[
  {
    "path": ".gitignore",
    "content": "*.suo\n/Installer/Content\n*bin\n*obj\n*Debug\n*.opensdf\n*.sdf\n*.blend1\n*.blend2\nThumbs.db\n/packages\nSteam/*.manifest\nSteam/*.manifest.txt\nSteam/*.log\nSteam/*.csd\nSteam/*.csm\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"Game\"]\n\tpath = Lemma/Game\n\turl = git@bitbucket.org:etodd/lemma-game-assets.git\n[submodule \"LemmaAnalytics\"]\n\tpath = LemmaAnalytics\n\turl = git@bitbucket.org:etodd/lemmaanalytics.git\n[submodule \"SharpZipLib\"]\n\tpath = SharpZipLib\n\turl = git@github.com:etodd/SharpZipLib.git\n[submodule \"Steamworks.NET\"]\n\tpath = Steamworks.NET\n\turl = git@github.com:etodd/Steamworks.NET.git\n\tignore = dirty"
  },
  {
    "path": "BEPUphysics/BEPUphysics.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <ProjectGuid>{2A9D2227-78D7-4804-B6D1-560BB43AE911}</ProjectGuid>\n    <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>BEPUphysics</RootNamespace>\n    <AssemblyName>BEPUphysics</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <TargetFrameworkProfile>Client</TargetFrameworkProfile>\n    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>\n    <XnaPlatform>Windows</XnaPlatform>\n    <XnaProfile>HiDef</XnaProfile>\n    <XnaCrossPlatformGroupID>7370a280-2dc9-49be-8ea9-7b6a817e142c</XnaCrossPlatformGroupID>\n    <XnaOutputType>Library</XnaOutputType>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|x86' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\x86\\Debug</OutputPath>\n    <DefineConstants>TRACE;DEBUG;WINDOWS;ALLOWUNSAFE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoStdLib>true</NoStdLib>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <PlatformTarget>x86</PlatformTarget>\n    <XnaCompressContent>false</XnaCompressContent>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|x86' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\x86\\Release</OutputPath>\n    <DefineConstants>WINDOWS;ALLOWUNSAFE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoStdLib>true</NoStdLib>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <PlatformTarget>x86</PlatformTarget>\n    <XnaCompressContent>true</XnaCompressContent>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <DocumentationFile>bin\\x86\\Release\\BEPUphysics.XML</DocumentationFile>\n    <DebugSymbols>true</DebugSymbols>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>strongNameKey.snk</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"Microsoft.Xna.Framework.Video, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"Microsoft.Xna.Framework.Avatar, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"Microsoft.Xna.Framework.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"Microsoft.Xna.Framework.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"mscorlib\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"System\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"System.Xml\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"System.Core\">\n      <RequiredTargetFramework>4.0</RequiredTargetFramework>\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"System.Net\">\n      <Private>False</Private>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"BroadPhaseSystems\\BroadPhase.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\BroadPhaseEntry.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\BroadPhaseOverlap.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\BruteForce.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\Hierarchies\\DynamicHierarchy.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\Hierarchies\\DynamicHierarchyNode.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\Hierarchies\\DynamicHierarchyQueryAccelerator.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\IBoundingBoxOwner.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\IBroadPhaseEntryOwner.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\IQueryAccelerator.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\SortAndSweep\\Grid2DEntry.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\SortAndSweep\\Grid2DSortAndSweep.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\SortAndSweep\\Grid2DSortAndSweepQueryAccelerator.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\SortAndSweep\\GridCell2D.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\SortAndSweep\\SortAndSweep1D.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\SortAndSweep\\Testing\\SortAndSweep3D.cs\" />\n    <Compile Include=\"BroadPhaseSystems\\SortAndSweep\\SortedGrid2DSet.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\StaticGroup.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\StaticCollidable.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\Events\\CompoundEventManager.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\Events\\IContactEventTriggerer.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\Events\\IEntryEventTriggerer.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\MobileCollidables\\CompoundHelper.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\MobileCollidables\\MobileMeshCollidable.cs\" />\n    <Compile Include=\"CollisionRuleManagement\\ICollisionRulesOwner.cs\" />\n    <Compile Include=\"CollisionShapes\\StaticGroupShape.cs\" />\n    <Compile Include=\"CollisionShapes\\MobileMeshShape.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\TrianglePairTester.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\TriangleSpherePairTester.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\MPRToolbox.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\BoxSphereContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\MobileMeshTriangleContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\MobileMeshSphereContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\MobileMeshContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\InstancedMeshSphereContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\InstancedMeshContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\StaticMeshConvexContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\StaticMeshContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\TerrainConvexContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\SphereContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\MobileMeshConvexContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\TerrainSphereContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\TriangleTrianglePairTester.cs\" />\n    <Compile Include=\"DataStructures\\BoundingBoxTree.cs\" />\n    <Compile Include=\"DataStructures\\MeshBoundingBoxTree.cs\" />\n    <Compile Include=\"DataStructures\\MeshBoundingBoxTreeData.cs\" />\n    <Compile Include=\"DataStructures\\StaticMeshData.cs\" />\n    <Compile Include=\"DataStructures\\TransformableMeshData.cs\" />\n    <Compile Include=\"DataStructures\\TreeOverlapPair.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\CollidableCollection.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\CollidablePair.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\EntityCollidableCollection.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\InstancedMesh.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\MobileCollidables\\CompoundCollidable.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\MobileCollidables\\CompoundHierarchy.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\MobileCollidables\\ConvexCollidable.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\MobileCollidables\\EntityCollidable.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\MobileCollidables\\TriangleCollidable.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\BoxShape.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\CapsuleShape.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\ConeShape.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\ConvexHullShape.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\ConvexShape.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\TransformableShape.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\MinkowskiSumShape.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\WrappedShape.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\CylinderShape.cs\" />\n    <Compile Include=\"CollisionShapes\\EntityShape.cs\" />\n    <Compile Include=\"CollisionShapes\\InstancedMeshShape.cs\" />\n    <Compile Include=\"CollisionShapes\\ShapeDistributionInformation.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\InertiaHelper.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\BoxBoxCollider.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\BoxSphereTester.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\TriangleConvexPairTester.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\GJK\\RaySimplex.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\SphereTester.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\BoxContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\InstancedMeshConvexContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\TerrainContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\TriangleMeshConvexContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\StaticMeshSphereContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\TriangleConvexContactManifold.cs\" />\n    <Compile Include=\"Constraints\\Collision\\ContactFrictionConstraint.cs\" />\n    <Compile Include=\"Constraints\\Collision\\ContactManifoldConstraint.cs\" />\n    <Compile Include=\"Constraints\\Collision\\ContactManifoldConstraintGroup.cs\" />\n    <Compile Include=\"Constraints\\Collision\\ContactPenetrationConstraint.cs\" />\n    <Compile Include=\"Constraints\\Collision\\ConvexContactManifoldConstraint.cs\" />\n    <Compile Include=\"Constraints\\Collision\\NonConvexContactManifoldConstraint.cs\" />\n    <Compile Include=\"Constraints\\Collision\\SlidingFrictionTwoAxis.cs\" />\n    <None Include=\"Constraints\\Collision\\Testing\\ContactPenetrationConstraintDETester.cs\" />\n    <None Include=\"Constraints\\Collision\\Testing\\DirectEnumerationSolver.cs\" />\n    <None Include=\"Constraints\\Collision\\Testing\\SlidingFrictionOneAxisConstraint.cs\" />\n    <None Include=\"Constraints\\Collision\\Testing\\SlidingFrictionTwoAxisObsolete.cs\" />\n    <Compile Include=\"Constraints\\Collision\\TwistFrictionConstraint.cs\" />\n    <Compile Include=\"Constraints\\EntitySolverUpdateable.cs\" />\n    <Compile Include=\"Constraints\\IJacobians.cs\" />\n    <Compile Include=\"Constraints\\ISolverSettings.cs\" />\n    <Compile Include=\"Constraints\\ISpringConstraint.cs\" />\n    <Compile Include=\"Constraints\\IXDImpulseConstraint.cs\" />\n    <Compile Include=\"Constraints\\JointTransform.cs\" />\n    <Compile Include=\"Constraints\\SingleEntity\\MaximumAngularVelocityConstraint.cs\" />\n    <Compile Include=\"Constraints\\SingleEntity\\MaximumLinearVelocityConstraint.cs\" />\n    <Compile Include=\"Constraints\\SingleEntity\\SingleEntityAngularMotor.cs\" />\n    <Compile Include=\"Constraints\\SingleEntity\\SingleEntityConstraint.cs\" />\n    <Compile Include=\"Constraints\\SingleEntity\\SingleEntityLinearMotor.cs\" />\n    <Compile Include=\"Constraints\\SolverGroups\\CustomizableSolverGroup.cs\" />\n    <Compile Include=\"Constraints\\SolverGroups\\LineSliderJoint.cs\" />\n    <Compile Include=\"Constraints\\SolverGroups\\PlaneSliderJoint.cs\" />\n    <Compile Include=\"Constraints\\SolverGroups\\PrismaticJoint.cs\" />\n    <Compile Include=\"Constraints\\SolverGroups\\RevoluteJoint.cs\" />\n    <Compile Include=\"Constraints\\SolverGroups\\SolverGroup.cs\" />\n    <Compile Include=\"Constraints\\SolverGroups\\SwivelHingeJoint.cs\" />\n    <Compile Include=\"Constraints\\SolverGroups\\UniversalJoint.cs\" />\n    <Compile Include=\"Constraints\\SolverGroups\\WeldJoint.cs\" />\n    <Compile Include=\"Constraints\\SolverSettings.cs\" />\n    <Compile Include=\"Constraints\\SpringSettings.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\JointLimits\\DistanceLimit.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\JointLimits\\EllipseSwingLimit.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\JointLimits\\JointLimit.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\JointLimits\\LinearAxisLimit.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\JointLimits\\RevoluteLimit.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\JointLimits\\SwingLimit.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\JointLimits\\TwistLimit.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Joints\\BallSocketJoint.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Joints\\DistanceJoint.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Joints\\Joint.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Joints\\NoRotationJoint.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Joints\\PointOnLineJoint.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Joints\\PointOnPlaneJoint.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Joints\\RevoluteAngularJoint.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Joints\\SwivelHingeAngularJoint.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Joints\\TwistJoint.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Motors\\AngularMotor.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Motors\\LinearAxisMotor.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Motors\\Motor.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Motors\\MotorSettings.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Motors\\RevoluteMotor.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\Motors\\TwistMotor.cs\" />\n    <Compile Include=\"Constraints\\TwoEntity\\TwoEntityConstraint.cs\" />\n    <Compile Include=\"DeactivationManagement\\DeactivationManager.cs\" />\n    <Compile Include=\"DeactivationManagement\\ISimulationIslandConnection.cs\" />\n    <Compile Include=\"DeactivationManagement\\ISimulationIslandConnectionOwner.cs\" />\n    <Compile Include=\"DeactivationManagement\\ISimulationIslandMemberOwner.cs\" />\n    <Compile Include=\"DeactivationManagement\\SimulationIsland.cs\" />\n    <Compile Include=\"DeactivationManagement\\SimulationIslandConnection.cs\" />\n    <Compile Include=\"DeactivationManagement\\SimulationIslandMember.cs\" />\n    <Compile Include=\"DeactivationManagement\\SimulationIslandMemberList.cs\" />\n    <Compile Include=\"Entities\\EntitySolverUpdateableCollection.cs\" />\n    <Compile Include=\"Entities\\EntityConstraintCollection.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\Box.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\Capsule.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\CompoundBody.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\Cone.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\ConvexHull.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\MobileMesh.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\Cylinder.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\MinkowskiSum.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\Sphere.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\TransformableEntity.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\Triangle.cs\" />\n    <Compile Include=\"Entities\\Prefabs\\WrappedBody.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\CompoundMobileMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\ContactCollection.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\ContactInformation.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\ConvexPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\CompoundGroupPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\ConvexConstraintPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\DetectorVolumeMobileMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\DetectorVolumeCompoundPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\DetectorVolumeGroupPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\DetectorVolumeConvexPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\DetectorVolumePairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\IDetectorVolumePairHandlerParent.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\StaticGroupCompoundPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\StaticGroupMobileMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\StaticGroupConvexPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\StaticGroupPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\MobileMeshTerrainPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\MobileMeshInstancedMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\MobileMeshTrianglePairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\MobileMeshMobileMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\MeshGroupPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\MobileMeshStaticMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\MobileMeshMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\MobileMeshSpherePairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\MobileMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\InstancedMeshSpherePairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\InstancedMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\StaticMeshSpherePairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\StaticMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\TerrainPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\TerrainSpherePairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\GroupPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\StandardPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\MobileMeshConvexPairHandler.cs\" />\n    <Compile Include=\"PhysicsChecker.cs\" />\n    <Compile Include=\"PhysicsResources.cs\" />\n    <Compile Include=\"PositionUpdating\\ContinuousPositionUpdater.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\Events\\ContactEventManager.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\Events\\EntryEventManager.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\Terrain.cs\" />\n    <Compile Include=\"Settings\\CollisionResponseSettings.cs\" />\n    <Compile Include=\"Settings\\MotionSettings.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\NarrowPhaseHelper.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\CompoundConvexPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\BoxPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\BoxSpherePairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\CompoundPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\CompoundStaticMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\CompoundTerrainPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\CompoundInstancedMeshPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\InstancedMeshConvexPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\TerrainConvexPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\StaticMeshConvexPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\TriangleConvexPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\SpherePairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\GeneralConvexPairHandler.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\IPairHandlerParent.cs\" />\n    <Compile Include=\"DataStructures\\TriangleMesh.cs\" />\n    <Compile Include=\"EntityStateManagement\\MotionState.cs\" />\n    <Compile Include=\"RayCastResult.cs\" />\n    <Compile Include=\"OtherSpaceStages\\BoundingBoxUpdater.cs\" />\n    <Compile Include=\"OtherSpaceStages\\DeferredEventDispatcher.cs\" />\n    <Compile Include=\"OtherSpaceStages\\ForceUpdater.cs\" />\n    <Compile Include=\"EntityStateManagement\\BufferedStatesManager.cs\" />\n    <Compile Include=\"CollisionRuleManagement\\CollisionGroup.cs\" />\n    <Compile Include=\"CollisionRuleManagement\\CollisionGroupPair.cs\" />\n    <Compile Include=\"CollisionRuleManagement\\CollisionRule.cs\" />\n    <Compile Include=\"CollisionRuleManagement\\CollisionRules.cs\" />\n    <Compile Include=\"CollisionShapes\\CollisionShape.cs\" />\n    <Compile Include=\"CollisionShapes\\CompoundShape.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\TriangleShape.cs\" />\n    <Compile Include=\"CollisionShapes\\ConvexShapes\\SphereShape.cs\" />\n    <Compile Include=\"CollisionShapes\\StaticMeshShape.cs\" />\n    <Compile Include=\"CollisionShapes\\TerrainShape.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\GJK\\SimpleSimplex.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\GJK\\GJKToolbox.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\GJK\\PairSimplex.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\MinkowskiToolbox.cs\" />\n    <Compile Include=\"CollisionTests\\Contact.cs\" />\n    <Compile Include=\"CollisionTests\\ContactData.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\ContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\ContactReducer.cs\" />\n    <Compile Include=\"CollisionTests\\ContactSupplementData.cs\" />\n    <Compile Include=\"CollisionTests\\Manifolds\\GeneralConvexContactManifold.cs\" />\n    <Compile Include=\"CollisionTests\\ContactRefresher.cs\" />\n    <Compile Include=\"CollisionTests\\CollisionAlgorithms\\GeneralConvexPairTester.cs\" />\n    <Compile Include=\"Entities\\Entity.cs\" />\n    <Compile Include=\"Entities\\EntityBase.cs\" />\n    <Compile Include=\"Entities\\MorphableEntity.cs\" />\n    <Compile Include=\"EntityStateManagement\\BufferedStatesAccessor.cs\" />\n    <Compile Include=\"EntityStateManagement\\InterpolatedStatesAccessor.cs\" />\n    <Compile Include=\"EntityStateManagement\\EntityBufferedStates.cs\" />\n    <Compile Include=\"EntityStateManagement\\EntityStateReadBuffers.cs\" />\n    <Compile Include=\"EntityStateManagement\\EntityStateWriteBuffer.cs\" />\n    <Compile Include=\"PositionUpdating\\ICCDPositionUpdateable.cs\" />\n    <Compile Include=\"OtherSpaceStages\\IDeferredEventCreator.cs\" />\n    <Compile Include=\"OtherSpaceStages\\IDeferredEventCreatorOwner.cs\" />\n    <Compile Include=\"PositionUpdating\\IPositionUpdateable.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\MobileCollidables\\MobileCollidable.cs\" />\n    <Compile Include=\"PositionUpdating\\PositionUpdater.cs\" />\n    <Compile Include=\"EntityStateManagement\\InterpolatedStatesManager.cs\" />\n    <Compile Include=\"MultithreadedProcessingStage.cs\" />\n    <Compile Include=\"Materials\\Material.cs\" />\n    <Compile Include=\"Materials\\MaterialManager.cs\" />\n    <Compile Include=\"Materials\\MaterialPair.cs\" />\n    <Compile Include=\"Materials\\InteractionProperties.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\Events\\CollisionEventTypes.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\CollidablePairHandler.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\DetectorVolume.cs\" />\n    <Compile Include=\"UpdateableSystems\\ForceFields\\BoundingSphereForceFieldShape.cs\" />\n    <Compile Include=\"Vehicle\\CylinderCastWheelShape.cs\" />\n    <Compile Include=\"Vehicle\\WheelFrictionBlender.cs\" />\n    <Compile Include=\"Settings\\CollisionDetectionSettings.cs\" />\n    <Compile Include=\"SolverSystems\\SolverUpdateable.cs\" />\n    <Compile Include=\"ISpace.cs\" />\n    <Compile Include=\"ISpaceObject.cs\" />\n    <Compile Include=\"OtherSpaceStages\\IForceUpdateable.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\Collidable.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\Pairs\\NarrowPhasePair.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\NarrowPhase.cs\" />\n    <Compile Include=\"NarrowPhaseSystems\\NarrowPhasePairFactory.cs\" />\n    <Compile Include=\"Paths\\CardinalSpline3D.cs\" />\n    <Compile Include=\"Paths\\ConstantAngularSpeedCurve.cs\" />\n    <Compile Include=\"Paths\\ConstantLinearSpeedCurve.cs\" />\n    <Compile Include=\"Paths\\ConstantSpeedCurve.cs\" />\n    <Compile Include=\"Paths\\Curve.cs\" />\n    <Compile Include=\"Paths\\CurveControlPoint.cs\" />\n    <Compile Include=\"Paths\\CurveControlPointList.cs\" />\n    <Compile Include=\"Paths\\CurveEndpointBehavior.cs\" />\n    <Compile Include=\"Paths\\FiniteDifferenceSpline3D.cs\" />\n    <Compile Include=\"Paths\\HermiteCurve3D.cs\" />\n    <Compile Include=\"Paths\\LinearInterpolationCurve3D.cs\" />\n    <Compile Include=\"Paths\\Path following\\EntityMover.cs\" />\n    <Compile Include=\"Paths\\Path following\\EntityRotator.cs\" />\n    <Compile Include=\"Paths\\Path.cs\" />\n    <Compile Include=\"Paths\\QuaternionSlerpCurve.cs\" />\n    <Compile Include=\"Paths\\SpeedControlledCurve.cs\" />\n    <Compile Include=\"Paths\\StepCurve1D.cs\" />\n    <Compile Include=\"Paths\\VariableAngularSpeedCurve.cs\" />\n    <Compile Include=\"Paths\\VariableLinearSpeedCurve.cs\" />\n    <Compile Include=\"Paths\\VariableSpeedCurve.cs\" />\n    <Compile Include=\"ProcessingStage.cs\" />\n    <Compile Include=\"SolverSystems\\Solver.cs\" />\n    <Compile Include=\"SolverSystems\\SolverUpdateableChange.cs\" />\n    <Compile Include=\"Space.cs\" />\n    <Compile Include=\"OtherSpaceStages\\SpaceObjectBuffer.cs\" />\n    <Compile Include=\"BroadPhaseEntries\\StaticMesh.cs\" />\n    <Compile Include=\"Threading\\IThreadManager.cs\" />\n    <Compile Include=\"Threading\\Modified Pool\\ParallelLoopManager.cs\" />\n    <Compile Include=\"Threading\\Modified Pool\\ParallelLoopWorker.cs\" />\n    <Compile Include=\"Threading\\Modified Pool\\SpecializedThreadManager.cs\" />\n    <Compile Include=\"Threading\\Modified Pool\\ThreadTaskManager.cs\" />\n    <Compile Include=\"Threading\\SimpleThreadManager.cs\" />\n    <Compile Include=\"Threading\\ThreadManagerTPL.cs\" />\n    <Compile Include=\"TimeStepSettings.cs\" />\n    <Compile Include=\"Materials\\IMaterialOwner.cs\" />\n    <Compile Include=\"UpdateableSystems\\CombinedUpdateable.cs\" />\n    <Compile Include=\"UpdateableSystems\\FluidVolume.cs\" />\n    <Compile Include=\"UpdateableSystems\\ForceFields\\BoundingBoxForceFieldShape.cs\" />\n    <Compile Include=\"UpdateableSystems\\ForceFields\\ForceField.cs\" />\n    <Compile Include=\"UpdateableSystems\\ForceFields\\ForceFieldShape.cs\" />\n    <Compile Include=\"UpdateableSystems\\ForceFields\\InfiniteForceFieldShape.cs\" />\n    <Compile Include=\"UpdateableSystems\\ForceFields\\VolumeForceFieldShape.cs\" />\n    <Compile Include=\"UpdateableSystems\\IBeforeNarrowPhaseUpdateable.cs\" />\n    <Compile Include=\"UpdateableSystems\\IBeforePositionUpdateUpdateable.cs\" />\n    <Compile Include=\"UpdateableSystems\\IBeforeSolverUpdateable.cs\" />\n    <Compile Include=\"UpdateableSystems\\IDuringForcesUpdateable.cs\" />\n    <Compile Include=\"UpdateableSystems\\IEndOfFrameUpdateable.cs\" />\n    <Compile Include=\"UpdateableSystems\\IEndOfTimeStepUpdateable.cs\" />\n    <Compile Include=\"UpdateableSystems\\ISpaceUpdateable.cs\" />\n    <Compile Include=\"UpdateableSystems\\Updateable.cs\" />\n    <Compile Include=\"UpdateableSystems\\UpdateableManager.cs\" />\n    <Compile Include=\"UpdateableSystems\\UpdateableManagers.cs\" />\n    <Compile Include=\"Vehicle\\RaycastWheelShape.cs\" />\n    <Compile Include=\"Vehicle\\Vehicle.cs\" />\n    <Compile Include=\"Vehicle\\Wheel.cs\" />\n    <Compile Include=\"Vehicle\\WheelBrake.cs\" />\n    <Compile Include=\"Vehicle\\WheelDrivingMotor.cs\" />\n    <Compile Include=\"Vehicle\\WheelShape.cs\" />\n    <Compile Include=\"Vehicle\\WheelSlidingFriction.cs\" />\n    <Compile Include=\"Vehicle\\WheelSuspension.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <None Include=\"strongNameKey.snk\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\BEPUutilities\\BEPUutilities.csproj\">\n      <Project>{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}</Project>\n      <Name>BEPUutilities</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\Microsoft\\XNA Game Studio\\Microsoft.Xna.GameStudio.targets\" />\n  <!--\n      To modify your build process, add your task inside one of the targets below and uncomment it. \n      Other similar extension points exist, see Microsoft.Common.targets.\n      <Target Name=\"BeforeBuild\">\n      </Target>\n      <Target Name=\"AfterBuild\">\n      </Target>\n    -->\n</Project>"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/BroadPhaseEntry.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseSystems;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\n\nnamespace BEPUphysics.BroadPhaseEntries\n{\n    /// <summary>\n    /// Superclass of all objects which live inside the broad phase.\n    /// The BroadPhase will generate pairs between BroadPhaseEntries.\n    /// </summary>\n    public abstract class BroadPhaseEntry : IBoundingBoxOwner, ICollisionRulesOwner\n    {\n        internal int hashCode;\n        protected BroadPhaseEntry()\n        {\n            CollisionRules = new CollisionRules();\n            collisionRulesUpdatedDelegate = CollisionRulesUpdated;\n\n            hashCode = (int)(base.GetHashCode() * 0xd8163841);\n        }\n\n        /// <summary>\n        /// Gets the broad phase to which this broad phase entry belongs.\n        /// </summary>\n        public BroadPhase BroadPhase\n        {\n            get;\n            internal set;\n        }\n\n        /// <summary>\n        /// Gets the object's hash code.\n        /// </summary>\n        /// <returns>Hash code for the object.</returns>\n        public override int GetHashCode()\n        {\n            return hashCode;\n        }\n\n        private Action collisionRulesUpdatedDelegate;\n        protected abstract void CollisionRulesUpdated();\n\n        protected internal BoundingBox boundingBox;\n        /// <summary>\n        /// Gets or sets the bounding box of the entry.\n        /// </summary>\n        public BoundingBox BoundingBox\n        {\n            get { return boundingBox; }\n            set\n            {\n                boundingBox = value;\n            }\n        }\n\n        protected internal abstract bool IsActive { get; }\n\n        internal CollisionRules collisionRules;\n        /// <summary>\n        /// Gets the entry's collision rules.\n        /// </summary>\n        public CollisionRules CollisionRules\n        {\n            get { return collisionRules; }\n            set\n            {\n                if (collisionRules != value)\n                {\n                    if (collisionRules != null)\n                        collisionRules.CollisionRulesChanged -= collisionRulesUpdatedDelegate;\n                    collisionRules = value;\n                    if (collisionRules != null)\n                        collisionRules.CollisionRulesChanged += collisionRulesUpdatedDelegate;\n                    CollisionRulesUpdated();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Tests a ray against the entry.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the entry, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public abstract bool RayCast(Ray ray, float maximumLength, out RayHit rayHit);\n\n        /// <summary>\n        /// Tests a ray against the entry.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the entry, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public virtual bool RayCast(Ray ray, float maximumLength, Func<BroadPhaseEntry, bool> filter, out RayHit rayHit)\n        {\n            if (filter(this))\n                return RayCast(ray, maximumLength, out rayHit);\n            rayHit = new RayHit();\n            return false;\n        }\n\n\n\n        /// <summary>\n        /// Sweeps a convex shape against the entry.\n        /// </summary>\n        /// <param name=\"castShape\">Swept shape.</param>\n        /// <param name=\"startingTransform\">Beginning location and orientation of the cast shape.</param>\n        /// <param name=\"sweep\">Sweep motion to apply to the cast shape.</param>\n        /// <param name=\"hit\">Hit data of the cast on the entry, if any.</param>\n        /// <returns>Whether or not the cast hit the entry.</returns>\n        public abstract bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayHit hit);\n\n        /// <summary>\n        /// Sweeps a convex shape against the entry.\n        /// </summary>\n        /// <param name=\"castShape\">Swept shape.</param>\n        /// <param name=\"startingTransform\">Beginning location and orientation of the cast shape.</param>\n        /// <param name=\"sweep\">Sweep motion to apply to the cast shape.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <param name=\"hit\">Hit data of the cast on the entry, if any.</param>\n        /// <returns>Whether or not the cast hit the entry.</returns>\n        public virtual bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, Func<BroadPhaseEntry, bool> filter, out RayHit hit)\n        {\n            if (filter(this))\n                return ConvexCast(castShape, ref startingTransform, ref sweep, out hit);\n            hit = new RayHit();\n            return false;\n        }\n\n        /// <summary>\n        /// Updates the bounding box to the current state of the entry.\n        /// </summary>\n        public abstract void UpdateBoundingBox();\n\n        \n        /// <summary>\n        /// Gets or sets the user data associated with this entry.\n        /// </summary>\n        public object Tag { get; set; }\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/Collidable.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.Events;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.CollisionShapes;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing BEPUphysics.CollisionRuleManagement;\nusing System;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.BroadPhaseEntries\n{\n    ///<summary>\n    /// Superclass of objects living in the collision detection pipeline\n    /// that can result in contacts.\n    ///</summary>\n    public abstract class Collidable : BroadPhaseEntry\n    {\n        protected Collidable()\n        {\n            shapeChangedDelegate = OnShapeChanged;\n        }\n\n\n\n        internal CollisionShape shape; //Having this non-private allows for some very special-casey stuff; see TriangleShape initialization.\n        ///<summary>\n        /// Gets the shape used by the collidable.\n        ///</summary>\n        public CollisionShape Shape\n        {\n            get\n            {\n                return shape;\n            }\n            protected set\n            {\n                if (shape != null)\n                    shape.ShapeChanged -= shapeChangedDelegate;\n                shape = value;\n                if (shape != null)\n                    shape.ShapeChanged += shapeChangedDelegate;\n                OnShapeChanged(shape);\n\n                //TODO: Watch out for unwanted references in the delegate lists.\n            }\n        }\n\n        protected internal abstract IContactEventTriggerer EventTriggerer { get; }\n\n\n\n        /// <summary>\n        /// Gets or sets whether or not to ignore shape changes.  When true, changing the collision shape will not force the collidable to perform any updates.\n        /// </summary>\n        public bool IgnoreShapeChanges { get; set; }\n\n        Action<CollisionShape> shapeChangedDelegate;\n        protected virtual void OnShapeChanged(CollisionShape collisionShape)\n        {\n        }\n\n\n        internal RawList<CollidablePairHandler> pairs = new RawList<CollidablePairHandler>();\n        ///<summary>\n        /// Gets the list of pairs associated with the collidable.\n        /// These pairs are found by the broad phase and are managed by the narrow phase;\n        /// they can contain other collidables, entities, and contacts.\n        ///</summary>\n        public ReadOnlyList<CollidablePairHandler> Pairs\n        {\n            get\n            {\n                return new ReadOnlyList<CollidablePairHandler>(pairs);\n            }\n        }\n\n        ///<summary>\n        /// Gets a list of all other collidables that this collidable overlaps.\n        ///</summary>\n        public CollidableCollection OverlappedCollidables\n        {\n            get\n            {\n                return new CollidableCollection(this);\n            }\n        }\n\n        protected override void CollisionRulesUpdated()\n        {\n            for (int i = 0; i < pairs.Count; i++)\n            {\n                pairs[i].CollisionRule = CollisionRules.CollisionRuleCalculator(pairs[i].BroadPhaseOverlap.entryA, pairs[i].BroadPhaseOverlap.entryB);\n            }\n        }\n\n\n\n        internal void AddPair(CollidablePairHandler pair, ref int index)\n        {\n            index = pairs.Count;\n            pairs.Add(pair);\n        }\n\n        internal void RemovePair(CollidablePairHandler pair, ref int index)\n        {\n            if (pairs.Count > index)\n            {\n                pairs.FastRemoveAt(index);\n                if (pairs.Count > index)\n                {\n                    var endPair = pairs.Elements[index];\n                    if (endPair.CollidableA == this)\n                        endPair.listIndexA = index;\n                    else\n                        endPair.listIndexB = index;\n                }\n            }\n            index = -1;\n        }\n\n\n    }\n\n\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/CollidableCollection.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace BEPUphysics.BroadPhaseEntries\n{\n    ///<summary>\n    /// List of collidable objects overlapping another collidable.\n    ///</summary>\n    public struct CollidableCollection : IList<Collidable>\n    {\n\n        ///<summary>\n        /// Enumerator for the CollidableCollection.\n        ///</summary>\n        public struct Enumerator : IEnumerator<Collidable>\n        {\n            CollidableCollection collection;\n            int index;\n            ///<summary>\n            /// Constructs an enumerator.\n            ///</summary>\n            ///<param name=\"collection\">Collection to which the enumerator belongs.</param>\n            public Enumerator(CollidableCollection collection)\n            {\n                this.collection = collection;\n                index = -1;\n            }\n\n            /// <summary>\n            /// Gets the element in the collection at the current position of the enumerator.\n            /// </summary>\n            /// <returns>\n            /// The element in the collection at the current position of the enumerator.\n            /// </returns>\n            public Collidable Current\n            {\n                get { return collection[index]; }\n            }\n\n            /// <summary>\n            /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n            /// </summary>\n            /// <filterpriority>2</filterpriority>\n            public void Dispose()\n            {\n            }\n\n            object System.Collections.IEnumerator.Current\n            {\n                get { return Current; }\n            }\n\n            /// <summary>\n            /// Advances the enumerator to the next element of the collection.\n            /// </summary>\n            /// <returns>\n            /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n            /// </returns>\n            /// <exception>The collection was modified after the enumerator was created.\n            ///   <cref>T:System.InvalidOperationException</cref>\n            /// </exception><filterpriority>2</filterpriority>\n            public bool MoveNext()\n            {\n                return ++index < collection.Count;\n            }\n\n            /// <summary>\n            /// Sets the enumerator to its initial position, which is before the first element in the collection.\n            /// </summary>\n            /// <exception>The collection was modified after the enumerator was created.\n            ///   <cref>T:System.InvalidOperationException</cref>\n            /// </exception><filterpriority>2</filterpriority>\n            public void Reset()\n            {\n                index = -1;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new CollidableCollection.\n        ///</summary>\n        ///<param name=\"owner\">The collidable to which the collection belongs.</param>\n        public CollidableCollection(Collidable owner)\n        {\n            this.owner = owner;\n        }\n\n        internal Collidable owner;\n\n\n        ///<summary>\n        /// Gets an enumerator which can be used to enumerate over the list.\n        ///</summary>\n        ///<returns>Enumerator for the collection.</returns>\n        public Enumerator GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        IEnumerator<Collidable> IEnumerable<Collidable>.GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n\n        /// <summary>\n        /// Determines the index of a specific item in the <see>\n        ///                                                  <cref>T:System.Collections.Generic.IList`1</cref>\n        ///                                                </see> .\n        /// </summary>\n        /// <returns>\n        /// The index of <paramref name=\"item\"/> if found in the list; otherwise, -1.\n        /// </returns>\n        /// <param name=\"item\">The object to locate in the <see>\n        ///                                                  <cref>T:System.Collections.Generic.IList`1</cref>\n        ///                                                </see> .</param>\n        public int IndexOf(Collidable item)\n        {\n            for (int i = 0; i < Count; i++)\n            {\n                if (item == this[i])\n                    return i;\n            }\n            return -1;\n        }\n\n\n        /// <summary>\n        /// Gets or sets the element at the specified index.\n        /// </summary>\n        /// <returns>\n        /// The element at the specified index.\n        /// </returns>\n        /// <param name=\"index\">The zero-based index of the element to get or set.</param><exception>\n        ///                                                                                 <cref>T:System.ArgumentOutOfRangeException</cref>\n        ///                                                                                 <paramref name=\"index\"/> is not a valid index in the <see>\n        ///                                                                                                                                        <cref>T:System.Collections.Generic.IList`1</cref>\n        ///                                                                                                                                      </see>\n        ///                                                                                 .</exception><exception>The property is set and the\n        ///                                                                                                <cref>T:System.NotSupportedException</cref>\n        ///                                                                                                <see>\n        ///                                                                                                  <cref>T:System.Collections.Generic.IList`1</cref>\n        ///                                                                                                </see>\n        ///                                                                                                is read-only.</exception>\n        public Collidable this[int index]\n        {\n            get\n            {\n                //It's guaranteed to be a CollisionInformation, because it's a member of a CollidablePairHandler.\n                return (Collidable)(owner.pairs[index].broadPhaseOverlap.entryA == owner ? owner.pairs[index].broadPhaseOverlap.entryB : owner.pairs[index].broadPhaseOverlap.entryA);\n            }\n            set\n            {\n                throw new NotSupportedException();\n            }\n        }\n\n\n        /// <summary>\n        /// Determines whether the <see>\n        ///                          <cref>T:System.Collections.Generic.ICollection`1</cref>\n        ///                        </see> contains a specific value.\n        /// </summary>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> is found in the <see>\n        ///                                                   <cref>T:System.Collections.Generic.ICollection`1</cref>\n        ///                                                 </see> ; otherwise, false.\n        /// </returns>\n        /// <param name=\"item\">The object to locate in the <see>\n        ///                                                  <cref>T:System.Collections.Generic.ICollection`1</cref>\n        ///                                                </see> .</param>\n        public bool Contains(Collidable item)\n        {\n            for (int i = 0; i < Count; i++)\n            {\n                if (item == this[i])\n                    return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Copies the elements of the <see>\n        ///                              <cref>T:System.Collections.Generic.ICollection`1</cref>\n        ///                            </see> to an <see>\n        ///                                           <cref>T:System.Array</cref>\n        ///                                         </see> , starting at a particular <see>\n        ///                                                                             <cref>T:System.Array</cref>\n        ///                                                                           </see> index.\n        /// </summary>\n        /// <param name=\"array\">The one-dimensional <see>\n        ///                                           <cref>T:System.Array</cref>\n        ///                                         </see> that is the destination of the elements copied from <see>\n        ///                                                                                                      <cref>T:System.Collections.Generic.ICollection`1</cref>\n        ///                                                                                                    </see> . The <see>\n        ///                                                                                                                   <cref>T:System.Array</cref>\n        ///                                                                                                                 </see> must have zero-based indexing.</param><param name=\"arrayIndex\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param><exception cref=\"T:System.ArgumentNullException\"><paramref name=\"array\"/> is null.</exception><exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"arrayIndex\"/> is less than 0.</exception><exception cref=\"T:System.ArgumentException\"><paramref name=\"array\"/> is multidimensional.-or-The number of elements in the source <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is greater than the available space from <paramref name=\"arrayIndex\"/> to the end of the destination <paramref name=\"array\"/>.-or-Type cannot be cast automatically to the type of the destination <paramref name=\"array\"/>.</exception>\n        public void CopyTo(Collidable[] array, int arrayIndex)\n        {\n            for (int i = 0; i < Count; i++)\n            {\n                array[arrayIndex + i] = this[i];\n            }\n        }\n\n        /// <summary>\n        /// Gets the number of elements contained in the <see>\n        ///                                                <cref>T:System.Collections.Generic.ICollection`1</cref>\n        ///                                              </see> .\n        /// </summary>\n        /// <returns>\n        /// The number of elements contained in the <see>\n        ///                                           <cref>T:System.Collections.Generic.ICollection`1</cref>\n        ///                                         </see> .\n        /// </returns>\n        public int Count\n        {\n            get { return owner.pairs.Count; }\n        }\n\n        bool ICollection<Collidable>.IsReadOnly\n        {\n            get { return true; }\n        }\n\n        bool ICollection<Collidable>.Remove(Collidable item)\n        {\n            throw new NotSupportedException();\n        }\n\n        void ICollection<Collidable>.Add(Collidable item)\n        {\n            throw new NotSupportedException();\n        }\n\n        void ICollection<Collidable>.Clear()\n        {\n            throw new NotSupportedException();\n        }\n\n        void IList<Collidable>.Insert(int index, Collidable item)\n        {\n            throw new NotSupportedException();\n        }\n\n        void IList<Collidable>.RemoveAt(int index)\n        {\n            throw new NotSupportedException();\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/CollidablePair.cs",
    "content": "﻿using System;\n\nnamespace BEPUphysics.BroadPhaseEntries\n{\n    ///<summary>\n    /// Pair of collidables.\n    ///</summary>\n    public struct CollidablePair : IEquatable<CollidablePair>\n    {\n        internal Collidable collidableA;\n        ///<summary>\n        /// First collidable in the pair.\n        ///</summary>\n        public Collidable CollidableA\n        {\n            get { return collidableA; }\n        }\n\n        internal Collidable collidableB;\n        /// <summary>\n        /// Second collidable in the pair.\n        /// </summary>\n        public Collidable CollidableB\n        {\n            get { return collidableB; }\n        }\n\n        ///<summary>\n        /// Constructs a new collidable pair.\n        ///</summary>\n        ///<param name=\"collidableA\">First collidable in the pair.</param>\n        ///<param name=\"collidableB\">Second collidable in the pair.</param>\n        public CollidablePair(Collidable collidableA, Collidable collidableB)\n        {\n            this.collidableA = collidableA;\n            this.collidableB = collidableB;\n        }\n\n\n        /// <summary>\n        /// Returns the hash code for this instance.\n        /// </summary>\n        /// <returns>\n        /// A 32-bit signed integer that is the hash code for this instance.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            //TODO: Use old prime-based system?\n            return collidableA.GetHashCode() + collidableB.GetHashCode();\n        }\n\n\n\n        #region IEquatable<BroadPhaseOverlap> Members\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public bool Equals(CollidablePair other)\n        {\n            return (other.collidableA == collidableA && other.collidableB == collidableB) || (other.collidableA == collidableB && other.collidableB == collidableA);\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/DetectorVolume.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUphysics.DataStructures;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.Entities;\nusing BEPUphysics.OtherSpaceStages;\nusing BEPUutilities;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing RigidTransform = BEPUutilities.RigidTransform;\n\nnamespace BEPUphysics.BroadPhaseEntries\n{\n    /// <summary>\n    /// Stores flags regarding an object's degree of inclusion in a volume.\n    /// </summary>\n    public struct ContainmentState\n    {\n        /// <summary>\n        /// Whether or not the object is fully contained.\n        /// </summary>\n        public bool IsContained;\n\n        /// <summary>\n        /// Whether or not the object is partially or fully contained.\n        /// </summary>\n        public bool IsTouching;\n\n        /// <summary>\n        /// Whether or not the entity associated with this state has been refreshed during the last update.\n        /// </summary>\n        internal bool StaleState;\n\n        /// <summary>\n        /// Constructs a new ContainmentState.\n        /// </summary>\n        /// <param name=\"touching\">Whether or not the object is partially or fully contained.</param>\n        /// <param name=\"contained\">Whether or not the object is fully contained.</param>\n        public ContainmentState(bool touching, bool contained)\n        {\n            IsTouching = touching;\n            IsContained = contained;\n            StaleState = false;\n        }\n        /// <summary>\n        /// Constructs a new ContainmentState.\n        /// </summary>\n        /// <param name=\"touching\">Whether or not the object is partially or fully contained.</param>\n        /// <param name=\"contained\">Whether or not the object is fully contained.</param>\n        /// <param name=\"stale\">Whether or not the entity associated with this state has been refreshed in the previous update.</param>\n        internal ContainmentState(bool touching, bool contained, bool stale)\n        {\n            IsTouching = touching;\n            IsContained = contained;\n            StaleState = stale;\n        }\n\n\n    }\n\n    /// <summary>\n    /// Manages the detection of entities within an arbitrary closed triangle mesh.\n    /// </summary>\n    public class DetectorVolume : BroadPhaseEntry, ISpaceObject, IDeferredEventCreator\n    {\n\n        internal Dictionary<Entity, DetectorVolumePairHandler> pairs = new Dictionary<Entity, DetectorVolumePairHandler>();\n        /// <summary>\n        /// Gets the list of pairs associated with the detector volume.\n        /// </summary>\n        public ReadOnlyDictionary<Entity, DetectorVolumePairHandler> Pairs\n        {\n            get\n            {\n                return new ReadOnlyDictionary<Entity, DetectorVolumePairHandler>(pairs);\n            }\n        }\n\n\n        TriangleMesh triangleMesh;\n        /// <summary>\n        /// Gets or sets the triangle mesh data and acceleration structure.  Must be a closed mesh with consistent winding.\n        /// </summary>\n        public TriangleMesh TriangleMesh\n        {\n            get\n            {\n                return triangleMesh;\n            }\n            set\n            {\n                triangleMesh = value;\n                UpdateBoundingBox();\n                Reinitialize();\n            }\n        }\n\n\n\n\n\n\n        /// <summary>\n        /// Creates a detector volume.\n        /// </summary>\n        /// <param name=\"triangleMesh\">Closed and consistently wound mesh defining the volume.</param>\n        public DetectorVolume(TriangleMesh triangleMesh)\n        {\n            TriangleMesh = triangleMesh;\n            UpdateBoundingBox();\n        }\n\n\n        \n        /// <summary>\n        /// Fires when an entity comes into contact with the volume.\n        /// </summary>\n        public event EntityBeginsTouchingVolumeEventHandler EntityBeganTouching;\n\n        /// <summary>\n        /// Fires when an entity ceases to intersect the volume.\n        /// </summary>\n        public event EntityStopsTouchingVolumeEventHandler EntityStoppedTouching;\n\n        /// <summary>\n        /// Fires when an entity becomes fully engulfed by a volume.\n        /// </summary>\n        public event VolumeBeginsContainingEntityEventHandler VolumeBeganContainingEntity;\n\n        /// <summary>\n        /// Fires when an entity ceases to be fully engulfed by a volume.\n        /// </summary>\n        public event VolumeStopsContainingEntityEventHandler VolumeStoppedContainingEntity;\n\n\n        \n\n        private ISpace space;\n        ISpace ISpaceObject.Space\n        {\n            get\n            {\n                return space;\n            }\n            set\n            {\n                space = value;\n            }\n        }\n\n        ///<summary>\n        /// Space that owns the detector volume.\n        ///</summary>\n        public ISpace Space\n        {\n            get\n            {\n                return space;\n            }\n        }\n\n        private bool innerFacingIsClockwise;\n\n        /// <summary>\n        /// Determines if a point is contained by the detector volume.\n        /// </summary>\n        /// <param name=\"point\">Point to check for containment.</param>\n        /// <returns>Whether or not the point is contained by the detector volume.</returns>\n        public bool IsPointContained(Vector3 point)\n        {\n            var triangles = CommonResources.GetIntList();\n            bool contained = IsPointContained(ref point, triangles);\n            CommonResources.GiveBack(triangles);\n            return contained;\n        }\n\n        internal bool IsPointContained(ref Vector3 point, RawList<int> triangles)\n        {\n            Vector3 rayDirection;\n            //Point from the approximate center of the mesh outwards.\n            //This is a cheap way to reduce the number of unnecessary checks when objects are external to the mesh.\n            Vector3.Add(ref boundingBox.Max, ref boundingBox.Min, out rayDirection);\n            Vector3.Multiply(ref rayDirection, .5f, out rayDirection);\n            Vector3.Subtract(ref point, ref rayDirection, out rayDirection);\n            //If the point is right in the middle, we'll need a backup.\n            if (rayDirection.LengthSquared() < .01f)\n                rayDirection = Vector3.Up;\n\n            var ray = new Ray(point, rayDirection);\n            triangleMesh.Tree.GetOverlaps(ray, triangles);\n\n            float minimumT = float.MaxValue;\n            bool minimumIsClockwise = false;\n\n            for (int i = 0; i < triangles.Count; i++)\n            {\n                Vector3 a, b, c;\n                triangleMesh.Data.GetTriangle(triangles.Elements[i], out a, out b, out c);\n\n                RayHit hit;\n                bool hitClockwise;\n                if (Toolbox.FindRayTriangleIntersection(ref ray, float.MaxValue, ref a, ref b, ref c, out hitClockwise, out hit))\n                {\n                    if (hit.T < minimumT)\n                    {\n                        minimumT = hit.T;\n                        minimumIsClockwise = hitClockwise;\n                    }\n                }\n            }\n\n            triangles.Clear();\n\n            //If the first hit is on the inner surface, then the ray started inside the mesh.\n            return minimumT < float.MaxValue && minimumIsClockwise == innerFacingIsClockwise;\n        }\n\n        protected override void CollisionRulesUpdated()\n        {\n            foreach (var pair in pairs.Values)\n                pair.CollisionRule = CollisionRules.CollisionRuleCalculator(pair.BroadPhaseOverlap.entryA, pair.BroadPhaseOverlap.entryB);\n\n        }\n\n        protected internal override bool IsActive\n        {\n            get { return false; }\n        }\n\n        public override bool RayCast(Ray ray, float maximumLength, out RayHit rayHit)\n        {\n            return triangleMesh.RayCast(ray, maximumLength, TriangleSidedness.DoubleSided, out rayHit);\n        }\n\n        public override bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayHit hit)\n        {\n            hit = new RayHit();\n            BoundingBox boundingBox;\n            castShape.GetSweptBoundingBox(ref startingTransform, ref sweep, out boundingBox);\n            var tri = PhysicsResources.GetTriangle();\n            var hitElements = CommonResources.GetIntList();\n            if (triangleMesh.Tree.GetOverlaps(boundingBox, hitElements))\n            {\n                hit.T = float.MaxValue;\n                for (int i = 0; i < hitElements.Count; i++)\n                {\n                    triangleMesh.Data.GetTriangle(hitElements[i], out tri.vA, out tri.vB, out tri.vC);\n                    Vector3 center;\n                    Vector3.Add(ref tri.vA, ref tri.vB, out center);\n                    Vector3.Add(ref center, ref tri.vC, out center);\n                    Vector3.Multiply(ref center, 1f / 3f, out center);\n                    Vector3.Subtract(ref tri.vA, ref center, out tri.vA);\n                    Vector3.Subtract(ref tri.vB, ref center, out tri.vB);\n                    Vector3.Subtract(ref tri.vC, ref center, out tri.vC);\n                    tri.maximumRadius = tri.vA.LengthSquared();\n                    float radius = tri.vB.LengthSquared();\n                    if (tri.maximumRadius < radius)\n                        tri.maximumRadius = radius;\n                    radius = tri.vC.LengthSquared();\n                    if (tri.maximumRadius < radius)\n                        tri.maximumRadius = radius;\n                    tri.maximumRadius = (float)Math.Sqrt(tri.maximumRadius);\n                    tri.collisionMargin = 0;\n                    var triangleTransform = new RigidTransform { Orientation = Quaternion.Identity, Position = center };\n                    RayHit tempHit;\n                    if (MPRToolbox.Sweep(castShape, tri, ref sweep, ref Toolbox.ZeroVector, ref startingTransform, ref triangleTransform, out tempHit) && tempHit.T < hit.T)\n                    {\n                        hit = tempHit;\n                    }\n                }\n                tri.maximumRadius = 0;\n                PhysicsResources.GiveBack(tri);\n                CommonResources.GiveBack(hitElements);\n                return hit.T != float.MaxValue;\n            }\n            PhysicsResources.GiveBack(tri);\n            CommonResources.GiveBack(hitElements);\n            return false;\n        }\n\n        /// <summary>\n        /// Sets the bounding box of the detector volume to the current hierarchy root bounding box.  This is called automatically if the TriangleMesh property is set.\n        /// </summary>\n        public override void UpdateBoundingBox()\n        {\n            boundingBox = triangleMesh.Tree.BoundingBox;\n        }\n\n        /// <summary>\n        /// Updates the detector volume's interpretation of the mesh.  This should be called when the the TriangleMesh is changed significantly.  This is called automatically if the TriangleMesh property is set.\n        /// </summary>\n        public void Reinitialize()\n        {\n            //Pick a point that is known to be outside the mesh as the origin.\n            Vector3 origin = (triangleMesh.Tree.BoundingBox.Max - triangleMesh.Tree.BoundingBox.Min) * 1.5f + triangleMesh.Tree.BoundingBox.Min;\n\n            //Pick a direction which will definitely hit the mesh.\n            Vector3 a, b, c;\n            triangleMesh.Data.GetTriangle(0, out a, out b, out c);\n            var direction = (a + b + c) / 3 - origin;\n\n            var ray = new Ray(origin, direction);\n            var triangles = CommonResources.GetIntList();\n            triangleMesh.Tree.GetOverlaps(ray, triangles);\n\n            float minimumT = float.MaxValue;\n\n            for (int i = 0; i < triangles.Count; i++)\n            {\n                triangleMesh.Data.GetTriangle(triangles.Elements[i], out a, out b, out c);\n\n                RayHit hit;\n                bool hitClockwise;\n                if (Toolbox.FindRayTriangleIntersection(ref ray, float.MaxValue, ref a, ref b, ref c, out hitClockwise, out hit))\n                {\n                    if (hit.T < minimumT)\n                    {\n                        minimumT = hit.T;\n                        innerFacingIsClockwise = !hitClockwise;\n                    }\n                }\n            }\n            CommonResources.GiveBack(triangles);\n        }\n\n\n        void ISpaceObject.OnAdditionToSpace(ISpace newSpace)\n        {\n\n        }\n\n        void ISpaceObject.OnRemovalFromSpace(ISpace oldSpace)\n        {\n\n        }\n\n\n        /// <summary>\n        /// Used to protect against containment changes coming in from multithreaded narrowphase contexts.\n        /// </summary>\n        SpinLock locker = new SpinLock();\n        struct ContainmentChange\n        {\n            public Entity Entity;\n            public ContainmentChangeType Change;\n        }\n        enum ContainmentChangeType : byte\n        {\n            BeganTouching,\n            StoppedTouching,\n            BeganContaining,\n            StoppedContaining\n        }\n        private Queue<ContainmentChange> containmentChanges = new Queue<ContainmentChange>();\n        internal void BeganTouching(DetectorVolumePairHandler pair)\n        {\n            locker.Enter();\n            containmentChanges.Enqueue(new ContainmentChange\n            {\n                Change = ContainmentChangeType.BeganTouching,\n                Entity = pair.Collidable.entity\n            });\n            locker.Exit();\n        }\n\n        internal void StoppedTouching(DetectorVolumePairHandler pair)\n        {\n            locker.Enter();\n            containmentChanges.Enqueue(new ContainmentChange\n            {\n                Change = ContainmentChangeType.StoppedTouching,\n                Entity = pair.Collidable.entity\n            });\n            locker.Exit();\n        }\n\n        internal void BeganContaining(DetectorVolumePairHandler pair)\n        {\n            locker.Enter();\n            containmentChanges.Enqueue(new ContainmentChange\n            {\n                Change = ContainmentChangeType.BeganContaining,\n                Entity = pair.Collidable.entity\n            });\n            locker.Exit();\n        }\n\n        internal void StoppedContaining(DetectorVolumePairHandler pair)\n        {\n            locker.Enter();\n            containmentChanges.Enqueue(new ContainmentChange\n            {\n                Change = ContainmentChangeType.StoppedContaining,\n                Entity = pair.Collidable.entity\n            });\n            locker.Exit();\n        }\n\n\n        DeferredEventDispatcher IDeferredEventCreator.DeferredEventDispatcher { get; set; }\n\n        bool IDeferredEventCreator.IsActive\n        {\n            get { return true; }\n            set { throw new NotSupportedException(\"Detector volumes are always active deferred event generators.\"); }\n        }\n\n        void IDeferredEventCreator.DispatchEvents()\n        {\n            while (containmentChanges.Count > 0)\n            {\n                var change = containmentChanges.Dequeue();\n                switch (change.Change)\n                {\n                    case ContainmentChangeType.BeganTouching:\n                        if (EntityBeganTouching != null)\n                            EntityBeganTouching(this, change.Entity);\n                        break;\n                    case ContainmentChangeType.StoppedTouching:\n                        if (EntityStoppedTouching != null)\n                            EntityStoppedTouching(this, change.Entity);\n                        break;\n                    case ContainmentChangeType.BeganContaining:\n                        if (VolumeBeganContainingEntity != null)\n                            VolumeBeganContainingEntity(this, change.Entity);\n                        break;\n                    case ContainmentChangeType.StoppedContaining:\n                        if (VolumeStoppedContainingEntity != null)\n                            VolumeStoppedContainingEntity(this, change.Entity);\n                        break;\n                }\n            }\n        }\n\n        int IDeferredEventCreator.ChildDeferredEventCreators\n        {\n            get { return 0; }\n            set\n            {\n                throw new NotSupportedException(\"The detector volume does not allow child deferred event creators.\");\n            }\n        }\n    }\n\n\n    /// <summary>\n    /// Handles any special logic to perform when an entry begins touching a detector volume.\n    /// Runs within an update loop for updateables; modifying the updateable listing during the event is disallowed.\n    /// </summary>\n    /// <param name=\"volume\">DetectorVolume being touched.</param>\n    /// <param name=\"toucher\">Entry touching the volume.</param>\n    public delegate void EntityBeginsTouchingVolumeEventHandler(DetectorVolume volume, Entity toucher);\n\n    /// <summary>\n    /// Handles any special logic to perform when an entry stops touching a detector volume.\n    /// Runs within an update loop for updateables; modifying the updateable listing during the event is disallowed.\n    /// </summary>\n    /// <param name=\"volume\">DetectorVolume no longer being touched.</param>\n    /// <param name=\"toucher\">Entry no longer touching the volume.</param>\n    public delegate void EntityStopsTouchingVolumeEventHandler(DetectorVolume volume, Entity toucher);\n\n    /// <summary>\n    /// Handles any special logic to perform when an entity begins being contained by a detector volume.\n    /// Runs within an update loop for updateables; modifying the updateable listing during the event is disallowed.\n    /// </summary>\n    /// <param name=\"volume\">DetectorVolume containing the entry.</param>\n    /// <param name=\"entity\">Entity contained by the volume.</param>\n    public delegate void VolumeBeginsContainingEntityEventHandler(DetectorVolume volume, Entity entity);\n\n    /// <summary>\n    /// Handles any special logic to perform when an entry stops being contained by a detector volume.\n    /// Runs within an update loop for updateables; modifying the updateable listing during the event is disallowed.\n    /// </summary>\n    /// <param name=\"volume\">DetectorVolume no longer containing the entry.</param>\n    /// <param name=\"entity\">Entity no longer contained by the volume.</param>\n    public delegate void VolumeStopsContainingEntityEventHandler(DetectorVolume volume, Entity entity);\n}"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/EntityCollidableCollection.cs",
    "content": "﻿using System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Entities;\n\nnamespace BEPUphysics.BroadPhaseEntries\n{\n    ///<summary>\n    /// Enumerable collection of entities associated with a collidable.\n    ///</summary>\n    public struct EntityCollidableCollection : IEnumerable<Entity>\n    {\n\n        ///<summary>\n        /// Enumerator for the EntityCollidableCollection.\n        ///</summary>\n        public struct Enumerator : IEnumerator<Entity>\n        {\n            EntityCollidableCollection collection;\n            EntityCollidable current;\n            int index;\n            ///<summary>\n            /// Constructs a new enumerator.\n            ///</summary>\n            ///<param name=\"collection\">Owning collection.</param>\n            public Enumerator(EntityCollidableCollection collection)\n            {\n                this.collection = collection;\n                index = -1;\n                current = null;\n            }\n\n            /// <summary>\n            /// Gets the element in the collection at the current position of the enumerator.\n            /// </summary>\n            /// <returns>\n            /// The element in the collection at the current position of the enumerator.\n            /// </returns>\n            public Entity Current\n            {\n                get { return current.entity; }\n            }\n\n            /// <summary>\n            /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n            /// </summary>\n            /// <filterpriority>2</filterpriority>\n            public void Dispose()\n            {\n            }\n\n            object System.Collections.IEnumerator.Current\n            {\n                get { return Current; }\n            }\n\n            /// <summary>\n            /// Advances the enumerator to the next element of the collection.\n            /// </summary>\n            /// <returns>\n            /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n            /// </returns>\n            /// <exception>The collection was modified after the enumerator was created.\n            ///   <cref>T:System.InvalidOperationException</cref>\n            /// </exception><filterpriority>2</filterpriority>\n            public bool MoveNext()\n            {\n                while (++index < collection.owner.pairs.Count)\n                {\n                    if ((current = (collection.owner.pairs[index].broadPhaseOverlap.entryA == collection.owner ?\n                        collection.owner.pairs[index].broadPhaseOverlap.entryB : \n                        collection.owner.pairs[index].broadPhaseOverlap.entryA) as EntityCollidable) != null)\n                        return true;\n                }\n                return false;\n            }\n\n            /// <summary>\n            /// Sets the enumerator to its initial position, which is before the first element in the collection.\n            /// </summary>\n            /// <exception>The collection was modified after the enumerator was created.\n            ///   <cref>T:System.InvalidOperationException</cref>\n            /// </exception><filterpriority>2</filterpriority>\n            public void Reset()\n            {\n                index = -1;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new EntityCollidableCollection.\n        ///</summary>\n        ///<param name=\"owner\">Owner of the collection.</param>\n        public EntityCollidableCollection(EntityCollidable owner)\n        {\n            this.owner = owner;\n        }\n\n        internal EntityCollidable owner;\n\n\n        ///<summary>\n        /// Gets an enumerator over the entities in the collection.\n        ///</summary>\n        ///<returns>Enumerator over the entities in the collection.</returns>\n        public Enumerator GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        IEnumerator<Entity> IEnumerable<Entity>.GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/Events/CollisionEventTypes.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\n\nnamespace BEPUphysics.BroadPhaseEntries.Events\n{\n    //TODO: Contravariance isn't supported on all platforms...\n\n    /// <summary>\n    /// Handles any special logic when two objects' bounding boxes overlap as determined by the broadphase system.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair presiding over the interaction of the two involved bodies.\n    /// This reference cannot be safely kept outside of the scope of the handler; pairs can quickly return to the resource pool.</param>\n    public delegate void PairCreatedEventHandler<T>(T sender, BroadPhaseEntry other, NarrowPhasePair pair);\n\n    /// <summary>\n    /// Handles any special logic when two objects' bounding boxes overlap as determined by the broadphase system.\n    /// Unlike PairCreatedEventHandler, this will be called as soon as a pair is created instead of at the end of the frame.\n    /// This allows the pair's data to be adjusted prior to any usage, but some actions are not supported due to the execution stage.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair presiding over the interaction of the two involved bodies.\n    /// This reference cannot be safely kept outside of the scope of the handler; pairs can quickly return to the resource pool.</param>\n    public delegate void CreatingPairEventHandler<T>(T sender, BroadPhaseEntry other, NarrowPhasePair pair);\n\n    /// <summary>\n    /// Handles any special logic when two objects' bounding boxes cease to overlap as determined by the broadphase system.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">The entry formerly interacting with the sender via the deleted pair.</param>\n    public delegate void PairRemovedEventHandler<T>(T sender, BroadPhaseEntry other);\n\n    /// <summary>\n    /// Handles any special logic when two objects' bounding boxes cease to overlap as determined by the broadphase system.\n    /// Unlike PairRemovedEventHandler, this will trigger at the time of pair removal instead of at the end of the space's update.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">The entry formerly interacting with the sender via the deleted pair.</param>\n    public delegate void RemovingPairEventHandler<T>(T sender, BroadPhaseEntry other);\n\n    /// <summary>\n    /// Handles any special logic when two bodies are touching and generate a contact point.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair presiding over the interaction of the two involved bodies.\n    /// This reference cannot be safely kept outside of the scope of the handler; pairs can quickly return to the resource pool.</param>\n    /// <param name=\"contact\">Created contact data.</param>\n    public delegate void ContactCreatedEventHandler<T>(T sender, Collidable other, CollidablePairHandler pair, ContactData contact);\n\n    /// <summary>\n    /// Handles any special logic when two bodies are touching and generate a contact point.\n    /// Unlike ContactCreatedEventHandler, this will trigger at the time of contact generation instead of at the end of the space's update.\n    /// This allows the contact's data to be adjusted prior to usage in the velocity solver, \n    /// but other actions such as altering the owning space's pair or entry listings are unsafe.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair presiding over the interaction of the two involved bodies.\n    /// This reference cannot be safely kept outside of the scope of the handler; pairs can quickly return to the resource pool.</param>\n    /// <param name=\"contact\">Newly generated contact point between the pair's two bodies.\n    /// This reference cannot be safely kept outside of the scope of the handler; contacts can quickly return to the resource pool.</param>\n    public delegate void CreatingContactEventHandler<T>(T sender, Collidable other, CollidablePairHandler pair, Contact contact);\n\n    /// <summary>\n    /// Handles any special logic when two bodies initally collide and generate a contact point.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair presiding over the interaction of the two involved bodies.\n    /// This reference cannot be safely kept outside of the scope of the handler; pairs can quickly return to the resource pool.</param>\n    public delegate void InitialCollisionDetectedEventHandler<T>(T sender, Collidable other, CollidablePairHandler pair);\n\n    /// <summary>\n    /// Handles any special logic when two bodies initally collide and generate a contact point.\n    /// Unlike InitialCollisionDetectedEventHandler, this will trigger at the time of contact creation instead of at the end of the space's update.\n    /// Performing operations outside of the scope of the pair is unsafe.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair presiding over the interaction of the two involved bodies.\n    /// This reference cannot be safely kept outside of the scope of the handler; pairs can quickly return to the resource pool.</param>\n    public delegate void DetectingInitialCollisionEventHandler<T>(T sender, Collidable other, CollidablePairHandler pair);\n\n    /// <summary>\n    /// Handles any special logic when a contact point between two bodies is removed.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair presiding over the interaction of the two involved bodies and data about the removed contact.\n    /// This reference cannot be safely kept outside of the scope of the handler; pairs can quickly return to the resource pool.</param>\n    /// <param name=\"contact\">Removed contact data.</param>\n    public delegate void ContactRemovedEventHandler<T>(T sender, Collidable other, CollidablePairHandler pair, ContactData contact);\n\n    /// <summary>\n    /// Handles any special logic when a contact point between two bodies is removed.\n    /// Unlike ContactRemovedEventHandler, this will trigger at the time of contact removal instead of at the end of the space's update.\n    /// Performing operations outside of the scope of the controller is unsafe.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair presiding over the interaction of the two involved bodies and data about the removed contact.\n    /// This reference cannot be safely kept outside of the scope of the handler; pairs can quickly return to the resource pool.</param>\n    /// <param name=\"contact\">Contact between the two entries.  This reference cannot be safely kept outside of the scope of the handler;\n    /// it will be immediately returned to the resource pool after the event handler completes.</param>\n    public delegate void RemovingContactEventHandler<T>(T sender, Collidable other, CollidablePairHandler pair, Contact contact);\n\n    /// <summary>\n    /// Handles any special logic when two bodies go from a touching state to a separated state.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair overseeing the collision.  Note that this instance may be invalid if the entries' bounding boxes no longer overlap.</param>\n    public delegate void CollisionEndedEventHandler<T>(T sender, Collidable other, CollidablePairHandler pair);\n\n    /// <summary>\n    /// Handles any special logic when two bodies go from a touching state to a separated state.\n    /// Unlike CollisionEndedEventHandler, this will trigger at the time of contact removal instead of at the end of the space's update.\n    /// Performing operations outside of the scope of the controller is unsafe.\n    /// </summary>\n    /// <param name=\"sender\">Entry sending the event.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair presiding over the interaction of the two involved bodies.\n    /// This reference cannot be safely kept outside of the scope of the handler; pairs can quickly return to the resource pool.</param>\n    public delegate void CollisionEndingEventHandler<T>(T sender, Collidable other, CollidablePairHandler pair);\n\n    /// <summary>\n    /// Handles any special logic to perform at the end of a pair's UpdateContactManifold method.\n    /// This is called every single update regardless if the process was quit early or did not complete due to interaction rules.\n    /// </summary>\n    /// <param name=\"sender\">Entry involved in the pair monitored for events.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair that was updated.</param>\n    public delegate void PairUpdatedEventHandler<T>(T sender, BroadPhaseEntry other, NarrowPhasePair pair);\n\n    /// <summary>\n    /// Handles any special logic to perform at the end of a pair's UpdateContactManifold method.\n    /// This is called every single update regardless if the process was quit early or did not complete due to interaction rules.\n    /// Unlike PairUpdatedEventHandler, this is called at the time of the collision detection update rather than at the end of the space's update.\n    /// Other entries' information may not be up to date, and operations acting on data outside of the character controller may be unsafe.\n    /// </summary>\n    /// <param name=\"sender\">Entry involved in the pair monitored for events.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair that was updated.</param>\n    public delegate void PairUpdatingEventHandler<T>(T sender, BroadPhaseEntry other, NarrowPhasePair pair);\n\n    /// <summary>\n    /// Handles any special logic to perform at the end of a pair's UpdateContactManifold method if the two objects are colliding.\n    /// This is called every single update regardless if the process was quit early or did not complete due to interaction rules.\n    /// </summary>\n    /// <param name=\"sender\">Entry involved in the pair monitored for events.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair that was updated.</param>\n    public delegate void PairTouchedEventHandler<T>(T sender, Collidable other, CollidablePairHandler pair);\n\n    /// <summary>\n    /// Handles any special logic to perform at the end of a pair's UpdateContactManifold method if the two objects are colliding.\n    /// This is called every single update regardless if the process was quit early or did not complete due to interaction rules.\n    /// Unlike PairTouchedEventHandler, this is called at the time of the collision detection update rather than at the end of the space's update.\n    /// Other entries' information may not be up to date, and operations acting on data outside of the character controller may be unsafe.\n    /// </summary>\n    /// <param name=\"sender\">Entry involved in the pair monitored for events.</param>\n    /// <param name=\"other\">Other entry within the pair opposing the monitored entry.</param>\n    /// <param name=\"pair\">Pair that was updated.</param>\n    public delegate void PairTouchingEventHandler<T>(T sender, Collidable other, CollidablePairHandler pair);\n\n    //Storage for deferred event dispatching\n    internal struct EventStoragePairCreated\n    {\n        internal NarrowPhasePair pair;\n        internal BroadPhaseEntry other;\n\n        internal EventStoragePairCreated(BroadPhaseEntry other, NarrowPhasePair pair)\n        {\n            this.other = other;\n            this.pair = pair;\n        }\n    }\n\n    internal struct EventStoragePairRemoved\n    {\n        internal BroadPhaseEntry other;\n\n        internal EventStoragePairRemoved(BroadPhaseEntry other)\n        {\n            this.other = other;\n        }\n    }\n\n    internal struct EventStorageContactCreated\n    {\n        internal CollidablePairHandler pair;\n        internal ContactData contactData;\n        internal Collidable other;\n\n\n        internal EventStorageContactCreated(Collidable other, CollidablePairHandler pair, ref ContactData contactData)\n        {\n            this.other = other;\n            this.pair = pair;\n            this.contactData = contactData;\n        }\n    }\n\n    internal struct EventStorageInitialCollisionDetected\n    {\n        internal CollidablePairHandler pair;\n        internal Collidable other;\n\n        internal EventStorageInitialCollisionDetected(Collidable other, CollidablePairHandler pair)\n        {\n            this.pair = pair;\n            this.other = other;\n        }\n    }\n\n    internal struct EventStorageContactRemoved\n    {\n        internal CollidablePairHandler pair;\n        internal ContactData contactData;\n        internal Collidable other;\n\n        internal EventStorageContactRemoved(Collidable other, CollidablePairHandler pair, ref ContactData contactData)\n        {\n            this.other = other;\n            this.pair = pair;\n            this.contactData = contactData;\n        }\n    }\n\n    internal struct EventStorageCollisionEnded\n    {\n        internal CollidablePairHandler pair;\n        internal Collidable other;\n\n        internal EventStorageCollisionEnded(Collidable other, CollidablePairHandler pair)\n        {\n            this.other = other;\n            this.pair = pair;\n        }\n    }\n\n    internal struct EventStoragePairUpdated\n    {\n        internal NarrowPhasePair pair;\n        internal BroadPhaseEntry other;\n\n        internal EventStoragePairUpdated(BroadPhaseEntry other, NarrowPhasePair pair)\n        {\n            this.other = other;\n            this.pair = pair;\n        }\n    }\n\n    internal struct EventStoragePairTouched\n    {\n        internal CollidablePairHandler pair;\n        internal Collidable other;\n\n        internal EventStoragePairTouched(Collidable other, CollidablePairHandler pair)\n        {\n            this.other = other;\n            this.pair = pair;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/Events/CompoundEventManager.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.OtherSpaceStages;\n\nnamespace BEPUphysics.BroadPhaseEntries.Events\n{\n    /// <summary>\n    /// Event manager for use with the CompoundCollidable.\n    /// It's possible to use the ContactEventManager directly with a compound,\n    /// but without using this class, any child event managers will fail to dispatch\n    /// deferred events.\n    /// </summary>\n    public class CompoundEventManager : ContactEventManager<EntityCollidable>\n    {\n\n        //TODO: This class can be generalized if there is ever another collidable which has similar requirements to the compound body.\n        protected override void DispatchEvents()\n        {\n            //Go through all children and dispatch events.\n            //They won't be touched by the primary event manager otherwise.\n            var compound = this.owner as CompoundCollidable;\n            if (compound != null)\n            {\n                foreach (var child in compound.children)\n                {\n                    var deferredEventCreator = child.CollisionInformation.events as IDeferredEventCreator;\n                    if (deferredEventCreator.IsActive)\n                        deferredEventCreator.DispatchEvents();\n                }\n            }\n            else\n            {\n                throw new InvalidOperationException(\"Cannot use a CompoundEventManager with anything but a CompoundCollidable.\");\n            }\n            base.DispatchEvents();\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/Events/ContactEventManager.cs",
    "content": "﻿using BEPUutilities;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.BroadPhaseEntries.Events\n{\n\n    ///<summary>\n    /// Event manager for collidables (things which can create contact points).\n    ///</summary>\n    ///<typeparam name=\"T\">Some Collidable subclass.</typeparam>\n    public class ContactEventManager<T> : EntryEventManager<T>, IContactEventTriggerer where T : Collidable\n    {\n\n        #region Events\n\n        /// <summary>\n        /// Fires when the entity stops touching another entity.\n        /// </summary>\n        public event CollisionEndedEventHandler<T> CollisionEnded\n        {\n            add\n            {\n                InternalCollisionEnded += value;\n                AddToEventfuls();\n            }\n            remove\n            {\n                InternalCollisionEnded -= value;\n                VerifyEventStatus();\n            }\n        }\n\n        /// <summary>\n        /// Fires when the entity stops touching another entity.\n        /// Unlike the CollisionEnded event, this event will run inline instead of at the end of the space's update.\n        /// Some operations are unsupported while the engine is updating, and be especially careful if internal multithreading is enabled.\n        /// </summary>\n        public event CollisionEndingEventHandler<T> CollisionEnding;\n\n        /// <summary>\n        /// Fires when a pair is updated and there are contact points in it.\n        /// </summary>\n        public event PairTouchedEventHandler<T> PairTouched\n        {\n            add\n            {\n                InternalPairTouched += value;\n                AddToEventfuls();\n            }\n            remove\n            {\n                InternalPairTouched -= value;\n                VerifyEventStatus();\n            }\n        }\n\n        /// <summary>\n        /// Fires when a pair is updated and there are contact points in it.\n        /// Unlike the PairTouched event, this event will run inline instead of at the end of the space's update.\n        /// Some operations are unsupported while the engine is updating, and be especially careful if internal multithreading is enabled.\n        /// </summary>\n        public event PairTouchingEventHandler<T> PairTouching;\n\n        /// <summary>\n        /// Fires when this entity gains a contact point with another entity.\n        /// </summary>\n        public event ContactCreatedEventHandler<T> ContactCreated\n        {\n            add\n            {\n                InternalContactCreated += value;\n                AddToEventfuls();\n            }\n            remove\n            {\n                InternalContactCreated -= value;\n                VerifyEventStatus();\n            }\n        }\n\n        /// <summary>\n        /// Fires when this entity loses a contact point with another entity.\n        /// </summary>\n        public event ContactRemovedEventHandler<T> ContactRemoved\n        {\n            add\n            {\n                InternalContactRemoved += value;\n                AddToEventfuls();\n            }\n            remove\n            {\n                InternalContactRemoved -= value;\n                VerifyEventStatus();\n            }\n        }\n\n        /// <summary>\n        /// Fires when this entity gains a contact point with another entity.\n        /// Unlike the ContactCreated event, this event will run inline instead of at the end of the space's update.\n        /// Some operations are unsupported while the engine is updating, and be especially careful if internal multithreading is enabled.\n        /// </summary>\n        public event CreatingContactEventHandler<T> CreatingContact;\n\n        /// <summary>\n        /// Fires when a collision first occurs.\n        /// Unlike the InitialCollisionDetected event, this event will run inline instead of at the end of the space's update.\n        /// Some operations are unsupported while the engine is updating, and be especially careful if internal multithreading is enabled.\n        /// </summary>\n        public event DetectingInitialCollisionEventHandler<T> DetectingInitialCollision;\n\n        /// <summary>\n        /// Fires when a collision first occurs.\n        /// </summary>\n        public event InitialCollisionDetectedEventHandler<T> InitialCollisionDetected\n        {\n            add\n            {\n                InternalInitialCollisionDetected += value;\n                AddToEventfuls();\n            }\n            remove\n            {\n                InternalInitialCollisionDetected -= value;\n                VerifyEventStatus();\n            }\n        }\n\n        /// <summary>\n        /// Fires when this entity loses a contact point with another entity.\n        /// Unlike the ContactRemoved event, this event will run inline instead of at the end of the space's update.\n        /// Some operations are unsupported while the engine is updating, and be especially careful if internal multithreading is enabled.\n        /// </summary>\n        public event RemovingContactEventHandler<T> RemovingContact;\n\n        private event CollisionEndedEventHandler<T> InternalCollisionEnded;\n        private event PairTouchedEventHandler<T> InternalPairTouched;\n        private event ContactCreatedEventHandler<T> InternalContactCreated;\n        private event ContactRemovedEventHandler<T> InternalContactRemoved;\n        private event InitialCollisionDetectedEventHandler<T> InternalInitialCollisionDetected;\n\n        #endregion\n\n        #region Supporting members\n\n        protected override bool EventsAreInactive()\n        {\n            return InternalCollisionEnded == null &&\n                   InternalPairTouched == null &&\n                   InternalContactCreated == null &&\n                   InternalContactRemoved == null &&\n                   InternalInitialCollisionDetected == null &&\n                   base.EventsAreInactive();\n        }\n\n        readonly ConcurrentDeque<EventStorageContactCreated> eventStorageContactCreated = new ConcurrentDeque<EventStorageContactCreated>(0);\n        readonly ConcurrentDeque<EventStorageInitialCollisionDetected> eventStorageInitialCollisionDetected = new ConcurrentDeque<EventStorageInitialCollisionDetected>(0);\n        readonly ConcurrentDeque<EventStorageContactRemoved> eventStorageContactRemoved = new ConcurrentDeque<EventStorageContactRemoved>(0);\n        readonly ConcurrentDeque<EventStorageCollisionEnded> eventStorageCollisionEnded = new ConcurrentDeque<EventStorageCollisionEnded>(0);\n        readonly ConcurrentDeque<EventStoragePairTouched> eventStoragePairTouched = new ConcurrentDeque<EventStoragePairTouched>(0);\n\n        protected override void DispatchEvents()\n        {\n            //Note: Deferred event creation should be performed sequentially with dispatching.\n            //This means a event creation from this creator cannot occur ASYNCHRONOUSLY while DispatchEvents is running.\n\n            //Note: If the deferred event handler is removed during the execution of the engine, the handler may be null.\n            //In this situation, ignore the event.\n            //This is not a particularly clean behavior, but it's better than just crashing.\n            EventStorageContactCreated contactCreated;\n            while (eventStorageContactCreated.TryUnsafeDequeueFirst(out contactCreated))\n                if (InternalContactCreated != null)\n                    InternalContactCreated(owner, contactCreated.other, contactCreated.pair, contactCreated.contactData);\n\n            EventStorageInitialCollisionDetected initialCollisionDetected;\n            while (eventStorageInitialCollisionDetected.TryUnsafeDequeueFirst(out initialCollisionDetected))\n                if (InternalInitialCollisionDetected != null)\n                    InternalInitialCollisionDetected(owner, initialCollisionDetected.other, initialCollisionDetected.pair);\n\n            EventStorageContactRemoved contactRemoved;\n            while (eventStorageContactRemoved.TryUnsafeDequeueFirst(out contactRemoved))\n                if (InternalContactRemoved != null)\n                    InternalContactRemoved(owner, contactRemoved.other, contactRemoved.pair, contactRemoved.contactData);\n\n            EventStorageCollisionEnded collisionEnded;\n            while (eventStorageCollisionEnded.TryUnsafeDequeueFirst(out collisionEnded))\n                if (InternalCollisionEnded != null)\n                    InternalCollisionEnded(owner, collisionEnded.other, collisionEnded.pair);\n\n            EventStoragePairTouched collisionPairTouched;\n            while (eventStoragePairTouched.TryUnsafeDequeueFirst(out collisionPairTouched))\n                if (InternalPairTouched != null)\n                    InternalPairTouched(owner, collisionPairTouched.other, collisionPairTouched.pair);\n\n            base.DispatchEvents();\n        }\n\n        public void OnCollisionEnded(Collidable other, CollidablePairHandler collisionPair)\n        {\n            if (InternalCollisionEnded != null)\n                eventStorageCollisionEnded.Enqueue(new EventStorageCollisionEnded(other, collisionPair));\n            if (CollisionEnding != null)\n                CollisionEnding(owner, other, collisionPair);\n        }\n\n        public void OnPairTouching(Collidable other, CollidablePairHandler collisionPair)\n        {\n            if (InternalPairTouched != null)\n                eventStoragePairTouched.Enqueue(new EventStoragePairTouched(other, collisionPair));\n            if (PairTouching != null)\n                PairTouching(owner, other, collisionPair);\n        }\n\n        public void OnContactCreated(Collidable other, CollidablePairHandler collisionPair, Contact contact)\n        {\n            if (InternalContactCreated != null)\n            {\n                ContactData contactData;\n                contactData.Position = contact.Position;\n                contactData.Normal = contact.Normal;\n                contactData.PenetrationDepth = contact.PenetrationDepth;\n                contactData.Id = contact.Id;\n                eventStorageContactCreated.Enqueue(new EventStorageContactCreated(other, collisionPair, ref contactData));\n            }\n            if (CreatingContact != null)\n                CreatingContact(owner, other, collisionPair, contact);\n        }\n\n        public void OnContactRemoved(Collidable other, CollidablePairHandler collisionPair, Contact contact)\n        {\n            if (InternalContactRemoved != null)\n            {\n                ContactData contactData;\n                contactData.Position = contact.Position;\n                contactData.Normal = contact.Normal;\n                contactData.PenetrationDepth = contact.PenetrationDepth;\n                contactData.Id = contact.Id;\n                eventStorageContactRemoved.Enqueue(new EventStorageContactRemoved(other, collisionPair, ref contactData));\n            }\n            if (RemovingContact != null)\n                RemovingContact(owner, other, collisionPair, contact);\n        }\n\n        public void OnInitialCollisionDetected(Collidable other, CollidablePairHandler collisionPair)\n        {\n            if (InternalInitialCollisionDetected != null)\n                eventStorageInitialCollisionDetected.Enqueue(new EventStorageInitialCollisionDetected(other, collisionPair));\n            if (DetectingInitialCollision != null)\n                DetectingInitialCollision(owner, other, collisionPair);\n        }\n\n        ///<summary>\n        /// Removes all event hooks from the event manager.\n        ///</summary>\n        public override void RemoveAllEvents()\n        {\n            InternalCollisionEnded = null;\n            InternalPairTouched = null;\n            InternalContactCreated = null;\n            InternalContactRemoved = null;\n            InternalInitialCollisionDetected = null;\n\n            CollisionEnding = null;\n            DetectingInitialCollision = null;\n            CreatingContact = null;\n            RemovingContact = null;\n            PairTouching = null;\n\n            base.RemoveAllEvents();\n        }\n\n        #endregion\n\n\n\n    }\n\n\n\n\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/Events/EntryEventManager.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing BEPUphysics.OtherSpaceStages;\nusing BEPUutilities;\nusing System;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.BroadPhaseEntries.Events\n{\n\n    ///<summary>\n    /// Event manager for BroadPhaseEntries (all types that live in the broad phase).\n    ///</summary>\n    ///<typeparam name=\"T\">Some BroadPhaseEntry subclass.</typeparam>\n    public class EntryEventManager<T> : IDeferredEventCreator, IEntryEventTriggerer where T : BroadPhaseEntry\n    {\n        protected internal int childDeferredEventCreators;\n        /// <summary>\n        /// Number of child deferred event creators.\n        /// </summary>\n        int IDeferredEventCreator.ChildDeferredEventCreators\n        {\n            get\n            {\n                return childDeferredEventCreators;\n            }\n            set\n            {\n                int previousValue = childDeferredEventCreators;\n                childDeferredEventCreators = value;\n                if (childDeferredEventCreators == 0 && previousValue != 0)\n                {\n                    //Deactivate!\n                    if (EventsAreInactive())\n                    {\n                        //The events are inactive method tests to see if this event manager\n                        //has any events that need to be deferred.\n                        //If we get here, that means that there's zero children active, and we aren't active...\n                        ((IDeferredEventCreator)this).IsActive = false;\n                    }\n                }\n                else if (childDeferredEventCreators != 0 && previousValue == 0)\n                {\n                    //Activate!\n                    //It doesn't matter if there are any events active in this instance, just try to activate anyway.\n                    //If it is already active, nothing will happen.\n                    ((IDeferredEventCreator)this).IsActive = true;\n                }\n            }\n        }\n\n        private CompoundEventManager parent;\n        /// <summary>\n        /// The parent of the event manager, if any.\n        /// </summary>\n        protected internal CompoundEventManager Parent\n        {\n            get\n            {\n                return parent;\n            }\n            set\n            {\n                //The child deferred event creator links must be maintained.\n                if (parent != null && isActive)\n                    ((IDeferredEventCreator)parent).ChildDeferredEventCreators--;\n                parent = value;\n                if (parent != null && isActive)\n                    ((IDeferredEventCreator)parent).ChildDeferredEventCreators++;\n            }\n\n        }\n\n        protected internal T owner;\n        ///<summary>\n        /// Owner of the event manager.\n        ///</summary>\n        public T Owner\n        {\n            get\n            {\n                return owner;\n            }\n            protected internal set\n            {\n                owner = value;\n            }\n        }\n\n\n        #region Events\n        /// <summary>\n        /// Fires when this entity's bounding box newly overlaps another entity's bounding box.\n        /// </summary>\n        public event PairCreatedEventHandler<T> PairCreated\n        {\n            add\n            {\n                InternalPairCreated += value;\n                AddToEventfuls();\n            }\n            remove\n            {\n                InternalPairCreated -= value;\n                VerifyEventStatus();\n            }\n        }\n\n        /// <summary>\n        /// Fires when this entity's bounding box no longer overlaps another entity's bounding box.\n        /// </summary>\n        public event PairRemovedEventHandler<T> PairRemoved\n        {\n            add\n            {\n                InternalPairRemoved += value;\n                AddToEventfuls();\n            }\n            remove\n            {\n                InternalPairRemoved -= value;\n                VerifyEventStatus();\n            }\n        }\n\n        /// <summary>\n        /// Fires when a pair is updated.\n        /// </summary>\n        public event PairUpdatedEventHandler<T> PairUpdated\n        {\n            add\n            {\n                InternalPairUpdated += value;\n                AddToEventfuls();\n            }\n            remove\n            {\n                InternalPairUpdated -= value;\n                VerifyEventStatus();\n            }\n        }\n\n        /// <summary>\n        /// Fires when a pair is updated.\n        /// Unlike the PairUpdated event, this event will run inline instead of at the end of the space's update.\n        /// Some operations are unsupported while the engine is updating, and be especially careful if internal multithreading is enabled.\n        /// </summary>\n        public event PairUpdatingEventHandler<T> PairUpdating;\n\n        /// <summary>\n        /// Fires when this entity's bounding box newly overlaps another entity's bounding box.\n        /// Unlike the PairCreated event, this event will run inline instead of at the end of the space's update.\n        /// Some operations are unsupported while the engine is updating, and be especially careful if internal multithreading is enabled.\n        /// </summary>\n        public event CreatingPairEventHandler<T> CreatingPair;\n\n        /// <summary>\n        /// Fires when this entity's bounding box no longer overlaps another entity's bounding box.\n        /// Unlike the PairRemoved event, this event will run inline instead of at the end of the space's update.\n        /// Some operations are unsupported while the engine is updating, and be especially careful if internal multithreading is enabled.\n        /// </summary>\n        public event RemovingPairEventHandler<T> RemovingPair;\n\n\n        private event PairCreatedEventHandler<T> InternalPairCreated;\n        private event PairRemovedEventHandler<T> InternalPairRemoved;\n        private event PairUpdatedEventHandler<T> InternalPairUpdated;\n\n        #endregion\n\n\n        #region Supporting members\n\n        /// <summary>\n        /// Removes the entity from the space's list of eventful entities if no events are active.\n        /// </summary>\n        protected void VerifyEventStatus()\n        {\n            if (EventsAreInactive() && childDeferredEventCreators == 0)\n            {\n                ((IDeferredEventCreator)this).IsActive = false;\n            }\n        }\n\n        protected virtual bool EventsAreInactive()\n        {\n            return InternalPairCreated == null &&\n                   InternalPairRemoved == null &&\n                   InternalPairUpdated == null;\n        }\n\n\n        protected void AddToEventfuls()\n        {\n            ((IDeferredEventCreator)this).IsActive = true;\n        }\n\n\n        private DeferredEventDispatcher deferredEventDispatcher;\n        DeferredEventDispatcher IDeferredEventCreator.DeferredEventDispatcher\n        {\n            get\n            {\n                return deferredEventDispatcher;\n            }\n            set\n            {\n                deferredEventDispatcher = value;\n            }\n        }\n\n        readonly ConcurrentDeque<EventStoragePairCreated> eventStoragePairCreated = new ConcurrentDeque<EventStoragePairCreated>(0);\n        readonly ConcurrentDeque<EventStoragePairRemoved> eventStoragePairRemoved = new ConcurrentDeque<EventStoragePairRemoved>(0);\n        readonly ConcurrentDeque<EventStoragePairUpdated> eventStoragePairUpdated = new ConcurrentDeque<EventStoragePairUpdated>(0);\n\n        void IDeferredEventCreator.DispatchEvents()\n        {\n            DispatchEvents();\n        }\n        protected virtual void DispatchEvents()\n        {\n            //Note: Deferred event creation should be performed sequentially with dispatching.\n            //This means a event creation from this creator cannot occur ASYNCHRONOUSLY while DispatchEvents is running.\n\n            //Note: If the deferred event handler is removed during the execution of the engine, the handler may be null.\n            //In this situation, ignore the event.\n            //This is not a particularly clean behavior, but it's better than just crashing.\n            EventStoragePairCreated collisionPairCreated;\n            while (eventStoragePairCreated.TryUnsafeDequeueFirst(out collisionPairCreated))\n                if (InternalPairCreated != null)\n                    InternalPairCreated(owner, collisionPairCreated.other, collisionPairCreated.pair);\n            EventStoragePairRemoved collisionPairRemoved;\n            while (eventStoragePairRemoved.TryUnsafeDequeueFirst(out collisionPairRemoved))\n                if (InternalPairRemoved != null)\n                    InternalPairRemoved(owner, collisionPairRemoved.other);\n            EventStoragePairUpdated collisionPairUpdated;\n            while (eventStoragePairUpdated.TryUnsafeDequeueFirst(out collisionPairUpdated))\n                if (InternalPairUpdated != null)\n                    InternalPairUpdated(owner, collisionPairUpdated.other, collisionPairUpdated.pair);\n\n\n        }\n\n\n        public void OnPairCreated(BroadPhaseEntry other, NarrowPhasePair collisionPair)\n        {\n            if (InternalPairCreated != null)\n                eventStoragePairCreated.Enqueue(new EventStoragePairCreated(other, collisionPair));\n            if (CreatingPair != null)\n                CreatingPair(owner, other, collisionPair);\n        }\n\n        public void OnPairRemoved(BroadPhaseEntry other)\n        {\n            if (InternalPairRemoved != null)\n            {\n                eventStoragePairRemoved.Enqueue(new EventStoragePairRemoved(other));\n            }\n            if (RemovingPair != null)\n            {\n                RemovingPair(owner, other);\n            }\n        }\n\n        public void OnPairUpdated(BroadPhaseEntry other, NarrowPhasePair collisionPair)\n        {\n            if (InternalPairUpdated != null)\n                eventStoragePairUpdated.Enqueue(new EventStoragePairUpdated(other, collisionPair));\n            if (PairUpdating != null)\n                PairUpdating(owner, other, collisionPair);\n        }\n\n\n        private bool isActive;\n        //IsActive is enabled whenever this collision information can dispatch events.\n        bool IDeferredEventCreator.IsActive\n        {\n            get\n            {\n                return isActive;\n            }\n            set\n            {\n                if (!isActive && value)\n                {\n                    isActive = true;\n                    //Notify the parent that it needs to activate.\n                    if (parent != null)\n                        ((IDeferredEventCreator)parent).ChildDeferredEventCreators++;\n\n                    if (deferredEventDispatcher != null)\n                        deferredEventDispatcher.CreatorActivityChanged(this);\n                }\n                else if (isActive && !value)\n                {\n                    isActive = false;\n                    //Notify the parent that it can deactivate.\n                    if (parent != null)\n                        ((IDeferredEventCreator)parent).ChildDeferredEventCreators--;\n\n                    if (deferredEventDispatcher != null)\n                        deferredEventDispatcher.CreatorActivityChanged(this);\n                }\n            }\n        }\n\n        ///<summary>\n        /// Removes all event hooks from the manager.\n        ///</summary>\n        public virtual void RemoveAllEvents()\n        {\n            PairUpdating = null;\n            CreatingPair = null;\n            RemovingPair = null;\n            InternalPairCreated = null;\n            InternalPairRemoved = null;\n            InternalPairUpdated = null;\n\n            VerifyEventStatus();\n        }\n\n        #endregion\n\n\n\n    }\n\n\n\n\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/Events/IContactEventTriggerer.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing BEPUphysics.CollisionTests;\n\nnamespace BEPUphysics.BroadPhaseEntries.Events\n{\n    /// <summary>\n    /// Manages triggers for events in an ContactEventManager.\n    /// </summary>\n    public interface IContactEventTriggerer : IEntryEventTriggerer\n    {\n        /// <summary>\n        /// Fires collision ending events.\n        /// </summary>\n        /// <param name=\"other\">Other collidable involved in the pair.</param>\n        /// <param name=\"collisionPair\">Collidable pair handler that manages the two objects.</param>\n        void OnCollisionEnded(Collidable other, CollidablePairHandler collisionPair);\n\n        /// <summary>\n        /// Fires pair touching events.\n        /// </summary>\n        /// <param name=\"other\">Other collidable involved in the pair.</param>\n        /// <param name=\"collisionPair\">Collidable pair handler that manages the two objects.</param>\n        void OnPairTouching(Collidable other, CollidablePairHandler collisionPair);\n\n        /// <summary>\n        /// Fires contact creating events.\n        /// </summary>\n        /// <param name=\"other\">Other collidable involved in the pair.</param>\n        /// <param name=\"collisionPair\">Collidable pair handler that manages the two objects.</param>\n        /// <param name=\"contact\">Contact point of collision.</param>\n        void OnContactCreated(Collidable other, CollidablePairHandler collisionPair, Contact contact);\n\n        /// <summary>\n        /// Fires contact removal events.\n        /// </summary>\n        /// <param name=\"other\">Other collidable involved in the pair.</param>\n        /// <param name=\"collisionPair\">Collidable pair handler that manages the two objects.</param>\n        /// <param name=\"contact\">Contact point of collision.</param>\n        void OnContactRemoved(Collidable other, CollidablePairHandler collisionPair, Contact contact);\n\n        /// <summary>\n        /// Fires initial collision detected events.\n        /// </summary>\n        /// <param name=\"other\">Other collidable involved in the pair.</param>\n        /// <param name=\"collisionPair\">Collidable pair handler that manages the two objects.</param>\n        void OnInitialCollisionDetected(Collidable other, CollidablePairHandler collisionPair);\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/Events/IEntryEventTriggerer.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\n\nnamespace BEPUphysics.BroadPhaseEntries.Events\n{\n    /// <summary>\n    /// Manages triggers for events in an EntryEventManager.\n    /// </summary>\n    public interface IEntryEventTriggerer\n    {\n        /// <summary>\n        /// Fires the event manager's pair creation events.\n        /// </summary>\n        /// <param name=\"other\">Other entry involved in the pair.</param>\n        /// <param name=\"collisionPair\">Narrow phase pair governing the two objects.</param>\n        void OnPairCreated(BroadPhaseEntry other, NarrowPhasePair collisionPair);\n\n        /// <summary>\n        /// Fires the event manager's pair removal events.\n        /// </summary>\n        /// <param name=\"other\">Other entry involved in the pair.</param>\n        void OnPairRemoved(BroadPhaseEntry other);\n\n        /// <summary>\n        /// Fires the event manager's pair updated events.\n        /// </summary>\n        /// <param name=\"other\">Other entry involved in the pair.</param>\n        /// <param name=\"collisionPair\">Narrow phase pair governing the two objects.</param>\n        void OnPairUpdated(BroadPhaseEntry other, NarrowPhasePair collisionPair);\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/InstancedMesh.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries.Events;\nusing BEPUphysics.CollisionShapes;\nusing BEPUutilities;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUphysics.OtherSpaceStages;\nusing AffineTransform = BEPUutilities.AffineTransform;\nusing RigidTransform = BEPUutilities.RigidTransform;\n\nnamespace BEPUphysics.BroadPhaseEntries\n{\n    ///<summary>\n    /// Collidable mesh which can be created from a reusable InstancedMeshShape.\n    /// Very little data is needed for each individual InstancedMesh object, allowing\n    /// a complicated mesh to be repeated many times.  Since the hierarchy used to accelerate\n    /// collisions is purely local, it may be marginally slower than an individual StaticMesh.\n    ///</summary>\n    public class InstancedMesh : StaticCollidable\n    {\n\n        internal AffineTransform worldTransform;\n        ///<summary>\n        /// Gets or sets the world transform of the mesh.\n        ///</summary>\n        public AffineTransform WorldTransform\n        {\n            get\n            {\n                return worldTransform;\n            }\n            set\n            {\n                worldTransform = value;\n                Shape.ComputeBoundingBox(ref value, out boundingBox);\n            }\n        }\n\n        /// <summary>\n        /// Updates the bounding box to the current state of the entry.\n        /// </summary>\n        public override void UpdateBoundingBox()\n        {\n            Shape.ComputeBoundingBox(ref worldTransform, out boundingBox);\n        }\n\n\n        ///<summary>\n        /// Constructs a new InstancedMesh.\n        ///</summary>\n        ///<param name=\"meshShape\">Shape to use for the instance.</param>\n        public InstancedMesh(InstancedMeshShape meshShape)\n            : this(meshShape, AffineTransform.Identity)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a new InstancedMesh.\n        ///</summary>\n        ///<param name=\"meshShape\">Shape to use for the instance.</param>\n        ///<param name=\"worldTransform\">Transform to use for the instance.</param>\n        public InstancedMesh(InstancedMeshShape meshShape, AffineTransform worldTransform)\n        {\n            this.worldTransform = worldTransform;\n            base.Shape = meshShape;\n            Events = new ContactEventManager<InstancedMesh>();\n\n\n        }\n\n        ///<summary>\n        /// Gets the shape used by the instanced mesh.\n        ///</summary>\n        public new InstancedMeshShape Shape\n        {\n            get\n            {\n                return (InstancedMeshShape)shape;\n            }\n        }\n\n        internal TriangleSidedness sidedness = TriangleSidedness.DoubleSided;\n        ///<summary>\n        /// Gets or sets the sidedness of the mesh.  This can be used to ignore collisions and rays coming from a direction relative to the winding of the triangle.\n        ///</summary>\n        public TriangleSidedness Sidedness\n        {\n            get\n            {\n                return sidedness;\n            }\n            set\n            {\n                sidedness = value;\n            }\n        }\n\n        internal bool improveBoundaryBehavior = true;\n        /// <summary>\n        /// Gets or sets whether or not the collision system should attempt to improve contact behavior at the boundaries between triangles.\n        /// This has a slight performance cost, but prevents objects sliding across a triangle boundary from 'bumping,' and otherwise improves\n        /// the robustness of contacts at edges and vertices.\n        /// </summary>\n        public bool ImproveBoundaryBehavior\n        {\n            get\n            {\n                return improveBoundaryBehavior;\n            }\n            set\n            {\n                improveBoundaryBehavior = value;\n            }\n        }\n\n\n        protected internal ContactEventManager<InstancedMesh> events;\n        ///<summary>\n        /// Gets the event manager of the mesh.\n        ///</summary>\n        public ContactEventManager<InstancedMesh> Events\n        {\n            get\n            {\n                return events;\n            }\n            set\n            {\n                if (value.Owner != null && //Can't use a manager which is owned by a different entity.\n                    value != events) //Stay quiet if for some reason the same event manager is being set.\n                    throw new ArgumentException(\"Event manager is already owned by a mesh; event managers cannot be shared.\");\n                if (events != null)\n                    events.Owner = null;\n                events = value;\n                if (events != null)\n                    events.Owner = this;\n            }\n        }\n        protected internal override IContactEventTriggerer EventTriggerer\n        {\n            get { return events; }\n        }\n\n        protected override IDeferredEventCreator EventCreator\n        {\n            get\n            {\n                return events;\n            }\n        }\n\n\n        /// <summary>\n        /// Tests a ray against the entry.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the entry, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public override bool RayCast(Ray ray, float maximumLength, out RayHit rayHit)\n        {\n            return RayCast(ray, maximumLength, sidedness, out rayHit);\n        }\n\n        ///<summary>\n        /// Tests a ray against the instance.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test.</param>\n        ///<param name=\"maximumLength\">Maximum length of the ray to test; in units of the ray's direction's length.</param>\n        ///<param name=\"sidedness\">Sidedness to use during the ray cast.  This does not have to be the same as the mesh's sidedness.</param>\n        ///<param name=\"rayHit\">The hit location of the ray on the mesh, if any.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, float maximumLength, TriangleSidedness sidedness, out RayHit rayHit)\n        {\n            //Put the ray into local space.\n            Ray localRay;\n            AffineTransform inverse;\n            AffineTransform.Invert(ref worldTransform, out inverse);\n            Matrix3x3.Transform(ref ray.Direction, ref inverse.LinearTransform, out localRay.Direction);\n            AffineTransform.Transform(ref ray.Position, ref inverse, out localRay.Position);\n\n            if (Shape.TriangleMesh.RayCast(localRay, maximumLength, sidedness, out rayHit))\n            {\n                //Transform the hit into world space.\n                Vector3.Multiply(ref ray.Direction, rayHit.T, out rayHit.Location);\n                Vector3.Add(ref rayHit.Location, ref ray.Position, out rayHit.Location);\n                Matrix3x3.TransformTranspose(ref rayHit.Normal, ref inverse.LinearTransform, out rayHit.Normal);\n                return true;\n            }\n            rayHit = new RayHit();\n            return false;\n        }\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"hit\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public override bool ConvexCast(CollisionShapes.ConvexShapes.ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayHit hit)\n        {\n            hit = new RayHit();\n            BoundingBox boundingBox;\n            castShape.GetSweptLocalBoundingBox(ref startingTransform, ref worldTransform, ref sweep, out boundingBox);\n            var tri = PhysicsResources.GetTriangle();\n            var hitElements = CommonResources.GetIntList();\n            if (this.Shape.TriangleMesh.Tree.GetOverlaps(boundingBox, hitElements))\n            {\n                hit.T = float.MaxValue;\n                for (int i = 0; i < hitElements.Count; i++)\n                {\n                    Shape.TriangleMesh.Data.GetTriangle(hitElements[i], out tri.vA, out tri.vB, out tri.vC);\n                    AffineTransform.Transform(ref tri.vA, ref worldTransform, out tri.vA);\n                    AffineTransform.Transform(ref tri.vB, ref worldTransform, out tri.vB);\n                    AffineTransform.Transform(ref tri.vC, ref worldTransform, out tri.vC);\n                    Vector3 center;\n                    Vector3.Add(ref tri.vA, ref tri.vB, out center);\n                    Vector3.Add(ref center, ref tri.vC, out center);\n                    Vector3.Multiply(ref center, 1f / 3f, out center);\n                    Vector3.Subtract(ref tri.vA, ref center, out tri.vA);\n                    Vector3.Subtract(ref tri.vB, ref center, out tri.vB);\n                    Vector3.Subtract(ref tri.vC, ref center, out tri.vC);\n                    tri.maximumRadius = tri.vA.LengthSquared();\n                    float radius = tri.vB.LengthSquared();\n                    if (tri.maximumRadius < radius)\n                        tri.maximumRadius = radius;\n                    radius = tri.vC.LengthSquared();\n                    if (tri.maximumRadius < radius)\n                        tri.maximumRadius = radius;\n                    tri.maximumRadius = (float)Math.Sqrt(tri.maximumRadius);\n                    tri.collisionMargin = 0;\n                    var triangleTransform = new RigidTransform { Orientation = Quaternion.Identity, Position = center };\n                    RayHit tempHit;\n                    if (MPRToolbox.Sweep(castShape, tri, ref sweep, ref Toolbox.ZeroVector, ref startingTransform, ref triangleTransform, out tempHit) && tempHit.T < hit.T)\n                    {\n                        hit = tempHit;\n                    }\n                }\n                tri.maximumRadius = 0;\n                PhysicsResources.GiveBack(tri);\n                CommonResources.GiveBack(hitElements);\n                return hit.T != float.MaxValue;\n            }\n            PhysicsResources.GiveBack(tri);\n            CommonResources.GiveBack(hitElements);\n            return false;\n        }\n\n    \n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/MobileCollidables/CompoundCollidable.cs",
    "content": "﻿using System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.Events;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.CollisionShapes;\nusing BEPUutilities;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.Materials;\nusing BEPUphysics.CollisionRuleManagement;\nusing System;\n\nnamespace BEPUphysics.BroadPhaseEntries.MobileCollidables\n{\n    ///<summary>\n    /// Collidable used by compound shapes.\n    ///</summary>\n    public class CompoundCollidable : EntityCollidable\n    {\n        /// <summary>\n        /// Gets or sets the event manager for the collidable.\n        /// Compound collidables must use a special CompoundEventManager in order for the deferred events created\n        /// by child collidables to be dispatched.\n        /// If this method is bypassed and a different event manager is used, this method will return null and \n        /// deferred events from children will fail.\n        /// </summary>\n        public new CompoundEventManager Events\n        {\n            get\n            {\n                return events as CompoundEventManager;\n            }\n            set\n            {\n                //Tell every child to update their parent references to the new object.\n                foreach (var child in children)\n                {\n                    child.CollisionInformation.events.Parent = value;\n                }\n                base.Events = value;\n            }\n        }\n\n        ///<summary>\n        /// Gets the shape of the collidable.\n        ///</summary>\n        public new CompoundShape Shape\n        {\n            get\n            {\n                return (CompoundShape)shape;\n            }\n            protected internal set\n            {\n                base.Shape = value;\n            }\n        }\n\n        internal RawList<CompoundChild> children = new RawList<CompoundChild>();\n        ///<summary>\n        /// Gets a list of the children in the collidable.\n        ///</summary>\n        public ReadOnlyList<CompoundChild> Children\n        {\n            get\n            {\n                return new ReadOnlyList<CompoundChild>(children);\n            }\n        }\n\n\n\n        protected override void OnEntityChanged()\n        {\n            for (int i = 0; i < children.Count; i++)\n            {\n                children.Elements[i].CollisionInformation.Entity = entity;\n                if (children.Elements[i].Material == null)\n                    children.Elements[i].Material = entity.material;\n            }\n            base.OnEntityChanged();\n        }\n\n\n\n\n        private CompoundChild GetChild(CompoundChildData data, int index)\n        {\n            var instance = data.Entry.Shape.GetCollidableInstance();\n\n            if (data.Events != null)\n                instance.Events = data.Events;\n            //Establish the link between the child event manager and our event manager.\n            instance.events.Parent = Events;\n\n            if (data.CollisionRules != null)\n                instance.CollisionRules = data.CollisionRules;\n\n            instance.Tag = data.Tag;\n\n            if (data.Material == null)\n                data.Material = new Material();\n\n            return new CompoundChild(Shape, instance, data.Material, index);\n        }\n\n        private CompoundChild GetChild(CompoundShapeEntry entry, int index)\n        {\n            var instance = entry.Shape.GetCollidableInstance();\n            //Establish the link between the child event manager and our event manager.\n            instance.events.Parent = Events;\n            return new CompoundChild(Shape, instance, index);\n        }\n\n        //Used to efficiently split compounds.\n        internal CompoundCollidable()\n        {\n            Events = new CompoundEventManager();\n\n            hierarchy = new CompoundHierarchy(this);\n\n        }\n\n        ///<summary>\n        /// Constructs a compound collidable using additional information about the shapes in the compound.\n        ///</summary>\n        ///<param name=\"children\">Data representing the children of the compound collidable.</param>\n        public CompoundCollidable(IList<CompoundChildData> children)\n        {\n            Events = new CompoundEventManager();\n\n            var shapeList = new RawList<CompoundShapeEntry>();\n            //Create the shape first.\n            for (int i = 0; i < children.Count; i++)\n            {\n                shapeList.Add(children[i].Entry);\n            }\n            base.Shape = new CompoundShape(shapeList);\n            //Now create the actual child objects.\n            for (int i = 0; i < children.Count; i++)\n            {\n                this.children.Add(GetChild(children[i], i));\n            }\n            hierarchy = new CompoundHierarchy(this);\n\n        }\n\n        ///<summary>\n        /// Constructs a compound collidable using additional information about the shapes in the compound.\n        ///</summary>\n        ///<param name=\"children\">Data representing the children of the compound collidable.</param>\n        ///<param name=\"center\">Location computed to be the center of the compound object.</param>\n        public CompoundCollidable(IList<CompoundChildData> children, out Vector3 center)\n        {\n            Events = new CompoundEventManager();\n\n            var shapeList = new RawList<CompoundShapeEntry>();\n            //Create the shape first.\n            for (int i = 0; i < children.Count; i++)\n            {\n                shapeList.Add(children[i].Entry);\n            }\n            base.Shape = new CompoundShape(shapeList, out center);\n            //Now create the actual child objects.\n            for (int i = 0; i < children.Count; i++)\n            {\n                this.children.Add(GetChild(children[i], i));\n            }\n            hierarchy = new CompoundHierarchy(this);\n\n        }\n\n\n        ///<summary>\n        /// Constructs a new CompoundCollidable.\n        ///</summary>\n        ///<param name=\"compoundShape\">Compound shape to use for the collidable.</param>\n        public CompoundCollidable(CompoundShape compoundShape)\n            : base(compoundShape)\n        {\n            Events = new CompoundEventManager();\n\n            for (int i = 0; i < compoundShape.shapes.Count; i++)\n            {\n                CompoundChild child = GetChild(compoundShape.shapes.Elements[i], i);\n                this.children.Add(child);\n            }\n            hierarchy = new CompoundHierarchy(this);\n\n\n        }\n\n\n\n\n\n\n        internal CompoundHierarchy hierarchy;\n        ///<summary>\n        /// Gets the hierarchy of children used by the collidable.\n        ///</summary>\n        public CompoundHierarchy Hierarchy\n        {\n            get\n            {\n                return hierarchy;\n            }\n        }\n\n\n        ///<summary>\n        /// Updates the world transform of the collidable.\n        ///</summary>\n        ///<param name=\"position\">Position to use for the calculation.</param>\n        ///<param name=\"orientation\">Orientation to use for the calculation.</param>\n        public override void UpdateWorldTransform(ref Vector3 position, ref Quaternion orientation)\n        {\n            base.UpdateWorldTransform(ref position, ref orientation);\n            var shapeList = Shape.shapes;\n            for (int i = 0; i < children.Count; i++)\n            {\n                RigidTransform transform;\n                RigidTransform.Transform(ref shapeList.Elements[children.Elements[i].shapeIndex].LocalTransform, ref worldTransform, out transform);\n                children.Elements[i].CollisionInformation.UpdateWorldTransform(ref transform.Position, ref transform.Orientation);\n            }\n        }\n\n        protected internal override void UpdateBoundingBoxInternal(float dt)\n        {\n            for (int i = 0; i < children.Count; i++)\n            {\n                children.Elements[i].CollisionInformation.UpdateBoundingBoxInternal(dt);\n            }\n            hierarchy.Tree.Refit();\n            boundingBox = hierarchy.Tree.BoundingBox;\n\n        }\n\n\n        /// <summary>\n        /// Tests a ray against the collidable.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the collidable, if any.</param>\n        /// <returns>Whether or not the ray hit the collidable.</returns>\n        public override bool RayCast(Ray ray, float maximumLength, out RayHit rayHit)\n        {\n            CompoundChild hitChild;\n            bool hit = RayCast(ray, maximumLength, out rayHit, out hitChild);\n            return hit;\n        }\n\n        /// <summary>\n        /// Tests a ray against the compound.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"rayHit\">Hit data and the hit child collidable, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public bool RayCast(Ray ray, float maximumLength, out RayCastResult rayHit)\n        {\n            RayHit hitData;\n            CompoundChild hitChild;\n            bool hit = RayCast(ray, maximumLength, out hitData, out hitChild);\n            rayHit = new RayCastResult { HitData = hitData, HitObject = hitChild.CollisionInformation };\n            return hit;\n        }\n\n        /// <summary>\n        /// Tests a ray against the collidable.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"rayHit\">Hit data, if any.</param>\n        /// <param name=\"hitChild\">Child collidable hit by the ray, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public bool RayCast(Ray ray, float maximumLength, out RayHit rayHit, out CompoundChild hitChild)\n        {\n            rayHit = new RayHit();\n            hitChild = null;\n            var hitElements = PhysicsResources.GetCompoundChildList();\n            if (hierarchy.Tree.GetOverlaps(ray, maximumLength, hitElements))\n            {\n                rayHit.T = float.MaxValue;\n                for (int i = 0; i < hitElements.Count; i++)\n                {\n                    EntityCollidable candidate = hitElements.Elements[i].CollisionInformation;\n                    RayHit tempHit;\n                    if (candidate.RayCast(ray, maximumLength, out tempHit) && tempHit.T < rayHit.T)\n                    {\n                        rayHit = tempHit;\n                        hitChild = hitElements.Elements[i];\n                    }\n                }\n                PhysicsResources.GiveBack(hitElements);\n                return rayHit.T != float.MaxValue;\n            }\n            PhysicsResources.GiveBack(hitElements);\n            return false;\n        }\n\n        /// <summary>\n        /// Tests a ray against the collidable.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the collidable, if any.</param>\n        /// <returns>Whether or not the ray hit the collidable.</returns>\n        public override bool RayCast(Ray ray, float maximumLength, Func<BroadPhaseEntry, bool> filter, out RayHit rayHit)\n        {\n            CompoundChild hitChild;\n            bool hit = RayCast(ray, maximumLength, filter, out rayHit, out hitChild);\n            return hit;\n        }\n\n        /// <summary>\n        /// Tests a ray against the compound.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"rayHit\">Hit data and the hit child collidable, if any.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public bool RayCast(Ray ray, float maximumLength, Func<BroadPhaseEntry, bool> filter, out RayCastResult rayHit)\n        {\n            RayHit hitData;\n            CompoundChild hitChild;\n            bool hit = RayCast(ray, maximumLength, filter, out hitData, out hitChild);\n            rayHit = new RayCastResult { HitData = hitData, HitObject = hitChild.CollisionInformation };\n            return hit;\n        }\n\n        /// <summary>\n        /// Tests a ray against the collidable.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the collidable, if any.</param>\n        /// <param name=\"hitChild\">Child hit by the ray.</param>\n        /// <returns>Whether or not the ray hit the collidable.</returns>\n        public bool RayCast(Ray ray, float maximumLength, Func<BroadPhaseEntry, bool> filter, out RayHit rayHit, out CompoundChild hitChild)\n        {\n            rayHit = new RayHit();\n            hitChild = null;\n            if (filter(this))\n            {\n                var hitElements = PhysicsResources.GetCompoundChildList();\n                if (hierarchy.Tree.GetOverlaps(ray, maximumLength, hitElements))\n                {\n                    rayHit.T = float.MaxValue;\n                    for (int i = 0; i < hitElements.Count; i++)\n                    {\n                        RayHit tempHit;\n                        if (hitElements.Elements[i].CollisionInformation.RayCast(ray, maximumLength, filter, out tempHit) && tempHit.T < rayHit.T)\n                        {\n                            rayHit = tempHit;\n                            hitChild = hitElements.Elements[i];\n                        }\n                    }\n                    PhysicsResources.GiveBack(hitElements);\n                    return rayHit.T != float.MaxValue;\n                }\n                PhysicsResources.GiveBack(hitElements);\n            }\n            return false;\n        }\n\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"rayHit\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public override bool ConvexCast(CollisionShapes.ConvexShapes.ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayHit rayHit)\n        {\n            CompoundChild hitChild;\n            bool hit = ConvexCast(castShape, ref startingTransform, ref sweep, out rayHit, out hitChild);\n            return hit;\n        }\n\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"result\">Data and hit object from the first impact, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public bool ConvexCast(CollisionShapes.ConvexShapes.ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayCastResult result)\n        {\n            CompoundChild hitChild;\n            RayHit rayHit;\n            bool hit = ConvexCast(castShape, ref startingTransform, ref sweep, out rayHit, out hitChild);\n            result = new RayCastResult { HitData = rayHit, HitObject = hitChild.CollisionInformation };\n            return hit;\n        }\n\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"hit\">Hit data, if any.</param>\n        /// <param name=\"hitChild\">Child hit by the cast.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public bool ConvexCast(CollisionShapes.ConvexShapes.ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayHit hit, out CompoundChild hitChild)\n        {\n            hit = new RayHit();\n            hitChild = null;\n            BoundingBox boundingBox;\n            castShape.GetSweptBoundingBox(ref startingTransform, ref sweep, out boundingBox);\n            var hitElements = PhysicsResources.GetCompoundChildList();\n            if (hierarchy.Tree.GetOverlaps(boundingBox, hitElements))\n            {\n                hit.T = float.MaxValue;\n                for (int i = 0; i < hitElements.Count; i++)\n                {\n                    var candidate = hitElements.Elements[i].CollisionInformation;\n                    RayHit tempHit;\n                    if (candidate.ConvexCast(castShape, ref startingTransform, ref sweep, out tempHit) && tempHit.T < hit.T)\n                    {\n                        hit = tempHit;\n                        hitChild = hitElements.Elements[i];\n                    }\n                }\n                PhysicsResources.GiveBack(hitElements);\n                return hit.T != float.MaxValue;\n            }\n            PhysicsResources.GiveBack(hitElements);\n            return false;\n        }\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <param name=\"rayHit\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public override bool ConvexCast(CollisionShapes.ConvexShapes.ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, Func<BroadPhaseEntry, bool> filter, out RayHit rayHit)\n        {\n            CompoundChild hitChild;\n            bool hit = ConvexCast(castShape, ref startingTransform, ref sweep, filter, out rayHit, out hitChild);\n            return hit;\n        }\n\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <param name=\"result\">Data and hit object from the first impact, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public bool ConvexCast(CollisionShapes.ConvexShapes.ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, Func<BroadPhaseEntry, bool> filter, out RayCastResult result)\n        {\n            CompoundChild hitChild;\n            RayHit rayHit;\n            bool hit = ConvexCast(castShape, ref startingTransform, ref sweep, filter, out rayHit, out hitChild);\n            result = new RayCastResult { HitData = rayHit, HitObject = hitChild.CollisionInformation };\n            return hit;\n        }\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <param name=\"hit\">Hit data, if any.</param>\n        /// <param name=\"hitChild\">Child hit by the cast.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public bool ConvexCast(CollisionShapes.ConvexShapes.ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, Func<BroadPhaseEntry, bool> filter, out RayHit hit, out CompoundChild hitChild)\n        {\n            hit = new RayHit();\n            hitChild = null;\n            BoundingBox boundingBox;\n            castShape.GetSweptBoundingBox(ref startingTransform, ref sweep, out boundingBox);\n            var hitElements = PhysicsResources.GetCompoundChildList();\n            if (hierarchy.Tree.GetOverlaps(boundingBox, hitElements))\n            {\n                hit.T = float.MaxValue;\n                for (int i = 0; i < hitElements.Count; i++)\n                {\n                    var candidate = hitElements.Elements[i].CollisionInformation;\n                    RayHit tempHit;\n                    if (candidate.ConvexCast(castShape, ref startingTransform, ref sweep, filter, out tempHit) && tempHit.T < hit.T)\n                    {\n                        hit = tempHit;\n                        hitChild = hitElements.Elements[i];\n                    }\n                }\n                PhysicsResources.GiveBack(hitElements);\n                return hit.T != float.MaxValue;\n            }\n            PhysicsResources.GiveBack(hitElements);\n            return false;\n        }\n\n    }\n\n    ///<summary>\n    /// Data which can be used to create a CompoundChild.\n    /// This data is not itself a child yet; another system\n    /// will use it as input to construct the children.\n    ///</summary>\n    public struct CompoundChildData\n    {\n        ///<summary>\n        /// Shape entry of the compound child.\n        ///</summary>\n        public CompoundShapeEntry Entry;\n        ///<summary>\n        /// Event manager for the new child.\n        ///</summary>\n        public ContactEventManager<EntityCollidable> Events;\n        ///<summary>\n        /// Collision rules for the new child.\n        ///</summary>\n        public CollisionRules CollisionRules;\n        ///<summary>\n        /// Material for the new child.\n        ///</summary>\n        public Material Material;\n        /// <summary>\n        /// Tag to assign to the collidable created for this child.\n        /// </summary>\n        public object Tag;\n\n    }\n\n\n    ///<summary>\n    /// A collidable child of a compound.\n    ///</summary>\n    public class CompoundChild : IBoundingBoxOwner\n    {\n        CompoundShape shape;\n        internal int shapeIndex;\n\n        /// <summary>\n        /// Gets the index of the shape used by this child in the CompoundShape's shapes list.\n        /// </summary>\n        public int ShapeIndex\n        {\n            get\n            {\n                return shapeIndex;\n            }\n        }\n\n        private EntityCollidable collisionInformation;\n        ///<summary>\n        /// Gets the Collidable associated with the child.\n        ///</summary>\n        public EntityCollidable CollisionInformation\n        {\n            get\n            {\n                return collisionInformation;\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the material associated with the child.\n        ///</summary>\n        public Material Material { get; set; }\n\n        /// <summary>\n        /// Gets the index of the shape associated with this child in the CompoundShape's shapes list.\n        /// </summary>\n        public CompoundShapeEntry Entry\n        {\n            get\n            {\n                return shape.shapes.Elements[shapeIndex];\n            }\n\n        }\n\n        internal CompoundChild(CompoundShape shape, EntityCollidable collisionInformation, Material material, int index)\n        {\n            this.shape = shape;\n            this.collisionInformation = collisionInformation;\n            Material = material;\n            this.shapeIndex = index;\n        }\n\n        internal CompoundChild(CompoundShape shape, EntityCollidable collisionInformation, int index)\n        {\n            this.shape = shape;\n            this.collisionInformation = collisionInformation;\n            this.shapeIndex = index;\n        }\n\n        /// <summary>\n        /// Gets the bounding box of the child.\n        /// </summary>\n        public BoundingBox BoundingBox\n        {\n            get { return collisionInformation.boundingBox; }\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/MobileCollidables/CompoundHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.CollisionShapes;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\nusing BEPUphysics.Entities;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.BroadPhaseEntries.MobileCollidables\n{\n    /// <summary>\n    /// Contains methods to help with splitting compound objects into multiple pieces.\n    /// </summary>\n    public static class CompoundHelper\n    {\n        /// <summary>\n        /// Splits a single compound collidable into two separate compound collidables and computes information needed by the simulation.\n        /// </summary>\n        /// <param name=\"splitPredicate\">Delegate which determines if a child in the original compound should be moved to the new compound.</param>\n        /// <param name=\"a\">Original compound to be split.  Children in this compound will be removed and added to the other compound.</param>\n        /// <param name=\"b\">Compound to receive children removed from the original compound.</param>\n        /// <returns>Whether or not the predicate returned true for any element in the original compound and split the compound.</returns>\n        public static bool SplitCompound(Func<CompoundChild, bool> splitPredicate,\n            Entity<CompoundCollidable> a, out Entity<CompoundCollidable> b)\n        {\n            var childContributions = a.CollisionInformation.Shape.ComputeChildContributions();\n            return SplitCompound(childContributions, splitPredicate, a, out b);\n        }\n        /// <summary>\n        /// Splits a single compound collidable into two separate compound collidables and computes information needed by the simulation.\n        /// </summary>\n        /// <param name=\"childContributions\">List of distribution information associated with each child shape of the whole compound shape used by the compound being split.</param>\n        /// <param name=\"splitPredicate\">Delegate which determines if a child in the original compound should be moved to the new compound.</param>\n        /// <param name=\"a\">Original compound to be split.  Children in this compound will be removed and added to the other compound.</param>\n        /// <param name=\"b\">Compound to receive children removed from the original compound.</param>\n        /// <returns>Whether or not the predicate returned true for any element in the original compound and split the compound.</returns>\n        public static bool SplitCompound(IList<ShapeDistributionInformation> childContributions, Func<CompoundChild, bool> splitPredicate,\n            Entity<CompoundCollidable> a, out Entity<CompoundCollidable> b)\n        {\n\n            ShapeDistributionInformation distributionInfoA, distributionInfoB;\n            if (SplitCompound(childContributions, splitPredicate, a, out b, out distributionInfoA, out distributionInfoB))\n            {\n                return true;\n            }\n            else\n                return false;\n        }\n\n        /// <summary>\n        /// Splits a single compound collidable into two separate compound collidables and computes information needed by the simulation.\n        /// </summary>\n        /// <param name=\"childContributions\">List of distribution information associated with each child shape of the whole compound shape used by the compound being split.</param>\n        /// <param name=\"splitPredicate\">Delegate which determines if a child in the original compound should be moved to the new compound.</param>\n        /// <param name=\"a\">Original compound to be split.  Children in this compound will be removed and added to the other compound.</param>\n        /// <param name=\"b\">Compound to receive children removed from the original compound.</param>\n        /// <param name=\"distributionInfoA\">Volume, volume distribution, and center information about the new form of the original compound collidable.</param>\n        /// <param name=\"distributionInfoB\">Volume, volume distribution, and center information about the new compound collidable.</param>\n        /// <returns>Whether or not the predicate returned true for any element in the original compound and split the compound.</returns>\n        public static bool SplitCompound(IList<ShapeDistributionInformation> childContributions, Func<CompoundChild, bool> splitPredicate,\n                        Entity<CompoundCollidable> a, out Entity<CompoundCollidable> b,\n                        out ShapeDistributionInformation distributionInfoA, out ShapeDistributionInformation distributionInfoB)\n        {\n            var bCollidable = new CompoundCollidable { Shape = a.CollisionInformation.Shape };\n            b = null;\n\n\n            float weightA, weightB;\n            if (SplitCompound(childContributions, splitPredicate, a.CollisionInformation, bCollidable, out distributionInfoA, out distributionInfoB, out weightA, out weightB))\n            {\n                //Reconfigure the entities using the data computed in the split.\n                float originalMass = a.mass;\n                if (a.CollisionInformation.children.Count > 0)\n                {\n                    float newMassA = (weightA / (weightA + weightB)) * originalMass;\n                    Matrix3x3.Multiply(ref distributionInfoA.VolumeDistribution, newMassA * InertiaHelper.InertiaTensorScale, out distributionInfoA.VolumeDistribution);\n                    a.Initialize(a.CollisionInformation, newMassA, distributionInfoA.VolumeDistribution, distributionInfoA.Volume);\n                }\n                if (bCollidable.children.Count > 0)\n                {\n                    float newMassB = (weightB / (weightA + weightB)) * originalMass;\n                    Matrix3x3.Multiply(ref distributionInfoB.VolumeDistribution, newMassB * InertiaHelper.InertiaTensorScale, out distributionInfoB.VolumeDistribution);\n                    b = new Entity<CompoundCollidable>();\n                    b.Initialize(bCollidable, newMassB, distributionInfoB.VolumeDistribution, distributionInfoB.Volume);\n                }\n\n                SplitReposition(a, b, ref distributionInfoA, ref distributionInfoB, weightA, weightB);\n                return true;\n            }\n            else\n                return false;\n        }\n\n        static void SplitReposition(Entity a, Entity b, ref ShapeDistributionInformation distributionInfoA, ref ShapeDistributionInformation distributionInfoB, float weightA, float weightB)\n        {\n            //The compounds are not aligned with the original's position yet.\n            //In order to align them, first look at the centers the split method computed.\n            //They are offsets from the center of the original shape in local space.\n            //These can be used to reposition the objects in world space.\n            Vector3 weightedA, weightedB;\n            Vector3.Multiply(ref distributionInfoA.Center, weightA, out weightedA);\n            Vector3.Multiply(ref distributionInfoB.Center, weightB, out weightedB);\n            Vector3 newLocalCenter;\n            Vector3.Add(ref weightedA, ref weightedB, out newLocalCenter);\n            Vector3.Divide(ref newLocalCenter, weightA + weightB, out newLocalCenter);\n\n            Vector3 localOffsetA;\n            Vector3 localOffsetB;\n            Vector3.Subtract(ref distributionInfoA.Center, ref newLocalCenter, out localOffsetA);\n            Vector3.Subtract(ref distributionInfoB.Center, ref newLocalCenter, out localOffsetB);\n\n            Vector3 originalPosition = a.position;\n\n            b.Orientation = a.Orientation;\n            Vector3 offsetA = Vector3.Transform(localOffsetA, a.Orientation);\n            Vector3 offsetB = Vector3.Transform(localOffsetB, a.Orientation);\n            a.Position = originalPosition + offsetA;\n            b.Position = originalPosition + offsetB;\n\n            Vector3 originalLinearVelocity = a.linearVelocity;\n            Vector3 originalAngularVelocity = a.angularVelocity;\n            a.AngularVelocity = originalAngularVelocity;\n            b.AngularVelocity = originalAngularVelocity;\n            a.LinearVelocity = originalLinearVelocity + Vector3.Cross(originalAngularVelocity, offsetA);\n            b.LinearVelocity = originalLinearVelocity + Vector3.Cross(originalAngularVelocity, offsetB);\n        }\n\n\n        /// <summary>\n        /// Splits a single compound collidable into two separate compound collidables and computes information needed by the simulation.\n        /// </summary>\n        /// <param name=\"splitPredicate\">Delegate which determines if a child in the original compound should be moved to the new compound.</param>\n        /// <param name=\"a\">Original compound to be split.  Children in this compound will be removed and added to the other compound.</param>\n        /// <param name=\"b\">Compound to receive children removed from the original compound.</param>\n        /// <returns>Whether or not the predicate returned true for any element in the original compound and split the compound.</returns>\n        public static bool SplitCompound(Func<CompoundChild, bool> splitPredicate,\n            Entity<CompoundCollidable> a, Entity<CompoundCollidable> b)\n        {\n            var childContributions = a.CollisionInformation.Shape.ComputeChildContributions();\n            if (SplitCompound(childContributions, splitPredicate, a, b))\n            {\n                return true;\n            }\n            else\n                return false;\n        }\n\n\n        /// <summary>\n        /// Splits a single compound collidable into two separate compound collidables and computes information needed by the simulation.\n        /// </summary>\n        /// <param name=\"childContributions\">List of distribution information associated with each child shape of the whole compound shape used by the compound being split.</param>\n        /// <param name=\"splitPredicate\">Delegate which determines if a child in the original compound should be moved to the new compound.</param>\n        /// <param name=\"a\">Original compound to be split.  Children in this compound will be removed and added to the other compound.</param>\n        /// <param name=\"b\">Compound to receive children removed from the original compound.</param>\n        /// <returns>Whether or not the predicate returned true for any element in the original compound and split the compound.</returns>\n        public static bool SplitCompound(IList<ShapeDistributionInformation> childContributions, Func<CompoundChild, bool> splitPredicate,\n            Entity<CompoundCollidable> a, Entity<CompoundCollidable> b)\n        {\n            ShapeDistributionInformation distributionInfoA, distributionInfoB;\n            if (SplitCompound(childContributions, splitPredicate, a, b, out distributionInfoA, out distributionInfoB))\n            {\n                return true;\n            }\n            else\n                return false;\n        }\n\n        /// <summary>\n        /// Splits a single compound collidable into two separate compound collidables and computes information needed by the simulation.\n        /// </summary>\n        /// <param name=\"childContributions\">List of distribution information associated with each child shape of the whole compound shape used by the compound being split.</param>\n        /// <param name=\"splitPredicate\">Delegate which determines if a child in the original compound should be moved to the new compound.</param>\n        /// <param name=\"distributionInfoA\">Volume, volume distribution, and center information about the new form of the original compound collidable.</param>\n        /// <param name=\"distributionInfoB\">Volume, volume distribution, and center information about the new compound collidable.</param>\n        /// <param name=\"a\">Original compound to be split.  Children in this compound will be removed and added to the other compound.</param>\n        /// <param name=\"b\">Compound to receive children removed from the original compound.</param>\n        /// <returns>Whether or not the predicate returned true for any element in the original compound and split the compound.</returns>\n        public static bool SplitCompound(IList<ShapeDistributionInformation> childContributions, Func<CompoundChild, bool> splitPredicate,\n                        Entity<CompoundCollidable> a, Entity<CompoundCollidable> b,\n                        out ShapeDistributionInformation distributionInfoA, out ShapeDistributionInformation distributionInfoB)\n        {\n            float weightA, weightB;\n            if (SplitCompound(childContributions, splitPredicate, a.CollisionInformation, b.CollisionInformation, out distributionInfoA, out distributionInfoB, out weightA, out weightB))\n            {\n                //Reconfigure the entities using the data computed in the split.\n                float originalMass = a.mass;\n                if (a.CollisionInformation.children.Count > 0)\n                {\n                    float newMassA = (weightA / (weightA + weightB)) * originalMass;\n                    Matrix3x3.Multiply(ref distributionInfoA.VolumeDistribution, newMassA * InertiaHelper.InertiaTensorScale, out distributionInfoA.VolumeDistribution);\n                    a.Initialize(a.CollisionInformation, newMassA, distributionInfoA.VolumeDistribution, distributionInfoA.Volume);\n                }\n\n                if (b.CollisionInformation.children.Count > 0)\n                {\n                    float newMassB = (weightB / (weightA + weightB)) * originalMass;\n                    Matrix3x3.Multiply(ref distributionInfoB.VolumeDistribution, newMassB * InertiaHelper.InertiaTensorScale, out distributionInfoB.VolumeDistribution);\n                    b.Initialize(b.CollisionInformation, newMassB, distributionInfoB.VolumeDistribution, distributionInfoB.Volume);\n                }\n\n                SplitReposition(a, b, ref distributionInfoA, ref distributionInfoB, weightA, weightB);\n\n                return true;\n            }\n            else\n                return false;\n        }\n\n        /// <summary>\n        /// Splits a single compound collidable into two separate compound collidables and computes information needed by the simulation.\n        /// </summary>\n        /// <param name=\"childContributions\">List of distribution information associated with each child shape of the whole compound shape used by the compound being split.</param>\n        /// <param name=\"splitPredicate\">Delegate which determines if a child in the original compound should be moved to the new compound.</param>\n        /// <param name=\"a\">Original compound to be split.  Children in this compound will be removed and added to the other compound.</param>\n        /// <param name=\"b\">Compound to receive children removed from the original compound.</param>\n        /// <param name=\"distributionInfoA\">Volume, volume distribution, and center information about the new form of the original compound collidable.</param>\n        /// <param name=\"distributionInfoB\">Volume, volume distribution, and center information about the new compound collidable.</param>\n        /// <param name=\"weightA\">Total weight associated with the new form of the original compound collidable.</param>\n        /// <param name=\"weightB\">Total weight associated with the new compound collidable.</param>\n        /// <returns>Whether or not the predicate returned true for any element in the original compound and split the compound.</returns>\n        public static bool SplitCompound(IList<ShapeDistributionInformation> childContributions, Func<CompoundChild, bool> splitPredicate,\n            CompoundCollidable a, CompoundCollidable b,\n            out ShapeDistributionInformation distributionInfoA, out ShapeDistributionInformation distributionInfoB,\n            out float weightA, out float weightB)\n        {\n            bool splitOccurred = false;\n            for (int i = a.children.Count - 1; i >= 0; i--)\n            {\n                //The shape doesn't change during this process.  The entity could, though.\n                //All of the other collidable information, like the Tag, CollisionRules, Events, etc. all stay the same.\n                var child = a.children.Elements[i];\n                if (splitPredicate(child))\n                {\n                    splitOccurred = true;\n\n                    a.children.FastRemoveAt(i);\n                    b.children.Add(child);\n                    //The child event handler must be unhooked from the old compound and given to the new one.\n                    child.CollisionInformation.events.Parent = b.Events;\n                }\n            }\n\n            if (!splitOccurred)\n            {\n                //No split occurred, so we cannot proceed.\n                distributionInfoA = new ShapeDistributionInformation();\n                distributionInfoB = new ShapeDistributionInformation();\n                weightA = 0;\n                weightB = 0;\n                return false;\n            }\n\n            //Compute the contributions from the original shape to the new form of the original collidable.\n            distributionInfoA = new ShapeDistributionInformation();\n            weightA = 0;\n            distributionInfoB = new ShapeDistributionInformation();\n            weightB = 0;\n            for (int i = a.children.Count - 1; i >= 0; i--)\n            {\n                var child = a.children.Elements[i];\n                var entry = child.Entry;\n                var contribution = childContributions[child.shapeIndex];\n                Vector3.Add(ref contribution.Center, ref entry.LocalTransform.Position, out contribution.Center);\n                Vector3.Multiply(ref contribution.Center, child.Entry.Weight, out contribution.Center);\n                Vector3.Add(ref contribution.Center, ref distributionInfoA.Center, out distributionInfoA.Center);\n                distributionInfoA.Volume += contribution.Volume;\n                weightA += entry.Weight;\n            }\n            for (int i = b.children.Count - 1; i >= 0; i--)\n            {\n                var child = b.children.Elements[i];\n                var entry = child.Entry;\n                var contribution = childContributions[child.shapeIndex];\n                Vector3.Add(ref contribution.Center, ref entry.LocalTransform.Position, out contribution.Center);\n                Vector3.Multiply(ref contribution.Center, child.Entry.Weight, out contribution.Center);\n                Vector3.Add(ref contribution.Center, ref distributionInfoB.Center, out distributionInfoB.Center);\n                distributionInfoB.Volume += contribution.Volume;\n                weightB += entry.Weight;\n            }\n\n            //Average the center out.\n            if (weightA > 0)\n                Vector3.Divide(ref distributionInfoA.Center, weightA, out distributionInfoA.Center);\n\n            if (weightB > 0)\n                Vector3.Divide(ref distributionInfoB.Center, weightB, out distributionInfoB.Center);\n\n            //Note that the 'entry' is from the Shape, and so the translations are local to the shape's center.\n            //That is not technically the center of the new collidable- distributionInfoA.Center is.\n            //Offset the child collidables by -distributionInfoA.Center using their local offset.\n            Vector3 offsetA;\n            Vector3.Negate(ref distributionInfoA.Center, out offsetA);\n            Vector3 offsetB;\n            Vector3.Negate(ref distributionInfoB.Center, out offsetB);\n\n            //Compute the unscaled inertia tensor.\n            for (int i = a.children.Count - 1; i >= 0; i--)\n            {\n                var child = a.children.Elements[i];\n                var entry = child.Entry;\n                Vector3 transformedOffset;\n                Quaternion conjugate;\n                Quaternion.Conjugate(ref entry.LocalTransform.Orientation, out conjugate);\n                Vector3.Transform(ref offsetA, ref conjugate, out transformedOffset);\n                child.CollisionInformation.localPosition = transformedOffset;\n                var contribution = childContributions[child.shapeIndex];\n                CompoundShape.TransformContribution(ref entry.LocalTransform, ref distributionInfoA.Center, ref contribution.VolumeDistribution, entry.Weight, out contribution.VolumeDistribution);\n                //Vector3.Add(ref entry.LocalTransform.Position, ref offsetA, out entry.LocalTransform.Position);\n                Matrix3x3.Add(ref contribution.VolumeDistribution, ref distributionInfoA.VolumeDistribution, out distributionInfoA.VolumeDistribution);\n            }\n            for (int i = b.children.Count - 1; i >= 0; i--)\n            {\n                var child = b.children.Elements[i];\n                var entry = child.Entry;\n                Vector3 transformedOffset;\n                Quaternion conjugate;\n                Quaternion.Conjugate(ref entry.LocalTransform.Orientation, out conjugate);\n                Vector3.Transform(ref offsetB, ref conjugate, out transformedOffset);\n                child.CollisionInformation.localPosition = transformedOffset;\n                var contribution = childContributions[child.shapeIndex];\n                CompoundShape.TransformContribution(ref entry.LocalTransform, ref distributionInfoB.Center, ref contribution.VolumeDistribution, entry.Weight, out contribution.VolumeDistribution);\n                //Vector3.Add(ref entry.LocalTransform.Position, ref offsetB, out entry.LocalTransform.Position);\n                Matrix3x3.Add(ref contribution.VolumeDistribution, ref distributionInfoB.VolumeDistribution, out distributionInfoB.VolumeDistribution);\n            }\n\n            //Normalize the volume distribution.\n            Matrix3x3.Multiply(ref distributionInfoA.VolumeDistribution, 1 / weightA, out distributionInfoA.VolumeDistribution);\n            Matrix3x3.Multiply(ref distributionInfoB.VolumeDistribution, 1 / weightB, out distributionInfoB.VolumeDistribution);\n\n            //Update the hierarchies of the compounds.\n            //TODO: Create a new method that does this quickly without garbage.  Requires a new Reconstruct method which takes a pool which stores the appropriate node types.\n            a.hierarchy.Tree.Reconstruct(a.children);\n            b.hierarchy.Tree.Reconstruct(b.children);\n\n            return true;\n        }\n\n\n        static void RemoveReposition(Entity compound, ref ShapeDistributionInformation distributionInfo, float weight, float removedWeight, ref Vector3 removedCenter)\n        {\n            //The compounds are not aligned with the original's position yet.\n            //In order to align them, first look at the centers the split method computed.\n            //They are offsets from the center of the original shape in local space.\n            //These can be used to reposition the objects in world space.\n            Vector3 weightedA, weightedB;\n            Vector3.Multiply(ref distributionInfo.Center, weight, out weightedA);\n            Vector3.Multiply(ref removedCenter, removedWeight, out weightedB);\n            Vector3 newLocalCenter;\n            Vector3.Add(ref weightedA, ref weightedB, out newLocalCenter);\n            Vector3.Divide(ref newLocalCenter, weight + removedWeight, out newLocalCenter);\n\n            Vector3 localOffset;\n            Vector3.Subtract(ref distributionInfo.Center, ref newLocalCenter, out localOffset);\n\n            Vector3 originalPosition = compound.position;\n\n            Vector3 offset = Vector3.Transform(localOffset, compound.orientation);\n            compound.Position = originalPosition + offset;\n\n            Vector3 originalLinearVelocity = compound.linearVelocity;\n            Vector3 originalAngularVelocity = compound.angularVelocity;\n            compound.AngularVelocity = originalAngularVelocity;\n            compound.LinearVelocity = originalLinearVelocity + Vector3.Cross(originalAngularVelocity, offset);\n        }\n\n        /// <summary>\n        /// Removes a child from a compound body.\n        /// </summary>\n        /// <param name=\"childContributions\">List of distribution information associated with each child shape of the whole compound shape used by the compound being split.</param>\n        /// <param name=\"removalPredicate\">Delegate which determines if a child in the original compound should be moved to the new compound.</param>\n        /// <param name=\"compound\">Original compound to have a child removed.</param>\n        /// <returns>Whether or not the predicate returned true for any element in the original compound and split the compound.</returns>\n        public static bool RemoveChildFromCompound(Entity<CompoundCollidable> compound, Func<CompoundChild, bool> removalPredicate, IList<ShapeDistributionInformation> childContributions)\n        {\n            ShapeDistributionInformation distributionInfo;\n            if (RemoveChildFromCompound(compound, removalPredicate, childContributions, out distributionInfo))\n            {\n                return true;\n            }\n            else\n                return false;\n        }\n\n        /// <summary>\n        /// Removes a child from a compound body.\n        /// </summary>\n        /// <param name=\"childContributions\">List of distribution information associated with each child shape of the whole compound shape used by the compound being split.</param>\n        /// <param name=\"removalPredicate\">Delegate which determines if a child in the original compound should be moved to the new compound.</param>\n        /// <param name=\"distributionInfo\">Volume, volume distribution, and center information about the new form of the original compound collidable.</param>\n        /// <param name=\"compound\">Original compound to have a child removed.</param>\n        /// <returns>Whether or not the predicate returned true for any element in the original compound and split the compound.</returns>\n        public static bool RemoveChildFromCompound(Entity<CompoundCollidable> compound, Func<CompoundChild, bool> removalPredicate, IList<ShapeDistributionInformation> childContributions,\n                        out ShapeDistributionInformation distributionInfo)\n        {\n            float weight;\n            float removedWeight;\n            Vector3 removedCenter;\n            if (RemoveChildFromCompound(compound.CollisionInformation, removalPredicate, childContributions, out distributionInfo, out weight, out removedWeight, out removedCenter))\n            {\n                //Reconfigure the entities using the data computed in the split.\n                //Only bother if there are any children left in the compound!\n                if (compound.CollisionInformation.Children.Count > 0)\n                {\n                    float originalMass = compound.mass;\n                    float newMass = (weight / (weight + removedWeight)) * originalMass;\n                    Matrix3x3.Multiply(ref distributionInfo.VolumeDistribution, newMass * InertiaHelper.InertiaTensorScale, out distributionInfo.VolumeDistribution);\n                    compound.Initialize(compound.CollisionInformation, newMass, distributionInfo.VolumeDistribution, distributionInfo.Volume);\n\n                    RemoveReposition(compound, ref distributionInfo, weight, removedWeight, ref removedCenter);\n                }\n\n                return true;\n            }\n            else\n                return false;\n        }\n\n        /// <summary>\n        /// Removes a child from a compound collidable.\n        /// </summary>\n        /// <param name=\"compound\">Compound collidable to remove a child from.</param>\n        /// <param name=\"removalPredicate\">Callback which analyzes a child and determines if it should be removed from the compound.</param>\n        /// <param name=\"childContributions\">Distribution contributions from all shapes in the compound shape.  This can include shapes which are not represented in the compound.</param>\n        /// <param name=\"distributionInfo\">Distribution information of the new compound.</param>\n        /// <param name=\"weight\">Total weight of the new compound.</param>\n        /// <param name=\"removedWeight\">Weight removed from the compound.</param>\n        /// <param name=\"removedCenter\">Center of the chunk removed from the compound.</param>\n        /// <returns>Whether or not any removal took place.</returns>\n        public static bool RemoveChildFromCompound(CompoundCollidable compound, Func<CompoundChild, bool> removalPredicate, IList<ShapeDistributionInformation> childContributions,\n           out ShapeDistributionInformation distributionInfo, out float weight, out float removedWeight, out Vector3 removedCenter)\n        {\n            bool removalOccurred = false;\n            removedWeight = 0;\n            removedCenter = new Vector3();\n            for (int i = compound.children.Count - 1; i >= 0; i--)\n            {\n                //The shape doesn't change during this process.  The entity could, though.\n                //All of the other collidable information, like the Tag, CollisionRules, Events, etc. all stay the same.\n                var child = compound.children.Elements[i];\n                if (removalPredicate(child))\n                {\n                    removalOccurred = true;\n                    var entry = child.Entry;\n                    removedWeight += entry.Weight;\n                    Vector3 toAdd;\n                    Vector3.Multiply(ref entry.LocalTransform.Position, entry.Weight, out toAdd);\n                    Vector3.Add(ref removedCenter, ref toAdd, out removedCenter);\n                    //The child event handler must be unhooked from the compound.\n                    child.CollisionInformation.events.Parent = null;\n                    compound.children.FastRemoveAt(i);\n                }\n            }\n\n            if (!removalOccurred)\n            {\n                //No removal occurred, so we cannot proceed.\n                distributionInfo = new ShapeDistributionInformation();\n                weight = 0;\n                return false;\n            }\n            if (removedWeight > 0)\n            {\n                Vector3.Divide(ref removedCenter, removedWeight, out removedCenter);\n            }\n\n            //Compute the contributions from the original shape to the new form of the original collidable.\n            distributionInfo = new ShapeDistributionInformation();\n            weight = 0;\n            for (int i = compound.children.Count - 1; i >= 0; i--)\n            {\n                var child = compound.children.Elements[i];\n                var entry = child.Entry;\n                var contribution = childContributions[child.shapeIndex];\n                Vector3.Add(ref contribution.Center, ref entry.LocalTransform.Position, out contribution.Center);\n                Vector3.Multiply(ref contribution.Center, child.Entry.Weight, out contribution.Center);\n                Vector3.Add(ref contribution.Center, ref distributionInfo.Center, out distributionInfo.Center);\n                distributionInfo.Volume += contribution.Volume;\n                weight += entry.Weight;\n            }\n            //Average the center out.\n            Vector3.Divide(ref distributionInfo.Center, weight, out distributionInfo.Center);\n\n            //Note that the 'entry' is from the Shape, and so the translations are local to the shape's center.\n            //That is not technically the center of the new collidable- distributionInfo.Center is.\n            //Offset the child collidables by -distributionInfo.Center using their local offset.\n            Vector3 offset;\n            Vector3.Negate(ref distributionInfo.Center, out offset);\n\n            //Compute the unscaled inertia tensor.\n            for (int i = compound.children.Count - 1; i >= 0; i--)\n            {\n                var child = compound.children.Elements[i];\n                var entry = child.Entry;\n                Vector3 transformedOffset;\n                Quaternion conjugate;\n                Quaternion.Conjugate(ref entry.LocalTransform.Orientation, out conjugate);\n                Vector3.Transform(ref offset, ref conjugate, out transformedOffset);\n                child.CollisionInformation.localPosition = transformedOffset;\n                var contribution = childContributions[child.shapeIndex];\n                CompoundShape.TransformContribution(ref entry.LocalTransform, ref distributionInfo.Center, ref contribution.VolumeDistribution, entry.Weight, out contribution.VolumeDistribution);\n                //Vector3.Add(ref entry.LocalTransform.Position, ref offsetA, out entry.LocalTransform.Position);\n                Matrix3x3.Add(ref contribution.VolumeDistribution, ref distributionInfo.VolumeDistribution, out distributionInfo.VolumeDistribution);\n            }\n\n            //Normalize the volume distribution.\n            Matrix3x3.Multiply(ref distributionInfo.VolumeDistribution, 1 / weight, out distributionInfo.VolumeDistribution);\n\n            //Update the hierarchies of the compounds.\n            //TODO: Create a new method that does this quickly without garbage.  Requires a new Reconstruct method which takes a pool which stores the appropriate node types.\n            compound.hierarchy.Tree.Reconstruct(compound.children);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Constructs a compound collidable containing only the specified subset of children.\n        /// </summary>\n        /// <param name=\"shape\">Shape to base the compound collidable on.</param>\n        /// <param name=\"childIndices\">Indices of child shapes from the CompoundShape to include in the compound collidable.</param>\n        /// <returns>Compound collidable containing only the specified subset of children.</returns>\n        public static CompoundCollidable CreatePartialCompoundCollidable(CompoundShape shape, IList<int> childIndices)\n        {\n            if (childIndices.Count == 0)\n                throw new ArgumentException(\"Cannot create a compound from zero shapes.\");\n            \n            CompoundCollidable compound = new CompoundCollidable();\n            Vector3 center = new Vector3();\n            float totalWeight = 0;\n            for (int i = 0; i < childIndices.Count; i++)\n            {\n                //Create and add the child object itself.\n                var entry = shape.shapes[childIndices[i]];\n                compound.children.Add(new CompoundChild(shape, entry.Shape.GetCollidableInstance(), childIndices[i]));\n                //Grab its entry to compute the center of mass of this subset.\n                Vector3 toAdd;\n                Vector3.Multiply(ref entry.LocalTransform.Position, entry.Weight, out toAdd);\n                Vector3.Add(ref center, ref toAdd, out center);\n                totalWeight += entry.Weight;\n            }\n            if (totalWeight <= 0)\n            {\n                throw new ArgumentException(\"Compound has zero total weight; invalid configuration.\");\n            }\n            Vector3.Divide(ref center, totalWeight, out center);\n            //Our subset of the compound is not necessarily aligned with the shape's origin.\n            //By default, an object will rotate around the center of the collision shape.\n            //We can't modify the shape data itself since it could be shared, which leaves\n            //modifying the local position of the collidable.\n            //We have the subset position in shape space, so pull the collidable back into alignment\n            //with the origin.\n            //This approach matches the rest of the CompoundHelper's treatment of subsets.\n            compound.LocalPosition = -center;\n\n            //Recompute the hierarchy for the compound.\n            compound.hierarchy.Tree.Reconstruct(compound.children);\n            compound.Shape = shape;\n            return compound;\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/MobileCollidables/CompoundHierarchy.cs",
    "content": "﻿using System;\nusing BEPUphysics.DataStructures;\n\nnamespace BEPUphysics.BroadPhaseEntries.MobileCollidables\n{\n    ///<summary>\n    /// Hierarchy of children used to accelerate queries and tests for compound collidables.\n    ///</summary>\n    public class CompoundHierarchy\n    {\n        private BoundingBoxTree<CompoundChild> tree;\n        ///<summary>\n        /// Gets the bounding box tree of the hierarchy.\n        ///</summary>\n        public BoundingBoxTree<CompoundChild> Tree\n        {\n            get\n            {\n                return tree;\n            }\n        }\n\n        private CompoundCollidable owner;\n        ///<summary>\n        /// Gets the CompoundCollidable that owns this hierarchy.\n        ///</summary>\n        public CompoundCollidable Owner\n        {\n            get\n            {\n                return owner;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new compound hierarchy.\n        ///</summary>\n        ///<param name=\"owner\">Owner of the hierarchy.</param>\n        public CompoundHierarchy(CompoundCollidable owner)\n        {\n            this.owner = owner;\n            var children = new CompoundChild[owner.children.Count];\n            Array.Copy(owner.children.Elements, children, owner.children.Count);\n            //In order to initialize a good tree, the local space bounding boxes should first be computed.\n            //Otherwise, the tree would try to create a hierarchy based on a bunch of zeroed out bounding boxes!\n            for (int i = 0; i < children.Length; i++)\n            {\n                children[i].CollisionInformation.worldTransform = owner.Shape.shapes.Elements[i].LocalTransform;\n                children[i].CollisionInformation.UpdateBoundingBoxInternal(0);\n            }\n            tree = new BoundingBoxTree<CompoundChild>(children);\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/MobileCollidables/ConvexCollidable.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries.Events;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing System;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\n\nnamespace BEPUphysics.BroadPhaseEntries.MobileCollidables\n{\n    ///<summary>\n    /// Collidable with a convex shape.\n    ///</summary>\n    public abstract class ConvexCollidable : EntityCollidable\n    {\n\n        protected ConvexCollidable(ConvexShape shape)\n            : base(shape)\n        {\n            Events = new ContactEventManager<EntityCollidable>();\n        }\n\n        ///<summary>\n        /// Gets the shape of the collidable.\n        ///</summary>\n        public new ConvexShape Shape\n        {\n            get\n            {\n                return (ConvexShape)shape;\n            }\n        }\n\n\n        public override bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayHit hit)\n        {\n            return MPRToolbox.Sweep(castShape, Shape, ref sweep, ref Toolbox.ZeroVector, ref startingTransform, ref worldTransform, out hit);\n        }\n\n    }\n\n    ///<summary>\n    /// Collidable with a convex shape of a particular type.\n    ///</summary>\n    ///<typeparam name=\"T\">ConvexShape type.</typeparam>\n    public class ConvexCollidable<T> : ConvexCollidable where T : ConvexShape\n    {\n        ///<summary>\n        /// Gets the shape of the collidable.\n        ///</summary>\n        public new T Shape\n        {\n            get\n            {\n                return (T)shape;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new convex collidable.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use in the collidable.</param>\n        public ConvexCollidable(T shape)\n            : base(shape)\n        {\n\n        }\n\n\n        /// <summary>\n        /// Tests a ray against the entry.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the entry, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public override bool RayCast(Ray ray, float maximumLength, out RayHit rayHit)\n        {\n            return Shape.RayTest(ref ray, ref worldTransform, maximumLength, out rayHit);\n        }\n\n\n\n        protected internal override void UpdateBoundingBoxInternal(float dt)\n        {\n            Shape.GetBoundingBox(ref worldTransform, out boundingBox);\n\n            ExpandBoundingBox(ref boundingBox, dt);\n        }\n\n\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/MobileCollidables/EntityCollidable.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries.Events;\nusing BEPUphysics.CollisionShapes;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Settings;\nusing System;\nusing BEPUphysics.PositionUpdating;\n\nnamespace BEPUphysics.BroadPhaseEntries.MobileCollidables\n{\n    ///<summary>\n    /// Mobile collidable acting as a collision proxy for an entity.\n    ///</summary>\n    public abstract class EntityCollidable : MobileCollidable\n    {\n        protected EntityCollidable()\n        {\n            //This constructor is used when the subclass is going to set the shape after doing some extra initialization.\n        }\n\n        protected EntityCollidable(EntityShape shape)\n        {\n            base.Shape = shape;\n        }\n\n\n\n\n\n        /// <summary>\n        /// Gets the shape of the collidable.\n        /// </summary>\n        public new EntityShape Shape\n        {\n            get\n            {\n                return (EntityShape)shape;\n            }\n            protected set\n            {\n                base.Shape = value;\n            }\n        }\n\n        protected internal Entity entity;\n        ///<summary>\n        /// Gets the entity owning the collidable.\n        ///</summary>\n        public Entity Entity\n        {\n            get\n            {\n                return entity;\n            }\n            protected internal set\n            {\n                entity = value;\n                OnEntityChanged();\n            }\n        }\n\n\n        protected virtual void OnEntityChanged()\n        {\n        }\n\n        protected internal RigidTransform worldTransform;\n        ///<summary>\n        /// Gets or sets the world transform of the collidable.\n        /// The EntityCollidable's LocalPosition is ignored for this process; the shape will end up\n        /// centered exactly on the world transform.\n        /// Setting this property also updates the bounding box.\n        ///</summary>\n        public RigidTransform WorldTransform\n        {\n            get\n            {\n                return worldTransform;\n            }\n            set\n            {\n                //Remove the local position.  The UpdateBoundingBoxForTransform will reintroduce it; we want the final result to put the shape (i.e. the WorldTransform) right where defined.\n                Quaternion conjugate;\n                Quaternion.Conjugate(ref value.Orientation, out conjugate);\n                Vector3 worldOffset;\n                Vector3.Transform(ref localPosition, ref conjugate, out worldOffset);\n                Vector3.Subtract(ref value.Position, ref worldOffset, out value.Position);\n                UpdateBoundingBoxForTransform(ref value);\n            }\n        }\n\n        protected internal override bool IsActive\n        {\n            get\n            {\n                return entity != null ? entity.activityInformation.IsActive : false;\n            }\n        }\n\n        protected internal Vector3 localPosition;\n        ///<summary>\n        /// Gets or sets the local position of the collidable.\n        /// The local position can be used to offset the collision geometry\n        /// from an entity's center of mass.\n        ///</summary>\n        public Vector3 LocalPosition\n        {\n            get\n            {\n                return localPosition;\n            }\n            set\n            {\n                localPosition = value;\n\n                localPosition.Validate();\n            }\n        }\n\n        ///<summary>\n        /// Updates the bounding box of the mobile collidable according to the associated entity's current state.\n        /// Do not use this if the EntityCollidable does not have an associated entity; consider using\n        /// UpdateBoundingBoxForTransform instead.\n        ///</summary>\n        public override void UpdateBoundingBox()\n        {\n            UpdateBoundingBox(0);\n        }\n\n        ///<summary>\n        /// Updates the bounding box of the mobile collidable according to the associated entity's current state.\n        /// Do not use this if the EntityCollidable does not have an associated entity; consider using\n        /// UpdateBoundingBoxForTransform instead.\n        ///</summary>\n        ///<param name=\"dt\">Timestep with which to update the bounding box.</param>\n        public override void UpdateBoundingBox(float dt)\n        {\n            //The world transform update isn't strictly required for uninterrupted simulation.\n            //The entity update method manages the world transforms.\n            //However, the redundancy allows a user to change the position in between frames.\n            //If the order of the space update changes to position-update-first, this is completely unnecessary.\n            UpdateWorldTransform(ref entity.position, ref entity.orientation);\n            UpdateBoundingBoxInternal(dt);\n        }\n\n        ///<summary>\n        /// Updates the world transform of the shape using the given position and orientation.\n        /// The world transform of the shape is offset from the given position and orientation by the collidable's LocalPosition.\n        ///</summary>\n        ///<param name=\"position\">Position to use for the calculation.</param>\n        ///<param name=\"orientation\">Orientation to use for the calculation.</param>\n        public virtual void UpdateWorldTransform(ref Vector3 position, ref Quaternion orientation)\n        {\n            Vector3.Transform(ref localPosition, ref orientation, out worldTransform.Position);\n            Vector3.Add(ref worldTransform.Position, ref position, out worldTransform.Position);\n            worldTransform.Orientation = orientation;\n\n            worldTransform.Validate();\n        }\n\n        /// <summary>\n        /// Updates the collidable's world transform and bounding box.  The transform provided\n        /// will be offset by the collidable's LocalPosition to get the shape transform.\n        /// This is a convenience method for external modification of the collidable's data.\n        /// </summary>\n        /// <param name=\"transform\">Transform to use for the collidable.</param>\n        /// <param name=\"dt\">Duration of the simulation time step.  Used to expand the\n        /// bounding box using the owning entity's velocity.  If the collidable\n        /// does not have an owning entity, this must be zero.</param>\n        public void UpdateBoundingBoxForTransform(ref RigidTransform transform, float dt)\n        {\n            UpdateWorldTransform(ref transform.Position, ref transform.Orientation);\n            UpdateBoundingBoxInternal(dt);\n        }\n\n\n        /// <summary>\n        /// Updates the collidable's world transform and bounding box.\n        /// This is a convenience method for external modification of the collidable's data.\n        /// </summary>\n        /// <param name=\"transform\">Transform to use for the collidable.</param>\n        public void UpdateBoundingBoxForTransform(ref RigidTransform transform)\n        {\n            UpdateBoundingBoxForTransform(ref transform, 0);\n        }\n\n\n        protected internal abstract void UpdateBoundingBoxInternal(float dt);\n\n        //Helper method for mobile collidables.\n        internal void ExpandBoundingBox(ref BoundingBox boundingBox, float dt)\n        {\n            //Expand bounding box with velocity.\n            if (dt > 0)\n            {\n                bool useExtraExpansion = MotionSettings.UseExtraExpansionForContinuousBoundingBoxes && entity.PositionUpdateMode == PositionUpdateMode.Continuous;\n                float velocityScaling = useExtraExpansion ? 2 : 1;\n                if (entity.linearVelocity.X > 0)\n                    boundingBox.Max.X += entity.linearVelocity.X * dt * velocityScaling;\n                else\n                    boundingBox.Min.X += entity.linearVelocity.X * dt * velocityScaling;\n\n                if (entity.linearVelocity.Y > 0)\n                    boundingBox.Max.Y += entity.linearVelocity.Y * dt * velocityScaling;\n                else\n                    boundingBox.Min.Y += entity.linearVelocity.Y * dt * velocityScaling;\n\n                if (entity.linearVelocity.Z > 0)\n                    boundingBox.Max.Z += entity.linearVelocity.Z * dt * velocityScaling;\n                else\n                    boundingBox.Min.Z += entity.linearVelocity.Z * dt * velocityScaling;\n\n\n\n\n                if (useExtraExpansion)\n                {\n                    float expansion = 0;\n                    //It's possible that an object could have a small bounding box since its own\n                    //velocity is low, but then a collision with a high velocity object sends\n                    //it way out of its bounding box.  By taking into account high velocity objects\n                    //in danger of hitting us and expanding our own bounding box by their speed,\n                    //we stand a much better chance of not missing secondary collisions.\n                    foreach (var e in OverlappedEntities)\n                    {\n\n                        float velocity = e.linearVelocity.LengthSquared();\n                        if (velocity > expansion)\n                            expansion = velocity;\n                    }\n                    expansion = (float)Math.Sqrt(expansion) * dt;\n\n\n                    boundingBox.Min.X -= expansion;\n                    boundingBox.Min.Y -= expansion;\n                    boundingBox.Min.Z -= expansion;\n\n                    boundingBox.Max.X += expansion;\n                    boundingBox.Max.Y += expansion;\n                    boundingBox.Max.Z += expansion;\n\n                }\n\n                //Could use this to incorporate angular motion.  Since the bounding box is an approximation to begin with,\n                //this isn't too important.  If an updating system is used where the bounding box MUST fully contain the frame's motion\n                //then the commented area should be used.\n                //Math.Min(entity.angularVelocity.Length() * dt, Shape.maximumRadius) * velocityScaling;\n                //TODO: consider using minimum radius \n\n            }\n\n            boundingBox.Validate();\n        }\n\n\n\n        protected override void CollisionRulesUpdated()\n        {\n            //Try to activate the entity since our collision rules just changed; broadphase might need to update some stuff.\n            //Beware, though; if this collidable is still being constructed, then the entity won't be available.\n            if (entity != null)\n                entity.activityInformation.Activate();\n        }\n\n\n        protected internal ContactEventManager<EntityCollidable> events;\n        ///<summary>\n        /// Gets or sets the event manager of the collidable.\n        ///</summary>\n        public ContactEventManager<EntityCollidable> Events\n        {\n            get\n            {\n                return events;\n            }\n            set\n            {\n                if (value.Owner != null && //Can't use a manager which is owned by a different entity.\n                    value != events) //Stay quiet if for some reason the same event manager is being set.\n                    throw new ArgumentException(\"Event manager is already owned by an entity; event managers cannot be shared.\");\n                //Must pass on the link to the parent event manager to the new event manager in case we are the child of a compound.\n                CompoundEventManager oldParent = null;\n                if (events != null)\n                {\n                    events.Owner = null;\n                    oldParent = events.Parent;\n                    events.Parent = null;\n                }\n                events = value;\n                if (events != null)\n                {\n                    events.Owner = this;\n                    events.Parent = oldParent;\n                }\n            }\n        }\n        protected internal override IContactEventTriggerer EventTriggerer\n        {\n            get { return events; }\n        }\n\n\n        ///<summary>\n        /// Gets an enumerable collection of all entities overlapping this collidable.\n        ///</summary>\n        public EntityCollidableCollection OverlappedEntities\n        {\n            get\n            {\n                return new EntityCollidableCollection(this);\n            }\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/MobileCollidables/MobileCollidable.cs",
    "content": "﻿namespace BEPUphysics.BroadPhaseEntries.MobileCollidables\n{\n    //This is implemented by anything which wants the engine to update its bounding box every frame (so long as it is 'active').\n    ///<summary>\n    /// Superclass of all collidables which are capable of movement, and thus need bounding box updates every frame.\n    ///</summary>\n    public abstract class MobileCollidable : Collidable\n    {\n        //TODO: Imagine needing to calculate the bounding box for a data structure that is not axis-aligned.  Being able to return BB without 'setting' would be helpful.\n        //Possibly require second method.  The parameterless one uses 'self data' to do the calculation, as a sort of convenience.  The parameterful would return without setting.\n        ///<summary>\n        /// Updates the bounding box of the mobile collidable.\n        ///</summary>\n        ///<param name=\"dt\">Timestep with which to update the bounding box.</param>\n        public abstract void UpdateBoundingBox(float dt);\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/MobileCollidables/MobileMeshCollidable.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries.Events;\nusing BEPUphysics.CollisionShapes;\nusing BEPUutilities;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing System;\n\nnamespace BEPUphysics.BroadPhaseEntries.MobileCollidables\n{\n    ///<summary>\n    /// Collidable used by compound shapes.\n    ///</summary>\n    public class MobileMeshCollidable : EntityCollidable\n    {\n        ///<summary>\n        /// Gets the shape of the collidable.\n        ///</summary>\n        public new MobileMeshShape Shape\n        {\n            get\n            {\n                return (MobileMeshShape)shape;\n            }\n        }\n\n        /// <summary>\n        /// Constructs a new mobile mesh collidable.\n        /// </summary>\n        /// <param name=\"shape\">Shape to use in the collidable.</param>\n        public MobileMeshCollidable(MobileMeshShape shape)\n            : base(shape)\n        {\n            Events = new ContactEventManager<EntityCollidable>();\n        }\n\n\n\n        internal bool improveBoundaryBehavior = true;\n        /// <summary>\n        /// Gets or sets whether or not the collision system should attempt to improve contact behavior at the boundaries between triangles.\n        /// This has a slight performance cost, but prevents objects sliding across a triangle boundary from 'bumping,' and otherwise improves\n        /// the robustness of contacts at edges and vertices.\n        /// </summary>\n        public bool ImproveBoundaryBehavior\n        {\n            get\n            {\n                return improveBoundaryBehavior;\n            }\n            set\n            {\n                improveBoundaryBehavior = value;\n            }\n        }\n\n        protected internal override void UpdateBoundingBoxInternal(float dt)\n        {\n            Shape.GetBoundingBox(ref worldTransform, out boundingBox);\n\n            //This DOES NOT EXPAND the local hierarchy.\n            //The bounding boxes of queries against the local hierarchy\n            //should be expanded using the relative velocity.\n            ExpandBoundingBox(ref boundingBox, dt);\n        }\n\n\n\n\n        /// <summary>\n        /// Tests a ray against the entry.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the entry, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public override bool RayCast(Ray ray, float maximumLength, out RayHit rayHit)\n        {\n            //Put the ray into local space.\n            Ray localRay;\n            Matrix3x3 orientation;\n            Matrix3x3.CreateFromQuaternion(ref worldTransform.Orientation, out orientation);\n            Matrix3x3.TransformTranspose(ref ray.Direction, ref orientation, out localRay.Direction);\n            Vector3.Subtract(ref ray.Position, ref worldTransform.Position, out localRay.Position);\n            Matrix3x3.TransformTranspose(ref localRay.Position, ref orientation, out localRay.Position);\n\n\n            if (Shape.solidity == MobileMeshSolidity.Solid)\n            {\n                //Find all hits.  Use the count to determine the ray started inside or outside.\n                //If it starts inside and we're in 'solid' mode, then return the ray start.\n                //The raycast must be of infinite length at first.  This allows it to determine\n                //if it is inside or outside.\n                if (Shape.IsLocalRayOriginInMesh(ref localRay, out rayHit))\n                {\n                    //It was inside!\n                    rayHit = new RayHit() { Location = ray.Position, Normal = Vector3.Zero, T = 0 };\n                    return true;\n\n                }\n                else\n                {\n                    if (rayHit.T < maximumLength)\n                    {\n                        //Transform the hit into world space.\n                        Vector3.Multiply(ref ray.Direction, rayHit.T, out rayHit.Location);\n                        Vector3.Add(ref rayHit.Location, ref ray.Position, out rayHit.Location);\n                        Matrix3x3.Transform(ref rayHit.Normal, ref orientation, out rayHit.Normal);\n                    }\n                    else\n                    {\n                        //The hit was too far away, or there was no hit (in which case T would be float.MaxValue).\n                        return false;\n                    }\n                    return true;\n                }\n            }\n            else\n            {\n                //Just do a normal raycast since the object isn't solid.\n                TriangleSidedness sidedness;\n                switch (Shape.solidity)\n                {\n                    case MobileMeshSolidity.Clockwise:\n                        sidedness = TriangleSidedness.Clockwise;\n                        break;\n                    case MobileMeshSolidity.Counterclockwise:\n                        sidedness = TriangleSidedness.Counterclockwise;\n                        break;\n                    default:\n                        sidedness = TriangleSidedness.DoubleSided;\n                        break;\n                }\n                if (Shape.TriangleMesh.RayCast(localRay, maximumLength, sidedness, out rayHit))\n                {\n                    //Transform the hit into world space.\n                    Vector3.Multiply(ref ray.Direction, rayHit.T, out rayHit.Location);\n                    Vector3.Add(ref rayHit.Location, ref ray.Position, out rayHit.Location);\n                    Matrix3x3.Transform(ref rayHit.Normal, ref orientation, out rayHit.Normal);\n                    return true;\n                }\n            }\n            rayHit = new RayHit();\n            return false;\n        }\n\n        ///<summary>\n        /// Tests a ray against the surface of the mesh.  This does not take into account solidity.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test.</param>\n        ///<param name=\"maximumLength\">Maximum length of the ray to test; in units of the ray's direction's length.</param>\n        ///<param name=\"sidedness\">Sidedness to use during the ray cast.  This does not have to be the same as the mesh's sidedness.</param>\n        ///<param name=\"rayHit\">The hit location of the ray on the mesh, if any.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, float maximumLength, TriangleSidedness sidedness, out RayHit rayHit)\n        {\n            //Put the ray into local space.\n            Ray localRay;\n            Matrix3x3 orientation;\n            Matrix3x3.CreateFromQuaternion(ref worldTransform.Orientation, out orientation);\n            Matrix3x3.TransformTranspose(ref ray.Direction, ref orientation, out localRay.Direction);\n            Vector3.Subtract(ref ray.Position, ref worldTransform.Position, out localRay.Position);\n            Matrix3x3.TransformTranspose(ref localRay.Position, ref orientation, out localRay.Position);\n\n            if (Shape.TriangleMesh.RayCast(localRay, maximumLength, sidedness, out rayHit))\n            {\n                //Transform the hit into world space.\n                Vector3.Multiply(ref ray.Direction, rayHit.T, out rayHit.Location);\n                Vector3.Add(ref rayHit.Location, ref ray.Position, out rayHit.Location);\n                Matrix3x3.Transform(ref rayHit.Normal, ref orientation, out rayHit.Normal);\n                return true;\n            }\n            rayHit = new RayHit();\n            return false;\n        }\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"hit\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public override bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayHit hit)\n        {\n            if (Shape.solidity == MobileMeshSolidity.Solid)\n            {\n                //If the convex cast is inside the mesh and the mesh is solid, it should return t = 0.\n                var ray = new Ray() { Position = startingTransform.Position, Direction = Toolbox.UpVector };\n                if (Shape.IsLocalRayOriginInMesh(ref ray, out hit))\n                {\n\n                    hit = new RayHit() { Location = startingTransform.Position, Normal = new Vector3(), T = 0 };\n                    return true;\n                }\n            }\n            hit = new RayHit();\n            BoundingBox boundingBox;\n            var transform = new AffineTransform {Translation = worldTransform.Position};\n            Matrix3x3.CreateFromQuaternion(ref worldTransform.Orientation, out transform.LinearTransform);\n            castShape.GetSweptLocalBoundingBox(ref startingTransform, ref transform, ref sweep, out boundingBox);\n            var tri = PhysicsResources.GetTriangle();\n            var hitElements = CommonResources.GetIntList();\n            if (this.Shape.TriangleMesh.Tree.GetOverlaps(boundingBox, hitElements))\n            {\n                hit.T = float.MaxValue;\n                for (int i = 0; i < hitElements.Count; i++)\n                {\n                    Shape.TriangleMesh.Data.GetTriangle(hitElements[i], out tri.vA, out tri.vB, out tri.vC);\n                    AffineTransform.Transform(ref tri.vA, ref transform, out tri.vA);\n                    AffineTransform.Transform(ref tri.vB, ref transform, out tri.vB);\n                    AffineTransform.Transform(ref tri.vC, ref transform, out tri.vC);\n                    Vector3 center;\n                    Vector3.Add(ref tri.vA, ref tri.vB, out center);\n                    Vector3.Add(ref center, ref tri.vC, out center);\n                    Vector3.Multiply(ref center, 1f / 3f, out center);\n                    Vector3.Subtract(ref tri.vA, ref center, out tri.vA);\n                    Vector3.Subtract(ref tri.vB, ref center, out tri.vB);\n                    Vector3.Subtract(ref tri.vC, ref center, out tri.vC);\n                    tri.maximumRadius = tri.vA.LengthSquared();\n                    float radius = tri.vB.LengthSquared();\n                    if (tri.maximumRadius < radius)\n                        tri.maximumRadius = radius;\n                    radius = tri.vC.LengthSquared();\n                    if (tri.maximumRadius < radius)\n                        tri.maximumRadius = radius;\n                    tri.maximumRadius = (float)Math.Sqrt(tri.maximumRadius);\n                    tri.collisionMargin = 0;\n                    var triangleTransform = new RigidTransform {Orientation = Quaternion.Identity, Position = center};\n                    RayHit tempHit;\n                    if (MPRToolbox.Sweep(castShape, tri, ref sweep, ref Toolbox.ZeroVector, ref startingTransform, ref triangleTransform, out tempHit) && tempHit.T < hit.T)\n                    {\n                        hit = tempHit;\n                    }\n                }\n                tri.maximumRadius = 0;\n                PhysicsResources.GiveBack(tri);\n                CommonResources.GiveBack(hitElements);\n                return hit.T != float.MaxValue;\n            }\n            PhysicsResources.GiveBack(tri);\n            CommonResources.GiveBack(hitElements);\n            return false;\n        }\n    }\n\n\n\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/MobileCollidables/TriangleCollidable.cs",
    "content": "﻿using BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.BroadPhaseEntries.MobileCollidables\n{\n    ///<summary>\n    /// Special case collidable for reuseable triangles.\n    ///</summary>\n    public class TriangleCollidable : ConvexCollidable<TriangleShape>\n    {\n        ///<summary>\n        /// Constructs a new shapeless collidable.\n        ///</summary>\n        public TriangleCollidable()\n            : base(new TriangleShape())\n        {\n        }\n\n        ///<summary>\n        /// Constructs the triangle collidable using the given shape.\n        ///</summary>\n        ///<param name=\"shape\">TriangleShape to use in the collidable.</param>\n        public TriangleCollidable(TriangleShape shape)\n            : base(shape)\n        {\n        }\n\n        ///<summary>\n        /// Initializes the collidable using the new triangle shape, but does NOT\n        /// fire any shape-changed events.\n        ///</summary>\n        ///<param name=\"a\">First vertex in the triangle.</param>\n        ///<param name=\"b\">Second vertex in the triangle. </param>\n        ///<param name=\"c\">Third vertex in the triangle. </param>\n        public void Initialize(ref Vector3 a, ref Vector3 b, ref Vector3 c)\n        {\n            var shape = Shape;\n            shape.collisionMargin = 0;\n            shape.sidedness = TriangleSidedness.DoubleSided;\n            shape.vA = a;\n            shape.vB = b;\n            shape.vC = c;\n        }\n\n        ///<summary>\n        /// Cleans up the collidable by removing all events.\n        ///</summary>\n        public void CleanUp()\n        {\n            events.RemoveAllEvents();\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/StaticCollidable.cs",
    "content": "﻿using System;\nusing BEPUphysics.CollisionShapes;\nusing BEPUphysics.Materials;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.OtherSpaceStages;\n\nnamespace BEPUphysics.BroadPhaseEntries\n{\n    ///<summary>\n    /// Superclass of static collidable objects which can be added directly to a space.  Static objects cannot move.\n    ///</summary>\n    public abstract class StaticCollidable : Collidable, ISpaceObject, IMaterialOwner, IDeferredEventCreatorOwner\n    {\n\n\n        ///<summary>\n        /// Performs common initialization.\n        ///</summary>\n        protected StaticCollidable()\n        {\n            collisionRules.group = CollisionRules.DefaultKinematicCollisionGroup;\n            //Note that the Events manager is not created here.  That is left for subclasses to implement so that the type is more specific.\n            //Entities can get away with having EntityCollidable specificity since you generally care more about the entity than the collidable,\n            //but with static objects, the collidable is the only important object.  It would be annoying to cast to the type you know it is every time\n            //just to get access to some type-specific properties.\n\n            material = new Material();\n            materialChangedDelegate = OnMaterialChanged;\n            material.MaterialChanged += materialChangedDelegate;\n        }\n\n        protected override void OnShapeChanged(CollisionShape collisionShape)\n        {\n            if (!IgnoreShapeChanges)\n                UpdateBoundingBox();\n        }\n\n        internal Material material;\n        //NOT thread safe due to material change pair update.\n        ///<summary>\n        /// Gets or sets the material used by the collidable.\n        ///</summary>\n        public Material Material\n        {\n            get\n            {\n                return material;\n            }\n            set\n            {\n                if (material != null)\n                    material.MaterialChanged -= materialChangedDelegate;\n                material = value;\n                if (material != null)\n                    material.MaterialChanged += materialChangedDelegate;\n                OnMaterialChanged(material);\n            }\n        }\n\n        Action<Material> materialChangedDelegate;\n        protected virtual void OnMaterialChanged(Material newMaterial)\n        {\n            for (int i = 0; i < pairs.Count; i++)\n            {\n                pairs[i].UpdateMaterialProperties();\n            }\n        }\n\n        protected internal override bool IsActive\n        {\n            get { return false; }\n        }\n\n        \n\n        ISpace space;\n        ISpace ISpaceObject.Space\n        {\n            get\n            {\n                return space;\n            }\n            set\n            {\n                space = value;\n            }\n        }\n        ///<summary>\n        /// Gets the space that owns the mesh.\n        ///</summary>\n        public ISpace Space\n        {\n            get\n            {\n                return space;\n            }\n        }\n\n        void ISpaceObject.OnAdditionToSpace(ISpace newSpace)\n        {\n        }\n\n        void ISpaceObject.OnRemovalFromSpace(ISpace oldSpace)\n        {\n        }\n\n\n\n        IDeferredEventCreator IDeferredEventCreatorOwner.EventCreator\n        {\n            get\n            {\n                return EventCreator;\n            }\n        }\n\n        /// <summary>\n        /// Gets the event creator associated with this collidable.\n        /// </summary>\n        protected abstract IDeferredEventCreator EventCreator\n        {\n            get;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/StaticGroup.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries.Events;\nusing BEPUphysics.CollisionShapes;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUphysics.OtherSpaceStages;\nusing System.Collections.Generic;\nusing RigidTransform = BEPUutilities.RigidTransform;\n\nnamespace BEPUphysics.BroadPhaseEntries\n{\n    ///<summary>\n    /// Collection of unmoving collidable objects.\n    ///</summary>\n    ///<remarks>\n    /// Batching multiple static objects together into a StaticGroup as opposed to adding them separately to the Space avoids BroadPhase pollution, improving performance.\n    /// </remarks>\n    public class StaticGroup : StaticCollidable\n    {\n\n\n        ///<summary>\n        /// Constructs a new static mesh.\n        ///</summary>\n        ///<param name=\"collidables\">List of collidables in the static group.</param>\n        public StaticGroup(IList<Collidable> collidables)\n        {\n            shape = new StaticGroupShape(collidables, this);\n            Events = new ContactEventManager<StaticGroup>();\n\n        }\n\n        ///<summary>\n        /// Gets the shape used by the mesh.  Unlike most collidable-shape pairs, StaticGroupShapes cannot be shared between multiple StaticGroups.\n        ///</summary>\n        public new StaticGroupShape Shape\n        {\n            get\n            {\n                return (StaticGroupShape)shape;\n            }\n        }\n\n\n        protected internal ContactEventManager<StaticGroup> events;\n\n        ///<summary>\n        /// Gets the event manager used by the mesh.\n        ///</summary>\n        public ContactEventManager<StaticGroup> Events\n        {\n            get\n            {\n                return events;\n            }\n            set\n            {\n                if (value.Owner != null && //Can't use a manager which is owned by a different entity.\n                    value != events) //Stay quiet if for some reason the same event manager is being set.\n                    throw new ArgumentException(\"Event manager is already owned by a mesh; event managers cannot be shared.\");\n                if (events != null)\n                    events.Owner = null;\n                events = value;\n                if (events != null)\n                    events.Owner = this;\n            }\n        }\n        protected internal override IContactEventTriggerer EventTriggerer\n        {\n            get { return events; }\n        }\n        protected override IDeferredEventCreator EventCreator\n        {\n            get { return events; }\n        }\n\n\n        /// <summary>\n        /// Updates the bounding box to the current state of the entry.\n        /// </summary>\n        public override void UpdateBoundingBox()\n        {\n            boundingBox = Shape.CollidableTree.BoundingBox;\n        }\n\n        /// <summary>\n        /// Tests a ray against the entry.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the entry, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public override bool RayCast(Ray ray, float maximumLength, out RayHit rayHit)\n        {\n            RayCastResult result;\n            bool toReturn = Shape.RayCast(ray, maximumLength, out result);\n            rayHit = result.HitData;\n            return toReturn;\n        }\n\n        /// <summary>\n        /// Tests a ray against the entry.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the entry, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public override bool RayCast(Ray ray, float maximumLength, Func<BroadPhaseEntry, bool> filter, out RayHit rayHit)\n        {\n            RayCastResult result;\n            bool toReturn = Shape.RayCast(ray, maximumLength, filter, out result);\n            rayHit = result.HitData;\n            return toReturn;\n        }\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"hit\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public override bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayHit hit)\n        {\n            RayCastResult result;\n            bool toReturn = Shape.ConvexCast(castShape, ref startingTransform, ref sweep, out result);\n            hit = result.HitData;\n            return toReturn;\n        }\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <param name=\"hit\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public override bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, Func<BroadPhaseEntry, bool> filter, out RayHit hit)\n        {\n            RayCastResult result;\n            bool toReturn = Shape.ConvexCast(castShape, ref startingTransform, ref sweep, filter, out result);\n            hit = result.HitData;\n            return toReturn;\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/StaticMesh.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries.Events;\nusing BEPUphysics.CollisionShapes;\nusing BEPUphysics.DataStructures;\nusing BEPUutilities;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUphysics.OtherSpaceStages;\n\nnamespace BEPUphysics.BroadPhaseEntries\n{\n    ///<summary>\n    /// Unmoving, collidable triangle mesh.\n    ///</summary>\n    ///<remarks>\n    /// The acceleration structure for the mesh is created individually for each\n    /// StaticMesh; if you want to create many meshes of the same model, consider using the\n    /// InstancedMesh.\n    /// </remarks>\n    public class StaticMesh : StaticCollidable\n    {\n\n        TriangleMesh mesh;\n        ///<summary>\n        /// Gets the TriangleMesh acceleration structure used by the StaticMesh.\n        ///</summary>\n        public TriangleMesh Mesh\n        {\n            get\n            {\n                return mesh;\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the world transform of the mesh.\n        ///</summary>\n        public AffineTransform WorldTransform\n        {\n            get\n            {\n                return ((TransformableMeshData)mesh.Data).worldTransform;\n            }\n            set\n            {\n                ((TransformableMeshData)mesh.Data).WorldTransform = value;\n                mesh.Tree.Refit();\n                UpdateBoundingBox();\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new static mesh.\n        ///</summary>\n        ///<param name=\"vertices\">Vertex positions of the mesh.</param>\n        ///<param name=\"indices\">Index list of the mesh.</param>\n        public StaticMesh(Vector3[] vertices, uint[] indices, int indexCount)\n        {\n            base.Shape = new StaticMeshShape(vertices, indices, indexCount);\n            Events = new ContactEventManager<StaticMesh>();\n\n        }\n\n        ///<summary>\n        /// Constructs a new static mesh.\n        ///</summary>\n        ///<param name=\"vertices\">Vertex positions of the mesh.</param>\n        ///<param name=\"indices\">Index list of the mesh.</param>\n        /// <param name=\"worldTransform\">Transform to use to create the mesh initially.</param>\n        public StaticMesh(Vector3[] vertices, uint[] indices, int indexCount, AffineTransform worldTransform)\n        {\n            base.Shape = new StaticMeshShape(vertices, indices, indexCount, worldTransform);\n            Events = new ContactEventManager<StaticMesh>();\n        }\n\n        ///<summary>\n        /// Gets the shape used by the mesh.\n        ///</summary>\n        public new StaticMeshShape Shape\n        {\n            get\n            {\n                return (StaticMeshShape)shape;\n            }\n        }\n\n        internal TriangleSidedness sidedness = TriangleSidedness.DoubleSided;\n        ///<summary>\n        /// Gets or sets the sidedness of the mesh.  This can be used to ignore collisions and rays coming from a direction relative to the winding of the triangle.\n        ///</summary>\n        public TriangleSidedness Sidedness\n        {\n            get\n            {\n                return sidedness;\n            }\n            set\n            {\n                sidedness = value;\n            }\n        }\n\n        internal bool improveBoundaryBehavior = true;\n        /// <summary>\n        /// Gets or sets whether or not the collision system should attempt to improve contact behavior at the boundaries between triangles.\n        /// This has a slight performance cost, but prevents objects sliding across a triangle boundary from 'bumping,' and otherwise improves\n        /// the robustness of contacts at edges and vertices.\n        /// </summary>\n        public bool ImproveBoundaryBehavior\n        {\n            get\n            {\n                return improveBoundaryBehavior;\n            }\n            set\n            {\n                improveBoundaryBehavior = value;\n            }\n        }\n\n\n        protected internal ContactEventManager<StaticMesh> events;\n\n        ///<summary>\n        /// Gets the event manager used by the mesh.\n        ///</summary>\n        public ContactEventManager<StaticMesh> Events\n        {\n            get\n            {\n                return events;\n            }\n            set\n            {\n                if (value.Owner != null && //Can't use a manager which is owned by a different entity.\n                    value != events) //Stay quiet if for some reason the same event manager is being set.\n                    throw new ArgumentException(\"Event manager is already owned by a mesh; event managers cannot be shared.\");\n                if (events != null)\n                    events.Owner = null;\n                events = value;\n                if (events != null)\n                    events.Owner = this;\n            }\n        }\n        protected internal override IContactEventTriggerer EventTriggerer\n        {\n            get { return events; }\n        }\n        protected override IDeferredEventCreator EventCreator\n        {\n            get { return events; }\n        }\n\n        protected override void OnShapeChanged(CollisionShape collisionShape)\n        {\n            if (!IgnoreShapeChanges)\n            {\n                mesh = new TriangleMesh(Shape.TriangleMeshData);\n                UpdateBoundingBox();\n            }\n        }\n\n        /// <summary>\n        /// Updates the bounding box to the current state of the entry.\n        /// </summary>\n        public override void UpdateBoundingBox()\n        {\n            boundingBox = mesh.Tree.BoundingBox;\n        }\n\n        /// <summary>\n        /// Tests a ray against the entry.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the entry, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public override bool RayCast(Ray ray, float maximumLength, out RayHit rayHit)\n        {\n            return mesh.RayCast(ray, maximumLength, sidedness, out rayHit);\n        }\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"hit\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public override bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayHit hit)\n        {\n            hit = new RayHit();\n            BoundingBox boundingBox;\n            castShape.GetSweptBoundingBox(ref startingTransform, ref sweep, out boundingBox);\n            var tri = PhysicsResources.GetTriangle();\n            var hitElements = CommonResources.GetIntList();\n            if (Mesh.Tree.GetOverlaps(boundingBox, hitElements))\n            {\n                hit.T = float.MaxValue;\n                for (int i = 0; i < hitElements.Count; i++)\n                {\n                    mesh.Data.GetTriangle(hitElements[i], out tri.vA, out tri.vB, out tri.vC);\n                    Vector3 center;\n                    Vector3.Add(ref tri.vA, ref tri.vB, out center);\n                    Vector3.Add(ref center, ref tri.vC, out center);\n                    Vector3.Multiply(ref center, 1f / 3f, out center);\n                    Vector3.Subtract(ref tri.vA, ref center, out tri.vA);\n                    Vector3.Subtract(ref tri.vB, ref center, out tri.vB);\n                    Vector3.Subtract(ref tri.vC, ref center, out tri.vC);\n                    tri.maximumRadius = tri.vA.LengthSquared();\n                    float radius = tri.vB.LengthSquared();\n                    if (tri.maximumRadius < radius)\n                        tri.maximumRadius = radius;\n                    radius = tri.vC.LengthSquared(); \n                    if (tri.maximumRadius < radius)\n                        tri.maximumRadius = radius;\n                    tri.maximumRadius = (float)Math.Sqrt(tri.maximumRadius);\n                    tri.collisionMargin = 0;\n                    var triangleTransform = new RigidTransform {Orientation = Quaternion.Identity, Position = center};\n                    RayHit tempHit;\n                    if (MPRToolbox.Sweep(castShape, tri, ref sweep, ref Toolbox.ZeroVector, ref startingTransform, ref triangleTransform, out tempHit) && tempHit.T < hit.T)\n                    {\n                        hit = tempHit;\n                    }\n                }\n                tri.maximumRadius = 0;\n                PhysicsResources.GiveBack(tri);\n                CommonResources.GiveBack(hitElements);\n                return hit.T != float.MaxValue;\n            }\n            PhysicsResources.GiveBack(tri);\n            CommonResources.GiveBack(hitElements);\n            return false;\n        }\n\n        ///<summary>\n        /// Tests a ray against the mesh.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test.</param>\n        ///<param name=\"maximumLength\">Maximum length to test in units of the ray direction's length.</param>\n        ///<param name=\"sidedness\">Sidedness to use when raycasting.  Doesn't have to be the same as the mesh's own sidedness.</param>\n        ///<param name=\"rayHit\">Data about the ray's intersection with the mesh, if any.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, float maximumLength, TriangleSidedness sidedness, out RayHit rayHit)\n        {\n            return mesh.RayCast(ray, maximumLength, sidedness, out rayHit);\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseEntries/Terrain.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries.Events;\nusing BEPUutilities;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUphysics.OtherSpaceStages;\n\nnamespace BEPUphysics.BroadPhaseEntries\n{\n    ///<summary>\n    /// Heightfield-based unmovable collidable object.\n    ///</summary>\n    public class Terrain : StaticCollidable\n    {\n        ///<summary>\n        /// Gets the shape of this collidable.\n        ///</summary>\n        public new TerrainShape Shape\n        {\n            get\n            {\n                return (TerrainShape)shape;\n            }\n            set\n            {\n                base.Shape = value;\n            }\n        }\n\n\n        internal AffineTransform worldTransform;\n        ///<summary>\n        /// Gets or sets the affine transform of the terrain.\n        ///</summary>\n        public AffineTransform WorldTransform\n        {\n            get\n            {\n                return worldTransform;\n            }\n            set\n            {\n                worldTransform = value;\n            }\n        }\n\n\n        internal bool improveBoundaryBehavior = true;\n        /// <summary>\n        /// Gets or sets whether or not the collision system should attempt to improve contact behavior at the boundaries between triangles.\n        /// This has a slight performance cost, but prevents objects sliding across a triangle boundary from 'bumping,' and otherwise improves\n        /// the robustness of contacts at edges and vertices.\n        /// </summary>\n        public bool ImproveBoundaryBehavior\n        {\n            get\n            {\n                return improveBoundaryBehavior;\n            }\n            set\n            {\n                improveBoundaryBehavior = value;\n            }\n        }\n\n        protected internal ContactEventManager<Terrain> events;\n        ///<summary>\n        /// Gets the event manager used by the Terrain.\n        ///</summary>\n        public ContactEventManager<Terrain> Events\n        {\n            get\n            {\n                return events;\n            }\n            set\n            {\n                if (value.Owner != null && //Can't use a manager which is owned by a different entity.\n                    value != events) //Stay quiet if for some reason the same event manager is being set.\n                    throw new ArgumentException(\"Event manager is already owned by a Terrain; event managers cannot be shared.\");\n                if (events != null)\n                    events.Owner = null;\n                events = value;\n                if (events != null)\n                    events.Owner = this;\n            }\n        }\n\n        protected internal override IContactEventTriggerer EventTriggerer\n        {\n            get { return events; }\n        }\n\n        protected override IDeferredEventCreator EventCreator\n        {\n            get { return events; }\n        }\n\n\n        internal float thickness;\n        /// <summary>\n        /// Gets or sets the thickness of the terrain.  This defines how far below the triangles of the terrain's surface the terrain 'body' extends.\n        /// Anything within the body of the terrain will be pulled back up to the surface.\n        /// </summary>\n        public float Thickness\n        {\n            get\n            {\n                return thickness;\n            }\n            set\n            {\n                if (value < 0)\n                    throw new ArgumentException(\"Cannot use a negative thickness value.\");\n\n                //Modify the bounding box to include the new thickness.\n                Vector3 down = Vector3.Normalize(worldTransform.LinearTransform.Down);\n                Vector3 thicknessOffset = down * (value - thickness);\n                //Use the down direction rather than the thicknessOffset to determine which\n                //component of the bounding box to subtract, since the down direction contains all\n                //previous extra thickness.\n                if (down.X < 0)\n                    boundingBox.Min.X += thicknessOffset.X;\n                else\n                    boundingBox.Max.X += thicknessOffset.X;\n                if (down.Y < 0)\n                    boundingBox.Min.Y += thicknessOffset.Y;\n                else\n                    boundingBox.Max.Y += thicknessOffset.Y;\n                if (down.Z < 0)\n                    boundingBox.Min.Z += thicknessOffset.Z;\n                else\n                    boundingBox.Max.Z += thicknessOffset.Z;\n\n                thickness = value;\n            }\n        }\n\n\n        ///<summary>\n        /// Constructs a new Terrain.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use for the terrain.</param>\n        ///<param name=\"worldTransform\">Transform to use for the terrain.</param>\n        public Terrain(TerrainShape shape, AffineTransform worldTransform)\n        {\n            this.worldTransform = worldTransform;\n            Shape = shape;\n\n            Events = new ContactEventManager<Terrain>();\n        }\n\n\n        ///<summary>\n        /// Constructs a new Terrain.\n        ///</summary>\n        ///<param name=\"heights\">Height data to use to create the TerrainShape.</param>\n        ///<param name=\"worldTransform\">Transform to use for the terrain.</param>\n        public Terrain(float[,] heights, AffineTransform worldTransform)\n            : this(new TerrainShape(heights), worldTransform)\n        {\n        }\n\n\n        ///<summary>\n        /// Updates the bounding box of the terrain.\n        ///</summary>\n        public override void UpdateBoundingBox()\n        {\n            Shape.GetBoundingBox(ref worldTransform, out boundingBox);\n            //Include the thickness of the terrain.\n            Vector3 thicknessOffset = Vector3.Normalize(worldTransform.LinearTransform.Down) * thickness;\n            if (thicknessOffset.X < 0)\n                boundingBox.Min.X += thicknessOffset.X;\n            else\n                boundingBox.Max.X += thicknessOffset.X;\n            if (thicknessOffset.Y < 0)\n                boundingBox.Min.Y += thicknessOffset.Y;\n            else\n                boundingBox.Max.Y += thicknessOffset.Y;\n            if (thicknessOffset.Z < 0)\n                boundingBox.Min.Z += thicknessOffset.Z;\n            else\n                boundingBox.Max.Z += thicknessOffset.Z;\n        }\n\n   \n\n        /// <summary>\n        /// Tests a ray against the entry.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"rayHit\">Hit location of the ray on the entry, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public override bool RayCast(Ray ray, float maximumLength, out RayHit rayHit)\n        {\n            return Shape.RayCast(ref ray, maximumLength, ref worldTransform, out rayHit);\n        }\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"hit\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public override bool ConvexCast(CollisionShapes.ConvexShapes.ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayHit hit)\n        {\n            hit = new RayHit();\n            BoundingBox boundingBox;\n            castShape.GetSweptLocalBoundingBox(ref startingTransform, ref worldTransform, ref sweep, out boundingBox);\n            var tri = PhysicsResources.GetTriangle();\n            var hitElements = PhysicsResources.GetTriangleIndicesList();\n            if (Shape.GetOverlaps(boundingBox, hitElements))\n            {\n                hit.T = float.MaxValue;\n                for (int i = 0; i < hitElements.Count; i++)\n                {\n                    Shape.GetTriangle(ref hitElements.Elements[i], ref worldTransform, out tri.vA, out tri.vB, out tri.vC);\n                    Vector3 center;\n                    Vector3.Add(ref tri.vA, ref tri.vB, out center);\n                    Vector3.Add(ref center, ref tri.vC, out center);\n                    Vector3.Multiply(ref center, 1f / 3f, out center);\n                    Vector3.Subtract(ref tri.vA, ref center, out tri.vA);\n                    Vector3.Subtract(ref tri.vB, ref center, out tri.vB);\n                    Vector3.Subtract(ref tri.vC, ref center, out tri.vC);\n                    tri.maximumRadius = tri.vA.LengthSquared();\n                    float radius = tri.vB.LengthSquared();\n                    if (tri.maximumRadius < radius)\n                        tri.maximumRadius = radius;\n                    radius = tri.vC.LengthSquared();\n                    if (tri.maximumRadius < radius)\n                        tri.maximumRadius = radius;\n                    tri.maximumRadius = (float)Math.Sqrt(tri.maximumRadius);\n                    tri.collisionMargin = 0;\n                    var triangleTransform = new RigidTransform { Orientation = Quaternion.Identity, Position = center };\n                    RayHit tempHit;\n                    if (MPRToolbox.Sweep(castShape, tri, ref sweep, ref Toolbox.ZeroVector, ref startingTransform, ref triangleTransform, out tempHit) && tempHit.T < hit.T)\n                    {\n                        hit = tempHit;\n                    }\n                }\n                tri.maximumRadius = 0;\n                PhysicsResources.GiveBack(tri);\n                PhysicsResources.GiveBack(hitElements);\n                return hit.T != float.MaxValue;\n            }\n            PhysicsResources.GiveBack(tri);\n            PhysicsResources.GiveBack(hitElements);\n            return false;\n        }\n\n        ///<summary>\n        /// Gets the normal of a vertex at the given indices.\n        ///</summary>\n        ///<param name=\"i\">First dimension index into the heightmap array.</param>\n        ///<param name=\"j\">Second dimension index into the heightmap array.</param>\n        ///<param name=\"normal\">Normal at the given indices.</param>\n        public void GetNormal(int i, int j, out Vector3 normal)\n        {\n            Shape.GetNormal(i, j, ref worldTransform, out normal);\n        }\n\n        ///<summary>\n        /// Gets the position of a vertex at the given indices.\n        ///</summary>\n        ///<param name=\"i\">First dimension index into the heightmap array.</param>\n        ///<param name=\"j\">Second dimension index into the heightmap array.</param>\n        ///<param name=\"position\">Position at the given indices.</param>\n        public void GetPosition(int i, int j, out Vector3 position)\n        {\n            Shape.GetPosition(i, j, ref worldTransform, out position);\n        }\n\n\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/BroadPhase.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.Threading;\nusing BEPUutilities;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUutilities.DataStructures;\nusing System;\n\nnamespace BEPUphysics.BroadPhaseSystems\n{\n    ///<summary>\n    /// Superclass of all broad phases.  Broad phases collect overlapping broad phase entry pairs.\n    ///</summary>\n    public abstract class BroadPhase : MultithreadedProcessingStage\n    {\n        readonly SpinLock overlapAddLock = new SpinLock();\n\n        ///<summary>\n        /// Gets the object which is locked by the broadphase during synchronized update processes.\n        ///</summary>\n        public object Locker { get; protected set; }\n        protected BroadPhase()\n        {\n            Locker = new object();\n            Enabled = true;\n        }\n\n        protected BroadPhase(IThreadManager threadManager)\n            : this()\n        {\n            ThreadManager = threadManager;\n            AllowMultithreading = true;\n        }\n        //TODO: Initial capacity?  Special collection type other than list due to structs? RawList? Clear at beginning of each frame?\n        readonly RawList<BroadPhaseOverlap> overlaps = new RawList<BroadPhaseOverlap>();\n        /// <summary>\n        /// Gets the list of overlaps identified in the previous broad phase update.\n        /// </summary>\n        public RawList<BroadPhaseOverlap> Overlaps\n        {\n            get { return overlaps; }\n        }\n\n\n\n        ///<summary>\n        /// Gets an interface to the broad phase's support for volume-based queries.\n        ///</summary>\n        public IQueryAccelerator QueryAccelerator { get; protected set; }\n\n        /// <summary>\n        /// Adds an entry to the broad phase.\n        /// </summary>\n        /// <param name=\"entry\">Entry to add.</param>\n        public virtual void Add(BroadPhaseEntry entry)\n        {\n            if (entry.BroadPhase == null)\n                entry.BroadPhase = this;\n            else\n                throw new ArgumentException(\"Cannot add entry; it already belongs to a broad phase.\");\n        }\n\n        /// <summary>\n        /// Removes an entry from the broad phase.\n        /// </summary>\n        /// <param name=\"entry\">Entry to remove.</param>\n        public virtual void Remove(BroadPhaseEntry entry)\n        {\n            if (entry.BroadPhase == this)\n                entry.BroadPhase = null;\n            else\n                throw new ArgumentException(\"Cannot remove entry; it does not belong to this broad phase.\");\n        }\n\n        protected internal void AddOverlap(BroadPhaseOverlap overlap)\n        {\n            overlapAddLock.Enter();\n            overlaps.Add(overlap);\n            overlapAddLock.Exit();\n        }\n\n        /// <summary>\n        /// Adds a broad phase overlap if the collision rules permit it.\n        /// </summary>\n        /// <param name=\"entryA\">First entry of the overlap.</param>\n        /// <param name=\"entryB\">Second entry of the overlap.</param>\n        protected internal void TryToAddOverlap(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            CollisionRule rule;\n            if ((rule = GetCollisionRule(entryA, entryB)) < CollisionRule.NoBroadPhase)\n            {\n                overlapAddLock.Enter();\n                overlaps.Add(new BroadPhaseOverlap(entryA, entryB, rule));\n                overlapAddLock.Exit();\n            }\n        }\n\n        protected internal CollisionRule GetCollisionRule(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            if (entryA.IsActive || entryB.IsActive)\n                return CollisionRules.collisionRuleCalculator(entryA, entryB);\n            return CollisionRule.NoBroadPhase;\n        }\n\n        //TODO: Consider what happens when an overlap is found twice.  How should it be dealt with?\n        //Can the DBH spit out redundancies?\n        //The PUG definitely can- consider two entities that are both in two adjacent cells.\n        //Could say 'whatever' to it and handle it in the narrow phase-  use the NeedsUpdate property.\n        //If NeedsUpdate is false, that means it's already been updated once.  Consider multithreaded problems.\n        //Would require an interlocked compare exchange or something similar to protect it.  \n        //Slightly ruins the whole 'embarassingly parallel' aspect.\n\n        //Need a something which has O(1) add, O(1) contains check, and fast iteration without requiring external nodes since everything gets regenerated each frame.\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/BroadPhaseOverlap.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.CollisionRuleManagement;\n\nnamespace BEPUphysics.BroadPhaseSystems\n{\n    /// <summary>\n    /// A pair of overlapping BroadPhaseEntries.\n    /// </summary>\n    public struct BroadPhaseOverlap : IEquatable<BroadPhaseOverlap>\n    {\n        internal BroadPhaseEntry entryA;\n        /// <summary>\n        /// First entry in the pair.\n        /// </summary>\n        public BroadPhaseEntry EntryA\n        {\n            get { return entryA; }\n        }\n\n        internal BroadPhaseEntry entryB;\n        /// <summary>\n        /// Second entry in the pair.\n        /// </summary>\n        public BroadPhaseEntry EntryB\n        {\n            get { return entryB; }\n        }\n\n        internal CollisionRule collisionRule;\n\n        /// <summary>\n        /// Constructs an overlap.\n        /// </summary>\n        /// <param name=\"entryA\">First entry in the pair.</param>\n        /// <param name=\"entryB\">Second entry in the pair.</param>\n        public BroadPhaseOverlap(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            this.entryA = entryA;\n            this.entryB = entryB;\n            collisionRule = CollisionRules.DefaultCollisionRule;\n        }\n\n        /// <summary>\n        /// Constructs an overlap.\n        /// </summary>\n        /// <param name=\"entryA\">First entry in the pair.</param>\n        /// <param name=\"entryB\">Second entry in the pair.</param>\n        /// <param name=\"collisionRule\">Collision rule calculated for the pair.</param>\n        public BroadPhaseOverlap(BroadPhaseEntry entryA, BroadPhaseEntry entryB, CollisionRule collisionRule)\n        {\n            this.entryA = entryA;\n            this.entryB = entryB;\n            this.collisionRule = collisionRule;\n        }\n\n        /// <summary>\n        /// Gets the collision rule calculated for the pair.\n        /// </summary>\n        public CollisionRule CollisionRule\n        {\n            get { return collisionRule; }\n        }\n\n        /// <summary>\n        /// Gets the hash code of the object.\n        /// </summary>\n        /// <returns>Hash code of the object.</returns>\n        public override int GetHashCode()\n        {\n            //TODO: Use old prime-based system?\n            return (int)((entryA.hashCode + entryB.hashCode) * 0xd8163841);\n        }\n\n\n        #region IEquatable<BroadPhaseOverlap> Members\n\n        /// <summary>\n        /// Compares the overlaps for equality based on the involved entries.\n        /// </summary>\n        /// <param name=\"other\">Overlap to compare.</param>\n        /// <returns>Whether or not the overlaps were equal.</returns>\n        public bool Equals(BroadPhaseOverlap other)\n        {\n            return (other.entryA == entryA && other.entryB == entryB) || (other.entryA == entryB && other.entryB == entryA);\n        }\n\n        #endregion\n\n        public override string ToString()\n        {\n            return \"{\" + entryA + \", \" + entryB + \"}\";\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/BruteForce.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.BroadPhaseEntries;\n\nnamespace BEPUphysics.BroadPhaseSystems\n{\n    public class BruteForce : BroadPhase\n    {\n        public List<BroadPhaseEntry> entries = new List<BroadPhaseEntry>();\n\n        public override void Add(BroadPhaseEntry entry)\n        {\n            entries.Add(entry);\n        }\n\n        public override void Remove(BroadPhaseEntry entry)\n        {\n            entries.Remove(entry);\n        }\n\n        protected override void UpdateMultithreaded()\n        {\n            UpdateSingleThreaded();\n        }\n\n        protected override void UpdateSingleThreaded()\n        {\n            Overlaps.Clear();\n            for (int i = 0; i < entries.Count; i++)\n            {\n                for (int j = i + 1; j < entries.Count; j++)\n                {\n                    if (entries[i].boundingBox.Intersects(entries[j].boundingBox))\n                        base.TryToAddOverlap(entries[i], entries[j]);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/Hierarchies/DynamicHierarchy.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.Threading;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.BroadPhaseSystems.Hierarchies\n{\n    /// <summary>\n    /// Broad phase that incrementally updates the internal tree acceleration structure.\n    /// </summary>\n    /// <remarks>\n    /// This is a good all-around broad phase; its performance is consistent and all queries are supported and speedy.\n    /// The memory usage is higher than simple one-axis sort and sweep, but a bit lower than the Grid2DSortAndSweep option.\n    /// </remarks>\n    public class DynamicHierarchy : BroadPhase\n    {\n        internal Node root;\n\n        /// <summary>\n        /// Constructs a new dynamic hierarchy broad phase.\n        /// </summary>\n        public DynamicHierarchy()\n        {\n            multithreadedRefit = MultithreadedRefit;\n            multithreadedOverlap = MultithreadedOverlap;\n            QueryAccelerator = new DynamicHierarchyQueryAccelerator(this);\n        }\n\n        /// <summary>\n        /// Constructs a new dynamic hierarchy broad phase.\n        /// </summary>\n        /// <param name=\"threadManager\">Thread manager to use in the broad phase.</param>\n        public DynamicHierarchy(IThreadManager threadManager)\n            : base(threadManager)\n        {\n            multithreadedRefit = MultithreadedRefit;\n            multithreadedOverlap = MultithreadedOverlap;\n            QueryAccelerator = new DynamicHierarchyQueryAccelerator(this);\n        }\n\n        /// <summary>\n        /// This is a few test-based values which help threaded scaling.\n        /// By going deeper into the trees, a better distribution of work is achieved.\n        /// Going above the tested core count theoretically benefits from a '0 if power of 2, 2 otherwise' rule of thumb.\n        /// </summary>\n        private int[] threadSplitOffsets = new[]\n#if !XBOX360\n { 0, 0, 4, 1, 2, 2, 2, 0, 2, 2, 2, 2 };\n#else\n        { 2, 2, 2, 1};\n#endif\n#if PROFILE\n        /// <summary>\n        /// Gets the time used in refitting the acceleration structure and making any necessary incremental improvements.\n        /// </summary>\n        public double RefitTime\n        {\n            get\n            {\n                return (endRefit - startRefit) / (double)Stopwatch.Frequency;\n            }\n        }\n        /// <summary>\n        /// Gets the time used in testing the tree against itself to find overlapping pairs. \n        /// </summary>\n        public double OverlapTime\n        {\n            get\n            {\n                return (endOverlap - endRefit) / (double)Stopwatch.Frequency;\n            }\n        }\n        long startRefit, endRefit;\n        long endOverlap;\n\n\n#endif\n\n        #region Multithreading\n\n        private void MultithreadedRefitPhase(int splitDepth)\n        {\n            if (splitDepth > 0)\n            {\n                root.CollectMultithreadingNodes(splitDepth, 1, multithreadingSourceNodes);\n                //Go through every node and refit it.\n                ThreadManager.ForLoop(0, multithreadingSourceNodes.Count, multithreadedRefit);\n                multithreadingSourceNodes.Clear();\n                //Now that the subtrees belonging to the source nodes are refit, refit the top nodes.\n                //Sometimes, this will go deeper than necessary because the refit process may require an extremely high level (nonmultithreaded) revalidation.\n                //The waste cost is a matter of nanoseconds due to the simplicity of the operations involved.\n                root.PostRefit(splitDepth, 1);\n            }\n            else\n            {\n                SingleThreadedRefitPhase();\n            }\n        }\n\n        private void MultithreadedOverlapPhase(int splitDepth)\n        {\n            if (splitDepth > 0)\n            {\n                //The trees are now fully refit (and revalidated, if the refit process found it to be necessary).\n                //The overlap traversal is conceptually similar to the multithreaded refit, but is a bit easier since there's no need to go back up the stack.\n                if (!root.IsLeaf) //If the root is a leaf, it's alone- nothing to collide against! This test is required by the assumptions of the leaf-leaf test.\n                {\n                    root.GetMultithreadedOverlaps(root, splitDepth, 1, this, multithreadingSourceOverlaps);\n                    ThreadManager.ForLoop(0, multithreadingSourceOverlaps.Count, multithreadedOverlap);\n                    multithreadingSourceOverlaps.Clear();\n                }\n            }\n            else\n            {\n                SingleThreadedOverlapPhase();\n            }\n        }\n\n        protected override void UpdateMultithreaded()\n        {\n            lock (Locker)\n            {\n                Overlaps.Clear();\n                if (root != null)\n                {\n                    //To multithread the tree traversals, we have to do a little single threaded work.\n                    //Dive down into the tree far enough that there are enough nodes to split amongst all the threads in the thread manager.\n                    //The depth to which we dive is offset by some precomputed values (when available) or a guess based on whether or not the \n                    //thread count is a power of 2.  Thread counts which are a power of 2 match well to the binary tree, while other thread counts\n                    //require going deeper for better distributions.\n                    int offset = ThreadManager.ThreadCount <= threadSplitOffsets.Length\n                                     ? threadSplitOffsets[ThreadManager.ThreadCount - 1]\n                                     : (ThreadManager.ThreadCount & (ThreadManager.ThreadCount - 1)) == 0 ? 0 : 2;\n                    int splitDepth = offset + (int)Math.Ceiling(Math.Log(ThreadManager.ThreadCount, 2));\n#if PROFILE\n                    startRefit = Stopwatch.GetTimestamp();\n#endif\n                    MultithreadedRefitPhase(splitDepth);\n#if PROFILE\n                    endRefit = Stopwatch.GetTimestamp();\n#endif\n                    MultithreadedOverlapPhase(splitDepth);\n#if PROFILE\n                    endOverlap = Stopwatch.GetTimestamp();\n#endif\n                }\n            }\n\n        }\n\n        internal struct NodePair\n        {\n            internal Node a;\n            internal Node b;\n        }\n\n        RawList<Node> multithreadingSourceNodes = new RawList<Node>(4);\n        Action<int> multithreadedRefit;\n        void MultithreadedRefit(int i)\n        {\n            multithreadingSourceNodes.Elements[i].Refit();\n        }\n\n        RawList<NodePair> multithreadingSourceOverlaps = new RawList<NodePair>(10);\n        Action<int> multithreadedOverlap;\n        void MultithreadedOverlap(int i)\n        {\n            var overlap = multithreadingSourceOverlaps.Elements[i];\n            //Note: It's okay not to check to see if a and b are equal and leaf nodes, because the systems which added nodes to the list already did it.\n            overlap.a.GetOverlaps(overlap.b, this);\n        }\n\n        #endregion\n\n        private void SingleThreadedRefitPhase()\n        {\n            root.Refit();\n        }\n\n        private void SingleThreadedOverlapPhase()\n        {\n            if (!root.IsLeaf) //If the root is a leaf, it's alone- nothing to collide against! This test is required by the assumptions of the leaf-leaf test.\n                root.GetOverlaps(root, this);\n        }\n\n        protected override void UpdateSingleThreaded()\n        {\n            lock (Locker)\n            {\n                Overlaps.Clear();\n                if (root != null)\n                {\n#if PROFILE\n                    startRefit = Stopwatch.GetTimestamp();\n#endif\n                    SingleThreadedRefitPhase();\n#if PROFILE\n                    endRefit = Stopwatch.GetTimestamp();\n#endif\n                    SingleThreadedOverlapPhase();\n#if PROFILE\n                    endOverlap = Stopwatch.GetTimestamp();\n#endif\n                }\n            }\n        }\n\n        UnsafeResourcePool<LeafNode> leafNodes = new UnsafeResourcePool<LeafNode>();\n\n        /// <summary>\n        /// Adds an entry to the hierarchy.\n        /// </summary>\n        /// <param name=\"entry\">Entry to remove.</param>\n        public override void Add(BroadPhaseEntry entry)\n        {\n            base.Add(entry);\n            //Entities do not set up their own bounding box before getting stuck in here.  If they're all zeroed out, the tree will be horrible.\n            Vector3 offset;\n            Vector3.Subtract(ref entry.boundingBox.Max, ref entry.boundingBox.Min, out offset);\n            if (offset.X * offset.Y * offset.Z == 0)\n                entry.UpdateBoundingBox();\n            //Could buffer additions to get a better construction in the tree.\n            var node = leafNodes.Take();\n            node.Initialize(entry);\n            if (root == null)\n            {\n                //Empty tree.  This is the first and only node.\n                root = node;\n            }\n            else\n            {\n                if (root.IsLeaf) //Root is alone.\n                    root.TryToInsert(node, out root);\n                else\n                {\n                    BoundingBox.CreateMerged(ref node.BoundingBox, ref root.BoundingBox, out root.BoundingBox);\n                    var internalNode = (InternalNode)root;\n                    Vector3.Subtract(ref root.BoundingBox.Max, ref root.BoundingBox.Min, out offset);\n                    internalNode.currentVolume = offset.X * offset.Y * offset.Z;\n                    //internalNode.maximumVolume = internalNode.currentVolume * InternalNode.MaximumVolumeScale;\n                    //The caller is responsible for the merge.\n                    var treeNode = root;\n                    while (!treeNode.TryToInsert(node, out treeNode)) ;//TryToInsert returns the next node, if any, and updates node bounding box.\n                }\n            }\n        }\n        /// <summary>\n        /// Removes an entry from the hierarchy.\n        /// </summary>\n        /// <param name=\"entry\">Entry to remove.</param>\n        public override void Remove(BroadPhaseEntry entry)\n        {\n            if (root == null)\n                throw new InvalidOperationException(\"Entry not present in the hierarchy.\");\n            //Attempt to search for the entry with a boundingbox lookup first.\n            if (!RemoveFast(entry))\n            {\n                //Oof, could not locate it with the fast method; it must have been force-moved or something.\n                //Fall back to a slow brute force approach.\n                if (!RemoveBrute(entry))\n                {\n                    throw new InvalidOperationException(\"Entry not present in the hierarchy.\");\n                }\n            }\n        }\n\n        internal bool RemoveFast(BroadPhaseEntry entry)\n        {\n            LeafNode leafNode;\n            //Update the root with the replacement just in case the removal triggers a root change.\n            if (root.RemoveFast(entry, out leafNode, out root))\n            {\n                leafNode.CleanUp();\n                leafNodes.GiveBack(leafNode);\n                base.Remove(entry);\n                return true;\n            }\n            return false;\n        }\n\n        internal bool RemoveBrute(BroadPhaseEntry entry)\n        {\n            LeafNode leafNode;\n            //Update the root with the replacement just in case the removal triggers a root change.\n            if (root.Remove(entry, out leafNode, out root))\n            {\n                leafNode.CleanUp();\n                leafNodes.GiveBack(leafNode);\n                base.Remove(entry);\n                return true;\n            }\n            return false;\n        }\n\n        #region Debug\n        internal void Analyze(List<int> depths, out int nodeCount)\n        {\n            nodeCount = 0;\n            root.Analyze(depths, 0, ref nodeCount);\n        }\n\n        internal void ForceRevalidation()\n        {\n            ((InternalNode)root).Revalidate();\n        }\n        #endregion\n    }\n\n}"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/Hierarchies/DynamicHierarchyNode.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.BroadPhaseSystems.Hierarchies\n{\n    internal abstract class Node\n    {\n        internal BoundingBox BoundingBox;\n        internal abstract void GetOverlaps(ref BoundingBox boundingBox, IList<BroadPhaseEntry> outputOverlappedElements);\n        internal abstract void GetOverlaps(ref BoundingSphere boundingSphere, IList<BroadPhaseEntry> outputOverlappedElements);\n        internal abstract void GetOverlaps(ref BoundingFrustum boundingFrustum, IList<BroadPhaseEntry> outputOverlappedElements);\n        internal abstract void GetOverlaps(ref Ray ray, float maximumLength, IList<BroadPhaseEntry> outputOverlappedElements);\n        internal abstract void GetOverlaps(Node node, DynamicHierarchy owner);\n\n        internal abstract bool IsLeaf { get; }\n\n        internal abstract Node ChildA { get; }\n        internal abstract Node ChildB { get; }\n        internal abstract BroadPhaseEntry Element { get; }\n\n        internal abstract bool TryToInsert(LeafNode node, out Node treeNode);\n\n        internal abstract void Analyze(List<int> depths, int depth, ref int nodeCount);\n\n        internal abstract void Refit();\n\n        internal abstract void RetrieveNodes(RawList<LeafNode> leafNodes);\n\n\n\n        internal abstract void CollectMultithreadingNodes(int splitDepth, int currentDepth, RawList<Node> multithreadingSourceNodes);\n\n        internal abstract void PostRefit(int splitDepth, int currentDepth);\n\n        internal abstract void GetMultithreadedOverlaps(Node opposingNode, int splitDepth, int currentDepth, DynamicHierarchy owner, RawList<DynamicHierarchy.NodePair> multithreadingSourceOverlaps);\n\n        internal abstract bool Remove(BroadPhaseEntry entry, out LeafNode leafNode, out Node replacementNode);\n        internal abstract bool RemoveFast(BroadPhaseEntry entry, out LeafNode leafNode, out Node replacementNode);\n    }\n\n    internal sealed class InternalNode : Node\n    {\n        internal Node childA;\n        internal Node childB;\n\n        internal float currentVolume;\n        internal float maximumVolume;\n\n        internal static float MaximumVolumeScale = 1.4f;\n\n        internal override Node ChildA\n        {\n            get\n            {\n                return childA;\n            }\n        }\n        internal override Node ChildB\n        {\n            get\n            {\n                return childB;\n            }\n        }\n        internal override BroadPhaseEntry Element\n        {\n            get\n            {\n                return default(BroadPhaseEntry);\n            }\n        }\n\n        internal override bool IsLeaf\n        {\n            get { return false; }\n        }\n\n\n        internal override void GetOverlaps(ref BoundingBox boundingBox, IList<BroadPhaseEntry> outputOverlappedElements)\n        {\n            //Users of the GetOverlaps method will have to check the bounding box before calling\n            //root.getoverlaps.  This is actually desired in some cases, since the outer bounding box is used\n            //to determine a pair, and further overlap tests shouldn'BroadPhaseEntry bother retesting the root.\n            bool intersects;\n            childA.BoundingBox.Intersects(ref boundingBox, out intersects);\n            if (intersects)\n                childA.GetOverlaps(ref boundingBox, outputOverlappedElements);\n            childB.BoundingBox.Intersects(ref boundingBox, out intersects);\n            if (intersects)\n                childB.GetOverlaps(ref boundingBox, outputOverlappedElements);\n        }\n\n        internal override void GetOverlaps(ref BoundingSphere boundingSphere, IList<BroadPhaseEntry> outputOverlappedElements)\n        {\n            bool intersects;\n            childA.BoundingBox.Intersects(ref boundingSphere, out intersects);\n            if (intersects)\n                childA.GetOverlaps(ref boundingSphere, outputOverlappedElements);\n            childB.BoundingBox.Intersects(ref boundingSphere, out intersects);\n            if (intersects)\n                childB.GetOverlaps(ref boundingSphere, outputOverlappedElements);\n        }\n\n        internal override void GetOverlaps(ref BoundingFrustum boundingFrustum, IList<BroadPhaseEntry> outputOverlappedElements)\n        {\n            bool intersects;\n            boundingFrustum.Intersects(ref childA.BoundingBox, out intersects);\n            if (intersects)\n                childA.GetOverlaps(ref boundingFrustum, outputOverlappedElements);\n            boundingFrustum.Intersects(ref childB.BoundingBox, out intersects);\n            if (intersects)\n                childB.GetOverlaps(ref boundingFrustum, outputOverlappedElements);\n        }\n\n        internal override void GetOverlaps(ref Ray ray, float maximumLength, IList<BroadPhaseEntry> outputOverlappedElements)\n        {\n            float? result;\n            ray.Intersects(ref childA.BoundingBox, out result);\n            if (result != null && result < maximumLength)\n                childA.GetOverlaps(ref ray, maximumLength, outputOverlappedElements);\n            ray.Intersects(ref childB.BoundingBox, out result);\n            if (result != null && result < maximumLength)\n                childB.GetOverlaps(ref ray, maximumLength, outputOverlappedElements);\n        }\n\n        internal override void GetOverlaps(Node opposingNode, DynamicHierarchy owner)\n        {\n            bool intersects;\n\n            if (this == opposingNode)\n            {\n                //We are being compared against ourselves!\n                //Obviously we're an internal node, so spawn three children:\n                //A versus A:\n                if (!childA.IsLeaf) //This is performed in the child method usually by convention, but this saves some time.\n                    childA.GetOverlaps(childA, owner);\n                //B versus B:\n                if (!childB.IsLeaf) //This is performed in the child method usually by convention, but this saves some time.\n                    childB.GetOverlaps(childB, owner);\n                //A versus B (if they intersect):\n                childA.BoundingBox.Intersects(ref childB.BoundingBox, out intersects);\n                if (intersects)\n                    childA.GetOverlaps(childB, owner);\n\n            }\n            else\n            {\n                //Two different nodes.  The other one may be a leaf.\n                if (opposingNode.IsLeaf)\n                {\n                    //If it's a leaf, go deeper in our hierarchy, but not the opposition.\n                    childA.BoundingBox.Intersects(ref opposingNode.BoundingBox, out intersects);\n                    if (intersects)\n                        childA.GetOverlaps(opposingNode, owner);\n                    childB.BoundingBox.Intersects(ref opposingNode.BoundingBox, out intersects);\n                    if (intersects)\n                        childB.GetOverlaps(opposingNode, owner);\n                }\n                else\n                {\n                    var opposingChildA = opposingNode.ChildA;\n                    var opposingChildB = opposingNode.ChildB;\n                    //If it's not a leaf, try to go deeper in both hierarchies.\n                    childA.BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                    if (intersects)\n                        childA.GetOverlaps(opposingChildA, owner);\n                    childA.BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                    if (intersects)\n                        childA.GetOverlaps(opposingChildB, owner);\n                    childB.BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                    if (intersects)\n                        childB.GetOverlaps(opposingChildA, owner);\n                    childB.BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                    if (intersects)\n                        childB.GetOverlaps(opposingChildB, owner);\n\n\n                }\n            }\n\n\n\n\n\n        }\n\n        internal static LockingResourcePool<InternalNode> nodePool = new LockingResourcePool<InternalNode>();\n        internal override bool TryToInsert(LeafNode node, out Node treeNode)\n        {\n            //Since we are an internal node, we know we have two children.\n            //Regardless of what kind of nodes they are, figure out which would be a better choice to merge the new node with.\n\n            //Use the path which produces the smallest 'volume.'\n            BoundingBox mergedA, mergedB;\n            BoundingBox.CreateMerged(ref childA.BoundingBox, ref node.BoundingBox, out mergedA);\n            BoundingBox.CreateMerged(ref childB.BoundingBox, ref node.BoundingBox, out mergedB);\n\n            Vector3 offset;\n            float originalAVolume, originalBVolume;\n            Vector3.Subtract(ref childA.BoundingBox.Max, ref childA.BoundingBox.Min, out offset);\n            originalAVolume = offset.X * offset.Y * offset.Z;\n            Vector3.Subtract(ref childB.BoundingBox.Max, ref childB.BoundingBox.Min, out offset);\n            originalBVolume = offset.X * offset.Y * offset.Z;\n\n            float mergedAVolume, mergedBVolume;\n            Vector3.Subtract(ref mergedA.Max, ref mergedA.Min, out offset);\n            mergedAVolume = offset.X * offset.Y * offset.Z;\n            Vector3.Subtract(ref mergedB.Max, ref mergedB.Min, out offset);\n            mergedBVolume = offset.X * offset.Y * offset.Z;\n\n            //Could use factor increase or absolute difference\n            if (mergedAVolume - originalAVolume < mergedBVolume - originalBVolume)\n            {\n                //merging A produces a better result.\n                if (childA.IsLeaf)\n                {\n                    var newChildA = nodePool.Take();\n                    newChildA.BoundingBox = mergedA;\n                    newChildA.childA = this.childA;\n                    newChildA.childB = node;\n                    newChildA.currentVolume = mergedAVolume;\n                    //newChildA.maximumVolume = newChildA.currentVolume * MaximumVolumeScale;\n                    childA = newChildA;\n                    treeNode = null;\n                    return true;\n                }\n                else\n                {\n                    childA.BoundingBox = mergedA;\n                    var internalNode = (InternalNode)childA;\n                    internalNode.currentVolume = mergedAVolume;\n                    //internalNode.maximumVolume = internalNode.currentVolume * MaximumVolumeScale;\n                    treeNode = childA;\n                    return false;\n                }\n            }\n            else\n            {\n                //merging B produces a better result.\n                if (childB.IsLeaf)\n                {\n                    //Target is a leaf! Return.\n                    var newChildB = nodePool.Take();\n                    newChildB.BoundingBox = mergedB;\n                    newChildB.childA = node;\n                    newChildB.childB = this.childB;\n                    newChildB.currentVolume = mergedBVolume;\n                    //newChildB.maximumVolume = newChildB.currentVolume * MaximumVolumeScale;\n                    childB = newChildB;\n                    treeNode = null;\n                    return true;\n                }\n                else\n                {\n                    childB.BoundingBox = mergedB;\n                    treeNode = childB;\n                    var internalNode = (InternalNode)childB;\n                    internalNode.currentVolume = mergedBVolume;\n                    //internalNode.maximumVolume = internalNode.currentVolume * MaximumVolumeScale;\n                    return false;\n                }\n            }\n\n\n\n        }\n\n        public override string ToString()\n        {\n            return \"{\" + childA + \", \" + childB + \"}\";\n\n        }\n\n        internal override void Analyze(List<int> depths, int depth, ref int nodeCount)\n        {\n            nodeCount++;\n            childA.Analyze(depths, depth + 1, ref nodeCount);\n            childB.Analyze(depths, depth + 1, ref nodeCount);\n        }\n\n        internal override void Refit()\n        {\n            if (currentVolume > maximumVolume)\n            {\n                Revalidate();\n                return;\n            }\n            childA.Refit();\n            childB.Refit();\n            BoundingBox.CreateMerged(ref childA.BoundingBox, ref childB.BoundingBox, out BoundingBox);\n            //float DEBUGlastVolume = currentVolume;\n            currentVolume = (BoundingBox.Max.X - BoundingBox.Min.X) * (BoundingBox.Max.Y - BoundingBox.Min.Y) * (BoundingBox.Max.Z - BoundingBox.Min.Z);\n            //if (Math.Abs(currentVolume - DEBUGlastVolume) > .000001 * (DEBUGlastVolume + currentVolume))\n            //    Debug.WriteLine(\":Break>:)\");\n        }\n\n        internal static LockingResourcePool<RawList<LeafNode>> nodeListPool = new LockingResourcePool<RawList<LeafNode>>();\n        internal void Revalidate()\n        {\n            //The revalidation procedure 'reconstructs' a portion of the tree that has expanded beyond its old limits.\n            //To reconstruct the tree, the nodes (internal and leaf) currently in use need to be retrieved.\n            //The internal nodes can be put back into the nodePool.  LeafNodes are reinserted one by one into the new tree.\n            //To retrieve the nodes, a depth-first search is used.\n\n            //Given that an internal node is being revalidated, it is known that there are at least two children.\n            var oldChildA = childA;\n            var oldChildB = childB;\n            childA = null;\n            childB = null;\n            var leafNodes = nodeListPool.Take();\n            oldChildA.RetrieveNodes(leafNodes);\n            oldChildB.RetrieveNodes(leafNodes);\n            for (int i = 0; i < leafNodes.Count; i++)\n                leafNodes.Elements[i].Refit();\n            Reconstruct(leafNodes, 0, leafNodes.Count);\n            leafNodes.Clear();\n            nodeListPool.GiveBack(leafNodes);\n\n\n        }\n\n        void Reconstruct(RawList<LeafNode> leafNodes, int begin, int end)\n        {\n            //It is known that we have 2 children; this is safe.\n            //This is because this is only an internal node if the parent figured out it involved more than 2 leaf nodes, OR\n            //this node was the initiator of the revalidation (in which case, it was an internal node with 2+ children).\n            BoundingBox.CreateMerged(ref leafNodes.Elements[begin].BoundingBox, ref leafNodes.Elements[begin + 1].BoundingBox, out BoundingBox);\n            for (int i = begin + 2; i < end; i++)\n            {\n                BoundingBox.CreateMerged(ref BoundingBox, ref leafNodes.Elements[i].BoundingBox, out BoundingBox);\n            }\n            Vector3 offset;\n            Vector3.Subtract(ref BoundingBox.Max, ref BoundingBox.Min, out offset);\n            currentVolume = offset.X * offset.Y * offset.Z;\n            maximumVolume = currentVolume * MaximumVolumeScale;\n\n            //Pick an axis and sort along it.\n            if (offset.X > offset.Y && offset.X > offset.Z)\n            {\n                //Maximum variance axis is X.\n                Array.Sort(leafNodes.Elements, begin, end - begin, xComparer);\n            }\n            else if (offset.Y > offset.Z)\n            {\n                //Maximum variance axis is Y.  \n                Array.Sort(leafNodes.Elements, begin, end - begin, yComparer);\n            }\n            else\n            {\n                //Maximum variance axis is Z.\n                Array.Sort(leafNodes.Elements, begin, end - begin, zComparer);\n            }\n\n            //Find the median index.\n            int median = (begin + end) / 2;\n\n            if (median - begin >= 2)\n            {\n                //There are 2 or more leaf nodes remaining in the first half.  The next childA will be an internal node.\n                var newChildA = nodePool.Take();\n                newChildA.Reconstruct(leafNodes, begin, median);\n                childA = newChildA;\n            }\n            else\n            {\n                //There is only 1 leaf node remaining in this half.  It's a leaf node.\n                childA = leafNodes.Elements[begin];\n            }\n\n            if (end - median >= 2)\n            {\n                //There are 2 or more leaf nodes remaining in the second half.  The next childB will be an internal node.\n                var newChildB = nodePool.Take();\n                newChildB.Reconstruct(leafNodes, median, end);\n                childB = newChildB;\n            }\n            else\n            {\n                //There is only 1 leaf node remaining in this half.  It's a leaf node.\n                childB = leafNodes.Elements[median];\n            }\n\n        }\n\n        internal override void RetrieveNodes(RawList<LeafNode> leafNodes)\n        {\n            var oldChildA = childA;\n            var oldChildB = childB;\n            childA = null;\n            childB = null;\n            nodePool.GiveBack(this); //Give internal nodes back to the pool before going deeper to minimize the creation of additional internal instances.\n            oldChildA.RetrieveNodes(leafNodes);\n            oldChildB.RetrieveNodes(leafNodes);\n\n\n        }\n\n        internal override void CollectMultithreadingNodes(int splitDepth, int currentDepth, RawList<Node> multithreadingSourceNodes)\n        {\n            if (currentVolume > maximumVolume)\n            {\n                //Very rarely, one of these extremely high level nodes will need to be revalidated.  This isn't great.\n                //We may lose a frame.  This could be independently multithreaded, but the benefit is unknown.\n                Revalidate();\n                return;\n            }\n            if (currentDepth == splitDepth)\n            {\n                //We are deep enough in the tree where our children will act as the starting point for multithreaded refits.\n                //The split depth ensures that we have enough tasks to thread across our core count.\n                multithreadingSourceNodes.Add(childA);\n                multithreadingSourceNodes.Add(childB);\n            }\n            else\n            {\n                childA.CollectMultithreadingNodes(splitDepth, currentDepth + 1, multithreadingSourceNodes);\n                childB.CollectMultithreadingNodes(splitDepth, currentDepth + 1, multithreadingSourceNodes);\n            }\n        }\n\n        internal override void PostRefit(int splitDepth, int currentDepth)\n        {\n            if (splitDepth > currentDepth)\n            {\n                //We are not yet back to the nodes that triggered the multithreaded split.\n                //Need to go deeper into the tree.\n                childA.PostRefit(splitDepth, currentDepth + 1);\n                childB.PostRefit(splitDepth, currentDepth + 1);\n            }\n            BoundingBox.CreateMerged(ref childA.BoundingBox, ref childB.BoundingBox, out BoundingBox);\n            currentVolume = (BoundingBox.Max.X - BoundingBox.Min.X) * (BoundingBox.Max.Y - BoundingBox.Min.Y) * (BoundingBox.Max.Z - BoundingBox.Min.Z);\n        }\n\n        internal override void GetMultithreadedOverlaps(Node opposingNode, int splitDepth, int currentDepth, DynamicHierarchy owner, RawList<DynamicHierarchy.NodePair> multithreadingSourceOverlaps)\n        {\n            bool intersects;\n            if (currentDepth == splitDepth)\n            {\n                //We've reached the depth where our child comparisons will be multithreaded.\n                if (this == opposingNode)\n                {\n                    //We are being compared against ourselves!\n                    //Obviously we're an internal node, so spawn three children:\n                    //A versus A:\n                    if (!childA.IsLeaf) //This is performed in the child method usually by convention, but this saves some time.\n                        multithreadingSourceOverlaps.Add(new DynamicHierarchy.NodePair() { a = childA, b = childA });\n                    //B versus B:\n                    if (!childB.IsLeaf) //This is performed in the child method usually by convention, but this saves some time.\n                        multithreadingSourceOverlaps.Add(new DynamicHierarchy.NodePair() { a = childB, b = childB });\n                    //A versus B (if they intersect):\n                    childA.BoundingBox.Intersects(ref childB.BoundingBox, out intersects);\n                    if (intersects)\n                        multithreadingSourceOverlaps.Add(new DynamicHierarchy.NodePair() { a = childA, b = childB });\n\n                }\n                else\n                {\n                    //Two different nodes.  The other one may be a leaf.\n                    if (opposingNode.IsLeaf)\n                    {\n                        //If it's a leaf, go deeper in our hierarchy, but not the opposition.\n                        childA.BoundingBox.Intersects(ref opposingNode.BoundingBox, out intersects);\n                        if (intersects)\n                            multithreadingSourceOverlaps.Add(new DynamicHierarchy.NodePair() { a = childA, b = opposingNode });\n                        childB.BoundingBox.Intersects(ref opposingNode.BoundingBox, out intersects);\n                        if (intersects)\n                            multithreadingSourceOverlaps.Add(new DynamicHierarchy.NodePair() { a = childB, b = opposingNode });\n                    }\n                    else\n                    {\n                        var opposingChildA = opposingNode.ChildA;\n                        var opposingChildB = opposingNode.ChildB;\n                        //If it's not a leaf, try to go deeper in both hierarchies.\n                        childA.BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                        if (intersects)\n                            multithreadingSourceOverlaps.Add(new DynamicHierarchy.NodePair() { a = childA, b = opposingChildA });\n                        childA.BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                        if (intersects)\n                            multithreadingSourceOverlaps.Add(new DynamicHierarchy.NodePair() { a = childA, b = opposingChildB });\n                        childB.BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                        if (intersects)\n                            multithreadingSourceOverlaps.Add(new DynamicHierarchy.NodePair() { a = childB, b = opposingChildA });\n                        childB.BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                        if (intersects)\n                            multithreadingSourceOverlaps.Add(new DynamicHierarchy.NodePair() { a = childB, b = opposingChildB });\n                    }\n                }\n                return;\n            }\n            if (this == opposingNode)\n            {\n                //We are being compared against ourselves!\n                //Obviously we're an internal node, so spawn three children:\n                //A versus A:\n                if (!childA.IsLeaf) //This is performed in the child method usually by convention, but this saves some time.\n                    childA.GetMultithreadedOverlaps(childA, splitDepth, currentDepth + 1, owner, multithreadingSourceOverlaps);\n                //B versus B:\n                if (!childB.IsLeaf) //This is performed in the child method usually by convention, but this saves some time.\n                    childB.GetMultithreadedOverlaps(childB, splitDepth, currentDepth + 1, owner, multithreadingSourceOverlaps);\n                //A versus B (if they intersect):\n                childA.BoundingBox.Intersects(ref childB.BoundingBox, out intersects);\n                if (intersects)\n                    childA.GetMultithreadedOverlaps(childB, splitDepth, currentDepth + 1, owner, multithreadingSourceOverlaps);\n\n            }\n            else\n            {\n                //Two different nodes.  The other one may be a leaf.\n                if (opposingNode.IsLeaf)\n                {\n                    //If it's a leaf, go deeper in our hierarchy, but not the opposition.\n                    childA.BoundingBox.Intersects(ref opposingNode.BoundingBox, out intersects);\n                    if (intersects)\n                        childA.GetMultithreadedOverlaps(opposingNode, splitDepth, currentDepth + 1, owner, multithreadingSourceOverlaps);\n                    childB.BoundingBox.Intersects(ref opposingNode.BoundingBox, out intersects);\n                    if (intersects)\n                        childB.GetMultithreadedOverlaps(opposingNode, splitDepth, currentDepth + 1, owner, multithreadingSourceOverlaps);\n                }\n                else\n                {\n                    var opposingChildA = opposingNode.ChildA;\n                    var opposingChildB = opposingNode.ChildB;\n                    //If it's not a leaf, try to go deeper in both hierarchies.\n                    childA.BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                    if (intersects)\n                        childA.GetMultithreadedOverlaps(opposingChildA, splitDepth, currentDepth + 1, owner, multithreadingSourceOverlaps);\n                    childA.BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                    if (intersects)\n                        childA.GetMultithreadedOverlaps(opposingChildB, splitDepth, currentDepth + 1, owner, multithreadingSourceOverlaps);\n                    childB.BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                    if (intersects)\n                        childB.GetMultithreadedOverlaps(opposingChildA, splitDepth, currentDepth + 1, owner, multithreadingSourceOverlaps);\n                    childB.BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                    if (intersects)\n                        childB.GetMultithreadedOverlaps(opposingChildB, splitDepth, currentDepth + 1, owner, multithreadingSourceOverlaps);\n                }\n            }\n        }\n\n\n        internal override bool Remove(BroadPhaseEntry entry, out LeafNode leafNode, out Node replacementNode)\n        {\n            if (childA.Remove(entry, out leafNode, out replacementNode))\n            {\n                if (childA.IsLeaf)\n                    replacementNode = childB;\n                else\n                {\n                    //It was not a leaf node, but a child found the leaf.\n                    //Change the child to the replacement node.\n                    childA = replacementNode;\n                    replacementNode = this; //We don't need to be replaced!\n                }\n                return true;\n\n            }\n            if (childB.Remove(entry, out leafNode, out replacementNode))\n            {\n                if (childB.IsLeaf)\n                    replacementNode = childA;\n                else\n                {\n                    //It was not a leaf node, but a child found the leaf.\n                    //Change the child to the replacement node.\n                    childB = replacementNode;\n                    replacementNode = this; //We don't need to be replaced!\n                }\n                return true;\n            }\n            replacementNode = this;\n            return false;\n        }\n\n        internal override bool RemoveFast(BroadPhaseEntry entry, out LeafNode leafNode, out Node replacementNode)\n        {\n            //Only bother checking deeper in the path if the entry and child have overlapping bounding boxes.\n            bool intersects;\n            childA.BoundingBox.Intersects(ref entry.boundingBox, out intersects);\n            if (intersects && childA.RemoveFast(entry, out leafNode, out replacementNode))\n            {\n                if (childA.IsLeaf)\n                    replacementNode = childB;\n                else\n                {\n                    //It was not a leaf node, but a child found the leaf.\n                    //Change the child to the replacement node.\n                    childA = replacementNode;\n                    replacementNode = this; //We don't need to be replaced!\n                }\n                return true;\n\n            }\n            childB.BoundingBox.Intersects(ref entry.boundingBox, out intersects);\n            if (intersects && childB.RemoveFast(entry, out leafNode, out replacementNode))\n            {\n                if (childB.IsLeaf)\n                    replacementNode = childA;\n                else\n                {\n                    //It was not a leaf node, but a child found the leaf.\n                    //Change the child to the replacement node.\n                    childB = replacementNode;\n                    replacementNode = this; //We don't need to be replaced!\n                }\n                return true;\n            }\n            replacementNode = this;\n            leafNode = null;\n            return false;\n        }\n\n\n        static XComparer xComparer = new XComparer();\n        static YComparer yComparer = new YComparer();\n        static ZComparer zComparer = new ZComparer();\n        //Try using Comparer instead of IComparer- is there some tricky hardcoded optimization?\n        class XComparer : IComparer<LeafNode>\n        {\n            public int Compare(LeafNode x, LeafNode y)\n            {\n                return x.BoundingBox.Min.X < y.BoundingBox.Min.X ? -1 : 1;\n            }\n        }\n        class YComparer : IComparer<LeafNode>\n        {\n            public int Compare(LeafNode x, LeafNode y)\n            {\n                return x.BoundingBox.Min.Y < y.BoundingBox.Min.Y ? -1 : 1;\n            }\n        }\n        class ZComparer : IComparer<LeafNode>\n        {\n            public int Compare(LeafNode x, LeafNode y)\n            {\n                return x.BoundingBox.Min.Z < y.BoundingBox.Min.Z ? -1 : 1;\n            }\n        }\n    }\n\n\n\n\n    internal sealed class LeafNode : Node\n    {\n        BroadPhaseEntry element;\n        internal override Node ChildA\n        {\n            get\n            {\n                return null;\n            }\n        }\n        internal override Node ChildB\n        {\n            get\n            {\n                return null;\n            }\n        }\n\n        internal override BroadPhaseEntry Element\n        {\n            get\n            {\n                return element;\n            }\n        }\n\n        internal override bool IsLeaf\n        {\n            get { return true; }\n        }\n\n\n        internal void Initialize(BroadPhaseEntry element)\n        {\n            this.element = element;\n            BoundingBox = element.BoundingBox;\n        }\n        internal void CleanUp()\n        {\n            element = null;\n        }\n\n        internal override void GetOverlaps(ref BoundingBox boundingBox, IList<BroadPhaseEntry> outputOverlappedElements)\n        {\n            //Our parent already tested the bounding box.  All that's left is to add myself to the list.\n            outputOverlappedElements.Add(element);\n        }\n\n        internal override void GetOverlaps(ref BoundingSphere boundingSphere, IList<BroadPhaseEntry> outputOverlappedElements)\n        {\n            outputOverlappedElements.Add(element);\n        }\n\n        internal override void GetOverlaps(ref BoundingFrustum boundingFrustum, IList<BroadPhaseEntry> outputOverlappedElements)\n        {\n            outputOverlappedElements.Add(element);\n        }\n\n        internal override void GetOverlaps(ref Ray ray, float maximumLength, IList<BroadPhaseEntry> outputOverlappedElements)\n        {\n            outputOverlappedElements.Add(element);\n        }\n\n        internal override void GetOverlaps(Node opposingNode, DynamicHierarchy owner)\n        {\n            bool intersects;\n            //note: This is never executed when the opposing node is the current node.\n            if (opposingNode.IsLeaf)\n            {\n                //We're both leaves!  Our parents have already done the testing for us, so we know we're overlapping.\n                owner.TryToAddOverlap(element, opposingNode.Element);\n            }\n            else\n            {\n                var opposingChildA = opposingNode.ChildA;\n                var opposingChildB = opposingNode.ChildB;\n                //If it's not a leaf, try to go deeper in the opposing hierarchy.\n                BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                if (intersects)\n                    GetOverlaps(opposingChildA, owner);\n                BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                if (intersects)\n                    GetOverlaps(opposingChildB, owner);\n\n            }\n        }\n\n        internal override bool TryToInsert(LeafNode node, out Node treeNode)\n        {\n            var newTreeNode = InternalNode.nodePool.Take();\n            BoundingBox.CreateMerged(ref BoundingBox, ref node.BoundingBox, out newTreeNode.BoundingBox);\n            Vector3 offset;\n            Vector3.Subtract(ref newTreeNode.BoundingBox.Max, ref newTreeNode.BoundingBox.Min, out offset);\n            newTreeNode.currentVolume = offset.X * offset.Y * offset.Z;\n            //newTreeNode.maximumVolume = newTreeNode.currentVolume * InternalNode.MaximumVolumeScale;\n            newTreeNode.childA = this;\n            newTreeNode.childB = node;\n            treeNode = newTreeNode;\n            return true;\n        }\n\n        public override string ToString()\n        {\n            return element.ToString();\n        }\n\n        internal override void Analyze(List<int> depths, int depth, ref int nodeCount)\n        {\n            nodeCount++;\n            depths.Add(depth);\n        }\n\n        internal override void Refit()\n        {\n            BoundingBox = element.boundingBox;\n        }\n\n        internal override void RetrieveNodes(RawList<LeafNode> leafNodes)\n        {\n            Refit();\n            leafNodes.Add(this);\n        }\n\n        internal override void CollectMultithreadingNodes(int splitDepth, int currentDepth, RawList<Node> multithreadingSourceNodes)\n        {\n            //This could happen if there are almost no elements in the tree.  No biggie- do nothing!\n        }\n\n        internal override void PostRefit(int splitDepth, int currentDepth)\n        {\n            //This could happen if there are almost no elements in the tree.  Just do a normal leaf refit.\n            BoundingBox = element.boundingBox;\n        }\n\n        internal override void GetMultithreadedOverlaps(Node opposingNode, int splitDepth, int currentDepth, DynamicHierarchy owner, RawList<DynamicHierarchy.NodePair> multithreadingSourceOverlaps)\n        {\n            bool intersects;\n            //note: This is never executed when the opposing node is the current node.\n            if (opposingNode.IsLeaf)\n            {\n                //We're both leaves!  Our parents have already done the testing for us, so we know we're overlapping.\n                owner.TryToAddOverlap(element, opposingNode.Element);\n            }\n            else\n            {\n                var opposingChildA = opposingNode.ChildA;\n                var opposingChildB = opposingNode.ChildB;\n                if (splitDepth == currentDepth)\n                {\n                    //Time to add the child overlaps to the multithreading set!\n                    BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                    if (intersects)\n                        multithreadingSourceOverlaps.Add(new DynamicHierarchy.NodePair() { a = this, b = opposingChildA });\n                    BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                    if (intersects)\n                        multithreadingSourceOverlaps.Add(new DynamicHierarchy.NodePair() { a = this, b = opposingChildB });\n\n                    return;\n                }\n                //If it's not a leaf, try to go deeper in the opposing hierarchy.\n                BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                if (intersects)\n                    GetOverlaps(opposingChildA, owner);\n                BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                if (intersects)\n                    GetOverlaps(opposingChildB, owner);\n\n            }\n        }\n\n        internal override bool Remove(BroadPhaseEntry entry, out LeafNode leafNode, out Node replacementNode)\n        {\n            replacementNode = null;\n            if (element == entry)\n            {\n                leafNode = this;\n                return true;\n            }\n            leafNode = null;\n            return false;\n        }\n        internal override bool RemoveFast(BroadPhaseEntry entry, out LeafNode leafNode, out Node replacementNode)\n        {\n            //The fastremove leaf node procedure is identical to the brute force approach.\n            //We don't need to perform any bounding box test here; if they're equal, they're equal!\n            replacementNode = null;\n            if (element == entry)\n            {\n                leafNode = this;\n                return true;\n            }\n            leafNode = null;\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/Hierarchies/DynamicHierarchyQueryAccelerator.cs",
    "content": "﻿using System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.BroadPhaseSystems.Hierarchies\n{\n    ///<summary>\n    /// Interface to the DynamicHierarchy's volume query systems.\n    ///</summary>\n    public class DynamicHierarchyQueryAccelerator : IQueryAccelerator\n    {\n        private readonly DynamicHierarchy hierarchy;\n        internal DynamicHierarchyQueryAccelerator(DynamicHierarchy hierarchy)\n        {\n            this.hierarchy = hierarchy;\n        }\n\n        /// <summary>\n        /// Gets the broad phase associated with this query accelerator.\n        /// </summary>\n        public BroadPhase BroadPhase\n        {\n            get\n            {\n                return hierarchy;\n            }\n        }\n\n        /// <summary>\n        /// Collects all entries with bounding boxes which intersect the given bounding box.\n        /// </summary>\n        /// <param name=\"box\">Bounding box to test against the world.</param>\n        /// <param name=\"entries\">Entries of the space which intersect the bounding box.</param>\n        public void GetEntries(BoundingBox box, IList<BroadPhaseEntry> entries)\n        {\n            if (hierarchy.root != null)\n                hierarchy.root.GetOverlaps(ref box, entries);\n\n        }\n\n        /// <summary>\n        /// Collects all entries with bounding boxes which intersect the given frustum.\n        /// </summary>\n        /// <param name=\"frustum\">Frustum to test against the world.</param>\n        /// <param name=\"entries\">Entries of the space which intersect the frustum.</param>\n        public void GetEntries(BoundingFrustum frustum, IList<BroadPhaseEntry> entries)\n        {\n            if (hierarchy.root != null)\n                hierarchy.root.GetOverlaps(ref frustum, entries);\n\n        }\n\n        /// <summary>\n        /// Collects all entries with bounding boxes which intersect the given sphere.\n        /// </summary>\n        /// <param name=\"sphere\">Sphere to test against the world.</param>\n        /// <param name=\"entries\">Entries of the space which intersect the sphere.</param>\n        public void GetEntries(BoundingSphere sphere, IList<BroadPhaseEntry> entries)\n        {\n            if (hierarchy.root != null)\n                hierarchy.root.GetOverlaps(ref sphere, entries);\n\n        }\n\n\n        /// <summary>\n        /// Finds all intersections between the ray and broad phase entries.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test against the structure.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray's direction's length.</param>\n        /// <param name=\"entries\">Entries which have bounding boxes that overlap the ray.</param>\n        public bool RayCast(Ray ray, float maximumLength, IList<BroadPhaseEntry> entries)\n        {\n            if (hierarchy.root != null)\n            {\n                hierarchy.root.GetOverlaps(ref ray, maximumLength, entries);\n\n                return entries.Count > 0;\n            }\n            return false;\n        }\n\n\n        /// <summary>\n        /// Finds all intersections between the ray and broad phase entries.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test against the structure.</param>\n        /// <param name=\"entries\">Entries which have bounding boxes that overlap the ray.</param>\n        public bool RayCast(Ray ray, IList<BroadPhaseEntry> entries)\n        {\n            if (hierarchy.root != null)\n            {\n                hierarchy.root.GetOverlaps(ref ray, float.MaxValue, entries);\n\n                return entries.Count > 0;\n            }\n            return false;\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/IBoundingBoxOwner.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.BroadPhaseSystems\n{\n    ///<summary>\n    /// Requires that a class have a BoundingBox.\n    ///</summary>\n    public interface IBoundingBoxOwner\n    {\n        ///<summary>\n        /// Gets the bounding box of the object.\n        ///</summary>\n        BoundingBox BoundingBox { get; }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/IBroadPhaseEntryOwner.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\n\nnamespace BEPUphysics.BroadPhaseSystems\n{\n    ///<summary>\n    /// Requires that a class own a BroadPhaseEntry.\n    ///</summary>\n    public interface IBroadPhaseEntryOwner\n    {\n        ///<summary>\n        /// Gets the broad phase entry associated with this object.\n        ///</summary>\n        BroadPhaseEntry Entry { get; }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/IQueryAccelerator.cs",
    "content": "﻿using System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.BroadPhaseSystems\n{\n    ///<summary>\n    /// Defines a system that accelerates bounding volume and ray cast queries.\n    ///</summary>\n    public interface IQueryAccelerator\n    {\n        /// <summary>\n        /// Gets the broad phase associated with this query accelerator, if any.\n        /// </summary>\n        BroadPhase BroadPhase { get; }\n        ///<summary>\n        /// Gets the broad phase entries overlapping the ray.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test.</param>\n        ///<param name=\"outputIntersections\">Overlapped entries.</param>\n        ///<returns>Whether or not the ray hit anything.</returns>\n        bool RayCast(Ray ray, IList<BroadPhaseEntry> outputIntersections);\n        ///<summary>\n        /// Gets the broad phase entries overlapping the ray.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray's direction's length.</param>\n        ///<param name=\"outputIntersections\">Overlapped entries.</param>\n        ///<returns>Whether or not the ray hit anything.</returns>\n        bool RayCast(Ray ray, float maximumLength, IList<BroadPhaseEntry> outputIntersections);\n\n        //There's no single-hit version because the TOI on queries isn't really meaningful.\n        //TODO: IQueryAccelerator + BroadPhase.  Both have add methods.  A user might expect to be able to add separately, but that doesn't really work.\n        //Consider pulling the query accelerator into the broadphase so people consider it to be a part of the broadphase- it accelerates queries against the broadphase.\n        //If someone wanted to raycast against something other than the broadphase, they can create an IQueryAccelerator of some kind in isolation.\n\n        /// <summary>\n        /// Gets the entries with bounding boxes which overlap the bounding shape.\n        /// </summary>\n        /// <param name=\"boundingShape\">Bounding shape to test.</param>\n        /// <param name=\"overlaps\">Overlapped entries.</param>\n        void GetEntries(BoundingBox boundingShape, IList<BroadPhaseEntry> overlaps);\n        /// <summary>\n        /// Gets the entries with bounding boxes which overlap the bounding shape.\n        /// </summary>\n        /// <param name=\"boundingShape\">Bounding shape to test.</param>\n        /// <param name=\"overlaps\">Overlapped entries.</param>\n        void GetEntries(BoundingSphere boundingShape, IList<BroadPhaseEntry> overlaps);\n        /// <summary>\n        /// Gets the entries with bounding boxes which overlap the bounding shape.\n        /// </summary>\n        /// <param name=\"boundingShape\">Bounding shape to test.</param>\n        /// <param name=\"overlaps\">Overlapped entries.</param>\n        void GetEntries(BoundingFrustum boundingShape, IList<BroadPhaseEntry> overlaps);\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/SortAndSweep/Grid2DEntry.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.BroadPhaseEntries;\n\nnamespace BEPUphysics.BroadPhaseSystems.SortAndSweep\n{\n    class Grid2DEntry\n    {\n        internal void Initialize(BroadPhaseEntry entry)\n        {\n            this.item = entry;\n            Grid2DSortAndSweep.ComputeCell(ref entry.boundingBox.Min, out previousMin);\n            Grid2DSortAndSweep.ComputeCell(ref entry.boundingBox.Max, out previousMax);\n        }\n\n\n        internal BroadPhaseEntry item;\n        internal Int2 previousMin;\n        internal Int2 previousMax;\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/SortAndSweep/Grid2DSortAndSweep.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.Threading;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.BroadPhaseSystems.SortAndSweep\n{\n    /// <summary>\n    /// Broad phase implementation that partitions objects into a 2d grid, and then performs a sort and sweep on the final axis.\n    /// </summary>\n    /// <remarks>\n    /// This broad phase typically has very good collision performance and scales well with multithreading, but its query times can sometimes be worse than tree-based systems\n    /// since it must scan cells.  Keeping rays as short as possible helps avoid unnecessary cell checks.\n    /// The performance can degrade noticeably in some situations involving significant off-axis motion.\n    /// </remarks>\n    public class Grid2DSortAndSweep : BroadPhase\n    {\n        /// <summary>\n        /// Gets or sets the width of cells in the 2D grid.  For sparser, larger scenes, increasing this can help performance.\n        /// For denser scenes, decreasing this may help.\n        /// </summary>\n        public static float CellSize\n        {\n            get\n            {\n                return 1 / cellSizeInverse;\n            }\n            set\n            {\n                cellSizeInverse = 1 / value;\n            }\n        }\n        //TODO: Try different values for this.\n        internal static float cellSizeInverse = 1 / 8f; \n\n        internal static void ComputeCell(ref Vector3 v, out Int2 cell)\n        {\n            cell.Y = (int)Math.Floor(v.Y * cellSizeInverse);\n            cell.Z = (int)Math.Floor(v.Z * cellSizeInverse);\n        }\n\n        \n\n\n\n        internal SortedGrid2DSet cellSet = new SortedGrid2DSet();\n\n\n        RawList<Grid2DEntry> entries = new RawList<Grid2DEntry>();\n        Action<int> updateEntry, updateCell;\n\n        /// <summary>\n        /// Constructs a grid-based sort and sweep broad phase.\n        /// </summary>\n        /// <param name=\"threadManager\">Thread manager to use for the broad phase.</param>\n        public Grid2DSortAndSweep(IThreadManager threadManager)\n            :base(threadManager)\n        {\n            updateEntry = UpdateEntry;\n            updateCell = UpdateCell;\n            QueryAccelerator = new Grid2DSortAndSweepQueryAccelerator(this);\n        }\n        /// <summary>\n        /// Constructs a grid-based sort and sweep broad phase.\n        /// </summary>\n        public Grid2DSortAndSweep()\n        {\n            updateEntry = UpdateEntry;\n            updateCell = UpdateCell;\n            QueryAccelerator = new Grid2DSortAndSweepQueryAccelerator(this);\n        }\n\n        UnsafeResourcePool<Grid2DEntry> entryPool = new UnsafeResourcePool<Grid2DEntry>();\n        /// <summary>\n        /// Adds an entry to the broad phase.\n        /// </summary>\n        /// <param name=\"entry\">Entry to add.</param>\n        public override void Add(BroadPhaseEntry entry)\n        {\n            base.Add(entry);\n            //Entities do not set up their own bounding box before getting stuck in here.  If they're all zeroed out, the tree will be horrible.\n            Vector3 offset;\n            Vector3.Subtract(ref entry.boundingBox.Max, ref entry.boundingBox.Min, out offset);\n            if (offset.X * offset.Y * offset.Z == 0)\n                entry.UpdateBoundingBox();\n            var newEntry = entryPool.Take();\n            newEntry.Initialize(entry);\n            entries.Add(newEntry);\n            //Add the object to the grid.\n            for (int i = newEntry.previousMin.Y; i <= newEntry.previousMax.Y; i++)\n            {\n                for (int j = newEntry.previousMin.Z; j <= newEntry.previousMax.Z; j++)\n                {\n                    var index = new Int2 {Y = i, Z = j};\n                    cellSet.Add(ref index, newEntry);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Removes an entry from the broad phase.\n        /// </summary>\n        /// <param name=\"entry\">Entry to remove.</param>\n        public override void Remove(BroadPhaseEntry entry)\n        {\n            base.Remove(entry);\n            for (int i = 0; i < entries.Count; i++)\n            {\n                if (entries.Elements[i].item == entry)\n                {\n                    var gridEntry = entries.Elements[i];\n                    entries.RemoveAt(i);\n                    //Remove the object from any cells that it is held by.\n                    for (int j = gridEntry.previousMin.Y; j <= gridEntry.previousMax.Y; j++)\n                    {\n                        for (int k = gridEntry.previousMin.Z; k <= gridEntry.previousMax.Z; k++)\n                        {\n                            var index = new Int2 {Y = j, Z = k};\n                            cellSet.Remove(ref index, gridEntry);\n                        }\n                    }\n                    gridEntry.item = null;\n                    entryPool.GiveBack(gridEntry);\n                    return;\n                }\n            }\n        }\n\n        protected override void UpdateMultithreaded()\n        {\n            lock (Locker)\n            {\n                Overlaps.Clear();\n                //Update the entries!\n                ThreadManager.ForLoop(0, entries.Count, updateEntry);\n                //Update the cells!\n                ThreadManager.ForLoop(0, cellSet.count, updateCell);\n            }\n        }\n\n        protected override void UpdateSingleThreaded()\n        {\n            lock (Locker)\n            {\n                Overlaps.Clear();\n                //Update the placement of objects.\n                for (int i = 0; i < entries.Count; i++)\n                {\n                    //Compute the current cells occupied by the entry.\n                    var entry = entries.Elements[i];\n                    Int2 min, max;\n                    ComputeCell(ref entry.item.boundingBox.Min, out min);\n                    ComputeCell(ref entry.item.boundingBox.Max, out max);\n                    //For any cell that used to be occupied (defined by the previous min/max),\n                    //remove the entry.\n                    for (int j = entry.previousMin.Y; j <= entry.previousMax.Y; j++)\n                    {\n                        for (int k = entry.previousMin.Z; k <= entry.previousMax.Z; k++)\n                        {\n                            if (j >= min.Y && j <= max.Y && k >= min.Z && k <= max.Z)\n                                continue; //This cell is currently occupied, do not remove.\n                            var index = new Int2 {Y = j, Z = k};\n                            cellSet.Remove(ref index, entry);\n                        }\n                    }\n                    //For any cell that is newly occupied (was not previously contained),\n                    //add the entry.\n                    for (int j = min.Y; j <= max.Y; j++)\n                    {\n                        for (int k = min.Z; k <= max.Z; k++)\n                        {\n                            if (j >= entry.previousMin.Y && j <= entry.previousMax.Y && k >= entry.previousMin.Z && k <= entry.previousMax.Z)\n                                continue; //This cell is already occupied, do not add.\n                            var index = new Int2 {Y = j, Z = k};\n                            cellSet.Add(ref index, entry);\n                        }\n                    }\n                    entry.previousMin = min;\n                    entry.previousMax = max;\n                }\n\n                //Update each cell to find the overlaps.\n                for (int i = 0; i < cellSet.count; i++)\n                {\n                    cellSet.cells.Elements[i].UpdateOverlaps(this);\n                }\n            }\n        }\n\n        //TODO: Cell change operations take a while.  Spin lock can't efficiently wait that long.\n        //This causes some pretty horrible scaling problems in some scenarios.\n        //Improving the cell set operations directly should improve that problem and the query times noticeably.\n\n\n        SpinLock cellSetLocker = new SpinLock();\n        void UpdateEntry(int i)\n        {\n\n            //Compute the current cells occupied by the entry.\n            var entry = entries.Elements[i];\n            Int2 min, max;\n            ComputeCell(ref entry.item.boundingBox.Min, out min);\n            ComputeCell(ref entry.item.boundingBox.Max, out max);\n            //For any cell that used to be occupied (defined by the previous min/max),\n            //remove the entry.\n            for (int j = entry.previousMin.Y; j <= entry.previousMax.Y; j++)\n            {\n                for (int k = entry.previousMin.Z; k <= entry.previousMax.Z; k++)\n                {\n                    if (j >= min.Y && j <= max.Y && k >= min.Z && k <= max.Z)\n                        continue; //This cell is currently occupied, do not remove.\n                    var index = new Int2 {Y = j, Z = k};\n                    cellSetLocker.Enter();\n                    cellSet.Remove(ref index, entry);\n                    cellSetLocker.Exit();\n                }\n            }\n            //For any cell that is newly occupied (was not previously contained),\n            //add the entry.\n            for (int j = min.Y; j <= max.Y; j++)\n            {\n                for (int k = min.Z; k <= max.Z; k++)\n                {\n                    if (j >= entry.previousMin.Y && j <= entry.previousMax.Y && k >= entry.previousMin.Z && k <= entry.previousMax.Z)\n                        continue; //This cell is already occupied, do not add.\n                    var index = new Int2 {Y = j, Z = k};\n                    cellSetLocker.Enter();\n                    cellSet.Add(ref index, entry);\n                    cellSetLocker.Exit();\n                }\n            }\n            entry.previousMin = min;\n            entry.previousMax = max;\n        }\n\n        void UpdateCell(int i)\n        {\n            //TODO: Consider permuting.\n            //In some simulations, there may be a ton of unoccupied cells.\n            //It would be best to distribute these over the threads.\n            //(int)((i * 122949823L) % cellSet.count)\n            //(i * 122949823L) % cellSet.count\n            cellSet.cells.Elements[i].UpdateOverlaps(this);\n        }\n    }\n\n    struct Int2\n    {\n        internal int Y;\n        internal int Z;\n\n        public override int GetHashCode()\n        {\n            return Y + Z;\n        }\n\n\n\n        internal int GetSortingHash()\n        {\n            return (int)(Y * 15485863L + Z * 32452843L);\n        }\n\n        public override string ToString()\n        {\n            return \"{\" + Y + \", \" + Z + \"}\";\n        }\n    }\n\n\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/SortAndSweep/Grid2DSortAndSweepQueryAccelerator.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.BroadPhaseEntries;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.BroadPhaseSystems.SortAndSweep\n{\n    public class Grid2DSortAndSweepQueryAccelerator : IQueryAccelerator\n    {\n        Grid2DSortAndSweep owner;\n        public Grid2DSortAndSweepQueryAccelerator(Grid2DSortAndSweep owner)\n        {\n            this.owner = owner;\n        }\n\n        /// <summary>\n        /// Gets the broad phase associated with this query accelerator.\n        /// </summary>\n        public BroadPhase BroadPhase\n        {\n            get\n            {\n                return owner;\n            }\n        }\n\n        public bool RayCast(Microsoft.Xna.Framework.Ray ray, IList<BroadPhaseEntry> outputIntersections)\n        {\n            throw new NotSupportedException(\"The Grid2DSortAndSweep broad phase cannot accelerate infinite ray casts.  Consider specifying a maximum length or using a broad phase which supports infinite ray casts.\");\n        }\n\n        public bool RayCast(Microsoft.Xna.Framework.Ray ray, float maximumLength, IList<BroadPhaseEntry> outputIntersections)\n        {\n            if (maximumLength == float.MaxValue) \n                throw new NotSupportedException(\"The Grid2DSortAndSweep broad phase cannot accelerate infinite ray casts.  Consider specifying a maximum length or using a broad phase which supports infinite ray casts.\");\n        \n            //Use 2d line rasterization.\n            //Compute the exit location in the cell.\n            //Test against each bounding box up until the exit value is reached.\n            float length = 0;\n            Int2 cellIndex;\n            Vector3 currentPosition = ray.Position;\n            Grid2DSortAndSweep.ComputeCell(ref currentPosition, out cellIndex);\n            while (true)\n            {\n\n                float cellWidth = 1 / Grid2DSortAndSweep.cellSizeInverse;\n                float nextT; //Distance along ray to next boundary.\n                float nextTy; //Distance along ray to next boundary along y axis.\n                float nextTz; //Distance along ray to next boundary along z axis.\n                //Find the next cell.\n                if (ray.Direction.Y > 0)\n                    nextTy = ((cellIndex.Y + 1) * cellWidth - currentPosition.Y) / ray.Direction.Y;\n                else if (ray.Direction.Y < 0)\n                    nextTy = ((cellIndex.Y) * cellWidth - currentPosition.Y) / ray.Direction.Y;\n                else\n                    nextTy = 10e10f;\n                if (ray.Direction.Z > 0)\n                    nextTz = ((cellIndex.Z + 1) * cellWidth - currentPosition.Z) / ray.Direction.Z;\n                else if (ray.Direction.Z < 0)\n                    nextTz = ((cellIndex.Z) * cellWidth - currentPosition.Z) / ray.Direction.Z;\n                else\n                    nextTz = 10e10f;\n\n                bool yIsMinimum = nextTy < nextTz;\n                nextT = yIsMinimum ? nextTy : nextTz;\n\n\n\n\n                //Grab the cell that we are currently in.\n                GridCell2D cell;\n                if (owner.cellSet.TryGetCell(ref cellIndex, out cell))\n                {\n                    float endingX;\n                    if(ray.Direction.X < 0)\n                        endingX = currentPosition.X;\n                    else\n                        endingX = currentPosition.X + ray.Direction.X * nextT;\n\n                    //To fully accelerate this, the entries list would need to contain both min and max interval markers.\n                    //Since it only contains the sorted min intervals, we can't just start at a point in the middle of the list.\n                    //Consider some giant bounding box that spans the entire list. \n                    for (int i = 0; i < cell.entries.Count \n                        && cell.entries.Elements[i].item.boundingBox.Min.X <= endingX; i++) //TODO: Try additional x axis pruning?\n                    {\n                        float? intersects;\n                        var item = cell.entries.Elements[i].item;\n                        ray.Intersects(ref item.boundingBox, out intersects);\n                        if (intersects != null && intersects < maximumLength && !outputIntersections.Contains(item))\n                        {\n                            outputIntersections.Add(item);\n                        }\n                    }\n                }\n\n                //Move the position forward.\n                length += nextT;\n                if (length > maximumLength) //Note that this catches the case in which the ray is pointing right down the middle of a row (resulting in a nextT of 10e10f).\n                    break;\n                Vector3 offset;\n                Vector3.Multiply(ref ray.Direction, nextT, out offset);\n                Vector3.Add(ref offset, ref currentPosition, out currentPosition);\n                if (yIsMinimum)\n                    if (ray.Direction.Y < 0)\n                        cellIndex.Y -= 1;\n                    else\n                        cellIndex.Y += 1;\n                else\n                    if (ray.Direction.Z < 0)\n                        cellIndex.Z -= 1;\n                    else\n                        cellIndex.Z += 1;\n            }\n            return outputIntersections.Count > 0;\n\n        }\n\n\n        public void GetEntries(Microsoft.Xna.Framework.BoundingBox boundingShape, IList<BroadPhaseEntry> overlaps)\n        {\n            //Compute the min and max of the bounding box.\n            //Loop through the cells and select bounding boxes which overlap the x axis.\n\n            Int2 min, max;\n            Grid2DSortAndSweep.ComputeCell(ref boundingShape.Min, out min);\n            Grid2DSortAndSweep.ComputeCell(ref boundingShape.Max, out max);\n            for (int i = min.Y; i <= max.Y; i++)\n            {\n                for (int j = min.Z; j <= max.Z; j++)\n                {\n                    //Grab the cell that we are currently in.\n                    Int2 cellIndex;\n                    cellIndex.Y = i;\n                    cellIndex.Z = j;\n                    GridCell2D cell;\n                    if (owner.cellSet.TryGetCell(ref cellIndex, out cell))\n                    {\n                       \n                        //To fully accelerate this, the entries list would need to contain both min and max interval markers.\n                        //Since it only contains the sorted min intervals, we can't just start at a point in the middle of the list.\n                        //Consider some giant bounding box that spans the entire list. \n                        for (int k = 0; k < cell.entries.Count\n                            && cell.entries.Elements[k].item.boundingBox.Min.X <= boundingShape.Max.X; k++) //TODO: Try additional x axis pruning? A bit of optimization potential due to overlap with AABB test.\n                        {\n                            bool intersects;\n                            var item = cell.entries.Elements[k].item;\n                            boundingShape.Intersects(ref item.boundingBox, out intersects);\n                            if (intersects && !overlaps.Contains(item))\n                            {\n                                overlaps.Add(item);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        public void GetEntries(Microsoft.Xna.Framework.BoundingSphere boundingShape, IList<BroadPhaseEntry> overlaps)\n        {\n            //Create a bounding box based on the bounding sphere.\n            //Compute the min and max of the bounding box.\n            //Loop through the cells and select bounding boxes which overlap the x axis.\n#if !WINDOWS\n            Vector3 offset = new Vector3();\n#else\n            Vector3 offset;\n#endif\n            offset.X = boundingShape.Radius;\n            offset.Y = offset.X;\n            offset.Z = offset.Y;\n            BoundingBox box;\n            Vector3.Add(ref boundingShape.Center, ref offset, out box.Max);\n            Vector3.Subtract(ref boundingShape.Center, ref offset, out box.Min);\n\n            Int2 min, max;\n            Grid2DSortAndSweep.ComputeCell(ref box.Min, out min);\n            Grid2DSortAndSweep.ComputeCell(ref box.Max, out max);\n            for (int i = min.Y; i <= max.Y; i++)\n            {\n                for (int j = min.Z; j <= max.Z; j++)\n                {\n                    //Grab the cell that we are currently in.\n                    Int2 cellIndex;\n                    cellIndex.Y = i;\n                    cellIndex.Z = j;\n                    GridCell2D cell;\n                    if (owner.cellSet.TryGetCell(ref cellIndex, out cell))\n                    {\n\n                        //To fully accelerate this, the entries list would need to contain both min and max interval markers.\n                        //Since it only contains the sorted min intervals, we can't just start at a point in the middle of the list.\n                        //Consider some giant bounding box that spans the entire list. \n                        for (int k = 0; k < cell.entries.Count\n                            && cell.entries.Elements[k].item.boundingBox.Min.X <= box.Max.X; k++) //TODO: Try additional x axis pruning? A bit of optimization potential due to overlap with AABB test.\n                        {\n                            bool intersects;\n                            var item = cell.entries.Elements[k].item;\n                            boundingShape.Intersects(ref item.boundingBox, out intersects);\n                            if (intersects && !overlaps.Contains(item))\n                            {\n                                overlaps.Add(item);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        public void GetEntries(Microsoft.Xna.Framework.BoundingFrustum boundingShape, IList<BroadPhaseEntry> overlaps)\n        {\n            throw new NotSupportedException(\"The Grid2DSortAndSweep broad phase cannot accelerate frustum tests.  Consider using a broad phase which supports frustum tests or using a custom solution.\");\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/SortAndSweep/GridCell2D.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUutilities.DataStructures;\nusing Microsoft.Xna.Framework;\nusing System.Diagnostics;\n\nnamespace BEPUphysics.BroadPhaseSystems.SortAndSweep\n{\n    class GridCell2D\n    {\n        internal RawList<Grid2DEntry> entries = new RawList<Grid2DEntry>();\n        internal Int2 cellIndex;\n        internal int sortingHash;\n\n        internal void Initialize(ref Int2 cellIndex, int hash)\n        {\n            this.cellIndex = cellIndex;\n            sortingHash = hash;\n        }\n\n        internal int GetIndex(float x)\n        {\n            int minIndex = 0; //inclusive\n            int maxIndex = entries.Count; //exclusive\n            int index = 0;\n            while (maxIndex - minIndex > 0)\n            {\n                index = (maxIndex + minIndex) / 2;\n                if (entries.Elements[index].item.boundingBox.Min.X > x)\n                    maxIndex = index;\n                else if (entries.Elements[index].item.boundingBox.Min.X < x)\n                    minIndex = ++index;\n                else\n                    break; //Found an equal value!\n\n            }\n            return index;\n        }\n\n        internal void Add(Grid2DEntry entry)\n        {\n            //binary search for the approximately correct location.  This helps prevent large first-frame sort times.\n            entries.Insert(GetIndex(entry.item.boundingBox.Min.X), entry);\n        }\n\n        internal void Remove(Grid2DEntry entry)\n        {\n            entries.Remove(entry);\n        }\n\n        internal void UpdateOverlaps(Grid2DSortAndSweep owner)\n        {\n            //Sort along x axis using insertion sort; the list will be nearly sorted, so very few swaps are necessary.\n            for (int i = 1; i < entries.Count; i++)\n            {\n                var entry = entries.Elements[i];\n                for (int j = i - 1; j >= 0; j--)\n                {\n                    if (entry.item.boundingBox.Min.X < entries.Elements[j].item.boundingBox.Min.X)\n                    {\n                        entries.Elements[j + 1] = entries.Elements[j];\n                        entries.Elements[j] = entry;\n                    }\n                    else\n                        break;\n                }\n            }\n            //Sweep the list looking for overlaps.\n            for (int i = 0; i < entries.Count; i++)\n            {\n                Grid2DEntry a = entries.Elements[i];\n                Grid2DEntry b;\n                //TODO: Microoptimize\n                for (int j = i + 1; j < entries.Count && a.item.boundingBox.Max.X >= (b = entries.Elements[j]).item.boundingBox.Min.X; j++)\n                {\n                    if (!(a.item.boundingBox.Min.Y > b.item.boundingBox.Max.Y || a.item.boundingBox.Max.Y < b.item.boundingBox.Min.Y ||\n                          a.item.boundingBox.Min.Z > b.item.boundingBox.Max.Z || a.item.boundingBox.Max.Z < b.item.boundingBox.Min.Z))\n                    {\n                        //Now we know this pair is overlapping, but we do not know if this overlap is already added.\n                        //Rather than use a hashset or other heavy structure to check, rely on the rules of the grid.\n\n                        //It's possible to avoid adding pairs entirely unless we are the designated 'responsible' cell.\n                        //All other cells will defer to the cell 'responsible' for a pair.\n                        //A simple rule for determining the cell which is responsible is to choose the cell which is the \n                        //smallest index in the shared cells.  So first, compute that cell's index.\n\n                        Int2 minimumSharedIndex = a.previousMin;\n\n                        if (minimumSharedIndex.Y < b.previousMin.Y)\n                            minimumSharedIndex.Y = b.previousMin.Y;\n                        if (minimumSharedIndex.Y > b.previousMax.Y)\n                            minimumSharedIndex.Y = b.previousMax.Y;\n\n                        if (minimumSharedIndex.Z < b.previousMin.Z)\n                            minimumSharedIndex.Z = b.previousMin.Z;\n                        if (minimumSharedIndex.Z > b.previousMax.Z)\n                            minimumSharedIndex.Z = b.previousMax.Z;\n\n                        //Is our cell the minimum cell?\n                        if (minimumSharedIndex.Y == cellIndex.Y && minimumSharedIndex.Z == cellIndex.Z)\n                            owner.TryToAddOverlap(a.item, b.item);\n\n\n\n\n\n                    }\n                }\n            }\n        }\n\n\n        public override string ToString()\n        {\n            return \"{\" + cellIndex.Y + \", \" + cellIndex.Z + \"}: \" + entries.Count;\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/SortAndSweep/SortAndSweep1D.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.Threading;\nusing BEPUutilities.DataStructures;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.BroadPhaseSystems.SortAndSweep\n{\n    /// <summary>\n    /// Simple and standard implementation of the one-axis sort and sweep (sweep and prune) algorithm.\n    /// </summary>\n    /// <remarks>\n    /// In small scenarios, it can be the quickest option.  It uses very little memory.\n    /// However, it tends to scale poorly relative to other options and can slow down significantly when entries cluster along the axis.\n    /// Additionally, it supports no queries at all.\n    /// </remarks>\n    public class SortAndSweep1D : BroadPhase\n    {\n        /// <summary>\n        /// Constructs a new sort and sweep broad phase.\n        /// </summary>\n        /// <param name=\"threadManager\">Thread manager to use in the broad phase.</param>\n        public SortAndSweep1D(IThreadManager threadManager)\n            : base(threadManager)\n        {\n            sweepSegment = Sweep;\n            backbuffer = new RawList<BroadPhaseEntry>();\n        }\n\n        /// <summary>\n        /// Constructs a new sort and sweep broad phase.\n        /// </summary>\n        public SortAndSweep1D()\n        {\n\n            sweepSegment = Sweep;\n            backbuffer = new RawList<BroadPhaseEntry>();\n        }\n\n\n        RawList<BroadPhaseEntry> entries = new RawList<BroadPhaseEntry>();\n        /// <summary>\n        /// Adds an entry to the broad phase.\n        /// </summary>\n        /// <param name=\"entry\">Entry to add.</param>\n        public override void Add(BroadPhaseEntry entry)\n        {\n            base.Add(entry);\n            //Entities do not set up their own bounding box before getting stuck in here.  If they're all zeroed out, the tree will be horrible.\n            Vector3 offset;\n            Vector3.Subtract(ref entry.boundingBox.Max, ref entry.boundingBox.Min, out offset);\n            if (offset.X * offset.Y * offset.Z == 0)\n                entry.UpdateBoundingBox();\n            //binary search for the approximately correct location.  This helps prevent large first-frame sort times.\n            int minIndex = 0; //inclusive\n            int maxIndex = entries.Count; //exclusive\n            int index = 0;\n            while (maxIndex - minIndex > 0)\n            {\n                index = (maxIndex + minIndex) / 2;\n                if (entries.Elements[index].boundingBox.Min.X > entry.boundingBox.Min.X)\n                    maxIndex = index;\n                else if (entries.Elements[index].boundingBox.Min.X < entry.boundingBox.Min.X)\n                    minIndex = ++index;\n                else\n                    break; //Found an equal value!\n\n            }\n            entries.Insert(index, entry);\n        }\n\n        /// <summary>\n        /// Removes an entry from the broad phase.\n        /// </summary>\n        /// <param name=\"entry\">Entry to remove.</param>\n        public override void Remove(BroadPhaseEntry entry)\n        {\n            base.Remove(entry);\n            entries.Remove(entry);\n        }\n\n        Action<int> sweepSegment;\n        protected override void UpdateMultithreaded()\n        {\n            if (backbuffer.Count != entries.Count)\n            {\n                backbuffer.Capacity = entries.Capacity;\n                backbuffer.Count = entries.Count;\n            }\n            Overlaps.Clear();\n            //Sort along x axis using insertion sort; the list will be nearly sorted, so very few swaps are necessary.\n            for (int i = 1; i < entries.Count; i++)\n            {\n                var entry = entries.Elements[i];\n                for (int j = i - 1; j >= 0; j--)\n                {\n                    if (entry.boundingBox.Min.X < entries.Elements[j].boundingBox.Min.X)\n                    {\n                        entries.Elements[j + 1] = entries.Elements[j];\n                        entries.Elements[j] = entry;\n                    }\n                    else\n                        break;\n                }\n\n            }\n\n            //TODO: Multithreaded sorting could help in some large cases.\n            //The overhead involved in this implementation is way too high for reasonable object counts.\n            //for (int i = 0; i < sortSegmentCount; i++)\n            //    SortSection(i);\n\n            ////MergeSections(0, 1);\n            ////MergeSections(2, 3);\n            ////MergeSections(0, 2);\n            ////MergeSections(1, 3);\n\n            //MergeSections(0, 1);\n            //MergeSections(2, 3);\n            //MergeSections(4, 5);\n            //MergeSections(6, 7);\n\n            //MergeSections(0, 2);\n            //MergeSections(1, 3);\n            //MergeSections(4, 6);\n            //MergeSections(5, 7);\n\n            //MergeSections(0, 4);\n            //MergeSections(1, 5);\n            //MergeSections(2, 6);\n            //MergeSections(3, 7);\n\n            //var temp = backbuffer;\n            //backbuffer = entries;\n            //entries = temp;\n\n            ThreadManager.ForLoop(0, sweepSegmentCount, sweepSegment);\n        }\n\n        protected override void UpdateSingleThreaded()\n        {\n            Overlaps.Clear();\n            //Sort along x axis using insertion sort; the list will be nearly sorted, so very few swaps are necessary.\n            for (int i = 1; i < entries.Count; i++)\n            {\n                var entry = entries.Elements[i];\n                for (int j = i - 1; j >= 0; j--)\n                {\n                    if (entry.boundingBox.Min.X < entries.Elements[j].boundingBox.Min.X)\n                    {\n                        entries.Elements[j + 1] = entries.Elements[j];\n                        entries.Elements[j] = entry;\n                    }\n                    else\n                        break;\n                }\n\n            }\n            //Sweep the list looking for overlaps.\n            for (int i = 0; i < entries.Count; i++)\n            {\n                BoundingBox a = entries.Elements[i].boundingBox;\n                for (int j = i + 1; j < entries.Count && a.Max.X >= entries.Elements[j].boundingBox.Min.X; j++)\n                {\n                    if (!(a.Min.Y > entries.Elements[j].boundingBox.Max.Y || a.Max.Y < entries.Elements[j].boundingBox.Min.Y ||\n                          a.Min.Z > entries.Elements[j].boundingBox.Max.Z || a.Max.Z < entries.Elements[j].boundingBox.Min.Z))\n                    {\n                        TryToAddOverlap(entries.Elements[i], entries.Elements[j]);\n                    }\n                }\n            }\n        }\n\n\n        //TODO: It is possible to distribute things a bit better.  Instead of lumping all of the remainder into the final, put and \n\n        int sweepSegmentCount = 32;\n        void Sweep(int segment)\n        {\n            int intervalLength = entries.Count / sweepSegmentCount;\n            int end;\n            if (segment == sweepSegmentCount - 1)\n                end = entries.Count;\n            else\n                end = intervalLength * (segment + 1);\n            for (int i = intervalLength * segment; i < end; i++)\n            {\n                BoundingBox a = entries.Elements[i].boundingBox;\n                for (int j = i + 1; j < entries.Count && a.Max.X >= entries.Elements[j].boundingBox.Min.X; j++)\n                {\n                    if (!(a.Min.Y > entries.Elements[j].boundingBox.Max.Y || a.Max.Y < entries.Elements[j].boundingBox.Min.Y ||\n                          a.Min.Z > entries.Elements[j].boundingBox.Max.Z || a.Max.Z < entries.Elements[j].boundingBox.Min.Z))\n                    {\n                        TryToAddOverlap(entries.Elements[i], entries.Elements[j]);\n                    }\n                }\n            }\n        }\n\n        int sortSegmentCount = 4;\n        void SortSection(int section)\n        {\n            int intervalLength = entries.Count / sortSegmentCount;\n            int start = section * intervalLength;\n            int end;\n            if (section == sortSegmentCount - 1)\n                end = entries.Count;\n            else\n                end = intervalLength * (section + 1);\n\n            for (int i = start + 1; i < end; i++)\n            {\n                var entry = entries.Elements[i];\n                for (int j = i - 1; j >= 0; j--)\n                {\n                    if (entry.boundingBox.Min.X < entries.Elements[j].boundingBox.Min.X)\n                    {\n                        entries.Elements[j + 1] = entries.Elements[j];\n                        entries.Elements[j] = entry;\n                    }\n                    else\n                        break;\n                }\n\n            }\n        }\n\n        RawList<BroadPhaseEntry> backbuffer;\n        void MergeSections(int a, int b)\n        {\n            int intervalLength = entries.Count / sortSegmentCount;\n            //'a' is known to be less than b, which means it cannot be the last section.\n            int aStart = intervalLength * a;\n            int aEnd = intervalLength * (a + 1);\n            int bStart = intervalLength * b;\n            int bEnd;\n            int length;\n            if (b == sortSegmentCount - 1)\n            {\n                bEnd = entries.Count;\n                length = intervalLength + entries.Count - bStart;\n            }\n            else\n            {\n                bEnd = intervalLength * (b + 1);\n                length = intervalLength * 2;\n            }\n\n            int aIndex = aStart, bIndex = bStart;\n            int i = 0;\n            while (i < length)\n            {\n                //Compute the location in the buffer array to put the minimum element.\n                int bufferIndex;\n                if (i >= intervalLength) //a length is intervalLength.\n                    bufferIndex = bStart + i - intervalLength;\n                else\n                    bufferIndex = aStart + i;\n\n                if (aIndex < aEnd && bIndex < bEnd)\n                {\n                    //Compare the element at a to the one at b.\n                    if (entries.Elements[aIndex].boundingBox.Min.X < entries.Elements[bIndex].boundingBox.Min.X)\n                    {\n                        //a was the minimum element.  Put it into the buffer and increment the considered a index.\n                        backbuffer.Elements[bufferIndex] = entries.Elements[aIndex++];\n                    }\n                    else\n                    {\n                        //b was the minimum element.  Put it into the buffer and increment the considered b index.\n                        backbuffer.Elements[bufferIndex] = entries.Elements[bIndex++];\n                    }\n                }\n                else if (aIndex < aEnd)\n                {\n                    //B is at the max, so just use a.\n                    backbuffer.Elements[bufferIndex] = entries.Elements[aIndex++];\n                }\n                else\n                {\n                    //A is at the max, so just use b.\n                    backbuffer.Elements[bufferIndex] = entries.Elements[bIndex++];\n                }\n                i++;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/SortAndSweep/SortedGrid2DSet.cs",
    "content": "﻿using BEPUutilities.DataStructures;\nusing BEPUutilities.ResourceManagement;\n\nnamespace BEPUphysics.BroadPhaseSystems.SortAndSweep\n{\n    internal class SortedGrid2DSet\n    {\n        //TODO: The cell set is the number one reason why Grid2DSortAndSweep fails in corner cases.\n        //One option:\n        //Instead of trying to maintain a sorted set, stick to a dictionary + RawList combo.\n        //The update phase can add active cell-object pairs to a raw list.  Could do bottom-up recreation too, though contention might be an issue.\n        //Another option: Some other parallel-enumerable set, possibly with tricky hashing.\n\n        internal RawList<GridCell2D> cells = new RawList<GridCell2D>();\n        UnsafeResourcePool<GridCell2D> cellPool = new UnsafeResourcePool<GridCell2D>();\n\n        internal int count;\n\n        internal bool TryGetIndex(ref Int2 cellIndex, out int index, out int sortingHash)\n        {\n            sortingHash = cellIndex.GetSortingHash();\n            int minIndex = 0; //inclusive\n            int maxIndex = count; //exclusive\n            index = 0;\n            while (maxIndex - minIndex > 0) //If the testing interval has a length of zero, we've done as much as we can.\n            {\n                index = (maxIndex + minIndex) / 2;\n                if (cells.Elements[index].sortingHash > sortingHash)\n                    maxIndex = index;\n                else if (cells.Elements[index].sortingHash < sortingHash)\n                    minIndex = ++index;\n                else\n                {\n                    //Found an equal sorting hash!\n                    //The hash can collide, and we cannot add an entry to \n                    //an incorrect index.  It would break the 'cell responsibility' \n                    //used by the cell update process to avoid duplicate overlaps.\n                    //So, check if the index we found is ACTUALLY correct.\n                    if (cells.Elements[index].cellIndex.Y == cellIndex.Y && cells.Elements[index].cellIndex.Z == cellIndex.Z)\n                    {\n                        return true;\n                    }\n                    //If it was not the correct index, let it continue searching.\n                }\n\n            }\n            return false;\n        }\n\n        internal bool TryGetCell(ref Int2 cellIndex, out GridCell2D cell)\n        {\n            int index;\n            int sortingHash;\n            if (TryGetIndex(ref cellIndex, out index, out sortingHash))\n            {\n                cell = cells.Elements[index];\n                return true;\n            }\n            cell = null;\n            return false;\n        }\n\n        internal void Add(ref Int2 index, Grid2DEntry entry)\n        {\n            int cellIndex;\n            int sortingHash;\n            if (TryGetIndex(ref index, out cellIndex, out sortingHash))\n            {\n                cells.Elements[cellIndex].Add(entry);\n                return;\n            }\n            var cell = cellPool.Take();\n            cell.Initialize(ref index, sortingHash);\n            cell.Add(entry);\n            cells.Insert(cellIndex, cell);\n            count++;\n\n            ////Take an index.  See if it's taken in the set.\n            ////If it's already there, then add the entry to the cell.\n            ////If it's not already there, create a new cell and add the entry to the cell and insert it at the index located.\n\n            //int sortingHash = index.GetSortingHash();\n            //int minIndex = 0; //inclusive\n            //int maxIndex = count; //exclusive\n            //int i = 0;\n            //while (maxIndex - minIndex > 0) //If the testing interval has a length of zero, we've done as much as we can.\n            //{\n            //    i = (maxIndex + minIndex) / 2;\n            //    if (cells.Elements[i].sortingHash > sortingHash)\n            //        maxIndex = i;\n            //    else if (cells.Elements[i].sortingHash < sortingHash)\n            //        minIndex = ++i;\n            //    else\n            //    {\n            //        //Found an equal sorting hash!\n            //        //The hash can collide, and we cannot add an entry to \n            //        //an incorrect index.  It would break the 'cell responsibility' \n            //        //used by the cell update process to avoid duplicate overlaps.\n            //        //So, check if the index we found is ACTUALLY correct.\n            //        if (cells.Elements[i].cellIndex.Y == index.Y && cells.Elements[i].cellIndex.Z == index.Z)\n            //        {\n            //            cells.Elements[i].Add(entry);\n            //            return;\n            //        }\n            //        //If it was not the correct index, let it continue searching.\n            //    }\n\n            //}\n            //var cell = cellPool.Take();\n            //cell.Initialize(ref index, sortingHash);\n            //cell.Add(entry);\n            //cells.Insert(i, cell);\n            //count++;\n\n        }\n\n        internal void Remove(ref Int2 index, Grid2DEntry entry)\n        {\n            int cellIndex;\n            int sortingHash;\n            if (TryGetIndex(ref index, out cellIndex, out sortingHash))\n            {\n                cells.Elements[cellIndex].Remove(entry);\n                if (cells.Elements[cellIndex].entries.Count == 0)\n                {\n                    //The cell is now empty.  Give it back to the pool.\n                    var toRemove = cells.Elements[cellIndex];\n                    //There's no cleanup to do on the grid cell.\n                    //Its list is empty, and the rest is just value types.\n                    cells.RemoveAt(cellIndex);\n                    cellPool.GiveBack(toRemove);\n                    count--;\n                }\n            }\n\n\n            //int sortingHash = index.GetSortingHash();\n            //int minIndex = 0; //inclusive\n            //int maxIndex = count; //exclusive\n            //int i = 0;\n            //while (maxIndex - minIndex > 0) //If the testing interval has a length of zero, we've done as much as we can.\n            //{\n            //    i = (maxIndex + minIndex) / 2;\n            //    if (cells.Elements[i].sortingHash > sortingHash)\n            //        maxIndex = i;\n            //    else if (cells.Elements[i].sortingHash < sortingHash)\n            //        minIndex = ++i;\n            //    else\n            //    {\n            //        //Found an equal sorting hash!\n            //        //The hash can collide, and we cannot add an entry to \n            //        //an incorrect index.  It would break the 'cell responsibility' \n            //        //used by the cell update process to avoid duplicate overlaps.\n            //        //So, check if the index we found is ACTUALLY correct.\n            //        if (cells.Elements[i].cellIndex.Y == index.Y && cells.Elements[i].cellIndex.Z == index.Z)\n            //        {\n            //            cells.Elements[i].Remove(entry);\n            //            if (cells.Elements[i].entries.count == 0)\n            //            {\n            //                //The cell is now empty.  Give it back to the pool.\n            //                var toRemove = cells.Elements[i];\n            //                //There's no cleanup to do on the grid cell.\n            //                //Its list is empty, and the rest is just value types.\n            //                cells.RemoveAt(i);\n            //                cellPool.GiveBack(toRemove);\n            //                count--;\n            //            }\n            //            return;\n            //        }\n            //        //If it was not the correct index, let it continue searching.\n            //    }\n\n            //}\n            ////Getting here should be impossible.\n\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/BroadPhaseSystems/SortAndSweep/Testing/SortAndSweep3D.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUutilities.DataStructures;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.BroadPhaseSystems.SortAndSweep.Testing\n{\n    internal class SortAndSweep3D : BroadPhase\n    {\n        RawList<BroadPhaseEntry> entriesX = new RawList<BroadPhaseEntry>();\n        RawList<BroadPhaseEntry> entriesY = new RawList<BroadPhaseEntry>();\n        RawList<BroadPhaseEntry> entriesZ = new RawList<BroadPhaseEntry>();\n\n        public override void Add(BroadPhaseEntry entry)\n        {\n            base.Add(entry);\n            //binary search for the approximately correct location.  This helps prevent large first-frame sort times.\n            //X Axis:\n            int minIndex = 0; //inclusive\n            int maxIndex = entriesX.Count; //exclusive\n            int index = 0;\n            while (maxIndex - minIndex > 0)\n            {\n                index = (maxIndex + minIndex) / 2;\n                if (entriesX.Elements[index].boundingBox.Min.X > entry.boundingBox.Min.X)\n                    maxIndex = index;\n                else if (entriesX.Elements[index].boundingBox.Min.X < entry.boundingBox.Min.X)\n                    minIndex = ++index;\n                else\n                    break; //Found an equal value!\n            }\n            entriesX.Insert(index, entry);\n\n            //Y Axis:\n            minIndex = 0; //inclusive\n            maxIndex = entriesY.Count; //exclusive\n            while (maxIndex - minIndex > 0)\n            {\n                index = (maxIndex + minIndex) / 2;\n                if (entriesY.Elements[index].boundingBox.Min.Y > entry.boundingBox.Min.Y)\n                    maxIndex = index;\n                else if (entriesY.Elements[index].boundingBox.Min.Y < entry.boundingBox.Min.Y)\n                    minIndex = ++index;\n                else\n                    break; //Found an equal value!\n            }\n            entriesY.Insert(index, entry);\n\n            //Z Axis:\n            minIndex = 0; //inclusive\n            maxIndex = entriesZ.Count; //exclusive\n            while (maxIndex - minIndex > 0)\n            {\n                index = (maxIndex + minIndex) / 2;\n                if (entriesZ.Elements[index].boundingBox.Min.Z > entry.boundingBox.Min.Z)\n                    maxIndex = index;\n                else if (entriesZ.Elements[index].boundingBox.Min.Z < entry.boundingBox.Min.Z)\n                    minIndex = ++index;\n                else\n                    break; //Found an equal value!\n            }\n            entriesZ.Insert(index, entry);\n        }\n\n        public override void Remove(BroadPhaseEntry entry)\n        {\n            base.Remove(entry);\n            entriesX.Remove(entry);\n            entriesY.Remove(entry);\n            entriesZ.Remove(entry);\n        }\n\n        protected override void UpdateMultithreaded()\n        {\n            UpdateSingleThreaded();\n        }\n\n        HashSet<BroadPhaseOverlap> overlapCandidatesX = new HashSet<BroadPhaseOverlap>();\n        HashSet<BroadPhaseOverlap> overlapCandidatesY = new HashSet<BroadPhaseOverlap>();\n\n        protected override void UpdateSingleThreaded()\n        {\n            overlapCandidatesX.Clear();\n            overlapCandidatesY.Clear();\n            Overlaps.Clear();\n\n            //Sort along x axis using insertion sort; the list will be nearly sorted, so very few swaps are necessary.\n            for (int i = 1; i < entriesX.Count; i++)\n            {\n                var entry = entriesX.Elements[i];\n                for (int j = i - 1; j >= 0; j--)\n                {\n                    if (entry.boundingBox.Min.X < entriesX.Elements[j].boundingBox.Min.X)\n                    {\n                        entriesX.Elements[j + 1] = entriesX.Elements[j];\n                        entriesX.Elements[j] = entry;\n                    }\n                    else\n                        break;\n                }\n\n            }\n            //Sort along y axis using insertion sort; the list will be nearly sorted, so very few swaps are necessary.\n            for (int i = 1; i < entriesY.Count; i++)\n            {\n                var entry = entriesY.Elements[i];\n                for (int j = i - 1; j >= 0; j--)\n                {\n                    if (entry.boundingBox.Min.Y < entriesY.Elements[j].boundingBox.Min.Y)\n                    {\n                        entriesY.Elements[j + 1] = entriesY.Elements[j];\n                        entriesY.Elements[j] = entry;\n                    }\n                    else\n                        break;\n                }\n\n            }\n            //Sort along z axis using insertion sort; the list will be nearly sorted, so very few swaps are necessary.\n            for (int i = 1; i < entriesZ.Count; i++)\n            {\n                var entry = entriesZ.Elements[i];\n                for (int j = i - 1; j >= 0; j--)\n                {\n                    if (entry.boundingBox.Min.Z < entriesZ.Elements[j].boundingBox.Min.Z)\n                    {\n                        entriesZ.Elements[j + 1] = entriesZ.Elements[j];\n                        entriesZ.Elements[j] = entry;\n                    }\n                    else\n                        break;\n                }\n\n            }\n\n            //Hash-set based sweeping is way too slow.  3D sap is really best suited to an incremental approach.\n\n            //Sweep the list looking for overlaps.\n            //Sweep the X axis first; in this phase, add overlaps to the hash set if they exist.\n            for (int i = 0; i < entriesX.Count; i++)\n            {\n                BoundingBox a = entriesX.Elements[i].boundingBox;\n                for (int j = i + 1; j < entriesX.Count && a.Max.X > entriesX.Elements[j].boundingBox.Min.X; j++)\n                {\n                    overlapCandidatesX.Add(new BroadPhaseOverlap(entriesX.Elements[i], entriesX.Elements[j]));\n                }\n            }\n            //Sweep the Y axis second; same thing\n            for (int i = 0; i < entriesY.Count; i++)\n            {\n                BoundingBox a = entriesY.Elements[i].boundingBox;\n                for (int j = i + 1; j < entriesY.Count && a.Max.Y > entriesY.Elements[j].boundingBox.Min.Y; j++)\n                {\n                    overlapCandidatesY.Add(new BroadPhaseOverlap(entriesY.Elements[i], entriesY.Elements[j]));\n                }\n            }\n            //Sweep the Z axis last\n            for (int i = 0; i < entriesZ.Count; i++)\n            {\n                BoundingBox a = entriesZ.Elements[i].boundingBox;\n                for (int j = i + 1; j < entriesZ.Count && a.Max.Z > entriesZ.Elements[j].boundingBox.Min.Z; j++)\n                {\n                    var overlap = new BroadPhaseOverlap(entriesZ.Elements[i], entriesZ.Elements[j]);\n                    if (overlapCandidatesX.Contains(overlap) && overlapCandidatesY.Contains(overlap))\n                        TryToAddOverlap(entriesZ.Elements[i], entriesZ.Elements[j]);\n                }\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionRuleManagement/CollisionGroup.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace BEPUphysics.CollisionRuleManagement\n{\n    /// <summary>\n    /// A group which can have interaction rules created between it and other collision groups.\n    /// Every entity has a collision group and considers the group's interaction rules in collisions with other entities.\n    /// </summary>\n    public class CollisionGroup\n    {\n        private readonly int hashCode;\n\n        /// <summary>\n        /// Constructs a new collision group.\n        /// </summary>\n        public CollisionGroup()\n        {\n            const ulong prime = 0xd8163841;\n            var hash = (ulong)(base.GetHashCode());\n            hash = hash * hash * hash * hash * hash * prime;\n            hashCode = (int)(hash);\n        }\n\n        //Equals is not overriden because the hashcode because the hashcode is the default hashcode, just modified a bit.\n\n        /// <summary>\n        /// Defines the CollisionRule between the two groups for a given space.\n        /// </summary>\n        /// <param name=\"groupA\">First CollisionGroup of the pair.</param>\n        /// <param name=\"groupB\">Second CollisionGroup of the pair.</param>\n        /// <param name=\"rule\">CollisionRule to use between the pair.</param>\n        public static void DefineCollisionRule(CollisionGroup groupA, CollisionGroup groupB, CollisionRule rule)\n        {\n            var pair = new CollisionGroupPair(groupA, groupB);\n            if (CollisionRules.CollisionGroupRules.ContainsKey(pair))\n                CollisionRules.CollisionGroupRules[pair] = rule;\n            else\n                CollisionRules.CollisionGroupRules.Add(pair, rule);\n        }\n\n        /// <summary>\n        /// Defines a CollisionRule between every group in the first set and every group in the second set for a given space.\n        /// </summary>\n        /// <param name=\"aGroups\">First set of groups.</param>\n        /// <param name=\"bGroups\">Second set of groups.</param>\n        /// <param name=\"rule\">Collision rule to define between the sets.</param>\n        public static void DefineCollisionRulesBetweenSets(List<CollisionGroup> aGroups, List<CollisionGroup> bGroups, CollisionRule rule)\n        {\n            foreach (CollisionGroup group in aGroups)\n            {\n                DefineCollisionRulesWithSet(group, bGroups, rule);\n            }\n        }\n\n        /// <summary>\n        /// Defines a CollisionRule between every group in a set with itself and the others in the set for a given space.\n        /// </summary>\n        /// <param name=\"groups\">Set of CollisionGroups.</param>\n        /// <param name=\"self\">CollisionRule between each group and itself.</param>\n        /// <param name=\"other\">CollisionRule between each group and every other group in the set.</param>\n        public static void DefineCollisionRulesInSet(List<CollisionGroup> groups, CollisionRule self, CollisionRule other)\n        {\n            for (int i = 0; i < groups.Count; i++)\n            {\n                DefineCollisionRule(groups[i], groups[i], self);\n            }\n            for (int i = 0; i < groups.Count - 1; i++)\n            {\n                for (int j = i + 1; j < groups.Count; j++)\n                {\n                    DefineCollisionRule(groups[i], groups[j], other);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Defines a CollisionRule between a group and every group in a set of groups for a given space.\n        /// </summary>\n        /// <param name=\"group\">First CollisionGroup of the pair.</param>\n        /// <param name=\"groups\">Set of CollisionGroups; each group will have its CollisionRule with the first group defined.</param>\n        /// <param name=\"rule\">CollisionRule to use between the pairs.</param>\n        public static void DefineCollisionRulesWithSet(CollisionGroup group, List<CollisionGroup> groups, CollisionRule rule)\n        {\n            foreach (CollisionGroup g in groups)\n            {\n                DefineCollisionRule(group, g, rule);\n            }\n        }\n\n        /// <summary>\n        /// Removes any rule between the two groups in the space.\n        /// </summary>\n        /// <param name=\"groupA\">First CollisionGroup of the pair.</param>\n        /// <param name=\"groupB\">SecondCollisionGroup of the pair.</param>\n        public static void RemoveCollisionRule(CollisionGroup groupA, CollisionGroup groupB)\n        {\n            Dictionary<CollisionGroupPair, CollisionRule> dictionary = CollisionRules.CollisionGroupRules;\n            var pair = new CollisionGroupPair(groupA, groupB);\n            if (dictionary.ContainsKey(pair))\n                dictionary.Remove(pair);\n        }\n\n        /// <summary>\n        /// Removes any rule between every group in the first set and every group in the second set for a given space.\n        /// </summary>\n        /// <param name=\"aGroups\">First set of groups.</param>\n        /// <param name=\"bGroups\">Second set of groups.</param>\n        public static void RemoveCollisionRulesBetweenSets(List<CollisionGroup> aGroups, List<CollisionGroup> bGroups)\n        {\n            foreach (CollisionGroup group in aGroups)\n            {\n                RemoveCollisionRulesWithSet(group, bGroups);\n            }\n        }\n\n        /// <summary>\n        /// Removes any rule between every group in a set with itself and the others in the set for a given space.\n        /// </summary>\n        /// <param name=\"groups\">Set of CollisionGroups.</param>\n        public static void RemoveCollisionRulesInSet(List<CollisionGroup> groups)\n        {\n            for (int i = 0; i < groups.Count; i++)\n            {\n                RemoveCollisionRule(groups[i], groups[i]);\n            }\n            for (int i = 0; i < groups.Count - 1; i++)\n            {\n                for (int j = i + 1; j < groups.Count; j++)\n                {\n                    RemoveCollisionRule(groups[i], groups[j]);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Removes any rule between a group and every group in a set of groups for a given space.\n        /// </summary>\n        /// <param name=\"group\">First CollisionGroup of the pair.</param>\n        /// <param name=\"groups\">Set of CollisionGroups; each group will have its CollisionRule with the first group removed.</param>\n        public static void RemoveCollisionRulesWithSet(CollisionGroup group, List<CollisionGroup> groups)\n        {\n            foreach (CollisionGroup g in groups)\n            {\n                RemoveCollisionRule(group, g);\n            }\n        }\n\n        /// <summary>\n        /// Gets a hash code for the object.\n        /// </summary>\n        /// <returns>Hash code for the object.</returns>\n        public override int GetHashCode()\n        {\n            return hashCode;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionRuleManagement/CollisionGroupPair.cs",
    "content": "﻿using System;\n\nnamespace BEPUphysics.CollisionRuleManagement\n{\n\n    /// <summary>\n    /// Storage strucure containing two CollisionGroup instances used as a key in a collision rules dictionary.\n    /// </summary>\n    public struct CollisionGroupPair : IEquatable<CollisionGroupPair>\n    {\n        /// <summary>\n        /// First collision group in the pair.\n        /// </summary>\n        public readonly CollisionGroup A;\n\n        /// <summary>\n        /// Second collision group in the pair.\n        /// </summary>\n        public readonly CollisionGroup B;\n\n        private readonly int hashCode;\n\n        /// <summary>\n        /// Constructs a new collision group pair.\n        /// </summary>\n        /// <param name=\"groupA\">First collision group in the pair.</param>\n        /// <param name=\"groupB\">Second collision group in the pair.</param>\n        public CollisionGroupPair(CollisionGroup groupA, CollisionGroup groupB)\n        {\n            if (groupA == null)\n                throw new ArgumentNullException(\"groupA\",\n                                                \"The first collision group in the pair is null.  If this pair was being created for CollisionRule calculation purposes, simply consider the rule to be CollisionRule.Defer.\");\n            if (groupB == null)\n                throw new ArgumentNullException(\"groupB\",\n                                                \"The second collision group in the pair is null.  If this pair was being created for CollisionRule calculation purposes, simply consider the rule to be CollisionRule.Defer.\");\n            A = groupA;\n            B = groupB;\n            const ulong prime = 0xd8163841;\n            //Note that the order of the pair is irrelevant- this is required\n            ulong hash = ((ulong)(groupA.GetHashCode()) + (ulong)(groupB.GetHashCode())) * prime;\n            hashCode = (int)(hash); // % (int.MaxValue - 1));\n        }\n\n        #region IEquatable<CollisionGroupPair> Members\n\n        bool IEquatable<CollisionGroupPair>.Equals(CollisionGroupPair other)\n        {\n            return (other.A == A && other.B == B) || (other.B == A && other.A == B);\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Determines whether or not the two objects are equal.\n        /// Use the IEquatable interface implementation if possible.\n        /// </summary>\n        /// <param name=\"obj\">Object to compare.</param>\n        /// <returns>Whether or not the two objects are equal.</returns>\n        public override bool Equals(object obj)\n        {\n            //This method requires boxing, so make sure any attempt to call it is caught.\n            var other = (CollisionGroupPair)obj;\n            return (other.A == A && other.B == B) || (other.B == A && other.A == B);\n        }\n\n        /// <summary>\n        /// Gets the hash code of the entity type pair.\n        /// </summary>\n        /// <returns>Hash code of the entity type pair.</returns>\n        public override int GetHashCode()\n        {\n            return hashCode;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionRuleManagement/CollisionRule.cs",
    "content": "﻿namespace BEPUphysics.CollisionRuleManagement\n{\n    /// <summary>\n    /// Defines a set of rules that collisions can adhere to.\n    /// </summary>\n    public enum CollisionRule\n    {\n        /// <summary>\n        /// Yields the interaction type's determination to a later stage.\n        /// </summary>\n        Defer,\n        /// <summary>\n        /// Uses all of collision detection, including creating a collision pair, creating contacts when appropriate, and responding to those contacts physically.\n        /// If a collision pair is forced to use a 'normal' interaction but both entities in the pair are kinematic, the collision response will be skipped.\n        /// </summary>\n        Normal,\n        /// <summary>\n        /// Creates a collision pair and undergoes narrow phase testing, but does not collision response in the solver.\n        /// </summary>\n        NoSolver,\n        /// <summary>\n        /// Creates a broad phase overlap and narrow phase pair but the collision is never updated.  It cannot generate contacts nor undergo solving.\n        /// </summary>\n        NoNarrowPhaseUpdate,\n        /// <summary>\n        /// Creates a broad phase overlap but does not create any narrow phase pairs.  It cannot generate contacts nor undergo solving.\n        /// </summary>\n        NoNarrowPhasePair,\n        /// <summary>\n        /// Does not create a broad phase overlap.  No further collision detection or response takes place.\n        /// </summary>\n        NoBroadPhase\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionRuleManagement/CollisionRules.cs",
    "content": "﻿﻿using System;\nusing System.Collections.Generic;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.CollisionRuleManagement\n{\n    /// <summary>\n    /// Stores how an object can interact with other objects through collisions.\n    /// </summary>\n    public class CollisionRules\n    {\n\n        ///<summary>\n        /// Fires when the contained collision rules are altered.\n        ///</summary>\n        public event Action CollisionRulesChanged;\n\n\n        ///<summary>\n        /// Constructs a new CollisionRules instance.\n        ///</summary>\n        public CollisionRules()\n        {\n            hashCode = (int)(base.GetHashCode() * 0x8da6b343);\n            OnChangedDelegate = OnChanged;\n        }\n\n        int hashCode;\n\n        /// <summary>\n        /// Serves as a hash function for a particular type. \n        /// </summary>\n        /// <returns>\n        /// A hash code for the current <see cref=\"T:System.Object\"/>.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            return hashCode;\n        }\n\n        private Action OnChangedDelegate;\n        protected void OnChanged()\n        {\n            if (CollisionRulesChanged != null)\n                CollisionRulesChanged();\n        }\n\n\n        internal CollisionGroup group;\n        /// <summary>\n        /// The collision group to which the object owning this instance belongs to.\n        /// This is overridden by any relationships defined in the Specific collection with CollisionRules other than CollisionRule.Defer.\n        /// This is also overriden by the Personal CollisionRule if it is anything but CollisionRule.Defer.\n        /// If the interaction type between the group is defined as CollisionRule.Defer, it is considered to be CollisionRule.normal as the collision group is the final stage.\n        /// </summary>\n        public CollisionGroup Group\n        {\n            get { return group; }\n            set\n            {\n                group = value;\n                OnChanged();\n            }\n        }\n\n\n        internal CollisionRule personal = CollisionRule.Defer;\n        /// <summary>\n        /// Determines in general how the object owning this instance should react to other objects.\n        /// This is overridden by any relationships defined in the Specific collection with CollisionRules other than CollisionRule.Defer.\n        /// If this is not set to CollisionRule.Defer, it will override the collision group's collision rules.\n        /// </summary>\n        public CollisionRule Personal\n        {\n            get { return personal; }\n            set\n            {\n                personal = value;\n                OnChanged();\n            }\n        }\n\n\n\n        internal ObservableDictionary<CollisionRules, CollisionRule> specific = new ObservableDictionary<CollisionRules, CollisionRule>();\n        /// <summary>\n        /// Specifies how the object owning this instance should react to other individual objects.\n        /// Any rules defined in this collection will take priority over the Personal collision rule and the collision group's collision rules.\n        /// Objects that are not in this collection are considered to have a relationship of CollisionRule.Defer.\n        /// </summary>\n        public ObservableDictionary<CollisionRules, CollisionRule> Specific\n        {\n            get { return specific; }\n            set\n            {\n                if (value != specific)\n                {\n                    if (specific != null)\n                        specific.Changed -= OnChangedDelegate;\n                    if (value != null)\n                        value.Changed += OnChangedDelegate;\n\n                    specific = value;\n                    OnChanged();\n                }\n            }\n        }\n\n        //Pure convenience method.\n        ///<summary>\n        /// Adds an entry in ownerA's Specific relationships list about ownerB.\n        ///</summary>\n        ///<param name=\"ownerA\">Owner of the collision rules that will gain an entry in its Specific relationships.</param>\n        ///<param name=\"ownerB\">Owner of the collision rules that will be added to ownerA's Specific relationships.</param>\n        ///<param name=\"rule\">Rule assigned to the pair.</param>\n        public static void AddRule(ICollisionRulesOwner ownerA, ICollisionRulesOwner ownerB, CollisionRule rule)\n        {\n            ownerA.CollisionRules.specific.Add(ownerB.CollisionRules, rule);\n        }\n        ///<summary>\n        /// Adds an entry in rulesA's Specific relationships list about ownerB.\n        ///</summary>\n        ///<param name=\"rulesA\">Collision rules that will gain an entry in its Specific relationships.</param>\n        ///<param name=\"ownerB\">Owner of the collision rules that will be added to ownerA's Specific relationships.</param>\n        ///<param name=\"rule\">Rule assigned to the pair.</param>\n        public static void AddRule(CollisionRules rulesA, ICollisionRulesOwner ownerB, CollisionRule rule)\n        {\n            rulesA.specific.Add(ownerB.CollisionRules, rule);\n        }\n\n        ///<summary>\n        /// Adds an entry in rulesA's Specific relationships list about ownerB.\n        ///</summary>\n        ///<param name=\"ownerA\">Owner of the collision rules that will gain an entry in its Specific relationships.</param>\n        ///<param name=\"rulesB\">Collision rules that will be added to ownerA's Specific relationships.</param>\n        ///<param name=\"rule\">Rule assigned to the pair.</param>\n        public static void AddRule(ICollisionRulesOwner ownerA, CollisionRules rulesB, CollisionRule rule)\n        {\n            ownerA.CollisionRules.specific.Add(rulesB, rule);\n        }\n\n        ///<summary>\n        /// Tries to remove a relationship about ownerB from ownerA's Specific list.\n        ///</summary>\n        ///<param name=\"ownerA\">Owner of the collision rules that will lose an entry in its Specific relationships.</param>\n        ///<param name=\"ownerB\">Owner of the collision rules that will be removed from ownerA's Specific relationships.</param>\n        public static void RemoveRule(ICollisionRulesOwner ownerA, ICollisionRulesOwner ownerB)\n        {\n            if (!ownerA.CollisionRules.specific.Remove(ownerB.CollisionRules))\n                ownerB.CollisionRules.specific.Remove(ownerA.CollisionRules);\n        }\n        ///<summary>\n        /// Tries to remove a relationship about ownerB from rulesA's Specific list.\n        ///</summary>\n        ///<param name=\"rulesA\">Collision rules that will lose an entry in its Specific relationships.</param>\n        ///<param name=\"ownerB\">Owner of the collision rules that will be removed from ownerA's Specific relationships.</param>\n        public static void RemoveRule(CollisionRules rulesA, ICollisionRulesOwner ownerB)\n        {\n            if (!rulesA.specific.Remove(ownerB.CollisionRules))\n                ownerB.CollisionRules.specific.Remove(rulesA);\n        }\n\n        ///<summary>\n        /// Tries to remove a relationship about rulesB from ownerA's Specific list.\n        ///</summary>\n        ///<param name=\"ownerA\">Owner of the collision rules that will lose an entry in its Specific relationships.</param>\n        ///<param name=\"rulesB\">Collision rules that will be removed from ownerA's Specific relationships.</param>\n        public static void RemoveRule(ICollisionRulesOwner ownerA, CollisionRules rulesB)\n        {\n            if (!ownerA.CollisionRules.specific.Remove(rulesB))\n                rulesB.specific.Remove(ownerA.CollisionRules);\n        }\n\n        static CollisionRules()\n        {\n            CollisionGroupRules.Add(new CollisionGroupPair(DefaultKinematicCollisionGroup, DefaultKinematicCollisionGroup), CollisionRule.NoBroadPhase);\n        }\n\n        internal static Func<ICollisionRulesOwner, ICollisionRulesOwner, CollisionRule> collisionRuleCalculator = GetCollisionRuleDefault;\n        ///<summary>\n        /// Gets or sets the delegate used to calculate collision rules.\n        /// Defaults to CollisionRules.GetCollisionRuleDefault.\n        ///</summary>\n        public static Func<ICollisionRulesOwner, ICollisionRulesOwner, CollisionRule> CollisionRuleCalculator\n        {\n            get\n            {\n                return collisionRuleCalculator;\n            }\n            set\n            {\n                collisionRuleCalculator = value;\n            }\n        }\n\n        /// <summary>\n        /// Uses the CollisionRuleCalculator to get the collision rule between two collision rules owners.\n        /// </summary>\n        /// <param name=\"ownerA\">First owner of the pair.</param>\n        /// <param name=\"ownerB\">Second owner of the pair.</param>\n        /// <returns>CollisionRule between the pair, according to the CollisionRuleCalculator.</returns>\n        public static CollisionRule GetCollisionRule(ICollisionRulesOwner ownerA, ICollisionRulesOwner ownerB)\n        {\n            return collisionRuleCalculator(ownerA, ownerB);\n        }\n\n\n        /// <summary>\n        /// Defines any special collision rules between collision groups.\n        /// </summary>\n        public static Dictionary<CollisionGroupPair, CollisionRule> CollisionGroupRules = new Dictionary<CollisionGroupPair, CollisionRule>();\n\n        /// <summary>\n        /// If a CollisionRule calculation between two colliding objects results in no defined CollisionRule, this value will be used.\n        /// </summary>\n        public static CollisionRule DefaultCollisionRule = CollisionRule.Normal;\n\n        /// <summary>\n        /// When a dynamic entity is created and added to a space without having a specific collision group set beforehand, it inherits this collision group.\n        /// There are no special rules associated with this group by default; entities within this group have normal, full interaction with all other entities.\n        /// Collision group interaction rules can be overriden by entity personal collision rules or entity-to-entity specific collision rules.\n        /// </summary>\n        public static CollisionGroup DefaultDynamicCollisionGroup = new CollisionGroup();\n\n        /// <summary>\n        /// When a kinematic entity is created and added to a space without having a specific collision group set beforehand, it inherits this collision group.\n        /// Entities in this collision group will not create collision pairs with other entities of this collision group by default.  All other interactions are normal.\n        /// Collision group interaction rules can be overriden by entity personal collision rules or entity-to-entity specific collision rules.\n        /// \n        /// Non-entity collidable objects like static triangle meshes also use this collision group by default.\n        /// </summary>\n        public static CollisionGroup DefaultKinematicCollisionGroup = new CollisionGroup();\n\n        /// <summary>\n        /// Determines what collision rule governs the interaction between the two objects.\n        /// </summary>\n        /// <param name=\"aOwner\">First ruleset owner in the pair.  This entity's space is used to determine the collision detection settings that contain special collision group interaction rules.</param>\n        /// <param name=\"bOwner\">Second ruleset owner in the pair.</param>\n        /// <returns>Collision rule governing the interaction between the pair.</returns>\n        public static CollisionRule GetCollisionRuleDefault(ICollisionRulesOwner aOwner, ICollisionRulesOwner bOwner)\n        {\n            var a = aOwner.CollisionRules;\n            var b = bOwner.CollisionRules;\n            CollisionRule pairRule = GetSpecificCollisionRuleDefault(a, b);\n            if (pairRule == CollisionRule.Defer)\n            {\n                pairRule = GetPersonalCollisionRuleDefault(a, b);\n                if (pairRule == CollisionRule.Defer)\n                    pairRule = GetGroupCollisionRuleDefault(a, b);\n            }\n\n            if (pairRule == CollisionRule.Defer)\n                pairRule = DefaultCollisionRule;\n            return pairRule;\n        }\n\n\n        ///<summary>\n        /// Default implementation used to calculate collision rules due to the rulesets' specific relationships.\n        ///</summary>\n        ///<param name=\"a\">First ruleset in the pair.</param>\n        ///<param name=\"b\">Second ruleset in the pair.</param>\n        ///<returns>Collision rule governing the interaction between the pair.</returns>\n        public static CollisionRule GetSpecificCollisionRuleDefault(CollisionRules a, CollisionRules b)\n        {\n            CollisionRule aToB;\n            a.specific.WrappedDictionary.TryGetValue(b, out aToB);\n            CollisionRule bToA;\n            b.specific.WrappedDictionary.TryGetValue(a, out bToA);\n            return aToB > bToA ? aToB : bToA;\n\n        }\n\n        ///<summary>\n        /// Default implementation used to calculate collision rules due to the rulesets' collision groups.\n        ///</summary>\n        ///<param name=\"a\">First ruleset in the pair.</param>\n        ///<param name=\"b\">Second ruleset in the pair.</param>\n        ///<returns>Collision rule governing the interaction between the pair.</returns>\n        public static CollisionRule GetGroupCollisionRuleDefault(CollisionRules a, CollisionRules b)\n        {\n            if (a.group == null || b.group == null)\n                return CollisionRule.Defer; //This can happen occasionally when objects aren't in a space or are being handled uniquely (like in compound bodies).\n            CollisionRule pairRule;\n            CollisionGroupRules.TryGetValue(new CollisionGroupPair(a.group, b.group), out pairRule);\n            return pairRule;\n        }\n        ///<summary>\n        /// Default implementation used to calculate collision rules due to the rulesets' personal rules.\n        ///</summary>\n        ///<param name=\"a\">First ruleset in the pair.</param>\n        ///<param name=\"b\">Second ruleset in the pair.</param>\n        ///<returns>Collision rule governing the interaction between the pair.</returns>\n        public static CollisionRule GetPersonalCollisionRuleDefault(CollisionRules a, CollisionRules b)\n        {\n            return a.personal > b.personal ? a.personal : b.personal;\n        }\n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/CollisionRuleManagement/ICollisionRulesOwner.cs",
    "content": "﻿﻿namespace BEPUphysics.CollisionRuleManagement\n {\n     ///<summary>\n     /// Defines a class which must own CollisionRules.\n     ///</summary>\n     public interface ICollisionRulesOwner\n     {\n         ///<summary>\n         /// Collision rules owned by the object.\n         ///</summary>\n         CollisionRules CollisionRules { get; set; }\n     }\n }"
  },
  {
    "path": "BEPUphysics/CollisionShapes/CollisionShape.cs",
    "content": "﻿using System;\n\nnamespace BEPUphysics.CollisionShapes\n{\n    ///<summary>\n    /// Superclass of all collision shapes.\n    /// Collision shapes are composed entirely of local space information.\n    /// Collidables provide the world space information needed to use the shapes to do collision detection.\n    ///</summary>\n    public abstract class CollisionShape\n    {\n        ///<summary>\n        /// Fires when some of the local space information in the shape changes.\n        ///</summary>\n        public event Action<CollisionShape> ShapeChanged;\n\n        protected virtual void OnShapeChanged()\n        {\n            if (ShapeChanged != null)\n                ShapeChanged(this);\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/CompoundShape.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionShapes\n{\n    ///<summary>\n    /// Contains a shape and its local transform relative to its owning compound shape.\n    /// This is used to construct compound shapes.\n    ///</summary>\n    public struct CompoundShapeEntry\n    {\n        ///<summary>\n        /// Local transform of the shape relative to its owning compound shape.\n        ///</summary>\n        public RigidTransform LocalTransform;\n        /// <summary>\n        /// Shape used by the compound.\n        /// </summary>\n        public EntityShape Shape;\n        /// <summary>\n        /// Weight of the entry.  This defines how much the entry contributes to its owner\n        /// for the purposes of center of rotation computation.\n        /// </summary>\n        public float Weight;\n\n        ///<summary>\n        /// Constructs a new compound shape entry using the volume of the shape as a weight.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use.</param>\n        ///<param name=\"localTransform\">Local transform of the shape.</param>\n        ///<param name=\"weight\">Weight of the entry.  This defines how much the entry contributes to its owner\n        /// for the purposes of center of rotation computation.</param>\n        public CompoundShapeEntry(EntityShape shape, RigidTransform localTransform, float weight)\n        {\n            localTransform.Validate();\n            LocalTransform = localTransform;\n            Shape = shape;\n            Weight = weight;\n        }\n\n        ///<summary>\n        /// Constructs a new compound shape entry using the volume of the shape as a weight.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use.</param>\n        ///<param name=\"position\">Local position of the shape.</param>\n        ///<param name=\"weight\">Weight of the entry.  This defines how much the entry contributes to its owner\n        /// for the purposes of center of mass and inertia computation.</param>\n        public CompoundShapeEntry(EntityShape shape, Vector3 position, float weight)\n        {\n            position.Validate();\n            LocalTransform = new RigidTransform(position);\n            Shape = shape;\n            Weight = weight;\n        }\n\n        ///<summary>\n        /// Constructs a new compound shape entry using the volume of the shape as a weight.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use.</param>\n        ///<param name=\"orientation\">Local orientation of the shape.</param>\n        ///<param name=\"weight\">Weight of the entry.  This defines how much the entry contributes to its owner\n        /// for the purposes of center of rotation computation.</param>\n        public CompoundShapeEntry(EntityShape shape, Quaternion orientation, float weight)\n        {\n            orientation.Validate();\n            LocalTransform = new RigidTransform(orientation);\n            Shape = shape;\n            Weight = weight;\n        }\n        ///<summary>\n        /// Constructs a new compound shape entry using the volume of the shape as a weight.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use.</param>\n        ///<param name=\"weight\">Weight of the entry.  This defines how much the entry contributes to its owner\n        /// for the purposes of center of rotation computation.</param>\n        public CompoundShapeEntry(EntityShape shape, float weight)\n        {\n            LocalTransform = RigidTransform.Identity;\n            Shape = shape;\n            Weight = weight;\n        }\n\n        ///<summary>\n        /// Constructs a new compound shape entry using the volume of the shape as a weight.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use.</param>\n        ///<param name=\"localTransform\">Local transform of the shape.</param>\n        public CompoundShapeEntry(EntityShape shape, RigidTransform localTransform)\n        {\n            localTransform.Validate();\n            LocalTransform = localTransform;\n            Shape = shape;\n            Weight = shape.ComputeVolume();\n        }\n\n        ///<summary>\n        /// Constructs a new compound shape entry using the volume of the shape as a weight.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use.</param>\n        ///<param name=\"position\">Local position of the shape.</param>\n        public CompoundShapeEntry(EntityShape shape, Vector3 position)\n        {\n            position.Validate();\n            LocalTransform = new RigidTransform(position);\n            Shape = shape;\n            Weight = shape.ComputeVolume();\n        }\n\n        ///<summary>\n        /// Constructs a new compound shape entry using the volume of the shape as a weight.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use.</param>\n        ///<param name=\"orientation\">Local orientation of the shape.</param>\n        public CompoundShapeEntry(EntityShape shape, Quaternion orientation)\n        {\n            orientation.Validate();\n            LocalTransform = new RigidTransform(orientation);\n            Shape = shape;\n            Weight = shape.ComputeVolume();\n        }\n        ///<summary>\n        /// Constructs a new compound shape entry using the volume of the shape as a weight.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use.</param>\n        public CompoundShapeEntry(EntityShape shape)\n        {\n            LocalTransform = RigidTransform.Identity;\n            Shape = shape;\n            Weight = shape.ComputeVolume();\n        }\n    }\n\n\n\n\n    ///<summary>\n    /// Shape composed of multiple other shapes.\n    ///</summary>\n    public class CompoundShape : EntityShape\n    {\n        internal RawList<CompoundShapeEntry> shapes;\n        ///<summary>\n        /// Gets the list of shapes in the compound shape.\n        ///</summary>\n        public ReadOnlyList<CompoundShapeEntry> Shapes\n        {\n            get\n            {\n                return new ReadOnlyList<CompoundShapeEntry>(shapes);\n            }\n        }\n\n\n\n        ///<summary>\n        /// Constructs a compound shape.\n        ///</summary>\n        ///<param name=\"shapes\">Shape entries used to create the compound.</param>\n        /// <param name=\"center\">Computed center of the compound shape, using the entry weights.</param>\n        public CompoundShape(IList<CompoundShapeEntry> shapes, out Vector3 center)\n        {\n            if (shapes.Count > 0)\n            {\n                center = ComputeCenter(shapes);\n                this.shapes = new RawList<CompoundShapeEntry>(shapes);\n                for (int i = 0; i < this.shapes.Count; i++)\n                {\n                    this.shapes.Elements[i].LocalTransform.Position -= center;\n                }\n            }\n            else\n            {\n                throw new ArgumentException(\"Compound shape must have at least 1 subshape.\");\n            }\n        }\n\n        ///<summary>\n        /// Constructs a compound shape.\n        ///</summary>\n        ///<param name=\"shapes\">Shape entries used to create the compound.</param>\n        public CompoundShape(IList<CompoundShapeEntry> shapes)\n        {\n            if (shapes.Count > 0)\n            {\n                Vector3 center = ComputeCenter(shapes);\n                this.shapes = new RawList<CompoundShapeEntry>(shapes);\n                for (int i = 0; i < this.shapes.Count; i++)\n                {\n                    this.shapes.Elements[i].LocalTransform.Position -= center;\n                }\n            }\n            else\n            {\n                throw new ArgumentException(\"Compound shape must have at least 1 subshape.\");\n            }\n        }\n\n        #region EntityShape members and support\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass, based on the weightings of entries in the shape.\n        /// For properly calibrated compound shapes, this will return a zero vector,\n        /// since the shape recenters itself on construction.\n        /// </summary>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter()\n        {\n            float totalWeight = 0;\n            var center = new Vector3();\n            for (int i = 0; i < shapes.Count; i++)\n            {\n                totalWeight += shapes.Elements[i].Weight;\n                Vector3 centerContribution;\n                Vector3.Multiply(ref shapes.Elements[i].LocalTransform.Position, shapes.Elements[i].Weight, out centerContribution);\n                Vector3.Add(ref center, ref centerContribution, out center);\n\n            }\n            if (totalWeight <= 0)\n                throw new NotFiniteNumberException(\"Cannot compute center; the total weight of a compound shape must be positive.\");\n            Vector3.Divide(ref center, totalWeight, out center);\n            center.Validate();\n            return center;\n        }\n\n\n        ///<summary>\n        /// Computes the center of a compound using its child data.\n        ///</summary>\n        ///<param name=\"childData\">Child data to use to compute the center.</param>\n        ///<returns>Center of the children.</returns>\n        public static Vector3 ComputeCenter(IList<CompoundChildData> childData)\n        {\n            var center = new Vector3();\n            float totalWeight = 0;\n            for (int i = 0; i < childData.Count; i++)\n            {\n                float weight = childData[i].Entry.Weight;\n                totalWeight += weight;\n                center += childData[i].Entry.LocalTransform.Position * weight;\n            }\n            if (totalWeight <= 0)\n                throw new NotFiniteNumberException(\"Cannot compute center; the total weight of a compound shape must be positive.\");\n            Vector3.Divide(ref center, totalWeight, out center);\n            center.Validate();\n            return center;\n\n        }\n\n        ///<summary>\n        /// Computes the center of a compound using its child data.\n        /// Children are weighted using their volumes for contribution to the center of 'mass.'\n        ///</summary>\n        ///<param name=\"childData\">Child data to use to compute the center.</param>\n        ///<returns>Center of the children.</returns>\n        public static Vector3 ComputeCenter(IList<CompoundShapeEntry> childData)\n        {\n            var center = new Vector3();\n            float totalWeight = 0;\n            for (int i = 0; i < childData.Count; i++)\n            {\n                float weight = childData[i].Weight;\n                totalWeight += weight;\n                center += childData[i].LocalTransform.Position * weight;\n            }\n            if (totalWeight <= 0)\n                throw new NotFiniteNumberException(\"Cannot compute center; the total weight of a compound shape must be positive.\");\n            Vector3.Divide(ref center, totalWeight, out center);\n            center.Validate();\n            return center;\n\n        }\n\n        /// <summary>\n        /// Computes the volume of the shape.\n        /// This is approximate; it will double count the intersection of multiple subshapes.\n        /// </summary>\n        /// <returns>Volume of the shape.</returns>\n        public override float ComputeVolume()\n        {\n            float volume = 0;\n            for (int i = 0; i < shapes.Count; i++)\n            {\n                volume += shapes.Elements[i].Shape.ComputeVolume();\n            }\n            return volume;\n        }\n\n        /// <summary>\n        /// Computes the volume distribution of the shape as well as its volume.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Volume distribution of the shape.</returns>\n        public override Matrix3x3 ComputeVolumeDistribution(out float volume)\n        {\n            volume = ComputeVolume();\n            return ComputeVolumeDistribution();\n        }\n\n        /// <summary>\n        /// Computes the volume distribution of the shape.\n        /// </summary>\n        /// <returns>Volume distribution of the shape.</returns>\n        public override Matrix3x3 ComputeVolumeDistribution()\n        {\n            var volumeDistribution = new Matrix3x3();\n            float totalWeight = 0;\n            for (int i = 0; i < shapes.Count; i++)\n            {\n                totalWeight += shapes.Elements[i].Weight;\n                Matrix3x3 contribution;\n                GetContribution(shapes.Elements[i].Shape, ref shapes.Elements[i].LocalTransform, ref Toolbox.ZeroVector, shapes.Elements[i].Weight, out contribution);\n                Matrix3x3.Add(ref contribution, ref volumeDistribution, out volumeDistribution);\n\n            } \n            if (totalWeight <= 0)\n                throw new NotFiniteNumberException(\"Cannot compute distribution; the total weight of a compound shape must be positive.\");\n            Matrix3x3.Multiply(ref volumeDistribution, 1 / totalWeight, out volumeDistribution);\n            volumeDistribution.Validate();\n            return volumeDistribution;\n        }\n\n        /// <summary>\n        /// Computes the volume distribution and center of the shape.\n        /// </summary>\n        /// <param name=\"entries\">Mass-weighted entries of the compound.</param>\n        /// <param name=\"center\">Center of the compound.</param>\n        /// <returns>Volume distribution of the shape.</returns>\n        public static Matrix3x3 ComputeVolumeDistribution(IList<CompoundShapeEntry> entries, out Vector3 center)\n        {\n            center = new Vector3();\n            float totalWeight = 0;\n            for (int i = 0; i < entries.Count; i++)\n            {\n                center += entries[i].LocalTransform.Position * entries[i].Weight;\n                totalWeight += entries[i].Weight;\n            }\n            if (totalWeight <= 0)\n                throw new NotFiniteNumberException(\"Cannot compute distribution; the total weight of a compound shape must be positive.\");\n            float totalWeightInverse = 1 / totalWeight;\n            totalWeightInverse.Validate();\n            center *= totalWeightInverse;\n\n            var volumeDistribution = new Matrix3x3();\n            for (int i = 0; i < entries.Count; i++)\n            {\n                RigidTransform transform = entries[i].LocalTransform;\n                Matrix3x3 contribution;\n                GetContribution(entries[i].Shape, ref transform, ref center, entries[i].Weight, out contribution);\n                Matrix3x3.Add(ref volumeDistribution, ref contribution, out volumeDistribution);\n            }\n            Matrix3x3.Multiply(ref volumeDistribution, totalWeightInverse, out volumeDistribution);\n            volumeDistribution.Validate();\n            return volumeDistribution;\n        }\n\n        ///<summary>\n        /// Gets the volume distribution contributed by a single shape.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use to compute a contribution.</param>\n        ///<param name=\"transform\">Transform of the shape.</param>\n        ///<param name=\"center\">Center to use when computing the distribution.</param>\n        ///<param name=\"weight\">Weighting to apply to the contribution.</param>\n        ///<param name=\"contribution\">Volume distribution of the contribution.</param>\n        public static void GetContribution(EntityShape shape, ref RigidTransform transform, ref Vector3 center, float weight, out Matrix3x3 contribution)\n        {\n            contribution = shape.ComputeVolumeDistribution();\n            TransformContribution(ref transform, ref center, ref contribution, weight, out contribution);\n            //return TransformContribution(ref transform, ref center, ref contribution, weight);\n        }\n\n\n\n        /// <summary>\n        /// Modifies a contribution using a transform, position, and weight.\n        /// </summary>\n        /// <param name=\"transform\">Transform to use to modify the contribution.</param>\n        /// <param name=\"center\">Center to use to modify the contribution.</param>\n        /// <param name=\"baseContribution\">Original unmodified contribution.</param>\n        /// <param name=\"weight\">Weight of the contribution.</param>\n        /// <param name=\"contribution\">Transformed contribution.</param>\n        public static void TransformContribution(ref RigidTransform transform, ref Vector3 center, ref Matrix3x3 baseContribution, float weight, out Matrix3x3 contribution)\n        {\n            Matrix3x3 rotation;\n            Matrix3x3.CreateFromQuaternion(ref transform.Orientation, out rotation);\n            Matrix3x3 temp;\n\n            //TODO: Verify contribution\n\n            //Do angular transformed contribution first...\n            Matrix3x3.MultiplyTransposed(ref rotation, ref baseContribution, out temp);\n            Matrix3x3.Multiply(ref temp, ref rotation, out temp);\n\n            contribution = temp;\n\n            //Now add in the offset from the origin.\n            Vector3 offset;\n            Vector3.Subtract(ref transform.Position, ref center, out offset);\n            Matrix3x3 innerProduct;\n            Matrix3x3.CreateScale(offset.LengthSquared(), out innerProduct);\n            Matrix3x3 outerProduct;\n            Matrix3x3.CreateOuterProduct(ref offset, ref offset, out outerProduct);\n\n            Matrix3x3.Subtract(ref innerProduct, ref outerProduct, out temp);\n\n            Matrix3x3.Add(ref contribution, ref temp, out contribution);\n            Matrix3x3.Multiply(ref contribution, weight, out contribution);\n\n        }\n\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new CompoundCollidable(this);\n        }\n\n\n        /// <summary>\n        /// Computes the center of the shape and its volume.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the compound.</param>\n        /// <returns>Volume of the compound.</returns>\n        public override Vector3 ComputeCenter(out float volume)\n        {\n            volume = ComputeVolume();\n            return ComputeCenter();\n        }\n\n        /// <summary>\n        /// Computes a variety of shape information all at once.\n        /// </summary>\n        /// <param name=\"shapeInfo\">Properties of the shape.</param>\n        public override void ComputeDistributionInformation(out ShapeDistributionInformation shapeInfo)\n        {\n            shapeInfo.VolumeDistribution = ComputeVolumeDistribution(out shapeInfo.Volume);\n            shapeInfo.Center = ComputeCenter();\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Computes and returns the volume, volume distribution, and center contributions from each child shape in the compound shape.\n        /// </summary>\n        /// <returns>Volume, volume distribution, and center contributions from each child shape in the compound shape.</returns>\n        public ShapeDistributionInformation[] ComputeChildContributions()\n        {\n            var toReturn = new ShapeDistributionInformation[shapes.Count];\n            for (int i = 0; i < shapes.Count; i++)\n            {\n                shapes.Elements[i].Shape.ComputeDistributionInformation(out toReturn[i]);\n            }\n            return toReturn;\n        }\n\n        /// <summary>\n        /// Computes a bounding box for the shape given the specified transform.\n        /// </summary>\n        /// <param name=\"transform\">Transform to apply to the shape to compute the bounding box.</param>\n        /// <param name=\"boundingBox\">Bounding box for the shape given the transform.</param>\n        public override void GetBoundingBox(ref RigidTransform transform, out BoundingBox boundingBox)\n        {\n            RigidTransform combinedTransform;\n            RigidTransform.Transform(ref shapes.Elements[0].LocalTransform, ref transform, out combinedTransform);\n            shapes.Elements[0].Shape.GetBoundingBox(ref combinedTransform, out boundingBox);\n\n            for (int i = 0; i < shapes.Count; i++)\n            {\n                RigidTransform.Transform(ref shapes.Elements[i].LocalTransform, ref transform, out combinedTransform);\n                BoundingBox childBoundingBox;\n                shapes.Elements[i].Shape.GetBoundingBox(ref combinedTransform, out childBoundingBox);\n                BoundingBox.CreateMerged(ref boundingBox, ref childBoundingBox, out boundingBox);\n            }\n        }\n    }\n\n\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/BoxShape.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n    ///<summary>\n    /// Convex shape with width, length, and height.\n    ///</summary>\n    public class BoxShape : ConvexShape\n    {\n        internal float halfWidth;\n        internal float halfHeight;\n        internal float halfLength;\n\n\n        ///<summary>\n        /// Constructs a new box shape.\n        ///</summary>\n        ///<param name=\"width\">Width of the box.</param>\n        ///<param name=\"height\">Height of the box.</param>\n        ///<param name=\"length\">Length of the box.</param>\n        public BoxShape(float width, float height, float length)\n        {\n            halfWidth = width * .5f;\n            halfHeight = height * .5f;\n            halfLength = length * .5f;\n            OnShapeChanged();\n        }\n\n        /// <summary>\n        /// Width of the box divided by two.\n        /// </summary>\n        public float HalfWidth\n        {\n            get { return halfWidth; }\n            set { halfWidth = value; OnShapeChanged(); }\n        }\n\n        /// <summary>\n        /// Height of the box divided by two.\n        /// </summary>\n        public float HalfHeight\n        {\n            get { return halfHeight; }\n            set { halfHeight = value; OnShapeChanged(); }\n        }\n\n        /// <summary>\n        /// Length of the box divided by two.\n        /// </summary>\n        public float HalfLength\n        {\n            get { return halfLength; }\n            set { halfLength = value; OnShapeChanged(); }\n        }\n\n        /// <summary>\n        /// Width of the box.\n        /// </summary>\n        public float Width\n        {\n            get { return halfWidth * 2; }\n            set { halfWidth = value / 2; OnShapeChanged(); }\n        }\n\n        /// <summary>\n        /// Height of the box.\n        /// </summary>\n        public float Height\n        {\n            get { return halfHeight * 2; }\n            set { halfHeight = value / 2; OnShapeChanged(); }\n        }\n\n        /// <summary>\n        /// Length of the box.\n        /// </summary>\n        public float Length\n        {\n            get { return halfLength * 2; }\n            set { halfLength = value / 2; OnShapeChanged(); }\n        }\n\n\n        /// <summary>\n        /// Gets the bounding box of the shape given a transform.\n        /// </summary>\n        /// <param name=\"shapeTransform\">Transform to use.</param>\n        /// <param name=\"boundingBox\">Bounding box of the transformed shape.</param>\n        public override void GetBoundingBox(ref RigidTransform shapeTransform, out BoundingBox boundingBox)\n        {\n#if !WINDOWS\n            boundingBox = new BoundingBox();\n#endif\n\n            Matrix3x3 o;\n            Matrix3x3.CreateFromQuaternion(ref shapeTransform.Orientation, out o);\n            //Sample the local directions from the orientation matrix, implicitly transposed.\n            //Notice only three directions are used.  Due to box symmetry, 'left' is just -right.\n            var right = new Vector3(Math.Sign(o.M11) * halfWidth, Math.Sign(o.M21) * halfHeight, Math.Sign(o.M31) * halfLength);\n\n            var up = new Vector3(Math.Sign(o.M12) * halfWidth, Math.Sign(o.M22) * halfHeight, Math.Sign(o.M32) * halfLength);\n\n            var backward = new Vector3(Math.Sign(o.M13) * halfWidth, Math.Sign(o.M23) * halfHeight, Math.Sign(o.M33) * halfLength);\n\n            Matrix3x3.Transform(ref right, ref o, out right);\n            Matrix3x3.Transform(ref up, ref o, out up);\n            Matrix3x3.Transform(ref backward, ref o, out backward);\n            //These right/up/backward represent the extreme points in world space along the world space axes.\n\n            boundingBox.Max.X = shapeTransform.Position.X + right.X;\n            boundingBox.Max.Y = shapeTransform.Position.Y + up.Y;\n            boundingBox.Max.Z = shapeTransform.Position.Z + backward.Z;\n\n            boundingBox.Min.X = shapeTransform.Position.X - right.X;\n            boundingBox.Min.Y = shapeTransform.Position.Y - up.Y;\n            boundingBox.Min.Z = shapeTransform.Position.Z - backward.Z;\n\n        }\n\n\n        ///<summary>\n        /// Gets the extreme point of the shape in local space in a given direction.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)\n        {\n            extremePoint = new Vector3(Math.Sign(direction.X) * (halfWidth - collisionMargin), Math.Sign(direction.Y) * (halfHeight - collisionMargin), Math.Sign(direction.Z) * (halfLength - collisionMargin));\n        }\n\n        ///<summary>\n        /// Computes the minimum radius of the shape.\n        /// This is often smaller than the actual minimum radius;\n        /// it is simply an approximation that avoids overestimating.\n        ///</summary>\n        ///<returns>Minimum radius of the shape.</returns>\n        public override float ComputeMinimumRadius()\n        {\n            return Math.Min(halfWidth, Math.Min(halfHeight, halfLength));\n        }\n\n        /// <summary>\n        /// Computes the maximum radius of the shape.\n        /// This is often larger than the actual maximum radius;\n        /// it is simply an approximation that avoids underestimating.\n        /// </summary>\n        /// <returns>Maximum radius of the shape.</returns>\n        public override float ComputeMaximumRadius()\n        {\n            return (float)Math.Sqrt(halfWidth * halfWidth + halfHeight * halfHeight + halfLength * halfLength);\n        }\n\n        /// <summary>\n        /// Computes the volume distribution of the shape as well as its volume.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Volume distribution of the shape.</returns>\n        public override Matrix3x3 ComputeVolumeDistribution(out float volume)\n        {\n            var volumeDistribution = new Matrix3x3();\n            float halfWidthSquared = halfWidth * halfWidth;\n            float halfHeightSquared = halfHeight * halfHeight;\n            float halfLengthSquared = halfLength * halfLength;\n            const float inv3 = 1 / 3f;\n\n            volumeDistribution.M11 = (halfHeightSquared + halfLengthSquared) * inv3;\n            volumeDistribution.M22 = (halfWidthSquared + halfLengthSquared) * inv3;\n            volumeDistribution.M33 = (halfWidthSquared + halfHeightSquared) * inv3;\n            volume = ComputeVolume();\n            return volumeDistribution;\n        }\n\n\n\n\n        /// <summary>\n        /// Gets the intersection between the box and the ray.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test against the box.</param>\n        /// <param name=\"transform\">Transform of the shape.</param>\n        /// <param name=\"maximumLength\">Maximum distance to travel in units of the direction vector's length.</param>\n        /// <param name=\"hit\">Hit data for the raycast, if any.</param>\n        /// <returns>Whether or not the ray hit the target.</returns>\n        public override bool RayTest(ref Ray ray, ref RigidTransform transform, float maximumLength, out RayHit hit)\n        {\n            hit = new RayHit();\n\n            Quaternion conjugate;\n            Quaternion.Conjugate(ref transform.Orientation, out conjugate);\n            Vector3 localOrigin;\n            Vector3.Subtract(ref ray.Position, ref transform.Position, out localOrigin);\n            Vector3.Transform(ref localOrigin, ref conjugate, out localOrigin);\n            Vector3 localDirection;\n            Vector3.Transform(ref ray.Direction, ref conjugate, out localDirection);\n            Vector3 normal = Toolbox.ZeroVector;\n            float temp, tmin = 0, tmax = maximumLength;\n\n            if (Math.Abs(localDirection.X) < Toolbox.Epsilon && (localOrigin.X < -halfWidth || localOrigin.X > halfWidth))\n                return false;\n            float inverseDirection = 1 / localDirection.X;\n            float t1 = (-halfWidth - localOrigin.X) * inverseDirection;\n            float t2 = (halfWidth - localOrigin.X) * inverseDirection;\n            var tempNormal = new Vector3(-1, 0, 0);\n            if (t1 > t2)\n            {\n                temp = t1;\n                t1 = t2;\n                t2 = temp;\n                tempNormal *= -1;\n            }\n            temp = tmin;\n            tmin = Math.Max(tmin, t1);\n            if (temp != tmin)\n                normal = tempNormal;\n            tmax = Math.Min(tmax, t2);\n            if (tmin > tmax)\n                return false;\n            if (Math.Abs(localDirection.Y) < Toolbox.Epsilon && (localOrigin.Y < -halfHeight || localOrigin.Y > halfHeight))\n                return false;\n            inverseDirection = 1 / localDirection.Y;\n            t1 = (-halfHeight - localOrigin.Y) * inverseDirection;\n            t2 = (halfHeight - localOrigin.Y) * inverseDirection;\n            tempNormal = new Vector3(0, -1, 0);\n            if (t1 > t2)\n            {\n                temp = t1;\n                t1 = t2;\n                t2 = temp;\n                tempNormal *= -1;\n            }\n            temp = tmin;\n            tmin = Math.Max(tmin, t1);\n            if (temp != tmin)\n                normal = tempNormal;\n            tmax = Math.Min(tmax, t2);\n            if (tmin > tmax)\n                return false;\n            if (Math.Abs(localDirection.Z) < Toolbox.Epsilon && (localOrigin.Z < -halfLength || localOrigin.Z > halfLength))\n                return false;\n            inverseDirection = 1 / localDirection.Z;\n            t1 = (-halfLength - localOrigin.Z) * inverseDirection;\n            t2 = (halfLength - localOrigin.Z) * inverseDirection;\n            tempNormal = new Vector3(0, 0, -1);\n            if (t1 > t2)\n            {\n                temp = t1;\n                t1 = t2;\n                t2 = temp;\n                tempNormal *= -1;\n            }\n            temp = tmin;\n            tmin = Math.Max(tmin, t1);\n            if (temp != tmin)\n                normal = tempNormal;\n            tmax = Math.Min(tmax, t2);\n            if (tmin > tmax)\n                return false;\n            hit.T = tmin;\n            Vector3.Multiply(ref ray.Direction, tmin, out hit.Location);\n            Vector3.Add(ref hit.Location, ref ray.Position, out hit.Location);\n            Vector3.Transform(ref normal, ref transform.Orientation, out normal);\n            hit.Normal = normal;\n            return true;\n        }\n\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.\n        /// </summary>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter()\n        {\n            return Vector3.Zero;\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.  This calculation is often associated with the \n        /// volume calculation, which is given by this method as well.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter(out float volume)\n        {\n            volume = ComputeVolume();\n            return ComputeCenter();\n        }\n\n        /// <summary>\n        /// Computes the volume of the shape.\n        /// </summary>\n        /// <returns>Volume of the shape.</returns>\n        public override float ComputeVolume()\n        {\n            return 8 * halfWidth * halfLength * halfHeight;\n        }\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new ConvexCollidable<BoxShape>(this);\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/CapsuleShape.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n    ///<summary>\n    /// Sphere-expanded line segment.  Another way of looking at it is a cylinder with half-spheres on each end.\n    ///</summary>\n    public class CapsuleShape : ConvexShape\n    {\n        ///<summary>\n        /// Constructs a new capsule shape.\n        ///</summary>\n        ///<param name=\"length\">Length of the capsule's inner line segment.</param>\n        ///<param name=\"radius\">Radius to expand the line segment width.</param>\n        public CapsuleShape(float length, float radius)\n        {\n            halfLength = length * .5f;\n            Radius = radius;\n        }\n\n        float halfLength;\n        ///<summary>\n        /// Gets or sets the length of the capsule's inner line segment.\n        ///</summary>\n        public float Length\n        {\n            get\n            {\n                return halfLength * 2;\n            }\n            set\n            {\n                halfLength = value / 2;\n                OnShapeChanged();\n            }\n        }\n\n        //This is a convenience method.  People expect to see a 'radius' of some kind.\n        ///<summary>\n        /// Gets or sets the radius of the capsule.\n        ///</summary>\n        public float Radius { get { return collisionMargin; } set { CollisionMargin = value; } }\n\n\n        public override void GetBoundingBox(ref RigidTransform shapeTransform, out BoundingBox boundingBox)\n        {\n#if !WINDOWS\n            boundingBox = new BoundingBox();\n#endif\n            var upExtreme = new Vector3(0, halfLength, 0);\n            var downExtreme = new Vector3(0, -halfLength, 0);\n\n            Vector3.Transform(ref upExtreme, ref shapeTransform.Orientation, out upExtreme);\n            Vector3.Transform(ref downExtreme, ref shapeTransform.Orientation, out downExtreme);\n\n            if (upExtreme.X > downExtreme.X)\n            {\n                boundingBox.Max.X = upExtreme.X;\n                boundingBox.Min.X = downExtreme.X;\n            }\n            else\n            {\n                boundingBox.Max.X = downExtreme.X;\n                boundingBox.Min.X = upExtreme.X;\n            }\n\n            if (upExtreme.Y > downExtreme.Y)\n            {\n                boundingBox.Max.Y = upExtreme.Y;\n                boundingBox.Min.Y = downExtreme.Y;\n            }\n            else\n            {\n                boundingBox.Max.Y = downExtreme.Y;\n                boundingBox.Min.Y = upExtreme.Y;\n            }\n\n            if (upExtreme.Z > downExtreme.Z)\n            {\n                boundingBox.Max.Z = upExtreme.Z;\n                boundingBox.Min.Z = downExtreme.Z;\n            }\n            else\n            {\n                boundingBox.Max.Z = downExtreme.Z;\n                boundingBox.Min.Z = upExtreme.Z;\n            }\n\n\n            boundingBox.Min.X += shapeTransform.Position.X - collisionMargin;\n            boundingBox.Min.Y += shapeTransform.Position.Y - collisionMargin;\n            boundingBox.Min.Z += shapeTransform.Position.Z - collisionMargin;\n            boundingBox.Max.X += shapeTransform.Position.X + collisionMargin;\n            boundingBox.Max.Y += shapeTransform.Position.Y + collisionMargin;\n            boundingBox.Max.Z += shapeTransform.Position.Z + collisionMargin;\n        }\n\n\n        ///<summary>\n        /// Gets the extreme point of the shape in local space in a given direction.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)\n        {\n            if (direction.Y > 0)\n                extremePoint = new Vector3(0, halfLength, 0);\n            else if (direction.Y < 0)\n                extremePoint = new Vector3(0, -halfLength, 0);\n            else\n                extremePoint = Toolbox.ZeroVector;\n        }\n\n\n        ///<summary>\n        /// Computes the minimum radius of the shape.\n        /// This is often smaller than the actual minimum radius;\n        /// it is simply an approximation that avoids overestimating.\n        ///</summary>\n        ///<returns>Minimum radius of the shape.</returns>\n        public override float ComputeMinimumRadius()\n        {\n            return Radius;\n        }\n\n        /// <summary>\n        /// Computes the maximum radius of the shape.\n        /// This is often larger than the actual maximum radius;\n        /// it is simply an approximation that avoids underestimating.\n        /// </summary>\n        /// <returns>Maximum radius of the shape.</returns>\n        public override float ComputeMaximumRadius()\n        {\n            return halfLength + Radius;\n        }\n\n        /// <summary>\n        /// Computes the volume distribution of the shape as well as its volume.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Volume distribution of the shape.</returns>\n        public override Matrix3x3 ComputeVolumeDistribution(out float volume)\n        {\n            volume = ComputeVolume();\n\n\n            //Calculate inertia tensor.\n            var volumeDistribution = new Matrix3x3();\n            float effectiveLength = Length + Radius / 2;\n            float diagValue = (.0833333333f * effectiveLength * effectiveLength + .25f * Radius * Radius);\n            volumeDistribution.M11 = diagValue;\n            volumeDistribution.M22 = .5f * Radius * Radius;\n            volumeDistribution.M33 = diagValue;\n\n            return volumeDistribution;\n        }\n\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.\n        /// </summary>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter()\n        {\n            return Vector3.Zero;\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.  This calculation is often associated with the \n        /// volume calculation, which is given by this method as well.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter(out float volume)\n        {\n            volume = ComputeVolume();\n            return ComputeCenter();\n        }\n\n        /// <summary>\n        /// Computes the volume of the shape.\n        /// </summary>\n        /// <returns>Volume of the shape.</returns>\n        public override float ComputeVolume()\n        {\n            return (float)(Math.PI * Radius * Radius * Length + 1.333333 * Math.PI * Radius * Radius * Radius);\n        }\n\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new ConvexCollidable<CapsuleShape>(this);\n        }\n\n        /// <summary>\n        /// Gets the intersection between the convex shape and the ray.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"transform\">Transform of the convex shape.</param>\n        /// <param name=\"maximumLength\">Maximum distance to travel in units of the ray direction's length.</param>\n        /// <param name=\"hit\">Ray hit data, if any.</param>\n        /// <returns>Whether or not the ray hit the target.</returns>\n        public override bool RayTest(ref Ray ray, ref RigidTransform transform, float maximumLength, out RayHit hit)\n        {\n            //Put the ray into local space.\n            Quaternion conjugate;\n            Quaternion.Conjugate(ref transform.Orientation, out conjugate);\n            Ray localRay;\n            Vector3.Subtract(ref ray.Position, ref transform.Position, out localRay.Position);\n            Vector3.Transform(ref localRay.Position, ref conjugate, out localRay.Position);\n            Vector3.Transform(ref ray.Direction, ref conjugate, out localRay.Direction);\n\n            //Check for containment in the cylindrical portion of the capsule.\n            if (localRay.Position.Y >= -halfLength && localRay.Position.Y <= halfLength && localRay.Position.X * localRay.Position.X + localRay.Position.Z * localRay.Position.Z <= collisionMargin * collisionMargin)\n            {\n                //It's inside!\n                hit.T = 0;\n                hit.Location = localRay.Position; \n                hit.Normal = new Vector3(hit.Location.X, 0, hit.Location.Z);\n                float normalLengthSquared = hit.Normal.LengthSquared();\n                if (normalLengthSquared > 1e-9f)\n                    Vector3.Divide(ref hit.Normal, (float)Math.Sqrt(normalLengthSquared), out hit.Normal);\n                else\n                    hit.Normal = new Vector3();\n                //Pull the hit into world space.\n                Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n                RigidTransform.Transform(ref hit.Location, ref transform, out hit.Location);\n                return true;\n            }\n\n            //Project the ray direction onto the plane where the cylinder is a circle.\n            //The projected ray is then tested against the circle to compute the time of impact.\n            //That time of impact is used to compute the 3d hit location.\n            Vector2 planeDirection = new Vector2(localRay.Direction.X, localRay.Direction.Z);\n            float planeDirectionLengthSquared = planeDirection.LengthSquared();\n\n            if (planeDirectionLengthSquared < Toolbox.Epsilon)\n            {\n                //The ray is nearly parallel with the axis.\n                //Skip the cylinder-sides test.  We're either inside the cylinder and won't hit the sides, or we're outside\n                //and won't hit the sides.  \n                if (localRay.Position.Y > halfLength)\n                    goto upperSphereTest;\n                if (localRay.Position.Y < -halfLength)\n                    goto lowerSphereTest;\n\n\n                hit = new RayHit();\n                return false;\n\n            }\n            Vector2 planeOrigin = new Vector2(localRay.Position.X, localRay.Position.Z);\n            float dot;\n            Vector2.Dot(ref planeDirection, ref planeOrigin, out dot);\n            float closestToCenterT = -dot / planeDirectionLengthSquared;\n\n            Vector2 closestPoint;\n            Vector2.Multiply(ref planeDirection, closestToCenterT, out closestPoint);\n            Vector2.Add(ref planeOrigin, ref closestPoint, out closestPoint);\n            //How close does the ray come to the circle?\n            float squaredDistance = closestPoint.LengthSquared();\n            if (squaredDistance > collisionMargin * collisionMargin)\n            {\n                //It's too far!  The ray cannot possibly hit the capsule.\n                hit = new RayHit();\n                return false;\n            }\n\n\n\n            //With the squared distance, compute the distance backward along the ray from the closest point on the ray to the axis.\n            float backwardsDistance = collisionMargin * (float)Math.Sqrt(1 - squaredDistance / (collisionMargin * collisionMargin));\n            float tOffset = backwardsDistance / (float)Math.Sqrt(planeDirectionLengthSquared);\n\n            hit.T = closestToCenterT - tOffset;\n\n            //Compute the impact point on the infinite cylinder in 3d local space.\n            Vector3.Multiply(ref localRay.Direction, hit.T, out hit.Location);\n            Vector3.Add(ref hit.Location, ref localRay.Position, out hit.Location);\n\n            //Is it intersecting the cylindrical portion of the capsule?\n            if (hit.Location.Y <= halfLength && hit.Location.Y >= -halfLength && hit.T < maximumLength)\n            {\n                //Yup!\n                hit.Normal = new Vector3(hit.Location.X, 0, hit.Location.Z);\n                float normalLengthSquared = hit.Normal.LengthSquared();\n                if (normalLengthSquared > 1e-9f)\n                    Vector3.Divide(ref hit.Normal, (float)Math.Sqrt(normalLengthSquared), out hit.Normal);\n                else\n                    hit.Normal = new Vector3();\n                //Pull the hit into world space.\n                Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n                RigidTransform.Transform(ref hit.Location, ref transform, out hit.Location);\n                return true;\n            }\n\n            if (hit.Location.Y < halfLength)\n                goto lowerSphereTest;\n        upperSphereTest:\n            //Nope! It may be intersecting the ends of the capsule though.\n            //We're above the capsule, so cast a ray against the upper sphere.\n            //We don't have to worry about it hitting the bottom of the sphere since it would have hit the cylinder portion first.\n            var spherePosition = new Vector3(0, halfLength, 0);\n            if (Toolbox.RayCastSphere(ref localRay, ref spherePosition, collisionMargin, maximumLength, out hit))\n            {\n                //Pull the hit into world space.\n                Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n                RigidTransform.Transform(ref hit.Location, ref transform, out hit.Location);\n                return true;\n            }\n            //No intersection! We can't be hitting the other sphere, so it's over!\n            hit = new RayHit();\n            return false;\n\n        lowerSphereTest:\n            //Okay, what about the bottom sphere?\n            //We're above the capsule, so cast a ray against the upper sphere.\n            //We don't have to worry about it hitting the bottom of the sphere since it would have hit the cylinder portion first.\n            spherePosition = new Vector3(0, -halfLength, 0);\n            if (Toolbox.RayCastSphere(ref localRay, ref spherePosition, collisionMargin, maximumLength, out hit))\n            {\n                //Pull the hit into world space.\n                Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n                RigidTransform.Transform(ref hit.Location, ref transform, out hit.Location);\n                return true;\n            }\n            //No intersection! We can't be hitting the other sphere, so it's over!\n            hit = new RayHit();\n            return false;\n\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/ConeShape.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n    ///<summary>\n    /// Symmetrical shape with a circular base and a point at the top.\n    ///</summary>\n    public class ConeShape : ConvexShape\n    {\n\n        float radius;\n        float height;\n        ///<summary>\n        /// Gets or sets the height of the cone.\n        ///</summary>\n        public float Height\n        {\n            get { return height; }\n            set\n            {\n                height = value;\n                OnShapeChanged();\n            }\n        }\n        ///<summary>\n        /// Gets or sets the radius of the cone base.\n        ///</summary>\n        public float Radius\n        {\n            get { return radius; }\n            set\n            {\n                radius = value;\n                OnShapeChanged();\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new cone shape.\n        ///</summary>\n        ///<param name=\"height\">Height of the cone.</param>\n        ///<param name=\"radius\">Radius of the cone base.</param>\n        public ConeShape(float height, float radius)\n        {\n            this.height = height;\n            Radius = radius;\n        }\n\n\n        ///<summary>\n        /// Gets the extreme point of the shape in local space in a given direction.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)\n        {\n            //Is it the tip of the cone?\n            float sinThetaSquared = radius * radius / (radius * radius + height * height);\n            //If d.Y * d.Y / d.LengthSquared >= sinthetaSquared\n            if (direction.Y > 0 && direction.Y * direction.Y >= direction.LengthSquared() * sinThetaSquared)\n            {\n                extremePoint = new Vector3(0, .75f * height, 0);\n                return;\n            }\n            //Is it a bottom edge of the cone?\n            float horizontalLengthSquared = direction.X * direction.X + direction.Z * direction.Z;\n            if (horizontalLengthSquared > Toolbox.Epsilon)\n            {\n                var radOverSigma = radius / Math.Sqrt(horizontalLengthSquared);\n                extremePoint = new Vector3((float)(radOverSigma * direction.X), -.25f * height, (float)(radOverSigma * direction.Z));\n            }\n            else // It's pointing almost straight down...\n                extremePoint = new Vector3(0, -.25f * height, 0);\n\n\n        }\n\n        ///<summary>\n        /// Computes the minimum radius of the shape.\n        /// This is often smaller than the actual minimum radius;\n        /// it is simply an approximation that avoids overestimating.\n        ///</summary>\n        ///<returns>Minimum radius of the shape.</returns>\n        public override float ComputeMinimumRadius()\n        {\n            double denominator = radius / height;\n            denominator = denominator / Math.Sqrt(denominator * denominator + 1);\n            return (float)(collisionMargin + Math.Min(.25f * height, denominator * .75 * height));\n        }\n\n        /// <summary>\n        /// Computes the maximum radius of the shape.\n        /// This is often larger than the actual maximum radius;\n        /// it is simply an approximation that avoids underestimating.\n        /// </summary>\n        /// <returns>Maximum radius of the shape.</returns>\n        public override float ComputeMaximumRadius()\n        {\n            return (float)(collisionMargin + Math.Max(.75 * Height, Math.Sqrt(.0625f * Height * Height + Radius * Radius)));\n        }\n\n        /// <summary>\n        /// Computes the volume distribution of the shape as well as its volume.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Volume distribution of the shape.</returns>\n        public override Matrix3x3 ComputeVolumeDistribution(out float volume)\n        {\n            volume = ComputeVolume();\n\n            //Calculate inertia tensor.\n            var volumeDistribution = new Matrix3x3();\n            float diagValue = (.1f * Height * Height + .15f * Radius * Radius);\n            volumeDistribution.M11 = diagValue;\n            volumeDistribution.M22 = .3f * Radius * Radius;\n            volumeDistribution.M33 = diagValue;\n\n            return volumeDistribution;\n        }\n\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.\n        /// </summary>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter()\n        {\n            return Vector3.Zero;\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.  This calculation is often associated with the \n        /// volume calculation, which is given by this method as well.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter(out float volume)\n        {\n            volume = ComputeVolume();\n            return ComputeCenter();\n        }\n\n        /// <summary>\n        /// Computes the volume of the shape.\n        /// </summary>\n        /// <returns>Volume of the shape.</returns>\n        public override float ComputeVolume()\n        {\n            return (float)(.333333 * Math.PI * Radius * Radius * Height);\n        }\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new ConvexCollidable<ConeShape>(this);\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/ConvexHullShape.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n    ///<summary>\n    /// Convex wrapping around a point set.\n    ///</summary>\n    public class ConvexHullShape : ConvexShape\n    {\n        ///<summary>\n        /// Gets the point set of the convex hull.\n        ///</summary>\n        public ReadOnlyList<Vector3> Vertices\n        {\n            get\n            {\n                return new ReadOnlyList<Vector3>(vertices);\n            }\n        }\n        RawList<Vector3> vertices;\n\n        ///<summary>\n        /// Constructs a new convex hull shape.\n        /// The point set will be recentered on the local origin.\n        /// If that offset is needed, use the other constructor which outputs the computed center.\n        ///</summary>\n        ///<param name=\"vertices\">Point set to use to construct the convex hull.</param>\n        ///<exception cref=\"ArgumentException\">Thrown when the point set is empty.</exception>\n        public ConvexHullShape(IList<Vector3> vertices)\n        {\n            if (vertices.Count == 0)\n                throw new ArgumentException(\"Vertices list used to create a ConvexHullShape cannot be empty.\");\n\n            var surfaceVertices = CommonResources.GetVectorList();\n            ComputeCenter(vertices, surfaceVertices);\n            this.vertices = new RawList<Vector3>(surfaceVertices);\n            CommonResources.GiveBack(surfaceVertices);\n\n            OnShapeChanged();\n        }\n\n        ///<summary>\n        /// Constructs a new convex hull shape.\n        /// The point set will be recentered on the local origin.\n        ///</summary>\n        ///<param name=\"vertices\">Point set to use to construct the convex hull.</param>\n        /// <param name=\"center\">Computed center of the convex hull shape prior to recentering.</param>\n        ///<exception cref=\"ArgumentException\">Thrown when the point set is empty.</exception>\n        public ConvexHullShape(IList<Vector3> vertices, out Vector3 center)\n        {\n            if (vertices.Count == 0)\n                throw new ArgumentException(\"Vertices list used to create a ConvexHullShape cannot be empty.\");\n\n            var surfaceVertices = CommonResources.GetVectorList();\n            center = ComputeCenter(vertices, surfaceVertices);\n            this.vertices = new RawList<Vector3>(surfaceVertices);\n            CommonResources.GiveBack(surfaceVertices);\n\n            OnShapeChanged();\n        }\n\n        ///<summary>\n        /// Constructs a new convex hull shape.\n        /// The point set will be recentered on the local origin.\n        ///</summary>\n        ///<param name=\"vertices\">Point set to use to construct the convex hull.</param>\n        /// <param name=\"center\">Computed center of the convex hull shape prior to recentering.</param>\n        /// <param name=\"outputHullTriangleIndices\">Triangle indices computed on the surface of the point set.</param>\n        /// <param name=\"outputUniqueSurfaceVertices\">Unique vertices on the surface of the convex hull.</param>\n        ///<exception cref=\"ArgumentException\">Thrown when the point set is empty.</exception>\n        public ConvexHullShape(IList<Vector3> vertices, out Vector3 center, IList<int> outputHullTriangleIndices, IList<Vector3> outputUniqueSurfaceVertices)\n        {\n            if (vertices.Count == 0)\n                throw new ArgumentException(\"Vertices list used to create a ConvexHullShape cannot be empty.\");\n\n\n            //Ensure that the convex hull is centered on its local origin.\n            center = ComputeCenter(vertices, outputHullTriangleIndices, outputUniqueSurfaceVertices);\n            this.vertices = new RawList<Vector3>(outputUniqueSurfaceVertices);\n\n            OnShapeChanged();\n        }\n\n\n        /// <summary>\n        /// Gets the bounding box of the shape given a transform.\n        /// </summary>\n        /// <param name=\"shapeTransform\">Transform to use.</param>\n        /// <param name=\"boundingBox\">Bounding box of the transformed shape.</param>\n        public override void GetBoundingBox(ref RigidTransform shapeTransform, out BoundingBox boundingBox)\n        {\n#if !WINDOWS\n            boundingBox = new BoundingBox();\n#endif\n\n            Matrix3x3 o;\n            Matrix3x3.CreateFromQuaternion(ref shapeTransform.Orientation, out o);\n\n            float minX, maxX;\n            float minY, maxY;\n            float minZ, maxZ;\n            var right = new Vector3(o.M11, o.M21, o.M31);\n            var up = new Vector3(o.M12, o.M22, o.M32);\n            var backward = new Vector3(o.M13, o.M23, o.M33);\n            Vector3.Dot(ref vertices.Elements[0], ref right, out maxX);\n            minX = maxX;\n            Vector3.Dot(ref vertices.Elements[0], ref up, out maxY);\n            minY = maxY;\n            Vector3.Dot(ref vertices.Elements[0], ref backward, out maxZ);\n            minZ = maxZ;\n            int minXIndex = 0;\n            int maxXIndex = 0;\n            int minYIndex = 0;\n            int maxYIndex = 0;\n            int minZIndex = 0;\n            int maxZIndex = 0;\n            for (int i = 1; i < vertices.Count; i++)\n            {\n                float dot;\n                Vector3.Dot(ref vertices.Elements[i], ref right, out dot);\n                if (dot < minX)\n                {\n                    minX = dot;\n                    minXIndex = i;\n                }\n                else if (dot > maxX)\n                {\n                    maxX = dot;\n                    maxXIndex = i;\n                }\n\n                Vector3.Dot(ref vertices.Elements[i], ref up, out dot);\n                if (dot < minY)\n                {\n                    minY = dot;\n                    minYIndex = i;\n                }\n                else if (dot > maxY)\n                {\n                    maxY = dot;\n                    maxYIndex = i;\n                }\n\n                Vector3.Dot(ref vertices.Elements[i], ref backward, out dot);\n                if (dot < minZ)\n                {\n                    minZ = dot;\n                    minZIndex = i;\n                }\n                else if (dot > maxZ)\n                {\n                    maxZ = dot;\n                    maxZIndex = i;\n                }\n            }\n\n            Vector3 minXpoint, maxXpoint, minYpoint, maxYpoint, minZpoint, maxZpoint;\n\n            Matrix3x3.Transform(ref vertices.Elements[minXIndex], ref o, out minXpoint);\n            Matrix3x3.Transform(ref vertices.Elements[maxXIndex], ref o, out maxXpoint);\n            Matrix3x3.Transform(ref vertices.Elements[minYIndex], ref o, out minYpoint);\n            Matrix3x3.Transform(ref vertices.Elements[maxYIndex], ref o, out maxYpoint);\n            Matrix3x3.Transform(ref vertices.Elements[minZIndex], ref o, out minZpoint);\n            Matrix3x3.Transform(ref vertices.Elements[maxZIndex], ref o, out maxZpoint);\n\n            boundingBox.Max.X = shapeTransform.Position.X + collisionMargin + maxXpoint.X;\n            boundingBox.Max.Y = shapeTransform.Position.Y + collisionMargin + maxYpoint.Y;\n            boundingBox.Max.Z = shapeTransform.Position.Z + collisionMargin + maxZpoint.Z;\n\n            boundingBox.Min.X = shapeTransform.Position.X - collisionMargin + minXpoint.X;\n            boundingBox.Min.Y = shapeTransform.Position.Y - collisionMargin + minYpoint.Y;\n            boundingBox.Min.Z = shapeTransform.Position.Z - collisionMargin + minZpoint.Z;\n        }\n\n\n        public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)\n        {\n            float max;\n            Vector3.Dot(ref vertices.Elements[0], ref direction, out max);\n            int maxIndex = 0;\n            for (int i = 1; i < vertices.Count; i++)\n            {\n                float dot;\n                Vector3.Dot(ref vertices.Elements[i], ref direction, out dot);\n                if (dot > max)\n                {\n                    max = dot;\n                    maxIndex = i;\n                }\n            }\n            extremePoint = vertices.Elements[maxIndex];\n        }\n\n        #region Shape Information\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.\n        /// </summary>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter()\n        {\n            return ComputeCenter(vertices);\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.  This calculation is often associated with the \n        /// volume calculation, which is given by this method as well.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter(out float volume)\n        {\n            return ComputeCenter(vertices, out volume);\n        }\n\n        /// <summary>\n        /// Computes the volume of the shape.\n        /// </summary>\n        /// <returns>Volume of the shape.</returns>\n        public override float ComputeVolume()\n        {\n            float volume;\n            ComputeCenter(out volume);\n            return volume;\n        }\n\n        ///<summary>\n        /// Computes the center, volume, and surface triangles of the convex hull shape.\n        ///</summary>\n        ///<param name=\"volume\">Volume of the hull.</param>\n        ///<param name=\"outputSurfaceTriangles\">Surface triangles of the hull.</param>\n        ///<param name=\"outputLocalSurfaceVertices\">Surface vertices recentered on the center of volume. </param>\n        ///<returns>Center of the hull.</returns>\n        public Vector3 ComputeCenter(out float volume, IList<int> outputSurfaceTriangles, IList<Vector3> outputLocalSurfaceVertices)\n        {\n            return ComputeCenter(vertices, out volume, outputSurfaceTriangles, outputLocalSurfaceVertices);\n        }\n\n        ///<summary>\n        /// Computes the center of a convex hull defined by the point set.\n        ///</summary>\n        ///<param name=\"vertices\">Point set defining the convex hull.</param>\n        ///<returns>Center of the convex hull.</returns>\n        public static Vector3 ComputeCenter(IList<Vector3> vertices)\n        {\n            float volume;\n            return ComputeCenter(vertices, out volume);\n        }\n\n        ///<summary>\n        /// Computes the center and volume of a convex hull defined by a pointset.\n        ///</summary>\n        ///<param name=\"vertices\">Point set defining the convex hull.</param>\n        ///<param name=\"volume\">Volume of the convex hull.</param>\n        ///<returns>Center of the convex hull.</returns>\n        public static Vector3 ComputeCenter(IList<Vector3> vertices, out float volume)\n        {\n            var localSurfaceVertices = CommonResources.GetVectorList();\n            var surfaceTriangles = CommonResources.GetIntList();\n            Vector3 toReturn = ComputeCenter(vertices, out volume, surfaceTriangles, localSurfaceVertices);\n            CommonResources.GiveBack(localSurfaceVertices);\n            CommonResources.GiveBack(surfaceTriangles);\n            return toReturn;\n        }\n\n        ///<summary>\n        /// Computes the center and surface triangles of a convex hull defined by a point set.\n        ///</summary>\n        ///<param name=\"vertices\">Point set defining the convex hull.</param>\n        ///<param name=\"outputLocalSurfaceVertices\">Local positions of vertices on the convex hull.</param>\n        ///<returns>Center of the convex hull.</returns>\n        public static Vector3 ComputeCenter(IList<Vector3> vertices, IList<Vector3> outputLocalSurfaceVertices)\n        {\n            float volume;\n            var indices = CommonResources.GetIntList();\n            Vector3 toReturn = ComputeCenter(vertices, out volume, indices, outputLocalSurfaceVertices);\n            CommonResources.GiveBack(indices);\n            return toReturn;\n        }\n\n        ///<summary>\n        /// Computes the center and surface triangles of a convex hull defined by a point set.\n        ///</summary>\n        ///<param name=\"vertices\">Point set defining the convex hull.</param>\n        ///<param name=\"outputSurfaceTriangles\">Indices of surface triangles of the convex hull.</param>\n        ///<param name=\"outputLocalSurfaceVertices\">Local positions of vertices on the convex hull.</param>\n        ///<returns>Center of the convex hull.</returns>\n        public static Vector3 ComputeCenter(IList<Vector3> vertices, IList<int> outputSurfaceTriangles, IList<Vector3> outputLocalSurfaceVertices)\n        {\n            float volume;\n            Vector3 toReturn = ComputeCenter(vertices, out volume, outputSurfaceTriangles, outputLocalSurfaceVertices);\n            return toReturn;\n        }\n\n        ///<summary>\n        /// Computes the center, volume, and surface triangles of a convex hull defined by a point set.\n        ///</summary>\n        ///<param name=\"vertices\">Point set defining the convex hull.</param>\n        ///<param name=\"volume\">Volume of the convex hull.</param>\n        ///<param name=\"outputSurfaceTriangles\">Indices of surface triangles of the convex hull.</param>\n        ///<param name=\"outputLocalSurfaceVertices\">Local positions of vertices on the convex hull.</param>\n        ///<returns>Center of the convex hull.</returns>\n        public static Vector3 ComputeCenter(IList<Vector3> vertices, out float volume, IList<int> outputSurfaceTriangles, IList<Vector3> outputLocalSurfaceVertices)\n        {\n            Vector3 centroid = Toolbox.ZeroVector;\n            for (int k = 0; k < vertices.Count; k++)\n            {\n                centroid += vertices[k];\n            }\n            centroid /= vertices.Count;\n\n            //Toolbox.GetConvexHull(vertices, outputSurfaceTriangles, outputLocalSurfaceVertices);\n            ConvexHullHelper.GetConvexHull(vertices, outputSurfaceTriangles, outputLocalSurfaceVertices);\n\n            volume = 0;\n            var volumes = CommonResources.GetFloatList();\n            var centroids = CommonResources.GetVectorList();\n            for (int k = 0; k < outputSurfaceTriangles.Count; k += 3)\n            {\n                volumes.Add(Vector3.Dot(\n                    Vector3.Cross(vertices[outputSurfaceTriangles[k + 1]] - vertices[outputSurfaceTriangles[k]],\n                                  vertices[outputSurfaceTriangles[k + 2]] - vertices[outputSurfaceTriangles[k]]),\n                    centroid - vertices[outputSurfaceTriangles[k]]));\n                volume += volumes[k / 3];\n                centroids.Add((vertices[outputSurfaceTriangles[k]] + vertices[outputSurfaceTriangles[k + 1]] + vertices[outputSurfaceTriangles[k + 2]] + centroid) / 4);\n            }\n            Vector3 center = Toolbox.ZeroVector;\n            for (int k = 0; k < centroids.Count; k++)\n            {\n                center += centroids[k] * (volumes[k] / volume);\n            }\n            volume /= 6;\n            for (int k = 0; k < outputLocalSurfaceVertices.Count; k++)\n            {\n                outputLocalSurfaceVertices[k] -= center;\n            }\n            CommonResources.GiveBack(centroids);\n            CommonResources.GiveBack(volumes);\n            return center;\n        }\n\n        /// <summary>\n        /// Computes the volume distribution of the shape as well as its volume.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Volume distribution of the shape.</returns>\n        public override Matrix3x3 ComputeVolumeDistribution(out float volume)\n        {\n            var surfaceTriangles = CommonResources.GetIntList();\n            var surfaceVertices = CommonResources.GetVectorList();\n            ComputeCenter(out volume, surfaceTriangles, surfaceVertices);\n            Matrix3x3 toReturn = ComputeVolumeDistribution(volume, surfaceTriangles);\n            CommonResources.GiveBack(surfaceTriangles);\n            CommonResources.GiveBack(surfaceVertices);\n            return toReturn;\n        }\n\n        ///<summary>\n        /// Computes the volume distribution of the convex hull, its volume, and its surface triangles.\n        ///</summary>\n        ///<param name=\"volume\">Volume of the convex hull.</param>\n        ///<param name=\"localSurfaceTriangles\">Surface triangles of the convex hull.</param>\n        ///<returns>Volume distribution of the convex hull.</returns>\n        public Matrix3x3 ComputeVolumeDistribution(float volume, IList<int> localSurfaceTriangles)\n        {\n            //TODO: This method has a lot of overlap with the volume calculation.  Conceptually very similar, could bundle tighter.\n\n            //Source: Explicit Exact Formulas for the 3-D Tetrahedron Inertia Tensor in Terms of its Vertex Coordinates\n            //http://www.scipub.org/fulltext/jms2/jms2118-11.pdf\n            //x1, x2, x3, x4 are origin, triangle1, triangle2, triangle3\n            //Looking to find inertia tensor matrix of the form\n            // [  a  -b' -c' ]\n            // [ -b'  b  -a' ]\n            // [ -c' -a'  c  ]\n            float a = 0, b = 0, c = 0, ao = 0, bo = 0, co = 0;\n            Vector3 v2, v3, v4;\n            float density = 1 / volume;\n            float diagonalFactor = density / 60;\n            float offFactor = -density / 120;\n            for (int i = 0; i < localSurfaceTriangles.Count; i += 3)\n            {\n                v2 = vertices[localSurfaceTriangles[i]];\n                v3 = vertices[localSurfaceTriangles[i + 1]];\n                v4 = vertices[localSurfaceTriangles[i + 2]];\n                float determinant = Math.Abs(v2.X * (v3.Y * v4.Z - v3.Z * v4.Y) -\n                                             v3.X * (v2.Y * v4.Z - v2.Z * v4.Y) +\n                                             v4.X * (v2.Y * v3.Z - v2.Z * v3.Y)); //Determinant is 6 * volume.\n                a += determinant * (v2.Y * v2.Y + v2.Y * v3.Y + v3.Y * v3.Y + v2.Y * v4.Y + v3.Y * v4.Y + v4.Y * v4.Y +\n                                    v2.Z * v2.Z + v2.Z * v3.Z + v3.Z * v3.Z + v2.Z * v4.Z + v3.Z * v4.Z + v4.Z * v4.Z);\n                b += determinant * (v2.X * v2.X + v2.X * v3.X + v3.X * v3.X + v2.X * v4.X + v3.X * v4.X + v4.X * v4.X +\n                                    v2.Z * v2.Z + v2.Z * v3.Z + v3.Z * v3.Z + v2.Z * v4.Z + v3.Z * v4.Z + v4.Z * v4.Z);\n                c += determinant * (v2.X * v2.X + v2.X * v3.X + v3.X * v3.X + v2.X * v4.X + v3.X * v4.X + v4.X * v4.X +\n                                    v2.Y * v2.Y + v2.Y * v3.Y + v3.Y * v3.Y + v2.Y * v4.Y + v3.Y * v4.Y + v4.Y * v4.Y);\n                ao += determinant * (2 * v2.Y * v2.Z + v3.Y * v2.Z + v4.Y * v2.Z + v2.Y * v3.Z + 2 * v3.Y * v3.Z + v4.Y * v3.Z + v2.Y * v4.Z + v3.Y * v4.Z + 2 * v4.Y * v4.Z);\n                bo += determinant * (2 * v2.X * v2.Z + v3.X * v2.Z + v4.X * v2.Z + v2.X * v3.Z + 2 * v3.X * v3.Z + v4.X * v3.Z + v2.X * v4.Z + v3.X * v4.Z + 2 * v4.X * v4.Z);\n                co += determinant * (2 * v2.X * v2.Y + v3.X * v2.Y + v4.X * v2.Y + v2.X * v3.Y + 2 * v3.X * v3.Y + v4.X * v3.Y + v2.X * v4.Y + v3.X * v4.Y + 2 * v4.X * v4.Y);\n\n\n                /*subInertiaTensor = new Matrix(a, bo, co, 0,\n                                              bo, b, ao, 0,\n                                              co, ao, c, 0,\n                                              0, 0, 0, 0);\n\n                localInertiaTensor += subInertiaTensor;// +(offset.LengthSquared() * Matrix.Identity - Toolbox.getOuterProduct(offset, offset));// *(determinant * density / 6);*/\n            }\n            a *= diagonalFactor;\n            b *= diagonalFactor;\n            c *= diagonalFactor;\n            ao *= offFactor;\n            bo *= offFactor;\n            co *= offFactor;\n            var distribution = new Matrix3x3(a, bo, co,\n                                                   bo, b, ao,\n                                                   co, ao, c);\n\n            return distribution;\n        }\n\n        /// <summary>\n        /// Computes the maximum radius of the shape.\n        /// This is often larger than the actual maximum radius;\n        /// it is simply an approximation that avoids underestimating.\n        /// </summary>\n        /// <returns>Maximum radius of the shape.</returns>\n        public override float ComputeMaximumRadius()\n        {\n            float maximumRadius = 0;\n            for (int i = 0; i < vertices.Count; i++)\n            {\n                float tempDist = vertices.Elements[i].Length();\n                if (maximumRadius < tempDist)\n                    maximumRadius = tempDist;\n            }\n            maximumRadius += collisionMargin;\n            return maximumRadius;\n        }\n\n        ///<summary>\n        /// Computes the minimum radius of the shape.\n        /// This is often smaller than the actual minimum radius;\n        /// it is simply an approximation that avoids overestimating.\n        ///</summary>\n        ///<returns>Minimum radius of the shape.</returns>\n        public override float ComputeMinimumRadius()\n        {\n            //Sample the shape in directions pointing to the vertices of a regular tetrahedron.\n            Vector3 a, b, c, d;\n            var direction = new Vector3(1, 1, 1);\n            GetLocalExtremePointWithoutMargin(ref direction, out a);\n            direction = new Vector3(-1, -1, 1);\n            GetLocalExtremePointWithoutMargin(ref direction, out b);\n            direction = new Vector3(-1, 1, -1);\n            GetLocalExtremePointWithoutMargin(ref direction, out c);\n            direction = new Vector3(1, -1, -1);\n            GetLocalExtremePointWithoutMargin(ref direction, out d);\n            Vector3 ab, cb, ac, ad, cd;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3.Subtract(ref b, ref c, out cb);\n            Vector3.Subtract(ref c, ref a, out ac);\n            Vector3.Subtract(ref d, ref a, out ad);\n            Vector3.Subtract(ref d, ref c, out cd);\n            //Find normals of triangles: ABC, CBD, ACD, ADB\n            Vector3 nABC, nCBD, nACD, nADB;\n            Vector3.Cross(ref ac, ref ab, out nABC);\n            Vector3.Cross(ref cd, ref cb, out nCBD);\n            Vector3.Cross(ref ad, ref ac, out nACD);\n            Vector3.Cross(ref ab, ref ad, out nADB);\n            //Find distances to planes.\n            float dABC, dCBD, dACD, dADB;\n            Vector3.Dot(ref a, ref nABC, out dABC);\n            Vector3.Dot(ref c, ref nCBD, out dCBD);\n            Vector3.Dot(ref a, ref nACD, out dACD);\n            Vector3.Dot(ref a, ref nADB, out dADB);\n            dABC /= nABC.Length();\n            dCBD /= nCBD.Length();\n            dACD /= nACD.Length();\n            dADB /= nADB.Length();\n\n            return collisionMargin + Math.Min(dABC, Math.Min(dCBD, Math.Min(dACD, dADB)));\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new ConvexCollidable<ConvexHullShape>(this);\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/ConvexShape.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\nusing BEPUphysics.Settings;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n    ///<summary>\n    /// Superclass of convex collision shapes.\n    ///</summary>\n    public abstract class ConvexShape : EntityShape\n    {\n        protected internal float collisionMargin = CollisionDetectionSettings.DefaultMargin;\n        ///<summary>\n        /// Collision margin of the convex shape.  The margin is a small spherical expansion around\n        /// entities which allows specialized collision detection algorithms to be used.\n        /// It's recommended that this be left unchanged.\n        ///</summary>\n        public float CollisionMargin\n        {\n            get\n            {\n                return collisionMargin;\n            }\n            set\n            {\n                if (value < 0)\n                    throw new ArgumentException(\"Collision margin must be nonnegative..\");\n                collisionMargin = value;\n                OnShapeChanged();\n            }\n        }\n\n        protected internal float minimumRadius;\n        /// <summary>\n        /// Gets or sets the minimum radius of the collidable's shape.  This is initialized to a value that is\n        /// guaranteed to be equal to or smaller than the actual minimum radius.  When setting this property,\n        /// ensure that the inner sphere formed by the new minimum radius is fully contained within the shape.\n        /// </summary>\n        public float MinimumRadius { get { return minimumRadius; } set { minimumRadius = value; } }\n\n        protected internal float maximumRadius;\n        /// <summary>\n        /// Gets the maximum radius of the collidable's shape.  This is initialized to a value that is\n        /// guaranteed to be equal to or larger than the actual maximum radius.\n        /// </summary>\n        public float MaximumRadius { get { return maximumRadius; } }\n\n        ///<summary>\n        /// Gets the extreme point of the shape in local space in a given direction.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public abstract void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint);\n\n        ///<summary>\n        /// Gets the extreme point of the shape in world space in a given direction.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        /// <param name=\"shapeTransform\">Transform to use for the shape.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public void GetExtremePointWithoutMargin(Vector3 direction, ref RigidTransform shapeTransform, out Vector3 extremePoint)\n        {\n            Quaternion conjugate;\n            Quaternion.Conjugate(ref shapeTransform.Orientation, out conjugate);\n            Vector3.Transform(ref direction, ref conjugate, out direction);\n            GetLocalExtremePointWithoutMargin(ref direction, out extremePoint);\n\n            Vector3.Transform(ref extremePoint, ref shapeTransform.Orientation, out extremePoint);\n            Vector3.Add(ref extremePoint, ref shapeTransform.Position, out extremePoint);\n        }\n\n        ///<summary>\n        /// Gets the extreme point of the shape in world space in a given direction with margin expansion.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        /// <param name=\"shapeTransform\">Transform to use for the shape.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public void GetExtremePoint(Vector3 direction, ref RigidTransform shapeTransform, out Vector3 extremePoint)\n        {\n            GetExtremePointWithoutMargin(direction, ref shapeTransform, out extremePoint);\n\n            float directionLength = direction.LengthSquared();\n            if (directionLength > Toolbox.Epsilon)\n            {\n                Vector3.Multiply(ref direction, collisionMargin / (float)Math.Sqrt(directionLength), out direction);\n                Vector3.Add(ref extremePoint, ref direction, out extremePoint);\n            }\n\n        }\n\n        ///<summary>\n        /// Gets the extreme point of the shape in local space in a given direction with margin expansion.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public void GetLocalExtremePoint(Vector3 direction, out Vector3 extremePoint)\n        {\n            GetLocalExtremePointWithoutMargin(ref direction, out extremePoint);\n\n            float directionLength = direction.LengthSquared();\n            if (directionLength > Toolbox.Epsilon)\n            {\n                Vector3.Multiply(ref direction, collisionMargin / (float)Math.Sqrt(directionLength), out direction);\n                Vector3.Add(ref extremePoint, ref direction, out extremePoint);\n            }\n        }\n\n\n\n        /// <summary>\n        /// Gets the bounding box of the shape given a transform.\n        /// </summary>\n        /// <param name=\"shapeTransform\">Transform to use.</param>\n        /// <param name=\"boundingBox\">Bounding box of the transformed shape.</param>\n        public override void GetBoundingBox(ref RigidTransform shapeTransform, out BoundingBox boundingBox)\n        {\n#if !WINDOWS\n            boundingBox = new BoundingBox();\n#endif\n            Matrix3x3 o;\n            Matrix3x3.CreateFromQuaternion(ref shapeTransform.Orientation, out o);\n            //Sample the local directions from the orientation matrix, implicitly transposed.\n\n            Vector3 right;\n            var direction = new Vector3(o.M11, o.M21, o.M31);\n            GetLocalExtremePointWithoutMargin(ref direction, out right);\n\n            Vector3 left;\n            direction = new Vector3(-o.M11, -o.M21, -o.M31);\n            GetLocalExtremePointWithoutMargin(ref direction, out left);\n\n            Vector3 up;\n            direction = new Vector3(o.M12, o.M22, o.M32);\n            GetLocalExtremePointWithoutMargin(ref direction, out up);\n\n            Vector3 down;\n            direction = new Vector3(-o.M12, -o.M22, -o.M32);\n            GetLocalExtremePointWithoutMargin(ref direction, out down);\n\n            Vector3 backward;\n            direction = new Vector3(o.M13, o.M23, o.M33);\n            GetLocalExtremePointWithoutMargin(ref direction, out backward);\n\n            Vector3 forward;\n            direction = new Vector3(-o.M13, -o.M23, -o.M33);\n            GetLocalExtremePointWithoutMargin(ref direction, out forward);\n\n\n            Matrix3x3.Transform(ref right, ref o, out right);\n            Matrix3x3.Transform(ref left, ref o, out left);\n            Matrix3x3.Transform(ref up, ref o, out up);\n            Matrix3x3.Transform(ref down, ref o, out down);\n            Matrix3x3.Transform(ref backward, ref o, out backward);\n            Matrix3x3.Transform(ref forward, ref o, out forward);\n\n            //These right/up/backward represent the extreme points in world space along the world space axes.\n\n            boundingBox.Max.X = shapeTransform.Position.X + collisionMargin + right.X;\n            boundingBox.Max.Y = shapeTransform.Position.Y + collisionMargin + up.Y;\n            boundingBox.Max.Z = shapeTransform.Position.Z + collisionMargin + backward.Z;\n\n            boundingBox.Min.X = shapeTransform.Position.X - collisionMargin + left.X;\n            boundingBox.Min.Y = shapeTransform.Position.Y - collisionMargin + down.Y;\n            boundingBox.Min.Z = shapeTransform.Position.Z - collisionMargin + forward.Z;\n\n        }\n\n        /// <summary>\n        /// Gets the intersection between the convex shape and the ray.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"transform\">Transform of the convex shape.</param>\n        /// <param name=\"maximumLength\">Maximum distance to travel in units of the ray direction's length.</param>\n        /// <param name=\"hit\">Ray hit data, if any.</param>\n        /// <returns>Whether or not the ray hit the target.</returns>\n        public virtual bool RayTest(ref Ray ray, ref RigidTransform transform, float maximumLength, out RayHit hit)\n        {\n            \n            //RayHit newHit;\n            //bool newBool = GJKToolbox.RayCast(ray, this, ref transform, maximumLength, out newHit);\n            //RayHit oldHit;\n            //bool oldBool = OldGJKVerifier.RayCastGJK(ray.Position, ray.Direction, maximumLength, this, transform, out oldHit.Location, out oldHit.Normal, out oldHit.T);\n            //bool mprBool = MPRToolbox.RayCast(ray, maximumLength, this, ref transform, out hit);\n            ////if (newBool != oldBool || ((newBool && oldBool) && Vector3.DistanceSquared(newHit.Location, hit.Location) > .01f))\n            ////    Debug.WriteLine(\"break.\");\n            //return mprBool;\n\n            //if (GJKToolbox.RayCast(ray, this, ref transform, maximumLength, out hit))\n            //{\n            //    //GJK toolbox doesn't normalize the hit normal; it's unnecessary for some other systems so it just saves on time.\n            //    //It would be nice if ray tests always normalized it though.\n            //    float length = hit.Normal.LengthSquared();\n            //    if (length > Toolbox.Epsilon)\n            //        Vector3.Divide(ref hit.Normal, (float) Math.Sqrt(length), out hit.Normal);\n            //    else\n            //        hit.Normal = new Vector3();\n            //    return true;\n            //}\n\n            //return false;\n\n            return MPRToolbox.RayCast(ray, maximumLength, this, ref transform, out hit);\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.\n        /// </summary>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter()\n        {\n            return InertiaHelper.ComputeCenter(this);\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.  This calculation is often associated with the \n        /// volume calculation, which is given by this method as well.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter(out float volume)\n        {\n            return InertiaHelper.ComputeCenter(this, out volume);\n        }\n\n        /// <summary>\n        /// Computes the volume of the shape.\n        /// </summary>\n        /// <returns>Volume of the shape.</returns>\n        public override float ComputeVolume()\n        {\n            float volume;\n            ComputeVolumeDistribution(out volume);\n            return volume;\n        }\n\n        /// <summary>\n        /// Computes the volume distribution of the shape as well as its volume.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Volume distribution of the shape.</returns>\n        public override Matrix3x3 ComputeVolumeDistribution(out float volume)\n        {\n            return InertiaHelper.ComputeVolumeDistribution(this, out volume);\n        }\n\n        protected override void OnShapeChanged()\n        {\n            minimumRadius = ComputeMinimumRadius();\n            maximumRadius = ComputeMaximumRadius();\n            base.OnShapeChanged();\n        }\n\n        /// <summary>\n        /// Computes the volume distribution of the shape.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <returns>Volume distribution of the shape.</returns>\n        public override Matrix3x3 ComputeVolumeDistribution()\n        {\n            float volume;\n            return ComputeVolumeDistribution(out volume);\n        }\n\n        public override void ComputeDistributionInformation(out ShapeDistributionInformation shapeInfo)\n        {\n            shapeInfo.VolumeDistribution = ComputeVolumeDistribution(out shapeInfo.Volume);\n            shapeInfo.Center = ComputeCenter();\n        }\n\n        /// <summary>\n        /// Computes a bounding box for the shape and expands it.\n        /// </summary>\n        /// <param name=\"transform\">Transform to use to position the shape.</param>\n        /// <param name=\"sweep\">Extra to add to the bounding box.</param>\n        /// <param name=\"boundingBox\">Expanded bounding box.</param>\n        public void GetSweptBoundingBox(ref RigidTransform transform, ref Vector3 sweep, out BoundingBox boundingBox)\n        {\n            GetBoundingBox(ref transform, out boundingBox);\n            Toolbox.ExpandBoundingBox(ref boundingBox, ref sweep);\n\n        }\n\n        /// <summary>\n        /// Gets the bounding box of the convex shape transformed first into world space, and then into the local space of another affine transform.\n        /// </summary>\n        /// <param name=\"shapeTransform\">Transform to use to put the shape into world space.</param>\n        /// <param name=\"spaceTransform\">Used as the frame of reference to compute the bounding box.\n        /// In effect, the shape is transformed by the inverse of the space transform to compute its bounding box in local space.</param>\n        /// <param name=\"sweep\">Vector to expand the bounding box with in local space.</param>\n        /// <param name=\"boundingBox\">Bounding box in the local space.</param>\n        public void GetSweptLocalBoundingBox(ref RigidTransform shapeTransform, ref AffineTransform spaceTransform, ref Vector3 sweep, out BoundingBox boundingBox)\n        {\n            GetLocalBoundingBox(ref shapeTransform, ref spaceTransform, out boundingBox);\n            Vector3 expansion;\n            Matrix3x3.TransformTranspose(ref sweep, ref spaceTransform.LinearTransform, out expansion);\n            Toolbox.ExpandBoundingBox(ref boundingBox, ref expansion);\n        }\n\n        //Transform the convex into the space of something else.\n        /// <summary>\n        /// Gets the bounding box of the convex shape transformed first into world space, and then into the local space of another affine transform.\n        /// </summary>\n        /// <param name=\"shapeTransform\">Transform to use to put the shape into world space.</param>\n        /// <param name=\"spaceTransform\">Used as the frame of reference to compute the bounding box.\n        /// In effect, the shape is transformed by the inverse of the space transform to compute its bounding box in local space.</param>\n        /// <param name=\"boundingBox\">Bounding box in the local space.</param>\n        public void GetLocalBoundingBox(ref RigidTransform shapeTransform, ref AffineTransform spaceTransform, out BoundingBox boundingBox)\n        {\n#if !WINDOWS\n            boundingBox = new BoundingBox();\n#endif\n            //TODO: This method peforms quite a few sqrts because the collision margin can get scaled, and so cannot be applied as a final step.\n            //There should be a better way to do this.\n            //Additionally, this bounding box is not consistent in all cases with the post-add version.  Adding the collision margin at the end can\n            //slightly overestimate the size of a margin expanded shape at the corners, which is fine (and actually important for the box-box special case).\n\n            //Move forward into convex's space, backwards into the new space's local space.\n            AffineTransform transform;\n            AffineTransform.Invert(ref spaceTransform, out transform);\n            AffineTransform.Multiply(ref shapeTransform, ref transform, out transform);\n\n            //Sample the local directions from the orientation matrix, implicitly transposed.\n\n            Vector3 right;\n            var direction = new Vector3(transform.LinearTransform.M11, transform.LinearTransform.M21, transform.LinearTransform.M31);\n            GetLocalExtremePoint(direction, out right);\n\n            Vector3 left;\n            direction = new Vector3(-transform.LinearTransform.M11, -transform.LinearTransform.M21, -transform.LinearTransform.M31);\n            GetLocalExtremePoint(direction, out left);\n\n            Vector3 up;\n            direction = new Vector3(transform.LinearTransform.M12, transform.LinearTransform.M22, transform.LinearTransform.M32);\n            GetLocalExtremePoint(direction, out up);\n\n            Vector3 down;\n            direction = new Vector3(-transform.LinearTransform.M12, -transform.LinearTransform.M22, -transform.LinearTransform.M32);\n            GetLocalExtremePoint(direction, out down);\n\n            Vector3 backward;\n            direction = new Vector3(transform.LinearTransform.M13, transform.LinearTransform.M23, transform.LinearTransform.M33);\n            GetLocalExtremePoint(direction, out backward);\n\n            Vector3 forward;\n            direction = new Vector3(-transform.LinearTransform.M13, -transform.LinearTransform.M23, -transform.LinearTransform.M33);\n            GetLocalExtremePoint(direction, out forward);\n\n\n            //This could be optimized.  Unnecessary transformation information gets computed.\n            Matrix3x3.Transform(ref right, ref transform.LinearTransform, out right);\n            Matrix3x3.Transform(ref left, ref transform.LinearTransform, out left);\n            Matrix3x3.Transform(ref up, ref transform.LinearTransform, out up);\n            Matrix3x3.Transform(ref down, ref transform.LinearTransform, out down);\n            Matrix3x3.Transform(ref backward, ref transform.LinearTransform, out backward);\n            Matrix3x3.Transform(ref forward, ref transform.LinearTransform, out forward);\n\n            //These right/up/backward represent the extreme points in world space along the world space axes.\n            boundingBox.Max.X = transform.Translation.X + right.X;\n            boundingBox.Max.Y = transform.Translation.Y + up.Y;\n            boundingBox.Max.Z = transform.Translation.Z + backward.Z;\n\n            boundingBox.Min.X = transform.Translation.X + left.X;\n            boundingBox.Min.Y = transform.Translation.Y + down.Y;\n            boundingBox.Min.Z = transform.Translation.Z + forward.Z;\n        }\n\n\n        ///<summary>\n        /// Computes the minimum radius of the shape.\n        /// This is often smaller than the actual minimum radius;\n        /// it is simply an approximation that avoids overestimating.\n        ///</summary>\n        ///<returns>Minimum radius of the shape.</returns>\n        public abstract float ComputeMinimumRadius();\n        /// <summary>\n        /// Computes the maximum radius of the shape.\n        /// This is often larger than the actual maximum radius;\n        /// it is simply an approximation that avoids underestimating.\n        /// </summary>\n        /// <returns>Maximum radius of the shape.</returns>\n        public abstract float ComputeMaximumRadius();\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/CylinderShape.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n    ///<summary>\n    /// Symmetrical object with a circular bottom and top.\n    ///</summary>\n    public class CylinderShape : ConvexShape\n    {\n        private float halfHeight;\n        private float radius;\n        ///<summary>\n        /// Constructs a new cylinder shape.\n        ///</summary>\n        ///<param name=\"height\">Height of the cylinder.</param>\n        ///<param name=\"radius\">Radius of the cylinder.</param>\n        public CylinderShape(float height, float radius)\n        {\n            this.halfHeight = height * .5f;\n            Radius = radius;\n        }\n\n        ///<summary>\n        /// Gets or sets the radius of the cylinder.\n        ///</summary>\n        public float Radius { get { return radius; } set { radius = value; OnShapeChanged(); } }\n        ///<summary>\n        /// Gets or sets the height of the cylinder.\n        ///</summary>\n        public float Height { get { return halfHeight * 2; } set { halfHeight = value / 2; OnShapeChanged(); } }\n\n        /// <summary>\n        /// Gets the bounding box of the shape given a transform.\n        /// </summary>\n        /// <param name=\"shapeTransform\">Transform to use.</param>\n        /// <param name=\"boundingBox\">Bounding box of the transformed shape.</param>\n        public override void GetBoundingBox(ref RigidTransform shapeTransform, out BoundingBox boundingBox)\n        {\n#if !WINDOWS\n            boundingBox = new BoundingBox();\n#endif\n\n\n            Matrix3x3 o;\n            Matrix3x3.CreateFromQuaternion(ref shapeTransform.Orientation, out o);\n            //Sample the local directions from the orientation matrix, implicitly transposed.\n            //Notice only three directions are used.  Due to box symmetry, 'left' is just -right.\n            var direction = new Vector3(o.M11, o.M21, o.M31);\n            Vector3 right;\n            GetLocalExtremePointWithoutMargin(ref direction, out right);\n\n            direction = new Vector3(o.M12, o.M22, o.M32);\n            Vector3 up;\n            GetLocalExtremePointWithoutMargin(ref direction, out up);\n\n            direction = new Vector3(o.M13, o.M23, o.M33);\n            Vector3 backward;\n            GetLocalExtremePointWithoutMargin(ref direction, out backward);\n\n            Matrix3x3.Transform(ref right, ref o, out right);\n            Matrix3x3.Transform(ref up, ref o, out up);\n            Matrix3x3.Transform(ref backward, ref o, out backward);\n            //These right/up/backward represent the extreme points in world space along the world space axes.\n\n            boundingBox.Max.X = shapeTransform.Position.X + collisionMargin + right.X;\n            boundingBox.Max.Y = shapeTransform.Position.Y + collisionMargin + up.Y;\n            boundingBox.Max.Z = shapeTransform.Position.Z + collisionMargin + backward.Z;\n\n            boundingBox.Min.X = shapeTransform.Position.X - collisionMargin - right.X;\n            boundingBox.Min.Y = shapeTransform.Position.Y - collisionMargin - up.Y;\n            boundingBox.Min.Z = shapeTransform.Position.Z - collisionMargin - backward.Z;\n        }\n\n\n        ///<summary>\n        /// Gets the extreme point of the shape in local space in a given direction.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)\n        {\n            float horizontalLengthSquared = direction.X * direction.X + direction.Z * direction.Z;\n            if (horizontalLengthSquared > Toolbox.Epsilon)\n            {\n                float multiplier = (radius - collisionMargin) / (float)Math.Sqrt(horizontalLengthSquared);\n                extremePoint = new Vector3(direction.X * multiplier, Math.Sign(direction.Y) * (halfHeight - collisionMargin), direction.Z * multiplier);\n            }\n            else\n            {\n                extremePoint = new Vector3(0, Math.Sign(direction.Y) * (halfHeight - collisionMargin), 0);\n            }\n\n        }\n\n        /// <summary>\n        /// Computes the maximum radius of the shape.\n        /// This is often larger than the actual maximum radius;\n        /// it is simply an approximation that avoids underestimating.\n        /// </summary>\n        /// <returns>Maximum radius of the shape.</returns>\n        public override float ComputeMaximumRadius()\n        {\n            return (float)Math.Sqrt(radius * radius + halfHeight * halfHeight);\n        }\n\n        ///<summary>\n        /// Computes the minimum radius of the shape.\n        /// This is often smaller than the actual minimum radius;\n        /// it is simply an approximation that avoids overestimating.\n        ///</summary>\n        ///<returns>Minimum radius of the shape.</returns>\n        public override float ComputeMinimumRadius()\n        {\n            return Math.Min(radius, halfHeight);\n        }\n\n        /// <summary>\n        /// Computes the volume distribution of the shape as well as its volume.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Volume distribution of the shape.</returns>\n        public override Matrix3x3 ComputeVolumeDistribution(out float volume)\n        {\n            volume = ComputeVolume();\n\n            var volumeDistribution = new Matrix3x3();\n\n            float diagValue = (.0833333333f * Height * Height + .25f * Radius * Radius);\n            volumeDistribution.M11 = diagValue;\n            volumeDistribution.M22 = .5f * Radius * Radius;\n            volumeDistribution.M33 = diagValue;\n\n            return volumeDistribution;\n        }\n\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.\n        /// </summary>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter()\n        {\n            return Vector3.Zero;\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.  This calculation is often associated with the \n        /// volume calculation, which is given by this method as well.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter(out float volume)\n        {\n            volume = ComputeVolume();\n            return ComputeCenter();\n        }\n\n        /// <summary>\n        /// Computes the volume of the shape.\n        /// </summary>\n        /// <returns>Volume of the shape.</returns>\n        public override float ComputeVolume()\n        {\n            return (float)(Math.PI * Radius * Radius * Height);\n        }\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new ConvexCollidable<CylinderShape>(this);\n        }\n\n        /// <summary>\n        /// Gets the intersection between the convex shape and the ray.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"transform\">Transform of the convex shape.</param>\n        /// <param name=\"maximumLength\">Maximum distance to travel in units of the ray direction's length.</param>\n        /// <param name=\"hit\">Ray hit data, if any.</param>\n        /// <returns>Whether or not the ray hit the target.</returns>\n        public override bool RayTest(ref Ray ray, ref RigidTransform transform, float maximumLength, out RayHit hit)\n        {\n            //Put the ray into local space.\n            Quaternion conjugate;\n            Quaternion.Conjugate(ref transform.Orientation, out conjugate);\n            Ray localRay;\n            Vector3.Subtract(ref ray.Position, ref transform.Position, out localRay.Position);\n            Vector3.Transform(ref localRay.Position, ref conjugate, out localRay.Position);\n            Vector3.Transform(ref ray.Direction, ref conjugate, out localRay.Direction);\n\n            //Check for containment.\n            if (localRay.Position.Y >= -halfHeight && localRay.Position.Y <= halfHeight && localRay.Position.X * localRay.Position.X + localRay.Position.Z * localRay.Position.Z <= radius * radius)\n            {\n                //It's inside!\n                hit.T = 0;\n                hit.Location = localRay.Position;\n                hit.Normal = new Vector3(hit.Location.X, 0, hit.Location.Z);\n                float normalLengthSquared = hit.Normal.LengthSquared();\n                if (normalLengthSquared > 1e-9f)\n                    Vector3.Divide(ref hit.Normal, (float)Math.Sqrt(normalLengthSquared), out hit.Normal);\n                else\n                    hit.Normal = new Vector3();\n                //Pull the hit into world space.\n                Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n                RigidTransform.Transform(ref hit.Location, ref transform, out hit.Location);\n                return true;\n            }\n\n            //Project the ray direction onto the plane where the cylinder is a circle.\n            //The projected ray is then tested against the circle to compute the time of impact.\n            //That time of impact is used to compute the 3d hit location.\n            Vector2 planeDirection = new Vector2(localRay.Direction.X, localRay.Direction.Z);\n            float planeDirectionLengthSquared = planeDirection.LengthSquared();\n\n            if (planeDirectionLengthSquared < Toolbox.Epsilon)\n            {\n                //The ray is nearly parallel with the axis.\n                //Skip the cylinder-sides test.  We're either inside the cylinder and won't hit the sides, or we're outside\n                //and won't hit the sides.  \n                if (localRay.Position.Y > halfHeight)\n                    goto upperTest;\n                if (localRay.Position.Y < -halfHeight)\n                    goto lowerTest;\n\n\n                hit = new RayHit();\n                return false;\n\n            }\n            Vector2 planeOrigin = new Vector2(localRay.Position.X, localRay.Position.Z);\n            float dot;\n            Vector2.Dot(ref planeDirection, ref planeOrigin, out dot);\n            float closestToCenterT = -dot / planeDirectionLengthSquared;\n\n            Vector2 closestPoint;\n            Vector2.Multiply(ref planeDirection, closestToCenterT, out closestPoint);\n            Vector2.Add(ref planeOrigin, ref closestPoint, out closestPoint);\n            //How close does the ray come to the circle?\n            float squaredDistance = closestPoint.LengthSquared();\n            if (squaredDistance > radius * radius)\n            {\n                //It's too far!  The ray cannot possibly hit the capsule.\n                hit = new RayHit();\n                return false;\n            }\n\n\n\n            //With the squared distance, compute the distance backward along the ray from the closest point on the ray to the axis.\n            float backwardsDistance = radius * (float)Math.Sqrt(1 - squaredDistance / (radius * radius));\n            float tOffset = backwardsDistance / (float)Math.Sqrt(planeDirectionLengthSquared);\n\n            hit.T = closestToCenterT - tOffset;\n\n            //Compute the impact point on the infinite cylinder in 3d local space.\n            Vector3.Multiply(ref localRay.Direction, hit.T, out hit.Location);\n            Vector3.Add(ref hit.Location, ref localRay.Position, out hit.Location);\n\n            //Is it intersecting the cylindrical portion of the capsule?\n            if (hit.Location.Y <= halfHeight && hit.Location.Y >= -halfHeight && hit.T < maximumLength)\n            {\n                //Yup!\n                hit.Normal = new Vector3(hit.Location.X, 0, hit.Location.Z);\n                float normalLengthSquared = hit.Normal.LengthSquared();\n                if (normalLengthSquared > 1e-9f)\n                    Vector3.Divide(ref hit.Normal, (float)Math.Sqrt(normalLengthSquared), out hit.Normal);\n                else\n                    hit.Normal = new Vector3();\n                //Pull the hit into world space.\n                Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n                RigidTransform.Transform(ref hit.Location, ref transform, out hit.Location);\n                return true;\n            }\n\n            if (hit.Location.Y < halfHeight)\n                goto lowerTest;\n        upperTest:\n            //Nope! It may be intersecting the ends of the cylinder though.\n            //We're above the cylinder, so cast a ray against the upper cap.\n            if (localRay.Direction.Y > -1e-9)\n            {\n                //Can't hit the upper cap if the ray isn't pointing down.\n                hit = new RayHit();\n                return false;\n            }\n            float t = (halfHeight - localRay.Position.Y) / localRay.Direction.Y;\n            Vector3 planeIntersection;\n            Vector3.Multiply(ref localRay.Direction, t, out planeIntersection);\n            Vector3.Add(ref localRay.Position, ref planeIntersection, out planeIntersection);\n            if(planeIntersection.X * planeIntersection.X + planeIntersection.Z * planeIntersection.Z < radius * radius + 1e-9 && t < maximumLength)\n            {\n                //Pull the hit into world space.\n                Vector3.Transform(ref Toolbox.UpVector, ref transform.Orientation, out hit.Normal);\n                RigidTransform.Transform(ref planeIntersection, ref transform, out hit.Location);\n                hit.T = t;\n                return true;\n            }\n            //No intersection! We can't be hitting the other sphere, so it's over!\n            hit = new RayHit();\n            return false;\n\n        lowerTest:\n            //Is it intersecting the bottom cap?\n            if (localRay.Direction.Y < 1e-9)\n            {\n                //Can't hit the bottom cap if the ray isn't pointing up.\n                hit = new RayHit();\n                return false;\n            }\n            t = (-halfHeight - localRay.Position.Y) / localRay.Direction.Y;\n            Vector3.Multiply(ref localRay.Direction, t, out planeIntersection);\n            Vector3.Add(ref localRay.Position, ref planeIntersection, out planeIntersection);\n            if (planeIntersection.X * planeIntersection.X + planeIntersection.Z * planeIntersection.Z < radius * radius + 1e-9 && t < maximumLength)\n            {\n                //Pull the hit into world space.\n                Vector3.Transform(ref Toolbox.DownVector, ref transform.Orientation, out hit.Normal);\n                RigidTransform.Transform(ref planeIntersection, ref transform, out hit.Location);\n                hit.T = t;\n                return true;\n            }\n            //No intersection! We can't be hitting the other sphere, so it's over!\n            hit = new RayHit();\n            return false;\n\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/InertiaHelper.cs",
    "content": "﻿using BEPUutilities;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n    ///<summary>\n    /// Helper class used to compute volume distribution information, which is in turn used to compute inertia tensor information.\n    ///</summary>\n    public class InertiaHelper\n    {\n        /// <summary>\n        /// Value to scale any created entities' inertia tensors by.\n        /// Larger tensors (above 1) improve stiffness of constraints and contacts, while smaller values (towards 1) are closer to 'realistic' behavior.\n        /// Defaults to 2.5.\n        /// </summary>\n        public static float InertiaTensorScale = 2.5f;\n\n        ///<summary>\n        /// Number of samples the system takes along a side of an object's AABB when voxelizing it.\n        ///</summary>\n        public static int NumberOfSamplesPerDimension = 10;\n\n        ///<summary>\n        /// Computes the center of a convex shape.\n        ///</summary>\n        ///<param name=\"shape\">Shape to compute the center of.</param>\n        ///<returns>Center of the shape.</returns>\n        public static Vector3 ComputeCenter(ConvexShape shape)\n        {\n            float volume;\n            return ComputeCenter(shape, out volume);\n        }\n\n        ///<summary>\n        /// Computes the center and volume of a convex shape.\n        ///</summary>\n        ///<param name=\"shape\">Shape to compute the center of.</param>\n        ///<param name=\"volume\">Volume of the shape.</param>\n        ///<returns>Center of the shape.</returns>\n        public static Vector3 ComputeCenter(ConvexShape shape, out float volume)\n        {\n            var pointContributions = CommonResources.GetVectorList();\n            GetPoints(shape, out volume, pointContributions);\n            Vector3 center = AveragePoints(pointContributions);\n            CommonResources.GiveBack(pointContributions);\n            MathChecker.Validate(center);\n            return center;\n        }\n\n        ///<summary>\n        /// Averages together all the points in the point list.\n        ///</summary>\n        ///<param name=\"pointContributions\">Point list to average.</param>\n        ///<returns>Averaged point.</returns>\n        public static Vector3 AveragePoints(RawList<Vector3> pointContributions)\n        {\n            var center = new Vector3();\n            for (int i = 0; i < pointContributions.Count; i++)\n            {\n                center += pointContributions[i]; //Every point has equal weight.\n            }\n            return center / pointContributions.Count;\n        }\n\n        ///<summary>\n        /// Computes the volume and volume distribution of a shape.\n        ///</summary>\n        ///<param name=\"shape\">Shape to compute the volume information of.</param>\n        ///<param name=\"volume\">Volume of the shape.</param>\n        ///<returns>Volume distribution of the shape.</returns>\n        public static Matrix3x3 ComputeVolumeDistribution(ConvexShape shape, out float volume)\n        {\n            var pointContributions = CommonResources.GetVectorList();\n            GetPoints(shape, out volume, pointContributions);\n            Vector3 center = AveragePoints(pointContributions);\n            Matrix3x3 volumeDistribution = ComputeVolumeDistribution(pointContributions, ref center);\n            CommonResources.GiveBack(pointContributions);\n            return volumeDistribution;\n        }\n\n        \n        ///<summary>\n        /// Computes the volume and volume distribution of a shape based on a given center.\n        ///</summary>\n        ///<param name=\"shape\">Shape to compute the volume information of.</param>\n        ///<param name=\"center\">Location to use as the center of the shape when computing the volume distribution.</param>\n        ///<param name=\"volume\">Volume of the shape.</param>\n        ///<returns>Volume distribution of the shape.</returns>\n        public static Matrix3x3 ComputeVolumeDistribution(ConvexShape shape, ref Vector3 center, out float volume)\n        {\n            var pointContributions = CommonResources.GetVectorList();\n            GetPoints(shape, out volume, pointContributions);\n            Matrix3x3 volumeDistribution = ComputeVolumeDistribution(pointContributions, ref center);\n            CommonResources.GiveBack(pointContributions);\n            return volumeDistribution;\n        }\n\n        ///<summary>\n        /// Computes a volume distribution based on a bunch of point contributions.\n        ///</summary>\n        ///<param name=\"pointContributions\">Point contributions to the volume distribution.</param>\n        ///<param name=\"center\">Location to use as the center for purposes of computing point contributions.</param>\n        ///<returns>Volume distribution of the point contributions.</returns>\n        public static Matrix3x3 ComputeVolumeDistribution(RawList<Vector3> pointContributions, ref Vector3 center)\n        {\n            var volumeDistribution = new Matrix3x3();\n            float pointWeight = 1f / pointContributions.Count;\n            for (int i = 0; i < pointContributions.Count; i++)\n            {\n                Matrix3x3 contribution;\n                GetPointContribution(pointWeight, ref center, pointContributions[i], out contribution);\n                Matrix3x3.Add(ref volumeDistribution, ref contribution, out volumeDistribution);\n            }\n            return volumeDistribution;\n        }\n\n\n\n        ///<summary>\n        /// Gets the point contributions within a convex shape.\n        ///</summary>\n        ///<param name=\"shape\">Shape to compute the point contributions of.</param>\n        ///<param name=\"volume\">Volume of the shape.</param>\n        ///<param name=\"outputPointContributions\">Point contributions of the shape.</param>\n        public static void GetPoints(ConvexShape shape, out float volume, RawList<Vector3> outputPointContributions)\n        {\n            RigidTransform transform = RigidTransform.Identity;\n            BoundingBox boundingBox;\n            shape.GetBoundingBox(ref transform, out boundingBox);\n\n            //Find the direction which maximizes the possible hits.  Generally, this is the smallest area axis.\n            //Possible options are:\n            //YZ -> use X\n            //XZ -> use Y\n            //XY -> use Z\n            Ray ray;\n            float width = boundingBox.Max.X - boundingBox.Min.X;\n            float height = boundingBox.Max.Y - boundingBox.Min.Y;\n            float length = boundingBox.Max.Z - boundingBox.Min.Z;\n            float yzArea = height * length;\n            float xzArea = width * length;\n            float xyArea = width * height;\n            Vector3 increment1, increment2;\n            float incrementMultiplier = 1f / NumberOfSamplesPerDimension;\n            float maxLength;\n            float rayIncrement;\n            if (yzArea > xzArea && yzArea > xyArea)\n            {\n                //use the x axis as the direction.\n                ray.Direction = Vector3.Right;\n                ray.Position = new Vector3(boundingBox.Min.X, boundingBox.Min.Y + .5f * incrementMultiplier * height, boundingBox.Min.Z + .5f * incrementMultiplier * length);\n                increment1 = new Vector3(0, incrementMultiplier * height, 0);\n                increment2 = new Vector3(0, 0, incrementMultiplier * length);\n                rayIncrement = incrementMultiplier * width;\n                maxLength = width;\n            }\n            else if (xzArea > xyArea) //yz is not the max, given by the previous if.  Is xz or xy the max?\n            {\n                //use the y axis as the direction.\n                ray.Direction = Vector3.Up;\n                ray.Position = new Vector3(boundingBox.Min.X + .5f * incrementMultiplier * width, boundingBox.Min.Y, boundingBox.Min.Z + .5f * incrementMultiplier * length);\n                increment1 = new Vector3(incrementMultiplier * width, 0, 0);\n                increment2 = new Vector3(0, 0, incrementMultiplier * height);\n                rayIncrement = incrementMultiplier * height;\n                maxLength = height;\n            }\n            else\n            {\n                //use the z axis as the direction.\n                ray.Direction = Vector3.Backward;\n                ray.Position = new Vector3(boundingBox.Min.X + .5f * incrementMultiplier * width, boundingBox.Min.Y + .5f * incrementMultiplier * height, boundingBox.Min.Z);\n                increment1 = new Vector3(incrementMultiplier * width, 0, 0);\n                increment2 = new Vector3(0, incrementMultiplier * height, 0);\n                rayIncrement = incrementMultiplier * length;\n                maxLength = length;\n            }\n\n\n            Ray oppositeRay;\n            volume = 0;\n            for (int i = 0; i < NumberOfSamplesPerDimension; i++)\n            {\n                for (int j = 0; j < NumberOfSamplesPerDimension; j++)\n                {\n                    //Ray cast from one direction.  If it succeeds, try the other way.  This forms an interval in which inertia tensor contributions are contained.\n                    RayHit hit;\n                    if (shape.RayTest(ref ray, ref transform, maxLength, out hit))\n                    {\n                        Vector3.Multiply(ref ray.Direction, maxLength, out oppositeRay.Position);\n                        Vector3.Add(ref oppositeRay.Position, ref ray.Position, out oppositeRay.Position);\n                        Vector3.Negate(ref ray.Direction, out oppositeRay.Direction);\n                        RayHit oppositeHit;\n                        if (shape.RayTest(ref oppositeRay, ref transform, maxLength, out oppositeHit))\n                        {\n                            //It should always get here if one direction casts, but there may be numerical issues.\n                            float scanVolume;\n                            ScanObject(rayIncrement, maxLength, ref increment1, ref increment2, ref ray, ref hit, ref oppositeHit, outputPointContributions, out scanVolume);\n                            volume += scanVolume;\n                        }\n                    }\n                    Vector3.Add(ref ray.Position, ref increment2, out ray.Position);\n                }\n                Vector3.Add(ref ray.Position, ref increment1, out ray.Position);\n                //Move the ray back to the starting position along the other axis.\n                Vector3 subtract;\n                Vector3.Multiply(ref increment2, NumberOfSamplesPerDimension, out subtract);\n                Vector3.Subtract(ref ray.Position, ref subtract, out ray.Position);\n            }\n\n\n        }\n\n\n\n        private static void ScanObject(float rayIncrement, float maxLength, ref Vector3 increment1, ref Vector3 increment2, ref Ray ray, ref RayHit startHit, ref RayHit endHit, RawList<Vector3> pointContributions, out float volume)\n        {\n            Vector3 cell;\n            Vector3.Multiply(ref ray.Direction, rayIncrement, out cell);\n            Vector3.Add(ref increment1, ref cell, out cell);\n            Vector3.Add(ref increment2, ref cell, out cell);\n            float perCellVolume = cell.X * cell.Y * cell.Z;\n\n            volume = 0;\n\n            for (int i = (int)(startHit.T / rayIncrement); i <= (int)((maxLength - endHit.T) / rayIncrement); i++)\n            {\n                Vector3 position;\n                Vector3.Multiply(ref ray.Direction, (i + .5f) * rayIncrement, out position);\n                Vector3.Add(ref position, ref ray.Position, out position);\n                pointContributions.Add(position);\n                volume += perCellVolume;\n            }\n        }\n\n\n\n        ///<summary>\n        /// Computes the volume contribution of a point.\n        ///</summary>\n        ///<param name=\"pointWeight\">Weight of the point.</param>\n        ///<param name=\"center\">Location to use as the center for the purposes of computing the contribution.</param>\n        ///<param name=\"p\">Point to compute the contribution of.</param>\n        ///<param name=\"contribution\">Contribution of the point.</param>\n        public static void GetPointContribution(float pointWeight, ref Vector3 center, Vector3 p, out Matrix3x3 contribution)\n        {\n            Vector3.Subtract(ref p, ref center, out p);\n            float xx = pointWeight * p.X * p.X;\n            float yy = pointWeight * p.Y * p.Y;\n            float zz = pointWeight * p.Z * p.Z;\n            contribution.M11 = yy + zz;\n            contribution.M22 = xx + zz;\n            contribution.M33 = xx + yy;\n            contribution.M12 = -pointWeight * p.X * p.Y;\n            contribution.M13 = -pointWeight * p.X * p.Z;\n            contribution.M23 = -pointWeight * p.Y * p.Z;\n            contribution.M21 = contribution.M12;\n            contribution.M31 = contribution.M13;\n            contribution.M32 = contribution.M23;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/MinkowskiSumShape.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n    ///<summary>\n    /// A shape associated with an orientation.\n    ///</summary>\n    public struct OrientedConvexShapeEntry\n    {\n        ///<summary>\n        /// The entry's shape.\n        ///</summary>\n        public ConvexShape CollisionShape;\n        ///<summary>\n        /// The entry's orientation.\n        ///</summary>\n        public Quaternion Orientation;\n\n        ///<summary>\n        /// Constructs a new entry.\n        ///</summary>\n        ///<param name=\"orientation\">Orientation of the entry.</param>\n        ///<param name=\"shape\">Shape of the entry.</param>\n        public OrientedConvexShapeEntry(Quaternion orientation, ConvexShape shape)\n        {\n            Orientation = orientation;\n            CollisionShape = shape;\n        }\n\n        ///<summary>\n        /// Constructs a new entry with identity orientation.\n        ///</summary>\n        ///<param name=\"shape\">Shape of the entry.</param>\n        public OrientedConvexShapeEntry(ConvexShape shape)\n        {\n            Orientation = Quaternion.Identity;\n            CollisionShape = shape;\n        }\n    }\n    ///<summary>\n    /// A shape composed of the pointwise summation of all points in child shapes.\n    /// For example, the minkowski sum of two spheres would be a sphere with the radius of both spheres combined.\n    /// The minkowski sum of a box and a sphere would be a rounded box.\n    ///</summary>\n    public class MinkowskiSumShape : ConvexShape\n    {\n        ObservableList<OrientedConvexShapeEntry> shapes = new ObservableList<OrientedConvexShapeEntry>();\n        ///<summary>\n        /// Gets the list of shapes in the minkowski sum.\n        ///</summary>\n        public ObservableList<OrientedConvexShapeEntry> Shapes\n        {\n            get\n            {\n                return shapes;\n            }\n        }\n\n        //Local offset is needed to ensure that the minkowski sum is centered on the local origin.\n        Vector3 localOffset;\n        ///<summary>\n        /// Gets the local offset of the elements in the minkowski sum.\n        /// This is required because convex shapes need to be centered on their local origin.\n        ///</summary>\n        public Vector3 LocalOffset\n        {\n            get\n            {\n                return localOffset;\n            }\n        }\n\n        /// <summary>\n        /// Constructs a minkowski sum shape.\n        /// A minkowski sum can be created from more than two objects; use the other constructors.\n        /// The sum will be recentered on its local origin.\n        /// </summary>\n        /// <param name=\"firstShape\">First entry in the sum.</param>\n        /// <param name=\"secondShape\">Second entry in the sum.</param>\n        /// <param name=\"center\">Center of the minkowski sum computed pre-recentering.</param>\n        public MinkowskiSumShape(OrientedConvexShapeEntry firstShape, OrientedConvexShapeEntry secondShape, out Vector3 center)\n            : this(firstShape, secondShape)\n        {\n            center = -localOffset;\n        }\n\n        /// <summary>\n        /// Constructs a minkowski sum shape.\n        /// The sum will be recentered on its local origin.\n        /// </summary>\n        /// <param name=\"shapeEntries\">Entries composing the minkowski sum.</param>\n        /// <param name=\"center\">Center of the minkowski sum computed pre-recentering.</param>\n        public MinkowskiSumShape(IList<OrientedConvexShapeEntry> shapeEntries, out Vector3 center)\n            : this(shapeEntries)\n        {\n            center = -localOffset;\n        }\n\n        /// <summary>\n        /// Constructs a minkowski sum shape.\n        /// A minkowski sum can be created from more than two objects; use the other constructors.\n        /// The sum will be recentered on its local origin.  The computed center is outputted by the other constructor.\n        /// </summary>\n        /// <param name=\"firstShape\">First entry in the sum.</param>\n        /// <param name=\"secondShape\">Second entry in the sum.</param>\n        public MinkowskiSumShape(OrientedConvexShapeEntry firstShape, OrientedConvexShapeEntry secondShape)\n        {\n            shapes.Add(firstShape);\n            shapes.Add(secondShape);\n            shapes.Changed += ShapesChanged;\n            OnShapeChanged();\n            localOffset = -ComputeCenter();\n        }\n\n        /// <summary>\n        /// Constructs a minkowski sum shape.\n        /// The sum will be recentered on its local origin.  The computed center is outputted by the other constructor.\n        /// </summary>\n        /// <param name=\"shapeEntries\">Entries composing the minkowski sum.</param>\n        public MinkowskiSumShape(IList<OrientedConvexShapeEntry> shapeEntries)\n        {\n            if (shapeEntries.Count == 0)\n                throw new ArgumentException(\"Cannot create a wrapped shape with no contained shapes.\");\n            for (int i = 0; i < shapeEntries.Count; i++)\n            {\n                shapes.Add(shapeEntries[i]);\n            }\n            shapes.Changed += ShapesChanged;\n            OnShapeChanged();\n            localOffset = -ComputeCenter();\n        }\n\n        void ShapesChanged(ObservableList<OrientedConvexShapeEntry> list)\n        {\n            OnShapeChanged();\n            //Computing the center uses extreme point calculations.\n            //Extreme point calculations make use of the localOffset.\n            //So, set the local offset to zero before doing the computation.\n            //The new offset is then computed.\n            localOffset = new Vector3();\n            localOffset = -ComputeCenter();\n        }\n\n\n        ///<summary>\n        /// Gets the extreme point of the shape in local space in a given direction.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)\n        {\n            var transform = new RigidTransform { Orientation = shapes.WrappedList.Elements[0].Orientation };\n            shapes.WrappedList.Elements[0].CollisionShape.GetExtremePoint(direction, ref transform, out extremePoint);\n            for (int i = 1; i < shapes.WrappedList.Count; i++)\n            {\n                Vector3 temp;\n                transform.Orientation = shapes.WrappedList.Elements[i].Orientation;\n                shapes.WrappedList.Elements[i].CollisionShape.GetExtremePoint(direction, ref transform, out temp);\n                Vector3.Add(ref extremePoint, ref temp, out extremePoint);\n            }\n            Vector3.Add(ref extremePoint, ref localOffset, out extremePoint);\n        }\n\n        ///<summary>\n        /// Computes the minimum radius of the shape.\n        /// This is often smaller than the actual minimum radius;\n        /// it is simply an approximation that avoids overestimating.\n        ///</summary>\n        ///<returns>Minimum radius of the shape.</returns>\n        public override float ComputeMinimumRadius()\n        {\n            float minRadius = 0;\n            for (int i = 0; i < shapes.Count; i++)\n            {\n                minRadius += shapes.WrappedList.Elements[i].CollisionShape.ComputeMinimumRadius();\n            }\n            return minRadius + collisionMargin;\n        }\n\n\n        /// <summary>\n        /// Computes the maximum radius of the shape.\n        /// This is often larger than the actual maximum radius;\n        /// it is simply an approximation that avoids underestimating.\n        /// </summary>\n        /// <returns>Maximum radius of the shape.</returns>\n        public override float ComputeMaximumRadius()\n        {\n            //This can overestimate the actual maximum radius, but such is the defined behavior of the ComputeMaximumRadius function.  It's not exact; it's an upper bound on the actual maximum.\n            float maxRadius = 0;\n            for (int i = 0; i < shapes.Count; i++)\n            {\n                maxRadius += shapes.WrappedList.Elements[i].CollisionShape.ComputeMaximumRadius();\n            }\n            return maxRadius + collisionMargin;\n        }\n\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new ConvexCollidable<MinkowskiSumShape>(this);\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/SphereShape.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n    ///<summary>\n    /// Ball-like shape.\n    ///</summary>\n    public class SphereShape : ConvexShape\n    {\n        ///<summary>\n        /// Constructs a new sphere shape.\n        ///</summary>\n        ///<param name=\"radius\">Radius of the sphere.</param>\n        public SphereShape(float radius)\n        {\n            Radius = radius;\n        }\n\n        //This is a convenience method.  People expect to see a 'radius' of some kind.\n        ///<summary>\n        /// Gets or sets the radius of the sphere.\n        ///</summary>\n        public float Radius { get { return collisionMargin; } set { CollisionMargin = value; } }\n\n        /// <summary>\n        /// Gets the bounding box of the shape given a transform.\n        /// </summary>\n        /// <param name=\"shapeTransform\">Transform to use.</param>\n        /// <param name=\"boundingBox\">Bounding box of the transformed shape.</param>\n        public override void GetBoundingBox(ref RigidTransform shapeTransform, out BoundingBox boundingBox)\n        {\n#if !WINDOWS\n            boundingBox = new BoundingBox();\n#endif\n            boundingBox.Min.X = shapeTransform.Position.X - collisionMargin;\n            boundingBox.Min.Y = shapeTransform.Position.Y - collisionMargin;\n            boundingBox.Min.Z = shapeTransform.Position.Z - collisionMargin;\n            boundingBox.Max.X = shapeTransform.Position.X + collisionMargin;\n            boundingBox.Max.Y = shapeTransform.Position.Y + collisionMargin;\n            boundingBox.Max.Z = shapeTransform.Position.Z + collisionMargin;\n        }\n\n\n        //TODO: Could do a little optimizing.  If the methods were virtual, could override and save a conjugate/transform.\n        ///<summary>\n        /// Gets the extreme point of the shape in local space in a given direction.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)\n        {\n            extremePoint = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Computes the maximum radius of the shape.\n        /// This is often larger than the actual maximum radius;\n        /// it is simply an approximation that avoids underestimating.\n        /// </summary>\n        /// <returns>Maximum radius of the shape.</returns>\n        public override float ComputeMaximumRadius()\n        {\n            return Radius;\n        }\n\n        ///<summary>\n        /// Computes the minimum radius of the shape.\n        /// This is often smaller than the actual minimum radius;\n        /// it is simply an approximation that avoids overestimating.\n        ///</summary>\n        ///<returns>Minimum radius of the shape.</returns>\n        public override float ComputeMinimumRadius()\n        {\n            return Radius;\n        }\n\n        /// <summary>\n        /// Computes the volume distribution of the shape as well as its volume.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Volume distribution of the shape.</returns>\n        public override Matrix3x3 ComputeVolumeDistribution(out float volume)\n        {\n            var volumeDistribution = new Matrix3x3();\n            float diagValue = ((2f / 5f) * Radius * Radius);\n            volumeDistribution.M11 = diagValue;\n            volumeDistribution.M22 = diagValue;\n            volumeDistribution.M33 = diagValue;\n\n            volume = ComputeVolume();\n            return volumeDistribution;\n        }\n\n\n        /// <summary>\n        /// Gets the intersection between the sphere and the ray.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test against the sphere.</param>\n        /// <param name=\"transform\">Transform applied to the convex for the test.</param>\n        /// <param name=\"maximumLength\">Maximum distance to travel in units of the ray direction's length.</param>\n        /// <param name=\"hit\">Ray hit data, if any.</param>\n        /// <returns>Whether or not the ray hit the target.</returns>\n        public override bool RayTest(ref Ray ray, ref RigidTransform transform, float maximumLength, out RayHit hit)\n        {\n            return Toolbox.RayCastSphere(ref ray, ref transform.Position, collisionMargin, maximumLength, out hit);\n            //Vector3 normalizedDirection;\n            //float length = ray.Direction.Length();\n            //Vector3.Divide(ref ray.Direction, length, out normalizedDirection);\n            //maximumLength *= length;\n            //hit = new RayHit();\n            //Vector3 m;\n            //Vector3.Subtract(ref ray.Position, ref transform.Position, out m);\n            //float b = Vector3.Dot(m, normalizedDirection);\n            //float c = m.LengthSquared() - collisionMargin * collisionMargin;\n\n            //if (c > 0 && b > 0)\n            //    return false;\n            //float discriminant = b * b - c;\n            //if (discriminant < 0)\n            //    return false;\n\n            //hit.T = -b - (float)Math.Sqrt(discriminant);\n            //if (hit.T < 0)\n            //    hit.T = 0;\n            //if (hit.T > maximumLength)\n            //    return false;\n            //Vector3.Multiply(ref normalizedDirection, hit.T, out hit.Location);\n            //Vector3.Add(ref hit.Location, ref ray.Position, out hit.Location);\n            //Vector3.Subtract(ref hit.Location, ref transform.Position, out hit.Normal);\n            //hit.Normal.Normalize();\n            //return true;\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.\n        /// </summary>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter()\n        {\n            return Vector3.Zero;\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.  This calculation is often associated with the \n        /// volume calculation, which is given by this method as well.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter(out float volume)\n        {\n            volume = ComputeVolume();\n            return ComputeCenter();\n        }\n\n        /// <summary>\n        /// Computes the volume of the shape.\n        /// </summary>\n        /// <returns>Volume of the shape.</returns>\n        public override float ComputeVolume()\n        {\n            return (float)(1.333333 * Math.PI * Radius * Radius * Radius);\n        }\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new ConvexCollidable<SphereShape>(this);\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/TransformableShape.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n\n    ///<summary>\n    /// Shape which can take any convex shape and use a linear transform to shear, scale, and rotate it.\n    ///</summary>\n    public class TransformableShape : ConvexShape\n    {\n        protected ConvexShape shape;\n        ///<summary>\n        /// Gets or sets the convex shape to be transformed.\n        ///</summary>\n        public ConvexShape Shape\n        {\n            get\n            {\n                return shape;\n            }\n            set\n            {\n                shape = value;\n                OnShapeChanged();\n            }\n        }\n\n        protected Matrix3x3 transform;\n        ///<summary>\n        /// Gets or sets the linear transform used to transform the convex shape.\n        ///</summary>\n        public Matrix3x3 Transform\n        {\n            get\n            {\n                return transform;\n            }\n            set\n            {\n                transform = value;\n                OnShapeChanged();\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new transformable shape.\n        ///</summary>\n        ///<param name=\"shape\">Base shape to transform.</param>\n        ///<param name=\"transform\">Transform to use.</param>\n        public TransformableShape(ConvexShape shape, Matrix3x3 transform)\n        {\n            this.shape = shape;\n            Transform = transform;\n\n        }\n\n\n        ///<summary>\n        /// Gets the extreme point of the shape in local space in a given direction.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)\n        {\n            Vector3 d;\n            Matrix3x3.TransformTranspose(ref direction, ref transform, out d);\n            shape.GetLocalExtremePoint(d, out extremePoint);\n            Matrix3x3.Transform(ref extremePoint, ref transform, out extremePoint);\n        }\n\n\n        /// <summary>\n        /// Computes the maximum radius of the shape.\n        /// This is often larger than the actual maximum radius;\n        /// it is simply an approximation that avoids underestimating.\n        /// </summary>\n        /// <returns>Maximum radius of the shape.</returns>\n        public override float ComputeMaximumRadius()\n        {\n            //This will overestimate the actual maximum radius, but such is the defined behavior of the ComputeMaximumRadius function.  It's not exact; it's an upper bound on the actual maximum.\n            RigidTransform transform = RigidTransform.Identity;\n            BoundingBox boundingBox;\n            GetBoundingBox(ref transform, out boundingBox);\n            Vector3 diameter;\n            Vector3.Subtract(ref boundingBox.Max, ref boundingBox.Min, out diameter);\n            return diameter.Length();\n            \n        }\n\n        ///<summary>\n        /// Computes the minimum radius of the shape.\n        /// This is often smaller than the actual minimum radius;\n        /// it is simply an approximation that avoids overestimating.\n        ///</summary>\n        ///<returns>Minimum radius of the shape.</returns>\n        public override float ComputeMinimumRadius()\n        {\n            //Sample the shape in directions pointing to the vertices of a regular tetrahedron.\n            Vector3 a, b, c, d;\n            var direction = new Vector3(1, 1, 1);\n            GetLocalExtremePointWithoutMargin(ref direction, out a);\n            direction = new Vector3(-1, -1, 1);\n            GetLocalExtremePointWithoutMargin(ref direction, out b);\n            direction = new Vector3(-1, 1, -1);\n            GetLocalExtremePointWithoutMargin(ref direction, out c);\n            direction = new Vector3(1, -1, -1);\n            GetLocalExtremePointWithoutMargin(ref direction, out d);\n            Vector3 ab, cb, ac, ad, cd;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3.Subtract(ref b, ref c, out cb);\n            Vector3.Subtract(ref c, ref a, out ac);\n            Vector3.Subtract(ref d, ref a, out ad);\n            Vector3.Subtract(ref d, ref c, out cd);\n            //Find normals of triangles: ABC, CBD, ACD, ADB\n            Vector3 nABC, nCBD, nACD, nADB;\n            Vector3.Cross(ref ac, ref ab, out nABC);\n            Vector3.Cross(ref cd, ref cb, out nCBD);\n            Vector3.Cross(ref ad, ref ac, out nACD);\n            Vector3.Cross(ref ab, ref ad, out nADB);\n            //Find distances to planes.\n            float dABC, dCBD, dACD, dADB;\n            Vector3.Dot(ref a, ref nABC, out dABC);\n            Vector3.Dot(ref c, ref nCBD, out dCBD);\n            Vector3.Dot(ref a, ref nACD, out dACD);\n            Vector3.Dot(ref a, ref nADB, out dADB);\n            dABC /= nABC.Length();\n            dCBD /= nCBD.Length();\n            dACD /= nACD.Length();\n            dADB /= nADB.Length();\n\n            return collisionMargin + Math.Min(dABC, Math.Min(dCBD, Math.Min(dACD, dADB)));\n        }\n\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.\n        /// </summary>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter()\n        {\n            //All convexes under acceptably normal circumstances are centered on the local origin.\n            //The linear transform performs rotation, scaling, and shearing.  All of these operations will not move the origin.\n            return Vector3.Zero;\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.  This calculation is often associated with the \n        /// volume calculation, which is given by this method as well.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter(out float volume)\n        {\n            volume = ComputeVolume();\n            return ComputeCenter();\n        }\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new ConvexCollidable<TransformableShape>(this);\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/TriangleShape.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing RigidTransform = BEPUutilities.RigidTransform;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n\n    ///<summary>\n    /// Triangle collision shape.\n    ///</summary>\n    public class TriangleShape : ConvexShape\n    {\n        internal Vector3 vA, vB, vC;\n\n        ///<summary>\n        /// Constructs a triangle shape without initializing it.\n        /// This is useful for systems that re-use a triangle shape repeatedly.\n        ///</summary>\n        public TriangleShape()\n        {\n            //Triangles are often used in special situations where the vertex locations are changed directly.  This constructor assists with that.\n        }\n\n        ///<summary>\n        /// Constructs a triangle shape.\n        /// The vertices will be recentered.\n        ///</summary>\n        ///<param name=\"vA\">First vertex in the triangle.</param>\n        ///<param name=\"vB\">Second vertex in the triangle.</param>\n        ///<param name=\"vC\">Third vertex in the triangle.</param>\n        ///<param name=\"center\">Computed center of the triangle.</param>\n        public TriangleShape(Vector3 vA, Vector3 vB, Vector3 vC, out Vector3 center)\n        {\n            //Recenter.  Convexes should contain the origin.\n            center = (vA + vB + vC) / 3;\n            this.vA = vA - center;\n            this.vB = vB - center;\n            this.vC = vC - center;\n            OnShapeChanged();\n        }\n\n        ///<summary>\n        /// Constructs a triangle shape.\n        /// The vertices will be recentered.  If the center is needed, use the other constructor.\n        ///</summary>\n        ///<param name=\"vA\">First vertex in the triangle.</param>\n        ///<param name=\"vB\">Second vertex in the triangle.</param>\n        ///<param name=\"vC\">Third vertex in the triangle.</param>\n        public TriangleShape(Vector3 vA, Vector3 vB, Vector3 vC)\n        {\n            //Recenter.  Convexes should contain the origin.\n            Vector3 center = (vA + vB + vC) / 3;\n            this.vA = vA - center;\n            this.vB = vB - center;\n            this.vC = vC - center;\n            OnShapeChanged();\n        }\n\n        ///<summary>\n        /// Gets or sets the first vertex of the triangle shape.\n        ///</summary>\n        public Vector3 VertexA\n        {\n            get\n            {\n                return vA;\n            }\n            set\n            {\n                vA = value;\n                OnShapeChanged();\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the second vertex of the triangle shape.\n        ///</summary>\n        public Vector3 VertexB\n        {\n            get\n            {\n                return vB;\n            }\n            set\n            {\n                vB = value;\n                OnShapeChanged();\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the third vertex of the triangle shape.\n        ///</summary>\n        public Vector3 VertexC\n        {\n            get\n            {\n                return vC;\n            }\n            set\n            {\n                vC = value;\n                OnShapeChanged();\n            }\n        }\n\n        internal TriangleSidedness sidedness;\n        ///<summary>\n        /// Gets or sets the sidedness of the triangle.\n        ///</summary>\n        public TriangleSidedness Sidedness\n        {\n            get { return sidedness; }\n            set\n            {\n                sidedness = value;\n                OnShapeChanged();\n            }\n        }\n\n        /// <summary>\n        /// Gets the bounding box of the shape given a transform.\n        /// </summary>\n        /// <param name=\"shapeTransform\">Transform to use.</param>\n        /// <param name=\"boundingBox\">Bounding box of the transformed shape.</param>\n        public override void GetBoundingBox(ref RigidTransform shapeTransform, out BoundingBox boundingBox)\n        {\n            Vector3 a, b, c;\n\n            Vector3.Transform(ref vA, ref shapeTransform.Orientation, out a);\n            Vector3.Transform(ref vB, ref shapeTransform.Orientation, out b);\n            Vector3.Transform(ref vC, ref shapeTransform.Orientation, out c);\n\n            Vector3.Min(ref a, ref b, out boundingBox.Min);\n            Vector3.Min(ref c, ref boundingBox.Min, out boundingBox.Min);\n\n            Vector3.Max(ref a, ref b, out boundingBox.Max);\n            Vector3.Max(ref c, ref boundingBox.Max, out boundingBox.Max);\n\n            boundingBox.Min.X += shapeTransform.Position.X - collisionMargin;\n            boundingBox.Min.Y += shapeTransform.Position.Y - collisionMargin;\n            boundingBox.Min.Z += shapeTransform.Position.Z - collisionMargin;\n            boundingBox.Max.X += shapeTransform.Position.X + collisionMargin;\n            boundingBox.Max.Y += shapeTransform.Position.Y + collisionMargin;\n            boundingBox.Max.Z += shapeTransform.Position.Z + collisionMargin;\n        }\n\n\n        ///<summary>\n        /// Gets the extreme point of the shape in local space in a given direction.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)\n        {\n            float dotA, dotB, dotC;\n            Vector3.Dot(ref direction, ref vA, out dotA);\n            Vector3.Dot(ref direction, ref vB, out dotB);\n            Vector3.Dot(ref direction, ref vC, out dotC);\n            if (dotA > dotB && dotA > dotC)\n            {\n                extremePoint = vA;\n            }\n            else if (dotB > dotC) //vA is not the most extreme point.\n            {\n                extremePoint = vB;\n            }\n            else\n            {\n                extremePoint = vC;\n            }\n        }\n\n        /// <summary>\n        /// Computes the maximum radius of the shape.\n        /// This is often larger than the actual maximum radius;\n        /// it is simply an approximation that avoids underestimating.\n        /// </summary>\n        /// <returns>Maximum radius of the shape.</returns>\n        public override float ComputeMaximumRadius()\n        {\n            Vector3 center = ComputeCenter();\n            return collisionMargin + Math.Max((vA - center).Length(), Math.Max((vB - center).Length(), (vC - center).Length()));\n        }\n\n        ///<summary>\n        /// Computes the minimum radius of the shape.\n        /// This is often smaller than the actual minimum radius;\n        /// it is simply an approximation that avoids overestimating.\n        ///</summary>\n        ///<returns>Minimum radius of the shape.</returns>\n        public override float ComputeMinimumRadius()\n        {\n            return 0;\n        }\n\n        /// <summary>\n        /// Computes the volume distribution of the shape as well as its volume.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Volume distribution of the shape.</returns>\n        public override Matrix3x3 ComputeVolumeDistribution(out float volume)\n        {\n            Vector3 center = ComputeCenter();\n            volume = ComputeVolume(); //Just approximate.\n\n            //Calculate distribution of mass.\n\n            const float massPerPoint = .333333333f;\n\n            //Subtract the position from the distribution, moving into a 'body space' relative to itself.\n            //        [ (j * j + z * z)  (-j * j)  (-j * z) ]\n            //I = I + [ (-j * j)  (j * j + z * z)  (-j * z) ]\n            //\t      [ (-j * z)  (-j * z)  (j * j + j * j) ]\n\n            float i = vA.X - center.X;\n            float j = vA.Y - center.Y;\n            float k = vA.Z - center.Z;\n            //localInertiaTensor += new Matrix(j * j + k * k, -j * j, -j * k, 0, -j * j, j * j + k * k, -j * k, 0, -j * k, -j * k, j * j + j * j, 0, 0, 0, 0, 0); //No mass per point.\n            var volumeDistribution = new Matrix3x3(massPerPoint * (j * j + k * k), massPerPoint * (-i * j), massPerPoint * (-i * k),\n                                                         massPerPoint * (-i * j), massPerPoint * (i * i + k * k), massPerPoint * (-j * k),\n                                                         massPerPoint * (-i * k), massPerPoint * (-j * k), massPerPoint * (i * i + j * j));\n\n            i = vB.X - center.X;\n            j = vB.Y - center.Y;\n            k = vB.Z - center.Z;\n            var pointContribution = new Matrix3x3(massPerPoint * (j * j + k * k), massPerPoint * (-i * j), massPerPoint * (-i * k),\n                                                        massPerPoint * (-i * j), massPerPoint * (i * i + k * k), massPerPoint * (-j * k),\n                                                        massPerPoint * (-i * k), massPerPoint * (-j * k), massPerPoint * (i * i + j * j));\n            Matrix3x3.Add(ref volumeDistribution, ref pointContribution, out volumeDistribution);\n\n            i = vC.X - center.X;\n            j = vC.Y - center.Y;\n            k = vC.Z - center.Z;\n            pointContribution = new Matrix3x3(massPerPoint * (j * j + k * k), massPerPoint * (-i * j), massPerPoint * (-i * k),\n                                              massPerPoint * (-i * j), massPerPoint * (i * i + k * k), massPerPoint * (-j * k),\n                                              massPerPoint * (-i * k), massPerPoint * (-j * k), massPerPoint * (i * i + j * j));\n            Matrix3x3.Add(ref volumeDistribution, ref pointContribution, out volumeDistribution);\n            return volumeDistribution;\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.\n        /// </summary>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter()\n        {\n            return (vA + vB + vC) / 3;\n        }\n\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.  This calculation is often associated with the \n        /// volume calculation, which is given by this method as well.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Center of the shape.</returns>\n        public override Vector3 ComputeCenter(out float volume)\n        {\n            volume = ComputeVolume();\n            return ComputeCenter();\n        }\n\n        /// <summary>\n        /// Computes the volume of the shape.\n        /// </summary>\n        /// <returns>Volume of the shape.</returns>\n        public override float ComputeVolume()\n        {\n            return Vector3.Cross(vB - vA, vC - vA).Length() * collisionMargin;\n        }\n\n        ///<summary>\n        /// Gets the normal of the triangle shape in its local space.\n        ///</summary>\n        ///<returns>The local normal.</returns>\n        public Vector3 GetLocalNormal()\n        {\n            Vector3 normal;\n            Vector3 vAvB;\n            Vector3 vAvC;\n            Vector3.Subtract(ref vB, ref vA, out vAvB);\n            Vector3.Subtract(ref vC, ref vA, out vAvC);\n            Vector3.Cross(ref vAvB, ref vAvC, out normal);\n            normal.Normalize();\n            return normal;\n        }\n\n        /// <summary>\n        /// Gets the normal of the triangle in world space.\n        /// </summary>\n        /// <param name=\"transform\">World transform.</param>\n        /// <returns>Normal of the triangle in world space.</returns>\n        public Vector3 GetNormal(RigidTransform transform)\n        {\n            Vector3 normal = GetLocalNormal();\n            Vector3.Transform(ref normal, ref transform.Orientation, out normal);\n            return normal;\n        }\n\n        /// <summary>\n        /// Gets the intersection between the triangle and the ray.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test against the triangle.</param>\n        /// <param name=\"transform\">Transform to apply to the triangle shape for the test.</param>\n        /// <param name=\"maximumLength\">Maximum distance to travel in units of the direction vector's length.</param>\n        /// <param name=\"hit\">Hit data of the ray cast, if any.</param>\n        /// <returns>Whether or not the ray hit the target.</returns>\n        public override bool RayTest(ref Ray ray, ref RigidTransform transform, float maximumLength, out RayHit hit)\n        {\n            Matrix3x3 orientation;\n            Matrix3x3.CreateFromQuaternion(ref transform.Orientation, out orientation);\n            Ray localRay;\n            Quaternion conjugate;\n            Quaternion.Conjugate(ref transform.Orientation, out conjugate);\n            Vector3.Transform(ref ray.Direction, ref conjugate, out localRay.Direction);\n            Vector3.Subtract(ref ray.Position, ref transform.Position, out localRay.Position);\n            Vector3.Transform(ref localRay.Position, ref conjugate, out localRay.Position);\n\n            bool toReturn = Toolbox.FindRayTriangleIntersection(ref localRay, maximumLength, sidedness, ref vA, ref vB, ref vC, out hit);\n            //Move the hit back into world space.\n            Vector3.Multiply(ref ray.Direction, hit.T, out hit.Location);\n            Vector3.Add(ref ray.Position, ref hit.Location, out hit.Location);\n            Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n            return toReturn;\n        }\n\n        /// <summary>\n        /// Returns a <see cref=\"T:System.String\"/> that represents the current <see cref=\"T:System.Object\"/>.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.String\"/> that represents the current <see cref=\"T:System.Object\"/>.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return vA + \", \" + vB + \", \" + vC;\n        }\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new ConvexCollidable<TriangleShape>(this);\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ConvexShapes/WrappedShape.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.CollisionShapes.ConvexShapes\n{\n    ///<summary>\n    /// Convex shape entry to a WrappedShape.\n    ///</summary>\n    public struct ConvexShapeEntry\n    {\n        /// <summary>\n        /// Convex shape of the entry.\n        /// </summary>\n        public ConvexShape CollisionShape;\n        /// <summary>\n        /// Local transform of the entry.\n        /// </summary>\n        public RigidTransform Transform;\n\n        /// <summary>\n        /// Constructs a convex shape entry.\n        /// </summary>\n        /// <param name=\"position\">Local position of the entry.</param>\n        /// <param name=\"shape\">Shape of the entry.</param>\n        public ConvexShapeEntry(Vector3 position, ConvexShape shape)\n        {\n            Transform = new RigidTransform(position);\n            CollisionShape = shape;\n        }\n\n        /// <summary>\n        /// Constructs a convex shape entry.\n        /// </summary>\n        /// <param name=\"orientation\">Local orientation of the entry.</param>\n        /// <param name=\"shape\">Shape of the entry.</param>\n        public ConvexShapeEntry(Quaternion orientation, ConvexShape shape)\n        {\n            Transform = new RigidTransform(orientation);\n            CollisionShape = shape;\n        }\n\n        /// <summary>\n        /// Constructs a convex shape entry.\n        /// </summary>\n        /// <param name=\"transform\">Local transform of the entry.</param>\n        /// <param name=\"shape\">Shape of the entry.</param>\n        public ConvexShapeEntry(RigidTransform transform, ConvexShape shape)\n        {\n            Transform = transform;\n            CollisionShape = shape;\n        }\n\n        ///<summary>\n        /// Constructs a convex shape entry with identity transformation.\n        ///</summary>\n        ///<param name=\"shape\">Shape of the entry.</param>\n        public ConvexShapeEntry(ConvexShape shape)\n        {\n            Transform = RigidTransform.Identity;\n            CollisionShape = shape;\n        }\n    }\n    ///<summary>\n    /// Shape that wraps other convex shapes in a convex hull.\n    /// One way to think of it is to collect a bunch of items and wrap shrinkwrap around them.\n    /// That surface is the shape of the WrappedShape.\n    ///</summary>\n    public class WrappedShape : ConvexShape\n    {\n        ObservableList<ConvexShapeEntry> shapes = new ObservableList<ConvexShapeEntry>();\n        ///<summary>\n        /// Gets the shapes in wrapped shape.\n        ///</summary>\n        public ObservableList<ConvexShapeEntry> Shapes\n        {\n            get\n            {\n                return shapes;\n            }\n        }\n\n        void Recenter(out Vector3 center)\n        {\n            //When first constructed, a wrapped shape may not actually be centered on its local origin.\n            //It is helpful to many systems if this is addressed.\n            center = ComputeCenter();\n            for (int i = 0; i < shapes.Count; i++)\n            {\n                shapes.WrappedList.Elements[i].Transform.Position -= center;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a wrapped shape.\n        /// A constructor is also available which takes a list of objects rather than just a pair.\n        /// The shape will be recentered.  If the center is needed, use the other constructor.\n        ///</summary>\n        ///<param name=\"firstShape\">First shape in the wrapped shape.</param>\n        ///<param name=\"secondShape\">Second shape in the wrapped shape.</param>\n        public WrappedShape(ConvexShapeEntry firstShape, ConvexShapeEntry secondShape)\n        {\n            shapes.Add(firstShape);\n            shapes.Add(secondShape);\n\n            OnShapeChanged();\n            Vector3 v;\n            Recenter(out v);\n\n            shapes.Changed += ShapesChanged;\n        }\n\n        ///<summary>\n        /// Constructs a wrapped shape.\n        /// A constructor is also available which takes a list of objects rather than just a pair.\n        /// The shape will be recentered.\n        ///</summary>\n        ///<param name=\"firstShape\">First shape in the wrapped shape.</param>\n        ///<param name=\"secondShape\">Second shape in the wrapped shape.</param>\n        ///<param name=\"center\">Center of the shape before recentering..</param>\n        public WrappedShape(ConvexShapeEntry firstShape, ConvexShapeEntry secondShape, out Vector3 center)\n        {\n            shapes.Add(firstShape);\n            shapes.Add(secondShape);\n\n            OnShapeChanged();\n            Recenter(out center);\n\n            shapes.Changed += ShapesChanged;\n        }\n\n        ///<summary>\n        /// Constructs a wrapped shape.\n        /// The shape will be recentered; if the center is needed, use the other constructor.\n        ///</summary>\n        ///<param name=\"shapeEntries\">Shape entries used to construct the shape.</param>\n        ///<exception cref=\"Exception\">Thrown when the shape list is empty.</exception>\n        public WrappedShape(IList<ConvexShapeEntry> shapeEntries)\n        {\n            if (shapeEntries.Count == 0)\n                throw new ArgumentException(\"Cannot create a wrapped shape with no contained shapes.\");\n            for (int i = 0; i < shapeEntries.Count; i++)\n            {\n                shapes.Add(shapeEntries[i]);\n            }\n            Vector3 v;\n            OnShapeChanged();\n            Recenter(out v);\n\n            shapes.Changed += ShapesChanged;\n        }\n\n        ///<summary>\n        /// Constructs a wrapped shape.\n        /// The shape will be recentered.\n        ///</summary>\n        ///<param name=\"shapeEntries\">Shape entries used to construct the shape.</param>\n        /// <param name=\"center\">Center of the shape before recentering.</param>\n        ///<exception cref=\"Exception\">Thrown when the shape list is empty.</exception>\n        public WrappedShape(IList<ConvexShapeEntry> shapeEntries, out Vector3 center)\n        {\n            if (shapeEntries.Count == 0)\n                throw new ArgumentException(\"Cannot create a wrapped shape with no contained shapes.\");\n            for (int i = 0; i < shapeEntries.Count; i++)\n            {\n                shapes.Add(shapeEntries[i]);\n            }\n\n            OnShapeChanged();\n            Recenter(out center);\n\n            shapes.Changed += ShapesChanged;\n        }\n\n        void ShapesChanged(ObservableList<ConvexShapeEntry> list)\n        {\n            OnShapeChanged();\n        }\n\n\n        /// <summary>\n        /// Gets the bounding box of the shape given a transform.\n        /// </summary>\n        /// <param name=\"shapeTransform\">Transform to use.</param>\n        /// <param name=\"boundingBox\">Bounding box of the transformed shape.</param>\n        public override void GetBoundingBox(ref RigidTransform shapeTransform, out BoundingBox boundingBox)\n        {\n            RigidTransform subTransform;\n            RigidTransform.Transform(ref shapes.WrappedList.Elements[0].Transform, ref shapeTransform, out subTransform);\n            shapes.WrappedList.Elements[0].CollisionShape.GetBoundingBox(ref subTransform, out boundingBox);\n            for (int i = 1; i < shapes.WrappedList.Count; i++)\n            {\n                RigidTransform.Transform(ref shapes.WrappedList.Elements[i].Transform, ref shapeTransform, out subTransform);\n                BoundingBox toMerge;\n                shapes.WrappedList.Elements[i].CollisionShape.GetBoundingBox(ref subTransform, out toMerge);\n                BoundingBox.CreateMerged(ref boundingBox, ref toMerge, out boundingBox);\n            }\n\n            boundingBox.Min.X -= collisionMargin;\n            boundingBox.Min.Y -= collisionMargin;\n            boundingBox.Min.Z -= collisionMargin;\n\n            boundingBox.Max.X += collisionMargin;\n            boundingBox.Max.Y += collisionMargin;\n            boundingBox.Max.Z += collisionMargin;\n        }\n\n\n        ///<summary>\n        /// Gets the extreme point of the shape in local space in a given direction.\n        ///</summary>\n        ///<param name=\"direction\">Direction to find the extreme point in.</param>\n        ///<param name=\"extremePoint\">Extreme point on the shape.</param>\n        public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)\n        {\n            shapes.WrappedList.Elements[0].CollisionShape.GetExtremePoint(direction, ref shapes.WrappedList.Elements[0].Transform, out extremePoint);\n            float maxDot;\n            Vector3.Dot(ref extremePoint, ref direction, out maxDot);\n            for (int i = 1; i < shapes.WrappedList.Count; i++)\n            {\n                float dot;\n                Vector3 temp;\n\n                shapes.WrappedList.Elements[i].CollisionShape.GetExtremePoint(direction, ref shapes.WrappedList.Elements[i].Transform, out temp);\n                Vector3.Dot(ref direction, ref temp, out dot);\n                if (dot > maxDot)\n                {\n                    extremePoint = temp;\n                    maxDot = dot;\n                }\n            }\n        }\n\n\n        /// <summary>\n        /// Computes the maximum radius of the shape.\n        /// This is often larger than the actual maximum radius;\n        /// it is simply an approximation that avoids underestimating.\n        /// </summary>\n        /// <returns>Maximum radius of the shape.</returns>\n        public override float ComputeMaximumRadius()\n        {\n            //This can overestimate the actual maximum radius, but such is the defined behavior of the ComputeMaximumRadius function.  It's not exact; it's an upper bound on the actual maximum.\n            float maxRadius = 0;\n            for (int i = 0; i < shapes.Count; i++)\n            {\n                float radius = shapes.WrappedList.Elements[i].CollisionShape.ComputeMaximumRadius() +\n                               shapes.WrappedList.Elements[i].Transform.Position.Length();\n                if (radius > maxRadius)\n                    maxRadius = radius;\n            }\n            return maxRadius + collisionMargin;\n        }\n        public override float ComputeMinimumRadius()\n        {\n            //Could also use the tetrahedron approximation approach.\n            float minRadius = 0;\n            for (int i = 0; i < shapes.Count; i++)\n            {\n                float radius = shapes.WrappedList.Elements[i].CollisionShape.ComputeMinimumRadius();\n                if (radius < minRadius)\n                    minRadius = radius;\n            }\n            return minRadius + collisionMargin;\n        }\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new ConvexCollidable<WrappedShape>(this);\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/EntityShape.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionShapes\n{\n    ///<summary>\n    /// Superclass of all collision shapes that are used by Entities.\n    ///</summary>\n    public abstract class EntityShape : CollisionShape\n    {\n\n        /// <summary>\n        /// Computes the volume of the shape.\n        /// </summary>\n        /// <returns>Volume of the shape.</returns>\n        public virtual float ComputeVolume()\n        {\n            ShapeDistributionInformation shapeInfo;\n            ComputeDistributionInformation(out shapeInfo);\n            return shapeInfo.Volume;\n        }\n        /// <summary>\n        /// Computes the volume distribution of the shape as well as its volume.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Volume distribution of the shape.</returns>\n        public virtual Matrix3x3 ComputeVolumeDistribution(out float volume)\n        {\n            ShapeDistributionInformation shapeInfo;\n            ComputeDistributionInformation(out shapeInfo);\n            volume = shapeInfo.Volume;\n            return shapeInfo.VolumeDistribution;\n        }\n        /// <summary>\n        /// Computes the volume distribution of the shape.\n        /// The volume distribution can be used to compute inertia tensors when\n        /// paired with mass and other tuning factors.\n        /// </summary>\n        /// <returns>Volume distribution of the shape.</returns>\n        public virtual Matrix3x3 ComputeVolumeDistribution()\n        {\n            ShapeDistributionInformation shapeInfo;\n            ComputeDistributionInformation(out shapeInfo);\n            return shapeInfo.VolumeDistribution;\n        }\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.\n        /// </summary>\n        /// <returns>Center of the shape.</returns>\n        public virtual Vector3 ComputeCenter()\n        {\n            ShapeDistributionInformation shapeInfo;\n            ComputeDistributionInformation(out shapeInfo);\n            return shapeInfo.Center;\n        }\n        /// <summary>\n        /// Computes the center of the shape.  This can be considered its \n        /// center of mass.  This calculation is often associated with the \n        /// volume calculation, which is given by this method as well.\n        /// </summary>\n        /// <param name=\"volume\">Volume of the shape.</param>\n        /// <returns>Center of the shape.</returns>\n        public virtual Vector3 ComputeCenter(out float volume)\n        {\n            ShapeDistributionInformation shapeInfo;\n            ComputeDistributionInformation(out shapeInfo);\n            volume = shapeInfo.Volume;\n            return shapeInfo.Center;\n        }\n\n        /// <summary>\n        /// Computes a variety of shape information all at once.\n        /// </summary>\n        /// <param name=\"shapeInfo\">Properties of the shape.</param>\n        public abstract void ComputeDistributionInformation(out ShapeDistributionInformation shapeInfo);\n\n        /// <summary>\n        /// Retrieves an instance of an EntityCollidable that uses this EntityShape.  Mainly used by compound bodies.\n        /// </summary>\n        /// <returns>EntityCollidable that uses this shape.</returns>\n        public abstract EntityCollidable GetCollidableInstance();\n\n        /// <summary>\n        /// Computes a bounding box for the shape given the specified transform.\n        /// </summary>\n        /// <param name=\"transform\">Transform to apply to the shape to compute the bounding box.</param>\n        /// <param name=\"boundingBox\">Bounding box for the shape given the transform.</param>\n        public abstract void GetBoundingBox(ref RigidTransform transform, out BoundingBox boundingBox);\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/InstancedMeshShape.cs",
    "content": "﻿using BEPUphysics.DataStructures;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionShapes\n{\n    ///<summary>\n    /// Local space data associated with an instanced mesh.\n    /// This contains a hierarchy and all the other heavy data needed\n    /// by an InstancedMesh.\n    ///</summary>\n    public class InstancedMeshShape : CollisionShape\n    {\n        TriangleMesh triangleMesh;\n        ///<summary>\n        /// Gets or sets the TriangleMesh data structure used by this shape.\n        ///</summary>\n        public TriangleMesh TriangleMesh\n        {\n            get\n            {\n                return triangleMesh;\n            }\n            set\n            {\n                triangleMesh = value;\n                OnShapeChanged();\n            }\n        }\n\n\n\n        ///<summary>\n        /// Constructs a new instanced mesh shape.\n        ///</summary>\n        ///<param name=\"vertices\">Vertices of the mesh.</param>\n        ///<param name=\"indices\">Indices of the mesh.</param>\n        public InstancedMeshShape(Vector3[] vertices, uint[] indices)\n        {\n            TriangleMesh = new TriangleMesh(new StaticMeshData(vertices, indices, indices.Length));\n        }\n\n\n\n        ///<summary>\n        /// Computes the bounding box of the transformed mesh shape.\n        ///</summary>\n        ///<param name=\"transform\">Transform to apply to the shape during the bounding box calculation.</param>\n        ///<param name=\"boundingBox\">Bounding box containing the transformed mesh shape.</param>\n        public void ComputeBoundingBox(ref AffineTransform transform, out BoundingBox boundingBox)\n        {\n#if !WINDOWS\n            boundingBox = new BoundingBox();\n#endif\n            float minX = float.MaxValue;\n            float minY = float.MaxValue;\n            float minZ = float.MaxValue;\n\n            float maxX = -float.MaxValue;\n            float maxY = -float.MaxValue;\n            float maxZ = -float.MaxValue;\n            for (int i = 0; i < triangleMesh.Data.vertices.Length; i++)\n            {\n                Vector3 vertex;\n                triangleMesh.Data.GetVertexPosition(i, out vertex);\n                Matrix3x3.Transform(ref vertex, ref transform.LinearTransform, out vertex);\n                if (vertex.X < minX)\n                    minX = vertex.X;\n                if (vertex.X > maxX)\n                    maxX = vertex.X;\n\n                if (vertex.Y < minY)\n                    minY = vertex.Y;\n                if (vertex.Y > maxY)\n                    maxY = vertex.Y;\n\n                if (vertex.Z < minZ)\n                    minZ = vertex.Z;\n                if (vertex.Z > maxZ)\n                    maxZ = vertex.Z;\n            }\n            boundingBox.Min.X = transform.Translation.X + minX;\n            boundingBox.Min.Y = transform.Translation.Y + minY;\n            boundingBox.Min.Z = transform.Translation.Z + minZ;\n            \n            boundingBox.Max.X = transform.Translation.X + maxX;\n            boundingBox.Max.Y = transform.Translation.Y + maxY;\n            boundingBox.Max.Z = transform.Translation.Z + maxZ;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/MobileMeshShape.cs",
    "content": "﻿using BEPUphysics.DataStructures;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing System;\nusing BEPUphysics.Settings;\n\nnamespace BEPUphysics.CollisionShapes\n{\n    ///<summary>\n    /// Local space data associated with a mobile mesh.\n    /// This contains a hierarchy and all the other heavy data needed\n    /// by an MobileMesh.\n    ///</summary>\n    public class MobileMeshShape : EntityShape\n    {\n        private float meshCollisionMargin = CollisionDetectionSettings.DefaultMargin;\n        /// <summary>\n        /// Gets or sets the margin of the mobile mesh to use when colliding with other meshes.\n        /// When colliding with non-mesh shapes, the mobile mesh has no margin.\n        /// </summary>\n        public float MeshCollisionMargin\n        {\n            get\n            {\n                return meshCollisionMargin;\n            }\n            set\n            {\n                if (value < 0)\n                    throw new ArgumentException(\"Mesh margin must be nonnegative.\");\n                meshCollisionMargin = value;\n                OnShapeChanged();\n            }\n        }\n        TriangleMesh triangleMesh;\n        ///<summary>\n        /// Gets or sets the TriangleMesh data structure used by this shape.\n        ///</summary>\n        public TriangleMesh TriangleMesh\n        {\n            get\n            {\n                return triangleMesh;\n            }\n        }\n\n        /// <summary>\n        /// Gets the transform used by the local mesh shape.\n        /// </summary>\n        public AffineTransform Transform\n        {\n            get\n            {\n                return ((TransformableMeshData)triangleMesh.Data).worldTransform;\n            }\n        }\n\n        RawList<Vector3> surfaceVertices = new RawList<Vector3>();\n\n        internal MobileMeshSolidity solidity = MobileMeshSolidity.DoubleSided;\n        ///<summary>\n        /// Gets the solidity of the mesh.\n        ///</summary>\n        public MobileMeshSolidity Solidity\n        {\n            get\n            {\n                return solidity;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the sidedness of the shape.  This is a convenience property based on the Solidity property.\n        /// If the shape is solid, this returns whatever sidedness is computed to make the triangles of the shape face outward.\n        /// If the shape is solid, setting this property will change the sidedness that is used while the shape is solid.\n        /// </summary>\n        public TriangleSidedness Sidedness\n        {\n            get\n            {\n                switch (solidity)\n                {\n                    case MobileMeshSolidity.Clockwise:\n                        return TriangleSidedness.Clockwise;\n                    case MobileMeshSolidity.Counterclockwise:\n                        return TriangleSidedness.Counterclockwise;\n                    case MobileMeshSolidity.DoubleSided:\n                        return TriangleSidedness.DoubleSided;\n                    case MobileMeshSolidity.Solid:\n                        return solidSidedness;\n\n                }\n                return TriangleSidedness.DoubleSided;\n            }\n            set\n            {\n                if (solidity == MobileMeshSolidity.Solid)\n                    solidSidedness = value;\n                else\n                {\n                    switch (value)\n                    {\n                        case TriangleSidedness.Clockwise:\n                            solidity = MobileMeshSolidity.Clockwise;\n                            break;\n                        case TriangleSidedness.Counterclockwise:\n                            solidity = MobileMeshSolidity.Counterclockwise;\n                            break;\n                        case TriangleSidedness.DoubleSided:\n                            solidity = MobileMeshSolidity.DoubleSided;\n                            break;\n                    }\n                }\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new mobile mesh shape.\n        ///</summary>\n        ///<param name=\"vertices\">Vertices of the mesh.</param>\n        ///<param name=\"indices\">Indices of the mesh.</param>\n        ///<param name=\"localTransform\">Local transform to apply to the shape.</param>\n        ///<param name=\"solidity\">Solidity state of the shape.</param>\n        public MobileMeshShape(Vector3[] vertices, uint[] indices, AffineTransform localTransform, MobileMeshSolidity solidity)\n        {\n            this.solidity = solidity;\n            var data = new TransformableMeshData(vertices, indices, indices.Length, localTransform);\n            ShapeDistributionInformation distributionInfo;\n            ComputeShapeInformation(data, out distributionInfo);\n\n            for (int i = 0; i < surfaceVertices.Count; i++)\n            {\n                Vector3.Subtract(ref surfaceVertices.Elements[i], ref distributionInfo.Center, out surfaceVertices.Elements[i]);\n            }\n            triangleMesh = new TriangleMesh(data);\n\n            ComputeSolidSidedness();\n        }\n\n        ///<summary>\n        /// Constructs a new mobile mesh shape.\n        ///</summary>\n        ///<param name=\"vertices\">Vertices of the mesh.</param>\n        ///<param name=\"indices\">Indices of the mesh.</param>\n        ///<param name=\"localTransform\">Local transform to apply to the shape.</param>\n        ///<param name=\"solidity\">Solidity state of the shape.</param>\n        ///<param name=\"distributionInfo\">Information computed about the shape during construction.</param>\n        public MobileMeshShape(Vector3[] vertices, uint[] indices, AffineTransform localTransform, MobileMeshSolidity solidity, out ShapeDistributionInformation distributionInfo)\n        {\n            this.solidity = solidity;\n            var data = new TransformableMeshData(vertices, indices, indices.Length, localTransform);\n            ComputeShapeInformation(data, out distributionInfo);\n\n            for (int i = 0; i < surfaceVertices.Count; i++)\n            {\n                Vector3.Subtract(ref surfaceVertices.Elements[i], ref distributionInfo.Center, out surfaceVertices.Elements[i]);\n            }\n            triangleMesh = new TriangleMesh(data);\n\n            ComputeSolidSidedness();\n            //ComputeBoundingHull();\n        }\n\n        /// <summary>\n        /// Sidedness required if the mesh is in solid mode.\n        /// If the windings were reversed or double sided,\n        /// the solidity would fight against shell contacts,\n        /// leading to very bad jittering.\n        /// </summary>\n        internal TriangleSidedness solidSidedness;\n\n\n        /// <summary>\n        /// Tests to see if a ray's origin is contained within the mesh.\n        /// If it is, the hit location is found.\n        /// If it isn't, the hit location is still valid if a hit occurred.\n        /// If the origin isn't inside and there was no hit, the hit has a T value of float.MaxValue.\n        /// </summary>\n        /// <param name=\"ray\">Ray in the local space of the shape to test.</param>\n        /// <param name=\"hit\">The first hit against the mesh, if any.</param>\n        /// <returns>Whether or not the ray origin was in the mesh.</returns>\n        public bool IsLocalRayOriginInMesh(ref Ray ray, out RayHit hit)\n        {\n            var overlapList = CommonResources.GetIntList();\n            hit = new RayHit();\n            hit.T = float.MaxValue;\n            if (triangleMesh.Tree.GetOverlaps(ray, overlapList))\n            {\n                bool minimumClockwise = false;\n                for (int i = 0; i < overlapList.Count; i++)\n                {\n                    Vector3 vA, vB, vC;\n                    triangleMesh.Data.GetTriangle(overlapList[i], out vA, out vB, out vC);\n                    bool hitClockwise;\n                    RayHit tempHit;\n                    if (Toolbox.FindRayTriangleIntersection(ref ray, float.MaxValue, ref vA, ref vB, ref vC, out hitClockwise, out tempHit) &&\n                        tempHit.T < hit.T)\n                    {\n                        hit = tempHit;\n                        minimumClockwise = hitClockwise;\n                    }\n                }\n                CommonResources.GiveBack(overlapList);\n\n                //If the mesh is hit from behind by the ray on the first hit, then the ray is inside.\n                return hit.T < float.MaxValue && ((solidSidedness == TriangleSidedness.Clockwise && !minimumClockwise) || (solidSidedness == TriangleSidedness.Counterclockwise && minimumClockwise));\n            }\n            CommonResources.GiveBack(overlapList);\n            return false;\n\n        }\n\n        /// <summary>\n        /// The difference in t parameters in a ray cast under which two hits are considered to be redundant.\n        /// </summary>\n        public static float MeshHitUniquenessThreshold = .0001f;\n\n        internal bool IsHitUnique(RawList<RayHit> hits, ref RayHit hit)\n        {\n            for (int i = 0; i < hits.Count; i++)\n            {\n                if (Math.Abs(hits.Elements[i].T - hit.T) < MeshHitUniquenessThreshold)\n                    return false;\n            }\n            hits.Add(hit);\n            return true;\n        }\n\n        void ComputeSolidSidedness()\n        {\n            //Raycast against the mesh.\n            //If there's an even number of hits, then the ray start point is outside.\n            //If there's an odd number of hits, then the ray start point is inside.\n\n            //If the start is outside, then take the earliest toi hit and calibrate sidedness based on it.\n            //If the start is inside, then take the latest toi hit and calibrate sidedness based on it.\n\n            //This test assumes consistent winding across the entire mesh as well as a closed surface.\n            //If those assumptions are not correct, then the raycast cannot determine inclusion or exclusion,\n            //or there exists no calibration that will work across the entire surface.\n\n            //Pick a ray direction that goes to a random location on the mesh.  \n            //A vertex would work, but targeting the middle of a triangle avoids some edge cases.\n            var ray = new Ray();\n            Vector3 vA, vB, vC;\n            triangleMesh.Data.GetTriangle(((triangleMesh.Data.indices.Length / 3) / 2) * 3, out vA, out vB, out vC);\n            ray.Direction = (vA + vB + vC) / 3;\n            ray.Direction.Normalize();\n\n            solidSidedness = ComputeSolidSidednessHelper(ray);\n            //TODO: Positions need to be valid for the verifying directions to work properly.\n            ////Find another direction and test it to corroborate the first test.\n            //Ray alternateRay;\n            //alternateRay.Position = ray.Position;\n            //Vector3.Cross(ref ray.Direction, ref Toolbox.UpVector, out alternateRay.Direction);\n            //float lengthSquared = alternateRay.Direction.LengthSquared();\n            //if (lengthSquared < Toolbox.Epsilon)\n            //{\n            //    Vector3.Cross(ref ray.Direction, ref Toolbox.RightVector, out alternateRay.Direction);\n            //    lengthSquared = alternateRay.Direction.LengthSquared();\n            //}\n            //Vector3.Divide(ref alternateRay.Direction, (float)Math.Sqrt(lengthSquared), out alternateRay.Direction);\n            //var sidednessCandidate2 = ComputeSolidSidednessHelper(alternateRay);\n            //if (sidednessCandidate == sidednessCandidate2)\n            //{\n            //    //The two tests agreed! It's very likely that the sidedness is, in fact, in this direction.\n            //    solidSidedness = sidednessCandidate;\n            //}\n            //else\n            //{\n            //    //The two tests disagreed.  Tiebreaker!\n            //    Vector3.Cross(ref alternateRay.Direction, ref ray.Direction, out alternateRay.Direction);\n            //    solidSidedness = ComputeSolidSidednessHelper(alternateRay);\n            //}\n        }\n\n        TriangleSidedness ComputeSolidSidednessHelper(Ray ray)\n        {\n            TriangleSidedness toReturn;\n            var hitList = CommonResources.GetIntList();\n            if (triangleMesh.Tree.GetOverlaps(ray, hitList))\n            {\n                Vector3 vA, vB, vC;\n                var hits = CommonResources.GetRayHitList();\n                //Identify the first and last hits.\n                int minimum = 0;\n                int maximum = 0;\n                float minimumT = float.MaxValue;\n                float maximumT = -1;\n                for (int i = 0; i < hitList.Count; i++)\n                {\n                    triangleMesh.Data.GetTriangle(hitList[i], out vA, out vB, out vC);\n                    RayHit hit;\n                    if (Toolbox.FindRayTriangleIntersection(ref ray, float.MaxValue, TriangleSidedness.DoubleSided, ref vA, ref vB, ref vC, out hit) &&\n                        IsHitUnique(hits, ref hit))\n                    {\n                        if (hit.T < minimumT)\n                        {\n                            minimumT = hit.T;\n                            minimum = hitList[i];\n                        }\n                        if (hit.T > maximumT)\n                        {\n                            maximumT = hit.T;\n                            maximum = hitList[i];\n                        }\n                    }\n                }\n\n                if (hits.Count % 2 == 0)\n                {\n                    //Since we were outside, the first hit triangle should be calibrated\n                    //such that it faces towards us.\n\n                    triangleMesh.Data.GetTriangle(minimum, out vA, out vB, out vC);\n                    var normal = Vector3.Cross(vA - vB, vA - vC);\n                    if (Vector3.Dot(normal, ray.Direction) < 0)\n                        toReturn = TriangleSidedness.Clockwise;\n                    else\n                        toReturn = TriangleSidedness.Counterclockwise;\n                }\n                else\n                {\n                    //Since we were inside, the last hit triangle should be calibrated\n                    //such that it faces away from us.\n\n                    triangleMesh.Data.GetTriangle(maximum, out vA, out vB, out vC);\n                    var normal = Vector3.Cross(vA - vB, vA - vC);\n                    if (Vector3.Dot(normal, ray.Direction) < 0)\n                        toReturn = TriangleSidedness.Counterclockwise;\n                    else\n                        toReturn = TriangleSidedness.Clockwise;\n                }\n\n                CommonResources.GiveBack(hits);\n\n            }\n            else\n                toReturn = TriangleSidedness.DoubleSided; //This is a problem...\n            CommonResources.GiveBack(hitList);\n            return toReturn;\n        }\n\n        void ComputeShapeInformation(TransformableMeshData data, out ShapeDistributionInformation shapeInformation)\n        {\n            //Compute the surface vertices of the shape.\n            surfaceVertices.Clear();\n            try\n            {\n                ConvexHullHelper.GetConvexHull(data.vertices, surfaceVertices);\n                for (int i = 0; i < surfaceVertices.Count; i++)\n                {\n                    AffineTransform.Transform(ref surfaceVertices.Elements[i], ref data.worldTransform, out surfaceVertices.Elements[i]);\n                }\n            }\n            catch\n            {\n                surfaceVertices.Clear();\n                //If the convex hull failed, then the point set has no volume.  A mobile mesh is allowed to have zero volume, however.\n                //In this case, compute the bounding box of all points.\n                BoundingBox box = new BoundingBox();\n                for (int i = 0; i < data.vertices.Length; i++)\n                {\n                    Vector3 v;\n                    data.GetVertexPosition(i, out v);\n                    if (v.X > box.Max.X)\n                        box.Max.X = v.X;\n                    if (v.X < box.Min.X)\n                        box.Min.X = v.X;\n                    if (v.Y > box.Max.Y)\n                        box.Max.Y = v.Y;\n                    if (v.Y < box.Min.Y)\n                        box.Min.Y = v.Y;\n                    if (v.Z > box.Max.Z)\n                        box.Max.Z = v.Z;\n                    if (v.Z < box.Min.Z)\n                        box.Min.Z = v.Z;\n                }\n                //Add the corners.  This will overestimate the size of the surface a bit.\n                surfaceVertices.Add(box.Min);\n                surfaceVertices.Add(box.Max);\n                surfaceVertices.Add(new Vector3(box.Min.X, box.Min.Y, box.Max.Z));\n                surfaceVertices.Add(new Vector3(box.Min.X, box.Max.Y, box.Min.Z));\n                surfaceVertices.Add(new Vector3(box.Max.X, box.Min.Y, box.Min.Z));\n                surfaceVertices.Add(new Vector3(box.Min.X, box.Max.Y, box.Max.Z));\n                surfaceVertices.Add(new Vector3(box.Max.X, box.Max.Y, box.Min.Z));\n                surfaceVertices.Add(new Vector3(box.Max.X, box.Min.Y, box.Max.Z));\n            }\n            shapeInformation.Center = new Vector3();\n\n            if (solidity == MobileMeshSolidity.Solid)\n            {\n\n                //The following inertia tensor calculation assumes a closed mesh.\n\n                shapeInformation.Volume = 0;\n                for (int i = 0; i < data.IndexCount; i += 3)\n                {\n                    Vector3 v2, v3, v4;\n                    data.GetTriangle(i, out v2, out v3, out v4);\n\n                    //Determinant is 6 * volume.  It's signed, though; this is because the mesh isn't necessarily convex nor centered on the origin.\n                    float tetrahedronVolume = v2.X * (v3.Y * v4.Z - v3.Z * v4.Y) -\n                                              v3.X * (v2.Y * v4.Z - v2.Z * v4.Y) +\n                                              v4.X * (v2.Y * v3.Z - v2.Z * v3.Y);\n\n                    shapeInformation.Volume += tetrahedronVolume;\n                    shapeInformation.Center += tetrahedronVolume * (v2 + v3 + v4);\n                }\n                shapeInformation.Center /= shapeInformation.Volume * 4;\n                shapeInformation.Volume /= 6;\n                shapeInformation.Volume = Math.Abs(shapeInformation.Volume);\n\n                data.worldTransform.Translation -= shapeInformation.Center;\n\n                //Source: Explicit Exact Formulas for the 3-D Tetrahedron Inertia Tensor in Terms of its Vertex Coordinates\n                //http://www.scipub.org/fulltext/jms2/jms2118-11.pdf\n                //x1, x2, x3, x4 are origin, triangle1, triangle2, triangle3\n                //Looking to find inertia tensor matrix of the form\n                // [  a  -b' -c' ]\n                // [ -b'  b  -a' ]\n                // [ -c' -a'  c  ]\n                float a = 0, b = 0, c = 0, ao = 0, bo = 0, co = 0;\n\n                float totalWeight = 0;\n                for (int i = 0; i < data.IndexCount; i += 3)\n                {\n                    Vector3 v2, v3, v4;\n                    data.GetTriangle(i, out v2, out v3, out v4);\n\n                    //Determinant is 6 * volume.  It's signed, though; this is because the mesh isn't necessarily convex nor centered on the origin.\n                    float tetrahedronVolume = v2.X * (v3.Y * v4.Z - v3.Z * v4.Y) -\n                                              v3.X * (v2.Y * v4.Z - v2.Z * v4.Y) +\n                                              v4.X * (v2.Y * v3.Z - v2.Z * v3.Y);\n\n                    totalWeight += tetrahedronVolume;\n\n                    a += tetrahedronVolume * (v2.Y * v2.Y + v2.Y * v3.Y + v3.Y * v3.Y + v2.Y * v4.Y + v3.Y * v4.Y + v4.Y * v4.Y +\n                                              v2.Z * v2.Z + v2.Z * v3.Z + v3.Z * v3.Z + v2.Z * v4.Z + v3.Z * v4.Z + v4.Z * v4.Z);\n                    b += tetrahedronVolume * (v2.X * v2.X + v2.X * v3.X + v3.X * v3.X + v2.X * v4.X + v3.X * v4.X + v4.X * v4.X +\n                                              v2.Z * v2.Z + v2.Z * v3.Z + v3.Z * v3.Z + v2.Z * v4.Z + v3.Z * v4.Z + v4.Z * v4.Z);\n                    c += tetrahedronVolume * (v2.X * v2.X + v2.X * v3.X + v3.X * v3.X + v2.X * v4.X + v3.X * v4.X + v4.X * v4.X +\n                                              v2.Y * v2.Y + v2.Y * v3.Y + v3.Y * v3.Y + v2.Y * v4.Y + v3.Y * v4.Y + v4.Y * v4.Y);\n                    ao += tetrahedronVolume * (2 * v2.Y * v2.Z + v3.Y * v2.Z + v4.Y * v2.Z + v2.Y * v3.Z + 2 * v3.Y * v3.Z + v4.Y * v3.Z + v2.Y * v4.Z + v3.Y * v4.Z + 2 * v4.Y * v4.Z);\n                    bo += tetrahedronVolume * (2 * v2.X * v2.Z + v3.X * v2.Z + v4.X * v2.Z + v2.X * v3.Z + 2 * v3.X * v3.Z + v4.X * v3.Z + v2.X * v4.Z + v3.X * v4.Z + 2 * v4.X * v4.Z);\n                    co += tetrahedronVolume * (2 * v2.X * v2.Y + v3.X * v2.Y + v4.X * v2.Y + v2.X * v3.Y + 2 * v3.X * v3.Y + v4.X * v3.Y + v2.X * v4.Y + v3.X * v4.Y + 2 * v4.X * v4.Y);\n                }\n                float density = 1 / totalWeight;\n                float diagonalFactor = density / 10;\n                float offFactor = -density / 20;\n                a *= diagonalFactor;\n                b *= diagonalFactor;\n                c *= diagonalFactor;\n                ao *= offFactor;\n                bo *= offFactor;\n                co *= offFactor;\n                shapeInformation.VolumeDistribution = new Matrix3x3(a, bo, co,\n                                                                    bo, b, ao,\n                                                                    co, ao, c);\n\n\n            }\n            else\n            {\n                shapeInformation.Center = new Vector3();\n                float totalWeight = 0;\n                for (int i = 0; i < data.IndexCount; i += 3)\n                { //Configure the inertia tensor to be local.\n                    Vector3 vA, vB, vC;\n                    data.GetTriangle(i, out vA, out vB, out vC);\n                    Vector3 vAvB;\n                    Vector3 vAvC;\n                    Vector3.Subtract(ref vB, ref vA, out vAvB);\n                    Vector3.Subtract(ref vC, ref vA, out vAvC);\n                    Vector3 cross;\n                    Vector3.Cross(ref vAvB, ref vAvC, out cross);\n                    float weight = cross.Length();\n                    totalWeight += weight;\n\n                    shapeInformation.Center += weight * (vA + vB + vC) / 3;\n\n\n                }\n                shapeInformation.Center /= totalWeight;\n                shapeInformation.Volume = 0;\n\n\n                data.worldTransform.Translation -= shapeInformation.Center;\n\n                shapeInformation.VolumeDistribution = new Matrix3x3();\n                for (int i = 0; i < data.IndexCount; i += 3)\n                { //Configure the inertia tensor to be local.\n                    Vector3 vA, vB, vC;\n                    data.GetTriangle(i, out vA, out vB, out vC);\n                    Vector3 vAvB;\n                    Vector3 vAvC;\n                    Vector3.Subtract(ref vB, ref vA, out vAvB);\n                    Vector3.Subtract(ref vC, ref vA, out vAvC);\n                    Vector3 cross;\n                    Vector3.Cross(ref vAvB, ref vAvC, out cross);\n                    float weight = cross.Length();\n                    totalWeight += weight;\n\n                    Matrix3x3 innerProduct;\n                    Matrix3x3.CreateScale(vA.LengthSquared(), out innerProduct);\n                    Matrix3x3 outerProduct;\n                    Matrix3x3.CreateOuterProduct(ref vA, ref vA, out outerProduct);\n                    Matrix3x3 contribution;\n                    Matrix3x3.Subtract(ref innerProduct, ref outerProduct, out contribution);\n                    Matrix3x3.Multiply(ref contribution, weight, out contribution);\n                    Matrix3x3.Add(ref shapeInformation.VolumeDistribution, ref contribution, out shapeInformation.VolumeDistribution);\n\n                    Matrix3x3.CreateScale(vB.LengthSquared(), out innerProduct);\n                    Matrix3x3.CreateOuterProduct(ref vB, ref vB, out outerProduct);\n                    Matrix3x3.Subtract(ref innerProduct, ref outerProduct, out outerProduct);\n                    Matrix3x3.Multiply(ref contribution, weight, out contribution);\n                    Matrix3x3.Add(ref shapeInformation.VolumeDistribution, ref contribution, out shapeInformation.VolumeDistribution);\n\n                    Matrix3x3.CreateScale(vC.LengthSquared(), out innerProduct);\n                    Matrix3x3.CreateOuterProduct(ref vC, ref vC, out outerProduct);\n                    Matrix3x3.Subtract(ref innerProduct, ref outerProduct, out contribution);\n                    Matrix3x3.Multiply(ref contribution, weight, out contribution);\n                    Matrix3x3.Add(ref shapeInformation.VolumeDistribution, ref contribution, out shapeInformation.VolumeDistribution);\n\n                }\n                Matrix3x3.Multiply(ref shapeInformation.VolumeDistribution, 1 / (6 * totalWeight), out shapeInformation.VolumeDistribution);\n            }\n\n            ////Configure the inertia tensor to be local.\n            //Vector3 finalOffset = shapeInformation.Center;\n            //Matrix3X3 finalInnerProduct;\n            //Matrix3X3.CreateScale(finalOffset.LengthSquared(), out finalInnerProduct);\n            //Matrix3X3 finalOuterProduct;\n            //Matrix3X3.CreateOuterProduct(ref finalOffset, ref finalOffset, out finalOuterProduct);\n\n            //Matrix3X3 finalContribution;\n            //Matrix3X3.Subtract(ref finalInnerProduct, ref finalOuterProduct, out finalContribution);\n\n            //Matrix3X3.Subtract(ref shapeInformation.VolumeDistribution, ref finalContribution, out shapeInformation.VolumeDistribution);\n        }\n\n        ///// <summary>\n        ///// Defines two planes that bound the mesh shape in local space.\n        ///// </summary>\n        //struct Extent\n        //{\n        //    internal Vector3 Direction;\n        //    internal float Minimum;\n        //    internal float Maximum;\n\n        //    internal void Clamp(ref Vector3 v)\n        //    {\n        //        float dot;\n        //        Vector3.Dot(ref v, ref Direction, out dot);\n        //        float difference;\n        //        if (dot < Minimum)\n        //        {\n        //            difference = dot - Minimum;\n        //        }\n        //        else if (dot > Maximum)\n        //        {\n        //            difference = dot - Maximum;\n        //        }\n        //        else return;\n\n        //        //Subtract the component of v which is parallel to the normal.\n        //        v.X -= difference * Direction.X;\n        //        v.Y -= difference * Direction.Y;\n        //        v.Z -= difference * Direction.Z;\n        //    }\n\n        //}\n\n        //RawList<Extent> extents = new RawList<Extent>();\n\n        //void ComputeBoundingHull()\n        //{\n        //    //TODO:\n        //    //While we have computed a convex hull of the shape already, we don't really\n        //    //need the full tightness of the convex hull.\n        //    extents.Add(new Extent() { Direction = new Vector3(1, 0, 0) });\n        //    extents.Add(new Extent() { Direction = new Vector3(0, 1, 0) });\n        //    extents.Add(new Extent() { Direction = new Vector3(0, 0, 1) });\n        //    //extents.Add(new Extent() { Direction = new Vector3(1, 1, 0) });\n        //    //extents.Add(new Extent() { Direction = new Vector3(-1, 1, 0) });\n        //    //extents.Add(new Extent() { Direction = new Vector3(0, 1, 1) });\n        //    //extents.Add(new Extent() { Direction = new Vector3(0, 1, -1) });\n        //    extents.Add(new Extent() { Direction = Vector3.Normalize(new Vector3(1, 0, 1)) });\n        //    extents.Add(new Extent() { Direction = Vector3.Normalize(new Vector3(1, 0, -1)) });\n        //    //Add more extents for a tighter volume\n\n        //    //Initialize the max and mins.\n        //    for (int i = 0; i < extents.count; i++)\n        //    {\n        //        extents.Elements[i].Minimum = float.MaxValue;\n        //        extents.Elements[i].Maximum = -float.MaxValue;\n        //    }\n\n        //    for (int i = 0; i < triangleMesh.Data.vertices.Length; i++)\n        //    {\n        //        Vector3 v;\n        //        triangleMesh.Data.GetVertexPosition(i, out v);\n        //        for (int j = 0; j < extents.count; j++)\n        //        {\n        //            float dot;\n        //            Vector3.Dot(ref v, ref extents.Elements[j].Direction, out dot);\n        //            if (dot < extents.Elements[j].Minimum)\n        //                extents.Elements[j].Minimum = dot;\n        //            if (dot > extents.Elements[j].Maximum)\n        //                extents.Elements[j].Maximum = dot;\n        //        }\n        //    }\n        //}\n\n        private void GetBoundingBox(ref Matrix3x3 o, out BoundingBox boundingBox)\n        {\n#if !WINDOWS\n            boundingBox = new BoundingBox();\n#endif\n            //Sample the local directions from the matrix, implicitly transposed.\n            var rightDirection = new Vector3(o.M11, o.M21, o.M31);\n            var upDirection = new Vector3(o.M12, o.M22, o.M32);\n            var backDirection = new Vector3(o.M13, o.M23, o.M33);\n\n            int right = 0, left = 0, up = 0, down = 0, backward = 0, forward = 0;\n            float minX = float.MaxValue, maxX = -float.MaxValue, minY = float.MaxValue, maxY = -float.MaxValue, minZ = float.MaxValue, maxZ = -float.MaxValue;\n\n            for (int i = 0; i < surfaceVertices.Count; i++)\n            {\n                float dotX, dotY, dotZ;\n                Vector3.Dot(ref rightDirection, ref surfaceVertices.Elements[i], out dotX);\n                Vector3.Dot(ref upDirection, ref surfaceVertices.Elements[i], out dotY);\n                Vector3.Dot(ref backDirection, ref surfaceVertices.Elements[i], out dotZ);\n                if (dotX < minX)\n                {\n                    minX = dotX;\n                    left = i;\n                }\n                if (dotX > maxX)\n                {\n                    maxX = dotX;\n                    right = i;\n                }\n\n                if (dotY < minY)\n                {\n                    minY = dotY;\n                    down = i;\n                }\n                if (dotY > maxY)\n                {\n                    maxY = dotY;\n                    up = i;\n                }\n\n                if (dotZ < minZ)\n                {\n                    minZ = dotZ;\n                    forward = i;\n                }\n                if (dotZ > maxZ)\n                {\n                    maxZ = dotZ;\n                    backward = i;\n                }\n\n            }\n\n            //Incorporate the collision margin.\n            Vector3.Multiply(ref rightDirection, meshCollisionMargin / (float)Math.Sqrt(rightDirection.Length()), out rightDirection);\n            Vector3.Multiply(ref upDirection, meshCollisionMargin / (float)Math.Sqrt(upDirection.Length()), out upDirection);\n            Vector3.Multiply(ref backDirection, meshCollisionMargin / (float)Math.Sqrt(backDirection.Length()), out backDirection);\n\n            var rightElement = surfaceVertices.Elements[right];\n            var leftElement = surfaceVertices.Elements[left];\n            var upElement = surfaceVertices.Elements[up];\n            var downElement = surfaceVertices.Elements[down];\n            var backwardElement = surfaceVertices.Elements[backward];\n            var forwardElement = surfaceVertices.Elements[forward];\n            Vector3.Add(ref rightElement, ref rightDirection, out rightElement);\n            Vector3.Subtract(ref leftElement, ref rightDirection, out leftElement);\n            Vector3.Add(ref upElement, ref upDirection, out upElement);\n            Vector3.Subtract(ref downElement, ref upDirection, out downElement);\n            Vector3.Add(ref backwardElement, ref backDirection, out backwardElement);\n            Vector3.Subtract(ref forwardElement, ref backDirection, out forwardElement);\n\n            //TODO: This could be optimized.  Unnecessary transformation information gets computed.\n            Vector3 vMinX, vMaxX, vMinY, vMaxY, vMinZ, vMaxZ;\n            Matrix3x3.Transform(ref rightElement, ref o, out vMaxX);\n            Matrix3x3.Transform(ref leftElement, ref o, out vMinX);\n            Matrix3x3.Transform(ref upElement, ref o, out vMaxY);\n            Matrix3x3.Transform(ref downElement, ref o, out vMinY);\n            Matrix3x3.Transform(ref backwardElement, ref o, out vMaxZ);\n            Matrix3x3.Transform(ref forwardElement, ref o, out vMinZ);\n\n\n            boundingBox.Max.X = vMaxX.X;\n            boundingBox.Max.Y = vMaxY.Y;\n            boundingBox.Max.Z = vMaxZ.Z;\n\n            boundingBox.Min.X = vMinX.X;\n            boundingBox.Min.Y = vMinY.Y;\n            boundingBox.Min.Z = vMinZ.Z;\n        }\n\n        ///<summary>\n        /// Computes the bounding box of the transformed mesh shape.\n        ///</summary>\n        ///<param name=\"shapeTransform\">Transform to apply to the shape during the bounding box calculation.</param>\n        ///<param name=\"boundingBox\">Bounding box containing the transformed mesh shape.</param>\n        public override void GetBoundingBox(ref RigidTransform shapeTransform, out BoundingBox boundingBox)\n        {\n            ////TODO: Could use an approximate bounding volume.  Would be cheaper at runtime and use less memory, though the box would be bigger.\n            //Matrix3X3 o;\n            //Matrix3X3.CreateFromQuaternion(ref shapeTransform.Orientation, out o);\n            ////Sample the local directions from the orientation matrix, implicitly transposed.\n            //Vector3 right = new Vector3(o.M11 * 100000, o.M21 * 100000, o.M31 * 100000);\n            //Vector3 up = new Vector3(o.M12 * 100000, o.M22 * 100000, o.M32 * 100000);\n            //Vector3 backward = new Vector3(o.M13 * 100000, o.M23 * 100000, o.M33 * 100000);\n            //Vector3 left, down, forward;\n            //Vector3.Negate(ref right, out left);\n            //Vector3.Negate(ref up, out down);\n            //Vector3.Negate(ref backward, out forward);\n            //for (int i = 0; i < extents.count; i++)\n            //{\n            //    extents.Elements[i].Clamp(ref right);\n            //    extents.Elements[i].Clamp(ref left);\n            //    extents.Elements[i].Clamp(ref up);\n            //    extents.Elements[i].Clamp(ref down);\n            //    extents.Elements[i].Clamp(ref backward);\n            //    extents.Elements[i].Clamp(ref forward);\n            //}\n\n            //Matrix3X3.Transform(ref right, ref o, out right);\n            //Matrix3X3.Transform(ref left, ref o, out left);\n            //Matrix3X3.Transform(ref down, ref o, out down);\n            //Matrix3X3.Transform(ref up, ref o, out up);\n            //Matrix3X3.Transform(ref forward, ref o, out forward);\n            //Matrix3X3.Transform(ref backward, ref o, out backward);\n\n\n            //boundingBox.Max.X = shapeTransform.Position.X + right.X;\n            //boundingBox.Max.Y = shapeTransform.Position.Y + up.Y;\n            //boundingBox.Max.Z = shapeTransform.Position.Z + backward.Z;\n\n            //boundingBox.Min.X = shapeTransform.Position.X + left.X;\n            //boundingBox.Min.Y = shapeTransform.Position.Y + down.Y;\n            //boundingBox.Min.Z = shapeTransform.Position.Z + forward.Z;\n\n\n            Matrix3x3 o;\n            Matrix3x3.CreateFromQuaternion(ref shapeTransform.Orientation, out o);\n            GetBoundingBox(ref o, out boundingBox);\n\n\n            boundingBox.Max.X += shapeTransform.Position.X;\n            boundingBox.Max.Y += shapeTransform.Position.Y;\n            boundingBox.Max.Z += shapeTransform.Position.Z;\n\n            boundingBox.Min.X += shapeTransform.Position.X;\n            boundingBox.Min.Y += shapeTransform.Position.Y;\n            boundingBox.Min.Z += shapeTransform.Position.Z;\n\n        }\n\n\n        /// <summary>\n        /// Gets the bounding box of the mesh transformed first into world space, and then into the local space of another affine transform.\n        /// </summary>\n        /// <param name=\"shapeTransform\">Transform to use to put the shape into world space.</param>\n        /// <param name=\"spaceTransform\">Used as the frame of reference to compute the bounding box.\n        /// In effect, the shape is transformed by the inverse of the space transform to compute its bounding box in local space.</param>\n        /// <param name=\"boundingBox\">Bounding box in the local space.</param>\n        public void GetLocalBoundingBox(ref RigidTransform shapeTransform, ref AffineTransform spaceTransform, out BoundingBox boundingBox)\n        {\n#if !WINDOWS\n            boundingBox = new BoundingBox();\n#endif\n            //TODO: This method peforms quite a few sqrts because the collision margin can get scaled, and so cannot be applied as a final step.\n            //There should be a better way to do this.\n            //Additionally, this bounding box is not consistent in all cases with the post-add version.  Adding the collision margin at the end can\n            //slightly overestimate the size of a margin expanded shape at the corners, which is fine (and actually important for the box-box special case).\n\n            //Move forward into convex's space, backwards into the new space's local space.\n            AffineTransform transform;\n            AffineTransform.Invert(ref spaceTransform, out transform);\n            AffineTransform.Multiply(ref shapeTransform, ref transform, out transform);\n\n            GetBoundingBox(ref transform.LinearTransform, out boundingBox);\n            boundingBox.Max.X += transform.Translation.X;\n            boundingBox.Max.Y += transform.Translation.Y;\n            boundingBox.Max.Z += transform.Translation.Z;\n\n            boundingBox.Min.X += transform.Translation.X;\n            boundingBox.Min.Y += transform.Translation.Y;\n            boundingBox.Min.Z += transform.Translation.Z;\n\n        }\n\n        /// <summary>\n        /// Gets the bounding box of the mesh transformed first into world space, and then into the local space of another affine transform.\n        /// </summary>\n        /// <param name=\"shapeTransform\">Transform to use to put the shape into world space.</param>\n        /// <param name=\"spaceTransform\">Used as the frame of reference to compute the bounding box.\n        /// In effect, the shape is transformed by the inverse of the space transform to compute its bounding box in local space.</param>\n        /// <param name=\"sweep\">World space sweep direction to transform and add to the bounding box.</param>\n        /// <param name=\"boundingBox\">Bounding box in the local space.</param>\n        public void GetSweptLocalBoundingBox(ref RigidTransform shapeTransform, ref AffineTransform spaceTransform, ref Vector3 sweep, out BoundingBox boundingBox)\n        {\n            GetLocalBoundingBox(ref shapeTransform, ref spaceTransform, out boundingBox);\n            Vector3 expansion;\n            Matrix3x3.TransformTranspose(ref sweep, ref spaceTransform.LinearTransform, out expansion);\n            Toolbox.ExpandBoundingBox(ref boundingBox, ref expansion);\n        }\n\n\n        /// <summary>\n        /// Computes the volume, center of mass, and volume distribution of the shape.\n        /// </summary>\n        /// <param name=\"shapeInfo\">Data about the shape.</param>\n        public override void ComputeDistributionInformation(out ShapeDistributionInformation shapeInfo)\n        {\n            ComputeShapeInformation(this.TriangleMesh.Data as TransformableMeshData, out shapeInfo);\n        }\n\n        public override EntityCollidable GetCollidableInstance()\n        {\n            return new MobileMeshCollidable(this);\n        }\n\n\n\n      \n    }\n\n    ///<summary>\n    /// Solidity of a triangle or mesh.\n    /// A triangle can be double sided, or allow one of its sides to let interacting objects through.\n    /// The entire mesh can be made solid, which means objects on the interior still generate contacts even if there aren't any triangles to hit.\n    /// Solidity requires the mesh to be closed.\n    ///</summary>\n    public enum MobileMeshSolidity\n    {\n        /// <summary>\n        /// The mesh will interact with objects coming from both directions.\n        /// </summary>\n        DoubleSided,\n        /// <summary>\n        /// The mesh will interact with objects from which the winding of the triangles appears to be clockwise.\n        /// </summary>\n        Clockwise,\n        /// <summary>\n        /// The mesh will interact with objects from which the winding of the triangles appears to be counterclockwise.\n        /// </summary>\n        Counterclockwise,\n        /// <summary>\n        /// The mesh will treat objects inside of its concave shell as if the mesh had volume.  Mesh must be closed for this to work properly.\n        /// </summary>\n        Solid\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/ShapeDistributionInformation.cs",
    "content": "﻿using BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.CollisionShapes\n{\n    ///<summary>\n    /// Contains data about the distribution of volume in a shape.\n    ///</summary>\n    public struct ShapeDistributionInformation\n    {\n        ///<summary>\n        /// The distribution of volume in a shape.\n        /// This can be scaled to create an inertia tensor for a shape.\n        ///</summary>\n        public Matrix3x3 VolumeDistribution;\n        /// <summary>\n        /// The center of a shape.\n        /// </summary>\n        public Vector3 Center;\n        /// <summary>\n        /// The volume of a shape.\n        /// </summary>\n        public float Volume;\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/StaticGroupShape.cs",
    "content": "﻿using System;\nusing BEPUphysics.DataStructures;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\n\nnamespace BEPUphysics.CollisionShapes\n{\n    ///<summary>\n    /// The shape information used by a StaticGroup.\n    /// Unlike most shapes, a StaticGroupShape cannot be shared between multiple StaticGroups;\n    /// a StaticGroupShape is linked to a single StaticGroup.\n    ///</summary>\n    public class StaticGroupShape : CollisionShape\n    {\n        //Technically, while this is superior to the 'put a bunch of stuff in the Space' approach, it is still \n        //inferior in maximum performance to an approach which allows for the direct comparison of a static tree against a nonstatic tree.\n        //This would require tighter integration with the broad phase, though.  It's not clear that the performance boost is worth it.\n\n        /// <summary>\n        /// Gets the StaticGroup associated with this StaticGroupShape.  Unlike most shapes, there is a one-to-one relationship\n        /// between StaticGroupShapes and StaticGroups.\n        /// </summary>\n        public StaticGroup StaticGroup\n        {\n            get;\n            private set;\n        }\n\n        /// <summary>\n        /// Gets the bounding box tree associated with this shape.\n        /// Contains Collidable instances as opposed to shapes.\n        /// </summary>\n        public BoundingBoxTree<Collidable> CollidableTree\n        {\n            get;\n            private set;\n        }\n\n\n        ///<summary>\n        /// Constructs a new StaticGroupShape.\n        ///</summary>\n        ///<param name=\"collidables\">List of collidables in the StaticGroup.</param>\n        ///<param name=\"owner\">StaticGroup directly associated with this shape.</param>\n        public StaticGroupShape(IList<Collidable> collidables, StaticGroup owner)\n        {\n            this.StaticGroup = owner;\n            CollidableTree = new BoundingBoxTree<Collidable>(collidables);\n            //Rather than hooking up a bunch of ShapeChanged events here that don't capture the full capacity of change\n            //in our child collidables, we will rely on the user telling the collidable tree to reformat itself directly.\n        }\n\n\n        /// <summary>\n        /// Tests a ray against the collidable.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"result\">Hit data, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public bool RayCast(Ray ray, float maximumLength, out RayCastResult result)\n        {\n            var outputOverlappedElements = PhysicsResources.GetCollidableList();\n            CollidableTree.GetOverlaps(ray, maximumLength, outputOverlappedElements);\n            result = new RayCastResult();\n            result.HitData.T = float.MaxValue;\n            for (int i = 0; i < outputOverlappedElements.Count; ++i)\n            {\n                RayHit hit;\n                if (outputOverlappedElements.Elements[i].RayCast(ray, maximumLength, out hit))\n                {\n                    if (hit.T < result.HitData.T)\n                    {\n                        result.HitData = hit;\n                        result.HitObject = outputOverlappedElements.Elements[i];\n                    }\n                }\n            }\n            PhysicsResources.GiveBack(outputOverlappedElements);\n            return result.HitData.T < float.MaxValue;\n        }\n\n        /// <summary>\n        /// Tests a ray against the collidable.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length, in units of the ray's direction's length, to test.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <param name=\"result\">Hit data, if any.</param>\n        /// <returns>Whether or not the ray hit the entry.</returns>\n        public bool RayCast(Ray ray, float maximumLength, Func<BroadPhaseEntry, bool> filter, out RayCastResult result)\n        {\n            var outputOverlappedElements = PhysicsResources.GetCollidableList();\n            CollidableTree.GetOverlaps(ray, maximumLength, outputOverlappedElements);\n            result = new RayCastResult();\n            result.HitData.T = float.MaxValue;\n            for (int i = 0; i < outputOverlappedElements.Count; ++i)\n            {\n                RayHit hit;\n                if (outputOverlappedElements.Elements[i].RayCast(ray, maximumLength, filter, out hit))\n                {\n                    if (hit.T < result.HitData.T)\n                    {\n                        result.HitData = hit;\n                        result.HitObject = outputOverlappedElements.Elements[i];\n                    }\n                }\n            }\n            PhysicsResources.GiveBack(outputOverlappedElements);\n            return result.HitData.T < float.MaxValue;\n        }\n\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"result\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public bool ConvexCast(ConvexShapes.ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayCastResult result)\n        {\n            var outputOverlappedElements = PhysicsResources.GetCollidableList();\n            BoundingBox boundingBox;\n            castShape.GetSweptBoundingBox(ref startingTransform, ref sweep, out boundingBox);\n\n            CollidableTree.GetOverlaps(boundingBox, outputOverlappedElements);\n            result = new RayCastResult();\n            result.HitData.T = float.MaxValue;\n            for (int i = 0; i < outputOverlappedElements.Count; ++i)\n            {\n                RayHit hit;\n                if (outputOverlappedElements.Elements[i].ConvexCast(castShape, ref startingTransform, ref sweep, out hit))\n                {\n                    if (hit.T < result.HitData.T)\n                    {\n                        result.HitData = hit;\n                        result.HitObject = outputOverlappedElements.Elements[i];\n                    }\n                }\n            }\n            PhysicsResources.GiveBack(outputOverlappedElements);\n            return result.HitData.T < float.MaxValue;\n        }\n\n        /// <summary>\n        /// Casts a convex shape against the collidable.\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape.</param>\n        /// <param name=\"filter\">Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present\n        /// in the entry, this filter will be passed into inner ray casts.</param>\n        /// <param name=\"result\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public bool ConvexCast(ConvexShapes.ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, Func<BroadPhaseEntry, bool> filter, out RayCastResult result)\n        {\n            var outputOverlappedElements = PhysicsResources.GetCollidableList();\n            BoundingBox boundingBox;\n            castShape.GetSweptBoundingBox(ref startingTransform, ref sweep, out boundingBox);\n\n            CollidableTree.GetOverlaps(boundingBox, outputOverlappedElements);\n            result = new RayCastResult();\n            result.HitData.T = float.MaxValue;\n            for (int i = 0; i < outputOverlappedElements.Count; ++i)\n            {\n                RayHit hit;\n                if (outputOverlappedElements.Elements[i].ConvexCast(castShape, ref startingTransform, ref sweep, filter, out hit))\n                {\n                    if (hit.T < result.HitData.T)\n                    {\n                        result.HitData = hit;\n                        result.HitObject = outputOverlappedElements.Elements[i];\n                    }\n                }\n            }\n            PhysicsResources.GiveBack(outputOverlappedElements);\n            return result.HitData.T < float.MaxValue;\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/StaticMeshShape.cs",
    "content": "﻿using BEPUphysics.DataStructures;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.CollisionShapes\n{\n    ///<summary>\n    /// The local space information needed by a StaticMesh.\n    /// Since the hierarchy is in world space and owned by the StaticMesh collidable,\n    /// this is a pretty lightweight object.\n    ///</summary>\n    public class StaticMeshShape : CollisionShape\n    {\n        TransformableMeshData triangleMeshData;\n        ///<summary>\n        /// Gets the triangle mesh data composing the StaticMeshShape.\n        ///</summary>\n        public TransformableMeshData TriangleMeshData\n        {\n            get\n            {\n                return triangleMeshData;\n            }\n        }\n\n\n\n\n\n\n        ///<summary>\n        /// Constructs a new StaticMeshShape.\n        ///</summary>\n        ///<param name=\"vertices\">Vertices of the mesh.</param>\n        ///<param name=\"indices\">Indices of the mesh.</param>\n        ///<param name=\"worldTransform\">World transform to use in the local space data.</param>\n        public StaticMeshShape(Vector3[] vertices, uint[] indices, int indexCount, AffineTransform worldTransform)\n        {\n            triangleMeshData = new TransformableMeshData(vertices, indices, indexCount, worldTransform);\n        }\n\n\n\n        ///<summary>\n        /// Constructs a new StaticMeshShape.\n        ///</summary>\n        ///<param name=\"vertices\">Vertices of the mesh.</param>\n        ///<param name=\"indices\">Indices of the mesh.</param>\n        public StaticMeshShape(Vector3[] vertices, uint[] indices, int indexCount)\n        {\n            triangleMeshData = new TransformableMeshData(vertices, indices, indexCount);\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionShapes/TerrainShape.cs",
    "content": "﻿using System;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.CollisionShapes\n{\n    ///<summary>\n    /// The local space data needed by a Terrain collidable.\n    /// Contains the Heightmap and other information.\n    ///</summary>\n    public class TerrainShape : CollisionShape\n    {\n        private float[,] heights;\n        //note: changing heights in array does not fire OnShapeChanged automatically.\n        //Need to notify parent manually if you do it.\n        ///<summary>\n        /// Gets or sets the height field of the terrain shape.\n        ///</summary>\n        public float[,] Heights\n        {\n            get\n            {\n                return heights;\n            }\n            set\n            {\n                heights = value;\n                OnShapeChanged();\n            }\n        }\n\n\n\n        QuadTriangleOrganization quadTriangleOrganization;\n        ///<summary>\n        /// Gets or sets the quad triangle organization.\n        ///</summary>\n        public QuadTriangleOrganization QuadTriangleOrganization\n        {\n            get\n            {\n                return quadTriangleOrganization;\n            }\n            set\n            {\n                quadTriangleOrganization = value;\n                OnShapeChanged();\n            }\n        }\n\n        ///<summary>\n        /// Constructs a TerrainShape.\n        ///</summary>\n        ///<param name=\"heights\">Heights array used for the shape.</param>\n        ///<param name=\"triangleOrganization\">Triangle organization of each quad.</param>\n        ///<exception cref=\"ArgumentException\">Thrown if the heights array has less than 2x2 vertices.</exception>\n        public TerrainShape(float[,] heights, QuadTriangleOrganization triangleOrganization)\n        {\n            if (heights.GetLength(0) <= 1 || heights.GetLength(1) <= 1)\n            {\n                throw new ArgumentException(\"Terrains must have a least 2x2 vertices (one quad).\");\n            }\n            this.heights = heights;\n            quadTriangleOrganization = triangleOrganization;\n        }\n\n        ///<summary>\n        /// Constructs a TerrainShape.\n        ///</summary>\n        ///<param name=\"heights\">Heights array used for the shape.</param>\n        public TerrainShape(float[,] heights)\n            : this(heights, QuadTriangleOrganization.BottomLeftUpperRight)\n        {\n        }\n\n\n\n        ///<summary>\n        /// Constructs the bounding box of the terrain given a transform.\n        ///</summary>\n        ///<param name=\"transform\">Transform to apply to the terrain during the bounding box calculation.</param>\n        ///<param name=\"boundingBox\">Bounding box of the terrain shape when transformed.</param>\n        public void GetBoundingBox(ref AffineTransform transform, out BoundingBox boundingBox)\n        {\n#if !WINDOWS\n            boundingBox = new BoundingBox();\n#endif\n            float minX = float.MaxValue, maxX = -float.MaxValue,\n                  minY = float.MaxValue, maxY = -float.MaxValue,\n                  minZ = float.MaxValue, maxZ = -float.MaxValue;\n            Vector3 minXvertex = new Vector3(),\n                    maxXvertex = new Vector3(),\n                    minYvertex = new Vector3(),\n                    maxYvertex = new Vector3(),\n                    minZvertex = new Vector3(),\n                    maxZvertex = new Vector3();\n\n            //Find the extreme locations.\n            for (int i = 0; i < heights.GetLength(0); i++)\n            {\n                for (int j = 0; j < heights.GetLength(1); j++)\n                {\n                    var vertex = new Vector3(i, heights[i, j], j);\n                    Matrix3x3.Transform(ref vertex, ref transform.LinearTransform, out vertex);\n                    if (vertex.X < minX)\n                    {\n                        minX = vertex.X;\n                        minXvertex = vertex;\n                    }\n                    else if (vertex.X > maxX)\n                    {\n                        maxX = vertex.X;\n                        maxXvertex = vertex;\n                    }\n\n                    if (vertex.Y < minY)\n                    {\n                        minY = vertex.Y;\n                        minYvertex = vertex;\n                    }\n                    else if (vertex.Y > maxY)\n                    {\n                        maxY = vertex.Y;\n                        maxYvertex = vertex;\n                    }\n\n                    if (vertex.Z < minZ)\n                    {\n                        minZ = vertex.Z;\n                        minZvertex = vertex;\n                    }\n                    else if (vertex.Z > maxZ)\n                    {\n                        maxZ = vertex.Z;\n                        maxZvertex = vertex;\n                    }\n                }\n            }\n\n            //Shift the bounding box.\n            boundingBox.Min.X = minXvertex.X + transform.Translation.X;\n            boundingBox.Min.Y = minYvertex.Y + transform.Translation.Y;\n            boundingBox.Min.Z = minZvertex.Z + transform.Translation.Z;\n            boundingBox.Max.X = maxXvertex.X + transform.Translation.X;\n            boundingBox.Max.Y = maxYvertex.Y + transform.Translation.Y;\n            boundingBox.Max.Z = maxZvertex.Z + transform.Translation.Z;\n        }\n        ///<summary>\n        /// Tests a ray against the terrain shape.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the shape.</param>\n        ///<param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        ///<param name=\"transform\">Transform to apply to the terrain shape during the test.</param>\n        ///<param name=\"hit\">Hit data of the ray cast, if any.</param>\n        ///<returns>Whether or not the ray hit the transformed terrain shape.</returns>\n        public bool RayCast(ref Ray ray, float maximumLength, ref AffineTransform transform, out RayHit hit)\n        {\n            return RayCast(ref ray, maximumLength, ref transform, TriangleSidedness.Counterclockwise, out hit);\n        }\n        ///<summary>\n        /// Tests a ray against the terrain shape.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the shape.</param>\n        ///<param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        ///<param name=\"transform\">Transform to apply to the terrain shape during the test.</param>\n        ///<param name=\"sidedness\">Sidedness of the triangles to use when raycasting.</param>\n        ///<param name=\"hit\">Hit data of the ray cast, if any.</param>\n        ///<returns>Whether or not the ray hit the transformed terrain shape.</returns>\n        public bool RayCast(ref Ray ray, float maximumLength, ref AffineTransform transform, TriangleSidedness sidedness, out RayHit hit)\n        {\n            hit = new RayHit();\n            //Put the ray into local space.\n            Ray localRay;\n            AffineTransform inverse;\n            AffineTransform.Invert(ref transform, out inverse);\n            Matrix3x3.Transform(ref ray.Direction, ref inverse.LinearTransform, out localRay.Direction);\n            AffineTransform.Transform(ref ray.Position, ref inverse, out localRay.Position);\n\n            //Use rasterizey traversal.\n            //The origin is at 0,0,0 and the map goes +X, +Y, +Z.\n            //if it's before the origin and facing away, or outside the max and facing out, early out.\n            float maxX = heights.GetLength(0) - 1;\n            float maxZ = heights.GetLength(1) - 1;\n\n            Vector3 progressingOrigin = localRay.Position;\n            float distance = 0;\n            //Check the outside cases first.\n            if (progressingOrigin.X < 0)\n            {\n                if (localRay.Direction.X > 0)\n                {\n                    //Off the left side.\n                    float timeToMinX = -progressingOrigin.X / localRay.Direction.X;\n                    distance += timeToMinX;\n                    Vector3 increment;\n                    Vector3.Multiply(ref localRay.Direction, timeToMinX, out increment);\n                    Vector3.Add(ref increment, ref progressingOrigin, out progressingOrigin);\n                }\n                else\n                    return false; //Outside and pointing away from the terrain.\n            }\n            else if (progressingOrigin.X > maxX)\n            {\n                if (localRay.Direction.X < 0)\n                {\n                    //Off the left side.\n                    float timeToMinX = -(progressingOrigin.X - maxX) / localRay.Direction.X;\n                    distance += timeToMinX;\n                    Vector3 increment;\n                    Vector3.Multiply(ref localRay.Direction, timeToMinX, out increment);\n                    Vector3.Add(ref increment, ref progressingOrigin, out progressingOrigin);\n                }\n                else\n                    return false; //Outside and pointing away from the terrain.\n            }\n\n            if (progressingOrigin.Z < 0)\n            {\n                if (localRay.Direction.Z > 0)\n                {\n                    float timeToMinZ = -progressingOrigin.Z / localRay.Direction.Z;\n                    distance += timeToMinZ;\n                    Vector3 increment;\n                    Vector3.Multiply(ref localRay.Direction, timeToMinZ, out increment);\n                    Vector3.Add(ref increment, ref progressingOrigin, out progressingOrigin);\n                }\n                else\n                    return false;\n            }\n            else if (progressingOrigin.Z > maxZ)\n            {\n                if (localRay.Direction.Z < 0)\n                {\n                    float timeToMinZ = -(progressingOrigin.Z - maxZ) / localRay.Direction.Z;\n                    distance += timeToMinZ;\n                    Vector3 increment;\n                    Vector3.Multiply(ref localRay.Direction, timeToMinZ, out increment);\n                    Vector3.Add(ref increment, ref progressingOrigin, out progressingOrigin);\n                }\n                else\n                    return false;\n            }\n\n            if (distance > maximumLength)\n                return false;\n\n\n\n            //By now, we should be entering the main body of the terrain.\n\n            int xCell = (int)progressingOrigin.X;\n            int zCell = (int)progressingOrigin.Z;\n            //If it's hitting the border and going in, then correct the index\n            //so that it will initially target a valid quad.\n            //Without this, a quad beyond the border would be tried and failed.\n            if (xCell == heights.GetLength(0) - 1 && localRay.Direction.X < 0)\n                xCell = heights.GetLength(0) - 2;\n            if (zCell == heights.GetLength(1) - 1 && localRay.Direction.Z < 0)\n                zCell = heights.GetLength(1) - 2;\n\n            while (true)\n            {\n                //Check for a miss.\n                if (xCell < 0 ||\n                    zCell < 0 ||\n                    xCell >= heights.GetLength(0) - 1 ||\n                    zCell >= heights.GetLength(1) - 1)\n                    return false;\n\n                //Test the triangles of this cell.\n                Vector3 v1, v2, v3, v4;\n                // v3 v4\n                // v1 v2\n                GetLocalPosition(xCell, zCell, out v1);\n                GetLocalPosition(xCell + 1, zCell, out v2);\n                GetLocalPosition(xCell, zCell + 1, out v3);\n                GetLocalPosition(xCell + 1, zCell + 1, out v4);\n                RayHit hit1, hit2;\n                bool didHit1;\n                bool didHit2;\n\n                //Don't bother doing ray intersection tests if the ray can't intersect it.\n\n                float highest = v1.Y;\n                float lowest = v1.Y;\n                if (v2.Y > highest)\n                    highest = v2.Y;\n                else if (v2.Y < lowest)\n                    lowest = v2.Y;\n                if (v3.Y > highest)\n                    highest = v3.Y;\n                else if (v3.Y < lowest)\n                    lowest = v3.Y;\n                if (v4.Y > highest)\n                    highest = v4.Y;\n                else if (v4.Y < lowest)\n                    lowest = v4.Y;\n\n\n                if (!(progressingOrigin.Y > highest && localRay.Direction.Y > 0 ||\n                    progressingOrigin.Y < lowest && localRay.Direction.Y < 0))\n                {\n\n\n                    if (quadTriangleOrganization == QuadTriangleOrganization.BottomLeftUpperRight)\n                    {\n                        //Always perform the raycast as if Y+ in local space is the way the triangles are facing.\n                        didHit1 = Toolbox.FindRayTriangleIntersection(ref localRay, maximumLength, sidedness, ref v1, ref v2, ref v3, out hit1);\n                        didHit2 = Toolbox.FindRayTriangleIntersection(ref localRay, maximumLength, sidedness, ref v2, ref v4, ref v3, out hit2);\n                    }\n                    else //if (quadTriangleOrganization == CollisionShapes.QuadTriangleOrganization.BottomRightUpperLeft)\n                    {\n                        didHit1 = Toolbox.FindRayTriangleIntersection(ref localRay, maximumLength, sidedness, ref v1, ref v2, ref v4, out hit1);\n                        didHit2 = Toolbox.FindRayTriangleIntersection(ref localRay, maximumLength, sidedness, ref v1, ref v4, ref v3, out hit2);\n                    }\n                    if (didHit1 && didHit2)\n                    {\n                        if (hit1.T < hit2.T)\n                        {\n                            Vector3.Multiply(ref ray.Direction, hit1.T, out hit.Location);\n                            Vector3.Add(ref hit.Location, ref ray.Position, out hit.Location);\n                            Matrix3x3.TransformTranspose(ref hit1.Normal, ref inverse.LinearTransform, out hit.Normal);\n                            hit.T = hit1.T;\n                            return true;\n                        }\n                        Vector3.Multiply(ref ray.Direction, hit2.T, out hit.Location);\n                        Vector3.Add(ref hit.Location, ref ray.Position, out hit.Location);\n                        Matrix3x3.TransformTranspose(ref hit2.Normal, ref inverse.LinearTransform, out hit.Normal);\n                        hit.T = hit2.T;\n                        return true;\n                    }\n                    else if (didHit1)\n                    {\n                        Vector3.Multiply(ref ray.Direction, hit1.T, out hit.Location);\n                        Vector3.Add(ref hit.Location, ref ray.Position, out hit.Location);\n                        Matrix3x3.TransformTranspose(ref hit1.Normal, ref inverse.LinearTransform, out hit.Normal);\n                        hit.T = hit1.T;\n                        return true;\n                    }\n                    else if (didHit2)\n                    {\n                        Vector3.Multiply(ref ray.Direction, hit2.T, out hit.Location);\n                        Vector3.Add(ref hit.Location, ref ray.Position, out hit.Location);\n                        Matrix3x3.TransformTranspose(ref hit2.Normal, ref inverse.LinearTransform, out hit.Normal);\n                        hit.T = hit2.T;\n                        return true;\n                    }\n                }\n\n                //Move to the next cell.\n\n                float timeToX;\n                if (localRay.Direction.X < 0)\n                    timeToX = -(progressingOrigin.X - xCell) / localRay.Direction.X;\n                else if (ray.Direction.X > 0)\n                    timeToX = (xCell + 1 - progressingOrigin.X) / localRay.Direction.X;\n                else\n                    timeToX = float.MaxValue;\n\n                float timeToZ;\n                if (localRay.Direction.Z < 0)\n                    timeToZ = -(progressingOrigin.Z - zCell) / localRay.Direction.Z;\n                else if (localRay.Direction.Z > 0)\n                    timeToZ = (zCell + 1 - progressingOrigin.Z) / localRay.Direction.Z;\n                else\n                    timeToZ = float.MaxValue;\n\n                //Move to the next cell.\n                if (timeToX < timeToZ)\n                {\n                    if (localRay.Direction.X < 0)\n                        xCell--;\n                    else\n                        xCell++;\n\n                    distance += timeToX;\n                    if (distance > maximumLength)\n                        return false;\n\n                    Vector3 increment;\n                    Vector3.Multiply(ref localRay.Direction, timeToX, out increment);\n                    Vector3.Add(ref increment, ref progressingOrigin, out progressingOrigin);\n                }\n                else\n                {\n                    if (localRay.Direction.Z < 0)\n                        zCell--;\n                    else\n                        zCell++;\n\n                    distance += timeToZ;\n                    if (distance > maximumLength)\n                        return false;\n\n                    Vector3 increment;\n                    Vector3.Multiply(ref localRay.Direction, timeToZ, out increment);\n                    Vector3.Add(ref increment, ref progressingOrigin, out progressingOrigin);\n                }\n\n            }\n\n\n        }\n\n        ///<summary>\n        /// Gets the position of a vertex at the given indices in local space.\n        ///</summary>\n        ///<param name=\"i\">Index in the first dimension.</param>\n        ///<param name=\"j\">Index in the second dimension.</param>\n        ///<param name=\"v\">Local space position at the given vertice.s</param>\n        public void GetLocalPosition(int i, int j, out Vector3 v)\n        {\n#if !WINDOWS\n            v = new Vector3();\n#endif\n            v.X = i;\n            v.Y = heights[i, j];\n            v.Z = j;\n        }\n\n        /// <summary>\n        /// Gets the world space position of a vertex in the terrain at the given indices.\n        /// </summary>\n        ///<param name=\"i\">Index in the first dimension.</param>\n        ///<param name=\"j\">Index in the second dimension.</param>\n        /// <param name=\"transform\">Transform to apply to the vertex.</param>\n        /// <param name=\"position\">Transformed position of the vertex at the given indices.</param>\n        public void GetPosition(int i, int j, ref AffineTransform transform, out Vector3 position)\n        {\n            if (i <= 0)\n                i = 0;\n            else if (i >= heights.GetLength(0))\n                i = heights.GetLength(0) - 1;\n            if (j <= 0)\n                j = 0;\n            else if (j >= heights.GetLength(1))\n                j = heights.GetLength(1) - 1;\n#if !WINDOWS\n            position = new Vector3();\n#endif\n            position.X = i;\n            position.Y = heights[i, j];\n            position.Z = j;\n            AffineTransform.Transform(ref position, ref transform, out position);\n\n\n        }\n\n\n        /// <summary>\n        /// Gets the world space normal at the given indices.\n        /// </summary>\n        ///<param name=\"i\">Index in the first dimension.</param>\n        ///<param name=\"j\">Index in the second dimension.</param>\n        /// <param name=\"transform\">Transform to apply to the terrain while computing the normal.</param>\n        /// <param name=\"normal\">World space normal at the given indices.</param>\n        public void GetNormal(int i, int j, ref AffineTransform transform, out Vector3 normal)\n        {\n            Vector3 top;\n            Vector3 bottom;\n            Vector3 right;\n            Vector3 left;\n\n            if (i <= 0)\n                i = 0;\n            else if (i >= heights.GetLength(0))\n                i = heights.GetLength(0) - 1;\n            if (j <= 0)\n                j = 0;\n            else if (j >= heights.GetLength(1))\n                j = heights.GetLength(1) - 1;\n\n            GetPosition(i, Math.Min(j + 1, heights.GetLength(1) - 1), ref transform, out top);\n            GetPosition(i, Math.Max(j - 1, 0), ref transform, out bottom);\n            GetPosition(Math.Min(i + 1, heights.GetLength(0) - 1), j, ref transform, out right);\n            GetPosition(Math.Max(i - 1, 0), j, ref transform, out left);\n\n            Vector3 temp;\n            Vector3.Subtract(ref top, ref bottom, out temp);\n            Vector3.Subtract(ref right, ref left, out normal);\n            Vector3.Cross(ref temp, ref normal, out normal);\n\n            normal.Normalize();\n        }\n\n        ///<summary>\n        /// Gets overlapped triangles with the terrain shape with a bounding box in the local space of the shape.\n        ///</summary>\n        ///<param name=\"localSpaceBoundingBox\">Bounding box in the local space of the terrain shape.</param>\n        ///<param name=\"overlappedTriangles\">Triangles whose bounding boxes overlap the input bounding box.</param>\n        public bool GetOverlaps(BoundingBox localSpaceBoundingBox, RawList<TriangleMeshConvexContactManifold.TriangleIndices> overlappedTriangles)\n        {\n            uint width = (uint)heights.GetLength(0);\n            uint minX = (uint)Math.Max((int)localSpaceBoundingBox.Min.X, 0);\n            uint minY = (uint)Math.Max((int)localSpaceBoundingBox.Min.Z, 0);\n            uint maxX = (uint)Math.Min((int)localSpaceBoundingBox.Max.X, width - 2);\n            uint maxY = (uint)Math.Min((int)localSpaceBoundingBox.Max.Z, heights.GetLength(1) - 2);\n            for (uint i = minX; i <= maxX; i++)\n            {\n                for (uint j = minY; j <= maxY; j++)\n                {\n                    //Before adding a triangle to the list, make sure the object isn't too high or low from the quad.\n                    float highest, lowest;\n                    float y1 = heights[i, j];\n                    float y2 = heights[i + 1, j];\n                    float y3 = heights[i, j + 1];\n                    float y4 = heights[i + 1, j + 1];\n\n                    highest = y1;\n                    lowest = y1;\n                    if (y2 > highest)\n                        highest = y2;\n                    else if (y2 < lowest)\n                        lowest = y2;\n                    if (y3 > highest)\n                        highest = y3;\n                    else if (y3 < lowest)\n                        lowest = y3;\n                    if (y4 > highest)\n                        highest = y4;\n                    else if (y4 < lowest)\n                        lowest = y4;\n\n\n                    if (localSpaceBoundingBox.Max.Y < lowest ||\n                        localSpaceBoundingBox.Min.Y > highest)\n                        continue;\n\n                    //Now the local bounding box is very likely intersecting those of the triangles.\n                    //Add the triangles to the list.\n                    var indices = new TriangleMeshConvexContactManifold.TriangleIndices();\n\n                    //v3 v4\n                    //v1 v2\n\n                    if (quadTriangleOrganization == QuadTriangleOrganization.BottomLeftUpperRight)\n                    {\n                        //v1 v2 v3\n                        indices.A = i + j * width;\n                        indices.B = i + 1 + j * width;\n                        indices.C = i + (j + 1) * width;\n                        overlappedTriangles.Add(indices);\n\n                        //v2 v4 v3\n                        indices.A = i + 1 + j * width;\n                        indices.B = i + 1 + (j + 1) * width;\n                        indices.C = i + (j + 1) * width;\n                        overlappedTriangles.Add(indices);\n                    }\n                    else //Bottom right, Upper left\n                    {\n                        //v1 v2 v4\n                        indices.A = i + j * width;\n                        indices.B = i + 1 + j * width;\n                        indices.C = i + 1 + (j + 1) * width;\n                        overlappedTriangles.Add(indices);\n\n                        //v1 v4 v3\n                        indices.A = i + j * width;\n                        indices.B = i + 1 + (j + 1) * width;\n                        indices.C = i + (j + 1) * width;\n                        overlappedTriangles.Add(indices);\n                    }\n\n                }\n            }\n            return overlappedTriangles.Count > 0;\n        }\n\n        ///<summary>\n        /// Gets overlapped triangles with the terrain shape with a bounding box in the local space of the shape.\n        ///</summary>\n        ///<param name=\"localBoundingBox\">Bounding box in the local space of the terrain shape.</param>\n        ///<param name=\"overlappedElements\">Indices of elements whose bounding boxes overlap the input bounding box.</param>\n        public bool GetOverlaps(BoundingBox localBoundingBox, RawList<int> overlappedElements)\n        {\n            int width = heights.GetLength(0);\n            int minX = Math.Max((int)localBoundingBox.Min.X, 0);\n            int minY = Math.Max((int)localBoundingBox.Min.Z, 0);\n            int maxX = Math.Min((int)localBoundingBox.Max.X, width - 2);\n            int maxY = Math.Min((int)localBoundingBox.Max.Z, heights.GetLength(1) - 2);\n            for (int i = minX; i <= maxX; i++)\n            {\n                for (int j = minY; j <= maxY; j++)\n                {\n                    //Before adding a triangle to the list, make sure the object isn't too high or low from the quad.\n                    float highest, lowest;\n                    float y1 = heights[i, j];\n                    float y2 = heights[i + 1, j];\n                    float y3 = heights[i, j + 1];\n                    float y4 = heights[i + 1, j + 1];\n\n                    highest = y1;\n                    lowest = y1;\n                    if (y2 > highest)\n                        highest = y2;\n                    else if (y2 < lowest)\n                        lowest = y2;\n                    if (y3 > highest)\n                        highest = y3;\n                    else if (y3 < lowest)\n                        lowest = y3;\n                    if (y4 > highest)\n                        highest = y4;\n                    else if (y4 < lowest)\n                        lowest = y4;\n\n\n                    if (localBoundingBox.Max.Y < lowest ||\n                        localBoundingBox.Min.Y > highest)\n                        continue;\n\n                    //Now the local bounding box is very likely intersecting those of the triangles.\n                    //Add the triangles to the list.\n                    int quadIndex = (i + j * width) * 2;\n                    overlappedElements.Add(quadIndex);\n                    overlappedElements.Add(quadIndex + 1);\n\n\n                }\n            }\n            return overlappedElements.Count > 0;\n        }\n\n        ///<summary>\n        /// Gets a world space triangle in the terrain at the given indices (as if it were a mesh).\n        ///</summary>\n        ///<param name=\"indices\">Indices of the triangle.</param>\n        ///<param name=\"transform\">Transform to apply to the triangle vertices.</param>\n        ///<param name=\"a\">First vertex of the triangle.</param>\n        ///<param name=\"b\">Second vertex of the triangle.</param>\n        ///<param name=\"c\">Third vertex of the triangle.</param>\n        public void GetTriangle(ref TriangleMeshConvexContactManifold.TriangleIndices indices, ref AffineTransform transform, out Vector3 a, out Vector3 b, out Vector3 c)\n        {\n            //Reverse the encoded index:\n            //index = i + width * j\n            int width = heights.GetLength(0);\n            int columnA = (int)indices.A / width;\n            int rowA = (int)indices.A - columnA * width;\n            int columnB = (int)indices.B / width;\n            int rowB = (int)indices.B - columnB * width;\n            int columnC = (int)indices.C / width;\n            int rowC = (int)indices.C - columnC * width;\n            GetPosition(rowA, columnA, ref transform, out a);\n            GetPosition(rowB, columnB, ref transform, out b);\n            GetPosition(rowC, columnC, ref transform, out c);\n        }\n\n        ///<summary>\n        /// Gets a world space triangle in the terrain at the given triangle index.\n        ///</summary>\n        ///<param name=\"index\">Index of the triangle.</param>\n        ///<param name=\"transform\">Transform to apply to the triangle vertices.</param>\n        ///<param name=\"a\">First vertex of the triangle.</param>\n        ///<param name=\"b\">Second vertex of the triangle.</param>\n        ///<param name=\"c\">Third vertex of the triangle.</param>\n        public void GetTriangle(int index, ref AffineTransform transform, out Vector3 a, out Vector3 b, out Vector3 c)\n        {\n            //Find the quad.\n            int quadIndex = index / 2;\n            bool isFirstTriangle = quadIndex * 2 == index;\n            int column = quadIndex / heights.GetLength(0);\n            int row = quadIndex - column * heights.GetLength(0);\n\n            if (quadTriangleOrganization == CollisionShapes.QuadTriangleOrganization.BottomLeftUpperRight)\n            {\n                if (isFirstTriangle)\n                {\n                    GetPosition(row, column, ref transform, out a);\n                    GetPosition(row + 1, column, ref transform, out b);\n                    GetPosition(row, column + 1, ref transform, out c);\n                }\n                else\n                {\n                    GetPosition(row, column + 1, ref transform, out a);\n                    GetPosition(row + 1, column + 1, ref transform, out b);\n                    GetPosition(row + 1, column, ref transform, out c);\n                }\n            }\n            else\n            {\n                //The quad is BottomRightUpperLeft.\n                if (isFirstTriangle)\n                {\n                    GetPosition(row, column, ref transform, out a);\n                    GetPosition(row + 1, column, ref transform, out b);\n                    GetPosition(row + 1, column + 1, ref transform, out c);\n                }\n                else\n                {\n                    GetPosition(row, column, ref transform, out a);\n                    GetPosition(row, column + 1, ref transform, out b);\n                    GetPosition(row + 1, column + 1, ref transform, out c);\n                }\n\n            }\n        }\n\n\n    }\n\n    /// <summary>\n    /// Defines how a Terrain organizes triangles in its quads.\n    /// </summary>\n    public enum QuadTriangleOrganization\n    {\n        /// <summary>\n        /// Triangle with a right angle at the (-i,-j) position and another at the (+i,+j) position.\n        /// </summary>\n        BottomLeftUpperRight,\n        /// <summary>\n        /// Triangle with a right angle at the (+i,-j) position and another at the high (-i,+j) position.\n        /// </summary>\n        BottomRightUpperLeft\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/BoxBoxCollider.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing System.Diagnostics;\nusing BEPUphysics.Settings;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms\n{\n    /// <summary>\n    /// Stores basic data used by some collision systems.\n    /// </summary>\n    [StructLayout(LayoutKind.Sequential)]\n    public struct BoxContactData : IEquatable<BoxContactData>\n    {\n        /// <summary>\n        /// Position of the candidate contact.\n        /// </summary>\n        public Vector3 Position;\n\n        /// <summary>\n        /// Depth of the candidate contact.\n        /// </summary>\n        public float Depth;\n\n        /// <summary>\n        /// Id of the candidate contact.\n        /// </summary>\n        public int Id;\n\n        #region IEquatable<BoxContactData> Members\n\n        /// <summary>\n        /// Returns true if the other data has the same id.\n        /// </summary>\n        /// <param name=\"other\">Data to compare.</param>\n        /// <returns>True if the other data has the same id, false otherwise.</returns>\n        public bool Equals(BoxContactData other)\n        {\n            return Id == other.Id;\n        }\n\n        #endregion\n    }\n\n\n#if WINDOWS\n    [StructLayout(LayoutKind.Sequential, Pack = 1)]\n#else\n#if XBOX360\n    [StructLayout(LayoutKind.Sequential)]\n#endif\n#endif\n    /// <summary>\n    /// Basic storage structure for contact data.\n    /// Designed for performance critical code and pointer access.\n    /// </summary>\n    public struct BoxContactDataCache\n    {\n        public BoxContactData D1;\n        public BoxContactData D2;\n        public BoxContactData D3;\n        public BoxContactData D4;\n\n        public BoxContactData D5;\n        public BoxContactData D6;\n        public BoxContactData D7;\n        public BoxContactData D8;\n\n        //internal BoxContactData d9;\n        //internal BoxContactData d10;\n        //internal BoxContactData d11;\n        //internal BoxContactData d12;\n\n        //internal BoxContactData d13;\n        //internal BoxContactData d14;\n        //internal BoxContactData d15;\n        //internal BoxContactData d16;\n\n        /// <summary>\n        /// Number of elements in the cache.\n        /// </summary>\n        public byte Count;\n\n#if ALLOWUNSAFE\n        /// <summary>\n        /// Removes an item at the given index.\n        /// </summary>\n        /// <param name=\"index\">Index to remove.</param>\n        public unsafe void RemoveAt(int index)\n        {\n            BoxContactDataCache copy = this;\n            BoxContactData* pointer = &copy.D1;\n            pointer[index] = pointer[Count - 1];\n            this = copy;\n            Count--;\n        }\n#endif\n    }\n\n\n    /// <summary>\n    /// Contains helper methods for testing collisions between boxes.\n    /// </summary>\n    public static class BoxBoxCollider\n    {\n        /// <summary>\n        /// Determines if the two boxes are colliding.\n        /// </summary>\n        /// <param name=\"a\">First box to collide.</param>\n        /// <param name=\"b\">Second box to collide.</param>\n        /// <param name=\"transformA\">Transform to apply to shape a.</param>\n        /// <param name=\"transformB\">Transform to apply to shape b.</param>\n        /// <returns>Whether or not the boxes collide.</returns>\n        public static bool AreBoxesColliding(BoxShape a, BoxShape b, ref RigidTransform transformA, ref RigidTransform transformB)\n        {\n            float aX = a.HalfWidth;\n            float aY = a.HalfHeight;\n            float aZ = a.HalfLength;\n\n            float bX = b.HalfWidth;\n            float bY = b.HalfHeight;\n            float bZ = b.HalfLength;\n\n            //Relative rotation from A to B.\n            Matrix3x3 bR;\n\n            Matrix3x3 aO;\n            Matrix3x3.CreateFromQuaternion(ref transformA.Orientation, out aO);\n            Matrix3x3 bO;\n            Matrix3x3.CreateFromQuaternion(ref transformB.Orientation, out bO);\n\n            //Relative translation rotated into A's configuration space.\n            Vector3 t;\n            Vector3.Subtract(ref transformB.Position, ref transformA.Position, out t);\n\n            bR.M11 = aO.M11 * bO.M11 + aO.M12 * bO.M12 + aO.M13 * bO.M13;\n            bR.M12 = aO.M11 * bO.M21 + aO.M12 * bO.M22 + aO.M13 * bO.M23;\n            bR.M13 = aO.M11 * bO.M31 + aO.M12 * bO.M32 + aO.M13 * bO.M33;\n            Matrix3x3 absBR;\n            //Epsilons are added to deal with near-parallel edges.\n            absBR.M11 = Math.Abs(bR.M11) + Toolbox.Epsilon;\n            absBR.M12 = Math.Abs(bR.M12) + Toolbox.Epsilon;\n            absBR.M13 = Math.Abs(bR.M13) + Toolbox.Epsilon;\n            float tX = t.X;\n            t.X = t.X * aO.M11 + t.Y * aO.M12 + t.Z * aO.M13;\n\n            //Test the axes defines by entity A's rotation matrix.\n            //A.X\n            float rb = bX * absBR.M11 + bY * absBR.M12 + bZ * absBR.M13;\n            if (Math.Abs(t.X) > aX + rb)\n                return false;\n            bR.M21 = aO.M21 * bO.M11 + aO.M22 * bO.M12 + aO.M23 * bO.M13;\n            bR.M22 = aO.M21 * bO.M21 + aO.M22 * bO.M22 + aO.M23 * bO.M23;\n            bR.M23 = aO.M21 * bO.M31 + aO.M22 * bO.M32 + aO.M23 * bO.M33;\n            absBR.M21 = Math.Abs(bR.M21) + Toolbox.Epsilon;\n            absBR.M22 = Math.Abs(bR.M22) + Toolbox.Epsilon;\n            absBR.M23 = Math.Abs(bR.M23) + Toolbox.Epsilon;\n            float tY = t.Y;\n            t.Y = tX * aO.M21 + t.Y * aO.M22 + t.Z * aO.M23;\n\n            //A.Y\n            rb = bX * absBR.M21 + bY * absBR.M22 + bZ * absBR.M23;\n            if (Math.Abs(t.Y) > aY + rb)\n                return false;\n\n            bR.M31 = aO.M31 * bO.M11 + aO.M32 * bO.M12 + aO.M33 * bO.M13;\n            bR.M32 = aO.M31 * bO.M21 + aO.M32 * bO.M22 + aO.M33 * bO.M23;\n            bR.M33 = aO.M31 * bO.M31 + aO.M32 * bO.M32 + aO.M33 * bO.M33;\n            absBR.M31 = Math.Abs(bR.M31) + Toolbox.Epsilon;\n            absBR.M32 = Math.Abs(bR.M32) + Toolbox.Epsilon;\n            absBR.M33 = Math.Abs(bR.M33) + Toolbox.Epsilon;\n            t.Z = tX * aO.M31 + tY * aO.M32 + t.Z * aO.M33;\n\n            //A.Z\n            rb = bX * absBR.M31 + bY * absBR.M32 + bZ * absBR.M33;\n            if (Math.Abs(t.Z) > aZ + rb)\n                return false;\n\n            //Test the axes defines by entity B's rotation matrix.\n            //B.X\n            float ra = aX * absBR.M11 + aY * absBR.M21 + aZ * absBR.M31;\n            if (Math.Abs(t.X * bR.M11 + t.Y * bR.M21 + t.Z * bR.M31) > ra + bX)\n                return false;\n\n            //B.Y\n            ra = aX * absBR.M12 + aY * absBR.M22 + aZ * absBR.M32;\n            if (Math.Abs(t.X * bR.M12 + t.Y * bR.M22 + t.Z * bR.M32) > ra + bY)\n                return false;\n\n            //B.Z\n            ra = aX * absBR.M13 + aY * absBR.M23 + aZ * absBR.M33;\n            if (Math.Abs(t.X * bR.M13 + t.Y * bR.M23 + t.Z * bR.M33) > ra + bZ)\n                return false;\n\n            //Now for the edge-edge cases.\n            //A.X x B.X\n            ra = aY * absBR.M31 + aZ * absBR.M21;\n            rb = bY * absBR.M13 + bZ * absBR.M12;\n            if (Math.Abs(t.Z * bR.M21 - t.Y * bR.M31) > ra + rb)\n                return false;\n\n            //A.X x B.Y\n            ra = aY * absBR.M32 + aZ * absBR.M22;\n            rb = bX * absBR.M13 + bZ * absBR.M11;\n            if (Math.Abs(t.Z * bR.M22 - t.Y * bR.M32) > ra + rb)\n                return false;\n\n            //A.X x B.Z\n            ra = aY * absBR.M33 + aZ * absBR.M23;\n            rb = bX * absBR.M12 + bY * absBR.M11;\n            if (Math.Abs(t.Z * bR.M23 - t.Y * bR.M33) > ra + rb)\n                return false;\n\n\n            //A.Y x B.X\n            ra = aX * absBR.M31 + aZ * absBR.M11;\n            rb = bY * absBR.M23 + bZ * absBR.M22;\n            if (Math.Abs(t.X * bR.M31 - t.Z * bR.M11) > ra + rb)\n                return false;\n\n            //A.Y x B.Y\n            ra = aX * absBR.M32 + aZ * absBR.M12;\n            rb = bX * absBR.M23 + bZ * absBR.M21;\n            if (Math.Abs(t.X * bR.M32 - t.Z * bR.M12) > ra + rb)\n                return false;\n\n            //A.Y x B.Z\n            ra = aX * absBR.M33 + aZ * absBR.M13;\n            rb = bX * absBR.M22 + bY * absBR.M21;\n            if (Math.Abs(t.X * bR.M33 - t.Z * bR.M13) > ra + rb)\n                return false;\n\n            //A.Z x B.X\n            ra = aX * absBR.M21 + aY * absBR.M11;\n            rb = bY * absBR.M33 + bZ * absBR.M32;\n            if (Math.Abs(t.Y * bR.M11 - t.X * bR.M21) > ra + rb)\n                return false;\n\n            //A.Z x B.Y\n            ra = aX * absBR.M22 + aY * absBR.M12;\n            rb = bX * absBR.M33 + bZ * absBR.M31;\n            if (Math.Abs(t.Y * bR.M12 - t.X * bR.M22) > ra + rb)\n                return false;\n\n            //A.Z x B.Z\n            ra = aX * absBR.M23 + aY * absBR.M13;\n            rb = bX * absBR.M32 + bY * absBR.M31;\n            if (Math.Abs(t.Y * bR.M13 - t.X * bR.M23) > ra + rb)\n                return false;\n\n            return true;\n        }\n\n        /// <summary>\n        /// Determines if the two boxes are colliding.\n        /// </summary>\n        /// <param name=\"a\">First box to collide.</param>\n        /// <param name=\"b\">Second box to collide.</param>\n        /// <param name=\"separationDistance\">Distance of separation.</param>\n        /// <param name=\"separatingAxis\">Axis of separation.</param>\n        /// <param name=\"transformA\">Transform to apply to shape A.</param>\n        /// <param name=\"transformB\">Transform to apply to shape B.</param>\n        /// <returns>Whether or not the boxes collide.</returns>\n        public static bool AreBoxesColliding(BoxShape a, BoxShape b, ref RigidTransform transformA, ref RigidTransform transformB, out float separationDistance, out Vector3 separatingAxis)\n        {\n            float aX = a.HalfWidth;\n            float aY = a.HalfHeight;\n            float aZ = a.HalfLength;\n\n            float bX = b.HalfWidth;\n            float bY = b.HalfHeight;\n            float bZ = b.HalfLength;\n\n            //Relative rotation from A to B.\n            Matrix3x3 bR;\n\n            Matrix3x3 aO;\n            Matrix3x3.CreateFromQuaternion(ref transformA.Orientation, out aO);\n            Matrix3x3 bO;\n            Matrix3x3.CreateFromQuaternion(ref transformB.Orientation, out bO);\n\n            //Relative translation rotated into A's configuration space.\n            Vector3 t;\n            Vector3.Subtract(ref transformB.Position, ref transformA.Position, out t);\n\n            #region A Face Normals\n\n            bR.M11 = aO.M11 * bO.M11 + aO.M12 * bO.M12 + aO.M13 * bO.M13;\n            bR.M12 = aO.M11 * bO.M21 + aO.M12 * bO.M22 + aO.M13 * bO.M23;\n            bR.M13 = aO.M11 * bO.M31 + aO.M12 * bO.M32 + aO.M13 * bO.M33;\n            Matrix3x3 absBR;\n            //Epsilons are added to deal with near-parallel edges.\n            absBR.M11 = Math.Abs(bR.M11) + Toolbox.Epsilon;\n            absBR.M12 = Math.Abs(bR.M12) + Toolbox.Epsilon;\n            absBR.M13 = Math.Abs(bR.M13) + Toolbox.Epsilon;\n            float tX = t.X;\n            t.X = t.X * aO.M11 + t.Y * aO.M12 + t.Z * aO.M13;\n\n            //Test the axes defines by entity A's rotation matrix.\n            //A.X\n            float rarb = aX + bX * absBR.M11 + bY * absBR.M12 + bZ * absBR.M13;\n            if (t.X > rarb)\n            {\n                separationDistance = t.X - rarb;\n                separatingAxis = new Vector3(aO.M11, aO.M12, aO.M13);\n                return false;\n            }\n            if (t.X < -rarb)\n            {\n                separationDistance = -t.X - rarb;\n                separatingAxis = new Vector3(-aO.M11, -aO.M12, -aO.M13);\n                return false;\n            }\n\n\n            bR.M21 = aO.M21 * bO.M11 + aO.M22 * bO.M12 + aO.M23 * bO.M13;\n            bR.M22 = aO.M21 * bO.M21 + aO.M22 * bO.M22 + aO.M23 * bO.M23;\n            bR.M23 = aO.M21 * bO.M31 + aO.M22 * bO.M32 + aO.M23 * bO.M33;\n            absBR.M21 = Math.Abs(bR.M21) + Toolbox.Epsilon;\n            absBR.M22 = Math.Abs(bR.M22) + Toolbox.Epsilon;\n            absBR.M23 = Math.Abs(bR.M23) + Toolbox.Epsilon;\n            float tY = t.Y;\n            t.Y = tX * aO.M21 + t.Y * aO.M22 + t.Z * aO.M23;\n\n            //A.Y\n            rarb = aY + bX * absBR.M21 + bY * absBR.M22 + bZ * absBR.M23;\n            if (t.Y > rarb)\n            {\n                separationDistance = t.Y - rarb;\n                separatingAxis = new Vector3(aO.M21, aO.M22, aO.M23);\n                return false;\n            }\n            if (t.Y < -rarb)\n            {\n                separationDistance = -t.Y - rarb;\n                separatingAxis = new Vector3(-aO.M21, -aO.M22, -aO.M23);\n                return false;\n            }\n\n            bR.M31 = aO.M31 * bO.M11 + aO.M32 * bO.M12 + aO.M33 * bO.M13;\n            bR.M32 = aO.M31 * bO.M21 + aO.M32 * bO.M22 + aO.M33 * bO.M23;\n            bR.M33 = aO.M31 * bO.M31 + aO.M32 * bO.M32 + aO.M33 * bO.M33;\n            absBR.M31 = Math.Abs(bR.M31) + Toolbox.Epsilon;\n            absBR.M32 = Math.Abs(bR.M32) + Toolbox.Epsilon;\n            absBR.M33 = Math.Abs(bR.M33) + Toolbox.Epsilon;\n            t.Z = tX * aO.M31 + tY * aO.M32 + t.Z * aO.M33;\n\n            //A.Z\n            rarb = aZ + bX * absBR.M31 + bY * absBR.M32 + bZ * absBR.M33;\n            if (t.Z > rarb)\n            {\n                separationDistance = t.Z - rarb;\n                separatingAxis = new Vector3(aO.M31, aO.M32, aO.M33);\n                return false;\n            }\n            if (t.Z < -rarb)\n            {\n                separationDistance = -t.Z - rarb;\n                separatingAxis = new Vector3(-aO.M31, -aO.M32, -aO.M33);\n                return false;\n            }\n\n            #endregion\n\n            #region B Face Normals\n\n            //Test the axes defines by entity B's rotation matrix.\n            //B.X\n            rarb = bX + aX * absBR.M11 + aY * absBR.M21 + aZ * absBR.M31;\n            float tl = t.X * bR.M11 + t.Y * bR.M21 + t.Z * bR.M31;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(bO.M11, bO.M12, bO.M13);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(-bO.M11, -bO.M12, -bO.M13);\n                return false;\n            }\n\n            //B.Y\n            rarb = bY + aX * absBR.M12 + aY * absBR.M22 + aZ * absBR.M32;\n            tl = t.X * bR.M12 + t.Y * bR.M22 + t.Z * bR.M32;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(bO.M21, bO.M22, bO.M23);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(-bO.M21, -bO.M22, -bO.M23);\n                return false;\n            }\n\n\n            //B.Z\n            rarb = bZ + aX * absBR.M13 + aY * absBR.M23 + aZ * absBR.M33;\n            tl = t.X * bR.M13 + t.Y * bR.M23 + t.Z * bR.M33;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(bO.M31, bO.M32, bO.M33);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(-bO.M31, -bO.M32, -bO.M33);\n                return false;\n            }\n\n            #endregion\n\n            #region A.X x B.()\n\n            //Now for the edge-edge cases.\n            //A.X x B.X\n            rarb = aY * absBR.M31 + aZ * absBR.M21 +\n                   bY * absBR.M13 + bZ * absBR.M12;\n            tl = t.Z * bR.M21 - t.Y * bR.M31;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(aO.M12 * bO.M13 - aO.M13 * bO.M12,\n                                             aO.M13 * bO.M11 - aO.M11 * bO.M13,\n                                             aO.M11 * bO.M12 - aO.M12 * bO.M11);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(bO.M12 * aO.M13 - bO.M13 * aO.M12,\n                                             bO.M13 * aO.M11 - bO.M11 * aO.M13,\n                                             bO.M11 * aO.M12 - bO.M12 * aO.M11);\n                return false;\n            }\n\n            //A.X x B.Y\n            rarb = aY * absBR.M32 + aZ * absBR.M22 +\n                   bX * absBR.M13 + bZ * absBR.M11;\n            tl = t.Z * bR.M22 - t.Y * bR.M32;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(aO.M12 * bO.M23 - aO.M13 * bO.M22,\n                                             aO.M13 * bO.M21 - aO.M11 * bO.M23,\n                                             aO.M11 * bO.M22 - aO.M12 * bO.M21);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(bO.M22 * aO.M13 - bO.M23 * aO.M12,\n                                             bO.M23 * aO.M11 - bO.M21 * aO.M13,\n                                             bO.M21 * aO.M12 - bO.M22 * aO.M11);\n                return false;\n            }\n\n            //A.X x B.Z\n            rarb = aY * absBR.M33 + aZ * absBR.M23 +\n                   bX * absBR.M12 + bY * absBR.M11;\n            tl = t.Z * bR.M23 - t.Y * bR.M33;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(aO.M12 * bO.M33 - aO.M13 * bO.M32,\n                                             aO.M13 * bO.M31 - aO.M11 * bO.M33,\n                                             aO.M11 * bO.M32 - aO.M12 * bO.M31);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(bO.M32 * aO.M13 - bO.M33 * aO.M12,\n                                             bO.M33 * aO.M11 - bO.M31 * aO.M13,\n                                             bO.M31 * aO.M12 - bO.M32 * aO.M11);\n                return false;\n            }\n\n            #endregion\n\n            #region A.Y x B.()\n\n            //A.Y x B.X\n            rarb = aX * absBR.M31 + aZ * absBR.M11 +\n                   bY * absBR.M23 + bZ * absBR.M22;\n            tl = t.X * bR.M31 - t.Z * bR.M11;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(aO.M22 * bO.M13 - aO.M23 * bO.M12,\n                                             aO.M23 * bO.M11 - aO.M21 * bO.M13,\n                                             aO.M21 * bO.M12 - aO.M22 * bO.M11);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(bO.M12 * aO.M23 - bO.M13 * aO.M22,\n                                             bO.M13 * aO.M21 - bO.M11 * aO.M23,\n                                             bO.M11 * aO.M22 - bO.M12 * aO.M21);\n                return false;\n            }\n\n            //A.Y x B.Y\n            rarb = aX * absBR.M32 + aZ * absBR.M12 +\n                   bX * absBR.M23 + bZ * absBR.M21;\n            tl = t.X * bR.M32 - t.Z * bR.M12;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(aO.M22 * bO.M23 - aO.M23 * bO.M22,\n                                             aO.M23 * bO.M21 - aO.M21 * bO.M23,\n                                             aO.M21 * bO.M22 - aO.M22 * bO.M21);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(bO.M22 * aO.M23 - bO.M23 * aO.M22,\n                                             bO.M23 * aO.M21 - bO.M21 * aO.M23,\n                                             bO.M21 * aO.M22 - bO.M22 * aO.M21);\n                return false;\n            }\n\n            //A.Y x B.Z\n            rarb = aX * absBR.M33 + aZ * absBR.M13 +\n                   bX * absBR.M22 + bY * absBR.M21;\n            tl = t.X * bR.M33 - t.Z * bR.M13;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(aO.M22 * bO.M33 - aO.M23 * bO.M32,\n                                             aO.M23 * bO.M31 - aO.M21 * bO.M33,\n                                             aO.M21 * bO.M32 - aO.M22 * bO.M31);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(bO.M32 * aO.M23 - bO.M33 * aO.M22,\n                                             bO.M33 * aO.M21 - bO.M31 * aO.M23,\n                                             bO.M31 * aO.M22 - bO.M32 * aO.M21);\n                return false;\n            }\n\n            #endregion\n\n            #region A.Z x B.()\n\n            //A.Z x B.X\n            rarb = aX * absBR.M21 + aY * absBR.M11 +\n                   bY * absBR.M33 + bZ * absBR.M32;\n            tl = t.Y * bR.M11 - t.X * bR.M21;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(aO.M32 * bO.M13 - aO.M33 * bO.M12,\n                                             aO.M33 * bO.M11 - aO.M31 * bO.M13,\n                                             aO.M31 * bO.M12 - aO.M32 * bO.M11);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(bO.M12 * aO.M33 - bO.M13 * aO.M32,\n                                             bO.M13 * aO.M31 - bO.M11 * aO.M33,\n                                             bO.M11 * aO.M32 - bO.M12 * aO.M31);\n                return false;\n            }\n\n            //A.Z x B.Y\n            rarb = aX * absBR.M22 + aY * absBR.M12 +\n                   bX * absBR.M33 + bZ * absBR.M31;\n            tl = t.Y * bR.M12 - t.X * bR.M22;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(aO.M32 * bO.M23 - aO.M33 * bO.M22,\n                                             aO.M33 * bO.M21 - aO.M31 * bO.M23,\n                                             aO.M31 * bO.M22 - aO.M32 * bO.M21);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(bO.M22 * aO.M33 - bO.M23 * aO.M32,\n                                             bO.M23 * aO.M31 - bO.M21 * aO.M33,\n                                             bO.M21 * aO.M32 - bO.M22 * aO.M31);\n                return false;\n            }\n\n            //A.Z x B.Z\n            rarb = aX * absBR.M23 + aY * absBR.M13 +\n                   bX * absBR.M32 + bY * absBR.M31;\n            tl = t.Y * bR.M13 - t.X * bR.M23;\n            if (tl > rarb)\n            {\n                separationDistance = tl - rarb;\n                separatingAxis = new Vector3(aO.M32 * bO.M33 - aO.M33 * bO.M32,\n                                             aO.M33 * bO.M31 - aO.M31 * bO.M33,\n                                             aO.M31 * bO.M32 - aO.M32 * bO.M31);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                separationDistance = -tl - rarb;\n                separatingAxis = new Vector3(bO.M32 * aO.M33 - bO.M33 * aO.M32,\n                                             bO.M33 * aO.M31 - bO.M31 * aO.M33,\n                                             bO.M31 * aO.M32 - bO.M32 * aO.M31);\n                return false;\n            }\n\n            #endregion\n\n            separationDistance = 0;\n            separatingAxis = Vector3.Zero;\n            return true;\n        }\n\n        /// <summary>\n        /// Determines if the two boxes are colliding, including penetration depth data.\n        /// </summary>\n        /// <param name=\"a\">First box to collide.</param>\n        /// <param name=\"b\">Second box to collide.</param>\n        /// <param name=\"distance\">Distance of separation or penetration.</param>\n        /// <param name=\"axis\">Axis of separation or penetration.</param>\n        /// <param name=\"transformA\">Transform to apply to shape A.</param>\n        /// <param name=\"transformB\">Transform to apply to shape B.</param>\n        /// <returns>Whether or not the boxes collide.</returns>\n        public static bool AreBoxesCollidingWithPenetration(BoxShape a, BoxShape b, ref RigidTransform transformA, ref RigidTransform transformB, out float distance, out Vector3 axis)\n        {\n            float aX = a.HalfWidth;\n            float aY = a.HalfHeight;\n            float aZ = a.HalfLength;\n\n            float bX = b.HalfWidth;\n            float bY = b.HalfHeight;\n            float bZ = b.HalfLength;\n\n            //Relative rotation from A to B.\n            Matrix3x3 bR;\n\n            Matrix3x3 aO;\n            Matrix3x3.CreateFromQuaternion(ref transformA.Orientation, out aO);\n            Matrix3x3 bO;\n            Matrix3x3.CreateFromQuaternion(ref transformB.Orientation, out bO);\n\n            //Relative translation rotated into A's configuration space.\n            Vector3 t;\n            Vector3.Subtract(ref transformB.Position, ref transformA.Position, out t);\n\n            float tempDistance;\n            float minimumDistance = -float.MaxValue;\n            var minimumAxis = new Vector3();\n\n            #region A Face Normals\n\n            bR.M11 = aO.M11 * bO.M11 + aO.M12 * bO.M12 + aO.M13 * bO.M13;\n            bR.M12 = aO.M11 * bO.M21 + aO.M12 * bO.M22 + aO.M13 * bO.M23;\n            bR.M13 = aO.M11 * bO.M31 + aO.M12 * bO.M32 + aO.M13 * bO.M33;\n            Matrix3x3 absBR;\n            //Epsilons are added to deal with near-parallel edges.\n            absBR.M11 = Math.Abs(bR.M11) + Toolbox.Epsilon;\n            absBR.M12 = Math.Abs(bR.M12) + Toolbox.Epsilon;\n            absBR.M13 = Math.Abs(bR.M13) + Toolbox.Epsilon;\n            float tX = t.X;\n            t.X = t.X * aO.M11 + t.Y * aO.M12 + t.Z * aO.M13;\n\n            //Test the axes defines by entity A's rotation matrix.\n            //A.X\n            float rarb = aX + bX * absBR.M11 + bY * absBR.M12 + bZ * absBR.M13;\n            if (t.X > rarb)\n            {\n                distance = t.X - rarb;\n                axis = new Vector3(aO.M11, aO.M12, aO.M13);\n                return false;\n            }\n            if (t.X < -rarb)\n            {\n                distance = -t.X - rarb;\n                axis = new Vector3(-aO.M11, -aO.M12, -aO.M13);\n                return false;\n            }\n            //Inside\n            if (t.X > 0)\n            {\n                tempDistance = t.X - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(aO.M11, aO.M12, aO.M13);\n                }\n            }\n            else\n            {\n                tempDistance = -t.X - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-aO.M11, -aO.M12, -aO.M13);\n                }\n            }\n\n\n            bR.M21 = aO.M21 * bO.M11 + aO.M22 * bO.M12 + aO.M23 * bO.M13;\n            bR.M22 = aO.M21 * bO.M21 + aO.M22 * bO.M22 + aO.M23 * bO.M23;\n            bR.M23 = aO.M21 * bO.M31 + aO.M22 * bO.M32 + aO.M23 * bO.M33;\n            absBR.M21 = Math.Abs(bR.M21) + Toolbox.Epsilon;\n            absBR.M22 = Math.Abs(bR.M22) + Toolbox.Epsilon;\n            absBR.M23 = Math.Abs(bR.M23) + Toolbox.Epsilon;\n            float tY = t.Y;\n            t.Y = tX * aO.M21 + t.Y * aO.M22 + t.Z * aO.M23;\n\n            //A.Y\n            rarb = aY + bX * absBR.M21 + bY * absBR.M22 + bZ * absBR.M23;\n            if (t.Y > rarb)\n            {\n                distance = t.Y - rarb;\n                axis = new Vector3(aO.M21, aO.M22, aO.M23);\n                return false;\n            }\n            if (t.Y < -rarb)\n            {\n                distance = -t.Y - rarb;\n                axis = new Vector3(-aO.M21, -aO.M22, -aO.M23);\n                return false;\n            }\n            //Inside\n            if (t.Y > 0)\n            {\n                tempDistance = t.Y - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(aO.M21, aO.M22, aO.M23);\n                }\n            }\n            else\n            {\n                tempDistance = -t.Y - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-aO.M21, -aO.M22, -aO.M23);\n                }\n            }\n\n            bR.M31 = aO.M31 * bO.M11 + aO.M32 * bO.M12 + aO.M33 * bO.M13;\n            bR.M32 = aO.M31 * bO.M21 + aO.M32 * bO.M22 + aO.M33 * bO.M23;\n            bR.M33 = aO.M31 * bO.M31 + aO.M32 * bO.M32 + aO.M33 * bO.M33;\n            absBR.M31 = Math.Abs(bR.M31) + Toolbox.Epsilon;\n            absBR.M32 = Math.Abs(bR.M32) + Toolbox.Epsilon;\n            absBR.M33 = Math.Abs(bR.M33) + Toolbox.Epsilon;\n            t.Z = tX * aO.M31 + tY * aO.M32 + t.Z * aO.M33;\n\n            //A.Z\n            rarb = aZ + bX * absBR.M31 + bY * absBR.M32 + bZ * absBR.M33;\n            if (t.Z > rarb)\n            {\n                distance = t.Z - rarb;\n                axis = new Vector3(aO.M31, aO.M32, aO.M33);\n                return false;\n            }\n            if (t.Z < -rarb)\n            {\n                distance = -t.Z - rarb;\n                axis = new Vector3(-aO.M31, -aO.M32, -aO.M33);\n                return false;\n            }\n            //Inside\n            if (t.Z > 0)\n            {\n                tempDistance = t.Z - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(aO.M31, aO.M32, aO.M33);\n                }\n            }\n            else\n            {\n                tempDistance = -t.Z - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-aO.M31, -aO.M32, -aO.M33);\n                }\n            }\n\n            #endregion\n\n            #region B Face Normals\n\n            //Test the axes defines by entity B's rotation matrix.\n            //B.X\n            rarb = bX + aX * absBR.M11 + aY * absBR.M21 + aZ * absBR.M31;\n            float tl = t.X * bR.M11 + t.Y * bR.M21 + t.Z * bR.M31;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M11, bO.M12, bO.M13);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(-bO.M11, -bO.M12, -bO.M13);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempDistance = tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(bO.M11, bO.M12, bO.M13);\n                }\n            }\n            else\n            {\n                tempDistance = -tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-bO.M11, -bO.M12, -bO.M13);\n                }\n            }\n\n            //B.Y\n            rarb = bY + aX * absBR.M12 + aY * absBR.M22 + aZ * absBR.M32;\n            tl = t.X * bR.M12 + t.Y * bR.M22 + t.Z * bR.M32;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M21, bO.M22, bO.M23);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(-bO.M21, -bO.M22, -bO.M23);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempDistance = tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(bO.M21, bO.M22, bO.M23);\n                }\n            }\n            else\n            {\n                tempDistance = -tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-bO.M21, -bO.M22, -bO.M23);\n                }\n            }\n\n            //B.Z\n            rarb = bZ + aX * absBR.M13 + aY * absBR.M23 + aZ * absBR.M33;\n            tl = t.X * bR.M13 + t.Y * bR.M23 + t.Z * bR.M33;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M31, bO.M32, bO.M33);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(-bO.M31, -bO.M32, -bO.M33);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempDistance = tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(bO.M31, bO.M32, bO.M33);\n                }\n            }\n            else\n            {\n                tempDistance = -tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-bO.M31, -bO.M32, -bO.M33);\n                }\n            }\n\n            #endregion\n\n            float axisLengthInverse;\n            Vector3 tempAxis;\n\n            #region A.X x B.()\n\n            //Now for the edge-edge cases.\n            //A.X x B.X\n            rarb = aY * absBR.M31 + aZ * absBR.M21 +\n                   bY * absBR.M13 + bZ * absBR.M12;\n            tl = t.Z * bR.M21 - t.Y * bR.M31;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(aO.M12 * bO.M13 - aO.M13 * bO.M12,\n                                   aO.M13 * bO.M11 - aO.M11 * bO.M13,\n                                   aO.M11 * bO.M12 - aO.M12 * bO.M11);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M12 * aO.M13 - bO.M13 * aO.M12,\n                                   bO.M13 * aO.M11 - bO.M11 * aO.M13,\n                                   bO.M11 * aO.M12 - bO.M12 * aO.M11);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(aO.M12 * bO.M13 - aO.M13 * bO.M12,\n                                       aO.M13 * bO.M11 - aO.M11 * bO.M13,\n                                       aO.M11 * bO.M12 - aO.M12 * bO.M11);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(bO.M12 * aO.M13 - bO.M13 * aO.M12,\n                                       bO.M13 * aO.M11 - bO.M11 * aO.M13,\n                                       bO.M11 * aO.M12 - bO.M12 * aO.M11);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.X x B.Y\n            rarb = aY * absBR.M32 + aZ * absBR.M22 +\n                   bX * absBR.M13 + bZ * absBR.M11;\n            tl = t.Z * bR.M22 - t.Y * bR.M32;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(aO.M12 * bO.M23 - aO.M13 * bO.M22,\n                                   aO.M13 * bO.M21 - aO.M11 * bO.M23,\n                                   aO.M11 * bO.M22 - aO.M12 * bO.M21);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M22 * aO.M13 - bO.M23 * aO.M12,\n                                   bO.M23 * aO.M11 - bO.M21 * aO.M13,\n                                   bO.M21 * aO.M12 - bO.M22 * aO.M11);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(aO.M12 * bO.M23 - aO.M13 * bO.M22,\n                                       aO.M13 * bO.M21 - aO.M11 * bO.M23,\n                                       aO.M11 * bO.M22 - aO.M12 * bO.M21);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(bO.M22 * aO.M13 - bO.M23 * aO.M12,\n                                       bO.M23 * aO.M11 - bO.M21 * aO.M13,\n                                       bO.M21 * aO.M12 - bO.M22 * aO.M11);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.X x B.Z\n            rarb = aY * absBR.M33 + aZ * absBR.M23 +\n                   bX * absBR.M12 + bY * absBR.M11;\n            tl = t.Z * bR.M23 - t.Y * bR.M33;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(aO.M12 * bO.M33 - aO.M13 * bO.M32,\n                                   aO.M13 * bO.M31 - aO.M11 * bO.M33,\n                                   aO.M11 * bO.M32 - aO.M12 * bO.M31);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M32 * aO.M13 - bO.M33 * aO.M12,\n                                   bO.M33 * aO.M11 - bO.M31 * aO.M13,\n                                   bO.M31 * aO.M12 - bO.M32 * aO.M11);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(aO.M12 * bO.M33 - aO.M13 * bO.M32,\n                                       aO.M13 * bO.M31 - aO.M11 * bO.M33,\n                                       aO.M11 * bO.M32 - aO.M12 * bO.M31);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(bO.M32 * aO.M13 - bO.M33 * aO.M12,\n                                       bO.M33 * aO.M11 - bO.M31 * aO.M13,\n                                       bO.M31 * aO.M12 - bO.M32 * aO.M11);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            #endregion\n\n            #region A.Y x B.()\n\n            //A.Y x B.X\n            rarb = aX * absBR.M31 + aZ * absBR.M11 +\n                   bY * absBR.M23 + bZ * absBR.M22;\n            tl = t.X * bR.M31 - t.Z * bR.M11;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(aO.M22 * bO.M13 - aO.M23 * bO.M12,\n                                   aO.M23 * bO.M11 - aO.M21 * bO.M13,\n                                   aO.M21 * bO.M12 - aO.M22 * bO.M11);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M12 * aO.M23 - bO.M13 * aO.M22,\n                                   bO.M13 * aO.M21 - bO.M11 * aO.M23,\n                                   bO.M11 * aO.M22 - bO.M12 * aO.M21);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(aO.M22 * bO.M13 - aO.M23 * bO.M12,\n                                       aO.M23 * bO.M11 - aO.M21 * bO.M13,\n                                       aO.M21 * bO.M12 - aO.M22 * bO.M11);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(bO.M12 * aO.M23 - bO.M13 * aO.M22,\n                                       bO.M13 * aO.M21 - bO.M11 * aO.M23,\n                                       bO.M11 * aO.M22 - bO.M12 * aO.M21);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.Y x B.Y\n            rarb = aX * absBR.M32 + aZ * absBR.M12 +\n                   bX * absBR.M23 + bZ * absBR.M21;\n            tl = t.X * bR.M32 - t.Z * bR.M12;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(aO.M22 * bO.M23 - aO.M23 * bO.M22,\n                                   aO.M23 * bO.M21 - aO.M21 * bO.M23,\n                                   aO.M21 * bO.M22 - aO.M22 * bO.M21);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M22 * aO.M23 - bO.M23 * aO.M22,\n                                   bO.M23 * aO.M21 - bO.M21 * aO.M23,\n                                   bO.M21 * aO.M22 - bO.M22 * aO.M21);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(aO.M22 * bO.M23 - aO.M23 * bO.M22,\n                                       aO.M23 * bO.M21 - aO.M21 * bO.M23,\n                                       aO.M21 * bO.M22 - aO.M22 * bO.M21);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(bO.M22 * aO.M23 - bO.M23 * aO.M22,\n                                       bO.M23 * aO.M21 - bO.M21 * aO.M23,\n                                       bO.M21 * aO.M22 - bO.M22 * aO.M21);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.Y x B.Z\n            rarb = aX * absBR.M33 + aZ * absBR.M13 +\n                   bX * absBR.M22 + bY * absBR.M21;\n            tl = t.X * bR.M33 - t.Z * bR.M13;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(aO.M22 * bO.M33 - aO.M23 * bO.M32,\n                                   aO.M23 * bO.M31 - aO.M21 * bO.M33,\n                                   aO.M21 * bO.M32 - aO.M22 * bO.M31);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M32 * aO.M23 - bO.M33 * aO.M22,\n                                   bO.M33 * aO.M21 - bO.M31 * aO.M23,\n                                   bO.M31 * aO.M22 - bO.M32 * aO.M21);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(aO.M22 * bO.M33 - aO.M23 * bO.M32,\n                                       aO.M23 * bO.M31 - aO.M21 * bO.M33,\n                                       aO.M21 * bO.M32 - aO.M22 * bO.M31);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(bO.M32 * aO.M23 - bO.M33 * aO.M22,\n                                       bO.M33 * aO.M21 - bO.M31 * aO.M23,\n                                       bO.M31 * aO.M22 - bO.M32 * aO.M21);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            #endregion\n\n            #region A.Z x B.()\n\n            //A.Z x B.X\n            rarb = aX * absBR.M21 + aY * absBR.M11 +\n                   bY * absBR.M33 + bZ * absBR.M32;\n            tl = t.Y * bR.M11 - t.X * bR.M21;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(aO.M32 * bO.M13 - aO.M33 * bO.M12,\n                                   aO.M33 * bO.M11 - aO.M31 * bO.M13,\n                                   aO.M31 * bO.M12 - aO.M32 * bO.M11);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M12 * aO.M33 - bO.M13 * aO.M32,\n                                   bO.M13 * aO.M31 - bO.M11 * aO.M33,\n                                   bO.M11 * aO.M32 - bO.M12 * aO.M31);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(aO.M32 * bO.M13 - aO.M33 * bO.M12,\n                                       aO.M33 * bO.M11 - aO.M31 * bO.M13,\n                                       aO.M31 * bO.M12 - aO.M32 * bO.M11);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(bO.M12 * aO.M33 - bO.M13 * aO.M32,\n                                       bO.M13 * aO.M31 - bO.M11 * aO.M33,\n                                       bO.M11 * aO.M32 - bO.M12 * aO.M31);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.Z x B.Y\n            rarb = aX * absBR.M22 + aY * absBR.M12 +\n                   bX * absBR.M33 + bZ * absBR.M31;\n            tl = t.Y * bR.M12 - t.X * bR.M22;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(aO.M32 * bO.M23 - aO.M33 * bO.M22,\n                                   aO.M33 * bO.M21 - aO.M31 * bO.M23,\n                                   aO.M31 * bO.M22 - aO.M32 * bO.M21);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M22 * aO.M33 - bO.M23 * aO.M32,\n                                   bO.M23 * aO.M31 - bO.M21 * aO.M33,\n                                   bO.M21 * aO.M32 - bO.M22 * aO.M31);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(aO.M32 * bO.M23 - aO.M33 * bO.M22,\n                                       aO.M33 * bO.M21 - aO.M31 * bO.M23,\n                                       aO.M31 * bO.M22 - aO.M32 * bO.M21);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(bO.M22 * aO.M33 - bO.M23 * aO.M32,\n                                       bO.M23 * aO.M31 - bO.M21 * aO.M33,\n                                       bO.M21 * aO.M32 - bO.M22 * aO.M31);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.Z x B.Z\n            rarb = aX * absBR.M23 + aY * absBR.M13 +\n                   bX * absBR.M32 + bY * absBR.M31;\n            tl = t.Y * bR.M13 - t.X * bR.M23;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(aO.M32 * bO.M33 - aO.M33 * bO.M32,\n                                   aO.M33 * bO.M31 - aO.M31 * bO.M33,\n                                   aO.M31 * bO.M32 - aO.M32 * bO.M31);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M32 * aO.M33 - bO.M33 * aO.M32,\n                                   bO.M33 * aO.M31 - bO.M31 * aO.M33,\n                                   bO.M31 * aO.M32 - bO.M32 * aO.M31);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(aO.M32 * bO.M33 - aO.M33 * bO.M32,\n                                       aO.M33 * bO.M31 - aO.M31 * bO.M33,\n                                       aO.M31 * bO.M32 - aO.M32 * bO.M31);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(bO.M32 * aO.M33 - bO.M33 * aO.M32,\n                                       bO.M33 * aO.M31 - bO.M31 * aO.M33,\n                                       bO.M31 * aO.M32 - bO.M32 * aO.M31);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            #endregion\n\n            distance = minimumDistance;\n            axis = minimumAxis;\n            return true;\n        }\n\n#if ALLOWUNSAFE\n        /// <summary>\n        /// Determines if the two boxes are colliding and computes contact data.\n        /// </summary>\n        /// <param name=\"a\">First box to collide.</param>\n        /// <param name=\"b\">Second box to collide.</param>\n        /// <param name=\"distance\">Distance of separation or penetration.</param>\n        /// <param name=\"axis\">Axis of separation or penetration.</param>\n        /// <param name=\"contactData\">Computed contact data.</param>\n        /// <param name=\"transformA\">Transform to apply to shape A.</param>\n        /// <param name=\"transformB\">Transform to apply to shape B.</param>\n        /// <returns>Whether or not the boxes collide.</returns>\n        public static unsafe bool AreBoxesColliding(BoxShape a, BoxShape b, ref RigidTransform transformA, ref RigidTransform transformB, out float distance, out Vector3 axis, out TinyStructList<BoxContactData> contactData)\n        {\n            BoxContactDataCache tempData;\n            bool toReturn = AreBoxesColliding(a, b, ref transformA, ref transformB, out distance, out axis, out tempData);\n            BoxContactData* dataPointer = &tempData.D1;\n            contactData = new TinyStructList<BoxContactData>();\n            for (int i = 0; i < tempData.Count; i++)\n            {\n                contactData.Add(ref dataPointer[i]);\n            }\n            return toReturn;\n        }\n#endif\n\n        /// <summary>\n        /// Determines if the two boxes are colliding and computes contact data.\n        /// </summary>\n        /// <param name=\"a\">First box to collide.</param>\n        /// <param name=\"b\">Second box to collide.</param>\n        /// <param name=\"distance\">Distance of separation or penetration.</param>\n        /// <param name=\"axis\">Axis of separation or penetration.</param>\n        /// <param name=\"contactData\">Contact positions, depths, and ids.</param>\n        /// <param name=\"transformA\">Transform to apply to shape A.</param>\n        /// <param name=\"transformB\">Transform to apply to shape B.</param>\n        /// <returns>Whether or not the boxes collide.</returns>\n#if ALLOWUNSAFE\n        public static bool AreBoxesColliding(BoxShape a, BoxShape b, ref RigidTransform transformA, ref RigidTransform transformB, out float distance, out Vector3 axis, out BoxContactDataCache contactData)\n#else\n        public static bool AreBoxesColliding(BoxShape a, BoxShape b, ref RigidTransform transformA, ref RigidTransform transformB, out float distance, out Vector3 axis, out TinyStructList<BoxContactData> contactData)\n#endif\n        {\n            float aX = a.HalfWidth;\n            float aY = a.HalfHeight;\n            float aZ = a.HalfLength;\n\n            float bX = b.HalfWidth;\n            float bY = b.HalfHeight;\n            float bZ = b.HalfLength;\n\n#if ALLOWUNSAFE\n            contactData = new BoxContactDataCache();\n#else\n            contactData = new TinyStructList<BoxContactData>();\n#endif\n            //Relative rotation from A to B.\n            Matrix3x3 bR;\n\n            Matrix3x3 aO;\n            Matrix3x3.CreateFromQuaternion(ref transformA.Orientation, out aO);\n            Matrix3x3 bO;\n            Matrix3x3.CreateFromQuaternion(ref transformB.Orientation, out bO);\n\n            //Relative translation rotated into A's configuration space.\n            Vector3 t;\n            Vector3.Subtract(ref transformB.Position, ref transformA.Position, out t);\n\n            float tempDistance;\n            float minimumDistance = -float.MaxValue;\n            var minimumAxis = new Vector3();\n            byte minimumFeature = 2; //2 means edge.  0-> A face, 1 -> B face.\n\n            #region A Face Normals\n\n            bR.M11 = aO.M11 * bO.M11 + aO.M12 * bO.M12 + aO.M13 * bO.M13;\n            bR.M12 = aO.M11 * bO.M21 + aO.M12 * bO.M22 + aO.M13 * bO.M23;\n            bR.M13 = aO.M11 * bO.M31 + aO.M12 * bO.M32 + aO.M13 * bO.M33;\n            Matrix3x3 absBR;\n            //Epsilons are added to deal with near-parallel edges.\n            absBR.M11 = Math.Abs(bR.M11) + Toolbox.Epsilon;\n            absBR.M12 = Math.Abs(bR.M12) + Toolbox.Epsilon;\n            absBR.M13 = Math.Abs(bR.M13) + Toolbox.Epsilon;\n            float tX = t.X;\n            t.X = t.X * aO.M11 + t.Y * aO.M12 + t.Z * aO.M13;\n\n            //Test the axes defines by entity A's rotation matrix.\n            //A.X\n            float rarb = aX + bX * absBR.M11 + bY * absBR.M12 + bZ * absBR.M13;\n            if (t.X > rarb)\n            {\n                distance = t.X - rarb;\n                axis = new Vector3(-aO.M11, -aO.M12, -aO.M13);\n                return false;\n            }\n            if (t.X < -rarb)\n            {\n                distance = -t.X - rarb;\n                axis = new Vector3(aO.M11, aO.M12, aO.M13);\n                return false;\n            }\n            //Inside\n            if (t.X > 0)\n            {\n                tempDistance = t.X - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-aO.M11, -aO.M12, -aO.M13);\n                    minimumFeature = 0;\n                }\n            }\n            else\n            {\n                tempDistance = -t.X - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(aO.M11, aO.M12, aO.M13);\n                    minimumFeature = 0;\n                }\n            }\n\n\n            bR.M21 = aO.M21 * bO.M11 + aO.M22 * bO.M12 + aO.M23 * bO.M13;\n            bR.M22 = aO.M21 * bO.M21 + aO.M22 * bO.M22 + aO.M23 * bO.M23;\n            bR.M23 = aO.M21 * bO.M31 + aO.M22 * bO.M32 + aO.M23 * bO.M33;\n            absBR.M21 = Math.Abs(bR.M21) + Toolbox.Epsilon;\n            absBR.M22 = Math.Abs(bR.M22) + Toolbox.Epsilon;\n            absBR.M23 = Math.Abs(bR.M23) + Toolbox.Epsilon;\n            float tY = t.Y;\n            t.Y = tX * aO.M21 + t.Y * aO.M22 + t.Z * aO.M23;\n\n            //A.Y\n            rarb = aY + bX * absBR.M21 + bY * absBR.M22 + bZ * absBR.M23;\n            if (t.Y > rarb)\n            {\n                distance = t.Y - rarb;\n                axis = new Vector3(-aO.M21, -aO.M22, -aO.M23);\n                return false;\n            }\n            if (t.Y < -rarb)\n            {\n                distance = -t.Y - rarb;\n                axis = new Vector3(aO.M21, aO.M22, aO.M23);\n                return false;\n            }\n            //Inside\n            if (t.Y > 0)\n            {\n                tempDistance = t.Y - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-aO.M21, -aO.M22, -aO.M23);\n                    minimumFeature = 0;\n                }\n            }\n            else\n            {\n                tempDistance = -t.Y - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(aO.M21, aO.M22, aO.M23);\n                    minimumFeature = 0;\n                }\n            }\n\n            bR.M31 = aO.M31 * bO.M11 + aO.M32 * bO.M12 + aO.M33 * bO.M13;\n            bR.M32 = aO.M31 * bO.M21 + aO.M32 * bO.M22 + aO.M33 * bO.M23;\n            bR.M33 = aO.M31 * bO.M31 + aO.M32 * bO.M32 + aO.M33 * bO.M33;\n            absBR.M31 = Math.Abs(bR.M31) + Toolbox.Epsilon;\n            absBR.M32 = Math.Abs(bR.M32) + Toolbox.Epsilon;\n            absBR.M33 = Math.Abs(bR.M33) + Toolbox.Epsilon;\n            t.Z = tX * aO.M31 + tY * aO.M32 + t.Z * aO.M33;\n\n            //A.Z\n            rarb = aZ + bX * absBR.M31 + bY * absBR.M32 + bZ * absBR.M33;\n            if (t.Z > rarb)\n            {\n                distance = t.Z - rarb;\n                axis = new Vector3(-aO.M31, -aO.M32, -aO.M33);\n                return false;\n            }\n            if (t.Z < -rarb)\n            {\n                distance = -t.Z - rarb;\n                axis = new Vector3(aO.M31, aO.M32, aO.M33);\n                return false;\n            }\n            //Inside\n            if (t.Z > 0)\n            {\n                tempDistance = t.Z - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-aO.M31, -aO.M32, -aO.M33);\n                    minimumFeature = 0;\n                }\n            }\n            else\n            {\n                tempDistance = -t.Z - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(aO.M31, aO.M32, aO.M33);\n                    minimumFeature = 0;\n                }\n            }\n\n            #endregion\n\n            const float antiBBias = .01f;\n            minimumDistance += antiBBias;\n\n            #region B Face Normals\n\n            //Test the axes defines by entity B's rotation matrix.\n            //B.X\n            rarb = bX + aX * absBR.M11 + aY * absBR.M21 + aZ * absBR.M31;\n            float tl = t.X * bR.M11 + t.Y * bR.M21 + t.Z * bR.M31;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(-bO.M11, -bO.M12, -bO.M13);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M11, bO.M12, bO.M13);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempDistance = tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-bO.M11, -bO.M12, -bO.M13);\n                    minimumFeature = 1;\n                }\n            }\n            else\n            {\n                tempDistance = -tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(bO.M11, bO.M12, bO.M13);\n                    minimumFeature = 1;\n                }\n            }\n\n            //B.Y\n            rarb = bY + aX * absBR.M12 + aY * absBR.M22 + aZ * absBR.M32;\n            tl = t.X * bR.M12 + t.Y * bR.M22 + t.Z * bR.M32;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(-bO.M21, -bO.M22, -bO.M23);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M21, bO.M22, bO.M23);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempDistance = tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-bO.M21, -bO.M22, -bO.M23);\n                    minimumFeature = 1;\n                }\n            }\n            else\n            {\n                tempDistance = -tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(bO.M21, bO.M22, bO.M23);\n                    minimumFeature = 1;\n                }\n            }\n\n            //B.Z\n            rarb = bZ + aX * absBR.M13 + aY * absBR.M23 + aZ * absBR.M33;\n            tl = t.X * bR.M13 + t.Y * bR.M23 + t.Z * bR.M33;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(-bO.M31, -bO.M32, -bO.M33);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(bO.M31, bO.M32, bO.M33);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempDistance = tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(-bO.M31, -bO.M32, -bO.M33);\n                    minimumFeature = 1;\n                }\n            }\n            else\n            {\n                tempDistance = -tl - rarb;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumDistance = tempDistance;\n                    minimumAxis = new Vector3(bO.M31, bO.M32, bO.M33);\n                    minimumFeature = 1;\n                }\n            }\n\n            #endregion\n\n            if (minimumFeature != 1)\n                minimumDistance -= antiBBias;\n\n            float antiEdgeBias = .01f;\n            minimumDistance += antiEdgeBias;\n            float axisLengthInverse;\n            Vector3 tempAxis;\n\n            #region A.X x B.()\n\n            //Now for the edge-edge cases.\n            //A.X x B.X\n            rarb = aY * absBR.M31 + aZ * absBR.M21 +\n                   bY * absBR.M13 + bZ * absBR.M12;\n            tl = t.Z * bR.M21 - t.Y * bR.M31;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M12 * aO.M13 - bO.M13 * aO.M12,\n                                   bO.M13 * aO.M11 - bO.M11 * aO.M13,\n                                   bO.M11 * aO.M12 - bO.M12 * aO.M11);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(aO.M12 * bO.M13 - aO.M13 * bO.M12,\n                                   aO.M13 * bO.M11 - aO.M11 * bO.M13,\n                                   aO.M11 * bO.M12 - aO.M12 * bO.M11);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(bO.M12 * aO.M13 - bO.M13 * aO.M12,\n                                       bO.M13 * aO.M11 - bO.M11 * aO.M13,\n                                       bO.M11 * aO.M12 - bO.M12 * aO.M11);\n\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(aO.M12 * bO.M13 - aO.M13 * bO.M12,\n                                       aO.M13 * bO.M11 - aO.M11 * bO.M13,\n                                       aO.M11 * bO.M12 - aO.M12 * bO.M11);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.X x B.Y\n            rarb = aY * absBR.M32 + aZ * absBR.M22 +\n                   bX * absBR.M13 + bZ * absBR.M11;\n            tl = t.Z * bR.M22 - t.Y * bR.M32;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M22 * aO.M13 - bO.M23 * aO.M12,\n                                   bO.M23 * aO.M11 - bO.M21 * aO.M13,\n                                   bO.M21 * aO.M12 - bO.M22 * aO.M11);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(aO.M12 * bO.M23 - aO.M13 * bO.M22,\n                                   aO.M13 * bO.M21 - aO.M11 * bO.M23,\n                                   aO.M11 * bO.M22 - aO.M12 * bO.M21);\n\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(bO.M22 * aO.M13 - bO.M23 * aO.M12,\n                                       bO.M23 * aO.M11 - bO.M21 * aO.M13,\n                                       bO.M21 * aO.M12 - bO.M22 * aO.M11);\n\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(aO.M12 * bO.M23 - aO.M13 * bO.M22,\n                                       aO.M13 * bO.M21 - aO.M11 * bO.M23,\n                                       aO.M11 * bO.M22 - aO.M12 * bO.M21);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.X x B.Z\n            rarb = aY * absBR.M33 + aZ * absBR.M23 +\n                   bX * absBR.M12 + bY * absBR.M11;\n            tl = t.Z * bR.M23 - t.Y * bR.M33;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M32 * aO.M13 - bO.M33 * aO.M12,\n                                   bO.M33 * aO.M11 - bO.M31 * aO.M13,\n                                   bO.M31 * aO.M12 - bO.M32 * aO.M11);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n\n                axis = new Vector3(aO.M12 * bO.M33 - aO.M13 * bO.M32,\n                                   aO.M13 * bO.M31 - aO.M11 * bO.M33,\n                                   aO.M11 * bO.M32 - aO.M12 * bO.M31);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(bO.M32 * aO.M13 - bO.M33 * aO.M12,\n                                       bO.M33 * aO.M11 - bO.M31 * aO.M13,\n                                       bO.M31 * aO.M12 - bO.M32 * aO.M11);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(aO.M12 * bO.M33 - aO.M13 * bO.M32,\n                                       aO.M13 * bO.M31 - aO.M11 * bO.M33,\n                                       aO.M11 * bO.M32 - aO.M12 * bO.M31);\n\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            #endregion\n\n            #region A.Y x B.()\n\n            //A.Y x B.X\n            rarb = aX * absBR.M31 + aZ * absBR.M11 +\n                   bY * absBR.M23 + bZ * absBR.M22;\n            tl = t.X * bR.M31 - t.Z * bR.M11;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M12 * aO.M23 - bO.M13 * aO.M22,\n                                   bO.M13 * aO.M21 - bO.M11 * aO.M23,\n                                   bO.M11 * aO.M22 - bO.M12 * aO.M21);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(aO.M22 * bO.M13 - aO.M23 * bO.M12,\n                                   aO.M23 * bO.M11 - aO.M21 * bO.M13,\n                                   aO.M21 * bO.M12 - aO.M22 * bO.M11);\n\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(bO.M12 * aO.M23 - bO.M13 * aO.M22,\n                                       bO.M13 * aO.M21 - bO.M11 * aO.M23,\n                                       bO.M11 * aO.M22 - bO.M12 * aO.M21);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(aO.M22 * bO.M13 - aO.M23 * bO.M12,\n                                       aO.M23 * bO.M11 - aO.M21 * bO.M13,\n                                       aO.M21 * bO.M12 - aO.M22 * bO.M11);\n\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.Y x B.Y\n            rarb = aX * absBR.M32 + aZ * absBR.M12 +\n                   bX * absBR.M23 + bZ * absBR.M21;\n            tl = t.X * bR.M32 - t.Z * bR.M12;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M22 * aO.M23 - bO.M23 * aO.M22,\n                                   bO.M23 * aO.M21 - bO.M21 * aO.M23,\n                                   bO.M21 * aO.M22 - bO.M22 * aO.M21);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n\n                axis = new Vector3(aO.M22 * bO.M23 - aO.M23 * bO.M22,\n                                   aO.M23 * bO.M21 - aO.M21 * bO.M23,\n                                   aO.M21 * bO.M22 - aO.M22 * bO.M21);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(bO.M22 * aO.M23 - bO.M23 * aO.M22,\n                                       bO.M23 * aO.M21 - bO.M21 * aO.M23,\n                                       bO.M21 * aO.M22 - bO.M22 * aO.M21);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(aO.M22 * bO.M23 - aO.M23 * bO.M22,\n                                       aO.M23 * bO.M21 - aO.M21 * bO.M23,\n                                       aO.M21 * bO.M22 - aO.M22 * bO.M21);\n\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.Y x B.Z\n            rarb = aX * absBR.M33 + aZ * absBR.M13 +\n                   bX * absBR.M22 + bY * absBR.M21;\n            tl = t.X * bR.M33 - t.Z * bR.M13;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M32 * aO.M23 - bO.M33 * aO.M22,\n                                   bO.M33 * aO.M21 - bO.M31 * aO.M23,\n                                   bO.M31 * aO.M22 - bO.M32 * aO.M21);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n\n                axis = new Vector3(aO.M22 * bO.M33 - aO.M23 * bO.M32,\n                                   aO.M23 * bO.M31 - aO.M21 * bO.M33,\n                                   aO.M21 * bO.M32 - aO.M22 * bO.M31);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(bO.M32 * aO.M23 - bO.M33 * aO.M22,\n                                       bO.M33 * aO.M21 - bO.M31 * aO.M23,\n                                       bO.M31 * aO.M22 - bO.M32 * aO.M21);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(aO.M22 * bO.M33 - aO.M23 * bO.M32,\n                                       aO.M23 * bO.M31 - aO.M21 * bO.M33,\n                                       aO.M21 * bO.M32 - aO.M22 * bO.M31);\n\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            #endregion\n\n            #region A.Z x B.()\n\n            //A.Z x B.X\n            rarb = aX * absBR.M21 + aY * absBR.M11 +\n                   bY * absBR.M33 + bZ * absBR.M32;\n            tl = t.Y * bR.M11 - t.X * bR.M21;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M12 * aO.M33 - bO.M13 * aO.M32,\n                                   bO.M13 * aO.M31 - bO.M11 * aO.M33,\n                                   bO.M11 * aO.M32 - bO.M12 * aO.M31);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n\n                axis = new Vector3(aO.M32 * bO.M13 - aO.M33 * bO.M12,\n                                   aO.M33 * bO.M11 - aO.M31 * bO.M13,\n                                   aO.M31 * bO.M12 - aO.M32 * bO.M11);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(bO.M12 * aO.M33 - bO.M13 * aO.M32,\n                                       bO.M13 * aO.M31 - bO.M11 * aO.M33,\n                                       bO.M11 * aO.M32 - bO.M12 * aO.M31);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(aO.M32 * bO.M13 - aO.M33 * bO.M12,\n                                       aO.M33 * bO.M11 - aO.M31 * bO.M13,\n                                       aO.M31 * bO.M12 - aO.M32 * bO.M11);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.Z x B.Y\n            rarb = aX * absBR.M22 + aY * absBR.M12 +\n                   bX * absBR.M33 + bZ * absBR.M31;\n            tl = t.Y * bR.M12 - t.X * bR.M22;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M22 * aO.M33 - bO.M23 * aO.M32,\n                                   bO.M23 * aO.M31 - bO.M21 * aO.M33,\n                                   bO.M21 * aO.M32 - bO.M22 * aO.M31);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n\n                axis = new Vector3(aO.M32 * bO.M23 - aO.M33 * bO.M22,\n                                   aO.M33 * bO.M21 - aO.M31 * bO.M23,\n                                   aO.M31 * bO.M22 - aO.M32 * bO.M21);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(bO.M22 * aO.M33 - bO.M23 * aO.M32,\n                                       bO.M23 * aO.M31 - bO.M21 * aO.M33,\n                                       bO.M21 * aO.M32 - bO.M22 * aO.M31);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(aO.M32 * bO.M23 - aO.M33 * bO.M22,\n                                       aO.M33 * bO.M21 - aO.M31 * bO.M23,\n                                       aO.M31 * bO.M22 - aO.M32 * bO.M21);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            //A.Z x B.Z\n            rarb = aX * absBR.M23 + aY * absBR.M13 +\n                   bX * absBR.M32 + bY * absBR.M31;\n            tl = t.Y * bR.M13 - t.X * bR.M23;\n            if (tl > rarb)\n            {\n                distance = tl - rarb;\n                axis = new Vector3(bO.M32 * aO.M33 - bO.M33 * aO.M32,\n                                   bO.M33 * aO.M31 - bO.M31 * aO.M33,\n                                   bO.M31 * aO.M32 - bO.M32 * aO.M31);\n                return false;\n            }\n            if (tl < -rarb)\n            {\n                distance = -tl - rarb;\n                axis = new Vector3(aO.M32 * bO.M33 - aO.M33 * bO.M32,\n                                   aO.M33 * bO.M31 - aO.M31 * bO.M33,\n                                   aO.M31 * bO.M32 - aO.M32 * bO.M31);\n                return false;\n            }\n            //Inside\n            if (tl > 0)\n            {\n                tempAxis = new Vector3(bO.M32 * aO.M33 - bO.M33 * aO.M32,\n                                       bO.M33 * aO.M31 - bO.M31 * aO.M33,\n                                       bO.M31 * aO.M32 - bO.M32 * aO.M31);\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n            else\n            {\n                tempAxis = new Vector3(aO.M32 * bO.M33 - aO.M33 * bO.M32,\n                                       aO.M33 * bO.M31 - aO.M31 * bO.M33,\n                                       aO.M31 * bO.M32 - aO.M32 * bO.M31);\n\n                axisLengthInverse = 1 / tempAxis.Length();\n                tempDistance = (-tl - rarb) * axisLengthInverse;\n                if (tempDistance > minimumDistance)\n                {\n                    minimumFeature = 2;\n                    minimumDistance = tempDistance;\n                    tempAxis.X *= axisLengthInverse;\n                    tempAxis.Y *= axisLengthInverse;\n                    tempAxis.Z *= axisLengthInverse;\n                    minimumAxis = tempAxis;\n                }\n            }\n\n            #endregion\n\n            if (minimumFeature == 2)\n            {\n\n                //Edge-edge contact conceptually only has one contact, but allowing it to create multiple due to penetration is more robust.\n                GetEdgeEdgeContact(a, b, ref transformA.Position, ref aO, ref transformB.Position, ref bO, minimumDistance, ref minimumAxis, out contactData);\n\n                //Vector3 position;\n                //float depth;\n                //int id;\n                //                GetEdgeEdgeContact(a, b, ref transformA.Position, ref aO, ref transformB.Position, ref bO, ref minimumAxis, out position, out id);\n                //#if ALLOWUNSAFE\n                //                contactData.D1.Position = position;\n                //                contactData.D1.Depth = minimumDistance; \n                //                contactData.D1.Id = id;\n                //                contactData.Count = 1;\n                //#else\n                //                var toAdd = new BoxContactData();\n                //                toAdd.Position = position;\n                //                toAdd.Depth = minimumDistance;\n                //                toAdd.Id = id;\n                //                contactData.Add(ref toAdd);\n                //#endif\n            }\n            else\n            {\n                minimumDistance -= antiEdgeBias;\n                GetFaceContacts(a, b, ref transformA.Position, ref aO, ref transformB.Position, ref bO, minimumFeature == 0, ref minimumAxis, out contactData);\n\n            }\n\n            distance = minimumDistance;\n            axis = minimumAxis;\n            return true;\n        }\n\n#if ALLOWUNSAFE\n        internal static void GetEdgeEdgeContact(BoxShape a, BoxShape b, ref Vector3 positionA, ref Matrix3x3 orientationA, ref Vector3 positionB, ref Matrix3x3 orientationB, float depth, ref Vector3 mtd, out BoxContactDataCache contactData)\n#else\n        internal static void GetEdgeEdgeContact(BoxShape a, BoxShape b, ref Vector3 positionA, ref Matrix3X3 orientationA, ref Vector3 positionB, ref Matrix3X3 orientationB, float depth, ref Vector3 mtd, out TinyStructList<BoxContactData> contactData)\n#endif\n        {\n            //Edge-edge contacts conceptually can only create one contact in perfectly rigid collisions.\n            //However, this is a discrete approximation of rigidity; things can penetrate each other.\n            //If edge-edge only returns a single contact, there's a good chance that the box will get into\n            //an oscillating state when under pressure.\n\n            //To avoid the oscillation, we may sometimes need two edge contacts.\n            //To determine which edges to use, compute 8 dot products.\n            //One for each edge parallel to the contributing axis on each of the two shapes.\n            //The resulting cases are:\n            //One edge on A touching one edge on B.\n            //Two edges on A touching one edge on B.\n            //One edge on A touching two edges on B.\n            //Two edges on A touching two edges on B.\n\n            //The three latter cases SHOULD be covered by the face-contact system, but in practice,\n            //they are not sufficiently covered because the system decides that the single edge-edge pair\n            //should be used and drops the other contacts, producting the aforementioned oscillation.\n\n            //All edge cross products result in the MTD, so no recalculation is necessary.\n\n            //Of the four edges which are aligned with the local edge axis, pick the two\n            //who have vertices which, when dotted with the local mtd, are greatest.\n\n            //Compute the closest points between each edge pair.  For two edges each,\n            //this comes out to four total closest point tests.\n            //This is not a traditional closest point between segments test.\n            //Completely ignore the pair if the closest points turn out to be beyond the intervals of the segments.\n\n            //Use the offsets found from each test.\n            //Test the A to B offset against the MTD, which is also known to be oriented in a certain way.\n            //That known directionality allows easy computation of depth using MTD dot offset.\n            //Do not use any contacts which have negative depth/positive distance.\n\n\n            //Put the minimum translation direction into the local space of each object.\n            Vector3 mtdA, mtdB;\n            Vector3 negatedMtd;\n            Vector3.Negate(ref mtd, out negatedMtd);\n            Matrix3x3.TransformTranspose(ref negatedMtd, ref orientationA, out mtdA);\n            Matrix3x3.TransformTranspose(ref mtd, ref orientationB, out mtdB);\n\n\n#if !WINDOWS\n            Vector3 edgeAStart1 = new Vector3(), edgeAEnd1 = new Vector3(), edgeAStart2 = new Vector3(), edgeAEnd2 = new Vector3();\n            Vector3 edgeBStart1 = new Vector3(), edgeBEnd1 = new Vector3(), edgeBStart2 = new Vector3(), edgeBEnd2 = new Vector3();\n#else\n            Vector3 edgeAStart1, edgeAEnd1, edgeAStart2, edgeAEnd2;\n            Vector3 edgeBStart1, edgeBEnd1, edgeBStart2, edgeBEnd2;\n#endif\n            float aHalfWidth = a.halfWidth;\n            float aHalfHeight = a.halfHeight;\n            float aHalfLength = a.halfLength;\n\n            float bHalfWidth = b.halfWidth;\n            float bHalfHeight = b.halfHeight;\n            float bHalfLength = b.halfLength;\n\n            //Letter stands for owner.  Number stands for edge (1 or 2).\n            int edgeAStart1Id, edgeAEnd1Id, edgeAStart2Id, edgeAEnd2Id;\n            int edgeBStart1Id, edgeBEnd1Id, edgeBStart2Id, edgeBEnd2Id;\n\n            //This is an edge-edge collision, so one (AND ONLY ONE) of the components in the \n            //local direction must be very close to zero.  We can use an arbitrary fixed \n            //epsilon because the mtd is always unit length.\n\n            #region Edge A\n\n            if (Math.Abs(mtdA.X) < Toolbox.Epsilon)\n            {\n                //mtd is in the Y-Z plane.\n                //Perform an implicit dot with the edge location relative to the center.\n                //Find the two edges furthest in the direction of the mtdA.\n                var dots = new TinyList<float>();\n                dots.Add(-aHalfHeight * mtdA.Y - aHalfLength * mtdA.Z);\n                dots.Add(-aHalfHeight * mtdA.Y + aHalfLength * mtdA.Z);\n                dots.Add(aHalfHeight * mtdA.Y - aHalfLength * mtdA.Z);\n                dots.Add(aHalfHeight * mtdA.Y + aHalfLength * mtdA.Z);\n\n                //Find the first and second highest indices.\n                int highestIndex, secondHighestIndex;\n                FindHighestIndices(ref dots, out highestIndex, out secondHighestIndex);\n                //Use the indices to compute the edges.\n                GetEdgeData(highestIndex, 0, aHalfWidth, aHalfHeight, aHalfLength, out edgeAStart1, out edgeAEnd1, out edgeAStart1Id, out edgeAEnd1Id);\n                GetEdgeData(secondHighestIndex, 0, aHalfWidth, aHalfHeight, aHalfLength, out edgeAStart2, out edgeAEnd2, out edgeAStart2Id, out edgeAEnd2Id);\n\n\n            }\n            else if (Math.Abs(mtdA.Y) < Toolbox.Epsilon)\n            {\n                //mtd is in the X-Z plane\n                //Perform an implicit dot with the edge location relative to the center.\n                //Find the two edges furthest in the direction of the mtdA.\n                var dots = new TinyList<float>();\n                dots.Add(-aHalfWidth * mtdA.X - aHalfLength * mtdA.Z);\n                dots.Add(-aHalfWidth * mtdA.X + aHalfLength * mtdA.Z);\n                dots.Add(aHalfWidth * mtdA.X - aHalfLength * mtdA.Z);\n                dots.Add(aHalfWidth * mtdA.X + aHalfLength * mtdA.Z);\n\n                //Find the first and second highest indices.\n                int highestIndex, secondHighestIndex;\n                FindHighestIndices(ref dots, out highestIndex, out secondHighestIndex);\n                //Use the indices to compute the edges.\n                GetEdgeData(highestIndex, 1, aHalfWidth, aHalfHeight, aHalfLength, out edgeAStart1, out edgeAEnd1, out edgeAStart1Id, out edgeAEnd1Id);\n                GetEdgeData(secondHighestIndex, 1, aHalfWidth, aHalfHeight, aHalfLength, out edgeAStart2, out edgeAEnd2, out edgeAStart2Id, out edgeAEnd2Id);\n            }\n            else\n            {\n                //mtd is in the X-Y plane\n                //Perform an implicit dot with the edge location relative to the center.\n                //Find the two edges furthest in the direction of the mtdA.\n                var dots = new TinyList<float>();\n                dots.Add(-aHalfWidth * mtdA.X - aHalfHeight * mtdA.Y);\n                dots.Add(-aHalfWidth * mtdA.X + aHalfHeight * mtdA.Y);\n                dots.Add(aHalfWidth * mtdA.X - aHalfHeight * mtdA.Y);\n                dots.Add(aHalfWidth * mtdA.X + aHalfHeight * mtdA.Y);\n\n                //Find the first and second highest indices.\n                int highestIndex, secondHighestIndex;\n                FindHighestIndices(ref dots, out highestIndex, out secondHighestIndex);\n                //Use the indices to compute the edges.\n                GetEdgeData(highestIndex, 2, aHalfWidth, aHalfHeight, aHalfLength, out edgeAStart1, out edgeAEnd1, out edgeAStart1Id, out edgeAEnd1Id);\n                GetEdgeData(secondHighestIndex, 2, aHalfWidth, aHalfHeight, aHalfLength, out edgeAStart2, out edgeAEnd2, out edgeAStart2Id, out edgeAEnd2Id);\n            }\n\n            #endregion\n\n            #region Edge B\n\n            if (Math.Abs(mtdB.X) < Toolbox.Epsilon)\n            {\n                //mtd is in the Y-Z plane.\n                //Perform an implicit dot with the edge location relative to the center.\n                //Find the two edges furthest in the direction of the mtdB.\n                var dots = new TinyList<float>();\n                dots.Add(-bHalfHeight * mtdB.Y - bHalfLength * mtdB.Z);\n                dots.Add(-bHalfHeight * mtdB.Y + bHalfLength * mtdB.Z);\n                dots.Add(bHalfHeight * mtdB.Y - bHalfLength * mtdB.Z);\n                dots.Add(bHalfHeight * mtdB.Y + bHalfLength * mtdB.Z);\n\n                //Find the first and second highest indices.\n                int highestIndex, secondHighestIndex;\n                FindHighestIndices(ref dots, out highestIndex, out secondHighestIndex);\n                //Use the indices to compute the edges.\n                GetEdgeData(highestIndex, 0, bHalfWidth, bHalfHeight, bHalfLength, out edgeBStart1, out edgeBEnd1, out edgeBStart1Id, out edgeBEnd1Id);\n                GetEdgeData(secondHighestIndex, 0, bHalfWidth, bHalfHeight, bHalfLength, out edgeBStart2, out edgeBEnd2, out edgeBStart2Id, out edgeBEnd2Id);\n\n\n            }\n            else if (Math.Abs(mtdB.Y) < Toolbox.Epsilon)\n            {\n                //mtd is in the X-Z plane\n                //Perform an implicit dot with the edge location relative to the center.\n                //Find the two edges furthest in the direction of the mtdB.\n                var dots = new TinyList<float>();\n                dots.Add(-bHalfWidth * mtdB.X - bHalfLength * mtdB.Z);\n                dots.Add(-bHalfWidth * mtdB.X + bHalfLength * mtdB.Z);\n                dots.Add(bHalfWidth * mtdB.X - bHalfLength * mtdB.Z);\n                dots.Add(bHalfWidth * mtdB.X + bHalfLength * mtdB.Z);\n\n                //Find the first and second highest indices.\n                int highestIndex, secondHighestIndex;\n                FindHighestIndices(ref dots, out highestIndex, out secondHighestIndex);\n                //Use the indices to compute the edges.\n                GetEdgeData(highestIndex, 1, bHalfWidth, bHalfHeight, bHalfLength, out edgeBStart1, out edgeBEnd1, out edgeBStart1Id, out edgeBEnd1Id);\n                GetEdgeData(secondHighestIndex, 1, bHalfWidth, bHalfHeight, bHalfLength, out edgeBStart2, out edgeBEnd2, out edgeBStart2Id, out edgeBEnd2Id);\n            }\n            else\n            {\n                //mtd is in the X-Y plane\n                //Perform an implicit dot with the edge location relative to the center.\n                //Find the two edges furthest in the direction of the mtdB.\n                var dots = new TinyList<float>();\n                dots.Add(-bHalfWidth * mtdB.X - bHalfHeight * mtdB.Y);\n                dots.Add(-bHalfWidth * mtdB.X + bHalfHeight * mtdB.Y);\n                dots.Add(bHalfWidth * mtdB.X - bHalfHeight * mtdB.Y);\n                dots.Add(bHalfWidth * mtdB.X + bHalfHeight * mtdB.Y);\n\n                //Find the first and second highest indices.\n                int highestIndex, secondHighestIndex;\n                FindHighestIndices(ref dots, out highestIndex, out secondHighestIndex);\n                //Use the indices to compute the edges.\n                GetEdgeData(highestIndex, 2, bHalfWidth, bHalfHeight, bHalfLength, out edgeBStart1, out edgeBEnd1, out edgeBStart1Id, out edgeBEnd1Id);\n                GetEdgeData(secondHighestIndex, 2, bHalfWidth, bHalfHeight, bHalfLength, out edgeBStart2, out edgeBEnd2, out edgeBStart2Id, out edgeBEnd2Id);\n            }\n\n            #endregion\n\n\n            Matrix3x3.Transform(ref edgeAStart1, ref orientationA, out edgeAStart1);\n            Matrix3x3.Transform(ref edgeAEnd1, ref orientationA, out edgeAEnd1);\n            Matrix3x3.Transform(ref edgeBStart1, ref orientationB, out edgeBStart1);\n            Matrix3x3.Transform(ref edgeBEnd1, ref orientationB, out edgeBEnd1);\n\n            Matrix3x3.Transform(ref edgeAStart2, ref orientationA, out edgeAStart2);\n            Matrix3x3.Transform(ref edgeAEnd2, ref orientationA, out edgeAEnd2);\n            Matrix3x3.Transform(ref edgeBStart2, ref orientationB, out edgeBStart2);\n            Matrix3x3.Transform(ref edgeBEnd2, ref orientationB, out edgeBEnd2);\n\n            Vector3.Add(ref edgeAStart1, ref positionA, out edgeAStart1);\n            Vector3.Add(ref edgeAEnd1, ref positionA, out edgeAEnd1);\n            Vector3.Add(ref edgeBStart1, ref positionB, out edgeBStart1);\n            Vector3.Add(ref edgeBEnd1, ref positionB, out edgeBEnd1);\n\n            Vector3.Add(ref edgeAStart2, ref positionA, out edgeAStart2);\n            Vector3.Add(ref edgeAEnd2, ref positionA, out edgeAEnd2);\n            Vector3.Add(ref edgeBStart2, ref positionB, out edgeBStart2);\n            Vector3.Add(ref edgeBEnd2, ref positionB, out edgeBEnd2);\n\n            Vector3 onA, onB;\n            Vector3 offset;\n            float dot;\n#if ALLOWUNSAFE\n            var tempContactData = new BoxContactDataCache();\n            unsafe\n            {\n                var contactDataPointer = &tempContactData.D1;\n#else\n            contactData = new TinyStructList<BoxContactData>();\n#endif\n\n            //Go through the pairs and add any contacts with positive depth that are within the segments' intervals.\n\n            if (GetClosestPointsBetweenSegments(ref edgeAStart1, ref edgeAEnd1, ref edgeBStart1, ref edgeBEnd1, out onA, out onB))\n            {\n                Vector3.Subtract(ref onA, ref onB, out offset);\n                Vector3.Dot(ref offset, ref mtd, out dot);\n                if (dot < 0) //Distance must be negative.\n                {\n                    BoxContactData data;\n                    data.Position = onA;\n                    data.Depth = dot;\n                    data.Id = GetContactId(edgeAStart1Id, edgeAEnd1Id, edgeBStart1Id, edgeBEnd1Id);\n#if ALLOWUNSAFE\n                        contactDataPointer[tempContactData.Count] = data;\n                        tempContactData.Count++;\n#else\n                    contactData.Add(ref data);\n#endif\n                }\n\n            }\n            if (GetClosestPointsBetweenSegments(ref edgeAStart1, ref edgeAEnd1, ref edgeBStart2, ref edgeBEnd2, out onA, out onB))\n            {\n                Vector3.Subtract(ref onA, ref onB, out offset);\n                Vector3.Dot(ref offset, ref mtd, out dot);\n                if (dot < 0) //Distance must be negative.\n                {\n                    BoxContactData data;\n                    data.Position = onA;\n                    data.Depth = dot;\n                    data.Id = GetContactId(edgeAStart1Id, edgeAEnd1Id, edgeBStart2Id, edgeBEnd2Id);\n#if ALLOWUNSAFE\n                        contactDataPointer[tempContactData.Count] = data;\n                        tempContactData.Count++;\n#else\n                    contactData.Add(ref data);\n#endif\n                }\n\n            }\n            if (GetClosestPointsBetweenSegments(ref edgeAStart2, ref edgeAEnd2, ref edgeBStart1, ref edgeBEnd1, out onA, out onB))\n            {\n                Vector3.Subtract(ref onA, ref onB, out offset);\n                Vector3.Dot(ref offset, ref mtd, out dot);\n                if (dot < 0) //Distance must be negative.\n                {\n                    BoxContactData data;\n                    data.Position = onA;\n                    data.Depth = dot;\n                    data.Id = GetContactId(edgeAStart2Id, edgeAEnd2Id, edgeBStart1Id, edgeBEnd1Id);\n#if ALLOWUNSAFE\n                        contactDataPointer[tempContactData.Count] = data;\n                        tempContactData.Count++;\n#else\n                    contactData.Add(ref data);\n#endif\n                }\n\n            }\n            if (GetClosestPointsBetweenSegments(ref edgeAStart2, ref edgeAEnd2, ref edgeBStart2, ref edgeBEnd2, out onA, out onB))\n            {\n                Vector3.Subtract(ref onA, ref onB, out offset);\n                Vector3.Dot(ref offset, ref mtd, out dot);\n                if (dot < 0) //Distance must be negative.\n                {\n                    BoxContactData data;\n                    data.Position = onA;\n                    data.Depth = dot;\n                    data.Id = GetContactId(edgeAStart2Id, edgeAEnd2Id, edgeBStart2Id, edgeBEnd2Id);\n#if ALLOWUNSAFE\n                        contactDataPointer[tempContactData.Count] = data;\n                        tempContactData.Count++;\n#else\n                    contactData.Add(ref data);\n#endif\n                }\n\n            }\n#if ALLOWUNSAFE\n            }\n            contactData = tempContactData;\n#endif\n\n        }\n\n        private static void GetEdgeData(int index, int axis, float x, float y, float z, out Vector3 edgeStart, out Vector3 edgeEnd, out int edgeStartId, out int edgeEndId)\n        {\n            //Index defines which edge to use.\n            //They follow this pattern:\n            //0: --\n            //1: -+\n            //2: +-\n            //3: ++\n\n            //The axis index determines the dimensions to use.\n            //0: plane with normal X\n            //1: plane with normal Y\n            //2: plane with normal Z\n\n#if !WINDOWS\n            edgeStart = new Vector3();\n            edgeEnd = new Vector3();\n#endif\n\n            switch (index + axis * 4)\n            {\n                case 0:\n                    //X--\n                    edgeStart.X = -x;\n                    edgeStart.Y = -y;\n                    edgeStart.Z = -z;\n                    edgeStartId = 0; //000\n\n                    edgeEnd.X = x;\n                    edgeEnd.Y = -y;\n                    edgeEnd.Z = -z;\n                    edgeEndId = 4; //100\n                    break;\n                case 1:\n                    //X-+\n                    edgeStart.X = -x;\n                    edgeStart.Y = -y;\n                    edgeStart.Z = z;\n                    edgeStartId = 1; //001\n\n                    edgeEnd.X = x;\n                    edgeEnd.Y = -y;\n                    edgeEnd.Z = z;\n                    edgeEndId = 5; //101\n                    break;\n                case 2:\n                    //X+-\n                    edgeStart.X = -x;\n                    edgeStart.Y = y;\n                    edgeStart.Z = -z;\n                    edgeStartId = 2; //010\n\n                    edgeEnd.X = x;\n                    edgeEnd.Y = y;\n                    edgeEnd.Z = -z;\n                    edgeEndId = 6; //110\n                    break;\n                case 3:\n                    //X++\n                    edgeStart.X = -x;\n                    edgeStart.Y = y;\n                    edgeStart.Z = z;\n                    edgeStartId = 3; //011\n\n                    edgeEnd.X = x;\n                    edgeEnd.Y = y;\n                    edgeEnd.Z = z;\n                    edgeEndId = 7; //111\n                    break;\n                case 4:\n                    //-Y-\n                    edgeStart.X = -x;\n                    edgeStart.Y = -y;\n                    edgeStart.Z = -z;\n                    edgeStartId = 0; //000\n\n                    edgeEnd.X = -x;\n                    edgeEnd.Y = y;\n                    edgeEnd.Z = -z;\n                    edgeEndId = 2; //010\n                    break;\n                case 5:\n                    //-Y+\n                    edgeStart.X = -x;\n                    edgeStart.Y = -y;\n                    edgeStart.Z = z;\n                    edgeStartId = 1; //001\n\n                    edgeEnd.X = -x;\n                    edgeEnd.Y = y;\n                    edgeEnd.Z = z;\n                    edgeEndId = 3; //011\n                    break;\n                case 6:\n                    //+Y-\n                    edgeStart.X = x;\n                    edgeStart.Y = -y;\n                    edgeStart.Z = -z;\n                    edgeStartId = 4; //100\n\n                    edgeEnd.X = x;\n                    edgeEnd.Y = y;\n                    edgeEnd.Z = -z;\n                    edgeEndId = 6; //110\n                    break;\n                case 7:\n                    //+Y+\n                    edgeStart.X = x;\n                    edgeStart.Y = -y;\n                    edgeStart.Z = z;\n                    edgeStartId = 5; //101\n\n                    edgeEnd.X = x;\n                    edgeEnd.Y = y;\n                    edgeEnd.Z = z;\n                    edgeEndId = 7; //111\n                    break;\n                case 8:\n                    //--Z\n                    edgeStart.X = -x;\n                    edgeStart.Y = -y;\n                    edgeStart.Z = -z;\n                    edgeStartId = 0; //000\n\n                    edgeEnd.X = -x;\n                    edgeEnd.Y = -y;\n                    edgeEnd.Z = z;\n                    edgeEndId = 1; //001\n                    break;\n                case 9:\n                    //-+Z\n                    edgeStart.X = -x;\n                    edgeStart.Y = y;\n                    edgeStart.Z = -z;\n                    edgeStartId = 2; //010\n\n                    edgeEnd.X = -x;\n                    edgeEnd.Y = y;\n                    edgeEnd.Z = z;\n                    edgeEndId = 3; //011\n                    break;\n                case 10:\n                    //+-Z\n                    edgeStart.X = x;\n                    edgeStart.Y = -y;\n                    edgeStart.Z = -z;\n                    edgeStartId = 4; //100\n\n                    edgeEnd.X = x;\n                    edgeEnd.Y = -y;\n                    edgeEnd.Z = z;\n                    edgeEndId = 5; //101\n                    break;\n                case 11:\n                    //++Z\n                    edgeStart.X = x;\n                    edgeStart.Y = y;\n                    edgeStart.Z = -z;\n                    edgeStartId = 6; //110\n\n                    edgeEnd.X = x;\n                    edgeEnd.Y = y;\n                    edgeEnd.Z = z;\n                    edgeEndId = 7; //111\n                    break;\n                default:\n                    throw new ArgumentException(\"Invalid index or axis.\");\n            }\n        }\n\n        static void FindHighestIndices(ref TinyList<float> dots, out int highestIndex, out int secondHighestIndex)\n        {\n            highestIndex = 0;\n            float highestValue = dots[0];\n            for (int i = 1; i < 4; i++)\n            {\n                float dot = dots[i];\n                if (dot > highestValue)\n                {\n                    highestIndex = i;\n                    highestValue = dot;\n                }\n            }\n            secondHighestIndex = 0;\n            float secondHighestValue = -float.MaxValue;\n            for (int i = 0; i < 4; i++)\n            {\n                float dot = dots[i];\n                if (i != highestIndex && dot > secondHighestValue)\n                {\n                    secondHighestIndex = i;\n                    secondHighestValue = dot;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Computes closest points c1 and c2 betwen segments p1q1 and p2q2.\n        /// </summary>\n        /// <param name=\"p1\">First point of first segment.</param>\n        /// <param name=\"q1\">Second point of first segment.</param>\n        /// <param name=\"p2\">First point of second segment.</param>\n        /// <param name=\"q2\">Second point of second segment.</param>\n        /// <param name=\"c1\">Closest point on first segment.</param>\n        /// <param name=\"c2\">Closest point on second segment.</param>\n        static bool GetClosestPointsBetweenSegments(ref Vector3 p1, ref Vector3 q1, ref Vector3 p2, ref Vector3 q2,\n                                                           out Vector3 c1, out Vector3 c2)\n        {\n            //Segment direction vectors\n            Vector3 d1;\n            Vector3.Subtract(ref q1, ref p1, out d1);\n            Vector3 d2;\n            Vector3.Subtract(ref q2, ref p2, out d2);\n            Vector3 r;\n            Vector3.Subtract(ref p1, ref p2, out r);\n            //distance\n            float a = d1.LengthSquared();\n            float e = d2.LengthSquared();\n            float f;\n            Vector3.Dot(ref d2, ref r, out f);\n\n            float s, t;\n\n            if (a <= Toolbox.Epsilon && e <= Toolbox.Epsilon)\n            {\n                //These segments are more like points.\n                c1 = p1;\n                c2 = p2;\n                return false;\n            }\n            if (a <= Toolbox.Epsilon)\n            {\n                // First segment is basically a point.\n                s = 0.0f;\n                t = f / e;\n                if (t < 0 || t > 1)\n                {\n                    c1 = new Vector3();\n                    c2 = new Vector3();\n                    return false;\n                }\n            }\n            else\n            {\n                float c = Vector3.Dot(d1, r);\n                if (e <= Toolbox.Epsilon)\n                {\n                    // Second segment is basically a point.\n                    t = 0.0f;\n                    s = MathHelper.Clamp(-c / a, 0.0f, 1.0f);\n                }\n                else\n                {\n                    float b = Vector3.Dot(d1, d2);\n                    float denom = a * e - b * b;\n\n                    // If segments not parallel, compute closest point on L1 to L2, and\n                    // clamp to segment S1. Else pick some s (here .5f)\n                    if (denom != 0.0f)\n                    {\n                        s = (b * f - c * e) / denom;\n                        if (s < 0 || s > 1)\n                        {\n                            //Closest point would be outside of the segment.\n                            c1 = new Vector3();\n                            c2 = new Vector3();\n                            return false;\n                        }\n                    }\n                    else //Parallel, just use .5f\n                        s = .5f;\n\n\n                    t = (b * s + f) / e;\n\n                    if (t < 0 || t > 1)\n                    {\n                        //Closest point would be outside of the segment.\n                        c1 = new Vector3();\n                        c2 = new Vector3();\n                        return false;\n                    }\n                }\n            }\n\n            Vector3.Multiply(ref d1, s, out c1);\n            Vector3.Add(ref c1, ref p1, out c1);\n            Vector3.Multiply(ref d2, t, out c2);\n            Vector3.Add(ref c2, ref p2, out c2);\n            return true;\n        }\n\n        //        internal static void GetEdgeEdgeContact(BoxShape a, BoxShape b, ref Vector3 positionA, ref Matrix3X3 orientationA, ref Vector3 positionB, ref Matrix3X3 orientationB, float depth, ref Vector3 mtd, out TinyStructList<BoxContactData> contactData)\n        //        {\n        //            //Put the minimum translation direction into the local space of each object.\n        //            Vector3 mtdA, mtdB;\n        //            Vector3 negatedMtd;\n        //            Vector3.Negate(ref mtd, out negatedMtd);\n        //            Matrix3X3.TransformTranspose(ref negatedMtd, ref orientationA, out mtdA);\n        //            Matrix3X3.TransformTranspose(ref mtd, ref orientationB, out mtdB);\n\n\n        //#if !WINDOWS\n        //            Vector3 edgeA1 = new Vector3(), edgeA2 = new Vector3();\n        //            Vector3 edgeB1 = new Vector3(), edgeB2 = new Vector3();\n        //#else\n        //            Vector3 edgeA1, edgeA2;\n        //            Vector3 edgeB1, edgeB2;\n        //#endif\n        //            float aHalfWidth = a.halfWidth;\n        //            float aHalfHeight = a.halfHeight;\n        //            float aHalfLength = a.halfLength;\n\n        //            float bHalfWidth = b.halfWidth;\n        //            float bHalfHeight = b.halfHeight;\n        //            float bHalfLength = b.halfLength;\n\n        //            int edgeA1Id, edgeA2Id;\n        //            int edgeB1Id, edgeB2Id;\n\n        //            //This is an edge-edge collision, so one (AND ONLY ONE) of the components in the \n        //            //local direction must be very close to zero.  We can use an arbitrary fixed \n        //            //epsilon because the mtd is always unit length.\n\n        //            #region Edge A\n\n        //            if (Math.Abs(mtdA.X) < Toolbox.Epsilon)\n        //            {\n        //                //mtd is in the Y-Z plane.\n        //                if (mtdA.Y > 0)\n        //                {\n        //                    if (mtdA.Z > 0)\n        //                    {\n        //                        //++\n        //                        edgeA1.X = -aHalfWidth;\n        //                        edgeA1.Y = aHalfHeight;\n        //                        edgeA1.Z = aHalfLength;\n\n        //                        edgeA2.X = aHalfWidth;\n        //                        edgeA2.Y = aHalfHeight;\n        //                        edgeA2.Z = aHalfLength;\n\n        //                        edgeA1Id = 6;\n        //                        edgeA2Id = 7;\n        //                    }\n        //                    else\n        //                    {\n        //                        //+-\n        //                        edgeA1.X = -aHalfWidth;\n        //                        edgeA1.Y = aHalfHeight;\n        //                        edgeA1.Z = -aHalfLength;\n\n        //                        edgeA2.X = aHalfWidth;\n        //                        edgeA2.Y = aHalfHeight;\n        //                        edgeA2.Z = -aHalfLength;\n\n        //                        edgeA1Id = 2;\n        //                        edgeA2Id = 3;\n        //                    }\n        //                }\n        //                else\n        //                {\n        //                    if (mtdA.Z > 0)\n        //                    {\n        //                        //-+\n        //                        edgeA1.X = -aHalfWidth;\n        //                        edgeA1.Y = -aHalfHeight;\n        //                        edgeA1.Z = aHalfLength;\n\n        //                        edgeA2.X = aHalfWidth;\n        //                        edgeA2.Y = -aHalfHeight;\n        //                        edgeA2.Z = aHalfLength;\n\n        //                        edgeA1Id = 4;\n        //                        edgeA2Id = 5;\n        //                    }\n        //                    else\n        //                    {\n        //                        //--\n        //                        edgeA1.X = -aHalfWidth;\n        //                        edgeA1.Y = -aHalfHeight;\n        //                        edgeA1.Z = -aHalfLength;\n\n        //                        edgeA2.X = aHalfWidth;\n        //                        edgeA2.Y = -aHalfHeight;\n        //                        edgeA2.Z = -aHalfLength;\n\n        //                        edgeA1Id = 0;\n        //                        edgeA2Id = 1;\n        //                    }\n        //                }\n        //            }\n        //            else if (Math.Abs(mtdA.Y) < Toolbox.Epsilon)\n        //            {\n        //                //mtd is in the X-Z plane\n        //                if (mtdA.X > 0)\n        //                {\n        //                    if (mtdA.Z > 0)\n        //                    {\n        //                        //++\n        //                        edgeA1.X = aHalfWidth;\n        //                        edgeA1.Y = -aHalfHeight;\n        //                        edgeA1.Z = aHalfLength;\n\n        //                        edgeA2.X = aHalfWidth;\n        //                        edgeA2.Y = aHalfHeight;\n        //                        edgeA2.Z = aHalfLength;\n\n        //                        edgeA1Id = 5;\n        //                        edgeA2Id = 7;\n        //                    }\n        //                    else\n        //                    {\n        //                        //+-\n        //                        edgeA1.X = aHalfWidth;\n        //                        edgeA1.Y = -aHalfHeight;\n        //                        edgeA1.Z = -aHalfLength;\n\n        //                        edgeA2.X = aHalfWidth;\n        //                        edgeA2.Y = aHalfHeight;\n        //                        edgeA2.Z = -aHalfLength;\n\n        //                        edgeA1Id = 1;\n        //                        edgeA2Id = 3;\n        //                    }\n        //                }\n        //                else\n        //                {\n        //                    if (mtdA.Z > 0)\n        //                    {\n        //                        //-+\n        //                        edgeA1.X = -aHalfWidth;\n        //                        edgeA1.Y = -aHalfHeight;\n        //                        edgeA1.Z = aHalfLength;\n\n        //                        edgeA2.X = -aHalfWidth;\n        //                        edgeA2.Y = aHalfHeight;\n        //                        edgeA2.Z = aHalfLength;\n\n        //                        edgeA1Id = 4;\n        //                        edgeA2Id = 6;\n        //                    }\n        //                    else\n        //                    {\n        //                        //--\n        //                        edgeA1.X = -aHalfWidth;\n        //                        edgeA1.Y = -aHalfHeight;\n        //                        edgeA1.Z = -aHalfLength;\n\n        //                        edgeA2.X = -aHalfWidth;\n        //                        edgeA2.Y = aHalfHeight;\n        //                        edgeA2.Z = -aHalfLength;\n\n        //                        edgeA1Id = 0;\n        //                        edgeA2Id = 2;\n        //                    }\n        //                }\n        //            }\n        //            else\n        //            {\n        //                //mtd is in the X-Y plane\n        //                if (mtdA.X > 0)\n        //                {\n        //                    if (mtdA.Y > 0)\n        //                    {\n        //                        //++\n        //                        edgeA1.X = aHalfWidth;\n        //                        edgeA1.Y = aHalfHeight;\n        //                        edgeA1.Z = -aHalfLength;\n\n        //                        edgeA2.X = aHalfWidth;\n        //                        edgeA2.Y = aHalfHeight;\n        //                        edgeA2.Z = aHalfLength;\n\n        //                        edgeA1Id = 3;\n        //                        edgeA2Id = 7;\n        //                    }\n        //                    else\n        //                    {\n        //                        //+-\n        //                        edgeA1.X = aHalfWidth;\n        //                        edgeA1.Y = -aHalfHeight;\n        //                        edgeA1.Z = -aHalfLength;\n\n        //                        edgeA2.X = aHalfWidth;\n        //                        edgeA2.Y = -aHalfHeight;\n        //                        edgeA2.Z = aHalfLength;\n\n        //                        edgeA1Id = 1;\n        //                        edgeA2Id = 5;\n        //                    }\n        //                }\n        //                else\n        //                {\n        //                    if (mtdA.Y > 0)\n        //                    {\n        //                        //-+\n        //                        edgeA1.X = -aHalfWidth;\n        //                        edgeA1.Y = aHalfHeight;\n        //                        edgeA1.Z = -aHalfLength;\n\n        //                        edgeA2.X = -aHalfWidth;\n        //                        edgeA2.Y = aHalfHeight;\n        //                        edgeA2.Z = aHalfLength;\n\n        //                        edgeA1Id = 2;\n        //                        edgeA2Id = 6;\n        //                    }\n        //                    else\n        //                    {\n        //                        //--\n        //                        edgeA1.X = -aHalfWidth;\n        //                        edgeA1.Y = -aHalfHeight;\n        //                        edgeA1.Z = -aHalfLength;\n\n        //                        edgeA2.X = -aHalfWidth;\n        //                        edgeA2.Y = -aHalfHeight;\n        //                        edgeA2.Z = aHalfLength;\n\n        //                        edgeA1Id = 0;\n        //                        edgeA2Id = 4;\n        //                    }\n        //                }\n        //            }\n\n        //            #endregion\n\n        //            #region Edge B\n\n        //            if (Math.Abs(mtdB.X) < Toolbox.Epsilon)\n        //            {\n        //                //mtd is in the Y-Z plane.\n        //                if (mtdB.Y > 0)\n        //                {\n        //                    if (mtdB.Z > 0)\n        //                    {\n        //                        //++\n        //                        edgeB1.X = -bHalfWidth;\n        //                        edgeB1.Y = bHalfHeight;\n        //                        edgeB1.Z = bHalfLength;\n\n        //                        edgeB2.X = bHalfWidth;\n        //                        edgeB2.Y = bHalfHeight;\n        //                        edgeB2.Z = bHalfLength;\n\n        //                        edgeB1Id = 6;\n        //                        edgeB2Id = 7;\n        //                    }\n        //                    else\n        //                    {\n        //                        //+-\n        //                        edgeB1.X = -bHalfWidth;\n        //                        edgeB1.Y = bHalfHeight;\n        //                        edgeB1.Z = -bHalfLength;\n\n        //                        edgeB2.X = bHalfWidth;\n        //                        edgeB2.Y = bHalfHeight;\n        //                        edgeB2.Z = -bHalfLength;\n\n        //                        edgeB1Id = 2;\n        //                        edgeB2Id = 3;\n        //                    }\n        //                }\n        //                else\n        //                {\n        //                    if (mtdB.Z > 0)\n        //                    {\n        //                        //-+\n        //                        edgeB1.X = -bHalfWidth;\n        //                        edgeB1.Y = -bHalfHeight;\n        //                        edgeB1.Z = bHalfLength;\n\n        //                        edgeB2.X = bHalfWidth;\n        //                        edgeB2.Y = -bHalfHeight;\n        //                        edgeB2.Z = bHalfLength;\n\n        //                        edgeB1Id = 4;\n        //                        edgeB2Id = 5;\n        //                    }\n        //                    else\n        //                    {\n        //                        //--\n        //                        edgeB1.X = -bHalfWidth;\n        //                        edgeB1.Y = -bHalfHeight;\n        //                        edgeB1.Z = -bHalfLength;\n\n        //                        edgeB2.X = bHalfWidth;\n        //                        edgeB2.Y = -bHalfHeight;\n        //                        edgeB2.Z = -bHalfLength;\n\n        //                        edgeB1Id = 0;\n        //                        edgeB2Id = 1;\n        //                    }\n        //                }\n        //            }\n        //            else if (Math.Abs(mtdB.Y) < Toolbox.Epsilon)\n        //            {\n        //                //mtd is in the X-Z plane\n        //                if (mtdB.X > 0)\n        //                {\n        //                    if (mtdB.Z > 0)\n        //                    {\n        //                        //++\n        //                        edgeB1.X = bHalfWidth;\n        //                        edgeB1.Y = -bHalfHeight;\n        //                        edgeB1.Z = bHalfLength;\n\n        //                        edgeB2.X = bHalfWidth;\n        //                        edgeB2.Y = bHalfHeight;\n        //                        edgeB2.Z = bHalfLength;\n\n        //                        edgeB1Id = 5;\n        //                        edgeB2Id = 7;\n        //                    }\n        //                    else\n        //                    {\n        //                        //+-\n        //                        edgeB1.X = bHalfWidth;\n        //                        edgeB1.Y = -bHalfHeight;\n        //                        edgeB1.Z = -bHalfLength;\n\n        //                        edgeB2.X = bHalfWidth;\n        //                        edgeB2.Y = bHalfHeight;\n        //                        edgeB2.Z = -bHalfLength;\n\n        //                        edgeB1Id = 1;\n        //                        edgeB2Id = 3;\n        //                    }\n        //                }\n        //                else\n        //                {\n        //                    if (mtdB.Z > 0)\n        //                    {\n        //                        //-+\n        //                        edgeB1.X = -bHalfWidth;\n        //                        edgeB1.Y = -bHalfHeight;\n        //                        edgeB1.Z = bHalfLength;\n\n        //                        edgeB2.X = -bHalfWidth;\n        //                        edgeB2.Y = bHalfHeight;\n        //                        edgeB2.Z = bHalfLength;\n\n        //                        edgeB1Id = 4;\n        //                        edgeB2Id = 6;\n        //                    }\n        //                    else\n        //                    {\n        //                        //--\n        //                        edgeB1.X = -bHalfWidth;\n        //                        edgeB1.Y = -bHalfHeight;\n        //                        edgeB1.Z = -bHalfLength;\n\n        //                        edgeB2.X = -bHalfWidth;\n        //                        edgeB2.Y = bHalfHeight;\n        //                        edgeB2.Z = -bHalfLength;\n\n        //                        edgeB1Id = 0;\n        //                        edgeB2Id = 2;\n        //                    }\n        //                }\n        //            }\n        //            else\n        //            {\n        //                //mtd is in the X-Y plane\n        //                if (mtdB.X > 0)\n        //                {\n        //                    if (mtdB.Y > 0)\n        //                    {\n        //                        //++\n        //                        edgeB1.X = bHalfWidth;\n        //                        edgeB1.Y = bHalfHeight;\n        //                        edgeB1.Z = -bHalfLength;\n\n        //                        edgeB2.X = bHalfWidth;\n        //                        edgeB2.Y = bHalfHeight;\n        //                        edgeB2.Z = bHalfLength;\n\n        //                        edgeB1Id = 3;\n        //                        edgeB2Id = 7;\n        //                    }\n        //                    else\n        //                    {\n        //                        //+-\n        //                        edgeB1.X = bHalfWidth;\n        //                        edgeB1.Y = -bHalfHeight;\n        //                        edgeB1.Z = -bHalfLength;\n\n        //                        edgeB2.X = bHalfWidth;\n        //                        edgeB2.Y = -bHalfHeight;\n        //                        edgeB2.Z = bHalfLength;\n\n        //                        edgeB1Id = 1;\n        //                        edgeB2Id = 5;\n        //                    }\n        //                }\n        //                else\n        //                {\n        //                    if (mtdB.Y > 0)\n        //                    {\n        //                        //-+\n        //                        edgeB1.X = -bHalfWidth;\n        //                        edgeB1.Y = bHalfHeight;\n        //                        edgeB1.Z = -bHalfLength;\n\n        //                        edgeB2.X = -bHalfWidth;\n        //                        edgeB2.Y = bHalfHeight;\n        //                        edgeB2.Z = bHalfLength;\n\n        //                        edgeB1Id = 2;\n        //                        edgeB2Id = 6;\n        //                    }\n        //                    else\n        //                    {\n        //                        //--\n        //                        edgeB1.X = -bHalfWidth;\n        //                        edgeB1.Y = -bHalfHeight;\n        //                        edgeB1.Z = -bHalfLength;\n\n        //                        edgeB2.X = -bHalfWidth;\n        //                        edgeB2.Y = -bHalfHeight;\n        //                        edgeB2.Z = bHalfLength;\n\n        //                        edgeB1Id = 0;\n        //                        edgeB2Id = 4;\n        //                    }\n        //                }\n        //            }\n\n        //            #endregion\n\n        //            //TODO: Since the above uniquely identifies the edge from each box based on two vertices,\n        //            //get the edge feature id from vertexA id combined with vertexB id.\n        //            //Vertex id's are 3 bit binary 'numbers' because ---, --+, -+-, etc.\n\n\n        //            Matrix3X3.Transform(ref edgeA1, ref orientationA, out edgeA1);\n        //            Matrix3X3.Transform(ref edgeA2, ref orientationA, out edgeA2);\n        //            Matrix3X3.Transform(ref edgeB1, ref orientationB, out edgeB1);\n        //            Matrix3X3.Transform(ref edgeB2, ref orientationB, out edgeB2);\n        //            Vector3.Add(ref edgeA1, ref positionA, out edgeA1);\n        //            Vector3.Add(ref edgeA2, ref positionA, out edgeA2);\n        //            Vector3.Add(ref edgeB1, ref positionB, out edgeB1);\n        //            Vector3.Add(ref edgeB2, ref positionB, out edgeB2);\n\n        //            float s, t;\n        //            Vector3 onA, onB;\n        //            Toolbox.GetClosestPointsBetweenSegments(ref edgeA1, ref edgeA2, ref edgeB1, ref edgeB2, out s, out t, out onA, out onB);\n        //            //Vector3.Add(ref onA, ref onB, out point);\n        //            //Vector3.Multiply(ref point, .5f, out point);\n        //            point = onA;\n\n        //            //depth = (onB.X - onA.X) * mtd.X + (onB.Y - onA.Y) * mtd.Y + (onB.Z - onA.Z) * mtd.Z;\n\n        //            id = GetContactId(edgeA1Id, edgeA2Id, edgeB1Id, edgeB2Id);\n        //        }\n\n#if ALLOWUNSAFE\n        internal static void GetFaceContacts(BoxShape a, BoxShape b, ref Vector3 positionA, ref Matrix3x3 orientationA, ref Vector3 positionB, ref Matrix3x3 orientationB, bool aIsFaceOwner, ref Vector3 mtd, out BoxContactDataCache contactData)\n#else\n        internal static void GetFaceContacts(BoxShape a, BoxShape b, ref Vector3 positionA, ref Matrix3X3 orientationA, ref Vector3 positionB, ref Matrix3X3 orientationB, bool aIsFaceOwner, ref Vector3 mtd, out TinyStructList<BoxContactData> contactData)\n#endif\n        {\n            float aHalfWidth = a.halfWidth;\n            float aHalfHeight = a.halfHeight;\n            float aHalfLength = a.halfLength;\n\n            float bHalfWidth = b.halfWidth;\n            float bHalfHeight = b.halfHeight;\n            float bHalfLength = b.halfLength;\n\n            BoxFace aBoxFace, bBoxFace;\n\n            Vector3 negatedMtd;\n            Vector3.Negate(ref mtd, out negatedMtd);\n            GetNearestFace(ref positionA, ref orientationA, ref negatedMtd, aHalfWidth, aHalfHeight, aHalfLength, out aBoxFace);\n\n\n            GetNearestFace(ref positionB, ref orientationB, ref mtd, bHalfWidth, bHalfHeight, bHalfLength, out bBoxFace);\n\n            if (aIsFaceOwner)\n                ClipFacesDirect(ref aBoxFace, ref bBoxFace, ref negatedMtd, out contactData);\n            else\n                ClipFacesDirect(ref bBoxFace, ref aBoxFace, ref mtd, out contactData);\n\n            if (contactData.Count > 4)\n                PruneContactsMaxDistance(ref mtd, contactData, out contactData);\n        }\n\n#if ALLOWUNSAFE\n        private static unsafe void PruneContactsMaxDistance(ref Vector3 mtd, BoxContactDataCache input, out BoxContactDataCache output)\n        {\n            BoxContactData* data = &input.D1;\n            int count = input.Count;\n            //TODO: THE FOLLOWING has a small issue in release mode.\n            //Find the deepest point.\n            float deepestDepth = -1;\n            int deepestIndex = 0;\n            for (int i = 0; i < count; i++)\n            {\n                if (data[i].Depth > deepestDepth)\n                {\n                    deepestDepth = data[i].Depth;\n                    deepestIndex = i;\n                }\n            }\n\n            //Identify the furthest point away from the deepest index.\n            float furthestDistance = -1;\n            int furthestIndex = 0;\n            for (int i = 0; i < count; i++)\n            {\n                float distance;\n                Vector3.DistanceSquared(ref data[deepestIndex].Position, ref data[i].Position, out distance);\n                if (distance > furthestDistance)\n                {\n                    furthestDistance = distance;\n                    furthestIndex = i;\n                }\n\n            }\n\n            Vector3 xAxis;\n            Vector3.Subtract(ref data[furthestIndex].Position, ref data[deepestIndex].Position, out xAxis);\n\n            Vector3 yAxis;\n            Vector3.Cross(ref mtd, ref xAxis, out yAxis);\n\n            float minY;\n            float maxY;\n            int minYindex = 0;\n            int maxYindex = 0;\n\n            Vector3.Dot(ref data[0].Position, ref yAxis, out minY);\n            maxY = minY;\n            for (int i = 1; i < count; i++)\n            {\n                float dot;\n                Vector3.Dot(ref yAxis, ref data[i].Position, out dot);\n                if (dot < minY)\n                {\n                    minY = dot;\n                    minYindex = i;\n                }\n                else if (dot > maxY)\n                {\n                    maxY = dot;\n                    maxYindex = i;\n                }\n            }\n\n            output = new BoxContactDataCache\n                         {\n                             Count = 4,\n                             D1 = data[deepestIndex],\n                             D2 = data[furthestIndex],\n                             D3 = data[minYindex],\n                             D4 = data[maxYindex]\n                         };\n\n\n            //Vector3 v;\n            //var maximumOffset = new Vector3();\n            //int maxIndexA = -1, maxIndexB = -1;\n            //float temp;\n            //float maximumDistanceSquared = -float.MaxValue;\n            //for (int i = 0; i < count; i++)\n            //{\n            //    for (int j = i + 1; j < count; j++)\n            //    {\n            //        Vector3.Subtract(ref data[j].Position, ref data[i].Position, out v);\n            //        temp = v.LengthSquared();\n            //        if (temp > maximumDistanceSquared)\n            //        {\n            //            maximumDistanceSquared = temp;\n            //            maxIndexA = i;\n            //            maxIndexB = j;\n            //            maximumOffset = v;\n            //        }\n            //    }\n            //}\n\n            //Vector3 otherDirection;\n            //Vector3.Cross(ref mtd, ref maximumOffset, out otherDirection);\n            //int minimumIndex = -1, maximumIndex = -1;\n            //float minimumDistance = float.MaxValue, maximumDistance = -float.MaxValue;\n\n            //for (int i = 0; i < count; i++)\n            //{\n            //    if (i != maxIndexA && i != maxIndexB)\n            //    {\n            //        Vector3.Dot(ref data[i].Position, ref otherDirection, out temp);\n            //        if (temp > maximumDistance)\n            //        {\n            //            maximumDistance = temp;\n            //            maximumIndex = i;\n            //        }\n            //        if (temp < minimumDistance)\n            //        {\n            //            minimumDistance = temp;\n            //            minimumIndex = i;\n            //        }\n            //    }\n            //}\n\n            //output = new BoxContactDataCache();\n            //output.Count = 4;\n            //output.D1 = data[maxIndexA];\n            //output.D2 = data[maxIndexB];\n            //output.D3 = data[minimumIndex];\n            //output.D4 = data[maximumIndex];\n        }\n#else\n        private static void PruneContactsMaxDistance(ref Vector3 mtd, TinyStructList<BoxContactData> input, out TinyStructList<BoxContactData> output)\n        {\n            int count = input.Count;\n            //Find the deepest point.\n            BoxContactData data, deepestData;\n            input.Get(0, out deepestData);\n            for (int i = 1; i < count; i++)\n            {\n                input.Get(i, out data);\n                if (data.Depth > deepestData.Depth)\n                {\n                    deepestData = data;\n                }\n            }\n\n            //Identify the furthest point away from the deepest index.\n            BoxContactData furthestData;\n            input.Get(0, out furthestData);\n            float furthestDistance;\n            Vector3.DistanceSquared(ref deepestData.Position, ref furthestData.Position, out furthestDistance);\n            for (int i = 1; i < count; i++)\n            {\n                input.Get(i, out data);\n                float distance;\n                Vector3.DistanceSquared(ref deepestData.Position, ref data.Position, out distance);\n                if (distance > furthestDistance)\n                {\n                    furthestDistance = distance;\n                    furthestData = data;\n                }\n\n            }\n\n            Vector3 xAxis;\n            Vector3.Subtract(ref furthestData.Position, ref deepestData.Position, out xAxis);\n\n            Vector3 yAxis;\n            Vector3.Cross(ref mtd, ref xAxis, out yAxis);\n\n            float minY;\n            float maxY;\n            BoxContactData minData, maxData;\n            input.Get(0, out minData);\n            maxData = minData;\n\n            Vector3.Dot(ref minData.Position, ref yAxis, out minY);\n            maxY = minY;\n            for (int i = 1; i < count; i++)\n            {\n                input.Get(i, out data);\n                float dot;\n                Vector3.Dot(ref yAxis, ref data.Position, out dot);\n                if (dot < minY)\n                {\n                    minY = dot;\n                    minData = data;\n                }\n                else if (dot > maxY)\n                {\n                    maxY = dot;\n                    maxData = data;\n                }\n            }\n\n            output = new TinyStructList<BoxContactData>();\n            output.Add(ref deepestData);\n            output.Add(ref furthestData);\n            output.Add(ref minData);\n            output.Add(ref maxData);\n\n\n            //int count = input.Count;\n            //Vector3 v;\n            //var maximumOffset = new Vector3();\n            //int maxIndexA = -1, maxIndexB = -1;\n            //float temp;\n            //float maximumDistanceSquared = -float.MaxValue;\n            //BoxContactData itemA, itemB;\n            //for (int i = 0; i < count; i++)\n            //{\n            //    for (int j = i + 1; j < count; j++)\n            //    {\n            //        input.Get(j, out itemB);\n            //        input.Get(i, out itemA);\n            //        Vector3.Subtract(ref itemB.Position, ref itemA.Position, out v);\n            //        temp = v.LengthSquared();\n            //        if (temp > maximumDistanceSquared)\n            //        {\n            //            maximumDistanceSquared = temp;\n            //            maxIndexA = i;\n            //            maxIndexB = j;\n            //            maximumOffset = v;\n            //        }\n            //    }\n            //}\n\n            //Vector3 otherDirection;\n            //Vector3.Cross(ref mtd, ref maximumOffset, out otherDirection);\n            //int minimumIndex = -1, maximumIndex = -1;\n            //float minimumDistance = float.MaxValue, maximumDistance = -float.MaxValue;\n\n            //for (int i = 0; i < count; i++)\n            //{\n            //    if (i != maxIndexA && i != maxIndexB)\n            //    {\n            //        input.Get(i, out itemA);\n            //        Vector3.Dot(ref itemA.Position, ref otherDirection, out temp);\n            //        if (temp > maximumDistance)\n            //        {\n            //            maximumDistance = temp;\n            //            maximumIndex = i;\n            //        }\n            //        if (temp < minimumDistance)\n            //        {\n            //            minimumDistance = temp;\n            //            minimumIndex = i;\n            //        }\n            //    }\n            //}\n\n            //output = new TinyStructList<BoxContactData>();\n            //input.Get(maxIndexA, out itemA);\n            //output.Add(ref itemA);\n            //input.Get(maxIndexB, out itemA);\n            //output.Add(ref itemA);\n            //input.Get(minimumIndex, out itemA);\n            //output.Add(ref itemA);\n            //input.Get(maximumIndex, out itemA);\n            //output.Add(ref itemA);\n        }\n#endif\n#if EXCLUDED\n        private static unsafe void clipFacesSH(ref BoxFace clipFace, ref BoxFace face, ref Vector3 mtd, out BoxContactDataCache outputData)\n        {\n            BoxContactDataCache contactDataCache = new BoxContactDataCache();\n            BoxContactData* data = &contactDataCache.d1;\n\n            //Set up the initial face list.\n            data[0].position = face.v1;\n            data[0].id = face.id1;\n            data[1].position = face.v2;\n            data[1].id = face.id2;\n            data[2].position = face.v3;\n            data[2].id = face.id3;\n            data[3].position = face.v4;\n            data[3].id = face.id4;\n            contactDataCache.count = 4;\n\n            BoxContactDataCache temporaryCache;\n            BoxContactData* temp = &temporaryCache.d1;\n            FaceEdge clippingEdge;\n            Vector3 intersection;\n            for (int i = 0; i < 4; i++)\n            {//For each clipping edge (edges of face a)\n\n                clipFace.GetEdge(i, ref mtd, out clippingEdge);\n\n                temporaryCache = contactDataCache;\n\n                contactDataCache.count = 0;\n\n                Vector3 start = temp[temporaryCache.count - 1].position;\n                int startId = temp[temporaryCache.count - 1].id;\n\n\n                for (int j = 0; j < temporaryCache.count; j++)\n                {//For each point in the input list\n                    Vector3 end = temp[j].position;\n                    int endId = temp[j].id;\n                    if (clippingEdge.isPointInside(ref end))\n                    {\n                        if (!clippingEdge.isPointInside(ref start))\n                        {\n                            ComputeIntersection(ref start, ref end, ref mtd, ref clippingEdge, out intersection);\n                            if (contactDataCache.count < 8)\n                            {\n                                data[contactDataCache.count].position = intersection;\n                                data[contactDataCache.count].id = GetContactId(startId, endId, ref clippingEdge);\n                                contactDataCache.count++;\n                            }\n                            else\n                            {\n                                data[contactDataCache.count - 1].position = intersection;\n                                data[contactDataCache.count - 1].id = GetContactId(startId, endId, ref clippingEdge);\n                            }\n                        }\n                        if (contactDataCache.count < 8)\n                        {\n                            data[contactDataCache.count].position = end;\n                            data[contactDataCache.count].id = endId;\n                            contactDataCache.count++;\n                        }\n                        else\n                        {\n                            data[contactDataCache.count - 1].position = end;\n                            data[contactDataCache.count - 1].id = endId;\n                        }\n                    }\n                    else if (clippingEdge.isPointInside(ref start))\n                    {\n                        ComputeIntersection(ref start, ref end, ref mtd, ref clippingEdge, out intersection);\n                        if (contactDataCache.count < 8)\n                        {\n                            data[contactDataCache.count].position = intersection;\n                            data[contactDataCache.count].id = GetContactId(startId, endId, ref clippingEdge);\n                            contactDataCache.count++;\n                        }\n                        else\n                        {\n                            data[contactDataCache.count - 1].position = intersection;\n                            data[contactDataCache.count - 1].id = GetContactId(startId, endId, ref clippingEdge);\n                        }\n                    }\n                    start = end;\n                    startId = endId;\n                }\n            }\n            temporaryCache = contactDataCache;\n            contactDataCache.count = 0;\n\n            float depth;\n            float a, b;\n            Vector3.Dot(ref clipFace.v1, ref mtd, out a);\n            for (int i = 0; i < temporaryCache.count; i++)\n            {\n                Vector3.Dot(ref temp[i].position, ref mtd, out b);\n                depth = b - a;\n                if (depth <= 0)\n                {\n                    data[contactDataCache.count].position = temp[i].position;\n                    data[contactDataCache.count].id = temp[i].id;\n                    contactDataCache.count++;\n                }\n            }\n\n            outputData = contactDataCache;\n\n            /*\n             * \n  List outputList = subjectPolygon;\n  for (Edge clipEdge in clipPolygon) do\n     List inputList = outputList;\n     outputList.clear();\n     Point S = inputList.last;\n     for (Point E in inputList) do\n        if (E inside clipEdge) then\n           if (S not inside clipEdge) then\n              outputList.add(ComputeIntersection(S,E,clipEdge));\n           end if\n           outputList.add(E);\n        else if (S inside clipEdge) then\n           outputList.add(ComputeIntersection(S,E,clipEdge));\n        end if\n        S = E;\n     done\n  done\n             */\n\n        }\n#endif\n\n#if ALLOWUNSAFE\n        private static unsafe void ClipFacesDirect(ref BoxFace clipFace, ref BoxFace face, ref Vector3 mtd, out BoxContactDataCache outputData)\n        {\n            var contactData = new BoxContactDataCache();\n            BoxContactDataCache tempData; //Local version.\n            BoxContactData* data = &contactData.D1;\n            BoxContactData* temp = &tempData.D1;\n\n            //Local directions on the clip face.  Their length is equal to the length of an edge.\n            Vector3 clipX, clipY;\n            Vector3.Subtract(ref clipFace.V4, ref clipFace.V3, out clipX);\n            Vector3.Subtract(ref clipFace.V2, ref clipFace.V3, out clipY);\n            float inverseClipWidth = 1 / clipFace.Width;\n            float inverseClipHeight = 1 / clipFace.Height;\n            float inverseClipWidthSquared = inverseClipWidth * inverseClipWidth;\n            clipX.X *= inverseClipWidthSquared;\n            clipX.Y *= inverseClipWidthSquared;\n            clipX.Z *= inverseClipWidthSquared;\n            float inverseClipHeightSquared = inverseClipHeight * inverseClipHeight;\n            clipY.X *= inverseClipHeightSquared;\n            clipY.Y *= inverseClipHeightSquared;\n            clipY.Z *= inverseClipHeightSquared;\n\n            //Local directions on the opposing face.  Their length is equal to the length of an edge.\n            Vector3 faceX, faceY;\n            Vector3.Subtract(ref face.V4, ref face.V3, out faceX);\n            Vector3.Subtract(ref face.V2, ref face.V3, out faceY);\n            float inverseFaceWidth = 1 / face.Width;\n            float inverseFaceHeight = 1 / face.Height;\n            float inverseFaceWidthSquared = inverseFaceWidth * inverseFaceWidth;\n            faceX.X *= inverseFaceWidthSquared;\n            faceX.Y *= inverseFaceWidthSquared;\n            faceX.Z *= inverseFaceWidthSquared;\n            float inverseFaceHeightSquared = inverseFaceHeight * inverseFaceHeight;\n            faceY.X *= inverseFaceHeightSquared;\n            faceY.Y *= inverseFaceHeightSquared;\n            faceY.Z *= inverseFaceHeightSquared;\n\n            Vector3 clipCenter;\n            Vector3.Add(ref clipFace.V1, ref clipFace.V3, out clipCenter);\n            //Defer division until after dot product (2 multiplies instead of 3)\n            float clipCenterX, clipCenterY;\n            Vector3.Dot(ref clipCenter, ref clipX, out clipCenterX);\n            Vector3.Dot(ref clipCenter, ref clipY, out clipCenterY);\n            clipCenterX *= .5f;\n            clipCenterY *= .5f;\n\n            Vector3 faceCenter;\n            Vector3.Add(ref face.V1, ref face.V3, out faceCenter);\n            //Defer division until after dot product (2 multiplies instead of 3)\n            float faceCenterX, faceCenterY;\n            Vector3.Dot(ref faceCenter, ref faceX, out faceCenterX);\n            Vector3.Dot(ref faceCenter, ref faceY, out faceCenterY);\n            faceCenterX *= .5f;\n            faceCenterY *= .5f;\n\n            //To test bounds, recall that clipX is the length of the X edge.\n            //Going from the center to the max or min goes half of the length of X edge, or +/- 0.5.\n            //Bias could be added here.\n            //const float extent = .5f; //.5f is the default, extra could be added for robustness or speed.\n            float extentX = .5f + .01f * inverseClipWidth;\n            float extentY = .5f + .01f * inverseClipHeight;\n            //float extentX = .5f + .01f * inverseClipXLength;\n            //float extentY = .5f + .01f * inverseClipYLength;\n            float clipCenterMaxX = clipCenterX + extentX;\n            float clipCenterMaxY = clipCenterY + extentY;\n            float clipCenterMinX = clipCenterX - extentX;\n            float clipCenterMinY = clipCenterY - extentY;\n\n            extentX = .5f + .01f * inverseFaceWidth;\n            extentY = .5f + .01f * inverseFaceHeight;\n            //extentX = .5f + .01f * inverseFaceXLength;\n            //extentY = .5f + .01f * inverseFaceYLength;\n            float faceCenterMaxX = faceCenterX + extentX;\n            float faceCenterMaxY = faceCenterY + extentY;\n            float faceCenterMinX = faceCenterX - extentX;\n            float faceCenterMinY = faceCenterY - extentY;\n\n            //Find out where the opposing face is.\n            float dotX, dotY;\n\n            //The four edges can be thought of as minX, maxX, minY and maxY.\n\n            //Face v1\n            Vector3.Dot(ref clipX, ref face.V1, out dotX);\n            bool v1MaxXInside = dotX < clipCenterMaxX;\n            bool v1MinXInside = dotX > clipCenterMinX;\n            Vector3.Dot(ref clipY, ref face.V1, out dotY);\n            bool v1MaxYInside = dotY < clipCenterMaxY;\n            bool v1MinYInside = dotY > clipCenterMinY;\n\n            //Face v2\n            Vector3.Dot(ref clipX, ref face.V2, out dotX);\n            bool v2MaxXInside = dotX < clipCenterMaxX;\n            bool v2MinXInside = dotX > clipCenterMinX;\n            Vector3.Dot(ref clipY, ref face.V2, out dotY);\n            bool v2MaxYInside = dotY < clipCenterMaxY;\n            bool v2MinYInside = dotY > clipCenterMinY;\n\n            //Face v3\n            Vector3.Dot(ref clipX, ref face.V3, out dotX);\n            bool v3MaxXInside = dotX < clipCenterMaxX;\n            bool v3MinXInside = dotX > clipCenterMinX;\n            Vector3.Dot(ref clipY, ref face.V3, out dotY);\n            bool v3MaxYInside = dotY < clipCenterMaxY;\n            bool v3MinYInside = dotY > clipCenterMinY;\n\n            //Face v4\n            Vector3.Dot(ref clipX, ref face.V4, out dotX);\n            bool v4MaxXInside = dotX < clipCenterMaxX;\n            bool v4MinXInside = dotX > clipCenterMinX;\n            Vector3.Dot(ref clipY, ref face.V4, out dotY);\n            bool v4MaxYInside = dotY < clipCenterMaxY;\n            bool v4MinYInside = dotY > clipCenterMinY;\n\n            //Find out where the clip face is.\n            //Clip v1\n            Vector3.Dot(ref faceX, ref clipFace.V1, out dotX);\n            bool clipv1MaxXInside = dotX < faceCenterMaxX;\n            bool clipv1MinXInside = dotX > faceCenterMinX;\n            Vector3.Dot(ref faceY, ref clipFace.V1, out dotY);\n            bool clipv1MaxYInside = dotY < faceCenterMaxY;\n            bool clipv1MinYInside = dotY > faceCenterMinY;\n\n            //Clip v2\n            Vector3.Dot(ref faceX, ref clipFace.V2, out dotX);\n            bool clipv2MaxXInside = dotX < faceCenterMaxX;\n            bool clipv2MinXInside = dotX > faceCenterMinX;\n            Vector3.Dot(ref faceY, ref clipFace.V2, out dotY);\n            bool clipv2MaxYInside = dotY < faceCenterMaxY;\n            bool clipv2MinYInside = dotY > faceCenterMinY;\n\n            //Clip v3\n            Vector3.Dot(ref faceX, ref clipFace.V3, out dotX);\n            bool clipv3MaxXInside = dotX < faceCenterMaxX;\n            bool clipv3MinXInside = dotX > faceCenterMinX;\n            Vector3.Dot(ref faceY, ref clipFace.V3, out dotY);\n            bool clipv3MaxYInside = dotY < faceCenterMaxY;\n            bool clipv3MinYInside = dotY > faceCenterMinY;\n\n            //Clip v4\n            Vector3.Dot(ref faceX, ref clipFace.V4, out dotX);\n            bool clipv4MaxXInside = dotX < faceCenterMaxX;\n            bool clipv4MinXInside = dotX > faceCenterMinX;\n            Vector3.Dot(ref faceY, ref clipFace.V4, out dotY);\n            bool clipv4MaxYInside = dotY < faceCenterMaxY;\n            bool clipv4MinYInside = dotY > faceCenterMinY;\n\n        #region Face Vertices\n\n            if (v1MinXInside && v1MaxXInside && v1MinYInside && v1MaxYInside)\n            {\n                data[contactData.Count].Position = face.V1;\n                data[contactData.Count].Id = face.Id1;\n                contactData.Count++;\n            }\n\n            if (v2MinXInside && v2MaxXInside && v2MinYInside && v2MaxYInside)\n            {\n                data[contactData.Count].Position = face.V2;\n                data[contactData.Count].Id = face.Id2;\n                contactData.Count++;\n            }\n\n            if (v3MinXInside && v3MaxXInside && v3MinYInside && v3MaxYInside)\n            {\n                data[contactData.Count].Position = face.V3;\n                data[contactData.Count].Id = face.Id3;\n                contactData.Count++;\n            }\n\n            if (v4MinXInside && v4MaxXInside && v4MinYInside && v4MaxYInside)\n            {\n                data[contactData.Count].Position = face.V4;\n                data[contactData.Count].Id = face.Id4;\n                contactData.Count++;\n            }\n\n            #endregion\n\n            //Compute depths.\n            tempData = contactData;\n            contactData.Count = 0;\n            float depth;\n            float clipFaceDot, faceDot;\n            Vector3.Dot(ref clipFace.V1, ref mtd, out clipFaceDot);\n            for (int i = 0; i < tempData.Count; i++)\n            {\n                Vector3.Dot(ref temp[i].Position, ref mtd, out faceDot);\n                depth = faceDot - clipFaceDot;\n                if (depth <= 0)\n                {\n                    data[contactData.Count].Position = temp[i].Position;\n                    data[contactData.Count].Depth = depth;\n                    data[contactData.Count].Id = temp[i].Id;\n                    contactData.Count++;\n                }\n            }\n\n            byte previousCount = contactData.Count;\n            if (previousCount >= 4) //Early finish :)\n            {\n                outputData = contactData;\n                return;\n            }\n\n        #region Clip face vertices\n\n            Vector3 v;\n            float a, b;\n            Vector3.Dot(ref face.V1, ref face.Normal, out b);\n            //CLIP FACE\n            if (clipv1MinXInside && clipv1MaxXInside && clipv1MinYInside && clipv1MaxYInside)\n            {\n                Vector3.Dot(ref clipFace.V1, ref face.Normal, out a);\n                Vector3.Multiply(ref face.Normal, a - b, out v);\n                Vector3.Subtract(ref clipFace.V1, ref v, out v);\n                data[contactData.Count].Position = v;\n                data[contactData.Count].Id = clipFace.Id1 + 8;\n                contactData.Count++;\n            }\n\n            if (clipv2MinXInside && clipv2MaxXInside && clipv2MinYInside && clipv2MaxYInside)\n            {\n                Vector3.Dot(ref clipFace.V2, ref face.Normal, out a);\n                Vector3.Multiply(ref face.Normal, a - b, out v);\n                Vector3.Subtract(ref clipFace.V2, ref v, out v);\n                data[contactData.Count].Position = v;\n                data[contactData.Count].Id = clipFace.Id2 + 8;\n                contactData.Count++;\n            }\n\n            if (clipv3MinXInside && clipv3MaxXInside && clipv3MinYInside && clipv3MaxYInside)\n            {\n                Vector3.Dot(ref clipFace.V3, ref face.Normal, out a);\n                Vector3.Multiply(ref face.Normal, a - b, out v);\n                Vector3.Subtract(ref clipFace.V3, ref v, out v);\n                data[contactData.Count].Position = v;\n                data[contactData.Count].Id = clipFace.Id3 + 8;\n                contactData.Count++;\n            }\n\n            if (clipv4MinXInside && clipv4MaxXInside && clipv4MinYInside && clipv4MaxYInside)\n            {\n                Vector3.Dot(ref clipFace.V4, ref face.Normal, out a);\n                Vector3.Multiply(ref face.Normal, a - b, out v);\n                Vector3.Subtract(ref clipFace.V4, ref v, out v);\n                data[contactData.Count].Position = v;\n                data[contactData.Count].Id = clipFace.Id4 + 8;\n                contactData.Count++;\n            }\n\n            #endregion\n\n            //Compute depths.\n            tempData = contactData;\n            contactData.Count = previousCount;\n\n            for (int i = previousCount; i < tempData.Count; i++)\n            {\n                Vector3.Dot(ref temp[i].Position, ref mtd, out faceDot);\n                depth = faceDot - clipFaceDot;\n                if (depth <= 0)\n                {\n                    data[contactData.Count].Position = temp[i].Position;\n                    data[contactData.Count].Depth = depth;\n                    data[contactData.Count].Id = temp[i].Id;\n                    contactData.Count++;\n                }\n            }\n\n            previousCount = contactData.Count;\n            if (previousCount >= 4) //Early finish :)\n            {\n                outputData = contactData;\n                return;\n            }\n\n            //Intersect edges.\n\n            //maxX maxY -> v1\n            //minX maxY -> v2\n            //minX minY -> v3\n            //maxX minY -> v4\n\n            //Once we get here there can only be 3 contacts or less.\n            //Once 4 possible contacts have been added, switch to using safe increments.\n            //float dot;\n\n        #region CLIP EDGE: v1 v2\n\n            FaceEdge clipEdge;\n            clipFace.GetEdge(0, out clipEdge);\n            if (!v1MaxYInside)\n            {\n                if (v2MaxYInside)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v4MaxYInside)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v2MaxYInside)\n            {\n                if (v1MaxYInside)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v3MaxYInside)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v3MaxYInside)\n            {\n                if (v2MaxYInside)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v4MaxYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v4MaxYInside)\n            {\n                if (v1MaxYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v3MaxYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n\n            #endregion\n\n        #region CLIP EDGE: v2 v3\n\n            clipFace.GetEdge(1, out clipEdge);\n            if (!v1MinXInside)\n            {\n                if (v2MinXInside && contactData.Count < 8)\n                {\n                    //test v1-v2 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v4MinXInside && contactData.Count < 8)\n                {\n                    //test v1-v3 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v2MinXInside)\n            {\n                if (v1MinXInside && contactData.Count < 8)\n                {\n                    //test v1-v2 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v3MinXInside && contactData.Count < 8)\n                {\n                    //test v2-v4 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v3MinXInside)\n            {\n                if (v2MinXInside && contactData.Count < 8)\n                {\n                    //test v1-v3 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v4MinXInside && contactData.Count < 8)\n                {\n                    //test v3-v4 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v4MinXInside)\n            {\n                if (v1MinXInside && contactData.Count < 8)\n                {\n                    //test v2-v4 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v3MinXInside && contactData.Count < 8)\n                {\n                    //test v3-v4 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n\n            #endregion\n\n        #region CLIP EDGE: v3 v4\n\n            clipFace.GetEdge(2, out clipEdge);\n            if (!v1MinYInside)\n            {\n                if (v2MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v4MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v2MinYInside)\n            {\n                if (v1MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v3MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v3MinYInside)\n            {\n                if (v2MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v4MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v4MinYInside)\n            {\n                if (v3MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v1MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n\n            #endregion\n\n        #region CLIP EDGE: v4 v1\n\n            clipFace.GetEdge(3, out clipEdge);\n            if (!v1MaxXInside)\n            {\n                if (v2MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v4MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v2MaxXInside)\n            {\n                if (v1MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v3MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v3MaxXInside)\n            {\n                if (v2MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v4MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n            if (!v4MaxXInside)\n            {\n                if (v1MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n                if (v3MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        data[contactData.Count].Position = v;\n                        data[contactData.Count].Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Count++;\n                    }\n                }\n            }\n\n            #endregion\n\n            //Compute depths.\n            tempData = contactData;\n            contactData.Count = previousCount;\n\n            for (int i = previousCount; i < tempData.Count; i++)\n            {\n                Vector3.Dot(ref temp[i].Position, ref mtd, out faceDot);\n                depth = faceDot - clipFaceDot;\n                if (depth <= 0)\n                {\n                    data[contactData.Count].Position = temp[i].Position;\n                    data[contactData.Count].Depth = depth;\n                    data[contactData.Count].Id = temp[i].Id;\n                    contactData.Count++;\n                }\n            }\n            outputData = contactData;\n        }\n#else\n        private static void ClipFacesDirect(ref BoxFace clipFace, ref BoxFace face, ref Vector3 mtd, out TinyStructList<BoxContactData> contactData)\n        {\n            contactData = new TinyStructList<BoxContactData>();\n\n            //Local directions on the clip face.  Their length is equal to the length of an edge.\n            Vector3 clipX, clipY;\n            Vector3.Subtract(ref clipFace.V4, ref clipFace.V3, out clipX);\n            Vector3.Subtract(ref clipFace.V2, ref clipFace.V3, out clipY);\n            float inverseClipWidth = 1 / clipFace.Width;\n            float inverseClipHeight = 1 / clipFace.Height;\n            float inverseClipWidthSquared = inverseClipWidth * inverseClipWidth;\n            clipX.X *= inverseClipWidthSquared;\n            clipX.Y *= inverseClipWidthSquared;\n            clipX.Z *= inverseClipWidthSquared;\n            float inverseClipHeightSquared = inverseClipHeight * inverseClipHeight;\n            clipY.X *= inverseClipHeightSquared;\n            clipY.Y *= inverseClipHeightSquared;\n            clipY.Z *= inverseClipHeightSquared;\n\n            //Local directions on the opposing face.  Their length is equal to the length of an edge.\n            Vector3 faceX, faceY;\n            Vector3.Subtract(ref face.V4, ref face.V3, out faceX);\n            Vector3.Subtract(ref face.V2, ref face.V3, out faceY);\n            float inverseFaceWidth = 1 / face.Width;\n            float inverseFaceHeight = 1 / face.Height;\n            float inverseFaceWidthSquared = inverseFaceWidth * inverseFaceWidth;\n            faceX.X *= inverseFaceWidthSquared;\n            faceX.Y *= inverseFaceWidthSquared;\n            faceX.Z *= inverseFaceWidthSquared;\n            float inverseFaceHeightSquared = inverseFaceHeight * inverseFaceHeight;\n            faceY.X *= inverseFaceHeightSquared;\n            faceY.Y *= inverseFaceHeightSquared;\n            faceY.Z *= inverseFaceHeightSquared;\n\n            Vector3 clipCenter;\n            Vector3.Add(ref clipFace.V1, ref clipFace.V3, out clipCenter);\n            //Defer division until after dot product (2 multiplies instead of 3)\n            float clipCenterX, clipCenterY;\n            Vector3.Dot(ref clipCenter, ref clipX, out clipCenterX);\n            Vector3.Dot(ref clipCenter, ref clipY, out clipCenterY);\n            clipCenterX *= .5f;\n            clipCenterY *= .5f;\n\n            Vector3 faceCenter;\n            Vector3.Add(ref face.V1, ref face.V3, out faceCenter);\n            //Defer division until after dot product (2 multiplies instead of 3)\n            float faceCenterX, faceCenterY;\n            Vector3.Dot(ref faceCenter, ref faceX, out faceCenterX);\n            Vector3.Dot(ref faceCenter, ref faceY, out faceCenterY);\n            faceCenterX *= .5f;\n            faceCenterY *= .5f;\n\n            //To test bounds, recall that clipX is the length of the X edge.\n            //Going from the center to the max or min goes half of the length of X edge, or +/- 0.5.\n            //Bias could be added here.\n            //const float extent = .5f; //.5f is the default, extra could be added for robustness or speed.\n            float extentX = .5f + .01f * inverseClipWidth;\n            float extentY = .5f + .01f * inverseClipHeight;\n            //float extentX = .5f + .01f * inverseClipXLength;\n            //float extentY = .5f + .01f * inverseClipYLength;\n            float clipCenterMaxX = clipCenterX + extentX;\n            float clipCenterMaxY = clipCenterY + extentY;\n            float clipCenterMinX = clipCenterX - extentX;\n            float clipCenterMinY = clipCenterY - extentY;\n\n            extentX = .5f + .01f * inverseFaceWidth;\n            extentY = .5f + .01f * inverseFaceHeight;\n            //extentX = .5f + .01f * inverseFaceXLength;\n            //extentY = .5f + .01f * inverseFaceYLength;\n            float faceCenterMaxX = faceCenterX + extentX;\n            float faceCenterMaxY = faceCenterY + extentY;\n            float faceCenterMinX = faceCenterX - extentX;\n            float faceCenterMinY = faceCenterY - extentY;\n\n            //Find out where the opposing face is.\n            float dotX, dotY;\n\n            //The four edges can be thought of as minX, maxX, minY and maxY.\n\n            //Face v1\n            Vector3.Dot(ref clipX, ref face.V1, out dotX);\n            bool v1MaxXInside = dotX < clipCenterMaxX;\n            bool v1MinXInside = dotX > clipCenterMinX;\n            Vector3.Dot(ref clipY, ref face.V1, out dotY);\n            bool v1MaxYInside = dotY < clipCenterMaxY;\n            bool v1MinYInside = dotY > clipCenterMinY;\n\n            //Face v2\n            Vector3.Dot(ref clipX, ref face.V2, out dotX);\n            bool v2MaxXInside = dotX < clipCenterMaxX;\n            bool v2MinXInside = dotX > clipCenterMinX;\n            Vector3.Dot(ref clipY, ref face.V2, out dotY);\n            bool v2MaxYInside = dotY < clipCenterMaxY;\n            bool v2MinYInside = dotY > clipCenterMinY;\n\n            //Face v3\n            Vector3.Dot(ref clipX, ref face.V3, out dotX);\n            bool v3MaxXInside = dotX < clipCenterMaxX;\n            bool v3MinXInside = dotX > clipCenterMinX;\n            Vector3.Dot(ref clipY, ref face.V3, out dotY);\n            bool v3MaxYInside = dotY < clipCenterMaxY;\n            bool v3MinYInside = dotY > clipCenterMinY;\n\n            //Face v4\n            Vector3.Dot(ref clipX, ref face.V4, out dotX);\n            bool v4MaxXInside = dotX < clipCenterMaxX;\n            bool v4MinXInside = dotX > clipCenterMinX;\n            Vector3.Dot(ref clipY, ref face.V4, out dotY);\n            bool v4MaxYInside = dotY < clipCenterMaxY;\n            bool v4MinYInside = dotY > clipCenterMinY;\n\n            //Find out where the clip face is.\n            //Clip v1\n            Vector3.Dot(ref faceX, ref clipFace.V1, out dotX);\n            bool clipv1MaxXInside = dotX < faceCenterMaxX;\n            bool clipv1MinXInside = dotX > faceCenterMinX;\n            Vector3.Dot(ref faceY, ref clipFace.V1, out dotY);\n            bool clipv1MaxYInside = dotY < faceCenterMaxY;\n            bool clipv1MinYInside = dotY > faceCenterMinY;\n\n            //Clip v2\n            Vector3.Dot(ref faceX, ref clipFace.V2, out dotX);\n            bool clipv2MaxXInside = dotX < faceCenterMaxX;\n            bool clipv2MinXInside = dotX > faceCenterMinX;\n            Vector3.Dot(ref faceY, ref clipFace.V2, out dotY);\n            bool clipv2MaxYInside = dotY < faceCenterMaxY;\n            bool clipv2MinYInside = dotY > faceCenterMinY;\n\n            //Clip v3\n            Vector3.Dot(ref faceX, ref clipFace.V3, out dotX);\n            bool clipv3MaxXInside = dotX < faceCenterMaxX;\n            bool clipv3MinXInside = dotX > faceCenterMinX;\n            Vector3.Dot(ref faceY, ref clipFace.V3, out dotY);\n            bool clipv3MaxYInside = dotY < faceCenterMaxY;\n            bool clipv3MinYInside = dotY > faceCenterMinY;\n\n            //Clip v4\n            Vector3.Dot(ref faceX, ref clipFace.V4, out dotX);\n            bool clipv4MaxXInside = dotX < faceCenterMaxX;\n            bool clipv4MinXInside = dotX > faceCenterMinX;\n            Vector3.Dot(ref faceY, ref clipFace.V4, out dotY);\n            bool clipv4MaxYInside = dotY < faceCenterMaxY;\n            bool clipv4MinYInside = dotY > faceCenterMinY;\n\n            #region Face Vertices\n            BoxContactData item = new BoxContactData();\n            if (v1MinXInside && v1MaxXInside && v1MinYInside && v1MaxYInside)\n            {\n                item.Position = face.V1;\n                item.Id = face.Id1;\n                contactData.Add(ref item);\n            }\n\n            if (v2MinXInside && v2MaxXInside && v2MinYInside && v2MaxYInside)\n            {\n                item.Position = face.V2;\n                item.Id = face.Id2;\n                contactData.Add(ref item);\n            }\n\n            if (v3MinXInside && v3MaxXInside && v3MinYInside && v3MaxYInside)\n            {\n                item.Position = face.V3;\n                item.Id = face.Id3;\n                contactData.Add(ref item);\n            }\n\n            if (v4MinXInside && v4MaxXInside && v4MinYInside && v4MaxYInside)\n            {\n                item.Position = face.V4;\n                item.Id = face.Id4;\n                contactData.Add(ref item);\n            }\n\n            #endregion\n\n            //Compute depths.\n            TinyStructList<BoxContactData> tempData = contactData;\n            contactData.Clear();\n            float clipFaceDot, faceDot;\n            Vector3.Dot(ref clipFace.V1, ref mtd, out clipFaceDot);\n            for (int i = 0; i < tempData.Count; i++)\n            {\n                tempData.Get(i, out item);\n                Vector3.Dot(ref item.Position, ref mtd, out faceDot);\n                item.Depth = faceDot - clipFaceDot;\n                if (item.Depth <= 0)\n                {\n                    contactData.Add(ref item);\n                }\n            }\n\n            int previousCount = contactData.Count;\n            if (previousCount >= 4) //Early finish :)\n            {\n                return;\n            }\n\n            #region Clip face vertices\n\n            Vector3 v;\n            float a, b;\n            Vector3.Dot(ref face.V1, ref face.Normal, out b);\n            //CLIP FACE\n            if (clipv1MinXInside && clipv1MaxXInside && clipv1MinYInside && clipv1MaxYInside)\n            {\n                Vector3.Dot(ref clipFace.V1, ref face.Normal, out a);\n                Vector3.Multiply(ref face.Normal, a - b, out v);\n                Vector3.Subtract(ref clipFace.V1, ref v, out v);\n                item.Position = v;\n                item.Id = clipFace.Id1 + 8;\n                contactData.Add(ref item);\n            }\n\n            if (clipv2MinXInside && clipv2MaxXInside && clipv2MinYInside && clipv2MaxYInside)\n            {\n                Vector3.Dot(ref clipFace.V2, ref face.Normal, out a);\n                Vector3.Multiply(ref face.Normal, a - b, out v);\n                Vector3.Subtract(ref clipFace.V2, ref v, out v);\n                item.Position = v;\n                item.Id = clipFace.Id2 + 8;\n                contactData.Add(ref item);\n            }\n\n            if (clipv3MinXInside && clipv3MaxXInside && clipv3MinYInside && clipv3MaxYInside)\n            {\n                Vector3.Dot(ref clipFace.V3, ref face.Normal, out a);\n                Vector3.Multiply(ref face.Normal, a - b, out v);\n                Vector3.Subtract(ref clipFace.V3, ref v, out v);\n                item.Position = v;\n                item.Id = clipFace.Id3 + 8;\n                contactData.Add(ref item);\n            }\n\n            if (clipv4MinXInside && clipv4MaxXInside && clipv4MinYInside && clipv4MaxYInside)\n            {\n                Vector3.Dot(ref clipFace.V4, ref face.Normal, out a);\n                Vector3.Multiply(ref face.Normal, a - b, out v);\n                Vector3.Subtract(ref clipFace.V4, ref v, out v);\n                item.Position = v;\n                item.Id = clipFace.Id4 + 8;\n                contactData.Add(ref item);\n            }\n\n            #endregion\n\n            //Compute depths.\n            int postClipCount = contactData.Count;\n            tempData = contactData;\n            for (int i = postClipCount - 1; i >= previousCount; i--) //TODO: >=?\n                contactData.RemoveAt(i);\n\n\n            for (int i = previousCount; i < tempData.Count; i++)\n            {\n                tempData.Get(i, out item);\n                Vector3.Dot(ref item.Position, ref mtd, out faceDot);\n                item.Depth = faceDot - clipFaceDot;\n                if (item.Depth <= 0)\n                {\n                    contactData.Add(ref item);\n                }\n            }\n\n            previousCount = contactData.Count;\n            if (previousCount >= 4) //Early finish :)\n            {\n                return;\n            }\n            //Intersect edges.\n\n            //maxX maxY -> v1\n            //minX maxY -> v2\n            //minX minY -> v3\n            //maxX minY -> v4\n\n            //Once we get here there can only be 3 contacts or less.\n            //Once 4 possible contacts have been added, switch to using safe increments.\n            //float dot;\n\n            #region CLIP EDGE: v1 v2\n\n            FaceEdge clipEdge;\n            clipFace.GetEdge(0, out clipEdge);\n            if (!v1MaxYInside)\n            {\n                if (v2MaxYInside)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v4MaxYInside)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v2MaxYInside)\n            {\n                if (v1MaxYInside)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v3MaxYInside)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v3MaxYInside)\n            {\n                if (v2MaxYInside)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v4MaxYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v4MaxYInside)\n            {\n                if (v1MaxYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v3MaxYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n\n            #endregion\n\n            #region CLIP EDGE: v2 v3\n\n            clipFace.GetEdge(1, out clipEdge);\n            if (!v1MinXInside)\n            {\n                if (v2MinXInside && contactData.Count < 8)\n                {\n                    //test v1-v2 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v4MinXInside && contactData.Count < 8)\n                {\n                    //test v1-v3 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v2MinXInside)\n            {\n                if (v1MinXInside && contactData.Count < 8)\n                {\n                    //test v1-v2 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v3MinXInside && contactData.Count < 8)\n                {\n                    //test v2-v4 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v3MinXInside)\n            {\n                if (v2MinXInside && contactData.Count < 8)\n                {\n                    //test v1-v3 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v4MinXInside && contactData.Count < 8)\n                {\n                    //test v3-v4 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v4MinXInside)\n            {\n                if (v1MinXInside && contactData.Count < 8)\n                {\n                    //test v2-v4 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v3MinXInside && contactData.Count < 8)\n                {\n                    //test v3-v4 against minXminY-minXmaxY\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n\n            #endregion\n\n            #region CLIP EDGE: v3 v4\n\n            clipFace.GetEdge(2, out clipEdge);\n            if (!v1MinYInside)\n            {\n                if (v2MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v4MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v2MinYInside)\n            {\n                if (v1MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v3MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v3MinYInside)\n            {\n                if (v2MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v4MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v4MinYInside)\n            {\n                if (v3MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v1MinYInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipX, ref v, out dot);\n                    //if (dot > clipCenterMinX && dot < clipCenterMaxX)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n\n            #endregion\n\n            #region CLIP EDGE: v4 v1\n\n            clipFace.GetEdge(3, out clipEdge);\n            if (!v1MaxXInside)\n            {\n                if (v2MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v4MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v2MaxXInside)\n            {\n                if (v1MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v3MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v3MaxXInside)\n            {\n                if (v2MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v4MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n            if (!v4MaxXInside)\n            {\n                if (v1MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n                if (v3MaxXInside && contactData.Count < 8)\n                {\n                    //ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n                    //Vector3.Dot(ref clipY, ref v, out dot);\n                    //if (dot > clipCenterMinY && dot < clipCenterMaxY)\n                    if (ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v))\n                    {\n                        item.Position = v;\n                        item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n                        contactData.Add(ref item);\n                    }\n                }\n            }\n\n            #endregion\n\n            //Compute depths.\n            postClipCount = contactData.Count;\n            tempData = contactData;\n            for (int i = postClipCount - 1; i >= previousCount; i--)\n                contactData.RemoveAt(i);\n\n            for (int i = previousCount; i < tempData.Count; i++)\n            {\n                tempData.Get(i, out item);\n                Vector3.Dot(ref item.Position, ref mtd, out faceDot);\n                item.Depth = faceDot - clipFaceDot;\n                if (item.Depth <= 0)\n                {\n                    contactData.Add(ref item);\n                }\n            }\n        }\n        //private static void ClipFacesDirect(ref BoxFace clipFace, ref BoxFace face, ref Vector3 mtd, out TinyStructList<BoxContactData> contactData)\n        //{\n        //    contactData = new TinyStructList<BoxContactData>();\n        //    //BoxContactData* data = &contactData.d1;\n        //    //BoxContactData* temp = &tempData.d1;\n\n        //    //Local directions on the clip face.  Their length is equal to the length of an edge.\n        //    Vector3 clipX, clipY;\n        //    Vector3.Subtract(ref clipFace.V4, ref clipFace.V3, out clipX);\n        //    Vector3.Subtract(ref clipFace.V2, ref clipFace.V3, out clipY);\n        //    float inverse = 1 / clipX.LengthSquared();\n        //    clipX.X *= inverse;\n        //    clipX.Y *= inverse;\n        //    clipX.Z *= inverse;\n        //    inverse = 1 / clipY.LengthSquared();\n        //    clipY.X *= inverse;\n        //    clipY.Y *= inverse;\n        //    clipY.Z *= inverse;\n\n        //    //Local directions on the opposing face.  Their length is equal to the length of an edge.\n        //    Vector3 faceX, faceY;\n        //    Vector3.Subtract(ref face.V4, ref face.V3, out faceX);\n        //    Vector3.Subtract(ref face.V2, ref face.V3, out faceY);\n        //    inverse = 1 / faceX.LengthSquared();\n        //    faceX.X *= inverse;\n        //    faceX.Y *= inverse;\n        //    faceX.Z *= inverse;\n        //    inverse = 1 / faceY.LengthSquared();\n        //    faceY.X *= inverse;\n        //    faceY.Y *= inverse;\n        //    faceY.Z *= inverse;\n\n        //    Vector3 clipCenter;\n        //    Vector3.Add(ref clipFace.V1, ref clipFace.V3, out clipCenter);\n        //    //Defer division until after dot product (2 multiplies instead of 3)\n        //    float clipCenterX, clipCenterY;\n        //    Vector3.Dot(ref clipCenter, ref clipX, out clipCenterX);\n        //    Vector3.Dot(ref clipCenter, ref clipY, out clipCenterY);\n        //    clipCenterX *= .5f;\n        //    clipCenterY *= .5f;\n\n        //    Vector3 faceCenter;\n        //    Vector3.Add(ref face.V1, ref face.V3, out faceCenter);\n        //    //Defer division until after dot product (2 multiplies instead of 3)\n        //    float faceCenterX, faceCenterY;\n        //    Vector3.Dot(ref faceCenter, ref faceX, out faceCenterX);\n        //    Vector3.Dot(ref faceCenter, ref faceY, out faceCenterY);\n        //    faceCenterX *= .5f;\n        //    faceCenterY *= .5f;\n\n        //    //To test bounds, recall that clipX is the length of the X edge.\n        //    //Going from the center to the max or min goes half of the length of X edge, or +/- 0.5.\n        //    //Bias could be added here.\n        //    float extent = .5f; //.5f is the default, extra could be added for robustness or speed.\n        //    float clipCenterMaxX = clipCenterX + extent;\n        //    float clipCenterMaxY = clipCenterY + extent;\n        //    float clipCenterMinX = clipCenterX - extent;\n        //    float clipCenterMinY = clipCenterY - extent;\n\n        //    float faceCenterMaxX = faceCenterX + extent;\n        //    float faceCenterMaxY = faceCenterY + extent;\n        //    float faceCenterMinX = faceCenterX - extent;\n        //    float faceCenterMinY = faceCenterY - extent;\n\n        //    //Find out where the opposing face is.\n        //    float dotX, dotY;\n\n        //    //The four edges can be thought of as minX, maxX, minY and maxY.\n\n        //    //Face v1\n        //    Vector3.Dot(ref clipX, ref face.V1, out dotX);\n        //    bool v1MaxXInside = dotX < clipCenterMaxX;\n        //    bool v1MinXInside = dotX > clipCenterMinX;\n        //    Vector3.Dot(ref clipY, ref face.V1, out dotY);\n        //    bool v1MaxYInside = dotY < clipCenterMaxY;\n        //    bool v1MinYInside = dotY > clipCenterMinY;\n\n        //    //Face v2\n        //    Vector3.Dot(ref clipX, ref face.V2, out dotX);\n        //    bool v2MaxXInside = dotX < clipCenterMaxX;\n        //    bool v2MinXInside = dotX > clipCenterMinX;\n        //    Vector3.Dot(ref clipY, ref face.V2, out dotY);\n        //    bool v2MaxYInside = dotY < clipCenterMaxY;\n        //    bool v2MinYInside = dotY > clipCenterMinY;\n\n        //    //Face v3\n        //    Vector3.Dot(ref clipX, ref face.V3, out dotX);\n        //    bool v3MaxXInside = dotX < clipCenterMaxX;\n        //    bool v3MinXInside = dotX > clipCenterMinX;\n        //    Vector3.Dot(ref clipY, ref face.V3, out dotY);\n        //    bool v3MaxYInside = dotY < clipCenterMaxY;\n        //    bool v3MinYInside = dotY > clipCenterMinY;\n\n        //    //Face v4\n        //    Vector3.Dot(ref clipX, ref face.V4, out dotX);\n        //    bool v4MaxXInside = dotX < clipCenterMaxX;\n        //    bool v4MinXInside = dotX > clipCenterMinX;\n        //    Vector3.Dot(ref clipY, ref face.V4, out dotY);\n        //    bool v4MaxYInside = dotY < clipCenterMaxY;\n        //    bool v4MinYInside = dotY > clipCenterMinY;\n\n        //    //Find out where the clip face is.\n        //    //Clip v1\n        //    Vector3.Dot(ref faceX, ref clipFace.V1, out dotX);\n        //    bool clipv1MaxXInside = dotX < faceCenterMaxX;\n        //    bool clipv1MinXInside = dotX > faceCenterMinX;\n        //    Vector3.Dot(ref faceY, ref clipFace.V1, out dotY);\n        //    bool clipv1MaxYInside = dotY < faceCenterMaxY;\n        //    bool clipv1MinYInside = dotY > faceCenterMinY;\n\n        //    //Clip v2\n        //    Vector3.Dot(ref faceX, ref clipFace.V2, out dotX);\n        //    bool clipv2MaxXInside = dotX < faceCenterMaxX;\n        //    bool clipv2MinXInside = dotX > faceCenterMinX;\n        //    Vector3.Dot(ref faceY, ref clipFace.V2, out dotY);\n        //    bool clipv2MaxYInside = dotY < faceCenterMaxY;\n        //    bool clipv2MinYInside = dotY > faceCenterMinY;\n\n        //    //Clip v3\n        //    Vector3.Dot(ref faceX, ref clipFace.V3, out dotX);\n        //    bool clipv3MaxXInside = dotX < faceCenterMaxX;\n        //    bool clipv3MinXInside = dotX > faceCenterMinX;\n        //    Vector3.Dot(ref faceY, ref clipFace.V3, out dotY);\n        //    bool clipv3MaxYInside = dotY < faceCenterMaxY;\n        //    bool clipv3MinYInside = dotY > faceCenterMinY;\n\n        //    //Clip v4\n        //    Vector3.Dot(ref faceX, ref clipFace.V4, out dotX);\n        //    bool clipv4MaxXInside = dotX < faceCenterMaxX;\n        //    bool clipv4MinXInside = dotX > faceCenterMinX;\n        //    Vector3.Dot(ref faceY, ref clipFace.V4, out dotY);\n        //    bool clipv4MaxYInside = dotY < faceCenterMaxY;\n        //    bool clipv4MinYInside = dotY > faceCenterMinY;\n\n        //    var item = new BoxContactData();\n\n        //    #region Face Vertices\n\n        //    if (v1MinXInside && v1MaxXInside && v1MinYInside && v1MaxYInside)\n        //    {\n        //        item.Position = face.V1;\n        //        item.Id = face.Id1;\n        //        contactData.Add(ref item);\n        //    }\n\n        //    if (v2MinXInside && v2MaxXInside && v2MinYInside && v2MaxYInside)\n        //    {\n        //        item.Position = face.V2;\n        //        item.Id = face.Id2;\n        //        contactData.Add(ref item);\n        //    }\n\n        //    if (v3MinXInside && v3MaxXInside && v3MinYInside && v3MaxYInside)\n        //    {\n        //        item.Position = face.V3;\n        //        item.Id = face.Id3;\n        //        contactData.Add(ref item);\n        //    }\n\n        //    if (v4MinXInside && v4MaxXInside && v4MinYInside && v4MaxYInside)\n        //    {\n        //        item.Position = face.V4;\n        //        item.Id = face.Id4;\n        //        contactData.Add(ref item);\n        //    }\n\n        //    #endregion\n\n        //    //Compute depths.\n        //    TinyStructList<BoxContactData> tempData = contactData;\n        //    contactData.Clear();\n        //    float clipFaceDot, faceDot;\n        //    Vector3.Dot(ref clipFace.V1, ref mtd, out clipFaceDot);\n        //    for (int i = 0; i < tempData.Count; i++)\n        //    {\n        //        tempData.Get(i, out item);\n        //        Vector3.Dot(ref item.Position, ref mtd, out faceDot);\n        //        item.Depth = faceDot - clipFaceDot;\n        //        if (item.Depth <= 0)\n        //        {\n        //            contactData.Add(ref item);\n        //        }\n        //    }\n\n        //    int previousCount = contactData.Count;\n        //    if (previousCount >= 4) //Early finish :)\n        //    {\n        //        return;\n        //    }\n\n        //    #region Clip face vertices\n\n        //    Vector3 faceNormal;\n        //    Vector3.Cross(ref faceY, ref faceX, out faceNormal);\n        //    //inverse = 1 / faceNormal.LengthSquared();\n        //    //faceNormal.X *= inverse;\n        //    //faceNormal.Y *= inverse;\n        //    //faceNormal.Z *= inverse;\n        //    faceNormal.Normalize();\n        //    Vector3 v;\n        //    float a, b;\n        //    Vector3.Dot(ref face.V1, ref faceNormal, out b);\n        //    //CLIP FACE\n        //    if (clipv1MinXInside && clipv1MaxXInside && clipv1MinYInside && clipv1MaxYInside)\n        //    {\n        //        Vector3.Dot(ref clipFace.V1, ref faceNormal, out a);\n        //        Vector3.Multiply(ref faceNormal, a - b, out v);\n        //        Vector3.Subtract(ref clipFace.V1, ref v, out v);\n        //        item.Position = v;\n        //        item.Id = clipFace.Id1 + 8;\n        //        contactData.Add(ref item);\n        //    }\n\n        //    if (clipv2MinXInside && clipv2MaxXInside && clipv2MinYInside && clipv2MaxYInside)\n        //    {\n        //        Vector3.Dot(ref clipFace.V2, ref faceNormal, out a);\n        //        Vector3.Multiply(ref faceNormal, a - b, out v);\n        //        Vector3.Subtract(ref clipFace.V2, ref v, out v);\n        //        item.Position = v;\n        //        item.Id = clipFace.Id2 + 8;\n        //        contactData.Add(ref item);\n        //    }\n\n        //    if (clipv3MinXInside && clipv3MaxXInside && clipv3MinYInside && clipv3MaxYInside)\n        //    {\n        //        Vector3.Dot(ref clipFace.V3, ref faceNormal, out a);\n        //        Vector3.Multiply(ref faceNormal, a - b, out v);\n        //        Vector3.Subtract(ref clipFace.V3, ref v, out v);\n        //        item.Position = v;\n        //        item.Id = clipFace.Id3 + 8;\n        //        contactData.Add(ref item);\n        //    }\n\n        //    if (clipv4MinXInside && clipv4MaxXInside && clipv4MinYInside && clipv4MaxYInside)\n        //    {\n        //        Vector3.Dot(ref clipFace.V4, ref faceNormal, out a);\n        //        Vector3.Multiply(ref faceNormal, a - b, out v);\n        //        Vector3.Subtract(ref clipFace.V4, ref v, out v);\n        //        item.Position = v;\n        //        item.Id = clipFace.Id4 + 8;\n        //        contactData.Add(ref item);\n        //    }\n\n        //    #endregion\n\n        //    //Compute depths.\n        //    int postClipCount = contactData.Count;\n        //    tempData = contactData;\n        //    for (int i = postClipCount - 1; i >= previousCount; i--) //TODO: >=?\n        //        contactData.RemoveAt(i);\n\n\n        //    for (int i = previousCount; i < tempData.Count; i++)\n        //    {\n        //        tempData.Get(i, out item);\n        //        Vector3.Dot(ref item.Position, ref mtd, out faceDot);\n        //        item.Depth = faceDot - clipFaceDot;\n        //        if (item.Depth <= 0)\n        //        {\n        //            contactData.Add(ref item);\n        //        }\n        //    }\n\n        //    previousCount = contactData.Count;\n        //    if (previousCount >= 4) //Early finish :)\n        //    {\n        //        return;\n        //    }\n\n        //    //Intersect edges.\n\n        //    //maxX maxY -> v1\n        //    //minX maxY -> v2\n        //    //minX minY -> v3\n        //    //maxX minY -> v4\n\n        //    //Once we get here there can only be 3 contacts or less.\n        //    //Once 4 possible contacts have been added, switch to using safe increments.\n        //    float dot;\n\n        //    #region CLIP EDGE: v1 v2\n\n        //    FaceEdge clipEdge;\n        //    clipFace.GetEdge(0, ref mtd, out clipEdge);\n        //    if (!v1MaxYInside)\n        //    {\n        //        if (v2MaxYInside)\n        //        {\n        //            ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v4MaxYInside)\n        //        {\n        //            ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v2MaxYInside)\n        //    {\n        //        if (v1MaxYInside)\n        //        {\n        //            ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v3MaxYInside)\n        //        {\n        //            ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v3MaxYInside)\n        //    {\n        //        if (v2MaxYInside)\n        //        {\n        //            ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v4MaxYInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v4MaxYInside)\n        //    {\n        //        if (v1MaxYInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v3MaxYInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n\n        //    #endregion\n\n        //    #region CLIP EDGE: v2 v3\n\n        //    clipFace.GetEdge(1, ref mtd, out clipEdge);\n        //    if (!v1MinXInside)\n        //    {\n        //        if (v2MinXInside && contactData.Count < 8)\n        //        {\n        //            //test v1-v2 against minXminY-minXmaxY\n        //            ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v4MinXInside && contactData.Count < 8)\n        //        {\n        //            //test v1-v3 against minXminY-minXmaxY\n        //            ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v2MinXInside)\n        //    {\n        //        if (v1MinXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v3MinXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v3MinXInside)\n        //    {\n        //        if (v2MinXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v4MinXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v4MinXInside)\n        //    {\n        //        if (v1MinXInside && contactData.Count < 8)\n        //        {\n        //            //test v2-v4 against minXminY-minXmaxY\n        //            ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v3MinXInside && contactData.Count < 8)\n        //        {\n        //            //test v3-v4 against minXminY-minXmaxY\n        //            ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n\n        //    #endregion\n\n        //    #region CLIP EDGE: v3 v4\n\n        //    clipFace.GetEdge(2, ref mtd, out clipEdge);\n        //    if (!v1MinYInside)\n        //    {\n        //        if (v2MinYInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v4MinYInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v2MinYInside)\n        //    {\n        //        if (v1MinYInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v3MinYInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v3MinYInside)\n        //    {\n        //        if (v2MinYInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v4MinYInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v4MinYInside)\n        //    {\n        //        if (v3MinYInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v1MinYInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipX, ref v, out dot);\n        //            if (dot > clipCenterMinX && dot < clipCenterMaxX)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n\n        //    #endregion\n\n        //    #region CLIP EDGE: v4 v1\n\n        //    clipFace.GetEdge(3, ref mtd, out clipEdge);\n        //    if (!v1MaxXInside)\n        //    {\n        //        if (v2MaxXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v4MaxXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v2MaxXInside)\n        //    {\n        //        if (v1MaxXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V1, ref face.V2, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id1, face.Id2, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v3MaxXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v3MaxXInside)\n        //    {\n        //        if (v2MaxXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V2, ref face.V3, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id2, face.Id3, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v4MaxXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n        //    if (!v4MaxXInside)\n        //    {\n        //        if (v1MaxXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V4, ref face.V1, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id4, face.Id1, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //        if (v3MaxXInside && contactData.Count < 8)\n        //        {\n        //            ComputeIntersection(ref face.V3, ref face.V4, ref clipEdge, out v);\n        //            Vector3.Dot(ref clipY, ref v, out dot);\n        //            if (dot > clipCenterMinY && dot < clipCenterMaxY)\n        //            {\n        //                item.Position = v;\n        //                item.Id = GetContactId(face.Id3, face.Id4, ref clipEdge);\n        //                contactData.Add(ref item);\n        //            }\n        //        }\n        //    }\n\n        //    #endregion\n\n        //    //Compute depths.\n        //    postClipCount = contactData.Count;\n        //    tempData = contactData;\n        //    for (int i = postClipCount - 1; i >= previousCount; i--)\n        //        contactData.RemoveAt(i);\n\n        //    for (int i = previousCount; i < tempData.Count; i++)\n        //    {\n        //        tempData.Get(i, out item);\n        //        Vector3.Dot(ref item.Position, ref mtd, out faceDot);\n        //        item.Depth = faceDot - clipFaceDot;\n        //        if (item.Depth <= 0)\n        //        {\n        //            contactData.Add(ref item);\n        //        }\n        //    }\n        //}\n#endif\n\n        private static bool ComputeIntersection(ref Vector3 edgeA1, ref Vector3 edgeA2, ref FaceEdge clippingEdge, out Vector3 intersection)\n        {\n            //Intersect the incoming edge (edgeA1, edgeA2) with the clipping edge's PLANE.  Nicely given by one of its positions and its 'perpendicular,'\n            //which is its normal.\n\n            Vector3 offset;\n            Vector3.Subtract(ref clippingEdge.A, ref edgeA1, out offset);\n\n            Vector3 edgeDirection;\n            Vector3.Subtract(ref edgeA2, ref edgeA1, out edgeDirection);\n            float distanceToPlane;\n            Vector3.Dot(ref offset, ref clippingEdge.Perpendicular, out distanceToPlane);\n            float edgeDirectionLength;\n            Vector3.Dot(ref edgeDirection, ref clippingEdge.Perpendicular, out edgeDirectionLength);\n            float t = distanceToPlane / edgeDirectionLength;\n            if (t < 0 || t > 1)\n            {\n                //It's outside of the incoming edge!\n                intersection = new Vector3();\n                return false;\n            }\n            Vector3.Multiply(ref edgeDirection, t, out offset);\n            Vector3.Add(ref offset, ref edgeA1, out intersection);\n\n            Vector3.Subtract(ref intersection, ref clippingEdge.A, out offset);\n            Vector3.Subtract(ref clippingEdge.B, ref clippingEdge.A, out edgeDirection);\n            Vector3.Dot(ref edgeDirection, ref offset, out t);\n            if (t < 0 || t > edgeDirection.LengthSquared())\n            {\n                //It's outside of the clipping edge!\n                return false;\n            }\n            return true;\n        }\n\n        private static void GetNearestFace(ref Vector3 position, ref Matrix3x3 orientation, ref Vector3 mtd, float halfWidth, float halfHeight, float halfLength, out BoxFace boxFace)\n        {\n            boxFace = new BoxFace();\n\n            float xDot = orientation.M11 * mtd.X +\n                         orientation.M12 * mtd.Y +\n                         orientation.M13 * mtd.Z;\n            float yDot = orientation.M21 * mtd.X +\n                         orientation.M22 * mtd.Y +\n                         orientation.M23 * mtd.Z;\n            float zDot = orientation.M31 * mtd.X +\n                         orientation.M32 * mtd.Y +\n                         orientation.M33 * mtd.Z;\n\n            float absX = Math.Abs(xDot);\n            float absY = Math.Abs(yDot);\n            float absZ = Math.Abs(zDot);\n\n            Matrix worldTransform;\n            Matrix3x3.ToMatrix4X4(ref orientation, out worldTransform);\n            worldTransform.M41 = position.X;\n            worldTransform.M42 = position.Y;\n            worldTransform.M43 = position.Z;\n            worldTransform.M44 = 1;\n\n            Vector3 candidate;\n            int bit;\n            if (absX > absY && absX > absZ)\n            {\n                //\"X\" faces are candidates\n                if (xDot < 0)\n                {\n                    halfWidth = -halfWidth;\n                    bit = 0;\n                }\n                else\n                    bit = 1;\n                candidate = new Vector3(halfWidth, halfHeight, halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V1 = candidate;\n                candidate = new Vector3(halfWidth, -halfHeight, halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V2 = candidate;\n                candidate = new Vector3(halfWidth, -halfHeight, -halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V3 = candidate;\n                candidate = new Vector3(halfWidth, halfHeight, -halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V4 = candidate;\n\n                if (xDot < 0)\n                    boxFace.Normal = orientation.Left;\n                else\n                    boxFace.Normal = orientation.Right;\n\n                boxFace.Width = halfHeight * 2;\n                boxFace.Height = halfLength * 2;\n\n                boxFace.Id1 = bit + 2 + 4;\n                boxFace.Id2 = bit + 4;\n                boxFace.Id3 = bit + 2;\n                boxFace.Id4 = bit;\n            }\n            else if (absY > absX && absY > absZ)\n            {\n                //\"Y\" faces are candidates\n                if (yDot < 0)\n                {\n                    halfHeight = -halfHeight;\n                    bit = 0;\n                }\n                else\n                    bit = 2;\n                candidate = new Vector3(halfWidth, halfHeight, halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V1 = candidate;\n                candidate = new Vector3(-halfWidth, halfHeight, halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V2 = candidate;\n                candidate = new Vector3(-halfWidth, halfHeight, -halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V3 = candidate;\n                candidate = new Vector3(halfWidth, halfHeight, -halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V4 = candidate;\n\n                if (yDot < 0)\n                    boxFace.Normal = orientation.Down;\n                else\n                    boxFace.Normal = orientation.Up;\n\n                boxFace.Width = halfWidth * 2;\n                boxFace.Height = halfLength * 2;\n\n                boxFace.Id1 = 1 + bit + 4;\n                boxFace.Id2 = bit + 4;\n                boxFace.Id3 = 1 + bit;\n                boxFace.Id4 = bit;\n            }\n            else if (absZ > absX && absZ > absY)\n            {\n                //\"Z\" faces are candidates\n                if (zDot < 0)\n                {\n                    halfLength = -halfLength;\n                    bit = 0;\n                }\n                else\n                    bit = 4;\n                candidate = new Vector3(halfWidth, halfHeight, halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V1 = candidate;\n                candidate = new Vector3(-halfWidth, halfHeight, halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V2 = candidate;\n                candidate = new Vector3(-halfWidth, -halfHeight, halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V3 = candidate;\n                candidate = new Vector3(halfWidth, -halfHeight, halfLength);\n                Vector3.Transform(ref candidate, ref worldTransform, out candidate);\n                boxFace.V4 = candidate;\n\n                if (zDot < 0)\n                    boxFace.Normal = orientation.Forward;\n                else\n                    boxFace.Normal = orientation.Backward;\n\n                boxFace.Width = halfWidth * 2;\n                boxFace.Height = halfHeight * 2;\n\n                boxFace.Id1 = 1 + 2 + bit;\n                boxFace.Id2 = 2 + bit;\n                boxFace.Id3 = 1 + bit;\n                boxFace.Id4 = bit;\n            }\n        }\n\n\n        private struct BoxFace\n        {\n            public int Id1, Id2, Id3, Id4;\n            public Vector3 V1, V2, V3, V4;\n            public Vector3 Normal;\n            public float Width, Height;\n\n            public int GetId(int i)\n            {\n                switch (i)\n                {\n                    case 0:\n                        return Id1;\n                    case 1:\n                        return Id2;\n                    case 2:\n                        return Id3;\n                    case 3:\n                        return Id4;\n                }\n                return -1;\n            }\n\n            public void GetVertex(int i, out Vector3 v)\n            {\n                switch (i)\n                {\n                    case 0:\n                        v = V1;\n                        return;\n                    case 1:\n                        v = V2;\n                        return;\n                    case 2:\n                        v = V3;\n                        return;\n                    case 3:\n                        v = V4;\n                        return;\n                }\n                v = Toolbox.NoVector;\n            }\n\n            internal void GetEdge(int i, out FaceEdge clippingEdge)\n            {\n                Vector3 insidePoint;\n                switch (i)\n                {\n                    case 0:\n                        clippingEdge.A = V1;\n                        clippingEdge.B = V2;\n                        insidePoint = V3;\n                        clippingEdge.Id = GetEdgeId(Id1, Id2);\n                        break;\n                    case 1:\n                        clippingEdge.A = V2;\n                        clippingEdge.B = V3;\n                        insidePoint = V4;\n                        clippingEdge.Id = GetEdgeId(Id2, Id3);\n                        break;\n                    case 2:\n                        clippingEdge.A = V3;\n                        clippingEdge.B = V4;\n                        insidePoint = V1;\n                        clippingEdge.Id = GetEdgeId(Id3, Id4);\n                        break;\n                    case 3:\n                        clippingEdge.A = V4;\n                        clippingEdge.B = V1;\n                        insidePoint = V2;\n                        clippingEdge.Id = GetEdgeId(Id4, Id1);\n                        break;\n                    default:\n                        throw new IndexOutOfRangeException();\n                }\n                //TODO: Edge direction and perpendicular not normalized.\n                Vector3 edgeDirection;\n                Vector3.Subtract(ref clippingEdge.B, ref clippingEdge.A, out edgeDirection);\n                edgeDirection.Normalize();\n                Vector3.Cross(ref edgeDirection, ref Normal, out clippingEdge.Perpendicular);\n\n                float dot;\n                Vector3 offset;\n                Vector3.Subtract(ref insidePoint, ref clippingEdge.A, out offset);\n                Vector3.Dot(ref clippingEdge.Perpendicular, ref offset, out dot);\n                if (dot > 0)\n                {\n                    clippingEdge.Perpendicular.X = -clippingEdge.Perpendicular.X;\n                    clippingEdge.Perpendicular.Y = -clippingEdge.Perpendicular.Y;\n                    clippingEdge.Perpendicular.Z = -clippingEdge.Perpendicular.Z;\n                }\n                Vector3.Dot(ref clippingEdge.A, ref clippingEdge.Perpendicular, out clippingEdge.EdgeDistance);\n            }\n        }\n\n        private static int GetContactId(int vertexAEdgeA, int vertexBEdgeA, int vertexAEdgeB, int vertexBEdgeB)\n        {\n            return GetEdgeId(vertexAEdgeA, vertexBEdgeA) * 2549 + GetEdgeId(vertexAEdgeB, vertexBEdgeB) * 2857;\n        }\n\n        private static int GetContactId(int vertexAEdgeA, int vertexBEdgeA, ref FaceEdge clippingEdge)\n        {\n            return GetEdgeId(vertexAEdgeA, vertexBEdgeA) * 2549 + clippingEdge.Id * 2857;\n        }\n\n        private static int GetEdgeId(int id1, int id2)\n        {\n            return (id1 + 1) * 571 + (id2 + 1) * 577;\n        }\n\n        private struct FaceEdge : IEquatable<FaceEdge>\n        {\n            public Vector3 A, B;\n            public float EdgeDistance;\n            public int Id;\n            public Vector3 Perpendicular;\n\n            #region IEquatable<FaceEdge> Members\n\n            public bool Equals(FaceEdge other)\n            {\n                return other.Id == Id;\n            }\n\n            #endregion\n\n            public bool IsPointInside(ref Vector3 point)\n            {\n                float distance;\n                Vector3.Dot(ref point, ref Perpendicular, out distance);\n                return distance < EdgeDistance; // +1; //TODO: Bias this a little?\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/BoxSphereTester.cs",
    "content": "﻿using System;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Settings;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms\n{\n    ///<summary>\n    /// Static class with methods to help with testing box shapes against sphere shapes.\n    ///</summary>\n    public static class BoxSphereTester\n    {\n        ///<summary>\n        /// Tests if a box and sphere are colliding.\n        ///</summary>\n        ///<param name=\"box\">Box to test.</param>\n        ///<param name=\"sphere\">Sphere to test.</param>\n        ///<param name=\"boxTransform\">Transform to apply to the box.</param>\n        ///<param name=\"spherePosition\">Transform to apply to the sphere.</param>\n        ///<param name=\"contact\">Contact point between the shapes, if any.</param>\n        ///<returns>Whether or not the shapes were colliding.</returns>\n        public static bool AreShapesColliding(BoxShape box, SphereShape sphere, ref RigidTransform boxTransform, ref Vector3 spherePosition, out ContactData contact)\n        {\n            contact = new ContactData();\n\n            Vector3 localPosition;\n            RigidTransform.TransformByInverse(ref spherePosition, ref boxTransform, out localPosition);\n#if !WINDOWS\n            Vector3 localClosestPoint = new Vector3();\n#else\n            Vector3 localClosestPoint;\n#endif\n            localClosestPoint.X = MathHelper.Clamp(localPosition.X, -box.halfWidth, box.halfWidth);\n            localClosestPoint.Y = MathHelper.Clamp(localPosition.Y, -box.halfHeight, box.halfHeight);\n            localClosestPoint.Z = MathHelper.Clamp(localPosition.Z, -box.halfLength, box.halfLength);\n\n            RigidTransform.Transform(ref localClosestPoint, ref boxTransform, out contact.Position);\n\n            Vector3 offset;\n            Vector3.Subtract(ref spherePosition, ref contact.Position, out offset);\n            float offsetLength = offset.LengthSquared();\n\n            if (offsetLength > (sphere.collisionMargin + CollisionDetectionSettings.maximumContactDistance) * (sphere.collisionMargin + CollisionDetectionSettings.maximumContactDistance))\n            {\n                return false;\n            }\n\n            //Colliding.\n            if (offsetLength > Toolbox.Epsilon)\n            {\n                offsetLength = (float)Math.Sqrt(offsetLength);\n                //Outside of the box.\n                Vector3.Divide(ref offset, offsetLength, out contact.Normal);\n                contact.PenetrationDepth = sphere.collisionMargin - offsetLength;\n            }\n            else\n            {\n                //Inside of the box.\n                Vector3 penetrationDepths;\n                penetrationDepths.X = localClosestPoint.X < 0 ? localClosestPoint.X + box.halfWidth : box.halfWidth - localClosestPoint.X;\n                penetrationDepths.Y = localClosestPoint.Y < 0 ? localClosestPoint.Y + box.halfHeight : box.halfHeight - localClosestPoint.Y;\n                penetrationDepths.Z = localClosestPoint.Z < 0 ? localClosestPoint.Z + box.halfLength : box.halfLength - localClosestPoint.Z;\n                if (penetrationDepths.X < penetrationDepths.Y && penetrationDepths.X < penetrationDepths.Z)\n                {\n                    contact.Normal = localClosestPoint.X > 0 ? Toolbox.RightVector : Toolbox.LeftVector; \n                    contact.PenetrationDepth = penetrationDepths.X;\n                }\n                else if (penetrationDepths.Y < penetrationDepths.Z)\n                {\n                    contact.Normal = localClosestPoint.Y > 0 ? Toolbox.UpVector : Toolbox.DownVector; \n                    contact.PenetrationDepth = penetrationDepths.Y;\n                }\n                else\n                {\n                    contact.Normal = localClosestPoint.Z > 0 ? Toolbox.BackVector : Toolbox.ForwardVector; \n                    contact.PenetrationDepth = penetrationDepths.X;\n                }\n                contact.PenetrationDepth += sphere.collisionMargin;\n                Vector3.Transform(ref contact.Normal, ref boxTransform.Orientation, out contact.Normal);\n            }\n\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/GJK/GJKToolbox.cs",
    "content": "﻿using BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Settings;\nusing RigidTransform = BEPUutilities.RigidTransform;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms.GJK\n{\n    ///<summary>\n    /// Helper class containing various tests based on GJK.\n    ///</summary>\n    public static class GJKToolbox\n    {\n        /// <summary>\n        /// Maximum number of iterations the GJK algorithm will do.  If the iterations exceed this number, the system will immediately quit and return whatever information it has at the time.\n        /// </summary>\n        public static int MaximumGJKIterations = 15;\n        /// <summary>\n        /// Defines how many iterations are required to consider a GJK attempt to be 'probably stuck' and proceed with protective measures.\n        /// </summary>\n        public static int HighGJKIterations = 8;\n\n        ///<summary>\n        /// Tests if the pair is intersecting.\n        ///</summary>\n        ///<param name=\"shapeA\">First shape of the pair.</param>\n        ///<param name=\"shapeB\">Second shape of the pair.</param>\n        ///<param name=\"transformA\">Transform to apply to the first shape.</param>\n        ///<param name=\"transformB\">Transform to apply to the second shape.</param>\n        ///<returns>Whether or not the shapes are intersecting.</returns>\n        public static bool AreShapesIntersecting(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform transformA, ref RigidTransform transformB)\n        {\n            //Zero isn't a very good guess!  But it's a cheap guess.\n            Vector3 separatingAxis = Toolbox.ZeroVector;\n            return AreShapesIntersecting(shapeA, shapeB, ref transformA, ref transformB, ref separatingAxis);\n        }\n\n        ///<summary>\n        /// Tests if the pair is intersecting.\n        ///</summary>\n        ///<param name=\"shapeA\">First shape of the pair.</param>\n        ///<param name=\"shapeB\">Second shape of the pair.</param>\n        ///<param name=\"transformA\">Transform to apply to the first shape.</param>\n        ///<param name=\"transformB\">Transform to apply to the second shape.</param>\n        ///<param name=\"localSeparatingAxis\">Warmstartable separating axis used by the method to quickly early-out if possible.  Updated to the latest separating axis after each run.</param>\n        ///<returns>Whether or not the objects were intersecting.</returns>\n        public static bool AreShapesIntersecting(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform transformA, ref RigidTransform transformB,\n                                                 ref Vector3 localSeparatingAxis)\n        {\n            RigidTransform localtransformB;\n            MinkowskiToolbox.GetLocalTransform(ref transformA, ref transformB, out localtransformB);\n\n            //Warm start the simplex.\n            var simplex = new SimpleSimplex();\n            Vector3 extremePoint;\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref localSeparatingAxis, ref localtransformB, out extremePoint);\n            simplex.AddNewSimplexPoint(ref extremePoint);\n\n            Vector3 closestPoint;\n            int count = 0;\n            while (count++ < MaximumGJKIterations)\n            {\n                if (simplex.GetPointClosestToOrigin(out closestPoint) || //Also reduces the simplex.\n                    closestPoint.LengthSquared() <= simplex.GetErrorTolerance() * Toolbox.BigEpsilon)\n                {\n                    //Intersecting, or so close to it that it will be difficult/expensive to figure out the separation.\n                    return true;\n                }\n\n                //Use the closest point as a direction.\n                Vector3 direction;\n                Vector3.Negate(ref closestPoint, out direction);\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref direction, ref localtransformB, out extremePoint);\n                //Since this is a boolean test, we don't need to refine the simplex if it becomes apparent that we cannot reach the origin.\n                //If the most extreme point at any given time does not go past the origin, then we can quit immediately.\n                float dot;\n                Vector3.Dot(ref extremePoint, ref closestPoint, out dot); //extreme point dotted against the direction pointing backwards towards the CSO. \n                if (dot > 0)\n                {\n                    // If it's positive, that means that the direction pointing towards the origin produced an extreme point 'in front of' the origin, eliminating the possibility of any intersection.\n                    localSeparatingAxis = direction;\n                    return false;\n                }\n\n                simplex.AddNewSimplexPoint(ref extremePoint);\n\n\n            }\n            return false;\n        }\n\n        ///<summary>\n        /// Gets the closest points between the shapes.\n        ///</summary>\n        ///<param name=\"shapeA\">First shape of the pair.</param>\n        ///<param name=\"shapeB\">Second shape of the pair.</param>\n        ///<param name=\"transformA\">Transform to apply to the first shape.</param>\n        ///<param name=\"transformB\">Transform to apply to the second shape.</param>\n        ///<param name=\"closestPointA\">Closest point on the first shape to the second shape.</param>\n        ///<param name=\"closestPointB\">Closest point on the second shape to the first shape.</param>\n        ///<returns>Whether or not the objects were intersecting.  If they are intersecting, then the closest points cannot be identified.</returns>\n        public static bool GetClosestPoints(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform transformA, ref RigidTransform transformB,\n                                            out Vector3 closestPointA, out Vector3 closestPointB)\n        {\n            //The cached simplex stores locations that are local to the shapes.  A fairly decent initial state is between the centroids of the objects.\n            //In local space, the centroids are at the origins.\n\n            RigidTransform localtransformB;\n            MinkowskiToolbox.GetLocalTransform(ref transformA, ref transformB, out localtransformB);\n\n            var simplex = new CachedSimplex {State = SimplexState.Point};\n                // new CachedSimplex(shapeA, shapeB, ref localtransformB);\n            bool toReturn = GetClosestPoints(shapeA, shapeB, ref localtransformB, ref simplex, out closestPointA, out closestPointB);\n\n            RigidTransform.Transform(ref closestPointA, ref transformA, out closestPointA);\n            RigidTransform.Transform(ref closestPointB, ref transformA, out closestPointB);\n            return toReturn;\n        }\n\n        ///<summary>\n        /// Gets the closest points between the shapes.\n        ///</summary>\n        ///<param name=\"shapeA\">First shape of the pair.</param>\n        ///<param name=\"shapeB\">Second shape of the pair.</param>\n        ///<param name=\"transformA\">Transform to apply to the first shape.</param>\n        ///<param name=\"transformB\">Transform to apply to the second shape.</param>\n        /// <param name=\"cachedSimplex\">Simplex from a previous updated used to warmstart the current attempt.  Updated after each run.</param>\n        ///<param name=\"closestPointA\">Closest point on the first shape to the second shape.</param>\n        ///<param name=\"closestPointB\">Closest point on the second shape to the first shape.</param>\n        ///<returns>Whether or not the objects were intersecting.  If they are intersecting, then the closest points cannot be identified.</returns>\n        public static bool GetClosestPoints(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform transformA, ref RigidTransform transformB,\n                                            ref CachedSimplex cachedSimplex, out Vector3 closestPointA, out Vector3 closestPointB)\n        {\n            RigidTransform localtransformB;\n            MinkowskiToolbox.GetLocalTransform(ref transformA, ref transformB, out localtransformB);\n\n            bool toReturn = GetClosestPoints(shapeA, shapeB, ref localtransformB, ref cachedSimplex, out closestPointA, out closestPointB);\n\n            RigidTransform.Transform(ref closestPointA, ref transformA, out closestPointA);\n            RigidTransform.Transform(ref closestPointB, ref transformA, out closestPointB);\n            return toReturn;\n        }\n\n        private static bool GetClosestPoints(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform localTransformB,\n                                             ref CachedSimplex cachedSimplex, out Vector3 localClosestPointA, out Vector3 localClosestPointB)\n        {\n\n            var simplex = new PairSimplex(ref cachedSimplex, ref localTransformB);\n\n            Vector3 closestPoint;\n            int count = 0;\n            while (true)\n            {\n                if (simplex.GetPointClosestToOrigin(out closestPoint) || //Also reduces the simplex and computes barycentric coordinates if necessary. \n                    closestPoint.LengthSquared() <= Toolbox.Epsilon * simplex.errorTolerance)\n                {\n                    //Intersecting.\n                    localClosestPointA = Toolbox.ZeroVector;\n                    localClosestPointB = Toolbox.ZeroVector;\n\n                    simplex.UpdateCachedSimplex(ref cachedSimplex);\n                    return true;\n                }\n\n                if (++count > MaximumGJKIterations)\n                    break; //Must break BEFORE a new vertex is added if we're over the iteration limit.  This guarantees final simplex is not a tetrahedron.\n\n                if (simplex.GetNewSimplexPoint(shapeA, shapeB, count, ref closestPoint))\n                {\n                    //No progress towards origin, not intersecting.\n                    break;\n                }\n\n            }\n            //Compute closest points from the contributing simplexes and barycentric coordinates\n            simplex.GetClosestPoints(out localClosestPointA, out localClosestPointB);\n            //simplex.VerifyContributions();\n            //if (Vector3.Distance(localClosestPointA - localClosestPointB, closestPoint) > .00001f)\n            //    Debug.WriteLine(\"break.\");\n            simplex.UpdateCachedSimplex(ref cachedSimplex);\n            return false;\n        }\n\n        //TODO: Consider changing the termination epsilons on these casts.  Epsilon * Modifier is okay, but there might be better options.\n\n        ///<summary>\n        /// Tests a ray against a convex shape.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the shape.</param>\n        ///<param name=\"shape\">Shape to test.</param>\n        ///<param name=\"shapeTransform\">Transform to apply to the shape for the test.</param>\n        ///<param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        ///<param name=\"hit\">Hit data of the ray cast, if any.</param>\n        ///<returns>Whether or not the ray hit the shape.</returns>\n        public static bool RayCast(Ray ray, ConvexShape shape, ref RigidTransform shapeTransform, float maximumLength,\n                                   out RayHit hit)\n        {\n            //Transform the ray into the object's local space.\n            Vector3.Subtract(ref ray.Position, ref shapeTransform.Position, out ray.Position);\n            Quaternion conjugate;\n            Quaternion.Conjugate(ref shapeTransform.Orientation, out conjugate);\n            Vector3.Transform(ref ray.Position, ref conjugate, out ray.Position);\n            Vector3.Transform(ref ray.Direction, ref conjugate, out ray.Direction);\n\n            Vector3 extremePointToRayOrigin, extremePoint;\n            hit.T = 0;\n            hit.Location = ray.Position;\n            hit.Normal = Toolbox.ZeroVector;\n            Vector3 closestOffset = hit.Location;\n\n            RaySimplex simplex = new RaySimplex();\n\n            float vw, closestPointDotDirection;\n            int count = 0;\n            //This epsilon has a significant impact on performance and accuracy.  Changing it to use BigEpsilon instead increases speed by around 30-40% usually, but jigging is more evident.\n            while (closestOffset.LengthSquared() >= Toolbox.Epsilon * simplex.GetErrorTolerance(ref ray.Position))\n            {\n                if (++count > MaximumGJKIterations)\n                {\n                    //It's taken too long to find a hit.  Numerical problems are probable; quit.\n                    hit = new RayHit();\n                    return false;\n                }\n\n                shape.GetLocalExtremePoint(closestOffset, out extremePoint);\n\n                Vector3.Subtract(ref hit.Location, ref extremePoint, out extremePointToRayOrigin);\n                Vector3.Dot(ref closestOffset, ref extremePointToRayOrigin, out vw);\n                //If the closest offset and the extreme point->ray origin direction point the same way,\n                //then we might be able to conservatively advance the point towards the surface.\n                if (vw > 0)\n                {\n                    \n                    Vector3.Dot(ref closestOffset, ref ray.Direction, out closestPointDotDirection);\n                    if (closestPointDotDirection >= 0)\n                    {\n                        hit = new RayHit();\n                        return false;\n                    }\n                    hit.T = hit.T - vw / closestPointDotDirection;\n                    if (hit.T > maximumLength)\n                    {\n                        //If we've gone beyond where the ray can reach, there's obviously no hit.\n                        hit = new RayHit();\n                        return false;\n                    }\n                    //Shift the ray up.\n                    Vector3.Multiply(ref ray.Direction, hit.T, out hit.Location);\n                    Vector3.Add(ref hit.Location, ref ray.Position, out hit.Location);\n                    hit.Normal = closestOffset;\n                }\n\n                RaySimplex shiftedSimplex;\n                simplex.AddNewSimplexPoint(ref extremePoint, ref hit.Location, out shiftedSimplex);\n\n                //Compute the offset from the simplex surface to the origin.\n                shiftedSimplex.GetPointClosestToOrigin(ref simplex, out closestOffset);\n\n            }\n            //Transform the hit data into world space.\n            Vector3.Transform(ref hit.Normal, ref shapeTransform.Orientation, out hit.Normal);\n            Vector3.Transform(ref hit.Location, ref shapeTransform.Orientation, out hit.Location);\n            Vector3.Add(ref hit.Location, ref shapeTransform.Position, out hit.Location);\n\n            return true;\n        }\n\n        ///<summary>\n        /// Sweeps a shape against another shape using a given sweep vector.\n        ///</summary>\n        ///<param name=\"sweptShape\">Shape to sweep.</param>\n        ///<param name=\"target\">Shape being swept against.</param>\n        ///<param name=\"sweep\">Sweep vector for the sweptShape.</param>\n        ///<param name=\"startingSweptTransform\">Starting transform of the sweptShape.</param>\n        ///<param name=\"targetTransform\">Transform to apply to the target shape.</param>\n        ///<param name=\"hit\">Hit data of the sweep test, if any.</param>\n        ///<returns>Whether or not the swept shape hit the other shape.</returns>\n        public static bool ConvexCast(ConvexShape sweptShape, ConvexShape target, ref Vector3 sweep, ref RigidTransform startingSweptTransform, ref RigidTransform targetTransform,\n                                  out RayHit hit)\n        {\n            return ConvexCast(sweptShape, target, ref sweep, ref Toolbox.ZeroVector, ref startingSweptTransform, ref targetTransform, out hit);\n        }\n\n        ///<summary>\n        /// Sweeps two shapes against another.\n        ///</summary>\n        ///<param name=\"shapeA\">First shape being swept.</param>\n        ///<param name=\"shapeB\">Second shape being swept.</param>\n        ///<param name=\"sweepA\">Sweep vector for the first shape.</param>\n        ///<param name=\"sweepB\">Sweep vector for the second shape.</param>\n        ///<param name=\"transformA\">Transform to apply to the first shape.</param>\n        ///<param name=\"transformB\">Transform to apply to the second shape.</param>\n        ///<param name=\"hit\">Hit data of the sweep test, if any.</param>\n        ///<returns>Whether or not the swept shapes hit each other..</returns>\n        public static bool ConvexCast(ConvexShape shapeA, ConvexShape shapeB, ref Vector3 sweepA, ref Vector3 sweepB, ref RigidTransform transformA, ref RigidTransform transformB,\n                                  out RayHit hit)\n        {\n            //Put the velocity into shapeA's local space.\n            Vector3 velocityWorld;\n            Vector3.Subtract(ref sweepB, ref sweepA, out velocityWorld);\n            Quaternion conjugateOrientationA;\n            Quaternion.Conjugate(ref transformA.Orientation, out conjugateOrientationA);\n            Vector3 rayDirection;\n            Vector3.Transform(ref velocityWorld, ref conjugateOrientationA, out rayDirection);\n            //Transform b into a's local space.\n            RigidTransform localTransformB;\n            Quaternion.Concatenate(ref transformB.Orientation, ref conjugateOrientationA, out localTransformB.Orientation);\n            Vector3.Subtract(ref transformB.Position, ref transformA.Position, out localTransformB.Position);\n            Vector3.Transform(ref localTransformB.Position, ref conjugateOrientationA, out localTransformB.Position);\n            \n\n            Vector3 w, p;\n            hit.T = 0;\n            hit.Location = Vector3.Zero; //The ray starts at the origin.\n            hit.Normal = Toolbox.ZeroVector;\n            Vector3 v = hit.Location;\n\n            RaySimplex simplex = new RaySimplex();\n\n \n            float vw, vdir;\n            int count = 0;\n            do\n            {\n                \n\n                if (++count > MaximumGJKIterations)\n                {\n                    //It's taken too long to find a hit.  Numerical problems are probable; quit.\n                    hit = new RayHit();\n                    return false;\n                }\n\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref v, ref localTransformB, out p);\n\n                Vector3.Subtract(ref hit.Location, ref p, out w);\n                Vector3.Dot(ref v, ref w, out vw);\n                if (vw > 0)\n                {\n                    Vector3.Dot(ref v, ref rayDirection, out vdir);\n                    if (vdir >= 0)\n                    {\n                        hit = new RayHit();\n                        return false;\n                    }\n                    hit.T = hit.T - vw / vdir;\n                    if (hit.T > 1)\n                    {\n                        //If we've gone beyond where the ray can reach, there's obviously no hit.\n                        hit = new RayHit();\n                        return false;\n                    }\n                    //Shift the ray up.\n                    Vector3.Multiply(ref rayDirection, hit.T, out hit.Location);\n                    //The ray origin is the origin!  Don't need to add any ray position.\n                    hit.Normal = v;\n                }\n\n                RaySimplex shiftedSimplex;\n                simplex.AddNewSimplexPoint(ref p, ref hit.Location, out shiftedSimplex);\n\n                shiftedSimplex.GetPointClosestToOrigin(ref simplex, out v);\n\n                //Could measure the progress of the ray.  If it's too little, could early out.\n                //Not used by default since it's biased towards precision over performance.\n\n            } while (v.LengthSquared() >= Toolbox.Epsilon * simplex.GetErrorTolerance(ref Toolbox.ZeroVector));\n            //This epsilon has a significant impact on performance and accuracy.  Changing it to use BigEpsilon instead increases speed by around 30-40% usually, but jigging is more evident.\n            //Transform the hit data into world space.\n            Vector3.Transform(ref hit.Normal, ref transformA.Orientation, out hit.Normal);\n            Vector3.Multiply(ref velocityWorld, hit.T, out hit.Location);\n            Vector3.Add(ref hit.Location, ref transformA.Position, out hit.Location);\n            return true;\n        }\n\n\n        ///<summary>\n        /// Casts a fat (sphere expanded) ray against the shape.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the shape.</param>\n        ///<param name=\"radius\">Radius of the ray.</param>\n        ///<param name=\"shape\">Shape to test against.</param>\n        ///<param name=\"shapeTransform\">Transform to apply to the shape for the test.</param>\n        ///<param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        ///<param name=\"hit\">Hit data of the sphere cast, if any.</param>\n        ///<returns>Whether or not the sphere cast hit the shape.</returns>\n        public static bool SphereCast(Ray ray, float radius, ConvexShape shape, ref RigidTransform shapeTransform, float maximumLength,\n                                   out RayHit hit)\n        {\n            //Transform the ray into the object's local space.\n            Vector3.Subtract(ref ray.Position, ref shapeTransform.Position, out ray.Position);\n            Quaternion conjugate;\n            Quaternion.Conjugate(ref shapeTransform.Orientation, out conjugate);\n            Vector3.Transform(ref ray.Position, ref conjugate, out ray.Position);\n            Vector3.Transform(ref ray.Direction, ref conjugate, out ray.Direction);\n\n            Vector3 w, p;\n            hit.T = 0;\n            hit.Location = ray.Position;\n            hit.Normal = Toolbox.ZeroVector;\n            Vector3 v = hit.Location;\n\n            RaySimplex simplex = new RaySimplex();\n\n            float vw, vdir;\n            int count = 0;\n\n            //This epsilon has a significant impact on performance and accuracy.  Changing it to use BigEpsilon instead increases speed by around 30-40% usually, but jigging is more evident.\n            while (v.LengthSquared() >= Toolbox.Epsilon * simplex.GetErrorTolerance(ref ray.Position))\n            {\n                if (++count > MaximumGJKIterations)\n                {\n                    //It's taken too long to find a hit.  Numerical problems are probable; quit.\n                    hit = new RayHit();\n                    return false;\n                }\n\n                shape.GetLocalExtremePointWithoutMargin(ref v, out p);\n                Vector3 contribution;\n                MinkowskiToolbox.ExpandMinkowskiSum(shape.collisionMargin, radius, ref v, out contribution);\n                Vector3.Add(ref p, ref contribution, out p);\n\n                Vector3.Subtract(ref hit.Location, ref p, out w);\n                Vector3.Dot(ref v, ref w, out vw);\n                if (vw > 0)\n                {\n                    Vector3.Dot(ref v, ref ray.Direction, out vdir);\n                    hit.T = hit.T - vw / vdir;\n                    if (vdir >= 0)\n                    {\n                        //We would have to back up!\n                        return false;\n                    }\n                    if (hit.T > maximumLength)\n                    {\n                        //If we've gone beyond where the ray can reach, there's obviously no hit.\n                        return false;\n                    }\n                    //Shift the ray up.\n                    Vector3.Multiply(ref ray.Direction, hit.T, out hit.Location);\n                    Vector3.Add(ref hit.Location, ref ray.Position, out hit.Location);\n                    hit.Normal = v;\n                }\n\n                RaySimplex shiftedSimplex;\n                simplex.AddNewSimplexPoint(ref p, ref hit.Location, out shiftedSimplex);\n\n                shiftedSimplex.GetPointClosestToOrigin(ref simplex, out v);\n\n            }\n            //Transform the hit data into world space.\n            Vector3.Transform(ref hit.Normal, ref shapeTransform.Orientation, out hit.Normal);\n            Vector3.Transform(ref hit.Location, ref shapeTransform.Orientation, out hit.Location);\n            Vector3.Add(ref hit.Location, ref shapeTransform.Position, out hit.Location);\n\n            return true;\n        }\n\n        ///<summary>\n        /// Casts a fat (sphere expanded) ray against the shape.  If the raycast appears to be stuck in the shape, the cast will be attempted\n        /// with a smaller ray (scaled by the MotionSettings.CoreShapeScaling each time).\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the shape.</param>\n        ///<param name=\"radius\">Radius of the ray.</param>\n        ///<param name=\"target\">Shape to test against.</param>\n        ///<param name=\"shapeTransform\">Transform to apply to the shape for the test.</param>\n        ///<param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        ///<param name=\"hit\">Hit data of the sphere cast, if any.</param>\n        ///<returns>Whether or not the sphere cast hit the shape.</returns>\n        public static bool CCDSphereCast(Ray ray, float radius, ConvexShape target, ref RigidTransform shapeTransform, float maximumLength,\n                                   out RayHit hit)\n        {\n            int iterations = 0;\n            while (true)\n            {\n                if (GJKToolbox.SphereCast(ray, radius, target, ref shapeTransform, maximumLength, out hit) &&\n                    hit.T > 0)\n                {\n                    //The ray cast isn't embedded in the shape, and it's less than maximum length away!\n                    return true;\n                }\n                if (hit.T > maximumLength || hit.T < 0)\n                    return false; //Failure showed it was too far, or behind.\n\n                radius *= MotionSettings.CoreShapeScaling;\n                iterations++;\n                if (iterations > 3) //Limit could be configurable.\n                {\n                    //It's iterated too much, let's just do a last ditch attempt using a raycast and hope that can help.\n                    return GJKToolbox.RayCast(ray, target, ref shapeTransform, maximumLength, out hit) && hit.T > 0;\n                        \n                }\n            }\n        }\n    }\n\n\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/GJK/PairSimplex.cs",
    "content": "﻿using BEPUphysics.CollisionShapes.ConvexShapes;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\nusing System.Diagnostics;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms.GJK\n{\n    \n    ///<summary>\n    /// Defines the state of a simplex.\n    ///</summary>\n    public enum SimplexState : byte\n    {\n        Empty,\n        Point,\n        Segment,\n        Triangle,\n        Tetrahedron\n    }\n\n    ///<summary>\n    /// Stored simplex used to warmstart closest point GJK runs.\n    ///</summary>\n    public struct CachedSimplex\n    {\n        //public CachedSimplex(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform transformA, ref RigidTransform transformB)\n        //{\n        //    RigidTransform localTransformB;\n        //    MinkowskiToolbox.GetLocalTransform(ref transformA, ref transformB, out localTransformB);\n        //    LocalSimplexA = new ContributingShapeSimplex();\n        //    LocalSimplexB = new ContributingShapeSimplex();\n\n        //    State = SimplexState.Point;\n        //    return;\n        //    shapeA.GetLocalExtremePointWithoutMargin(ref localTransformB.Position, out LocalSimplexA.A);\n        //    Vector3 direction;\n        //    Vector3.Negate(ref localTransformB.Position, out direction);\n        //    Quaternion conjugate;\n        //    Quaternion.Conjugate(ref localTransformB.Orientation, out conjugate);\n        //    Vector3.Transform(ref direction, ref conjugate, out direction);\n        //    shapeB.GetLocalExtremePointWithoutMargin(ref direction, out LocalSimplexB.A);\n        //}\n\n        //public CachedSimplex(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform localTransformB)\n        //{\n        //    LocalSimplexA = new ContributingShapeSimplex();\n        //    LocalSimplexB = new ContributingShapeSimplex();\n\n        //    State = SimplexState.Point;\n        //    return;\n        //    shapeA.GetLocalExtremePointWithoutMargin(ref localTransformB.Position, out LocalSimplexA.A);\n        //    Vector3 direction;\n        //    Vector3.Negate(ref localTransformB.Position, out direction);\n        //    Quaternion conjugate;\n        //    Quaternion.Conjugate(ref localTransformB.Orientation, out conjugate);\n        //    Vector3.Transform(ref direction, ref conjugate, out direction);\n        //    shapeB.GetLocalExtremePointWithoutMargin(ref direction, out LocalSimplexB.A);\n        //}\n\n\n        ///<summary>\n        /// Simplex in the local space of shape A.\n        ///</summary>\n        public ContributingShapeSimplex LocalSimplexA;\n\n        ///<summary>\n        /// Simplex in the local space of shape B.\n        ///</summary>\n        public ContributingShapeSimplex LocalSimplexB;\n        \n        /// <summary>\n        /// State of the simplex at the termination of the last GJK run.\n        /// </summary>\n        public SimplexState State;\n    }\n\n    ///<summary>\n    /// List of points composing a shape's contributions to a simplex.\n    ///</summary>\n    public struct ContributingShapeSimplex\n    {\n        public Vector3 A;\n        public Vector3 B;\n        public Vector3 C;\n        public Vector3 D;\n    }\n\n    ///<summary>\n    /// GJK simplex used to support closest point tests with warmstarting.\n    ///</summary>\n    public struct PairSimplex\n    {\n        ///<summary>\n        /// The baseline amount that a GJK iteration must progress through to avoid exiting.\n        /// Defaults to 1e-8f.\n        ///</summary>\n        public static float ProgressionEpsilon = 1e-8f;\n        /// <summary>\n        /// The baseline amount that an iteration must converge with its distance to avoid exiting.\n        /// Defaults to 1e-7f.\n        /// </summary>\n        public static float DistanceConvergenceEpsilon = 1e-7f;\n\n        ///<summary>\n        /// Simplex as viewed from the local space of A.\n        ///</summary>\n        public ContributingShapeSimplex SimplexA;\n\n        ///<summary>\n        /// Simplex as viewed from the local space of B.\n        ///</summary>\n        public ContributingShapeSimplex SimplexB;\n\n        public Vector3 A;\n        public Vector3 B;\n        public Vector3 C;\n        public Vector3 D;\n        public SimplexState State;\n        /// <summary>\n        /// Weight of vertex A.\n        /// </summary>\n        public float U;\n        /// <summary>\n        /// Weight of vertex B.\n        /// </summary>\n        public float V;\n        /// <summary>\n        /// Weight of vertex C.\n        /// </summary>\n        public float W;\n        /// <summary>\n        /// Transform of the second shape in the first shape's local space.\n        /// </summary>\n        public RigidTransform LocalTransformB;\n\n\n        private PairSimplex(ref RigidTransform localTransformB)\n        {\n            //This isn't a very good approach since the transform position is not guaranteed to be within the object.  Would have to use the GetNewSimplexPoint to make it valid.\n            previousDistanceToClosest = float.MaxValue;\n            errorTolerance = 0;\n            LocalTransformB = localTransformB;\n            //Warm up the simplex using the centroids.\n            //Could also use the GetNewSimplexPoint if it had a Empty case, but test before choosing.\n            State = SimplexState.Point;\n            SimplexA = new ContributingShapeSimplex();\n            SimplexB = new ContributingShapeSimplex {A = localTransformB.Position};\n            //minkowski space support = shapeA-shapeB = 0,0,0 - positionB\n            Vector3.Negate(ref localTransformB.Position, out A);\n            B = new Vector3();\n            C = new Vector3();\n            D = new Vector3();\n            U = 0;\n            V = 0;\n            W = 0;\n        }\n\n        ///<summary>\n        /// Constructs a new pair simplex.\n        ///</summary>\n        ///<param name=\"cachedSimplex\">Cached simplex to use to warmstart the simplex.</param>\n        ///<param name=\"localTransformB\">Transform of shape B in the local space of A.</param>\n        public PairSimplex(ref CachedSimplex cachedSimplex, ref RigidTransform localTransformB)\n        {\n            //NOTE:\n            //USING A CACHED SIMPLEX INVALIDATES ASSUMPTIONS THAT ALLOW SIMPLEX CASES TO BE IGNORED!\n            //To get those assumptions back, either DO NOT USE CACHED SIMPLEXES, or \n            //VERIFY THE SIMPLEXES.\n            //-A point requires no verification.\n            //-A segment needs verification that the origin is in front of A in the direction of B.\n            //-A triangle needs verification that the origin is within the edge planes and in the direction of C.\n            //-A tetrahedron needs verification that the origin is within the edge planes of triangle ABC and is in the direction of D.\n\n            //This simplex implementation will not ignore any cases, so we can warm start safely with one problem.\n            //Due to relative movement, the simplex may become degenerate.  Edges could become points, etc.\n            //Some protections are built into the simplex cases, but keep an eye out for issues.\n            //Most dangerous degeneracy seen so far is tetrahedron.  It fails to find any points on opposing sides due to numerical problems and returns intersection.\n\n\n            previousDistanceToClosest = float.MaxValue;\n            errorTolerance = 0;\n            LocalTransformB = localTransformB;\n\n            //Transform the SimplexB into the working space of the simplex and compute the working space simplex.\n            State = cachedSimplex.State;\n            SimplexA = cachedSimplex.LocalSimplexA;\n            SimplexB = new ContributingShapeSimplex();\n            U = 0;\n            V = 0;\n            W = 0;\n            switch (State)\n            {\n                case SimplexState.Point:\n                    Vector3.Transform(ref cachedSimplex.LocalSimplexB.A, ref LocalTransformB.Orientation, out SimplexB.A);\n                    Vector3.Add(ref SimplexB.A, ref LocalTransformB.Position, out SimplexB.A);\n\n                    Vector3.Subtract(ref SimplexA.A, ref SimplexB.A, out A);\n                    B = new Vector3();\n                    C = new Vector3();\n                    D = new Vector3();\n                    break;\n                case SimplexState.Segment:\n                    Matrix3x3 transform;\n                    Matrix3x3.CreateFromQuaternion(ref localTransformB.Orientation, out transform);\n                    Matrix3x3.Transform(ref cachedSimplex.LocalSimplexB.A, ref transform, out SimplexB.A);\n                    Matrix3x3.Transform(ref cachedSimplex.LocalSimplexB.B, ref transform, out SimplexB.B);\n                    Vector3.Add(ref SimplexB.A, ref LocalTransformB.Position, out SimplexB.A);\n                    Vector3.Add(ref SimplexB.B, ref LocalTransformB.Position, out SimplexB.B);\n\n                    Vector3.Subtract(ref SimplexA.A, ref SimplexB.A, out A);\n                    Vector3.Subtract(ref SimplexA.B, ref SimplexB.B, out B);\n                    C = new Vector3();\n                    D = new Vector3();\n\n                    ////Test for degeneracy.\n                    //float edgeLengthAB;\n                    //Vector3.DistanceSquared(ref A, ref B, out edgeLengthAB);\n                    //if (edgeLengthAB < Toolbox.Epsilon)\n                    //    State = SimplexState.Point;\n\n                    break;\n                case SimplexState.Triangle:\n                    Matrix3x3.CreateFromQuaternion(ref localTransformB.Orientation, out transform);\n                    Matrix3x3.Transform(ref cachedSimplex.LocalSimplexB.A, ref transform, out SimplexB.A);\n                    Matrix3x3.Transform(ref cachedSimplex.LocalSimplexB.B, ref transform, out SimplexB.B);\n                    Matrix3x3.Transform(ref cachedSimplex.LocalSimplexB.C, ref transform, out SimplexB.C);\n                    Vector3.Add(ref SimplexB.A, ref LocalTransformB.Position, out SimplexB.A);\n                    Vector3.Add(ref SimplexB.B, ref LocalTransformB.Position, out SimplexB.B);\n                    Vector3.Add(ref SimplexB.C, ref LocalTransformB.Position, out SimplexB.C);\n\n                    Vector3.Subtract(ref SimplexA.A, ref SimplexB.A, out A);\n                    Vector3.Subtract(ref SimplexA.B, ref SimplexB.B, out B);\n                    Vector3.Subtract(ref SimplexA.C, ref SimplexB.C, out C);\n                    D = new Vector3();\n\n                    ////Test for degeneracy.\n                    //Vector3 AB, AC;\n                    //Vector3.Subtract(ref B, ref A, out AB);\n                    //Vector3.Subtract(ref C, ref A, out AC);\n                    //Vector3 cross;\n                    //Vector3.Cross(ref AB, ref AC, out cross);\n                    ////If the area is small compared to a tolerance (adjusted by the partial perimeter), it's degenerate.\n                    //if (cross.LengthSquared() < Toolbox.BigEpsilon * (AB.LengthSquared() + AC.LengthSquared()))\n                    //    State = SimplexState.Point;\n\n\n                    break;\n                case SimplexState.Tetrahedron:\n                    Matrix3x3.CreateFromQuaternion(ref localTransformB.Orientation, out transform);\n                    Matrix3x3.Transform(ref cachedSimplex.LocalSimplexB.A, ref transform, out SimplexB.A);\n                    Matrix3x3.Transform(ref cachedSimplex.LocalSimplexB.B, ref transform, out SimplexB.B);\n                    Matrix3x3.Transform(ref cachedSimplex.LocalSimplexB.C, ref transform, out SimplexB.C);\n                    Matrix3x3.Transform(ref cachedSimplex.LocalSimplexB.D, ref transform, out SimplexB.D);\n                    Vector3.Add(ref SimplexB.A, ref LocalTransformB.Position, out SimplexB.A);\n                    Vector3.Add(ref SimplexB.B, ref LocalTransformB.Position, out SimplexB.B);\n                    Vector3.Add(ref SimplexB.C, ref LocalTransformB.Position, out SimplexB.C);\n                    Vector3.Add(ref SimplexB.D, ref LocalTransformB.Position, out SimplexB.D);\n\n                    Vector3.Subtract(ref SimplexA.A, ref SimplexB.A, out A);\n                    Vector3.Subtract(ref SimplexA.B, ref SimplexB.B, out B);\n                    Vector3.Subtract(ref SimplexA.C, ref SimplexB.C, out C);\n                    Vector3.Subtract(ref SimplexA.D, ref SimplexB.D, out D);\n\n                    ////Test for degeneracy.\n                    //Vector3 AD;\n                    //Vector3.Subtract(ref B, ref A, out AB);\n                    //Vector3.Subtract(ref C, ref A, out AC);\n                    //Vector3.Subtract(ref D, ref A, out AD);\n                    //Vector3.Cross(ref AB, ref AC, out cross);\n                    //float volume;\n                    //Vector3.Dot(ref cross, ref AD, out volume);\n\n                    ////Volume is small compared to partial 'perimeter.'\n                    //if (volume < Toolbox.BigEpsilon * (AB.LengthSquared() + AC.LengthSquared() + AD.LengthSquared()))\n                    //    State = SimplexState.Point;\n                    break;\n                default:\n                    A = new Vector3();\n                    B = new Vector3();\n                    C = new Vector3();\n                    D = new Vector3();\n                    break;\n            }\n        }\n\n        ///<summary>\n        /// Updates the cached simplex with the latest run's results.\n        ///</summary>\n        ///<param name=\"simplex\">Simplex to update.</param>\n        public void UpdateCachedSimplex(ref CachedSimplex simplex)\n        {\n            simplex.LocalSimplexA = SimplexA;\n            switch (State)\n            {\n                case SimplexState.Point:\n                    Vector3.Subtract(ref SimplexB.A, ref LocalTransformB.Position, out simplex.LocalSimplexB.A);\n                    Quaternion conjugate;\n                    Quaternion.Conjugate(ref LocalTransformB.Orientation, out conjugate);\n                    Vector3.Transform(ref simplex.LocalSimplexB.A, ref conjugate, out simplex.LocalSimplexB.A);\n                    break;\n                case SimplexState.Segment:\n                    Vector3.Subtract(ref SimplexB.A, ref LocalTransformB.Position, out simplex.LocalSimplexB.A);\n                    Vector3.Subtract(ref SimplexB.B, ref LocalTransformB.Position, out simplex.LocalSimplexB.B);\n\n                    Matrix3x3 transform;\n                    Matrix3x3.CreateFromQuaternion(ref LocalTransformB.Orientation, out transform);\n                    Matrix3x3.TransformTranspose(ref simplex.LocalSimplexB.A, ref transform, out simplex.LocalSimplexB.A);\n                    Matrix3x3.TransformTranspose(ref simplex.LocalSimplexB.B, ref transform, out simplex.LocalSimplexB.B);\n                    break;\n                case SimplexState.Triangle:\n                    Vector3.Subtract(ref SimplexB.A, ref LocalTransformB.Position, out simplex.LocalSimplexB.A);\n                    Vector3.Subtract(ref SimplexB.B, ref LocalTransformB.Position, out simplex.LocalSimplexB.B);\n                    Vector3.Subtract(ref SimplexB.C, ref LocalTransformB.Position, out simplex.LocalSimplexB.C);\n\n                    Matrix3x3.CreateFromQuaternion(ref LocalTransformB.Orientation, out transform);\n                    Matrix3x3.TransformTranspose(ref simplex.LocalSimplexB.A, ref transform, out simplex.LocalSimplexB.A);\n                    Matrix3x3.TransformTranspose(ref simplex.LocalSimplexB.B, ref transform, out simplex.LocalSimplexB.B);\n                    Matrix3x3.TransformTranspose(ref simplex.LocalSimplexB.C, ref transform, out simplex.LocalSimplexB.C);\n                    break;\n                case SimplexState.Tetrahedron:\n                    Vector3.Subtract(ref SimplexB.A, ref LocalTransformB.Position, out simplex.LocalSimplexB.A);\n                    Vector3.Subtract(ref SimplexB.B, ref LocalTransformB.Position, out simplex.LocalSimplexB.B);\n                    Vector3.Subtract(ref SimplexB.C, ref LocalTransformB.Position, out simplex.LocalSimplexB.C);\n                    Vector3.Subtract(ref SimplexB.D, ref LocalTransformB.Position, out simplex.LocalSimplexB.D);\n\n                    Matrix3x3.CreateFromQuaternion(ref LocalTransformB.Orientation, out transform);\n                    Matrix3x3.TransformTranspose(ref simplex.LocalSimplexB.A, ref transform, out simplex.LocalSimplexB.A);\n                    Matrix3x3.TransformTranspose(ref simplex.LocalSimplexB.B, ref transform, out simplex.LocalSimplexB.B);\n                    Matrix3x3.TransformTranspose(ref simplex.LocalSimplexB.C, ref transform, out simplex.LocalSimplexB.C);\n                    Matrix3x3.TransformTranspose(ref simplex.LocalSimplexB.D, ref transform, out simplex.LocalSimplexB.D);\n                    break;\n            }\n            simplex.State = State;\n        }\n\n        ///<summary>\n        /// Gets the point on the simplex closest to the origin.\n        ///</summary>\n        ///<param name=\"point\">Point closest to the origin.</param>\n        ///<returns>Whether or not the simplex encloses the origin.</returns>\n        public bool GetPointClosestToOrigin(out Vector3 point)\n        {\n            //This method finds the closest point on the simplex to the origin.\n            //Barycentric coordinates are assigned to the MinimumNormCoordinates as necessary to perform the inclusion calculation.\n            //If the simplex is a tetrahedron and found to be overlapping the origin, the function returns true to tell the caller to terminate.\n            //Elements of the simplex that are not used to determine the point of minimum norm are removed from the simplex.\n\n            switch (State)\n            {\n\n                case SimplexState.Point:\n                    point = A;\n                    U = 1;\n                    break;\n                case SimplexState.Segment:\n                    GetPointOnSegmentClosestToOrigin(out point);\n                    break;\n                case SimplexState.Triangle:\n                    GetPointOnTriangleClosestToOrigin(out point);\n                    break;\n                case SimplexState.Tetrahedron:\n                    return GetPointOnTetrahedronClosestToOrigin(out point);\n                default:\n                    point = Toolbox.ZeroVector;\n                    break;\n\n\n            }\n            return false;\n        }\n\n\n        ///<summary>\n        /// Gets the point on the segment closest to the origin.\n        ///</summary>\n        ///<param name=\"point\">Point closest to origin.</param>\n        public void GetPointOnSegmentClosestToOrigin(out Vector3 point)\n        {\n            Vector3 segmentDisplacement;\n            Vector3.Subtract(ref B, ref A, out segmentDisplacement);\n\n            float dotA;\n            Vector3.Dot(ref segmentDisplacement, ref A, out dotA);\n            if (dotA > 0)\n            {\n                //'Behind' segment.  This can't happen in a boolean version,\n                //but with closest points warmstarting or raycasts, it will.\n                State = SimplexState.Point;\n\n                U = 1;\n                point = A;\n                return;\n            }\n            float dotB;\n            Vector3.Dot(ref segmentDisplacement, ref B, out dotB);\n            if (dotB > 0)\n            {\n                //Inside segment.\n                U = dotB / segmentDisplacement.LengthSquared();\n                V = 1 - U;\n                Vector3.Multiply(ref segmentDisplacement, V, out point);\n                Vector3.Add(ref point, ref A, out point);\n                return;\n\n            }\n\n            //It should be possible in the warmstarted closest point calculation/raycasting to be outside B.\n            //It is not possible in a 'boolean' GJK, where it early outs as soon as a separating axis is found.\n\n            //Outside B.\n            //Remove current A; we're becoming a point.\n            A = B;\n            SimplexA.A = SimplexA.B;\n            SimplexB.A = SimplexB.B;\n            State = SimplexState.Point;\n\n            U = 1;\n            point = A;\n\n        }\n\n        ///<summary>\n        /// Gets the point on the triangle closest to the origin.\n        ///</summary>\n        ///<param name=\"point\">Point closest to origin.</param>\n        public void GetPointOnTriangleClosestToOrigin(out Vector3 point)\n        {\n            Vector3 ab, ac;\n            Vector3.Subtract(ref B, ref A, out ab);\n            Vector3.Subtract(ref C, ref A, out ac);\n            //The point we are comparing against the triangle is 0,0,0, so instead of storing an \"A->P\" vector,\n            //just use -A.\n            //Same for B->P, C->P...\n\n            //Check to see if it's outside A.\n            //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside A.\n            float AdotAB, AdotAC;\n            Vector3.Dot(ref ab, ref A, out AdotAB);\n            Vector3.Dot(ref ac, ref A, out AdotAC);\n            AdotAB = -AdotAB;\n            AdotAC = -AdotAC;\n            if (AdotAC <= 0f && AdotAB <= 0)\n            {\n                //It is A!\n                State = SimplexState.Point;\n                U = 1;\n                point = A;\n                return;\n            }\n\n            //Check to see if it's outside B.\n            //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside B.\n            float BdotAB, BdotAC;\n            Vector3.Dot(ref ab, ref B, out BdotAB);\n            Vector3.Dot(ref ac, ref B, out BdotAC);\n            BdotAB = -BdotAB;\n            BdotAC = -BdotAC;\n            if (BdotAB >= 0f && BdotAC <= BdotAB)\n            {\n                //It is B!\n                State = SimplexState.Point;\n                A = B;\n                U = 1;\n                SimplexA.A = SimplexA.B;\n                SimplexB.A = SimplexB.B;\n                point = B;\n                return;\n            }\n\n            //Check to see if it's outside AB.\n            float vc = AdotAB * BdotAC - BdotAB * AdotAC;\n            if (vc <= 0 && AdotAB > 0 && BdotAB < 0)//Note > and < instead of => <=; avoids possibly division by zero\n            {\n                State = SimplexState.Segment;\n                V = AdotAB / (AdotAB - BdotAB);\n                U = 1 - V;\n\n                Vector3.Multiply(ref ab, V, out point);\n                Vector3.Add(ref point, ref A, out point);\n                return;\n            }\n\n            //Check to see if it's outside C.\n            //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside C.\n            float CdotAB, CdotAC;\n            Vector3.Dot(ref ab, ref C, out CdotAB);\n            Vector3.Dot(ref ac, ref C, out CdotAC);\n            CdotAB = -CdotAB;\n            CdotAC = -CdotAC;\n            if (CdotAC >= 0f && CdotAB <= CdotAC)\n            {\n                //It is C!\n                State = SimplexState.Point;\n                A = C;\n                SimplexA.A = SimplexA.C;\n                SimplexB.A = SimplexB.C;\n                U = 1;\n                point = A;\n                return;\n            }\n\n            //Check if it's outside AC.            \n            //float AdotAB, AdotAC;\n            //Vector3.Dot(ref ab, ref A, out AdotAB);\n            //Vector3.Dot(ref ac, ref A, out AdotAC);\n            //AdotAB = -AdotAB;\n            //AdotAC = -AdotAC;\n            float vb = CdotAB * AdotAC - AdotAB * CdotAC;\n            if (vb <= 0f && AdotAC > 0f && CdotAC < 0f)//Note > instead of >= and < instead of <=; prevents bad denominator\n            {\n                //Get rid of B.  Compress C into B.\n                State = SimplexState.Segment;\n                B = C;\n                SimplexA.B = SimplexA.C;\n                SimplexB.B = SimplexB.C;\n                V = AdotAC / (AdotAC - CdotAC);\n                U = 1 - V;\n                Vector3.Multiply(ref ac, V, out point);\n                Vector3.Add(ref point, ref A, out point);\n                return;\n            }\n\n            //Check if it's outside BC.\n            //float BdotAB, BdotAC;\n            //Vector3.Dot(ref ab, ref B, out BdotAB);\n            //Vector3.Dot(ref ac, ref B, out BdotAC);\n            //BdotAB = -BdotAB;\n            //BdotAC = -BdotAC;\n            float va = BdotAB * CdotAC - CdotAB * BdotAC;\n            float d3d4;\n            float d6d5;\n            if (va <= 0f && (d3d4 = BdotAC - BdotAB) > 0f && (d6d5 = CdotAB - CdotAC) > 0f)//Note > instead of >= and < instead of <=; prevents bad denominator\n            {\n                //Throw away A.  C->A.\n                //TODO: Does B->A, C->B work better?\n                State = SimplexState.Segment;\n                A = C;\n                SimplexA.A = SimplexA.C;\n                SimplexB.A = SimplexB.C;\n                U = d3d4 / (d3d4 + d6d5);\n                V = 1 - U;\n\n                Vector3 bc;\n                Vector3.Subtract(ref C, ref B, out bc);\n                Vector3.Multiply(ref bc, U, out point);\n                Vector3.Add(ref point, ref B, out point);\n                return;\n            }\n\n\n            //On the face of the triangle.\n            float denom = 1f / (va + vb + vc);\n            V = vb * denom;\n            W = vc * denom;\n            U = 1 - V - W;\n            Vector3.Multiply(ref ab, V, out point);\n            Vector3 acw;\n            Vector3.Multiply(ref ac, W, out acw);\n            Vector3.Add(ref A, ref point, out point);\n            Vector3.Add(ref point, ref acw, out point);\n\n\n\n\n        }\n\n        ///<summary>\n        /// Gets the point on the tetrahedron closest to the origin.\n        ///</summary>\n        ///<param name=\"point\">Closest point to the origin.</param>\n        ///<returns>Whether or not the tetrahedron encloses the origin.</returns>\n        public bool GetPointOnTetrahedronClosestToOrigin(out Vector3 point)\n        {\n\n            //Thanks to the fact that D is new and that we know that the origin is within the extruded\n            //triangular prism of ABC (and on the \"D\" side of ABC),\n            //we can immediately ignore voronoi regions:\n            //A, B, C, AC, AB, BC, ABC\n            //and only consider:\n            //D, DA, DB, DC, DAC, DCB, DBA\n\n            //There is some overlap of calculations in this method, since DAC, DCB, and DBA are tested fully.\n\n\n            PairSimplex minimumSimplex = new PairSimplex();\n            point = new Vector3();\n            float minimumDistance = float.MaxValue;\n\n\n            PairSimplex candidate;\n            float candidateDistance;\n            Vector3 candidatePoint;\n            if (TryTetrahedronTriangle(ref A, ref C, ref D,\n                                       ref SimplexA.A, ref SimplexA.C, ref SimplexA.D,\n                                       ref SimplexB.A, ref SimplexB.C, ref SimplexB.D,\n                                       errorTolerance,\n                                       ref B, out candidate, out candidatePoint))\n            {\n                point = candidatePoint;\n                minimumSimplex = candidate;\n                minimumDistance = candidatePoint.LengthSquared();\n            }\n\n            //Try BDC instead of CBD\n            if (TryTetrahedronTriangle(ref B, ref D, ref C,\n                                       ref SimplexA.B, ref SimplexA.D, ref SimplexA.C,\n                                       ref SimplexB.B, ref SimplexB.D, ref SimplexB.C,\n                                       errorTolerance,\n                                       ref A, out candidate, out candidatePoint) &&\n                (candidateDistance = candidatePoint.LengthSquared()) < minimumDistance)\n            {\n                point = candidatePoint;\n                minimumSimplex = candidate;\n                minimumDistance = candidateDistance;\n            }\n\n            //Try ADB instead of BAD\n            if (TryTetrahedronTriangle(ref A, ref D, ref B,\n                                       ref SimplexA.A, ref SimplexA.D, ref SimplexA.B,\n                                       ref SimplexB.A, ref SimplexB.D, ref SimplexB.B,\n                                       errorTolerance,\n                                       ref C, out candidate, out candidatePoint) &&\n                (candidateDistance = candidatePoint.LengthSquared()) < minimumDistance)\n            {\n                point = candidatePoint;\n                minimumSimplex = candidate;\n                minimumDistance = candidateDistance;\n            }\n\n            if (TryTetrahedronTriangle(ref A, ref B, ref C,\n                                       ref SimplexA.A, ref SimplexA.B, ref SimplexA.C,\n                                       ref SimplexB.A, ref SimplexB.B, ref SimplexB.C,\n                                       errorTolerance,\n                                       ref D, out candidate, out candidatePoint) &&\n                (candidateDistance = candidatePoint.LengthSquared()) < minimumDistance)\n            {\n                point = candidatePoint;\n                minimumSimplex = candidate;\n                minimumDistance = candidateDistance;\n            }\n\n\n            if (minimumDistance < float.MaxValue)\n            {\n                minimumSimplex.LocalTransformB = LocalTransformB;\n                minimumSimplex.previousDistanceToClosest = previousDistanceToClosest;\n                minimumSimplex.errorTolerance = errorTolerance;\n                this = minimumSimplex;\n                return false;\n            }\n            return true;\n        }\n\n\n        private static bool TryTetrahedronTriangle(ref Vector3 A, ref Vector3 B, ref Vector3 C,\n                                                   ref Vector3 A1, ref Vector3 B1, ref Vector3 C1,\n                                                   ref Vector3 A2, ref Vector3 B2, ref Vector3 C2,\n                                                   float errorTolerance,\n                                                   ref Vector3 otherPoint, out PairSimplex simplex, out Vector3 point)\n        {\n            //Note that there may be some extra terms that can be removed from this process.\n            //Some conditions could use less parameters, since it is known that the origin\n            //is not 'behind' BC or AC.\n\n            simplex = new PairSimplex();\n            point = new Vector3();\n\n\n            Vector3 ab, ac;\n            Vector3.Subtract(ref B, ref A, out ab);\n            Vector3.Subtract(ref C, ref A, out ac);\n            Vector3 normal;\n            Vector3.Cross(ref ab, ref ac, out normal);\n            float AdotN, ADdotN;\n            Vector3 AD;\n            Vector3.Subtract(ref otherPoint, ref A, out AD);\n            Vector3.Dot(ref A, ref normal, out AdotN);\n            Vector3.Dot(ref AD, ref normal, out ADdotN);\n\n            //If (-A * N) * (AD * N) < 0, D and O are on opposite sides of the triangle.\n            if (AdotN * ADdotN >= -Toolbox.Epsilon * errorTolerance)\n            {\n                //The point we are comparing against the triangle is 0,0,0, so instead of storing an \"A->P\" vector,\n                //just use -A.\n                //Same for B->, C->P...\n\n                //Check to see if it's outside A.\n                //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside A.\n                float AdotAB, AdotAC;\n                Vector3.Dot(ref ab, ref A, out AdotAB);\n                Vector3.Dot(ref ac, ref A, out AdotAC);\n                AdotAB = -AdotAB;\n                AdotAC = -AdotAC;\n                if (AdotAC <= 0f && AdotAB <= 0)\n                {\n                    //It is A!\n                    simplex.State = SimplexState.Point;\n                    simplex.A = A;\n                    simplex.U = 1;\n                    simplex.SimplexA.A = A1;\n                    simplex.SimplexB.A = A2;\n                    point = A;\n                    return true;\n                }\n\n                //Check to see if it's outside B.\n                //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside B.\n                float BdotAB, BdotAC;\n                Vector3.Dot(ref ab, ref B, out BdotAB);\n                Vector3.Dot(ref ac, ref B, out BdotAC);\n                BdotAB = -BdotAB;\n                BdotAC = -BdotAC;\n                if (BdotAB >= 0f && BdotAC <= BdotAB)\n                {\n                    //It is B!\n                    simplex.State = SimplexState.Point;\n                    simplex.A = B;\n                    simplex.U = 1;\n                    simplex.SimplexA.A = B1;\n                    simplex.SimplexB.A = B2;\n                    point = B;\n                    return true;\n                }\n\n                //Check to see if it's outside AB.\n                float vc = AdotAB * BdotAC - BdotAB * AdotAC;\n                if (vc <= 0 && AdotAB > 0 && BdotAB < 0) //Note > and < instead of => <=; avoids possibly division by zero\n                {\n                    simplex.State = SimplexState.Segment;\n                    simplex.V = AdotAB / (AdotAB - BdotAB);\n                    simplex.U = 1 - simplex.V;\n                    simplex.A = A;\n                    simplex.B = B;\n                    simplex.SimplexA.A = A1;\n                    simplex.SimplexB.A = A2;\n                    simplex.SimplexA.B = B1;\n                    simplex.SimplexB.B = B2;\n\n                    Vector3.Multiply(ref ab, simplex.V, out point);\n                    Vector3.Add(ref point, ref A, out point);\n                    return true;\n                }\n\n                //Check to see if it's outside C.\n                //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside C.\n                float CdotAB, CdotAC;\n                Vector3.Dot(ref ab, ref C, out CdotAB);\n                Vector3.Dot(ref ac, ref C, out CdotAC);\n                CdotAB = -CdotAB;\n                CdotAC = -CdotAC;\n                if (CdotAC >= 0f && CdotAB <= CdotAC)\n                {\n                    //It is C!\n                    simplex.State = SimplexState.Point;\n                    simplex.A = C;\n                    simplex.U = 1;\n                    simplex.SimplexA.A = C1;\n                    simplex.SimplexB.A = C2;\n                    point = C;\n                    return true;\n                }\n\n                //Check if it's outside AC.            \n                //float AdotAB, AdotAC;\n                //Vector3.Dot(ref ab, ref A, out AdotAB);\n                //Vector3.Dot(ref ac, ref A, out AdotAC);\n                //AdotAB = -AdotAB;\n                //AdotAC = -AdotAC;\n                float vb = CdotAB * AdotAC - AdotAB * CdotAC;\n                if (vb <= 0f && AdotAC > 0f && CdotAC < 0f) //Note > instead of >= and < instead of <=; prevents bad denominator\n                {\n                    simplex.State = SimplexState.Segment;\n                    simplex.A = A;\n                    simplex.B = C;\n                    simplex.SimplexA.A = A1;\n                    simplex.SimplexA.B = C1;\n                    simplex.SimplexB.A = A2;\n                    simplex.SimplexB.B = C2;\n                    simplex.V = AdotAC / (AdotAC - CdotAC);\n                    simplex.U = 1 - simplex.V;\n                    Vector3.Multiply(ref ac, simplex.V, out point);\n                    Vector3.Add(ref point, ref A, out point);\n                    return true;\n                }\n\n                //Check if it's outside BC.\n                //float BdotAB, BdotAC;\n                //Vector3.Dot(ref ab, ref B, out BdotAB);\n                //Vector3.Dot(ref ac, ref B, out BdotAC);\n                //BdotAB = -BdotAB;\n                //BdotAC = -BdotAC;\n                float va = BdotAB * CdotAC - CdotAB * BdotAC;\n                float d3d4;\n                float d6d5;\n                if (va <= 0f && (d3d4 = BdotAC - BdotAB) > 0f && (d6d5 = CdotAB - CdotAC) > 0f)//Note > instead of >= and < instead of <=; prevents bad denominator\n                {\n                    simplex.State = SimplexState.Segment;\n                    simplex.A = B;\n                    simplex.B = C;\n                    simplex.SimplexA.A = B1;\n                    simplex.SimplexA.B = C1;\n                    simplex.SimplexB.A = B2;\n                    simplex.SimplexB.B = C2;\n                    simplex.V = d3d4 / (d3d4 + d6d5);\n                    simplex.U = 1 - simplex.V;\n\n                    Vector3 bc;\n                    Vector3.Subtract(ref C, ref B, out bc);\n                    Vector3.Multiply(ref bc, simplex.V, out point);\n                    Vector3.Add(ref point, ref B, out point);\n                    return true;\n                }\n\n\n                //On the face of the triangle.\n                simplex.A = A;\n                simplex.B = B;\n                simplex.C = C;\n                simplex.SimplexA.A = A1;\n                simplex.SimplexA.B = B1;\n                simplex.SimplexA.C = C1;\n                simplex.SimplexB.A = A2;\n                simplex.SimplexB.B = B2;\n                simplex.SimplexB.C = C2;\n                simplex.State = SimplexState.Triangle;\n                float denom = 1f / (va + vb + vc);\n                simplex.W = vc * denom;\n                simplex.V = vb * denom;\n                simplex.U = 1 - simplex.V - simplex.W;\n                Vector3.Multiply(ref ab, simplex.V, out point);\n                Vector3 acw;\n                Vector3.Multiply(ref ac, simplex.W, out acw);\n                Vector3.Add(ref A, ref point, out point);\n                Vector3.Add(ref point, ref acw, out point);\n                return true;\n            }\n            return false;\n        }\n\n\n        internal float errorTolerance;\n        ///<summary>\n        /// Gets the error tolerance of the simplex.\n        ///</summary>\n        public float ErrorTolerance\n        {\n            get\n            {\n                return errorTolerance;\n            }\n        }\n        float previousDistanceToClosest;\n        ///<summary>\n        /// Adds a new point to the simplex.\n        ///</summary>\n        ///<param name=\"shapeA\">First shape in the pair.</param>\n        ///<param name=\"shapeB\">Second shape in the pair.</param>\n        ///<param name=\"iterationCount\">Current iteration count.</param>\n        ///<param name=\"closestPoint\">Current point on simplex closest to origin.</param>\n        ///<returns>Whether or not GJK should exit due to a lack of progression.</returns>\n        public bool GetNewSimplexPoint(ConvexShape shapeA, ConvexShape shapeB, int iterationCount, ref Vector3 closestPoint)\n        {\n            Vector3 negativeDirection;\n            Vector3.Negate(ref closestPoint, out negativeDirection);\n            Vector3 sa, sb;\n            shapeA.GetLocalExtremePointWithoutMargin(ref negativeDirection, out sa);\n            shapeB.GetExtremePointWithoutMargin(closestPoint, ref LocalTransformB, out sb);\n            Vector3 S;\n            Vector3.Subtract(ref sa, ref sb, out S);\n            //If S is not further towards the origin along negativeDirection than closestPoint, then we're done.\n            float dotS;\n            Vector3.Dot(ref S, ref negativeDirection, out dotS); //-P * S\n            float distanceToClosest = closestPoint.LengthSquared();\n\n            float progression = dotS + distanceToClosest;\n            //It's likely that the system is oscillating between two or more states, usually because of a degenerate simplex.\n            //Rather than detect specific problem cases, this approach just lets it run and catches whatever falls through.\n            //During oscillation, one of the states is usually just BARELY outside of the numerical tolerance.\n            //After a bunch of iterations, the system lets it pick the 'better' one.\n            if (iterationCount > GJKToolbox.HighGJKIterations && distanceToClosest - previousDistanceToClosest < DistanceConvergenceEpsilon * errorTolerance)\n                return true;\n            if (distanceToClosest < previousDistanceToClosest)\n                previousDistanceToClosest = distanceToClosest;\n\n            //If \"A\" is the new point always, then the switch statement can be removed\n            //in favor of just pushing three points up.\n            switch (State)\n            {\n                case SimplexState.Point:\n                    if (progression <= (errorTolerance = MathHelper.Max(A.LengthSquared(), S.LengthSquared())) * ProgressionEpsilon)\n                        return true;\n\n                    State = SimplexState.Segment;\n                    B = S;\n                    SimplexA.B = sa;\n                    SimplexB.B = sb;\n                    return false;\n                case SimplexState.Segment:\n                    if (progression <= (errorTolerance = MathHelper.Max(MathHelper.Max(A.LengthSquared(), B.LengthSquared()), S.LengthSquared())) * ProgressionEpsilon)\n                        return true;\n\n                    State = SimplexState.Triangle;\n                    C = S;\n                    SimplexA.C = sa;\n                    SimplexB.C = sb;\n                    return false;\n                case SimplexState.Triangle:\n                    if (progression <= (errorTolerance = MathHelper.Max(MathHelper.Max(A.LengthSquared(), B.LengthSquared()), MathHelper.Max(C.LengthSquared(), S.LengthSquared()))) * ProgressionEpsilon)\n                        return true;\n\n                    State = SimplexState.Tetrahedron;\n                    D = S;\n                    SimplexA.D = sa;\n                    SimplexB.D = sb;\n                    return false;\n            }\n            return false;\n        }\n\n        ///<summary>\n        /// Gets the closest points by using the barycentric coordinates and shape simplex contributions.\n        ///</summary>\n        ///<param name=\"closestPointA\">Closest point on shape A.</param>\n        ///<param name=\"closestPointB\">Closest point on shape B.</param>\n        public void GetClosestPoints(out Vector3 closestPointA, out Vector3 closestPointB)\n        {\n            //A * U + B * V + C * W\n            switch (State)\n            {\n                case SimplexState.Point:\n                    closestPointA = SimplexA.A;\n                    closestPointB = SimplexB.A;\n                    return;\n                case SimplexState.Segment:\n                    Vector3 temp;\n                    Vector3.Multiply(ref SimplexA.A, U, out closestPointA);\n                    Vector3.Multiply(ref SimplexA.B, V, out temp);\n                    Vector3.Add(ref closestPointA, ref temp, out closestPointA);\n\n                    Vector3.Multiply(ref SimplexB.A, U, out closestPointB);\n                    Vector3.Multiply(ref SimplexB.B, V, out temp);\n                    Vector3.Add(ref closestPointB, ref temp, out closestPointB);\n                    return;\n                case SimplexState.Triangle:\n                    Vector3.Multiply(ref SimplexA.A, U, out closestPointA);\n                    Vector3.Multiply(ref SimplexA.B, V, out temp);\n                    Vector3.Add(ref closestPointA, ref temp, out closestPointA);\n                    Vector3.Multiply(ref SimplexA.C, W, out temp);\n                    Vector3.Add(ref closestPointA, ref temp, out closestPointA);\n\n                    Vector3.Multiply(ref SimplexB.A, U, out closestPointB);\n                    Vector3.Multiply(ref SimplexB.B, V, out temp);\n                    Vector3.Add(ref closestPointB, ref temp, out closestPointB);\n                    Vector3.Multiply(ref SimplexB.C, W, out temp);\n                    Vector3.Add(ref closestPointB, ref temp, out closestPointB);\n                    return;\n            }\n            closestPointA = Toolbox.ZeroVector;\n            closestPointB = Toolbox.ZeroVector;\n\n        }\n\n        internal void VerifyContributions()\n        {\n            switch (State)\n            {\n                case SimplexState.Point:\n                    if (Vector3.Distance(SimplexA.A - SimplexB.A, A) > .0001f)\n                        Debug.WriteLine(\"break.\");\n                    break;\n                case SimplexState.Segment:\n                    if (Vector3.Distance(SimplexA.A - SimplexB.A, A) > .0001f)\n                        Debug.WriteLine(\"break.\");\n\n                    if (Vector3.Distance(SimplexA.B - SimplexB.B, B) > .0001f)\n                        Debug.WriteLine(\"break.\");\n                    break;\n                case SimplexState.Triangle:\n                    if (Vector3.Distance(SimplexA.A - SimplexB.A, A) > .0001f)\n                        Debug.WriteLine(\"break.\");\n\n                    if (Vector3.Distance(SimplexA.B - SimplexB.B, B) > .0001f)\n                        Debug.WriteLine(\"break.\");\n\n                    if (Vector3.Distance(SimplexA.C - SimplexB.C, C) > .0001f)\n                        Debug.WriteLine(\"break.\");\n                    break;\n\n                case SimplexState.Tetrahedron:\n                    if (Vector3.Distance(SimplexA.A - SimplexB.A, A) > .0001f)\n                        Debug.WriteLine(\"break.\");\n\n                    if (Vector3.Distance(SimplexA.B - SimplexB.B, B) > .0001f)\n                        Debug.WriteLine(\"break.\");\n\n                    if (Vector3.Distance(SimplexA.C - SimplexB.C, C) > .0001f)\n                        Debug.WriteLine(\"break.\");\n\n                    if (Vector3.Distance(SimplexA.D - SimplexB.D, D) > .0001f)\n                        Debug.WriteLine(\"break.\");\n                    break;\n            }\n        }\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/GJK/RaySimplex.cs",
    "content": "﻿using BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms.GJK\n{\n\n    ///<summary>\n    /// GJK simplex supporting ray-based tests.\n    ///</summary>\n    public struct RaySimplex\n    {\n        ///<summary>\n        /// First vertex in the simplex.\n        ///</summary>\n        public Vector3 A;\n        /// <summary>\n        /// Second vertex in the simplex.\n        /// </summary>\n        public Vector3 B;\n        /// <summary>\n        /// Third vertex in the simplex.\n        /// </summary>\n        public Vector3 C;\n        /// <summary>\n        /// Fourth vertex in the simplex.\n        /// </summary>\n        public Vector3 D;\n        /// <summary>\n        /// Current state of the simplex.\n        /// </summary>\n        public SimplexState State;\n\n\n\n        ///<summary>\n        /// Gets the point on the simplex that is closest to the origin.\n        ///</summary>\n        ///<param name=\"simplex\">Simplex to test.</param>\n        ///<param name=\"point\">Closest point on the simplex.</param>\n        ///<returns>Whether or not the simplex contains the origin.</returns>\n        public bool GetPointClosestToOrigin(ref RaySimplex simplex, out Vector3 point)\n        {\n            //This method finds the closest point on the simplex to the origin.\n            //Barycentric coordinates are assigned to the MinimumNormCoordinates as necessary to perform the inclusion calculation.\n            //If the simplex is a tetrahedron and found to be overlapping the origin, the function returns true to tell the caller to terminate.\n            //Elements of the simplex that are not used to determine the point of minimum norm are removed from the simplex.\n\n            switch (State)\n            {\n\n                case SimplexState.Point:\n                    point = A;\n                    break;\n                case SimplexState.Segment:\n                    GetPointOnSegmentClosestToOrigin(ref simplex, out point);\n                    break;\n                case SimplexState.Triangle:\n                    GetPointOnTriangleClosestToOrigin(ref simplex, out point);\n                    break;\n                case SimplexState.Tetrahedron:\n                    return GetPointOnTetrahedronClosestToOrigin(ref simplex, out point);\n                default:\n                    point = Toolbox.ZeroVector;\n                    break;\n\n\n            }\n            return false;\n        }\n\n\n        ///<summary>\n        /// Finds the point on the segment to the origin.\n        ///</summary>\n        ///<param name=\"simplex\">Simplex to test.</param>\n        ///<param name=\"point\">Closest point.</param>\n        public void GetPointOnSegmentClosestToOrigin(ref RaySimplex simplex, out Vector3 point)\n        {\n            Vector3 segmentDisplacement;\n            Vector3.Subtract(ref B, ref A, out segmentDisplacement);\n\n            float dotA;\n            Vector3.Dot(ref segmentDisplacement, ref A, out dotA);\n            if (dotA > 0)\n            {\n                //'Behind' segment.  This can't happen in a boolean version,\n                //but with closest points warmstarting or raycasts, it will.\n                simplex.State = SimplexState.Point;\n\n                point = A;\n                return;\n            }\n            float dotB;\n            Vector3.Dot(ref segmentDisplacement, ref B, out dotB);\n            if (dotB > 0)\n            {\n                //Inside segment.\n                float V = -dotA / segmentDisplacement.LengthSquared();\n                Vector3.Multiply(ref segmentDisplacement, V, out point);\n                Vector3.Add(ref point, ref A, out point);\n                return;\n\n            }\n\n            //It should be possible in the warmstarted closest point calculation/raycasting to be outside B.\n            //It is not possible in a 'boolean' GJK, where it early outs as soon as a separating axis is found.\n\n            //Outside B.\n            //Remove current A; we're becoming a point.\n            simplex.A = simplex.B;\n            simplex.State = SimplexState.Point;\n\n            point = A;\n\n        }\n\n        ///<summary>\n        /// Gets the point on the triangle that is closest to the origin.\n        ///</summary>\n        ///<param name=\"simplex\">Simplex to test.</param>\n        ///<param name=\"point\">Closest point to origin.</param>\n        public void GetPointOnTriangleClosestToOrigin(ref RaySimplex simplex, out Vector3 point)\n        {\n            Vector3 ab, ac;\n            Vector3.Subtract(ref B, ref A, out ab);\n            Vector3.Subtract(ref C, ref A, out ac);\n            //The point we are comparing against the triangle is 0,0,0, so instead of storing an \"A->P\" vector,\n            //just use -A.\n            //Same for B->P, C->P...\n\n            //Check to see if it's outside A.\n            //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside A.\n            float AdotAB, AdotAC;\n            Vector3.Dot(ref ab, ref A, out AdotAB);\n            Vector3.Dot(ref ac, ref A, out AdotAC);\n            AdotAB = -AdotAB;\n            AdotAC = -AdotAC;\n            if (AdotAC <= 0f && AdotAB <= 0)\n            {\n                //It is A!\n                simplex.State = SimplexState.Point;\n                point = A;\n                return;\n            }\n\n            //Check to see if it's outside B.\n            //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside B.\n            float BdotAB, BdotAC;\n            Vector3.Dot(ref ab, ref B, out BdotAB);\n            Vector3.Dot(ref ac, ref B, out BdotAC);\n            BdotAB = -BdotAB;\n            BdotAC = -BdotAC;\n            if (BdotAB >= 0f && BdotAC <= BdotAB)\n            {\n                //It is B!\n                simplex.State = SimplexState.Point;\n                simplex.A = simplex.B;\n\n                point = B;\n                return;\n            }\n\n            //Check to see if it's outside AB.\n            float vc = AdotAB * BdotAC - BdotAB * AdotAC;\n            if (vc <= 0 && AdotAB > 0 && BdotAB < 0)//Note > and < instead of => <=; avoids possibly division by zero\n            {\n                simplex.State = SimplexState.Segment;\n                float V = AdotAB / (AdotAB - BdotAB);\n\n                Vector3.Multiply(ref ab, V, out point);\n                Vector3.Add(ref point, ref A, out point);\n                return;\n            }\n\n            //Check to see if it's outside C.\n            //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside C.\n            float CdotAB, CdotAC;\n            Vector3.Dot(ref ab, ref C, out CdotAB);\n            Vector3.Dot(ref ac, ref C, out CdotAC);\n            CdotAB = -CdotAB;\n            CdotAC = -CdotAC;\n            if (CdotAC >= 0f && CdotAB <= CdotAC)\n            {\n                //It is C!\n                simplex.State = SimplexState.Point;\n                simplex.A = simplex.C;\n                point = A;\n                return;\n            }\n\n            //Check if it's outside AC.            \n            //float AdotAB, AdotAC;\n            //Vector3.Dot(ref ab, ref A, out AdotAB);\n            //Vector3.Dot(ref ac, ref A, out AdotAC);\n            //AdotAB = -AdotAB;\n            //AdotAC = -AdotAC;\n            float vb = CdotAB * AdotAC - AdotAB * CdotAC;\n            if (vb <= 0f && AdotAC > 0f && CdotAC < 0f)//Note > instead of >= and < instead of <=; prevents bad denominator\n            {\n                //Get rid of B.  Compress C into B.\n                simplex.State = SimplexState.Segment;\n                simplex.B = simplex.C;\n                float V = AdotAC / (AdotAC - CdotAC);\n                Vector3.Multiply(ref ac, V, out point);\n                Vector3.Add(ref point, ref A, out point);\n                return;\n            }\n\n            //Check if it's outside BC.\n            //float BdotAB, BdotAC;\n            //Vector3.Dot(ref ab, ref B, out BdotAB);\n            //Vector3.Dot(ref ac, ref B, out BdotAC);\n            //BdotAB = -BdotAB;\n            //BdotAC = -BdotAC;\n            float va = BdotAB * CdotAC - CdotAB * BdotAC;\n            float d3d4;\n            float d6d5;\n            if (va <= 0f && (d3d4 = BdotAC - BdotAB) > 0f && (d6d5 = CdotAB - CdotAC) > 0f)//Note > instead of >= and < instead of <=; prevents bad denominator\n            {\n                //Throw away A.  C->A.\n                //TODO: Does B->A, C->B work better?\n                simplex.State = SimplexState.Segment;\n                simplex.A = simplex.C;\n                float U = d3d4 / (d3d4 + d6d5);\n\n                Vector3 bc;\n                Vector3.Subtract(ref C, ref B, out bc);\n                Vector3.Multiply(ref bc, U, out point);\n                Vector3.Add(ref point, ref B, out point);\n                return;\n            }\n\n\n            //On the face of the triangle.\n            float denom = 1f / (va + vb + vc);\n            float v = vb * denom;\n            float w = vc * denom;\n            Vector3.Multiply(ref ab, v, out point);\n            Vector3 acw;\n            Vector3.Multiply(ref ac, w, out acw);\n            Vector3.Add(ref A, ref point, out point);\n            Vector3.Add(ref point, ref acw, out point);\n\n\n\n\n        }\n\n        ///<summary>\n        /// Gets the point closest to the origin on the tetrahedron.\n        ///</summary>\n        ///<param name=\"simplex\">Simplex to test.</param>\n        ///<param name=\"point\">Closest point.</param>\n        ///<returns>Whether or not the tetrahedron encloses the origin.</returns>\n        public bool GetPointOnTetrahedronClosestToOrigin(ref RaySimplex simplex, out Vector3 point)\n        {\n\n            //Thanks to the fact that D is new and that we know that the origin is within the extruded\n            //triangular prism of ABC (and on the \"D\" side of ABC),\n            //we can immediately ignore voronoi regions:\n            //A, B, C, AC, AB, BC, ABC\n            //and only consider:\n            //D, DA, DB, DC, DAC, DCB, DBA\n\n            //There is some overlap of calculations in this method, since DAC, DCB, and DBA are tested fully.\n            \n            //When this method is being called, we don't care about the state of 'this' simplex.  It's just a temporary shifted simplex.\n            //The one that needs to be updated is the simplex being passed in.\n            \n            var minimumSimplex = new RaySimplex();\n            point = new Vector3();\n            float minimumDistance = float.MaxValue;\n\n\n            RaySimplex candidate;\n            float candidateDistance;\n            Vector3 candidatePoint;\n            if (TryTetrahedronTriangle(ref A, ref C, ref D,\n                                       ref simplex.A, ref simplex.C, ref simplex.D,\n                                       ref B, out candidate, out candidatePoint))\n            {\n                point = candidatePoint;\n                minimumSimplex = candidate;\n                minimumDistance = candidatePoint.LengthSquared();\n            }\n\n            if (TryTetrahedronTriangle(ref C, ref B, ref D,\n                                       ref simplex.C, ref simplex.B, ref simplex.D,\n                                       ref A, out candidate, out candidatePoint) &&\n                (candidateDistance = candidatePoint.LengthSquared()) < minimumDistance)\n            {\n                point = candidatePoint;\n                minimumSimplex = candidate;\n                minimumDistance = candidateDistance;\n            }\n\n            if (TryTetrahedronTriangle(ref B, ref A, ref D,\n                                       ref simplex.B, ref simplex.A, ref simplex.D,\n                                       ref C, out candidate, out candidatePoint) &&\n                (candidateDistance = candidatePoint.LengthSquared()) < minimumDistance)\n            {\n                point = candidatePoint;\n                minimumSimplex = candidate;\n                minimumDistance = candidateDistance;\n            }\n\n            if (TryTetrahedronTriangle(ref A, ref B, ref C,\n                                       ref simplex.A, ref simplex.B, ref simplex.C,\n                                       ref D, out candidate, out candidatePoint) &&\n                (candidateDistance = candidatePoint.LengthSquared()) < minimumDistance)\n            {\n                point = candidatePoint;\n                minimumSimplex = candidate;\n                minimumDistance = candidateDistance;\n            }\n\n\n            if (minimumDistance < float.MaxValue)\n            {\n                simplex = minimumSimplex;\n                return false;\n            }\n            return true;\n        }\n\n\n        private static bool TryTetrahedronTriangle(ref Vector3 A, ref Vector3 B, ref Vector3 C,\n                                                   ref Vector3 simplexA, ref Vector3 simplexB, ref Vector3 simplexC,\n                                                   ref Vector3 otherPoint, out RaySimplex simplex, out Vector3 point)\n        {\n            //Note that there may be some extra terms that can be removed from this process.\n            //Some conditions could use less parameters, since it is known that the origin\n            //is not 'behind' BC or AC.\n\n            simplex = new RaySimplex();\n            point = new Vector3();\n\n\n            Vector3 ab, ac;\n            Vector3.Subtract(ref B, ref A, out ab);\n            Vector3.Subtract(ref C, ref A, out ac);\n            Vector3 normal;\n            Vector3.Cross(ref ab, ref ac, out normal);\n            float AdotN, ADdotN;\n            Vector3 AD;\n            Vector3.Subtract(ref otherPoint, ref A, out AD);\n            Vector3.Dot(ref A, ref normal, out AdotN);\n            Vector3.Dot(ref AD, ref normal, out ADdotN);\n\n            //If (-A * N) * (AD * N) < 0, D and O are on opposite sides of the triangle.\n            if (AdotN * ADdotN >= 0)\n            {\n                //The point we are comparing against the triangle is 0,0,0, so instead of storing an \"A->P\" vector,\n                //just use -A.\n                //Same for B->, C->P...\n\n                //Check to see if it's outside A.\n                //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside A.\n                float AdotAB, AdotAC;\n                Vector3.Dot(ref ab, ref A, out AdotAB);\n                Vector3.Dot(ref ac, ref A, out AdotAC);\n                AdotAB = -AdotAB;\n                AdotAC = -AdotAC;\n                if (AdotAC <= 0f && AdotAB <= 0)\n                {\n                    //It is A!\n                    simplex.State = SimplexState.Point;\n                    simplex.A = simplexA;\n                    point = A;\n                    return true;\n                }\n\n                //Check to see if it's outside B.\n                //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside B.\n                float BdotAB, BdotAC;\n                Vector3.Dot(ref ab, ref B, out BdotAB);\n                Vector3.Dot(ref ac, ref B, out BdotAC);\n                BdotAB = -BdotAB;\n                BdotAC = -BdotAC;\n                if (BdotAB >= 0f && BdotAC <= BdotAB)\n                {\n                    //It is B!\n                    simplex.State = SimplexState.Point;\n                    simplex.A = simplexB;\n                    point = B;\n                    return true;\n                }\n\n                //Check to see if it's outside AB.\n                float vc = AdotAB * BdotAC - BdotAB * AdotAC;\n                if (vc <= 0 && AdotAB > 0 && BdotAB < 0) //Note > and < instead of => <=; avoids possibly division by zero\n                {\n                    simplex.State = SimplexState.Segment;\n                    simplex.A = simplexA;\n                    simplex.B = simplexB;\n                    float V = AdotAB / (AdotAB - BdotAB);\n\n                    Vector3.Multiply(ref ab, V, out point);\n                    Vector3.Add(ref point, ref A, out point);\n                    return true;\n                }\n\n                //Check to see if it's outside C.\n                //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside C.\n                float CdotAB, CdotAC;\n                Vector3.Dot(ref ab, ref C, out CdotAB);\n                Vector3.Dot(ref ac, ref C, out CdotAC);\n                CdotAB = -CdotAB;\n                CdotAC = -CdotAC;\n                if (CdotAC >= 0f && CdotAB <= CdotAC)\n                {\n                    //It is C!\n                    simplex.State = SimplexState.Point;\n                    simplex.A = simplexC;\n                    point = C;\n                    return true;\n                }\n\n                //Check if it's outside AC.            \n                //float AdotAB, AdotAC;\n                //Vector3.Dot(ref ab, ref A, out AdotAB);\n                //Vector3.Dot(ref ac, ref A, out AdotAC);\n                //AdotAB = -AdotAB;\n                //AdotAC = -AdotAC;\n                float vb = CdotAB * AdotAC - AdotAB * CdotAC;\n                if (vb <= 0f && AdotAC > 0f && CdotAC < 0f) //Note > instead of >= and < instead of <=; prevents bad denominator\n                {\n                    simplex.State = SimplexState.Segment;\n                    simplex.A = simplexA;\n                    simplex.B = simplexC;\n                    float V = AdotAC / (AdotAC - CdotAC);\n                    Vector3.Multiply(ref ac, V, out point);\n                    Vector3.Add(ref point, ref A, out point);\n                    return true;\n                }\n\n                //Check if it's outside BC.\n                //float BdotAB, BdotAC;\n                //Vector3.Dot(ref ab, ref B, out BdotAB);\n                //Vector3.Dot(ref ac, ref B, out BdotAC);\n                //BdotAB = -BdotAB;\n                //BdotAC = -BdotAC;\n                float va = BdotAB * CdotAC - CdotAB * BdotAC;\n                float d3d4;\n                float d6d5;\n                if (va <= 0f && (d3d4 = BdotAC - BdotAB) > 0f && (d6d5 = CdotAB - CdotAC) > 0f)//Note > instead of >= and < instead of <=; prevents bad denominator\n                {\n                    simplex.State = SimplexState.Segment;\n                    simplex.A = simplexB;\n                    simplex.B = simplexC;\n                    float V = d3d4 / (d3d4 + d6d5);\n\n                    Vector3 bc;\n                    Vector3.Subtract(ref C, ref B, out bc);\n                    Vector3.Multiply(ref bc, V, out point);\n                    Vector3.Add(ref point, ref B, out point);\n                    return true;\n                }\n\n\n                //On the face of the triangle.\n                simplex.State = SimplexState.Triangle;\n                simplex.A = simplexA;\n                simplex.B = simplexB;\n                simplex.C = simplexC;\n                float denom = 1f / (va + vb + vc);\n                float w = vc * denom;\n                float v = vb * denom;\n                Vector3.Multiply(ref ab, v, out point);\n                Vector3 acw;\n                Vector3.Multiply(ref ac, w, out acw);\n                Vector3.Add(ref A, ref point, out point);\n                Vector3.Add(ref point, ref acw, out point);\n                return true;\n            }\n            return false;\n        }\n\n\n\n        ///<summary>\n        /// Adds a new point to the simplex.\n        ///</summary>\n        ///<param name=\"point\">Point to add.</param>\n        ///<param name=\"hitLocation\">Current ray hit location.</param>\n        ///<param name=\"shiftedSimplex\">Simplex shifted with the hit location.</param>\n        public void AddNewSimplexPoint(ref Vector3 point, ref Vector3 hitLocation, out RaySimplex shiftedSimplex)\n        {\n            shiftedSimplex = new RaySimplex();\n            switch (State)\n            {\n                case SimplexState.Empty:\n                    State = SimplexState.Point;\n                    A = point;\n\n                    Vector3.Subtract(ref hitLocation, ref A, out shiftedSimplex.A);\n                    break;\n                case SimplexState.Point:\n                    State = SimplexState.Segment;\n                    B = point;\n\n                    Vector3.Subtract(ref hitLocation, ref A, out shiftedSimplex.A);\n                    Vector3.Subtract(ref hitLocation, ref B, out shiftedSimplex.B);\n                    break;\n                case SimplexState.Segment:\n                    State = SimplexState.Triangle;\n                    C = point;\n\n                    Vector3.Subtract(ref hitLocation, ref A, out shiftedSimplex.A);\n                    Vector3.Subtract(ref hitLocation, ref B, out shiftedSimplex.B);\n                    Vector3.Subtract(ref hitLocation, ref C, out shiftedSimplex.C);\n                    break;\n                case SimplexState.Triangle:\n                    State = SimplexState.Tetrahedron;\n                    D = point;\n\n                    Vector3.Subtract(ref hitLocation, ref A, out shiftedSimplex.A);\n                    Vector3.Subtract(ref hitLocation, ref B, out shiftedSimplex.B);\n                    Vector3.Subtract(ref hitLocation, ref C, out shiftedSimplex.C);\n                    Vector3.Subtract(ref hitLocation, ref D, out shiftedSimplex.D);\n                    break;\n            }\n            shiftedSimplex.State = State;\n        }\n\n        /// <summary>\n        /// Gets the error tolerance for the simplex.\n        /// </summary>\n        /// <param name=\"rayOrigin\">Origin of the ray.</param>\n        /// <returns>Error tolerance of the simplex.</returns>\n        public float GetErrorTolerance(ref Vector3 rayOrigin)\n        {\n            switch (State)\n            {\n                case SimplexState.Point:\n                    float distanceA;\n                    Vector3.DistanceSquared(ref A, ref rayOrigin, out distanceA);\n                    return distanceA;\n                case SimplexState.Segment:\n                    float distanceB;\n                    Vector3.DistanceSquared(ref A, ref rayOrigin, out distanceA);\n                    Vector3.DistanceSquared(ref B, ref rayOrigin, out distanceB);\n                    return MathHelper.Max(distanceA, distanceB);\n                case SimplexState.Triangle:\n                    float distanceC;\n                    Vector3.DistanceSquared(ref A, ref rayOrigin, out distanceA);\n                    Vector3.DistanceSquared(ref B, ref rayOrigin, out distanceB);\n                    Vector3.DistanceSquared(ref C, ref rayOrigin, out distanceC);\n                    return MathHelper.Max(distanceA, MathHelper.Max(distanceB, distanceC));\n                case SimplexState.Tetrahedron:\n                    float distanceD;\n                    Vector3.DistanceSquared(ref A, ref rayOrigin, out distanceA);\n                    Vector3.DistanceSquared(ref B, ref rayOrigin, out distanceB);\n                    Vector3.DistanceSquared(ref C, ref rayOrigin, out distanceC);\n                    Vector3.DistanceSquared(ref D, ref rayOrigin, out distanceD);\n                    return MathHelper.Max(distanceA, MathHelper.Max(distanceB, MathHelper.Max(distanceC, distanceD)));\n            }\n            return 0;\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/GJK/SimpleSimplex.cs",
    "content": "﻿using BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms.GJK\n{\n\n\n    ///<summary>\n    /// GJK simplex supporting boolean intersection tests.\n    ///</summary>\n    public struct SimpleSimplex\n    {\n        ///<summary>\n        /// First vertex of the simplex.\n        ///</summary>\n        public Vector3 A;\n        ///<summary>\n        /// Second vertex of the simplex.\n        ///</summary>\n        public Vector3 B;\n        ///<summary>\n        /// Third vertex of the simplex.\n        ///</summary>\n        public Vector3 C;\n        ///<summary>\n        /// Fourth vertex of the simplex.\n        ///</summary>\n        public Vector3 D;\n        ///<summary>\n        /// Current state of the simplex.\n        ///</summary>\n        public SimplexState State;\n\n        ///<summary>\n        /// Gets the point on the simplex closest to the origin.\n        ///</summary>\n        ///<param name=\"point\">Closest point to the origin.</param>\n        ///<returns>Whether or not the simplex encloses the origin.</returns>\n        public bool GetPointClosestToOrigin(out Vector3 point)\n        {\n            //This method finds the closest point on the simplex to the origin.\n            //Barycentric coordinates are assigned to the MinimumNormCoordinates as necessary to perform the inclusion calculation.\n            //If the simplex is a tetrahedron and found to be overlapping the origin, the function returns true to tell the caller to terminate.\n            //Elements of the simplex that are not used to determine the point of minimum norm are removed from the simplex.\n\n            switch (State)\n            {\n\n                case SimplexState.Point:\n                    point = A;\n                    break;\n                case SimplexState.Segment:\n                    GetPointOnSegmentClosestToOrigin(out point);\n                    break;\n                case SimplexState.Triangle:\n                    GetPointOnTriangleClosestToOrigin(out point);\n                    break;\n                case SimplexState.Tetrahedron:\n                    return GetPointOnTetrahedronClosestToOrigin(out point);\n                default:\n                    point = Toolbox.ZeroVector;\n                    break;\n\n\n            }\n            return false;\n        }\n\n        ///<summary>\n        /// Gets the closest point on the segment to the origin.\n        ///</summary>\n        ///<param name=\"point\">Closest point.</param>\n        public void GetPointOnSegmentClosestToOrigin(out Vector3 point)\n        {\n            Vector3 segmentDisplacement;\n            Vector3.Subtract(ref B, ref A, out segmentDisplacement);\n            float dotA;\n            Vector3.Dot(ref segmentDisplacement, ref A, out dotA);\n\n            //Inside segment.\n            float V = -dotA / segmentDisplacement.LengthSquared();\n\n            Vector3.Multiply(ref segmentDisplacement, V, out point);\n            Vector3.Add(ref point, ref A, out point);\n\n            //if (dotB > 0)\n            //{\n            //}\n            //else\n            //{\n            //    //It is not possible to be anywhere but within the segment in a 'boolean' GJK, where it early outs as soon as a separating axis is found.\n\n            //    //Outside B.\n            //    //Remove current A; we're becoming a point.\n            //    A = B;\n            //    State = SimplexState.Point;\n\n            //    point = A;\n            //}\n            //It can never be outside A! \n            //That would mean that the origin is LESS extreme along the search direction than our extreme point--- our search direction would not have picked that direction.\n        }\n\n        ///<summary>\n        /// Gets the closest point on the triangle to the origin.\n        ///</summary>\n        ///<param name=\"point\">Closest point.</param>\n        public void GetPointOnTriangleClosestToOrigin(out Vector3 point)\n        {\n            Vector3 ab, ac;\n            Vector3.Subtract(ref B, ref A, out ab);\n            Vector3.Subtract(ref C, ref A, out ac);\n            //The point we are comparing against the triangle is 0,0,0, so instead of storing an \"A->P\" vector,\n            //just use -A.\n            //Same for B->, C->P...\n\n            //CAN'T BE IN A'S REGION.\n\n            //CAN'T BE IN B'S REGION.\n\n            //CAN'T BE IN AB'S REGION.\n\n            //Check to see if it's outside C.\n            //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside C.\n            float d5, d6;\n            Vector3.Dot(ref ab, ref C, out d5);\n            Vector3.Dot(ref ac, ref C, out d6);\n            d5 = -d5;\n            d6 = -d6;\n            if (d6 >= 0f && d5 <= d6)\n            {\n                //It is C!\n                State = SimplexState.Point;\n                A = C;\n                point = A;\n                return;\n            }\n\n            //Check if it's outside AC.            \n            float d1, d2;\n            Vector3.Dot(ref ab, ref A, out d1);\n            Vector3.Dot(ref ac, ref A, out d2);\n            d1 = -d1;\n            d2 = -d2;\n            float vb = d5 * d2 - d1 * d6;\n            if (vb <= 0f && d2 > 0f && d6 < 0f) //Note > instead of >= and < instead of <=; prevents bad denominator\n            {\n                //Get rid of B.  Compress C into B.\n                State = SimplexState.Segment;\n                B = C;\n                float V = d2 / (d2 - d6);\n                Vector3.Multiply(ref ac, V, out point);\n                Vector3.Add(ref point, ref A, out point);\n                return;\n            }\n\n            //Check if it's outside BC.\n            float d3, d4;\n            Vector3.Dot(ref ab, ref B, out d3);\n            Vector3.Dot(ref ac, ref B, out d4);\n            d3 = -d3;\n            d4 = -d4;\n            float va = d3 * d6 - d5 * d4;\n            float d3d4;\n            float d6d5;\n            if (va <= 0f && (d3d4 = d4 - d3) > 0f && (d6d5 = d5 - d6) > 0f)//Note > instead of >= and < instead of <=; prevents bad denominator\n            {\n                //Throw away A.  C->A.\n                //TODO: Does B->A, C->B work better?\n                State = SimplexState.Segment;\n                A = C;\n                float U = d3d4 / (d3d4 + d6d5);\n\n                Vector3 bc;\n                Vector3.Subtract(ref C, ref B, out bc);\n                Vector3.Multiply(ref bc, U, out point);\n                Vector3.Add(ref point, ref B, out point);\n                return;\n            }\n\n\n            //On the face of the triangle.\n            float vc = d1 * d4 - d3 * d2;\n            float denom = 1f / (va + vb + vc);\n            float v = vb * denom;\n            float w = vc * denom;\n\n            Vector3.Multiply(ref ab, v, out point);\n            Vector3 acw;\n            Vector3.Multiply(ref ac, w, out acw);\n            Vector3.Add(ref A, ref point, out point);\n            Vector3.Add(ref point, ref acw, out point);\n\n\n\n\n        }\n\n        ///<summary>\n        /// Gets the closest point on the tetrahedron to the origin.\n        ///</summary>\n        ///<param name=\"point\">Closest point.</param>\n        ///<returns>Whether or not the simplex encloses the origin.</returns>\n        public bool GetPointOnTetrahedronClosestToOrigin(out Vector3 point)\n        {\n            //Thanks to the fact that D is new and that we know that the origin is within the extruded\n            //triangular prism of ABC (and on the \"D\" side of ABC),\n            //we can immediately ignore voronoi regions:\n            //A, B, C, AC, AB, BC, ABC\n            //and only consider:\n            //D, DA, DB, DC, DAC, DCB, DBA\n\n            //There is some overlap of calculations in this method, since DAC, DCB, and DBA are tested fully.\n\n            SimpleSimplex minimumSimplex = new SimpleSimplex();\n            point = new Vector3();\n            float minimumDistance = float.MaxValue;\n\n\n            SimpleSimplex candidate;\n            float candidateDistance;\n            Vector3 candidatePoint;\n            if (TryTetrahedronTriangle(ref A, ref C, ref D, ref B, out candidate, out candidatePoint))\n            {\n                point = candidatePoint;\n                minimumSimplex = candidate;\n                minimumDistance = candidatePoint.LengthSquared();\n            }\n\n            if (TryTetrahedronTriangle(ref C, ref B, ref D, ref A, out candidate, out candidatePoint) &&\n                (candidateDistance = candidatePoint.LengthSquared()) < minimumDistance)\n            {\n                point = candidatePoint;\n                minimumSimplex = candidate;\n                minimumDistance = candidateDistance;\n            }\n\n            if (TryTetrahedronTriangle(ref B, ref A, ref D, ref C, out candidate, out candidatePoint) &&\n                (candidateDistance = candidatePoint.LengthSquared()) < minimumDistance)\n            {\n                point = candidatePoint;\n                minimumSimplex = candidate;\n                minimumDistance = candidateDistance;\n            }\n\n            if (minimumDistance < float.MaxValue)\n            {\n                this = minimumSimplex;\n                return false;\n            }\n            return true;\n        }\n\n        private static bool TryTetrahedronTriangle(ref Vector3 A, ref Vector3 B, ref Vector3 C, \n                                                   ref Vector3 otherPoint, out SimpleSimplex simplex, out Vector3 point)\n        {\n            //Note that there may be some extra terms that can be removed from this process.\n            //Some conditions could use less parameters, since it is known that the origin\n            //is not 'behind' BC or AC.\n\n            simplex = new SimpleSimplex();\n            point = new Vector3();\n\n\n            Vector3 ab, ac;\n            Vector3.Subtract(ref B, ref A, out ab);\n            Vector3.Subtract(ref C, ref A, out ac);\n            Vector3 normal;\n            Vector3.Cross(ref ab, ref ac, out normal);\n            float AdotN, ADdotN;\n            Vector3 AD;\n            Vector3.Subtract(ref otherPoint, ref A, out AD);\n            Vector3.Dot(ref A, ref normal, out AdotN);\n            Vector3.Dot(ref AD, ref normal, out ADdotN);\n\n            //If (-A * N) * (AD * N) < 0, D and O are on opposite sides of the triangle.\n            if (AdotN * ADdotN > 0)\n            {\n                //The point we are comparing against the triangle is 0,0,0, so instead of storing an \"A->P\" vector,\n                //just use -A.\n                //Same for B->, C->P...\n\n                //CAN'T BE IN A'S REGION.\n\n                //CAN'T BE IN B'S REGION.\n\n                //CAN'T BE IN AB'S REGION.\n\n                //Check to see if it's outside C.\n                //TODO: Note that in a boolean-style GJK, it shouldn't be possible to be outside C.\n                float CdotAB, CdotAC;\n                Vector3.Dot(ref ab, ref C, out CdotAB);\n                Vector3.Dot(ref ac, ref C, out CdotAC);\n                CdotAB = -CdotAB;\n                CdotAC = -CdotAC;\n                if (CdotAC >= 0f && CdotAB <= CdotAC)\n                {\n                    //It is C!\n                    simplex.State = SimplexState.Point;\n                    simplex.A = C;\n                    point = C;\n                    return true;\n                }\n\n                //Check if it's outside AC.            \n                float AdotAB, AdotAC;\n                Vector3.Dot(ref ab, ref A, out AdotAB);\n                Vector3.Dot(ref ac, ref A, out AdotAC);\n                AdotAB = -AdotAB;\n                AdotAC = -AdotAC;\n                float vb = CdotAB * AdotAC - AdotAB * CdotAC;\n                if (vb <= 0f && AdotAC > 0f && CdotAC < 0f) //Note > instead of >= and < instead of <=; prevents bad denominator\n                {\n                    simplex.State = SimplexState.Segment;\n                    simplex.A = A;\n                    simplex.B = C;\n                    float V = AdotAC / (AdotAC - CdotAC);\n\n                    Vector3.Multiply(ref ac, V, out point);\n                    Vector3.Add(ref point, ref A, out point);\n                    return true;\n                }\n\n                //Check if it's outside BC.\n                float BdotAB, BdotAC;\n                Vector3.Dot(ref ab, ref B, out BdotAB);\n                Vector3.Dot(ref ac, ref B, out BdotAC);\n                BdotAB = -BdotAB;\n                BdotAC = -BdotAC;\n                float va = BdotAB * CdotAC - CdotAB * BdotAC;\n                float d3d4;\n                float d6d5;\n                if (va <= 0f && (d3d4 = BdotAC - BdotAB) > 0f && (d6d5 = CdotAB - CdotAC) > 0f)//Note > instead of >= and < instead of <=; prevents bad denominator\n                {\n                    simplex.State = SimplexState.Segment;\n                    simplex.A = B;\n                    simplex.B = C;\n                    float V = d3d4 / (d3d4 + d6d5);\n\n                    Vector3 bc;\n                    Vector3.Subtract(ref C, ref B, out bc);\n                    Vector3.Multiply(ref bc, V, out point);\n                    Vector3.Add(ref point, ref B, out point);\n                    return true;\n                }\n\n\n                //On the face of the triangle.\n                float vc = AdotAB * BdotAC - BdotAB * AdotAC;\n                simplex.A = A;\n                simplex.B = B;\n                simplex.C = C;\n                simplex.State = SimplexState.Triangle;\n                float denom = 1f / (va + vb + vc);\n                float w = vc * denom;\n                float v = vb * denom;\n\n                Vector3.Multiply(ref ab, v, out point);\n                Vector3 acw;\n                Vector3.Multiply(ref ac, w, out acw);\n                Vector3.Add(ref A, ref point, out point);\n                Vector3.Add(ref point, ref acw, out point);\n                return true;\n            }\n            return false;\n        }\n\n\n\n\n\n        ///<summary>\n        /// Adds a new point to the simplex.\n        ///</summary>\n        ///<param name=\"point\">Point to add.</param>\n        public void AddNewSimplexPoint(ref Vector3 point)\n        {\n            switch (State)\n            {\n                case SimplexState.Empty:\n                    State = SimplexState.Point;\n                    A = point;\n                    break;\n                case SimplexState.Point:\n                    State = SimplexState.Segment;\n                    B = point;\n                    break;\n                case SimplexState.Segment:\n                    State = SimplexState.Triangle;\n                    C = point;\n                    break;\n                case SimplexState.Triangle:\n                    State = SimplexState.Tetrahedron;\n                    D = point;\n                    break;\n            }\n        }\n\n        ///<summary>\n        /// Gets the error tolerance of the simplex.\n        ///</summary>\n        ///<returns>Error tolerance of the simplex.</returns>\n        public float GetErrorTolerance()\n        {\n            switch (State)\n            {\n                case SimplexState.Point:\n                    return A.LengthSquared();\n                case SimplexState.Segment:\n                    return MathHelper.Max(A.LengthSquared(), B.LengthSquared());\n                case SimplexState.Triangle:\n                    return MathHelper.Max(A.LengthSquared(), MathHelper.Max(B.LengthSquared(), C.LengthSquared()));\n                case SimplexState.Tetrahedron:\n                    return MathHelper.Max(A.LengthSquared(), MathHelper.Max(B.LengthSquared(), MathHelper.Max(C.LengthSquared(), D.LengthSquared())));\n            }\n            return 1;\n        }\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/GeneralConvexPairTester.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms\n{\n    ///<summary>\n    /// Tests convex shapes against other convex shapes for contact generation.\n    ///</summary>\n    public class GeneralConvexPairTester\n    {\n        //TODO: warmstarted calculations like those within this tester will carry over bad information if the shape of an object is changed.\n        //Need to notify the system to take appropriate action when a shape changes...\n\n        ///<summary>\n        /// Whether or not to use simplex caching in general case convex-convex collisions.\n        /// This will improve performance in simulations relying on the general case system, \n        /// but may decrease quality of behavior for curved shapes.\n        ///</summary>\n        public static bool UseSimplexCaching;\n        private CollisionState state = CollisionState.Separated;\n        private CollisionState previousState = CollisionState.Separated;\n\n        Vector3 localSeparatingAxis;\n        CachedSimplex cachedSimplex;\n\n        protected internal ConvexCollidable collidableA;\n        protected internal ConvexCollidable collidableB;\n\n        ///<summary>\n        /// Gets the first collidable in the pair.\n        ///</summary>\n        public ConvexCollidable CollidableA\n        {\n            get\n            {\n                return collidableA;\n            }\n        }\n        ///<summary>\n        /// Gets the second collidable in the pair.\n        ///</summary>\n        public ConvexCollidable CollidableB\n        {\n            get\n            {\n                return collidableB;\n            }\n        }\n\n\n        ///<summary>\n        /// Generates a contact between the objects, if possible.\n        ///</summary>\n        ///<param name=\"contact\">Contact created between the pair, if possible.</param>\n        ///<returns>Whether or not the objects were colliding.</returns>\n        public bool GenerateContactCandidate(out ContactData contact)\n        {\n            //Generate contacts.  This will just find one closest point using general supportmapping based systems like MPR and GJK.\n\n            //The collision system moves through a state machine depending on the latest collision generation result.\n            //At first, assume that the pair is completely separating.  This is almost always the correct guess for new pairs.\n            //An extremely fast, warm-startable boolean GJK test can be performed.  If it returns with nonintersection, we can quit and do nothing.\n            //If the initial boolean GJK test finds intersection, move onto a shallow contact test.\n            //The shallow contact test is a different kind of GJK test that finds the closest points between the shape pair.  It's not as speedy as the boolean version.\n            //The algorithm is run between the marginless versions of the shapes, so that the closest points will form a contact somewhere in the space separating the cores.\n            //If the closest point system finds no intersection and returns the closest points, the state is changed to ShallowContact.\n            //If the closest point system finds intersection of the core shapes, then the state is changed to DeepContact, and MPR is run to determine contact information.\n            //The system tries to escape from deep contact to shallow contact, and from shallow contact to separated whenever possible.\n\n            //Here's the state flow:\n            //On Separated: BooleanGJK\n            //  -Intersecting -> Go to ShallowContact.\n            //  -Nonintersecting -> Do nothing.\n            //On ShallowContact: ClosestPointsGJK\n            //  -Intersecting -> Go to DeepContact.\n            //  -Nonintersecting: Go to Separated (without test) if squared distance > margin squared, otherwise use closest points to make contact.\n            //On DeepContact: MPR\n            //  -Intersecting -> Go to ShallowContact if penetration depth < margin\n            //  -Nonintersecting -> This case is rare, but not impossible.  Go to Separated (without test).\n\n            previousState = state;\n            switch (state)\n            {\n                case CollisionState.Separated:\n                    if (GJKToolbox.AreShapesIntersecting(collidableA.Shape, collidableB.Shape, ref collidableA.worldTransform, ref collidableB.worldTransform, ref localSeparatingAxis))\n                    {\n                        state = CollisionState.ShallowContact;\n                        return DoShallowContact(out contact);\n                    }\n                    contact = new ContactData();\n                    return false;\n                case CollisionState.ShallowContact:\n                    return DoShallowContact(out contact);\n                case CollisionState.DeepContact:\n                    return DoDeepContact(out contact);\n            }\n\n            contact = new ContactData();\n            return false;\n        }\n\n        private bool DoShallowContact(out ContactData contact)\n        {\n            Vector3 closestA, closestB;\n\n            //RigidTransform transform = RigidTransform.Identity;\n            //Vector3 closestAnew, closestBnew;\n            //CachedSimplex cachedTest = cachedSimplex;\n            //bool intersecting = GJKToolbox.GetClosestPoints(informationA.Shape, informationB.Shape, ref informationA.worldTransform, ref informationB.worldTransform, ref cachedTest, out closestAnew, out closestBnew);\n\n            ////bool otherIntersecting = OldGJKVerifier.GetClosestPointsBetweenObjects(informationA.Shape, informationB.Shape, ref informationA.worldTransform, ref informationB.worldTransform, 0, 0, out closestA, out closestB);\n            //bool otherIntersecting = GJKToolbox.GetClosestPoints(informationA.Shape, informationB.Shape, ref informationA.worldTransform, ref informationB.worldTransform, out closestA, out closestB);\n\n            //Vector3 closestAold, closestBold;\n            //bool oldIntersecting = OldGJKVerifier.GetClosestPointsBetweenObjects(informationA.Shape, informationB.Shape, ref informationA.worldTransform, ref informationB.worldTransform, 0, 0, out closestAold, out closestBold);\n\n            //if (otherIntersecting != intersecting || (!otherIntersecting && !intersecting &&\n            //    Vector3.DistanceSquared(closestAnew, closestBnew) - Vector3.DistanceSquared(closestA, closestB) > .0001f &&\n            //    (Vector3.DistanceSquared(closestA, closestAnew) > .0001f ||\n            //    Vector3.DistanceSquared(closestB, closestBnew) > .0001f)))// ||\n            //    //Math.Abs(Vector3.Dot(closestB - closestA, closestBnew - closestAnew) - Vector3.Dot(closestB - closestA, closestB - closestA)) > Toolbox.Epsilon)))\n            //    Debug.WriteLine(\"Break.\");\n\n            //Vector3 sub;\n            //Vector3.Subtract(ref closestA, ref closestB, out sub);\n            //if (sub.LengthSquared() < Toolbox.Epsilon)\n\n            if (UseSimplexCaching)\n                GJKToolbox.GetClosestPoints(collidableA.Shape, collidableB.Shape, ref collidableA.worldTransform, ref collidableB.worldTransform, ref cachedSimplex, out closestA, out closestB);\n            else\n            {\n                //The initialization of the pair creates a pretty decent simplex to start from.\n                //Just don't try to update it.\n                CachedSimplex preInitializedSimplex = cachedSimplex;\n                GJKToolbox.GetClosestPoints(collidableA.Shape, collidableB.Shape, ref collidableA.worldTransform, ref collidableB.worldTransform, ref preInitializedSimplex, out closestA, out closestB);\n            }\n            \n            Vector3 displacement;\n            Vector3.Subtract(ref closestB, ref closestA, out displacement);\n            float distanceSquared = displacement.LengthSquared();\n\n            if (distanceSquared < Toolbox.Epsilon)\n            {\n                state = CollisionState.DeepContact;\n                return DoDeepContact(out contact);\n            }\n\n            localDirection = displacement; //Use this as the direction for future deep contacts.\n            float margin = collidableA.Shape.collisionMargin + collidableB.Shape.collisionMargin;\n\n\n            if (distanceSquared < margin * margin)\n            {\n                //Generate a contact.\n                contact = new ContactData();\n                //Displacement is from A to B.  point = A + t * AB, where t = marginA / margin.\n                if (margin > Toolbox.Epsilon) //Avoid a NaN!\n                    Vector3.Multiply(ref displacement, collidableA.Shape.collisionMargin / margin, out contact.Position); //t * AB\n                else\n                    contact.Position = new Vector3();\n\n                Vector3.Add(ref closestA, ref contact.Position, out contact.Position); //A + t * AB.\n\n                contact.Normal = displacement;\n                float distance = (float)Math.Sqrt(distanceSquared);\n                Vector3.Divide(ref contact.Normal, distance, out contact.Normal);\n                contact.PenetrationDepth = margin - distance;\n                return true;\n\n            }\n            //Too shallow to make a contact- move back to separation.\n            state = CollisionState.Separated;\n            contact = new ContactData();\n            return false;\n        }\n\n        Vector3 localDirection;\n        private bool DoDeepContact(out ContactData contact)\n        {\n           \n            #region Informed search\n            if (previousState == CollisionState.Separated) //If it was shallow before, then its closest points will be used to find the normal.\n            {\n                //It's overlapping! Find the relative velocity at the point relative to the two objects.  The point is still in local space!\n                //Vector3 velocityA;\n                //Vector3.Cross(ref contact.Position, ref collidableA.entity.angularVelocity, out velocityA);\n                //Vector3.Add(ref velocityA, ref collidableA.entity.linearVelocity, out velocityA);\n                //Vector3 velocityB;\n                //Vector3.Subtract(ref contact.Position, ref localTransformB.Position, out velocityB);\n                //Vector3.Cross(ref velocityB, ref collidableB.entity.angularVelocity, out velocityB);\n                //Vector3.Add(ref velocityB, ref collidableB.entity.linearVelocity, out velocityB);\n                ////The velocity is negated because the direction so point backwards along the velocity.\n                //Vector3.Subtract(ref velocityA, ref velocityB, out localDirection);\n\n                //The above takes into account angular velocity, but linear velocity alone is a lot more stable and does the job just fine.\n                if (collidableA.entity != null && collidableB.entity != null)\n                    Vector3.Subtract(ref collidableA.entity.linearVelocity, ref collidableB.entity.linearVelocity, out localDirection);\n                else\n                    localDirection = localSeparatingAxis;\n\n                if (localDirection.LengthSquared() < Toolbox.Epsilon)\n                {\n                    localDirection = Vector3.Up;\n                }\n\n            }\n            if (MPRToolbox.GetContact(collidableA.Shape, collidableB.Shape, ref collidableA.worldTransform, ref collidableB.worldTransform, ref localDirection, out contact))\n            {\n                if (contact.PenetrationDepth < collidableA.Shape.collisionMargin + collidableB.Shape.collisionMargin)\n                    state = CollisionState.ShallowContact;\n                return true;\n            }\n            //This is rare, but could happen.\n            state = CollisionState.Separated;\n            return false;\n\n            //if (MPRTesting.GetLocalOverlapPosition(collidableA.Shape, collidableB.Shape, ref localTransformB, out contact.Position))\n            //{\n\n\n            //    //First, try to use the heuristically found direction.  This comes from either the GJK shallow contact separating axis or from the relative velocity.\n            //    Vector3 rayCastDirection;\n            //    float lengthSquared = localDirection.LengthSquared();\n            //    if (lengthSquared > Toolbox.Epsilon)\n            //    {\n            //        Vector3.Divide(ref localDirection, (float)Math.Sqrt(lengthSquared), out rayCastDirection);// (Vector3.Normalize(localDirection) + Vector3.Normalize(collidableB.worldTransform.Position - collidableA.worldTransform.Position)) / 2;\n            //        MPRTesting.LocalSurfaceCast(collidableA.Shape, collidableB.Shape, ref localTransformB, ref rayCastDirection, out contact.PenetrationDepth, out contact.Normal);\n            //    }\n            //    else\n            //    {\n            //        contact.PenetrationDepth = float.MaxValue;\n            //        contact.Normal = Toolbox.UpVector;\n            //    }\n            //    //Try the offset between the origins as a second option.  Sometimes this is a better choice than the relative velocity.\n            //    //TODO: Could use the position-finding MPR iteration to find the A-B direction hit by continuing even after the origin has been found (optimization).\n            //    Vector3 normalCandidate;\n            //    float depthCandidate;\n            //    lengthSquared = localTransformB.Position.LengthSquared();\n            //    if (lengthSquared > Toolbox.Epsilon)\n            //    {\n            //        Vector3.Divide(ref localTransformB.Position, (float)Math.Sqrt(lengthSquared), out rayCastDirection);\n            //        MPRTesting.LocalSurfaceCast(collidableA.Shape, collidableB.Shape, ref localTransformB, ref rayCastDirection, out depthCandidate, out normalCandidate);\n            //        if (depthCandidate < contact.PenetrationDepth)\n            //        {\n            //            contact.Normal = normalCandidate;\n            //        }\n            //    }\n\n\n            //    //Correct the penetration depth.\n            //    MPRTesting.LocalSurfaceCast(collidableA.Shape, collidableB.Shape, ref localTransformB, ref contact.Normal, out contact.PenetrationDepth, out rayCastDirection);\n\n\n            //    ////The local casting can optionally continue.  Eventually, it will converge to the local minimum.\n            //    //while (true)\n            //    //{\n            //    //    MPRTesting.LocalSurfaceCast(collidableA.Shape, collidableB.Shape, ref localTransformB, ref contact.Normal, out depthCandidate, out normalCandidate);\n            //    //    if (contact.PenetrationDepth - depthCandidate <= Toolbox.BigEpsilon)\n            //    //        break;\n\n            //    //    contact.PenetrationDepth = depthCandidate;\n            //    //    contact.Normal = normalCandidate;\n            //    //}\n\n            //    contact.Id = -1;\n            //    //we're still in local space! transform it all back.\n            //    Matrix3X3 orientation;\n            //    Matrix3X3.CreateFromQuaternion(ref collidableA.worldTransform.Orientation, out orientation);\n            //    Matrix3X3.Transform(ref contact.Normal, ref orientation, out contact.Normal);\n            //    //Vector3.Negate(ref contact.Normal, out contact.Normal);\n            //    Matrix3X3.Transform(ref contact.Position, ref orientation, out contact.Position);\n            //    Vector3.Add(ref contact.Position, ref collidableA.worldTransform.Position, out contact.Position);\n            //    if (contact.PenetrationDepth < collidableA.Shape.collisionMargin + collidableB.Shape.collisionMargin)\n            //        state = CollisionState.ShallowContact;\n            //    return true;\n            //}\n\n            ////This is rare, but could happen.\n            //state = CollisionState.Separated;\n            //contact = new ContactData();\n            //return false;\n            #endregion\n\n            #region Testing\n            //RigidTransform localTransformB;\n            //MinkowskiToolbox.GetLocalTransform(ref collidableA.worldTransform, ref collidableB.worldTransform, out localTransformB); \n            //contact.Id = -1;\n            //if (MPRTesting.GetLocalOverlapPosition(collidableA.Shape, collidableB.Shape, ref localTransformB, out contact.Position))\n            //{\n            //    Vector3 rayCastDirection = localTransformB.Position;\n            //    MPRTesting.LocalSurfaceCast(collidableA.Shape, collidableB.Shape, ref localTransformB, ref rayCastDirection, out contact.PenetrationDepth, out contact.Normal);\n            //    MPRTesting.LocalSurfaceCast(collidableA.Shape, collidableB.Shape, ref localTransformB, ref contact.Normal, out contact.PenetrationDepth, out rayCastDirection);\n            //    RigidTransform.Transform(ref contact.Position, ref collidableA.worldTransform, out contact.Position);\n            //    Vector3.Transform(ref contact.Normal, ref collidableA.worldTransform.Orientation, out contact.Normal);\n            //    return true;\n            //}\n            //contact.Normal = new Vector3();\n            //contact.PenetrationDepth = 0;\n            //return false;\n            #endregion\n\n            #region v0.15.2 and before\n            //if (MPRToolbox.AreObjectsColliding(collidableA.Shape, collidableB.Shape, ref collidableA.worldTransform, ref collidableB.worldTransform, out contact))\n            //{\n            //    if (contact.PenetrationDepth < collidableA.Shape.collisionMargin + collidableB.Shape.collisionMargin)\n            //        state = CollisionState.ShallowContact; //If it's emerged from the deep contact, we can go back to using the preferred GJK method.\n            //    return true;\n            //}\n            ////This is rare, but could happen.\n            //state = CollisionState.Separated;\n            //return false;\n            #endregion\n\n        }\n\n        ///<summary>\n        /// Initializes the pair tester.\n        ///</summary>\n        ///<param name=\"shapeA\">First shape in the pair.</param>\n        ///<param name=\"shapeB\">Second shape in the pair.</param>\n        public void Initialize(Collidable shapeA, Collidable shapeB)\n        {\n            collidableA = (ConvexCollidable)shapeA;\n            collidableB = (ConvexCollidable)shapeB;\n            cachedSimplex = new CachedSimplex { State = SimplexState.Point };// new CachedSimplex(informationA.Shape, informationB.Shape, ref informationA.worldTransform, ref informationB.worldTransform);\n        }\n\n        ///<summary>\n        /// Cleans up the pair tester.\n        ///</summary>\n        public void CleanUp()\n        {\n            state = CollisionState.Separated;\n            previousState = CollisionState.Separated;\n            cachedSimplex = new CachedSimplex();\n            localSeparatingAxis = new Vector3();\n            collidableA = null;\n            collidableB = null;\n        }\n\n\n        enum CollisionState\n        {\n            Separated,\n            ShallowContact,\n            DeepContact\n        }\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/MPRToolbox.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing System.Diagnostics;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms\n{\n    /// <summary>\n    /// Contains a variety of queries and computation methods that make use of minkowski portal refinement.\n    /// </summary>\n    public static class MPRToolbox\n    {\n        //TODO: Lots of nasty code repeat.\n        //The common phases of portal construction, correction, and refinement are implemented with subtle differences.\n        //With some effort, they could be shoved together.\n\n        /// <summary>\n        /// Number of iterations that the MPR system will run in its inner loop before giving up and returning with failure.\n        /// </summary>\n        public static int InnerIterationLimit = 15;\n        /// <summary>\n        /// Number of iterations that the MPR system will run in its outer loop before giving up and moving on to its inner loop.\n        /// </summary>\n        public static int OuterIterationLimit = 15;\n\n        private static float surfaceEpsilon = 1e-7f;\n        /// <summary>\n        /// Gets or sets how close surface-finding based MPR methods have to get before exiting.\n        /// Defaults to 1e-7.\n        /// </summary>\n        public static float SurfaceEpsilon\n        {\n            get\n            {\n                return surfaceEpsilon;\n            }\n            set\n            {\n                if (value > 0)\n                    surfaceEpsilon = value;\n                else throw new ArgumentException(\"Epsilon must be positive.\");\n\n            }\n        }\n\n        private static float depthRefinementEpsilon = 1e-4f;\n        /// <summary>\n        /// Gets or sets how close the penetration depth refinement system should converge before quitting.\n        /// Making this smaller can help more precisely find a local minimum at the cost of performance.\n        /// The change will likely only be visible on curved shapes, since polytopes will converge extremely rapidly to a precise local minimum.\n        /// Defaults to 1e-4.\n        /// </summary>\n        public static float DepthRefinementEpsilon\n        {\n            get\n            {\n                return depthRefinementEpsilon;\n            }\n            set\n            {\n                if (value > 0)\n                    depthRefinementEpsilon = value;\n                else throw new ArgumentException(\"Epsilon must be positive.\");\n\n            }\n        }\n\n        private static float rayCastSurfaceEpsilon = 1e-9f;\n        /// <summary>\n        /// Gets or sets how close surface-finding ray casts have to get before exiting.\n        /// Defaults to 1e-9.\n        /// </summary>\n        public static float RayCastSurfaceEpsilon\n        {\n            get\n            {\n                return rayCastSurfaceEpsilon;\n            }\n            set\n            {\n                if (value > 0)\n                    rayCastSurfaceEpsilon = value;\n                else\n                    throw new ArgumentException(\"Epsilon must be positive.\");\n            }\n        }\n\n        private static int maximumDepthRefinementIterations = 3;\n        /// <summary>\n        /// Gets or sets the maximum number of iterations to use to reach the local penetration depth minimum when using the RefinePenetration function.\n        /// Increasing this allows the system to work longer to find local penetration minima.\n        /// The change will likely only be visible on curved shapes, since polytopes will converge extremely rapidly to a precise local minimum.\n        /// Defaults to 3.\n        /// </summary>\n        public static int MaximumDepthRefinementIterations\n        {\n            get\n            {\n                return maximumDepthRefinementIterations;\n            }\n            set\n            {\n                if (value > 0)\n                    maximumDepthRefinementIterations = value;\n                else throw new ArgumentException(\"Iteration count must be positive.\");\n            }\n        }\n\n        /// <summary>\n        /// Gets a world space point in the overlapped volume between two shapes.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape in the pair.</param>\n        /// <param name=\"shapeB\">Second shape in the pair.</param>\n        /// <param name=\"transformA\">Transformation to apply to the first shape.</param>\n        /// <param name=\"transformB\">Transformation to apply to the second shape.</param>\n        /// <param name=\"position\">Position within the overlapped volume of the two shapes, if any.</param>\n        /// <returns>Whether or not the two shapes overlap.</returns>\n        public static bool GetOverlapPosition(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform transformA, ref RigidTransform transformB, out Vector3 position)\n        {\n            RigidTransform localTransformB;\n            MinkowskiToolbox.GetLocalTransform(ref transformA, ref transformB, out localTransformB);\n            bool toReturn = GetLocalOverlapPosition(shapeA, shapeB, ref localTransformB, out position);\n            RigidTransform.Transform(ref position, ref transformA, out position);\n            return toReturn;\n\n        }\n\n\n        /// <summary>\n        /// Gets a point in the overlapped volume between two shapes in shape A's local space.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape in the pair.</param>\n        /// <param name=\"shapeB\">Second shape in the pair.</param>\n        /// <param name=\"position\">Position within the overlapped volume of the two shapes in shape A's local space, if any.</param>\n        /// <returns>Whether or not the two shapes overlap.</returns>\n        public static bool GetLocalOverlapPosition(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform localTransformB, out Vector3 position)\n        {\n            return GetLocalOverlapPosition(shapeA, shapeB, ref localTransformB.Position, ref localTransformB, out position);\n        }\n\n        internal static bool GetLocalOverlapPosition(ConvexShape shapeA, ConvexShape shapeB, ref Vector3 originRay, ref RigidTransform localTransformB, out Vector3 position)\n        {\n            //Compute the origin ray.  This points from a point known to be inside the minkowski sum to the origin.\n            //The centers of the shapes are used to create the interior point.\n\n            //It's possible that the two objects' centers are overlapping, or very very close to it.  In this case, \n            //they are obviously colliding and we can immediately exit.\n            if (originRay.LengthSquared() < Toolbox.Epsilon)\n            {\n                position = new Vector3();\n                //DEBUGlastPosition = position;\n                return true;\n            }\n\n            Vector3 v0;\n            Vector3.Negate(ref originRay, out v0); //Since we're in A's local space, A-B is just -B.\n\n\n\n            //Now that the origin ray is known, create a portal through which the ray passes.\n            //To do this, first guess a portal.\n            //This implementation is similar to that of the original XenoCollide.\n            //'n' will be the direction used to find supports throughout the algorithm.\n            Vector3 n = originRay;\n            Vector3 v1;\n            Vector3 v1A, v1B; //extreme point contributions from each shape.  Used later to compute contact position; could be used to cache simplex too.\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v1A, out v1B, out v1);\n\n            //Find another extreme point in a direction perpendicular to the previous.\n            Vector3 v2;\n            Vector3 v2A, v2B;\n            Vector3.Cross(ref v1, ref v0, out n);\n            if (n.LengthSquared() < Toolbox.Epsilon)\n            {\n                //v1 and v0 could be parallel.\n                //This isn't a bad thing- it means the direction is exactly aligned with the extreme point offset.\n                //In other words, if the raycast is followed out to the surface, it will arrive at the extreme point!\n                //If the origin is further along this direction than the extreme point, then there is no intersection.\n                //If the origin is within this extreme point, then there is an intersection.\n                float dot;\n                Vector3.Dot(ref v1, ref originRay, out dot);\n                if (dot < 0)\n                {\n                    //Origin is outside.\n                    position = new Vector3();\n                    return false;\n                }\n                //Origin is inside.\n                //Compute barycentric coordinates along simplex (segment).\n                float dotv0;\n                //Dot > 0, so dotv0 starts out negative.\n                Vector3.Dot(ref v0, ref originRay, out dotv0);\n                float barycentricCoordinate = -dotv0 / (dot - dotv0);\n                //Vector3.Subtract(ref v1A, ref v0A, out offset); //'v0a' is just the zero vector, so there's no need to calculate the offset.\n                Vector3.Multiply(ref v1A, barycentricCoordinate, out position);\n                return true;\n            }\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v2A, out v2B, out v2);\n\n            Vector3 temp1, temp2;\n            //Set n for the first iteration.\n            Vector3.Subtract(ref v1, ref v0, out temp1);\n            Vector3.Subtract(ref v2, ref v0, out temp2);\n            Vector3.Cross(ref temp1, ref temp2, out n);\n\n\n            Vector3 v3A, v3B, v3;\n            int count = 0;\n            while (true)\n            {\n                //Find a final extreme point using the normal of the plane defined by v0, v1, v2.\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v3A, out v3B, out v3);\n\n                if (count > MPRToolbox.OuterIterationLimit)\n                    break;\n                count++;\n                //By now, the simplex is a tetrahedron, but it is not known whether or not the origin ray found earlier actually passes through the portal\n                //defined by v1, v2, v3.\n\n                // If the origin is outside the plane defined by v1,v0,v3, then the portal is invalid.\n                Vector3.Cross(ref v1, ref v3, out temp1);\n                float dot;\n                Vector3.Dot(ref temp1, ref v0, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v2) with the new extreme point.\n                    v2 = v3;\n                    v2A = v3A;\n                    v2B = v3B;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Subtract(ref v1, ref v0, out temp1);\n                    Vector3.Subtract(ref v3, ref v0, out temp2);\n                    Vector3.Cross(ref temp1, ref temp2, out n);\n                    continue;\n                }\n\n                // If the origin is outside the plane defined by v3,v0,v2, then the portal is invalid.\n                Vector3.Cross(ref v3, ref v2, out temp1);\n                Vector3.Dot(ref temp1, ref v0, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v1) with the new extreme point.\n                    v1 = v3;\n                    v1A = v3A;\n                    v1B = v3B;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Subtract(ref v2, ref v0, out temp1);\n                    Vector3.Subtract(ref v3, ref v0, out temp2);\n                    Vector3.Cross(ref temp1, ref temp2, out n);\n                    continue;\n                }\n                break;\n            }\n\n            //if (!VerifySimplex(ref v0, ref v1, ref v2, ref v3, ref localPoint.Position))\n            //    Debug.WriteLine(\"Break.\");\n\n\n            // Refine the portal.\n            while (true)\n            {\n                //Test the origin against the plane defined by v1, v2, v3.  If it's inside, we're done.\n                //Compute the outward facing normal.\n                Vector3.Subtract(ref v3, ref v2, out temp1);\n                Vector3.Subtract(ref v1, ref v2, out temp2);\n                Vector3.Cross(ref temp1, ref temp2, out n);\n                float dot;\n                Vector3.Dot(ref n, ref v1, out dot);\n                if (dot >= 0)\n                {\n                    Vector3 temp3;\n                    //Compute the barycentric coordinates of the origin.\n                    //This is done by computing the scaled volume (parallelepiped) of the tetrahedra \n                    //formed by each triangle of the v0v1v2v3 tetrahedron and the origin.\n\n                    //TODO: consider a different approach using T parameter or something.\n                    Vector3.Subtract(ref v1, ref v0, out temp1);\n                    Vector3.Subtract(ref v2, ref v0, out temp2);\n                    Vector3.Subtract(ref v3, ref v0, out temp3);\n\n                    Vector3 cross;\n                    Vector3.Cross(ref temp1, ref temp2, out cross);\n                    float v0v1v2v3volume;\n                    Vector3.Dot(ref cross, ref temp3, out v0v1v2v3volume);\n\n                    Vector3.Cross(ref v1, ref v2, out cross);\n                    float ov1v2v3volume;\n                    Vector3.Dot(ref cross, ref v3, out ov1v2v3volume);\n\n                    Vector3.Cross(ref originRay, ref temp2, out cross);\n                    float v0ov2v3volume;\n                    Vector3.Dot(ref cross, ref temp3, out v0ov2v3volume);\n\n                    Vector3.Cross(ref temp1, ref originRay, out cross);\n                    float v0v1ov3volume;\n                    Vector3.Dot(ref cross, ref temp3, out v0v1ov3volume);\n\n                    if (v0v1v2v3volume > Toolbox.Epsilon * .01f)\n                    {\n                        float inverseTotalVolume = 1 / v0v1v2v3volume;\n                        float v0Weight = ov1v2v3volume * inverseTotalVolume;\n                        float v1Weight = v0ov2v3volume * inverseTotalVolume;\n                        float v2Weight = v0v1ov3volume * inverseTotalVolume;\n                        float v3Weight = 1 - v0Weight - v1Weight - v2Weight;\n                        position = v1Weight * v1A + v2Weight * v2A + v3Weight * v3A;\n                    }\n                    else\n                    {\n                        position = new Vector3();\n                    }\n                    //DEBUGlastPosition = position;\n                    return true;\n                }\n\n                //We haven't yet found the origin.  Find the support point in the portal's outward facing direction.\n                Vector3 v4, v4A, v4B;\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v4A, out v4B, out v4);\n                //If the origin is further along the direction than the extreme point, it's not inside the shape.\n                float dot2;\n                Vector3.Dot(ref v4, ref n, out dot2);\n                if (dot2 < 0)\n                {\n                    //The origin is outside!\n                    position = new Vector3();\n                    return false;\n                }\n\n                //If the plane which generated the normal is very close to the extreme point, then we're at the surface\n                //and we have not found the origin; it's either just BARELY inside, or it is outside.  Assume it's outside.\n                if (dot2 - dot < surfaceEpsilon || count > MPRToolbox.InnerIterationLimit) // TODO: Could use a dynamic epsilon for possibly better behavior.\n                {\n                    position = new Vector3();\n                    //DEBUGlastPosition = position;\n                    return false;\n                }\n                count++;\n\n                //Still haven't exited, so refine the portal.\n                //Test origin against the three planes that separate the new portal candidates: (v1,v4,v0) (v2,v4,v0) (v3,v4,v0)\n                Vector3.Cross(ref v4, ref v0, out temp1);\n                Vector3.Dot(ref v1, ref temp1, out dot);\n                if (dot >= 0)\n                {\n                    Vector3.Dot(ref v2, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v1 = v4; // Inside v1 & inside v2 ==> eliminate v1\n                        v1A = v4A;\n                        v1B = v4B;\n                    }\n                    else\n                    {\n                        v3 = v4; // Inside v1 & outside v2 ==> eliminate v3\n                        v3A = v4A;\n                        v3B = v4B;\n                    }\n                }\n                else\n                {\n                    Vector3.Dot(ref v3, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v2 = v4; // Outside v1 & inside v3 ==> eliminate v2\n                        v2A = v4A;\n                        v2B = v4B;\n                    }\n                    else\n                    {\n                        v1 = v4; // Outside v1 & outside v3 ==> eliminate v1\n                        v1A = v4A;\n                        v1B = v4B;\n                    }\n                }\n\n                //if (!VerifySimplex(ref v0, ref v1, ref v2, ref v3, ref localPoint.Position))\n                //    Debug.WriteLine(\"Break.\");\n\n            }\n\n\n        }\n\n\n\n        /// <summary>\n        /// Determines if two shapes are colliding.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape in the pair.</param>\n        /// <param name=\"shapeB\">Second shape of the pair.</param>\n        /// <param name=\"transformA\">Transformation to apply to shape A.</param>\n        /// <param name=\"transformB\">Transformation to apply to shape B.</param>\n        /// <returns>Whether or not the shapes are overlapping.</returns>\n        public static bool AreShapesOverlapping(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform transformA, ref RigidTransform transformB)\n        {\n            RigidTransform localTransformB;\n            MinkowskiToolbox.GetLocalTransform(ref transformA, ref transformB, out localTransformB);\n            return AreLocalShapesOverlapping(shapeA, shapeB, ref localTransformB);\n\n        }\n\n        /// <summary>\n        /// Determines if two shapes are colliding.  Shape B is positioned relative to shape A.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape in the pair.</param>\n        /// <param name=\"shapeB\">Second shape of the pair.</param>\n        /// <param name=\"localTransformB\">Relative transform of shape B to shape A.</param>\n        /// <returns>Whether or not the shapes are overlapping.</returns>\n        public static bool AreLocalShapesOverlapping(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform localTransformB)\n        {\n            return AreLocalShapesOverlapping(shapeA, shapeB, ref localTransformB.Position, ref localTransformB);\n        }\n\n        /// <summary>\n        /// Determines if two shapes are colliding.  Shape B is positioned relative to shape A.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape in the pair.</param>\n        /// <param name=\"shapeB\">Second shape of the pair.</param>\n        /// <param name=\"originRay\">Direction in which to cast the overlap ray.  Necessary when an object's origin is not contained in its geometry.</param>\n        /// <param name=\"localTransformB\">Relative transform of shape B to shape A.</param>\n        /// <returns>Whether or not the shapes are overlapping.</returns>\n        internal static bool AreLocalShapesOverlapping(ConvexShape shapeA, ConvexShape shapeB, ref Vector3 originRay, ref RigidTransform localTransformB)\n        {\n            //Compute the origin ray.  This points from a point known to be inside the minkowski sum to the origin.\n            //The centers of the shapes are used to create the interior point.\n\n            //It's possible that the two objects' centers are overlapping, or very very close to it.  In this case, \n            //they are obviously colliding and we can immediately exit.\n            if (originRay.LengthSquared() < Toolbox.Epsilon)\n            {\n                return true;\n            }\n\n            Vector3 v0;\n            Vector3.Negate(ref originRay, out v0); //Since we're in A's local space, A-B is just -B.\n\n\n\n            //Now that the origin ray is known, create a portal through which the ray passes.\n            //To do this, first guess a portal.\n            //This implementation is similar to that of the original XenoCollide.\n            //'n' will be the direction used to find supports throughout the algorithm.\n            Vector3 n = originRay;\n            Vector3 v1;\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v1);\n\n            //Find another extreme point in a direction perpendicular to the previous.\n            Vector3 v2;\n            Vector3.Cross(ref v1, ref v0, out n);\n            if (n.LengthSquared() < Toolbox.Epsilon)\n            {\n                //v1 and v0 could be parallel.\n                //This isn't a bad thing- it means the direction is exactly aligned with the extreme point offset.\n                //In other words, if the raycast is followed out to the surface, it will arrive at the extreme point!\n                //If the origin is further along this direction than the extreme point, then there is no intersection.\n                //If the origin is within this extreme point, then there is an intersection.\n                float dot;\n                Vector3.Dot(ref v1, ref originRay, out dot);\n                if (dot < 0)\n                {\n                    //Origin is outside.\n                    return false;\n                }\n                //Origin is inside.\n                return true;\n            }\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v2);\n\n            Vector3 temp1, temp2;\n            //Set n for the first iteration.\n            Vector3.Subtract(ref v1, ref v0, out temp1);\n            Vector3.Subtract(ref v2, ref v0, out temp2);\n            Vector3.Cross(ref temp1, ref temp2, out n);\n\n\n            Vector3 v3;\n            int count = 0;\n            while (true)\n            {\n                //Find a final extreme point using the normal of the plane defined by v0, v1, v2.\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v3);\n\n                if (count > MPRToolbox.OuterIterationLimit)\n                    break;\n                count++;\n                //By now, the simplex is a tetrahedron, but it is not known whether or not the origin ray found earlier actually passes through the portal\n                //defined by v1, v2, v3.\n\n                // If the origin is outside the plane defined by v1,v0,v3, then the portal is invalid.\n                Vector3.Cross(ref v1, ref v3, out temp1);\n                float dot;\n                Vector3.Dot(ref temp1, ref v0, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v2) with the new extreme point.\n                    v2 = v3;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Subtract(ref v1, ref v0, out temp1);\n                    Vector3.Subtract(ref v3, ref v0, out temp2);\n                    Vector3.Cross(ref temp1, ref temp2, out n);\n                    continue;\n                }\n\n                // If the origin is outside the plane defined by v3,v0,v2, then the portal is invalid.\n                Vector3.Cross(ref v3, ref v2, out temp1);\n                Vector3.Dot(ref temp1, ref v0, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v1) with the new extreme point.\n                    v1 = v3;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Subtract(ref v2, ref v0, out temp1);\n                    Vector3.Subtract(ref v3, ref v0, out temp2);\n                    Vector3.Cross(ref temp1, ref temp2, out n);\n                    continue;\n                }\n                break;\n            }\n\n            //if (!VerifySimplex(ref v0, ref v1, ref v2, ref v3, ref localPoint.Position))\n            //    Debug.WriteLine(\"Break.\");\n\n\n            // Refine the portal.\n            while (true)\n            {\n                //Test the origin against the plane defined by v1, v2, v3.  If it's inside, we're done.\n                //Compute the outward facing normal.\n                Vector3.Subtract(ref v3, ref v2, out temp1);\n                Vector3.Subtract(ref v1, ref v2, out temp2);\n                Vector3.Cross(ref temp1, ref temp2, out n);\n                float dot;\n                Vector3.Dot(ref n, ref v1, out dot);\n                if (dot >= 0)\n                {\n                    return true;\n                }\n\n                //We haven't yet found the origin.  Find the support point in the portal's outward facing direction.\n                Vector3 v4;\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v4);\n                //If the origin is further along the direction than the extreme point, it's not inside the shape.\n                float dot2;\n                Vector3.Dot(ref v4, ref n, out dot2);\n                if (dot2 < 0)\n                {\n                    //The origin is outside!\n                    return false;\n                }\n\n                //If the plane which generated the normal is very close to the extreme point, then we're at the surface\n                //and we have not found the origin; it's either just BARELY inside, or it is outside.  Assume it's outside.\n                if (dot2 - dot < surfaceEpsilon || count > MPRToolbox.InnerIterationLimit) // TODO: Could use a dynamic epsilon for possibly better behavior.\n                {\n                    return false;\n                }\n                count++;\n\n                //Still haven't exited, so refine the portal.\n                //Test origin against the three planes that separate the new portal candidates: (v1,v4,v0) (v2,v4,v0) (v3,v4,v0)\n                Vector3.Cross(ref v4, ref v0, out temp1);\n                Vector3.Dot(ref v1, ref temp1, out dot);\n                if (dot >= 0)\n                {\n                    Vector3.Dot(ref v2, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v1 = v4; // Inside v1 & inside v2 ==> eliminate v1\n                    }\n                    else\n                    {\n                        v3 = v4; // Inside v1 & outside v2 ==> eliminate v3\n                    }\n                }\n                else\n                {\n                    Vector3.Dot(ref v3, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v2 = v4; // Outside v1 & inside v3 ==> eliminate v2\n                    }\n                    else\n                    {\n                        v1 = v4; // Outside v1 & outside v3 ==> eliminate v1\n                    }\n                }\n\n                //if (!VerifySimplex(ref v0, ref v1, ref v2, ref v3, ref localPoint.Position))\n                //    Debug.WriteLine(\"Break.\");\n\n            }\n\n\n        }\n\n        /// <summary>\n        /// Casts a ray from the origin in the given direction at the surface of the minkowski difference.\n        /// Assumes that the origin is within the minkowski difference.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape in the pair.</param>\n        /// <param name=\"shapeB\">Second shape in the pair.</param>\n        /// <param name=\"localTransformB\">Transformation of shape B relative to shape A.</param>\n        /// <param name=\"direction\">Direction to cast the ray.</param>\n        /// <param name=\"t\">Length along the direction vector that the impact was found.</param>\n        /// <param name=\"normal\">Normal of the impact at the surface of the convex.</param>\n        public static void LocalSurfaceCast(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform localTransformB, ref Vector3 direction, out float t, out Vector3 normal)\n        {\n            // Local surface cast is very similar to regular MPR.  However, instead of starting at an interior point and targeting the origin,\n            // the ray starts at the origin (a point known to be in both shape and shapeB), and just goes towards the direction until the surface\n            // is found.  The portal (v1, v2, v3) at termination defines the surface normal, and the distance from the origin to the portal along the direction is used as the 't' result.\n\n\n            //'v0' is no longer explicitly tracked since it is simply the origin.\n\n\n            //Now that the origin ray is known, create a portal through which the ray passes.\n            //To do this, first guess a portal.\n            //This implementation is similar to that of the original XenoCollide.\n            //'n' will be the direction used to find supports throughout the algorithm.\n            Vector3 n = direction;\n            Vector3 v1;\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v1);\n            //v1 could be zero in some degenerate cases.\n            //if (v1.LengthSquared() < Toolbox.Epsilon)\n            //{\n            //    t = 0;\n            //    normal = n;\n            //    return;\n            //}\n\n            //Find another extreme point in a direction perpendicular to the previous.\n            Vector3 v2;\n            Vector3.Cross(ref direction, ref v1, out n);\n            if (n.LengthSquared() < Toolbox.Epsilon)\n            {\n                //v1 and v0 could be parallel.\n                //This isn't a bad thing- it means the direction is exactly aligned with the extreme point offset.\n                //In other words, if the raycast is followed out to the surface, it will arrive at the extreme point!\n\n                float rayLengthSquared = direction.LengthSquared();\n                if (rayLengthSquared > Toolbox.Epsilon * .01f)\n                    Vector3.Divide(ref direction, (float)Math.Sqrt(rayLengthSquared), out normal);\n                else\n                    normal = new Vector3();\n\n                float rate;\n                Vector3.Dot(ref  normal, ref direction, out rate);\n                float distance;\n                Vector3.Dot(ref  normal, ref v1, out distance);\n                if (rate > 0)\n                    t = distance / rate;\n                else\n                    t = 0;\n                return;\n            }\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v2);\n\n\n\n\n            Vector3 temp1, temp2;\n            //Set n for the first iteration.\n            Vector3.Cross(ref v1, ref v2, out n);\n\n            //It's possible that v1 and v2 were constructed in such a way that 'n' is not properly calibrated\n            //relative to the direction vector.\n            float dot;\n            Vector3.Dot(ref n, ref direction, out dot);\n            if (dot > 0)\n            {\n                //It's not properly calibrated.  Flip the winding (and the previously calculated normal).\n                Vector3.Negate(ref n, out n);\n                temp1 = v1;\n                v1 = v2;\n                v2 = temp1;\n            }\n\n            Vector3 v3;\n            int count = 0;\n            while (true)\n            {\n                //Find a final extreme point using the normal of the plane defined by v0, v1, v2.\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v3);\n\n                if (count > MPRToolbox.OuterIterationLimit)\n                {\n                    //Can't enclose the origin! That's a bit odd; something is wrong.\n                    t = float.MaxValue;\n                    normal = Toolbox.UpVector;\n                    return;\n                }\n                count++;\n\n                //By now, the simplex is a tetrahedron, but it is not known whether or not the ray actually passes through the portal\n                //defined by v1, v2, v3.\n\n                // If the direction is outside the plane defined by v1,v0,v3, then the portal is invalid.\n                Vector3.Cross(ref v1, ref v3, out temp1);\n                Vector3.Dot(ref temp1, ref direction, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v2) with the new extreme point.\n                    v2 = v3;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Cross(ref v1, ref v3, out n);\n                    continue;\n                }\n\n                // If the direction is outside the plane defined by v3,v0,v2, then the portal is invalid.\n                Vector3.Cross(ref v3, ref v2, out temp1);\n                Vector3.Dot(ref temp1, ref direction, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v1) with the new extreme point.\n                    v1 = v3;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Cross(ref v2, ref v3, out n);\n                    continue;\n                }\n                break;\n            }\n\n            //if (!VerifySimplex(ref Toolbox.ZeroVector, ref v1, ref v2, ref v3, ref direction))\n            //    Debug.WriteLine(\"Break.\");\n\n\n            // Refine the portal.\n            count = 0;\n            while (true)\n            {\n                //Compute the outward facing normal.\n                Vector3.Subtract(ref v1, ref v2, out temp1);\n                Vector3.Subtract(ref v3, ref v2, out temp2);\n                Vector3.Cross(ref temp1, ref temp2, out n);\n\n\n                //Keep working towards the surface.  Find the next extreme point.\n                Vector3 v4;\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v4);\n\n\n                //If the plane which generated the normal is very close to the extreme point, then we're at the surface.\n                Vector3.Dot(ref n, ref v1, out dot);\n                float supportDot;\n                Vector3.Dot(ref v4, ref n, out supportDot);\n\n                if (supportDot - dot < surfaceEpsilon || count > MPRToolbox.InnerIterationLimit) // TODO: Could use a dynamic epsilon for possibly better behavior.\n                {\n                    //normal = n;\n                    //float normalLengthInverse = 1 / normal.Length();\n                    //Vector3.Multiply(ref normal, normalLengthInverse, out normal);\n                    ////Find the distance from the origin to the plane.\n                    //t = dot * normalLengthInverse;\n\n                    float lengthSquared = n.LengthSquared();\n                    if (lengthSquared > Toolbox.Epsilon * .01f)\n                    {\n                        Vector3.Divide(ref n, (float)Math.Sqrt(lengthSquared), out normal);\n\n                        //The plane is very close to the surface, and the ray is known to pass through it.\n                        //dot is the rate.\n                        Vector3.Dot(ref normal, ref direction, out dot);\n                        //supportDot is the distance to the plane.\n                        Vector3.Dot(ref normal, ref v1, out supportDot);\n                        if (dot > 0)\n                            t = supportDot / dot;\n                        else\n                            t = 0;\n                    }\n                    else\n                    {\n                        normal = Vector3.Up;\n                        t = 0;\n                    }\n                    ////DEBUG STUFF:\n\n                    //DEBUGlastRayT = t;\n                    //DEBUGlastRayDirection = direction;\n                    //DEBUGlastDepth = t;\n                    //DEBUGlastNormal = normal;\n                    //DEBUGlastV1 = v1;\n                    //DEBUGlastV2 = v2;\n                    //DEBUGlastV3 = v3;\n                    return;\n                }\n\n                //Still haven't exited, so refine the portal.\n                //Test direction against the three planes that separate the new portal candidates: (v1,v4,v0) (v2,v4,v0) (v3,v4,v0)\n\n\n\n                //This may look a little weird at first.\n                //'inside' here means 'on the positive side of the plane.'\n                //There are three total planes being tested, one for each of v1, v2, and v3.\n                //The planes are created from consistently wound vertices, so it's possible to determine\n                //where the ray passes through the portal based upon its relationship to two of the three planes.\n                //The third vertex which is found to be opposite the face which contains the ray is replaced with the extreme point.\n\n                //This v4 x direction is just a minor reordering of a scalar triple product: (v1 x v4) * direction.\n                //It eliminates the need for extra cross products for the inner if.\n                Vector3.Cross(ref v4, ref direction, out temp1);\n                Vector3.Dot(ref v1, ref temp1, out dot);\n                if (dot >= 0)\n                {\n                    Vector3.Dot(ref v2, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v1 = v4; // Inside v1 & inside v2 ==> eliminate v1\n                    }\n                    else\n                    {\n                        v3 = v4; // Inside v1 & outside v2 ==> eliminate v3\n                    }\n                }\n                else\n                {\n                    Vector3.Dot(ref v3, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v2 = v4; // Outside v1 & inside v3 ==> eliminate v2\n                    }\n                    else\n                    {\n                        v1 = v4; // Outside v1 & outside v3 ==> eliminate v1\n                    }\n                }\n\n                count++;\n\n                //Here's an unoptimized equivalent without the scalar triple product reorder.\n                #region Equivalent refinement\n                //Vector3.Cross(ref v1, ref v4, out temp1);\n                //Vector3.Dot(ref temp1, ref direction, out dot);\n                //if (dot > 0)\n                //{\n                //    Vector3.Cross(ref v2, ref v4, out temp2);\n                //    Vector3.Dot(ref temp2, ref direction, out dot);\n                //    if (dot > 0)\n                //    {\n                //        //Inside v1, v4, v0 and inside v2, v4, v0\n                //        v1 = v4;\n                //    }\n                //    else\n                //    {\n                //        //Inside v1, v4, v0 and outside v2, v4, v0\n                //        v3 = v4;\n                //    }\n                //}\n                //else\n                //{\n                //    Vector3.Cross(ref v3, ref v4, out temp2);\n                //    Vector3.Dot(ref temp2, ref direction, out dot);\n                //    if (dot > 0)\n                //    {\n                //        //Outside v1, v4, v0 and inside v3, v4, v0\n                //        v2 = v4;\n                //    }\n                //    else\n                //    {\n                //        //Outside v1, v4, v0 and outside v3, v4, v0\n                //        v1 = v4;\n                //    }\n                //}\n                #endregion\n\n                //if (!VerifySimplex(ref Toolbox.ZeroVector, ref v1, ref v2, ref v3, ref direction))\n                //    Debug.WriteLine(\"Break.\");\n            }\n        }\n\n        /// <summary>\n        /// Casts a ray from the origin in the given direction at the surface of the minkowski difference.\n        /// Assumes that the origin is within the minkowski difference.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape in the pair.</param>\n        /// <param name=\"shapeB\">Second shape in the pair.</param>\n        /// <param name=\"localTransformB\">Transformation of shape B relative to shape A.</param>\n        /// <param name=\"direction\">Direction to cast the ray.</param>\n        /// <param name=\"t\">Length along the direction vector that the impact was found.</param>\n        /// <param name=\"normal\">Normal of the impact at the surface of the convex.</param>\n        /// <param name=\"position\">Location of the ray cast hit on the surface of A.</param>\n        public static void LocalSurfaceCast(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform localTransformB, ref Vector3 direction, out float t, out Vector3 normal, out Vector3 position)\n        {\n            // Local surface cast is very similar to regular MPR.  However, instead of starting at an interior point and targeting the origin,\n            // the ray starts at the origin (a point known to be in both shape and shapeB), and just goes towards the direction until the surface\n            // is found.  The portal (v1, v2, v3) at termination defines the surface normal, and the distance from the origin to the portal along the direction is used as the 't' result.\n\n\n            //'v0' is no longer explicitly tracked since it is simply the origin.\n\n\n            //Now that the origin ray is known, create a portal through which the ray passes.\n            //To do this, first guess a portal.\n            //This implementation is similar to that of the original XenoCollide.\n            //'n' will be the direction used to find supports throughout the algorithm.\n            Vector3 n = direction;\n            Vector3 v1, v1A;\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v1A, out v1);\n            //v1 could be zero in some degenerate cases.\n            //if (v1.LengthSquared() < Toolbox.Epsilon)\n            //{\n            //    t = 0;\n            //    normal = n;\n            //    return;\n            //}\n\n            //Find another extreme point in a direction perpendicular to the previous.\n            Vector3 v2, v2A;\n            Vector3.Cross(ref direction, ref v1, out n);\n            if (n.LengthSquared() < Toolbox.Epsilon)\n            {\n                //v1 and v0 could be parallel.\n                //This isn't a bad thing- it means the direction is exactly aligned with the extreme point offset.\n                //In other words, if the raycast is followed out to the surface, it will arrive at the extreme point!\n\n                float rayLengthSquared = direction.LengthSquared();\n                if (rayLengthSquared > Toolbox.Epsilon * .01f)\n                    Vector3.Divide(ref direction, (float)Math.Sqrt(rayLengthSquared), out normal);\n                else\n                    normal = new Vector3();\n\n                float rate;\n                Vector3.Dot(ref  normal, ref direction, out rate);\n                float distance;\n                Vector3.Dot(ref  normal, ref v1, out distance);\n                if (rate > 0)\n                    t = distance / rate;\n                else\n                    t = 0;\n                position = v1A;\n                return;\n            }\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v2A, out v2);\n\n\n\n\n            Vector3 temp1, temp2;\n            //Set n for the first iteration.\n            Vector3.Cross(ref v1, ref v2, out n);\n\n            //It's possible that v1 and v2 were constructed in such a way that 'n' is not properly calibrated\n            //relative to the direction vector.\n            float dot;\n            Vector3.Dot(ref n, ref direction, out dot);\n            if (dot > 0)\n            {\n                //It's not properly calibrated.  Flip the winding (and the previously calculated normal).\n                Vector3.Negate(ref n, out n);\n                temp1 = v1;\n                v1 = v2;\n                v2 = temp1;\n\n                temp1 = v1A;\n                v1A = v2A;\n                v2A = temp1;\n            }\n\n            Vector3 v3, v3A;\n            int count = 0;\n            while (true)\n            {\n                //Find a final extreme point using the normal of the plane defined by v0, v1, v2.\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v3A, out v3);\n\n                if (count > MPRToolbox.OuterIterationLimit)\n                {\n                    //Can't enclose the origin! That's a bit odd; something is wrong.\n                    t = float.MaxValue;\n                    normal = Toolbox.UpVector;\n                    position = new Vector3();\n                    return;\n                }\n                count++;\n\n                //By now, the simplex is a tetrahedron, but it is not known whether or not the ray actually passes through the portal\n                //defined by v1, v2, v3.\n\n                // If the direction is outside the plane defined by v1,v0,v3, then the portal is invalid.\n                Vector3.Cross(ref v1, ref v3, out temp1);\n                Vector3.Dot(ref temp1, ref direction, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v2) with the new extreme point.\n                    v2 = v3;\n                    v2A = v3A;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Cross(ref v1, ref v3, out n);\n                    continue;\n                }\n\n                // If the direction is outside the plane defined by v3,v0,v2, then the portal is invalid.\n                Vector3.Cross(ref v3, ref v2, out temp1);\n                Vector3.Dot(ref temp1, ref direction, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v1) with the new extreme point.\n                    v1 = v3;\n                    v1A = v3A;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Cross(ref v2, ref v3, out n);\n                    continue;\n                }\n                break;\n            }\n\n            //if (!VerifySimplex(ref Toolbox.ZeroVector, ref v1, ref v2, ref v3, ref direction))\n            //    Debug.WriteLine(\"Break.\");\n\n\n            // Refine the portal.\n            count = 0;\n            while (true)\n            {\n                //Compute the outward facing normal.\n                Vector3.Subtract(ref v1, ref v2, out temp1);\n                Vector3.Subtract(ref v3, ref v2, out temp2);\n                Vector3.Cross(ref temp1, ref temp2, out n);\n\n\n                //Keep working towards the surface.  Find the next extreme point.\n                Vector3 v4, v4A;\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v4A, out v4);\n\n\n                //If the plane which generated the normal is very close to the extreme point, then we're at the surface.\n                Vector3.Dot(ref n, ref v1, out dot);\n                float supportDot;\n                Vector3.Dot(ref v4, ref n, out supportDot);\n\n                if (supportDot - dot < surfaceEpsilon || count > MPRToolbox.InnerIterationLimit) // TODO: Could use a dynamic epsilon for possibly better behavior.\n                {\n                    //normal = n;\n                    //float normalLengthInverse = 1 / normal.Length();\n                    //Vector3.Multiply(ref normal, normalLengthInverse, out normal);\n                    ////Find the distance from the origin to the plane.\n                    //t = dot * normalLengthInverse;\n\n                    float lengthSquared = n.LengthSquared();\n                    if (lengthSquared > Toolbox.Epsilon * .01f)\n                    {\n                        Vector3.Divide(ref n, (float)Math.Sqrt(lengthSquared), out normal);\n\n                        //The plane is very close to the surface, and the ray is known to pass through it.\n                        //dot is the rate.\n                        Vector3.Dot(ref normal, ref direction, out dot);\n                        //supportDot is the distance to the plane.\n                        Vector3.Dot(ref normal, ref v1, out supportDot);\n                        if (dot > 0)\n                            t = supportDot / dot;\n                        else\n                            t = 0;\n                    }\n                    else\n                    {\n                        normal = Vector3.Up;\n                        t = 0;\n                    }\n\n                    float v1Weight, v2Weight, v3Weight;\n                    Vector3.Multiply(ref direction, t, out position);\n\n                    Toolbox.GetBarycentricCoordinates(ref position, ref v1, ref v2, ref v3, out v1Weight, out v2Weight, out v3Weight);\n                    Vector3.Multiply(ref v1A, v1Weight, out position);\n                    Vector3 temp;\n                    Vector3.Multiply(ref v2A, v2Weight, out temp);\n                    Vector3.Add(ref temp, ref position, out position);\n                    Vector3.Multiply(ref v3A, v3Weight, out temp);\n                    Vector3.Add(ref temp, ref position, out position);\n                    ////DEBUG STUFF:\n\n                    //DEBUGlastRayT = t;\n                    //DEBUGlastRayDirection = direction;\n                    //DEBUGlastDepth = t;\n                    //DEBUGlastNormal = normal;\n                    //DEBUGlastV1 = v1;\n                    //DEBUGlastV2 = v2;\n                    //DEBUGlastV3 = v3;\n                    return;\n                }\n\n                //Still haven't exited, so refine the portal.\n                //Test direction against the three planes that separate the new portal candidates: (v1,v4,v0) (v2,v4,v0) (v3,v4,v0)\n\n\n\n                //This may look a little weird at first.\n                //'inside' here means 'on the positive side of the plane.'\n                //There are three total planes being tested, one for each of v1, v2, and v3.\n                //The planes are created from consistently wound vertices, so it's possible to determine\n                //where the ray passes through the portal based upon its relationship to two of the three planes.\n                //The third vertex which is found to be opposite the face which contains the ray is replaced with the extreme point.\n\n                //This v4 x direction is just a minor reordering of a scalar triple product: (v1 x v4) * direction.\n                //It eliminates the need for extra cross products for the inner if.\n                Vector3.Cross(ref v4, ref direction, out temp1);\n                Vector3.Dot(ref v1, ref temp1, out dot);\n                if (dot >= 0)\n                {\n                    Vector3.Dot(ref v2, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v1 = v4; // Inside v1 & inside v2 ==> eliminate v1\n                        v1A = v4A;\n                    }\n                    else\n                    {\n                        v3 = v4; // Inside v1 & outside v2 ==> eliminate v3\n                        v3A = v4A;\n                    }\n                }\n                else\n                {\n                    Vector3.Dot(ref v3, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v2 = v4; // Outside v1 & inside v3 ==> eliminate v2\n                        v2A = v4A;\n                    }\n                    else\n                    {\n                        v1 = v4; // Outside v1 & outside v3 ==> eliminate v1\n                        v1A = v4A;\n                    }\n                }\n\n                count++;\n\n                //Here's an unoptimized equivalent without the scalar triple product reorder.\n                #region Equivalent refinement\n                //Vector3.Cross(ref v1, ref v4, out temp1);\n                //Vector3.Dot(ref temp1, ref direction, out dot);\n                //if (dot > 0)\n                //{\n                //    Vector3.Cross(ref v2, ref v4, out temp2);\n                //    Vector3.Dot(ref temp2, ref direction, out dot);\n                //    if (dot > 0)\n                //    {\n                //        //Inside v1, v4, v0 and inside v2, v4, v0\n                //        v1 = v4;\n                //    }\n                //    else\n                //    {\n                //        //Inside v1, v4, v0 and outside v2, v4, v0\n                //        v3 = v4;\n                //    }\n                //}\n                //else\n                //{\n                //    Vector3.Cross(ref v3, ref v4, out temp2);\n                //    Vector3.Dot(ref temp2, ref direction, out dot);\n                //    if (dot > 0)\n                //    {\n                //        //Outside v1, v4, v0 and inside v3, v4, v0\n                //        v2 = v4;\n                //    }\n                //    else\n                //    {\n                //        //Outside v1, v4, v0 and outside v3, v4, v0\n                //        v1 = v4;\n                //    }\n                //}\n                #endregion\n\n                //if (!VerifySimplex(ref Toolbox.ZeroVector, ref v1, ref v2, ref v3, ref direction))\n                //    Debug.WriteLine(\"Break.\");\n            }\n        }\n\n        static bool VerifySimplex(ref Vector3 v0, ref Vector3 v1, ref Vector3 v2, ref Vector3 v3, ref Vector3 direction)\n        {\n\n\n            //v1, v0, v3\n            Vector3 cross = Vector3.Cross(v0 - v1, v3 - v1);\n            float planeProduct1 = Vector3.Dot(cross, direction);\n            //v3, v0, v2\n            cross = Vector3.Cross(v0 - v3, v2 - v3);\n            float planeProduct2 = Vector3.Dot(cross, direction);\n            //v2, v0, v1\n            cross = Vector3.Cross(v0 - v2, v1 - v2);\n            float planeProduct3 = Vector3.Dot(cross, direction);\n            return (planeProduct1 <= 0 && planeProduct2 <= 0 && planeProduct3 <= 0) ||\n                (planeProduct1 >= 0 && planeProduct2 >= 0 && planeProduct3 >= 0);\n        }\n\n        /// <summary>\n        /// Gets a contact point between two convex shapes.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape in the pair.</param>\n        /// <param name=\"shapeB\">Second shape in the pair.</param>\n        /// <param name=\"transformA\">Transformation to apply to the first shape.</param>\n        /// <param name=\"transformB\">Transformation to apply to the second shape.</param>\n        /// <param name=\"penetrationAxis\">Axis along which to first test the penetration depth.</param>\n        /// <param name=\"contact\">Contact data between the two shapes, if any.</param>\n        /// <returns>Whether or not the shapes overlap.</returns>\n        public static bool GetContact(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform transformA, ref RigidTransform transformB, ref Vector3 penetrationAxis, out ContactData contact)\n        {\n            RigidTransform localTransformB;\n            MinkowskiToolbox.GetLocalTransform(ref transformA, ref transformB, out localTransformB);\n            if (MPRToolbox.AreLocalShapesOverlapping(shapeA, shapeB, ref localTransformB))\n            {\n                //First, try to use the heuristically found direction.  This comes from either the GJK shallow contact separating axis or from the relative velocity.\n                Vector3 rayCastDirection;\n                float lengthSquared = penetrationAxis.LengthSquared();\n                if (lengthSquared > Toolbox.Epsilon)\n                {\n                    Vector3.Divide(ref penetrationAxis, (float)Math.Sqrt(lengthSquared), out rayCastDirection);// (Vector3.Normalize(localDirection) + Vector3.Normalize(collidableB.worldTransform.Position - collidableA.worldTransform.Position)) / 2;\n                    MPRToolbox.LocalSurfaceCast(shapeA, shapeB, ref localTransformB, ref rayCastDirection, out contact.PenetrationDepth, out contact.Normal);\n                }\n                else\n                {\n                    contact.PenetrationDepth = float.MaxValue;\n                    contact.Normal = Toolbox.UpVector;\n                }\n                //Try the offset between the origins as a second option.  Sometimes this is a better choice than the relative velocity.\n                //TODO: Could use the position-finding MPR iteration to find the A-B direction hit by continuing even after the origin has been found (optimization).\n                Vector3 normalCandidate;\n                float depthCandidate;\n                lengthSquared = localTransformB.Position.LengthSquared();\n                if (lengthSquared > Toolbox.Epsilon)\n                {\n                    Vector3.Divide(ref localTransformB.Position, (float)Math.Sqrt(lengthSquared), out rayCastDirection);\n                    MPRToolbox.LocalSurfaceCast(shapeA, shapeB, ref localTransformB, ref rayCastDirection, out depthCandidate, out normalCandidate);\n                    if (depthCandidate < contact.PenetrationDepth)\n                    {\n                        contact.Normal = normalCandidate;\n                        contact.PenetrationDepth = depthCandidate;\n                    }\n                }\n\n                //if (contact.PenetrationDepth > 1)\n                //    Debug.WriteLine(\"Break.\");\n\n                //Correct the penetration depth.\n                RefinePenetration(shapeA, shapeB, ref localTransformB, contact.PenetrationDepth, ref contact.Normal, out contact.PenetrationDepth, out contact.Normal, out contact.Position);\n\n                ////Correct the penetration depth.\n                //MPRTesting.LocalSurfaceCast(shape, shapeB, ref localPoint, ref contact.Normal, out contact.PenetrationDepth, out rayCastDirection);\n\n\n                ////The local casting can optionally continue.  Eventually, it will converge to the local minimum.\n                //while (true)\n                //{\n                //    MPRTesting.LocalSurfaceCast(collidableA.Shape, collidableB.Shape, ref localPoint, ref contact.Normal, out depthCandidate, out normalCandidate);\n                //    if (contact.PenetrationDepth - depthCandidate <= Toolbox.BigEpsilon)\n                //        break;\n\n                //    contact.PenetrationDepth = depthCandidate;\n                //    contact.Normal = normalCandidate;\n                //}\n\n                contact.Id = -1;\n                //we're still in local space! transform it all back.\n                Matrix3x3 orientation;\n                Matrix3x3.CreateFromQuaternion(ref transformA.Orientation, out orientation);\n                Matrix3x3.Transform(ref contact.Normal, ref orientation, out contact.Normal);\n                //Vector3.Negate(ref contact.Normal, out contact.Normal);\n                Matrix3x3.Transform(ref contact.Position, ref orientation, out contact.Position);\n                Vector3.Add(ref contact.Position, ref transformA.Position, out contact.Position);\n                return true;\n            }\n            contact = new ContactData();\n            return false;\n        }\n\n        /// <summary>\n        /// Incrementally refines the penetration depth and normal towards the local minimum.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape in the pair.</param>\n        /// <param name=\"shapeB\">Second shape in the pair.</param>\n        /// <param name=\"localTransformB\">Transformation of shape B relative to shape A.</param>\n        /// <param name=\"initialDepth\">Initial depth estimate.</param>\n        /// <param name=\"initialNormal\">Initial normal estimate.</param>\n        /// <param name=\"penetrationDepth\">Refined penetration depth.</param>\n        /// <param name=\"refinedNormal\">Refined normal.</param>\n        /// <param name=\"position\">Refined position.</param>\n        public static void RefinePenetration(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform localTransformB, float initialDepth, ref Vector3 initialNormal, out float penetrationDepth, out Vector3 refinedNormal, out Vector3 position)\n        {\n            //The local casting can optionally continue.  Eventually, it will converge to the local minimum.\n            int optimizingCount = 0;\n            refinedNormal = initialNormal;\n            penetrationDepth = initialDepth;\n            float candidateDepth;\n            Vector3 candidateNormal;\n\n            while (true)\n            {\n\n                MPRToolbox.LocalSurfaceCast(shapeA, shapeB, ref localTransformB, ref refinedNormal, out candidateDepth, out candidateNormal, out position);\n                if (penetrationDepth - candidateDepth <= depthRefinementEpsilon ||\n                    ++optimizingCount >= maximumDepthRefinementIterations)\n                {\n                    //If we've reached the end due to convergence, the normal will be extremely close to correct (if not 100% correct).\n                    //The candidateDepth computed is the previous contact normal's depth.\n                    //The reason why the previous normal is kept is that the last raycast computed the depth for that normal, not the new normal.\n                    penetrationDepth = candidateDepth;\n                    break;\n                }\n\n                penetrationDepth = candidateDepth;\n                refinedNormal = candidateNormal;\n\n            }\n        }\n\n        //SWEEPS\n\n        /// <summary>\n        /// Sweeps the shapes against each other and finds a point, time, and normal of impact.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape in the pair.</param>\n        /// <param name=\"shapeB\">Second shape in the pair.</param>\n        /// <param name=\"sweepA\">Sweep direction and amount to apply to the first shape.</param>\n        /// <param name=\"sweepB\">Sweep direction and amount to apply to the second shape.</param>\n        /// <param name=\"transformA\">Initial transform to apply to the first shape.</param>\n        /// <param name=\"transformB\">Initial transform to apply to the second shape.</param>\n        /// <param name=\"hit\">Hit data between the two shapes, if any.</param>\n        /// <returns>Whether or not the swept shapes hit each other.</returns>\n        public static bool Sweep(ConvexShape shapeA, ConvexShape shapeB, ref Vector3 sweepA, ref Vector3 sweepB, ref RigidTransform transformA, ref RigidTransform transformB, out RayHit hit)\n        {\n            //Put the relative velocity into shape's local space.\n            Vector3 velocityWorld;\n            //note the order of subtraction.  It 'should' be B-A, but the ray direction the algorithm works with is actually OPPOSITE.\n            Vector3.Subtract(ref sweepA, ref sweepB, out velocityWorld);\n            Quaternion conjugateOrientationA;\n            Quaternion.Conjugate(ref transformA.Orientation, out conjugateOrientationA);\n            Vector3 localDirection;\n            Vector3.Transform(ref velocityWorld, ref conjugateOrientationA, out localDirection);\n\n\n            //Sweeping two objects against each other is very similar to the local surface cast.\n            //The ray starts at the origin and goes in the sweep direction.\n            //However, unlike the local surface cast, the origin may start outside of the minkowski difference.\n            //Additionally, the method can early out if the length traversed by the ray is found to be longer than the maximum length, or if the origin is found to be outside the minkowski difference.\n\n            //The support points of the minkowski difference are also modified.  By default, the minkowski difference should very rarely contain the origin.\n            //Sweep tests aren't very useful if the objects are intersecting!\n            //However, in order for the local surface cast to actually find a proper result (assuming there is a hit at all), the origin must be inside the minkowski difference.\n            //So, expand the minkowski difference using the sweep direction with magnitude sufficient to fully include the plane defined by the origin and the sweep direction.\n            //If there's going to be a hit, then the origin will be within this expanded shape.\n\n\n\n            //If the sweep direction is found to be negative, the ray can be thought of as pointing away from the shape.\n            //However, the minkowski difference may contain the shape.  In this case, the time of impact is zero.\n\n            //If the swept (with sweep = 0 in case of incorrect direction) minkowski difference does not contain the shape, then the raycast cannot begin and we also know that the shapes will not intersect.\n\n            //If the sweep amount is nonnegative and the minkowski difference contains the shape, then the normal raycasting process can continue.\n            //Perform the usual local raycast, but use the swept minkowski difference.\n            //Once the surface is found, the final t parameter of the ray is equal to the sweep distance minus the local raycast computed t parameter.\n\n\n\n            RigidTransform localTransformB;\n            MinkowskiToolbox.GetLocalTransform(ref transformA, ref transformB, out localTransformB);\n\n\n            //First: Compute the sweep amount along the sweep direction.\n            //This sweep amount needs to expand the minkowski difference to fully intersect the plane defined by the sweep direction and origin.\n\n            float rayLengthSquared = localDirection.LengthSquared();\n            float sweepLength;\n            if (rayLengthSquared > Toolbox.Epsilon * .01f)\n            {\n                Vector3.Dot(ref localTransformB.Position, ref localDirection, out sweepLength);\n                sweepLength /= rayLengthSquared;\n                //Scale the sweep length by the margins.  Divide by the length to pull the margin into terms of the length of the ray.\n                sweepLength += (shapeA.maximumRadius + shapeB.maximumRadius) / (float)Math.Sqrt(rayLengthSquared);\n            }\n            else\n            {\n                rayLengthSquared = 0;\n                sweepLength = 0;\n            }\n            //If the sweep direction is found to be negative, the ray can be thought of as pointing away from the shape.\n            //Do not sweep backward.\n            bool negativeLength;\n            if (negativeLength = sweepLength < 0)\n                sweepLength = 0;\n\n\n\n            Vector3 sweep;\n            Vector3.Multiply(ref localDirection, sweepLength, out sweep);\n            //Check to see if the origin is contained within the swept shape.\n            if (!AreSweptShapesIntersecting(shapeA, shapeB, ref sweep, ref localTransformB, out hit.Location)) //Computes a hit location to be used if the early-outs due to being in contact.\n            {\n                //The origin is not contained within the sweep volume.  The raycast definitely misses.\n                hit.T = float.MaxValue;\n                hit.Normal = new Vector3();\n                hit.Location = new Vector3();\n                return false;\n            }\n            if (negativeLength)\n            {\n                //The origin is contained, but we shouldn't continue.\n                //The ray is facing backwards.  The time of impact would be 0.\n                hit.T = 0;\n                Vector3.Normalize(ref localDirection, out hit.Normal);\n                Vector3.Transform(ref hit.Normal, ref transformA.Orientation, out hit.Normal);\n                //hit.Location = hit.T * localDirection;\n                Vector3.Transform(ref hit.Location, ref transformA.Orientation, out hit.Location);\n                Vector3.Add(ref hit.Location, ref transformA.Position, out hit.Location);\n                hit.Location += sweepA * hit.T;\n                return true;\n            }\n\n            //OKAY! We've finally finished all the pre-testing.  Cast the ray!\n            if (LocalSweepCast(shapeA, shapeB, sweepLength, rayLengthSquared, ref localDirection, ref sweep, ref localTransformB, out hit))\n            {\n                //Compute the actual hit location on the minkowski surface.\n                Vector3 minkowskiRayHit = -hit.T * localDirection;\n                //TODO: This uses MPR to identify a witness point on shape A.\n                //It's a very roundabout way to do it.  There should be a much simpler/faster way to compute the witness point directly, or with a little sampling. \n                GetLocalPosition(shapeA, shapeB, ref localTransformB, ref minkowskiRayHit, out hit.Location);\n                //The hit location is still in local space, so transform it into world space using A's transform.\n                RigidTransform.Transform(ref hit.Location, ref transformA, out hit.Location);\n                Vector3.Transform(ref hit.Normal, ref transformA.Orientation, out hit.Normal);\n                //Push the world space hit location relative to object A along A's sweep direction.\n                Vector3 temp;\n                Vector3.Multiply(ref sweepA, hit.T, out temp);\n                Vector3.Add(ref temp, ref hit.Location, out hit.Location);\n                return true;\n            }\n            return false;\n\n        }\n\n        private static bool LocalSweepCast(ConvexShape shape, ConvexShape shapeB, float sweepLength, float rayLengthSquared, ref Vector3 localDirection, ref Vector3 sweep, ref RigidTransform localTransformB, out RayHit hit)\n        {\n            //By now, the ray is known to be within the swept shape and facing the right direction for a normal raycast.\n\n            //First guess a portal.\n            //This implementation is similar to that of the original XenoCollide.\n            //'n' will be the direction used to find supports throughout the algorithm.\n            Vector3 n = localDirection;\n            Vector3 v1, v1A;\n            GetSweptExtremePoint(shape, shapeB, ref localTransformB, ref sweep, ref n, out v1A, out v1);\n            //v1 could be zero in some degenerate cases.\n            //if (v1.LengthSquared() < Toolbox.Epsilon)\n            //{\n            //    hit.T = 0;\n            //    Vector3.Normalize(ref n, out hit.Normal);\n            //    Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n            //    //hit.Location = hit.T * localDirection;\n            //    Vector3.Transform(ref hit.Location, ref transform.Orientation, out hit.Location);\n            //    Vector3.Add(ref hit.Location, ref transform.Position, out hit.Location);\n            //    hit.Location += sweepA * hit.T;\n            //    return true;\n            //}\n\n            //Find another extreme point in a direction perpendicular to the previous.\n            Vector3 v2, v2A;\n            Vector3.Cross(ref localDirection, ref v1, out n);\n            hit.Location = new Vector3();\n            if (n.LengthSquared() < Toolbox.Epsilon * .01f)\n            {\n                //v1 and v0 could be parallel.\n                //This isn't a bad thing- it means the direction is exactly aligned with the extreme point offset.\n                //In other words, if the raycast is followed out to the surface, it will arrive at the extreme point!\n\n                if (rayLengthSquared > Toolbox.Epsilon * .01f)\n                    Vector3.Divide(ref localDirection, (float)Math.Sqrt(rayLengthSquared), out hit.Normal);\n                else\n                    hit.Normal = new Vector3();\n\n                float rate;\n                Vector3.Dot(ref  hit.Normal, ref localDirection, out rate);\n                float distance;\n                Vector3.Dot(ref  hit.Normal, ref v1, out distance);\n                if (rate > 0)\n                    hit.T = sweepLength - distance / rate;\n                else\n                    hit.T = sweepLength;\n\n                if (hit.T < 0)\n                    hit.T = 0;\n\n                //Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n                ////hit.Location = hit.T * localDirection;\n                //Vector3.Transform(ref hit.Location, ref transform.Orientation, out hit.Location);\n                //Vector3.Add(ref hit.Location, ref transform.Position, out hit.Location);\n                //hit.Location += sweepA * hit.T;\n                return hit.T <= 1;\n\n\n            }\n            GetSweptExtremePoint(shape, shapeB, ref localTransformB, ref sweep, ref n, out v2A, out v2);\n\n\n\n\n            Vector3 temp1, temp2;\n            //Set n for the first iteration.\n            Vector3.Cross(ref v1, ref v2, out n);\n\n            //It's possible that v1 and v2 were constructed in such a way that 'n' is not properly calibrated\n            //relative to the direction vector.\n            float dot;\n            Vector3.Dot(ref n, ref localDirection, out dot);\n            if (dot > 0)\n            {\n                //It's not properly calibrated.  Flip the winding (and the previously calculated normal).\n                Vector3.Negate(ref n, out n);\n                temp1 = v1;\n                v1 = v2;\n                v2 = temp1;\n                temp1 = v1A;\n                v1A = v2A;\n                v2A = temp1;\n            }\n\n            Vector3 v3, v3A;\n            int count = 0;\n            while (true)\n            {\n                //Find a final extreme point using the normal of the plane defined by v0, v1, v2.\n                GetSweptExtremePoint(shape, shapeB, ref localTransformB, ref sweep, ref n, out v3A, out v3);\n\n                if (count > MPRToolbox.OuterIterationLimit)\n                {\n                    //Can't enclose the origin! That's a bit odd.  Something is wrong; the preparation for this raycast\n                    //guarantees that the origin is enclosed.  Could be a numerical problem.\n                    hit.T = float.MaxValue;\n                    hit.Normal = new Vector3();\n                    hit.Location = new Vector3();\n                    return false;\n                }\n                count++;\n\n                //By now, the simplex is a tetrahedron, but it is not known whether or not the ray actually passes through the portal\n                //defined by v1, v2, v3.\n\n                // If the direction is outside the plane defined by v1,v0,v3, then the portal is invalid.\n                Vector3.Cross(ref v1, ref v3, out temp1);\n                Vector3.Dot(ref temp1, ref localDirection, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v2) with the new extreme point.\n                    v2 = v3;\n                    v2A = v3A;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Cross(ref v1, ref v3, out n);\n                    continue;\n                }\n\n                // If the direction is outside the plane defined by v3,v0,v2, then the portal is invalid.\n                Vector3.Cross(ref v3, ref v2, out temp1);\n                Vector3.Dot(ref temp1, ref localDirection, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v1) with the new extreme point.\n                    v1 = v3;\n                    v1A = v3A;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Cross(ref v2, ref v3, out n);\n                    continue;\n                }\n                break;\n            }\n\n\n            // Refine the portal.\n            count = 0;\n            while (true)\n            {\n                //Compute the outward facing normal.\n                Vector3.Subtract(ref v1, ref v2, out temp1);\n                Vector3.Subtract(ref v3, ref v2, out temp2);\n                Vector3.Cross(ref temp1, ref temp2, out n);\n\n\n                //Keep working towards the surface.  Find the next extreme point.\n                Vector3 v4, v4A;\n                GetSweptExtremePoint(shape, shapeB, ref localTransformB, ref sweep, ref n, out v4A, out v4);\n\n\n                //If the plane which generated the normal is very close to the extreme point, then we're at the surface.\n                Vector3.Dot(ref n, ref v1, out dot);\n                float supportDot;\n                Vector3.Dot(ref v4, ref n, out supportDot);\n\n                if (supportDot - dot < rayCastSurfaceEpsilon || count > MPRToolbox.InnerIterationLimit) // TODO: Could use a dynamic epsilon for possibly better behavior.\n                {\n                    //The portal is now on the surface.  The algorithm can now compute the TOI and exit.\n                    float lengthSquared = n.LengthSquared();\n                    if (lengthSquared > Toolbox.Epsilon * .00001f)\n                    {\n                        Vector3.Divide(ref n, (float)Math.Sqrt(lengthSquared), out hit.Normal);\n\n                        //The plane is very close to the surface, and the ray is known to pass through it.\n                        //dot is the rate.\n                        Vector3.Dot(ref  hit.Normal, ref localDirection, out dot);\n                        //supportDot is the distance to the plane.\n                        Vector3.Dot(ref  hit.Normal, ref v1, out supportDot);\n\n\n                        hit.T = sweepLength - supportDot / dot;\n                    }\n                    else\n                    {\n                        Vector3.Normalize(ref localDirection, out hit.Normal);\n                        hit.T = sweepLength;\n                    }\n                    //Sometimes, when the objects are intersecting, the T parameter can be negative.\n                    //In this case, just go with t = 0.\n                    if (hit.T < 0)\n                        hit.T = 0;\n\n\n                    //Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n\n                    //Vector3.Transform(ref hit.Location, ref transform.Orientation, out hit.Location);\n                    //Vector3.Add(ref hit.Location, ref transform.Position, out hit.Location);\n                    //hit.Location += sweepA * (hit.T);\n\n                    //Compute the barycentric coordinates of the ray hit location.\n                    //Vector3 mdHitLocation = t * localDirection;\n                    //float v1Weight, v2Weight, v3Weight;\n                    //Toolbox.GetBarycentricCoordinates(ref mdHitLocation, ref v1, ref v2, ref v3, out v1Weight, out v2Weight, out v3Weight);\n                    //hit.Location = v1Weight * v1A + v2Weight * v2A + v3Weight * v3A;\n                    //hit.Location += sweepA * hit.T;\n\n                    //Vector3.Transform(ref hit.Location, ref transform.Orientation, out hit.Location);\n                    //Vector3.Add(ref hit.Location, ref transform.Position, out hit.Location);\n\n                    return hit.T <= 1;\n                }\n\n                //Still haven't exited, so refine the portal.\n                //Test direction against the three planes that separate the new portal candidates: (v1,v4,v0) (v2,v4,v0) (v3,v4,v0)\n\n\n                //This may look a little weird at first.\n                //'inside' here means 'on the positive side of the plane.'\n                //There are three total planes being tested, one for each of v1, v2, and v3.\n                //The planes are created from consistently wound vertices, so it's possible to determine\n                //where the ray passes through the portal based upon its relationship to two of the three planes.\n                //The third vertex which is found to be opposite the face which contains the ray is replaced with the extreme point.\n\n                //This v4 x direction is just a minor reordering of a scalar triple product: (v1 x v4) * direction.\n                //It eliminates the need for extra cross products for the inner if.\n                Vector3.Cross(ref v4, ref localDirection, out temp1);\n                Vector3.Dot(ref v1, ref temp1, out dot);\n                if (dot >= 0)\n                {\n                    Vector3.Dot(ref v2, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v1 = v4; // Inside v1 & inside v2 ==> eliminate v1\n                        v1A = v4A;\n                    }\n                    else\n                    {\n                        v3 = v4; // Inside v1 & outside v2 ==> eliminate v3\n                        v3A = v4A;\n                    }\n                }\n                else\n                {\n                    Vector3.Dot(ref v3, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v2 = v4; // Outside v1 & inside v3 ==> eliminate v2\n                        v2A = v4A;\n                    }\n                    else\n                    {\n                        v1 = v4; // Outside v1 & outside v3 ==> eliminate v1\n                        v1A = v4A;\n                    }\n                }\n\n                count++;\n\n            }\n        }\n\n\n        /// <summary>\n        /// Computes the position of the minkowski point in the local space of A.\n        /// This assumes that the minkowski point is contained in A-B.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape to test.</param>\n        /// <param name=\"shapeB\">Second shape to test.</param>\n        /// <param name=\"localTransformB\">Transform of shape B in the local space of A.</param>\n        /// <param name=\"minkowskiPosition\">Position in minkowski space to pull into the local space of A.</param>\n        /// <param name=\"position\">Position of the minkowski space point in the local space of A.</param>\n        internal static void GetLocalPosition(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform localTransformB, ref Vector3 minkowskiPosition, out Vector3 position)\n        {\n            //Compute the ray.  This points from a point known to be inside the minkowski sum to the test minkowski position;\n            //The centers of the shapes are used to create the interior point.\n            Vector3 rayDirection;\n            Vector3.Add(ref minkowskiPosition, ref localTransformB.Position, out rayDirection);\n\n            //It's possible that the point is extremely close to the A-B center.  In this case, early out.\n            if (rayDirection.LengthSquared() < Toolbox.Epsilon)\n            {\n                //0,0,0 is the contributing position from object A if it overlaps with the A-B minkowski center.\n                //A-B center is fromed from the center position of A minus the center position of B.  We're in A's local space.\n                position = new Vector3();\n                //DEBUGlastPosition = position;\n                return;\n            }\n\n            Vector3 v0;\n            Vector3.Negate(ref localTransformB.Position, out v0); //Since we're in A's local space, A-B is just -B.\n\n\n\n            //Now that the ray is known, create a portal through which the ray passes.\n            //To do this, first guess a portal.\n            //This implementation is similar to that of the original XenoCollide.\n            //'n' will be the direction used to find supports throughout the algorithm.\n            Vector3 n = rayDirection;\n            Vector3 v1;\n            Vector3 v1A, v1B; //extreme point contributions from each shape.  Used later to compute contact position; could be used to cache simplex too.\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v1A, out v1B, out v1);\n\n            //Find another extreme point in a direction perpendicular to the previous.\n            Vector3 v2;\n            Vector3 v2A, v2B;\n            Vector3.Cross(ref v1, ref v0, out n);\n            if (n.LengthSquared() < Toolbox.Epsilon)\n            {\n                //v1 and v0 could be parallel.\n                //This isn't a bad thing- it means the direction is exactly aligned with the extreme point offset.\n                //In other words, if the raycast is followed out to the surface, it will arrive at the extreme point!\n                //If the origin is further along this direction than the extreme point, then there is no intersection.\n                //If the origin is within this extreme point, then there is an intersection.\n                //For this test, we already guarantee that the point is extremely close to the A-B shape or inside of it, so don't bother\n                //trying to return false.\n                float dot = Vector3.Dot(v1 - minkowskiPosition, rayDirection);\n                //Vector3.Dot(ref v1, ref rayDirection, out dot);\n                //if (dot < 0) //if we were trying to return false here (in a IsPointContained style test), then the '0' should actually be a dot between the minkowskiPoint and rayDirection (simplified by a subtraction and then a dot).\n                //{\n                //    //Origin is outside.\n                //    position = new Vector3();\n                //    return false;\n                //}\n                //Origin is inside.\n                //Compute barycentric coordinates along simplex (segment).\n                float dotv0 = Vector3.Dot(v0 - minkowskiPosition, rayDirection);\n                //Dot > 0, so dotv0 starts out negative.\n                //Vector3.Dot(ref v0, ref rayDirection, out dotv0);\n                float barycentricCoordinate = -dotv0 / (dot - dotv0);\n                //Vector3.Subtract(ref v1A, ref v0A, out offset); //'v0a' is just the zero vector, so there's no need to calculate the offset.\n                Vector3.Multiply(ref v1A, barycentricCoordinate, out position);\n                Vector3 offset;\n                Vector3.Subtract(ref v1B, ref localTransformB.Position, out offset);\n                return;\n            }\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v2A, out v2B, out v2);\n\n            Vector3 temp;\n            Vector3 v0v1, v0v2;\n            //Set n for the first iteration.\n            Vector3.Subtract(ref v1, ref v0, out v0v1);\n            Vector3.Subtract(ref v2, ref v0, out v0v2);\n            Vector3.Cross(ref v0v1, ref v0v2, out n);\n\n            Vector3 pointToV0;\n            Vector3.Subtract(ref v0, ref minkowskiPosition, out pointToV0);\n            Vector3 v3A, v3B, v3;\n            int count = 0;\n            while (true)\n            {\n                //Find a final extreme point using the normal of the plane defined by v0, v1, v2.\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v3A, out v3B, out v3);\n\n                if (count > MPRToolbox.OuterIterationLimit)\n                    break;\n                count++;\n                //By now, the simplex is a tetrahedron, but it is not known whether or not the origin ray found earlier actually passes through the portal\n                //defined by v1, v2, v3.\n\n                // If the origin is outside the plane defined by v1,v0,v3, then the portal is invalid.\n                Vector3 v0v3;\n                Vector3.Subtract(ref v1, ref v0, out v0v1);\n                Vector3.Subtract(ref v3, ref v0, out v0v3);\n                Vector3.Cross(ref v0v1, ref v0v3, out temp);\n                float dot;\n                Vector3.Dot(ref temp, ref pointToV0, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v2) with the new extreme point.\n                    v2 = v3;\n                    v2A = v3A;\n                    v2B = v3B;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Cross(ref v0v1, ref v0v3, out n);\n                    continue;\n                }\n\n                // If the origin is outside the plane defined by v3,v0,v2, then the portal is invalid.\n                Vector3.Subtract(ref v2, ref v0, out v0v2);\n                Vector3.Cross(ref v0v3, ref v0v2, out temp);\n                Vector3.Dot(ref temp, ref pointToV0, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v1) with the new extreme point.\n                    v1 = v3;\n                    v1A = v3A;\n                    v1B = v3B;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Cross(ref v0v2, ref v0v3, out n);\n                    continue;\n                }\n                break;\n            }\n\n            //if (!VerifySimplex(ref v0, ref v1, ref v2, ref v3, ref rayDirection))\n            //    Debug.WriteLine(\"Break.\");\n\n\n            // Refine the portal.\n            while (true)\n            {\n                //Test the origin against the plane defined by v1, v2, v3.  If it's inside, we're done.\n                //Compute the outward facing normal.\n                Vector3 v2v3, v2v1;\n                Vector3.Subtract(ref v3, ref v2, out v2v3);\n                Vector3.Subtract(ref v1, ref v2, out v2v1);\n                Vector3.Cross(ref v2v3, ref v2v1, out n);\n                float dot;\n                Vector3 pointToV1;\n                Vector3.Subtract(ref v1, ref minkowskiPosition, out pointToV1);\n                Vector3.Dot(ref pointToV1, ref n, out dot);\n                //Because this method is intended for use with surface collisions, rely on the surface push case.\n                //This will not significantly harm performance, but will simplify the termination condition.\n                //if (dot >= 0)\n                //{\n                //    Vector3 temp3;\n                //    //Compute the barycentric coordinates of the origin.\n                //    //This is done by computing the scaled volume (parallelepiped) of the tetrahedra \n                //    //formed by each triangle of the v0v1v2v3 tetrahedron and the origin.\n\n                //    //TODO: consider a different approach using T parameter or something.\n                //    Vector3.Subtract(ref v1, ref v0, out temp1);\n                //    Vector3.Subtract(ref v2, ref v0, out temp2);\n                //    Vector3.Subtract(ref v3, ref v0, out temp3);\n\n                //    Vector3 cross;\n                //    Vector3.Cross(ref temp1, ref temp2, out cross);\n                //    float v0v1v2v3volume;\n                //    Vector3.Dot(ref cross, ref temp3, out v0v1v2v3volume);\n\n                //    Vector3.Cross(ref v1, ref v2, out cross);\n                //    float ov1v2v3volume;\n                //    Vector3.Dot(ref cross, ref v3, out ov1v2v3volume);\n\n                //    Vector3.Cross(ref rayDirection, ref temp2, out cross);\n                //    float v0ov2v3volume;\n                //    Vector3.Dot(ref cross, ref temp3, out v0ov2v3volume);\n\n                //    Vector3.Cross(ref temp1, ref rayDirection, out cross);\n                //    float v0v1ov3volume;\n                //    Vector3.Dot(ref cross, ref temp3, out v0v1ov3volume);\n\n                //    if (v0v1v2v3volume > Toolbox.Epsilon * .01f)\n                //    {\n                //        float inverseTotalVolume = 1 / v0v1v2v3volume;\n                //        float v0Weight = ov1v2v3volume * inverseTotalVolume;\n                //        float v1Weight = v0ov2v3volume * inverseTotalVolume;\n                //        float v2Weight = v0v1ov3volume * inverseTotalVolume;\n                //        float v3Weight = 1 - v0Weight - v1Weight - v2Weight;\n                //        position = v1Weight * v1A + v2Weight * v2A + v3Weight * v3A;\n                //    }\n                //    else\n                //    {\n                //        position = new Vector3();\n                //    }\n                //    //DEBUGlastPosition = position;\n                //    return;\n                //}\n\n                //We haven't yet found the origin.  Find the support point in the portal's outward facing direction.\n                Vector3 v4, v4A, v4B;\n                MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref n, ref localTransformB, out v4A, out v4B, out v4);\n                //If the origin is further along the direction than the extreme point, it's not inside the shape.\n                float dot2;\n                Vector3 pointToV4;\n                Vector3.Subtract(ref v4, ref minkowskiPosition, out pointToV4);\n                Vector3.Dot(ref pointToV4, ref n, out dot2);\n                //if (dot2 < 0) //We're not concerned with this test!  We already have guarantees that the shape contains or very nearly contains the minkowski point.\n                //{\n                //    //The origin is outside!\n                //    position = new Vector3();\n                //    return false;\n                //}\n\n                //If the plane which generated the normal is very close to the extreme point, then we're at the surface\n                //and we have not found the origin; it's either just BARELY inside, or it is outside.  Assume it's outside.\n                if (dot2 - dot < rayCastSurfaceEpsilon || count > MPRToolbox.InnerIterationLimit) // TODO: Could use a dynamic epsilon for possibly better behavior.\n                {\n                    //We found the surface.  Technically, we did not find the minkowski point yet, but it must be really close based on the guarantees\n                    //required by this method.\n                    //The ray intersection with the plane defined by our final portal should be extremely close to the actual minkowski point.\n                    //In fact, it is probably close enough such that the barycentric coordinates can be computed using the minkowski point directly!\n                    float weight1, weight2, weight3;\n                    Toolbox.GetBarycentricCoordinates(ref minkowskiPosition, ref v1, ref v2, ref v3, out weight1, out weight2, out weight3);\n                    Vector3.Multiply(ref v1A, weight1, out position);\n                    Vector3.Multiply(ref v2A, weight2, out v2A);\n                    Vector3.Multiply(ref v3A, weight3, out v3A);\n                    Vector3.Add(ref v2A, ref position, out position);\n                    Vector3.Add(ref v3A, ref position, out position);\n\n                    return;\n                }\n                count++;\n\n                //Still haven't exited, so refine the portal.\n                //Test minkowskiPoint against the three planes that separate the new portal candidates: (v1,v4,v0) (v2,v4,v0) (v3,v4,v0)\n                Vector3.Cross(ref pointToV4, ref pointToV0, out temp);\n                Vector3.Dot(ref pointToV1, ref temp, out dot);\n                if (dot >= 0) //Dot v0 x v4 against v1, and dot it against \n                {\n                    Vector3 pointToV2;\n                    Vector3.Subtract(ref v2, ref minkowskiPosition, out pointToV2);\n                    Vector3.Dot(ref pointToV2, ref temp, out dot);\n                    if (dot >= 0)\n                    {\n                        v1 = v4; // Inside v1 & inside v2 ==> eliminate v1\n                        v1A = v4A;\n                        v1B = v4B;\n                    }\n                    else\n                    {\n                        v3 = v4; // Inside v1 & outside v2 ==> eliminate v3\n                        v3A = v4A;\n                        v3B = v4B;\n                    }\n                }\n                else\n                {\n                    Vector3 pointToV3;\n                    Vector3.Subtract(ref v3, ref minkowskiPosition, out pointToV3);\n                    Vector3.Dot(ref pointToV3, ref temp, out dot);\n                    if (dot >= 0)\n                    {\n                        v2 = v4; // Outside v1 & inside v3 ==> eliminate v2\n                        v2A = v4A;\n                        v2B = v4B;\n                    }\n                    else\n                    {\n                        v1 = v4; // Outside v1 & outside v3 ==> eliminate v1\n                        v1A = v4A;\n                        v1B = v4B;\n                    }\n                }\n\n                //if (!VerifySimplex(ref v0, ref v1, ref v2, ref v3, ref rayDirection))\n                //    Debug.WriteLine(\"Break.\");\n\n            }\n\n\n        }\n\n        /// <summary>\n        /// Determines if two shapes are intersecting.\n        /// </summary>\n        /// <param name=\"shapeA\">First shape in the pair.</param>\n        /// <param name=\"shapeB\">Second shape in the pair.</param>\n        /// <param name=\"sweep\">Sweep direction and magnitude.</param>\n        /// <param name=\"localTransformB\">Transformation of shape B in the local space of A.</param>\n        /// <param name=\"position\">Position of the minkowski difference origin in the local space of A, if the swept volumes intersect.</param>\n        /// <returns>Whether the swept shapes intersect.</returns>\n        public static bool AreSweptShapesIntersecting(ConvexShape shapeA, ConvexShape shapeB, ref Vector3 sweep, ref RigidTransform localTransformB, out Vector3 position)\n        {\n            //It's possible that the two objects' centers are overlapping, or very very close to it.  In this case, \n            //they are obviously colliding and we can immediately exit.\n            if (localTransformB.Position.LengthSquared() < Toolbox.Epsilon)\n            {\n                position = new Vector3();\n                return true;\n            }\n\n            Vector3 v0;\n            Vector3.Negate(ref localTransformB.Position, out v0); //Since we're in A's local space, A-B is just -B.\n\n\n\n            //Now that the origin ray is known, create a portal through which the ray passes.\n            //To do this, first guess a portal.\n            //This implementation is similar to that of the original XenoCollide.\n            //'n' will be the direction used to find supports throughout the algorithm.\n            Vector3 n = localTransformB.Position;\n            Vector3 v1;\n            Vector3 v1A; //extreme point contributions from each shape.  Used later to compute contact position; could be used to cache simplex too.\n            //MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shape, shapeB, ref n, ref localPoint, out v1A, out v1B, out v1);\n            GetSweptExtremePoint(shapeA, shapeB, ref localTransformB, ref sweep, ref n, out v1A, out v1);\n\n            //Find another extreme point in a direction perpendicular to the previous.\n            Vector3 v2;\n            Vector3 v2A;\n            Vector3.Cross(ref v1, ref v0, out n);\n            if (n.LengthSquared() < Toolbox.Epsilon)\n            {\n                //v1 and v0 could be parallel.\n                //This isn't a bad thing- it means the direction is exactly aligned with the extreme point offset.\n                //In other words, if the raycast is followed out to the surface, it will arrive at the extreme point!\n                //If the origin is further along this direction than the extreme point, then there is no intersection.\n                //If the origin is within this extreme point, then there is an intersection.\n                float dot;\n                Vector3.Dot(ref v1, ref localTransformB.Position, out dot);\n                if (dot < 0)\n                {\n                    //Origin is outside.\n                    position = new Vector3();\n                    return false;\n                }\n                //Origin is inside.\n                //Compute barycentric coordinates along simplex (segment).\n                float dotv0;\n                //Dot > 0, so dotv0 starts out negative.\n                Vector3.Dot(ref v0, ref localTransformB.Position, out dotv0);\n                float barycentricCoordinate = -dotv0 / (dot - dotv0);\n                //Vector3.Subtract(ref v1A, ref v0A, out offset); //'v0a' is just the zero vector, so there's no need to calculate the offset.\n                Vector3.Multiply(ref v1A, barycentricCoordinate, out position);\n                return true;\n            }\n            //MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shape, shapeB, ref n, ref localPoint, out v2A, out v2B, out v2);\n            GetSweptExtremePoint(shapeA, shapeB, ref localTransformB, ref sweep, ref n, out v2A, out v2);\n\n            Vector3 temp1, temp2;\n            //Set n for the first iteration.\n            Vector3.Subtract(ref v1, ref v0, out temp1);\n            Vector3.Subtract(ref v2, ref v0, out temp2);\n            Vector3.Cross(ref temp1, ref temp2, out n);\n\n\n            Vector3 v3A, v3;\n            int count = 0;\n            while (true)\n            {\n                //Find a final extreme point using the normal of the plane defined by v0, v1, v2.\n                //MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shape, shapeB, ref n, ref localPoint, out v3A, out v3B, out v3);\n                GetSweptExtremePoint(shapeA, shapeB, ref localTransformB, ref sweep, ref n, out v3A, out v3);\n\n                if (count > MPRToolbox.OuterIterationLimit)\n                    break;\n                count++;\n                //By now, the simplex is a tetrahedron, but it is not known whether or not the origin ray found earlier actually passes through the portal\n                //defined by v1, v2, v3.\n\n                // If the origin is outside the plane defined by v1,v0,v3, then the portal is invalid.\n                Vector3.Cross(ref v1, ref v3, out temp1);\n                float dot;\n                Vector3.Dot(ref temp1, ref v0, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v2) with the new extreme point.\n                    v2 = v3;\n                    v2A = v3A;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Subtract(ref v1, ref v0, out temp1);\n                    Vector3.Subtract(ref v3, ref v0, out temp2);\n                    Vector3.Cross(ref temp1, ref temp2, out n);\n                    continue;\n                }\n\n                // If the origin is outside the plane defined by v3,v0,v2, then the portal is invalid.\n                Vector3.Cross(ref v3, ref v2, out temp1);\n                Vector3.Dot(ref temp1, ref v0, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v1) with the new extreme point.\n                    v1 = v3;\n                    v1A = v3A;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Subtract(ref v2, ref v0, out temp1);\n                    Vector3.Subtract(ref v3, ref v0, out temp2);\n                    Vector3.Cross(ref temp1, ref temp2, out n);\n                    continue;\n                }\n                break;\n            }\n\n            //if (!VerifySimplex(ref v0, ref v1, ref v2, ref v3, ref localPoint.Position))\n            //    Debug.WriteLine(\"Break.\");\n\n\n            // Refine the portal.\n            while (true)\n            {\n                //Test the origin against the plane defined by v1, v2, v3.  If it's inside, we're done.\n                //Compute the outward facing normal.\n                Vector3.Subtract(ref v3, ref v2, out temp1);\n                Vector3.Subtract(ref v1, ref v2, out temp2);\n                Vector3.Cross(ref temp1, ref temp2, out n);\n                float dot;\n                Vector3.Dot(ref n, ref v1, out dot);\n                if (dot >= 0)\n                {\n                    Vector3 temp3;\n                    //Compute the barycentric coordinates of the origin.\n                    //This is done by computing the scaled volume (parallelepiped) of the tetrahedra \n                    //formed by each triangle of the v0v1v2v3 tetrahedron and the origin.\n\n                    //TODO: consider a different approach using T parameter or something.\n                    Vector3.Subtract(ref v1, ref v0, out temp1);\n                    Vector3.Subtract(ref v2, ref v0, out temp2);\n                    Vector3.Subtract(ref v3, ref v0, out temp3);\n\n                    Vector3 cross;\n                    Vector3.Cross(ref temp1, ref temp2, out cross);\n                    float v0v1v2v3volume;\n                    Vector3.Dot(ref cross, ref temp3, out v0v1v2v3volume);\n\n                    Vector3.Cross(ref v1, ref v2, out cross);\n                    float ov1v2v3volume;\n                    Vector3.Dot(ref cross, ref v3, out ov1v2v3volume);\n\n                    Vector3.Cross(ref localTransformB.Position, ref temp2, out cross);\n                    float v0ov2v3volume;\n                    Vector3.Dot(ref cross, ref temp3, out v0ov2v3volume);\n\n                    Vector3.Cross(ref temp1, ref localTransformB.Position, out cross);\n                    float v0v1ov3volume;\n                    Vector3.Dot(ref cross, ref temp3, out v0v1ov3volume);\n\n\n                    float inverseTotalVolume = 1 / v0v1v2v3volume;\n                    float v0Weight = ov1v2v3volume * inverseTotalVolume;\n                    float v1Weight = v0ov2v3volume * inverseTotalVolume;\n                    float v2Weight = v0v1ov3volume * inverseTotalVolume;\n                    float v3Weight = 1 - v0Weight - v1Weight - v2Weight;\n                    position = v1Weight * v1A + v2Weight * v2A + v3Weight * v3A;\n                    //DEBUGlastPosition = position;\n                    return true;\n                }\n\n                //We haven't yet found the origin.  Find the support point in the portal's outward facing direction.\n                Vector3 v4, v4A;\n                //MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shape, shapeB, ref n, ref localPoint, out v4A, out v4B, out v4); \n                GetSweptExtremePoint(shapeA, shapeB, ref localTransformB, ref sweep, ref n, out v4A, out v4);\n\n                //If the origin is further along the direction than the extreme point, it's not inside the shape.\n                float dot2;\n                Vector3.Dot(ref v4, ref n, out dot2);\n                if (dot2 < 0)\n                {\n                    //The origin is outside!\n                    position = new Vector3();\n                    return false;\n                }\n\n                //If the plane which generated the normal is very close to the extreme point, then we're at the surface\n                //and we have not found the origin; it's either just BARELY inside, or it is outside.  Assume it's outside.\n                if (dot2 - dot < surfaceEpsilon || count > MPRToolbox.InnerIterationLimit) // TODO: Could use a dynamic epsilon for possibly better behavior.\n                {\n                    position = new Vector3();\n                    //DEBUGlastPosition = position;\n                    return false;\n                }\n                count++;\n\n                //Still haven't exited, so refine the portal.\n                //Test origin against the three planes that separate the new portal candidates: (v1,v4,v0) (v2,v4,v0) (v3,v4,v0)\n                Vector3.Cross(ref v4, ref v0, out temp1);\n                Vector3.Dot(ref v1, ref temp1, out dot);\n                if (dot >= 0)\n                {\n                    Vector3.Dot(ref v2, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v1 = v4; // Inside v1 & inside v2 ==> eliminate v1\n                        v1A = v4A;\n                    }\n                    else\n                    {\n                        v3 = v4; // Inside v1 & outside v2 ==> eliminate v3\n                        v3A = v4A;\n                    }\n                }\n                else\n                {\n                    Vector3.Dot(ref v3, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v2 = v4; // Outside v1 & inside v3 ==> eliminate v2\n                        v2A = v4A;\n                    }\n                    else\n                    {\n                        v1 = v4; // Outside v1 & outside v3 ==> eliminate v1\n                        v1A = v4A;\n                    }\n                }\n\n                //if (!VerifySimplex(ref v0, ref v1, ref v2, ref v3, ref localPoint.Position))\n                //    Debug.WriteLine(\"Break.\");\n\n            }\n\n\n        }\n\n\n        static void GetSweptExtremePoint(ConvexShape shapeA, ConvexShape shapeB, ref RigidTransform localTransformB, ref Vector3 sweep, ref Vector3 extremePointDirection, out Vector3 extremePointA, out Vector3 extremePoint)\n        {\n            Vector3 b;\n            MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shapeA, shapeB, ref extremePointDirection, ref localTransformB, out extremePointA, out b, out extremePoint);\n            float dot;\n            Vector3.Dot(ref extremePointDirection, ref sweep, out dot);\n            if (dot > 0)\n            {\n                Vector3.Add(ref extremePoint, ref sweep, out extremePoint);\n            }\n        }\n\n        //RAY CAST\n        /// <summary>\n        /// Casts a ray against a shape.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test against the shape.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray.</param>\n        /// <param name=\"shape\">Shape to test with a ray.</param>\n        /// <param name=\"transform\">Transform to apply to the shape.</param>\n        /// <param name=\"hit\">Hit data of the ray on the shape, if any.</param>\n        /// <returns>Whether or not the swept shapes hit each other.</returns>\n        public static bool RayCast(Ray ray, float maximumLength, ConvexShape shape, ref RigidTransform transform, out RayHit hit)\n        {\n            //Compute the local origin and direction of the ray.\n            Ray localRay;\n            Quaternion conjugate;\n            Vector3.Subtract(ref ray.Position, ref transform.Position, out localRay.Position);\n            Quaternion.Conjugate(ref transform.Orientation, out conjugate);\n            Vector3.Transform(ref localRay.Position, ref conjugate, out localRay.Position);\n            Vector3.Transform(ref ray.Direction, ref conjugate, out localRay.Direction);\n\n            //Note that we will be casting the ray *backwards* against the sweep-expanded surface of the shape.\n            Vector3.Negate(ref localRay.Direction, out localRay.Direction);\n\n            //A ray cast is a special case of two-body sweeping.  This is implemented separately from the two-body sweep above almost entirely for a tiny performance boost.\n            //It also allows for certain tricks to help with numerical stability.\n\n            //Sweeping two objects against each other is very similar to the local surface cast.\n            //The ray starts at the origin and goes in the sweep direction.\n            //However, unlike the local surface cast, the origin may start outside of the minkowski difference.\n            //Additionally, the method can early out if the length traversed by the ray is found to be longer than the maximum length, or if the origin is found to be outside the minkowski difference.\n\n            //The support points of the minkowski difference are also modified.  By default, the minkowski difference should very rarely contain the origin.\n            //Sweep tests aren't very useful if the objects are intersecting!\n            //However, in order for the local surface cast to actually find a proper result (assuming there is a hit at all), the origin must be inside the minkowski difference.\n            //So, expand the minkowski difference using the sweep direction with magnitude sufficient to fully include the plane defined by the origin and the sweep direction.\n            //If there's going to be a hit, then the origin will be within this expanded shape.\n\n\n\n            //If the sweep direction is found to be negative, the ray can be thought of as pointing away from the shape.\n            //However, the minkowski difference may contain the shape.  In this case, the time of impact is zero.\n\n            //If the swept (with sweep = 0 in case of incorrect direction) minkowski difference does not contain the shape, then the raycast cannot begin and we also know that the shapes will not intersect.\n\n            //If the sweep amount is nonnegative and the minkowski difference contains the shape, then the normal raycasting process can continue.\n            //Perform the usual local raycast, but use the swept minkowski difference.\n            //Once the surface is found, the final t parameter of the ray is equal to the sweep distance minus the local raycast computed t parameter.\n\n\n            //Given that this is a ray cast, we can make some modifications.  Rays frequently traverse large distances, but stretching the swept volume\n            //a huge amount to match could manifest numerical issues.  Instead, pull the ray up close to the object.\n            RayHit sphereHit;\n\n            if (Toolbox.RayCastSphere(ref ray, ref transform.Position, shape.maximumRadius, maximumLength, out sphereHit))\n            {\n                //We can scoot ourselves almost all the way up to the intersection with the outer sphere.\n                //Stop just short to prevent a possible erroneous 'just-barely-contained' result.\n                sphereHit.T = Math.Max(sphereHit.T - .1f, 0);\n                Vector3 offset;\n                Vector3.Multiply(ref localRay.Direction, -sphereHit.T, out offset);\n                Vector3.Add(ref localRay.Position, ref offset, out localRay.Position);\n            }\n            else\n            {\n                //If the ray cast doesn't hit the bounding sphere, it's impossible for the ray to hit the shape itself.\n                hit.T = float.MaxValue;\n                hit.Normal = new Vector3();\n                hit.Location = new Vector3();\n                return false;\n            }\n\n\n\n            //First: Compute the sweep amount along the sweep direction.\n            //This sweep amount needs to expand the minkowski difference to fully intersect the plane defined by the sweep direction and origin.\n\n            float rayLengthSquared = localRay.Direction.LengthSquared();\n            float sweepLength;\n            if (rayLengthSquared > Toolbox.Epsilon * .01f)\n            {\n                Vector3.Dot(ref localRay.Position, ref localRay.Direction, out sweepLength);\n                //Ray length isn't necessarily normalized...\n                sweepLength /= rayLengthSquared;\n                //Scale the sweep length by the margins.  Divide by the length to pull the margin into terms of the length of the ray.\n                sweepLength += shape.maximumRadius / (float)Math.Sqrt(rayLengthSquared);\n            }\n            else\n            {\n                rayLengthSquared = 0;\n                sweepLength = 0;\n            }\n            //If the sweep direction is found to be negative, the ray can be thought of as pointing away from the shape.\n            //Do not sweep backward.\n            bool negativeLength;\n            if (negativeLength = sweepLength < 0)\n                sweepLength = 0;\n\n\n\n            Vector3 sweep;\n            Vector3.Multiply(ref localRay.Direction, sweepLength, out sweep);\n            //Check to see if the origin is contained within the swept shape.\n            if (!SweptShapeContainsPoint(shape, ref sweep, ref localRay.Position))\n            {\n                //The origin is not contained within the sweep volume.  The raycast definitely misses.\n                hit.T = float.MaxValue;\n                hit.Normal = new Vector3();\n                hit.Location = new Vector3();\n                return false;\n            }\n            if (negativeLength)\n            {\n                //The origin is contained, but we shouldn't continue.\n                //The ray is facing backwards.  The time of impact would be 0 (because we already verified that we are contained in the shape volume).\n                hit.T = 0;\n                Vector3.Normalize(ref ray.Direction, out hit.Normal);\n                hit.Location = ray.Position;\n                return true;\n            }\n\n            //OKAY! We've finally finished all the pre-testing.  Cast the ray!\n            if (LocalSweepCast(shape, sweepLength, rayLengthSquared, ref localRay.Direction, ref sweep, ref localRay.Position, out hit))\n            {\n                hit.T += sphereHit.T;\n                if (hit.T <= maximumLength)\n                {\n                    //Get the world space hit location.\n                    Vector3.Multiply(ref ray.Direction, hit.T, out hit.Location);\n                    Vector3.Add(ref hit.Location, ref ray.Position, out hit.Location);\n                    //Transform the normal.\n                    Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n                    return true;\n                }\n            }\n            return false;\n\n        }\n\n        /// <summary>\n        /// Determines if a point is contained within the swept volume of a shape.\n        /// </summary>\n        /// <param name=\"shape\">First shape in the pair.</param>\n        /// <param name=\"sweep\">Sweep direction and magnitude.</param>\n        /// <param name=\"localPoint\">Point to check for containment in the shape in the local space of the shape.</param>\n        /// <returns>Whether the swept shape contains the point.</returns>\n        public static bool SweptShapeContainsPoint(ConvexShape shape, ref Vector3 sweep, ref Vector3 localPoint)\n        {\n            //It's possible that the two objects' centers are overlapping, or very very close to it.  In this case, \n            //they are obviously colliding and we can immediately exit.\n            if (localPoint.LengthSquared() < Toolbox.Epsilon)\n            {\n                return true;\n            }\n\n            Vector3 v0;\n            Vector3.Negate(ref localPoint, out v0); //Since we're in A's local space, A-B is just -B.\n\n\n\n            //Now that the origin ray is known, create a portal through which the ray passes.\n            //To do this, first guess a portal.\n            //This implementation is similar to that of the original XenoCollide.\n            //'n' will be the direction used to find supports throughout the algorithm.\n            Vector3 n = localPoint;\n            Vector3 v1;\n            //MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shape, shapeB, ref n, ref localPoint, out v1A, out v1B, out v1);\n            GetSweptExtremePoint(shape, ref localPoint, ref sweep, ref n, out v1);\n\n            //Find another extreme point in a direction perpendicular to the previous.\n            Vector3 v2;\n            Vector3.Cross(ref v1, ref v0, out n);\n            if (n.LengthSquared() < Toolbox.Epsilon)\n            {\n                //v1 and v0 could be parallel.\n                //This isn't a bad thing- it means the direction is exactly aligned with the extreme point offset.\n                //In other words, if the raycast is followed out to the surface, it will arrive at the extreme point!\n                //If the origin is further along this direction than the extreme point, then there is no intersection.\n                //If the origin is within this extreme point, then there is an intersection.\n                float dot;\n                Vector3.Dot(ref v1, ref localPoint, out dot);\n                if (dot < 0)\n                {\n                    //Origin is outside.\n                    return false;\n                }\n                return true;\n            }\n            //MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shape, shapeB, ref n, ref localPoint, out v2A, out v2B, out v2);\n            GetSweptExtremePoint(shape, ref localPoint, ref sweep, ref n, out v2);\n\n            Vector3 temp1, temp2;\n            //Set n for the first iteration.\n            Vector3.Subtract(ref v1, ref v0, out temp1);\n            Vector3.Subtract(ref v2, ref v0, out temp2);\n            Vector3.Cross(ref temp1, ref temp2, out n);\n\n\n            Vector3 v3;\n            int count = 0;\n            while (true)\n            {\n                //Find a final extreme point using the normal of the plane defined by v0, v1, v2.\n                //MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shape, shapeB, ref n, ref localPoint, out v3A, out v3B, out v3);\n                GetSweptExtremePoint(shape, ref localPoint, ref sweep, ref n, out v3);\n\n                if (count > MPRToolbox.OuterIterationLimit)\n                    break;\n                count++;\n                //By now, the simplex is a tetrahedron, but it is not known whether or not the origin ray found earlier actually passes through the portal\n                //defined by v1, v2, v3.\n\n                // If the origin is outside the plane defined by v1,v0,v3, then the portal is invalid.\n                Vector3.Cross(ref v1, ref v3, out temp1);\n                float dot;\n                Vector3.Dot(ref temp1, ref v0, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v2) with the new extreme point.\n                    v2 = v3;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Subtract(ref v1, ref v0, out temp1);\n                    Vector3.Subtract(ref v3, ref v0, out temp2);\n                    Vector3.Cross(ref temp1, ref temp2, out n);\n                    continue;\n                }\n\n                // If the origin is outside the plane defined by v3,v0,v2, then the portal is invalid.\n                Vector3.Cross(ref v3, ref v2, out temp1);\n                Vector3.Dot(ref temp1, ref v0, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v1) with the new extreme point.\n                    v1 = v3;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Subtract(ref v2, ref v0, out temp1);\n                    Vector3.Subtract(ref v3, ref v0, out temp2);\n                    Vector3.Cross(ref temp1, ref temp2, out n);\n                    continue;\n                }\n                break;\n            }\n\n            //if (!VerifySimplex(ref v0, ref v1, ref v2, ref v3, ref localPoint.Position))\n            //    Debug.WriteLine(\"Break.\");\n\n\n            // Refine the portal.\n            while (true)\n            {\n                //Test the origin against the plane defined by v1, v2, v3.  If it's inside, we're done.\n                //Compute the outward facing normal.\n                Vector3.Subtract(ref v3, ref v2, out temp1);\n                Vector3.Subtract(ref v1, ref v2, out temp2);\n                Vector3.Cross(ref temp1, ref temp2, out n);\n                float dot;\n                Vector3.Dot(ref n, ref v1, out dot);\n                if (dot >= 0)\n                {\n                    return true;\n                }\n\n                //We haven't yet found the origin.  Find the support point in the portal's outward facing direction.\n                Vector3 v4;\n                //MinkowskiToolbox.GetLocalMinkowskiExtremePoint(shape, shapeB, ref n, ref localPoint, out v4A, out v4B, out v4); \n                GetSweptExtremePoint(shape, ref localPoint, ref sweep, ref n, out v4);\n\n                //If the origin is further along the direction than the extreme point, it's not inside the shape.\n                float dot2;\n                Vector3.Dot(ref v4, ref n, out dot2);\n                if (dot2 < 0)\n                {\n                    //The origin is outside!\n                    return false;\n                }\n\n                //If the plane which generated the normal is very close to the extreme point, then we're at the surface\n                //and we have not found the origin; it's either just BARELY inside, or it is outside.  Assume it's outside.\n                if (dot2 - dot < surfaceEpsilon || count > MPRToolbox.InnerIterationLimit) // TODO: Could use a dynamic epsilon for possibly better behavior.\n                {\n                    //DEBUGlastPosition = position;\n                    return false;\n                }\n                count++;\n\n                //Still haven't exited, so refine the portal.\n                //Test origin against the three planes that separate the new portal candidates: (v1,v4,v0) (v2,v4,v0) (v3,v4,v0)\n                Vector3.Cross(ref v4, ref v0, out temp1);\n                Vector3.Dot(ref v1, ref temp1, out dot);\n                if (dot >= 0)\n                {\n                    Vector3.Dot(ref v2, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v1 = v4; // Inside v1 & inside v2 ==> eliminate v1\n                    }\n                    else\n                    {\n                        v3 = v4; // Inside v1 & outside v2 ==> eliminate v3\n                    }\n                }\n                else\n                {\n                    Vector3.Dot(ref v3, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v2 = v4; // Outside v1 & inside v3 ==> eliminate v2\n                    }\n                    else\n                    {\n                        v1 = v4; // Outside v1 & outside v3 ==> eliminate v1\n                    }\n                }\n\n                //if (!VerifySimplex(ref v0, ref v1, ref v2, ref v3, ref localPoint.Position))\n                //    Debug.WriteLine(\"Break.\");\n\n            }\n\n\n        }\n\n\n        private static bool LocalSweepCast(ConvexShape shape, float sweepLength, float rayLengthSquared, ref Vector3 localDirection, ref Vector3 sweep, ref Vector3 rayOrigin, out RayHit hit)\n        {\n            //By now, the ray is known to be within the swept shape and facing the right direction for a normal raycast.\n\n            //First guess a portal.\n            //This implementation is similar to that of the original XenoCollide.\n            //'n' will be the direction used to find supports throughout the algorithm.\n            Vector3 n = localDirection;\n            Vector3 v1;\n            GetSweptExtremePoint(shape, ref rayOrigin, ref sweep, ref n, out v1);\n            //v1 could be zero in some degenerate cases.\n            //if (v1.LengthSquared() < Toolbox.Epsilon)\n            //{\n            //    hit.T = 0;\n            //    Vector3.Normalize(ref n, out hit.Normal);\n            //    Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n            //    //hit.Location = hit.T * localDirection;\n            //    Vector3.Transform(ref hit.Location, ref transform.Orientation, out hit.Location);\n            //    Vector3.Add(ref hit.Location, ref transform.Position, out hit.Location);\n            //    hit.Location += sweepA * hit.T;\n            //    return true;\n            //}\n\n            //Find another extreme point in a direction perpendicular to the previous.\n            Vector3 v2;\n            Vector3.Cross(ref localDirection, ref v1, out n);\n            hit.Location = new Vector3();\n            if (n.LengthSquared() < Toolbox.Epsilon * .01f)\n            {\n                //v1 and v0 could be parallel.\n                //This isn't a bad thing- it means the direction is exactly aligned with the extreme point offset.\n                //In other words, if the raycast is followed out to the surface, it will arrive at the extreme point!\n\n                if (rayLengthSquared > Toolbox.Epsilon * .01f)\n                    Vector3.Divide(ref localDirection, (float)Math.Sqrt(rayLengthSquared), out hit.Normal);\n                else\n                    hit.Normal = new Vector3();\n\n                float rate;\n                Vector3.Dot(ref  hit.Normal, ref localDirection, out rate);\n                float distance;\n                Vector3.Dot(ref  hit.Normal, ref v1, out distance);\n                if (rate > 0)\n                    hit.T = sweepLength - distance / rate;\n                else\n                    hit.T = sweepLength;\n\n                if (hit.T < 0)\n                    hit.T = 0;\n\n                //Vector3.Transform(ref hit.Normal, ref transform.Orientation, out hit.Normal);\n                ////hit.Location = hit.T * localDirection;\n                //Vector3.Transform(ref hit.Location, ref transform.Orientation, out hit.Location);\n                //Vector3.Add(ref hit.Location, ref transform.Position, out hit.Location);\n                //hit.Location += sweepA * hit.T;\n                return hit.T <= 1;\n\n\n            }\n            GetSweptExtremePoint(shape, ref rayOrigin, ref sweep, ref n, out v2);\n\n\n\n\n            Vector3 temp1, temp2;\n            //Set n for the first iteration.\n            Vector3.Cross(ref v1, ref v2, out n);\n\n            //It's possible that v1 and v2 were constructed in such a way that 'n' is not properly calibrated\n            //relative to the direction vector.\n            float dot;\n            Vector3.Dot(ref n, ref localDirection, out dot);\n            if (dot > 0)\n            {\n                //It's not properly calibrated.  Flip the winding (and the previously calculated normal).\n                Vector3.Negate(ref n, out n);\n                temp1 = v1;\n                v1 = v2;\n                v2 = temp1;\n            }\n\n            Vector3 v3;\n            int count = 0;\n            while (true)\n            {\n                //Find a final extreme point using the normal of the plane defined by v0, v1, v2.\n                GetSweptExtremePoint(shape, ref rayOrigin, ref sweep, ref n, out v3);\n\n                if (count > MPRToolbox.OuterIterationLimit)\n                {\n                    //Can't enclose the origin! That's a bit odd.  Something is wrong; the preparation for this raycast\n                    //guarantees that the origin is enclosed.  Could be a numerical problem.\n                    hit.T = float.MaxValue;\n                    hit.Normal = new Vector3();\n                    hit.Location = new Vector3();\n                    return false;\n                }\n                count++;\n\n                //By now, the simplex is a tetrahedron, but it is not known whether or not the ray actually passes through the portal\n                //defined by v1, v2, v3.\n\n                // If the direction is outside the plane defined by v1,v0,v3, then the portal is invalid.\n                Vector3.Cross(ref v1, ref v3, out temp1);\n                Vector3.Dot(ref temp1, ref localDirection, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v2) with the new extreme point.\n                    v2 = v3;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Cross(ref v1, ref v3, out n);\n                    continue;\n                }\n\n                // If the direction is outside the plane defined by v3,v0,v2, then the portal is invalid.\n                Vector3.Cross(ref v3, ref v2, out temp1);\n                Vector3.Dot(ref temp1, ref localDirection, out dot);\n                if (dot < 0)\n                {\n                    //Replace the point that was on the inside of the plane (v1) with the new extreme point.\n                    v1 = v3;\n                    // Calculate the normal of the plane that will be used to find a new extreme point.\n                    Vector3.Cross(ref v2, ref v3, out n);\n                    continue;\n                }\n                break;\n            }\n\n\n            // Refine the portal.\n            count = 0;\n            while (true)\n            {\n                //Compute the outward facing normal.\n                Vector3.Subtract(ref v1, ref v2, out temp1);\n                Vector3.Subtract(ref v3, ref v2, out temp2);\n                Vector3.Cross(ref temp1, ref temp2, out n);\n\n\n                //Keep working towards the surface.  Find the next extreme point.\n                Vector3 v4;\n                GetSweptExtremePoint(shape, ref rayOrigin, ref sweep, ref n, out v4);\n\n\n                //If the plane which generated the normal is very close to the extreme point, then we're at the surface.\n                Vector3.Dot(ref n, ref v1, out dot);\n                float supportDot;\n                Vector3.Dot(ref v4, ref n, out supportDot);\n\n                if (supportDot - dot < rayCastSurfaceEpsilon || count > MPRToolbox.InnerIterationLimit) // TODO: Could use a dynamic epsilon for possibly better behavior.\n                {\n                    //The portal is now on the surface.  The algorithm can now compute the TOI and exit.\n                    float lengthSquared = n.LengthSquared();\n                    if (lengthSquared > Toolbox.Epsilon * .00001f)\n                    {\n                        Vector3.Divide(ref n, (float)Math.Sqrt(lengthSquared), out hit.Normal);\n\n                        //The plane is very close to the surface, and the ray is known to pass through it.\n                        //dot is the rate.\n                        Vector3.Dot(ref  hit.Normal, ref localDirection, out dot);\n                        //supportDot is the distance to the plane.\n                        Vector3.Dot(ref  hit.Normal, ref v1, out supportDot);\n\n\n                        hit.T = sweepLength - supportDot / dot;\n                    }\n                    else\n                    {\n                        Vector3.Normalize(ref localDirection, out hit.Normal);\n                        hit.T = sweepLength;\n                    }\n                    //Sometimes, when the objects are intersecting, the T parameter can be negative.\n                    //In this case, just go with t = 0.\n                    if (hit.T < 0)\n                        hit.T = 0;\n                    return true;\n                }\n\n                //Still haven't exited, so refine the portal.\n                //Test direction against the three planes that separate the new portal candidates: (v1,v4,v0) (v2,v4,v0) (v3,v4,v0)\n\n\n                //This may look a little weird at first.\n                //'inside' here means 'on the positive side of the plane.'\n                //There are three total planes being tested, one for each of v1, v2, and v3.\n                //The planes are created from consistently wound vertices, so it's possible to determine\n                //where the ray passes through the portal based upon its relationship to two of the three planes.\n                //The third vertex which is found to be opposite the face which contains the ray is replaced with the extreme point.\n\n                //This v4 x direction is just a minor reordering of a scalar triple product: (v1 x v4) * direction.\n                //It eliminates the need for extra cross products for the inner if.\n                Vector3.Cross(ref v4, ref localDirection, out temp1);\n                Vector3.Dot(ref v1, ref temp1, out dot);\n                if (dot >= 0)\n                {\n                    Vector3.Dot(ref v2, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v1 = v4; // Inside v1 & inside v2 ==> eliminate v1\n                    }\n                    else\n                    {\n                        v3 = v4; // Inside v1 & outside v2 ==> eliminate v3\n                    }\n                }\n                else\n                {\n                    Vector3.Dot(ref v3, ref temp1, out dot);\n                    if (dot >= 0)\n                    {\n                        v2 = v4; // Outside v1 & inside v3 ==> eliminate v2\n                    }\n                    else\n                    {\n                        v1 = v4; // Outside v1 & outside v3 ==> eliminate v1\n                    }\n                }\n\n                count++;\n\n            }\n        }\n\n        static void GetSweptExtremePoint(ConvexShape shape, ref Vector3 point, ref Vector3 sweep, ref Vector3 extremePointDirection, out Vector3 extremePoint)\n        {\n            shape.GetExtremePoint(extremePointDirection, ref Toolbox.RigidIdentity, out extremePoint);\n            Vector3.Subtract(ref extremePoint, ref point, out extremePoint);\n            float dot;\n            Vector3.Dot(ref extremePointDirection, ref sweep, out dot);\n            if (dot > 0)\n            {\n                Vector3.Add(ref extremePoint, ref sweep, out extremePoint);\n            }\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/MinkowskiToolbox.cs",
    "content": "﻿using System;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms\n{\n    ///<summary>\n    /// Helper class that supports other systems using minkowski space operations.\n    ///</summary>\n    public static class MinkowskiToolbox\n    {\n        ///<summary>\n        /// Gets the local transform of B in the space of A.\n        ///</summary>\n        ///<param name=\"transformA\">First transform.</param>\n        ///<param name=\"transformB\">Second transform.</param>\n        ///<param name=\"localTransformB\">Transform of B in the local space of A.</param>\n        public static void GetLocalTransform(ref RigidTransform transformA, ref RigidTransform transformB,\n                                             out RigidTransform localTransformB)\n        {\n            //Put B into A's space.\n            Quaternion conjugateOrientationA;\n            Quaternion.Conjugate(ref transformA.Orientation, out conjugateOrientationA);\n            Quaternion.Concatenate(ref transformB.Orientation, ref conjugateOrientationA, out localTransformB.Orientation);\n            Vector3.Subtract(ref transformB.Position, ref transformA.Position, out localTransformB.Position);\n            Vector3.Transform(ref localTransformB.Position, ref conjugateOrientationA, out localTransformB.Position);\n        }\n\n        ///<summary>\n        /// Gets the extreme point of the minkowski difference of shapeA and shapeB in the local space of shapeA.\n        ///</summary>\n        ///<param name=\"shapeA\">First shape.</param>\n        ///<param name=\"shapeB\">Second shape.</param>\n        ///<param name=\"direction\">Extreme point direction in local space.</param>\n        ///<param name=\"localTransformB\">Transform of shapeB in the local space of A.</param>\n        ///<param name=\"extremePoint\">The extreme point in the local space of A.</param>\n        public static void GetLocalMinkowskiExtremePoint(ConvexShape shapeA, ConvexShape shapeB, ref Vector3 direction, ref RigidTransform localTransformB, out Vector3 extremePoint)\n        {\n            //Extreme point of A-B along D = (extreme point of A along D) - (extreme point of B along -D)\n            shapeA.GetLocalExtremePointWithoutMargin(ref direction, out extremePoint);\n            Vector3 v;\n            Vector3 negativeN;\n            Vector3.Negate(ref direction, out negativeN);\n            shapeB.GetExtremePointWithoutMargin(negativeN, ref localTransformB, out v);\n            Vector3.Subtract(ref extremePoint, ref v, out extremePoint);\n\n            ExpandMinkowskiSum(shapeA.collisionMargin, shapeB.collisionMargin, ref direction, out v);\n            Vector3.Add(ref extremePoint, ref v, out extremePoint);\n\n\n        }\n\n        ///<summary>\n        /// Gets the extreme point of the minkowski difference of shapeA and shapeB in the local space of shapeA.\n        ///</summary>\n        ///<param name=\"shapeA\">First shape.</param>\n        ///<param name=\"shapeB\">Second shape.</param>\n        ///<param name=\"direction\">Extreme point direction in local space.</param>\n        ///<param name=\"localTransformB\">Transform of shapeB in the local space of A.</param>\n        /// <param name=\"extremePointA\">The extreme point on shapeA.</param>\n        ///<param name=\"extremePoint\">The extreme point in the local space of A.</param>\n        public static void GetLocalMinkowskiExtremePoint(ConvexShape shapeA, ConvexShape shapeB, ref Vector3 direction, ref RigidTransform localTransformB,\n                                                 out Vector3 extremePointA, out Vector3 extremePoint)\n        {\n            //Extreme point of A-B along D = (extreme point of A along D) - (extreme point of B along -D)\n            shapeA.GetLocalExtremePointWithoutMargin(ref direction, out extremePointA);\n            Vector3 v;\n            Vector3.Negate(ref direction, out v);\n            Vector3 extremePointB;\n            shapeB.GetExtremePointWithoutMargin(v, ref localTransformB, out extremePointB);\n\n            ExpandMinkowskiSum(shapeA.collisionMargin, shapeB.collisionMargin, direction, ref extremePointA, ref extremePointB);\n            Vector3.Subtract(ref extremePointA, ref extremePointB, out extremePoint);\n\n\n        }\n\n        ///<summary>\n        /// Gets the extreme point of the minkowski difference of shapeA and shapeB in the local space of shapeA.\n        ///</summary>\n        ///<param name=\"shapeA\">First shape.</param>\n        ///<param name=\"shapeB\">Second shape.</param>\n        ///<param name=\"direction\">Extreme point direction in local space.</param>\n        ///<param name=\"localTransformB\">Transform of shapeB in the local space of A.</param>\n        /// <param name=\"extremePointA\">The extreme point on shapeA.</param>\n        /// <param name=\"extremePointB\">The extreme point on shapeB.</param>\n        ///<param name=\"extremePoint\">The extreme point in the local space of A.</param>\n        public static void GetLocalMinkowskiExtremePoint(ConvexShape shapeA, ConvexShape shapeB, ref Vector3 direction, ref RigidTransform localTransformB,\n                                                 out Vector3 extremePointA, out Vector3 extremePointB, out Vector3 extremePoint)\n        {\n            //Extreme point of A-B along D = (extreme point of A along D) - (extreme point of B along -D)\n            shapeA.GetLocalExtremePointWithoutMargin(ref direction, out extremePointA);\n            Vector3 v;\n            Vector3.Negate(ref direction, out v);\n            shapeB.GetExtremePointWithoutMargin(v, ref localTransformB, out extremePointB);\n\n            ExpandMinkowskiSum(shapeA.collisionMargin, shapeB.collisionMargin, direction, ref extremePointA, ref extremePointB);\n            Vector3.Subtract(ref extremePointA, ref extremePointB, out extremePoint);\n\n\n        }\n\n        ///<summary>\n        /// Gets the extreme point of the minkowski difference of shapeA and shapeB in the local space of shapeA, without a margin.\n        ///</summary>\n        ///<param name=\"shapeA\">First shape.</param>\n        ///<param name=\"shapeB\">Second shape.</param>\n        ///<param name=\"direction\">Extreme point direction in local space.</param>\n        ///<param name=\"localTransformB\">Transform of shapeB in the local space of A.</param>\n        ///<param name=\"extremePoint\">The extreme point in the local space of A.</param>\n        public static void GetLocalMinkowskiExtremePointWithoutMargin(ConvexShape shapeA, ConvexShape shapeB, ref Vector3 direction, ref RigidTransform localTransformB, out Vector3 extremePoint)\n        {\n            //Extreme point of A-B along D = (extreme point of A along D) - (extreme point of B along -D)\n            shapeA.GetLocalExtremePointWithoutMargin(ref direction, out extremePoint);\n            Vector3 extremePointB;\n            Vector3 negativeN;\n            Vector3.Negate(ref direction, out negativeN);\n            shapeB.GetExtremePointWithoutMargin(negativeN, ref localTransformB, out extremePointB);\n            Vector3.Subtract(ref extremePoint, ref extremePointB, out extremePoint);\n\n        }\n\n\n\n        ///<summary>\n        /// Computes the expansion of the minkowski sum due to margins in a given direction.\n        ///</summary>\n        ///<param name=\"marginA\">First margin.</param>\n        ///<param name=\"marginB\">Second margin.</param>\n        ///<param name=\"direction\">Extreme point direction.</param>\n        ///<param name=\"contribution\">Margin contribution to the extreme point.</param>\n        public static void ExpandMinkowskiSum(float marginA, float marginB, ref Vector3 direction, out Vector3 contribution)\n        {\n            float lengthSquared = direction.LengthSquared();\n            if (lengthSquared > Toolbox.Epsilon)\n            {\n                //The contribution to the minkowski sum by the margin is:\n                //direction * marginA - (-direction) * marginB.\n                Vector3.Multiply(ref direction, (marginA + marginB) / (float)Math.Sqrt(lengthSquared), out contribution);\n\n            }\n            else\n            {\n                contribution = new Vector3();\n            }\n\n\n        }\n\n\n        ///<summary>\n        /// Computes the expansion of the minkowski sum due to margins in a given direction.\n        ///</summary>\n        ///<param name=\"marginA\">First margin.</param>\n        ///<param name=\"marginB\">Second margin.</param>\n        ///<param name=\"direction\">Extreme point direction.</param>\n        ///<param name=\"toExpandA\">Margin contribution to the shapeA.</param>\n        ///<param name=\"toExpandB\">Margin contribution to the shapeB.</param>\n        public static void ExpandMinkowskiSum(float marginA, float marginB, Vector3 direction, ref Vector3 toExpandA, ref Vector3 toExpandB)\n        {\n            float lengthSquared = direction.LengthSquared();\n            if (lengthSquared > Toolbox.Epsilon)\n            {\n                lengthSquared = 1 / (float)Math.Sqrt(lengthSquared);   \n                //The contribution to the minkowski sum by the margin is:\n                //direction * marginA - (-direction) * marginB. \n                Vector3 contribution;\n                Vector3.Multiply(ref direction, marginA * lengthSquared, out contribution);\n                Vector3.Add(ref toExpandA, ref contribution, out toExpandA);\n                Vector3.Multiply(ref direction, marginB * lengthSquared, out contribution);\n                Vector3.Subtract(ref toExpandB, ref contribution, out toExpandB);\n            }\n            //If the direction is too small, then the expansion values are left unchanged.\n\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/SphereTester.cs",
    "content": "﻿using System;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Settings;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms\n{\n    ///<summary>\n    /// Helper class to test spheres against each other.\n    ///</summary>\n    public static class SphereTester\n    {\n        /// <summary>\n        /// Computes contact data for two spheres.\n        /// </summary>\n        /// <param name=\"a\">First sphere.</param>\n        /// <param name=\"b\">Second sphere.</param>\n        /// <param name=\"positionA\">Position of the first sphere.</param>\n        /// <param name=\"positionB\">Position of the second sphere.</param>\n        /// <param name=\"contact\">Contact data between the spheres, if any.</param>\n        /// <returns>Whether or not the spheres are touching.</returns>\n        public static bool AreSpheresColliding(SphereShape a, SphereShape b, ref Vector3 positionA, ref Vector3 positionB, out ContactData contact)\n        {\n            contact = new ContactData();\n\n            float radiusSum = a.collisionMargin + b.collisionMargin;\n            Vector3 centerDifference;\n            Vector3.Subtract(ref positionB, ref positionA, out centerDifference);\n            float centerDistance = centerDifference.LengthSquared();\n\n            if (centerDistance < (radiusSum + CollisionDetectionSettings.maximumContactDistance) * (radiusSum + CollisionDetectionSettings.maximumContactDistance))\n            {\n                //In collision!\n\n                if (radiusSum > Toolbox.Epsilon) //This would be weird, but it is still possible to cause a NaN.\n                    Vector3.Multiply(ref centerDifference, a.collisionMargin / (radiusSum), out  contact.Position);\n                else contact.Position = new Vector3();\n                Vector3.Add(ref contact.Position, ref positionA, out contact.Position);\n\n                centerDistance = (float)Math.Sqrt(centerDistance);\n                if (centerDistance > Toolbox.BigEpsilon)\n                {\n                    Vector3.Divide(ref centerDifference, centerDistance, out contact.Normal);\n                }\n                else\n                {\n                    contact.Normal = Toolbox.UpVector;\n                }\n                contact.PenetrationDepth = radiusSum - centerDistance;\n\n                return true;\n\n            }\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/TriangleConvexPairTester.cs",
    "content": "﻿using System;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing BEPUphysics.Settings;\nusing BEPUutilities.DataStructures;\nusing System.Diagnostics;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms\n{\n    ///<summary>\n    /// Persistent tester that compares triangles against convex objects.\n    ///</summary>\n    public class TriangleConvexPairTester : TrianglePairTester\n    {\n        internal ConvexShape convex;\n\n        internal CollisionState state = CollisionState.Plane;\n        private const int EscapeAttemptPeriod = 10;\n        int escapeAttempts;\n\n        Vector3 localSeparatingAxis;\n\n        //Relies on the triangle being located in the local space of the convex object.  The convex transform is used to transform the\n        //contact points back from the convex's local space into world space.\n        ///<summary>\n        /// Generates a contact between the triangle and convex.\n        ///</summary>\n        ///<param name=\"contactList\">Contact between the shapes, if any.</param>\n        ///<returns>Whether or not the shapes are colliding.</returns>\n        public override bool GenerateContactCandidate(out TinyStructList<ContactData> contactList)\n        {\n            switch (state)\n            {\n                case CollisionState.Plane:\n                    return DoPlaneTest(out contactList);\n                case CollisionState.ExternalSeparated:\n                    return DoExternalSeparated(out contactList);\n                case CollisionState.ExternalNear:\n                    return DoExternalNear(out contactList);\n                case CollisionState.Deep:\n                    return DoDeepContact(out contactList);\n                default:\n                    contactList = new TinyStructList<ContactData>();\n                    return false;\n            }\n\n\n\n        }\n\n\n        private bool DoPlaneTest(out TinyStructList<ContactData> contactList)\n        {\n\n\n            //Find closest point between object and plane.\n            Vector3 reverseNormal;\n            Vector3 ab, ac;\n            Vector3.Subtract(ref triangle.vB, ref triangle.vA, out ab);\n            Vector3.Subtract(ref triangle.vC, ref triangle.vA, out ac);\n            Vector3.Cross(ref ac, ref ab, out reverseNormal);\n            //Convex position dot normal is ALWAYS zero.  The thing to look at is the plane's 'd'.\n            //If the distance along the normal is positive, then the convex is 'behind' that normal.\n            float dotA;\n            Vector3.Dot(ref triangle.vA, ref reverseNormal, out dotA);\n\n            contactList = new TinyStructList<ContactData>();\n            switch (triangle.sidedness)\n            {\n                case TriangleSidedness.DoubleSided:\n                    if (dotA < 0)\n                    {\n                        //The reverse normal is pointing towards the convex.\n                        //It needs to point away from the convex so that the direction\n                        //will get the proper extreme point.\n                        Vector3.Negate(ref reverseNormal, out reverseNormal);\n                        dotA = -dotA;\n                    }\n                    break;\n                case TriangleSidedness.Clockwise:\n                    //if (dotA < 0)\n                    //{\n                    //    //The reverse normal is pointing towards the convex.\n                    //    return false;\n                    //}\n                    break;\n                case TriangleSidedness.Counterclockwise:\n                    //if (dotA > 0)\n                    //{\n                    //    //The reverse normal is pointing away from the convex.\n                    //    return false;\n                    //}\n\n                    //The reverse normal is pointing towards the convex.\n                    //It needs to point away from the convex so that the direction\n                    //will get the proper extreme point.\n                    Vector3.Negate(ref reverseNormal, out reverseNormal);\n                    dotA = -dotA;\n                    break;\n            }\n            Vector3 extremePoint;\n            convex.GetLocalExtremePointWithoutMargin(ref reverseNormal, out extremePoint);\n\n\n            //See if the extreme point is within the face or not.\n            //It might seem like the easy \"depth\" test should come first, since a barycentric\n            //calculation takes a bit more time.  However, transferring from plane to depth is 'rare' \n            //(like all transitions), and putting this test here is logically closer to its requirements'\n            //computation.\n\n            if (GetVoronoiRegion(ref extremePoint) != VoronoiRegion.ABC)\n            {\n                state = CollisionState.ExternalSeparated;\n                return DoExternalSeparated(out contactList);\n            }\n\n\n\n            float dotE;\n            Vector3.Dot(ref extremePoint, ref reverseNormal, out dotE);\n            float t = (dotA - dotE) / reverseNormal.LengthSquared();\n\n\n\n            Vector3 offset;\n            Vector3.Multiply(ref reverseNormal, t, out offset);\n\n            //Compare the distance from the plane to the convex object.\n            float distanceSquared = offset.LengthSquared();\n\n            float marginSum = triangle.collisionMargin + convex.collisionMargin;\n            //TODO: Could just normalize early and avoid computing point plane before it's necessary.  \n            //Exposes a sqrt but...\n            if (t <= 0 || distanceSquared < marginSum * marginSum)\n            {\n                //The convex object is in the margin of the plane.\n                //All that's left is to create the contact.\n\n\n                var contact = new ContactData();\n                //Displacement is from A to B.  point = A + t * AB, where t = marginA / margin.\n                if (marginSum > Toolbox.Epsilon) //This can be zero! It would cause a NaN is unprotected.\n                    Vector3.Multiply(ref offset, convex.collisionMargin / marginSum, out contact.Position); //t * AB\n                else contact.Position = new Vector3();\n                Vector3.Add(ref extremePoint, ref contact.Position, out contact.Position); //A + t * AB.\n\n                float normalLength = reverseNormal.Length();\n                Vector3.Divide(ref reverseNormal, normalLength, out contact.Normal);\n                float distance = normalLength * t;\n\n\n\n                contact.PenetrationDepth = marginSum - distance;\n\n                if (contact.PenetrationDepth > marginSum)\n                {\n                    //Check to see if the inner sphere is touching the plane.\n                    //This does not override other tests; there can be more than one contact from a single triangle.\n\n                    ContactData alternateContact;\n                    if (TryInnerSphereContact(out alternateContact))// && alternateContact.PenetrationDepth > contact.PenetrationDepth)\n                    {\n                        contactList.Add(ref alternateContact);\n                    }\n\n                    //The convex object is stuck deep in the plane!\n                    //The most problematic case for this is when\n                    //an object is right on top of a cliff.\n                    //The lower, vertical triangle may occasionally detect\n                    //a contact with the object, but would compute an extremely\n                    //deep depth if the normal plane test was used.\n\n\n\n\n                    //Verify that the depth is correct by trying another approach.\n                    CollisionState previousState = state;\n                    state = CollisionState.ExternalNear;\n                    TinyStructList<ContactData> alternateContacts;\n                    if (DoExternalNear(out alternateContacts))\n                    {\n                        alternateContacts.Get(0, out alternateContact);\n                        if (alternateContact.PenetrationDepth + .01f < contact.PenetrationDepth) //Bias against the subtest's result, since the plane version will probably have a better position.\n                        {\n                            //It WAS a bad contact.\n                            contactList.Add(ref alternateContact);\n                            //DoDeepContact (which can be called from within DoExternalNear) can generate two contacts, but the second contact would just be an inner sphere (which we already generated).\n                            //DoExternalNear can only generate one contact.  So we only need the first contact!\n                            //TODO: This is a fairly fragile connection between the two stages.  Consider robustifying. (Also, the TryInnerSphereContact is done twice! This process is very rare for marginful pairs, though)\n                        }\n                        else\n                        {\n                            //Well, it really is just that deep.\n                            contactList.Add(ref contact);\n                            state = previousState;\n                        }\n                    }\n                    else\n                    {\n                        //If the external near test finds that there was no collision at all, \n                        //just return to plane testing.  If the point turns up outside the face region\n                        //next time, the system will adapt.\n                        state = previousState;\n                        return false;\n                    }\n                }\n                else\n                {\n                    contactList.Add(ref contact);\n                }\n                return true;\n\n            }\n            return false;\n\n\n        }\n\n\n\n\n        private bool DoExternalSeparated(out TinyStructList<ContactData> contactList)\n        {\n\n            if (GJKToolbox.AreShapesIntersecting(convex, triangle, ref Toolbox.RigidIdentity, ref Toolbox.RigidIdentity, ref localSeparatingAxis))\n            {\n                state = CollisionState.ExternalNear;\n                return DoExternalNear(out contactList);\n            }\n            TryToEscape();\n            contactList = new TinyStructList<ContactData>();\n            return false;\n        }\n\n        private bool DoExternalNear(out TinyStructList<ContactData> contactList)\n        {\n\n            Vector3 closestA, closestB;\n\n\n            //Don't bother trying to do any clever caching.  The continually transforming simplex makes it very rarely useful.\n            //TODO: Initialize the simplex of the GJK method using the 'true' center of the triangle.\n            //If left unmodified, the simplex that is used in GJK will just be a point at 0,0,0, which of course is at the origin.\n            //This causes an instant-out, always.  Not good!\n            //By giving the contributing simplex the average centroid, it has a better guess.\n            Vector3 triangleCentroid;\n            Vector3.Add(ref triangle.vA, ref triangle.vB, out triangleCentroid);\n            Vector3.Add(ref triangleCentroid, ref triangle.vC, out triangleCentroid);\n            Vector3.Multiply(ref triangleCentroid, .33333333f, out triangleCentroid);\n\n            var initialSimplex = new CachedSimplex { State = SimplexState.Point, LocalSimplexB = { A = triangleCentroid } };\n            if (GJKToolbox.GetClosestPoints(convex, triangle, ref Toolbox.RigidIdentity, ref Toolbox.RigidIdentity, ref initialSimplex, out closestA, out closestB))\n            {\n                state = CollisionState.Deep;\n                return DoDeepContact(out contactList);\n            }\n            Vector3 displacement;\n            Vector3.Subtract(ref closestB, ref closestA, out displacement);\n            float distanceSquared = displacement.LengthSquared();\n            float margin = convex.collisionMargin + triangle.collisionMargin;\n\n            contactList = new TinyStructList<ContactData>();\n            if (distanceSquared < margin * margin)\n            {\n                //Try to generate a contact.\n                var contact = new ContactData();\n\n                //Determine if the normal points in the appropriate direction given the sidedness of the triangle.\n                if (triangle.sidedness != TriangleSidedness.DoubleSided)\n                {\n                    Vector3 triangleNormal, ab, ac;\n                    Vector3.Subtract(ref triangle.vB, ref triangle.vA, out ab);\n                    Vector3.Subtract(ref triangle.vC, ref triangle.vA, out ac);\n                    Vector3.Cross(ref ab, ref ac, out triangleNormal);\n                    float dot;\n                    Vector3.Dot(ref triangleNormal, ref displacement, out dot);\n                    if (triangle.sidedness == TriangleSidedness.Clockwise && dot > 0)\n                        return false;\n                    if (triangle.sidedness == TriangleSidedness.Counterclockwise && dot < 0)\n                        return false;\n                }\n\n\n                //Displacement is from A to B.  point = A + t * AB, where t = marginA / margin.\n                if (margin > Toolbox.Epsilon) //This can be zero! It would cause a NaN if unprotected.\n                    Vector3.Multiply(ref displacement, convex.collisionMargin / margin, out contact.Position); //t * AB\n                else contact.Position = new Vector3();\n                Vector3.Add(ref closestA, ref contact.Position, out contact.Position); //A + t * AB.\n\n\n\n                contact.Normal = displacement;\n                float distance = (float)Math.Sqrt(distanceSquared);\n                Vector3.Divide(ref contact.Normal, distance, out contact.Normal);\n                contact.PenetrationDepth = margin - distance;\n\n\n\n                contactList.Add(ref contact);\n                TryToEscape(ref contact.Position);\n                return true;\n\n            }\n            //Too far to make a contact- move back to separation.\n            state = CollisionState.ExternalSeparated;\n            return false;\n        }\n\n        private bool DoDeepContact(out TinyStructList<ContactData> contactList)\n        {\n\n\n            //Find the origin to triangle center offset.\n            Vector3 center;\n            Vector3.Add(ref triangle.vA, ref triangle.vB, out center);\n            Vector3.Add(ref center, ref triangle.vC, out center);\n            Vector3.Multiply(ref center, 1f / 3f, out center);\n\n            ContactData contact;\n\n            contactList = new TinyStructList<ContactData>();\n\n            if (MPRToolbox.AreLocalShapesOverlapping(convex, triangle, ref center, ref Toolbox.RigidIdentity))\n            {\n\n                float dot;\n\n\n                Vector3 triangleNormal, ab, ac;\n                Vector3.Subtract(ref triangle.vB, ref triangle.vA, out ab);\n                Vector3.Subtract(ref triangle.vC, ref triangle.vA, out ac);\n                Vector3.Cross(ref ab, ref ac, out triangleNormal);\n                float lengthSquared = triangleNormal.LengthSquared();\n                if (lengthSquared < Toolbox.Epsilon * .01f)\n                {\n                    //Degenerate triangle! That's no good.\n                    //Just use the direction pointing from A to B, \"B\" being the triangle.  That direction is center - origin, or just center.\n                    MPRToolbox.LocalSurfaceCast(convex, triangle, ref Toolbox.RigidIdentity, ref center, out contact.PenetrationDepth, out contact.Normal, out contact.Position);\n                }\n                else\n                {\n                    //Normalize the normal.\n                    Vector3.Divide(ref triangleNormal, (float)Math.Sqrt(lengthSquared), out triangleNormal);\n\n\n                    ////The first direction to check is one of the triangle's edge normals.  Choose the one that is most aligned with the offset from A to B.\n                    ////Project the direction onto the triangle plane.\n                    //Vector3.Dot(ref triangleNormal, ref center, out dot);\n                    //Vector3 trianglePlaneDirection;\n                    //Vector3.Multiply(ref triangleNormal, dot, out trianglePlaneDirection);\n                    //Vector3.Subtract(ref trianglePlaneDirection, ref center, out trianglePlaneDirection);\n\n                    ////To find out which edge to use, compute which region the direction is in.\n                    ////This is done by constructing three planes which segment the triangle into three sub-triangles.\n\n                    ////These planes are defined by A, origin, center; B, origin, center; C, origin, center.\n                    ////The plane tests against the direction can be reordered to:\n                    ////(center x direction) * A\n                    ////(center x direction) * B\n                    ////(center x direction) * C\n                    //Vector3 OxD;\n                    //Vector3.Cross(ref trianglePlaneDirection, ref center, out OxD);\n                    //Vector3 p;\n\n                    //float dotA, dotB, dotC;\n                    //Vector3.Dot(ref triangle.vA, ref OxD, out dotA);\n                    //Vector3.Dot(ref triangle.vB, ref OxD, out dotB);\n                    //Vector3.Dot(ref triangle.vC, ref OxD, out dotC);\n\n                    //if (dotA >= 0 && dotB <= 0)\n                    //{\n                    //    //Direction is in the AB edge zone.\n                    //    //Compute the edge normal using AB x (AO x AB).\n                    //    Vector3 AB, AO;\n                    //    Vector3.Subtract(ref triangle.vB, ref triangle.vA, out AB);\n                    //    Vector3.Subtract(ref center, ref triangle.vA, out AO);\n                    //    Vector3.Cross(ref AO, ref AB, out p);\n                    //    Vector3.Cross(ref AB, ref p, out trianglePlaneDirection);\n                    //}\n                    //else if (dotB >= 0 && dotC <= 0)\n                    //{\n                    //    //Direction is in the BC edge zone.\n                    //    //Compute the edge normal using BC x (BO x BC).\n                    //    Vector3 BC, BO;\n                    //    Vector3.Subtract(ref triangle.vC, ref triangle.vB, out BC);\n                    //    Vector3.Subtract(ref center, ref triangle.vB, out BO);\n                    //    Vector3.Cross(ref BO, ref BC, out p);\n                    //    Vector3.Cross(ref BC, ref p, out trianglePlaneDirection);\n\n                    //}\n                    //else // dotC > 0 && dotA < 0\n                    //{\n                    //    //Direction is in the CA edge zone.\n                    //    //Compute the edge normal using CA x (CO x CA).\n                    //    Vector3 CA, CO;\n                    //    Vector3.Subtract(ref triangle.vA, ref triangle.vC, out CA);\n                    //    Vector3.Subtract(ref center, ref triangle.vC, out CO);\n                    //    Vector3.Cross(ref CO, ref CA, out p);\n                    //    Vector3.Cross(ref CA, ref p, out trianglePlaneDirection);\n                    //}\n\n\n\n                    //dot = trianglePlaneDirection.LengthSquared();\n                    //if (dot > Toolbox.Epsilon)\n                    //{\n                    //    Vector3.Divide(ref trianglePlaneDirection, (float)Math.Sqrt(dot), out trianglePlaneDirection);\n                    //    MPRTesting.LocalSurfaceCast(convex, triangle, ref Toolbox.RigidIdentity, ref trianglePlaneDirection, out contact.PenetrationDepth, out contact.Normal);\n                    //    //Check to see if the normal is facing in the proper direction, considering that this may not be a two-sided triangle.\n                    //    Vector3.Dot(ref triangleNormal, ref contact.Normal, out dot);\n                    //    if ((triangle.sidedness == TriangleSidedness.Clockwise && dot > 0) || (triangle.sidedness == TriangleSidedness.Counterclockwise && dot < 0))\n                    //    {\n                    //        //Normal was facing the wrong way.\n                    //        //Instead of ignoring it entirely, correct the direction to as close as it can get by removing any component parallel to the triangle normal.\n                    //        Vector3 previousNormal = contact.Normal;\n                    //        Vector3.Dot(ref contact.Normal, ref triangleNormal, out dot);\n\n                    //        Vector3.Multiply(ref contact.Normal, dot, out p);\n                    //        Vector3.Subtract(ref contact.Normal, ref p, out contact.Normal);\n                    //        float length = contact.Normal.LengthSquared();\n                    //        if (length > Toolbox.Epsilon)\n                    //        {\n                    //            //Renormalize the corrected normal.\n                    //            Vector3.Divide(ref contact.Normal, (float)Math.Sqrt(length), out contact.Normal);\n                    //            Vector3.Dot(ref contact.Normal, ref previousNormal, out dot);\n                    //            contact.PenetrationDepth *= dot;\n                    //        }\n                    //        else\n                    //        {\n                    //            contact.PenetrationDepth = float.MaxValue;\n                    //            contact.Normal = new Vector3();\n                    //        }\n                    //    }\n                    //}\n                    //else\n                    //{\n                    //    contact.PenetrationDepth = float.MaxValue;\n                    //    contact.Normal = new Vector3();\n                    //}\n\n                    //TODO: This tests all three edge axes with a full MPR raycast.  That's not really necessary; the correct edge normal should be discoverable, resulting in a single MPR raycast.\n\n                    //Find the edge directions that will be tested with MPR.\n                    Vector3 AO, BO, CO;\n                    Vector3 AB, BC, CA;\n                    Vector3.Subtract(ref center, ref triangle.vA, out AO);\n                    Vector3.Subtract(ref center, ref triangle.vB, out BO);\n                    Vector3.Subtract(ref center, ref triangle.vC, out CO);\n                    Vector3.Subtract(ref triangle.vB, ref triangle.vA, out AB);\n                    Vector3.Subtract(ref triangle.vC, ref triangle.vB, out BC);\n                    Vector3.Subtract(ref triangle.vA, ref triangle.vC, out CA);\n\n\n                    //We don't have to worry about degenerate triangles here because we've already handled that possibility above.\n                    Vector3 ABnormal, BCnormal, CAnormal;\n\n                    //Project the center onto the edge to find the direction from the center to the edge AB.\n                    Vector3.Dot(ref AO, ref AB, out dot);\n                    Vector3.Multiply(ref AB, dot / AB.LengthSquared(), out ABnormal);\n                    Vector3.Subtract(ref AO, ref ABnormal, out ABnormal);\n                    ABnormal.Normalize();\n\n                    //Project the center onto the edge to find the direction from the center to the edge BC.\n                    Vector3.Dot(ref BO, ref BC, out dot);\n                    Vector3.Multiply(ref BC, dot / BC.LengthSquared(), out BCnormal);\n                    Vector3.Subtract(ref BO, ref BCnormal, out BCnormal);\n                    BCnormal.Normalize();\n\n                    //Project the center onto the edge to find the direction from the center to the edge BC.\n                    Vector3.Dot(ref CO, ref CA, out dot);\n                    Vector3.Multiply(ref CA, dot / CA.LengthSquared(), out CAnormal);\n                    Vector3.Subtract(ref CO, ref CAnormal, out CAnormal);\n                    CAnormal.Normalize();\n\n\n                    MPRToolbox.LocalSurfaceCast(convex, triangle, ref Toolbox.RigidIdentity, ref ABnormal, out contact.PenetrationDepth, out contact.Normal);\n                    //Check to see if the normal is facing in the proper direction, considering that this may not be a two-sided triangle.\n                    Vector3.Dot(ref triangleNormal, ref contact.Normal, out dot);\n                    if ((triangle.sidedness == TriangleSidedness.Clockwise && dot > 0) || (triangle.sidedness == TriangleSidedness.Counterclockwise && dot < 0))\n                    {\n                        //Normal was facing the wrong way.\n                        //Instead of ignoring it entirely, correct the direction to as close as it can get by removing any component parallel to the triangle normal.\n                        Vector3 previousNormal = contact.Normal;\n                        Vector3.Dot(ref contact.Normal, ref triangleNormal, out dot);\n\n                        Vector3 p;\n                        Vector3.Multiply(ref contact.Normal, dot, out p);\n                        Vector3.Subtract(ref contact.Normal, ref p, out contact.Normal);\n                        float length = contact.Normal.LengthSquared();\n                        if (length > Toolbox.Epsilon)\n                        {\n                            //Renormalize the corrected normal.\n                            Vector3.Divide(ref contact.Normal, (float)Math.Sqrt(length), out contact.Normal);\n                            Vector3.Dot(ref contact.Normal, ref previousNormal, out dot);\n                            contact.PenetrationDepth *= dot;\n                        }\n                        else\n                        {\n                            contact.PenetrationDepth = float.MaxValue;\n                            contact.Normal = new Vector3();\n                        }\n                    }\n\n\n\n                    Vector3 candidateNormal;\n                    float candidateDepth;\n\n                    MPRToolbox.LocalSurfaceCast(convex, triangle, ref Toolbox.RigidIdentity, ref BCnormal, out candidateDepth, out candidateNormal);\n                    //Check to see if the normal is facing in the proper direction, considering that this may not be a two-sided triangle.\n                    Vector3.Dot(ref triangleNormal, ref candidateNormal, out dot);\n                    if ((triangle.sidedness == TriangleSidedness.Clockwise && dot > 0) || (triangle.sidedness == TriangleSidedness.Counterclockwise && dot < 0))\n                    {\n                        //Normal was facing the wrong way.\n                        //Instead of ignoring it entirely, correct the direction to as close as it can get by removing any component parallel to the triangle normal.\n                        Vector3 previousNormal = candidateNormal;\n                        Vector3.Dot(ref candidateNormal, ref triangleNormal, out dot);\n\n                        Vector3 p;\n                        Vector3.Multiply(ref candidateNormal, dot, out p);\n                        Vector3.Subtract(ref candidateNormal, ref p, out candidateNormal);\n                        float length = candidateNormal.LengthSquared();\n                        if (length > Toolbox.Epsilon)\n                        {\n                            //Renormalize the corrected normal.\n                            Vector3.Divide(ref candidateNormal, (float)Math.Sqrt(length), out candidateNormal);\n                            Vector3.Dot(ref candidateNormal, ref previousNormal, out dot);\n                            candidateDepth *= dot;\n                        }\n                        else\n                        {\n                            contact.PenetrationDepth = float.MaxValue;\n                            contact.Normal = new Vector3();\n                        }\n                    }\n                    if (candidateDepth < contact.PenetrationDepth)\n                    {\n                        contact.Normal = candidateNormal;\n                        contact.PenetrationDepth = candidateDepth;\n                    }\n\n\n\n                    MPRToolbox.LocalSurfaceCast(convex, triangle, ref Toolbox.RigidIdentity, ref CAnormal, out candidateDepth, out candidateNormal);\n                    //Check to see if the normal is facing in the proper direction, considering that this may not be a two-sided triangle.\n                    Vector3.Dot(ref triangleNormal, ref candidateNormal, out dot);\n                    if ((triangle.sidedness == TriangleSidedness.Clockwise && dot > 0) || (triangle.sidedness == TriangleSidedness.Counterclockwise && dot < 0))\n                    {\n                        //Normal was facing the wrong way.\n                        //Instead of ignoring it entirely, correct the direction to as close as it can get by removing any component parallel to the triangle normal.\n                        Vector3 previousNormal = candidateNormal;\n                        Vector3.Dot(ref candidateNormal, ref triangleNormal, out dot);\n\n                        Vector3 p;\n                        Vector3.Multiply(ref candidateNormal, dot, out p);\n                        Vector3.Subtract(ref candidateNormal, ref p, out candidateNormal);\n                        float length = candidateNormal.LengthSquared();\n                        if (length > Toolbox.Epsilon)\n                        {\n                            //Renormalize the corrected normal.\n                            Vector3.Divide(ref candidateNormal, (float)Math.Sqrt(length), out candidateNormal);\n                            Vector3.Dot(ref candidateNormal, ref previousNormal, out dot);\n                            candidateDepth *= dot;\n                        }\n                        else\n                        {\n                            contact.PenetrationDepth = float.MaxValue;\n                            contact.Normal = new Vector3();\n                        }\n                    }\n                    if (candidateDepth < contact.PenetrationDepth)\n                    {\n                        contact.Normal = candidateNormal;\n                        contact.PenetrationDepth = candidateDepth;\n                    }\n\n\n\n                    //Try the depth along the positive triangle normal.\n\n                    //If it's clockwise, this direction is unnecessary (the resulting normal would be invalidated by the onesidedness of the triangle).\n                    if (triangle.sidedness != TriangleSidedness.Clockwise)\n                    {\n                        MPRToolbox.LocalSurfaceCast(convex, triangle, ref Toolbox.RigidIdentity, ref triangleNormal, out candidateDepth, out candidateNormal);\n                        if (candidateDepth < contact.PenetrationDepth)\n                        {\n                            contact.Normal = candidateNormal;\n                            contact.PenetrationDepth = candidateDepth;\n                        }\n                    }\n\n                    //Try the depth along the negative triangle normal.\n\n                    //If it's counterclockwise, this direction is unnecessary (the resulting normal would be invalidated by the onesidedness of the triangle).\n                    if (triangle.sidedness != TriangleSidedness.Counterclockwise)\n                    {\n                        Vector3.Negate(ref triangleNormal, out triangleNormal);\n                        MPRToolbox.LocalSurfaceCast(convex, triangle, ref Toolbox.RigidIdentity, ref triangleNormal, out candidateDepth, out candidateNormal);\n                        if (candidateDepth < contact.PenetrationDepth)\n                        {\n                            contact.Normal = candidateNormal;\n                            contact.PenetrationDepth = candidateDepth;\n                        }\n                    }\n\n\n\n\n                }\n\n\n\n                MPRToolbox.RefinePenetration(convex, triangle, ref Toolbox.RigidIdentity, contact.PenetrationDepth, ref contact.Normal, out contact.PenetrationDepth, out contact.Normal, out contact.Position);\n\n                //It's possible for the normal to still face the 'wrong' direction according to one sided triangles.\n                if (triangle.sidedness != TriangleSidedness.DoubleSided)\n                {\n                    Vector3.Dot(ref triangleNormal, ref contact.Normal, out dot);\n                    if (dot < 0)\n                    {\n                        //Skip the add process.\n                        goto InnerSphere;\n                    }\n                }\n\n\n                contact.Id = -1;\n\n                if (contact.PenetrationDepth < convex.collisionMargin + triangle.collisionMargin)\n                {\n                    state = CollisionState.ExternalNear; //If it's emerged from the deep contact, we can go back to using the preferred GJK method.\n                }\n                contactList.Add(ref contact);\n            }\n\n        InnerSphere:\n\n            if (TryInnerSphereContact(out contact))\n            {\n                contactList.Add(ref contact);\n            }\n            if (contactList.Count > 0)\n                return true;\n\n            state = CollisionState.ExternalSeparated;\n            return false;\n\n\n\n\n\n\n\n\n\n\n\n\n        }\n\n\n        void TryToEscape()\n        {\n            if (++escapeAttempts == EscapeAttemptPeriod)\n            {\n                escapeAttempts = 0;\n                state = CollisionState.Plane;\n            }\n        }\n\n        void TryToEscape(ref Vector3 position)\n        {\n            if (++escapeAttempts == EscapeAttemptPeriod && GetVoronoiRegion(ref position) == VoronoiRegion.ABC)\n            {\n                escapeAttempts = 0;\n                state = CollisionState.Plane;\n            }\n        }\n\n\n        private bool TryInnerSphereContact(out ContactData contact)\n        {\n            Vector3 closestPoint;\n            Toolbox.GetClosestPointOnTriangleToPoint(ref triangle.vA, ref triangle.vB, ref triangle.vC, ref Toolbox.ZeroVector, out closestPoint);\n            float length = closestPoint.LengthSquared();\n            float minimumRadius = convex.minimumRadius * (MotionSettings.CoreShapeScaling + .01f);\n            if (length < minimumRadius * minimumRadius)\n            {\n                Vector3 triangleNormal, ab, ac;\n                Vector3.Subtract(ref triangle.vB, ref triangle.vA, out ab);\n                Vector3.Subtract(ref triangle.vC, ref triangle.vA, out ac);\n                Vector3.Cross(ref ab, ref ac, out triangleNormal);\n                float dot;\n                Vector3.Dot(ref closestPoint, ref triangleNormal, out dot);\n                if ((triangle.sidedness == TriangleSidedness.Clockwise && dot > 0) || (triangle.sidedness == TriangleSidedness.Counterclockwise && dot < 0))\n                {\n                    //Normal was facing the wrong way.\n                    contact = new ContactData();\n                    return false;\n                }\n\n                length = (float)Math.Sqrt(length);\n                contact.Position = closestPoint;\n\n                if (length > Toolbox.Epsilon) //Watch out for NaN's!\n                {\n                    Vector3.Divide(ref closestPoint, length, out contact.Normal);\n                }\n                else\n                {\n                    //The direction is undefined.  Use the triangle's normal.\n                    //One sided triangles can only face in the appropriate direction.\n                    float normalLength = triangleNormal.LengthSquared();\n                    if (triangleNormal.LengthSquared() > Toolbox.Epsilon)\n                    {\n                        Vector3.Divide(ref triangleNormal, (float)Math.Sqrt(normalLength), out triangleNormal);\n                        if (triangle.sidedness == TriangleSidedness.Clockwise)\n                            contact.Normal = triangleNormal;\n                        else\n                            Vector3.Negate(ref triangleNormal, out contact.Normal);\n                    }\n                    else\n                    {\n                        //Degenerate triangle!\n                        contact = new ContactData();\n                        return false;\n                    }\n                }\n\n                //Compute the actual depth of the contact.\n                MPRToolbox.LocalSurfaceCast(convex, triangle, ref Toolbox.RigidIdentity, ref contact.Normal, out contact.PenetrationDepth, out triangleNormal); //Trash the 'corrected' normal.  We want to use the spherical normal.\n                contact.Id = -1;\n                return true;\n            }\n            contact = new ContactData();\n            return false;\n        }\n\n        ///<summary>\n        /// Determines what voronoi region a given point is in.\n        ///</summary>\n        ///<param name=\"p\">Point to test.</param>\n        ///<returns>Voronoi region containing the point.</returns>\n        private VoronoiRegion GetVoronoiRegion(ref Vector3 p)\n        {\n            //The point we are comparing against the triangle is 0,0,0, so instead of storing an \"A->P\" vector,\n            //just use -A.\n            //Same for B->, C->P...\n\n            Vector3 ab, ac, ap;\n            Vector3.Subtract(ref triangle.vB, ref triangle.vA, out ab);\n            Vector3.Subtract(ref triangle.vC, ref triangle.vA, out ac);\n            Vector3.Subtract(ref p, ref triangle.vA, out ap);\n\n            //Check to see if it's outside A.\n            float APdotAB, APdotAC;\n            Vector3.Dot(ref ap, ref ab, out APdotAB);\n            Vector3.Dot(ref ap, ref ac, out APdotAC);\n            if (APdotAC <= 0f && APdotAB <= 0)\n            {\n                //It is A!\n                return VoronoiRegion.A;\n            }\n\n            //Check to see if it's outside B.\n            float BPdotAB, BPdotAC;\n            Vector3 bp;\n            Vector3.Subtract(ref p, ref triangle.vB, out bp);\n            Vector3.Dot(ref ab, ref bp, out BPdotAB);\n            Vector3.Dot(ref ac, ref bp, out BPdotAC);\n            if (BPdotAB >= 0f && BPdotAC <= BPdotAB)\n            {\n                //It is B!\n                return VoronoiRegion.B;\n            }\n\n            //Check to see if it's outside AB.\n            float vc = APdotAB * BPdotAC - BPdotAB * APdotAC;\n            if (vc <= 0 && APdotAB > 0 && BPdotAB < 0) //Note > and < instead of => <=; avoids possibly division by zero\n            {\n                return VoronoiRegion.AB;\n            }\n\n            //Check to see if it's outside C.\n            float CPdotAB, CPdotAC;\n            Vector3 cp;\n            Vector3.Subtract(ref p, ref triangle.vC, out cp);\n            Vector3.Dot(ref ab, ref cp, out CPdotAB);\n            Vector3.Dot(ref ac, ref cp, out CPdotAC);\n            if (CPdotAC >= 0f && CPdotAB <= CPdotAC)\n            {\n                //It is C!\n                return VoronoiRegion.C;\n            }\n\n            //Check if it's outside AC.    \n            float vb = CPdotAB * APdotAC - APdotAB * CPdotAC;\n            if (vb <= 0f && APdotAC > 0f && CPdotAC < 0f) //Note > instead of >= and < instead of <=; prevents bad denominator\n            {\n                return VoronoiRegion.AC;\n            }\n\n            //Check if it's outside BC.\n            float va = BPdotAB * CPdotAC - CPdotAB * BPdotAC;\n            if (va <= 0f && (BPdotAC - BPdotAB) > 0f && (CPdotAB - CPdotAC) > 0f)//Note > instead of >= and < instead of <=; prevents bad denominator\n            {\n                return VoronoiRegion.BC;\n            }\n\n\n            //On the face of the triangle.\n            return VoronoiRegion.ABC;\n\n\n        }\n\n        ///<summary>\n        /// Initializes the pair tester.\n        ///</summary>\n        ///<param name=\"convex\">Convex shape to use.</param>\n        ///<param name=\"triangle\">Triangle shape to use.</param>\n        public override void Initialize(ConvexShape convex, TriangleShape triangle)\n        {\n            this.convex = convex;\n            this.triangle = triangle;\n        }\n\n        /// <summary>\n        /// Cleans up the pair tester.\n        /// </summary>\n        public override void CleanUp()\n        {\n            triangle = null;\n            convex = null;\n            state = CollisionState.Plane;\n            escapeAttempts = 0;\n            localSeparatingAxis = new Vector3();\n            Updated = false;\n        }\n\n        internal enum CollisionState\n        {\n            Plane,\n            ExternalSeparated,\n            ExternalNear,\n            Deep\n        }\n\n\n        public override VoronoiRegion GetRegion(ref ContactData contact)\n        {\n            //Deep contact can produce non-triangle normals while still being within the triangle.\n            //To solve this problem, find the voronoi region to which the contact belongs using its normal.\n            //The voronoi region will be either the most extreme vertex, or the edge that includes\n            //the first and second most extreme vertices.\n            //If the normal dotted with an extreme edge direction is near 0, then it belongs to the edge.\n            //Otherwise, it belongs to the vertex.\n            //MPR tends to produce 'approximate' normals, though.\n            //Use a fairly forgiving epsilon.\n            float dotA, dotB, dotC;\n            Vector3.Dot(ref triangle.vA, ref contact.Normal, out dotA);\n            Vector3.Dot(ref triangle.vB, ref contact.Normal, out dotB);\n            Vector3.Dot(ref triangle.vC, ref contact.Normal, out dotC);\n\n            //Since normal points from convex to triangle always, reverse dot signs.\n            dotA = -dotA;\n            dotB = -dotB;\n            dotC = -dotC;\n\n\n            float faceEpsilon = .01f;\n            const float edgeEpsilon = .01f;\n\n            float edgeDot;\n            Vector3 edgeDirection;\n            if (dotA > dotB && dotA > dotC)\n            {\n                //A is extreme.\n                if (dotB > dotC)\n                {\n                    //B is second most extreme.\n                    if (Math.Abs(dotA - dotC) < faceEpsilon)\n                    {\n                        //The normal is basically a face normal.  This can happen at the edges occasionally.\n                        return VoronoiRegion.ABC;\n                    }\n                    else\n                    {\n                        Vector3.Subtract(ref triangle.vB, ref triangle.vA, out edgeDirection);\n                        Vector3.Dot(ref edgeDirection, ref contact.Normal, out edgeDot);\n                        if (edgeDot * edgeDot < edgeDirection.LengthSquared() * edgeEpsilon)\n                            return VoronoiRegion.AB;\n                        else\n                            return VoronoiRegion.A;\n                    }\n                }\n                else\n                {\n                    //C is second most extreme.\n                    if (Math.Abs(dotA - dotB) < faceEpsilon)\n                    {\n                        //The normal is basically a face normal.  This can happen at the edges occasionally.\n                        return VoronoiRegion.ABC;\n                    }\n                    else\n                    {\n                        Vector3.Subtract(ref triangle.vC, ref triangle.vA, out edgeDirection);\n                        Vector3.Dot(ref edgeDirection, ref contact.Normal, out edgeDot);\n                        if (edgeDot * edgeDot < edgeDirection.LengthSquared() * edgeEpsilon)\n                            return VoronoiRegion.AC;\n                        else\n                            return VoronoiRegion.A;\n                    }\n                }\n            }\n            else if (dotB > dotC)\n            {\n                //B is extreme.\n                if (dotC > dotA)\n                {\n                    //C is second most extreme.\n                    if (Math.Abs(dotB - dotA) < faceEpsilon)\n                    {\n                        //The normal is basically a face normal.  This can happen at the edges occasionally.\n                        return VoronoiRegion.ABC;\n                    }\n                    else\n                    {\n                        Vector3.Subtract(ref triangle.vC, ref triangle.vB, out edgeDirection);\n                        Vector3.Dot(ref edgeDirection, ref contact.Normal, out edgeDot);\n                        if (edgeDot * edgeDot < edgeDirection.LengthSquared() * edgeEpsilon)\n                            return VoronoiRegion.BC;\n                        else\n                            return VoronoiRegion.B;\n                    }\n                }\n                else\n                {\n                    //A is second most extreme.\n                    if (Math.Abs(dotB - dotC) < faceEpsilon)\n                    {\n                        //The normal is basically a face normal.  This can happen at the edges occasionally.\n                        return VoronoiRegion.ABC;\n                    }\n                    else\n                    {\n                        Vector3.Subtract(ref triangle.vA, ref triangle.vB, out edgeDirection);\n                        Vector3.Dot(ref edgeDirection, ref contact.Normal, out edgeDot);\n                        if (edgeDot * edgeDot < edgeDirection.LengthSquared() * edgeEpsilon)\n                            return VoronoiRegion.AB;\n                        else\n                            return VoronoiRegion.B;\n                    }\n                }\n            }\n            else\n            {\n                //C is extreme.\n                if (dotA > dotB)\n                {\n                    //A is second most extreme.\n                    if (Math.Abs(dotC - dotB) < faceEpsilon)\n                    {\n                        //The normal is basically a face normal.  This can happen at the edges occasionally.\n                        return VoronoiRegion.ABC;\n                    }\n                    else\n                    {\n                        Vector3.Subtract(ref triangle.vA, ref triangle.vC, out edgeDirection);\n                        Vector3.Dot(ref edgeDirection, ref contact.Normal, out edgeDot);\n                        if (edgeDot * edgeDot < edgeDirection.LengthSquared() * edgeEpsilon)\n                            return VoronoiRegion.AC;\n                        else\n                            return VoronoiRegion.C;\n                    }\n                }\n                else\n                {\n                    //B is second most extreme.\n                    if (Math.Abs(dotC - dotA) < faceEpsilon)\n                    {\n                        //The normal is basically a face normal.  This can happen at the edges occasionally.\n                        return VoronoiRegion.ABC;\n                    }\n                    else\n                    {\n                        Vector3.Subtract(ref triangle.vB, ref triangle.vC, out edgeDirection);\n                        Vector3.Dot(ref edgeDirection, ref contact.Normal, out edgeDot);\n                        if (edgeDot * edgeDot < edgeDirection.LengthSquared() * edgeEpsilon)\n                            return VoronoiRegion.BC;\n                        else\n                            return VoronoiRegion.C;\n                    }\n                }\n            }\n\n        }\n\n        public override bool ShouldCorrectContactNormal\n        {\n            get\n            {\n                return state == CollisionState.Deep;\n            }\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/TrianglePairTester.cs",
    "content": "﻿using System;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing BEPUphysics.Settings;\nusing BEPUutilities.DataStructures;\nusing System.Diagnostics;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms\n{\n    ///<summary>\n    /// Persistent tester that compares triangles against convex objects.\n    ///</summary>\n    public abstract class TrianglePairTester\n    {\n        internal TriangleShape triangle;\n\n        ///<summary>\n        /// Whether or not the pair tester was updated during the last attempt.\n        ///</summary>\n        public bool Updated;\n\n        //Relies on the triangle being located in the local space of the convex object.  The convex transform is used to transform the\n        //contact points back from the convex's local space into world space.\n        ///<summary>\n        /// Generates a contact between the triangle and convex.\n        ///</summary>\n        ///<param name=\"contactList\">Contact between the shapes, if any.</param>\n        ///<returns>Whether or not the shapes are colliding.</returns>\n        public abstract bool GenerateContactCandidate(out TinyStructList<ContactData> contactList);\n\n        /// <summary>\n        /// Gets the triangle region in which the contact resides.\n        /// </summary>\n        /// <param name=\"contact\">Contact to check.</param>\n        /// <returns>Region in which the contact resides.</returns>\n        public abstract VoronoiRegion GetRegion(ref ContactData contact);\n\n        /// <summary>\n        /// Whether or not the last found contact should have its normal corrected.\n        /// </summary>\n        public abstract bool ShouldCorrectContactNormal { get; }\n\n        ///<summary>\n        /// Initializes the pair tester.\n        ///</summary>\n        ///<param name=\"convex\">Convex shape to use.</param>\n        ///<param name=\"triangle\">Triangle shape to use.</param>\n        public abstract void Initialize(ConvexShape convex, TriangleShape triangle);\n\n        /// <summary>\n        /// Cleans up the pair tester.\n        /// </summary>\n        public abstract void CleanUp();\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/TriangleSpherePairTester.cs",
    "content": "﻿using System;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing BEPUphysics.Settings;\nusing BEPUutilities.DataStructures;\nusing System.Diagnostics;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms\n{\n    ///<summary>\n    /// Persistent tester that compares triangles against convex objects.\n    ///</summary>\n    public sealed class TriangleSpherePairTester : TrianglePairTester\n    {\n        internal SphereShape sphere;\n\n        private VoronoiRegion lastRegion;\n\n\n        //Relies on the triangle being located in the local space of the convex object.  The convex transform is used to transform the\n        //contact points back from the convex's local space into world space.\n        ///<summary>\n        /// Generates a contact between the triangle and convex.\n        ///</summary>\n        ///<param name=\"contactList\">Contact between the shapes, if any.</param>\n        ///<returns>Whether or not the shapes are colliding.</returns>\n        public override bool GenerateContactCandidate(out TinyStructList<ContactData> contactList)\n        {\n            contactList = new TinyStructList<ContactData>();\n\n\n            Vector3 ab, ac;\n            Vector3.Subtract(ref triangle.vB, ref triangle.vA, out ab);\n            Vector3.Subtract(ref triangle.vC, ref triangle.vA, out ac);\n            Vector3 triangleNormal;\n            Vector3.Cross(ref ab, ref ac, out triangleNormal);\n            if (triangleNormal.LengthSquared() < Toolbox.Epsilon * .01f)\n            {\n                //If the triangle is degenerate, use the offset between its center and the sphere.\n                Vector3.Add(ref triangle.vA, ref triangle.vB, out triangleNormal);\n                Vector3.Add(ref triangleNormal, ref triangle.vC, out triangleNormal);\n                Vector3.Multiply(ref triangleNormal, 1 / 3f, out triangleNormal);\n                if (triangleNormal.LengthSquared() < Toolbox.Epsilon * .01f)\n                    triangleNormal = Toolbox.UpVector; //Alrighty then! Pick a random direction.\n                    \n            }\n\n            \n            float dot;\n            Vector3.Dot(ref triangleNormal, ref triangle.vA, out dot);\n            switch (triangle.sidedness)\n            {\n                case TriangleSidedness.DoubleSided:\n                    if (dot < 0)\n                        Vector3.Negate(ref triangleNormal, out triangleNormal); //Normal must face outward.\n                    break;\n                case TriangleSidedness.Clockwise:\n                    if (dot > 0)\n                        return false; //Wrong side, can't have a contact pointing in a reasonable direction.\n                    break;\n                case TriangleSidedness.Counterclockwise:\n                    if (dot < 0)\n                        return false; //Wrong side, can't have a contact pointing in a reasonable direction.\n                    break;\n\n            }\n\n\n            Vector3 closestPoint;\n            //Could optimize this process a bit.  The 'point' being compared is always zero.  Additionally, since the triangle normal is available,\n            //there is a little extra possible optimization.\n            lastRegion = Toolbox.GetClosestPointOnTriangleToPoint(ref triangle.vA, ref triangle.vB, ref triangle.vC, ref Toolbox.ZeroVector, out closestPoint);\n            float lengthSquared = closestPoint.LengthSquared();\n            float marginSum = triangle.collisionMargin + sphere.collisionMargin;\n\n            if (lengthSquared <= marginSum * marginSum)\n            {\n                var contact = new ContactData();\n                if (lengthSquared < Toolbox.Epsilon)\n                {\n                    //Super close to the triangle.  Normalizing would be dangerous.\n\n                    Vector3.Negate(ref triangleNormal, out contact.Normal);\n                    contact.Normal.Normalize();\n                    contact.PenetrationDepth = marginSum;\n                    contactList.Add(ref contact);\n                    return true;\n                }\n\n                lengthSquared = (float)Math.Sqrt(lengthSquared);\n                Vector3.Divide(ref closestPoint, lengthSquared, out contact.Normal);\n                contact.PenetrationDepth = marginSum - lengthSquared;\n                contact.Position = closestPoint;\n                contactList.Add(ref contact);\n                return true;\n\n            }\n            return false;\n\n\n\n\n        }\n\n        public override VoronoiRegion GetRegion(ref ContactData contact)\n        {\n            return lastRegion;\n        }\n\n\n        public override bool ShouldCorrectContactNormal\n        {\n            get\n            {\n                return false;\n            }\n        }\n\n        ///<summary>\n        /// Initializes the pair tester.\n        ///</summary>\n        ///<param name=\"convex\">Convex shape to use.</param>\n        ///<param name=\"triangle\">Triangle shape to use.</param>\n        public override void Initialize(ConvexShape convex, TriangleShape triangle)\n        {\n            this.sphere = (SphereShape)convex;\n            this.triangle = triangle;\n        }\n\n        /// <summary>\n        /// Cleans up the pair tester.\n        /// </summary>\n        public override void CleanUp()\n        {\n            triangle = null;\n            sphere = null;\n            Updated = false;\n        }\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/CollisionAlgorithms/TriangleTrianglePairTester.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.CollisionTests.CollisionAlgorithms\n{\n    /// <summary>\n    /// Generates candidates between two triangles and manages the persistent state of the pair.\n    /// </summary>\n    public class TriangleTrianglePairTester : TriangleConvexPairTester\n    {\n        //TODO: Having a specialized triangle-triangle pair test would be nice.  Even if it didn't use an actual triangle-triangle test, certain assumptions could still make it speedier and more elegant.\n        //\"Closest points between triangles\" + persistent manifolding would probably be the best approach (a lot faster than the triangle-convex general case anyway).\n        public override bool GenerateContactCandidate(out TinyStructList<ContactData> contactList)\n        {\n            if (base.GenerateContactCandidate(out contactList))\n            {\n                //The triangle-convex pair test has already rejected contacts whose normals would violate the first triangle's sidedness.\n                //However, since it's a vanilla triangle-convex test, it doesn't know about the sidedness of the other triangle!\n                var shape = ((TriangleShape)convex);\n                Vector3 normal;\n                //Lots of recalculating ab-bc!\n                Vector3 ab, ac;\n                Vector3.Subtract(ref shape.vB, ref shape.vA, out ab);\n                Vector3.Subtract(ref shape.vC, ref shape.vA, out ac);\n                Vector3.Cross(ref ab, ref ac, out normal);\n                var sidedness = shape.sidedness;\n                if (sidedness != TriangleSidedness.DoubleSided)\n                {\n                    for (int i = contactList.Count - 1; i >= 0; i--)\n                    {\n                        ContactData item;\n                        contactList.Get(i, out item);\n\n                        float dot;\n                        Vector3.Dot(ref item.Normal, ref normal, out dot);\n                        if (sidedness == TriangleSidedness.Clockwise)\n                        {\n                            if (dot < 0)\n                            {\n                                contactList.RemoveAt(i);\n                            }\n                        }\n                        else\n                        {\n                            if (dot > 0)\n                            {\n                                contactList.RemoveAt(i);\n                            }\n                        }\n                    }\n                }\n                return contactList.Count > 0;\n            }\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Contact.cs",
    "content": "﻿using System;\nusing BEPUphysics.Settings;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.CollisionTests\n{\n    /// <summary>\n    /// Handles information about a contact point during a collision between two bodies.\n    /// </summary>\n    public class Contact\n    {\n        /// <summary>\n        /// Amount of penetration between the two objects.\n        /// </summary>\n        public float PenetrationDepth;\n\n        /// <summary>\n        /// Identifier used to link contact data with existing contacts and categorize members of a manifold.\n        /// </summary>\n        public int Id = -1;\n\n        /// <summary>\n        /// Normal direction of the surface at the contact point.\n        /// </summary>\n        public Vector3 Normal;\n\n\n        /// <summary>\n        /// Position of the contact point.\n        /// </summary>\n        public Vector3 Position;\n\n \n\n\n        ///<summary>\n        /// Sets up the contact with new information.\n        ///</summary>\n        ///<param name=\"candidate\">Contact data to initialize the contact with.</param>\n        public void Setup(ref ContactData candidate)\n        {\n            candidate.Validate();\n            Position = candidate.Position;\n            Normal = candidate.Normal;\n            PenetrationDepth = candidate.PenetrationDepth;\n            Id = candidate.Id;\n        }\n\n        /// <summary>\n        /// Outputs the position, normal, and depth information of the contact into a string.\n        /// </summary>\n        /// <returns>Position, normal, and depth information of the contact in a string.</returns>\n        public override string ToString()\n        {\n            return \"Position: \" + Position + \" Normal: \" + Normal + \" Depth: \" + PenetrationDepth;\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/ContactData.cs",
    "content": "﻿using Microsoft.Xna.Framework;\nusing System;\n\nnamespace BEPUphysics.CollisionTests\n{\n    ///<summary>\n    /// Contact data created by collision detection.\n    ///</summary>\n    public struct ContactData :IEquatable<ContactData>\n    {\n        /// <summary>\n        /// Amount of penetration between the two objects.\n        /// </summary>\n        public float PenetrationDepth;\n\n        /// <summary>\n        /// Feature-based id used to match contacts from the previous frame to their current versions.\n        /// </summary>\n        public int Id;\n\n        /// <summary>\n        /// Normal direction of the surface at the contact point.\n        /// </summary>\n        public Vector3 Normal;\n\n        /// <summary>\n        /// Position of the contact point.\n        /// </summary>\n        public Vector3 Position;\n\n        /// <summary>\n        /// Returns the fully qualified type name of this instance.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.String\"/> containing a fully qualified type name.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override string ToString()\n        {\n            return Position + \", \" + Normal;\n        }\n\n\n\n        public bool Equals(ContactData other)\n        {\n            return other.PenetrationDepth == PenetrationDepth &&\n                other.Id == Id &&\n                other.Normal == Normal &&\n                other.Position == Position;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/ContactReducer.cs",
    "content": "﻿using System;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.CollisionTests\n{\n    ///<summary>\n    /// Helper class that reduces contact manifolds to reasonable numbers of contacts.\n    ///</summary>\n    public static class ContactReducer\n    {\n        //This works in the general case where there can be any  number of contacts and candidates.  Could specialize it as an optimization to single-contact added incremental manifolds.\n        ///<summary>\n        /// Reduces the contact manifold to a good subset.\n        ///</summary>\n        ///<param name=\"contacts\">Contacts to reduce.</param>\n        ///<param name=\"contactCandidates\">Contact candidates to include in the reduction process.</param>\n        ///<param name=\"contactsToRemove\">Contacts that need to removed to reach the reduced state.</param>\n        ///<param name=\"toAdd\">Contact candidates that should be added to reach the reduced state.</param>\n        ///<exception cref=\"InvalidOperationException\">Thrown when the set being reduced is empty.</exception>\n        public static void ReduceContacts(RawList<Contact> contacts, RawValueList<ContactData> contactCandidates, RawList<int> contactsToRemove, RawValueList<ContactData> toAdd)\n        {\n            //Find the deepest point of all contacts/candidates, as well as a compounded 'normal' vector.\n            float maximumDepth = -float.MaxValue;\n            int deepestIndex = -1;\n            Vector3 normal = Toolbox.ZeroVector;\n            for (int i = 0; i < contacts.Count; i++)\n            {\n                Vector3.Add(ref normal, ref contacts.Elements[i].Normal, out normal);\n                if (contacts.Elements[i].PenetrationDepth > maximumDepth)\n                {\n                    deepestIndex = i;\n                    maximumDepth = contacts.Elements[i].PenetrationDepth;\n                }\n            }\n            for (int i = 0; i < contactCandidates.Count; i++)\n            {\n                Vector3.Add(ref normal, ref contactCandidates.Elements[i].Normal, out normal);\n                if (contactCandidates.Elements[i].PenetrationDepth > maximumDepth)\n                {\n                    deepestIndex = contacts.Count + i;\n                    maximumDepth = contactCandidates.Elements[i].PenetrationDepth;\n                }\n            }\n            //If the normals oppose each other, this can happen.  It doesn't need to be normalized, but having SOME normal is necessary.\n            if (normal.LengthSquared() < Toolbox.Epsilon)\n                if (contacts.Count > 0)\n                    normal = contacts.Elements[0].Normal;\n                else if (contactCandidates.Count > 0)\n                    normal = contactCandidates.Elements[0].Normal; //This method is only called when there's too many contacts, so if contacts is empty, the candidates must NOT be empty.\n                else //This method should not have been called at all if it gets here.\n                    throw new ArgumentException(\"Cannot reduce an empty contact set.\");\n\n\n            //Find the contact (candidate) that is furthest away from the deepest contact (candidate).\n            Vector3 deepestPosition;\n            if (deepestIndex < contacts.Count)\n                deepestPosition = contacts.Elements[deepestIndex].Position;\n            else\n                deepestPosition = contactCandidates.Elements[deepestIndex - contacts.Count].Position;\n            float distanceSquared;\n            float furthestDistance = 0;\n            int furthestIndex = -1;\n            for (int i = 0; i < contacts.Count; i++)\n            {\n                Vector3.DistanceSquared(ref contacts.Elements[i].Position, ref deepestPosition, out distanceSquared);\n                if (distanceSquared > furthestDistance)\n                {\n                    furthestDistance = distanceSquared;\n                    furthestIndex = i;\n                }\n            }\n            for (int i = 0; i < contactCandidates.Count; i++)\n            {\n                Vector3.DistanceSquared(ref contactCandidates.Elements[i].Position, ref deepestPosition, out distanceSquared);\n                if (distanceSquared > furthestDistance)\n                {\n                    furthestDistance = distanceSquared;\n                    furthestIndex = contacts.Count + i;\n                }\n            }\n            if (furthestIndex == -1)\n            {\n                //Either this method was called when it shouldn't have been, or all contacts and contact candidates are at the same location.\n                if (contacts.Count > 0)\n                {\n                    for (int i = 1; i < contacts.Count; i++)\n                    {\n                        contactsToRemove.Add(i);\n                    }\n                    return;\n                }\n                if (contactCandidates.Count > 0)\n                {\n                    toAdd.Add(ref contactCandidates.Elements[0]);\n                    return;\n                }\n                throw new ArgumentException(\"Cannot reduce an empty contact set.\");\n\n            }\n            Vector3 furthestPosition;\n            if (furthestIndex < contacts.Count)\n                furthestPosition = contacts.Elements[furthestIndex].Position;\n            else\n                furthestPosition = contactCandidates.Elements[furthestIndex - contacts.Count].Position;\n            Vector3 xAxis;\n            Vector3.Subtract(ref deepestPosition, ref furthestPosition, out xAxis);\n\n            //Create the second axis of the 2d 'coordinate system' of the manifold.\n            Vector3 yAxis;\n            Vector3.Cross(ref xAxis, ref normal, out yAxis);\n\n            //Determine the furthest points along the axis.\n            float minYAxisDot = float.MaxValue, maxYAxisDot = -float.MaxValue;\n            int minYAxisIndex = -1, maxYAxisIndex = -1;\n\n            for (int i = 0; i < contacts.Count; i++)\n            {\n                float dot;\n                Vector3.Dot(ref contacts.Elements[i].Position, ref yAxis, out dot);\n                if (dot < minYAxisDot)\n                {\n                    minYAxisIndex = i;\n                    minYAxisDot = dot;\n                }\n                if (dot > maxYAxisDot)\n                {\n                    maxYAxisIndex = i;\n                    maxYAxisDot = dot;\n                }\n\n            }\n            for (int i = 0; i < contactCandidates.Count; i++)\n            {\n                float dot;\n                Vector3.Dot(ref contactCandidates.Elements[i].Position, ref yAxis, out dot);\n                if (dot < minYAxisDot)\n                {\n                    minYAxisIndex = i + contacts.Count;\n                    minYAxisDot = dot;\n                }\n                if (dot > maxYAxisDot)\n                {\n                    maxYAxisIndex = i + contacts.Count;\n                    maxYAxisDot = dot;\n                }\n\n            }\n\n            //the deepestIndex, furthestIndex, minYAxisIndex, and maxYAxisIndex are the extremal points.\n            //Cycle through the existing contacts.  If any DO NOT MATCH the existing candidates, add them to the toRemove list.\n            //Cycle through the candidates.  If any match, add them to the toAdd list.\n\n            //Repeated entries in the reduced manifold aren't a problem.\n            //-Contacts list does not include repeats with itself.\n            //-A contact is only removed if it doesn't match anything.\n\n            //-Contact candidates do not repeat with themselves.\n            //-Contact candidates do not repeat with contacts.\n            //-Contact candidates are added if they match any of the indices.\n\n            for (int i = 0; i < contactCandidates.Count; i++)\n            {\n                int totalIndex = i + contacts.Count;\n                if (totalIndex == deepestIndex || totalIndex == furthestIndex || totalIndex == minYAxisIndex || totalIndex == maxYAxisIndex)\n                {\n                    //This contact is present in the new manifold.  Add it.\n                    toAdd.Add(ref contactCandidates.Elements[i]);\n                }\n            }\n            for (int i = 0; i < contacts.Count; i++)\n            {\n                if (!(i == deepestIndex || i == furthestIndex || i == minYAxisIndex || i == maxYAxisIndex))\n                {\n                    //This contact is not present in the new manifold.  Remove it.\n                    contactsToRemove.Add(i);\n                }\n            }\n\n\n\n        }\n\n\n        //This works in the specific case of 4 contacts and 1 contact candidate.\n        ///<summary>\n        /// Reduces a 4-contact manifold and contact candidate to 4 total contacts.\n        ///</summary>\n        ///<param name=\"contacts\">Contacts to reduce.</param>\n        ///<param name=\"contactCandidate\">Contact candidate to include in the reduction process.</param>\n        ///<param name=\"toRemove\">Contacts that need to be removed to reduce the manifold.</param>\n        ///<param name=\"addCandidate\">Whether or not to add the contact candidate to reach the reduced manifold.</param>\n        ///<exception cref=\"ArgumentException\">Thrown when the contact manifold being reduced doesn't have 4 contacts.</exception>\n        public static void ReduceContacts(RawList<Contact> contacts, ref ContactData contactCandidate, RawList<int> toRemove, out bool addCandidate)\n        {\n            if (contacts.Count != 4)\n                throw new ArgumentException(\"Can only use this method to reduce contact lists with four contacts and a contact candidate.\");\n\n            //addCandidate = true;\n            //float min = float.MaxValue;\n            //int minIndex = 3;\n            //for (int i = 0; i < 4; i++)\n            //{\n            //    if (contacts.Elements[i].PenetrationDepth < min)\n            //    {\n            //        min = contacts.Elements[i].PenetrationDepth;\n            //        minIndex = i;\n            //    }\n            //}\n            //toRemove.Add(minIndex);\n            //return;\n\n            //Find the deepest point of all contacts/candidates, as well as a compounded 'normal' vector.\n            float maximumDepth = -float.MaxValue;\n            int deepestIndex = -1;\n            for (int i = 0; i < 4; i++)\n            {\n                if (contacts.Elements[i].PenetrationDepth > maximumDepth)\n                {\n                    deepestIndex = i;\n                    maximumDepth = contacts.Elements[i].PenetrationDepth;\n                }\n            }\n            if (contactCandidate.PenetrationDepth > maximumDepth)\n            {\n                deepestIndex = 4;\n            }\n\n\n            //Find the contact (candidate) that is furthest away from the deepest contact (candidate).\n            Vector3 deepestPosition;\n            if (deepestIndex < 4)\n                deepestPosition = contacts.Elements[deepestIndex].Position;\n            else\n                deepestPosition = contactCandidate.Position;\n            float distanceSquared;\n            float furthestDistance = 0;\n            int furthestIndex = -1;\n            for (int i = 0; i < 4; i++)\n            {\n                Vector3.DistanceSquared(ref contacts.Elements[i].Position, ref deepestPosition, out distanceSquared);\n                if (distanceSquared > furthestDistance)\n                {\n                    furthestDistance = distanceSquared;\n                    furthestIndex = i;\n                }\n            }\n\n            Vector3.DistanceSquared(ref contactCandidate.Position, ref deepestPosition, out distanceSquared);\n            if (distanceSquared > furthestDistance)\n            {\n                furthestIndex = 4;\n            }\n            Vector3 furthestPosition;\n            if (furthestIndex < contacts.Count)\n                furthestPosition = contacts.Elements[furthestIndex].Position;\n            else\n                furthestPosition = contactCandidate.Position;\n            Vector3 xAxis;\n            Vector3.Subtract(ref deepestPosition, ref furthestPosition, out xAxis);\n\n            //Create the second axis of the 2d 'coordinate system' of the manifold.\n            Vector3 yAxis;\n            Vector3.Cross(ref xAxis, ref contacts.Elements[0].Normal, out yAxis);\n\n            //Determine the furthest points along the axis.\n            float minYAxisDot = float.MaxValue, maxYAxisDot = -float.MaxValue;\n            int minYAxisIndex = -1, maxYAxisIndex = -1;\n\n            float dot;\n            for (int i = 0; i < 4; i++)\n            {\n                Vector3.Dot(ref contacts.Elements[i].Position, ref yAxis, out dot);\n                if (dot < minYAxisDot)\n                {\n                    minYAxisIndex = i;\n                    minYAxisDot = dot;\n                }\n                if (dot > maxYAxisDot)\n                {\n                    maxYAxisIndex = i;\n                    maxYAxisDot = dot;\n                }\n\n            }\n            Vector3.Dot(ref contactCandidate.Position, ref yAxis, out dot);\n            if (dot < minYAxisDot)\n            {\n                minYAxisIndex = 4;\n            }\n            if (dot > maxYAxisDot)\n            {\n                maxYAxisIndex = 4;\n            }\n\n            //the deepestIndex, furthestIndex, minYAxisIndex, and maxYAxisIndex are the extremal points.\n            //Cycle through the existing contacts.  If any DO NOT MATCH the existing candidates, add them to the toRemove list.\n            //Cycle through the candidates.  If any match, add them to the toAdd list.\n\n            //Repeated entries in the reduced manifold aren't a problem.\n            //-Contacts list does not include repeats with itself.\n            //-A contact is only removed if it doesn't match anything.\n\n            //-Contact candidates do not repeat with themselves.\n            //-Contact candidates do not repeat with contacts.\n            //-Contact candidates are added if they match any of the indices.\n\n            if (4 == deepestIndex || 4 == furthestIndex || 4 == minYAxisIndex || 4 == maxYAxisIndex)\n            {\n\n                addCandidate = true;\n                //Only reduce when we are going to add a new contact, and only get rid of one.\n                for (int i = 0; i < 4; i++)\n                {\n                    if (!(i == deepestIndex || i == furthestIndex || i == minYAxisIndex || i == maxYAxisIndex))\n                    {\n                        //This contact is not present in the new manifold.  Remove it.\n                        toRemove.Add(i);\n                        break;\n                    }\n                }\n            }\n            else\n                addCandidate = false;\n\n\n\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/ContactRefresher.cs",
    "content": "﻿using BEPUutilities;\nusing BEPUphysics.Settings;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing System.Diagnostics;\nusing System;\n\nnamespace BEPUphysics.CollisionTests\n{\n    ///<summary>\n    /// Helper class that refreshes manifolds to keep them recent.\n    ///</summary>\n    public class ContactRefresher\n    {\n\n        /// <summary>\n        /// Refreshes the contact manifold, removing any out of date contacts\n        /// and updating others.\n        /// </summary>\n        public static void ContactRefresh(RawList<Contact> contacts, RawValueList<ContactSupplementData> supplementData, ref RigidTransform transformA, ref RigidTransform transformB, RawList<int> toRemove)\n        {\n            //TODO: Could also refresh normals with some trickery.\n            //Would also need to refresh depth using new normals, and would require some extra information.\n\n            for (int k = 0; k < contacts.Count; k++)\n            {\n                contacts.Elements[k].Validate();\n                ContactSupplementData data = supplementData.Elements[k];\n                Vector3 newPosA, newPosB;\n                RigidTransform.Transform(ref data.LocalOffsetA, ref transformA, out newPosA);\n                RigidTransform.Transform(ref data.LocalOffsetB, ref transformB, out newPosB);\n\n                //ab - (ab*n)*n\n                //Compute the horizontal offset.\n                Vector3 ab;\n                Vector3.Subtract(ref newPosB, ref newPosA, out ab);\n                float dot;\n                Vector3.Dot(ref ab, ref contacts.Elements[k].Normal, out dot);\n                Vector3 temp;\n                Vector3.Multiply(ref contacts.Elements[k].Normal, dot, out temp);\n                Vector3.Subtract(ref ab, ref temp, out temp);\n                dot = temp.LengthSquared();\n                if (dot > CollisionDetectionSettings.ContactInvalidationLengthSquared)\n                {\n                    toRemove.Add(k);\n                }\n                else\n                {\n                    //Depth refresh:\n                    //Find deviation (IE, (Ra-Rb)*N) and add to base depth.\n                    Vector3.Dot(ref ab, ref contacts.Elements[k].Normal, out dot);\n                    contacts.Elements[k].PenetrationDepth = data.BasePenetrationDepth - dot;\n                    if (contacts.Elements[k].PenetrationDepth < -CollisionDetectionSettings.maximumContactDistance)\n                        toRemove.Add(k);\n                    else\n                    {\n                        //Refresh position and ra/rb.\n                        Vector3 newPos;\n                        Vector3.Add(ref newPosB, ref newPosA, out newPos);\n                        Vector3.Multiply(ref newPos, .5f, out newPos);\n                        contacts.Elements[k].Position = newPos;\n                        //This is an interesting idea, but has very little effect one way or the other.\n                        //data.BasePenetrationDepth = contacts.Elements[k].PenetrationDepth;\n                        //RigidTransform.TransformByInverse(ref newPos, ref transformA, out data.LocalOffsetA);\n                        //RigidTransform.TransformByInverse(ref newPos, ref transformB, out data.LocalOffsetB);\n                    }\n                    contacts.Elements[k].Validate();\n                }\n               \n            }\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/ContactSupplementData.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.CollisionTests\n{\n    ///<summary>\n    /// Extra data associated with a contact point used to refresh contacts each frame.\n    ///</summary>\n    public struct ContactSupplementData\n    {\n        /// <summary>\n        /// Offset from the center of the first object to the contact point in the object's local space.\n        /// </summary>\n        public Vector3 LocalOffsetA;\n\n        /// <summary>\n        /// Offset from the center of the second object to the contact point in the object's local space.\n        /// </summary>\n        public Vector3 LocalOffsetB;\n        /// <summary>\n        /// Original penetration depth computed at the associatd contact.\n        /// </summary>\n        public float BasePenetrationDepth;\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/BoxContactManifold.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contact data between two boxes.\n    ///</summary>\n    public class BoxContactManifold : ContactManifold\n    {\n        protected ConvexCollidable<BoxShape> boxA, boxB;\n\n        ///<summary>\n        /// Gets the first collidable in the pair.\n        ///</summary>\n        public ConvexCollidable<BoxShape> CollidableA\n        {\n            get\n            {\n                return boxA;\n            }\n        }\n\n        /// <summary>\n        /// Gets the second collidable in the pair.\n        /// </summary>\n        public ConvexCollidable<BoxShape> CollidableB\n        {\n            get\n            {\n                return boxB;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new manifold.\n        ///</summary>\n        public BoxContactManifold()\n        {\n            contacts = new RawList<Contact>(4);\n            unusedContacts = new UnsafeResourcePool<Contact>(4);\n            contactIndicesToRemove = new RawList<int>(4);\n        }\n\n#if ALLOWUNSAFE\n        ///<summary>\n        /// Updates the manifold.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n\n            //Now, generate a contact between the two shapes.\n            float distance;\n            Vector3 axis;\n            BoxContactDataCache manifold;\n            if (BoxBoxCollider.AreBoxesColliding(boxA.Shape, boxB.Shape, ref boxA.worldTransform, ref boxB.worldTransform, out distance, out axis, out manifold))\n            {\n                unsafe\n                {\n                    BoxContactData* manifoldPointer = &manifold.D1;\n                    Vector3.Negate(ref axis, out axis);\n                    var toRemove = new TinyList<int>();\n                    for (int i = 0; i < contacts.Count; i++)\n                    {\n                        bool found = false;\n                        for (int j = manifold.Count - 1; j >= 0; j--)\n                        {\n                            if (contacts.Elements[i].Id == manifoldPointer[j].Id)\n                            {\n                                found = true;\n                                contacts.Elements[i].Validate();\n                                //Update contact...\n                                contacts.Elements[i].Position = manifoldPointer[j].Position;\n                                contacts.Elements[i].PenetrationDepth = -manifoldPointer[j].Depth;\n                                contacts.Elements[i].Normal = axis;\n                                //Remove manifold entry\n                                contacts.Elements[i].Validate();\n                                manifold.RemoveAt(j);\n                                break;\n                            }\n                        }\n                        if (!found)\n                        {//No match found\n                            toRemove.Add(i);\n                        }\n                    }\n\n\n                    //toRemove is sorted by increasing index.  Go backwards along it so that the indices are valid all the way through.\n                    for (int i = toRemove.Count - 1; i >= 0; i--)\n                        Remove(toRemove[i]);\n\n                    //Add new contacts.\n                    for (int i = 0; i < manifold.Count; i++)\n                    {\n                        var newContact = new ContactData\n                                             {\n                                                 Position = manifoldPointer[i].Position,\n                                                 PenetrationDepth = -manifoldPointer[i].Depth,\n                                                 Normal = axis,\n                                                 Id = manifoldPointer[i].Id\n                                             };\n\n                        Add(ref newContact);\n                    }\n                }\n            }\n            else\n            {\n                //Not colliding, so get rid of it.\n                for (int i = contacts.Count - 1; i >= 0; i--)\n                {\n                    Remove(i);\n                }\n            }\n        }\n#else\n        public override void Update(float dt)\n        {\n\n            //Now, generate a contact between the two shapes.\n            float distance;\n            Vector3 axis;\n            var manifold = new TinyStructList<BoxContactData>();\n            if (BoxBoxCollider.AreBoxesColliding(boxA.Shape, boxB.Shape, ref boxA.worldTransform, ref boxB.worldTransform, out distance, out axis, out manifold))\n            {\n                Vector3.Negate(ref axis, out axis);\n                TinyList<int> toRemove = new TinyList<int>();\n                BoxContactData data;\n                for (int i = 0; i < contacts.Count; i++)\n                {\n                    bool found = false;\n                    for (int j = manifold.Count - 1; j >= 0; j--)\n                    {\n                        manifold.Get(j, out data);\n                        if (contacts.Elements[i].Id == data.Id)\n                        {\n                            found = true;\n                            //Update contact...\n                            contacts.Elements[i].Position = data.Position;\n                            contacts.Elements[i].PenetrationDepth = -data.Depth;\n                            contacts.Elements[i].Normal = axis;\n                            contacts.Elements[i].Validate();\n                            //Remove manifold entry\n                            manifold.RemoveAt(j);\n                            break;\n                        }\n                    }\n                    if (!found)\n                    {//No match found\n                        toRemove.Add(i);\n                    }\n                }\n\n                ////Go through the indices to remove.\n                ////For each one, replace the removal index with a contact in the new manifold.\n                //int removalIndex;\n                //for (removalIndex = toRemove.count - 1; removalIndex >= 0 && manifold.count > 0; removalIndex--)\n                //{\n                //    int indexToReplace = toRemove[removalIndex];\n                //    toRemove.RemoveAt(removalIndex);\n                //    manifold.Get(manifold.count - 1, out data);\n                //    //Update contact...\n                //    contacts.Elements[indexToReplace].Position = data.Position;\n                //    contacts.Elements[indexToReplace].PenetrationDepth = -data.Depth;\n                //    contacts.Elements[indexToReplace].Normal = axis;\n                //    contacts.Elements[indexToReplace].Id = data.Id;\n                //    //Remove manifold entry\n                //    manifold.RemoveAt(manifold.count - 1);\n\n                //}\n\n                //Alright, we ran out of contacts to replace (if, in fact, toRemove isn't empty now).  Just remove the remainder.\n                //toRemove is sorted by increasing index.  Go backwards along it so that the indices are valid all the way through.\n                for (int i = toRemove.Count - 1; i >= 0; i--)\n                    Remove(toRemove[i]);\n\n                //Add new contacts.\n                for (int i = 0; i < manifold.Count; i++)\n                {\n                    manifold.Get(i, out data);\n                    ContactData newContact = new ContactData();\n                    newContact.Position = data.Position;\n                    newContact.PenetrationDepth = -data.Depth;\n                    newContact.Normal = axis;\n                    newContact.Id = data.Id;\n\n                    Add(ref newContact);\n                }\n            }\n            else\n            {\n                //Not colliding, so get rid of it.\n                for (int i = contacts.Count - 1; i >= 0; i--)\n                {\n                    Remove(i);\n                }\n            }\n        }\n#endif\n\n\n        ///<summary>\n        /// Initializes the manifold.\n        ///</summary>\n        ///<param name=\"newCollidableA\">First collidable.</param>\n        ///<param name=\"newCollidableB\">Second collidable.</param>\n        ///<exception cref=\"Exception\">Thrown when the collidables being used are not of the proper type.</exception>\n        public override void Initialize(Collidable newCollidableA, Collidable newCollidableB)\n        {\n            boxA = (ConvexCollidable<BoxShape>)newCollidableA;\n            boxB = (ConvexCollidable<BoxShape>)newCollidableB;\n\n\n            if (boxA == null || boxB == null)\n            {\n                throw new ArgumentException(\"Inappropriate types used to initialize pair tester.\");\n            }\n        }\n\n        ///<summary>\n        /// Cleans up the manifold.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            boxA = null;\n            boxB = null;\n            base.CleanUp();\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/BoxSphereContactManifold.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contact data between two boxes.\n    ///</summary>\n    public class BoxSphereContactManifold : ContactManifold\n    {\n        protected ConvexCollidable<BoxShape> box;\n        protected ConvexCollidable<SphereShape> sphere;\n\n        ///<summary>\n        /// Gets the first collidable in the pair.\n        ///</summary>\n        public ConvexCollidable<BoxShape> CollidableA\n        {\n            get\n            {\n                return box;\n            }\n        }\n\n        /// <summary>\n        /// Gets the second collidable in the pair.\n        /// </summary>\n        public ConvexCollidable<SphereShape> CollidableB\n        {\n            get\n            {\n                return sphere;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new manifold.\n        ///</summary>\n        public BoxSphereContactManifold()\n        {\n            contacts = new RawList<Contact>(1);\n        }\n\n        Contact contact = new Contact();\n        bool previouslyColliding;\n\n        ///<summary>\n        /// Updates the manifold.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            ContactData contactData;\n            bool colliding = false;\n            if (BoxSphereTester.AreShapesColliding(box.Shape, sphere.Shape, ref box.worldTransform, ref sphere.worldTransform.Position, out contactData))\n            {\n                if (!previouslyColliding && contactData.PenetrationDepth >= 0)//Don't use the contact if it's an initial contact and the depth is negative.  Why not? Bounciness and InitialCollisionDetected.\n                {\n                    Add(ref contactData);\n                    colliding = true;\n                }\n                else if (previouslyColliding)\n                {\n                    contactData.Validate();\n                    contact.Normal = contactData.Normal;\n                    contact.PenetrationDepth = contactData.PenetrationDepth;\n                    contact.Position = contactData.Position;\n                    colliding = true;\n                }\n            }\n            else\n            {\n                if (previouslyColliding)\n                    Remove(0);\n            }\n            previouslyColliding = colliding;\n        }\n\n        protected override void Add(ref ContactData contactCandidate)\n        {\n            contactCandidate.Validate();\n            contact.Normal = contactCandidate.Normal;\n            contact.PenetrationDepth = contactCandidate.PenetrationDepth;\n            contact.Position = contactCandidate.Position;\n\n            contacts.Add(contact);\n            OnAdded(contact);\n        }\n\n        protected override void Remove(int index)\n        {\n            contacts.RemoveAt(index);\n            OnRemoved(contact);\n        }\n\n\n\n        ///<summary>\n        /// Initializes the manifold.\n        ///</summary>\n        ///<param name=\"newCollidableA\">First collidable.</param>\n        ///<param name=\"newCollidableB\">Second collidable.</param>\n        ///<exception cref=\"Exception\">Thrown when the collidables being used are not of the proper type.</exception>\n        public override void Initialize(Collidable newCollidableA, Collidable newCollidableB)\n        {\n            box = newCollidableA as ConvexCollidable<BoxShape>;\n            sphere = newCollidableB as ConvexCollidable<SphereShape>;\n\n            if (box == null || sphere == null)\n            {\n                box = newCollidableB as ConvexCollidable<BoxShape>;\n                sphere = newCollidableA as ConvexCollidable<SphereShape>;\n                if (box == null || sphere == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n        }\n\n        ///<summary>\n        /// Cleans up the manifold.\n        ///</summary>\n        public override void CleanUp()\n        {\n            box = null;\n            sphere = null;\n            previouslyColliding = false;\n            //We don't have to worry about losing a reference to our contact- we keep it local!\n            contacts.Clear();\n        }\n\n        /// <summary>\n        /// Clears the contacts associated with this manifold.\n        /// </summary>\n        public override void ClearContacts()\n        {\n            previouslyColliding = false;\n            base.ClearContacts();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/ContactManifold.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities.ResourceManagement;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Superclass of manifolds which manage persistent contacts over multiple frames.\n    ///</summary>\n    public abstract class ContactManifold\n    {\n\n        protected RawList<int> contactIndicesToRemove;\n        protected internal RawList<Contact> contacts;\n\n        ///<summary>\n        /// Gets the contacts in the manifold.\n        ///</summary>\n        public ReadOnlyList<Contact> Contacts\n        {\n            get\n            {\n                return new ReadOnlyList<Contact>(contacts);\n            }\n        }\n        protected UnsafeResourcePool<Contact> unusedContacts;\n\n\n        protected void RemoveQueuedContacts()\n        {\n            //TOREMOVE MUST BE SORTED LEAST TO GREATEST INDEX.\n            for (int i = contactIndicesToRemove.Count - 1; i >= 0; i--)\n            {\n                Remove(contactIndicesToRemove.Elements[i]);\n            }\n            contactIndicesToRemove.Clear();\n        }\n\n        protected virtual void Remove(int contactIndex)\n        {\n            Contact removing = contacts.Elements[contactIndex];\n            contacts.FastRemoveAt(contactIndex);\n            OnRemoved(removing);\n            unusedContacts.GiveBack(removing);\n        }\n\n        protected virtual void Add(ref ContactData contactCandidate)\n        {\n            Contact adding = unusedContacts.Take();\n            adding.Setup(ref contactCandidate);\n            contacts.Add(adding);\n            OnAdded(adding);\n        }\n\n\n        ///<summary>\n        /// Fires when a contact is added.\n        ///</summary>\n        public event Action<Contact> ContactAdded;\n        ///<summary>\n        /// Fires when a contact is removed.\n        ///</summary>\n        public event Action<Contact> ContactRemoved;\n\n        protected void OnAdded(Contact contact)\n        {\n            if (ContactAdded != null)\n                ContactAdded(contact);\n        }\n\n        protected void OnRemoved(Contact contact)\n        {\n            if (ContactRemoved != null)\n                ContactRemoved(contact);\n        }\n\n        ///<summary>\n        /// Initializes the manifold.\n        ///</summary>\n        ///<param name=\"newCollidableA\">First collidable.</param>\n        ///<param name=\"newCollidableB\">Second collidable.</param>\n        public abstract void Initialize(Collidable newCollidableA, Collidable newCollidableB);\n\n\n        ///<summary>\n        /// Cleans up the manifold.\n        ///</summary>\n        public virtual void CleanUp()\n        {\n            for (int i = contacts.Count - 1; i >= 0; --i)\n            {\n                unusedContacts.GiveBack(contacts.Elements[i]);\n                contacts.FastRemoveAt(i);\n            }\n        }\n\n        ///<summary>\n        /// Updates the manifold.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public abstract void Update(float dt);\n\n        /// <summary>\n        /// Clears the contacts associated with this manifold.\n        /// </summary>\n        public virtual void ClearContacts()\n        {\n            for (int i = contacts.Count - 1; i >= 0; i--)\n            {\n                Remove(i);\n            }\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/GeneralConvexContactManifold.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.Settings;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts for two convex collidables.\n    ///</summary>\n    public class GeneralConvexContactManifold : ContactManifold\n    {\n        RawValueList<ContactSupplementData> supplementData = new RawValueList<ContactSupplementData>(4);\n        GeneralConvexPairTester pairTester;\n\n        ///<summary>\n        /// Gets the pair tester used by the manifold to do testing.\n        ///</summary>\n        public GeneralConvexPairTester PairTester\n        {\n            get\n            {\n                return pairTester;\n            }\n\n        }\n\n        protected ConvexCollidable collidableA, collidableB;\n\n        ///<summary>\n        /// Gets the first collidable in the pair.\n        ///</summary>\n        public ConvexCollidable CollidableA\n        {\n            get\n            {\n                return collidableA;\n            }\n        }\n\n        /// <summary>\n        /// Gets the second collidable in the pair.\n        /// </summary>\n        public ConvexCollidable CollidableB\n        {\n            get\n            {\n                return collidableB;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new convex-convex manifold.\n        ///</summary>\n        public GeneralConvexContactManifold()\n        {\n            contacts = new RawList<Contact>(4);\n            unusedContacts = new UnsafeResourcePool<Contact>(4);\n            contactIndicesToRemove = new RawList<int>(4);\n            pairTester = new GeneralConvexPairTester();\n        }\n\n        ///<summary>\n        /// Updates the manifold.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            //First, refresh all existing contacts.  This is an incremental manifold.\n            ContactRefresher.ContactRefresh(contacts, supplementData, ref collidableA.worldTransform, ref collidableB.worldTransform, contactIndicesToRemove);\n            RemoveQueuedContacts();\n\n\n            //Now, generate a contact between the two shapes.\n            ContactData contact;\n            if (pairTester.GenerateContactCandidate(out contact))\n            {\n\n                if (IsContactUnique(ref contact))\n                {\n                    //Check if adding the new contact would overflow the manifold.\n                    if (contacts.Count == 4)\n                    {\n                        //Adding that contact would overflow the manifold.  Reduce to the best subset.\n                        bool addCandidate;\n                        ContactReducer.ReduceContacts(contacts, ref contact, contactIndicesToRemove, out addCandidate);\n                        RemoveQueuedContacts();\n                        if (addCandidate)\n                            Add(ref contact);\n                    }\n                    else\n                    {\n                        //Won't overflow the manifold, so just toss it in.\n                        Add(ref contact);\n                    }\n                }\n            }\n            else\n            {\n                //No collision, clean out the manifold.\n                for (int i = contacts.Count - 1; i >= 0; i--)\n                {\n                    Remove(i);\n                }\n            }\n\n\n        }\n\n        protected override void Add(ref ContactData contactCandidate)\n        {\n            ContactSupplementData supplement;\n            supplement.BasePenetrationDepth = contactCandidate.PenetrationDepth;\n            //The closest point method computes the local space versions before transforming to world... consider cutting out the middle man\n            RigidTransform.TransformByInverse(ref contactCandidate.Position, ref collidableA.worldTransform, out supplement.LocalOffsetA);\n            RigidTransform.TransformByInverse(ref contactCandidate.Position, ref collidableB.worldTransform, out supplement.LocalOffsetB);\n            supplementData.Add(ref supplement);\n            base.Add(ref contactCandidate);\n        }\n        protected override void Remove(int contactIndex)\n        {\n            supplementData.RemoveAt(contactIndex);\n            base.Remove(contactIndex);\n        }\n\n\n        private bool IsContactUnique(ref ContactData contactCandidate)\n        {\n            contactCandidate.Validate();\n            for (int i = 0; i < contacts.Count; i++)\n            {\n                float distanceSquared;\n                Vector3.DistanceSquared(ref contacts.Elements[i].Position, ref contactCandidate.Position, out distanceSquared);\n                if (distanceSquared < CollisionDetectionSettings.ContactMinimumSeparationDistanceSquared)\n                {\n                    //Update the existing 'redundant' contact with the new information.\n                    //This works out because the new contact is the deepest contact according to the previous collision detection iteration.\n                    contacts.Elements[i].Normal = contactCandidate.Normal;\n                    contacts.Elements[i].Position = contactCandidate.Position;\n                    contacts.Elements[i].PenetrationDepth = contactCandidate.PenetrationDepth;\n                    supplementData.Elements[i].BasePenetrationDepth = contactCandidate.PenetrationDepth;\n                    RigidTransform.TransformByInverse(ref contactCandidate.Position, ref collidableA.worldTransform, out supplementData.Elements[i].LocalOffsetA);\n                    RigidTransform.TransformByInverse(ref contactCandidate.Position, ref collidableB.worldTransform, out supplementData.Elements[i].LocalOffsetB);\n                    return false;\n                }\n            }\n            return true;\n        }\n\n        ///<summary>\n        /// Initializes the manifold.\n        ///</summary>\n        ///<param name=\"newCollidableA\">First collidable.</param>\n        ///<param name=\"newCollidableB\">Second collidable.</param>\n        public override void Initialize(Collidable newCollidableA, Collidable newCollidableB)\n        {\n            collidableA = newCollidableA as ConvexCollidable;\n            collidableB = newCollidableB as ConvexCollidable;\n            pairTester.Initialize(newCollidableA, newCollidableB);\n\n\n            if (collidableA == null || collidableB == null)\n            {\n                throw new ArgumentException(\"Inappropriate types used to initialize pair tester.\");\n            }\n        }\n\n        ///<summary>\n        /// Cleans up the manifold.\n        ///</summary>\n        public override void CleanUp()\n        {\n            supplementData.Clear();\n            collidableA = null;\n            collidableB = null;\n            pairTester.CleanUp();\n            base.CleanUp();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/InstancedMeshContactManifold.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.DataStructures;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a convex and an instanced mesh.\n    ///</summary>\n    public abstract class InstancedMeshContactManifold : TriangleMeshConvexContactManifold\n    {\n        protected InstancedMesh mesh;\n\n        internal RawList<int> overlappedTriangles = new RawList<int>(8);\n\n        ///<summary>\n        /// Gets the mesh of the pair.\n        ///</summary>\n        public InstancedMesh Mesh\n        {\n            get\n            {\n                return mesh;\n            }\n        }\n\n        protected internal override int FindOverlappingTriangles(float dt)\n        {\n            BoundingBox boundingBox;\n            convex.Shape.GetLocalBoundingBox(ref convex.worldTransform, ref mesh.worldTransform, out boundingBox);\n            if (convex.entity != null)\n            {\n                Vector3 transformedVelocity;\n                Matrix3x3 inverse;\n                Matrix3x3.Invert(ref mesh.worldTransform.LinearTransform, out inverse);\n                Matrix3x3.Transform(ref convex.entity.linearVelocity, ref inverse, out transformedVelocity);\n                Vector3.Multiply(ref transformedVelocity, dt, out transformedVelocity);\n\n                if (transformedVelocity.X > 0)\n                    boundingBox.Max.X += transformedVelocity.X;\n                else\n                    boundingBox.Min.X += transformedVelocity.X;\n\n                if (transformedVelocity.Y > 0)\n                    boundingBox.Max.Y += transformedVelocity.Y;\n                else\n                    boundingBox.Min.Y += transformedVelocity.Y;\n\n                if (transformedVelocity.Z > 0)\n                    boundingBox.Max.Z += transformedVelocity.Z;\n                else\n                    boundingBox.Min.Z += transformedVelocity.Z;\n            }\n\n            mesh.Shape.TriangleMesh.Tree.GetOverlaps(boundingBox, overlappedTriangles);\n            return overlappedTriangles.Count;\n        }\n\n        protected override bool ConfigureTriangle(int i, out TriangleIndices indices)\n        {\n            MeshBoundingBoxTreeData data = mesh.Shape.TriangleMesh.Data;\n            int triangleIndex = overlappedTriangles.Elements[i];\n            data.GetTriangle(triangleIndex, out localTriangleShape.vA, out localTriangleShape.vB, out localTriangleShape.vC);\n            AffineTransform.Transform(ref localTriangleShape.vA, ref mesh.worldTransform, out localTriangleShape.vA);\n            AffineTransform.Transform(ref localTriangleShape.vB, ref mesh.worldTransform, out localTriangleShape.vB);\n            AffineTransform.Transform(ref localTriangleShape.vC, ref mesh.worldTransform, out localTriangleShape.vC);\n            //In instanced meshes, the bounding box we found in local space could collect more triangles than strictly necessary.\n            //By doing a second pass, we should be able to prune out quite a few of them.\n            BoundingBox triangleAABB;\n            Toolbox.GetTriangleBoundingBox(ref localTriangleShape.vA, ref localTriangleShape.vB, ref localTriangleShape.vC, out triangleAABB);\n            bool toReturn;\n            triangleAABB.Intersects(ref convex.boundingBox, out toReturn);\n            if (!toReturn)\n            {\n                indices = new TriangleIndices();\n                return false;\n            }\n\n            localTriangleShape.sidedness = mesh.sidedness;\n            localTriangleShape.collisionMargin = 0;\n            indices = new TriangleIndices()\n            {\n                A = data.indices[triangleIndex],\n                B = data.indices[triangleIndex + 1],\n                C = data.indices[triangleIndex + 2]\n            };\n\n            return true;\n        }\n\n        protected internal override void CleanUpOverlappingTriangles()\n        {\n            overlappedTriangles.Clear();\n        }\n\n        protected override bool UseImprovedBoundaryHandling\n        {\n            get { return mesh.improveBoundaryBehavior; }\n        }\n\n\n        ///<summary>\n        /// Cleans up the manifold.\n        ///</summary>\n        public override void CleanUp()\n        {\n            mesh = null;\n            convex = null;\n            base.CleanUp();\n        }\n\n        ///<summary>\n        /// Initializes the manifold.\n        ///</summary>\n        ///<param name=\"newCollidableA\">First collidable.</param>\n        ///<param name=\"newCollidableB\">Second collidable.</param>\n        public override void Initialize(Collidable newCollidableA, Collidable newCollidableB)\n        {\n            convex = newCollidableA as ConvexCollidable;\n            mesh = newCollidableB as InstancedMesh;\n\n\n            if (convex == null || mesh == null)\n            {\n                convex = newCollidableB as ConvexCollidable;\n                mesh = newCollidableA as InstancedMesh;\n                if (convex == null || mesh == null)\n                    throw new ArgumentException(\"Inappropriate types used to initialize contact manifold.\");\n            }\n\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/InstancedMeshConvexContactManifold.cs",
    "content": "﻿using BEPUutilities.ResourceManagement;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a convex and an instanced mesh.\n    ///</summary>\n    public class InstancedMeshConvexContactManifold : InstancedMeshContactManifold\n    {\n\n        UnsafeResourcePool<TriangleConvexPairTester> testerPool = new UnsafeResourcePool<TriangleConvexPairTester>();\n        protected override void GiveBackTester(CollisionAlgorithms.TrianglePairTester tester)\n        {\n            testerPool.GiveBack((TriangleConvexPairTester)tester);\n        }\n\n        protected override CollisionAlgorithms.TrianglePairTester GetTester()\n        {\n            return testerPool.Take();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/InstancedMeshSphereContactManifold.cs",
    "content": "﻿using BEPUutilities.ResourceManagement;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a convex and an instanced mesh.\n    ///</summary>\n    public class InstancedMeshSphereContactManifold : InstancedMeshContactManifold\n    {\n\n        UnsafeResourcePool<TriangleSpherePairTester> testerPool = new UnsafeResourcePool<TriangleSpherePairTester>();\n        protected override void GiveBackTester(CollisionAlgorithms.TrianglePairTester tester)\n        {\n            testerPool.GiveBack((TriangleSpherePairTester)tester);\n        }\n\n        protected override CollisionAlgorithms.TrianglePairTester GetTester()\n        {\n            return testerPool.Take();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/MobileMeshContactManifold.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.DataStructures;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities;\nusing BEPUphysics.CollisionShapes;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a convex and an instanced mesh.\n    ///</summary>\n    public abstract class MobileMeshContactManifold : TriangleMeshConvexContactManifold\n    {\n        protected MobileMeshCollidable mesh;\n        internal int parentContactCount;\n\n        internal RawList<int> overlappedTriangles = new RawList<int>(8);\n\n        ///<summary>\n        /// Gets the mesh of the pair.\n        ///</summary>\n        public MobileMeshCollidable Mesh\n        {\n            get\n            {\n                return mesh;\n            }\n        }\n\n        protected override RigidTransform MeshTransform\n        {\n            get { return mesh.worldTransform; }\n        }\n\n        //Expand the convex's bounding box to include the mobile mesh's movement.\n\n        protected internal override int FindOverlappingTriangles(float dt)\n        {\n            BoundingBox boundingBox;\n            AffineTransform transform = new AffineTransform(mesh.worldTransform.Orientation, mesh.worldTransform.Position);\n            convex.Shape.GetLocalBoundingBox(ref convex.worldTransform, ref transform, out boundingBox);\n            Vector3 transformedVelocity;\n            //Compute the relative velocity with respect to the mesh.  The mesh's bounding tree is NOT expanded with velocity,\n            //so whatever motion there is between the two objects needs to be included in the convex's bounding box.\n\n            if (convex.entity != null)\n                transformedVelocity = convex.entity.linearVelocity;\n            else\n                transformedVelocity = new Vector3();\n            if (mesh.entity != null)\n                Vector3.Subtract(ref transformedVelocity, ref mesh.entity.linearVelocity, out transformedVelocity);\n\n            //The linear transform is known to be orientation only, so using the transpose is allowed.\n            Matrix3x3.TransformTranspose(ref transformedVelocity, ref transform.LinearTransform, out transformedVelocity);\n            Vector3.Multiply(ref transformedVelocity, dt, out transformedVelocity);\n\n            if (transformedVelocity.X > 0)\n                boundingBox.Max.X += transformedVelocity.X;\n            else\n                boundingBox.Min.X += transformedVelocity.X;\n\n            if (transformedVelocity.Y > 0)\n                boundingBox.Max.Y += transformedVelocity.Y;\n            else\n                boundingBox.Min.Y += transformedVelocity.Y;\n\n            if (transformedVelocity.Z > 0)\n                boundingBox.Max.Z += transformedVelocity.Z;\n            else\n                boundingBox.Min.Z += transformedVelocity.Z;\n\n            mesh.Shape.TriangleMesh.Tree.GetOverlaps(boundingBox, overlappedTriangles);\n            return overlappedTriangles.Count;\n        }\n\n        protected override bool ConfigureTriangle(int i, out TriangleIndices indices)\n        {\n            MeshBoundingBoxTreeData data = mesh.Shape.TriangleMesh.Data;\n            int triangleIndex = overlappedTriangles.Elements[i];\n            data.GetTriangle(triangleIndex, out localTriangleShape.vA, out localTriangleShape.vB, out localTriangleShape.vC);\n            AffineTransform transform;\n            AffineTransform.CreateFromRigidTransform(ref mesh.worldTransform, out transform);\n            AffineTransform.Transform(ref localTriangleShape.vA, ref transform, out localTriangleShape.vA);\n            AffineTransform.Transform(ref localTriangleShape.vB, ref transform, out localTriangleShape.vB);\n            AffineTransform.Transform(ref localTriangleShape.vC, ref transform, out localTriangleShape.vC);\n            //In instanced meshes, the bounding box we found in local space could collect more triangles than strictly necessary.\n            //By doing a second pass, we should be able to prune out quite a few of them.\n            BoundingBox triangleAABB;\n            Toolbox.GetTriangleBoundingBox(ref localTriangleShape.vA, ref localTriangleShape.vB, ref localTriangleShape.vC, out triangleAABB);\n            bool toReturn;\n            triangleAABB.Intersects(ref convex.boundingBox, out toReturn);\n            if (!toReturn)\n            {\n                indices = new TriangleIndices();\n                return false;\n            }\n\n            TriangleSidedness sidedness;\n            switch (mesh.Shape.solidity)\n            {\n                case MobileMeshSolidity.Clockwise:\n                    sidedness = TriangleSidedness.Clockwise;\n                    break;\n                case MobileMeshSolidity.Counterclockwise:\n                    sidedness = TriangleSidedness.Counterclockwise;\n                    break;\n                case MobileMeshSolidity.DoubleSided:\n                    sidedness = TriangleSidedness.DoubleSided;\n                    break;\n                default:\n                    sidedness = mesh.Shape.solidSidedness;\n                    break;\n            }\n            localTriangleShape.sidedness = sidedness;\n            localTriangleShape.collisionMargin = 0;\n            indices = new TriangleIndices()\n            {\n                A = data.indices[triangleIndex],\n                B = data.indices[triangleIndex + 1],\n                C = data.indices[triangleIndex + 2]\n            };\n            return true;\n\n        }\n\n        protected internal override void CleanUpOverlappingTriangles()\n        {\n            overlappedTriangles.Clear();\n        }\n\n        protected override bool UseImprovedBoundaryHandling\n        {\n            get { return mesh.improveBoundaryBehavior; }\n        }\n\n        float previousDepth;\n        Vector3 lastValidConvexPosition;\n        protected override void ProcessCandidates(RawValueList<ContactData> candidates)\n        {\n            if (candidates.Count == 0 && parentContactCount == 0 && Mesh.Shape.solidity == MobileMeshSolidity.Solid)\n            {\n\n                //If there's no new contacts on the mesh and it's supposed to be a solid,\n                //then we must check the convex for containment within the shell.\n                //We already know that it's not on the shell, meaning that the shape is either\n                //far enough away outside the shell that there's no contact (and we're done), \n                //or it's far enough inside the shell that the triangles cannot create contacts.\n\n                //To find out which it is, raycast against the shell.\n\n                Matrix3x3 orientation;\n                Matrix3x3.CreateFromQuaternion(ref mesh.worldTransform.Orientation, out orientation);\n\n                Ray ray;\n                Vector3.Subtract(ref convex.worldTransform.Position, ref mesh.worldTransform.Position, out ray.Position);\n                Matrix3x3.TransformTranspose(ref ray.Position, ref orientation, out ray.Position);\n\n                //Cast from the current position back to the previous position.\n                Vector3.Subtract(ref lastValidConvexPosition, ref ray.Position, out ray.Direction);\n                float rayDirectionLength = ray.Direction.LengthSquared();\n                if (rayDirectionLength < Toolbox.Epsilon)\n                {\n                    //The object may not have moved enough to normalize properly.  If so, choose something arbitrary.\n                    //Try the direction from the center of the object to the convex's position.\n                    ray.Direction = ray.Position;\n                    rayDirectionLength = ray.Direction.LengthSquared();\n                    if (rayDirectionLength < Toolbox.Epsilon)\n                    {\n                        //This is unlikely; just pick something completely arbitrary then.\n                        ray.Direction = Vector3.Up;\n                        rayDirectionLength = 1;\n                    }\n                }\n                Vector3.Divide(ref ray.Direction, (float)Math.Sqrt(rayDirectionLength), out ray.Direction);\n\n\n                RayHit hit;\n                if (mesh.Shape.IsLocalRayOriginInMesh(ref ray, out hit))\n                {\n                    ContactData newContact = new ContactData {Id = 2};\n                    //Give it a special id so that we know that it came from the inside.\n                    Matrix3x3.Transform(ref ray.Position, ref orientation, out newContact.Position);\n                    Vector3.Add(ref newContact.Position, ref mesh.worldTransform.Position, out newContact.Position);\n\n                    newContact.Normal = hit.Normal;\n                    newContact.Normal.Normalize();\n\n                    float factor;\n                    Vector3.Dot(ref ray.Direction, ref newContact.Normal, out factor);\n                    newContact.PenetrationDepth = -factor * hit.T + convex.Shape.minimumRadius;\n\n                    Matrix3x3.Transform(ref newContact.Normal, ref orientation, out newContact.Normal);\n\n                    newContact.Validate();\n\n                    //Do not yet create a new contact.  Check to see if an 'inner contact' with id == 2 already exists.\n                    bool addContact = true;\n                    for (int i = 0; i < contacts.Count; i++)\n                    {\n                        if (contacts.Elements[i].Id == 2)\n                        {\n                            contacts.Elements[i].Position = newContact.Position;\n                            contacts.Elements[i].Normal = newContact.Normal;\n                            contacts.Elements[i].PenetrationDepth = newContact.PenetrationDepth;\n                            supplementData.Elements[i].BasePenetrationDepth = newContact.PenetrationDepth;\n                            supplementData.Elements[i].LocalOffsetA = new Vector3();\n                            supplementData.Elements[i].LocalOffsetB = ray.Position; //convex local position in mesh.\n                            addContact = false;\n                            break;\n                        }\n                    }\n                    if (addContact && contacts.Count == 0)\n                        Add(ref newContact);\n                    previousDepth = newContact.PenetrationDepth;\n                }\n                else\n                {\n                    //It's possible that we had a false negative.  The previous frame may have been in deep intersection, and this frame just failed to come to the same conclusion.\n                    //If we set the target location to the current location, the object will never escape the mesh.  Instead, only do that if two frames agree that we are no longer colliding.\n                    if (previousDepth > 0)\n                    {\n                        //We're not touching the mesh.\n                        lastValidConvexPosition = ray.Position;\n                    }\n                    previousDepth = 0;\n\n                }\n            }\n        }\n\n        ///<summary>\n        /// Cleans up the manifold.\n        ///</summary>\n        public override void CleanUp()\n        {\n            mesh = null;\n            convex = null;\n            parentContactCount = 0;\n            base.CleanUp();\n        }\n\n        ///<summary>\n        /// Initializes the manifold.\n        ///</summary>\n        ///<param name=\"newCollidableA\">First collidable.</param>\n        ///<param name=\"newCollidableB\">Second collidable.</param>\n        public override void Initialize(Collidable newCollidableA, Collidable newCollidableB)\n        {\n            convex = newCollidableA as ConvexCollidable;\n            mesh = newCollidableB as MobileMeshCollidable;\n\n\n            if (convex == null || mesh == null)\n            {\n                convex = newCollidableB as ConvexCollidable;\n                mesh = newCollidableA as MobileMeshCollidable;\n                if (convex == null || mesh == null)\n                    throw new ArgumentException(\"Inappropriate types used to initialize contact manifold.\");\n            }\n\n        }\n\n        UnsafeResourcePool<TriangleConvexPairTester> testerPool = new UnsafeResourcePool<TriangleConvexPairTester>();\n        protected override void GiveBackTester(TrianglePairTester tester)\n        {\n            testerPool.GiveBack((TriangleConvexPairTester)tester);\n        }\n\n        protected override TrianglePairTester GetTester()\n        {\n            return testerPool.Take();\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/MobileMeshConvexContactManifold.cs",
    "content": "﻿using BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.ResourceManagement;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a convex and an instanced mesh.\n    ///</summary>\n    public class MobileMeshConvexContactManifold : MobileMeshContactManifold\n    {\n\n        UnsafeResourcePool<TriangleConvexPairTester> testerPool = new UnsafeResourcePool<TriangleConvexPairTester>();\n        protected override void GiveBackTester(TrianglePairTester tester)\n        {\n            testerPool.GiveBack((TriangleConvexPairTester)tester);\n        }\n\n        protected override TrianglePairTester GetTester()\n        {\n            return testerPool.Take();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/MobileMeshSphereContactManifold.cs",
    "content": "﻿using BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.ResourceManagement;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a convex and an instanced mesh.\n    ///</summary>\n    public class MobileMeshSphereContactManifold : MobileMeshContactManifold\n    {\n\n        UnsafeResourcePool<TriangleSpherePairTester> testerPool = new UnsafeResourcePool<TriangleSpherePairTester>();\n        protected override void GiveBackTester(TrianglePairTester tester)\n        {\n            testerPool.GiveBack((TriangleSpherePairTester)tester);\n        }\n\n        protected override TrianglePairTester GetTester()\n        {\n            return testerPool.Take();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/MobileMeshTriangleContactManifold.cs",
    "content": "﻿using BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.ResourceManagement;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a convex and an instanced mesh.\n    ///</summary>\n    public class MobileMeshTriangleContactManifold : MobileMeshContactManifold\n    {\n\n        UnsafeResourcePool<TriangleTrianglePairTester> testerPool = new UnsafeResourcePool<TriangleTrianglePairTester>();\n        protected override void GiveBackTester(TrianglePairTester tester)\n        {\n            testerPool.GiveBack((TriangleTrianglePairTester)tester);\n        }\n\n        protected override TrianglePairTester GetTester()\n        {\n            return testerPool.Take();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/SphereContactManifold.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contact data between two boxes.\n    ///</summary>\n    public class SphereContactManifold : ContactManifold\n    {\n        protected ConvexCollidable<SphereShape> sphereA;\n        protected ConvexCollidable<SphereShape> sphereB;\n\n        ///<summary>\n        /// Gets the first collidable in the pair.\n        ///</summary>\n        public ConvexCollidable<SphereShape> CollidableA\n        {\n            get\n            {\n                return sphereA;\n            }\n        }\n\n        /// <summary>\n        /// Gets the second collidable in the pair.\n        /// </summary>\n        public ConvexCollidable<SphereShape> CollidableB\n        {\n            get\n            {\n                return sphereB;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new manifold.\n        ///</summary>\n        public SphereContactManifold()\n        {\n            contacts = new RawList<Contact>(1);\n        }\n\n        Contact contact = new Contact();\n        bool previouslyColliding;\n\n        ///<summary>\n        /// Updates the manifold.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            ContactData contactData;\n            bool colliding = false;\n            if (SphereTester.AreSpheresColliding(sphereA.Shape, sphereB.Shape, ref sphereA.worldTransform.Position, ref sphereB.worldTransform.Position, out contactData))\n            {\n                if (!previouslyColliding && contactData.PenetrationDepth >= 0) //Don't use the contact if it's an initial contact and the depth is negative.  Why not? Bounciness and InitialCollisionDetected.\n                {\n                    Add(ref contactData);\n                    colliding = true;\n                }\n                else if (previouslyColliding)\n                {\n                    contactData.Validate();\n                    contact.Normal = contactData.Normal;\n                    contact.PenetrationDepth = contactData.PenetrationDepth;\n                    contact.Position = contactData.Position;\n                    colliding = true;\n                }\n            }\n            else\n            {\n                if (previouslyColliding)\n                    Remove(0);\n            }\n            previouslyColliding = colliding;\n        }\n\n        protected override void Add(ref ContactData contactCandidate)\n        {\n            contactCandidate.Validate();\n            contact.Normal = contactCandidate.Normal;\n            contact.PenetrationDepth = contactCandidate.PenetrationDepth;\n            contact.Position = contactCandidate.Position;\n\n            contacts.Add(contact);\n            OnAdded(contact);\n        }\n\n        protected override void Remove(int index)\n        {\n            contacts.RemoveAt(index);\n            OnRemoved(contact);\n        }\n\n\n\n        ///<summary>\n        /// Initializes the manifold.\n        ///</summary>\n        ///<param name=\"newCollidableA\">First collidable.</param>\n        ///<param name=\"newCollidableB\">Second collidable.</param>\n        ///<exception cref=\"Exception\">Thrown when the collidables being used are not of the proper type.</exception>\n        public override void Initialize(Collidable newCollidableA, Collidable newCollidableB)\n        {\n            sphereA = (ConvexCollidable<SphereShape>)newCollidableA;\n            sphereB = (ConvexCollidable<SphereShape>)newCollidableB;\n\n            if (sphereA == null || sphereB == null)\n            {\n                throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n            }\n\n        }\n\n        ///<summary>\n        /// Cleans up the manifold.\n        ///</summary>\n        public override void CleanUp()\n        {\n            sphereA = null;\n            sphereB = null;\n            previouslyColliding = false;\n            //We don't have to worry about losing a reference to our contact- we keep it local!\n            contacts.Clear();\n        }\n\n        /// <summary>\n        /// Clears the contacts associated with this manifold.\n        /// </summary>\n        public override void ClearContacts()\n        {\n            previouslyColliding = false;\n            base.ClearContacts();\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/StaticMeshContactManifold.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a static mesh and a convex.\n    ///</summary>\n    public abstract class StaticMeshContactManifold : TriangleMeshConvexContactManifold\n    {\n\n\n        protected StaticMesh mesh;\n\n        internal RawList<int> overlappedTriangles = new RawList<int>(4);\n\n        ///<summary>\n        /// Gets the static mesh associated with this pair.\n        ///</summary>\n        public StaticMesh Mesh\n        {\n            get\n            {\n                return mesh;\n            }\n        }\n\n        protected internal override int FindOverlappingTriangles(float dt)\n        {\n            mesh.Mesh.Tree.GetOverlaps(convex.boundingBox, overlappedTriangles);\n            return overlappedTriangles.Count;\n        }\n\n        protected override bool ConfigureTriangle(int i, out TriangleIndices indices)\n        {\n            int triangleIndex = overlappedTriangles.Elements[i];\n            mesh.Mesh.Data.GetTriangle(triangleIndex, out localTriangleShape.vA, out localTriangleShape.vB, out localTriangleShape.vC);\n            localTriangleShape.sidedness = mesh.sidedness;\n            localTriangleShape.collisionMargin = 0;\n            indices = new TriangleIndices\n                          {\n                              A = mesh.Mesh.Data.indices[triangleIndex],\n                              B = mesh.Mesh.Data.indices[triangleIndex + 1],\n                              C = mesh.Mesh.Data.indices[triangleIndex + 2]\n                          };\n            return true;\n        }\n\n        protected internal override void CleanUpOverlappingTriangles()\n        {\n            overlappedTriangles.Clear();\n        }\n\n        protected override bool UseImprovedBoundaryHandling\n        {\n            get { return mesh.improveBoundaryBehavior; }\n        }\n\n\n        ///<summary>\n        /// Cleans up the manifold.\n        ///</summary>\n        public override void CleanUp()\n        {\n            mesh = null;\n            convex = null;\n            base.CleanUp();\n        }\n\n        ///<summary>\n        /// Initializes the manifold.\n        ///</summary>\n        ///<param name=\"newCollidableA\">First collidable.</param>\n        ///<param name=\"newCollidableB\">Second collidable.</param>\n        public override void Initialize(Collidable newCollidableA, Collidable newCollidableB)\n        {\n            convex = newCollidableA as ConvexCollidable;\n            mesh = newCollidableB as StaticMesh;\n\n\n            if (convex == null || mesh == null)\n            {\n                convex = newCollidableB as ConvexCollidable;\n                mesh = newCollidableA as StaticMesh;\n                if (convex == null || mesh == null)\n                    throw new ArgumentException(\"Inappropriate types used to initialize contact manifold.\");\n            }\n\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/StaticMeshConvexContactManifold.cs",
    "content": "﻿using BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.ResourceManagement;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a static mesh and a convex.\n    ///</summary>\n    public class StaticMeshConvexContactManifold : StaticMeshContactManifold\n    {\n\n\n        UnsafeResourcePool<TriangleConvexPairTester> testerPool = new UnsafeResourcePool<TriangleConvexPairTester>();\n        protected override void GiveBackTester(CollisionAlgorithms.TrianglePairTester tester)\n        {\n            testerPool.GiveBack((TriangleConvexPairTester)tester);\n        }\n\n        protected override CollisionAlgorithms.TrianglePairTester GetTester()\n        {\n            return testerPool.Take();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/StaticMeshSphereContactManifold.cs",
    "content": "﻿using BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.ResourceManagement;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a static mesh and a convex.\n    ///</summary>\n    public class StaticMeshSphereContactManifold : StaticMeshContactManifold\n    {\n\n\n        UnsafeResourcePool<TriangleSpherePairTester> testerPool = new UnsafeResourcePool<TriangleSpherePairTester>();\n        protected override void GiveBackTester(CollisionAlgorithms.TrianglePairTester tester)\n        {\n            testerPool.GiveBack((TriangleSpherePairTester)tester);\n        }\n\n        protected override CollisionAlgorithms.TrianglePairTester GetTester()\n        {\n            return testerPool.Take();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/TerrainContactManifold.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\nusing BEPUphysics.Settings;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a Terrain and a convex.\n    ///</summary>\n    public abstract class TerrainContactManifold : TriangleMeshConvexContactManifold\n    {\n        protected Terrain terrain;\n\n        internal RawList<TriangleIndices> overlappedTriangles = new RawList<TriangleIndices>(4);\n\n        ///<summary>\n        /// Gets the terrain associated with this pair.\n        ///</summary>\n        public Terrain Terrain\n        {\n            get\n            {\n                return terrain;\n            }\n        }\n\n        protected internal override int FindOverlappingTriangles(float dt)\n        {\n            BoundingBox boundingBox;\n            convex.Shape.GetLocalBoundingBox(ref convex.worldTransform, ref terrain.worldTransform, out boundingBox);\n            \n\n            if (convex.entity != null)\n            {\n                Vector3 transformedVelocity;\n                Matrix3x3 inverse;\n                Matrix3x3.Invert(ref terrain.worldTransform.LinearTransform, out inverse);\n                Matrix3x3.Transform(ref convex.entity.linearVelocity, ref inverse, out transformedVelocity);\n                Vector3.Multiply(ref transformedVelocity, dt, out transformedVelocity);\n\n\n                if (transformedVelocity.X > 0)\n                    boundingBox.Max.X += transformedVelocity.X;\n                else\n                    boundingBox.Min.X += transformedVelocity.X;\n\n                if (transformedVelocity.Y > 0)\n                    boundingBox.Max.Y += transformedVelocity.Y;\n                else\n                    boundingBox.Min.Y += transformedVelocity.Y;\n\n                if (transformedVelocity.Z > 0)\n                    boundingBox.Max.Z += transformedVelocity.Z;\n                else\n                    boundingBox.Min.Z += transformedVelocity.Z;\n            }\n\n\n            terrain.Shape.GetOverlaps(boundingBox, overlappedTriangles);\n            return overlappedTriangles.Count;\n        }\n\n        protected override bool ConfigureTriangle(int i, out TriangleIndices indices)\n        {\n            indices = overlappedTriangles.Elements[i];\n            terrain.Shape.GetTriangle(ref indices, ref terrain.worldTransform, out localTriangleShape.vA, out localTriangleShape.vB, out localTriangleShape.vC);\n            localTriangleShape.collisionMargin = 0;\n\n            //Calibrate the sidedness of the triangle such that it's always facing up.\n            //TODO: There's quite a bit of redundancy in here with other systems.\n\n            Vector3 AB, AC, normal;\n            Vector3.Subtract(ref localTriangleShape.vB, ref localTriangleShape.vA, out AB);\n            Vector3.Subtract(ref localTriangleShape.vC, ref localTriangleShape.vA, out AC);\n            Vector3.Cross(ref AB, ref AC, out normal);\n\n            Vector3 terrainUp = new Vector3(terrain.worldTransform.LinearTransform.M21, terrain.worldTransform.LinearTransform.M22, terrain.worldTransform.LinearTransform.M23);\n            float dot;\n            Vector3.Dot(ref terrainUp, ref normal, out dot);\n            if (dot > 0)\n            {\n                localTriangleShape.sidedness = TriangleSidedness.Clockwise;\n            }\n            else\n            {\n                localTriangleShape.sidedness = TriangleSidedness.Counterclockwise;\n            }\n            //Unlike other 'instanced' geometries, terrains are almost always axis aligned in some way and/or have low triangle density relative to what they are colliding with.\n            //Instead of performing additional tests, just assume that it's a fairly regular situation.\n            return true;\n        }\n\n        protected internal override void CleanUpOverlappingTriangles()\n        {\n            overlappedTriangles.Clear();\n        }\n\n\n        protected override void ProcessCandidates(RawValueList<ContactData> candidates)\n        {\n            //If the candidates list is empty, then let's see if the convex is in the 'thickness' of the terrain.\n            if (candidates.Count == 0 & terrain.thickness > 0)\n            {\n                RayHit rayHit;\n                Ray ray = new Ray { Position = convex.worldTransform.Position, Direction = terrain.worldTransform.LinearTransform.Up };\n                ray.Direction.Normalize();\n                //The raycast has to use doublesidedness, since we're casting from the bottom up.\n                if (terrain.Shape.RayCast(ref ray, terrain.thickness, ref terrain.worldTransform, TriangleSidedness.DoubleSided, out rayHit))\n                {\n                    //Found a hit!\n                    rayHit.Normal.Normalize();\n                    float dot;\n                    Vector3.Dot(ref ray.Direction, ref rayHit.Normal, out dot);\n\n                    var newContact = new ContactData\n                    {\n                        Normal = rayHit.Normal,\n                        Position = convex.worldTransform.Position,\n                        Id = 2,\n                        PenetrationDepth = -rayHit.T * dot + convex.Shape.minimumRadius\n                    };\n                    newContact.Validate();\n                    bool found = false;\n                    for (int i = 0; i < contacts.Count; i++)\n                    {\n                        if (contacts.Elements[i].Id == 2)\n                        {\n                            //As set above, an id of 2 corresponds to a contact created from this raycast process.\n                            contacts.Elements[i].Normal = newContact.Normal;\n                            contacts.Elements[i].Position = newContact.Position;\n                            contacts.Elements[i].PenetrationDepth = newContact.PenetrationDepth;\n                            supplementData.Elements[i].BasePenetrationDepth = newContact.PenetrationDepth;\n                            supplementData.Elements[i].LocalOffsetA = new Vector3();\n                            supplementData.Elements[i].LocalOffsetB = ray.Position; //convex local position in mesh.\n                            found = true;\n                            break;\n                        }\n                    }\n                    if (!found)\n                        candidates.Add(ref newContact);\n                }\n            }\n        }\n\n        protected override bool UseImprovedBoundaryHandling\n        {\n            get { return terrain.improveBoundaryBehavior; }\n        }\n\n\n        ///<summary>\n        /// Cleans up the manifold.\n        ///</summary>\n        public override void CleanUp()\n        {\n            terrain = null;\n            convex = null;\n            base.CleanUp();\n        }\n\n        ///<summary>\n        /// Initializes the manifold.\n        ///</summary>\n        ///<param name=\"newCollidableA\">First collidable.</param>\n        ///<param name=\"newCollidableB\">Second collidable.</param>\n        public override void Initialize(Collidable newCollidableA, Collidable newCollidableB)\n        {\n            convex = newCollidableA as ConvexCollidable;\n            terrain = newCollidableB as Terrain;\n\n\n            if (convex == null || terrain == null)\n            {\n                convex = newCollidableB as ConvexCollidable;\n                terrain = newCollidableA as Terrain;\n                if (convex == null || terrain == null)\n                    throw new ArgumentException(\"Inappropriate types used to initialize contact manifold.\");\n            }\n\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/TerrainConvexContactManifold.cs",
    "content": "﻿using BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.ResourceManagement;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    public class TerrainConvexContactManifold : TerrainContactManifold\n    {\n        UnsafeResourcePool<TriangleConvexPairTester> testerPool = new UnsafeResourcePool<TriangleConvexPairTester>();\n        protected override TrianglePairTester GetTester()\n        {\n            return testerPool.Take();\n        }\n\n        protected override void GiveBackTester(TrianglePairTester tester)\n        {\n            testerPool.GiveBack((TriangleConvexPairTester)tester);\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/TerrainSphereContactManifold.cs",
    "content": "﻿using BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.ResourceManagement;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    public class TerrainSphereContactManifold : TerrainContactManifold\n    {\n        UnsafeResourcePool<TriangleSpherePairTester> testerPool = new UnsafeResourcePool<TriangleSpherePairTester>();\n        protected override TrianglePairTester GetTester()\n        {\n            return testerPool.Take();\n        }\n\n        protected override void GiveBackTester(TrianglePairTester tester)\n        {\n            testerPool.GiveBack((TriangleSpherePairTester)tester);\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/TriangleConvexContactManifold.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.Settings;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contacts between a triangle and convex.\n    ///</summary>\n    public class TriangleConvexContactManifold : ContactManifold\n    {\n        RawValueList<ContactSupplementData> supplementData = new RawValueList<ContactSupplementData>(4);\n        TriangleConvexPairTester pairTester;\n        TriangleShape localTriangleShape = new TriangleShape();\n\n        ///<summary>\n        /// Gets the pair tester used by the manifold.\n        ///</summary>\n        public TriangleConvexPairTester PairTester\n        {\n            get\n            {\n                return pairTester;\n            }\n\n        }\n\n        protected ConvexCollidable convex;\n        protected ConvexCollidable<TriangleShape> triangle;\n\n        ///<summary>\n        /// Gets the convex associated with the pair.\n        ///</summary>\n        public ConvexCollidable Convex\n        {\n            get\n            {\n                return convex;\n            }\n        }\n\n        ///<summary>\n        /// Gets the triangle associated with the pair.\n        ///</summary>\n        public ConvexCollidable<TriangleShape> Triangle\n        {\n            get\n            {\n                return triangle;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new manifold.\n        ///</summary>\n        public TriangleConvexContactManifold()\n        {\n            contacts = new RawList<Contact>(4);\n            unusedContacts = new UnsafeResourcePool<Contact>(4);\n            contactIndicesToRemove = new RawList<int>(4);\n            pairTester = new TriangleConvexPairTester();\n        }\n\n        public override void Update(float dt)\n        {\n            //First, refresh all existing contacts.  This is an incremental manifold.\n            ContactRefresher.ContactRefresh(contacts, supplementData, ref convex.worldTransform, ref triangle.worldTransform, contactIndicesToRemove);\n            RemoveQueuedContacts();\n\n\n            //Compute the local triangle vertices.\n            //TODO: this could be quicker and cleaner.\n            localTriangleShape.collisionMargin = triangle.Shape.collisionMargin;\n            localTriangleShape.sidedness = triangle.Shape.sidedness;\n            Matrix3x3 orientation;\n            Matrix3x3.CreateFromQuaternion(ref triangle.worldTransform.Orientation, out orientation);\n            Matrix3x3.Transform(ref triangle.Shape.vA, ref orientation, out localTriangleShape.vA);\n            Matrix3x3.Transform(ref triangle.Shape.vB, ref orientation, out localTriangleShape.vB);\n            Matrix3x3.Transform(ref triangle.Shape.vC, ref orientation, out localTriangleShape.vC);\n            Vector3.Add(ref localTriangleShape.vA, ref triangle.worldTransform.Position, out localTriangleShape.vA);\n            Vector3.Add(ref localTriangleShape.vB, ref triangle.worldTransform.Position, out localTriangleShape.vB);\n            Vector3.Add(ref localTriangleShape.vC, ref triangle.worldTransform.Position, out localTriangleShape.vC);\n\n            Vector3.Subtract(ref localTriangleShape.vA, ref convex.worldTransform.Position, out localTriangleShape.vA);\n            Vector3.Subtract(ref localTriangleShape.vB, ref convex.worldTransform.Position, out localTriangleShape.vB);\n            Vector3.Subtract(ref localTriangleShape.vC, ref convex.worldTransform.Position, out localTriangleShape.vC);\n            Matrix3x3.CreateFromQuaternion(ref convex.worldTransform.Orientation, out orientation);\n            Matrix3x3.TransformTranspose(ref localTriangleShape.vA, ref orientation, out localTriangleShape.vA);\n            Matrix3x3.TransformTranspose(ref localTriangleShape.vB, ref orientation, out localTriangleShape.vB);\n            Matrix3x3.TransformTranspose(ref localTriangleShape.vC, ref orientation, out localTriangleShape.vC);\n\n            //Now, generate a contact between the two shapes.\n            ContactData contact;\n            TinyStructList<ContactData> contactList;\n            if (pairTester.GenerateContactCandidate(out contactList))\n            {\n                for (int i = 0; i < contactList.Count; i++)\n                {\n                    contactList.Get(i, out contact);\n                    //Put the contact into world space.\n                    Matrix3x3.Transform(ref contact.Position, ref orientation, out contact.Position);\n                    Vector3.Add(ref contact.Position, ref convex.worldTransform.Position, out contact.Position);\n                    Matrix3x3.Transform(ref contact.Normal, ref orientation, out contact.Normal);\n                    //Check if the contact is unique before proceeding.\n                    if (IsContactUnique(ref contact))\n                    {\n                        //Check if adding the new contact would overflow the manifold.\n                        if (contacts.Count == 4)\n                        {\n                            //Adding that contact would overflow the manifold.  Reduce to the best subset.\n                            bool addCandidate;\n                            ContactReducer.ReduceContacts(contacts, ref contact, contactIndicesToRemove, out addCandidate);\n                            RemoveQueuedContacts();\n                            if (addCandidate)\n                                Add(ref contact);\n                        }\n                        else\n                        {\n                            //Won't overflow the manifold, so just toss it in PROVIDED that it isn't too close to something else.\n                            Add(ref contact);\n                        }\n                    }\n                }\n            }\n            else\n            {\n                //Clear out the contacts, it's separated.\n                for (int i = contacts.Count - 1; i >= 0; i--)\n                    Remove(i);\n            }\n\n        }\n\n        protected override void Add(ref ContactData contactCandidate)\n        {\n            ContactSupplementData supplement;\n            supplement.BasePenetrationDepth = contactCandidate.PenetrationDepth;\n            //The closest point method computes the local space versions before transforming to world... consider cutting out the middle man\n            RigidTransform.TransformByInverse(ref contactCandidate.Position, ref convex.worldTransform, out supplement.LocalOffsetA);\n            RigidTransform.TransformByInverse(ref contactCandidate.Position, ref triangle.worldTransform, out supplement.LocalOffsetB);\n            supplementData.Add(ref supplement);\n            base.Add(ref contactCandidate);\n        }\n\n        protected override void Remove(int contactIndex)\n        {\n            supplementData.RemoveAt(contactIndex);\n            base.Remove(contactIndex);\n        }\n\n\n        private bool IsContactUnique(ref ContactData contactCandidate)\n        {\n            contactCandidate.Validate();\n            float distanceSquared;\n            for (int i = 0; i < contacts.Count; i++)\n            {\n                Vector3.DistanceSquared(ref contacts.Elements[i].Position, ref contactCandidate.Position, out distanceSquared);\n                if (distanceSquared < CollisionDetectionSettings.ContactMinimumSeparationDistanceSquared)\n                {\n                    //Update the existing 'redundant' contact with the new information.\n                    //This works out because the new contact is the deepest contact according to the previous collision detection iteration.\n                    contacts.Elements[i].Normal = contactCandidate.Normal;\n                    contacts.Elements[i].Position = contactCandidate.Position;\n                    contacts.Elements[i].PenetrationDepth = contactCandidate.PenetrationDepth;\n                    supplementData.Elements[i].BasePenetrationDepth = contactCandidate.PenetrationDepth;\n                    RigidTransform.TransformByInverse(ref contactCandidate.Position, ref convex.worldTransform, out supplementData.Elements[i].LocalOffsetA);\n                    RigidTransform.TransformByInverse(ref contactCandidate.Position, ref triangle.worldTransform, out supplementData.Elements[i].LocalOffsetB);\n                    return false;\n                }\n            }\n            return true;\n        }\n\n        public override void Initialize(Collidable newCollidableA, Collidable newCollidableB)\n        {\n            convex = newCollidableA as ConvexCollidable;\n            triangle = newCollidableB as ConvexCollidable<TriangleShape>;\n\n\n            if (convex == null || triangle == null)\n            {\n                convex = newCollidableB as ConvexCollidable;\n                triangle = newCollidableA as ConvexCollidable<TriangleShape>;\n                if (convex == null || triangle == null)\n                    throw new ArgumentException(\"Inappropriate types used to initialize contact manifold.\");\n            }\n\n            pairTester.Initialize(convex.Shape, localTriangleShape);\n        }\n\n        public override void CleanUp()\n        {\n            supplementData.Clear();\n            convex = null;\n            triangle = null;\n            pairTester.CleanUp();\n            base.CleanUp();\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/CollisionTests/Manifolds/TriangleMeshConvexContactManifold.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.Settings;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\n\nnamespace BEPUphysics.CollisionTests.Manifolds\n{\n    ///<summary>\n    /// Manages persistent contact data between a triangle mesh and a convex.\n    ///</summary>\n    public abstract class TriangleMeshConvexContactManifold : ContactManifold\n    {\n        protected RawValueList<ContactSupplementData> supplementData = new RawValueList<ContactSupplementData>(4);\n        Dictionary<TriangleIndices, TrianglePairTester> activePairTesters = new Dictionary<TriangleIndices, TrianglePairTester>(8);\n        RawValueList<ContactData> candidatesToAdd;\n        RawValueList<ContactData> reducedCandidates = new RawValueList<ContactData>(4);\n        protected TriangleShape localTriangleShape = new TriangleShape();\n\n        protected abstract TrianglePairTester GetTester();\n\n        protected abstract void GiveBackTester(TrianglePairTester tester);\n\n        HashSet<uint> blockedVertexRegions = new HashSet<uint>();\n        HashSet<Edge> blockedEdgeRegions = new HashSet<Edge>();\n        RawValueList<EdgeContact> edgeContacts = new RawValueList<EdgeContact>(8);\n        RawValueList<VertexContact> vertexContacts = new RawValueList<VertexContact>(8);\n\n        protected ConvexCollidable convex;\n\n        ///<summary>\n        /// Gets the convex collidable associated with this pair.\n        ///</summary>\n        public ConvexCollidable ConvexCollidable\n        {\n            get\n            {\n                return convex;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new contact manifold.\n        ///</summary>\n        protected TriangleMeshConvexContactManifold()\n        {\n            contacts = new RawList<Contact>(4);\n            unusedContacts = new UnsafeResourcePool<Contact>(4);\n            contactIndicesToRemove = new RawList<int>(4);\n            candidatesToAdd = new RawValueList<ContactData>(8);\n        }\n\n        protected virtual RigidTransform MeshTransform\n        {\n            get\n            {\n                return RigidTransform.Identity;\n            }\n        }\n\n\n        protected abstract bool UseImprovedBoundaryHandling { get; }\n        protected internal abstract int FindOverlappingTriangles(float dt);\n        protected abstract bool ConfigureTriangle(int i, out TriangleIndices indices);\n        protected internal abstract void CleanUpOverlappingTriangles();\n\n        ///<summary>\n        /// Updates the manifold.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            //First, refresh all existing contacts.  This is an incremental manifold.\n            var transform = MeshTransform;\n            ContactRefresher.ContactRefresh(contacts, supplementData, ref convex.worldTransform, ref transform, contactIndicesToRemove);\n\n            RemoveQueuedContacts();\n\n\n            CleanUpOverlappingTriangles();\n            //Get all the overlapped triangle indices.\n            int triangleCount = FindOverlappingTriangles(dt);\n\n            Matrix3x3 orientation;\n            Matrix3x3.CreateFromQuaternion(ref convex.worldTransform.Orientation, out orientation);\n            var guaranteedContacts = 0;\n            for (int i = 0; i < triangleCount; i++)\n            {\n                //Initialize the local triangle.\n                TriangleIndices indices;\n                if (ConfigureTriangle(i, out indices))\n                {\n\n                    //Find a pairtester for the triangle.\n                    TrianglePairTester pairTester;\n                    if (!activePairTesters.TryGetValue(indices, out pairTester))\n                    {\n                        pairTester = GetTester();\n                        pairTester.Initialize(convex.Shape, localTriangleShape);\n                        activePairTesters.Add(indices, pairTester);\n                    }\n                    pairTester.Updated = true;\n\n\n                    //Put the triangle into the local space of the convex.\n                    Vector3.Subtract(ref localTriangleShape.vA, ref convex.worldTransform.Position, out localTriangleShape.vA);\n                    Vector3.Subtract(ref localTriangleShape.vB, ref convex.worldTransform.Position, out localTriangleShape.vB);\n                    Vector3.Subtract(ref localTriangleShape.vC, ref convex.worldTransform.Position, out localTriangleShape.vC);\n                    Matrix3x3.TransformTranspose(ref localTriangleShape.vA, ref orientation, out localTriangleShape.vA);\n                    Matrix3x3.TransformTranspose(ref localTriangleShape.vB, ref orientation, out localTriangleShape.vB);\n                    Matrix3x3.TransformTranspose(ref localTriangleShape.vC, ref orientation, out localTriangleShape.vC);\n\n                    //Now, generate a contact between the two shapes.\n                    ContactData contact;\n                    TinyStructList<ContactData> contactList;\n                    if (pairTester.GenerateContactCandidate(out contactList))\n                    {\n                        for (int j = 0; j < contactList.Count; j++)\n                        {\n                            contactList.Get(j, out contact);\n\n\n                            if (UseImprovedBoundaryHandling)\n                            {\n                                if (AnalyzeCandidate(ref indices, pairTester, ref contact))\n                                {\n                                    //This is let through if there's a face contact. Face contacts cannot be blocked.\n                                    guaranteedContacts++;\n                                    AddLocalContact(ref contact, ref orientation);\n                                }\n                            }\n                            else\n                            {\n                                AddLocalContact(ref contact, ref orientation);\n                            }\n\n                        }\n                    }\n\n                    //Get the voronoi region from the contact candidate generation.  Possibly just recalculate, since most of the systems don't calculate it.\n                    //Depending on which voronoi region it is in (Switch on enumeration), identify the indices composing that region.  For face contacts, don't bother- just add it if unique.\n                    //For AB, AC, or BC, add an Edge to the blockedEdgeRegions set with the corresponding indices.\n                    //For A, B, or C, add the index of the vertex to the blockedVertexRegions set.\n                    //If the edge/vertex is already present in the set, then DO NOT add the contact.\n                    //When adding a contact, add ALL other voronoi regions to the blocked sets. \n                }\n\n            }\n\n\n\n            if (UseImprovedBoundaryHandling)\n            {\n\n                //If there were no face contacts that absolutely must be included, we may get into a very rare situation\n                //where absolutely no contacts get created.  For example, a sphere falling directly on top of a vertex in a flat terrain.\n                //It will generally get locked out of usage by belonging only to restricted regions (numerical issues make it visible by both edges and vertices).\n                //In some cases, the contacts will be ignored instead of corrected (e.g. spheres).\n                //To prevent objects from just falling through the ground in such a situation, force-correct the contacts regardless of the pair tester's desires.\n                //Sure, it might not be necessary under normal circumstances, but it's a better option than having no contacts.\n                //TODO: There is another option: Changing restricted regions so that a vertex only restricts the other two vertices and the far edge,\n                //and an edge only restricts the far vertex and other two edges.  This introduces an occasional bump though...\n\n                //It's possible, in very specific instances, for an object to wedge itself between two adjacent triangles.\n                //For this state to continue beyond a brief instant generally requires the object be orientation locked and slender.\n                //However, some characters fit this description, so it can't be ignored!\n\n                //Conceptually, this issue can occur at either a vertex junction or a shared edge (usually on extremely flat surfaces only).\n                //However, an object stuck between multiple triangles is not in a stable state.  In the edge case, the object gets shoved to one side\n                //as one contact 'wins' the solver war.  That's not enough to escape, unfortunately.\n                //The vertex case, on the other hand, is degenerate and decays into an edge case rapidly thanks to this lack of stability.\n                //So, we don't have to explicitly handle the somewhat more annoying and computationally expensive vertex unstucking case, because the edge case handles both! :)\n\n                //This isn't a completely free operation, but it's guarded behind pretty rare conditions.\n                //Essentially, we will check to see if there's just edge contacts fighting against each other.\n                //If they are, then we will correct any stuck-contributing normals to the triangle normal.\n                if (vertexContacts.Count == 0 && guaranteedContacts == 0 && edgeContacts.Count > 1)\n                {\n                    //There are only edge contacts, check to see if:\n                    //all normals are coplanar, and\n                    //at least one normal faces against the other normals (meaning it's probably stuck, as opposed to just colliding on a corner).\n\n                    bool allNormalsInSamePlane = true;\n                    bool atLeastOneNormalAgainst = false;\n\n                    var firstNormal = edgeContacts.Elements[0].ContactData.Normal;\n                    edgeContacts.Elements[0].CorrectedNormal.Normalize();\n                    float dot;\n                    Vector3.Dot(ref firstNormal, ref edgeContacts.Elements[0].CorrectedNormal, out dot);\n                    if (Math.Abs(dot) > .01f)\n                    {\n                        //Go ahead and test the first contact separately, since we're using its contact normal to determine coplanarity.\n                        allNormalsInSamePlane = false;\n                    }\n                    else\n                    {\n                        //TODO: Note that we're only checking the new edge contacts, not the existing contacts.\n                        //It's possible that some existing contacts could interfere and cause issues, but for the sake of simplicity and due to rarity\n                        //we'll ignore that possibility for now.\n                        for (int i = 1; i < edgeContacts.Count; i++)\n                        {\n                            Vector3.Dot(ref edgeContacts.Elements[i].ContactData.Normal, ref firstNormal, out dot);\n                            if (dot < 0)\n                            {\n                                atLeastOneNormalAgainst = true;\n                            }\n                            //Check to see if the normal is outside the plane.\n                            Vector3.Dot(ref edgeContacts.Elements[i].ContactData.Normal, ref edgeContacts.Elements[0].CorrectedNormal, out dot);\n\n                            if (Math.Abs(dot) > .01f)\n                            {\n\n                                //We are not stuck!\n                                allNormalsInSamePlane = false;\n                                break;\n                            }\n                        }\n                    }\n\n                    if (allNormalsInSamePlane && atLeastOneNormalAgainst)\n                    {\n                        //Uh oh! all the normals are parallel... The object is probably in a weird situation.\n                        //Let's correct the normals!\n\n                        //Already normalized the first contact above.\n                        //We don't need to perform the perpendicularity test here- we did that before! We know it's perpendicular already.\n                        edgeContacts.Elements[0].ContactData.Normal = edgeContacts.Elements[0].CorrectedNormal;\n                        edgeContacts.Elements[0].ShouldCorrect = true;\n\n                        for (int i = 1; i < edgeContacts.Count; i++)\n                        {\n                            //Must normalize the corrected normal before using it.\n                            edgeContacts.Elements[i].CorrectedNormal.Normalize();\n                            Vector3.Dot(ref edgeContacts.Elements[i].CorrectedNormal, ref edgeContacts.Elements[i].ContactData.Normal, out dot);\n                            if (dot < .01)\n                            {\n                                //Only bother doing the correction if the normal appears to be pointing nearly horizontally- implying that it's a contributor to the stuckness!\n                                //If it's blocked, the next section will use the corrected normal- if it's not blocked, the next section will use the direct normal.\n                                //Make them the same thing :)\n                                edgeContacts.Elements[i].ContactData.Normal = edgeContacts.Elements[i].CorrectedNormal;\n                                edgeContacts.Elements[i].ShouldCorrect = true;\n                                //Note that the penetration depth is NOT corrected.  The contact's depth no longer represents the true depth.\n                                //However, we only need to have some penetration depth to get the object to escape the rut.\n                                //Furthermore, the depth computed from the horizontal opposing contacts is known to be less than the depth in the perpendicular direction.\n                                //If the current depth was NOT less than the true depth along the corrected normal, then the collision detection system \n                                //would have picked a different depth, as it finds a reasonable approximation of the minimum penetration!\n                                //As a consequence, this contact will not be active beyond the object's destuckification, because its contact depth will be negative (or very close to it).\n\n                            }\n                        }\n                    }\n                }\n\n\n              \n\n\n                for (int i = 0; i < edgeContacts.Count; i++)\n                {\n                    //Only correct if it's allowed AND it's blocked.\n                    //If it's not blocked, the contact being created is necessary!\n                    //The normal generated by the triangle-convex tester is already known not to\n                    //violate the triangle sidedness.\n                    if (!blockedEdgeRegions.Contains(edgeContacts.Elements[i].Edge))\n                    {\n                        //If it's not blocked, use the contact as-is without correcting it.\n                        AddLocalContact(ref edgeContacts.Elements[i].ContactData, ref orientation);\n\n                    }\n                    else if (edgeContacts.Elements[i].ShouldCorrect || guaranteedContacts == 0)\n                    {\n                        //If it is blocked, we can still make use of the contact.  But first, we need to change the contact normal to ensure that\n                        //it will not interfere (and cause a bump or something).\n                        float dot;\n                        edgeContacts.Elements[i].CorrectedNormal.Normalize();\n                        Vector3.Dot(ref edgeContacts.Elements[i].CorrectedNormal, ref edgeContacts.Elements[i].ContactData.Normal, out dot);\n                        edgeContacts.Elements[i].ContactData.Normal = edgeContacts.Elements[i].CorrectedNormal;\n                        edgeContacts.Elements[i].ContactData.PenetrationDepth *= MathHelper.Max(0, dot); //Never cause a negative penetration depth.\n                        AddLocalContact(ref edgeContacts.Elements[i].ContactData, ref orientation);\n                    }\n                    //If it's blocked AND it doesn't allow correction, ignore its existence.\n\n\n\n                }\n\n\n\n\n                for (int i = 0; i < vertexContacts.Count; i++)\n                {\n\n                    if (!blockedVertexRegions.Contains(vertexContacts.Elements[i].Vertex))\n                    {\n                        //If it's not blocked, use the contact as-is without correcting it.\n                        AddLocalContact(ref vertexContacts.Elements[i].ContactData, ref orientation);\n                    }\n                    else if (vertexContacts.Elements[i].ShouldCorrect || guaranteedContacts == 0)\n                    {\n                        //If it is blocked, we can still make use of the contact.  But first, we need to change the contact normal to ensure that\n                        //it will not interfere (and cause a bump or something).\n                        float dot;\n                        vertexContacts.Elements[i].CorrectedNormal.Normalize();\n                        Vector3.Dot(ref vertexContacts.Elements[i].CorrectedNormal, ref vertexContacts.Elements[i].ContactData.Normal, out dot);\n                        vertexContacts.Elements[i].ContactData.Normal = vertexContacts.Elements[i].CorrectedNormal;\n                        vertexContacts.Elements[i].ContactData.PenetrationDepth *= MathHelper.Max(0, dot); //Never cause a negative penetration depth.\n                        AddLocalContact(ref vertexContacts.Elements[i].ContactData, ref orientation);\n                    }\n                    //If it's blocked AND it doesn't allow correction, ignore its existence.\n\n\n                }\n\n\n\n                blockedEdgeRegions.Clear();\n                blockedVertexRegions.Clear();\n                vertexContacts.Clear();\n                edgeContacts.Clear();\n\n\n            }\n\n\n\n            //Remove stale pair testers.\n            //This will only remove 8 stale ones per frame, but it doesn't really matter.\n            //VERY rarely will there be more than 8 in a single frame, and they will be immediately taken care of in the subsequent frame.\n            var toRemove = new TinyList<TriangleIndices>();\n            foreach (KeyValuePair<TriangleIndices, TrianglePairTester> pair in activePairTesters)\n            {\n                if (!pair.Value.Updated)\n                {\n                    if (!toRemove.Add(pair.Key))\n                        break;\n                }\n                else\n                    pair.Value.Updated = false;\n            }\n\n\n\n            for (int i = toRemove.Count - 1; i >= 0; i--)\n            {\n                var pairTester = activePairTesters[toRemove[i]];\n                pairTester.CleanUp();\n                GiveBackTester(pairTester);\n                activePairTesters.Remove(toRemove[i]);\n            }\n\n\n            //Some child types will want to do some extra post processing on the manifold.        \n            ProcessCandidates(candidatesToAdd);\n\n\n            //Check if adding the new contacts would overflow the manifold.\n            if (contacts.Count + candidatesToAdd.Count > 4)\n            {\n                //Adding all the contacts would overflow the manifold.  Reduce to the best subset.\n                ContactReducer.ReduceContacts(contacts, candidatesToAdd, contactIndicesToRemove, reducedCandidates);\n                RemoveQueuedContacts();\n                for (int i = reducedCandidates.Count - 1; i >= 0; i--)\n                {\n                    Add(ref reducedCandidates.Elements[i]);\n                    reducedCandidates.RemoveAt(i);\n                }\n            }\n            else if (candidatesToAdd.Count > 0)\n            {\n                //Won't overflow the manifold, so just toss it in PROVIDED that it isn't too close to something else.\n                for (int i = 0; i < candidatesToAdd.Count; i++)\n                {\n                    Add(ref candidatesToAdd.Elements[i]);\n                }\n            }\n\n\n\n            candidatesToAdd.Clear();\n\n        }\n\n        void AddLocalContact(ref ContactData contact, ref Matrix3x3 orientation)\n        {\n            //Put the contact into world space.\n            Matrix3x3.Transform(ref contact.Position, ref orientation, out contact.Position);\n            Vector3.Add(ref contact.Position, ref convex.worldTransform.Position, out contact.Position);\n            Matrix3x3.Transform(ref contact.Normal, ref orientation, out contact.Normal);\n            //Check to see if the contact is unique before proceeding.\n            if (IsContactUnique(ref contact))\n            {\n                candidatesToAdd.Add(ref contact);\n            }\n        }\n\n\n        protected void GetNormal(ref Vector3 uncorrectedNormal, out Vector3 normal)\n        {\n            //Compute the normal of the triangle in the current convex's local space.\n            //Note its reliance on the local triangle shape.  It must be initialized to the correct values before this is called.\n            Vector3 AB, AC;\n            Vector3.Subtract(ref localTriangleShape.vB, ref localTriangleShape.vA, out AB);\n            Vector3.Subtract(ref localTriangleShape.vC, ref localTriangleShape.vA, out AC);\n            //Compute the normal based on the sidedness.\n            switch (localTriangleShape.sidedness)\n            {\n                case TriangleSidedness.DoubleSided:\n                    //If it's double sided, then pick the triangle normal which points in the same direction\n                    //as the contact normal that's going to be corrected.\n                    float dot;\n                    Vector3.Cross(ref AB, ref AC, out normal);\n                    Vector3.Dot(ref normal, ref uncorrectedNormal, out dot);\n                    if (dot < 0)\n                        Vector3.Negate(ref normal, out normal);\n                    break;\n                case TriangleSidedness.Clockwise:\n                    //If it's clockwise, always use ACxAB.\n                    Vector3.Cross(ref AC, ref AB, out normal);\n                    break;\n                default:\n                    //If it's counterclockwise, always use ABxAC.\n                    Vector3.Cross(ref AB, ref AC, out normal);\n                    break;\n            }\n            //If the normal is degenerate, just use the uncorrected normal.\n            if (normal.LengthSquared() < Toolbox.Epsilon)\n                normal = uncorrectedNormal;\n        }\n\n        bool AnalyzeCandidate(ref TriangleIndices indices, TrianglePairTester pairTester, ref ContactData contact)\n        {\n            switch (pairTester.GetRegion(ref contact))\n            {\n                case VoronoiRegion.A:\n                    //Add the contact.\n                    VertexContact vertexContact;\n                    GetNormal(ref contact.Normal, out vertexContact.CorrectedNormal);\n                    vertexContact.ContactData = contact;\n                    vertexContact.Vertex = indices.A;\n                    vertexContact.ShouldCorrect = pairTester.ShouldCorrectContactNormal;\n                    vertexContacts.Add(ref vertexContact);\n\n                    //Block all of the other voronoi regions.\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.B));\n                    blockedEdgeRegions.Add(new Edge(indices.B, indices.C));\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.C));\n                    blockedVertexRegions.Add(indices.B);\n                    blockedVertexRegions.Add(indices.C);\n\n                    break;\n                case VoronoiRegion.B:\n                    //Add the contact.\n                    GetNormal(ref contact.Normal, out vertexContact.CorrectedNormal);\n                    vertexContact.ContactData = contact;\n                    vertexContact.Vertex = indices.B;\n                    vertexContact.ShouldCorrect = pairTester.ShouldCorrectContactNormal;\n                    vertexContacts.Add(ref vertexContact);\n\n                    //Block all of the other voronoi regions.\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.B));\n                    blockedEdgeRegions.Add(new Edge(indices.B, indices.C));\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.C));\n                    blockedVertexRegions.Add(indices.A);\n                    blockedVertexRegions.Add(indices.C);\n\n                    break;\n                case VoronoiRegion.C:\n                    //Add the contact.\n                    GetNormal(ref contact.Normal, out vertexContact.CorrectedNormal);\n                    vertexContact.ContactData = contact;\n                    vertexContact.Vertex = indices.C;\n                    vertexContact.ShouldCorrect = pairTester.ShouldCorrectContactNormal;\n                    vertexContacts.Add(ref vertexContact);\n\n                    //Block all of the other voronoi regions.\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.B));\n                    blockedEdgeRegions.Add(new Edge(indices.B, indices.C));\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.C));\n                    blockedVertexRegions.Add(indices.A);\n                    blockedVertexRegions.Add(indices.B);\n\n                    break;\n                case VoronoiRegion.AB:\n                    //Add the contact.\n                    EdgeContact edgeContact;\n                    GetNormal(ref contact.Normal, out edgeContact.CorrectedNormal);\n                    edgeContact.Edge = new Edge(indices.A, indices.B);\n                    edgeContact.ContactData = contact;\n                    edgeContact.ShouldCorrect = pairTester.ShouldCorrectContactNormal;\n                    edgeContacts.Add(ref edgeContact);\n\n                    //Block all of the other voronoi regions.\n                    blockedEdgeRegions.Add(new Edge(indices.B, indices.C));\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.C));\n                    blockedVertexRegions.Add(indices.A);\n                    blockedVertexRegions.Add(indices.B);\n                    blockedVertexRegions.Add(indices.C);\n                    break;\n                case VoronoiRegion.AC:\n                    //Add the contact.\n                    GetNormal(ref contact.Normal, out edgeContact.CorrectedNormal);\n                    edgeContact.Edge = new Edge(indices.A, indices.C);\n                    edgeContact.ContactData = contact;\n                    edgeContact.ShouldCorrect = pairTester.ShouldCorrectContactNormal;\n                    edgeContacts.Add(ref edgeContact);\n\n                    //Block all of the other voronoi regions.\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.B));\n                    blockedEdgeRegions.Add(new Edge(indices.B, indices.C));\n                    blockedVertexRegions.Add(indices.A);\n                    blockedVertexRegions.Add(indices.B);\n                    blockedVertexRegions.Add(indices.C);\n                    break;\n                case VoronoiRegion.BC:\n                    //Add the contact.\n                    GetNormal(ref contact.Normal, out edgeContact.CorrectedNormal);\n                    edgeContact.Edge = new Edge(indices.B, indices.C);\n                    edgeContact.ContactData = contact;\n                    edgeContact.ShouldCorrect = pairTester.ShouldCorrectContactNormal;\n                    edgeContacts.Add(ref edgeContact);\n\n                    //Block all of the other voronoi regions.\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.B));\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.C));\n                    blockedVertexRegions.Add(indices.A);\n                    blockedVertexRegions.Add(indices.B);\n                    blockedVertexRegions.Add(indices.C);\n                    break;\n                default:\n                    //Block all of the other voronoi regions.\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.B));\n                    blockedEdgeRegions.Add(new Edge(indices.B, indices.C));\n                    blockedEdgeRegions.Add(new Edge(indices.A, indices.C));\n                    blockedVertexRegions.Add(indices.A);\n                    blockedVertexRegions.Add(indices.B);\n                    blockedVertexRegions.Add(indices.C);\n                    //Should add the contact.\n                    return true;\n            }\n\n\n            return false;\n        }\n\n        protected override void Add(ref ContactData contactCandidate)\n        {\n            ContactSupplementData supplement;\n            supplement.BasePenetrationDepth = contactCandidate.PenetrationDepth;\n            //The closest point method computes the local space versions before transforming to world... consider cutting out the middle man\n            RigidTransform.TransformByInverse(ref contactCandidate.Position, ref convex.worldTransform, out supplement.LocalOffsetA);\n            RigidTransform transform = MeshTransform;\n            RigidTransform.TransformByInverse(ref contactCandidate.Position, ref transform, out supplement.LocalOffsetB);\n            supplementData.Add(ref supplement);\n            base.Add(ref contactCandidate);\n        }\n\n        protected override void Remove(int contactIndex)\n        {\n            supplementData.RemoveAt(contactIndex);\n            base.Remove(contactIndex);\n        }\n\n\n        private bool IsContactUnique(ref ContactData contactCandidate)\n        {\n            contactCandidate.Validate();\n            float distanceSquared;\n            RigidTransform meshTransform = MeshTransform;\n            for (int i = 0; i < contacts.Count; i++)\n            {\n                Vector3.DistanceSquared(ref contacts.Elements[i].Position, ref contactCandidate.Position, out distanceSquared);\n                if (distanceSquared < CollisionDetectionSettings.ContactMinimumSeparationDistanceSquared)\n                {\n                    //This is a nonconvex manifold.  There will be times where a an object will be shoved into a corner such that\n                    //a single position will have two reasonable normals.  If the normals aren't mostly aligned, they should NOT be considered equivalent.\n                    Vector3.Dot(ref contacts.Elements[i].Normal, ref contactCandidate.Normal, out distanceSquared);\n                    if (Math.Abs(distanceSquared) >= CollisionDetectionSettings.nonconvexNormalDotMinimum)\n                    {\n                        //Update the existing 'redundant' contact with the new information.\n                        //This works out because the new contact is the deepest contact according to the previous collision detection iteration.\n                        contacts.Elements[i].Normal = contactCandidate.Normal;\n                        contacts.Elements[i].Position = contactCandidate.Position;\n                        contacts.Elements[i].PenetrationDepth = contactCandidate.PenetrationDepth;\n                        supplementData.Elements[i].BasePenetrationDepth = contactCandidate.PenetrationDepth;\n                        RigidTransform.TransformByInverse(ref contactCandidate.Position, ref convex.worldTransform, out supplementData.Elements[i].LocalOffsetA);\n                        RigidTransform.TransformByInverse(ref contactCandidate.Position, ref meshTransform, out supplementData.Elements[i].LocalOffsetB);\n                        return false;\n                    }\n                }\n            }\n            for (int i = 0; i < candidatesToAdd.Count; i++)\n            {\n                Vector3.DistanceSquared(ref candidatesToAdd.Elements[i].Position, ref contactCandidate.Position, out distanceSquared);\n                if (distanceSquared < CollisionDetectionSettings.ContactMinimumSeparationDistanceSquared)\n                {\n                    //This is a nonconvex manifold.  There will be times where a an object will be shoved into a corner such that\n                    //a single position will have two reasonable normals.  If the normals aren't mostly aligned, they should NOT be considered equivalent.\n                    Vector3.Dot(ref candidatesToAdd.Elements[i].Normal, ref contactCandidate.Normal, out distanceSquared);\n                    if (Math.Abs(distanceSquared) >= CollisionDetectionSettings.nonconvexNormalDotMinimum)\n                        return false;\n                }\n            }\n            //for (int i = 0; i < edgeContacts.count; i++)\n            //{\n            //    Vector3.DistanceSquared(ref edgeContacts.Elements[i].ContactData.Position, ref contactCandidate.Position, out distanceSquared);\n            //    if (distanceSquared < CollisionDetectionSettings.ContactMinimumSeparationDistanceSquared)\n            //    {\n            //        return false;\n            //    }\n            //}\n            //for (int i = 0; i < vertexContacts.count; i++)\n            //{\n            //    Vector3.DistanceSquared(ref vertexContacts.Elements[i].ContactData.Position, ref contactCandidate.Position, out distanceSquared);\n            //    if (distanceSquared < CollisionDetectionSettings.ContactMinimumSeparationDistanceSquared)\n            //    {\n            //        return false;\n            //    }\n            //}\n            return true;\n\n        }\n\n        protected virtual void ProcessCandidates(RawValueList<ContactData> candidates)\n        {\n\n        }\n\n\n        ///<summary>\n        /// Cleans up the manifold.\n        ///</summary>\n        public override void CleanUp()\n        {\n            supplementData.Clear();\n            convex = null;\n            foreach (KeyValuePair<TriangleIndices, TrianglePairTester> pair in activePairTesters)\n            {\n                pair.Value.CleanUp();\n                GiveBackTester(pair.Value);\n            }\n            activePairTesters.Clear();\n            CleanUpOverlappingTriangles();\n            base.CleanUp();\n        }\n\n        /// <summary>\n        /// Edge of a triangle in a mesh in terms of vertex indices.\n        /// </summary>\n        public struct Edge : IEquatable<Edge>\n        {\n            private uint A;\n            private uint B;\n\n            public Edge(uint a, uint b)\n            {\n                A = a;\n                B = b;\n            }\n\n            public override int GetHashCode()\n            {\n                return (int)A + (int)B;\n            }\n\n            public bool Equals(Edge edge)\n            {\n                return (edge.A == A && edge.B == B) || (edge.A == B && edge.B == A);\n            }\n        }\n\n        ///<summary>\n        /// Stores indices of a triangle.\n        ///</summary>\n        public struct TriangleIndices : IEquatable<TriangleIndices>\n        {\n            ///<summary>\n            /// First index in the triangle.\n            ///</summary>\n            public uint A;\n            ///<summary>\n            /// Second index in the triangle.\n            ///</summary>\n            public uint B;\n            ///<summary>\n            /// Third index in the triangle.\n            ///</summary>\n            public uint C;\n\n            /// <summary>\n            /// Returns the hash code for this instance.\n            /// </summary>\n            /// <returns>\n            /// A 32-bit signed integer that is the hash code for this instance.\n            /// </returns>\n            /// <filterpriority>2</filterpriority>\n            public override int GetHashCode()\n            {\n                return (int)A + (int)B + (int)C;\n            }\n\n            /// <summary>\n            /// Indicates whether the current object is equal to another object of the same type.\n            /// </summary>\n            /// <returns>\n            /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n            /// </returns>\n            /// <param name=\"other\">An object to compare with this object.</param>\n            public bool Equals(TriangleIndices other)\n            {\n                return A == other.A && B == other.B && C == other.C;\n            }\n        }\n\n        struct EdgeContact\n        {\n            public bool ShouldCorrect;\n            public Vector3 CorrectedNormal;\n            public Edge Edge;\n            public ContactData ContactData;\n        }\n\n        struct VertexContact\n        {\n            public bool ShouldCorrect;\n            public Vector3 CorrectedNormal;\n            public uint Vertex;\n            public ContactData ContactData;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/ContactFrictionConstraint.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Settings;\n\nnamespace BEPUphysics.Constraints.Collision\n{\n    /// <summary>\n    /// Computes the friction force for a contact when central friction cannot be used.\n    /// </summary>\n    public class ContactFrictionConstraint : EntitySolverUpdateable\n    {\n        private ContactManifoldConstraint contactManifoldConstraint;\n        ///<summary>\n        /// Gets the manifold constraint associated with this friction constraint.\n        ///</summary>\n        public ContactManifoldConstraint ContactManifoldConstraint\n        {\n            get\n            {\n                return contactManifoldConstraint;\n            }\n        }\n        private ContactPenetrationConstraint penetrationConstraint;\n        ///<summary>\n        /// Gets the penetration constraint associated with this friction constraint.\n        ///</summary>\n        public ContactPenetrationConstraint PenetrationConstraint\n        {\n            get\n            {\n                return penetrationConstraint;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new friction constraint.\n        ///</summary>\n        public ContactFrictionConstraint()\n        {\n            isActive = false;\n        }\n\n        internal float accumulatedImpulse;\n        //float linearBX, linearBY, linearBZ;\n        private float angularAX, angularAY, angularAZ;\n        private float angularBX, angularBY, angularBZ;\n\n        //Inverse effective mass matrix\n\n\n        private float friction;\n        internal float linearAX, linearAY, linearAZ;\n        private Entity entityA, entityB;\n        private bool entityAIsDynamic, entityBIsDynamic;\n        private float velocityToImpulse;\n\n\n        ///<summary>\n        /// Configures the friction constraint for a new contact.\n        ///</summary>\n        ///<param name=\"contactManifoldConstraint\">Manifold to which the constraint belongs.</param>\n        ///<param name=\"penetrationConstraint\">Penetration constraint associated with this friction constraint.</param>\n        public void Setup(ContactManifoldConstraint contactManifoldConstraint, ContactPenetrationConstraint penetrationConstraint)\n        {\n            this.contactManifoldConstraint = contactManifoldConstraint;\n            this.penetrationConstraint = penetrationConstraint;\n            IsActive = true;\n            linearAX = 0;\n            linearAY = 0;\n            linearAZ = 0;\n\n            entityA = contactManifoldConstraint.EntityA;\n            entityB = contactManifoldConstraint.EntityB;\n        }\n\n        ///<summary>\n        /// Cleans upt he friction constraint.\n        ///</summary>\n        public void CleanUp()\n        {\n            accumulatedImpulse = 0;\n            contactManifoldConstraint = null;\n            penetrationConstraint = null;\n            entityA = null;\n            entityB = null;\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Gets the direction in which the friction force acts.\n        /// </summary>\n        public Vector3 FrictionDirection\n        {\n            get { return new Vector3(linearAX, linearAY, linearAZ); }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this friction constraint in the last time step.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        ///<summary>\n        /// Gets the relative velocity of the constraint.  This is the velocity along the tangent movement direction.\n        ///</summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float velocity = 0;\n                if (entityA != null)\n                    velocity += entityA.linearVelocity.X * linearAX + entityA.linearVelocity.Y * linearAY + entityA.linearVelocity.Z * linearAZ +\n                                entityA.angularVelocity.X * angularAX + entityA.angularVelocity.Y * angularAY + entityA.angularVelocity.Z * angularAZ;\n                if (entityB != null)\n                    velocity += -entityB.linearVelocity.X * linearAX - entityB.linearVelocity.Y * linearAY - entityB.linearVelocity.Z * linearAZ +\n                                entityB.angularVelocity.X * angularBX + entityB.angularVelocity.Y * angularBY + entityB.angularVelocity.Z * angularBZ;\n                return velocity;\n            }\n        }\n\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n            //Compute relative velocity and convert to impulse\n            float lambda = RelativeVelocity * velocityToImpulse;\n\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            float maxForce = friction * penetrationConstraint.accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse + lambda, -maxForce, maxForce);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = lambda * linearAX;\n            linear.Y = lambda * linearAY;\n            linear.Z = lambda * linearAZ;\n            if (entityAIsDynamic)\n            {\n                angular.X = lambda * angularAX;\n                angular.Y = lambda * angularAY;\n                angular.Z = lambda * angularAZ;\n                entityA.ApplyLinearImpulse(ref linear);\n                entityA.ApplyAngularImpulse(ref angular);\n            }\n            if (entityBIsDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = lambda * angularBX;\n                angular.Y = lambda * angularBY;\n                angular.Z = lambda * angularBZ;\n                entityB.ApplyLinearImpulse(ref linear);\n                entityB.ApplyAngularImpulse(ref angular);\n            }\n\n            return Math.Abs(lambda);\n        }\n\n        /// <summary>\n        /// Initializes the constraint for this frame.\n        /// </summary>\n        /// <param name=\"dt\">Time since the last frame.</param>\n        public override void Update(float dt)\n        {\n\n\n            entityAIsDynamic = entityA != null && entityA.isDynamic;\n            entityBIsDynamic = entityB != null && entityB.isDynamic;\n\n            //Compute the three dimensional relative velocity at the point.\n\n            Vector3 velocityA = new Vector3(), velocityB = new Vector3();\n            Vector3 ra = penetrationConstraint.ra, rb = penetrationConstraint.rb;\n            if (entityA != null)\n            {\n                Vector3.Cross(ref entityA.angularVelocity, ref ra, out velocityA);\n                Vector3.Add(ref velocityA, ref entityA.linearVelocity, out velocityA);\n            }\n            if (entityB != null)\n            {\n                Vector3.Cross(ref entityB.angularVelocity, ref rb, out velocityB);\n                Vector3.Add(ref velocityB, ref entityB.linearVelocity, out velocityB);\n            }\n            Vector3 relativeVelocity;\n            Vector3.Subtract(ref velocityA, ref velocityB, out relativeVelocity);\n\n            //Get rid of the normal velocity.\n            Vector3 normal = penetrationConstraint.contact.Normal;\n            float normalVelocityScalar = normal.X * relativeVelocity.X + normal.Y * relativeVelocity.Y + normal.Z * relativeVelocity.Z;\n            relativeVelocity.X -= normalVelocityScalar * normal.X;\n            relativeVelocity.Y -= normalVelocityScalar * normal.Y;\n            relativeVelocity.Z -= normalVelocityScalar * normal.Z;\n\n            //Create the jacobian entry and decide the friction coefficient.\n            float length = relativeVelocity.LengthSquared();\n            if (length > Toolbox.Epsilon)\n            {\n                length = (float)Math.Sqrt(length);\n                linearAX = relativeVelocity.X / length;\n                linearAY = relativeVelocity.Y / length;\n                linearAZ = relativeVelocity.Z / length;\n\n                friction = length > CollisionResponseSettings.StaticFrictionVelocityThreshold\n                               ? contactManifoldConstraint.materialInteraction.KineticFriction\n                               : contactManifoldConstraint.materialInteraction.StaticFriction;\n            }\n            else\n            {\n                //If there's no velocity, there's no jacobian.  Give up.\n                //This is 'fast' in that it will early out on essentially resting objects,\n                //but it may introduce instability.\n                //If it doesn't look good, try the next approach.\n                //isActive = false;\n                //return;\n\n                //if the above doesn't work well, try using the previous frame's jacobian.\n                if (linearAX != 0 || linearAY != 0 || linearAZ != 0)\n                {\n                    friction = contactManifoldConstraint.materialInteraction.StaticFriction;\n                }\n                else\n                {\n                    //Can't really do anything here, give up.\n                    isActiveInSolver = false;\n                    return;\n                    //Could also cross the up with normal to get a random direction.  Questionable value.\n                }\n            }\n\n\n            //angular A = Ra x N\n            angularAX = (ra.Y * linearAZ) - (ra.Z * linearAY);\n            angularAY = (ra.Z * linearAX) - (ra.X * linearAZ);\n            angularAZ = (ra.X * linearAY) - (ra.Y * linearAX);\n\n            //Angular B = N x Rb\n            angularBX = (linearAY * rb.Z) - (linearAZ * rb.Y);\n            angularBY = (linearAZ * rb.X) - (linearAX * rb.Z);\n            angularBZ = (linearAX * rb.Y) - (linearAY * rb.X);\n\n            //Compute inverse effective mass matrix\n            float entryA, entryB;\n\n            //these are the transformed coordinates\n            float tX, tY, tZ;\n            if (entityAIsDynamic)\n            {\n                tX = angularAX * entityA.inertiaTensorInverse.M11 + angularAY * entityA.inertiaTensorInverse.M21 + angularAZ * entityA.inertiaTensorInverse.M31;\n                tY = angularAX * entityA.inertiaTensorInverse.M12 + angularAY * entityA.inertiaTensorInverse.M22 + angularAZ * entityA.inertiaTensorInverse.M32;\n                tZ = angularAX * entityA.inertiaTensorInverse.M13 + angularAY * entityA.inertiaTensorInverse.M23 + angularAZ * entityA.inertiaTensorInverse.M33;\n                entryA = tX * angularAX + tY * angularAY + tZ * angularAZ + entityA.inverseMass;\n            }\n            else\n                entryA = 0;\n\n            if (entityBIsDynamic)\n            {\n                tX = angularBX * entityB.inertiaTensorInverse.M11 + angularBY * entityB.inertiaTensorInverse.M21 + angularBZ * entityB.inertiaTensorInverse.M31;\n                tY = angularBX * entityB.inertiaTensorInverse.M12 + angularBY * entityB.inertiaTensorInverse.M22 + angularBZ * entityB.inertiaTensorInverse.M32;\n                tZ = angularBX * entityB.inertiaTensorInverse.M13 + angularBY * entityB.inertiaTensorInverse.M23 + angularBZ * entityB.inertiaTensorInverse.M33;\n                entryB = tX * angularBX + tY * angularBY + tZ * angularBZ + entityB.inverseMass;\n            }\n            else\n                entryB = 0;\n\n            velocityToImpulse = -1 / (entryA + entryB); //Softness?\n\n\n\n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Warm starting\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = accumulatedImpulse * linearAX;\n            linear.Y = accumulatedImpulse * linearAY;\n            linear.Z = accumulatedImpulse * linearAZ;\n            if (entityAIsDynamic)\n            {\n                angular.X = accumulatedImpulse * angularAX;\n                angular.Y = accumulatedImpulse * angularAY;\n                angular.Z = accumulatedImpulse * angularAZ;\n                entityA.ApplyLinearImpulse(ref linear);\n                entityA.ApplyAngularImpulse(ref angular);\n            }\n            if (entityBIsDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = accumulatedImpulse * angularBX;\n                angular.Y = accumulatedImpulse * angularBY;\n                angular.Z = accumulatedImpulse * angularBZ;\n                entityB.ApplyLinearImpulse(ref linear);\n                entityB.ApplyAngularImpulse(ref angular);\n            }\n        }\n\n        protected internal override void CollectInvolvedEntities(RawList<Entity> outputInvolvedEntities)\n        {\n            //This should never really have to be called.\n            if (entityA != null)\n                outputInvolvedEntities.Add(entityA);\n            if (entityB != null)\n                outputInvolvedEntities.Add(entityB);\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/ContactManifoldConstraint.cs",
    "content": "﻿using BEPUphysics.Constraints.SolverGroups;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.Entities;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.Materials;\nusing BEPUphysics.SolverSystems;\n\nnamespace BEPUphysics.Constraints.Collision\n{\n    ///<summary>\n    /// Superclass of collision constraints that include multiple contact subconstraints.\n    ///</summary>\n    public abstract class ContactManifoldConstraint : SolverGroup\n    {\n\n        internal InteractionProperties materialInteraction;\n        ///<summary>\n        /// Gets or sets the material-blended properties used by this constraint.\n        ///</summary>\n        public InteractionProperties MaterialInteraction\n        {\n            get\n            {\n                return materialInteraction;\n            }\n            set\n            {\n                materialInteraction = value;\n            }\n        }\n\n        protected Entity entityA;\n        ///<summary>\n        /// Gets the first entity associated with the manifold.\n        ///</summary>\n        public Entity EntityA { get { return entityA; } }\n        protected Entity entityB;\n        ///<summary>\n        /// Gets the second entity associated with the manifold.\n        ///</summary>\n        public Entity EntityB { get { return entityB; } }\n\n        protected internal CollidablePairHandler pair;\n\n        ///<summary>\n        /// Gets the pair handler owning this constraint.\n        ///</summary>\n        public CollidablePairHandler Pair\n        {\n            get\n            {\n                return pair;\n            }\n\n        }\n\n        protected internal override void OnInvolvedEntitiesChanged()\n        {\n            //The default implementation of this method is pretty complicated.\n            //This is a special constraint that has certain guarantees that allow a simpler method to be used.\n            //This updates the involved entities and connected members lists, but does not update references.\n            //It does not have to update references because this 'constraint' can never change entities while belonging to a solver.\n            //It doesn't even need to notify the parent solvergroup.\n            CollectInvolvedEntities();\n        }\n        protected internal override void CollectInvolvedEntities(RawList<Entity> outputInvolvedEntities)\n        {\n            //The default implementation for solver groups looks at every single subconstraint.\n            //That's not necessary for these special constraints.\n            if (entityA != null)\n                outputInvolvedEntities.Add(entityA);\n            if (entityB != null)\n                outputInvolvedEntities.Add(entityB);\n        }\n\n        ///<summary>\n        /// Adds a contact to be managed by the constraint.\n        ///</summary>\n        ///<param name=\"contact\">Contact to add.</param>\n        public abstract void AddContact(Contact contact);\n\n        ///<summary>\n        /// Removes a contact from the constraint.\n        ///</summary>\n        ///<param name=\"contact\">Contact to remove.</param>\n        public abstract void RemoveContact(Contact contact);\n\n\n        ///<summary>\n        /// Initializes the constraint.\n        ///</summary>\n        ///<param name=\"a\">First entity of the pair.</param>\n        ///<param name=\"b\">Second entity of the pair.</param>\n        ///<param name=\"newPair\">Pair owning this constraint.</param>\n        public virtual void Initialize(Entity a, Entity b, CollidablePairHandler newPair)\n        {\n            //This should only be called before the constraint has been added to the solver.\n            entityA = a;\n            entityB = b;\n            pair = newPair;\n            OnInvolvedEntitiesChanged();\n        }\n\n        ///<summary>\n        /// Cleans up the constraint.\n        ///</summary>\n        public abstract void CleanUp();\n\n        protected internal void CleanUpReferences()\n        {\n            entityA = null;\n            entityB = null;\n\n            OnInvolvedEntitiesChanged();\n        }\n\n\n        /// <summary>\n        /// Called when the updateable is removed from its solver.\n        /// </summary>\n        /// <param name=\"oldSolver\">Solver from which the updateable was removed.</param>\n        public override void OnRemovalFromSolver(Solver oldSolver)\n        {\n            //This should only be called after the constraint has been removed from the solver.\n            if (pair == null)\n            {\n                CleanUpReferences();\n            }\n        }\n\n        /// <summary>\n        /// Sets the activity state of the constraint based on the activity state of its connections.\n        /// Called automatically by the space owning a constaint.  If a constraint is a sub-constraint that hasn't been directly added to the space,\n        /// this may need to be called alongside the preStep from within the parent constraint.\n        /// </summary>\n        public override void UpdateSolverActivity()\n        {\n\n            if (isActive)\n            {\n                isActiveInSolver = pair.BroadPhaseOverlap.collisionRule < CollisionRule.NoSolver &&\n                                   ((entityA != null && entityA.isDynamic && entityA.activityInformation.IsActive) || //At least one of the objects must be an active dynamic entity.\n                                   (entityB != null && entityB.isDynamic && entityB.activityInformation.IsActive));\n                for (int i = 0; i < solverUpdateables.Count; i++)\n                {\n                    solverUpdateables.Elements[i].isActiveInSolver = solverUpdateables.Elements[i].isActive && isActiveInSolver;\n                }\n            }\n            else\n                isActiveInSolver = false;\n            \n\n        }\n\n        ///<summary>\n        /// Updates the material properties associated with the constraint.\n        ///</summary>\n        ///<param name=\"materialA\">Material associated with the first entity of the pair.</param>\n        ///<param name=\"materialB\">Material associated with the second entity of the pair.</param>\n        public void UpdateMaterialProperties(Material materialA, Material materialB)\n        {\n            if (materialA != null && materialB != null)\n                MaterialManager.GetInteractionProperties(materialA, materialB, out materialInteraction);\n            else if (materialA == null && materialB != null)\n            {\n                materialInteraction.KineticFriction = materialB.kineticFriction;\n                materialInteraction.StaticFriction = materialB.staticFriction;\n                materialInteraction.Bounciness = materialB.bounciness;\n            }\n            else if (materialA != null)\n            {\n                materialInteraction.KineticFriction = materialA.kineticFriction;\n                materialInteraction.StaticFriction = materialA.staticFriction;\n                materialInteraction.Bounciness = materialA.bounciness;\n            }\n            else\n            {\n                materialInteraction.KineticFriction = 0;\n                materialInteraction.StaticFriction = 0;\n                materialInteraction.Bounciness = 0;\n            }\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/ContactManifoldConstraintGroup.cs",
    "content": "﻿using BEPUphysics.Constraints.SolverGroups;\nusing BEPUphysics.Entities;\nusing System;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.Constraints.Collision\n{\n    ///<summary>\n    /// Constraint group containing multiple contact manifold constraints.\n    /// Used by some pairs which manage multiple sub-pairs.\n    ///</summary>\n    public class ContactManifoldConstraintGroup : SolverGroup\n    {\n\n        protected Entity entityA;\n        ///<summary>\n        /// Gets the first entity in the pair.\n        ///</summary>\n        public Entity EntityA { get { return entityA; } }\n        protected Entity entityB;\n        ///<summary>\n        /// Gets the second entity in the pair.\n        ///</summary>\n        public Entity EntityB { get { return entityB; } }\n\n        ///<summary>\n        /// Adds a constraint to the group.\n        ///</summary>\n        ///<param name=\"manifoldConstraint\">Constraint to add.</param>\n        public new void Add(EntitySolverUpdateable manifoldConstraint)\n        {\n            //This is a similar process to a normal solver group.\n            //However, it does not attempt to change involved entities.\n            //This is for two reasons:\n            //-It is unnecessary; a contact manifold is always between the same two entities throughout its lifespan.\n            //-It causes race conditions; this method is called in a multithreaded context and changing involved \n            // entities calls upon sequential-only methods.\n            if (manifoldConstraint.solver == null)\n            {\n                if (manifoldConstraint.SolverGroup == null)\n                {\n                    solverUpdateables.Add(manifoldConstraint);\n                    manifoldConstraint.SolverGroup = this;\n                    manifoldConstraint.Solver = solver;\n                }\n                else\n                {\n                    throw new InvalidOperationException(\"Cannot add SolverUpdateable to SolverGroup; it already belongs to a SolverGroup.\");\n                }\n            }\n            else\n            {\n                throw new InvalidOperationException(\"Cannot add SolverUpdateable to SolverGroup; it already belongs to a solver.\");\n            }\n        }\n\n        ///<summary>\n        /// Removes a constraint from the group.\n        ///</summary>\n        ///<param name=\"manifoldConstraint\">Constraint to remove.</param>\n        public new void Remove(EntitySolverUpdateable manifoldConstraint)\n        {\n            //This is a similar process to a normal solver group.\n            //However, it does not attempt to change involved entities.\n            //This is for two reasons:\n            //-It is unnecessary; a contact manifold is always between the same two entities throughout its lifespan.\n            //-It causes race conditions; this method is called in a multithreaded context and changing involved \n            // entities calls upon sequential-only methods.\n            if (manifoldConstraint.SolverGroup == this)\n            {\n                solverUpdateables.Remove(manifoldConstraint);\n                manifoldConstraint.SolverGroup = null;\n                manifoldConstraint.Solver = null;\n            }\n            else\n            {\n                throw new InvalidOperationException(\"Cannot remove SolverUpdateable from SolverGroup; it doesn't belong to this SolverGroup.\");\n            }\n        }\n\n        protected internal override void CollectInvolvedEntities(RawList<Entity> outputInvolvedEntities)\n        {\n            //The default implementation for solver groups looks at every single subconstraint.\n            //That's not necessary for these special constraints.\n            if (entityA != null)\n                outputInvolvedEntities.Add(entityA);\n            if (entityB != null)\n                outputInvolvedEntities.Add(entityB);\n        }\n\n\n\n        protected internal override void OnInvolvedEntitiesChanged()\n        {\n            //The default implementation of this method is pretty complicated.\n            //This is a special constraint that has certain guarantees that allow a simpler method to be used.\n            //This updates the involved entities and connected members lists, but does not update references.\n            //It does not have to update references because this 'constraint' can never change entities while belonging to a solver.\n            //It doesn't even need to notify the parent solvergroup.\n            CollectInvolvedEntities();\n        }\n\n        ///<summary>\n        /// Initializes the constraint group.\n        ///</summary>\n        ///<param name=\"a\">First entity of the pair.</param>\n        ///<param name=\"b\">Second entity of the pair.</param>\n        public virtual void Initialize(Entity a, Entity b)\n        {\n            //This should only be called before the constraint has been added to the solver.\n            entityA = a;\n            entityB = b;\n            OnInvolvedEntitiesChanged();\n        }\n\n        ///<summary>\n        /// Cleans up the constraint group.\n        ///</summary>\n        public virtual void CleanUp()\n        {\n            //This should only be called after the constraint has been removed from the solver.\n            entityA = null;\n            entityB = null;\n            OnInvolvedEntitiesChanged();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/ContactPenetrationConstraint.cs",
    "content": "﻿using BEPUphysics.Entities;\nusing BEPUutilities.DataStructures;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.Settings;\nusing BEPUutilities;\nusing System;\n\nnamespace BEPUphysics.Constraints.Collision\n{\n    /// <summary>\n    /// Computes the forces necessary to keep two entities from going through each other at a contact point.\n    /// </summary>\n    public class ContactPenetrationConstraint : EntitySolverUpdateable\n    {\n        internal Contact contact;\n\n        ///<summary>\n        /// Gets the contact associated with this penetration constraint.\n        ///</summary>\n        public Contact Contact { get { return contact; } }\n        internal float accumulatedImpulse;\n        //float linearBX, linearBY, linearBZ;\n        internal float angularAX, angularAY, angularAZ;\n        internal float angularBX, angularBY, angularBZ;\n\n        private float softness;\n        private float bias;\n        private float linearAX, linearAY, linearAZ;\n        private Entity entityA, entityB;\n        private bool entityADynamic, entityBDynamic;\n        //Inverse effective mass matrix\n        internal float velocityToImpulse;\n        private ContactManifoldConstraint contactManifoldConstraint;\n\n        internal Vector3 ra, rb;\n\n        ///<summary>\n        /// Constructs a new penetration constraint.\n        ///</summary>\n        public ContactPenetrationConstraint()\n        {\n            isActive = false;\n        }\n\n\n        ///<summary>\n        /// Configures the penetration constraint.\n        ///</summary>\n        ///<param name=\"contactManifoldConstraint\">Owning manifold constraint.</param>\n        ///<param name=\"contact\">Contact associated with the penetration constraint.</param>\n        public void Setup(ContactManifoldConstraint contactManifoldConstraint, Contact contact)\n        {\n            this.contactManifoldConstraint = contactManifoldConstraint;\n            this.contact = contact;\n            isActive = true;\n\n            entityA = contactManifoldConstraint.EntityA;\n            entityB = contactManifoldConstraint.EntityB;\n\n        }\n\n        ///<summary>\n        /// Cleans up the constraint.\n        ///</summary>\n        public void CleanUp()\n        {\n            accumulatedImpulse = 0;\n            contactManifoldConstraint = null;\n            contact = null;\n            entityA = null;\n            entityB = null;\n            isActive = false;\n\n\n        }\n\n        /// <summary>\n        /// Gets the total normal impulse applied by this penetration constraint to maintain the separation of the involved entities.\n        /// </summary>\n        public float NormalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        ///<summary>\n        /// Gets the relative velocity between the associated entities at the contact point along the contact normal.\n        ///</summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float lambda = 0;\n                if (entityA != null)\n                {\n                    lambda = entityA.linearVelocity.X * linearAX + entityA.linearVelocity.Y * linearAY + entityA.linearVelocity.Z * linearAZ +\n                             entityA.angularVelocity.X * angularAX + entityA.angularVelocity.Y * angularAY + entityA.angularVelocity.Z * angularAZ;\n                }\n                if (entityB != null)\n                {\n                    lambda += -entityB.linearVelocity.X * linearAX - entityB.linearVelocity.Y * linearAY - entityB.linearVelocity.Z * linearAZ +\n                              entityB.angularVelocity.X * angularBX + entityB.angularVelocity.Y * angularBY + entityB.angularVelocity.Z * angularBZ;\n                }\n                return lambda;\n            }\n        }\n\n\n\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n\n            entityADynamic = entityA != null && entityA.isDynamic;\n            entityBDynamic = entityB != null && entityB.isDynamic;\n\n            //Set up the jacobians.\n            linearAX = -contact.Normal.X;\n            linearAY = -contact.Normal.Y;\n            linearAZ = -contact.Normal.Z;\n            //linearBX = -linearAX;\n            //linearBY = -linearAY;\n            //linearBZ = -linearAZ;\n\n\n\n            //angular A = Ra x N\n            if (entityA != null)\n            {\n                Vector3.Subtract(ref contact.Position, ref entityA.position, out ra);\n                angularAX = (ra.Y * linearAZ) - (ra.Z * linearAY);\n                angularAY = (ra.Z * linearAX) - (ra.X * linearAZ);\n                angularAZ = (ra.X * linearAY) - (ra.Y * linearAX);\n            }\n\n\n            //Angular B = N x Rb\n            if (entityB != null)\n            {\n                Vector3.Subtract(ref contact.Position, ref entityB.position, out rb);\n                angularBX = (linearAY * rb.Z) - (linearAZ * rb.Y);\n                angularBY = (linearAZ * rb.X) - (linearAX * rb.Z);\n                angularBZ = (linearAX * rb.Y) - (linearAY * rb.X);\n            }\n\n\n            //Compute inverse effective mass matrix\n            float entryA, entryB;\n\n            //these are the transformed coordinates\n            float tX, tY, tZ;\n            if (entityADynamic)\n            {\n                tX = angularAX * entityA.inertiaTensorInverse.M11 + angularAY * entityA.inertiaTensorInverse.M21 + angularAZ * entityA.inertiaTensorInverse.M31;\n                tY = angularAX * entityA.inertiaTensorInverse.M12 + angularAY * entityA.inertiaTensorInverse.M22 + angularAZ * entityA.inertiaTensorInverse.M32;\n                tZ = angularAX * entityA.inertiaTensorInverse.M13 + angularAY * entityA.inertiaTensorInverse.M23 + angularAZ * entityA.inertiaTensorInverse.M33;\n                entryA = tX * angularAX + tY * angularAY + tZ * angularAZ + entityA.inverseMass;\n            }\n            else\n                entryA = 0;\n\n            if (entityBDynamic)\n            {\n                tX = angularBX * entityB.inertiaTensorInverse.M11 + angularBY * entityB.inertiaTensorInverse.M21 + angularBZ * entityB.inertiaTensorInverse.M31;\n                tY = angularBX * entityB.inertiaTensorInverse.M12 + angularBY * entityB.inertiaTensorInverse.M22 + angularBZ * entityB.inertiaTensorInverse.M32;\n                tZ = angularBX * entityB.inertiaTensorInverse.M13 + angularBY * entityB.inertiaTensorInverse.M23 + angularBZ * entityB.inertiaTensorInverse.M33;\n                entryB = tX * angularBX + tY * angularBY + tZ * angularBZ + entityB.inverseMass;\n            }\n            else\n                entryB = 0;\n\n            //If we used a single fixed softness value, then heavier objects will tend to 'squish' more than light objects.\n            //In the extreme case, very heavy objects could simply fall through the ground by force of gravity.\n            //To see why this is the case, consider that a given dt, softness, and bias factor correspond to an equivalent spring's damping and stiffness coefficients.\n            //Imagine trying to hang objects of different masses on the fixed-strength spring: obviously, heavier ones will pull it further down.\n\n            //To counteract this, scale the softness value based on the effective mass felt by the constraint.\n            //Larger effective masses should correspond to smaller softnesses so that the spring has the same positional behavior.\n            //Fortunately, we're already computing the necessary values: the raw, unsoftened effective mass inverse shall be used to compute the softness.\n    \n            float effectiveMassInverse = entryA + entryB;\n            softness = CollisionResponseSettings.Softness * effectiveMassInverse;\n            velocityToImpulse = -1 / (softness + effectiveMassInverse);\n\n\n            //Bounciness and bias (penetration correction)\n            if (contact.PenetrationDepth >= 0)\n            {\n                bias = MathHelper.Min(\n                    MathHelper.Max(0, contact.PenetrationDepth - CollisionDetectionSettings.AllowedPenetration) *\n                    CollisionResponseSettings.PenetrationRecoveryStiffness / dt,\n                    CollisionResponseSettings.MaximumPenetrationCorrectionSpeed);\n\n                if (contactManifoldConstraint.materialInteraction.Bounciness > 0)\n                {\n                    //Target a velocity which includes a portion of the incident velocity.\n                    float relativeVelocity = -RelativeVelocity;\n                    if (relativeVelocity > CollisionResponseSettings.BouncinessVelocityThreshold)\n                        bias = MathHelper.Max(relativeVelocity * contactManifoldConstraint.materialInteraction.Bounciness, bias);\n                }\n            }\n            else\n            {\n                //The contact is actually separated right now.  Allow the solver to target a position that is just barely in collision.\n                //If the solver finds that an accumulated negative impulse is required to hit this target, then no work will be done.\n                bias = contact.PenetrationDepth / dt;\n\n                //This implementation is going to ignore bounciness for now.\n                //Since it's not being used for CCD, these negative-depth contacts\n                //only really occur in situations where no bounce should occur.\n                \n                //if (contactManifoldConstraint.materialInteraction.Bounciness > 0)\n                //{\n                //    //Target a velocity which includes a portion of the incident velocity.\n                //    //The contact isn't colliding currently, but go ahead and target the post-bounce velocity.\n                //    //The bias is added to the bounce velocity to simulate the object continuing to the surface and then bouncing off.\n                //    float relativeVelocity = -RelativeVelocity;\n                //    if (relativeVelocity > CollisionResponseSettings.BouncinessVelocityThreshold)\n                //        bias = relativeVelocity * contactManifoldConstraint.materialInteraction.Bounciness + bias;\n                //}\n            }\n \n\n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Warm starting\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = accumulatedImpulse * linearAX;\n            linear.Y = accumulatedImpulse * linearAY;\n            linear.Z = accumulatedImpulse * linearAZ;\n            if (entityADynamic)\n            {\n                angular.X = accumulatedImpulse * angularAX;\n                angular.Y = accumulatedImpulse * angularAY;\n                angular.Z = accumulatedImpulse * angularAZ;\n                entityA.ApplyLinearImpulse(ref linear);\n                entityA.ApplyAngularImpulse(ref angular);\n            }\n            if (entityBDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = accumulatedImpulse * angularBX;\n                angular.Y = accumulatedImpulse * angularBY;\n                angular.Z = accumulatedImpulse * angularBZ;\n                entityB.ApplyLinearImpulse(ref linear);\n                entityB.ApplyAngularImpulse(ref angular);\n            }\n        }\n\n\n        /// <summary>\n        /// Computes and applies an impulse to keep the colliders from penetrating.\n        /// </summary>\n        /// <returns>Impulse applied.</returns>\n        public override float SolveIteration()\n        {\n\n            //Compute relative velocity\n            float lambda = (RelativeVelocity - bias + softness * accumulatedImpulse) * velocityToImpulse;\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Max(0, accumulatedImpulse + lambda);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n \n\n            //Apply the impulse\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = lambda * linearAX;\n            linear.Y = lambda * linearAY;\n            linear.Z = lambda * linearAZ;\n            if (entityADynamic)\n            {\n                angular.X = lambda * angularAX;\n                angular.Y = lambda * angularAY;\n                angular.Z = lambda * angularAZ;\n                entityA.ApplyLinearImpulse(ref linear);\n                entityA.ApplyAngularImpulse(ref angular);\n            }\n            if (entityBDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = lambda * angularBX;\n                angular.Y = lambda * angularBY;\n                angular.Z = lambda * angularBZ;\n                entityB.ApplyLinearImpulse(ref linear);\n                entityB.ApplyAngularImpulse(ref angular);\n            }\n\n            return Math.Abs(lambda);\n        }\n\n        protected internal override void CollectInvolvedEntities(RawList<Entity> outputInvolvedEntities)\n        {\n            //This should never really have to be called.\n            if (entityA != null)\n                outputInvolvedEntities.Add(entityA);\n            if (entityB != null)\n                outputInvolvedEntities.Add(entityB);\n        }\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/ConvexContactManifoldConstraint.cs",
    "content": "﻿using BEPUphysics.CollisionTests;\nusing BEPUutilities.DataStructures;\nusing System.Collections.Generic;\n\nnamespace BEPUphysics.Constraints.Collision\n{\n    ///<summary>\n    /// Contact manifold constraint that is used by manifolds whose normals are assumed to be\n    /// essentially the same.  This assumption can only be maintained between two convex objects.\n    ///</summary>\n    public class ConvexContactManifoldConstraint : ContactManifoldConstraint\n    {\n        //This contact manifold constraint covers a single, 4-contact pair.\n\n        //The solver group is composed of multiple constraints.\n        //One pentration constraint for each contact.\n        //One sliding constraint.\n        //One twist constraint.\n\n        internal TwistFrictionConstraint twistFriction;\n        ///<summary>\n        /// Gets the twist friction constraint used by the manifold.\n        ///</summary>\n        public TwistFrictionConstraint TwistFriction\n        {\n            get\n            {\n                return twistFriction;\n            }\n        }\n        internal SlidingFrictionTwoAxis slidingFriction;\n        ///<summary>\n        /// Gets the sliding friction constraint used by the manifold.\n        ///</summary>\n        public SlidingFrictionTwoAxis SlidingFriction\n        {\n            get\n            {\n                return slidingFriction;\n            }\n        }\n\n\n\n        internal RawList<ContactPenetrationConstraint> penetrationConstraints;\n        ///<summary>\n        /// Gets the penetration constraints used by the manifold.\n        ///</summary>\n        public ReadOnlyList<ContactPenetrationConstraint> ContactPenetrationConstraints\n        {\n            get\n            {\n                return new ReadOnlyList<ContactPenetrationConstraint>(penetrationConstraints);\n            }\n        }\n\n        Stack<ContactPenetrationConstraint> penetrationConstraintPool = new Stack<ContactPenetrationConstraint>(4);\n\n\n        ///<summary>\n        /// Constructs a new convex contact manifold constraint.\n        ///</summary>\n        public ConvexContactManifoldConstraint()\n        {\n            //All of the constraints are always in the solver group.  Some of them are just deactivated sometimes.\n            //This reduces some bookkeeping complications.\n\n\n            penetrationConstraints = new RawList<ContactPenetrationConstraint>(4);\n\n\n            //Order matters in this adding process.  Sliding friction computes some information used by the twist friction, and both use penetration impulses.\n            for (int i = 0; i < 4; i++)\n            {\n                var penetrationConstraint = new ContactPenetrationConstraint();\n                Add(penetrationConstraint);\n                penetrationConstraintPool.Push(penetrationConstraint);\n            }\n            slidingFriction = new SlidingFrictionTwoAxis();\n            Add(slidingFriction);\n            twistFriction = new TwistFrictionConstraint();\n            Add(twistFriction);\n\n\n        }\n\n        ///<summary>\n        /// Cleans up the constraint.\n        ///</summary>\n        public override void CleanUp()\n        {\n            //Deactivate any remaining constraints.\n            for (int i = penetrationConstraints.Count - 1; i >= 0; i--)\n            {\n                var penetrationConstraint = penetrationConstraints.Elements[i];\n                penetrationConstraint.CleanUp();\n                penetrationConstraints.RemoveAt(i);\n                penetrationConstraintPool.Push(penetrationConstraint);\n            }\n            if (twistFriction.isActive)\n            {\n                twistFriction.CleanUp();\n                slidingFriction.CleanUp();\n            }\n\n\n        }\n\n\n        ///<summary>\n        /// Adds a contact to be managed by the constraint.\n        ///</summary>\n        ///<param name=\"contact\">Contact to add.</param>\n        public override void AddContact(Contact contact)\n        {\n            contact.Validate();\n            var penetrationConstraint = penetrationConstraintPool.Pop();\n            penetrationConstraint.Setup(this, contact);\n            penetrationConstraints.Add(penetrationConstraint);\n            if (!twistFriction.isActive)\n            {\n                //This is the first real contact.  All constraints need to become active.\n                twistFriction.Setup(this);\n                slidingFriction.Setup(this);\n            }\n        }\n\n        ///<summary>\n        /// Removes a contact from the constraint.\n        ///</summary>\n        ///<param name=\"contact\">Contact to remove.</param>\n        public override void RemoveContact(Contact contact)\n        {\n            for (int i = 0; i < penetrationConstraints.Count; i++)\n            {\n                ContactPenetrationConstraint penetrationConstraint;\n                if ((penetrationConstraint = penetrationConstraints.Elements[i]).contact == contact)\n                {\n                    penetrationConstraint.CleanUp();\n                    penetrationConstraints.RemoveAt(i);\n                    penetrationConstraintPool.Push(penetrationConstraint);\n                    break;\n                }\n            }\n            if (penetrationConstraints.Count == 0)\n            {\n                //No more contacts.  Disable everything.\n                //Don't have to worry about speculative contacts here; if there existed a regular manifold contact, there couldn't now exist a speculative contact.\n                twistFriction.CleanUp();\n                slidingFriction.CleanUp();\n            }\n        }\n\n\n\n        //NOTE: Even though the order of addition to the solver group ensures penetration constraints come first, the\n        //order of penetration constraints themselves matters in terms of determinism!\n        //Consider what happens when penetration constraints are added and removed.  They cycle through a stack,\n        //so the penetration constraints in the solver group's listing have inconsistent ordering.  Reloading the simulation\n        //doesn't reset the penetration constraint pools, so suddenly everything is nonrepeatable, even single threaded.\n\n        //By having the update use the order defined by contact addition/removal, determinism is maintained (so long as contact addition/removal is deterministic!)\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public sealed override void Update(float dt)\n        {\n            for (int i = 0; i < penetrationConstraints.Count; i++)\n                UpdateUpdateable(penetrationConstraints.Elements[i], dt);\n            UpdateUpdateable(slidingFriction, dt);\n            UpdateUpdateable(twistFriction, dt);\n        }\n\n\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public sealed override void ExclusiveUpdate()\n        {\n            for (int i = 0; i < penetrationConstraints.Count; i++)\n                ExclusiveUpdateUpdateable(penetrationConstraints.Elements[i]);\n            ExclusiveUpdateUpdateable(slidingFriction);\n            ExclusiveUpdateUpdateable(twistFriction);\n        }\n\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public sealed override float SolveIteration()\n        {\n\n            int activeConstraints = 0;\n            for (int i = 0; i < penetrationConstraints.Count; i++)\n                SolveUpdateable(penetrationConstraints.Elements[i], ref activeConstraints);\n            SolveUpdateable(slidingFriction, ref activeConstraints);\n            SolveUpdateable(twistFriction, ref activeConstraints);\n\n\n            isActiveInSolver = activeConstraints > 0;\n\n            return solverSettings.minimumImpulse + 1; //Never let the system deactivate due to low impulses; solver group takes care of itself.\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/NonConvexContactManifoldConstraint.cs",
    "content": "﻿using BEPUphysics.CollisionTests;\nusing BEPUutilities.DataStructures;\nusing System.Collections.Generic;\n\nnamespace BEPUphysics.Constraints.Collision\n{\n    ///<summary>\n    /// Collision constraint for non-convex manifolds.  These manifolds are usually used in cases\n    /// where the contacts are coming from multiple objects or from non-convex objects.  The normals\n    /// will likely face more than one direction.\n    ///</summary>\n    public class NonConvexContactManifoldConstraint : ContactManifoldConstraint\n    {\n        //Unlike the convex manifold constraint, this constraint enforces no requirements\n        //on the contact data.  The collisions can form a nonconvex patch.  They can have differing normals.\n        //This is required for proper collision handling on large structures\n\n        //The solver group is composed of multiple constraints.\n        //One pentration constraint for each contact.\n        //One friction constraint for each contact.\n\n        internal RawList<ContactPenetrationConstraint> penetrationConstraints;\n        ///<summary>\n        /// Gets the penetration constraints in the manifold.\n        ///</summary>\n        public ReadOnlyList<ContactPenetrationConstraint> ContactPenetrationConstraints\n        {\n            get\n            {\n                return new ReadOnlyList<ContactPenetrationConstraint>(penetrationConstraints);\n            }\n        }\n\n        Stack<ContactPenetrationConstraint> penetrationConstraintPool = new Stack<ContactPenetrationConstraint>(4);\n\n        internal RawList<ContactFrictionConstraint> frictionConstraints;\n        ///<summary>\n        /// Gets the friction constraints in the manifold.\n        ///</summary>\n        public ReadOnlyList<ContactFrictionConstraint> ContactFrictionConstraints\n        {\n            get\n            {\n                return new ReadOnlyList<ContactFrictionConstraint>(frictionConstraints);\n            }\n        }\n\n        Stack<ContactFrictionConstraint> frictionConstraintPool = new Stack<ContactFrictionConstraint>(4);\n\n\n        ///<summary>\n        /// Constructs a new nonconvex manifold constraint.\n        ///</summary>\n        public NonConvexContactManifoldConstraint()\n        {\n            //All of the constraints are always in the solver group.  Some of them are just deactivated sometimes.\n            //This reduces some bookkeeping complications.\n\n            penetrationConstraints = new RawList<ContactPenetrationConstraint>(4);\n            frictionConstraints = new RawList<ContactFrictionConstraint>(4);\n\n            for (int i = 0; i < 4; i++)\n            {\n                var penetrationConstraint = new ContactPenetrationConstraint();\n                penetrationConstraintPool.Push(penetrationConstraint);\n                Add(penetrationConstraint);\n\n                var frictionConstraint = new ContactFrictionConstraint();\n                frictionConstraintPool.Push(frictionConstraint);\n                Add(frictionConstraint);\n            }\n            \n        }\n\n\n        ///<summary>\n        /// Cleans up the constraint.\n        ///</summary>\n        public override void CleanUp()\n        {\n            //Deactivate any remaining constraints.\n            for (int i = penetrationConstraints.Count - 1; i >= 0; i--)\n            {\n                var penetrationConstraint = penetrationConstraints.Elements[i];\n                penetrationConstraint.CleanUp();\n                penetrationConstraints.RemoveAt(i);\n                penetrationConstraintPool.Push(penetrationConstraint);\n            }\n\n            for (int i = frictionConstraints.Count - 1; i >= 0; i--)\n            {\n                var frictionConstraint = frictionConstraints.Elements[i];\n                frictionConstraint.CleanUp();\n                frictionConstraints.RemoveAt(i);\n                frictionConstraintPool.Push(frictionConstraint);\n            }\n\n\n        }\n\n\n \n\n\n\n\n        //TODO: PROBLEM IS that the add contact/remove contact, when they go from 0 -> !0 or !0 -> 0, the whole constraint is added/removed from the solver.\n        //The Added/Removed contact methods here will run ambiguously before or after they are removed from the solver.\n        //That ambiguous order doesn't really matter though, since everything that these add/remove methods do is local to this solver object and its children.\n        //It doesn't go out and modify any external values on referenced entities.  That only happens when it's added or removed from the solver by whatever owns this object!\n\n        //To avoid ANY ambiguity, some third party is now responsible for adding and removing contacts from this.\n\n        ///<summary>\n        /// Adds a contact to be managed by the constraint.\n        ///</summary>\n        ///<param name=\"contact\">Contact to add.</param>\n        public override void AddContact(Contact contact)\n        {\n            contact.Validate();\n            var penetrationConstraint = penetrationConstraintPool.Pop();\n            penetrationConstraint.Setup(this, contact);\n            penetrationConstraints.Add(penetrationConstraint);\n\n            var frictionConstraint = frictionConstraintPool.Pop();\n            frictionConstraint.Setup(this, penetrationConstraint);\n            frictionConstraints.Add(frictionConstraint);\n\n        }\n\n        ///<summary>\n        /// Removes a contact from the constraint.\n        ///</summary>\n        ///<param name=\"contact\">Contact to remove.</param>\n        public override void RemoveContact(Contact contact)\n        {\n\n            ContactPenetrationConstraint penetrationConstraint = null;\n            for (int i = 0; i < penetrationConstraints.Count; i++)\n            {\n                if ((penetrationConstraint = penetrationConstraints.Elements[i]).contact == contact)\n                {\n                    penetrationConstraint.CleanUp();\n                    penetrationConstraints.RemoveAt(i);\n                    penetrationConstraintPool.Push(penetrationConstraint);\n                    break;\n                }\n            }\n            for (int i = frictionConstraints.Count - 1; i >= 0; i--)\n            {\n                ContactFrictionConstraint frictionConstraint = frictionConstraints[i];\n                if (frictionConstraint.PenetrationConstraint == penetrationConstraint)\n                {\n                    frictionConstraint.CleanUp();\n                    frictionConstraints.RemoveAt(i);\n                    frictionConstraintPool.Push(frictionConstraint);\n                    break;\n                }\n            }\n\n        }\n\n\n\n        //NOTE: Even though the order of addition to the solver group ensures penetration constraints come first, the\n        //order of penetration constraints themselves matters in terms of determinism!\n        //Consider what happens when penetration constraints are added and removed.  They cycle through a stack,\n        //so the penetration constraints in the solver group's listing have inconsistent ordering.  Reloading the simulation\n        //doesn't reset the penetration constraint pools, so suddenly everything is nonrepeatable, even single threaded.\n\n        //By having the update use the order defined by contact addition/removal, determinism is maintained (so long as contact addition/removal is deterministic!)\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public sealed override void Update(float dt)\n        {\n            for (int i = 0; i < penetrationConstraints.Count; i++)\n                UpdateUpdateable(penetrationConstraints.Elements[i], dt);\n            for (int i = 0; i < frictionConstraints.Count; i++)\n                UpdateUpdateable(frictionConstraints.Elements[i], dt);\n        }\n\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public sealed override void ExclusiveUpdate()\n        {\n            for (int i = 0; i < penetrationConstraints.Count; i++)\n                ExclusiveUpdateUpdateable(penetrationConstraints.Elements[i]);\n            for (int i = 0; i < frictionConstraints.Count; i++)\n                ExclusiveUpdateUpdateable(frictionConstraints.Elements[i]);\n        }\n\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public sealed override float SolveIteration()\n        {\n            int activeConstraints = 0;\n            for (int i = 0; i < penetrationConstraints.Count; i++)\n                SolveUpdateable(penetrationConstraints.Elements[i], ref activeConstraints);\n            for (int i = 0; i < frictionConstraints.Count; i++)\n                SolveUpdateable(frictionConstraints.Elements[i], ref activeConstraints);\n            isActiveInSolver = activeConstraints > 0;\n            return solverSettings.minimumImpulse + 1; //Never let the system deactivate due to low impulses; solver group takes care of itself.\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/SlidingFrictionTwoAxis.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Settings;\n\nnamespace BEPUphysics.Constraints.Collision\n{\n    /// <summary>\n    /// Computes the forces to slow down and stop sliding motion between two entities when centralized friction is active.\n    /// </summary>\n    public class SlidingFrictionTwoAxis : EntitySolverUpdateable\n    {\n        private ConvexContactManifoldConstraint contactManifoldConstraint;\n        ///<summary>\n        /// Gets the contact manifold constraint that owns this constraint.\n        ///</summary>\n        public ConvexContactManifoldConstraint ContactManifoldConstraint\n        {\n            get\n            {\n                return contactManifoldConstraint;\n            }\n        }\n        internal Vector2 accumulatedImpulse;\n        internal Matrix2x3 angularA, angularB;\n        private int contactCount;\n        private float friction;\n        internal Matrix2x3 linearA;\n        private Entity entityA, entityB;\n        private bool entityADynamic, entityBDynamic;\n        private Vector3 ra, rb;\n        private Matrix2x2 velocityToImpulse;\n\n\n        /// <summary>\n        /// Gets the first direction in which the friction force acts.\n        /// This is one of two directions that are perpendicular to each other and the normal of a collision between two entities.\n        /// </summary>\n        public Vector3 FrictionDirectionX\n        {\n            get { return new Vector3(linearA.M11, linearA.M12, linearA.M13); }\n        }\n\n        /// <summary>\n        /// Gets the second direction in which the friction force acts.\n        /// This is one of two directions that are perpendicular to each other and the normal of a collision between two entities.\n        /// </summary>\n        public Vector3 FrictionDirectionY\n        {\n            get { return new Vector3(linearA.M21, linearA.M22, linearA.M23); }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by sliding friction in the last time step.\n        /// The X component of this vector is the force applied along the frictionDirectionX,\n        /// while the Y component is the force applied along the frictionDirectionY.\n        /// </summary>\n        public Vector2 TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        ///<summary>\n        /// Gets the tangential relative velocity between the associated entities at the contact point.\n        ///</summary>\n        public Vector2 RelativeVelocity\n        {\n            get\n            {\n                //Compute relative velocity\n                //Explicit version:\n                //Vector2 dot;\n                //Matrix2x3.Transform(ref parentA.myInternalLinearVelocity, ref linearA, out lambda);\n                //Matrix2x3.Transform(ref parentB.myInternalLinearVelocity, ref linearA, out dot);\n                //lambda.X -= dot.X; lambda.Y -= dot.Y;\n                //Matrix2x3.Transform(ref parentA.myInternalAngularVelocity, ref angularA, out dot);\n                //lambda.X += dot.X; lambda.Y += dot.Y;\n                //Matrix2x3.Transform(ref parentB.myInternalAngularVelocity, ref angularB, out dot);\n                //lambda.X += dot.X; lambda.Y += dot.Y;\n\n                //Inline version:\n                //lambda.X = linearA.M11 * parentA.myInternalLinearVelocity.X + linearA.M12 * parentA.myInternalLinearVelocity.Y + linearA.M13 * parentA.myInternalLinearVelocity.Z -\n                //           linearA.M11 * parentB.myInternalLinearVelocity.X - linearA.M12 * parentB.myInternalLinearVelocity.Y - linearA.M13 * parentB.myInternalLinearVelocity.Z +\n                //           angularA.M11 * parentA.myInternalAngularVelocity.X + angularA.M12 * parentA.myInternalAngularVelocity.Y + angularA.M13 * parentA.myInternalAngularVelocity.Z +\n                //           angularB.M11 * parentB.myInternalAngularVelocity.X + angularB.M12 * parentB.myInternalAngularVelocity.Y + angularB.M13 * parentB.myInternalAngularVelocity.Z;\n                //lambda.Y = linearA.M21 * parentA.myInternalLinearVelocity.X + linearA.M22 * parentA.myInternalLinearVelocity.Y + linearA.M23 * parentA.myInternalLinearVelocity.Z -\n                //           linearA.M21 * parentB.myInternalLinearVelocity.X - linearA.M22 * parentB.myInternalLinearVelocity.Y - linearA.M23 * parentB.myInternalLinearVelocity.Z +\n                //           angularA.M21 * parentA.myInternalAngularVelocity.X + angularA.M22 * parentA.myInternalAngularVelocity.Y + angularA.M23 * parentA.myInternalAngularVelocity.Z +\n                //           angularB.M21 * parentB.myInternalAngularVelocity.X + angularB.M22 * parentB.myInternalAngularVelocity.Y + angularB.M23 * parentB.myInternalAngularVelocity.Z;\n\n                //Re-using information version:\n                //TODO: va + wa x ra - vb - wb x rb, dotted against each axis, is it faster?\n                float dvx = 0, dvy = 0, dvz = 0;\n                if (entityA != null)\n                {\n                    dvx = entityA.linearVelocity.X + (entityA.angularVelocity.Y * ra.Z) - (entityA.angularVelocity.Z * ra.Y);\n                    dvy = entityA.linearVelocity.Y + (entityA.angularVelocity.Z * ra.X) - (entityA.angularVelocity.X * ra.Z);\n                    dvz = entityA.linearVelocity.Z + (entityA.angularVelocity.X * ra.Y) - (entityA.angularVelocity.Y * ra.X);\n                }\n                if (entityB != null)\n                {\n                    dvx += -entityB.linearVelocity.X - (entityB.angularVelocity.Y * rb.Z) + (entityB.angularVelocity.Z * rb.Y);\n                    dvy += -entityB.linearVelocity.Y - (entityB.angularVelocity.Z * rb.X) + (entityB.angularVelocity.X * rb.Z);\n                    dvz += -entityB.linearVelocity.Z - (entityB.angularVelocity.X * rb.Y) + (entityB.angularVelocity.Y * rb.X);\n                }\n\n                //float dvx = entityA.linearVelocity.X + (entityA.angularVelocity.Y * ra.Z) - (entityA.angularVelocity.Z * ra.Y)\n                //            - entityB.linearVelocity.X - (entityB.angularVelocity.Y * rb.Z) + (entityB.angularVelocity.Z * rb.Y);\n\n                //float dvy = entityA.linearVelocity.Y + (entityA.angularVelocity.Z * ra.X) - (entityA.angularVelocity.X * ra.Z)\n                //            - entityB.linearVelocity.Y - (entityB.angularVelocity.Z * rb.X) + (entityB.angularVelocity.X * rb.Z);\n\n                //float dvz = entityA.linearVelocity.Z + (entityA.angularVelocity.X * ra.Y) - (entityA.angularVelocity.Y * ra.X)\n                //            - entityB.linearVelocity.Z - (entityB.angularVelocity.X * rb.Y) + (entityB.angularVelocity.Y * rb.X);\n\n#if !WINDOWS\n                Vector2 lambda = new Vector2();\n#else\n                Vector2 lambda;\n#endif\n                lambda.X = dvx * linearA.M11 + dvy * linearA.M12 + dvz * linearA.M13;\n                lambda.Y = dvx * linearA.M21 + dvy * linearA.M22 + dvz * linearA.M23;\n                return lambda;\n\n                //Using XNA Cross product instead of inline\n                //Vector3 wara, wbrb;\n                //Vector3.Cross(ref parentA.myInternalAngularVelocity, ref Ra, out wara);\n                //Vector3.Cross(ref parentB.myInternalAngularVelocity, ref Rb, out wbrb);\n\n                //float dvx, dvy, dvz;\n                //dvx = wara.X + parentA.myInternalLinearVelocity.X - wbrb.X - parentB.myInternalLinearVelocity.X;\n                //dvy = wara.Y + parentA.myInternalLinearVelocity.Y - wbrb.Y - parentB.myInternalLinearVelocity.Y;\n                //dvz = wara.Z + parentA.myInternalLinearVelocity.Z - wbrb.Z - parentB.myInternalLinearVelocity.Z;\n\n                //lambda.X = dvx * linearA.M11 + dvy * linearA.M12 + dvz * linearA.M13;\n                //lambda.Y = dvx * linearA.M21 + dvy * linearA.M22 + dvz * linearA.M23;\n            }\n        }\n\n\n        ///<summary>\n        /// Constructs a new sliding friction constraint.\n        ///</summary>\n        public SlidingFrictionTwoAxis()\n        {\n            isActive = false;\n        }\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n\n            Vector2 lambda = RelativeVelocity;\n\n            //Convert to impulse\n            //Matrix2x2.Transform(ref lambda, ref velocityToImpulse, out lambda);\n            float x = lambda.X;\n            lambda.X = x * velocityToImpulse.M11 + lambda.Y * velocityToImpulse.M21;\n            lambda.Y = x * velocityToImpulse.M12 + lambda.Y * velocityToImpulse.M22;\n\n            //Accumulate and clamp\n            Vector2 previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse.X += lambda.X;\n            accumulatedImpulse.Y += lambda.Y;\n            float length = accumulatedImpulse.LengthSquared();\n            float maximumFrictionForce = 0;\n            for (int i = 0; i < contactCount; i++)\n            {\n                maximumFrictionForce += contactManifoldConstraint.penetrationConstraints.Elements[i].accumulatedImpulse;\n            }\n            maximumFrictionForce *= friction;\n            if (length > maximumFrictionForce * maximumFrictionForce)\n            {\n                length = maximumFrictionForce / (float)Math.Sqrt(length);\n                accumulatedImpulse.X *= length;\n                accumulatedImpulse.Y *= length;\n            }\n            lambda.X = accumulatedImpulse.X - previousAccumulatedImpulse.X;\n            lambda.Y = accumulatedImpulse.Y - previousAccumulatedImpulse.Y;\n            //Single Axis clamp\n            //float maximumFrictionForce = 0;\n            //for (int i = 0; i < contactCount; i++)\n            //{\n            //    maximumFrictionForce += pair.contacts[i].penetrationConstraint.accumulatedImpulse;\n            //}\n            //maximumFrictionForce *= friction;\n            //float previousAccumulatedImpulse = accumulatedImpulse.X;\n            //accumulatedImpulse.X = MathHelper.Clamp(accumulatedImpulse.X + lambda.X, -maximumFrictionForce, maximumFrictionForce);\n            //lambda.X = accumulatedImpulse.X - previousAccumulatedImpulse;\n            //previousAccumulatedImpulse = accumulatedImpulse.Y;\n            //accumulatedImpulse.Y = MathHelper.Clamp(accumulatedImpulse.Y + lambda.Y, -maximumFrictionForce, maximumFrictionForce);\n            //lambda.Y = accumulatedImpulse.Y - previousAccumulatedImpulse;\n\n            //Apply impulse\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            //Matrix2x3.Transform(ref lambda, ref linearA, out linear);\n            linear.X = lambda.X * linearA.M11 + lambda.Y * linearA.M21;\n            linear.Y = lambda.X * linearA.M12 + lambda.Y * linearA.M22;\n            linear.Z = lambda.X * linearA.M13 + lambda.Y * linearA.M23;\n            if (entityADynamic)\n            {\n                //Matrix2x3.Transform(ref lambda, ref angularA, out angular);\n                angular.X = lambda.X * angularA.M11 + lambda.Y * angularA.M21;\n                angular.Y = lambda.X * angularA.M12 + lambda.Y * angularA.M22;\n                angular.Z = lambda.X * angularA.M13 + lambda.Y * angularA.M23;\n                entityA.ApplyLinearImpulse(ref linear);\n                entityA.ApplyAngularImpulse(ref angular);\n            }\n            if (entityBDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                //Matrix2x3.Transform(ref lambda, ref angularB, out angular);\n                angular.X = lambda.X * angularB.M11 + lambda.Y * angularB.M21;\n                angular.Y = lambda.X * angularB.M12 + lambda.Y * angularB.M22;\n                angular.Z = lambda.X * angularB.M13 + lambda.Y * angularB.M23;\n                entityB.ApplyLinearImpulse(ref linear);\n                entityB.ApplyAngularImpulse(ref angular);\n            }\n\n\n            return Math.Abs(lambda.X) + Math.Abs(lambda.Y);\n        }\n\n        internal Vector3 manifoldCenter, relativeVelocity;\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n\n            entityADynamic = entityA != null && entityA.isDynamic;\n            entityBDynamic = entityB != null && entityB.isDynamic;\n\n            contactCount = contactManifoldConstraint.penetrationConstraints.Count;\n            switch (contactCount)\n            {\n                case 1:\n                    manifoldCenter = contactManifoldConstraint.penetrationConstraints.Elements[0].contact.Position;\n                    break;\n                case 2:\n                    Vector3.Add(ref contactManifoldConstraint.penetrationConstraints.Elements[0].contact.Position,\n                                ref contactManifoldConstraint.penetrationConstraints.Elements[1].contact.Position,\n                                out manifoldCenter);\n                    manifoldCenter.X *= .5f;\n                    manifoldCenter.Y *= .5f;\n                    manifoldCenter.Z *= .5f;\n                    break;\n                case 3:\n                    Vector3.Add(ref contactManifoldConstraint.penetrationConstraints.Elements[0].contact.Position,\n                                ref contactManifoldConstraint.penetrationConstraints.Elements[1].contact.Position,\n                                out manifoldCenter);\n                    Vector3.Add(ref contactManifoldConstraint.penetrationConstraints.Elements[2].contact.Position,\n                                ref manifoldCenter,\n                                out manifoldCenter);\n                    manifoldCenter.X *= .333333333f;\n                    manifoldCenter.Y *= .333333333f;\n                    manifoldCenter.Z *= .333333333f;\n                    break;\n                case 4:\n                    //This isn't actually the center of the manifold.  Is it good enough?  Sure seems like it.\n                    Vector3.Add(ref contactManifoldConstraint.penetrationConstraints.Elements[0].contact.Position,\n                                ref contactManifoldConstraint.penetrationConstraints.Elements[1].contact.Position,\n                                out manifoldCenter);\n                    Vector3.Add(ref contactManifoldConstraint.penetrationConstraints.Elements[2].contact.Position,\n                                ref manifoldCenter,\n                                out manifoldCenter);\n                    Vector3.Add(ref contactManifoldConstraint.penetrationConstraints.Elements[3].contact.Position,\n                                ref manifoldCenter,\n                                out manifoldCenter);\n                    manifoldCenter.X *= .25f;\n                    manifoldCenter.Y *= .25f;\n                    manifoldCenter.Z *= .25f;\n                    break;\n                default:\n                    manifoldCenter = Toolbox.NoVector;\n                    break;\n            }\n\n            //Compute the three dimensional relative velocity at the point.\n\n\n            Vector3 velocityA, velocityB;\n            if (entityA != null)\n            {\n                Vector3.Subtract(ref manifoldCenter, ref entityA.position, out ra);\n                Vector3.Cross(ref entityA.angularVelocity, ref ra, out velocityA);\n                Vector3.Add(ref velocityA, ref entityA.linearVelocity, out velocityA);\n            }\n            else\n                velocityA = new Vector3();\n            if (entityB != null)\n            {\n                Vector3.Subtract(ref manifoldCenter, ref entityB.position, out rb);\n                Vector3.Cross(ref entityB.angularVelocity, ref rb, out velocityB);\n                Vector3.Add(ref velocityB, ref entityB.linearVelocity, out velocityB);\n            }\n            else\n                velocityB = new Vector3();\n            Vector3.Subtract(ref velocityA, ref velocityB, out relativeVelocity);\n\n            //Get rid of the normal velocity.\n            Vector3 normal = contactManifoldConstraint.penetrationConstraints.Elements[0].contact.Normal;\n            float normalVelocityScalar = normal.X * relativeVelocity.X + normal.Y * relativeVelocity.Y + normal.Z * relativeVelocity.Z;\n            relativeVelocity.X -= normalVelocityScalar * normal.X;\n            relativeVelocity.Y -= normalVelocityScalar * normal.Y;\n            relativeVelocity.Z -= normalVelocityScalar * normal.Z;\n\n            //Create the jacobian entry and decide the friction coefficient.\n            float length = relativeVelocity.LengthSquared();\n            if (length > Toolbox.Epsilon)\n            {\n                length = (float)Math.Sqrt(length);\n                float inverseLength = 1 / length;\n                linearA.M11 = relativeVelocity.X * inverseLength;\n                linearA.M12 = relativeVelocity.Y * inverseLength;\n                linearA.M13 = relativeVelocity.Z * inverseLength;\n\n\n                friction = length > CollisionResponseSettings.StaticFrictionVelocityThreshold ?\n                           contactManifoldConstraint.materialInteraction.KineticFriction :\n                           contactManifoldConstraint.materialInteraction.StaticFriction;\n            }\n            else\n            {\n                friction = contactManifoldConstraint.materialInteraction.StaticFriction;\n\n                //If there was no velocity, try using the previous frame's jacobian... if it exists.\n                //Reusing an old one is okay since jacobians are cleared when a contact is initialized.\n                if (!(linearA.M11 != 0 || linearA.M12 != 0 || linearA.M13 != 0))\n                {\n                    //Otherwise, just redo it all.\n                    //Create arbitrary axes.\n                    Vector3 axis1;\n                    Vector3.Cross(ref normal, ref Toolbox.RightVector, out axis1);\n                    length = axis1.LengthSquared();\n                    if (length > Toolbox.Epsilon)\n                    {\n                        length = (float)Math.Sqrt(length);\n                        float inverseLength = 1 / length;\n                        linearA.M11 = axis1.X * inverseLength;\n                        linearA.M12 = axis1.Y * inverseLength;\n                        linearA.M13 = axis1.Z * inverseLength;\n                    }\n                    else\n                    {\n                        Vector3.Cross(ref normal, ref Toolbox.UpVector, out axis1);\n                        axis1.Normalize();\n                        linearA.M11 = axis1.X;\n                        linearA.M12 = axis1.Y;\n                        linearA.M13 = axis1.Z;\n                    }\n                }\n            }\n\n            //Second axis is first axis x normal\n            linearA.M21 = (linearA.M12 * normal.Z) - (linearA.M13 * normal.Y);\n            linearA.M22 = (linearA.M13 * normal.X) - (linearA.M11 * normal.Z);\n            linearA.M23 = (linearA.M11 * normal.Y) - (linearA.M12 * normal.X);\n\n\n            //Compute angular jacobians\n            if (entityA != null)\n            {\n                //angularA 1 =  ra x linear axis 1\n                angularA.M11 = (ra.Y * linearA.M13) - (ra.Z * linearA.M12);\n                angularA.M12 = (ra.Z * linearA.M11) - (ra.X * linearA.M13);\n                angularA.M13 = (ra.X * linearA.M12) - (ra.Y * linearA.M11);\n\n                //angularA 2 =  ra x linear axis 2\n                angularA.M21 = (ra.Y * linearA.M23) - (ra.Z * linearA.M22);\n                angularA.M22 = (ra.Z * linearA.M21) - (ra.X * linearA.M23);\n                angularA.M23 = (ra.X * linearA.M22) - (ra.Y * linearA.M21);\n            }\n\n            //angularB 1 =  linear axis 1 x rb\n            if (entityB != null)\n            {\n                angularB.M11 = (linearA.M12 * rb.Z) - (linearA.M13 * rb.Y);\n                angularB.M12 = (linearA.M13 * rb.X) - (linearA.M11 * rb.Z);\n                angularB.M13 = (linearA.M11 * rb.Y) - (linearA.M12 * rb.X);\n\n                //angularB 2 =  linear axis 2 x rb\n                angularB.M21 = (linearA.M22 * rb.Z) - (linearA.M23 * rb.Y);\n                angularB.M22 = (linearA.M23 * rb.X) - (linearA.M21 * rb.Z);\n                angularB.M23 = (linearA.M21 * rb.Y) - (linearA.M22 * rb.X);\n            }\n            //Compute inverse effective mass matrix\n            Matrix2x2 entryA, entryB;\n\n            //these are the transformed coordinates\n            Matrix2x3 transform;\n            Matrix3x2 transpose;\n            if (entityADynamic)\n            {\n                Matrix2x3.Multiply(ref angularA, ref entityA.inertiaTensorInverse, out transform);\n                Matrix2x3.Transpose(ref angularA, out transpose);\n                Matrix2x2.Multiply(ref transform, ref transpose, out entryA);\n                entryA.M11 += entityA.inverseMass;\n                entryA.M22 += entityA.inverseMass;\n            }\n            else\n            {\n                entryA = new Matrix2x2();\n            }\n\n            if (entityBDynamic)\n            {\n                Matrix2x3.Multiply(ref angularB, ref entityB.inertiaTensorInverse, out transform);\n                Matrix2x3.Transpose(ref angularB, out transpose);\n                Matrix2x2.Multiply(ref transform, ref transpose, out entryB);\n                entryB.M11 += entityB.inverseMass;\n                entryB.M22 += entityB.inverseMass;\n            }\n            else\n            {\n                entryB = new Matrix2x2();\n            }\n\n            velocityToImpulse.M11 = -entryA.M11 - entryB.M11;\n            velocityToImpulse.M12 = -entryA.M12 - entryB.M12;\n            velocityToImpulse.M21 = -entryA.M21 - entryB.M21;\n            velocityToImpulse.M22 = -entryA.M22 - entryB.M22;\n            Matrix2x2.Invert(ref velocityToImpulse, out velocityToImpulse);\n\n\n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n\n            //Warm starting\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            //Matrix2x3.Transform(ref lambda, ref linearA, out linear);\n            linear.X = accumulatedImpulse.X * linearA.M11 + accumulatedImpulse.Y * linearA.M21;\n            linear.Y = accumulatedImpulse.X * linearA.M12 + accumulatedImpulse.Y * linearA.M22;\n            linear.Z = accumulatedImpulse.X * linearA.M13 + accumulatedImpulse.Y * linearA.M23;\n            if (entityADynamic)\n            {\n                //Matrix2x3.Transform(ref lambda, ref angularA, out angular);\n                angular.X = accumulatedImpulse.X * angularA.M11 + accumulatedImpulse.Y * angularA.M21;\n                angular.Y = accumulatedImpulse.X * angularA.M12 + accumulatedImpulse.Y * angularA.M22;\n                angular.Z = accumulatedImpulse.X * angularA.M13 + accumulatedImpulse.Y * angularA.M23;\n                entityA.ApplyLinearImpulse(ref linear);\n                entityA.ApplyAngularImpulse(ref angular);\n            }\n            if (entityBDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                //Matrix2x3.Transform(ref lambda, ref angularB, out angular);\n                angular.X = accumulatedImpulse.X * angularB.M11 + accumulatedImpulse.Y * angularB.M21;\n                angular.Y = accumulatedImpulse.X * angularB.M12 + accumulatedImpulse.Y * angularB.M22;\n                angular.Z = accumulatedImpulse.X * angularB.M13 + accumulatedImpulse.Y * angularB.M23;\n                entityB.ApplyLinearImpulse(ref linear);\n                entityB.ApplyAngularImpulse(ref angular);\n            }\n        }\n\n        internal void Setup(ConvexContactManifoldConstraint contactManifoldConstraint)\n        {\n            this.contactManifoldConstraint = contactManifoldConstraint;\n            isActive = true;\n\n            linearA = new Matrix2x3();\n\n            entityA = contactManifoldConstraint.EntityA;\n            entityB = contactManifoldConstraint.EntityB;\n        }\n\n        internal void CleanUp()\n        {\n            accumulatedImpulse = new Vector2();\n            contactManifoldConstraint = null;\n            entityA = null;\n            entityB = null;\n            isActive = false;\n        }\n\n        protected internal override void CollectInvolvedEntities(RawList<Entity> outputInvolvedEntities)\n        {\n            //This should never really have to be called.\n            if (entityA != null)\n                outputInvolvedEntities.Add(entityA);\n            if (entityB != null)\n                outputInvolvedEntities.Add(entityB);\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/Testing/ContactPenetrationConstraintDETester.cs",
    "content": "﻿using BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints\n{\n    internal class ContactPenetrationConstraintTester\n    {\n        private readonly Contact contact;\n\n        internal float accumulatedImpulse;\n        //float linearBX, linearBY, linearBZ;\n        internal float angularAX, angularAY, angularAZ;\n        internal float angularBX, angularBY, angularBZ;\n\n        //Inverse effective mass matrix\n\n        private float bias;\n        internal bool isActive = true;\n        private float linearAX, linearAY, linearAZ;\n        internal int numIterationsAtZeroImpulse;\n        private Entity parentA, parentB;\n        internal float velocityToImpulse;\n\n        internal ContactPenetrationConstraintTester(Contact contact)\n        {\n            this.contact = contact;\n        }\n\n        /// <summary>\n        /// Computes and applies an impulse to keep the colliders from penetrating.\n        /// </summary>\n        /// <returns>Impulse applied.</returns>\n        internal float ApplyImpulse()\n        {\n            //Compute relative velocity\n            float lambda = (parentA.linearVelocity.X * linearAX + parentA.linearVelocity.Y * linearAY + parentA.linearVelocity.Z * linearAZ +\n                            parentA.angularVelocity.X * angularAX + parentA.angularVelocity.Y * angularAY + parentA.angularVelocity.Z * angularAZ -\n                            //note negatives, since reusing linearA jacobian entry\n                            parentB.linearVelocity.X * linearAX - parentB.linearVelocity.Y * linearAY - parentB.linearVelocity.Z * linearAZ +\n                            parentB.angularVelocity.X * angularBX + parentB.angularVelocity.Y * angularBY + parentB.angularVelocity.Z * angularBZ\n                            - bias) //Add in position correction/resitution\n                           * velocityToImpulse; //convert to impulse\n\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Max(0, accumulatedImpulse + lambda);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = lambda * linearAX;\n            linear.Y = lambda * linearAY;\n            linear.Z = lambda * linearAZ;\n            if (parentA.isDynamic)\n            {\n                angular.X = lambda * angularAX;\n                angular.Y = lambda * angularAY;\n                angular.Z = lambda * angularAZ;\n                parentA.ApplyLinearImpulse(ref linear);\n                parentA.ApplyAngularImpulse(ref angular);\n            }\n            if (parentB.isDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = lambda * angularBX;\n                angular.Y = lambda * angularBY;\n                angular.Z = lambda * angularBZ;\n                parentB.ApplyLinearImpulse(ref linear);\n                parentB.ApplyAngularImpulse(ref angular);\n            }\n\n            return lambda;\n        }\n\n        internal void PreStep(float dt)\n        {\n            parentA = contact.collisionPair.ParentA;\n            parentB = contact.collisionPair.ParentB;\n\n            //Set up the jacobians.\n            linearAX = contact.Normal.X;\n            linearAY = contact.Normal.Y;\n            linearAZ = contact.Normal.Z;\n            //linearBX = -linearAX;\n            //linearBY = -linearAY;\n            //linearBZ = -linearAZ;\n\n            //angular A = Ra x N\n            angularAX = (contact.Ra.Y * linearAZ) - (contact.Ra.Z * linearAY);\n            angularAY = (contact.Ra.Z * linearAX) - (contact.Ra.X * linearAZ);\n            angularAZ = (contact.Ra.X * linearAY) - (contact.Ra.Y * linearAX);\n\n            //Angular B = N x Rb\n            angularBX = (linearAY * contact.Rb.Z) - (linearAZ * contact.Rb.Y);\n            angularBY = (linearAZ * contact.Rb.X) - (linearAX * contact.Rb.Z);\n            angularBZ = (linearAX * contact.Rb.Y) - (linearAY * contact.Rb.X);\n\n            //Compute inverse effective mass matrix\n            float entryA, entryB;\n\n            //these are the transformed coordinates\n            float tX, tY, tZ;\n            if (parentA.isDynamic)\n            {\n                tX = angularAX * parentA.inertiaTensorInverse.M11 + angularAY * parentA.inertiaTensorInverse.M21 + angularAZ * parentA.inertiaTensorInverse.M31;\n                tY = angularAX * parentA.inertiaTensorInverse.M12 + angularAY * parentA.inertiaTensorInverse.M22 + angularAZ * parentA.inertiaTensorInverse.M32;\n                tZ = angularAX * parentA.inertiaTensorInverse.M13 + angularAY * parentA.inertiaTensorInverse.M23 + angularAZ * parentA.inertiaTensorInverse.M33;\n                entryA = tX * angularAX + tY * angularAY + tZ * angularAZ + 1 / parentA.mass;\n            }\n            else\n                entryA = 0;\n\n            if (parentB.isDynamic)\n            {\n                tX = angularBX * parentB.inertiaTensorInverse.M11 + angularBY * parentB.inertiaTensorInverse.M21 + angularBZ * parentB.inertiaTensorInverse.M31;\n                tY = angularBX * parentB.inertiaTensorInverse.M12 + angularBY * parentB.inertiaTensorInverse.M22 + angularBZ * parentB.inertiaTensorInverse.M32;\n                tZ = angularBX * parentB.inertiaTensorInverse.M13 + angularBY * parentB.inertiaTensorInverse.M23 + angularBZ * parentB.inertiaTensorInverse.M33;\n                entryB = tX * angularBX + tY * angularBY + tZ * angularBZ + 1 / parentB.mass;\n            }\n            else\n                entryB = 0;\n\n            velocityToImpulse = -1 / (entryA + entryB); //Softness?\n\n            //Bounciness\n            bias =\n                MathHelper.Min(\n                    MathHelper.Max(0, contact.PenetrationDepth - contact.collisionPair.allowedPenetration) *\n                    contact.collisionPair.space.simulationSettings.CollisionResponse.PenetrationRecoveryStiffness / dt,\n                    contact.collisionPair.space.simulationSettings.CollisionResponse.MaximumPositionCorrectionSpeed);\n            if (contact.collisionPair.Bounciness > 0)\n            {\n                //Compute relative velocity\n                float relativeVelocity = parentA.linearVelocity.X * linearAX + parentA.linearVelocity.Y * linearAY + parentA.linearVelocity.Z * linearAZ +\n                                         parentA.angularVelocity.X * angularAX + parentA.angularVelocity.Y * angularAY + parentA.angularVelocity.Z * angularAZ -\n                                         parentB.linearVelocity.X * linearAX - parentB.linearVelocity.Y * linearAY - parentB.linearVelocity.Z * linearAZ +\n                                         parentB.angularVelocity.X * angularBX + parentB.angularVelocity.Y * angularBY + parentB.angularVelocity.Z * angularBZ;\n                relativeVelocity *= -1;\n                if (relativeVelocity > contact.collisionPair.space.simulationSettings.CollisionResponse.BouncinessVelocityThreshold)\n                    bias = MathHelper.Max(relativeVelocity * contact.collisionPair.Bounciness, bias);\n            }\n\n            //Warm starting\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = accumulatedImpulse * linearAX;\n            linear.Y = accumulatedImpulse * linearAY;\n            linear.Z = accumulatedImpulse * linearAZ;\n            if (parentA.isDynamic)\n            {\n                angular.X = accumulatedImpulse * angularAX;\n                angular.Y = accumulatedImpulse * angularAY;\n                angular.Z = accumulatedImpulse * angularAZ;\n                //parentA.ApplyLinearImpulse(ref linear);\n                //parentA.ApplyAngularImpulse(ref angular);\n            }\n            if (parentB.isDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = accumulatedImpulse * angularBX;\n                angular.Y = accumulatedImpulse * angularBY;\n                angular.Z = accumulatedImpulse * angularBZ;\n                //parentB.ApplyLinearImpulse(ref linear);\n                //parentB.ApplyAngularImpulse(ref angular);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/Testing/DirectEnumerationSolver.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints\n{\n    /// <summary>\n    /// Solves the penetration constraints in a collision pair at once.\n    /// </summary>\n    internal class DirectEnumerationSolver\n    {\n        private const float ConditionNumberLimit = 1000;\n        private readonly Vector3[] angularA = new Vector3[4];\n        private readonly Vector3[] angularB = new Vector3[4];\n        private readonly List<int> contactIndicesUsed = new List<int>(4);\n        private readonly CollisionPair pair;\n        private int contactCount;\n        private Vector3 linear;\n        private Entity parentA, parentB;\n\n        //Jacobian is of the form\n        //LinA1 AngA1 LinB1 AngB1\n        //LinA2 AngA2 LinB2 AngB2\n        //LinA3 AngA3 LinB3 AngB3\n        //LinA4 AngA4 LinB4 AngB4\n        //4x12 matrix.\n\n        //Now, it just so happens that all linear entries are equal (B's are negative).\n        //Angular entries are not equal.\n\n        //4x12 Jacobian for 4 contacts:\n        //[  n  ra1 x n  -n  n x rb1  ]\n        //[  n  ra2 x n  -n  n x rb2  ]\n        //[  n  ra3 x n  -n  n x rb3  ]\n        //[  n  ra4 x n  -n  n x rb4  ]\n\n\n        private Matrix velocityToImpulse;\n        private Matrix3x3 velocityToImpulse3X3;\n\n        internal DirectEnumerationSolver(CollisionPair pair)\n        {\n            this.pair = pair;\n        }\n\n        internal void ApplyImpulse()\n        {\n            switch (contactIndicesUsed.Count)\n            {\n                case 4:\n                    //Compute relative velocities.\n#if !WINDOWS\n                Vector4 lambda = new Vector4();\n#else\n                    Vector4 lambda;\n#endif\n                    lambda.X = -GetRelativeVelocity(0);\n                    lambda.Y = -GetRelativeVelocity(1);\n                    lambda.Z = -GetRelativeVelocity(2);\n                    lambda.W = -GetRelativeVelocity(3);\n\n                    //Transform to impulse\n                    Vector4.Transform(ref lambda, ref velocityToImpulse, out lambda);\n\n\n                    //if the solution is acceptable, apply and return\n                    if (lambda.X > 0 && lambda.Y > 0 && lambda.Z > 0 && lambda.W > 0)\n                    {\n#if !WINDOWS\n                    Vector3 linearImpulse = new Vector3(), angularImpulse = new Vector3();\n#else\n                        Vector3 linearImpulse, angularImpulse;\n#endif\n                        float lambdaSum = lambda.X + lambda.Y + lambda.Z + lambda.W;\n                        linearImpulse.X = linear.X * lambdaSum;\n                        linearImpulse.Y = linear.Y * lambdaSum;\n                        linearImpulse.Z = linear.Z * lambdaSum;\n                        if (parentA.isDynamic)\n                        {\n                            angularImpulse.X = angularA[0].X * lambda.X + angularA[1].X * lambda.Y + angularA[2].X * lambda.Z + angularA[3].X * lambda.W;\n                            angularImpulse.Y = angularA[0].Y * lambda.X + angularA[1].Y * lambda.Y + angularA[2].Y * lambda.Z + angularA[3].Y * lambda.W;\n                            angularImpulse.Z = angularA[0].Z * lambda.X + angularA[1].Z * lambda.Y + angularA[2].Z * lambda.Z + angularA[3].Z * lambda.W;\n                            parentA.ApplyLinearImpulse(ref linearImpulse);\n                            parentA.ApplyAngularImpulse(ref angularImpulse);\n                        }\n                        if (parentB.isDynamic)\n                        {\n                            linearImpulse.X = -linearImpulse.X;\n                            linearImpulse.Y = -linearImpulse.Y;\n                            linearImpulse.Z = -linearImpulse.Z;\n                            angularImpulse.X = angularB[0].X * lambda.X + angularB[1].X * lambda.Y + angularB[2].X * lambda.Z + angularB[3].X * lambda.W;\n                            angularImpulse.Y = angularB[0].Y * lambda.X + angularB[1].Y * lambda.Y + angularB[2].Y * lambda.Z + angularB[3].Y * lambda.W;\n                            angularImpulse.Z = angularB[0].Z * lambda.X + angularB[1].Z * lambda.Y + angularB[2].Z * lambda.Z + angularB[3].Z * lambda.W;\n                            parentB.ApplyLinearImpulse(ref linearImpulse);\n                            parentB.ApplyAngularImpulse(ref angularImpulse);\n                        }\n                        return;\n                    }\n                    break;\n                case 3:\n#if !WINDOWS\n                    Vector3 lambda3 = new Vector3();\n#else\n                    Vector3 lambda3;\n#endif\n                    lambda3.X = -GetRelativeVelocity(contactIndicesUsed[0]);\n                    lambda3.Y = -GetRelativeVelocity(contactIndicesUsed[1]);\n                    lambda3.Z = -GetRelativeVelocity(contactIndicesUsed[2]);\n\n                    //Transform to impulse\n                    Matrix3x3.Transform(ref lambda3, ref velocityToImpulse3X3, out lambda3);\n\n\n                    //if the solution is acceptable, apply and return\n                    if (lambda3.X >= 0 && lambda3.Y >= 0 && lambda3.Z >= 0)\n                    {\n#if !WINDOWS\n                    Vector3 linearImpulse = new Vector3(), angularImpulse = new Vector3();\n#else\n                        Vector3 linearImpulse, angularImpulse;\n#endif\n                        float lambdaSum = lambda3.X + lambda3.Y + lambda3.Z;\n                        linearImpulse.X = linear.X * lambdaSum;\n                        linearImpulse.Y = linear.Y * lambdaSum;\n                        linearImpulse.Z = linear.Z * lambdaSum;\n                        if (parentA.isDynamic)\n                        {\n                            angularImpulse.X = angularA[contactIndicesUsed[0]].X * lambda3.X + angularA[contactIndicesUsed[1]].X * lambda3.Y + angularA[contactIndicesUsed[2]].X * lambda3.Z;\n                            angularImpulse.Y = angularA[contactIndicesUsed[0]].Y * lambda3.X + angularA[contactIndicesUsed[1]].Y * lambda3.Y + angularA[contactIndicesUsed[2]].Y * lambda3.Z;\n                            angularImpulse.Z = angularA[contactIndicesUsed[0]].Z * lambda3.X + angularA[contactIndicesUsed[1]].Z * lambda3.Y + angularA[contactIndicesUsed[2]].Z * lambda3.Z;\n                            parentA.ApplyLinearImpulse(ref linearImpulse);\n                            parentA.ApplyAngularImpulse(ref angularImpulse);\n                        }\n                        if (parentB.isDynamic)\n                        {\n                            linearImpulse.X = -linearImpulse.X;\n                            linearImpulse.Y = -linearImpulse.Y;\n                            linearImpulse.Z = -linearImpulse.Z;\n                            angularImpulse.X = angularB[contactIndicesUsed[0]].X * lambda3.X + angularB[contactIndicesUsed[1]].X * lambda3.Y + angularB[contactIndicesUsed[2]].X * lambda3.Z;\n                            angularImpulse.Y = angularB[contactIndicesUsed[0]].Y * lambda3.X + angularB[contactIndicesUsed[1]].Y * lambda3.Y + angularB[contactIndicesUsed[2]].Y * lambda3.Z;\n                            angularImpulse.Z = angularB[contactIndicesUsed[0]].Z * lambda3.X + angularB[contactIndicesUsed[1]].Z * lambda3.Y + angularB[contactIndicesUsed[2]].Z * lambda3.Z;\n                            parentB.ApplyLinearImpulse(ref linearImpulse);\n                            parentB.ApplyAngularImpulse(ref angularImpulse);\n                        }\n                        return;\n                    }\n                    break;\n            }\n            //Note: No accumulated impulses yet.\n\n            //Note: There's no 'sleeping' here.  It's going to be real slow.\n            //foreach (Contact c in pair.contacts)\n            //{\n            //    c.penetrationConstraint.applyImpulse();\n            //}\n        }\n\n        internal void PreStep(float dt)\n        {\n            parentA = pair.ParentA;\n            parentB = pair.ParentB;\n            contactCount = pair.Contacts.Count;\n\n            if (contactCount > 0)\n            {\n                //Populate the jacobian\n                linear = pair.Contacts[0].Normal;\n                for (int i = 0; i < contactCount; i++)\n                {\n                    angularA[i] = new Vector3(pair.Contacts[i].penetrationConstraint.angularAX, pair.Contacts[i].penetrationConstraint.angularAY, pair.Contacts[i].penetrationConstraint.angularAZ);\n                    angularB[i] = new Vector3(pair.Contacts[i].penetrationConstraint.angularBX, pair.Contacts[i].penetrationConstraint.angularBY, pair.Contacts[i].penetrationConstraint.angularBZ);\n                    //TODO: Penetration constraint calculates the diagonal entries already.\n                    //Could also cache out the angular[i] * I^-1 part, which would then speed up mass matrix calculation.\n                    //massMatrixInverse[i][i] = pair.contacts[0].penetrationConstraint.velocityToImpulse;\n                }\n            }\n            contactIndicesUsed.Clear();\n            switch (contactCount)\n            {\n                case 4:\n\n                    //Create the effective mass matrix\n                    //Could optimize this since the penetration constraints need to compute the diagonal anyway.\n                    //Also, it does a lot of unnecessary 1/mass calculations.\n\n                    Matrix inverse;\n                    if (Get4X4MassMatrix(out inverse, out velocityToImpulse))\n                    {\n                        //The 4x4 version is acceptable.\n                        contactIndicesUsed.Add(0);\n                        contactIndicesUsed.Add(1);\n                        contactIndicesUsed.Add(2);\n                        contactIndicesUsed.Add(3);\n                    }\n                        //TODO: Okay, this is a 'bad matrix' even in the ideal 4 point manifold situation.  Is this to be expected, or is the above mass matrix entry calculation screwed up?\n                        //Yea.\n                        //J * M^-1 * JT could be singular in the case of redundant contacts.  Pretest? Gramian, condition number..\n\n                    else\n                    {\n                        Matrix3x3 inverse3X3;\n                        if (Get3X3InverseMassMatrix(1, 2, 3, out inverse3X3, out velocityToImpulse3X3))\n                        {\n                            contactIndicesUsed.Add(1);\n                            contactIndicesUsed.Add(2);\n                            contactIndicesUsed.Add(3);\n                        }\n                        else if (Get3X3InverseMassMatrix(0, 2, 3, out inverse3X3, out velocityToImpulse3X3))\n                        {\n                            contactIndicesUsed.Add(0);\n                            contactIndicesUsed.Add(2);\n                            contactIndicesUsed.Add(3);\n                        }\n                        else if (Get3X3InverseMassMatrix(0, 1, 3, out inverse3X3, out velocityToImpulse3X3))\n                        {\n                            contactIndicesUsed.Add(0);\n                            contactIndicesUsed.Add(1);\n                            contactIndicesUsed.Add(3);\n                        }\n                        else if (Get3X3InverseMassMatrix(0, 1, 2, out inverse3X3, out velocityToImpulse3X3))\n                        {\n                            contactIndicesUsed.Add(0);\n                            contactIndicesUsed.Add(1);\n                            contactIndicesUsed.Add(2);\n                        }\n                    }\n\n                    break;\n                case 3:\n\n                    break;\n            }\n        }\n\n\n        private bool Get2X2InverseMassMatrix(int indexA, int indexB, out Matrix2X2 massMatrix)\n        {\n            massMatrix.M11 = GetMassMatrixEntry(indexA, indexA);\n            massMatrix.M12 = GetMassMatrixEntry(indexA, indexB);\n\n            massMatrix.M21 = massMatrix.M12; // getMassMatrixEntry(indexB, indexA);\n            massMatrix.M22 = GetMassMatrixEntry(indexB, indexB);\n\n            return ComputeNorm(ref massMatrix) < ConditionNumberLimit;\n        }\n\n        private bool Get3X3InverseMassMatrix(int indexA, int indexB, int indexC, out Matrix3x3 inverseMassMatrix, out Matrix3x3 massMatrix)\n        {\n            inverseMassMatrix.M11 = GetMassMatrixEntry(indexA, indexA);\n            inverseMassMatrix.M12 = GetMassMatrixEntry(indexA, indexB);\n            inverseMassMatrix.M13 = GetMassMatrixEntry(indexA, indexC);\n\n            inverseMassMatrix.M21 = inverseMassMatrix.M12; // getMassMatrixEntry(indexB, indexA);\n            inverseMassMatrix.M22 = GetMassMatrixEntry(indexB, indexB);\n            inverseMassMatrix.M23 = GetMassMatrixEntry(indexB, indexC);\n\n            inverseMassMatrix.M31 = inverseMassMatrix.M13; // getMassMatrixEntry(indexC, indexA);\n            inverseMassMatrix.M32 = inverseMassMatrix.M23; // getMassMatrixEntry(indexC, indexB);\n            inverseMassMatrix.M33 = GetMassMatrixEntry(indexC, indexC);\n\n            Matrix3x3.Invert(ref inverseMassMatrix, out massMatrix);\n\n            return ComputeNorm(ref inverseMassMatrix) * ComputeNorm(ref massMatrix) < ConditionNumberLimit;\n        }\n\n        private bool Get4X4MassMatrix(out Matrix inverseMassMatrix, out Matrix massMatrix)\n        {\n#if !WINDOWS\n            inverseMassMatrix = new Matrix();\n#endif\n            inverseMassMatrix.M11 = GetMassMatrixEntry(0, 0);\n            inverseMassMatrix.M12 = GetMassMatrixEntry(0, 1);\n            inverseMassMatrix.M13 = GetMassMatrixEntry(0, 2);\n            inverseMassMatrix.M14 = GetMassMatrixEntry(0, 3);\n\n            inverseMassMatrix.M21 = inverseMassMatrix.M12; // getMassMatrixEntry(1, 0);\n            inverseMassMatrix.M22 = GetMassMatrixEntry(1, 1);\n            inverseMassMatrix.M23 = GetMassMatrixEntry(1, 2);\n            inverseMassMatrix.M24 = GetMassMatrixEntry(1, 3);\n\n            inverseMassMatrix.M31 = inverseMassMatrix.M13; // getMassMatrixEntry(2, 0);\n            inverseMassMatrix.M32 = inverseMassMatrix.M23; // getMassMatrixEntry(2, 1);\n            inverseMassMatrix.M33 = GetMassMatrixEntry(2, 2);\n            inverseMassMatrix.M34 = GetMassMatrixEntry(2, 3);\n\n            inverseMassMatrix.M41 = inverseMassMatrix.M14; // getMassMatrixEntry(3, 0);\n            inverseMassMatrix.M42 = inverseMassMatrix.M24; // getMassMatrixEntry(3, 1);\n            inverseMassMatrix.M43 = inverseMassMatrix.M34; // getMassMatrixEntry(3, 2);\n            inverseMassMatrix.M44 = GetMassMatrixEntry(3, 3);\n\n            Matrix.Invert(ref inverseMassMatrix, out massMatrix);\n\n            return ComputeNorm(ref inverseMassMatrix) * ComputeNorm(ref massMatrix) < ConditionNumberLimit;\n        }\n\n        //TODO: DON'T JUST ADD 1/MASS!!!!!! look at Point on Line Joint formulation redux for more information\n        //TODO: ON the other hand, uhh.. normal * normal is always 1 no matter how you look at it.  LOOK AT IT MORE\n\n        private float GetMassMatrixEntry(int i, int j)\n        {\n            //This is wasteful; there are 4 angular jacobians for each entity in 4x4 case.\n            //Even with the reduced 10-element only mass matrix calculation, there is significant\n            //retransforming going on.\n            //Re-used values:\n            //A[0] * Ia^-1\n            //A[1] * Ia^-1\n            //A[2] * Ia^-1\n            //A[3] * Ia^-1\n            //B[0] * Ib^-1\n            //B[1] * Ib^-1\n            //B[2] * Ib^-1\n            //B[3] * Ib^-1\n            //A, B inverse mass\n            //The waste gets more wastey when the 4x4 fails and it has to do even more calculations...\n            //In fact, the matrix entries themselves are redundant.\n            //Can construct smaller matrices from bigger matrices????? Maybe...\n            //Since getMassMatrixEntry is the same for 1x1, 2x2, 3x3, and 4x4 versions (1 2 3 4 contacts)...\n            //me^-1 i,j is unique based on i,j alone!!!\n            //Compute \"max size matrix\" and derive smaller ones directly from it :)))\n            //Technically only the inverse mass matrix shares entries.  Post inversion to mass matrix, they will be different.\n            float entryA, entryB;\n            Vector3 transform;\n            if (parentA.isDynamic)\n            {\n                Matrix3x3.Transform(ref angularA[i], ref parentA.inertiaTensorInverse, out transform);\n                Vector3.Dot(ref angularA[j], ref transform, out entryA);\n                entryA += 1 / parentA.mass;\n            }\n            else\n                entryA = 0;\n\n            if (parentB.isDynamic)\n            {\n                Matrix3x3.Transform(ref angularB[i], ref parentB.inertiaTensorInverse, out transform);\n                Vector3.Dot(ref angularB[j], ref transform, out entryB);\n                entryB += 1 / parentB.mass;\n            }\n            else\n                entryB = 0;\n\n            return entryA + entryB;\n        }\n\n        private float GetRelativeVelocity(int i)\n        {\n            float relativeVelocity, dot;\n            Vector3.Dot(ref linear, ref parentA.linearVelocity, out relativeVelocity);\n            Vector3.Dot(ref angularA[i], ref parentA.angularVelocity, out dot);\n            relativeVelocity += dot;\n            Vector3.Dot(ref linear, ref parentB.linearVelocity, out dot);\n            relativeVelocity -= dot;\n            Vector3.Dot(ref angularB[i], ref parentB.angularVelocity, out dot);\n            return relativeVelocity + dot;\n        }\n\n        private float GetSimulatedRelativeVelocity(int i, ref Vector3 linearVelocityA, ref Vector3 linearVelocityB, ref Vector3 angularVelocityA, ref Vector3 angularVelocityB)\n        {\n            float relativeVelocity, dot;\n            Vector3.Dot(ref linear, ref linearVelocityA, out relativeVelocity);\n            Vector3.Dot(ref angularA[i], ref angularVelocityA, out dot);\n            relativeVelocity += dot;\n            Vector3.Dot(ref linear, ref linearVelocityB, out dot);\n            relativeVelocity -= dot;\n            Vector3.Dot(ref angularB[i], ref angularVelocityB, out dot);\n            return relativeVelocity + dot;\n        }\n\n        #region Norms\n\n        private static float ComputeNorm(ref Matrix m)\n        {\n            //Would a square-based norm be faster and sufficient ?\n            //Huge number of branches in this\n            float norm = MathHelper.Max(Math.Abs(m.M11), Math.Abs(m.M12));\n            norm = MathHelper.Max(norm, Math.Abs(m.M13));\n            norm = MathHelper.Max(norm, Math.Abs(m.M14));\n\n            norm = MathHelper.Max(norm, Math.Abs(m.M21));\n            norm = MathHelper.Max(norm, Math.Abs(m.M22));\n            norm = MathHelper.Max(norm, Math.Abs(m.M23));\n            norm = MathHelper.Max(norm, Math.Abs(m.M24));\n\n            norm = MathHelper.Max(norm, Math.Abs(m.M31));\n            norm = MathHelper.Max(norm, Math.Abs(m.M32));\n            norm = MathHelper.Max(norm, Math.Abs(m.M33));\n            norm = MathHelper.Max(norm, Math.Abs(m.M34));\n\n            norm = MathHelper.Max(norm, Math.Abs(m.M41));\n            norm = MathHelper.Max(norm, Math.Abs(m.M42));\n            norm = MathHelper.Max(norm, Math.Abs(m.M43));\n            norm = MathHelper.Max(norm, Math.Abs(m.M44));\n\n            return norm;\n        }\n\n        private static float ComputeNorm(ref Matrix3x3 m)\n        {\n            //Would a square-based norm be faster and sufficient ?\n            //Huge number of branches in this\n            float norm = MathHelper.Max(Math.Abs(m.M11), Math.Abs(m.M12));\n            norm = MathHelper.Max(norm, Math.Abs(m.M13));\n\n            norm = MathHelper.Max(norm, Math.Abs(m.M21));\n            norm = MathHelper.Max(norm, Math.Abs(m.M22));\n            norm = MathHelper.Max(norm, Math.Abs(m.M23));\n\n            norm = MathHelper.Max(norm, Math.Abs(m.M31));\n            norm = MathHelper.Max(norm, Math.Abs(m.M32));\n            norm = MathHelper.Max(norm, Math.Abs(m.M33));\n\n            return norm;\n        }\n\n        private static float ComputeNorm(ref Matrix2X2 m)\n        {\n            //Would a square-based norm be faster and sufficient ?\n            //Huge number of branches in this\n            float norm = MathHelper.Max(Math.Abs(m.M11), Math.Abs(m.M12));\n\n            norm = MathHelper.Max(norm, Math.Abs(m.M21));\n            norm = MathHelper.Max(norm, Math.Abs(m.M22));\n\n            return norm;\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/Testing/SlidingFrictionOneAxisConstraint.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints\n{\n    /// <summary>\n    /// Handles collision pair sliding friction.\n    /// </summary>\n    internal class SlidingFrictionOneAxisConstraint\n    {\n        private readonly CollisionPair pair;\n        private float accumulatedImpulse;\n\n        //Jacobian entries\n        //float linearBX, linearBY, linearBZ;\n        private float angularAX, angularAY, angularAZ;\n        private float angularBX, angularBY, angularBZ;\n        internal bool isActive = true;\n        private float linearAX, linearAY, linearAZ;\n        private float maximumFrictionForce;\n        internal int numIterationsAtZeroImpulse;\n        private Entity parentA, parentB;\n\n        //Inverse effective mass matrix\n        private float velocityToImpulse;\n\n        /// <summary>\n        /// Constructs a new linear friction constraint.\n        /// </summary>\n        /// <param name=\"pair\">Collision pair owning this friction constraint.</param>\n        internal SlidingFrictionOneAxisConstraint(CollisionPair pair)\n        {\n            this.pair = pair;\n        }\n\n\n        internal float ApplyImpulse()\n        {\n            //Compute relative velocity\n            float lambda = (parentA.linearVelocity.X * linearAX + parentA.linearVelocity.Y * linearAY + parentA.linearVelocity.Z * linearAZ +\n                            parentA.angularVelocity.X * angularAX + parentA.angularVelocity.Y * angularAY + parentA.angularVelocity.Z * angularAZ -\n                            //note negatives, since reusing linearA jacobian entry\n                            parentB.linearVelocity.X * linearAX - parentB.linearVelocity.Y * linearAY - parentB.linearVelocity.Z * linearAZ +\n                            parentB.angularVelocity.X * angularBX + parentB.angularVelocity.Y * angularBY + parentB.angularVelocity.Z * angularBZ)\n                           * velocityToImpulse; //convert to impulse\n\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse + lambda, -maximumFrictionForce, maximumFrictionForce); //instead of maximumFrictionForce, could recompute each iteration...\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = lambda * linearAX;\n            linear.Y = lambda * linearAY;\n            linear.Z = lambda * linearAZ;\n            if (parentA.isDynamic)\n            {\n                angular.X = lambda * angularAX;\n                angular.Y = lambda * angularAY;\n                angular.Z = lambda * angularAZ;\n                parentA.ApplyLinearImpulse(ref linear);\n                parentA.ApplyAngularImpulse(ref angular);\n            }\n            if (parentB.isDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = lambda * angularBX;\n                angular.Y = lambda * angularBY;\n                angular.Z = lambda * angularBZ;\n                parentB.ApplyLinearImpulse(ref linear);\n                parentB.ApplyAngularImpulse(ref angular);\n            }\n\n            return lambda;\n        }\n\n        /// <summary>\n        /// Initializes the constraint for this frame.\n        /// </summary>\n        /// <param name=\"dt\">Time since the last frame.</param>\n        /// <param name=\"manifoldCenter\">Computed center of manifold.</param>\n        internal void PreStep(float dt, out Vector3 manifoldCenter)\n        {\n            parentA = pair.ParentA;\n            parentB = pair.ParentB;\n\n            int count = pair.Contacts.Count;\n            switch (count)\n            {\n                case 1:\n                    manifoldCenter = pair.Contacts[0].Position;\n                    break;\n                case 2:\n                    Vector3.Add(ref pair.Contacts[0].Position, ref pair.Contacts[1].Position, out manifoldCenter);\n                    manifoldCenter.X *= .5f;\n                    manifoldCenter.Y *= .5f;\n                    manifoldCenter.Z *= .5f;\n                    break;\n                case 3:\n                    Vector3.Add(ref pair.Contacts[0].Position, ref pair.Contacts[1].Position, out manifoldCenter);\n                    Vector3.Add(ref pair.Contacts[2].Position, ref manifoldCenter, out manifoldCenter);\n                    manifoldCenter.X *= .333333333f;\n                    manifoldCenter.Y *= .333333333f;\n                    manifoldCenter.Z *= .333333333f;\n                    break;\n                case 4:\n                    //This isn't actually the center of the manifold.  Is it good enough?\n                    Vector3.Add(ref pair.Contacts[0].Position, ref pair.Contacts[1].Position, out manifoldCenter);\n                    Vector3.Add(ref pair.Contacts[2].Position, ref manifoldCenter, out manifoldCenter);\n                    Vector3.Add(ref pair.Contacts[3].Position, ref manifoldCenter, out manifoldCenter);\n                    manifoldCenter.X *= .25f;\n                    manifoldCenter.Y *= .25f;\n                    manifoldCenter.Z *= .25f;\n                    break;\n                default:\n                    manifoldCenter = Toolbox.NoVector;\n                    break;\n            }\n\n            //Compute the three dimensional relative velocity at the point.\n            Vector3 ra, rb;\n            Vector3.Subtract(ref manifoldCenter, ref parentA.position, out ra);\n            Vector3.Subtract(ref manifoldCenter, ref parentB.position, out rb);\n\n            Vector3 velocityA, velocityB;\n            Vector3.Cross(ref parentA.angularVelocity, ref ra, out velocityA);\n            Vector3.Add(ref velocityA, ref parentA.linearVelocity, out velocityA);\n\n            Vector3.Cross(ref parentB.angularVelocity, ref rb, out velocityB);\n            Vector3.Add(ref velocityB, ref parentB.linearVelocity, out velocityB);\n\n            Vector3 relativeVelocity;\n            Vector3.Subtract(ref velocityA, ref velocityB, out relativeVelocity);\n\n            //Get rid of the normal velocity.\n            Vector3 normal = pair.Contacts[0].Normal;\n            float normalVelocityScalar = normal.X * relativeVelocity.X + normal.Y * relativeVelocity.Y + normal.Z * relativeVelocity.Z;\n            relativeVelocity.X -= normalVelocityScalar * normal.X;\n            relativeVelocity.Y -= normalVelocityScalar * normal.Y;\n            relativeVelocity.Z -= normalVelocityScalar * normal.Z;\n\n            float friction;\n            //Create the jacobian entry and decide the friction coefficient.\n            float length = relativeVelocity.LengthSquared();\n            if (length > Toolbox.Epsilon)\n            {\n                length = (float) Math.Sqrt(length);\n                linearAX = relativeVelocity.X / length;\n                linearAY = relativeVelocity.Y / length;\n                linearAZ = relativeVelocity.Z / length;\n\n                friction = length > pair.space.simulationSettings.CollisionResponse.StaticFrictionVelocityThreshold ? pair.DynamicFriction : pair.StaticFriction;\n            }\n            else\n            {\n                //If there's no velocity, there's no jacobian.  Give up.\n                //This is 'fast' in that it will early out on essentially resting objects,\n                //but it may introduce instability.\n                //If it doesn't look good, try the next approach.\n                //isActive = false;\n                //return;\n\n                //if the above doesn't work well, try using the previous frame's jacobian.\n                if (linearAX != 0 || linearAY != 0 || linearAZ != 0)\n                {\n                    friction = pair.StaticFriction;\n                }\n                else\n                {\n                    //Can't really do anything here, give up.\n                    isActive = false;\n                    return;\n                }\n            }\n\n            maximumFrictionForce = 0;\n            for (int i = 0; i < count; i++)\n            {\n                maximumFrictionForce += pair.Contacts[i].penetrationConstraint.accumulatedImpulse;\n            }\n            maximumFrictionForce *= friction;\n\n            //angular A = Ra x N\n            angularAX = (ra.Y * linearAZ) - (ra.Z * linearAY);\n            angularAY = (ra.Z * linearAX) - (ra.X * linearAZ);\n            angularAZ = (ra.X * linearAY) - (ra.Y * linearAX);\n\n            //Angular B = N x Rb\n            angularBX = (linearAY * rb.Z) - (linearAZ * rb.Y);\n            angularBY = (linearAZ * rb.X) - (linearAX * rb.Z);\n            angularBZ = (linearAX * rb.Y) - (linearAY * rb.X);\n\n            //Compute inverse effective mass matrix\n            float entryA, entryB;\n\n            //these are the transformed coordinates\n            float tX, tY, tZ;\n            if (parentA.isDynamic)\n            {\n                tX = angularAX * parentA.inertiaTensorInverse.M11 + angularAY * parentA.inertiaTensorInverse.M21 + angularAZ * parentA.inertiaTensorInverse.M31;\n                tY = angularAX * parentA.inertiaTensorInverse.M12 + angularAY * parentA.inertiaTensorInverse.M22 + angularAZ * parentA.inertiaTensorInverse.M32;\n                tZ = angularAX * parentA.inertiaTensorInverse.M13 + angularAY * parentA.inertiaTensorInverse.M23 + angularAZ * parentA.inertiaTensorInverse.M33;\n                entryA = tX * angularAX + tY * angularAY + tZ * angularAZ + 1 / parentA.mass;\n            }\n            else\n                entryA = 0;\n\n            if (parentB.isDynamic)\n            {\n                tX = angularBX * parentB.inertiaTensorInverse.M11 + angularBY * parentB.inertiaTensorInverse.M21 + angularBZ * parentB.inertiaTensorInverse.M31;\n                tY = angularBX * parentB.inertiaTensorInverse.M12 + angularBY * parentB.inertiaTensorInverse.M22 + angularBZ * parentB.inertiaTensorInverse.M32;\n                tZ = angularBX * parentB.inertiaTensorInverse.M13 + angularBY * parentB.inertiaTensorInverse.M23 + angularBZ * parentB.inertiaTensorInverse.M33;\n                entryB = tX * angularBX + tY * angularBY + tZ * angularBZ + 1 / parentB.mass;\n            }\n            else\n                entryB = 0;\n\n            velocityToImpulse = -1 / (entryA + entryB); //Softness?\n\n\n            //Warm starting\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = accumulatedImpulse * linearAX;\n            linear.Y = accumulatedImpulse * linearAY;\n            linear.Z = accumulatedImpulse * linearAZ;\n            if (parentA.isDynamic)\n            {\n                angular.X = accumulatedImpulse * angularAX;\n                angular.Y = accumulatedImpulse * angularAY;\n                angular.Z = accumulatedImpulse * angularAZ;\n                parentA.ApplyLinearImpulse(ref linear);\n                parentA.ApplyAngularImpulse(ref angular);\n            }\n            if (parentB.isDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = accumulatedImpulse * angularBX;\n                angular.Y = accumulatedImpulse * angularBY;\n                angular.Z = accumulatedImpulse * angularBZ;\n                parentB.ApplyLinearImpulse(ref linear);\n                parentB.ApplyAngularImpulse(ref angular);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/Testing/SlidingFrictionTwoAxisObsolete.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints\n{\n    /// <summary>\n    /// Handles collision pair sliding friction.\n    /// </summary>\n    internal class SlidingFrictionTwoAxisObsolete\n    {\n        private readonly CollisionPair pair;\n        private float accumulatedImpulse;\n        private float accumulatedImpulse2;\n\n        //Jacobian entries\n        //float linearBX, linearBY, linearBZ;\n        private float angularAX;\n        private float angularAX2;\n        private float angularAY;\n        private float angularAY2;\n        private float angularAZ;\n        private float angularAZ2;\n        private float angularBX;\n        private float angularBX2;\n        private float angularBY;\n        private float angularBY2;\n        private float angularBZ;\n        private float angularBZ2;\n        private int contactCount;\n        private float friction;\n        internal bool isActive = true;\n        private float linearAX;\n        private float linearAX2;\n        private float linearAY;\n        private float linearAY2;\n        private float linearAZ;\n        private float linearAZ2;\n        /*\n                private float maximumFrictionForce;\n        */\n        internal int numIterationsAtZeroImpulse;\n        private Entity parentA, parentB;\n\n        //Inverse effective mass matrix\n        private float velocityToImpulse;\n        private float velocityToImpulse2;\n\n        /// <summary>\n        /// Constructs a new linear friction constraint.\n        /// </summary>\n        /// <param name=\"pair\">Collision pair owning this friction constraint.</param>\n        internal SlidingFrictionTwoAxisObsolete(CollisionPair pair)\n        {\n            this.pair = pair;\n        }\n\n\n        internal float ApplyImpulse()\n        {\n            //Compute relative velocity\n            float lambda = (parentA.linearVelocity.X * linearAX + parentA.linearVelocity.Y * linearAY + parentA.linearVelocity.Z * linearAZ +\n                            parentA.angularVelocity.X * angularAX + parentA.angularVelocity.Y * angularAY + parentA.angularVelocity.Z * angularAZ -\n                            //note negatives, since reusing linearA jacobian entry\n                            parentB.linearVelocity.X * linearAX - parentB.linearVelocity.Y * linearAY - parentB.linearVelocity.Z * linearAZ +\n                            parentB.angularVelocity.X * angularBX + parentB.angularVelocity.Y * angularBY + parentB.angularVelocity.Z * angularBZ)\n                           * velocityToImpulse; //convert to impulse\n\n            //Compute maximum force\n            float maximumFrictionForce = 0;\n            for (int i = 0; i < contactCount; i++)\n            {\n                maximumFrictionForce += pair.Contacts[i].penetrationConstraint.accumulatedImpulse;\n            }\n            maximumFrictionForce *= friction;\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse + lambda, -maximumFrictionForce, maximumFrictionForce); //instead of maximumFrictionForce, could recompute each iteration...\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = lambda * linearAX;\n            linear.Y = lambda * linearAY;\n            linear.Z = lambda * linearAZ;\n            if (parentA.isDynamic)\n            {\n                angular.X = lambda * angularAX;\n                angular.Y = lambda * angularAY;\n                angular.Z = lambda * angularAZ;\n                parentA.ApplyLinearImpulse(ref linear);\n                parentA.ApplyAngularImpulse(ref angular);\n            }\n            if (parentB.isDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = lambda * angularBX;\n                angular.Y = lambda * angularBY;\n                angular.Z = lambda * angularBZ;\n                parentB.ApplyLinearImpulse(ref linear);\n                parentB.ApplyAngularImpulse(ref angular);\n            }\n\n            //Compute relative velocity\n            float lambda2 = (parentA.linearVelocity.X * linearAX2 + parentA.linearVelocity.Y * linearAY2 + parentA.linearVelocity.Z * linearAZ2 +\n                             parentA.angularVelocity.X * angularAX2 + parentA.angularVelocity.Y * angularAY2 + parentA.angularVelocity.Z * angularAZ2 -\n                             //note negatives, since reusing linearA jacobian entry\n                             parentB.linearVelocity.X * linearAX2 - parentB.linearVelocity.Y * linearAY2 - parentB.linearVelocity.Z * linearAZ2 +\n                             parentB.angularVelocity.X * angularBX2 + parentB.angularVelocity.Y * angularBY2 + parentB.angularVelocity.Z * angularBZ2)\n                            * velocityToImpulse2; //convert to impulse\n\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse2 = accumulatedImpulse2;\n            accumulatedImpulse2 = MathHelper.Clamp(accumulatedImpulse2 + lambda2, -maximumFrictionForce, maximumFrictionForce); //instead of maximumFrictionForce, could recompute each iteration...\n            lambda2 = accumulatedImpulse2 - previousAccumulatedImpulse2;\n\n            //Apply the impulse\n            linear.X = lambda2 * linearAX2;\n            linear.Y = lambda2 * linearAY2;\n            linear.Z = lambda2 * linearAZ2;\n            if (parentA.isDynamic)\n            {\n                angular.X = lambda2 * angularAX2;\n                angular.Y = lambda2 * angularAY2;\n                angular.Z = lambda2 * angularAZ2;\n                parentA.ApplyLinearImpulse(ref linear);\n                parentA.ApplyAngularImpulse(ref angular);\n            }\n            if (parentB.isDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = lambda2 * angularBX2;\n                angular.Y = lambda2 * angularBY2;\n                angular.Z = lambda2 * angularBZ2;\n                parentB.ApplyLinearImpulse(ref linear);\n                parentB.ApplyAngularImpulse(ref angular);\n            }\n\n            return lambda;\n        }\n\n        /// <summary>\n        /// Initializes the constraint for this frame.\n        /// </summary>\n        /// <param name=\"dt\">Time since the last frame.</param>\n        /// <param name=\"manifoldCenter\">Computed center of manifold.</param>\n        internal void PreStep(float dt, out Vector3 manifoldCenter)\n        {\n            numIterationsAtZeroImpulse = 0;\n            parentA = pair.ParentA;\n            parentB = pair.ParentB;\n\n            contactCount = pair.Contacts.Count;\n            switch (contactCount)\n            {\n                case 1:\n                    manifoldCenter = pair.Contacts[0].Position;\n                    break;\n                case 2:\n                    Vector3.Add(ref pair.Contacts[0].Position, ref pair.Contacts[1].Position, out manifoldCenter);\n                    manifoldCenter.X *= .5f;\n                    manifoldCenter.Y *= .5f;\n                    manifoldCenter.Z *= .5f;\n                    break;\n                case 3:\n                    Vector3.Add(ref pair.Contacts[0].Position, ref pair.Contacts[1].Position, out manifoldCenter);\n                    Vector3.Add(ref pair.Contacts[2].Position, ref manifoldCenter, out manifoldCenter);\n                    manifoldCenter.X *= .333333333f;\n                    manifoldCenter.Y *= .333333333f;\n                    manifoldCenter.Z *= .333333333f;\n                    break;\n                case 4:\n                    //This isn't actually the center of the manifold.  Is it good enough?\n                    Vector3.Add(ref pair.Contacts[0].Position, ref pair.Contacts[1].Position, out manifoldCenter);\n                    Vector3.Add(ref pair.Contacts[2].Position, ref manifoldCenter, out manifoldCenter);\n                    Vector3.Add(ref pair.Contacts[3].Position, ref manifoldCenter, out manifoldCenter);\n                    manifoldCenter.X *= .25f;\n                    manifoldCenter.Y *= .25f;\n                    manifoldCenter.Z *= .25f;\n                    break;\n                default:\n                    manifoldCenter = Toolbox.NoVector;\n                    break;\n            }\n\n            //Compute the three dimensional relative velocity at the point.\n            Vector3 ra;\n            Vector3 rb;\n            Vector3.Subtract(ref manifoldCenter, ref parentA.position, out ra);\n            Vector3.Subtract(ref manifoldCenter, ref parentB.position, out rb);\n\n            Vector3 velocityA, velocityB;\n            Vector3.Cross(ref parentA.angularVelocity, ref ra, out velocityA);\n            Vector3.Add(ref velocityA, ref parentA.linearVelocity, out velocityA);\n\n            Vector3.Cross(ref parentB.angularVelocity, ref rb, out velocityB);\n            Vector3.Add(ref velocityB, ref parentB.linearVelocity, out velocityB);\n\n            Vector3 relativeVelocity;\n            Vector3.Subtract(ref velocityA, ref velocityB, out relativeVelocity);\n\n            //Get rid of the normal velocity.\n            Vector3 normal = pair.Contacts[0].Normal;\n            float normalVelocityScalar = normal.X * relativeVelocity.X + normal.Y * relativeVelocity.Y + normal.Z * relativeVelocity.Z;\n            relativeVelocity.X -= normalVelocityScalar * normal.X;\n            relativeVelocity.Y -= normalVelocityScalar * normal.Y;\n            relativeVelocity.Z -= normalVelocityScalar * normal.Z;\n\n            //Create the jacobian entry and decide the friction coefficient.\n            float length = relativeVelocity.LengthSquared();\n            if (length > Toolbox.Epsilon)\n            {\n                length = (float) Math.Sqrt(length);\n                linearAX = relativeVelocity.X / length;\n                linearAY = relativeVelocity.Y / length;\n                linearAZ = relativeVelocity.Z / length;\n\n                friction = length > pair.space.simulationSettings.CollisionResponse.StaticFrictionVelocityThreshold ? pair.DynamicFriction : pair.StaticFriction;\n            }\n            else\n            {\n                //If there's no velocity, there's no jacobian.  Give up.\n                //This is 'fast' in that it will early out on essentially resting objects,\n                //but it may introduce instability.\n                //If it doesn't look good, try the next approach.\n                //isActive = false;\n                //return;\n\n                //if the above doesn't work well, try using the previous frame's jacobian.\n                if (linearAX != 0 || linearAY != 0 || linearAZ != 0)\n                {\n                    friction = pair.StaticFriction;\n                }\n                else\n                {\n                    //Can't really do anything here, give up.\n                    isActive = false;\n                    return;\n                }\n            }\n\n            //maximumFrictionForce = 0;\n            //for (int i = 0; i < count; i++)\n            //{\n            //    maximumFrictionForce += pair.contacts[i].penetrationConstraint.accumulatedImpulse;\n            //}\n            //maximumFrictionForce *= friction;\n\n            //linear axis 2 = normal x N\n            linearAX2 = (normal.Y * linearAZ) - (normal.Z * linearAY);\n            linearAY2 = (normal.Z * linearAX) - (normal.X * linearAZ);\n            linearAZ2 = (normal.X * linearAY) - (normal.Y * linearAX);\n\n            //angular A = Ra x N\n            angularAX = (ra.Y * linearAZ) - (ra.Z * linearAY);\n            angularAY = (ra.Z * linearAX) - (ra.X * linearAZ);\n            angularAZ = (ra.X * linearAY) - (ra.Y * linearAX);\n\n            //angular A 2 = Ra x linear axis 2\n            angularAX2 = (ra.Y * linearAZ2) - (ra.Z * linearAY2);\n            angularAY2 = (ra.Z * linearAX2) - (ra.X * linearAZ2);\n            angularAZ2 = (ra.X * linearAY2) - (ra.Y * linearAX2);\n\n            //Angular B = N x Rb\n            angularBX = (linearAY * rb.Z) - (linearAZ * rb.Y);\n            angularBY = (linearAZ * rb.X) - (linearAX * rb.Z);\n            angularBZ = (linearAX * rb.Y) - (linearAY * rb.X);\n\n            //Angular B 2 = linear axis 2 x Rb\n            angularBX2 = (linearAY2 * rb.Z) - (linearAZ2 * rb.Y);\n            angularBY2 = (linearAZ2 * rb.X) - (linearAX2 * rb.Z);\n            angularBZ2 = (linearAX2 * rb.Y) - (linearAY2 * rb.X);\n\n            //Compute inverse effective mass matrix\n            float entryA, entryB;\n            float entryA2, entryB2;\n\n            //these are the transformed coordinates\n            float tX, tY, tZ;\n            float tX2, tY2, tZ2;\n            if (parentA.isDynamic)\n            {\n                tX = angularAX * parentA.inertiaTensorInverse.M11 + angularAY * parentA.inertiaTensorInverse.M21 + angularAZ * parentA.inertiaTensorInverse.M31;\n                tY = angularAX * parentA.inertiaTensorInverse.M12 + angularAY * parentA.inertiaTensorInverse.M22 + angularAZ * parentA.inertiaTensorInverse.M32;\n                tZ = angularAX * parentA.inertiaTensorInverse.M13 + angularAY * parentA.inertiaTensorInverse.M23 + angularAZ * parentA.inertiaTensorInverse.M33;\n                entryA = tX * angularAX + tY * angularAY + tZ * angularAZ + 1 / parentA.mass;\n\n                tX2 = angularAX2 * parentA.inertiaTensorInverse.M11 + angularAY2 * parentA.inertiaTensorInverse.M21 + angularAZ2 * parentA.inertiaTensorInverse.M31;\n                tY2 = angularAX2 * parentA.inertiaTensorInverse.M12 + angularAY2 * parentA.inertiaTensorInverse.M22 + angularAZ2 * parentA.inertiaTensorInverse.M32;\n                tZ2 = angularAX2 * parentA.inertiaTensorInverse.M13 + angularAY2 * parentA.inertiaTensorInverse.M23 + angularAZ2 * parentA.inertiaTensorInverse.M33;\n                entryA2 = tX2 * angularAX2 + tY2 * angularAY2 * tZ2 * angularAZ2 + 1 / parentA.mass;\n            }\n            else\n            {\n                entryA = 0;\n                entryA2 = 0;\n            }\n\n            if (parentB.isDynamic)\n            {\n                tX = angularBX * parentB.inertiaTensorInverse.M11 + angularBY * parentB.inertiaTensorInverse.M21 + angularBZ * parentB.inertiaTensorInverse.M31;\n                tY = angularBX * parentB.inertiaTensorInverse.M12 + angularBY * parentB.inertiaTensorInverse.M22 + angularBZ * parentB.inertiaTensorInverse.M32;\n                tZ = angularBX * parentB.inertiaTensorInverse.M13 + angularBY * parentB.inertiaTensorInverse.M23 + angularBZ * parentB.inertiaTensorInverse.M33;\n                entryB = tX * angularBX + tY * angularBY + tZ * angularBZ + 1 / parentB.mass;\n\n                tX2 = angularBX2 * parentB.inertiaTensorInverse.M11 + angularBY2 * parentB.inertiaTensorInverse.M21 + angularBZ2 * parentB.inertiaTensorInverse.M31;\n                tY2 = angularBX2 * parentB.inertiaTensorInverse.M12 + angularBY2 * parentB.inertiaTensorInverse.M22 + angularBZ2 * parentB.inertiaTensorInverse.M32;\n                tZ2 = angularBX2 * parentB.inertiaTensorInverse.M13 + angularBY2 * parentB.inertiaTensorInverse.M23 + angularBZ2 * parentB.inertiaTensorInverse.M33;\n                entryB2 = tX2 * angularBX2 + tY2 * angularBY2 + tZ2 * angularBZ2 + 1 / parentB.mass;\n            }\n            else\n            {\n                entryB = 0;\n                entryB2 = 0;\n            }\n            velocityToImpulse = -1 / (entryA + entryB); //Softness?\n            velocityToImpulse2 = -1 / (entryA2 + entryB2);\n\n\n            //Warm starting\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = accumulatedImpulse * linearAX;\n            linear.Y = accumulatedImpulse * linearAY;\n            linear.Z = accumulatedImpulse * linearAZ;\n            if (parentA.isDynamic)\n            {\n                angular.X = accumulatedImpulse * angularAX;\n                angular.Y = accumulatedImpulse * angularAY;\n                angular.Z = accumulatedImpulse * angularAZ;\n                parentA.ApplyLinearImpulse(ref linear);\n                parentA.ApplyAngularImpulse(ref angular);\n            }\n            if (parentB.isDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = accumulatedImpulse * angularBX;\n                angular.Y = accumulatedImpulse * angularBY;\n                angular.Z = accumulatedImpulse * angularBZ;\n                parentB.ApplyLinearImpulse(ref linear);\n                parentB.ApplyAngularImpulse(ref angular);\n            }\n\n            //Warm starting 2\n            linear.X = accumulatedImpulse2 * linearAX2;\n            linear.Y = accumulatedImpulse2 * linearAY2;\n            linear.Z = accumulatedImpulse2 * linearAZ2;\n            if (parentA.isDynamic)\n            {\n                angular.X = accumulatedImpulse2 * angularAX2;\n                angular.Y = accumulatedImpulse2 * angularAY2;\n                angular.Z = accumulatedImpulse2 * angularAZ2;\n                parentA.ApplyLinearImpulse(ref linear);\n                parentA.ApplyAngularImpulse(ref angular);\n            }\n            if (parentB.isDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = accumulatedImpulse2 * angularBX2;\n                angular.Y = accumulatedImpulse2 * angularBY2;\n                angular.Z = accumulatedImpulse2 * angularBZ2;\n                parentB.ApplyLinearImpulse(ref linear);\n                parentB.ApplyAngularImpulse(ref angular);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/Collision/TwistFrictionConstraint.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUutilities.DataStructures;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Settings;\n\nnamespace BEPUphysics.Constraints.Collision\n{\n    /// <summary>\n    /// Computes the forces necessary to slow down and stop twisting motion in a collision between two entities.\n    /// </summary>\n    public class TwistFrictionConstraint : EntitySolverUpdateable\n    {\n        private readonly float[] leverArms = new float[4];\n        private ConvexContactManifoldConstraint contactManifoldConstraint;\n        ///<summary>\n        /// Gets the contact manifold constraint that owns this constraint.\n        ///</summary>\n        public ConvexContactManifoldConstraint ContactManifoldConstraint { get { return contactManifoldConstraint; } }\n        internal float accumulatedImpulse;\n        private float angularX, angularY, angularZ;\n        private int contactCount;\n        private float friction;\n        Entity entityA, entityB;\n        bool entityADynamic, entityBDynamic;\n        private float velocityToImpulse;\n\n        ///<summary>\n        /// Constructs a new twist friction constraint.\n        ///</summary>\n        public TwistFrictionConstraint()\n        {\n            isActive = false;\n        }\n\n        /// <summary>\n        /// Gets the torque applied by twist friction.\n        /// </summary>\n        public float TotalTorque\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        ///<summary>\n        /// Gets the angular velocity between the associated entities.\n        ///</summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float lambda = 0;\n                if (entityA != null)\n                    lambda = entityA.angularVelocity.X * angularX + entityA.angularVelocity.Y * angularY + entityA.angularVelocity.Z * angularZ;\n                if (entityB != null)\n                    lambda -= entityB.angularVelocity.X * angularX + entityB.angularVelocity.Y * angularY + entityB.angularVelocity.Z * angularZ;\n                return lambda;\n            }\n        }\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n            //Compute relative velocity.  Collisions can occur between an entity and a non-entity.  If it's not an entity, assume it's not moving.\n            float lambda = RelativeVelocity;\n            \n            lambda *= velocityToImpulse; //convert to impulse\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            float maximumFrictionForce = 0;\n            for (int i = 0; i < contactCount; i++)\n            {\n                maximumFrictionForce += leverArms[i] * contactManifoldConstraint.penetrationConstraints.Elements[i].accumulatedImpulse;\n            }\n            maximumFrictionForce *= friction;\n            accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse + lambda, -maximumFrictionForce, maximumFrictionForce); //instead of maximumFrictionForce, could recompute each iteration...\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n\n            //Apply the impulse\n#if !WINDOWS\n            Vector3 angular = new Vector3();\n#else\n            Vector3 angular;\n#endif\n            angular.X = lambda * angularX;\n            angular.Y = lambda * angularY;\n            angular.Z = lambda * angularZ;\n            if (entityADynamic)\n            {\n                entityA.ApplyAngularImpulse(ref angular);\n            }\n            if (entityBDynamic)\n            {\n                angular.X = -angular.X;\n                angular.Y = -angular.Y;\n                angular.Z = -angular.Z;\n                entityB.ApplyAngularImpulse(ref angular);\n            }\n\n\n            return Math.Abs(lambda);\n        }\n\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n\n            entityADynamic = entityA != null && entityA.isDynamic;\n            entityBDynamic = entityB != null && entityB.isDynamic;\n\n            //Compute the jacobian......  Real hard!\n            Vector3 normal = contactManifoldConstraint.penetrationConstraints.Elements[0].contact.Normal;\n            angularX = normal.X;\n            angularY = normal.Y;\n            angularZ = normal.Z;\n\n            //Compute inverse effective mass matrix\n            float entryA, entryB;\n\n            //these are the transformed coordinates\n            float tX, tY, tZ;\n            if (entityADynamic)\n            {\n                tX = angularX * entityA.inertiaTensorInverse.M11 + angularY * entityA.inertiaTensorInverse.M21 + angularZ * entityA.inertiaTensorInverse.M31;\n                tY = angularX * entityA.inertiaTensorInverse.M12 + angularY * entityA.inertiaTensorInverse.M22 + angularZ * entityA.inertiaTensorInverse.M32;\n                tZ = angularX * entityA.inertiaTensorInverse.M13 + angularY * entityA.inertiaTensorInverse.M23 + angularZ * entityA.inertiaTensorInverse.M33;\n                entryA = tX * angularX + tY * angularY + tZ * angularZ + entityA.inverseMass;\n            }\n            else\n                entryA = 0;\n\n            if (entityBDynamic)\n            {\n                tX = angularX * entityB.inertiaTensorInverse.M11 + angularY * entityB.inertiaTensorInverse.M21 + angularZ * entityB.inertiaTensorInverse.M31;\n                tY = angularX * entityB.inertiaTensorInverse.M12 + angularY * entityB.inertiaTensorInverse.M22 + angularZ * entityB.inertiaTensorInverse.M32;\n                tZ = angularX * entityB.inertiaTensorInverse.M13 + angularY * entityB.inertiaTensorInverse.M23 + angularZ * entityB.inertiaTensorInverse.M33;\n                entryB = tX * angularX + tY * angularY + tZ * angularZ + entityB.inverseMass;\n            }\n            else\n                entryB = 0;\n\n            velocityToImpulse = -1 / (entryA + entryB);\n\n\n            //Compute the relative velocity to determine what kind of friction to use\n            float relativeAngularVelocity = RelativeVelocity;\n            //Set up friction and find maximum friction force\n            Vector3 relativeSlidingVelocity = contactManifoldConstraint.SlidingFriction.relativeVelocity;\n            friction = Math.Abs(relativeAngularVelocity) > CollisionResponseSettings.StaticFrictionVelocityThreshold ||\n                       Math.Abs(relativeSlidingVelocity.X) + Math.Abs(relativeSlidingVelocity.Y) + Math.Abs(relativeSlidingVelocity.Z) > CollisionResponseSettings.StaticFrictionVelocityThreshold\n                           ? contactManifoldConstraint.materialInteraction.KineticFriction\n                           : contactManifoldConstraint.materialInteraction.StaticFriction;\n            friction *= CollisionResponseSettings.TwistFrictionFactor;\n\n            contactCount = contactManifoldConstraint.penetrationConstraints.Count;\n\n            Vector3 contactOffset;\n            for (int i = 0; i < contactCount; i++)\n            {\n                Vector3.Subtract(ref contactManifoldConstraint.penetrationConstraints.Elements[i].contact.Position, ref contactManifoldConstraint.SlidingFriction.manifoldCenter, out contactOffset);\n                leverArms[i] = contactOffset.Length();\n            }\n\n\n\n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Apply the warmstarting impulse.\n#if !WINDOWS\n            Vector3 angular = new Vector3();\n#else\n            Vector3 angular;\n#endif\n            angular.X = accumulatedImpulse * angularX;\n            angular.Y = accumulatedImpulse * angularY;\n            angular.Z = accumulatedImpulse * angularZ;\n            if (entityADynamic)\n            {\n                entityA.ApplyAngularImpulse(ref angular);\n            }\n            if (entityBDynamic)\n            {\n                angular.X = -angular.X;\n                angular.Y = -angular.Y;\n                angular.Z = -angular.Z;\n                entityB.ApplyAngularImpulse(ref angular);\n            }\n        }\n\n        internal void Setup(ConvexContactManifoldConstraint contactManifoldConstraint)\n        {\n            this.contactManifoldConstraint = contactManifoldConstraint;\n            isActive = true;\n\n            entityA = contactManifoldConstraint.EntityA;\n            entityB = contactManifoldConstraint.EntityB;\n        }\n\n        internal void CleanUp()\n        {\n            accumulatedImpulse = 0;\n            contactManifoldConstraint = null;\n            entityA = null;\n            entityB = null;\n            isActive = false;\n        }\n\n        protected internal override void CollectInvolvedEntities(RawList<Entity> outputInvolvedEntities)\n        {\n            //This should never really have to be called.\n            if (entityA != null)\n                outputInvolvedEntities.Add(entityA);\n            if (entityB != null)\n                outputInvolvedEntities.Add(entityB);\n        }\n     \n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/EntitySolverUpdateable.cs",
    "content": "using System.Collections.Generic;\nusing BEPUphysics.Constraints.SolverGroups;\nusing BEPUphysics.Entities;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.SolverSystems;\n\nnamespace BEPUphysics.Constraints\n{\n    /// <summary>\n    /// Superclass of objects types which require solving by the velocity solver.\n    /// These are updated within the internal iterative solver when owned by a space.\n    /// </summary>\n    public abstract class EntitySolverUpdateable : SolverUpdateable\n    {\n\n\n\n\n        /// <summary>\n        /// List of all entities affected by this updateable.\n        /// </summary>\n        protected internal readonly RawList<Entity> involvedEntities = new RawList<Entity>(2);\n\n        ///<summary>\n        /// Gets the entities that this solver updateable is involved with.\n        ///</summary>\n        public ReadOnlyList<Entity> InvolvedEntities\n        {\n            get\n            {\n                return new ReadOnlyList<Entity>(involvedEntities);\n            }\n        }\n\n\n\n        /// <summary>\n        /// Number of entities used in the solver updateable.\n        /// Note that this is set automatically by the sortInvolvedEntities method\n        /// if it is called.\n        /// </summary>\n        protected internal int numberOfInvolvedEntities;\n\n\n\n\n        /// <summary>\n        /// Gets the solver group that manages this solver updateable, if any.\n        /// Null if not owned by a solver group.\n        /// </summary>\n        public SolverGroup SolverGroup { get; protected internal set; }\n\n\n        /// <summary>\n        /// Acquires exclusive access to all entities involved in the solver updateable.\n        /// </summary>\n        public override void EnterLock()\n        {\n            for (int i = 0; i < numberOfInvolvedEntities; i++)\n            {\n                if (involvedEntities.Elements[i].isDynamic) //Only need to lock dynamic entities.\n                {\n                    involvedEntities.Elements[i].locker.Enter();\n                    //Monitor.Enter(involvedEntities.Elements[i].locker);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Releases exclusive access to the updateable's entities.\n        /// This should be called within a 'finally' block following a 'try' block containing the locked operations.\n        /// </summary>\n        public override void ExitLock()\n        {\n            for (int i = numberOfInvolvedEntities - 1; i >= 0; i--)\n            {\n                if (involvedEntities.Elements[i].isDynamic) //Only need to lock dynamic entities.\n                    involvedEntities.Elements[i].locker.Exit();\n                //Monitor.Exit(involvedEntities[i].locker);\n            }\n        }\n\n        /// <summary>\n        /// Attempts to acquire exclusive access to all entities involved in the solver updateable.\n        /// </summary>\n        /// <returns>Whether or not the lock was entered successfully.</returns>\n        public override bool TryEnterLock()\n        {\n            for (int i = 0; i < numberOfInvolvedEntities; i++)\n            {\n                if (involvedEntities.Elements[i].isDynamic) //Only need to lock dynamic entities.\n                    if (!involvedEntities.Elements[i].locker.TryEnter())\n                    {\n                        //Turns out we can't take all the resources! Immediately drop everything.\n                        for (i = i - 1 /*failed on the ith element, so start at the previous*/; i >= 0; i--)\n                        {\n                            if (involvedEntities[i].isDynamic)\n                                involvedEntities.Elements[i].locker.Exit();\n                        }\n                        return false;\n                    }\n            }\n            return true;\n\n            //for (int i = 0; i < numberOfInvolvedEntities; i++)\n            //{\n            //    if (involvedEntities[i].isDynamic) //Only need to lock dynamic entities.\n            //        if (!Monitor.TryEnter(involvedEntities[i].locker))\n            //        {\n            //            //Turns out we can't take all the resources! Immediately drop everything.\n            //            for (i = i - 1 /*failed on the ith element, so start at the previous*/; i >= 0; i--)\n            //            {\n            //                if (involvedEntities[i].isDynamic)\n            //                    Monitor.Exit(involvedEntities[i].locker);\n            //            }\n            //            return false;\n            //        }\n            //}\n            //return true;\n        }\n\n\n\n\n        /// <summary>\n        /// Handle any bookkeeping needed when the entities involved in this SolverUpdateable change.\n        /// </summary>\n        protected internal virtual void OnInvolvedEntitiesChanged()\n        {\n            //First verify that something really changed.\n            bool entitiesChanged = false;\n            RawList<Entity> newInvolvedEntities = PhysicsResources.GetEntityRawList();\n            CollectInvolvedEntities(newInvolvedEntities);\n            if (newInvolvedEntities.Count == involvedEntities.Count)\n            {\n                for (int i = 0; i < newInvolvedEntities.Count; i++)\n                {\n                    if (newInvolvedEntities.Elements[i] != involvedEntities.Elements[i])\n                    {\n                        entitiesChanged = true;\n                        break;\n                    }\n                }\n            }\n            else\n            {\n                entitiesChanged = true;\n            }\n\n            if (entitiesChanged)\n            {\n                //Probably need to wake things up given that such a significant change was made.\n\n                for (int i = 0; i < involvedEntities.Count; i++)\n                {\n                    Entity e = involvedEntities.Elements[i];\n                    if (e.isDynamic)\n                    {\n                        e.activityInformation.Activate();\n                        break;//Don't bother activating other entities; they are all a part of the same simulation island.\n                    }\n                }\n\n                //CollectInvolvedEntities will give the updateable a new simulationIslandConnection and get rid of the old one.\n                CollectInvolvedEntities();\n\n\n\n                if (SolverGroup != null)\n                    SolverGroup.OnInvolvedEntitiesChanged();\n\n                //We woke up the FORMER involved entities, now wake up the current involved entities.\n                for (int i = 0; i < involvedEntities.Count; i++)\n                {\n                    Entity e = involvedEntities.Elements[i];\n                    if (e.isDynamic)\n                    {\n                        e.activityInformation.Activate();\n                        break; //Don't bother activating other entities; they are all a part of the same simulation island.\n                    }\n                }\n            }\n            PhysicsResources.GiveBack(newInvolvedEntities);\n        }\n\n        /// <summary>\n        /// Collects the entities involved in a solver updateable and sets up the internal listings.\n        /// </summary>\n        protected internal void CollectInvolvedEntities()\n        {\n            involvedEntities.Clear();\n            CollectInvolvedEntities(involvedEntities);\n            SortInvolvedEntities();\n            UpdateConnectedMembers();\n        }\n\n\n        /// <summary>\n        /// Adds entities associated with the solver item to the involved entities list.\n        /// This allows the non-batched multithreading system to lock properly.\n        /// </summary>\n        protected internal abstract void CollectInvolvedEntities(RawList<Entity> outputInvolvedEntities);\n\n        /// <summary>\n        /// Sorts the involved entities according to their hashcode to allow non-batched multithreading to avoid deadlocks.\n        /// </summary>\n        protected internal void SortInvolvedEntities()\n        {\n            numberOfInvolvedEntities = involvedEntities.Count;\n            involvedEntities.Sort(comparer);\n        }\n\n\n\n        void UpdateConnectedMembers()\n        {\n\n            //Since we're about to change this updateable's connections, make sure the \n            //simulation islands hear about it.  This is NOT thread safe.\n            var deactivationManager = simulationIslandConnection.DeactivationManager;\n\n            //Orphan the simulation island connection since it's about to get replaced.\n            //There's three possible situations here:\n            //1) We belong to the DeactivationManager.\n            //2) We don't belong to a DeactivationManager and the connection is slated for removal (we were in the deactivation manager before).\n            //   This can happen when a solver updateable associated with a pair gets removed and cleaned up.\n            //3) We don't belong to a DeactivationManager and the connection is not slated for removal (we weren't in a deactivation manager before).\n\n            //In Case #1, all we have to do is orphan the connection and remove it from the manager. This performs any splits necessary. The replacement connection will force any necessary merges.\n            //In Case #2, we were just removed but the connection is still considered to have an owner.\n            //It won't get cleaned up by the removal, and doing it here would be premature: orphan the connection so the next deactivation manager splits flush cleans it up!\n            //In Case #3, we have full control over the simulation island connection because there is no interaction with a deactivation manager. We can just get rid of it directly.\n            simulationIslandConnection.Owner = null; \n            if (deactivationManager != null)\n            {\n                deactivationManager.Remove(simulationIslandConnection);\n            }\n            else if (!simulationIslandConnection.SlatedForRemoval) //If it's already been removed, cleaning it ourselves would prevent proper simulation island splits in the deactivation manager split flush.\n                PhysicsResources.GiveBack(simulationIslandConnection); //Well, since we're going to orphan the connection, we'll need to take care of its trash.\n\n\n            //The SimulationIslandConnection is immutable.\n            //So create a new one!\n            //Assume we've already dealt with the old connection.\n            simulationIslandConnection = PhysicsResources.GetSimulationIslandConnection();\n            for (int i = 0; i < involvedEntities.Count; i++)\n            {\n                simulationIslandConnection.Add(involvedEntities.Elements[i].activityInformation);\n            }\n            simulationIslandConnection.Owner = this;\n\n\n            //Add the new reference back.\n            if (deactivationManager != null)\n                deactivationManager.Add(simulationIslandConnection);\n\n        }\n\n\n        private static EntityComparer comparer = new EntityComparer();\n        private class EntityComparer : IComparer<Entity>\n        {\n            #region IComparer<Entity> Members\n\n            int IComparer<Entity>.Compare(Entity x, Entity y)\n            {\n                if (x.InstanceId > y.InstanceId)\n                    return 1;\n                if (x.InstanceId < y.InstanceId)\n                    return -1;\n                return 0;\n            }\n\n            #endregion\n        }\n\n\n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/IJacobians.cs",
    "content": "﻿using BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints\n{\n    /// <summary>\n    /// Denotes a class that uses a single linear jacobian axis.\n    /// </summary>\n    public interface I1DJacobianConstraint\n    {\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        void GetAngularJacobianA(out Vector3 jacobian);\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        void GetAngularJacobianB(out Vector3 jacobian);\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        void GetLinearJacobianA(out Vector3 jacobian);\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        void GetLinearJacobianB(out Vector3 jacobian);\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        void GetMassMatrix(out float outputMassMatrix);\n    }\n\n    /// <summary>\n    /// Denotes a class that uses two linear jacobian axes.\n    /// </summary>\n    public interface I2DJacobianConstraint\n    {\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the first connected entity.</param>\n        void GetAngularJacobianA(out Vector3 jacobianX, out Vector3 jacobianY);\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the second connected entity.</param>\n        void GetAngularJacobianB(out Vector3 jacobianX, out Vector3 jacobianY);\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the first connected entity.</param>\n        void GetLinearJacobianA(out Vector3 jacobianX, out Vector3 jacobianY);\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the second connected entity.</param>\n        void GetLinearJacobianB(out Vector3 jacobianX, out Vector3 jacobianY);\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"massMatrix\">Constraint's mass matrix.</param>\n        void GetMassMatrix(out Matrix2x2 massMatrix);\n    }\n\n    /// <summary>\n    /// Denotes a class that uses three linear jacobian axes.\n    /// </summary>\n    public interface I3DJacobianConstraint\n    {\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianZ\">Third angular jacobian entry for the first connected entity.</param>\n        void GetAngularJacobianA(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ);\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianZ\">Third angular jacobian entry for the second connected entity.</param>\n        void GetAngularJacobianB(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ);\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianZ\">Third linear jacobian entry for the first connected entity.</param>\n        void GetLinearJacobianA(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ);\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianZ\">Third linear jacobian entry for the second connected entity.</param>\n        void GetLinearJacobianB(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ);\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        void GetMassMatrix(out Matrix3x3 outputMassMatrix);\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/ISolverSettings.cs",
    "content": "﻿namespace BEPUphysics.Constraints\n{\n    /// <summary>\n    /// Implemented by classes which have solver settings.\n    /// </summary>\n    public interface ISolverSettings\n    {\n        /// <summary>\n        /// Gets the solver settings for this constraint.\n        /// </summary>\n        SolverSettings SolverSettings { get; }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/ISpringConstraint.cs",
    "content": "﻿namespace BEPUphysics.Constraints\n{\n    /// <summary>\n    /// Implemented by constraints that support springlike behavior.\n    /// </summary>\n    public interface ISpringSettings\n    {\n        /// <summary>\n        /// Gets the spring settings used by the constraint.\n        /// </summary>\n        SpringSettings SpringSettings { get; }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/IXDImpulseConstraint.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints\n{\n    /// <summary>\n    /// Implemented by solver updateables which have a one dimensional impulse.\n    /// </summary>\n    public interface I1DImpulseConstraint\n    {\n        /// <summary>\n        /// Gets the current relative velocity of the constraint.\n        /// Computed based on the current connection velocities and jacobians.\n        /// </summary>\n        float RelativeVelocity { get; }\n\n        /// <summary>\n        /// Gets the total impulse a constraint has applied.\n        /// </summary>\n        float TotalImpulse { get; }\n    }\n\n    /// <summary>\n    /// Implemented by solver updateables which have a one dimensional impulse.\n    /// </summary>\n    public interface I1DImpulseConstraintWithError : I1DImpulseConstraint\n    {\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        float Error { get; }\n    }\n\n    /// <summary>\n    /// Implemented by solver updateables which have a two dimensional impulse.\n    /// </summary>\n    public interface I2DImpulseConstraint\n    {\n        /// <summary>\n        /// Gets the current relative velocity of the constraint.\n        /// Computed based on the current connection velocities and jacobians.\n        /// </summary>\n        Vector2 RelativeVelocity { get; }\n\n        /// <summary>\n        /// Gets the total impulse a constraint has applied.\n        /// </summary>\n        Vector2 TotalImpulse { get; }\n    }\n\n    /// <summary>\n    /// Implemented by solver updateables which have a two dimensional impulse.\n    /// </summary>\n    public interface I2DImpulseConstraintWithError : I2DImpulseConstraint\n    {\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        Vector2 Error { get; }\n    }\n\n    /// <summary>\n    /// Implemented by solver updateables which have a three dimensional impulse.\n    /// </summary>\n    public interface I3DImpulseConstraint\n    {\n        /// <summary>\n        /// Gets the current relative velocity of the constraint.\n        /// Computed based on the current connection velocities and jacobians.\n        /// </summary>\n        Vector3 RelativeVelocity { get; }\n\n        /// <summary>\n        /// Gets the total impulse a constraint has applied.\n        /// </summary>\n        Vector3 TotalImpulse { get; }\n    }\n\n    /// <summary>\n    /// Implemented by solver updateables which have a three dimensional impulse.\n    /// </summary>\n    public interface I3DImpulseConstraintWithError : I3DImpulseConstraint\n    {\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        Vector3 Error { get; }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/JointTransform.cs",
    "content": "﻿using System;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints\n{\n    /// <summary>\n    /// Defines a three dimensional orthonormal basis used by a constraint.\n    /// </summary>\n    public class JointBasis3D\n    {\n        internal Vector3 localPrimaryAxis = Vector3.Backward;\n        internal Vector3 localXAxis = Vector3.Right;\n        internal Vector3 localYAxis = Vector3.Up;\n        internal Vector3 primaryAxis = Vector3.Backward;\n        internal Matrix3x3 rotationMatrix = Matrix3x3.Identity;\n        internal Vector3 xAxis = Vector3.Right;\n        internal Vector3 yAxis = Vector3.Up;\n\n        /// <summary>\n        /// Gets the primary axis of the transform in local space.\n        /// </summary>\n        public Vector3 LocalPrimaryAxis\n        {\n            get { return localPrimaryAxis; }\n        }\n\n        /// <summary>\n        /// Gets or sets the local transform of the basis.\n        /// </summary>\n        public Matrix3x3 LocalTransform\n        {\n            get\n            {\n                var toReturn = new Matrix3x3 {Right = localXAxis, Up = localYAxis, Backward = localPrimaryAxis};\n                return toReturn;\n            }\n            set { SetLocalAxes(value); }\n        }\n\n        /// <summary>\n        /// Gets the X axis of the transform in local space.\n        /// </summary>\n        public Vector3 LocalXAxis\n        {\n            get { return localXAxis; }\n        }\n\n        /// <summary>\n        /// Gets the Y axis of the transform in local space.\n        /// </summary>\n        public Vector3 LocalYAxis\n        {\n            get { return localYAxis; }\n        }\n\n        /// <summary>\n        /// Gets the primary axis of the transform.\n        /// </summary>\n        public Vector3 PrimaryAxis\n        {\n            get { return primaryAxis; }\n        }\n\n        /// <summary>\n        /// Gets or sets the rotation matrix used by the joint transform to convert local space axes to world space.\n        /// </summary>\n        public Matrix3x3 RotationMatrix\n        {\n            get { return rotationMatrix; }\n            set\n            {\n                rotationMatrix = value;\n                ComputeWorldSpaceAxes();\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the world transform of the basis.\n        /// </summary>\n        public Matrix3x3 WorldTransform\n        {\n            get\n            {\n                var toReturn = new Matrix3x3 {Right = xAxis, Up = yAxis, Backward = primaryAxis};\n                return toReturn;\n            }\n            set { SetWorldAxes(value); }\n        }\n\n        /// <summary>\n        /// Gets the X axis of the transform.\n        /// </summary>\n        public Vector3 XAxis\n        {\n            get { return xAxis; }\n        }\n\n        /// <summary>\n        /// Gets the Y axis of the transform.\n        /// </summary>\n        public Vector3 YAxis\n        {\n            get { return yAxis; }\n        }\n\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"primaryAxis\">First axis in the transform.  Usually aligned along the main axis of a joint, like the twist axis of a TwistLimit.</param>\n        /// <param name=\"xAxis\">Second axis in the transform.</param>\n        /// <param name=\"yAxis\">Third axis in the transform.</param>\n        /// <param name=\"rotationMatrix\">Matrix to use to transform the local axes into world space.</param>\n        public void SetLocalAxes(Vector3 primaryAxis, Vector3 xAxis, Vector3 yAxis, Matrix3x3 rotationMatrix)\n        {\n            this.rotationMatrix = rotationMatrix;\n            SetLocalAxes(primaryAxis, xAxis, yAxis);\n        }\n\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"primaryAxis\">First axis in the transform.  Usually aligned along the main axis of a joint, like the twist axis of a TwistLimit.</param>\n        /// <param name=\"xAxis\">Second axis in the transform.</param>\n        /// <param name=\"yAxis\">Third axis in the transform.</param>\n        public void SetLocalAxes(Vector3 primaryAxis, Vector3 xAxis, Vector3 yAxis)\n        {\n            if (Math.Abs(Vector3.Dot(primaryAxis, xAxis)) > Toolbox.BigEpsilon ||\n                Math.Abs(Vector3.Dot(primaryAxis, yAxis)) > Toolbox.BigEpsilon ||\n                Math.Abs(Vector3.Dot(xAxis, yAxis)) > Toolbox.BigEpsilon)\n                throw new ArgumentException(\"The axes provided to the joint transform do not form an orthonormal basis.  Ensure that each axis is perpendicular to the other two.\");\n\n            localPrimaryAxis = Vector3.Normalize(primaryAxis);\n            localXAxis = Vector3.Normalize(xAxis);\n            localYAxis = Vector3.Normalize(yAxis);\n            ComputeWorldSpaceAxes();\n        }\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"matrix\">Rotation matrix representing the three axes.\n        /// The matrix's backward vector is used as the primary axis.  \n        /// The matrix's right vector is used as the x axis.\n        /// The matrix's up vector is used as the y axis.</param>\n        public void SetLocalAxes(Matrix3x3 matrix)\n        {\n            if (Math.Abs(Vector3.Dot(matrix.Backward, matrix.Right)) > Toolbox.BigEpsilon ||\n                Math.Abs(Vector3.Dot(matrix.Backward, matrix.Up)) > Toolbox.BigEpsilon ||\n                Math.Abs(Vector3.Dot(matrix.Right, matrix.Up)) > Toolbox.BigEpsilon)\n                throw new ArgumentException(\"The axes provided to the joint transform do not form an orthonormal basis.  Ensure that each axis is perpendicular to the other two.\");\n\n            localPrimaryAxis = Vector3.Normalize(matrix.Backward);\n            localXAxis = Vector3.Normalize(matrix.Right);\n            localYAxis = Vector3.Normalize(matrix.Up);\n            ComputeWorldSpaceAxes();\n        }\n\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"primaryAxis\">First axis in the transform.  Usually aligned along the main axis of a joint, like the twist axis of a TwistLimit.</param>\n        /// <param name=\"xAxis\">Second axis in the transform.</param>\n        /// <param name=\"yAxis\">Third axis in the transform.</param>\n        /// <param name=\"rotationMatrix\">Matrix to use to transform the local axes into world space.</param>\n        public void SetWorldAxes(Vector3 primaryAxis, Vector3 xAxis, Vector3 yAxis, Matrix3x3 rotationMatrix)\n        {\n            this.rotationMatrix = rotationMatrix;\n            SetWorldAxes(primaryAxis, xAxis, yAxis);\n        }\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"primaryAxis\">First axis in the transform.  Usually aligned along the main axis of a joint, like the twist axis of a TwistLimit.</param>\n        /// <param name=\"xAxis\">Second axis in the transform.</param>\n        /// <param name=\"yAxis\">Third axis in the transform.</param>\n        public void SetWorldAxes(Vector3 primaryAxis, Vector3 xAxis, Vector3 yAxis)\n        {\n            if (Math.Abs(Vector3.Dot(primaryAxis, xAxis)) > Toolbox.BigEpsilon ||\n                Math.Abs(Vector3.Dot(primaryAxis, yAxis)) > Toolbox.BigEpsilon ||\n                Math.Abs(Vector3.Dot(xAxis, yAxis)) > Toolbox.BigEpsilon)\n                throw new ArgumentException(\"The axes provided to the joint transform do not form an orthonormal basis.  Ensure that each axis is perpendicular to the other two.\");\n\n            this.primaryAxis = Vector3.Normalize(primaryAxis);\n            this.xAxis = Vector3.Normalize(xAxis);\n            this.yAxis = Vector3.Normalize(yAxis);\n            Matrix3x3.TransformTranspose(ref this.primaryAxis, ref rotationMatrix, out localPrimaryAxis);\n            Matrix3x3.TransformTranspose(ref this.xAxis, ref rotationMatrix, out localXAxis);\n            Matrix3x3.TransformTranspose(ref this.yAxis, ref rotationMatrix, out localYAxis);\n        }\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"matrix\">Rotation matrix representing the three axes.\n        /// The matrix's backward vector is used as the primary axis.  \n        /// The matrix's right vector is used as the x axis.\n        /// The matrix's up vector is used as the y axis.</param>\n        public void SetWorldAxes(Matrix3x3 matrix)\n        {\n            if (Math.Abs(Vector3.Dot(matrix.Backward, matrix.Right)) > Toolbox.BigEpsilon ||\n                Math.Abs(Vector3.Dot(matrix.Backward, matrix.Up)) > Toolbox.BigEpsilon ||\n                Math.Abs(Vector3.Dot(matrix.Right, matrix.Up)) > Toolbox.BigEpsilon)\n                throw new ArgumentException(\"The axes provided to the joint transform do not form an orthonormal basis.  Ensure that each axis is perpendicular to the other two.\");\n\n            primaryAxis = Vector3.Normalize(matrix.Backward);\n            xAxis = Vector3.Normalize(matrix.Right);\n            yAxis = Vector3.Normalize(matrix.Up);\n            Matrix3x3.TransformTranspose(ref this.primaryAxis, ref rotationMatrix, out localPrimaryAxis);\n            Matrix3x3.TransformTranspose(ref this.xAxis, ref rotationMatrix, out localXAxis);\n            Matrix3x3.TransformTranspose(ref this.yAxis, ref rotationMatrix, out localYAxis);\n        }\n\n        internal void ComputeWorldSpaceAxes()\n        {\n            Matrix3x3.Transform(ref localPrimaryAxis, ref rotationMatrix, out primaryAxis);\n            Matrix3x3.Transform(ref localXAxis, ref rotationMatrix, out xAxis);\n            Matrix3x3.Transform(ref localYAxis, ref rotationMatrix, out yAxis);\n        }\n    }\n\n    /// <summary>\n    /// Defines a two axes which are perpendicular to each other used by a constraint.\n    /// </summary>\n    public class JointBasis2D\n    {\n        internal Vector3 localPrimaryAxis = Vector3.Backward;\n        internal Vector3 localXAxis = Vector3.Right;\n        internal Vector3 primaryAxis = Vector3.Backward;\n        internal Matrix3x3 rotationMatrix = Matrix3x3.Identity;\n        internal Vector3 xAxis = Vector3.Right;\n\n        /// <summary>\n        /// Gets the primary axis of the transform in local space.\n        /// </summary>\n        public Vector3 LocalPrimaryAxis\n        {\n            get { return localPrimaryAxis; }\n        }\n\n        /// <summary>\n        /// Gets the X axis of the transform in local space.\n        /// </summary>\n        public Vector3 LocalXAxis\n        {\n            get { return localXAxis; }\n        }\n\n        /// <summary>\n        /// Gets the primary axis of the transform.\n        /// </summary>\n        public Vector3 PrimaryAxis\n        {\n            get { return primaryAxis; }\n        }\n\n        /// <summary>\n        /// Gets or sets the rotation matrix used by the joint transform to convert local space axes to world space.\n        /// </summary>\n        public Matrix3x3 RotationMatrix\n        {\n            get { return rotationMatrix; }\n            set\n            {\n                rotationMatrix = value;\n                ComputeWorldSpaceAxes();\n            }\n        }\n\n        /// <summary>\n        /// Gets the X axis of the transform.\n        /// </summary>\n        public Vector3 XAxis\n        {\n            get { return xAxis; }\n        }\n\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"primaryAxis\">First axis in the transform.  Usually aligned along the main axis of a joint, like the twist axis of a TwistLimit.</param>\n        /// <param name=\"xAxis\">Second axis in the transform.</param>\n        /// <param name=\"rotationMatrix\">Matrix to use to transform the local axes into world space.</param>\n        public void SetLocalAxes(Vector3 primaryAxis, Vector3 xAxis, Matrix3x3 rotationMatrix)\n        {\n            this.rotationMatrix = rotationMatrix;\n            SetLocalAxes(primaryAxis, xAxis);\n        }\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"primaryAxis\">First axis in the transform.  Usually aligned along the main axis of a joint, like the twist axis of a TwistLimit.</param>\n        /// <param name=\"xAxis\">Second axis in the transform.</param>\n        public void SetLocalAxes(Vector3 primaryAxis, Vector3 xAxis)\n        {\n            if (Math.Abs(Vector3.Dot(primaryAxis, xAxis)) > Toolbox.BigEpsilon)\n                throw new ArgumentException(\"The axes provided to the joint transform are not perpendicular.  Ensure that the specified axes form a valid constraint.\");\n\n            localPrimaryAxis = Vector3.Normalize(primaryAxis);\n            localXAxis = Vector3.Normalize(xAxis);\n            ComputeWorldSpaceAxes();\n        }\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"matrix\">Rotation matrix representing the three axes.\n        /// The matrix's backward vector is used as the primary axis.  \n        /// The matrix's right vector is used as the x axis.</param>\n        public void SetLocalAxes(Matrix3x3 matrix)\n        {\n            if (Math.Abs(Vector3.Dot(matrix.Backward, matrix.Right)) > Toolbox.BigEpsilon)\n                throw new ArgumentException(\"The axes provided to the joint transform are not perpendicular.  Ensure that the specified axes form a valid constraint.\");\n            localPrimaryAxis = Vector3.Normalize(matrix.Backward);\n            localXAxis = Vector3.Normalize(matrix.Right);\n            ComputeWorldSpaceAxes();\n        }\n\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"primaryAxis\">First axis in the transform.  Usually aligned along the main axis of a joint, like the twist axis of a TwistLimit.</param>\n        /// <param name=\"xAxis\">Second axis in the transform.</param>\n        /// <param name=\"rotationMatrix\">Matrix to use to transform the local axes into world space.</param>\n        public void SetWorldAxes(Vector3 primaryAxis, Vector3 xAxis, Matrix3x3 rotationMatrix)\n        {\n            this.rotationMatrix = rotationMatrix;\n            SetWorldAxes(primaryAxis, xAxis);\n        }\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"primaryAxis\">First axis in the transform.  Usually aligned along the main axis of a joint, like the twist axis of a TwistLimit.</param>\n        /// <param name=\"xAxis\">Second axis in the transform.</param>\n        public void SetWorldAxes(Vector3 primaryAxis, Vector3 xAxis)\n        {\n            if (Math.Abs(Vector3.Dot(primaryAxis, xAxis)) > Toolbox.BigEpsilon)\n                throw new ArgumentException(\"The axes provided to the joint transform are not perpendicular.  Ensure that the specified axes form a valid constraint.\");\n            this.primaryAxis = Vector3.Normalize(primaryAxis);\n            this.xAxis = Vector3.Normalize(xAxis);\n            Matrix3x3.TransformTranspose(ref this.primaryAxis, ref rotationMatrix, out localPrimaryAxis);\n            Matrix3x3.TransformTranspose(ref this.xAxis, ref rotationMatrix, out localXAxis);\n        }\n\n        /// <summary>\n        /// Sets up the axes of the transform and ensures that it is an orthonormal basis.\n        /// </summary>\n        /// <param name=\"matrix\">Rotation matrix representing the three axes.\n        /// The matrix's backward vector is used as the primary axis.  \n        /// The matrix's right vector is used as the x axis.</param>\n        public void SetWorldAxes(Matrix3x3 matrix)\n        {\n            if (Math.Abs(Vector3.Dot(matrix.Backward, matrix.Right)) > Toolbox.BigEpsilon)\n                throw new ArgumentException(\"The axes provided to the joint transform are not perpendicular.  Ensure that the specified axes form a valid constraint.\");\n            primaryAxis = Vector3.Normalize(matrix.Backward);\n            xAxis = Vector3.Normalize(matrix.Right);\n            Matrix3x3.TransformTranspose(ref this.primaryAxis, ref rotationMatrix, out localPrimaryAxis);\n            Matrix3x3.TransformTranspose(ref this.xAxis, ref rotationMatrix, out localXAxis);\n        }\n\n        internal void ComputeWorldSpaceAxes()\n        {\n            Matrix3x3.Transform(ref localPrimaryAxis, ref rotationMatrix, out primaryAxis);\n            Matrix3x3.Transform(ref localXAxis, ref rotationMatrix, out xAxis);\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SingleEntity/MaximumAngularVelocityConstraint.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.SingleEntity\n{\n    /// <summary>\n    /// Prevents the target entity from moving faster than the specified speeds.\n    /// </summary>\n    public class MaximumAngularSpeedConstraint : SingleEntityConstraint, I3DImpulseConstraint\n    {\n        private Matrix3x3 effectiveMassMatrix;\n        private float maxForceDt = float.MaxValue;\n        private float maxForceDtSquared = float.MaxValue;\n        private Vector3 accumulatedImpulse;\n        private float maximumForce = float.MaxValue;\n        private float maximumSpeed;\n        private float maximumSpeedSquared;\n\n        private float softness = .00001f;\n        private float usedSoftness;\n\n        /// <summary>\n        /// Constructs a maximum speed constraint.\n        /// Set its Entity and MaximumSpeed to complete the configuration.\n        /// IsActive also starts as false with this constructor.\n        /// </summary>\n        public MaximumAngularSpeedConstraint()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a maximum speed constraint.\n        /// </summary>\n        /// <param name=\"e\">Affected entity.</param>\n        /// <param name=\"maxSpeed\">Maximum angular speed allowed.</param>\n        public MaximumAngularSpeedConstraint(Entity e, float maxSpeed)\n        {\n            Entity = e;\n            MaximumSpeed = maxSpeed;\n        }\n\n        /// <summary>\n        /// Gets and sets the maximum impulse that the constraint will attempt to apply when satisfying its requirements.\n        /// This field can be used to simulate friction in a constraint.\n        /// </summary>\n        public float MaximumForce\n        {\n            get\n            {\n                if (maximumForce > 0)\n                {\n                    return maximumForce;\n                }\n                return 0;\n            }\n            set { maximumForce = value >= 0 ? value : 0; }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum angular speed that this constraint allows.\n        /// </summary>\n        public float MaximumSpeed\n        {\n            get { return maximumSpeed; }\n            set\n            {\n                maximumSpeed = MathHelper.Max(0, value);\n                maximumSpeedSquared = maximumSpeed * maximumSpeed;\n            }\n        }\n\n\n        /// <summary>\n        /// Gets and sets the softness of this constraint.\n        /// Higher values of softness allow the constraint to be violated more.\n        /// Must be greater than zero.\n        /// Sometimes, if a joint system is unstable, increasing the softness of the involved constraints will make it settle down.\n        /// For motors, softness can be used to implement damping.  For a damping constant k, the appropriate softness is 1/k.\n        /// </summary>\n        public float Softness\n        {\n            get { return softness; }\n            set { softness = Math.Max(0, value); }\n        }\n\n        #region I3DImpulseConstraint Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        Vector3 I3DImpulseConstraint.RelativeVelocity\n        {\n            get { return entity.angularVelocity; }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by the constraint.\n        /// </summary>\n        public Vector3 TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Calculates and applies corrective impulses.\n        /// Called automatically by space.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            float angularSpeed = entity.angularVelocity.LengthSquared();\n            if (angularSpeed > maximumSpeedSquared)\n            {\n                angularSpeed = (float)Math.Sqrt(angularSpeed);\n                Vector3 impulse;\n                //divide by angularSpeed to normalize the velocity.\n                //Multiply by angularSpeed - maximumSpeed to get the 'velocity change vector.'\n                Vector3.Multiply(ref entity.angularVelocity, -(angularSpeed - maximumSpeed) / angularSpeed, out impulse);\n\n                //incorporate softness\n                Vector3 softnessImpulse;\n                Vector3.Multiply(ref accumulatedImpulse, usedSoftness, out softnessImpulse);\n                Vector3.Subtract(ref impulse, ref softnessImpulse, out impulse);\n\n                //Transform into impulse\n                Matrix3x3.Transform(ref impulse, ref effectiveMassMatrix, out impulse);\n\n\n                //Accumulate\n                Vector3 previousAccumulatedImpulse = accumulatedImpulse;\n                Vector3.Add(ref accumulatedImpulse, ref impulse, out accumulatedImpulse);\n                float forceMagnitude = accumulatedImpulse.LengthSquared();\n                if (forceMagnitude > maxForceDtSquared)\n                {\n                    //max / impulse gives some value 0 < x < 1.  Basically, normalize the vector (divide by the length) and scale by the maximum.\n                    float multiplier = maxForceDt / (float)Math.Sqrt(forceMagnitude);\n                    accumulatedImpulse.X *= multiplier;\n                    accumulatedImpulse.Y *= multiplier;\n                    accumulatedImpulse.Z *= multiplier;\n\n                    //Since the limit was exceeded by this corrective impulse, limit it so that the accumulated impulse remains constrained.\n                    impulse.X = accumulatedImpulse.X - previousAccumulatedImpulse.X;\n                    impulse.Y = accumulatedImpulse.Y - previousAccumulatedImpulse.Y;\n                    impulse.Z = accumulatedImpulse.Z - previousAccumulatedImpulse.Z;\n                }\n\n                entity.ApplyAngularImpulse(ref impulse);\n\n\n                return (Math.Abs(impulse.X) + Math.Abs(impulse.Y) + Math.Abs(impulse.Z));\n            }\n\n            return 0;\n        }\n\n        /// <summary>\n        /// Calculates necessary information for velocity solving.\n        /// Called automatically by space.\n        /// </summary>\n        /// <param name=\"dt\">Time in seconds since the last update.</param>\n        public override void Update(float dt)\n        {\n            usedSoftness = softness / dt;\n\n            effectiveMassMatrix = entity.inertiaTensorInverse;\n\n            effectiveMassMatrix.M11 += usedSoftness;\n            effectiveMassMatrix.M22 += usedSoftness;\n            effectiveMassMatrix.M33 += usedSoftness;\n\n            Matrix3x3.Invert(ref effectiveMassMatrix, out effectiveMassMatrix);\n\n            //Determine maximum force\n            if (maximumForce < float.MaxValue)\n            {\n                maxForceDt = maximumForce * dt;\n                maxForceDtSquared = maxForceDt * maxForceDt;\n            }\n            else\n            {\n                maxForceDt = float.MaxValue;\n                maxForceDtSquared = float.MaxValue;\n            }\n\n        }\n\n\n        public override void ExclusiveUpdate()\n        {\n\n            //Can't do warmstarting due to the strangeness of this constraint (not based on a position error, nor is it really a motor).\n            accumulatedImpulse = Toolbox.ZeroVector;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SingleEntity/MaximumLinearVelocityConstraint.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.SingleEntity\n{\n    /// <summary>\n    /// Prevents the target entity from moving faster than the specified speeds.\n    /// </summary>\n    public class MaximumLinearSpeedConstraint : SingleEntityConstraint, I3DImpulseConstraint\n    {\n        private float effectiveMassMatrix;\n        private float maxForceDt = float.MaxValue;\n        private float maxForceDtSquared = float.MaxValue;\n        private Vector3 accumulatedImpulse;\n        private float maximumForce = float.MaxValue;\n        private float maximumSpeed;\n        private float maximumSpeedSquared;\n\n        private float softness = .00001f;\n        private float usedSoftness;\n\n        /// <summary>\n        /// Constructs a maximum speed constraint.\n        /// Set its Entity and MaximumSpeed to complete the configuration.\n        /// IsActive also starts as false with this constructor.\n        /// </summary>\n        public MaximumLinearSpeedConstraint()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a maximum speed constraint.\n        /// </summary>\n        /// <param name=\"e\">Affected entity.</param>\n        /// <param name=\"maxSpeed\">Maximum linear speed allowed.</param>\n        public MaximumLinearSpeedConstraint(Entity e, float maxSpeed)\n        {\n            Entity = e;\n            MaximumSpeed = maxSpeed;\n        }\n\n        /// <summary>\n        /// Gets and sets the maximum impulse that the constraint will attempt to apply when satisfying its requirements.\n        /// This field can be used to simulate friction in a constraint.\n        /// </summary>\n        public float MaximumForce\n        {\n            get\n            {\n                if (maximumForce > 0)\n                {\n                    return maximumForce;\n                }\n                return 0;\n            }\n            set { maximumForce = value >= 0 ? value : 0; }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum linear speed that this constraint allows.\n        /// </summary>\n        public float MaximumSpeed\n        {\n            get { return maximumSpeed; }\n            set\n            {\n                maximumSpeed = MathHelper.Max(0, value);\n                maximumSpeedSquared = maximumSpeed * maximumSpeed;\n            }\n        }\n\n        /// <summary>\n        /// Gets and sets the softness of this constraint.\n        /// Higher values of softness allow the constraint to be violated more.\n        /// Must be greater than zero.\n        /// Sometimes, if a joint system is unstable, increasing the softness of the involved constraints will make it settle down.\n        /// For motors, softness can be used to implement damping.  For a damping constant k, the appropriate softness is 1/k.\n        /// </summary>\n        public float Softness\n        {\n            get { return softness; }\n            set { softness = Math.Max(0, value); }\n        }\n\n        #region I3DImpulseConstraint Members\n\n        /// <summary>\n        /// Gets the current relative velocity with respect to the constraint.\n        /// For a single entity constraint, this is pretty straightforward as the\n        /// velocity of the entity.\n        /// </summary>\n        Vector3 I3DImpulseConstraint.RelativeVelocity\n        {\n            get { return Entity.LinearVelocity; }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by the constraint.\n        /// </summary>\n        public Vector3 TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Calculates and applies corrective impulses.\n        /// Called automatically by space.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            float linearSpeed = entity.linearVelocity.LengthSquared();\n            if (linearSpeed > maximumSpeedSquared)\n            {\n                linearSpeed = (float) Math.Sqrt(linearSpeed);\n                Vector3 impulse;\n                //divide by linearSpeed to normalize the velocity.\n                //Multiply by linearSpeed - maximumSpeed to get the 'velocity change vector.'\n                Vector3.Multiply(ref entity.linearVelocity, -(linearSpeed - maximumSpeed) / linearSpeed, out impulse);\n\n                //incorporate softness\n                Vector3 softnessImpulse;\n                Vector3.Multiply(ref accumulatedImpulse, usedSoftness, out softnessImpulse);\n                Vector3.Subtract(ref impulse, ref softnessImpulse, out impulse);\n\n                //Transform into impulse\n                Vector3.Multiply(ref impulse, effectiveMassMatrix, out impulse);\n\n\n                //Accumulate\n                Vector3 previousAccumulatedImpulse = accumulatedImpulse;\n                Vector3.Add(ref accumulatedImpulse, ref impulse, out accumulatedImpulse);\n                float forceMagnitude = accumulatedImpulse.LengthSquared();\n                if (forceMagnitude > maxForceDtSquared)\n                {\n                    //max / impulse gives some value 0 < x < 1.  Basically, normalize the vector (divide by the length) and scale by the maximum.\n                    float multiplier = maxForceDt / (float) Math.Sqrt(forceMagnitude);\n                    accumulatedImpulse.X *= multiplier;\n                    accumulatedImpulse.Y *= multiplier;\n                    accumulatedImpulse.Z *= multiplier;\n\n                    //Since the limit was exceeded by this corrective impulse, limit it so that the accumulated impulse remains constrained.\n                    impulse.X = accumulatedImpulse.X - previousAccumulatedImpulse.X;\n                    impulse.Y = accumulatedImpulse.Y - previousAccumulatedImpulse.Y;\n                    impulse.Z = accumulatedImpulse.Z - previousAccumulatedImpulse.Z;\n                }\n\n                entity.ApplyLinearImpulse(ref impulse);\n\n\n                return (Math.Abs(impulse.X) + Math.Abs(impulse.Y) + Math.Abs(impulse.Z));\n            }\n\n\n            return 0;\n        }\n\n        /// <summary>\n        /// Calculates necessary information for velocity solving.\n        /// Called automatically by space.\n        /// </summary>\n        /// <param name=\"dt\">Time in seconds since the last update.</param>\n        public override void Update(float dt)\n        {\n            usedSoftness = softness / dt;\n\n            effectiveMassMatrix = 1 / (entity.inverseMass + usedSoftness);\n\n            //Determine maximum force\n            if (maximumForce < float.MaxValue)\n            {\n                maxForceDt = maximumForce * dt;\n                maxForceDtSquared = maxForceDt * maxForceDt;\n            }\n            else\n            {\n                maxForceDt = float.MaxValue;\n                maxForceDtSquared = float.MaxValue;\n            }\n\n          \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Can't do warmstarting due to the strangeness of this constraint (not based on a position error, nor is it really a motor).\n            accumulatedImpulse = Toolbox.ZeroVector;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SingleEntity/SingleEntityAngularMotor.cs",
    "content": "﻿using System;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.SingleEntity\n{\n    /// <summary>\n    /// Constraint which attempts to restrict the relative angular velocity of two entities to some value.\n    /// Can use a target relative orientation to apply additional force.\n    /// </summary>\n    public class SingleEntityAngularMotor : SingleEntityConstraint, I3DImpulseConstraintWithError\n    {\n        private readonly JointBasis3D basis = new JointBasis3D();\n\n        private readonly MotorSettingsOrientation settings;\n        private Vector3 accumulatedImpulse;\n\n\n        private float angle;\n        private Vector3 axis;\n\n        private Vector3 biasVelocity;\n        private Matrix3x3 effectiveMassMatrix;\n\n        private float maxForceDt;\n        private float maxForceDtSquared;\n        private float usedSoftness;\n\n        /// <summary>\n        /// Constructs a new constraint which attempts to restrict the relative angular velocity of two entities to some value.\n        /// </summary>\n        /// <param name=\"entity\">Affected entity.</param>\n        public SingleEntityAngularMotor(Entity entity)\n        {\n            Entity = entity;\n\n            settings = new MotorSettingsOrientation(this) {servo = {goal = base.entity.orientation}};\n            //Since no target relative orientation was specified, just use the current relative orientation.  Prevents any nasty start-of-sim 'snapping.'\n\n            //mySettings.myServo.springSettings.stiffnessConstant *= .5f;\n        }\n\n        /// <summary>\n        /// Constructs a new constraint which attempts to restrict the relative angular velocity of two entities to some value.\n        /// This constructor will make the angular motor start with isActive set to false.\n        /// </summary>\n        public SingleEntityAngularMotor()\n        {\n            settings = new MotorSettingsOrientation(this);\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Gets the basis attached to the entity.\n        /// The target velocity/orientation of this motor is transformed by the basis.\n        /// </summary>\n        public JointBasis3D Basis\n        {\n            get { return basis; }\n        }\n\n        /// <summary>\n        /// Gets the motor's velocity and servo settings.\n        /// </summary>\n        public MotorSettingsOrientation Settings\n        {\n            get { return settings; }\n        }\n\n        #region I3DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity with respect to the constraint.\n        /// For single entity constraints, this is pretty straightforward.  It is taken directly from the \n        /// entity.\n        /// </summary>\n        public Vector3 RelativeVelocity\n        {\n            get { return -Entity.AngularVelocity; }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public Vector3 TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// If the motor is in velocity only mode, error is zero.\n        /// </summary>\n        public Vector3 Error\n        {\n            get { return axis * angle; }\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Applies the corrective impulses required by the constraint.\n        /// </summary>\n        public override float SolveIteration()\n        {\n#if !WINDOWS\n            Vector3 lambda = new Vector3();\n#else\n            Vector3 lambda;\n#endif\n            Vector3 aVel = entity.angularVelocity;\n            lambda.X = -aVel.X + biasVelocity.X - usedSoftness * accumulatedImpulse.X;\n            lambda.Y = -aVel.Y + biasVelocity.Y - usedSoftness * accumulatedImpulse.Y;\n            lambda.Z = -aVel.Z + biasVelocity.Z - usedSoftness * accumulatedImpulse.Z;\n\n            Matrix3x3.Transform(ref lambda, ref effectiveMassMatrix, out lambda);\n\n            Vector3 previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse.X += lambda.X;\n            accumulatedImpulse.Y += lambda.Y;\n            accumulatedImpulse.Z += lambda.Z;\n            float sumLengthSquared = accumulatedImpulse.LengthSquared();\n\n            if (sumLengthSquared > maxForceDtSquared)\n            {\n                //max / impulse gives some value 0 < x < 1.  Basically, normalize the vector (divide by the length) and scale by the maximum.\n                float multiplier = maxForceDt / (float) Math.Sqrt(sumLengthSquared);\n                accumulatedImpulse.X *= multiplier;\n                accumulatedImpulse.Y *= multiplier;\n                accumulatedImpulse.Z *= multiplier;\n\n                //Since the limit was exceeded by this corrective impulse, limit it so that the accumulated impulse remains constrained.\n                lambda.X = accumulatedImpulse.X - previousAccumulatedImpulse.X;\n                lambda.Y = accumulatedImpulse.Y - previousAccumulatedImpulse.Y;\n                lambda.Z = accumulatedImpulse.Z - previousAccumulatedImpulse.Z;\n            }\n\n\n            entity.ApplyAngularImpulse(ref lambda);\n\n\n            return Math.Abs(lambda.X) + Math.Abs(lambda.Y) + Math.Abs(lambda.Z);\n        }\n\n        /// <summary>\n        /// Initializes the constraint for the current frame.\n        /// </summary>\n        /// <param name=\"dt\">Time between frames.</param>\n        public override void Update(float dt)\n        {\n            basis.rotationMatrix = entity.orientationMatrix;\n            basis.ComputeWorldSpaceAxes();\n\n            if (settings.mode == MotorMode.Servomechanism) //Only need to do the bulk of this work if it's a servo.\n            {\n                Quaternion currentRelativeOrientation;\n                Matrix worldTransform = Matrix3x3.ToMatrix4X4(basis.WorldTransform);\n                Quaternion.CreateFromRotationMatrix(ref worldTransform, out currentRelativeOrientation);\n\n\n                //Compute the relative orientation R' between R and the target relative orientation.\n                Quaternion errorOrientation;\n                Quaternion.Conjugate(ref currentRelativeOrientation, out errorOrientation);\n                Quaternion.Multiply(ref settings.servo.goal, ref errorOrientation, out errorOrientation);\n\n\n                float errorReduction;\n                settings.servo.springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out usedSoftness);\n\n                //Turn this into an axis-angle representation.\n                Toolbox.GetAxisAngleFromQuaternion(ref errorOrientation, out axis, out angle);\n\n                //Scale the axis by the desired velocity if the angle is sufficiently large (epsilon).\n                if (angle > Toolbox.BigEpsilon)\n                {\n                    float velocity = MathHelper.Min(settings.servo.baseCorrectiveSpeed, angle / dt) + angle * errorReduction;\n\n                    biasVelocity.X = axis.X * velocity;\n                    biasVelocity.Y = axis.Y * velocity;\n                    biasVelocity.Z = axis.Z * velocity;\n\n\n                    //Ensure that the corrective velocity doesn't exceed the max.\n                    float length = biasVelocity.LengthSquared();\n                    if (length > settings.servo.maxCorrectiveVelocitySquared)\n                    {\n                        float multiplier = settings.servo.maxCorrectiveVelocity / (float) Math.Sqrt(length);\n                        biasVelocity.X *= multiplier;\n                        biasVelocity.Y *= multiplier;\n                        biasVelocity.Z *= multiplier;\n                    }\n                }\n                else\n                {\n                    //Wouldn't want an old frame's bias velocity to sneak in.\n                    biasVelocity = new Vector3();\n                }\n            }\n            else\n            {\n                usedSoftness = settings.velocityMotor.softness / dt;\n                angle = 0; //Zero out the error;\n                Matrix3x3 transform = basis.WorldTransform;\n                Matrix3x3.Transform(ref settings.velocityMotor.goalVelocity, ref transform, out biasVelocity);\n            }\n\n            //Compute effective mass\n            effectiveMassMatrix = entity.inertiaTensorInverse;\n            effectiveMassMatrix.M11 += usedSoftness;\n            effectiveMassMatrix.M22 += usedSoftness;\n            effectiveMassMatrix.M33 += usedSoftness;\n            Matrix3x3.Invert(ref effectiveMassMatrix, out effectiveMassMatrix);\n\n            //Update the maximum force\n            ComputeMaxForces(settings.maximumForce, dt);\n\n\n            \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Apply accumulated impulse\n            entity.ApplyAngularImpulse(ref accumulatedImpulse);\n        }\n\n        /// <summary>\n        /// Computes the maxForceDt and maxForceDtSquared fields.\n        /// </summary>\n        private void ComputeMaxForces(float maxForce, float dt)\n        {\n            //Determine maximum force\n            if (maxForce < float.MaxValue)\n            {\n                maxForceDt = maxForce * dt;\n                maxForceDtSquared = maxForceDt * maxForceDt;\n            }\n            else\n            {\n                maxForceDt = float.MaxValue;\n                maxForceDtSquared = float.MaxValue;\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SingleEntity/SingleEntityConstraint.cs",
    "content": "using BEPUphysics.Entities;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.Constraints.SingleEntity\n{\n    /// <summary>\n    /// Abstract superclass of constraints which control a single entity.\n    /// </summary>\n    public abstract class SingleEntityConstraint : EntitySolverUpdateable\n    {\n        /// <summary>\n        /// Number of frames so far at effectively zero corrective impulse.\n        /// Set to zero during every preStep(float dt) call and incremented by checkForEarlyOutIterations(Vector3 impulse).\n        /// </summary>\n        protected int iterationsAtZeroImpulse;\n\n        /// <summary>\n        /// Entity affected by the constraint.\n        /// </summary>\n        protected internal Entity entity;\n\n        /// <summary>\n        /// Gets or sets the entity affected by the constraint.\n        /// </summary>\n        public virtual Entity Entity\n        {\n            get { return entity; }\n            set\n            {\n                //TODO: Should this clear accumulated impulses?\n                //For constraints too...\n                entity = value;\n                OnInvolvedEntitiesChanged();\n            }\n        }\n\n\n        /// <summary>\n        /// Adds entities associated with the solver item to the involved entities list.\n        /// Ensure that sortInvolvedEntities() is called at the end of the function.\n        /// This allows the non-batched multithreading system to lock properly.\n        /// </summary>\n        protected internal override void CollectInvolvedEntities(RawList<Entity> outputInvolvedEntities)\n        {\n            if (entity != null) //sometimes, the entity is set to null to 'deactivate' it.  Don't add null to the involved entities list.\n                outputInvolvedEntities.Add(entity);\n        }\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SingleEntity/SingleEntityLinearMotor.cs",
    "content": "﻿using System;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.SingleEntity\n{\n    /// <summary>\n    /// Constraint which tries to push an entity to a desired location.\n    /// </summary>\n    public class SingleEntityLinearMotor : SingleEntityConstraint, I3DImpulseConstraintWithError\n    {\n        private readonly MotorSettings3D settings;\n\n        /// <summary>\n        /// Sum of forces applied to the constraint in the past.\n        /// </summary>\n        private Vector3 accumulatedImpulse = Vector3.Zero;\n\n        private Vector3 biasVelocity;\n        private Matrix3x3 effectiveMassMatrix;\n\n        /// <summary>\n        /// Maximum impulse that can be applied in a single frame.\n        /// </summary>\n        private float maxForceDt;\n\n        /// <summary>\n        /// Maximum impulse that can be applied in a single frame, squared.\n        /// This is computed in the prestep to avoid doing extra multiplies in the more-often called applyImpulse method.\n        /// </summary>\n        private float maxForceDtSquared;\n\n        private Vector3 error;\n\n        private Vector3 localPoint;\n\n        private Vector3 worldPoint;\n\n        private Vector3 r;\n        private float usedSoftness;\n\n        /// <summary>\n        /// Gets or sets the entity affected by the constraint.\n        /// </summary>\n        public override Entity Entity\n        {\n            get\n            {\n                return base.Entity;\n            }\n            set\n            {\n                if (Entity != value)\n                    accumulatedImpulse = new Vector3();\n                base.Entity = value;\n            }\n        }\n\n\n        /// <summary>\n        /// Constructs a new single body linear motor.  This motor will try to move a single entity to a goal velocity or to a goal position.\n        /// </summary>\n        /// <param name=\"entity\">Entity to affect.</param>\n        /// <param name=\"point\">Point in world space attached to the entity that will be motorized.</param>\n        public SingleEntityLinearMotor(Entity entity, Vector3 point)\n        {\n            Entity = entity;\n            Point = point;\n\n            settings = new MotorSettings3D(this) {servo = {goal = point}};\n            //Not really necessary, just helps prevent 'snapping'.\n        }\n\n\n        /// <summary>\n        /// Constructs a new single body linear motor.  This motor will try to move a single entity to a goal velocity or to a goal position.\n        /// This constructor will start the motor with isActive = false.\n        /// </summary>\n        public SingleEntityLinearMotor()\n        {\n            settings = new MotorSettings3D(this);\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Point attached to the entity in its local space that is motorized.\n        /// </summary>\n        public Vector3 LocalPoint\n        {\n            get { return localPoint; }\n            set\n            {\n                localPoint = value;\n                Matrix3x3.Transform(ref localPoint, ref entity.orientationMatrix, out worldPoint);\n                Vector3.Add(ref worldPoint, ref entity.position, out worldPoint);\n            }\n        }\n\n        /// <summary>\n        /// Point attached to the entity in world space that is motorized.\n        /// </summary>\n        public Vector3 Point\n        {\n            get { return worldPoint; }\n            set\n            {\n                worldPoint = value;\n                Vector3.Subtract(ref worldPoint, ref entity.position, out localPoint);\n                Matrix3x3.TransformTranspose(ref localPoint, ref entity.orientationMatrix, out localPoint);\n            }\n        }\n\n        /// <summary>\n        /// Gets the motor's velocity and servo settings.\n        /// </summary>\n        public MotorSettings3D Settings\n        {\n            get { return settings; }\n        }\n\n        #region I3DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public Vector3 RelativeVelocity\n        {\n            get\n            {\n                Vector3 lambda;\n                Vector3.Cross(ref r, ref entity.angularVelocity, out lambda);\n                Vector3.Subtract(ref lambda, ref entity.linearVelocity, out lambda);\n                return lambda;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public Vector3 TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// If the motor is in velocity only mode, error is zero.\n        /// </summary>\n        public Vector3 Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n            //Compute relative velocity\n            Vector3 lambda;\n            Vector3.Cross(ref r, ref entity.angularVelocity, out lambda);\n            Vector3.Subtract(ref lambda, ref entity.linearVelocity, out lambda);\n\n            //Add in bias velocity\n            Vector3.Add(ref biasVelocity, ref lambda, out lambda);\n\n            //Add in softness\n            Vector3 softnessVelocity;\n            Vector3.Multiply(ref accumulatedImpulse, usedSoftness, out softnessVelocity);\n            Vector3.Subtract(ref lambda, ref softnessVelocity, out lambda);\n\n            //In terms of an impulse (an instantaneous change in momentum), what is it?\n            Matrix3x3.Transform(ref lambda, ref effectiveMassMatrix, out lambda);\n\n            //Sum the impulse.\n            Vector3 previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse += lambda;\n\n            //If the impulse it takes to get to the goal is too high for the motor to handle, scale it back.\n            float sumImpulseLengthSquared = accumulatedImpulse.LengthSquared();\n            if (sumImpulseLengthSquared > maxForceDtSquared)\n            {\n                //max / impulse gives some value 0 < x < 1.  Basically, normalize the vector (divide by the length) and scale by the maximum.\n                accumulatedImpulse *= maxForceDt / (float)Math.Sqrt(sumImpulseLengthSquared);\n\n                //Since the limit was exceeded by this corrective impulse, limit it so that the accumulated impulse remains constrained.\n                lambda = accumulatedImpulse - previousAccumulatedImpulse;\n            }\n\n\n            entity.ApplyLinearImpulse(ref lambda);\n            Vector3 taImpulse;\n            Vector3.Cross(ref r, ref lambda, out taImpulse);\n            entity.ApplyAngularImpulse(ref taImpulse);\n\n            return (Math.Abs(lambda.X) + Math.Abs(lambda.Y) + Math.Abs(lambda.Z));\n        }\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            //Transform point into world space.\n            Matrix3x3.Transform(ref localPoint, ref entity.orientationMatrix, out r);\n            Vector3.Add(ref r, ref entity.position, out worldPoint);\n\n\n            if (settings.mode == MotorMode.Servomechanism)\n            {\n                Vector3.Subtract(ref settings.servo.goal, ref worldPoint, out error);\n                float separationDistance = error.Length();\n                if (separationDistance > Toolbox.BigEpsilon)\n                {\n                    float errorReduction;\n                    settings.servo.springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out usedSoftness);\n\n                    //The rate of correction can be based on a constant correction velocity as well as a 'spring like' correction velocity.\n                    //The constant correction velocity could overshoot the destination, so clamp it.\n                    float correctionSpeed = MathHelper.Min(settings.servo.baseCorrectiveSpeed, separationDistance / dt) +\n                                            separationDistance * errorReduction;\n\n                    Vector3.Multiply(ref error, correctionSpeed / separationDistance, out biasVelocity);\n                    //Ensure that the corrective velocity doesn't exceed the max.\n                    float length = biasVelocity.LengthSquared();\n                    if (length > settings.servo.maxCorrectiveVelocitySquared)\n                    {\n                        float multiplier = settings.servo.maxCorrectiveVelocity / (float)Math.Sqrt(length);\n                        biasVelocity.X *= multiplier;\n                        biasVelocity.Y *= multiplier;\n                        biasVelocity.Z *= multiplier;\n                    }\n                }\n                else\n                {\n                    //Wouldn't want to use a bias from an earlier frame.\n                    biasVelocity = new Vector3();\n                }\n            }\n            else\n            {\n                usedSoftness = settings.velocityMotor.softness / dt;\n                biasVelocity = settings.velocityMotor.goalVelocity;\n                error = Vector3.Zero;\n            }\n\n            //Compute the maximum force that can be applied this frame.\n            ComputeMaxForces(settings.maximumForce, dt);\n\n            //COMPUTE EFFECTIVE MASS MATRIX\n            //Transforms a change in velocity to a change in momentum when multiplied.\n            Matrix3x3 linearComponent;\n            Matrix3x3.CreateScale(entity.inverseMass, out linearComponent);\n            Matrix3x3 rACrossProduct;\n            Matrix3x3.CreateCrossProduct(ref r, out rACrossProduct);\n            Matrix3x3 angularComponentA;\n            Matrix3x3.Multiply(ref rACrossProduct, ref entity.inertiaTensorInverse, out angularComponentA);\n            Matrix3x3.Multiply(ref angularComponentA, ref rACrossProduct, out angularComponentA);\n            Matrix3x3.Subtract(ref linearComponent, ref angularComponentA, out effectiveMassMatrix);\n\n            effectiveMassMatrix.M11 += usedSoftness;\n            effectiveMassMatrix.M22 += usedSoftness;\n            effectiveMassMatrix.M33 += usedSoftness;\n\n            Matrix3x3.Invert(ref effectiveMassMatrix, out effectiveMassMatrix);\n\n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //\"Warm start\" the constraint by applying a first guess of the solution should be.\n            entity.ApplyLinearImpulse(ref accumulatedImpulse);\n            Vector3 taImpulse;\n            Vector3.Cross(ref r, ref accumulatedImpulse, out taImpulse);\n            entity.ApplyAngularImpulse(ref taImpulse);\n        }\n\n        /// <summary>\n        /// Computes the maxForceDt and maxForceDtSquared fields.\n        /// </summary>\n        private void ComputeMaxForces(float maxForce, float dt)\n        {\n            //Determine maximum force\n            if (maxForce < float.MaxValue)\n            {\n                maxForceDt = maxForce * dt;\n                maxForceDtSquared = maxForceDt * maxForceDt;\n            }\n            else\n            {\n                maxForceDt = float.MaxValue;\n                maxForceDtSquared = float.MaxValue;\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SolverGroups/CustomizableSolverGroup.cs",
    "content": "﻿namespace BEPUphysics.Constraints.SolverGroups\n{\n    /// <summary>\n    /// Constraint made from other constraints.\n    /// Putting constraints into a solver group can help with organization and, in some cases, performance.\n    /// \n    /// If you have multiple constraints between the same two entities, putting the constraints into a \n    /// CustomizableSolverGroup can lower lock contention.\n    /// \n    /// Be careful about overloading a single solvergroup; it should be kept relatively small to ensure that the multithreading loads stay balanced.\n    /// </summary>\n    public class CustomizableSolverGroup : SolverGroup\n    {\n        /// <summary>\n        /// Adds a new solver updateable to the solver group.\n        /// </summary>\n        /// <param name=\"solverUpdateable\">Solver updateable to add.</param>\n        public new void Add(EntitySolverUpdateable solverUpdateable)\n        {\n            base.Add(solverUpdateable);\n        }\n\n        /// <summary>\n        /// Removes a solver updateable from the solver group.\n        /// </summary>\n        /// <param name=\"solverUpdateable\">Solver updateable to remove.</param>\n        public new void Remove(EntitySolverUpdateable solverUpdateable)\n        {\n            base.Remove(solverUpdateable);\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SolverGroups/LineSliderJoint.cs",
    "content": "﻿using BEPUphysics.Constraints.TwoEntity;\nusing BEPUphysics.Constraints.TwoEntity.JointLimits;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.SolverGroups\n{\n    /// <summary>\n    /// Restricts two degrees of linear motion while allowing one degree of angular freedom.\n    /// </summary>\n    public class LineSliderJoint : SolverGroup\n    {\n        /// <summary>\n        /// Constructs a new constraint which restricts two degrees of linear freedom and two degrees of angular freedom between two entities.\n        /// This constructs the internal constraints, but does not configure them.  Before using a constraint constructed in this manner,\n        /// ensure that its active constituent constraints are properly configured.  The entire group as well as all internal constraints are initially inactive (IsActive = false).\n        /// </summary>\n        public LineSliderJoint()\n        {\n            IsActive = false;\n            PointOnLineJoint = new PointOnLineJoint();\n            AngularJoint = new RevoluteAngularJoint();\n            Limit = new LinearAxisLimit();\n            Motor = new LinearAxisMotor();\n            Add(PointOnLineJoint);\n            Add(AngularJoint);\n            Add(Limit);\n            Add(Motor);\n        }\n\n\n        /// <summary>\n        /// Constructs a new constraint which restricts two degrees of linear freedom and two degrees of angular freedom between two entities.\n        /// </summary>\n        /// <param name=\"connectionA\">First entity of the constraint pair.</param>\n        /// <param name=\"connectionB\">Second entity of the constraint pair.</param>\n        /// <param name=\"lineAnchor\">Location of the anchor for the line to be attached to connectionA in world space.</param>\n        /// <param name=\"lineDirection\">Axis in world space to be attached to connectionA along which connectionB can move and rotate.</param>\n        /// <param name=\"pointAnchor\">Location of the anchor for the point to be attached to connectionB in world space.</param>\n        public LineSliderJoint(Entity connectionA, Entity connectionB, Vector3 lineAnchor, Vector3 lineDirection, Vector3 pointAnchor)\n        {\n            if (connectionA == null)\n                connectionA = TwoEntityConstraint.WorldEntity;\n            if (connectionB == null)\n                connectionB = TwoEntityConstraint.WorldEntity;\n            PointOnLineJoint = new PointOnLineJoint(connectionA, connectionB, lineAnchor, lineDirection, pointAnchor);\n            AngularJoint = new RevoluteAngularJoint(connectionA, connectionB, lineDirection);\n            Limit = new LinearAxisLimit(connectionA, connectionB, lineAnchor, pointAnchor, lineDirection, 0, 0);\n            Motor = new LinearAxisMotor(connectionA, connectionB, lineAnchor, pointAnchor, lineDirection);\n            Limit.IsActive = false;\n            Motor.IsActive = false;\n            Add(PointOnLineJoint);\n            Add(AngularJoint);\n            Add(Limit);\n            Add(Motor);\n        }\n\n        /// <summary>\n        /// Gets the angular joint which removes two degrees of freedom.\n        /// </summary>\n        public RevoluteAngularJoint AngularJoint { get; private set; }\n\n        /// <summary>\n        /// Gets the distance limits for the slider.\n        /// </summary>\n        public LinearAxisLimit Limit { get; private set; }\n\n        /// <summary>\n        /// Gets the slider motor.\n        /// </summary>\n        public LinearAxisMotor Motor { get; private set; }\n\n        /// <summary>\n        /// Gets the line joint that restricts two linear degrees of freedom.\n        /// </summary>\n        public PointOnLineJoint PointOnLineJoint { get; private set; }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SolverGroups/PlaneSliderJoint.cs",
    "content": "﻿using BEPUphysics.Constraints.TwoEntity;\nusing BEPUphysics.Constraints.TwoEntity.JointLimits;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.SolverGroups\n{\n    /// <summary>\n    /// Restricts one linear degree of freedom.\n    /// </summary>\n    public class PlaneSliderJoint : SolverGroup\n    {\n        /// <summary>\n        /// Constructs a new constraint which restricts one linear degree of freedom between two entities.\n        /// This constructs the internal constraints, but does not configure them.  Before using a constraint constructed in this manner,\n        /// ensure that its active constituent constraints are properly configured.  The entire group as well as all internal constraints are initially inactive (IsActive = false).\n        /// </summary>\n        public PlaneSliderJoint()\n        {\n            IsActive = false;\n            PointOnPlaneJoint = new PointOnPlaneJoint();\n            LimitX = new LinearAxisLimit();\n            MotorX = new LinearAxisMotor();\n            LimitY = new LinearAxisLimit();\n            MotorY = new LinearAxisMotor();\n\n            Add(PointOnPlaneJoint);\n            Add(LimitX);\n            Add(MotorX);\n            Add(LimitY);\n            Add(MotorY);\n        }\n\n        /// <summary>\n        /// Constructs a new constraint which restricts one linear degree of freedom between two entities.\n        /// </summary>\n        /// <param name=\"connectionA\">First entity of the constraint pair.</param>\n        /// <param name=\"connectionB\">Second entity of the constraint pair.</param>\n        /// <param name=\"planeAnchor\">Location of the anchor for the plane to be attached to connectionA in world space.</param>\n        /// <param name=\"planeNormal\">Normal of the plane constraint in world space.</param>\n        /// <param name=\"xAxis\">Direction in world space along which the X axis LinearAxisLimit and LinearAxisMotor work.\n        /// This is usually chosen to be perpendicular to the planeNormal and the yAxis.</param>\n        /// <param name=\"yAxis\">Direction in world space along which the Y axis LinearAxisLimit and LinearAxisMotor work.\n        /// This is usually chosen to be perpendicular to the planeNormal and the xAxis.</param>\n        /// <param name=\"pointAnchor\">Location of the anchor for the point to be attached to connectionB in world space.</param>\n        public PlaneSliderJoint(Entity connectionA, Entity connectionB, Vector3 planeAnchor, Vector3 planeNormal, Vector3 xAxis, Vector3 yAxis, Vector3 pointAnchor)\n        {\n            if (connectionA == null)\n                connectionA = TwoEntityConstraint.WorldEntity;\n            if (connectionB == null)\n                connectionB = TwoEntityConstraint.WorldEntity;\n            PointOnPlaneJoint = new PointOnPlaneJoint(connectionA, connectionB, planeAnchor, planeNormal, pointAnchor);\n            LimitX = new LinearAxisLimit(connectionA, connectionB, planeAnchor, pointAnchor, xAxis, 0, 0);\n            MotorX = new LinearAxisMotor(connectionA, connectionB, planeAnchor, pointAnchor, xAxis);\n            LimitY = new LinearAxisLimit(connectionA, connectionB, planeAnchor, pointAnchor, yAxis, 0, 0);\n            MotorY = new LinearAxisMotor(connectionA, connectionB, planeAnchor, pointAnchor, yAxis);\n            LimitX.IsActive = false;\n            MotorX.IsActive = false;\n            LimitY.IsActive = false;\n            MotorY.IsActive = false;\n            Add(PointOnPlaneJoint);\n            Add(LimitX);\n            Add(MotorX);\n            Add(LimitY);\n            Add(MotorY);\n        }\n\n        /// <summary>\n        /// Gets the distance limit for the slider along plane's X axis.\n        /// </summary>\n        public LinearAxisLimit LimitX { get; private set; }\n\n        /// <summary>\n        /// Gets the distance limit for the slider along plane's Y axis.\n        /// </summary>\n        public LinearAxisLimit LimitY { get; private set; }\n\n        /// <summary>\n        /// Gets the slider motor for the plane's X axis.\n        /// </summary>\n        public LinearAxisMotor MotorX { get; private set; }\n\n        /// <summary>\n        /// Gets the slider motor for the plane's Y axis.\n        /// </summary>\n        public LinearAxisMotor MotorY { get; private set; }\n\n        /// <summary>\n        /// Gets the plane joint that restricts one linear degree of freedom.\n        /// </summary>\n        public PointOnPlaneJoint PointOnPlaneJoint { get; private set; }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SolverGroups/PrismaticJoint.cs",
    "content": "﻿using BEPUphysics.Constraints.TwoEntity;\nusing BEPUphysics.Constraints.TwoEntity.JointLimits;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.SolverGroups\n{\n    /// <summary>\n    /// Restricts two degrees of linear freedom and all three degrees of angular freedom.\n    /// </summary>\n    public class PrismaticJoint : SolverGroup\n    {\n\n        /// <summary>\n        /// Constructs a new constraint which restricts two degrees of linear freedom and all three degrees of angular freedom.\n        /// This constructs the internal constraints, but does not configure them.  Before using a constraint constructed in this manner,\n        /// ensure that its active constituent constraints are properly configured.  The entire group as well as all internal constraints are initially inactive (IsActive = false).\n        /// </summary>\n        public PrismaticJoint()\n        {\n            IsActive = false;\n            PointOnLineJoint = new PointOnLineJoint();\n            AngularJoint = new NoRotationJoint();\n            Limit = new LinearAxisLimit();\n            Motor = new LinearAxisMotor();\n\n            Add(PointOnLineJoint);\n            Add(AngularJoint);\n            Add(Limit);\n            Add(Motor);\n        }\n\n\n        /// <summary>\n        /// Constructs a new constraint which restricts two degrees of linear freedom and all three degrees of angular freedom.\n        /// </summary>\n        /// <param name=\"connectionA\">First entity of the constraint pair.</param>\n        /// <param name=\"connectionB\">Second entity of the constraint pair.</param>\n        /// <param name=\"lineAnchor\">Location of the anchor for the line to be attached to connectionA in world space.</param>\n        /// <param name=\"lineDirection\">Axis in world space to be attached to connectionA along which connectionB can move.</param>\n        /// <param name=\"pointAnchor\">Location of the anchor for the point to be attached to connectionB in world space.</param>\n        public PrismaticJoint(Entity connectionA, Entity connectionB, Vector3 lineAnchor, Vector3 lineDirection, Vector3 pointAnchor)\n        {\n            if (connectionA == null)\n                connectionA = TwoEntityConstraint.WorldEntity;\n            if (connectionB == null)\n                connectionB = TwoEntityConstraint.WorldEntity;\n            PointOnLineJoint = new PointOnLineJoint(connectionA, connectionB, lineAnchor, lineDirection, pointAnchor);\n            AngularJoint = new NoRotationJoint(connectionA, connectionB);\n            Limit = new LinearAxisLimit(connectionA, connectionB, lineAnchor, pointAnchor, lineDirection, 0, 0);\n            Motor = new LinearAxisMotor(connectionA, connectionB, lineAnchor, pointAnchor, lineDirection);\n            Limit.IsActive = false;\n            Motor.IsActive = false;\n            Add(PointOnLineJoint);\n            Add(AngularJoint);\n            Add(Limit);\n            Add(Motor);\n        }\n\n        /// <summary>\n        /// Gets the angular joint which removes three degrees of freedom.\n        /// </summary>\n        public NoRotationJoint AngularJoint { get; private set; }\n\n        /// <summary>\n        /// Gets the distance limits for the slider.\n        /// </summary>\n        public LinearAxisLimit Limit { get; private set; }\n\n        /// <summary>\n        /// Gets the slider motor.\n        /// </summary>\n        public LinearAxisMotor Motor { get; private set; }\n\n        /// <summary>\n        /// Gets the line joint that restricts two linear degrees of freedom.\n        /// </summary>\n        public PointOnLineJoint PointOnLineJoint { get; private set; }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SolverGroups/RevoluteJoint.cs",
    "content": "﻿using BEPUphysics.Constraints.TwoEntity;\nusing BEPUphysics.Constraints.TwoEntity.JointLimits;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.SolverGroups\n{\n    /// <summary>\n    /// Restricts linear motion while allowing one degree of angular freedom.\n    /// Acts like a normal door hinge.\n    /// </summary>\n    public class RevoluteJoint : SolverGroup\n    {\n\n        /// <summary>\n        /// Constructs a new constraint which restricts three degrees of linear freedom and two degrees of angular freedom between two entities.\n        /// This constructs the internal constraints, but does not configure them.  Before using a constraint constructed in this manner,\n        /// ensure that its active constituent constraints are properly configured.  The entire group as well as all internal constraints are initially inactive (IsActive = false).\n        /// </summary>\n        public RevoluteJoint()\n        {\n            IsActive = false;\n            BallSocketJoint = new BallSocketJoint();\n            AngularJoint = new RevoluteAngularJoint();\n            Limit = new RevoluteLimit();\n            Motor = new RevoluteMotor();\n\n\n            Add(BallSocketJoint);\n            Add(AngularJoint);\n            Add(Limit);\n            Add(Motor);\n        }\n\n\n        /// <summary>\n        /// Constructs a new constraint which restricts three degrees of linear freedom and two degrees of angular freedom between two entities.\n        /// </summary>\n        /// <param name=\"connectionA\">First entity of the constraint pair.</param>\n        /// <param name=\"connectionB\">Second entity of the constraint pair.</param>\n        /// <param name=\"anchor\">Point around which both entities rotate.</param>\n        /// <param name=\"freeAxis\">Axis around which the hinge can rotate.</param>\n        public RevoluteJoint(Entity connectionA, Entity connectionB, Vector3 anchor, Vector3 freeAxis)\n        {\n            if (connectionA == null)\n                connectionA = TwoEntityConstraint.WorldEntity;\n            if (connectionB == null)\n                connectionB = TwoEntityConstraint.WorldEntity;\n            BallSocketJoint = new BallSocketJoint(connectionA, connectionB, anchor);\n            AngularJoint = new RevoluteAngularJoint(connectionA, connectionB, freeAxis);\n            Limit = new RevoluteLimit(connectionA, connectionB);\n            Motor = new RevoluteMotor(connectionA, connectionB, freeAxis);\n            Limit.IsActive = false;\n            Motor.IsActive = false;\n\n            //Ensure that the base and test direction is perpendicular to the free axis.\n            Vector3 baseAxis = anchor - connectionA.position;\n            if (baseAxis.LengthSquared() < Toolbox.BigEpsilon) //anchor and connection a in same spot, so try the other way.\n                baseAxis = connectionB.position - anchor;\n            baseAxis -= Vector3.Dot(baseAxis, freeAxis) * freeAxis;\n            if (baseAxis.LengthSquared() < Toolbox.BigEpsilon)\n            {\n                //However, if the free axis is totally aligned (like in an axis constraint), pick another reasonable direction.\n                baseAxis = Vector3.Cross(freeAxis, Vector3.Up);\n                if (baseAxis.LengthSquared() < Toolbox.BigEpsilon)\n                {\n                    baseAxis = Vector3.Cross(freeAxis, Vector3.Right);\n                }\n            }\n            Limit.Basis.SetWorldAxes(freeAxis, baseAxis, connectionA.orientationMatrix);\n            Motor.Basis.SetWorldAxes(freeAxis, baseAxis, connectionA.orientationMatrix);\n\n            baseAxis = connectionB.position - anchor;\n            baseAxis -= Vector3.Dot(baseAxis, freeAxis) * freeAxis;\n            if (baseAxis.LengthSquared() < Toolbox.BigEpsilon)\n            {\n                //However, if the free axis is totally aligned (like in an axis constraint), pick another reasonable direction.\n                baseAxis = Vector3.Cross(freeAxis, Vector3.Up);\n                if (baseAxis.LengthSquared() < Toolbox.BigEpsilon)\n                {\n                    baseAxis = Vector3.Cross(freeAxis, Vector3.Right);\n                }\n            }\n            Limit.TestAxis = baseAxis;\n            Motor.TestAxis = baseAxis;\n\n\n            Add(BallSocketJoint);\n            Add(AngularJoint);\n            Add(Limit);\n            Add(Motor);\n        }\n\n        /// <summary>\n        /// Gets the angular joint which removes two degrees of freedom.\n        /// </summary>\n        public RevoluteAngularJoint AngularJoint { get; private set; }\n\n        /// <summary>\n        /// Gets the ball socket joint that restricts linear degrees of freedom.\n        /// </summary>\n        public BallSocketJoint BallSocketJoint { get; private set; }\n\n        /// <summary>\n        /// Gets the rotational limit of the hinge.\n        /// </summary>\n        public RevoluteLimit Limit { get; private set; }\n\n        /// <summary>\n        /// Gets the motor of the hinge.\n        /// </summary>\n        public RevoluteMotor Motor { get; private set; }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SolverGroups/SolverGroup.cs",
    "content": "﻿using System;\nusing System.Collections.ObjectModel;\nusing BEPUphysics.Entities;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.SolverSystems;\n\nnamespace BEPUphysics.Constraints.SolverGroups\n{\n    /// <summary>\n    /// Superclass of constraints that are composed of multiple subconstraints.\n    /// </summary>\n    public abstract class SolverGroup : EntitySolverUpdateable\n    {\n        internal readonly RawList<EntitySolverUpdateable> solverUpdateables = new RawList<EntitySolverUpdateable>();\n\n\n        /// <summary>\n        /// Gets the solver updateables managed by this solver group.\n        /// </summary>\n        public ReadOnlyList<EntitySolverUpdateable> SolverUpdateables\n        {\n            get\n            {\n                return new ReadOnlyList<EntitySolverUpdateable>(solverUpdateables);\n            }\n        }\n\n\n\n\n        /// <summary>\n        /// Collects the entities which are affected by the solver group and updates the internal listing.\n        /// </summary>\n        protected internal override void CollectInvolvedEntities(RawList<Entity> outputInvolvedEntities)\n        {\n            foreach (EntitySolverUpdateable item in solverUpdateables)\n            {\n                for (int i = 0; i < item.involvedEntities.Count; i++)\n                {\n                    if (!outputInvolvedEntities.Contains(item.involvedEntities.Elements[i]))\n                    {\n                        outputInvolvedEntities.Add(item.involvedEntities.Elements[i]);\n                    }\n                }\n            }\n        }\n\n\n        /// <summary>\n        /// Sets the activity state of the constraint based on the activity state of its connections.\n        /// Called automatically by the space owning a constaint.  If a constraint is a sub-constraint that hasn't been directly added to the space,\n        /// this may need to be called alongside the preStep from within the parent constraint.\n        /// </summary>\n        public override void UpdateSolverActivity()\n        {\n            if (isActive)\n            {\n                isActiveInSolver = false;\n                for (int i = 0; i < solverUpdateables.Count; i++)\n                {\n                    var item = solverUpdateables.Elements[i];\n                    item.UpdateSolverActivity();\n                    isActiveInSolver |= item.isActiveInSolver;\n                }\n            }\n            else\n            {\n                isActiveInSolver = false;\n            }\n        }\n\n        protected void UpdateUpdateable(EntitySolverUpdateable item, float dt)\n        {\n            item.SolverSettings.currentIterations = 0;\n            item.SolverSettings.iterationsAtZeroImpulse = 0;\n            if (item.isActiveInSolver)\n                item.Update(dt);\n        }\n\n        protected void ExclusiveUpdateUpdateable(EntitySolverUpdateable item)\n        {\n            if (item.isActiveInSolver)\n                item.ExclusiveUpdate();\n        }\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            for (int i = 0; i < solverUpdateables.Count; i++)\n            {\n                UpdateUpdateable(solverUpdateables.Elements[i], dt);\n            }\n        }\n\n\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            for (int i = 0; i < solverUpdateables.Count; i++)\n            {\n                ExclusiveUpdateUpdateable(solverUpdateables.Elements[i]);\n            }\n        }\n\n        /// <summary>\n        /// Solves a child updateable.  Some children may override the group's update method;\n        /// this avoids code repeat.\n        /// </summary>\n        /// <param name=\"item\"></param>\n        /// <param name=\"activeConstraints\"> </param>\n        protected void SolveUpdateable(EntitySolverUpdateable item, ref int activeConstraints)\n        {\n            if (item.isActiveInSolver)\n            {\n                SolverSettings subSolverSettings = item.solverSettings;\n\n                subSolverSettings.currentIterations++;\n                if (subSolverSettings.currentIterations <= solver.iterationLimit &&\n                    subSolverSettings.currentIterations <= subSolverSettings.maximumIterationCount)\n                {\n                    if (item.SolveIteration() < subSolverSettings.minimumImpulse)\n                    {\n                        subSolverSettings.iterationsAtZeroImpulse++;\n                        if (subSolverSettings.iterationsAtZeroImpulse > subSolverSettings.minimumIterationCount)\n                            item.isActiveInSolver = false;\n                        else\n                        {\n                            activeConstraints++;\n                        }\n\n                    }\n                    else\n                    {\n                        subSolverSettings.iterationsAtZeroImpulse = 0;\n                        activeConstraints++;\n                    }\n                }\n                else\n                {\n                    item.isActiveInSolver = false;\n                }\n\n            }\n        }\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n            int activeConstraints = 0;\n            for (int i = 0; i < solverUpdateables.Count; i++)\n            {\n                SolveUpdateable(solverUpdateables.Elements[i], ref activeConstraints);\n            }\n            isActiveInSolver = activeConstraints > 0;\n            return solverSettings.minimumImpulse + 1; //Never let the system deactivate due to low impulses; solver group takes care of itself.\n        }\n\n\n        /// <summary>\n        /// Adds a solver updateable to the group.\n        /// </summary>\n        /// <param name=\"solverUpdateable\">Solver updateable to add.</param>\n        /// <exception cref=\"InvalidOperationException\">Thrown when the SolverUpdateable to add to the SolverGroup already belongs to another SolverGroup or to a Space.</exception>\n        protected void Add(EntitySolverUpdateable solverUpdateable)\n        {\n            if (solverUpdateable.solver == null)\n            {\n                if (solverUpdateable.SolverGroup == null)\n                {\n                    solverUpdateables.Add(solverUpdateable);\n                    solverUpdateable.SolverGroup = this;\n                    solverUpdateable.Solver = solver;\n                    OnInvolvedEntitiesChanged();\n                }\n                else\n                {\n                    throw new InvalidOperationException(\"Cannot add SolverUpdateable to SolverGroup; it already belongs to a SolverGroup.\");\n                }\n            }\n            else\n            {\n                throw new InvalidOperationException(\"Cannot add SolverUpdateable to SolverGroup; it already belongs to a solver.\");\n            }\n        }\n\n        /// <summary>\n        /// Removes a solver updateable from the group.\n        /// </summary>\n        /// <param name=\"solverUpdateable\">Solver updateable to remove.</param>\n        /// <exception cref=\"InvalidOperationException\">Thrown when the SolverUpdateable to remove from the SolverGroup doesn't actually belong to this SolverGroup.</exception>\n        protected void Remove(EntitySolverUpdateable solverUpdateable)\n        {\n            if (solverUpdateable.SolverGroup == this)\n            {\n                solverUpdateables.Remove(solverUpdateable);\n                solverUpdateable.SolverGroup = null;\n                solverUpdateable.Solver = null;\n                OnInvolvedEntitiesChanged();\n            }\n            else\n            {\n                throw new InvalidOperationException(\"Cannot remove SolverUpdateable from SolverGroup; it doesn't belong to this SolverGroup.\");\n            }\n        }\n\n        /// <summary>\n        /// Called after the object is added to a space.\n        /// </summary>\n        /// <param name=\"newSpace\"></param>\n        public override void OnAdditionToSpace(ISpace newSpace)\n        {\n            for (int i = 0; i < solverUpdateables.Count; i++)\n            {\n                solverUpdateables[i].OnAdditionToSpace(newSpace);\n            }\n        }\n\n        /// <summary>\n        /// Called before an object is removed from its space.\n        /// </summary>\n        public override void OnRemovalFromSpace(ISpace oldSpace)\n        {\n            for (int i = 0; i < solverUpdateables.Count; i++)\n            {\n                solverUpdateables[i].OnRemovalFromSpace(oldSpace);\n            }\n        }\n\n        ///<summary>\n        /// Gets the solver to which the solver updateable belongs.\n        ///</summary>\n        public override Solver Solver\n        {\n            get\n            {\n                return solver;\n            }\n            internal set\n            {\n                base.Solver = value;\n                for (int i = 0; i < solverUpdateables.Count; i++)\n                {\n                    solverUpdateables.Elements[i].Solver = value;\n                }\n            }\n        }\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SolverGroups/SwivelHingeJoint.cs",
    "content": "﻿using BEPUphysics.Constraints.TwoEntity;\nusing BEPUphysics.Constraints.TwoEntity.JointLimits;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.SolverGroups\n{\n    /// <summary>\n    /// Restricts linear motion while allowing one degree of angular freedom.\n    /// Acts like a tablet pc monitor hinge.\n    /// </summary>\n    public class SwivelHingeJoint : SolverGroup\n    {\n        /// <summary>\n        /// Constructs a new constraint which restricts three degrees of linear freedom and one degree of angular freedom between two entities.\n        /// This constructs the internal constraints, but does not configure them.  Before using a constraint constructed in this manner,\n        /// ensure that its active constituent constraints are properly configured.  The entire group as well as all internal constraints are initially inactive (IsActive = false).\n        /// </summary>\n        public SwivelHingeJoint()\n        {\n            IsActive = false;\n            BallSocketJoint = new BallSocketJoint();\n            AngularJoint = new SwivelHingeAngularJoint();\n            HingeLimit = new RevoluteLimit();\n            HingeMotor = new RevoluteMotor();\n            TwistLimit = new TwistLimit();\n            TwistMotor = new TwistMotor();\n\n            Add(BallSocketJoint);\n            Add(AngularJoint);\n            Add(HingeLimit);\n            Add(HingeMotor);\n            Add(TwistLimit);\n            Add(TwistMotor);\n        }\n\n        /// <summary>\n        /// Constructs a new constraint which restricts three degrees of linear freedom and one degree of angular freedom between two entities.\n        /// </summary>\n        /// <param name=\"connectionA\">First entity of the constraint pair.</param>\n        /// <param name=\"connectionB\">Second entity of the constraint pair.</param>\n        /// <param name=\"anchor\">Point around which both entities rotate.</param>\n        /// <param name=\"hingeAxis\">Axis of allowed rotation in world space to be attached to connectionA.  Will be kept perpendicular with the twist axis.</param>\n        public SwivelHingeJoint(Entity connectionA, Entity connectionB, Vector3 anchor, Vector3 hingeAxis)\n        {\n            if (connectionA == null)\n                connectionA = TwoEntityConstraint.WorldEntity;\n            if (connectionB == null)\n                connectionB = TwoEntityConstraint.WorldEntity;\n            BallSocketJoint = new BallSocketJoint(connectionA, connectionB, anchor);\n            AngularJoint = new SwivelHingeAngularJoint(connectionA, connectionB, hingeAxis, -BallSocketJoint.OffsetB);\n            HingeLimit = new RevoluteLimit(connectionA, connectionB);\n            HingeMotor = new RevoluteMotor(connectionA, connectionB, hingeAxis);\n            TwistLimit = new TwistLimit(connectionA, connectionB, BallSocketJoint.OffsetA, -BallSocketJoint.OffsetB, 0, 0);\n            TwistMotor = new TwistMotor(connectionA, connectionB, BallSocketJoint.OffsetA, -BallSocketJoint.OffsetB);\n            HingeLimit.IsActive = false;\n            HingeMotor.IsActive = false;\n            TwistLimit.IsActive = false;\n            TwistMotor.IsActive = false;\n\n            //Ensure that the base and test direction is perpendicular to the free axis.\n            Vector3 baseAxis = anchor - connectionA.position;\n            if (baseAxis.LengthSquared() < Toolbox.BigEpsilon) //anchor and connection a in same spot, so try the other way.\n                baseAxis = connectionB.position - anchor;\n            baseAxis -= Vector3.Dot(baseAxis, hingeAxis) * hingeAxis;\n            if (baseAxis.LengthSquared() < Toolbox.BigEpsilon)\n            {\n                //However, if the free axis is totally aligned (like in an axis constraint), pick another reasonable direction.\n                baseAxis = Vector3.Cross(hingeAxis, Vector3.Up);\n                if (baseAxis.LengthSquared() < Toolbox.BigEpsilon)\n                {\n                    baseAxis = Vector3.Cross(hingeAxis, Vector3.Right);\n                }\n            }\n            HingeLimit.Basis.SetWorldAxes(hingeAxis, baseAxis, connectionA.orientationMatrix);\n            HingeMotor.Basis.SetWorldAxes(hingeAxis, baseAxis, connectionA.orientationMatrix);\n\n            baseAxis = connectionB.position - anchor;\n            baseAxis -= Vector3.Dot(baseAxis, hingeAxis) * hingeAxis;\n            if (baseAxis.LengthSquared() < Toolbox.BigEpsilon)\n            {\n                //However, if the free axis is totally aligned (like in an axis constraint), pick another reasonable direction.\n                baseAxis = Vector3.Cross(hingeAxis, Vector3.Up);\n                if (baseAxis.LengthSquared() < Toolbox.BigEpsilon)\n                {\n                    baseAxis = Vector3.Cross(hingeAxis, Vector3.Right);\n                }\n            }\n            HingeLimit.TestAxis = baseAxis;\n            HingeMotor.TestAxis = baseAxis;\n\n\n            Add(BallSocketJoint);\n            Add(AngularJoint);\n            Add(HingeLimit);\n            Add(HingeMotor);\n            Add(TwistLimit);\n            Add(TwistMotor);\n        }\n\n        /// <summary>\n        /// Gets the angular joint which removes one degree of freedom.\n        /// </summary>\n        public SwivelHingeAngularJoint AngularJoint { get; private set; }\n\n        /// <summary>\n        /// Gets the ball socket joint that restricts linear degrees of freedom.\n        /// </summary>\n        public BallSocketJoint BallSocketJoint { get; private set; }\n\n        /// <summary>\n        /// Gets the rotational limit of the hinge.\n        /// </summary>\n        public RevoluteLimit HingeLimit { get; private set; }\n\n        /// <summary>\n        /// Gets the motor of the hinge.\n        /// </summary>\n        public RevoluteMotor HingeMotor { get; private set; }\n\n        /// <summary>\n        /// Gets the rotational limit of the swivel hinge.\n        /// </summary>\n        public TwistLimit TwistLimit { get; private set; }\n\n        /// <summary>\n        /// Gets the twist motor of the swivel hinge.\n        /// </summary>\n        public TwistMotor TwistMotor { get; private set; }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SolverGroups/UniversalJoint.cs",
    "content": "﻿using BEPUphysics.Constraints.TwoEntity;\nusing BEPUphysics.Constraints.TwoEntity.JointLimits;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.SolverGroups\n{\n    /// <summary>\n    /// Restricts three degrees of linear motion and one degree of angular motion.\n    /// Acts like two hinges in immediate sequence.\n    /// </summary>\n    public class UniversalJoint : SolverGroup\n    {\n        /// <summary>\n        /// Constructs a new constraint which restricts three degrees of linear freedom and one degree of twisting angular freedom between two entities.\n        /// This constructs the internal constraints, but does not configure them.  Before using a constraint constructed in this manner,\n        /// ensure that its active constituent constraints are properly configured.  The entire group as well as all internal constraints are initially inactive (IsActive = false).\n        /// </summary>\n        public UniversalJoint()\n        {\n            IsActive = false;\n            BallSocketJoint = new BallSocketJoint();\n            TwistJoint = new TwistJoint();\n            Limit = new TwistLimit();\n            Motor = new TwistMotor();\n            Add(BallSocketJoint);\n            Add(TwistJoint);\n            Add(Limit);\n            Add(Motor);\n        }\n\n\n        /// <summary>\n        /// Constructs a new constraint which restricts three degrees of linear freedom and one degree of twisting angular freedom between two entities.\n        /// </summary>\n        /// <param name=\"connectionA\">First entity of the constraint pair.</param>\n        /// <param name=\"connectionB\">Second entity of the constraint pair.</param>\n        /// <param name=\"anchor\">Point around which both entities rotate in world space.</param>\n        public UniversalJoint(Entity connectionA, Entity connectionB, Vector3 anchor)\n        {\n            if (connectionA == null)\n                connectionA = TwoEntityConstraint.WorldEntity;\n            if (connectionB == null)\n                connectionB = TwoEntityConstraint.WorldEntity;\n            BallSocketJoint = new BallSocketJoint(connectionA, connectionB, anchor);\n            TwistJoint = new TwistJoint(connectionA, connectionB, BallSocketJoint.OffsetA, -BallSocketJoint.OffsetB);\n            Limit = new TwistLimit(connectionA, connectionB, BallSocketJoint.OffsetA, -BallSocketJoint.OffsetB, 0, 0);\n            Motor = new TwistMotor(connectionA, connectionB, BallSocketJoint.OffsetA, -BallSocketJoint.OffsetB);\n            Limit.IsActive = false;\n            Motor.IsActive = false;\n            Add(BallSocketJoint);\n            Add(TwistJoint);\n            Add(Limit);\n            Add(Motor);\n        }\n\n        /// <summary>\n        /// Gets the ball socket joint that restricts linear degrees of freedom.\n        /// </summary>\n        public BallSocketJoint BallSocketJoint { get; private set; }\n\n        /// <summary>\n        /// Gets the rotational limit of the universal joint.\n        /// This constraint overlaps with the twistJoint; if the limit is activated,\n        /// the twistJoint should be generally deactivated and vice versa.\n        /// </summary>\n        public TwistLimit Limit { get; private set; }\n\n        /// <summary>\n        /// Gets the motor of the universal joint.\n        /// This constraint overlaps with the twistJoint; if the motor is activated,\n        /// the twistJoint should generally be deactivated and vice versa.\n        /// </summary>\n        public TwistMotor Motor { get; private set; }\n\n        /// <summary>\n        /// Gets the angular joint which removes one twisting degree of freedom.\n        /// </summary>\n        public TwistJoint TwistJoint { get; private set; }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SolverGroups/WeldJoint.cs",
    "content": "﻿using BEPUphysics.Constraints.TwoEntity;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Entities;\n\nnamespace BEPUphysics.Constraints.SolverGroups\n{\n    /// <summary>\n    /// Restricts the linear and angular motion between two entities.\n    /// </summary>\n    public class WeldJoint : SolverGroup\n    {\n        /// <summary>\n        /// Constructs a new constraint which restricts the linear and angular motion between two entities.\n        /// This constructs the internal constraints, but does not configure them.  Before using a constraint constructed in this manner,\n        /// ensure that its active constituent constraints are properly configured.  The entire group as well as all internal constraints are initially inactive (IsActive = false).\n        /// </summary>\n        public WeldJoint()\n        {\n            IsActive = false;\n            BallSocketJoint = new BallSocketJoint();\n            NoRotationJoint = new NoRotationJoint();\n            Add(BallSocketJoint);\n            Add(NoRotationJoint);\n        }\n\n\n        /// <summary>\n        /// Constructs a new constraint which restricts the linear and angular motion between two entities.\n        /// </summary>\n        /// <param name=\"connectionA\">First entity of the constraint pair.</param>\n        /// <param name=\"connectionB\">Second entity of the constraint pair.</param>\n        public WeldJoint(Entity connectionA, Entity connectionB)\n        {\n            if (connectionA == null)\n                connectionA = TwoEntityConstraint.WorldEntity;\n            if (connectionB == null)\n                connectionB = TwoEntityConstraint.WorldEntity;\n            BallSocketJoint = new BallSocketJoint(connectionA, connectionB, (connectionA.position + connectionB.position) * .5f);\n            NoRotationJoint = new NoRotationJoint(connectionA, connectionB);\n            Add(BallSocketJoint);\n            Add(NoRotationJoint);\n        }\n\n        /// <summary>\n        /// Gets the ball socket joint that restricts linear degrees of freedom.\n        /// </summary>\n        public BallSocketJoint BallSocketJoint { get; private set; }\n\n        /// <summary>\n        /// Gets the no rotation joint that prevents angular motion.\n        /// </summary>\n        public NoRotationJoint NoRotationJoint { get; private set; }\n\n        \n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SolverSettings.cs",
    "content": "﻿using System;\n\nnamespace BEPUphysics.Constraints\n{\n    /// <summary>\n    /// Contains information about how a wheel solves its constraints.\n    /// </summary>\n    public class SolverSettings\n    {\n        /// <summary>\n        /// Used to count how many iterations have taken place so far.\n        /// </summary>\n        internal int currentIterations;\n\n        internal int maximumIterationCount = int.MaxValue;\n\n        internal int minimumIterationCount = DefaultMinimumIterationCount;\n\n        internal float minimumImpulse = DefaultMinimumImpulse;\n        internal int iterationsAtZeroImpulse;\n\n        /// <summary>\n        /// Gets or sets the maximum iterations that the wheel constraint can undergo.\n        /// If the space's iteration count is lower than this, the solver will only attempt\n        /// as many iterations as the space iteration count.\n        /// Lower iteration counts are less accurate, but can improve performance.\n        /// </summary>\n        public int MaximumIterationCount\n        {\n            get { return maximumIterationCount; }\n            set { maximumIterationCount = Math.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// Gets or sets the minimum number of iterations that will be applied.\n        /// If an impulse of magnitude smaller than the MinimumImpulse is applied, a 'tiny impulses' counter increases.  Once it exceeds the MinimumIterations,\n        /// the system can decide to stop solving to save time if appropriate.\n        /// </summary>\n        public int MinimumIterationCount\n        {\n            get { return minimumIterationCount; }\n            set { minimumIterationCount = Math.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// Gets or sets the lower limit for impulses.  Impulses applied with magnitudes less than this will increment the 'tiny impulse' counter, which is checked\n        /// against the MinimumIterations property.  If there's been too many tiny impulses in a row, then the system will stop trying to solve to save time.\n        /// Higher values will allow the system to give up earlier, but can harm accuracy.\n        /// </summary>\n        public float MinimumImpulse\n        {\n            get { return minimumImpulse; }\n            set { minimumImpulse = Math.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// The value to assign to new constraints' SolverSettings.MinimumImpulse.\n        /// Impulses with magnitudes below this value will count as effectively zero in determining iteration early outs unless changed in the constraint's solver settings.\n        /// High values quicken the short circuit but can cause instability, while low values will often prevent short circuiting, possibly increasing accuracy but harming performance.\n        /// Defaults to .001f.\n        /// </summary>\n        public static float DefaultMinimumImpulse = .001f;\n\n        /// <summary>\n        /// The value to assign to new constraints' SolverSettings.MinimumIterations.\n        /// Constraints are able to skip extra calculations if deemed appropriate after they complete the minimum iterations.\n        /// Higher values force the system to wait longer before trying to early out, possibly improving behavior.\n        /// Defaults to 1.\n        /// </summary>\n        public static int DefaultMinimumIterationCount = 1;\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/SpringSettings.cs",
    "content": "﻿using System;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints\n{\n    /// <summary>\n    /// Contains the error reduction factor and softness of a constraint.\n    /// These can be used to make the same behaviors as the stiffness and damping constants,\n    /// but may provide a more intuitive representation for rigid constraints.\n    /// </summary>\n    public class SpringAdvancedSettings\n    {\n        internal float errorReductionFactor = .1f;\n\n        internal float softness = .00001f;\n\n        internal bool useAdvancedSettings;\n\n        /// <summary>\n        /// Gets or sets the error reduction parameter of the spring.\n        /// </summary>\n        public float ErrorReductionFactor\n        {\n            get { return errorReductionFactor; }\n            set { errorReductionFactor = MathHelper.Clamp(value, 0, 1); }\n        }\n\n        /// <summary>\n        /// Gets or sets the softness of the joint.  Higher values allow the constraint to be violated more.\n        /// </summary>\n        public float Softness\n        {\n            get { return softness; }\n            set { softness = MathHelper.Max(0, value); }\n        }\n\n        /// <summary>\n        /// Gets or sets whether or not to use the advanced settings.\n        /// If this is set to true, the errorReductionFactor and softness will be used instead\n        /// of the stiffness constant and damping constant.\n        /// </summary>\n        public bool UseAdvancedSettings\n        {\n            get { return useAdvancedSettings; }\n            set { useAdvancedSettings = value; }\n        }\n    }\n\n\n    /// <summary>\n    /// Specifies the way in which a constraint's spring component behaves.\n    /// </summary>\n    public class SpringSettings\n    {\n        private readonly SpringAdvancedSettings advanced = new SpringAdvancedSettings();\n\n        internal float dampingConstant = 90000;\n        internal float stiffnessConstant = 600000;\n\n        /// <summary>\n        /// Gets an object containing the solver's direct view of the spring behavior.\n        /// </summary>\n        public SpringAdvancedSettings Advanced\n        {\n            get { return advanced; }\n        }\n\n        /// <summary>\n        /// Gets or sets the damping constant of this spring.  Higher values reduce oscillation more.\n        /// </summary>\n        public float DampingConstant\n        {\n            get { return dampingConstant; }\n            set { dampingConstant = MathHelper.Max(0, value); }\n        }\n\n        /// <summary>\n        /// Gets or sets the spring constant of this spring.  Higher values make the spring stiffer.\n        /// </summary>\n        public float StiffnessConstant\n        {\n            get { return stiffnessConstant; }\n            set { stiffnessConstant = Math.Max(0, value); }\n        }\n\n        /// <summary>\n        /// Computes the error reduction parameter and softness of a constraint based on its constants.\n        /// Automatically called by constraint presteps to compute their per-frame values.\n        /// </summary>\n        /// <param name=\"dt\">Simulation timestep.</param>\n        /// <param name=\"errorReduction\">Error reduction factor to use this frame.</param>\n        /// <param name=\"softness\">Adjusted softness of the constraint for this frame.</param>\n        public void ComputeErrorReductionAndSoftness(float dt, out float errorReduction, out float softness)\n        {\n            if (advanced.useAdvancedSettings)\n            {\n                errorReduction = advanced.errorReductionFactor / dt;\n                softness = advanced.softness / dt;\n            }\n            else\n            {\n                if (stiffnessConstant == 0 && dampingConstant == 0)\n                    throw new InvalidOperationException(\"Constraints cannot have both 0 stiffness and 0 damping.\");\n                errorReduction = stiffnessConstant / (dt * stiffnessConstant + dampingConstant);\n                softness = 1 / (dt * (dt * stiffnessConstant + dampingConstant));\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/JointLimits/DistanceLimit.cs",
    "content": "using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Constraints.TwoEntity.JointLimits\n{\n    /// <summary>\n    /// A modified distance constraint allowing a range of lengths between two anchor points.\n    /// </summary>\n    public class DistanceLimit : JointLimit, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private float accumulatedImpulse;\n        private Vector3 anchorA;\n\n        private Vector3 anchorB;\n        private float biasVelocity;\n        private Vector3 jAngularA, jAngularB;\n        private Vector3 jLinearA, jLinearB;\n        private float error;\n\n        private Vector3 localAnchorA;\n\n        private Vector3 localAnchorB;\n\n        /// <summary>\n        /// Maximum distance allowed between the anchors.\n        /// </summary>\n        protected float maximumLength;\n\n        /// <summary>\n        /// Minimum distance maintained between the anchors.\n        /// </summary>\n        protected float minimumLength;\n\n\n        private Vector3 offsetA, offsetB;\n        private float velocityToImpulse;\n\n        /// <summary>\n        /// Constructs a distance limit joint.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the WorldAnchorA and WorldAnchorB (or their entity-local versions)\n        /// and the MinimumLength and MaximumLength.\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public DistanceLimit()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a distance limit joint.\n        /// </summary>\n        /// <param name=\"connectionA\">First body connected to the distance limit.</param>\n        /// <param name=\"connectionB\">Second body connected to the distance limit.</param>\n        /// <param name=\"anchorA\">Connection to the spring from the first connected body in world space.</param>\n        /// <param name=\"anchorB\"> Connection to the spring from the second connected body in world space.</param>\n        /// <param name=\"minimumLength\">Minimum distance maintained between the anchors.</param>\n        /// <param name=\"maximumLength\">Maximum distance allowed between the anchors.</param>\n        public DistanceLimit(Entity connectionA, Entity connectionB, Vector3 anchorA, Vector3 anchorB, float minimumLength, float maximumLength)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n            MinimumLength = minimumLength;\n            MaximumLength = maximumLength;\n\n            WorldAnchorA = anchorA;\n            WorldAnchorB = anchorB;\n        }\n\n        /// <summary>\n        /// Gets or sets the first entity's connection point in local space.\n        /// </summary>\n        public Vector3 LocalAnchorA\n        {\n            get { return localAnchorA; }\n            set\n            {\n                localAnchorA = value;\n                Matrix3x3.Transform(ref localAnchorA, ref connectionA.orientationMatrix, out anchorA);\n                anchorA += connectionA.position;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the first entity's connection point in local space.\n        /// </summary>\n        public Vector3 LocalAnchorB\n        {\n            get { return localAnchorB; }\n            set\n            {\n                localAnchorB = value;\n                Matrix3x3.Transform(ref localAnchorB, ref connectionB.orientationMatrix, out anchorB);\n                anchorB += connectionB.position;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum distance allowed between the anchors.\n        /// </summary>\n        public float MaximumLength\n        {\n            get { return maximumLength; }\n            set\n            {\n                maximumLength = Math.Max(0, value);\n                minimumLength = Math.Min(minimumLength, maximumLength);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the minimum distance maintained between the anchors.\n        /// </summary>\n        public float MinimumLength\n        {\n            get { return minimumLength; }\n            set\n            {\n                minimumLength = Math.Max(0, value);\n                maximumLength = Math.Max(minimumLength, maximumLength);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the connection to the distance constraint from the first connected body in world space.\n        /// </summary>\n        public Vector3 WorldAnchorA\n        {\n            get { return anchorA; }\n            set\n            {\n                anchorA = value;\n                localAnchorA = Vector3.Transform(anchorA - connectionA.position, Quaternion.Conjugate(connectionA.orientation));\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the connection to the distance constraint from the second connected body in world space.\n        /// </summary>\n        public Vector3 WorldAnchorB\n        {\n            get { return anchorB; }\n            set\n            {\n                anchorB = value;\n                localAnchorB = Vector3.Transform(anchorB - connectionB.position, Quaternion.Conjugate(connectionB.orientation));\n            }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                if (isLimitActive)\n                {\n                    float lambda, dot;\n                    Vector3.Dot(ref jLinearA, ref connectionA.linearVelocity, out lambda);\n                    Vector3.Dot(ref jAngularA, ref connectionA.angularVelocity, out dot);\n                    lambda += dot;\n                    Vector3.Dot(ref jLinearB, ref connectionB.linearVelocity, out dot);\n                    lambda += dot;\n                    Vector3.Dot(ref jAngularB, ref connectionB.angularVelocity, out dot);\n                    lambda += dot;\n                    return lambda;\n                }\n                return 0;\n            }\n        }\n\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jLinearA;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jLinearB;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jAngularA;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jAngularB;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = velocityToImpulse;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Calculates and applies corrective impulses.\n        /// Called automatically by space.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            //Compute the current relative velocity.\n            float lambda, dot;\n            Vector3.Dot(ref jLinearA, ref connectionA.linearVelocity, out lambda);\n            Vector3.Dot(ref jAngularA, ref connectionA.angularVelocity, out dot);\n            lambda += dot;\n            Vector3.Dot(ref jLinearB, ref connectionB.linearVelocity, out dot);\n            lambda += dot;\n            Vector3.Dot(ref jAngularB, ref connectionB.angularVelocity, out dot);\n            lambda += dot;\n\n            //Add in the constraint space bias velocity\n            lambda = -lambda + biasVelocity - softness * accumulatedImpulse;\n\n            //Transform to an impulse\n            lambda *= velocityToImpulse;\n\n            //Clamp accumulated impulse (can't go negative)\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Max(accumulatedImpulse + lambda, 0);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearA, lambda, out impulse);\n                connectionA.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularA, lambda, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearB, lambda, out impulse);\n                connectionB.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularB, lambda, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return (Math.Abs(lambda));\n        }\n\n        /// <summary>\n        /// Calculates necessary information for velocity solving.\n        /// </summary>\n        /// <param name=\"dt\">Time in seconds since the last update.</param>\n        public override void Update(float dt)\n        {\n            //Transform the anchors and offsets into world space.\n            Matrix3x3.Transform(ref localAnchorA, ref connectionA.orientationMatrix, out offsetA);\n            Matrix3x3.Transform(ref localAnchorB, ref connectionB.orientationMatrix, out offsetB);\n            Vector3.Add(ref connectionA.position, ref offsetA, out anchorA);\n            Vector3.Add(ref connectionB.position, ref offsetB, out anchorB);\n\n            //Compute the distance.\n            Vector3 separation;\n            Vector3.Subtract(ref anchorB, ref anchorA, out separation);\n            float distance = separation.Length();\n            if (distance < maximumLength && distance > minimumLength)\n            {\n                isActiveInSolver = false;\n                accumulatedImpulse = 0;\n                error = 0;\n                isLimitActive = false;\n                return;\n            }\n            isLimitActive = true;\n\n\n            //Compute jacobians\n            if (distance > maximumLength)\n            {\n                //If it's beyond the max, all of the jacobians are reversed compared to what they are when it's below the min.\n                if (distance > Toolbox.Epsilon)\n                {\n                    jLinearA.X = separation.X / distance;\n                    jLinearA.Y = separation.Y / distance;\n                    jLinearA.Z = separation.Z / distance;\n                }\n                else\n                    jLinearB = Toolbox.ZeroVector;\n\n                jLinearB.X = -jLinearA.X;\n                jLinearB.Y = -jLinearA.Y;\n                jLinearB.Z = -jLinearA.Z;\n\n                Vector3.Cross(ref jLinearA, ref offsetA, out jAngularA);\n                //Still need to negate angular A.  It's done after the effective mass matrix.\n                Vector3.Cross(ref jLinearA, ref offsetB, out jAngularB);\n            }\n            else\n            {\n                if (distance > Toolbox.Epsilon)\n                {\n                    jLinearB.X = separation.X / distance;\n                    jLinearB.Y = separation.Y / distance;\n                    jLinearB.Z = separation.Z / distance;\n                }\n                else\n                    jLinearB = Toolbox.ZeroVector;\n\n                jLinearA.X = -jLinearB.X;\n                jLinearA.Y = -jLinearB.Y;\n                jLinearA.Z = -jLinearB.Z;\n\n                Vector3.Cross(ref offsetA, ref jLinearB, out jAngularA);\n                //Still need to negate angular A.  It's done after the effective mass matrix.\n                Vector3.Cross(ref offsetB, ref jLinearB, out jAngularB);\n            }\n\n\n            //Debug.WriteLine(\"BiasVelocity: \" + biasVelocity);\n\n\n            //Compute effective mass matrix\n            if (connectionA.isDynamic && connectionB.isDynamic)\n            {\n                Vector3 aAngular;\n                Matrix3x3.Transform(ref jAngularA, ref connectionA.localInertiaTensorInverse, out aAngular);\n                Vector3.Cross(ref aAngular, ref offsetA, out aAngular);\n                Vector3 bAngular;\n                Matrix3x3.Transform(ref jAngularB, ref connectionB.localInertiaTensorInverse, out bAngular);\n                Vector3.Cross(ref bAngular, ref offsetB, out bAngular);\n                Vector3.Add(ref aAngular, ref bAngular, out aAngular);\n                Vector3.Dot(ref aAngular, ref jLinearB, out velocityToImpulse);\n                velocityToImpulse += connectionA.inverseMass + connectionB.inverseMass;\n            }\n            else if (connectionA.isDynamic)\n            {\n                Vector3 aAngular;\n                Matrix3x3.Transform(ref jAngularA, ref connectionA.localInertiaTensorInverse, out aAngular);\n                Vector3.Cross(ref aAngular, ref offsetA, out aAngular);\n                Vector3.Dot(ref aAngular, ref jLinearB, out velocityToImpulse);\n                velocityToImpulse += connectionA.inverseMass;\n            }\n            else if (connectionB.isDynamic)\n            {\n                Vector3 bAngular;\n                Matrix3x3.Transform(ref jAngularB, ref connectionB.localInertiaTensorInverse, out bAngular);\n                Vector3.Cross(ref bAngular, ref offsetB, out bAngular);\n                Vector3.Dot(ref bAngular, ref jLinearB, out velocityToImpulse);\n                velocityToImpulse += connectionB.inverseMass;\n            }\n            else\n            {\n                //No point in trying to solve with two kinematics.\n                isActiveInSolver = false;\n                accumulatedImpulse = 0;\n                return;\n            }\n\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n\n            velocityToImpulse = 1 / (softness + velocityToImpulse);\n            //Finish computing jacobian; it's down here as an optimization (since it didn't need to be negated in mass matrix)\n            jAngularA.X = -jAngularA.X;\n            jAngularA.Y = -jAngularA.Y;\n            jAngularA.Z = -jAngularA.Z;\n\n            //Compute bias velocity\n            if (distance > maximumLength)\n                error = Math.Max(0, distance - maximumLength - Margin);\n            else\n                error = Math.Max(0, minimumLength - Margin - distance);\n            biasVelocity = Math.Min(errorReduction * error, maxCorrectiveVelocity);\n            if (bounciness > 0)\n            {\n                //Compute currently relative velocity for bounciness.\n                float relativeVelocity, dot;\n                Vector3.Dot(ref jLinearA, ref connectionA.linearVelocity, out relativeVelocity);\n                Vector3.Dot(ref jAngularA, ref connectionA.angularVelocity, out dot);\n                relativeVelocity += dot;\n                Vector3.Dot(ref jLinearB, ref connectionB.linearVelocity, out dot);\n                relativeVelocity += dot;\n                Vector3.Dot(ref jAngularB, ref connectionB.angularVelocity, out dot);\n                relativeVelocity += dot;\n                if (-relativeVelocity > bounceVelocityThreshold)\n                    biasVelocity = Math.Max(biasVelocity, -relativeVelocity * bounciness);\n            }\n\n            \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Warm starting\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearA, accumulatedImpulse, out impulse);\n                connectionA.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularA, accumulatedImpulse, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearB, accumulatedImpulse, out impulse);\n                connectionB.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularB, accumulatedImpulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/JointLimits/EllipseSwingLimit.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Constraints.TwoEntity.JointLimits\n{\n    /// <summary>\n    /// Constrains the relative orientation of two entities to within an ellipse.\n    /// </summary>\n    public class EllipseSwingLimit : JointLimit, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private readonly JointBasis3D basis = new JointBasis3D();\n        private float accumulatedImpulse;\n        private float biasVelocity;\n        private Vector3 jacobianA, jacobianB;\n        private float error;\n\n        private Vector3 localTwistAxisB;\n        private float maximumAngleX;\n        private float maximumAngleY;\n        private Vector3 worldTwistAxisB;\n        private float velocityToImpulse;\n\n        /// <summary>\n        /// Constructs a new swing limit.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the TwistAxis (or its entity-local version),\n        /// the MaximumAngleX and MaximumAngleY,\n        /// and the Basis.\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public EllipseSwingLimit()\n        {\n            SpringSettings.StiffnessConstant /= 5;\n            SpringSettings.Advanced.ErrorReductionFactor /= 5;\n            Margin = .05f;\n\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a new swing limit.\n        /// </summary>\n        /// <param name=\"connectionA\">First entity connected by the constraint.</param>\n        /// <param name=\"connectionB\">Second entity connected by the constraint.</param>\n        /// <param name=\"twistAxis\">Axis in world space to use as the initial unrestricted twist direction.\n        /// This direction will be transformed to entity A's local space to form the basis's primary axis\n        /// and to entity B's local space to form its twist axis.\n        /// The basis's x and y axis are automatically created from the twist axis.</param>\n        /// <param name=\"maximumAngleX\">Maximum angle of rotation around the basis X axis.</param>\n        /// <param name=\"maximumAngleY\">Maximum angle of rotation around the basis Y axis.</param>\n        public EllipseSwingLimit(Entity connectionA, Entity connectionB, Vector3 twistAxis, float maximumAngleX, float maximumAngleY)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n            SetupJointTransforms(twistAxis);\n            MaximumAngleX = maximumAngleX;\n            MaximumAngleY = maximumAngleY;\n\n            SpringSettings.StiffnessConstant /= 5;\n            SpringSettings.Advanced.ErrorReductionFactor /= 5;\n            Margin = .05f;\n        }\n\n        /// <summary>\n        /// Constructs a new swing limit.\n        /// Using this constructor will leave the limit uninitialized.  Before using the limit in a simulation, be sure to set the basis axes using\n        /// limit.basis.setLocalAxes or limit.basis.setWorldAxes and b's twist axis using the localTwistAxisB or twistAxisB properties.\n        /// </summary>\n        /// <param name=\"connectionA\">First entity connected by the constraint.</param>\n        /// <param name=\"connectionB\">Second entity connected by the constraint.</param>\n        public EllipseSwingLimit(Entity connectionA, Entity connectionB)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n\n\n            SpringSettings.StiffnessConstant /= 5;\n            SpringSettings.Advanced.ErrorReductionFactor /= 5;\n            Margin = .05f;\n        }\n\n        /// <summary>\n        /// Gets the basis attached to entity A.\n        /// The primary axis is the \"twist\" axis attached to entity A.\n        /// The xAxis is the axis around which the angle will be limited by maximumAngleX.\n        /// Similarly, the yAxis is the axis around which the angle will be limited by maximumAngleY.\n        /// </summary>\n        public JointBasis3D Basis\n        {\n            get { return basis; }\n        }\n\n        /// <summary>\n        /// Gets or sets the twist axis attached to entity B in its local space.\n        /// The transformed twist axis will be used to determine the angles around entity A's basis axes.\n        /// </summary>\n        public Vector3 LocalTwistAxisB\n        {\n            get { return localTwistAxisB; }\n            set\n            {\n                localTwistAxisB = value;\n                Matrix3x3.Transform(ref localTwistAxisB, ref connectionB.orientationMatrix, out worldTwistAxisB);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum angle of rotation around the x axis.\n        /// This can be thought of as the major radius of the swing limit's ellipse.\n        /// </summary>\n        public float MaximumAngleX\n        {\n            get { return maximumAngleX; }\n            set { maximumAngleX = MathHelper.Clamp(value, Toolbox.BigEpsilon, MathHelper.Pi); }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum angle of rotation around the y axis.\n        /// This can be thought of as the minor radius of the swing limit's ellipse.\n        /// </summary>\n        public float MaximumAngleY\n        {\n            get { return maximumAngleY; }\n            set { maximumAngleY = MathHelper.Clamp(value, Toolbox.BigEpsilon, MathHelper.Pi); }\n        }\n\n        /// <summary>\n        /// Gets or sets the twist axis attached to entity B in world space.\n        /// The transformed twist axis will be used to determine the angles around entity A's basis axes.\n        /// </summary>\n        public Vector3 TwistAxisB\n        {\n            get { return worldTwistAxisB; }\n            set\n            {\n                worldTwistAxisB = value;\n                Matrix3x3.TransformTranspose(ref worldTwistAxisB, ref connectionB.orientationMatrix, out localTwistAxisB);\n            }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                if (isLimitActive)\n                {\n                    float velocityA, velocityB;\n                    Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n                    Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n                    return velocityA + velocityB;\n                }\n                return 0;\n            }\n        }\n\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jacobianA;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jacobianB;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = velocityToImpulse;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Sets up the joint transforms by automatically creating perpendicular vectors to complete the bases.\n        /// </summary>\n        /// <param name=\"twistAxis\">Axis around which rotation is allowed.</param>\n        public void SetupJointTransforms(Vector3 twistAxis)\n        {\n            //Compute a vector which is perpendicular to the axis.  It'll be added in local space to both connections.\n            Vector3 xAxis;\n            Vector3.Cross(ref twistAxis, ref Toolbox.UpVector, out xAxis);\n            float length = xAxis.LengthSquared();\n            if (length < Toolbox.Epsilon)\n            {\n                Vector3.Cross(ref twistAxis, ref Toolbox.RightVector, out xAxis);\n            }\n\n            Vector3 yAxis;\n            Vector3.Cross(ref twistAxis, ref xAxis, out yAxis);\n\n            //Put the axes into the joint transform of A.\n            basis.rotationMatrix = connectionA.orientationMatrix;\n            basis.SetWorldAxes(twistAxis, xAxis, yAxis);\n\n\n            //Put the axes into the 'joint transform' of B too.\n            TwistAxisB = twistAxis;\n        }\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n            float velocityA, velocityB;\n            //Find the velocity contribution from each connection\n            Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n            Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n            //Add in the constraint space bias velocity\n            float lambda = (-velocityA - velocityB) - biasVelocity - softness * accumulatedImpulse;\n\n            //Transform to an impulse\n            lambda *= velocityToImpulse;\n\n            //Clamp accumulated impulse (can't go negative)\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Min(accumulatedImpulse + lambda, 0);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, lambda, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, lambda, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return (Math.Abs(lambda));\n        }\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            //Transform the axes into world space.\n            basis.rotationMatrix = connectionA.orientationMatrix;\n            basis.ComputeWorldSpaceAxes();\n            Matrix3x3.Transform(ref localTwistAxisB, ref connectionB.orientationMatrix, out worldTwistAxisB);\n\n            //Compute the individual swing angles.\n            Quaternion relativeRotation;\n            Toolbox.GetQuaternionBetweenNormalizedVectors(ref worldTwistAxisB, ref basis.primaryAxis, out relativeRotation);\n            Vector3 axis;\n            float angle;\n            Toolbox.GetAxisAngleFromQuaternion(ref relativeRotation, out axis, out angle);\n\n#if !WINDOWS\n            Vector3 axisAngle = new Vector3();\n#else\n            Vector3 axisAngle;\n#endif\n            axisAngle.X = axis.X * angle;\n            axisAngle.Y = axis.Y * angle;\n            axisAngle.Z = axis.Z * angle;\n\n            float angleX;\n            Vector3.Dot(ref axisAngle, ref basis.xAxis, out angleX);\n            float angleY;\n            Vector3.Dot(ref axisAngle, ref basis.yAxis, out angleY);\n\n\n            float maxAngleXSquared = maximumAngleX * maximumAngleX;\n            float maxAngleYSquared = maximumAngleY * maximumAngleY;\n            error = angleX * angleX * maxAngleYSquared + angleY * angleY * maxAngleXSquared - maxAngleXSquared * maxAngleYSquared;\n\n\n            //float ellipseAngle = (float)Math.Atan2(angleY, angleX) + MathHelper.PiOver2;\n            ////This angle may need to have pi/2 added to it, since it is perpendicular\n\n            ////Compute the maximum angle, based on the ellipse\n            //float cosAngle = (float)Math.Cos(ellipseAngle);\n            //float sinAngle = (float)Math.Sin(ellipseAngle);\n            //float denominator = myMaximumAngleX * cosAngle;\n            //denominator *= denominator;\n            //float denominator2 = myMaximumAngleY * sinAngle;\n            //denominator += denominator2 * denominator2;\n            //denominator = (float)Math.Sqrt(denominator);\n\n            //float maximumAngle = myMaximumAngleX * myMaximumAngleY / denominator;\n            //myError = angle - maximumAngle;\n\n            //myError = angleX * angleX / (myMaximumAngleX * myMaximumAngleX) + angleY * angleY / (myMaximumAngleY * myMaximumAngleY) - 1;\n            if (error <= 0)\n            {\n                isActiveInSolver = false;\n                error = 0;\n                accumulatedImpulse = 0;\n                isLimitActive = false;\n                return;\n            }\n            isLimitActive = true;\n\n#if !WINDOWS\n            Vector2 tangent = new Vector2();\n#else\n            Vector2 tangent;\n#endif\n            //tangent.X = angleX * myMaximumAngleY / myMaximumAngleX;\n            //tangent.Y = angleY * myMaximumAngleX / myMaximumAngleY;\n            tangent.X = angleX / maxAngleXSquared;\n            tangent.Y = angleY / maxAngleYSquared;\n            tangent.Normalize();\n\n            //Create a rotation which swings our basis 'out' to b's world orientation.\n            Quaternion.Conjugate(ref relativeRotation, out relativeRotation);\n            Vector3 sphereTangentX, sphereTangentY;\n            Vector3.Transform(ref basis.xAxis, ref relativeRotation, out sphereTangentX);\n            Vector3.Transform(ref basis.yAxis, ref relativeRotation, out sphereTangentY);\n\n            Vector3.Multiply(ref sphereTangentX, tangent.X, out jacobianA); //not actually jA, just storing it there.\n            Vector3.Multiply(ref sphereTangentY, tangent.Y, out jacobianB); //not actually jB, just storing it there.\n            Vector3.Add(ref jacobianA, ref jacobianB, out jacobianA);\n            //jacobianA = tangent.X * sphereTangentX + tangent.Y * sphereTangentY;\n\n            jacobianB.X = -jacobianA.X;\n            jacobianB.Y = -jacobianA.Y;\n            jacobianB.Z = -jacobianA.Z;\n\n\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n\n            //Compute the error correcting velocity\n            error = error - margin;\n            biasVelocity = MathHelper.Min(Math.Max(error, 0) * errorReduction, maxCorrectiveVelocity);\n            if (bounciness > 0)\n            {\n                float relativeVelocity;\n                float dot;\n                //Find the velocity contribution from each connection\n                Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out relativeVelocity);\n                Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out dot);\n                relativeVelocity += dot;\n                relativeVelocity /= 5; //HEEAAAAACK\n                if (relativeVelocity > bounceVelocityThreshold)\n                    biasVelocity = MathHelper.Max(biasVelocity, bounciness * relativeVelocity);\n            }\n\n\n            //****** EFFECTIVE MASS MATRIX ******//\n            //Connection A's contribution to the mass matrix\n            float entryA;\n            Vector3 transformedAxis;\n            if (connectionA.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianA, ref connectionA.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianA, out entryA);\n            }\n            else\n                entryA = 0;\n\n            //Connection B's contribution to the mass matrix\n            float entryB;\n            if (connectionB.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianB, ref connectionB.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianB, out entryB);\n            }\n            else\n                entryB = 0;\n\n            //Compute the inverse mass matrix\n            velocityToImpulse = 1 / (softness + entryA + entryB);\n\n            \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //****** WARM STARTING ******//\n            //Apply accumulated impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, accumulatedImpulse, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, accumulatedImpulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/JointLimits/JointLimit.cs",
    "content": "﻿using System;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.TwoEntity.JointLimits\n{\n    /// <summary>\n    /// Superclass of constraints which have a limited area of free movement.\n    /// </summary>\n    public abstract class JointLimit : Joint\n    {\n        /// <summary>\n        /// Minimum velocity necessary for a bounce to occur at a joint limit.\n        /// </summary>\n        protected float bounceVelocityThreshold = 1;\n\n        /// <summary>\n        /// Bounciness of this joint limit.  0 is completely inelastic; 1 is completely elastic.\n        /// </summary>\n        protected float bounciness;\n\n        protected bool isLimitActive;\n\n        /// <summary>\n        /// Small area that the constraint can be violated without applying position correction.  Helps avoid jitter.\n        /// </summary>\n        protected float margin = 0.005f;\n\n        /// <summary>\n        /// Gets or sets the minimum velocity necessary for a bounce to occur at a joint limit.\n        /// </summary>\n        public float BounceVelocityThreshold\n        {\n            get { return bounceVelocityThreshold; }\n            set { bounceVelocityThreshold = Math.Max(0, value); }\n        }\n\n        /// <summary>\n        /// Gets or sets the bounciness of this joint limit.  0 is completely inelastic; 1 is completely elastic.\n        /// </summary>\n        public float Bounciness\n        {\n            get { return bounciness; }\n            set { bounciness = MathHelper.Clamp(value, 0, 1); }\n        }\n\n        /// <summary>\n        /// Gets whether or not the limit is currently exceeded.  While violated, the constraint will apply impulses in an attempt to stop further violation and to correct any current error.\n        /// This is true whenever the limit is touched.\n        /// </summary>\n        public bool IsLimitExceeded\n        {\n            get { return isLimitActive; }\n        }\n\n        /// <summary>\n        /// Gets or sets the small area that the constraint can be violated without applying position correction.  Helps avoid jitter.\n        /// </summary>\n        public float Margin\n        {\n            get { return margin; }\n            set { margin = MathHelper.Max(value, 0); }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/JointLimits/LinearAxisLimit.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Constraints.TwoEntity.JointLimits\n{\n    /// <summary>\n    /// Constrains the distance along an axis between anchor points attached to two entities.\n    /// </summary>\n    public class LinearAxisLimit : JointLimit, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private float accumulatedImpulse;\n        private float biasVelocity;\n        private Vector3 jAngularA, jAngularB;\n        private Vector3 jLinearA, jLinearB;\n        private Vector3 localAnchorA;\n        private Vector3 localAnchorB;\n        private float massMatrix;\n        private float error;\n        private Vector3 localAxis;\n        private float maximum;\n        private float minimum;\n        private Vector3 worldAxis;\n        private Vector3 rA; //Jacobian entry for entity A.\n        private float unadjustedError;\n        private Vector3 worldAnchorA;\n        private Vector3 worldAnchorB;\n        private Vector3 worldOffsetA, worldOffsetB;\n\n        /// <summary>\n        /// Constructs a constraint which tries to keep anchors on two entities within a certain distance of each other along an axis.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the AnchorA, AnchorB, and Axis (or their entity-local versions),\n        /// and the Minimum and Maximum.\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public LinearAxisLimit()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a constraint which tries to keep anchors on two entities within a certain distance of each other along an axis.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        /// <param name=\"anchorA\">World space point to attach to connection A that will be constrained.</param>\n        /// <param name=\"anchorB\">World space point to attach to connection B that will be constrained.</param>\n        /// <param name=\"axis\">Limited axis in world space to attach to connection A.</param>\n        /// <param name=\"minimum\">Minimum allowed position along the axis.</param>\n        /// <param name=\"maximum\">Maximum allowed position along the axis.</param>\n        public LinearAxisLimit(Entity connectionA, Entity connectionB, Vector3 anchorA, Vector3 anchorB, Vector3 axis, float minimum, float maximum)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n            AnchorA = anchorA;\n            AnchorB = anchorB;\n            Axis = axis;\n            Minimum = minimum;\n            Maximum = maximum;\n        }\n\n        /// <summary>\n        /// Gets or sets the anchor point attached to entity A in world space.\n        /// </summary>\n        public Vector3 AnchorA\n        {\n            get { return worldAnchorA; }\n            set\n            {\n                worldAnchorA = value;\n                worldOffsetA = worldAnchorA - connectionA.position;\n                Matrix3x3.TransformTranspose(ref worldOffsetA, ref connectionA.orientationMatrix, out localAnchorA);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the anchor point attached to entity A in world space.\n        /// </summary>\n        public Vector3 AnchorB\n        {\n            get { return worldAnchorB; }\n            set\n            {\n                worldAnchorB = value;\n                worldOffsetB = worldAnchorB - connectionB.position;\n                Matrix3x3.TransformTranspose(ref worldOffsetB, ref connectionB.orientationMatrix, out localAnchorB);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the limited axis in world space.\n        /// </summary>\n        public Vector3 Axis\n        {\n            get { return worldAxis; }\n            set\n            {\n                worldAxis = Vector3.Normalize(value);\n                Matrix3x3.TransformTranspose(ref worldAxis, ref connectionA.orientationMatrix, out localAxis);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the limited axis in the local space of connection A.\n        /// </summary>\n        public Vector3 LocalAxis\n        {\n            get { return localAxis; }\n            set\n            {\n                localAxis = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localAxis, ref connectionA.orientationMatrix, out worldAxis);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the first entity's center of mass to the anchor point in its local space.\n        /// </summary>\n        public Vector3 LocalOffsetA\n        {\n            get { return localAnchorA; }\n            set\n            {\n                localAnchorA = value;\n                Matrix3x3.Transform(ref localAnchorA, ref connectionA.orientationMatrix, out worldOffsetA);\n                worldAnchorA = connectionA.position + worldOffsetA;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the second entity's center of mass to the anchor point in its local space.\n        /// </summary>\n        public Vector3 LocalOffsetB\n        {\n            get { return localAnchorB; }\n            set\n            {\n                localAnchorB = value;\n                Matrix3x3.Transform(ref localAnchorB, ref connectionB.orientationMatrix, out worldOffsetB);\n                worldAnchorB = connectionB.position + worldOffsetB;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum allowed distance along the axis.\n        /// </summary>\n        public float Maximum\n        {\n            get { return maximum; }\n            set\n            {\n                maximum = value;\n                minimum = MathHelper.Min(minimum, maximum);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the minimum allowed distance along the axis.\n        /// </summary>\n        public float Minimum\n        {\n            get { return minimum; }\n            set\n            {\n                minimum = value;\n                maximum = MathHelper.Max(minimum, maximum);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the first entity's center of mass to the anchor point in world space.\n        /// </summary>\n        public Vector3 OffsetA\n        {\n            get { return worldOffsetA; }\n            set\n            {\n                worldOffsetA = value;\n                worldAnchorA = connectionA.position + worldOffsetA;\n                Matrix3x3.TransformTranspose(ref worldOffsetA, ref connectionA.orientationMatrix, out localAnchorA);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the second entity's center of mass to the anchor point in world space.\n        /// </summary>\n        public Vector3 OffsetB\n        {\n            get { return worldOffsetB; }\n            set\n            {\n                worldOffsetB = value;\n                worldAnchorB = connectionB.position + worldOffsetB;\n                Matrix3x3.TransformTranspose(ref worldOffsetB, ref connectionB.orientationMatrix, out localAnchorB);\n            }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                if (isLimitActive)\n                {\n                    float lambda, dot;\n                    Vector3.Dot(ref jLinearA, ref connectionA.linearVelocity, out lambda);\n                    Vector3.Dot(ref jAngularA, ref connectionA.angularVelocity, out dot);\n                    lambda += dot;\n                    Vector3.Dot(ref jLinearB, ref connectionB.linearVelocity, out dot);\n                    lambda += dot;\n                    Vector3.Dot(ref jAngularB, ref connectionB.angularVelocity, out dot);\n                    lambda += dot;\n                    return lambda;\n                }\n                return 0;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        //Jacobians\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jLinearA;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jLinearB;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jAngularA;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jAngularB;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = massMatrix;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n            //Compute the current relative velocity.\n            float lambda, dot;\n            Vector3.Dot(ref jLinearA, ref connectionA.linearVelocity, out lambda);\n            Vector3.Dot(ref jAngularA, ref connectionA.angularVelocity, out dot);\n            lambda += dot;\n            Vector3.Dot(ref jLinearB, ref connectionB.linearVelocity, out dot);\n            lambda += dot;\n            Vector3.Dot(ref jAngularB, ref connectionB.angularVelocity, out dot);\n            lambda += dot;\n\n            //Add in the constraint space bias velocity\n            lambda = -lambda + biasVelocity - softness * accumulatedImpulse;\n\n            //Transform to an impulse\n            lambda *= massMatrix;\n\n            //Clamp accumulated impulse (can't go negative)\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            if (unadjustedError < 0)\n                accumulatedImpulse = MathHelper.Min(accumulatedImpulse + lambda, 0);\n            else\n                accumulatedImpulse = MathHelper.Max(accumulatedImpulse + lambda, 0);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearA, lambda, out impulse);\n                connectionA.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularA, lambda, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearB, lambda, out impulse);\n                connectionB.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularB, lambda, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return (Math.Abs(lambda));\n        }\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            //Compute the 'pre'-jacobians\n            Matrix3x3.Transform(ref localAnchorA, ref connectionA.orientationMatrix, out worldOffsetA);\n            Matrix3x3.Transform(ref localAnchorB, ref connectionB.orientationMatrix, out worldOffsetB);\n            Vector3.Add(ref worldOffsetA, ref connectionA.position, out worldAnchorA);\n            Vector3.Add(ref worldOffsetB, ref connectionB.position, out worldAnchorB);\n            Vector3.Subtract(ref worldAnchorB, ref connectionA.position, out rA);\n            Matrix3x3.Transform(ref localAxis, ref connectionA.orientationMatrix, out worldAxis);\n\n            //Compute error\n#if !WINDOWS\n            Vector3 separation = new Vector3();\n#else\n            Vector3 separation;\n#endif\n            separation.X = worldAnchorB.X - worldAnchorA.X;\n            separation.Y = worldAnchorB.Y - worldAnchorA.Y;\n            separation.Z = worldAnchorB.Z - worldAnchorA.Z;\n\n            Vector3.Dot(ref separation, ref worldAxis, out unadjustedError);\n\n            //Compute error\n            if (unadjustedError < minimum)\n                unadjustedError = minimum - unadjustedError;\n            else if (unadjustedError > maximum)\n                unadjustedError = maximum - unadjustedError;\n            else\n            {\n                unadjustedError = 0;\n                isActiveInSolver = false;\n                accumulatedImpulse = 0;\n                isLimitActive = false;\n                return;\n            }\n            isLimitActive = true;\n\n            unadjustedError = -unadjustedError;\n            //Adjust Error\n            if (unadjustedError > 0)\n                error = MathHelper.Max(0, unadjustedError - margin);\n            else if (unadjustedError < 0)\n                error = MathHelper.Min(0, unadjustedError + margin);\n\n            //Compute jacobians\n            jLinearA = worldAxis;\n            jLinearB.X = -jLinearA.X;\n            jLinearB.Y = -jLinearA.Y;\n            jLinearB.Z = -jLinearA.Z;\n            Vector3.Cross(ref rA, ref jLinearA, out jAngularA);\n            Vector3.Cross(ref worldOffsetB, ref jLinearB, out jAngularB);\n\n            //Compute bias\n            float errorReductionParameter;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReductionParameter, out softness);\n\n            biasVelocity = MathHelper.Clamp(errorReductionParameter * error, -maxCorrectiveVelocity, maxCorrectiveVelocity);\n            if (bounciness > 0)\n            {\n                //Compute currently relative velocity for bounciness.\n                float relativeVelocity, dot;\n                Vector3.Dot(ref jLinearA, ref connectionA.linearVelocity, out relativeVelocity);\n                Vector3.Dot(ref jAngularA, ref connectionA.angularVelocity, out dot);\n                relativeVelocity += dot;\n                Vector3.Dot(ref jLinearB, ref connectionB.linearVelocity, out dot);\n                relativeVelocity += dot;\n                Vector3.Dot(ref jAngularB, ref connectionB.angularVelocity, out dot);\n                relativeVelocity += dot;\n                if (unadjustedError > 0 && -relativeVelocity > bounceVelocityThreshold)\n                    biasVelocity = Math.Max(biasVelocity, -relativeVelocity * bounciness);\n                else if (unadjustedError < 0 && relativeVelocity > bounceVelocityThreshold)\n                    biasVelocity = Math.Min(biasVelocity, -relativeVelocity * bounciness);\n            }\n\n\n            //compute mass matrix\n            float entryA, entryB;\n            Vector3 intermediate;\n            if (connectionA.isDynamic)\n            {\n                Matrix3x3.Transform(ref jAngularA, ref connectionA.inertiaTensorInverse, out intermediate);\n                Vector3.Dot(ref intermediate, ref jAngularA, out entryA);\n                entryA += connectionA.inverseMass;\n            }\n            else\n                entryA = 0;\n            if (connectionB.isDynamic)\n            {\n                Matrix3x3.Transform(ref jAngularB, ref connectionB.inertiaTensorInverse, out intermediate);\n                Vector3.Dot(ref intermediate, ref jAngularB, out entryB);\n                entryB += connectionB.inverseMass;\n            }\n            else\n                entryB = 0;\n            massMatrix = 1 / (entryA + entryB + softness);\n\n\n            \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Warm starting\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearA, accumulatedImpulse, out impulse);\n                connectionA.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularA, accumulatedImpulse, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearB, accumulatedImpulse, out impulse);\n                connectionB.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularB, accumulatedImpulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        } \n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/JointLimits/RevoluteLimit.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.TwoEntity.JointLimits\n{\n    /// <summary>\n    /// Constraint which prevents the connected entities from rotating relative to each other around an axis beyond given limits.\n    /// </summary>\n    public class RevoluteLimit : JointLimit, I2DImpulseConstraintWithError, I2DJacobianConstraint\n    {\n        private readonly JointBasis2D basis = new JointBasis2D();\n\n        private Vector2 accumulatedImpulse;\n        private Vector2 biasVelocity;\n        private Vector3 jacobianMaxA;\n        private Vector3 jacobianMaxB;\n        private Vector3 jacobianMinA;\n        private Vector3 jacobianMinB;\n        private bool maxIsActive;\n        private bool minIsActive;\n        private Vector2 error;\n        private Vector3 localTestAxis;\n\n        /// <summary>\n        /// Naximum angle that entities can twist.\n        /// </summary>\n        protected float maximumAngle;\n\n        /// <summary>\n        /// Minimum angle that entities can twist.\n        /// </summary>\n        protected float minimumAngle;\n\n        private Vector3 worldTestAxis;\n        private Vector2 velocityToImpulse;\n\n        /// <summary>\n        /// Constructs a new constraint which prevents the connected entities from rotating relative to each other around an axis beyond given limits.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the TestAxis (or its entity-local version) and the Basis.\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public RevoluteLimit()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a new constraint which prevents the connected entities from rotating relative to each other around an axis beyond given limits.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        /// <param name=\"limitedAxis\">Axis of rotation to be limited.</param>\n        /// <param name=\"testAxis\">Axis attached to connectionB that is tested to determine the current angle.\n        /// Will also be used as the base rotation axis representing 0 degrees.</param>\n        /// <param name=\"minimumAngle\">Minimum twist angle allowed.</param>\n        /// <param name=\"maximumAngle\">Maximum twist angle allowed.</param>\n        public RevoluteLimit(Entity connectionA, Entity connectionB, Vector3 limitedAxis, Vector3 testAxis, float minimumAngle, float maximumAngle)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n\n            //Put the axes into the joint transform of A.\n            basis.rotationMatrix = this.connectionA.orientationMatrix;\n            basis.SetWorldAxes(limitedAxis, testAxis);\n\n            //Put the axes into the 'joint transform' of B too.\n            TestAxis = basis.xAxis;\n\n            MinimumAngle = minimumAngle;\n            MaximumAngle = maximumAngle;\n        }\n\n\n        /// <summary>\n        /// Constructs a new constraint which prevents the connected entities from rotating relative to each other around an axis beyond given limits.\n        /// Using this constructor will leave the limit uninitialized.  Before using the limit in a simulation, be sure to set the basis axes using\n        /// Basis.SetLocalAxes or Basis.SetWorldAxes and the test axis using the LocalTestAxis or TestAxis properties.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        public RevoluteLimit(Entity connectionA, Entity connectionB)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n        }\n\n        /// <summary>\n        /// Gets the basis attached to entity A.\n        /// The primary axis represents the limited axis of rotation.  The 'measurement plane' which the test axis is tested against is based on this primary axis.\n        /// The x axis defines the 'base' direction on the measurement plane corresponding to 0 degrees of relative rotation.\n        /// </summary>\n        public JointBasis2D Basis\n        {\n            get { return basis; }\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to entity B in its local space that will be tested against the limits.\n        /// </summary>\n        public Vector3 LocalTestAxis\n        {\n            get { return localTestAxis; }\n            set\n            {\n                localTestAxis = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localTestAxis, ref connectionB.orientationMatrix, out worldTestAxis);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum angle that entities can twist.\n        /// </summary>\n        public float MaximumAngle\n        {\n            get { return maximumAngle; }\n            set\n            {\n                maximumAngle = value % (MathHelper.TwoPi);\n                if (minimumAngle > MathHelper.Pi)\n                    minimumAngle -= MathHelper.TwoPi;\n                if (minimumAngle <= -MathHelper.Pi)\n                    minimumAngle += MathHelper.TwoPi;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the minimum angle that entities can twist.\n        /// </summary>\n        public float MinimumAngle\n        {\n            get { return minimumAngle; }\n            set\n            {\n                minimumAngle = value % (MathHelper.TwoPi);\n                if (minimumAngle > MathHelper.Pi)\n                    minimumAngle -= MathHelper.TwoPi;\n                if (minimumAngle <= -MathHelper.Pi)\n                    minimumAngle += MathHelper.TwoPi;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to entity B in world space that will be tested against the limits.\n        /// </summary>\n        public Vector3 TestAxis\n        {\n            get { return worldTestAxis; }\n            set\n            {\n                worldTestAxis = Vector3.Normalize(value);\n                Matrix3x3.TransformTranspose(ref worldTestAxis, ref connectionB.orientationMatrix, out localTestAxis);\n            }\n        }\n\n        #region I2DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// The revolute limit is special; internally, it is sometimes two constraints.\n        /// The X value of the vector is the \"minimum\" plane of the limit, and the Y value is the \"maximum\" plane.\n        /// If a plane isn't active, its error is zero.\n        /// </summary>\n        public Vector2 RelativeVelocity\n        {\n            get\n            {\n                if (isLimitActive)\n                {\n                    float velocityA, velocityB;\n                    Vector2 toReturn = Vector2.Zero;\n                    if (minIsActive)\n                    {\n                        Vector3.Dot(ref connectionA.angularVelocity, ref jacobianMinA, out velocityA);\n                        Vector3.Dot(ref connectionB.angularVelocity, ref jacobianMinB, out velocityB);\n                        toReturn.X = velocityA + velocityB;\n                    }\n                    if (maxIsActive)\n                    {\n                        Vector3.Dot(ref connectionA.angularVelocity, ref jacobianMaxA, out velocityA);\n                        Vector3.Dot(ref connectionB.angularVelocity, ref jacobianMaxB, out velocityB);\n                        toReturn.Y = velocityA + velocityB;\n                    }\n                    return toReturn;\n                }\n                return new Vector2();\n            }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// The x component corresponds to the minimum plane limit,\n        /// while the y component corresponds to the maximum plane limit.\n        /// </summary>\n        public Vector2 TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// The x component corresponds to the minimum plane limit,\n        /// while the y component corresponds to the maximum plane limit.\n        /// </summary>\n        public Vector2 Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        //Newer version of revolute limit will use up to two planes.  This is sort of like being a double-constraint, with two jacobians and everything.\n        //Not going to solve both plane limits simultaneously because they can be redundant.  De-linking them will let the system deal with redundancy better.\n\n        #region I2DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = Toolbox.ZeroVector;\n            jacobianY = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = Toolbox.ZeroVector;\n            jacobianY = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = jacobianMinA;\n            jacobianY = jacobianMaxA;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = jacobianMinB;\n            jacobianY = jacobianMaxB;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the revolute limit.\n        /// The revolute limit is special; in terms of solving, it is\n        /// actually sometimes TWO constraints; a minimum plane, and a\n        /// maximum plane.  The M11 field represents the minimum plane mass matrix\n        /// and the M22 field represents the maximum plane mass matrix.\n        /// </summary>\n        /// <param name=\"massMatrix\">Mass matrix of the constraint.</param>\n        public void GetMassMatrix(out Matrix2x2 massMatrix)\n        {\n            massMatrix.M11 = velocityToImpulse.X;\n            massMatrix.M22 = velocityToImpulse.Y;\n            massMatrix.M12 = 0;\n            massMatrix.M21 = 0;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n            float lambda;\n            float lambdaTotal = 0;\n            float velocityA, velocityB;\n            float previousAccumulatedImpulse;\n            if (minIsActive)\n            {\n                //Find the velocity contribution from each connection\n                Vector3.Dot(ref connectionA.angularVelocity, ref jacobianMinA, out velocityA);\n                Vector3.Dot(ref connectionB.angularVelocity, ref jacobianMinB, out velocityB);\n                //Add in the constraint space bias velocity\n                lambda = -(velocityA + velocityB) + biasVelocity.X - softness * accumulatedImpulse.X;\n\n                //Transform to an impulse\n                lambda *= velocityToImpulse.X;\n\n                //Clamp accumulated impulse (can't go negative)\n                previousAccumulatedImpulse = accumulatedImpulse.X;\n                accumulatedImpulse.X = MathHelper.Max(accumulatedImpulse.X + lambda, 0);\n                lambda = accumulatedImpulse.X - previousAccumulatedImpulse;\n\n                //Apply the impulse\n                Vector3 impulse;\n                if (connectionA.isDynamic)\n                {\n                    Vector3.Multiply(ref jacobianMinA, lambda, out impulse);\n                    connectionA.ApplyAngularImpulse(ref impulse);\n                }\n                if (connectionB.isDynamic)\n                {\n                    Vector3.Multiply(ref jacobianMinB, lambda, out impulse);\n                    connectionB.ApplyAngularImpulse(ref impulse);\n                }\n\n                lambdaTotal += Math.Abs(lambda);\n            }\n            if (maxIsActive)\n            {\n                //Find the velocity contribution from each connection\n                Vector3.Dot(ref connectionA.angularVelocity, ref jacobianMaxA, out velocityA);\n                Vector3.Dot(ref connectionB.angularVelocity, ref jacobianMaxB, out velocityB);\n                //Add in the constraint space bias velocity\n                lambda = -(velocityA + velocityB) + biasVelocity.Y - softness * accumulatedImpulse.Y;\n\n                //Transform to an impulse\n                lambda *= velocityToImpulse.Y;\n\n                //Clamp accumulated impulse (can't go negative)\n                previousAccumulatedImpulse = accumulatedImpulse.Y;\n                accumulatedImpulse.Y = MathHelper.Max(accumulatedImpulse.Y + lambda, 0);\n                lambda = accumulatedImpulse.Y - previousAccumulatedImpulse;\n\n                //Apply the impulse\n                Vector3 impulse;\n                if (connectionA.isDynamic)\n                {\n                    Vector3.Multiply(ref jacobianMaxA, lambda, out impulse);\n                    connectionA.ApplyAngularImpulse(ref impulse);\n                }\n                if (connectionB.isDynamic)\n                {\n                    Vector3.Multiply(ref jacobianMaxB, lambda, out impulse);\n                    connectionB.ApplyAngularImpulse(ref impulse);\n                }\n\n                lambdaTotal += Math.Abs(lambda);\n            }\n            return lambdaTotal;\n        }\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            //Transform the axes into world space.\n            basis.rotationMatrix = connectionA.orientationMatrix;\n            basis.ComputeWorldSpaceAxes();\n            Matrix3x3.Transform(ref localTestAxis, ref connectionB.orientationMatrix, out worldTestAxis);\n\n            //Compute the plane normals.\n            Vector3 minPlaneNormal, maxPlaneNormal;\n            //Rotate basisA y axis around the basisA primary axis.\n            Matrix rotation;\n            Matrix.CreateFromAxisAngle(ref basis.primaryAxis, minimumAngle + MathHelper.PiOver2, out rotation);\n            Vector3.TransformNormal(ref basis.xAxis, ref rotation, out minPlaneNormal);\n            Matrix.CreateFromAxisAngle(ref basis.primaryAxis, maximumAngle - MathHelper.PiOver2, out rotation);\n            Vector3.TransformNormal(ref basis.xAxis, ref rotation, out maxPlaneNormal);\n\n            //Compute the errors along the two normals.\n            float planePositionMin, planePositionMax;\n            Vector3.Dot(ref minPlaneNormal, ref worldTestAxis, out planePositionMin);\n            Vector3.Dot(ref maxPlaneNormal, ref worldTestAxis, out planePositionMax);\n\n\n            float span = GetDistanceFromMinimum(maximumAngle);\n\n            //Early out and compute the determine the plane normal.\n            if (span >= MathHelper.Pi)\n            {\n                if (planePositionMax > 0 || planePositionMin > 0)\n                {\n                    //It's in a perfectly valid configuration, so skip.\n                    isActiveInSolver = false;\n                    minIsActive = false;\n                    maxIsActive = false;\n                    error = Vector2.Zero;\n                    accumulatedImpulse = Vector2.Zero;\n                    isLimitActive = false;\n                    return;\n                }\n\n                if (planePositionMax > planePositionMin)\n                {\n                    //It's quicker to escape out to the max plane than the min plane.\n                    error.X = 0;\n                    error.Y = -planePositionMax;\n                    accumulatedImpulse.X = 0;\n                    minIsActive = false;\n                    maxIsActive = true;\n                }\n                else\n                {\n                    //It's quicker to escape out to the min plane than the max plane.\n                    error.X = -planePositionMin;\n                    error.Y = 0;\n                    accumulatedImpulse.Y = 0;\n                    minIsActive = true;\n                    maxIsActive = false;\n                }\n                //There's never a non-degenerate situation where having both planes active with a span \n                //greater than pi is useful.\n            }\n            else\n            {\n                if (planePositionMax > 0 && planePositionMin > 0)\n                {\n                    //It's in a perfectly valid configuration, so skip.\n                    isActiveInSolver = false;\n                    minIsActive = false;\n                    maxIsActive = false;\n                    error = Vector2.Zero;\n                    accumulatedImpulse = Vector2.Zero;\n                    isLimitActive = false;\n                    return;\n                }\n\n                if (planePositionMin <= 0 && planePositionMax <= 0)\n                {\n                    //Escape upward.\n                    //Activate both planes.\n                    error.X = -planePositionMin;\n                    error.Y = -planePositionMax;\n                    minIsActive = true;\n                    maxIsActive = true;\n                }\n                else if (planePositionMin <= 0)\n                {\n                    //It's quicker to escape out to the min plane than the max plane.\n                    error.X = -planePositionMin;\n                    error.Y = 0;\n                    accumulatedImpulse.Y = 0;\n                    minIsActive = true;\n                    maxIsActive = false;\n                }\n                else\n                {\n                    //It's quicker to escape out to the max plane than the min plane.\n                    error.X = 0;\n                    error.Y = -planePositionMax;\n                    accumulatedImpulse.X = 0;\n                    minIsActive = false;\n                    maxIsActive = true;\n                }\n            }\n            isLimitActive = true;\n\n\n            //****** VELOCITY BIAS ******//\n            //Compute the correction velocity\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n\n            //Compute the jacobians\n            if (minIsActive)\n            {\n                Vector3.Cross(ref minPlaneNormal, ref worldTestAxis, out jacobianMinA);\n                if (jacobianMinA.LengthSquared() < Toolbox.Epsilon)\n                {\n                    //The plane normal is aligned with the test axis.\n                    //Use the basis's free axis.\n                    jacobianMinA = basis.primaryAxis;\n                }\n                jacobianMinA.Normalize();\n                jacobianMinB.X = -jacobianMinA.X;\n                jacobianMinB.Y = -jacobianMinA.Y;\n                jacobianMinB.Z = -jacobianMinA.Z;\n            }\n            if (maxIsActive)\n            {\n                Vector3.Cross(ref maxPlaneNormal, ref worldTestAxis, out jacobianMaxA);\n                if (jacobianMaxA.LengthSquared() < Toolbox.Epsilon)\n                {\n                    //The plane normal is aligned with the test axis.\n                    //Use the basis's free axis.\n                    jacobianMaxA = basis.primaryAxis;\n                }\n                jacobianMaxA.Normalize();\n                jacobianMaxB.X = -jacobianMaxA.X;\n                jacobianMaxB.Y = -jacobianMaxA.Y;\n                jacobianMaxB.Z = -jacobianMaxA.Z;\n            }\n\n            //Error is always positive\n            if (minIsActive)\n            {\n                biasVelocity.X = MathHelper.Min(MathHelper.Max(0, error.X - margin) * errorReduction, maxCorrectiveVelocity);\n                if (bounciness > 0)\n                {\n                    float relativeVelocity;\n                    float dot;\n                    //Find the velocity contribution from each connection\n                    Vector3.Dot(ref connectionA.angularVelocity, ref jacobianMinA, out relativeVelocity);\n                    Vector3.Dot(ref connectionB.angularVelocity, ref jacobianMinB, out dot);\n                    relativeVelocity += dot;\n                    if (-relativeVelocity > bounceVelocityThreshold)\n                        biasVelocity.X = MathHelper.Max(biasVelocity.X, -bounciness * relativeVelocity);\n                }\n            }\n            if (maxIsActive)\n            {\n                biasVelocity.Y = MathHelper.Min(MathHelper.Max(0, error.Y - margin) * errorReduction, maxCorrectiveVelocity);\n                if (bounciness > 0)\n                {\n                    //Find the velocity contribution from each connection\n                    if (maxIsActive)\n                    {\n                        float relativeVelocity;\n                        Vector3.Dot(ref connectionA.angularVelocity, ref jacobianMaxA, out relativeVelocity);\n                        float dot;\n                        Vector3.Dot(ref connectionB.angularVelocity, ref jacobianMaxB, out dot);\n                        relativeVelocity += dot;\n                        if (-relativeVelocity > bounceVelocityThreshold)\n                            biasVelocity.Y = MathHelper.Max(biasVelocity.Y, -bounciness * relativeVelocity);\n                    }\n                }\n            }\n\n\n            //****** EFFECTIVE MASS MATRIX ******//\n            //Connection A's contribution to the mass matrix\n            float minEntryA, minEntryB;\n            float maxEntryA, maxEntryB;\n            Vector3 transformedAxis;\n            if (connectionA.isDynamic)\n            {\n                if (minIsActive)\n                {\n                    Matrix3x3.Transform(ref jacobianMinA, ref connectionA.inertiaTensorInverse, out transformedAxis);\n                    Vector3.Dot(ref transformedAxis, ref jacobianMinA, out minEntryA);\n                }\n                else\n                    minEntryA = 0;\n                if (maxIsActive)\n                {\n                    Matrix3x3.Transform(ref jacobianMaxA, ref connectionA.inertiaTensorInverse, out transformedAxis);\n                    Vector3.Dot(ref transformedAxis, ref jacobianMaxA, out maxEntryA);\n                }\n                else\n                    maxEntryA = 0;\n            }\n            else\n            {\n                minEntryA = 0;\n                maxEntryA = 0;\n            }\n            //Connection B's contribution to the mass matrix\n            if (connectionB.isDynamic)\n            {\n                if (minIsActive)\n                {\n                    Matrix3x3.Transform(ref jacobianMinB, ref connectionB.inertiaTensorInverse, out transformedAxis);\n                    Vector3.Dot(ref transformedAxis, ref jacobianMinB, out minEntryB);\n                }\n                else\n                    minEntryB = 0;\n                if (maxIsActive)\n                {\n                    Matrix3x3.Transform(ref jacobianMaxB, ref connectionB.inertiaTensorInverse, out transformedAxis);\n                    Vector3.Dot(ref transformedAxis, ref jacobianMaxB, out maxEntryB);\n                }\n                else\n                    maxEntryB = 0;\n            }\n            else\n            {\n                minEntryB = 0;\n                maxEntryB = 0;\n            }\n            //Compute the inverse mass matrix\n            //Notice that the mass matrix isn't linked, it's two separate ones.\n            velocityToImpulse.X = 1 / (softness + minEntryA + minEntryB);\n            velocityToImpulse.Y = 1 / (softness + maxEntryA + maxEntryB);\n\n            \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //****** WARM STARTING ******//\n            //Apply accumulated impulse\n            if (connectionA.isDynamic)\n            {\n                var impulse = new Vector3();\n                if (minIsActive)\n                {\n                    Vector3.Multiply(ref jacobianMinA, accumulatedImpulse.X, out impulse);\n                }\n                if (maxIsActive)\n                {\n                    Vector3 temp;\n                    Vector3.Multiply(ref jacobianMaxA, accumulatedImpulse.Y, out temp);\n                    Vector3.Add(ref impulse, ref temp, out impulse);\n                }\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                var impulse = new Vector3();\n                if (minIsActive)\n                {\n                    Vector3.Multiply(ref jacobianMinB, accumulatedImpulse.X, out impulse);\n                }\n                if (maxIsActive)\n                {\n                    Vector3 temp;\n                    Vector3.Multiply(ref jacobianMaxB, accumulatedImpulse.Y, out temp);\n                    Vector3.Add(ref impulse, ref temp, out impulse);\n                }\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n\n        private float GetDistanceFromMinimum(float angle)\n        {\n            if (minimumAngle > 0)\n            {\n                if (angle >= minimumAngle)\n                    return angle - minimumAngle;\n                if (angle > 0)\n                    return MathHelper.TwoPi - minimumAngle + angle;\n                return MathHelper.TwoPi - minimumAngle + angle;\n            }\n            if (angle < minimumAngle)\n                return MathHelper.TwoPi - minimumAngle + angle;\n            return angle - minimumAngle;\n            //else //if (currentAngle >= 0)\n            //    return angle - minimumAngle;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/JointLimits/SwingLimit.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Constraints.TwoEntity.JointLimits\n{\n    /// <summary>\n    /// Keeps the angle between the axes attached to two entities below some maximum value.\n    /// </summary>\n    public class SwingLimit : JointLimit, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private float accumulatedImpulse;\n        private float biasVelocity;\n        private Vector3 hingeAxis;\n        private float minimumCosine = 1;\n        private float error;\n\n        private Vector3 localAxisA;\n\n        private Vector3 localAxisB;\n        private Vector3 worldAxisA;\n\n        private Vector3 worldAxisB;\n        private float velocityToImpulse;\n\n        /// <summary>\n        /// Constructs a new constraint which attempts to restrict the maximum relative angle of two entities to some value.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the WorldAxisA, WorldAxisB (or their entity-local versions) and the MaximumAngle.\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public SwingLimit()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a new constraint which attempts to restrict the maximum relative angle of two entities to some value.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        /// <param name=\"axisA\">Axis attached to the first connected entity.</param>\n        /// <param name=\"axisB\">Axis attached to the second connected entity.</param>\n        /// <param name=\"maximumAngle\">Maximum angle between the axes allowed.</param>\n        public SwingLimit(Entity connectionA, Entity connectionB, Vector3 axisA, Vector3 axisB, float maximumAngle)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n            WorldAxisA = axisA;\n            WorldAxisB = axisB;\n            MaximumAngle = maximumAngle;\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to the first connected entity in its local space.\n        /// </summary>\n        public Vector3 LocalAxisA\n        {\n            get { return localAxisA; }\n            set\n            {\n                localAxisA = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localAxisA, ref connectionA.orientationMatrix, out worldAxisA);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to the first connected entity in its local space.\n        /// </summary>\n        public Vector3 LocalAxisB\n        {\n            get { return localAxisB; }\n            set\n            {\n                localAxisB = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localAxisB, ref connectionA.orientationMatrix, out worldAxisB);\n            }\n        }\n\n        /// <summary>\n        /// Maximum angle allowed between the two axes, from 0 to pi.\n        /// </summary>\n        public float MaximumAngle\n        {\n            get { return (float)Math.Acos(minimumCosine); }\n            set { minimumCosine = (float)Math.Cos(MathHelper.Clamp(value, 0, MathHelper.Pi)); }\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to the first connected entity in world space.\n        /// </summary>\n        public Vector3 WorldAxisA\n        {\n            get { return worldAxisA; }\n            set\n            {\n                worldAxisA = Vector3.Normalize(value);\n                Quaternion conjugate;\n                Quaternion.Conjugate(ref connectionA.orientation, out conjugate);\n                Vector3.Transform(ref worldAxisA, ref conjugate, out localAxisA);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to the first connected entity in world space.\n        /// </summary>\n        public Vector3 WorldAxisB\n        {\n            get { return worldAxisB; }\n            set\n            {\n                worldAxisB = Vector3.Normalize(value);\n                Quaternion conjugate;\n                Quaternion.Conjugate(ref connectionB.orientation, out conjugate);\n                Vector3.Transform(ref worldAxisB, ref conjugate, out localAxisB);\n            }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                if (isLimitActive)\n                {\n                    Vector3 relativeVelocity;\n                    Vector3.Subtract(ref connectionA.angularVelocity, ref connectionB.angularVelocity, out relativeVelocity);\n                    float lambda;\n                    Vector3.Dot(ref relativeVelocity, ref hingeAxis, out lambda);\n                    return lambda;\n                }\n                return 0;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = hingeAxis;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = -hingeAxis;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = velocityToImpulse;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Applies the sequential impulse.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            float lambda;\n            Vector3 relativeVelocity;\n            Vector3.Subtract(ref connectionA.angularVelocity, ref connectionB.angularVelocity, out relativeVelocity);\n            //Transform the velocity to with the jacobian\n            Vector3.Dot(ref relativeVelocity, ref hingeAxis, out lambda);\n            //Add in the constraint space bias velocity\n            lambda = -lambda + biasVelocity - softness * accumulatedImpulse;\n\n            //Transform to an impulse\n            lambda *= velocityToImpulse;\n\n            //Clamp accumulated impulse (can't go negative)\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Max(accumulatedImpulse + lambda, 0);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n            Vector3 impulse;\n            Vector3.Multiply(ref hingeAxis, lambda, out impulse);\n            if (connectionA.isDynamic)\n            {\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Negate(ref impulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return (Math.Abs(lambda));\n        }\n\n        /// <summary>\n        /// Initializes the constraint for this frame.\n        /// </summary>\n        /// <param name=\"dt\">Time since the last frame.</param>\n        public override void Update(float dt)\n        {\n            Matrix3x3.Transform(ref localAxisA, ref connectionA.orientationMatrix, out worldAxisA);\n            Matrix3x3.Transform(ref localAxisB, ref connectionB.orientationMatrix, out worldAxisB);\n\n            float dot;\n            Vector3.Dot(ref worldAxisA, ref worldAxisB, out dot);\n\n            //Keep in mind, the dot is the cosine of the angle.\n            //1: 0 radians\n            //0: pi/2 radians\n            //-1: pi radians\n            if (dot > minimumCosine)\n            {\n                isActiveInSolver = false;\n                error = 0;\n                accumulatedImpulse = 0;\n                isLimitActive = false;\n                return;\n            }\n            isLimitActive = true;\n\n            //Hinge axis is actually the jacobian entry for angular A (negative angular B).\n            Vector3.Cross(ref worldAxisA, ref worldAxisB, out hingeAxis);\n            float lengthSquared = hingeAxis.LengthSquared();\n            if (lengthSquared > Toolbox.Epsilon)\n            {\n                //Vector3.Divide(ref hingeAxis, (float)Math.Sqrt(lengthSquared), out hingeAxis);\n            }\n            else\n            {\n                //They're parallel; for the sake of continuity, pick some axis which is perpendicular to both that ISN'T the zero vector.\n                Vector3.Cross(ref worldAxisA, ref Toolbox.UpVector, out hingeAxis);\n                lengthSquared = hingeAxis.LengthSquared();\n                if (lengthSquared > Toolbox.Epsilon)\n                {\n                    //Vector3.Divide(ref hingeAxis, (float)Math.Sqrt(lengthSquared), out hingeAxis);\n                }\n                else\n                {\n                    //That's improbable; b's world axis was apparently parallel with the up vector!\n                    //So just use the right vector (it can't be parallel with both the up and right vectors).\n                    Vector3.Cross(ref worldAxisA, ref Toolbox.RightVector, out hingeAxis);\n                    //hingeAxis.Normalize();\n                }\n            }\n\n\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n\n            //Further away from 0 degrees is further negative; if the dot is below the minimum cosine, it means the angle is above the maximum angle.\n            error = Math.Max(0, minimumCosine - dot - margin);\n            biasVelocity = MathHelper.Clamp(errorReduction * error, -maxCorrectiveVelocity, maxCorrectiveVelocity);\n\n            if (bounciness > 0)\n            {\n                //Compute the speed around the axis.\n                float relativeSpeed;\n                Vector3 relativeVelocity;\n                Vector3.Subtract(ref connectionA.angularVelocity, ref connectionB.angularVelocity, out relativeVelocity);\n                Vector3.Dot(ref relativeVelocity, ref hingeAxis, out relativeSpeed);\n                if (relativeSpeed < -bounceVelocityThreshold)\n                {\n                    biasVelocity = Math.Max(biasVelocity, bounciness * relativeSpeed);\n                }\n            }\n\n            //Connection A's contribution to the mass matrix\n            float entryA;\n            Vector3 transformedAxis;\n            if (connectionA.isDynamic)\n            {\n                Matrix3x3.Transform(ref hingeAxis, ref connectionA.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref hingeAxis, out entryA);\n            }\n            else\n                entryA = 0;\n\n            //Connection B's contribution to the mass matrix\n            float entryB;\n            if (connectionB.isDynamic)\n            {\n                Matrix3x3.Transform(ref hingeAxis, ref connectionB.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref hingeAxis, out entryB);\n            }\n            else\n                entryB = 0;\n\n            //Compute the inverse mass matrix\n            velocityToImpulse = 1 / (softness + entryA + entryB);\n\n\n        }\n\n        public override void ExclusiveUpdate()\n        {\n            //Apply accumulated impulse\n            Vector3 impulse;\n            Vector3.Multiply(ref hingeAxis, accumulatedImpulse, out impulse);\n            if (connectionA.isDynamic)\n            {\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Negate(ref impulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/JointLimits/TwistLimit.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Constraints.TwoEntity.JointLimits\n{\n    /// <summary>\n    /// Prevents the connected entities from twisting relative to each other beyond given limits.\n    /// </summary>\n    public class TwistLimit : JointLimit, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private readonly JointBasis3D basisA = new JointBasis3D();\n        private readonly JointBasis2D basisB = new JointBasis2D();\n\n\n        private float accumulatedImpulse;\n        private float biasVelocity;\n        private Vector3 jacobianA, jacobianB;\n        private float error;\n\n        /// <summary>\n        /// Naximum angle that entities can twist.\n        /// </summary>\n        protected float maximumAngle;\n\n        /// <summary>\n        /// Minimum angle that entities can twist.\n        /// </summary>\n        protected float minimumAngle;\n\n        private float velocityToImpulse;\n\n        /// <summary>\n        /// Constructs a new constraint which prevents the connected entities from twisting relative to each other beyond given limits.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the BasisA, BasisB and the MinimumAngle and MaximumAngle.\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public TwistLimit()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a new constraint which prevents the connected entities from twisting relative to each other beyond given limits.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        /// <param name=\"axisA\">Twist axis attached to the first connected entity.</param>\n        /// <param name=\"axisB\">Twist axis attached to the second connected entity.</param>\n        /// <param name=\"minimumAngle\">Minimum twist angle allowed.</param>\n        /// <param name=\"maximumAngle\">Maximum twist angle allowed.</param>\n        public TwistLimit(Entity connectionA, Entity connectionB, Vector3 axisA, Vector3 axisB, float minimumAngle, float maximumAngle)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n            SetupJointTransforms(axisA, axisB);\n            MinimumAngle = minimumAngle;\n            MaximumAngle = maximumAngle;\n        }\n\n        /// <summary>\n        /// Gets the basis attached to entity A.\n        /// The primary axis represents the twist axis attached to entity A.\n        /// The x axis and y axis represent a plane against which entity B's attached x axis is projected to determine the twist angle.\n        /// </summary>\n        public JointBasis3D BasisA\n        {\n            get { return basisA; }\n        }\n\n\n        /// <summary>\n        /// Gets the basis attached to entity B.\n        /// The primary axis represents the twist axis attached to entity A.\n        /// The x axis is projected onto the plane defined by localTransformA's x and y axes\n        /// to get the twist angle.\n        /// </summary>\n        public JointBasis2D BasisB\n        {\n            get { return basisB; }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum angle that entities can twist.\n        /// </summary>\n        public float MaximumAngle\n        {\n            get { return maximumAngle; }\n            set\n            {\n                maximumAngle = value % (MathHelper.TwoPi);\n                if (minimumAngle > MathHelper.Pi)\n                    minimumAngle -= MathHelper.TwoPi;\n                if (minimumAngle <= -MathHelper.Pi)\n                    minimumAngle += MathHelper.TwoPi;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the minimum angle that entities can twist.\n        /// </summary>\n        public float MinimumAngle\n        {\n            get { return minimumAngle; }\n            set\n            {\n                minimumAngle = value % (MathHelper.TwoPi);\n                if (minimumAngle > MathHelper.Pi)\n                    minimumAngle -= MathHelper.TwoPi;\n                if (minimumAngle <= -MathHelper.Pi)\n                    minimumAngle += MathHelper.TwoPi;\n            }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                if (isLimitActive)\n                {\n                    float velocityA, velocityB;\n                    //Find the velocity contribution from each connection\n                    Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n                    Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n                    return velocityA + velocityB;\n                }\n                return 0;\n            }\n        }\n\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jacobianA;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jacobianB;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = velocityToImpulse;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Sets up the joint transforms by automatically creating perpendicular vectors to complete the bases.\n        /// </summary>\n        /// <param name=\"worldTwistAxisA\">Twist axis in world space to attach to entity A.</param>\n        /// <param name=\"worldTwistAxisB\">Twist axis in world space to attach to entity B.</param>\n        public void SetupJointTransforms(Vector3 worldTwistAxisA, Vector3 worldTwistAxisB)\n        {\n            worldTwistAxisA.Normalize();\n            worldTwistAxisB.Normalize();\n\n            Vector3 worldXAxis;\n            Vector3.Cross(ref worldTwistAxisA, ref Toolbox.UpVector, out worldXAxis);\n            float length = worldXAxis.LengthSquared();\n            if (length < Toolbox.Epsilon)\n            {\n                Vector3.Cross(ref worldTwistAxisA, ref Toolbox.RightVector, out worldXAxis);\n            }\n            worldXAxis.Normalize();\n\n            //Complete A's basis.\n            Vector3 worldYAxis;\n            Vector3.Cross(ref worldTwistAxisA, ref worldXAxis, out worldYAxis);\n\n            basisA.rotationMatrix = connectionA.orientationMatrix;\n            basisA.SetWorldAxes(worldTwistAxisA, worldXAxis, worldYAxis);\n\n            //Rotate the axis to B since it could be arbitrarily rotated.\n            Quaternion rotation;\n            Toolbox.GetQuaternionBetweenNormalizedVectors(ref worldTwistAxisA, ref worldTwistAxisB, out rotation);\n            Vector3.Transform(ref worldXAxis, ref rotation, out worldXAxis);\n\n            basisB.rotationMatrix = connectionB.orientationMatrix;\n            basisB.SetWorldAxes(worldTwistAxisB, worldXAxis);\n        }\n\n        /// <summary>\n        /// Solves for velocity.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            float velocityA, velocityB;\n            //Find the velocity contribution from each connection\n            Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n            Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n            //Add in the constraint space bias velocity\n            float lambda = -(velocityA + velocityB) + biasVelocity - softness * accumulatedImpulse;\n\n            //Transform to an impulse\n            lambda *= velocityToImpulse;\n\n            //Clamp accumulated impulse (can't go negative)\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Max(accumulatedImpulse + lambda, 0);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, lambda, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, lambda, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return Math.Abs(lambda);\n        }\n\n        /// <summary>\n        /// Do any necessary computations to prepare the constraint for this frame.\n        /// </summary>\n        /// <param name=\"dt\">Simulation step length.</param>\n        public override void Update(float dt)\n        {\n            basisA.rotationMatrix = connectionA.orientationMatrix;\n            basisB.rotationMatrix = connectionB.orientationMatrix;\n            basisA.ComputeWorldSpaceAxes();\n            basisB.ComputeWorldSpaceAxes();\n\n            Quaternion rotation;\n            Toolbox.GetQuaternionBetweenNormalizedVectors(ref basisB.primaryAxis, ref basisA.primaryAxis, out rotation);\n\n            //Transform b's 'Y' axis so that it is perpendicular with a's 'X' axis for measurement.\n            Vector3 twistMeasureAxis;\n            Vector3.Transform(ref basisB.xAxis, ref rotation, out twistMeasureAxis);\n\n            //By dotting the measurement vector with a 2d plane's axes, we can get a local X and Y value.\n            float y, x;\n            Vector3.Dot(ref twistMeasureAxis, ref basisA.yAxis, out y);\n            Vector3.Dot(ref twistMeasureAxis, ref basisA.xAxis, out x);\n            var angle = (float) Math.Atan2(y, x);\n\n            float distanceFromCurrent, distanceFromMaximum;\n            if (IsAngleValid(angle, out distanceFromCurrent, out distanceFromMaximum))\n            {\n                isActiveInSolver = false;\n                accumulatedImpulse = 0;\n                error = 0;\n                isLimitActive = false;\n                return;\n            }\n            isLimitActive = true;\n\n            //Compute the jacobian.\n            if (error > 0)\n            {\n                Vector3.Add(ref basisA.primaryAxis, ref basisB.primaryAxis, out jacobianB);\n                if (jacobianB.LengthSquared() < Toolbox.Epsilon)\n                {\n                    //A nasty singularity can show up if the axes are aligned perfectly.\n                    //In a 'real' situation, this is impossible, so just ignore it.\n                    isActiveInSolver = false;\n                    return;\n                }\n\n                jacobianB.Normalize();\n                jacobianA.X = -jacobianB.X;\n                jacobianA.Y = -jacobianB.Y;\n                jacobianA.Z = -jacobianB.Z;\n            }\n            else\n            {\n                //Reverse the jacobian so that the solver loop is easier.\n                Vector3.Add(ref basisA.primaryAxis, ref basisB.primaryAxis, out jacobianA);\n                if (jacobianA.LengthSquared() < Toolbox.Epsilon)\n                {\n                    //A nasty singularity can show up if the axes are aligned perfectly.\n                    //In a 'real' situation, this is impossible, so just ignore it.\n                    isActiveInSolver = false;\n                    return;\n                }\n\n                jacobianA.Normalize();\n                jacobianB.X = -jacobianA.X;\n                jacobianB.Y = -jacobianA.Y;\n                jacobianB.Z = -jacobianA.Z;\n            }\n\n            //****** VELOCITY BIAS ******//\n            //Compute the correction velocity.\n            error = ComputeAngleError(distanceFromCurrent, distanceFromMaximum);\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n\n\n            //biasVelocity = MathHelper.Clamp(-error * myCorrectionStrength / dt, -myMaxCorrectiveVelocity, myMaxCorrectiveVelocity);\n            biasVelocity = MathHelper.Min(MathHelper.Max(0, Math.Abs(error) - margin) * errorReduction, maxCorrectiveVelocity);\n            if (bounciness > 0)\n            {\n                float relativeVelocity;\n                float dot;\n                //Find the velocity contribution from each connection\n                Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out relativeVelocity);\n                Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out dot);\n                relativeVelocity += dot;\n                if (-relativeVelocity > bounceVelocityThreshold)\n                    biasVelocity = MathHelper.Max(biasVelocity, -bounciness * relativeVelocity);\n            }\n\n            //The nice thing about this approach is that the jacobian entry doesn't flip.\n            //Instead, the error can be negative due to the use of Atan2.\n            //This is important for limits which have a unique high and low value.\n\n\n            //****** EFFECTIVE MASS MATRIX ******//\n            //Connection A's contribution to the mass matrix\n            float entryA;\n            Vector3 transformedAxis;\n            if (connectionA.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianA, ref connectionA.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianA, out entryA);\n            }\n            else\n                entryA = 0;\n\n            //Connection B's contribution to the mass matrix\n            float entryB;\n            if (connectionB.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianB, ref connectionB.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianB, out entryB);\n            }\n            else\n                entryB = 0;\n\n            //Compute the inverse mass matrix\n            velocityToImpulse = 1 / (softness + entryA + entryB);\n\n            \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //****** WARM STARTING ******//\n            //Apply accumulated impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, accumulatedImpulse, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, accumulatedImpulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n\n        private static float ComputeAngleError(float distanceFromCurrent, float distanceFromMaximum)\n        {\n            float errorFromMin = MathHelper.TwoPi - distanceFromCurrent;\n            float errorFromMax = distanceFromCurrent - distanceFromMaximum;\n            return errorFromMax > errorFromMin ? errorFromMin : -errorFromMax;\n        }\n\n        private float GetDistanceFromMinimum(float angle)\n        {\n            if (minimumAngle > 0)\n            {\n                if (angle >= minimumAngle)\n                    return angle - minimumAngle;\n                if (angle > 0)\n                    return MathHelper.TwoPi - minimumAngle + angle;\n                return MathHelper.TwoPi - minimumAngle + angle;\n            }\n            if (angle < minimumAngle)\n                return MathHelper.TwoPi - minimumAngle + angle;\n            return angle - minimumAngle;\n            //else //if (currentAngle >= 0)\n            //    return angle - myMinimumAngle;\n        }\n\n        private bool IsAngleValid(float currentAngle, out float distanceFromCurrent, out float distanceFromMaximum)\n        {\n            distanceFromCurrent = GetDistanceFromMinimum(currentAngle);\n            distanceFromMaximum = GetDistanceFromMinimum(maximumAngle);\n            return distanceFromCurrent < distanceFromMaximum;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Joints/BallSocketJoint.cs",
    "content": "using System;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing System.Diagnostics;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Joints\n{\n    /// <summary>\n    /// Connects two entities with a spherical joint.  Acts like an unrestricted shoulder joint.\n    /// </summary>\n    public class BallSocketJoint : Joint, I3DImpulseConstraintWithError, I3DJacobianConstraint\n    {\n        private Vector3 accumulatedImpulse;\n        private Vector3 biasVelocity;\n        private Vector3 localAnchorA;\n        private Vector3 localAnchorB;\n        private Matrix3x3 massMatrix;\n        private Vector3 error;\n        private Matrix3x3 rACrossProduct;\n        private Matrix3x3 rBCrossProduct;\n        private Vector3 worldOffsetA, worldOffsetB;\n\n        /// <summary>\n        /// Constructs a spherical joint.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the offsets (OffsetA, OffsetB or LocalOffsetA, LocalOffsetB).\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public BallSocketJoint()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a spherical joint.\n        /// </summary>\n        /// <param name=\"connectionA\">First connected entity.</param>\n        /// <param name=\"connectionB\">Second connected entity.</param>\n        /// <param name=\"anchorLocation\">Location of the socket.</param>\n        public BallSocketJoint(Entity connectionA, Entity connectionB, Vector3 anchorLocation)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n\n            OffsetA = anchorLocation - ConnectionA.position;\n            OffsetB = anchorLocation - ConnectionB.position;\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the first entity's center of mass to the anchor point in its local space.\n        /// </summary>\n        public Vector3 LocalOffsetA\n        {\n            get { return localAnchorA; }\n            set\n            {\n                localAnchorA = value;\n                Matrix3x3.Transform(ref localAnchorA, ref connectionA.orientationMatrix, out worldOffsetA); \n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the second entity's center of mass to the anchor point in its local space.\n        /// </summary>\n        public Vector3 LocalOffsetB\n        {\n            get { return localAnchorB; }\n            set\n            {\n                localAnchorB = value;\n                Matrix3x3.Transform(ref localAnchorB, ref connectionB.orientationMatrix, out worldOffsetB); \n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the first entity's center of mass to the anchor point in world space.\n        /// </summary>\n        public Vector3 OffsetA\n        {\n            get { return worldOffsetA; }\n            set\n            {\n                worldOffsetA = value;\n                Matrix3x3.TransformTranspose(ref worldOffsetA, ref connectionA.orientationMatrix, out localAnchorA);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the second entity's center of mass to the anchor point in world space.\n        /// </summary>\n        public Vector3 OffsetB\n        {\n            get { return worldOffsetB; }\n            set\n            {\n                worldOffsetB = value;\n                Matrix3x3.TransformTranspose(ref worldOffsetB, ref connectionB.orientationMatrix, out localAnchorB);\n            }\n        }\n\n        #region I3DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public Vector3 RelativeVelocity\n        {\n            get\n            {\n                Vector3 cross;\n                Vector3 aVel, bVel;\n                Vector3.Cross(ref connectionA.angularVelocity, ref worldOffsetA, out cross);\n                Vector3.Add(ref connectionA.linearVelocity, ref cross, out aVel);\n                Vector3.Cross(ref connectionB.angularVelocity, ref worldOffsetB, out cross);\n                Vector3.Add(ref connectionB.linearVelocity, ref cross, out bVel);\n                return aVel - bVel;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public Vector3 TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public Vector3 Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I3DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianZ\">Third linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = Toolbox.RightVector;\n            jacobianY = Toolbox.UpVector;\n            jacobianZ = Toolbox.BackVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianZ\">Third linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = Toolbox.RightVector;\n            jacobianY = Toolbox.UpVector;\n            jacobianZ = Toolbox.BackVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianZ\">Third angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = rACrossProduct.Right;\n            jacobianY = rACrossProduct.Up;\n            jacobianZ = rACrossProduct.Forward;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianZ\">Third angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = rBCrossProduct.Right;\n            jacobianY = rBCrossProduct.Up;\n            jacobianZ = rBCrossProduct.Forward;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out Matrix3x3 outputMassMatrix)\n        {\n            outputMassMatrix = massMatrix;\n        }\n\n        #endregion\n\n\n        /// <summary>\n        /// Calculates necessary information for velocity solving.\n        /// Called by preStep(float dt)\n        /// </summary>\n        /// <param name=\"dt\">Time in seconds since the last update.</param>\n        public override void Update(float dt)\n        {\n            Matrix3x3.Transform(ref localAnchorA, ref connectionA.orientationMatrix, out worldOffsetA);\n            Matrix3x3.Transform(ref localAnchorB, ref connectionB.orientationMatrix, out worldOffsetB);\n\n\n            float errorReductionParameter;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReductionParameter, out softness);\n\n            //Mass Matrix\n            Matrix3x3 k;\n            Matrix3x3 linearComponent;\n            Matrix3x3.CreateCrossProduct(ref worldOffsetA, out rACrossProduct);\n            Matrix3x3.CreateCrossProduct(ref worldOffsetB, out rBCrossProduct);\n            if (connectionA.isDynamic && connectionB.isDynamic)\n            {\n                Matrix3x3.CreateScale(connectionA.inverseMass + connectionB.inverseMass, out linearComponent);\n                Matrix3x3 angularComponentA, angularComponentB;\n                Matrix3x3.Multiply(ref rACrossProduct, ref connectionA.inertiaTensorInverse, out angularComponentA);\n                Matrix3x3.Multiply(ref rBCrossProduct, ref connectionB.inertiaTensorInverse, out angularComponentB);\n                Matrix3x3.Multiply(ref angularComponentA, ref rACrossProduct, out angularComponentA);\n                Matrix3x3.Multiply(ref angularComponentB, ref rBCrossProduct, out angularComponentB);\n                Matrix3x3.Subtract(ref linearComponent, ref angularComponentA, out k);\n                Matrix3x3.Subtract(ref k, ref angularComponentB, out k);\n            }\n            else if (connectionA.isDynamic && !connectionB.isDynamic)\n            {\n                Matrix3x3.CreateScale(connectionA.inverseMass, out linearComponent);\n                Matrix3x3 angularComponentA;\n                Matrix3x3.Multiply(ref rACrossProduct, ref connectionA.inertiaTensorInverse, out angularComponentA);\n                Matrix3x3.Multiply(ref angularComponentA, ref rACrossProduct, out angularComponentA);\n                Matrix3x3.Subtract(ref linearComponent, ref angularComponentA, out k);\n            }\n            else if (!connectionA.isDynamic && connectionB.isDynamic)\n            {\n                Matrix3x3.CreateScale(connectionB.inverseMass, out linearComponent);\n                Matrix3x3 angularComponentB;\n                Matrix3x3.Multiply(ref rBCrossProduct, ref connectionB.inertiaTensorInverse, out angularComponentB);\n                Matrix3x3.Multiply(ref angularComponentB, ref rBCrossProduct, out angularComponentB);\n                Matrix3x3.Subtract(ref linearComponent, ref angularComponentB, out k);\n            }\n            else\n            {\n                throw new InvalidOperationException(\"Cannot constrain two kinematic bodies.\");\n            }\n            k.M11 += softness;\n            k.M22 += softness;\n            k.M33 += softness;\n            Matrix3x3.Invert(ref k, out massMatrix);\n\n            Vector3.Add(ref connectionB.position, ref worldOffsetB, out error);\n            Vector3.Subtract(ref error, ref connectionA.position, out error);\n            Vector3.Subtract(ref error, ref worldOffsetA, out error);\n\n\n            Vector3.Multiply(ref error, -errorReductionParameter, out biasVelocity);\n\n            //Ensure that the corrective velocity doesn't exceed the max.\n            float length = biasVelocity.LengthSquared();\n            if (length > maxCorrectiveVelocitySquared)\n            {\n                float multiplier = maxCorrectiveVelocity / (float)Math.Sqrt(length);\n                biasVelocity.X *= multiplier;\n                biasVelocity.Y *= multiplier;\n                biasVelocity.Z *= multiplier;\n            }\n\n   \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Warm starting\n            //Constraint.applyImpulse(myConnectionA, myConnectionB, ref rA, ref rB, ref accumulatedImpulse);\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n#else\n            Vector3 linear;\n#endif\n            if (connectionA.isDynamic)\n            {\n                linear.X = -accumulatedImpulse.X;\n                linear.Y = -accumulatedImpulse.Y;\n                linear.Z = -accumulatedImpulse.Z;\n                connectionA.ApplyLinearImpulse(ref linear);\n                Vector3 taImpulse;\n                Vector3.Cross(ref worldOffsetA, ref linear, out taImpulse);\n                connectionA.ApplyAngularImpulse(ref taImpulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                connectionB.ApplyLinearImpulse(ref accumulatedImpulse);\n                Vector3 tbImpulse;\n                Vector3.Cross(ref worldOffsetB, ref accumulatedImpulse, out tbImpulse);\n                connectionB.ApplyAngularImpulse(ref tbImpulse);\n            }\n        }\n\n\n        /// <summary>\n        /// Calculates and applies corrective impulses.\n        /// Called automatically by space.\n        /// </summary>\n        public override float SolveIteration()\n        {\n#if !WINDOWS\n            Vector3 lambda = new Vector3();\n#else\n            Vector3 lambda;\n#endif\n\n            //Velocity along the length.\n            Vector3 cross;\n            Vector3 aVel, bVel;\n            Vector3.Cross(ref connectionA.angularVelocity, ref worldOffsetA, out cross);\n            Vector3.Add(ref connectionA.linearVelocity, ref cross, out aVel);\n            Vector3.Cross(ref connectionB.angularVelocity, ref worldOffsetB, out cross);\n            Vector3.Add(ref connectionB.linearVelocity, ref cross, out bVel);\n\n            lambda.X = aVel.X - bVel.X + biasVelocity.X - softness * accumulatedImpulse.X;\n            lambda.Y = aVel.Y - bVel.Y + biasVelocity.Y - softness * accumulatedImpulse.Y;\n            lambda.Z = aVel.Z - bVel.Z + biasVelocity.Z - softness * accumulatedImpulse.Z;\n\n            //Turn the velocity into an impulse.\n            Matrix3x3.Transform(ref lambda, ref massMatrix, out lambda);\n\n            //ACcumulate the impulse\n            Vector3.Add(ref accumulatedImpulse, ref lambda, out accumulatedImpulse);\n\n            //Apply the impulse\n            //Constraint.applyImpulse(myConnectionA, myConnectionB, ref rA, ref rB, ref impulse);\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n#else\n            Vector3 linear;\n#endif\n            if (connectionA.isDynamic)\n            {\n                linear.X = -lambda.X;\n                linear.Y = -lambda.Y;\n                linear.Z = -lambda.Z;\n                connectionA.ApplyLinearImpulse(ref linear);\n                Vector3 taImpulse;\n                Vector3.Cross(ref worldOffsetA, ref linear, out taImpulse);\n                connectionA.ApplyAngularImpulse(ref taImpulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                connectionB.ApplyLinearImpulse(ref lambda);\n                Vector3 tbImpulse;\n                Vector3.Cross(ref worldOffsetB, ref lambda, out tbImpulse);\n                connectionB.ApplyAngularImpulse(ref tbImpulse);\n            }\n\n            return (Math.Abs(lambda.X) +\n                    Math.Abs(lambda.Y) +\n                    Math.Abs(lambda.Z));\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Joints/DistanceJoint.cs",
    "content": "using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Joints\n{\n    /// <summary>\n    /// Constraint which tries to maintain the distance between points on two entities.\n    /// </summary>\n    public class DistanceJoint : Joint, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private float accumulatedImpulse;\n        private Vector3 anchorA;\n\n        private Vector3 anchorB;\n        private float biasVelocity;\n        private Vector3 jAngularA, jAngularB;\n        private Vector3 jLinearA, jLinearB;\n\n        /// <summary>\n        /// Distance maintained between the anchors.\n        /// </summary>\n        protected float distance;\n\n        private float error;\n\n        private Vector3 localAnchorA;\n\n        private Vector3 localAnchorB;\n\n\n        private Vector3 offsetA, offsetB;\n        private float velocityToImpulse;\n\n        /// <summary>\n        /// Constructs a distance joint.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the anchors (WorldAnchorA, WorldAnchorB or LocalAnchorA, LocalAnchorB)\n        /// and the desired Distance.\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public DistanceJoint()\n        {\n            IsActive = false;\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n\n            Distance = (anchorA - anchorB).Length();\n\n            WorldAnchorA = anchorA;\n            WorldAnchorB = anchorB;\n        }\n\n        /// <summary>\n        /// Constructs a distance joint.\n        /// </summary>\n        /// <param name=\"connectionA\">First body connected to the distance joint.</param>\n        /// <param name=\"connectionB\">Second body connected to the distance joint.</param>\n        /// <param name=\"anchorA\">Connection to the distance joint from the first connected body in world space.</param>\n        /// <param name=\"anchorB\"> Connection to the distance joint from the second connected body in world space.</param>\n        public DistanceJoint(Entity connectionA, Entity connectionB, Vector3 anchorA, Vector3 anchorB)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n\n            Distance = (anchorA - anchorB).Length();\n\n            WorldAnchorA = anchorA;\n            WorldAnchorB = anchorB;\n        }\n\n        /// <summary>\n        /// Gets or sets the distance maintained between the anchors.\n        /// </summary>\n        public float Distance\n        {\n            get { return distance; }\n            set { distance = Math.Max(0, value); }\n        }\n\n        /// <summary>\n        /// Gets or sets the first entity's connection point in local space.\n        /// </summary>\n        public Vector3 LocalAnchorA\n        {\n            get { return localAnchorA; }\n            set\n            {\n                localAnchorA = value;\n                Matrix3x3.Transform(ref localAnchorA, ref connectionA.orientationMatrix, out anchorA);\n                anchorA += connectionA.position;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the first entity's connection point in local space.\n        /// </summary>\n        public Vector3 LocalAnchorB\n        {\n            get { return localAnchorB; }\n            set\n            {\n                localAnchorB = value;\n                Matrix3x3.Transform(ref localAnchorB, ref connectionB.orientationMatrix, out anchorB);\n                anchorB += connectionB.position;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the connection to the distance constraint from the first connected body in world space.\n        /// </summary>\n        public Vector3 WorldAnchorA\n        {\n            get { return anchorA; }\n            set\n            {\n                anchorA = value;\n                localAnchorA = Vector3.Transform(anchorA - connectionA.position, Quaternion.Conjugate(connectionA.orientation));\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the connection to the distance constraint from the second connected body in world space.\n        /// </summary>\n        public Vector3 WorldAnchorB\n        {\n            get { return anchorB; }\n            set\n            {\n                anchorB = value;\n                localAnchorB = Vector3.Transform(anchorB - connectionB.position, Quaternion.Conjugate(connectionB.orientation));\n            }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float lambda, dot;\n                Vector3.Dot(ref jLinearA, ref connectionA.linearVelocity, out lambda);\n                Vector3.Dot(ref jAngularA, ref connectionA.angularVelocity, out dot);\n                lambda += dot;\n                Vector3.Dot(ref jLinearB, ref connectionB.linearVelocity, out dot);\n                lambda += dot;\n                Vector3.Dot(ref jAngularB, ref connectionB.angularVelocity, out dot);\n                lambda += dot;\n                return lambda;\n            }\n        }\n\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jLinearA;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jLinearB;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jAngularA;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jAngularB;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = velocityToImpulse;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Calculates and applies corrective impulses.\n        /// Called automatically by space.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            //Compute the current relative velocity.\n            float lambda, dot;\n            Vector3.Dot(ref jLinearA, ref connectionA.linearVelocity, out lambda);\n            Vector3.Dot(ref jAngularA, ref connectionA.angularVelocity, out dot);\n            lambda += dot;\n            Vector3.Dot(ref jLinearB, ref connectionB.linearVelocity, out dot);\n            lambda += dot;\n            Vector3.Dot(ref jAngularB, ref connectionB.angularVelocity, out dot);\n            lambda += dot;\n\n            //Add in the constraint space bias velocity\n            lambda = -lambda + biasVelocity - softness * accumulatedImpulse;\n\n            //Transform to an impulse\n            lambda *= velocityToImpulse;\n\n            //Accumulate impulse\n            accumulatedImpulse += lambda;\n\n            //Apply the impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearA, lambda, out impulse);\n                connectionA.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularA, lambda, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearB, lambda, out impulse);\n                connectionB.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularB, lambda, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return (Math.Abs(lambda));\n        }\n\n        /// <summary>\n        /// Calculates necessary information for velocity solving.\n        /// </summary>\n        /// <param name=\"dt\">Time in seconds since the last update.</param>\n        public override void Update(float dt)\n        {\n            //Transform the anchors and offsets into world space.\n            Matrix3x3.Transform(ref localAnchorA, ref connectionA.orientationMatrix, out offsetA);\n            Matrix3x3.Transform(ref localAnchorB, ref connectionB.orientationMatrix, out offsetB);\n            Vector3.Add(ref connectionA.position, ref offsetA, out anchorA);\n            Vector3.Add(ref connectionB.position, ref offsetB, out anchorB);\n\n            //Compute the distance.\n            Vector3 separation;\n            Vector3.Subtract(ref anchorB, ref anchorA, out separation);\n            float currentDistance = separation.Length();\n\n            //Compute jacobians\n            if (currentDistance > Toolbox.Epsilon)\n            {\n                jLinearB.X = separation.X / currentDistance;\n                jLinearB.Y = separation.Y / currentDistance;\n                jLinearB.Z = separation.Z / currentDistance;\n            }\n            else\n                jLinearB = Toolbox.ZeroVector;\n\n            jLinearA.X = -jLinearB.X;\n            jLinearA.Y = -jLinearB.Y;\n            jLinearA.Z = -jLinearB.Z;\n\n            Vector3.Cross(ref offsetA, ref jLinearB, out jAngularA);\n            //Still need to negate angular A.  It's done after the effective mass matrix.\n            Vector3.Cross(ref offsetB, ref jLinearB, out jAngularB);\n\n\n            //Compute effective mass matrix\n            if (connectionA.isDynamic && connectionB.isDynamic)\n            {\n                Vector3 aAngular;\n                Matrix3x3.Transform(ref jAngularA, ref connectionA.localInertiaTensorInverse, out aAngular);\n                Vector3.Cross(ref aAngular, ref offsetA, out aAngular);\n                Vector3 bAngular;\n                Matrix3x3.Transform(ref jAngularB, ref connectionB.localInertiaTensorInverse, out bAngular);\n                Vector3.Cross(ref bAngular, ref offsetB, out bAngular);\n                Vector3.Add(ref aAngular, ref bAngular, out aAngular);\n                Vector3.Dot(ref aAngular, ref jLinearB, out velocityToImpulse);\n                velocityToImpulse += connectionA.inverseMass + connectionB.inverseMass;\n            }\n            else if (connectionA.isDynamic)\n            {\n                Vector3 aAngular;\n                Matrix3x3.Transform(ref jAngularA, ref connectionA.localInertiaTensorInverse, out aAngular);\n                Vector3.Cross(ref aAngular, ref offsetA, out aAngular);\n                Vector3.Dot(ref aAngular, ref jLinearB, out velocityToImpulse);\n                velocityToImpulse += connectionA.inverseMass;\n            }\n            else if (connectionB.isDynamic)\n            {\n                Vector3 bAngular;\n                Matrix3x3.Transform(ref jAngularB, ref connectionB.localInertiaTensorInverse, out bAngular);\n                Vector3.Cross(ref bAngular, ref offsetB, out bAngular);\n                Vector3.Dot(ref bAngular, ref jLinearB, out velocityToImpulse);\n                velocityToImpulse += connectionB.inverseMass;\n            }\n            else\n            {\n                //No point in trying to solve with two kinematics.\n                isActiveInSolver = false;\n                accumulatedImpulse = 0;\n                return;\n            }\n\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n\n            velocityToImpulse = 1 / (softness + velocityToImpulse);\n            //Finish computing jacobian; it's down here as an optimization (since it didn't need to be negated in mass matrix)\n            jAngularA.X = -jAngularA.X;\n            jAngularA.Y = -jAngularA.Y;\n            jAngularA.Z = -jAngularA.Z;\n\n            //Compute bias velocity\n            error = distance - currentDistance;\n            biasVelocity = MathHelper.Clamp(error * errorReduction, -maxCorrectiveVelocity, maxCorrectiveVelocity);\n\n           \n\n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        { \n            //Warm starting\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearA, accumulatedImpulse, out impulse);\n                connectionA.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularA, accumulatedImpulse, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearB, accumulatedImpulse, out impulse);\n                connectionB.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularB, accumulatedImpulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Joints/Joint.cs",
    "content": "﻿using System;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Joints\n{\n    /// <summary>\n    /// Superclass of position-based constraints.\n    /// </summary>\n    public abstract class Joint : TwoEntityConstraint, ISpringSettings\n    {\n        /// <summary>\n        /// Maximum extra velocity that the constraint will apply in an effort to correct constraint error.\n        /// </summary>\n        protected float maxCorrectiveVelocity = float.MaxValue;\n\n        /// <summary>\n        /// Squared maximum extra velocity that the constraint will apply in an effort to correct constraint error.\n        /// </summary>\n        protected float maxCorrectiveVelocitySquared = float.MaxValue;\n\n        protected float softness;\n\n        /// <summary>\n        /// Spring settings define how a constraint responds to velocity and position error.\n        /// </summary>\n        protected SpringSettings springSettings = new SpringSettings();\n\n        /// <summary>\n        /// Gets or sets the maximum extra velocity that the constraint will apply in an effort to correct any constraint error.\n        /// </summary>\n        public float MaxCorrectiveVelocity\n        {\n            get { return maxCorrectiveVelocity; }\n            set\n            {\n                maxCorrectiveVelocity = Math.Max(0, value);\n                if (maxCorrectiveVelocity >= float.MaxValue)\n                {\n                    maxCorrectiveVelocitySquared = float.MaxValue;\n                }\n                else\n                {\n                    maxCorrectiveVelocitySquared = maxCorrectiveVelocity * maxCorrectiveVelocity;\n                }\n            }\n        }\n\n        #region ISpringSettings Members\n\n        /// <summary>\n        /// Gets the spring settings used by the constraint.\n        /// Spring settings define how a constraint responds to velocity and position error.\n        /// </summary>\n        public SpringSettings SpringSettings\n        {\n            get { return springSettings; }\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Joints/NoRotationJoint.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Joints\n{\n    /// <summary>\n    /// Constrains two entities so that they cannot rotate relative to each other.\n    /// </summary>\n    public class NoRotationJoint : Joint, I3DImpulseConstraintWithError, I3DJacobianConstraint\n    {\n        private Vector3 accumulatedImpulse;\n        private Vector3 biasVelocity;\n        private Matrix3x3 effectiveMassMatrix;\n        private Quaternion initialQuaternionConjugateA;\n        private Quaternion initialQuaternionConjugateB;\n        private Vector3 error;\n\n        /// <summary>\n        /// Constructs a new constraint which prevents relative angular motion between the two connected bodies.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) and the initial orientations\n        /// (InitialOrientationA, InitialOrientationB).\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public NoRotationJoint()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a new constraint which prevents relative angular motion between the two connected bodies.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        public NoRotationJoint(Entity connectionA, Entity connectionB)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n\n            initialQuaternionConjugateA = Quaternion.Conjugate(ConnectionA.orientation);\n            initialQuaternionConjugateB = Quaternion.Conjugate(ConnectionB.orientation);\n        }\n\n        /// <summary>\n        /// Gets or sets the initial orientation of the first connected entity.\n        /// The constraint will try to maintain the relative orientation between the initialOrientationA and initialOrientationB.\n        /// </summary>\n        public Quaternion InitialOrientationA\n        {\n            get { return Quaternion.Conjugate(initialQuaternionConjugateA); }\n            set { initialQuaternionConjugateA = Quaternion.Conjugate(value); }\n        }\n\n        /// <summary>\n        /// Gets or sets the initial orientation of the second connected entity.\n        /// The constraint will try to maintain the relative orientation between the initialOrientationA and initialOrientationB.\n        /// </summary>\n        public Quaternion InitialOrientationB\n        {\n            get { return Quaternion.Conjugate(initialQuaternionConjugateB); }\n            set { initialQuaternionConjugateB = Quaternion.Conjugate(value); }\n        }\n\n        #region I3DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public Vector3 RelativeVelocity\n        {\n            get\n            {\n                Vector3 velocityDifference;\n                Vector3.Subtract(ref connectionB.angularVelocity, ref connectionA.angularVelocity, out velocityDifference);\n                return velocityDifference;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public Vector3 TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public Vector3 Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I3DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianZ\">Third linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = Toolbox.ZeroVector;\n            jacobianY = Toolbox.ZeroVector;\n            jacobianZ = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianZ\">Third linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = Toolbox.ZeroVector;\n            jacobianY = Toolbox.ZeroVector;\n            jacobianZ = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianZ\">Third angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = Toolbox.RightVector;\n            jacobianY = Toolbox.UpVector;\n            jacobianZ = Toolbox.BackVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianZ\">Third angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = Toolbox.RightVector;\n            jacobianY = Toolbox.UpVector;\n            jacobianZ = Toolbox.BackVector;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out Matrix3x3 outputMassMatrix)\n        {\n            outputMassMatrix = effectiveMassMatrix;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Applies the corrective impulses required by the constraint.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            Vector3 velocityDifference;\n            Vector3.Subtract(ref connectionB.angularVelocity, ref connectionA.angularVelocity, out velocityDifference);\n            Vector3 softnessVector;\n            Vector3.Multiply(ref accumulatedImpulse, softness, out softnessVector);\n\n            Vector3 lambda;\n            Vector3.Add(ref velocityDifference, ref biasVelocity, out lambda);\n            Vector3.Subtract(ref lambda, ref softnessVector, out lambda);\n            Matrix3x3.Transform(ref lambda, ref effectiveMassMatrix, out lambda);\n\n            Vector3.Add(ref lambda, ref accumulatedImpulse, out accumulatedImpulse);\n            if (connectionA.isDynamic)\n            {\n                connectionA.ApplyAngularImpulse(ref lambda);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3 torqueB;\n                Vector3.Negate(ref lambda, out torqueB);\n                connectionB.ApplyAngularImpulse(ref torqueB);\n            }\n\n            return Math.Abs(lambda.X) + Math.Abs(lambda.Y) + Math.Abs(lambda.Z);\n        }\n\n        /// <summary>\n        /// Initializes the constraint for the current frame.\n        /// </summary>\n        /// <param name=\"dt\">Time between frames.</param>\n        public override void Update(float dt)\n        {\n            Quaternion quaternionA;\n            Quaternion.Multiply(ref connectionA.orientation, ref initialQuaternionConjugateA, out quaternionA);\n            Quaternion quaternionB;\n            Quaternion.Multiply(ref connectionB.orientation, ref initialQuaternionConjugateB, out quaternionB);\n            Quaternion.Conjugate(ref quaternionB, out quaternionB);\n            Quaternion intermediate;\n            Quaternion.Multiply(ref quaternionA, ref quaternionB, out intermediate);\n\n\n            float angle;\n            Vector3 axis;\n            Toolbox.GetAxisAngleFromQuaternion(ref intermediate, out axis, out angle);\n\n            error.X = axis.X * angle;\n            error.Y = axis.Y * angle;\n            error.Z = axis.Z * angle;\n\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n            errorReduction = -errorReduction;\n            biasVelocity.X = errorReduction * error.X;\n            biasVelocity.Y = errorReduction * error.Y;\n            biasVelocity.Z = errorReduction * error.Z;\n\n            //Ensure that the corrective velocity doesn't exceed the max.\n            float length = biasVelocity.LengthSquared();\n            if (length > maxCorrectiveVelocitySquared)\n            {\n                float multiplier = maxCorrectiveVelocity / (float) Math.Sqrt(length);\n                biasVelocity.X *= multiplier;\n                biasVelocity.Y *= multiplier;\n                biasVelocity.Z *= multiplier;\n            }\n\n            Matrix3x3.Add(ref connectionA.inertiaTensorInverse, ref connectionB.inertiaTensorInverse, out effectiveMassMatrix);\n            effectiveMassMatrix.M11 += softness;\n            effectiveMassMatrix.M22 += softness;\n            effectiveMassMatrix.M33 += softness;\n            Matrix3x3.Invert(ref effectiveMassMatrix, out effectiveMassMatrix);\n\n\n           \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //apply accumulated impulse\n            if (connectionA.isDynamic)\n            {\n                connectionA.ApplyAngularImpulse(ref accumulatedImpulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3 torqueB;\n                Vector3.Negate(ref accumulatedImpulse, out torqueB);\n                connectionB.ApplyAngularImpulse(ref torqueB);\n            }\n        } \n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Joints/PointOnLineJoint.cs",
    "content": "using System;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Joints\n{\n    /// <summary>\n    /// Constrains two entities so that one has a point that stays on a line defined by the other.\n    /// </summary>\n    public class PointOnLineJoint : Joint, I2DImpulseConstraintWithError, I2DJacobianConstraint\n    {\n        private Vector2 accumulatedImpulse;\n        private Vector3 angularA1;\n        private Vector3 angularA2;\n        private Vector3 angularB1;\n        private Vector3 angularB2;\n        private Vector2 biasVelocity;\n        private Vector3 localRestrictedAxis1; //on a\n        private Vector3 localRestrictedAxis2; //on a\n        private Vector2 error;\n        private Vector3 localAxisAnchor; //on a\n        private Vector3 localLineDirection; //on a\n        private Vector3 localPoint; //on b\n        private Vector3 worldLineAnchor;\n        private Vector3 worldLineDirection;\n        private Vector3 worldPoint;\n        private Matrix2x2 negativeEffectiveMassMatrix;\n\n        //Jacobians\n        //(Linear jacobians are just:\n        // axis 1   -axis 1\n        // axis 2   -axis 2 )\n        private Vector3 rA, rB;\n        private Vector3 worldRestrictedAxis1, worldRestrictedAxis2;\n\n        /// <summary>\n        /// Constructs a joint which constrains a point of one body to be on a line based on the other body.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB),\n        /// the LineAnchor, the LineDirection, and the Point (or the entity-local versions).\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public PointOnLineJoint()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a joint which constrains a point of one body to be on a line based on the other body.\n        /// </summary>\n        /// <param name=\"connectionA\">First connected entity which defines the line.</param>\n        /// <param name=\"connectionB\">Second connected entity which has a point.</param>\n        /// <param name=\"lineAnchor\">Location off of which the line is based in world space.</param>\n        /// <param name=\"lineDirection\">Direction of the line in world space.</param>\n        /// <param name=\"pointLocation\">Location of the point anchored to connectionB in world space.</param>\n        public PointOnLineJoint(Entity connectionA, Entity connectionB, Vector3 lineAnchor, Vector3 lineDirection, Vector3 pointLocation)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n\n            LineAnchor = lineAnchor;\n            LineDirection = lineDirection;\n            Point = pointLocation;\n        }\n\n        /// <summary>\n        /// Gets or sets the line anchor in world space.\n        /// </summary>\n        public Vector3 LineAnchor\n        {\n            get { return worldLineAnchor; }\n            set\n            {\n                localAxisAnchor = value - connectionA.position;\n                Matrix3x3.TransformTranspose(ref localAxisAnchor, ref connectionA.orientationMatrix, out localAxisAnchor);\n                worldLineAnchor = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the line direction in world space.\n        /// </summary>\n        public Vector3 LineDirection\n        {\n            get { return worldLineDirection; }\n            set\n            {\n                worldLineDirection = Vector3.Normalize(value);\n                Matrix3x3.TransformTranspose(ref worldLineDirection, ref connectionA.orientationMatrix, out localLineDirection);\n                UpdateRestrictedAxes();\n            }\n        }\n\n\n        /// <summary>\n        /// Gets or sets the line anchor in connection A's local space.\n        /// </summary>\n        public Vector3 LocalLineAnchor\n        {\n            get { return localAxisAnchor; }\n            set\n            {\n                localAxisAnchor = value;\n                Matrix3x3.Transform(ref localAxisAnchor, ref connectionA.orientationMatrix, out worldLineAnchor);\n                Vector3.Add(ref worldLineAnchor, ref connectionA.position, out worldLineAnchor);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the line direction in connection A's local space.\n        /// </summary>\n        public Vector3 LocalLineDirection\n        {\n            get { return localLineDirection; }\n            set\n            {\n                localLineDirection = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localLineDirection, ref connectionA.orientationMatrix, out worldLineDirection);\n                UpdateRestrictedAxes();\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the point's location in connection B's local space.\n        /// The point is the location that is attached to the line.\n        /// </summary>\n        public Vector3 LocalPoint\n        {\n            get { return localPoint; }\n            set\n            {\n                localPoint = value;\n                Matrix3x3.Transform(ref localPoint, ref connectionB.orientationMatrix, out worldPoint);\n                Vector3.Add(ref worldPoint, ref connectionB.position, out worldPoint);\n            }\n        }\n\n        /// <summary>\n        /// Gets the offset from A to the connection point between the entities.\n        /// </summary>\n        public Vector3 OffsetA\n        {\n            get { return rA; }\n        }\n\n        /// <summary>\n        /// Gets the offset from B to the connection point between the entities.\n        /// </summary>\n        public Vector3 OffsetB\n        {\n            get { return rB; }\n        }\n\n        /// <summary>\n        /// Gets or sets the point's location in world space.\n        /// The point is the location on connection B that is attached to the line.\n        /// </summary>\n        public Vector3 Point\n        {\n            get { return worldPoint; }\n            set\n            {\n                worldPoint = value;\n                localPoint = worldPoint - connectionB.position;\n                Matrix3x3.TransformTranspose(ref localPoint, ref connectionB.orientationMatrix, out localPoint);\n            }\n        }\n\n        #region I2DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public Vector2 RelativeVelocity\n        {\n            get\n            {\n#if !WINDOWS\n                Vector2 lambda = new Vector2();\n#else\n                Vector2 lambda;\n#endif\n                Vector3 dv;\n                Vector3 aVel, bVel;\n                Vector3.Cross(ref connectionA.angularVelocity, ref rA, out aVel);\n                Vector3.Add(ref aVel, ref connectionA.linearVelocity, out aVel);\n                Vector3.Cross(ref connectionB.angularVelocity, ref rB, out bVel);\n                Vector3.Add(ref bVel, ref connectionB.linearVelocity, out bVel);\n                Vector3.Subtract(ref aVel, ref bVel, out dv);\n                Vector3.Dot(ref dv, ref worldRestrictedAxis1, out lambda.X);\n                Vector3.Dot(ref dv, ref worldRestrictedAxis2, out lambda.Y);\n                return lambda;\n            }\n        }\n\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public Vector2 TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public Vector2 Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I2DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = worldRestrictedAxis1;\n            jacobianY = worldRestrictedAxis2;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = -worldRestrictedAxis1;\n            jacobianY = -worldRestrictedAxis2;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = angularA1;\n            jacobianY = angularA2;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = angularB1;\n            jacobianY = angularB2;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"massMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out Matrix2x2 massMatrix)\n        {\n            Matrix2x2.Negate(ref negativeEffectiveMassMatrix, out massMatrix);\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Calculates and applies corrective impulses.\n        /// Called automatically by space.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            #region Theory\n\n            //lambda = -mc * (Jv + b)\n            // PraT = [ bx by bz ] * [  0   raz -ray ] = [ (-by * raz + bz * ray) (bx * raz - bz * rax) (-bx * ray + by * rax) ]\n            //        [ cx cy cz ]   [ -raz  0   rax ]   [ (-cy * raz + cz * ray) (cx * raz - cz * rax) (-cx * ray + cy * rax) ]\n            //                       [ ray -rax   0  ]\n            //\n            // PrbT = [ bx by bz ] * [  0   rbz -rby ] = [ (-by * rbz + bz * rby) (bx * rbz - bz * rbx) (-bx * rby + by * rbx) ]\n            //        [ cx cy cz ]   [ -rbz  0   rbx ]   [ (-cy * rbz + cz * rby) (cx * rbz - cz * rbx) (-cx * rby + cy * rbx) ]\n            //                       [ rby -rbx   0  ]\n            // Jv = [ bx by bz  PraT  -bx -by -bz  -Prbt ] * [ vax ]\n            //      [ cx cy cz        -cx -cy -cz        ]   [ vay ]\n            //                                               [ vaz ]\n            //                                               [ wax ]\n            //                                               [ way ]\n            //                                               [ waz ]\n            //                                               [ vbx ]\n            //                                               [ vby ]\n            //                                               [ vbz ]\n            //                                               [ wbx ]\n            //                                               [ wby ]\n            //                                               [ wbz ]\n            // va' = [ bx * vax + by * vay + bz * vaz ] = [ b * va ]\n            //       [ cx * vax + cy * vay + cz * vaz ]   [ c * va ] \n            // wa' = [ (PraT row 1) * wa ]\n            //       [ (PraT row 2) * wa ]\n            // vb' = [ -bx * vbx - by * vby - bz * vbz ] = [ -b * vb ]\n            //       [ -cx * vbx - cy * vby - cz * vbz ]   [ -c * vb ]\n            // wb' = [ -(PrbT row 1) * wb ]\n            //       [ -(PrbT row 2) * wb ]\n            // Jv = [ b * va + (PraT row 1) * wa - b * vb - (PrbT row 1) * wb ]\n            //      [ c * va + (PraT row 2) * wa - c * vb - (PrbT row 2) * wb ]\n            // Jv = [ b * (va + wa x ra - vb - wb x rb) ]\n            //      [ c * (va + wa x ra - vb - wb x rb) ]\n            //P = JT * lambda\n\n            #endregion\n\n#if !WINDOWS\n            Vector2 lambda = new Vector2();\n#else\n            Vector2 lambda;\n#endif\n            //float va1, va2, wa1, wa2, vb1, vb2, wb1, wb2;\n            //Vector3.Dot(ref worldAxis1, ref myParentA.myInternalLinearVelocity, out va1);\n            //Vector3.Dot(ref worldAxis2, ref myParentA.myInternalLinearVelocity, out va2);\n            //wa1 = prAT.M11 * myParentA.myInternalAngularVelocity.X + prAT.M12 * myParentA.myInternalAngularVelocity.Y + prAT.M13 * myParentA.myInternalAngularVelocity.Z;\n            //wa2 = prAT.M21 * myParentA.myInternalAngularVelocity.X + prAT.M22 * myParentA.myInternalAngularVelocity.Y + prAT.M23 * myParentA.myInternalAngularVelocity.Z;\n\n            //Vector3.Dot(ref worldAxis1, ref myParentB.myInternalLinearVelocity, out vb1);\n            //Vector3.Dot(ref worldAxis2, ref myParentB.myInternalLinearVelocity, out vb2);\n            //wb1 = prBT.M11 * myParentB.myInternalAngularVelocity.X + prBT.M12 * myParentB.myInternalAngularVelocity.Y + prBT.M13 * myParentB.myInternalAngularVelocity.Z;\n            //wb2 = prBT.M21 * myParentB.myInternalAngularVelocity.X + prBT.M22 * myParentB.myInternalAngularVelocity.Y + prBT.M23 * myParentB.myInternalAngularVelocity.Z;\n\n            //lambda.X = va1 + wa1 - vb1 - wb1 + biasVelocity.X + mySoftness * accumulatedImpulse.X;\n            //lambda.Y = va2 + wa2 - vb2 - wb2 + biasVelocity.Y + mySoftness * accumulatedImpulse.Y;\n            Vector3 dv;\n            Vector3 aVel, bVel;\n            Vector3.Cross(ref connectionA.angularVelocity, ref rA, out aVel);\n            Vector3.Add(ref aVel, ref connectionA.linearVelocity, out aVel);\n            Vector3.Cross(ref connectionB.angularVelocity, ref rB, out bVel);\n            Vector3.Add(ref bVel, ref connectionB.linearVelocity, out bVel);\n            Vector3.Subtract(ref aVel, ref bVel, out dv);\n            Vector3.Dot(ref dv, ref worldRestrictedAxis1, out lambda.X);\n            Vector3.Dot(ref dv, ref worldRestrictedAxis2, out lambda.Y);\n\n\n            lambda.X += biasVelocity.X + softness * accumulatedImpulse.X;\n            lambda.Y += biasVelocity.Y + softness * accumulatedImpulse.Y;\n\n            //Convert to impulse\n            Matrix2x2.Transform(ref lambda, ref negativeEffectiveMassMatrix, out lambda);\n\n            Vector2.Add(ref lambda, ref accumulatedImpulse, out accumulatedImpulse);\n\n            float x = lambda.X;\n            float y = lambda.Y;\n            //Apply impulse\n#if !WINDOWS\n            Vector3 impulse = new Vector3();\n            Vector3 torque= new Vector3();\n#else\n            Vector3 impulse;\n            Vector3 torque;\n#endif\n            impulse.X = worldRestrictedAxis1.X * x + worldRestrictedAxis2.X * y;\n            impulse.Y = worldRestrictedAxis1.Y * x + worldRestrictedAxis2.Y * y;\n            impulse.Z = worldRestrictedAxis1.Z * x + worldRestrictedAxis2.Z * y;\n            if (connectionA.isDynamic)\n            {\n                torque.X = x * angularA1.X + y * angularA2.X;\n                torque.Y = x * angularA1.Y + y * angularA2.Y;\n                torque.Z = x * angularA1.Z + y * angularA2.Z;\n\n                connectionA.ApplyLinearImpulse(ref impulse);\n                connectionA.ApplyAngularImpulse(ref torque);\n            }\n            if (connectionB.isDynamic)\n            {\n                impulse.X = -impulse.X;\n                impulse.Y = -impulse.Y;\n                impulse.Z = -impulse.Z;\n\n                torque.X = x * angularB1.X + y * angularB2.X;\n                torque.Y = x * angularB1.Y + y * angularB2.Y;\n                torque.Z = x * angularB1.Z + y * angularB2.Z;\n\n                connectionB.ApplyLinearImpulse(ref impulse);\n                connectionB.ApplyAngularImpulse(ref torque);\n            }\n            return (Math.Abs(lambda.X) + Math.Abs(lambda.Y));\n        }\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            //Transform local axes into world space\n            Matrix3x3.Transform(ref localRestrictedAxis1, ref connectionA.orientationMatrix, out worldRestrictedAxis1);\n            Matrix3x3.Transform(ref localRestrictedAxis2, ref connectionA.orientationMatrix, out worldRestrictedAxis2);\n            Matrix3x3.Transform(ref localAxisAnchor, ref connectionA.orientationMatrix, out worldLineAnchor);\n            Vector3.Add(ref worldLineAnchor, ref connectionA.position, out worldLineAnchor);\n            Matrix3x3.Transform(ref localLineDirection, ref connectionA.orientationMatrix, out worldLineDirection);\n\n            //Transform local \n            Matrix3x3.Transform(ref localPoint, ref connectionB.orientationMatrix, out rB);\n            Vector3.Add(ref rB, ref connectionB.position, out worldPoint);\n\n            //Find the point on the line closest to the world point.\n            Vector3 offset;\n            Vector3.Subtract(ref worldPoint, ref worldLineAnchor, out offset);\n            float distanceAlongAxis;\n            Vector3.Dot(ref offset, ref worldLineDirection, out distanceAlongAxis);\n\n            Vector3 worldNearPoint;\n            Vector3.Multiply(ref worldLineDirection, distanceAlongAxis, out offset);\n            Vector3.Add(ref worldLineAnchor, ref offset, out worldNearPoint);\n            Vector3.Subtract(ref worldNearPoint, ref connectionA.position, out rA);\n\n            //Error\n            Vector3 error3D;\n            Vector3.Subtract(ref worldPoint, ref worldNearPoint, out error3D);\n\n            Vector3.Dot(ref error3D, ref worldRestrictedAxis1, out error.X);\n            Vector3.Dot(ref error3D, ref worldRestrictedAxis2, out error.Y);\n\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n            float bias = -errorReduction;\n\n\n            biasVelocity.X = bias * error.X;\n            biasVelocity.Y = bias * error.Y;\n\n            //Ensure that the corrective velocity doesn't exceed the max.\n            float length = biasVelocity.LengthSquared();\n            if (length > maxCorrectiveVelocitySquared)\n            {\n                float multiplier = maxCorrectiveVelocity / (float)Math.Sqrt(length);\n                biasVelocity.X *= multiplier;\n                biasVelocity.Y *= multiplier;\n            }\n\n            //Set up the jacobians\n            Vector3.Cross(ref rA, ref worldRestrictedAxis1, out angularA1);\n            Vector3.Cross(ref worldRestrictedAxis1, ref rB, out angularB1);\n            Vector3.Cross(ref rA, ref worldRestrictedAxis2, out angularA2);\n            Vector3.Cross(ref worldRestrictedAxis2, ref rB, out angularB2);\n\n            float m11 = 0, m22 = 0, m1221 = 0;\n            float inverseMass;\n            Vector3 intermediate;\n            //Compute the effective mass matrix.\n            if (connectionA.isDynamic)\n            {\n                inverseMass = connectionA.inverseMass;\n                Matrix3x3.Transform(ref angularA1, ref connectionA.inertiaTensorInverse, out intermediate);\n                Vector3.Dot(ref intermediate, ref angularA1, out m11);\n                m11 += inverseMass;\n                Vector3.Dot(ref intermediate, ref angularA2, out m1221);\n                Matrix3x3.Transform(ref angularA2, ref connectionA.inertiaTensorInverse, out intermediate);\n                Vector3.Dot(ref intermediate, ref angularA2, out m22);\n                m22 += inverseMass;\n            }\n\n            #region Mass Matrix B\n\n            if (connectionB.isDynamic)\n            {\n                float extra;\n                inverseMass = connectionB.inverseMass;\n                Matrix3x3.Transform(ref angularB1, ref connectionB.inertiaTensorInverse, out intermediate);\n                Vector3.Dot(ref intermediate, ref angularB1, out extra);\n                m11 += inverseMass + extra;\n                Vector3.Dot(ref intermediate, ref angularB2, out extra);\n                m1221 += extra;\n                Matrix3x3.Transform(ref angularB2, ref connectionB.inertiaTensorInverse, out intermediate);\n                Vector3.Dot(ref intermediate, ref angularB2, out extra);\n                m22 += inverseMass + extra;\n            }\n\n            #endregion\n\n            negativeEffectiveMassMatrix.M11 = m11 + softness;\n            negativeEffectiveMassMatrix.M12 = m1221;\n            negativeEffectiveMassMatrix.M21 = m1221;\n            negativeEffectiveMassMatrix.M22 = m22 + softness;\n            Matrix2x2.Invert(ref negativeEffectiveMassMatrix, out negativeEffectiveMassMatrix);\n            Matrix2x2.Negate(ref negativeEffectiveMassMatrix, out negativeEffectiveMassMatrix);\n\n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n\n            //Warm starting\n#if !WINDOWS\n            Vector3 impulse = new Vector3();\n            Vector3 torque= new Vector3();\n#else\n            Vector3 impulse;\n            Vector3 torque;\n#endif\n            float x = accumulatedImpulse.X;\n            float y = accumulatedImpulse.Y;\n            impulse.X = worldRestrictedAxis1.X * x + worldRestrictedAxis2.X * y;\n            impulse.Y = worldRestrictedAxis1.Y * x + worldRestrictedAxis2.Y * y;\n            impulse.Z = worldRestrictedAxis1.Z * x + worldRestrictedAxis2.Z * y;\n            if (connectionA.isDynamic)\n            {\n                torque.X = x * angularA1.X + y * angularA2.X;\n                torque.Y = x * angularA1.Y + y * angularA2.Y;\n                torque.Z = x * angularA1.Z + y * angularA2.Z;\n\n                connectionA.ApplyLinearImpulse(ref impulse);\n                connectionA.ApplyAngularImpulse(ref torque);\n            }\n            if (connectionB.isDynamic)\n            {\n                impulse.X = -impulse.X;\n                impulse.Y = -impulse.Y;\n                impulse.Z = -impulse.Z;\n\n                torque.X = x * angularB1.X + y * angularB2.X;\n                torque.Y = x * angularB1.Y + y * angularB2.Y;\n                torque.Z = x * angularB1.Z + y * angularB2.Z;\n\n\n                connectionB.ApplyLinearImpulse(ref impulse);\n                connectionB.ApplyAngularImpulse(ref torque);\n            }\n        }\n\n        private void UpdateRestrictedAxes()\n        {\n            localRestrictedAxis1 = Vector3.Cross(Vector3.Up, localLineDirection);\n            if (localRestrictedAxis1.LengthSquared() < .001f)\n            {\n                localRestrictedAxis1 = Vector3.Cross(Vector3.Right, localLineDirection);\n            }\n            localRestrictedAxis2 = Vector3.Cross(localLineDirection, localRestrictedAxis1);\n            localRestrictedAxis1.Normalize();\n            localRestrictedAxis2.Normalize();\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Joints/PointOnPlaneJoint.cs",
    "content": "﻿using BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Joints\n{\n    /// <summary>\n    /// Constrains a point on one body to be on a plane defined by another body.\n    /// </summary>\n    public class PointOnPlaneJoint : Joint, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private float accumulatedImpulse;\n        private float biasVelocity;\n        private float error;\n\n        private Vector3 localPlaneAnchor;\n        private Vector3 localPlaneNormal;\n        private Vector3 localPointAnchor;\n\n        private Vector3 worldPlaneAnchor;\n        private Vector3 worldPlaneNormal;\n        private Vector3 worldPointAnchor;\n        private float negativeEffectiveMass;\n        private Vector3 rA;\n        private Vector3 rAcrossN;\n        private Vector3 rB;\n        private Vector3 rBcrossN;\n\n        /// <summary>\n        /// Constructs a new point on plane constraint.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the PlaneAnchor, PlaneNormal, and PointAnchor (or their entity-local versions).\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public PointOnPlaneJoint()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a new point on plane constraint.\n        /// </summary>\n        /// <param name=\"connectionA\">Entity to which the constraint's plane is attached.</param>\n        /// <param name=\"connectionB\">Entity to which the constraint's point is attached.</param>\n        /// <param name=\"planeAnchor\">A point on the plane.</param>\n        /// <param name=\"normal\">Direction, attached to the first connected entity, defining the plane's normal</param>\n        /// <param name=\"pointAnchor\">The point to constrain to the plane, attached to the second connected object.</param>\n        public PointOnPlaneJoint(Entity connectionA, Entity connectionB, Vector3 planeAnchor, Vector3 normal, Vector3 pointAnchor)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n\n            PointAnchor = pointAnchor;\n            PlaneAnchor = planeAnchor;\n            PlaneNormal = normal;\n        }\n\n        /// <summary>\n        /// Gets or sets the plane's anchor in entity A's local space.\n        /// </summary>\n        public Vector3 LocalPlaneAnchor\n        {\n            get { return localPlaneAnchor; }\n            set\n            {\n                localPlaneAnchor = value;\n                Matrix3x3.Transform(ref localPlaneAnchor, ref connectionA.orientationMatrix, out worldPlaneAnchor);\n                Vector3.Add(ref connectionA.position, ref worldPlaneAnchor, out worldPlaneAnchor);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the plane's normal in entity A's local space.\n        /// </summary>\n        public Vector3 LocalPlaneNormal\n        {\n            get { return localPlaneNormal; }\n            set\n            {\n                localPlaneNormal = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localPlaneNormal, ref connectionA.orientationMatrix, out worldPlaneNormal);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the point anchor in entity B's local space.\n        /// </summary>\n        public Vector3 LocalPointAnchor\n        {\n            get { return localPointAnchor; }\n            set\n            {\n                localPointAnchor = value;\n                Matrix3x3.Transform(ref localPointAnchor, ref connectionB.orientationMatrix, out worldPointAnchor);\n                Vector3.Add(ref worldPointAnchor, ref connectionB.position, out worldPointAnchor);\n            }\n        }\n\n        /// <summary>\n        /// Gets the offset from A to the connection point between the entities.\n        /// </summary>\n        public Vector3 OffsetA\n        {\n            get { return rA; }\n        }\n\n        /// <summary>\n        /// Gets the offset from B to the connection point between the entities.\n        /// </summary>\n        public Vector3 OffsetB\n        {\n            get { return rB; }\n        }\n\n        /// <summary>\n        /// Gets or sets the plane anchor in world space.\n        /// </summary>\n        public Vector3 PlaneAnchor\n        {\n            get { return worldPlaneAnchor; }\n            set\n            {\n                worldPlaneAnchor = value;\n                localPlaneAnchor = value - connectionA.position;\n                Matrix3x3.TransformTranspose(ref localPlaneAnchor, ref connectionA.orientationMatrix, out localPlaneAnchor);\n\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the plane's normal in world space.\n        /// </summary>\n        public Vector3 PlaneNormal\n        {\n            get { return worldPlaneNormal; }\n            set\n            {\n                worldPlaneNormal = Vector3.Normalize(value);\n                Matrix3x3.TransformTranspose(ref worldPlaneNormal, ref connectionA.orientationMatrix, out localPlaneNormal);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the point anchor in world space.\n        /// </summary>\n        public Vector3 PointAnchor\n        {\n            get { return worldPointAnchor; }\n            set\n            {\n                worldPointAnchor = value;\n                localPointAnchor = value - connectionB.position;\n                Matrix3x3.TransformTranspose(ref localPointAnchor, ref connectionB.orientationMatrix, out localPointAnchor);\n\n            }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                Vector3 dv;\n                Vector3 aVel, bVel;\n                Vector3.Cross(ref connectionA.angularVelocity, ref rA, out aVel);\n                Vector3.Add(ref aVel, ref connectionA.linearVelocity, out aVel);\n                Vector3.Cross(ref connectionB.angularVelocity, ref rB, out bVel);\n                Vector3.Add(ref bVel, ref connectionB.linearVelocity, out bVel);\n                Vector3.Subtract(ref aVel, ref bVel, out dv);\n                float velocityDifference;\n                Vector3.Dot(ref dv, ref worldPlaneNormal, out velocityDifference);\n                return velocityDifference;\n            }\n        }\n\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = worldPlaneNormal;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = -worldPlaneNormal;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = rAcrossN;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = -rBcrossN;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = -negativeEffectiveMass;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n            //TODO: This could technically be faster.\n            //Form the jacobian explicitly.\n            //Cross cross add add subtract dot\n            //vs\n            //dot dot dot dot and then scalar adds\n            Vector3 dv;\n            Vector3 aVel, bVel;\n            Vector3.Cross(ref connectionA.angularVelocity, ref rA, out aVel);\n            Vector3.Add(ref aVel, ref connectionA.linearVelocity, out aVel);\n            Vector3.Cross(ref connectionB.angularVelocity, ref rB, out bVel);\n            Vector3.Add(ref bVel, ref connectionB.linearVelocity, out bVel);\n            Vector3.Subtract(ref aVel, ref bVel, out dv);\n            float velocityDifference;\n            Vector3.Dot(ref dv, ref worldPlaneNormal, out velocityDifference);\n            //if(velocityDifference > 0)\n            //    Debug.WriteLine(\"Velocity difference: \" + velocityDifference);\n            //Debug.WriteLine(\"softness velocity: \" + softness * accumulatedImpulse);\n            float lambda = negativeEffectiveMass * (velocityDifference + biasVelocity + softness * accumulatedImpulse);\n            accumulatedImpulse += lambda;\n\n            Vector3 impulse;\n            Vector3 torque;\n            Vector3.Multiply(ref worldPlaneNormal, lambda, out impulse);\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref rAcrossN, lambda, out torque);\n                connectionA.ApplyLinearImpulse(ref impulse);\n                connectionA.ApplyAngularImpulse(ref torque);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Negate(ref impulse, out impulse);\n                Vector3.Multiply(ref rBcrossN, lambda, out torque);\n                connectionB.ApplyLinearImpulse(ref impulse);\n                connectionB.ApplyAngularImpulse(ref torque);\n            }\n\n            return lambda;\n        }\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            Matrix3x3.Transform(ref localPlaneNormal, ref connectionA.orientationMatrix, out worldPlaneNormal);\n            Matrix3x3.Transform(ref localPlaneAnchor, ref connectionA.orientationMatrix, out worldPlaneAnchor);\n            Vector3.Add(ref worldPlaneAnchor, ref connectionA.position, out worldPlaneAnchor);\n\n            Matrix3x3.Transform(ref localPointAnchor, ref connectionB.orientationMatrix, out rB);\n            Vector3.Add(ref rB, ref connectionB.position, out worldPointAnchor);\n\n            //Find rA and rB.\n            //So find the closest point on the plane to worldPointAnchor.\n            float pointDistance, planeDistance;\n            Vector3.Dot(ref worldPointAnchor, ref worldPlaneNormal, out pointDistance);\n            Vector3.Dot(ref worldPlaneAnchor, ref worldPlaneNormal, out planeDistance);\n            float distanceChange = planeDistance - pointDistance;\n            Vector3 closestPointOnPlane;\n            Vector3.Multiply(ref worldPlaneNormal, distanceChange, out closestPointOnPlane);\n            Vector3.Add(ref closestPointOnPlane, ref worldPointAnchor, out closestPointOnPlane);\n\n            Vector3.Subtract(ref closestPointOnPlane, ref connectionA.position, out rA);\n\n            Vector3.Cross(ref rA, ref worldPlaneNormal, out rAcrossN);\n            Vector3.Cross(ref rB, ref worldPlaneNormal, out rBcrossN);\n            Vector3.Negate(ref rBcrossN, out rBcrossN);\n\n            Vector3 offset;\n            Vector3.Subtract(ref worldPointAnchor, ref closestPointOnPlane, out offset);\n            Vector3.Dot(ref offset, ref worldPlaneNormal, out error);\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n            biasVelocity = MathHelper.Clamp(-errorReduction * error, -maxCorrectiveVelocity, maxCorrectiveVelocity);\n\n            if (connectionA.IsDynamic && connectionB.IsDynamic)\n            {\n                Vector3 IrACrossN, IrBCrossN;\n                Matrix3x3.Transform(ref rAcrossN, ref connectionA.inertiaTensorInverse, out IrACrossN);\n                Matrix3x3.Transform(ref rBcrossN, ref connectionB.inertiaTensorInverse, out IrBCrossN);\n                float angularA, angularB;\n                Vector3.Dot(ref rAcrossN, ref IrACrossN, out angularA);\n                Vector3.Dot(ref rBcrossN, ref IrBCrossN, out angularB);\n                negativeEffectiveMass = connectionA.inverseMass + connectionB.inverseMass + angularA + angularB;\n                negativeEffectiveMass = -1 / (negativeEffectiveMass + softness);\n            }\n            else if (connectionA.IsDynamic && !connectionB.IsDynamic)\n            {\n                Vector3 IrACrossN;\n                Matrix3x3.Transform(ref rAcrossN, ref connectionA.inertiaTensorInverse, out IrACrossN);\n                float angularA;\n                Vector3.Dot(ref rAcrossN, ref IrACrossN, out angularA);\n                negativeEffectiveMass = connectionA.inverseMass + angularA;\n                negativeEffectiveMass = -1 / (negativeEffectiveMass + softness);\n            }\n            else if (!connectionA.IsDynamic && connectionB.IsDynamic)\n            {\n                Vector3 IrBCrossN;\n                Matrix3x3.Transform(ref rBcrossN, ref connectionB.inertiaTensorInverse, out IrBCrossN);\n                float angularB;\n                Vector3.Dot(ref rBcrossN, ref IrBCrossN, out angularB);\n                negativeEffectiveMass = connectionB.inverseMass + angularB;\n                negativeEffectiveMass = -1 / (negativeEffectiveMass + softness);\n            }\n            else\n                negativeEffectiveMass = 0;\n\n\n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Warm Starting\n            Vector3 impulse;\n            Vector3 torque;\n            Vector3.Multiply(ref worldPlaneNormal, accumulatedImpulse, out impulse);\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref rAcrossN, accumulatedImpulse, out torque);\n                connectionA.ApplyLinearImpulse(ref impulse);\n                connectionA.ApplyAngularImpulse(ref torque);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Negate(ref impulse, out impulse);\n                Vector3.Multiply(ref rBcrossN, accumulatedImpulse, out torque);\n                connectionB.ApplyLinearImpulse(ref impulse);\n                connectionB.ApplyAngularImpulse(ref torque);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Joints/RevoluteAngularJoint.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Joints\n{\n    /// <summary>\n    /// Constrains two entities to rotate only around a single axis.\n    /// Acts like the angular portion of a hinge joint.\n    /// </summary>\n    public class RevoluteAngularJoint : Joint, I2DImpulseConstraintWithError, I2DJacobianConstraint\n    {\n        private Vector2 accumulatedImpulse;\n        private Vector2 biasVelocity;\n        private Matrix2x2 effectiveMassMatrix;\n        private Vector3 localAxisA, localAxisB;\n        private Vector3 localConstrainedAxis1, localConstrainedAxis2; //Not a and b because they are both based on a...\n        private Vector2 error;\n        private Vector3 worldAxisA, worldAxisB;\n        private Vector3 worldConstrainedAxis1, worldConstrainedAxis2;\n\n        /// <summary>\n        /// Constructs a new orientation joint.\n        /// Orientation joints can be used to simulate the angular portion of a hinge.\n        /// Orientation joints allow rotation around only a single axis.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the WorldFreeAxisA and WorldFreeAxisB (or their entity-local versions).\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public RevoluteAngularJoint()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a new orientation joint.\n        /// Orientation joints can be used to simulate the angular portion of a hinge.\n        /// Orientation joints allow rotation around only a single axis.\n        /// </summary>\n        /// <param name=\"connectionA\">First entity connected in the orientation joint.</param>\n        /// <param name=\"connectionB\">Second entity connected in the orientation joint.</param>\n        /// <param name=\"freeAxis\">Axis allowed to rotate freely in world space.</param>\n        public RevoluteAngularJoint(Entity connectionA, Entity connectionB, Vector3 freeAxis)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n\n            //rA and rB store the local version of the axis.\n            WorldFreeAxisA = freeAxis;\n            WorldFreeAxisB = freeAxis;\n        }\n\n        /// <summary>\n        /// Gets or sets the free axis in connection A's local space.\n        /// Updates the internal restricted axes.\n        /// </summary>\n        public Vector3 LocalFreeAxisA\n        {\n            get { return localAxisA; }\n            set\n            {\n                localAxisA = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localAxisA, ref connectionA.orientationMatrix, out worldAxisA);\n                UpdateRestrictedAxes();\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the free axis in connection B's local space.\n        /// </summary>\n        public Vector3 LocalFreeAxisB\n        {\n            get { return localAxisB; }\n            set\n            {\n                localAxisB = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localAxisB, ref connectionB.orientationMatrix, out worldAxisB);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the free axis attached to connection A in world space.\n        /// This does not change the other connection's free axis.\n        /// Updates the internal restricted axes.\n        /// </summary>\n        public Vector3 WorldFreeAxisA\n        {\n            get { return worldAxisA; }\n            set\n            {\n                worldAxisA = Vector3.Normalize(value);\n                Matrix3x3.TransformTranspose(ref worldAxisA, ref connectionA.orientationMatrix, out localAxisA);\n                UpdateRestrictedAxes();\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the free axis attached to connection A in world space.\n        /// This does not change the other connection's free axis.\n        /// </summary>\n        public Vector3 WorldFreeAxisB\n        {\n            get { return worldAxisB; }\n            set\n            {\n                worldAxisB = Vector3.Normalize(value);\n                Matrix3x3.TransformTranspose(ref worldAxisB, ref connectionB.orientationMatrix, out localAxisB);\n            }\n        }\n\n        #region I2DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public Vector2 RelativeVelocity\n        {\n            get\n            {\n                Vector3 velocity;\n                Vector3.Subtract(ref connectionA.angularVelocity, ref connectionB.angularVelocity, out velocity);\n\n#if !WINDOWS\n                Vector2 lambda = new Vector2();\n#else\n                Vector2 lambda;\n#endif\n                Vector3.Dot(ref worldConstrainedAxis1, ref velocity, out lambda.X);\n                Vector3.Dot(ref worldConstrainedAxis2, ref velocity, out lambda.Y);\n                return lambda;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public Vector2 TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public Vector2 Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I2DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = Toolbox.ZeroVector;\n            jacobianY = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = Toolbox.ZeroVector;\n            jacobianY = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = worldConstrainedAxis1;\n            jacobianY = worldConstrainedAxis2;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobianX, out Vector3 jacobianY)\n        {\n            jacobianX = -worldConstrainedAxis1;\n            jacobianY = -worldConstrainedAxis2;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"massMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out Matrix2x2 massMatrix)\n        {\n            massMatrix = effectiveMassMatrix;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n            // lambda = -mc * (Jv + b)\n            // P = JT * lambda\n            Vector3 velocity;\n            Vector3.Subtract(ref connectionA.angularVelocity, ref connectionB.angularVelocity, out velocity);\n\n#if !WINDOWS\n            Vector2 lambda = new Vector2();\n#else\n            Vector2 lambda;\n#endif\n            Vector3.Dot(ref worldConstrainedAxis1, ref velocity, out lambda.X);\n            Vector3.Dot(ref worldConstrainedAxis2, ref velocity, out lambda.Y);\n            Vector2.Add(ref lambda, ref biasVelocity, out lambda);\n            Vector2 softnessImpulse;\n            Vector2.Multiply(ref accumulatedImpulse, softness, out softnessImpulse);\n            Vector2.Add(ref lambda, ref softnessImpulse, out lambda);\n            Matrix2x2.Transform(ref lambda, ref effectiveMassMatrix, out lambda);\n            Vector2.Add(ref accumulatedImpulse, ref lambda, out accumulatedImpulse);\n\n\n#if !WINDOWS\n            Vector3 impulse = new Vector3();\n#else\n            Vector3 impulse;\n#endif\n            impulse.X = worldConstrainedAxis1.X * lambda.X + worldConstrainedAxis2.X * lambda.Y;\n            impulse.Y = worldConstrainedAxis1.Y * lambda.X + worldConstrainedAxis2.Y * lambda.Y;\n            impulse.Z = worldConstrainedAxis1.Z * lambda.X + worldConstrainedAxis2.Z * lambda.Y;\n            if (connectionA.isDynamic)\n            {\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Negate(ref impulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return (Math.Abs(lambda.X) + Math.Abs(lambda.Y));\n        }\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            Matrix3x3.Transform(ref localAxisA, ref connectionA.orientationMatrix, out worldAxisA);\n            Matrix3x3.Transform(ref localAxisB, ref connectionB.orientationMatrix, out worldAxisB);\n\n\n            Matrix3x3.Transform(ref localConstrainedAxis1, ref connectionA.orientationMatrix, out worldConstrainedAxis1);\n            Matrix3x3.Transform(ref localConstrainedAxis2, ref connectionA.orientationMatrix, out worldConstrainedAxis2);\n\n            Vector3 error;\n            Vector3.Cross(ref worldAxisA, ref worldAxisB, out error);\n\n            Vector3.Dot(ref error, ref worldConstrainedAxis1, out this.error.X);\n            Vector3.Dot(ref error, ref worldConstrainedAxis2, out this.error.Y);\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n            errorReduction = -errorReduction;\n            biasVelocity.X = errorReduction * this.error.X;\n            biasVelocity.Y = errorReduction * this.error.Y;\n\n\n            //Ensure that the corrective velocity doesn't exceed the max.\n            float length = biasVelocity.LengthSquared();\n            if (length > maxCorrectiveVelocitySquared)\n            {\n                float multiplier = maxCorrectiveVelocity / (float) Math.Sqrt(length);\n                biasVelocity.X *= multiplier;\n                biasVelocity.Y *= multiplier;\n            }\n\n            Vector3 axis1I, axis2I;\n            if (connectionA.isDynamic && connectionB.isDynamic)\n            {\n                Matrix3x3 inertiaTensorSum;\n                Matrix3x3.Add(ref connectionA.inertiaTensorInverse, ref connectionB.inertiaTensorInverse, out inertiaTensorSum);\n\n                Matrix3x3.Transform(ref worldConstrainedAxis1, ref inertiaTensorSum, out axis1I);\n                Matrix3x3.Transform(ref worldConstrainedAxis2, ref inertiaTensorSum, out axis2I);\n            }\n            else if (connectionA.isDynamic && !connectionB.isDynamic)\n            {\n                Matrix3x3.Transform(ref worldConstrainedAxis1, ref connectionA.inertiaTensorInverse, out axis1I);\n                Matrix3x3.Transform(ref worldConstrainedAxis2, ref connectionA.inertiaTensorInverse, out axis2I);\n            }\n            else if (!connectionA.isDynamic && connectionB.isDynamic)\n            {\n                Matrix3x3.Transform(ref worldConstrainedAxis1, ref connectionB.inertiaTensorInverse, out axis1I);\n                Matrix3x3.Transform(ref worldConstrainedAxis2, ref connectionB.inertiaTensorInverse, out axis2I);\n            }\n            else\n            {\n                throw new InvalidOperationException(\"Cannot constrain two kinematic bodies.\");\n            }\n\n            Vector3.Dot(ref axis1I, ref worldConstrainedAxis1, out effectiveMassMatrix.M11);\n            Vector3.Dot(ref axis1I, ref worldConstrainedAxis2, out effectiveMassMatrix.M12);\n            Vector3.Dot(ref axis2I, ref worldConstrainedAxis1, out effectiveMassMatrix.M21);\n            Vector3.Dot(ref axis2I, ref worldConstrainedAxis2, out effectiveMassMatrix.M22);\n            effectiveMassMatrix.M11 += softness;\n            effectiveMassMatrix.M22 += softness;\n            Matrix2x2.Invert(ref effectiveMassMatrix, out effectiveMassMatrix);\n            Matrix2x2.Negate(ref effectiveMassMatrix, out effectiveMassMatrix);\n\n   \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Warm Starting\n#if !WINDOWS\n            Vector3 impulse = new Vector3();\n#else\n            Vector3 impulse;\n#endif\n            impulse.X = worldConstrainedAxis1.X * accumulatedImpulse.X + worldConstrainedAxis2.X * accumulatedImpulse.Y;\n            impulse.Y = worldConstrainedAxis1.Y * accumulatedImpulse.X + worldConstrainedAxis2.Y * accumulatedImpulse.Y;\n            impulse.Z = worldConstrainedAxis1.Z * accumulatedImpulse.X + worldConstrainedAxis2.Z * accumulatedImpulse.Y;\n            if (connectionA.isDynamic)\n            {\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Negate(ref impulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n\n        private void UpdateRestrictedAxes()\n        {\n            localConstrainedAxis1 = Vector3.Cross(Vector3.Up, localAxisA);\n            if (localConstrainedAxis1.LengthSquared() < .001f)\n            {\n                localConstrainedAxis1 = Vector3.Cross(Vector3.Right, localAxisA);\n            }\n            localConstrainedAxis2 = Vector3.Cross(localAxisA, localConstrainedAxis1);\n            localConstrainedAxis1.Normalize();\n            localConstrainedAxis2.Normalize();\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Joints/SwivelHingeAngularJoint.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Joints\n{\n    /// <summary>\n    /// Constrains two bodies so that they can rotate relative to each other like a modified door hinge.\n    /// Instead of removing two degrees of freedom, only one is removed so that the second connection to the constraint can twist.\n    /// </summary>\n    public class SwivelHingeAngularJoint : Joint, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private float accumulatedImpulse;\n        private float biasVelocity;\n        private Vector3 jacobianA, jacobianB;\n        private float error;\n        private Vector3 localHingeAxis;\n        private Vector3 localTwistAxis;\n        private Vector3 worldHingeAxis;\n        private Vector3 worldTwistAxis;\n        private float velocityToImpulse;\n\n        /// <summary>\n        /// Constructs a new constraint which allows relative angular motion around a hinge axis and a twist axis.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the WorldHingeAxis and WorldTwistAxis (or their entity-local versions).\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public SwivelHingeAngularJoint()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a new constraint which allows relative angular motion around a hinge axis and a twist axis.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        /// <param name=\"worldHingeAxis\">Hinge axis attached to connectionA.\n        /// The connected entities will be able to rotate around this axis relative to each other.</param>\n        /// <param name=\"worldTwistAxis\">Twist axis attached to connectionB.\n        /// The connected entities will be able to rotate around this axis relative to each other.</param>\n        public SwivelHingeAngularJoint(Entity connectionA, Entity connectionB, Vector3 worldHingeAxis, Vector3 worldTwistAxis)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n            WorldHingeAxis = worldHingeAxis;\n            WorldTwistAxis = worldTwistAxis;\n        }\n\n        /// <summary>\n        /// Gets or sets the hinge axis attached to entity A in its local space.\n        /// </summary>\n        public Vector3 LocalHingeAxis\n        {\n            get { return localHingeAxis; }\n            set\n            {\n                localHingeAxis = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localHingeAxis, ref connectionA.orientationMatrix, out worldHingeAxis);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the twist axis attached to entity B in its local space.\n        /// </summary>\n        public Vector3 LocalTwistAxis\n        {\n            get { return localTwistAxis; }\n            set\n            {\n                localTwistAxis = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localTwistAxis, ref connectionB.orientationMatrix, out worldTwistAxis);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the hinge axis attached to entity A in world space.\n        /// </summary>\n        public Vector3 WorldHingeAxis\n        {\n            get { return worldHingeAxis; }\n            set\n            {\n                worldHingeAxis = Vector3.Normalize(value);\n                Quaternion conjugate;\n                Quaternion.Conjugate(ref connectionA.orientation, out conjugate);\n                Vector3.Transform(ref worldHingeAxis, ref conjugate, out localHingeAxis);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to the first connected entity in world space.\n        /// </summary>\n        public Vector3 WorldTwistAxis\n        {\n            get { return worldTwistAxis; }\n            set\n            {\n                worldTwistAxis = Vector3.Normalize(value);\n                Quaternion conjugate;\n                Quaternion.Conjugate(ref connectionB.orientation, out conjugate);\n                Vector3.Transform(ref worldTwistAxis, ref conjugate, out localTwistAxis);\n            }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float velocityA, velocityB;\n                //Find the velocity contribution from each connection\n                Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n                Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n                return velocityA + velocityB;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jacobianA;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jacobianB;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = velocityToImpulse;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Solves for velocity.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            float velocityA, velocityB;\n            //Find the velocity contribution from each connection\n            Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n            Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n            //Add in the constraint space bias velocity\n            float lambda = -(velocityA + velocityB) - biasVelocity - softness * accumulatedImpulse;\n\n            //Transform to an impulse\n            lambda *= velocityToImpulse;\n\n            //Accumulate the impulse\n            accumulatedImpulse += lambda;\n\n            //Apply the impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, lambda, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, lambda, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return (Math.Abs(lambda));\n        }\n\n        /// <summary>\n        /// Do any necessary computations to prepare the constraint for this frame.\n        /// </summary>\n        /// <param name=\"dt\">Simulation step length.</param>\n        public override void Update(float dt)\n        {\n            //Transform the axes into world space.\n            Matrix3x3.Transform(ref localHingeAxis, ref connectionA.orientationMatrix, out worldHingeAxis);\n            Matrix3x3.Transform(ref localTwistAxis, ref connectionB.orientationMatrix, out worldTwistAxis);\n\n            //****** VELOCITY BIAS ******//\n            Vector3.Dot(ref worldHingeAxis, ref worldTwistAxis, out error);\n            //Compute the correction velocity.\n\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n\n            biasVelocity = MathHelper.Clamp(error * errorReduction, -maxCorrectiveVelocity, maxCorrectiveVelocity);\n\n            //Compute the jacobian\n            Vector3.Cross(ref worldHingeAxis, ref worldTwistAxis, out jacobianA);\n            float length = jacobianA.LengthSquared();\n            if (length > Toolbox.Epsilon)\n                Vector3.Divide(ref jacobianA, (float)Math.Sqrt(length), out jacobianA);\n            else\n                jacobianA = new Vector3();\n            jacobianB.X = -jacobianA.X;\n            jacobianB.Y = -jacobianA.Y;\n            jacobianB.Z = -jacobianA.Z;\n\n\n            //****** EFFECTIVE MASS MATRIX ******//\n            //Connection A's contribution to the mass matrix\n            float entryA;\n            Vector3 transformedAxis;\n            if (connectionA.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianA, ref connectionA.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianA, out entryA);\n            }\n            else\n                entryA = 0;\n\n            //Connection B's contribution to the mass matrix\n            float entryB;\n            if (connectionB.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianB, ref connectionB.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianB, out entryB);\n            }\n            else\n                entryB = 0;\n\n            //Compute the inverse mass matrix\n            velocityToImpulse = 1 / (softness + entryA + entryB);\n\n            \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //****** WARM STARTING ******//\n            //Apply accumulated impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, accumulatedImpulse, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, accumulatedImpulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Joints/TwistJoint.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Joints\n{\n    /// <summary>\n    /// Prevents the connected entities from twisting relative to each other.\n    /// Acts like the angular part of a universal joint.\n    /// </summary>\n    public class TwistJoint : Joint, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private Vector3 aLocalAxisY, aLocalAxisZ;\n        private float accumulatedImpulse;\n        private Vector3 bLocalAxisY;\n        private float biasVelocity;\n        private Vector3 jacobianA, jacobianB;\n        private float error;\n        private Vector3 localAxisA;\n        private Vector3 localAxisB;\n        private Vector3 worldAxisA;\n        private Vector3 worldAxisB;\n        private float velocityToImpulse;\n\n        /// <summary>\n        /// Constructs a new constraint which prevents the connected entities from twisting relative to each other.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the WorldAxisA and WorldAxisB (or their entity-local versions).\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public TwistJoint()\n        {\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a new constraint which prevents the connected entities from twisting relative to each other.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        /// <param name=\"axisA\">Twist axis attached to the first connected entity.</param>\n        /// <param name=\"axisB\">Twist axis attached to the second connected entity.</param>\n        public TwistJoint(Entity connectionA, Entity connectionB, Vector3 axisA, Vector3 axisB)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n            WorldAxisA = axisA;\n            WorldAxisB = axisB;\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to the first connected entity in its local space.\n        /// </summary>\n        public Vector3 LocalAxisA\n        {\n            get { return localAxisA; }\n            set\n            {\n                localAxisA = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localAxisA, ref connectionA.orientationMatrix, out worldAxisA);\n                Initialize();\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to the first connected entity in its local space.\n        /// </summary>\n        public Vector3 LocalAxisB\n        {\n            get { return localAxisB; }\n            set\n            {\n                localAxisB = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localAxisB, ref connectionA.orientationMatrix, out worldAxisB);\n                Initialize();\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to the first connected entity in world space.\n        /// </summary>\n        public Vector3 WorldAxisA\n        {\n            get { return worldAxisA; }\n            set\n            {\n                worldAxisA = Vector3.Normalize(value);\n                Quaternion conjugate;\n                Quaternion.Conjugate(ref connectionA.orientation, out conjugate);\n                Vector3.Transform(ref worldAxisA, ref conjugate, out localAxisA);\n                Initialize();\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to the first connected entity in world space.\n        /// </summary>\n        public Vector3 WorldAxisB\n        {\n            get { return worldAxisB; }\n            set\n            {\n                worldAxisB = Vector3.Normalize(value);\n                Quaternion conjugate;\n                Quaternion.Conjugate(ref connectionA.orientation, out conjugate);\n                Vector3.Transform(ref worldAxisB, ref conjugate, out localAxisB);\n                Initialize();\n            }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float velocityA, velocityB;\n                Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n                Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n                return velocityA + velocityB;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jacobianA;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jacobianB;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = velocityToImpulse;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Solves for velocity.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            float velocityA, velocityB;\n            //Find the velocity contribution from each connection\n            Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n            Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n            //Add in the constraint space bias velocity\n            float lambda = -(velocityA + velocityB) + biasVelocity - softness * accumulatedImpulse;\n\n            //Transform to an impulse\n            lambda *= velocityToImpulse;\n\n            //Accumulate the impulse\n            accumulatedImpulse += lambda;\n\n            //Apply the impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, lambda, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, lambda, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return (Math.Abs(lambda));\n        }\n\n        /// <summary>\n        /// Do any necessary computations to prepare the constraint for this frame.\n        /// </summary>\n        /// <param name=\"dt\">Simulation step length.</param>\n        public override void Update(float dt)\n        {\n            Vector3 aAxisY, aAxisZ;\n            Vector3 bAxisY;\n            Matrix3x3.Transform(ref localAxisA, ref connectionA.orientationMatrix, out worldAxisA);\n            Matrix3x3.Transform(ref aLocalAxisY, ref connectionA.orientationMatrix, out aAxisY);\n            Matrix3x3.Transform(ref aLocalAxisZ, ref connectionA.orientationMatrix, out aAxisZ);\n            Matrix3x3.Transform(ref localAxisB, ref connectionB.orientationMatrix, out worldAxisB);\n            Matrix3x3.Transform(ref bLocalAxisY, ref connectionB.orientationMatrix, out bAxisY);\n\n            Quaternion rotation;\n            Toolbox.GetQuaternionBetweenNormalizedVectors(ref worldAxisB, ref worldAxisA, out rotation);\n\n            //Transform b's 'Y' axis so that it is perpendicular with a's 'X' axis for measurement.\n            Vector3 twistMeasureAxis;\n            Vector3.Transform(ref bAxisY, ref rotation, out twistMeasureAxis);\n\n            //By dotting the measurement vector with a 2d plane's axes, we can get a local X and Y value.\n            float y, x;\n            Vector3.Dot(ref twistMeasureAxis, ref aAxisZ, out y);\n            Vector3.Dot(ref twistMeasureAxis, ref aAxisY, out x);\n            error = (float) Math.Atan2(y, x);\n\n            //Debug.WriteLine(\"Angle: \" + angle);\n\n            //The nice thing about this approach is that the jacobian entry doesn't flip.\n            //Instead, the error can be negative due to the use of Atan2.\n            //This is important for limits which have a unique high and low value.\n\n            //Compute the jacobian.\n            Vector3.Add(ref worldAxisA, ref worldAxisB, out jacobianB);\n            if (jacobianB.LengthSquared() < Toolbox.Epsilon)\n            {\n                //A nasty singularity can show up if the axes are aligned perfectly.\n                //In a 'real' situation, this is impossible, so just ignore it.\n                isActiveInSolver = false;\n                return;\n            }\n\n            jacobianB.Normalize();\n            jacobianA.X = -jacobianB.X;\n            jacobianA.Y = -jacobianB.Y;\n            jacobianA.Z = -jacobianB.Z;\n\n            //****** VELOCITY BIAS ******//\n            //Compute the correction velocity.\n            float errorReduction;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out softness);\n            biasVelocity = MathHelper.Clamp(-error * errorReduction, -maxCorrectiveVelocity, maxCorrectiveVelocity);\n\n            //****** EFFECTIVE MASS MATRIX ******//\n            //Connection A's contribution to the mass matrix\n            float entryA;\n            Vector3 transformedAxis;\n            if (connectionA.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianA, ref connectionA.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianA, out entryA);\n            }\n            else\n                entryA = 0;\n\n            //Connection B's contribution to the mass matrix\n            float entryB;\n            if (connectionB.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianB, ref connectionB.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianB, out entryB);\n            }\n            else\n                entryB = 0;\n\n            //Compute the inverse mass matrix\n            velocityToImpulse = 1 / (softness + entryA + entryB);\n\n            \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //****** WARM STARTING ******//\n            //Apply accumulated impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, accumulatedImpulse, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, accumulatedImpulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n\n        private void Initialize()\n        {\n            //Compute a vector which is perpendicular to the axis.  It'll be added in local space to both connections.\n            Vector3 yAxis;\n            Vector3.Cross(ref worldAxisA, ref Toolbox.UpVector, out yAxis);\n            float length = yAxis.LengthSquared();\n            if (length < Toolbox.Epsilon)\n            {\n                Vector3.Cross(ref worldAxisA, ref Toolbox.RightVector, out yAxis);\n            }\n            yAxis.Normalize();\n\n            //Put the axis into the local space of A.\n            Quaternion conjugate;\n            Quaternion.Conjugate(ref connectionA.orientation, out conjugate);\n            Vector3.Transform(ref yAxis, ref conjugate, out aLocalAxisY);\n\n            //Complete A's basis.\n            Vector3.Cross(ref localAxisA, ref aLocalAxisY, out aLocalAxisZ);\n\n            //Rotate the axis to B since it could be arbitrarily rotated.\n            Quaternion rotation;\n            Toolbox.GetQuaternionBetweenNormalizedVectors(ref worldAxisA, ref worldAxisB, out rotation);\n            Vector3.Transform(ref yAxis, ref rotation, out yAxis);\n\n            //Put it into local space.\n            Quaternion.Conjugate(ref connectionB.orientation, out conjugate);\n            Vector3.Transform(ref yAxis, ref conjugate, out bLocalAxisY);\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Motors/AngularMotor.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Motors\n{\n    /// <summary>\n    /// Constraint which attempts to restrict the relative angular motion of two entities.\n    /// Can use a target relative orientation to apply additional force.\n    /// </summary>\n    public class AngularMotor : Motor, I3DImpulseConstraintWithError, I3DJacobianConstraint\n    {\n        private readonly JointBasis3D basis = new JointBasis3D();\n\n        private readonly MotorSettingsOrientation settings;\n        private Vector3 accumulatedImpulse;\n\n\n        private float angle;\n        private Vector3 axis;\n        private Vector3 biasVelocity;\n        private Matrix3x3 effectiveMassMatrix;\n\n        /// <summary>\n        /// Constructs a new constraint which attempts to restrict the relative angular motion of two entities.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB).\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public AngularMotor()\n        {\n            IsActive = false;\n            settings = new MotorSettingsOrientation(this);\n        }\n\n        /// <summary>\n        /// Constructs a new constraint which attempts to restrict the relative angular motion of two entities.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        public AngularMotor(Entity connectionA, Entity connectionB)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n\n            settings = new MotorSettingsOrientation(this);\n\n            //Compute the rotation from A to B in A's local space.\n            Quaternion orientationAConjugate;\n            Quaternion.Conjugate(ref connectionA.orientation, out orientationAConjugate);\n            Quaternion.Concatenate(ref connectionB.orientation, ref orientationAConjugate, out settings.servo.goal);\n\n        }\n\n        /// <summary>\n        /// Gets the basis attached to entity A.\n        /// The target velocity/orientation of this motor is transformed by the basis.\n        /// </summary>\n        public JointBasis3D Basis\n        {\n            get { return basis; }\n        }\n\n        /// <summary>\n        /// Gets the motor's velocity and servo settings.\n        /// </summary>\n        public MotorSettingsOrientation Settings\n        {\n            get { return settings; }\n        }\n\n        #region I3DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public Vector3 RelativeVelocity\n        {\n            get { return connectionA.angularVelocity - connectionB.angularVelocity; }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public Vector3 TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// If the motor is in velocity only mode, error is zero.\n        /// </summary>\n        public Vector3 Error\n        {\n            get { return axis * angle; }\n        }\n\n        #endregion\n\n        #region I3DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianZ\">Third linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = Toolbox.ZeroVector;\n            jacobianY = Toolbox.ZeroVector;\n            jacobianZ = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second linear jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianZ\">Third linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = Toolbox.ZeroVector;\n            jacobianY = Toolbox.ZeroVector;\n            jacobianZ = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the first connected entity.</param>\n        /// <param name=\"jacobianZ\">Third angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = Toolbox.RightVector;\n            jacobianY = Toolbox.UpVector;\n            jacobianZ = Toolbox.BackVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobianX\">First angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianY\">Second angular jacobian entry for the second connected entity.</param>\n        /// <param name=\"jacobianZ\">Third angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobianX, out Vector3 jacobianY, out Vector3 jacobianZ)\n        {\n            jacobianX = Toolbox.RightVector;\n            jacobianY = Toolbox.UpVector;\n            jacobianZ = Toolbox.BackVector;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out Matrix3x3 outputMassMatrix)\n        {\n            outputMassMatrix = effectiveMassMatrix;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Applies the corrective impulses required by the constraint.\n        /// </summary>\n        public override float SolveIteration()\n        {\n#if !WINDOWS\n            Vector3 lambda = new Vector3();\n#else\n            Vector3 lambda;\n#endif\n            Vector3 aVel = connectionA.angularVelocity;\n            Vector3 bVel = connectionB.angularVelocity;\n            lambda.X = bVel.X - aVel.X - biasVelocity.X - usedSoftness * accumulatedImpulse.X;\n            lambda.Y = bVel.Y - aVel.Y - biasVelocity.Y - usedSoftness * accumulatedImpulse.Y;\n            lambda.Z = bVel.Z - aVel.Z - biasVelocity.Z - usedSoftness * accumulatedImpulse.Z;\n\n            Matrix3x3.Transform(ref lambda, ref effectiveMassMatrix, out lambda);\n\n            Vector3 previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse.X += lambda.X;\n            accumulatedImpulse.Y += lambda.Y;\n            accumulatedImpulse.Z += lambda.Z;\n            float sumLengthSquared = accumulatedImpulse.LengthSquared();\n\n            if (sumLengthSquared > maxForceDtSquared)\n            {\n                //max / impulse gives some value 0 < x < 1.  Basically, normalize the vector (divide by the length) and scale by the maximum.\n                float multiplier = maxForceDt / (float) Math.Sqrt(sumLengthSquared);\n                accumulatedImpulse.X *= multiplier;\n                accumulatedImpulse.Y *= multiplier;\n                accumulatedImpulse.Z *= multiplier;\n\n                //Since the limit was exceeded by this corrective impulse, limit it so that the accumulated impulse remains constrained.\n                lambda.X = accumulatedImpulse.X - previousAccumulatedImpulse.X;\n                lambda.Y = accumulatedImpulse.Y - previousAccumulatedImpulse.Y;\n                lambda.Z = accumulatedImpulse.Z - previousAccumulatedImpulse.Z;\n            }\n\n\n            if (connectionA.isDynamic)\n            {\n                connectionA.ApplyAngularImpulse(ref lambda);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3 torqueB;\n                Vector3.Negate(ref lambda, out torqueB);\n                connectionB.ApplyAngularImpulse(ref torqueB);\n            }\n\n            return (Math.Abs(lambda.X) + Math.Abs(lambda.Y) + Math.Abs(lambda.Z));\n        }\n\n        /// <summary>\n        /// Initializes the constraint for the current frame.\n        /// </summary>\n        /// <param name=\"dt\">Time between frames.</param>\n        public override void Update(float dt)\n        {\n            basis.rotationMatrix = connectionA.orientationMatrix;\n            basis.ComputeWorldSpaceAxes();\n\n            if (settings.mode == MotorMode.Servomechanism) //Only need to do the bulk of this work if it's a servo.\n            {\n\n                //The error is computed using this equation:\n                //GoalRelativeOrientation * ConnectionA.Orientation * Error = ConnectionB.Orientation\n                //GoalRelativeOrientation is the original rotation from A to B in A's local space.\n                //Multiplying by A's orientation gives us where B *should* be.\n                //Of course, B won't be exactly where it should be after initialization.\n                //The Error component holds the difference between what is and what should be.\n                //Error = (GoalRelativeOrientation * ConnectionA.Orientation)^-1 * ConnectionB.Orientation\n\n                //ConnectionA.Orientation is replaced in the above by the world space basis orientation.\n                Quaternion worldBasis = Matrix3x3.CreateQuaternion(basis.WorldTransform);\n\n                Quaternion bTarget;\n                Quaternion.Concatenate(ref settings.servo.goal, ref worldBasis, out bTarget);\n                Quaternion bTargetConjugate;\n                Quaternion.Conjugate(ref bTarget, out bTargetConjugate);\n\n                Quaternion error;\n                Quaternion.Concatenate(ref bTargetConjugate, ref connectionB.orientation, out error);\n                \n\n                float errorReduction;\n                settings.servo.springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out usedSoftness);\n\n                //Turn this into an axis-angle representation.\n                Toolbox.GetAxisAngleFromQuaternion(ref error, out axis, out angle);\n\n                //Scale the axis by the desired velocity if the angle is sufficiently large (epsilon).\n                if (angle > Toolbox.BigEpsilon)\n                {\n                    float velocity = -(MathHelper.Min(settings.servo.baseCorrectiveSpeed, angle / dt) + angle * errorReduction);\n\n                    biasVelocity.X = axis.X * velocity;\n                    biasVelocity.Y = axis.Y * velocity;\n                    biasVelocity.Z = axis.Z * velocity;\n\n\n                    //Ensure that the corrective velocity doesn't exceed the max.\n                    float length = biasVelocity.LengthSquared();\n                    if (length > settings.servo.maxCorrectiveVelocitySquared)\n                    {\n                        float multiplier = settings.servo.maxCorrectiveVelocity / (float) Math.Sqrt(length);\n                        biasVelocity.X *= multiplier;\n                        biasVelocity.Y *= multiplier;\n                        biasVelocity.Z *= multiplier;\n                    }\n                }\n                else\n                {\n                    biasVelocity.X = 0;\n                    biasVelocity.Y = 0;\n                    biasVelocity.Z = 0;\n                }\n            }\n            else\n            {\n                usedSoftness = settings.velocityMotor.softness / dt;\n                angle = 0; //Zero out the error;\n                Matrix3x3 transform = basis.WorldTransform;\n                Matrix3x3.Transform(ref settings.velocityMotor.goalVelocity, ref transform, out biasVelocity);\n            }\n\n            //Compute effective mass\n            Matrix3x3.Add(ref connectionA.inertiaTensorInverse, ref connectionB.inertiaTensorInverse, out effectiveMassMatrix);\n            effectiveMassMatrix.M11 += usedSoftness;\n            effectiveMassMatrix.M22 += usedSoftness;\n            effectiveMassMatrix.M33 += usedSoftness;\n            Matrix3x3.Invert(ref effectiveMassMatrix, out effectiveMassMatrix);\n\n            //Update the maximum force\n            ComputeMaxForces(settings.maximumForce, dt);\n\n\n           \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Apply accumulated impulse\n            if (connectionA.isDynamic)\n            {\n                connectionA.ApplyAngularImpulse(ref accumulatedImpulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3 torqueB;\n                Vector3.Negate(ref accumulatedImpulse, out torqueB);\n                connectionB.ApplyAngularImpulse(ref torqueB);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Motors/LinearAxisMotor.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Motors\n{\n    /// <summary>\n    /// Constrains anchors on two entities to move relative to each other on a line.\n    /// </summary>\n    public class LinearAxisMotor : Motor, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private readonly MotorSettings1D settings;\n\n        private float accumulatedImpulse;\n        private float biasVelocity;\n        private Vector3 jAngularA, jAngularB;\n        private Vector3 jLinearA, jLinearB;\n        private Vector3 localAnchorA;\n        private Vector3 localAnchorB;\n        private float massMatrix;\n        private float error;\n        private Vector3 localAxis;\n        private Vector3 worldAxis;\n        private Vector3 rA; //Jacobian entry for entity A.\n        private Vector3 worldAnchorA;\n        private Vector3 worldAnchorB;\n        private Vector3 worldOffsetA, worldOffsetB;\n\n        /// <summary>\n        /// Constrains anchors on two entities to move relative to each other on a line.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the AnchorA, AnchorB and the Axis (or their entity-local versions).\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public LinearAxisMotor()\n        {\n            settings = new MotorSettings1D(this);\n            IsActive = false;\n        }\n\n\n        /// <summary>\n        /// Constrains anchors on two entities to move relative to each other on a line.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        /// <param name=\"anchorA\">World space point to attach to connection A that will be constrained.</param>\n        /// <param name=\"anchorB\">World space point to attach to connection B that will be constrained.</param>\n        /// <param name=\"axis\">Limited axis in world space to attach to connection A.</param>\n        public LinearAxisMotor(Entity connectionA, Entity connectionB, Vector3 anchorA, Vector3 anchorB, Vector3 axis)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n            AnchorA = anchorA;\n            AnchorB = anchorB;\n            Axis = axis;\n\n            settings = new MotorSettings1D(this);\n        }\n\n        /// <summary>\n        /// Gets or sets the anchor point attached to entity A in world space.\n        /// </summary>\n        public Vector3 AnchorA\n        {\n            get { return worldAnchorA; }\n            set\n            {\n                worldAnchorA = value;\n                worldOffsetA = worldAnchorA - connectionA.position;\n                Matrix3x3.TransformTranspose(ref worldOffsetA, ref connectionA.orientationMatrix, out localAnchorA);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the anchor point attached to entity A in world space.\n        /// </summary>\n        public Vector3 AnchorB\n        {\n            get { return worldAnchorB; }\n            set\n            {\n                worldAnchorB = value;\n                worldOffsetB = worldAnchorB - connectionB.position;\n                Matrix3x3.TransformTranspose(ref worldOffsetB, ref connectionB.orientationMatrix, out localAnchorB);\n            }\n        }\n\n\n        /// <summary>\n        /// Gets or sets the motorized axis in world space.\n        /// </summary>\n        public Vector3 Axis\n        {\n            get { return worldAxis; }\n            set\n            {\n                worldAxis = Vector3.Normalize(value);\n                Matrix3x3.TransformTranspose(ref worldAxis, ref connectionA.orientationMatrix, out localAxis);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the limited axis in the local space of connection A.\n        /// </summary>\n        public Vector3 LocalAxis\n        {\n            get { return localAxis; }\n            set\n            {\n                localAxis = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localAxis, ref connectionA.orientationMatrix, out worldAxis);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the first entity's center of mass to the anchor point in its local space.\n        /// </summary>\n        public Vector3 LocalOffsetA\n        {\n            get { return localAnchorA; }\n            set\n            {\n                localAnchorA = value;\n                Matrix3x3.Transform(ref localAnchorA, ref connectionA.orientationMatrix, out worldOffsetA);\n                worldAnchorA = connectionA.position + worldOffsetA;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the second entity's center of mass to the anchor point in its local space.\n        /// </summary>\n        public Vector3 LocalOffsetB\n        {\n            get { return localAnchorB; }\n            set\n            {\n                localAnchorB = value;\n                Matrix3x3.Transform(ref localAnchorB, ref connectionB.orientationMatrix, out worldOffsetB);\n                worldAnchorB = connectionB.position + worldOffsetB;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the first entity's center of mass to the anchor point in world space.\n        /// </summary>\n        public Vector3 OffsetA\n        {\n            get { return worldOffsetA; }\n            set\n            {\n                worldOffsetA = value; \n                worldAnchorA = connectionA.position + worldOffsetA;\n                Matrix3x3.TransformTranspose(ref worldOffsetA, ref connectionA.orientationMatrix, out localAnchorA); //Looks weird, but localAnchorA is \"localOffsetA.\"\n                \n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the offset from the second entity's center of mass to the anchor point in world space.\n        /// </summary>\n        public Vector3 OffsetB\n        {\n            get { return worldOffsetB; }\n            set\n            {\n                worldOffsetB = value;\n                worldAnchorB = connectionB.position + worldOffsetB;\n                Matrix3x3.TransformTranspose(ref worldOffsetB, ref connectionB.orientationMatrix, out localAnchorB);//Looks weird, but localAnchorB is \"localOffsetB.\"\n            }\n        }\n\n        /// <summary>\n        /// Gets the motor's velocity and servo settings.\n        /// </summary>\n        public MotorSettings1D Settings\n        {\n            get { return settings; }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float lambda, dot;\n                Vector3.Dot(ref jLinearA, ref connectionA.linearVelocity, out lambda);\n                Vector3.Dot(ref jAngularA, ref connectionA.angularVelocity, out dot);\n                lambda += dot;\n                Vector3.Dot(ref jLinearB, ref connectionB.linearVelocity, out dot);\n                lambda += dot;\n                Vector3.Dot(ref jAngularB, ref connectionB.angularVelocity, out dot);\n                lambda += dot;\n                return lambda;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// If the motor is in velocity only mode, the error will be zero.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        //Jacobians\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jLinearA;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jLinearB;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jAngularA;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jAngularB;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = massMatrix;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n            //Compute the current relative velocity.\n            float lambda, dot;\n            Vector3.Dot(ref jLinearA, ref connectionA.linearVelocity, out lambda);\n            Vector3.Dot(ref jAngularA, ref connectionA.angularVelocity, out dot);\n            lambda += dot;\n            Vector3.Dot(ref jLinearB, ref connectionB.linearVelocity, out dot);\n            lambda += dot;\n            Vector3.Dot(ref jAngularB, ref connectionB.angularVelocity, out dot);\n            lambda += dot;\n\n            //Add in the constraint space bias velocity\n            lambda = -lambda + biasVelocity - usedSoftness * accumulatedImpulse;\n\n            //Transform to an impulse\n            lambda *= massMatrix;\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse + lambda, -maxForceDt, maxForceDt);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearA, lambda, out impulse);\n                connectionA.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularA, lambda, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearB, lambda, out impulse);\n                connectionB.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularB, lambda, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return (Math.Abs(lambda));\n        }\n\n        public override void Update(float dt)\n        {\n            //Compute the 'pre'-jacobians\n            Matrix3x3.Transform(ref localAnchorA, ref connectionA.orientationMatrix, out worldOffsetA);\n            Matrix3x3.Transform(ref localAnchorB, ref connectionB.orientationMatrix, out worldOffsetB);\n            Vector3.Add(ref worldOffsetA, ref connectionA.position, out worldAnchorA);\n            Vector3.Add(ref worldOffsetB, ref connectionB.position, out worldAnchorB);\n            Vector3.Subtract(ref worldAnchorB, ref connectionA.position, out rA);\n            Matrix3x3.Transform(ref localAxis, ref connectionA.orientationMatrix, out worldAxis);\n\n            if (settings.mode == MotorMode.Servomechanism)\n            {\n                //Compute error\n#if !WINDOWS\n            Vector3 separation = new Vector3();\n#else\n                Vector3 separation;\n#endif\n                separation.X = worldAnchorB.X - worldAnchorA.X;\n                separation.Y = worldAnchorB.Y - worldAnchorA.Y;\n                separation.Z = worldAnchorB.Z - worldAnchorA.Z;\n\n                Vector3.Dot(ref separation, ref worldAxis, out error);\n\n                //Compute error\n                error = error - settings.servo.goal;\n\n\n                //Compute bias\n                float absErrorOverDt = Math.Abs(error / dt);\n                float errorReduction;\n                settings.servo.springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out usedSoftness);\n                biasVelocity = Math.Sign(error) * MathHelper.Min(settings.servo.baseCorrectiveSpeed, absErrorOverDt) + error * errorReduction;\n                biasVelocity = MathHelper.Clamp(biasVelocity, -settings.servo.maxCorrectiveVelocity, settings.servo.maxCorrectiveVelocity);\n            }\n            else\n            {\n                biasVelocity = -settings.velocityMotor.goalVelocity;\n                usedSoftness = settings.velocityMotor.softness / dt;\n                error = 0;\n            }\n\n            //Compute jacobians\n            jLinearA = worldAxis;\n            jLinearB.X = -jLinearA.X;\n            jLinearB.Y = -jLinearA.Y;\n            jLinearB.Z = -jLinearA.Z;\n            Vector3.Cross(ref rA, ref jLinearA, out jAngularA);\n            Vector3.Cross(ref worldOffsetB, ref jLinearB, out jAngularB);\n\n            //compute mass matrix\n            float entryA, entryB;\n            Vector3 intermediate;\n            if (connectionA.isDynamic)\n            {\n                Matrix3x3.Transform(ref jAngularA, ref connectionA.inertiaTensorInverse, out intermediate);\n                Vector3.Dot(ref intermediate, ref jAngularA, out entryA);\n                entryA += connectionA.inverseMass;\n            }\n            else\n                entryA = 0;\n            if (connectionB.isDynamic)\n            {\n                Matrix3x3.Transform(ref jAngularB, ref connectionB.inertiaTensorInverse, out intermediate);\n                Vector3.Dot(ref intermediate, ref jAngularB, out entryB);\n                entryB += connectionB.inverseMass;\n            }\n            else\n                entryB = 0;\n            massMatrix = 1 / (entryA + entryB + usedSoftness);\n\n            //Update the maximum force\n            ComputeMaxForces(settings.maximumForce, dt);\n\n\n            \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //Warm starting\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearA, accumulatedImpulse, out impulse);\n                connectionA.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularA, accumulatedImpulse, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jLinearB, accumulatedImpulse, out impulse);\n                connectionB.ApplyLinearImpulse(ref impulse);\n                Vector3.Multiply(ref jAngularB, accumulatedImpulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Motors/Motor.cs",
    "content": "﻿namespace BEPUphysics.Constraints.TwoEntity.Motors\n{\n    /// <summary>\n    /// Superclass of constraints which do work and change the velocity of connected entities, but have no specific position target.\n    /// </summary>\n    public abstract class Motor : TwoEntityConstraint\n    {\n        protected float maxForceDt = float.MaxValue;\n        protected float maxForceDtSquared = float.MaxValue;\n\n        /// <summary>\n        /// Softness divided by the timestep to maintain timestep independence.\n        /// </summary>\n        internal float usedSoftness;\n\n        /// <summary>\n        /// Computes the maxForceDt and maxForceDtSquared fields.\n        /// </summary>\n        protected void ComputeMaxForces(float maxForce, float dt)\n        {\n            //Determine maximum force\n            if (maxForce < float.MaxValue)\n            {\n                maxForceDt = maxForce * dt;\n                maxForceDtSquared = maxForceDt * maxForceDt;\n            }\n            else\n            {\n                maxForceDt = float.MaxValue;\n                maxForceDtSquared = float.MaxValue;\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Motors/MotorSettings.cs",
    "content": "﻿using System;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Motors\n{\n    /// <summary>\n    /// Defines the behavior style of a motor.\n    /// </summary>\n    public enum MotorMode\n    {\n        /// <summary>\n        /// Velocity motors only work to try to reach some relative velocity.\n        /// They have no position goal.\n        /// \n        /// When this type is selected, the motor settings' velocityMotor data will be used.\n        /// </summary>\n        VelocityMotor,\n        /// <summary>\n        /// Servomechanisms change their velocity in order to reach some position goal.\n        /// \n        /// When this type is selected, the motor settings' servo data will be used.\n        /// </summary>\n        Servomechanism\n    }\n\n    /// <summary>\n    /// Contains genereal settings for motors.\n    /// </summary>\n    public abstract class MotorSettings\n    {\n        internal EntitySolverUpdateable motor;\n\n        internal float maximumForce = float.MaxValue;\n        internal MotorMode mode = MotorMode.VelocityMotor;\n\n        internal MotorSettings(EntitySolverUpdateable motor)\n        {\n            this.motor = motor;\n        }\n\n        /// <summary>\n        /// Gets and sets the maximum impulse that the constraint will attempt to apply when satisfying its requirements.\n        /// This field can be used to simulate friction in a constraint.\n        /// </summary>\n        public float MaximumForce\n        {\n            get\n            {\n                if (maximumForce > 0)\n                {\n                    return maximumForce;\n                }\n                return 0;\n            }\n            set\n            {\n                value = value >= 0 ? value : 0;\n                if (value != maximumForce)\n                {\n                    maximumForce = value;\n                    WakeUpEntities();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets what kind of motor this is.\n        /// \n        /// If velocityMotor is chosen, the motor will try to achieve some velocity using the VelocityMotorSettings.\n        /// If servomechanism is chosen, the motor will try to reach some position using the ServoSettings.\n        /// </summary>\n        public MotorMode Mode\n        {\n            get { return mode; }\n            set\n            {\n                if (mode != value)\n                {\n                    mode = value;\n                    WakeUpEntities();\n                }\n            }\n        }\n\n        internal void WakeUpEntities()\n        {\n            for (int i = 0; i < motor.involvedEntities.Count; i++)\n            {\n                if (motor.involvedEntities[i].isDynamic)\n                {\n                    //Only need to wake up one dynamic entity.  That will wake up the rest.\n                    //Wouldn't want to pointlessly force-wake a kinematic object.\n                    motor.involvedEntities[i].activityInformation.Activate();\n                    break;\n                }\n            }\n        }\n    }\n\n    /// <summary>\n    /// Contains settings for motors which act on one degree of freedom.\n    /// </summary>\n    public class MotorSettings1D : MotorSettings\n    {\n        internal ServoSettings1D servo;\n        internal VelocityMotorSettings1D velocityMotor;\n\n        internal MotorSettings1D(Motor motor)\n            : base(motor)\n        {\n            servo = new ServoSettings1D(this);\n            velocityMotor = new VelocityMotorSettings1D(this);\n        }\n\n        /// <summary>\n        /// Gets the settings that govern the behavior of this motor if it is a servomechanism.\n        /// </summary>\n        public ServoSettings1D Servo\n        {\n            get { return servo; }\n        }\n\n        /// <summary>\n        /// Gets the settings that govern the behavior of this motor if it is a velocity motor.\n        /// </summary>\n        public VelocityMotorSettings1D VelocityMotor\n        {\n            get { return velocityMotor; }\n        }\n    }\n\n    /// <summary>\n    /// Contains settings for motors which act on three degrees of freedom.\n    /// </summary>\n    public class MotorSettings3D : MotorSettings\n    {\n        internal ServoSettings3D servo;\n        internal VelocityMotorSettings3D velocityMotor;\n\n        internal MotorSettings3D(EntitySolverUpdateable motor)\n            : base(motor)\n        {\n            servo = new ServoSettings3D(this);\n            velocityMotor = new VelocityMotorSettings3D(this);\n        }\n\n        /// <summary>\n        /// Gets the settings that govern the behavior of this motor if it is a servomechanism.\n        /// </summary>\n        public ServoSettings3D Servo\n        {\n            get { return servo; }\n        }\n\n        /// <summary>\n        /// Gets the settings that govern the behavior of this motor if it is a velocity motor.\n        /// </summary>\n        public VelocityMotorSettings3D VelocityMotor\n        {\n            get { return velocityMotor; }\n        }\n    }\n\n    /// <summary>\n    /// Contains settings for motors which act on two entities' relative orientation.\n    /// </summary>\n    public class MotorSettingsOrientation : MotorSettings\n    {\n        internal ServoSettingsOrientation servo;\n        internal VelocityMotorSettings3D velocityMotor;\n\n        internal MotorSettingsOrientation(EntitySolverUpdateable motor)\n            : base(motor)\n        {\n            servo = new ServoSettingsOrientation(this);\n            velocityMotor = new VelocityMotorSettings3D(this);\n        }\n\n        /// <summary>\n        /// Gets the settings that govern the behavior of this motor if it is a servomechanism.\n        /// </summary>\n        public ServoSettingsOrientation Servo\n        {\n            get { return servo; }\n        }\n\n        /// <summary>\n        /// Gets the settings that govern the behavior of this motor if it is a velocity motor.\n        /// </summary>\n        public VelocityMotorSettings3D VelocityMotor\n        {\n            get { return velocityMotor; }\n        }\n    }\n\n    /// <summary>\n    /// Defines the behavior of a servo.\n    /// Used when the MotorSettings' motorType is set to servomechanism.\n    /// </summary>\n    public class ServoSettings : ISpringSettings\n    {\n        internal MotorSettings motorSettings;\n\n        /// <summary>\n        /// Speed at which the servo will try to achieve its goal.\n        /// </summary>\n        internal float baseCorrectiveSpeed;\n\n        /// <summary>\n        /// Maximum extra velocity that the constraint will apply in an effort to correct constraint error.\n        /// </summary>\n        internal float maxCorrectiveVelocity = float.MaxValue;\n\n        /// <summary>\n        /// Squared maximum extra velocity that the constraint will apply in an effort to correct constraint error.\n        /// </summary>\n        internal float maxCorrectiveVelocitySquared = float.MaxValue;\n\n        /// <summary>\n        /// Spring settings define how a constraint responds to velocity and position error.\n        /// </summary>\n        internal SpringSettings springSettings = new SpringSettings();\n\n        internal ServoSettings(MotorSettings motorSettings)\n        {\n            this.motorSettings = motorSettings;\n        }\n\n        /// <summary>\n        /// Gets and sets the speed at which the servo will try to achieve its goal.\n        /// This is inactive if the constraint is not in servo mode.\n        /// </summary>\n        public float BaseCorrectiveSpeed\n        {\n            get { return baseCorrectiveSpeed; }\n            set\n            {\n                value = value < 0 ? 0 : value;\n                if (value != baseCorrectiveSpeed)\n                {\n                    baseCorrectiveSpeed = value;\n                    motorSettings.WakeUpEntities();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum extra velocity that the constraint will apply in an effort to correct any constraint error.\n        /// </summary>\n        public float MaxCorrectiveVelocity\n        {\n            get { return maxCorrectiveVelocity; }\n            set\n            {\n                value = Math.Max(0, value);\n                if (maxCorrectiveVelocity != value)\n                {\n                    maxCorrectiveVelocity = value;\n                    if (maxCorrectiveVelocity >= float.MaxValue)\n                    {\n                        maxCorrectiveVelocitySquared = float.MaxValue;\n                    }\n                    else\n                    {\n                        maxCorrectiveVelocitySquared = maxCorrectiveVelocity * maxCorrectiveVelocity;\n                    }\n                    motorSettings.WakeUpEntities();\n                }\n\n\n            }\n        }\n\n        #region ISpringSettings Members\n\n        /// <summary>\n        /// Gets the spring settings used by the constraint.\n        /// Spring settings define how a constraint responds to velocity and position error.\n        /// </summary>\n        public SpringSettings SpringSettings\n        {\n            get { return springSettings; }\n        }\n\n        #endregion\n    }\n\n    /// <summary>\n    /// Defines the behavior of a servo that works on one degree of freedom.\n    /// Used when the MotorSettings' motorType is set to servomechanism.\n    /// </summary>\n    public class ServoSettings1D : ServoSettings\n    {\n        internal float goal;\n\n        internal ServoSettings1D(MotorSettings motorSettings)\n            : base(motorSettings)\n        {\n        }\n\n        /// <summary>\n        /// Gets or sets the goal position of the servo.\n        /// </summary>\n        public float Goal\n        {\n            get { return goal; }\n            set\n            {\n                if (goal != value)\n                {\n                    goal = value;\n                    motorSettings.WakeUpEntities();\n                }\n            }\n        }\n\n\n    }\n\n    /// <summary>\n    /// Defines the behavior of a servo that works on three degrees of freedom.\n    /// Used when the MotorSettings' motorType is set to servomechanism.\n    /// </summary>\n    public class ServoSettings3D : ServoSettings\n    {\n        internal Vector3 goal;\n\n        internal ServoSettings3D(MotorSettings motorSettings)\n            : base(motorSettings)\n        {\n        }\n\n        /// <summary>\n        /// Gets or sets the goal position of the servo.\n        /// </summary>\n        public Vector3 Goal\n        {\n            get { return goal; }\n            set\n            {\n                if (goal != value)\n                {\n                    goal = value;\n                    motorSettings.WakeUpEntities();\n                }\n            }\n        }\n    }\n\n    /// <summary>\n    /// Defines the behavior of a servo that works on the relative orientation of two entities.\n    /// Used when the MotorSettings' motorType is set to servomechanism.\n    /// </summary>\n    public class ServoSettingsOrientation : ServoSettings\n    {\n        internal Quaternion goal;\n\n        internal ServoSettingsOrientation(MotorSettings motorSettings)\n            : base(motorSettings)\n        {\n        }\n\n        /// <summary>\n        /// Gets or sets the goal orientation of the servo.\n        /// </summary>\n        public Quaternion Goal\n        {\n            get { return goal; }\n            set\n            {\n                if (goal != value)\n                {\n                    goal = value;\n                    motorSettings.WakeUpEntities();\n                }\n            }\n        }\n    }\n\n    /// <summary>\n    /// Defines the behavior of a velocity motor.\n    /// Used when the MotorSettings' motorType is set to velocityMotor.\n    /// </summary>\n    public class VelocityMotorSettings\n    {\n        internal MotorSettings motorSettings;\n\n        /// <summary>\n        /// Softness of this constraint.\n        /// Higher values of softness allow the constraint to be violated more.\n        /// Must be greater than zero.\n        /// Sometimes, if a joint system is unstable, increasing the softness of the involved constraints will make it settle down.\n        /// </summary>\n        internal float softness = .0001f;\n\n        internal VelocityMotorSettings(MotorSettings motorSettings)\n        {\n            this.motorSettings = motorSettings;\n        }\n\n        /// <summary>\n        /// Gets and sets the softness of this constraint.\n        /// Higher values of softness allow the constraint to be violated more.\n        /// Must be greater than zero.\n        /// Sometimes, if a joint system is unstable, increasing the softness of the involved constraints will make it settle down.\n        /// For motors, softness can be used to implement damping.  For a damping constant k, the appropriate softness is 1/k.\n        /// </summary>\n        public float Softness\n        {\n            get { return softness; }\n            set\n            {\n                value = value < 0 ? 0 : value;\n                if (softness != value)\n                {\n                    softness = value;\n                    motorSettings.WakeUpEntities();\n                }\n            }\n        }\n    }\n\n    /// <summary>\n    /// Defines the behavior of a velocity motor that works on one degree of freedom.\n    /// Used when the MotorSettings' motorType is set to velocityMotor.\n    /// </summary>\n    public class VelocityMotorSettings1D : VelocityMotorSettings\n    {\n        internal float goalVelocity;\n\n        internal VelocityMotorSettings1D(MotorSettings motorSettings)\n            : base(motorSettings)\n        {\n        }\n\n        /// <summary>\n        /// Gets or sets the goal velocity of the motor.\n        /// </summary>\n        public float GoalVelocity\n        {\n            get { return goalVelocity; }\n            set\n            {\n                goalVelocity = value;\n                motorSettings.WakeUpEntities();\n            }\n        }\n    }\n\n    /// <summary>\n    /// Defines the behavior of a velocity motor that works on three degrees of freedom.\n    /// Used when the MotorSettings' motorType is set to velocityMotor.\n    /// </summary>\n    public class VelocityMotorSettings3D : VelocityMotorSettings\n    {\n        internal Vector3 goalVelocity;\n\n        internal VelocityMotorSettings3D(MotorSettings motorSettings)\n            : base(motorSettings)\n        {\n        }\n\n        /// <summary>\n        /// Gets or sets the goal position of the servo.\n        /// </summary>\n        public Vector3 GoalVelocity\n        {\n            get { return goalVelocity; }\n            set\n            {\n                goalVelocity = value;\n                motorSettings.WakeUpEntities();\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Motors/RevoluteMotor.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework.Input;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Motors\n{\n    /// <summary>\n    /// Tries to rotate two entities so that they reach a specified relative orientation or speed around an axis.\n    /// </summary>\n    public class RevoluteMotor : Motor, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private readonly JointBasis2D basis = new JointBasis2D();\n        private readonly MotorSettings1D settings;\n        private float accumulatedImpulse;\n        protected float biasVelocity;\n        private Vector3 jacobianA, jacobianB;\n        private float error;\n\n        private Vector3 localTestAxis;\n\n\n        private Vector3 worldTestAxis;\n        private float velocityToImpulse;\n\n        /// <summary>\n        /// Constructs a new constraint tries to rotate two entities so that they reach a specified relative orientation around an axis.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the Basis and TestAxis.\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public RevoluteMotor()\n        {\n            settings = new MotorSettings1D(this);\n            IsActive = false;\n        }\n\n        /// <summary>\n        /// Constructs a new constraint tries to rotate two entities so that they reach a specified relative orientation around an axis.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        /// <param name=\"motorizedAxis\">Rotation axis to control in world space.</param>\n        public RevoluteMotor(Entity connectionA, Entity connectionB, Vector3 motorizedAxis)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n            SetupJointTransforms(motorizedAxis);\n\n            settings = new MotorSettings1D(this);\n        }\n\n        /// <summary>\n        /// Gets the basis attached to entity A.\n        /// The primary axis represents the motorized axis of rotation.  The 'measurement plane' which the test axis is tested against is based on this primary axis.\n        /// The x axis defines the 'base' direction on the measurement plane corresponding to 0 degrees of relative rotation.\n        /// </summary>\n        public JointBasis2D Basis\n        {\n            get { return basis; }\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to entity B in its local space.\n        /// This axis is projected onto the x and y axes of transformA to determine the hinge angle.\n        /// </summary>\n        public Vector3 LocalTestAxis\n        {\n            get { return localTestAxis; }\n            set\n            {\n                localTestAxis = Vector3.Normalize(value);\n                Matrix3x3.Transform(ref localTestAxis, ref connectionB.orientationMatrix, out worldTestAxis);\n            }\n        }\n\n        /// <summary>\n        /// Gets the motor's velocity and servo settings.\n        /// </summary>\n        public MotorSettings1D Settings\n        {\n            get { return settings; }\n        }\n\n        /// <summary>\n        /// Gets or sets the axis attached to entity B in world space.\n        /// This axis is projected onto the x and y axes of the Basis attached to entity A to determine the hinge angle.\n        /// </summary>\n        public Vector3 TestAxis\n        {\n            get { return worldTestAxis; }\n            set\n            {\n                worldTestAxis = Vector3.Normalize(value);\n                Matrix3x3.TransformTranspose(ref worldTestAxis, ref connectionB.orientationMatrix, out localTestAxis);\n            }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float velocityA, velocityB;\n                Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n                Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n                return velocityA + velocityB;\n            }\n        }\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// If the motor is in velocity only mode, the error is zero.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jacobianA;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jacobianB;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = velocityToImpulse;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Sets up the joint transforms by automatically creating perpendicular vectors to complete the bases.\n        /// </summary>\n        /// <param name=\"motorizedAxis\">Axis around which the motor acts.</param>\n        public void SetupJointTransforms(Vector3 motorizedAxis)\n        {\n            //Compute a vector which is perpendicular to the axis.  It'll be added in local space to both connections.\n            Vector3 xAxis;\n            Vector3.Cross(ref motorizedAxis, ref Toolbox.UpVector, out xAxis);\n            float length = xAxis.LengthSquared();\n            if (length < Toolbox.Epsilon)\n            {\n                Vector3.Cross(ref motorizedAxis, ref Toolbox.RightVector, out xAxis);\n            }\n\n            //Put the axes into the joint transform of A.\n            basis.rotationMatrix = connectionA.orientationMatrix;\n            basis.SetWorldAxes(motorizedAxis, xAxis);\n\n\n            //Put the axes into the 'joint transform' of B too.\n            TestAxis = basis.xAxis;\n        }\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void Update(float dt)\n        {\n            //Transform the axes into world space.\n            basis.rotationMatrix = connectionA.orientationMatrix;\n            basis.ComputeWorldSpaceAxes();\n            Matrix3x3.Transform(ref localTestAxis, ref connectionB.orientationMatrix, out worldTestAxis);\n\n\n            if (settings.mode == MotorMode.Servomechanism)\n            {\n                float y, x;\n                Vector3 yAxis;\n                Vector3.Cross(ref basis.primaryAxis, ref basis.xAxis, out yAxis);\n                Vector3.Dot(ref worldTestAxis, ref yAxis, out y);\n                Vector3.Dot(ref worldTestAxis, ref basis.xAxis, out x);\n                var angle = (float)Math.Atan2(y, x);\n\n                //****** VELOCITY BIAS ******//\n                //Compute the correction velocity.\n                error = GetDistanceFromGoal(angle);\n\n\n                float absErrorOverDt = Math.Abs(error / dt);\n                float errorReduction;\n                settings.servo.springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out usedSoftness);\n                biasVelocity = Math.Sign(error) * MathHelper.Min(settings.servo.baseCorrectiveSpeed, absErrorOverDt) + error * errorReduction;\n\n                biasVelocity = MathHelper.Clamp(biasVelocity, -settings.servo.maxCorrectiveVelocity, settings.servo.maxCorrectiveVelocity);\n            }\n            else\n            {\n                biasVelocity = settings.velocityMotor.goalVelocity;\n                usedSoftness = settings.velocityMotor.softness / dt;\n                error = 0;\n            }\n\n\n            //Compute the jacobians\n            jacobianA = basis.primaryAxis;\n            jacobianB.X = -jacobianA.X;\n            jacobianB.Y = -jacobianA.Y;\n            jacobianB.Z = -jacobianA.Z;\n\n\n            //****** EFFECTIVE MASS MATRIX ******//\n            //Connection A's contribution to the mass matrix\n            float entryA;\n            Vector3 transformedAxis;\n            if (connectionA.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianA, ref connectionA.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianA, out entryA);\n            }\n            else\n                entryA = 0;\n\n            //Connection B's contribution to the mass matrix\n            float entryB;\n            if (connectionB.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianB, ref connectionB.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianB, out entryB);\n            }\n            else\n                entryB = 0;\n\n            //Compute the inverse mass matrix\n            velocityToImpulse = 1 / (usedSoftness + entryA + entryB);\n\n\n            //Update the maximum force\n            ComputeMaxForces(settings.maximumForce, dt);\n\n\n\n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //****** WARM STARTING ******//\n            //Apply accumulated impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, accumulatedImpulse, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, accumulatedImpulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public override float SolveIteration()\n        {\n            float velocityA, velocityB;\n            //Find the velocity contribution from each connection\n            Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n            Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n            //Add in the constraint space bias velocity\n            float lambda = -(velocityA + velocityB) - biasVelocity - usedSoftness * accumulatedImpulse;\n\n            //Transform to an impulse\n            lambda *= velocityToImpulse;\n\n            //Accumulate the impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse + lambda, -maxForceDt, maxForceDt);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, lambda, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, lambda, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return Math.Abs(lambda);\n        }\n\n\n\n        private float GetDistanceFromGoal(float angle)\n        {\n\n            float forwardDistance;\n            float goalAngle = MathHelper.WrapAngle(settings.servo.goal);\n            if (goalAngle > 0)\n            {\n                if (angle > goalAngle)\n                    forwardDistance = angle - goalAngle;\n                else if (angle > 0)\n                    forwardDistance = MathHelper.TwoPi - goalAngle + angle;\n                else //if (angle <= 0)\n                    forwardDistance = MathHelper.TwoPi - goalAngle + angle;\n            }\n            else\n            {\n                if (angle < goalAngle)\n                    forwardDistance = MathHelper.TwoPi - goalAngle + angle;\n                else //if (angle < 0)\n                    forwardDistance = angle - goalAngle;\n                //else //if (currentAngle >= 0)\n                //    return angle - myMinimumAngle;\n            }\n            return forwardDistance > MathHelper.Pi ? MathHelper.TwoPi - forwardDistance : -forwardDistance;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/Motors/TwistMotor.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Constraints.TwoEntity.Motors\n{\n    /// <summary>\n    /// Attempts to achieve some defined relative twist angle between the entities.\n    /// </summary>\n    public class TwistMotor : Motor, I1DImpulseConstraintWithError, I1DJacobianConstraint\n    {\n        private readonly JointBasis3D basisA = new JointBasis3D();\n        private readonly JointBasis2D basisB = new JointBasis2D();\n        private readonly MotorSettings1D settings;\n\n\n        private float accumulatedImpulse;\n\n        /// <summary>\n        /// Velocity needed to get closer to the goal.\n        /// </summary>\n        protected float biasVelocity;\n\n        private Vector3 jacobianA, jacobianB;\n        private float error;\n        private float velocityToImpulse;\n\n\n        /// <summary>\n        /// Constructs a new constraint which prevents the connected entities from twisting relative to each other.\n        /// To finish the initialization, specify the connections (ConnectionA and ConnectionB) \n        /// as well as the BasisA and BasisB.\n        /// This constructor sets the constraint's IsActive property to false by default.\n        /// </summary>\n        public TwistMotor()\n        {\n            IsActive = false;\n            settings = new MotorSettings1D(this);\n        }\n\n        /// <summary>\n        /// Constructs a new constraint which prevents the connected entities from twisting relative to each other.\n        /// </summary>\n        /// <param name=\"connectionA\">First connection of the pair.</param>\n        /// <param name=\"connectionB\">Second connection of the pair.</param>\n        /// <param name=\"axisA\">Twist axis attached to the first connected entity.</param>\n        /// <param name=\"axisB\">Twist axis attached to the second connected entity.</param>\n        public TwistMotor(Entity connectionA, Entity connectionB, Vector3 axisA, Vector3 axisB)\n        {\n            ConnectionA = connectionA;\n            ConnectionB = connectionB;\n            SetupJointTransforms(axisA, axisB);\n\n            settings = new MotorSettings1D(this);\n        }\n\n        /// <summary>\n        /// Gets the basis attached to entity A.\n        /// The primary axis represents the twist axis attached to entity A.\n        /// The x axis and y axis represent a plane against which entity B's attached x axis is projected to determine the twist angle.\n        /// </summary>\n        public JointBasis3D BasisA\n        {\n            get { return basisA; }\n        }\n\n\n        /// <summary>\n        /// Gets the basis attached to entity B.\n        /// The primary axis represents the twist axis attached to entity A.\n        /// The x axis is projected onto the plane defined by localTransformA's x and y axes\n        /// to get the twist angle.\n        /// </summary>\n        public JointBasis2D BasisB\n        {\n            get { return basisB; }\n        }\n\n        /// <summary>\n        /// Gets the motor's velocity and servo settings.\n        /// </summary>\n        public MotorSettings1D Settings\n        {\n            get { return settings; }\n        }\n\n        #region I1DImpulseConstraintWithError Members\n\n        /// <summary>\n        /// Gets the current relative velocity between the connected entities with respect to the constraint.\n        /// </summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float velocityA, velocityB;\n                Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n                Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n                return velocityA + velocityB;\n            }\n        }\n\n\n        /// <summary>\n        /// Gets the total impulse applied by this constraint.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the current constraint error.\n        /// If the motor is in velocity only mode, the error will be zero.\n        /// </summary>\n        public float Error\n        {\n            get { return error; }\n        }\n\n        #endregion\n\n        #region I1DJacobianConstraint Members\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the first connected entity.</param>\n        public void GetLinearJacobianA(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the linear jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Linear jacobian entry for the second connected entity.</param>\n        public void GetLinearJacobianB(out Vector3 jacobian)\n        {\n            jacobian = Toolbox.ZeroVector;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the first connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the first connected entity.</param>\n        public void GetAngularJacobianA(out Vector3 jacobian)\n        {\n            jacobian = jacobianA;\n        }\n\n        /// <summary>\n        /// Gets the angular jacobian entry for the second connected entity.\n        /// </summary>\n        /// <param name=\"jacobian\">Angular jacobian entry for the second connected entity.</param>\n        public void GetAngularJacobianB(out Vector3 jacobian)\n        {\n            jacobian = jacobianB;\n        }\n\n        /// <summary>\n        /// Gets the mass matrix of the constraint.\n        /// </summary>\n        /// <param name=\"outputMassMatrix\">Constraint's mass matrix.</param>\n        public void GetMassMatrix(out float outputMassMatrix)\n        {\n            outputMassMatrix = velocityToImpulse;\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Sets up the joint transforms by automatically creating perpendicular vectors to complete the bases.\n        /// </summary>\n        /// <param name=\"worldTwistAxisA\">Twist axis in world space to attach to entity A.</param>\n        /// <param name=\"worldTwistAxisB\">Twist axis in world space to attach to entity B.</param>\n        public void SetupJointTransforms(Vector3 worldTwistAxisA, Vector3 worldTwistAxisB)\n        {\n            worldTwistAxisA.Normalize();\n            worldTwistAxisB.Normalize();\n\n            Vector3 worldXAxis;\n            Vector3.Cross(ref worldTwistAxisA, ref Toolbox.UpVector, out worldXAxis);\n            float length = worldXAxis.LengthSquared();\n            if (length < Toolbox.Epsilon)\n            {\n                Vector3.Cross(ref worldTwistAxisA, ref Toolbox.RightVector, out worldXAxis);\n            }\n            worldXAxis.Normalize();\n\n            //Complete A's basis.\n            Vector3 worldYAxis;\n            Vector3.Cross(ref worldTwistAxisA, ref worldXAxis, out worldYAxis);\n\n            basisA.rotationMatrix = connectionA.orientationMatrix;\n            basisA.SetWorldAxes(worldTwistAxisA, worldXAxis, worldYAxis);\n\n            //Rotate the axis to B since it could be arbitrarily rotated.\n            Quaternion rotation;\n            Toolbox.GetQuaternionBetweenNormalizedVectors(ref worldTwistAxisA, ref worldTwistAxisB, out rotation);\n            Vector3.Transform(ref worldXAxis, ref rotation, out worldXAxis);\n\n            basisB.rotationMatrix = connectionB.orientationMatrix;\n            basisB.SetWorldAxes(worldTwistAxisB, worldXAxis);\n        }\n\n        /// <summary>\n        /// Solves for velocity.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            float velocityA, velocityB;\n            //Find the velocity contribution from each connection\n            Vector3.Dot(ref connectionA.angularVelocity, ref jacobianA, out velocityA);\n            Vector3.Dot(ref connectionB.angularVelocity, ref jacobianB, out velocityB);\n            //Add in the constraint space bias velocity\n            float lambda = -(velocityA + velocityB) + biasVelocity - usedSoftness * accumulatedImpulse;\n\n            //Transform to an impulse\n            lambda *= velocityToImpulse;\n\n            //Accumulate the impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse + lambda, -maxForceDt, maxForceDt);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, lambda, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, lambda, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n\n            return Math.Abs(lambda);\n        }\n\n        /// <summary>\n        /// Do any necessary computations to prepare the constraint for this frame.\n        /// </summary>\n        /// <param name=\"dt\">Simulation step length.</param>\n        public override void Update(float dt)\n        {\n            basisA.rotationMatrix = connectionA.orientationMatrix;\n            basisB.rotationMatrix = connectionB.orientationMatrix;\n            basisA.ComputeWorldSpaceAxes();\n            basisB.ComputeWorldSpaceAxes();\n\n            if (settings.mode == MotorMode.Servomechanism)\n            {\n                Quaternion rotation;\n                Toolbox.GetQuaternionBetweenNormalizedVectors(ref basisB.primaryAxis, ref basisA.primaryAxis, out rotation);\n\n                //Transform b's 'Y' axis so that it is perpendicular with a's 'X' axis for measurement.\n                Vector3 twistMeasureAxis;\n                Vector3.Transform(ref basisB.xAxis, ref rotation, out twistMeasureAxis);\n\n\n                //By dotting the measurement vector with a 2d plane's axes, we can get a local X and Y value.\n                float y, x;\n                Vector3.Dot(ref twistMeasureAxis, ref basisA.yAxis, out y);\n                Vector3.Dot(ref twistMeasureAxis, ref basisA.xAxis, out x);\n                var angle = (float) Math.Atan2(y, x);\n\n                //Compute goal velocity.\n                error = GetDistanceFromGoal(angle);\n                float absErrorOverDt = Math.Abs(error / dt);\n                float errorReduction;\n                settings.servo.springSettings.ComputeErrorReductionAndSoftness(dt, out errorReduction, out usedSoftness);\n                biasVelocity = Math.Sign(error) * MathHelper.Min(settings.servo.baseCorrectiveSpeed, absErrorOverDt) + error * errorReduction;\n\n                biasVelocity = MathHelper.Clamp(biasVelocity, -settings.servo.maxCorrectiveVelocity, settings.servo.maxCorrectiveVelocity);\n            }\n            else\n            {\n                biasVelocity = settings.velocityMotor.goalVelocity;\n                usedSoftness = settings.velocityMotor.softness / dt;\n                error = 0;\n            }\n\n\n            //The nice thing about this approach is that the jacobian entry doesn't flip.\n            //Instead, the error can be negative due to the use of Atan2.\n            //This is important for limits which have a unique high and low value.\n\n            //Compute the jacobian.\n            Vector3.Add(ref basisA.primaryAxis, ref basisB.primaryAxis, out jacobianB);\n            if (jacobianB.LengthSquared() < Toolbox.Epsilon)\n            {\n                //A nasty singularity can show up if the axes are aligned perfectly.\n                //In a 'real' situation, this is impossible, so just ignore it.\n                isActiveInSolver = false;\n                return;\n            }\n\n            jacobianB.Normalize();\n            jacobianA.X = -jacobianB.X;\n            jacobianA.Y = -jacobianB.Y;\n            jacobianA.Z = -jacobianB.Z;\n\n            //Update the maximum force\n            ComputeMaxForces(settings.maximumForce, dt);\n\n\n            //****** EFFECTIVE MASS MATRIX ******//\n            //Connection A's contribution to the mass matrix\n            float entryA;\n            Vector3 transformedAxis;\n            if (connectionA.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianA, ref connectionA.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianA, out entryA);\n            }\n            else\n                entryA = 0;\n\n            //Connection B's contribution to the mass matrix\n            float entryB;\n            if (connectionB.isDynamic)\n            {\n                Matrix3x3.Transform(ref jacobianB, ref connectionB.inertiaTensorInverse, out transformedAxis);\n                Vector3.Dot(ref transformedAxis, ref jacobianB, out entryB);\n            }\n            else\n                entryB = 0;\n\n            //Compute the inverse mass matrix\n            velocityToImpulse = 1 / (usedSoftness + entryA + entryB);\n\n            \n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            //****** WARM STARTING ******//\n            //Apply accumulated impulse\n            Vector3 impulse;\n            if (connectionA.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianA, accumulatedImpulse, out impulse);\n                connectionA.ApplyAngularImpulse(ref impulse);\n            }\n            if (connectionB.isDynamic)\n            {\n                Vector3.Multiply(ref jacobianB, accumulatedImpulse, out impulse);\n                connectionB.ApplyAngularImpulse(ref impulse);\n            }\n        }\n\n        private float GetDistanceFromGoal(float angle)\n        {\n            float forwardDistance;\n            float goalAngle = MathHelper.WrapAngle(settings.servo.goal);\n            if (goalAngle > 0)\n            {\n                if (angle > goalAngle)\n                    forwardDistance = angle - goalAngle;\n                else if (angle > 0)\n                    forwardDistance = MathHelper.TwoPi - goalAngle + angle;\n                else //if (angle <= 0)\n                    forwardDistance = MathHelper.TwoPi - goalAngle + angle;\n            }\n            else\n            {\n                if (angle < goalAngle)\n                    forwardDistance = MathHelper.TwoPi - goalAngle + angle;\n                else //if (angle < 0)\n                    forwardDistance = angle - goalAngle;\n                //else //if (currentAngle >= 0)\n                //    return angle - myMinimumAngle;\n            }\n            return forwardDistance > MathHelper.Pi ? MathHelper.TwoPi - forwardDistance : -forwardDistance;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Constraints/TwoEntity/TwoEntityConstraint.cs",
    "content": "using BEPUphysics.Entities;\nusing BEPUphysics.Entities.Prefabs;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.Constraints.TwoEntity\n{\n    /// <summary>\n    /// Abstract superclass of constraints involving two bodies.\n    /// </summary>\n    public abstract class TwoEntityConstraint : EntitySolverUpdateable\n    {\n        /// <summary>\n        /// Entity that constraints connect to when they are given a null connection.\n        /// </summary>\n        public static readonly Entity WorldEntity = new Sphere(Vector3.Zero, 0);\n\n        /// <summary>\n        /// First connection to the constraint.\n        /// </summary>\n        protected internal Entity connectionA;\n\n\n        /// <summary>\n        /// Second connection to the constraint.\n        /// </summary>\n        protected internal Entity connectionB;\n\n\n        /// <summary>\n        /// Gets or sets the first connection to the constraint.\n        /// </summary>\n        public Entity ConnectionA\n        {\n            get\n            {\n                //if (myConnectionA == nullSphere)\n                //    return null;\n                return connectionA;\n            }\n            set\n            {\n                connectionA = value ?? WorldEntity;\n                OnInvolvedEntitiesChanged();\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the second connection to the constraint.\n        /// </summary>\n        public Entity ConnectionB\n        {\n            get\n            {\n                //if (myConnectionB == nullSphere)\n                //    return null;\n                return connectionB;\n            }\n            set\n            {\n                connectionB = value ?? WorldEntity;\n                OnInvolvedEntitiesChanged();\n            }\n        }\n\n\n        /// <summary>\n        /// Adds entities associated with the solver item to the involved entities list.\n        /// Ensure that sortInvolvedEntities() is called at the end of the function.\n        /// This allows the non-batched multithreading system to lock properly.\n        /// </summary>\n        protected internal override void CollectInvolvedEntities(RawList<Entity> outputInvolvedEntities)\n        {\n            if (connectionA != null && connectionA != WorldEntity)\n                outputInvolvedEntities.Add(connectionA);\n\n            if (connectionB != null && connectionB != WorldEntity)\n                outputInvolvedEntities.Add(connectionB);\n        }\n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/DataStructures/BoundingBoxTree.cs",
    "content": "﻿using System.Collections.Generic;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.BroadPhaseSystems;\n\nnamespace BEPUphysics.DataStructures\n{\n    ///<summary>\n    /// Acceleration structure of objects surrounded by axis aligned bounding boxes, supporting various speedy queries.\n    ///</summary>\n    public class BoundingBoxTree<T> where T : IBoundingBoxOwner\n    {\n        /// <summary>\n        /// Gets the bounding box surrounding the tree.\n        /// </summary>\n        public BoundingBox BoundingBox\n        {\n            get\n            {\n                if (root != null)\n                    return root.BoundingBox;\n                else\n                    return new BoundingBox();\n            }\n        }\n\n        Node root;\n\n\n        /// <summary>\n        /// Constructs a new tree.\n        /// </summary>\n        /// <param name=\"elements\">Data to use to construct the tree.</param>\n        public BoundingBoxTree(IList<T> elements)\n        {\n            Reconstruct(elements);\n        }\n\n\n        /// <summary>\n        /// Reconstructs the tree based on the current data.\n        /// </summary>\n        public void Reconstruct(IList<T> elements)\n        {\n            root = null;\n            int count = elements.Count;\n            for (int i = 0; i < count; i++)\n            {\n                //Use a permuted version of the elements instead of the actual elements list.\n                //Permuting makes the input basically random, improving the quality of the tree.\n                Add(elements[(int)((982451653L * i) % count)]);\n            }\n        }\n\n        /// <summary>\n        /// Refits the tree based on the current data.\n        /// This process is cheaper to perform than a reconstruction when the topology of the mesh\n        /// does not change.\n        /// </summary>\n        public void Refit()\n        {\n            if (root != null)\n                root.Refit();\n        }\n\n        void Analyze(out List<int> depths, out int minDepth, out int maxDepth, out int nodeCount)\n        {\n            depths = new List<int>();\n            nodeCount = 0;\n            root.Analyze(depths, 0, ref nodeCount);\n\n            maxDepth = 0;\n            minDepth = int.MaxValue;\n            for (int i = 0; i < depths.Count; i++)\n            {\n                if (depths[i] > maxDepth)\n                    maxDepth = depths[i];\n                if (depths[i] < minDepth)\n                    minDepth = depths[i];\n            }\n        }\n\n        /// <summary>\n        /// Adds an element to the tree.\n        /// If a list of objects is available, using the Reconstruct method is recommended.\n        /// </summary>\n        /// <param name=\"element\">Element to add.</param>\n        public void Add(T element)\n        {\n            //Insertions can easily be performed stacklessly.\n            //Only one path is chosen at each step and nothing is returned, so the history of the 'recursion' is completely forgotten.\n\n            var node = new LeafNode(element);\n            if (root == null)\n            {\n                //Empty tree.  This is the first and only node.\n                root = node;\n            }\n            else\n            {\n                if (root.IsLeaf) //Root is alone.\n                    root.TryToInsert(node, out root);\n                else\n                {\n                    //The caller is responsible for the merge.\n                    BoundingBox.CreateMerged(ref node.BoundingBox, ref root.BoundingBox, out root.BoundingBox);\n                    Node treeNode = root;\n                    while (!treeNode.TryToInsert(node, out treeNode)) ;//TryToInsert returns the next node, if any, and updates node bounding box.\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the triangles whose bounding boxes are overlapped by the query.\n        /// </summary>\n        /// <param name=\"boundingBox\">Shape to query against the tree.</param>\n        /// <param name=\"outputOverlappedElements\">Indices of triangles in the index buffer with bounding boxes which are overlapped by the query.</param>\n        /// <returns>Whether or not any elements were overlapped.</returns>\n        public bool GetOverlaps(BoundingBox boundingBox, IList<T> outputOverlappedElements)\n        {\n            if (root != null)\n            {\n                bool intersects;\n                root.BoundingBox.Intersects(ref boundingBox, out intersects);\n                if (intersects)\n                    root.GetOverlaps(ref boundingBox, outputOverlappedElements);\n            }\n            return outputOverlappedElements.Count > 0;\n        }\n\n        /// <summary>\n        /// Gets the triangles whose bounding boxes are overlapped by the query.\n        /// </summary>\n        /// <param name=\"boundingSphere\">Shape to query against the tree.</param>\n        /// <param name=\"outputOverlappedElements\">Indices of triangles in the index buffer with bounding boxes which are overlapped by the query.</param>\n        /// <returns>Whether or not any elements were overlapped.</returns>\n        public bool GetOverlaps(BoundingSphere boundingSphere, IList<T> outputOverlappedElements)\n        {\n            if (root != null)\n            {\n                bool intersects;\n                root.BoundingBox.Intersects(ref boundingSphere, out intersects);\n                if (intersects)\n                    root.GetOverlaps(ref boundingSphere, outputOverlappedElements);\n            }\n            return outputOverlappedElements.Count > 0;\n        }\n        /// <summary>\n        /// Gets the triangles whose bounding boxes are overlapped by the query.\n        /// </summary>\n        /// <param name=\"boundingFrustum\">Shape to query against the tree.</param>\n        /// <param name=\"outputOverlappedElements\">Indices of triangles in the index buffer with bounding boxes which are overlapped by the query.</param>\n        /// <returns>Whether or not any elements were overlapped.</returns>\n        public bool GetOverlaps(BoundingFrustum boundingFrustum, IList<T> outputOverlappedElements)\n        {\n            if (root != null)\n            {\n                bool intersects;\n                boundingFrustum.Intersects(ref root.BoundingBox, out intersects);\n                if (intersects)\n                    root.GetOverlaps(ref boundingFrustum, outputOverlappedElements);\n            }\n            return outputOverlappedElements.Count > 0;\n        }\n        /// <summary>\n        /// Gets the triangles whose bounding boxes are overlapped by the query.\n        /// </summary>\n        /// <param name=\"ray\">Shape to query against the tree.</param>\n        /// <param name=\"outputOverlappedElements\">Indices of triangles in the index buffer with bounding boxes which are overlapped by the query.</param>\n        /// <returns>Whether or not any elements were overlapped.</returns>\n        public bool GetOverlaps(Ray ray, IList<T> outputOverlappedElements)\n        {\n            if (root != null)\n            {\n                float? result;\n                ray.Intersects(ref root.BoundingBox, out result);\n                if (result != null)\n                    root.GetOverlaps(ref ray, float.MaxValue, outputOverlappedElements);\n            }\n            return outputOverlappedElements.Count > 0;\n        }\n        /// <summary>\n        /// Gets the triangles whose bounding boxes are overlapped by the query.\n        /// </summary>\n        /// <param name=\"ray\">Shape to query against the tree.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray's length.</param>\n        /// <param name=\"outputOverlappedElements\">Indices of triangles in the index buffer with bounding boxes which are overlapped by the query.</param>\n        /// <returns>Whether or not any elements were overlapped.</returns>\n        public bool GetOverlaps(Ray ray, float maximumLength, IList<T> outputOverlappedElements)\n        {\n            if (root != null)\n            {\n                float? result;\n                ray.Intersects(ref root.BoundingBox, out result);\n                if (result != null)\n                    root.GetOverlaps(ref ray, maximumLength, outputOverlappedElements);\n            }\n            return outputOverlappedElements.Count > 0;\n        }\n\n        /// <summary>\n        /// Gets the pairs of elements in each tree with overlapping bounding boxes.\n        /// </summary>\n        /// <typeparam name=\"TElement\">Type of the elements in the opposing tree.</typeparam>\n        /// <param name=\"tree\">Other tree to test.</param>\n        /// <param name=\"outputOverlappedElements\">List of overlaps found by the query.</param>\n        /// <returns>Whether or not any overlaps were found.</returns>\n        public bool GetOverlaps<TElement>(BoundingBoxTree<TElement> tree, IList<TreeOverlapPair<T, TElement>> outputOverlappedElements)\n            where TElement : IBoundingBoxOwner\n        {\n            bool intersects;\n            root.BoundingBox.Intersects(ref tree.root.BoundingBox, out intersects);\n            if (intersects)\n            {\n                root.GetOverlaps<TElement>(tree.root, outputOverlappedElements);\n            }\n            return outputOverlappedElements.Count > 0;\n        }\n\n        internal abstract class Node\n        {\n            internal BoundingBox BoundingBox;\n            internal abstract void GetOverlaps(ref BoundingBox boundingBox, IList<T> outputOverlappedElements);\n            internal abstract void GetOverlaps(ref BoundingSphere boundingSphere, IList<T> outputOverlappedElements);\n            internal abstract void GetOverlaps(ref BoundingFrustum boundingFrustum, IList<T> outputOverlappedElements);\n            internal abstract void GetOverlaps(ref Ray ray, float maximumLength, IList<T> outputOverlappedElements);\n            internal abstract void GetOverlaps<TElement>(BoundingBoxTree<TElement>.Node opposingNode, IList<TreeOverlapPair<T, TElement>> outputOverlappedElements) where TElement : IBoundingBoxOwner;\n\n            internal abstract bool IsLeaf { get; }\n\n            internal abstract Node ChildA { get; }\n            internal abstract Node ChildB { get; }\n            internal abstract T Element { get; }\n\n            internal abstract bool TryToInsert(LeafNode node, out Node treeNode);\n\n\n\n            internal abstract void Analyze(List<int> depths, int depth, ref int nodeCount);\n\n            internal abstract void Refit();\n        }\n\n        internal sealed class InternalNode : Node\n        {\n            internal Node childA;\n            internal Node childB;\n\n            internal override Node ChildA\n            {\n                get\n                {\n                    return childA;\n                }\n            }\n            internal override Node ChildB\n            {\n                get\n                {\n                    return childB;\n                }\n            }\n            internal override T Element\n            {\n                get\n                {\n                    return default(T);\n                }\n            }\n\n            internal override bool IsLeaf\n            {\n                get { return false; }\n            }\n\n\n            internal override void GetOverlaps(ref BoundingBox boundingBox, IList<T> outputOverlappedElements)\n            {\n                //Users of the GetOverlaps method will have to check the bounding box before calling\n                //root.getoverlaps.  This is actually desired in some cases, since the outer bounding box is used\n                //to determine a pair, and further overlap tests shouldn't bother retesting the root.\n                bool intersects;\n                childA.BoundingBox.Intersects(ref boundingBox, out intersects);\n                if (intersects)\n                    childA.GetOverlaps(ref boundingBox, outputOverlappedElements);\n                childB.BoundingBox.Intersects(ref boundingBox, out intersects);\n                if (intersects)\n                    childB.GetOverlaps(ref boundingBox, outputOverlappedElements);\n            }\n\n            internal override void GetOverlaps(ref BoundingSphere boundingSphere, IList<T> outputOverlappedElements)\n            {\n                bool intersects;\n                childA.BoundingBox.Intersects(ref boundingSphere, out intersects);\n                if (intersects)\n                    childA.GetOverlaps(ref boundingSphere, outputOverlappedElements);\n                childB.BoundingBox.Intersects(ref boundingSphere, out intersects);\n                if (intersects)\n                    childB.GetOverlaps(ref boundingSphere, outputOverlappedElements);\n            }\n\n            internal override void GetOverlaps(ref BoundingFrustum boundingFrustum, IList<T> outputOverlappedElements)\n            {\n                bool intersects;\n                boundingFrustum.Intersects(ref childA.BoundingBox, out intersects);\n                if (intersects)\n                    childA.GetOverlaps(ref boundingFrustum, outputOverlappedElements);\n                boundingFrustum.Intersects(ref childB.BoundingBox, out intersects);\n                if (intersects)\n                    childB.GetOverlaps(ref boundingFrustum, outputOverlappedElements);\n            }\n\n            internal override void GetOverlaps(ref Ray ray, float maximumLength, IList<T> outputOverlappedElements)\n            {\n                float? result;\n                ray.Intersects(ref childA.BoundingBox, out result);\n                if (result != null && result < maximumLength)\n                    childA.GetOverlaps(ref ray, maximumLength, outputOverlappedElements);\n                ray.Intersects(ref childB.BoundingBox, out result);\n                if (result != null && result < maximumLength)\n                    childB.GetOverlaps(ref ray, maximumLength, outputOverlappedElements);\n            }\n\n            internal override void GetOverlaps<TElement>(BoundingBoxTree<TElement>.Node opposingNode, IList<TreeOverlapPair<T, TElement>> outputOverlappedElements)\n            {\n                bool intersects;\n\n                if (opposingNode.IsLeaf)\n                {\n                    //If it's a leaf, go deeper in our hierarchy, but not the opposition.\n                    childA.BoundingBox.Intersects(ref opposingNode.BoundingBox, out intersects);\n                    if (intersects)\n                        childA.GetOverlaps<TElement>(opposingNode, outputOverlappedElements);\n                    childB.BoundingBox.Intersects(ref opposingNode.BoundingBox, out intersects);\n                    if (intersects)\n                        childB.GetOverlaps<TElement>(opposingNode, outputOverlappedElements);\n                }\n                else\n                {\n                    var opposingChildA = opposingNode.ChildA;\n                    var opposingChildB = opposingNode.ChildB;\n                    //If it's not a leaf, try to go deeper in both hierarchies.\n                    childA.BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                    if (intersects)\n                        childA.GetOverlaps<TElement>(opposingChildA, outputOverlappedElements);\n                    childA.BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                    if (intersects)\n                        childA.GetOverlaps<TElement>(opposingChildB, outputOverlappedElements);\n                    childB.BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                    if (intersects)\n                        childB.GetOverlaps<TElement>(opposingChildA, outputOverlappedElements);\n                    childB.BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                    if (intersects)\n                        childB.GetOverlaps<TElement>(opposingChildB, outputOverlappedElements);\n\n\n                }\n\n\n\n\n\n            }\n\n\n            internal override bool TryToInsert(LeafNode node, out Node treeNode)\n            {\n                ////The following can make the tree shorter, but it actually hurt query times in testing.\n                //bool aIsLeaf = childA.IsLeaf;\n                //bool bIsLeaf = childB.IsLeaf;\n                //if (aIsLeaf && !bIsLeaf)\n                //{\n                //    //Just put us with the leaf.  Keeps the tree shallower.\n                //    BoundingBox merged;\n                //    BoundingBox.CreateMerged(ref childA.BoundingBox, ref node.BoundingBox, out merged);\n                //    childA = new InternalNode() { BoundingBox = merged, childA = this.childA, childB = node };\n                //    treeNode = null;\n                //    return true;\n                //}\n                //else if (!aIsLeaf && bIsLeaf)\n                //{\n                //    //Just put us with the leaf.  Keeps the tree shallower.\n                //    BoundingBox merged;\n                //    BoundingBox.CreateMerged(ref childB.BoundingBox, ref node.BoundingBox, out merged);\n                //    childB = new InternalNode() { BoundingBox = merged, childA = node, childB = this.childB };\n                //    treeNode = null;\n                //    return true;\n                //}\n\n\n                //Since we are an internal node, we know we have two children.\n                //Regardless of what kind of nodes they are, figure out which would be a better choice to merge the new node with.\n\n                //Use the path which produces the smallest 'volume.'\n                BoundingBox mergedA, mergedB;\n                BoundingBox.CreateMerged(ref childA.BoundingBox, ref node.BoundingBox, out mergedA);\n                BoundingBox.CreateMerged(ref childB.BoundingBox, ref node.BoundingBox, out mergedB);\n\n                Vector3 offset;\n                float originalAVolume, originalBVolume;\n                Vector3.Subtract(ref childA.BoundingBox.Max, ref childA.BoundingBox.Min, out offset);\n                originalAVolume = offset.X * offset.Y * offset.Z;\n                Vector3.Subtract(ref childB.BoundingBox.Max, ref childB.BoundingBox.Min, out offset);\n                originalBVolume = offset.X * offset.Y * offset.Z;\n\n                float mergedAVolume, mergedBVolume;\n                Vector3.Subtract(ref mergedA.Max, ref mergedA.Min, out offset);\n                mergedAVolume = offset.X * offset.Y * offset.Z;\n                Vector3.Subtract(ref mergedB.Max, ref mergedB.Min, out offset);\n                mergedBVolume = offset.X * offset.Y * offset.Z;\n\n                //Could use factor increase or absolute difference\n                if (mergedAVolume - originalAVolume < mergedBVolume - originalBVolume)\n                {\n                    //merging A produces a better result.\n                    if (childA.IsLeaf)\n                    {\n                        childA = new InternalNode() { BoundingBox = mergedA, childA = this.childA, childB = node };\n                        treeNode = null;\n                        return true;\n                    }\n                    else\n                    {\n                        childA.BoundingBox = mergedA;\n                        treeNode = childA;\n                        return false;\n                    }\n                }\n                else\n                {\n                    //merging B produces a better result.\n                    if (childB.IsLeaf)\n                    {\n                        //Target is a leaf! Return.\n                        childB = new InternalNode() { BoundingBox = mergedB, childA = node, childB = this.childB };\n                        treeNode = null;\n                        return true;\n                    }\n                    else\n                    {\n                        childB.BoundingBox = mergedB;\n                        treeNode = childB;\n                        return false;\n                    }\n                }\n\n\n\n            }\n\n            public override string ToString()\n            {\n                return \"{\" + childA + \", \" + childB + \"}\";\n\n            }\n\n            internal override void Analyze(List<int> depths, int depth, ref int nodeCount)\n            {\n                nodeCount++;\n                childA.Analyze(depths, depth + 1, ref nodeCount);\n                childB.Analyze(depths, depth + 1, ref nodeCount);\n            }\n\n            internal override void Refit()\n            {\n                childA.Refit();\n                childB.Refit();\n                BoundingBox.CreateMerged(ref childA.BoundingBox, ref childB.BoundingBox, out BoundingBox);\n            }\n        }\n\n        /// <summary>\n        /// The tiny extra margin added to leaf bounding boxes that allow the volume cost metric to function properly even in degenerate cases.\n        /// </summary>\n        public static float LeafMargin = .001f;\n        internal sealed class LeafNode : Node\n        {\n            T element;\n            internal override Node ChildA\n            {\n                get\n                {\n                    return null;\n                }\n            }\n            internal override Node ChildB\n            {\n                get\n                {\n                    return null;\n                }\n            }\n\n            internal override T Element\n            {\n                get\n                {\n                    return element;\n                }\n            }\n\n            internal override bool IsLeaf\n            {\n                get { return true; }\n            }\n\n            internal LeafNode(T element)\n            {\n                this.element = element;\n                BoundingBox = element.BoundingBox;\n                //Having an ever-so-slight margin allows the hierarchy use a volume metric even for degenerate shapes (consider a flat tessellated plane).\n                BoundingBox.Max.X += LeafMargin;\n                BoundingBox.Max.Y += LeafMargin;\n                BoundingBox.Max.Z += LeafMargin;\n                BoundingBox.Min.X -= LeafMargin;\n                BoundingBox.Min.Y -= LeafMargin;\n                BoundingBox.Min.Z -= LeafMargin;\n            }\n\n            internal override void GetOverlaps(ref BoundingBox boundingBox, IList<T> outputOverlappedElements)\n            {\n                //Our parent already tested the bounding box.  All that's left is to add myself to the list.\n                outputOverlappedElements.Add(element);\n            }\n\n            internal override void GetOverlaps(ref BoundingSphere boundingSphere, IList<T> outputOverlappedElements)\n            {\n                outputOverlappedElements.Add(element);\n            }\n\n            internal override void GetOverlaps(ref BoundingFrustum boundingFrustum, IList<T> outputOverlappedElements)\n            {\n                outputOverlappedElements.Add(element);\n            }\n\n            internal override void GetOverlaps(ref Ray ray, float maximumLength, IList<T> outputOverlappedElements)\n            {\n                outputOverlappedElements.Add(element);\n            }\n\n            internal override void GetOverlaps<TElement>(BoundingBoxTree<TElement>.Node opposingNode, IList<TreeOverlapPair<T, TElement>> outputOverlappedElements)\n            {\n                bool intersects;\n\n                if (opposingNode.IsLeaf)\n                {\n                    //We're both leaves!  Our parents have already done the testing for us, so we know we're overlapping.\n                    outputOverlappedElements.Add(new TreeOverlapPair<T, TElement>(element, opposingNode.Element));\n                }\n                else\n                {\n                    var opposingChildA = opposingNode.ChildA;\n                    var opposingChildB = opposingNode.ChildB;\n                    //If it's not a leaf, try to go deeper in the opposing hierarchy.\n                    BoundingBox.Intersects(ref opposingChildA.BoundingBox, out intersects);\n                    if (intersects)\n                        GetOverlaps<TElement>(opposingChildA, outputOverlappedElements);\n                    BoundingBox.Intersects(ref opposingChildB.BoundingBox, out intersects);\n                    if (intersects)\n                        GetOverlaps<TElement>(opposingChildB, outputOverlappedElements);\n\n                }\n            }\n\n            internal override bool TryToInsert(LeafNode node, out Node treeNode)\n            {\n                var newTreeNode = new InternalNode();\n                BoundingBox.CreateMerged(ref BoundingBox, ref node.BoundingBox, out newTreeNode.BoundingBox);\n                newTreeNode.childA = this;\n                newTreeNode.childB = node;\n                treeNode = newTreeNode;\n                return true;\n            }\n\n            public override string ToString()\n            {\n                return element.ToString();\n            }\n\n            internal override void Analyze(List<int> depths, int depth, ref int nodeCount)\n            {\n                nodeCount++;\n                depths.Add(depth);\n            }\n\n            internal override void Refit()\n            {\n                BoundingBox = element.BoundingBox;\n                //Having an ever-so-slight margin allows the hierarchy use a volume metric even for degenerate shapes (consider a flat tessellated plane).\n                BoundingBox.Max.X += LeafMargin;\n                BoundingBox.Max.Y += LeafMargin;\n                BoundingBox.Max.Z += LeafMargin;\n                BoundingBox.Min.X -= LeafMargin;\n                BoundingBox.Min.Y -= LeafMargin;\n                BoundingBox.Min.Z -= LeafMargin;\n            }\n        }\n\n    }\n\n\n}\n"
  },
  {
    "path": "BEPUphysics/DataStructures/MeshBoundingBoxTree.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Globalization;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.DataStructures\n{    \n    ///<summary>\n    /// Acceleration structure of triangles surrounded by axis aligned bounding boxes, supporting various speedy queries.\n    ///</summary>\n    public class MeshBoundingBoxTree\n    {\n        MeshBoundingBoxTreeData data;\n\n\n        /// <summary>\n        /// Gets the bounding box surrounding the tree.\n        /// </summary>\n        public BoundingBox BoundingBox\n        {\n            get\n            {\n                if (root != null)\n                    return root.BoundingBox;\n                else \n                    return new BoundingBox();\n            }\n        }\n\n        Node root;\n\n        /// <summary>\n        /// Gets or sets the data used to construct the tree.\n        /// When set, the tree will be reconstructed.\n        /// </summary>\n        public MeshBoundingBoxTreeData Data\n        {\n            get\n            {\n                return data;\n            }\n            set\n            {\n                this.data = value;\n                Reconstruct();\n            }\n        }\n\n        /// <summary>\n        /// Constructs a new tree.\n        /// </summary>\n        /// <param name=\"data\">Data to use to construct the tree.</param>\n        public MeshBoundingBoxTree(MeshBoundingBoxTreeData data)\n        {\n            Data = data;\n        }\n\n\n        /// <summary>\n        /// Reconstructs the tree based on the current data.\n        /// </summary>\n        public void Reconstruct()\n        {\n            root = null;\n            for (int i = 0; i < data.IndexCount; i += 3)\n            {\n                //Use a permuted version of the triangles instead of the actual triangle list.\n                //Permuting makes the input basically random, improving the quality of the tree.\n                Insert((int)(((982451653L * (i / 3)) % (data.IndexCount / 3)) * 3));\n            }\n        }\n\n        /// <summary>\n        /// Refits the tree based on the current data.\n        /// This process is cheaper to perform than a reconstruction when the topology of the mesh\n        /// does not change.\n        /// </summary>\n        public void Refit()\n        {\n            if (root != null)\n                root.Refit(data);\n        }\n\n        void Analyze(out List<int> depths, out int minDepth, out int maxDepth, out int nodeCount)\n        {\n            depths = new List<int>();\n            nodeCount = 0;\n            root.Analyze(depths, 0, ref nodeCount);\n\n            maxDepth = 0;\n            minDepth = int.MaxValue;\n            for (int i = 0; i < depths.Count; i++)\n            {\n                if (depths[i] > maxDepth)\n                    maxDepth = depths[i];\n                if (depths[i] < minDepth)\n                    minDepth = depths[i];\n            }\n        }\n\n\n        void Insert(int triangleIndex)\n        {\n            //Insertions can easily be performed stacklessly.\n            //Only one path is chosen at each step and nothing is returned, so the history of the 'recursion' is completely forgotten.\n\n            var node = new LeafNode(triangleIndex, data);\n            if (root == null)\n            {\n                //Empty tree.  This is the first and only node.\n                root = node;\n            }\n            else\n            {\n                if (root.IsLeaf) //Root is alone.\n                    root.TryToInsert(node, out root);\n                else\n                {\n                    //The caller is responsible for the merge.\n                    BoundingBox.CreateMerged(ref node.BoundingBox, ref root.BoundingBox, out root.BoundingBox);\n                    Node treeNode = root;\n                    while (!treeNode.TryToInsert(node, out treeNode)) ;//TryToInsert returns the next node, if any, and updates node bounding box.\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets the triangles whose bounding boxes are overlapped by the query.\n        /// </summary>\n        /// <param name=\"boundingBox\">Shape to query against the tree.</param>\n        /// <param name=\"outputOverlappedElements\">Indices of triangles in the index buffer with bounding boxes which are overlapped by the query.</param>\n        /// <returns>Whether or not any elements were overlapped.</returns>\n        public bool GetOverlaps(BoundingBox boundingBox, IList<int> outputOverlappedElements)\n        {\n            if (root != null)\n            {\n                bool intersects;\n                root.BoundingBox.Intersects(ref boundingBox, out intersects);\n                if (intersects)\n                    root.GetOverlaps(ref boundingBox, outputOverlappedElements);\n            }\n            return outputOverlappedElements.Count > 0;\n        }\n\n        /// <summary>\n        /// Gets the triangles whose bounding boxes are overlapped by the query.\n        /// </summary>\n        /// <param name=\"boundingSphere\">Shape to query against the tree.</param>\n        /// <param name=\"outputOverlappedElements\">Indices of triangles in the index buffer with bounding boxes which are overlapped by the query.</param>\n        /// <returns>Whether or not any elements were overlapped.</returns>\n        public bool GetOverlaps(BoundingSphere boundingSphere, IList<int> outputOverlappedElements)\n        {\n            if (root != null)\n            {\n                bool intersects;\n                root.BoundingBox.Intersects(ref boundingSphere, out intersects);\n                if (intersects)\n                    root.GetOverlaps(ref boundingSphere, outputOverlappedElements);\n            }\n            return outputOverlappedElements.Count > 0;\n        }\n        /// <summary>\n        /// Gets the triangles whose bounding boxes are overlapped by the query.\n        /// </summary>\n        /// <param name=\"boundingFrustum\">Shape to query against the tree.</param>\n        /// <param name=\"outputOverlappedElements\">Indices of triangles in the index buffer with bounding boxes which are overlapped by the query.</param>\n        /// <returns>Whether or not any elements were overlapped.</returns>\n        public bool GetOverlaps(BoundingFrustum boundingFrustum, IList<int> outputOverlappedElements)\n        {\n            if (root != null)\n            {\n                bool intersects;\n                boundingFrustum.Intersects(ref root.BoundingBox, out intersects);\n                if (intersects)\n                    root.GetOverlaps(ref boundingFrustum, outputOverlappedElements);\n            }\n            return outputOverlappedElements.Count > 0;\n        }\n        /// <summary>\n        /// Gets the triangles whose bounding boxes are overlapped by the query.\n        /// </summary>\n        /// <param name=\"ray\">Shape to query against the tree.</param>\n        /// <param name=\"outputOverlappedElements\">Indices of triangles in the index buffer with bounding boxes which are overlapped by the query.</param>\n        /// <returns>Whether or not any elements were overlapped.</returns>\n        public bool GetOverlaps(Ray ray, IList<int> outputOverlappedElements)\n        {\n            if (root != null)\n            {\n                float? result;\n                ray.Intersects(ref root.BoundingBox, out result);\n                if (result != null)\n                    root.GetOverlaps(ref ray, float.MaxValue, outputOverlappedElements);\n            }\n            return outputOverlappedElements.Count > 0;\n        }\n        /// <summary>\n        /// Gets the triangles whose bounding boxes are overlapped by the query.\n        /// </summary>\n        /// <param name=\"ray\">Shape to query against the tree.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray's length.</param>\n        /// <param name=\"outputOverlappedElements\">Indices of triangles in the index buffer with bounding boxes which are overlapped by the query.</param>\n        /// <returns>Whether or not any elements were overlapped.</returns>\n        public bool GetOverlaps(Ray ray, float maximumLength, IList<int> outputOverlappedElements)\n        {\n            if (root != null)\n            {\n                float? result;\n                ray.Intersects(ref root.BoundingBox, out result);\n                if (result != null)\n                    root.GetOverlaps(ref ray, maximumLength, outputOverlappedElements);\n            }\n            return outputOverlappedElements.Count > 0;\n        }\n\n        abstract class Node\n        {\n            internal BoundingBox BoundingBox;\n            internal abstract void GetOverlaps(ref BoundingBox boundingBox, IList<int> outputOverlappedElements);\n            internal abstract void GetOverlaps(ref BoundingSphere boundingSphere, IList<int> outputOverlappedElements);\n            internal abstract void GetOverlaps(ref BoundingFrustum boundingFrustum, IList<int> outputOverlappedElements);\n            internal abstract void GetOverlaps(ref Ray ray, float maximumLength, IList<int> outputOverlappedElements);\n\n            internal abstract bool IsLeaf { get; }\n\n\n            internal abstract bool TryToInsert(LeafNode node, out Node treeNode);\n\n\n\n            internal abstract void Analyze(List<int> depths, int depth, ref int nodeCount);\n\n            internal abstract void Refit(MeshBoundingBoxTreeData data);\n        }\n\n        sealed class InternalNode : Node\n        {\n            internal Node ChildA;\n            internal Node ChildB;\n\n            internal override bool IsLeaf\n            {\n                get { return false; }\n            }\n\n\n            internal override void GetOverlaps(ref BoundingBox boundingBox, IList<int> outputOverlappedElements)\n            {\n                //Users of the GetOverlaps method will have to check the bounding box before calling\n                //root.getoverlaps.  This is actually desired in some cases, since the outer bounding box is used\n                //to determine a pair, and further overlap tests shouldn't bother retesting the root.\n                bool intersects;\n                ChildA.BoundingBox.Intersects(ref boundingBox, out intersects);\n                if (intersects)\n                    ChildA.GetOverlaps(ref boundingBox, outputOverlappedElements);\n                ChildB.BoundingBox.Intersects(ref boundingBox, out intersects);\n                if (intersects)\n                    ChildB.GetOverlaps(ref boundingBox, outputOverlappedElements);\n            }\n\n            internal override void GetOverlaps(ref BoundingSphere boundingSphere, IList<int> outputOverlappedElements)\n            {\n                bool intersects;\n                ChildA.BoundingBox.Intersects(ref boundingSphere, out intersects);\n                if (intersects)\n                    ChildA.GetOverlaps(ref boundingSphere, outputOverlappedElements);\n                ChildB.BoundingBox.Intersects(ref boundingSphere, out intersects);\n                if (intersects)\n                    ChildB.GetOverlaps(ref boundingSphere, outputOverlappedElements);\n            }\n\n            internal override void GetOverlaps(ref BoundingFrustum boundingFrustum, IList<int> outputOverlappedElements)\n            {\n                bool intersects;\n                boundingFrustum.Intersects(ref ChildA.BoundingBox, out intersects);\n                if (intersects)\n                    ChildA.GetOverlaps(ref boundingFrustum, outputOverlappedElements);\n                boundingFrustum.Intersects(ref ChildB.BoundingBox, out intersects);\n                if (intersects)\n                    ChildB.GetOverlaps(ref boundingFrustum, outputOverlappedElements);\n            }\n\n            internal override void GetOverlaps(ref Ray ray, float maximumLength, IList<int> outputOverlappedElements)\n            {\n                float? result;\n                ray.Intersects(ref ChildA.BoundingBox, out result);\n                if (result != null && result < maximumLength)\n                    ChildA.GetOverlaps(ref ray, maximumLength, outputOverlappedElements);\n                ray.Intersects(ref ChildB.BoundingBox, out result);\n                if (result != null && result < maximumLength)\n                    ChildB.GetOverlaps(ref ray, maximumLength, outputOverlappedElements);\n            }\n\n\n            internal override bool TryToInsert(LeafNode node, out Node treeNode)\n            {\n                ////The following can make the tree shorter, but it actually hurt query times in testing.\n                //bool aIsLeaf = childA.IsLeaf;\n                //bool bIsLeaf = childB.IsLeaf;\n                //if (aIsLeaf && !bIsLeaf)\n                //{\n                //    //Just put us with the leaf.  Keeps the tree shallower.\n                //    BoundingBox merged;\n                //    BoundingBox.CreateMerged(ref childA.BoundingBox, ref node.BoundingBox, out merged);\n                //    childA = new InternalNode() { BoundingBox = merged, childA = this.childA, childB = node };\n                //    treeNode = null;\n                //    return true;\n                //}\n                //else if (!aIsLeaf && bIsLeaf)\n                //{\n                //    //Just put us with the leaf.  Keeps the tree shallower.\n                //    BoundingBox merged;\n                //    BoundingBox.CreateMerged(ref childB.BoundingBox, ref node.BoundingBox, out merged);\n                //    childB = new InternalNode() { BoundingBox = merged, childA = node, childB = this.childB };\n                //    treeNode = null;\n                //    return true;\n                //}\n\n\n                //Since we are an internal node, we know we have two children.\n                //Regardless of what kind of nodes they are, figure out which would be a better choice to merge the new node with.\n\n                //Use the path which produces the smallest 'volume.'\n                BoundingBox mergedA, mergedB;\n                BoundingBox.CreateMerged(ref ChildA.BoundingBox, ref node.BoundingBox, out mergedA);\n                BoundingBox.CreateMerged(ref ChildB.BoundingBox, ref node.BoundingBox, out mergedB);\n\n                Vector3 offset;\n                float originalAVolume, originalBVolume;\n                Vector3.Subtract(ref ChildA.BoundingBox.Max, ref ChildA.BoundingBox.Min, out offset);\n                originalAVolume = offset.X * offset.Y * offset.Z;\n                Vector3.Subtract(ref ChildB.BoundingBox.Max, ref ChildB.BoundingBox.Min, out offset);\n                originalBVolume = offset.X * offset.Y * offset.Z;\n\n                float mergedAVolume, mergedBVolume;\n                Vector3.Subtract(ref mergedA.Max, ref mergedA.Min, out offset);\n                mergedAVolume = offset.X * offset.Y * offset.Z;\n                Vector3.Subtract(ref mergedB.Max, ref mergedB.Min, out offset);\n                mergedBVolume = offset.X * offset.Y * offset.Z;\n\n                //Could use factor increase or absolute difference\n                if (mergedAVolume - originalAVolume < mergedBVolume - originalBVolume)\n                {\n                    //merging A produces a better result.\n                    if (ChildA.IsLeaf)\n                    {\n                        ChildA = new InternalNode() { BoundingBox = mergedA, ChildA = this.ChildA, ChildB = node };\n                        treeNode = null;\n                        return true;\n                    }\n                    else\n                    {\n                        ChildA.BoundingBox = mergedA;\n                        treeNode = ChildA;\n                        return false;\n                    }\n                }\n                else\n                {\n                    //merging B produces a better result.\n                    if (ChildB.IsLeaf)\n                    {\n                        //Target is a leaf! Return.\n                        ChildB = new InternalNode() { BoundingBox = mergedB, ChildA = node, ChildB = this.ChildB };\n                        treeNode = null;\n                        return true;\n                    }\n                    else\n                    {\n                        ChildB.BoundingBox = mergedB;\n                        treeNode = ChildB;\n                        return false;\n                    }\n                }\n\n\n\n            }\n\n            public override string ToString()\n            {\n                return \"{\" + ChildA.ToString() + \", \" + ChildB.ToString() + \"}\";\n\n            }\n\n            internal override void Analyze(List<int> depths, int depth, ref int nodeCount)\n            {\n                nodeCount++;\n                ChildA.Analyze(depths, depth + 1, ref nodeCount);\n                ChildB.Analyze(depths, depth + 1, ref nodeCount);\n            }\n\n            internal override void Refit(MeshBoundingBoxTreeData data)\n            {\n                ChildA.Refit(data);\n                ChildB.Refit(data);\n                BoundingBox.CreateMerged(ref ChildA.BoundingBox, ref ChildB.BoundingBox, out BoundingBox);\n            }\n        }\n\n        /// <summary>\n        /// The tiny extra margin added to leaf bounding boxes that allow the volume cost metric to function properly even in degenerate cases.\n        /// </summary>\n        public static float LeafMargin = .001f;\n        sealed class LeafNode : Node\n        {\n            int LeafIndex;\n\n            internal override bool IsLeaf\n            {\n                get { return true; }\n            }\n\n            internal LeafNode(int leafIndex, MeshBoundingBoxTreeData data)\n            {\n                LeafIndex = leafIndex;\n                data.GetBoundingBox(leafIndex, out BoundingBox);\n                //Having an ever-so-slight margin allows the hierarchy use a volume metric even for degenerate shapes (consider a flat tessellated plane).\n                BoundingBox.Max.X += LeafMargin;\n                BoundingBox.Max.Y += LeafMargin;\n                BoundingBox.Max.Z += LeafMargin;\n                BoundingBox.Min.X -= LeafMargin;\n                BoundingBox.Min.Y -= LeafMargin;\n                BoundingBox.Min.Z -= LeafMargin;\n            }\n\n            internal override void GetOverlaps(ref BoundingBox boundingBox, IList<int> outputOverlappedElements)\n            {\n                //Our parent already tested the bounding box.  All that's left is to add myself to the list.\n                outputOverlappedElements.Add(LeafIndex);\n            }\n\n            internal override void GetOverlaps(ref BoundingSphere boundingSphere, IList<int> outputOverlappedElements)\n            {\n                outputOverlappedElements.Add(LeafIndex);\n            }\n\n            internal override void GetOverlaps(ref BoundingFrustum boundingFrustum, IList<int> outputOverlappedElements)\n            {\n                outputOverlappedElements.Add(LeafIndex);\n            }\n\n            internal override void GetOverlaps(ref Ray ray, float maximumLength, IList<int> outputOverlappedElements)\n            {\n                outputOverlappedElements.Add(LeafIndex);\n            }\n\n            internal override bool TryToInsert(LeafNode node, out Node treeNode)\n            {\n                var newTreeNode = new InternalNode();\n                BoundingBox.CreateMerged(ref BoundingBox, ref node.BoundingBox, out newTreeNode.BoundingBox);\n                newTreeNode.ChildA = this;\n                newTreeNode.ChildB = node;\n                treeNode = newTreeNode;\n                return true;\n            }\n\n            public override string ToString()\n            {\n                return LeafIndex.ToString(CultureInfo.InvariantCulture);\n            }\n\n            internal override void Analyze(List<int> depths, int depth, ref int nodeCount)\n            {\n                nodeCount++;\n                depths.Add(depth);\n            }\n\n            internal override void Refit(MeshBoundingBoxTreeData data)\n            {\n                data.GetBoundingBox(LeafIndex, out BoundingBox);\n                //Having an ever-so-slight margin allows the hierarchy use a volume metric even for degenerate shapes (consider a flat tessellated plane).\n                BoundingBox.Max.X += LeafMargin;\n                BoundingBox.Max.Y += LeafMargin;\n                BoundingBox.Max.Z += LeafMargin;\n                BoundingBox.Min.X -= LeafMargin;\n                BoundingBox.Min.Y -= LeafMargin;\n                BoundingBox.Min.Z -= LeafMargin;\n            }\n        }\n\n    }\n\n\n}\n"
  },
  {
    "path": "BEPUphysics/DataStructures/MeshBoundingBoxTreeData.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.DataStructures\n{\n\t///<summary>\n\t/// Superclass of the data used to create triangle mesh bounding box trees.\n\t///</summary>\n\tpublic abstract class MeshBoundingBoxTreeData\n\t{\n\t\tinternal uint[] indices;\n\t\t///<summary>\n\t\t/// Gets or sets the indices of the triangle mesh.\n\t\t///</summary>\n\t\tpublic uint[] Indices\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn indices;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tindices = value;\n\t\t\t}\n\t\t}\n\t\tpublic int IndexCount;\n\n\t\tinternal Vector3[] vertices;\n\t\t///<summary>\n\t\t/// Gets or sets the vertices of the triangle mesh.\n\t\t///</summary>\n\t\tpublic Vector3[] Vertices\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn vertices;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tvertices = value;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the bounding box of an element in the data.\n\t\t/// </summary>\n\t\t/// <param name=\"triangleIndex\">Index of the triangle in the data.</param>\n\t\t/// <param name=\"boundingBox\">Bounding box of the triangle.</param>\n\t\tpublic void GetBoundingBox(int triangleIndex, out BoundingBox boundingBox)\n\t\t{\n\t\t\tVector3 v1, v2, v3;\n\t\t\tGetTriangle(triangleIndex, out v1, out v2, out v3);\n\t\t\tVector3.Min(ref v1, ref v2, out boundingBox.Min);\n\t\t\tVector3.Min(ref boundingBox.Min, ref v3, out boundingBox.Min);\n\t\t\tVector3.Max(ref v1, ref v2, out boundingBox.Max);\n\t\t\tVector3.Max(ref boundingBox.Max, ref v3, out boundingBox.Max);\n\n\t\t}\n\t\t///<summary>\n\t\t/// Gets the triangle vertex positions at a given index.\n\t\t///</summary>\n\t\t///<param name=\"triangleIndex\">First index of a triangle's vertices in the index buffer.</param>\n\t\t///<param name=\"v1\">First vertex of the triangle.</param>\n\t\t///<param name=\"v2\">Second vertex of the triangle.</param>\n\t\t///<param name=\"v3\">Third vertex of the triangle.</param>\n\t\tpublic abstract void GetTriangle(int triangleIndex, out Vector3 v1, out Vector3 v2, out Vector3 v3);\n\t\t///<summary>\n\t\t/// Gets the position of a vertex in the data.\n\t\t///</summary>\n\t\t///<param name=\"i\">Index of the vertex.</param>\n\t\t///<param name=\"vertex\">Position of the vertex.</param>\n\t\tpublic abstract void GetVertexPosition(int i, out Vector3 vertex);\n\t}\n}\n"
  },
  {
    "path": "BEPUphysics/DataStructures/StaticMeshData.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.DataStructures\n{\n\t///<summary>\n\t/// Collection of triangle mesh data that directly returns vertices from its vertex buffer instead of transforming them first.\n\t///</summary>\n\tpublic class StaticMeshData : MeshBoundingBoxTreeData\n\t{\n\t\t///<summary>\n\t\t/// Constructs the triangle mesh data.\n\t\t///</summary>\n\t\t///<param name=\"vertices\">Vertices to use in the data.</param>\n\t\t///<param name=\"indices\">Indices to use in the data.</param>\n\t\tpublic StaticMeshData(Vector3[] vertices, uint[] indices, int indexCount)\n\t\t{\n\t\t\tVertices = vertices;\n\t\t\tIndices = indices;\n\t\t\tIndexCount = indexCount;\n\t\t}\n\n\n\t\t///<summary>\n\t\t/// Gets the triangle vertex positions at a given index.\n\t\t///</summary>\n\t\t///<param name=\"triangleIndex\">First index of a triangle's vertices in the index buffer.</param>\n\t\t///<param name=\"v1\">First vertex of the triangle.</param>\n\t\t///<param name=\"v2\">Second vertex of the triangle.</param>\n\t\t///<param name=\"v3\">Third vertex of the triangle.</param>\n\t\tpublic override void GetTriangle(int triangleIndex, out Vector3 v1, out Vector3 v2, out Vector3 v3)\n\t\t{\n\t\t\tv1 = vertices[indices[triangleIndex]];\n\t\t\tv2 = vertices[indices[triangleIndex + 1]];\n\t\t\tv3 = vertices[indices[triangleIndex + 2]];\n\t\t}\n\n\n\t\t///<summary>\n\t\t/// Gets the position of a vertex in the data.\n\t\t///</summary>\n\t\t///<param name=\"i\">Index of the vertex.</param>\n\t\t///<param name=\"vertex\">Position of the vertex.</param>\n\t\tpublic override void GetVertexPosition(int i, out Vector3 vertex)\n\t\t{\n\t\t\tvertex = vertices[i];\n\t\t}\n\n\n\t}\n}\n"
  },
  {
    "path": "BEPUphysics/DataStructures/TransformableMeshData.cs",
    "content": "﻿using BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.DataStructures\n{\n\t///<summary>\n\t/// Collection of mesh data which transforms its vertices before returning them.\n\t///</summary>\n\tpublic class TransformableMeshData : MeshBoundingBoxTreeData\n\t{\n\t\t///<summary>\n\t\t/// Constructs the mesh data.\n\t\t///</summary>\n\t\t///<param name=\"vertices\">Vertices to use in the mesh data.</param>\n\t\t///<param name=\"indices\">Indices to use in the mesh data.</param>\n\t\tpublic TransformableMeshData(Vector3[] vertices, uint[] indices, int indexCount)\n\t\t{\n\t\t\tVertices = vertices;\n\t\t\tIndices = indices;\n\t\t\tIndexCount = indexCount;\n\t\t}\n\n\t\t///<summary>\n\t\t/// Constructs the mesh data.\n\t\t///</summary>\n\t\t///<param name=\"vertices\">Vertice sto use in the mesh data.</param>\n\t\t///<param name=\"indices\">Indices to use in the mesh data.</param>\n\t\t///<param name=\"worldTransform\">Transform to apply to vertices before returning their positions.</param>\n\t\tpublic TransformableMeshData(Vector3[] vertices, uint[] indices, int indexCount, AffineTransform worldTransform)\n\t\t{\n\t\t\tthis.worldTransform = worldTransform;\n\t\t\tVertices = vertices;\n\t\t\tIndices = indices;\n\t\t\tIndexCount = indexCount;\n\t\t}\n\n\n\t\tinternal AffineTransform worldTransform = AffineTransform.Identity;\n\n\t\t///<summary>\n\t\t/// Gets or sets the transform to apply to the vertices before returning their position.\n\t\t///</summary>\n\t\tpublic AffineTransform WorldTransform\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn worldTransform;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tworldTransform = value;\n\t\t\t}\n\t\t}\n\n\t\t///<summary>\n\t\t/// Gets the triangle vertex positions at a given index.\n\t\t///</summary>\n\t\t///<param name=\"triangleIndex\">First index of a triangle's vertices in the index buffer.</param>\n\t\t///<param name=\"v1\">First vertex of the triangle.</param>\n\t\t///<param name=\"v2\">Second vertex of the triangle.</param>\n\t\t///<param name=\"v3\">Third vertex of the triangle.</param>\n\t\tpublic override void GetTriangle(int triangleIndex, out Vector3 v1, out Vector3 v2, out Vector3 v3)\n\t\t{\n\t\t\tAffineTransform.Transform(ref vertices[indices[triangleIndex]], ref worldTransform, out v1);\n\t\t\tAffineTransform.Transform(ref vertices[indices[triangleIndex + 1]], ref worldTransform, out v2);\n\t\t\tAffineTransform.Transform(ref vertices[indices[triangleIndex + 2]], ref worldTransform, out v3);\n\t\t}\n\n\t\t///<summary>\n\t\t/// Gets the position of a vertex in the data.\n\t\t///</summary>\n\t\t///<param name=\"i\">Index of the vertex.</param>\n\t\t///<param name=\"vertex\">Position of the vertex.</param>\n\t\tpublic override void GetVertexPosition(int i, out Vector3 vertex)\n\t\t{\n\t\t\tAffineTransform.Transform(ref vertices[i], ref worldTransform, out vertex);\n\t\t}\n\n\n\t}\n}\n"
  },
  {
    "path": "BEPUphysics/DataStructures/TreeOverlapPair.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace BEPUphysics.DataStructures\n{\n    ///<summary>\n    /// Result of an overlap test between two trees of specified type.\n    ///</summary>\n    ///<typeparam name=\"T1\">Type of elements in the first tree.</typeparam>\n    ///<typeparam name=\"T2\">Type of elements in the second tree.</typeparam>\n    public struct TreeOverlapPair<T1, T2>\n    {\n        /// <summary>\n        /// Overlap owned by the first tree.\n        /// </summary>\n        public T1 OverlapA;\n        /// <summary>\n        /// Overlap owned by the second tree.\n        /// </summary>\n        public T2 OverlapB;\n\n        /// <summary>\n        /// Constructs a new overlap pair.\n        /// </summary>\n        /// <param name=\"overlapA\">Overlap owned by the first tree.</param>\n        /// <param name=\"overlapB\">Overlap owned by the second tree.</param>\n        public TreeOverlapPair(T1 overlapA, T2 overlapB)\n        {\n            OverlapA = overlapA;\n            OverlapB = overlapB;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/DataStructures/TriangleMesh.cs",
    "content": "﻿using System.Collections.Generic;\nusing BEPUutilities;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace BEPUphysics.DataStructures\n{\n    ///<summary>\n    /// Data structure containing triangle mesh data and its associated bounding box tree.\n    ///</summary>\n    public class TriangleMesh\n    {\n        private MeshBoundingBoxTreeData data;\n        ///<summary>\n        /// Gets or sets the bounding box data used in the mesh.\n        ///</summary>\n        public MeshBoundingBoxTreeData Data\n        {\n            get\n            {\n                return data;\n            }\n            set\n            {\n                data = value;\n                tree.Data = data;\n            }\n        }\n\n        private MeshBoundingBoxTree tree;\n        ///<summary>\n        /// Gets the bounding box tree that accelerates queries to this triangle mesh.\n        ///</summary>\n        public MeshBoundingBoxTree Tree\n        {\n            get\n            {\n                return tree;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new triangle mesh.\n        ///</summary>\n        ///<param name=\"data\">Data to use to construct the mesh.</param>\n        public TriangleMesh(MeshBoundingBoxTreeData data)\n        {\n            this.data = data;\n            tree = new MeshBoundingBoxTree(data);\n        }\n\n        ///<summary>\n        /// Tests a ray against the triangle mesh.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the mesh.</param>\n        ///<param name=\"hitCount\">Number of hits between the ray and the mesh.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, out int hitCount)\n        {\n            var rayHits = CommonResources.GetRayHitList();\n            bool toReturn = RayCast(ray, rayHits);\n            hitCount = rayHits.Count;\n            CommonResources.GiveBack(rayHits);\n            return toReturn;\n        }\n\n        ///<summary>\n        /// Tests a ray against the triangle mesh.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the mesh.</param>\n        ///<param name=\"rayHit\">Hit data for the ray, if any.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, out RayHit rayHit)\n        {\n            return RayCast(ray, float.MaxValue, TriangleSidedness.DoubleSided, out rayHit);\n        }\n\n        ///<summary>\n        /// Tests a ray against the triangle mesh.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the mesh.</param>\n        /// <param name=\"sidedness\">Sidedness to apply to the mesh for the ray cast.</param>\n        ///<param name=\"rayHit\">Hit data for the ray, if any.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, TriangleSidedness sidedness, out RayHit rayHit)\n        {\n            return RayCast(ray, float.MaxValue, sidedness, out rayHit);\n        }\n\n        ///<summary>\n        /// Tests a ray against the triangle mesh.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the mesh.</param>\n        ///<param name=\"hits\">Hit data for the ray, if any.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, IList<RayHit> hits)\n        {\n            return RayCast(ray, float.MaxValue, TriangleSidedness.DoubleSided, hits);\n        }\n\n        ///<summary>\n        /// Tests a ray against the triangle mesh.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the mesh.</param>\n        /// <param name=\"sidedness\">Sidedness to apply to the mesh for the ray cast.</param>\n        ///<param name=\"hits\">Hit data for the ray, if any.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, TriangleSidedness sidedness, IList<RayHit> hits)\n        {\n            return RayCast(ray, float.MaxValue, sidedness, hits);\n        }\n\n        ///<summary>\n        /// Tests a ray against the triangle mesh.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the mesh.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        ///<param name=\"rayHit\">Hit data for the ray, if any.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, float maximumLength, out RayHit rayHit)\n        {\n            return RayCast(ray, maximumLength, TriangleSidedness.DoubleSided, out rayHit);\n        }\n\n        ///<summary>\n        /// Tests a ray against the triangle mesh.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the mesh.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        /// <param name=\"sidedness\">Sidedness to apply to the mesh for the ray cast.</param>\n        ///<param name=\"rayHit\">Hit data for the ray, if any.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, float maximumLength, TriangleSidedness sidedness, out RayHit rayHit)\n        {\n            var rayHits = CommonResources.GetRayHitList();\n            bool toReturn = RayCast(ray, maximumLength, sidedness, rayHits);\n            if (toReturn)\n            {\n                rayHit = rayHits[0];\n                for (int i = 1; i < rayHits.Count; i++)\n                {\n                    RayHit hit = rayHits[i];\n                    if (hit.T < rayHit.T)\n                        rayHit = hit;\n                }\n            }\n            else\n                rayHit = new RayHit();\n            CommonResources.GiveBack(rayHits);\n            return toReturn;\n        }\n\n        ///<summary>\n        /// Tests a ray against the triangle mesh.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the mesh.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        ///<param name=\"hits\">Hit data for the ray, if any.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, float maximumLength, IList<RayHit> hits)\n        {\n            return RayCast(ray, maximumLength, TriangleSidedness.DoubleSided, hits);\n        }\n\n        ///<summary>\n        /// Tests a ray against the triangle mesh.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test against the mesh.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        /// <param name=\"sidedness\">Sidedness to apply to the mesh for the ray cast.</param>\n        ///<param name=\"hits\">Hit data for the ray, if any.</param>\n        ///<returns>Whether or not the ray hit the mesh.</returns>\n        public bool RayCast(Ray ray, float maximumLength, TriangleSidedness sidedness, IList<RayHit> hits)\n        {\n            var hitElements = CommonResources.GetIntList();\n            tree.GetOverlaps(ray, maximumLength, hitElements);\n            for (int i = 0; i < hitElements.Count; i++)\n            {\n                Vector3 v1, v2, v3;\n                data.GetTriangle(hitElements[i], out v1, out v2, out v3);\n                RayHit hit;\n                if (Toolbox.FindRayTriangleIntersection(ref ray, maximumLength, sidedness, ref v1, ref v2, ref v3, out hit))\n                {\n                    hits.Add(hit);\n                }\n            }\n            CommonResources.GiveBack(hitElements);\n            return hits.Count > 0;\n        }\n\n        #region Vertex extraction helpers\n\n\n        /// <summary>\n        /// Gets an array of vertices and indices from the provided model.\n        /// </summary>\n        /// <param name=\"collisionModel\">Model to use for the collision shape.</param>\n        /// <param name=\"vertices\">Compiled set of vertices from the model.</param>\n        /// <param name=\"indices\">Compiled set of indices from the model.</param>\n        public static void GetVerticesAndIndicesFromModel(Model collisionModel, out Vector3[] vertices, out int[] indices)\n        {\n            var verticesList = new List<Vector3>();\n            var indicesList = new List<int>();\n            var transforms = new Matrix[collisionModel.Bones.Count];\n            collisionModel.CopyAbsoluteBoneTransformsTo(transforms);\n\n            Matrix transform;\n            foreach (ModelMesh mesh in collisionModel.Meshes)\n            {\n                if (mesh.ParentBone != null)\n                    transform = transforms[mesh.ParentBone.Index];\n                else\n                    transform = Matrix.Identity;\n                AddMesh(mesh, transform, verticesList, indicesList);\n            }\n\n            vertices = verticesList.ToArray();\n            indices = indicesList.ToArray();\n\n\n        }\n\n        /// <summary>\n        /// Adds a mesh's vertices and indices to the given lists.\n        /// </summary>\n        /// <param name=\"collisionModelMesh\">Model to use for the collision shape.</param>\n        /// <param name=\"transform\">Transform to apply to the mesh.</param>\n        /// <param name=\"vertices\">List to receive vertices from the mesh.</param>\n        /// <param name=\"indices\">List to receive indices from the mesh.</param>\n        public static void AddMesh(ModelMesh collisionModelMesh, Matrix transform, List<Vector3> vertices, IList<int> indices)\n        {\n            foreach (ModelMeshPart meshPart in collisionModelMesh.MeshParts)\n            {\n                int startIndex = vertices.Count;\n                var meshPartVertices = new Vector3[meshPart.NumVertices];\n                //Grab position data from the mesh part.\n                int stride = meshPart.VertexBuffer.VertexDeclaration.VertexStride;\n                meshPart.VertexBuffer.GetData(\n                        meshPart.VertexOffset * stride,\n                        meshPartVertices,\n                        0,\n                        meshPart.NumVertices,\n                        stride);\n\n                //Transform it so its vertices are located in the model's space as opposed to mesh part space.\n                Vector3.Transform(meshPartVertices, ref transform, meshPartVertices);\n                vertices.AddRange(meshPartVertices);\n\n                if (meshPart.IndexBuffer.IndexElementSize == IndexElementSize.ThirtyTwoBits)\n                {\n                    var meshIndices = new int[meshPart.PrimitiveCount * 3];\n                    meshPart.IndexBuffer.GetData(meshPart.StartIndex * 4, meshIndices, 0, meshPart.PrimitiveCount * 3);\n                    for (int k = 0; k < meshIndices.Length; k++)\n                    {\n                        indices.Add(startIndex + meshIndices[k]);\n                    }\n                }\n                else\n                {\n                    var meshIndices = new ushort[meshPart.PrimitiveCount * 3];\n                    meshPart.IndexBuffer.GetData(meshPart.StartIndex * 2, meshIndices, 0, meshPart.PrimitiveCount * 3);\n                    for (int k = 0; k < meshIndices.Length; k++)\n                    {\n                        indices.Add(startIndex + meshIndices[k]);\n                    }\n\n\n                }\n            }\n\n\n\n\n        }\n\n        #endregion\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/DeactivationManagement/DeactivationManager.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.Threading;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.DeactivationManagement\n{\n    ///<summary>\n    /// Manages the sleeping states of objects.\n    ///</summary>\n    public class DeactivationManager : MultithreadedProcessingStage\n    {\n        private int maximumDeactivationAttemptsPerFrame = 100;\n        private int deactivationIslandIndex;\n\n        internal float velocityLowerLimit = .26f;\n        internal float velocityLowerLimitSquared = .26f * .26f;\n        internal float lowVelocityTimeMinimum = 1f;\n\n        ///<summary>\n        /// Gets or sets the velocity under which the deactivation system will consider \n        /// objects to be deactivation candidates (if their velocity stays below the limit\n        /// for the LowVelocityTimeMinimum).\n        /// Defaults to 0.26.\n        ///</summary>\n        public float VelocityLowerLimit\n        {\n            get\n            {\n                return velocityLowerLimit;\n            }\n            set\n            {\n                velocityLowerLimit = Math.Max(0, value);\n                velocityLowerLimitSquared = velocityLowerLimit * velocityLowerLimit;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the time limit above which the deactivation system will consider\n        /// objects to be deactivation candidates (if their velocity stays below the VelocityLowerLimit for the duration).\n        /// Defaults to 1.\n        /// </summary>\n        public float LowVelocityTimeMinimum\n        {\n            get\n            {\n                return lowVelocityTimeMinimum;\n            }\n            set\n            {\n                if (value <= 0)\n                    throw new ArgumentException(\"Must use a positive, non-zero value for deactivation time minimum.\");\n                lowVelocityTimeMinimum = value;\n            }\n        }\n\n        internal bool useStabilization = true;\n        ///<summary>\n        /// Gets or sets whether or not to use a stabilization effect on nearly motionless objects.\n        /// This removes a lot of energy from a system when things are settling down, allowing them to go \n        /// to sleep faster.  It also makes most simulations appear a lot more robust.\n        /// Defaults to true.\n        ///</summary>\n        public bool UseStabilization\n        {\n            get\n            {\n                return useStabilization;\n            }\n            set\n            {\n                useStabilization = value;\n            }\n        }\n\n\n\n        //TryToSplit is NOT THREAD SAFE.  Only one TryToSplit should ever be run.\n        Queue<SimulationIslandMember> member1Friends = new Queue<SimulationIslandMember>(), member2Friends = new Queue<SimulationIslandMember>();\n        List<SimulationIslandMember> searchedMembers1 = new List<SimulationIslandMember>(), searchedMembers2 = new List<SimulationIslandMember>();\n\n        ///<summary>\n        /// Gets or sets the maximum number of objects to attempt to deactivate each frame.\n        /// Defaults to 100.\n        ///</summary>\n        public int MaximumDeactivationAttemptsPerFrame { get { return maximumDeactivationAttemptsPerFrame; } set { maximumDeactivationAttemptsPerFrame = value; } }\n\n        TimeStepSettings timeStepSettings;\n        ///<summary>\n        /// Gets or sets the time step settings used by the deactivation manager.\n        ///</summary>\n        public TimeStepSettings TimeStepSettings\n        {\n            get\n            {\n                return timeStepSettings;\n            }\n            set\n            {\n                timeStepSettings = value;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a deactivation manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">The time step settings used by the manager.</param>\n        public DeactivationManager(TimeStepSettings timeStepSettings)\n        {\n            Enabled = true;\n            multithreadedCandidacyLoopDelegate = MultithreadedCandidacyLoop;\n            this.timeStepSettings = timeStepSettings;\n        }\n\n        ///<summary>\n        /// Constructs a deactivation manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">The time step settings used by the manager.</param>\n        /// <param name=\"threadManager\">Thread manager used by the manager.</param>\n        public DeactivationManager(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : this(timeStepSettings)\n        {\n            ThreadManager = threadManager;\n            AllowMultithreading = true;\n        }\n        //TODO: Deactivation Candidate Detection\n        //-Could scan the entities of CURRENTLY ACTIVE simulation islands.\n        //-Requires a List-format of active sim islands.\n        //-Requires sim islands have a list-format entity set.\n        //-Simulation islands of different sizes won't load-balance well on the xbox360; it would be fine on the pc though.\n        //TODO: Simulation Island Deactivation\n\n        RawList<SimulationIslandMember> simulationIslandMembers = new RawList<SimulationIslandMember>();\n        RawList<SimulationIsland> simulationIslands = new RawList<SimulationIsland>();\n\n        ///<summary>\n        /// Gets the simulation islands currently in the manager.\n        ///</summary>\n        public ReadOnlyList<SimulationIsland> SimulationIslands\n        {\n            get\n            {\n                return new ReadOnlyList<SimulationIsland>(simulationIslands);\n            }\n        }\n\n        UnsafeResourcePool<SimulationIsland> islandPool = new UnsafeResourcePool<SimulationIsland>();\n\n        void GiveBackIsland(SimulationIsland island)\n        {\n            island.CleanUp();\n            islandPool.GiveBack(island);\n        }\n\n        ///<summary>\n        /// Adds a simulation island member to the manager.\n        ///</summary>\n        ///<param name=\"simulationIslandMember\">Member to add.</param>\n        ///<exception cref=\"Exception\">Thrown if the member already belongs to a manager.</exception>\n        public void Add(SimulationIslandMember simulationIslandMember)\n        {\n            if (simulationIslandMember.DeactivationManager == null)\n            {\n                simulationIslandMember.Activate();\n                simulationIslandMember.DeactivationManager = this;\n                simulationIslandMembers.Add(simulationIslandMember);\n                if (simulationIslandMember.IsDynamic)\n                {\n                    AddSimulationIslandToMember(simulationIslandMember);\n                }\n                else\n                {\n                    RemoveSimulationIslandFromMember(simulationIslandMember);\n                }\n            }\n            else\n                throw new ArgumentException(\"Cannot add that member to this DeactivationManager; it already belongs to a manager.\");\n        }\n\n        /// <summary>\n        /// Removes the member from this island.\n        /// </summary>\n        /// <param name=\"simulationIslandMember\">Removes the member from the manager.</param>\n        public void Remove(SimulationIslandMember simulationIslandMember)\n        {\n            if (simulationIslandMember.DeactivationManager == this)\n            {\n                simulationIslandMember.DeactivationManager = null;\n                simulationIslandMembers.Remove(simulationIslandMember);\n                RemoveSimulationIslandFromMember(simulationIslandMember);\n\n            }\n            else\n                throw new ArgumentException(\"Cannot remove that member from this DeactivationManager; it belongs to a different or no manager.\");\n        }\n\n        Action<int> multithreadedCandidacyLoopDelegate;\n        void MultithreadedCandidacyLoop(int i)\n        {\n            simulationIslandMembers.Elements[i].UpdateDeactivationCandidacy(timeStepSettings.TimeStepDuration);\n        }\n\n        protected override void UpdateMultithreaded()\n        {\n            FlushSplits();\n\n            ThreadManager.ForLoop(0, simulationIslandMembers.Count, multithreadedCandidacyLoopDelegate);\n\n            DeactivateObjects();\n        }\n\n        //RawList<SimulationIslandConnection> debugConnections = new RawList<SimulationIslandConnection>();\n        protected override void UpdateSingleThreaded()\n        {\n            FlushSplits();\n\n            for (int i = 0; i < simulationIslandMembers.Count; i++)\n                simulationIslandMembers.Elements[i].UpdateDeactivationCandidacy(timeStepSettings.TimeStepDuration);\n\n            DeactivateObjects();\n\n        }\n\n\n        Queue<SimulationIslandConnection> splitAttempts = new Queue<SimulationIslandConnection>();\n\n        static float maximumSplitAttemptsFraction = .01f;\n        /// <summary>\n        /// Gets or sets the fraction of splits that the deactivation manager will attempt in a single frame.\n        /// The total splits queued multiplied by this value results in the number of splits managed.\n        /// Defaults to .04f.\n        /// </summary>\n        public static float MaximumSplitAttemptsFraction\n        {\n            get\n            {\n                return maximumSplitAttemptsFraction;\n            }\n            set\n            {\n                if (value > 1 || value < 0)\n                    throw new ArgumentException(\"Value must be from zero to one.\");\n                maximumSplitAttemptsFraction = value;\n            }\n        }\n        static int minimumSplitAttempts = 3;\n        /// <summary>\n        /// Gets or sets the minimum number of splits attempted in a single frame.\n        /// Defaults to 5.\n        /// </summary>\n        public static int MinimumSplitAttempts\n        {\n            get\n            {\n                return minimumSplitAttempts;\n            }\n            set\n            {\n                if (value >= 0)\n                    throw new ArgumentException(\"Minimum split count must be nonnegative.\");\n                minimumSplitAttempts = value;\n            }\n        }\n        void FlushSplits()\n        {\n            //Only do a portion of the total splits.\n            int maxAttempts = Math.Max(minimumSplitAttempts, (int)(splitAttempts.Count * maximumSplitAttemptsFraction));\n            int attempts = 0;\n            while (attempts < maxAttempts && splitAttempts.Count > 0)\n            {\n                var attempt = splitAttempts.Dequeue();\n                if (attempt.SlatedForRemoval) //If it was re-added, don't split!\n                {\n                    attempt.SlatedForRemoval = false; //Reset the removal state so that future adds will add back references, since we're about to remove them.\n                    attempt.RemoveReferencesFromConnectedMembers();\n                    bool triedToSplit = false;\n                    for (int i = 0; i < attempt.entries.Count; i++)\n                    {\n                        for (int j = i + 1; j < attempt.entries.Count; j++)\n                        {\n                            triedToSplit |= TryToSplit(attempt.entries.Elements[i].Member, attempt.entries.Elements[j].Member);\n                        }\n                    }\n                    //Only count the split if it does any work.\n                    if (triedToSplit)\n                        attempts++;\n                    if (attempt.Owner == null)\n                    {\n                        //It's an orphan connection.  No one owns it, and now that it's been dequeued from the deactivation manager,\n                        //it has no home at all.\n                        //Don't let it rot- return it to the pool!\n                        PhysicsResources.GiveBack(attempt);\n                        //This occurs when a constraint changes members.\n                        //Because connections need to be immutable for this scheme to work,\n                        //the old connection is orphaned and put into the deactivation manager's removal queue\n                        //while a new one from the pool takes its place.\n                    }\n                }\n\n            }\n\n        }\n\n\n        void DeactivateObjects()\n        {\n            //Deactivate only some objects each frame.\n            int numberOfEntitiesDeactivated = 0;\n            int numberOfIslandsChecked = 0;\n            int originalIslandCount = simulationIslands.Count;\n            while (numberOfEntitiesDeactivated < maximumDeactivationAttemptsPerFrame && simulationIslands.Count > 0 && numberOfIslandsChecked < originalIslandCount)\n            {\n                deactivationIslandIndex = (deactivationIslandIndex + 1) % simulationIslands.Count;\n                var island = simulationIslands.Elements[deactivationIslandIndex];\n                if (island.memberCount == 0)\n                {\n                    //Found an orphan island left over from merge procedures or removal procedures.\n                    //Shoo it on out.\n                    simulationIslands.FastRemoveAt(deactivationIslandIndex);\n                    GiveBackIsland(island);\n                }\n                else\n                {\n                    island.TryToDeactivate();\n                    numberOfEntitiesDeactivated += island.memberCount;\n                }\n                numberOfIslandsChecked++;\n            }\n        }\n\n        ///<summary>\n        /// Adds a simulation island connection to the deactivation manager.\n        ///</summary>\n        ///<param name=\"connection\">Connection to add.</param>\n        ///<exception cref=\"ArgumentException\">Thrown if the connection already belongs to a manager.</exception>\n        public void Add(SimulationIslandConnection connection)\n        {\n            //DO A MERGE IF NECESSARY\n            if (connection.DeactivationManager == null)\n            {\n                connection.DeactivationManager = this;\n                if (connection.entries.Count > 0)\n                {\n                    var island = connection.entries.Elements[0].Member.SimulationIsland;\n                    for (int i = 1; i < connection.entries.Count; i++)\n                    {\n                        SimulationIsland opposingIsland;\n                        if (island != (opposingIsland = connection.entries.Elements[i].Member.SimulationIsland))\n                        {\n                            //Need to do a merge between the two islands.\n                            //Note that this merge may eliminate the need for a merge with subsequent connection if they belong to the same island.\n                            island = Merge(island, opposingIsland);\n                        }\n\n                    }\n\n                    if (connection.SlatedForRemoval)\n                        connection.SlatedForRemoval = false; //If it was slated for removal, that means connections are still present.  Just set the flag and the removal system will ignore the removal order.\n                    else\n                        connection.AddReferencesToConnectedMembers();\n                    //debugConnections.Add(connection);\n                }\n            }\n            else\n            {\n                throw new ArgumentException(\"Cannot add connection to deactivation manager; it already belongs to one.\");\n            }\n        }\n\n        private SimulationIsland Merge(SimulationIsland s1, SimulationIsland s2)\n        {\n            //Pull the smaller island into the larger island and set all members\n            //of the smaller island to refer to the new island.\n\n            //The simulation islands can be null; a connection can be a kinematic entity, which has no simulation island.\n            //'Merging' a null island with an island simply gets back the island.\n            if (s1 == null)\n            {\n                //Should still activate the island, though.\n                s2.Activate();\n                return s2;\n            }\n            if (s2 == null)\n            {\n                //Should still activate the island, though.\n                s1.Activate();\n                return s1;\n            }\n\n            //Swap if needed so s1 is the bigger island\n            if (s1.memberCount < s2.memberCount)\n            {\n                var biggerIsland = s2;\n                s2 = s1;\n                s1 = biggerIsland;\n            }\n\n            s1.Activate();\n            s2.immediateParent = s1;\n\n            //This is a bit like a 'union by rank.'\n            //But don't get confused- simulation islands are not a union find structure.\n            //This parenting simply avoids the need for maintaining a list of members in each simulation island.\n            //In the subsequent frame, the deactivation candidacy update will go through the parents and eat away\n            //at the child simulation island.  Then, in a later TryToDeactivate phase, the then-empty simulation island\n            //will be removed.\n\n            //The larger one survives.\n            return s1;\n        }\n\n\n\n        ///<summary>\n        /// Removes a simulation island connection from the manager.\n        ///</summary>\n        ///<param name=\"connection\">Connection to remove from the manager.</param>\n        ///<exception cref=\"ArgumentException\">Thrown if the connection does not belong to this manager.</exception>\n        public void Remove(SimulationIslandConnection connection)\n        {\n            if (connection.DeactivationManager == this)\n            {\n                connection.DeactivationManager = null; //TODO: Should it remove here, or in the deferred final case? probably here, since otherwise Add-Remove-Add would throw an exception!\n                //Try to split by examining the connections and breadth-first searching outward.\n                //If it is determined that a split is required, grab a new island and add it.\n                //This is a little tricky because it's a theoretically N-way split.\n\n                //For two members which have the same simulation island (they will initially), try to split.\n                //debugConnections.Remove(connection);\n                connection.SlatedForRemoval = true;\n                //Don't immediately do the removal.\n                //Defer them!\n\n                splitAttempts.Enqueue(connection);\n\n                //connection.RemoveReferencesFromConnectedMembers();\n                //for (int i = 0; i < connection.members.count; i++)\n                //{\n                //    for (int j = i + 1; j < connection.members.count; j++)\n                //    {\n                //        //Notice that the splits are not performed immediately! They are deferred and spread over multiple frames.\n                //        //Split operations aren't cheap, and overdoing them can lead to pointless re-merging and re-splitting.\n                //        splitAttempts.Enqueue(new SplitAttempt() { a = connection.members.Elements[i], b = connection.members.Elements[j] });\n                //        //TryToSplit(connection.ConnectedMembers[i], connection.ConnectedMembers[j]);\n                //    }\n                //}\n\n            }\n            else\n            {\n                throw new ArgumentException(\"Cannot remove connection from activity manager; it is owned by a different or no activity manager.\");\n            }\n\n\n\n        }\n\n\n        /// <summary>\n        /// Tries to split connections between the two island members.\n        /// </summary>\n        /// <param name=\"member1\">First island member.</param>\n        /// <param name=\"member2\">Second island member.</param>\n        /// <returns>Whether a split operation was run.  This does not mean a split was\n        /// successful, just that the expensive test was performed.</returns>\n        private bool TryToSplit(SimulationIslandMember member1, SimulationIslandMember member2)\n        {\n            //Can't split if they aren't even in the same island.\n            //This also covers the case where the connection involves a kinematic entity that has no \n            //simulation island at all.\n            if (member1.SimulationIsland != member2.SimulationIsland ||\n                member1.SimulationIsland == null ||\n                member2.SimulationIsland == null)\n                return false;\n\n\n            //By now, we know the members belong to the same island and are not null.\n            //Start a BFS starting from each member.\n            //Two-way can complete the search quicker.\n\n            member1Friends.Enqueue(member1);\n            member2Friends.Enqueue(member2);\n            searchedMembers1.Add(member1);\n            searchedMembers2.Add(member2);\n            member1.searchState = SimulationIslandSearchState.OwnedByFirst;\n            member2.searchState = SimulationIslandSearchState.OwnedBySecond;\n\n            while (member1Friends.Count > 0 && member2Friends.Count > 0)\n            {\n\n\n                SimulationIslandMember currentNode = member1Friends.Dequeue();\n                for (int i = 0; i < currentNode.connections.Count; i++)\n                {\n                    for (int j = 0; j < currentNode.connections.Elements[i].entries.Count; j++)\n                    {\n                        SimulationIslandMember connectedNode;\n                        if ((connectedNode = currentNode.connections.Elements[i].entries.Elements[j].Member) != currentNode &&\n                            connectedNode.SimulationIsland != null) //The connection could be connected to something that isn't in the Space and has no island, or it's not dynamic.\n                        {\n                            switch (connectedNode.searchState)\n                            {\n                                case SimulationIslandSearchState.Unclaimed:\n                                    //Found a new friend :)\n                                    member1Friends.Enqueue(connectedNode);\n                                    connectedNode.searchState = SimulationIslandSearchState.OwnedByFirst;\n                                    searchedMembers1.Add(connectedNode);\n                                    break;\n                                case SimulationIslandSearchState.OwnedBySecond:\n                                    //Found our way to member2Friends set; cannot split!\n                                    member1Friends.Clear();\n                                    member2Friends.Clear();\n                                    goto ResetSearchStates;\n                            }\n\n                        }\n                    }\n                }\n\n                currentNode = member2Friends.Dequeue();\n                for (int i = 0; i < currentNode.connections.Count; i++)\n                {\n                    for (int j = 0; j < currentNode.connections.Elements[i].entries.Count; j++)\n                    {\n                        SimulationIslandMember connectedNode;\n                        if ((connectedNode = currentNode.connections.Elements[i].entries.Elements[j].Member) != currentNode &&\n                            connectedNode.SimulationIsland != null) //The connection could be connected to something that isn't in the Space and has no island, or it's not dynamic.\n                        {\n                            switch (connectedNode.searchState)\n                            {\n                                case SimulationIslandSearchState.Unclaimed:\n                                    //Found a new friend :)\n                                    member2Friends.Enqueue(connectedNode);\n                                    connectedNode.searchState = SimulationIslandSearchState.OwnedBySecond;\n                                    searchedMembers2.Add(connectedNode);\n                                    break;\n                                case SimulationIslandSearchState.OwnedByFirst:\n                                    //Found our way to member1Friends set; cannot split!\n                                    member1Friends.Clear();\n                                    member2Friends.Clear();\n                                    goto ResetSearchStates;\n                            }\n\n                        }\n                    }\n                }\n            }\n            //If one of the queues empties out without finding anything, it means it's isolated.  The other one will never find it.\n            //Now we can do a split.  Grab a new Island, fill it with the isolated search stuff.  Remove the isolated search stuff from the old Island.\n\n\n            SimulationIsland newIsland = islandPool.Take();\n            simulationIslands.Add(newIsland);\n            if (member1Friends.Count == 0)\n            {\n\n                //Member 1 is isolated, give it its own simulation island!\n                for (int i = 0; i < searchedMembers1.Count; i++)\n                {\n                    searchedMembers1[i].simulationIsland.Remove(searchedMembers1[i]);\n                    newIsland.Add(searchedMembers1[i]);\n                }\n                member2Friends.Clear();\n            }\n            else if (member2Friends.Count == 0)\n            {\n\n                //Member 2 is isolated, give it its own simulation island!\n                for (int i = 0; i < searchedMembers2.Count; i++)\n                {\n                    searchedMembers2[i].simulationIsland.Remove(searchedMembers2[i]);\n                    newIsland.Add(searchedMembers2[i]);\n                }\n                member1Friends.Clear();\n            }\n\n            //Force the system awake.\n            //Technically, the members should already be awake.\n            //However, calling Activate on them resets the members'\n            //deactivation candidacy timers.  This prevents the island\n            //from instantly going back to sleep, which could leave\n            //objects hanging in mid-air.\n            member1.Activate();\n            member2.Activate();\n\n\n        ResetSearchStates:\n            for (int i = 0; i < searchedMembers1.Count; i++)\n            {\n                searchedMembers1[i].searchState = SimulationIslandSearchState.Unclaimed;\n            }\n            for (int i = 0; i < searchedMembers2.Count; i++)\n            {\n                searchedMembers2[i].searchState = SimulationIslandSearchState.Unclaimed;\n            }\n            searchedMembers1.Clear();\n            searchedMembers2.Clear();\n            return true;\n\n        }\n\n\n\n\n        ///<summary>\n        /// Strips a member of its simulation island.\n        ///</summary>\n        ///<param name=\"member\">Member to be stripped.</param>\n        public void RemoveSimulationIslandFromMember(SimulationIslandMember member)\n        {\n\n            //Becoming kinematic eliminates the member as a possible path.\n            //Splits must be attempted between its connected members.\n            //Don't need to split same-connection members.  Splitting one non-null entry against a non null entry in each of the other connections will do the trick.\n            if (member.simulationIsland != null)\n            {\n                //Note that this is using the most immediate simulation island.  This is because the immediate simulation island\n                //is the one who 'owns' the member; not the root parent.  The root parent will own the member in the next frame\n                //after the deactivation candidacy loop runs.\n                SimulationIsland island = member.simulationIsland;\n                island.Remove(member);\n                if (island.memberCount == 0)\n                {\n                    simulationIslands.Remove(island);\n                    GiveBackIsland(island);\n                    //Even though we appear to have connections, the island was only me!\n                    //We can stop now.\n                    //Note that we do NOT remove the island from the simulation islands list here.\n                    //That would take an O(n) search.  Instead, orphan it and let the TryToDeactivate loop find it.\n                    return;\n                }\n            }\n            if (member.connections.Count > 0)\n            {\n                for (int i = 0; i < member.connections.Count; i++)\n                {\n                    //Find a member with a non-null island to represent connection i.\n                    SimulationIslandMember representativeA = null;\n                    for (int j = 0; j < member.connections.Elements[i].entries.Count; j++)\n                    {\n                        if (member.connections.Elements[i].entries.Elements[j].Member.SimulationIsland != null)\n                        {\n                            representativeA = member.connections.Elements[i].entries.Elements[j].Member;\n                            break;\n                        }\n                    }\n\n                    if (representativeA == null)\n                    {\n                        //There was no representative!  That means it was a connection in which\n                        //no member had a simulation island.  Consider removing a dynamic box from the space\n                        //while it sits on a kinematic box.  Neither object has a simulation island.\n                        //In this case, simply try the next connection.\n                        continue;\n                    }\n                    //Activate the representative. This must be performed even if no split occurs; connected objects must be activated!\n                    representativeA.Activate();\n\n                    //Split the representative against representatives from other connections.\n                    for (int j = i + 1; j < member.connections.Count; j++)\n                    {\n                        //Find a representative for another connection.\n                        SimulationIslandMember representativeB = null;\n                        for (int k = 0; k < member.connections.Elements[j].entries.Count; k++)\n                        {\n                            if (member.connections.Elements[j].entries.Elements[k].Member.SimulationIsland != null)\n                            {\n                                representativeB = member.connections.Elements[j].entries.Elements[k].Member;\n                                break;\n                            }\n                        }\n\n                        if (representativeB == null)\n                        {\n                            //There was no representative!  Same idea as above.\n                            //Try the next connection.\n                            continue;\n                        }\n                        //Activate the representative. This must be performed even if no split occurs; connected objects must be activated!\n                        representativeB.Activate();\n\n                        //Try to split the representatives.\n                        //Don't bother doing any deferring; this is a rare activity\n                        //and it's best just to do it up front.\n                        TryToSplit(representativeA, representativeB);\n\n\n                    }\n                }\n            }\n\n\n        }\n\n        ///<summary>\n        /// Adds a simulation island to a member.\n        ///</summary>\n        ///<param name=\"member\">Member to gain a simulation island.</param>\n        ///<exception cref=\"Exception\">Thrown if the member already has a simulation island.</exception>\n        public void AddSimulationIslandToMember(SimulationIslandMember member)\n        {\n            if (member.SimulationIsland != null)\n            {\n                throw new ArgumentException(\"Cannot initialize member's simulation island; it already has one.\");\n            }\n            if (member.connections.Count > 0)\n            {\n                SimulationIsland island = null;\n                //Find a simulation starting island to live in.\n                for (int i = 0; i < member.connections.Count; i++)\n                {\n                    for (int j = 0; j < member.connections.Elements[i].entries.Count; j++)\n                    {\n                        island = member.connections.Elements[i].entries.Elements[j].Member.SimulationIsland;\n                        if (island != null)\n                        {\n                            island.Add(member);\n                            break;\n                        }\n                    }\n                    if (island != null)\n                        break;\n                }\n                if (member.SimulationIsland == null)\n                {\n                    //No non-null entries in any connections.  That's weird.\n                    //Maybe it's connected to a bunch of kinematics, or maybe it's a vehicle-like situation\n                    //where the body is associated with a 'vehicle' connection which sometimes contains only the body.\n\n                    //No friends to merge with.\n                    SimulationIsland newIsland = islandPool.Take();\n                    simulationIslands.Add(newIsland);\n                    newIsland.Add(member);\n                    return;\n                }\n\n\n                //Becoming dynamic adds a new path.\n                //Merges must be attempted between its connected members.\n                for (int i = 0; i < member.connections.Count; i++)\n                {\n                    for (int j = 0; j < member.connections.Elements[i].entries.Count; j++)\n                    {\n                        if (member.connections.Elements[i].entries.Elements[j].Member == member)\n                            continue; //Don't bother trying to compare against ourselves.  That would cause an erroneous early-out sometimes.\n                        SimulationIsland opposingIsland = member.connections.Elements[i].entries.Elements[j].Member.SimulationIsland;\n                        if (opposingIsland != null)\n                        {\n                            if (island != opposingIsland)\n                            {\n                                island = Merge(island, opposingIsland);\n                            }\n                            //All non-null simulation islands in a single connection are guaranteed to be the same island due to previous merges.\n                            //Once we find one, we can stop.\n                            break;\n                        }\n                    }\n                }\n            }\n            else\n            {\n                //No friends to merge with.\n                SimulationIsland newIsland = islandPool.Take();\n                simulationIslands.Add(newIsland);\n                newIsland.Add(member);\n            }\n\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/DeactivationManagement/ISimulationIslandConnection.cs",
    "content": "﻿using System.Collections.ObjectModel;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.DeactivationManagement\n{\n    ///<summary>\n    /// Defines an object which connects simulation islands together.\n    ///</summary>\n    public interface ISimulationIslandConnection\n    {\n        ///<summary>\n        /// Gets or sets the deactivation member that owns this connection.\n        ///</summary>\n        DeactivationManager DeactivationManager { get; set; }\n\n        ///<summary>\n        /// Gets the simulation island members associated with this connection.\n        ///</summary>\n        ReadOnlyList<SimulationIslandMember> ConnectedMembers { get; }\n\n        ///<summary>\n        /// Adds references to the connection to all connected members.\n        ///</summary>\n        void AddReferencesToConnectedMembers();\n\n        ///<summary>\n        /// Removes references to the connection from all connected members.\n        ///</summary>\n        void RemoveReferencesFromConnectedMembers();\n\n        //When connections are modified, simulation island needs to be updated.\n        //Could have a custom collection that shoots off events when it is changed, or otherwise notifies...\n        //But then again, whatever is doing the changing can do the notification without a custom collection.\n        //It would need to call merge/trysplit..  Not everything has the ability to change connections, but some do.\n        //Leave it up to the implementors :)\n\n\n        //When \"Added,\" it attempts to merge the simulation islands of its connected members.\n        //When \"Removed,\" it attempts to split the simulation islands of its connected members.\n\n        //The SimulationIslandConnection is not itself a thing that is added/removed to a set somewhere.\n        //It is a description of some object.  The act of 'adding' a simulation island connection is completed in full by\n        //merging simulation islands and the associated bookkeeping- there does not need to be a list anywhere.\n        //Likewise, removing a simulation island is completed in full by the split attempt.\n\n        //However, whatever is doing the management of things that happen to be ISimulationIslandConnections must know how to deal with them.\n        //(Using the SimulationIsland.Merge, TrySplit methods).\n        //This leaves a lot of responsibility in the implementation's hands.\n        //Maybe this is just fine.  Consider that this isn't exactly a common situation.\n        //Known, in-engine scenarios:\n        //Constraints\n        //Collision Pairs.\n        \n        //When constraints are added or removed to the space (or maybe more directly the solver, to unify with cp's), the merge happens.\n        //When they are removed from the space, the split happens.\n        \n        //All SolverItems are also simulation connections, which is why it makes sense to do it at the solver time.... HOWEVER...\n        //It is possible to have a simulation island connection that isn't a solver item at all.  Think particle collision.\n        //In the particle case, the engine doesn't 'know' anything about the type- it's 100% custom.\n        //The OnAdditionToSpace methods come in handy.  Particle collision says, well, the system won't do it for me since I'm not going to be added to the solver.\n        //So instead, whatever the thing is that handles the 'force application' part of the particle system would perform the necessary simulation island management.\n\n        //Sidenote:  The particle collision system would, in practice, probably just be a Solver item with 1 iteration.\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/DeactivationManagement/ISimulationIslandConnectionOwner.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace BEPUphysics.DeactivationManagement\n{\n    /// <summary>\n    /// Denotes a class which owns a simulation island connection.\n    /// </summary>\n    public interface ISimulationIslandConnectionOwner\n    {\n        /// <summary>\n        /// Gets the connection associated with the object.\n        /// </summary>\n        SimulationIslandConnection SimulationIslandConnection\n        {\n            get;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/DeactivationManagement/ISimulationIslandMemberOwner.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace BEPUphysics.DeactivationManagement\n{\n    /// <summary>\n    /// Defines an object which owns a SimulationIslandMember.\n    /// </summary>\n    public interface ISimulationIslandMemberOwner\n    {\n        /// <summary>\n        /// Gets the simulation island member associated with the object.\n        /// </summary>\n        SimulationIslandMember ActivityInformation { get; }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/DeactivationManagement/SimulationIsland.cs",
    "content": "﻿using System;\nusing System.Threading;\nusing BEPUutilities.DataStructures;\nusing System.Collections.ObjectModel;\n\nnamespace BEPUphysics.DeactivationManagement\n{\n    ///<summary>\n    /// A collection of simulation island members bound together with connections.\n    /// An island is activated and deactivated as a group.\n    ///</summary>\n    public class SimulationIsland\n    {\n        internal SimulationIsland immediateParent;\n\n        internal SimulationIsland Parent\n        {\n            get\n            {\n                return immediateParent == this ? this : immediateParent.Parent;\n            }\n        }\n\n        internal bool allowDeactivation = true;\n        internal bool isActive = true;\n        ///<summary>\n        /// Gets whether or not the island is currently active.\n        ///</summary>\n        public bool IsActive\n        {\n            get\n            {\n                return isActive;\n            }\n            set\n            {\n                isActive = value;\n            }\n        }\n        internal int memberCount;\n\n        /// <summary>\n        /// Gets the number of simulation island members within this simulation island.\n        /// </summary>\n        public int MemberCount\n        {\n            get { return memberCount; }\n        }\n\n        internal int deactivationCandidateCount;\n        /// <summary>\n        /// Gets the number of simulation island members in the simulation island which are prepared to go to sleep.\n        /// </summary>\n        public int DeactivationCandidateCount\n        {\n            get { return deactivationCandidateCount; }\n        }\n\n        ///<summary>\n        /// Constructs a simulation island.\n        ///</summary>\n        public SimulationIsland()\n        {\n            memberActivatedDelegate = MemberActivated;\n            becameDeactivationCandidateDelegate = BecameDeactivationCandidate;\n            becameNonDeactivationCandidateDelegate = BecameNonDeactivationCandidate;\n            CleanUp();\n        }\n\n        Action<SimulationIslandMember> memberActivatedDelegate;\n        void MemberActivated(SimulationIslandMember member)\n        {\n            Activate();\n        }\n\n        Action<SimulationIslandMember> becameDeactivationCandidateDelegate;\n        void BecameDeactivationCandidate(SimulationIslandMember member)\n        {\n            Interlocked.Increment(ref deactivationCandidateCount);\n            //The reason why this does not deactivate when count == members.count is that deactivation candidate count will go up and down in parallel.\n            //The actual deactivation process is not designed to be thread safe.  Perhaps doable, but perhaps not worth the effort.\n        }\n        Action<SimulationIslandMember> becameNonDeactivationCandidateDelegate;\n        void BecameNonDeactivationCandidate(SimulationIslandMember member)\n        {\n            Interlocked.Decrement(ref deactivationCandidateCount);\n        }\n\n        ///<summary>\n        /// Activates the simulation island.\n        ///</summary>\n        public void Activate()\n        {\n            //TODO: CONSIDER ACTIVE ISLAND WITH FORCE-DEACTIVATED MEMBER.  ACTIVATING SIMULATION ISLAND WILL NOT WAKE FORCE-DEACTIVATED MEMBER.  DESIRED?\n            if (!isActive)\n            {\n                isActive = true;\n            }\n        }\n\n\n        ///<summary>\n        /// Attempts to deactivate the simulation island.\n        ///</summary>\n        ///<returns>Whether or not the simulation island was successfully deactivated.</returns>\n        public bool TryToDeactivate()\n        {\n            if (allowDeactivation)\n            {\n                //TODO: Check the deactivation count.  If it's a fully deactivated simulation island, then try to deactivate !:)\n                //DO NOT WORRY ABOUT THREAD SAFETY HERE.\n                //TryToDeactivate will be called sequentially in a 'limited work per frame' scheme.\n                //Avoids load balancing problems and makes implementation easier.\n                if (isActive && deactivationCandidateCount == memberCount)\n                {\n                    isActive = false;\n                    return true;\n                }\n                return false;\n            }\n            else\n            {\n                //Reset the allow deactivation flag so we don't stay inactive forever.\n                allowDeactivation = true;\n                return false;\n            }\n\n        }\n\n        ///<summary>\n        /// Adds a member to the simulation island.\n        ///</summary>\n        ///<param name=\"member\">Member to add.</param>\n        ///<exception cref=\"Exception\">Thrown when the member being added is either non-dynamic or already has a simulation island.</exception>\n        public void Add(SimulationIslandMember member)\n        {\n            //This method is not thread safe.\n            //TODO: Should it wake the island up?\n            if (member.IsDynamic && member.simulationIsland == null)\n            {\n                member.simulationIsland = this;\n                memberCount++;\n                member.Activated += memberActivatedDelegate;\n                member.BecameDeactivationCandidate += becameDeactivationCandidateDelegate;\n                member.BecameNonDeactivationCandidate += becameNonDeactivationCandidateDelegate;\n                if (member.IsDeactivationCandidate)\n                {\n                    deactivationCandidateCount++;\n                }\n            }\n            else\n                throw new ArgumentException(\"Member either is not dynamic or already has a simulation island; cannot add.\");\n        }\n\n        ///<summary>\n        /// Removes a member from the simulation island.\n        ///</summary>\n        ///<param name=\"member\">Member to remove.</param>\n        ///<exception cref=\"Exception\">Thrown when the member does not belong to this simulation island.</exception>\n        public void Remove(SimulationIslandMember member)\n        {\n            //Is this method ever used?  What if old islands are simply cleared and a new one is repopulated instead?\n            //More amenable to UFBRPC approach, probably quicker/simpler overall than removing even with lists\n            //Consider a single block leaving a large island. BFS will quickly find out the necessary information to quickly\n            //remove everything from the old island.\n            //Event handlers will hold references still if not cleaned up via removal...\n\n            //This method is not thread safe.\n            //TODO: Should it wake the island up?\n            if (member.simulationIsland == this)\n            {\n                memberCount--;\n                member.simulationIsland = null;\n                member.Activated -= memberActivatedDelegate;\n                member.BecameDeactivationCandidate -= becameDeactivationCandidateDelegate;\n                member.BecameNonDeactivationCandidate -= becameNonDeactivationCandidateDelegate;\n                if (member.IsDeactivationCandidate)\n                {\n                    deactivationCandidateCount--;\n                }\n            }\n            else\n                throw new ArgumentException(\"Member does not belong to island; cannot remove.\");\n        }\n\n\n\n        internal void CleanUp()\n        {\n            isActive = true;\n            deactivationCandidateCount = 0;\n            memberCount = 0;\n            immediateParent = this;\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/DeactivationManagement/SimulationIslandConnection.cs",
    "content": "﻿using System.Threading;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.DeactivationManagement\n{\n    \n    /// <summary>\n    /// Connects simulation island members together.\n    /// </summary>\n    public class SimulationIslandConnection\n    {\n        /// <summary>\n        /// Stores members and the index at which this connection is located in that member's connections list.\n        /// This allows connections to be removed from members in constant time rather than linear time.\n        /// </summary>\n        internal struct Entry\n        {\n            internal SimulationIslandMember Member;\n            internal int Index;\n        }\n\n        internal RawList<Entry> entries = new RawList<Entry>(2);\n        /// <summary>\n        /// Gets a list of members connected by the connection.\n        /// </summary>\n        public SimulationIslandMemberList Members\n        {\n            get\n            {\n                return new SimulationIslandMemberList(entries);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the owner of the connection.\n        /// </summary>\n        public ISimulationIslandConnectionOwner Owner\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets whether or not this connection is going to be removed\n        /// by the next DeactivationManager stage run.  Connections\n        /// slated for removal should not be considered to be part of\n        /// a member's 'real' connections.\n        /// </summary>\n        public bool SlatedForRemoval { get; internal set; }\n\n\n\n        /// <summary>\n        /// Adds the connection to the connected members.\n        /// </summary>\n        public void AddReferencesToConnectedMembers()\n        {\n            //Add back the references to this to entities\n            for (int i = 0; i < entries.Count; i++)\n            {\n                entries.Elements[i].Index = entries.Elements[i].Member.AddConnectionReference(this);\n            }\n        }\n\n        /// <summary>\n        /// Removes the connection from the connected members.\n        /// </summary>\n        public void RemoveReferencesFromConnectedMembers()\n        {\n            //Clean out the references entities may have had to this solver updateable.\n            for (int i = 0; i < entries.Count; i++)\n            {\n                entries.Elements[i].Member.RemoveConnectionReference(this, entries.Elements[i].Index);\n            }\n        }\n\n        /// <summary>\n        /// Searches the list of members related to this connection and sets the index associated with this connection to the given value.\n        /// </summary>\n        /// <param name=\"member\">Member to change the index for.</param>\n        /// <param name=\"index\">New index of this connection in the member's connections list.</param>\n        internal void SetListIndex(SimulationIslandMember member, int index)\n        {\n            for (int i = 0; i < entries.Count; i++)\n            {\n                if (member == entries.Elements[i].Member)\n                {\n                    entries.Elements[i].Index = index;\n                    break;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the deactivation manager that owns the connection.\n        /// </summary>\n        public DeactivationManager DeactivationManager { get; internal set; }\n\n\n        internal void CleanUp()\n        {\n            SlatedForRemoval = false;\n            entries.Clear();\n            Owner = null;\n            DeactivationManager = null;\n        }\n\n        /// <summary>\n        /// Adds the member to the connection.\n        /// </summary>\n        /// <param name=\"simulationIslandMember\">Member to add.</param>\n        internal void Add(SimulationIslandMember simulationIslandMember)\n        {\n            //Note that the simulation member does not yet know about this connection, so the index is assigned to -1.\n            entries.Add(new Entry { Index = -1, Member = simulationIslandMember });\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/DeactivationManagement/SimulationIslandMember.cs",
    "content": "﻿using System;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.Entities;\n\nnamespace BEPUphysics.DeactivationManagement\n{\n    /// <summary>\n    /// Object owned by an entity which lives in a simulation island.\n    /// Can be considered the entity's deactivation system proxy, just as the CollisionInformation property stores the collision pipeline proxy.\n    /// </summary>\n    public class SimulationIslandMember\n    {\n        //This system could be expanded to allow non-entity simulation island members.\n        //However, there are no such objects on the near horizon, and it is unlikely that anyone will be interested in developing custom simulation island members.\n        Entity owner;\n        float previousVelocity;\n        internal float velocityTimeBelowLimit;\n        internal bool isSlowing;\n\n        /// <summary>\n        /// Gets the entity that owns this simulation island member.\n        /// </summary>\n        public Entity Owner\n        {\n            get\n            {\n                return owner;\n            }\n        }\n\n        internal SimulationIslandMember(Entity owner)\n        {\n            this.owner = owner;\n        }\n\n        internal RawList<SimulationIslandConnection> connections = new RawList<SimulationIslandConnection>(16);\n        ///<summary>\n        /// Gets the connections associated with this member.\n        ///</summary>\n        public ReadOnlyList<SimulationIslandConnection> Connections\n        {\n            get\n            {\n                return new ReadOnlyList<SimulationIslandConnection>(connections);\n            }\n        }\n\n        ///<summary>\n        /// Updates the member's deactivation state.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public void UpdateDeactivationCandidacy(float dt)\n        {\n            //Get total velocity, and see if the entity is losing energy.\n            float velocity = owner.linearVelocity.LengthSquared() + owner.angularVelocity.LengthSquared();\n\n            bool isActive = IsActive;\n            if (isActive)\n            {\n                TryToCompressIslandHierarchy();\n                isSlowing = velocity <= previousVelocity;\n                if (IsDynamic)\n                {\n\n                    //Update time entity's been under the low-velocity limit, or reset if it's not\n                    if (velocity < DeactivationManager.velocityLowerLimitSquared)\n                        velocityTimeBelowLimit += dt;\n                    else\n                        velocityTimeBelowLimit = 0;\n\n                    if (!IsAlwaysActive)\n                    {\n                        if (!isDeactivationCandidate)\n                        {\n                            //See if the velocity has been low long enough to make this object a deactivation candidate.\n                            if (velocityTimeBelowLimit > DeactivationManager.lowVelocityTimeMinimum &&\n                                isSlowing) //Only deactivate if it is NOT increasing in speed.\n                            {\n                                IsDeactivationCandidate = true;\n                            }\n                        }\n                        else\n                        {\n                            //See if velocity is high enough to make this object not a deactivation candidate.\n                            if (velocityTimeBelowLimit <= DeactivationManager.lowVelocityTimeMinimum)\n                            {\n                                IsDeactivationCandidate = false;\n                            }\n                        }\n\n\n                    }\n                    else\n                        IsDeactivationCandidate = false;\n\n\n                }\n                else\n                {\n                    //If it's not dynamic, then deactivation candidacy is based entirely on whether or not the object has velocity (and the IsAlwaysActive state).\n                    IsDeactivationCandidate = velocity == 0 && !IsAlwaysActive;\n\n                    if (IsDeactivationCandidate)\n                    {\n                        //Update the flagging system.\n                        //If time <= 0, the entity is considered active.\n                        //Forcing a kinematic active needs to allow the system to run for a whole frame.\n                        //This means that in here, if it is < 0, we set it to zero.  It will still update for the rest of the frame.\n                        //Then, next frame, when its == 0, set it to 1.  It will be considered inactive unless it was activated manually again.\n                        if (velocityTimeBelowLimit == 0)\n                            velocityTimeBelowLimit = 1;\n                        else if (velocityTimeBelowLimit < 0)\n                            velocityTimeBelowLimit = 0;\n                    }\n                    else\n                    {\n                        //If velocity is not zero, then the flag is set to 'this is active.'\n                        velocityTimeBelowLimit = -1;\n                    }\n\n                    if (velocityTimeBelowLimit <= 0)\n                    {\n                        //There's a single oddity we need to worry about in this case.\n                        //An active kinematic object has no simulation island.  Without intervention,\n                        //an active kinematic object will not keep an island awake.\n                        //To solve this, when we encounter active kinematic objects,\n                        //tell simulation islands associated with connected objects that they aren't allowed to deactivate.\n\n                        for (int i = 0; i < connections.Count; i++)\n                        {\n                            var connectedMembers = connections.Elements[i].entries;\n                            for (int j = connectedMembers.Count - 1; j >= 0; j--)\n                            {\n                                //The change locker must be obtained before attempting to access the SimulationIsland.\n                                //Path compression can force the simulation island to evaluate to null briefly.\n                                //Do not permit the object to undergo path compression during this (brief) operation.\n                                connectedMembers.Elements[j].Member.simulationIslandChangeLocker.Enter();\n                                var island = connectedMembers.Elements[j].Member.SimulationIsland;\n                                if (island != null)\n                                {\n                                    //It's possible a kinematic entity to go inactive for one frame, allowing nearby entities to go to sleep.\n                                    //The next frame, it could wake up again.  Because kinematics do not have simulation islands and thus\n                                    //do not automatically wake up touching dynamic entities, we must do so manually.\n                                    //This is safe because the island.Activate command is a single boolean set.\n                                    //We're also inside the island change locker, so we don't have to worry about the island changing beneath our feet.\n                                    island.Activate();\n                                    island.allowDeactivation = false;\n                                }\n                                connectedMembers.Elements[j].Member.simulationIslandChangeLocker.Exit();\n                            }\n                        }\n                    }\n\n                }\n            }\n            previousVelocity = velocity;\n\n            //These will be 'eventually right.'\n            if (previouslyActive && !isActive)\n                OnDeactivated();\n            else if (!previouslyActive && isActive)\n                OnActivated();\n            previouslyActive = isActive;\n        }\n\n        bool isDeactivationCandidate;\n        ///<summary>\n        /// Gets or sets whether or not the object is a deactivation candidate.\n        ///</summary>\n        public bool IsDeactivationCandidate\n        {\n            get { return isDeactivationCandidate; }\n            private set\n            {\n                if (value && !isDeactivationCandidate)\n                {\n                    isDeactivationCandidate = true;\n                    OnBecameDeactivationCandidate();\n                }\n                else if (!value && isDeactivationCandidate)\n                {\n                    isDeactivationCandidate = false;\n                    OnBecameNonDeactivationCandidate();\n                }\n                if (!value)\n                {\n                    velocityTimeBelowLimit = 0;\n                }\n            }\n        }\n\n        internal BEPUutilities.SpinLock simulationIslandChangeLocker = new BEPUutilities.SpinLock();\n        void TryToCompressIslandHierarchy()\n        {\n\n            var currentSimulationIsland = simulationIsland;\n            if (currentSimulationIsland != null)\n            {\n                if (currentSimulationIsland.immediateParent != currentSimulationIsland)\n                {\n                    //Only remove ourselves from the owning simulation island, not all the way up the chain.\n                    //The change locker must be obtained first to prevent kinematic notifications in the candidacy update \n                    //from attempting to evaluate the SimulationIsland while we are reorganizing things.\n                    simulationIslandChangeLocker.Enter();\n                    lock (currentSimulationIsland)\n                        currentSimulationIsland.Remove(this);\n                    currentSimulationIsland = currentSimulationIsland.Parent;\n                    //Add ourselves to the new owner.\n                    lock (currentSimulationIsland)\n                        currentSimulationIsland.Add(this);\n                    simulationIslandChangeLocker.Exit();\n                    //TODO: Should it activate the new island?  This might avoid a possible corner case.\n                    //It could interfere with the activated event meaningfulness, since that is triggered\n                    //at the end of the update candidacy loop..\n                    //currentSimulationIsland.isActive = true;\n                }\n            }\n        }\n\n        bool previouslyActive = true;\n        ///<summary>\n        /// Gets whether or not the member is active.\n        ///</summary>\n        public bool IsActive\n        {\n            get\n            {\n                var currentSimulationIsland = SimulationIsland;\n                if (currentSimulationIsland != null)\n                {\n                    return currentSimulationIsland.isActive;\n                }\n                else\n                {\n                    //If the simulation island is null,\n                    //then this member has either not been added to a deactivation manager,\n                    //or it is a kinematic entity.\n                    //In either case, using the previous velocity is a reasonable approach.\n                    //This previous velocity is represented here by a flagging system that uses the velocityTimeBelowLimit.\n\n                    //-A kinematic entity with a velocityTimeBelowLimit of -1 was found to be active during the last deactivation candidacy analysis due to its velocity,\n                    //or it was recently activated, or IsAlwaysActive is set to true.\n                    //-A kinematic entity with a velocityTimeBelowLimit of 0 did not have its activity refreshed during the deactivation candidacy, \n                    //but we still consider it active so that a full frame can complete.\n                    //-A kinematic entity with a velocityTimeBelowLimit of 1 did not have its activity refreshed in the last two frames so we can consider it inactive.\n                    return velocityTimeBelowLimit <= 0;\n                }\n            }\n\n        }\n\n        /// <summary>\n        /// Attempts to activate the entity.\n        /// </summary>\n        public void Activate()\n        {\n            //If we're trying to activate, always set the deactivation candidacy to false.  This resets the timer if necessary.\n            IsDeactivationCandidate = false;\n            var currentSimulationIsland = SimulationIsland;\n            if (currentSimulationIsland != null)\n            {\n                //We can force-activate an island.\n                //Note that this does nothing for objects not in a space\n                //or kinematic objects that don't have an island.\n                //\"Activating\" a kinematic object is meaningless- their activity state\n                //is entirely defined by their velocity.\n                currentSimulationIsland.IsActive = true;\n\n            }\n            else\n            {\n                //\"Wake up\" the kinematic entity.\n                //The time is used as a flag.  If time <= 0, that means the object will be considered active until the subsequent update.\n                velocityTimeBelowLimit = -1;\n            }\n\n        }\n\n        bool isAlwaysActive;\n        /// <summary>\n        /// Gets or sets whether or not this member is always active.\n        /// </summary>\n        public bool IsAlwaysActive\n        {\n            get\n            {\n                return isAlwaysActive;\n            }\n            set\n            {\n                isAlwaysActive = value;\n                if (isAlwaysActive)\n                    Activate();\n            }\n        }\n\n\n\n        internal bool allowStabilization = true;\n        /// <summary>\n        /// Gets or sets whether or not the entity can be stabilized by the deactivation system.  This allows systems of objects to go to sleep faster.\n        /// Defaults to true.\n        /// </summary>\n        public bool AllowStabilization\n        {\n            get\n            {\n                return allowStabilization;\n            }\n            set\n            {\n                allowStabilization = value;\n            }\n        }\n\n\n        //simulationisland should hook into the activated event.  If it is fired and the simulation island is inactive, the simulation island should activate.\n        //Obviously only call event if it goes from inactive to active.\n        ///<summary>\n        /// Fired when the object activates.\n        ///</summary>\n        public event Action<SimulationIslandMember> Activated;\n        ///<summary>\n        /// Fired when the object becomes a deactivation candidate.\n        ///</summary>\n        public event Action<SimulationIslandMember> BecameDeactivationCandidate; //semi-horrible name\n        ///<summary>\n        /// Fired when the object is no longer a deactivation candidate.\n        ///</summary>\n        public event Action<SimulationIslandMember> BecameNonDeactivationCandidate; //horrible name\n        ///<summary>\n        /// Fired when the object deactivates.\n        ///</summary>\n        public event Action<SimulationIslandMember> Deactivated;\n\n        protected internal void OnActivated()\n        {\n            if (Activated != null)\n                Activated(this);\n        }\n\n        protected internal void OnBecameDeactivationCandidate()\n        {\n            if (BecameDeactivationCandidate != null)\n                BecameDeactivationCandidate(this);\n        }\n\n        protected internal void OnBecameNonDeactivationCandidate()\n        {\n            if (BecameNonDeactivationCandidate != null)\n                BecameNonDeactivationCandidate(this);\n        }\n\n        protected internal void OnDeactivated()\n        {\n            if (Deactivated != null)\n                Deactivated(this);\n        }\n\n\n        internal SimulationIsland simulationIsland;\n        ///<summary>\n        /// Gets the simulation island that owns this member.\n        ///</summary>\n        public SimulationIsland SimulationIsland\n        {\n            get\n            {\n                return simulationIsland != null ? simulationIsland.Parent : null;\n            }\n            internal set\n            {\n                simulationIsland = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the deactivation manager that is managing this member.\n        /// </summary>\n        public DeactivationManager DeactivationManager { get; internal set; }\n\n        //This is appropriate because it allows kinematic entities, while still technically members (they inherit ISimulationIslandMember), to act as dead-ends.\n        ///<summary>\n        /// Gets whether or not the object is dynamic.\n        /// Non-dynamic members act as dead-ends in connection graphs.\n        ///</summary>\n        public bool IsDynamic\n        {\n            get\n            {\n                return owner.isDynamic;\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the current search state of the simulation island member.  This is used by the simulation island system\n        /// to efficiently split islands.\n        ///</summary>\n        internal SimulationIslandSearchState searchState;\n\n        ///<summary>\n        /// Removes a connection reference from the member.\n        ///</summary>\n        ///<param name=\"connection\">Reference to remove.</param>\n        ///<param name=\"index\">Index of the connection in this member's list</param>\n        internal void RemoveConnectionReference(SimulationIslandConnection connection, int index)\n        {\n            if (connections.Count > index)\n            {\n                connections.FastRemoveAt(index);\n                if (connections.Count > index)\n                    connections.Elements[index].SetListIndex(this, index);\n            }\n        }\n\n        ///<summary>\n        /// Adds a connection reference to the member.\n        ///</summary>\n        ///<param name=\"connection\">Reference to add.</param>\n        ///<returns>Index of the connection in the member's list.</returns>\n        internal int AddConnectionReference(SimulationIslandConnection connection)\n        {\n            connections.Add(connection);\n            return connections.Count - 1;\n        }\n\n\n    }\n\n\n    ///<summary>\n    /// Defines the current state of a simulation island member in a split attempt.\n    ///</summary>\n    public enum SimulationIslandSearchState\n    {\n        Unclaimed,\n        OwnedByFirst,\n        OwnedBySecond\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/DeactivationManagement/SimulationIslandMemberList.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.DeactivationManagement\n{\n    /// <summary>\n    /// Read only list containing the simulation island members associated with a simulation island connection.\n    /// </summary>\n    public struct SimulationIslandMemberList : IList<SimulationIslandMember>\n    {\n        RawList<SimulationIslandConnection.Entry> entries;\n\n        internal SimulationIslandMemberList(RawList<SimulationIslandConnection.Entry> entries)\n        {\n            this.entries = entries;\n        }\n\n        /// <summary>\n        /// Determines the index of a specific item in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.\n        /// </summary>\n        /// <returns>\n        /// The index of <paramref name=\"item\"/> if found in the list; otherwise, -1.\n        /// </returns>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</param>\n        public int IndexOf(SimulationIslandMember item)\n        {\n            return Array.IndexOf(entries.Elements, item, 0, entries.Count);\n        }\n\n        void IList<SimulationIslandMember>.Insert(int index, SimulationIslandMember item)\n        {\n            throw new NotSupportedException(\"The list is read-only.\");\n        }\n\n        void IList<SimulationIslandMember>.RemoveAt(int index)\n        {\n            throw new NotSupportedException(\"The list is read-only.\");\n        }\n\n        /// <summary>\n        /// Gets the element at the specified index.\n        /// </summary>\n        /// <returns>\n        /// The element at the specified index.\n        /// </returns>\n        /// <param name=\"index\">The zero-based index of the element to get or set.</param><exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"index\"/> is not a valid index in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</exception><exception cref=\"T:System.NotSupportedException\">The property is set and the <see cref=\"T:System.Collections.Generic.IList`1\"/> is read-only.</exception>\n        public SimulationIslandMember this[int index]\n        {\n            get\n            {\n                return entries.Elements[index].Member;\n            }\n            set\n            {\n                throw new NotSupportedException(\"The list is read-only.\");\n            }\n        }\n\n        void ICollection<SimulationIslandMember>.Add(SimulationIslandMember item)\n        {\n            throw new NotSupportedException(\"The list is read-only.\");\n        }\n\n        void ICollection<SimulationIslandMember>.Clear()\n        {\n            throw new NotSupportedException(\"The list is read-only.\");\n        }\n\n        /// <summary>\n        /// Determines whether the <see cref=\"T:System.Collections.Generic.ICollection`1\"/> contains a specific value.\n        /// </summary>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> is found in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>; otherwise, false.\n        /// </returns>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param>\n        public bool Contains(SimulationIslandMember item)\n        {\n            return IndexOf(item) > -1;\n        }\n\n        /// <summary>\n        /// Copies the elements of the <see cref=\"T:System.Collections.Generic.ICollection`1\"/> to an <see cref=\"T:System.Array\"/>, starting at a particular <see cref=\"T:System.Array\"/> index.\n        /// </summary>\n        /// <param name=\"array\">The one-dimensional <see cref=\"T:System.Array\"/> that is the destination of the elements copied from <see cref=\"T:System.Collections.Generic.ICollection`1\"/>. The <see cref=\"T:System.Array\"/> must have zero-based indexing.</param>\n        /// <param name=\"arrayIndex\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        public void CopyTo(SimulationIslandMember[] array, int arrayIndex)\n        {\n            for (int i = 0; i < entries.Count; i++)\n            {\n                array[i + arrayIndex] = entries.Elements[i].Member;\n            }\n        }\n\n        /// <summary>\n        /// Gets the number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <returns>\n        /// The number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </returns>\n        public int Count\n        {\n            get { return entries.Count; }\n        }\n\n        bool ICollection<SimulationIslandMember>.IsReadOnly\n        {\n            get { return true; }\n        }\n\n        bool ICollection<SimulationIslandMember>.Remove(SimulationIslandMember item)\n        {\n            throw new NotSupportedException(\"The list is read-only.\");\n        }\n\n        public IEnumerator<SimulationIslandMember> GetEnumerator()\n        {\n            return new Enumerator(entries);\n        }\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return new Enumerator(entries);\n        }\n\n        /// <summary>\n        /// Enumerators the simulation island members in the member list.\n        /// </summary>\n        public struct Enumerator : IEnumerator<SimulationIslandMember>\n        {\n            private RawList<SimulationIslandConnection.Entry> entries;\n            private int index;\n\n            internal Enumerator(RawList<SimulationIslandConnection.Entry> entries)\n            {\n                this.entries = entries;\n                index = -1;\n            }\n\n            /// <summary>\n            /// Gets the element in the collection at the current position of the enumerator.\n            /// </summary>\n            /// <returns>\n            /// The element in the collection at the current position of the enumerator.\n            /// </returns>\n            public SimulationIslandMember Current\n            {\n                get { return entries.Elements[index].Member; }\n            }\n\n            /// <summary>\n            /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n            /// </summary>\n            /// <filterpriority>2</filterpriority>\n            public void Dispose()\n            {\n            }\n\n            /// <summary>\n            /// Gets the current element in the collection.\n            /// </summary>\n            /// <returns>\n            /// The current element in the collection.\n            /// </returns>\n            /// <exception cref=\"T:System.InvalidOperationException\">The enumerator is positioned before the first element of the collection or after the last element.</exception><filterpriority>2</filterpriority>\n            object System.Collections.IEnumerator.Current\n            {\n                get { return Current; }\n            }\n\n            /// <summary>\n            /// Advances the enumerator to the next element of the collection.\n            /// </summary>\n            /// <returns>\n            /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n            /// </returns>\n            /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n            public bool MoveNext()\n            {\n                index++;\n                return index >= entries.Count;\n            }\n\n            /// <summary>\n            /// Sets the enumerator to its initial position, which is before the first element in the collection.\n            /// </summary>\n            /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n            public void Reset()\n            {\n                index = -1;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Entities/Entity.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Entities\n{\n    ///<summary>\n    /// Superclass of all entities which have a defined collidable type.\n    /// After construction, the collidable on this sort of Entity cannot be changed.\n    /// It can be constructed directly, or one of its prefab children (Box, Sphere, etc.) can be used.\n    ///</summary>\n    /// <remarks>If the collidable needs to be changed after construction, consider using the MorphableEntity.</remarks>\n    ///<typeparam name=\"T\">Type of EntityCollidable to use for the entity.</typeparam>\n    public class Entity<T> : Entity where T : EntityCollidable\n    {\n        ///<summary>\n        /// Gets the collidable used by the entity.\n        ///</summary>\n        public new T CollisionInformation\n        {\n            get { return (T)collisionInformation; }\n        }\n\n        protected internal Entity()\n        {\n\n        }\n\n        ///<summary>\n        /// Constructs a kinematic Entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable for the entity.</param>\n        public Entity(T collisionInformation)\n        {\n            Initialize(collisionInformation);\n        }\n\n\n        ///<summary>\n        /// Constructs a dynamic Entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable for the entity.</param>\n        /// <param name=\"mass\">Mass of the entity.</param>\n        public Entity(T collisionInformation, float mass)\n        {\n            Initialize(collisionInformation, mass);\n        }\n        ///<summary>\n        /// Constructs a dynamic Entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable for the entity.</param>\n        /// <param name=\"mass\">Mass of the entity.</param>\n        /// <param name=\"inertiaTensor\">Inertia of the entity.</param>\n        public Entity(T collisionInformation, float mass, Matrix3x3 inertiaTensor)\n        {\n            Initialize(collisionInformation, mass, inertiaTensor);\n        }\n\n        ///<summary>\n        /// Constructs a dynamic Entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable for the entity.</param>\n        /// <param name=\"mass\">Mass of the entity.</param>\n        /// <param name=\"inertiaTensor\">Inertia of the entity.</param>\n        /// <param name=\"volume\">Volume of the entity.</param>\n        public Entity(T collisionInformation, float mass, Matrix3x3 inertiaTensor, float volume)\n        {\n            Initialize(collisionInformation, mass, inertiaTensor, volume);\n        }\n\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Entities/EntityBase.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUphysics.DeactivationManagement;\nusing BEPUphysics.EntityStateManagement;\nusing BEPUphysics.OtherSpaceStages;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\nusing BEPUphysics.Materials;\nusing BEPUphysics.CollisionShapes;\nusing BEPUphysics.CollisionRuleManagement;\nusing MathChecker = BEPUutilities.MathChecker;\n\nnamespace BEPUphysics.Entities\n{\n    ///<summary>\n    /// Superclass of movable rigid bodies.  Contains information for\n    /// both dynamic and kinematic simulation.\n    ///</summary>\n    public class Entity :\n        IBroadPhaseEntryOwner,\n        IDeferredEventCreatorOwner,\n        ISimulationIslandMemberOwner,\n        ICCDPositionUpdateable,\n        IForceUpdateable,\n        ISpaceObject,\n        IMaterialOwner,\n        ICollisionRulesOwner\n    {\n        internal Vector3 position;\n        internal Quaternion orientation = Quaternion.Identity;\n        internal Matrix3x3 orientationMatrix = Matrix3x3.Identity;\n        internal Vector3 linearVelocity;\n        internal Vector3 linearMomentum;\n        internal Vector3 angularVelocity;\n        internal Vector3 angularMomentum;\n        internal bool isDynamic;\n\n\n\n        ///<summary>\n        /// Gets or sets the position of the Entity.  This Position acts\n        /// as the center of mass for dynamic entities.\n        ///</summary>\n        public Vector3 Position\n        {\n            get\n            {\n                return position;\n            }\n            set\n            {\n                position = value;\n                activityInformation.Activate();\n\n                MathChecker.Validate(position);\n            }\n        }\n        ///<summary>\n        /// Gets or sets the orientation quaternion of the entity.\n        ///</summary>\n        public Quaternion Orientation\n        {\n            get\n            {\n                return orientation;\n            }\n            set\n            {\n                Quaternion.Normalize(ref value, out orientation);\n                Matrix3x3.CreateFromQuaternion(ref orientation, out orientationMatrix);\n                //Update inertia tensors for consistency.\n                Matrix3x3 multiplied;\n                Matrix3x3.MultiplyTransposed(ref orientationMatrix, ref localInertiaTensorInverse, out multiplied);\n                Matrix3x3.Multiply(ref multiplied, ref orientationMatrix, out inertiaTensorInverse);\n                Matrix3x3.MultiplyTransposed(ref orientationMatrix, ref localInertiaTensor, out multiplied);\n                Matrix3x3.Multiply(ref multiplied, ref orientationMatrix, out inertiaTensor);\n                activityInformation.Activate();\n\n                MathChecker.Validate(orientation);\n            }\n        }\n        /// <summary>\n        /// Gets or sets the orientation matrix of the entity.\n        /// </summary>\n        public Matrix3x3 OrientationMatrix\n        {\n            get\n            {\n                return orientationMatrix;\n            }\n            set\n            {\n                Matrix3x3.CreateQuaternion(ref value, out orientation);\n                Orientation = orientation; //normalizes and sets.\n            }\n        }\n        ///<summary>\n        /// Gets or sets the world transform of the entity.\n        /// The upper left 3x3 part is the Orientation, and the translation is the Position.\n        /// When setting this property, ensure that the rotation matrix component does not include\n        /// any scaling or shearing.\n        ///</summary>\n        public Matrix WorldTransform\n        {\n            get\n            {\n                Matrix worldTransform;\n                Matrix3x3.ToMatrix4X4(ref orientationMatrix, out worldTransform);\n                worldTransform.Translation = position;\n                return worldTransform;\n            }\n            set\n            {\n                Quaternion.CreateFromRotationMatrix(ref value, out orientation);\n                Orientation = orientation; //normalizes and sets.\n                position = value.Translation;\n                activityInformation.Activate();\n\n                MathChecker.Validate(position);\n            }\n\n        }\n        /// <summary>\n        /// Gets or sets the angular velocity of the entity.\n        /// </summary>\n        public Vector3 AngularVelocity\n        {\n            get\n            {\n                return angularVelocity;\n            }\n            set\n            {\n                angularVelocity = value;\n                Matrix3x3.Transform(ref value, ref inertiaTensor, out angularMomentum);\n                activityInformation.Activate();\n\n                MathChecker.Validate(angularVelocity);\n                MathChecker.Validate(angularMomentum);\n            }\n        }\n        /// <summary>\n        /// Gets or sets the angular momentum of the entity.\n        /// </summary>\n        public Vector3 AngularMomentum\n        {\n            get\n            {\n                if (MotionSettings.ConserveAngularMomentum)\n                    return angularMomentum;\n                else\n                {\n                    Vector3 v;\n                    Matrix3x3.Transform(ref angularVelocity, ref inertiaTensor, out v);\n                    return v;\n                }\n            }\n            set\n            {\n                angularMomentum = value;\n                Matrix3x3.Transform(ref value, ref inertiaTensorInverse, out angularVelocity);\n                activityInformation.Activate();\n\n                MathChecker.Validate(angularVelocity);\n                MathChecker.Validate(angularMomentum);\n            }\n        }\n        /// <summary>\n        /// Gets or sets the linear velocity of the entity.\n        /// </summary>\n        public Vector3 LinearVelocity\n        {\n            get\n            {\n                return linearVelocity;\n            }\n            set\n            {\n                linearVelocity = value;\n                Vector3.Multiply(ref linearVelocity, mass, out linearMomentum);\n                activityInformation.Activate();\n\n                MathChecker.Validate(linearVelocity);\n                MathChecker.Validate(linearMomentum);\n            }\n        }\n        /// <summary>\n        /// Gets or sets the linear momentum of the entity.\n        /// </summary>\n        public Vector3 LinearMomentum\n        {\n            get\n            {\n                return linearMomentum;\n            }\n            set\n            {\n                linearMomentum = value;\n                Vector3.Multiply(ref linearMomentum, inverseMass, out linearVelocity);\n                activityInformation.Activate();\n\n                MathChecker.Validate(linearVelocity);\n                MathChecker.Validate(linearMomentum);\n            }\n        }\n        /// <summary>\n        /// Gets or sets the position, orientation, linear velocity, and angular velocity of the entity.\n        /// </summary>\n        public MotionState MotionState\n        {\n            get\n            {\n                MotionState toReturn;\n                toReturn.Position = position;\n                toReturn.Orientation = orientation;\n                toReturn.LinearVelocity = linearVelocity;\n                toReturn.AngularVelocity = angularVelocity;\n                return toReturn;\n            }\n            set\n            {\n                Position = value.Position;\n                Orientation = value.Orientation;\n                LinearVelocity = value.LinearVelocity;\n                AngularVelocity = value.AngularVelocity;\n            }\n        }\n\n        /// <summary>\n        /// Gets whether or not the entity is dynamic.\n        /// Dynamic entities have finite mass and respond\n        /// to collisions.  Kinematic (non-dynamic) entities\n        /// have infinite mass and inertia and will plow through anything.\n        /// </summary>\n        public bool IsDynamic\n        {\n            get\n            {\n                return isDynamic;\n            }\n        }\n\n\n\n        bool isAffectedByGravity = true;\n        ///<summary>\n        /// Gets or sets whether or not the entity can be affected by gravity applied by the ForceUpdater.\n        ///</summary>\n        public bool IsAffectedByGravity\n        {\n            get\n            {\n                return isAffectedByGravity;\n            }\n            set\n            {\n                isAffectedByGravity = value;\n            }\n        }\n\n        ///<summary>\n        /// Gets the buffered states of the entity.  If the Space.BufferedStates manager is enabled,\n        /// this property provides access to the buffered and interpolated states of the entity.\n        /// Buffered states are the most recent completed update values, while interpolated states are the previous values blended\n        /// with the current frame's values.  Interpolated states are helpful when updating the engine with internal time stepping, \n        /// giving entity motion a smooth appearance even when updates aren't occurring consistently every frame.  \n        /// Both are buffered for asynchronous access.\n        ///</summary>\n        public EntityBufferedStates BufferedStates { get; private set; }\n\n        internal Matrix3x3 inertiaTensorInverse;\n        ///<summary>\n        /// Gets the world space inertia tensor inverse of the entity.\n        ///</summary>\n        public Matrix3x3 InertiaTensorInverse\n        {\n            get\n            {\n                return inertiaTensorInverse;\n            }\n        }\n        internal Matrix3x3 inertiaTensor;\n        ///<summary>\n        /// Gets the world space inertia tensor of the entity.\n        ///</summary>\n        public Matrix3x3 InertiaTensor\n        {\n            get { return inertiaTensor; }\n        }\n\n        internal Matrix3x3 localInertiaTensor;\n        ///<summary>\n        /// Gets or sets the local inertia tensor of the entity.\n        ///</summary>\n        public Matrix3x3 LocalInertiaTensor\n        {\n            get\n            {\n                return localInertiaTensor;\n            }\n            set\n            {\n                localInertiaTensor = value;\n                Matrix3x3.AdaptiveInvert(ref localInertiaTensor, out localInertiaTensorInverse);\n                Matrix3x3 multiplied;\n                Matrix3x3.MultiplyTransposed(ref orientationMatrix, ref localInertiaTensorInverse, out multiplied);\n                Matrix3x3.Multiply(ref multiplied, ref orientationMatrix, out inertiaTensorInverse);\n                Matrix3x3.MultiplyTransposed(ref orientationMatrix, ref localInertiaTensor, out multiplied);\n                Matrix3x3.Multiply(ref multiplied, ref orientationMatrix, out inertiaTensor);\n\n                localInertiaTensor.Validate();\n                localInertiaTensorInverse.Validate();\n            }\n        }\n        internal Matrix3x3 localInertiaTensorInverse;\n        /// <summary>\n        /// Gets or sets the local inertia tensor inverse of the entity.\n        /// </summary>\n        public Matrix3x3 LocalInertiaTensorInverse\n        {\n            get\n            {\n                return localInertiaTensorInverse;\n            }\n            set\n            {\n                localInertiaTensorInverse = value;\n                Matrix3x3.AdaptiveInvert(ref localInertiaTensorInverse, out localInertiaTensor);\n                //Update the world space versions.\n                Matrix3x3 multiplied;\n                Matrix3x3.MultiplyTransposed(ref orientationMatrix, ref localInertiaTensorInverse, out multiplied);\n                Matrix3x3.Multiply(ref multiplied, ref orientationMatrix, out inertiaTensorInverse);\n                Matrix3x3.MultiplyTransposed(ref orientationMatrix, ref localInertiaTensor, out multiplied);\n                Matrix3x3.Multiply(ref multiplied, ref orientationMatrix, out inertiaTensor);\n\n                localInertiaTensor.Validate();\n                localInertiaTensorInverse.Validate();\n            }\n        }\n\n        internal float mass;\n        ///<summary>\n        /// Gets or sets the mass of the entity.  Setting this to an invalid value, such as a non-positive number, NaN, or infinity, makes the entity kinematic.\n        /// Setting it to a valid positive number will also scale the inertia tensor if it was already dynamic, or force the calculation of a new inertia tensor\n        /// if it was previously kinematic.\n        ///</summary>\n        public float Mass\n        {\n            get\n            {\n                return mass;\n            }\n            set\n            {\n                if (value <= 0 || float.IsNaN(value) || float.IsInfinity(value))\n                    BecomeKinematic();\n                else\n                {\n                    if (isDynamic)\n                    {\n                        //If it's already dynamic, then we don't need to recompute the inertia tensor.\n                        //Instead, scale the one we have already.\n                        Matrix3x3 newInertia;\n                        Matrix3x3.Multiply(ref localInertiaTensor, value * inverseMass, out newInertia);\n                        BecomeDynamic(value, newInertia);\n                    }\n                    else\n                    {\n                        BecomeDynamic(value);\n                    }\n                }\n            }\n        }\n\n        internal float inverseMass;\n        /// <summary>\n        /// Gets or sets the inverse mass of the entity.\n        /// </summary>\n        public float InverseMass\n        {\n            get\n            {\n                return inverseMass;\n            }\n            set\n            {\n                if (value > 0)\n                    Mass = 1 / value;\n                else\n                    Mass = 0;\n            }\n        }\n\n\n        internal float volume;\n        /// <summary>\n        /// Gets the volume of the entity.\n        /// This is computed along with other physical properties at initialization,\n        /// but it's only used for auxiliary systems like the FluidVolume.\n        /// </summary>\n        public float Volume { get { return volume; } }\n\n\n\n        ///<summary>\n        /// Fires when the entity's position and orientation is updated.\n        ///</summary>\n        public event Action<Entity> PositionUpdated;\n\n\n\n        protected EntityCollidable collisionInformation;\n        ///<summary>\n        /// Gets the collidable used by the entity.\n        ///</summary>\n        public EntityCollidable CollisionInformation\n        {\n            get { return collisionInformation; }\n            protected set\n            {\n                if (collisionInformation != null)\n                    collisionInformation.Shape.ShapeChanged -= shapeChangedDelegate;\n                collisionInformation = value;\n                if (collisionInformation != null)\n                    collisionInformation.Shape.ShapeChanged += shapeChangedDelegate;\n                //Entity constructors do their own initialization when the collision information changes.\n                //Might be able to condense it up here, but don't really need it right now.\n                //ShapeChangedHandler(collisionInformation.shape);\n            }\n        }\n\n        //protected internal object locker = new object();\n        /////<summary>\n        ///// Gets the synchronization object used by systems that need\n        ///// exclusive access to the entity's properties.\n        /////</summary>\n        //public object Locker\n        //{\n        //    get\n        //    {\n        //        return locker;\n        //    }\n        //}\n\n        protected internal SpinLock locker = new SpinLock();\n        ///<summary>\n        /// Gets the synchronization object used by systems that need\n        /// exclusive access to the entity's properties.\n        ///</summary>\n        public SpinLock Locker\n        {\n            get\n            {\n                return locker;\n            }\n        }\n\n        internal Material material;\n        //NOT thread safe due to material change pair update.\n        ///<summary>\n        /// Gets or sets the material used by the entity.\n        ///</summary>\n        public Material Material\n        {\n            get\n            {\n                return material;\n            }\n            set\n            {\n                if (material != null)\n                    material.MaterialChanged -= materialChangedDelegate;\n                material = value;\n                if (material != null)\n                    material.MaterialChanged += materialChangedDelegate;\n                OnMaterialChanged(material);\n            }\n        }\n\n        Action<Material> materialChangedDelegate;\n        void OnMaterialChanged(Material newMaterial)\n        {\n            for (int i = 0; i < collisionInformation.pairs.Count; i++)\n            {\n                collisionInformation.pairs[i].UpdateMaterialProperties();\n            }\n        }\n\n\n        ///<summary>\n        /// Gets all the EntitySolverUpdateables associated with this entity.\n        ///</summary>\n        public EntitySolverUpdateableCollection SolverUpdateables\n        {\n            get\n            {\n                return new EntitySolverUpdateableCollection(activityInformation.connections);\n            }\n        }\n\n        ///<summary>\n        /// Gets the two-entity constraints associated with this entity (a subset of the solver updateables).\n        ///</summary>\n        public EntityConstraintCollection Constraints\n        {\n            get\n            {\n                return new EntityConstraintCollection(activityInformation.connections);\n            }\n        }\n\n        #region Construction\n\n        protected Entity()\n        {\n            InitializeId();\n\n            BufferedStates = new EntityBufferedStates(this);\n\n            material = new Material();\n            materialChangedDelegate = OnMaterialChanged;\n            material.MaterialChanged += materialChangedDelegate;\n\n            shapeChangedDelegate = OnShapeChanged;\n\n            activityInformation = new SimulationIslandMember(this);\n\n\n        }\n\n        ///<summary>\n        /// Constructs a new kinematic entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable to use with the entity.</param>\n        public Entity(EntityCollidable collisionInformation)\n            : this()\n        {\n            Initialize(collisionInformation);\n        }\n\n        ///<summary>\n        /// Constructs a new entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity. If positive, the entity will be dynamic. Otherwise, it will be kinematic.</param>\n        public Entity(EntityCollidable collisionInformation, float mass)\n            : this()\n        {\n            Initialize(collisionInformation, mass);\n        }\n\n        ///<summary>\n        /// Constructs a new entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity. If positive, the entity will be dynamic. Otherwise, it will be kinematic.</param>\n        /// <param name=\"inertiaTensor\">Inertia tensor of the entity. Only used for a dynamic entity.</param>\n        public Entity(EntityCollidable collisionInformation, float mass, Matrix3x3 inertiaTensor)\n            : this()\n        {\n            Initialize(collisionInformation, mass, inertiaTensor);\n        }\n        ///<summary>\n        /// Constructs a new entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity. If positive, the entity will be dynamic. Otherwise, it will be kinematic.</param>\n        /// <param name=\"inertiaTensor\">Inertia tensor of the entity. Only used for a dynamic entity.</param>\n        /// <param name=\"volume\">Volume of the entity.</param>\n        public Entity(EntityCollidable collisionInformation, float mass, Matrix3x3 inertiaTensor, float volume)\n            : this()\n        {\n            Initialize(collisionInformation, mass, inertiaTensor, volume);\n        }\n\n        ///<summary>\n        /// Constructs a new kinematic entity.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use with the entity.</param>\n        public Entity(EntityShape shape)\n            : this()\n        {\n            Initialize(shape.GetCollidableInstance());\n        }\n\n        ///<summary>\n        /// Constructs a new entity.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity. If positive, the entity will be dynamic. Otherwise, it will be kinematic.</param>\n        public Entity(EntityShape shape, float mass)\n            : this()\n        {\n            Initialize(shape.GetCollidableInstance(), mass);\n        }\n\n        ///<summary>\n        /// Constructs a new entity.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity. If positive, the entity will be dynamic. Otherwise, it will be kinematic.</param>\n        /// <param name=\"inertiaTensor\">Inertia tensor of the entity. Only used for a dynamic entity.</param>\n        public Entity(EntityShape shape, float mass, Matrix3x3 inertiaTensor)\n            : this()\n        {\n            Initialize(shape.GetCollidableInstance(), mass, inertiaTensor);\n        }\n\n        ///<summary>\n        /// Constructs a new entity.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity. If positive, the entity will be dynamic. Otherwise, it will be kinematic.</param>\n        /// <param name=\"inertiaTensor\">Inertia tensor of the entity. Only used for a dynamic entity.</param>\n        /// <param name=\"volume\">Volume of the entity.</param>\n        public Entity(EntityShape shape, float mass, Matrix3x3 inertiaTensor, float volume)\n            : this()\n        {\n            Initialize(shape.GetCollidableInstance(), mass, inertiaTensor, volume);\n        }\n\n\n\n\n        //These initialize methods make it easier to construct some Entity prefab types.\n        protected internal void Initialize(EntityCollidable collisionInformation)\n        {\n            CollisionInformation = collisionInformation;\n            BecomeKinematic();\n            collisionInformation.Entity = this;\n        }\n\n        protected internal void Initialize(EntityCollidable collisionInformation, float mass)\n        {\n            CollisionInformation = collisionInformation;\n\n            if (mass > 0)\n            {\n                ShapeDistributionInformation shapeInfo;\n                collisionInformation.Shape.ComputeDistributionInformation(out shapeInfo);\n                Matrix3x3.Multiply(ref shapeInfo.VolumeDistribution, mass * InertiaHelper.InertiaTensorScale, out shapeInfo.VolumeDistribution);\n\n                volume = shapeInfo.Volume;\n\n                BecomeDynamic(mass, shapeInfo.VolumeDistribution);\n            }\n            else\n            {\n                volume = collisionInformation.Shape.ComputeVolume();\n                BecomeKinematic();\n            }\n\n            collisionInformation.Entity = this;\n        }\n\n        protected internal void Initialize(EntityCollidable collisionInformation, float mass, Matrix3x3 inertiaTensor)\n        {\n            CollisionInformation = collisionInformation;\n\n            volume = collisionInformation.Shape.ComputeVolume();\n\n            if (mass > 0)\n                BecomeDynamic(mass, inertiaTensor);\n            else\n                BecomeKinematic();\n\n            collisionInformation.Entity = this;\n        }\n\n        protected internal void Initialize(EntityCollidable collisionInformation, float mass, Matrix3x3 inertiaTensor, float volume)\n        {\n            CollisionInformation = collisionInformation;\n            this.volume = volume;\n            if (mass > 0)\n                BecomeDynamic(mass, inertiaTensor);\n            else\n                BecomeKinematic();\n\n            collisionInformation.Entity = this;\n        }\n\n        #endregion\n\n        #region IDeferredEventCreatorOwner Members\n\n        IDeferredEventCreator IDeferredEventCreatorOwner.EventCreator\n        {\n            get { return CollisionInformation.Events; }\n        }\n\n        #endregion\n\n        internal SimulationIslandMember activityInformation;\n        public SimulationIslandMember ActivityInformation\n        {\n            get\n            {\n                return activityInformation;\n            }\n        }\n\n        bool IForceUpdateable.IsActive\n        {\n            get\n            {\n                return activityInformation.IsActive;\n            }\n        }\n        bool IPositionUpdateable.IsActive\n        {\n            get\n            {\n                return activityInformation.IsActive;\n            }\n        }\n\n\n\n        ///<summary>\n        /// Applies an impulse to the entity.\n        ///</summary>\n        ///<param name=\"location\">Location to apply the impulse.</param>\n        ///<param name=\"impulse\">Impulse to apply.</param>\n        public void ApplyImpulse(Vector3 location, Vector3 impulse)\n        {\n            ApplyImpulse(ref location, ref impulse);\n        }\n\n        ///<summary>\n        /// Applies an impulse to the entity.\n        ///</summary>\n        ///<param name=\"location\">Location to apply the impulse.</param>\n        ///<param name=\"impulse\">Impulse to apply.</param>\n        public void ApplyImpulse(ref Vector3 location, ref Vector3 impulse)\n        {\n            if (isDynamic)\n            {\n                ApplyLinearImpulse(ref impulse);\n#if WINDOWS\n                Vector3 positionDifference;\n#else\n                Vector3 positionDifference = new Vector3();\n#endif\n                positionDifference.X = location.X - position.X;\n                positionDifference.Y = location.Y - position.Y;\n                positionDifference.Z = location.Z - position.Z;\n\n                Vector3 cross;\n                Vector3.Cross(ref positionDifference, ref impulse, out cross);\n                ApplyAngularImpulse(ref cross);\n\n                activityInformation.Activate();\n            }\n        }\n\n        //These methods are very direct and quick.  They don't activate the object or anything.\n        /// <summary>\n        /// Applies a linear velocity change to the entity using the given impulse.\n        /// This method does not wake up the object or perform any other nonessential operation;\n        /// it is meant to be used for performance-sensitive constraint solving.\n        /// Consider equivalently adding to the LinearMomentum property for convenience instead.\n        /// </summary>\n        /// <param name=\"impulse\">Impulse to apply.</param>\n        public void ApplyLinearImpulse(ref Vector3 impulse)\n        {\n#if WINDOWS_PHONE\n            //Some XNA math methods support SIMD on the phone.\n            //This would most likely be inlined on the PC anyway, but the XBOX360 is a questionmark.\n            //Just inline those platforms manually.\n            Vector3.Add(ref linearMomentum, ref impulse, out linearMomentum);\n            Vector3.Multiply(ref linearMomentum, inverseMass, out linearVelocity);\n#else\n            linearMomentum.X += impulse.X;\n            linearMomentum.Y += impulse.Y;\n            linearMomentum.Z += impulse.Z;\n            linearVelocity.X = linearMomentum.X * inverseMass;\n            linearVelocity.Y = linearMomentum.Y * inverseMass;\n            linearVelocity.Z = linearMomentum.Z * inverseMass;\n#endif\n            MathChecker.Validate(linearVelocity);\n            MathChecker.Validate(linearMomentum);\n\n        }\n        /// <summary>\n        /// Applies an angular velocity change to the entity using the given impulse.\n        /// This method does not wake up the object or perform any other nonessential operation;\n        /// it is meant to be used for performance-sensitive constraint solving.\n        /// Consider equivalently adding to the AngularMomentum property for convenience instead.\n        /// </summary>\n        /// <param name=\"impulse\">Impulse to apply.</param>\n        public void ApplyAngularImpulse(ref Vector3 impulse)\n        {\n            //There's some room here for SIMD-friendliness.  However, since the phone doesn't accelerate non-XNA types, the matrix3x3 operations don't gain much.\n            angularMomentum.X += impulse.X;\n            angularMomentum.Y += impulse.Y;\n            angularMomentum.Z += impulse.Z;\n            if (MotionSettings.ConserveAngularMomentum)\n            {\n                angularVelocity.X = angularMomentum.X * inertiaTensorInverse.M11 + angularMomentum.Y * inertiaTensorInverse.M21 + angularMomentum.Z * inertiaTensorInverse.M31;\n                angularVelocity.Y = angularMomentum.X * inertiaTensorInverse.M12 + angularMomentum.Y * inertiaTensorInverse.M22 + angularMomentum.Z * inertiaTensorInverse.M32;\n                angularVelocity.Z = angularMomentum.X * inertiaTensorInverse.M13 + angularMomentum.Y * inertiaTensorInverse.M23 + angularMomentum.Z * inertiaTensorInverse.M33;\n            }\n            else\n            {\n                angularVelocity.X += impulse.X * inertiaTensorInverse.M11 + impulse.Y * inertiaTensorInverse.M21 + impulse.Z * inertiaTensorInverse.M31;\n                angularVelocity.Y += impulse.X * inertiaTensorInverse.M12 + impulse.Y * inertiaTensorInverse.M22 + impulse.Z * inertiaTensorInverse.M32;\n                angularVelocity.Z += impulse.X * inertiaTensorInverse.M13 + impulse.Y * inertiaTensorInverse.M23 + impulse.Z * inertiaTensorInverse.M33;\n            }\n\n            MathChecker.Validate(angularVelocity);\n            MathChecker.Validate(angularMomentum);\n        }\n\n        /// <summary>\n        /// Gets or sets whether or not to ignore shape changes.  When true, changing the entity's collision shape will not update the volume, density, or inertia tensor. \n        /// </summary>\n        public bool IgnoreShapeChanges { get; set; }\n\n        Action<CollisionShape> shapeChangedDelegate;\n        protected void OnShapeChanged(CollisionShape shape)\n        {\n            if (!IgnoreShapeChanges)\n            {\n                //When the shape changes, force the entity awake so that it performs any necessary updates.\n                activityInformation.Activate();\n                ShapeDistributionInformation shapeInfo;\n                collisionInformation.Shape.ComputeDistributionInformation(out shapeInfo);\n                volume = shapeInfo.Volume;\n                if (isDynamic)\n                {\n                    Matrix3x3.Multiply(ref shapeInfo.VolumeDistribution, InertiaHelper.InertiaTensorScale * mass, out shapeInfo.VolumeDistribution);\n                    LocalInertiaTensor = shapeInfo.VolumeDistribution;\n                }\n                else\n                {\n                    LocalInertiaTensorInverse = new Matrix3x3();\n                }\n            }\n        }\n\n\n        //TODO: Include warnings about multithreading.  These modify things outside of the entity and use single-thread-only helpers.\n        ///<summary>\n        /// Forces the entity to become kinematic.  Kinematic entities have infinite mass and inertia.\n        ///</summary>\n        public void BecomeKinematic()\n        {\n            bool previousState = isDynamic;\n            isDynamic = false;\n            LocalInertiaTensorInverse = new Matrix3x3();\n            mass = 0;\n            inverseMass = 0;\n\n            //Notify simulation island of the change.\n            if (previousState)\n            {\n                if (activityInformation.DeactivationManager != null)\n                    activityInformation.DeactivationManager.RemoveSimulationIslandFromMember(activityInformation);\n\n                if (((IForceUpdateable)this).ForceUpdater != null)\n                    ((IForceUpdateable)this).ForceUpdater.ForceUpdateableBecomingKinematic(this);\n            }\n            //Change the collision group if it was using the default.\n            if (collisionInformation.CollisionRules.Group == CollisionRules.DefaultDynamicCollisionGroup ||\n                collisionInformation.CollisionRules.Group == null)\n                collisionInformation.CollisionRules.Group = CollisionRules.DefaultKinematicCollisionGroup;\n\n            activityInformation.Activate();\n\n            //Preserve velocity and reinitialize momentum for new state.\n            LinearVelocity = linearVelocity;\n            AngularVelocity = angularVelocity;\n        }\n\n\n        ///<summary>\n        /// Forces the entity to become dynamic.  Dynamic entities respond to collisions and have finite mass and inertia.\n        ///</summary>\n        ///<param name=\"mass\">Mass to use for the entity.</param>\n        public void BecomeDynamic(float mass)\n        {\n            Matrix3x3 inertiaTensor = collisionInformation.Shape.ComputeVolumeDistribution();\n            Matrix3x3.Multiply(ref inertiaTensor, mass * InertiaHelper.InertiaTensorScale, out inertiaTensor);\n            BecomeDynamic(mass, inertiaTensor);\n        }\n\n        ///<summary>\n        /// Forces the entity to become dynamic.  Dynamic entities respond to collisions and have finite mass and inertia.\n        ///</summary>\n        ///<param name=\"mass\">Mass to use for the entity.</param>\n        /// <param name=\"localInertiaTensor\">Inertia tensor to use for the entity.</param>\n        public void BecomeDynamic(float mass, Matrix3x3 localInertiaTensor)\n        {\n            if (mass <= 0 || float.IsInfinity(mass) || float.IsNaN(mass))\n                throw new InvalidOperationException(\"Cannot use a mass of \" + mass + \" for a dynamic entity.  Consider using a kinematic entity instead.\");\n            bool previousState = isDynamic;\n            isDynamic = true;\n            LocalInertiaTensor = localInertiaTensor;\n            this.mass = mass;\n            this.inverseMass = 1 / mass;\n\n            //Notify simulation island system of the change.\n            if (!previousState)\n            {\n                if (activityInformation.DeactivationManager != null)\n                    activityInformation.DeactivationManager.AddSimulationIslandToMember(activityInformation);\n\n                if (((IForceUpdateable)this).ForceUpdater != null)\n                    ((IForceUpdateable)this).ForceUpdater.ForceUpdateableBecomingDynamic(this);\n            }\n            //Change the group if it was using the defaults.\n            if (collisionInformation.CollisionRules.Group == CollisionRules.DefaultKinematicCollisionGroup ||\n                collisionInformation.CollisionRules.Group == null)\n                collisionInformation.CollisionRules.Group = CollisionRules.DefaultDynamicCollisionGroup;\n\n            activityInformation.Activate();\n\n\n            //Preserve velocity and reinitialize momentum for new state.\n            LinearVelocity = linearVelocity;\n            AngularVelocity = angularVelocity;\n\n        }\n\n\n        void IForceUpdateable.UpdateForForces(float dt)\n        {\n\n\n            //Linear velocity\n            if (IsAffectedByGravity)\n            {\n                Vector3.Add(ref forceUpdater.gravityDt, ref linearVelocity, out linearVelocity);\n            }\n\n            //Boost damping at very low velocities.  This is a strong stabilizer; removes a ton of energy from the system.\n            if (activityInformation.DeactivationManager.useStabilization && activityInformation.allowStabilization &&\n                (activityInformation.isSlowing || activityInformation.velocityTimeBelowLimit > activityInformation.DeactivationManager.lowVelocityTimeMinimum))\n            {\n                float energy = linearVelocity.LengthSquared() + angularVelocity.LengthSquared();\n                if (energy < activityInformation.DeactivationManager.velocityLowerLimitSquared)\n                {\n                    float boost = 1 - (float)(Math.Sqrt(energy) / (2f * activityInformation.DeactivationManager.velocityLowerLimit));\n                    ModifyAngularDamping(boost);\n                    ModifyLinearDamping(boost);\n                }\n            }\n\n            //Damping\n            float linear = LinearDamping + linearDampingBoost;\n            if (linear > 0)\n            {\n                Vector3.Multiply(ref linearVelocity, (float)Math.Pow(MathHelper.Clamp(1 - linear, 0, 1), dt), out linearVelocity);\n            }\n            //When applying angular damping, the momentum or velocity is damped depending on the conservation setting.\n            float angular = AngularDamping + angularDampingBoost;\n            if (angular > 0 && MotionSettings.ConserveAngularMomentum)\n            {\n                Vector3.Multiply(ref angularMomentum, (float)Math.Pow(MathHelper.Clamp(1 - angular, 0, 1), dt), out angularMomentum);\n            }\n            else if (angular > 0)\n            {\n                Vector3.Multiply(ref angularVelocity, (float)Math.Pow(MathHelper.Clamp(1 - angular, 0, 1), dt), out angularVelocity);\n            }\n\n            linearDampingBoost = 0;\n            angularDampingBoost = 0;\n\n            //Linear momentum\n            Vector3.Multiply(ref linearVelocity, mass, out linearMomentum);\n\n\n            //Update world inertia tensors.\n            Matrix3x3 multiplied;\n            Matrix3x3.MultiplyTransposed(ref orientationMatrix, ref localInertiaTensorInverse, out multiplied);\n            Matrix3x3.Multiply(ref multiplied, ref orientationMatrix, out inertiaTensorInverse);\n            Matrix3x3.MultiplyTransposed(ref orientationMatrix, ref localInertiaTensor, out multiplied);\n            Matrix3x3.Multiply(ref multiplied, ref orientationMatrix, out inertiaTensor);\n\n            //Update angular velocity or angular momentum.\n            if (MotionSettings.ConserveAngularMomentum)\n            {\n                Matrix3x3.Transform(ref angularMomentum, ref inertiaTensorInverse, out angularVelocity);\n            }\n            else\n            {\n                Matrix3x3.Transform(ref angularVelocity, ref inertiaTensor, out angularMomentum);\n            }\n\n            MathChecker.Validate(linearVelocity);\n            MathChecker.Validate(linearMomentum);\n            MathChecker.Validate(angularVelocity);\n            MathChecker.Validate(angularMomentum);\n\n\n        }\n\n        private ForceUpdater forceUpdater;\n        ForceUpdater IForceUpdateable.ForceUpdater\n        {\n            get\n            {\n                return forceUpdater;\n            }\n            set\n            {\n                forceUpdater = value;\n            }\n        }\n\n        #region ISpaceObject\n\n        ISpace space;\n        ISpace ISpaceObject.Space\n        {\n            get\n            {\n                return space;\n            }\n            set\n            {\n                space = value;\n            }\n        }\n        ///<summary>\n        /// Gets the space that owns the entity.\n        ///</summary>\n        public ISpace Space\n        {\n            get\n            {\n                return space;\n            }\n        }\n\n\n        void ISpaceObject.OnAdditionToSpace(ISpace newSpace)\n        {\n            OnAdditionToSpace(newSpace);\n        }\n\n        protected virtual void OnAdditionToSpace(ISpace newSpace)\n        {\n        }\n\n        void ISpaceObject.OnRemovalFromSpace(ISpace oldSpace)\n        {\n            OnRemovalFromSpace(oldSpace);\n        }\n\n        protected virtual void OnRemovalFromSpace(ISpace oldSpace)\n        {\n        }\n        #endregion\n\n\n        #region ICCDPositionUpdateable\n\n        PositionUpdater IPositionUpdateable.PositionUpdater\n        {\n            get;\n            set;\n        }\n\n        PositionUpdateMode positionUpdateMode = MotionSettings.DefaultPositionUpdateMode;\n        ///<summary>\n        /// Gets the position update mode of the entity.\n        ///</summary>\n        public PositionUpdateMode PositionUpdateMode\n        {\n            get\n            {\n                return positionUpdateMode;\n            }\n            set\n            {\n                var previous = positionUpdateMode;\n                positionUpdateMode = value;\n                //Notify our owner of the change, if needed.\n                if (positionUpdateMode != previous &&\n                    ((IPositionUpdateable)this).PositionUpdater != null &&\n                    (((IPositionUpdateable)this).PositionUpdater as ContinuousPositionUpdater) != null)\n                {\n                    (((IPositionUpdateable)this).PositionUpdater as ContinuousPositionUpdater).UpdateableModeChanged(this, previous);\n                }\n\n            }\n        }\n\n        void ICCDPositionUpdateable.UpdateTimesOfImpact(float dt)\n        {\n            //I am a continuous object.  If I am in a pair with another object, even if I am inactive,\n            //I must order the pairs to compute a time of impact.\n\n            //The pair method works in such a way that, when this method is run asynchronously, there will be no race conditions.\n            for (int i = 0; i < collisionInformation.pairs.Count; i++)\n            {\n                //Only perform CCD if we're either supposed to test against no solver pairs or if this isn't a no solver pair.\n                if (MotionSettings.PairAllowsCCD(this, collisionInformation.pairs.Elements[i]))\n                    collisionInformation.pairs.Elements[i].UpdateTimeOfImpact(collisionInformation, dt);\n            }\n        }\n        void ICCDPositionUpdateable.ResetTimesOfImpact()\n        {\n            //Reset all of the times of impact to 1, allowing the entity to move all the way through its velocity-defined motion.\n            for (int i = 0; i < collisionInformation.pairs.Count; i++)\n            {\n                collisionInformation.pairs.Elements[i].timeOfImpact = 1;\n            }\n        }\n\n        void ICCDPositionUpdateable.UpdatePositionContinuously(float dt)\n        {\n            float minimumToi = 1;\n            for (int i = 0; i < collisionInformation.pairs.Count; i++)\n            {\n                if (collisionInformation.pairs.Elements[i].timeOfImpact < minimumToi)\n                    minimumToi = collisionInformation.pairs.Elements[i].timeOfImpact;\n            }\n\n            //The orientation was already updated by the PreUpdatePosition.\n            //However, to be here, this object is not a discretely updated object.\n            //That means we still need to update the linear motion.\n\n            Vector3 increment;\n            Vector3.Multiply(ref linearVelocity, dt * minimumToi, out increment);\n            Vector3.Add(ref position, ref increment, out position);\n\n            collisionInformation.UpdateWorldTransform(ref position, ref orientation);\n\n            if (PositionUpdated != null)\n                PositionUpdated(this);\n\n            MathChecker.Validate(linearMomentum);\n            MathChecker.Validate(linearVelocity);\n            MathChecker.Validate(angularMomentum);\n            MathChecker.Validate(angularVelocity);\n            MathChecker.Validate(position);\n            MathChecker.Validate(orientation);\n        }\n\n        void IPositionUpdateable.PreUpdatePosition(float dt)\n        {\n            Vector3 increment;\n            if (MotionSettings.UseRk4AngularIntegration && isDynamic)\n            {\n                Toolbox.UpdateOrientationRK4(ref orientation, ref localInertiaTensorInverse, ref angularMomentum, dt, out orientation);\n            }\n            else\n            {\n                Vector3.Multiply(ref angularVelocity, dt * .5f, out increment);\n                var multiplier = new Quaternion(increment.X, increment.Y, increment.Z, 0);\n                Quaternion.Multiply(ref multiplier, ref orientation, out multiplier);\n                Quaternion.Add(ref orientation, ref multiplier, out orientation);\n                orientation.Normalize();\n            }\n            Matrix3x3.CreateFromQuaternion(ref orientation, out orientationMatrix);\n\n            //Only do the linear motion if this object doesn't obey CCD.\n            if (PositionUpdateMode == PositionUpdateMode.Discrete)\n            {\n                Vector3.Multiply(ref linearVelocity, dt, out increment);\n                Vector3.Add(ref position, ref increment, out position);\n\n                collisionInformation.UpdateWorldTransform(ref position, ref orientation);\n                //The position update is complete if this is a discretely updated object.\n                if (PositionUpdated != null)\n                    PositionUpdated(this);\n            }\n            collisionInformation.UpdateWorldTransform(ref position, ref orientation);\n\n            MathChecker.Validate(linearMomentum);\n            MathChecker.Validate(linearVelocity);\n            MathChecker.Validate(angularMomentum);\n            MathChecker.Validate(angularVelocity);\n            MathChecker.Validate(position);\n            MathChecker.Validate(orientation);\n\n        }\n\n\n\n        #endregion\n\n\n\n        float linearDampingBoost, angularDampingBoost;\n        float angularDamping = .15f;\n        float linearDamping = .03f;\n        ///<summary>\n        /// Gets or sets the angular damping of the entity.\n        /// Values range from 0 to 1, corresponding to a fraction of angular momentum removed\n        /// from the entity over a unit of time.\n        ///</summary>\n        public float AngularDamping\n        {\n            get\n            {\n                return angularDamping;\n            }\n            set\n            {\n                angularDamping = MathHelper.Clamp(value, 0, 1);\n            }\n        }\n        ///<summary>\n        /// Gets or sets the linear damping of the entity.\n        /// Values range from 0 to 1, correspondong to a fraction of linear momentum removed\n        /// from the entity over a unit of time.\n        ///</summary>\n        public float LinearDamping\n        {\n            get\n            {\n                return linearDamping;\n            }\n\n            set\n            {\n                linearDamping = MathHelper.Clamp(value, 0, 1);\n            }\n        }\n\n        /// <summary>\n        /// Temporarily adjusts the linear damping by an amount.  After the value is used, the\n        /// damping returns to the base value.\n        /// </summary>\n        /// <param name=\"damping\">Damping to add.</param>\n        public void ModifyLinearDamping(float damping)\n        {\n            float totalDamping = LinearDamping + linearDampingBoost;\n            float remainder = 1 - totalDamping;\n            linearDampingBoost += damping * remainder;\n        }\n        /// <summary>\n        /// Temporarily adjusts the angular damping by an amount.  After the value is used, the\n        /// damping returns to the base value.\n        /// </summary>\n        /// <param name=\"damping\">Damping to add.</param>\n        public void ModifyAngularDamping(float damping)\n        {\n            float totalDamping = AngularDamping + angularDampingBoost;\n            float remainder = 1 - totalDamping;\n            angularDampingBoost += damping * remainder;\n        }\n\n        /// <summary>\n        /// Gets or sets the user data associated with the entity.\n        /// This is separate from the entity's collidable's tag.\n        /// If a tag needs to be accessed from within the collision\n        /// detection pipeline, consider using the entity.CollisionInformation.Tag.\n        /// </summary>\n        public object Tag { get; set; }\n\n\n\n        CollisionRules ICollisionRulesOwner.CollisionRules\n        {\n            get\n            {\n                return collisionInformation.collisionRules;\n            }\n            set\n            {\n                collisionInformation.CollisionRules = value;\n            }\n        }\n\n        BroadPhaseEntry IBroadPhaseEntryOwner.Entry\n        {\n            get { return collisionInformation; }\n        }\n\n        public override string ToString()\n        {\n            if (Tag == null)\n                return base.ToString();\n            else\n                return base.ToString() + \", \" + Tag;\n        }\n\n\n#if WINDOWS_PHONE\n        static int idCounter;\n        /// <summary>\n        /// Gets the entity's unique instance id.\n        /// </summary>\n        public int InstanceId { get; private set; }\n#else\n        static long idCounter;\n        /// <summary>\n        /// Gets the entity's unique instance id.\n        /// </summary>\n        public long InstanceId { get; private set; }\n#endif\n        void InitializeId()\n        {\n            InstanceId = System.Threading.Interlocked.Increment(ref idCounter);\n\n            hashCode = (int)((((ulong)InstanceId) * 4294967311UL) % 4294967296UL);\n        }\n\n\n        int hashCode;\n        public override int GetHashCode()\n        {\n            return hashCode;\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Entities/EntityConstraintCollection.cs",
    "content": "﻿using System.Collections.Generic;\nusing BEPUphysics.Constraints.TwoEntity;\nusing BEPUphysics.DeactivationManagement;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.Entities\n{\n    ///<summary>\n    /// Convenience collection for easily scanning the two entity constraints connected to an entity.\n    ///</summary>\n    public class EntityConstraintCollection : IEnumerable<TwoEntityConstraint>\n    {\n        private RawList<SimulationIslandConnection> connections;\n\n\n        /// <summary>\n        /// Constructs a new constraint collection.\n        /// </summary>\n        /// <param name=\"connections\">Solver updateables to enumerate over.</param>\n        public EntityConstraintCollection(RawList<SimulationIslandConnection> connections)\n        {\n            this.connections = connections;\n        }\n\n        /// <summary>\n        /// Gets an enumerator for the collection.\n        /// </summary>\n        /// <returns>Enumerator for the collection.</returns>\n        public Enumerator GetEnumerator()\n        {\n            return new Enumerator(connections);\n        }\n\n        IEnumerator<TwoEntityConstraint> IEnumerable<TwoEntityConstraint>.GetEnumerator()\n        {\n            return new Enumerator(connections);\n        }\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return new Enumerator(connections);\n        }\n\n        ///<summary>\n        /// Enumerator for the EntityConstraintCollection.\n        ///</summary>\n        public struct Enumerator : IEnumerator<TwoEntityConstraint>\n        {\n            private RawList<SimulationIslandConnection> connections;\n            private int index;\n            private TwoEntityConstraint current;\n\n            /// <summary>\n            /// Constructs an enumerator for the solver updateables list.\n            /// </summary>\n            /// <param name=\"connections\">List of solver updateables to enumerate.</param>\n            public Enumerator(RawList<SimulationIslandConnection> connections)\n            {\n                this.connections = connections;\n                index = -1;\n                current = null;\n            }\n\n            /// <summary>\n            /// Gets the element in the collection at the current position of the enumerator.\n            /// </summary>\n            /// <returns>\n            /// The element in the collection at the current position of the enumerator.\n            /// </returns>\n            public TwoEntityConstraint Current\n            {\n                get { return current; }\n            }\n\n            /// <summary>\n            /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n            /// </summary>\n            /// <filterpriority>2</filterpriority>\n            public void Dispose()\n            {\n            }\n\n            object System.Collections.IEnumerator.Current\n            {\n                get { return Current; }\n            }\n\n            /// <summary>\n            /// Advances the enumerator to the next element of the collection.\n            /// </summary>\n            /// <returns>\n            /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n            /// </returns>\n            /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n            public bool MoveNext()\n            {\n                while (++index < connections.Count)\n                {\n                    if (!connections.Elements[index].SlatedForRemoval)\n                    {\n                        current = connections.Elements[index].Owner as TwoEntityConstraint;\n                        if (current != null)\n                            return true;\n                    }\n                }\n                return false;\n            }\n\n            /// <summary>\n            /// Sets the enumerator to its initial position, which is before the first element in the collection.\n            /// </summary>\n            /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n            public void Reset()\n            {\n                index = -1;\n                current = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Entities/EntitySolverUpdateableCollection.cs",
    "content": "﻿using System.Collections.Generic;\nusing BEPUphysics.Constraints;\nusing BEPUphysics.DeactivationManagement;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.Entities\n{\n    ///<summary>\n    /// Convenience collection for easily scanning the two entity constraints connected to an entity.\n    ///</summary>\n    public class EntitySolverUpdateableCollection : IEnumerable<EntitySolverUpdateable>\n    {\n        private RawList<SimulationIslandConnection> connections;\n\n\n        /// <summary>\n        /// Constructs a new constraint collection.\n        /// </summary>\n        /// <param name=\"connections\">Solver updateables to enumerate over.</param>\n        public EntitySolverUpdateableCollection(RawList<SimulationIslandConnection> connections)\n        {\n            this.connections = connections;\n        }\n\n        /// <summary>\n        /// Gets an enumerator for the collection.\n        /// </summary>\n        /// <returns>Enumerator for the collection.</returns>\n        public Enumerator GetEnumerator()\n        {\n            return new Enumerator(connections);\n        }\n\n        IEnumerator<EntitySolverUpdateable> IEnumerable<EntitySolverUpdateable>.GetEnumerator()\n        {\n            return new Enumerator(connections);\n        }\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return new Enumerator(connections);\n        }\n\n        ///<summary>\n        /// Enumerator for the EntityConstraintCollection.\n        ///</summary>\n        public struct Enumerator : IEnumerator<EntitySolverUpdateable>\n        {\n            private RawList<SimulationIslandConnection> connections;\n            private int index;\n            private EntitySolverUpdateable current;\n\n            /// <summary>\n            /// Constructs an enumerator for the solver updateables list.\n            /// </summary>\n            /// <param name=\"connections\">List of solver updateables to enumerate.</param>\n            public Enumerator(RawList<SimulationIslandConnection> connections)\n            {\n                this.connections = connections;\n                index = -1;\n                current = null;\n            }\n\n            /// <summary>\n            /// Gets the element in the collection at the current position of the enumerator.\n            /// </summary>\n            /// <returns>\n            /// The element in the collection at the current position of the enumerator.\n            /// </returns>\n            public EntitySolverUpdateable Current\n            {\n                get { return current; }\n            }\n\n            /// <summary>\n            /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n            /// </summary>\n            /// <filterpriority>2</filterpriority>\n            public void Dispose()\n            {\n            }\n\n            object System.Collections.IEnumerator.Current\n            {\n                get { return Current; }\n            }\n\n            /// <summary>\n            /// Advances the enumerator to the next element of the collection.\n            /// </summary>\n            /// <returns>\n            /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n            /// </returns>\n            /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n            public bool MoveNext()\n            {\n                while (++index < connections.Count)\n                {\n                    if (!connections.Elements[index].SlatedForRemoval)\n                    {\n                        current = connections.Elements[index].Owner as EntitySolverUpdateable;\n                        if (current != null)\n                            return true;\n                    }\n                }\n                return false;\n            }\n\n            /// <summary>\n            /// Sets the enumerator to its initial position, which is before the first element in the collection.\n            /// </summary>\n            /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n            public void Reset()\n            {\n                index = -1;\n                current = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Entities/MorphableEntity.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities;\nusing BEPUphysics.CollisionShapes;\n\nnamespace BEPUphysics.Entities\n{\n    ///<summary>\n    /// Entity with modifiable collision information.\n    ///</summary>\n    public class MorphableEntity : Entity\n    {\n        ///<summary>\n        /// Gets or sets the collidable associated with the entity.\n        ///</summary>\n        public new EntityCollidable CollisionInformation\n        {\n            get\n            {\n                return base.CollisionInformation;\n            }\n            set\n            {\n                SetCollisionInformation(value);\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new morphable entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable to use with the entity.</param>\n        public MorphableEntity(EntityCollidable collisionInformation)\n            : base(collisionInformation)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a new morphable entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity.</param>\n        public MorphableEntity(EntityCollidable collisionInformation, float mass)\n            : base(collisionInformation, mass)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a new morphable entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity.</param>\n        /// <param name=\"inertiaTensor\">Inertia tensor of the entity.</param>\n        public MorphableEntity(EntityCollidable collisionInformation, float mass, Matrix3x3 inertiaTensor)\n            : base(collisionInformation, mass, inertiaTensor)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a new morphable entity.\n        ///</summary>\n        ///<param name=\"collisionInformation\">Collidable to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity.</param>\n        /// <param name=\"inertiaTensor\">Inertia tensor of the entity.</param>\n        /// <param name=\"volume\">Volume of the entity.</param>\n        public MorphableEntity(EntityCollidable collisionInformation, float mass, Matrix3x3 inertiaTensor, float volume)\n            : base(collisionInformation, mass, inertiaTensor, volume)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a new morphable entity.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use with the entity.</param>\n        public MorphableEntity(EntityShape shape)\n            : base(shape)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a new morphable entity.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity.</param>\n        public MorphableEntity(EntityShape shape, float mass)\n            : base(shape, mass)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a new morphable entity.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity.</param>\n        /// <param name=\"inertiaTensor\">Inertia tensor of the entity.</param>\n        public MorphableEntity(EntityShape shape, float mass, Matrix3x3 inertiaTensor)\n            : base(shape, mass, inertiaTensor)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a new morphable entity.\n        ///</summary>\n        ///<param name=\"shape\">Shape to use with the entity.</param>\n        ///<param name=\"mass\">Mass of the entity.</param>\n        /// <param name=\"inertiaTensor\">Inertia tensor of the entity.</param>\n        /// <param name=\"volume\">Volume of the entity.</param>\n        public MorphableEntity(EntityShape shape, float mass, Matrix3x3 inertiaTensor, float volume)\n            : base(shape, mass, inertiaTensor, volume)\n        {\n        }\n\n        /// <summary>\n        /// Sets the collision information of the entity to another collidable.\n        /// </summary>\n        /// <param name=\"newCollisionInformation\">New collidable to use.</param>\n        public void SetCollisionInformation(EntityCollidable newCollisionInformation)\n        {\n            //Temporarily remove the object from the space.  \n            //The reset process will update any systems that need to be updated.\n            //This is not thread safe, but this operation should not be performed mid-frame anyway.\n            ISpace space = Space;\n            if (space != null)\n                Space.Remove(this);\n\n            CollisionInformation.Entity = null;\n\n            if (isDynamic)\n                Initialize(newCollisionInformation, mass);\n            else\n                Initialize(newCollisionInformation);\n\n            if (space != null)\n                space.Add(this);\n        }\n\n        /// <summary>\n        /// Sets the collision information of the entity to another collidable.\n        /// </summary>\n        /// <param name=\"newCollisionInformation\">New collidable to use.</param>\n        /// <param name=\"newMass\">New mass to use for the entity.</param>\n        public void SetCollisionInformation(EntityCollidable newCollisionInformation, float newMass)\n        {\n            //Temporarily remove the object from the space.  \n            //The reset process will update any systems that need to be updated.\n            //This is not thread safe, but this operation should not be performed mid-frame anyway.\n            ISpace space = Space;\n            if (space != null)\n                Space.Remove(this);\n\n            CollisionInformation.Entity = null;\n\n            Initialize(newCollisionInformation, newMass);\n\n            if (space != null)\n                space.Add(this);\n        }\n\n        /// <summary>\n        /// Sets the collision information of the entity to another collidable.\n        /// </summary>\n        /// <param name=\"newCollisionInformation\">New collidable to use.</param>\n        /// <param name=\"newMass\">New mass to use for the entity.</param>\n        /// <param name=\"newInertia\">New inertia tensor to use for the entity.</param>\n        public void SetCollisionInformation(EntityCollidable newCollisionInformation, float newMass, Matrix3x3 newInertia)\n        {\n            //Temporarily remove the object from the space.  \n            //The reset process will update any systems that need to be updated.\n            //This is not thread safe, but this operation should not be performed mid-frame anyway.\n            ISpace space = Space;\n            if (space != null)\n                Space.Remove(this);\n\n            CollisionInformation.Entity = null;\n\n            Initialize(newCollisionInformation, newMass, newInertia);\n\n            if (space != null)\n                space.Add(this);\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/Box.cs",
    "content": "using BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.EntityStateManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// Box-shaped object that can collide and move.  After making an entity, add it to a Space so that the engine can manage it.\n    /// </summary>\n    public class Box : Entity<ConvexCollidable<BoxShape>>\n    {\n\n        private Box(float width, float height, float length)\n            :base(new ConvexCollidable<BoxShape>(new BoxShape(width, height, length)))\n        {\n        }\n\n        private Box(float width, float height, float length, float mass)\n            :base(new ConvexCollidable<BoxShape>(new BoxShape(width, height, length)), mass)\n        {\n        }\n\n        /// <summary>\n        /// Constructs a physically simulated box.\n        /// </summary>\n        /// <param name=\"pos\">Position of the box.</param>\n        /// <param name=\"width\">Width of the box.</param>\n        /// <param name=\"length\">Length of the box.</param>\n        /// <param name=\"height\">Height of the box.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Box(Vector3 pos, float width, float height, float length, float mass)\n            : this(width, height, length, mass)\n        {\n            Position = pos;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic box.\n        /// </summary>\n        /// <param name=\"pos\">Position of the box.</param>\n        /// <param name=\"width\">Width of the box.</param>\n        /// <param name=\"length\">Length of the box.</param>\n        /// <param name=\"height\">Height of the box.</param>\n        public Box(Vector3 pos, float width, float height, float length)\n            : this(width, height, length)\n        {\n            Position = pos;\n        }\n\n        /// <summary>\n        /// Constructs a physically simulated box.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"width\">Width of the box.</param>\n        /// <param name=\"length\">Length of the box.</param>\n        /// <param name=\"height\">Height of the box.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Box(MotionState motionState, float width, float height, float length, float mass)\n            : this(width, height, length, mass)\n        {\n            MotionState = motionState;\n        }\n\n\n\n        /// <summary>\n        /// Constructs a nondynamic box.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"width\">Width of the box.</param>\n        /// <param name=\"length\">Length of the box.</param>\n        /// <param name=\"height\">Height of the box.</param>\n        public Box(MotionState motionState, float width, float height, float length)\n            : this(width, height, length)\n        {\n            MotionState = motionState;\n        }\n\n        /// <summary>\n        /// Width of the box divided by two.\n        /// </summary>\n        public float HalfWidth\n        {\n            get { return CollisionInformation.Shape.HalfWidth; }\n            set { CollisionInformation.Shape.HalfWidth = value; }\n        }\n\n\n        /// <summary>\n        /// Height of the box divided by two.\n        /// </summary>\n        public float HalfHeight\n        {\n            get { return CollisionInformation.Shape.HalfHeight; }\n            set { CollisionInformation.Shape.HalfHeight = value; }\n        }\n\n        /// <summary>\n        /// Length of the box divided by two.\n        /// </summary>\n        public float HalfLength\n        {\n            get { return CollisionInformation.Shape.HalfLength; }\n            set { CollisionInformation.Shape.HalfLength = value; }\n        }\n\n\n\n        /// <summary>\n        /// Width of the box.\n        /// </summary>\n        public float Width\n        {\n            get { return CollisionInformation.Shape.Width; }\n            set { CollisionInformation.Shape.Width = value; }\n        }\n\n        /// <summary>\n        /// Height of the box.\n        /// </summary>\n        public float Height\n        {\n            get { return CollisionInformation.Shape.Height; }\n            set { CollisionInformation.Shape.Height = value; }\n        }\n\n        /// <summary>\n        /// Length of the box.\n        /// </summary>\n        public float Length\n        {\n            get { return CollisionInformation.Shape.Length; }\n            set { CollisionInformation.Shape.Length = value; }\n        }\n\n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/Capsule.cs",
    "content": "using BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.EntityStateManagement;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// Pill-shaped object that can collide and move.  After making an entity, add it to a Space so that the engine can manage it.\n    /// </summary>\n    public class Capsule : Entity<ConvexCollidable<CapsuleShape>>\n    {\n        /// <summary>\n        /// Gets or sets the length of the capsule.\n        /// </summary>\n        public float Length\n        {\n            get\n            {\n                return CollisionInformation.Shape.Length;\n            }\n            set\n            {\n                CollisionInformation.Shape.Length = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the radius of the capsule.\n        /// </summary>\n        public float Radius\n        {\n            get\n            {\n                return CollisionInformation.Shape.Radius;\n            }\n            set\n            {\n                CollisionInformation.Shape.Radius = value;\n            }\n        }\n\n        private Capsule(float len, float rad)\n            : base(new ConvexCollidable<CapsuleShape>(new CapsuleShape(len, rad)))\n        {\n        }\n\n        private Capsule(float len, float rad, float mass)\n            : base(new ConvexCollidable<CapsuleShape>(new CapsuleShape(len, rad)), mass)\n        {\n        }\n\n\n\n        ///<summary>\n        /// Computes an orientation and length from a line segment.\n        ///</summary>\n        ///<param name=\"start\">Starting point of the line segment.</param>\n        ///<param name=\"end\">Endpoint of the line segment.</param>\n        ///<param name=\"orientation\">Orientation of a line that fits the line segment.</param>\n        ///<param name=\"length\">Length of the line segment.</param>\n        public static void GetCapsuleInformation(ref Vector3 start, ref Vector3 end, out Quaternion orientation, out float length)\n        {\n            Vector3 segmentDirection;\n            Vector3.Subtract(ref end, ref start, out segmentDirection);\n            length = segmentDirection.Length();\n            if (length > 0)\n            {\n                Vector3.Divide(ref segmentDirection, length, out segmentDirection);\n                Toolbox.GetQuaternionBetweenNormalizedVectors(ref Toolbox.UpVector, ref segmentDirection, out orientation);\n            }\n            else\n                orientation = Quaternion.Identity;\n        }\n\n        ///<summary>\n        /// Constructs a new kinematic capsule.\n        ///</summary>\n        ///<param name=\"start\">Line segment start point.</param>\n        ///<param name=\"end\">Line segment end point.</param>\n        ///<param name=\"radius\">Radius of the capsule to expand the line segment by.</param>\n        public Capsule(Vector3 start, Vector3 end, float radius)\n            : this((end - start).Length(), radius)\n        {\n            float length;\n            Quaternion orientation;\n            GetCapsuleInformation(ref start, ref end, out orientation, out length);\n            this.Orientation = orientation;\n            Vector3 position;\n            Vector3.Add(ref start, ref end, out position);\n            Vector3.Multiply(ref position, .5f, out position);\n            this.Position = position;\n        }\n\n\n        ///<summary>\n        /// Constructs a new dynamic capsule.\n        ///</summary>\n        ///<param name=\"start\">Line segment start point.</param>\n        ///<param name=\"end\">Line segment end point.</param>\n        ///<param name=\"radius\">Radius of the capsule to expand the line segment by.</param>\n        /// <param name=\"mass\">Mass of the entity.</param>\n        public Capsule(Vector3 start, Vector3 end, float radius, float mass)\n            : this((end - start).Length(), radius, mass)\n        {\n            float length;\n            Quaternion orientation;\n            GetCapsuleInformation(ref start, ref end, out orientation, out length);\n            this.Orientation = orientation;\n            Vector3 position;\n            Vector3.Add(ref start, ref end, out position);\n            Vector3.Multiply(ref position, .5f, out position);\n            this.Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a physically simulated capsule.\n        /// </summary>\n        /// <param name=\"position\">Position of the capsule.</param>\n        /// <param name=\"length\">Length of the capsule.</param>\n        /// <param name=\"radius\">Radius of the capsule.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Capsule(Vector3 position, float length, float radius, float mass)\n            : this(length, radius, mass)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic capsule.\n        /// </summary>\n        /// <param name=\"position\">Position of the capsule.</param>\n        /// <param name=\"length\">Length of the capsule.</param>\n        /// <param name=\"radius\">Radius of the capsule.</param>\n        public Capsule(Vector3 position, float length, float radius)\n            : this(length, radius)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a dynamic capsule.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"length\">Length of the capsule.</param>\n        /// <param name=\"radius\">Radius of the capsule.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Capsule(MotionState motionState, float length, float radius, float mass)\n            : this(length, radius, mass)\n        {\n            MotionState = motionState;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic capsule.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"length\">Length of the capsule.</param>\n        /// <param name=\"radius\">Radius of the capsule.</param>\n        public Capsule(MotionState motionState, float length, float radius)\n            : this(length, radius)\n        {\n            MotionState = motionState;\n        }\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/CompoundBody.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.CollisionShapes;\nusing BEPUutilities;\nusing System.Collections.ObjectModel;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// Acts as a grouping of multiple other objects.  Can be used to form physically simulated concave shapes.\n    /// </summary>\n    public class CompoundBody : Entity<CompoundCollidable>\n    {\n        ///<summary>\n        /// Gets the list of shapes in the compound.\n        ///</summary>\n        public ReadOnlyList<CompoundShapeEntry> Shapes\n        {\n            get\n            {\n                return CollisionInformation.Shape.Shapes;\n            }\n        }\n\n\n        /// <summary>\n        /// Creates a new kinematic CompoundBody with the given subbodies.\n        /// </summary>\n        /// <param name=\"bodies\">List of entities to use as subbodies of the compound body.</param>\n        /// <exception cref=\"InvalidOperationException\">Thrown when the bodies list is empty or there is a mix of kinematic and dynamic entities in the body list.</exception>\n        public CompoundBody(IList<CompoundShapeEntry> bodies)\n        {\n            Vector3 center;\n            var shape = new CompoundShape(bodies, out center);\n            Initialize(new CompoundCollidable(shape));\n            Position = center;\n        }\n\n\n        /// <summary>\n        /// Creates a new dynamic CompoundBody with the given subbodies.\n        /// </summary>\n        /// <param name=\"bodies\">List of entities to use as subbodies of the compound body.</param>\n        /// <param name=\"mass\">Mass of the compound.</param>\n        /// <exception cref=\"InvalidOperationException\">Thrown when the bodies list is empty or there is a mix of kinematic and dynamic entities in the body list.</exception>\n        public CompoundBody(IList<CompoundShapeEntry> bodies, float mass)\n        {\n            Vector3 center;\n            var shape = new CompoundShape(bodies, out center);\n            Initialize(new CompoundCollidable(shape), mass);\n            Position = center;\n        }\n\n\n        ///<summary>\n        /// Constructs a kinematic compound body from the children data.\n        ///</summary>\n        ///<param name=\"children\">Children data to construct the compound from.</param>\n        public CompoundBody(IList<CompoundChildData> children)\n        {\n\n            Vector3 center;\n            var collidable = new CompoundCollidable(children, out center);\n            Initialize(collidable);\n            Position = center;\n        }\n\n        ///<summary>\n        /// Constructs a dynamic compound body from the children data.\n        ///</summary>\n        ///<param name=\"children\">Children data to construct the compound from.</param>\n        ///<param name=\"mass\">Mass of the compound body.</param>\n        public CompoundBody(IList<CompoundChildData> children, float mass)\n        {\n            Vector3 center;\n            var collidable = new CompoundCollidable(children, out center);\n            Initialize(collidable, mass);\n            Position = center;\n        }\n\n\n\n    }\n\n\n}"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/Cone.cs",
    "content": "using BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.EntityStateManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// Cone-shaped object that can collide and move.  After making an entity, add it to a Space so that the engine can manage it.\n    /// </summary>\n    public class Cone : Entity<ConvexCollidable<ConeShape>>\n    {\n        /// <summary>\n        /// Gets or sets the length of the cone.\n        /// </summary>\n        public float Height\n        {\n            get\n            {\n                return CollisionInformation.Shape.Height;\n            }\n            set\n            {\n                CollisionInformation.Shape.Height = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the radius of the cone.\n        /// </summary>\n        public float Radius\n        {\n            get\n            {\n                return CollisionInformation.Shape.Radius;\n            }\n            set\n            {\n                CollisionInformation.Shape.Radius = value;\n            }\n        }\n\n\n        private Cone(float high, float rad)\n            :base(new ConvexCollidable<ConeShape>(new ConeShape(high, rad)))\n        {\n        }\n\n        private Cone(float high, float rad, float mass)\n            :base(new ConvexCollidable<ConeShape>(new ConeShape(high, rad)), mass)\n        {\n        }\n\n\n\n        /// <summary>\n        /// Constructs a physically simulated cone.\n        /// </summary>\n        /// <param name=\"position\">Position of the cone.</param>\n        /// <param name=\"height\">Height of the cone.</param>\n        /// <param name=\"radius\">Radius of the cone.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Cone(Vector3 position, float height, float radius, float mass)\n            : this(height, radius, mass)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic cone.\n        /// </summary>\n        /// <param name=\"position\">Position of the cone.</param>\n        /// <param name=\"height\">Height of the cone.</param>\n        /// <param name=\"radius\">Radius of the cone.</param>\n        public Cone(Vector3 position, float height, float radius)\n            : this(height, radius)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a physically simulated cone.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"height\">Height of the cone.</param>\n        /// <param name=\"radius\">Radius of the cone.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Cone(MotionState motionState, float height, float radius, float mass)\n            : this(height, radius, mass)\n        {\n            MotionState = motionState;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic cone.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"height\">Height of the cone.</param>\n        /// <param name=\"radius\">Radius of the cone.</param>\n        public Cone(MotionState motionState, float height, float radius)\n            : this(height, radius)\n        {\n            MotionState = motionState;\n        }\n\n \n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/ConvexHull.cs",
    "content": "using System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.EntityStateManagement;\nusing Microsoft.Xna.Framework;\nusing System.Collections.ObjectModel;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// Shape that can collide and move based on the convex 'outer layer' of a list of points.  After making an entity, add it to a Space so that the engine can manage it.\n    /// </summary>\n    public class ConvexHull : Entity<ConvexCollidable<ConvexHullShape>>\n    {\n        /// <summary>\n        /// List of the points composing the surface of the convex hull in local space.\n        /// </summary>\n        public ReadOnlyList<Vector3> Vertices\n        {\n            get\n            {\n                return CollisionInformation.Shape.Vertices;\n            }\n        }\n\n\n        /// <summary>\n        /// Constructs a nondynamic convex hull of points.\n        /// </summary>\n        /// <param name=\"points\">List of points in the object.</param>\n        public ConvexHull(IList<Vector3> points)\n        {\n            Vector3 center;\n            var shape = new ConvexHullShape(points, out center);\n            Initialize(new ConvexCollidable<ConvexHullShape>(shape));\n            Position = center;\n        }\n\n\n        /// <summary>\n        /// Constructs a physically simulated convex hull of points.\n        /// </summary>\n        /// <param name=\"points\">List of points in the object.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public ConvexHull(IList<Vector3> points, float mass)\n        {\n            Vector3 center;\n            var shape = new ConvexHullShape(points, out center);\n            Initialize(new ConvexCollidable<ConvexHullShape>(shape), mass);\n            Position = center;\n        }\n\n        /// <summary>\n        /// Constructs a physically simulated convex hull of points.\n        /// </summary>\n        /// <param name=\"position\">Position to place the convex hull.</param>\n        /// <param name=\"points\">List of points in the object.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public ConvexHull(Vector3 position, IList<Vector3> points, float mass)\n            : this(points, mass)\n        {\n            Position = position;\n        }\n\n\n        /// <summary>\n        /// Constructs a nondynamic convex hull of points.\n        /// </summary>\n        /// <param name=\"position\">Position to place the convex hull.</param>\n        /// <param name=\"points\">List of points in the object.</param>\n        public ConvexHull(Vector3 position, IList<Vector3> points)\n            : this(points)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a physically simulated convex hull of points.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"points\">List of points in the object.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public ConvexHull(MotionState motionState, IList<Vector3> points, float mass)\n            : this(points, mass)\n        {\n            MotionState = motionState;\n        }\n\n\n        /// <summary>\n        /// Constructs a nondynamic convex hull of points.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"points\">List of points in the object.</param>\n        public ConvexHull(MotionState motionState, IList<Vector3> points)\n            : this(points)\n        {\n            MotionState = motionState;\n        }\n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/Cylinder.cs",
    "content": "using BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.EntityStateManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// Cylinder-shaped object that can collide and move.  After making an entity, add it to a Space so that the engine can manage it.\n    /// </summary>\n    public class Cylinder : Entity<ConvexCollidable<CylinderShape>>\n    {\n        /// <summary>\n        /// Gets or sets the height of the cylinder.\n        /// </summary>\n        public float Height\n        {\n            get\n            {\n                return CollisionInformation.Shape.Height;\n            }\n            set\n            {\n                CollisionInformation.Shape.Height = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the radius of the cylinder.\n        /// </summary>\n        public float Radius\n        {\n            get\n            {\n                return CollisionInformation.Shape.Radius;\n            }\n            set\n            {\n                CollisionInformation.Shape.Radius = value;\n            }\n        }\n\n\n        private Cylinder(float high, float rad, float mass)\n            : base(new ConvexCollidable<CylinderShape>(new CylinderShape(high, rad)), mass)\n        {\n        }\n\n        private Cylinder(float high, float rad)\n            : base(new ConvexCollidable<CylinderShape>(new CylinderShape(high, rad)))\n        {\n        }\n\n        /// <summary>\n        /// Constructs a physically simulated cylinder.\n        /// </summary>\n        /// <param name=\"position\">Position of the cylinder.</param>\n        /// <param name=\"height\">Height of the cylinder.</param>\n        /// <param name=\"radius\">Radius of the cylinder.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Cylinder(Vector3 position, float height, float radius, float mass)\n            : this(height, radius, mass)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic cylinder.\n        /// </summary>\n        /// <param name=\"position\">Position of the cylinder.</param>\n        /// <param name=\"height\">Height of the cylinder.</param>\n        /// <param name=\"radius\">Radius of the cylinder.</param>\n        public Cylinder(Vector3 position, float height, float radius)\n            : this(height, radius)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a physically simulated cylinder.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"height\">Height of the cylinder.</param>\n        /// <param name=\"radius\">Radius of the cylinder.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Cylinder(MotionState motionState, float height, float radius, float mass)\n            : this(height, radius, mass)\n        {\n            MotionState = motionState;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic cylinder.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"height\">Height of the cylinder.</param>\n        /// <param name=\"radius\">Radius of the cylinder.</param>\n        public Cylinder(MotionState motionState, float height, float radius)\n            : this(height, radius)\n        {\n            MotionState = motionState;\n        }\n\n\n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/MinkowskiSum.cs",
    "content": "using System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.EntityStateManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// Shape representing the sweeping of one entity through another.  Can collide and move.  After making an entity, add it to a Space so that the engine can manage it.\n    /// </summary>\n    public class MinkowskiSum : Entity<ConvexCollidable<MinkowskiSumShape>>\n    {\n        /// <summary>\n        /// First entity in the sum.\n        /// </summary>\n        public Entity EntityA;\n\n        /// <summary>\n        /// Second entity in the sum.\n        /// </summary>\n        public Entity EntityB;\n\n        private MinkowskiSum(OrientedConvexShapeEntry a, OrientedConvexShapeEntry b, float m)\n            :base(new ConvexCollidable<MinkowskiSumShape>(new MinkowskiSumShape(a, b)), m)\n        {\n            Position = -CollisionInformation.Shape.LocalOffset;\n        }\n\n        private MinkowskiSum(OrientedConvexShapeEntry a, OrientedConvexShapeEntry b)\n            : base(new ConvexCollidable<MinkowskiSumShape>(new MinkowskiSumShape(a, b)))\n        {\n            Position = -CollisionInformation.Shape.LocalOffset;\n        }\n\n        /// <summary>\n        /// Constructs a dynamic minkowski sum.\n        /// </summary>\n        /// <param name=\"position\">Position of the resulting shape.</param>\n        /// <param name=\"a\">First entity in the sum.</param>\n        /// <param name=\"b\">Second entity in the sum.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public MinkowskiSum(Vector3 position, OrientedConvexShapeEntry a, OrientedConvexShapeEntry b, float mass)\n            : this(a, b, mass)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic minkowski sum of two entities.\n        /// </summary>\n        /// <param name=\"position\">Position of the resulting shape.</param>\n        /// <param name=\"a\">First entity in the sum.</param>\n        /// <param name=\"b\">Second entity in the sum.</param>\n        public MinkowskiSum(Vector3 position, OrientedConvexShapeEntry a, OrientedConvexShapeEntry b)\n            : this(a, b)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a dynamic minkowski sum of two entities.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"a\">First entity in the sum.</param>\n        /// <param name=\"b\">Second entity in the sum.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public MinkowskiSum(MotionState motionState, OrientedConvexShapeEntry a, OrientedConvexShapeEntry b, float mass)\n            : this(a, b, mass)\n        {\n            MotionState = motionState;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic minkowski sum of two entities.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"a\">First entity in the sum.</param>\n        /// <param name=\"b\">Second entity in the sum.</param>\n        public MinkowskiSum(MotionState motionState, OrientedConvexShapeEntry a, OrientedConvexShapeEntry b)\n            : this(a, b)\n        {\n            MotionState = motionState;\n        }\n\n        /// <summary>\n        /// Constructs a dynamic minkowski sum entity.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"shapes\">List of shapes to make the sum frmo.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public MinkowskiSum(MotionState motionState, IList<OrientedConvexShapeEntry> shapes, float mass)\n            : base(new ConvexCollidable<MinkowskiSumShape>(new MinkowskiSumShape(shapes)), mass)\n        {\n            MotionState = motionState;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic minkowski sum.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"shapes\">List of shapes to make the sum frmo.</param>\n        public MinkowskiSum(MotionState motionState, IList<OrientedConvexShapeEntry> shapes)\n            : base(new ConvexCollidable<MinkowskiSumShape>(new MinkowskiSumShape(shapes)))\n        {\n            MotionState = motionState;\n        }\n\n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/MobileMesh.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.CollisionShapes;\nusing BEPUutilities;\nusing System.Collections.ObjectModel;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// Acts as a grouping of multiple other objects.  Can be used to form physically simulated concave shapes.\n    /// </summary>\n    public class MobileMesh : Entity<MobileMeshCollidable>\n    {\n\n        /// <summary>\n        /// Creates a new kinematic MobileMesh.\n        /// </summary>\n        /// <param name=\"vertices\">Vertices in the mesh.</param>\n        /// <param name=\"indices\">Indices of the mesh.</param>\n        /// <param name=\"localTransform\">Affine transform to apply to the vertices.</param>\n        /// <param name=\"solidity\">Solidity/sidedness of the mesh.  \"Solid\" is only permitted if the mesh is closed.</param>\n        public MobileMesh(Vector3[] vertices, uint[] indices, AffineTransform localTransform, MobileMeshSolidity solidity)\n        {\n            ShapeDistributionInformation info;\n            var shape = new MobileMeshShape(vertices, indices, localTransform, solidity, out info);\n            Initialize(new MobileMeshCollidable(shape));\n            Position = info.Center;\n        }\n\n\n\n        /// <summary>\n        /// Creates a new dynamic MobileMesh.\n        /// </summary>\n        /// <param name=\"vertices\">Vertices in the mesh.</param>\n        /// <param name=\"indices\">Indices of the mesh.</param>\n        /// <param name=\"localTransform\">Affine transform to apply to the vertices.</param>\n        /// <param name=\"solidity\">Solidity/sidedness of the mesh.  \"Solid\" is only permitted if the mesh is closed.</param>\n        /// <param name=\"mass\">Mass of the mesh.</param>\n        public MobileMesh(Vector3[] vertices, uint[] indices,  AffineTransform localTransform, MobileMeshSolidity solidity, float mass)\n        {\n            ShapeDistributionInformation info;\n            var shape = new MobileMeshShape(vertices, indices, localTransform, solidity, out info);\n            Matrix3x3 inertia;\n            Matrix3x3.Multiply(ref info.VolumeDistribution, mass * InertiaHelper.InertiaTensorScale, out inertia);\n            Initialize(new MobileMeshCollidable(shape), mass, inertia, info.Volume);\n            Position = info.Center;\n        }\n\n\n\n\n    }\n\n\n}"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/Sphere.cs",
    "content": "using BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.EntityStateManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// Ball-shaped object that can collide and move.  After making an entity, add it to a Space so that the engine can manage it.\n    /// </summary>\n    public class Sphere : Entity<ConvexCollidable<SphereShape>>\n    {\n        /// <summary>\n        /// Radius of the sphere.\n        /// </summary>\n        public float Radius\n        {\n            get\n            {\n                return CollisionInformation.Shape.Radius;\n            }\n            set\n            {\n                CollisionInformation.Shape.Radius = value;\n            }\n        }\n\n        private Sphere(float radius)\n            :base(new ConvexCollidable<SphereShape>(new SphereShape(radius)))\n        {\n        }\n\n        private Sphere(float radius, float mass)\n            :base(new ConvexCollidable<SphereShape>(new SphereShape(radius)), mass)\n        {\n        }\n\n\n\n        /// <summary>\n        /// Constructs a physically simulated sphere.\n        /// </summary>\n        /// <param name=\"position\">Position of the sphere.</param>\n        /// <param name=\"radius\">Radius of the sphere.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Sphere(Vector3 position, float radius, float mass)\n            : this(radius, mass)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic sphere.\n        /// </summary>\n        /// <param name=\"position\">Position of the sphere.</param>\n        /// <param name=\"radius\">Radius of the sphere.</param>\n        public Sphere(Vector3 position, float radius)\n            : this(radius)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a physically simulated sphere.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"radius\">Radius of the sphere.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Sphere(MotionState motionState, float radius, float mass)\n            : this(radius, mass)\n        {\n            MotionState = motionState;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic sphere.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"radius\">Radius of the sphere.</param>\n        public Sphere(MotionState motionState, float radius)\n            : this(radius)\n        {\n            MotionState = motionState;\n        }\n\n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/TransformableEntity.cs",
    "content": "using BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.EntityStateManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// Ball-shaped object that can collide and move.  After making an entity, add it to a Space so that the engine can manage it.\n    /// </summary>\n    public class TransformableEntity : Entity<ConvexCollidable<TransformableShape>>\n    {\n        ///<summary>\n        /// Gets the shape on which the transformable shape is based.\n        ///</summary>\n        public ConvexShape Shape\n        {\n            get\n            {\n                return CollisionInformation.Shape.Shape;\n            }\n            set\n            {\n                CollisionInformation.Shape.Shape = value;\n            }\n        }\n\n        ///<summary>\n        /// Gets the linear transform that the shape uses to transform its base shape.\n        ///</summary>\n        public Matrix3x3 Transform\n        {\n            get\n            {\n                return CollisionInformation.Shape.Transform;\n            }\n            set\n            {\n                CollisionInformation.Shape.Transform = value;\n            }\n        }\n\n        private TransformableEntity(ConvexShape shape, Matrix3x3 transform)\n            : base(new ConvexCollidable<TransformableShape>(new TransformableShape(shape, transform)))\n        {\n        }\n\n        private TransformableEntity(ConvexShape shape, Matrix3x3 transform, float mass)\n            : base(new ConvexCollidable<TransformableShape>(new TransformableShape(shape, transform)), mass)\n        {\n        }\n\n\n\n        /// <summary>\n        /// Constructs a dynamic transformable entity.\n        /// </summary>\n        /// <param name=\"position\">Position of the entity.</param>\n        /// <param name=\"shape\">Shape to transform.</param>\n        /// <param name=\"transform\">Transform to apply to the shape.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public TransformableEntity(Vector3 position, ConvexShape shape, Matrix3x3 transform, float mass)\n            : this(shape, transform, mass)\n        {\n            Position = position;\n        }\n\n\n        /// <summary>\n        /// Constructs a kinematic transformable entity.\n        /// </summary>\n        /// <param name=\"position\">Position of the entity.</param>\n        /// <param name=\"shape\">Shape to transform.</param>\n        /// <param name=\"transform\">Transform to apply to the shape.</param>\n        public TransformableEntity(Vector3 position, ConvexShape shape, Matrix3x3 transform)\n            : this(shape, transform)\n        {\n            Position = position;\n        }\n\n\n        /// <summary>\n        /// Constructs a dynamic transformable entity.\n        /// </summary>\n        /// <param name=\"motionState\">Initial motion state of the entity.</param>\n        /// <param name=\"shape\">Shape to transform.</param>\n        /// <param name=\"transform\">Transform to apply to the shape.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public TransformableEntity(MotionState motionState, ConvexShape shape, Matrix3x3 transform, float mass)\n            : this(shape, transform, mass)\n        {\n            MotionState = motionState;\n        }\n\n        /// <summary>\n        /// Constructs a kinematic transformable entity.\n        /// </summary>\n        /// <param name=\"motionState\">Initial motion state of the entity.</param>\n        /// <param name=\"shape\">Shape to transform.</param>\n        /// <param name=\"transform\">Transform to apply to the shape.</param>\n        public TransformableEntity(MotionState motionState, ConvexShape shape, Matrix3x3 transform)\n            : this(shape, transform)\n        {\n            MotionState = motionState;\n        }\n\n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/Triangle.cs",
    "content": "using BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.EntityStateManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// Triangle-shaped object that can collide and move.  After making an entity, add it to a Space so that the engine can manage it.\n    /// </summary>\n    public class Triangle : Entity<ConvexCollidable<TriangleShape>>\n    {\n\n        ///<summary>\n        /// Gets or sets the first vertex of the triangle in local space.\n        ///</summary>\n        public Vector3 LocalVertexA\n        {\n            get\n            {\n                return CollisionInformation.Shape.VertexA;\n            }\n            set\n            {\n                CollisionInformation.Shape.VertexA = value;\n            }\n        }\n        ///<summary>\n        /// Gets or sets the second vertex of the triangle in local space.\n        ///</summary>\n        public Vector3 LocalVertexB\n        {\n            get\n            {\n                return CollisionInformation.Shape.VertexB;\n            }\n            set\n            {\n                CollisionInformation.Shape.VertexB = value;\n            }\n        }\n        ///<summary>\n        /// Gets or sets the third vertex of the triangle in local space.\n        ///</summary>\n        public Vector3 LocalVertexC\n        {\n            get\n            {\n                return CollisionInformation.Shape.VertexC;\n            }\n            set\n            {\n                CollisionInformation.Shape.VertexC = value;\n            }\n        }\n\n\n        ///<summary>\n        /// Gets or sets the first vertex of the triangle in world space.\n        ///</summary>\n        public Vector3 VertexA\n        {\n            get\n            {\n                return Matrix3x3.Transform(CollisionInformation.Shape.VertexA, orientationMatrix) + position;\n            }\n            set\n            {\n                CollisionInformation.Shape.VertexA = Matrix3x3.TransformTranspose(value - position, orientationMatrix);\n            }\n        }\n        ///<summary>\n        /// Gets or sets the second vertex of the triangle in world space.\n        ///</summary>\n        public Vector3 VertexB\n        {\n            get\n            {\n                return Matrix3x3.Transform(CollisionInformation.Shape.VertexB, orientationMatrix) + position;\n            }\n            set\n            {\n                CollisionInformation.Shape.VertexB = Matrix3x3.TransformTranspose(value - position, orientationMatrix);\n            }\n        }\n        ///<summary>\n        /// Gets or sets the third vertex of the triangle in world space.\n        ///</summary>\n        public Vector3 VertexC\n        {\n            get\n            {\n                return Matrix3x3.Transform(CollisionInformation.Shape.VertexC, orientationMatrix) + position;\n            }\n            set\n            {\n                CollisionInformation.Shape.VertexC = Matrix3x3.TransformTranspose(value - position, orientationMatrix);\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the sidedness of the triangle.\n        ///</summary>\n        public TriangleSidedness Sidedness\n        {\n            get { return CollisionInformation.Shape.Sidedness; }\n            set\n            {\n                CollisionInformation.Shape.Sidedness = value;\n            }\n        }\n\n\n\n        /// <summary>\n        /// Constructs a dynamic triangle.\n        /// </summary>\n        /// <param name=\"v1\">Position of the first vertex.</param>\n        /// <param name=\"v2\">Position of the second vertex.</param>\n        /// <param name=\"v3\">Position of the third vertex.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Triangle(Vector3 v1, Vector3 v2, Vector3 v3, float mass)\n        {\n            Vector3 center;\n            var shape = new TriangleShape(v1, v2, v3, out center);\n            Initialize(new ConvexCollidable<TriangleShape>(shape), mass);\n            Position = center;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic triangle.\n        /// </summary>\n        /// <param name=\"v1\">Position of the first vertex.</param>\n        /// <param name=\"v2\">Position of the second vertex.</param>\n        /// <param name=\"v3\">Position of the third vertex.</param>\n        public Triangle(Vector3 v1, Vector3 v2, Vector3 v3)\n        {\n            Vector3 center;\n            var shape = new TriangleShape(v1, v2, v3, out center);\n            Initialize(new ConvexCollidable<TriangleShape>(shape));\n            Position = center;\n        }\n\n        /// <summary>\n        /// Constructs a dynamic triangle.\n        /// </summary>\n        /// <param name=\"pos\">Position where the triangle is initialy centered.</param>\n        /// <param name=\"v1\">Position of the first vertex.</param>\n        /// <param name=\"v2\">Position of the second vertex.</param>\n        /// <param name=\"v3\">Position of the third vertex.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Triangle(Vector3 pos, Vector3 v1, Vector3 v2, Vector3 v3, float mass)\n            : this(v1, v2, v3, mass)\n        {\n            Position = pos;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic triangle.\n        /// </summary>\n        /// <param name=\"pos\">Position where the triangle is initially centered.</param>\n        /// <param name=\"v1\">Position of the first vertex.</param>\n        /// <param name=\"v2\">Position of the second vertex.</param>\n        /// <param name=\"v3\">Position of the third vertex.</param>\n        public Triangle(Vector3 pos, Vector3 v1, Vector3 v2, Vector3 v3)\n            : this(v1, v2, v3)\n        {\n            Position = pos;\n        }\n\n        /// <summary>\n        /// Constructs a dynamic triangle.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"v1\">Position of the first vertex.</param>\n        /// <param name=\"v2\">Position of the second vertex.</param>\n        /// <param name=\"v3\">Position of the third vertex.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public Triangle(MotionState motionState, Vector3 v1, Vector3 v2, Vector3 v3, float mass)\n            : this(v1, v2, v3, mass)\n        {\n            MotionState = motionState;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic triangle.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"v1\">Position of the first vertex.</param>\n        /// <param name=\"v2\">Position of the second vertex.</param>\n        /// <param name=\"v3\">Position of the third vertex.</param>\n        public Triangle(MotionState motionState, Vector3 v1, Vector3 v2, Vector3 v3)\n            : this(v1, v2, v3)\n        {\n            MotionState = motionState;\n        }\n\n\n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Entities/Prefabs/WrappedBody.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.EntityStateManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.Entities.Prefabs\n{\n    /// <summary>\n    /// A shape formed from the convex hull around its subbodies.  Can collide and move.  After making an entity, add it to a Space so that the engine can manage it.\n    /// </summary>\n    public class WrappedBody : Entity<ConvexCollidable<WrappedShape>>\n    {\n        ///<summary>\n        /// Gets the list of shapes in the wrapped body.\n        ///</summary>\n        public ObservableList<ConvexShapeEntry> Shapes\n        {\n            get\n            {\n                return CollisionInformation.Shape.Shapes;\n            }\n        }\n\n        /// <exception cref=\"ArgumentException\">Thrown when the subbodies list contains zero entities.</exception>\n        private WrappedBody(IList<ConvexShapeEntry> subShapes, float mass)\n        {\n            Vector3 center;\n            var shape = new WrappedShape(subShapes, out center);\n            Initialize(new ConvexCollidable<WrappedShape>(shape), mass);\n            Position = center;\n        }\n\n        /// <exception cref=\"ArgumentException\">Thrown when the subbodies list contains zero entities.</exception>\n        private WrappedBody(IList<ConvexShapeEntry> subShapes)\n        {\n            Vector3 center;\n            var shape = new WrappedShape(subShapes, out center);\n            Initialize(new ConvexCollidable<WrappedShape>(shape));\n            Position = center;\n        }\n\n        /// <summary>\n        /// Constructs a physically simulated box.\n        /// </summary>\n        /// <param name=\"position\">Position of the box.</param>\n        /// <param name=\"subBodies\">List of entities composing the body.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public WrappedBody(Vector3 position, IList<ConvexShapeEntry> subBodies, float mass)\n            : this(subBodies, mass)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic wrapped body.\n        /// </summary>\n        /// <param name=\"position\">Position of the box.</param>\n        /// <param name=\"subBodies\">List of entities composing the body.</param>\n        public WrappedBody(Vector3 position, IList<ConvexShapeEntry> subBodies)\n            : this(subBodies)\n        {\n            Position = position;\n        }\n\n        /// <summary>\n        /// Constructs a dynamic wrapped body.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"subBodies\">List of entities composing the body.</param>\n        /// <param name=\"mass\">Mass of the object.</param>\n        public WrappedBody(MotionState motionState, IList<ConvexShapeEntry> subBodies, float mass)\n            : this(subBodies, mass)\n        {\n            MotionState = motionState;\n        }\n\n        /// <summary>\n        /// Constructs a nondynamic wrapped body.\n        /// </summary>\n        /// <param name=\"motionState\">Motion state specifying the entity's initial state.</param>\n        /// <param name=\"subBodies\">List of entities composing the body.</param>\n        public WrappedBody(MotionState motionState, IList<ConvexShapeEntry> subBodies)\n            : this(subBodies)\n        {\n            MotionState = motionState;\n        }\n\n\n      \n    }\n}"
  },
  {
    "path": "BEPUphysics/EntityStateManagement/BufferedStatesAccessor.cs",
    "content": "﻿using Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.EntityStateManagement\n{\n    ///<summary>\n    /// Acts as an entity's view into the buffered states system.\n    /// Buffered states are updated each frame and contain the latest known states.\n    /// These states can also be written to.  Writes will not be immediately visible;\n    /// the next frame's write buffer flush will write the changes to the entities.\n    ///</summary>\n    public class BufferedStatesAccessor\n    {\n        internal EntityBufferedStates bufferedStates;\n        ///<summary>\n        /// Gets and sets the states write buffer used when buffered properties are written.\n        ///</summary>\n        public EntityStateWriteBuffer WriteBuffer { get; set; }\n        ///<summary>\n        /// Constructs a new accessor.\n        ///</summary>\n        ///<param name=\"bufferedStates\">The owning states system.</param>\n        public BufferedStatesAccessor(EntityBufferedStates bufferedStates)\n        {\n            this.bufferedStates = bufferedStates;\n        }\n\n        bool IsReadBufferAccessible()\n        {\n            return bufferedStates.BufferedStatesManager != null && bufferedStates.BufferedStatesManager.Enabled && bufferedStates.BufferedStatesManager.ReadBuffers.Enabled;\n        }\n\n        bool IsWriteBufferAccessible()\n        {\n            return WriteBuffer != null && WriteBuffer.Enabled;\n        }\n\n\n        ///<summary>\n        /// Gets or sets the buffered position of the entity.\n        ///</summary>\n        public Vector3 Position\n        {\n            get\n            {\n                if (IsReadBufferAccessible())\n                    return bufferedStates.BufferedStatesManager.ReadBuffers.GetState(bufferedStates.motionStateIndex).Position;\n                return bufferedStates.Entity.Position;\n            }\n            set\n            {\n                if (IsWriteBufferAccessible())\n                    WriteBuffer.EnqueuePosition(bufferedStates.Entity, ref value);\n                else\n                    bufferedStates.Entity.Position = value;\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the buffered orientation quaternion of the entity.\n        ///</summary>\n        public Quaternion Orientation\n        {\n            get\n            {\n                if (IsReadBufferAccessible())\n                    return bufferedStates.BufferedStatesManager.ReadBuffers.GetState(bufferedStates.motionStateIndex).Orientation;\n                return bufferedStates.Entity.Orientation;\n            }\n            set\n            {\n                if (IsWriteBufferAccessible())\n                    WriteBuffer.EnqueueOrientation(bufferedStates.Entity, ref value);\n                else\n                    bufferedStates.Entity.Orientation = value;\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the buffered orientation matrix of the entity.\n        ///</summary>\n        public Matrix3x3 OrientationMatrix\n        {\n            get\n            {\n                Matrix3x3 toReturn;\n                if (IsReadBufferAccessible())\n                {\n                    Quaternion o = bufferedStates.BufferedStatesManager.ReadBuffers.GetState(bufferedStates.motionStateIndex).Orientation;\n                    Matrix3x3.CreateFromQuaternion(ref o, out toReturn);\n                }\n                else\n                    Matrix3x3.CreateFromQuaternion(ref bufferedStates.Entity.orientation, out toReturn);\n                return toReturn;\n            }\n            set\n            {\n                if (IsWriteBufferAccessible())\n                {\n                    Quaternion toSet = Quaternion.Normalize(Quaternion.CreateFromRotationMatrix(Matrix3x3.ToMatrix4X4(value)));\n                    WriteBuffer.EnqueueOrientation(bufferedStates.Entity, ref toSet);\n                }\n                else\n                {\n                    bufferedStates.Entity.OrientationMatrix = value;\n                }\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the buffered linear velocity of the entity.\n        ///</summary>\n        public Vector3 LinearVelocity\n        {\n            get\n            {\n                if (IsReadBufferAccessible())\n                    return bufferedStates.BufferedStatesManager.ReadBuffers.GetState(bufferedStates.motionStateIndex).LinearVelocity;\n                return bufferedStates.Entity.LinearVelocity;\n            }\n            set\n            {\n                if (IsWriteBufferAccessible())\n                    WriteBuffer.EnqueueLinearVelocity(bufferedStates.Entity, ref value);\n                else\n                    bufferedStates.Entity.LinearVelocity = value;\n            }\n        }\n\n\n        ///<summary>\n        /// Gets or sets the buffered angular velocity of the entity.\n        ///</summary>\n        public Vector3 AngularVelocity\n        {\n            get\n            {\n                if (IsReadBufferAccessible())\n                    return bufferedStates.BufferedStatesManager.ReadBuffers.GetState(bufferedStates.motionStateIndex).AngularVelocity;\n                return bufferedStates.Entity.AngularVelocity;\n            }\n            set\n            {\n                if (IsWriteBufferAccessible())\n                    WriteBuffer.EnqueueAngularVelocity(bufferedStates.Entity, ref value);\n                else\n                    bufferedStates.Entity.AngularVelocity = value;\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the buffered world transform of the entity.\n        ///</summary>\n        public Matrix WorldTransform\n        {\n            get\n            {\n                if (IsReadBufferAccessible())\n                    return bufferedStates.BufferedStatesManager.ReadBuffers.GetState(bufferedStates.motionStateIndex).WorldTransform;\n                return bufferedStates.Entity.WorldTransform;\n            }\n            set\n            {\n                if (IsWriteBufferAccessible())\n                {\n                    Vector3 translation = value.Translation;\n                    Quaternion orientation;\n                    Quaternion.CreateFromRotationMatrix(ref value, out orientation);\n                    orientation.Normalize();\n                    WriteBuffer.EnqueueOrientation(bufferedStates.Entity, ref orientation);\n                    WriteBuffer.EnqueuePosition(bufferedStates.Entity, ref translation);\n                }\n                else\n                {\n                    bufferedStates.Entity.WorldTransform = value;\n                }\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the buffered motion state of the entity.\n        ///</summary>\n        public MotionState MotionState\n        {\n            get\n            {\n                if (IsReadBufferAccessible())\n                    return bufferedStates.BufferedStatesManager.ReadBuffers.GetState(bufferedStates.motionStateIndex);\n                return bufferedStates.Entity.MotionState;\n            }\n            set\n            {\n                if (IsWriteBufferAccessible())\n                {\n                    WriteBuffer.EnqueueLinearVelocity(bufferedStates.Entity, ref value.LinearVelocity);\n                    WriteBuffer.EnqueueAngularVelocity(bufferedStates.Entity, ref value.AngularVelocity);\n                    WriteBuffer.EnqueueOrientation(bufferedStates.Entity, ref value.Orientation);\n                    WriteBuffer.EnqueuePosition(bufferedStates.Entity, ref value.Position);\n                }\n                else\n                {\n                    bufferedStates.Entity.MotionState = value;\n                }\n            }\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/EntityStateManagement/BufferedStatesManager.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing BEPUphysics.Threading;\nusing BEPUutilities;\nusing BEPUphysics.Entities;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.EntityStateManagement\n{\n    ///<summary>\n    /// Manages the buffered and interpolated states of entities.\n    ///</summary>\n    public class BufferedStatesManager\n    {\n\n        ///<summary>\n        /// Gets the buffers of last known entity states.\n        ///</summary>\n        public StateReadBuffers ReadBuffers { get; private set; }\n        ///<summary>\n        /// Gets the entity states blended between the current frame and previous frame based on\n        /// the time remaining in internal time stepping.\n        ///</summary>\n        public InterpolatedStatesManager InterpolatedStates { get; private set; }\n\n        internal RawList<Entity> entities = new RawList<Entity>();\n\n        ///<summary>\n        /// Gets the list of entities in the manager.\n        ///</summary>\n        public ReadOnlyList<Entity> Entities\n        {\n            get\n            {\n                return new ReadOnlyList<Entity>(entities);\n            }\n        }\n\n        bool enabled;\n        ///<summary>\n        /// Gets or sets whether or not the buffered states manager and its submanagers are updating.\n        ///</summary>\n        public bool Enabled\n        {\n            get\n            {\n                return enabled;\n            }\n            set\n            {\n                if (!enabled && value)\n                {\n                    ReadBuffers.Enabled = true;\n                    InterpolatedStates.Enabled = true;\n                }\n                else if (enabled && !value)\n                {\n                    InterpolatedStates.Enabled = false;\n                    ReadBuffers.Enabled = false;\n                }\n                enabled = value;\n            }\n        }\n\n        ///<summary>\n        /// Constructs a new manager.\n        ///</summary>\n        public BufferedStatesManager()\n        {\n            InterpolatedStates = new InterpolatedStatesManager(this);\n            ReadBuffers = new StateReadBuffers(this);\n\n        }\n\n        ///<summary>\n        /// Constructs a new manager.\n        ///</summary>\n        ///<param name=\"threadManager\">Thread manager to be used by the manager.</param>\n        public BufferedStatesManager(IThreadManager threadManager)\n        {\n            InterpolatedStates = new InterpolatedStatesManager(this, threadManager);\n            ReadBuffers = new StateReadBuffers(this, threadManager);\n        }\n\n\n        ///<summary>\n        /// Adds an entity to the manager.\n        ///</summary>\n        ///<param name=\"e\">Entity to add.</param>\n        ///<exception cref=\"InvalidOperationException\">Thrown if the entity already belongs to a states manager.</exception>\n        public void Add(Entity e)\n        {\n            lock (InterpolatedStates.FlipLocker)\n            {\n                lock (ReadBuffers.FlipLocker)\n                {\n                    if (e.BufferedStates.BufferedStatesManager == null)\n                    {\n                        e.BufferedStates.BufferedStatesManager = this;\n                        e.BufferedStates.motionStateIndex = entities.Count;\n                        entities.Add(e);\n                        if (ReadBuffers.Enabled)\n                            ReadBuffers.Add(e);\n                        if (InterpolatedStates.Enabled)\n                            InterpolatedStates.Add(e);\n                    }\n                    else\n                        throw new InvalidOperationException(\"Entity already belongs to a BufferedStatesManager; cannot add.\");\n\n                }\n            }\n        }\n\n        ///<summary>\n        /// Removes an entity from the manager.\n        ///</summary>\n        ///<param name=\"e\">Entity to remove.</param>\n        ///<exception cref=\"InvalidOperationException\">Thrown if the entity does not belong to this manager.</exception>\n        public void Remove(Entity e)\n        {\n            lock (InterpolatedStates.FlipLocker)\n            {\n                lock (ReadBuffers.FlipLocker)\n                {\n                    if (e.BufferedStates.BufferedStatesManager == this)\n                    {\n                        int index = entities.IndexOf(e);\n\n                        int endIndex = entities.Count - 1;\n                        entities[index] = entities[endIndex];\n                        entities.RemoveAt(endIndex);\n                        if (index < entities.Count)\n                            entities[index].BufferedStates.motionStateIndex = index;\n                        if (ReadBuffers.Enabled)\n                            ReadBuffers.Remove(index, endIndex);\n                        if (InterpolatedStates.Enabled)\n                            InterpolatedStates.Remove(index, endIndex);\n\n                        e.BufferedStates.BufferedStatesManager = null;\n                    }\n                    else\n                        throw new InvalidOperationException(\"Entity does not belong to this BufferedStatesManager; cannot remove.\");\n\n                }\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/EntityStateManagement/EntityBufferedStates.cs",
    "content": "﻿using BEPUphysics.Entities;\n\nnamespace BEPUphysics.EntityStateManagement\n{\n    ///<summary>\n    /// Contains a single entity's buffered states.\n    ///</summary>\n    public class EntityBufferedStates\n    {\n        ///<summary>\n        /// Gets the buffered states manager that owns this entry.\n        ///</summary>\n        public BufferedStatesManager BufferedStatesManager { get; internal set; }\n\n        ///<summary>\n        /// Gets the buffered states accessor for this entity.\n        /// Contains the current snapshot of the entity's states.\n        ///</summary>\n        public BufferedStatesAccessor States { get; private set; }\n        ///<summary>\n        /// Gets the interpolated states accessor for this entity.\n        /// Contains a blended snapshot between the previous and current states based on the\n        /// internal timestepping remainder.\n        ///</summary>\n        public InterpolatedStatesAccessor InterpolatedStates { get; private set; }\n\n        internal int motionStateIndex;\n        ///<summary>\n        /// Gets the motion state index of this entity.\n        ///</summary>\n        public int MotionStateIndex { get { return motionStateIndex; } internal set { motionStateIndex = value; } }\n\n        ///<summary>\n        /// Constructs a new buffered states entry.\n        ///</summary>\n        ///<param name=\"entity\">Owning entity.</param>\n        public EntityBufferedStates(Entity entity)\n        {\n            Entity = entity;\n            States = new BufferedStatesAccessor(this);\n            InterpolatedStates = new InterpolatedStatesAccessor(this);\n        }\n\n        ///<summary>\n        /// Gets the entity owning this entry.\n        ///</summary>\n        public Entity Entity { get; private set; }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/EntityStateManagement/EntityStateReadBuffers.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUphysics.Threading;\nusing BEPUutilities;\n\nnamespace BEPUphysics.EntityStateManagement\n{\n    ///<summary>\n    /// Manages the buffered states of entities.\n    ///</summary>\n    public class StateReadBuffers : MultithreadedProcessingStage\n    {\n        ///<summary>\n        /// Gets or sets whether or not the buffers are active.\n        ///</summary>\n        ///<exception cref=\"InvalidOperationException\">Thrown if the read buffers are disabled while the interpolated states are enabled.</exception>\n        public override bool Enabled\n        {\n            get\n            {\n                return base.Enabled;\n            }\n            set\n            {\n                if (base.Enabled && !value)\n                {\n                    if (!manager.InterpolatedStates.Enabled)\n                        throw new InvalidOperationException(\"Cannot disable read buffers unless the interpolated states are disabled.\");\n                    Disable();\n                    base.Enabled = false;\n                }\n                else if (!base.Enabled && value)\n                {\n                    Enable();\n                    base.Enabled = true;\n                }\n            }\n        }\n        \n        internal void Enable()\n        {\n            //Turn everything on.\n            lock (FlipLocker)\n            {\n\n                int initialCount = Math.Max(manager.entities.Count, 64);\n                backBuffer = new MotionState[initialCount];\n                frontBuffer = new MotionState[initialCount];\n                for (int i = 0; i < manager.entities.Count; i++)\n                {\n                    Entity entity = manager.entities[i];\n                    backBuffer[i].Position = entity.position;\n                    backBuffer[i].Orientation = entity.orientation;\n                    backBuffer[i].LinearVelocity = entity.linearVelocity;\n                    backBuffer[i].AngularVelocity = entity.angularVelocity;\n                }\n                Array.Copy(backBuffer, frontBuffer, backBuffer.Length);\n            }\n        }\n\n        internal void Disable()\n        {\n            //Turn everything off.\n            lock (FlipLocker)\n            {\n                backBuffer = null;\n                frontBuffer = null;\n            }\n        }\n\n        private BufferedStatesManager manager;\n        ///<summary>\n        /// Gets the synchronization object which is locked during internal buffer flips.\n        /// Acquiring a lock on this object will prevent the manager from flipping the buffers\n        /// for the duration of the lock.\n        ///</summary>\n        public object FlipLocker { get; private set; }\n        internal MotionState[] backBuffer;\n        internal MotionState[] frontBuffer;\n\n        ///<summary>\n        /// Constructs a read buffer manager.\n        ///</summary>\n        ///<param name=\"manager\">Owning buffered states manager.</param>\n        public StateReadBuffers(BufferedStatesManager manager)\n        {\n            this.manager = manager;\n            multithreadedStateUpdateDelegate = MultithreadedStateUpdate;\n            FlipLocker = new object();\n        }\n\n        ///<summary>\n        /// Constructs a read buffer manager.\n        ///</summary>\n        ///<param name=\"manager\">Owning buffered states manager.</param>\n        ///<param name=\"threadManager\">Thread manager to use.</param>\n        public StateReadBuffers(BufferedStatesManager manager, IThreadManager threadManager)\n        {\n            this.manager = manager;\n            multithreadedStateUpdateDelegate = MultithreadedStateUpdate;\n            FlipLocker = new object();\n            ThreadManager = threadManager;\n            AllowMultithreading = true;\n        }\n\n\n        Action<int> multithreadedStateUpdateDelegate;\n        void MultithreadedStateUpdate(int i)\n        {\n            Entity entity = manager.entities[i];\n            backBuffer[i].Position = entity.position;\n            backBuffer[i].Orientation = entity.orientation;\n            backBuffer[i].LinearVelocity = entity.linearVelocity;\n            backBuffer[i].AngularVelocity = entity.angularVelocity;\n        }\n\n\n        protected override void UpdateMultithreaded()\n        {\n            ThreadManager.ForLoop(0, manager.entities.Count, multithreadedStateUpdateDelegate);\n            FlipBuffers();\n        }\n\n        protected override void UpdateSingleThreaded()\n        {\n            for (int i = 0; i < manager.entities.Count; i++)\n            {\n                Entity entity = manager.entities[i];\n                backBuffer[i].Position = entity.position;\n                backBuffer[i].Orientation = entity.orientation;\n                backBuffer[i].LinearVelocity = entity.linearVelocity;\n                backBuffer[i].AngularVelocity = entity.angularVelocity;\n            }\n            FlipBuffers();\n        }\n\n        internal void Add(Entity e)\n        {\n\n            //Don't need to lock since the parent manager handles it.\n            if (frontBuffer.Length <= e.BufferedStates.motionStateIndex)\n            {\n                var newStates = new MotionState[frontBuffer.Length * 2]; //TODO: shifty\n                frontBuffer.CopyTo(newStates, 0);\n                frontBuffer = newStates;\n            }\n            frontBuffer[e.BufferedStates.motionStateIndex].Position = e.position;\n            frontBuffer[e.BufferedStates.motionStateIndex].Orientation = e.orientation;\n\n            if (backBuffer.Length <= e.BufferedStates.motionStateIndex)\n            {\n                var newStates = new MotionState[backBuffer.Length * 2]; //TODO: shifty\n                backBuffer.CopyTo(newStates, 0);\n                backBuffer = newStates;\n            }\n            backBuffer[e.BufferedStates.motionStateIndex].Position = e.position;\n            backBuffer[e.BufferedStates.motionStateIndex].Orientation = e.orientation;\n        }\n\n        internal void Remove(int index, int endIndex)\n        {\n            //Don't need to lock since the parent manager handles it.\n            frontBuffer[index] = frontBuffer[endIndex];\n            backBuffer[index] = backBuffer[endIndex];\n        }\n\n        ///<summary>\n        /// Acquires a lock on the FlipLocker and forces the internal buffers to flip.\n        ///</summary>\n        public void FlipBuffers()\n        {\n            lock (FlipLocker)\n            {\n                MotionState[] formerFrontBuffer = frontBuffer;\n                frontBuffer = backBuffer;\n                backBuffer = formerFrontBuffer;\n            }\n        }\n\n        ///<summary>\n        /// Gets the state of the entity associated with the given index.\n        /// Does not lock the FlipLocker.\n        ///</summary>\n        ///<param name=\"motionStateIndex\">Index of the entity.</param>\n        ///<returns>MotionState of the entity at the index.</returns>\n        public MotionState GetState(int motionStateIndex)\n        {\n            return frontBuffer[motionStateIndex];\n        }\n\n        ///<summary>\n        /// Gets the states of all entities atomically.\n        ///</summary>\n        ///<param name=\"states\">Entity states.</param>\n        ///<exception cref=\"InvalidOperationException\">Thrown when the array is too small.</exception>\n        public void GetStates(MotionState[] states)\n        {\n            lock (FlipLocker)\n            {\n                if (states.Length < manager.entities.Count)\n                {\n                    throw new ArgumentException(\"Array is not large enough to hold the buffer.\", \"states\");\n                }\n                Array.Copy(frontBuffer, states, manager.entities.Count);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/EntityStateManagement/EntityStateWriteBuffer.cs",
    "content": "﻿using System.Runtime.InteropServices;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.EntityStateManagement\n{\n\n    ///<summary>\n    /// Buffer containing pending writes to entity states.\n    ///</summary>\n    public class EntityStateWriteBuffer : ProcessingStage\n    {\n        internal enum TargetField : byte\n        {\n            Position,\n            Orientation,\n            LinearVelocity,\n            AngularVelocity,\n        }\n\n        //TODO: Not a particularly elegant buffering mechanism.  Make a better in-order buffering scheme.\n        //There are platform requirements on layout that cause issues with the WINDOWS explicit version.\n        //TODO: There's probably a better way to handle it on the XBOX/WP7 than the \"give up\" approach taken below.\n#if WINDOWS\n        [StructLayout(LayoutKind.Explicit)]\n        internal struct EntityStateChange\n        {\n            [FieldOffset(0)]\n            internal Quaternion orientationQuaternion;\n            [FieldOffset(0)]\n            internal Vector3 vector;\n            [FieldOffset(16)]\n            internal TargetField targetField;\n            [FieldOffset(24)]\n            internal Entity target;\n        }\n#else\n        internal struct EntityStateChange\n        {\n            internal Quaternion orientationQuaternion;\n            internal Vector3 vector;\n            internal TargetField targetField;\n            internal Entity target;\n        }\n#endif\n\n        private ConcurrentDeque<EntityStateChange> stateChanges = new ConcurrentDeque<EntityStateChange>();\n\n        ///<summary>\n        /// Constructs the write buffer.\n        ///</summary>\n        public EntityStateWriteBuffer()\n        {\n            Enabled = true;\n        }\n\n        ///<summary>\n        /// Enqueues a change to an entity's position.\n        ///</summary>\n        ///<param name=\"entity\">Entity to target.</param>\n        ///<param name=\"newPosition\">New position of the entity.</param>\n        public void EnqueuePosition(Entity entity, ref Vector3 newPosition)\n        {\n            stateChanges.Enqueue(new EntityStateChange { target = entity, vector = newPosition, targetField = TargetField.Position });\n        }\n        ///<summary>\n        /// Enqueues a change to an entity's orientation.\n        ///</summary>\n        ///<param name=\"entity\">Entity to target.</param>\n        ///<param name=\"newOrientationQuaternion\">New orientation of the entity.</param>\n        public void EnqueueOrientation(Entity entity, ref Quaternion newOrientationQuaternion)\n        {\n            stateChanges.Enqueue(new EntityStateChange { target = entity, orientationQuaternion = newOrientationQuaternion, targetField = TargetField.Orientation });\n        }\n        ///<summary>\n        /// Enqueues a change to an entity's linear velocity.\n        ///</summary>\n        ///<param name=\"entity\">Entity to target.</param>\n        ///<param name=\"newLinearVelocity\">New linear velocity of the entity.</param>\n        public void EnqueueLinearVelocity(Entity entity, ref Vector3 newLinearVelocity)\n        {\n            stateChanges.Enqueue(new EntityStateChange { target = entity, vector = newLinearVelocity, targetField = TargetField.LinearVelocity });\n        }\n        ///<summary>\n        /// Enqueues a change to an entity's angular velocity.\n        ///</summary>\n        ///<param name=\"entity\">Entity to target.</param>\n        ///<param name=\"newAngularVelocity\">New angular velocity of the entity.</param>\n        public void EnqueueAngularVelocity(Entity entity, ref Vector3 newAngularVelocity)\n        {\n            stateChanges.Enqueue(new EntityStateChange { target = entity, vector = newAngularVelocity, targetField = TargetField.AngularVelocity });\n        }\n\n\n        protected override void UpdateStage()\n        {\n            EntityStateChange item;\n            while (stateChanges.TryDequeueFirst(out item))\n            {\n                Entity target = item.target;\n                switch (item.targetField)\n                {\n                    case TargetField.Position:\n                        target.Position = item.vector;\n                        break;\n                    case TargetField.Orientation:\n                        target.Orientation = item.orientationQuaternion;\n                        break;\n                    case TargetField.LinearVelocity:\n                        target.LinearVelocity = item.vector;\n                        break;\n                    case TargetField.AngularVelocity:\n                        target.AngularVelocity = item.vector;\n                        break;\n                }\n            }\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/EntityStateManagement/InterpolatedStatesAccessor.cs",
    "content": "﻿using Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.EntityStateManagement\n{\n    ///<summary>\n    /// Accesses an entity's interpolated states.\n    /// Interpolated states are blended states between the previous and current entity states based\n    /// on the time remainder from interal timestepping.\n    ///</summary>\n    public class InterpolatedStatesAccessor\n    {\n        internal EntityBufferedStates bufferedStates;\n        ///<summary>\n        /// Constructs a new accessor.\n        ///</summary>\n        ///<param name=\"bufferedStates\">Owning entry.</param>\n        public InterpolatedStatesAccessor(EntityBufferedStates bufferedStates)\n        {\n            this.bufferedStates = bufferedStates;\n        }\n\n        bool IsBufferAccessible()\n        {\n            return bufferedStates.BufferedStatesManager != null && bufferedStates.BufferedStatesManager.Enabled && bufferedStates.BufferedStatesManager.InterpolatedStates.Enabled;\n        }\n\n\n\n        ///<summary>\n        /// Gets the interpolated position of the entity.\n        ///</summary>\n        public Vector3 Position\n        {\n            get\n            {\n                if (IsBufferAccessible())\n                    return bufferedStates.BufferedStatesManager.InterpolatedStates.GetState(bufferedStates.motionStateIndex).Position;\n                return bufferedStates.Entity.Position;\n            }\n        }\n\n        ///<summary>\n        /// Gets the interpolated orientation of the entity.\n        ///</summary>\n        public Quaternion Orientation\n        {\n            get\n            {\n                if (IsBufferAccessible())\n                    return bufferedStates.BufferedStatesManager.InterpolatedStates.GetState(bufferedStates.motionStateIndex).Orientation;\n                return bufferedStates.Entity.Orientation;\n            }\n        }\n\n        ///<summary>\n        /// Gets the interpolated orientation matrix of the entity.\n        ///</summary>\n        public Matrix3x3 OrientationMatrix\n        {\n            get\n            {\n                Matrix3x3 toReturn;\n                if (IsBufferAccessible())\n                {\n                    Quaternion o = bufferedStates.BufferedStatesManager.InterpolatedStates.GetState(bufferedStates.motionStateIndex).Orientation;\n                    Matrix3x3.CreateFromQuaternion(ref o, out toReturn);\n                }\n                else\n                    Matrix3x3.CreateFromQuaternion(ref bufferedStates.Entity.orientation, out toReturn);\n                return toReturn;\n            }\n        }\n\n        ///<summary>\n        /// Gets the interpolated world transform of the entity.\n        ///</summary>\n        public Matrix WorldTransform\n        {\n            get\n            {\n                if (IsBufferAccessible())\n                    return bufferedStates.BufferedStatesManager.InterpolatedStates.GetState(bufferedStates.motionStateIndex).Matrix;\n                return bufferedStates.Entity.WorldTransform;\n            }\n        }\n\n        ///<summary>\n        /// Gets the interpolated rigid transform of the entity.\n        ///</summary>\n        public RigidTransform RigidTransform\n        {\n            get\n            {\n                if (IsBufferAccessible())\n                    return bufferedStates.BufferedStatesManager.InterpolatedStates.GetState(bufferedStates.motionStateIndex);\n                var toReturn = new RigidTransform\n                                   {\n                                       Position = bufferedStates.Entity.position,\n                                       Orientation = bufferedStates.Entity.orientation\n                                   };\n                return toReturn;\n            }\n\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/EntityStateManagement/InterpolatedStatesManager.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUphysics.Threading;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.EntityStateManagement\n{\n    ///<summary>\n    /// Manages the interpolated states of entities.  Interpolated states are those\n    /// based on the previous entity states and the current entity states, blended together\n    /// using the time remainder from internal time stepping.\n    ///</summary>\n    public class InterpolatedStatesManager : MultithreadedProcessingStage\n    {\n        ///<summary>\n        /// Gets or sets whether or not the manager is updating.\n        ///</summary>\n        ///<exception cref=\"InvalidOperationException\">Thrown when enabling the interpolated manager without having the read buffers active.</exception>\n        public override bool Enabled\n        {\n            get\n            {\n                return base.Enabled;\n            }\n            set\n            {\n                if (base.Enabled && !value)\n                {\n                    Disable();\n                    base.Enabled = false;\n                }\n                else if (!base.Enabled && value)\n                {\n                    if (!manager.ReadBuffers.Enabled)\n                        throw new InvalidOperationException(\"Cannot enable interpolated states unless the read buffers are enabled.\");\n                    Enable();\n                    base.Enabled = true;\n                }\n            }\n        }\n\n        internal void Enable()\n        {\n            //Turn everything on.\n            lock (FlipLocker)\n            {\n                int initialCount = Math.Max(manager.entities.Count, 64);\n                backBuffer = new RigidTransform[initialCount];\n                states = new RigidTransform[initialCount];\n                for (int i = 0; i < manager.entities.Count; i++)\n                {\n                    Entity entity = manager.entities[i];\n                    backBuffer[i].Position = entity.position;\n                    backBuffer[i].Orientation = entity.orientation;\n                }\n                Array.Copy(backBuffer, states, backBuffer.Length);\n            }\n\n        }\n\n        internal void Disable()\n        {\n            //Turn everything off.\n            lock (FlipLocker)\n            {\n                backBuffer = null;\n                states = null;\n            }\n        }\n        private BufferedStatesManager manager;\n        ///<summary>\n        /// Gets the synchronization object locked prior to flipping the internal buffers.\n        /// Acquiring a lock on this object will prevent the internal buffers from flipping for the duration\n        /// of the lock.\n        ///</summary>\n        public object FlipLocker { get; private set; }\n\n        RigidTransform[] backBuffer;\n        RigidTransform[] states = new RigidTransform[64];\n\n        ///<summary>\n        /// Constructs a new interpolated states manager.\n        ///</summary>\n        ///<param name=\"manager\">Owning buffered states manager.</param>\n        public InterpolatedStatesManager(BufferedStatesManager manager)\n        {\n            this.manager = manager;\n            multithreadedWithReadBuffersDelegate = UpdateIndex;\n            FlipLocker = new object();\n        }\n\n        ///<summary>\n        /// Constructs a new interpolated states manager.\n        ///</summary>\n        ///<param name=\"manager\">Owning buffered states manager.</param>\n        /// <param name=\"threadManager\">Thread manager to use.</param>\n        public InterpolatedStatesManager(BufferedStatesManager manager, IThreadManager threadManager)\n        {\n            this.manager = manager;\n            multithreadedWithReadBuffersDelegate = UpdateIndex;\n            FlipLocker = new object();\n            ThreadManager = threadManager;\n            AllowMultithreading = true;\n        }\n\n\n        float blendAmount;\n        ///<summary>\n        /// Gets or sets the blending amount to use.\n        /// This is set automatically when the space is using internal timestepping\n        /// (I.E. when Space.Update(dt) is called).  It is a value from 0 to 1\n        /// that defines the amount of the previous and current frames to include\n        /// in the blended state.  A value of 1 means use only the current frame;\n        /// a value of 0 means use only the previous frame.\n        ///</summary>\n        public float BlendAmount\n        {\n            get\n            {\n                return blendAmount;\n            }\n            set\n            {\n                blendAmount = MathHelper.Clamp(value, 0, 1);\n            }\n        }\n\n        Action<int> multithreadedWithReadBuffersDelegate;\n        void UpdateIndex(int i)\n        {\n            Entity entity = manager.entities[i];\n            //Blend between previous and current states.\n            //Interpolated updates occur after proper updates complete.\n            //That means that the internal positions and the front buffer positions are equivalent.\n            //However, the backbuffer is uncontested and contains the previous frame's data.\n            Vector3.Lerp(ref manager.ReadBuffers.backBuffer[i].Position, ref entity.position, blendAmount, out backBuffer[i].Position);\n            Quaternion.Slerp(ref manager.ReadBuffers.backBuffer[i].Orientation, ref entity.orientation, blendAmount, out backBuffer[i].Orientation);\n        }\n\n\n\n        protected override void UpdateMultithreaded()\n        {\n            ThreadManager.ForLoop(0, manager.entities.Count, multithreadedWithReadBuffersDelegate);\n            FlipBuffers();\n        }\n\n        protected override void UpdateSingleThreaded()\n        {\n            for (int i = 0; i < manager.entities.Count; i++)\n            {\n                UpdateIndex(i);\n            }\n            FlipBuffers();\n        }\n\n        ///<summary>\n        /// Acquires a lock on the FlipLocker and flips the internal buffers.\n        ///</summary>\n        public void FlipBuffers()\n        {\n            lock (FlipLocker)\n            {\n                RigidTransform[] formerFrontBuffer = states;\n                states = backBuffer;\n                backBuffer = formerFrontBuffer;\n            }\n        }\n\n        ///<summary>\n        /// Returns an interpolated state associated with an entity with the given index.\n        /// Does not lock the FlipLocker.\n        ///</summary>\n        ///<param name=\"motionStateIndex\">Motion state of the entity.</param>\n        ///<returns>Interpolated state associated with the entity at the given index.</returns>\n        public RigidTransform GetState(int motionStateIndex)\n        {\n            return states[motionStateIndex];\n        }\n\n        ///<summary>\n        /// Gets the interpolated states of all entities.\n        ///</summary>\n        ///<param name=\"states\">Interpolated states of all entities.</param>\n        ///<exception cref=\"InvalidOperationException\">Thrown when the array is too small to hold the states.</exception>\n        public void GetStates(RigidTransform[] states)\n        {\n            lock (FlipLocker)\n            {\n                if (states.Length < manager.entities.Count)\n                {\n                    throw new ArgumentException(\"Array is not large enough to hold the buffer.\", \"states\");\n                }\n                Array.Copy(this.states, states, manager.entities.Count);\n            }\n        }\n\n        internal void Add(Entity e)\n        {\n            //Don't need to lock since the parent manager handles it.\n            if (states.Length <= e.BufferedStates.motionStateIndex)\n            {\n                var newStates = new RigidTransform[states.Length * 2];\n                states.CopyTo(newStates, 0);\n                states = newStates;\n            }\n            states[e.BufferedStates.motionStateIndex].Position = e.position;\n            states[e.BufferedStates.motionStateIndex].Orientation = e.orientation;\n\n            if (backBuffer.Length <= e.BufferedStates.motionStateIndex)\n            {\n                var newStates = new RigidTransform[backBuffer.Length * 2];\n                backBuffer.CopyTo(newStates, 0);\n                backBuffer = newStates;\n            }\n            backBuffer[e.BufferedStates.motionStateIndex].Position = e.position;\n            backBuffer[e.BufferedStates.motionStateIndex].Orientation = e.orientation;\n        }\n\n        internal void Remove(int index, int endIndex)\n        {\n            //Don't need to lock since the parent manager handles it.\n            states[index] = states[endIndex];\n            backBuffer[index] = backBuffer[endIndex];\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/EntityStateManagement/MotionState.cs",
    "content": "﻿using Microsoft.Xna.Framework;\nusing System;\n\nnamespace BEPUphysics.EntityStateManagement\n{\n    ///<summary>\n    /// State describing the position, orientation, and velocity of an entity.\n    ///</summary>\n    public struct MotionState : IEquatable<MotionState>\n    {\n        ///<summary>\n        /// Position of an entity.\n        ///</summary>\n        public Vector3 Position;\n        ///<summary>\n        /// Orientation of an entity.\n        ///</summary>\n        public Quaternion Orientation;\n        ///<summary>\n        /// Orientation matrix of an entity.\n        ///</summary>\n        public Matrix OrientationMatrix\n        {\n            get\n            {\n                Matrix toReturn;\n                Matrix.CreateFromQuaternion(ref Orientation, out toReturn);\n                return toReturn;\n            }\n        }\n        ///<summary>\n        /// World transform of an entity.\n        ///</summary>\n        public Matrix WorldTransform\n        {\n            get\n            {\n                Matrix toReturn;\n                Matrix.CreateFromQuaternion(ref Orientation, out toReturn);\n                toReturn.Translation = Position;\n                return toReturn;\n            }\n        }\n        ///<summary>\n        /// Linear velocity of an entity.\n        ///</summary>\n        public Vector3 LinearVelocity;\n        ///<summary>\n        /// Angular velocity of an entity.\n        ///</summary>\n        public Vector3 AngularVelocity;\n\n\n        public bool Equals(MotionState other)\n        {\n            return other.AngularVelocity == AngularVelocity &&\n                   other.LinearVelocity == LinearVelocity &&\n                   other.Position == Position &&\n                   other.Orientation == Orientation;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/ISpace.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing System.Collections.ObjectModel;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics\n{\n    ///<summary>\n    /// Defines the minimum interface required for a Space object which acts as the main simulation class.\n    ///</summary>\n    public interface ISpace\n    {\n        ///<summary>\n        /// Adds a space object to the simulation.\n        ///</summary>\n        ///<param name=\"spaceObject\">Space object to add.</param>\n        void Add(ISpaceObject spaceObject);\n        ///<summary>\n        /// Removes a space object from the simulation.\n        ///</summary>\n        ///<param name=\"spaceObject\">Space object to remove.</param>\n        void Remove(ISpaceObject spaceObject);\n\n        ///<summary>\n        /// Performs a single timestep.\n        ///</summary>\n        void Update();\n\n        /// <summary>\n        /// Performs as many timesteps as necessary to get as close to the elapsed time as possible.\n        /// </summary>\n        /// <param name=\"dt\">Elapsed time from the previous frame.</param>\n        void Update(float dt); //Does as many timesteps as necessary, obeying the timing requirements.\n\n        ///<summary>\n        /// Gets the list of entities in the space.\n        ///</summary>\n        ReadOnlyList<Entity> Entities { get; }\n\n        /// <summary>\n        /// Tests a ray against the space.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"result\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        bool RayCast(Ray ray, out RayCastResult result);\n\n        /// <summary>\n        /// Tests a ray against the space.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"filter\">Delegate to prune out hit candidates before performing a ray cast against them.</param>\n        /// <param name=\"result\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        bool RayCast(Ray ray, Func<BroadPhaseEntry, bool> filter, out RayCastResult result);\n\n        /// <summary>\n        /// Tests a ray against the space.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        /// <param name=\"result\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        bool RayCast(Ray ray, float maximumLength, out RayCastResult result);\n\n        /// <summary>\n        /// Tests a ray against the space.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        /// <param name=\"filter\">Delegate to prune out hit candidates before performing a ray cast against them.</param>\n        /// <param name=\"result\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        bool RayCast(Ray ray, float maximumLength, Func<BroadPhaseEntry, bool> filter, out RayCastResult result);\n\n        /// <summary>\n        /// Tests a ray against the space, possibly returning multiple hits.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        /// <param name=\"outputRayCastResults\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        bool RayCast(Ray ray, float maximumLength, IList<RayCastResult> outputRayCastResults);\n\n        /// <summary>\n        /// Tests a ray against the space, possibly returning multiple hits.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        /// <param name=\"filter\">Delegate to prune out hit candidates before performing a ray cast against them.</param>\n        /// <param name=\"outputRayCastResults\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        bool RayCast(Ray ray, float maximumLength, Func<BroadPhaseEntry, bool> filter, IList<RayCastResult> outputRayCastResults);\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/ISpaceObject.cs",
    "content": "﻿namespace BEPUphysics\n{\n    ///<summary>\n    /// Defines an object which can be managed by an ISpace.\n    ///</summary>\n    public interface ISpaceObject\n    {\n        /// <summary>\n        /// Gets the Space to which the object belongs.\n        /// </summary>\n        ISpace Space { get; set; }\n        /// <summary>\n        /// Called after the object is added to a space.\n        /// </summary>\n        /// <param name=\"newSpace\">Space to which the object was added.</param>\n        void OnAdditionToSpace(ISpace newSpace);\n        /// <summary>\n        /// Called before an object is removed from its space.\n        /// </summary>\n        /// <param name=\"oldSpace\">Space from which the object was removed.</param>\n        void OnRemovalFromSpace(ISpace oldSpace);\n        /// <summary>\n        /// Gets or sets the user data associated with this object.\n        /// </summary>\n        object Tag { get; set; }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Materials/IMaterialOwner.cs",
    "content": "﻿namespace BEPUphysics.Materials\n{\n    ///<summary>\n    /// Defines an object that has a material.\n    ///</summary>\n    public interface IMaterialOwner\n    {\n        ///<summary>\n        /// Gets or sets the material of the object.\n        ///</summary>\n        Material Material { get; set; }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Materials/InteractionProperties.cs",
    "content": "﻿namespace BEPUphysics.Materials\n{\n    ///<summary>\n    /// Contains the blended friction and bounciness of a pair of objects.\n    ///</summary>\n    public struct InteractionProperties\n    {\n        ///<summary>\n        /// Kinetic friction between the pair of objects.\n        ///</summary>\n        public float KineticFriction;\n        ///<summary>\n        /// Static friction between the pair of objects.\n        ///</summary>\n        public float StaticFriction;\n        ///<summary>\n        /// Bounciness between the pair of objects.\n        ///</summary>\n        public float Bounciness;\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Materials/Material.cs",
    "content": "﻿using System;\n\nnamespace BEPUphysics.Materials\n{\n    ///<summary>\n    /// Material properties for collidable objects.\n    ///</summary>\n    public class Material\n    {\n        internal float kineticFriction = MaterialManager.DefaultKineticFriction;\n        ///<summary>\n        /// Gets or sets the friction coefficient used when the object is sliding quickly and\n        /// no special material relationship is defined between the colliding objects.\n        ///</summary>\n        public float KineticFriction\n        {\n            get\n            {\n                return kineticFriction;\n            }\n            set\n            {\n                kineticFriction = value;\n                if (MaterialChanged != null)\n                    MaterialChanged(this);\n            }\n        }\n\n        internal float staticFriction = MaterialManager.DefaultStaticFriction;\n        ///<summary>\n        /// Gets or sets the friction coefficient used when the object is sliding slowly and\n        /// no special material relationship is defined between the colliding objects.\n        ///</summary>\n        public float StaticFriction\n        {\n            get\n            {\n                return staticFriction;\n            }\n            set\n            {\n                staticFriction = value;\n                if (MaterialChanged != null)\n                    MaterialChanged(this);\n            }\n        }\n\n\n        internal float bounciness = MaterialManager.DefaultBounciness;\n        ///<summary>\n        /// Gets or sets the coefficient of restitution between the objects when\n        /// no special material relationship is defined between the colliding objects.\n        ///</summary>\n        public float Bounciness\n        {\n            get\n            {\n                return bounciness;\n            }\n            set\n            {\n                bounciness = value;\n                if (MaterialChanged != null)\n                    MaterialChanged(this);\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets user data associated with the material.\n        ///</summary>\n        public object Tag { get; set; }\n        int hashCode;\n        ///<summary>\n        /// Constructs a new material.\n        ///</summary>\n        public Material()\n        {\n            hashCode = (int)(((uint)GetHashCode()) * 19999999);\n        }\n\n        ///<summary>\n        /// Constructs a new material.\n        ///</summary>\n        ///<param name=\"staticFriction\">Static friction to use.</param>\n        ///<param name=\"kineticFriction\">Kinetic friction to use.</param>\n        ///<param name=\"bounciness\">Bounciness to use.</param>\n        public Material(float staticFriction, float kineticFriction, float bounciness)\n            : this()\n        {\n            this.staticFriction = staticFriction;\n            this.kineticFriction = kineticFriction;\n            this.bounciness = bounciness;\n        }\n\n        /// <summary>\n        /// Serves as a hash function for a particular type. \n        /// </summary>\n        /// <returns>\n        /// A hash code for the current <see cref=\"T:System.Object\"/>.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            return hashCode;\n        }\n\n        ///<summary>\n        /// Fires when the material properties change.\n        ///</summary>\n        public event Action<Material> MaterialChanged;\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Materials/MaterialManager.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace BEPUphysics.Materials\n{\n    /// <summary>\n    /// A function which takes two materials and computes the interaction properties between them.\n    /// </summary>\n    /// <param name=\"a\">First material to blend.</param>\n    /// <param name=\"b\">Second material to blend.</param>\n    /// <param name=\"properties\">Interaction properties between the two materials.</param>\n    public delegate void MaterialBlender(Material a, Material b, out InteractionProperties properties);\n\n    ///<summary>\n    /// Manages the relationship between materials.\n    ///</summary>\n    public static class MaterialManager\n    {\n        /// <summary>\n        /// Delegate used to blend two materials together when there is no special handler defined in the MaterialInteractions dictionary.\n        /// </summary>\n        public static MaterialBlender MaterialBlender = DefaultMaterialBlender;\n\n\n        ///<summary>\n        /// Default coefficient of kinetic friction. \n        /// Defaults to 0.8.\n        ///</summary>\n        public static float DefaultKineticFriction = .8f;\n        ///<summary>\n        /// Default coefficient of static friction.\n        /// Defaults to 1.\n        ///</summary>\n        public static float DefaultStaticFriction = 1f;\n        ///<summary>\n        /// Default coefficient of restitution.\n        /// Defaults to 0.\n        ///</summary>\n        public static float DefaultBounciness;\n\n        static MaterialManager()\n        {\n            MaterialInteractions = new Dictionary<MaterialPair, MaterialBlender>();\n        }\n\n        ///<summary>\n        /// Computes the interaction properties between two materials.\n        ///</summary>\n        ///<param name=\"materialA\">First material of the pair.</param>\n        ///<param name=\"materialB\">Second material of the pair.</param>\n        ///<param name=\"properties\">Interaction properties between two materials.</param>\n        public static void GetInteractionProperties(Material materialA, Material materialB, out InteractionProperties properties)\n        {\n            MaterialBlender specialBlender;\n            if (MaterialInteractions.TryGetValue(new MaterialPair(materialA, materialB), out specialBlender))\n                specialBlender(materialA, materialB, out properties);\n            else\n                MaterialBlender(materialA, materialB, out properties);\n\n        }\n\n\n\n        ///<summary>\n        /// Gets or sets the material interactions dictionary.\n        /// This dictionary contains all the special relationships between specific materials.\n        /// These interaction properties will override properties obtained by normal blending.\n        ///</summary>\n        public static Dictionary<MaterialPair, MaterialBlender> MaterialInteractions { get; set; }\n\n        /// <summary>\n        /// Blender used to combine materials into a pair's interaction properties.\n        /// </summary>\n        /// <param name=\"a\">Material associated with the first object to blend.</param>\n        /// <param name=\"b\">Material associated with the second object to blend.</param>\n        /// <param name=\"properties\">Blended material values.</param>\n        public static void DefaultMaterialBlender(Material a, Material b, out InteractionProperties properties)\n        {\n            properties = new InteractionProperties\n            {\n                Bounciness = a.bounciness * b.bounciness,\n                KineticFriction = a.kineticFriction * b.kineticFriction,\n                StaticFriction = a.staticFriction * b.staticFriction\n            };\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Materials/MaterialPair.cs",
    "content": "﻿using System;\nnamespace BEPUphysics.Materials\n{\n    ///<summary>\n    /// A pair of materials.\n    ///</summary>\n    public struct MaterialPair :IEquatable<MaterialPair>\n    {\n        ///<summary>\n        /// First material in the pair.\n        ///</summary>\n        public Material MaterialA;\n        ///<summary>\n        /// Second material in the pair.\n        ///</summary>\n        public Material MaterialB;\n        ///<summary>\n        /// Constructs a new material pair.\n        ///</summary>\n        ///<param name=\"a\">First material in the pair.</param>\n        ///<param name=\"b\">Second material in the pair.</param>\n        public MaterialPair(Material a, Material b)\n        {\n            MaterialA = a;\n            MaterialB = b;\n        }\n\n        /// <summary>\n        /// Returns the hash code for this instance.\n        /// </summary>\n        /// <returns>\n        /// A 32-bit signed integer that is the hash code for this instance.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            return MaterialA.GetHashCode() + MaterialB.GetHashCode();\n        }\n\n\n        /// <summary>\n        /// Determines if the two material pairs have the same materials.\n        /// </summary>\n        /// <param name=\"other\">Other pair to compare against.</param>\n        /// <returns>Whether or not the two pairs have the same materials.</returns>\n        public bool Equals(MaterialPair other)\n        {\n            return (other.MaterialA == MaterialA && other.MaterialB == MaterialB) || (other.MaterialA == MaterialB && other.MaterialB == MaterialA);\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/MultithreadedProcessingStage.cs",
    "content": "﻿using System;\nusing BEPUphysics.Threading;\n\nnamespace BEPUphysics\n{\n    ///<summary>\n    /// Superclass of processing systems which can use multiple threads.\n    ///</summary>\n    public abstract class MultithreadedProcessingStage\n    {\n        ///<summary>\n        /// Gets or sets whether or not the processing stage is active.\n        ///</summary>\n        public virtual bool Enabled { get; set; }\n\n        ///<summary>\n        /// Gets or sets whether or not the processing stage should allow multithreading.\n        ///</summary>\n        public bool AllowMultithreading { get; set; }\n\n        ///<summary>\n        /// Gets or sets the thread manager used by the stage.\n        ///</summary>\n        public IThreadManager ThreadManager { get; set; }\n\n        ///<summary>\n        /// Fires when the processing stage begins working.\n        ///</summary>\n        public event Action Starting;\n\n        /// <summary>\n        /// Fires when the processing stage finishes working.\n        /// </summary>\n        public event Action Finishing;\n\n        protected bool ShouldUseMultithreading\n        {\n            get\n            {\n                return AllowMultithreading && ThreadManager != null && ThreadManager.ThreadCount > 1;\n            }\n        }\n\n#if PROFILE\n        /// <summary>\n        /// Gets the time elapsed in the previous execution of this stage, not including any hooked Starting or Finishing events.\n        /// </summary>\n        public double Time\n        {\n            get\n            {\n                return (end - start) / (double)Stopwatch.Frequency;\n            }\n        }\n\n        long start, end;\n\n        private void StartClock()\n        {\n            start = Stopwatch.GetTimestamp();\n        }\n        private void StopClock()\n        {\n            end = Stopwatch.GetTimestamp();\n        }\n#endif\n\n        ///<summary>\n        /// Runs the processing stage.\n        ///</summary>\n        public void Update()\n        {\n            if (!Enabled)\n                return;\n            if (Starting != null)\n                Starting();\n#if PROFILE\n            StartClock();\n#endif\n            if (ShouldUseMultithreading)\n            {\n                UpdateMultithreaded();\n            }\n            else\n            {\n                UpdateSingleThreaded();\n            }\n#if PROFILE\n            StopClock();\n#endif\n            if (Finishing != null)\n                Finishing();\n        }\n        protected abstract void UpdateMultithreaded();\n        protected abstract void UpdateSingleThreaded();\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/NarrowPhase.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.Constraints;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing BEPUphysics.SolverSystems;\nusing BEPUphysics.Threading;\nusing BEPUutilities;\nusing BEPUphysics.CollisionRuleManagement;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.NarrowPhaseSystems\n{\n    ///<summary>\n    /// Pair of types.\n    ///</summary>\n    public struct TypePair : IEquatable<TypePair>\n    {\n        //Currently this requires some reflective labor.  If perhaps the broad phase entries had some sort of 'id'... and they simply return that int through the interface.\n        //Could be 'faster' assuming the supporting logic that creates the ids to begin with isn't too obtuse.\n        ///<summary>\n        /// First type in the pair.\n        ///</summary>\n        public Type A;\n\n        ///<summary>\n        /// Second type in the pair.\n        ///</summary>\n        public Type B;\n\n        ///<summary>\n        /// Constructs a new type pair.\n        ///</summary>\n        ///<param name=\"a\">First type in the pair.</param>\n        ///<param name=\"b\">Second type in the pair.</param>\n        public TypePair(Type a, Type b)\n        {\n            A = a;\n            B = b;\n        }\n\n        /// <summary>\n        /// Returns the hash code for this instance.\n        /// </summary>\n        /// <returns>\n        /// A 32-bit signed integer that is the hash code for this instance.\n        /// </returns>\n        /// <filterpriority>2</filterpriority>\n        public override int GetHashCode()\n        {\n            //TODO: Use old hash code system?\n            return A.GetHashCode() + B.GetHashCode();\n        }\n\n\n        #region IEquatable<TypePair> Members\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public bool Equals(TypePair other)\n        {\n            return (other.A == A && other.B == B) || (other.B == A && other.A == B);\n        }\n\n        #endregion\n    }\n    ///<summary>\n    /// Manages and constructs pair handlers from broad phase overlaps.\n    ///</summary>\n    public class NarrowPhase : MultithreadedProcessingStage\n    {\n        RawList<BroadPhaseOverlap> broadPhaseOverlaps;\n        ///<summary>\n        /// Gets or sets the list of broad phase overlaps used by the narrow phase to manage pairs.\n        ///</summary>\n        public RawList<BroadPhaseOverlap> BroadPhaseOverlaps { get { return broadPhaseOverlaps; } set { broadPhaseOverlaps = value; } }\n\n        Dictionary<BroadPhaseOverlap, NarrowPhasePair> overlapMapping = new Dictionary<BroadPhaseOverlap, NarrowPhasePair>();\n        RawList<NarrowPhasePair> narrowPhasePairs = new RawList<NarrowPhasePair>();\n        ///<summary>\n        /// Gets the list of Pairs managed by the narrow phase.\n        ///</summary>\n        public ReadOnlyList<NarrowPhasePair> Pairs\n        {\n            get\n            {\n                return new ReadOnlyList<NarrowPhasePair>(narrowPhasePairs);\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the time step settings used by the narrow phase.\n        ///</summary>\n        public TimeStepSettings TimeStepSettings { get; set; }\n\n        /// <summary>\n        /// Gets or sets the solver into which the narrow phase will put solver updateables generated by narrow phase pairs.\n        /// </summary>\n        public Solver Solver { get; set; }\n\n        ConcurrentDeque<NarrowPhasePair> newNarrowPhasePairs = new ConcurrentDeque<NarrowPhasePair>();\n\n\n        ///<summary>\n        /// Constructs a new narrow phase.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings used by the narrow phase.</param>\n        public NarrowPhase(TimeStepSettings timeStepSettings)\n        {\n            TimeStepSettings = timeStepSettings;\n            updateBroadPhaseOverlapDelegate = UpdateBroadPhaseOverlap;\n            Enabled = true;\n        }\n\n        ///<summary>\n        /// Constructs a new narrow phase.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings used by the narrow phase.</param>\n        /// <param name=\"overlaps\">Overlaps list used by the narrow phase to create pairs.</param>\n        public NarrowPhase(TimeStepSettings timeStepSettings, RawList<BroadPhaseOverlap> overlaps)\n            : this(timeStepSettings)\n        {\n            broadPhaseOverlaps = overlaps;\n        }\n        ///<summary>\n        /// Constructs a new narrow phase.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings used by the narrow phase.</param>\n        /// <param name=\"overlaps\">Overlaps list used by the narrow phase to create pairs.</param>\n        /// <param name=\"threadManager\">Thread manager used by the narrow phase.</param>\n        public NarrowPhase(TimeStepSettings timeStepSettings, RawList<BroadPhaseOverlap> overlaps, IThreadManager threadManager)\n            : this(timeStepSettings, overlaps)\n        {\n            ThreadManager = threadManager;\n            AllowMultithreading = true;\n        }\n\n        Action<int> updateBroadPhaseOverlapDelegate;\n        void UpdateBroadPhaseOverlap(int i)\n        {\n            BroadPhaseOverlap overlap = broadPhaseOverlaps.Elements[i];\n\n            if (overlap.collisionRule < CollisionRule.NoNarrowPhasePair)\n            {\n\n                NarrowPhasePair pair;\n                //see if the overlap is already present in the narrow phase.\n                if (!overlapMapping.TryGetValue(overlap, out pair))\n                {\n                    //Create/enqueue based on collision table\n                    pair = NarrowPhaseHelper.GetPairHandler(ref overlap);\n                    if (pair != null)\n                    {\n                        pair.NarrowPhase = this;\n                        //Add the new object to the 'todo' list.\n                        //Technically, this doesn't need to be thread-safe when this is called from the sequential context.\n                        //It's just bunched together for maintainability despite the slight performance hit.\n                        newNarrowPhasePairs.Enqueue(pair);\n                    }\n\n                }\n                if (pair != null)\n                {\n                    //Update the collision rule.\n                    pair.CollisionRule = overlap.collisionRule;\n                    if (pair.BroadPhaseOverlap.collisionRule < CollisionRule.NoNarrowPhaseUpdate)\n                    {\n                        pair.UpdateCollision(TimeStepSettings.TimeStepDuration);\n                    }\n                    pair.NeedsUpdate = false;\n                }\n\n\n            }\n        }\n\n#if PROFILE\n        /// <summary>\n        /// Gets the time used in updating the pair handler states.\n        /// </summary>\n        public double PairUpdateTime\n        {\n            get\n            {\n                return (endPairs - startPairs) / (double)Stopwatch.Frequency;\n            }\n        }\n        /// <summary>\n        /// Gets the time used in flushing new pairs into the simulation.\n        /// </summary>\n        public double FlushNewPairsTime\n        {\n            get\n            {\n                return (endFlushNew - endPairs) / (double)Stopwatch.Frequency;\n            }\n        }\n        /// <summary>\n        /// Gets the time used in flushing changes to solver updateables managed by the pairs.\n        /// </summary>\n        public double FlushSolverUpdateableChangesTime\n        {\n            get\n            {\n                return (endFlushSolverUpdateables - endFlushNew) / (double)Stopwatch.Frequency;\n            }\n        }\n\n        /// <summary>\n        /// Gets the time used in scanning for out of date pairs.\n        /// </summary>\n        public double StaleOverlapRemovalTime\n        {\n            get\n            {\n                return (endStale - endFlushSolverUpdateables) / (double)Stopwatch.Frequency;\n            }\n        }\n        private long startPairs;\n        private long endPairs;\n        private long endFlushNew;\n        private long endFlushSolverUpdateables;\n        private long endStale;\n\n#endif\n\n        protected override void UpdateMultithreaded()\n        {\n\n#if PROFILE\n            startPairs = Stopwatch.GetTimestamp();\n#endif\n\n            ThreadManager.ForLoop(0, broadPhaseOverlaps.Count, updateBroadPhaseOverlapDelegate);\n\n#if PROFILE\n            endPairs = Stopwatch.GetTimestamp();\n#endif\n\n            //The new narrow phase objects should be flushed before we get to the stale overlaps, or else the NeedsUpdate property might get into an invalid state.\n            AddNewNarrowPhaseObjects();\n\n#if PROFILE\n            endFlushNew = Stopwatch.GetTimestamp();\n#endif\n\n            //Flush away every change accumulated since the last flush.\n            FlushGeneratedSolverUpdateables();\n\n#if PROFILE\n            endFlushSolverUpdateables = Stopwatch.GetTimestamp();\n#endif\n            //By the time we get here, there's no more pending items in the queue, so the overlaps\n            //can be removed directly by the stale loop.\n            RemoveStaleOverlaps();\n#if PROFILE\n            endStale = Stopwatch.GetTimestamp();\n#endif\n\n        }\n\n\n        protected override void UpdateSingleThreaded()\n        {\n#if PROFILE\n            startPairs = Stopwatch.GetTimestamp();\n#endif\n\n            int count = broadPhaseOverlaps.Count;\n            for (int i = 0; i < count; i++)\n            {\n                UpdateBroadPhaseOverlap(i);\n            }\n\n#if PROFILE\n            endPairs = Stopwatch.GetTimestamp();\n#endif\n\n            //The new narrow phase objects should be flushed before we get to the stale overlaps, or else the NeedsUpdate property might get into an invalid state.\n            AddNewNarrowPhaseObjects();\n\n#if PROFILE\n            endFlushNew = Stopwatch.GetTimestamp();\n#endif\n\n            //Flush away every change accumulated since the last flush.\n            FlushGeneratedSolverUpdateables();\n\n#if PROFILE\n            endFlushSolverUpdateables = Stopwatch.GetTimestamp();\n#endif\n\n            //By the time we get here, there's no more pending items in the queue, so the overlaps\n            //can be removed directly by the stale loop.\n            RemoveStaleOverlaps();\n\n#if PROFILE\n            endStale = Stopwatch.GetTimestamp();\n#endif\n\n        }\n\n\n        void RemoveStaleOverlaps()\n        {\n            //We don't need to do any synchronization or queueing here; just remove everything directly.\n            ApplySolverUpdateableChangesDirectly = true;\n\n            //Remove stale objects.\n            for (int i = narrowPhasePairs.Count - 1; i >= 0; i--)\n            {\n                var pair = narrowPhasePairs.Elements[i];\n\n                //A stale overlap is a pair which has not been updated, but not because of inactivity.\n\n                //Pairs between two inactive shapes are not updated because the broad phase does not output overlaps\n                //between inactive entries.  We need to keep such pairs around, otherwise when they wake up, lots of extra work\n                //will be needed and quality will suffer.\n\n                //The classic stale overlap is two objects which have moved apart.  Because the bounding boxes no longer overlap,\n                //the broad phase does not generate an overlap for them.  Obviously, we should get rid of such a pair.  \n                //Any such pair will have at least one active member.  Having velocity requires activity and teleportation will activate the object.\n\n                //There's another sneaky kind of stale overlap.  Consider a sleeping dynamic object on a Terrain.  The Terrain, being a static object,\n                //is considered inactive.  The sleeping dynamic object is also inactive.  Now, remove the sleeping dynamic object.\n                //Both objects are still considered inactive.  But the pair is clearly stale- one of its members doesn't even exist anymore!\n                //This has nasty side effects, like retaining memory.  To solve this, also check to see if either member does not belong to the simulation.\n\n\n                if (pair.NeedsUpdate && //If we didn't receive an update in the previous narrow phase run and...\n                    (pair.broadPhaseOverlap.entryA.IsActive || pair.broadPhaseOverlap.entryB.IsActive || //one of us is active or..\n                    pair.broadPhaseOverlap.entryA.BroadPhase == null || pair.broadPhaseOverlap.entryB.BroadPhase == null)) //one of us doesn't exist anymore...\n                {\n                    //Get rid of the pair!\n                    if (RemovingPair != null)\n                        RemovingPair(pair);\n                    narrowPhasePairs.FastRemoveAt(i);\n                    overlapMapping.Remove(pair.BroadPhaseOverlap);\n                    //The clean up will issue an order to get rid of the solver updateable if it is active.\n                    //To avoid a situation where the solver updateable outlives the pair but is available for re-use\n                    //because of the factory giveback here, the updateable is removed directly (ApplySolverUpdateableChangesDirectly = true).\n                    pair.CleanUp();\n                    pair.Factory.GiveBack(pair);\n\n\n                }\n                else\n                {\n                    pair.NeedsUpdate = true;\n\n                }\n\n            }\n\n            ApplySolverUpdateableChangesDirectly = false;\n\n\n        }\n\n        void AddNewNarrowPhaseObjects()\n        {\n            //Add new narrow phase objects.  This will typically be a very tiny phase.\n            NarrowPhasePair narrowPhaseObject;\n\n            while (newNarrowPhasePairs.TryUnsafeDequeueFirst(out narrowPhaseObject))\n            {\n                narrowPhasePairs.Add(narrowPhaseObject);\n                OnCreatePair(narrowPhaseObject);\n            }\n        }\n\n        ///<summary>\n        /// Gets the pair between two broad phase entries, if any.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        ///<returns>The pair if it exists, null otherwise.</returns>\n        public NarrowPhasePair GetPair(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            NarrowPhasePair toReturn;\n            overlapMapping.TryGetValue(new BroadPhaseOverlap(entryA, entryB), out toReturn);\n            return toReturn;\n        }\n\n        protected void OnCreatePair(NarrowPhasePair pair)\n        {\n            overlapMapping.Add(pair.BroadPhaseOverlap, pair);\n            pair.OnAddedToNarrowPhase();\n            if (CreatingPair != null)\n                CreatingPair(pair);\n        }\n\n        ///<summary>\n        /// Fires when the narrow phase creates a pair.\n        ///</summary>\n        public event Action<NarrowPhasePair> CreatingPair;\n        ///<summary>\n        /// Fires when the narrow phase removes a pair.\n        ///</summary>\n        public event Action<NarrowPhasePair> RemovingPair;\n\n        ConcurrentDeque<SolverUpdateableChange> solverUpdateableChanges = new ConcurrentDeque<SolverUpdateableChange>();\n\n\n        /// <summary>\n        /// If true, solver updateables added and removed from narrow phase pairs will be added directly to the solver\n        /// without any synchronization or queueing.\n        /// </summary>\n        bool ApplySolverUpdateableChangesDirectly { get; set; }\n\n        ///<summary>\n        /// Enqueues a solver updateable created by some pair for flushing into the solver later.\n        ///</summary>\n        ///<param name=\"addedItem\">Updateable to add.</param>\n        public void NotifyUpdateableAdded(SolverUpdateable addedItem)\n        {\n            if (ApplySolverUpdateableChangesDirectly)\n            {\n                Solver.Add(addedItem);\n            }\n            else\n            {\n                solverUpdateableChanges.Enqueue(new SolverUpdateableChange(true, addedItem));\n            }\n        }\n        ///<summary>\n        /// Enqueues a solver updateable removed by some pair for flushing into the solver later.\n        ///</summary>\n        ///<param name=\"removedItem\">Solver updateable to remove.</param>\n        public void NotifyUpdateableRemoved(SolverUpdateable removedItem)\n        {\n            if (ApplySolverUpdateableChangesDirectly)\n            {\n                Solver.Remove(removedItem);\n            }\n            else\n            {\n                solverUpdateableChanges.Enqueue(new SolverUpdateableChange(false, removedItem));\n            }\n        }\n\n\n        /// <summary>\n        /// Flushes the new solver updateables into the solver.\n        /// They are 'flux' updateables, so this uses the solver's flux add method.\n        /// </summary>\n        public void FlushGeneratedSolverUpdateables()\n        {\n            SolverUpdateableChange change;\n            while (solverUpdateableChanges.TryUnsafeDequeueFirst(out change))\n            {\n                if (change.ShouldAdd)\n                {\n                    //It is technically possible for a constraint to be added twice, if certain systems interfere.\n                    //The character controller is one such system.\n                    //We should check the new constraint's solver status before adding it here.\n                    if (change.Item.solver == null)\n                    {\n                        Solver.Add(change.Item);\n                    }\n                }\n                else\n                {\n                    if (change.Item.solver != null)\n                    {\n                        Solver.Remove(change.Item);\n                    }\n                }\n            }\n\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/NarrowPhaseHelper.cs",
    "content": "﻿using System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.UpdateableSystems;\n\nnamespace BEPUphysics.NarrowPhaseSystems\n{\n    /// <summary>\n    /// Contains the various factories that are used by default in the engine.\n    /// </summary>\n    public class Factories\n    {\n        /// <summary>\n        /// Gets the factory for the box-box case.\n        /// </summary>\n        public NarrowPhasePairFactory<BoxPairHandler> BoxBox { get; private set; }\n        /// <summary>\n        /// Gets the factory for the box-sphere case.\n        /// </summary>\n        public NarrowPhasePairFactory<BoxSpherePairHandler> BoxSphere { get; private set; }\n        /// <summary>\n        /// Gets the factory for the sphere-sphere case.\n        /// </summary>\n        public NarrowPhasePairFactory<SpherePairHandler> SphereSphere { get; private set; }\n        /// <summary>\n        /// Gets the factory for the convex-convex case.  This works for any two convexes, though some other special cases (e.g. box-box) supersede it.\n        /// </summary>\n        public NarrowPhasePairFactory<GeneralConvexPairHandler> ConvexConvex { get; private set; }\n        /// <summary>\n        /// Gets the factory for the triangle-convex case.\n        /// </summary>\n        public NarrowPhasePairFactory<TriangleConvexPairHandler> TriangleConvex { get; private set; }\n        /// <summary>\n        /// Gets the factory for the compound-convex case.\n        /// </summary>\n        public NarrowPhasePairFactory<CompoundConvexPairHandler> CompoundConvex { get; private set; }\n        /// <summary>\n        /// Gets the factory for the compound-compound case.\n        /// </summary>\n        public NarrowPhasePairFactory<CompoundPairHandler> CompoundCompound { get; private set; }\n        /// <summary>\n        /// Gets the factory for the compound-static mesh case.\n        /// </summary>\n        public NarrowPhasePairFactory<CompoundStaticMeshPairHandler> CompoundStaticMesh { get; private set; }\n        /// <summary>\n        /// Gets the factory for the compound-terrain case.\n        /// </summary>\n        public NarrowPhasePairFactory<CompoundTerrainPairHandler> CompoundTerrain { get; private set; }\n        /// <summary>\n        /// Gets the factory for the compound-instanced mesh case.\n        /// </summary>\n        public NarrowPhasePairFactory<CompoundInstancedMeshPairHandler> CompoundInstancedMesh { get; private set; }\n        /// <summary>\n        /// Gets the factory for the compound-mobile mesh case.\n        /// </summary>\n        public NarrowPhasePairFactory<CompoundMobileMeshPairHandler> CompoundMobileMesh { get; private set; }\n        /// <summary>\n        /// Gets the factory for the static mesh-convex case.\n        /// </summary>\n        public NarrowPhasePairFactory<StaticMeshConvexPairHandler> StaticMeshConvex { get; private set; }\n        /// <summary>\n        /// Gets the factory for the static mesh-sphere case.\n        /// </summary>\n        public NarrowPhasePairFactory<StaticMeshSpherePairHandler> StaticMeshSphere { get; private set; }\n        /// <summary>\n        /// Gets the factory for the terrain-convex case.\n        /// </summary>\n        public NarrowPhasePairFactory<TerrainConvexPairHandler> TerrainConvex { get; private set; }\n        /// <summary>\n        /// Gets the factory for the terrain-sphere case.\n        /// </summary>\n        public NarrowPhasePairFactory<TerrainSpherePairHandler> TerrainSphere { get; private set; }\n        /// <summary>\n        /// Gets the factory for the instanced mesh-convex case.\n        /// </summary>\n        public NarrowPhasePairFactory<InstancedMeshConvexPairHandler> InstancedMeshConvex { get; private set; }\n        /// <summary>\n        /// Gets the factory for the instanced mesh-sphere case.\n        /// </summary>\n        public NarrowPhasePairFactory<InstancedMeshSpherePairHandler> InstancedMeshSphere { get; private set; }\n        /// <summary>\n        /// Gets the factory for the mobile mesh-convex case.\n        /// </summary>\n        public NarrowPhasePairFactory<MobileMeshConvexPairHandler> MobileMeshConvex { get; private set; }\n        /// <summary>\n        /// Gets the factory for the mobile mesh-sphere case.\n        /// </summary>\n        public NarrowPhasePairFactory<MobileMeshSpherePairHandler> MobileMeshSphere { get; private set; }\n        /// <summary>\n        /// Gets the factory for the mobile mesh-triangle case.\n        /// </summary>\n        public NarrowPhasePairFactory<MobileMeshTrianglePairHandler> MobileMeshTriangle { get; private set; }\n        /// <summary>\n        /// Gets the factory for the mobile mesh-static mesh case.\n        /// </summary>\n        public NarrowPhasePairFactory<MobileMeshStaticMeshPairHandler> MobileMeshStaticMesh { get; private set; }\n        /// <summary>\n        /// Gets the factory for the mobile mesh-instanced mesh case.\n        /// </summary>\n        public NarrowPhasePairFactory<MobileMeshInstancedMeshPairHandler> MobileMeshInstancedMesh { get; private set; }\n        /// <summary>\n        /// Gets the factory for the mobile mesh-terrain case.\n        /// </summary>\n        public NarrowPhasePairFactory<MobileMeshTerrainPairHandler> MobileMeshTerrain { get; private set; }\n        /// <summary>\n        /// Gets the factory for the mobile mesh-mobile mesh case.\n        /// </summary>\n        public NarrowPhasePairFactory<MobileMeshMobileMeshPairHandler> MobileMeshMobileMesh { get; private set; }\n        /// <summary>\n        /// Gets the factory for the static group-convex case.\n        /// </summary>\n        public NarrowPhasePairFactory<StaticGroupConvexPairHandler> StaticGroupConvex { get; private set; }\n        /// <summary>\n        /// Gets the factory for the static group-compound case.\n        /// </summary>\n        public NarrowPhasePairFactory<StaticGroupCompoundPairHandler> StaticGroupCompound { get; private set; }\n        /// <summary>\n        /// Gets the factory for the static group-mobile mesh case.\n        /// </summary>\n        public NarrowPhasePairFactory<StaticGroupMobileMeshPairHandler> StaticGroupMobileMesh { get; private set; }\n        /// <summary>\n        /// Gets the factory for the detector volume-convex case.\n        /// </summary>\n        public NarrowPhasePairFactory<DetectorVolumeConvexPairHandler> DetectorVolumeConvex { get; private set; }\n        /// <summary>\n        /// Gets the factory for the detector volume-mobile mesh case.\n        /// </summary>\n        public NarrowPhasePairFactory<DetectorVolumeMobileMeshPairHandler> DetectorVolumeMobileMesh { get; private set; }\n        /// <summary>\n        /// Gets the factory for the detector volume-compound case.\n        /// </summary>\n        public NarrowPhasePairFactory<DetectorVolumeCompoundPairHandler> DetectorVolumeCompound { get; private set; }\n\n        RawList<NarrowPhasePairFactory> factories = new RawList<NarrowPhasePairFactory>();\n        /// <summary>\n        /// Gets a collection of all the default factories.\n        /// </summary>\n        public ReadOnlyList<NarrowPhasePairFactory> All\n        {\n            get\n            {\n                return new ReadOnlyList<NarrowPhasePairFactory>(factories);\n            }\n        }\n\n        /// <summary>\n        /// Constructs all factories.\n        /// </summary>\n        public Factories()\n        {\n            factories.Add(BoxBox = new NarrowPhasePairFactory<BoxPairHandler>());\n            factories.Add(BoxSphere = new NarrowPhasePairFactory<BoxSpherePairHandler>());\n            factories.Add(SphereSphere = new NarrowPhasePairFactory<SpherePairHandler>());\n            factories.Add(ConvexConvex = new NarrowPhasePairFactory<GeneralConvexPairHandler>());\n            factories.Add(TriangleConvex = new NarrowPhasePairFactory<TriangleConvexPairHandler>());\n            factories.Add(CompoundConvex = new NarrowPhasePairFactory<CompoundConvexPairHandler>());\n            factories.Add(CompoundCompound = new NarrowPhasePairFactory<CompoundPairHandler>());\n            factories.Add(CompoundStaticMesh = new NarrowPhasePairFactory<CompoundStaticMeshPairHandler>());\n            factories.Add(CompoundTerrain = new NarrowPhasePairFactory<CompoundTerrainPairHandler>());\n            factories.Add(CompoundInstancedMesh = new NarrowPhasePairFactory<CompoundInstancedMeshPairHandler>());\n            factories.Add(CompoundMobileMesh = new NarrowPhasePairFactory<CompoundMobileMeshPairHandler>());\n            factories.Add(StaticMeshConvex = new NarrowPhasePairFactory<StaticMeshConvexPairHandler>());\n            factories.Add(StaticMeshSphere = new NarrowPhasePairFactory<StaticMeshSpherePairHandler>());\n            factories.Add(TerrainConvex = new NarrowPhasePairFactory<TerrainConvexPairHandler>());\n            factories.Add(TerrainSphere = new NarrowPhasePairFactory<TerrainSpherePairHandler>());\n            factories.Add(InstancedMeshConvex = new NarrowPhasePairFactory<InstancedMeshConvexPairHandler>());\n            factories.Add(InstancedMeshSphere = new NarrowPhasePairFactory<InstancedMeshSpherePairHandler>());\n            factories.Add(MobileMeshConvex = new NarrowPhasePairFactory<MobileMeshConvexPairHandler>());\n            factories.Add(MobileMeshSphere = new NarrowPhasePairFactory<MobileMeshSpherePairHandler>());\n            factories.Add(MobileMeshTriangle = new NarrowPhasePairFactory<MobileMeshTrianglePairHandler>());\n            factories.Add(MobileMeshStaticMesh = new NarrowPhasePairFactory<MobileMeshStaticMeshPairHandler>());\n            factories.Add(MobileMeshInstancedMesh = new NarrowPhasePairFactory<MobileMeshInstancedMeshPairHandler>());\n            factories.Add(MobileMeshTerrain = new NarrowPhasePairFactory<MobileMeshTerrainPairHandler>());\n            factories.Add(MobileMeshMobileMesh = new NarrowPhasePairFactory<MobileMeshMobileMeshPairHandler>());\n            factories.Add(StaticGroupConvex = new NarrowPhasePairFactory<StaticGroupConvexPairHandler>());\n            factories.Add(StaticGroupCompound = new NarrowPhasePairFactory<StaticGroupCompoundPairHandler>());\n            factories.Add(StaticGroupMobileMesh = new NarrowPhasePairFactory<StaticGroupMobileMeshPairHandler>());\n            factories.Add(DetectorVolumeConvex = new NarrowPhasePairFactory<DetectorVolumeConvexPairHandler>());\n            factories.Add(DetectorVolumeMobileMesh = new NarrowPhasePairFactory<DetectorVolumeMobileMeshPairHandler>());\n            factories.Add(DetectorVolumeCompound = new NarrowPhasePairFactory<DetectorVolumeCompoundPairHandler>());\n        }\n\n\n    }\n\n    ///<summary>\n    /// Contains the collision managers dictionary and other helper methods for creating pairs.\n    ///</summary>\n    public static class NarrowPhaseHelper\n    {\n        /// <summary>\n        /// Gets the factories used by default to construct various pair types in the narrow phase.\n        /// These do not necessarily reflect the state of the narrow phase helper's CollisionManagers dictionary\n        /// if changes are made to its entries.\n        /// </summary>\n        public static Factories Factories\n        {\n            get;\n            private set;\n        }\n\n        static NarrowPhaseHelper()\n        {\n            Factories = new NarrowPhaseSystems.Factories();\n            collisionManagers = new Dictionary<TypePair, NarrowPhasePairFactory>();\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<BoxShape>), typeof(ConvexCollidable<BoxShape>)), Factories.BoxBox);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<BoxShape>), typeof(ConvexCollidable<SphereShape>)), Factories.BoxSphere);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<SphereShape>), typeof(ConvexCollidable<SphereShape>)), Factories.SphereSphere);\n\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<BoxShape>), typeof(ConvexCollidable<TriangleShape>)), Factories.TriangleConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<SphereShape>), typeof(ConvexCollidable<TriangleShape>)), Factories.TriangleConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CapsuleShape>), typeof(ConvexCollidable<TriangleShape>)), Factories.TriangleConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TriangleShape>), typeof(ConvexCollidable<TriangleShape>)), Factories.TriangleConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CylinderShape>), typeof(ConvexCollidable<TriangleShape>)), Factories.TriangleConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConeShape>), typeof(ConvexCollidable<TriangleShape>)), Factories.TriangleConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TransformableShape>), typeof(ConvexCollidable<TriangleShape>)), Factories.TriangleConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<MinkowskiSumShape>), typeof(ConvexCollidable<TriangleShape>)), Factories.TriangleConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<WrappedShape>), typeof(ConvexCollidable<TriangleShape>)), Factories.TriangleConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConvexHullShape>), typeof(ConvexCollidable<TriangleShape>)), Factories.TriangleConvex);\n\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<BoxShape>), typeof(StaticMesh)), Factories.StaticMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<SphereShape>), typeof(StaticMesh)), Factories.StaticMeshSphere);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CapsuleShape>), typeof(StaticMesh)), Factories.StaticMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TriangleShape>), typeof(StaticMesh)), Factories.StaticMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CylinderShape>), typeof(StaticMesh)), Factories.StaticMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConeShape>), typeof(StaticMesh)), Factories.StaticMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TransformableShape>), typeof(StaticMesh)), Factories.StaticMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<MinkowskiSumShape>), typeof(StaticMesh)), Factories.StaticMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<WrappedShape>), typeof(StaticMesh)), Factories.StaticMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConvexHullShape>), typeof(StaticMesh)), Factories.StaticMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(TriangleCollidable), typeof(StaticMesh)), Factories.StaticMeshConvex);\n\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<BoxShape>), typeof(Terrain)), Factories.TerrainConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<SphereShape>), typeof(Terrain)), Factories.TerrainSphere);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CapsuleShape>), typeof(Terrain)), Factories.TerrainConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TriangleShape>), typeof(Terrain)), Factories.TerrainConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CylinderShape>), typeof(Terrain)), Factories.TerrainConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConeShape>), typeof(Terrain)), Factories.TerrainConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TransformableShape>), typeof(Terrain)), Factories.TerrainConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<MinkowskiSumShape>), typeof(Terrain)), Factories.TerrainConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<WrappedShape>), typeof(Terrain)), Factories.TerrainConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConvexHullShape>), typeof(Terrain)), Factories.TerrainConvex);\n            collisionManagers.Add(new TypePair(typeof(TriangleCollidable), typeof(Terrain)), Factories.TerrainConvex);\n\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<BoxShape>), typeof(InstancedMesh)), Factories.InstancedMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<SphereShape>), typeof(InstancedMesh)), Factories.InstancedMeshSphere);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CapsuleShape>), typeof(InstancedMesh)), Factories.InstancedMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TriangleShape>), typeof(InstancedMesh)), Factories.InstancedMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CylinderShape>), typeof(InstancedMesh)), Factories.InstancedMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConeShape>), typeof(InstancedMesh)), Factories.InstancedMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TransformableShape>), typeof(InstancedMesh)), Factories.InstancedMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<MinkowskiSumShape>), typeof(InstancedMesh)), Factories.InstancedMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<WrappedShape>), typeof(InstancedMesh)), Factories.InstancedMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConvexHullShape>), typeof(InstancedMesh)), Factories.InstancedMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(TriangleCollidable), typeof(InstancedMesh)), Factories.InstancedMeshConvex);\n\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<BoxShape>), typeof(CompoundCollidable)), Factories.CompoundConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<SphereShape>), typeof(CompoundCollidable)), Factories.CompoundConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CapsuleShape>), typeof(CompoundCollidable)), Factories.CompoundConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TriangleShape>), typeof(CompoundCollidable)), Factories.CompoundConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CylinderShape>), typeof(CompoundCollidable)), Factories.CompoundConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConeShape>), typeof(CompoundCollidable)), Factories.CompoundConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TransformableShape>), typeof(CompoundCollidable)), Factories.CompoundConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<MinkowskiSumShape>), typeof(CompoundCollidable)), Factories.CompoundConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<WrappedShape>), typeof(CompoundCollidable)), Factories.CompoundConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConvexHullShape>), typeof(CompoundCollidable)), Factories.CompoundConvex);\n            collisionManagers.Add(new TypePair(typeof(TriangleCollidable), typeof(CompoundCollidable)), Factories.CompoundConvex);\n\n            collisionManagers.Add(new TypePair(typeof(CompoundCollidable), typeof(CompoundCollidable)), Factories.CompoundCompound);\n            collisionManagers.Add(new TypePair(typeof(CompoundCollidable), typeof(StaticMesh)), Factories.CompoundStaticMesh);\n            collisionManagers.Add(new TypePair(typeof(CompoundCollidable), typeof(Terrain)), Factories.CompoundTerrain);\n            collisionManagers.Add(new TypePair(typeof(CompoundCollidable), typeof(InstancedMesh)), Factories.CompoundInstancedMesh);\n\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<BoxShape>), typeof(MobileMeshCollidable)), Factories.MobileMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<SphereShape>), typeof(MobileMeshCollidable)), Factories.MobileMeshSphere);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CapsuleShape>), typeof(MobileMeshCollidable)), Factories.MobileMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TriangleShape>), typeof(MobileMeshCollidable)), Factories.MobileMeshTriangle);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CylinderShape>), typeof(MobileMeshCollidable)), Factories.MobileMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConeShape>), typeof(MobileMeshCollidable)), Factories.MobileMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TransformableShape>), typeof(MobileMeshCollidable)), Factories.MobileMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<MinkowskiSumShape>), typeof(MobileMeshCollidable)), Factories.MobileMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<WrappedShape>), typeof(MobileMeshCollidable)), Factories.MobileMeshConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConvexHullShape>), typeof(MobileMeshCollidable)), Factories.MobileMeshConvex);\n\n            collisionManagers.Add(new TypePair(typeof(CompoundCollidable), typeof(MobileMeshCollidable)), Factories.CompoundMobileMesh);\n            collisionManagers.Add(new TypePair(typeof(MobileMeshCollidable), typeof(StaticMesh)), Factories.MobileMeshStaticMesh);\n            collisionManagers.Add(new TypePair(typeof(MobileMeshCollidable), typeof(InstancedMesh)), Factories.MobileMeshInstancedMesh);\n            collisionManagers.Add(new TypePair(typeof(MobileMeshCollidable), typeof(Terrain)), Factories.MobileMeshTerrain);\n            collisionManagers.Add(new TypePair(typeof(MobileMeshCollidable), typeof(MobileMeshCollidable)), Factories.MobileMeshMobileMesh);\n            collisionManagers.Add(new TypePair(typeof(MobileMeshCollidable), typeof(TriangleCollidable)), Factories.MobileMeshTriangle);\n\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<BoxShape>), typeof(StaticGroup)), Factories.StaticGroupConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<SphereShape>), typeof(StaticGroup)), Factories.StaticGroupConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CapsuleShape>), typeof(StaticGroup)), Factories.StaticGroupConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TriangleShape>), typeof(StaticGroup)), Factories.StaticGroupConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<CylinderShape>), typeof(StaticGroup)), Factories.StaticGroupConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConeShape>), typeof(StaticGroup)), Factories.StaticGroupConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<TransformableShape>), typeof(StaticGroup)), Factories.StaticGroupConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<MinkowskiSumShape>), typeof(StaticGroup)), Factories.StaticGroupConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<WrappedShape>), typeof(StaticGroup)), Factories.StaticGroupConvex);\n            collisionManagers.Add(new TypePair(typeof(ConvexCollidable<ConvexHullShape>), typeof(StaticGroup)), Factories.StaticGroupConvex);\n            collisionManagers.Add(new TypePair(typeof(TriangleCollidable), typeof(StaticGroup)), Factories.StaticGroupConvex);\n\n            collisionManagers.Add(new TypePair(typeof(CompoundCollidable), typeof(StaticGroup)), Factories.StaticGroupCompound);\n            collisionManagers.Add(new TypePair(typeof(MobileMeshCollidable), typeof(StaticGroup)), Factories.StaticGroupMobileMesh);\n\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(ConvexCollidable<BoxShape>)), Factories.DetectorVolumeConvex);\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(ConvexCollidable<SphereShape>)), Factories.DetectorVolumeConvex);\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(ConvexCollidable<CapsuleShape>)), Factories.DetectorVolumeConvex);\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(ConvexCollidable<TriangleShape>)), Factories.DetectorVolumeConvex);\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(ConvexCollidable<CylinderShape>)), Factories.DetectorVolumeConvex);\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(ConvexCollidable<ConeShape>)), Factories.DetectorVolumeConvex);\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(ConvexCollidable<TransformableShape>)), Factories.DetectorVolumeConvex);\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(ConvexCollidable<MinkowskiSumShape>)), Factories.DetectorVolumeConvex);\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(ConvexCollidable<WrappedShape>)), Factories.DetectorVolumeConvex);\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(ConvexCollidable<ConvexHullShape>)), Factories.DetectorVolumeConvex);\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(TriangleCollidable)), Factories.DetectorVolumeConvex);\n\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(MobileMeshCollidable)), Factories.DetectorVolumeMobileMesh);\n            collisionManagers.Add(new TypePair(typeof(DetectorVolume), typeof(CompoundCollidable)), Factories.DetectorVolumeCompound);\n\n        }\n\n        internal static Dictionary<TypePair, NarrowPhasePairFactory> collisionManagers;\n        ///<summary>\n        /// Gets or sets the dictionary that defines the factory to use for various type pairs.\n        ///</summary>\n        public static Dictionary<TypePair, NarrowPhasePairFactory> CollisionManagers\n        {\n            get\n            {\n                return collisionManagers;\n            }\n            set\n            {\n                collisionManagers = value;\n            }\n        }\n\n        ///<summary>\n        /// Gets a narrow phase pair for a given broad phase overlap.\n        ///</summary>\n        ///<param name=\"pair\">Overlap to use to create the pair.</param>\n        ///<returns>A INarrowPhasePair for the overlap.</returns>\n        public static NarrowPhasePair GetPairHandler(ref BroadPhaseOverlap pair)\n        {\n            NarrowPhasePairFactory factory;\n            if (collisionManagers.TryGetValue(new TypePair(pair.entryA.GetType(), pair.entryB.GetType()), out factory))\n            {\n                var toReturn = factory.GetNarrowPhasePair();\n                toReturn.BroadPhaseOverlap = pair;\n                toReturn.Factory = factory;\n                return toReturn;\n            }\n            //Convex-convex collisions are a pretty significant chunk of all tests, so rather than defining them all, just have a fallback.\n            var a = pair.entryA as ConvexCollidable;\n            var b = pair.entryB as ConvexCollidable;\n            if (a != null && b != null)\n            {\n                NarrowPhasePair toReturn = Factories.ConvexConvex.GetNarrowPhasePair();\n                toReturn.BroadPhaseOverlap = pair;\n                toReturn.Factory = Factories.ConvexConvex;\n                return toReturn;\n            }\n            return null;\n        }\n\n        ///<summary>\n        /// Gets a narrow phase pair for a given pair of entries.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        /// <param name=\"entryB\">Second entry in the pair.</param>\n        /// <param name=\"rule\">Collision rule governing the pair.</param>\n        ///<returns>A NarrowPhasePair for the overlap.</returns>\n        public static NarrowPhasePair GetPairHandler(BroadPhaseEntry entryA, BroadPhaseEntry entryB, CollisionRule rule)\n        {\n            var overlap = new BroadPhaseOverlap(entryA, entryB, rule);\n            return GetPairHandler(ref overlap);\n        }\n\n        ///<summary>\n        /// Gets a narrow phase pair for a given pair of entries.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        /// <param name=\"entryB\">Second entry in the pair.</param>\n        ///<returns>AINarrowPhasePair for the overlap.</returns>\n        public static NarrowPhasePair GetPairHandler(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            var overlap = new BroadPhaseOverlap(entryA, entryB);\n            return GetPairHandler(ref overlap);\n        }\n\n        /// <summary>\n        /// Gets a collidable pair handler for a pair of collidables.\n        /// </summary>\n        /// <param name=\"pair\">Pair of collidables to use to create the pair handler.</param>\n        /// <param name=\"rule\">Collision rule governing the pair.</param>\n        /// <returns>CollidablePairHandler for the pair.</returns>\n        public static CollidablePairHandler GetPairHandler(ref CollidablePair pair, CollisionRule rule)\n        {\n            var overlap = new BroadPhaseOverlap(pair.collidableA, pair.collidableB, rule);\n            return GetPairHandler(ref overlap) as CollidablePairHandler;\n        }\n        /// <summary>\n        /// Gets a collidable pair handler for a pair of collidables.\n        /// </summary>\n        /// <param name=\"pair\">Pair of collidables to use to create the pair handler.</param>\n        /// <returns>CollidablePairHandler for the pair.</returns>\n        public static CollidablePairHandler GetPairHandler(ref CollidablePair pair)\n        {\n            var overlap = new BroadPhaseOverlap(pair.collidableA, pair.collidableB);\n            return GetPairHandler(ref overlap) as CollidablePairHandler;\n        }\n\n        /// <summary>\n        /// Tests the pair of collidables for intersection without regard for collision rules.\n        /// </summary>\n        /// <param name=\"pair\">Pair to test.</param>\n        /// <returns>Whether or not the pair is intersecting.</returns>\n        public static bool Intersecting(ref CollidablePair pair)\n        {\n            var pairHandler = GetPairHandler(ref pair);\n            if (pairHandler == null)\n                return false;\n            pairHandler.SuppressEvents = true;\n            pairHandler.UpdateCollision(0);\n            //Technically, contacts with negative depth do not count.\n            //The current implementation of collision detection does not generate\n            //negative depths on the first execution of UpdateCollision, though,\n            //so we don't need to worry about that- yet.\n            bool toReturn = pairHandler.ContactCount > 0;\n            pairHandler.SuppressEvents = false;\n            pairHandler.CleanUp();\n            pairHandler.Factory.GiveBack(pairHandler);\n            return toReturn;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/NarrowPhasePairFactory.cs",
    "content": "﻿using BEPUphysics.NarrowPhaseSystems.Pairs;\nusing System;\nusing BEPUutilities.ResourceManagement;\n\nnamespace BEPUphysics.NarrowPhaseSystems\n{\n    /// <summary>\n    /// Superclass of the generic typed NarrowPhasePairFactory.  Offers interaction with the factory on a INarrowPhasePair level.\n    /// </summary>\n    public abstract class NarrowPhasePairFactory\n    {\n        ///<summary>\n        /// Manufactures and returns a narrow phase pair for the given overlap.\n        ///</summary>\n        ///<returns>Narrow phase pair.</returns>\n        public abstract NarrowPhasePair GetNarrowPhasePair();\n\n        /// <summary>\n        /// Returns a pair to the factory for re-use.\n        /// </summary>\n        /// <param name=\"pair\">Pair to return.</param>\n        public abstract void GiveBack(NarrowPhasePair pair);\n        /// <summary>\n        /// Gets or sets the number of elements in the pair factory that are ready to take.\n        /// If the factory runs out, it will construct new instances to give away (unless AllowOnDemandConstruction is set to false).\n        /// </summary>\n        public abstract int Count { get; set; }\n\n        protected bool allowOnDemandConstruction = true;\n        /// <summary>\n        /// Gets or sets whether or not to allow the factory to create additional instances when it runs\n        /// out of its initial set.  Defaults to true.\n        /// </summary>\n        public bool AllowOnDemandConstruction\n        {\n            get\n            {\n                return allowOnDemandConstruction;\n            }\n            set\n            {\n                allowOnDemandConstruction = value;\n            }\n        }\n\n        /// <summary>\n        /// Ensures that the factory has at least the given number of elements ready to take.\n        /// </summary>\n        /// <param name=\"minimumCount\">Minimum number of elements to ensure in the factory.</param>\n        public void EnsureCount(int minimumCount)\n        {\n            if (Count < minimumCount)\n                Count = minimumCount;\n        }\n\n        /// <summary>\n        /// Ensures that the factory has at most the given number of elements ready to take.\n        /// </summary>\n        /// <param name=\"maximumCount\">Maximum number of elements to allow in the factory.</param>\n        public void CapCount(int maximumCount)\n        {\n            if (Count > maximumCount)\n                Count = maximumCount;\n        }\n        \n        /// <summary>\n        /// Removes all elements from the factory.\n        /// </summary>\n        public abstract void Clear();\n    }\n    ///<summary>\n    /// Manufactures a given type of narrow phase pairs.\n    ///</summary>\n    /// <typeparam name=\"T\">Type of the pair to manufacture.</typeparam>\n    public class NarrowPhasePairFactory<T> : NarrowPhasePairFactory where T : NarrowPhasePair, new()\n    {\n        LockingResourcePool<T> pool = new LockingResourcePool<T>();\n        /// <summary>\n        /// Get a resource from the factory.\n        /// </summary>\n        /// <returns>A pair from the factory.</returns>\n        public override NarrowPhasePair GetNarrowPhasePair()\n        {\n            if (!allowOnDemandConstruction && pool.Count == 0)\n                throw new InvalidOperationException(\"Cannot request additional resources from this factory; it is exhausted.  Consider specifying a greater number of initial resources or setting AllowOnDemandConstruction to true.\");\n            var pair = pool.Take();\n            pair.NeedsUpdate = true;\n            return pair;\n        }\n\n        /// <summary>\n        /// Give a resource back to the factory.\n        /// </summary>\n        /// <param name=\"pair\">Pair to return.</param>\n        public override void GiveBack(NarrowPhasePair pair)\n        {\n            pair.NarrowPhase = null;\n            pool.GiveBack((T)pair);\n        }\n\n\n\n        /// <summary>\n        /// Gets or sets the number of elements in the pair factory that are ready to take.\n        /// If the factory runs out, it will construct new instances to give away (unless AllowOnDemandConstruction is set to false).\n        /// </summary>\n        public override int Count\n        {\n            get\n            {\n                return pool.Count;\n            }\n            set\n            {\n                pool.Initialize(value);\n            }\n        }\n\n\n\n        /// <summary>\n        /// Removes all elements from the factory.\n        /// </summary>\n        public override void Clear()\n        {\n            pool.Clear();\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/BoxPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Pair handler that manages a pair of two boxes.\n    ///</summary>\n    public class BoxPairHandler : ConvexConstraintPairHandler\n    {\n        ConvexCollidable<BoxShape> boxA;\n        ConvexCollidable<BoxShape> boxB;\n\n        BoxContactManifold contactManifold = new BoxContactManifold();\n\n        public override Collidable CollidableA\n        {\n            get { return boxA; }\n        }\n\n        public override Collidable CollidableB\n        {\n            get { return boxB; }\n        }\n\n        public override Entities.Entity EntityA\n        {\n            get { return boxA.entity; }\n        }\n\n        public override Entities.Entity EntityB\n        {\n            get { return boxB.entity; }\n        }\n        /// <summary>\n        /// Gets the contact manifold used by the pair handler.\n        /// </summary>\n        public override ContactManifold ContactManifold\n        {\n            get { return contactManifold; }\n        }\n\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            boxA = entryA as ConvexCollidable<BoxShape>;\n            boxB = entryB as ConvexCollidable<BoxShape>;\n\n            if (boxA == null || boxB == null)\n            {\n                throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n            }\n\n            base.Initialize(entryA, entryB);\n\n        }\n\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            boxA = null;\n            boxB = null;\n            \n        }\n\n\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/BoxSpherePairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUphysics.CollisionTests.Manifolds;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a box and sphere in a collision.\n    ///</summary>\n    public class BoxSpherePairHandler : ConvexPairHandler\n    {\n        ConvexCollidable<BoxShape> box;\n        ConvexCollidable<SphereShape> sphere;\n\n        //Using a non-convex one since they have slightly lower overhead than their Convex friends when dealing with a single contact point.\n        BoxSphereContactManifold contactManifold = new BoxSphereContactManifold();\n        NonConvexContactManifoldConstraint contactConstraint = new NonConvexContactManifoldConstraint();\n\n        public override Collidable CollidableA\n        {\n            get { return box; }\n        }\n\n        public override Collidable CollidableB\n        {\n            get { return sphere; }\n        }\n\n        /// <summary>\n        /// Gets the contact constraint used by the pair handler.\n        /// </summary>\n        public override ContactManifoldConstraint ContactConstraint\n        {\n            get\n            {\n                return contactConstraint;\n            }\n        }\n        /// <summary>\n        /// Gets the contact manifold used by the pair handler.\n        /// </summary>\n        public override ContactManifold ContactManifold\n        {\n            get { return contactManifold; }\n        }\n\n        public override Entities.Entity EntityA\n        {\n            get { return box.entity; }\n        }\n\n        public override Entities.Entity EntityB\n        {\n            get { return sphere.entity; }\n        }\n        \n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n\n\n            box = entryA as ConvexCollidable<BoxShape>;\n            sphere = entryB as ConvexCollidable<SphereShape>;\n\n            if (box == null || sphere == null)\n            {\n                box = entryB as ConvexCollidable<BoxShape>;\n                sphere = entryA as ConvexCollidable<SphereShape>;\n                if (box == null || sphere == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n            //Reorder the entries so that the guarantee that the normal points from A to B is satisfied.\n            broadPhaseOverlap.entryA = box;\n            broadPhaseOverlap.entryB = sphere;\n            \n            base.Initialize(entryA, entryB);\n\n\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            box = null;\n            sphere = null;\n\n        }\n\n\n        protected internal override void GetContactInformation(int index, out ContactInformation info)\n        {\n            info.Contact = ContactManifold.contacts.Elements[index];\n            //Find the contact's force.\n            info.FrictionImpulse = 0;\n            info.NormalImpulse = 0;\n            for (int i = 0; i < contactConstraint.frictionConstraints.Count; i++)\n            {\n                if (contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.contact == info.Contact)\n                {\n                    info.FrictionImpulse = contactConstraint.frictionConstraints.Elements[i].accumulatedImpulse;\n                    info.NormalImpulse = contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.accumulatedImpulse;\n                    break;\n                }\n            }\n            //Compute relative velocity\n            Vector3 velocity;\n            \n            if (EntityA != null)\n            {\n                Vector3.Subtract(ref info.Contact.Position, ref EntityA.position, out velocity);\n                Vector3.Cross(ref EntityA.angularVelocity, ref velocity, out velocity);\n                Vector3.Add(ref velocity, ref EntityA.linearVelocity, out info.RelativeVelocity);\n            }\n            else\n                info.RelativeVelocity = new Vector3();\n\n            if (EntityB != null)\n            {\n                Vector3.Subtract(ref info.Contact.Position, ref EntityB.position, out velocity);\n                Vector3.Cross(ref EntityB.angularVelocity, ref velocity, out velocity);\n                Vector3.Add(ref velocity, ref EntityB.linearVelocity, out velocity);\n                Vector3.Subtract(ref info.RelativeVelocity, ref velocity, out info.RelativeVelocity);\n            }\n\n            info.Pair = this;\n\n        }\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/CollidablePairHandler.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.Entities;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.CollisionTests;\nusing System;\nusing BEPUphysics.Constraints.SolverGroups;\nusing BEPUphysics.Materials;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Superclass of pairs between collidables that generate contact points.\n    ///</summary>\n    public abstract class CollidablePairHandler : NarrowPhasePair\n    {\n        /// <summary>\n        /// Gets the first collidable associated with the pair.\n        /// </summary>\n        public abstract Collidable CollidableA { get; }\n        /// <summary>\n        /// Gets the second collidable associated with the pair.\n        /// </summary>\n        public abstract Collidable CollidableB { get; }\n        //Entities could be null!\n        /// <summary>\n        /// Gets the first entity associated with the pair.  This could be null if no entity is associated with CollidableA.\n        /// </summary>\n        public abstract Entity EntityA { get; }        \n        /// <summary>\n        /// Gets the second entity associated with the pair.  This could be null if no entity is associated with CollidableB.\n        /// </summary>\n        public abstract Entity EntityB { get; }\n\n        /// <summary>\n        /// Index of this pair in CollidableA's pairs list.\n        /// </summary>\n        internal int listIndexA = -1;\n        /// <summary>\n        /// Index of this pair in CollidableB's pairs list.\n        /// </summary>\n        internal int listIndexB = -1;\n\n        protected internal abstract int ContactCount { get; }\n\n\n\n        protected internal int previousContactCount;\n\n\n        protected CollidablePairHandler()\n        {\n            Contacts = new ContactCollection(this);\n        }\n\n\n        protected internal float timeOfImpact = 1;\n        ///<summary>\n        /// Gets the last computed time of impact of the pair handler.\n        /// This is only computed when one of the members is a continuously\n        /// updated object.\n        ///</summary>\n        public float TimeOfImpact\n        {\n            get\n            {\n                return timeOfImpact;\n            }\n        }\n\n        ///<summary>\n        /// Updates the time of impact for the pair.\n        ///</summary>\n        ///<param name=\"requester\">Collidable requesting the update.</param>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public abstract void UpdateTimeOfImpact(Collidable requester, float dt);\n\n\n        protected bool suppressEvents;\n        ///<summary>\n        /// Gets or sets whether or not to suppress events from this pair handler.\n        ///</summary>\n        public bool SuppressEvents\n        {\n            get\n            {\n                return suppressEvents;\n            }\n            set\n            {\n                suppressEvents = value;\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the parent of this pair handler.\n        /// Pairs with parents report to their parents various\n        /// changes in state.  This is mainly used to support\n        /// hierarchies of pairs for compound collisions.\n        ///</summary>\n        public IPairHandlerParent Parent { get; set; }\n\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            //Child initialization is responsible for setting up the entries.\n            //Child initialization is responsible for setting up the material.\n            //Child initialization is responsible for setting up the manifold.\n            //Child initialization is responsible for setting up the constraint.\n\n            if (!suppressEvents)\n            {\n                CollidableA.EventTriggerer.OnPairCreated(CollidableB, this);\n                CollidableB.EventTriggerer.OnPairCreated(CollidableA, this);\n            }\n        }\n\n        ///<summary>\n        /// Called when the pair handler is added to the narrow phase.\n        ///</summary>\n        protected internal override void OnAddedToNarrowPhase()\n        {\n            CollidableA.AddPair(this, ref listIndexA);\n            CollidableB.AddPair(this, ref listIndexB);\n        }\n\n        protected virtual void OnContactAdded(Contact contact)\n        {\n            contact.Validate();\n            //Children manage the addition of the contact to the constraint, if any.\n            if (!suppressEvents)\n            {\n                CollidableA.EventTriggerer.OnContactCreated(CollidableB, this, contact);\n                CollidableB.EventTriggerer.OnContactCreated(CollidableA, this, contact);\n            }\n            if (Parent != null)\n                Parent.OnContactAdded(contact);\n\n        }\n\n        protected virtual void OnContactRemoved(Contact contact)\n        {\n            //Children manage the removal of the contact from the constraint, if any.\n            if (!suppressEvents)\n            {\n                CollidableA.EventTriggerer.OnContactRemoved(CollidableB, this, contact);\n                CollidableB.EventTriggerer.OnContactRemoved(CollidableA, this, contact);\n            }\n            if (Parent != null)\n                Parent.OnContactRemoved(contact);\n\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            //Child types remove contacts from the pair handler and call OnContactRemoved.\n            //Child types manage the removal of the constraint from the space, if necessary.\n\n\n            //If the contact manifold had any contacts in it on cleanup, then we still need to fire the 'ending' event.\n            if (previousContactCount > 0 && !suppressEvents)\n            {\n                CollidableA.EventTriggerer.OnCollisionEnded(CollidableB, this);\n                CollidableB.EventTriggerer.OnCollisionEnded(CollidableA, this);\n            }\n\n            //Remove this pair from each collidable.  This can be done safely because the CleanUp is called sequentially.\n            //However, only do it if we have been added to the collidables! This does not happen until this pair is added to the narrow phase.\n            //For pairs which never get added to the broad phase, such as those in queries, we should not attempt to remove something that isn't there!\n            if (listIndexA != -1)\n            {\n                CollidableA.RemovePair(this, ref listIndexA);\n                CollidableB.RemovePair(this, ref listIndexB);\n            }\n\n            //Notify the colliders that the pair went away.\n            if (!suppressEvents)\n            {\n                CollidableA.EventTriggerer.OnPairRemoved(CollidableB);\n                CollidableB.EventTriggerer.OnPairRemoved(CollidableA);\n            }\n\n\n            broadPhaseOverlap = new BroadPhaseOverlap();\n            suppressEvents = false;\n            timeOfImpact = 1;\n            Parent = null;\n\n            previousContactCount = 0;\n\n            //Child cleanup is responsible for cleaning up direct references to the involved collidables.\n            //Child cleanup is responsible for cleaning up contact manifolds.\n        }\n\n        ///<summary>\n        /// Forces an update of the pair's material properties.\n        ///</summary>\n        /// <param name=\"properties\">Properties to use in the collision.</param>\n        public abstract void UpdateMaterialProperties(InteractionProperties properties);\n\n        ///<summary>\n        /// Forces an update of the pair's material properties.\n        ///</summary>\n        /// <param name=\"materialA\">First material to use.</param>\n        /// <param name=\"materialB\">Second material to use.</param>\n        public abstract void UpdateMaterialProperties(Material materialA, Material materialB);\n\n        ///<summary>\n        /// Forces an update of the pair's material properties.\n        /// Uses default choices (such as the owning entities' materials).\n        ///</summary>\n        public void UpdateMaterialProperties()\n        {\n            UpdateMaterialProperties(null, null);\n        }\n\n\n        protected internal abstract void GetContactInformation(int index, out ContactInformation info);\n\n\n        ///<summary>\n        /// Gets a list of the contacts in the pair and their associated constraint information.\n        ///</summary>\n        public ContactCollection Contacts { get; private set; }\n\n        /// <summary>\n        /// Gets whether or not this pair has any contacts in it with nonnegative penetration depths.\n        /// Such a contact would imply the pair of objects is actually colliding.\n        /// </summary>\n        public bool Colliding\n        {\n            get\n            {\n                foreach (var contact in Contacts)\n                {\n                    if (contact.Contact.PenetrationDepth >= 0)\n                        return true;\n                }\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Forces the pair handler to clean out its contacts.\n        /// </summary>\n        public virtual void ClearContacts()\n        {\n            previousContactCount = 0;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/CompoundConvexPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound and convex collision pair.\n    ///</summary>\n    public class CompoundConvexPairHandler : CompoundGroupPairHandler\n    {\n        ConvexCollidable convexInfo;\n\n\n        public override Collidable CollidableB\n        {\n            get { return convexInfo; }\n        }\n\n        public override Entities.Entity EntityB\n        {\n            get { return convexInfo.entity; }\n        }\n\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            convexInfo = entryA as ConvexCollidable;\n            if (convexInfo == null)\n            {\n                convexInfo = entryB as ConvexCollidable;\n                if (convexInfo == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n            convexInfo = null;\n        }\n\n\n\n        protected override void UpdateContainedPairs()\n        {\n            var overlappedElements = PhysicsResources.GetCompoundChildList();\n            compoundInfo.hierarchy.Tree.GetOverlaps(convexInfo.boundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                TryToAdd(overlappedElements.Elements[i].CollisionInformation, CollidableB, overlappedElements.Elements[i].Material);\n            }\n\n            PhysicsResources.GiveBack(overlappedElements);\n\n\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/CompoundGroupPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound and group collision pair.\n    ///</summary>\n    public abstract class CompoundGroupPairHandler : GroupPairHandler\n    {\n        protected CompoundCollidable compoundInfo;\n\n        public override Collidable CollidableA\n        {\n            get { return compoundInfo; }\n        }\n        public override Entities.Entity EntityA\n        {\n            get { return compoundInfo.entity; }\n        }\n\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            //Other member of the pair is initialized by the child.\n            compoundInfo = entryA as CompoundCollidable;\n            if (compoundInfo == null)\n            {\n                compoundInfo = entryB as CompoundCollidable;\n                if (compoundInfo == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n            base.Initialize(entryA, entryB);\n        }\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            compoundInfo = null;\n            //Child type needs to null out other reference.\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/CompoundInstancedMeshPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound-instanced mesh collision pair.\n    ///</summary>\n    public class CompoundInstancedMeshPairHandler : CompoundGroupPairHandler\n    {\n        InstancedMesh mesh;\n\n        public override Collidable CollidableB\n        {\n            get { return mesh; }\n        }\n\n        public override Entities.Entity EntityB\n        {\n            get { return null; }\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            mesh = entryA as InstancedMesh;\n            if (mesh == null)\n            {\n                mesh = entryB as InstancedMesh; \n                if (mesh == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n            mesh = null;\n\n\n        }\n\n\n\n        protected override void UpdateContainedPairs()\n        {\n            //Could go other way; get triangles in mesh that overlap the compound.\n            //Could be faster sometimes depending on the way it's set up.\n            var overlappedElements = PhysicsResources.GetCompoundChildList(); \n            compoundInfo.hierarchy.Tree.GetOverlaps(mesh.boundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                TryToAdd(overlappedElements.Elements[i].CollisionInformation, mesh, overlappedElements.Elements[i].Material, mesh.material);\n            }\n\n            PhysicsResources.GiveBack(overlappedElements);\n\n\n\n        }\n\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/CompoundMobileMeshPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound-instanced mesh collision pair.\n    ///</summary>\n    public class CompoundMobileMeshPairHandler : CompoundGroupPairHandler\n    {\n\n        MobileMeshCollidable mesh;\n\n        public override Collidable CollidableB\n        {\n            get { return mesh; }\n        }\n\n        public override Entities.Entity EntityB\n        {\n            get { return mesh.entity; }\n        }\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            mesh = entryA as MobileMeshCollidable;\n            if (mesh == null)\n            {\n                mesh = entryB as MobileMeshCollidable;\n                if (mesh == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            mesh = null;\n        }\n\n\n\n    \n\n\n        protected override void UpdateContainedPairs()\n        {\n            //Could go other way; get triangles in mesh that overlap the compound.\n            //Could be faster sometimes depending on the way it's set up.\n\n            var overlappedElements = PhysicsResources.GetCompoundChildList();\n            compoundInfo.hierarchy.Tree.GetOverlaps(mesh.boundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                TryToAdd(overlappedElements.Elements[i].CollisionInformation, mesh, overlappedElements.Elements[i].Material);\n            }\n\n            PhysicsResources.GiveBack(overlappedElements);\n\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/CompoundPairHandler.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Constraints;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.DataStructures;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.CollisionTests;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound-compound collision pair.\n    ///</summary>\n    public class CompoundPairHandler : CompoundGroupPairHandler\n    {\n\n        CompoundCollidable compoundInfoB;\n\n        public override Collidable CollidableB\n        {\n            get { return compoundInfoB; }\n        }\n\n        public override Entities.Entity EntityB\n        {\n            get { return compoundInfoB.entity; }\n        }\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            compoundInfoB = entryB as CompoundCollidable;\n            if (compoundInfoB == null)\n            {\n                throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n            }\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n            compoundInfoB = null;\n\n\n        }\n\n        //Some danger of unintuitive-to-address allocations here.  If these lists get huge, the user will see some RawList<<>> goofiness in the profiler.\n        //They can still address it by clearing out the cached pair factories though.\n        RawList<TreeOverlapPair<CompoundChild, CompoundChild>> overlappedElements = new RawList<TreeOverlapPair<CompoundChild, CompoundChild>>();\n        protected override void UpdateContainedPairs()\n        {\n            compoundInfo.hierarchy.Tree.GetOverlaps(compoundInfoB.hierarchy.Tree, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                var element = overlappedElements.Elements[i];\n                TryToAdd(element.OverlapA.CollisionInformation, element.OverlapB.CollisionInformation,\n                         element.OverlapA.Material, element.OverlapB.Material);\n            }\n            overlappedElements.Clear();\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/CompoundStaticMeshPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound-static mesh collision pair.\n    ///</summary>\n    public class CompoundStaticMeshPairHandler : CompoundGroupPairHandler\n    {\n       \n\n        StaticMesh mesh;\n\n        public override Collidable CollidableB\n        {\n            get { return mesh; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return null; }\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            mesh = entryA as StaticMesh;\n            if (mesh == null)\n            {\n                mesh = entryB as StaticMesh;\n                if (mesh == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n            mesh = null;\n\n\n        }\n\n\n\n\n        protected override void UpdateContainedPairs()\n        {\n            //TODO: Static triangle meshes have a worldspace hierarchy that could be more efficiently traversed with a tree vs tree test.\n            //This is just a lot simpler to manage in the short term.\n\n            var overlappedElements = PhysicsResources.GetCompoundChildList();\n            compoundInfo.hierarchy.Tree.GetOverlaps(mesh.boundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                TryToAdd(overlappedElements.Elements[i].CollisionInformation, mesh, overlappedElements.Elements[i].Material, mesh.material);\n            }\n\n            PhysicsResources.GiveBack(overlappedElements);\n\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/CompoundTerrainPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound-terrain collision pair.\n    ///</summary>\n    public class CompoundTerrainPairHandler : CompoundGroupPairHandler\n    {\n\n        Terrain terrain;\n\n        public override Collidable CollidableB\n        {\n            get { return terrain; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return null; }\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            terrain = entryA as Terrain;\n            if (terrain == null)\n            {\n\n                terrain = entryB as Terrain;\n                if (terrain == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n            terrain = null;\n\n\n        }\n\n\n\n\n\n        protected override void UpdateContainedPairs()\n        {           \n            //Could go other way; get triangles in mesh that overlap the compound.\n            //Could be faster sometimes depending on the way it's set up.\n            var overlappedElements = PhysicsResources.GetCompoundChildList();\n            compoundInfo.hierarchy.Tree.GetOverlaps(terrain.boundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                TryToAdd(overlappedElements.Elements[i].CollisionInformation, terrain, overlappedElements.Elements[i].Material, terrain.Material);\n\n            }\n\n            PhysicsResources.GiveBack(overlappedElements);\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/ContactCollection.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Convenience collection of contacts and their associated data.\n    ///</summary>\n    public class ContactCollection : IList<ContactInformation>\n    {\n\n        ///<summary>\n        /// Enumerator for the contact collection.\n        ///</summary>\n        public struct Enumerator : IEnumerator<ContactInformation>\n        {\n            ContactCollection contactCollection;\n            int index;\n            int count;\n\n            internal Enumerator(ContactCollection contactCollection)\n            {\n                this.contactCollection = contactCollection;\n                index = -1;\n                count = contactCollection.Count;\n            }\n\n\n            /// <summary>\n            /// Gets the element in the collection at the current position of the enumerator.\n            /// </summary>\n            /// <returns>\n            /// The element in the collection at the current position of the enumerator.\n            /// </returns>\n            public ContactInformation Current\n            {\n                get { return contactCollection[index]; }\n            }\n\n            /// <summary>\n            /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n            /// </summary>\n            /// <filterpriority>2</filterpriority>\n            public void Dispose()\n            {\n            }\n\n            object System.Collections.IEnumerator.Current\n            {\n                get { return Current; }\n            }\n\n            /// <summary>\n            /// Advances the enumerator to the next element of the collection.\n            /// </summary>\n            /// <returns>\n            /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n            /// </returns>\n            /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n            public bool MoveNext()\n            {\n                return ++index < count;\n            }\n\n            /// <summary>\n            /// Sets the enumerator to its initial position, which is before the first element in the collection.\n            /// </summary>\n            /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n            public void Reset()\n            {\n                index = -1;\n                count = contactCollection.Count;\n            }\n        }\n\n        CollidablePairHandler pair;\n\n        internal ContactCollection(CollidablePairHandler pair)\n        {\n            this.pair = pair;\n        }\n\n        /// <summary>\n        /// Gets the number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <returns>\n        /// The number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </returns>\n        public int Count\n        {\n            get\n            {\n                return pair.ContactCount;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the element at the specified index.\n        /// </summary>\n        /// <returns>\n        /// The element at the specified index.\n        /// </returns>\n        /// <param name=\"index\">The zero-based index of the element to get or set.</param><exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"index\"/> is not a valid index in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</exception><exception cref=\"T:System.NotSupportedException\">The property is set and the <see cref=\"T:System.Collections.Generic.IList`1\"/> is read-only.</exception>\n        public ContactInformation this[int index]\n        {\n            get\n            {\n                ContactInformation toReturn;\n                pair.GetContactInformation(index, out toReturn);\n                return toReturn;\n            }\n            set\n            {\n                throw new NotSupportedException();\n            }\n        }\n\n        IEnumerator<ContactInformation> IEnumerable<ContactInformation>.GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        ///<summary>\n        /// Gets an enumerator for the collection.\n        ///</summary>\n        ///<returns>Enumerator for the contact collection.</returns>\n        public Enumerator GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        /// <summary>\n        /// Determines whether the <see cref=\"T:System.Collections.Generic.ICollection`1\"/> contains a specific value.\n        /// </summary>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> is found in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>; otherwise, false.\n        /// </returns>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param>\n        public bool Contains(ContactInformation item)\n        {\n            int count = Count;\n            for (int i = 0; i < count; i++)\n            {\n                if (this[i].Contact == item.Contact)\n                    return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Copies the elements of the <see cref=\"T:System.Collections.Generic.ICollection`1\"/> to an <see cref=\"T:System.Array\"/>, starting at a particular <see cref=\"T:System.Array\"/> index.\n        /// </summary>\n        /// <param name=\"array\">The one-dimensional <see cref=\"T:System.Array\"/> that is the destination of the elements copied from <see cref=\"T:System.Collections.Generic.ICollection`1\"/>. The <see cref=\"T:System.Array\"/> must have zero-based indexing.</param><param name=\"arrayIndex\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param><exception cref=\"T:System.ArgumentNullException\"><paramref name=\"array\"/> is null.</exception><exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"arrayIndex\"/> is less than 0.</exception><exception cref=\"T:System.ArgumentException\"><paramref name=\"array\"/> is multidimensional.-or-The number of elements in the source <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is greater than the available space from <paramref name=\"arrayIndex\"/> to the end of the destination <paramref name=\"array\"/>.-or-Type cannot be cast automatically to the type of the destination <paramref name=\"array\"/>.</exception>\n        public void CopyTo(ContactInformation[] array, int arrayIndex)\n        {\n            int count = Count;\n            for (int i = 0; i < count; i++)\n            {\n                array[arrayIndex + i] = this[i];\n            }\n        }\n\n        /// <summary>\n        /// Determines the index of a specific item in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.\n        /// </summary>\n        /// <returns>\n        /// The index of <paramref name=\"item\"/> if found in the list; otherwise, -1.\n        /// </returns>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</param>\n        public int IndexOf(ContactInformation item)\n        {\n            int count = Count;\n            for (int i = 0; i < count; i++)\n            {\n                if (this[i].Contact == item.Contact)\n                    return i;\n            }\n            return -1;\n        }\n\n        bool ICollection<ContactInformation>.IsReadOnly\n        {\n            get { return true; }\n        }\n\n        bool ICollection<ContactInformation>.Remove(ContactInformation item)\n        {\n            throw new NotSupportedException();\n        }\n\n        void ICollection<ContactInformation>.Add(ContactInformation item)\n        {\n            throw new NotSupportedException();\n        }\n\n        void ICollection<ContactInformation>.Clear()\n        {\n            throw new NotSupportedException();\n        }\n\n        void IList<ContactInformation>.Insert(int index, ContactInformation item)\n        {\n            throw new NotSupportedException();\n        }\n\n        void IList<ContactInformation>.RemoveAt(int index)\n        {\n            throw new NotSupportedException();\n        }\n\n\n\n\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/ContactInformation.cs",
    "content": "﻿using System;\nusing BEPUphysics.CollisionTests;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Contact and some associated data used by the convenience ContactCollection.\n    ///</summary>\n    public struct ContactInformation : IEquatable<ContactInformation>\n    {\n        /// <summary>\n        /// Contact point in the pair.\n        /// </summary>\n        public Contact Contact;\n\n        /// <summary>\n        /// Pair that most directly generated the contact.\n        /// The pair may have parents, accessible through the pair's Parent property.\n        /// </summary>\n        public CollidablePairHandler Pair;\n\n        /// <summary>\n        /// Normal impulse applied between the objects at the contact point.\n        /// </summary>\n        public float NormalImpulse;\n\n        /// <summary>\n        /// Friction impulse applied between the objects at the contact point.\n        /// This is sometimes an approximation due to the varying ways in which\n        /// friction is calculated.\n        /// </summary>\n        public float FrictionImpulse;\n        \n        ///<summary>\n        /// Relative velocity of the colliding objects at the position of the contact.\n        ///</summary>\n        public Vector3 RelativeVelocity;\n\n\n        public override string ToString()\n        {\n            return Contact + \" NormalImpulse: \" + NormalImpulse + \" FrictionImpulse: \" + FrictionImpulse + \" RelativeVelocity: \" + RelativeVelocity;\n        }\n\n\n        public bool Equals(ContactInformation other)\n        {\n            return other.Contact == Contact;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/ConvexConstraintPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Pair handler that manages a pair of two boxes.\n    ///</summary>\n    public abstract class ConvexConstraintPairHandler : ConvexPairHandler\n    {\n\n        ConvexContactManifoldConstraint contactConstraint = new ConvexContactManifoldConstraint();\n\n        //public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        //{\n        //    contactConstraint = new ConvexContactManifoldConstraint();\n\n        //    base.Initialize(entryA, entryB);\n        //}\n\n        /// <summary>\n        /// Gets the contact constraint used by the pair handler.\n        /// </summary>\n        public override ContactManifoldConstraint ContactConstraint\n        {\n            get { return contactConstraint; }\n        }\n\n\n        protected internal override void GetContactInformation(int index, out ContactInformation info)\n        {\n            info.Contact = ContactManifold.contacts.Elements[index];\n            //Find the contact's normal force.\n            float totalNormalImpulse = 0;\n            info.NormalImpulse = 0;\n            for (int i = 0; i < contactConstraint.penetrationConstraints.Count; i++)\n            {\n                totalNormalImpulse += contactConstraint.penetrationConstraints.Elements[i].accumulatedImpulse;\n                if (contactConstraint.penetrationConstraints.Elements[i].contact == info.Contact)\n                {\n                    info.NormalImpulse = contactConstraint.penetrationConstraints.Elements[i].accumulatedImpulse;\n                }\n            }\n            //Compute friction force.  Since we are using central friction, this is 'faked.'\n            float radius;\n            Vector3.Distance(ref contactConstraint.slidingFriction.manifoldCenter, ref info.Contact.Position, out radius);\n            if (totalNormalImpulse > 0)\n                info.FrictionImpulse = (info.NormalImpulse / totalNormalImpulse) * (contactConstraint.slidingFriction.accumulatedImpulse.Length() + contactConstraint.twistFriction.accumulatedImpulse * radius);\n            else\n                info.FrictionImpulse = 0;\n            //Compute relative velocity\n            Vector3 velocity;\n            //If the pair is handling some type of query and does not actually have supporting entities, then consider the velocity contribution to be zero.\n            if (EntityA != null)\n            {\n                Vector3.Subtract(ref info.Contact.Position, ref EntityA.position, out velocity);\n                Vector3.Cross(ref EntityA.angularVelocity, ref velocity, out velocity);\n                Vector3.Add(ref velocity, ref EntityA.linearVelocity, out info.RelativeVelocity);\n            }\n            else\n                info.RelativeVelocity = new Vector3();\n\n            if (EntityB != null)\n            {\n                Vector3.Subtract(ref info.Contact.Position, ref EntityB.position, out velocity);\n                Vector3.Cross(ref EntityB.angularVelocity, ref velocity, out velocity);\n                Vector3.Add(ref velocity, ref EntityB.linearVelocity, out velocity);\n                Vector3.Subtract(ref info.RelativeVelocity, ref velocity, out info.RelativeVelocity);\n            }\n\n\n            info.Pair = this;\n\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/ConvexPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Pair handler that manages a pair of two boxes.\n    ///</summary>\n    public abstract class ConvexPairHandler : StandardPairHandler\n    {\n\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            UpdateMaterialProperties();\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n\n        ///<summary>\n        /// Updates the time of impact for the pair.\n        ///</summary>\n        ///<param name=\"requester\">Collidable requesting the update.</param>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void UpdateTimeOfImpact(Collidable requester, float dt)\n        {\n            var collidableA = CollidableA as ConvexCollidable;\n            var collidableB = CollidableB as ConvexCollidable;\n            var modeA = collidableA.entity == null ? PositionUpdateMode.Discrete : collidableA.entity.PositionUpdateMode;\n            var modeB = collidableB.entity == null ? PositionUpdateMode.Discrete : collidableB.entity.PositionUpdateMode;\n\n            var overlap = BroadPhaseOverlap;\n            if (\n                    (overlap.entryA.IsActive || overlap.entryB.IsActive) && //At least one has to be active.\n                    (\n                        (\n                            modeA == PositionUpdateMode.Continuous &&   //If both are continuous, only do the process for A.\n                            modeB == PositionUpdateMode.Continuous &&\n                            overlap.entryA == requester\n                        ) ||\n                        (\n                            modeA == PositionUpdateMode.Continuous ^   //If only one is continuous, then we must do it.\n                            modeB == PositionUpdateMode.Continuous\n                        )\n\n                    )\n                )\n            {\n                //Only perform the test if the minimum radii are small enough relative to the size of the velocity.\n                //Discrete objects have already had their linear motion integrated, so don't use their velocity.\n                Vector3 velocity;\n                if (modeA == PositionUpdateMode.Discrete)\n                {\n                    //CollidableA is static for the purposes of this continuous test.\n                    velocity = collidableB.entity.linearVelocity;\n                }\n                else if (modeB == PositionUpdateMode.Discrete)\n                {\n                    //CollidableB is static for the purposes of this continuous test.\n                    Vector3.Negate(ref collidableA.entity.linearVelocity, out velocity);\n                }\n                else\n                {\n                    //Both objects are moving.\n                    Vector3.Subtract(ref collidableB.entity.linearVelocity, ref collidableA.entity.linearVelocity, out velocity);\n                }\n                Vector3.Multiply(ref velocity, dt, out velocity);\n                float velocitySquared = velocity.LengthSquared();\n\n                var minimumRadiusA = collidableA.Shape.minimumRadius * MotionSettings.CoreShapeScaling;\n                timeOfImpact = 1;\n                if (minimumRadiusA * minimumRadiusA < velocitySquared)\n                {\n                    //Spherecast A against B.\n                    RayHit rayHit;\n                    if (GJKToolbox.CCDSphereCast(new Ray(collidableA.worldTransform.Position, -velocity), minimumRadiusA, collidableB.Shape, ref collidableB.worldTransform, timeOfImpact, out rayHit))\n                        timeOfImpact = rayHit.T;\n                }\n\n                var minimumRadiusB = collidableB.Shape.minimumRadius * MotionSettings.CoreShapeScaling;\n                if (minimumRadiusB * minimumRadiusB < velocitySquared)\n                {\n                    //Spherecast B against A.\n                    RayHit rayHit;\n                    if (GJKToolbox.CCDSphereCast(new Ray(collidableB.worldTransform.Position, velocity), minimumRadiusB, collidableA.Shape, ref collidableA.worldTransform, timeOfImpact, out rayHit))\n                        timeOfImpact = rayHit.T;\n                }\n\n                //If it's intersecting, throw our hands into the air and give up.\n                //This is generally a perfectly acceptable thing to do, since it's either sitting\n                //inside another object (no ccd makes sense) or we're still in an intersecting case\n                //from a previous frame where CCD took place and a contact should have been created\n                //to deal with interpenetrating velocity.  Sometimes that contact isn't sufficient,\n                //but it's good enough.\n                if (timeOfImpact == 0)\n                    timeOfImpact = 1;\n            }\n\n        }\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/DetectorVolumeCompoundPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound-static mesh collision pair.\n    ///</summary>\n    public class DetectorVolumeCompoundPairHandler : DetectorVolumeGroupPairHandler\n    {\n        private CompoundCollidable compound;\n\n        /// <summary>\n        /// Gets the entity collidable associated with the pair.\n        /// </summary>\n        public override EntityCollidable Collidable\n        {\n            get { return compound; }\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            compound = entryA as CompoundCollidable;\n            if (compound == null)\n            {\n                compound = entryB as CompoundCollidable;\n                if (compound == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n            compound = null;\n\n\n        }\n\n\n\n\n        protected override void UpdateContainedPairs()\n        {\n            //TODO: Triangle meshes have a worldspace hierarchy that could be more efficiently traversed with a tree vs tree test.\n            //This is just a lot simpler to manage in the short term.\n\n            for (int i = 0; i < compound.children.Count; i++)\n            {\n                TryToAdd(compound.children.Elements[i].CollisionInformation);\n            }\n\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/DetectorVolumeConvexPairHandler.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing System;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    /// <summary>\n    /// Handles the tests between a DetectorVolume and a convex collidable.\n    /// </summary>\n    public class DetectorVolumeConvexPairHandler : DetectorVolumePairHandler\n    {\n        ConvexCollidable convex;\n\n        private bool checkContainment = true;\n        /// <summary>\n        /// Gets or sets whether or not to check the convex object for total containment within the detector volume.\n        /// </summary>\n        public bool CheckContainment\n        {\n            get { return checkContainment; }\n            set { checkContainment = value; }\n        }\n\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            base.Initialize(entryA, entryB);\n            convex = entryA as ConvexCollidable;\n            if (convex == null)\n            {\n                convex = entryB as ConvexCollidable;\n                if (convex == null)\n                {\n                    throw new ArgumentException(\"Incorrect types passed to pair handler.\");\n                }\n            }\n        }\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n            convex = null;\n            checkContainment = true;\n\n\n        }\n\n        public override EntityCollidable Collidable\n        {\n            get { return convex; }\n        }\n\n        RawList<int> overlaps = new RawList<int>(8);\n        private TriangleShape triangle = new TriangleShape { collisionMargin = 0 };\n        public override void UpdateCollision(float dt)\n        {\n            WasContaining = Containing;\n            WasTouching = Touching;\n\n\n            var transform = new RigidTransform { Orientation = Quaternion.Identity };\n            DetectorVolume.TriangleMesh.Tree.GetOverlaps(convex.boundingBox, overlaps);\n            for (int i = 0; i < overlaps.Count; i++)\n            {\n                DetectorVolume.TriangleMesh.Data.GetTriangle(overlaps.Elements[i], out triangle.vA, out triangle.vB, out triangle.vC);\n                Vector3.Add(ref triangle.vA, ref triangle.vB, out transform.Position);\n                Vector3.Add(ref triangle.vC, ref transform.Position, out transform.Position);\n                Vector3.Multiply(ref transform.Position, 1 / 3f, out transform.Position);\n                Vector3.Subtract(ref triangle.vA, ref transform.Position, out triangle.vA);\n                Vector3.Subtract(ref triangle.vB, ref transform.Position, out triangle.vB);\n                Vector3.Subtract(ref triangle.vC, ref transform.Position, out triangle.vC);\n\n                //If this triangle collides with the convex, we can stop immediately since we know we're touching and not containing.)))\n                //[MPR is used here in lieu of GJK because the MPR implementation tends to finish quicker when objects are overlapping than GJK.  The GJK implementation does better on separated objects.]\n                if (MPRToolbox.AreShapesOverlapping(convex.Shape, triangle, ref convex.worldTransform, ref transform))\n                {\n                    Touching = true;\n                    //The convex can't be fully contained if it's still touching the surface.\n                    Containing = false;\n\n                    overlaps.Clear();\n                    goto events;\n                }\n            }\n\n            overlaps.Clear();\n            //If we get here, then there was no shell intersection.\n            //If the convex's center point is contained by the mesh, then the convex is fully contained.\n            //If this is a child pair, the CheckContainment flag may be set to false.  This is because the parent has\n            //already determined that it is not contained (another child performed the check and found that it was not contained)\n            //and that it is already touching somehow (either by intersection or by containment).\n            //so further containment tests are unnecessary.\n            if (CheckContainment && DetectorVolume.IsPointContained(ref convex.worldTransform.Position, overlaps))\n            {\n                Touching = true;\n                Containing = true;\n                goto events;\n            }\n\n            //If we get here, then there was no surface intersection and the convex's center is not contained- the volume and convex are separate!\n            Touching = false;\n            Containing = false;\n\n        events:\n            NotifyDetectorVolumeOfChanges();\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/DetectorVolumeGroupPairHandler.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Diagnostics;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.Materials;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework.Input;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Superclass of pairs between collidables that generate contact points.\n    ///</summary>\n    public abstract class DetectorVolumeGroupPairHandler : DetectorVolumePairHandler, IDetectorVolumePairHandlerParent\n    {\n        Dictionary<EntityCollidable, DetectorVolumePairHandler> subPairs = new Dictionary<EntityCollidable, DetectorVolumePairHandler>();\n        HashSet<EntityCollidable> containedPairs = new HashSet<EntityCollidable>();\n        RawList<EntityCollidable> pairsToRemove = new RawList<EntityCollidable>();\n\n        /// <summary>\n        /// Gets a read-only dictionary of collidables associated with this group pair handler all the subpairs associated with them.\n        /// </summary>\n        public ReadOnlyDictionary<EntityCollidable, DetectorVolumePairHandler> Pairs\n        {\n            get { return new ReadOnlyDictionary<EntityCollidable, DetectorVolumePairHandler>(subPairs); }\n        }\n\n        ///<summary>\n        /// Called when the pair handler is added to the narrow phase.\n        ///</summary>\n        protected internal override void OnAddedToNarrowPhase()\n        {\n            DetectorVolume.pairs.Add(Collidable.entity, this);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            foreach (var pair in subPairs.Values)\n            {\n                pair.CleanUp();\n            }\n            subPairs.Clear();\n            base.CleanUp();\n\n\n        }\n\n        protected void TryToAdd(EntityCollidable collidable)\n        {\n            CollisionRule rule;\n            if ((rule = CollisionRules.collisionRuleCalculator(DetectorVolume, collidable)) < CollisionRule.NoNarrowPhasePair)\n            {\n                //Clamp the rule to the parent's rule.  Always use the more restrictive option.\n                //Don't have to test for NoNarrowPhasePair rule on the parent's rule because then the parent wouldn't exist!\n                if (rule < CollisionRule)\n                    rule = CollisionRule;\n                if (!subPairs.ContainsKey(collidable))\n                {\n                    var newPair = NarrowPhaseHelper.GetPairHandler(DetectorVolume, collidable, rule) as DetectorVolumePairHandler;\n                    if (newPair != null)\n                    {\n                        newPair.Parent = this;\n                        subPairs.Add(collidable, newPair);\n                    }\n                }\n                containedPairs.Add(collidable);\n            }\n        }\n\n        protected abstract void UpdateContainedPairs();\n\n        public override void UpdateCollision(float dt)\n        {\n            WasContaining = Containing;\n            WasTouching = Touching;\n\n            //Gather current pairs.      \n            UpdateContainedPairs();\n\n            //Eliminate old pairs.\n            foreach (var other in subPairs.Keys)\n            {\n                if (!containedPairs.Contains(other))\n                    pairsToRemove.Add(other);\n            }\n            for (int i = 0; i < pairsToRemove.Count; i++)\n            {\n                var toReturn = subPairs[pairsToRemove.Elements[i]];\n                subPairs.Remove(pairsToRemove.Elements[i]);\n                toReturn.CleanUp();\n                toReturn.Factory.GiveBack(toReturn);\n\n            }\n            containedPairs.Clear();\n            pairsToRemove.Clear();\n\n\n            //Scan the pairs in sequence, updating the state as we go.\n            //Touching can be set to true by a single touching subpair.\n            Touching = false;\n            //Containing can be set to false by a single noncontaining or nontouching subpair.\n            Containing = subPairs.Count > 0;\n            foreach (var pair in subPairs.Values)\n            {\n                //For child convex pairs, we don't need to always perform containment checks.\n                //Only check if the containment state has not yet been invalidated or a touching state has not been identified.\n                var convexPair = pair as DetectorVolumeConvexPairHandler;\n                if (convexPair != null)\n                    convexPair.CheckContainment = Containing || !Touching;\n\n                pair.UpdateCollision(dt);\n\n                if (pair.Touching)\n                    Touching = true; //If one child is touching, then we are touching too.\n                else\n                    Containing = false; //If one child isn't touching, then we aren't containing.\n\n                if (!pair.Containing) //If one child isn't containing, then we aren't containing.\n                    Containing = false;\n\n\n                if (!Containing && Touching)\n                {\n                    //If it's touching but not containing, no further pairs will change the state.\n                    //Containment has been invalidated by something that either didn't touch or wasn't contained.\n                    //Touching has been ensured by at least one object touching.\n                    break;\n                }\n            }\n\n            NotifyDetectorVolumeOfChanges();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/DetectorVolumeMobileMeshPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.CollisionShapes;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Superclass of pairs between collidables that generate contact points.\n    ///</summary>\n    public class DetectorVolumeMobileMeshPairHandler : DetectorVolumePairHandler\n    {\n\n\n        private MobileMeshCollidable mesh;\n\n        /// <summary>\n        /// Gets the entity collidable associated with the pair.\n        /// </summary>\n        public override EntityCollidable Collidable\n        {\n            get { return mesh; }\n        }\n\n\n        ///<summary>\n        /// Called when the pair handler is added to the narrow phase.\n        ///</summary>\n        protected internal override void OnAddedToNarrowPhase()\n        {\n            DetectorVolume.pairs.Add(Collidable.entity, this);\n        }\n\n\n        public override void Initialize(BroadPhaseEntries.BroadPhaseEntry entryA, BroadPhaseEntries.BroadPhaseEntry entryB)\n        {\n            base.Initialize(entryA, entryB);\n            mesh = entryA as MobileMeshCollidable;\n            if (mesh == null)\n            {\n                mesh = entryB as MobileMeshCollidable;\n                if (mesh == null)\n                    throw new ArgumentException(\"Invalid types used to initialize pair handler.\");\n            }\n\n        }\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            mesh = null;\n\n        }\n\n\n        private TriangleShape mobileTriangle = new TriangleShape();\n        private TriangleShape detectorTriangle = new TriangleShape { collisionMargin = 0 };\n\n        RawList<int> overlaps = new RawList<int>(8);\n\n        public override void UpdateCollision(float dt)\n        {\n            WasContaining = Containing;\n            WasTouching = Touching;\n\n            mobileTriangle.collisionMargin = mesh.Shape.MeshCollisionMargin;\n\n            //Scan the pairs in sequence, updating the state as we go.\n            //Touching can be set to true by a single touching subpair.\n            Touching = false;\n            //Containing can be set to false by a single noncontaining or nontouching subpair.\n            Containing = true;\n\n\n            var meshData = mesh.Shape.TriangleMesh.Data;\n            RigidTransform mobileTriangleTransform, detectorTriangleTransform;\n            mobileTriangleTransform.Orientation = Quaternion.Identity;\n            detectorTriangleTransform.Orientation = Quaternion.Identity;\n            for (int i = 0; i < meshData.IndexCount; i += 3)\n            {\n                //Grab a triangle associated with the mobile mesh.\n                meshData.GetTriangle(i, out mobileTriangle.vA, out mobileTriangle.vB, out mobileTriangle.vC);\n                RigidTransform.Transform(ref mobileTriangle.vA, ref mesh.worldTransform, out mobileTriangle.vA);\n                RigidTransform.Transform(ref mobileTriangle.vB, ref mesh.worldTransform, out mobileTriangle.vB);\n                RigidTransform.Transform(ref mobileTriangle.vC, ref mesh.worldTransform, out mobileTriangle.vC);\n                Vector3.Add(ref mobileTriangle.vA, ref mobileTriangle.vB, out mobileTriangleTransform.Position);\n                Vector3.Add(ref mobileTriangle.vC, ref mobileTriangleTransform.Position, out mobileTriangleTransform.Position);\n                Vector3.Multiply(ref mobileTriangleTransform.Position, 1 / 3f, out mobileTriangleTransform.Position);\n                Vector3.Subtract(ref mobileTriangle.vA, ref mobileTriangleTransform.Position, out mobileTriangle.vA);\n                Vector3.Subtract(ref mobileTriangle.vB, ref mobileTriangleTransform.Position, out mobileTriangle.vB);\n                Vector3.Subtract(ref mobileTriangle.vC, ref mobileTriangleTransform.Position, out mobileTriangle.vC);\n\n                //Go through all the detector volume triangles which are near the mobile mesh triangle.\n                bool triangleTouching, triangleContaining;\n                BoundingBox mobileBoundingBox;\n                mobileTriangle.GetBoundingBox(ref mobileTriangleTransform, out mobileBoundingBox);\n                DetectorVolume.TriangleMesh.Tree.GetOverlaps(mobileBoundingBox, overlaps);\n                for (int j = 0; j < overlaps.Count; j++)\n                {\n                    DetectorVolume.TriangleMesh.Data.GetTriangle(overlaps.Elements[j], out detectorTriangle.vA, out detectorTriangle.vB, out detectorTriangle.vC);\n                    Vector3.Add(ref detectorTriangle.vA, ref detectorTriangle.vB, out detectorTriangleTransform.Position);\n                    Vector3.Add(ref detectorTriangle.vC, ref detectorTriangleTransform.Position, out detectorTriangleTransform.Position);\n                    Vector3.Multiply(ref detectorTriangleTransform.Position, 1 / 3f, out detectorTriangleTransform.Position);\n                    Vector3.Subtract(ref detectorTriangle.vA, ref detectorTriangleTransform.Position, out detectorTriangle.vA);\n                    Vector3.Subtract(ref detectorTriangle.vB, ref detectorTriangleTransform.Position, out detectorTriangle.vB);\n                    Vector3.Subtract(ref detectorTriangle.vC, ref detectorTriangleTransform.Position, out detectorTriangle.vC);\n\n                    //If this triangle collides with the convex, we can stop immediately since we know we're touching and not containing.)))\n                    //[MPR is used here in lieu of GJK because the MPR implementation tends to finish quicker than GJK when objects are overlapping.  The GJK implementation does better on separated objects.]\n                    if (MPRToolbox.AreShapesOverlapping(detectorTriangle, mobileTriangle, ref detectorTriangleTransform, ref mobileTriangleTransform))\n                    {\n                        triangleTouching = true;\n                        //The convex can't be fully contained if it's still touching the surface.\n                        triangleContaining = false;\n                        overlaps.Clear();\n                        goto finishTriangleTest;\n                    }\n                }\n\n                overlaps.Clear();\n                //If we get here, then there was no shell intersection.\n                //If the convex's center point is contained by the mesh, then the convex is fully contained.\n                //This test is only needed if containment hasn't yet been outlawed or a touching state hasn't been established.\n                if ((!Touching || Containing) && DetectorVolume.IsPointContained(ref mobileTriangleTransform.Position, overlaps))\n                {\n                    triangleTouching = true;\n                    triangleContaining = true;\n                    goto finishTriangleTest;\n                }\n\n                //If we get here, then there was no surface intersection and the convex's center is not contained- the volume and convex are separate!\n                triangleTouching = false;\n                triangleContaining = false;\n\n            finishTriangleTest:\n                //Analyze the results of the triangle test.\n\n                if (triangleTouching)\n                    Touching = true; //If one child is touching, then we are touching too.\n                else\n                    Containing = false; //If one child isn't touching, then we aren't containing.\n\n                if (!triangleContaining) //If one child isn't containing, then we aren't containing.\n                    Containing = false;\n\n                if (!Containing && Touching)\n                {\n                    //If it's touching but not containing, no further pairs will change the state.\n                    //Containment has been invalidated by something that either didn't touch or wasn't contained.\n                    //Touching has been ensured by at least one object touching.\n                    break;\n                }\n\n            }\n\n            //There is a possibility that the MobileMesh is solid and fully contains the DetectorVolume.\n            //In this case, we should be Touching, but currently we are not.\n            if (mesh.Shape.solidity == MobileMeshSolidity.Solid && !Containing && !Touching)\n            {\n                //To determine if the detector volume is fully contained, check if one of the detector mesh's vertices\n                //are in the mobile mesh.\n\n                //This *could* fail if the mobile mesh is actually multiple pieces, but that's not a common or really supported case for solids.\n                Vector3 vertex;\n                DetectorVolume.TriangleMesh.Data.GetVertexPosition(0, out vertex);\n                Ray ray;\n                ray.Direction = Vector3.Up;\n                RayHit hit;\n                RigidTransform.TransformByInverse(ref vertex, ref mesh.worldTransform, out ray.Position);\n                if (mesh.Shape.IsLocalRayOriginInMesh(ref ray, out hit))\n                {\n                    Touching = true;\n                }\n            }\n\n            NotifyDetectorVolumeOfChanges();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/DetectorVolumePairHandler.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing System;\nusing BEPUphysics.UpdateableSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Superclass of pairs between collidables that generate contact points.\n    ///</summary>\n    public abstract class DetectorVolumePairHandler : NarrowPhasePair\n    {\n        /// <summary>\n        /// Gets the detector volume associated with the pair.\n        /// </summary>\n        public DetectorVolume DetectorVolume { get; private set; }\n        /// <summary>\n        /// Gets the entity collidable associated with the pair.\n        /// </summary>\n        public abstract EntityCollidable Collidable { get; }\n\n        /// <summary>\n        /// Gets whether or not the collidable was touching the detector volume during the previous frame.\n        /// </summary>\n        public bool WasTouching\n        {\n            get;\n            protected set;\n        }\n\n        /// <summary>\n        /// Gets whether or not the collidable was fully contained within the detector volume during the previous frame.\n        /// </summary>\n        public bool WasContaining\n        {\n            get;\n            protected set;\n        }\n\n        /// <summary>\n        /// Gets whether or not the collidable is touching the detector volume.\n        /// </summary>\n        public bool Touching\n        {\n            get;\n            protected set;\n        }\n\n        /// <summary>\n        /// Gets whether or not the collidable is fully contained within the detector volume.\n        /// </summary>\n        public bool Containing\n        {\n            get;\n            protected set;\n        }\n\n        /// <summary>\n        /// Gets the parent of this pair handler, if any.\n        /// </summary>\n        public IDetectorVolumePairHandlerParent Parent\n        {\n            get;\n            internal set;\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            //Child initialization is responsible for setting up the collidable.\n\n            DetectorVolume = entryA as DetectorVolume;\n            if (DetectorVolume == null)\n            {\n                DetectorVolume = entryB as DetectorVolume;\n                if (DetectorVolume == null)\n                    throw new ArgumentException(\"Incorrect types used to initialize detector volume pair.\");\n            }\n\n        }\n\n        ///<summary>\n        /// Called when the pair handler is added to the narrow phase.\n        ///</summary>\n        protected internal override void OnAddedToNarrowPhase()\n        {\n            DetectorVolume.pairs.Add(Collidable.entity, this);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            //Fire off some events if needed! Note the order; we should stop containing before we stop touching. \n            if (Parent == null)\n            {\n                if (Containing)\n                {\n                    DetectorVolume.StoppedContaining(this);\n                }\n                if (Touching)\n                {\n                    DetectorVolume.StoppedTouching(this);\n                }\n            }\n            Containing = false;\n            Touching = false;\n            WasContaining = false;\n            WasTouching = false;\n\n\n            DetectorVolume.pairs.Remove(Collidable.entity);\n\n\n            broadPhaseOverlap = new BroadPhaseOverlap();\n\n            DetectorVolume = null;\n\n            Parent = null;\n            //Child cleanup is responsible for cleaning up direct references to the involved collidables.\n\n\n        }\n\n        protected void NotifyDetectorVolumeOfChanges()\n        {\n            //Don't notify the detector volume if we have a parent.  The parent will analyze our state.\n            if (Parent == null)\n            {\n                //Beware the order!\n                //Starts touching -> starts containing\n                if (!WasTouching && Touching)\n                {\n                    DetectorVolume.BeganTouching(this);\n                }\n                if (!WasContaining && Containing)\n                {\n                    DetectorVolume.BeganContaining(this);\n                }\n                //Stops containing -> stops touching\n                if (WasContaining && !Containing)\n                {\n                    DetectorVolume.StoppedContaining(this);\n                }\n                if (WasTouching && !Touching)\n                {\n                    DetectorVolume.StoppedTouching(this);\n                }\n            }\n\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/GeneralConvexPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a convex-convex collision pair.\n    ///</summary>\n    public class GeneralConvexPairHandler : ConvexConstraintPairHandler\n    {\n        ConvexCollidable convexA;\n        ConvexCollidable convexB;\n\n        GeneralConvexContactManifold contactManifold = new GeneralConvexContactManifold();\n\n\n        public override Collidable CollidableA\n        {\n            get { return convexA; }\n        }\n        public override Collidable CollidableB\n        {\n            get { return convexB; }\n        }    \n        /// <summary>\n        /// Gets the contact manifold used by the pair handler.\n        /// </summary>\n        public override ContactManifold ContactManifold\n        {\n            get { return contactManifold; }\n        }\n        public override Entities.Entity EntityA\n        {\n            get { return convexA.entity; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return convexB.entity; }\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n\n            convexA = entryA as ConvexCollidable;\n            convexB = entryB as ConvexCollidable;\n\n            if (convexA == null || convexB == null)\n            {\n                throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n            }\n\n            base.Initialize(entryA, entryB);\n\n\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            convexA = null;\n            convexB = null;\n\n\n\n        }\n\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/GroupPairHandler.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.Constraints;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.Materials;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Superclass of pairs which manage multiple sub-collidable pairs.\n    ///</summary>\n    public abstract class GroupPairHandler : CollidablePairHandler, IPairHandlerParent\n    {\n        ContactManifoldConstraintGroup manifoldConstraintGroup;\n\n        Dictionary<CollidablePair, CollidablePairHandler> subPairs = new Dictionary<CollidablePair, CollidablePairHandler>();\n        HashSet<CollidablePair> containedPairs = new HashSet<CollidablePair>();\n        RawList<CollidablePair> pairsToRemove = new RawList<CollidablePair>();\n\n\n        ///<summary>\n        /// Gets a list of the pairs associated with children.\n        ///</summary>\n        public ReadOnlyDictionary<CollidablePair, CollidablePairHandler> ChildPairs\n        {\n            get\n            {\n                return new ReadOnlyDictionary<CollidablePair, CollidablePairHandler>(subPairs);\n            }\n        }\n\n\n\n        ///<summary>\n        /// Constructs a new compound-convex pair handler.\n        ///</summary>\n        protected GroupPairHandler()\n        {\n            manifoldConstraintGroup = new ContactManifoldConstraintGroup();\n        }\n\n\n\n\n        ///<summary>\n        /// Forces an update of the pair's material properties.\n        ///</summary>\n        ///<param name=\"a\">Material of the first member of the pair.</param>\n        ///<param name=\"b\">Material of the second member of the pair.</param>\n        public override void UpdateMaterialProperties(Material a, Material b)\n        {\n            foreach (var pairHandler in subPairs.Values)\n            {\n                pairHandler.UpdateMaterialProperties(a, b);\n            }\n        }\n\n        /// <summary>\n        /// Updates the material interaction properties of the pair handler's constraint.\n        /// </summary>\n        /// <param name=\"properties\">Properties to use.</param>\n        public override void UpdateMaterialProperties(InteractionProperties properties)\n        {\n            foreach (var pairHandler in subPairs.Values)\n            {\n                pairHandler.UpdateMaterialProperties(properties);\n            }\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n\n            //Child initialization is responsible for setting up the entries.\n            //Child initialization is responsible for setting up the manifold, if any.\n            manifoldConstraintGroup.Initialize(EntityA, EntityB);\n\n            base.Initialize(entryA, entryB);\n        }\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            //The pair handler cleanup will get rid of contacts.\n            foreach (var pairHandler in subPairs.Values)\n            {\n                pairHandler.CleanUp();\n                //Don't forget to give the pair back to the factory!\n                //There'd be a lot of leaks otherwise.\n                pairHandler.Factory.GiveBack(pairHandler);\n            }\n            subPairs.Clear();\n            //don't need to remove constraints directly from our group, since cleaning up our children should get rid of them.\n\n\n            base.CleanUp();\n\n            //Child type needs to null out the references.\n        }\n\n        //TODO: At the time of writing this, the default project configuration for the Xbox360 didn't allow optional parameters.  Could compress this.\n\n        protected void TryToAdd(Collidable a, Collidable b)\n        {\n            TryToAdd(a, b, null, null);\n        }\n\n        protected void TryToAdd(Collidable a, Collidable b, Material materialA)\n        {\n            TryToAdd(a, b, materialA, null);\n        }\n\n        protected void TryToAdd(Collidable a, Collidable b, Material materialA, Material materialB)\n        {\n            CollisionRule rule;\n            if ((rule = CollisionRules.collisionRuleCalculator(a, b)) < CollisionRule.NoNarrowPhasePair)\n            {\n                //Clamp the rule to the parent's rule.  Always use the more restrictive option.\n                //Don't have to test for NoNarrowPhasePair rule on the parent's rule because then the parent wouldn't exist!\n                if (rule < CollisionRule)\n                    rule = CollisionRule;\n                var pair = new CollidablePair(a, b);\n                if (!subPairs.ContainsKey(pair))\n                {\n                    var newPair = NarrowPhaseHelper.GetPairHandler(ref pair, rule);\n                    if (newPair != null)\n                    {\n                        newPair.UpdateMaterialProperties(materialA, materialB);  //Override the materials, if necessary.\n                        newPair.Parent = this;\n                        subPairs.Add(pair, newPair);\n                    }\n                }\n                containedPairs.Add(pair);\n            }\n        }\n\n        protected abstract void UpdateContainedPairs();\n\n\n        ///<summary>\n        /// Updates the pair handler's contacts.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        protected virtual void UpdateContacts(float dt)\n        {\n\n            UpdateContainedPairs();\n            //Eliminate old pairs.\n            foreach (CollidablePair pair in subPairs.Keys)\n            {\n                if (!containedPairs.Contains(pair))\n                    pairsToRemove.Add(pair);\n            }\n            for (int i = 0; i < pairsToRemove.Count; i++)\n            {\n                CollidablePairHandler toReturn = subPairs[pairsToRemove.Elements[i]];\n                subPairs.Remove(pairsToRemove.Elements[i]);\n                toReturn.CleanUp();\n                toReturn.Factory.GiveBack(toReturn);\n\n            }\n            containedPairs.Clear();\n            pairsToRemove.Clear();\n\n            foreach (CollidablePairHandler pair in subPairs.Values)\n            {\n                if (pair.BroadPhaseOverlap.collisionRule < CollisionRule.NoNarrowPhaseUpdate) //Don't test if the collision rules say don't.\n                    pair.UpdateCollision(dt);\n            }\n\n\n        }\n\n\n        ///<summary>\n        /// Updates the pair handler.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void UpdateCollision(float dt)\n        {\n\n            if (!suppressEvents)\n            {\n                CollidableA.EventTriggerer.OnPairUpdated(CollidableB, this);\n                CollidableB.EventTriggerer.OnPairUpdated(CollidableA, this);\n            }\n\n            UpdateContacts(dt);\n\n\n            if (contactCount > 0)\n            {\n                if (!suppressEvents)\n                {\n                    CollidableA.EventTriggerer.OnPairTouching(CollidableB, this);\n                    CollidableB.EventTriggerer.OnPairTouching(CollidableA, this);\n                }\n\n                if (previousContactCount == 0)\n                {\n                    //collision started!\n                    CollidableA.EventTriggerer.OnInitialCollisionDetected(CollidableB, this);\n                    CollidableB.EventTriggerer.OnInitialCollisionDetected(CollidableA, this);\n\n                    //No solver updateable addition in this method since it's handled by the \"AddSolverUpdateable\" method.\n                }\n            }\n            else if (previousContactCount > 0 && !suppressEvents)\n            {\n                //collision ended!\n                CollidableA.EventTriggerer.OnCollisionEnded(CollidableB, this);\n                CollidableB.EventTriggerer.OnCollisionEnded(CollidableA, this);\n\n                //No solver updateable removal in this method since it's handled by the \"RemoveSolverUpdateable\" method.\n            }\n            previousContactCount = contactCount;\n\n        }\n\n        ///<summary>\n        /// Updates the time of impact for the pair.\n        ///</summary>\n        ///<param name=\"requester\">Collidable requesting the update.</param>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void UpdateTimeOfImpact(Collidable requester, float dt)\n        {\n            timeOfImpact = 1;\n            foreach (CollidablePairHandler pair in subPairs.Values)\n            {\n                //The system uses the identity of the requester to determine if it needs to do handle the TOI calculation.\n                //Use the child pair's own entries as a proxy.\n                if (BroadPhaseOverlap.entryA == requester)\n                    pair.UpdateTimeOfImpact((Collidable)pair.BroadPhaseOverlap.entryA, dt);\n                else\n                    pair.UpdateTimeOfImpact((Collidable)pair.BroadPhaseOverlap.entryB, dt);\n                if (pair.timeOfImpact < timeOfImpact)\n                    timeOfImpact = pair.timeOfImpact;\n            }\n        }\n\n\n        protected internal override void GetContactInformation(int index, out ContactInformation info)\n        {\n            foreach (CollidablePairHandler pair in subPairs.Values)\n            {\n                int count = pair.Contacts.Count;\n                if (index - count < 0)\n                {\n                    pair.GetContactInformation(index, out info);\n                    return;\n                }\n                index -= count;\n            }\n            throw new IndexOutOfRangeException(\"Contact index is not present in the pair.\");\n\n        }\n\n\n        void IPairHandlerParent.AddSolverUpdateable(EntitySolverUpdateable addedItem)\n        {\n\n            manifoldConstraintGroup.Add(addedItem);\n            //If this is the first child solver item to be added, we need to add ourselves to our parent too.\n            if (manifoldConstraintGroup.SolverUpdateables.Count == 1)\n            {\n                if (Parent != null)\n                    Parent.AddSolverUpdateable(manifoldConstraintGroup);\n                else if (NarrowPhase != null)\n                    NarrowPhase.NotifyUpdateableAdded(manifoldConstraintGroup);\n            }\n\n        }\n\n        void IPairHandlerParent.RemoveSolverUpdateable(EntitySolverUpdateable removedItem)\n        {\n\n            manifoldConstraintGroup.Remove(removedItem);\n\n            //If this is the last child solver item, we need to remove ourselves from our parent too.\n            if (manifoldConstraintGroup.SolverUpdateables.Count == 0)\n            {\n                if (Parent != null)\n                    Parent.RemoveSolverUpdateable(manifoldConstraintGroup);\n                else if (NarrowPhase != null)\n                    NarrowPhase.NotifyUpdateableRemoved(manifoldConstraintGroup);\n            }\n\n\n        }\n\n\n        void IPairHandlerParent.OnContactAdded(Contact contact)\n        {\n            contactCount++;\n            OnContactAdded(contact);\n        }\n\n        void IPairHandlerParent.OnContactRemoved(Contact contact)\n        {\n            contactCount--;\n            OnContactRemoved(contact);\n        }\n\n\n\n\n        int contactCount;\n        /// <summary>\n        /// Gets the number of contacts in the pair.\n        /// </summary>\n        protected internal override int ContactCount\n        {\n            get { return contactCount; }\n        }\n\n        /// <summary>\n        /// Clears the pair's contacts.\n        /// </summary>\n        public override void ClearContacts()\n        {\n            foreach (var pair in subPairs.Values)\n            {\n                pair.ClearContacts();\n            }\n            base.ClearContacts();\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/IDetectorVolumePairHandlerParent.cs",
    "content": "﻿namespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    /// <summary>\n    /// Implemented by detector volume pair handlers with children.\n    /// </summary>\n    public interface IDetectorVolumePairHandlerParent\n    {\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/IPairHandlerParent.cs",
    "content": "﻿using BEPUphysics.Constraints;\nusing BEPUphysics.CollisionTests;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Defines a pair handler which can have children.\n    ///</summary>\n    public interface IPairHandlerParent\n    {\n        ///<summary>\n        /// Called when a child adds a contact.\n        ///</summary>\n        ///<param name=\"contact\">Contact added.</param>\n        void OnContactAdded(Contact contact);\n\n        /// <summary>\n        /// Called when a child removes a contact.\n        /// </summary>\n        /// <param name=\"contact\">Contact removed.</param>\n        void OnContactRemoved(Contact contact);\n\n        ///<summary>\n        /// Called when a child attempts to add a solver updateable to the solver.\n        ///</summary>\n        ///<param name=\"addedItem\">Item to add.</param>\n        void AddSolverUpdateable(EntitySolverUpdateable addedItem);\n\n\n        ///<summary>\n        /// Called when a child attempts to remove a solver updateable from the solver.\n        ///</summary>\n        ///<param name=\"removedItem\">Item to remove.</param>\n        void RemoveSolverUpdateable(EntitySolverUpdateable removedItem);\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/InstancedMeshConvexPairHandler.cs",
    "content": "﻿using BEPUphysics.CollisionTests.Manifolds;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a instanced mesh-convex collision pair.\n    ///</summary>\n    public class InstancedMeshConvexPairHandler : InstancedMeshPairHandler\n    {\n\n        InstancedMeshConvexContactManifold contactManifold = new InstancedMeshConvexContactManifold();\n        protected override InstancedMeshContactManifold MeshManifold\n        {\n            get { return contactManifold; }\n        }\n        \n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/InstancedMeshPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.DataStructures;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a instanced mesh-convex collision pair.\n    ///</summary>\n    public abstract class InstancedMeshPairHandler : StandardPairHandler\n    {\n        InstancedMesh instancedMesh;\n        ConvexCollidable convex;\n\n        NonConvexContactManifoldConstraint contactConstraint = new NonConvexContactManifoldConstraint();\n\n        public override Collidable CollidableA\n        {\n            get { return convex; }\n        }\n        public override Collidable CollidableB\n        {\n            get { return instancedMesh; }\n        }\n        public override Entities.Entity EntityA\n        {\n            get { return convex.entity; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return null; }\n        }\n        /// <summary>\n        /// Gets the contact constraint used by the pair handler.\n        /// </summary>\n        public override ContactManifoldConstraint ContactConstraint\n        {\n            get { return contactConstraint; }\n        }\n        /// <summary>\n        /// Gets the contact manifold used by the pair handler.\n        /// </summary>\n        public override ContactManifold ContactManifold\n        {\n            get { return MeshManifold; }\n        }\n        protected abstract InstancedMeshContactManifold MeshManifold { get; }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n\n            instancedMesh = entryA as InstancedMesh;\n            convex = entryB as ConvexCollidable;\n\n            if (instancedMesh == null || convex == null)\n            {\n                instancedMesh = entryB as InstancedMesh;\n                convex = entryA as ConvexCollidable;\n\n                if (instancedMesh == null || convex == null)\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n            }            \n            \n            //Contact normal goes from A to B.\n            broadPhaseOverlap.entryA = convex;\n            broadPhaseOverlap.entryB = instancedMesh;\n\n            UpdateMaterialProperties(convex.entity != null ? convex.entity.material : null, instancedMesh.material);\n\n\n            base.Initialize(entryA, entryB);\n\n\n\n  \n\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n            instancedMesh = null;\n            convex = null;\n\n        }\n\n\n\n        ///<summary>\n        /// Updates the time of impact for the pair.\n        ///</summary>\n        ///<param name=\"requester\">Collidable requesting the update.</param>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void UpdateTimeOfImpact(Collidable requester, float dt)\n        {\n            //Notice that we don't test for convex entity null explicitly.  The convex.IsActive property does that for us.\n            if (convex.IsActive && convex.entity.PositionUpdateMode == PositionUpdateMode.Continuous)\n            {\n                //TODO: This system could be made more robust by using a similar region-based rejection of edges.\n                //CCD events are awfully rare under normal circumstances, so this isn't usually an issue.\n\n                //Only perform the test if the minimum radii are small enough relative to the size of the velocity.\n                Vector3 velocity;\n                Vector3.Multiply(ref convex.entity.linearVelocity, dt, out velocity);\n                float velocitySquared = velocity.LengthSquared();\n\n                var minimumRadius = convex.Shape.minimumRadius * MotionSettings.CoreShapeScaling;\n                timeOfImpact = 1;\n                if (minimumRadius * minimumRadius < velocitySquared)\n                {\n                    var triangle = PhysicsResources.GetTriangle();\n                    triangle.collisionMargin = 0;\n                    //Spherecast against all triangles to find the earliest time.\n                    for (int i = 0; i < MeshManifold.overlappedTriangles.Count; i++)\n                    {\n                        MeshBoundingBoxTreeData data = instancedMesh.Shape.TriangleMesh.Data;\n                        int triangleIndex = MeshManifold.overlappedTriangles.Elements[i];\n                        data.GetTriangle(triangleIndex, out triangle.vA, out triangle.vB, out triangle.vC);\n                        AffineTransform.Transform(ref triangle.vA, ref instancedMesh.worldTransform, out triangle.vA);\n                        AffineTransform.Transform(ref triangle.vB, ref instancedMesh.worldTransform, out triangle.vB);\n                        AffineTransform.Transform(ref triangle.vC, ref instancedMesh.worldTransform, out triangle.vC);\n                        //Put the triangle into 'localish' space of the convex.\n                        Vector3.Subtract(ref triangle.vA, ref convex.worldTransform.Position, out triangle.vA);\n                        Vector3.Subtract(ref triangle.vB, ref convex.worldTransform.Position, out triangle.vB);\n                        Vector3.Subtract(ref triangle.vC, ref convex.worldTransform.Position, out triangle.vC);\n\n                        RayHit rayHit;\n                        if (GJKToolbox.CCDSphereCast(new Ray(Toolbox.ZeroVector, velocity), minimumRadius, triangle, ref Toolbox.RigidIdentity, timeOfImpact, out rayHit) &&\n                            rayHit.T > Toolbox.BigEpsilon)\n                        {\n\n                            if (instancedMesh.sidedness != TriangleSidedness.DoubleSided)\n                            {\n                                Vector3 AB, AC;\n                                Vector3.Subtract(ref triangle.vB, ref triangle.vA, out AB);\n                                Vector3.Subtract(ref triangle.vC, ref triangle.vA, out AC);\n                                Vector3 normal;\n                                Vector3.Cross(ref AB, ref AC, out normal);\n                                float dot;\n                                Vector3.Dot(ref normal, ref rayHit.Normal, out dot);\n                                //Only perform sweep if the object is in danger of hitting the object.\n                                //Triangles can be one sided, so check the impact normal against the triangle normal.\n                                if (instancedMesh.sidedness == TriangleSidedness.Counterclockwise && dot < 0 ||\n                                    instancedMesh.sidedness == TriangleSidedness.Clockwise && dot > 0)\n                                {\n                                    timeOfImpact = rayHit.T;\n                                }\n                            }\n                            else\n                            {\n                                timeOfImpact = rayHit.T;\n                            }\n                        }\n                    }\n                    PhysicsResources.GiveBack(triangle);\n                }\n\n\n\n            }\n\n        }\n\n\n        protected internal override void GetContactInformation(int index, out ContactInformation info)\n        {\n            info.Contact = MeshManifold.contacts.Elements[index];\n            //Find the contact's normal and friction forces.\n            info.FrictionImpulse = 0;\n            info.NormalImpulse = 0;\n            for (int i = 0; i < contactConstraint.frictionConstraints.Count; i++)\n            {\n                if (contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.contact == info.Contact)\n                {\n                    info.FrictionImpulse = contactConstraint.frictionConstraints.Elements[i].accumulatedImpulse;\n                    info.NormalImpulse = contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.accumulatedImpulse;\n                    break;\n                }\n            }\n\n            //Compute relative velocity\n            if (convex.entity != null)\n            {\n                Vector3 velocity;\n                Vector3.Subtract(ref info.Contact.Position, ref convex.entity.position, out velocity);\n                Vector3.Cross(ref convex.entity.angularVelocity, ref velocity, out velocity);\n                Vector3.Add(ref velocity, ref convex.entity.linearVelocity, out info.RelativeVelocity);\n            }\n            else\n                info.RelativeVelocity = new Vector3();\n\n\n            info.Pair = this;\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/InstancedMeshSpherePairHandler.cs",
    "content": "﻿using BEPUphysics.CollisionTests.Manifolds;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a instanced mesh-convex collision pair.\n    ///</summary>\n    public class InstancedMeshSpherePairHandler : InstancedMeshPairHandler\n    {\n        InstancedMeshSphereContactManifold contactManifold = new InstancedMeshSphereContactManifold();\n        protected override InstancedMeshContactManifold MeshManifold\n        {\n            get { return contactManifold; }\n        }\n        \n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/MeshGroupPairHandler.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Constraints;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.Materials;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    /// <summary>\n    /// Contains a triangle collidable and its index.  Used by mobile mesh-mesh collisions.\n    /// </summary>\n    public struct TriangleEntry : IEquatable<TriangleEntry>\n    {\n        /// <summary>\n        /// Index of the triangle that was the source of this entry.\n        /// </summary>\n        public int Index;\n        /// <summary>\n        /// Collidable for the triangle.\n        /// </summary>\n        public TriangleCollidable Collidable;\n\n        /// <summary>\n        /// Gets the hash code of the object.\n        /// </summary>\n        /// <returns>Hash code of the object.</returns>\n        public override int GetHashCode()\n        {\n            return Index;\n        }\n\n\n        /// <summary>\n        /// Determines if two colliders refer to the same triangle.\n        /// </summary>\n        /// <param name=\"other\">Object to compare.</param>\n        /// <returns>Whether or not the objects are equal.</returns>\n        public bool Equals(TriangleEntry other)\n        {\n            return other.Index == Index;\n        }\n    }\n\n    //TODO: Lots of overlap with the GroupPairHandler.\n    ///<summary>\n    /// Superclass of pair handlers which have multiple index-based collidable child pairs.\n    ///</summary>\n    public abstract class MeshGroupPairHandler : CollidablePairHandler, IPairHandlerParent\n    {\n        ContactManifoldConstraintGroup manifoldConstraintGroup;\n\n        Dictionary<TriangleEntry, MobileMeshPairHandler> subPairs = new Dictionary<TriangleEntry, MobileMeshPairHandler>();\n        HashSet<TriangleEntry> containedPairs = new HashSet<TriangleEntry>();\n        RawList<TriangleEntry> pairsToRemove = new RawList<TriangleEntry>();\n\n\n        ///<summary>\n        /// Gets a list of the pairs associated with children.\n        ///</summary>\n        public ReadOnlyDictionary<TriangleEntry, MobileMeshPairHandler> ChildPairs\n        {\n            get\n            {\n                return new ReadOnlyDictionary<TriangleEntry, MobileMeshPairHandler>(subPairs);\n            }\n        }\n\n        /// <summary>\n        /// Material of the first collidable.\n        /// </summary>\n        protected abstract Material MaterialA { get; }\n        /// <summary>\n        /// Material of the second collidable.\n        /// </summary>\n        protected abstract Material MaterialB { get; }\n\n        ///<summary>\n        /// Constructs a new compound-convex pair handler.\n        ///</summary>\n        protected MeshGroupPairHandler()\n        {\n            manifoldConstraintGroup = new ContactManifoldConstraintGroup();\n        }\n\n\n\n\n        ///<summary>\n        /// Forces an update of the pair's material properties.\n        ///</summary>\n        ///<param name=\"a\">Material of the first member of the pair.</param>\n        ///<param name=\"b\">Material of the second member of the pair.</param>\n        public override void UpdateMaterialProperties(Material a, Material b)\n        {\n            foreach (CollidablePairHandler pairHandler in subPairs.Values)\n            {\n                pairHandler.UpdateMaterialProperties(a, b);\n            }\n        }\n\n\n        /// <summary>\n        /// Updates the material interaction properties of the pair handler's constraint.\n        /// </summary>\n        /// <param name=\"properties\">Properties to use.</param>\n        public override void UpdateMaterialProperties(InteractionProperties properties)\n        {\n            foreach (CollidablePairHandler pairHandler in subPairs.Values)\n            {\n                pairHandler.UpdateMaterialProperties(properties);\n            }\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n\n            //Child initialization is responsible for setting up the entries.\n            //Child initialization is responsible for setting up the manifold, if any.\n            manifoldConstraintGroup.Initialize(EntityA, EntityB);\n\n            base.Initialize(entryA, entryB);\n        }\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            //The pair handler cleanup will get rid of contacts.\n            foreach (CollidablePairHandler pairHandler in subPairs.Values)\n            {\n                pairHandler.CleanUp();             \n                //Don't forget to give the pair back to the factory!\n                //There'd be a lot of leaks otherwise.\n                pairHandler.Factory.GiveBack(pairHandler);\n            }\n            subPairs.Clear();\n            //don't need to remove constraints directly from our group, since cleaning up our children should get rid of them.\n\n\n            base.CleanUp();\n\n            //Child type needs to null out the references.\n        }\n\n        protected void TryToAdd(int index)\n        {\n            var entry = new TriangleEntry { Index = index };\n            if (!subPairs.ContainsKey(entry))\n            {\n                var collidablePair = new CollidablePair(CollidableA, entry.Collidable = GetOpposingCollidable(index));\n                var newPair = (MobileMeshPairHandler)NarrowPhaseHelper.GetPairHandler(ref collidablePair);\n                if (newPair != null)\n                {\n                    newPair.CollisionRule = CollisionRule;\n                    newPair.UpdateMaterialProperties(MaterialA, MaterialB);  //Override the materials, if necessary.  Meshes don't currently support custom materials but..\n                    newPair.Parent = this;\n                    subPairs.Add(entry, newPair);\n                }\n            }\n            containedPairs.Add(entry);\n\n        }\n\n        /// <summary>\n        /// Get a collidable from CollidableB to represent the object at the given index.\n        /// </summary>\n        /// <param name=\"index\">Index to create a collidable for.</param>\n        /// <returns>Collidable for the object at the given index.</returns>\n        protected abstract TriangleCollidable GetOpposingCollidable(int index);\n\n        /// <summary>\n        /// Configure a triangle from CollidableB to represent the object at the given index.\n        /// </summary>\n        /// <param name=\"entry\">Entry to configure.</param>\n        /// <param name=\"dt\">Time step duration.</param>\n        protected abstract void ConfigureCollidable(TriangleEntry entry, float dt);\n\n        /// <summary>\n        /// Cleans up the collidable.\n        /// </summary>\n        /// <param name=\"collidable\">Collidable to clean up.</param>\n        protected virtual void CleanUpCollidable(TriangleCollidable collidable)\n        {\n            PhysicsResources.GiveBack(collidable);\n        }\n\n        protected abstract void UpdateContainedPairs(float dt);\n\n\n        ///<summary>\n        /// Updates the pair handler's contacts.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        protected virtual void UpdateContacts(float dt)\n        {\n\n            UpdateContainedPairs(dt);\n            //Eliminate old pairs.\n            foreach (var pair in subPairs.Keys)\n            {\n                if (!containedPairs.Contains(pair))\n                    pairsToRemove.Add(pair);\n            }\n            for (int i = 0; i < pairsToRemove.Count; i++)\n            {\n                var toReturn = subPairs[pairsToRemove.Elements[i]];\n                subPairs.Remove(pairsToRemove.Elements[i]);\n                toReturn.CleanUp();\n                toReturn.Factory.GiveBack(toReturn);\n\n            }\n            containedPairs.Clear();\n            pairsToRemove.Clear();\n\n            foreach (var pair in subPairs)\n            {\n                if (pair.Value.BroadPhaseOverlap.collisionRule < CollisionRule.NoNarrowPhaseUpdate) //Don't test if the collision rules say don't.\n                {\n                    ConfigureCollidable(pair.Key, dt);\n                    //Update the contact count using our (the parent) contact count so that the child can avoid costly solidity testing.\n                    pair.Value.MeshManifold.parentContactCount = contactCount;\n                    pair.Value.UpdateCollision(dt);\n                }\n            }\n\n\n        }\n\n\n        ///<summary>\n        /// Updates the pair handler.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void UpdateCollision(float dt)\n        {\n\n            if (!suppressEvents)\n            {\n                CollidableA.EventTriggerer.OnPairUpdated(CollidableB, this);\n                CollidableB.EventTriggerer.OnPairUpdated(CollidableA, this);\n            }\n\n            UpdateContacts(dt);\n\n\n            if (contactCount > 0)\n            {\n                if (!suppressEvents)\n                {\n                    CollidableA.EventTriggerer.OnPairTouching(CollidableB, this);\n                    CollidableB.EventTriggerer.OnPairTouching(CollidableA, this);\n                }\n\n                if (previousContactCount == 0)\n                {\n                    //collision started!\n                    CollidableA.EventTriggerer.OnInitialCollisionDetected(CollidableB, this);\n                    CollidableB.EventTriggerer.OnInitialCollisionDetected(CollidableA, this);\n\n                    //No solver updateable addition in this method since it's handled by the \"AddSolverUpdateable\" method.\n                }\n            }\n            else if (previousContactCount > 0 && !suppressEvents)\n            {\n                //collision ended!\n                CollidableA.EventTriggerer.OnCollisionEnded(CollidableB, this);\n                CollidableB.EventTriggerer.OnCollisionEnded(CollidableA, this);\n\n                //No solver updateable removal in this method since it's handled by the \"RemoveSolverUpdateable\" method.\n            }\n            previousContactCount = contactCount;\n\n        }\n\n        ///<summary>\n        /// Updates the time of impact for the pair.\n        ///</summary>\n        ///<param name=\"requester\">Collidable requesting the update.</param>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void UpdateTimeOfImpact(Collidable requester, float dt)\n        {\n            timeOfImpact = 1;\n            foreach (var pair in subPairs.Values)\n            {\n                //The system uses the identity of the requester to determine if it needs to do handle the TOI calculation.\n                //Use the child pair's own entries as a proxy.\n                if (BroadPhaseOverlap.entryA == requester)\n                    pair.UpdateTimeOfImpact((Collidable)pair.BroadPhaseOverlap.entryA, dt);\n                else\n                    pair.UpdateTimeOfImpact((Collidable)pair.BroadPhaseOverlap.entryB, dt);\n                if (pair.timeOfImpact < timeOfImpact)\n                    timeOfImpact = pair.timeOfImpact;\n            }\n        }\n\n\n        protected internal override void GetContactInformation(int index, out ContactInformation info)\n        {\n            foreach (CollidablePairHandler pair in subPairs.Values)\n            {\n                int count = pair.Contacts.Count;\n                if (index - count < 0)\n                {\n                    pair.GetContactInformation(index, out info);\n                    return;\n                }\n                index -= count;\n            }\n            throw new IndexOutOfRangeException(\"Contact index is not present in the pair.\");\n\n        }\n\n\n        void IPairHandlerParent.AddSolverUpdateable(EntitySolverUpdateable addedItem)\n        {\n\n            manifoldConstraintGroup.Add(addedItem);\n            //If this is the first child solver item to be added, we need to add ourselves to our parent too.\n            if (manifoldConstraintGroup.SolverUpdateables.Count == 1)\n            {\n                if (Parent != null)\n                    Parent.AddSolverUpdateable(manifoldConstraintGroup);\n                else if (NarrowPhase != null)\n                    NarrowPhase.NotifyUpdateableAdded(manifoldConstraintGroup);\n            }\n\n        }\n\n        void IPairHandlerParent.RemoveSolverUpdateable(EntitySolverUpdateable removedItem)\n        {\n\n            manifoldConstraintGroup.Remove(removedItem);\n\n            //If this is the last child solver item, we need to remove ourselves from our parent too.\n            if (manifoldConstraintGroup.SolverUpdateables.Count == 0)\n            {\n                if (Parent != null)\n                    Parent.RemoveSolverUpdateable(manifoldConstraintGroup);\n                else if (NarrowPhase != null)\n                    NarrowPhase.NotifyUpdateableRemoved(manifoldConstraintGroup);\n\n            }\n\n\n        }\n\n\n        void IPairHandlerParent.OnContactAdded(Contact contact)\n        {\n            contactCount++;\n            OnContactAdded(contact);\n        }\n\n        void IPairHandlerParent.OnContactRemoved(Contact contact)\n        {\n            contactCount--;\n            OnContactRemoved(contact);\n        }\n\n\n\n\n        int contactCount;\n        /// <summary>\n        /// Gets the number of contacts in the pair.\n        /// </summary>\n        protected internal override int ContactCount\n        {\n            get { return contactCount; }\n        }\n\n        /// <summary>\n        /// Clears the pair's contacts.\n        /// </summary>\n        public override void ClearContacts()\n        {\n            foreach (var pair in subPairs.Values)\n            {\n                pair.ClearContacts();\n            }\n            base.ClearContacts();\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/MobileMeshConvexPairHandler.cs",
    "content": "﻿using BEPUphysics.CollisionTests.Manifolds;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a mobile mesh-convex collision pair.\n    ///</summary>\n    public class MobileMeshConvexPairHandler : MobileMeshPairHandler\n    {\n        MobileMeshConvexContactManifold contactManifold = new MobileMeshConvexContactManifold();\n        protected internal override MobileMeshContactManifold MeshManifold\n        {\n            get { return contactManifold; }\n        }\n\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/MobileMeshInstancedMeshPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a mobile mesh-mobile mesh collision pair.\n    ///</summary>\n    public class MobileMeshInstancedMeshPairHandler : MobileMeshMeshPairHandler\n    {\n\n\n        InstancedMesh mesh;\n\n        public override Collidable CollidableB\n        {\n            get { return mesh; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return null; }\n        }\n        protected override Materials.Material MaterialB\n        {\n            get { return mesh.material; }\n        }\n\n        protected override TriangleCollidable GetOpposingCollidable(int index)\n        {\n            //Construct a TriangleCollidable from the static mesh.\n            var toReturn = PhysicsResources.GetTriangleCollidable();\n            var shape = toReturn.Shape;\n            mesh.Shape.TriangleMesh.Data.GetTriangle(index, out shape.vA, out shape.vB, out shape.vC);\n            Matrix3x3.Transform(ref shape.vA, ref mesh.worldTransform.LinearTransform, out shape.vA);\n            Matrix3x3.Transform(ref shape.vB, ref mesh.worldTransform.LinearTransform, out shape.vB);\n            Matrix3x3.Transform(ref shape.vC, ref mesh.worldTransform.LinearTransform, out shape.vC);\n            Vector3 center;\n            Vector3.Add(ref shape.vA, ref shape.vB, out center);\n            Vector3.Add(ref center, ref shape.vC, out center);\n            Vector3.Multiply(ref center, 1 / 3f, out center);\n            Vector3.Subtract(ref shape.vA, ref center, out shape.vA);\n            Vector3.Subtract(ref shape.vB, ref center, out shape.vB);\n            Vector3.Subtract(ref shape.vC, ref center, out shape.vC);\n\n            Vector3.Add(ref center, ref mesh.worldTransform.Translation, out center);\n            //The bounding box doesn't update by itself.\n            toReturn.worldTransform.Position = center;\n            toReturn.worldTransform.Orientation = Quaternion.Identity;\n            toReturn.UpdateBoundingBoxInternal(0);\n            shape.sidedness = mesh.Sidedness;\n            shape.collisionMargin = mobileMesh.Shape.MeshCollisionMargin;\n            return toReturn;\n        }\n\n      \n\n        protected override void ConfigureCollidable(TriangleEntry entry, float dt)\n        {\n\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            mesh = entryA as InstancedMesh;\n            if (mesh == null)\n            {\n                mesh = entryB as InstancedMesh;\n                if (mesh == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n\n\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n            mesh = null;\n\n\n        }\n\n\n\n\n        protected override void UpdateContainedPairs(float dt)\n        {\n            var overlappedElements = CommonResources.GetIntList();\n            BoundingBox localBoundingBox;\n\n            Vector3 sweep;\n            Vector3.Multiply(ref mobileMesh.entity.linearVelocity, dt, out sweep);\n            mobileMesh.Shape.GetSweptLocalBoundingBox(ref mobileMesh.worldTransform, ref mesh.worldTransform, ref sweep, out localBoundingBox);\n            mesh.Shape.TriangleMesh.Tree.GetOverlaps(localBoundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                TryToAdd(overlappedElements.Elements[i]);\n            }\n\n            CommonResources.GiveBack(overlappedElements);\n\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/MobileMeshMeshPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a mobile mesh and mesh collision pair.\n    ///</summary>\n    public abstract class MobileMeshMeshPairHandler : MeshGroupPairHandler\n    {\n        public MobileMeshCollidable mobileMesh;\n\n        public override Collidable CollidableA\n        {\n            get { return mobileMesh; }\n        }\n        public override Entities.Entity EntityA\n        {\n            get { return mobileMesh.entity; }\n        }\n        protected override Materials.Material MaterialA\n        {\n            get { return mobileMesh.entity.material; }\n        }\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            //Other member of the pair is initialized by the child.\n            mobileMesh = entryA as MobileMeshCollidable;\n            if (mobileMesh == null)\n            {\n                mobileMesh = entryB as MobileMeshCollidable;\n                if (mobileMesh == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n            base.Initialize(entryA, entryB);\n        }\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            mobileMesh = null;\n            //Child type needs to null out other reference.\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/MobileMeshMobileMeshPairHandler.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a mobile mesh-mobile mesh collision pair.\n    ///</summary>\n    public class MobileMeshMobileMeshPairHandler : MobileMeshMeshPairHandler\n    {\n\n\n        MobileMeshCollidable mesh;\n\n        public override Collidable CollidableB\n        {\n            get { return mesh; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return mesh.entity; }\n        }\n        protected override Materials.Material MaterialB\n        {\n            get { return mesh.entity.material; }\n        }\n\n        protected override TriangleCollidable GetOpposingCollidable(int index)\n        {\n            //Construct a TriangleCollidable from the static mesh.\n            var toReturn = PhysicsResources.GetTriangleCollidable();\n            toReturn.Shape.sidedness = mesh.Shape.Sidedness;\n            toReturn.Shape.collisionMargin = mobileMesh.Shape.MeshCollisionMargin;\n            toReturn.Entity = mesh.entity;\n            return toReturn;\n        }\n\n        protected override void CleanUpCollidable(TriangleCollidable collidable)\n        {\n            collidable.Entity = null;\n            base.CleanUpCollidable(collidable);\n        }\n\n        protected override void ConfigureCollidable(TriangleEntry entry, float dt)\n        {\n            var shape = entry.Collidable.Shape;\n            mesh.Shape.TriangleMesh.Data.GetTriangle(entry.Index, out shape.vA, out shape.vB, out shape.vC);\n            Matrix3x3 o;\n            Matrix3x3.CreateFromQuaternion(ref mesh.worldTransform.Orientation, out o);\n            Matrix3x3.Transform(ref shape.vA, ref o, out shape.vA);\n            Matrix3x3.Transform(ref shape.vB, ref o, out shape.vB);\n            Matrix3x3.Transform(ref shape.vC, ref o, out shape.vC);\n            Vector3 center;\n            Vector3.Add(ref shape.vA, ref shape.vB, out center);\n            Vector3.Add(ref center, ref shape.vC, out center);\n            Vector3.Multiply(ref center, 1 / 3f, out center);\n            Vector3.Subtract(ref shape.vA, ref center, out shape.vA);\n            Vector3.Subtract(ref shape.vB, ref center, out shape.vB);\n            Vector3.Subtract(ref shape.vC, ref center, out shape.vC);\n\n            Vector3.Add(ref center, ref mesh.worldTransform.Position, out center);\n            //The bounding box doesn't update by itself.\n            entry.Collidable.worldTransform.Position = center;\n            entry.Collidable.worldTransform.Orientation = Quaternion.Identity;\n            entry.Collidable.UpdateBoundingBoxInternal(dt);\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            mesh = (MobileMeshCollidable)entryB;\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n\n\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n            mesh = null;\n\n\n        }\n\n\n\n\n        protected override void UpdateContainedPairs(float dt)\n        {\n            var overlappedElements = CommonResources.GetIntList();\n            BoundingBox localBoundingBox;\n            AffineTransform meshTransform;\n            AffineTransform.CreateFromRigidTransform(ref mesh.worldTransform, out meshTransform);\n\n            Vector3 sweep;\n            Vector3.Subtract(ref mobileMesh.entity.linearVelocity, ref mesh.entity.linearVelocity, out sweep);\n            Vector3.Multiply(ref sweep, dt, out sweep);\n            mobileMesh.Shape.GetSweptLocalBoundingBox(ref mobileMesh.worldTransform, ref meshTransform, ref sweep, out localBoundingBox);\n            mesh.Shape.TriangleMesh.Tree.GetOverlaps(localBoundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                TryToAdd(overlappedElements.Elements[i]);\n            }\n\n            CommonResources.GiveBack(overlappedElements);\n\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/MobileMeshPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.DataStructures;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a mobile mesh-convex collision pair.\n    ///</summary>\n    public abstract class MobileMeshPairHandler : StandardPairHandler\n    {\n        MobileMeshCollidable mobileMesh;\n        ConvexCollidable convex;\n\n        NonConvexContactManifoldConstraint contactConstraint = new NonConvexContactManifoldConstraint();\n\n\n        public override Collidable CollidableA\n        {\n            get { return convex; }\n        }\n        public override Collidable CollidableB\n        {\n            get { return mobileMesh; }\n        }\n        public override Entities.Entity EntityA\n        {\n            get { return convex.entity; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return mobileMesh.entity; }\n        }\n        /// <summary>\n        /// Gets the contact manifold used by the pair handler.\n        /// </summary>\n        public override ContactManifold ContactManifold\n        {\n            get { return MeshManifold; }\n        }\n        /// <summary>\n        /// Gets the contact constraint used by the pair handler.\n        /// </summary>\n        public override ContactManifoldConstraint ContactConstraint\n        {\n            get { return contactConstraint; }\n        }\n\n        protected internal abstract MobileMeshContactManifold MeshManifold { get; }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n\n            mobileMesh = entryA as MobileMeshCollidable;\n            convex = entryB as ConvexCollidable;\n\n            if (mobileMesh == null || convex == null)\n            {\n                mobileMesh = entryB as MobileMeshCollidable;\n                convex = entryA as ConvexCollidable;\n\n                if (mobileMesh == null || convex == null)\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n            }\n\n\n            //Contact normal goes from A to B.\n            broadPhaseOverlap.entryA = convex;\n            broadPhaseOverlap.entryB = mobileMesh;\n\n            //It's possible that the convex does not have an entity if it is a proxy for a non-entity collidable.\n            //Similarly, the mesh could be a query object.\n            UpdateMaterialProperties(convex.entity != null ? convex.entity.material : null, mobileMesh.entity != null ? mobileMesh.entity.material : null);\n\n\n            base.Initialize(entryA, entryB);\n\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n\n            base.CleanUp();\n\n            mobileMesh = null;\n            convex = null;\n\n        }\n\n\n\n        ///<summary>\n        /// Updates the time of impact for the pair.\n        ///</summary>\n        ///<param name=\"requester\">Collidable requesting the update.</param>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void UpdateTimeOfImpact(Collidable requester, float dt)\n        {\n            var overlap = BroadPhaseOverlap;\n            var meshMode = mobileMesh.entity == null ? PositionUpdateMode.Discrete : mobileMesh.entity.PositionUpdateMode;\n            var convexMode = convex.entity == null ? PositionUpdateMode.Discrete : convex.entity.PositionUpdateMode;\n\n            if (\n                    (mobileMesh.IsActive || convex.IsActive) && //At least one has to be active.\n                    (\n                        (\n                            convexMode == PositionUpdateMode.Continuous &&   //If both are continuous, only do the process for A.\n                            meshMode == PositionUpdateMode.Continuous &&\n                            overlap.entryA == requester\n                        ) ||\n                        (\n                            convexMode == PositionUpdateMode.Continuous ^   //If only one is continuous, then we must do it.\n                            meshMode == PositionUpdateMode.Continuous\n                        )\n                    )\n                )\n            {\n                //TODO: This system could be made more robust by using a similar region-based rejection of edges.\n                //CCD events are awfully rare under normal circumstances, so this isn't usually an issue.\n\n                //Only perform the test if the minimum radii are small enough relative to the size of the velocity.\n                Vector3 velocity;\n                if (convexMode == PositionUpdateMode.Discrete)\n                {                    \n                    //Convex is static for the purposes of CCD.\n                    Vector3.Negate(ref mobileMesh.entity.linearVelocity, out velocity);\n                }\n                else if (meshMode == PositionUpdateMode.Discrete)\n                {\n                    //Mesh is static for the purposes of CCD.\n                    velocity = convex.entity.linearVelocity;\n                }\n                else\n                {\n                    //Both objects can move.\n                    Vector3.Subtract(ref convex.entity.linearVelocity, ref mobileMesh.entity.linearVelocity, out velocity);\n\n                }\n                Vector3.Multiply(ref velocity, dt, out velocity);\n                float velocitySquared = velocity.LengthSquared();\n\n                var minimumRadius = convex.Shape.minimumRadius * MotionSettings.CoreShapeScaling;\n                timeOfImpact = 1;\n                if (minimumRadius * minimumRadius < velocitySquared)\n                {\n                    TriangleSidedness sidedness = mobileMesh.Shape.Sidedness;\n                    Matrix3x3 orientation;\n                    Matrix3x3.CreateFromQuaternion(ref mobileMesh.worldTransform.Orientation, out orientation);\n                    var triangle = PhysicsResources.GetTriangle();\n                    triangle.collisionMargin = 0;\n                    //Spherecast against all triangles to find the earliest time.\n                    for (int i = 0; i < MeshManifold.overlappedTriangles.Count; i++)\n                    {\n                        MeshBoundingBoxTreeData data = mobileMesh.Shape.TriangleMesh.Data;\n                        int triangleIndex = MeshManifold.overlappedTriangles.Elements[i];\n                        data.GetTriangle(triangleIndex, out triangle.vA, out triangle.vB, out triangle.vC);\n                        Matrix3x3.Transform(ref triangle.vA, ref orientation, out triangle.vA);\n                        Matrix3x3.Transform(ref triangle.vB, ref orientation, out triangle.vB);\n                        Matrix3x3.Transform(ref triangle.vC, ref orientation, out triangle.vC);\n                        Vector3.Add(ref triangle.vA, ref mobileMesh.worldTransform.Position, out triangle.vA);\n                        Vector3.Add(ref triangle.vB, ref mobileMesh.worldTransform.Position, out triangle.vB);\n                        Vector3.Add(ref triangle.vC, ref mobileMesh.worldTransform.Position, out triangle.vC);\n                        //Put the triangle into 'localish' space of the convex.\n                        Vector3.Subtract(ref triangle.vA, ref convex.worldTransform.Position, out triangle.vA);\n                        Vector3.Subtract(ref triangle.vB, ref convex.worldTransform.Position, out triangle.vB);\n                        Vector3.Subtract(ref triangle.vC, ref convex.worldTransform.Position, out triangle.vC);\n\n                        RayHit rayHit;\n                        if (GJKToolbox.CCDSphereCast(new Ray(Toolbox.ZeroVector, velocity), minimumRadius, triangle, ref Toolbox.RigidIdentity, timeOfImpact, out rayHit) &&\n                            rayHit.T > Toolbox.BigEpsilon)\n                        {\n\n                            if (sidedness != TriangleSidedness.DoubleSided)\n                            {\n                                Vector3 AB, AC;\n                                Vector3.Subtract(ref triangle.vB, ref triangle.vA, out AB);\n                                Vector3.Subtract(ref triangle.vC, ref triangle.vA, out AC);\n                                Vector3 normal;\n                                Vector3.Cross(ref AB, ref AC, out normal);\n                                float dot;\n                                Vector3.Dot(ref normal, ref rayHit.Normal, out dot);\n                                //Only perform sweep if the object is in danger of hitting the object.\n                                //Triangles can be one sided, so check the impact normal against the triangle normal.\n                                if (sidedness == TriangleSidedness.Counterclockwise && dot < 0 ||\n                                    sidedness == TriangleSidedness.Clockwise && dot > 0)\n                                {\n                                    timeOfImpact = rayHit.T;\n                                }\n                            }\n                            else\n                            {\n                                timeOfImpact = rayHit.T;\n                            }\n                        }\n                    }\n                    PhysicsResources.GiveBack(triangle);\n                }\n\n\n\n            }\n\n        }\n\n\n        protected internal override void GetContactInformation(int index, out ContactInformation info)\n        {\n            info.Contact = MeshManifold.contacts.Elements[index];\n            //Find the contact's normal and friction forces.\n            info.FrictionImpulse = 0;\n            info.NormalImpulse = 0;\n            for (int i = 0; i < contactConstraint.frictionConstraints.Count; i++)\n            {\n                if (contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.contact == info.Contact)\n                {\n                    info.FrictionImpulse = contactConstraint.frictionConstraints.Elements[i].accumulatedImpulse;\n                    info.NormalImpulse = contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.accumulatedImpulse;\n                    break;\n                }\n            }\n\n            //Compute relative velocity\n            Vector3 velocity;\n            if (convex.entity != null)\n            {\n                Vector3.Subtract(ref info.Contact.Position, ref convex.entity.position, out velocity);\n                Vector3.Cross(ref convex.entity.angularVelocity, ref velocity, out velocity);\n                Vector3.Add(ref velocity, ref convex.entity.linearVelocity, out info.RelativeVelocity);\n            }\n            else\n                info.RelativeVelocity = new Vector3();\n\n            if (mobileMesh.entity != null)\n            {\n                Vector3.Subtract(ref info.Contact.Position, ref mobileMesh.entity.position, out velocity);\n                Vector3.Cross(ref mobileMesh.entity.angularVelocity, ref velocity, out velocity);\n                Vector3.Add(ref velocity, ref mobileMesh.entity.linearVelocity, out velocity);\n                Vector3.Subtract(ref info.RelativeVelocity, ref velocity, out info.RelativeVelocity);\n            }\n\n            info.Pair = this;\n        }\n\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/MobileMeshSpherePairHandler.cs",
    "content": "﻿using BEPUphysics.CollisionTests.Manifolds;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a mobile mesh-sphere collision pair.\n    ///</summary>\n    public class MobileMeshSpherePairHandler : MobileMeshPairHandler\n    {\n        MobileMeshSphereContactManifold contactManifold = new MobileMeshSphereContactManifold();\n        protected internal override MobileMeshContactManifold MeshManifold\n        {\n            get { return contactManifold; }\n        }\n\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/MobileMeshStaticMeshPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a mobile mesh-static mesh collision pair.\n    ///</summary>\n    public class MobileMeshStaticMeshPairHandler : MobileMeshMeshPairHandler\n    {\n\n\n        StaticMesh mesh;\n\n        public override Collidable CollidableB\n        {\n            get { return mesh; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return null; }\n        }\n        protected override Materials.Material MaterialB\n        {\n            get { return mesh.material; }\n        }\n\n        protected override TriangleCollidable GetOpposingCollidable(int index)\n        {\n            //Construct a TriangleCollidable from the static mesh.\n            var toReturn = PhysicsResources.GetTriangleCollidable();\n            var shape = toReturn.Shape;\n            mesh.Mesh.Data.GetTriangle(index, out shape.vA, out shape.vB, out shape.vC);\n            Vector3 center;\n            Vector3.Add(ref shape.vA, ref shape.vB, out center);\n            Vector3.Add(ref center, ref shape.vC, out center);\n            Vector3.Multiply(ref center, 1 / 3f, out center);\n            Vector3.Subtract(ref shape.vA, ref center, out shape.vA);\n            Vector3.Subtract(ref shape.vB, ref center, out shape.vB);\n            Vector3.Subtract(ref shape.vC, ref center, out shape.vC);\n            //The bounding box doesn't update by itself.\n            toReturn.worldTransform.Position = center;\n            toReturn.worldTransform.Orientation = Quaternion.Identity;\n            toReturn.UpdateBoundingBoxInternal(0);\n            shape.sidedness = mesh.sidedness;\n            shape.collisionMargin = mobileMesh.Shape.MeshCollisionMargin;\n            return toReturn;\n        }\n\n        protected override void ConfigureCollidable(TriangleEntry entry, float dt)\n        {\n\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            mesh = entryA as StaticMesh;\n            if (mesh == null)\n            {\n                mesh = entryB as StaticMesh;\n                if (mesh == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n\n\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n            mesh = null;\n\n\n        }\n\n\n\n\n        protected override void UpdateContainedPairs(float dt)\n        {\n            var overlappedElements = CommonResources.GetIntList();\n            mesh.Mesh.Tree.GetOverlaps(mobileMesh.boundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                TryToAdd(overlappedElements.Elements[i]);\n            }\n\n            CommonResources.GiveBack(overlappedElements);\n\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/MobileMeshTerrainPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a mobile mesh-mobile mesh collision pair.\n    ///</summary>\n    public class MobileMeshTerrainPairHandler : MobileMeshMeshPairHandler\n    {\n\n\n        Terrain mesh;\n\n        public override Collidable CollidableB\n        {\n            get { return mesh; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return null; }\n        }\n        protected override Materials.Material MaterialB\n        {\n            get { return mesh.material; }\n        }\n\n        protected override TriangleCollidable GetOpposingCollidable(int index)\n        {\n            //Construct a TriangleCollidable from the static mesh.\n            var toReturn = PhysicsResources.GetTriangleCollidable();\n            Vector3 terrainUp = new Vector3(mesh.worldTransform.LinearTransform.M21, mesh.worldTransform.LinearTransform.M22, mesh.worldTransform.LinearTransform.M23);\n            float dot;\n            Vector3 AB, AC, normal;\n            var shape = toReturn.Shape;\n            mesh.Shape.GetTriangle(index, ref mesh.worldTransform, out shape.vA, out shape.vB, out shape.vC);\n            Vector3 center;\n            Vector3.Add(ref shape.vA, ref shape.vB, out center);\n            Vector3.Add(ref center, ref shape.vC, out center);\n            Vector3.Multiply(ref center, 1 / 3f, out center);\n            Vector3.Subtract(ref shape.vA, ref center, out shape.vA);\n            Vector3.Subtract(ref shape.vB, ref center, out shape.vB);\n            Vector3.Subtract(ref shape.vC, ref center, out shape.vC);\n\n            //The bounding box doesn't update by itself.\n            toReturn.worldTransform.Position = center;\n            toReturn.worldTransform.Orientation = Quaternion.Identity;\n            toReturn.UpdateBoundingBoxInternal(0);\n\n            Vector3.Subtract(ref shape.vB, ref shape.vA, out AB);\n            Vector3.Subtract(ref shape.vC, ref shape.vA, out AC);\n            Vector3.Cross(ref AB, ref AC, out normal);\n            Vector3.Dot(ref terrainUp, ref normal, out dot);\n            if (dot > 0)\n            {\n                shape.sidedness = TriangleSidedness.Clockwise;\n            }\n            else\n            {\n                shape.sidedness = TriangleSidedness.Counterclockwise;\n            }\n            shape.collisionMargin = mobileMesh.Shape.MeshCollisionMargin;\n            return toReturn;\n        }\n\n\n        protected override void ConfigureCollidable(TriangleEntry entry, float dt)\n        {\n\n        }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            mesh = entryA as Terrain;\n            if (mesh == null)\n            {\n                mesh = entryB as Terrain;\n                if (mesh == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n\n\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n            mesh = null;\n\n\n        }\n\n\n\n\n        protected override void UpdateContainedPairs(float dt)\n        {\n            var overlappedElements = CommonResources.GetIntList();\n            BoundingBox localBoundingBox;\n\n            Vector3 sweep;\n            Vector3.Multiply(ref mobileMesh.entity.linearVelocity, dt, out sweep);\n            mobileMesh.Shape.GetSweptLocalBoundingBox(ref mobileMesh.worldTransform, ref mesh.worldTransform, ref sweep, out localBoundingBox);\n            mesh.Shape.GetOverlaps(localBoundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                TryToAdd(overlappedElements.Elements[i]);\n            }\n\n            CommonResources.GiveBack(overlappedElements);\n\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/MobileMeshTrianglePairHandler.cs",
    "content": "﻿using BEPUphysics.CollisionTests.Manifolds;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a mobile mesh-convex collision pair.\n    ///</summary>\n    public class MobileMeshTrianglePairHandler : MobileMeshPairHandler\n    {\n        MobileMeshTriangleContactManifold contactManifold = new MobileMeshTriangleContactManifold();\n        protected internal override MobileMeshContactManifold MeshManifold\n        {\n            get { return contactManifold; }\n        }\n\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/NarrowPhasePair.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.CollisionRuleManagement;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Superclass of objects which handle a collision between two broad phase entries.\n    ///</summary>\n    public abstract class NarrowPhasePair\n    {\n\n        ///<summary>\n        /// Updates the collision between the broad phase entries.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public abstract void UpdateCollision(float dt);\n\n        ///<summary>\n        /// Gets or sets whether or not the pair needs to be updated.\n        /// Used by the NarrowPhase to manage pairs.\n        ///</summary>\n        public bool NeedsUpdate { get; set; }\n\n        ///<summary>\n        /// Gets or sets the collision rule governing this pair.\n        ///</summary>\n        public CollisionRule CollisionRule\n        {\n            get\n            {\n                return broadPhaseOverlap.collisionRule;\n            }\n            set\n            {\n                broadPhaseOverlap.collisionRule = value;\n            }\n        }\n\n        internal BroadPhaseOverlap broadPhaseOverlap;\n        ///<summary>\n        /// Gets the overlap used to create the pair.\n        ///</summary>\n        public BroadPhaseOverlap BroadPhaseOverlap\n        {\n            get\n            {\n                return broadPhaseOverlap;\n            }\n            set\n            {\n                broadPhaseOverlap = value;\n                Initialize(value.entryA, value.entryB);\n            }\n        }\n\n        ///<summary>\n        /// Gets the factory that created the pair.\n        ///</summary>\n        public NarrowPhasePairFactory Factory { get; internal set; }\n\n        /// <summary>\n        /// Gets the narrow phase that owns this pair.\n        /// </summary>\n        public NarrowPhase NarrowPhase { get; internal set; }\n\n        ///<summary>\n        /// Initializes the pair.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public abstract void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB);\n        /// <summary>\n        /// Called when the pair is added to the narrow phase.\n        /// </summary>\n        protected internal abstract void OnAddedToNarrowPhase();\n        /// <summary>\n        /// Cleans up the pair, preparing it to go inactive.\n        /// </summary>\n        public abstract void CleanUp();\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/SpherePairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUphysics.CollisionTests.Manifolds;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a sphere-sphere collision pair.\n    ///</summary>\n    public class SpherePairHandler : ConvexPairHandler\n    {\n        ConvexCollidable<SphereShape> sphereA;\n        ConvexCollidable<SphereShape> sphereB;\n\n        //Using a non-convex one since they have slightly lower overhead than their Convex friends when dealing with a single contact point.\n        SphereContactManifold contactManifold = new SphereContactManifold();\n        NonConvexContactManifoldConstraint contactConstraint = new NonConvexContactManifoldConstraint();\n\n        public override Collidable CollidableA\n        {\n            get { return sphereA; }\n        }\n        public override Collidable CollidableB\n        {\n            get { return sphereB; }\n        }\n        public override Entities.Entity EntityA\n        {\n            get { return sphereA.entity; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return sphereB.entity; }\n        }\n        /// <summary>\n        /// Gets the contact constraint used by the pair handler.\n        /// </summary>\n        public override ContactManifoldConstraint ContactConstraint\n        {\n            get\n            {\n                return contactConstraint;\n            }\n        }\n        /// <summary>\n        /// Gets the contact manifold used by the pair handler.\n        /// </summary>\n        public override ContactManifold ContactManifold\n        {\n            get { return contactManifold; }\n        }\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n\n\n            sphereA = entryA as ConvexCollidable<SphereShape>;\n            sphereB = entryB as ConvexCollidable<SphereShape>;\n\n            if (sphereA == null || sphereB == null)\n            {\n                throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n            }\n\n            base.Initialize(entryA, entryB);\n\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n\n            sphereA = null;\n            sphereB = null;\n\n\n\n\n        }\n\n        protected internal override void GetContactInformation(int index, out ContactInformation info)\n        {\n            info.Contact = ContactManifold.contacts.Elements[index];\n            //Find the contact's force.\n            info.FrictionImpulse = 0;\n            info.NormalImpulse = 0;\n            for (int i = 0; i < contactConstraint.frictionConstraints.Count; i++)\n            {\n                if (contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.contact == info.Contact)\n                {\n                    info.FrictionImpulse = contactConstraint.frictionConstraints.Elements[i].accumulatedImpulse;\n                    info.NormalImpulse = contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.accumulatedImpulse;\n                    break;\n                }\n            }\n            //Compute relative velocity\n            Vector3 velocity;\n            if (EntityA != null)\n            {\n                Vector3.Subtract(ref info.Contact.Position, ref EntityA.position, out velocity);\n                Vector3.Cross(ref EntityA.angularVelocity, ref velocity, out velocity);\n                Vector3.Add(ref velocity, ref EntityA.linearVelocity, out info.RelativeVelocity);\n            }\n            else\n                info.RelativeVelocity = new Vector3();\n\n            if (EntityB != null)\n            {\n                Vector3.Subtract(ref info.Contact.Position, ref EntityB.position, out velocity);\n                Vector3.Cross(ref EntityB.angularVelocity, ref velocity, out velocity);\n                Vector3.Add(ref velocity, ref EntityB.linearVelocity, out velocity);\n                Vector3.Subtract(ref info.RelativeVelocity, ref velocity, out info.RelativeVelocity);\n            }\n\n\n            info.Pair = this;\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/StandardPairHandler.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.Materials;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a standard pair handler that has a direct manifold and constraint.\n    ///</summary>\n    public abstract class StandardPairHandler : CollidablePairHandler\n    {\n\n        /// <summary>\n        /// Gets the contact manifold used by the pair handler.\n        /// </summary>\n        public abstract ContactManifold ContactManifold { get; }\n        /// <summary>\n        /// Gets the contact constraint usd by the pair handler.\n        /// </summary>\n        public abstract ContactManifoldConstraint ContactConstraint { get; }\n\n        ///<summary>\n        /// Constructs a pair handler.\n        ///</summary>\n        protected StandardPairHandler()\n        {\n            //Child type constructors construct manifold and constraint first.\n            ContactManifold.ContactAdded += OnContactAdded;\n            ContactManifold.ContactRemoved += OnContactRemoved;\n        }\n\n        protected override void OnContactAdded(Contact contact)\n        {\n            ContactConstraint.AddContact(contact);\n            base.OnContactAdded(contact);\n\n        }\n\n        protected override void OnContactRemoved(Contact contact)\n        {\n            ContactConstraint.RemoveContact(contact);\n            base.OnContactRemoved(contact);\n\n        }\n\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            //Child initialization is responsible for setting up the entries.\n\n            ContactManifold.Initialize(CollidableA, CollidableB);\n            ContactConstraint.Initialize(EntityA, EntityB, this);\n\n            base.Initialize(entryA, entryB);\n\n\n\n        }\n\n        ///<summary>\n        /// Forces an update of the pair's material properties.\n        ///</summary>\n        public override void UpdateMaterialProperties(Material a, Material b)\n        {\n            ContactConstraint.UpdateMaterialProperties(\n                a ?? (EntityA == null ? null : EntityA.material),\n                b ?? (EntityB == null ? null : EntityB.material));\n        }\n\n        /// <summary>\n        /// Updates the material interaction properties of the pair handler's constraint.\n        /// </summary>\n        /// <param name=\"properties\">Properties to use.</param>\n        public override void UpdateMaterialProperties(InteractionProperties properties)\n        {\n            ContactConstraint.MaterialInteraction = properties;\n        }\n\n\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            //Deal with the remaining contacts.\n            for (int i = ContactManifold.contacts.Count - 1; i >= 0; i--)\n            {\n                OnContactRemoved(ContactManifold.contacts[i]);\n            }\n\n            //If the constraint is still in the solver, then request to have it removed.\n            if (ContactConstraint.solver != null)\n            {\n                ContactConstraint.pair = null; //Setting the pair to null tells the constraint that it's going to be orphaned.  It will be cleaned up on removal.\n                if (Parent != null)\n                    Parent.RemoveSolverUpdateable(ContactConstraint);\n                else if (NarrowPhase != null)\n                    NarrowPhase.NotifyUpdateableRemoved(ContactConstraint);\n            }\n            else\n            {\n                ContactConstraint.CleanUpReferences();//The constraint isn't in the solver, so we can safely clean it up directly.\n                //Even though it's not in the solver, we still may need to notify the parent to remove it.\n                if (Parent != null && ContactConstraint.SolverGroup != null)\n                    Parent.RemoveSolverUpdateable(ContactConstraint);\n            }\n\n            ContactConstraint.CleanUp();\n\n\n            base.CleanUp();\n\n            ContactManifold.CleanUp();\n\n\n            //Child cleanup is responsible for cleaning up direct references to the involved collidables.\n        }\n\n\n\n        ///<summary>\n        /// Updates the pair handler.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void UpdateCollision(float dt)\n        {\n            //Cache some properties.\n            var a = CollidableA;\n            var b = CollidableB;\n            var triggerA = a.EventTriggerer;\n            var triggerB = b.EventTriggerer;\n\n            if (!suppressEvents)\n            {\n                triggerA.OnPairUpdated(b, this);\n                triggerB.OnPairUpdated(a, this);\n            }\n\n            ContactManifold.Update(dt);\n\n            if (ContactManifold.contacts.Count > 0)\n            {\n                if (!suppressEvents)\n                {\n                    triggerA.OnPairTouching(b, this);\n                    triggerB.OnPairTouching(a, this);\n                }\n\n                if (previousContactCount == 0)\n                {\n                    //New collision.\n\n                    //Add a solver item.\n                    if (Parent != null)\n                        Parent.AddSolverUpdateable(ContactConstraint);\n                    else if (NarrowPhase != null)\n                        NarrowPhase.NotifyUpdateableAdded(ContactConstraint);\n\n                    //And notify the pair members.\n                    if (!suppressEvents)\n                    {\n                        triggerA.OnInitialCollisionDetected(b, this);\n                        triggerB.OnInitialCollisionDetected(a, this);\n                    }\n                }\n            }\n            else if (previousContactCount > 0)\n            {\n                //Just exited collision.\n\n                //Remove the solver item.\n                if (Parent != null)\n                    Parent.RemoveSolverUpdateable(ContactConstraint);\n                else if (NarrowPhase != null)\n                    NarrowPhase.NotifyUpdateableRemoved(ContactConstraint);\n\n                if (!suppressEvents)\n                {\n                    triggerA.OnCollisionEnded(b, this);\n                    triggerB.OnCollisionEnded(a, this);\n                }\n            }\n\n            previousContactCount = ContactManifold.contacts.Count;\n\n        }\n\n\n        /// <summary>\n        /// Gets the number of contacts associated with this pair handler.\n        /// </summary>\n        protected internal override int ContactCount\n        {\n            get { return ContactManifold.contacts.Count; }\n        }\n\n        /// <summary>\n        /// Clears the contacts associated with this pair handler.\n        /// </summary>\n        public override void ClearContacts()\n        {\n            if (previousContactCount > 0)\n            {\n                //Just exited collision.\n\n                //Remove the solver item.\n                if (Parent != null)\n                    Parent.RemoveSolverUpdateable(ContactConstraint);\n                else if (NarrowPhase != null)\n                    NarrowPhase.NotifyUpdateableRemoved(ContactConstraint);\n\n                if (!suppressEvents)\n                {\n                    var a = CollidableA;\n                    var b = CollidableB;\n                    a.EventTriggerer.OnCollisionEnded(b, this);\n                    b.EventTriggerer.OnCollisionEnded(a, this);\n                }\n            }\n            ContactManifold.ClearContacts();\n            base.ClearContacts();\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/StaticGroupCompoundPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.DataStructures;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound-compound collision pair.\n    ///</summary>\n    public class StaticGroupCompoundPairHandler : StaticGroupPairHandler\n    {\n\n        CompoundCollidable compoundInfo;\n\n        public override Collidable CollidableB\n        {\n            get { return compoundInfo; }\n        }\n\n        public override Entities.Entity EntityB\n        {\n            get { return compoundInfo.entity; }\n        }\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            compoundInfo = entryA as CompoundCollidable;\n            if (compoundInfo == null)\n            {\n                compoundInfo = entryB as CompoundCollidable;\n                if (compoundInfo == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n\n            base.CleanUp();\n            compoundInfo = null;\n\n\n        }\n\n        //Some danger of unintuitive-to-address allocations here.  If these lists get huge, the user will see some RawList<<>> goofiness in the profiler.\n        //They can still address it by clearing out the cached pair factories though.\n        RawList<TreeOverlapPair<Collidable, CompoundChild>> overlappedElements = new RawList<TreeOverlapPair<Collidable, CompoundChild>>();\n        protected override void UpdateContainedPairs()\n        {\n            staticGroup.Shape.CollidableTree.GetOverlaps(compoundInfo.hierarchy.Tree, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                var element = overlappedElements.Elements[i];\n                var staticCollidable = element.OverlapA as StaticCollidable;\n                TryToAdd(element.OverlapA, element.OverlapB.CollisionInformation,\n                    staticCollidable != null ? staticCollidable.Material : staticGroup.Material, element.OverlapB.Material);\n            }\n            overlappedElements.Clear();\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/StaticGroupConvexPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound and convex collision pair.\n    ///</summary>\n    public class StaticGroupConvexPairHandler : StaticGroupPairHandler\n    {\n        ConvexCollidable convexInfo;\n\n\n        public override Collidable CollidableB\n        {\n            get { return convexInfo; }\n        }\n\n        public override Entities.Entity EntityB\n        {\n            get { return convexInfo.entity; }\n        }\n\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            convexInfo = entryA as ConvexCollidable;\n            if (convexInfo == null)\n            {\n                convexInfo = entryB as ConvexCollidable;\n                if (convexInfo == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n            convexInfo = null;\n        }\n\n\n\n        protected override void UpdateContainedPairs()\n        {\n            var overlappedElements = PhysicsResources.GetCollidableList();\n            staticGroup.Shape.CollidableTree.GetOverlaps(convexInfo.boundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                var staticCollidable = overlappedElements.Elements[i] as StaticCollidable;\n                TryToAdd(overlappedElements.Elements[i], CollidableB, staticCollidable != null ? staticCollidable.Material : staticGroup.Material);\n            }\n\n            PhysicsResources.GiveBack(overlappedElements);\n\n\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/StaticGroupMobileMeshPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound-instanced mesh collision pair.\n    ///</summary>\n    public class StaticGroupMobileMeshPairHandler : StaticGroupPairHandler\n    {\n\n        MobileMeshCollidable mesh;\n\n        public override Collidable CollidableB\n        {\n            get { return mesh; }\n        }\n\n        public override Entities.Entity EntityB\n        {\n            get { return mesh.entity; }\n        }\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            mesh = entryA as MobileMeshCollidable;\n            if (mesh == null)\n            {\n                mesh = entryB as MobileMeshCollidable;\n                if (mesh == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n\n            base.Initialize(entryA, entryB);\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            mesh = null;\n        }\n\n\n\n    \n\n\n        protected override void UpdateContainedPairs()\n        {\n            var overlappedElements = PhysicsResources.GetCollidableList();\n            staticGroup.Shape.CollidableTree.GetOverlaps(mesh.boundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; i++)\n            {\n                var staticCollidable = overlappedElements.Elements[i] as StaticCollidable;\n                TryToAdd(overlappedElements.Elements[i], mesh, staticCollidable != null ? staticCollidable.Material : staticGroup.Material);\n            }\n\n            PhysicsResources.GiveBack(overlappedElements);\n\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/StaticGroupPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a compound and group collision pair.\n    ///</summary>\n    public abstract class StaticGroupPairHandler : GroupPairHandler\n    {\n        protected StaticGroup staticGroup;\n\n        public override Collidable CollidableA\n        {\n            get { return staticGroup; }\n        }\n        public override Entities.Entity EntityA\n        {\n            get { return null; }\n        }\n\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n            //Other member of the pair is initialized by the child.\n            staticGroup = entryA as StaticGroup;\n            if (staticGroup == null)\n            {\n                staticGroup = entryB as StaticGroup;\n                if (staticGroup == null)\n                {\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n                }\n            }\n\n            base.Initialize(entryA, entryB);\n        }\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            staticGroup = null;\n            //Child type needs to null out other reference.\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/StaticMeshConvexPairHandler.cs",
    "content": "﻿using BEPUphysics.CollisionTests.Manifolds;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a static mesh-convex collision pair.\n    ///</summary>\n    public class StaticMeshConvexPairHandler : StaticMeshPairHandler\n    {\n\n        StaticMeshConvexContactManifold contactManifold = new StaticMeshConvexContactManifold();\n        protected override StaticMeshContactManifold MeshManifold\n        {\n            get { return contactManifold; }\n        }\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/StaticMeshPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a static mesh-convex collision pair.\n    ///</summary>\n    public abstract class StaticMeshPairHandler : StandardPairHandler\n    {\n        StaticMesh mesh;\n        ConvexCollidable convex;\n\n        NonConvexContactManifoldConstraint contactConstraint = new NonConvexContactManifoldConstraint();\n\n\n        public override Collidable CollidableA\n        {\n            get { return convex; }\n        }\n        public override Collidable CollidableB\n        {\n            get { return mesh; }\n        }\n        public override Entities.Entity EntityA\n        {\n            get { return convex.entity; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return null; }\n        }\n        /// <summary>\n        /// Gets the contact constraint used by the pair handler.\n        /// </summary>\n        public override ContactManifoldConstraint ContactConstraint\n        {\n            get { return contactConstraint; }\n        }\n        /// <summary>\n        /// Gets the contact manifold used by the pair handler.\n        /// </summary>\n        public override ContactManifold ContactManifold\n        {\n            get { return MeshManifold; }\n        }\n\n        protected abstract StaticMeshContactManifold MeshManifold { get; }\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n\n            mesh = entryA as StaticMesh;\n            convex = entryB as ConvexCollidable;\n\n            if (mesh == null || convex == null)\n            {\n                mesh = entryB as StaticMesh;\n                convex = entryA as ConvexCollidable;\n\n                if (mesh == null || convex == null)\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n            }\n\n            //Contact normal goes from A to B.\n            broadPhaseOverlap.entryA = convex;\n            broadPhaseOverlap.entryB = mesh;\n\n            UpdateMaterialProperties(convex.entity != null ? convex.entity.material : null, mesh.material);\n\n            base.Initialize(entryA, entryB);\n\n\n\n\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            mesh = null;\n            convex = null;\n        }\n\n\n\n        ///<summary>\n        /// Updates the time of impact for the pair.\n        ///</summary>\n        ///<param name=\"requester\">Collidable requesting the update.</param>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void UpdateTimeOfImpact(Collidable requester, float dt)\n        {\n            //Notice that we don't test for convex entity null explicitly.  The convex.IsActive property does that for us.\n            if (convex.IsActive && convex.entity.PositionUpdateMode == PositionUpdateMode.Continuous)\n            {\n                //TODO: This system could be made more robust by using a similar region-based rejection of edges.\n                //CCD events are awfully rare under normal circumstances, so this isn't usually an issue.\n\n                //Only perform the test if the minimum radii are small enough relative to the size of the velocity.\n                Vector3 velocity;\n                Vector3.Multiply(ref convex.entity.linearVelocity, dt, out velocity);\n                float velocitySquared = velocity.LengthSquared();\n\n                var minimumRadius = convex.Shape.minimumRadius * MotionSettings.CoreShapeScaling;\n                timeOfImpact = 1;\n                if (minimumRadius * minimumRadius < velocitySquared)\n                {\n                    var triangle = PhysicsResources.GetTriangle();\n                    triangle.collisionMargin = 0;\n                    //Spherecast against all triangles to find the earliest time.\n                    for (int i = 0; i < MeshManifold.overlappedTriangles.Count; i++)\n                    {\n                        mesh.Shape.TriangleMeshData.GetTriangle(MeshManifold.overlappedTriangles.Elements[i], out triangle.vA, out triangle.vB, out triangle.vC);\n                        //Put the triangle into 'localish' space of the convex.\n                        Vector3.Subtract(ref triangle.vA, ref convex.worldTransform.Position, out triangle.vA);\n                        Vector3.Subtract(ref triangle.vB, ref convex.worldTransform.Position, out triangle.vB);\n                        Vector3.Subtract(ref triangle.vC, ref convex.worldTransform.Position, out triangle.vC);\n\n                        RayHit rayHit;\n                        if (GJKToolbox.CCDSphereCast(new Ray(Toolbox.ZeroVector, velocity), minimumRadius, triangle, ref Toolbox.RigidIdentity, timeOfImpact, out rayHit) &&\n                            rayHit.T > Toolbox.BigEpsilon)\n                        {\n                            if (mesh.sidedness != TriangleSidedness.DoubleSided)\n                            {\n                                Vector3 AB, AC;\n                                Vector3.Subtract(ref triangle.vB, ref triangle.vA, out AB);\n                                Vector3.Subtract(ref triangle.vC, ref triangle.vA, out AC);\n                                Vector3 normal;\n                                Vector3.Cross(ref AB, ref AC, out normal);\n                                float dot;\n                                Vector3.Dot(ref normal, ref rayHit.Normal, out dot);\n                                //Only perform sweep if the object is in danger of hitting the object.\n                                //Triangles can be one sided, so check the impact normal against the triangle normal.\n                                if (mesh.sidedness == TriangleSidedness.Counterclockwise && dot < 0 ||\n                                    mesh.sidedness == TriangleSidedness.Clockwise && dot > 0)\n                                {\n                                    timeOfImpact = rayHit.T;\n                                }\n                            }\n                            else\n                            {\n                                timeOfImpact = rayHit.T;\n                            }\n                        }\n                    }\n                    PhysicsResources.GiveBack(triangle);\n                }\n\n\n\n            }\n\n        }\n\n\n\n        protected internal override void GetContactInformation(int index, out ContactInformation info)\n        {\n            info.Contact = MeshManifold.contacts.Elements[index];\n            //Find the contact's normal and friction forces.\n            info.FrictionImpulse = 0;\n            info.NormalImpulse = 0;\n            for (int i = 0; i < contactConstraint.frictionConstraints.Count; i++)\n            {\n                if (contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.contact == info.Contact)\n                {\n                    info.FrictionImpulse = contactConstraint.frictionConstraints.Elements[i].accumulatedImpulse;\n                    info.NormalImpulse = contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.accumulatedImpulse;\n                    break;\n                }\n            }\n\n            //Compute relative velocity\n            if (convex.entity != null)\n            {\n                Vector3 velocity;\n                Vector3.Subtract(ref info.Contact.Position, ref convex.entity.position, out velocity);\n                Vector3.Cross(ref convex.entity.angularVelocity, ref velocity, out velocity);\n                Vector3.Add(ref velocity, ref convex.entity.linearVelocity, out info.RelativeVelocity);\n            }\n            else info.RelativeVelocity = new Vector3();\n\n            info.Pair = this;\n        }\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/StaticMeshSpherePairHandler.cs",
    "content": "﻿using BEPUphysics.CollisionTests.Manifolds;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a static mesh-sphere collision pair.\n    ///</summary>\n    public class StaticMeshSpherePairHandler : StaticMeshPairHandler\n    {\n\n        StaticMeshSphereContactManifold contactManifold = new StaticMeshSphereContactManifold();\n        protected override StaticMeshContactManifold MeshManifold\n        {\n            get { return contactManifold; }\n        }\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/TerrainConvexPairHandler.cs",
    "content": "﻿using BEPUphysics.CollisionTests.Manifolds;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a terrain-convex collision pair.\n    ///</summary>\n    public sealed class TerrainConvexPairHandler : TerrainPairHandler\n    {\n        protected TerrainConvexContactManifold contactManifold = new TerrainConvexContactManifold();\n        protected override TerrainContactManifold TerrainManifold\n        {\n            get { return contactManifold; }\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/TerrainPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a terrain-convex collision pair.\n    ///</summary>\n    public abstract class TerrainPairHandler : StandardPairHandler\n    {\n        Terrain terrain;\n        ConvexCollidable convex;\n\n        NonConvexContactManifoldConstraint contactConstraint = new NonConvexContactManifoldConstraint();\n\n\n        public override Collidable CollidableA\n        {\n            get { return convex; }\n        }\n        public override Collidable CollidableB\n        {\n            get { return terrain; }\n        }\n        public override Entities.Entity EntityA\n        {\n            get { return convex.entity; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return null; }\n        }\n        /// <summary>\n        /// Gets the contact constraint used by the pair handler.\n        /// </summary>\n        public override ContactManifoldConstraint ContactConstraint\n        {\n            get { return contactConstraint; }\n        }\n        /// <summary>\n        /// Gets the contact manifold used by the pair handler.\n        /// </summary>\n        public override ContactManifold ContactManifold\n        {\n            get { return TerrainManifold; }\n        }\n\n        protected abstract TerrainContactManifold TerrainManifold\n        {\n            get;\n        }\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n\n            terrain = entryA as Terrain;\n            convex = entryB as ConvexCollidable;\n\n            if (terrain == null || convex == null)\n            {\n                terrain = entryB as Terrain;\n                convex = entryA as ConvexCollidable;\n\n                if (terrain == null || convex == null)\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n            }\n\n            //Contact normal goes from A to B.\n            broadPhaseOverlap.entryA = convex;\n            broadPhaseOverlap.entryB = terrain;\n\n            UpdateMaterialProperties(convex.entity != null ? convex.entity.material : null, terrain.material);\n\n            base.Initialize(entryA, entryB);\n\n\n\n\n        }\n\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            terrain = null;\n            convex = null;\n\n        }\n\n\n        ///<summary>\n        /// Updates the time of impact for the pair.\n        ///</summary>\n        ///<param name=\"requester\">Collidable requesting the update.</param>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void UpdateTimeOfImpact(Collidable requester, float dt)\n        {\n            //Notice that we don't test for convex entity null explicitly.  The convex.IsActive property does that for us.\n            if (convex.IsActive && convex.entity.PositionUpdateMode == PositionUpdateMode.Continuous)\n            {\n                //TODO: This system could be made more robust by using a similar region-based rejection of edges.\n                //CCD events are awfully rare under normal circumstances, so this isn't usually an issue.\n\n                //Only perform the test if the minimum radii are small enough relative to the size of the velocity.\n                Vector3 velocity;\n                Vector3.Multiply(ref convex.entity.linearVelocity, dt, out velocity);\n                float velocitySquared = velocity.LengthSquared();\n\n                var minimumRadius = convex.Shape.minimumRadius * MotionSettings.CoreShapeScaling;\n                timeOfImpact = 1;\n                if (minimumRadius * minimumRadius < velocitySquared)\n                {\n                    var triangle = PhysicsResources.GetTriangle();\n                    triangle.collisionMargin = 0;\n                    Vector3 terrainUp = new Vector3(terrain.worldTransform.LinearTransform.M21, terrain.worldTransform.LinearTransform.M22, terrain.worldTransform.LinearTransform.M23);\n                    //Spherecast against all triangles to find the earliest time.\n                    for (int i = 0; i < TerrainManifold.overlappedTriangles.Count; i++)\n                    {\n                        terrain.Shape.GetTriangle(ref TerrainManifold.overlappedTriangles.Elements[i], ref terrain.worldTransform, out triangle.vA, out triangle.vB, out triangle.vC);\n                        //Put the triangle into 'localish' space of the convex.\n                        Vector3.Subtract(ref triangle.vA, ref convex.worldTransform.Position, out triangle.vA);\n                        Vector3.Subtract(ref triangle.vB, ref convex.worldTransform.Position, out triangle.vB);\n                        Vector3.Subtract(ref triangle.vC, ref convex.worldTransform.Position, out triangle.vC);\n\n                        RayHit rayHit;\n                        if (GJKToolbox.CCDSphereCast(new Ray(Toolbox.ZeroVector, velocity), minimumRadius, triangle, ref Toolbox.RigidIdentity, timeOfImpact, out rayHit) &&\n                            rayHit.T > Toolbox.BigEpsilon)\n                        {\n\n                            Vector3 AB, AC;\n                            Vector3.Subtract(ref triangle.vB, ref triangle.vA, out AB);\n                            Vector3.Subtract(ref triangle.vC, ref triangle.vA, out AC);\n                            Vector3 normal;\n                            Vector3.Cross(ref AC, ref AB, out normal);\n                            float dot;\n                            Vector3.Dot(ref normal, ref terrainUp, out dot);\n                            if (dot < 0)\n                                Vector3.Dot(ref normal, ref rayHit.Normal, out dot);\n                            else\n                            {\n                                Vector3.Dot(ref normal, ref rayHit.Normal, out dot);\n                                dot = -dot;\n                            }\n                            //Only perform sweep if the object is in danger of hitting the object.\n                            //Triangles can be one sided, so check the impact normal against the triangle normal.\n                            if (dot < 0)\n                            {\n                                timeOfImpact = rayHit.T;\n                            }\n                        }\n                    }\n                    PhysicsResources.GiveBack(triangle);\n                }\n\n\n\n            }\n\n        }\n\n\n        protected internal override void GetContactInformation(int index, out ContactInformation info)\n        {\n            info.Contact = TerrainManifold.contacts.Elements[index];\n            //Find the contact's normal and friction forces.\n            info.FrictionImpulse = 0;\n            info.NormalImpulse = 0;\n            for (int i = 0; i < contactConstraint.frictionConstraints.Count; i++)\n            {\n                if (contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.contact == info.Contact)\n                {\n                    info.FrictionImpulse = contactConstraint.frictionConstraints.Elements[i].accumulatedImpulse;\n                    info.NormalImpulse = contactConstraint.frictionConstraints.Elements[i].PenetrationConstraint.accumulatedImpulse;\n                    break;\n                }\n            }\n\n            //Compute relative velocity\n            if (convex.entity != null)\n            {\n                Vector3 velocity;\n                Vector3.Subtract(ref info.Contact.Position, ref convex.entity.position, out velocity);\n                Vector3.Cross(ref convex.entity.angularVelocity, ref velocity, out velocity);\n                Vector3.Add(ref velocity, ref convex.entity.linearVelocity, out info.RelativeVelocity);\n            }\n            else\n                info.RelativeVelocity = new Vector3();\n\n\n            info.Pair = this;\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/TerrainSpherePairHandler.cs",
    "content": "﻿using BEPUphysics.CollisionTests.Manifolds;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a terrain-sphere collision pair.\n    ///</summary>\n    public sealed class TerrainSpherePairHandler : TerrainPairHandler\n    {\n        protected TerrainSphereContactManifold contactManifold = new TerrainSphereContactManifold();\n        protected override TerrainContactManifold TerrainManifold\n        {\n            get { return contactManifold; }\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/NarrowPhaseSystems/Pairs/TriangleConvexPairHandler.cs",
    "content": "﻿using System;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.CollisionTests.CollisionAlgorithms.GJK;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.Constraints.Collision;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.Settings;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\n\nnamespace BEPUphysics.NarrowPhaseSystems.Pairs\n{\n    ///<summary>\n    /// Handles a triangle-convex collision pair.\n    ///</summary>\n    public class TriangleConvexPairHandler : ConvexConstraintPairHandler\n    {\n        ConvexCollidable<TriangleShape> triangle;\n        ConvexCollidable convex;\n\n        TriangleConvexContactManifold contactManifold = new TriangleConvexContactManifold();\n\n        public override Collidable CollidableA\n        {\n            get { return convex; }\n        }\n        public override Collidable CollidableB\n        {\n            get { return triangle; }\n        }\n\n        public override Entities.Entity EntityA\n        {\n            get { return convex.entity; }\n        }\n        public override Entities.Entity EntityB\n        {\n            get { return triangle.entity; }\n        }\n        /// <summary>\n        /// Gets the contact manifold used by the pair handler.\n        /// </summary>\n        public override ContactManifold ContactManifold\n        {\n            get { return contactManifold; }\n        }\n\n\n\n        ///<summary>\n        /// Initializes the pair handler.\n        ///</summary>\n        ///<param name=\"entryA\">First entry in the pair.</param>\n        ///<param name=\"entryB\">Second entry in the pair.</param>\n        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)\n        {\n\n            triangle = entryA as ConvexCollidable<TriangleShape>;\n            convex = entryB as ConvexCollidable;\n\n            if (triangle == null || convex == null)\n            {\n                triangle = entryB as ConvexCollidable<TriangleShape>;\n                convex = entryA as ConvexCollidable;\n\n                if (triangle == null || convex == null)\n                    throw new ArgumentException(\"Inappropriate types used to initialize pair.\");\n            }\n\n            //Contact normal goes from A to B.\n            broadPhaseOverlap.entryA = convex;\n            broadPhaseOverlap.entryB = triangle;\n\n            base.Initialize(entryA, entryB);\n\n        }\n\n        ///<summary>\n        /// Cleans up the pair handler.\n        ///</summary>\n        public override void CleanUp()\n        {\n            base.CleanUp();\n\n            triangle = null;\n            convex = null;\n\n        }\n\n\n\n\n        ///<summary>\n        /// Updates the time of impact for the pair.\n        ///</summary>\n        ///<param name=\"requester\">Collidable requesting the update.</param>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public override void UpdateTimeOfImpact(Collidable requester, float dt)\n        {\n            var overlap = BroadPhaseOverlap;\n            var triangleMode = triangle.entity == null ? PositionUpdateMode.Discrete : triangle.entity.PositionUpdateMode;\n            var convexMode = convex.entity == null ? PositionUpdateMode.Discrete : convex.entity.PositionUpdateMode;\n            if (\n                    (overlap.entryA.IsActive || overlap.entryB.IsActive) && //At least one has to be active.\n                    (\n                        (\n                            convexMode == PositionUpdateMode.Continuous &&   //If both are continuous, only do the process for A.\n                            triangleMode == PositionUpdateMode.Continuous &&\n                            overlap.entryA == requester\n                        ) ||\n                        (\n                            convexMode == PositionUpdateMode.Continuous ^   //If only one is continuous, then we must do it.\n                            triangleMode == PositionUpdateMode.Continuous\n                        )\n                    )\n                )\n            {\n\n\n                //Only perform the test if the minimum radii are small enough relative to the size of the velocity.\n                Vector3 velocity;\n                if (convexMode == PositionUpdateMode.Discrete)\n                {\n                    //Triangle is static for the purposes of this continuous test.\n                    velocity = triangle.entity.linearVelocity;\n                }\n                else if (triangleMode == PositionUpdateMode.Discrete)\n                {\n                    //Convex is static for the purposes of this continuous test.\n                    Vector3.Negate(ref convex.entity.linearVelocity, out velocity);\n                }\n                else\n                {\n                    //Both objects are moving.\n                    Vector3.Subtract(ref triangle.entity.linearVelocity, ref convex.entity.linearVelocity, out velocity);\n                }\n                Vector3.Multiply(ref velocity, dt, out velocity);\n                float velocitySquared = velocity.LengthSquared();\n\n                var minimumRadiusA = convex.Shape.minimumRadius * MotionSettings.CoreShapeScaling;\n                timeOfImpact = 1;\n                if (minimumRadiusA * minimumRadiusA < velocitySquared)\n                {\n                    //Spherecast A against B.\n                    RayHit rayHit;\n                    if (GJKToolbox.CCDSphereCast(new Ray(convex.worldTransform.Position, -velocity), minimumRadiusA, triangle.Shape, ref triangle.worldTransform, timeOfImpact, out rayHit))\n                    {\n                        if (triangle.Shape.sidedness != TriangleSidedness.DoubleSided)\n                        {                \n                            //Only perform sweep if the object is in danger of hitting the object.\n                            //Triangles can be one sided, so check the impact normal against the triangle normal.\n                            Vector3 AB, AC;\n                            Vector3.Subtract(ref triangle.Shape.vB, ref triangle.Shape.vA, out AB);\n                            Vector3.Subtract(ref triangle.Shape.vC, ref triangle.Shape.vA, out AC);\n                            Vector3 normal;\n                            Vector3.Cross(ref AB, ref AC, out normal);\n\n                            float dot;\n                            Vector3.Dot(ref rayHit.Normal, ref normal, out dot);\n                            if (triangle.Shape.sidedness == TriangleSidedness.Counterclockwise && dot < 0 ||\n                                triangle.Shape.sidedness == TriangleSidedness.Clockwise && dot > 0)\n                            {\n                                timeOfImpact = rayHit.T;\n                            }\n                        }\n                        else\n                        {\n                            timeOfImpact = rayHit.T;\n                        }\n                    }\n                }\n\n                //TECHNICALLY, the triangle should be casted too.  But, given the way triangles are usually used and their tiny minimum radius, ignoring it is usually just fine.\n                //var minimumRadiusB = triangle.minimumRadius * MotionSettings.CoreShapeScaling;\n                //if (minimumRadiusB * minimumRadiusB < velocitySquared)\n                //{\n                //    //Spherecast B against A.\n                //    RayHit rayHit;\n                //    if (GJKToolbox.SphereCast(new Ray(triangle.entity.position, velocity), minimumRadiusB, convex.Shape, ref convex.worldTransform, 1, out rayHit) &&\n                //        rayHit.T < timeOfImpact)\n                //    {\n                //        if (triangle.Shape.sidedness != TriangleSidedness.DoubleSided)\n                //        {\n                //            float dot;\n                //            Vector3.Dot(ref rayHit.Normal, ref normal, out dot);\n                //            if (dot > 0)\n                //            {\n                //                timeOfImpact = rayHit.T;\n                //            }\n                //        }\n                //        else\n                //        {\n                //            timeOfImpact = rayHit.T;\n                //        }\n                //    }\n                //}\n\n                //If it's intersecting, throw our hands into the air and give up.\n                //This is generally a perfectly acceptable thing to do, since it's either sitting\n                //inside another object (no ccd makes sense) or we're still in an intersecting case\n                //from a previous frame where CCD took place and a contact should have been created\n                //to deal with interpenetrating velocity.  Sometimes that contact isn't sufficient,\n                //but it's good enough.\n                if (timeOfImpact == 0)\n                    timeOfImpact = 1;\n            }\n\n        }\n\n\n    }\n\n}\n"
  },
  {
    "path": "BEPUphysics/OtherSpaceStages/BoundingBoxUpdater.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Threading;\nusing BEPUutilities;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.OtherSpaceStages\n{\n    ///<summary>\n    /// Updates the bounding box of managed objects.\n    ///</summary>\n    public class BoundingBoxUpdater : MultithreadedProcessingStage\n    {\n\n        //TODO: should the Entries field be publicly accessible since there's not any custom add/remove logic?\n        RawList<MobileCollidable> entries = new RawList<MobileCollidable>();\n        TimeStepSettings timeStepSettings;\n        ///<summary>\n        /// Gets or sets the time step settings used by the updater.\n        ///</summary>\n        public TimeStepSettings TimeStepSettings { get; set; }\n        ///<summary>\n        /// Constructs the bounding box updater.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step setttings to be used by the updater.</param>\n        public BoundingBoxUpdater(TimeStepSettings timeStepSettings)\n        {\n            multithreadedLoopBodyDelegate = LoopBody;\n            Enabled = true;\n            this.timeStepSettings = timeStepSettings;\n        }\n        ///<summary>\n        /// Constructs the bounding box updater.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step setttings to be used by the updater.</param>\n        /// <param name=\"threadManager\">Thread manager to be used by the updater.</param>\n        public BoundingBoxUpdater(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : this(timeStepSettings)\n        {\n            ThreadManager = threadManager;\n            AllowMultithreading = true;\n\n        }\n        Action<int> multithreadedLoopBodyDelegate;\n        void LoopBody(int i)\n        {\n            var entry = entries.Elements[i];\n            if (entry.IsActive)\n            {\n                entry.UpdateBoundingBox(timeStepSettings.TimeStepDuration);\n                entry.boundingBox.Validate();\n            }\n\n        }\n\n        ///<summary>\n        /// Adds an entry to the updater.\n        ///</summary>\n        ///<param name=\"entry\">Entry to add.</param>\n        public void Add(MobileCollidable entry)\n        {\n            //TODO: Contains check?\n            entries.Add(entry);\n        }\n        ///<summary>\n        /// Removes an entry from the updater.\n        ///</summary>\n        ///<param name=\"entry\">Entry to remove.</param>\n        public void Remove(MobileCollidable entry)\n        {\n            entries.Remove(entry);\n        }\n        protected override void UpdateMultithreaded()\n        {\n            ThreadManager.ForLoop(0, entries.Count, multithreadedLoopBodyDelegate);\n        }\n\n        protected override void UpdateSingleThreaded()\n        {\n            for (int i = 0; i < entries.Count; ++i)\n            {\n                LoopBody(i);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/OtherSpaceStages/DeferredEventDispatcher.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace BEPUphysics.OtherSpaceStages\n{\n    ///<summary>\n    /// Manages the deferred events spawned by IDeferredEventCreators and dispatches them on update.\n    ///</summary>\n    public class DeferredEventDispatcher : ProcessingStage\n    {\n        private List<IDeferredEventCreator> activeEventCreators = new List<IDeferredEventCreator>();\n\n        ///<summary>\n        /// Constructs the dispatcher.\n        ///</summary>\n        public DeferredEventDispatcher()\n        {\n            Enabled = true;\n        }\n\n        ///<summary>\n        /// Adds an event creator.\n        ///</summary>\n        ///<param name=\"creator\">Creator to add.</param>\n        ///<exception cref=\"ArgumentException\">Thrown when the creator is already managed by a dispatcher.</exception>\n        public void AddEventCreator(IDeferredEventCreator creator)\n        {\n            if (creator.DeferredEventDispatcher == null)\n            {\n                creator.DeferredEventDispatcher = this;\n                //If it already has events attached, add it to the active event creators list.\n                //Otherwise, don't bother adding it until it has some.\n                //It is up to the creator to notify the dispatcher of the change.\n                if (creator.IsActive)\n                    activeEventCreators.Add(creator);\n            }\n            else\n                throw new ArgumentException(\"The event creator is already managed by a dispatcher; it cannot be added.\", \"creator\");\n        }\n\n        /// <summary>\n        /// Removes an event creator.\n        /// </summary>\n        /// <param name=\"creator\">Creator to remove.</param>\n        public void RemoveEventCreator(IDeferredEventCreator creator)\n        {\n            if (creator.DeferredEventDispatcher == this)\n            {\n                creator.DeferredEventDispatcher = null;\n                if (creator.IsActive)\n                    activeEventCreators.Remove(creator);\n            }\n            else\n                throw new ArgumentException(\"The event creator is managed by a different dispatcher; it cannot be removed.\", \"creator\");\n        }\n\n        ///<summary>\n        /// Notifies the dispatcher that the event activity of a creator has changed.\n        ///</summary>\n        ///<param name=\"creator\">Cretor whose activity has changed.</param>\n        ///<exception cref=\"ArgumentException\">Thrown when the event creator's state hasn't changed.</exception>\n        public void CreatorActivityChanged(IDeferredEventCreator creator)\n        {\n            //This is a pretty rarely called method.  It's okay to do a little extra verification at the cost of performance.\n            if (creator.IsActive)\n                if (!activeEventCreators.Contains(creator))\n                    activeEventCreators.Add(creator);\n                else\n                    throw new ArgumentException(\"The event creator was already active in the dispatcher; make sure the CreatorActivityChanged function is only called when the state actually changes.\", \"creator\");\n            else\n                if (!activeEventCreators.Remove(creator))\n                    throw new ArgumentException(\"The event creator not active in the dispatcher; make sure the CreatorActivityChanged function is only called when the state actually changes.\", \"creator\");\n        }\n\n\n\n        protected override void UpdateStage()\n        {\n            for (int i = activeEventCreators.Count - 1; i >= 0; i--)\n            {\n                activeEventCreators[i].DispatchEvents();\n                // Since it can attempt to remove or add any number of creators during the handler, all we can do is make sure \n                // that our current index is still valid.  We may re-dispatch some event creators, but assuming they follow the\n                // proper pattern for deferred event creators, it will be okay.  The first execution cleans out all of the \n                // deferred events that have been queued up.  The second execution will try, but the queues will be empty.\n                // This is a fairly acceptable result for a rare case.\n                if (i > activeEventCreators.Count)\n                    i = activeEventCreators.Count;\n\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/OtherSpaceStages/ForceUpdater.cs",
    "content": "﻿using System;\nusing BEPUphysics.Threading;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities;\n\nnamespace BEPUphysics.OtherSpaceStages\n{\n    ///<summary>\n    /// Applies forces to managed objects.\n    ///</summary>\n    public class ForceUpdater : MultithreadedProcessingStage\n    {\n\n        RawList<IForceUpdateable> dynamicObjects = new RawList<IForceUpdateable>();\n        protected internal Vector3 gravity;\n        ///<summary>\n        /// Gets or sets the gravity applied by the force updater.\n        ///</summary>\n        public Vector3 Gravity\n        {\n            get\n            {\n                return gravity;\n            }\n            set\n            {\n                gravity = value;\n            }\n        }\n\n        internal Vector3 gravityDt;\n\n        protected TimeStepSettings timeStepSettings;\n\n        ///<summary>\n        /// Gets or sets the time step settings used by the force updater.\n        ///</summary>\n        public TimeStepSettings TimeStepSettings\n        {\n            get\n            {\n                return timeStepSettings;\n            }\n            set\n            {\n                timeStepSettings = value;\n            }\n        }\n\n        ///<summary>\n        /// Constructs the force updater.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        public ForceUpdater(TimeStepSettings timeStepSettings)\n        {\n            TimeStepSettings = timeStepSettings;\n            Enabled = true;\n            multithreadedLoopBodyDelegate = UpdateObject;\n        }\n\n        ///<summary>\n        /// Constructs the force updater.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        /// <param name=\"threadManager\">Thread manager to use.</param>\n        public ForceUpdater(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : this(timeStepSettings)\n        {\n            ThreadManager = threadManager;\n            AllowMultithreading = true;\n        }\n        private Action<int> multithreadedLoopBodyDelegate;\n        void UpdateObject(int i)\n        {\n            if (dynamicObjects.Elements[i].IsActive)\n                dynamicObjects.Elements[i].UpdateForForces(timeStepSettings.TimeStepDuration);\n        }\n\n        protected override void UpdateMultithreaded()\n        {\n            Vector3.Multiply(ref gravity, timeStepSettings.TimeStepDuration, out gravityDt);\n            ThreadManager.ForLoop(0, dynamicObjects.Count, multithreadedLoopBodyDelegate);\n        }\n\n        protected override void UpdateSingleThreaded()\n        {\n            Vector3.Multiply(ref gravity, timeStepSettings.TimeStepDuration, out gravityDt);\n            for (int i = 0; i < dynamicObjects.Count; i++)\n            {\n                UpdateObject(i);\n            }\n        }\n\n\n        ///<summary>\n        /// Adds a force updateable to the force updater.\n        ///</summary>\n        ///<param name=\"forceUpdateable\">Item to add.</param>\n        ///<exception cref=\"Exception\">Thrown when the item already belongs to a force updater.</exception>\n        public void Add(IForceUpdateable forceUpdateable)\n        {\n            if (forceUpdateable.ForceUpdater == null)\n            {\n                forceUpdateable.ForceUpdater = this;\n                if (forceUpdateable.IsDynamic)\n                    dynamicObjects.Add(forceUpdateable);\n            }\n            else\n                throw new ArgumentException(\"Cannot add updateable; it already belongs to another manager.\");\n        }\n        ///<summary>\n        /// Removes a force updateable from the force updater.\n        ///</summary>\n        ///<param name=\"forceUpdateable\">Item to remove.</param>\n        ///<exception cref=\"Exception\">Thrown when the item does not belong to this force updater or its state is corrupted.</exception>\n        public void Remove(IForceUpdateable forceUpdateable)\n        {\n            if (forceUpdateable.ForceUpdater == this)\n            {\n                if (forceUpdateable.IsDynamic && !dynamicObjects.Remove(forceUpdateable))\n                    throw new InvalidOperationException(\"Dynamic object not present in dynamic objects list; ensure that the IForceUpdateable was never removed from the list improperly by using ForceUpdateableBecomingKinematic.\");\n                forceUpdateable.ForceUpdater = null;\n            }\n            else\n                throw new ArgumentException(\"Cannot remove updateable; it does not belong to this manager.\");\n        }\n\n        /// <summary>\n        /// Notifies the system that a force updateable is becoming dynamic.\n        /// </summary>\n        /// <param name=\"updateable\">Updateable changing state.</param>\n        public void ForceUpdateableBecomingDynamic(IForceUpdateable updateable)\n        {\n            //This does not verify that it used to be kinematic.  Small room for unsafety.\n            if (updateable.ForceUpdater == this)\n            {\n                dynamicObjects.Add(updateable);\n            }\n            else\n                throw new ArgumentException(\"Updateable does not belong to this manager.\");\n        }\n        /// <summary>\n        /// Notifies the system that a force updateable is becoming kinematic.\n        /// </summary>\n        /// <param name=\"updateable\">Updateable changing state.</param>\n        public void ForceUpdateableBecomingKinematic(IForceUpdateable updateable)\n        {\n            //This does not verify that it used to be dynamic.  Small room for unsafety.\n            if (updateable.ForceUpdater == this)\n            {\n                if (!dynamicObjects.Remove(updateable))\n                    throw new InvalidOperationException(\"Dynamic object not present in dynamic objects list; ensure that the IVelocityUpdateable was never removed from the list improperly by using VelocityUpdateableBecomingKinematic.\");\n            }\n            else\n                throw new ArgumentException(\"Updateable does not belong to this manager.\");\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/OtherSpaceStages/IDeferredEventCreator.cs",
    "content": "﻿namespace BEPUphysics.OtherSpaceStages\n{\n    ///<summary>\n    /// Defines an object which can create deferred events.\n    ///</summary>\n    public interface IDeferredEventCreator\n    {\n        //Needs backreference in order to add/remove itself to the dispatcher when deferred event handlers are added/removed.\n        ///<summary>\n        /// Gets or sets the deferred event dispatcher that owns this creator.\n        ///</summary>\n        DeferredEventDispatcher DeferredEventDispatcher { get; set; }\n\n        ///<summary>\n        /// Gets or sets the activity state of this creator.\n        ///</summary>\n        bool IsActive { get; set; }\n\n        ///<summary>\n        /// Dispatches the events created by this creator.\n        ///</summary>\n        void DispatchEvents();\n\n        /// <summary>\n        /// Gets or sets the number of child deferred event creators.\n        /// </summary>\n        int ChildDeferredEventCreators { get; set; }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/OtherSpaceStages/IDeferredEventCreatorOwner.cs",
    "content": "﻿namespace BEPUphysics.OtherSpaceStages\n{\n    ///<summary>\n    /// Defines an object that owns a deferred event creator.\n    ///</summary>\n    public interface IDeferredEventCreatorOwner\n    {\n        ///<summary>\n        /// Gets the event creator owned by the object.\n        ///</summary>\n        IDeferredEventCreator EventCreator { get; }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/OtherSpaceStages/IForceUpdateable.cs",
    "content": "﻿namespace BEPUphysics.OtherSpaceStages\n{\n    ///<summary>\n    /// Defines an object which can be updated using forces by the ForceUpdater.\n    ///</summary>\n    public interface IForceUpdateable\n    {\n        ///<summary>\n        /// Applies forces to the object.\n        ///</summary>\n        ///<param name=\"dt\">Time step duration.</param>\n        void UpdateForForces(float dt);\n\n        ///<summary>\n        /// Force updater that owns this object.\n        ///</summary>\n        ForceUpdater ForceUpdater { get; set; }\n\n        ///<summary>\n        /// Gets whether or not this object is dynamic.\n        /// Only dynamic objects are updated by the force updater.\n        ///</summary>\n        bool IsDynamic { get; }\n\n        ///<summary>\n        /// Gets whether or not this object is active.  Only active objects are updated by the force updater.\n        ///</summary>\n        bool IsActive { get; }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/OtherSpaceStages/SpaceObjectBuffer.cs",
    "content": "﻿using BEPUutilities;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.OtherSpaceStages\n{\n\n\n    ///<summary>\n    /// Thead-safely buffers up space objects for addition and removal.\n    ///</summary>\n    public class SpaceObjectBuffer : ProcessingStage\n    {\n\n        private struct SpaceObjectChange\n        {\n            public readonly ISpaceObject SpaceObject;\n            //Could change to enumeration, or more generally, buffered 'action<ISpaceObject>' to perform on the space object.\n            public readonly bool ShouldAdd;\n\n            public SpaceObjectChange(ISpaceObject spaceObject, bool shouldAdd)\n            {\n                SpaceObject = spaceObject;\n                ShouldAdd = shouldAdd;\n            }\n        }\n        private ConcurrentDeque<SpaceObjectChange> objectsToChange = new ConcurrentDeque<SpaceObjectChange>();\n\n        private ISpace space;\n        ///<summary>\n        /// Gets the space which owns this buffer.\n        ///</summary>\n        public ISpace Space\n        {\n            get { return space; }\n        }\n\n        ///<summary>\n        /// Constructs the buffer.\n        ///</summary>\n        ///<param name=\"space\">Space that owns the buffer.</param>\n        public SpaceObjectBuffer(ISpace space)\n        {\n            Enabled = true;\n            this.space = space;\n        }\n\n        ///<summary>\n        /// Adds a space object to the buffer.\n        /// It will be added to the space the next time the buffer is flushed.\n        ///</summary>\n        ///<param name=\"spaceObject\">Space object to add.</param>\n        public void Add(ISpaceObject spaceObject)\n        {\n            objectsToChange.Enqueue(new SpaceObjectChange(spaceObject, true));\n        }\n\n        /// <summary>\n        /// Enqueues a removal request to the buffer.\n        /// It will be processed the next time the buffer is flushed.\n        /// </summary>\n        /// <param name=\"spaceObject\">Space object to remove.</param>\n        public void Remove(ISpaceObject spaceObject)\n        {\n            objectsToChange.Enqueue(new SpaceObjectChange(spaceObject, false));\n        }\n\n\n        protected override void UpdateStage()\n        {\n            SpaceObjectChange change;\n            while (objectsToChange.TryDequeueFirst(out change))\n            {\n                if (change.ShouldAdd)\n                    space.Add(change.SpaceObject);\n                else\n                    space.Remove(change.SpaceObject);\n            }\n        }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Paths/CardinalSpline3D.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Cardinal spline implementation of the 3D hermite curve.  Uses a tension parameter to control\n    /// the tightness of the curve.  When tension is zero, a cardinal spline acts like a Catmull-Rom spline.\n    /// </summary>\n    public class CardinalSpline3D : HermiteCurve3D\n    {\n        private float tension;\n\n        /// <summary>\n        /// Gets or sets the tension parameter of the cardinal spline.\n        /// A value of 0 acts like a Catmull-Rom spline, while a \n        /// value of 1 produces 0-length tangents.\n        /// </summary>\n        public float Tension\n        {\n            get { return tension; }\n            set { tension = MathHelper.Clamp(value, 0, 1); }\n        }\n\n\n        /// <summary>\n        /// Gets the curve's bounding index information.\n        /// </summary>\n        /// <param name=\"minIndex\">Index of the minimum control point in the active curve segment.</param>\n        /// <param name=\"maxIndex\">Index of the maximum control point in the active curve segment.</param>\n        public override void GetCurveIndexBoundsInformation(out int minIndex, out int maxIndex)\n        {\n            if (ControlPoints.Count > 3)\n            {\n                minIndex = 1;\n                maxIndex = ControlPoints.Count - 2;\n            }\n            else\n            {\n                minIndex = -1;\n                maxIndex = -1;\n            }\n        }\n\n        protected override void ComputeTangents()\n        {\n            tangents.Add(Vector3.Zero);\n            for (int i = 1; i < ControlPoints.Count - 1; i++)\n            {\n                Vector3 tangent;\n                Vector3 previous = ControlPoints[i - 1].Value;\n                Vector3 next = ControlPoints[i + 1].Value;\n                Vector3.Subtract(ref next, ref previous, out tangent);\n                Vector3.Multiply(ref tangent, (float)((1 - tension) / (ControlPoints[i + 1].Time - ControlPoints[i - 1].Time)), out tangent);\n                tangents.Add(tangent);\n            }\n            tangents.Add(Vector3.Zero);\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/ConstantAngularSpeedCurve.cs",
    "content": "﻿using BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Wrapper around an orientation curve that specifies a specific velocity at which to travel.\n    /// </summary>\n    public class ConstantAngularSpeedCurve : ConstantSpeedCurve<Quaternion>\n    {\n        /// <summary>\n        /// Constructs a new constant speed curve.\n        /// </summary>\n        /// <param name=\"speed\">Speed to maintain while traveling around a curve.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        public ConstantAngularSpeedCurve(float speed, Curve<Quaternion> curve)\n            : base(speed, curve)\n        {\n        }\n\n        /// <summary>\n        /// Constructs a new constant speed curve.\n        /// </summary>\n        /// <param name=\"speed\">Speed to maintain while traveling around a curve.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        /// <param name=\"sampleCount\">Number of samples to use when constructing the wrapper curve.\n        /// More samples increases the accuracy of the speed requirement at the cost of performance.</param>\n        public ConstantAngularSpeedCurve(float speed, Curve<Quaternion> curve, int sampleCount)\n            : base(speed, curve, sampleCount)\n        {\n        }\n\n        protected override float GetDistance(Quaternion start, Quaternion end)\n        {\n            Quaternion.Conjugate(ref end, out end);\n            Quaternion.Multiply(ref end, ref start, out end);\n            return Toolbox.GetAngleFromQuaternion(ref end);\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/ConstantLinearSpeedCurve.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Wrapper around a 3d position curve that specifies a specific velocity at which to travel.\n    /// </summary>\n    public class ConstantLinearSpeedCurve : ConstantSpeedCurve<Vector3>\n    {\n        /// <summary>\n        /// Constructs a new constant speed curve.\n        /// </summary>\n        /// <param name=\"speed\">Speed to maintain while traveling around a curve.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        public ConstantLinearSpeedCurve(float speed, Curve<Vector3> curve)\n            : base(speed, curve)\n        {\n        }\n\n        /// <summary>\n        /// Constructs a new constant speed curve.\n        /// </summary>\n        /// <param name=\"speed\">Speed to maintain while traveling around a curve.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        /// <param name=\"sampleCount\">Number of samples to use when constructing the wrapper curve.\n        /// More samples increases the accuracy of the speed requirement at the cost of performance.</param>\n        public ConstantLinearSpeedCurve(float speed, Curve<Vector3> curve, int sampleCount)\n            : base(speed, curve, sampleCount)\n        {\n        }\n\n        protected override float GetDistance(Vector3 start, Vector3 end)\n        {\n            float distance;\n            Vector3.Distance(ref start, ref end, out distance);\n            return distance;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/ConstantSpeedCurve.cs",
    "content": "﻿namespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Superclass of speed-controlled curves that have a constant speed.\n    /// </summary>\n    /// <typeparam name=\"TValue\">Type of the values in the curve.</typeparam>\n    public abstract class ConstantSpeedCurve<TValue> : SpeedControlledCurve<TValue>\n    {\n        /// <summary>\n        /// Constructs a new constant speed curve.\n        /// </summary>\n        /// <param name=\"speed\">Speed to maintain while traveling around a curve.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        protected ConstantSpeedCurve(float speed, Curve<TValue> curve)\n            : base(curve)\n        {\n            Speed = speed;\n            ResampleCurve();\n        }\n\n        /// <summary>\n        /// Constructs a new constant speed curve.\n        /// </summary>\n        /// <param name=\"speed\">Speed to maintain while traveling around a curve.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        /// <param name=\"sampleCount\">Number of samples to use when constructing the wrapper curve.\n        /// More samples increases the accuracy of the speed requirement at the cost of performance.</param>\n        protected ConstantSpeedCurve(float speed, Curve<TValue> curve, int sampleCount)\n            : base(curve, sampleCount)\n        {\n            Speed = speed;\n            ResampleCurve();\n        }\n\n        /// <summary>\n        /// Gets or sets the speed of the curve.\n        /// </summary>\n        public float Speed { get; set; }\n\n        /// <summary>\n        /// Gets the desired speed at a given time.\n        /// </summary>\n        /// <param name=\"time\">Time to check for speed.</param>\n        /// <returns>Speed at the given time.</returns>\n        public override float GetSpeedAtCurveTime(double time)\n        {\n            return Speed;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/Curve.cs",
    "content": "﻿using System;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Manages a curve in 3D space that supports interpolation.\n    /// </summary>\n    /// <typeparam name=\"TValue\">Type of values in the curve.</typeparam>\n    public abstract class Curve<TValue> : Path<TValue>\n    {\n        /// <summary>\n        /// Constructs a new 3D curve.\n        /// </summary>\n        protected Curve()\n        {\n            ControlPoints = new CurveControlPointList<TValue>(this);\n        }\n\n        /// <summary>\n        /// Gets the list of control points in the curve.\n        /// </summary>\n        public CurveControlPointList<TValue> ControlPoints { get; private set; }\n\n        /// <summary>\n        /// Defines how the curve is sampled when the evaluation time exceeds the final control point.\n        /// </summary>\n        public CurveEndpointBehavior PostLoop { get; set; }\n\n        /// <summary>\n        /// Defines how the curve is sampled when the evaluation time exceeds the beginning control point.\n        /// </summary>\n        public CurveEndpointBehavior PreLoop { get; set; }\n\n        /// <summary>\n        /// Converts an unbounded time to a time within the curve's interval using the \n        /// endpoint behavior.\n        /// </summary>\n        /// <param name=\"time\">Time to convert.</param>\n        /// <param name=\"intervalBegin\">Beginning of the curve's interval.</param>\n        /// <param name=\"intervalEnd\">End of the curve's interval.</param>\n        /// <param name=\"preLoop\">Looping behavior of the curve before the first endpoint's time.</param>\n        /// <param name=\"postLoop\">Looping behavior of the curve after the last endpoint's time.</param>\n        /// <returns>Time within the curve's interval.</returns>\n        public static double ModifyTime(double time, double intervalBegin, double intervalEnd, CurveEndpointBehavior preLoop, CurveEndpointBehavior postLoop)\n        {\n            if (time < intervalBegin)\n            {\n                switch (preLoop)\n                {\n                    case CurveEndpointBehavior.Wrap:\n                        double modifiedTime = time - intervalBegin;\n                        double intervalLength = intervalEnd - intervalBegin;\n                        modifiedTime %= intervalLength;\n                        return intervalEnd + modifiedTime;\n                    case CurveEndpointBehavior.Clamp:\n                        return Math.Max(intervalBegin, time);\n                    case CurveEndpointBehavior.Mirror:\n                        modifiedTime = time - intervalBegin;\n                        intervalLength = intervalEnd - intervalBegin;\n                        var numFlips = (int) (modifiedTime / intervalLength);\n                        if (numFlips % 2 == 0)\n                            return intervalBegin - modifiedTime % intervalLength;\n                        return intervalEnd + modifiedTime % intervalLength;\n                }\n            }\n            else if (time >= intervalEnd)\n            {\n                switch (postLoop)\n                {\n                    case CurveEndpointBehavior.Wrap:\n                        double modifiedTime = time - intervalEnd;\n                        double intervalLength = intervalEnd - intervalBegin;\n                        modifiedTime %= intervalLength;\n                        return intervalBegin + modifiedTime;\n                    case CurveEndpointBehavior.Clamp:\n                        return Math.Min(intervalEnd, time);\n                    case CurveEndpointBehavior.Mirror:\n                        modifiedTime = time - intervalEnd;\n                        intervalLength = intervalEnd - intervalBegin;\n                        var numFlips = (int) (modifiedTime / intervalLength);\n                        if (numFlips % 2 == 0)\n                            return intervalEnd - modifiedTime % intervalLength;\n                        return intervalBegin + modifiedTime % intervalLength;\n                }\n            }\n            return time;\n        }\n\n        /// <summary>\n        /// Evaluates the curve section starting at the control point index using\n        /// the weight value.\n        /// </summary>\n        /// <param name=\"controlPointIndex\">Index of the starting control point of the subinterval.</param>\n        /// <param name=\"weight\">Location to evaluate on the subinterval from 0 to 1.</param>\n        /// <param name=\"value\">Value at the given location.</param>\n        public abstract void Evaluate(int controlPointIndex, float weight, out TValue value);\n\n        /// <summary>\n        /// Gets the curve's bounding index information.\n        /// </summary>\n        /// <param name=\"minIndex\">Index of the minimum control point in the active curve segment.</param>\n        /// <param name=\"maxIndex\">Index of the maximum control point in the active curve segment.</param>\n        public abstract void GetCurveIndexBoundsInformation(out int minIndex, out int maxIndex);\n\n        /// <summary>\n        /// Computes the value of the curve at a given time.\n        /// </summary>\n        /// <param name=\"time\">Time at which to evaluate the curve.</param>\n        /// <param name=\"value\">Curve value at the given time.</param>\n        public override void Evaluate(double time, out TValue value)\n        {\n            double firstTime, lastTime;\n            int minIndex, maxIndex;\n            GetCurveBoundsInformation(out firstTime, out lastTime, out minIndex, out maxIndex);\n            if (minIndex < 0 || maxIndex < 0)\n            {\n                //Invalid bounds, quit with default\n                value = default(TValue);\n                return;\n            }\n            if (minIndex == maxIndex)\n            {\n                //1-length curve; asking the system to evaluate\n                //this will be a waste of time AND\n                //crash since +1 will be outside scope\n                value = ControlPoints[minIndex].Value;\n                return;\n            }\n            time = ModifyTime(time, firstTime, lastTime, PreLoop, PostLoop);\n\n            int index = GetPreviousIndex(time);\n            if (index == maxIndex)\n            {\n                //Somehow the index is the very last index, so next index would be invalid.\n                //Just 'clamp' it.\n                //This generally implies a bug, but it might also just be some very close floating point issue.\n                value = ControlPoints[maxIndex].Value;\n            }\n            else\n            {\n                var denominator = ControlPoints[index + 1].Time - ControlPoints[index].Time;\n\n                float intervalTime;\n                if (denominator < Toolbox.Epsilon)\n                    intervalTime = 0;\n                else\n                    intervalTime = (float) ((time - ControlPoints[index].Time) / denominator);\n\n\n                Evaluate(index, intervalTime, out value);\n            }\n        }\n\n        /// <summary>\n        /// Gets the starting and ending times of the path.\n        /// </summary>\n        /// <param name=\"startingTime\">Beginning time of the path.</param>\n        /// <param name=\"endingTime\">Ending time of the path.</param>\n        public override void GetPathBoundsInformation(out double startingTime, out double endingTime)\n        {\n            int index;\n            GetCurveBoundsInformation(out startingTime, out endingTime, out index, out index);\n        }\n\n        /// <summary>\n        /// Gets information about the curve's total active interval.\n        /// These are not always the first and last endpoints in a curve.\n        /// </summary>\n        /// <param name=\"firstIndexTime\">Time of the first index.</param>\n        /// <param name=\"lastIndexTime\">Time of the last index.</param>\n        /// <param name=\"minIndex\">First index in the reachable curve.</param>\n        /// <param name=\"maxIndex\">Last index in the reachable curve.</param>\n        public void GetCurveBoundsInformation(out double firstIndexTime, out double lastIndexTime, out int minIndex, out int maxIndex)\n        {\n            GetCurveIndexBoundsInformation(out minIndex, out maxIndex);\n            if (minIndex >= 0 && maxIndex < ControlPoints.Count && minIndex <= maxIndex)\n            {\n                firstIndexTime = ControlPoints[minIndex].Time;\n                lastIndexTime = ControlPoints[maxIndex].Time;\n            }\n            else\n            {\n                firstIndexTime = 0;\n                lastIndexTime = 0;\n            }\n        }\n\n        /// <summary>\n        /// Computes the indices of control points surrounding the time.\n        /// If the time is equal to a control point's time, indexA will\n        /// be that control point's index.\n        /// </summary>\n        /// <param name=\"time\">Time to index.</param>\n        /// <returns>Index prior to or equal to the given time.</returns>\n        public int GetPreviousIndex(double time)\n        {\n            int indexMin = 0;\n            int indexMax = ControlPoints.Count;\n            if (indexMax == 0)\n                return -1;\n            //If time < controlpoints.mintime, should be... 0 or -1?\n            while (indexMax - indexMin > 1) //if time belongs to min\n            {\n                int midIndex = (indexMin + indexMax) / 2;\n                if (time > ControlPoints[midIndex].Time)\n                {\n                    indexMin = midIndex;\n                }\n                else\n                {\n                    indexMax = midIndex;\n                }\n\n            }\n            return indexMin;\n        }\n\n\n        internal void InternalControlPointTimeChanged(CurveControlPoint<TValue> controlPoint)\n        {\n            int oldIndex = ControlPoints.list.IndexOf(controlPoint);\n            ControlPoints.list.RemoveAt(oldIndex);\n            int index = GetPreviousIndex(controlPoint.Time) + 1;\n            ControlPoints.list.Insert(index, controlPoint);\n            ControlPointTimeChanged(controlPoint, oldIndex, index);\n        }\n\n\n        /// <summary>\n        /// Called when a control point is added.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">New control point.</param>\n        /// <param name=\"index\">Index of the control point.</param>\n        protected internal abstract void ControlPointAdded(CurveControlPoint<TValue> curveControlPoint, int index);\n\n        /// <summary>\n        /// Called when a control point is removed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Removed control point.</param>\n        /// <param name=\"oldIndex\">Index of the control point before it was removed.</param>\n        protected internal abstract void ControlPointRemoved(CurveControlPoint<TValue> curveControlPoint, int oldIndex);\n\n        /// <summary>\n        /// Called when a control point belonging to the curve has its time changed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Changed control point.</param>\n        /// <param name=\"oldIndex\">Old index of the control point.</param>\n        /// <param name=\"newIndex\">New index of the control point.</param>\n        protected internal abstract void ControlPointTimeChanged(CurveControlPoint<TValue> curveControlPoint, int oldIndex, int newIndex);\n\n        /// <summary>\n        /// Called when a control point belonging to the curve has its value changed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Changed control point.</param>\n        protected internal abstract void ControlPointValueChanged(CurveControlPoint<TValue> curveControlPoint);\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/CurveControlPoint.cs",
    "content": "﻿using System;\nusing System.Linq;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Point defining the shape of a 3D curve.\n    /// </summary>\n    /// <typeparam name=\"TValue\">Type of values in the curve.</typeparam>\n    public class CurveControlPoint<TValue> : IComparable<CurveControlPoint<TValue>>\n    {\n        private double time;\n\n        private TValue value;\n\n        /// <summary>\n        /// Constructs a new 3D curve control point.\n        /// </summary>\n        /// <param name=\"time\">Time at which the point is positioned.</param>\n        /// <param name=\"value\">Value of the control point.</param>\n        /// <param name=\"curve\">Curve associated with the control point.</param>\n        public CurveControlPoint(double time, TValue value, Curve<TValue> curve)\n        {\n            Curve = curve;\n            Time = time;\n            Value = value;\n        }\n\n        /// <summary>\n        /// Gets the curve associated with this control point.\n        /// </summary>\n        public Curve<TValue> Curve { get; private set; }\n\n        /// <summary>\n        /// Gets or sets the time at which this control point is positioned.\n        /// </summary>\n        public double Time\n        {\n            get { return time; }\n            set\n            {\n                time = value;\n                if (Curve.ControlPoints.Contains(this))\n                {\n                    Curve.InternalControlPointTimeChanged(this);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the value of this control point.\n        /// </summary>\n        public TValue Value\n        {\n            get { return value; }\n            set\n            {\n                this.value = value;\n                if (Curve.ControlPoints.Contains(this))\n                {\n                    Curve.ControlPointValueChanged(this);\n                }\n            }\n        }\n\n        #region IComparable<CurveControlPoint<TValue>> Members\n\n        /// <summary>\n        /// Compares the two control points based on their time.\n        /// </summary>\n        /// <param name=\"other\">Control point to compare.</param>\n        /// <returns>-1 if the current instance has a smaller time, 0 if equal, and 1 if the current instance has a larger time.</returns>\n        public int CompareTo(CurveControlPoint<TValue> other)\n        {\n            if (other.Time < Time)\n                return 1;\n            if (other.Time > Time)\n                return -1;\n            return 0;\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/CurveControlPointList.cs",
    "content": "﻿using System.Collections;\nusing System.Collections.Generic;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Collection of control points in a curve.\n    /// </summary>\n    /// <typeparam name=\"TValue\">Type of values in the curve.</typeparam>\n    public class CurveControlPointList<TValue> : IEnumerable<CurveControlPoint<TValue>>\n    {\n        internal List<CurveControlPoint<TValue>> list = new List<CurveControlPoint<TValue>>();\n\n        internal CurveControlPointList(Curve<TValue> curve)\n        {\n            Curve = curve;\n        }\n\n        /// <summary>\n        /// Gets the control point at the given index.\n        /// </summary>\n        /// <param name=\"index\">Index into the list.</param>\n        /// <returns>Control point at the index.</returns>\n        public CurveControlPoint<TValue> this[int index]\n        {\n            get { return list[index]; }\n        }\n\n        /// <summary>\n        /// Gets the number of elements in the list.\n        /// </summary>\n        public int Count\n        {\n            get { return list.Count; }\n        }\n\n        /// <summary>\n        /// Gets the curve associated with this control point list.\n        /// </summary>\n        public Curve<TValue> Curve { get; private set; }\n\n        #region IEnumerable<CurveControlPoint<TValue>> Members\n\n        ///<summary>\n        /// Gets an enumerator for the list.\n        ///</summary>\n        ///<returns>Enumerator for the list.</returns>\n        public List<CurveControlPoint<TValue>>.Enumerator GetEnumerator()\n        {\n            return list.GetEnumerator();\n        }\n        IEnumerator<CurveControlPoint<TValue>> IEnumerable<CurveControlPoint<TValue>>.GetEnumerator()\n        {\n            return list.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return list.GetEnumerator();\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Adds a control point to the curve.\n        /// </summary>\n        /// <param name=\"point\">New control point to add to the curve.</param>\n        public void Add(CurveControlPoint<TValue> point)\n        {\n            int index = Curve.GetPreviousIndex(point.Time) + 1;\n            //TODO: Test for time-wise duplicate?\n            //IndexA would be the one that's possibly duplicated.\n            //Even with duplicate, this is still technically sorted.\n            list.Insert(index, point);\n            Curve.ControlPointAdded(point, index);\n        }\n\n        /// <summary>\n        /// Adds a new control point to the curve.\n        /// </summary>\n        /// <param name=\"time\">Time of the new control point.</param>\n        /// <param name=\"value\">Value of the new control point.</param>\n        /// <returns>Newly created control point.</returns>\n        public CurveControlPoint<TValue> Add(float time, TValue value)\n        {\n            var toAdd = new CurveControlPoint<TValue>(time, value, Curve);\n            Add(toAdd);\n            return toAdd;\n        }\n\n        /// <summary>\n        /// Removes the control point from the curve.\n        /// </summary>\n        /// <param name=\"controlPoint\">Control point to remove.</param>\n        public void Remove(CurveControlPoint<TValue> controlPoint)\n        {\n            RemoveAt(list.IndexOf(controlPoint));\n        }\n\n        /// <summary>\n        /// Removes the control point from the curve.\n        /// </summary>\n        /// <param name=\"index\">Index to remove at.</param>\n        public void RemoveAt(int index)\n        {\n            CurveControlPoint<TValue> removed = list[index];\n            list.RemoveAt(index);\n            Curve.ControlPointRemoved(removed, index);\n        }\n\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/CurveEndpointBehavior.cs",
    "content": "﻿namespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Defines how a curve behaves beyond an endpoint.\n    /// </summary>\n    public enum CurveEndpointBehavior\n    {\n        /// <summary>\n        /// When the time exceeds the endpoint, it wraps around to the other end of the curve.\n        /// </summary>\n        Wrap,\n        /// <summary>\n        /// Times exceeding the endpoint are clamped to the endpoint's value.\n        /// </summary>\n        Clamp,\n        /// <summary>\n        /// Times exceeding the endpoint will reverse direction and sample backwards.\n        /// </summary>\n        Mirror\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/FiniteDifferenceSpline3D.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// 3D hermite curve that uses the finite difference method to compute tangents.\n    /// </summary>\n    public class FiniteDifferenceSpline3D : HermiteCurve3D\n    {\n        /// <summary>\n        /// Gets the curve's bounding index information.\n        /// </summary>\n        /// <param name=\"minIndex\">Index of the minimum control point in the active curve segment.</param>\n        /// <param name=\"maxIndex\">Index of the maximum control point in the active curve segment.</param>\n        public override void GetCurveIndexBoundsInformation(out int minIndex, out int maxIndex)\n        {\n            if (ControlPoints.Count > 0)\n            {\n                minIndex = 0;\n                maxIndex = ControlPoints.Count - 1;\n            }\n            else\n            {\n                minIndex = -1;\n                maxIndex = -1;\n            }\n        }\n\n        protected override void ComputeTangents()\n        {\n            if (ControlPoints.Count == 1)\n            {\n                tangents.Add(Vector3.Zero);\n                return;\n            }\n            if (ControlPoints.Count == 2)\n            {\n                Vector3 tangent = ControlPoints[1].Value - ControlPoints[0].Value;\n                tangents.Add(tangent);\n                tangents.Add(tangent);\n                return;\n            }\n\n            Vector3 tangentA, tangentB;\n            Vector3 previous, current, next;\n            //First endpoint\n            current = ControlPoints[0].Value;\n            next = ControlPoints[1].Value;\n            Vector3.Subtract(ref next, ref current, out tangentA);\n            Vector3.Multiply(ref tangentA, (float)(.5 / (ControlPoints[1].Time - ControlPoints[0].Time)), out tangentA);\n            //Vector3.Multiply(ref current, .5f / (controlPoints[0].time), out tangentB);\n            //Vector3.Add(ref tangentA, ref tangentB, out tangentA);\n            tangents.Add(tangentA);\n\n            for (int i = 1; i < ControlPoints.Count - 1; i++)\n            {\n                previous = current;\n                current = next;\n                next = ControlPoints[i + 1].Value;\n                Vector3.Subtract(ref next, ref current, out tangentA);\n                Vector3.Subtract(ref current, ref previous, out tangentB);\n                Vector3.Multiply(ref tangentA, (float)(.5 / (ControlPoints[i + 1].Time - ControlPoints[i].Time)), out tangentA);\n                Vector3.Multiply(ref tangentB, (float)(.5 / (ControlPoints[i].Time - ControlPoints[i - 1].Time)), out tangentB);\n                Vector3.Add(ref tangentA, ref tangentB, out tangentA);\n                tangents.Add(tangentA);\n            }\n\n            previous = current;\n            current = next;\n            Vector3.Negate(ref current, out tangentA);\n            Vector3.Subtract(ref current, ref previous, out tangentB);\n            int currentIndex = ControlPoints.Count - 1;\n            int previousIndex = currentIndex - 1;\n            //Vector3.Multiply(ref tangentA, .5f / (-controlPoints[currentIndex].time), out tangentA);\n            Vector3.Multiply(ref tangentB, (float)(.5 / (ControlPoints[currentIndex].Time - ControlPoints[previousIndex].Time)), out tangentB);\n            //Vector3.Add(ref tangentA, ref tangentB, out tangentA);\n            tangents.Add(tangentB);\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/HermiteCurve3D.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Defines a 3D curve using hermite interpolation.\n    /// </summary>\n    public abstract class HermiteCurve3D : Curve<Vector3>\n    {\n        /// <summary>\n        /// Internal list of curve tangents.\n        /// </summary>\n        protected List<Vector3> tangents = new List<Vector3>();\n\n\n        /// <summary>\n        /// Gets the tangents used by the curve per control point.\n        /// </summary>\n        public ReadOnlyList<Vector3> Tangents\n        {\n            get\n            {\n                return new ReadOnlyList<Vector3>(tangents);\n            }\n        }\n\n        /// <summary>\n        /// Evaluates the curve section starting at the control point index using\n        /// the weight value.\n        /// </summary>\n        /// <param name=\"controlPointIndex\">Index of the starting control point of the subinterval.</param>\n        /// <param name=\"weight\">Location to evaluate on the subinterval from 0 to 1.</param>\n        /// <param name=\"value\">Value at the given location.</param>\n        public override void Evaluate(int controlPointIndex, float weight, out Vector3 value)\n        {\n            value = Vector3.Hermite(\n                ControlPoints[controlPointIndex].Value, tangents[controlPointIndex],\n                ControlPoints[controlPointIndex + 1].Value, tangents[controlPointIndex + 1], weight);\n        }\n\n        /// <summary>\n        /// Called when a control point is added.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">New control point.</param>\n        /// <param name=\"index\">Index of the control point.</param>\n        protected internal override void ControlPointAdded(CurveControlPoint<Vector3> curveControlPoint, int index)\n        {\n            tangents.Clear();\n            ComputeTangents();\n        }\n\n        /// <summary>\n        /// Called when a control point is removed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Removed control point.</param>\n        /// <param name=\"oldIndex\">Index of the control point before it was removed.</param>\n        protected internal override void ControlPointRemoved(CurveControlPoint<Vector3> curveControlPoint, int oldIndex)\n        {\n            tangents.Clear();\n            ComputeTangents();\n        }\n\n        /// <summary>\n        /// Called when a control point belonging to the curve has its time changed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Changed control point.</param>\n        /// <param name=\"oldIndex\">Old index of the control point.</param>\n        /// <param name=\"newIndex\">New index of the control point.</param>\n        protected internal override void ControlPointTimeChanged(CurveControlPoint<Vector3> curveControlPoint, int oldIndex, int newIndex)\n        {\n            tangents.Clear();\n            ComputeTangents();\n        }\n\n        /// <summary>\n        /// Called when a control point belonging to the curve has its value changed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Changed control point.</param>\n        protected internal override void ControlPointValueChanged(CurveControlPoint<Vector3> curveControlPoint)\n        {\n            tangents.Clear();\n            ComputeTangents();\n        }\n\n        /// <summary>\n        /// Computes the tangent entries in the curve according to some type of hermite curve.\n        /// </summary>\n        protected abstract void ComputeTangents();\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/LinearInterpolationCurve3D.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Defines a 3D curve using linear interpolation.\n    /// </summary>\n    public class LinearInterpolationCurve3D : Curve<Vector3>\n    {\n        /// <summary>\n        /// Evaluates the curve section starting at the control point index using\n        /// the weight value.\n        /// </summary>\n        /// <param name=\"controlPointIndex\">Index of the starting control point of the subinterval.</param>\n        /// <param name=\"weight\">Location to evaluate on the subinterval from 0 to 1.</param>\n        /// <param name=\"value\">Value at the given location.</param>\n        public override void Evaluate(int controlPointIndex, float weight, out Vector3 value)\n        {\n            value = Vector3.Lerp(ControlPoints[controlPointIndex].Value, ControlPoints[controlPointIndex + 1].Value, weight);\n        }\n\n        /// <summary>\n        /// Gets the curve's bounding index information.\n        /// </summary>\n        /// <param name=\"minIndex\">Index of the minimum control point in the active curve segment.</param>\n        /// <param name=\"maxIndex\">Index of the maximum control point in the active curve segment.</param>\n        public override void GetCurveIndexBoundsInformation(out int minIndex, out int maxIndex)\n        {\n            maxIndex = ControlPoints.Count - 1;\n            if (maxIndex < 0)\n                minIndex = -1;\n            else\n                minIndex = 0;\n        }\n\n        /// <summary>\n        /// Called when a control point is added.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">New control point.</param>\n        /// <param name=\"index\">Index of the control point.</param>\n        protected internal override void ControlPointAdded(CurveControlPoint<Vector3> curveControlPoint, int index)\n        {\n        }\n\n        /// <summary>\n        /// Called when a control point is removed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Removed control point.</param>\n        /// <param name=\"oldIndex\">Index of the control point before it was removed.</param>\n        protected internal override void ControlPointRemoved(CurveControlPoint<Vector3> curveControlPoint, int oldIndex)\n        {\n        }\n\n        /// <summary>\n        /// Called when a control point belonging to the curve has its time changed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Changed control point.</param>\n        /// <param name=\"oldIndex\">Old index of the control point.</param>\n        /// <param name=\"newIndex\">New index of the control point.</param>\n        protected internal override void ControlPointTimeChanged(CurveControlPoint<Vector3> curveControlPoint, int oldIndex, int newIndex)\n        {\n        }\n\n        /// <summary>\n        /// Called when a control point belonging to the curve has its value changed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Changed control point.</param>\n        protected internal override void ControlPointValueChanged(CurveControlPoint<Vector3> curveControlPoint)\n        {\n        }\n\n\n        ///// <summary>\n        ///// Evaluates the curve at a certain time.\n        ///// </summary>\n        ///// <param name=\"time\">Time to evaluate.</param>\n        ///// <param name=\"value\">Value at evaluated time.</param>\n        //public override void evaluate(double time, out Vector3 value)\n        //{\n        //    int maxIndex = controlPoints.count - 1;\n        //    if (maxIndex == -1)\n        //    {\n        //        value = Vector3.Zero;\n        //        return;\n        //    }\n        //    time = modifyTime(time, controlPoints[0].time, controlPoints[maxIndex].time);\n\n        //    int index = getPreviousIndex(time);\n        //    int nextIndex = Math.Min(index + 1, maxIndex); \n        //    float denominator = controlPoints[nextIndex].time - controlPoints[index].time;\n        //    float intervalTime;\n        //    if (denominator < Toolbox.epsilon)\n        //        intervalTime = 0;\n        //    else\n        //        intervalTime = (float)(time - controlPoints[index].time) / denominator;\n\n\n        //    value = Vector3.Lerp(controlPoints[index].value, controlPoints[nextIndex].value, intervalTime); \n\n        //}\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/Path following/EntityMover.cs",
    "content": "﻿using System;\nusing BEPUphysics.Constraints.SingleEntity;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Entities;\nusing BEPUphysics.UpdateableSystems;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Paths.PathFollowing\n{\n    /// <summary>\n    /// Pushes an entity around according to goal positions and orientations.\n    /// </summary>\n    public class EntityMover : Updateable, IDuringForcesUpdateable\n    {\n        private Entity entity;\n\n\n        /// <summary>\n        /// Constructs a new EntityMover.\n        /// </summary>\n        /// <param name=\"e\">Entity to move.</param>\n        public EntityMover(Entity e)\n        {\n            IsUpdatedSequentially = false;\n            LinearMotor = new SingleEntityLinearMotor(e, e.Position);\n            Entity = e;\n\n            LinearMotor.Settings.Mode = MotorMode.Servomechanism;\n            TargetPosition = e.Position;\n        }\n\n        /// <summary>\n        /// Constructs a new EntityMover.\n        /// </summary>\n        /// <param name=\"e\">Entity to move.</param>\n        /// <param name=\"linearMotor\">Motor to use for linear motion if the entity is dynamic.</param>\n        public EntityMover(Entity e, SingleEntityLinearMotor linearMotor)\n        {\n            IsUpdatedSequentially = false;\n            LinearMotor = linearMotor;\n            Entity = e;\n\n            linearMotor.Entity = Entity;\n            linearMotor.Settings.Mode = MotorMode.Servomechanism;\n            TargetPosition = e.Position;\n        }\n\n\n        /// <summary>\n        /// Gets or sets the entity being pushed by the entity mover.\n        /// </summary>\n        public Entity Entity\n        {\n            get { return entity; }\n            set\n            {\n                entity = value;\n                LinearMotor.Entity = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the linear motor used by the entity mover.\n        /// When the affected entity is dynamic, it is pushed by motors.\n        /// This ensures that its interactions and collisions with\n        /// other entities remain stable.\n        /// </summary>\n        public SingleEntityLinearMotor LinearMotor { get; private set; }\n\n        /// <summary>\n        /// Gets or sets the point in the entity's local space that will be moved towards the target position.\n        /// </summary>\n        public Vector3 LocalOffset\n        {\n            get { return LinearMotor.LocalPoint; }\n            set { LinearMotor.LocalPoint = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the point attached to the entity in world space that will be moved towards the target position.\n        /// </summary>\n        public Vector3 Offset\n        {\n            get { return LinearMotor.Point; }\n            set { LinearMotor.Point = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the target location of the entity mover.\n        /// </summary>\n        public Vector3 TargetPosition { get; set; }\n\n        /// <summary>\n        /// Gets the angular velocity necessary to change an entity's orientation from\n        /// the starting quaternion to the ending quaternion over time dt.\n        /// </summary>\n        /// <param name=\"start\">Initial position.</param>\n        /// <param name=\"end\">Final position.</param>\n        /// <param name=\"dt\">Time over which the angular velocity is to be applied.</param>\n        /// <returns>Angular velocity to reach the goal in time.</returns>\n        public static Vector3 GetLinearVelocity(Vector3 start, Vector3 end, float dt)\n        {\n            Vector3 offset;\n            Vector3.Subtract(ref end, ref start, out offset);\n            Vector3.Divide(ref offset, dt, out offset);\n            return offset;\n        }\n\n        /// <summary>\n        /// Adds the motors to the space.  Called automatically.\n        /// </summary>\n        public override void OnAdditionToSpace(ISpace newSpace)\n        {\n            newSpace.Add(LinearMotor);\n        }\n\n        /// <summary>\n        /// Removes the motors from the space.  Called automatically.\n        /// </summary>\n        public override void OnRemovalFromSpace(ISpace oldSpace)\n        {\n            oldSpace.Remove(LinearMotor);\n        }\n\n        /// <summary>\n        /// Called automatically by the space.\n        /// </summary>\n        /// <param name=\"dt\">Simulation timestep.</param>\n        void IDuringForcesUpdateable.Update(float dt)\n        {\n            if (Entity != LinearMotor.Entity)\n                throw new InvalidOperationException(\n                    \"EntityMover's entity differs from EntityMover's motors' entities.  Ensure that the moved entity is only changed by setting the EntityMover's entity property.\");\n\n            if (Entity.IsDynamic)\n            {\n                LinearMotor.IsActive = true;\n                LinearMotor.Settings.Servo.Goal = TargetPosition;\n            }\n            else\n            {\n                LinearMotor.IsActive = false;\n                Vector3 worldMovedPoint = Vector3.Transform(LocalOffset, entity.WorldTransform);\n                Entity.LinearVelocity = GetLinearVelocity(worldMovedPoint, TargetPosition, dt);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/Path following/EntityRotator.cs",
    "content": "﻿using System;\nusing BEPUphysics.Constraints.SingleEntity;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Entities;\nusing BEPUphysics.UpdateableSystems;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Paths.PathFollowing\n{\n    /// <summary>\n    /// Pushes an entity around according to goal positions and orientations.\n    /// </summary>\n    public class EntityRotator : Updateable, IDuringForcesUpdateable\n    {\n        private Entity entity;\n\n        /// <summary>\n        /// Constructs a new EntityRotator.\n        /// </summary>\n        /// <param name=\"e\">Entity to move.</param>\n        public EntityRotator(Entity e)\n        {\n            IsUpdatedSequentially = false;\n            AngularMotor = new SingleEntityAngularMotor(e);\n            Entity = e;\n\n            AngularMotor.Settings.Mode = MotorMode.Servomechanism;\n            TargetOrientation = e.Orientation;\n        }\n\n        /// <summary>\n        /// Constructs a new EntityRotator.\n        /// </summary>\n        /// <param name=\"e\">Entity to move.</param>\n        /// <param name=\"angularMotor\">Motor to use for angular motion if the entity is dynamic.</param>\n        public EntityRotator(Entity e, SingleEntityAngularMotor angularMotor)\n        {\n            IsUpdatedSequentially = false;\n            AngularMotor = angularMotor;\n            Entity = e;\n\n            angularMotor.Entity = Entity;\n            angularMotor.Settings.Mode = MotorMode.Servomechanism;\n            TargetOrientation = e.Orientation;\n        }\n\n\n        /// <summary>\n        /// Gets the angular motor used by the entity rotator.\n        /// When the affected entity is dynamic, it is pushed by motors.\n        /// This ensures that its interactions and collisions with\n        /// other entities remain stable.\n        /// </summary>\n        public SingleEntityAngularMotor AngularMotor { get; private set; }\n\n        /// <summary>\n        /// Gets or sets the entity being pushed by the entity rotator.\n        /// </summary>\n        public Entity Entity\n        {\n            get { return entity; }\n            set\n            {\n                entity = value;\n                AngularMotor.Entity = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the target orientation of the entity rotator.\n        /// </summary>\n        public Quaternion TargetOrientation { get; set; }\n\n        /// <summary>\n        /// Gets the angular velocity necessary to change an entity's orientation from\n        /// the starting quaternion to the ending quaternion over time dt.\n        /// </summary>\n        /// <param name=\"start\">Initial orientation.</param>\n        /// <param name=\"end\">Final orientation.</param>\n        /// <param name=\"dt\">Time over which the angular velocity is to be applied.</param>\n        /// <returns>Angular velocity to reach the goal in time.</returns>\n        public static Vector3 GetAngularVelocity(Quaternion start, Quaternion end, float dt)\n        {\n            //Compute the relative orientation R' between R and the target relative orientation.\n            Quaternion errorOrientation;\n            Quaternion.Conjugate(ref start, out errorOrientation);\n            Quaternion.Multiply(ref end, ref errorOrientation, out errorOrientation);\n\n            Vector3 axis;\n            float angle;\n            //Turn this into an axis-angle representation.\n            Toolbox.GetAxisAngleFromQuaternion(ref errorOrientation, out axis, out angle);\n            Vector3.Multiply(ref axis, angle / dt, out axis);\n            return axis;\n        }\n\n        /// <summary>\n        /// Adds the motors to the solver.  Called automatically.\n        /// </summary>\n        public override void OnAdditionToSpace(ISpace newSpace)\n        {\n            newSpace.Add(AngularMotor);\n        }\n\n        /// <summary>\n        /// Removes the motors from the solver.  Called automatically.\n        /// </summary>\n        public override void OnRemovalFromSpace(ISpace oldSpace)\n        {\n            oldSpace.Remove(AngularMotor);\n        }\n\n        /// <summary>\n        /// Called automatically by the space.\n        /// </summary>\n        /// <param name=\"dt\">Simulation timestep.</param>\n        void IDuringForcesUpdateable.Update(float dt)\n        {\n            if (Entity != AngularMotor.Entity)\n                throw new InvalidOperationException(\n                    \"EntityRotator's entity differs from EntityRotator's motor's entities.  Ensure that the moved entity is only changed by setting the EntityRotator's entity property.\");\n\n            if (Entity.IsDynamic)\n            {\n                AngularMotor.IsActive = true;\n                AngularMotor.Settings.Servo.Goal = TargetOrientation;\n            }\n            else\n            {\n                AngularMotor.IsActive = false;\n                Entity.AngularVelocity = GetAngularVelocity(Entity.Orientation, TargetOrientation, dt);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/Path.cs",
    "content": "﻿namespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Superclass of a variety of classes that can be evaluated at a time to retrieve a value associated with that time.\n    /// </summary>\n    /// <typeparam name=\"TValue\">Type of the value of the path.</typeparam>\n    public abstract class Path<TValue>\n    {\n        /// <summary>\n        /// Computes the value of the path at a given time.\n        /// </summary>\n        /// <param name=\"time\">Time at which to evaluate the path.</param>\n        /// <param name=\"value\">Path value at the given time.</param>\n        public abstract void Evaluate(double time, out TValue value);\n\n        /// <summary>\n        /// Gets the starting and ending times of the path.\n        /// </summary>\n        /// <param name=\"startingTime\">Beginning time of the path.</param>\n        /// <param name=\"endingTime\">Ending time of the path.</param>\n        public abstract void GetPathBoundsInformation(out double startingTime, out double endingTime);\n\n        /// <summary>\n        /// Computes the value of the path at a given time.\n        /// </summary>\n        /// <param name=\"time\">Time at which to evaluate the path.</param>\n        /// <returns>Path value at the given time.</returns>\n        public TValue Evaluate(double time)\n        {\n            TValue toReturn;\n            Evaluate(time, out toReturn);\n            return toReturn;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/QuaternionSlerpCurve.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Defines a quaternion curve using spherical linear interpolation.\n    /// </summary>\n    public class QuaternionSlerpCurve : Curve<Quaternion>\n    {\n        /// <summary>\n        /// Evaluates the curve section starting at the control point index using\n        /// the weight value.\n        /// </summary>\n        /// <param name=\"controlPointIndex\">Index of the starting control point of the subinterval.</param>\n        /// <param name=\"weight\">Location to evaluate on the subinterval from 0 to 1.</param>\n        /// <param name=\"value\">Value at the given location.</param>\n        public override void Evaluate(int controlPointIndex, float weight, out Quaternion value)\n        {\n            value = Quaternion.Slerp(ControlPoints[controlPointIndex].Value, ControlPoints[controlPointIndex + 1].Value, weight);\n        }\n\n        /// <summary>\n        /// Gets the curve's bounding index information.\n        /// </summary>\n        /// <param name=\"minIndex\">Index of the minimum control point in the active curve segment.</param>\n        /// <param name=\"maxIndex\">Index of the maximum control point in the active curve segment.</param>\n        public override void GetCurveIndexBoundsInformation(out int minIndex, out int maxIndex)\n        {\n            maxIndex = ControlPoints.Count - 1;\n            if (maxIndex < 0)\n                minIndex = -1;\n            else\n                minIndex = 0;\n        }\n\n        /// <summary>\n        /// Called when a control point is added.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">New control point.</param>\n        /// <param name=\"index\">Index of the control point.</param>\n        protected internal override void ControlPointAdded(CurveControlPoint<Quaternion> curveControlPoint, int index)\n        {\n        }\n\n        /// <summary>\n        /// Called when a control point is removed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Removed control point.</param>\n        /// <param name=\"oldIndex\">Index of the control point before it was removed.</param>\n        protected internal override void ControlPointRemoved(CurveControlPoint<Quaternion> curveControlPoint, int oldIndex)\n        {\n        }\n\n        /// <summary>\n        /// Called when a control point belonging to the curve has its time changed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Changed control point.</param>\n        /// <param name=\"oldIndex\">Old index of the control point.</param>\n        /// <param name=\"newIndex\">New index of the control point.</param>\n        protected internal override void ControlPointTimeChanged(CurveControlPoint<Quaternion> curveControlPoint, int oldIndex, int newIndex)\n        {\n        }\n\n        /// <summary>\n        /// Called when a control point belonging to the curve has its value changed.\n        /// </summary>\n        /// <param name=\"curveControlPoint\">Changed control point.</param>\n        protected internal override void ControlPointValueChanged(CurveControlPoint<Quaternion> curveControlPoint)\n        {\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/SpeedControlledCurve.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Paths\n{\n    internal struct SpeedControlledCurveSample\n    {\n        public double Wrapped;\n        public double SpeedControlled;\n    }\n\n    /// <summary>\n    /// Wrapper that controls the speed at which a curve is traversed.\n    /// </summary>\n    /// <remarks>\n    /// <para>\n    /// Even if a curve is evaluated at linearly increasing positions,\n    /// the distance between consecutive values can be different.  This\n    /// has the effect of a curve-following object having variable velocity.\n    /// </para>\n    /// <para>\n    /// To counteract the variable velocity, this wrapper samples the curve\n    /// and produces a reparameterized, distance-based curve.  Changing the\n    /// evaluated curve position will linearly change the value.\n    /// </para>\n    /// </remarks>\n    public abstract class SpeedControlledCurve<TValue> : Path<TValue>\n    {\n        private readonly List<SpeedControlledCurveSample> samples = new List<SpeedControlledCurveSample>(); //  X is wrapped view, Y is associated curve view\n\n        private Curve<TValue> curve;\n        private int samplesPerInterval;\n\n\n        /// <summary>\n        /// Constructs a new speed controlled curve.\n        /// </summary>\n        protected SpeedControlledCurve()\n        {\n        }\n\n        /// <summary>\n        /// Constructs a new speed-controlled curve.\n        /// </summary>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        protected SpeedControlledCurve(Curve<TValue> curve)\n        {\n            samplesPerInterval = 10;\n            this.curve = curve;\n        }\n\n        /// <summary>\n        /// Constructs a new speed-controlled curve.\n        /// </summary>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        /// <param name=\"samplesPerInterval\">Number of samples to use when constructing the wrapper curve.\n        /// More samples increases the accuracy of the speed requirement at the cost of performance.</param>\n        protected SpeedControlledCurve(Curve<TValue> curve, int samplesPerInterval)\n        {\n            this.curve = curve;\n            this.samplesPerInterval = samplesPerInterval;\n        }\n\n        /// <summary>\n        /// Gets or sets the curve wrapped by this instance.\n        /// </summary>\n        public Curve<TValue> Curve\n        {\n            get { return curve; }\n            set\n            {\n                curve = value;\n                if (Curve != null)\n                    ResampleCurve();\n            }\n        }\n\n        /// <summary>\n        /// Defines how the curve is sampled when the evaluation time exceeds the final control point.\n        /// </summary>\n        public CurveEndpointBehavior PostLoop { get; set; }\n\n        /// <summary>\n        /// Defines how the curve is sampled when the evaluation time exceeds the beginning control point.\n        /// </summary>\n        public CurveEndpointBehavior PreLoop { get; set; }\n\n        /// <summary>\n        /// Gets or sets the number of samples to use per interval in the curve.\n        /// </summary>\n        public int SamplesPerInterval\n        {\n            get { return samplesPerInterval; }\n            set\n            {\n                samplesPerInterval = value;\n                if (Curve != null)\n                    ResampleCurve();\n            }\n        }\n\n        /// <summary>\n        /// Gets the desired speed at a given time.\n        /// </summary>\n        /// <param name=\"time\">Time to check for speed.</param>\n        /// <returns>Speed at the given time.</returns>\n        public abstract float GetSpeedAtCurveTime(double time);\n\n        /// <summary>\n        /// Gets the time at which the internal curve would be evaluated at the given time.\n        /// </summary>\n        /// <param name=\"time\">Time to evaluate the speed-controlled curve.</param>\n        /// <returns>Time at which the internal curve would be evaluated.</returns>\n        public double GetInnerTime(double time)\n        {\n            if (Curve == null)\n                throw new InvalidOperationException(\"SpeedControlledCurve's internal curve is null; ensure that its curve property is set prior to evaluation.\");\n            double firstTime, lastTime;\n            GetPathBoundsInformation(out firstTime, out lastTime);\n            time = Curve<TValue>.ModifyTime(time, firstTime, lastTime, Curve.PreLoop, Curve.PostLoop);\n\n            int indexMin = 0;\n            int indexMax = samples.Count;\n            if (indexMax == 1)\n            {\n                //1-length curve; asking the system to evaluate\n                //this will be a waste of time AND\n                //crash since +1 will be outside scope\n                return samples[0].SpeedControlled;\n            }\n\n            if (indexMax == 0)\n            {\n                return 0;\n            }\n            //If time < controlpoints.mintime, should be... 0 or -1?\n            while (indexMax - indexMin > 1) //if time belongs to min\n            {\n                int midIndex = (indexMin + indexMax) / 2;\n                if (time > samples[midIndex].Wrapped)\n                {\n                    indexMin = midIndex;\n                }\n                else\n                {\n                    indexMax = midIndex;\n                }\n            }\n\n\n            double curveTime = (time - samples[indexMin].Wrapped) / (samples[indexMin + 1].Wrapped - samples[indexMin].Wrapped);\n            return (1 - curveTime) * samples[indexMin].SpeedControlled + (curveTime) * samples[indexMin + 1].SpeedControlled;\n        }\n\n        /// <summary>\n        /// Computes the value of the curve at a given time.\n        /// </summary>\n        /// <param name=\"time\">Time to evaluate the curve at.</param>\n        /// <param name=\"value\">Value of the curve at the given time.</param>\n        /// <param name=\"innerTime\">Time at which the internal curve was evaluated to get the value.</param>\n        public void Evaluate(double time, out TValue value, out double innerTime)\n        {\n            Curve.Evaluate(innerTime = GetInnerTime(time), out value);\n        }\n\n        /// <summary>\n        /// Computes the value of the curve at a given time.\n        /// </summary>\n        /// <param name=\"time\">Time to evaluate the curve at.</param>\n        /// <param name=\"value\">Value of the curve at the given time.</param>\n        public override void Evaluate(double time, out TValue value)\n        {\n            Curve.Evaluate(GetInnerTime(time), out value);\n        }\n\n        /// <summary>\n        /// Gets the starting and ending times of the path.\n        /// </summary>\n        /// <param name=\"startingTime\">Beginning time of the path.</param>\n        /// <param name=\"endingTime\">Ending time of the path.</param>\n        public override void GetPathBoundsInformation(out double startingTime, out double endingTime)\n        {\n            if (samples.Count > 0)\n            {\n                startingTime = 0;\n                endingTime = samples[samples.Count - 1].Wrapped;\n            }\n            else\n            {\n                startingTime = 0;\n                endingTime = 0;\n            }\n        }\n\n        /// <summary>\n        /// Forces a recalculation of curve samples.\n        /// This needs to be called if the wrapped curve\n        /// is changed.\n        /// </summary>\n        public void ResampleCurve()\n        {\n            //TODO: Call this from curve if add/remove/timechange/valuechange happens\n            //Could hide it then.\n            samples.Clear();\n            double firstTime, lastTime;\n            int minIndex, maxIndex;\n            curve.GetCurveBoundsInformation(out firstTime, out lastTime, out minIndex, out maxIndex);\n\n            //Curve isn't valid.\n            if (minIndex < 0 || maxIndex < 0)\n                return;\n\n            float timeElapsed = 0;\n            //TODO: useless calculation due to this\n            TValue currentValue = Curve.ControlPoints[minIndex].Value;\n            TValue previousValue = currentValue;\n\n            float inverseSampleCount = 1f / (SamplesPerInterval + 1);\n\n            float speed = GetSpeedAtCurveTime(Curve.ControlPoints[minIndex].Time);\n            float previousSpeed = speed;\n            for (int i = minIndex; i < maxIndex; i++)\n            {\n                previousValue = currentValue;\n                currentValue = Curve.ControlPoints[i].Value;\n\n                if (speed != 0)\n                    timeElapsed += GetDistance(previousValue, currentValue) / speed;\n                previousSpeed = speed;\n                speed = GetSpeedAtCurveTime(Curve.ControlPoints[i].Time);\n\n                samples.Add(new SpeedControlledCurveSample { Wrapped = timeElapsed, SpeedControlled = Curve.ControlPoints[i].Time });\n\n                var curveTime = Curve.ControlPoints[i].Time;\n                var intervalLength = Curve.ControlPoints[i + 1].Time - curveTime;\n                var curveTimePerSample = intervalLength / (SamplesPerInterval + 1);\n                for (int j = 1; j <= SamplesPerInterval; j++)\n                {\n                    previousValue = currentValue;\n                    Curve.Evaluate(i, j * inverseSampleCount, out currentValue);\n\n                    curveTime += curveTimePerSample;\n                    if (speed != 0)\n                        timeElapsed += GetDistance(previousValue, currentValue) / speed;\n\n                    previousSpeed = speed;\n                    speed = GetSpeedAtCurveTime(curveTime);\n\n                    samples.Add(new SpeedControlledCurveSample { Wrapped = timeElapsed, SpeedControlled = curveTime });\n                }\n            }\n            timeElapsed += GetDistance(previousValue, currentValue) / previousSpeed;\n            samples.Add(new SpeedControlledCurveSample { Wrapped = timeElapsed, SpeedControlled = Curve.ControlPoints[maxIndex].Time });\n        }\n\n        /// <summary>\n        /// Computes the distance between the two values.\n        /// </summary>\n        /// <param name=\"start\">Starting value.</param>\n        /// <param name=\"end\">Ending value.</param>\n        /// <returns>Distance between the values.</returns>\n        protected abstract float GetDistance(TValue start, TValue end);\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/StepCurve1D.cs",
    "content": "﻿namespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// One dimensional-valued curve that does not interpolate values.\n    /// Instead, it just picks the value from the previous control point.\n    /// </summary>\n    public class StepCurve1D : Curve<float>\n    {\n        /// <summary>\n        /// Evaluates the curve at a given time using linear interpolation.\n        /// </summary>\n        /// <param name=\"controlPointIndex\">Index of the control point at the beginning of the evaluation interval.</param>\n        /// <param name=\"weight\">Value of 0 to 1 representing how far along the interval to sample.</param>\n        /// <param name=\"value\">Value of the curve at the given location.</param>\n        public override void Evaluate(int controlPointIndex, float weight, out float value)\n        {\n            value = ControlPoints[controlPointIndex].Value;\n        }\n\n        /// <summary>\n        /// Computes the bounds of the curve.\n        /// </summary>\n        /// <param name=\"minIndex\">Minimum index of the curve.</param>\n        /// <param name=\"maxIndex\">Maximum index of the curve.</param>\n        public override void GetCurveIndexBoundsInformation(out int minIndex, out int maxIndex)\n        {\n            maxIndex = ControlPoints.Count - 1;\n            if (maxIndex < 0)\n                minIndex = -1;\n            else\n                minIndex = 0;\n        }\n\n        protected internal override void ControlPointAdded(CurveControlPoint<float> curveControlPoint, int index)\n        {\n        }\n\n        protected internal override void ControlPointRemoved(CurveControlPoint<float> curveControlPoint, int oldIndex)\n        {\n        }\n\n        protected internal override void ControlPointTimeChanged(CurveControlPoint<float> curveControlPoint, int oldIndex, int newIndex)\n        {\n        }\n\n        protected internal override void ControlPointValueChanged(CurveControlPoint<float> curveControlPoint)\n        {\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/VariableAngularSpeedCurve.cs",
    "content": "﻿using BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Wraps a curve that is traveled along with arbitrary defined angular speed.\n    /// </summary>\n    /// <remarks>\n    /// The speed curve should be designed with the wrapped curve's times in mind.\n    /// Speeds will be sampled based on the wrapped curve's interval.</remarks>\n    public class VariableAngularSpeedCurve : VariableSpeedCurve<Quaternion>\n    {\n        /// <summary>\n        /// Constructs a new variable speed curve.\n        /// </summary>\n        /// <param name=\"speedCurve\">Curve defining speeds to use.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        public VariableAngularSpeedCurve(Path<float> speedCurve, Curve<Quaternion> curve)\n            : base(speedCurve, curve)\n        {\n        }\n\n        /// <summary>\n        /// Constructs a new variable speed curve.\n        /// </summary>\n        /// <param name=\"speedCurve\">Curve defining speeds to use.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        /// <param name=\"sampleCount\">Number of samples to use when constructing the wrapper curve.\n        /// More samples increases the accuracy of the speed requirement at the cost of performance.</param>\n        public VariableAngularSpeedCurve(Path<float> speedCurve, Curve<Quaternion> curve, int sampleCount)\n            : base(speedCurve, curve, sampleCount)\n        {\n        }\n\n        protected override float GetDistance(Quaternion start, Quaternion end)\n        {\n            Quaternion.Conjugate(ref end, out end);\n            Quaternion.Multiply(ref end, ref start, out end);\n            return Toolbox.GetAngleFromQuaternion(ref end);\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/VariableLinearSpeedCurve.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Wraps a curve that is traveled along with arbitrary defined linear speed.\n    /// </summary>\n    /// <remarks>\n    /// The speed curve should be designed with the wrapped curve's times in mind.\n    /// Speeds will be sampled based on the wrapped curve's interval.</remarks>\n    public class VariableLinearSpeedCurve : VariableSpeedCurve<Vector3>\n    {\n        /// <summary>\n        /// Constructs a new variable speed curve.\n        /// </summary>\n        /// <param name=\"speedCurve\">Curve defining speeds to use.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        public VariableLinearSpeedCurve(Path<float> speedCurve, Curve<Vector3> curve)\n            : base(speedCurve, curve)\n        {\n        }\n\n        /// <summary>\n        /// Constructs a new variable speed curve.\n        /// </summary>\n        /// <param name=\"speedCurve\">Curve defining speeds to use.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        /// <param name=\"sampleCount\">Number of samples to use when constructing the wrapper curve.\n        /// More samples increases the accuracy of the speed requirement at the cost of performance.</param>\n        public VariableLinearSpeedCurve(Path<float> speedCurve, Curve<Vector3> curve, int sampleCount)\n            : base(speedCurve, curve, sampleCount)\n        {\n        }\n\n        protected override float GetDistance(Vector3 start, Vector3 end)\n        {\n            float distance;\n            Vector3.Distance(ref start, ref end, out distance);\n            return distance;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Paths/VariableSpeedCurve.cs",
    "content": "﻿namespace BEPUphysics.Paths\n{\n    /// <summary>\n    /// Curve that wraps another curve and travels along it with specified speeds.\n    /// </summary>\n    /// <typeparam name=\"TValue\">Type of the value of the wrapped curve.</typeparam>\n    public abstract class VariableSpeedCurve<TValue> : SpeedControlledCurve<TValue>\n    {\n        /// <summary>\n        /// Constructs a new constant speed curve.\n        /// </summary>\n        /// <param name=\"speedCurve\">Curve defining speeds to use.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        protected VariableSpeedCurve(Path<float> speedCurve, Curve<TValue> curve)\n            : base(curve)\n        {\n            SpeedCurve = speedCurve;\n            ResampleCurve();\n        }\n\n        /// <summary>\n        /// Constructs a new constant speed curve.\n        /// </summary>\n        /// <param name=\"speedCurve\">Curve defining speeds to use.</param>\n        /// <param name=\"curve\">Curve to wrap.</param>\n        /// <param name=\"sampleCount\">Number of samples to use when constructing the wrapper curve.\n        /// More samples increases the accuracy of the speed requirement at the cost of performance.</param>\n        protected VariableSpeedCurve(Path<float> speedCurve, Curve<TValue> curve, int sampleCount)\n            : base(curve, sampleCount)\n        {\n            SpeedCurve = speedCurve;\n            ResampleCurve();\n        }\n\n        /// <summary>\n        /// Gets or sets the path that defines the speeds at given locations.\n        /// The speed curve will be sampled at times associated with the wrapped curve.\n        /// </summary>\n        public Path<float> SpeedCurve { get; set; }\n\n        /// <summary>\n        /// Gets the speed at a given time on the wrapped curve.\n        /// </summary>\n        /// <param name=\"time\">Time to evaluate.</param>\n        /// <returns>Speed at the given time.</returns>\n        public override float GetSpeedAtCurveTime(double time)\n        {\n            return SpeedCurve.Evaluate(time);\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/PhysicsChecker.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing BEPUphysics.CollisionTests;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics\n{\n    /// <summary>\n    /// Contains conditional extensions to check for bad values in various structures.\n    /// </summary>\n    public static class PhysicsChecker\n    {\n\n        /// <summary>\n        /// Checks the contact to see if it contains NaNs or infinities.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this Contact contact)\n        {\n            contact.Normal.Validate();\n            if (contact.Normal.LengthSquared() < 0.9f)\n                throw new ArithmeticException(\"Invalid contact normal.\");\n            contact.Position.Validate();\n            contact.PenetrationDepth.Validate();\n        }\n\n\n        /// <summary>\n        /// Checks the contact to see if it contains NaNs or infinities.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this ContactData contact)\n        {\n            contact.Normal.Validate();\n            contact.Position.Validate();\n            contact.PenetrationDepth.Validate();\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/PhysicsResources.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests.Manifolds;\nusing BEPUphysics.Entities;\n \nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUphysics.DeactivationManagement;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics\n{\n    /// <summary>\n    /// Handles allocation and management of commonly used resources.\n    /// </summary>\n    public static class PhysicsResources\n    {\n        static PhysicsResources()\n        {\n            ResetPools();\n        }\n\n        public static void ResetPools()\n        {\n\n            SubPoolRayCastResultList = new LockingResourcePool<RawList<RayCastResult>>();\n            SubPoolBroadPhaseEntryList = new LockingResourcePool<RawList<BroadPhaseEntry>>();\n            SubPoolCollidableList = new LockingResourcePool<RawList<Collidable>>();\n            SubPoolCompoundChildList = new LockingResourcePool<RawList<CompoundChild>>();\n\n            SubPoolEntityRawList = new LockingResourcePool<RawList<Entity>>(16);\n            SubPoolTriangleShape = new LockingResourcePool<TriangleShape>();\n            SubPoolTriangleCollidables = new LockingResourcePool<TriangleCollidable>();\n            SubPoolTriangleIndicesList = new LockingResourcePool<RawList<TriangleMeshConvexContactManifold.TriangleIndices>>();\n            SimulationIslandConnections = new LockingResourcePool<SimulationIslandConnection>();\n        }\n\n        static ResourcePool<RawList<RayCastResult>> SubPoolRayCastResultList;\n        static ResourcePool<RawList<BroadPhaseEntry>> SubPoolBroadPhaseEntryList;\n        static ResourcePool<RawList<Collidable>> SubPoolCollidableList;\n        static ResourcePool<RawList<Entity>> SubPoolEntityRawList;\n        static ResourcePool<TriangleShape> SubPoolTriangleShape;\n        static ResourcePool<RawList<CompoundChild>> SubPoolCompoundChildList;\n        static ResourcePool<TriangleCollidable> SubPoolTriangleCollidables;\n        static ResourcePool<RawList<TriangleMeshConvexContactManifold.TriangleIndices>> SubPoolTriangleIndicesList;\n        static ResourcePool<SimulationIslandConnection> SimulationIslandConnections;\n        //#endif\n        /// <summary>\n        /// Retrieves a ray cast result list from the resource pool.\n        /// </summary>\n        /// <returns>Empty ray cast result list.</returns>\n        public static RawList<RayCastResult> GetRayCastResultList()\n        {\n            return SubPoolRayCastResultList.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"list\">List to return.</param>\n        public static void GiveBack(RawList<RayCastResult> list)\n        {\n            list.Clear();\n            SubPoolRayCastResultList.GiveBack(list);\n        }\n\n        /// <summary>\n        /// Retrieves an BroadPhaseEntry list from the resource pool.\n        /// </summary>\n        /// <returns>Empty BroadPhaseEntry list.</returns>\n        public static RawList<BroadPhaseEntry> GetBroadPhaseEntryList()\n        {\n            return SubPoolBroadPhaseEntryList.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"list\">List to return.</param>\n        public static void GiveBack(RawList<BroadPhaseEntry> list)\n        {\n            list.Clear();\n            SubPoolBroadPhaseEntryList.GiveBack(list);\n        }\n\n        /// <summary>\n        /// Retrieves a Collidable list from the resource pool.\n        /// </summary>\n        /// <returns>Empty Collidable list.</returns>\n        public static RawList<Collidable> GetCollidableList()\n        {\n            return SubPoolCollidableList.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"list\">List to return.</param>\n        public static void GiveBack(RawList<Collidable> list)\n        {\n            list.Clear();\n            SubPoolCollidableList.GiveBack(list);\n        }\n\n        /// <summary>\n        /// Retrieves an CompoundChild list from the resource pool.\n        /// </summary>\n        /// <returns>Empty information list.</returns>\n        public static RawList<CompoundChild> GetCompoundChildList()\n        {\n            return SubPoolCompoundChildList.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"list\">List to return.</param>\n        public static void GiveBack(RawList<CompoundChild> list)\n        {\n            list.Clear();\n            SubPoolCompoundChildList.GiveBack(list);\n        }\n\n      \n\n        /// <summary>\n        /// Retrieves an Entity RawList from the resource pool.\n        /// </summary>\n        /// <returns>Empty Entity raw list.</returns>\n        public static RawList<Entity> GetEntityRawList()\n        {\n            return SubPoolEntityRawList.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"list\">List to return.</param>\n        public static void GiveBack(RawList<Entity> list)\n        {\n            list.Clear();\n            SubPoolEntityRawList.GiveBack(list);\n        }\n\n        /// <summary>\n        /// Retrieves a Triangle shape from the resource pool.\n        /// </summary>\n        /// <param name=\"v1\">Position of the first vertex.</param>\n        /// <param name=\"v2\">Position of the second vertex.</param>\n        /// <param name=\"v3\">Position of the third vertex.</param>\n        /// <returns>Initialized TriangleShape.</returns>\n        public static TriangleShape GetTriangle(ref Vector3 v1, ref Vector3 v2, ref Vector3 v3)\n        {\n            TriangleShape toReturn = SubPoolTriangleShape.Take();\n            toReturn.vA = v1;\n            toReturn.vB = v2;\n            toReturn.vC = v3;\n            return toReturn;\n        }\n\n        /// <summary>\n        /// Retrieves a Triangle shape from the resource pool.\n        /// </summary>\n        /// <returns>Initialized TriangleShape.</returns>\n        public static TriangleShape GetTriangle()\n        {\n            return SubPoolTriangleShape.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"triangle\">Triangle to return.</param>\n        public static void GiveBack(TriangleShape triangle)\n        {\n            triangle.collisionMargin = 0;\n            triangle.sidedness = TriangleSidedness.DoubleSided;\n            SubPoolTriangleShape.GiveBack(triangle);\n        }\n\n\n        /// <summary>\n        /// Retrieves a TriangleCollidable from the resource pool.\n        /// </summary>\n        /// <param name=\"a\">First vertex in the triangle.</param>\n        /// <param name=\"b\">Second vertex in the triangle.</param>\n        /// <param name=\"c\">Third vertex in the triangle.</param>\n        /// <returns>Initialized TriangleCollidable.</returns>\n        public static TriangleCollidable GetTriangleCollidable(ref Vector3 a, ref Vector3 b, ref Vector3 c)\n        {\n            var tri = SubPoolTriangleCollidables.Take();\n            var shape = tri.Shape;\n            shape.vA = a;\n            shape.vB = b;\n            shape.vC = c;\n            var identity = RigidTransform.Identity;\n            tri.UpdateBoundingBoxForTransform(ref identity);\n            return tri;\n\n        }\n\n        /// <summary>\n        /// Retrieves a TriangleCollidable from the resource pool.\n        /// </summary>\n        /// <returns>Initialized TriangleCollidable.</returns>\n        public static TriangleCollidable GetTriangleCollidable()\n        {\n            return SubPoolTriangleCollidables.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"triangle\">Triangle collidable to return.</param>\n        public static void GiveBack(TriangleCollidable triangle)\n        {\n            triangle.CleanUp();\n            SubPoolTriangleCollidables.GiveBack(triangle);\n        }\n\n        /// <summary>\n        /// Retrieves a TriangleIndices list from the resource pool.\n        /// </summary>\n        /// <returns>TriangleIndices list.</returns>\n        public static RawList<TriangleMeshConvexContactManifold.TriangleIndices> GetTriangleIndicesList()\n        {\n            return SubPoolTriangleIndicesList.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"triangleIndices\">TriangleIndices list to return.</param>\n        public static void GiveBack(RawList<TriangleMeshConvexContactManifold.TriangleIndices> triangleIndices)\n        {\n            triangleIndices.Clear();\n            SubPoolTriangleIndicesList.GiveBack(triangleIndices);\n        }\n\n        /// <summary>\n        /// Retrieves a simulation island connection from the resource pool.\n        /// </summary>\n        /// <returns>Uninitialized simulation island connection.</returns>\n        public static SimulationIslandConnection GetSimulationIslandConnection()\n        {\n            return SimulationIslandConnections.Take();\n\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"connection\">Connection to return.</param>\n        public static void GiveBack(SimulationIslandConnection connection)\n        {\n            connection.CleanUp();\n            SimulationIslandConnections.GiveBack(connection);\n\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/PositionUpdating/ContinuousPositionUpdater.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.Settings;\nusing BEPUphysics.Threading;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.PositionUpdating\n{\n    ///<summary>\n    /// Updates objects according to the position update mode.\n    /// This allows continuous objects to avoid missing collisions.\n    ///</summary>\n    public class ContinuousPositionUpdater : PositionUpdater\n    {\n        RawList<IPositionUpdateable> discreteUpdateables = new RawList<IPositionUpdateable>();\n        RawList<ICCDPositionUpdateable> passiveUpdateables = new RawList<ICCDPositionUpdateable>();\n        RawList<ICCDPositionUpdateable> continuousUpdateables = new RawList<ICCDPositionUpdateable>();\n\n        ///<summary>\n        /// Number of objects in a list required to use multithreading.\n        ///</summary>\n        public static int MultithreadingThreshold = 100;\n\n        ///<summary>\n        /// Constructs the position updater.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        public ContinuousPositionUpdater(TimeStepSettings timeStepSettings)\n            : base(timeStepSettings)\n        {\n            preUpdate = PreUpdate;\n            updateTimeOfImpact = UpdateTimeOfImpact;\n            updateContinuous = UpdateContinuousItem;\n        }\n\n\n        ///<summary>\n        /// Constructs the position updater.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        /// <param name=\"threadManager\">Thread manager to use.</param>\n        public ContinuousPositionUpdater(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : base(timeStepSettings, threadManager)\n        {\n            preUpdate = PreUpdate;\n            updateTimeOfImpact = UpdateTimeOfImpact;\n            updateContinuous = UpdateContinuousItem;\n        }\n\n        Action<int> preUpdate;\n        void PreUpdate(int i)\n        {\n            if (i >= discreteUpdateables.Count)\n            {\n                i -= discreteUpdateables.Count;\n                if (i >= passiveUpdateables.Count)\n                {\n                    i -= passiveUpdateables.Count;\n                    //It's a continuous updateable.\n                    if (continuousUpdateables.Elements[i].IsActive)\n                        continuousUpdateables.Elements[i].PreUpdatePosition(timeStepSettings.TimeStepDuration);\n                }\n                else\n                {\n                    //It's a passive updateable.\n                    if (passiveUpdateables.Elements[i].IsActive)\n                        passiveUpdateables.Elements[i].PreUpdatePosition(timeStepSettings.TimeStepDuration);\n                }\n            }\n            else\n            {\n                //It's a discrete updateable.\n                if (discreteUpdateables.Elements[i].IsActive)\n                    discreteUpdateables.Elements[i].PreUpdatePosition(timeStepSettings.TimeStepDuration);\n            }\n        }\n\n        Action<int> updateTimeOfImpact;\n        void UpdateTimeOfImpact(int i)\n        {\n            //This should always execute, even if the updateable is not active.  This is because\n            //a CCD object may be in a pair where the CCD object is resting, and another incoming object\n            //is awake.\n            continuousUpdateables.Elements[i].UpdateTimesOfImpact(timeStepSettings.TimeStepDuration);\n        }\n\n        Action<int> updateContinuous;\n        void UpdateContinuousItem(int i)\n        {\n            if (i < passiveUpdateables.Count)\n            {\n                if (passiveUpdateables.Elements[i].IsActive)\n                    passiveUpdateables.Elements[i].UpdatePositionContinuously(timeStepSettings.TimeStepDuration);\n            }\n            else\n            {\n                if (continuousUpdateables.Elements[i - passiveUpdateables.Count].IsActive)\n                    continuousUpdateables.Elements[i - passiveUpdateables.Count].UpdatePositionContinuously(timeStepSettings.TimeStepDuration);\n            }\n        }\n\n        protected override void UpdateMultithreaded()\n        {\n\n            //Go through the list of all updateables which do not permit motion clamping.\n            //Since these do not care about CCD, just update them as if they were discrete.\n            //In addition, go through the remaining non-discrete objects and perform their prestep.\n            //This usually involves updating their angular motion, but not their linear motion.\n            int count = discreteUpdateables.Count + passiveUpdateables.Count + continuousUpdateables.Count;\n            ThreadManager.ForLoop(0, count, preUpdate);\n\n            //Now go through the list of all full CCD objects.  These are responsible\n            //for determining the TOI of collision pairs, if existent.\n            if (continuousUpdateables.Count > MultithreadingThreshold)\n                ThreadManager.ForLoop(0, continuousUpdateables.Count, updateTimeOfImpact);\n            else\n                for (int i = 0; i < continuousUpdateables.Count; i++)\n                    UpdateTimeOfImpact(i);\n\n            //The TOI's are now computed, so we can integrate all of the CCD or allow-motionclampers \n            //to their new positions.\n            count = passiveUpdateables.Count + continuousUpdateables.Count;\n            if (count > MultithreadingThreshold)\n                ThreadManager.ForLoop(0, count, updateContinuous);\n            else\n                for (int i = 0; i < count; i++)\n                    UpdateContinuousItem(i);\n\n            //The above process is the same as the UpdateSingleThreaded version, but \n            //it doesn't always use multithreading.  Sometimes, a simulation can have\n            //very few continuous objects.  In this case, there's no point in having the \n            //multithreaded overhead.\n\n        }\n\n        protected override void UpdateSingleThreaded()\n        {\n            //Go through the list of all updateables which do not permit motion clamping.\n            //Since these do not care about CCD, just update them as if they were discrete.\n            //In addition, go through the remaining non-discrete objects and perform their prestep.\n            //This usually involves updating their angular motion, but not their linear motion.\n            int count = discreteUpdateables.Count + passiveUpdateables.Count + continuousUpdateables.Count;\n            for (int i = 0; i < count; i++)\n                PreUpdate(i);\n\n            //Now go through the list of all full CCD objects.  These are responsible\n            //for determining the TOI of collision pairs, if existent.\n            for (int i = 0; i < continuousUpdateables.Count; i++)\n                UpdateTimeOfImpact(i);\n\n            //The TOI's are now computed, so we can integrate all of the CCD or allow-motionclampers \n            //to their new positions.\n            count = passiveUpdateables.Count + continuousUpdateables.Count;\n            for (int i = 0; i < count; i++)\n                UpdateContinuousItem(i);\n        }\n\n        ///<summary>\n        /// Notifies the position updater that an updateable has changed state.\n        ///</summary>\n        ///<param name=\"updateable\">Updateable with changed state.</param>\n        ///<param name=\"previousMode\">Previous state the updateable was in.</param>\n        public void UpdateableModeChanged(ICCDPositionUpdateable updateable, PositionUpdateMode previousMode)\n        {\n            switch (previousMode)\n            {\n                case PositionUpdateMode.Discrete:\n                    discreteUpdateables.Remove(updateable);\n                    break;\n                case PositionUpdateMode.Passive:\n                    passiveUpdateables.Remove(updateable);\n                    break;\n                case PositionUpdateMode.Continuous:\n                    continuousUpdateables.Remove(updateable);\n                    break;\n            }\n\n            switch (updateable.PositionUpdateMode)\n            {\n                case PositionUpdateMode.Discrete:\n                    discreteUpdateables.Add(updateable);\n                    break;\n                case PositionUpdateMode.Passive:\n                    passiveUpdateables.Add(updateable);\n                    break;\n                case PositionUpdateMode.Continuous:\n                    continuousUpdateables.Add(updateable);\n                    break;\n            }\n        }\n\n\n        ///<summary>\n        /// Adds an object to the position updater.\n        ///</summary>\n        ///<param name=\"updateable\">Updateable to add.</param>\n        ///<exception cref=\"Exception\">Thrown if the updateable already belongs to a position updater.</exception>\n        public override void Add(IPositionUpdateable updateable)\n        {\n            if (updateable.PositionUpdater == null)\n            {\n                updateable.PositionUpdater = this;\n                var ccdUpdateable = updateable as ICCDPositionUpdateable;\n                if (ccdUpdateable != null)\n                {\n                    switch (ccdUpdateable.PositionUpdateMode)\n                    {\n                        case PositionUpdateMode.Discrete:\n                            discreteUpdateables.Add(updateable);\n                            break;\n                        case PositionUpdateMode.Passive:\n                            passiveUpdateables.Add(ccdUpdateable);\n                            break;\n                        case PositionUpdateMode.Continuous:\n                            continuousUpdateables.Add(ccdUpdateable);\n                            break;\n                    }\n                }\n                else\n                    discreteUpdateables.Add(updateable);\n            }\n            else\n            {\n                throw new ArgumentException(\"Cannot add object to Integrator; it already belongs to one.\");\n            }\n        }\n\n\n        ///<summary>\n        /// Removes an updateable from the updater.\n        ///</summary>\n        ///<param name=\"updateable\">Item to remove.</param>\n        ///<exception cref=\"Exception\">Thrown if the updater does not own the updateable.</exception>\n        public override void Remove(IPositionUpdateable updateable)\n        {\n            if (updateable.PositionUpdater == this)\n            {\n                updateable.PositionUpdater = null;\n                var ccdUpdateable = updateable as ICCDPositionUpdateable;\n                if (ccdUpdateable != null)\n                {\n                    switch (ccdUpdateable.PositionUpdateMode)\n                    {\n                        case PositionUpdateMode.Discrete:\n                            discreteUpdateables.Remove(updateable);\n                            break;\n                        case PositionUpdateMode.Passive:\n                            passiveUpdateables.Remove(ccdUpdateable);\n                            break;\n                        case PositionUpdateMode.Continuous:\n                            continuousUpdateables.Remove(ccdUpdateable);\n                            break;\n                    }\n                }\n                else\n                    discreteUpdateables.Remove(updateable);\n            }\n            else\n                throw new ArgumentException(\"Cannot remove object from this Integrator.  The object doesn't belong to it.\");\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/PositionUpdating/ICCDPositionUpdateable.cs",
    "content": "﻿namespace BEPUphysics.PositionUpdating\n{\n    ///<summary>\n    /// Update modes for position updateables.\n    ///</summary>\n    public enum PositionUpdateMode : byte\n    {\n        /// <summary>\n        /// Updates position discretely regardless of its collision pairs.\n        /// </summary>\n        Discrete,\n        /// <summary>\n        /// Updates position discretely in isolation; when a Continuous object collides with it,\n        /// its position update will be bounded by the time of impact.\n        /// </summary>\n        Passive,\n        /// <summary>\n        /// Updates position continuously.  Continuous objects will integrate up to their earliest collision time.\n        /// </summary>\n        Continuous\n    }\n\n    ///<summary>\n    /// A position updateable that can be updated continuously.\n    ///</summary>\n    public interface ICCDPositionUpdateable : IPositionUpdateable\n    {\n        ///<summary>\n        /// Updates the time of impacts associated with the updateable.\n        ///</summary>\n        ///<param name=\"dt\">Time step duration.</param>\n        void UpdateTimesOfImpact(float dt);\n\n        /// <summary>\n        /// Updates the updateable using its continuous nature.\n        /// </summary>\n        /// <param name=\"dt\">Time step duration.</param>\n        void UpdatePositionContinuously(float dt);\n\n        /// <summary>\n        /// Gets or sets the position update mode of the object.\n        /// The position update mode defines the way the object\n        /// interacts with continuous collision detection.\n        /// </summary>\n        PositionUpdateMode PositionUpdateMode { get; set; }\n        \n        /// <summary>\n        /// Resets the times of impact for pairs associated with this position updateable.\n        /// </summary>\n        void ResetTimesOfImpact();\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/PositionUpdating/IPositionUpdateable.cs",
    "content": "﻿namespace BEPUphysics.PositionUpdating\n{\n    ///<summary>\n    /// Defines an object capable of a position update.\n    ///</summary>\n    public interface IPositionUpdateable\n    {\n        ///<summary>\n        /// Gets whether or not the object is active.\n        /// Only active objects will be updated.\n        ///</summary>\n        bool IsActive { get; }\n\n        ///<summary>\n        /// Gets or sets the position updater that owns this updateable.\n        ///</summary>\n        PositionUpdater PositionUpdater { get; set; }\n\n        ///<summary>\n        /// Updates the position state of the object.\n        ///</summary>\n        ///<param name=\"dt\">Time step duration.</param>\n        void PreUpdatePosition(float dt);\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/PositionUpdating/PositionUpdater.cs",
    "content": "﻿using System;\nusing BEPUphysics.Threading;\n\nnamespace BEPUphysics.PositionUpdating\n{\n    ///<summary>\n    /// Superclass of updaters which manage the position of objects.\n    ///</summary>\n    public abstract class PositionUpdater : MultithreadedProcessingStage\n    {\n        protected TimeStepSettings timeStepSettings;\n        ///<summary>\n        /// Gets or sets the time step settings used by the updater.\n        ///</summary>\n        public TimeStepSettings TimeStepSettings\n        {\n            get\n            {\n                return timeStepSettings;\n            }\n            set\n            {\n                timeStepSettings = value;\n            }\n        }\n\n        protected PositionUpdater(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            :this(timeStepSettings)\n        {\n            ThreadManager = threadManager;\n            AllowMultithreading = true;\n        }\n\n        protected PositionUpdater(TimeStepSettings timeStepSettings)\n        {\n            this.timeStepSettings = timeStepSettings;\n            Enabled = true;\n        }\n        ///<summary>\n        /// Adds an object to the position updater.\n        ///</summary>\n        ///<param name=\"updateable\">Updateable to add.</param>\n        ///<exception cref=\"Exception\">Thrown if the updateable already belongs to a position updater.</exception>\n        public abstract void Add(IPositionUpdateable updateable);\n        ///<summary>\n        /// Removes an updateable from the updater.\n        ///</summary>\n        ///<param name=\"updateable\">Item to remove.</param>\n        ///<exception cref=\"Exception\">Thrown if the updater does not own the updateable.</exception>\n        public abstract void Remove(IPositionUpdateable updateable);\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/ProcessingStage.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\n\nnamespace BEPUphysics\n{\n    ///<summary>\n    /// Superclass of singlethreaded update systems.\n    ///</summary>\n    public abstract class ProcessingStage\n    {\n        ///<summary>\n        /// Gets or sets whether or not the stage should update.\n        ///</summary>\n        public virtual bool Enabled { get; set; }\n\n        ///<summary>\n        /// Fires when the stage starts working.\n        ///</summary>\n        public event Action Starting;\n\n        ///<summary>\n        /// Fires when the stage finishes working.\n        ///</summary>\n        public event Action Finishing;\n\n#if PROFILE\n        /// <summary>\n        /// Gets the time elapsed in the previous execution of this stage, not including any hooked Starting or Finishing events.\n        /// </summary>\n        public double Time\n        {\n            get\n            {\n                return (end - start) / (double)Stopwatch.Frequency;\n            }\n        }\n\n        long start, end;\n      \n          \n#endif\n        ///<summary>\n        /// Updates the stage.\n        ///</summary>\n        public void Update()\n        {\n            if (!Enabled)\n                return;\n            if (Starting != null)\n                Starting();\n#if PROFILE\n            start = Stopwatch.GetTimestamp();\n#endif\n\n            UpdateStage();\n\n#if PROFILE\n            end = Stopwatch.GetTimestamp();\n#endif\n            if (Finishing != null)\n                Finishing();\n        }\n        protected abstract void UpdateStage();\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Properties/AppManifest.xml",
    "content": "﻿<Deployment xmlns=\"http://schemas.microsoft.com/client/2007/deployment\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n>\n    <Deployment.Parts>\n    </Deployment.Parts>\n</Deployment>\n"
  },
  {
    "path": "BEPUphysics/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"BEPUphysics\")]\n[assembly: AssemblyProduct(\"BEPUphysics\")]\n[assembly: AssemblyDescription(\"Real time physics simulation library\")]\n[assembly: AssemblyCompany(\"Bepu Entertainment LLC\")]\n[assembly: AssemblyCopyright(\"Copyright © Bepu Entertainment LLC\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type. Only Windows\n// assemblies support COM.\n[assembly: ComVisible(false)]\n\n// On Windows, the following GUID is for the ID of the typelib if this\n// project is exposed to COM. On other platforms, it unique identifies the\n// title storage container when deploying this assembly to the device.\n[assembly: Guid(\"ab0c58ea-ef42-46d7-b180-2baedc61ce9b\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n[assembly: AssemblyVersion(\"1.3.0.0\")]\n#if WINDOWS_PHONE\n[assembly: CodeGeneration(CodeGenerationFlags.EnableFPIntrinsicsUsingSIMD)]\n#endif"
  },
  {
    "path": "BEPUphysics/Properties/WMAppManifest.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Deployment xmlns=\"http://schemas.microsoft.com/windowsphone/2009/deployment\" AppPlatformVersion=\"7.0\">\n  <App xmlns=\"\" ProductID=\"{6f50645f-a329-4e50-bc28-8c3432b46198}\" Title=\"BEPUphysics\" RuntimeType=\"XNA\" Version=\"1.0.0.0\" Genre=\"Apps.Normal\" Author=\"\" Description=\"\" Publisher=\"\">\n    <IconPath IsRelative=\"true\" IsResource=\"false\">\n    </IconPath>\n    <Capabilities>\n      <Capability Name=\"ID_CAP_NETWORKING\" />\n      <Capability Name=\"ID_CAP_LOCATION\" />\n      <Capability Name=\"ID_CAP_SENSORS\" />\n      <Capability Name=\"ID_CAP_MICROPHONE\" />\n      <Capability Name=\"ID_CAP_MEDIALIB\" />\n      <Capability Name=\"ID_CAP_GAMERSERVICES\" />\n      <Capability Name=\"ID_CAP_PHONEDIALER\" />\n      <Capability Name=\"ID_CAP_PUSH_NOTIFICATION\" />\n      <Capability Name=\"ID_CAP_WEBBROWSERCOMPONENT\" />\n      <Capability Name=\"ID_CAP_IDENTITY_USER\" />\n      <Capability Name=\"ID_CAP_IDENTITY_DEVICE\" />\n      <!--New Windows Phone OS 7.1 capabilities inserted during project upgrade.-->\n      <Capability Name=\"ID_CAP_ISV_CAMERA\" />\n      <Capability Name=\"ID_CAP_CONTACTS\" />\n      <Capability Name=\"ID_CAP_APPOINTMENTS\" />\n    </Capabilities>\n    <Tasks>\n      <DefaultTask Name=\"_default\" />\n    </Tasks>\n    <Tokens>\n      <PrimaryToken TokenID=\"BEPUphysicsToken\" TaskName=\"_default\">\n        <TemplateType5>\n          <BackgroundImageURI IsRelative=\"true\" IsResource=\"false\">\n          </BackgroundImageURI>\n          <Count>0</Count>\n          <Title>\n          </Title>\n        </TemplateType5>\n      </PrimaryToken>\n    </Tokens>\n  </App>\n</Deployment>"
  },
  {
    "path": "BEPUphysics/RayCastResult.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUutilities;\n\nnamespace BEPUphysics\n{\n    ///<summary>\n    /// Contains information about a ray cast hit.\n    ///</summary>\n    public struct RayCastResult\n    {\n        ///<summary>\n        /// Position, normal, and t paramater of the hit.\n        ///</summary>\n        public RayHit HitData;\n        /// <summary>\n        /// Object hit by the ray.\n        /// </summary>\n        public BroadPhaseEntry HitObject;\n\n        ///<summary>\n        /// Constructs a new ray cast result.\n        ///</summary>\n        ///<param name=\"hitData\">Ray cast hit data.</param>\n        ///<param name=\"hitObject\">Object hit by the ray.</param>\n        public RayCastResult(RayHit hitData, BroadPhaseEntry hitObject)\n        {\n            HitData = hitData;\n            HitObject = hitObject;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Settings/CollisionDetectionSettings.cs",
    "content": "﻿using System;\nnamespace BEPUphysics.Settings\n{\n    ///<summary>\n    /// Settings class containing global information about collision detection.\n    ///</summary>\n    public static class CollisionDetectionSettings\n    {\n\n\n        internal static float ContactInvalidationLengthSquared = .01f;\n\n        /// <summary>\n        /// For persistent manifolds, contacts are represented by an offset in local space of two colliding bodies.\n        /// The distance between these offsets transformed into world space and projected onto a plane defined by the contact normal squared is compared against this value.\n        /// If this value is exceeded, the contact is removed from the contact manifold.\n        /// \n        /// If the world is smaller or larger than 'normal' for the engine, adjusting this value proportionally can improve contact caching behavior.\n        /// The default value of .1f works well for worlds that operate on the order of 1 unit.\n        /// </summary>\n        public static float ContactInvalidationLength\n        {\n            get\n            {\n                return (float)Math.Sqrt(ContactInvalidationLengthSquared);\n            }\n            set\n            {\n                ContactInvalidationLengthSquared = value * value;\n            }\n        }\n\n\n        internal static float ContactMinimumSeparationDistanceSquared = .0009f;\n        /// <summary>\n        /// In persistent manifolds, if two contacts are too close together, then \n        /// the system will not use one of them.  This avoids redundant constraints.\n        /// Defaults to .03f.\n        /// </summary>\n        public static float ContactMinimumSeparationDistance\n        {\n            get\n            {\n                return (float)Math.Sqrt(ContactMinimumSeparationDistanceSquared);\n            }\n            set\n            {\n                ContactMinimumSeparationDistanceSquared = value * value;\n            }\n        }\n\n        internal static float nonconvexNormalDotMinimum = .99f;\n        /// <summary>\n        /// In regular convex manifolds, two contacts are considered redundant if their positions are too close together.  \n        /// In nonconvex manifolds, the normal must also be tested, since a contact in the same location could have a different normal.\n        /// This property is the minimum angle in radians between normals below which contacts are considered redundant.\n        /// </summary>\n        public static float NonconvexNormalAngleDifferenceMinimum\n        {\n            get\n            {\n                return (float)Math.Acos(nonconvexNormalDotMinimum);\n            }\n            set\n            {\n                nonconvexNormalDotMinimum = (float)Math.Cos(value);\n            }\n        }\n\n        /// <summary>\n        /// The default amount of allowed penetration into the margin before position correcting impulses will be applied.\n        /// Defaults to .01f.\n        /// </summary>\n        public static float AllowedPenetration = .01f;\n\n        /// <summary>\n        /// Default collision margin around objects.  Margins help prevent objects from interpenetrating and improve stability.\n        /// Defaults to .04f.\n        /// </summary>\n        public static float DefaultMargin = .04f;\n\n        internal static float maximumContactDistance = .1f;\n        /// <summary>\n        /// Maximum distance between the surfaces defining a contact point allowed before removing the contact.\n        /// Defaults to .1f.\n        /// </summary>\n        public static float MaximumContactDistance\n        {\n            get\n            {\n                return maximumContactDistance;\n            }\n            set\n            {\n                if (value >= 0)\n                    maximumContactDistance = value;\n                else\n                    throw new ArgumentException(\"Distance must be nonnegative.\");\n            }\n        }\n\n\n        \n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Settings/CollisionResponseSettings.cs",
    "content": "﻿namespace BEPUphysics.Settings\n{\n    ///<summary>\n    /// Contains global settings relating to the collision response system.\n    ///</summary>\n    public static class CollisionResponseSettings\n    {\n        /// <summary>\n        /// Impact velocity above which the bouciness of the object pair is taken into account.  Below the threshold, no extra energy is added.\n        /// Defaults to 1.\n        /// </summary>\n        public static float BouncinessVelocityThreshold = 1;\n\n        /// <summary>\n        /// Maximum speed at which interpenetrating objects will attempt to undo any overlap.\n        /// Defaults to 2.\n        /// </summary>\n        public static float MaximumPenetrationCorrectionSpeed = 2;\n\n        /// <summary>\n        /// Fraction of position error to convert into corrective momentum.\n        /// Defaults to 0.2.\n        /// </summary>\n        public static float PenetrationRecoveryStiffness = 0.2f;\n\n        /// <summary>\n        /// Magnitude of relative velocity at a contact point below which staticFriction is used.\n        /// dynamicFriction is used when velocity exceeds this threshold.\n        /// Defaults to 0.2.\n        /// </summary>\n        public static float StaticFrictionVelocityThreshold = 0.2f;\n\n        /// <summary>\n        /// Value by which a collision pair's friction coefficient will be multiplied to get the twist friction coefficient.\n        /// Defaults to 1.\n        /// </summary>\n        public static float TwistFrictionFactor = 1f;\n\n        /// <summary>\n        /// <para>Softness multiplier used by collision penetration constraints. Higher softness values allow more velocity error and make things look 'squishier'. Defaults to 0.05.</para>\n        /// <para>Note that this value is not used directly by constraints; it is first scaled by the raw inverse effective mass. This allows consistent behavior across objects with different masses.</para>\n        /// </summary>\n        public static float Softness = 0.05f;\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Settings/MotionSettings.cs",
    "content": "﻿using BEPUphysics.PositionUpdating;\nusing System;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing BEPUphysics.Entities;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.BroadPhaseEntries;\n\nnamespace BEPUphysics.Settings\n{\n    ///<summary>\n    /// Contains global settings about motion updating.\n    ///</summary>\n    public static class MotionSettings\n    {\n        ///<summary>\n        /// Whether or not to use RK4 angular integration.  This can improve simulation quality sometimes, but not always.\n        /// It has a slight performance impact.  Enabling this when ConserveAngularMomentum is set to true may be helpful.\n        /// Defaults to false.\n        ///</summary>\n        public static bool UseRk4AngularIntegration;\n        ///<summary>\n        /// Whether or not to conserve angular momentum.\n        /// This produces slightly more realistic angular behavior, but can reduce stability.\n        /// Consider using a smaller timestep, enabling RK4 angular integration, or both.\n        /// Do not use singular inertia tensors while momentum conservation is enabled.\n        /// Defaults to false.\n        ///</summary>\n        public static bool ConserveAngularMomentum;\n        ///<summary>\n        /// The scaling to apply to the core shapes used for continuous collision detection tests.\n        /// Values should be between 0 and 0.99f.  The smaller the value, the smaller the shapes used\n        /// to perform CCD are, and more collisions are missed.\n        /// Defaults to .8f.\n        ///</summary>\n        public static float CoreShapeScaling\n        {\n            get\n            {\n                return coreShapeScaling;\n            }\n            set\n            {\n                //The reason why it doesn't allow up to 1.0 is there exist systems that require a small margin between the full minimum radius and the core shape.\n                coreShapeScaling = MathHelper.Clamp(value, 0, .99f);\n            }\n        }\n        static float coreShapeScaling = .8f;\n        /// <summary>\n        /// The default position updating mode used by position updateables.\n        /// Defaults to Discrete.\n        /// </summary>\n        public static PositionUpdateMode DefaultPositionUpdateMode = PositionUpdateMode.Discrete;\n        /// <summary>\n        /// It is possible for an object in danger of being hit by a moving object to have a bounding box which\n        /// does not contain the resulting motion, and CCD will fail to detect a secondary collision.\n        /// Setting this to true will take into account nearby objects' velocities and use them to enlarge the \n        /// bounding box so that secondary collisions are not missed.\n        /// The larger size of bounding boxes can cause an increase in collision pairs during stressful situations,\n        /// which can harm performance.\n        /// Defaults to false.\n        /// </summary>\n        public static bool UseExtraExpansionForContinuousBoundingBoxes;\n\n\n\n        /// <summary>\n        /// Delegate which determines if a given pair should be allowed to run continuous collision detection.\n        /// This is only called for entities which are continuous and colliding with other objects.\n        /// By default, this prevents CCD from being used in any pair where the pair's CollisionRule stops collision response.\n        /// </summary>\n        public static CCDFilter CCDFilter;\n\n        internal static bool PairAllowsCCD(Entity entity, CollidablePairHandler pair)\n        {\n            var other = (pair.broadPhaseOverlap.entryA == entity.CollisionInformation ? pair.broadPhaseOverlap.entryB : pair.broadPhaseOverlap.entryA) as Collidable;\n            return CCDFilter(entity, other, pair);\n        }\n\n        static bool DefaultCCDFilter(Entity entity, Collidable other, CollidablePairHandler pair)\n        {\n            return pair.broadPhaseOverlap.collisionRule < CollisionRule.NoSolver;\n        }\n\n        static MotionSettings()\n        {\n            CCDFilter = DefaultCCDFilter;\n        }\n\n    }\n\n    /// <summary>\n    /// Delegate which determines if a given pair should be allowed to run continuous collision detection.\n    /// This is only called for entities which are continuous and colliding with other objects.\n    /// </summary>\n    public delegate bool CCDFilter(Entity entity, Collidable other, CollidablePairHandler pair);\n}\n"
  },
  {
    "path": "BEPUphysics/SolverSystems/Solver.cs",
    "content": "﻿using System;\nusing BEPUphysics.DeactivationManagement;\nusing BEPUphysics.Threading;\nusing BEPUphysics.Constraints;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.SolverSystems\n{\n    ///<summary>\n    /// Iteratively solves solver updateables, converging to a solution for simulated joints and collision pair contact constraints.\n    ///</summary>\n    public class Solver : MultithreadedProcessingStage\n    {\n        RawList<SolverUpdateable> solverUpdateables = new RawList<SolverUpdateable>();\n        internal int iterationLimit = 10;\n        ///<summary>\n        /// Gets or sets the maximum number of iterations the solver will attempt to use to solve the simulation's constraints.\n        ///</summary>\n        public int IterationLimit { get { return iterationLimit; } set { iterationLimit = Math.Max(value, 0); } }\n        ///<summary>\n        /// Gets the list of solver updateables in the solver.\n        ///</summary>\n        public ReadOnlyList<SolverUpdateable> SolverUpdateables\n        {\n            get\n            {\n                return new ReadOnlyList<SolverUpdateable>(solverUpdateables);\n            }\n        }\n        protected internal TimeStepSettings timeStepSettings;\n        ///<summary>\n        /// Gets or sets the time step settings used by the solver.\n        ///</summary>\n        public TimeStepSettings TimeStepSettings\n        {\n            get\n            {\n                return timeStepSettings;\n            }\n            set\n            {\n                timeStepSettings = value;\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the deactivation manager used by the solver.\n        /// When constraints are added and removed, the deactivation manager\n        /// gains and loses simulation island connections that affect simulation islands\n        /// and activity states.\n        ///</summary>\n        public DeactivationManager DeactivationManager { get; set; }\n\n        /// <summary>\n        /// Gets the permutation mapper used by the solver.\n        /// </summary>\n        public PermutationMapper PermutationMapper { get; private set; }\n\n        ///<summary>\n        /// Constructs a Solver.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings used by the solver.</param>\n        ///<param name=\"deactivationManager\">Deactivation manager used by the solver.</param>\n        public Solver(TimeStepSettings timeStepSettings, DeactivationManager deactivationManager)\n        {\n            TimeStepSettings = timeStepSettings;\n            DeactivationManager = deactivationManager;\n            multithreadedPrestepDelegate = MultithreadedPrestep;\n            multithreadedIterationDelegate = MultithreadedIteration;\n            Enabled = true;\n            PermutationMapper = new PermutationMapper();\n        }\n        ///<summary>\n        /// Constructs a Solver.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings used by the solver.</param>\n        ///<param name=\"deactivationManager\">Deactivation manager used by the solver.</param>\n        /// <param name=\"threadManager\">Thread manager used by the solver.</param>\n        public Solver(TimeStepSettings timeStepSettings, DeactivationManager deactivationManager, IThreadManager threadManager)\n            : this(timeStepSettings, deactivationManager)\n        {\n            ThreadManager = threadManager;\n            AllowMultithreading = true;\n        }\n\n        ///<summary>\n        /// Adds a solver updateable to the solver.\n        ///</summary>\n        ///<param name=\"item\">Updateable to add.</param>\n        ///<exception cref=\"ArgumentException\">Thrown when the item already belongs to a solver.</exception>\n        public void Add(SolverUpdateable item)\n        {\n            if (item.Solver == null)\n            {\n                item.Solver = this;\n                item.solverIndex = solverUpdateables.Count;\n                solverUpdateables.Add(item);\n                DeactivationManager.Add(item.simulationIslandConnection);\n                item.OnAdditionToSolver(this);\n            }\n            else\n                throw new ArgumentException(\"Solver updateable already belongs to something; it can't be added.\", \"item\");\n        }\n        ///<summary>\n        /// Removes a solver updateable from the solver.\n        ///</summary>\n        ///<param name=\"item\">Updateable to remove.</param>\n        ///<exception cref=\"ArgumentException\">Thrown when the item does not belong to the solver.</exception>\n        public void Remove(SolverUpdateable item)\n        {\n\n            if (item.Solver == this)\n            {\n\n                item.Solver = null;\n                solverUpdateables.Count--;\n                if (item.solverIndex < solverUpdateables.Count)\n                {\n                    //The solver updateable isn't the last element, so put the last element in its place.\n                    solverUpdateables.Elements[item.solverIndex] = solverUpdateables.Elements[solverUpdateables.Count];\n                    //Update the replacement's solver index to its new location.\n                    solverUpdateables.Elements[item.solverIndex].solverIndex = item.solverIndex;\n                }\n                solverUpdateables.Elements[solverUpdateables.Count] = null;\n\n\n                DeactivationManager.Remove(item.simulationIslandConnection);\n                item.OnRemovalFromSolver(this);\n            }\n\n            else\n                throw new ArgumentException(\"Solver updateable doesn't belong to this solver; it can't be removed.\", \"item\");\n\n        }\n\n\n\n\n        Action<int> multithreadedPrestepDelegate;\n        void MultithreadedPrestep(int i)\n        {\n            var updateable = solverUpdateables.Elements[i];\n            updateable.UpdateSolverActivity();\n            if (updateable.isActiveInSolver)\n            {\n                updateable.SolverSettings.currentIterations = 0;\n                updateable.SolverSettings.iterationsAtZeroImpulse = 0;\n                updateable.Update(timeStepSettings.TimeStepDuration);\n\n                updateable.EnterLock();\n                try\n                {\n                    updateable.ExclusiveUpdate();\n                }\n                finally\n                {\n                    updateable.ExitLock();\n                }\n            }\n        }\n\n\n        Action<int> multithreadedIterationDelegate;\n        void MultithreadedIteration(int i)\n        {\n            //'i' is currently an index into an implicit array of solver updateables that goes from 0 to solverUpdateables.count * iterationLimit.\n            //It includes iterationLimit copies of each updateable.\n            //Permute the entire set with duplicates.\n            var updateable = solverUpdateables.Elements[PermutationMapper.GetMappedIndex(i, solverUpdateables.Count)];\n\n\n            SolverSettings solverSettings = updateable.solverSettings;\n            //Updateables only ever go from active to inactive during iterations,\n            //so it's safe to check for activity before we do hard (synchronized) work.\n            if (updateable.isActiveInSolver)\n            {\n                int incrementedIterations = -1;\n                updateable.EnterLock();\n                //This duplicate test protects against the possibility that the updateable went inactive between the first check and the lock.\n                if (updateable.isActiveInSolver)\n                {\n                    if (updateable.SolveIteration() < solverSettings.minimumImpulse)\n                    {\n                        solverSettings.iterationsAtZeroImpulse++;\n                        if (solverSettings.iterationsAtZeroImpulse > solverSettings.minimumIterationCount)\n                            updateable.isActiveInSolver = false;\n                    }\n                    else\n                    {\n                        solverSettings.iterationsAtZeroImpulse = 0;\n                    }\n\n                    //Increment the iteration count.\n                    incrementedIterations = solverSettings.currentIterations++;\n                }\n                updateable.ExitLock();\n                //Since the updateables only ever go from active to inactive, it's safe to check outside of the lock.\n                //Keeping this if statement out of the lock allows other waiters to get to work a few nanoseconds faster.\n                if (incrementedIterations > iterationLimit ||\n                    incrementedIterations > solverSettings.maximumIterationCount)\n                {\n                    updateable.isActiveInSolver = false;\n                }\n\n            }\n\n\n\n        }\n\n        protected override void UpdateMultithreaded()\n        {\n            ThreadManager.ForLoop(0, solverUpdateables.Count, multithreadedPrestepDelegate);\n            ++PermutationMapper.PermutationIndex;\n            ThreadManager.ForLoop(0, iterationLimit * solverUpdateables.Count, multithreadedIterationDelegate);\n        }\n\n        protected override void UpdateSingleThreaded()\n        {\n\n            int totalUpdateableCount = solverUpdateables.Count;\n            for (int i = 0; i < totalUpdateableCount; i++)\n            {\n                UnsafePrestep(solverUpdateables.Elements[i]);\n            }\n\n            int totalCount = iterationLimit * totalUpdateableCount;\n            ++PermutationMapper.PermutationIndex;\n            for (int i = 0; i < totalCount; i++)\n            {\n                UnsafeSolveIteration(solverUpdateables.Elements[PermutationMapper.GetMappedIndex(i, totalUpdateableCount)]);\n            }\n\n\n        }\n\n        protected internal void UnsafePrestep(SolverUpdateable updateable)\n        {\n            updateable.UpdateSolverActivity();\n            if (updateable.isActiveInSolver)\n            {\n                SolverSettings solverSettings = updateable.solverSettings;\n                solverSettings.currentIterations = 0;\n                solverSettings.iterationsAtZeroImpulse = 0;\n                updateable.Update(timeStepSettings.TimeStepDuration);\n                updateable.ExclusiveUpdate();\n            }\n        }\n\n        protected internal void UnsafeSolveIteration(SolverUpdateable updateable)\n        {\n            if (updateable.isActiveInSolver)\n            {\n                SolverSettings solverSettings = updateable.solverSettings;\n\n\n                solverSettings.currentIterations++;\n                if (solverSettings.currentIterations <= iterationLimit &&\n                    solverSettings.currentIterations <= solverSettings.maximumIterationCount)\n                {\n                    if (updateable.SolveIteration() < solverSettings.minimumImpulse)\n                    {\n                        solverSettings.iterationsAtZeroImpulse++;\n                        if (solverSettings.iterationsAtZeroImpulse > solverSettings.minimumIterationCount)\n                            updateable.isActiveInSolver = false;\n\n                    }\n                    else\n                    {\n                        solverSettings.iterationsAtZeroImpulse = 0;\n                    }\n                }\n                else\n                {\n                    updateable.isActiveInSolver = false;\n                }\n\n            }\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/SolverSystems/SolverUpdateable.cs",
    "content": "﻿using BEPUphysics.Constraints;\nusing BEPUphysics.DeactivationManagement;\n\nnamespace BEPUphysics.SolverSystems\n{\n    ///<summary>\n    /// Superclass of all objects that live in the solver.\n    ///</summary>\n    public abstract class SolverUpdateable : ISimulationIslandConnectionOwner, ISpaceObject\n    {\n        internal int solverIndex;\n\n        protected internal Solver solver;\n        ///<summary>\n        /// Gets the solver to which the solver updateable belongs.\n        ///</summary>\n        public virtual Solver Solver\n        {\n            get\n            {\n                return solver;\n            }\n            internal set\n            {\n                solver = value;\n            }\n        }\n\n        protected SolverUpdateable()\n        {\n            //Initialize the connection.\n            //It will usually be overridden and end up floating on back to the resource pool.\n            simulationIslandConnection = PhysicsResources.GetSimulationIslandConnection();\n            simulationIslandConnection.Owner = this;\n        }\n\n        ///<summary>\n        /// Performs the frame's configuration step.\n        ///</summary>\n        ///<param name=\"dt\">Timestep duration.</param>\n        public abstract void Update(float dt);\n\n        //Will be locked if necessary by the solver.\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public abstract void ExclusiveUpdate();\n\n        /// <summary>\n        /// Computes one iteration of the constraint to meet the solver updateable's goal.\n        /// </summary>\n        /// <returns>The rough applied impulse magnitude.</returns>\n        public abstract float SolveIteration();\n\n        protected internal SolverSettings solverSettings = new SolverSettings();\n        ///<summary>\n        /// Gets the solver settings that manage how the solver updates.\n        ///</summary>\n        public SolverSettings SolverSettings\n        {\n            get { return solverSettings; }\n        }\n\n        protected internal bool isActive = true;\n        /// <summary>\n        /// Gets or sets whether or not this solver updateable is active.\n        /// \n        /// When set to false, this solver updateable will be idle and its \n        /// isActiveInSolver field will always be false.\n        /// \n        /// When set to true, the solver updateable will run normally and update if\n        /// the type's activity conditions allow it.\n        /// </summary>\n        public bool IsActive\n        {\n            get { return isActive; }\n            set { isActive = value; }\n        }\n\n        protected internal bool isActiveInSolver = true;\n        /// <summary>\n        /// Gets whether or not the space's solver should try to solve this object.\n        /// Depends on conditions specific to each solver updateable type and whether or not\n        /// it has completed its computations early.  Recomputed each frame.\n        /// </summary>\n        public bool IsActiveInSolver\n        {\n            get\n            {\n                return isActiveInSolver;\n            }\n        }\n\n        /// <summary>\n        /// Attempts to acquire a lock on the solver updateable.\n        /// This allows operations that need exclusive access to the solver updateable's members.\n        /// If it is contested, it aborts the attempt.\n        /// </summary>\n        /// <returns>Whether or not the lock could be acquired.</returns>\n        public abstract bool TryEnterLock();\n        /// <summary>\n        /// Acquires a lock on the solver updateable.\n        /// This allows operations that need exclusive access to the solver updateable's members.\n        /// </summary>\n        public abstract void EnterLock();\n        /// <summary>\n        /// Releases the lock on the solver updateable.\n        /// </summary>\n        public abstract void ExitLock();\n\n\n        /// <summary>\n        /// Updates the activity state of the solver updateable based on its members.\n        /// </summary>\n        public virtual void UpdateSolverActivity()\n        {\n            if (isActive)\n            {\n                //This is a simulation island connection.  We already know that all connected objects share the\n                //same simulation island (or don't have one, in the case of kinematics).  All we have to do is test to see if that island is active!\n                for (int i = 0; i < simulationIslandConnection.entries.Count; i++)\n                {\n                    var island = simulationIslandConnection.entries.Elements[i].Member.SimulationIsland;\n                    if (island != null && island.isActive)\n                    {\n                        isActiveInSolver = true;\n                        return;\n                    }\n                }\n            }\n            isActiveInSolver = false;\n        }\n\n\n\n        protected internal ISpace space;\n        ISpace ISpaceObject.Space\n        {\n            get\n            {\n                return space;\n            }\n            set\n            {\n                space = value;\n            }\n        }\n\n        /// <summary>\n        /// Called after the object is added to a space.\n        /// </summary>\n        /// <param name=\"newSpace\"></param>\n        public virtual void OnAdditionToSpace(ISpace newSpace)\n        {\n        }\n\n        /// <summary>\n        /// Called before an object is removed from its space.\n        /// </summary>\n        public virtual void OnRemovalFromSpace(ISpace oldSpace)\n        {\n        }\n\n        ///<summary>\n        /// Called when the updateable is added to a solver.\n        ///</summary>\n        ///<param name=\"newSolver\">Solver to which the updateable was added.</param>\n        public virtual void OnAdditionToSolver(Solver newSolver)\n        {\n        }\n\n        /// <summary>\n        /// Called when the updateable is removed from its solver.\n        /// </summary>\n        /// <param name=\"oldSolver\">Solver from which the updateable was removed.</param>\n        public virtual void OnRemovalFromSolver(Solver oldSolver)\n        {\n        }\n\n        /// <summary>\n        /// Gets or sets the user data associated with this object.\n        /// </summary>\n        public object Tag { get; set; }\n\n\n        protected internal SimulationIslandConnection simulationIslandConnection;\n\n        /// <summary>\n        /// Gets the simulation island connection associated with this updateable.\n        /// </summary>\n        public SimulationIslandConnection SimulationIslandConnection\n        {\n            get { return simulationIslandConnection; }\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/SolverSystems/SolverUpdateableChange.cs",
    "content": "﻿namespace BEPUphysics.SolverSystems\n{\n    ///<summary>\n    /// Stores an enqueued solver updateable addition or removal.\n    ///</summary>\n    public struct SolverUpdateableChange\n    {\n\n        ///<summary>\n        /// Whether the item is going to be added or removed.\n        ///</summary>\n        public bool ShouldAdd;\n        ///<summary>\n        /// Item being added or removed.\n        ///</summary>\n        public SolverUpdateable Item;\n\n        ///<summary>\n        /// Constructs a new solver updateable change.\n        ///</summary>\n        ///<param name=\"shouldAdd\">Whether the item is going to be added or removed.</param>\n        ///<param name=\"item\">Item to add or remove.</param>\n        public SolverUpdateableChange(bool shouldAdd, SolverUpdateable item)\n        {\n            ShouldAdd = shouldAdd;\n            Item = item;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Space.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseSystems.Hierarchies;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUphysics.DeactivationManagement;\nusing BEPUphysics.Entities;\nusing BEPUphysics.EntityStateManagement;\nusing BEPUphysics.OtherSpaceStages;\nusing BEPUphysics.PositionUpdating;\nusing BEPUphysics.SolverSystems;\nusing BEPUphysics.Threading;\nusing BEPUutilities;\nusing BEPUphysics.NarrowPhaseSystems;\nusing BEPUphysics.UpdateableSystems;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics\n{\n    ///<summary>\n    /// Main simulation class of BEPUphysics.  Contains various updating stages addition/removal methods for getting objects into the simulation.\n    ///</summary>\n    public class Space : ISpace, IDisposable\n    {\n        private TimeStepSettings timeStepSettings;\n        ///<summary>\n        /// Gets or sets the time step settings used by the space.\n        ///</summary>\n        public TimeStepSettings TimeStepSettings\n        {\n            get\n            {\n                return timeStepSettings;\n            }\n            set\n            {\n                timeStepSettings = value;\n                DeactivationManager.TimeStepSettings = value;\n                ForceUpdater.TimeStepSettings = value;\n                BoundingBoxUpdater.TimeStepSettings = value;\n                Solver.TimeStepSettings = value;\n                PositionUpdater.TimeStepSettings = value;\n\n            }\n        }\n\n        IThreadManager threadManager;\n        ///<summary>\n        /// Gets or sets the thread manager used by the space.\n        ///</summary>\n        public IThreadManager ThreadManager\n        {\n            get\n            {\n                return threadManager;\n            }\n            set\n            {\n                threadManager = value;\n                DeactivationManager.ThreadManager = value;\n                ForceUpdater.ThreadManager = value;\n                BoundingBoxUpdater.ThreadManager = value;\n                BroadPhase.ThreadManager = value;\n                NarrowPhase.ThreadManager = value;\n                Solver.ThreadManager = value;\n                PositionUpdater.ThreadManager = value;\n                DuringForcesUpdateables.ThreadManager = value;\n                BeforeNarrowPhaseUpdateables.ThreadManager = value;\n                EndOfTimeStepUpdateables.ThreadManager = value;\n                EndOfFrameUpdateables.ThreadManager = value;\n            }\n        }\n\n        ///<summary>\n        /// Gets or sets the space object buffer used by the space.\n        /// The space object buffer allows objects to be safely asynchronously\n        /// added to and removed from the space.\n        ///</summary>\n        public SpaceObjectBuffer SpaceObjectBuffer { get; set; }\n        ///<summary>\n        /// Gets or sets the entity state write buffer used by the space.\n        /// The write buffer contains buffered writes to entity states that are\n        /// flushed each frame when the buffer is updated.\n        ///</summary>\n        public EntityStateWriteBuffer EntityStateWriteBuffer { get; set; }\n        ///<summary>\n        /// Gets or sets the deactivation manager used by the space.\n        /// The deactivation manager controls the activity state objects, putting them\n        /// to sleep and managing the connections between objects and simulation islands.\n        ///</summary>\n        public DeactivationManager DeactivationManager { get; set; }\n        ///<summary>\n        /// Gets or sets the force updater used by the space.\n        /// The force updater applies forces to all dynamic objects in the space each frame.\n        ///</summary>\n        public ForceUpdater ForceUpdater { get; set; }\n        ///<summary>\n        /// Gets or sets the bounding box updater used by the space.\n        /// The bounding box updater updates the bounding box of mobile collidables each frame.\n        ///</summary>\n        public BoundingBoxUpdater BoundingBoxUpdater { get; set; }\n        private BroadPhase broadPhase;\n        /// <summary>\n        /// Gets or sets the broad phase used by the space.\n        /// The broad phase finds overlaps between broad phase entries and passes\n        /// them off to the narrow phase for processing.\n        /// </summary>\n        public BroadPhase BroadPhase\n        {\n            get\n            {\n                return broadPhase;\n            }\n            set\n            {\n                broadPhase = value;\n                if (NarrowPhase != null)\n                    if (value != null)\n                    {\n                        NarrowPhase.BroadPhaseOverlaps = broadPhase.Overlaps;\n                    }\n                    else\n                    {\n                        NarrowPhase.BroadPhaseOverlaps = null;\n                    }\n            }\n        }\n        ///<summary>\n        /// Gets or sets the narrow phase used by the space.\n        /// The narrow phase uses overlaps found by the broad phase\n        /// to create pair handlers.  Those pair handlers can go on to \n        /// create things like contacts and constraints.\n        ///</summary>\n        public NarrowPhase NarrowPhase { get; set; }\n        ///<summary>\n        /// Gets or sets the solver used by the space.\n        /// The solver iteratively finds a solution to the constraints in the simulation.\n        ///</summary>\n        public Solver Solver { get; set; }\n        ///<summary>\n        /// Gets or sets the position updater used by the space.\n        /// The position updater moves everything around each frame.\n        ///</summary>\n        public PositionUpdater PositionUpdater { get; set; }\n        ///<summary>\n        /// Gets or sets the buffered states manager used by the space.\n        /// The buffered states manager keeps track of read buffered entity states\n        /// and also interpolated states based on the time remaining from internal\n        /// time steps.\n        ///</summary>\n        public BufferedStatesManager BufferedStates { get; set; }\n        ///<summary>\n        /// Gets or sets the deferred event dispatcher used by the space.\n        /// The event dispatcher gathers up deferred events created\n        /// over the course of a timestep and dispatches them sequentially at the end.\n        ///</summary>\n        public DeferredEventDispatcher DeferredEventDispatcher { get; set; }\n\n        ///<summary>\n        /// Gets or sets the updateable manager that handles updateables that update during force application.\n        ///</summary>\n        public DuringForcesUpdateableManager DuringForcesUpdateables { get; set; }\n        ///<summary>\n        /// Gets or sets the updateable manager that handles updateables that update before the narrow phase.\n        ///</summary>\n        public BeforeNarrowPhaseUpdateableManager BeforeNarrowPhaseUpdateables { get; set; }\n        ///<summary>\n        /// Gets or sets the updateable manager that handles updateables that update before the solver\n        ///</summary>\n        public BeforeSolverUpdateableManager BeforeSolverUpdateables { get; set; }\n        ///<summary>\n        /// Gets or sets the updateable manager that handles updateables that update right before the position update phase.\n        ///</summary>\n        public BeforePositionUpdateUpdateableManager BeforePositionUpdateUpdateables { get; set; }\n        ///<summary>\n        /// Gets or sets the updateable manager that handles updateables that update at the end of a timestep.\n        ///</summary>\n        public EndOfTimeStepUpdateableManager EndOfTimeStepUpdateables { get; set; }\n        ///<summary>\n        /// Gets or sets the updateable manager that handles updateables that update at the end of a frame.\n        ///</summary>\n        public EndOfFrameUpdateableManager EndOfFrameUpdateables { get; set; }\n\n\n        ///<summary>\n        /// Gets the list of entities in the space.\n        ///</summary>\n        public ReadOnlyList<Entity> Entities\n        {\n            get { return BufferedStates.Entities; }\n        }\n\n        ///<summary>\n        /// Constructs a new space for things to live in.\n        /// Uses the SpecializedThreadManager.\n        ///</summary>\n        public Space()\n            : this(new SpecializedThreadManager())\n        {\n        }\n\n        ///<summary>\n        /// Constructs a new space for things to live in.\n        ///</summary>\n        ///<param name=\"threadManager\">Thread manager to use with the space.</param>\n        public Space(IThreadManager threadManager)\n        {\n            timeStepSettings = new TimeStepSettings();\n\n            this.threadManager = threadManager;\n\n            SpaceObjectBuffer = new SpaceObjectBuffer(this);\n            EntityStateWriteBuffer = new EntityStateWriteBuffer();\n            DeactivationManager = new DeactivationManager(TimeStepSettings, ThreadManager);\n            ForceUpdater = new ForceUpdater(TimeStepSettings, ThreadManager);\n            BoundingBoxUpdater = new BoundingBoxUpdater(TimeStepSettings, ThreadManager);\n            BroadPhase = new DynamicHierarchy(ThreadManager);\n            NarrowPhase = new NarrowPhase(TimeStepSettings, BroadPhase.Overlaps, ThreadManager);\n            Solver = new Solver(TimeStepSettings, DeactivationManager, ThreadManager);\n            NarrowPhase.Solver = Solver;\n            PositionUpdater = new ContinuousPositionUpdater(TimeStepSettings, ThreadManager);\n            BufferedStates = new BufferedStatesManager(ThreadManager);\n            DeferredEventDispatcher = new DeferredEventDispatcher();\n\n            DuringForcesUpdateables = new DuringForcesUpdateableManager(timeStepSettings, ThreadManager);\n            BeforeNarrowPhaseUpdateables = new BeforeNarrowPhaseUpdateableManager(timeStepSettings, ThreadManager);\n            BeforeSolverUpdateables = new BeforeSolverUpdateableManager(timeStepSettings, ThreadManager);\n            BeforePositionUpdateUpdateables = new BeforePositionUpdateUpdateableManager(timeStepSettings, ThreadManager);\n            EndOfTimeStepUpdateables = new EndOfTimeStepUpdateableManager(timeStepSettings, ThreadManager);\n            EndOfFrameUpdateables = new EndOfFrameUpdateableManager(timeStepSettings, ThreadManager);\n\n        }\n\n\n        ///<summary>\n        /// Adds a space object to the simulation.\n        ///</summary>\n        ///<param name=\"spaceObject\">Space object to add.</param>\n        public void Add(ISpaceObject spaceObject)\n        {\n            if (spaceObject.Space != null)\n                throw new ArgumentException(\"The object belongs to some Space already; cannot add it again.\");\n            spaceObject.Space = this;\n\n            SimulationIslandMember simulationIslandMember = spaceObject as SimulationIslandMember;\n            if (simulationIslandMember != null)\n            {\n                DeactivationManager.Add(simulationIslandMember);\n            }\n\n            ISimulationIslandMemberOwner simulationIslandMemberOwner = spaceObject as ISimulationIslandMemberOwner;\n            if (simulationIslandMemberOwner != null)\n            {\n                DeactivationManager.Add(simulationIslandMemberOwner.ActivityInformation);\n            }\n\n            //Go through each stage, adding the space object to it if necessary.\n            IForceUpdateable velocityUpdateable = spaceObject as IForceUpdateable;\n            if (velocityUpdateable != null)\n            {\n                ForceUpdater.Add(velocityUpdateable);\n            }\n\n            MobileCollidable boundingBoxUpdateable = spaceObject as MobileCollidable;\n            if (boundingBoxUpdateable != null)\n            {\n                BoundingBoxUpdater.Add(boundingBoxUpdateable);\n            }\n\n            BroadPhaseEntry broadPhaseEntry = spaceObject as BroadPhaseEntry;\n            if (broadPhaseEntry != null)\n            {\n                BroadPhase.Add(broadPhaseEntry);\n            }\n\n            //Entites own collision proxies, but are not entries themselves.\n            IBroadPhaseEntryOwner broadPhaseEntryOwner = spaceObject as IBroadPhaseEntryOwner;\n            if (broadPhaseEntryOwner != null)\n            {\n                BroadPhase.Add(broadPhaseEntryOwner.Entry);\n                boundingBoxUpdateable = broadPhaseEntryOwner.Entry as MobileCollidable;\n                if (boundingBoxUpdateable != null)\n                {\n                    BoundingBoxUpdater.Add(boundingBoxUpdateable);\n                }\n            }\n\n            SolverUpdateable solverUpdateable = spaceObject as SolverUpdateable;\n            if (solverUpdateable != null)\n            {\n                Solver.Add(solverUpdateable);\n            }\n\n            IPositionUpdateable integrable = spaceObject as IPositionUpdateable;\n            if (integrable != null)\n            {\n                PositionUpdater.Add(integrable);\n            }\n\n            Entity entity = spaceObject as Entity;\n            if (entity != null)\n            {\n                BufferedStates.Add(entity);\n            }\n\n            IDeferredEventCreator deferredEventCreator = spaceObject as IDeferredEventCreator;\n            if (deferredEventCreator != null)\n            {\n                DeferredEventDispatcher.AddEventCreator(deferredEventCreator);\n            }\n\n            IDeferredEventCreatorOwner deferredEventCreatorOwner = spaceObject as IDeferredEventCreatorOwner;\n            if (deferredEventCreatorOwner != null)\n            {\n                DeferredEventDispatcher.AddEventCreator(deferredEventCreatorOwner.EventCreator);\n            }\n\n            //Updateable stages.\n            IDuringForcesUpdateable duringForcesUpdateable = spaceObject as IDuringForcesUpdateable;\n            if (duringForcesUpdateable != null)\n            {\n                DuringForcesUpdateables.Add(duringForcesUpdateable);\n            }\n\n            IBeforeNarrowPhaseUpdateable beforeNarrowPhaseUpdateable = spaceObject as IBeforeNarrowPhaseUpdateable;\n            if (beforeNarrowPhaseUpdateable != null)\n            {\n                BeforeNarrowPhaseUpdateables.Add(beforeNarrowPhaseUpdateable);\n            }\n\n            IBeforeSolverUpdateable beforeSolverUpdateable = spaceObject as IBeforeSolverUpdateable;\n            if (beforeSolverUpdateable != null)\n            {\n                BeforeSolverUpdateables.Add(beforeSolverUpdateable);\n            }\n\n            IBeforePositionUpdateUpdateable beforePositionUpdateUpdateable = spaceObject as IBeforePositionUpdateUpdateable;\n            if (beforePositionUpdateUpdateable != null)\n            {\n                BeforePositionUpdateUpdateables.Add(beforePositionUpdateUpdateable);\n            }\n\n            IEndOfTimeStepUpdateable endOfStepUpdateable = spaceObject as IEndOfTimeStepUpdateable;\n            if (endOfStepUpdateable != null)\n            {\n                EndOfTimeStepUpdateables.Add(endOfStepUpdateable);\n            }\n\n            IEndOfFrameUpdateable endOfFrameUpdateable = spaceObject as IEndOfFrameUpdateable;\n            if (endOfFrameUpdateable != null)\n            {\n                EndOfFrameUpdateables.Add(endOfFrameUpdateable);\n            }\n\n            spaceObject.OnAdditionToSpace(this);\n        }\n\n        ///<summary>\n        /// Removes a space object from the simulation.\n        ///</summary>\n        ///<param name=\"spaceObject\">Space object to remove.</param>\n        public void Remove(ISpaceObject spaceObject)\n        {\n            if (spaceObject.Space != this) // HACK\n                return;\n\n            SimulationIslandMember simulationIslandMember = spaceObject as SimulationIslandMember;\n            if (simulationIslandMember != null)\n            {\n                DeactivationManager.Remove(simulationIslandMember);\n            }\n\n            ISimulationIslandMemberOwner simulationIslandMemberOwner = spaceObject as ISimulationIslandMemberOwner;\n            if (simulationIslandMemberOwner != null)\n            {\n                DeactivationManager.Remove(simulationIslandMemberOwner.ActivityInformation);\n            }\n\n            //Go through each stage, removing the space object from it if necessary.\n            IForceUpdateable velocityUpdateable = spaceObject as IForceUpdateable;\n            if (velocityUpdateable != null)\n            {\n                ForceUpdater.Remove(velocityUpdateable);\n            }\n\n            MobileCollidable boundingBoxUpdateable = spaceObject as MobileCollidable;\n            if (boundingBoxUpdateable != null)\n            {\n                BoundingBoxUpdater.Remove(boundingBoxUpdateable);\n            }\n\n            BroadPhaseEntry broadPhaseEntry = spaceObject as BroadPhaseEntry;\n            if (broadPhaseEntry != null)\n            {\n                BroadPhase.Remove(broadPhaseEntry);\n            }\n\n            //Entites own collision proxies, but are not entries themselves.\n            IBroadPhaseEntryOwner broadPhaseEntryOwner = spaceObject as IBroadPhaseEntryOwner;\n            if (broadPhaseEntryOwner != null)\n            {\n                BroadPhase.Remove(broadPhaseEntryOwner.Entry);\n                boundingBoxUpdateable = broadPhaseEntryOwner.Entry as MobileCollidable;\n                if (boundingBoxUpdateable != null)\n                {\n                    BoundingBoxUpdater.Remove(boundingBoxUpdateable);\n                }\n            }\n\n            SolverUpdateable solverUpdateable = spaceObject as SolverUpdateable;\n            if (solverUpdateable != null)\n            {\n                Solver.Remove(solverUpdateable);\n            }\n\n            IPositionUpdateable integrable = spaceObject as IPositionUpdateable;\n            if (integrable != null)\n            {\n                PositionUpdater.Remove(integrable);\n            }\n\n            Entity entity = spaceObject as Entity;\n            if (entity != null)\n            {\n                BufferedStates.Remove(entity);\n            }\n\n            IDeferredEventCreator deferredEventCreator = spaceObject as IDeferredEventCreator;\n            if (deferredEventCreator != null)\n            {\n                DeferredEventDispatcher.RemoveEventCreator(deferredEventCreator);\n            }\n\n            IDeferredEventCreatorOwner deferredEventCreatorOwner = spaceObject as IDeferredEventCreatorOwner;\n            if (deferredEventCreatorOwner != null)\n            {\n                DeferredEventDispatcher.RemoveEventCreator(deferredEventCreatorOwner.EventCreator);\n            }\n\n            //Updateable stages.\n            IDuringForcesUpdateable duringForcesUpdateable = spaceObject as IDuringForcesUpdateable;\n            if (duringForcesUpdateable != null)\n            {\n                DuringForcesUpdateables.Remove(duringForcesUpdateable);\n            }\n\n            IBeforeNarrowPhaseUpdateable beforeNarrowPhaseUpdateable = spaceObject as IBeforeNarrowPhaseUpdateable;\n            if (beforeNarrowPhaseUpdateable != null)\n            {\n                BeforeNarrowPhaseUpdateables.Remove(beforeNarrowPhaseUpdateable);\n            }\n\n            IBeforeSolverUpdateable beforeSolverUpdateable = spaceObject as IBeforeSolverUpdateable;\n            if (beforeSolverUpdateable != null)\n            {\n                BeforeSolverUpdateables.Remove(beforeSolverUpdateable);\n            }\n\n\n            IBeforePositionUpdateUpdateable beforePositionUpdateUpdateable = spaceObject as IBeforePositionUpdateUpdateable;\n            if (beforePositionUpdateUpdateable != null)\n            {\n                BeforePositionUpdateUpdateables.Remove(beforePositionUpdateUpdateable);\n            }\n\n            IEndOfTimeStepUpdateable endOfStepUpdateable = spaceObject as IEndOfTimeStepUpdateable;\n            if (endOfStepUpdateable != null)\n            {\n                EndOfTimeStepUpdateables.Remove(endOfStepUpdateable);\n            }\n\n            IEndOfFrameUpdateable endOfFrameUpdateable = spaceObject as IEndOfFrameUpdateable;\n            if (endOfFrameUpdateable != null)\n            {\n                EndOfFrameUpdateables.Remove(endOfFrameUpdateable);\n            }\n\n            spaceObject.Space = null;\n            spaceObject.OnRemovalFromSpace(this);\n        }\n\n#if PROFILE\n        /// <summary>\n        /// Gets the time it took to perform the previous time step.\n        /// </summary>\n        public double Time\n        {\n            get { return (end - start) / (double)Stopwatch.Frequency; }\n        }\n\n        private long start, end;\n#endif\n\n        void DoTimeStep()\n        {\n#if PROFILE\n            start = Stopwatch.GetTimestamp();\n#endif\n            SpaceObjectBuffer.Update();\n            EntityStateWriteBuffer.Update();\n            DeactivationManager.Update();\n            ForceUpdater.Update();\n            DuringForcesUpdateables.Update();\n            BoundingBoxUpdater.Update();\n            BroadPhase.Update();\n            BeforeNarrowPhaseUpdateables.Update();\n            NarrowPhase.Update();\n            BeforeSolverUpdateables.Update();\n            Solver.Update();\n            BeforePositionUpdateUpdateables.Update();\n            PositionUpdater.Update();\n            BufferedStates.ReadBuffers.Update();\n            DeferredEventDispatcher.Update();\n            EndOfTimeStepUpdateables.Update();\n#if PROFILE\n            end = Stopwatch.GetTimestamp();\n#endif\n\n\n        }\n\n        ///<summary>\n        /// Performs a single timestep.\n        ///</summary>\n        public void Update()\n        {\n            DoTimeStep();\n            EndOfFrameUpdateables.Update();\n        }\n\n        /// <summary>\n        /// Performs as many timesteps as necessary to get as close to the elapsed time as possible.\n        /// </summary>\n        /// <param name=\"dt\">Elapsed time from the previous frame.</param>\n        public void Update(float dt)\n        {\n            TimeStepSettings.AccumulatedTime += dt;\n            for (int i = 0; i < TimeStepSettings.MaximumTimeStepsPerFrame; i++)\n            {\n                if (TimeStepSettings.AccumulatedTime >= TimeStepSettings.TimeStepDuration)\n                {\n                    TimeStepSettings.AccumulatedTime -= TimeStepSettings.TimeStepDuration;\n                    DoTimeStep();\n                }\n                else\n                {\n                    break;\n                }\n            }\n\n            BufferedStates.InterpolatedStates.BlendAmount = TimeStepSettings.AccumulatedTime / TimeStepSettings.TimeStepDuration;\n            BufferedStates.InterpolatedStates.Update();\n            EndOfFrameUpdateables.Update();\n        }\n\n        /// <summary>\n        /// Tests a ray against the space.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"result\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        public bool RayCast(Ray ray, out RayCastResult result)\n        {\n            return RayCast(ray, float.MaxValue, out result);\n        }\n\n        /// <summary>\n        /// Tests a ray against the space.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"filter\">Delegate to prune out hit candidates before performing a ray cast against them. Return true from the filter to process an entry or false to ignore the entry.</param>\n        /// <param name=\"result\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        public bool RayCast(Ray ray, Func<BroadPhaseEntry, bool> filter, out RayCastResult result)\n        {\n            return RayCast(ray, float.MaxValue, filter, out result);\n        }\n\n        /// <summary>\n        /// Tests a ray against the space.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        /// <param name=\"result\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        public bool RayCast(Ray ray, float maximumLength, out RayCastResult result)\n        {\n            var resultsList = PhysicsResources.GetRayCastResultList();\n            bool didHit = RayCast(ray, maximumLength, resultsList);\n            result = resultsList.Elements[0];\n            for (int i = 1; i < resultsList.Count; i++)\n            {\n                RayCastResult candidate = resultsList.Elements[i];\n                if (candidate.HitData.T < result.HitData.T)\n                    result = candidate;\n            }\n            PhysicsResources.GiveBack(resultsList);\n\n            return didHit;\n        }\n\n        /// <summary>\n        /// Tests a ray against the space.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        /// <param name=\"filter\">Delegate to prune out hit candidates before performing a ray cast against them. Return true from the filter to process an entry or false to ignore the entry.</param>\n        /// <param name=\"result\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        public bool RayCast(Ray ray, float maximumLength, Func<BroadPhaseEntry, bool> filter, out RayCastResult result)\n        {\n            var resultsList = PhysicsResources.GetRayCastResultList();\n            bool didHit = RayCast(ray, maximumLength, filter, resultsList);\n            result = resultsList.Elements[0];\n            for (int i = 1; i < resultsList.Count; i++)\n            {\n                RayCastResult candidate = resultsList.Elements[i];\n                if (candidate.HitData.T < result.HitData.T)\n                    result = candidate;\n            }\n            PhysicsResources.GiveBack(resultsList);\n\n            return didHit;\n        }\n\n        /// <summary>\n        /// Tests a ray against the space, possibly returning multiple hits.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        /// <param name=\"outputRayCastResults\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        public bool RayCast(Ray ray, float maximumLength, IList<RayCastResult> outputRayCastResults)\n        {\n            var outputIntersections = PhysicsResources.GetBroadPhaseEntryList();\n            if (BroadPhase.QueryAccelerator.RayCast(ray, maximumLength, outputIntersections))\n            {\n\n                for (int i = 0; i < outputIntersections.Count; i++)\n                {\n                    RayHit rayHit;\n                    BroadPhaseEntry candidate = outputIntersections.Elements[i];\n                    if (candidate.RayCast(ray, maximumLength, out rayHit))\n                    {\n                        outputRayCastResults.Add(new RayCastResult(rayHit, candidate));\n                    }\n                }\n            }\n            PhysicsResources.GiveBack(outputIntersections);\n            return outputRayCastResults.Count > 0;\n        }\n\n        /// <summary>\n        /// Tests a ray against the space, possibly returning multiple hits.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        /// <param name=\"filter\">Delegate to prune out hit candidates before performing a cast against them. Return true from the filter to process an entry or false to ignore the entry.</param>\n        /// <param name=\"outputRayCastResults\">Hit data of the ray, if any.</param>\n        /// <returns>Whether or not the ray hit anything.</returns>\n        public bool RayCast(Ray ray, float maximumLength, Func<BroadPhaseEntry, bool> filter, IList<RayCastResult> outputRayCastResults)\n        {\n            var outputIntersections = PhysicsResources.GetBroadPhaseEntryList();\n            if (BroadPhase.QueryAccelerator.RayCast(ray, maximumLength, outputIntersections))\n            {\n\n                for (int i = 0; i < outputIntersections.Count; i++)\n                {\n                    RayHit rayHit;\n                    BroadPhaseEntry candidate = outputIntersections.Elements[i];\n                    if (candidate.RayCast(ray, maximumLength, filter, out rayHit))\n                    {\n                        outputRayCastResults.Add(new RayCastResult(rayHit, candidate));\n                    }\n                }\n            }\n            PhysicsResources.GiveBack(outputIntersections);\n            return outputRayCastResults.Count > 0;\n        }\n\n        /// <summary>\n        /// <para>Casts a convex shape against the space.</para>\n        /// <para>Convex casts are sensitive to length; avoid extremely long convex casts for better stability and performance.</para>\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape. Avoid extremely long convex casts for better stability and performance.</param>\n        /// <param name=\"castResult\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, out RayCastResult castResult)\n        {\n            var castResults = PhysicsResources.GetRayCastResultList();\n            bool didHit = ConvexCast(castShape, ref startingTransform, ref sweep, castResults);\n            castResult = castResults.Elements[0];\n            for (int i = 1; i < castResults.Count; i++)\n            {\n                RayCastResult candidate = castResults.Elements[i];\n                if (candidate.HitData.T < castResult.HitData.T)\n                    castResult = candidate;\n            }\n            PhysicsResources.GiveBack(castResults);\n            return didHit;\n        }\n\n        /// <summary>\n        /// <para>Casts a convex shape against the space.</para>\n        /// <para>Convex casts are sensitive to length; avoid extremely long convex casts for better stability and performance.</para>\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape. Avoid extremely long convex casts for better stability and performance.</param>\n        /// <param name=\"filter\">Delegate to prune out hit candidates before performing a cast against them. Return true from the filter to process an entry or false to ignore the entry.</param>\n        /// <param name=\"castResult\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, Func<BroadPhaseEntry, bool> filter, out RayCastResult castResult)\n        {\n            var castResults = PhysicsResources.GetRayCastResultList();\n            bool didHit = ConvexCast(castShape, ref startingTransform, ref sweep, filter, castResults);\n            castResult = castResults.Elements[0];\n            for (int i = 1; i < castResults.Count; i++)\n            {\n                RayCastResult candidate = castResults.Elements[i];\n                if (candidate.HitData.T < castResult.HitData.T)\n                    castResult = candidate;\n            }\n            PhysicsResources.GiveBack(castResults);\n            return didHit;\n        }\n\n        /// <summary>\n        /// <para>Casts a convex shape against the space.</para>\n        /// <para>Convex casts are sensitive to length; avoid extremely long convex casts for better stability and performance.</para>\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape. Avoid extremely long convex casts for better stability and performance.</param>\n        /// <param name=\"outputCastResults\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, IList<RayCastResult> outputCastResults)\n        {\n            var overlappedElements = PhysicsResources.GetBroadPhaseEntryList();\n            BoundingBox boundingBox;\n            castShape.GetSweptBoundingBox(ref startingTransform, ref sweep, out boundingBox);\n\n            BroadPhase.QueryAccelerator.GetEntries(boundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; ++i)\n            {\n                RayHit hit;\n                if (overlappedElements.Elements[i].ConvexCast(castShape, ref startingTransform, ref sweep, out hit))\n                {\n                    outputCastResults.Add(new RayCastResult { HitData = hit, HitObject = overlappedElements.Elements[i] });\n                }\n            }\n            PhysicsResources.GiveBack(overlappedElements);\n            return outputCastResults.Count > 0;\n        }\n\n        /// <summary>\n        /// <para>Casts a convex shape against the space.</para>\n        /// <para>Convex casts are sensitive to length; avoid extremely long convex casts for better stability and performance.</para>\n        /// </summary>\n        /// <param name=\"castShape\">Shape to cast.</param>\n        /// <param name=\"startingTransform\">Initial transform of the shape.</param>\n        /// <param name=\"sweep\">Sweep to apply to the shape. Avoid extremely long convex casts for better stability and performance.</param>\n        /// <param name=\"filter\">Delegate to prune out hit candidates before performing a cast against them. Return true from the filter to process an entry or false to ignore the entry.</param>\n        /// <param name=\"outputCastResults\">Hit data, if any.</param>\n        /// <returns>Whether or not the cast hit anything.</returns>\n        public bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, Func<BroadPhaseEntry, bool> filter, IList<RayCastResult> outputCastResults)\n        {\n            var overlappedElements = PhysicsResources.GetBroadPhaseEntryList();\n            BoundingBox boundingBox;\n            castShape.GetSweptBoundingBox(ref startingTransform, ref sweep, out boundingBox);\n\n            BroadPhase.QueryAccelerator.GetEntries(boundingBox, overlappedElements);\n            for (int i = 0; i < overlappedElements.Count; ++i)\n            {\n                RayHit hit;\n                if (overlappedElements.Elements[i].ConvexCast(castShape, ref startingTransform, ref sweep, filter, out hit))\n                {\n                    outputCastResults.Add(new RayCastResult { HitData = hit, HitObject = overlappedElements.Elements[i] });\n                }\n            }\n            PhysicsResources.GiveBack(overlappedElements);\n            return outputCastResults.Count > 0;\n        }\n\n\n        bool disposed;\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            if (!disposed)\n            {\n                disposed = true;\n                ThreadManager.Dispose();\n            }\n        }\n    }\n\n\n}\n"
  },
  {
    "path": "BEPUphysics/StyleCop.Cache",
    "content": "<stylecopresultscache>\n  <version>10</version>\n  <sourcecode name=\"BoundingBoxTree.cs\" parser=\"Microsoft.StyleCop.CSharp.CsParser\">\n    <settings>\n      <timestamp>06/30/2010 11:43:56</timestamp>\n      <milliseconds>0</milliseconds>\n    </settings>\n    <timestamp>10/22/2010 20:31:19</timestamp>\n    <milliseconds>604</milliseconds>\n    <violations>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"FileMustHaveHeader\" ruleCheckId=\"SA1633\">\n        <context>The file has no header, the header Xml is invalid, or the header is not located at the top of the file.</context>\n        <line>1</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>1</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>2</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBeOrderedAlphabeticallyByNamespace\" ruleCheckId=\"SA1210\">\n        <context>Using directives must be sorted alphabetically by the namespaces.</context>\n        <line>2</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>3</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBeOrderedAlphabeticallyByNamespace\" ruleCheckId=\"SA1210\">\n        <context>Using directives must be sorted alphabetically by the namespaces.</context>\n        <line>3</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>4</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBeOrderedAlphabeticallyByNamespace\" ruleCheckId=\"SA1210\">\n        <context>Using directives must be sorted alphabetically by the namespaces.</context>\n        <line>4</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>5</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>6</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"SystemUsingDirectivesMustBePlacedBeforeOtherUsingDirectives\" ruleCheckId=\"SA1208\">\n        <context>System using directives must be placed before all other using directives.</context>\n        <line>6</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>7</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The class must have a documentation header.</context>\n        <line>11</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The field must have a documentation header.</context>\n        <line>13</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.MaintainabilityRules\" rule=\"AccessModifierMustBeDeclared\" ruleCheckId=\"SA1400\">\n        <context>The field must have an access modifier.</context>\n        <line>13</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The constructor must have a documentation header.</context>\n        <line>15</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.ReadabilityRules\" rule=\"PrefixLocalCallsWithThis\" ruleCheckId=\"SA1101\">\n        <context>The call to Reconstruct must begin with the 'this.' prefix to indicate that the item is a member of the class.</context>\n        <line>17</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The method must have a documentation header.</context>\n        <line>20</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"CurlyBracketsMustNotBeOmitted\" ruleCheckId=\"SA1503\">\n        <context>The body of the if statement must be wrapped in opening and closing curly brackets.</context>\n        <line>28</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"CurlyBracketsMustNotBeOmitted\" ruleCheckId=\"SA1503\">\n        <context>The body of the if statement must be wrapped in opening and closing curly brackets.</context>\n        <line>30</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"CurlyBracketsMustNotBeOmitted\" ruleCheckId=\"SA1503\">\n        <context>The body of the if statement must be wrapped in opening and closing curly brackets.</context>\n        <line>32</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"CurlyBracketsMustNotBeOmitted\" ruleCheckId=\"SA1503\">\n        <context>The body of the if statement must be wrapped in opening and closing curly brackets.</context>\n        <line>35</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"CurlyBracketsMustNotBeOmitted\" ruleCheckId=\"SA1503\">\n        <context>The body of the if statement must be wrapped in opening and closing curly brackets.</context>\n        <line>37</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"CurlyBracketsMustNotBeOmitted\" ruleCheckId=\"SA1503\">\n        <context>The body of the if statement must be wrapped in opening and closing curly brackets.</context>\n        <line>39</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.MaintainabilityRules\" rule=\"AccessModifierMustBeDeclared\" ruleCheckId=\"SA1400\">\n        <context>The method must have an access modifier.</context>\n        <line>20</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"ElementsMustBeOrderedByAccess\" ruleCheckId=\"SA1202\">\n        <context>All private methods must be placed after all public methods.</context>\n        <line>43</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"ElementsMustBeOrderedByAccess\" ruleCheckId=\"SA1202\">\n        <context>All private methods must be placed after all public methods.</context>\n        <line>66</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The method must have a documentation header.</context>\n        <line>43</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.MaintainabilityRules\" rule=\"ArithmeticExpressionsMustDeclarePrecedence\" ruleCheckId=\"SA1407\">\n        <context>Insert parenthesis within the arithmetic expression to declare the operator precedence.</context>\n        <line>46</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.ReadabilityRules\" rule=\"PrefixLocalCallsWithThis\" ruleCheckId=\"SA1101\">\n        <context>The call to nodeArray must begin with the 'this.' prefix to indicate that the item is a member of the class.</context>\n        <line>56</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.ReadabilityRules\" rule=\"PrefixLocalCallsWithThis\" ruleCheckId=\"SA1101\">\n        <context>The call to nodeArray must begin with the 'this.' prefix to indicate that the item is a member of the class.</context>\n        <line>54</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.ReadabilityRules\" rule=\"PrefixLocalCallsWithThis\" ruleCheckId=\"SA1101\">\n        <context>The call to ReconstructNode must begin with the 'this.' prefix to indicate that the item is a member of the class.</context>\n        <line>59</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.SpacingRules\" rule=\"SingleLineCommentsMustBeginWithSingleSpace\" ruleCheckId=\"SA1005\">\n        <context>The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.</context>\n        <line>45</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The method must have a documentation header.</context>\n        <line>62</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.MaintainabilityRules\" rule=\"AccessModifierMustBeDeclared\" ruleCheckId=\"SA1400\">\n        <context>The method must have an access modifier.</context>\n        <line>62</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The method must have a documentation header.</context>\n        <line>66</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.ReadabilityRules\" rule=\"PrefixLocalCallsWithThis\" ruleCheckId=\"SA1101\">\n        <context>The call to Refit must begin with the 'this.' prefix to indicate that the item is a member of the class.</context>\n        <line>68</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The method must have a documentation header.</context>\n        <line>71</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"SingleLineCommentMustBePrecededByBlankLine\" ruleCheckId=\"SA1515\">\n        <context>A single-line comment must be preceded by a blank line or another single-line comment, or must be the first item in its scope. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.</context>\n        <line>77</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.MaintainabilityRules\" rule=\"AccessModifierMustBeDeclared\" ruleCheckId=\"SA1400\">\n        <context>The method must have an access modifier.</context>\n        <line>71</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.ReadabilityRules\" rule=\"PrefixLocalCallsWithThis\" ruleCheckId=\"SA1101\">\n        <context>The call to nodeArray must begin with the 'this.' prefix to indicate that the item is a member of the class.</context>\n        <line>76</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.ReadabilityRules\" rule=\"PrefixLocalCallsWithThis\" ruleCheckId=\"SA1101\">\n        <context>The call to nodeArray must begin with the 'this.' prefix to indicate that the item is a member of the class.</context>\n        <line>74</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.ReadabilityRules\" rule=\"PrefixLocalCallsWithThis\" ruleCheckId=\"SA1101\">\n        <context>The call to Refit must begin with the 'this.' prefix to indicate that the item is a member of the class.</context>\n        <line>85</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.ReadabilityRules\" rule=\"PrefixLocalCallsWithThis\" ruleCheckId=\"SA1101\">\n        <context>The call to Refit must begin with the 'this.' prefix to indicate that the item is a member of the class.</context>\n        <line>87</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.ReadabilityRules\" rule=\"PrefixLocalCallsWithThis\" ruleCheckId=\"SA1101\">\n        <context>The call to nodeArray must begin with the 'this.' prefix to indicate that the item is a member of the class.</context>\n        <line>88</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.SpacingRules\" rule=\"SingleLineCommentsMustBeginWithSingleSpace\" ruleCheckId=\"SA1005\">\n        <context>The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.</context>\n        <line>77</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.SpacingRules\" rule=\"SingleLineCommentsMustBeginWithSingleSpace\" ruleCheckId=\"SA1005\">\n        <context>The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.</context>\n        <line>81</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.SpacingRules\" rule=\"SingleLineCommentsMustBeginWithSingleSpace\" ruleCheckId=\"SA1005\">\n        <context>The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.</context>\n        <line>82</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.SpacingRules\" rule=\"SingleLineCommentsMustBeginWithSingleSpace\" ruleCheckId=\"SA1005\">\n        <context>The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.</context>\n        <line>83</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The struct must have a documentation header.</context>\n        <line>92</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"CodeMustNotContainMultipleBlankLinesInARow\" ruleCheckId=\"SA1507\">\n        <context>The code must not contain multiple blank lines in a row.</context>\n        <line>97</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"ClosingCurlyBracketsMustNotBePrecededByBlankLine\" ruleCheckId=\"SA1508\">\n        <context>A closing curly bracket must not be preceded by a blank line.</context>\n        <line>98</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.MaintainabilityRules\" rule=\"AccessModifierMustBeDeclared\" ruleCheckId=\"SA1400\">\n        <context>The struct must have an access modifier.</context>\n        <line>92</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The field must have a documentation header.</context>\n        <line>94</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The field must have a documentation header.</context>\n        <line>95</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.NamingRules\" rule=\"AccessibleFieldsMustBeginWithUpperCaseLetter\" ruleCheckId=\"SA1307\">\n        <context>Public and internal fields must start with an upper-case letter: value.</context>\n        <line>95</line>\n        <warning>False</warning>\n      </violation>\n    </violations>\n  </sourcecode>\n  <project key=\"-1870117806\">\n    <configuration>TRACE;WINDOWS</configuration>\n  </project>\n  <sourcecode name=\"ContactCandidateGenerator.cs\" parser=\"Microsoft.StyleCop.CSharp.CsParser\">\n    <settings>\n      <timestamp>06/30/2010 11:43:56</timestamp>\n      <milliseconds>0</milliseconds>\n    </settings>\n    <timestamp>10/30/2010 18:41:28</timestamp>\n    <milliseconds>690</milliseconds>\n    <violations>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"FileMustHaveHeader\" ruleCheckId=\"SA1633\">\n        <context>The file has no header, the header Xml is invalid, or the header is not located at the top of the file.</context>\n        <line>1</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>1</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>2</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>3</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>4</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>5</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBeOrderedAlphabeticallyByNamespace\" ruleCheckId=\"SA1210\">\n        <context>Using directives must be sorted alphabetically by the namespaces.</context>\n        <line>5</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>6</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBeOrderedAlphabeticallyByNamespace\" ruleCheckId=\"SA1210\">\n        <context>Using directives must be sorted alphabetically by the namespaces.</context>\n        <line>6</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>7</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBeOrderedAlphabeticallyByNamespace\" ruleCheckId=\"SA1210\">\n        <context>Using directives must be sorted alphabetically by the namespaces.</context>\n        <line>7</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"UsingDirectivesMustBePlacedWithinNamespace\" ruleCheckId=\"SA1200\">\n        <context>All using directives must be placed inside of the namespace.</context>\n        <line>8</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"ClosingCurlyBracketsMustNotBePrecededByBlankLine\" ruleCheckId=\"SA1508\">\n        <context>A closing curly bracket must not be preceded by a blank line.</context>\n        <line>30</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The class must have a documentation header.</context>\n        <line>12</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"ClosingCurlyBracketsMustNotBePrecededByBlankLine\" ruleCheckId=\"SA1508\">\n        <context>A closing curly bracket must not be preceded by a blank line.</context>\n        <line>28</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The constructor must have a documentation header.</context>\n        <line>16</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.OrderingRules\" rule=\"ElementsMustAppearInTheCorrectOrder\" ruleCheckId=\"SA1201\">\n        <context>All constructors must be placed after all fields.</context>\n        <line>16</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The field must have a documentation header.</context>\n        <line>22</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.MaintainabilityRules\" rule=\"FieldsMustBePrivate\" ruleCheckId=\"SA1401\">\n        <context>Fields must be declared with private access. Use properties to expose fields.</context>\n        <line>22</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.NamingRules\" rule=\"AccessibleFieldsMustBeginWithUpperCaseLetter\" ruleCheckId=\"SA1307\">\n        <context>Public and internal fields must start with an upper-case letter: shapeA.</context>\n        <line>22</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The field must have a documentation header.</context>\n        <line>23</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.MaintainabilityRules\" rule=\"FieldsMustBePrivate\" ruleCheckId=\"SA1401\">\n        <context>Fields must be declared with private access. Use properties to expose fields.</context>\n        <line>23</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.NamingRules\" rule=\"AccessibleFieldsMustBeginWithUpperCaseLetter\" ruleCheckId=\"SA1307\">\n        <context>Public and internal fields must start with an upper-case letter: shapeB.</context>\n        <line>23</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The property must have a documentation header.</context>\n        <line>25</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.DocumentationRules\" rule=\"ElementsMustBeDocumented\" ruleCheckId=\"SA1600\">\n        <context>The property must have a documentation header.</context>\n        <line>26</line>\n        <warning>False</warning>\n      </violation>\n      <violation namespace=\"Microsoft.StyleCop.CSharp.LayoutRules\" rule=\"ElementsMustBeSeparatedByBlankLine\" ruleCheckId=\"SA1516\">\n        <context>Adjacent elements must be separated by a blank line.</context>\n        <line>26</line>\n        <warning>False</warning>\n      </violation>\n    </violations>\n  </sourcecode>\n</stylecopresultscache>"
  },
  {
    "path": "BEPUphysics/Threading/IThreadManager.cs",
    "content": "using System;\n\nnamespace BEPUphysics.Threading\n{\n\n    /// <summary>\n    /// Manages the engine's threads.\n    /// </summary>\n    /// <remarks>\n    /// The thread manager is constructed with certain access assumptions in mind.\n    /// When implementing custom thread managers, ensure that the requirements are met\n    /// or exceeded with regard to concurrent access.\n    /// </remarks>\n    public interface IThreadManager : IDisposable\n    {\n        /// <summary>\n        /// Gets the number of threads currently managed by the thread manager.\n        /// </summary>\n        int ThreadCount { get; }\n\n        /// <summary>\n        /// Adds a new worker thread to the engine.\n        /// </summary>\n        void AddThread();\n\n        /// <summary>\n        /// Adds a new worker thread to the engine.\n        /// </summary>\n        /// <param name=\"initialization\">Function that the new thread will call before entering its work loop.</param>\n        /// <param name=\"initializationInformation\">Data to give the initializer.</param>\n        void AddThread(Action<object> initialization, object initializationInformation);\n\n        /// <summary>\n        /// Enqueues a task to the thread manager.\n        /// This should be safe to call from multiple threads and from other tasks.\n        /// </summary>\n        /// <param name=\"taskBody\">Method to run.</param>\n        /// <param name=\"taskInformation\">Data to give to the task.</param>\n        void EnqueueTask(Action<object> taskBody, object taskInformation);\n\n        /// <summary>\n        /// Loops from the starting index (inclusive) to the ending index (exclusive), calling the loopBody at each iteration.\n        /// The forLoop function will not return until all iterations are complete.\n        /// This is meant to be used in a 'fork-join' model; only a single thread should be running a forLoop\n        /// at any time.\n        /// </summary>\n        /// <param name=\"startIndex\">Inclusive starting index.</param>\n        /// <param name=\"endIndex\">Exclusive ending index.</param>\n        /// <param name=\"loopBody\">Function that handles an individual iteration of the loop.</param>\n        void ForLoop(int startIndex, int endIndex, Action<int> loopBody);\n\n        /// <summary>\n        /// Removes a worker thread from the engine.\n        /// </summary>\n        void RemoveThread();\n\n        /// <summary>\n        /// Waits until all tasks enqueued using enqueueTask are complete.\n        /// </summary>\n        void WaitForTaskCompletion();\n\n        //optional; if non-setting enqueue is added, doTasks is needed.\n        //non-setting enqueue\n        //doTasks\n    }\n}"
  },
  {
    "path": "BEPUphysics/Threading/Modified Pool/ParallelLoopManager.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Threading;\n\nnamespace BEPUphysics.Threading\n{\n    /// <summary>\n    /// Manages parallel for loops.\n    /// Cannot handle general task-based parallelism.\n    /// </summary>\n    public class ParallelLoopManager : IDisposable\n    {\n        private readonly AutoResetEvent loopFinished;\n        private int workerCount;\n\n        internal List<ParallelLoopWorker> workers = new List<ParallelLoopWorker>();\n        //internal SemaphoreSlim workerWaker;\n\n        internal int currentBeginIndex, currentEndIndex;\n        internal Action<int> currentLoopBody;\n        internal int iterationsPerSteal;\n\n        /// <summary>\n        /// Gets or sets the minimum number of tasks to be allocated to each thread\n        /// per loop.\n        /// </summary>\n        public int MinimumTasksPerThread\n        {\n            get { return minimumTasksPerThread; }\n            set { minimumTasksPerThread = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum number of loop iterations\n        /// per individual task.\n        /// </summary>\n        public int MaximumIterationsPerTask\n        {\n            get { return maximumIterationsPerTask; }\n            set { maximumIterationsPerTask = value; }\n        }\n\n#if WINDOWS\n        private int minimumTasksPerThread = 3;\n        private int maximumIterationsPerTask = 80;\n#else\n        int minimumTasksPerThread = 3;\n        int maximumIterationsPerTask = 80;\n#endif\n        internal int jobIndex;\n        internal int maxJobIndex;\n\n        /// <summary>\n        /// Constructs a new parallel loop manager.\n        /// </summary>\n        public ParallelLoopManager()\n        {\n            loopFinished = new AutoResetEvent(false);\n            //workerWaker = new SemaphoreSlim(0);\n        }\n\n        internal void AddThread()\n        {\n            AddThread(null, null);\n        }\n\n        internal void AddThread(Action<object> threadStart, object threadStartInformation)\n        {\n            workers.Add(new ParallelLoopWorker(this, threadStart, threadStartInformation));\n        }\n\n        internal void RemoveThread()\n        {\n            if (workers.Count > 0)\n            {\n                lock (workers[0].disposedLocker)\n                {\n                    if (!workers[0].disposed)\n                    {\n                        currentLoopBody = null;\n                        workerCount = 1;\n                        workers[0].getToWork.Set();\n                        loopFinished.WaitOne();\n                        workers[0].Dispose();\n                    }\n                }\n                workers.RemoveAt(0);\n            }\n        }\n\n        /// <summary>\n        /// Iterates over the interval.\n        /// </summary>\n        /// <param name=\"beginIndex\">Starting index of the iteration.</param>\n        /// <param name=\"endIndex\">Ending index of the iteration.</param>\n        /// <param name=\"loopBody\">Function to call on each iteration.</param>\n        public void ForLoop(int beginIndex, int endIndex, Action<int> loopBody)\n        {\n            //CANNOT CALL THIS WHILE BUSY!!!! ASSUME THAT IS GUARANTEED.\n            //Compute intervals for each worker.\n\n            workerCount = workers.Count;\n\n            //TODO: The job splitting could be tuned possibly.\n            int iterationCount = endIndex - beginIndex;\n            int tasksPerThread = Math.Max(minimumTasksPerThread, iterationCount / maximumIterationsPerTask);\n            int taskSubdivisions = workerCount * tasksPerThread;\n\n            currentBeginIndex = beginIndex;\n            currentEndIndex = endIndex;\n            currentLoopBody = loopBody;\n            iterationsPerSteal = Math.Max(1, iterationCount / taskSubdivisions);\n            jobIndex = 0;\n            float maxJobs = iterationCount / (float) iterationsPerSteal;\n            if (maxJobs % 1 == 0)\n                maxJobIndex = (int) maxJobs;\n            else\n                maxJobIndex = 1 + (int) maxJobs;\n\n            for (int i = 0; i < workers.Count; i++)\n            {\n                workers[i].finalIndex = endIndex;\n                workers[i].iterationsPerSteal = iterationsPerSteal;\n                workers[i].getToWork.Set();\n            }\n\n            loopFinished.WaitOne();\n        }\n\n        internal void OnWorkerFinish()\n        {\n            if (Interlocked.Decrement(ref workerCount) == 0)\n                loopFinished.Set();\n        }\n\n        #region IDisposable Members\n\n        private bool disposed;\n        private readonly object disposedLocker = new object();\n\n        /// <summary>\n        /// Releases resources used by the object.\n        /// </summary>\n        public void Dispose()\n        {\n            lock (disposedLocker)\n            {\n                if (!disposed)\n                {\n                    disposed = true;\n                    while (workers.Count > 0)\n                    {\n                        RemoveThread();\n                    }\n                    loopFinished.Close();\n                    GC.SuppressFinalize(this);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Releases resources used by the object.\n        /// </summary>\n        ~ParallelLoopManager()\n        {\n            Dispose();\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "BEPUphysics/Threading/Modified Pool/ParallelLoopWorker.cs",
    "content": "﻿using System;\nusing System.Threading;\n\nnamespace BEPUphysics.Threading\n{\n    internal class ParallelLoopWorker : IDisposable\n    {\n        private readonly ParallelLoopManager manager;\n        internal bool disposed;\n        internal object disposedLocker = new object();\n        internal int finalIndex;\n\n        internal AutoResetEvent getToWork;\n\n        private object initializationInformation;\n\n        internal int iterationsPerSteal;\n        private Thread thread;\n        private Action<object> threadStart;\n\n        internal ParallelLoopWorker(ParallelLoopManager manager, Action<object> threadStart, object initializationInformation)\n        {\n            this.manager = manager;\n            this.threadStart = threadStart;\n            this.initializationInformation = initializationInformation;\n\n            getToWork = new AutoResetEvent(false);\n\n            thread = new Thread(Work) {IsBackground = true};\n            thread.Start();\n        }\n\n\n        /// <summary>\n        /// Releases resources used by the object.\n        /// </summary>\n        ~ParallelLoopWorker()\n        {\n            Dispose();\n        }\n\n        #region IDisposable Members\n\n        /// <summary>\n        /// Disposes the worker.\n        /// </summary>\n        public void Dispose()\n        {\n            lock (disposedLocker)\n            {\n                if (!disposed)\n                {\n                    disposed = true;\n                    getToWork.Close();\n                    getToWork = null;\n                    thread = null;\n                    GC.SuppressFinalize(this);\n                }\n            }\n        }\n\n        #endregion\n\n        internal void Work()\n        {\n            if (threadStart != null)\n            {\n                threadStart(initializationInformation);\n            }\n            threadStart = null;\n            initializationInformation = null;\n\n            while (true)\n            {\n                //When ThreadManager sees a loop available, it set it up and then wake me up.\n                getToWork.WaitOne();\n                if (manager.currentLoopBody == null)\n                {\n                    //Woops, looks like it's time for me to die.\n                    manager.OnWorkerFinish();\n                    return;\n                }\n\n                while (manager.jobIndex <= manager.maxJobIndex)\n                {\n                    //Claim a piece of job.\n                    int jobIndex = Interlocked.Increment(ref manager.jobIndex);\n                    //The job interval.\n                    int endIndex = jobIndex * iterationsPerSteal;\n                    int beginIndex = endIndex - iterationsPerSteal;\n\n                    //Do the job piece.  Make sure you don't do more than exists in the list itself.\n                    for (int i = beginIndex; i < endIndex && i < finalIndex; i++)\n                    {\n                        manager.currentLoopBody(i);\n                    }\n                } //this is not 'thread safe' but the result of the unsafety is a quick fail in the worst case.\n\n                manager.OnWorkerFinish();\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Threading/Modified Pool/SpecializedThreadManager.cs",
    "content": "﻿using System;\n\nnamespace BEPUphysics.Threading\n{\n    /// <summary>\n    /// Manages the engine's threads.\n    /// </summary>\n    /// <remarks>\n    /// Separates the management of ThreadTasks and loops\n    /// into specialized systems.  Should have generally higher\n    /// performance than the SimpleThreadManager.\n    /// </remarks>\n    public class SpecializedThreadManager : IThreadManager\n    {\n        private readonly object disposedLocker = new object();\n        private bool disposed;\n        private ParallelLoopManager loopManager;\n        private ThreadTaskManager taskManager;\n\n        /// <summary>\n        /// Constructs a new specialized thread manager\n        /// that manages loops and tasks separately.\n        /// </summary>\n        public SpecializedThreadManager()\n        {\n            taskManager = new ThreadTaskManager();\n            loopManager = new ParallelLoopManager();\n        }\n\n        /// <summary>\n        /// Releases resources used by the object.\n        /// </summary>\n        ~SpecializedThreadManager()\n        {\n            Dispose();\n        }\n\n        /// <summary>\n        /// Gets or sets the loop manager used by this threading system.\n        /// The loop manager is used to specifically parallelize forloops.\n        /// </summary>\n        public ParallelLoopManager LoopManager\n        {\n            get { return loopManager; }\n            set { loopManager = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the task manager used by this threading system.\n        /// The task manager is used for anything that isn't strictly a \n        /// for loop.\n        /// </summary>\n        public ThreadTaskManager TaskManager\n        {\n            get { return taskManager; }\n            set { taskManager = value; }\n        }\n\n        #region IThreadManager Members\n\n        /// <summary>\n        /// Gets the number of threads in use by the manager.\n        /// </summary>\n        public int ThreadCount\n        {\n            get { return taskManager.ThreadCount; }\n        }\n\n        /// <summary>\n        /// Adds a new worker thread to the engine.\n        /// </summary>\n        public void AddThread()\n        {\n            taskManager.AddThread();\n            loopManager.AddThread();\n        }\n\n        /// <summary>\n        /// Adds a new worker thread to the engine.\n        /// </summary>\n        /// <param name=\"initialization\">Function that each of the new threads will call before entering its work loop.  Note that this type of thread manager spawns two worker threads for each given thread;\n        /// the initializer will run twice.</param>\n        /// <param name=\"initializationInformation\">Data to give the initializer.</param>\n        public void AddThread(Action<object> initialization, object initializationInformation)\n        {\n            taskManager.AddThread(initialization, initializationInformation);\n            loopManager.AddThread(initialization, initializationInformation);\n        }\n\n        /// <summary>\n        /// Removes a worker thread from the engine.\n        /// </summary>\n        public void RemoveThread()\n        {\n            taskManager.RemoveThread();\n            loopManager.RemoveThread();\n        }\n\n        /// <summary>\n        /// Enqueues a task to the thread manager.\n        /// This should be safe to call from multiple threads and from other tasks.\n        /// </summary>\n        /// <param name=\"taskBody\">Method to run.</param>\n        /// <param name=\"taskInformation\">Data to give to the task.</param>\n        public void EnqueueTask(Action<object> taskBody, object taskInformation)\n        {\n            taskManager.EnqueueTask(taskBody, taskInformation);\n        }\n\n        /// <summary>\n        /// Loops from the starting index (inclusive) to the ending index (exclusive), calling the loopBody at each iteration.\n        /// The forLoop function will not return until all iterations are complete.\n        /// This is meant to be used in a 'fork-join' model; only a single thread should be running a forLoop\n        /// at any time.\n        /// </summary>\n        /// <param name=\"startIndex\">Inclusive starting index.</param>\n        /// <param name=\"endIndex\">Exclusive ending index.</param>\n        /// <param name=\"loopBody\">Function that handles an individual iteration of the loop.</param>\n        public void ForLoop(int startIndex, int endIndex, Action<int> loopBody)\n        {\n            loopManager.ForLoop(startIndex, endIndex, loopBody);\n        }\n\n        /// <summary>\n        /// Waits until all tasks enqueued using enqueueTask are complete.\n        /// </summary>\n        public void WaitForTaskCompletion()\n        {\n            taskManager.WaitForTaskCompletion();\n        }\n\n        /// <summary>\n        /// Releases resources used by the object.\n        /// </summary>\n        public void Dispose()\n        {\n            lock (disposedLocker)\n            {\n                if (!disposed)\n                {\n                    disposed = true;\n                    taskManager.Dispose();\n                    loopManager.Dispose();\n                    GC.SuppressFinalize(this);\n                }\n            }\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "BEPUphysics/Threading/Modified Pool/ThreadTaskManager.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.Threading\n{\n    /// <summary>\n    /// Keeps track of the threads currently available to the physics engine.\n    /// </summary>\n    public class ThreadTaskManager : IThreadManager\n    {\n        private readonly object disposedLocker = new object();\n        private readonly Action<object> doLoopSectionDelegate;\n        private readonly List<LoopSection> taskInfos = new List<LoopSection>();\n        private readonly List<WorkerThread> workers = new List<WorkerThread>();\n\n        private ManualResetEvent allThreadsIdleNotifier = new ManualResetEvent(false);\n\n        /// <summary>\n        /// Index into the thread loop lists, incremented after each task allocation.\n        /// </summary>\n        private int currentTaskAllocationIndex;\n\n        private bool disposed;\n\n        private int loopTasksPerThread;\n        private int tasksRemaining = 1;\n\n        /// <summary>\n        /// Constructs a new thread task manager.\n        /// </summary>\n        public ThreadTaskManager()\n        {\n            LoopTasksPerThread = 1;\n            doLoopSectionDelegate = new Action<object>(DoLoopSection);\n        }\n\n        /// <summary>\n        /// Releases resources used by the object.\n        /// </summary>\n        ~ThreadTaskManager()\n        {\n            Dispose();\n        }\n\n        /// <summary>\n        /// Gets or sets the number of tasks to create per thread when doing forLoops.\n        /// </summary>\n        public int LoopTasksPerThread\n        {\n            get { return loopTasksPerThread; }\n            set\n            {\n                loopTasksPerThread = value;\n                RemakeLoopSections();\n            }\n        }\n\n        #region IThreadManager Members\n\n        /// <summary>\n        /// Gets the number of threads currently handled by the manager.\n        /// </summary>\n        public int ThreadCount\n        {\n            get { return workers.Count; }\n        }\n\n        /// <summary>\n        /// Blocks the current thread until all tasks have been completed.\n        /// </summary>\n        public void WaitForTaskCompletion()\n        {\n            //TODO: Try a WAITALL version of this\n            if (Interlocked.Decrement(ref tasksRemaining) == 0)\n            {\n                allThreadsIdleNotifier.Set();\n            }\n            allThreadsIdleNotifier.WaitOne();\n\n            //When it gets here, it means things are successfully idle'd.\n            tasksRemaining = 1;\n            allThreadsIdleNotifier.Reset();\n        }\n\n\n        /// <summary>\n        /// Adds a thread to the manager.\n        /// </summary>\n        public void AddThread()\n        {\n            AddThread(null, null);\n        }\n\n        /// <summary>\n        /// Adds a thread to the manager.\n        /// </summary>\n        /// <param name=\"initialization\">A function to run to perform any initialization on the new thread.</param>\n        /// <param name=\"initializationInformation\">Data to give the ParameterizedThreadStart for initialization.</param>\n        public void AddThread(Action<object> initialization, object initializationInformation)\n        {\n            lock (workers)\n            {\n                var worker = new WorkerThread(workers.Count, this, initialization, initializationInformation);\n                workers.Add(worker);\n                RemakeLoopSections();\n            }\n        }\n\n\n        /// <summary>\n        /// Removes a thread from the manager.\n        /// </summary>\n        public void RemoveThread()\n        {\n            if (workers.Count > 0)\n            {\n                workers[0].EnqueueTask(null, null);\n                WaitForTaskCompletion();\n                workers[0].Dispose();\n            }\n        }\n\n\n        /// <summary>\n        /// Gives the thread manager a new task to run.\n        /// </summary>\n        /// <param name=\"task\">Task to run.</param>\n        /// <param name=\"taskInformation\">Information to be used by the task.</param>\n        public void EnqueueTask(Action<object> task, object taskInformation)\n        {\n            lock (workers)\n            {\n                currentTaskAllocationIndex = (currentTaskAllocationIndex + 1) % workers.Count;\n                workers[currentTaskAllocationIndex].EnqueueTask(task, taskInformation);\n            }\n        }\n\n        /// <summary>\n        /// Loops from the starting index (inclusive) to the ending index (exclusive), calling the loopBody at each iteration.\n        /// The forLoop function will not return until all iterations are complete.\n        /// This is meant to be used in a 'fork-join' model; only a single thread should be running a forLoop\n        /// at any time.\n        /// </summary>\n        /// <param name=\"startIndex\">Inclusive starting index.</param>\n        /// <param name=\"endIndex\">Exclusive ending index.</param>\n        /// <param name=\"loopBody\">Function that handles an individual iteration of the loop.</param>\n        public void ForLoop(int startIndex, int endIndex, Action<int> loopBody)\n        {\n            int subdivisions = workers.Count * loopTasksPerThread;\n            int iterationCount = endIndex - startIndex;\n            for (int b = 0; b < subdivisions; b++)\n            {\n                taskInfos[b].loopBody = loopBody;\n                taskInfos[b].iterationCount = iterationCount;\n                EnqueueTaskSequentially(doLoopSectionDelegate, taskInfos[b]);\n            }\n            WaitForTaskCompletion();\n        }\n\n        /// <summary>\n        /// Releases resources used by the object.\n        /// </summary>\n        public void Dispose()\n        {\n            lock (disposedLocker)\n            {\n                if (!disposed)\n                {\n                    disposed = true;\n                    while (workers.Count > 0)\n                    {\n                        RemoveThread();\n                    }\n                    allThreadsIdleNotifier.Close();\n                    allThreadsIdleNotifier = null;\n                }\n            }\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Enqueues a task.\n        /// This method also does not perform any locking; it should only be called when all worker threads of the thread pool are idle and all calls to this method are from the same thread.\n        /// </summary>\n        /// <param name=\"task\">Task to enqueue.</param>\n        /// <param name=\"taskInformation\">Information for the task.</param>\n        public void EnqueueTaskSequentially(Action<object> task, object taskInformation)\n        {\n            //enqueueTask(task, taskInformation);\n            workers[currentTaskAllocationIndex].EnqueueTask(task, taskInformation);\n            currentTaskAllocationIndex = (currentTaskAllocationIndex + 1) % workers.Count;\n            //workers[currentTaskAllocationIndex].enqueueTaskSequentially(task, taskInformation);\n            //currentTaskAllocationIndex = (currentTaskAllocationIndex + 1) % workers.Count;\n        }\n\n\n        private static void DoLoopSection(object o)\n        {\n            var data = o as LoopSection;\n            int finalIndex = (data.iterationCount * (data.Index + 1)) / data.Subdivisions;\n            for (int i = (data.iterationCount * data.Index) / data.Subdivisions; i < finalIndex; i++)\n            {\n                //do stuff\n                data.loopBody(i);\n            }\n        }\n\n        private void RemakeLoopSections()\n        {\n            taskInfos.Clear();\n            int workerCount = workers.Count;\n            int subdivisions = workerCount * loopTasksPerThread;\n            for (int i = 0; i < workerCount; i++)\n            {\n                for (int j = 0; j < loopTasksPerThread; j++)\n                {\n                    taskInfos.Add(new LoopSection(i * loopTasksPerThread + j, subdivisions));\n                }\n            }\n        }\n\n\n        private struct TaskEntry\n        {\n            internal readonly object Info;\n            internal readonly Action<object> Task;\n\n            internal TaskEntry(Action<object> task, object info)\n            {\n                Task = task;\n                Info = info;\n            }\n        }\n\n        private class LoopSection\n        {\n            internal readonly int Index;\n            internal readonly int Subdivisions;\n            internal int iterationCount;\n            internal Action<int> loopBody;\n\n            internal LoopSection(int index, int subdivisions)\n            {\n                Index = index;\n                Subdivisions = subdivisions;\n            }\n        }\n\n        private class WorkerThread : IDisposable\n        {\n            private readonly object disposedLocker = new object();\n            private readonly object initializationInformation;\n            private readonly ThreadTaskManager manager;\n            private readonly ConcurrentDeque<TaskEntry> taskData;\n            private readonly Thread thread;\n            private readonly Action<object> threadStart;\n            private bool disposed;\n            private int index;\n            private AutoResetEvent resetEvent = new AutoResetEvent(false);\n\n            internal WorkerThread(int index, ThreadTaskManager manager, Action<object> threadStart, object initializationInformation)\n            {\n                this.manager = manager;\n                thread = new Thread(ThreadExecutionLoop);\n                thread.IsBackground = true;\n                taskData = new ConcurrentDeque<TaskEntry>();\n                this.threadStart = threadStart;\n                this.initializationInformation = initializationInformation;\n                UpdateIndex(index);\n                //#if WINDOWS\n                //                ResourcePool.addThreadID(thread.ManagedThreadId);\n                //#endif\n                thread.Start();\n            }\n\n            ~WorkerThread()\n            {\n                Dispose();\n            }\n\n            #region IDisposable Members\n\n            public void Dispose()\n            {\n                lock (disposedLocker)\n                {\n                    if (!disposed)\n                    {\n                        disposed = true;\n                        resetEvent.Close();\n                        resetEvent = null;\n                        manager.workers.Remove(this);\n                        GC.SuppressFinalize(this);\n                    }\n                }\n            }\n\n            #endregion\n\n            internal void EnqueueTask(Action<object> task, object taskInformation)\n            {\n                Interlocked.Increment(ref manager.tasksRemaining);\n                taskData.Enqueue(new TaskEntry(task, taskInformation));\n                resetEvent.Set();\n            }\n\n            private bool TrySteal(int victim, out TaskEntry task)\n            {\n                return manager.workers[victim].taskData.TryDequeueLast(out task);\n            }\n\n            /// <exception cref=\"ArithmeticException\">Thrown when the thread encounters an invalid state; generally propagated float.NaN's.</exception>\n            private void ThreadExecutionLoop()\n            {\n                //Perform any initialization requested.\n                if (threadStart != null)\n                    threadStart(initializationInformation);\n                TaskEntry task;\n\n                while (true)\n                {\n                    resetEvent.WaitOne();\n                    while (true)\n                    {\n                        if (!taskData.TryDequeueFirst(out task))\n                        {\n                            bool gotSomething = false;\n                            for (int i = 1; i < manager.workers.Count; i++)\n                            {\n                                if (TrySteal((index + i) % manager.workers.Count, out task))\n                                {\n                                    gotSomething = true;\n                                    break;\n                                }\n                            }\n                            if (!gotSomething)\n                                break; //Nothing to steal and I'm broke! Guess I'll mosey on out\n                        }\n                        try\n                        {\n                            if (task.Task != null)\n                                task.Task(task.Info);\n                            if (Interlocked.Decrement(ref manager.tasksRemaining) == 0)\n                            {\n                                manager.allThreadsIdleNotifier.Set();\n                            }\n                            if (task.Task == null)\n                                return;\n                        }\n                        catch (ArithmeticException arithmeticException)\n                        {\n                            throw new ArithmeticException(\n                                \"Some internal multithreaded arithmetic has encountered an invalid state.  Check for invalid entity momentums, velocities, and positions; propagating NaN's will generally trigger this exception in the getExtremePoint function.\",\n                                arithmeticException);\n                        }\n                    }\n                }\n            }\n\n            private void UpdateIndex(int newIndex)\n            {\n                index = newIndex;\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Threading/SimpleThreadManager.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading;\n\nnamespace BEPUphysics.Threading\n{\n    /// <summary>\n    /// Manages the engine's threads.\n    /// </summary>\n    /// <remarks>\n    /// Uses a simple round-robin threadpool.\n    /// It is recommended that other thread managers are used instead of this one;\n    /// it is kept for compatability and a fallback in case of problems.\n    /// </remarks>\n    public class SimpleThreadManager : IThreadManager\n    {\n        private readonly ManualResetEvent allThreadsIdleNotifier = new ManualResetEvent(false);\n        private readonly object disposedLocker = new object();\n        private readonly Action<object> doLoopSectionDelegate;\n        private readonly List<LoopSection> taskInfos = new List<LoopSection>();\n\n        private readonly List<WorkerThread> workers = new List<WorkerThread>();\n\n        /// <summary>\n        /// Index into the thread loop lists, incremented after each task allocation.\n        /// </summary>\n        private int currentTaskAllocationIndex;\n\n        private bool disposed;\n        private int loopTasksPerThread;\n\n        private int tasksRemaining = 1;\n\n        /// <summary>\n        /// Constructs the thread manager.\n        /// </summary>\n        public SimpleThreadManager()\n        {\n            LoopTasksPerThread = 1;\n            doLoopSectionDelegate = new Action<object>(DoLoopSection);\n        }\n\n        /// <summary>\n        /// Releases resources used by the object.\n        /// </summary>\n        ~SimpleThreadManager()\n        {\n            Dispose();\n        }\n\n        /// <summary>\n        /// Gets or sets the number of tasks to create per thread when doing forLoops.\n        /// </summary>\n        public int LoopTasksPerThread\n        {\n            get { return loopTasksPerThread; }\n            set\n            {\n                loopTasksPerThread = value;\n                RemakeLoopSections();\n            }\n        }\n\n        #region IThreadManager Members\n\n        /// <summary>\n        /// Gets the number of threads currently handled by the manager.\n        /// </summary>\n        public int ThreadCount\n        {\n            get { return workers.Count; }\n        }\n\n\n        /// <summary>\n        /// Blocks the current thread until all tasks have been completed.\n        /// </summary>\n        public void WaitForTaskCompletion()\n        {\n            if (Interlocked.Decrement(ref tasksRemaining) == 0)\n            {\n                allThreadsIdleNotifier.Set();\n            }\n            allThreadsIdleNotifier.WaitOne();\n\n            //When it gets here, it means things are successfully idle'd.\n            tasksRemaining = 1;\n            allThreadsIdleNotifier.Reset();\n        }\n\n\n        /// <summary>\n        /// Adds a thread to the manager.\n        /// </summary>\n        public void AddThread()\n        {\n            AddThread(null, null);\n        }\n\n        /// <summary>\n        /// Adds a thread to the manager.\n        /// </summary>\n        /// <param name=\"initialization\">A function to run to perform any initialization on the new thread.</param>\n        /// <param name=\"initializationInformation\">Data to give the ParameterizedThreadStart for initialization.</param>\n        public void AddThread(Action<object> initialization, object initializationInformation)\n        {\n            lock (workers)\n            {\n                var worker = new WorkerThread(this, initialization, initializationInformation);\n                workers.Add(worker);\n                RemakeLoopSections();\n            }\n        }\n\n\n        /// <summary>\n        /// Removes a thread and blocks until success.\n        /// </summary>\n        public void RemoveThread()\n        {\n            EnqueueTask(null, null);\n            WaitForTaskCompletion();\n            RemakeLoopSections();\n        }\n\n\n        /// <summary>\n        /// Gives the thread manager a new task to run.\n        /// </summary>\n        /// <param name=\"task\">Task to run.</param>\n        /// <param name=\"taskInformation\">Information to be used by the task.</param>\n        public void EnqueueTask(Action<object> task, object taskInformation)\n        {\n            lock (workers)\n            {\n                workers[currentTaskAllocationIndex].EnqueueTask(task, taskInformation);\n                currentTaskAllocationIndex = (currentTaskAllocationIndex + 1) % workers.Count;\n            }\n        }\n\n\n        /// <summary>\n        /// Loops from the starting index (inclusive) to the ending index (exclusive), calling the loopBody at each iteration.\n        /// The forLoop function will not return until all iterations are complete.\n        /// This is meant to be used in a 'fork-join' model; only a single thread should be running a forLoop\n        /// at any time.\n        /// </summary>\n        /// <param name=\"startIndex\">Inclusive starting index.</param>\n        /// <param name=\"endIndex\">Exclusive ending index.</param>\n        /// <param name=\"loopBody\">Function that handles an individual iteration of the loop.</param>\n        public void ForLoop(int startIndex, int endIndex, Action<int> loopBody)\n        {\n            int subdivisions = workers.Count * loopTasksPerThread;\n            int iterationCount = endIndex - startIndex;\n            for (int b = 0; b < subdivisions; b++)\n            {\n                taskInfos[b].loopBody = loopBody;\n                taskInfos[b].iterationCount = iterationCount;\n                EnqueueTaskSequentially(doLoopSectionDelegate, taskInfos[b]);\n            }\n            WaitForTaskCompletion();\n        }\n\n\n        /// <summary>\n        /// Releases threads and resources used by the thread manager.\n        /// </summary>\n        public void Dispose()\n        {\n            lock (disposedLocker)\n            {\n                if (!disposed)\n                {\n                    disposed = true;\n                    ShutDown();\n                    allThreadsIdleNotifier.Close();\n                    GC.SuppressFinalize(this);\n                }\n            }\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Enqueues a task.\n        /// This method also does not perform any locking; it should only be called when all worker threads of the thread pool are idle and all calls to this method are from the same thread.\n        /// </summary>\n        /// <param name=\"task\">Task to enqueue.</param>\n        /// <param name=\"taskInformation\">Information for the task.</param>\n        public void EnqueueTaskSequentially(Action<object> task, object taskInformation)\n        {\n            //enqueueTask(task, taskInformation);\n            workers[currentTaskAllocationIndex].EnqueueTask(task, taskInformation);\n            currentTaskAllocationIndex = (currentTaskAllocationIndex + 1) % workers.Count;\n            //workers[currentTaskAllocationIndex].enqueueTaskSequentially(task, taskInformation);\n            //currentTaskAllocationIndex = (currentTaskAllocationIndex + 1) % workers.Count;\n        }\n\n        /// <summary>\n        /// Tells every thread in the thread manager to shut down and waits until completion.\n        /// </summary>\n        public void ShutDown()\n        {\n            var toJoin = new Queue<Thread>();\n\n            for (int i = workers.Count - 1; i >= 0; i--)\n            {\n                lock (workers)\n                {\n                    toJoin.Enqueue(workers[i].Thread);\n                    workers[i].EnqueueTask(null, null);\n                }\n            }\n            while (toJoin.Count > 0)\n            {\n                toJoin.Dequeue().Join();\n            }\n        }\n\n        private static void DoLoopSection(object o)\n        {\n            var data = o as LoopSection;\n            int finalIndex = (data.iterationCount * (data.Index + 1)) / data.Subdivisions;\n            for (int i = (data.iterationCount * data.Index) / data.Subdivisions; i < finalIndex; i++)\n            {\n                //do stuff\n                data.loopBody(i);\n            }\n        }\n\n        private void RemakeLoopSections()\n        {\n            taskInfos.Clear();\n            int workerCount = workers.Count;\n            int subdivisions = workerCount * loopTasksPerThread;\n            for (int i = 0; i < workerCount; i++)\n            {\n                for (int j = 0; j < loopTasksPerThread; j++)\n                {\n                    taskInfos.Add(new LoopSection(i * loopTasksPerThread + j, subdivisions));\n                }\n            }\n        }\n\n        private class LoopSection\n        {\n            internal readonly int Index;\n            internal readonly int Subdivisions;\n            internal int iterationCount;\n            internal Action<int> loopBody;\n\n            internal LoopSection(int index, int subdivisions)\n            {\n                Index = index;\n                Subdivisions = subdivisions;\n            }\n        }\n\n        private class WorkerThread : IDisposable\n        {\n            private readonly object disposedLocker = new object();\n            private readonly object initializationInformation;\n            private readonly SimpleThreadManager manager;\n            private readonly AutoResetEvent resetEvent = new AutoResetEvent(false);\n            private readonly Queue<object> taskInformationQueue;\n            private readonly Queue<Action<object>> taskQueue;\n            internal readonly Thread Thread;\n            private readonly Action<object> threadStart;\n            private bool disposed;\n\n            internal WorkerThread(SimpleThreadManager manager, Action<object> threadStart, object initializationInformation)\n            {\n                this.manager = manager;\n                Thread = new Thread(ThreadExecutionLoop);\n                Thread.IsBackground = true;\n                taskQueue = new Queue<Action<object>>();\n                taskInformationQueue = new Queue<object>();\n                this.threadStart = threadStart;\n                this.initializationInformation = initializationInformation;\n                Thread.Start();\n            }\n\n            /// <summary>\n            /// Shuts down any still living threads.\n            /// </summary>\n            ~WorkerThread()\n            {\n                Dispose();\n            }\n\n            #region IDisposable Members\n\n            public void Dispose()\n            {\n                lock (disposedLocker)\n                {\n                    if (!disposed)\n                    {\n                        disposed = true;\n                        ShutDownThread();\n                        resetEvent.Close();\n                        GC.SuppressFinalize(this);\n                    }\n                }\n            }\n\n            #endregion\n\n            internal void EnqueueTask(Action<object> task, object taskInformation)\n            {\n                lock (taskQueue)\n                {\n                    Interlocked.Increment(ref manager.tasksRemaining);\n                    taskQueue.Enqueue(task);\n                    taskInformationQueue.Enqueue(taskInformation);\n                    resetEvent.Set();\n                }\n            }\n\n\n            private void ShutDownThread()\n            {\n                //Let the manager know that it is done with its 'task'!\n                if (Interlocked.Decrement(ref manager.tasksRemaining) == 0)\n                {\n                    if (!manager.disposed) //Don't mess with the handle if it's already disposed.\n                        manager.allThreadsIdleNotifier.Set();\n                }\n                //Dump out any remaining tasks in the queue.\n                for (int i = 0; i < taskQueue.Count; i++) //This is still safe since shutDownThread is called from within a lock(taskQueue) block.\n                {\n                    taskQueue.Dequeue();\n                    if (Interlocked.Decrement(ref manager.tasksRemaining) == 0)\n                    {\n                        if (!manager.disposed) //Don't mess with the handle if it's already disposed.\n                            manager.allThreadsIdleNotifier.Set();\n                    }\n                }\n\n                lock (manager.workers)\n                    manager.workers.Remove(this);\n            }\n\n            /// <exception cref=\"ArithmeticException\">Thrown when the thread encounters an invalid state; generally propagated float.NaN's.</exception>\n            private void ThreadExecutionLoop()\n            {\n                //Perform any initialization requested.\n                if (threadStart != null)\n                    threadStart(initializationInformation);\n                object information = null;\n\n                while (true)\n                {\n                    Action<object> task = null;\n                    lock (taskQueue)\n                    {\n                        if (taskQueue.Count > 0)\n                        {\n                            task = taskQueue.Dequeue();\n                            if (task == null)\n                            {\n                                Dispose();\n                                return;\n                            }\n\n                            information = taskInformationQueue.Dequeue();\n                        }\n                    }\n                    if (task != null)\n                    {\n                        //Perform the task!\n                        try\n                        {\n                            task(information);\n                        }\n                        catch (ArithmeticException arithmeticException)\n                        {\n                            throw new ArithmeticException(\n                                \"Some internal multithreaded arithmetic has encountered an invalid state.  Check for invalid entity momentums, velocities, and positions; propagating NaN's will generally trigger this exception in the getExtremePoint function.\",\n                                arithmeticException);\n                        }\n                        if (Interlocked.Decrement(ref manager.tasksRemaining) == 0)\n                        {\n                            manager.allThreadsIdleNotifier.Set();\n                            resetEvent.WaitOne();\n                        }\n                    }\n                    else\n                        resetEvent.WaitOne();\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Threading/ThreadManagerTPL.cs",
    "content": "﻿#if WINDOWS\nusing System;\nusing System.Threading.Tasks;\n\nnamespace BEPUphysics.Threading\n{\n    /// <summary>\n    /// Uses the .NET Task Parallel library to manage the engine's threads.\n    /// </summary>\n    public class ThreadManagerTPL : IThreadManager\n    {\n        /// <summary>\n        /// Gets or sets the task manager used to supplement the TPL.\n        /// </summary>\n        public IThreadManager TaskManager { get; set; }\n\n        /// <summary>\n        /// Gets the number of threads that the threadpool is targeting.\n        /// </summary>\n        public int ThreadCount\n        {\n            get { return TaskManager.ThreadCount; }\n        }\n\n        /// <summary>\n        /// Constructs the TPL thread manager.\n        /// </summary>\n        public ThreadManagerTPL()\n        {\n            TaskManager = new ThreadTaskManager();\n        }\n\n        /// <summary>\n        /// Notifies the thread manager that it should use another thread.\n        /// </summary>\n        public void AddThread()\n        {\n            TaskManager.AddThread();\n        }\n\n        /// <summary>\n        /// Notifies the thread manager that it should use another thread.\n        /// </summary>\n        /// <param name=\"initialization\">Function to use to initialize the thread.</param>\n        /// <param name=\"initializationInformation\">Information to provide to the initializer.</param>\n        public void AddThread(Action<object> initialization, object initializationInformation)\n        {\n            TaskManager.AddThread(initialization, initializationInformation);\n        }\n\n        /// <summary>\n        /// Notifies the thread manager that it should decrease the number of threads used.\n        /// </summary>\n        public void RemoveThread()\n        {\n            TaskManager.RemoveThread();\n        }\n\n\n        /// <summary>\n        /// Enqueues a task to the thread manager.\n        /// This should be safe to call from multiple threads and from other tasks.\n        /// </summary>\n        /// <param name=\"taskBody\">Method to run.</param>\n        /// <param name=\"taskInformation\">Data to give to the task.</param>\n        public void EnqueueTask(Action<object> taskBody, object taskInformation)\n        {\n            TaskManager.EnqueueTask(taskBody, taskInformation);\n        }\n\n        /// <summary>\n        /// Loops from the starting index (inclusive) to the ending index (exclusive), calling the loopBody at each iteration.\n        /// The forLoop function will not return until all iterations are complete.\n        /// This is meant to be used in a 'fork-join' model; only a single thread should be running a forLoop\n        /// at any time.\n        /// </summary>\n        /// <param name=\"startIndex\">Inclusive starting index.</param>\n        /// <param name=\"endIndex\">Exclusive ending index.</param>\n        /// <param name=\"loopBody\">Function that handles an individual iteration of the loop.</param>\n        public void ForLoop(int startIndex, int endIndex, Action<int> loopBody)\n        {\n            Parallel.For(startIndex, endIndex, loopBody);\n        }\n\n        /// <summary>\n        /// Waits until all tasks enqueued using enqueueTask are complete.\n        /// </summary>\n        public void WaitForTaskCompletion()\n        {\n            TaskManager.WaitForTaskCompletion();\n        }\n\n\n        #region IDisposable Members\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        public void Dispose()\n        {\n            TaskManager.Dispose();\n        }\n\n        #endregion\n    }\n}\n\n#endif"
  },
  {
    "path": "BEPUphysics/TimeStepSettings.cs",
    "content": "﻿namespace BEPUphysics\n{\n    ///<summary>\n    /// Contains settings for the instance's time step.\n    ///</summary>\n    public class TimeStepSettings\n    {\n        /// <summary>\n        /// Maximum number of timesteps to perform during a given frame when Space.Update(float) is used.  The unsimulated time will be accumulated for subsequent calls to Space.Update(float).\n        /// Defaults to 3.\n        /// </summary>\n        public int MaximumTimeStepsPerFrame = 3;\n\n        /// <summary>\n        /// Length of each integration step.  Calling a Space's Update() method moves time forward this much.\n        /// The other method, Space.Update(float), will try to move time forward by the amount specified in the parameter by taking steps of TimeStepDuration size.\n        /// Defaults to 1/60.\n        /// </summary>\n        public float TimeStepDuration = 1f / 60;\n\n        /// <summary>\n        /// Amount of time accumulated by previous calls to Space.Update(float) that has not yet been simulated.\n        /// </summary>\n        public float AccumulatedTime;\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/CombinedUpdateable.cs",
    "content": "﻿using System.Collections.Generic;\nusing BEPUphysics.Constraints;\n\nnamespace BEPUphysics.UpdateableSystems\n{\n    ///<summary>\n    /// A class which is both a space updateable and a Solver Updateable.\n    ///</summary>\n    public abstract class CombinedUpdateable : EntitySolverUpdateable, ISpaceUpdateable\n    {\n        private bool isSequentiallyUpdated = true;\n\n        protected CombinedUpdateable()\n        {\n            IsUpdating = true;\n        }\n\n        #region ISpaceUpdateable Members\n\n        List<UpdateableManager> managers = new List<UpdateableManager>();\n        List<UpdateableManager> ISpaceUpdateable.Managers\n        {\n            get\n            {\n                return managers;\n            }\n        }\n\n        /// <summary>\n        /// Gets and sets whether or not the updateable should be updated sequentially even in a multithreaded space.\n        /// If this is true, the updateable can make use of the space's ThreadManager for internal multithreading.\n        /// </summary>\n        public bool IsUpdatedSequentially\n        {\n            get { return isSequentiallyUpdated; }\n            set\n            {\n                bool oldValue = isSequentiallyUpdated;\n                isSequentiallyUpdated = value;\n                if (value != oldValue)\n                    for (int i = 0; i < managers.Count; i++)\n                    {\n                        managers[i].SequentialUpdatingStateChanged(this);\n                    }\n            }\n        }\n\n\n        /// <summary>\n        /// Gets and sets whether or not the updateable should be updated by the space.\n        /// </summary>\n        public bool IsUpdating\n        {\n            get;\n            set;\n        }\n\n\n        ISpace ISpaceObject.Space\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets or sets the user data associated with this object.\n        /// </summary>\n        public new object Tag { get; set; }\n\n        #endregion\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/FluidVolume.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.Entities;\nusing BEPUphysics.Threading;\nusing BEPUutilities;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUphysics.UpdateableSystems\n{\n\n    /// <summary>\n    /// Volume in which physically simulated objects have a buoyancy force applied to them based on their density and volume.\n    /// </summary>\n    public class FluidVolume : Updateable, IDuringForcesUpdateable, ICollisionRulesOwner\n    {\n        //TODO: The current FluidVolume implementation is awfully awful.\n        //It would be really nice if it was a bit more flexible and less clunktastic.\n        //(A mesh volume, maybe?)\n\n        private RigidTransform surfaceTransform;\n        private Matrix3x3 toSurfaceRotationMatrix;\n        Vector3 upVector;\n        ///<summary>\n        /// Gets or sets the up vector of the fluid volume.\n        ///</summary>\n        public Vector3 UpVector\n        {\n            get\n            {\n                return upVector;\n            }\n            set\n            {\n                value.Normalize();\n                upVector = value;\n\n                RecalculateBoundingBox();\n\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the dictionary storing density multipliers for the fluid volume.  If a value is specified for an entity, the density of the object is effectively scaled to match.\n        /// Higher values make entities sink more, lower values make entities float more.\n        /// </summary>\n        public Dictionary<Entity, float> DensityMultipliers { get; set; }\n\n        BoundingBox boundingBox;\n        /// <summary>\n        /// Bounding box surrounding the surface triangles and entire depth of the object.\n        /// </summary>\n        public BoundingBox BoundingBox\n        {\n            get\n            {\n                return boundingBox;\n            }\n        }\n\n        float maxDepth;\n        /// <summary>\n        /// Maximum depth of the fluid from the surface.\n        /// </summary>\n        public float MaxDepth\n        {\n            get\n            {\n                return maxDepth;\n            }\n            set\n            {\n                maxDepth = value;\n                RecalculateBoundingBox();\n            }\n        }\n\n        /// <summary>\n        /// Density of the fluid represented in the volume.\n        /// </summary>\n        public float Density { get; set; }\n\n        int samplePointsPerDimension = 8;\n        /// <summary>\n        /// Number of locations along each of the horizontal axes from which to sample the shape.\n        /// Defaults to 8.\n        /// </summary>\n        public int SamplePointsPerDimension\n        {\n            get\n            {\n                return samplePointsPerDimension;\n            }\n            set\n            {\n                samplePointsPerDimension = value;\n            }\n        }\n\n        /// <summary>\n        /// Fraction by which to reduce the linear momentum of floating objects each update.\n        /// </summary>\n        public float LinearDamping { get; set; }\n\n        /// <summary>\n        /// Fraction by which to reduce the angular momentum of floating objects each update.\n        /// </summary>\n        public float AngularDamping { get; set; }\n\n\n\n        private Vector3 flowDirection;\n        /// <summary>\n        /// Direction in which to exert force on objects within the fluid.\n        /// flowForce and maxFlowSpeed must have valid values as well for the flow to work.\n        /// </summary>\n        public Vector3 FlowDirection\n        {\n            get\n            {\n                return flowDirection;\n            }\n            set\n            {\n                float length = value.Length();\n                if (length > 0)\n                {\n                    flowDirection = value / length;\n                }\n                else\n                    flowDirection = Vector3.Zero;\n                //TODO: Activate bodies in water\n            }\n        }\n\n        private float flowForce;\n\n        /// <summary>\n        /// Magnitude of the flow's force, in units of flow direction.\n        /// flowDirection and maxFlowSpeed must have valid values as well for the flow to work.\n        /// </summary>\n        public float FlowForce\n        {\n            get\n            {\n                return flowForce;\n            }\n            set\n            {\n                flowForce = value;\n                //TODO: Activate bodies in water\n            }\n        }\n\n        float maxFlowSpeed;\n        /// <summary>\n        /// Maximum speed of the flow; objects will not be accelerated by the flow force beyond this speed.\n        /// flowForce and flowDirection must have valid values as well for the flow to work.\n        /// </summary>\n        public float MaxFlowSpeed\n        {\n            get\n            {\n                return maxFlowSpeed;\n            }\n            set\n            {\n                maxFlowSpeed = value;\n            }\n\n        }\n\n        IQueryAccelerator QueryAccelerator { get; set; }\n\n        ///<summary>\n        /// Gets or sets the thread manager used by the fluid volume.\n        ///</summary>\n        public IThreadManager ThreadManager { get; set; }\n\n        private List<Vector3[]> surfaceTriangles;\n        /// <summary>\n        /// List of coplanar triangles composing the surface of the fluid.\n        /// </summary>\n        public List<Vector3[]> SurfaceTriangles\n        {\n            get\n            {\n                return surfaceTriangles;\n            }\n            set\n            {\n                surfaceTriangles = value;\n                RecalculateBoundingBox();\n            }\n        }\n\n        float gravity;\n        ///<summary>\n        /// Gets or sets the gravity used by the fluid volume.\n        ///</summary>\n        public float Gravity\n        {\n            get\n            {\n                return gravity;\n            }\n            set\n            {\n                gravity = value;\n            }\n        }\n\n\n\n        /// <summary>\n        /// Creates a fluid volume.\n        /// </summary>\n        /// <param name=\"upVector\">Up vector of the fluid volume.</param>\n        /// <param name=\"gravity\">Strength of gravity for the purposes of the fluid volume.</param>\n        /// <param name=\"surfaceTriangles\">List of triangles composing the surface of the fluid.  Set up as a list of length 3 arrays of Vector3's.</param>\n        /// <param name=\"depth\">Depth of the fluid back along the surface normal.</param>\n        /// <param name=\"fluidDensity\">Density of the fluid represented in the volume.</param>\n        /// <param name=\"linearDamping\">Fraction by which to reduce the linear momentum of floating objects each update, in addition to any of the body's own damping.</param>\n        /// <param name=\"angularDamping\">Fraction by which to reduce the angular momentum of floating objects each update, in addition to any of the body's own damping.</param>\n        /// <param name=\"queryAccelerator\">System to accelerate queries to find nearby entities.</param>\n        /// <param name=\"threadManager\">Thread manager used by the fluid volume.</param>\n        public FluidVolume(Vector3 upVector, float gravity, List<Vector3[]> surfaceTriangles, float depth, float fluidDensity, float linearDamping, float angularDamping)\n        {\n            Gravity = gravity;\n            SurfaceTriangles = surfaceTriangles;\n            MaxDepth = depth;\n            Density = fluidDensity;\n            LinearDamping = linearDamping;\n            AngularDamping = angularDamping;\n\n            UpVector = upVector;\n\n            analyzeCollisionEntryDelegate = AnalyzeEntry;\n\n            DensityMultipliers = new Dictionary<Entity, float>();\n        }\n\n        /// <summary>\n        /// Recalculates the bounding box of the fluid based on its depth, surface normal, and surface triangles.\n        /// </summary>\n        public void RecalculateBoundingBox()\n        {\n            var points = CommonResources.GetVectorList();\n            foreach (var tri in SurfaceTriangles)\n            {\n                points.Add(tri[0]);\n                points.Add(tri[1]);\n                points.Add(tri[2]);\n                points.Add(tri[0] - upVector * MaxDepth);\n                points.Add(tri[1] - upVector * MaxDepth);\n                points.Add(tri[2] - upVector * MaxDepth);\n            }\n            boundingBox = BoundingBox.CreateFromPoints(points);\n            CommonResources.GiveBack(points);\n\n            //Compute the transforms used to pull objects into fluid local space.\n            Toolbox.GetQuaternionBetweenNormalizedVectors(ref Toolbox.UpVector, ref upVector, out surfaceTransform.Orientation);\n            Matrix3x3.CreateFromQuaternion(ref surfaceTransform.Orientation, out toSurfaceRotationMatrix);\n            surfaceTransform.Position = surfaceTriangles[0][0];\n        }\n\n        List<BroadPhaseEntry> broadPhaseEntries = new List<BroadPhaseEntry>();\n\n        /// <summary>\n        /// Applies buoyancy forces to appropriate objects.\n        /// Called automatically when needed by the owning Space.\n        /// </summary>\n        /// <param name=\"dt\">Time since last frame in physical logic.</param>\n        void IDuringForcesUpdateable.Update(float dt)\n        {\n            QueryAccelerator.GetEntries(boundingBox, broadPhaseEntries);\n            //TODO: Could integrate the entire thing into the collision detection pipeline.  Applying forces\n            //in the collision detection pipeline isn't allowed, so there'd still need to be an Updateable involved.\n            //However, the broadphase query would be eliminated and the raycasting work would be automatically multithreaded.\n\n            this.dt = dt;\n\n            //Don't always multithread.  For small numbers of objects, the overhead of using multithreading isn't worth it.\n            //Could tune this value depending on platform for better performance.\n            if (broadPhaseEntries.Count > 30 && ThreadManager.ThreadCount > 1)\n                ThreadManager.ForLoop(0, broadPhaseEntries.Count, analyzeCollisionEntryDelegate);\n            else\n                for (int i = 0; i < broadPhaseEntries.Count; i++)\n                {\n                    AnalyzeEntry(i);\n                }\n\n            broadPhaseEntries.Clear();\n\n\n\n\n        }\n\n        float dt;\n        Action<int> analyzeCollisionEntryDelegate;\n\n        void AnalyzeEntry(int i)\n        {\n            var entityCollidable = broadPhaseEntries[i] as EntityCollidable;\n            if (entityCollidable != null && entityCollidable.IsActive && entityCollidable.entity.isDynamic && CollisionRules.collisionRuleCalculator(this, entityCollidable) <= CollisionRule.Normal)\n            {\n                bool keepGoing = false;\n                foreach (var tri in surfaceTriangles)\n                {\n                    //Don't need to do anything if the entity is outside of the water.\n                    if (Toolbox.IsPointInsideTriangle(ref tri[0], ref tri[1], ref tri[2], ref entityCollidable.worldTransform.Position))\n                    {\n                        keepGoing = true;\n                        break;\n                    }\n                }\n                if (!keepGoing)\n                    return;\n\n                //The entity is submerged, apply buoyancy forces.\n                float submergedVolume;\n                Vector3 submergedCenter;\n                GetBuoyancyInformation(entityCollidable, out submergedVolume, out submergedCenter);\n\n                if (submergedVolume > 0)\n                {              \n\n                    float fractionSubmerged = submergedVolume / entityCollidable.entity.volume;\n\n                    //Divide the volume by the density multiplier if present.\n                    float densityMultiplier;\n                    if (DensityMultipliers.TryGetValue(entityCollidable.entity, out densityMultiplier))\n                    {\n                        submergedVolume /= densityMultiplier;\n                    }\n                    Vector3 force;\n                    Vector3.Multiply(ref upVector, -gravity * Density * dt * submergedVolume, out force);\n                    entityCollidable.entity.ApplyImpulse(ref submergedCenter, ref force);\n\n                    //Flow\n                    if (FlowForce != 0)\n                    {\n                        float dot = Math.Max(Vector3.Dot(entityCollidable.entity.linearVelocity, flowDirection), 0);\n                        if (dot < MaxFlowSpeed)\n                        {\n                            force = Math.Min(FlowForce, (MaxFlowSpeed - dot) * entityCollidable.entity.mass) * dt * fractionSubmerged * FlowDirection;\n                            entityCollidable.entity.ApplyLinearImpulse(ref force);\n                        }\n                    }\n                    //Damping\n                    entityCollidable.entity.ModifyLinearDamping(fractionSubmerged * LinearDamping);\n                    entityCollidable.entity.ModifyAngularDamping(fractionSubmerged * AngularDamping);\n\n                }\n            }\n        }\n\n        void GetBuoyancyInformation(EntityCollidable collidable, out float submergedVolume, out Vector3 submergedCenter)\n        {\n            BoundingBox entityBoundingBox;\n\n            RigidTransform localTransform;\n            RigidTransform.TransformByInverse(ref collidable.worldTransform, ref surfaceTransform, out localTransform);\n            collidable.Shape.GetBoundingBox(ref localTransform, out entityBoundingBox);\n            if (entityBoundingBox.Min.Y > 0)\n            {\n                //Fish out of the water.  Don't need to do raycast tests on objects not at the boundary.\n                submergedVolume = 0;\n                submergedCenter = collidable.worldTransform.Position;\n                return;\n            }\n            if (entityBoundingBox.Max.Y < 0)\n            {\n                submergedVolume = collidable.entity.volume;\n                submergedCenter = collidable.worldTransform.Position;\n                return;\n            }\n\n            Vector3 origin, xSpacing, zSpacing;\n            float perColumnArea;\n            GetSamplingOrigin(ref entityBoundingBox, out xSpacing, out zSpacing, out perColumnArea, out origin);\n\n            float boundingBoxHeight = entityBoundingBox.Max.Y - entityBoundingBox.Min.Y;\n            float maxLength = -entityBoundingBox.Min.Y;\n            submergedCenter = new Vector3();\n            submergedVolume = 0;\n            for (int i = 0; i < samplePointsPerDimension; i++)\n            {\n                for (int j = 0; j < samplePointsPerDimension; j++)\n                {\n                    Vector3 columnVolumeCenter;\n                    float submergedHeight;\n                    if ((submergedHeight = GetSubmergedHeight(collidable, maxLength, boundingBoxHeight, ref origin, ref xSpacing, ref zSpacing, i, j, out columnVolumeCenter)) > 0)\n                    {\n                        float columnVolume = submergedHeight * perColumnArea;\n                        Vector3.Multiply(ref columnVolumeCenter, columnVolume, out columnVolumeCenter);\n                        Vector3.Add(ref columnVolumeCenter, ref submergedCenter, out submergedCenter);\n                        submergedVolume += columnVolume;\n                    }\n                }\n            }\n            Vector3.Divide(ref submergedCenter, submergedVolume, out submergedCenter);\n            //Pull the submerged center into world space before applying the force.\n            RigidTransform.Transform(ref submergedCenter, ref surfaceTransform, out submergedCenter);\n\n        }\n\n        void GetSamplingOrigin(ref BoundingBox entityBoundingBox, out Vector3 xSpacing, out Vector3 zSpacing, out float perColumnArea, out Vector3 origin)\n        {\n            //Compute spacing and increment informaiton.\n            float widthIncrement = (entityBoundingBox.Max.X - entityBoundingBox.Min.X) / samplePointsPerDimension;\n            float lengthIncrement = (entityBoundingBox.Max.Z - entityBoundingBox.Min.Z) / samplePointsPerDimension;\n            xSpacing = new Vector3(widthIncrement, 0, 0);\n            zSpacing = new Vector3(0, 0, lengthIncrement);\n            Vector3.Transform(ref xSpacing, ref surfaceTransform.Orientation, out xSpacing);\n            Vector3.Transform(ref zSpacing, ref surfaceTransform.Orientation, out zSpacing);\n            perColumnArea = widthIncrement * lengthIncrement;\n\n\n            //Compute the origin.\n            Vector3 minimum;\n            RigidTransform.Transform(ref entityBoundingBox.Min, ref surfaceTransform, out minimum);\n            //Matrix3X3.TransformTranspose(ref entityBoundingBox.Min, ref surfaceOrientationTranspose, out minimum);\n            Vector3 offset;\n            Vector3.Multiply(ref xSpacing, .5f, out offset);\n            Vector3.Add(ref minimum, ref offset, out origin);\n            Vector3.Multiply(ref zSpacing, .5f, out offset);\n            Vector3.Add(ref origin, ref offset, out origin);\n\n\n            //TODO: Could adjust the grid origin such that a ray always hits the deepest point.\n            //The below code is a prototype of the idea, but has bugs.\n            //var convexInfo = collidable as ConvexCollisionInformation;\n            //if (convexInfo != null)\n            //{\n            //    Vector3 dir;\n            //    Vector3.Negate(ref upVector, out dir);\n            //    Vector3 extremePoint;\n            //    convexInfo.Shape.GetExtremePoint(dir, ref convexInfo.worldTransform, out extremePoint);\n            //    //Use extreme point to snap to grid.\n            //    Vector3.Subtract(ref extremePoint, ref origin, out offset);\n            //    float offsetX, offsetZ;\n            //    Vector3.Dot(ref offset, ref right, out offsetX);\n            //    Vector3.Dot(ref offset, ref backward, out offsetZ);\n            //    offsetX %= widthIncrement;\n            //    offsetZ %= lengthIncrement;\n\n            //    if (offsetX > .5f * widthIncrement)\n            //    {\n            //        Vector3.Multiply(ref right, 1 - offsetX, out offset);\n            //    }\n            //    else\n            //    {\n            //        Vector3.Multiply(ref right, -offsetX, out offset);\n            //    }\n\n            //    if (offsetZ > .5f * lengthIncrement)\n            //    {\n            //        Vector3 temp;\n            //        Vector3.Multiply(ref right, 1 - offsetZ, out temp);\n            //        Vector3.Add(ref temp, ref offset, out offset);\n            //    }\n            //    else\n            //    {\n            //        Vector3 temp;\n            //        Vector3.Multiply(ref right, -offsetZ, out temp);\n            //        Vector3.Add(ref temp, ref offset, out offset);\n            //    }\n\n            //    Vector3.Add(ref origin, ref offset, out origin);\n\n\n            //}\n        }\n\n        float GetSubmergedHeight(EntityCollidable collidable, float maxLength, float boundingBoxHeight, ref Vector3 rayOrigin, ref Vector3 xSpacing, ref Vector3 zSpacing, int i, int j, out Vector3 volumeCenter)\n        {\n            Ray ray;\n            Vector3.Multiply(ref xSpacing, i, out ray.Position);\n            Vector3.Multiply(ref zSpacing, j, out ray.Direction);\n            Vector3.Add(ref ray.Position, ref ray.Direction, out ray.Position);\n            Vector3.Add(ref ray.Position, ref rayOrigin, out ray.Position);\n\n            ray.Direction = upVector;\n            //do a bottom-up raycast.\n            RayHit rayHit;\n            //Only go up to maxLength.  If it's further away than maxLength, then it's above the water and it doesn't contribute anything.\n            if (collidable.RayCast(ray, maxLength, out rayHit))\n            {\n                //Position the ray to point from the other side.\n                Vector3.Multiply(ref ray.Direction, boundingBoxHeight, out ray.Direction);\n                Vector3.Add(ref ray.Position, ref ray.Direction, out ray.Position);\n                Vector3.Negate(ref upVector, out ray.Direction);\n\n                //Transform the hit into local space.\n                RigidTransform.TransformByInverse(ref rayHit.Location, ref surfaceTransform, out rayHit.Location);\n                float bottomY = rayHit.Location.Y;\n                float bottom = rayHit.T;\n                Vector3 bottomPosition = rayHit.Location;\n                if (collidable.RayCast(ray, boundingBoxHeight - rayHit.T, out rayHit))\n                {\n                    //Transform the hit into local space.\n                    RigidTransform.TransformByInverse(ref rayHit.Location, ref surfaceTransform, out rayHit.Location);\n                    Vector3.Add(ref rayHit.Location, ref bottomPosition, out volumeCenter);\n                    Vector3.Multiply(ref volumeCenter, .5f, out volumeCenter);\n                    return Math.Min(-bottomY, boundingBoxHeight - rayHit.T - bottom);\n                }\n                //This inner raycast should always hit, but just in case it doesn't due to some numerical problem, give it a graceful way out.\n                volumeCenter = Vector3.Zero;\n                return 0;\n            }\n            volumeCenter = Vector3.Zero;\n            return 0;\n        }\n\n        public override void OnAdditionToSpace(ISpace newSpace)\n        {\n            base.OnAdditionToSpace(newSpace);\n            Space space = newSpace as Space;\n            ThreadManager = space.ThreadManager;\n            QueryAccelerator = space.BroadPhase.QueryAccelerator;\n        }\n\n        public override void OnRemovalFromSpace(ISpace oldSpace)\n        {\n            base.OnRemovalFromSpace(oldSpace);\n            ThreadManager = null;\n            QueryAccelerator = null;\n        }\n\n        private CollisionRules collisionRules = new CollisionRules();\n        /// <summary>\n        /// Gets or sets the collision rules associated with the fluid volume.\n        /// </summary>\n        public CollisionRules CollisionRules\n        {\n            get\n            {\n                return collisionRules;\n            }\n            set\n            {\n                collisionRules = value;\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/ForceFields/BoundingBoxForceFieldShape.cs",
    "content": "using System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.UpdateableSystems.ForceFields\n{\n    /// <summary>\n    /// Defines the area in which a force field works using an entity's shape.\n    /// </summary>\n    public class BoundingBoxForceFieldShape : ForceFieldShape\n    {\n        private readonly List<Entity> affectedEntities = new List<Entity>();\n        private readonly RawList<BroadPhaseEntry> affectedEntries = new RawList<BroadPhaseEntry>();\n\n        /// <summary>\n        /// Constructs a new force field shape using a bounding box.\n        /// </summary>\n        /// <param name=\"box\">Bounding box to use.</param>\n        public BoundingBoxForceFieldShape(BoundingBox box)\n        {\n            BoundingBox = box;\n        }\n\n        /// <summary>\n        /// Gets or sets the bounding box used by the shape.\n        /// </summary>\n        public BoundingBox BoundingBox { get; set; }\n\n        /// <summary>\n        /// Determines the possibly involved entities.\n        /// </summary>\n        /// <returns>Possibly involved entities.</returns>\n        public override IList<Entity> GetPossiblyAffectedEntities()\n        {\n            affectedEntities.Clear();\n            ForceField.QueryAccelerator.GetEntries(BoundingBox, affectedEntries);\n            for (int i = 0; i < affectedEntries.Count; i++)\n            {\n                var EntityCollidable = affectedEntries[i] as EntityCollidable;\n                if (EntityCollidable != null)\n                    affectedEntities.Add(EntityCollidable.Entity);\n            }\n            affectedEntries.Clear();\n            return affectedEntities;\n        }\n\n        /// <summary>\n        /// Determines if the entity is affected by the force field.\n        /// </summary>\n        /// <param name=\"testEntity\">Entity to test.</param>\n        /// <returns>Whether the entity is affected.</returns>\n        public override bool IsEntityAffected(Entity testEntity)\n        {\n            return true;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/ForceFields/BoundingSphereForceFieldShape.cs",
    "content": "using System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.UpdateableSystems.ForceFields\n{\n    /// <summary>\n    /// Defines the area in which a force field works using an entity's shape.\n    /// </summary>\n    public class BoundingSphereForceFieldShape : ForceFieldShape\n    {\n        private readonly List<Entity> affectedEntities = new List<Entity>();\n        private readonly RawList<BroadPhaseEntry> affectedEntries = new RawList<BroadPhaseEntry>();\n\n        /// <summary>\n        /// Constructs a new force field shape using a bounding sphere.\n        /// </summary>\n        /// <param name=\"sphere\">Bounding sphere to use.</param>\n        public BoundingSphereForceFieldShape(BoundingSphere sphere)\n        {\n            BoundingSphere = sphere;\n        }\n\n        /// <summary>\n        /// Gets or sets the bounding box used by the shape.\n        /// </summary>\n        public BoundingSphere BoundingSphere { get; set; }\n\n        /// <summary>\n        /// Determines the possibly involved entities.\n        /// </summary>\n        /// <returns>Possibly involved entities.</returns>\n        public override IList<Entity> GetPossiblyAffectedEntities()\n        {\n            affectedEntities.Clear();\n            ForceField.QueryAccelerator.GetEntries(BoundingSphere, affectedEntries);\n            for (int i = 0; i < affectedEntries.Count; i++)\n            {\n                var EntityCollidable = affectedEntries[i] as EntityCollidable;\n                if (EntityCollidable != null)\n                    affectedEntities.Add(EntityCollidable.Entity);\n            }\n            affectedEntries.Clear();\n            return affectedEntities;\n        }\n\n        /// <summary>\n        /// Determines if the entity is affected by the force field.\n        /// </summary>\n        /// <param name=\"testEntity\">Entity to test.</param>\n        /// <returns>Whether the entity is affected.</returns>\n        public override bool IsEntityAffected(Entity testEntity)\n        {\n            return true;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/ForceFields/ForceField.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.Entities;\nusing BEPUphysics.Threading;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.UpdateableSystems.ForceFields\n{\n    /// <summary>\n    /// Superclass of objects which apply forces to entities in some field.\n    /// </summary>\n    public abstract class ForceField : Updateable, IDuringForcesUpdateable\n    {\n        private readonly Action<int> subfunction;\n        private IList<Entity> affectedEntities;\n        private float currentTimestep;\n        private ForceFieldShape shape;\n\n\n        ///<summary>\n        /// Gets or sets whether or not threading is allowed.\n        ///</summary>\n        public bool AllowMultithreading { get; set; }\n\n        ///<summary>\n        /// Gets or sets the query accelerator used by the force field to find entities.\n        ///</summary>\n        public IQueryAccelerator QueryAccelerator { get; set; }\n        ///<summary>\n        /// Gets or sets the thread manager used by the force field.\n        ///</summary>\n        public IThreadManager ThreadManager { get; set; }\n\n        /// <summary>\n        /// Constructs a force field.\n        /// </summary>\n        /// <param name=\"shape\">Shape to use for the force field.</param>\n        protected ForceField(ForceFieldShape shape)\n        {\n            Shape = shape;\n            subfunction = new Action<int>(CalculateImpulsesSubfunction);\n            AllowMultithreading = true;\n        }\n\n        /// <summary>\n        /// Gets or sets whether the the force field will force affected entities to wake up.\n        /// </summary>\n        public bool ForceWakeUp { get; set; }\n\n        /// <summary>\n        /// Gets or sets the shape of the force field used to determine which entities to apply forces to.\n        /// </summary>\n        public ForceFieldShape Shape\n        {\n            get { return shape; }\n            set\n            {\n                if (value != null && value.ForceField != null)\n                    throw new ArgumentException(\"The force field shape already belongs to another force field.\");\n                //Get rid of my old shape.\n                if (shape != null)\n                {\n                    shape.ForceField = null;\n                }\n                //Get my new shape!\n                shape = value;\n                if (shape != null)\n                {\n                    shape.ForceField = this;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Performs any custom logic desired prior to the force application.\n        /// </summary>\n        protected virtual void PreUpdate()\n        {\n\n        }\n\n        /// <summary>\n        /// Applies forces specified by the given calculation delegate to bodies in the volume.\n        /// Called automatically when needed by the owning Space.\n        /// </summary>\n        /// <param name=\"dt\">Time since the last frame in simulation seconds.</param>\n        void IDuringForcesUpdateable.Update(float dt)\n        {\n            PreUpdate();\n            affectedEntities = Shape.GetPossiblyAffectedEntities();\n            if (AllowMultithreading && ThreadManager.ThreadCount > 1)\n            {\n                currentTimestep = dt;\n                ThreadManager.ForLoop(0, affectedEntities.Count, subfunction);\n            }\n            else\n            {\n                currentTimestep = dt;\n                //No multithreading, so do it directly.\n                int count = affectedEntities.Count;\n                for (int i = 0; i < count; i++)\n                {\n                    CalculateImpulsesSubfunction(i);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Calculates the impulse to apply to the entity.\n        /// </summary>\n        /// <param name=\"e\">Affected entity.</param>\n        /// <param name=\"dt\">Duration between simulation updates.</param>\n        /// <param name=\"impulse\">Impulse to apply to the entity.</param>\n        protected abstract void CalculateImpulse(Entity e, float dt, out Vector3 impulse);\n\n        private void CalculateImpulsesSubfunction(int index)\n        {\n            Entity e = affectedEntities[index];\n            if (e.isDynamic && (e.activityInformation.IsActive || ForceWakeUp) && Shape.IsEntityAffected(e))\n            {\n                if (ForceWakeUp)\n                    e.activityInformation.Activate();\n                Vector3 impulse;\n                CalculateImpulse(e, currentTimestep, out impulse);\n                e.ApplyLinearImpulse(ref impulse);\n            }\n        }\n\n        /// <summary>\n        /// Called after the object is added to a space.\n        /// </summary>\n        /// <param name=\"newSpace\">Space to which the field has been added.</param>\n        public override void OnAdditionToSpace(ISpace newSpace)\n        {\n            base.OnAdditionToSpace(newSpace);\n            var space = newSpace as Space;\n            if(space != null)\n            {\n                ThreadManager = space.ThreadManager;\n                QueryAccelerator = space.BroadPhase.QueryAccelerator;\n            }\n        }\n\n        /// <summary>\n        /// Called before an object is removed from its space.\n        /// </summary>\n        /// <param name=\"oldSpace\">Space from which the object has been removed.</param>\n        public override void OnRemovalFromSpace(ISpace oldSpace)\n        {\n            base.OnRemovalFromSpace(oldSpace);\n            ThreadManager = null;\n            QueryAccelerator = null;\n        }\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/ForceFields/ForceFieldShape.cs",
    "content": "using System.Collections.Generic;\nusing BEPUphysics.Entities;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.UpdateableSystems.ForceFields\n{\n    /// <summary>\n    /// Superclass of force field shapes that test whether or not entities are affected by a forcefield.\n    /// </summary>\n    public abstract class ForceFieldShape\n    {\n        /// <summary>\n        /// Force field associated with this shape.\n        /// </summary>\n        public ForceField ForceField { get; internal set; }\n\n\n        /// <summary>\n        /// Uses an efficient query to see what entities may be affected.\n        /// Usually uses a broadphase bounding box query.\n        /// </summary>\n        /// <returns>Possibly affected entities.</returns>\n        public abstract IList<Entity> GetPossiblyAffectedEntities();\n\n        /// <summary>\n        /// Performs a narrow-phase test to see if an entity is affected by the force field.\n        /// </summary>\n        /// <param name=\"entity\">Entity to test.</param>\n        /// <returns>Whether or not the entity is affected.</returns>\n        public abstract bool IsEntityAffected(Entity entity);\n    }\n}"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/ForceFields/InfiniteForceFieldShape.cs",
    "content": "using System.Collections.Generic;\nusing BEPUphysics.Entities;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.UpdateableSystems.ForceFields\n{\n    /// <summary>\n    /// Defines the area in which a force field works using an entity's shape.\n    /// </summary>\n    public class InfiniteForceFieldShape : ForceFieldShape\n    {\n        private IList<Entity> boxedList;\n        /// <summary>\n        /// Determines the possibly involved entities.\n        /// </summary>\n        /// <returns>Possibly involved entities.</returns>\n        public override IList<Entity> GetPossiblyAffectedEntities()\n        {\n            return boxedList ?? (boxedList = (ForceField as ISpaceObject).Space.Entities);\n        }\n\n        /// <summary>\n        /// Determines if the entity is affected by the force field.\n        /// </summary>\n        /// <param name=\"testEntity\">Entity to test.</param>\n        /// <returns>Whether the entity is affected.</returns>\n        public override bool IsEntityAffected(Entity testEntity)\n        {\n            return true;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/ForceFields/VolumeForceFieldShape.cs",
    "content": "using System.Collections.Generic;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.Entities;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUphysics.UpdateableSystems.ForceFields\n{\n    /// <summary>\n    /// Defines the area in which a force field works using an entity's shape.\n    /// </summary>\n    public class VolumeForceFieldShape : ForceFieldShape\n    {\n        private readonly RawList<Entity> affectedEntities = new RawList<Entity>();\n\n        /// <summary>\n        /// Constructs a new force field shape using a detector volume.\n        /// </summary>\n        /// <param name=\"volume\">Volume to use.</param>\n        public VolumeForceFieldShape(DetectorVolume volume)\n        {\n            Volume = volume;\n        }\n\n        /// <summary>\n        /// Gets or sets the volume used by the shape.\n        /// </summary>\n        public DetectorVolume Volume { get; set; }\n\n        /// <summary>\n        /// Determines the possibly involved entities.\n        /// </summary>\n        /// <returns>Possibly involved entities.</returns>\n        public override IList<Entity> GetPossiblyAffectedEntities()\n        {\n            affectedEntities.Clear();\n            foreach (var entity in Volume.pairs.Keys)\n            {\n                affectedEntities.Add(entity);\n            }\n            return affectedEntities;\n        }\n\n        /// <summary>\n        /// Determines if the entity is affected by the force field.\n        /// </summary>\n        /// <param name=\"testEntity\">Entity to test.</param>\n        /// <returns>Whether the entity is affected.</returns>\n        public override bool IsEntityAffected(Entity testEntity)\n        {\n            return Volume.pairs[testEntity].Touching;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/IBeforeNarrowPhaseUpdateable.cs",
    "content": "﻿namespace BEPUphysics.UpdateableSystems\n{\n    ///<summary>\n    /// Defines an object which is updated by the space before the narrow phase runs.\n    ///</summary>\n    public interface IBeforeNarrowPhaseUpdateable : ISpaceUpdateable\n    {\n        ///<summary>\n        /// Updates the updateable before the narrow phase.\n        ///</summary>\n        ///<param name=\"dt\">Time step duration.</param>\n        void Update(float dt);\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/IBeforePositionUpdateUpdateable.cs",
    "content": "﻿namespace BEPUphysics.UpdateableSystems\n{\n    ///<summary>\n    /// Defines an object which is updated by the space at the end of a time step.\n    ///</summary>\n    public interface IBeforePositionUpdateUpdateable : ISpaceUpdateable\n    {\n\n        ///<summary>\n        /// Updates the object at the end of a time step.\n        ///</summary>\n        ///<param name=\"dt\">Time step duration.</param>\n        void Update(float dt);\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/IBeforeSolverUpdateable.cs",
    "content": "﻿namespace BEPUphysics.UpdateableSystems\n{\n    ///<summary>\n    /// Defines an object which is updated by the space before the solver runs.\n    ///</summary>\n    public interface IBeforeSolverUpdateable : ISpaceUpdateable\n    {\n        ///<summary>\n        /// Updates the updateable before the solver.\n        ///</summary>\n        ///<param name=\"dt\">Time step duration.</param>\n        void Update(float dt);\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/IDuringForcesUpdateable.cs",
    "content": "﻿namespace BEPUphysics.UpdateableSystems\n{\n    ///<summary>\n    /// Defines an object which is updated by a space during force application.\n    ///</summary>\n    public interface IDuringForcesUpdateable : ISpaceUpdateable\n    {\n\n        ///<summary>\n        /// Updates the object during force application.\n        ///</summary>\n        ///<param name=\"dt\">Time step duration.</param>\n        void Update(float dt);\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/IEndOfFrameUpdateable.cs",
    "content": "﻿namespace BEPUphysics.UpdateableSystems\n{\n    ///<summary>\n    /// Defines an object which is updated by the space at the end of the frame.\n    ///</summary>\n    public interface IEndOfFrameUpdateable : ISpaceUpdateable\n    {\n        /// <summary>\n        /// Updates the object at the end of the frame.\n        /// </summary>\n        /// <param name=\"dt\">Time step duration.</param>\n        void Update(float dt);\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/IEndOfTimeStepUpdateable.cs",
    "content": "﻿namespace BEPUphysics.UpdateableSystems\n{\n    ///<summary>\n    /// Defines an object which is updated by the space at the end of a time step.\n    ///</summary>\n    public interface IEndOfTimeStepUpdateable : ISpaceUpdateable\n    {\n\n        ///<summary>\n        /// Updates the object at the end of a time step.\n        ///</summary>\n        ///<param name=\"dt\">Time step duration.</param>\n        void Update(float dt);\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/ISpaceUpdateable.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace BEPUphysics.UpdateableSystems\n{\n    ///<summary>\n    /// Defines an object which is updated by the space.\n    /// These refer to the special Updateable types which\n    /// allow for easier integration into the update flow of the space.\n    ///</summary>\n    public interface ISpaceUpdateable : ISpaceObject\n    {\n        /// <summary>\n        /// Gets and sets whether or not the updateable should be updated sequentially even in a multithreaded space.\n        /// If this is true, the updateable can make use of the space's ThreadManager for internal multithreading.\n        /// </summary>\n        bool IsUpdatedSequentially { get; set; }\n\n        /// <summary>\n        /// Gets and sets whether or not the updateable should be updated by the space.\n        /// </summary>\n        bool IsUpdating { get; set; }\n\n        ///<summary>\n        /// List of managers owning the updateable.\n        ///</summary>\n        List<UpdateableManager> Managers { get; }\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/Updateable.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace BEPUphysics.UpdateableSystems\n{\n    ///<summary>\n    /// Convenience superclass of Updateables.\n    /// Updateables are updated by the Space at various\n    /// points during the execution of the engine\n    /// to support easy extensions.\n    ///</summary>\n    public abstract class Updateable : ISpaceUpdateable\n    {\n\n        protected Updateable()\n        {\n            IsUpdating = true;\n        }\n\n        #region ISpaceUpdateable Members\n        List<UpdateableManager> managers = new List<UpdateableManager>();\n        List<UpdateableManager> ISpaceUpdateable.Managers\n        {\n            get\n            {\n                return managers;\n            }\n        }\n\n        private bool isUpdatedSequentially = true;\n        /// <summary>\n        /// Gets and sets whether or not the updateable should be updated sequentially even in a multithreaded space.\n        /// If this is true, the updateable can make use of the space's ThreadManager for internal multithreading.\n        /// </summary>\n        public bool IsUpdatedSequentially\n        {\n            get { return isUpdatedSequentially; }\n            set\n            {\n                bool oldValue = isUpdatedSequentially;\n                isUpdatedSequentially = value;\n                if (value != oldValue)\n                    for (int i = 0; i < managers.Count; i++)\n                    {\n                        managers[i].SequentialUpdatingStateChanged(this);\n                    }\n            }\n        }\n\n\n        /// <summary>\n        /// Gets and sets whether or not the updateable should be updated by its manager.\n        /// </summary>\n        public bool IsUpdating\n        {\n            get;\n            set;\n        }\n\n\n        /// <summary>\n        /// Called after the object is added to a space.\n        /// </summary>\n        /// <param name=\"newSpace\">Space to which the object was added.</param>\n        public virtual void OnAdditionToSpace(ISpace newSpace)\n        {\n        }\n\n\n        /// <summary>\n        /// Called before an object is removed from its space.\n        /// </summary>\n        /// <param name=\"oldSpace\">Space from which the object was removed.</param>\n        public virtual void OnRemovalFromSpace(ISpace oldSpace)\n        {\n        }\n\n        private ISpace space;\n        ISpace ISpaceObject.Space\n        {\n            get\n            {\n                return space;\n            }\n            set\n            {\n                space = value;\n            }\n        }\n\n        ///<summary>\n        /// Space that owns the updateable.\n        ///</summary>\n        public ISpace Space\n        {\n            get\n            {\n                return space;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the user data associated with this object.\n        /// </summary>\n        public object Tag { get; set; }\n        #endregion\n\n\n\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/UpdateableManager.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUphysics.Threading;\n\nnamespace BEPUphysics.UpdateableSystems\n{\n\n    ///<summary>\n    /// Superclass of updateable managers.\n    ///</summary>\n    public abstract class UpdateableManager : MultithreadedProcessingStage\n    {\n        protected Action<int> multithreadedUpdateDelegate;\n        protected TimeStepSettings timeStepSettings;\n        ///<summary>\n        /// Gets the time step settings used by the updateable manager.\n        ///</summary>\n        public TimeStepSettings TimeStepSettings\n        {\n            get\n            {\n                return timeStepSettings;\n            }\n        }\n        protected UpdateableManager(TimeStepSettings timeStepSettings)\n        {\n            this.timeStepSettings = timeStepSettings;\n            Enabled = true;\n        }\n\n        protected UpdateableManager(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : this(timeStepSettings)\n        {\n            ThreadManager = threadManager;\n            AllowMultithreading = true;\n        }\n\n        ///<summary>\n        /// Notifies the manager that the updateable has changed sequential updating state.\n        ///</summary>\n        ///<param name=\"updateable\">Updateable with changed state.</param>\n        public abstract void SequentialUpdatingStateChanged(ISpaceUpdateable updateable);\n\n\n        ///<summary>\n        /// Gets or sets the owning space.\n        ///</summary>\n        public ISpace Space { get; set; }\n    }\n\n    ///<summary>\n    /// Superclass of updateable managers with a specific type.\n    ///</summary>\n    ///<typeparam name=\"T\">Type of Updateable being managed.</typeparam>\n    public abstract class UpdateableManager<T> : UpdateableManager where T : class, ISpaceUpdateable\n    {\n        protected List<T> sequentiallyUpdatedUpdateables = new List<T>();\n        protected List<T> simultaneouslyUpdatedUpdateables = new List<T>();\n\n        protected UpdateableManager(TimeStepSettings timeStepSettings)\n            : base(timeStepSettings)\n        {\n            multithreadedUpdateDelegate = MultithreadedUpdate;\n        }\n\n        protected UpdateableManager(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : base(timeStepSettings, threadManager)\n        {\n            multithreadedUpdateDelegate = MultithreadedUpdate;\n        }\n\n\n\n\n        protected abstract void MultithreadedUpdate(int i);\n        protected abstract void SequentialUpdate(int i);\n\n        public override void SequentialUpdatingStateChanged(ISpaceUpdateable updateable)\n        {\n            if (updateable.Managers.Contains(this))\n            {\n                T u = updateable as T;\n                if (updateable.IsUpdatedSequentially)\n                {\n                    if (simultaneouslyUpdatedUpdateables.Remove(u))\n                        sequentiallyUpdatedUpdateables.Add(u);\n                }\n                else\n                {\n                    if (sequentiallyUpdatedUpdateables.Remove(u))\n                        simultaneouslyUpdatedUpdateables.Add(u);\n                }\n            }\n            else\n            {\n                throw new ArgumentException(\"Updateable does not belong to this manager.\");\n            }\n        }\n\n        ///<summary>\n        /// Adds an updateable to the manager.\n        ///</summary>\n        ///<param name=\"updateable\">Updateable to add.</param>\n        ///<exception cref=\"Exception\">Thrown if the manager already contains the updateable.</exception>\n        public void Add(T updateable)\n        {\n            if (!updateable.Managers.Contains(this))\n            {\n                if (updateable.IsUpdatedSequentially)\n                    sequentiallyUpdatedUpdateables.Add(updateable);\n                else\n                    simultaneouslyUpdatedUpdateables.Add(updateable);\n                updateable.Managers.Add(this);\n            }\n            else\n            {\n                throw new ArgumentException(\"Updateable already belongs to the manager, cannot re-add.\");\n            }\n        }\n\n        ///<summary>\n        /// Removes an updateable from the manager.\n        ///</summary>\n        ///<param name=\"updateable\">Updateable to remove.</param>\n        ///<exception cref=\"Exception\">Thrown if the manager does not contain the updateable.</exception>\n        public void Remove(T updateable)\n        {\n            if (updateable.Managers.Contains(this))\n            {\n                if (updateable.IsUpdatedSequentially)\n                    sequentiallyUpdatedUpdateables.Remove(updateable);\n                else\n                    simultaneouslyUpdatedUpdateables.Remove(updateable);\n                updateable.Managers.Remove(this);\n            }\n            else\n            {\n                throw new ArgumentException(\"Updateable does not belong to this manager; cannot remove.\");\n            }\n\n        }\n\n        protected override void UpdateMultithreaded()\n        {\n            for (int i = 0; i < sequentiallyUpdatedUpdateables.Count; i++)\n            {\n                SequentialUpdate(i);\n            }\n            ThreadManager.ForLoop(0, simultaneouslyUpdatedUpdateables.Count, multithreadedUpdateDelegate);\n        }\n\n        protected override void UpdateSingleThreaded()\n        {\n            for (int i = 0; i < sequentiallyUpdatedUpdateables.Count; i++)\n            {\n                SequentialUpdate(i);\n            }\n            for (int i = 0; i < simultaneouslyUpdatedUpdateables.Count; i++)\n            {\n                MultithreadedUpdate(i);\n            }\n        }\n   \n\n    }\n\n\n\n}\n"
  },
  {
    "path": "BEPUphysics/UpdateableSystems/UpdateableManagers.cs",
    "content": "﻿using BEPUphysics.Threading;\nusing BEPUutilities;\n\nnamespace BEPUphysics.UpdateableSystems\n{\n\n    ///<summary>\n    /// Manages updateables that update during the forces stage.\n    ///</summary>\n    public class DuringForcesUpdateableManager : UpdateableManager<IDuringForcesUpdateable>\n    {\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        public DuringForcesUpdateableManager(TimeStepSettings timeStepSettings)\n            : base(timeStepSettings)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        /// <param name=\"threadManager\">Thread manager to use.</param>\n        public DuringForcesUpdateableManager(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : base(timeStepSettings, threadManager)\n        {\n        }\n\n        protected override void MultithreadedUpdate(int i)\n        {\n            if (simultaneouslyUpdatedUpdateables[i].IsUpdating)\n                simultaneouslyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n        protected override void SequentialUpdate(int i)\n        {\n            if (sequentiallyUpdatedUpdateables[i].IsUpdating)\n                sequentiallyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n\n    }\n\n    ///<summary>\n    /// Manages updateables that update before the narrow phase.\n    ///</summary>\n    public class BeforeNarrowPhaseUpdateableManager : UpdateableManager<IBeforeNarrowPhaseUpdateable>\n    {\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        public BeforeNarrowPhaseUpdateableManager(TimeStepSettings timeStepSettings)\n            : base(timeStepSettings)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        /// <param name=\"threadManager\">Thread manager to use.</param>\n        public BeforeNarrowPhaseUpdateableManager(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : base(timeStepSettings, threadManager)\n        {\n        }\n\n        protected override void MultithreadedUpdate(int i)\n        {\n            if (simultaneouslyUpdatedUpdateables[i].IsUpdating)\n                simultaneouslyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n        protected override void SequentialUpdate(int i)\n        {\n            if (sequentiallyUpdatedUpdateables[i].IsUpdating)\n                sequentiallyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n    }\n\n    ///<summary>\n    /// Manages updateables that update before the solver.\n    ///</summary>\n    public class BeforeSolverUpdateableManager : UpdateableManager<IBeforeSolverUpdateable>\n    {\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        public BeforeSolverUpdateableManager(TimeStepSettings timeStepSettings)\n            : base(timeStepSettings)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        /// <param name=\"threadManager\">Thread manager to use.</param>\n        public BeforeSolverUpdateableManager(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : base(timeStepSettings, threadManager)\n        {\n        }\n\n        protected override void MultithreadedUpdate(int i)\n        {\n            if (simultaneouslyUpdatedUpdateables[i].IsUpdating)\n                simultaneouslyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n        protected override void SequentialUpdate(int i)\n        {\n            if (sequentiallyUpdatedUpdateables[i].IsUpdating)\n                sequentiallyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n    }\n\n    ///<summary>\n    /// Manages updateables that update at the end of a time step.\n    ///</summary>\n    public class BeforePositionUpdateUpdateableManager : UpdateableManager<IBeforePositionUpdateUpdateable>\n    {\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        public BeforePositionUpdateUpdateableManager(TimeStepSettings timeStepSettings)\n            : base(timeStepSettings)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        /// <param name=\"threadManager\">Thread manager to use.</param>\n        public BeforePositionUpdateUpdateableManager(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : base(timeStepSettings, threadManager)\n        {\n        }\n\n        protected override void MultithreadedUpdate(int i)\n        {\n            if (simultaneouslyUpdatedUpdateables[i].IsUpdating)\n                simultaneouslyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n        protected override void SequentialUpdate(int i)\n        {\n            if (sequentiallyUpdatedUpdateables[i].IsUpdating)\n                sequentiallyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n\n    }\n\n    ///<summary>\n    /// Manages updateables that update at the end of a time step.\n    ///</summary>\n    public class EndOfTimeStepUpdateableManager : UpdateableManager<IEndOfTimeStepUpdateable>\n    {\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        public EndOfTimeStepUpdateableManager(TimeStepSettings timeStepSettings)\n            : base(timeStepSettings)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        /// <param name=\"threadManager\">Thread manager to use.</param>\n        public EndOfTimeStepUpdateableManager(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : base(timeStepSettings, threadManager)\n        {\n        }\n\n        protected override void MultithreadedUpdate(int i)\n        {\n            if (simultaneouslyUpdatedUpdateables[i].IsUpdating)\n                simultaneouslyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n        protected override void SequentialUpdate(int i)\n        {\n            if (sequentiallyUpdatedUpdateables[i].IsUpdating)\n                sequentiallyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n\n    }\n\n    ///<summary>\n    /// Manages updateables that update at the end of a frame.\n    ///</summary>\n    public class EndOfFrameUpdateableManager : UpdateableManager<IEndOfFrameUpdateable>\n    {\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        public EndOfFrameUpdateableManager(TimeStepSettings timeStepSettings)\n            : base(timeStepSettings)\n        {\n        }\n\n        ///<summary>\n        /// Constructs a manager.\n        ///</summary>\n        ///<param name=\"timeStepSettings\">Time step settings to use.</param>\n        /// <param name=\"threadManager\">Thread manager to use.</param>\n        public EndOfFrameUpdateableManager(TimeStepSettings timeStepSettings, IThreadManager threadManager)\n            : base(timeStepSettings, threadManager)\n        {\n        }\n\n        protected override void MultithreadedUpdate(int i)\n        {\n            if (simultaneouslyUpdatedUpdateables[i].IsUpdating)\n                simultaneouslyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n        protected override void SequentialUpdate(int i)\n        {\n            if (sequentiallyUpdatedUpdateables[i].IsUpdating)\n                sequentiallyUpdatedUpdateables[i].Update(timeStepSettings.TimeStepDuration);\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUphysics/Vehicle/CylinderCastWheelShape.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing BEPUphysics.Entities;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUutilities;\nusing BEPUphysics.Materials;\n\nnamespace BEPUphysics.Vehicle\n{\n    /// <summary>\n    /// Uses a cylinder cast as the shape of a wheel.\n    /// </summary>\n    public class CylinderCastWheelShape : WheelShape\n    {\n        private CylinderShape shape;\n\n        /// <summary>\n        /// Gets or sets the unsteered orientation of the wheel in the vehicle's local space.\n        /// </summary>\n        public Quaternion LocalWheelOrientation { get; set; }\n\n        /// <summary>\n        /// Creates a new cylinder cast based wheel shape.\n        /// </summary>\n        /// <param name=\"radius\">Radius of the wheel.</param>\n        /// <param name=\"width\">Width of the wheel.</param>\n        /// <param name=\"localWheelOrientation\">Unsteered orientation of the wheel in the vehicle's local space.</param>\n        /// <param name=\"localGraphicTransform\">Local graphic transform of the wheel shape.\n        /// This transform is applied first when creating the shape's worldTransform.</param>\n        /// <param name=\"includeSteeringTransformInCast\">Whether or not to include the steering transform in the wheel shape cast. If false, the casted wheel shape will always point straight forward.\n        /// If true, it will rotate with steering. Sometimes, setting this to false is helpful when the cast shape would otherwise become exposed when steering.</param>\n        public CylinderCastWheelShape(float radius, float width, Quaternion localWheelOrientation, Matrix localGraphicTransform, bool includeSteeringTransformInCast)\n        {\n            shape = new CylinderShape(width, radius);\n            this.LocalWheelOrientation = localWheelOrientation;\n            LocalGraphicTransform = localGraphicTransform;\n            this.IncludeSteeringTransformInCast = includeSteeringTransformInCast;\n        }\n\n        /// <summary>\n        /// Gets or sets the radius of the wheel.\n        /// </summary>\n        public override sealed float Radius\n        {\n            get { return shape.Radius; }\n            set { shape.Radius = MathHelper.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// Gets or sets the width of the wheel.\n        /// </summary>\n        public float Width\n        {\n            get { return shape.Height; }\n            set { shape.Height = MathHelper.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// Gets or sets whether or not to include the rotation from steering in the cast. If false, the casted wheel shape will always point straight forward.\n        /// If true, it will rotate with steering. Sometimes, setting this to false is helpful when the cast shape would otherwise become exposed when steering.\n        /// </summary>\n        public bool IncludeSteeringTransformInCast { get; set; }\n\n        /// <summary>\n        /// Updates the wheel's world transform for graphics.\n        /// Called automatically by the owning wheel at the end of each frame.\n        /// If the engine is updating asynchronously, you can call this inside of a space read buffer lock\n        /// and update the wheel transforms safely.\n        /// </summary>\n        public override void UpdateWorldTransform()\n        {\n#if !WINDOWS\n            Vector3 newPosition = new Vector3();\n#else\n            Vector3 newPosition;\n#endif\n            Vector3 worldAttachmentPoint;\n            Vector3 localAttach;\n            Vector3.Add(ref wheel.suspension.localAttachmentPoint, ref wheel.vehicle.Body.CollisionInformation.localPosition, out localAttach);\n            worldTransform = Matrix3x3.ToMatrix4X4(wheel.vehicle.Body.BufferedStates.InterpolatedStates.OrientationMatrix);\n\n            Vector3.TransformNormal(ref localAttach, ref worldTransform, out worldAttachmentPoint);\n            worldAttachmentPoint += wheel.vehicle.Body.BufferedStates.InterpolatedStates.Position;\n\n            Vector3 worldDirection;\n            Vector3.Transform(ref wheel.suspension.localDirection, ref worldTransform, out worldDirection);\n\n            float length = wheel.suspension.currentLength;\n            newPosition.X = worldAttachmentPoint.X + worldDirection.X * length;\n            newPosition.Y = worldAttachmentPoint.Y + worldDirection.Y * length;\n            newPosition.Z = worldAttachmentPoint.Z + worldDirection.Z * length;\n\n            Matrix spinTransform;\n\n            Vector3 localSpinAxis;\n            Vector3.Cross(ref wheel.localForwardDirection, ref wheel.suspension.localDirection, out localSpinAxis);\n            Matrix.CreateFromAxisAngle(ref localSpinAxis, spinAngle, out spinTransform);\n\n\n            Matrix localTurnTransform;\n            Matrix.Multiply(ref localGraphicTransform, ref spinTransform, out localTurnTransform);\n            Matrix.Multiply(ref localTurnTransform, ref steeringTransform, out localTurnTransform);\n            //Matrix.Multiply(ref localTurnTransform, ref spinTransform, out localTurnTransform);\n            Matrix.Multiply(ref localTurnTransform, ref worldTransform, out worldTransform);\n            worldTransform.Translation = newPosition;\n        }\n\n        /// <summary>\n        /// Finds a supporting entity, the contact location, and the contact normal.\n        /// </summary>\n        /// <param name=\"location\">Contact point between the wheel and the support.</param>\n        /// <param name=\"normal\">Contact normal between the wheel and the support.</param>\n        /// <param name=\"suspensionLength\">Length of the suspension at the contact.</param>\n        /// <param name=\"supportingCollidable\">Collidable supporting the wheel, if any.</param>\n        /// <param name=\"entity\">Supporting object.</param>\n        /// <param name=\"material\">Material of the wheel.</param>\n        /// <returns>Whether or not any support was found.</returns>\n        protected internal override bool FindSupport(out Vector3 location, out Vector3 normal, out float suspensionLength, out Collidable supportingCollidable, out Entity entity, out Material material)\n        {\n            suspensionLength = float.MaxValue;\n            location = Toolbox.NoVector;\n            supportingCollidable = null;\n            entity = null;\n            normal = Toolbox.NoVector;\n            material = null;\n\n            Collidable testCollidable;\n            RayHit rayHit;\n\n            bool hit = false;\n\n            Quaternion localSteeringTransform;\n            Quaternion.CreateFromAxisAngle(ref wheel.suspension.localDirection, steeringAngle, out localSteeringTransform);\n            var startingTransform = new RigidTransform\n            {\n                Position = wheel.suspension.worldAttachmentPoint,\n                Orientation = Quaternion.Concatenate(Quaternion.Concatenate(LocalWheelOrientation, IncludeSteeringTransformInCast ? localSteeringTransform : Quaternion.Identity), wheel.vehicle.Body.orientation)\n            };\n            Vector3 sweep;\n            Vector3.Multiply(ref wheel.suspension.worldDirection, wheel.suspension.restLength, out sweep);\n\n            for (int i = 0; i < detector.CollisionInformation.pairs.Count; i++)\n            {\n                var pair = detector.CollisionInformation.pairs[i];\n                testCollidable = (pair.BroadPhaseOverlap.entryA == detector.CollisionInformation ? pair.BroadPhaseOverlap.entryB : pair.BroadPhaseOverlap.entryA) as Collidable;\n                if (testCollidable != null)\n                {\n                    if (CollisionRules.CollisionRuleCalculator(this, testCollidable) == CollisionRule.Normal &&\n                        testCollidable.ConvexCast(shape, ref startingTransform, ref sweep, out rayHit) &&\n                        rayHit.T * wheel.suspension.restLength < suspensionLength)\n                    {\n                        suspensionLength = rayHit.T * wheel.suspension.restLength;\n                        EntityCollidable entityCollidable;\n                        if ((entityCollidable = testCollidable as EntityCollidable) != null)\n                        {\n                            entity = entityCollidable.Entity;\n                            material = entityCollidable.Entity.Material;\n                        }\n                        else\n                        {\n                            entity = null;\n                            supportingCollidable = testCollidable;\n                            var materialOwner = testCollidable as IMaterialOwner;\n                            if (materialOwner != null)\n                                material = materialOwner.Material;\n                        }\n                        location = rayHit.Location;\n                        normal = rayHit.Normal;\n                        hit = true;\n                    }\n                }\n            }\n            if (hit)\n            {\n                if (suspensionLength > 0)\n                {\n                    float dot;\n                    Vector3.Dot(ref normal, ref wheel.suspension.worldDirection, out dot);\n                    if (dot > 0)\n                    {\n                        //The cylinder cast produced a normal which is opposite of what we expect.\n                        Vector3.Negate(ref normal, out normal);\n                    }\n                    normal.Normalize();\n                }\n                else\n                    Vector3.Negate(ref wheel.suspension.worldDirection, out normal);\n                return true;\n            }\n            return false;\n        }\n\n\n        /// <summary>\n        /// Initializes the detector entity and any other necessary logic.\n        /// </summary>\n        protected internal override void Initialize()\n        {\n            //Setup the dimensions of the detector.\n            var initialTransform = new RigidTransform { Orientation = LocalWheelOrientation };\n            BoundingBox boundingBox;\n            shape.GetBoundingBox(ref initialTransform, out boundingBox);\n            var expansion = wheel.suspension.localDirection * wheel.suspension.restLength;\n            if (expansion.X > 0)\n                boundingBox.Max.X += expansion.X;\n            else if (expansion.X < 0)\n                boundingBox.Min.X += expansion.X;\n\n            if (expansion.Y > 0)\n                boundingBox.Max.Y += expansion.Y;\n            else if (expansion.Y < 0)\n                boundingBox.Min.Y += expansion.Y;\n\n            if (expansion.Z > 0)\n                boundingBox.Max.Z += expansion.Z;\n            else if (expansion.Z < 0)\n                boundingBox.Min.Z += expansion.Z;\n\n\n            detector.Width = boundingBox.Max.X - boundingBox.Min.X;\n            detector.Height = boundingBox.Max.Y - boundingBox.Min.Y;\n            detector.Length = boundingBox.Max.Z - boundingBox.Min.Z;\n        }\n\n        /// <summary>\n        /// Updates the position of the detector before each step.\n        /// </summary>\n        protected internal override void UpdateDetectorPosition()\n        {\n#if !WINDOWS\n            Vector3 newPosition = new Vector3();\n#else\n            Vector3 newPosition;\n#endif\n\n            newPosition.X = wheel.suspension.worldAttachmentPoint.X + wheel.suspension.worldDirection.X * wheel.suspension.restLength * .5f;\n            newPosition.Y = wheel.suspension.worldAttachmentPoint.Y + wheel.suspension.worldDirection.Y * wheel.suspension.restLength * .5f;\n            newPosition.Z = wheel.suspension.worldAttachmentPoint.Z + wheel.suspension.worldDirection.Z * wheel.suspension.restLength * .5f;\n\n            detector.Position = newPosition;\n            if (IncludeSteeringTransformInCast)\n            {\n                Quaternion localSteeringTransform;\n                Quaternion.CreateFromAxisAngle(ref wheel.suspension.localDirection, steeringAngle, out localSteeringTransform);\n\n                detector.Orientation = Quaternion.Concatenate(localSteeringTransform, wheel.Vehicle.Body.orientation);\n            }\n            else\n            {\n                detector.Orientation = wheel.Vehicle.Body.orientation;\n            }\n            Vector3 linearVelocity;\n            Vector3.Subtract(ref newPosition, ref wheel.vehicle.Body.position, out linearVelocity);\n            Vector3.Cross(ref linearVelocity, ref wheel.vehicle.Body.angularVelocity, out linearVelocity);\n            Vector3.Add(ref linearVelocity, ref wheel.vehicle.Body.linearVelocity, out linearVelocity);\n            detector.LinearVelocity = linearVelocity;\n            detector.AngularVelocity = wheel.vehicle.Body.angularVelocity;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Vehicle/RaycastWheelShape.cs",
    "content": "﻿using BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Entities;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUutilities;\nusing BEPUphysics.Materials;\n\nnamespace BEPUphysics.Vehicle\n{\n    /// <summary>\n    /// Uses a raycast as the shape of a wheel.\n    /// </summary>\n    public class RaycastWheelShape : WheelShape\n    {\n        private float graphicalRadius;\n\n        /// <summary>\n        /// Creates a new raycast based wheel shape.\n        /// </summary>\n        /// <param name=\"graphicalRadius\">Graphical radius of the wheel.\n        /// This is not used for simulation.  It is only used in\n        /// determining aesthetic properties of a vehicle wheel,\n        /// like position and orientation.</param>\n        /// <param name=\"localGraphicTransform\">Local graphic transform of the wheel shape.\n        /// This transform is applied first when creating the shape's worldTransform.</param>\n        public RaycastWheelShape(float graphicalRadius, Matrix localGraphicTransform)\n        {\n            Radius = graphicalRadius;\n            LocalGraphicTransform = localGraphicTransform;\n        }\n\n        /// <summary>\n        /// Gets or sets the graphical radius of the wheel.\n        /// This is not used for simulation.  It is only used in\n        /// determining aesthetic properties of a vehicle wheel,\n        /// like position and orientation.\n        /// </summary>\n        public override sealed float Radius\n        {\n            get { return graphicalRadius; }\n            set { graphicalRadius = MathHelper.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// Updates the wheel's world transform for graphics.\n        /// Called automatically by the owning wheel at the end of each frame.\n        /// If the engine is updating asynchronously, you can call this inside of a space read buffer lock\n        /// and update the wheel transforms safely.\n        /// </summary>\n        public override void UpdateWorldTransform()\n        {\n#if !WINDOWS\n            Vector3 newPosition = new Vector3();\n#else\n            Vector3 newPosition;\n#endif\n            Vector3 worldAttachmentPoint;\n            Vector3 localAttach;\n            Vector3.Add(ref wheel.suspension.localAttachmentPoint, ref wheel.vehicle.Body.CollisionInformation.localPosition, out localAttach);\n            worldTransform = Matrix3x3.ToMatrix4X4(wheel.vehicle.Body.BufferedStates.InterpolatedStates.OrientationMatrix);\n\n            Vector3.TransformNormal(ref localAttach, ref worldTransform, out worldAttachmentPoint);\n            worldAttachmentPoint += wheel.vehicle.Body.BufferedStates.InterpolatedStates.Position;\n\n            Vector3 worldDirection;\n            Vector3.Transform(ref wheel.suspension.localDirection, ref worldTransform, out worldDirection);\n\n            float length = wheel.suspension.currentLength - graphicalRadius;\n            newPosition.X = worldAttachmentPoint.X + worldDirection.X * length;\n            newPosition.Y = worldAttachmentPoint.Y + worldDirection.Y * length;\n            newPosition.Z = worldAttachmentPoint.Z + worldDirection.Z * length;\n\n            Matrix spinTransform;\n\n            Vector3 localSpinAxis;\n            Vector3.Cross(ref wheel.localForwardDirection, ref wheel.suspension.localDirection, out localSpinAxis);\n            Matrix.CreateFromAxisAngle(ref localSpinAxis, spinAngle, out spinTransform);\n\n\n            Matrix localTurnTransform;\n            Matrix.Multiply(ref localGraphicTransform, ref spinTransform, out localTurnTransform);\n            Matrix.Multiply(ref localTurnTransform, ref steeringTransform, out localTurnTransform);\n            //Matrix.Multiply(ref localTurnTransform, ref spinTransform, out localTurnTransform);\n            Matrix.Multiply(ref localTurnTransform, ref worldTransform, out worldTransform);\n            worldTransform.Translation = newPosition;\n        }\n\n        /// <summary>\n        /// Finds a supporting entity, the contact location, and the contact normal.\n        /// </summary>\n        /// <param name=\"location\">Contact point between the wheel and the support.</param>\n        /// <param name=\"normal\">Contact normal between the wheel and the support.</param>\n        /// <param name=\"suspensionLength\">Length of the suspension at the contact.</param>\n        /// <param name=\"supportingCollidable\">Collidable supporting the wheel, if any.</param>\n        /// <param name=\"entity\">Supporting object.</param>\n        /// <param name=\"material\">Material of the wheel.</param>\n        /// <returns>Whether or not any support was found.</returns>\n        protected internal override bool FindSupport(out Vector3 location, out Vector3 normal, out float suspensionLength, out Collidable supportingCollidable, out Entity entity, out Material material)\n        {\n            suspensionLength = float.MaxValue;\n            location = Toolbox.NoVector;\n            supportingCollidable = null;\n            entity = null;\n            normal = Toolbox.NoVector;\n            material = null;\n\n            Collidable testCollidable;\n            RayHit rayHit;\n\n            bool hit = false;\n\n            for (int i = 0; i < detector.CollisionInformation.pairs.Count; i++)\n            {\n                var pair = detector.CollisionInformation.pairs[i];\n                testCollidable = (pair.BroadPhaseOverlap.entryA == detector.CollisionInformation ? pair.BroadPhaseOverlap.entryB : pair.BroadPhaseOverlap.entryA) as Collidable;\n                if (testCollidable != null)\n                {\n                    if (CollisionRules.CollisionRuleCalculator(this, testCollidable) == CollisionRule.Normal &&\n                        testCollidable.RayCast(new Ray(wheel.suspension.worldAttachmentPoint, wheel.suspension.worldDirection), wheel.suspension.restLength, out rayHit) &&\n                        rayHit.T < suspensionLength)\n                    {\n                        suspensionLength = rayHit.T;\n                        EntityCollidable entityCollidable;\n                        if ((entityCollidable = testCollidable as EntityCollidable) != null)\n                        {\n                            entity = entityCollidable.Entity;\n                            material = entityCollidable.Entity.Material;\n                        }\n                        else\n                        {\n                            entity = null;\n                            supportingCollidable = testCollidable;\n                            var materialOwner = testCollidable as IMaterialOwner;\n                            if (materialOwner != null)\n                                material = materialOwner.Material;\n                        }\n                        location = rayHit.Location;\n                        normal = rayHit.Normal;\n                        hit = true;\n                    }\n                }\n            }\n            if (hit)\n            {\n                if (suspensionLength > 0)\n                    normal.Normalize();\n                else\n                    Vector3.Negate(ref wheel.suspension.worldDirection, out normal);\n                return true;\n            }\n            return false;\n        }\n\n\n        /// <summary>\n        /// Initializes the detector entity and any other necessary logic.\n        /// </summary>\n        protected internal override void Initialize()\n        {\n            //Setup the dimensions of the detector.\n            Vector3 startpoint = wheel.suspension.localAttachmentPoint;\n            Vector3 endpoint = startpoint + wheel.suspension.localDirection * wheel.suspension.restLength;\n            Vector3 min, max;\n            Vector3.Min(ref startpoint, ref endpoint, out min);\n            Vector3.Max(ref startpoint, ref endpoint, out max);\n\n            detector.Width = max.X - min.X;\n            detector.Height = max.Y - min.Y;\n            detector.Length = max.Z - min.Z;\n        }\n\n        /// <summary>\n        /// Updates the position of the detector before each step.\n        /// </summary>\n        protected internal override void UpdateDetectorPosition()\n        {\n#if !WINDOWS\n            Vector3 newPosition = new Vector3();\n#else\n            Vector3 newPosition;\n#endif\n\n            newPosition.X = wheel.suspension.worldAttachmentPoint.X + wheel.suspension.worldDirection.X * wheel.suspension.restLength * .5f;\n            newPosition.Y = wheel.suspension.worldAttachmentPoint.Y + wheel.suspension.worldDirection.Y * wheel.suspension.restLength * .5f;\n            newPosition.Z = wheel.suspension.worldAttachmentPoint.Z + wheel.suspension.worldDirection.Z * wheel.suspension.restLength * .5f;\n\n            detector.Position = newPosition;\n            detector.OrientationMatrix = wheel.Vehicle.Body.orientationMatrix;\n            Vector3 linearVelocity;\n            Vector3.Subtract(ref newPosition, ref wheel.vehicle.Body.position, out linearVelocity);\n            Vector3.Cross(ref linearVelocity, ref wheel.vehicle.Body.angularVelocity, out linearVelocity);\n            Vector3.Add(ref linearVelocity, ref wheel.vehicle.Body.linearVelocity, out linearVelocity);\n            detector.LinearVelocity = linearVelocity;\n            detector.AngularVelocity = wheel.vehicle.Body.angularVelocity;\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Vehicle/Vehicle.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing BEPUphysics.Entities;\nusing BEPUutilities.DataStructures;\nusing BEPUphysics.UpdateableSystems;\n\nnamespace BEPUphysics.Vehicle\n{\n    /// <summary>\n    /// Simulates wheeled vehicles using a variety of constraints and shape casts.\n    /// </summary>\n    public class Vehicle : CombinedUpdateable, IDuringForcesUpdateable, IBeforeNarrowPhaseUpdateable, IEndOfTimeStepUpdateable, IEndOfFrameUpdateable\n    {\n        //TODO: The vehicle uses wheel 'fake constraints' that were made prior to the changes to the constraint system that allow for customizable solver settings.\n        //It would be convenient to use a SolverGroup to handle the wheel constraints, since the functionality is nearly the same.\n\n        private readonly List<Wheel> wheels = new List<Wheel>();\n\n        private Entity body;\n        internal List<Entity> previousSupports = new List<Entity>();\n\n        /// <summary>\n        /// Constructs a vehicle.\n        /// </summary>\n        /// <param name=\"shape\">Body of the vehicle.</param>\n        public Vehicle(Entity shape)\n        {\n            IsUpdatedSequentially = false;\n            Body = shape;\n            Body.activityInformation.IsAlwaysActive = true;\n            //The body is always active, so don't bother with stabilization either.\n            //Stabilization can introduce artifacts as well.\n            body.activityInformation.AllowStabilization = false;\n        }\n\n        /// <summary>\n        /// Constructs a vehicle.\n        /// </summary>\n        /// <param name=\"shape\">Body of the vehicle.</param>\n        /// <param name=\"wheelList\">List of wheels of the vehicle.</param>\n        public Vehicle(Entity shape, IEnumerable<Wheel> wheelList)\n        {\n            IsUpdatedSequentially = false;\n            Body = shape;\n            Body.activityInformation.IsAlwaysActive = true;     \n            //The body is always active, so don't bother with stabilization either.\n            //Stabilization can introduce artifacts as well.\n            body.activityInformation.AllowStabilization = false;\n            foreach (Wheel wheel in wheelList)\n            {\n                AddWheel(wheel);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the entity representing the shape of the car.\n        /// </summary>\n        public Entity Body\n        {\n            get { return body; }\n            set\n            {\n                body = value;\n                OnInvolvedEntitiesChanged();\n            }\n        }\n\n\n        /// <summary>\n        /// Number of wheels with supports.\n        /// </summary>\n        public int SupportedWheelCount\n        {\n            get\n            {\n                int toReturn = 0;\n                foreach (Wheel wheel in Wheels)\n                {\n                    if (wheel.HasSupport)\n                        toReturn++;\n                }\n                return toReturn;\n            }\n        }\n\n        /// <summary>\n        /// Gets the list of wheels supporting the vehicle.\n        /// </summary>\n        public List<Wheel> Wheels\n        {\n            get { return wheels; }\n        }\n\n\n        /// <summary>\n        /// Sets up the vehicle's information when being added to the space.\n        /// Called automatically when the space adds the vehicle.\n        /// </summary>\n        /// <param name=\"newSpace\">New owning space.</param>\n        public override void OnAdditionToSpace(ISpace newSpace)\n        {\n            newSpace.Add(body);\n            foreach (Wheel wheel in Wheels)\n            {\n                wheel.OnAdditionToSpace(newSpace);\n            }\n        }\n\n        /// <summary>\n        /// Sets up the vehicle's information when being added to the space.\n        /// Called automatically when the space adds the vehicle.\n        /// </summary>\n        public override void OnRemovalFromSpace(ISpace oldSpace)\n        {\n            foreach (Wheel wheel in Wheels)\n            {\n                wheel.OnRemovalFromSpace(oldSpace);\n            }\n            oldSpace.Remove(Body);\n        }\n\n        /// <summary>\n        /// Performs the end-of-frame update component.\n        /// </summary>\n        /// <param name=\"dt\">Time since last frame in simulation seconds.</param>\n        void IEndOfFrameUpdateable.Update(float dt)\n        {\n            //Graphics should be updated at the end of each frame.\n            foreach (Wheel wheel in Wheels)\n            {\n                wheel.UpdateAtEndOfFrame(dt);\n            }\n        }\n\n        /// <summary>\n        /// Performs the end-of-update update component.\n        /// </summary>\n        /// <param name=\"dt\">Time since last frame in simulation seconds.</param>\n        void IEndOfTimeStepUpdateable.Update(float dt)\n        {\n            //Graphics should be updated at the end of each frame.\n            foreach (Wheel wheel in Wheels)\n            {\n                wheel.UpdateAtEndOfUpdate(dt);\n            }\n        }\n\n        void IBeforeNarrowPhaseUpdateable.Update(float dt)\n        {\n            //After broadphase, test for supports.\n            foreach (Wheel wheel in wheels)\n            {\n                wheel.FindSupport();\n            }\n            OnInvolvedEntitiesChanged();\n        }\n\n        void IDuringForcesUpdateable.Update(float dt)\n        {\n            foreach (Wheel wheel in wheels)\n            {\n                wheel.UpdateDuringForces(dt);\n            }\n        }\n\n        /// <summary>\n        /// Adds a wheel to the vehicle.\n        /// </summary>\n        /// <param name=\"wheel\">WheelTest to add.</param>\n        public void AddWheel(Wheel wheel)\n        {\n            if (wheel.vehicle == null)\n            {\n                Wheels.Add(wheel);\n                wheel.OnAddedToVehicle(this);\n            }\n            else\n                throw new InvalidOperationException(\"Can't add a wheel to a vehicle if it already belongs to a vehicle.\");\n        }\n\n        /// <summary>\n        /// Removes a wheel from the vehicle.\n        /// </summary>\n        /// <param name=\"wheel\">WheelTest to remove.</param>\n        public void RemoveWheel(Wheel wheel)\n        {\n            if (wheel.vehicle == this)\n            {\n                wheel.OnRemovedFromVehicle();\n                Wheels.Remove(wheel);\n            }\n            else\n                throw new InvalidOperationException(\"Can't remove a wheel from a vehicle that does not own it.\");\n        }\n\n\n        /// <summary>\n        /// Updates the vehicle.\n        /// Called automatically when needed by the owning Space.\n        /// </summary>\n        public override float SolveIteration()\n        {\n            int numActive = 0;\n            foreach (Wheel wheel in Wheels)\n            {\n                if (wheel.isActiveInSolver)\n                    if (!wheel.ApplyImpulse())\n                        wheel.isActiveInSolver = false;\n                    else\n                        numActive++;\n            }\n            if (numActive == 0)\n                isActiveInSolver = false;\n            return solverSettings.minimumImpulse + 1; //We take care of ourselves.\n        }\n\n        /// <summary>\n        /// Adds entities associated with the solver item to the involved entities list.\n        /// Ensure that sortInvolvedEntities() is called at the end of the function.\n        /// This allows the non-batched multithreading system to lock properly.\n        /// </summary>\n        protected internal override void CollectInvolvedEntities(RawList<Entity> outputInvolvedEntities)\n        {\n            outputInvolvedEntities.Add(Body);\n            foreach (Wheel wheel in Wheels)\n            {\n                if (wheel.supportingEntity != null && !outputInvolvedEntities.Contains(wheel.supportingEntity))\n                    outputInvolvedEntities.Add(wheel.supportingEntity);\n            }\n        }\n\n        /// <summary>\n        /// Computes information required during the later update.\n        /// Called once before the iteration loop.\n        /// </summary>\n        /// <param name=\"dt\">Time since previous frame in simulation seconds.</param>\n        public override void Update(float dt)\n        {\n            //TODO: to help balance multithreading, what if each wheel were its own SolverUpdateable\n            //(no more CombinedUpdateable, basically)\n            //This might be okay, but chances are if each was totally isolated, the 'enter exit'\n            //of the monitor would be more expensive than just going in all at once and leaving at once.\n            //Maybe a SolverGroup instead of CombinedUpdateable, though.\n\n            //Update the wheel 'constraints.'\n            foreach (Wheel wheel in Wheels)\n            {\n                if (wheel.isActiveInSolver)\n                    wheel.PreStep(dt);\n            }\n        }\n\n        /// <summary>\n        /// Performs any pre-solve iteration work that needs exclusive\n        /// access to the members of the solver updateable.\n        /// Usually, this is used for applying warmstarting impulses.\n        /// </summary>\n        public override void ExclusiveUpdate()\n        {\n            foreach (Wheel wheel in Wheels)\n            {\n                if (wheel.isActiveInSolver)\n                    wheel.ExclusiveUpdate();\n            }\n        }\n\n        /// <summary>\n        /// Updates the activity state of the wheel constraints.\n        /// </summary>\n        public override void UpdateSolverActivity()\n        {\n            if (isActive)\n            {\n                isActiveInSolver = false;\n                if (body.activityInformation.IsActive)\n                {\n                    foreach (Wheel wheel in Wheels)\n                    {\n                        wheel.UpdateSolverActivity();\n                        isActiveInSolver = isActiveInSolver || wheel.isActiveInSolver;\n                    }\n                }\n            }\n            else\n                isActiveInSolver = false;\n        }\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Vehicle/Wheel.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUphysics.UpdateableSystems;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\nusing BEPUphysics.Materials;\nusing BEPUphysics.BroadPhaseEntries;\n\nnamespace BEPUphysics.Vehicle\n{\n    /// <summary>\n    /// Supports a Vehicle.\n    /// </summary>\n    public class Wheel\n    {\n        internal Vector3 ra, rb;\n\n        /// <summary>\n        /// Used for solver early outing.\n        /// </summary>\n        internal bool isActiveInSolver = true;\n        internal bool isSupported;\n\n        internal WheelBrake brake;\n        internal WheelDrivingMotor drivingMotor;\n\n\n        internal Vector3 localForwardDirection = new Vector3(0, 0, -1);\n\n        internal Vector3 normal;\n        internal WheelShape shape;\n        internal WheelSlidingFriction slidingFriction;\n\n        internal Collidable supportingCollidable;\n        internal Material supportMaterial;\n        internal Vector3 supportLocation;\n        internal Entity supportingEntity;\n        internal WheelSuspension suspension;\n        internal Vehicle vehicle;\n        internal Vector3 worldForwardDirection;\n\n\n        /// <summary>\n        /// Constructs a new wheel.  The WheelSlidingFriction, WheelBrake, WheelSuspension, and WheelDrivingMotor should be configured prior to using this wheel.\n        /// </summary>\n        /// <param name=\"shape\">Shape of the wheel.</param>\n        public Wheel(WheelShape shape)\n        {\n            slidingFriction = new WheelSlidingFriction(this);\n            brake = new WheelBrake(this);\n            suspension = new WheelSuspension(this);\n            drivingMotor = new WheelDrivingMotor(this);\n            Shape = shape;\n        }\n\n        /// <summary>\n        /// Constructs a new wheel.\n        /// </summary>\n        /// <param name=\"shape\">Shape of the wheel.</param>\n        /// <param name=\"suspension\">Springy support of the vehicle.</param>\n        /// <param name=\"motor\">Driving force for the wheel.</param>\n        /// <param name=\"rollingFriction\">Friction force resisting the forward and backward motion of the wheel.</param>\n        /// <param name=\"slidingFriction\">Friction force resisting the side to side motion of the wheel.</param>\n        public Wheel(WheelShape shape, WheelSuspension suspension, WheelDrivingMotor motor, WheelBrake rollingFriction, WheelSlidingFriction slidingFriction)\n        {\n            Suspension = suspension;\n            DrivingMotor = motor;\n            Brake = rollingFriction;\n            this.SlidingFriction = slidingFriction;\n            Shape = shape;\n        }\n\n        internal void UpdateSolverActivity()\n        {\n            isActiveInSolver = true;\n        }\n\n        /// <summary>\n        /// Gets the brake for this wheel.\n        /// </summary>\n        public WheelBrake Brake\n        {\n            get { return brake; }\n            set\n            {\n                if (brake != null)\n                    brake.Wheel = null;\n                if (value != null)\n                {\n                    if (value.Wheel == null)\n                    {\n                        value.Wheel = this;\n                    }\n                    else\n                        throw new InvalidOperationException(\"Can't use a rolling friction object that already belongs to another wheel.\");\n                }\n                brake = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the motor that turns the wheel.\n        /// </summary>\n        public WheelDrivingMotor DrivingMotor\n        {\n            get { return drivingMotor; }\n            set\n            {\n                if (drivingMotor != null)\n                    drivingMotor.Wheel = null;\n                if (value != null)\n                {\n                    if (value.Wheel == null)\n                    {\n                        value.Wheel = this;\n                    }\n                    else\n                        throw new InvalidOperationException(\"Can't use a motor object that already belongs to another wheel.\");\n                }\n                drivingMotor = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets whether or not this wheel is sitting on anything.\n        /// </summary>\n        public bool HasSupport\n        {\n            get { return isSupported; }\n        }\n\n        /// <summary>\n        /// Gets or sets the local space forward direction of the wheel.\n        /// </summary>\n        public Vector3 LocalForwardDirection\n        {\n            get { return localForwardDirection; }\n            set\n            {\n                localForwardDirection = Vector3.Normalize(value);\n                if (vehicle != null)\n                    Matrix3x3.Transform(ref localForwardDirection, ref Vehicle.Body.orientationMatrix, out worldForwardDirection);\n                else\n                    worldForwardDirection = localForwardDirection;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the shape of this wheel used to find collisions with the ground.\n        /// </summary>\n        public WheelShape Shape\n        {\n            get { return shape; }\n            set\n            {\n                if (shape != null)\n                    shape.Wheel = null;\n                if (value != null)\n                {\n                    if (value.Wheel == null)\n                    {\n                        value.Wheel = this;\n                        value.Initialize();\n                    }\n                    else\n                        throw new InvalidOperationException(\"Can't use a wheel shape object that already belongs to another wheel.\");\n                }\n                shape = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the sliding friction settings for this wheel.\n        /// </summary>\n        public WheelSlidingFriction SlidingFriction\n        {\n            get { return slidingFriction; }\n            set\n            {\n                if (slidingFriction != null)\n                    slidingFriction.Wheel = null;\n                if (value != null)\n                {\n                    if (value.Wheel == null)\n                    {\n                        value.Wheel = this;\n                    }\n                    else\n                        throw new InvalidOperationException(\"Can't use a sliding friction object that already belongs to another wheel.\");\n                }\n                slidingFriction = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the current support location of this wheel.\n        /// </summary>\n        public Vector3 SupportLocation\n        {\n            get { return supportLocation; }\n        }\n\n        /// <summary>\n        /// Gets the normal \n        /// </summary>\n        public Vector3 SupportNormal\n        {\n            get { return normal; }\n        }\n\n        /// <summary>\n        /// Gets the entity supporting the wheel, if any.\n        /// </summary>\n        public Entity SupportingEntity\n        {\n            get { return supportingEntity; }\n        }\n\n        /// <summary>\n        /// Gets the collidable supporting the wheel, if any.\n        /// </summary>\n        public Collidable SupportingCollidable\n        {\n            get\n            {\n                return supportingCollidable;\n            }\n        }\n\n        /// <summary>\n        /// Gets the material associated with the support, if any.\n        /// </summary>\n        public Material SupportMaterial\n        {\n            get\n            {\n                return supportMaterial;\n            }\n        }\n\n        /// <summary>\n        /// Gets the suspension supporting this wheel.\n        /// </summary>\n        public WheelSuspension Suspension\n        {\n            get { return suspension; }\n            set\n            {\n                if (suspension != null)\n                    suspension.Wheel = null;\n                if (value != null)\n                {\n                    if (value.Wheel == null)\n                    {\n                        value.Wheel = this;\n                    }\n                    else\n                        throw new InvalidOperationException(\"Can't use a suspension object that already belongs to another wheel.\");\n                }\n                suspension = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the vehicle this wheel is attached to.\n        /// </summary>\n        public Vehicle Vehicle\n        {\n            get { return vehicle; }\n        }\n\n        /// <summary>\n        /// Gets or sets the world space forward direction of the wheel.\n        /// </summary>\n        public Vector3 WorldForwardDirection\n        {\n            get { return worldForwardDirection; }\n            set\n            {\n                worldForwardDirection = Vector3.Normalize(value);\n                if (vehicle != null)\n                {\n                    Quaternion conjugate;\n                    Quaternion.Conjugate(ref Vehicle.Body.orientation, out conjugate);\n                    Vector3.Transform(ref worldForwardDirection, ref conjugate, out localForwardDirection);\n                }\n                else\n                    localForwardDirection = worldForwardDirection;\n            }\n        }\n\n\n        internal void PreStep(float dt)\n        {\n            Matrix.CreateFromAxisAngle(ref suspension.localDirection, shape.steeringAngle, out shape.steeringTransform);\n            Vector3.TransformNormal(ref localForwardDirection, ref shape.steeringTransform, out worldForwardDirection);\n            Matrix3x3.Transform(ref worldForwardDirection, ref Vehicle.Body.orientationMatrix, out worldForwardDirection);\n            if (HasSupport)\n            {\n                Vector3.Subtract(ref supportLocation, ref Vehicle.Body.position, out ra);\n                if (supportingEntity != null)\n                    Vector3.Subtract(ref supportLocation, ref SupportingEntity.position, out rb);\n\n\n                //Mind the order of updating!  sliding friction must come before driving force or rolling friction\n                //because it computes the sliding direction.\n\n                suspension.isActive = true;\n                suspension.numIterationsAtZeroImpulse = 0;\n                suspension.solverSettings.currentIterations = 0;\n                slidingFriction.isActive = true;\n                slidingFriction.numIterationsAtZeroImpulse = 0;\n                slidingFriction.solverSettings.currentIterations = 0;\n                drivingMotor.isActive = true;\n                drivingMotor.numIterationsAtZeroImpulse = 0;\n                drivingMotor.solverSettings.currentIterations = 0;\n                brake.isActive = true;\n                brake.numIterationsAtZeroImpulse = 0;\n                brake.solverSettings.currentIterations = 0;\n\n                suspension.PreStep(dt);\n                slidingFriction.PreStep(dt);\n                drivingMotor.PreStep(dt);\n                brake.PreStep(dt);\n            }\n            else\n            {\n                //No support, don't need any solving.\n                suspension.isActive = false;\n                slidingFriction.isActive = false;\n                drivingMotor.isActive = false;\n                brake.isActive = false;\n\n                suspension.accumulatedImpulse = 0;\n                slidingFriction.accumulatedImpulse = 0;\n                drivingMotor.accumulatedImpulse = 0;\n                brake.accumulatedImpulse = 0;\n            }\n        }\n\n        internal void ExclusiveUpdate()\n        {\n            if (HasSupport)\n            {\n                suspension.ExclusiveUpdate();\n                slidingFriction.ExclusiveUpdate();\n                drivingMotor.ExclusiveUpdate();\n                brake.ExclusiveUpdate();\n            }\n        }\n\n\n        /// <summary>\n        /// Applies impulses and returns whether or not this wheel should be updated more.\n        /// </summary>\n        /// <returns>Whether not the wheel is done updating for the frame.</returns>\n        internal bool ApplyImpulse()\n        {\n            int numActiveConstraints = 0;\n            if (suspension.isActive)\n            {\n                if (++suspension.solverSettings.currentIterations <= suspension.solverSettings.maximumIterationCount)\n                    if (Math.Abs(suspension.ApplyImpulse()) < suspension.solverSettings.minimumImpulse)\n                    {\n                        suspension.numIterationsAtZeroImpulse++;\n                        if (suspension.numIterationsAtZeroImpulse > suspension.solverSettings.minimumIterationCount)\n                            suspension.isActive = false;\n                        else\n                        {\n                            numActiveConstraints++;\n                            suspension.numIterationsAtZeroImpulse = 0;\n                        }\n                    }\n                    else\n                    {\n                        numActiveConstraints++;\n                        suspension.numIterationsAtZeroImpulse = 0;\n                    }\n                else\n                    suspension.isActive = false;\n            }\n            if (slidingFriction.isActive)\n            {\n                if (++slidingFriction.solverSettings.currentIterations <= suspension.solverSettings.maximumIterationCount)\n                    if (Math.Abs(slidingFriction.ApplyImpulse()) < slidingFriction.solverSettings.minimumImpulse)\n                    {\n                        slidingFriction.numIterationsAtZeroImpulse++;\n                        if (slidingFriction.numIterationsAtZeroImpulse > slidingFriction.solverSettings.minimumIterationCount)\n                            slidingFriction.isActive = false;\n                        else\n                        {\n                            numActiveConstraints++;\n                            slidingFriction.numIterationsAtZeroImpulse = 0;\n                        }\n                    }\n                    else\n                    {\n                        numActiveConstraints++;\n                        slidingFriction.numIterationsAtZeroImpulse = 0;\n                    }\n                else\n                    slidingFriction.isActive = false;\n            }\n            if (drivingMotor.isActive)\n            {\n                if (++drivingMotor.solverSettings.currentIterations <= suspension.solverSettings.maximumIterationCount)\n                    if (Math.Abs(drivingMotor.ApplyImpulse()) < drivingMotor.solverSettings.minimumImpulse)\n                    {\n                        drivingMotor.numIterationsAtZeroImpulse++;\n                        if (drivingMotor.numIterationsAtZeroImpulse > drivingMotor.solverSettings.minimumIterationCount)\n                            drivingMotor.isActive = false;\n                        else\n                        {\n                            numActiveConstraints++;\n                            drivingMotor.numIterationsAtZeroImpulse = 0;\n                        }\n                    }\n                    else\n                    {\n                        numActiveConstraints++;\n                        drivingMotor.numIterationsAtZeroImpulse = 0;\n                    }\n                else\n                    drivingMotor.isActive = false;\n            }\n            if (brake.isActive)\n            {\n                if (++brake.solverSettings.currentIterations <= suspension.solverSettings.maximumIterationCount)\n                    if (Math.Abs(brake.ApplyImpulse()) < brake.solverSettings.minimumImpulse)\n                    {\n                        brake.numIterationsAtZeroImpulse++;\n                        if (brake.numIterationsAtZeroImpulse > brake.solverSettings.minimumIterationCount)\n                            brake.isActive = false;\n                        else\n                        {\n                            numActiveConstraints++;\n                            brake.numIterationsAtZeroImpulse = 0;\n                        }\n                    }\n                    else\n                    {\n                        numActiveConstraints++;\n                        brake.numIterationsAtZeroImpulse = 0;\n                    }\n                else\n                    brake.isActive = false;\n            }\n\n            return numActiveConstraints > 0;\n        }\n\n        internal void FindSupport()\n        {\n            if (!(isSupported = shape.FindSupport(out supportLocation, out normal, out suspension.currentLength, out supportingCollidable, out supportingEntity, out supportMaterial)))\n                suspension.currentLength = suspension.restLength;\n        }\n\n        internal void OnAdditionToSpace(ISpace space)\n        {\n            //Make sure it doesn't collide with anything.\n\n            shape.OnAdditionToSpace(space);\n            shape.UpdateDetectorPosition(); //Need to put the detectors in appropriate locations before adding since otherwise overloads the broadphase\n            space.Add(shape.detector);\n        }\n\n\n\n        internal void OnRemovalFromSpace(ISpace space)\n        {\n            space.Remove(shape.detector);\n\n            shape.OnRemovalFromSpace(space);\n        }\n\n        internal void OnAddedToVehicle(Vehicle vehicle)\n        {\n            this.vehicle = vehicle;\n            ISpace space = (vehicle as ISpaceUpdateable).Space;\n            if (space != null)\n            {\n                OnAdditionToSpace(space);\n            }\n            LocalForwardDirection = LocalForwardDirection;\n            suspension.OnAdditionToVehicle();\n        }\n\n        internal void OnRemovedFromVehicle()\n        {\n            ISpace space = (vehicle as ISpaceUpdateable).Space;\n            if (space != null)\n            {\n                OnRemovalFromSpace(space);\n            }\n            vehicle = null;\n        }\n\n\n        internal void UpdateAtEndOfFrame(float dt)\n        {\n            shape.UpdateWorldTransform();\n        }\n\n        internal void UpdateAtEndOfUpdate(float dt)\n        {\n            shape.UpdateSpin(dt);\n        }\n\n        internal void UpdateDuringForces(float dt)\n        {\n            suspension.ComputeWorldSpaceData();\n            shape.UpdateDetectorPosition();\n        }\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Vehicle/WheelBrake.cs",
    "content": "﻿using System;\nusing BEPUphysics.Constraints;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Materials;\n\nnamespace BEPUphysics.Vehicle\n{\n    /// <summary>\n    /// Attempts to resist rolling motion of a vehicle.\n    /// </summary>\n    public class WheelBrake : ISolverSettings\n    {\n        #region Static Stuff\n\n        /// <summary>\n        /// Default blender used by WheelRollingFriction constraints.\n        /// </summary>\n        public static WheelFrictionBlender DefaultRollingFrictionBlender;\n\n        static WheelBrake()\n        {\n            DefaultRollingFrictionBlender = BlendFriction;\n        }\n\n        /// <summary>\n        /// Function which takes the friction values from a wheel and a supporting material and computes the blended friction.\n        /// </summary>\n        /// <param name=\"wheelFriction\">Friction coefficient associated with the wheel.</param>\n        /// <param name=\"materialFriction\">Friction coefficient associated with the support material.</param>\n        /// <param name=\"usingKineticFriction\">True if the friction coefficients passed into the blender are kinetic coefficients, false otherwise.</param>\n        /// <param name=\"wheel\">Wheel being blended.</param>\n        /// <returns>Blended friction coefficient.</returns>\n        public static float BlendFriction(float wheelFriction, float materialFriction, bool usingKinematicFriction, Wheel wheel)\n        {\n            return wheelFriction * materialFriction;\n        }\n\n        #endregion\n\n        internal float accumulatedImpulse;\n\n        //float linearBX, linearBY, linearBZ;\n        private float angularAX, angularAY, angularAZ;\n        private float angularBX, angularBY, angularBZ;\n        internal bool isActive = true;\n        private float linearAX, linearAY, linearAZ;\n        private float blendedCoefficient;\n        private float kineticBrakingFrictionCoefficient;\n        private WheelFrictionBlender frictionBlender = DefaultRollingFrictionBlender;\n        private bool isBraking;\n        private float rollingFrictionCoefficient;\n        internal SolverSettings solverSettings = new SolverSettings();\n        private float staticBrakingFrictionCoefficient;\n        private float staticFrictionVelocityThreshold = 5f;\n        private Wheel wheel;\n        internal int numIterationsAtZeroImpulse;\n        private Entity vehicleEntity, supportEntity;\n\n        //Inverse effective mass matrix\n        private float velocityToImpulse;\n        private bool supportIsDynamic;\n\n\n        /// <summary>\n        /// Constructs a new rolling friction object for a wheel.\n        /// </summary>\n        /// <param name=\"dynamicBrakingFrictionCoefficient\">Coefficient of dynamic friction of the wheel for friction when the brake is active.</param>\n        /// <param name=\"staticBrakingFrictionCoefficient\">Coefficient of static friction of the wheel for friction when the brake is active.</param>\n        /// <param name=\"rollingFrictionCoefficient\">Coefficient of friction of the wheel for rolling friction when the brake isn't active.</param>\n        public WheelBrake(float dynamicBrakingFrictionCoefficient, float staticBrakingFrictionCoefficient, float rollingFrictionCoefficient)\n        {\n            KineticBrakingFrictionCoefficient = dynamicBrakingFrictionCoefficient;\n            StaticBrakingFrictionCoefficient = staticBrakingFrictionCoefficient;\n            RollingFrictionCoefficient = rollingFrictionCoefficient;\n        }\n\n        internal WheelBrake(Wheel wheel)\n        {\n            Wheel = wheel;\n        }\n\n        /// <summary>\n        /// Gets the coefficient of rolling friction between the wheel and support.\n        /// This coefficient is the blended result of the supporting entity's friction and the wheel's friction.\n        /// </summary>\n        public float BlendedCoefficient\n        {\n            get { return blendedCoefficient; }\n        }\n\n        /// <summary>\n        /// Gets or sets the coefficient of braking dynamic friction for this wheel.\n        /// This coefficient and the supporting entity's coefficient of friction will be \n        /// taken into account to determine the used coefficient at any given time.\n        /// This coefficient is used instead of the rollingFrictionCoefficient when \n        /// isBraking is true.\n        /// </summary>\n        public float KineticBrakingFrictionCoefficient\n        {\n            get { return kineticBrakingFrictionCoefficient; }\n            set { kineticBrakingFrictionCoefficient = MathHelper.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// Gets the axis along which rolling friction is applied.\n        /// </summary>\n        public Vector3 FrictionAxis\n        {\n            get { return wheel.drivingMotor.ForceAxis; }\n        }\n\n        /// <summary>\n        /// Gets or sets the function used to blend the supporting entity's friction and the wheel's friction.\n        /// </summary>\n        public WheelFrictionBlender FrictionBlender\n        {\n            get { return frictionBlender; }\n            set { frictionBlender = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets whether or not the wheel is braking.\n        /// When set to true, the brakingFrictionCoefficient is used.\n        /// When false, the rollingFrictionCoefficient is used.\n        /// </summary>\n        public bool IsBraking\n        {\n            get { return isBraking; }\n            set { isBraking = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the coefficient of rolling friction for this wheel.\n        /// This coefficient and the supporting entity's coefficient of friction will be \n        /// taken into account to determine the used coefficient at any given time.\n        /// This coefficient is used instead of the brakingFrictionCoefficient when \n        /// isBraking is false.\n        /// </summary>\n        public float RollingFrictionCoefficient\n        {\n            get { return rollingFrictionCoefficient; }\n            set { rollingFrictionCoefficient = MathHelper.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// Gets or sets the coefficient of static dynamic friction for this wheel.\n        /// This coefficient and the supporting entity's coefficient of friction will be \n        /// taken into account to determine the used coefficient at any given time.\n        /// This coefficient is used instead of the rollingFrictionCoefficient when \n        /// isBraking is true.\n        /// </summary>\n        public float StaticBrakingFrictionCoefficient\n        {\n            get { return staticBrakingFrictionCoefficient; }\n            set { staticBrakingFrictionCoefficient = MathHelper.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// Gets or sets the velocity under which the coefficient of static friction will be used instead of the dynamic one.\n        /// </summary>\n        public float StaticFrictionVelocityThreshold\n        {\n            get { return staticFrictionVelocityThreshold; }\n            set { staticFrictionVelocityThreshold = Math.Abs(value); }\n        }\n\n        /// <summary>\n        /// Gets the force \n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the wheel that this rolling friction applies to.\n        /// </summary>\n        public Wheel Wheel\n        {\n            get { return wheel; }\n            internal set { wheel = value; }\n        }\n\n        #region ISolverSettings Members\n\n        /// <summary>\n        /// Gets the solver settings used by this wheel constraint.\n        /// </summary>\n        public SolverSettings SolverSettings\n        {\n            get { return solverSettings; }\n        }\n\n        #endregion\n\n        ///<summary>\n        /// Gets the relative velocity along the braking direction at the wheel contact.\n        ///</summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float velocity = vehicleEntity.linearVelocity.X * linearAX + vehicleEntity.linearVelocity.Y * linearAY + vehicleEntity.linearVelocity.Z * linearAZ +\n                            vehicleEntity.angularVelocity.X * angularAX + vehicleEntity.angularVelocity.Y * angularAY + vehicleEntity.angularVelocity.Z * angularAZ;\n                if (supportEntity != null)\n                    velocity += -supportEntity.linearVelocity.X * linearAX - supportEntity.linearVelocity.Y * linearAY - supportEntity.linearVelocity.Z * linearAZ +\n                                supportEntity.angularVelocity.X * angularBX + supportEntity.angularVelocity.Y * angularBY + supportEntity.angularVelocity.Z * angularBZ;\n                return velocity;\n            }\n        }\n\n        internal float ApplyImpulse()\n        {\n            //Compute relative velocity and convert to impulse\n            float lambda = RelativeVelocity * velocityToImpulse;\n\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            float maxForce = -blendedCoefficient * wheel.suspension.accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse + lambda, -maxForce, maxForce);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = lambda * linearAX;\n            linear.Y = lambda * linearAY;\n            linear.Z = lambda * linearAZ;\n            if (vehicleEntity.isDynamic)\n            {\n                angular.X = lambda * angularAX;\n                angular.Y = lambda * angularAY;\n                angular.Z = lambda * angularAZ;\n                vehicleEntity.ApplyLinearImpulse(ref linear);\n                vehicleEntity.ApplyAngularImpulse(ref angular);\n            }\n            if (supportIsDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = lambda * angularBX;\n                angular.Y = lambda * angularBY;\n                angular.Z = lambda * angularBZ;\n                supportEntity.ApplyLinearImpulse(ref linear);\n                supportEntity.ApplyAngularImpulse(ref angular);\n            }\n\n            return lambda;\n        }\n\n        internal void PreStep(float dt)\n        {\n            vehicleEntity = wheel.Vehicle.Body;\n            supportEntity = wheel.SupportingEntity;\n            supportIsDynamic = supportEntity != null && supportEntity.isDynamic;\n\n            //Grab jacobian and mass matrix from the driving motor!\n            linearAX = wheel.drivingMotor.linearAX;\n            linearAY = wheel.drivingMotor.linearAY;\n            linearAZ = wheel.drivingMotor.linearAZ;\n\n            angularAX = wheel.drivingMotor.angularAX;\n            angularAY = wheel.drivingMotor.angularAY;\n            angularAZ = wheel.drivingMotor.angularAZ;\n            angularBX = wheel.drivingMotor.angularBX;\n            angularBY = wheel.drivingMotor.angularBY;\n            angularBZ = wheel.drivingMotor.angularBZ;\n\n            velocityToImpulse = wheel.drivingMotor.velocityToImpulse;\n\n            //Friction\n            //Which coefficient? Check velocity.\n            if (isBraking)\n                if (Math.Abs(RelativeVelocity) < staticFrictionVelocityThreshold)\n                    blendedCoefficient = frictionBlender(staticBrakingFrictionCoefficient, wheel.supportMaterial.staticFriction, false, wheel);\n                else\n                    blendedCoefficient = frictionBlender(kineticBrakingFrictionCoefficient, wheel.supportMaterial.kineticFriction, true, wheel);\n            else\n                blendedCoefficient = rollingFrictionCoefficient;\n\n\n        }\n\n        internal void ExclusiveUpdate()\n        {\n\n            //Warm starting\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = accumulatedImpulse * linearAX;\n            linear.Y = accumulatedImpulse * linearAY;\n            linear.Z = accumulatedImpulse * linearAZ;\n            if (vehicleEntity.isDynamic)\n            {\n                angular.X = accumulatedImpulse * angularAX;\n                angular.Y = accumulatedImpulse * angularAY;\n                angular.Z = accumulatedImpulse * angularAZ;\n                vehicleEntity.ApplyLinearImpulse(ref linear);\n                vehicleEntity.ApplyAngularImpulse(ref angular);\n            }\n            if (supportIsDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = accumulatedImpulse * angularBX;\n                angular.Y = accumulatedImpulse * angularBY;\n                angular.Z = accumulatedImpulse * angularBZ;\n                supportEntity.ApplyLinearImpulse(ref linear);\n                supportEntity.ApplyAngularImpulse(ref angular);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Vehicle/WheelDrivingMotor.cs",
    "content": "﻿using BEPUphysics.Constraints;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Materials;\n\nnamespace BEPUphysics.Vehicle\n{\n    /// <summary>\n    /// Handles a wheel's driving force for a vehicle.\n    /// </summary>\n    public class WheelDrivingMotor : ISolverSettings\n    {\n        #region Static Stuff\n\n        /// <summary>\n        /// Default blender used by WheelSlidingFriction constraints.\n        /// </summary>\n        public static WheelFrictionBlender DefaultGripFrictionBlender;\n\n        static WheelDrivingMotor()\n        {\n            DefaultGripFrictionBlender = BlendFriction;\n        }\n\n        /// <summary>\n        /// Function which takes the friction values from a wheel and a supporting material and computes the blended friction.\n        /// </summary>\n        /// <param name=\"wheelFriction\">Friction coefficient associated with the wheel.</param>\n        /// <param name=\"materialFriction\">Friction coefficient associated with the support material.</param>\n        /// <param name=\"usingKineticFriction\">True if the friction coefficients passed into the blender are kinetic coefficients, false otherwise.</param>\n        /// <param name=\"wheel\">Wheel being blended.</param>\n        /// <returns>Blended friction coefficient.</returns>\n        public static float BlendFriction(float wheelFriction, float materialFriction, bool usingKinematicFriction, Wheel wheel)\n        {\n            return wheelFriction * materialFriction;\n        }\n\n        #endregion\n\n        internal float accumulatedImpulse;\n\n        //float linearBX, linearBY, linearBZ;\n        internal float angularAX, angularAY, angularAZ;\n        internal float angularBX, angularBY, angularBZ;\n        internal bool isActive = true;\n        internal float linearAX, linearAY, linearAZ;\n        private float currentFrictionCoefficient;\n        internal Vector3 forceAxis;\n        private float gripFriction;\n        private WheelFrictionBlender gripFrictionBlender = DefaultGripFrictionBlender;\n        private float maxMotorForceDt;\n        private float maximumBackwardForce = float.MaxValue;\n        private float maximumForwardForce = float.MaxValue;\n        internal SolverSettings solverSettings = new SolverSettings();\n        private float targetSpeed;\n        private Wheel wheel;\n        internal int numIterationsAtZeroImpulse;\n        private Entity vehicleEntity, supportEntity;\n\n        //Inverse effective mass matrix\n        internal float velocityToImpulse;\n        private bool supportIsDynamic;\n\n        /// <summary>\n        /// Constructs a new wheel motor.\n        /// </summary>\n        /// <param name=\"gripFriction\">Friction coefficient of the wheel.  Blended with the ground's friction coefficient and normal force to determine a maximum force.</param>\n        /// <param name=\"maximumForwardForce\">Maximum force that the wheel motor can apply when driving forward (a target speed greater than zero).</param>\n        /// <param name=\"maximumBackwardForce\">Maximum force that the wheel motor can apply when driving backward (a target speed less than zero).</param>\n        public WheelDrivingMotor(float gripFriction, float maximumForwardForce, float maximumBackwardForce)\n        {\n            GripFriction = gripFriction;\n            MaximumForwardForce = maximumForwardForce;\n            MaximumBackwardForce = maximumBackwardForce;\n        }\n\n        internal WheelDrivingMotor(Wheel wheel)\n        {\n            Wheel = wheel;\n        }\n\n        /// <summary>\n        /// Gets the coefficient of grip friction between the wheel and support.\n        /// This coefficient is the blended result of the supporting entity's friction and the wheel's friction.\n        /// </summary>\n        public float BlendedCoefficient\n        {\n            get { return currentFrictionCoefficient; }\n        }\n\n        /// <summary>\n        /// Gets the axis along which the driving forces are applied.\n        /// </summary>\n        public Vector3 ForceAxis\n        {\n            get { return ForceAxis; }\n        }\n\n        /// <summary>\n        /// Gets or sets the coefficient of forward-backward gripping friction for this wheel.\n        /// This coefficient and the supporting entity's coefficient of friction will be \n        /// taken into account to determine the used coefficient at any given time.\n        /// </summary>\n        public float GripFriction\n        {\n            get { return gripFriction; }\n            set { gripFriction = MathHelper.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// Gets or sets the function used to blend the supporting entity's friction and the wheel's friction.\n        /// </summary>\n        public WheelFrictionBlender GripFrictionBlender\n        {\n            get { return gripFrictionBlender; }\n            set { gripFrictionBlender = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum force that the wheel motor can apply when driving backward (a target speed less than zero).\n        /// </summary>\n        public float MaximumBackwardForce\n        {\n            get { return maximumBackwardForce; }\n            set { maximumBackwardForce = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum force that the wheel motor can apply when driving forward (a target speed greater than zero).\n        /// </summary>\n        public float MaximumForwardForce\n        {\n            get { return maximumForwardForce; }\n            set { maximumForwardForce = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the target speed of this wheel.\n        /// </summary>\n        public float TargetSpeed\n        {\n            get { return targetSpeed; }\n            set { targetSpeed = value; }\n        }\n\n        /// <summary>\n        /// Gets the force this wheel's motor is applying.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the wheel that this motor applies to.\n        /// </summary>\n        public Wheel Wheel\n        {\n            get { return wheel; }\n            internal set { wheel = value; }\n        }\n\n        #region ISolverSettings Members\n\n        /// <summary>\n        /// Gets the solver settings used by this wheel constraint.\n        /// </summary>\n        public SolverSettings SolverSettings\n        {\n            get { return solverSettings; }\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Gets the relative velocity between the ground and wheel.\n        /// </summary>\n        /// <returns>Relative velocity between the ground and wheel.</returns>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float velocity = 0;\n                if (vehicleEntity != null)\n                    velocity += vehicleEntity.linearVelocity.X * linearAX + vehicleEntity.linearVelocity.Y * linearAY + vehicleEntity.linearVelocity.Z * linearAZ +\n                                  vehicleEntity.angularVelocity.X * angularAX + vehicleEntity.angularVelocity.Y * angularAY + vehicleEntity.angularVelocity.Z * angularAZ;\n                if (supportEntity != null)\n                    velocity += -supportEntity.linearVelocity.X * linearAX - supportEntity.linearVelocity.Y * linearAY - supportEntity.linearVelocity.Z * linearAZ +\n                                supportEntity.angularVelocity.X * angularBX + supportEntity.angularVelocity.Y * angularBY + supportEntity.angularVelocity.Z * angularBZ;\n                return velocity;\n            }\n        }\n\n        internal float ApplyImpulse()\n        {\n            //Compute relative velocity\n            float lambda = (RelativeVelocity\n                            - targetSpeed) //Add in the extra goal speed\n                           * velocityToImpulse; //convert to impulse\n\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse += lambda;\n            //Don't brake, and take into account the motor's maximum force.\n            if (targetSpeed > 0)\n                accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse, 0, maxMotorForceDt); //MathHelper.Min(MathHelper.Max(accumulatedImpulse, 0), myMaxMotorForceDt);\n            else if (targetSpeed < 0)\n                accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse, maxMotorForceDt, 0); //MathHelper.Max(MathHelper.Min(accumulatedImpulse, 0), myMaxMotorForceDt);\n            else\n                accumulatedImpulse = 0;\n            //Friction\n            float maxForce = currentFrictionCoefficient * wheel.suspension.accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse, maxForce, -maxForce);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n\n            //Apply the impulse\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = lambda * linearAX;\n            linear.Y = lambda * linearAY;\n            linear.Z = lambda * linearAZ;\n            if (vehicleEntity.isDynamic)\n            {\n                angular.X = lambda * angularAX;\n                angular.Y = lambda * angularAY;\n                angular.Z = lambda * angularAZ;\n                vehicleEntity.ApplyLinearImpulse(ref linear);\n                vehicleEntity.ApplyAngularImpulse(ref angular);\n            }\n            if (supportIsDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = lambda * angularBX;\n                angular.Y = lambda * angularBY;\n                angular.Z = lambda * angularBZ;\n                supportEntity.ApplyLinearImpulse(ref linear);\n                supportEntity.ApplyAngularImpulse(ref angular);\n            }\n\n            return lambda;\n        }\n\n        internal void PreStep(float dt)\n        {\n            vehicleEntity = wheel.Vehicle.Body;\n            supportEntity = wheel.SupportingEntity;\n            supportIsDynamic = supportEntity != null && supportEntity.isDynamic;\n\n            Vector3.Cross(ref wheel.normal, ref wheel.slidingFriction.slidingFrictionAxis, out forceAxis);\n            forceAxis.Normalize();\n            //Do not need to check for normalize safety because normal and sliding friction axis must be perpendicular.\n\n            linearAX = forceAxis.X;\n            linearAY = forceAxis.Y;\n            linearAZ = forceAxis.Z;\n\n            //angular A = Ra x N\n            angularAX = (wheel.ra.Y * linearAZ) - (wheel.ra.Z * linearAY);\n            angularAY = (wheel.ra.Z * linearAX) - (wheel.ra.X * linearAZ);\n            angularAZ = (wheel.ra.X * linearAY) - (wheel.ra.Y * linearAX);\n\n            //Angular B = N x Rb\n            angularBX = (linearAY * wheel.rb.Z) - (linearAZ * wheel.rb.Y);\n            angularBY = (linearAZ * wheel.rb.X) - (linearAX * wheel.rb.Z);\n            angularBZ = (linearAX * wheel.rb.Y) - (linearAY * wheel.rb.X);\n\n            //Compute inverse effective mass matrix\n            float entryA, entryB;\n\n            //these are the transformed coordinates\n            float tX, tY, tZ;\n            if (vehicleEntity.isDynamic)\n            {\n                tX = angularAX * vehicleEntity.inertiaTensorInverse.M11 + angularAY * vehicleEntity.inertiaTensorInverse.M21 + angularAZ * vehicleEntity.inertiaTensorInverse.M31;\n                tY = angularAX * vehicleEntity.inertiaTensorInverse.M12 + angularAY * vehicleEntity.inertiaTensorInverse.M22 + angularAZ * vehicleEntity.inertiaTensorInverse.M32;\n                tZ = angularAX * vehicleEntity.inertiaTensorInverse.M13 + angularAY * vehicleEntity.inertiaTensorInverse.M23 + angularAZ * vehicleEntity.inertiaTensorInverse.M33;\n                entryA = tX * angularAX + tY * angularAY + tZ * angularAZ + vehicleEntity.inverseMass;\n            }\n            else\n                entryA = 0;\n\n            if (supportIsDynamic)\n            {\n                tX = angularBX * supportEntity.inertiaTensorInverse.M11 + angularBY * supportEntity.inertiaTensorInverse.M21 + angularBZ * supportEntity.inertiaTensorInverse.M31;\n                tY = angularBX * supportEntity.inertiaTensorInverse.M12 + angularBY * supportEntity.inertiaTensorInverse.M22 + angularBZ * supportEntity.inertiaTensorInverse.M32;\n                tZ = angularBX * supportEntity.inertiaTensorInverse.M13 + angularBY * supportEntity.inertiaTensorInverse.M23 + angularBZ * supportEntity.inertiaTensorInverse.M33;\n                entryB = tX * angularBX + tY * angularBY + tZ * angularBZ + supportEntity.inverseMass;\n            }\n            else\n                entryB = 0;\n\n            velocityToImpulse = -1 / (entryA + entryB); //Softness?\n\n            currentFrictionCoefficient = gripFrictionBlender(gripFriction, wheel.supportMaterial.kineticFriction, true, wheel);\n\n            //Compute the maximum force\n            if (targetSpeed > 0)\n                maxMotorForceDt = maximumForwardForce * dt;\n            else\n                maxMotorForceDt = -maximumBackwardForce * dt;\n\n\n\n\n        }\n\n        internal void ExclusiveUpdate()\n        {\n            //Warm starting\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = accumulatedImpulse * linearAX;\n            linear.Y = accumulatedImpulse * linearAY;\n            linear.Z = accumulatedImpulse * linearAZ;\n            if (vehicleEntity.isDynamic)\n            {\n                angular.X = accumulatedImpulse * angularAX;\n                angular.Y = accumulatedImpulse * angularAY;\n                angular.Z = accumulatedImpulse * angularAZ;\n                vehicleEntity.ApplyLinearImpulse(ref linear);\n                vehicleEntity.ApplyAngularImpulse(ref angular);\n            }\n            if (supportIsDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = accumulatedImpulse * angularBX;\n                angular.Y = accumulatedImpulse * angularBY;\n                angular.Z = accumulatedImpulse * angularBZ;\n                supportEntity.ApplyLinearImpulse(ref linear);\n                supportEntity.ApplyAngularImpulse(ref angular);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Vehicle/WheelFrictionBlender.cs",
    "content": "﻿using BEPUphysics.Materials;\nnamespace BEPUphysics.Vehicle\n{\n    /// <summary>\n    /// Function which takes the friction values from a wheel and a supporting material and computes the blended friction.\n    /// </summary>\n    /// <param name=\"wheelFriction\">Friction coefficient associated with the wheel.</param>\n    /// <param name=\"materialFriction\">Friction coefficient associated with the support material.</param>\n    /// <param name=\"usingKineticFriction\">True if the friction coefficients passed into the blender are kinetic coefficients, false otherwise.</param>\n    /// <param name=\"wheel\">Wheel being blended.</param>\n    /// <returns>Blended friction coefficient.</returns>\n    public delegate float WheelFrictionBlender(float wheelFriction, float materialFriction, bool usingKineticFriction, Wheel wheel);\n\n\n}"
  },
  {
    "path": "BEPUphysics/Vehicle/WheelShape.cs",
    "content": "﻿using System;\nusing BEPUphysics.Entities;\nusing BEPUphysics.Entities.Prefabs;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.Materials;\nusing BEPUphysics.BroadPhaseEntries;\n\nnamespace BEPUphysics.Vehicle\n{\n    /// <summary>\n    /// Superclass for the shape of the tires of a vehicle.\n    /// Responsible for figuring out where the wheel touches the ground and\n    /// managing graphical properties.\n    /// </summary>\n    public abstract class WheelShape : ICollisionRulesOwner\n    {\n        private float airborneWheelAcceleration = 40;\n\n\n        private float airborneWheelDeceleration = 4;\n        private float brakeFreezeWheelDeceleration = 40;\n\n        /// <summary>\n        /// Collects collision pairs from the environment.\n        /// </summary>\n        protected internal Box detector = new Box(Vector3.Zero, 0, 0, 0);\n\n        protected internal Matrix localGraphicTransform;\n        protected float spinAngle;\n\n\n        protected float spinVelocity;\n        internal float steeringAngle;\n\n        internal Matrix steeringTransform;\n        protected internal Wheel wheel;\n\n        protected internal Matrix worldTransform;\n\n        CollisionRules collisionRules = new CollisionRules() { Group = CollisionRules.DefaultDynamicCollisionGroup};\n        /// <summary>\n        /// Gets or sets the collision rules used by the wheel.\n        /// </summary>\n        public CollisionRules CollisionRules\n        {\n            get { return collisionRules; }\n            set { collisionRules = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the graphical radius of the wheel.\n        /// </summary>\n        public abstract float Radius { get; set; }\n\n        /// <summary>\n        /// Gets or sets the rate at which the wheel's spinning velocity increases when accelerating and airborne.\n        /// This is a purely graphical effect.\n        /// </summary>\n        public float AirborneWheelAcceleration\n        {\n            get { return airborneWheelAcceleration; }\n            set { airborneWheelAcceleration = Math.Abs(value); }\n        }\n\n        /// <summary>\n        /// Gets or sets the rate at which the wheel's spinning velocity decreases when the wheel is airborne and its motor is idle.\n        /// This is a purely graphical effect.\n        /// </summary>\n        public float AirborneWheelDeceleration\n        {\n            get { return airborneWheelDeceleration; }\n            set { airborneWheelDeceleration = Math.Abs(value); }\n        }\n\n        /// <summary>\n        /// Gets or sets the rate at which the wheel's spinning velocity decreases when braking.\n        /// This is a purely graphical effect.\n        /// </summary>\n        public float BrakeFreezeWheelDeceleration\n        {\n            get { return brakeFreezeWheelDeceleration; }\n            set { brakeFreezeWheelDeceleration = Math.Abs(value); }\n        }\n\n        /// <summary>\n        /// Gets the detector entity used by the wheelshape to collect collision pairs.\n        /// </summary>\n        public Box Detector\n        {\n            get { return detector; }\n        }\n\n        /// <summary>\n        /// Gets or sets whether or not to halt the wheel spin while the WheelBrake is active.\n        /// </summary>\n        public bool FreezeWheelsWhileBraking { get; set; }\n\n        /// <summary>\n        /// Gets or sets the local graphic transform of the wheel shape.\n        /// This transform is applied first when creating the shape's worldTransform.\n        /// </summary>\n        public Matrix LocalGraphicTransform\n        {\n            get { return localGraphicTransform; }\n            set { localGraphicTransform = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the current spin angle of this wheel.\n        /// This changes each frame based on the relative velocity between the\n        /// support and the wheel.\n        /// </summary>\n        public float SpinAngle\n        {\n            get { return spinAngle; }\n            set { spinAngle = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the graphical spin velocity of the wheel based on the relative velocity \n        /// between the support and the wheel.  Whenever the wheel is in contact with\n        /// the ground, the spin velocity will be each frame.\n        /// </summary>\n        public float SpinVelocity\n        {\n            get { return spinVelocity; }\n            set { spinVelocity = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the current steering angle of this wheel.\n        /// </summary>\n        public float SteeringAngle\n        {\n            get { return steeringAngle; }\n            set { steeringAngle = value; }\n        }\n\n        /// <summary>\n        /// Gets the wheel object associated with this shape.\n        /// </summary>\n        public Wheel Wheel\n        {\n            get { return wheel; }\n            internal set { wheel = value; }\n        }\n\n        /// <summary>\n        /// Gets the world matrix of the wheel for positioning a graphic.\n        /// </summary>\n        public Matrix WorldTransform\n        {\n            get { return worldTransform; }\n        }\n\n\n        /// <summary>\n        /// Updates the wheel's world transform for graphics.\n        /// Called automatically by the owning wheel at the end of each frame.\n        /// If the engine is updating asynchronously, you can call this inside of a space read buffer lock\n        /// and update the wheel transforms safely.\n        /// </summary>\n        public abstract void UpdateWorldTransform();\n\n\n        internal void OnAdditionToSpace(ISpace space)\n        {\n            detector.CollisionInformation.collisionRules.Specific.Add(wheel.vehicle.Body.CollisionInformation.collisionRules, CollisionRule.NoBroadPhase);\n            detector.CollisionInformation.collisionRules.Personal = CollisionRule.NoNarrowPhaseUpdate;\n            detector.CollisionInformation.collisionRules.group = CollisionRules.DefaultDynamicCollisionGroup;\n\n        }\n\n        internal void OnRemovalFromSpace(ISpace space)\n        {\n            detector.CollisionInformation.CollisionRules.Specific.Remove(wheel.vehicle.Body.CollisionInformation.collisionRules);\n        }\n\n        /// <summary>\n        /// Updates the spin velocity and spin angle for the shape.\n        /// </summary>\n        /// <param name=\"dt\">Simulation timestep.</param>\n        internal void UpdateSpin(float dt)\n        {\n            if (wheel.HasSupport && !(wheel.brake.IsBraking && FreezeWheelsWhileBraking))\n            {\n                //On the ground, not braking.\n                spinVelocity = wheel.drivingMotor.RelativeVelocity / Radius;\n            }\n            else if (wheel.HasSupport && wheel.brake.IsBraking && FreezeWheelsWhileBraking)\n            {\n                //On the ground, braking\n                float deceleratedValue = 0;\n                if (spinVelocity > 0)\n                    deceleratedValue = Math.Max(spinVelocity - brakeFreezeWheelDeceleration * dt, 0);\n                else if (spinVelocity < 0)\n                    deceleratedValue = Math.Min(spinVelocity + brakeFreezeWheelDeceleration * dt, 0);\n\n                spinVelocity = wheel.drivingMotor.RelativeVelocity / Radius;\n\n                if (Math.Abs(deceleratedValue) < Math.Abs(spinVelocity))\n                    spinVelocity = deceleratedValue;\n            }\n            else if (!wheel.HasSupport && wheel.drivingMotor.TargetSpeed != 0)\n            {\n                //Airborne and accelerating, increase spin velocity.\n                float maxSpeed = Math.Abs(wheel.drivingMotor.TargetSpeed) / Radius;\n                spinVelocity = MathHelper.Clamp(spinVelocity + Math.Sign(wheel.drivingMotor.TargetSpeed) * airborneWheelAcceleration * dt, -maxSpeed, maxSpeed);\n            }\n            else if (!wheel.HasSupport && wheel.Brake.IsBraking)\n            {\n                //Airborne and braking\n                if (spinVelocity > 0)\n                    spinVelocity = Math.Max(spinVelocity - brakeFreezeWheelDeceleration * dt, 0);\n                else if (spinVelocity < 0)\n                    spinVelocity = Math.Min(spinVelocity + brakeFreezeWheelDeceleration * dt, 0);\n            }\n            else if (!wheel.HasSupport)\n            {\n                //Just idly slowing down.\n                if (spinVelocity > 0)\n                    spinVelocity = Math.Max(spinVelocity - airborneWheelDeceleration * dt, 0);\n                else if (spinVelocity < 0)\n                    spinVelocity = Math.Min(spinVelocity + airborneWheelDeceleration * dt, 0);\n            }\n            spinAngle += spinVelocity * dt;\n        }\n\n        /// <summary>\n        /// Finds a supporting entity, the contact location, and the contact normal.\n        /// </summary>\n        /// <param name=\"location\">Contact point between the wheel and the support.</param>\n        /// <param name=\"normal\">Contact normal between the wheel and the support.</param>\n        /// <param name=\"suspensionLength\">Length of the suspension at the contact.</param>\n        /// <param name=\"supportCollidable\">Collidable supporting the wheel, if any.</param>\n        /// <param name=\"entity\">Entity supporting the wheel, if any.</param>\n        /// <param name=\"material\">Material of the support.</param>\n        /// <returns>Whether or not any support was found.</returns>\n        protected internal abstract bool FindSupport(out Vector3 location, out Vector3 normal, out float suspensionLength, out Collidable supportCollidable, out Entity entity, out Material material);\n\n        /// <summary>\n        /// Initializes the detector entity and any other necessary logic.\n        /// </summary>\n        protected internal abstract void Initialize();\n\n        /// <summary>\n        /// Updates the position of the detector before each step.\n        /// </summary>\n        protected internal abstract void UpdateDetectorPosition();\n\n    }\n}"
  },
  {
    "path": "BEPUphysics/Vehicle/WheelSlidingFriction.cs",
    "content": "﻿using System;\nusing BEPUphysics.Constraints;\nusing BEPUphysics.Entities;\nusing BEPUutilities;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Materials;\n\nnamespace BEPUphysics.Vehicle\n{\n    /// <summary>\n    /// Attempts to resist sliding motion of a vehicle.\n    /// </summary>\n    public class WheelSlidingFriction : ISolverSettings\n    {\n        #region Static Stuff\n\n        /// <summary>\n        /// Default blender used by WheelSlidingFriction constraints.\n        /// </summary>\n        public static WheelFrictionBlender DefaultSlidingFrictionBlender;\n\n        static WheelSlidingFriction()\n        {\n            DefaultSlidingFrictionBlender = BlendFriction;\n        }\n\n        /// <summary>\n        /// Function which takes the friction values from a wheel and a supporting material and computes the blended friction.\n        /// </summary>\n        /// <param name=\"wheelFriction\">Friction coefficient associated with the wheel.</param>\n        /// <param name=\"materialFriction\">Friction coefficient associated with the support material.</param>\n        /// <param name=\"usingKineticFriction\">True if the friction coefficients passed into the blender are kinetic coefficients, false otherwise.</param>\n        /// <param name=\"wheel\">Wheel being blended.</param>\n        /// <returns>Blended friction coefficient.</returns>\n        public static float BlendFriction(float wheelFriction, float materialFriction, bool usingKinematicFriction, Wheel wheel)\n        {\n            return wheelFriction * materialFriction;\n        }\n\n        #endregion\n\n        internal float accumulatedImpulse;\n\n        //float linearBX, linearBY, linearBZ;\n        private float angularAX, angularAY, angularAZ;\n        private float angularBX, angularBY, angularBZ;\n        internal bool isActive = true;\n        private float linearAX, linearAY, linearAZ;\n        private float blendedCoefficient;\n        private float kineticCoefficient;\n        private WheelFrictionBlender frictionBlender = DefaultSlidingFrictionBlender;\n        internal Vector3 slidingFrictionAxis;\n        internal SolverSettings solverSettings = new SolverSettings();\n        private float staticCoefficient;\n        private float staticFrictionVelocityThreshold = 5;\n        private Wheel wheel;\n        internal int numIterationsAtZeroImpulse;\n        private Entity vehicleEntity, supportEntity;\n\n        //Inverse effective mass matrix\n        private float velocityToImpulse;\n\n        /// <summary>\n        /// Constructs a new sliding friction object for a wheel.\n        /// </summary>\n        /// <param name=\"dynamicCoefficient\">Coefficient of dynamic sliding friction to be blended with the supporting entity's friction.</param>\n        /// <param name=\"staticCoefficient\">Coefficient of static sliding friction to be blended with the supporting entity's friction.</param>\n        public WheelSlidingFriction(float dynamicCoefficient, float staticCoefficient)\n        {\n            KineticCoefficient = dynamicCoefficient;\n            StaticCoefficient = staticCoefficient;\n        }\n\n        internal WheelSlidingFriction(Wheel wheel)\n        {\n            Wheel = wheel;\n        }\n\n        /// <summary>\n        /// Gets the coefficient of sliding friction between the wheel and support.\n        /// This coefficient is the blended result of the supporting entity's friction and the wheel's friction.\n        /// </summary>\n        public float BlendedCoefficient\n        {\n            get { return blendedCoefficient; }\n        }\n\n        /// <summary>\n        /// Gets or sets the coefficient of dynamic horizontal sliding friction for this wheel.\n        /// This coefficient and the supporting entity's coefficient of friction will be \n        /// taken into account to determine the used coefficient at any given time.\n        /// </summary>\n        public float KineticCoefficient\n        {\n            get { return kineticCoefficient; }\n            set { kineticCoefficient = MathHelper.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// Gets or sets the function used to blend the supporting entity's friction and the wheel's friction.\n        /// </summary>\n        public WheelFrictionBlender FrictionBlender\n        {\n            get { return frictionBlender; }\n            set { frictionBlender = value; }\n        }\n\n        /// <summary>\n        /// Gets the axis along which sliding friction is applied.\n        /// </summary>\n        public Vector3 SlidingFrictionAxis\n        {\n            get { return slidingFrictionAxis; }\n        }\n\n        /// <summary>\n        /// Gets or sets the coefficient of static horizontal sliding friction for this wheel.\n        /// This coefficient and the supporting entity's coefficient of friction will be \n        /// taken into account to determine the used coefficient at any given time.\n        /// </summary>\n        public float StaticCoefficient\n        {\n            get { return staticCoefficient; }\n            set { staticCoefficient = MathHelper.Max(value, 0); }\n        }\n\n        /// <summary>\n        /// Gets or sets the velocity under which the coefficient of static friction will be used instead of the dynamic one.\n        /// </summary>\n        public float StaticFrictionVelocityThreshold\n        {\n            get { return staticFrictionVelocityThreshold; }\n            set { staticFrictionVelocityThreshold = Math.Abs(value); }\n        }\n\n        /// <summary>\n        /// Gets the force \n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the wheel that this sliding friction applies to.\n        /// </summary>\n        public Wheel Wheel\n        {\n            get { return wheel; }\n            internal set { wheel = value; }\n        }\n\n        #region ISolverSettings Members\n\n        /// <summary>\n        /// Gets the solver settings used by this wheel constraint.\n        /// </summary>\n        public SolverSettings SolverSettings\n        {\n            get { return solverSettings; }\n        }\n\n        #endregion\n\n        bool supportIsDynamic;\n\n        ///<summary>\n        /// Gets the relative velocity along the sliding direction at the wheel contact.\n        ///</summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float velocity = vehicleEntity.linearVelocity.X * linearAX + vehicleEntity.linearVelocity.Y * linearAY + vehicleEntity.linearVelocity.Z * linearAZ +\n                            vehicleEntity.angularVelocity.X * angularAX + vehicleEntity.angularVelocity.Y * angularAY + vehicleEntity.angularVelocity.Z * angularAZ;\n                if (supportEntity != null)\n                    velocity += -supportEntity.linearVelocity.X * linearAX - supportEntity.linearVelocity.Y * linearAY - supportEntity.linearVelocity.Z * linearAZ +\n                                supportEntity.angularVelocity.X * angularBX + supportEntity.angularVelocity.Y * angularBY + supportEntity.angularVelocity.Z * angularBZ;\n                return velocity;\n            }\n        }\n\n        internal float ApplyImpulse()\n        {\n            //Compute relative velocity and convert to an impulse\n            float lambda = RelativeVelocity * velocityToImpulse;\n\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            float maxForce = -blendedCoefficient * wheel.suspension.accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse + lambda, -maxForce, maxForce);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = lambda * linearAX;\n            linear.Y = lambda * linearAY;\n            linear.Z = lambda * linearAZ;\n            if (vehicleEntity.isDynamic)\n            {\n                angular.X = lambda * angularAX;\n                angular.Y = lambda * angularAY;\n                angular.Z = lambda * angularAZ;\n                vehicleEntity.ApplyLinearImpulse(ref linear);\n                vehicleEntity.ApplyAngularImpulse(ref angular);\n            }\n            if (supportIsDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = lambda * angularBX;\n                angular.Y = lambda * angularBY;\n                angular.Z = lambda * angularBZ;\n                supportEntity.ApplyLinearImpulse(ref linear);\n                supportEntity.ApplyAngularImpulse(ref angular);\n            }\n\n            return lambda;\n        }\n\n        internal void PreStep(float dt)\n        {\n            vehicleEntity = wheel.Vehicle.Body;\n            supportEntity = wheel.SupportingEntity;\n            supportIsDynamic = supportEntity != null && supportEntity.isDynamic;\n            Vector3.Cross(ref wheel.worldForwardDirection, ref wheel.normal, out slidingFrictionAxis);\n            float axisLength = slidingFrictionAxis.LengthSquared();\n            //Safety against bad cross product\n            if (axisLength < Toolbox.BigEpsilon)\n            {\n                Vector3.Cross(ref wheel.worldForwardDirection, ref Toolbox.UpVector, out slidingFrictionAxis);\n                axisLength = slidingFrictionAxis.LengthSquared();\n                if (axisLength < Toolbox.BigEpsilon)\n                {\n                    Vector3.Cross(ref wheel.worldForwardDirection, ref Toolbox.RightVector, out slidingFrictionAxis);\n                }\n            }\n            slidingFrictionAxis.Normalize();\n\n            linearAX = slidingFrictionAxis.X;\n            linearAY = slidingFrictionAxis.Y;\n            linearAZ = slidingFrictionAxis.Z;\n\n            //angular A = Ra x N\n            angularAX = (wheel.ra.Y * linearAZ) - (wheel.ra.Z * linearAY);\n            angularAY = (wheel.ra.Z * linearAX) - (wheel.ra.X * linearAZ);\n            angularAZ = (wheel.ra.X * linearAY) - (wheel.ra.Y * linearAX);\n\n            //Angular B = N x Rb\n            angularBX = (linearAY * wheel.rb.Z) - (linearAZ * wheel.rb.Y);\n            angularBY = (linearAZ * wheel.rb.X) - (linearAX * wheel.rb.Z);\n            angularBZ = (linearAX * wheel.rb.Y) - (linearAY * wheel.rb.X);\n\n            //Compute inverse effective mass matrix\n            float entryA, entryB;\n\n            //these are the transformed coordinates\n            float tX, tY, tZ;\n            if (vehicleEntity.isDynamic)\n            {\n                tX = angularAX * vehicleEntity.inertiaTensorInverse.M11 + angularAY * vehicleEntity.inertiaTensorInverse.M21 + angularAZ * vehicleEntity.inertiaTensorInverse.M31;\n                tY = angularAX * vehicleEntity.inertiaTensorInverse.M12 + angularAY * vehicleEntity.inertiaTensorInverse.M22 + angularAZ * vehicleEntity.inertiaTensorInverse.M32;\n                tZ = angularAX * vehicleEntity.inertiaTensorInverse.M13 + angularAY * vehicleEntity.inertiaTensorInverse.M23 + angularAZ * vehicleEntity.inertiaTensorInverse.M33;\n                entryA = tX * angularAX + tY * angularAY + tZ * angularAZ + vehicleEntity.inverseMass;\n            }\n            else\n                entryA = 0;\n\n            if (supportIsDynamic)\n            {\n                tX = angularBX * supportEntity.inertiaTensorInverse.M11 + angularBY * supportEntity.inertiaTensorInverse.M21 + angularBZ * supportEntity.inertiaTensorInverse.M31;\n                tY = angularBX * supportEntity.inertiaTensorInverse.M12 + angularBY * supportEntity.inertiaTensorInverse.M22 + angularBZ * supportEntity.inertiaTensorInverse.M32;\n                tZ = angularBX * supportEntity.inertiaTensorInverse.M13 + angularBY * supportEntity.inertiaTensorInverse.M23 + angularBZ * supportEntity.inertiaTensorInverse.M33;\n                entryB = tX * angularBX + tY * angularBY + tZ * angularBZ + supportEntity.inverseMass;\n            }\n            else\n                entryB = 0;\n\n            velocityToImpulse = -1 / (entryA + entryB); //Softness?\n\n            //Compute friction.\n            //Which coefficient? Check velocity.\n            if (Math.Abs(RelativeVelocity) < staticFrictionVelocityThreshold)\n                blendedCoefficient = frictionBlender(staticCoefficient, wheel.supportMaterial.staticFriction, false, wheel);\n            else\n                blendedCoefficient = frictionBlender(kineticCoefficient, wheel.supportMaterial.kineticFriction, true, wheel);\n\n\n\n        }\n\n        internal void ExclusiveUpdate()\n        {\n            //Warm starting\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = accumulatedImpulse * linearAX;\n            linear.Y = accumulatedImpulse * linearAY;\n            linear.Z = accumulatedImpulse * linearAZ;\n            if (vehicleEntity.isDynamic)\n            {\n                angular.X = accumulatedImpulse * angularAX;\n                angular.Y = accumulatedImpulse * angularAY;\n                angular.Z = accumulatedImpulse * angularAZ;\n                vehicleEntity.ApplyLinearImpulse(ref linear);\n                vehicleEntity.ApplyAngularImpulse(ref angular);\n            }\n            if (supportIsDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = accumulatedImpulse * angularBX;\n                angular.Y = accumulatedImpulse * angularBY;\n                angular.Z = accumulatedImpulse * angularBZ;\n                supportEntity.ApplyLinearImpulse(ref linear);\n                supportEntity.ApplyAngularImpulse(ref angular);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUphysics/Vehicle/WheelSuspension.cs",
    "content": "﻿using BEPUphysics.Constraints;\nusing BEPUphysics.Entities;\nusing Microsoft.Xna.Framework;\nusing BEPUutilities;\n\nnamespace BEPUphysics.Vehicle\n{\n    /// <summary>\n    /// Allows the connected wheel and vehicle to smoothly absorb bumps.\n    /// </summary>\n    public class WheelSuspension : ISpringSettings, ISolverSettings\n    {\n        private readonly SpringSettings springSettings = new SpringSettings();\n\n\n        internal float accumulatedImpulse;\n\n        //float linearBX, linearBY, linearBZ;\n        private float angularAX, angularAY, angularAZ;\n        private float angularBX, angularBY, angularBZ;\n        private float bias;\n\n        internal bool isActive = true;\n        private float linearAX, linearAY, linearAZ;\n        private float allowedCompression = .01f;\n        internal float currentLength;\n        internal Vector3 localAttachmentPoint;\n        internal Vector3 localDirection;\n        private float maximumSpringCorrectionSpeed = float.MaxValue;\n        private float maximumSpringForce = float.MaxValue;\n        internal float restLength;\n        internal SolverSettings solverSettings = new SolverSettings();\n        private Wheel wheel;\n        internal Vector3 worldAttachmentPoint;\n        internal Vector3 worldDirection;\n        internal int numIterationsAtZeroImpulse;\n        private Entity vehicleEntity, supportEntity;\n        private float softness;\n\n        //Inverse effective mass matrix\n        private float velocityToImpulse;\n        private bool supportIsDynamic;\n\n        /// <summary>\n        /// Constructs a new suspension for a wheel.\n        /// </summary>\n        /// <param name=\"stiffnessConstant\">Strength of the spring.  Higher values resist compression more.</param>\n        /// <param name=\"dampingConstant\">Damping constant of the spring.  Higher values remove more momentum.</param>\n        /// <param name=\"localDirection\">Direction of the suspension in the vehicle's local space.  For a normal, straight down suspension, this would be (0, -1, 0).</param>\n        /// <param name=\"restLength\">Length of the suspension when uncompressed.</param>\n        /// <param name=\"localAttachmentPoint\">Place where the suspension hooks up to the body of the vehicle.</param>\n        public WheelSuspension(float stiffnessConstant, float dampingConstant, Vector3 localDirection, float restLength, Vector3 localAttachmentPoint)\n        {\n            SpringSettings.StiffnessConstant = stiffnessConstant;\n            SpringSettings.DampingConstant = dampingConstant;\n            LocalDirection = localDirection;\n            RestLength = restLength;\n            LocalAttachmentPoint = localAttachmentPoint;\n        }\n\n        internal WheelSuspension(Wheel wheel)\n        {\n            Wheel = wheel;\n        }\n\n        /// <summary>\n        /// Gets or sets the allowed compression of the suspension before suspension forces take effect.\n        /// Usually a very small number.  Used to prevent 'jitter' where the wheel leaves the ground due to spring forces repeatedly.\n        /// </summary>\n        public float AllowedCompression\n        {\n            get { return allowedCompression; }\n            set { allowedCompression = MathHelper.Max(0, value); }\n        }\n\n        /// <summary>\n        /// Gets the the current length of the suspension.\n        /// This will be less than the restLength if the suspension is compressed.\n        /// </summary>\n        public float CurrentLength\n        {\n            get { return currentLength; }\n        }\n\n        /// <summary>\n        /// Gets or sets the attachment point of the suspension to the vehicle body in the body's local space.\n        /// </summary>\n        public Vector3 LocalAttachmentPoint\n        {\n            get { return localAttachmentPoint; }\n            set\n            {\n                localAttachmentPoint = value;\n                if (wheel != null && wheel.vehicle != null)\n                {\n                    RigidTransform.Transform(ref localAttachmentPoint, ref wheel.vehicle.Body.CollisionInformation.worldTransform, out worldAttachmentPoint);\n                }\n                else\n                    worldAttachmentPoint = localAttachmentPoint;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the direction of the wheel suspension in the local space of the vehicle body.\n        /// A normal, straight suspension would be (0,-1,0).\n        /// </summary>\n        public Vector3 LocalDirection\n        {\n            get { return localDirection; }\n            set\n            {\n                localDirection = Vector3.Normalize(value);\n                if (wheel != null && wheel.vehicle != null)\n                    Matrix3x3.Transform(ref localDirection, ref wheel.vehicle.Body.orientationMatrix, out worldDirection);\n                else\n                    worldDirection = localDirection;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum speed at which the suspension will try to return the suspension to rest length.\n        /// </summary>\n        public float MaximumSpringCorrectionSpeed\n        {\n            get { return maximumSpringCorrectionSpeed; }\n            set { maximumSpringCorrectionSpeed = MathHelper.Max(0, value); }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum force that can be applied by this suspension.\n        /// </summary>\n        public float MaximumSpringForce\n        {\n            get { return maximumSpringForce; }\n            set { maximumSpringForce = MathHelper.Max(0, value); }\n        }\n\n        /// <summary>\n        /// Gets or sets the length of the uncompressed suspension.\n        /// </summary>\n        public float RestLength\n        {\n            get { return restLength; }\n            set { restLength = value; }\n        }\n\n        /// <summary>\n        /// Gets the force that the suspension is applying to support the vehicle.\n        /// </summary>\n        public float TotalImpulse\n        {\n            get { return -accumulatedImpulse; }\n        }\n\n        /// <summary>\n        /// Gets the wheel that this suspension applies to.\n        /// </summary>\n        public Wheel Wheel\n        {\n            get { return wheel; }\n            internal set { wheel = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the attachment point of the suspension to the vehicle body in world space.\n        /// </summary>\n        public Vector3 WorldAttachmentPoint\n        {\n            get { return worldAttachmentPoint; }\n            set\n            {\n                worldAttachmentPoint = value;\n                if (wheel != null && wheel.vehicle != null)\n                {\n                    RigidTransform.TransformByInverse(ref worldAttachmentPoint, ref wheel.vehicle.Body.CollisionInformation.worldTransform, out localAttachmentPoint);\n                }\n                else\n                    localAttachmentPoint = worldAttachmentPoint;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the direction of the wheel suspension in the world space of the vehicle body.\n        /// </summary>\n        public Vector3 WorldDirection\n        {\n            get { return worldDirection; }\n            set\n            {\n                worldDirection = Vector3.Normalize(value);\n                if (wheel != null && wheel.vehicle != null)\n                {\n                    Matrix3x3.TransformTranspose(ref worldDirection, ref wheel.Vehicle.Body.orientationMatrix, out localDirection);\n                }\n                else\n                    localDirection = worldDirection;\n            }\n        }\n\n        #region ISolverSettings Members\n\n        /// <summary>\n        /// Gets the solver settings used by this wheel constraint.\n        /// </summary>\n        public SolverSettings SolverSettings\n        {\n            get { return solverSettings; }\n        }\n\n        #endregion\n\n        #region ISpringSettings Members\n\n        /// <summary>\n        /// Gets the spring settings that define the behavior of the suspension.\n        /// </summary>\n        public SpringSettings SpringSettings\n        {\n            get { return springSettings; }\n        }\n\n        #endregion\n\n\n        ///<summary>\n        /// Gets the relative velocity along the support normal at the contact point.\n        ///</summary>\n        public float RelativeVelocity\n        {\n            get\n            {\n                float velocity = vehicleEntity.linearVelocity.X * linearAX + vehicleEntity.linearVelocity.Y * linearAY + vehicleEntity.linearVelocity.Z * linearAZ +\n                                 vehicleEntity.angularVelocity.X * angularAX + vehicleEntity.angularVelocity.Y * angularAY + vehicleEntity.angularVelocity.Z * angularAZ;\n                if (supportEntity != null)\n                    velocity += -supportEntity.linearVelocity.X * linearAX - supportEntity.linearVelocity.Y * linearAY - supportEntity.linearVelocity.Z * linearAZ +\n                                supportEntity.angularVelocity.X * angularBX + supportEntity.angularVelocity.Y * angularBY + supportEntity.angularVelocity.Z * angularBZ;\n                return velocity;\n            }\n        }\n\n        internal float ApplyImpulse()\n        {\n            //Compute relative velocity\n            float lambda = (RelativeVelocity \n                            + bias //Add in position correction\n                            + softness * accumulatedImpulse) //Add in squishiness\n                           * velocityToImpulse; //convert to impulse\n\n\n            //Clamp accumulated impulse\n            float previousAccumulatedImpulse = accumulatedImpulse;\n            accumulatedImpulse = MathHelper.Clamp(accumulatedImpulse + lambda, -maximumSpringForce, 0);\n            lambda = accumulatedImpulse - previousAccumulatedImpulse;\n\n            //Apply the impulse\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = lambda * linearAX;\n            linear.Y = lambda * linearAY;\n            linear.Z = lambda * linearAZ;\n            if (vehicleEntity.isDynamic)\n            {\n                angular.X = lambda * angularAX;\n                angular.Y = lambda * angularAY;\n                angular.Z = lambda * angularAZ;\n                vehicleEntity.ApplyLinearImpulse(ref linear);\n                vehicleEntity.ApplyAngularImpulse(ref angular);\n            }\n            if (supportIsDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = lambda * angularBX;\n                angular.Y = lambda * angularBY;\n                angular.Z = lambda * angularBZ;\n                supportEntity.ApplyLinearImpulse(ref linear);\n                supportEntity.ApplyAngularImpulse(ref angular);\n            }\n\n            return lambda;\n        }\n\n        internal void ComputeWorldSpaceData()\n        {\n            //Transform local space vectors to world space.\n            RigidTransform.Transform(ref localAttachmentPoint, ref wheel.vehicle.Body.CollisionInformation.worldTransform, out worldAttachmentPoint);\n            Matrix3x3.Transform(ref localDirection, ref wheel.vehicle.Body.orientationMatrix, out worldDirection);\n        }\n\n        internal void OnAdditionToVehicle()\n        {\n            //This looks weird, but it's just re-setting the world locations.\n            //If the wheel doesn't belong to a vehicle (or this doesn't belong to a wheel)\n            //then the world space location can't be set.\n            LocalDirection = LocalDirection;\n            LocalAttachmentPoint = LocalAttachmentPoint;\n        }\n\n        internal void PreStep(float dt)\n        {\n            vehicleEntity = wheel.vehicle.Body;\n            supportEntity = wheel.supportingEntity;\n            supportIsDynamic = supportEntity != null && supportEntity.isDynamic;\n\n            //The next line is commented out because the world direction is computed by the wheelshape.  Weird, but necessary.\n            //Vector3.TransformNormal(ref myLocalDirection, ref parentA.myInternalOrientationMatrix, out myWorldDirection);\n\n            //Set up the jacobians.\n            linearAX = -wheel.normal.X; //myWorldDirection.X;\n            linearAY = -wheel.normal.Y; //myWorldDirection.Y;\n            linearAZ = -wheel.normal.Z; // myWorldDirection.Z;\n            //linearBX = -linearAX;\n            //linearBY = -linearAY;\n            //linearBZ = -linearAZ;\n\n            //angular A = Ra x N\n            angularAX = (wheel.ra.Y * linearAZ) - (wheel.ra.Z * linearAY);\n            angularAY = (wheel.ra.Z * linearAX) - (wheel.ra.X * linearAZ);\n            angularAZ = (wheel.ra.X * linearAY) - (wheel.ra.Y * linearAX);\n\n            //Angular B = N x Rb\n            angularBX = (linearAY * wheel.rb.Z) - (linearAZ * wheel.rb.Y);\n            angularBY = (linearAZ * wheel.rb.X) - (linearAX * wheel.rb.Z);\n            angularBZ = (linearAX * wheel.rb.Y) - (linearAY * wheel.rb.X);\n\n            //Compute inverse effective mass matrix\n            float entryA, entryB;\n\n            //these are the transformed coordinates\n            float tX, tY, tZ;\n            if (vehicleEntity.isDynamic)\n            {\n                tX = angularAX * vehicleEntity.inertiaTensorInverse.M11 + angularAY * vehicleEntity.inertiaTensorInverse.M21 + angularAZ * vehicleEntity.inertiaTensorInverse.M31;\n                tY = angularAX * vehicleEntity.inertiaTensorInverse.M12 + angularAY * vehicleEntity.inertiaTensorInverse.M22 + angularAZ * vehicleEntity.inertiaTensorInverse.M32;\n                tZ = angularAX * vehicleEntity.inertiaTensorInverse.M13 + angularAY * vehicleEntity.inertiaTensorInverse.M23 + angularAZ * vehicleEntity.inertiaTensorInverse.M33;\n                entryA = tX * angularAX + tY * angularAY + tZ * angularAZ + vehicleEntity.inverseMass;\n            }\n            else\n                entryA = 0;\n\n            if (supportIsDynamic)\n            {\n                tX = angularBX * supportEntity.inertiaTensorInverse.M11 + angularBY * supportEntity.inertiaTensorInverse.M21 + angularBZ * supportEntity.inertiaTensorInverse.M31;\n                tY = angularBX * supportEntity.inertiaTensorInverse.M12 + angularBY * supportEntity.inertiaTensorInverse.M22 + angularBZ * supportEntity.inertiaTensorInverse.M32;\n                tZ = angularBX * supportEntity.inertiaTensorInverse.M13 + angularBY * supportEntity.inertiaTensorInverse.M23 + angularBZ * supportEntity.inertiaTensorInverse.M33;\n                entryB = tX * angularBX + tY * angularBY + tZ * angularBZ + supportEntity.inverseMass;\n            }\n            else\n                entryB = 0;\n\n            //Convert spring constant and damping constant into ERP and CFM.\n            float biasFactor;\n            springSettings.ComputeErrorReductionAndSoftness(dt, out biasFactor, out softness);\n\n            velocityToImpulse = -1 / (entryA + entryB + softness);\n\n            //Correction velocity\n            bias = MathHelper.Min(MathHelper.Max(0, (restLength - currentLength) - allowedCompression) * biasFactor, maximumSpringCorrectionSpeed);\n\n\n        }\n\n        internal void ExclusiveUpdate()\n        {\n            //Warm starting\n#if !WINDOWS\n            Vector3 linear = new Vector3();\n            Vector3 angular = new Vector3();\n#else\n            Vector3 linear, angular;\n#endif\n            linear.X = accumulatedImpulse * linearAX;\n            linear.Y = accumulatedImpulse * linearAY;\n            linear.Z = accumulatedImpulse * linearAZ;\n            if (vehicleEntity.isDynamic)\n            {\n                angular.X = accumulatedImpulse * angularAX;\n                angular.Y = accumulatedImpulse * angularAY;\n                angular.Z = accumulatedImpulse * angularAZ;\n                vehicleEntity.ApplyLinearImpulse(ref linear);\n                vehicleEntity.ApplyAngularImpulse(ref angular);\n            }\n            if (supportIsDynamic)\n            {\n                linear.X = -linear.X;\n                linear.Y = -linear.Y;\n                linear.Z = -linear.Z;\n                angular.X = accumulatedImpulse * angularBX;\n                angular.Y = accumulatedImpulse * angularBY;\n                angular.Z = accumulatedImpulse * angularBZ;\n                supportEntity.ApplyLinearImpulse(ref linear);\n                supportEntity.ApplyAngularImpulse(ref angular);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUutilities/AffineTransform.cs",
    "content": "﻿ \n\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUutilities\n{\n    ///<summary>\n    /// A transformation composed of a linear transformation and a translation.\n    ///</summary>\n    public struct AffineTransform\n    {\n        ///<summary>\n        /// Translation in the affine transform.\n        ///</summary>\n        public Vector3 Translation;\n        /// <summary>\n        /// Linear transform in the affine transform.\n        /// </summary>\n        public Matrix3x3 LinearTransform;\n\n        ///<summary>\n        /// Constructs a new affine transform.\n        ///</summary>\n        ///<param name=\"translation\">Translation to use in the transform.</param>\n        public AffineTransform(Vector3 translation)\n        {\n            LinearTransform = Matrix3x3.Identity;\n            Translation = translation;\n        }\n\n        ///<summary>\n        /// Constructs a new affine tranform.\n        ///</summary>\n        ///<param name=\"orientation\">Orientation to use as the linear transform.</param>\n        ///<param name=\"translation\">Translation to use in the transform.</param>\n        public AffineTransform(Quaternion orientation, Vector3 translation)\n        {\n            Matrix3x3.CreateFromQuaternion(ref orientation, out LinearTransform);\n            Translation = translation;\n        }\n\n        ///<summary>\n        /// Constructs a new affine transform.\n        ///</summary>\n        ///<param name=\"scaling\">Scaling to apply in the linear transform.</param>\n        ///<param name=\"orientation\">Orientation to apply in the linear transform.</param>\n        ///<param name=\"translation\">Translation to apply.</param>\n        public AffineTransform(Vector3 scaling, Quaternion orientation, Vector3 translation)\n        {\n            //Create an SRT transform.\n            Matrix3x3.CreateScale(ref scaling, out LinearTransform);\n            Matrix3x3 rotation;\n            Matrix3x3.CreateFromQuaternion(ref orientation, out rotation);\n            Matrix3x3.Multiply(ref LinearTransform, ref rotation, out LinearTransform);\n            Translation = translation;\n        }\n\n        ///<summary>\n        /// Constructs a new affine transform.\n        ///</summary>\n        ///<param name=\"linearTransform\">The linear transform component.</param>\n        ///<param name=\"translation\">Translation component of the transform.</param>\n        public AffineTransform(Matrix3x3 linearTransform, Vector3 translation)\n        {\n            LinearTransform = linearTransform;\n            Translation = translation;\n\n        }\n\n        ///<summary>\n        /// Gets or sets the 4x4 matrix representation of the affine transform.\n        /// The linear transform is the upper left 3x3 part of the 4x4 matrix.\n        /// The translation is included in the matrix's Translation property.\n        ///</summary>\n        public Matrix Matrix\n        {\n            get\n            {\n                Matrix toReturn;\n                Matrix3x3.ToMatrix4X4(ref LinearTransform, out toReturn);\n                toReturn.Translation = Translation;\n                return toReturn;\n            }\n            set\n            {\n                Matrix3x3.CreateFromMatrix(ref value, out LinearTransform);\n                Translation = value.Translation;\n            }\n        }\n\n\n        ///<summary>\n        /// Gets the identity affine transform.\n        ///</summary>\n        public static AffineTransform Identity\n        {\n            get\n            {\n                var t = new AffineTransform { LinearTransform = Matrix3x3.Identity, Translation = new Vector3() };\n                return t;\n            }\n        }\n\n        ///<summary>\n        /// Transforms a vector by an affine transform.\n        ///</summary>\n        ///<param name=\"position\">Position to transform.</param>\n        ///<param name=\"transform\">Transform to apply.</param>\n        ///<param name=\"transformed\">Transformed position.</param>\n        public static void Transform(ref Vector3 position, ref AffineTransform transform, out Vector3 transformed)\n        {\n            Matrix3x3.Transform(ref position, ref transform.LinearTransform, out transformed);\n            Vector3.Add(ref transformed, ref transform.Translation, out transformed);\n        }\n\n        ///<summary>\n        /// Transforms a vector by an affine transform's inverse.\n        ///</summary>\n        ///<param name=\"position\">Position to transform.</param>\n        ///<param name=\"transform\">Transform to invert and apply.</param>\n        ///<param name=\"transformed\">Transformed position.</param>\n        public static void TransformInverse(ref Vector3 position, ref AffineTransform transform, out Vector3 transformed)\n        {\n            Vector3.Subtract(ref position, ref transform.Translation, out transformed);\n            Matrix3x3 inverse;\n            Matrix3x3.Invert(ref transform.LinearTransform, out inverse);\n            Matrix3x3.TransformTranspose(ref transformed, ref inverse, out transformed);\n        }\n\n        ///<summary>\n        /// Inverts an affine transform.\n        ///</summary>\n        ///<param name=\"transform\">Transform to invert.</param>\n        /// <param name=\"inverse\">Inverse of the transform.</param>\n        public static void Invert(ref AffineTransform transform, out AffineTransform inverse)\n        {\n            Matrix3x3.Invert(ref transform.LinearTransform, out inverse.LinearTransform);\n            Matrix3x3.Transform(ref transform.Translation, ref inverse.LinearTransform, out inverse.Translation);\n            Vector3.Negate(ref inverse.Translation, out inverse.Translation);\n        }\n\n        /// <summary>\n        /// Multiplies a transform by another transform.\n        /// </summary>\n        /// <param name=\"a\">First transform.</param>\n        /// <param name=\"b\">Second transform.</param>\n        /// <param name=\"transform\">Combined transform.</param>\n        public static void Multiply(ref AffineTransform a, ref AffineTransform b, out AffineTransform transform)\n        {\n            Matrix3x3 linearTransform;//Have to use temporary variable just in case a or b reference is transform.\n            Matrix3x3.Multiply(ref a.LinearTransform, ref b.LinearTransform, out linearTransform);\n            Vector3 translation;\n            Matrix3x3.Transform(ref a.Translation, ref b.LinearTransform, out translation);\n            Vector3.Add(ref translation, ref b.Translation, out transform.Translation);\n            transform.LinearTransform = linearTransform;\n        }\n\n        ///<summary>\n        /// Multiplies a rigid transform by an affine transform.\n        ///</summary>\n        ///<param name=\"a\">Rigid transform.</param>\n        ///<param name=\"b\">Affine transform.</param>\n        ///<param name=\"transform\">Combined transform.</param>\n        public static void Multiply(ref RigidTransform a, ref AffineTransform b, out AffineTransform transform)\n        {\n            Matrix3x3 linearTransform;//Have to use temporary variable just in case b reference is transform.\n            Matrix3x3.CreateFromQuaternion(ref a.Orientation, out linearTransform);\n            Matrix3x3.Multiply(ref linearTransform, ref b.LinearTransform, out linearTransform);\n            Vector3 translation;\n            Matrix3x3.Transform(ref a.Position, ref b.LinearTransform, out translation);\n            Vector3.Add(ref translation, ref b.Translation, out transform.Translation);\n            transform.LinearTransform = linearTransform;\n        }\n\n\n        ///<summary>\n        /// Transforms a vector using an affine transform.\n        ///</summary>\n        ///<param name=\"position\">Position to transform.</param>\n        ///<param name=\"affineTransform\">Transform to apply.</param>\n        ///<returns>Transformed position.</returns>\n        public static Vector3 Transform(Vector3 position, AffineTransform affineTransform)\n        {\n            Vector3 toReturn;\n            Transform(ref position, ref affineTransform, out toReturn);\n            return toReturn;\n        }\n\n        /// <summary>\n        /// Creates an affine transform from a rigid transform.\n        /// </summary>\n        /// <param name=\"rigid\">Rigid transform to base the affine transform on.</param>\n        /// <param name=\"affine\">Affine transform created from the rigid transform.</param>\n        public static void CreateFromRigidTransform(ref RigidTransform rigid, out AffineTransform affine)\n        {\n            affine.Translation = rigid.Position;\n            Matrix3x3.CreateFromQuaternion(ref rigid.Orientation, out affine.LinearTransform);\n        }\n\n        /// <summary>\n        /// Creates an affine transform from a rigid transform.\n        /// </summary>\n        /// <param name=\"rigid\">Rigid transform to base the affine transform on.</param>\n        /// <returns>Affine transform created from the rigid transform.</returns>\n        public static AffineTransform CreateFromRigidTransform(RigidTransform rigid)\n        {\n            AffineTransform toReturn;\n            toReturn.Translation = rigid.Position;\n            Matrix3x3.CreateFromQuaternion(ref rigid.Orientation, out toReturn.LinearTransform);\n            return toReturn;\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/BEPUutilities.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <ProjectGuid>{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}</ProjectGuid>\n    <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>BEPUutilities</RootNamespace>\n    <AssemblyName>BEPUutilities</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <TargetFrameworkProfile>Client</TargetFrameworkProfile>\n    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>\n    <XnaPlatform>Windows</XnaPlatform>\n    <XnaProfile>Reach</XnaProfile>\n    <XnaCrossPlatformGroupID>0aedf39e-8385-4a55-9db6-916f6d31ad51</XnaCrossPlatformGroupID>\n    <XnaOutputType>Library</XnaOutputType>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|x86' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\x86\\Debug</OutputPath>\n    <DefineConstants>TRACE;DEBUG;WINDOWS;ALLOWUNSAFE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoStdLib>true</NoStdLib>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <PlatformTarget>x86</PlatformTarget>\n    <XnaCompressContent>false</XnaCompressContent>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <DocumentationFile>bin\\x86\\Debug\\BEPUutilities.XML</DocumentationFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|x86' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\x86\\Release</OutputPath>\n    <DefineConstants>WINDOWS;ALLOWUNSAFE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoStdLib>true</NoStdLib>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <PlatformTarget>x86</PlatformTarget>\n    <XnaCompressContent>true</XnaCompressContent>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <DocumentationFile>bin\\x86\\Release\\BEPUutilities.XML</DocumentationFile>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>strongNameKey.snk</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"mscorlib\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"System.Core\">\n      <RequiredTargetFramework>4.0</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"System.Xml.Linq\">\n      <RequiredTargetFramework>4.0</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"System.Net\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AffineTransform.cs\" />\n    <Compile Include=\"ConvexHullHelper.cs\" />\n    <Compile Include=\"ConvexHullHelper.Pruning.cs\" />\n    <Compile Include=\"DataStructures\\ConcurrentDeque.cs\" />\n    <Compile Include=\"DataStructures\\HashSet.cs\" />\n    <Compile Include=\"DataStructures\\ObservableDictionary.cs\" />\n    <Compile Include=\"DataStructures\\ObservableList.cs\" />\n    <Compile Include=\"DataStructures\\RawList.cs\" />\n    <Compile Include=\"DataStructures\\RawValueList.cs\" />\n    <Compile Include=\"DataStructures\\ReadOnlyDictionary.cs\" />\n    <Compile Include=\"DataStructures\\ReadOnlyEnumerable.cs\" />\n    <Compile Include=\"DataStructures\\ReadOnlyList.cs\" />\n    <Compile Include=\"DataStructures\\TinyList.cs\" />\n    <Compile Include=\"DataStructures\\TinyStructList.cs\" />\n    <Compile Include=\"MathChecker.cs\" />\n    <Compile Include=\"Matrix2x2.cs\" />\n    <Compile Include=\"Matrix2x3.cs\" />\n    <Compile Include=\"Matrix3x2.cs\" />\n    <Compile Include=\"Matrix3x3.cs\" />\n    <Compile Include=\"PermutationMapper.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"RayHit.cs\" />\n    <Compile Include=\"ResourceManagement\\CommonResources.cs\" />\n    <Compile Include=\"ResourceManagement\\LockingResourcePool.cs\" />\n    <Compile Include=\"ResourceManagement\\ResourcePool.cs\" />\n    <Compile Include=\"ResourceManagement\\UnsafeResourcePool.cs\" />\n    <Compile Include=\"RigidTransform.cs\" />\n    <Compile Include=\"SpinLock.cs\" />\n    <Compile Include=\"Toolbox.cs\" />\n    <Compile Include=\"TriangleSidedness.cs\" />\n    <Compile Include=\"VoronoiRegion.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"strongNameKey.snk\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\Microsoft\\XNA Game Studio\\Microsoft.Xna.GameStudio.targets\" />\n  <!--\n      To modify your build process, add your task inside one of the targets below and uncomment it. \n      Other similar extension points exist, see Microsoft.Common.targets.\n      <Target Name=\"BeforeBuild\">\n      </Target>\n      <Target Name=\"AfterBuild\">\n      </Target>\n    -->\n</Project>"
  },
  {
    "path": "BEPUutilities/ConvexHullHelper.Pruning.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUutilities\n{\n    public static partial class ConvexHullHelper\n    {\n        /// <summary>\n        /// Represents a cell in space which is already occupied by a point.  Any other points which resolve to the same cell are considered redundant.\n        /// </summary>\n        public struct BlockedCell : IEquatable<BlockedCell>\n        {\n            public int X;\n            public int Y;\n            public int Z;\n\n            public override int GetHashCode()\n            {\n                const long p1 = 961748927L;\n                const long p2 = 961748941L;\n                const long p3 = 982451653L;\n                return (int)(X * p1 + Y * p2 + Z * p3);\n            }\n\n            public override bool Equals(object obj)\n            {\n                return this.Equals((BlockedCell)obj);\n            }\n\n            public bool Equals(BlockedCell other)\n            {\n                return other.X == X && other.Y == Y && other.Z == Z;\n            }\n        }\n\n        /// <summary>\n        /// Contains and manufactures cell sets used by the redundant point remover.  To minimize memory usage, this can be cleared\n        /// after using the RemoveRedundantPoints if it isn't going to be used again.\n        /// </summary>\n        public static LockingResourcePool<HashSet<BlockedCell>> BlockedCellSets = new LockingResourcePool<HashSet<BlockedCell>>();\n\n        /// <summary>\n        /// Removes redundant points.  Two points are redundant if they occupy the same hash grid cell of size 0.001.\n        /// </summary>\n        /// <param name=\"points\">List of points to prune.</param>\n        public static void RemoveRedundantPoints(IList<Vector3> points)\n        {\n            RemoveRedundantPoints(points, .001);\n        }\n\n        /// <summary>\n        /// Removes redundant points.  Two points are redundant if they occupy the same hash grid cell.\n        /// </summary>\n        /// <param name=\"points\">List of points to prune.</param>\n        /// <param name=\"cellSize\">Size of cells to determine redundancy.</param>\n        public static void RemoveRedundantPoints(IList<Vector3> points, double cellSize)\n        {\n            var rawPoints = CommonResources.GetVectorList();\n            rawPoints.AddRange(points);\n            RemoveRedundantPoints(rawPoints, cellSize);\n            points.Clear();\n            for (int i = 0; i < rawPoints.Count; ++i)\n            {\n                points.Add(rawPoints.Elements[i]);\n            }\n            CommonResources.GiveBack(rawPoints);\n        }\n\n        /// <summary>\n        /// Removes redundant points.  Two points are redundant if they occupy the same hash grid cell of size 0.001.\n        /// </summary>\n        /// <param name=\"points\">List of points to prune.</param>\n        public static void RemoveRedundantPoints(RawList<Vector3> points)\n        {\n            RemoveRedundantPoints(points, .001);\n        }\n\n        /// <summary>\n        /// Removes redundant points.  Two points are redundant if they occupy the same hash grid cell.\n        /// </summary>\n        /// <param name=\"points\">List of points to prune.</param>\n        /// <param name=\"cellSize\">Size of cells to determine redundancy.</param>\n        public static void RemoveRedundantPoints(RawList<Vector3> points, double cellSize)\n        {\n            var set = BlockedCellSets.Take();\n            for (int i = points.Count - 1; i >= 0; --i)\n            {\n                var element = points.Elements[i];\n                var cell = new BlockedCell\n                {\n                    X = (int)Math.Floor(element.X / cellSize),\n                    Y = (int)Math.Floor(element.Y / cellSize),\n                    Z = (int)Math.Floor(element.Z / cellSize) \n                };\n                if (set.Contains(cell))\n                {\n                    points.FastRemoveAt(i);\n                }\n                else\n                {\n                    set.Add(cell);\n                    //TODO: Consider adding adjacent cells to guarantee that a point on the border between two cells will still detect the presence\n                    //of a point on the opposite side of that border.\n                }\n            }\n            set.Clear();\n            BlockedCellSets.GiveBack(set);\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/ConvexHullHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing BEPUutilities;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUutilities\n{\n    /// <summary>\n    /// Processes vertex data into convex hulls.\n    /// </summary>\n    public static partial class ConvexHullHelper\n    {\n\n        /// <summary>\n        /// Identifies the indices of points in a set which are on the outer convex hull of the set.\n        /// </summary>\n        /// <param name=\"points\">List of points in the set.</param>\n        /// <param name=\"indices\">List of indices composing the triangulated surface of the convex hull.\n        /// Each group of 3 indices represents a triangle on the surface of the hull.</param>\n        public static void GetConvexHull(IList<Vector3> points, IList<int> indices)\n        {\n            var rawPoints = CommonResources.GetVectorList();\n            var rawIndices = CommonResources.GetIntList();\n            rawPoints.AddRange(points);\n            GetConvexHull(rawPoints, rawIndices);\n            CommonResources.GiveBack(rawPoints);\n            for (int i = 0; i < rawIndices.Count; i++)\n            {\n                indices.Add(rawIndices[i]);\n            }\n            CommonResources.GiveBack(rawIndices);\n        }\n\n        /// <summary>\n        /// Identifies the points on the surface of hull.\n        /// </summary>\n        /// <param name=\"points\">List of points in the set.</param>\n        /// <param name=\"outputSurfacePoints\">Unique points on the surface of the convex hull.</param>\n        public static void GetConvexHull(IList<Vector3> points, IList<Vector3> outputSurfacePoints)\n        {\n            var rawPoints = CommonResources.GetVectorList();\n            rawPoints.AddRange(points);\n            GetConvexHull(rawPoints, outputSurfacePoints);\n            CommonResources.GiveBack(rawPoints);\n        }\n\n        /// <summary>\n        /// Identifies the points on the surface of hull.\n        /// </summary>\n        /// <param name=\"points\">List of points in the set.</param>\n        /// <param name=\"outputSurfacePoints\">Unique points on the surface of the convex hull.</param>\n        public static void GetConvexHull(RawList<Vector3> points, IList<Vector3> outputSurfacePoints)\n        {\n            var indices = CommonResources.GetIntList();\n            GetConvexHull(points, indices, outputSurfacePoints);\n            CommonResources.GiveBack(indices);\n        }\n\n        /// <summary>\n        /// Identifies the points on the surface of hull.\n        /// </summary>\n        /// <param name=\"points\">List of points in the set.</param>\n        /// <param name=\"outputIndices\">List of indices composing the triangulated surface of the convex hull.\n        /// Each group of 3 indices represents a triangle on the surface of the hull.</param>\n        /// <param name=\"outputSurfacePoints\">Unique points on the surface of the convex hull.</param>\n        public static void GetConvexHull(IList<Vector3> points, IList<int> outputIndices, IList<Vector3> outputSurfacePoints)\n        {\n            var rawPoints = CommonResources.GetVectorList();\n            var rawIndices = CommonResources.GetIntList();\n            rawPoints.AddRange(points);\n            GetConvexHull(rawPoints, rawIndices, outputSurfacePoints);\n            CommonResources.GiveBack(rawPoints);\n            for (int i = 0; i < rawIndices.Count; i++)\n            {\n                outputIndices.Add(rawIndices[i]);\n            }\n            CommonResources.GiveBack(rawIndices);\n        }\n\n        /// <summary>\n        /// Identifies the points on the surface of hull.\n        /// </summary>\n        /// <param name=\"points\">List of points in the set.</param>\n        /// <param name=\"outputTriangleIndices\">List of indices composing the triangulated surface of the convex hull.\n        /// Each group of 3 indices represents a triangle on the surface of the hull.</param>\n        /// <param name=\"outputSurfacePoints\">Unique points on the surface of the convex hull.</param>\n        public static void GetConvexHull(RawList<Vector3> points, RawList<int> outputTriangleIndices, IList<Vector3> outputSurfacePoints)\n        {\n            GetConvexHull(points, outputTriangleIndices);\n\n            var alreadyContainedIndices = CommonResources.GetIntSet();\n\n            for (int i = outputTriangleIndices.Count - 1; i >= 0; i--)\n            {\n                int index = outputTriangleIndices[i];\n                if (!alreadyContainedIndices.Contains(index))\n                {\n                    outputSurfacePoints.Add(points[index]);\n                    alreadyContainedIndices.Add(index);\n                }\n            }\n\n            CommonResources.GiveBack(alreadyContainedIndices);\n\n\n        }\n\n        /// <summary>\n        /// Identifies the indices of points in a set which are on the outer convex hull of the set.\n        /// </summary>\n        /// <param name=\"points\">List of points in the set.</param>\n        /// <param name=\"outputTriangleIndices\">List of indices composing the triangulated surface of the convex hull.\n        /// Each group of 3 indices represents a triangle on the surface of the hull.</param>\n        public static void GetConvexHull(RawList<Vector3> points, RawList<int> outputTriangleIndices)\n        {\n            if (points.Count == 0)\n            {\n                throw new ArgumentException(\"Point set must have volume.\");\n            }\n            RawList<int> outsidePoints = CommonResources.GetIntList();\n            if (outsidePoints.Capacity < points.Count - 4)\n                outsidePoints.Capacity = points.Count - 4;\n\n            //Build the initial tetrahedron.\n            //It will also give us the location of a point which is guaranteed to be within the\n            //final convex hull.  We can use this point to calibrate the winding of triangles.\n            //A set of outside point candidates (all points other than those composing the tetrahedron) will be returned in the outsidePoints list.\n            //That list will then be further pruned by the RemoveInsidePoints call.\n            Vector3 insidePoint;\n            ComputeInitialTetrahedron(points, outsidePoints, outputTriangleIndices, out insidePoint);\n\n            //Compute outside points.\n            RemoveInsidePoints(points, outputTriangleIndices, outsidePoints);\n\n            var edges = CommonResources.GetIntList();\n            var toRemove = CommonResources.GetIntList();\n            var newTriangles = CommonResources.GetIntList();\n\n            //We're now ready to begin the main loop.\n            while (outsidePoints.Count > 0)\n            {\n                //While the convex hull is incomplete...\n                for (int k = 0; k < outputTriangleIndices.Count; k += 3)\n                {\n                    //Find the normal of the triangle\n                    Vector3 normal;\n                    FindNormal(outputTriangleIndices, points, k, out normal);\n\n                    //Get the furthest point in the direction of the normal.\n                    int maxIndexInOutsideList = GetExtremePoint(ref normal, points, outsidePoints);\n                    int maxIndex = outsidePoints.Elements[maxIndexInOutsideList];\n                    Vector3 maximum = points.Elements[maxIndex];\n\n                    //If the point is beyond the current triangle, continue.\n                    Vector3 offset;\n                    Vector3.Subtract(ref maximum, ref points.Elements[outputTriangleIndices.Elements[k]], out offset);\n                    float dot;\n                    Vector3.Dot(ref normal, ref offset, out dot);\n                    if (dot > 0)\n                    {\n                        //It's been picked! Remove the maximum point from the outside.\n                        outsidePoints.FastRemoveAt(maxIndexInOutsideList);\n                        //Remove any triangles that can see the point, including itself!\n                        edges.Clear();\n                        toRemove.Clear();\n                        for (int n = outputTriangleIndices.Count - 3; n >= 0; n -= 3)\n                        {\n                            //Go through each triangle, if it can be seen, delete it and use maintainEdge on its edges.\n                            if (IsTriangleVisibleFromPoint(outputTriangleIndices, points, n, ref maximum))\n                            {\n                                //This triangle can see it!\n                                //TODO: CONSIDER CONSISTENT WINDING HAPPYTIMES\n                                MaintainEdge(outputTriangleIndices[n], outputTriangleIndices[n + 1], edges);\n                                MaintainEdge(outputTriangleIndices[n], outputTriangleIndices[n + 2], edges);\n                                MaintainEdge(outputTriangleIndices[n + 1], outputTriangleIndices[n + 2], edges);\n                                //Because fast removals are being used, the order is very important.\n                                //It's pulling indices in from the end of the list in order, and also ensuring\n                                //that we never issue a removal order beyond the end of the list.\n                                outputTriangleIndices.FastRemoveAt(n + 2);\n                                outputTriangleIndices.FastRemoveAt(n + 1);\n                                outputTriangleIndices.FastRemoveAt(n);\n\n                            }\n                        }\n                        //Create new triangles.\n                        for (int n = 0; n < edges.Count; n += 2)\n                        {\n                            //For each edge, create a triangle with the extreme point.\n                            newTriangles.Add(edges[n]);\n                            newTriangles.Add(edges[n + 1]);\n                            newTriangles.Add(maxIndex);\n                        }\n                        //Only verify the windings of the new triangles.\n                        VerifyWindings(newTriangles, points, ref insidePoint);\n                        outputTriangleIndices.AddRange(newTriangles);\n                        newTriangles.Clear();\n\n                        //Remove all points from the outsidePoints if they are inside the polyhedron\n                        RemoveInsidePoints(points, outputTriangleIndices, outsidePoints);\n\n                        //The list has been significantly messed with, so restart the loop.\n                        break;\n                    }\n                }\n            }\n\n\n            CommonResources.GiveBack(outsidePoints);\n            CommonResources.GiveBack(edges);\n            CommonResources.GiveBack(toRemove);\n            CommonResources.GiveBack(newTriangles);\n        }\n\n        private static void MaintainEdge(int a, int b, RawList<int> edges)\n        {\n            bool contained = false;\n            int index = 0;\n            for (int k = 0; k < edges.Count; k += 2)\n            {\n                if ((edges[k] == a && edges[k + 1] == b) || (edges[k] == b && edges[k + 1] == a))\n                {\n                    contained = true;\n                    index = k;\n                }\n            }\n            //If it isn't present, add it to the edge list.\n            if (!contained)\n            {\n                edges.Add(a);\n                edges.Add(b);\n            }\n            else\n            {\n                //If it is present, that means both edge-connected triangles were deleted now, so get rid of it.\n                edges.FastRemoveAt(index + 1);\n                edges.FastRemoveAt(index);\n            }\n        }\n\n        private static int GetExtremePoint(ref Vector3 direction, RawList<Vector3> points, RawList<int> outsidePoints)\n        {\n            float maximumDot = -float.MaxValue;\n            int extremeIndex = 0;\n            for (int i = 0; i < outsidePoints.Count; ++i)\n            {\n                float dot;\n                Vector3.Dot(ref points.Elements[outsidePoints[i]], ref direction, out dot);\n                if (dot > maximumDot)\n                {\n                    maximumDot = dot;\n                    extremeIndex = i;\n                }\n            }\n            return extremeIndex;\n        }\n\n        private static void GetExtremePoints(ref Vector3 direction, RawList<Vector3> points, out float maximumDot, out float minimumDot, out int maximumIndex, out int minimumIndex)\n        {\n            maximumIndex = 0;\n            minimumIndex = 0;\n\n            float dot;\n            Vector3.Dot(ref points.Elements[0], ref direction, out dot);\n            minimumDot = dot;\n            maximumDot = dot;\n            for (int i = 1; i < points.Count; ++i)\n            {\n                Vector3.Dot(ref points.Elements[i], ref direction, out dot);\n                if (dot > maximumDot)\n                {\n                    maximumDot = dot;\n                    maximumIndex = i;\n                }\n                else if (dot < minimumDot)\n                {\n                    minimumDot = dot;\n                    minimumIndex = i;\n                }\n            }\n        }\n\n        private static void ComputeInitialTetrahedron(RawList<Vector3> points, RawList<int> outsidePointCandidates, RawList<int> triangleIndices, out Vector3 centroid)\n        {\n            //Find four points on the hull.\n            //We'll start with using the x axis to identify two points on the hull.\n            int a, b, c, d;\n            Vector3 direction;\n            //Find the extreme points along the x axis.\n            float minimumX = float.MaxValue, maximumX = -float.MaxValue;\n            int minimumXIndex = 0, maximumXIndex = 0;\n            for (int i = 0; i < points.Count; ++i)\n            {\n                var v = points.Elements[i];\n                if (v.X > maximumX)\n                {\n                    maximumX = v.X;\n                    maximumXIndex = i;\n                }\n                else if (v.X < minimumX)\n                {\n                    minimumX = v.X;\n                    minimumXIndex = i;\n                }\n            }\n            a = minimumXIndex;\n            b = maximumXIndex;\n            //Check for redundancies..\n            if (a == b)\n                throw new ArgumentException(\"Point set is degenerate; convex hulls must have volume.\");\n\n            //Now, use a second axis perpendicular to the two points we found.\n            Vector3 ab;\n            Vector3.Subtract(ref points.Elements[b], ref points.Elements[a], out ab);\n            Vector3.Cross(ref ab, ref Toolbox.UpVector, out direction);\n            if (direction.LengthSquared() < Toolbox.Epsilon)\n                Vector3.Cross(ref ab, ref Toolbox.RightVector, out direction);\n            float minimumDot, maximumDot;\n            int minimumIndex, maximumIndex;\n            GetExtremePoints(ref direction, points, out maximumDot, out minimumDot, out maximumIndex, out minimumIndex);\n            //Compare the location of the extreme points to the location of the axis.\n            float dot;\n            Vector3.Dot(ref direction, ref points.Elements[a], out dot);\n            //Use the point further from the axis.\n            if (Math.Abs(dot - minimumDot) > Math.Abs(dot - maximumDot))\n            {\n                //In this case, we should use the minimum index.\n                c = minimumIndex;\n            }\n            else\n            {\n                //In this case, we should use the maximum index.\n                c = maximumIndex;\n            }\n\n            //Check for redundancies..\n            if (a == c || b == c)\n                throw new ArgumentException(\"Point set is degenerate; convex hulls must have volume.\");\n\n            //Use a third axis perpendicular to the plane defined by the three unique points a, b, and c.\n            Vector3 ac;\n            Vector3.Subtract(ref points.Elements[c], ref points.Elements[a], out ac);\n            Vector3.Cross(ref ab, ref ac, out direction);\n\n            GetExtremePoints(ref direction, points, out maximumDot, out minimumDot, out maximumIndex, out minimumIndex);\n            //Compare the location of the extreme points to the location of the plane.\n            Vector3.Dot(ref direction, ref points.Elements[a], out dot);\n            //Use the point further from the plane. \n            if (Math.Abs(dot - minimumDot) > Math.Abs(dot - maximumDot))\n            {\n                //In this case, we should use the minimum index.\n                d = minimumIndex;\n            }\n            else\n            {\n                //In this case, we should use the maximum index.\n                d = maximumIndex;\n            }\n\n            //Check for redundancies..\n            if (a == d || b == d || c == d)\n                throw new ArgumentException(\"Point set is degenerate; convex hulls must have volume.\");\n\n            //Add the triangles.\n            triangleIndices.Add(a);\n            triangleIndices.Add(b);\n            triangleIndices.Add(c);\n\n            triangleIndices.Add(a);\n            triangleIndices.Add(b);\n            triangleIndices.Add(d);\n\n            triangleIndices.Add(a);\n            triangleIndices.Add(c);\n            triangleIndices.Add(d);\n\n            triangleIndices.Add(b);\n            triangleIndices.Add(c);\n            triangleIndices.Add(d);\n\n            //The centroid is guaranteed to be within the convex hull.  It will be used to verify the windings of triangles throughout the hull process.\n            Vector3.Add(ref points.Elements[a], ref points.Elements[b], out centroid);\n            Vector3.Add(ref centroid, ref points.Elements[c], out centroid);\n            Vector3.Add(ref centroid, ref points.Elements[d], out centroid);\n            Vector3.Multiply(ref centroid, 0.25f, out centroid);\n\n            for (int i = 0; i < triangleIndices.Count; i += 3)\n            {\n                var vA = points.Elements[triangleIndices.Elements[i]];\n                var vB = points.Elements[triangleIndices.Elements[i + 1]];\n                var vC = points.Elements[triangleIndices.Elements[i + 2]];\n\n                //Check the signed volume of a parallelepiped with the edges of this triangle and the centroid.\n                Vector3 cross;\n                Vector3.Subtract(ref vB, ref vA, out ab);\n                Vector3.Subtract(ref vC, ref vA, out ac);\n                Vector3.Cross(ref ac, ref ab, out cross);\n                Vector3 offset;\n                Vector3.Subtract(ref vA, ref centroid, out offset);\n                float volume;\n                Vector3.Dot(ref offset, ref cross, out volume);\n                //This volume/cross product could also be used to check for degeneracy, but we already tested for that.\n                if (Math.Abs(volume) < Toolbox.BigEpsilon)\n                {\n                    throw new ArgumentException(\"Point set is degenerate; convex hulls must have volume.\");\n                }\n                if (volume < 0)\n                {\n                    //If the signed volume is negative, that means the triangle's winding is opposite of what we want.\n                    //Flip it around!\n                    var temp = triangleIndices.Elements[i];\n                    triangleIndices.Elements[i] = triangleIndices.Elements[i + 1];\n                    triangleIndices.Elements[i + 1] = temp;\n                }\n            }\n\n            //Points which belong to the tetrahedra are guaranteed to be 'in' the convex hull. Do not allow them to be considered.\n            var tetrahedronIndices = CommonResources.GetIntList();\n            tetrahedronIndices.Add(a);\n            tetrahedronIndices.Add(b);\n            tetrahedronIndices.Add(c);\n            tetrahedronIndices.Add(d);\n            //Sort the indices to allow a linear time loop.\n            Array.Sort(tetrahedronIndices.Elements, 0, 4);\n            int tetrahedronIndex = 0;\n            for (int i = 0; i < points.Count; ++i)\n            {\n                if (tetrahedronIndex < 4 && i == tetrahedronIndices[tetrahedronIndex])\n                {\n                    //Don't add a tetrahedron index. Now that we've found this index, though, move on to the next one.\n                    ++tetrahedronIndex;\n                }\n                else\n                {\n                    outsidePointCandidates.Add(i);\n                }\n            }\n            CommonResources.GiveBack(tetrahedronIndices);\n        }\n\n        private static void RemoveInsidePoints(RawList<Vector3> points, RawList<int> triangleIndices, RawList<int> outsidePoints)\n        {\n            var insidePoints = CommonResources.GetIntList();\n            //We're going to remove points from this list as we go to prune it down to the truly inner points.\n            insidePoints.AddRange(outsidePoints);\n            outsidePoints.Clear();\n\n            for (int i = 0; i < triangleIndices.Count && insidePoints.Count > 0; i += 3)\n            {\n                //Compute the triangle's plane in point-normal representation to test other points against.\n                Vector3 normal;\n                FindNormal(triangleIndices, points, i, out normal);\n                Vector3 p = points.Elements[triangleIndices.Elements[i]];\n\n                for (int j = insidePoints.Count - 1; j >= 0; --j)\n                {\n                    //Offset from the triangle to the current point, tested against the normal, determines if the current point is visible\n                    //from the triangle face.\n                    Vector3 offset;\n                    Vector3.Subtract(ref points.Elements[insidePoints.Elements[j]], ref p, out offset);\n                    float dot;\n                    Vector3.Dot(ref offset, ref normal, out dot);\n                    //If it's visible, then it's outside!\n                    if (dot > 0)\n                    {\n                        //This point is known to be on the outside; put it on the outside!\n                        outsidePoints.Add(insidePoints.Elements[j]);\n                        insidePoints.FastRemoveAt(j);\n                    }\n                }\n            }\n            CommonResources.GiveBack(insidePoints);\n        }\n\n\n        private static void FindNormal(RawList<int> indices, RawList<Vector3> points, int triangleIndex, out Vector3 normal)\n        {\n            var a = points.Elements[indices.Elements[triangleIndex]];\n            Vector3 ab, ac;\n            Vector3.Subtract(ref points.Elements[indices.Elements[triangleIndex + 1]], ref a, out ab);\n            Vector3.Subtract(ref points.Elements[indices.Elements[triangleIndex + 2]], ref a, out ac);\n            Vector3.Cross(ref ac, ref ab, out normal);\n        }\n\n        private static bool IsTriangleVisibleFromPoint(RawList<int> indices, RawList<Vector3> points, int triangleIndex, ref Vector3 point)\n        {\n            //Compute the normal of the triangle.\n            var a = points.Elements[indices.Elements[triangleIndex]];\n            Vector3 ab, ac;\n            Vector3.Subtract(ref points.Elements[indices.Elements[triangleIndex + 1]], ref a, out ab);\n            Vector3.Subtract(ref points.Elements[indices.Elements[triangleIndex + 2]], ref a, out ac);\n            Vector3 normal;\n            Vector3.Cross(ref ac, ref ab, out normal);\n            //Assume a consistent winding.  Check to see if the normal points at the point.\n            Vector3 offset;\n            Vector3.Subtract(ref point, ref a, out offset);\n            float dot;\n            Vector3.Dot(ref offset, ref normal, out dot);\n            return dot >= 0;\n        }\n\n        private static void VerifyWindings(RawList<int> newIndices, RawList<Vector3> points, ref Vector3 centroid)\n        {\n            //Go through every triangle.\n            for (int k = 0; k < newIndices.Count; k += 3)\n            {\n                //Check if the triangle faces away or towards the centroid.\n\n                if (IsTriangleVisibleFromPoint(newIndices, points, k, ref centroid))\n                {\n                    //If it's towards, flip the winding.\n                    int temp = newIndices[k + 1];\n                    newIndices[k + 1] = newIndices[k + 2];\n                    newIndices[k + 2] = temp;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/DataStructures/ConcurrentDeque.cs",
    "content": "﻿using System;\n\nnamespace BEPUutilities.DataStructures\n{\n    /// <summary>\n    /// Locked queue supporting dequeues from both ends.\n    /// </summary>\n    /// <typeparam name=\"T\">Type of contained elements.</typeparam>\n    public class ConcurrentDeque<T>\n    {\n        private readonly SpinLock locker = new SpinLock();\n        internal T[] array;\n\n        private int count;\n        internal int firstIndex;\n        internal int lastIndex = -1;\n\n        public ConcurrentDeque(int capacity)\n        {\n            array = new T[capacity];\n        }\n\n        public ConcurrentDeque()\n            : this(16)\n        {\n        }\n\n        /// <summary>\n        /// Number of elements in the deque.\n        /// </summary>\n        public int Count\n        {\n            get { return count; }\n        }\n\n        public override string ToString()\n        {\n            return \"Count: \" + count;\n        }\n\n        //TODO:  SPEED UP THESE ENQUEUES!\n\n        /// <summary>\n        /// Enqueues an element to the tail of the queue with locking.\n        /// </summary>\n        /// <param name=\"item\">Dequeued element, if any.</param>\n        /// <returns>True if an element could be dequeued, false otherwise.</returns>\n        public void Enqueue(T item)\n        {\n            //bool taken = false;\n            //locker.Enter(ref taken);\n            locker.Enter();\n            try\n            {\n                //Enqueues go to the tail only; it's like a queue.\n                //head ----> tail\n\n                if (count == array.Length)\n                {\n                    //Resize\n                    //TODO: Better shift-resize\n                    T[] oldArray = array;\n                    array = new T[Math.Max(4, oldArray.Length * 2)];\n                    //Copy the old first-end to the first part of the new array.\n                    Array.Copy(oldArray, firstIndex, array, 0, oldArray.Length - firstIndex);\n                    //Copy the old begin-first to the second part of the new array.\n                    Array.Copy(oldArray, 0, array, oldArray.Length - firstIndex, firstIndex);\n                    firstIndex = 0;\n                    lastIndex = count - 1;\n                }\n\n\n                lastIndex++;\n                if (lastIndex == array.Length)\n                    lastIndex = 0;\n                array[lastIndex] = item;\n                count++;\n            }\n            finally\n            {\n                locker.Exit();\n                //locker.Exit();\n            }\n        }\n\n        /// <summary>\n        /// Tries to dequeue the first element of the queue with locking.\n        /// </summary>\n        /// <param name=\"item\">Dequeued element, if any.</param>\n        /// <returns>True if an element could be dequeued, false otherwise.</returns>\n        public bool TryDequeueFirst(out T item)\n        {\n            //bool taken = false;\n            //locker.Enter(ref taken);\n            locker.Enter();\n\n            try\n            {\n                if (count > 0)\n                {\n                    item = array[firstIndex];\n                    array[firstIndex] = default(T);\n                    firstIndex++;\n                    if (firstIndex == array.Length)\n                        firstIndex = 0;\n                    count--;\n                    return true;\n                }\n                item = default(T);\n                return false;\n            }\n            finally\n            {\n                locker.Exit();\n                //locker.Exit();\n            }\n        }\n\n        /// <summary>\n        /// Tries to dequeue the last element of the queue with locking.\n        /// </summary>\n        /// <param name=\"item\">Dequeued element, if any.</param>\n        /// <returns>True if an element could be dequeued, false otherwise.</returns>\n        public bool TryDequeueLast(out T item)\n        {\n            //bool taken = false;\n            //locker.Enter(ref taken);\n            locker.Enter();\n\n            try\n            {\n                if (count > 0)\n                {\n                    item = array[lastIndex];\n                    array[lastIndex] = default(T);\n                    lastIndex--;\n                    if (lastIndex < 0)\n                        lastIndex += array.Length;\n                    count--;\n                    return true;\n                }\n                item = default(T);\n                return false;\n            }\n            finally\n            {\n                locker.Exit();\n                //locker.Exit();\n            }\n        }\n\n        /// <summary>\n        /// Tries to dequeue the first element of the queue without locking.\n        /// </summary>\n        /// <param name=\"item\">Dequeued element, if any.</param>\n        /// <returns>True if an element could be dequeued, false otherwise.</returns>\n        public bool TryUnsafeDequeueFirst(out T item)\n        {\n            if (count > 0)\n            {\n                item = array[firstIndex];\n                array[firstIndex] = default(T);\n                firstIndex++;\n                if (firstIndex == array.Length)\n                    firstIndex = 0;\n                count--;\n                return true;\n            }\n            item = default(T);\n            return false;\n        }\n\n        /// <summary>\n        /// Tries to dequeue the last element of the queue without locking.\n        /// </summary>\n        /// <param name=\"item\">Dequeued element, if any.</param>\n        /// <returns>True if an element could be dequeued, false otherwise.</returns>\n        public bool TryUnsafeDequeueLast(out T item)\n        {\n            if (count > 0)\n            {\n                item = array[lastIndex];\n                array[lastIndex] = default(T);\n                lastIndex--;\n                if (lastIndex < 0)\n                    lastIndex += array.Length;\n                count--;\n                return true;\n            }\n            item = default(T);\n            return false;\n        }\n\n        /// <summary>\n        /// Enqueues an element onto the tail of the deque without locking.\n        /// </summary>\n        /// <param name=\"item\">Element to enqueue.</param>\n        public void UnsafeEnqueue(T item)\n        {\n            //Enqueues go to the tail only; it's like a queue.\n            //head ----> tail\n\n            if (count == array.Length)\n            {\n                //TODO: if it's always powers of 2, then resizing is quicker.\n                //Resize\n                T[] oldArray = array;\n                array = new T[oldArray.Length * 2];\n                //Copy the old first-end to the first part of the new array.\n                Array.Copy(oldArray, firstIndex, array, 0, oldArray.Length - firstIndex);\n                //Copy the old begin-first to the second part of the new array.\n                Array.Copy(oldArray, 0, array, oldArray.Length - firstIndex, firstIndex);\n                firstIndex = 0;\n                lastIndex = count - 1;\n            }\n\n\n            lastIndex++;\n            if (lastIndex == array.Length)\n                lastIndex = 0;\n            array[lastIndex] = item;\n            count++;\n        }\n    }\n}"
  },
  {
    "path": "BEPUutilities/DataStructures/HashSet.cs",
    "content": "﻿#if !WINDOWS\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace BEPUutilities.DataStructures\n{\n    /// <summary>\n    /// Provides basic .NET 3.5 HashSet functionality on non-Windows platforms.\n    /// </summary>\n    public class HashSet<T> : IEnumerable<T>\n    {\n        //TODO: A proper implementation of a HashSet would be nice.\n\n        Dictionary<T, bool> fakeSet;\n\n        ///<summary>\n        /// Constructs a new HashSet.\n        ///</summary>\n        public HashSet()\n        {\n            fakeSet = new Dictionary<T, bool>();\n        }\n\n\n        IEnumerator<T> IEnumerable<T>.GetEnumerator()\n        {\n            return fakeSet.Keys.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return fakeSet.Keys.GetEnumerator();\n        }\n\n        Dictionary<T, bool>.KeyCollection.Enumerator GetEnumerator()\n        {\n            return fakeSet.Keys.GetEnumerator();\n        }\n\n        ///<summary>\n        /// Adds an element to the HashSet.\n        ///</summary>\n        ///<param name=\"item\">Item to add.</param>\n        ///<returns>Whether or not the item could be added.</returns>\n        public bool Add(T item)\n        {\n            if (fakeSet.ContainsKey(item))\n                return false;\n\n            fakeSet.Add(item, false);\n            return true;\n        }\n\n        ///<summary>\n        /// Removes an element from the HashSet.\n        ///</summary>\n        ///<param name=\"item\">Item to remove.</param>\n        ///<returns>Whether or not the item could be removed.</returns>\n        public bool Remove(T item)\n        {\n            return fakeSet.Remove(item);\n        }\n\n        ///<summary>\n        /// Clears the HashSet.\n        ///</summary>\n        public void Clear()\n        {\n            fakeSet.Clear();\n        }\n\n        /// <summary>\n        /// Determines if the set contains the item.\n        /// </summary>\n        /// <param name=\"item\">Item to check for containment.</param>\n        /// <returns>Whether or not the item was contained in the set.</returns>\n        public bool Contains(T item)\n        {\n            return fakeSet.ContainsKey(item);\n        }\n    }\n}\n#endif"
  },
  {
    "path": "BEPUutilities/DataStructures/ObservableDictionary.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace BEPUutilities.DataStructures\n{\n    ///<summary>\n    /// Dictionary that provides events when the inner dictionary is changed.\n    ///</summary>\n    ///<typeparam name=\"TKey\">Type of the keys in the dictionary.</typeparam>\n    ///<typeparam name=\"TValue\">Type of the values in the dictionary.</typeparam>\n    public class ObservableDictionary<TKey, TValue>\n    {\n        ///<summary>\n        /// Gets or sets the dictionary wrapped by the observable dictionary.\n        /// While the inner dictionary can be changed, making modifications to it will\n        /// not trigger any changed events.\n        ///</summary>\n        public Dictionary<TKey, TValue> WrappedDictionary { get; private set; }\n\n        /// <summary>\n        /// Constructs a new observable dictionary.\n        /// </summary>\n        public ObservableDictionary()\n        {\n            WrappedDictionary = new Dictionary<TKey, TValue>();\n        }\n\n        ///<summary>\n        /// Adds a pair to the dictionary.\n        ///</summary>\n        ///<param name=\"key\">Key of the element.</param>\n        ///<param name=\"value\">Value of the element.</param>\n        public void Add(TKey key, TValue value)\n        {\n            WrappedDictionary.Add(key, value);\n            OnChanged();\n        }\n\n        ///<summary>\n        /// Removes a key and its associated value from the dictionary, if present.\n        ///</summary>\n        ///<param name=\"key\">Key of the element to remove.</param>\n        ///<returns>Whether or not the object was found.</returns>\n        public bool Remove(TKey key)\n        {\n            if (WrappedDictionary.Remove(key))\n            {\n                OnChanged();\n                return true;\n            }\n            return false;\n        }\n\n        ///<summary>\n        /// Clears the dictionary of all elements.\n        ///</summary>\n        public void Clear()\n        {\n            WrappedDictionary.Clear();\n            OnChanged();\n        }\n\n        ///<summary>\n        /// Fires when the dictionary's elements are changed using the wrapping functions.\n        ///</summary>\n        public event Action Changed;\n\n        protected void OnChanged()\n        {\n            if (Changed != null)\n            {\n                Changed();\n            }\n        }\n\n        \n    }\n}\n"
  },
  {
    "path": "BEPUutilities/DataStructures/ObservableList.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections;\n\nnamespace BEPUutilities.DataStructures\n{\n    ///<summary>\n    /// List of objects which fires events when it is changed.\n    ///</summary>\n    ///<typeparam name=\"T\">Type of elements in the list.</typeparam>\n    public class ObservableList<T> : IList<T>\n    {\n        /// <summary>\n        /// Gets the list wrapped by the observable list. Adds and removes made to this list directly will not trigger events.\n        /// </summary>\n        public RawList<T> WrappedList { get; private set; }\n\n        ///<summary>\n        /// Fires when elements in the list are changed.\n        ///</summary>\n        public event Action<ObservableList<T>> Changed;\n\n        ///<summary>\n        /// Constructs a new observable list.\n        ///</summary>\n        ///<param name=\"list\">List to copy into the internal wrapped list.</param>\n        public ObservableList(IList<T> list)\n        {\n            this.WrappedList = new RawList<T>(list.Count);\n            list.CopyTo(this.WrappedList.Elements, 0);\n        }\n\n        ///<summary>\n        /// Constructs an empty observable list.\n        ///</summary>\n        public ObservableList()\n        {\n            WrappedList = new RawList<T>();\n        }\n\n        ///<summary>\n        /// Constructs an empty observable list with a given capacity.\n        ///</summary>\n        ///<param name=\"initialCapacity\">Initial allocated storage in the list.</param>\n        public ObservableList(int initialCapacity)\n        {\n            WrappedList = new RawList<T>(initialCapacity);\n        }\n\n        protected void OnChanged()\n        {\n            if (Changed != null)\n                Changed(this);\n        }\n\n\n        /// <summary>\n        /// Determines the index of a specific item in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.\n        /// </summary>\n        /// <returns>\n        /// The index of <paramref name=\"item\"/> if found in the list; otherwise, -1.\n        /// </returns>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</param>\n        public int IndexOf(T item)\n        {\n            return WrappedList.IndexOf(item);\n        }\n\n        /// <summary>\n        /// Inserts an item to the <see cref=\"T:System.Collections.Generic.IList`1\"/> at the specified index.\n        /// </summary>\n        /// <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param><param name=\"item\">The object to insert into the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</param><exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"index\"/> is not a valid index in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</exception><exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.IList`1\"/> is read-only.</exception>\n        public void Insert(int index, T item)\n        {\n            WrappedList.Insert(index, item);\n        }\n\n        /// <summary>\n        /// Removes the <see cref=\"T:System.Collections.Generic.IList`1\"/> item at the specified index.\n        /// </summary>\n        /// <param name=\"index\">The zero-based index of the item to remove.</param><exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"index\"/> is not a valid index in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</exception><exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.IList`1\"/> is read-only.</exception>\n        public void RemoveAt(int index)\n        {\n            WrappedList.RemoveAt(index);\n        }\n\n        /// <summary>\n        /// Gets or sets the element at the specified index.\n        /// </summary>\n        /// <returns>\n        /// The element at the specified index.\n        /// </returns>\n        /// <param name=\"index\">The zero-based index of the element to get or set.</param><exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"index\"/> is not a valid index in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</exception><exception cref=\"T:System.NotSupportedException\">The property is set and the <see cref=\"T:System.Collections.Generic.IList`1\"/> is read-only.</exception>\n        public T this[int index]\n        {\n            get\n            {\n                return WrappedList[index];\n            }\n            set\n            {\n                WrappedList[index] = value;\n                OnChanged();\n            }\n        }\n\n        /// <summary>\n        /// Adds an item to the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <param name=\"item\">The object to add to the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param><exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is read-only.</exception>\n        public void Add(T item)\n        {\n            WrappedList.Add(item);\n            OnChanged();\n        }\n\n        /// <summary>\n        /// Removes all items from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is read-only. </exception>\n        public void Clear()\n        {\n            WrappedList.Clear();\n            OnChanged();\n        }\n\n        /// <summary>\n        /// Determines whether the <see cref=\"T:System.Collections.Generic.ICollection`1\"/> contains a specific value.\n        /// </summary>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> is found in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>; otherwise, false.\n        /// </returns>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param>\n        public bool Contains(T item)\n        {\n            return WrappedList.Contains(item);\n        }\n\n        /// <summary>\n        /// Copies the elements of the <see cref=\"T:System.Collections.Generic.ICollection`1\"/> to an <see cref=\"T:System.Array\"/>, starting at a particular <see cref=\"T:System.Array\"/> index.\n        /// </summary>\n        /// <param name=\"array\">The one-dimensional <see cref=\"T:System.Array\"/> that is the destination of the elements copied from <see cref=\"T:System.Collections.Generic.ICollection`1\"/>. The <see cref=\"T:System.Array\"/> must have zero-based indexing.</param><param name=\"arrayIndex\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param><exception cref=\"T:System.ArgumentNullException\"><paramref name=\"array\"/> is null.</exception><exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"arrayIndex\"/> is less than 0.</exception><exception cref=\"T:System.ArgumentException\"><paramref name=\"array\"/> is multidimensional.-or-The number of elements in the source <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is greater than the available space from <paramref name=\"arrayIndex\"/> to the end of the destination <paramref name=\"array\"/>.-or-Type cannot be cast automatically to the type of the destination <paramref name=\"array\"/>.</exception>\n        public void CopyTo(T[] array, int arrayIndex)\n        {\n            Array.Copy(WrappedList.Elements, 0, array, 0, WrappedList.Count);\n        }\n\n        /// <summary>\n        /// Gets the number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <returns>\n        /// The number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </returns>\n        public int Count\n        {\n            get { return WrappedList.Count; }\n        }\n\n        bool ICollection<T>.IsReadOnly\n        {\n            get { return (WrappedList as ICollection<T>).IsReadOnly; }\n        }\n\n        /// <summary>\n        /// Removes the first occurrence of a specific object from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> was successfully removed from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>; otherwise, false. This method also returns false if <paramref name=\"item\"/> is not found in the original <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </returns>\n        /// <param name=\"item\">The object to remove from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param><exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is read-only.</exception>\n        public bool Remove(T item)\n        {\n            if (WrappedList.Remove(item))\n            {\n                OnChanged();\n                return true;\n            }\n            return false;\n        }\n\n        ///<summary>\n        /// Gets an enumerator for the list.\n        ///</summary>\n        ///<returns>Enumerator for the list.</returns>\n        public RawList<T>.Enumerator GetEnumerator()\n        {\n            return WrappedList.GetEnumerator();\n        }\n\n        IEnumerator<T> IEnumerable<T>.GetEnumerator()\n        {\n            return WrappedList.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return WrappedList.GetEnumerator();\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/DataStructures/RawList.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace BEPUutilities.DataStructures\n{\n    ///<summary>\n    /// No-frills list that wraps an accessible array.\n    ///</summary>\n    ///<typeparam name=\"T\">Type of elements contained by the list.</typeparam>\n    public class RawList<T> : IList<T>\n    {\n        ///<summary>\n        /// Direct access to the elements owned by the raw list.\n        /// Be careful about the operations performed on this list;\n        /// use the normal access methods if in doubt.\n        ///</summary>\n        public T[] Elements;\n\n        /// <summary>\n        /// Gets the number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// Can also be set; setting the count is a direct change to the count integer and does not change the state of the array.\n        /// </summary>\n        /// <returns>\n        /// The number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </returns>\n        public int Count { get; set; }\n\n        ///<summary>\n        /// Constructs an empty list.\n        ///</summary>\n        public RawList()\n        {\n            Elements = new T[4];\n        }\n        ///<summary>\n        /// Constructs an empty list.\n        ///</summary>\n        ///<param name=\"initialCapacity\">Initial capacity to allocate for the list.</param>\n        ///<exception cref=\"ArgumentException\">Thrown when the initial capacity is zero or negative.</exception>\n        public RawList(int initialCapacity)\n        {\n            if (initialCapacity <= 0)\n                throw new ArgumentException(\"Initial capacity must be positive.\");\n            Elements = new T[initialCapacity];\n        }\n\n        ///<summary>\n        /// Constructs a raw list from another list.\n        ///</summary>\n        ///<param name=\"elements\">List to copy.</param>\n        public RawList(IList<T> elements)\n            : this(Math.Max(elements.Count, 4))\n        {\n            elements.CopyTo(Elements, 0);\n            Count = elements.Count;\n        }\n\n        /// <summary>\n        /// Removes an element from the list.\n        /// </summary>\n        /// <param name=\"index\">Index of the element to remove.</param>\n        public void RemoveAt(int index)\n        {\n            if (index >= Count)\n            {\n                throw new ArgumentOutOfRangeException(\"index\");\n            }\n            Count--;\n            if (index < Count)\n                Array.Copy(Elements, index + 1, Elements, index, Count - index);\n\n            Elements[Count] = default(T);\n        }\n\n        /// <summary>\n        /// Removes an element from the list without maintaining order.\n        /// </summary>\n        /// <param name=\"index\">Index of the element to remove.</param>\n        public void FastRemoveAt(int index)\n        {\n            if (index >= Count)\n            {\n                throw new ArgumentOutOfRangeException(\"index\");\n            }\n            Count--;\n            if (index < Count)\n            {\n                Elements[index] = Elements[Count];\n            }\n            Elements[Count] = default(T);\n\n        }\n\n        ///<summary>\n        /// Gets or sets the current size allocated for the list.\n        ///</summary>\n        public int Capacity\n        {\n            get\n            {\n                return Elements.Length;\n            }\n            set\n            {\n                T[] newArray = new T[value];\n                Array.Copy(Elements, newArray, Count);\n                Elements = newArray;\n            }\n        }\n\n        /// <summary>\n        /// Adds an item to the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <param name=\"item\">The object to add to the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param><exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is read-only.</exception>\n        public void Add(T item)\n        {\n            if (Count == Elements.Length)\n            {\n                Capacity = Elements.Length * 2;\n            }\n            Elements[Count++] = item;\n\n        }\n\n        ///<summary>\n        /// Adds a range of elements to the list from another list.\n        ///</summary>\n        ///<param name=\"items\">Elements to add.</param>\n        public void AddRange(RawList<T> items)\n        {\n            int neededLength = Count + items.Count;\n            if (neededLength > Elements.Length)\n            {\n                int newLength = Elements.Length * 2;\n                if (newLength < neededLength)\n                    newLength = neededLength;\n                Capacity = newLength;\n            }\n            Array.Copy(items.Elements, 0, Elements, Count, items.Count);\n            Count = neededLength;\n\n        }\n\n        ///<summary>\n        /// Adds a range of elements to the list from another list.\n        ///</summary>\n        ///<param name=\"items\">Elements to add.</param>\n        public void AddRange(List<T> items)\n        {\n            int neededLength = Count + items.Count;\n            if (neededLength > Elements.Length)\n            {\n                int newLength = Elements.Length * 2;\n                if (newLength < neededLength)\n                    newLength = neededLength;\n                Capacity = newLength;\n            }\n            items.CopyTo(0, Elements, Count, items.Count);\n            Count = neededLength;\n\n        }\n\n        ///<summary>\n        /// Adds a range of elements to the list from another list.\n        ///</summary>\n        ///<param name=\"items\">Elements to add.</param>\n        public void AddRange(IList<T> items)\n        {\n            int neededLength = Count + items.Count;\n            if (neededLength > Elements.Length)\n            {\n                int newLength = Elements.Length * 2;\n                if (newLength < neededLength)\n                    newLength = neededLength;\n                Capacity = newLength;\n            }\n            items.CopyTo(Elements, 0);\n            Count = neededLength;\n\n        }\n\n        /// <summary>\n        /// Removes all items from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is read-only. </exception>\n        public void Clear()\n        {\n            Array.Clear(Elements, 0, Count);\n            Count = 0;\n        }\n\n        /// <summary>\n        /// Removes the first occurrence of a specific object from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> was successfully removed from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>; otherwise, false. This method also returns false if <paramref name=\"item\"/> is not found in the original <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </returns>\n        /// <param name=\"item\">The object to remove from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param><exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is read-only.</exception>\n        public bool Remove(T item)\n        {\n            int index = IndexOf(item);\n            if (index == -1)\n                return false;\n            RemoveAt(index);\n            return true;\n        }\n\n        /// <summary>\n        /// Removes the first occurrence of a specific object from the collection without maintaining element order.\n        /// </summary>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> was successfully removed from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>; otherwise, false. This method also returns false if <paramref name=\"item\"/> is not found in the original <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </returns>\n        /// <param name=\"item\">The object to remove from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param><exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is read-only.</exception>\n        public bool FastRemove(T item)\n        {\n            int index = IndexOf(item);\n            if (index == -1)\n                return false;\n            FastRemoveAt(index);\n            return true;\n        }\n\n        /// <summary>\n        /// Determines the index of a specific item in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.\n        /// </summary>\n        /// <returns>\n        /// The index of <paramref name=\"item\"/> if found in the list; otherwise, -1.\n        /// </returns>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</param>\n        public int IndexOf(T item)\n        {\n            return Array.IndexOf(Elements, item, 0, Count);\n        }\n\n        /// <summary>\n        /// Copies the elements from the list into an array.\n        /// </summary>\n        /// <returns>An array containing the elements in the list.</returns>\n        public T[] ToArray()\n        {\n            var toReturn = new T[Count];\n            Array.Copy(Elements, toReturn, Count);\n            return toReturn;\n        }\n\n\n        #region IList<T> Members\n\n\n        /// <summary>\n        /// Inserts the element at the specified index.\n        /// </summary>\n        /// <param name=\"index\">Index to insert the item.</param>\n        /// <param name=\"item\">Element to insert.</param>\n        public void Insert(int index, T item)\n        {\n            if (index < Count)\n            {\n                if (Count == Elements.Length)\n                {\n                    Capacity = Elements.Length * 2;\n                }\n\n                Array.Copy(Elements, index, Elements, index + 1, Count - index);\n                Elements[index] = item;\n                Count++;\n            }\n            else\n                Add(item);\n        }\n        /// <summary>\n        /// Inserts the element at the specified index without maintaining list order.\n        /// </summary>\n        /// <param name=\"index\">Index to insert the item.</param>\n        /// <param name=\"item\">Element to insert.</param>\n        public void FastInsert(int index, T item)\n        {\n            if (index < Count)\n            {\n                if (Count == Elements.Length)\n                {\n                    Capacity = Elements.Length * 2;\n                }\n\n                Array.Copy(Elements, index, Elements, index + 1, Count - index);\n                Elements[Count] = Elements[index];\n                Elements[index] = item;\n                Count++;\n            }\n            else\n                Add(item);\n        }\n\n        /// <summary>\n        /// Gets or sets the element of the list at the given index.\n        /// </summary>\n        /// <param name=\"index\">Index in the list.</param>\n        /// <returns>Element at the given index.</returns>\n        public T this[int index]\n        {\n            get\n            {\n                if (index < Count && index >= 0)\n                    return Elements[index];\n                else\n                    throw new IndexOutOfRangeException(\"Index is outside of the list's bounds.\");\n            }\n            set\n            {\n                if (index < Count && index >= 0)\n                    Elements[index] = value;\n                else\n                    throw new IndexOutOfRangeException(\"Index is outside of the list's bounds.\");\n            }\n        }\n\n        #endregion\n\n        #region ICollection<T> Members\n\n        /// <summary>\n        /// Determines if an item is present in the list.\n        /// </summary>\n        /// <param name=\"item\">Item to be tested.</param>\n        /// <returns>Whether or not the item was contained by the list.</returns>\n        public bool Contains(T item)\n        {\n            return IndexOf(item) != -1;\n        }\n\n        /// <summary>\n        /// Copies the list's contents to the array.\n        /// </summary>\n        /// <param name=\"array\">Array to receive the list's contents.</param>\n        /// <param name=\"arrayIndex\">Index in the array to start the dump.</param>\n        public void CopyTo(T[] array, int arrayIndex)\n        {\n            Array.Copy(Elements, 0, array, arrayIndex, Count);\n        }\n\n\n        bool ICollection<T>.IsReadOnly\n        {\n            get { return false; }\n        }\n\n        #endregion\n\n        #region IEnumerable<T> Members\n\n        ///<summary>\n        /// Gets an enumerator for the list.\n        ///</summary>\n        ///<returns>Enumerator for the list.</returns>\n        public Enumerator GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        IEnumerator<T> IEnumerable<T>.GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        #endregion\n\n        #region IEnumerable Members\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return new Enumerator(this);\n        }\n\n        #endregion\n\n\n\n        ///<summary>\n        /// Sorts the list.\n        ///</summary>\n        ///<param name=\"comparer\">Comparer to use to sort the list.</param>\n        public void Sort(IComparer<T> comparer)\n        {\n            Array.Sort(Elements, 0, Count, comparer);\n        }\n\n\n        ///<summary>\n        /// Enumerator for the RawList.\n        ///</summary>\n        public struct Enumerator : IEnumerator<T>\n        {\n            RawList<T> list;\n            int index;\n            ///<summary>\n            /// Constructs a new enumerator.\n            ///</summary>\n            ///<param name=\"list\"></param>\n            public Enumerator(RawList<T> list)\n            {\n                index = -1;\n                this.list = list;\n            }\n            public T Current\n            {\n                get { return list.Elements[index]; }\n            }\n\n            public void Dispose()\n            {\n            }\n\n            object System.Collections.IEnumerator.Current\n            {\n                get { return list.Elements[index]; }\n            }\n\n            public bool MoveNext()\n            {\n                return ++index < list.Count;\n            }\n\n            public void Reset()\n            {\n                index = -1;\n            }\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/DataStructures/RawValueList.cs",
    "content": "﻿using System;\n\nnamespace BEPUutilities.DataStructures\n{\n    //THIS SHOULD ONLY BE USED ON VALUE TYPES WHICH HAVE NO REFERENCES TO HEAP OBJECTS.\n    ///<summary>\n    /// No-frills list used for value types that contain no reference types.\n    ///</summary>\n    ///<typeparam name=\"T\">Type of the elements in the list.</typeparam>\n    public class RawValueList<T> where T : struct\n    {\n        ///<summary>\n        /// Directly accessible array of elements in the list.\n        /// Be careful about which operations are applied to the array;\n        /// if in doubt, use the regular access methods.\n        ///</summary>\n        public T[] Elements;\n\n        /// <summary>\n        /// Gets the number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// Can also be set; setting the count is a direct change to the count integer and does not change the state of the array.\n        /// </summary>\n        /// <returns>\n        /// The number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </returns>\n        public int Count { get; set; }\n\n        ///<summary>\n        /// Constructs an empty list.\n        ///</summary>\n        public RawValueList()\n        {\n            Elements = new T[4];\n        }\n        ///<summary>\n        /// Constructs an empty list.\n        ///</summary>\n        ///<param name=\"initialCapacity\">Initial capacity of the list.</param>\n        ///<exception cref=\"ArgumentException\">Thrown when the initial capcity is less than or equal to zero.</exception>\n        public RawValueList(int initialCapacity)\n        {\n            if (initialCapacity <= 0)\n                throw new ArgumentException(\"Initial capacity must be positive.\");\n            Elements = new T[initialCapacity];\n        }\n\n\n        ///<summary>\n        /// Removes an element from the list.\n        ///</summary>\n        ///<param name=\"index\">Index of the element to remove.</param>\n        ///<exception cref=\"ArgumentOutOfRangeException\">Thrown when the index is not present in the list.</exception>\n        public void RemoveAt(int index)\n        {\n            if (index >= Count)\n            {\n                throw new ArgumentOutOfRangeException(\"index\");\n            }\n            Count--;\n            if (index < Count)\n            {\n                Elements[index] = Elements[Count];\n            }\n\n        }\n\n        ///<summary>\n        /// Gets or sets the current size allocated for the list.\n        ///</summary>\n        public int Capacity\n        {\n            get\n            {\n                return Elements.Length;\n            }\n            set\n            {\n                T[] newArray = new T[value];\n                Array.Copy(Elements, newArray, Count);\n                Elements = newArray;\n            }\n        }\n\n        ///<summary>\n        /// Adds an element to the list.\n        ///</summary>\n        ///<param name=\"item\">Item to add.</param>\n        public void Add(ref T item)\n        {\n            if (Count == Elements.Length)\n            {\n                Capacity = Elements.Length * 2;\n            }\n            Elements[Count++] = item;\n\n        }\n\n        ///<summary>\n        /// Clears the list of all elements.\n        ///</summary>\n        public void Clear()\n        {\n            Count = 0;\n        }\n\n        ///<summary>\n        /// Removes an element from the list.\n        ///</summary>\n        ///<param name=\"item\">Item to remove.</param>\n        ///<returns>Whether or not the item was present in the list.</returns>\n        public bool Remove(ref T item)\n        {\n            int index = IndexOf(ref item);\n            if (index == -1)\n                return false;\n            RemoveAt(index);\n            return true;\n        }\n\n        ///<summary>\n        /// Gets the index of an element in the list.\n        ///</summary>\n        ///<param name=\"item\">Item to search for.</param>\n        ///<returns>Index of the searched element.</returns>\n        public int IndexOf(ref T item)\n        {\n            return Array.IndexOf(Elements, item);\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/DataStructures/ReadOnlyDictionary.cs",
    "content": "﻿using System.Collections;\nusing System.Collections.Generic;\n\nnamespace BEPUutilities.DataStructures\n{\n    //TODO: This could be handled better.\n\n    ///<summary>\n    /// Wraps a dictionary in a read only collection.\n    ///</summary>\n    ///<typeparam name=\"TKey\">Type of keys in the dictionary.</typeparam>\n    ///<typeparam name=\"TValue\">Type of values in the dictionary.</typeparam>\n    public struct ReadOnlyDictionary<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>\n    {\n        private readonly IDictionary<TKey, TValue> dictionary;\n\n        /// <summary>\n        /// Constructs a new read-only wrapper dictionary.\n        /// </summary>\n        /// <param name=\"dictionary\">Internal dictionary to use.</param>\n        public ReadOnlyDictionary(IDictionary<TKey, TValue> dictionary)\n        {\n            this.dictionary = dictionary;\n        }\n\n        /// <summary>\n        /// Gets the number of elements in the dictionary.\n        /// </summary>\n        public int Count\n        {\n            get { return dictionary.Count; }\n        }\n\n        /// <summary>\n        /// Gets whether or not this dictionary is read-only.\n        /// </summary>\n        public bool IsReadOnly\n        {\n            get { return true; }\n        }\n\n        /// <summary>\n        /// Gets the value associated with the key in the dictionary.\n        /// </summary>\n        /// <param name=\"key\">Key to look for in the dictionary.</param>\n        /// <returns>Value associated with the key.</returns>\n        public TValue this[TKey key]\n        {\n            get { return dictionary[key]; }\n        }\n\n        /// <summary>\n        /// Gets an enumerable set of keys in the dictionary.\n        /// </summary>\n        public IEnumerable<TKey> Keys\n        {\n            get { return new ReadOnlyEnumerable<TKey>(dictionary.Keys); }\n        }\n\n        /// <summary>\n        /// Gets an enumerable set of values in the dictionary.\n        /// </summary>\n        public IEnumerable<TValue> Values\n        {\n            get { return new ReadOnlyEnumerable<TValue>(dictionary.Values); }\n        }\n\n        #region IEnumerable<KeyValuePair<TKey,TValue>> Members\n\n        /// <summary>\n        /// Gets an enumerator for key-value pairs in the dictionary.\n        /// </summary>\n        /// <returns>Enumerator for the dictionary.</returns>\n        IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()\n        {\n            return dictionary.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Gets an enumerator for key-value pairs in the dictionary.\n        /// </summary>\n        /// <returns>Enumerator for the dictionary.</returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return dictionary.GetEnumerator();\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Determines if the dictionary contains a key-value pair.\n        /// </summary>\n        /// <param name=\"item\">Key-value pair to look for.</param>\n        /// <returns>Whether or not the key-value pair is present.</returns>\n        public bool Contains(KeyValuePair<TKey, TValue> item)\n        {\n            return dictionary.Contains(item);\n        }\n\n        /// <summary>\n        /// Determines if the dictionary contains a given key.\n        /// </summary>\n        /// <param name=\"key\">Key to check for.</param>\n        /// <returns>Whether or not the key is contained.</returns>\n        public bool ContainsKey(TKey key)\n        {\n            return dictionary.ContainsKey(key);\n        }\n\n        /// <summary>\n        /// Copies the key-value pairs of the dictionary into an array.\n        /// </summary>\n        /// <param name=\"array\">Target array.</param>\n        /// <param name=\"arrayIndex\">The zero-based index at which copying begins.</param>\n        public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)\n        {\n            dictionary.CopyTo(array, arrayIndex);\n        }\n\n        /// <summary>\n        /// Tries to retrieve a value from the dictionary using a key.\n        /// </summary>\n        /// <param name=\"key\">Key to look for.</param>\n        /// <param name=\"value\">Value associated with the key.</param>\n        /// <returns>Whether or not the key exists.</returns>\n        public bool TryGetValue(TKey key, out TValue value)\n        {\n            return dictionary.TryGetValue(key, out value);\n        }\n    }\n}"
  },
  {
    "path": "BEPUutilities/DataStructures/ReadOnlyEnumerable.cs",
    "content": "﻿using System.Collections;\nusing System.Collections.Generic;\n\nnamespace BEPUutilities.DataStructures\n{\n    ///<summary>\n    /// WRaps an enumerable in a temporary enumeration struct.\n    ///</summary>\n    ///<typeparam name=\"T\">Type of the enumerable being iterated.</typeparam>\n    public struct ReadOnlyEnumerable<T> : IEnumerable<T>\n    {\n        private readonly IEnumerable<T> enumerable;\n\n        ///<summary>\n        /// Constructs a new read only enumerable.\n        ///</summary>\n        ///<param name=\"enumerable\">Enumerable to wrap.</param>\n        public ReadOnlyEnumerable(IEnumerable<T> enumerable)\n        {\n            this.enumerable = enumerable;\n        }\n\n        #region IEnumerable<T> Members\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n        /// </returns>\n        /// <filterpriority>1</filterpriority>\n        public IEnumerator<T> GetEnumerator()\n        {\n            return enumerable.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return enumerable.GetEnumerator();\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "BEPUutilities/DataStructures/ReadOnlyList.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace BEPUutilities.DataStructures\n{\n    /// <summary>\n    /// Wraps a list in an enumerable struct.\n    /// </summary>\n    /// <typeparam name=\"T\">Type contained by the list.</typeparam>\n    public struct ReadOnlyList<T> : IList<T>\n    {\n        IList<T> wrappedList;\n\n        /// <summary>\n        /// Constructs a new read-only list.\n        /// </summary>\n        /// <param name=\"wrappedList\">List wrapped by the read-only list.</param>\n        public ReadOnlyList(IList<T> wrappedList)\n        {\n            this.wrappedList = wrappedList;\n        }\n\n\n        /// <summary>\n        /// Determines the index of a specific item in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.\n        /// </summary>\n        /// <returns>\n        /// The index of <paramref name=\"item\"/> if found in the list; otherwise, -1.\n        /// </returns>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</param>\n        public int IndexOf(T item)\n        {\n            return wrappedList.IndexOf(item);\n        }\n\n        void IList<T>.Insert(int index, T item)\n        {\n            throw new NotSupportedException(\"The list is read-only.\");\n        }\n\n        void IList<T>.RemoveAt(int index)\n        {\n            throw new NotSupportedException(\"The list is read-only.\");\n        }\n\n        /// <summary>\n        /// Gets the element at the specified index.\n        /// </summary>\n        /// <returns>\n        /// The element at the specified index.\n        /// </returns>\n        /// <param name=\"index\">The zero-based index of the element to get.</param><exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"index\"/> is not a valid index in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</exception><exception cref=\"T:System.NotSupportedException\">The property is set and the <see cref=\"T:System.Collections.Generic.IList`1\"/> is read-only.</exception>\n        public T this[int index]\n        {\n            get { return wrappedList[index]; }\n            set\n            {\n                throw new NotSupportedException(\"The list is read-only.\");\n            }\n        }\n\n        void ICollection<T>.Add(T item)\n        {\n            throw new NotSupportedException(\"The list is read-only.\");\n        }\n\n        void ICollection<T>.Clear()\n        {\n            throw new NotSupportedException(\"The list is read-only.\");\n        }\n\n        /// <summary>\n        /// Determines whether the <see cref=\"T:System.Collections.Generic.ICollection`1\"/> contains a specific value.\n        /// </summary>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> is found in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>; otherwise, false.\n        /// </returns>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param>\n        public bool Contains(T item)\n        {\n            return wrappedList.Contains(item);\n        }\n\n        /// <summary>\n        /// Copies the elements of the <see cref=\"T:System.Collections.Generic.ICollection`1\"/> to an <see cref=\"T:System.Array\"/>, starting at a particular <see cref=\"T:System.Array\"/> index.\n        /// </summary>\n        /// <param name=\"array\">The one-dimensional <see cref=\"T:System.Array\"/> that is the destination of the elements copied from <see cref=\"T:System.Collections.Generic.ICollection`1\"/>. The <see cref=\"T:System.Array\"/> must have zero-based indexing.</param><param name=\"arrayIndex\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param><exception cref=\"T:System.ArgumentNullException\"><paramref name=\"array\"/> is null.</exception><exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"arrayIndex\"/> is less than 0.</exception><exception cref=\"T:System.ArgumentException\"><paramref name=\"array\"/> is multidimensional.-or-The number of elements in the source <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is greater than the available space from <paramref name=\"arrayIndex\"/> to the end of the destination <paramref name=\"array\"/>.-or-Type <paramref name=\"T\"/> cannot be cast automatically to the type of the destination <paramref name=\"array\"/>.</exception>\n        public void CopyTo(T[] array, int arrayIndex)\n        {\n            wrappedList.CopyTo(array, arrayIndex);\n        }\n\n        /// <summary>\n        /// Gets the number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <returns>\n        /// The number of elements contained in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </returns>\n        public int Count\n        {\n            get { return wrappedList.Count; }\n        }\n\n        bool ICollection<T>.IsReadOnly\n        {\n            get { return true; }\n        }\n\n        bool ICollection<T>.Remove(T item)\n        {\n            throw new NotSupportedException(\"The list is read-only.\");\n        }\n\n        public Enumerator GetEnumerator()\n        {\n            return new Enumerator(wrappedList);\n        }\n\n        IEnumerator<T> IEnumerable<T>.GetEnumerator()\n        {\n            return wrappedList.GetEnumerator();\n        }\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return wrappedList.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Enumerates the read only list.\n        /// </summary>\n        public struct Enumerator : IEnumerator<T>\n        {\n            private IList<T> wrappedList;\n            int index;\n            ///<summary>\n            /// Constructs an enumerator.\n            ///</summary>\n            ///<param name=\"wrappedList\">Collection to which the enumerator belongs.</param>\n            public Enumerator(IList<T> wrappedList)\n            {\n                this.wrappedList = wrappedList;\n                index = -1;\n            }\n\n            /// <summary>\n            /// Gets the element in the collection at the current position of the enumerator.\n            /// </summary>\n            /// <returns>\n            /// The element in the collection at the current position of the enumerator.\n            /// </returns>\n            public T Current\n            {\n                get { return wrappedList[index]; }\n            }\n\n            /// <summary>\n            /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n            /// </summary>\n            /// <filterpriority>2</filterpriority>\n            public void Dispose()\n            {\n            }\n\n            object System.Collections.IEnumerator.Current\n            {\n                get { return Current; }\n            }\n\n            /// <summary>\n            /// Advances the enumerator to the next element of the collection.\n            /// </summary>\n            /// <returns>\n            /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.\n            /// </returns>\n            /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n            public bool MoveNext()\n            {\n                return ++index < wrappedList.Count;\n            }\n\n            /// <summary>\n            /// Sets the enumerator to its initial position, which is before the first element in the collection.\n            /// </summary>\n            /// <exception cref=\"T:System.InvalidOperationException\">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority>\n            public void Reset()\n            {\n                index = -1;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/DataStructures/TinyList.cs",
    "content": "﻿using System;\n\nnamespace BEPUutilities.DataStructures\n{\n    /// <summary>\n    /// Special datatype used for heapless lists without unsafe/stackalloc.\n    /// Designed for object types or reference-sized structs (int, float...).\n    /// Stores a maximum of 8 entries.\n    /// </summary>\n    /// <typeparam name=\"T\">Struct type to use.</typeparam>\n    public struct TinyList<T> where T : IEquatable<T>\n    {\n        private T entry1;\n        private T entry2;\n        private T entry3;\n        private T entry4;\n\n        private T entry5;\n        private T entry6;\n        private T entry7;\n        private T entry8;\n\n        internal int count;\n\n        /// <summary>\n        /// Gets the current number of elements in the list.\n        /// </summary>\n        public int Count\n        {\n            get { return count; }\n        }\n\n        /// <summary>\n        /// Gets the item at the specified index.\n        /// </summary>\n        /// <param name=\"index\">Index to retrieve.</param>\n        /// <returns>Retrieved item.</returns>\n        public T this[int index]\n        {\n            get\n            {\n                //Get\n                if (index > count - 1 || index < 0)\n                {\n                    return default(T);\n                }\n                switch (index)\n                {\n                    case 0:\n                        return entry1;\n                    case 1:\n                        return entry2;\n                    case 2:\n                        return entry3;\n                    case 3:\n                        return entry4;\n                    case 4:\n                        return entry5;\n                    case 5:\n                        return entry6;\n                    case 6:\n                        return entry7;\n                    case 7:\n                        return entry8;\n                    default:\n                        //Curious!\n                        return default(T);\n                }\n            }\n            set\n            {\n                //Replace\n                if (index > count - 1 || index < 0)\n                {\n                    return;\n                }\n                switch (index)\n                {\n                    case 0:\n                        entry1 = value;\n                        break;\n                    case 1:\n                        entry2 = value;\n                        break;\n                    case 2:\n                        entry3 = value;\n                        break;\n                    case 3:\n                        entry4 = value;\n                        break;\n                    case 4:\n                        entry5 = value;\n                        break;\n                    case 5:\n                        entry6 = value;\n                        break;\n                    case 6:\n                        entry7 = value;\n                        break;\n                    case 7:\n                        entry8 = value;\n                        break;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Creates a string representation of the list.\n        /// </summary>\n        /// <returns>String representation of the list.</returns>\n        public override string ToString()\n        {\n            return \"TinyList<\" + typeof (T) + \">, Count: \" + count;\n        }\n\n        /// <summary>\n        /// Tries to add an element to the list.\n        /// </summary>\n        /// <param name=\"item\">Item to add.</param>\n        /// <returns>Whether or not the item could be added.\n        /// Will return false when the list is full.</returns>\n        public bool Add(T item)\n        {\n            switch (count)\n            {\n                case 0:\n                    entry1 = item;\n                    break;\n                case 1:\n                    entry2 = item;\n                    break;\n                case 2:\n                    entry3 = item;\n                    break;\n                case 3:\n                    entry4 = item;\n                    break;\n                case 4:\n                    entry5 = item;\n                    break;\n                case 5:\n                    entry6 = item;\n                    break;\n                case 6:\n                    entry7 = item;\n                    break;\n                case 7:\n                    entry8 = item;\n                    break;\n                default:\n                    return false;\n            }\n            count++;\n            return true;\n        }\n\n        /// <summary>\n        /// Clears the list.\n        /// </summary>\n        public void Clear()\n        {\n            //Things aren't guaranteed to be structs in this list.\n            //It would be bad if we kept a reference around, hidden.\n            count = 0;\n            entry1 = default(T);\n            entry2 = default(T);\n            entry3 = default(T);\n            entry4 = default(T);\n            entry5 = default(T);\n            entry6 = default(T);\n            entry7 = default(T);\n            entry8 = default(T);\n        }\n\n        /// <summary>\n        /// Gets the index of the item in the list, if it is present.\n        /// </summary>\n        /// <param name=\"item\">Item to look for.</param>\n        /// <returns>Index of the item, if present.  -1 otherwise.</returns>\n        public int IndexOf(T item)\n        {\n            //This isn't a super fast operation.\n            if (entry1.Equals(item))\n                return 0;\n            else if (entry2.Equals(item))\n                return 1;\n            else if (entry3.Equals(item))\n                return 2;\n            else if (entry4.Equals(item))\n                return 3;\n            else if (entry5.Equals(item))\n                return 4;\n            else if (entry6.Equals(item))\n                return 5;\n            else if (entry7.Equals(item))\n                return 6;\n            else if (entry8.Equals(item))\n                return 7;\n            return -1;\n        }\n\n        /// <summary>\n        /// Tries to remove an element from the list.\n        /// </summary>\n        /// <param name=\"item\">Item to remove.</param>\n        /// <returns>Whether or not the item existed in the list.</returns>\n        public bool Remove(T item)\n        {\n            //Identity-based removes aren't a super high priority feature, so can be a little slower.\n            int index = IndexOf(item);\n            if (index != -1)\n            {\n                RemoveAt(index);\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Removes the item at the specified index.\n        /// </summary>\n        /// <param name=\"index\">Index of the element to remove.</param>\n        /// <returns>Whether or not the item could be removed.\n        /// Returns false if the index is out of bounds.</returns>\n        public bool RemoveAt(int index)\n        {\n            if (index > count - 1 || index < 0)\n                return false;\n            switch (index)\n            {\n                case 0:\n                    entry1 = entry2;\n                    entry2 = entry3;\n                    entry3 = entry4;\n                    entry4 = entry5;\n                    entry5 = entry6;\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 1:\n                    entry2 = entry3;\n                    entry3 = entry4;\n                    entry4 = entry5;\n                    entry5 = entry6;\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 2:\n                    entry3 = entry4;\n                    entry4 = entry5;\n                    entry5 = entry6;\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 3:\n                    entry4 = entry5;\n                    entry5 = entry6;\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 4:\n                    entry5 = entry6;\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 5:\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 6:\n                    entry7 = entry8;\n                    break;\n            }\n            count--;\n            return true;\n        }\n    }\n}"
  },
  {
    "path": "BEPUutilities/DataStructures/TinyStructList.cs",
    "content": "﻿using System;\n\nnamespace BEPUutilities.DataStructures\n{\n    /// <summary>\n    /// Special datatype used for heapless lists without unsafe/stackalloc.\n    /// Since reference types would require heap-side allocation and\n    /// do not match well with this structure's ref-parameter based access,\n    /// only structs are allowed.\n    /// Stores a maximum of 8 entries.\n    /// </summary>\n    /// <typeparam name=\"T\">Struct type to use.</typeparam>\n    public struct TinyStructList<T> where T : struct, IEquatable<T>\n    {\n        private T entry1;\n        private T entry2;\n        private T entry3;\n        private T entry4;\n\n        private T entry5;\n        private T entry6;\n        private T entry7;\n        private T entry8;\n\n        internal int count;\n\n        /// <summary>\n        /// Gets the current number of elements in the list.\n        /// </summary>\n        public int Count\n        {\n            get { return count; }\n        }\n\n        /// <summary>\n        /// Creates a string representation of the list.\n        /// </summary>\n        /// <returns>String representation of the list.</returns>\n        public override string ToString()\n        {\n            return \"TinyStructList<\" + typeof (T) + \">, Count: \" + count;\n        }\n\n        /// <summary>\n        /// Tries to add an element to the list.\n        /// </summary>\n        /// <param name=\"item\">Item to add.</param>\n        /// <returns>Whether or not the item could be added.\n        /// Will return false when the list is full.</returns>\n        public bool Add(ref T item)\n        {\n            switch (count)\n            {\n                case 0:\n                    entry1 = item;\n                    break;\n                case 1:\n                    entry2 = item;\n                    break;\n                case 2:\n                    entry3 = item;\n                    break;\n                case 3:\n                    entry4 = item;\n                    break;\n                case 4:\n                    entry5 = item;\n                    break;\n                case 5:\n                    entry6 = item;\n                    break;\n                case 6:\n                    entry7 = item;\n                    break;\n                case 7:\n                    entry8 = item;\n                    break;\n                default:\n                    return false;\n            }\n            count++;\n            return true;\n        }\n\n        /// <summary>\n        /// Clears the list.\n        /// </summary>\n        public void Clear()\n        {\n            //Everything is a struct in this kind of list, so not much work to do!\n            count = 0;\n        }\n\n        /// <summary>\n        /// Gets the item at the specified index.\n        /// </summary>\n        /// <param name=\"index\">Index to retrieve.</param>\n        /// <param name=\"item\">Retrieved item.</param>\n        /// <returns>Whether or not the index was valid.</returns>\n        public bool Get(int index, out T item)\n        {\n            if (index > count - 1 || index < 0)\n            {\n                item = default(T);\n                return false;\n            }\n            switch (index)\n            {\n                case 0:\n                    item = entry1;\n                    return true;\n                case 1:\n                    item = entry2;\n                    return true;\n                case 2:\n                    item = entry3;\n                    return true;\n                case 3:\n                    item = entry4;\n                    return true;\n                case 4:\n                    item = entry5;\n                    return true;\n                case 5:\n                    item = entry6;\n                    return true;\n                case 6:\n                    item = entry7;\n                    return true;\n                case 7:\n                    item = entry8;\n                    return true;\n                default:\n                    //Curious!\n                    item = default(T);\n                    return false;\n            }\n        }\n\n        /// <summary>\n        /// Gets the index of the item in the list, if it is present.\n        /// </summary>\n        /// <param name=\"item\">Item to look for.</param>\n        /// <returns>Index of the item, if present.  -1 otherwise.</returns>\n        public int IndexOf(ref T item)\n        {\n            //This isn't a super fast operation.\n            if (entry1.Equals(item))\n                return 0;\n            if (entry2.Equals(item))\n                return 1;\n            if (entry3.Equals(item))\n                return 2;\n            if (entry4.Equals(item))\n                return 3;\n            if (entry5.Equals(item))\n                return 4;\n            if (entry6.Equals(item))\n                return 5;\n            if (entry7.Equals(item))\n                return 6;\n            if (entry8.Equals(item))\n                return 7;\n            return -1;\n        }\n\n        /// <summary>\n        /// Tries to remove an element from the list.\n        /// </summary>\n        /// <param name=\"item\">Item to remove.</param>\n        /// <returns>Whether or not the item existed in the list.</returns>\n        public bool Remove(ref T item)\n        {\n            //Identity-based removes aren't a super high priority feature, so can be a little slower.\n            int index = IndexOf(ref item);\n            if (index != -1)\n            {\n                RemoveAt(index);\n                return true;\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Removes the item at the specified index.\n        /// </summary>\n        /// <param name=\"index\">Index of the element to remove.</param>\n        /// <returns>Whether or not the item could be removed.\n        /// Returns false if the index is out of bounds.</returns>\n        public bool RemoveAt(int index)\n        {\n            if (index > count - 1 || index < 0)\n                return false;\n            switch (index)\n            {\n                case 0:\n                    entry1 = entry2;\n                    entry2 = entry3;\n                    entry3 = entry4;\n                    entry4 = entry5;\n                    entry5 = entry6;\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 1:\n                    entry2 = entry3;\n                    entry3 = entry4;\n                    entry4 = entry5;\n                    entry5 = entry6;\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 2:\n                    entry3 = entry4;\n                    entry4 = entry5;\n                    entry5 = entry6;\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 3:\n                    entry4 = entry5;\n                    entry5 = entry6;\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 4:\n                    entry5 = entry6;\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 5:\n                    entry6 = entry7;\n                    entry7 = entry8;\n                    break;\n                case 6:\n                    entry7 = entry8;\n                    break;\n            }\n            count--;\n            return true;\n        }\n\n        /// <summary>\n        /// Tries to add an element to the list.\n        /// </summary>\n        /// <param name=\"index\">Index to replace.</param>\n        /// <param name=\"item\">Item to add.</param>\n        /// <returns>Whether or not the item could be replaced.\n        /// Returns false if the index is invalid.</returns>\n        public bool Replace(int index, ref T item)\n        {\n            if (index > count - 1 || index < 0)\n            {\n                return false;\n            }\n            switch (index)\n            {\n                case 0:\n                    entry1 = item;\n                    break;\n                case 1:\n                    entry2 = item;\n                    break;\n                case 2:\n                    entry3 = item;\n                    break;\n                case 3:\n                    entry4 = item;\n                    break;\n                case 4:\n                    entry5 = item;\n                    break;\n                case 5:\n                    entry6 = item;\n                    break;\n                case 6:\n                    entry7 = item;\n                    break;\n                case 7:\n                    entry8 = item;\n                    break;\n                default:\n                    return false;\n            }\n            return true;\n        }\n    }\n}"
  },
  {
    "path": "BEPUutilities/MathChecker.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUutilities\n{\n    /// <summary>\n    /// Contains conditional extensions to check for bad values in various structures.\n    /// </summary>\n    public static class MathChecker\n    {\n        /// <summary>\n        /// Checks a single float for validity.  Separate from the extension method to avoid throwing exceptions deep in a call tree.\n        /// </summary>\n        /// <param name=\"f\">Value to validate.</param>\n        /// <returns>True if the value is invalid, false if it is valid.</returns>\n        private static bool IsInvalid(float f)\n        {\n            return float.IsNaN(f) || float.IsInfinity(f);\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this float f)\n        {\n            if (IsInvalid(f))\n            {\n                throw new NotFiniteNumberException(\"Invalid value.\");\n            }\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this Vector3 v)\n        {\n            if (IsInvalid(v.LengthSquared()))\n            {\n                throw new NotFiniteNumberException(\"Invalid value.\");\n            }\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this Matrix2x2 m)\n        {\n            if (IsInvalid(m.M11) || IsInvalid(m.M12) ||\n                IsInvalid(m.M21) || IsInvalid(m.M22))\n            {\n                throw new NotFiniteNumberException(\"Invalid value.\");\n            }\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this Matrix3x2 m)\n        {\n            if (IsInvalid(m.M11) || IsInvalid(m.M12) ||\n                IsInvalid(m.M21) || IsInvalid(m.M22) ||\n                IsInvalid(m.M31) || IsInvalid(m.M32))\n            {\n                throw new NotFiniteNumberException(\"Invalid value.\");\n            }\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this Matrix2x3 m)\n        {\n            if (IsInvalid(m.M11) || IsInvalid(m.M12) || IsInvalid(m.M13) ||\n                IsInvalid(m.M21) || IsInvalid(m.M22) || IsInvalid(m.M23))\n            {\n                throw new NotFiniteNumberException(\"Invalid value.\");\n            }\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this Matrix3x3 m)\n        {\n            m.Right.Validate();\n            m.Up.Validate();\n            m.Backward.Validate();\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this Matrix m)\n        {\n            m.Right.Validate();\n            m.Up.Validate();\n            m.Backward.Validate();\n            m.Translation.Validate();\n            if (IsInvalid(m.M14) || IsInvalid(m.M24) || IsInvalid(m.M34) || IsInvalid(m.M44))\n            {\n                throw new NotFiniteNumberException(\"Invalid value.\");\n            }\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this Quaternion q)\n        {\n            if (IsInvalid(q.LengthSquared()))\n            {\n                throw new NotFiniteNumberException(\"Invalid value.\");\n            }\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this RigidTransform r)\n        {\n            r.Position.Validate();\n            r.Orientation.Validate();\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this AffineTransform a)\n        {\n            a.LinearTransform.Validate();\n            a.Translation.Validate();\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this BoundingBox b)\n        {\n            b.Min.Validate();\n            b.Max.Validate();\n        }\n\n        /// <summary>\n        /// Checks the value to see if it is a NaN or infinite.  If it is, an exception is thrown.\n        /// This is only run when the CHECKMATH symbol is defined.\n        /// </summary>\n        [Conditional(\"CHECKMATH\")]\n        public static void Validate(this BoundingSphere b)\n        {\n            b.Center.Validate();\n            if (IsInvalid(b.Radius))\n                throw new NotFiniteNumberException(\"Invalid value.\");\n        }\n\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/Matrix2x2.cs",
    "content": "﻿ \n\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUutilities\n{\n    /// <summary>\n    /// 2 row, 2 column matrix.\n    /// </summary>\n    public struct Matrix2x2\n    {\n        /// <summary>\n        /// Value at row 1, column 1 of the matrix.\n        /// </summary>\n        public float M11;\n\n        /// <summary>\n        /// Value at row 1, column 2 of the matrix.\n        /// </summary>\n        public float M12;\n\n        /// <summary>\n        /// Value at row 2, column 1 of the matrix.\n        /// </summary>\n        public float M21;\n\n        /// <summary>\n        /// Value at row 2, column 2 of the matrix.\n        /// </summary>\n        public float M22;\n\n\n        /// <summary>\n        /// Constructs a new 2 row, 2 column matrix.\n        /// </summary>\n        /// <param name=\"m11\">Value at row 1, column 1 of the matrix.</param>\n        /// <param name=\"m12\">Value at row 1, column 2 of the matrix.</param>\n        /// <param name=\"m21\">Value at row 2, column 1 of the matrix.</param>\n        /// <param name=\"m22\">Value at row 2, column 2 of the matrix.</param>\n        public Matrix2x2(float m11, float m12, float m21, float m22)\n        {\n            M11 = m11;\n            M12 = m12;\n            M21 = m21;\n            M22 = m22;\n        }\n\n        /// <summary>\n        /// Gets the 2x2 identity matrix.\n        /// </summary>\n        public static Matrix2x2 Identity\n        {\n            get { return new Matrix2x2(1, 0, 1, 0); }\n        }\n\n        /// <summary>\n        /// Adds the two matrices together on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to add.</param>\n        /// <param name=\"b\">Second matrix to add.</param>\n        /// <param name=\"result\">Sum of the two matrices.</param>\n        public static void Add(ref Matrix2x2 a, ref Matrix2x2 b, out Matrix2x2 result)\n        {\n            float m11 = a.M11 + b.M11;\n            float m12 = a.M12 + b.M12;\n\n            float m21 = a.M21 + b.M21;\n            float m22 = a.M22 + b.M22;\n\n            result.M11 = m11;\n            result.M12 = m12;\n\n            result.M21 = m21;\n            result.M22 = m22;\n        }\n\n        /// <summary>\n        /// Adds the two matrices together on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to add.</param>\n        /// <param name=\"b\">Second matrix to add.</param>\n        /// <param name=\"result\">Sum of the two matrices.</param>\n        public static void Add(ref Matrix a, ref Matrix2x2 b, out Matrix2x2 result)\n        {\n            float m11 = a.M11 + b.M11;\n            float m12 = a.M12 + b.M12;\n\n            float m21 = a.M21 + b.M21;\n            float m22 = a.M22 + b.M22;\n\n            result.M11 = m11;\n            result.M12 = m12;\n\n            result.M21 = m21;\n            result.M22 = m22;\n        }\n\n        /// <summary>\n        /// Adds the two matrices together on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to add.</param>\n        /// <param name=\"b\">Second matrix to add.</param>\n        /// <param name=\"result\">Sum of the two matrices.</param>\n        public static void Add(ref Matrix2x2 a, ref Matrix b, out Matrix2x2 result)\n        {\n            float m11 = a.M11 + b.M11;\n            float m12 = a.M12 + b.M12;\n\n            float m21 = a.M21 + b.M21;\n            float m22 = a.M22 + b.M22;\n\n            result.M11 = m11;\n            result.M12 = m12;\n\n            result.M21 = m21;\n            result.M22 = m22;\n        }\n\n        /// <summary>\n        /// Adds the two matrices together on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to add.</param>\n        /// <param name=\"b\">Second matrix to add.</param>\n        /// <param name=\"result\">Sum of the two matrices.</param>\n        public static void Add(ref Matrix a, ref Matrix b, out Matrix2x2 result)\n        {\n            float m11 = a.M11 + b.M11;\n            float m12 = a.M12 + b.M12;\n\n            float m21 = a.M21 + b.M21;\n            float m22 = a.M22 + b.M22;\n\n            result.M11 = m11;\n            result.M12 = m12;\n\n            result.M21 = m21;\n            result.M22 = m22;\n        }\n\n        /// <summary>\n        /// Constructs a uniform scaling matrix.\n        /// </summary>\n        /// <param name=\"scale\">Value to use in the diagonal.</param>\n        /// <param name=\"matrix\">Scaling matrix.</param>\n        public static void CreateScale(float scale, out Matrix2x2 matrix)\n        {\n            matrix.M11 = scale;\n            matrix.M22 = scale;\n\n            matrix.M12 = 0;\n            matrix.M21 = 0;\n        }\n\n\n        /// <summary>\n        /// Inverts the given matix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to be inverted.</param>\n        /// <param name=\"result\">Inverted matrix.</param>\n        public static void Invert(ref Matrix2x2 matrix, out Matrix2x2 result)\n        {\n            float determinantInverse = 1 / (matrix.M11 * matrix.M22 - matrix.M12 * matrix.M21);\n            float m11 = matrix.M22 * determinantInverse;\n            float m12 = -matrix.M12 * determinantInverse;\n\n            float m21 = -matrix.M21 * determinantInverse;\n            float m22 = matrix.M11 * determinantInverse;\n\n            result.M11 = m11;\n            result.M12 = m12;\n\n            result.M21 = m21;\n            result.M22 = m22;\n        }\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void Multiply(ref Matrix2x2 a, ref Matrix2x2 b, out Matrix2x2 result)\n        {\n            float resultM11 = a.M11 * b.M11 + a.M12 * b.M21;\n            float resultM12 = a.M11 * b.M12 + a.M12 * b.M22;\n\n            float resultM21 = a.M21 * b.M11 + a.M22 * b.M21;\n            float resultM22 = a.M21 * b.M12 + a.M22 * b.M22;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n        }\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void Multiply(ref Matrix2x2 a, ref Matrix b, out Matrix2x2 result)\n        {\n            float resultM11 = a.M11 * b.M11 + a.M12 * b.M21;\n            float resultM12 = a.M11 * b.M12 + a.M12 * b.M22;\n\n            float resultM21 = a.M21 * b.M11 + a.M22 * b.M21;\n            float resultM22 = a.M21 * b.M12 + a.M22 * b.M22;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n        }\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void Multiply(ref Matrix a, ref Matrix2x2 b, out Matrix2x2 result)\n        {\n            float resultM11 = a.M11 * b.M11 + a.M12 * b.M21;\n            float resultM12 = a.M11 * b.M12 + a.M12 * b.M22;\n\n            float resultM21 = a.M21 * b.M11 + a.M22 * b.M21;\n            float resultM22 = a.M21 * b.M12 + a.M22 * b.M22;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n        }\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void Multiply(ref Matrix2x3 a, ref Matrix3x2 b, out Matrix2x2 result)\n        {\n            result.M11 = a.M11 * b.M11 + a.M12 * b.M21 + a.M13 * b.M31;\n            result.M12 = a.M11 * b.M12 + a.M12 * b.M22 + a.M13 * b.M32;\n\n            result.M21 = a.M21 * b.M11 + a.M22 * b.M21 + a.M23 * b.M31;\n            result.M22 = a.M21 * b.M12 + a.M22 * b.M22 + a.M23 * b.M32;\n        }\n\n        /// <summary>\n        /// Negates every element in the matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to negate.</param>\n        /// <param name=\"result\">Negated matrix.</param>\n        public static void Negate(ref Matrix2x2 matrix, out Matrix2x2 result)\n        {\n            float m11 = -matrix.M11;\n            float m12 = -matrix.M12;\n\n            float m21 = -matrix.M21;\n            float m22 = -matrix.M22;\n\n\n            result.M11 = m11;\n            result.M12 = m12;\n\n            result.M21 = m21;\n            result.M22 = m22;\n        }\n\n        /// <summary>\n        /// Subtracts the two matrices from each other on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to subtract.</param>\n        /// <param name=\"b\">Second matrix to subtract.</param>\n        /// <param name=\"result\">Difference of the two matrices.</param>\n        public static void Subtract(ref Matrix2x2 a, ref Matrix2x2 b, out Matrix2x2 result)\n        {\n            float m11 = a.M11 - b.M11;\n            float m12 = a.M12 - b.M12;\n\n            float m21 = a.M21 - b.M21;\n            float m22 = a.M22 - b.M22;\n\n            result.M11 = m11;\n            result.M12 = m12;\n\n            result.M21 = m21;\n            result.M22 = m22;\n        }\n\n        /// <summary>\n        /// Transforms the vector by the matrix.\n        /// </summary>\n        /// <param name=\"v\">Vector2 to transform.</param>\n        /// <param name=\"matrix\">Matrix to use as the transformation.</param>\n        /// <param name=\"result\">Product of the transformation.</param>\n        public static void Transform(ref Vector2 v, ref Matrix2x2 matrix, out Vector2 result)\n        {\n            float vX = v.X;\n            float vY = v.Y;\n#if !WINDOWS\n            result = new Vector2();\n#endif\n            result.X = vX * matrix.M11 + vY * matrix.M21;\n            result.Y = vX * matrix.M12 + vY * matrix.M22;\n        }\n\n        /// <summary>\n        /// Computes the transposed matrix of a matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to transpose.</param>\n        /// <param name=\"result\">Transposed matrix.</param>\n        public static void Transpose(ref Matrix2x2 matrix, out Matrix2x2 result)\n        {\n            float m21 = matrix.M12;\n\n            result.M11 = matrix.M11;\n            result.M12 = matrix.M21;\n\n            result.M21 = m21;\n            result.M22 = matrix.M22;\n        }\n\n        /// <summary>\n        /// Creates a string representation of the matrix.\n        /// </summary>\n        /// <returns>A string representation of the matrix.</returns>\n        public override string ToString()\n        {\n            return \"{\" + M11 + \", \" + M12 + \"} \" +\n                   \"{\" + M21 + \", \" + M22 + \"}\";\n        }\n\n        /// <summary>\n        /// Calculates the determinant of the matrix.\n        /// </summary>\n        /// <returns>The matrix's determinant.</returns>\n        public float Determinant()\n        {\n            return M11 * M22 - M12 * M21;\n        }\n    }\n}"
  },
  {
    "path": "BEPUutilities/Matrix2x3.cs",
    "content": "﻿ \n\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUutilities\n{\n    /// <summary>\n    /// 2 row, 3 column matrix.\n    /// </summary>\n    public struct Matrix2x3\n    {\n        /// <summary>\n        /// Value at row 1, column 1 of the matrix.\n        /// </summary>\n        public float M11;\n\n        /// <summary>\n        /// Value at row 1, column 2 of the matrix.\n        /// </summary>\n        public float M12;\n\n        /// <summary>\n        /// Value at row 1, column 2 of the matrix.\n        /// </summary>\n        public float M13;\n\n        /// <summary>\n        /// Value at row 2, column 1 of the matrix.\n        /// </summary>\n        public float M21;\n\n        /// <summary>\n        /// Value at row 2, column 2 of the matrix.\n        /// </summary>\n        public float M22;\n\n        /// <summary>\n        /// Value at row 2, column 3 of the matrix.\n        /// </summary>\n        public float M23;\n\n\n        /// <summary>\n        /// Constructs a new 2 row, 2 column matrix.\n        /// </summary>\n        /// <param name=\"m11\">Value at row 1, column 1 of the matrix.</param>\n        /// <param name=\"m12\">Value at row 1, column 2 of the matrix.</param>\n        /// <param name=\"m13\">Value at row 1, column 3 of the matrix.</param>\n        /// <param name=\"m21\">Value at row 2, column 1 of the matrix.</param>\n        /// <param name=\"m22\">Value at row 2, column 2 of the matrix.</param>\n        /// <param name=\"m23\">Value at row 2, column 3 of the matrix.</param>\n        public Matrix2x3(float m11, float m12, float m13, float m21, float m22, float m23)\n        {\n            M11 = m11;\n            M12 = m12;\n            M13 = m13;\n            M21 = m21;\n            M22 = m22;\n            M23 = m23;\n        }\n\n        /// <summary>\n        /// Adds the two matrices together on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to add.</param>\n        /// <param name=\"b\">Second matrix to add.</param>\n        /// <param name=\"result\">Sum of the two matrices.</param>\n        public static void Add(ref Matrix2x3 a, ref Matrix2x3 b, out Matrix2x3 result)\n        {\n            float m11 = a.M11 + b.M11;\n            float m12 = a.M12 + b.M12;\n            float m13 = a.M13 + b.M13;\n\n            float m21 = a.M21 + b.M21;\n            float m22 = a.M22 + b.M22;\n            float m23 = a.M23 + b.M23;\n\n            result.M11 = m11;\n            result.M12 = m12;\n            result.M13 = m13;\n\n            result.M21 = m21;\n            result.M22 = m22;\n            result.M23 = m23;\n        }\n\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void Multiply(ref Matrix2x3 a, ref Matrix3x3 b, out Matrix2x3 result)\n        {\n            float resultM11 = a.M11 * b.M11 + a.M12 * b.M21 + a.M13 * b.M31;\n            float resultM12 = a.M11 * b.M12 + a.M12 * b.M22 + a.M13 * b.M32;\n            float resultM13 = a.M11 * b.M13 + a.M12 * b.M23 + a.M13 * b.M33;\n\n            float resultM21 = a.M21 * b.M11 + a.M22 * b.M21 + a.M23 * b.M31;\n            float resultM22 = a.M21 * b.M12 + a.M22 * b.M22 + a.M23 * b.M32;\n            float resultM23 = a.M21 * b.M13 + a.M22 * b.M23 + a.M23 * b.M33;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n            result.M13 = resultM13;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n            result.M23 = resultM23;\n        }\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void Multiply(ref Matrix2x3 a, ref Matrix b, out Matrix2x3 result)\n        {\n            float resultM11 = a.M11 * b.M11 + a.M12 * b.M21 + a.M13 * b.M31;\n            float resultM12 = a.M11 * b.M12 + a.M12 * b.M22 + a.M13 * b.M32;\n            float resultM13 = a.M11 * b.M13 + a.M12 * b.M23 + a.M13 * b.M33;\n\n            float resultM21 = a.M21 * b.M11 + a.M22 * b.M21 + a.M23 * b.M31;\n            float resultM22 = a.M21 * b.M12 + a.M22 * b.M22 + a.M23 * b.M32;\n            float resultM23 = a.M21 * b.M13 + a.M22 * b.M23 + a.M23 * b.M33;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n            result.M13 = resultM13;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n            result.M23 = resultM23;\n        }\n\n        /// <summary>\n        /// Negates every element in the matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to negate.</param>\n        /// <param name=\"result\">Negated matrix.</param>\n        public static void Negate(ref Matrix2x3 matrix, out Matrix2x3 result)\n        {\n            float m11 = -matrix.M11;\n            float m12 = -matrix.M12;\n            float m13 = -matrix.M13;\n\n            float m21 = -matrix.M21;\n            float m22 = -matrix.M22;\n            float m23 = -matrix.M23;\n\n            result.M11 = m11;\n            result.M12 = m12;\n            result.M13 = m13;\n\n            result.M21 = m21;\n            result.M22 = m22;\n            result.M23 = m23;\n        }\n\n        /// <summary>\n        /// Subtracts the two matrices from each other on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to subtract.</param>\n        /// <param name=\"b\">Second matrix to subtract.</param>\n        /// <param name=\"result\">Difference of the two matrices.</param>\n        public static void Subtract(ref Matrix2x3 a, ref Matrix2x3 b, out Matrix2x3 result)\n        {\n            float m11 = a.M11 - b.M11;\n            float m12 = a.M12 - b.M12;\n            float m13 = a.M13 - b.M13;\n\n            float m21 = a.M21 - b.M21;\n            float m22 = a.M22 - b.M22;\n            float m23 = a.M23 - b.M23;\n\n            result.M11 = m11;\n            result.M12 = m12;\n            result.M13 = m13;\n\n            result.M21 = m21;\n            result.M22 = m22;\n            result.M23 = m23;\n        }\n\n\n        /// <summary>\n        /// Transforms the vector by the matrix.\n        /// </summary>\n        /// <param name=\"v\">Vector2 to transform.  Considered to be a row vector for purposes of multiplication.</param>\n        /// <param name=\"matrix\">Matrix to use as the transformation.</param>\n        /// <param name=\"result\">Row vector product of the transformation.</param>\n        public static void Transform(ref Vector2 v, ref Matrix2x3 matrix, out Vector3 result)\n        {\n#if !WINDOWS\n            result = new Vector3();\n#endif\n            result.X = v.X * matrix.M11 + v.Y * matrix.M21;\n            result.Y = v.X * matrix.M12 + v.Y * matrix.M22;\n            result.Z = v.X * matrix.M13 + v.Y * matrix.M23;\n        }\n\n        /// <summary>\n        /// Transforms the vector by the matrix.\n        /// </summary>\n        /// <param name=\"v\">Vector2 to transform.  Considered to be a column vector for purposes of multiplication.</param>\n        /// <param name=\"matrix\">Matrix to use as the transformation.</param>\n        /// <param name=\"result\">Column vector product of the transformation.</param>\n        public static void Transform(ref Vector3 v, ref Matrix2x3 matrix, out Vector2 result)\n        {\n#if !WINDOWS\n            result = new Vector2();\n#endif\n            result.X = matrix.M11 * v.X + matrix.M12 * v.Y + matrix.M13 * v.Z;\n            result.Y = matrix.M21 * v.X + matrix.M22 * v.Y + matrix.M23 * v.Z;\n        }\n\n\n        /// <summary>\n        /// Computes the transposed matrix of a matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to transpose.</param>\n        /// <param name=\"result\">Transposed matrix.</param>\n        public static void Transpose(ref Matrix2x3 matrix, out Matrix3x2 result)\n        {\n            result.M11 = matrix.M11;\n            result.M12 = matrix.M21;\n\n            result.M21 = matrix.M12;\n            result.M22 = matrix.M22;\n\n            result.M31 = matrix.M13;\n            result.M32 = matrix.M23;\n        }\n\n\n        /// <summary>\n        /// Creates a string representation of the matrix.\n        /// </summary>\n        /// <returns>A string representation of the matrix.</returns>\n        public override string ToString()\n        {\n            return \"{\" + M11 + \", \" + M12 + \", \" + M13 + \"} \" +\n                   \"{\" + M21 + \", \" + M22 + \", \" + M23 + \"}\";\n        }\n    }\n}"
  },
  {
    "path": "BEPUutilities/Matrix3x2.cs",
    "content": "﻿ \n\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUutilities\n{\n    /// <summary>\n    /// 3 row, 2 column matrix.\n    /// </summary>\n    public struct Matrix3x2\n    {\n        /// <summary>\n        /// Value at row 1, column 1 of the matrix.\n        /// </summary>\n        public float M11;\n\n        /// <summary>\n        /// Value at row 1, column 2 of the matrix.\n        /// </summary>\n        public float M12;\n\n        /// <summary>\n        /// Value at row 2, column 1 of the matrix.\n        /// </summary>\n        public float M21;\n\n        /// <summary>\n        /// Value at row 2, column 2 of the matrix.\n        /// </summary>\n        public float M22;\n\n        /// <summary>\n        /// Value at row 3, column 1 of the matrix.\n        /// </summary>\n        public float M31;\n\n        /// <summary>\n        /// Value at row 3, column 2 of the matrix.\n        /// </summary>\n        public float M32;\n\n\n        /// <summary>\n        /// Constructs a new 3 row, 2 column matrix.\n        /// </summary>\n        /// <param name=\"m11\">Value at row 1, column 1 of the matrix.</param>\n        /// <param name=\"m12\">Value at row 1, column 2 of the matrix.</param>\n        /// <param name=\"m21\">Value at row 2, column 1 of the matrix.</param>\n        /// <param name=\"m22\">Value at row 2, column 2 of the matrix.</param>\n        /// <param name=\"m31\">Value at row 2, column 1 of the matrix.</param>\n        /// <param name=\"m32\">Value at row 2, column 2 of the matrix.</param>\n        public Matrix3x2(float m11, float m12, float m21, float m22, float m31, float m32)\n        {\n            M11 = m11;\n            M12 = m12;\n            M21 = m21;\n            M22 = m22;\n            M31 = m31;\n            M32 = m32;\n        }\n\n\n        /// <summary>\n        /// Adds the two matrices together on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to add.</param>\n        /// <param name=\"b\">Second matrix to add.</param>\n        /// <param name=\"result\">Sum of the two matrices.</param>\n        public static void Add(ref Matrix3x2 a, ref Matrix3x2 b, out Matrix3x2 result)\n        {\n            float m11 = a.M11 + b.M11;\n            float m12 = a.M12 + b.M12;\n\n            float m21 = a.M21 + b.M21;\n            float m22 = a.M22 + b.M22;\n\n            float m31 = a.M31 + b.M31;\n            float m32 = a.M32 + b.M32;\n\n            result.M11 = m11;\n            result.M12 = m12;\n\n            result.M21 = m21;\n            result.M22 = m22;\n\n            result.M31 = m31;\n            result.M32 = m32;\n        }\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void Multiply(ref Matrix3x3 a, ref Matrix3x2 b, out Matrix3x2 result)\n        {\n            float resultM11 = a.M11 * b.M11 + a.M12 * b.M21 + a.M13 * b.M31;\n            float resultM12 = a.M11 * b.M12 + a.M12 * b.M22 + a.M13 * b.M32;\n\n            float resultM21 = a.M21 * b.M11 + a.M22 * b.M21 + a.M23 * b.M31;\n            float resultM22 = a.M21 * b.M12 + a.M22 * b.M22 + a.M23 * b.M32;\n\n            float resultM31 = a.M31 * b.M11 + a.M32 * b.M21 + a.M33 * b.M31;\n            float resultM32 = a.M31 * b.M12 + a.M32 * b.M22 + a.M33 * b.M32;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n\n            result.M31 = resultM31;\n            result.M32 = resultM32;\n        }\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void Multiply(ref Matrix a, ref Matrix3x2 b, out Matrix3x2 result)\n        {\n            float resultM11 = a.M11 * b.M11 + a.M12 * b.M21 + a.M13 * b.M31;\n            float resultM12 = a.M11 * b.M12 + a.M12 * b.M22 + a.M13 * b.M32;\n\n            float resultM21 = a.M21 * b.M11 + a.M22 * b.M21 + a.M23 * b.M31;\n            float resultM22 = a.M21 * b.M12 + a.M22 * b.M22 + a.M23 * b.M32;\n\n            float resultM31 = a.M31 * b.M11 + a.M32 * b.M21 + a.M33 * b.M31;\n            float resultM32 = a.M31 * b.M12 + a.M32 * b.M22 + a.M33 * b.M32;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n\n            result.M31 = resultM31;\n            result.M32 = resultM32;\n        }\n\n        /// <summary>\n        /// Negates every element in the matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to negate.</param>\n        /// <param name=\"result\">Negated matrix.</param>\n        public static void Negate(ref Matrix3x2 matrix, out Matrix3x2 result)\n        {\n            float m11 = -matrix.M11;\n            float m12 = -matrix.M12;\n\n            float m21 = -matrix.M21;\n            float m22 = -matrix.M22;\n\n            float m31 = -matrix.M31;\n            float m32 = -matrix.M32;\n\n            result.M11 = m11;\n            result.M12 = m12;\n\n            result.M21 = m21;\n            result.M22 = m22;\n\n            result.M31 = m31;\n            result.M32 = m32;\n        }\n\n        /// <summary>\n        /// Subtracts the two matrices from each other on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to subtract.</param>\n        /// <param name=\"b\">Second matrix to subtract.</param>\n        /// <param name=\"result\">Difference of the two matrices.</param>\n        public static void Subtract(ref Matrix3x2 a, ref Matrix3x2 b, out Matrix3x2 result)\n        {\n            float m11 = a.M11 - b.M11;\n            float m12 = a.M12 - b.M12;\n\n            float m21 = a.M21 - b.M21;\n            float m22 = a.M22 - b.M22;\n\n            float m31 = a.M31 - b.M31;\n            float m32 = a.M32 - b.M32;\n\n            result.M11 = m11;\n            result.M12 = m12;\n\n            result.M21 = m21;\n            result.M22 = m22;\n\n            result.M31 = m31;\n            result.M32 = m32;\n        }\n\n        /// <summary>\n        /// Transforms the vector by the matrix.\n        /// </summary>\n        /// <param name=\"v\">Vector2 to transform.  Considered to be a column vector for purposes of multiplication.</param>\n        /// <param name=\"matrix\">Matrix to use as the transformation.</param>\n        /// <param name=\"result\">Column vector product of the transformation.</param>\n        public static void Transform(ref Vector2 v, ref Matrix3x2 matrix, out Vector3 result)\n        {\n#if !WINDOWS\n            result = new Vector3();\n#endif\n            result.X = matrix.M11 * v.X + matrix.M12 * v.Y;\n            result.Y = matrix.M21 * v.X + matrix.M22 * v.Y;\n            result.Z = matrix.M31 * v.X + matrix.M32 * v.Y;\n        }\n\n        /// <summary>\n        /// Transforms the vector by the matrix.\n        /// </summary>\n        /// <param name=\"v\">Vector2 to transform.  Considered to be a row vector for purposes of multiplication.</param>\n        /// <param name=\"matrix\">Matrix to use as the transformation.</param>\n        /// <param name=\"result\">Row vector product of the transformation.</param>\n        public static void Transform(ref Vector3 v, ref Matrix3x2 matrix, out Vector2 result)\n        {\n#if !WINDOWS\n            result = new Vector2();\n#endif\n            result.X = v.X * matrix.M11 + v.Y * matrix.M21 + v.Z * matrix.M31;\n            result.Y = v.X * matrix.M12 + v.Y * matrix.M22 + v.Z * matrix.M32;\n        }\n\n\n        /// <summary>\n        /// Computes the transposed matrix of a matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to transpose.</param>\n        /// <param name=\"result\">Transposed matrix.</param>\n        public static void Transpose(ref Matrix3x2 matrix, out Matrix2x3 result)\n        {\n            result.M11 = matrix.M11;\n            result.M12 = matrix.M21;\n            result.M13 = matrix.M31;\n\n            result.M21 = matrix.M12;\n            result.M22 = matrix.M22;\n            result.M23 = matrix.M32;\n        }\n\n\n        /// <summary>\n        /// Creates a string representation of the matrix.\n        /// </summary>\n        /// <returns>A string representation of the matrix.</returns>\n        public override string ToString()\n        {\n            return \"{\" + M11 + \", \" + M12 + \"} \" +\n                   \"{\" + M21 + \", \" + M22 + \"} \" +\n                   \"{\" + M31 + \", \" + M32 + \"}\";\n        }\n    }\n}"
  },
  {
    "path": "BEPUutilities/Matrix3x3.cs",
    "content": "﻿using System;\nusing Microsoft.Xna.Framework;\n\n\nnamespace BEPUutilities\n{\n    /// <summary>\n    /// 3 row, 3 column matrix.\n    /// </summary>\n    public struct Matrix3x3\n    {\n        /// <summary>\n        /// Value at row 1, column 1 of the matrix.\n        /// </summary>\n        public float M11;\n\n        /// <summary>\n        /// Value at row 1, column 2 of the matrix.\n        /// </summary>\n        public float M12;\n\n        /// <summary>\n        /// Value at row 1, column 3 of the matrix.\n        /// </summary>\n        public float M13;\n\n        /// <summary>\n        /// Value at row 2, column 1 of the matrix.\n        /// </summary>\n        public float M21;\n\n        /// <summary>\n        /// Value at row 2, column 2 of the matrix.\n        /// </summary>\n        public float M22;\n\n        /// <summary>\n        /// Value at row 2, column 3 of the matrix.\n        /// </summary>\n        public float M23;\n\n        /// <summary>\n        /// Value at row 3, column 1 of the matrix.\n        /// </summary>\n        public float M31;\n\n        /// <summary>\n        /// Value at row 3, column 2 of the matrix.\n        /// </summary>\n        public float M32;\n\n        /// <summary>\n        /// Value at row 3, column 3 of the matrix.\n        /// </summary>\n        public float M33;\n\n        /// <summary>\n        /// Constructs a new 3 row, 3 column matrix.\n        /// </summary>\n        /// <param name=\"m11\">Value at row 1, column 1 of the matrix.</param>\n        /// <param name=\"m12\">Value at row 1, column 2 of the matrix.</param>\n        /// <param name=\"m13\">Value at row 1, column 3 of the matrix.</param>\n        /// <param name=\"m21\">Value at row 2, column 1 of the matrix.</param>\n        /// <param name=\"m22\">Value at row 2, column 2 of the matrix.</param>\n        /// <param name=\"m23\">Value at row 2, column 3 of the matrix.</param>\n        /// <param name=\"m31\">Value at row 3, column 1 of the matrix.</param>\n        /// <param name=\"m32\">Value at row 3, column 2 of the matrix.</param>\n        /// <param name=\"m33\">Value at row 3, column 3 of the matrix.</param>\n        public Matrix3x3(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33)\n        {\n            M11 = m11;\n            M12 = m12;\n            M13 = m13;\n            M21 = m21;\n            M22 = m22;\n            M23 = m23;\n            M31 = m31;\n            M32 = m32;\n            M33 = m33;\n        }\n\n        /// <summary>\n        /// Gets the 3x3 identity matrix.\n        /// </summary>\n        public static Matrix3x3 Identity\n        {\n            get { return new Matrix3x3(1, 0, 0, 0, 1, 0, 0, 0, 1); }\n        }\n\n\n        /// <summary>\n        /// Gets or sets the backward vector of the matrix.\n        /// </summary>\n        public Vector3 Backward\n        {\n            get\n            {\n#if !WINDOWS\n                Vector3 vector = new Vector3();\n#else\n                Vector3 vector;\n#endif\n                vector.X = M31;\n                vector.Y = M32;\n                vector.Z = M33;\n                return vector;\n            }\n            set\n            {\n                M31 = value.X;\n                M32 = value.Y;\n                M33 = value.Z;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the down vector of the matrix.\n        /// </summary>\n        public Vector3 Down\n        {\n            get\n            {\n#if !WINDOWS\n                Vector3 vector = new Vector3();\n#else\n                Vector3 vector;\n#endif\n                vector.X = -M21;\n                vector.Y = -M22;\n                vector.Z = -M23;\n                return vector;\n            }\n            set\n            {\n                M21 = -value.X;\n                M22 = -value.Y;\n                M23 = -value.Z;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the forward vector of the matrix.\n        /// </summary>\n        public Vector3 Forward\n        {\n            get\n            {\n#if !WINDOWS\n                Vector3 vector = new Vector3();\n#else\n                Vector3 vector;\n#endif\n                vector.X = -M31;\n                vector.Y = -M32;\n                vector.Z = -M33;\n                return vector;\n            }\n            set\n            {\n                M31 = -value.X;\n                M32 = -value.Y;\n                M33 = -value.Z;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the left vector of the matrix.\n        /// </summary>\n        public Vector3 Left\n        {\n            get\n            {\n#if !WINDOWS\n                Vector3 vector = new Vector3();\n#else\n                Vector3 vector;\n#endif\n                vector.X = -M11;\n                vector.Y = -M12;\n                vector.Z = -M13;\n                return vector;\n            }\n            set\n            {\n                M11 = -value.X;\n                M12 = -value.Y;\n                M13 = -value.Z;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the right vector of the matrix.\n        /// </summary>\n        public Vector3 Right\n        {\n            get\n            {\n#if !WINDOWS\n                Vector3 vector = new Vector3();\n#else\n                Vector3 vector;\n#endif\n                vector.X = M11;\n                vector.Y = M12;\n                vector.Z = M13;\n                return vector;\n            }\n            set\n            {\n                M11 = value.X;\n                M12 = value.Y;\n                M13 = value.Z;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the up vector of the matrix.\n        /// </summary>\n        public Vector3 Up\n        {\n            get\n            {\n#if !WINDOWS\n                Vector3 vector = new Vector3();\n#else\n                Vector3 vector;\n#endif\n                vector.X = M21;\n                vector.Y = M22;\n                vector.Z = M23;\n                return vector;\n            }\n            set\n            {\n                M21 = value.X;\n                M22 = value.Y;\n                M23 = value.Z;\n            }\n        }\n\n        /// <summary>\n        /// Adds the two matrices together on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to add.</param>\n        /// <param name=\"b\">Second matrix to add.</param>\n        /// <param name=\"result\">Sum of the two matrices.</param>\n        public static void Add(ref Matrix3x3 a, ref Matrix3x3 b, out Matrix3x3 result)\n        {\n            float m11 = a.M11 + b.M11;\n            float m12 = a.M12 + b.M12;\n            float m13 = a.M13 + b.M13;\n\n            float m21 = a.M21 + b.M21;\n            float m22 = a.M22 + b.M22;\n            float m23 = a.M23 + b.M23;\n\n            float m31 = a.M31 + b.M31;\n            float m32 = a.M32 + b.M32;\n            float m33 = a.M33 + b.M33;\n\n            result.M11 = m11;\n            result.M12 = m12;\n            result.M13 = m13;\n\n            result.M21 = m21;\n            result.M22 = m22;\n            result.M23 = m23;\n\n            result.M31 = m31;\n            result.M32 = m32;\n            result.M33 = m33;\n        }\n\n        /// <summary>\n        /// Adds the two matrices together on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to add.</param>\n        /// <param name=\"b\">Second matrix to add.</param>\n        /// <param name=\"result\">Sum of the two matrices.</param>\n        public static void Add(ref Matrix a, ref Matrix3x3 b, out Matrix3x3 result)\n        {\n            float m11 = a.M11 + b.M11;\n            float m12 = a.M12 + b.M12;\n            float m13 = a.M13 + b.M13;\n\n            float m21 = a.M21 + b.M21;\n            float m22 = a.M22 + b.M22;\n            float m23 = a.M23 + b.M23;\n\n            float m31 = a.M31 + b.M31;\n            float m32 = a.M32 + b.M32;\n            float m33 = a.M33 + b.M33;\n\n            result.M11 = m11;\n            result.M12 = m12;\n            result.M13 = m13;\n\n            result.M21 = m21;\n            result.M22 = m22;\n            result.M23 = m23;\n\n            result.M31 = m31;\n            result.M32 = m32;\n            result.M33 = m33;\n        }\n\n        /// <summary>\n        /// Adds the two matrices together on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to add.</param>\n        /// <param name=\"b\">Second matrix to add.</param>\n        /// <param name=\"result\">Sum of the two matrices.</param>\n        public static void Add(ref Matrix3x3 a, ref Matrix b, out Matrix3x3 result)\n        {\n            float m11 = a.M11 + b.M11;\n            float m12 = a.M12 + b.M12;\n            float m13 = a.M13 + b.M13;\n\n            float m21 = a.M21 + b.M21;\n            float m22 = a.M22 + b.M22;\n            float m23 = a.M23 + b.M23;\n\n            float m31 = a.M31 + b.M31;\n            float m32 = a.M32 + b.M32;\n            float m33 = a.M33 + b.M33;\n\n            result.M11 = m11;\n            result.M12 = m12;\n            result.M13 = m13;\n\n            result.M21 = m21;\n            result.M22 = m22;\n            result.M23 = m23;\n\n            result.M31 = m31;\n            result.M32 = m32;\n            result.M33 = m33;\n        }\n\n        /// <summary>\n        /// Adds the two matrices together on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to add.</param>\n        /// <param name=\"b\">Second matrix to add.</param>\n        /// <param name=\"result\">Sum of the two matrices.</param>\n        public static void Add(ref Matrix a, ref Matrix b, out Matrix3x3 result)\n        {\n            float m11 = a.M11 + b.M11;\n            float m12 = a.M12 + b.M12;\n            float m13 = a.M13 + b.M13;\n\n            float m21 = a.M21 + b.M21;\n            float m22 = a.M22 + b.M22;\n            float m23 = a.M23 + b.M23;\n\n            float m31 = a.M31 + b.M31;\n            float m32 = a.M32 + b.M32;\n            float m33 = a.M33 + b.M33;\n\n            result.M11 = m11;\n            result.M12 = m12;\n            result.M13 = m13;\n\n            result.M21 = m21;\n            result.M22 = m22;\n            result.M23 = m23;\n\n            result.M31 = m31;\n            result.M32 = m32;\n            result.M33 = m33;\n        }\n\n        /// <summary>\n        /// Creates a skew symmetric matrix M from vector A such that M * B for some other vector B is equivalent to the cross product of A and B.\n        /// </summary>\n        /// <param name=\"v\">Vector to base the matrix on.</param>\n        /// <param name=\"result\">Skew-symmetric matrix result.</param>\n        public static void CreateCrossProduct(ref Vector3 v, out Matrix3x3 result)\n        {\n            result.M11 = 0;\n            result.M12 = -v.Z;\n            result.M13 = v.Y;\n            result.M21 = v.Z;\n            result.M22 = 0;\n            result.M23 = -v.X;\n            result.M31 = -v.Y;\n            result.M32 = v.X;\n            result.M33 = 0;\n        }\n\n        /// <summary>\n        /// Creates a 3x3 matrix from an XNA 4x4 matrix.\n        /// </summary>\n        /// <param name=\"matrix4X4\">Matrix to extract a 3x3 matrix from.</param>\n        /// <param name=\"matrix3X3\">Upper 3x3 matrix extracted from the XNA matrix.</param>\n        public static void CreateFromMatrix(ref Matrix matrix4X4, out Matrix3x3 matrix3X3)\n        {\n            matrix3X3.M11 = matrix4X4.M11;\n            matrix3X3.M12 = matrix4X4.M12;\n            matrix3X3.M13 = matrix4X4.M13;\n\n            matrix3X3.M21 = matrix4X4.M21;\n            matrix3X3.M22 = matrix4X4.M22;\n            matrix3X3.M23 = matrix4X4.M23;\n\n            matrix3X3.M31 = matrix4X4.M31;\n            matrix3X3.M32 = matrix4X4.M32;\n            matrix3X3.M33 = matrix4X4.M33;\n        }\n        /// <summary>\n        /// Creates a 3x3 matrix from an XNA 4x4 matrix.\n        /// </summary>\n        /// <param name=\"matrix4X4\">Matrix to extract a 3x3 matrix from.</param>\n        /// <returns>Upper 3x3 matrix extracted from the XNA matrix.</returns>\n        public static Matrix3x3 CreateFromMatrix(Matrix matrix4X4)\n        {\n            Matrix3x3 matrix3X3;\n            matrix3X3.M11 = matrix4X4.M11;\n            matrix3X3.M12 = matrix4X4.M12;\n            matrix3X3.M13 = matrix4X4.M13;\n\n            matrix3X3.M21 = matrix4X4.M21;\n            matrix3X3.M22 = matrix4X4.M22;\n            matrix3X3.M23 = matrix4X4.M23;\n\n            matrix3X3.M31 = matrix4X4.M31;\n            matrix3X3.M32 = matrix4X4.M32;\n            matrix3X3.M33 = matrix4X4.M33;\n            return matrix3X3;\n        }\n\n        /// <summary>\n        /// Constructs a uniform scaling matrix.\n        /// </summary>\n        /// <param name=\"scale\">Value to use in the diagonal.</param>\n        /// <param name=\"matrix\">Scaling matrix.</param>\n        public static void CreateScale(float scale, out Matrix3x3 matrix)\n        {\n            matrix = new Matrix3x3 {M11 = scale, M22 = scale, M33 = scale};\n        }\n\n        /// <summary>\n        /// Constructs a uniform scaling matrix.\n        /// </summary>\n        /// <param name=\"scale\">Value to use in the diagonal.</param>\n        /// <returns>Scaling matrix.</returns>\n        public static Matrix3x3 CreateScale(float scale)\n        {\n            var matrix = new Matrix3x3 {M11 = scale, M22 = scale, M33 = scale};\n            return matrix;\n        }\n\n        /// <summary>\n        /// Constructs a non-uniform scaling matrix.\n        /// </summary>\n        /// <param name=\"scale\">Values defining the axis scales.</param>\n        /// <param name=\"matrix\">Scaling matrix.</param>\n        public static void CreateScale(ref Vector3 scale, out Matrix3x3 matrix)\n        {\n            matrix = new Matrix3x3 {M11 = scale.X, M22 = scale.Y, M33 = scale.Z};\n        }\n\n        /// <summary>\n        /// Constructs a non-uniform scaling matrix.\n        /// </summary>\n        /// <param name=\"scale\">Values defining the axis scales.</param>\n        /// <returns>Scaling matrix.</returns>\n        public static Matrix3x3 CreateScale(ref Vector3 scale)\n        {\n            var matrix = new Matrix3x3 {M11 = scale.X, M22 = scale.Y, M33 = scale.Z};\n            return matrix;\n        }\n\n\n        /// <summary>\n        /// Constructs a non-uniform scaling matrix.\n        /// </summary>\n        /// <param name=\"x\">Scaling along the x axis.</param>\n        /// <param name=\"y\">Scaling along the y axis.</param>\n        /// <param name=\"z\">Scaling along the z axis.</param>\n        /// <param name=\"matrix\">Scaling matrix.</param>\n        public static void CreateScale(float x, float y, float z, out Matrix3x3 matrix)\n        {\n            matrix = new Matrix3x3 {M11 = x, M22 = y, M33 = z};\n        }\n\n        /// <summary>\n        /// Constructs a non-uniform scaling matrix.\n        /// </summary>\n        /// <param name=\"x\">Scaling along the x axis.</param>\n        /// <param name=\"y\">Scaling along the y axis.</param>\n        /// <param name=\"z\">Scaling along the z axis.</param>\n        /// <returns>Scaling matrix.</returns>\n        public static Matrix3x3 CreateScale(float x, float y, float z)\n        {\n            var matrix = new Matrix3x3 {M11 = x, M22 = y, M33 = z};\n            return matrix;\n        }\n\n        /// <summary>\n        /// Inverts the given matix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to be inverted.</param>\n        /// <param name=\"result\">Inverted matrix.</param>\n        public static void Invert(ref Matrix3x3 matrix, out Matrix3x3 result)\n        {\n            float determinantInverse = 1 / matrix.Determinant();\n            float m11 = (matrix.M22 * matrix.M33 - matrix.M23 * matrix.M32) * determinantInverse;\n            float m12 = (matrix.M13 * matrix.M32 - matrix.M33 * matrix.M12) * determinantInverse;\n            float m13 = (matrix.M12 * matrix.M23 - matrix.M22 * matrix.M13) * determinantInverse;\n\n            float m21 = (matrix.M23 * matrix.M31 - matrix.M21 * matrix.M33) * determinantInverse;\n            float m22 = (matrix.M11 * matrix.M33 - matrix.M13 * matrix.M31) * determinantInverse;\n            float m23 = (matrix.M13 * matrix.M21 - matrix.M11 * matrix.M23) * determinantInverse;\n\n            float m31 = (matrix.M21 * matrix.M32 - matrix.M22 * matrix.M31) * determinantInverse;\n            float m32 = (matrix.M12 * matrix.M31 - matrix.M11 * matrix.M32) * determinantInverse;\n            float m33 = (matrix.M11 * matrix.M22 - matrix.M12 * matrix.M21) * determinantInverse;\n\n            result.M11 = m11;\n            result.M12 = m12;\n            result.M13 = m13;\n\n            result.M21 = m21;\n            result.M22 = m22;\n            result.M23 = m23;\n\n            result.M31 = m31;\n            result.M32 = m32;\n            result.M33 = m33;\n        }\n\n        /// <summary>\n        /// Inverts the largest nonsingular submatrix in the matrix, excluding 2x2's that involve M13 or M31, and excluding 1x1's that include nondiagonal elements.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to be inverted.</param>\n        /// <param name=\"result\">Inverted matrix.</param>\n        public static void AdaptiveInvert(ref Matrix3x3 matrix, out Matrix3x3 result)\n        {\n            int submatrix;\n            float determinantInverse = 1 / matrix.AdaptiveDeterminant(out submatrix);\n            float m11, m12, m13, m21, m22, m23, m31, m32, m33;\n            switch (submatrix)\n            {\n                case 0: //Full matrix.\n                    m11 = (matrix.M22 * matrix.M33 - matrix.M23 * matrix.M32) * determinantInverse;\n                    m12 = (matrix.M13 * matrix.M32 - matrix.M33 * matrix.M12) * determinantInverse;\n                    m13 = (matrix.M12 * matrix.M23 - matrix.M22 * matrix.M13) * determinantInverse;\n\n                    m21 = (matrix.M23 * matrix.M31 - matrix.M21 * matrix.M33) * determinantInverse;\n                    m22 = (matrix.M11 * matrix.M33 - matrix.M13 * matrix.M31) * determinantInverse;\n                    m23 = (matrix.M13 * matrix.M21 - matrix.M11 * matrix.M23) * determinantInverse;\n\n                    m31 = (matrix.M21 * matrix.M32 - matrix.M22 * matrix.M31) * determinantInverse;\n                    m32 = (matrix.M12 * matrix.M31 - matrix.M11 * matrix.M32) * determinantInverse;\n                    m33 = (matrix.M11 * matrix.M22 - matrix.M12 * matrix.M21) * determinantInverse;\n                    break;\n                case 1: //Upper left matrix, m11, m12, m21, m22.\n                    m11 = matrix.M22 * determinantInverse;\n                    m12 = -matrix.M12 * determinantInverse;\n                    m13 = 0;\n\n                    m21 = -matrix.M21 * determinantInverse;\n                    m22 = matrix.M11 * determinantInverse;\n                    m23 = 0;\n\n                    m31 = 0;\n                    m32 = 0;\n                    m33 = 0;\n                    break;\n                case 2: //Lower right matrix, m22, m23, m32, m33.\n                    m11 = 0;\n                    m12 = 0;\n                    m13 = 0;\n\n                    m21 = 0;\n                    m22 = matrix.M33 * determinantInverse;\n                    m23 = -matrix.M23 * determinantInverse;\n\n                    m31 = 0;\n                    m32 = -matrix.M32 * determinantInverse;\n                    m33 = matrix.M22 * determinantInverse;\n                    break;\n                case 3: //Corners, m11, m31, m13, m33.\n                    m11 = matrix.M33 * determinantInverse;\n                    m12 = 0;\n                    m13 = -matrix.M13 * determinantInverse;\n\n                    m21 = 0;\n                    m22 = 0;\n                    m23 = 0;\n\n                    m31 = -matrix.M31 * determinantInverse;\n                    m32 = 0;\n                    m33 = matrix.M11 * determinantInverse;\n                    break;\n                case 4: //M11\n                    m11 = 1 / matrix.M11;\n                    m12 = 0;\n                    m13 = 0;\n\n                    m21 = 0;\n                    m22 = 0;\n                    m23 = 0;\n\n                    m31 = 0;\n                    m32 = 0;\n                    m33 = 0;\n                    break;\n                case 5: //M22\n                    m11 = 0;\n                    m12 = 0;\n                    m13 = 0;\n\n                    m21 = 0;\n                    m22 = 1 / matrix.M22;\n                    m23 = 0;\n\n                    m31 = 0;\n                    m32 = 0;\n                    m33 = 0;\n                    break;\n                case 6: //M33\n                    m11 = 0;\n                    m12 = 0;\n                    m13 = 0;\n\n                    m21 = 0;\n                    m22 = 0;\n                    m23 = 0;\n\n                    m31 = 0;\n                    m32 = 0;\n                    m33 = 1 / matrix.M33;\n                    break;\n                default: //Completely singular.\n                    m11 = 0; m12 = 0; m13 = 0; m21 = 0; m22 = 0; m23 = 0; m31 = 0; m32 = 0; m33 = 0;\n                    break;\n            }\n\n            result.M11 = m11;\n            result.M12 = m12;\n            result.M13 = m13;\n\n            result.M21 = m21;\n            result.M22 = m22;\n            result.M23 = m23;\n\n            result.M31 = m31;\n            result.M32 = m32;\n            result.M33 = m33;\n        }\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <returns>Product of the multiplication.</returns>\n        public static Matrix3x3 operator *(Matrix3x3 a, Matrix3x3 b)\n        {\n            Matrix3x3 result;\n            float resultM11 = a.M11 * b.M11 + a.M12 * b.M21 + a.M13 * b.M31;\n            float resultM12 = a.M11 * b.M12 + a.M12 * b.M22 + a.M13 * b.M32;\n            float resultM13 = a.M11 * b.M13 + a.M12 * b.M23 + a.M13 * b.M33;\n\n            float resultM21 = a.M21 * b.M11 + a.M22 * b.M21 + a.M23 * b.M31;\n            float resultM22 = a.M21 * b.M12 + a.M22 * b.M22 + a.M23 * b.M32;\n            float resultM23 = a.M21 * b.M13 + a.M22 * b.M23 + a.M23 * b.M33;\n\n            float resultM31 = a.M31 * b.M11 + a.M32 * b.M21 + a.M33 * b.M31;\n            float resultM32 = a.M31 * b.M12 + a.M32 * b.M22 + a.M33 * b.M32;\n            float resultM33 = a.M31 * b.M13 + a.M32 * b.M23 + a.M33 * b.M33;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n            result.M13 = resultM13;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n            result.M23 = resultM23;\n\n            result.M31 = resultM31;\n            result.M32 = resultM32;\n            result.M33 = resultM33;\n            return result;\n        }        \n\n        /// <summary>\n        /// Scales all components of the matrix by the given value.\n        /// </summary>\n        /// <param name=\"m\">First matrix to multiply.</param>\n        /// <param name=\"f\">Scaling value to apply to all components of the matrix.</param>\n        /// <returns>Product of the multiplication.</returns>\n        public static Matrix3x3 operator *(Matrix3x3 m, float f)\n        {\n            Matrix3x3 result;\n            Multiply(ref m, f, out result);\n            return result;\n        }\n\n        /// <summary>\n        /// Scales all components of the matrix by the given value.\n        /// </summary>\n        /// <param name=\"m\">First matrix to multiply.</param>\n        /// <param name=\"f\">Scaling value to apply to all components of the matrix.</param>\n        /// <returns>Product of the multiplication.</returns>\n        public static Matrix3x3 operator *(float f, Matrix3x3 m)\n        {\n            Matrix3x3 result;\n            Multiply(ref m, f, out result);\n            return result;\n        }\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void Multiply(ref Matrix3x3 a, ref Matrix3x3 b, out Matrix3x3 result)\n        {\n            float resultM11 = a.M11 * b.M11 + a.M12 * b.M21 + a.M13 * b.M31;\n            float resultM12 = a.M11 * b.M12 + a.M12 * b.M22 + a.M13 * b.M32;\n            float resultM13 = a.M11 * b.M13 + a.M12 * b.M23 + a.M13 * b.M33;\n\n            float resultM21 = a.M21 * b.M11 + a.M22 * b.M21 + a.M23 * b.M31;\n            float resultM22 = a.M21 * b.M12 + a.M22 * b.M22 + a.M23 * b.M32;\n            float resultM23 = a.M21 * b.M13 + a.M22 * b.M23 + a.M23 * b.M33;\n\n            float resultM31 = a.M31 * b.M11 + a.M32 * b.M21 + a.M33 * b.M31;\n            float resultM32 = a.M31 * b.M12 + a.M32 * b.M22 + a.M33 * b.M32;\n            float resultM33 = a.M31 * b.M13 + a.M32 * b.M23 + a.M33 * b.M33;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n            result.M13 = resultM13;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n            result.M23 = resultM23;\n\n            result.M31 = resultM31;\n            result.M32 = resultM32;\n            result.M33 = resultM33;\n        }\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void Multiply(ref Matrix3x3 a, ref Matrix b, out Matrix3x3 result)\n        {\n            float resultM11 = a.M11 * b.M11 + a.M12 * b.M21 + a.M13 * b.M31;\n            float resultM12 = a.M11 * b.M12 + a.M12 * b.M22 + a.M13 * b.M32;\n            float resultM13 = a.M11 * b.M13 + a.M12 * b.M23 + a.M13 * b.M33;\n\n            float resultM21 = a.M21 * b.M11 + a.M22 * b.M21 + a.M23 * b.M31;\n            float resultM22 = a.M21 * b.M12 + a.M22 * b.M22 + a.M23 * b.M32;\n            float resultM23 = a.M21 * b.M13 + a.M22 * b.M23 + a.M23 * b.M33;\n\n            float resultM31 = a.M31 * b.M11 + a.M32 * b.M21 + a.M33 * b.M31;\n            float resultM32 = a.M31 * b.M12 + a.M32 * b.M22 + a.M33 * b.M32;\n            float resultM33 = a.M31 * b.M13 + a.M32 * b.M23 + a.M33 * b.M33;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n            result.M13 = resultM13;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n            result.M23 = resultM23;\n\n            result.M31 = resultM31;\n            result.M32 = resultM32;\n            result.M33 = resultM33;\n        }\n\n        /// <summary>\n        /// Multiplies the two matrices.\n        /// </summary>\n        /// <param name=\"a\">First matrix to multiply.</param>\n        /// <param name=\"b\">Second matrix to multiply.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void Multiply(ref Matrix a, ref Matrix3x3 b, out Matrix3x3 result)\n        {\n            float resultM11 = a.M11 * b.M11 + a.M12 * b.M21 + a.M13 * b.M31;\n            float resultM12 = a.M11 * b.M12 + a.M12 * b.M22 + a.M13 * b.M32;\n            float resultM13 = a.M11 * b.M13 + a.M12 * b.M23 + a.M13 * b.M33;\n\n            float resultM21 = a.M21 * b.M11 + a.M22 * b.M21 + a.M23 * b.M31;\n            float resultM22 = a.M21 * b.M12 + a.M22 * b.M22 + a.M23 * b.M32;\n            float resultM23 = a.M21 * b.M13 + a.M22 * b.M23 + a.M23 * b.M33;\n\n            float resultM31 = a.M31 * b.M11 + a.M32 * b.M21 + a.M33 * b.M31;\n            float resultM32 = a.M31 * b.M12 + a.M32 * b.M22 + a.M33 * b.M32;\n            float resultM33 = a.M31 * b.M13 + a.M32 * b.M23 + a.M33 * b.M33;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n            result.M13 = resultM13;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n            result.M23 = resultM23;\n\n            result.M31 = resultM31;\n            result.M32 = resultM32;\n            result.M33 = resultM33;\n        }\n\n\n        /// <summary>\n        /// Multiplies a transposed matrix with another matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to be multiplied.</param>\n        /// <param name=\"transpose\">Matrix to be transposed and multiplied.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void MultiplyTransposed(ref Matrix3x3 transpose, ref Matrix3x3 matrix, out Matrix3x3 result)\n        {\n            float resultM11 = transpose.M11 * matrix.M11 + transpose.M21 * matrix.M21 + transpose.M31 * matrix.M31;\n            float resultM12 = transpose.M11 * matrix.M12 + transpose.M21 * matrix.M22 + transpose.M31 * matrix.M32;\n            float resultM13 = transpose.M11 * matrix.M13 + transpose.M21 * matrix.M23 + transpose.M31 * matrix.M33;\n\n            float resultM21 = transpose.M12 * matrix.M11 + transpose.M22 * matrix.M21 + transpose.M32 * matrix.M31;\n            float resultM22 = transpose.M12 * matrix.M12 + transpose.M22 * matrix.M22 + transpose.M32 * matrix.M32;\n            float resultM23 = transpose.M12 * matrix.M13 + transpose.M22 * matrix.M23 + transpose.M32 * matrix.M33;\n\n            float resultM31 = transpose.M13 * matrix.M11 + transpose.M23 * matrix.M21 + transpose.M33 * matrix.M31;\n            float resultM32 = transpose.M13 * matrix.M12 + transpose.M23 * matrix.M22 + transpose.M33 * matrix.M32;\n            float resultM33 = transpose.M13 * matrix.M13 + transpose.M23 * matrix.M23 + transpose.M33 * matrix.M33;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n            result.M13 = resultM13;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n            result.M23 = resultM23;\n\n            result.M31 = resultM31;\n            result.M32 = resultM32;\n            result.M33 = resultM33;\n        }\n\n        /// <summary>\n        /// Multiplies a matrix with a transposed matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to be multiplied.</param>\n        /// <param name=\"transpose\">Matrix to be transposed and multiplied.</param>\n        /// <param name=\"result\">Product of the multiplication.</param>\n        public static void MultiplyByTransposed(ref Matrix3x3 matrix, ref Matrix3x3 transpose, out Matrix3x3 result)\n        {\n            float resultM11 = matrix.M11 * transpose.M11 + matrix.M12 * transpose.M12 + matrix.M13 * transpose.M13;\n            float resultM12 = matrix.M11 * transpose.M21 + matrix.M12 * transpose.M22 + matrix.M13 * transpose.M23;\n            float resultM13 = matrix.M11 * transpose.M31 + matrix.M12 * transpose.M32 + matrix.M13 * transpose.M33;\n\n            float resultM21 = matrix.M21 * transpose.M11 + matrix.M22 * transpose.M12 + matrix.M23 * transpose.M13;\n            float resultM22 = matrix.M21 * transpose.M21 + matrix.M22 * transpose.M22 + matrix.M23 * transpose.M23;\n            float resultM23 = matrix.M21 * transpose.M31 + matrix.M22 * transpose.M32 + matrix.M23 * transpose.M33;\n\n            float resultM31 = matrix.M31 * transpose.M11 + matrix.M32 * transpose.M12 + matrix.M33 * transpose.M13;\n            float resultM32 = matrix.M31 * transpose.M21 + matrix.M32 * transpose.M22 + matrix.M33 * transpose.M23;\n            float resultM33 = matrix.M31 * transpose.M31 + matrix.M32 * transpose.M32 + matrix.M33 * transpose.M33;\n\n            result.M11 = resultM11;\n            result.M12 = resultM12;\n            result.M13 = resultM13;\n\n            result.M21 = resultM21;\n            result.M22 = resultM22;\n            result.M23 = resultM23;\n\n            result.M31 = resultM31;\n            result.M32 = resultM32;\n            result.M33 = resultM33;\n        }\n\n        /// <summary>\n        /// Scales all components of the matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to scale.</param>\n        /// <param name=\"scale\">Amount to scale.</param>\n        /// <param name=\"result\">Scaled matrix.</param>\n        public static void Multiply(ref Matrix3x3 matrix, float scale, out Matrix3x3 result)\n        {\n            result.M11 = matrix.M11 * scale;\n            result.M12 = matrix.M12 * scale;\n            result.M13 = matrix.M13 * scale;\n\n            result.M21 = matrix.M21 * scale;\n            result.M22 = matrix.M22 * scale;\n            result.M23 = matrix.M23 * scale;\n\n            result.M31 = matrix.M31 * scale;\n            result.M32 = matrix.M32 * scale;\n            result.M33 = matrix.M33 * scale;\n        }\n\n        /// <summary>\n        /// Negates every element in the matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to negate.</param>\n        /// <param name=\"result\">Negated matrix.</param>\n        public static void Negate(ref Matrix3x3 matrix, out Matrix3x3 result)\n        {\n            result.M11 = -matrix.M11;\n            result.M12 = -matrix.M12;\n            result.M13 = -matrix.M13;\n\n            result.M21 = -matrix.M21;\n            result.M22 = -matrix.M22;\n            result.M23 = -matrix.M23;\n\n            result.M31 = -matrix.M31;\n            result.M32 = -matrix.M32;\n            result.M33 = -matrix.M33;\n        }\n\n        /// <summary>\n        /// Subtracts the two matrices from each other on a per-element basis.\n        /// </summary>\n        /// <param name=\"a\">First matrix to subtract.</param>\n        /// <param name=\"b\">Second matrix to subtract.</param>\n        /// <param name=\"result\">Difference of the two matrices.</param>\n        public static void Subtract(ref Matrix3x3 a, ref Matrix3x3 b, out Matrix3x3 result)\n        {\n            float m11 = a.M11 - b.M11;\n            float m12 = a.M12 - b.M12;\n            float m13 = a.M13 - b.M13;\n\n            float m21 = a.M21 - b.M21;\n            float m22 = a.M22 - b.M22;\n            float m23 = a.M23 - b.M23;\n\n            float m31 = a.M31 - b.M31;\n            float m32 = a.M32 - b.M32;\n            float m33 = a.M33 - b.M33;\n\n            result.M11 = m11;\n            result.M12 = m12;\n            result.M13 = m13;\n\n            result.M21 = m21;\n            result.M22 = m22;\n            result.M23 = m23;\n\n            result.M31 = m31;\n            result.M32 = m32;\n            result.M33 = m33;\n        }\n\n        /// <summary>\n        /// Creates a 4x4 matrix from a 3x3 matrix.\n        /// </summary>\n        /// <param name=\"a\">3x3 matrix.</param>\n        /// <param name=\"b\">Created 4x4 matrix.</param>\n        public static void ToMatrix4X4(ref Matrix3x3 a, out Matrix b)\n        {\n#if !WINDOWS\n            b = new Matrix();\n#endif\n            b.M11 = a.M11;\n            b.M12 = a.M12;\n            b.M13 = a.M13;\n\n            b.M21 = a.M21;\n            b.M22 = a.M22;\n            b.M23 = a.M23;\n\n            b.M31 = a.M31;\n            b.M32 = a.M32;\n            b.M33 = a.M33;\n\n            b.M44 = 1;\n            b.M14 = 0;\n            b.M24 = 0;\n            b.M34 = 0;\n            b.M41 = 0;\n            b.M42 = 0;\n            b.M43 = 0;\n        }\n\n        /// <summary>\n        /// Creates a 4x4 matrix from a 3x3 matrix.\n        /// </summary>\n        /// <param name=\"a\">3x3 matrix.</param>\n        /// <returns>Created 4x4 matrix.</returns>\n        public static Matrix ToMatrix4X4(Matrix3x3 a)\n        {\n#if !WINDOWS\n            Matrix b = new Matrix();\n#else\n            Matrix b;\n#endif\n            b.M11 = a.M11;\n            b.M12 = a.M12;\n            b.M13 = a.M13;\n\n            b.M21 = a.M21;\n            b.M22 = a.M22;\n            b.M23 = a.M23;\n\n            b.M31 = a.M31;\n            b.M32 = a.M32;\n            b.M33 = a.M33;\n\n            b.M44 = 1;\n            b.M14 = 0;\n            b.M24 = 0;\n            b.M34 = 0;\n            b.M41 = 0;\n            b.M42 = 0;\n            b.M43 = 0;\n            return b;\n        }\n\n        /// <summary>\n        /// Transforms the vector by the matrix.\n        /// </summary>\n        /// <param name=\"v\">Vector3 to transform.</param>\n        /// <param name=\"matrix\">Matrix to use as the transformation.</param>\n        /// <returns>Product of the transformation.</returns>\n        public static Vector3 Transform(Vector3 v, Matrix3x3 matrix)\n        {\n            Vector3 result;\n#if !WINDOWS\n            result = new Vector3();\n#endif\n            float vX = v.X;\n            float vY = v.Y;\n            float vZ = v.Z;\n\n            result.X = vX * matrix.M11 + vY * matrix.M21 + vZ * matrix.M31;\n            result.Y = vX * matrix.M12 + vY * matrix.M22 + vZ * matrix.M32;\n            result.Z = vX * matrix.M13 + vY * matrix.M23 + vZ * matrix.M33;\n            return result;\n        }\n\n        /// <summary>\n        /// Transforms the vector by the matrix.\n        /// </summary>\n        /// <param name=\"v\">Vector3 to transform.</param>\n        /// <param name=\"matrix\">Matrix to use as the transformation.</param>\n        /// <param name=\"result\">Product of the transformation.</param>\n        public static void Transform(ref Vector3 v, ref Matrix3x3 matrix, out Vector3 result)\n        {\n            float vX = v.X;\n            float vY = v.Y;\n            float vZ = v.Z;\n#if !WINDOWS\n            result = new Vector3();\n#endif\n            result.X = vX * matrix.M11 + vY * matrix.M21 + vZ * matrix.M31;\n            result.Y = vX * matrix.M12 + vY * matrix.M22 + vZ * matrix.M32;\n            result.Z = vX * matrix.M13 + vY * matrix.M23 + vZ * matrix.M33;\n        }\n\n        /// <summary>\n        /// Transforms the vector by the matrix.\n        /// </summary>\n        /// <param name=\"v\">Vector3 to transform.</param>\n        /// <param name=\"matrix\">Matrix to use as the transformation.</param>\n        /// <param name=\"result\">Product of the transformation.</param>\n        public static void Transform(ref Vector3 v, ref Matrix matrix, out Vector3 result)\n        {\n            float vX = v.X;\n            float vY = v.Y;\n            float vZ = v.Z;\n#if !WINDOWS\n            result = new Vector3();\n#endif\n            result.X = vX * matrix.M11 + vY * matrix.M21 + vZ * matrix.M31;\n            result.Y = vX * matrix.M12 + vY * matrix.M22 + vZ * matrix.M32;\n            result.Z = vX * matrix.M13 + vY * matrix.M23 + vZ * matrix.M33;\n        }\n\n        /// <summary>\n        /// Transforms the vector by the matrix's transpose.\n        /// </summary>\n        /// <param name=\"v\">Vector3 to transform.</param>\n        /// <param name=\"matrix\">Matrix to use as the transformation transpose.</param>\n        /// <returns>Product of the transformation.</returns>\n        public static Vector3 TransformTranspose(Vector3 v, Matrix3x3 matrix)\n        {\n            float vX = v.X;\n            float vY = v.Y;\n            float vZ = v.Z;\n            Vector3 result;\n#if !WINDOWS\n            result = new Vector3();\n#endif\n            result.X = vX * matrix.M11 + vY * matrix.M12 + vZ * matrix.M13;\n            result.Y = vX * matrix.M21 + vY * matrix.M22 + vZ * matrix.M23;\n            result.Z = vX * matrix.M31 + vY * matrix.M32 + vZ * matrix.M33;\n            return result;\n        }\n\n        /// <summary>\n        /// Transforms the vector by the matrix's transpose.\n        /// </summary>\n        /// <param name=\"v\">Vector3 to transform.</param>\n        /// <param name=\"matrix\">Matrix to use as the transformation transpose.</param>\n        /// <param name=\"result\">Product of the transformation.</param>\n        public static void TransformTranspose(ref Vector3 v, ref Matrix3x3 matrix, out Vector3 result)\n        {\n            float vX = v.X;\n            float vY = v.Y;\n            float vZ = v.Z;\n#if !WINDOWS\n            result = new Vector3();\n#endif\n            result.X = vX * matrix.M11 + vY * matrix.M12 + vZ * matrix.M13;\n            result.Y = vX * matrix.M21 + vY * matrix.M22 + vZ * matrix.M23;\n            result.Z = vX * matrix.M31 + vY * matrix.M32 + vZ * matrix.M33;\n        }\n\n        /// <summary>\n        /// Transforms the vector by the matrix's transpose.\n        /// </summary>\n        /// <param name=\"v\">Vector3 to transform.</param>\n        /// <param name=\"matrix\">Matrix to use as the transformation transpose.</param>\n        /// <param name=\"result\">Product of the transformation.</param>\n        public static void TransformTranspose(ref Vector3 v, ref Matrix matrix, out Vector3 result)\n        {\n            float vX = v.X;\n            float vY = v.Y;\n            float vZ = v.Z;\n#if !WINDOWS\n            result = new Vector3();\n#endif\n            result.X = vX * matrix.M11 + vY * matrix.M12 + vZ * matrix.M13;\n            result.Y = vX * matrix.M21 + vY * matrix.M22 + vZ * matrix.M23;\n            result.Z = vX * matrix.M31 + vY * matrix.M32 + vZ * matrix.M33;\n        }\n\n        /// <summary>\n        /// Computes the transposed matrix of a matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to transpose.</param>\n        /// <param name=\"result\">Transposed matrix.</param>\n        public static void Transpose(ref Matrix3x3 matrix, out Matrix3x3 result)\n        {\n            float m21 = matrix.M12;\n            float m31 = matrix.M13;\n            float m12 = matrix.M21;\n            float m32 = matrix.M23;\n            float m13 = matrix.M31;\n            float m23 = matrix.M32;\n\n            result.M11 = matrix.M11;\n            result.M12 = m12;\n            result.M13 = m13;\n            result.M21 = m21;\n            result.M22 = matrix.M22;\n            result.M23 = m23;\n            result.M31 = m31;\n            result.M32 = m32;\n            result.M33 = matrix.M33;\n        }\n\n        /// <summary>\n        /// Computes the transposed matrix of a matrix.\n        /// </summary>\n        /// <param name=\"matrix\">Matrix to transpose.</param>\n        /// <param name=\"result\">Transposed matrix.</param>\n        public static void Transpose(ref Matrix matrix, out Matrix3x3 result)\n        {\n            float m21 = matrix.M12;\n            float m31 = matrix.M13;\n            float m12 = matrix.M21;\n            float m32 = matrix.M23;\n            float m13 = matrix.M31;\n            float m23 = matrix.M32;\n\n            result.M11 = matrix.M11;\n            result.M12 = m12;\n            result.M13 = m13;\n            result.M21 = m21;\n            result.M22 = matrix.M22;\n            result.M23 = m23;\n            result.M31 = m31;\n            result.M32 = m32;\n            result.M33 = matrix.M33;\n        }\n\n        /// <summary>\n        /// Creates a string representation of the matrix.\n        /// </summary>\n        /// <returns>A string representation of the matrix.</returns>\n        public override string ToString()\n        {\n            return \"{\" + M11 + \", \" + M12 + \", \" + M13 + \"} \" +\n                   \"{\" + M21 + \", \" + M22 + \", \" + M23 + \"} \" +\n                   \"{\" + M31 + \", \" + M32 + \", \" + M33 + \"}\";\n        }\n\n        /// <summary>\n        /// Calculates the determinant of the matrix.\n        /// </summary>\n        /// <returns>The matrix's determinant.</returns>\n        public float Determinant()\n        {\n            return M11 * M22 * M33 + M12 * M23 * M31 + M13 * M21 * M32 -\n                   M31 * M22 * M13 - M32 * M23 * M11 - M33 * M21 * M12;\n        }\n\n        /// <summary>\n        /// Calculates the determinant of largest nonsingular submatrix, excluding 2x2's that involve M13 or M31, and excluding all 1x1's that involve nondiagonal elements.\n        /// </summary>\n        /// <param name=\"subMatrixCode\">Represents the submatrix that was used to compute the determinant.\n        /// 0 is the full 3x3.  1 is the upper left 2x2.  2 is the lower right 2x2.  3 is the four corners.\n        /// 4 is M11.  5 is M22.  6 is M33.</param>\n        /// <returns>The matrix's determinant.</returns>\n        internal float AdaptiveDeterminant(out int subMatrixCode)\n        {\n            //Try the full matrix first.\n            float determinant = M11 * M22 * M33 + M12 * M23 * M31 + M13 * M21 * M32 -\n                                M31 * M22 * M13 - M32 * M23 * M11 - M33 * M21 * M12;\n            if (determinant != 0) //This could be a little numerically flimsy.  Fortunately, the way this method is used, that doesn't matter!\n            {\n                subMatrixCode = 0;\n                return determinant;\n            }\n            //Try m11, m12, m21, m22.\n            determinant = M11 * M22 - M12 * M21;\n            if (determinant != 0)\n            {\n                subMatrixCode = 1;\n                return determinant;\n            }\n            //Try m22, m23, m32, m33.\n            determinant = M22 * M33 - M23 * M32;\n            if (determinant != 0)\n            {\n                subMatrixCode = 2;\n                return determinant;\n            }\n            //Try m11, m13, m31, m33.\n            determinant = M11 * M33 - M13 * M12;\n            if (determinant != 0)\n            {\n                subMatrixCode = 3;\n                return determinant;\n            }\n            //Try m11.\n            if (M11 != 0)\n            {\n                subMatrixCode = 4;\n                return M11;\n            }\n            //Try m22.\n            if (M22 != 0)\n            {\n                subMatrixCode = 5;\n                return M22;\n            }\n            //Try m33.\n            if (M33 != 0)\n            {\n                subMatrixCode = 6;\n                return M33;\n            }\n            //It's completely singular!\n            subMatrixCode = -1;\n            return 0;\n        }\n\n        /// <summary>\n        /// Constructs a quaternion from a 3x3 rotation matrix.\n        /// </summary>\n        /// <param name=\"r\">Rotation matrix to create the quaternion from.</param>\n        /// <param name=\"q\">Quaternion based on the rotation matrix.</param>\n        public static void CreateQuaternion(ref Matrix3x3 r, out Quaternion q)\n        {\n            float trace = r.M11 + r.M22 + r.M33;\n#if !WINDOWS\n            q = new Quaternion();\n#endif\n            if (trace >= 0)\n            {\n                var S = (float)System.Math.Sqrt(trace + 1.0) * 2; // S=4*qw \n                var inverseS = 1 / S;\n                q.W = 0.25f * S;\n                q.X = (r.M23 - r.M32) * inverseS;\n                q.Y = (r.M31 - r.M13) * inverseS;\n                q.Z = (r.M12 - r.M21) * inverseS;\n            }\n            else if ((r.M11 > r.M22) & (r.M11 > r.M33))\n            {\n                var S = (float)System.Math.Sqrt(1.0 + r.M11 - r.M22 - r.M33) * 2; // S=4*qx \n                var inverseS = 1 / S;\n                q.W = (r.M23 - r.M32) * inverseS;\n                q.X = 0.25f * S;\n                q.Y = (r.M21 + r.M12) * inverseS;\n                q.Z = (r.M31 + r.M13) * inverseS;\n            }\n            else if (r.M22 > r.M33)\n            {\n                var S = (float)System.Math.Sqrt(1.0 + r.M22 - r.M11 - r.M33) * 2; // S=4*qy\n                var inverseS = 1 / S;\n                q.W = (r.M31 - r.M13) * inverseS;\n                q.X = (r.M21 + r.M12) * inverseS;\n                q.Y = 0.25f * S;\n                q.Z = (r.M32 + r.M23) * inverseS;\n            }\n            else\n            {\n                var S = (float)System.Math.Sqrt(1.0 + r.M33 - r.M11 - r.M22) * 2; // S=4*qz\n                var inverseS = 1 / S;\n                q.W = (r.M12 - r.M21) * inverseS;\n                q.X = (r.M31 + r.M13) * inverseS;\n                q.Y = (r.M32 + r.M23) * inverseS;\n                q.Z = 0.25f * S;\n            }\n        }\n\n        /// <summary>\n        /// Constructs a quaternion from a 3x3 rotation matrix.\n        /// </summary>\n        /// <param name=\"r\">Rotation matrix to create the quaternion from.</param>\n        /// <returns>Quaternion based on the rotation matrix.</returns>\n        public static Quaternion CreateQuaternion(Matrix3x3 r)\n        {\n            Quaternion result;\n            CreateQuaternion(ref r, out result);\n            return result;\n        }\n\n        /// <summary>\n        /// Creates a 3x3 matrix representing the orientation stored in the quaternion.\n        /// </summary>\n        /// <param name=\"quaternion\">Quaternion to use to create a matrix.</param>\n        /// <param name=\"result\">Matrix representing the quaternion's orientation.</param>\n        public static void CreateFromQuaternion(ref Quaternion quaternion, out Matrix3x3 result)\n        {\n\n            float XX = 2 * quaternion.X * quaternion.X;\n            float YY = 2 * quaternion.Y * quaternion.Y;\n            float ZZ = 2 * quaternion.Z * quaternion.Z;\n            float XY = 2 * quaternion.X * quaternion.Y;\n            float XZ = 2 * quaternion.X * quaternion.Z;\n            float XW = 2 * quaternion.X * quaternion.W;\n            float YZ = 2 * quaternion.Y * quaternion.Z;\n            float YW = 2 * quaternion.Y * quaternion.W;\n            float ZW = 2 * quaternion.Z * quaternion.W;\n\n            result.M11 = 1 - YY - ZZ;\n            result.M21 = XY - ZW;\n            result.M31 = XZ + YW;\n\n            result.M12 = XY + ZW;\n            result.M22 = 1 - XX - ZZ;\n            result.M32 = YZ - XW;\n\n            result.M13 = XZ - YW;\n            result.M23 = YZ + XW;\n            result.M33 = 1 - XX - YY;\n        }\n\n        /// <summary>\n        /// Creates a 3x3 matrix representing the orientation stored in the quaternion.\n        /// </summary>\n        /// <param name=\"quaternion\">Quaternion to use to create a matrix.</param>\n        /// <returns>Matrix representing the quaternion's orientation.</returns>\n        public static Matrix3x3 CreateFromQuaternion(Quaternion quaternion)\n        {\n            Matrix3x3 result;\n            CreateFromQuaternion(ref quaternion, out result);\n            return result;\n        }\n\n        /// <summary>\n        /// Computes the outer product of the given vectors.\n        /// </summary>\n        /// <param name=\"a\">First vector.</param>\n        /// <param name=\"b\">Second vector.</param>\n        /// <param name=\"result\">Outer product result.</param>\n        public static void CreateOuterProduct(ref Vector3 a, ref Vector3 b, out Matrix3x3 result)\n        {\n            result.M11 = a.X * b.X;\n            result.M12 = a.X * b.Y;\n            result.M13 = a.X * b.Z;\n\n            result.M21 = a.Y * b.X;\n            result.M22 = a.Y * b.Y;\n            result.M23 = a.Y * b.Z;\n\n            result.M31 = a.Z * b.X;\n            result.M32 = a.Z * b.Y;\n            result.M33 = a.Z * b.Z;\n        }\n\n        /// <summary>\n        /// Creates a matrix representing a rotation of a given angle around a given axis.\n        /// </summary>\n        /// <param name=\"axis\">Axis around which to rotate.</param>\n        /// <param name=\"angle\">Amount to rotate.</param>\n        /// <returns>Matrix representing the rotation.</returns>\n        public static Matrix3x3 CreateFromAxisAngle(Vector3 axis, float angle)\n        {\n            Matrix3x3 toReturn;\n            CreateFromAxisAngle(ref axis, angle, out toReturn);\n            return toReturn;\n        }\n\n        /// <summary>\n        /// Creates a matrix representing a rotation of a given angle around a given axis.\n        /// </summary>\n        /// <param name=\"axis\">Axis around which to rotate.</param>\n        /// <param name=\"angle\">Amount to rotate.</param>\n        /// <param name=\"result\">Matrix representing the rotation.</param>\n        public static void CreateFromAxisAngle(ref Vector3 axis, float angle, out Matrix3x3 result)\n        {\n            float xx = axis.X * axis.X;\n            float yy = axis.Y * axis.Y;\n            float zz = axis.Z * axis.Z;\n            float xy = axis.X * axis.Y;\n            float xz = axis.X * axis.Z;\n            float yz = axis.Y * axis.Z;\n\n            float sinAngle = (float)System.Math.Sin(angle);\n            float oneMinusCosAngle = 1 - (float)System.Math.Cos(angle);\n\n            result.M11 = 1 + oneMinusCosAngle * (xx - 1);\n            result.M21 = -axis.Z * sinAngle + oneMinusCosAngle * xy;\n            result.M31 = axis.Y * sinAngle + oneMinusCosAngle * xz;\n\n            result.M12 = axis.Z * sinAngle + oneMinusCosAngle * xy;\n            result.M22 = 1 + oneMinusCosAngle * (yy - 1);\n            result.M32 = -axis.X * sinAngle + oneMinusCosAngle * yz;\n\n            result.M13 = -axis.Y * sinAngle + oneMinusCosAngle * xz;\n            result.M23 = axis.X * sinAngle + oneMinusCosAngle * yz;\n            result.M33 = 1 + oneMinusCosAngle * (zz - 1);\n        }\n\n\n\n\n\n\n    }\n}"
  },
  {
    "path": "BEPUutilities/PermutationMapper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace BEPUutilities\n{\n    /// <summary>\n    /// Maps indices to permuted versions of the indices.\n    /// </summary>\n    public class PermutationMapper\n    {\n        /// <summary>\n        /// Constructs a new permutation mapper.\n        /// </summary>\n        public PermutationMapper()\n        {\n            PermutationIndex = 0;\n        }\n\n        /// <summary>\n        /// Gets or sets the permutation index used by the solver.  If the simulation is restarting from a given frame,\n        /// setting this index to be consistent is required for deterministic results.\n        /// </summary>\n        public int PermutationIndex\n        {\n            get\n            {\n                return primeIndex;\n            }\n            set\n            {\n                primeIndex = value % primes.Length;\n                currentPrime = primes[primeIndex = (primeIndex + 1) % primes.Length];\n            }\n        }\n\n        long currentPrime;\n        int primeIndex;\n        static long[] primes = {\n                                    472882049, 492876847,\n                                    492876863, 512927357,\n                                    512927377, 533000389,\n                                    533000401, 553105243,\n                                    553105253, 573259391,\n                                    573259433, 593441843,\n                                    593441861, 613651349,\n                                    613651369, 633910099,\n                                    633910111, 654188383,\n                                    654188429, 674506081,\n                                    674506111, 694847533,\n                                    694847539, 715225739,\n                                    715225741, 735632791,\n                                    735632797, 756065159,\n                                    756065179, 776531401,\n                                    776531419, 797003413,\n                                    797003437, 817504243,\n                                    817504253, 838041641,\n                                    838041647, 858599503,\n                                    858599509, 879190747,\n                                    879190841, 899809343,\n                                    899809363, 920419813,\n                                    920419823, 941083981,\n                                    941083987, 961748927,\n                                    961748941, 982451653\n                               };\n\n\n        /// <summary>\n        /// Gets a remapped index.\n        /// </summary>\n        /// <param name=\"index\">Original index of an element in the set to be redirected to a shuffled position.</param>\n        /// <param name=\"setSize\">Size of the set being permuted. Must be smaller than 472882049.</param>\n        /// <returns>The remapped index.</returns>\n        public long GetMappedIndex(long index, int setSize)\n        {\n            return (index * currentPrime) % setSize;\n        }\n\n        /// <summary>\n        /// Gets a remapped index.\n        /// </summary>\n        /// <param name=\"index\">Original index of an element in the set to be redirected to a shuffled position.</param>\n        /// <param name=\"setSize\">Size of the set being permuted. Must be smaller than 472882049.</param>\n        /// <returns>The remapped index.</returns>\n        public int GetMappedIndex(int index, int setSize)\n        {\n            return (int)((index * currentPrime) % setSize);\n        }\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"BEPUutilities\")]\n[assembly: AssemblyProduct(\"BEPUutilities\")]\n[assembly: AssemblyDescription(\"Extensions and helpers used by various bepu things.\")]\n[assembly: AssemblyCompany(\"Bepu Entertainment LLC.\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2012\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type. Only Windows\n// assemblies support COM.\n[assembly: ComVisible(false)]\n\n// On Windows, the following GUID is for the ID of the typelib if this\n// project is exposed to COM. On other platforms, it unique identifies the\n// title storage container when deploying this assembly to the device.\n[assembly: Guid(\"a068ca77-0b61-484b-80dd-0dac40a2043c\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n[assembly: AssemblyVersion(\"1.3.0.0\")]\n[assembly: AssemblyFileVersionAttribute(\"1.3.0.0\")]\n"
  },
  {
    "path": "BEPUutilities/RayHit.cs",
    "content": "﻿using Microsoft.Xna.Framework;\n\nnamespace BEPUutilities\n{\n    ///<summary>\n    /// Contains ray hit data.\n    ///</summary>\n    public struct RayHit\n    {\n        ///<summary>\n        /// Location of the ray hit.\n        ///</summary>\n        public Vector3 Location;\n        ///<summary>\n        /// Normal of the ray hit.\n        ///</summary>\n        public Vector3 Normal;\n        ///<summary>\n        /// T parameter of the ray hit.  \n        /// The ray hit location is equal to the ray origin added to the ray direction multiplied by T.\n        ///</summary>\n        public float T;\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/ResourceManagement/CommonResources.cs",
    "content": "﻿using System.Collections.Generic;\nusing BEPUutilities.DataStructures;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUutilities.ResourceManagement\n{\n    /// <summary>\n    /// Handles allocation and management of commonly used resources.\n    /// </summary>\n    public static class CommonResources\n    {\n        static CommonResources()\n        {\n            ResetPools();\n        }\n\n        public static void ResetPools()\n        {\n            SubPoolIntList = new LockingResourcePool<RawList<int>>();\n            SubPoolIntSet = new LockingResourcePool<HashSet<int>>();\n            SubPoolFloatList = new LockingResourcePool<RawList<float>>();\n            SubPoolVectorList = new LockingResourcePool<RawList<Vector3>>();\n            SubPoolRayHitList = new LockingResourcePool<RawList<RayHit>>();\n\n        }\n\n        static ResourcePool<RawList<RayHit>> SubPoolRayHitList;\n        static ResourcePool<RawList<int>> SubPoolIntList;\n        static ResourcePool<HashSet<int>> SubPoolIntSet;\n        static ResourcePool<RawList<float>> SubPoolFloatList;\n        static ResourcePool<RawList<Vector3>> SubPoolVectorList;\n\n        /// <summary>\n        /// Retrieves a ray hit list from the resource pool.\n        /// </summary>\n        /// <returns>Empty ray hit list.</returns>\n        public static RawList<RayHit> GetRayHitList()\n        {\n            return SubPoolRayHitList.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"list\">List to return.</param>\n        public static void GiveBack(RawList<RayHit> list)\n        {\n            list.Clear();\n            SubPoolRayHitList.GiveBack(list);\n        }\n\n        \n\n        /// <summary>\n        /// Retrieves a int list from the resource pool.\n        /// </summary>\n        /// <returns>Empty int list.</returns>\n        public static RawList<int> GetIntList()\n        {\n            return SubPoolIntList.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"list\">List to return.</param>\n        public static void GiveBack(RawList<int> list)\n        {\n            list.Clear();\n            SubPoolIntList.GiveBack(list);\n        }\n\n        /// <summary>\n        /// Retrieves a int hash set from the resource pool.\n        /// </summary>\n        /// <returns>Empty int set.</returns>\n        public static HashSet<int> GetIntSet()\n        {\n            return SubPoolIntSet.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"set\">Set to return.</param>\n        public static void GiveBack(HashSet<int> set)\n        {\n            set.Clear();\n            SubPoolIntSet.GiveBack(set);\n        }\n\n        /// <summary>\n        /// Retrieves a float list from the resource pool.\n        /// </summary>\n        /// <returns>Empty float list.</returns>\n        public static RawList<float> GetFloatList()\n        {\n            return SubPoolFloatList.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"list\">List to return.</param>\n        public static void GiveBack(RawList<float> list)\n        {\n            list.Clear();\n            SubPoolFloatList.GiveBack(list);\n        }\n\n        /// <summary>\n        /// Retrieves a Vector3 list from the resource pool.\n        /// </summary>\n        /// <returns>Empty Vector3 list.</returns>\n        public static RawList<Vector3> GetVectorList()\n        {\n            return SubPoolVectorList.Take();\n        }\n\n        /// <summary>\n        /// Returns a resource to the pool.\n        /// </summary>\n        /// <param name=\"list\">List to return.</param>\n        public static void GiveBack(RawList<Vector3> list)\n        {\n            list.Clear();\n            SubPoolVectorList.GiveBack(list);\n        }\n\n       \n    }\n}"
  },
  {
    "path": "BEPUutilities/ResourceManagement/LockingResourcePool.cs",
    "content": "﻿using System;\nusing BEPUutilities.DataStructures;\n\nnamespace BEPUutilities.ResourceManagement\n{\n    /// <summary>\n    /// Uses a spinlock to safely access resources.\n    /// </summary>\n    /// <typeparam name=\"T\">Type of object to store in the pool.</typeparam>\n    public class LockingResourcePool<T> : ResourcePool<T> where T : class, new()\n    {\n        private readonly ConcurrentDeque<T> stack;\n\n        /// <summary>\n        /// Constructs a new thread-unsafe resource pool.\n        /// </summary>\n        /// <param name=\"initialResourceCount\">Number of resources to include in the pool by default.</param>\n        /// <param name=\"initializer\">Function to initialize new instances in the resource pool with.</param>\n        public LockingResourcePool(int initialResourceCount, Action<T> initializer)\n        {\n            InstanceInitializer = initializer;\n            stack = new ConcurrentDeque<T>(initialResourceCount);\n            Initialize(initialResourceCount);\n        }\n\n        /// <summary>\n        /// Constructs a new thread-unsafe resource pool.\n        /// </summary>\n        /// <param name=\"initialResourceCount\">Number of resources to include in the pool by default.</param>\n        public LockingResourcePool(int initialResourceCount)\n            : this(initialResourceCount, null)\n        {\n        }\n\n        /// <summary>\n        /// Constructs a new thread-unsafe resource pool.\n        /// </summary>\n        public LockingResourcePool()\n            : this(10)\n        {\n        }\n\n        /// <summary>\n        /// Gets the number of resources in the pool.\n        /// Even if the resource count hits 0, resources\n        /// can still be requested; they will be allocated\n        /// dynamically.\n        /// </summary>\n        public override int Count\n        {\n            get { return stack.Count; }\n        }\n\n        /// <summary>\n        /// Gives an item back to the resource pool.\n        /// </summary>\n        /// <param name=\"item\">Item to return.</param>\n        public override void GiveBack(T item)\n        {\n            stack.Enqueue(item);\n        }\n\n\n        /// <summary>\n        /// Initializes the pool with some resources.\n        /// Throws away excess resources.\n        /// </summary>\n        /// <param name=\"initialResourceCount\">Number of resources to include.</param>\n        public override void Initialize(int initialResourceCount)\n        {\n            while (stack.Count > initialResourceCount)\n            {\n                T toRemove;\n                stack.TryUnsafeDequeueFirst(out toRemove);\n            }\n            int length = stack.lastIndex - stack.firstIndex + 1; //lastIndex is inclusive, so add 1.\n            if (InstanceInitializer != null)\n                for (int i = 0; i < length; i++)\n                {\n                    InstanceInitializer(stack.array[(stack.firstIndex + i) % stack.array.Length]);\n                }\n            while (stack.Count < initialResourceCount)\n            {\n                stack.UnsafeEnqueue(CreateNewResource());\n            }\n        }\n\n        /// <summary>\n        /// Takes an item from the resource pool.\n        /// </summary>\n        /// <returns>Item to take.</returns>\n        public override T Take()\n        {\n            T toTake;\n            if (stack.TryDequeueFirst(out toTake))\n            {\n                return toTake;\n            }\n\n            return CreateNewResource();\n        }\n\n        /// <summary>\n        /// Clears out the resource pool.\n        /// </summary>\n        public override void Clear()\n        {\n            while (stack.Count > 0)\n            {\n                T item;\n                stack.TryDequeueFirst(out item);\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUutilities/ResourceManagement/ResourcePool.cs",
    "content": "﻿using System;\n\nnamespace BEPUutilities.ResourceManagement\n{\n    /// <summary>\n    /// Manages a cache of a type of resource.\n    /// </summary>\n    /// <typeparam name=\"T\">Type of object to pool.</typeparam>\n    public abstract class ResourcePool<T> where T : class, new()\n    {\n        /// <summary>\n        /// Gets the number of resources in the pool.\n        /// Even if the resource count hits 0, resources\n        /// can still be requested; they will be allocated\n        /// dynamically.\n        /// </summary>\n        public abstract int Count { get; }\n\n        /// <summary>\n        /// Gets or sets the function that configures new instances.\n        /// This is only called once per object created for the resource pool.\n        /// </summary>\n        public Action<T> InstanceInitializer { get; set; }\n\n        /// <summary>\n        /// Gives an item back to the resource pool.\n        /// </summary>\n        /// <param name=\"item\">Item to return.</param>\n        public abstract void GiveBack(T item);\n\n        /// <summary>\n        /// Initializes the pool with some resources.\n        /// Throws away excess resources.\n        /// </summary>\n        /// <param name=\"initialResourceCount\">Number of resources to include.</param>\n        public abstract void Initialize(int initialResourceCount);\n\n        /// <summary>\n        /// Takes an item from the resource pool.\n        /// </summary>\n        /// <returns>Item to take.</returns>\n        public abstract T Take();\n\n        /// <summary>\n        /// Creates and returns a new resource.\n        /// </summary>\n        /// <returns>New resource.</returns>\n        protected T CreateNewResource()\n        {\n            var toReturn = new T();\n            if (InstanceInitializer != null)\n                InstanceInitializer(toReturn);\n            return toReturn;\n        }\n\n        /// <summary>\n        /// Removes all elements from the pool.\n        /// </summary>\n        public abstract void Clear();\n\n    }\n}"
  },
  {
    "path": "BEPUutilities/ResourceManagement/UnsafeResourcePool.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace BEPUutilities.ResourceManagement\n{\n    /// <summary>\n    /// Manages a resource type, but performs no locking to handle asynchronous access.\n    /// </summary>\n    /// <typeparam name=\"T\">Type of object to store in the pool.</typeparam>\n    public class UnsafeResourcePool<T> : ResourcePool<T> where T : class, new()\n    {\n        private readonly Stack<T> stack;\n\n        /// <summary>\n        /// Constructs a new locking resource pool.\n        /// </summary>\n        /// <param name=\"initialResourceCount\">Number of resources to include in the pool by default.</param>\n        /// <param name=\"initializer\">Function to initialize new instances in the resource pool with.</param>\n        public UnsafeResourcePool(int initialResourceCount, Action<T> initializer)\n        {\n            InstanceInitializer = initializer;\n            stack = new Stack<T>(initialResourceCount);\n            Initialize(initialResourceCount);\n        }\n\n\n        /// <summary>\n        /// Constructs a new locking resource pool.\n        /// </summary>\n        /// <param name=\"initialResourceCount\">Number of resources to include in the pool by default.</param>\n        public UnsafeResourcePool(int initialResourceCount)\n            : this(initialResourceCount, null)\n        {\n        }\n\n        /// <summary>\n        /// Constructs a new locking resource pool.\n        /// </summary>\n        public UnsafeResourcePool()\n            : this(10)\n        {\n        }\n\n        /// <summary>\n        /// Gets the number of resources in the pool.\n        /// Even if the resource count hits 0, resources\n        /// can still be requested; they will be allocated\n        /// dynamically.\n        /// </summary>\n        public override int Count\n        {\n            get { return stack.Count; }\n        }\n\n        /// <summary>\n        /// Gives an item back to the resource pool.\n        /// </summary>\n        /// <param name=\"item\">Item to return.</param>\n        public override void GiveBack(T item)\n        {\n            stack.Push(item);\n        }\n\n\n        /// <summary>\n        /// Initializes the pool with some resources.\n        /// Throws away excess resources.\n        /// </summary>\n        /// <param name=\"initialResourceCount\">Number of resources to include.</param>\n        public override void Initialize(int initialResourceCount)\n        {\n            while (stack.Count > initialResourceCount)\n            {\n                stack.Pop();\n            }\n            if (InstanceInitializer != null)\n                foreach (T t in stack)\n                {\n                    InstanceInitializer(t);\n                }\n            while (stack.Count < initialResourceCount)\n            {\n                stack.Push(CreateNewResource());\n            }\n        }\n\n        /// <summary>\n        /// Takes an item from the resource pool.\n        /// </summary>\n        /// <returns>Item to take.</returns>\n        public override T Take()\n        {\n            if (stack.Count > 0)\n            {\n                return stack.Pop();\n            }\n            else\n            {\n                return CreateNewResource();\n            }\n        }\n\n        /// <summary>\n        /// Clears out the resource pool.\n        /// </summary>\n        public override void Clear()\n        {\n            stack.Clear();\n        }\n    }\n}"
  },
  {
    "path": "BEPUutilities/RigidTransform.cs",
    "content": "﻿ \n\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUutilities\n{\n    ///<summary>\n    /// Transform composed of a rotation and translation.\n    ///</summary>\n    public struct RigidTransform\n    {\n        ///<summary>\n        /// Translation component of the transform.\n        ///</summary>\n        public Vector3 Position;\n        ///<summary>\n        /// Rotation component of the transform.\n        ///</summary>\n        public Quaternion Orientation;\n\n        ///<summary>\n        /// Constructs a new rigid transform.\n        ///</summary>\n        ///<param name=\"position\">Translation component of the transform.</param>\n        ///<param name=\"orienation\">Rotation component of the transform.</param>\n        public RigidTransform(Vector3 position, Quaternion orienation)\n        {\n            Position = position;\n            Orientation = orienation;\n        }\n\n        ///<summary>\n        /// Constructs a new rigid transform.\n        ///</summary>\n        ///<param name=\"position\">Translation component of the transform.</param>\n        public RigidTransform(Vector3 position)\n        {\n            Position = position;\n            Orientation = Quaternion.Identity;\n        }\n\n        ///<summary>\n        /// Constructs a new rigid transform.\n        ///</summary>\n        ///<param name=\"orienation\">Rotation component of the transform.</param>\n        public RigidTransform(Quaternion orienation)\n        {\n            Position = new Vector3();\n            Orientation = orienation;\n        }\n\n        /// <summary>\n        /// Gets the orientation matrix created from the orientation of the rigid transform.\n        /// </summary>\n        public Matrix OrientationMatrix\n        {\n            get\n            {\n                Matrix toReturn;\n                Matrix.CreateFromQuaternion(ref Orientation, out toReturn);\n                return toReturn;\n            }\n        }\n        ///<summary>\n        /// Gets the 4x4 matrix created from the rigid transform.\n        ///</summary>\n        public Matrix Matrix\n        {\n            get\n            {\n                Matrix toReturn;\n                Matrix.CreateFromQuaternion(ref Orientation, out toReturn);\n                toReturn.Translation = Position;\n                return toReturn;\n            }\n        }\n\n      \n\n        ///<summary>\n        /// Gets the identity rigid transform.\n        ///</summary>\n        public static RigidTransform Identity\n        {\n            get\n            {\n                var t = new RigidTransform {Orientation = Quaternion.Identity, Position = new Vector3()};\n                return t;\n            }\n        }\n\n        /// <summary>\n        /// Inverts a rigid transform.\n        /// </summary>\n        /// <param name=\"transform\">Transform to invert.</param>\n        /// <param name=\"inverse\">Inverse of the transform.</param>\n        public static void Invert(ref RigidTransform transform, out RigidTransform inverse)\n        {\n            Quaternion.Conjugate(ref transform.Orientation, out inverse.Orientation);\n            Vector3.Transform(ref transform.Position, ref inverse.Orientation, out inverse.Position);\n            Vector3.Negate(ref inverse.Position, out inverse.Position);\n        }\n\n        ///<summary>\n        /// Transforms a rigid transform by another rigid transform.\n        ///</summary>\n        ///<param name=\"a\">The first, \"local\" rigid transform.</param>\n        ///<param name=\"b\">The second, \"world\" rigid transform.</param>\n        ///<param name=\"combined\">Combined rigid transform.</param>\n        public static void Transform(ref RigidTransform a, ref RigidTransform b, out RigidTransform combined)\n        {\n            Vector3 intermediate;\n            Vector3.Transform(ref a.Position, ref b.Orientation, out intermediate);\n            Vector3.Add(ref intermediate, ref b.Position, out combined.Position);\n            Quaternion.Concatenate(ref a.Orientation, ref b.Orientation, out combined.Orientation);\n\n        }\n        ///<summary>\n        /// Transforms a rigid transform by another rigid transform's inverse.\n        ///</summary>\n        ///<param name=\"a\">The first rigid transform.</param>\n        ///<param name=\"b\">The second rigid transform, to be inverted.</param>\n        ///<param name=\"combinedTransform\">Combined rigid transform.</param>\n        public static void TransformByInverse(ref RigidTransform a, ref RigidTransform b, out RigidTransform combinedTransform)\n        {\n            Invert(ref b, out combinedTransform);\n            Transform(ref a, ref combinedTransform, out combinedTransform);\n        }\n\n        ///<summary>\n        /// Transforms a position by a rigid transform.\n        ///</summary>\n        ///<param name=\"position\">Position to transform.</param>\n        ///<param name=\"transform\">Transform to apply.</param>\n        ///<param name=\"result\">Transformed position.</param>\n        public static void Transform(ref Vector3 position, ref RigidTransform transform, out Vector3 result)\n        {\n            Vector3 intermediate;\n            Vector3.Transform(ref position, ref transform.Orientation, out intermediate);\n            Vector3.Add(ref intermediate, ref transform.Position, out result);\n        }\n\n\n        ///<summary>\n        /// Transforms a position by a rigid transform's inverse.\n        ///</summary>\n        ///<param name=\"position\">Position to transform.</param>\n        ///<param name=\"transform\">Transform to invert and apply.</param>\n        ///<param name=\"result\">Transformed position.</param>\n        public static void TransformByInverse(ref Vector3 position, ref RigidTransform transform, out Vector3 result)\n        {\n            Quaternion orientation;\n            Vector3 intermediate;\n            Vector3.Subtract(ref position, ref transform.Position, out intermediate);\n            Quaternion.Conjugate(ref transform.Orientation, out orientation);\n            Vector3.Transform(ref intermediate, ref orientation, out result);\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/SpinLock.cs",
    "content": "﻿using System;\nusing System.Threading;\n\nnamespace BEPUutilities\n{\n    /// <summary>\n    /// Synchronizes using a busy wait.  Take care when using this; if the critical section is long or there's any doubt about the use of a busy wait, consider using Monitor locks or other approaches instead.\n    /// Replaces the .NET SpinLock on PC and provides its functionality on the Xbox360.\n    /// </summary>\n    public class SpinLock\n    {\n        private const int MaximumSpinWait = 15;\n        private const int SleepInterval = 10;\n        private int owner = -1;\n\n\n        /// <summary>\n        /// Enters the critical section.  A thread cannot attempt to enter the spinlock if it already owns the spinlock.\n        /// </summary>\n        public void Enter()\n        {\n            int count = 0;\n            while (Interlocked.CompareExchange(ref owner, 0, -1) != -1)\n            {\n                //Lock is owned by someone else.\n                count++;\n                WaitBriefly(ref count);\n            }\n            //It's my lock now!\n        }\n\n        /// <summary>\n        /// Attempts to enters the critical section.  A thread cannot attempt to enter the spinlock if it already owns the spinlock.\n        /// </summary>\n        public bool TryEnter()\n        {\n            return Interlocked.CompareExchange(ref owner, 0, -1) == -1;\n        }\n\n        /// <summary>\n        /// Exits the critical section.  This can only be safely called from the same\n        /// thread of execution after a corresponding Enter.\n        /// </summary>\n        public void Exit()\n        {\n            //To be safe, technically should check the identity of the exiter.\n            //But since this is a very low-level, restricted access class,\n            //assume that enter has to succeed before exit is tried.\n            owner = -1;\n        }\n\n        internal void WaitBriefly(ref int attempt)\n        {\n            if (attempt == SleepInterval)\n            {\n#if WINDOWS\n                Thread.Yield();\n#else\n                Thread.Sleep(0);\n#endif\n                //TODO: Thread.Yield on windows?\n                //Check multithreaded bookmarks performance conscious\n                //and .netspinlock\n                attempt -= SleepInterval;\n            }\n            else\n            {\n                Thread.SpinWait(Math.Min(3 << attempt, MaximumSpinWait));\n            }\n        }\n    }\n}"
  },
  {
    "path": "BEPUutilities/Toolbox.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing BEPUphysics.CollisionTests;\nusing BEPUutilities.DataStructures;\nusing BEPUutilities.ResourceManagement;\nusing Microsoft.Xna.Framework;\n\nnamespace BEPUutilities\n{\n    //TODO: It would be nice to split and improve this monolith into individually superior, organized components.\n\n\n    /// <summary>\n    /// Helper class with many algorithms for intersection testing and 3D math.\n    /// </summary>\n    public static class Toolbox\n    {\n        /// <summary>\n        /// Large tolerance value. Defaults to 1e-5f.\n        /// </summary>\n        public static float BigEpsilon = 1E-5f;\n\n        /// <summary>\n        /// Tolerance value. Defaults to 1e-7f.\n        /// </summary>\n        public static float Epsilon = 1E-7f;\n\n        /// <summary>\n        /// Represents an invalid Vector3.\n        /// </summary>\n        public static readonly Vector3 NoVector = new Vector3(-float.MaxValue, -float.MaxValue, -float.MaxValue);\n\n        /// <summary>\n        /// Reference for a vector with dimensions (0,0,1).\n        /// </summary>\n        public static Vector3 BackVector = Vector3.Backward;\n\n        /// <summary>\n        /// Reference for a vector with dimensions (0,-1,0).\n        /// </summary>\n        public static Vector3 DownVector = Vector3.Down;\n\n        /// <summary>\n        /// Reference for a vector with dimensions (0,0,-1).\n        /// </summary>\n        public static Vector3 ForwardVector = Vector3.Forward;\n\n        /// <summary>\n        /// Refers to the identity quaternion.\n        /// </summary>\n        public static Quaternion IdentityOrientation = Quaternion.Identity;\n\n        /// <summary>\n        /// Reference for a vector with dimensions (-1,0,0).\n        /// </summary>\n        public static Vector3 LeftVector = Vector3.Left;\n\n        /// <summary>\n        /// Reference for a vector with dimensions (1,0,0).\n        /// </summary>\n        public static Vector3 RightVector = Vector3.Right;\n\n        /// <summary>\n        /// Reference for a vector with dimensions (0,1,0).\n        /// </summary>\n        public static Vector3 UpVector = Vector3.Up;\n\n        /// <summary>\n        /// Matrix containing zeroes for every element.\n        /// </summary>\n        public static Matrix ZeroMatrix = new Matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\n        /// <summary>\n        /// Reference for a vector with dimensions (0,0,0).\n        /// </summary>\n        public static Vector3 ZeroVector = Vector3.Zero;\n\n        /// <summary>\n        /// Refers to the rigid identity transformation.\n        /// </summary>\n        public static RigidTransform RigidIdentity = RigidTransform.Identity;\n\n        #region Segment/Ray-Triangle Tests\n\n        /// <summary>\n        /// Determines the intersection between a ray and a triangle.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length to travel in units of the direction's length.</param>\n        /// <param name=\"a\">First vertex of the triangle.</param>\n        /// <param name=\"b\">Second vertex of the triangle.</param>\n        /// <param name=\"c\">Third vertex of the triangle.</param>\n        /// <param name=\"hitClockwise\">True if the the triangle was hit on the clockwise face, false otherwise.</param>\n        /// <param name=\"hit\">Hit data of the ray, if any</param>\n        /// <returns>Whether or not the ray and triangle intersect.</returns>\n        public static bool FindRayTriangleIntersection(ref Ray ray, float maximumLength, ref Vector3 a, ref Vector3 b, ref Vector3 c, out bool hitClockwise, out RayHit hit)\n        {\n            hitClockwise = false;\n            hit = new RayHit();\n            Vector3 ab, ac;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3.Subtract(ref c, ref a, out ac);\n\n            Vector3.Cross(ref ab, ref ac, out hit.Normal);\n            if (hit.Normal.LengthSquared() < Epsilon)\n                return false; //Degenerate triangle!\n\n            float d;\n            Vector3.Dot(ref ray.Direction, ref hit.Normal, out d);\n            d = -d;\n\n            hitClockwise = d >= 0;\n\n            Vector3 ap;\n            Vector3.Subtract(ref ray.Position, ref a, out ap);\n\n            Vector3.Dot(ref ap, ref hit.Normal, out hit.T);\n            hit.T /= d;\n            if (hit.T < 0 || hit.T > maximumLength)\n                return false;//Hit is behind origin, or too far away.\n\n            Vector3.Multiply(ref ray.Direction, hit.T, out hit.Location);\n            Vector3.Add(ref ray.Position, ref hit.Location, out hit.Location);\n\n            // Compute barycentric coordinates\n            Vector3.Subtract(ref hit.Location, ref a, out ap);\n            float ABdotAB, ABdotAC, ABdotAP;\n            float ACdotAC, ACdotAP;\n            Vector3.Dot(ref ab, ref ab, out ABdotAB);\n            Vector3.Dot(ref ab, ref ac, out ABdotAC);\n            Vector3.Dot(ref ab, ref ap, out ABdotAP);\n            Vector3.Dot(ref ac, ref ac, out ACdotAC);\n            Vector3.Dot(ref ac, ref ap, out ACdotAP);\n\n            float denom = 1 / (ABdotAB * ACdotAC - ABdotAC * ABdotAC);\n            float u = (ACdotAC * ABdotAP - ABdotAC * ACdotAP) * denom;\n            float v = (ABdotAB * ACdotAP - ABdotAC * ABdotAP) * denom;\n\n            return (u >= -Toolbox.BigEpsilon) && (v >= -Toolbox.BigEpsilon) && (u + v <= 1 + Toolbox.BigEpsilon);\n\n        }\n\n        /// <summary>\n        /// Determines the intersection between a ray and a triangle.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test.</param>\n        /// <param name=\"maximumLength\">Maximum length to travel in units of the direction's length.</param>\n        /// <param name=\"sidedness\">Sidedness of the triangle to test.</param>\n        /// <param name=\"a\">First vertex of the triangle.</param>\n        /// <param name=\"b\">Second vertex of the triangle.</param>\n        /// <param name=\"c\">Third vertex of the triangle.</param>\n        /// <param name=\"hit\">Hit data of the ray, if any</param>\n        /// <returns>Whether or not the ray and triangle intersect.</returns>\n        public static bool FindRayTriangleIntersection(ref Ray ray, float maximumLength, TriangleSidedness sidedness, ref Vector3 a, ref Vector3 b, ref Vector3 c, out RayHit hit)\n        {\n            hit = new RayHit();\n            Vector3 ab, ac;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3.Subtract(ref c, ref a, out ac);\n\n            Vector3.Cross(ref ab, ref ac, out hit.Normal);\n            if (hit.Normal.LengthSquared() < Epsilon)\n                return false; //Degenerate triangle!\n\n            float d;\n            Vector3.Dot(ref ray.Direction, ref hit.Normal, out d);\n            d = -d;\n            switch (sidedness)\n            {\n                case TriangleSidedness.DoubleSided:\n                    if (d <= 0) //Pointing the wrong way.  Flip the normal.\n                    {\n                        Vector3.Negate(ref hit.Normal, out hit.Normal);\n                        d = -d;\n                    }\n                    break;\n                case TriangleSidedness.Clockwise:\n                    if (d <= 0) //Pointing the wrong way.  Can't hit.\n                        return false;\n\n                    break;\n                case TriangleSidedness.Counterclockwise:\n                    if (d >= 0) //Pointing the wrong way.  Can't hit.\n                        return false;\n\n                    Vector3.Negate(ref hit.Normal, out hit.Normal);\n                    d = -d;\n                    break;\n            }\n\n            Vector3 ap;\n            Vector3.Subtract(ref ray.Position, ref a, out ap);\n\n            Vector3.Dot(ref ap, ref hit.Normal, out hit.T);\n            hit.T /= d;\n            if (hit.T < 0 || hit.T > maximumLength)\n                return false;//Hit is behind origin, or too far away.\n\n            Vector3.Multiply(ref ray.Direction, hit.T, out hit.Location);\n            Vector3.Add(ref ray.Position, ref hit.Location, out hit.Location);\n\n            // Compute barycentric coordinates\n            Vector3.Subtract(ref hit.Location, ref a, out ap);\n            float ABdotAB, ABdotAC, ABdotAP;\n            float ACdotAC, ACdotAP;\n            Vector3.Dot(ref ab, ref ab, out ABdotAB);\n            Vector3.Dot(ref ab, ref ac, out ABdotAC);\n            Vector3.Dot(ref ab, ref ap, out ABdotAP);\n            Vector3.Dot(ref ac, ref ac, out ACdotAC);\n            Vector3.Dot(ref ac, ref ap, out ACdotAP);\n\n            float denom = 1 / (ABdotAB * ACdotAC - ABdotAC * ABdotAC);\n            float u = (ACdotAC * ABdotAP - ABdotAC * ACdotAP) * denom;\n            float v = (ABdotAB * ACdotAP - ABdotAC * ABdotAP) * denom;\n\n            return (u >= -Toolbox.BigEpsilon) && (v >= -Toolbox.BigEpsilon) && (u + v <= 1 + Toolbox.BigEpsilon);\n\n        }\n\n        /// <summary>\n        /// Finds the intersection between the given segment and the given plane defined by three points.\n        /// </summary>\n        /// <param name=\"a\">First endpoint of segment.</param>\n        /// <param name=\"b\">Second endpoint of segment.</param>\n        /// <param name=\"d\">First vertex of a triangle which lies on the plane.</param>\n        /// <param name=\"e\">Second vertex of a triangle which lies on the plane.</param>\n        /// <param name=\"f\">Third vertex of a triangle which lies on the plane.</param>\n        /// <param name=\"q\">Intersection point.</param>\n        /// <returns>Whether or not the segment intersects the plane.</returns>\n        public static bool GetSegmentPlaneIntersection(Vector3 a, Vector3 b, Vector3 d, Vector3 e, Vector3 f, out Vector3 q)\n        {\n            Plane p;\n            p.Normal = Vector3.Cross(e - d, f - d);\n            p.D = Vector3.Dot(p.Normal, d);\n            float t;\n            return GetSegmentPlaneIntersection(a, b, p, out t, out q);\n        }\n\n        /// <summary>\n        /// Finds the intersection between the given segment and the given plane.\n        /// </summary>\n        /// <param name=\"a\">First endpoint of segment.</param>\n        /// <param name=\"b\">Second enpoint of segment.</param>\n        /// <param name=\"p\">Plane for comparison.</param>\n        /// <param name=\"q\">Intersection point.</param>\n        /// <returns>Whether or not the segment intersects the plane.</returns>\n        public static bool GetSegmentPlaneIntersection(Vector3 a, Vector3 b, Plane p, out Vector3 q)\n        {\n            float t;\n            return GetLinePlaneIntersection(ref a, ref b, ref p, out t, out q) && t >= 0 && t <= 1;\n        }\n\n        /// <summary>\n        /// Finds the intersection between the given segment and the given plane.\n        /// </summary>\n        /// <param name=\"a\">First endpoint of segment.</param>\n        /// <param name=\"b\">Second endpoint of segment.</param>\n        /// <param name=\"p\">Plane for comparison.</param>\n        /// <param name=\"t\">Interval along segment to intersection.</param>\n        /// <param name=\"q\">Intersection point.</param>\n        /// <returns>Whether or not the segment intersects the plane.</returns>\n        public static bool GetSegmentPlaneIntersection(Vector3 a, Vector3 b, Plane p, out float t, out Vector3 q)\n        {\n            return GetLinePlaneIntersection(ref a, ref b, ref p, out t, out q) && t >= 0 && t <= 1;\n        }\n\n        /// <summary>\n        /// Finds the intersection between the given line and the given plane.\n        /// </summary>\n        /// <param name=\"a\">First endpoint of segment defining the line.</param>\n        /// <param name=\"b\">Second endpoint of segment defining the line.</param>\n        /// <param name=\"p\">Plane for comparison.</param>\n        /// <param name=\"t\">Interval along line to intersection (A + t * AB).</param>\n        /// <param name=\"q\">Intersection point.</param>\n        /// <returns>Whether or not the line intersects the plane.  If false, the line is parallel to the plane's surface.</returns>\n        public static bool GetLinePlaneIntersection(ref Vector3 a, ref Vector3 b, ref Plane p, out float t, out Vector3 q)\n        {\n            Vector3 ab;\n            Vector3.Subtract(ref b, ref a, out ab);\n            float denominator;\n            Vector3.Dot(ref p.Normal, ref ab, out denominator);\n            if (denominator < Epsilon && denominator > -Epsilon)\n            {\n                //Surface of plane and line are parallel (or very close to it).\n                q = new Vector3();\n                t = float.MaxValue;\n                return false;\n            }\n            float numerator;\n            Vector3.Dot(ref p.Normal, ref a, out numerator);\n            t = (p.D - numerator) / denominator;\n            //Compute the intersection position.\n            Vector3.Multiply(ref ab, t, out q);\n            Vector3.Add(ref a, ref q, out q);\n            return true;\n        }\n\n        /// <summary>\n        /// Finds the intersection between the given ray and the given plane.\n        /// </summary>\n        /// <param name=\"ray\">Ray to test against the plane.</param>\n        /// <param name=\"p\">Plane for comparison.</param>\n        /// <param name=\"t\">Interval along line to intersection (A + t * AB).</param>\n        /// <param name=\"q\">Intersection point.</param>\n        /// <returns>Whether or not the line intersects the plane.  If false, the line is parallel to the plane's surface.</returns>\n        public static bool GetRayPlaneIntersection(ref Ray ray, ref Plane p, out float t, out Vector3 q)\n        {\n            float denominator;\n            Vector3.Dot(ref p.Normal, ref ray.Direction, out denominator);\n            if (denominator < Epsilon && denominator > -Epsilon)\n            {\n                //Surface of plane and line are parallel (or very close to it).\n                q = new Vector3();\n                t = float.MaxValue;\n                return false;\n            }\n            float numerator;\n            Vector3.Dot(ref p.Normal, ref ray.Position, out numerator);\n            t = (p.D - numerator) / denominator;\n            //Compute the intersection position.\n            Vector3.Multiply(ref ray.Direction, t, out q);\n            Vector3.Add(ref ray.Position, ref q, out q);\n            return t >= 0;\n        }\n\n        #endregion\n\n        #region Point-Triangle Tests\n\n        /// <summary>\n        /// Determines the closest point on a triangle given by points a, b, and c to point p.\n        /// </summary>\n        /// <param name=\"a\">First vertex of triangle.</param>\n        /// <param name=\"b\">Second vertex of triangle.</param>\n        /// <param name=\"c\">Third vertex of triangle.</param>\n        /// <param name=\"p\">Point for comparison.</param>\n        /// <param name=\"closestPoint\">Closest point on tetrahedron to point.</param>\n        /// <returns>Voronoi region containing the closest point.</returns>\n        public static VoronoiRegion GetClosestPointOnTriangleToPoint(ref Vector3 a, ref Vector3 b, ref Vector3 c, ref Vector3 p, out Vector3 closestPoint)\n        {\n            float v, w;\n            Vector3 ab;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3 ac;\n            Vector3.Subtract(ref c, ref a, out ac);\n            //Vertex region A?\n            Vector3 ap;\n            Vector3.Subtract(ref p, ref a, out ap);\n            float d1;\n            Vector3.Dot(ref ab, ref ap, out d1);\n            float d2;\n            Vector3.Dot(ref ac, ref ap, out d2);\n            if (d1 <= 0 && d2 < 0)\n            {\n                closestPoint = a;\n                return VoronoiRegion.A;\n            }\n            //Vertex region B?\n            Vector3 bp;\n            Vector3.Subtract(ref p, ref b, out bp);\n            float d3;\n            Vector3.Dot(ref ab, ref bp, out d3);\n            float d4;\n            Vector3.Dot(ref ac, ref bp, out d4);\n            if (d3 >= 0 && d4 <= d3)\n            {\n                closestPoint = b;\n                return VoronoiRegion.B;\n            }\n            //Edge region AB?\n            float vc = d1 * d4 - d3 * d2;\n            if (vc <= 0 && d1 >= 0 && d3 <= 0)\n            {\n                v = d1 / (d1 - d3);\n                Vector3.Multiply(ref ab, v, out closestPoint);\n                Vector3.Add(ref closestPoint, ref a, out closestPoint);\n                return VoronoiRegion.AB;\n            }\n            //Vertex region C?\n            Vector3 cp;\n            Vector3.Subtract(ref p, ref c, out cp);\n            float d5;\n            Vector3.Dot(ref ab, ref cp, out d5);\n            float d6;\n            Vector3.Dot(ref ac, ref cp, out d6);\n            if (d6 >= 0 && d5 <= d6)\n            {\n                closestPoint = c;\n                return VoronoiRegion.C;\n            }\n            //Edge region AC?\n            float vb = d5 * d2 - d1 * d6;\n            if (vb <= 0 && d2 >= 0 && d6 <= 0)\n            {\n                w = d2 / (d2 - d6);\n                Vector3.Multiply(ref ac, w, out closestPoint);\n                Vector3.Add(ref closestPoint, ref a, out closestPoint);\n                return VoronoiRegion.AC;\n            }\n            //Edge region BC?\n            float va = d3 * d6 - d5 * d4;\n            if (va <= 0 && (d4 - d3) >= 0 && (d5 - d6) >= 0)\n            {\n                w = (d4 - d3) / ((d4 - d3) + (d5 - d6));\n                Vector3.Subtract(ref c, ref b, out closestPoint);\n                Vector3.Multiply(ref closestPoint, w, out closestPoint);\n                Vector3.Add(ref closestPoint, ref b, out closestPoint);\n                return VoronoiRegion.BC;\n            }\n            //Inside triangle?\n            float denom = 1 / (va + vb + vc);\n            v = vb * denom;\n            w = vc * denom;\n            Vector3 abv;\n            Vector3.Multiply(ref ab, v, out abv);\n            Vector3 acw;\n            Vector3.Multiply(ref ac, w, out acw);\n            Vector3.Add(ref a, ref abv, out closestPoint);\n            Vector3.Add(ref closestPoint, ref acw, out closestPoint);\n            return VoronoiRegion.ABC;\n        }\n\n        /// <summary>\n        /// Determines the closest point on a triangle given by points a, b, and c to point p and provides the subsimplex whose voronoi region contains the point.\n        /// </summary>\n        /// <param name=\"a\">First vertex of triangle.</param>\n        /// <param name=\"b\">Second vertex of triangle.</param>\n        /// <param name=\"c\">Third vertex of triangle.</param>\n        /// <param name=\"p\">Point for comparison.</param>\n        /// <param name=\"subsimplex\">The source of the voronoi region which contains the point.</param>\n        /// <param name=\"closestPoint\">Closest point on tetrahedron to point.</param>\n        [Obsolete(\"Used for simplex tests; consider using the PairSimplex and its variants instead for simplex-related testing.\")]\n        public static void GetClosestPointOnTriangleToPoint(ref Vector3 a, ref Vector3 b, ref Vector3 c, ref Vector3 p, RawList<Vector3> subsimplex, out Vector3 closestPoint)\n        {\n            subsimplex.Clear();\n            float v, w;\n            Vector3 ab;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3 ac;\n            Vector3.Subtract(ref c, ref a, out ac);\n            //Vertex region A?\n            Vector3 ap;\n            Vector3.Subtract(ref p, ref a, out ap);\n            float d1;\n            Vector3.Dot(ref ab, ref ap, out d1);\n            float d2;\n            Vector3.Dot(ref ac, ref ap, out d2);\n            if (d1 <= 0 && d2 < 0)\n            {\n                subsimplex.Add(a);\n                closestPoint = a;\n                return;\n            }\n            //Vertex region B?\n            Vector3 bp;\n            Vector3.Subtract(ref p, ref b, out bp);\n            float d3;\n            Vector3.Dot(ref ab, ref bp, out d3);\n            float d4;\n            Vector3.Dot(ref ac, ref bp, out d4);\n            if (d3 >= 0 && d4 <= d3)\n            {\n                subsimplex.Add(b);\n                closestPoint = b;\n                return;\n            }\n            //Edge region AB?\n            float vc = d1 * d4 - d3 * d2;\n            if (vc <= 0 && d1 >= 0 && d3 <= 0)\n            {\n                subsimplex.Add(a);\n                subsimplex.Add(b);\n                v = d1 / (d1 - d3);\n                Vector3.Multiply(ref ab, v, out closestPoint);\n                Vector3.Add(ref closestPoint, ref a, out closestPoint);\n                return;\n            }\n            //Vertex region C?\n            Vector3 cp;\n            Vector3.Subtract(ref p, ref c, out cp);\n            float d5;\n            Vector3.Dot(ref ab, ref cp, out d5);\n            float d6;\n            Vector3.Dot(ref ac, ref cp, out d6);\n            if (d6 >= 0 && d5 <= d6)\n            {\n                subsimplex.Add(c);\n                closestPoint = c;\n                return;\n            }\n            //Edge region AC?\n            float vb = d5 * d2 - d1 * d6;\n            if (vb <= 0 && d2 >= 0 && d6 <= 0)\n            {\n                subsimplex.Add(a);\n                subsimplex.Add(c);\n                w = d2 / (d2 - d6);\n                Vector3.Multiply(ref ac, w, out closestPoint);\n                Vector3.Add(ref closestPoint, ref a, out closestPoint);\n                return;\n            }\n            //Edge region BC?\n            float va = d3 * d6 - d5 * d4;\n            if (va <= 0 && (d4 - d3) >= 0 && (d5 - d6) >= 0)\n            {\n                subsimplex.Add(b);\n                subsimplex.Add(c);\n                w = (d4 - d3) / ((d4 - d3) + (d5 - d6));\n                Vector3.Subtract(ref c, ref b, out closestPoint);\n                Vector3.Multiply(ref closestPoint, w, out closestPoint);\n                Vector3.Add(ref closestPoint, ref b, out closestPoint);\n                return;\n            }\n            //Inside triangle?\n            subsimplex.Add(a);\n            subsimplex.Add(b);\n            subsimplex.Add(c);\n            float denom = 1 / (va + vb + vc);\n            v = vb * denom;\n            w = vc * denom;\n            Vector3 abv;\n            Vector3.Multiply(ref ab, v, out abv);\n            Vector3 acw;\n            Vector3.Multiply(ref ac, w, out acw);\n            Vector3.Add(ref a, ref abv, out closestPoint);\n            Vector3.Add(ref closestPoint, ref acw, out closestPoint);\n        }\n\n        /// <summary>\n        /// Determines the closest point on a triangle given by points a, b, and c to point p and provides the subsimplex whose voronoi region contains the point.\n        /// </summary>\n        /// <param name=\"q\">Simplex containing triangle for testing.</param>\n        /// <param name=\"i\">Index of first vertex of triangle.</param>\n        /// <param name=\"j\">Index of second vertex of triangle.</param>\n        /// <param name=\"k\">Index of third vertex of triangle.</param>\n        /// <param name=\"p\">Point for comparison.</param>\n        /// <param name=\"subsimplex\">The source of the voronoi region which contains the point, enumerated as a = 0, b = 1, c = 2.</param>\n        /// <param name=\"baryCoords\">Barycentric coordinates of the point on the triangle.</param>\n        /// <param name=\"closestPoint\">Closest point on tetrahedron to point.</param>\n        [Obsolete(\"Used for simplex tests; consider using the PairSimplex and its variants instead for simplex-related testing.\")]\n        public static void GetClosestPointOnTriangleToPoint(RawList<Vector3> q, int i, int j, int k, ref Vector3 p, RawList<int> subsimplex, RawList<float> baryCoords, out Vector3 closestPoint)\n        {\n            subsimplex.Clear();\n            baryCoords.Clear();\n            float v, w;\n            Vector3 a = q[i];\n            Vector3 b = q[j];\n            Vector3 c = q[k];\n            Vector3 ab;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3 ac;\n            Vector3.Subtract(ref c, ref a, out ac);\n            //Vertex region A?\n            Vector3 ap;\n            Vector3.Subtract(ref p, ref a, out ap);\n            float d1;\n            Vector3.Dot(ref ab, ref ap, out d1);\n            float d2;\n            Vector3.Dot(ref ac, ref ap, out d2);\n            if (d1 <= 0 && d2 < 0)\n            {\n                subsimplex.Add(i);\n                baryCoords.Add(1);\n                closestPoint = a;\n                return; //barycentric coordinates (1,0,0)\n            }\n            //Vertex region B?\n            Vector3 bp;\n            Vector3.Subtract(ref p, ref b, out bp);\n            float d3;\n            Vector3.Dot(ref ab, ref bp, out d3);\n            float d4;\n            Vector3.Dot(ref ac, ref bp, out d4);\n            if (d3 >= 0 && d4 <= d3)\n            {\n                subsimplex.Add(j);\n                baryCoords.Add(1);\n                closestPoint = b;\n                return; //barycentric coordinates (0,1,0)\n            }\n            //Edge region AB?\n            float vc = d1 * d4 - d3 * d2;\n            if (vc <= 0 && d1 >= 0 && d3 <= 0)\n            {\n                subsimplex.Add(i);\n                subsimplex.Add(j);\n                v = d1 / (d1 - d3);\n                baryCoords.Add(1 - v);\n                baryCoords.Add(v);\n                Vector3.Multiply(ref ab, v, out closestPoint);\n                Vector3.Add(ref closestPoint, ref a, out closestPoint);\n                return; //barycentric coordinates (1-v, v, 0)\n            }\n            //Vertex region C?\n            Vector3 cp;\n            Vector3.Subtract(ref p, ref c, out cp);\n            float d5;\n            Vector3.Dot(ref ab, ref cp, out d5);\n            float d6;\n            Vector3.Dot(ref ac, ref cp, out d6);\n            if (d6 >= 0 && d5 <= d6)\n            {\n                subsimplex.Add(k);\n                baryCoords.Add(1);\n                closestPoint = c;\n                return; //barycentric coordinates (0,0,1)\n            }\n            //Edge region AC?\n            float vb = d5 * d2 - d1 * d6;\n            if (vb <= 0 && d2 >= 0 && d6 <= 0)\n            {\n                subsimplex.Add(i);\n                subsimplex.Add(k);\n                w = d2 / (d2 - d6);\n                baryCoords.Add(1 - w);\n                baryCoords.Add(w);\n                Vector3.Multiply(ref ac, w, out closestPoint);\n                Vector3.Add(ref closestPoint, ref a, out closestPoint);\n                return; //barycentric coordinates (1-w, 0, w)\n            }\n            //Edge region BC?\n            float va = d3 * d6 - d5 * d4;\n            if (va <= 0 && (d4 - d3) >= 0 && (d5 - d6) >= 0)\n            {\n                subsimplex.Add(j);\n                subsimplex.Add(k);\n                w = (d4 - d3) / ((d4 - d3) + (d5 - d6));\n                baryCoords.Add(1 - w);\n                baryCoords.Add(w);\n                Vector3.Subtract(ref c, ref b, out closestPoint);\n                Vector3.Multiply(ref closestPoint, w, out closestPoint);\n                Vector3.Add(ref closestPoint, ref b, out closestPoint);\n                return; //barycentric coordinates (0, 1 - w ,w)\n            }\n            //Inside triangle?\n            subsimplex.Add(i);\n            subsimplex.Add(j);\n            subsimplex.Add(k);\n            float denom = 1 / (va + vb + vc);\n            v = vb * denom;\n            w = vc * denom;\n            baryCoords.Add(1 - v - w);\n            baryCoords.Add(v);\n            baryCoords.Add(w);\n            Vector3 abv;\n            Vector3.Multiply(ref ab, v, out abv);\n            Vector3 acw;\n            Vector3.Multiply(ref ac, w, out acw);\n            Vector3.Add(ref a, ref abv, out closestPoint);\n            Vector3.Add(ref closestPoint, ref acw, out closestPoint);\n            //return a + ab * v + ac * w; //barycentric coordinates (1 - v - w, v, w)\n        }\n\n        /// <summary>\n        /// Determines if supplied point is within the triangle as defined by the provided vertices.\n        /// </summary>\n        /// <param name=\"vA\">A vertex of the triangle.</param>\n        /// <param name=\"vB\">A vertex of the triangle.</param>\n        /// <param name=\"vC\">A vertex of the triangle.</param>\n        /// <param name=\"p\">The point for comparison against the triangle.</param>\n        /// <returns>Whether or not the point is within the triangle.</returns>\n        public static bool IsPointInsideTriangle(ref Vector3 vA, ref Vector3 vB, ref Vector3 vC, ref Vector3 p)\n        {\n            float u, v, w;\n            GetBarycentricCoordinates(ref p, ref vA, ref vB, ref vC, out u, out v, out w);\n            //Are the barycoords valid?\n            return (u > -Epsilon) && (v > -Epsilon) && (w > -Epsilon);\n        }\n\n        /// <summary>\n        /// Determines if supplied point is within the triangle as defined by the provided vertices.\n        /// </summary>\n        /// <param name=\"vA\">A vertex of the triangle.</param>\n        /// <param name=\"vB\">A vertex of the triangle.</param>\n        /// <param name=\"vC\">A vertex of the triangle.</param>\n        /// <param name=\"p\">The point for comparison against the triangle.</param>\n        /// <param name=\"margin\">Extra area on the edges of the triangle to include.  Can be negative.</param>\n        /// <returns>Whether or not the point is within the triangle.</returns>\n        public static bool IsPointInsideTriangle(ref Vector3 vA, ref Vector3 vB, ref Vector3 vC, ref Vector3 p, float margin)\n        {\n            float u, v, w;\n            GetBarycentricCoordinates(ref p, ref vA, ref vB, ref vC, out u, out v, out w);\n            //Are the barycoords valid?\n            return (u > -margin) && (v > -margin) && (w > -margin);\n        }\n\n        #endregion\n\n        #region Point-Line Tests\n\n        /// <summary>\n        /// Determines the closest point on the provided segment ab to point p.\n        /// </summary>\n        /// <param name=\"a\">First endpoint of segment.</param>\n        /// <param name=\"b\">Second endpoint of segment.</param>\n        /// <param name=\"p\">Point for comparison.</param>\n        /// <param name=\"closestPoint\">Closest point on the edge to p.</param>\n        public static void GetClosestPointOnSegmentToPoint(ref Vector3 a, ref Vector3 b, ref Vector3 p, out Vector3 closestPoint)\n        {\n            Vector3 ab;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3 ap;\n            Vector3.Subtract(ref p, ref a, out ap);\n            float t;\n            Vector3.Dot(ref ap, ref ab, out t);\n            if (t <= 0)\n            {\n                closestPoint = a;\n            }\n            else\n            {\n                float denom = ab.X * ab.X + ab.Y * ab.Y + ab.Z * ab.Z;\n                if (t >= denom)\n                {\n                    closestPoint = b;\n                }\n                else\n                {\n                    t = t / denom;\n                    Vector3 tab;\n                    Vector3.Multiply(ref ab, t, out tab);\n                    Vector3.Add(ref a, ref tab, out closestPoint);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines the closest point on the provided segment ab to point p.\n        /// </summary>\n        /// <param name=\"a\">First endpoint of segment.</param>\n        /// <param name=\"b\">Second endpoint of segment.</param>\n        /// <param name=\"p\">Point for comparison.</param>\n        /// <param name=\"subsimplex\">The source of the voronoi region which contains the point.</param>\n        /// <param name=\"closestPoint\">Closest point on the edge to p.</param>\n        [Obsolete(\"Used for simplex tests; consider using the PairSimplex and its variants instead for simplex-related testing.\")]\n        public static void GetClosestPointOnSegmentToPoint(ref Vector3 a, ref Vector3 b, ref Vector3 p, List<Vector3> subsimplex, out Vector3 closestPoint)\n        {\n            subsimplex.Clear();\n            Vector3 ab;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3 ap;\n            Vector3.Subtract(ref p, ref a, out ap);\n            float t;\n            Vector3.Dot(ref ap, ref ab, out t);\n            if (t <= 0)\n            {\n                //t = 0;//Don't need this for returning purposes.\n                subsimplex.Add(a);\n                closestPoint = a;\n            }\n            else\n            {\n                float denom = ab.X * ab.X + ab.Y * ab.Y + ab.Z * ab.Z;\n                if (t >= denom)\n                {\n                    //t = 1;//Don't need this for returning purposes.\n                    subsimplex.Add(b);\n                    closestPoint = b;\n                }\n                else\n                {\n                    t = t / denom;\n                    subsimplex.Add(a);\n                    subsimplex.Add(b);\n                    Vector3 tab;\n                    Vector3.Multiply(ref ab, t, out tab);\n                    Vector3.Add(ref a, ref tab, out closestPoint);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines the closest point on the provided segment ab to point p.\n        /// </summary>\n        /// <param name=\"q\">List of points in the containing simplex.</param>\n        /// <param name=\"i\">Index of first endpoint of segment.</param>\n        /// <param name=\"j\">Index of second endpoint of segment.</param>\n        /// <param name=\"p\">Point for comparison.</param>\n        /// <param name=\"subsimplex\">The source of the voronoi region which contains the point, enumerated as a = 0, b = 1.</param>\n        /// <param name=\"baryCoords\">Barycentric coordinates of the point.</param>\n        /// <param name=\"closestPoint\">Closest point on the edge to p.</param>\n        [Obsolete(\"Used for simplex tests; consider using the PairSimplex and its variants instead for simplex-related testing.\")]\n        public static void GetClosestPointOnSegmentToPoint(List<Vector3> q, int i, int j, ref Vector3 p, List<int> subsimplex, List<float> baryCoords, out Vector3 closestPoint)\n        {\n            Vector3 a = q[i];\n            Vector3 b = q[j];\n            subsimplex.Clear();\n            baryCoords.Clear();\n            Vector3 ab;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3 ap;\n            Vector3.Subtract(ref p, ref a, out ap);\n            float t;\n            Vector3.Dot(ref ap, ref ab, out t);\n            if (t <= 0)\n            {\n                subsimplex.Add(i);\n                baryCoords.Add(1);\n                closestPoint = a;\n            }\n            else\n            {\n                float denom = ab.X * ab.X + ab.Y * ab.Y + ab.Z * ab.Z;\n                if (t >= denom)\n                {\n                    subsimplex.Add(j);\n                    baryCoords.Add(1);\n                    closestPoint = b;\n                }\n                else\n                {\n                    t = t / denom;\n                    subsimplex.Add(i);\n                    subsimplex.Add(j);\n                    baryCoords.Add(1 - t);\n                    baryCoords.Add(t);\n                    Vector3 tab;\n                    Vector3.Multiply(ref ab, t, out tab);\n                    Vector3.Add(ref a, ref tab, out closestPoint);\n                }\n            }\n        }\n\n\n        /// <summary>\n        /// Determines the shortest squared distance from the point to the line.\n        /// </summary>\n        /// <param name=\"p\">Point to check against the line.</param>\n        /// <param name=\"a\">First point on the line.</param>\n        /// <param name=\"b\">Second point on the line.</param>\n        /// <returns>Shortest squared distance from the point to the line.</returns>\n        public static float GetSquaredDistanceFromPointToLine(ref Vector3 p, ref Vector3 a, ref Vector3 b)\n        {\n            Vector3 ap, ab;\n            Vector3.Subtract(ref p, ref a, out ap);\n            Vector3.Subtract(ref b, ref a, out ab);\n            float e;\n            Vector3.Dot(ref ap, ref ab, out e);\n            return ap.LengthSquared() - e * e / ab.LengthSquared();\n        }\n\n        #endregion\n\n        #region Line-Line Tests\n\n        /// <summary>\n        /// Computes closest points c1 and c2 betwen segments p1q1 and p2q2.\n        /// </summary>\n        /// <param name=\"p1\">First point of first segment.</param>\n        /// <param name=\"q1\">Second point of first segment.</param>\n        /// <param name=\"p2\">First point of second segment.</param>\n        /// <param name=\"q2\">Second point of second segment.</param>\n        /// <param name=\"c1\">Closest point on first segment.</param>\n        /// <param name=\"c2\">Closest point on second segment.</param>\n        public static void GetClosestPointsBetweenSegments(Vector3 p1, Vector3 q1, Vector3 p2, Vector3 q2, out Vector3 c1, out Vector3 c2)\n        {\n            float s, t;\n            GetClosestPointsBetweenSegments(ref p1, ref q1, ref p2, ref q2, out s, out t, out c1, out c2);\n        }\n\n        /// <summary>\n        /// Computes closest points c1 and c2 betwen segments p1q1 and p2q2.\n        /// </summary>\n        /// <param name=\"p1\">First point of first segment.</param>\n        /// <param name=\"q1\">Second point of first segment.</param>\n        /// <param name=\"p2\">First point of second segment.</param>\n        /// <param name=\"q2\">Second point of second segment.</param>\n        /// <param name=\"s\">Distance along the line to the point for first segment.</param>\n        /// <param name=\"t\">Distance along the line to the point for second segment.</param>\n        /// <param name=\"c1\">Closest point on first segment.</param>\n        /// <param name=\"c2\">Closest point on second segment.</param>\n        public static void GetClosestPointsBetweenSegments(ref Vector3 p1, ref Vector3 q1, ref Vector3 p2, ref Vector3 q2,\n                                                           out float s, out float t, out Vector3 c1, out Vector3 c2)\n        {\n            //Segment direction vectors\n            Vector3 d1;\n            Vector3.Subtract(ref q1, ref p1, out d1);\n            Vector3 d2;\n            Vector3.Subtract(ref q2, ref p2, out d2);\n            Vector3 r;\n            Vector3.Subtract(ref p1, ref p2, out r);\n            //distance\n            float a = d1.LengthSquared();\n            float e = d2.LengthSquared();\n            float f;\n            Vector3.Dot(ref d2, ref r, out f);\n\n            if (a <= Epsilon && e <= Epsilon)\n            {\n                //These segments are more like points.\n                s = t = 0.0f;\n                c1 = p1;\n                c2 = p2;\n                return;\n            }\n            if (a <= Epsilon)\n            {\n                // First segment is basically a point.\n                s = 0.0f;\n                t = MathHelper.Clamp(f / e, 0.0f, 1.0f);\n            }\n            else\n            {\n                float c = Vector3.Dot(d1, r);\n                if (e <= Epsilon)\n                {\n                    // Second segment is basically a point.\n                    t = 0.0f;\n                    s = MathHelper.Clamp(-c / a, 0.0f, 1.0f);\n                }\n                else\n                {\n                    float b = Vector3.Dot(d1, d2);\n                    float denom = a * e - b * b;\n\n                    // If segments not parallel, compute closest point on L1 to L2, and\n                    // clamp to segment S1. Else pick some s (here .5f)\n                    if (denom != 0.0f)\n                        s = MathHelper.Clamp((b * f - c * e) / denom, 0.0f, 1.0f);\n                    else //Parallel, just use .5f\n                        s = .5f;\n\n\n                    t = (b * s + f) / e;\n\n                    if (t < 0)\n                    {\n                        //Closest point is before the segment.\n                        t = 0;\n                        s = MathHelper.Clamp(-c / a, 0, 1);\n                    }\n                    else if (t > 1)\n                    {\n                        //Closest point is after the segment.\n                        t = 1;\n                        s = MathHelper.Clamp((b - c) / a, 0, 1);\n                    }\n                }\n            }\n\n            Vector3.Multiply(ref d1, s, out c1);\n            Vector3.Add(ref c1, ref p1, out c1);\n            Vector3.Multiply(ref d2, t, out c2);\n            Vector3.Add(ref c2, ref p2, out c2);\n        }\n\n\n        /// <summary>\n        /// Computes closest points c1 and c2 betwen lines p1q1 and p2q2.\n        /// </summary>\n        /// <param name=\"p1\">First point of first segment.</param>\n        /// <param name=\"q1\">Second point of first segment.</param>\n        /// <param name=\"p2\">First point of second segment.</param>\n        /// <param name=\"q2\">Second point of second segment.</param>\n        /// <param name=\"s\">Distance along the line to the point for first segment.</param>\n        /// <param name=\"t\">Distance along the line to the point for second segment.</param>\n        /// <param name=\"c1\">Closest point on first segment.</param>\n        /// <param name=\"c2\">Closest point on second segment.</param>\n        public static void GetClosestPointsBetweenLines(ref Vector3 p1, ref Vector3 q1, ref Vector3 p2, ref Vector3 q2,\n                                                           out float s, out float t, out Vector3 c1, out Vector3 c2)\n        {\n            //Segment direction vectors\n            Vector3 d1;\n            Vector3.Subtract(ref q1, ref p1, out d1);\n            Vector3 d2;\n            Vector3.Subtract(ref q2, ref p2, out d2);\n            Vector3 r;\n            Vector3.Subtract(ref p1, ref p2, out r);\n            //distance\n            float a = d1.LengthSquared();\n            float e = d2.LengthSquared();\n            float f;\n            Vector3.Dot(ref d2, ref r, out f);\n\n            if (a <= Epsilon && e <= Epsilon)\n            {\n                //These segments are more like points.\n                s = t = 0.0f;\n                c1 = p1;\n                c2 = p2;\n                return;\n            }\n            if (a <= Epsilon)\n            {\n                // First segment is basically a point.\n                s = 0.0f;\n                t = MathHelper.Clamp(f / e, 0.0f, 1.0f);\n            }\n            else\n            {\n                float c = Vector3.Dot(d1, r);\n                if (e <= Epsilon)\n                {\n                    // Second segment is basically a point.\n                    t = 0.0f;\n                    s = MathHelper.Clamp(-c / a, 0.0f, 1.0f);\n                }\n                else\n                {\n                    float b = Vector3.Dot(d1, d2);\n                    float denom = a * e - b * b;\n\n                    // If segments not parallel, compute closest point on L1 to L2, and\n                    // clamp to segment S1. Else pick some s (here .5f)\n                    if (denom != 0f)\n                        s = (b * f - c * e) / denom;\n                    else //Parallel, just use .5f\n                        s = .5f;\n\n\n                    t = (b * s + f) / e;\n                }\n            }\n\n            Vector3.Multiply(ref d1, s, out c1);\n            Vector3.Add(ref c1, ref p1, out c1);\n            Vector3.Multiply(ref d2, t, out c2);\n            Vector3.Add(ref c2, ref p2, out c2);\n        }\n\n\n\n        #endregion\n\n\n        #region Point-Plane Tests\n\n        /// <summary>\n        /// Determines if vectors o and p are on opposite sides of the plane defined by a, b, and c.\n        /// </summary>\n        /// <param name=\"o\">First point for comparison.</param>\n        /// <param name=\"p\">Second point for comparison.</param>\n        /// <param name=\"a\">First vertex of the plane.</param>\n        /// <param name=\"b\">Second vertex of plane.</param>\n        /// <param name=\"c\">Third vertex of plane.</param>\n        /// <returns>Whether or not vectors o and p reside on opposite sides of the plane.</returns>\n        public static bool ArePointsOnOppositeSidesOfPlane(ref Vector3 o, ref Vector3 p, ref Vector3 a, ref Vector3 b, ref Vector3 c)\n        {\n            Vector3 ab, ac, ap, ao;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3.Subtract(ref c, ref a, out ac);\n            Vector3.Subtract(ref p, ref a, out ap);\n            Vector3.Subtract(ref o, ref a, out ao);\n            Vector3 q;\n            Vector3.Cross(ref ab, ref ac, out q);\n            float signp;\n            Vector3.Dot(ref ap, ref q, out signp);\n            float signo;\n            Vector3.Dot(ref ao, ref q, out signo);\n            if (signp * signo <= 0)\n                return true;\n            return false;\n        }\n\n        /// <summary>\n        /// Determines the distance between a point and a plane..\n        /// </summary>\n        /// <param name=\"point\">Point to project onto plane.</param>\n        /// <param name=\"normal\">Normal of the plane.</param>\n        /// <param name=\"pointOnPlane\">Point located on the plane.</param>\n        /// <returns>Distance from the point to the plane.</returns>\n        public static float GetDistancePointToPlane(ref Vector3 point, ref Vector3 normal, ref Vector3 pointOnPlane)\n        {\n            Vector3 offset;\n            Vector3.Subtract(ref point, ref pointOnPlane, out offset);\n            float dot;\n            Vector3.Dot(ref normal, ref offset, out dot);\n            return dot / normal.LengthSquared();\n        }\n\n        /// <summary>\n        /// Determines the location of the point when projected onto the plane defined by the normal and a point on the plane.\n        /// </summary>\n        /// <param name=\"point\">Point to project onto plane.</param>\n        /// <param name=\"normal\">Normal of the plane.</param>\n        /// <param name=\"pointOnPlane\">Point located on the plane.</param>\n        /// <param name=\"projectedPoint\">Projected location of point onto plane.</param>\n        public static void GetPointProjectedOnPlane(ref Vector3 point, ref Vector3 normal, ref Vector3 pointOnPlane, out Vector3 projectedPoint)\n        {\n            float dot;\n            Vector3.Dot(ref normal, ref point, out dot);\n            float dot2;\n            Vector3.Dot(ref pointOnPlane, ref normal, out dot2);\n            float t = (dot - dot2) / normal.LengthSquared();\n            Vector3 multiply;\n            Vector3.Multiply(ref normal, t, out multiply);\n            Vector3.Subtract(ref point, ref multiply, out projectedPoint);\n        }\n\n        /// <summary>\n        /// Determines if a point is within a set of planes defined by the edges of a triangle.\n        /// </summary>\n        /// <param name=\"point\">Point for comparison.</param>\n        /// <param name=\"planes\">Edge planes.</param>\n        /// <param name=\"centroid\">A point known to be inside of the planes.</param>\n        /// <returns>Whether or not the point is within the edge planes.</returns>\n        public static bool IsPointWithinFaceExtrusion(Vector3 point, List<Plane> planes, Vector3 centroid)\n        {\n            foreach (Plane plane in planes)\n            {\n                float centroidPlaneDot;\n                plane.DotCoordinate(ref centroid, out centroidPlaneDot);\n                float pointPlaneDot;\n                plane.DotCoordinate(ref point, out pointPlaneDot);\n                if (!((centroidPlaneDot <= Epsilon && pointPlaneDot <= Epsilon) || (centroidPlaneDot >= -Epsilon && pointPlaneDot >= -Epsilon)))\n                {\n                    //Point's NOT the same side of the centroid, so it's 'outside.'\n                    return false;\n                }\n            }\n            return true;\n        }\n\n\n        #endregion\n\n        #region Tetrahedron Tests\n        //Note: These methods are unused in modern systems, but are kept around for verification.\n\n        /// <summary>\n        /// Determines the closest point on a tetrahedron to a provided point p.\n        /// </summary>\n        /// <param name=\"a\">First vertex of the tetrahedron.</param>\n        /// <param name=\"b\">Second vertex of the tetrahedron.</param>\n        /// <param name=\"c\">Third vertex of the tetrahedron.</param>\n        /// <param name=\"d\">Fourth vertex of the tetrahedron.</param>\n        /// <param name=\"p\">Point for comparison.</param>\n        /// <param name=\"closestPoint\">Closest point on the tetrahedron to the point.</param>\n        public static void GetClosestPointOnTetrahedronToPoint(ref Vector3 a, ref Vector3 b, ref Vector3 c, ref Vector3 d, ref Vector3 p, out Vector3 closestPoint)\n        {\n            // Start out assuming point inside all halfspaces, so closest to itself\n            closestPoint = p;\n            Vector3 pq;\n            Vector3 q;\n            float bestSqDist = float.MaxValue;\n            // If point outside face abc then compute closest point on abc\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref d, ref a, ref b, ref c))\n            {\n                GetClosestPointOnTriangleToPoint(ref a, ref b, ref c, ref p, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.X * pq.X + pq.Y * pq.Y + pq.Z * pq.Z;\n                // Update best closest point if (squared) distance is less than current best\n                if (sqDist < bestSqDist)\n                {\n                    bestSqDist = sqDist;\n                    closestPoint = q;\n                }\n            }\n            // Repeat test for face acd\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref b, ref a, ref c, ref d))\n            {\n                GetClosestPointOnTriangleToPoint(ref a, ref c, ref d, ref p, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.X * pq.X + pq.Y * pq.Y + pq.Z * pq.Z;\n                if (sqDist < bestSqDist)\n                {\n                    bestSqDist = sqDist;\n                    closestPoint = q;\n                }\n            }\n            // Repeat test for face adb\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref c, ref a, ref d, ref b))\n            {\n                GetClosestPointOnTriangleToPoint(ref a, ref d, ref b, ref p, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.X * pq.X + pq.Y * pq.Y + pq.Z * pq.Z;\n                if (sqDist < bestSqDist)\n                {\n                    bestSqDist = sqDist;\n                    closestPoint = q;\n                }\n            }\n            // Repeat test for face bdc\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref a, ref b, ref d, ref c))\n            {\n                GetClosestPointOnTriangleToPoint(ref b, ref d, ref c, ref p, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.X * pq.X + pq.Y * pq.Y + pq.Z * pq.Z;\n                if (sqDist < bestSqDist)\n                {\n                    closestPoint = q;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines the closest point on a tetrahedron to a provided point p.\n        /// </summary>\n        /// <param name=\"a\">First vertex of the tetrahedron.</param>\n        /// <param name=\"b\">Second vertex of the tetrahedron.</param>\n        /// <param name=\"c\">Third vertex of the tetrahedron.</param>\n        /// <param name=\"d\">Fourth vertex of the tetrahedron.</param>\n        /// <param name=\"p\">Point for comparison.</param>\n        /// <param name=\"subsimplex\">The source of the voronoi region which contains the point.</param>\n        /// <param name=\"closestPoint\">Closest point on the tetrahedron to the point.</param>\n        [Obsolete(\"This method was used for older GJK simplex tests.  If you need simplex tests, consider the PairSimplex class and its variants.\")]\n        public static void GetClosestPointOnTetrahedronToPoint(ref Vector3 a, ref Vector3 b, ref Vector3 c, ref Vector3 d, ref Vector3 p, RawList<Vector3> subsimplex, out Vector3 closestPoint)\n        {\n            // Start out assuming point inside all halfspaces, so closest to itself\n            subsimplex.Clear();\n            subsimplex.Add(a); //Provides a baseline; if the object is not outside of any planes, then it's inside and the subsimplex is the tetrahedron itself.\n            subsimplex.Add(b);\n            subsimplex.Add(c);\n            subsimplex.Add(d);\n            closestPoint = p;\n            Vector3 pq;\n            Vector3 q;\n            float bestSqDist = float.MaxValue;\n            // If point outside face abc then compute closest point on abc\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref d, ref a, ref b, ref c))\n            {\n                GetClosestPointOnTriangleToPoint(ref a, ref b, ref c, ref p, subsimplex, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.X * pq.X + pq.Y * pq.Y + pq.Z * pq.Z;\n                // Update best closest point if (squared) distance is less than current best\n                if (sqDist < bestSqDist)\n                {\n                    bestSqDist = sqDist;\n                    closestPoint = q;\n                }\n            }\n            // Repeat test for face acd\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref b, ref a, ref c, ref d))\n            {\n                GetClosestPointOnTriangleToPoint(ref a, ref c, ref d, ref p, subsimplex, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.X * pq.X + pq.Y * pq.Y + pq.Z * pq.Z;\n                if (sqDist < bestSqDist)\n                {\n                    bestSqDist = sqDist;\n                    closestPoint = q;\n                }\n            }\n            // Repeat test for face adb\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref c, ref a, ref d, ref b))\n            {\n                GetClosestPointOnTriangleToPoint(ref a, ref d, ref b, ref p, subsimplex, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.X * pq.X + pq.Y * pq.Y + pq.Z * pq.Z;\n                if (sqDist < bestSqDist)\n                {\n                    bestSqDist = sqDist;\n                    closestPoint = q;\n                }\n            }\n            // Repeat test for face bdc\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref a, ref b, ref d, ref c))\n            {\n                GetClosestPointOnTriangleToPoint(ref b, ref d, ref c, ref p, subsimplex, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.X * pq.X + pq.Y * pq.Y + pq.Z * pq.Z;\n                if (sqDist < bestSqDist)\n                {\n                    closestPoint = q;\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines the closest point on a tetrahedron to a provided point p.\n        /// </summary>\n        /// <param name=\"tetrahedron\">List of 4 points composing the tetrahedron.</param>\n        /// <param name=\"p\">Point for comparison.</param>\n        /// <param name=\"subsimplex\">The source of the voronoi region which contains the point, enumerated as a = 0, b = 1, c = 2, d = 3.</param>\n        /// <param name=\"baryCoords\">Barycentric coordinates of p on the tetrahedron.</param>\n        /// <param name=\"closestPoint\">Closest point on the tetrahedron to the point.</param>\n        [Obsolete(\"This method was used for older GJK simplex tests.  If you need simplex tests, consider the PairSimplex class and its variants.\")]\n        public static void GetClosestPointOnTetrahedronToPoint(RawList<Vector3> tetrahedron, ref Vector3 p, RawList<int> subsimplex, RawList<float> baryCoords, out Vector3 closestPoint)\n        {\n            var subsimplexCandidate = CommonResources.GetIntList();\n            var baryCoordsCandidate = CommonResources.GetFloatList();\n            Vector3 a = tetrahedron[0];\n            Vector3 b = tetrahedron[1];\n            Vector3 c = tetrahedron[2];\n            Vector3 d = tetrahedron[3];\n            closestPoint = p;\n            Vector3 pq;\n            float bestSqDist = float.MaxValue;\n            subsimplex.Clear();\n            subsimplex.Add(0); //Provides a baseline; if the object is not outside of any planes, then it's inside and the subsimplex is the tetrahedron itself.\n            subsimplex.Add(1);\n            subsimplex.Add(2);\n            subsimplex.Add(3);\n            baryCoords.Clear();\n            Vector3 q;\n            bool baryCoordsFound = false;\n\n            // If point outside face abc then compute closest point on abc\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref d, ref a, ref b, ref c))\n            {\n                GetClosestPointOnTriangleToPoint(tetrahedron, 0, 1, 2, ref p, subsimplexCandidate, baryCoordsCandidate, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.LengthSquared();\n                // Update best closest point if (squared) distance is less than current best\n                if (sqDist < bestSqDist)\n                {\n                    bestSqDist = sqDist;\n                    closestPoint = q;\n                    subsimplex.Clear();\n                    baryCoords.Clear();\n                    for (int k = 0; k < subsimplexCandidate.Count; k++)\n                    {\n                        subsimplex.Add(subsimplexCandidate[k]);\n                        baryCoords.Add(baryCoordsCandidate[k]);\n                    }\n                    //subsimplex.AddRange(subsimplexCandidate);\n                    //baryCoords.AddRange(baryCoordsCandidate);\n                    baryCoordsFound = true;\n                }\n            }\n            // Repeat test for face acd\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref b, ref a, ref c, ref d))\n            {\n                GetClosestPointOnTriangleToPoint(tetrahedron, 0, 2, 3, ref p, subsimplexCandidate, baryCoordsCandidate, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.LengthSquared();\n                if (sqDist < bestSqDist)\n                {\n                    bestSqDist = sqDist;\n                    closestPoint = q;\n                    subsimplex.Clear();\n                    baryCoords.Clear();\n                    for (int k = 0; k < subsimplexCandidate.Count; k++)\n                    {\n                        subsimplex.Add(subsimplexCandidate[k]);\n                        baryCoords.Add(baryCoordsCandidate[k]);\n                    }\n                    //subsimplex.AddRange(subsimplexCandidate);\n                    //baryCoords.AddRange(baryCoordsCandidate);\n                    baryCoordsFound = true;\n                }\n            }\n            // Repeat test for face adb\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref c, ref a, ref d, ref b))\n            {\n                GetClosestPointOnTriangleToPoint(tetrahedron, 0, 3, 1, ref p, subsimplexCandidate, baryCoordsCandidate, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.LengthSquared();\n                if (sqDist < bestSqDist)\n                {\n                    bestSqDist = sqDist;\n                    closestPoint = q;\n                    subsimplex.Clear();\n                    baryCoords.Clear();\n                    for (int k = 0; k < subsimplexCandidate.Count; k++)\n                    {\n                        subsimplex.Add(subsimplexCandidate[k]);\n                        baryCoords.Add(baryCoordsCandidate[k]);\n                    }\n                    //subsimplex.AddRange(subsimplexCandidate);\n                    //baryCoords.AddRange(baryCoordsCandidate);\n                    baryCoordsFound = true;\n                }\n            }\n            // Repeat test for face bdc\n            if (ArePointsOnOppositeSidesOfPlane(ref p, ref a, ref b, ref d, ref c))\n            {\n                GetClosestPointOnTriangleToPoint(tetrahedron, 1, 3, 2, ref p, subsimplexCandidate, baryCoordsCandidate, out q);\n                Vector3.Subtract(ref q, ref p, out pq);\n                float sqDist = pq.LengthSquared();\n                if (sqDist < bestSqDist)\n                {\n                    closestPoint = q;\n                    subsimplex.Clear();\n                    baryCoords.Clear();\n                    for (int k = 0; k < subsimplexCandidate.Count; k++)\n                    {\n                        subsimplex.Add(subsimplexCandidate[k]);\n                        baryCoords.Add(baryCoordsCandidate[k]);\n                    }\n                    //subsimplex.AddRange(subsimplexCandidate);\n                    //baryCoords.AddRange(baryCoordsCandidate);\n                    baryCoordsFound = true;\n                }\n            }\n            if (!baryCoordsFound)\n            {\n                //subsimplex is the entire tetrahedron, can only occur when objects intersect!  Determinants of each of the tetrahedrons based on triangles composing the sides and the point itself.\n                //This is basically computing the volume of parallelepipeds (triple scalar product).\n                //Could be quicker just to do it directly.\n                float abcd = (new Matrix(tetrahedron[0].X, tetrahedron[0].Y, tetrahedron[0].Z, 1,\n                                         tetrahedron[1].X, tetrahedron[1].Y, tetrahedron[1].Z, 1,\n                                         tetrahedron[2].X, tetrahedron[2].Y, tetrahedron[2].Z, 1,\n                                         tetrahedron[3].X, tetrahedron[3].Y, tetrahedron[3].Z, 1)).Determinant();\n                float pbcd = (new Matrix(p.X, p.Y, p.Z, 1,\n                                         tetrahedron[1].X, tetrahedron[1].Y, tetrahedron[1].Z, 1,\n                                         tetrahedron[2].X, tetrahedron[2].Y, tetrahedron[2].Z, 1,\n                                         tetrahedron[3].X, tetrahedron[3].Y, tetrahedron[3].Z, 1)).Determinant();\n                float apcd = (new Matrix(tetrahedron[0].X, tetrahedron[0].Y, tetrahedron[0].Z, 1,\n                                         p.X, p.Y, p.Z, 1,\n                                         tetrahedron[2].X, tetrahedron[2].Y, tetrahedron[2].Z, 1,\n                                         tetrahedron[3].X, tetrahedron[3].Y, tetrahedron[3].Z, 1)).Determinant();\n                float abpd = (new Matrix(tetrahedron[0].X, tetrahedron[0].Y, tetrahedron[0].Z, 1,\n                                         tetrahedron[1].X, tetrahedron[1].Y, tetrahedron[1].Z, 1,\n                                         p.X, p.Y, p.Z, 1,\n                                         tetrahedron[3].X, tetrahedron[3].Y, tetrahedron[3].Z, 1)).Determinant();\n                abcd = 1 / abcd;\n                baryCoords.Add(pbcd * abcd); //u\n                baryCoords.Add(apcd * abcd); //v\n                baryCoords.Add(abpd * abcd); //w\n                baryCoords.Add(1 - baryCoords[0] - baryCoords[1] - baryCoords[2]); //x = 1-u-v-w\n            }\n            CommonResources.GiveBack(subsimplexCandidate);\n            CommonResources.GiveBack(baryCoordsCandidate);\n        }\n\n        #endregion\n\n\n\n\n\n        #region Miscellaneous\n\n        ///<summary>\n        /// Tests a ray against a sphere.\n        ///</summary>\n        ///<param name=\"ray\">Ray to test.</param>\n        ///<param name=\"spherePosition\">Position of the sphere.</param>\n        ///<param name=\"radius\">Radius of the sphere.</param>\n        ///<param name=\"maximumLength\">Maximum length of the ray in units of the ray direction's length.</param>\n        ///<param name=\"hit\">Hit data of the ray, if any.</param>\n        ///<returns>Whether or not the ray hits the sphere.</returns>\n        public static bool RayCastSphere(ref Ray ray, ref Vector3 spherePosition, float radius, float maximumLength, out RayHit hit)\n        {\n            Vector3 normalizedDirection;\n            float length = ray.Direction.Length();\n            Vector3.Divide(ref ray.Direction, length, out normalizedDirection);\n            maximumLength *= length;\n            hit = new RayHit();\n            Vector3 m;\n            Vector3.Subtract(ref ray.Position, ref spherePosition, out m);\n            float b = Vector3.Dot(m, normalizedDirection);\n            float c = m.LengthSquared() - radius * radius;\n\n            if (c > 0 && b > 0)\n                return false;\n            float discriminant = b * b - c;\n            if (discriminant < 0)\n                return false;\n\n            hit.T = -b - (float)Math.Sqrt(discriminant);\n            if (hit.T < 0)\n                hit.T = 0;\n            if (hit.T > maximumLength)\n                return false;\n            hit.T /= length;\n            Vector3.Multiply(ref normalizedDirection, hit.T, out hit.Location);\n            Vector3.Add(ref hit.Location, ref ray.Position, out hit.Location);\n            Vector3.Subtract(ref hit.Location, ref spherePosition, out hit.Normal);\n            hit.Normal.Normalize();\n            return true;\n        }\n\n\n        /// <summary>\n        /// Computes the velocity of a point as if it were attached to an object with the given center and velocity.\n        /// </summary>\n        /// <param name=\"point\">Point to compute the velocity of.</param>\n        /// <param name=\"center\">Center of the object to which the point is attached.</param>\n        /// <param name=\"linearVelocity\">Linear velocity of the object.</param>\n        /// <param name=\"angularVelocity\">Angular velocity of the object.</param>\n        /// <param name=\"velocity\">Velocity of the point.</param>\n        public static void GetVelocityOfPoint(ref Vector3 point, ref Vector3 center, ref Vector3 linearVelocity, ref Vector3 angularVelocity, out Vector3 velocity)\n        {\n            Vector3 offset;\n            Vector3.Subtract(ref point, ref center, out offset);\n            Vector3.Cross(ref angularVelocity, ref offset, out velocity);\n            Vector3.Add(ref velocity, ref linearVelocity, out velocity);\n        }\n\n        /// <summary>\n        /// Computes the velocity of a point as if it were attached to an object with the given center and velocity.\n        /// </summary>\n        /// <param name=\"point\">Point to compute the velocity of.</param>\n        /// <param name=\"center\">Center of the object to which the point is attached.</param>\n        /// <param name=\"linearVelocity\">Linear velocity of the object.</param>\n        /// <param name=\"angularVelocity\">Angular velocity of the object.</param>\n        /// <returns>Velocity of the point.</returns>\n        public static Vector3 GetVelocityOfPoint(Vector3 point, Vector3 center, Vector3 linearVelocity, Vector3 angularVelocity)\n        {\n            Vector3 toReturn;\n            GetVelocityOfPoint(ref point, ref center, ref linearVelocity, ref angularVelocity, out toReturn);\n            return toReturn;\n        }\n\n        /// <summary>\n        /// Expands a bounding box by the given sweep.\n        /// </summary>\n        /// <param name=\"boundingBox\">Bounding box to expand.</param>\n        /// <param name=\"sweep\">Sweep to expand the bounding box with.</param>\n        public static void ExpandBoundingBox(ref BoundingBox boundingBox, ref Vector3 sweep)\n        {\n            if (sweep.X > 0)\n                boundingBox.Max.X += sweep.X;\n            else\n                boundingBox.Min.X += sweep.X;\n\n            if (sweep.Y > 0)\n                boundingBox.Max.Y += sweep.Y;\n            else\n                boundingBox.Min.Y += sweep.Y;\n\n            if (sweep.Z > 0)\n                boundingBox.Max.Z += sweep.Z;\n            else\n                boundingBox.Min.Z += sweep.Z;\n        }\n\n        /// <summary>\n        /// Computes the bounding box of three points.\n        /// </summary>\n        /// <param name=\"a\">First vertex of the triangle.</param>\n        /// <param name=\"b\">Second vertex of the triangle.</param>\n        /// <param name=\"c\">Third vertex of the triangle.</param>\n        /// <param name=\"aabb\">Bounding box of the triangle.</param>\n        public static void GetTriangleBoundingBox(ref Vector3 a, ref Vector3 b, ref Vector3 c, out BoundingBox aabb)\n        {\n#if !WINDOWS\n            aabb = new BoundingBox();\n#endif\n            //X axis\n            if (a.X > b.X && a.X > c.X)\n            {\n                //A is max\n                aabb.Max.X = a.X;\n                aabb.Min.X = b.X > c.X ? c.X : b.X;\n            }\n            else if (b.X > c.X)\n            {\n                //B is max\n                aabb.Max.X = b.X;\n                aabb.Min.X = a.X > c.X ? c.X : a.X;\n            }\n            else\n            {\n                //C is max\n                aabb.Max.X = c.X;\n                aabb.Min.X = a.X > b.X ? b.X : a.X;\n            }\n            //Y axis\n            if (a.Y > b.Y && a.Y > c.Y)\n            {\n                //A is max\n                aabb.Max.Y = a.Y;\n                aabb.Min.Y = b.Y > c.Y ? c.Y : b.Y;\n            }\n            else if (b.Y > c.Y)\n            {\n                //B is max\n                aabb.Max.Y = b.Y;\n                aabb.Min.Y = a.Y > c.Y ? c.Y : a.Y;\n            }\n            else\n            {\n                //C is max\n                aabb.Max.Y = c.Y;\n                aabb.Min.Y = a.Y > b.Y ? b.Y : a.Y;\n            }\n            //Z axis\n            if (a.Z > b.Z && a.Z > c.Z)\n            {\n                //A is max\n                aabb.Max.Z = a.Z;\n                aabb.Min.Z = b.Z > c.Z ? c.Z : b.Z;\n            }\n            else if (b.Z > c.Z)\n            {\n                //B is max\n                aabb.Max.Z = b.Z;\n                aabb.Min.Z = a.Z > c.Z ? c.Z : a.Z;\n            }\n            else\n            {\n                //C is max\n                aabb.Max.Z = c.Z;\n                aabb.Min.Z = a.Z > b.Z ? b.Z : a.Z;\n            }\n        }\n\n        /// <summary>\n        /// Computes the angle change represented by a normalized quaternion.\n        /// </summary>\n        /// <param name=\"q\">Quaternion to be converted.</param>\n        /// <returns>Angle around the axis represented by the quaternion.</returns>\n        public static float GetAngleFromQuaternion(ref Quaternion q)\n        {\n            float qw = Math.Abs(q.W);\n            if (qw > 1)\n                return 0;\n            return 2 * (float)Math.Acos(qw);\n        }\n\n        /// <summary>\n        /// Computes the axis angle representation of a normalized quaternion.\n        /// </summary>\n        /// <param name=\"q\">Quaternion to be converted.</param>\n        /// <param name=\"axis\">Axis represented by the quaternion.</param>\n        /// <param name=\"angle\">Angle around the axis represented by the quaternion.</param>\n        public static void GetAxisAngleFromQuaternion(ref Quaternion q, out Vector3 axis, out float angle)\n        {\n#if !WINDOWS\n            axis = new Vector3();\n#endif\n            float qx = q.X;\n            float qy = q.Y;\n            float qz = q.Z;\n            float qw = q.W;\n            if (qw < 0)\n            {\n                qx = -qx;\n                qy = -qy;\n                qz = -qz;\n                qw = -qw;\n            }\n            if (qw > 1 - 1e-12)\n            {\n                axis = UpVector;\n                angle = 0;\n            }\n            else\n            {\n                angle = 2 * (float)Math.Acos(qw);\n                float denominator = 1 / (float)Math.Sqrt(1 - qw * qw);\n                axis.X = qx * denominator;\n                axis.Y = qy * denominator;\n                axis.Z = qz * denominator;\n            }\n        }\n\n\n\n        /// <summary>\n        /// Computes the quaternion rotation between two normalized vectors.\n        /// </summary>\n        /// <param name=\"v1\">First unit-length vector.</param>\n        /// <param name=\"v2\">Second unit-length vector.</param>\n        /// <param name=\"q\">Quaternion representing the rotation from v1 to v2.</param>\n        public static void GetQuaternionBetweenNormalizedVectors(ref Vector3 v1, ref Vector3 v2, out Quaternion q)\n        {\n            float dot;\n            Vector3.Dot(ref v1, ref v2, out dot);\n            //For non-normal vectors, the multiplying the axes length squared would be necessary:\n            //float w = dot + (float)Math.Sqrt(v1.LengthSquared() * v2.LengthSquared());\n            if (dot < -0.9999f) //parallel, opposing direction\n            {\n                //Project onto the plane which has the lowest component magnitude.\n                if (v1.X < v1.Y && v1.X < v1.Z)\n                    q = new Quaternion(0, -v1.Z, v1.Y, 0);\n                else if (v1.Y < v1.Z)\n                    q = new Quaternion(-v1.Z, 0, v1.X, 0);\n                else\n                    q = new Quaternion(-v1.Y, -v1.X, 0, 0);\n            }\n            else\n            {\n                Vector3 axis;\n                Vector3.Cross(ref v1, ref v2, out axis);\n                q = new Quaternion(axis.X, axis.Y, axis.Z, dot + 1);\n            }\n            q.Normalize();\n        }\n\n\n\n\n        /// <summary>\n        /// Updates the quaternion using RK4 integration.\n        /// </summary>\n        /// <param name=\"q\">Quaternion to update.</param>\n        /// <param name=\"localInertiaTensorInverse\">Local-space inertia tensor of the object being updated.</param>\n        /// <param name=\"angularMomentum\">Angular momentum of the object.</param>\n        /// <param name=\"dt\">Time since last frame, in seconds.</param>\n        /// <param name=\"newOrientation\">New orientation quaternion.</param>\n        public static void UpdateOrientationRK4(ref Quaternion q, ref Matrix3x3 localInertiaTensorInverse, ref Vector3 angularMomentum, float dt, out Quaternion newOrientation)\n        {\n            //TODO: This is a little goofy\n            //Quaternion diff = differentiateQuaternion(ref q, ref localInertiaTensorInverse, ref angularMomentum);\n            Quaternion d1;\n            DifferentiateQuaternion(ref q, ref localInertiaTensorInverse, ref angularMomentum, out d1);\n            Quaternion s2;\n            Quaternion.Multiply(ref d1, dt * .5f, out s2);\n            Quaternion.Add(ref q, ref s2, out s2);\n\n            Quaternion d2;\n            DifferentiateQuaternion(ref s2, ref localInertiaTensorInverse, ref angularMomentum, out d2);\n            Quaternion s3;\n            Quaternion.Multiply(ref d2, dt * .5f, out s3);\n            Quaternion.Add(ref q, ref s3, out s3);\n\n            Quaternion d3;\n            DifferentiateQuaternion(ref s3, ref localInertiaTensorInverse, ref angularMomentum, out d3);\n            Quaternion s4;\n            Quaternion.Multiply(ref d3, dt, out s4);\n            Quaternion.Add(ref q, ref s4, out s4);\n\n            Quaternion d4;\n            DifferentiateQuaternion(ref s4, ref localInertiaTensorInverse, ref angularMomentum, out d4);\n\n            Quaternion.Multiply(ref d1, dt / 6, out d1);\n            Quaternion.Multiply(ref d2, dt / 3, out d2);\n            Quaternion.Multiply(ref d3, dt / 3, out d3);\n            Quaternion.Multiply(ref d4, dt / 6, out d4);\n            Quaternion added;\n            Quaternion.Add(ref q, ref d1, out added);\n            Quaternion.Add(ref added, ref d2, out added);\n            Quaternion.Add(ref added, ref d3, out added);\n            Quaternion.Add(ref added, ref d4, out added);\n            Quaternion.Normalize(ref added, out newOrientation);\n        }\n\n\n        /// <summary>\n        /// Finds the change in the rotation state quaternion provided the local inertia tensor and angular velocity.\n        /// </summary>\n        /// <param name=\"orientation\">Orienatation of the object.</param>\n        /// <param name=\"localInertiaTensorInverse\">Local-space inertia tensor of the object being updated.</param>\n        /// <param name=\"angularMomentum\">Angular momentum of the object.</param>\n        ///  <param name=\"orientationChange\">Change in quaternion.</param>\n        public static void DifferentiateQuaternion(ref Quaternion orientation, ref Matrix3x3 localInertiaTensorInverse, ref Vector3 angularMomentum, out Quaternion orientationChange)\n        {\n            Quaternion normalizedOrientation;\n            Quaternion.Normalize(ref orientation, out normalizedOrientation);\n            Matrix3x3 tempRotMat;\n            Matrix3x3.CreateFromQuaternion(ref normalizedOrientation, out tempRotMat);\n            Matrix3x3 tempInertiaTensorInverse;\n            Matrix3x3.MultiplyTransposed(ref tempRotMat, ref localInertiaTensorInverse, out tempInertiaTensorInverse);\n            Matrix3x3.Multiply(ref tempInertiaTensorInverse, ref tempRotMat, out tempInertiaTensorInverse);\n            Vector3 halfspin;\n            Matrix3x3.Transform(ref angularMomentum, ref tempInertiaTensorInverse, out halfspin);\n            Vector3.Multiply(ref halfspin, .5f, out halfspin);\n            var halfspinQuaternion = new Quaternion(halfspin.X, halfspin.Y, halfspin.Z, 0);\n            Quaternion.Multiply(ref halfspinQuaternion, ref normalizedOrientation, out orientationChange);\n        }\n\n\n        /// <summary>\n        /// Gets the barycentric coordinates of the point with respect to a triangle's vertices.\n        /// </summary>\n        /// <param name=\"p\">Point to compute the barycentric coordinates of.</param>\n        /// <param name=\"a\">First vertex in the triangle.</param>\n        /// <param name=\"b\">Second vertex in the triangle.</param>\n        /// <param name=\"c\">Third vertex in the triangle.</param>\n        /// <param name=\"aWeight\">Weight of the first vertex.</param>\n        /// <param name=\"bWeight\">Weight of the second vertex.</param>\n        /// <param name=\"cWeight\">Weight of the third vertex.</param>\n        public static void GetBarycentricCoordinates(ref Vector3 p, ref Vector3 a, ref Vector3 b, ref Vector3 c, out float aWeight, out float bWeight, out float cWeight)\n        {\n            Vector3 ab, ac;\n            Vector3.Subtract(ref b, ref a, out ab);\n            Vector3.Subtract(ref c, ref a, out ac);\n            Vector3 triangleNormal;\n            Vector3.Cross(ref ab, ref ac, out triangleNormal);\n            float x = triangleNormal.X < 0 ? -triangleNormal.X : triangleNormal.X;\n            float y = triangleNormal.Y < 0 ? -triangleNormal.Y : triangleNormal.Y;\n            float z = triangleNormal.Z < 0 ? -triangleNormal.Z : triangleNormal.Z;\n\n            float numeratorU, numeratorV, denominator;\n            if (x >= y && x >= z)\n            {\n                //The projection of the triangle on the YZ plane is the largest.\n                numeratorU = (p.Y - b.Y) * (b.Z - c.Z) - (b.Y - c.Y) * (p.Z - b.Z); //PBC\n                numeratorV = (p.Y - c.Y) * (c.Z - a.Z) - (c.Y - a.Y) * (p.Z - c.Z); //PCA\n                denominator = triangleNormal.X;\n            }\n            else if (y >= z)\n            {\n                //The projection of the triangle on the XZ plane is the largest.\n                numeratorU = (p.X - b.X) * (b.Z - c.Z) - (b.X - c.X) * (p.Z - b.Z); //PBC\n                numeratorV = (p.X - c.X) * (c.Z - a.Z) - (c.X - a.X) * (p.Z - c.Z); //PCA\n                denominator = -triangleNormal.Y;\n            }\n            else\n            {\n                //The projection of the triangle on the XY plane is the largest.\n                numeratorU = (p.X - b.X) * (b.Y - c.Y) - (b.X - c.X) * (p.Y - b.Y); //PBC\n                numeratorV = (p.X - c.X) * (c.Y - a.Y) - (c.X - a.X) * (p.Y - c.Y); //PCA\n                denominator = triangleNormal.Z;\n            }\n\n            if (denominator < -1e-9 || denominator > 1e-9)\n            {\n                denominator = 1 / denominator;\n                aWeight = numeratorU * denominator;\n                bWeight = numeratorV * denominator;\n                cWeight = 1 - aWeight - bWeight;\n            }\n            else\n            {\n                //It seems to be a degenerate triangle.\n                //In that case, pick one of the closest vertices.\n                //MOST of the time, this will happen when the vertices\n                //are all very close together (all three points form a single point).\n                //Sometimes, though, it could be that it's more of a line.\n                //If it's a little inefficient, don't worry- this is a corner case anyway.\n\n                float distance1, distance2, distance3;\n                Vector3.DistanceSquared(ref p, ref a, out distance1);\n                Vector3.DistanceSquared(ref p, ref b, out distance2);\n                Vector3.DistanceSquared(ref p, ref c, out distance3);\n                if (distance1 < distance2 && distance1 < distance3)\n                {\n                    aWeight = 1;\n                    bWeight = 0;\n                    cWeight = 0;\n                }\n                else if (distance2 < distance3)\n                {\n                    aWeight = 0;\n                    bWeight = 1;\n                    cWeight = 0;\n                }\n                else\n                {\n                    aWeight = 0;\n                    bWeight = 0;\n                    cWeight = 1;\n                }\n            }\n\n\n        }\n\n\n\n\n        #endregion\n\n\n\n\n\n\n\n    }\n}"
  },
  {
    "path": "BEPUutilities/TriangleSidedness.cs",
    "content": "﻿namespace BEPUutilities\n{\n    ///<summary>\n    /// Sidedness of a triangle or mesh.\n    /// A triangle can be double sided, or allow one of its sides to let interacting objects through.\n    ///</summary>\n    public enum TriangleSidedness\n    {\n        /// <summary>\n        /// The triangle will interact with objects coming from both directions.\n        /// </summary>\n        DoubleSided,\n        /// <summary>\n        /// The triangle will interact with objects from which the winding of the triangle appears to be clockwise.\n        /// </summary>\n        Clockwise,\n        /// <summary>\n        /// The triangle will interact with objects from which the winding of the triangle appears to be counterclockwise..\n        /// </summary>\n        Counterclockwise\n    }\n}\n"
  },
  {
    "path": "BEPUutilities/VoronoiRegion.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace BEPUphysics.CollisionTests\n{\n    public enum VoronoiRegion\n    {\n        A,\n        B,\n        C,\n        AB,\n        AC,\n        BC,\n        ABC\n    }\n}\n"
  },
  {
    "path": "ComponentBind/BaseMain.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\n\nnamespace ComponentBind\n{\n\tpublic class BaseMain : Microsoft.Xna.Framework.Game\n\t{\n\t\tpublic Command<Entity> EntityAdded = new Command<Entity>();\n\t\tpublic Command<Entity> EntityRemoved = new Command<Entity>();\n\n\t\tpublic Property<bool> Paused = new Property<bool>();\n\n\t\tpublic Property<float> ElapsedTime = new Property<float>();\n\t\tpublic Property<float> TotalTime = new Property<float>();\n\n\t\tpublic Property<bool> EditorEnabled = new Property<bool> { Value = false };\n\n\t\tpublic GameTime GameTime;\n\n\t\tpublic ListProperty<Entity> Entities;\n\n\t\tprotected List<IComponent> componentsToRemove = new List<IComponent>();\n\t\tprotected List<IComponent> componentsToAdd = new List<IComponent>();\n\n\t\tpublic void Add(Entity entity)\n\t\t{\n\t\t\tif (entity.Active && !entity.Added)\n\t\t\t{\n\t\t\t\tentity.Added = true;\n\t\t\t\tthis.Entities.Add(entity);\n\t\t\t\tthis.EntityAdded.Execute(entity);\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddComponent(IComponent component)\n\t\t{\n\t\t\tif (this.EditorEnabled || component.Entity == null || component.Entity.CannotSuspend)\n\t\t\t\tcomponent.Suspended.Value = false;\n\n\t\t\tcomponent.SetMain(this);\n\t\t\tif (typeof(IGraphicsComponent).IsAssignableFrom(component.GetType()))\n\t\t\t\t((IGraphicsComponent)component).LoadContent(false);\n\t\t\tcomponent.Awake();\n\t\t\tthis.componentsToAdd.Add(component);\n\t\t}\n\n\t\tpublic void RemoveComponent(IComponent component)\n\t\t{\n\t\t\tthis.componentsToRemove.Add(component);\n\t\t}\n\n\t\tpublic void Remove(Entity entity)\n\t\t{\n\t\t\tif (entity.Active)\n\t\t\t{\n\t\t\t\t// Trigger all delete commands\n\t\t\t\t// then call this Remove function again, but this time the entity will be inactive.\n\t\t\t\tentity.Delete.Execute();\n\t\t\t}\n\t\t\telse if (entity.Added)\n\t\t\t{\n\t\t\t\tentity.Added = false;\n\t\t\t\tthis.Entities.Remove(entity);\n\t\t\t\tthis.EntityRemoved.Execute(entity);\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<Entity> Get(string type)\n\t\t{\n\t\t\treturn this.Entities.Where(x => x.Type == type && x.Active);\n\t\t}\n\n\t\tpublic Entity GetByID(string id)\n\t\t{\n\t\t\treturn Entity.GetByID(id);\n\t\t}\n\n\t\tpublic Entity GetByGUID(ulong id)\n\t\t{\n\t\t\treturn Entity.GetByGUID(id);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "ComponentBind/Binding.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ComponentBind\n{\n\tpublic interface IBinding\n\t{\n\t\tvoid Delete();\n\t}\n\n\tpublic interface IPropertyBinding : IBinding\n\t{\n\t\tvoid OnChanged(IProperty changed);\n\t}\n\n\tpublic class Binding<Type, Type2> : IPropertyBinding\n\t{\n\t\tprotected Property<Type> destination;\n\t\tprotected Func<Type> get;\n\t\tprotected IProperty[] sources;\n\n\t\tprotected Binding()\n\t\t{\n\n\t\t}\n\n\t\tpublic Binding(Property<Type> _destination, Func<Type2, Type> transform, Property<Type2> _source)\n\t\t{\n\t\t\tthis.destination = _destination;\n\t\t\t_source.AddBinding(this);\n\t\t\tthis.get = () => transform(_source.Value);\n\t\t\tthis.sources = new IProperty[] { _source };\n\t\t\tthis.OnChanged(_source);\n\t\t}\n\n\t\tpublic virtual void OnChanged(IProperty changed)\n\t\t{\n\t\t\tthis.destination.InternalSet(this.get(), this);\n\t\t}\n\n\t\tpublic virtual void Delete()\n\t\t{\n\t\t\tfor (int i = 0; i < this.sources.Length; i++)\n\t\t\t\tthis.sources[i].RemoveBinding(this);\n\t\t\tthis.sources = null;\n\t\t\tthis.get = null;\n\t\t\tthis.destination = null;\n\t\t}\n\t}\n\n\tpublic class SetBinding<Type> : IPropertyBinding\n\t{\n\t\tprotected Action<Type> notify;\n\t\tprotected Property<Type> source;\n\n\t\tprotected SetBinding()\n\t\t{\n\n\t\t}\n\n\t\tpublic SetBinding(Property<Type> source, Action<Type> _notify)\n\t\t{\n\t\t\tthis.notify = _notify;\n\t\t\tthis.source = source;\n\t\t\tsource.AddBinding(this);\n\t\t\tType v = this.source.Value;\n\t\t\tif (v != null)\n\t\t\t\tthis.notify(v);\n\t\t}\n\n\t\tpublic void OnChanged(IProperty changed)\n\t\t{\n\t\t\tthis.notify(this.source.Value);\n\t\t}\n\n\t\tpublic void Delete()\n\t\t{\n\t\t\tthis.source.RemoveBinding(this);\n\t\t\tthis.notify = null;\n\t\t\tthis.source = null;\n\t\t}\n\t}\n\n\tpublic class ChangeBinding<Type> : IPropertyBinding\n\t{\n\t\tprotected Action<Type, Type> notify;\n\t\tprotected Property<Type> source;\n\t\tprotected Type value;\n\n\t\tprotected ChangeBinding()\n\t\t{\n\n\t\t}\n\n\t\tpublic ChangeBinding(Property<Type> source, Action<Type, Type> _notify)\n\t\t{\n\t\t\tthis.notify = _notify;\n\t\t\tthis.source = source;\n\t\t\tthis.value = source.Value;\n\t\t\tsource.AddBinding(this);\n\t\t\tif (this.value != null && !this.value.Equals(default(Type)))\n\t\t\t\tthis.notify(default(Type), this.value);\n\t\t}\n\n\t\tpublic void OnChanged(IProperty changed)\n\t\t{\n\t\t\tType old = this.value;\n\t\t\tthis.value = this.source.Value;\n\t\t\tthis.notify(old, this.value);\n\t\t}\n\n\t\tpublic void Delete()\n\t\t{\n\t\t\tthis.source.RemoveBinding(this);\n\t\t\tthis.notify = null;\n\t\t\tthis.source = null;\n\t\t}\n\t}\n\n\tpublic class NotifyBinding : IPropertyBinding\n\t{\n\t\tprotected Action notify;\n\t\tprotected IProperty[] sources;\n\n\t\tprotected NotifyBinding()\n\t\t{\n\n\t\t}\n\n\t\tpublic NotifyBinding(Action _notify, params IProperty[] _sources)\n\t\t{\n\t\t\tthis.notify = _notify;\n\t\t\tthis.sources = _sources;\n\t\t\tfor (int i = 0; i < this.sources.Length; i++)\n\t\t\t\tthis.sources[i].AddBinding(this);\n\t\t}\n\n\t\tpublic void OnChanged(IProperty changed)\n\t\t{\n\t\t\tthis.notify();\n\t\t}\n\n\t\tpublic void Delete()\n\t\t{\n\t\t\tfor (int i = 0; i < this.sources.Length; i++)\n\t\t\t\tthis.sources[i].RemoveBinding(this);\n\t\t\tthis.notify = null;\n\t\t\tthis.sources = null;\n\t\t}\n\t}\n\n\tpublic class Binding<Type> : Binding<Type, Type>\n\t{\n\t\tprotected Binding()\n\t\t{\n\t\t}\n\n\t\tpublic Binding(Property<Type> _destination, Property<Type> _source)\n\t\t\t: base(_destination, x => x, _source)\n\t\t{\n\n\t\t}\n\n\t\tpublic Binding(Property<Type> _destination, Func<Type, Type> transform, Property<Type> _source)\n\t\t\t: base(_destination, transform, _source)\n\t\t{\n\n\t\t}\n\n\t\tpublic Binding(Property<Type> _destination, Func<Type> _get, params IProperty[] _sources)\n\t\t{\n\t\t\tthis.destination = _destination;\n\t\t\tthis.get = _get;\n\t\t\tthis.sources = _sources;\n\t\t\tfor (int i = 0; i < this.sources.Length; i++)\n\t\t\t\tthis.sources[i].AddBinding(this);\n\t\t\tthis.OnChanged(_sources.FirstOrDefault());\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Important: When initializing, the first given property takes precedence.\n\t/// </summary>\n\t/// <typeparam name=\"Type\"></typeparam>\n\t/// <typeparam name=\"Type2\"></typeparam>\n\tpublic class TwoWayBinding<Type, Type2> : Binding<Type, Type2>\n\t{\n\t\tprotected Property<Type> property1;\n\t\tprotected IProperty[] property1Sources;\n\t\tprotected Property<Type2> property2;\n\t\tprotected IProperty[] property2Sources;\n\t\tprotected Func<Type2, Type> transform1;\n\t\tprotected Func<Type, Type2> transform2;\n\n\t\tprotected bool reevaluating = false;\n\n\t\tprotected TwoWayBinding()\n\t\t{\n\n\t\t}\n\n\t\tpublic TwoWayBinding(\n\t\t\tProperty<Type> _property1,\n\t\t\tFunc<Type2, Type> _transform1,\n\t\t\tProperty<Type2> _property2,\n\t\t\tFunc<Type, Type2> _transform2)\n\t\t\t: this(_property1, _transform1, new IProperty[] { }, _property2, _transform2, new IProperty[] { })\n\t\t{\n\t\t}\n\n\t\tpublic TwoWayBinding(\n\t\t\tProperty<Type> _property1,\n\t\t\tFunc<Type2, Type> _transform1,\n\t\t\tIEnumerable<IProperty> _property1Sources,\n\t\t\tProperty<Type2> _property2,\n\t\t\tFunc<Type, Type2> _transform2,\n\t\t\tIEnumerable<IProperty> _property2Sources)\n\t\t{\n\t\t\tthis.property1 = _property1;\n\t\t\tthis.property2 = _property2;\n\t\t\tthis.property1Sources = _property1Sources.Union(new IProperty[] { this.property2 }).ToArray();\n\t\t\tthis.property2Sources = _property2Sources.Union(new IProperty[] { this.property1 }).ToArray();\n\t\t\tthis.transform1 = _transform1;\n\t\t\tthis.transform2 = _transform2;\n\t\t\tfor (int i = 0; i < this.property1Sources.Length; i++)\n\t\t\t\tthis.property1Sources[i].AddBinding(this);\n\t\t\tfor (int i = 0; i < this.property2Sources.Length; i++)\n\t\t\t\tthis.property2Sources[i].AddBinding(this);\n\t\t\tthis.OnChanged(this.property1);\n\t\t}\n\n\t\tpublic void Reevaluate(IProperty destination)\n\t\t{\n\t\t\tif (!this.reevaluating)\n\t\t\t{\n\t\t\t\tthis.reevaluating = true;\n\t\t\t\tif (destination == this.property1)\n\t\t\t\t\tthis.property1.InternalSet(this.transform1(this.property2.Value), this);\n\t\t\t\telse if (destination == this.property2)\n\t\t\t\t\tthis.property2.InternalSet(this.transform2(this.property1.Value), this);\n\t\t\t\telse\n\t\t\t\t\tthrow new ArgumentException(\"Binding received improper property change notification.\");\n\t\t\t\tthis.reevaluating = false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void OnChanged(IProperty changed)\n\t\t{\n\t\t\tif (this.property2Sources.Contains(changed))\n\t\t\t\tthis.property2.InternalSet(this.transform2(this.property1.Value), this);\n\t\t\telse if (this.property1Sources.Contains(changed))\n\t\t\t\tthis.property1.InternalSet(this.transform1(this.property2.Value), this);\n\t\t\telse\n\t\t\t\tthrow new ArgumentException(\"Binding received improper property change notification.\");\n\t\t}\n\n\t\tpublic override void Delete()\n\t\t{\n\t\t\tfor (int i = 0; i < this.property1Sources.Length; i++)\n\t\t\t\tthis.property1Sources[i].RemoveBinding(this);\n\t\t\tfor (int i = 0; i < this.property2Sources.Length; i++)\n\t\t\t\tthis.property2Sources[i].RemoveBinding(this);\n\t\t\tthis.property1 = null;\n\t\t\tthis.property1Sources = null;\n\t\t\tthis.property2 = null;\n\t\t\tthis.property2Sources = null;\n\t\t\tthis.transform1 = null;\n\t\t\tthis.transform2 = null;\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Important: When initializing, the first given property takes precedence.\n\t/// </summary>\n\t/// <typeparam name=\"Type\"></typeparam>\n\tpublic class TwoWayBinding<Type> : TwoWayBinding<Type, Type>\n\t{\n\t\tprotected TwoWayBinding()\n\t\t{\n\t\t}\n\n\t\tpublic TwoWayBinding(Property<Type> _property1, Property<Type> _property2)\n\t\t\t: base(_property1, x => x, _property2, x => x)\n\t\t{\n\t\t}\n\t}\n\n\tpublic interface IListBinding<Type> : IPropertyBinding\n\t{\n\t\tvoid Add(Type x, IProperty property);\n\t\tvoid Remove(Type x, IProperty property);\n\t\tvoid OnChanged(Type x, Type y, IProperty property);\n\t\tvoid Clear(IProperty property);\n\t}\n\n\tpublic class ListBinding<Type, Type2> : IListBinding<Type2>\n\t{\n\t\tprotected class Entry\n\t\t{\n\t\t\tpublic int Index;\n\t\t}\n\t\tprotected ListProperty<Type> destination;\n\t\tprotected Func<Type2, Type> transform;\n\t\tprotected Func<Type2, bool> filter;\n\t\tprotected Dictionary<Type2, Entry> mapping = new Dictionary<Type2, Entry>();\n\t\tprotected IProperty[] sources;\n\n\t\tpublic bool Enabled { get; set; }\n\n\t\tprotected ListBinding()\n\t\t{\n\t\t\tthis.Enabled = true;\n\t\t}\n\n\t\tpublic ListBinding(ListProperty<Type> _destination, ListProperty<Type2> _source, Func<Type2, Type> _transform, Func<Type2, bool> _filter)\n\t\t{\n\t\t\tthis.Enabled = true;\n\t\t\tthis.destination = _destination;\n\t\t\tthis.transform = _transform;\n\t\t\tthis.filter = _filter;\n\t\t\t_source.AddBinding(this);\n\t\t\tthis.sources = new IProperty[] { _source };\n\t\t\tthis.OnChanged(_source);\n\t\t}\n\n\t\tpublic ListBinding(ListProperty<Type> _destination, ListProperty<Type2> _source, Func<Type2, Type> _transform)\n\t\t\t: this(_destination, _source, _transform, (x) => true)\n\t\t{\n\t\t}\n\n\t\tpublic void OnChanged(IProperty property)\n\t\t{\n\t\t\tif (this.Enabled)\n\t\t\t{\n\t\t\t\tthis.Clear(property);\n\t\t\t\tListProperty<Type2> source = (ListProperty<Type2>)this.sources[0];\n\t\t\t\tfor (int i = 0; i < source.Count; i++)\n\t\t\t\t\tthis.Add(source[i], property);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Add(Type2 x, IProperty property)\n\t\t{\n\t\t\tif (this.Enabled && this.filter((Type2)x))\n\t\t\t{\n\t\t\t\tType y = this.transform(x);\n\t\t\t\tthis.destination.Add(y);\n\t\t\t\tthis.mapping.Add((Type2)x, new Entry { Index = this.destination.Length - 1 });\n\t\t\t}\n\t\t}\n\n\t\tpublic void Remove(Type2 x, IProperty property)\n\t\t{\n\t\t\tif (this.Enabled && this.filter((Type2)x))\n\t\t\t{\n\t\t\t\tint e = this.mapping[(Type2)x].Index;\n\t\t\t\tthis.mapping.Remove((Type2)x);\n\t\t\t\tthis.destination.RemoveAt(e);\n\t\t\t\tthis.recalculate(e + 1, e);\n\t\t\t}\n\t\t}\n\n\t\tprivate void recalculate(int oldIndex, int newIndex)\n\t\t{\n\t\t\tif (newIndex != oldIndex)\n\t\t\t{\n\t\t\t\tint diff = newIndex - oldIndex;\n\t\t\t\tforeach (Entry entry in this.mapping.Values)\n\t\t\t\t{\n\t\t\t\t\tif (entry.Index >= oldIndex)\n\t\t\t\t\t\tentry.Index += diff;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void OnChanged(Type2 from, Type2 to, IProperty property)\n\t\t{\n\t\t\tif (this.Enabled)\n\t\t\t{\n\t\t\t\tbool originallyIncluded = this.filter((Type2)from), nowIncluded = this.filter((Type2)to);\n\t\t\t\tif (originallyIncluded && nowIncluded)\n\t\t\t\t{\n\t\t\t\t\tEntry oldEntry = this.mapping[(Type2)from];\n\t\t\t\t\tType newValue = this.transform((Type2)to);\n\t\t\t\t\tEntry newEntry = new Entry { Index = oldEntry.Index };\n\n\t\t\t\t\tthis.destination.Changed(oldEntry.Index, newValue);\n\n\t\t\t\t\tthis.mapping[(Type2)from] = newEntry;\n\t\t\t\t}\n\t\t\t\telse if (!originallyIncluded && nowIncluded)\n\t\t\t\t{\n\t\t\t\t\tType newValue = this.transform((Type2)to);\n\t\t\t\t\tthis.destination.Add(newValue);\n\t\t\t\t\tthis.mapping.Add((Type2)to, new Entry { Index = this.destination.Length - 1 });\n\t\t\t\t}\n\t\t\t\telse if (originallyIncluded && !nowIncluded)\n\t\t\t\t{\n\t\t\t\t\tEntry entry = this.mapping[(Type2)from];\n\t\t\t\t\tthis.destination.RemoveAt(entry.Index);\n\t\t\t\t\tthis.mapping.Remove((Type2)from);\n\t\t\t\t\tthis.recalculate(entry.Index + 1, entry.Index);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Clear(IProperty property)\n\t\t{\n\t\t\tthis.mapping.Clear();\n\t\t\tif (this.Enabled)\n\t\t\t\tthis.destination.Clear();\n\t\t}\n\n\t\tpublic void Delete()\n\t\t{\n\t\t\tfor (int i = 0; i < this.sources.Length; i++)\n\t\t\t\tthis.sources[i].RemoveBinding(this);\n\t\t\tthis.sources = null;\n\t\t\tthis.destination = null;\n\t\t\tthis.transform = null;\n\t\t\tthis.filter = null;\n\t\t\tthis.mapping.Clear();\n\t\t}\n\t}\n\n\tpublic class ListNotifyBinding<Type> : IListBinding<Type>\n\t{\n\t\tprotected IProperty[] sources;\n\t\tprivate Action notify;\n\n\t\tpublic bool Enabled { get; set; }\n\n\t\tprotected ListNotifyBinding()\n\t\t{\n\t\t\tthis.Enabled = true;\n\t\t}\n\n\t\tpublic ListNotifyBinding(Action notify, ListProperty<Type> _source)\n\t\t{\n\t\t\tthis.Enabled = true;\n\t\t\tthis.notify = notify;\n\t\t\t_source.AddBinding(this);\n\t\t\tthis.sources = new IProperty[] { _source };\n\t\t}\n\n\t\tpublic void OnChanged(IProperty property)\n\t\t{\n\t\t\tif (this.Enabled)\n\t\t\t\tthis.notify();\n\t\t}\n\n\t\tpublic void Add(Type x, IProperty property)\n\t\t{\n\t\t\tif (this.Enabled)\n\t\t\t\tthis.notify();\n\t\t}\n\n\t\tpublic void Remove(Type x, IProperty property)\n\t\t{\n\t\t\tif (this.Enabled)\n\t\t\t\tthis.notify();\n\t\t}\n\n\t\tpublic void OnChanged(Type from, Type to, IProperty property)\n\t\t{\n\t\t\tif (this.Enabled)\n\t\t\t\tthis.notify();\n\t\t}\n\n\t\tpublic void Clear(IProperty property)\n\t\t{\n\t\t\tif (this.Enabled)\n\t\t\t\tthis.notify();\n\t\t}\n\n\t\tpublic void Delete()\n\t\t{\n\t\t\tfor (int i = 0; i < this.sources.Length; i++)\n\t\t\t\tthis.sources[i].RemoveBinding(this);\n\t\t\tthis.sources = null;\n\t\t}\n\t}\n\n\tpublic class ListBinding<Type> : ListBinding<Type, Type>\n\t{\n\t\tpublic ListBinding(ListProperty<Type> _destination, ListProperty<Type> _source)\n\t\t\t: base(_destination, _source, x => x, x => true)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "ComponentBind/Command.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ComponentBind\n{\n\tpublic abstract class BaseCommand\n\t{\n\t\tpublic List<ICommandBinding> Bindings = new List<ICommandBinding>();\n\t\tpublic void AddBinding(ICommandBinding binding)\n\t\t{\n\t\t\tthis.Bindings.Add(binding);\n\t\t}\n\n\t\tpublic void RemoveBinding(ICommandBinding binding)\n\t\t{\n\t\t\tthis.Bindings.Remove(binding);\n\t\t}\n\t}\n\n\tpublic class Command : BaseCommand\n\t{\n\t\tpublic enum Perms { Linkable, Executable, LinkableAndExecutable }\n\n\t\tpublic class Entry\n\t\t{\n\t\t\tpublic Command Command;\n\t\t\tpublic Perms Permissions;\n\t\t\tpublic string Description;\n\t\t\tpublic string Key;\n\t\t}\n\n\t\tpublic Action Action;\n\n\t\tpublic void Execute()\n\t\t{\n\t\t\tfor (int j = this.Bindings.Count - 1; j >= 0; j = Math.Min(this.Bindings.Count - 1, j - 1))\n\t\t\t\t((CommandBinding)this.Bindings[j]).Execute();\n\t\t\tif (this.Action != null)\n\t\t\t\tthis.Action();\n\t\t}\n\t}\n\n\tpublic class Command<Type> : BaseCommand\n\t{\n\t\tpublic Action<Type> Action;\n\n\t\tpublic void Execute(Type parameter)\n\t\t{\n\t\t\tfor (int j = this.Bindings.Count - 1; j >= 0; j = Math.Min(this.Bindings.Count - 1, j - 1))\n\t\t\t\t((CommandBinding<Type>)this.Bindings[j]).Execute(parameter);\n\t\t\tif (this.Action != null)\n\t\t\t\tthis.Action(parameter);\n\t\t}\n\t}\n\n\tpublic class Command<Type, Type2> : BaseCommand\n\t{\n\t\tpublic Action<Type, Type2> Action;\n\n\t\tpublic void Execute(Type parameter1, Type2 parameter2)\n\t\t{\n\t\t\tfor (int j = this.Bindings.Count - 1; j >= 0; j = Math.Min(this.Bindings.Count - 1, j - 1))\n\t\t\t\t((CommandBinding<Type, Type2>)this.Bindings[j]).Execute(parameter1, parameter2);\n\t\t\tif (this.Action != null)\n\t\t\t\tthis.Action(parameter1, parameter2);\n\t\t}\n\t}\n\n\tpublic class Command<Type, Type2, Type3> : BaseCommand\n\t{\n\t\tpublic Action<Type, Type2, Type3> Action;\n\n\t\tpublic void Execute(Type parameter1, Type2 parameter2, Type3 parameter3)\n\t\t{\n\t\t\tfor (int j = this.Bindings.Count - 1; j >= 0; j = Math.Min(this.Bindings.Count - 1, j - 1))\n\t\t\t\t((CommandBinding<Type, Type2, Type3>)this.Bindings[j]).Execute(parameter1, parameter2, parameter3);\n\t\t\tif (this.Action != null)\n\t\t\t\tthis.Action(parameter1, parameter2, parameter3);\n\t\t}\n\t}\n\n\tpublic class Command<Type, Type2, Type3, Type4> : BaseCommand\n\t{\n\t\tpublic Action<Type, Type2, Type3, Type4> Action;\n\n\t\tpublic void Execute(Type parameter1, Type2 parameter2, Type3 parameter3, Type4 parameter4)\n\t\t{\n\t\t\tfor (int j = this.Bindings.Count - 1; j >= 0; j = Math.Min(this.Bindings.Count - 1, j - 1))\n\t\t\t\t((CommandBinding<Type, Type2, Type3, Type4>)this.Bindings[j]).Execute(parameter1, parameter2, parameter3, parameter4);\n\t\t\tif (this.Action != null)\n\t\t\t\tthis.Action(parameter1, parameter2, parameter3, parameter4);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "ComponentBind/CommandBinding.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ComponentBind\n{\n\tpublic interface ICommandBinding : IBinding\n\t{\n\n\t}\n\n\tpublic abstract class BaseCommandBinding<CommandType> : ICommandBinding\n\t\twhere CommandType : BaseCommand\n\t{\n\t\tprotected CommandType source;\n\t\tprotected CommandType[] destinations;\n\t\tprotected Func<bool> enabled;\n\n\t\tpublic bool Enabled { get; set; }\n\n\t\tprotected BaseCommandBinding()\n\t\t{\n\t\t\tthis.Enabled = true;\n\t\t}\n\n\t\tpublic void Delete()\n\t\t{\n\t\t\tthis.Enabled = false;\n\t\t\tthis.source.RemoveBinding(this);\n\t\t\tthis.source = null;\n\t\t\tthis.destinations = null;\n\t\t\tthis.enabled = null;\n\t\t}\n\t}\n\n\tpublic class CommandBinding : BaseCommandBinding<Command>\n\t{\n\t\tpublic CommandBinding(Command _source, params Command[] _destinations)\n\t\t\t: this(_source, () => true, _destinations)\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command _source, Func<bool> enabled, params Command[] _destinations)\n\t\t{\n\t\t\tthis.source = _source;\n\t\t\tthis.source.AddBinding(this);\n\t\t\tthis.destinations = _destinations;\n\t\t\tthis.enabled = enabled;\n\t\t}\n\n\t\tpublic CommandBinding(Command _source, params Action[] _destinations)\n\t\t\t: this(_source, () => true, _destinations)\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command _source, Func<bool> enabled, params Action[] _destinations)\n\t\t{\n\t\t\tthis.source = _source;\n\t\t\tthis.source.AddBinding(this);\n\t\t\tthis.destinations = _destinations.Select(x => new Command { Action = x }).ToArray();\n\t\t\tthis.enabled = enabled;\n\t\t}\n\n\t\tpublic void Execute()\n\t\t{\n\t\t\tif (this.Enabled && this.enabled())\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.destinations.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tthis.destinations[i].Execute();\n\t\t\t\t\tif (this.destinations == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class CommandBinding<Type> : BaseCommandBinding<Command<Type>>\n\t{\n\t\tpublic CommandBinding(Command<Type> _source, params Command<Type>[] _destinations)\n\t\t\t: this(_source, () => true, _destinations)\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type> _source, params Action<Type>[] _destinations)\n\t\t\t: this(_source, () => true, _destinations)\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type> _source, Func<bool> enabled, params Action<Type>[] _destinations)\n\t\t\t: this(_source, enabled, _destinations.Select(x => new Command<Type> { Action = x }).ToArray())\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type> _source, Func<bool> enabled, params Command<Type>[] _destinations)\n\t\t{\n\t\t\tthis.source = _source;\n\t\t\tthis.source.AddBinding(this);\n\t\t\tthis.destinations = _destinations;\n\t\t\tthis.enabled = enabled;\n\t\t}\n\n\t\tpublic void Execute(Type parameter1)\n\t\t{\n\t\t\tif (this.Enabled && this.enabled())\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.destinations.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tthis.destinations[i].Execute(parameter1);\n\t\t\t\t\tif (this.destinations == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class CommandBinding<Type, Type2> : BaseCommandBinding<Command<Type, Type2>>\n\t{\n\t\tpublic CommandBinding(Command<Type, Type2> _source, params Command<Type, Type2>[] _destinations)\n\t\t\t: this(_source, () => true, _destinations)\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type, Type2> _source, params Action<Type, Type2>[] _destinations)\n\t\t\t: this(_source, () => true, _destinations)\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type, Type2> _source, Func<bool> enabled, params Action<Type, Type2>[] _destinations)\n\t\t\t: this(_source, enabled, _destinations.Select(x => new Command<Type, Type2> { Action = x }).ToArray())\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type, Type2> _source, Func<bool> enabled, params Command<Type, Type2>[] _destinations)\n\t\t{\n\t\t\tthis.source = _source;\n\t\t\tthis.source.AddBinding(this);\n\t\t\tthis.destinations = _destinations;\n\t\t\tthis.enabled = enabled;\n\t\t}\n\n\t\tpublic void Execute(Type parameter1, Type2 parameter2)\n\t\t{\n\t\t\tif (this.Enabled && this.enabled())\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.destinations.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tthis.destinations[i].Execute(parameter1, parameter2);\n\t\t\t\t\tif (this.destinations == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class CommandBinding<Type, Type2, Type3> : BaseCommandBinding<Command<Type, Type2, Type3>>\n\t{\n\t\tpublic CommandBinding(Command<Type, Type2, Type3> _source, params Command<Type, Type2, Type3>[] _destinations)\n\t\t\t: this(_source, () => true, _destinations)\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type, Type2, Type3> _source, params Action<Type, Type2, Type3>[] _destinations)\n\t\t\t: this(_source, () => true, _destinations)\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type, Type2, Type3> _source, Func<bool> enabled, params Action<Type, Type2, Type3>[] _destinations)\n\t\t\t: this(_source, enabled, _destinations.Select(x => new Command<Type, Type2, Type3> { Action = x }).ToArray())\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type, Type2, Type3> _source, Func<bool> enabled, params Command<Type, Type2, Type3>[] _destinations)\n\t\t{\n\t\t\tthis.source = _source;\n\t\t\tthis.source.AddBinding(this);\n\t\t\tthis.destinations = _destinations;\n\t\t\tthis.enabled = enabled;\n\t\t}\n\n\t\tpublic void Execute(Type parameter1, Type2 parameter2, Type3 parameter3)\n\t\t{\n\t\t\tif (this.Enabled && this.enabled())\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.destinations.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tthis.destinations[i].Execute(parameter1, parameter2, parameter3);\n\t\t\t\t\tif (this.destinations == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class CommandBinding<Type, Type2, Type3, Type4> : BaseCommandBinding<Command<Type, Type2, Type3, Type4>>\n\t{\n\t\tpublic CommandBinding(Command<Type, Type2, Type3, Type4> _source, params Command<Type, Type2, Type3, Type4>[] _destinations)\n\t\t\t: this(_source, () => true, _destinations)\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type, Type2, Type3, Type4> _source, params Action<Type, Type2, Type3, Type4>[] _destinations)\n\t\t\t: this(_source, () => true, _destinations)\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type, Type2, Type3, Type4> _source, Func<bool> enabled, params Action<Type, Type2, Type3, Type4>[] _destinations)\n\t\t\t: this(_source, enabled, _destinations.Select(x => new Command<Type, Type2, Type3, Type4> { Action = x }).ToArray())\n\t\t{\n\t\t}\n\n\t\tpublic CommandBinding(Command<Type, Type2, Type3, Type4> _source, Func<bool> enabled, params Command<Type, Type2, Type3, Type4>[] _destinations)\n\t\t{\n\t\t\tthis.source = _source;\n\t\t\tthis.source.AddBinding(this);\n\t\t\tthis.destinations = _destinations;\n\t\t\tthis.enabled = enabled;\n\t\t}\n\n\t\tpublic void Execute(Type parameter1, Type2 parameter2, Type3 parameter3, Type4 parameter4)\n\t\t{\n\t\t\tif (this.Enabled && this.enabled())\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.destinations.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tthis.destinations[i].Execute(parameter1, parameter2, parameter3, parameter4);\n\t\t\t\t\tif (this.destinations == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "ComponentBind/Component.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\nusing System.ComponentModel;\nusing Newtonsoft.Json;\n\nnamespace ComponentBind\n{\n\tpublic interface IBindable\n\t{\n\t\tvoid delete();\n\t}\n\n\tpublic interface IComponent : IBindable\n\t{\n\t\tEntity Entity { get; set; }\n\t\tbool Active { get; }\n\t\tbool Serialize { get; set; }\n\t\tvoid SetMain(BaseMain main);\n\t\tProperty<bool> Enabled { get; }\n\t\tbool EnabledInEditMode { get; }\n\t\tbool EnabledWhenPaused { get; }\n\t\tProperty<bool> Suspended { get; }\n\t\tCommand Delete { get; }\n\t\tvoid OnSave();\n\t\tvoid Start();\n\t\tvoid Awake();\n\t}\n\n\tpublic interface IGraphicsComponent : IComponent\n\t{\n\t\tvoid LoadContent(bool reload);\n\t}\n\n\tpublic interface IUpdateableComponent : IComponent\n\t{\n\t\tvoid Update(float dt);\n\t}\n\n\tpublic interface IEarlyUpdateableComponent : IComponent\n\t{\n\t\tvoid Update(float dt);\n\t\tProperty<int> UpdateOrder { get; }\n\t}\n\n\tpublic class Bindable : IBindable\n\t{\n\t\tprivate List<IBinding> bindings = new List<IBinding>();\n\n\t\tpublic void Add(IBinding binding)\n\t\t{\n\t\t\tthis.bindings.Add(binding);\n\t\t}\n\n\t\tpublic void Remove(IBinding binding)\n\t\t{\n\t\t\tbinding.Delete();\n\t\t\tthis.bindings.Remove(binding);\n\t\t}\n\n\t\tpublic void RemoveAllBindings()\n\t\t{\n\t\t\tfor (int i = 0; i < this.bindings.Count; i++)\n\t\t\t\tthis.bindings[i].Delete();\n\t\t\tthis.bindings.Clear();\n\t\t}\n\n\t\tpublic virtual void delete()\n\t\t{\n\t\t\tfor (int i = 0; i < this.bindings.Count; i++)\n\t\t\t\tthis.bindings[i].Delete();\n\t\t\tthis.bindings.Clear();\n\t\t}\n\t}\n\n\tpublic class Component<MainClass> : Bindable, IComponent\n\t\twhere MainClass : BaseMain\n\t{\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic bool Serialize { get; set; }\n\n\t\tpublic Property<bool> Enabled { get; set; }\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic Property<bool> Suspended { get; set; }\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic Command Enable = new Command();\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic Command Disable = new Command();\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic Command OnSuspended = new Command();\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic Command OnResumed = new Command();\n\n\t\tprivate Command del = new Command();\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic Command Delete\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.del;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic bool EnabledInEditMode { get; set; }\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic bool EnabledWhenPaused { get; set; }\n\n\t\tprotected MainClass main;\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic virtual Entity Entity { get; set; }\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic bool Active { get; private set; }\n\n\t\tpublic Component()\n\t\t{\n\t\t\tthis.Serialize = true;\n\t\t\tthis.Enabled = new Property<bool> { Value = true };\n\t\t\tthis.Suspended = new Property<bool> { Value = false };\n\t\t\tthis.EnabledInEditMode = true;\n\t\t\tthis.EnabledWhenPaused = true;\n\t\t\tthis.Delete.Action = delegate()\n\t\t\t{\n\t\t\t\tif (this.Active)\n\t\t\t\t{\n\t\t\t\t\tthis.Active = false;\n\t\t\t\t\tthis.main.RemoveComponent(this);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.Add(new CommandBinding(Enable, () => !Enabled, delegate()\n\t\t\t{\n\t\t\t\tEnabled.Value = true;\n\t\t\t}));\n\n\t\t\tthis.Add(new CommandBinding(Disable, () => Enabled, delegate()\n\t\t\t{\n\t\t\t\tEnabled.Value = false;\n\t\t\t}));\n\t\t}\n\n\t\tpublic virtual void OnSave()\n\t\t{\n\n\t\t}\n\n\t\tpublic virtual void Start()\n\t\t{\n\n\t\t}\n\n\t\tpublic virtual void Awake()\n\t\t{\n\t\t\tthis.Add(new ChangeBinding<bool>(this.Enabled, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (!old && value)\n\t\t\t\t\tthis.Enable.Execute();\n\t\t\t\telse if (old && !value)\n\t\t\t\t\tthis.Disable.Execute();\n\t\t\t}));\n\t\t\tthis.Add(new ChangeBinding<bool>(this.Suspended, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (!old && value)\n\t\t\t\t\tthis.OnSuspended.Execute();\n\t\t\t\telse if (old && !value)\n\t\t\t\t\tthis.OnResumed.Execute();\n\t\t\t}));\n\t\t}\n\n\t\tpublic void SetMain(BaseMain _main)\n\t\t{\n\t\t\tthis.Active = true;\n\t\t\tthis.main = (MainClass)_main;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tif (this.Entity != null)\n\t\t\t\tthis.Entity.Remove(this);\n\t\t\tbase.delete();\n\t\t}\n\t}\n}"
  },
  {
    "path": "ComponentBind/ComponentBind.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{2D0637AB-A380-4C97-A329-BF7C40C99495}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>ComponentBind</RootNamespace>\n    <AssemblyName>ComponentBind</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"BaseMain.cs\" />\n    <Compile Include=\"Binding.cs\" />\n    <Compile Include=\"Command.cs\" />\n    <Compile Include=\"CommandBinding.cs\" />\n    <Compile Include=\"Component.cs\" />\n    <Compile Include=\"Entity.cs\" />\n    <Compile Include=\"Factory.cs\" />\n    <Compile Include=\"Log.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Property.cs\" />\n    <Compile Include=\"Transform.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Newtonsoft.Json\\Newtonsoft.Json.Net40.csproj\">\n      <Project>{a9ae40ff-1a21-414a-9fe7-3be13644cc6d}</Project>\n      <Name>Newtonsoft.Json.Net40</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "ComponentBind/Entity.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Xml.Serialization;\nusing System.Collections;\nusing System.ComponentModel;\nusing System.Reflection;\nusing Newtonsoft.Json;\n\nnamespace ComponentBind\n{\n\t[XmlInclude(typeof(Entity.Handle))]\n\t[XmlInclude(typeof(Property<Entity.Handle>))]\n\t[XmlInclude(typeof(ListProperty<Entity.Handle>))]\n\t[XmlInclude(typeof(ListProperty<string>))]\n\t[XmlInclude(typeof(Transform))]\n\tpublic class Entity\n\t{\n\t\tpublic class CommandLink\n\t\t{\n\t\t\tpublic Handle TargetEntity;\n\n\t\t\t[XmlAttribute]\n\t\t\t[DefaultValue(\"\")]\n\t\t\tpublic string TargetCommand;\n\n\t\t\t[XmlAttribute]\n\t\t\t[DefaultValue(\"\")]\n\t\t\tpublic string SourceCommand;\n\n\t\t\t[XmlIgnore]\n\t\t\t[JsonIgnore]\n\t\t\tpublic Command LinkedTargetCmd;\n\n\t\t\t[XmlIgnore]\n\t\t\t[JsonIgnore]\n\t\t\tpublic Command LinkedSourceCmd;\n\t\t}\n\n\t\tpublic struct Handle\n\t\t{\n\t\t\tprivate ulong guid;\n\n\t\t\t[XmlAttribute]\n\t\t\t[DefaultValue(0)]\n\t\t\tpublic ulong GUID;\n\n\t\t\tprivate Entity target;\n\n\t\t\t[XmlIgnore]\n\t\t\t[JsonIgnore]\n\t\t\tpublic Entity Target\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\tif (this.target == null || this.target.GUID != this.GUID)\n\t\t\t\t\t\tEntity.guidTable.TryGetValue(this.GUID, out this.target);\n\t\t\t\t\treturn this.target;\n\t\t\t\t}\n\t\t\t\tset\n\t\t\t\t{\n\t\t\t\t\tthis.target = value;\n\t\t\t\t\tthis.GUID = this.target == null ? 0 : this.target.GUID;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic static implicit operator Entity(Handle obj)\n\t\t\t{\n\t\t\t\treturn obj.Target;\n\t\t\t}\n\n\t\t\tpublic static implicit operator Handle(Entity obj)\n\t\t\t{\n\t\t\t\treturn new Handle { Target = obj, GUID = obj == null ? 0 : obj.GUID };\n\t\t\t}\n\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tif (obj is Handle)\n\t\t\t\t\treturn ((Handle)obj).GUID == this.GUID;\n\t\t\t\telse if (obj is Entity)\n\t\t\t\t\treturn ((Entity)obj).GUID == this.GUID;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn (int)(this.GUID & 0xffffffff);\n\t\t\t}\n\t\t}\n\n\t\tprivate static Dictionary<ulong, Entity> guidTable = new Dictionary<ulong, Entity>();\n\t\tprivate static Dictionary<string, Entity> idTable = new Dictionary<string, Entity>();\n\n\t\tprivate static List<IComponent> componentCache = new List<IComponent>();\n\n\t\tpublic static Entity GetByID(string id)\n\t\t{\n\t\t\tEntity result;\n\t\t\tEntity.idTable.TryGetValue(id, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic static Entity GetByGUID(ulong id)\n\t\t{\n\t\t\tEntity result;\n\t\t\tEntity.guidTable.TryGetValue(id, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic bool Active = true;\n\n\t\t[XmlAttribute]\n\t\tpublic string Type;\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic bool EditorCanDelete = true;\n\n\t\tpublic Property<string> ID = new Property<string>();\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\"{0} [{1}]\", string.IsNullOrEmpty(this.ID.Value) ? this.GUID.ToString() : this.ID.Value, this.Type);\n\t\t}\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic bool Serialize = true;\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic bool CannotSuspend;\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic bool CannotSuspendByDistance;\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic bool Added;\n\n\t\tprivate BaseMain main;\n\t\tprivate Dictionary<string, IComponent> components = new Dictionary<string, IComponent>();\n\t\tprivate Dictionary<Type, IComponent> componentsByType = new Dictionary<Type, IComponent>();\n\t\tprivate List<IBinding> bindings = new List<IBinding>();\n\n\t\tpublic static ulong CurrentGUID = 1;\n\n\t\t[XmlAttribute]\n\t\tpublic ulong GUID;\n\n\t\tprivate Dictionary<string, Command.Entry> commands = new Dictionary<string, Command.Entry>();\n\n\t\tprivate readonly Dictionary<string, PropertyEntry> properties = new Dictionary<string, PropertyEntry>();\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic Command Delete = new Command();\n\n\t\t[XmlArray(\"LinkedCommands\")]\n\t\t[XmlArrayItem(\"CommandLink\", typeof(CommandLink))]\n\t\t[JsonProperty]\n\t\tpublic ListProperty<CommandLink> LinkedCommands = new ListProperty<CommandLink>();\n\n\t\t[XmlArray(\"Components\")]\n\t\t[XmlArrayItem(\"Component\", Type = typeof(DictionaryEntry))]\n\t\t[JsonProperty]\n\t\tpublic DictionaryEntry[] Components\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\t// Make an array of DictionaryEntries to return\n\t\t\t\tIEnumerable<KeyValuePair<string, IComponent>> serializableComponents = this.components.Where(x => x.Value.Serialize);\n\t\t\t\tDictionaryEntry[] ret = new DictionaryEntry[serializableComponents.Count()];\n\t\t\t\tint i = 0;\n\t\t\t\tDictionaryEntry de;\n\t\t\t\t// Iterate through properties to load items into the array.\n\t\t\t\tforeach (KeyValuePair<string, IComponent> component in serializableComponents)\n\t\t\t\t{\n\t\t\t\t\tde = new DictionaryEntry();\n\t\t\t\t\tde.Key = component.Key;\n\t\t\t\t\tde.Value = component.Value;\n\t\t\t\t\tcomponent.Value.OnSave();\n\t\t\t\t\tret[i] = de;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif (this.OnSave != null)\n\t\t\t\t\tthis.OnSave.Execute();\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.components.Clear();\n\t\t\t\tfor (int i = 0; i < value.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tIComponent c = value[i].Value as IComponent;\n\t\t\t\t\tif (c != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.components.Add((string)value[i].Key, c);\n\t\t\t\t\t\tType t = c.GetType();\n\t\t\t\t\t\tdo\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.componentsByType[t] = c;\n\t\t\t\t\t\t\tt = t.BaseType;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (t.Assembly != Entity.componentBindAssembly);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic Dictionary<string, IComponent> ComponentDictionary\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.components;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic IEnumerable<KeyValuePair<string, Command.Entry>> Commands\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.commands;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic IEnumerable<KeyValuePair<string, PropertyEntry>> Properties\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.properties;\n\t\t\t}\n\t\t}\n\n\t\tpublic Entity()\n\t\t{\n\t\t\t// Called by XmlSerializer\n\t\t\tthis.Delete.Action = (Action)this.delete;\n\t\t}\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic Command OnSave;\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic Property<bool> EditorSelected;\n\n\t\tprivate static Assembly componentBindAssembly;\n\n\t\tstatic Entity()\n\t\t{\n\t\t\tEntity.componentBindAssembly = Assembly.GetExecutingAssembly();\n\t\t}\n\n\t\tpublic Entity(BaseMain _main, string _type)\n\t\t\t: this()\n\t\t{\n\t\t\t// Called by a Factory\n\t\t\tthis.Type = _type;\n\t\t}\n\n\t\tpublic void ClearGUID()\n\t\t{\n\t\t\tif (this.GUID != 0)\n\t\t\t\tEntity.guidTable.Remove(this.GUID);\n\t\t}\n\n\t\tpublic void NewGUID()\n\t\t{\n\t\t\tthis.ClearGUID();\n\t\t\tthis.GUID = Entity.CurrentGUID;\n\t\t\tEntity.CurrentGUID++;\n\t\t\tEntity.guidTable.Add(this.GUID, this);\n\t\t}\n\n\t\tpublic void SetMain(BaseMain _main)\n\t\t{\n\t\t\tif (this.GUID == 0)\n\t\t\t\tthis.GUID = Entity.CurrentGUID;\n\n\t\t\tEntity.CurrentGUID = Math.Max(Entity.CurrentGUID, this.GUID + 1);\n\t\t\tEntity.guidTable.Add(this.GUID, this);\n\n\t\t\tthis.main = _main;\n\n\t\t\tif (!string.IsNullOrEmpty(this.ID))\n\t\t\t\tEntity.idTable.Add(this.ID, this);\n\n\t\t\tif (_main.EditorEnabled)\n\t\t\t{\n\t\t\t\tthis.OnSave = new Command();\n\t\t\t\tthis.EditorSelected = new Property<bool>();\n\t\t\t\tstring oldId = this.ID;\n\t\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t\t{\n\t\t\t\t\tif (!string.IsNullOrEmpty(oldId))\n\t\t\t\t\t\tEntity.idTable.Remove(oldId);\n\t\t\t\t\tif (!string.IsNullOrEmpty(this.ID))\n\t\t\t\t\t\tEntity.idTable.Add(this.ID, this);\n\t\t\t\t\toldId = this.ID;\n\t\t\t\t}, this.ID));\n\t\t\t}\n\n\t\t\tEntity.componentCache.AddRange(this.components.Values);\n\t\t\tfor (int i = 0; i < Entity.componentCache.Count; i++)\n\t\t\t{\n\t\t\t\tIComponent c = Entity.componentCache[i];\n\t\t\t\tc.Entity = this;\n\t\t\t\tthis.main.AddComponent(c);\n\t\t\t}\n\t\t\tEntity.componentCache.Clear();\n\t\t}\n\n\t\tpublic void SetSuspended(bool suspended)\n\t\t{\n\t\t\tEntity.componentCache.AddRange(this.components.Values);\n\t\t\tfor (int i = 0; i < Entity.componentCache.Count; i++)\n\t\t\t{\n\t\t\t\tIComponent c = Entity.componentCache[i];\n\t\t\t\tif (c.Suspended.Value != suspended)\n\t\t\t\t\tc.Suspended.Value = suspended;\n\t\t\t}\n\t\t\tEntity.componentCache.Clear();\n\t\t}\n\n\t\tpublic void LinkedCommandCall(CommandLink link)\n\t\t{\n\t\t\tif (link.LinkedTargetCmd != null)\n\t\t\t\tlink.LinkedTargetCmd.Execute();\n\t\t\telse if (link.TargetEntity.Target != null)\n\t\t\t{\n\t\t\t\tCommand destCommand = link.TargetEntity.Target.getCommand(link.TargetCommand);\n\t\t\t\tif (destCommand != null)\n\t\t\t\t{\n\t\t\t\t\tlink.LinkedTargetCmd = destCommand;\n\t\t\t\t\tdestCommand.Execute();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Add(string name, Command cmd, Command.Perms perms = Command.Perms.Linkable, string description = null)\n\t\t{\n\t\t\tCommand.Entry entry = new Command.Entry { Command = cmd, Permissions = perms, Key = name };\n\t\t\tif (this.main.EditorEnabled)\n\t\t\t\tentry.Description = description;\n\t\t\tthis.commands.Add(name, entry);\n\t\t\tfor (int i = 0; i < this.LinkedCommands.Count; i++)\n\t\t\t{\n\t\t\t\tCommandLink link = this.LinkedCommands[i];\n\t\t\t\tif (link.LinkedSourceCmd == null && name == link.SourceCommand)\n\t\t\t\t{\n\t\t\t\t\tlink.LinkedSourceCmd = cmd;\n\t\t\t\t\tthis.Add(new CommandBinding(link.LinkedSourceCmd, () => LinkedCommandCall(link)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Add(string name, IComponent component)\n\t\t{\n\t\t\tthis.components.Add(name, component);\n\t\t\tType t = component.GetType();\n\t\t\tdo\n\t\t\t{\n\t\t\t\tthis.componentsByType[t] = component;\n\t\t\t\tt = t.BaseType;\n\t\t\t}\n\t\t\twhile (t.Assembly != Entity.componentBindAssembly);\n\t\t\tif (this.main != null)\n\t\t\t{\n\t\t\t\tcomponent.Entity = this;\n\t\t\t\tthis.main.AddComponent(component);\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddWithoutOverwriting(string name, IComponent component)\n\t\t{\n\t\t\tthis.components.Add(name, component);\n\t\t\tType t = component.GetType();\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif (!this.componentsByType.ContainsKey(t))\n\t\t\t\t\tthis.componentsByType[t] = component;\n\t\t\t\tt = t.BaseType;\n\t\t\t}\n\t\t\twhile (t.Assembly != Entity.componentBindAssembly);\n\t\t\tif (this.main != null)\n\t\t\t{\n\t\t\t\tcomponent.Entity = this;\n\t\t\t\tthis.main.AddComponent(component);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Add(IComponent component)\n\t\t{\n\t\t\tcomponent.Serialize = false;\n\t\t\tthis.Add(Guid.NewGuid().ToString(), component);\n\t\t}\n\n\t\tpublic void Add(string name, IProperty prop, PropertyEntry.EditorData editorData)\n\t\t{\n\t\t\tthis.properties.Add(name, new PropertyEntry(prop, this.main.EditorEnabled ? editorData : null));\n\t\t}\n\n\t\tpublic void Add(string name, IProperty prop, string description = null, bool readOnly = false)\n\t\t{\n\t\t\tPropertyEntry.EditorData data = null;\n\t\t\tif (this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tdata = new PropertyEntry.EditorData();\n\t\t\t\tdata.Readonly = readOnly;\n\t\t\t\tdata.Description = description;\n\t\t\t}\n\t\t\tthis.properties.Add(name, new PropertyEntry(prop, data));\n\t\t}\n\n\t\tpublic void RemoveProperty(string name)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tthis.properties.Remove(name);\n\t\t\t}\n\t\t\tcatch (KeyNotFoundException)\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\tpublic void RemoveCommand(string name)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tthis.commands.Remove(name);\n\t\t\t}\n\t\t\tcatch (KeyNotFoundException)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tfor (int i = this.LinkedCommands.Count - 1; i >= 0; i--)\n\t\t\t{\n\t\t\t\tCommandLink link = this.LinkedCommands[i];\n\t\t\t\tif (link.SourceCommand == name)\n\t\t\t\t\tthis.LinkedCommands.RemoveAt(i);\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<T> GetProperty<T>(string name)\n\t\t{\n\t\t\tif (name == null) return null;\n\t\t\tPropertyEntry result;\n\t\t\tthis.properties.TryGetValue(name, out result);\n\t\t\tif (result == null)\n\t\t\t\treturn null;\n\t\t\telse\n\t\t\t\treturn (Property<T>)result.Property;\n\t\t}\n\n\t\tpublic IProperty GetProperty(string name)\n\t\t{\n\t\t\tif (name == null) return null;\n\t\t\tPropertyEntry result;\n\t\t\tthis.properties.TryGetValue(name, out result);\n\t\t\tif (result == null)\n\t\t\t\treturn null;\n\t\t\telse\n\t\t\t\treturn result.Property;\n\t\t}\n\n\t\tpublic void AddWithoutOverwriting(IComponent component)\n\t\t{\n\t\t\tthis.AddWithoutOverwriting(Guid.NewGuid().ToString(), component);\n\t\t}\n\n\t\tpublic void Add(IBinding binding)\n\t\t{\n\t\t\tthis.bindings.Add(binding);\n\t\t}\n\n\t\tpublic void RemoveComponent(string name)\n\t\t{\n\t\t\tIComponent c;\n\t\t\tthis.components.TryGetValue(name, out c);\n\t\t\tif (c != null)\n\t\t\t{\n\t\t\t\tthis.components.Remove(name);\n\t\t\t\tthis.removeComponentTypeMapping(c);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Remove(IBinding b)\n\t\t{\n\t\t\tb.Delete();\n\t\t\tthis.bindings.Remove(b);\n\t\t}\n\n\t\tpublic void Remove(IComponent c)\n\t\t{\n\t\t\tforeach (KeyValuePair<string, IComponent> pair in this.components)\n\t\t\t{\n\t\t\t\tif (pair.Value == c)\n\t\t\t\t{\n\t\t\t\t\tthis.components.Remove(pair.Key);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.removeComponentTypeMapping(c);\n\t\t}\n\n\t\tprivate void removeComponentTypeMapping(IComponent c)\n\t\t{\n\t\t\tType type = c.GetType();\n\t\t\tdo\n\t\t\t{\n\t\t\t\tIComponent typeComponent = null;\n\t\t\t\tthis.componentsByType.TryGetValue(type, out typeComponent);\n\t\t\t\tif (typeComponent == c)\n\t\t\t\t{\n\t\t\t\t\tbool foundReplacement = false;\n\t\t\t\t\tforeach (IComponent c2 in this.components.Values)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (c2.GetType().Equals(type))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.componentsByType[type] = c2;\n\t\t\t\t\t\t\tfoundReplacement = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!foundReplacement)\n\t\t\t\t\t\tthis.componentsByType.Remove(type);\n\t\t\t\t}\n\t\t\t\ttype = type.BaseType;\n\t\t\t}\n\t\t\twhile (type.Assembly != Entity.componentBindAssembly);\n\t\t}\n\n\t\tpublic T Get<T>() where T : IComponent\n\t\t{\n\t\t\tIComponent result = null;\n\t\t\tthis.componentsByType.TryGetValue(typeof(T), out result);\n\t\t\treturn (T)result;\n\t\t}\n\n\t\tpublic T GetOrCreate<T>() where T : IComponent, new()\n\t\t{\n\t\t\tIComponent result = null;\n\t\t\tthis.componentsByType.TryGetValue(typeof(T), out result);\n\t\t\tif (result == null)\n\t\t\t{\n\t\t\t\tresult = new T();\n\t\t\t\tthis.Add(result);\n\t\t\t}\n\t\t\treturn (T)result;\n\t\t}\n\n\t\tpublic IEnumerable<T> GetAll<T>() where T : IComponent\n\t\t{\n\t\t\treturn this.components.Values.OfType<T>();\n\t\t}\n\n\t\tpublic T Get<T>(string name) where T : IComponent\n\t\t{\n\t\t\tIComponent result = null;\n\t\t\tthis.components.TryGetValue(name, out result);\n\t\t\treturn (T)result;\n\t\t}\n\n\t\tpublic T GetOrCreate<T>(string name) where T : IComponent, new()\n\t\t{\n\t\t\tIComponent result = null;\n\t\t\tthis.components.TryGetValue(name, out result);\n\t\t\tif (result == null)\n\t\t\t{\n\t\t\t\tresult = new T();\n\t\t\t\tthis.Add(name, result);\n\t\t\t}\n\t\t\treturn (T)result;\n\t\t}\n\n\t\tpublic T GetOrCreateWithoutOverwriting<T>(string name) where T : IComponent, new()\n\t\t{\n\t\t\tIComponent result = null;\n\t\t\tthis.components.TryGetValue(name, out result);\n\t\t\tif (result == null)\n\t\t\t{\n\t\t\t\tresult = new T();\n\t\t\t\tthis.AddWithoutOverwriting(name, result);\n\t\t\t}\n\t\t\treturn (T)result;\n\t\t}\n\n\t\tpublic T Create<T>(string name = null) where T : IComponent, new()\n\t\t{\n\t\t\tT result = new T();\n\t\t\tif (name == null)\n\t\t\t\tthis.Add(result);\n\t\t\telse\n\t\t\t\tthis.Add(name, result);\n\t\t\treturn (T)result;\n\t\t}\n\n\t\tpublic T GetOrCreate<T>(string name, out bool created) where T : IComponent, new()\n\t\t{\n\t\t\tIComponent result = null;\n\t\t\tthis.components.TryGetValue(name, out result);\n\t\t\tcreated = false;\n\t\t\tif (result == null)\n\t\t\t{\n\t\t\t\tcreated = true;\n\t\t\t\tresult = new T();\n\t\t\t\tthis.Add(name, result);\n\t\t\t}\n\t\t\treturn (T)result;\n\t\t}\n\n\t\tprivate Command getCommand(string name)\n\t\t{\n\t\t\tCommand.Entry result;\n\t\t\tif (this.commands.TryGetValue(name, out result))\n\t\t\t\treturn result.Command;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\n\t\tprotected void delete()\n\t\t{\n\t\t\tif (this.Active)\n\t\t\t{\n\t\t\t\tthis.Active = false;\n\t\t\t\tEntity.componentCache.AddRange(this.components.Values);\n\t\t\t\tthis.components.Clear();\n\t\t\t\tthis.componentsByType.Clear();\n\t\t\t\tfor (int i = 0; i < Entity.componentCache.Count; i++)\n\t\t\t\t\tEntity.componentCache[i].Delete.Execute();\n\t\t\t\tEntity.componentCache.Clear();\n\t\t\t\tfor (int i = 0; i < this.bindings.Count; i++)\n\t\t\t\t\tthis.bindings[i].Delete();\n\t\t\t\tthis.bindings.Clear();\n\t\t\t\tthis.commands.Clear();\n\t\t\t\tthis.main.Remove(this);\n\t\t\t\tthis.ClearGUID();\n\t\t\t\tif (!string.IsNullOrEmpty(this.ID))\n\t\t\t\t\tEntity.idTable.Remove(this.ID);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "ComponentBind/Factory.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing System.Collections;\nusing System.Reflection;\nusing System.Xml.Serialization;\n\nnamespace ComponentBind\n{\n\tpublic class Factory\n\t{\n\t\tprotected static Dictionary<string, Factory> factories = new Dictionary<string, Factory>();\n\t\tprotected static Dictionary<Type, Factory> factoriesByType = new Dictionary<Type, Factory>();\n\n\t\tpublic static T Get<T>() where T : Factory\n\t\t{\n\t\t\tFactory result = null;\n\t\t\tFactory.factoriesByType.TryGetValue(typeof(T), out result);\n\t\t\treturn (T)result;\n\t\t}\n\n\t\tpublic static Factory Get(string type)\n\t\t{\n\t\t\tFactory result = null;\n\t\t\tFactory.factories.TryGetValue(type, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Vector3 Color = Vector3.One;\n\n\t\tpublic bool EditorCanSpawn = true;\n\t\tpublic bool AvailableInRelease = true;\n\t}\n\n\tpublic class Factory<MainClass> : Factory\n\t\twhere MainClass : BaseMain\n\t{\n\t\tstatic Factory()\n\t\t{\n\t\t\tFactory<MainClass>.Initialize();\n\t\t}\n\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tFactory.factories.Clear();\n\t\t\tFactory.factoriesByType.Clear();\n\t\t\tType baseType = typeof(Factory<MainClass>);\n\t\t\tforeach (Type type in Assembly.GetEntryAssembly().GetTypes().Where(t => t != baseType && baseType.IsAssignableFrom(t)))\n\t\t\t{\n\t\t\t\tif (!type.ContainsGenericParameters)\n\t\t\t\t{\n\t\t\t\t\tFactory factory = (Factory)type.GetConstructor(new Type[] { }).Invoke(new object[] { });\n\t\t\t\t\tFactory.factories.Add(type.Name.Substring(0, type.Name.Length - \"Factory\".Length), factory);\n\t\t\t\t\tFactory.factoriesByType.Add(type, factory);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static new Factory<MainClass> Get(string type)\n\t\t{\n\t\t\tFactory result = null;\n\t\t\tFactory.factories.TryGetValue(type, out result);\n\t\t\treturn (Factory<MainClass>)result;\n\t\t}\n\n\t\tpublic virtual Entity Create(MainClass main)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic Entity CreateAndBind(MainClass main)\n\t\t{\n\t\t\tEntity entity = this.Create(main);\n\t\t\tthis.Bind(entity, main, true);\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic void SetMain(Entity entity, MainClass main)\n\t\t{\n\t\t\tentity.SetMain(main);\n\t\t\tif (main.EditorEnabled)\n\t\t\t{\n\t\t\t\tFactory<MainClass>.GlobalEditorComponents(entity, main);\n\t\t\t\tthis.AttachEditorComponents(entity, main);\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual void Bind(Entity entity, MainClass main, bool creating = false)\n\t\t{\n\t\t\tthis.SetMain(entity, main);\n\t\t}\n\n\t\tpublic static Action<Factory<MainClass>, Entity, MainClass> DefaultEditorComponents;\n\t\tpublic static Action<Entity, MainClass> GlobalEditorComponents;\n\n\t\tpublic virtual void AttachEditorComponents(Entity entity, MainClass main)\n\t\t{\n\t\t\tFactory<MainClass>.DefaultEditorComponents(this, entity, main);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "ComponentBind/Log.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Reflection;\nusing System.Diagnostics;\n\nnamespace ComponentBind\n{\n\tpublic class Log\n\t{\n\t\tpublic static Action<string> Handler = (Action<string>)Console.WriteLine;\n\n\t\tpublic static void d(string log)\n\t\t{\n\t\t\tStackTrace trace = new StackTrace();\n\t\t\tMethodBase method = trace.GetFrame(1).GetMethod();\n\t\t\tLog.Handler(string.Format(\"{0}.{1}: {2}\", method.ReflectedType.Name, method.Name, log));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "ComponentBind/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"ComponentBind\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"ComponentBind\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"406447d3-9e9c-4c83-a9de-4c362711c098\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "ComponentBind/Property.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing System.ComponentModel;\nusing System.Collections;\nusing System.Diagnostics;\nusing Newtonsoft.Json;\n\nnamespace ComponentBind\n{\n\tpublic interface IProperty\n\t{\n\t\tvoid AddBinding(IPropertyBinding binding);\n\t\tvoid RemoveBinding(IPropertyBinding binding);\n\t\tvoid Reset();\n\t\tType PropertyType { get; }\n\t}\n\n\tpublic class PropertyEntry\n\t{\n\t\tpublic IProperty Property;\n\t\tpublic EditorData Data;\n\n\t\tpublic PropertyEntry(IProperty property, string description)\n\t\t{\n\t\t\tthis.Property = property;\n\t\t\tthis.Data = new EditorData();\n\t\t\tthis.Data.Description = description;\n\t\t}\n\n\t\tpublic PropertyEntry(IProperty property, EditorData data)\n\t\t{\n\t\t\tthis.Property = property;\n\t\t\tthis.Data = data;\n\t\t}\n\n\t\tpublic class EditorData\n\t\t{\n\t\t\tpublic Property<bool> Visible;\n\t\t\tpublic string Description;\n\t\t\tpublic IListProperty Options;\n\t\t\tpublic bool Readonly;\n\t\t\tpublic bool RefreshOnChange;\n\t\t\tpublic int IChangeBy = 1;\n\t\t\tpublic float FChangeBy = 1f;\n\t\t\tpublic byte BChangeBy = 1;\n\t\t}\n\t}\n\n\t[DebuggerDisplay(\"Property {Value}\")]\n\tpublic class Property<Type> : IProperty\n\t{\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tprotected Type _value;\n\n\t\tprotected List<IPropertyBinding> bindings = new List<IPropertyBinding>();\n\n\t\tpublic void AddBinding(IPropertyBinding binding)\n\t\t{\n\t\t\tthis.bindings.Add(binding);\n\t\t}\n\n\t\tpublic void RemoveBinding(IPropertyBinding binding)\n\t\t{\n\t\t\tthis.bindings.Remove(binding);\n\t\t}\n\n\t\tpublic void Changed()\n\t\t{\n\t\t\tfor (int j = this.bindings.Count - 1; j >= 0; j = Math.Min(this.bindings.Count - 1, j - 1))\n\t\t\t\tthis.bindings[j].OnChanged(this);\n\t\t}\n\n\t\tpublic Type Value\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this._value;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.InternalSet(value, null);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Reset()\n\t\t{\n\t\t\tthis.InternalSet(this._value, null);\n\t\t}\n\n\t\t[XmlIgnore]\n\t\t[JsonIgnore]\n\t\tpublic System.Type PropertyType\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn typeof(Type);\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetStealthy(Type t)\n\t\t{\n\t\t\tthis._value = t;\n\t\t}\n\n\t\tpublic void InternalSet(Type obj, IPropertyBinding binding)\n\t\t{\n\t\t\tthis._value = obj;\n\t\t\tfor (int j = this.bindings.Count - 1; j >= 0; j = Math.Min(this.bindings.Count - 1, j - 1))\n\t\t\t{\n\t\t\t\tIPropertyBinding b = this.bindings[j];\n\t\t\t\tif (b != binding)\n\t\t\t\t\tb.OnChanged(this);\n\t\t\t}\n\t\t}\n\n\t\tpublic static implicit operator Type(Property<Type> obj)\n\t\t{\n\t\t\treturn obj._value;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn this._value.ToString();\n\t\t}\n\t}\n\n\tpublic interface IListProperty : IProperty\n\t{\n\t\tvoid CopyTo(IListProperty dest);\n\t}\n\n\tpublic class ListProperty<Type> : ICollection<Type>, IListProperty\n\t{\n\t\tpublic delegate void ItemAddedEventHandler(int index, Type t);\n\t\tpublic delegate void ItemRemovedEventHandler(int index, Type t);\n\t\tpublic delegate void ItemChangedEventHandler(int index, Type old, Type newValue);\n\t\tpublic delegate void ClearEventHandler();\n\n\t\tpublic int Count\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.list.Count;\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<int> Length = new Property<int>();\n\n\t\tpublic event ItemAddedEventHandler ItemAdded;\n\t\tpublic event ItemRemovedEventHandler ItemRemoved;\n\t\tpublic event ItemChangedEventHandler ItemChanged;\n\t\tpublic event ClearEventHandler Cleared;\n\t\tpublic event ClearEventHandler Clearing;\n\n\t\tpublic void Reset()\n\t\t{\n\n\t\t}\n\n\t\tpublic System.Type PropertyType\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn typeof (Type);\n\t\t\t}\n\t\t}\n\n\t\tprivate List<Type> list = new List<Type>();\n\t\tprotected List<IListBinding<Type>> bindings = new List<IListBinding<Type>>();\n\n\t\tpublic void AddBinding(IPropertyBinding binding)\n\t\t{\n\t\t\tif (!this.bindings.Contains(binding))\n\t\t\t\tthis.bindings.Add((IListBinding<Type>)binding);\n\t\t}\n\n\t\tpublic void RemoveBinding(IPropertyBinding binding)\n\t\t{\n\t\t\tthis.bindings.Remove((IListBinding<Type>)binding);\n\t\t}\n\n\t\tpublic bool IsReadOnly\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Contains(Type t)\n\t\t{\n\t\t\treturn this.list.Contains(t);\n\t\t}\n\n\t\tpublic void CopyTo(Type[] array, int arrayIndex)\n\t\t{\n\t\t\tthis.list.CopyTo(array, arrayIndex);\n\t\t}\n\n\t\tIEnumerator<Type> IEnumerable<Type>.GetEnumerator()\n\t\t{\n\t\t\treturn this.list.GetEnumerator();\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn this.list.GetEnumerator();\n\t\t}\n\n\t\tpublic Type this[int i]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.list[i];\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.Changed(i, value);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Changed()\n\t\t{\n\t\t\tfor (int j = this.bindings.Count - 1; j >= 0; j = Math.Min(this.bindings.Count - 1, j - 1))\n\t\t\t\tthis.bindings[j].OnChanged(this);\n\t\t}\n\n\t\tpublic void CopyTo(IListProperty dest)\n\t\t{\n\t\t\tListProperty<Type> list = (ListProperty<Type>)dest;\n\t\t\tlist.Clear();\n\t\t\tfor (int i = 0; i < this.list.Count; i++)\n\t\t\t\tlist.Add(this.list[i]);\n\t\t}\n\n\t\tpublic void Add(Type t)\n\t\t{\n\t\t\tthis.list.Add(t);\n\n\t\t\tthis.Length.Value = this.list.Count;\n\n\t\t\tfor (int j = this.bindings.Count - 1; j >= 0; j = Math.Min(this.bindings.Count - 1, j - 1))\n\t\t\t\tthis.bindings[j].Add(t, this);\n\n\t\t\tif (this.ItemAdded != null)\n\t\t\t\tthis.ItemAdded(this.list.Count - 1, t);\n\t\t}\n\n\t\tpublic int IndexOf(Type t)\n\t\t{\n\t\t\treturn this.list.IndexOf(t);\n\t\t}\n\n\t\tpublic void AddAll(IEnumerable<Type> items)\n\t\t{\n\t\t\tforeach (Type t in items)\n\t\t\t\tthis.Add(t);\n\t\t}\n\n\t\tpublic void Insert(int index, Type t)\n\t\t{\n\t\t\tthis.list.Insert(index, t);\n\n\t\t\tthis.Length.Value = this.list.Count;\n\n\t\t\tfor (int j = this.bindings.Count - 1; j >= 0; j = Math.Min(this.bindings.Count - 1, j - 1))\n\t\t\t\tthis.bindings[j].Add(t, this);\n\n\t\t\tif (this.ItemAdded != null)\n\t\t\t\tthis.ItemAdded(index, t);\n\t\t}\n\n\t\tpublic void RemoveAt(int index)\n\t\t{\n\t\t\tType t = this.list[index];\n\t\t\tthis.list.RemoveAt(index);\n\t\t\tthis.Length.Value = this.list.Count;\n\t\t\tif (this.ItemRemoved != null)\n\t\t\t\tthis.ItemRemoved(index, t);\n\n\t\t\tfor (int j = this.bindings.Count - 1; j >= 0; j = Math.Min(this.bindings.Count - 1, j - 1))\n\t\t\t\tthis.bindings[j].Remove(t, this);\n\t\t}\n\n\t\tpublic bool Remove(Type t)\n\t\t{\n\t\t\tint index = this.list.IndexOf(t);\n\n\t\t\tthis.list.RemoveAt(index);\n\t\t\tthis.Length.Value = this.list.Count;\n\t\t\tif (this.ItemRemoved != null)\n\t\t\t\tthis.ItemRemoved(index, t);\n\n\t\t\tfor (int j = this.bindings.Count - 1; j >= 0; j = Math.Min(this.bindings.Count - 1, j - 1))\n\t\t\t\tthis.bindings[j].Remove(t, this);\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic void RemoveWithoutNotifying(Type t)\n\t\t{\n\t\t\tint index = this.list.IndexOf(t);\n\n\t\t\tthis.list.RemoveAt(index);\n\t\t\tthis.Length.Value = this.list.Count;\n\n\t\t\tfor (int j = this.bindings.Count - 1; j >= 0; j = Math.Min(this.bindings.Count - 1, j - 1))\n\t\t\t\tthis.bindings[j].Remove(t, this);\n\t\t}\n\n\t\tpublic void RemoveAll(IEnumerable<Type> items)\n\t\t{\n\t\t\tforeach (Type t in items)\n\t\t\t\tthis.Remove(t);\n\t\t}\n\n\t\tpublic void Changed(Type from, Type to)\n\t\t{\n\t\t\tint i = this.list.IndexOf(from);\n\t\t\tthis.list[i] = to;\n\t\t\tif (this.ItemChanged != null)\n\t\t\t\tthis.ItemChanged(i, from, to);\n\n\t\t\tfor (int j = this.bindings.Count - 1; j >= 0; j = Math.Min(this.bindings.Count - 1, j - 1))\n\t\t\t\tthis.bindings[j].OnChanged(from, to, this);\n\t\t}\n\n\t\tpublic void Changed(int i, Type to)\n\t\t{\n\t\t\tType from = this.list[i];\n\t\t\tthis.list[i] = to;\n\t\t\tif (this.ItemChanged != null)\n\t\t\t\tthis.ItemChanged(i, from, to);\n\n\t\t\tfor (int j = this.bindings.Count - 1; j >= 0; j = Math.Min(this.bindings.Count - 1, j - 1))\n\t\t\t\tthis.bindings[j].OnChanged(from, to, this);\n\t\t}\n\n\t\tpublic void Clear()\n\t\t{\n\t\t\tbool notify = this.list.Count > 0;\n\n\t\t\tif (notify && this.Clearing != null)\n\t\t\t\tthis.Clearing();\n\n\t\t\tthis.list.Clear();\n\t\t\tthis.Length.Value = 0;\n\n\t\t\tif (notify)\n\t\t\t{\n\t\t\t\tif (this.Cleared != null)\n\t\t\t\t\tthis.Cleared();\n\n\t\t\t\tfor (int i = this.bindings.Count - 1; i >= 0; i = Math.Min(this.bindings.Count - 1, i - 1))\n\t\t\t\t\tthis.bindings[i].Clear(this);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Changed(Type t)\n\t\t{\n\t\t\tif (this.ItemChanged != null)\n\t\t\t{\n\t\t\t\tint i = this.list.IndexOf(t);\n\t\t\t\tthis.ItemChanged(i, t, t);\n\t\t\t}\n\n\t\t\tfor (int j = this.bindings.Count - 1; j >= 0; j = Math.Min(this.bindings.Count - 1, j - 1))\n\t\t\t\tthis.bindings[j].OnChanged(t, t, this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "ComponentBind/Transform.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\n\nnamespace ComponentBind\n{\n\tpublic class Transform : Component<BaseMain>\n\t{\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<Quaternion> Quaternion = new Property<Quaternion>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> Matrix = new Property<Matrix> { Value = Microsoft.Xna.Framework.Matrix.Identity };\n\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> Selectable = new Property<bool> { Value = true };\n\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"Position\", this.Position);\n\t\t\tthis.Entity.Add(\"Quaternion\", this.Quaternion);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new TwoWayBinding<Vector3, Matrix>(\n\t\t\t\tthis.Position,\n\t\t\t\tdelegate(Matrix value)\n\t\t\t\t{\n\t\t\t\t\treturn value.Translation;\n\t\t\t\t},\n\t\t\t\tthis.Matrix,\n\t\t\t\tdelegate(Vector3 value)\n\t\t\t\t{\n\t\t\t\t\tMatrix matrix = this.Matrix.Value;\n\t\t\t\t\tmatrix.Translation = value;\n\t\t\t\t\treturn matrix;\n\t\t\t\t}));\n\n\t\t\tthis.Add(new TwoWayBinding<Quaternion, Matrix>(\n\t\t\t\tthis.Quaternion,\n\t\t\t\tdelegate(Matrix value)\n\t\t\t\t{\n\t\t\t\t\tVector3 scale, translation;\n\t\t\t\t\tQuaternion rotation;\n\t\t\t\t\tvalue.Decompose(out scale, out rotation, out translation);\n\t\t\t\t\treturn rotation;\n\t\t\t\t},\n\t\t\t\tthis.Matrix,\n\t\t\t\tdelegate(Quaternion value)\n\t\t\t\t{\n\t\t\t\t\tMatrix original = this.Matrix;\n\t\t\t\t\tMatrix result = Microsoft.Xna.Framework.Matrix.CreateFromQuaternion(value);\n\t\t\t\t\tresult.Translation = original.Translation;\n\t\t\t\t\treturn result;\n\t\t\t\t}));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Dialogger/app.js",
    "content": "var app = module.exports = require('appjs');\n\napp.serveFilesFrom(__dirname + '/content');\n\nvar window = app.createWindow(\n{\n\twidth\t: 1280,\n\theight : 720,\n\ticons\t: __dirname + '/content/icons'\n});\n\nwindow.on('create', function()\n{\n\twindow.frame.show();\n\twindow.frame.center();\n});\n\nwindow.on('ready', function()\n{\n    window.require = require;\n\twindow.process = process;\n\twindow.module = module;\n\n\tfunction F12(e) { return e.keyIdentifier === 'F12' }\n\tfunction Command_Option_J(e) { return e.keyCode === 74 && e.metaKey && e.altKey }\n\n\twindow.addEventListener('keydown', function(e)\n\t{\n\t\tif (F12(e) || Command_Option_J(e))\n\t\t\twindow.frame.openDevTools();\n\t});\n\n    window.dispatchEvent(new window.Event('app-ready'));\n});\n"
  },
  {
    "path": "Dialogger/dialogger.js",
    "content": "var fs = null;\naddEventListener('app-ready', function(e)\n{\n\t// We're running inside app.js\n\tfs = require('fs');\n\t$('#import').hide();\n\t$('#export').hide();\n\t$('#export-game').hide();\n});\n\nvar graph = new joint.dia.Graph();\n\nvar defaultLink = new joint.dia.Link(\n{\n\tattrs:\n\t{\n\t\t'.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z', },\n\t\t'.link-tools .tool-remove circle, .marker-vertex': { r: 8 },\n\t},\n});\ndefaultLink.set('smooth', true);\n\nvar allowableConnections =\n[\n\t['dialogue.Text', 'dialogue.Text'],\n\t['dialogue.Text', 'dialogue.Node'],\n\t['dialogue.Text', 'dialogue.Choice'],\n\t['dialogue.Text', 'dialogue.Set'],\n\t['dialogue.Text', 'dialogue.Branch'],\n\t['dialogue.Node', 'dialogue.Text'],\n\t['dialogue.Node', 'dialogue.Node'],\n\t['dialogue.Node', 'dialogue.Choice'],\n\t['dialogue.Node', 'dialogue.Set'],\n\t['dialogue.Node', 'dialogue.Branch'],\n\t['dialogue.Choice', 'dialogue.Text'],\n\t['dialogue.Choice', 'dialogue.Node'],\n\t['dialogue.Choice', 'dialogue.Set'],\n\t['dialogue.Choice', 'dialogue.Branch'],\n\t['dialogue.Set', 'dialogue.Text'],\n\t['dialogue.Set', 'dialogue.Node'],\n\t['dialogue.Set', 'dialogue.Set'],\n\t['dialogue.Set', 'dialogue.Branch'],\n\t['dialogue.Branch', 'dialogue.Text'],\n\t['dialogue.Branch', 'dialogue.Node'],\n\t['dialogue.Branch', 'dialogue.Set'],\n\t['dialogue.Branch', 'dialogue.Branch'],\n];\n\nfunction validateConnection(cellViewS, magnetS, cellViewT, magnetT, end, linkView)\n{\n\t// Prevent loop linking\n\tif (magnetS == magnetT)\n\t\treturn false;\n\n\tif (cellViewS == cellViewT)\n\t\treturn false;\n\n\tif (magnetT.attributes.magnet.nodeValue !== 'passive') // Can't connect to an output port\n\t\treturn false;\n\n\tvar sourceType = cellViewS.model.attributes.type;\n\tvar targetType = cellViewT.model.attributes.type;\n\tvar valid = false;\n\tfor (var i = 0; i < allowableConnections.length; i++)\n\t{\n\t\tvar rule = allowableConnections[i];\n\t\tif (sourceType == rule[0] && targetType == rule[1])\n\t\t{\n\t\t\tvalid = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!valid)\n\t\treturn false;\n\n\tvar links = graph.getConnectedLinks(cellViewS.model);\n\tfor (var i = 0; i < links.length; i++)\n\t{\n\t\tvar link = links[i];\n\t\tif (link.attributes.source.id === cellViewS.model.id && link.attributes.source.port === magnetS.attributes.port.nodeValue && link.attributes.target.id)\n\t\t{\n\t\t\tvar targetCell = graph.getCell(link.attributes.target.id);\n\t\t\tif (targetCell.attributes.type !== targetType)\n\t\t\t\treturn false; // We can only connect to multiple targets of the same type\n\t\t\tif (targetCell == cellViewT.model)\n\t\t\t\treturn false; // Already connected\n\t\t} \n\t}\n\n\treturn true;\n}\n\nfunction validateMagnet(cellView, magnet)\n{\n\tif (magnet.getAttribute('magnet') === 'passive')\n\t\treturn false;\n\n\t// If unlimited connections attribute is null, we can only ever connect to one object\n\t// If it is not null, it is an array of type strings which are allowed to have unlimited connections\n\tvar unlimitedConnections = magnet.getAttribute('unlimitedConnections');\n\tvar links = graph.getConnectedLinks(cellView.model);\n\tfor (var i = 0; i < links.length; i++)\n\t{\n\t\tvar link = links[i];\n\t\tif (link.attributes.source.id === cellView.model.id && link.attributes.source.port === magnet.attributes.port.nodeValue)\n\t\t{\n\t\t\t// This port already has a connection\n\t\t\tif (unlimitedConnections && link.attributes.target.id)\n\t\t\t{\n\t\t\t\tvar targetCell = graph.getCell(link.attributes.target.id);\n\t\t\t\tif (unlimitedConnections.indexOf(targetCell.attributes.type) !== -1)\n\t\t\t\t\treturn true; // It's okay because this target type has unlimited connections\n\t\t\t} \n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\njoint.shapes.dialogue = {};\njoint.shapes.dialogue.Base = joint.shapes.devs.Model.extend(\n{\n\tdefaults: joint.util.deepSupplement\n\t(\n\t\t{\n\t\t\ttype: 'dialogue.Base',\n\t\t\tsize: { width: 200, height: 64 },\n\t\t\tname: '',\n\t\t\tattrs:\n\t\t\t{\n\t\t\t\trect: { stroke: 'none', 'fill-opacity': 0 },\n\t\t\t\ttext: { display: 'none' },\n\t\t\t\t'.inPorts circle': { magnet: 'passive' },\n\t\t\t\t'.outPorts circle': { magnet: true, },\n\t\t\t},\n\t\t},\n\t\tjoint.shapes.devs.Model.prototype.defaults\n\t),\n});\n\njoint.shapes.dialogue.BaseView = joint.shapes.devs.ModelView.extend(\n{\n\ttemplate:\n\t[\n\t\t'<div class=\"node\">',\n\t\t'<span class=\"label\"></span>',\n\t\t'<button class=\"delete\">x</button>',\n\t\t'<input type=\"text\" class=\"name\" placeholder=\"Text\" />',\n\t\t'</div>',\n\t].join(''),\n\n\tinitialize: function()\n\t{\n\t\t_.bindAll(this, 'updateBox');\n\t\tjoint.shapes.devs.ModelView.prototype.initialize.apply(this, arguments);\n\n\t\tthis.$box = $(_.template(this.template)());\n\t\t// Prevent paper from handling pointerdown.\n\t\tthis.$box.find('input').on('mousedown click', function(evt) { evt.stopPropagation(); });\n\n\t\t// This is an example of reacting on the input change and storing the input data in the cell model.\n\t\tthis.$box.find('input.name').on('change', _.bind(function(evt)\n\t\t{\n\t\t\tthis.model.set('name', $(evt.target).val());\n\t\t}, this));\n\n\t\tthis.$box.find('.delete').on('click', _.bind(this.model.remove, this.model));\n\t\t// Update the box position whenever the underlying model changes.\n\t\tthis.model.on('change', this.updateBox, this);\n\t\t// Remove the box when the model gets removed from the graph.\n\t\tthis.model.on('remove', this.removeBox, this);\n\n\t\tthis.updateBox();\n\t},\n\n\trender: function()\n\t{\n\t\tjoint.shapes.devs.ModelView.prototype.render.apply(this, arguments);\n\t\tthis.paper.$el.prepend(this.$box);\n\t\tthis.updateBox();\n\t\treturn this;\n\t},\n\n\tupdateBox: function()\n\t{\n\t\t// Set the position and dimension of the box so that it covers the JointJS element.\n\t\tvar bbox = this.model.getBBox();\n\t\t// Example of updating the HTML with a data stored in the cell model.\n\t\tvar nameField = this.$box.find('input.name');\n\t\tif (!nameField.is(':focus'))\n\t\t\tnameField.val(this.model.get('name'));\n\t\tvar label = this.$box.find('.label');\n\t\tvar type = this.model.get('type').slice('dialogue.'.length);\n\t\tlabel.text(type);\n\t\tlabel.attr('class', 'label ' + type);\n\t\tthis.$box.css({ width: bbox.width, height: bbox.height, left: bbox.x, top: bbox.y, transform: 'rotate(' + (this.model.get('angle') || 0) + 'deg)' });\n\t},\n\n\tremoveBox: function(evt)\n\t{\n\t\tthis.$box.remove();\n\t},\n});\n\njoint.shapes.dialogue.Node = joint.shapes.devs.Model.extend(\n{\n\tdefaults: joint.util.deepSupplement\n\t(\n\t\t{\n\t\t\ttype: 'dialogue.Node',\n\t\t\tinPorts: ['input'],\n\t\t\toutPorts: ['output'],\n\t\t\tattrs:\n\t\t\t{\n\t\t\t\t'.outPorts circle': { unlimitedConnections: ['dialogue.Choice'], }\n\t\t\t},\n\t\t},\n\t\tjoint.shapes.dialogue.Base.prototype.defaults\n\t),\n});\njoint.shapes.dialogue.NodeView = joint.shapes.dialogue.BaseView;\n\njoint.shapes.dialogue.Text = joint.shapes.devs.Model.extend(\n{\n\tdefaults: joint.util.deepSupplement\n\t(\n\t\t{\n\t\t\ttype: 'dialogue.Text',\n\t\t\tinPorts: ['input'],\n\t\t\toutPorts: ['output'],\n\t\t\tattrs:\n\t\t\t{\n\t\t\t\t'.outPorts circle': { unlimitedConnections: ['dialogue.Choice'], }\n\t\t\t},\n\t\t},\n\t\tjoint.shapes.dialogue.Base.prototype.defaults\n\t),\n});\njoint.shapes.dialogue.TextView = joint.shapes.dialogue.BaseView;\n\njoint.shapes.dialogue.Choice = joint.shapes.devs.Model.extend(\n{\n\tdefaults: joint.util.deepSupplement\n\t(\n\t\t{\n\t\t\ttype: 'dialogue.Choice',\n\t\t\tinPorts: ['input'],\n\t\t\toutPorts: ['output'],\n\t\t},\n\t\tjoint.shapes.dialogue.Base.prototype.defaults\n\t),\n});\njoint.shapes.dialogue.ChoiceView = joint.shapes.dialogue.BaseView;\n\njoint.shapes.dialogue.Branch = joint.shapes.devs.Model.extend(\n{\n\tdefaults: joint.util.deepSupplement\n\t(\n\t\t{\n\t\t\ttype: 'dialogue.Branch',\n\t\t\tsize: { width: 200, height: 100, },\n\t\t\tinPorts: ['input'],\n\t\t\toutPorts: ['output0'],\n\t\t\tvalues: [],\n\t\t},\n\t\tjoint.shapes.dialogue.Base.prototype.defaults\n\t),\n});\njoint.shapes.dialogue.BranchView = joint.shapes.dialogue.BaseView.extend(\n{\n\ttemplate:\n\t[\n\t\t'<div class=\"node\">',\n\t\t'<span class=\"label\"></span>',\n\t\t'<button class=\"delete\">x</button>',\n\t\t'<button class=\"add\">+</button>',\n\t\t'<button class=\"remove\">-</button>',\n\t\t'<input type=\"text\" class=\"name\" placeholder=\"Variable\" />',\n\t\t'<input type=\"text\" value=\"Default\" readonly/>',\n\t\t'</div>',\n\t].join(''),\n\n\tinitialize: function()\n\t{\n\t\tjoint.shapes.dialogue.BaseView.prototype.initialize.apply(this, arguments);\n\t\tthis.$box.find('.add').on('click', _.bind(this.addPort, this));\n\t\tthis.$box.find('.remove').on('click', _.bind(this.removePort, this));\n\t},\n\n\tremovePort: function()\n\t{\n\t\tif (this.model.get('outPorts').length > 1)\n\t\t{\n\t\t\tvar outPorts = this.model.get('outPorts').slice(0);\n\t\t\toutPorts.pop();\n\t\t\tthis.model.set('outPorts', outPorts);\n\t\t\tvar values = this.model.get('values').slice(0);\n\t\t\tvalues.pop();\n\t\t\tthis.model.set('values', values);\n\t\t\tthis.updateSize();\n\t\t}\n\t},\n\n\taddPort: function()\n\t{\n\t\tvar outPorts = this.model.get('outPorts').slice(0);\n\t\toutPorts.push('output' + outPorts.length.toString());\n\t\tthis.model.set('outPorts', outPorts);\n\t\tvar values = this.model.get('values').slice(0);\n\t\tvalues.push(null);\n\t\tthis.model.set('values', values);\n\t\tthis.updateSize();\n\t},\n\n\tupdateBox: function()\n\t{\n\t\tjoint.shapes.dialogue.BaseView.prototype.updateBox.apply(this, arguments);\n\t\tvar values = this.model.get('values');\n\t\tvar valueFields = this.$box.find('input.value');\n\n\t\t// Add value fields if necessary\n\t\tfor (var i = valueFields.length; i < values.length; i++)\n\t\t{\n\t\t\t// Prevent paper from handling pointerdown.\n\t\t\tvar field = $('<input type=\"text\" class=\"value\" />');\n\t\t\tfield.attr('placeholder', 'Value ' + (i + 1).toString());\n\t\t\tfield.attr('index', i);\n\t\t\tthis.$box.append(field);\n\t\t\tfield.on('mousedown click', function(evt) { evt.stopPropagation(); });\n\n\t\t\t// This is an example of reacting on the input change and storing the input data in the cell model.\n\t\t\tfield.on('change', _.bind(function(evt)\n\t\t\t{\n\t\t\t\tvar values = this.model.get('values').slice(0);\n\t\t\t\tvalues[$(evt.target).attr('index')] = $(evt.target).val();\n\t\t\t\tthis.model.set('values', values);\n\t\t\t}, this));\n\t\t}\n\n\t\t// Remove value fields if necessary\n\t\tfor (var i = values.length; i < valueFields.length; i++)\n\t\t\t$(valueFields[i]).remove();\n\n\t\t// Update value fields\n\t\tvalueFields = this.$box.find('input.value');\n\t\tfor (var i = 0; i < valueFields.length; i++)\n\t\t{\n\t\t\tvar field = $(valueFields[i]);\n\t\t\tif (!field.is(':focus'))\n\t\t\t\tfield.val(values[i]);\n\t\t}\n\t},\n\n\tupdateSize: function()\n\t{\n\t\tvar textField = this.$box.find('input.name');\n\t\tvar height = textField.outerHeight(true);\n\t\tthis.model.set('size', { width: 200, height: 100 + Math.max(0, (this.model.get('outPorts').length - 1) * height) });\n\t},\n});\n\njoint.shapes.dialogue.Set = joint.shapes.devs.Model.extend(\n{\n\tdefaults: joint.util.deepSupplement\n\t(\n\t\t{\n\t\t\ttype: 'dialogue.Set',\n\t\t\tinPorts: ['input'],\n\t\t\toutPorts: ['output'],\n\t\t\tsize: { width: 200, height: 100, },\n\t\t\tvalue: '',\n\t\t},\n\t\tjoint.shapes.dialogue.Base.prototype.defaults\n\t),\n});\n\njoint.shapes.dialogue.SetView = joint.shapes.dialogue.BaseView.extend(\n{\n\ttemplate:\n\t[\n\t\t'<div class=\"node\">',\n\t\t'<span class=\"label\"></span>',\n\t\t'<button class=\"delete\">x</button>',\n\t\t'<input type=\"text\" class=\"name\" placeholder=\"Variable\" />',\n\t\t'<input type=\"text\" class=\"value\" placeholder=\"Value\" />',\n\t\t'</div>',\n\t].join(''),\n\n\tinitialize: function()\n\t{\n\t\tjoint.shapes.dialogue.BaseView.prototype.initialize.apply(this, arguments);\n\t\tthis.$box.find('input.value').on('change', _.bind(function(evt)\n\t\t{\n\t\t\tthis.model.set('value', $(evt.target).val());\n\t\t}, this));\n\t},\n\n\tupdateBox: function()\n\t{\n\t\tjoint.shapes.dialogue.BaseView.prototype.updateBox.apply(this, arguments);\n\t\tvar field = this.$box.find('input.value');\n\t\tif (!field.is(':focus'))\n\t\t\tfield.val(this.model.get('value'));\n\t},\n});\n\nfunction gameData()\n{\n\tvar cells = graph.toJSON().cells;\n\tvar nodesByID = {};\n\tvar cellsByID = {};\n\tvar nodes = [];\n\tfor (var i = 0; i < cells.length; i++)\n\t{\n\t\tvar cell = cells[i];\n\t\tif (cell.type != 'link')\n\t\t{\n\t\t\tvar node =\n\t\t\t{\n\t\t\t\ttype: cell.type.slice('dialogue.'.length),\n\t\t\t\tid: cell.id,\n\t\t\t};\n\t\t\tif (node.type == 'Branch')\n\t\t\t{\n\t\t\t\tnode.variable = cell.name;\n\t\t\t\tnode.branches = {};\n\t\t\t\tfor (var j = 0; j < cell.values.length; j++)\n\t\t\t\t{\n\t\t\t\t\tvar branch = cell.values[j];\n\t\t\t\t\tnode.branches[branch] = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (node.type == 'Set')\n\t\t\t{\n\t\t\t\tnode.variable = cell.name;\n\t\t\t\tnode.value = cell.value;\n\t\t\t\tnode.next = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnode.name = cell.name;\n\t\t\t\tnode.next = null;\n\t\t\t}\n\t\t\tnodes.push(node);\n\t\t\tnodesByID[cell.id] = node;\n\t\t\tcellsByID[cell.id] = cell;\n\t\t}\n\t}\n\tfor (var i = 0; i < cells.length; i++)\n\t{\n\t\tvar cell = cells[i];\n\t\tif (cell.type == 'link')\n\t\t{\n\t\t\tvar source = nodesByID[cell.source.id];\n\t\t\tvar target = cell.target ? nodesByID[cell.target.id] : null;\n\t\t\tif (source)\n\t\t\t{\n\t\t\t\tif (source.type == 'Branch')\n\t\t\t\t{\n\t\t\t\t\tvar portNumber = parseInt(cell.source.port.slice('output'.length));\n\t\t\t\t\tvar value;\n\t\t\t\t\tif (portNumber == 0)\n\t\t\t\t\t\tvalue = '_default';\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar sourceCell = cellsByID[source.id];\n\t\t\t\t\t\tvalue = sourceCell.values[portNumber - 1];\n\t\t\t\t\t}\n\t\t\t\t\tsource.branches[value] = target ? target.id : null;\n\t\t\t\t}\n\t\t\t\telse if ((source.type == 'Text' || source.type == 'Node') && target && target.type == 'Choice')\n\t\t\t\t{\n\t\t\t\t\tif (!source.choices)\n\t\t\t\t\t{\n\t\t\t\t\t\tsource.choices = [];\n\t\t\t\t\t\tdelete source.next;\n\t\t\t\t\t}\n\t\t\t\t\tsource.choices.push(target.id);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tsource.next = target ? target.id : null;\n\t\t\t}\n\t\t}\n\t}\n\treturn nodes;\n}\n\n// Menu actions\n\nvar filename = null;\nvar defaultFilename = 'dialogue.dl';\n\nfunction flash(text)\n{\n\tvar $flash = $('#flash');\n\t$flash.text(text);\n\t$flash.stop(true, true);\n\t$flash.show();\n\t$flash.css('opacity', 1.0);\n\t$flash.fadeOut({ duration: 1500 });\n}\n\nfunction offerDownload(name, data)\n{\n\tvar a = $('<a>');\n\ta.attr('download', name);\n\ta.attr('href', 'data:application/json,' + encodeURIComponent(JSON.stringify(data)));\n\ta.attr('target', '_blank');\n\ta.hide();\n\t$('body').append(a);\n\ta[0].click();\n\ta.remove();\n}\n\nfunction promptFilename(callback)\n{\n\tif (fs)\n\t{\n\t\tfilename = null;\n\t\twindow.frame.openDialog(\n\t\t{\n\t\t\ttype: 'save',\n\t\t}, function(err, files)\n\t\t{\n\t\t\tif (!err && files.length == 1)\n\t\t\t{\n\t\t\t\tfilename = files[0];\n\t\t\t\tcallback(filename);\n\t\t\t}\n\t\t});\n\t}\n\telse\n\t{\n\t\tfilename = prompt('Filename', defaultFilename);\n\t\tcallback(filename);\n\t}\n}\n\nfunction applyTextFields()\n{\n\t$('input[type=text]').blur();\n}\n\nfunction save()\n{\n\tapplyTextFields();\n\tif (!filename)\n\t\tpromptFilename(doSave);\n\telse\n\t\tdoSave();\n}\n\nfunction doSave()\n{\n\tif (filename)\n\t{\n\t\tif (fs)\n\t\t{\n\t\t\tfs.writeFileSync(filename, JSON.stringify(graph), 'utf8');\n\t\t\tfs.writeFileSync(gameFilenameFromNormalFilename(filename), JSON.stringify(gameData()), 'utf8');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!localStorage[filename])\n\t\t\t\taddFileEntry(filename);\n\t\t\tlocalStorage[filename] = JSON.stringify(graph);\n\t\t}\n\t\tflash('Saved ' + filename);\n\t}\n}\n\nfunction load()\n{\n\tif (fs)\n\t{\n\t\twindow.frame.openDialog(\n\t\t{\n\t\t\ttype: 'open',\n\t\t\tmultiSelect: false,\n\t\t}, function(err, files)\n\t\t{\n\t\t\tif (!err && files.length == 1)\n\t\t\t{\n\t\t\t\tgraph.clear();\n\t\t\t\tfilename = files[0];\n\t\t\t\tgraph.fromJSON(JSON.parse(fs.readFileSync(filename, 'utf8')));\n\t\t\t}\n\t\t});\n\t}\n\telse\n\t\t$('#menu').show();\n}\n\nfunction exportFile()\n{\n\tif (!fs)\n\t{\n\t\tapplyTextFields();\n\t\tofferDownload(filename ? filename : defaultFilename, graph);\n\t}\n}\n\nfunction gameFilenameFromNormalFilename(f)\n{\n\treturn f.substring(0, f.length - 2) + 'dlz';\n}\n\nfunction exportGameFile()\n{\n\tif (!fs)\n\t{\n\t\tapplyTextFields();\n\t\tofferDownload(gameFilenameFromNormalFilename(filename ? filename : defaultFilename), gameData());\n\t}\n}\n\nfunction importFile()\n{\n\tif (!fs)\n\t\t$('#file').click();\n}\n\nfunction add(constructor)\n{\n\treturn function()\n\t{\n\t\tvar position = $('#cmroot').position();\n\t\tvar container = $('#container')[0];\n\t\tvar element = new constructor(\n\t\t{\n\t\t\tposition: { x: position.left + container.scrollLeft, y: position.top + container.scrollTop },\n\t\t});\n\t\tgraph.addCells([element]);\n\t};\n}\n\nfunction clear()\n{\n\tgraph.clear();\n\tfilename = null;\n}\n\n// Browser stuff\n\nvar paper = new joint.dia.Paper(\n{\n\tel: $('#paper'),\n\twidth: 16000,\n\theight: 8000,\n\tmodel: graph,\n\tgridSize: 1,\n\tdefaultLink: defaultLink,\n\tvalidateConnection: validateConnection,\n\tvalidateMagnet: validateMagnet,\n\t// Enable link snapping within 75px lookup radius\n\tsnapLinks: { radius: 75 }\n});\n\nvar panning = false;\nvar mousePosition = { x: 0, y: 0 };\npaper.on('blank:pointerdown', function(e, x, y)\n{\n\tpanning = true;\n\tmousePosition.x = e.pageX;\n\tmousePosition.y = e.pageY;\n\t$('body').css('cursor', 'move');\n\tapplyTextFields();\n});\npaper.on('cell:pointerdown', function(e, x, y)\n{\n\tapplyTextFields();\n});\n\n$('#container').mousemove(function(e)\n{\n\tif (panning)\n\t{\n\t\tvar $this = $(this);\n\t\t$this.scrollLeft($this.scrollLeft() + mousePosition.x - e.pageX);\n\t\t$this.scrollTop($this.scrollTop() + mousePosition.y - e.pageY);\n\t\tmousePosition.x = e.pageX;\n\t\tmousePosition.y = e.pageY;\n\t}\n});\n\n$('#container').mouseup(function (e)\n{\n\tpanning = false;\n\t$('body').css('cursor', 'default');\n});\n\nfunction handleFiles(files)\n{\n\tfilename = files[0].name;\n\tvar fileReader = new FileReader();\n\tfileReader.onload = function(e)\n\t{\n\t\tgraph.clear();\n\t\tgraph.fromJSON(JSON.parse(e.target.result));\n\t};\n\tfileReader.readAsText(files[0]);\n}\n\n$('#file').on('change', function()\n{\n\thandleFiles(this.files);\n});\n\n$('body').on('dragenter', function(e)\n{\n\te.stopPropagation();\n\te.preventDefault();\n});\n\n$('body').on('dragexit', function(e)\n{\n\te.stopPropagation();\n\te.preventDefault();\n});\n\n$('body').on('dragover', function(e)\n{\n\te.stopPropagation();\n\te.preventDefault();\n});\n\n$('body').on('drop', function(e)\n{\n\te.stopPropagation();\n\te.preventDefault();\n\thandleFiles(e.originalEvent.dataTransfer.files);\n});\n\n$(window).on('keydown', function(event)\n{\n\t// Catch Ctrl-S or key code 19 on Mac (Cmd-S)\n\tif (((event.ctrlKey || event.metaKey) && String.fromCharCode(event.which).toLowerCase() == 's') || event.which == 19)\n\t{\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\t\tsave();\n\t\treturn false;\n\t}\n\telse if ((event.ctrlKey || event.metaKey) && String.fromCharCode(event.which).toLowerCase() == 'o')\n\t{\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\t\tload();\n\t\treturn false;\n\t}\n\telse if ((event.ctrlKey || event.metaKey) && String.fromCharCode(event.which).toLowerCase() == 'e')\n\t{\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\t\texportFile();\n\t\treturn false;\n\t}\n\treturn true;\n});\n\n$(window).resize(function()\n{\n\tapplyTextFields();\n\tvar $window = $(window);\n\tvar $container = $('#container');\n\t\t$container.height($window.innerHeight());\n\t\t$container.width($window.innerWidth());\n\t\tvar $menu = $('#menu');\n\t\t$menu.css('top', Math.max(0, (($window.height() - $menu.outerHeight()) / 2)) + 'px');\n\t\t$menu.css('left', Math.max(0, (($window.width() - $menu.outerWidth()) / 2)) + 'px');\n\t\treturn this;\n});\n\nfunction addFileEntry(name)\n{\n\tvar entry = $('<div>');\n\tentry.text(name);\n\tvar deleteButton = $('<button class=\"delete\">-</button>');\n\tentry.append(deleteButton);\n\t$('#menu').append(entry);\n\n\tdeleteButton.on('click', function(event)\n\t{\n\t\tlocalStorage.removeItem(name);\n\t\tentry.remove();\n\t\tevent.stopPropagation();\n\t});\n\n\tentry.on('click', function(event)\n\t{\n\t\tgraph.clear();\n\t\tgraph.fromJSON(JSON.parse(localStorage[name]));\n\t\tfilename = name;\n\t\t$('#menu').hide();\n\t});\n}\n\n(function()\n{\n\tfor (var i = 0; i < localStorage.length; i++)\n\t\taddFileEntry(localStorage.key(i));\n})();\n\n$('#menu button.close').click(function()\n{\n\t$('#menu').hide();\n});\n\n$(window).trigger('resize');\n\n$('#paper').contextmenu(\n{\n\twidth: 150,\n\titems:\n\t[\n\t\t{ text: 'Text', alias: '1-1', action: add(joint.shapes.dialogue.Text) },\n\t\t{ text: 'Choice', alias: '1-2', action: add(joint.shapes.dialogue.Choice) },\n\t\t{ text: 'Branch', alias: '1-3', action: add(joint.shapes.dialogue.Branch) },\n\t\t{ text: 'Set', alias: '1-4', action: add(joint.shapes.dialogue.Set) },\n\t\t{ text: 'Node', alias: '1-5', action: add(joint.shapes.dialogue.Node) },\n\t\t{ type: 'splitLine' },\n\t\t{ text: 'Save', alias: '2-1', action: save },\n\t\t{ text: 'Load', alias: '2-2', action: load },\n\t\t{ text: 'Import', id: 'import', alias: '2-3', action: importFile },\n\t\t{ text: 'New', alias: '2-4', action: clear },\n\t\t{ text: 'Export', id: 'export', alias: '2-5', action: exportFile },\n\t\t{ text: 'Export game file', id: 'export-game', alias: '2-6', action: exportGameFile },\n\t]\n});\n"
  },
  {
    "path": "Dialogger/index.css",
    "content": "html, body \n{\n\tpadding: 0px;\n\tcolor: #fff;\n\tmargin: 0px;\n\tfont-family: sans-serif;\n\tfont-size: small;\n\tbackground: #7d8ea2; /* Old browsers */\n\tbackground: -moz-linear-gradient(top, #7d8ea2 0%, #121413 100%); /* FF3.6+ */\n\tbackground: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7d8ea2), color-stop(100%,#121413)); /* Chrome,Safari4+ */\n\tbackground: -webkit-linear-gradient(top, #7d8ea2 0%,#121413 100%); /* Chrome10+,Safari5.1+ */\n\tbackground: -o-linear-gradient(top, #7d8ea2 0%,#121413 100%); /* Opera 11.10+ */\n\tbackground: -ms-linear-gradient(top, #7d8ea2 0%,#121413 100%); /* IE10+ */\n\tbackground: linear-gradient(to bottom, #7d8ea2 0%,#121413 100%); /* W3C */\n\tfilter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7d8ea2', endColorstr='#121413',GradientType=0 ); /* IE6-9 */\n\toverflow: hidden;\n}\n\n#container\n{\n\toverflow: scroll;\n}\n\n#paper\n{\n\tposition: relative;\n\tdisplay: inline-block;\n\tbackground: transparent;\n\tbackground-image: url(g/grid.png);\n}\n\n#paper svg\n{\n\tbackground: transparent;\n}\n\n#paper svg .link\n{\n\tz-index: 2;\n}\n\n#menu\n{\n\tposition: absolute;\n\tdisplay: none;\n\twidth: 40%;\n\tz-index: 10000;\n\tpadding: 8px;\n\tcursor: pointer;\n}\n\n#menu div\n{\n\tclear: right;\n\tpadding: 4px;\n\tmargin-left: 20px;\n\tmargin-right: 20px;\n\tborder-bottom: 1px solid #ccc;\n}\n\n#menu div:hover\n{\n\tbackground-color: black;\n}\n\n#flash\n{\n\tposition: absolute;\n\ttop: 10px;\n\tleft: 10px;\n\tpadding: 8px;\n\tfont-weight: bold;\n\tdisplay: none;\n}\n\n/*\nEditor tools\n*/\n.marker-target\n{\n\tfill: #fff;\n\tstroke-width: 0;\n}\n\n.marker-vertex\n{\n   fill: #fff;\n}\n\n.marker-vertex:hover\n{\n   fill: #000;\n   stroke: none;\n}\n\n.marker-arrowhead\n{\n   fill: #fff;\n   stroke: none;\n}\n\n.marker-arrowhead:hover\n{\n   fill: #000;\n}\n\n.link-tools .tool-remove circle\n{\n   fill: #c0392b;\n}\n\n.connection\n{\n\tstroke: #fff;\n}\n\n.inPorts circle\n{\n\tfill: #c0392b;\n\tstroke-width: 0;\n}\n\n.outPorts circle\n{\n\tfill: #8c6;\n\tstroke-width: 0;\n}\n\n/*\nNode styles\n*/\n\n.node\n{\n\tposition: absolute;\n\tbackground: #666;\n\t/* Make sure events are propagated to the JointJS element so, e.g. dragging works.*/\n\tpointer-events: none;\n\t-webkit-user-select: none;\n\tpadding: 8px;\n\tbox-sizing: border-box;\n\tz-index: 2;\n}\n\n.node input, button\n{\n\t/* Enable interacting with inputs only. */\n\tpointer-events: auto;\t\n\tborder: none;\n\tbox-sizing: border-box;\n\tbackground-color: #456;\n\tcolor: #fff;\n}\n\n.node .label\n{\n\tcolor: #ddd;\n}\n\n.node .label.Text\n{\n\tcolor: #8c6;\n}\n\n.node .label.Set\n{\n\tcolor: #acf;\n}\n\n.node .label.Choice\n{\n\tcolor: #dc5;\n}\n\n.node .label.Branch\n{\n\tcolor: #ea6;\n}\n\nbutton\n{\n\tfloat: right;\n\tborder: none;\n\tborder-radius: 8px;\n\tfont-weight: bold;\n\twidth: 16px;\n\theight: 16px;\n\tline-height: 0px;\n\ttext-align: middle;\n\tpadding: 0;\n\tmargin: 0;\n\tcursor: pointer;\n}\n\nbutton.delete:hover\n{\n\tbackground-color: #c0392b;\n}\n\n.node button.add:hover\n{\n\tbackground-color: #8c6;\n}\n\n.node button.remove:hover\n{\n\tbackground-color: #dc5;\n}\n\n.node input\n{\n\twidth: 100%;\n\tpadding: 4px;\n\tmargin-top: 8px;\n}\n\n.node\n{\n\tcolor: #fff;\n}\n\n/*\nContext menu\n*/\n.b-m-mpanel, #menu, #flash\n{\n\tbackground-color: #444;\n\tposition: absolute;\n\tz-index: 99997;\n\t-moz-box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.5);\n\t-webkit-box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.5);\n\tbox-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.5);\n}\n\n.b-m-split\n{\n\tfont-size: 0px;\n\tmargin: 2px;\n\tborder-bottom: 1px solid #777;\n}\n\n.b-m-item, .b-m-ifocus\n{\n    padding: 8px;\n    line-height: 100%;\n}\n\nspan\n{\n    -moz-user-select: none;\n    -webkit-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n    cursor: default;\n}\n\n.b-m-ibody\n{\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.b-m-ifocus\n{\n    background-color: #000;\n}\n"
  },
  {
    "path": "Dialogger/index.html",
    "content": "<!doctype html>\n<html>\n\t<head>\n\t\t<title>Dialogger</title>\n\t\t<link rel=\"stylesheet\" href=\"lib/joint.css\" />\n\t\t<link rel=\"stylesheet\" href=\"index.css\" />\n\t\t<script src=\"lib/joint.js\"></script>\n\t\t<script src=\"lib/jquery.contextmenu.js\"></script>\n\t\t<script src=\"lib/joint.shapes.devs.js\"></script>\n\t</head>\n\t<body>\n\t\t<input type=\"file\" id=\"file\" accept=\".dl\" style=\"display: none;\" />\n\t\t<div id=\"flash\"></div>\n\t\t<div id=\"menu\">\n\t\t\t<button class=\"delete close\">x</button>\n\t\t</div>\n\t\t<div id=\"container\">\n\t\t\t<div id=\"paper\"></div>\n\t\t</div>\n\t\t<script src=\"dialogger.js\"></script>\n\t</body>\n</html>"
  },
  {
    "path": "Dialogger/lib/joint.css",
    "content": "/*! JointJS v0.8.1 - JavaScript diagramming library  2014-02-24 \n\n\nThis Source Code Form is subject to the terms of the Mozilla Public\nLicense, v. 2.0. If a copy of the MPL was not distributed with this\nfile, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n\n/*\nA complete list of SVG properties that can be set through CSS is here:\nhttp://www.w3.org/TR/SVG/styling.html\n\nImportant note: Presentation attributes have a lower precedence over CSS style rules.\n*/\n\n\n/* .viewport is a <g> node wrapping all diagram elements in the paper */\n.viewport {\n   -webkit-user-select: none;\n   -moz-user-select: none;\n   user-select: none;\n}\n\n/* .magnet is an element that can be either source or a target of a link */\n/*\n.magnet {\n   fill: black;\n   fill-opacity: 0;\n   stroke: black;\n   stroke-width: 15;\n   stroke-opacity: 0;\n   pointer-events: visibleStroke;\n   cursor: crosshair;\n   vector-effect: non-scaling-stroke;\n}\n\n.magnet:hover {\n   stroke-opacity: .5;\n}\n*/\n\n[magnet=true]:not(.element) {\n   cursor: crosshair;\n}\n[magnet=true]:not(.element):hover {\n   opacity: .7;\n}\n\n/*\n\nElements have CSS classes named by their types. E.g. type: basic.Rect has a CSS class \"element basic Rect\".\nThis makes it possible to easilly style elements in CSS and have generic CSS rules applying to\nthe whole group of elements. Each plugin can provide its own stylesheet.\n\n*/\n\n.element {\n   /* Give the user a hint that he can drag&drop the element. */\n   cursor: move;\n}\n\n.element * {\n   /* The default behavior when scaling an element is not to scale the stroke in order to prevent the ugly effect of stroke with different proportions. */\n   vector-effect: non-scaling-stroke;\n   -moz-user-select: none;\n   user-drag: none;\n}\n\n\n/* \n\nconnection-wrap is a <path> element of the joint.dia.Link that follows the .connection <path> of that link.\nIn other words, the `d` attribute of the .connection-wrap contains the same data as the `d` attribute of the\n.connection <path>. The advantage of using .connection-wrap is to be able to catch pointer events\nin the neighborhood of the .connection <path>. This is especially handy if the .connection <path> is \nvery thin.\n\n*/\n\n.connection-wrap {\n   fill: none;\n   stroke: black;\n   stroke-width: 15;\n   stroke-linecap: round;\n   stroke-linejoin: round;\n   opacity: 0;\n   cursor: move;\n}\n.connection-wrap:hover {\n   opacity: .4;\n   stroke-opacity: .4;\n}\n\n\n.connection {\n   /* stroke: black; */\n   /* stroke width cannot be overriden by attribute? */\n   /*   stroke-width: 1; */\n   fill: none;\n   stroke-linejoin: round;\n}\n\n.marker-source, .marker-target {\n/* Cannot be in CSS otherwise it could not be overruled by attributes.\n   fill: black;\n   stroke: black;\n*/\n   /* This makes the arrowheads point to the border of objects even though the transform: scale() is applied on them. */\n   vector-effect: non-scaling-stroke;\n}\n\n/* \n\nVertex markers are `<circle>` elements that appear at connection vertex positions.\n\n*/\n\n/* <g> element wrapping .marker-vertex-group. */\n.marker-vertices {\n   opacity: 0;\n   cursor: move;\n}\n.marker-arrowheads {\n   opacity: 0;\n   cursor: move;\n   cursor: -webkit-grab;\n   cursor: -moz-grab;\n/*   display: none;   */   /* setting `display: none` on .marker-arrowheads effectivelly switches of links reconnecting */\n}\n.link-tools {\n   opacity: 0;\n   cursor: pointer;\n}\n.link-tools .tool-options {\n   display: none;       /* by default, we don't display link options tool */\n}\n.link-tools .tool-remove circle {\n   fill: red;\n}\n.link-tools .tool-remove path {\n   fill: white;\n}\n.link:hover .marker-vertices,\n.link:hover .marker-arrowheads,\n.link:hover .link-tools {\n   opacity: 1;\n}\n\n/* <circle> element inside .marker-vertex-group <g> element */\n.marker-vertex {\n   fill: #1ABC9C;\n}\n.marker-vertex:hover {\n   fill: #34495E;\n   stroke: none;\n}\n\n.marker-arrowhead {\n   fill: #1ABC9C;\n}\n.marker-arrowhead:hover {\n   fill: #F39C12;\n   stroke: none;\n}\n\n/* <circle> element used to remove a vertex */\n.marker-vertex-remove {\n   cursor: pointer;\n   opacity: .1;\n   fill: white;\n}\n\n.marker-vertex-group:hover .marker-vertex-remove {\n   opacity: 1;\n}\n\n.marker-vertex-remove-area {\n   opacity: .1;\n   cursor: pointer;\n}\n.marker-vertex-group:hover .marker-vertex-remove-area {\n   opacity: 1;\n}\n\n/*\n\n/* Cell highlighting - e.g a cell underneath the dragged link get highlighted.\n   See joint.dia.cell.js highlight(); */\n\n/* For some reason, CSS `outline` property does not work on `<text>` elements. */\ntext.highlighted {\n    fill: #FF0000;\n}\n\n.highlighted {\n    outline: 2px solid #FF0000; /* `outline` doesn't work in Firefox, Opera and IE9+ correctly. */\n    opacity: 0.7 \\9; /* It targets only IE9. */\n}\n\n/*\nuse '@-moz-document url-prefix()' to target all versions if Firefox and nothing else.\nSee `https://developer.mozilla.org/en-US/docs/Web/CSS/@document`.\n*/\n@-moz-document url-prefix() {\n    .highlighted { opacity: 0.7; } /* only for FF */\n}\n\n/*\n`-o-prefocus` is a pseudo-class that allows styles to be targeted for Opera only.\nSee `http://www.opera.com/docs/specs/presto2.12/css/o-vendor/`.\n*/\ndoesnotexist:-o-prefocus, .highlighted {\n    opacity: 0.7;\n}\n\n/*\n\nExample of custom changes (in pure CSS only!):\n\nDo not show marker vertices at all:  .marker-vertices { display: none; }\nDo not allow adding new vertices: .connection-wrap { pointer-events: none; }\n\n*/\n\n/* foreignObject in joint.shapes.basic.TextBlock */\n.TextBlock .fobj body {\n    background-color: transparent;\n    margin: 0px;\n}\n.TextBlock .fobj div {\n    text-align: center;\n    vertical-align: middle;\n    display: table-cell;\n    padding: 0px 5px 0px 5px;\n}"
  },
  {
    "path": "Dialogger/lib/joint.js",
    "content": "/*! JointJS v0.8.1 - JavaScript diagramming library  2014-02-24 \n\n\nThis Source Code Form is subject to the terms of the Mozilla Public\nLicense, v. 2.0. If a copy of the MPL was not distributed with this\nfile, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n/*!\n * jQuery JavaScript Library v2.0.3\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2013-07-03T13:30Z\n */\n(function( window, undefined ) {\n\n// Can't do this because several apps including ASP.NET trace\n// the stack via arguments.caller.callee and Firefox dies if\n// you try to trace through \"use strict\" call chains. (#13335)\n// Support: Firefox 18+\n//\"use strict\";\nvar\n\t// A central reference to the root jQuery(document)\n\trootjQuery,\n\n\t// The deferred used on DOM ready\n\treadyList,\n\n\t// Support: IE9\n\t// For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`\n\tcore_strundefined = typeof undefined,\n\n\t// Use the correct document accordingly with window argument (sandbox)\n\tlocation = window.location,\n\tdocument = window.document,\n\tdocElem = document.documentElement,\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$,\n\n\t// [[Class]] -> type pairs\n\tclass2type = {},\n\n\t// List of deleted data cache ids, so we can reuse them\n\tcore_deletedIds = [],\n\n\tcore_version = \"2.0.3\",\n\n\t// Save a reference to some core methods\n\tcore_concat = core_deletedIds.concat,\n\tcore_push = core_deletedIds.push,\n\tcore_slice = core_deletedIds.slice,\n\tcore_indexOf = core_deletedIds.indexOf,\n\tcore_toString = class2type.toString,\n\tcore_hasOwn = class2type.hasOwnProperty,\n\tcore_trim = core_version.trim,\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\treturn new jQuery.fn.init( selector, context, rootjQuery );\n\t},\n\n\t// Used for matching numbers\n\tcore_pnum = /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,\n\n\t// Used for splitting on whitespace\n\tcore_rnotwhite = /\\S+/g,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,\n\n\t// Match a standalone tag\n\trsingleTag = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,\n\n\t// Matches dashed string for camelizing\n\trmsPrefix = /^-ms-/,\n\trdashAlpha = /-([\\da-z])/gi,\n\n\t// Used by jQuery.camelCase as callback to replace()\n\tfcamelCase = function( all, letter ) {\n\t\treturn letter.toUpperCase();\n\t},\n\n\t// The ready event handler and self cleanup method\n\tcompleted = function() {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed, false );\n\t\twindow.removeEventListener( \"load\", completed, false );\n\t\tjQuery.ready();\n\t};\n\njQuery.fn = jQuery.prototype = {\n\t// The current version of jQuery being used\n\tjquery: core_version,\n\n\tconstructor: jQuery,\n\tinit: function( selector, context, rootjQuery ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector.charAt(0) === \"<\" && selector.charAt( selector.length - 1 ) === \">\" && selector.length >= 3 ) {\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && (match[1] || !context) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[1] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[0] : context;\n\n\t\t\t\t\t// scripts is true for back-compat\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[1],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( jQuery.isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[2] );\n\n\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t\tthis[0] = elem;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.context = document;\n\t\t\t\t\tthis.selector = selector;\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || rootjQuery ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis.context = this[0] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( jQuery.isFunction( selector ) ) {\n\t\t\treturn rootjQuery.ready( selector );\n\t\t}\n\n\t\tif ( selector.selector !== undefined ) {\n\t\t\tthis.selector = selector.selector;\n\t\t\tthis.context = selector.context;\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t},\n\n\t// Start with an empty selector\n\tselector: \"\",\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn core_slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\t\treturn num == null ?\n\n\t\t\t// Return a 'clean' array\n\t\t\tthis.toArray() :\n\n\t\t\t// Return just the object\n\t\t\t( num < 0 ? this[ this.length + num ] : this[ num ] );\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\t\tret.context = this.context;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\t// (You can seed the arguments with an array of args, but this is\n\t// only used internally.)\n\teach: function( callback, args ) {\n\t\treturn jQuery.each( this, callback, args );\n\t},\n\n\tready: function( fn ) {\n\t\t// Add the callback\n\t\tjQuery.ready.promise().done( fn );\n\n\t\treturn this;\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( core_slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map(this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t}));\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor(null);\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: core_push,\n\tsort: [].sort,\n\tsplice: [].splice\n};\n\n// Give the init function the jQuery prototype for later instantiation\njQuery.fn.init.prototype = jQuery.fn;\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[0] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend({\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( core_version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\tnoConflict: function( deep ) {\n\t\tif ( window.$ === jQuery ) {\n\t\t\twindow.$ = _$;\n\t\t}\n\n\t\tif ( deep && window.jQuery === jQuery ) {\n\t\t\twindow.jQuery = _jQuery;\n\t\t}\n\n\t\treturn jQuery;\n\t},\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Hold (or release) the ready event\n\tholdReady: function( hold ) {\n\t\tif ( hold ) {\n\t\t\tjQuery.readyWait++;\n\t\t} else {\n\t\t\tjQuery.ready( true );\n\t\t}\n\t},\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\n\t\t// Trigger any bound ready events\n\t\tif ( jQuery.fn.trigger ) {\n\t\t\tjQuery( document ).trigger(\"ready\").off(\"ready\");\n\t\t}\n\t},\n\n\t// See test/unit/core.js for details concerning isFunction.\n\t// Since version 1.3, DOM methods and functions like alert\n\t// aren't supported. They return false on IE (#2968).\n\tisFunction: function( obj ) {\n\t\treturn jQuery.type(obj) === \"function\";\n\t},\n\n\tisArray: Array.isArray,\n\n\tisWindow: function( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t},\n\n\tisNumeric: function( obj ) {\n\t\treturn !isNaN( parseFloat(obj) ) && isFinite( obj );\n\t},\n\n\ttype: function( obj ) {\n\t\tif ( obj == null ) {\n\t\t\treturn String( obj );\n\t\t}\n\t\t// Support: Safari <= 5.1 (functionish RegExp)\n\t\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\t\tclass2type[ core_toString.call(obj) ] || \"object\" :\n\t\t\ttypeof obj;\n\t},\n\n\tisPlainObject: function( obj ) {\n\t\t// Not plain objects:\n\t\t// - Any object or value whose internal [[Class]] property is not \"[object Object]\"\n\t\t// - DOM nodes\n\t\t// - window\n\t\tif ( jQuery.type( obj ) !== \"object\" || obj.nodeType || jQuery.isWindow( obj ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Support: Firefox <20\n\t\t// The try/catch suppresses exceptions thrown when attempting to access\n\t\t// the \"constructor\" property of certain host objects, ie. |window.location|\n\t\t// https://bugzilla.mozilla.org/show_bug.cgi?id=814622\n\t\ttry {\n\t\t\tif ( obj.constructor &&\n\t\t\t\t\t!core_hasOwn.call( obj.constructor.prototype, \"isPrototypeOf\" ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the function hasn't returned already, we're confident that\n\t\t// |obj| is a plain object, created by {} or constructed with new Object\n\t\treturn true;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\t// data: string of html\n\t// context (optional): If specified, the fragment will be created in this context, defaults to document\n\t// keepScripts (optional): If true, will include scripts passed in the html string\n\tparseHTML: function( data, context, keepScripts ) {\n\t\tif ( !data || typeof data !== \"string\" ) {\n\t\t\treturn null;\n\t\t}\n\t\tif ( typeof context === \"boolean\" ) {\n\t\t\tkeepScripts = context;\n\t\t\tcontext = false;\n\t\t}\n\t\tcontext = context || document;\n\n\t\tvar parsed = rsingleTag.exec( data ),\n\t\t\tscripts = !keepScripts && [];\n\n\t\t// Single tag\n\t\tif ( parsed ) {\n\t\t\treturn [ context.createElement( parsed[1] ) ];\n\t\t}\n\n\t\tparsed = jQuery.buildFragment( [ data ], context, scripts );\n\n\t\tif ( scripts ) {\n\t\t\tjQuery( scripts ).remove();\n\t\t}\n\n\t\treturn jQuery.merge( [], parsed.childNodes );\n\t},\n\n\tparseJSON: JSON.parse,\n\n\t// Cross-browser xml parsing\n\tparseXML: function( data ) {\n\t\tvar xml, tmp;\n\t\tif ( !data || typeof data !== \"string\" ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Support: IE9\n\t\ttry {\n\t\t\ttmp = new DOMParser();\n\t\t\txml = tmp.parseFromString( data , \"text/xml\" );\n\t\t} catch ( e ) {\n\t\t\txml = undefined;\n\t\t}\n\n\t\tif ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\t\tjQuery.error( \"Invalid XML: \" + data );\n\t\t}\n\t\treturn xml;\n\t},\n\n\tnoop: function() {},\n\n\t// Evaluates a script in a global context\n\tglobalEval: function( code ) {\n\t\tvar script,\n\t\t\t\tindirect = eval;\n\n\t\tcode = jQuery.trim( code );\n\n\t\tif ( code ) {\n\t\t\t// If the code includes a valid, prologue position\n\t\t\t// strict mode pragma, execute code by injecting a\n\t\t\t// script tag into the document.\n\t\t\tif ( code.indexOf(\"use strict\") === 1 ) {\n\t\t\t\tscript = document.createElement(\"script\");\n\t\t\t\tscript.text = code;\n\t\t\t\tdocument.head.appendChild( script ).parentNode.removeChild( script );\n\t\t\t} else {\n\t\t\t// Otherwise, avoid the DOM node creation, insertion\n\t\t\t// and removal by using an indirect global eval\n\t\t\t\tindirect( code );\n\t\t\t}\n\t\t}\n\t},\n\n\t// Convert dashed to camelCase; used by the css and data modules\n\t// Microsoft forgot to hump their vendor prefix (#9572)\n\tcamelCase: function( string ) {\n\t\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n\t},\n\n\tnodeName: function( elem, name ) {\n\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\t},\n\n\t// args is for internal usage only\n\teach: function( obj, callback, args ) {\n\t\tvar value,\n\t\t\ti = 0,\n\t\t\tlength = obj.length,\n\t\t\tisArray = isArraylike( obj );\n\n\t\tif ( args ) {\n\t\t\tif ( isArray ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tvalue = callback.apply( obj[ i ], args );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i in obj ) {\n\t\t\t\t\tvalue = callback.apply( obj[ i ], args );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t\t} else {\n\t\t\tif ( isArray ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i in obj ) {\n\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\ttrim: function( text ) {\n\t\treturn text == null ? \"\" : core_trim.call( text );\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArraylike( Object(arr) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcore_push.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : core_indexOf.call( arr, elem, i );\n\t},\n\n\tmerge: function( first, second ) {\n\t\tvar l = second.length,\n\t\t\ti = first.length,\n\t\t\tj = 0;\n\n\t\tif ( typeof l === \"number\" ) {\n\t\t\tfor ( ; j < l; j++ ) {\n\t\t\t\tfirst[ i++ ] = second[ j ];\n\t\t\t}\n\t\t} else {\n\t\t\twhile ( second[j] !== undefined ) {\n\t\t\t\tfirst[ i++ ] = second[ j++ ];\n\t\t\t}\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, inv ) {\n\t\tvar retVal,\n\t\t\tret = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length;\n\t\tinv = !!inv;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tretVal = !!callback( elems[ i ], i );\n\t\t\tif ( inv !== retVal ) {\n\t\t\t\tret.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar value,\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tisArray = isArraylike( elems ),\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their\n\t\tif ( isArray ) {\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret[ ret.length ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret[ ret.length ] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn core_concat.apply( [], ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// Bind a function to a context, optionally partially applying any\n\t// arguments.\n\tproxy: function( fn, context ) {\n\t\tvar tmp, args, proxy;\n\n\t\tif ( typeof context === \"string\" ) {\n\t\t\ttmp = fn[ context ];\n\t\t\tcontext = fn;\n\t\t\tfn = tmp;\n\t\t}\n\n\t\t// Quick check to determine if target is callable, in the spec\n\t\t// this throws a TypeError, but we will just return undefined.\n\t\tif ( !jQuery.isFunction( fn ) ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Simulated bind\n\t\targs = core_slice.call( arguments, 2 );\n\t\tproxy = function() {\n\t\t\treturn fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );\n\t\t};\n\n\t\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\t\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\t\treturn proxy;\n\t},\n\n\t// Multifunctional method to get and set values of a collection\n\t// The value/s can optionally be executed if it's a function\n\taccess: function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\t\tvar i = 0,\n\t\t\tlength = elems.length,\n\t\t\tbulk = key == null;\n\n\t\t// Sets many values\n\t\tif ( jQuery.type( key ) === \"object\" ) {\n\t\t\tchainable = true;\n\t\t\tfor ( i in key ) {\n\t\t\t\tjQuery.access( elems, fn, i, key[i], true, emptyGet, raw );\n\t\t\t}\n\n\t\t// Sets one value\n\t\t} else if ( value !== undefined ) {\n\t\t\tchainable = true;\n\n\t\t\tif ( !jQuery.isFunction( value ) ) {\n\t\t\t\traw = true;\n\t\t\t}\n\n\t\t\tif ( bulk ) {\n\t\t\t\t// Bulk operations run against the entire set\n\t\t\t\tif ( raw ) {\n\t\t\t\t\tfn.call( elems, value );\n\t\t\t\t\tfn = null;\n\n\t\t\t\t// ...except when executing function values\n\t\t\t\t} else {\n\t\t\t\t\tbulk = fn;\n\t\t\t\t\tfn = function( elem, key, value ) {\n\t\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( fn ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tfn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn chainable ?\n\t\t\telems :\n\n\t\t\t// Gets\n\t\t\tbulk ?\n\t\t\t\tfn.call( elems ) :\n\t\t\t\tlength ? fn( elems[0], key ) : emptyGet;\n\t},\n\n\tnow: Date.now,\n\n\t// A method for quickly swapping in/out CSS properties to get correct calculations.\n\t// Note: this method belongs to the css module but it's needed here for the support module.\n\t// If support gets modularized, this method should be moved back to the css module.\n\tswap: function( elem, options, callback, args ) {\n\t\tvar ret, name,\n\t\t\told = {};\n\n\t\t// Remember the old values, and insert the new ones\n\t\tfor ( name in options ) {\n\t\t\told[ name ] = elem.style[ name ];\n\t\t\telem.style[ name ] = options[ name ];\n\t\t}\n\n\t\tret = callback.apply( elem, args || [] );\n\n\t\t// Revert the old values\n\t\tfor ( name in options ) {\n\t\t\telem.style[ name ] = old[ name ];\n\t\t}\n\n\t\treturn ret;\n\t}\n});\n\njQuery.ready.promise = function( obj ) {\n\tif ( !readyList ) {\n\n\t\treadyList = jQuery.Deferred();\n\n\t\t// Catch cases where $(document).ready() is called after the browser event has already occurred.\n\t\t// we once tried to use readyState \"interactive\" here, but it caused issues like the one\n\t\t// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15\n\t\tif ( document.readyState === \"complete\" ) {\n\t\t\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\t\t\tsetTimeout( jQuery.ready );\n\n\t\t} else {\n\n\t\t\t// Use the handy event callback\n\t\t\tdocument.addEventListener( \"DOMContentLoaded\", completed, false );\n\n\t\t\t// A fallback to window.onload, that will always work\n\t\t\twindow.addEventListener( \"load\", completed, false );\n\t\t}\n\t}\n\treturn readyList.promise( obj );\n};\n\n// Populate the class2type map\njQuery.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\nfunction isArraylike( obj ) {\n\tvar length = obj.length,\n\t\ttype = jQuery.type( obj );\n\n\tif ( jQuery.isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\tif ( obj.nodeType === 1 && length ) {\n\t\treturn true;\n\t}\n\n\treturn type === \"array\" || type !== \"function\" &&\n\t\t( length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj );\n}\n\n// All jQuery objects should point back to these\nrootjQuery = jQuery(document);\n/*!\n * Sizzle CSS Selector Engine v1.9.4-pre\n * http://sizzlejs.com/\n *\n * Copyright 2013 jQuery Foundation, Inc. and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2013-06-03\n */\n(function( window, undefined ) {\n\nvar i,\n\tsupport,\n\tcachedruns,\n\tExpr,\n\tgetText,\n\tisXML,\n\tcompile,\n\toutermostContext,\n\tsortInput,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + -(new Date()),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\thasDuplicate = false,\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// General-purpose constants\n\tstrundefined = typeof undefined,\n\tMAX_NEGATIVE = 1 << 31,\n\n\t// Instance methods\n\thasOwn = ({}).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpush_native = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\t// Use a stripped-down indexOf if we can't use a native one\n\tindexOf = arr.indexOf || function( elem ) {\n\t\tvar i = 0,\n\t\t\tlen = this.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( this[i] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\t// http://www.w3.org/TR/css3-syntax/#characters\n\tcharacterEncoding = \"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",\n\n\t// Loosely modeled on CSS identifier characters\n\t// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors\n\t// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n\tidentifier = characterEncoding.replace( \"w\", \"w#\" ),\n\n\t// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + characterEncoding + \")\" + whitespace +\n\t\t\"*(?:([*^$|!~]?=)\" + whitespace + \"*(?:(['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|(\" + identifier + \")|)|)\" + whitespace + \"*\\\\]\",\n\n\t// Prefer arguments quoted,\n\t//   then not containing pseudos/brackets,\n\t//   then attribute selectors/non-parenthetical expressions,\n\t//   then anything else\n\t// These preferences are here to reduce the number of selectors\n\t//   needing tokenize in the PSEUDO preFilter\n\tpseudos = \":(\" + characterEncoding + \")(?:\\\\(((['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes.replace( 3, 8 ) + \")*)|.*)\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\" ),\n\n\trsibling = new RegExp( whitespace + \"*[+~]\" ),\n\trattributeQuotes = new RegExp( \"=\" + whitespace + \"*([^\\\\]'\\\"]*)\" + whitespace + \"*\\\\]\", \"g\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + characterEncoding + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + characterEncoding + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + characterEncoding.replace( \"w\", \"w*\" ) + \")\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n\t\t\t\"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n\t\t\t\"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n\t\t\twhitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trescape = /'|\\\\/g,\n\n\t// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\([\\\\da-f]{1,6}\" + whitespace + \"?|(\" + whitespace + \")|.)\", \"ig\" ),\n\tfunescape = function( _, escaped, escapedWhitespace ) {\n\t\tvar high = \"0x\" + escaped - 0x10000;\n\t\t// NaN means non-codepoint\n\t\t// Support: Firefox\n\t\t// Workaround erroneous numeric interpretation of +\"0x\"\n\t\treturn high !== high || escapedWhitespace ?\n\t\t\tescaped :\n\t\t\t// BMP codepoint\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t};\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t(arr = slice.call( preferredDoc.childNodes )),\n\t\tpreferredDoc.childNodes\n\t);\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpush_native.apply( target, slice.call(els) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( (target[j++] = els[i++]) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar match, elem, m, nodeType,\n\t\t// QSA vars\n\t\ti, groups, old, nid, newContext, newSelector;\n\n\tif ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\n\tcontext = context || document;\n\tresults = results || [];\n\n\tif ( !selector || typeof selector !== \"string\" ) {\n\t\treturn results;\n\t}\n\n\tif ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {\n\t\treturn [];\n\t}\n\n\tif ( documentIsHTML && !seed ) {\n\n\t\t// Shortcuts\n\t\tif ( (match = rquickExpr.exec( selector )) ) {\n\t\t\t// Speed-up: Sizzle(\"#ID\")\n\t\t\tif ( (m = match[1]) ) {\n\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\telem = context.getElementById( m );\n\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Handle the case where IE, Opera, and Webkit return items\n\t\t\t\t\t\t// by name instead of ID\n\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Context is not a document\n\t\t\t\t\tif ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\n\t\t\t\t\t\tcontains( context, elem ) && elem.id === m ) {\n\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Speed-up: Sizzle(\"TAG\")\n\t\t\t} else if ( match[2] ) {\n\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\treturn results;\n\n\t\t\t// Speed-up: Sizzle(\".CLASS\")\n\t\t\t} else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {\n\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\treturn results;\n\t\t\t}\n\t\t}\n\n\t\t// QSA path\n\t\tif ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\n\t\t\tnid = old = expando;\n\t\t\tnewContext = context;\n\t\t\tnewSelector = nodeType === 9 && selector;\n\n\t\t\t// qSA works strangely on Element-rooted queries\n\t\t\t// We can work around this by specifying an extra ID on the root\n\t\t\t// and working up from there (Thanks to Andrew Dupont for the technique)\n\t\t\t// IE 8 doesn't work on object elements\n\t\t\tif ( nodeType === 1 && context.nodeName.toLowerCase() !== \"object\" ) {\n\t\t\t\tgroups = tokenize( selector );\n\n\t\t\t\tif ( (old = context.getAttribute(\"id\")) ) {\n\t\t\t\t\tnid = old.replace( rescape, \"\\\\$&\" );\n\t\t\t\t} else {\n\t\t\t\t\tcontext.setAttribute( \"id\", nid );\n\t\t\t\t}\n\t\t\t\tnid = \"[id='\" + nid + \"'] \";\n\n\t\t\t\ti = groups.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tgroups[i] = nid + toSelector( groups[i] );\n\t\t\t\t}\n\t\t\t\tnewContext = rsibling.test( selector ) && context.parentNode || context;\n\t\t\t\tnewSelector = groups.join(\",\");\n\t\t\t}\n\n\t\t\tif ( newSelector ) {\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch(qsaError) {\n\t\t\t\t} finally {\n\t\t\t\t\tif ( !old ) {\n\t\t\t\t\t\tcontext.removeAttribute(\"id\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {Function(string, Object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key += \" \" ) > Expr.cacheLength ) {\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn (cache[ key ] = value);\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created div and expects a boolean result\n */\nfunction assert( fn ) {\n\tvar div = document.createElement(\"div\");\n\n\ttry {\n\t\treturn !!fn( div );\n\t} catch (e) {\n\t\treturn false;\n\t} finally {\n\t\t// Remove from its parent by default\n\t\tif ( div.parentNode ) {\n\t\t\tdiv.parentNode.removeChild( div );\n\t\t}\n\t\t// release memory in IE\n\t\tdiv = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split(\"|\"),\n\t\ti = attrs.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[i] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\t( ~b.sourceIndex || MAX_NEGATIVE ) -\n\t\t\t( ~a.sourceIndex || MAX_NEGATIVE );\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( (cur = cur.nextSibling) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect xml\n * @param {Element|Object} elem An element or a document\n */\nisXML = Sizzle.isXML = function( elem ) {\n\t// documentElement is verified for cases where it doesn't yet exist\n\t// (such as loading iframes in IE - #4833)\n\tvar documentElement = elem && (elem.ownerDocument || elem).documentElement;\n\treturn documentElement ? documentElement.nodeName !== \"HTML\" : false;\n};\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar doc = node ? node.ownerDocument || node : preferredDoc,\n\t\tparent = doc.defaultView;\n\n\t// If no document and documentElement is available, return\n\tif ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Set our document\n\tdocument = doc;\n\tdocElem = doc.documentElement;\n\n\t// Support tests\n\tdocumentIsHTML = !isXML( doc );\n\n\t// Support: IE>8\n\t// If iframe document is assigned to \"document\" variable and if iframe has been reloaded,\n\t// IE will throw \"permission denied\" error when accessing \"document\" variable, see jQuery #13936\n\t// IE6-8 do not support the defaultView property so parent will be undefined\n\tif ( parent && parent.attachEvent && parent !== parent.top ) {\n\t\tparent.attachEvent( \"onbeforeunload\", function() {\n\t\t\tsetDocument();\n\t\t});\n\t}\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)\n\tsupport.attributes = assert(function( div ) {\n\t\tdiv.className = \"i\";\n\t\treturn !div.getAttribute(\"className\");\n\t});\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert(function( div ) {\n\t\tdiv.appendChild( doc.createComment(\"\") );\n\t\treturn !div.getElementsByTagName(\"*\").length;\n\t});\n\n\t// Check if getElementsByClassName can be trusted\n\tsupport.getElementsByClassName = assert(function( div ) {\n\t\tdiv.innerHTML = \"<div class='a'></div><div class='a i'></div>\";\n\n\t\t// Support: Safari<4\n\t\t// Catch class over-caching\n\t\tdiv.firstChild.className = \"i\";\n\t\t// Support: Opera<10\n\t\t// Catch gEBCN failure to find non-leading classes\n\t\treturn div.getElementsByClassName(\"i\").length === 2;\n\t});\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert(function( div ) {\n\t\tdocElem.appendChild( div ).id = expando;\n\t\treturn !doc.getElementsByName || !doc.getElementsByName( expando ).length;\n\t});\n\n\t// ID find and filter\n\tif ( support.getById ) {\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== strundefined && documentIsHTML ) {\n\t\t\t\tvar m = context.getElementById( id );\n\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\treturn m && m.parentNode ? [m] : [];\n\t\t\t}\n\t\t};\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"id\") === attrId;\n\t\t\t};\n\t\t};\n\t} else {\n\t\t// Support: IE6/7\n\t\t// getElementById is not reliable as a find shortcut\n\t\tdelete Expr.find[\"ID\"];\n\n\t\tExpr.filter[\"ID\"] =  function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode(\"id\");\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[\"TAG\"] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== strundefined ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\t\t\t}\n\t\t} :\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( (elem = results[i++]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[\"CLASS\"] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See http://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert(function( div ) {\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// http://bugs.jquery.com/ticket/12359\n\t\t\tdiv.innerHTML = \"<select><option selected=''></option></select>\";\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !div.querySelectorAll(\"[selected]\").length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":checked\").length ) {\n\t\t\t\trbuggyQSA.push(\":checked\");\n\t\t\t}\n\t\t});\n\n\t\tassert(function( div ) {\n\n\t\t\t// Support: Opera 10-12/IE8\n\t\t\t// ^= $= *= and empty values\n\t\t\t// Should not select anything\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type attribute is restricted during .innerHTML assignment\n\t\t\tvar input = doc.createElement(\"input\");\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tdiv.appendChild( input ).setAttribute( \"t\", \"\" );\n\n\t\t\tif ( div.querySelectorAll(\"[t^='']\").length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":enabled\").length ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tdiv.querySelectorAll(\"*,:x\");\n\t\t\trbuggyQSA.push(\",.*:\");\n\t\t});\n\t}\n\n\tif ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector) )) ) {\n\n\t\tassert(function( div ) {\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( div, \"div\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( div, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t});\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join(\"|\") );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join(\"|\") );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\n\t// Element contains another\n\t// Purposefully does not implement inclusive descendent\n\t// As in, an element does not contain itself\n\tcontains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t));\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( (b = b.parentNode) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = docElem.compareDocumentPosition ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );\n\n\t\tif ( compare ) {\n\t\t\t// Disconnected nodes\n\t\t\tif ( compare & 1 ||\n\t\t\t\t(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {\n\n\t\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t\tif ( a === doc || contains(preferredDoc, a) ) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif ( b === doc || contains(preferredDoc, b) ) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\t// Maintain original order\n\t\t\t\treturn sortInput ?\n\t\t\t\t\t( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :\n\t\t\t\t\t0;\n\t\t\t}\n\n\t\t\treturn compare & 4 ? -1 : 1;\n\t\t}\n\n\t\t// Not directly comparable, sort on existence of method\n\t\treturn a.compareDocumentPosition ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\t} else if ( !aup || !bup ) {\n\t\t\treturn a === doc ? -1 :\n\t\t\t\tb === doc ? 1 :\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[i] === bp[i] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[i], bp[i] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\tap[i] === preferredDoc ? -1 :\n\t\t\tbp[i] === preferredDoc ? 1 :\n\t\t\t0;\n\t};\n\n\treturn doc;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\t// Make sure that attribute selectors are quoted\n\texpr = expr.replace( rattributeQuotes, \"='$1']\" );\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch(e) {}\n\t}\n\n\treturn Sizzle( expr, document, null, [elem] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\t// Set document vars if needed\n\tif ( ( context.ownerDocument || context ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val === undefined ?\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t(val = elem.getAttributeNode(name)) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull :\n\t\tval;\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( (elem = results[i++]) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\t\t// If no nodeType, this is expected to be an array\n\t\tfor ( ; (node = elem[i]); i++ ) {\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (see #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[1] = match[1].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[3] = ( match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[2] === \"~=\" ) {\n\t\t\t\tmatch[3] = \" \" + match[3] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[1] = match[1].toLowerCase();\n\n\t\t\tif ( match[1].slice( 0, 3 ) === \"nth\" ) {\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[3] ) {\n\t\t\t\t\tSizzle.error( match[0] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n\t\t\t\tmatch[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[3] ) {\n\t\t\t\tSizzle.error( match[0] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[5] && match[2];\n\n\t\t\tif ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[3] && match[4] !== undefined ) {\n\t\t\t\tmatch[2] = match[4];\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t(excess = tokenize( unquoted, true )) &&\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t(excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[0] = match[0].slice( 0, excess );\n\t\t\t\tmatch[2] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() { return true; } :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t(pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test( typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute(\"class\") || \"\" );\n\t\t\t\t});\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tvar cache, outerCache, node, diff, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( (node = node[ dir ]) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\t\t\t\t\t\t\touterCache = parent[ expando ] || (parent[ expando ] = {});\n\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[0] === dirruns && cache[1];\n\t\t\t\t\t\t\tdiff = cache[0] === dirruns && cache[2];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {\n\t\t\t\t\t\t\tdiff = cache[1];\n\n\t\t\t\t\t\t// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\tif ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {\n\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction(function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf.call( seed, matched[i] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[i] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction(function( selector ) {\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction(function( seed, matches, context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = unmatched[i]) ) {\n\t\t\t\t\t\t\tseed[i] = !(matches[i] = elem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}) :\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tinput[0] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t}),\n\n\t\t\"has\": markFunction(function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t}),\n\n\t\t\"contains\": markFunction(function( text ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t}),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test(lang || \"\") ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( (elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": function( elem ) {\n\t\t\treturn elem.disabled === false;\n\t\t},\n\n\t\t\"disabled\": function( elem ) {\n\t\t\treturn elem.disabled === true;\n\t\t},\n\n\t\t\"checked\": function( elem ) {\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),\n\t\t\t//   not comment, processing instructions, or others\n\t\t\t// Thanks to Diego Perini for the nodeName shortcut\n\t\t\t//   Greater than \"@\" means alpha characters (specifically not starting with \"#\" or \"?\")\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeName > \"@\" || elem.nodeType === 3 || elem.nodeType === 4 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[\"empty\"]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\t// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\n\t\t\t// use getAttribute instead to test this case\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\t\t\t\t( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === elem.type );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo(function() {\n\t\t\treturn [ 0 ];\n\t\t}),\n\n\t\t\"last\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t}),\n\n\t\t\"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t}),\n\n\t\t\"even\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t})\n\t}\n};\n\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\nfunction tokenize( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || (match = rcomma.exec( soFar )) ) {\n\t\t\tif ( match ) {\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[0].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( tokens = [] );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( (match = rcombinators.exec( soFar )) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push({\n\t\t\t\tvalue: matched,\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[0].replace( rtrim, \" \" )\n\t\t\t});\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n\t\t\t\t(match = preFilters[ type ]( match ))) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push({\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t});\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n}\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[i].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tcheckNonElements = base && dir === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar data, cache, outerCache,\n\t\t\t\tdirkey = dirruns + \" \" + doneName;\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || (elem[ expando ] = {});\n\t\t\t\t\t\tif ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {\n\t\t\t\t\t\t\tif ( (data = cache[1]) === true || data === cachedruns ) {\n\t\t\t\t\t\t\t\treturn data === true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcache = outerCache[ dir ] = [ dirkey ];\n\t\t\t\t\t\t\tcache[1] = matcher( elem, context, xml ) || cachedruns;\n\t\t\t\t\t\t\tif ( cache[1] === true ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[i]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[0];\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (elem = unmatched[i]) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction(function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( (elem = temp[i]) ) {\n\t\t\t\t\tmatcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = matcherOut[i]) ) {\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( (matcherIn[i] = elem) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, (matcherOut = []), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( (elem = matcherOut[i]) &&\n\t\t\t\t\t\t(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {\n\n\t\t\t\t\t\tseed[temp] = !(results[temp] = elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[0].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[\" \"],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf.call( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\treturn ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t(checkContext = context).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n\t\t\tmatchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[j].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\t\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\t\ttokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" })\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\t// A counter to specify which element is currently being matched\n\tvar matcherCachedRuns = 0,\n\t\tbySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, expandContext ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tsetMatched = [],\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\toutermost = expandContext != null,\n\t\t\t\tcontextBackup = outermostContext,\n\t\t\t\t// We must always have either seed elements or context\n\t\t\t\telems = seed || byElement && Expr.find[\"TAG\"]( \"*\", expandContext && context.parentNode || context ),\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);\n\n\t\t\tif ( outermost ) {\n\t\t\t\toutermostContext = context !== document && context;\n\t\t\t\tcachedruns = matcherCachedRuns;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Keep `i` a string if there are no elements so `matchedCount` will be \"00\" below\n\t\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (matcher = elementMatchers[j++]) ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t\tcachedruns = ++matcherCachedRuns;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( (elem = !matcher && elem) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\tmatchedCount += i;\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (matcher = setMatchers[j++]) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !(unmatched[i] || setMatched[i]) ) {\n\t\t\t\t\t\t\t\tsetMatched[i] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !group ) {\n\t\t\tgroup = tokenize( selector );\n\t\t}\n\t\ti = group.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( group[i] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\t}\n\treturn cached;\n};\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[i], results );\n\t}\n\treturn results;\n}\n\nfunction select( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tmatch = tokenize( selector );\n\n\tif ( !seed ) {\n\t\t// Try to minimize operations if there is only one group\n\t\tif ( match.length === 1 ) {\n\n\t\t\t// Take a shortcut and set the context if the root selector is an ID\n\t\t\ttokens = match[0] = match[0].slice( 0 );\n\t\t\tif ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n\t\t\t\t\tsupport.getById && context.nodeType === 9 && documentIsHTML &&\n\t\t\t\t\tExpr.relative[ tokens[1].type ] ) {\n\n\t\t\t\tcontext = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n\t\t\t\tif ( !context ) {\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t\t}\n\n\t\t\t// Fetch a seed set for right-to-left matching\n\t\t\ti = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\ttoken = tokens[i];\n\n\t\t\t\t// Abort if we hit a combinator\n\t\t\t\tif ( Expr.relative[ (type = token.type) ] ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( (find = Expr.find[ type ]) ) {\n\t\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\t\tif ( (seed = find(\n\t\t\t\t\t\ttoken.matches[0].replace( runescape, funescape ),\n\t\t\t\t\t\trsibling.test( tokens[0].type ) && context.parentNode || context\n\t\t\t\t\t)) ) {\n\n\t\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\tcompile( selector, match )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\trsibling.test( selector )\n\t);\n\treturn results;\n}\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split(\"\").sort( sortOrder ).join(\"\") === expando;\n\n// Support: Chrome<14\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert(function( div1 ) {\n\t// Should return 1, but returns 4 (following)\n\treturn div1.compareDocumentPosition( document.createElement(\"div\") ) & 1;\n});\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert(function( div ) {\n\tdiv.innerHTML = \"<a href='#'></a>\";\n\treturn div.firstChild.getAttribute(\"href\") === \"#\" ;\n}) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert(function( div ) {\n\tdiv.innerHTML = \"<input/>\";\n\tdiv.firstChild.setAttribute( \"value\", \"\" );\n\treturn div.firstChild.getAttribute( \"value\" ) === \"\";\n}) ) {\n\taddHandle( \"value\", function( elem, name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert(function( div ) {\n\treturn div.getAttribute(\"disabled\") == null;\n}) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn (val = elem.getAttributeNode( name )) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\telem[ name ] === true ? name.toLowerCase() : null;\n\t\t}\n\t});\n}\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\njQuery.expr[\":\"] = jQuery.expr.pseudos;\njQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\n\n\n})( window );\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\tfiringLength = 0;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = jQuery.isFunction( fns[ i ] ) && fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ](function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ]\n\t\t\tdeferred[ tuple[0] ] = function() {\n\t\t\t\tdeferred[ tuple[0] + \"With\" ]( this === deferred ? promise : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\njQuery.support = (function( support ) {\n\tvar input = document.createElement(\"input\"),\n\t\tfragment = document.createDocumentFragment(),\n\t\tdiv = document.createElement(\"div\"),\n\t\tselect = document.createElement(\"select\"),\n\t\topt = select.appendChild( document.createElement(\"option\") );\n\n\t// Finish early in limited environments\n\tif ( !input.type ) {\n\t\treturn support;\n\t}\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3\n\t// Check the default checkbox/radio value (\"\" on old WebKit; \"on\" elsewhere)\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Must access the parent to make an option select properly\n\t// Support: IE9, IE10\n\tsupport.optSelected = opt.selected;\n\n\t// Will be defined later\n\tsupport.reliableMarginRight = true;\n\tsupport.boxSizingReliable = true;\n\tsupport.pixelPosition = false;\n\n\t// Make sure checked status is properly cloned\n\t// Support: IE9, IE10\n\tinput.checked = true;\n\tsupport.noCloneChecked = input.cloneNode( true ).checked;\n\n\t// Make sure that the options inside disabled selects aren't marked as disabled\n\t// (WebKit marks them as disabled)\n\tselect.disabled = true;\n\tsupport.optDisabled = !opt.disabled;\n\n\t// Check if an input maintains its value after becoming a radio\n\t// Support: IE9, IE10\n\tinput = document.createElement(\"input\");\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n\n\t// #11217 - WebKit loses check when the name is after the checked attribute\n\tinput.setAttribute( \"checked\", \"t\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tfragment.appendChild( input );\n\n\t// Support: Safari 5.1, Android 4.x, Android 2.3\n\t// old WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: Firefox, Chrome, Safari\n\t// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)\n\tsupport.focusinBubbles = \"onfocusin\" in window;\n\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\t// Run tests that need a body at doc ready\n\tjQuery(function() {\n\t\tvar container, marginDiv,\n\t\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\t\tdivReset = \"padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box\",\n\t\t\tbody = document.getElementsByTagName(\"body\")[ 0 ];\n\n\t\tif ( !body ) {\n\t\t\t// Return for frameset docs that don't have a body\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer = document.createElement(\"div\");\n\t\tcontainer.style.cssText = \"border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px\";\n\n\t\t// Check box-sizing and margin behavior.\n\t\tbody.appendChild( container ).appendChild( div );\n\t\tdiv.innerHTML = \"\";\n\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\tdiv.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%\";\n\n\t\t// Workaround failing boxSizing test due to offsetWidth returning wrong value\n\t\t// with some non-1 values of body zoom, ticket #13543\n\t\tjQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {\n\t\t\tsupport.boxSizing = div.offsetWidth === 4;\n\t\t});\n\n\t\t// Use window.getComputedStyle because jsdom on node.js will break without it.\n\t\tif ( window.getComputedStyle ) {\n\t\t\tsupport.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== \"1%\";\n\t\t\tsupport.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: \"4px\" } ).width === \"4px\";\n\n\t\t\t// Support: Android 2.3\n\t\t\t// Check if div with explicit width and no margin-right incorrectly\n\t\t\t// gets computed margin-right based on width of container. (#3333)\n\t\t\t// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right\n\t\t\tmarginDiv = div.appendChild( document.createElement(\"div\") );\n\t\t\tmarginDiv.style.cssText = div.style.cssText = divReset;\n\t\t\tmarginDiv.style.marginRight = marginDiv.style.width = \"0\";\n\t\t\tdiv.style.width = \"1px\";\n\n\t\t\tsupport.reliableMarginRight =\n\t\t\t\t!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );\n\t\t}\n\n\t\tbody.removeChild( container );\n\t});\n\n\treturn support;\n})( {} );\n\n/*\n\tImplementation Summary\n\n\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n\t2. Improve the module's maintainability by reducing the storage\n\t\tpaths to a single mechanism.\n\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n*/\nvar data_user, data_priv,\n\trbrace = /(?:\\{[\\s\\S]*\\}|\\[[\\s\\S]*\\])$/,\n\trmultiDash = /([A-Z])/g;\n\nfunction Data() {\n\t// Support: Android < 4,\n\t// Old WebKit does not have Object.preventExtensions/freeze method,\n\t// return new empty object instead with no [[set]] accessor\n\tObject.defineProperty( this.cache = {}, 0, {\n\t\tget: function() {\n\t\t\treturn {};\n\t\t}\n\t});\n\n\tthis.expando = jQuery.expando + Math.random();\n}\n\nData.uid = 1;\n\nData.accepts = function( owner ) {\n\t// Accepts only:\n\t//  - Node\n\t//    - Node.ELEMENT_NODE\n\t//    - Node.DOCUMENT_NODE\n\t//  - Object\n\t//    - Any\n\treturn owner.nodeType ?\n\t\towner.nodeType === 1 || owner.nodeType === 9 : true;\n};\n\nData.prototype = {\n\tkey: function( owner ) {\n\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t// but we should not, see #8335.\n\t\t// Always return the key for a frozen object.\n\t\tif ( !Data.accepts( owner ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar descriptor = {},\n\t\t\t// Check if the owner object already has a cache key\n\t\t\tunlock = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !unlock ) {\n\t\t\tunlock = Data.uid++;\n\n\t\t\t// Secure it in a non-enumerable, non-writable property\n\t\t\ttry {\n\t\t\t\tdescriptor[ this.expando ] = { value: unlock };\n\t\t\t\tObject.defineProperties( owner, descriptor );\n\n\t\t\t// Support: Android < 4\n\t\t\t// Fallback to a less secure definition\n\t\t\t} catch ( e ) {\n\t\t\t\tdescriptor[ this.expando ] = unlock;\n\t\t\t\tjQuery.extend( owner, descriptor );\n\t\t\t}\n\t\t}\n\n\t\t// Ensure the cache object\n\t\tif ( !this.cache[ unlock ] ) {\n\t\t\tthis.cache[ unlock ] = {};\n\t\t}\n\n\t\treturn unlock;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\t// There may be an unlock assigned to this node,\n\t\t\t// if there is no entry for this \"owner\", create one inline\n\t\t\t// and set the unlock as though an owner entry had always existed\n\t\t\tunlock = this.key( owner ),\n\t\t\tcache = this.cache[ unlock ];\n\n\t\t// Handle: [ owner, key, value ] args\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ data ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\t\t\t// Fresh assignments by object are shallow copied\n\t\t\tif ( jQuery.isEmptyObject( cache ) ) {\n\t\t\t\tjQuery.extend( this.cache[ unlock ], data );\n\t\t\t// Otherwise, copy the properties one-by-one to the cache object\n\t\t\t} else {\n\t\t\t\tfor ( prop in data ) {\n\t\t\t\t\tcache[ prop ] = data[ prop ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\t// Either a valid cache is found, or will be created.\n\t\t// New caches will be created and the unlock returned,\n\t\t// allowing direct access to the newly created\n\t\t// empty data object. A valid owner object must be provided.\n\t\tvar cache = this.cache[ this.key( owner ) ];\n\n\t\treturn key === undefined ?\n\t\t\tcache : cache[ key ];\n\t},\n\taccess: function( owner, key, value ) {\n\t\tvar stored;\n\t\t// In cases where either:\n\t\t//\n\t\t//   1. No key was specified\n\t\t//   2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t//   1. The entire cache object\n\t\t//   2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t((key && typeof key === \"string\") && value === undefined) ) {\n\n\t\t\tstored = this.get( owner, key );\n\n\t\t\treturn stored !== undefined ?\n\t\t\t\tstored : this.get( owner, jQuery.camelCase(key) );\n\t\t}\n\n\t\t// [*]When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t//   1. An object of properties\n\t\t//   2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i, name, camel,\n\t\t\tunlock = this.key( owner ),\n\t\t\tcache = this.cache[ unlock ];\n\n\t\tif ( key === undefined ) {\n\t\t\tthis.cache[ unlock ] = {};\n\n\t\t} else {\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( jQuery.isArray( key ) ) {\n\t\t\t\t// If \"name\" is an array of keys...\n\t\t\t\t// When data is initially created, via (\"key\", \"val\") signature,\n\t\t\t\t// keys will be converted to camelCase.\n\t\t\t\t// Since there is no way to tell _how_ a key was added, remove\n\t\t\t\t// both plain key and camelCase key. #12786\n\t\t\t\t// This will only penalize the array argument path.\n\t\t\t\tname = key.concat( key.map( jQuery.camelCase ) );\n\t\t\t} else {\n\t\t\t\tcamel = jQuery.camelCase( key );\n\t\t\t\t// Try the string as a key before any manipulation\n\t\t\t\tif ( key in cache ) {\n\t\t\t\t\tname = [ key, camel ];\n\t\t\t\t} else {\n\t\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\t\tname = camel;\n\t\t\t\t\tname = name in cache ?\n\t\t\t\t\t\t[ name ] : ( name.match( core_rnotwhite ) || [] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ti = name.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ name[ i ] ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\treturn !jQuery.isEmptyObject(\n\t\t\tthis.cache[ owner[ this.expando ] ] || {}\n\t\t);\n\t},\n\tdiscard: function( owner ) {\n\t\tif ( owner[ this.expando ] ) {\n\t\t\tdelete this.cache[ owner[ this.expando ] ];\n\t\t}\n\t}\n};\n\n// These may be used throughout the jQuery core codebase\ndata_user = new Data();\ndata_priv = new Data();\n\n\njQuery.extend({\n\tacceptData: Data.accepts,\n\n\thasData: function( elem ) {\n\t\treturn data_user.hasData( elem ) || data_priv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn data_user.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdata_user.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to data_priv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn data_priv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdata_priv.remove( elem, name );\n\t}\n});\n\njQuery.fn.extend({\n\tdata: function( key, value ) {\n\t\tvar attrs, name,\n\t\t\telem = this[ 0 ],\n\t\t\ti = 0,\n\t\t\tdata = null;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = data_user.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !data_priv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\tattrs = elem.attributes;\n\t\t\t\t\tfor ( ; i < attrs.length; i++ ) {\n\t\t\t\t\t\tname = attrs[ i ].name;\n\n\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\tname = jQuery.camelCase( name.slice(5) );\n\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdata_priv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each(function() {\n\t\t\t\tdata_user.set( this, key );\n\t\t\t});\n\t\t}\n\n\t\treturn jQuery.access( this, function( value ) {\n\t\t\tvar data,\n\t\t\t\tcamelKey = jQuery.camelCase( key );\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// with the key as-is\n\t\t\t\tdata = data_user.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// with the key camelized\n\t\t\t\tdata = data_user.get( elem, camelKey );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, camelKey, undefined );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each(function() {\n\t\t\t\t// First, attempt to store a copy or reference of any\n\t\t\t\t// data that might've been store with a camelCased key.\n\t\t\t\tvar data = data_user.get( this, camelKey );\n\n\t\t\t\t// For HTML5 data-* attribute interop, we have to\n\t\t\t\t// store property names with dashes in a camelCase form.\n\t\t\t\t// This might not apply to all properties...*\n\t\t\t\tdata_user.set( this, camelKey, value );\n\n\t\t\t\t// *... In the case of properties that might _actually_\n\t\t\t\t// have dashes, we need to also store a copy of that\n\t\t\t\t// unchanged property.\n\t\t\t\tif ( key.indexOf(\"-\") !== -1 && data !== undefined ) {\n\t\t\t\t\tdata_user.set( this, key, value );\n\t\t\t\t}\n\t\t\t});\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each(function() {\n\t\t\tdata_user.remove( this, key );\n\t\t});\n\t}\n});\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$1\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = data === \"true\" ? true :\n\t\t\t\t\tdata === \"false\" ? false :\n\t\t\t\t\tdata === \"null\" ? null :\n\t\t\t\t\t// Only convert to a number if it doesn't change the string\n\t\t\t\t\t+data + \"\" === data ? +data :\n\t\t\t\t\trbrace.test( data ) ? JSON.parse( data ) :\n\t\t\t\t\tdata;\n\t\t\t} catch( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdata_user.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\njQuery.extend({\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = data_priv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || jQuery.isArray( data ) ) {\n\t\t\t\t\tqueue = data_priv.access( elem, type, jQuery.makeArray(data) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// not intended for public consumption - generates a queueHooks object, or returns the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn data_priv.get( elem, key ) || data_priv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks(\"once memory\").add(function() {\n\t\t\t\tdata_priv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t})\n\t\t});\n\t}\n});\n\njQuery.fn.extend({\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[0], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each(function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[0] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t});\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t});\n\t},\n\t// Based off of the plugin by Clint Helfers, with permission.\n\t// http://blindsignals.com/index.php/2009/07/jquery-delay/\n\tdelay: function( time, type ) {\n\t\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\t\ttype = type || \"fx\";\n\n\t\treturn this.queue( type, function( next, hooks ) {\n\t\t\tvar timeout = setTimeout( next, time );\n\t\t\thooks.stop = function() {\n\t\t\t\tclearTimeout( timeout );\n\t\t\t};\n\t\t});\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile( i-- ) {\n\t\t\ttmp = data_priv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n});\nvar nodeHook, boolHook,\n\trclass = /[\\t\\r\\n\\f]/g,\n\trreturn = /\\r/g,\n\trfocusable = /^(?:input|select|textarea|button)$/i;\n\njQuery.fn.extend({\n\tattr: function( name, value ) {\n\t\treturn jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t});\n\t},\n\n\tprop: function( name, value ) {\n\t\treturn jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each(function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t});\n\t},\n\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, clazz, j,\n\t\t\ti = 0,\n\t\t\tlen = this.length,\n\t\t\tproceed = typeof value === \"string\" && value;\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, this.className ) );\n\t\t\t});\n\t\t}\n\n\t\tif ( proceed ) {\n\t\t\t// The disjunction here is for better compressibility (see removeClass)\n\t\t\tclasses = ( value || \"\" ).match( core_rnotwhite ) || [];\n\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\telem = this[ i ];\n\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?\n\t\t\t\t\t( \" \" + elem.className + \" \" ).replace( rclass, \" \" ) :\n\t\t\t\t\t\" \"\n\t\t\t\t);\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (clazz = classes[j++]) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telem.className = jQuery.trim( cur );\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, clazz, j,\n\t\t\ti = 0,\n\t\t\tlen = this.length,\n\t\t\tproceed = arguments.length === 0 || typeof value === \"string\" && value;\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, this.className ) );\n\t\t\t});\n\t\t}\n\t\tif ( proceed ) {\n\t\t\tclasses = ( value || \"\" ).match( core_rnotwhite ) || [];\n\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\telem = this[ i ];\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?\n\t\t\t\t\t( \" \" + elem.className + \" \" ).replace( rclass, \" \" ) :\n\t\t\t\t\t\"\"\n\t\t\t\t);\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (clazz = classes[j++]) ) {\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) >= 0 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telem.className = value ? jQuery.trim( cur ) : \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value;\n\n\t\tif ( typeof stateVal === \"boolean\" && type === \"string\" ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );\n\t\t\t});\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tif ( type === \"string\" ) {\n\t\t\t\t// toggle individual class names\n\t\t\t\tvar className,\n\t\t\t\t\ti = 0,\n\t\t\t\t\tself = jQuery( this ),\n\t\t\t\t\tclassNames = value.match( core_rnotwhite ) || [];\n\n\t\t\t\twhile ( (className = classNames[ i++ ]) ) {\n\t\t\t\t\t// check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( type === core_strundefined || type === \"boolean\" ) {\n\t\t\t\tif ( this.className ) {\n\t\t\t\t\t// store className if set\n\t\t\t\t\tdata_priv.set( this, \"__className__\", this.className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed \"false\",\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tthis.className = this.className || value === false ? \"\" : data_priv.get( this, \"__className__\" ) || \"\";\n\t\t\t}\n\t\t});\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className = \" \" + selector + \" \",\n\t\t\ti = 0,\n\t\t\tl = this.length;\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tif ( this[i].nodeType === 1 && (\" \" + this[i].className + \" \").replace(rclass, \" \").indexOf( className ) >= 0 ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t},\n\n\tval: function( value ) {\n\t\tvar hooks, ret, isFunction,\n\t\t\telem = this[0];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks && \"get\" in hooks && (ret = hooks.get( elem, \"value\" )) !== undefined ) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\treturn typeof ret === \"string\" ?\n\t\t\t\t\t// handle most common string cases\n\t\t\t\t\tret.replace(rreturn, \"\") :\n\t\t\t\t\t// handle cases where value is null/undef or number\n\t\t\t\t\tret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tisFunction = jQuery.isFunction( value );\n\n\t\treturn this.each(function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\t\t\t} else if ( jQuery.isArray( val ) ) {\n\t\t\t\tval = jQuery.map(val, function ( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t});\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !(\"set\" in hooks) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t});\n\t}\n});\n\njQuery.extend({\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\t\t\t\t// attributes.value is undefined in Blackberry 4.7 but\n\t\t\t\t// uses .value. See #6932\n\t\t\t\tvar val = elem.attributes.value;\n\t\t\t\treturn !val || val.specified ? elem.value : elem.text;\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\" || index < 0,\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length,\n\t\t\t\t\ti = index < 0 ?\n\t\t\t\t\t\tmax :\n\t\t\t\t\t\tone ? index : 0;\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// IE6-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t( jQuery.support.optDisabled ? !option.disabled : option.getAttribute(\"disabled\") === null ) &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\t\t\t\t\tif ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t},\n\n\tattr: function( elem, name, value ) {\n\t\tvar hooks, ret,\n\t\t\tnType = elem.nodeType;\n\n\t\t// don't get/set attributes on text, comment and attribute nodes\n\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === core_strundefined ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// All attributes are lowercase\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\tname = name.toLowerCase();\n\t\t\thooks = jQuery.attrHooks[ name ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\n\t\t\t} else if ( hooks && \"set\" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {\n\t\t\t\treturn ret;\n\n\t\t\t} else {\n\t\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t} else if ( hooks && \"get\" in hooks && (ret = hooks.get( elem, name )) !== null ) {\n\t\t\treturn ret;\n\n\t\t} else {\n\t\t\tret = jQuery.find.attr( elem, name );\n\n\t\t\t// Non-existent attributes return null, we normalize to undefined\n\t\t\treturn ret == null ?\n\t\t\t\tundefined :\n\t\t\t\tret;\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name, propName,\n\t\t\ti = 0,\n\t\t\tattrNames = value && value.match( core_rnotwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( (name = attrNames[i++]) ) {\n\t\t\t\tpropName = jQuery.propFix[ name ] || name;\n\n\t\t\t\t// Boolean attributes get special treatment (#10870)\n\t\t\t\tif ( jQuery.expr.match.bool.test( name ) ) {\n\t\t\t\t\t// Set corresponding property to false\n\t\t\t\t\telem[ propName ] = false;\n\t\t\t\t}\n\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !jQuery.support.radioValue && value === \"radio\" && jQuery.nodeName(elem, \"input\") ) {\n\t\t\t\t\t// Setting the type on a radio button after the value resets the value in IE6-9\n\t\t\t\t\t// Reset value to default in case type is set after value during creation\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t},\n\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks, notxml,\n\t\t\tnType = elem.nodeType;\n\n\t\t// don't get/set properties on text, comment and attribute nodes\n\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnotxml = nType !== 1 || !jQuery.isXMLDoc( elem );\n\n\t\tif ( notxml ) {\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\treturn hooks && \"set\" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?\n\t\t\t\tret :\n\t\t\t\t( elem[ name ] = value );\n\n\t\t} else {\n\t\t\treturn hooks && \"get\" in hooks && (ret = hooks.get( elem, name )) !== null ?\n\t\t\t\tret :\n\t\t\t\telem[ name ];\n\t\t}\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\t\t\t\treturn elem.hasAttribute( \"tabindex\" ) || rfocusable.test( elem.nodeName ) || elem.href ?\n\t\t\t\t\telem.tabIndex :\n\t\t\t\t\t-1;\n\t\t\t}\n\t\t}\n\t}\n});\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( i, name ) {\n\tvar getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;\n\n\tjQuery.expr.attrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar fn = jQuery.expr.attrHandle[ name ],\n\t\t\tret = isXML ?\n\t\t\t\tundefined :\n\t\t\t\t/* jshint eqeqeq: false */\n\t\t\t\t// Temporarily disable this handler to check existence\n\t\t\t\t(jQuery.expr.attrHandle[ name ] = undefined) !=\n\t\t\t\t\tgetter( elem, name, isXML ) ?\n\n\t\t\t\t\tname.toLowerCase() :\n\t\t\t\t\tnull;\n\n\t\t// Restore handler\n\t\tjQuery.expr.attrHandle[ name ] = fn;\n\n\t\treturn ret;\n\t};\n});\n\n// Support: IE9+\n// Selectedness for an option in an optgroup can be inaccurate\nif ( !jQuery.support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t};\n}\n\njQuery.each([\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n});\n\n// Radios and checkboxes getter/setter\njQuery.each([ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( jQuery.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !jQuery.support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\t// Support: Webkit\n\t\t\t// \"\" is returned instead of \"on\" if a value isn't specified\n\t\t\treturn elem.getAttribute(\"value\") === null ? \"on\" : elem.value;\n\t\t};\n\t}\n});\nvar rkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|contextmenu)|click/,\n\trfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)$/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = data_priv.get( elem );\n\n\t\t// Don't attach events to noData or text/comment nodes (but allow plain objects)\n\t\tif ( !elemData ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !(events = elemData.events) ) {\n\t\t\tevents = elemData.events = {};\n\t\t}\n\t\tif ( !(eventHandle = elemData.handle) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?\n\t\t\t\t\tjQuery.event.dispatch.apply( eventHandle.elem, arguments ) :\n\t\t\t\t\tundefined;\n\t\t\t};\n\t\t\t// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events\n\t\t\teventHandle.elem = elem;\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( core_rnotwhite ) || [\"\"];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[t] ) || [];\n\t\t\ttype = origType = tmp[1];\n\t\t\tnamespaces = ( tmp[2] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend({\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join(\".\")\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !(handlers = events[ type ]) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle, false );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t\t// Nullify elem to prevent memory leaks in IE\n\t\telem = null;\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = data_priv.hasData( elem ) && data_priv.get( elem );\n\n\t\tif ( !elemData || !(events = elemData.events) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( core_rnotwhite ) || [\"\"];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[t] ) || [];\n\t\t\ttype = origType = tmp[1];\n\t\t\tnamespaces = ( tmp[2] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[2] && new RegExp( \"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector || selector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdelete elemData.handle;\n\t\t\tdata_priv.remove( elem, \"events\" );\n\t\t}\n\t},\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = core_hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = core_hasOwn.call( event, \"namespace\" ) ? event.namespace.split(\".\") : [];\n\n\t\tcur = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf(\".\") >= 0 ) {\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split(\".\");\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf(\":\") < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join(\".\");\n\t\tevent.namespace_re = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === (elem.ownerDocument || document) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {\n\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( data_priv.get( cur, \"events\" ) || {} )[ event.type ] && data_priv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&\n\t\t\t\tjQuery.acceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\t\t\t\t\telem[ type ]();\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\tdispatch: function( event ) {\n\n\t\t// Make a writable jQuery.Event from the native event object\n\t\tevent = jQuery.event.fix( event );\n\n\t\tvar i, j, ret, matched, handleObj,\n\t\t\thandlerQueue = [],\n\t\t\targs = core_slice.call( arguments ),\n\t\t\thandlers = ( data_priv.get( this, \"events\" ) || {} )[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[0] = event;\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// Triggered event must either 1) have no namespace, or\n\t\t\t\t// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).\n\t\t\t\tif ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )\n\t\t\t\t\t\t\t.apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( (event.result = ret) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, matches, sel, handleObj,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\t// Black-hole SVG <use> instance trees (#13180)\n\t\t// Avoid non-left-click bubbling in Firefox (#3861)\n\t\tif ( delegateCount && cur.nodeType && (!event.button || event.type !== \"click\") ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.disabled !== true || event.type !== \"click\" ) {\n\t\t\t\t\tmatches = [];\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matches[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatches[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) >= 0 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matches[ sel ] ) {\n\t\t\t\t\t\t\tmatches.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matches.length ) {\n\t\t\t\t\t\thandlerQueue.push({ elem: cur, handlers: matches });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\t// Includes some event props shared by KeyEvent and MouseEvent\n\tprops: \"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"),\n\n\tfixHooks: {},\n\n\tkeyHooks: {\n\t\tprops: \"char charCode key keyCode\".split(\" \"),\n\t\tfilter: function( event, original ) {\n\n\t\t\t// Add which for key events\n\t\t\tif ( event.which == null ) {\n\t\t\t\tevent.which = original.charCode != null ? original.charCode : original.keyCode;\n\t\t\t}\n\n\t\t\treturn event;\n\t\t}\n\t},\n\n\tmouseHooks: {\n\t\tprops: \"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"),\n\t\tfilter: function( event, original ) {\n\t\t\tvar eventDoc, doc, body,\n\t\t\t\tbutton = original.button;\n\n\t\t\t// Calculate pageX/Y if missing and clientX/Y available\n\t\t\tif ( event.pageX == null && original.clientX != null ) {\n\t\t\t\teventDoc = event.target.ownerDocument || document;\n\t\t\t\tdoc = eventDoc.documentElement;\n\t\t\t\tbody = eventDoc.body;\n\n\t\t\t\tevent.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );\n\t\t\t\tevent.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );\n\t\t\t}\n\n\t\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\t\t// Note: button is not normalized, so don't use it\n\t\t\tif ( !event.which && button !== undefined ) {\n\t\t\t\tevent.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );\n\t\t\t}\n\n\t\t\treturn event;\n\t\t}\n\t},\n\n\tfix: function( event ) {\n\t\tif ( event[ jQuery.expando ] ) {\n\t\t\treturn event;\n\t\t}\n\n\t\t// Create a writable copy of the event object and normalize some properties\n\t\tvar i, prop, copy,\n\t\t\ttype = event.type,\n\t\t\toriginalEvent = event,\n\t\t\tfixHook = this.fixHooks[ type ];\n\n\t\tif ( !fixHook ) {\n\t\t\tthis.fixHooks[ type ] = fixHook =\n\t\t\t\trmouseEvent.test( type ) ? this.mouseHooks :\n\t\t\t\trkeyEvent.test( type ) ? this.keyHooks :\n\t\t\t\t{};\n\t\t}\n\t\tcopy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;\n\n\t\tevent = new jQuery.Event( originalEvent );\n\n\t\ti = copy.length;\n\t\twhile ( i-- ) {\n\t\t\tprop = copy[ i ];\n\t\t\tevent[ prop ] = originalEvent[ prop ];\n\t\t}\n\n\t\t// Support: Cordova 2.5 (WebKit) (#13255)\n\t\t// All events should have a target; Cordova deviceready doesn't\n\t\tif ( !event.target ) {\n\t\t\tevent.target = document;\n\t\t}\n\n\t\t// Support: Safari 6.0+, Chrome < 28\n\t\t// Target should not be a text node (#504, #13143)\n\t\tif ( event.target.nodeType === 3 ) {\n\t\t\tevent.target = event.target.parentNode;\n\t\t}\n\n\t\treturn fixHook.filter? fixHook.filter( event, originalEvent ) : event;\n\t},\n\n\tspecial: {\n\t\tload: {\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tfocus: {\n\t\t\t// Fire native event if possible so blur/focus sequence is correct\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this !== safeActiveElement() && this.focus ) {\n\t\t\t\t\tthis.focus();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusin\"\n\t\t},\n\t\tblur: {\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this === safeActiveElement() && this.blur ) {\n\t\t\t\t\tthis.blur();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusout\"\n\t\t},\n\t\tclick: {\n\t\t\t// For checkbox, fire native event so checked state will be right\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this.type === \"checkbox\" && this.click && jQuery.nodeName( this, \"input\" ) ) {\n\t\t\t\t\tthis.click();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, don't fire native .click() on links\n\t\t\t_default: function( event ) {\n\t\t\t\treturn jQuery.nodeName( event.target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tsimulate: function( type, elem, event, bubble ) {\n\t\t// Piggyback on a donor event to simulate a different one.\n\t\t// Fake originalEvent to avoid donor's stopPropagation, but if the\n\t\t// simulated event prevents default then we do the same on the donor.\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true,\n\t\t\t\toriginalEvent: {}\n\t\t\t}\n\t\t);\n\t\tif ( bubble ) {\n\t\t\tjQuery.event.trigger( e, null, elem );\n\t\t} else {\n\t\t\tjQuery.event.dispatch.call( elem, e );\n\t\t}\n\t\tif ( e.isDefaultPrevented() ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n};\n\njQuery.removeEvent = function( elem, type, handle ) {\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle, false );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\t// Allow instantiation without the 'new' keyword\n\tif ( !(this instanceof jQuery.Event) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = ( src.defaultPrevented ||\n\t\t\tsrc.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || jQuery.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && e.preventDefault ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && e.stopPropagation ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// Support: Chrome 15+\njQuery.each({\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mousenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || (related !== target && !jQuery.contains( target, related )) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n});\n\n// Create \"bubbling\" focus and blur events\n// Support: Firefox, Chrome, Safari\nif ( !jQuery.support.focusinBubbles ) {\n\tjQuery.each({ focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler while someone wants focusin/focusout\n\t\tvar attaches = 0,\n\t\t\thandler = function( event ) {\n\t\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );\n\t\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\t\t\t\tif ( attaches++ === 0 ) {\n\t\t\t\t\tdocument.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tif ( --attaches === 0 ) {\n\t\t\t\t\tdocument.removeEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n}\n\njQuery.fn.extend({\n\n\ton: function( types, selector, data, fn, /*INTERNAL*/ one ) {\n\t\tvar origFn, type;\n\n\t\t// Types can be a map of types/handlers\n\t\tif ( typeof types === \"object\" ) {\n\t\t\t// ( types-Object, selector, data )\n\t\t\tif ( typeof selector !== \"string\" ) {\n\t\t\t\t// ( types-Object, data )\n\t\t\t\tdata = data || selector;\n\t\t\t\tselector = undefined;\n\t\t\t}\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.on( type, selector, data, types[ type ], one );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tif ( data == null && fn == null ) {\n\t\t\t// ( types, fn )\n\t\t\tfn = selector;\n\t\t\tdata = selector = undefined;\n\t\t} else if ( fn == null ) {\n\t\t\tif ( typeof selector === \"string\" ) {\n\t\t\t\t// ( types, selector, fn )\n\t\t\t\tfn = data;\n\t\t\t\tdata = undefined;\n\t\t\t} else {\n\t\t\t\t// ( types, data, fn )\n\t\t\t\tfn = data;\n\t\t\t\tdata = selector;\n\t\t\t\tselector = undefined;\n\t\t\t}\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t} else if ( !fn ) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif ( one === 1 ) {\n\t\t\torigFn = fn;\n\t\t\tfn = function( event ) {\n\t\t\t\t// Can use an empty set, since event contains the info\n\t\t\t\tjQuery().off( event );\n\t\t\t\treturn origFn.apply( this, arguments );\n\t\t\t};\n\t\t\t// Use same guid so caller can remove using origFn\n\t\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.add( this, types, fn, data, selector );\n\t\t});\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn this.on( types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\t\t\t// ( event )  dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ? handleObj.origType + \".\" + handleObj.namespace : handleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each(function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t});\n\t},\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t});\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[0];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n});\nvar isSimple = /^.[^:#\\[\\.,]*$/,\n\trparentsprev = /^(?:parents|prev(?:Until|All))/,\n\trneedsContext = jQuery.expr.match.needsContext,\n\t// methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend({\n\tfind: function( selector ) {\n\t\tvar i,\n\t\t\tret = [],\n\t\t\tself = this,\n\t\t\tlen = self.length;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter(function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}) );\n\t\t}\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\t// Needed because $( selector, context ) becomes $( context ).find( selector )\n\t\tret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );\n\t\tret.selector = this.selector ? this.selector + \" \" + selector : selector;\n\t\treturn ret;\n\t},\n\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter(function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[i] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow(this, selector || [], true) );\n\t},\n\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow(this, selector || [], false) );\n\t},\n\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\tpos = ( rneedsContext.test( selectors ) || typeof selectors !== \"string\" ) ?\n\t\t\t\tjQuery( selectors, context || this.context ) :\n\t\t\t\t0;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tfor ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {\n\t\t\t\t// Always skip document fragments\n\t\t\t\tif ( cur.nodeType < 11 && (pos ?\n\t\t\t\t\tpos.index(cur) > -1 :\n\n\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\tjQuery.find.matchesSelector(cur, selectors)) ) {\n\n\t\t\t\t\tcur = matched.push( cur );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within\n\t// the matched set of elements\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn core_indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn core_indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\tvar set = typeof selector === \"string\" ?\n\t\t\t\tjQuery( selector, context ) :\n\t\t\t\tjQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),\n\t\t\tall = jQuery.merge( this.get(), set );\n\n\t\treturn this.pushStack( jQuery.unique(all) );\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter(selector)\n\t\t);\n\t}\n});\n\nfunction sibling( cur, dir ) {\n\twhile ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}\n\n\treturn cur;\n}\n\njQuery.each({\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn jQuery.dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn jQuery.dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn jQuery.dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn jQuery.sibling( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\treturn elem.contentDocument || jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.unique( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n});\n\njQuery.extend({\n\tfilter: function( expr, elems, not ) {\n\t\tvar elem = elems[ 0 ];\n\n\t\tif ( not ) {\n\t\t\texpr = \":not(\" + expr + \")\";\n\t\t}\n\n\t\treturn elems.length === 1 && elem.nodeType === 1 ?\n\t\t\tjQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :\n\t\t\tjQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\t\t\treturn elem.nodeType === 1;\n\t\t\t}));\n\t},\n\n\tdir: function( elem, dir, until ) {\n\t\tvar matched = [],\n\t\t\ttruncate = until !== undefined;\n\n\t\twhile ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tmatched.push( elem );\n\t\t\t}\n\t\t}\n\t\treturn matched;\n\t},\n\n\tsibling: function( n, elem ) {\n\t\tvar matched = [];\n\n\t\tfor ( ; n; n = n.nextSibling ) {\n\t\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\t\tmatched.push( n );\n\t\t\t}\n\t\t}\n\n\t\treturn matched;\n\t}\n});\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( jQuery.isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\t/* jshint -W018 */\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t});\n\n\t}\n\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t});\n\n\t}\n\n\tif ( typeof qualifier === \"string\" ) {\n\t\tif ( isSimple.test( qualifier ) ) {\n\t\t\treturn jQuery.filter( qualifier, elements, not );\n\t\t}\n\n\t\tqualifier = jQuery.filter( qualifier, elements );\n\t}\n\n\treturn jQuery.grep( elements, function( elem ) {\n\t\treturn ( core_indexOf.call( qualifier, elem ) >= 0 ) !== not;\n\t});\n}\nvar rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi,\n\trtagName = /<([\\w:]+)/,\n\trhtml = /<|&#?\\w+;/,\n\trnoInnerhtml = /<(?:script|style|link)/i,\n\tmanipulation_rcheckableType = /^(?:checkbox|radio)$/i,\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trscriptType = /^$|\\/(?:java|ecma)script/i,\n\trscriptTypeMasked = /^true\\/(.*)/,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g,\n\n\t// We have to close these tags to support XHTML (#13200)\n\twrapMap = {\n\n\t\t// Support: IE 9\n\t\toption: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n\n\t\tthead: [ 1, \"<table>\", \"</table>\" ],\n\t\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\t\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\t\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t\t_default: [ 0, \"\", \"\" ]\n\t};\n\n// Support: IE 9\nwrapMap.optgroup = wrapMap.option;\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\njQuery.fn.extend({\n\ttext: function( value ) {\n\t\treturn jQuery.access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().append( ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t});\n\t},\n\n\tprepend: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t});\n\t},\n\n\tbefore: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t});\n\t},\n\n\tafter: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t});\n\t},\n\n\t// keepData is for internal use only--do not document\n\tremove: function( selector, keepData ) {\n\t\tvar elem,\n\t\t\telems = selector ? jQuery.filter( selector, this ) : this,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\tif ( !keepData && elem.nodeType === 1 ) {\n\t\t\t\tjQuery.cleanData( getAll( elem ) );\n\t\t\t}\n\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\tif ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {\n\t\t\t\t\tsetGlobalEval( getAll( elem, \"script\" ) );\n\t\t\t\t}\n\t\t\t\telem.parentNode.removeChild( elem );\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = this[i]) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function () {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t});\n\t},\n\n\thtml: function( value ) {\n\t\treturn jQuery.access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = value.replace( rxhtmlTag, \"<$1></$2>\" );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar\n\t\t\t// Snapshot the DOM in case .domManip sweeps something relevant into its fragment\n\t\t\targs = jQuery.map( this, function( elem ) {\n\t\t\t\treturn [ elem.nextSibling, elem.parentNode ];\n\t\t\t}),\n\t\t\ti = 0;\n\n\t\t// Make the changes, replacing each context element with the new content\n\t\tthis.domManip( arguments, function( elem ) {\n\t\t\tvar next = args[ i++ ],\n\t\t\t\tparent = args[ i++ ];\n\n\t\t\tif ( parent ) {\n\t\t\t\t// Don't use the snapshot next if it has moved (#13810)\n\t\t\t\tif ( next && next.parentNode !== parent ) {\n\t\t\t\t\tnext = this.nextSibling;\n\t\t\t\t}\n\t\t\t\tjQuery( this ).remove();\n\t\t\t\tparent.insertBefore( elem, next );\n\t\t\t}\n\t\t// Allow new content to include elements from the context set\n\t\t}, true );\n\n\t\t// Force removal if there was no new content (e.g., from empty arguments)\n\t\treturn i ? this : this.remove();\n\t},\n\n\tdetach: function( selector ) {\n\t\treturn this.remove( selector, true );\n\t},\n\n\tdomManip: function( args, callback, allowIntersection ) {\n\n\t\t// Flatten any nested arrays\n\t\targs = core_concat.apply( [], args );\n\n\t\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tset = this,\n\t\t\tiNoClone = l - 1,\n\t\t\tvalue = args[ 0 ],\n\t\t\tisFunction = jQuery.isFunction( value );\n\n\t\t// We can't cloneNode fragments that contain checked, in WebKit\n\t\tif ( isFunction || !( l <= 1 || typeof value !== \"string\" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {\n\t\t\treturn this.each(function( index ) {\n\t\t\t\tvar self = set.eq( index );\n\t\t\t\tif ( isFunction ) {\n\t\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t\t}\n\t\t\t\tself.domManip( args, callback, allowIntersection );\n\t\t\t});\n\t\t}\n\n\t\tif ( l ) {\n\t\t\tfragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );\n\t\t\tfirst = fragment.firstChild;\n\n\t\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\t\tfragment = first;\n\t\t\t}\n\n\t\t\tif ( first ) {\n\t\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\t\thasScripts = scripts.length;\n\n\t\t\t\t// Use the original fragment for the last item instead of the first because it can end up\n\t\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\tnode = fragment;\n\n\t\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\t\tif ( hasScripts ) {\n\t\t\t\t\t\t\t// Support: QtWebKit\n\t\t\t\t\t\t\t// jQuery.merge because core_push.apply(_, arraylike) throws\n\t\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcallback.call( this[ i ], node, i );\n\t\t\t\t}\n\n\t\t\t\tif ( hasScripts ) {\n\t\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t\t// Reenable scripts\n\t\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t\t!data_priv.access( node, \"globalEval\" ) && jQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\t\tif ( node.src ) {\n\t\t\t\t\t\t\t\t// Hope ajax is available...\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.globalEval( node.textContent.replace( rcleanScript, \"\" ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n});\n\njQuery.each({\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: QtWebKit\n\t\t\t// .get() because core_push.apply(_, arraylike) throws\n\t\t\tcore_push.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n});\n\njQuery.extend({\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t// Support: IE >= 9\n\t\t// Fix Cloning issues\n\t\tif ( !jQuery.support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tbuildFragment: function( elems, context, scripts, selection ) {\n\t\tvar elem, tmp, tag, wrap, contains, j,\n\t\t\ti = 0,\n\t\t\tl = elems.length,\n\t\t\tfragment = context.createDocumentFragment(),\n\t\t\tnodes = [];\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\telem = elems[ i ];\n\n\t\t\tif ( elem || elem === 0 ) {\n\n\t\t\t\t// Add nodes directly\n\t\t\t\tif ( jQuery.type( elem ) === \"object\" ) {\n\t\t\t\t\t// Support: QtWebKit\n\t\t\t\t\t// jQuery.merge because core_push.apply(_, arraylike) throws\n\t\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t\t// Convert non-html into a text node\n\t\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t\t// Convert html into DOM nodes\n\t\t\t\t} else {\n\t\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement(\"div\") );\n\n\t\t\t\t\t// Deserialize a standard representation\n\t\t\t\t\ttag = ( rtagName.exec( elem ) || [\"\", \"\"] )[ 1 ].toLowerCase();\n\t\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\t\ttmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, \"<$1></$2>\" ) + wrap[ 2 ];\n\n\t\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\t\tj = wrap[ 0 ];\n\t\t\t\t\twhile ( j-- ) {\n\t\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: QtWebKit\n\t\t\t\t\t// jQuery.merge because core_push.apply(_, arraylike) throws\n\t\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t\t// Remember the top-level container\n\t\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t\t// Fixes #12346\n\t\t\t\t\t// Support: Webkit, IE\n\t\t\t\t\ttmp.textContent = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove wrapper from fragment\n\t\tfragment.textContent = \"\";\n\n\t\ti = 0;\n\t\twhile ( (elem = nodes[ i++ ]) ) {\n\n\t\t\t// #4087 - If origin and destination elements are the same, and this is\n\t\t\t// that element, do not do anything\n\t\t\tif ( selection && jQuery.inArray( elem, selection ) !== -1 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tcontains = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t\t// Append to fragment\n\t\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t\t// Preserve script evaluation history\n\t\t\tif ( contains ) {\n\t\t\t\tsetGlobalEval( tmp );\n\t\t\t}\n\n\t\t\t// Capture executables\n\t\t\tif ( scripts ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (elem = tmp[ j++ ]) ) {\n\t\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\t\tscripts.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn fragment;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, events, type, key, j,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = elems[ i ]) !== undefined; i++ ) {\n\t\t\tif ( Data.accepts( elem ) ) {\n\t\t\t\tkey = elem[ data_priv.expando ];\n\n\t\t\t\tif ( key && (data = data_priv.cache[ key ]) ) {\n\t\t\t\t\tevents = Object.keys( data.events || {} );\n\t\t\t\t\tif ( events.length ) {\n\t\t\t\t\t\tfor ( j = 0; (type = events[j]) !== undefined; j++ ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( data_priv.cache[ key ] ) {\n\t\t\t\t\t\t// Discard any remaining `private` data\n\t\t\t\t\t\tdelete data_priv.cache[ key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Discard any remaining `user` data\n\t\t\tdelete data_user.cache[ elem[ data_user.expando ] ];\n\t\t}\n\t},\n\n\t_evalUrl: function( url ) {\n\t\treturn jQuery.ajax({\n\t\t\turl: url,\n\t\t\ttype: \"GET\",\n\t\t\tdataType: \"script\",\n\t\t\tasync: false,\n\t\t\tglobal: false,\n\t\t\t\"throws\": true\n\t\t});\n\t}\n});\n\n// Support: 1.x compatibility\n// Manipulating tables requires a tbody\nfunction manipulationTarget( elem, content ) {\n\treturn jQuery.nodeName( elem, \"table\" ) &&\n\t\tjQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, \"tr\" ) ?\n\n\t\telem.getElementsByTagName(\"tbody\")[0] ||\n\t\t\telem.appendChild( elem.ownerDocument.createElement(\"tbody\") ) :\n\t\telem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = (elem.getAttribute(\"type\") !== null) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tvar match = rscriptTypeMasked.exec( elem.type );\n\n\tif ( match ) {\n\t\telem.type = match[ 1 ];\n\t} else {\n\t\telem.removeAttribute(\"type\");\n\t}\n\n\treturn elem;\n}\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar l = elems.length,\n\t\ti = 0;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdata_priv.set(\n\t\t\telems[ i ], \"globalEval\", !refElements || data_priv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( data_priv.hasData( src ) ) {\n\t\tpdataOld = data_priv.access( src );\n\t\tpdataCur = data_priv.set( dest, pdataOld );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdelete pdataCur.handle;\n\t\t\tpdataCur.events = {};\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( data_user.hasData( src ) ) {\n\t\tudataOld = data_user.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdata_user.set( dest, udataCur );\n\t}\n}\n\n\nfunction getAll( context, tag ) {\n\tvar ret = context.getElementsByTagName ? context.getElementsByTagName( tag || \"*\" ) :\n\t\t\tcontext.querySelectorAll ? context.querySelectorAll( tag || \"*\" ) :\n\t\t\t[];\n\n\treturn tag === undefined || tag && jQuery.nodeName( context, tag ) ?\n\t\tjQuery.merge( [ context ], ret ) :\n\t\tret;\n}\n\n// Support: IE >= 9\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && manipulation_rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\njQuery.fn.extend({\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( jQuery.isFunction( html ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).wrapAll( html.call(this, i) );\n\t\t\t});\n\t\t}\n\n\t\tif ( this[ 0 ] ) {\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map(function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t}).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( jQuery.isFunction( html ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call(this, i) );\n\t\t\t});\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t});\n\t},\n\n\twrap: function( html ) {\n\t\tvar isFunction = jQuery.isFunction( html );\n\n\t\treturn this.each(function( i ) {\n\t\t\tjQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );\n\t\t});\n\t},\n\n\tunwrap: function() {\n\t\treturn this.parent().each(function() {\n\t\t\tif ( !jQuery.nodeName( this, \"body\" ) ) {\n\t\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t\t}\n\t\t}).end();\n\t}\n});\nvar curCSS, iframe,\n\t// swappable if display is none or starts with table except \"table\", \"table-cell\", or \"table-caption\"\n\t// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trmargin = /^margin/,\n\trnumsplit = new RegExp( \"^(\" + core_pnum + \")(.*)$\", \"i\" ),\n\trnumnonpx = new RegExp( \"^(\" + core_pnum + \")(?!px)[a-z%]+$\", \"i\" ),\n\trrelNum = new RegExp( \"^([+-])=(\" + core_pnum + \")\", \"i\" ),\n\telemdisplay = { BODY: \"block\" },\n\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: 0,\n\t\tfontWeight: 400\n\t},\n\n\tcssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ],\n\tcssPrefixes = [ \"Webkit\", \"O\", \"Moz\", \"ms\" ];\n\n// return a css property mapped to a potentially vendor prefixed property\nfunction vendorPropName( style, name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in style ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt(0).toUpperCase() + name.slice(1),\n\t\torigName = name,\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in style ) {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\treturn origName;\n}\n\nfunction isHidden( elem, el ) {\n\t// isHidden might be called from jQuery#filter function;\n\t// in that case, element will be second argument\n\telem = el || elem;\n\treturn jQuery.css( elem, \"display\" ) === \"none\" || !jQuery.contains( elem.ownerDocument, elem );\n}\n\n// NOTE: we've included the \"window\" in window.getComputedStyle\n// because jsdom on node.js will break without it.\nfunction getStyles( elem ) {\n\treturn window.getComputedStyle( elem, null );\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem, hidden,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvalues[ index ] = data_priv.get( elem, \"olddisplay\" );\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\t\t\t// Reset the inline display of this element to learn if it is\n\t\t\t// being hidden by cascaded rules or not\n\t\t\tif ( !values[ index ] && display === \"none\" ) {\n\t\t\t\telem.style.display = \"\";\n\t\t\t}\n\n\t\t\t// Set elements which have been overridden with display: none\n\t\t\t// in a stylesheet to whatever the default browser style is\n\t\t\t// for such an element\n\t\t\tif ( elem.style.display === \"\" && isHidden( elem ) ) {\n\t\t\t\tvalues[ index ] = data_priv.access( elem, \"olddisplay\", css_defaultDisplay(elem.nodeName) );\n\t\t\t}\n\t\t} else {\n\n\t\t\tif ( !values[ index ] ) {\n\t\t\t\thidden = isHidden( elem );\n\n\t\t\t\tif ( display && display !== \"none\" || !hidden ) {\n\t\t\t\t\tdata_priv.set( elem, \"olddisplay\", hidden ? display : jQuery.css(elem, \"display\") );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of most of the elements in a second loop\n\t// to avoid the constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( !show || elem.style.display === \"none\" || elem.style.display === \"\" ) {\n\t\t\telem.style.display = show ? values[ index ] || \"\" : \"none\";\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend({\n\tcss: function( name, value ) {\n\t\treturn jQuery.access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( jQuery.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t},\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tif ( isHidden( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t});\n\t}\n});\n\njQuery.extend({\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"fontWeight\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {\n\t\t// normalize float css property\n\t\t\"float\": \"cssFloat\"\n\t},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = jQuery.camelCase( name ),\n\t\t\tstyle = elem.style;\n\n\t\tname = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );\n\n\t\t// gets hook for the prefixed version\n\t\t// followed by the unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// convert relative number strings (+= or -=) to relative numbers. #7345\n\t\t\tif ( type === \"string\" && (ret = rrelNum.exec( value )) ) {\n\t\t\t\tvalue = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that NaN and null values aren't set. See: #7116\n\t\t\tif ( value == null || type === \"number\" && isNaN( value ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add 'px' to the (except for certain CSS properties)\n\t\t\tif ( type === \"number\" && !jQuery.cssNumber[ origName ] ) {\n\t\t\t\tvalue += \"px\";\n\t\t\t}\n\n\t\t\t// Fixes #8908, it can be done more correctly by specifying setters in cssHooks,\n\t\t\t// but it would mean to define eight (for every problematic property) identical functions\n\t\t\tif ( !jQuery.support.clearCloneStyle && value === \"\" && name.indexOf(\"background\") === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !(\"set\" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {\n\t\t\t\tstyle[ name ] = value;\n\t\t\t}\n\n\t\t} else {\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = jQuery.camelCase( name );\n\n\t\t// Make sure that we're working with the right name\n\t\tname = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );\n\n\t\t// gets hook for the prefixed version\n\t\t// followed by the unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t//convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Return, converting to number if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || jQuery.isNumeric( num ) ? num || 0 : val;\n\t\t}\n\t\treturn val;\n\t}\n});\n\ncurCSS = function( elem, name, _computed ) {\n\tvar width, minWidth, maxWidth,\n\t\tcomputed = _computed || getStyles( elem ),\n\n\t\t// Support: IE9\n\t\t// getPropertyValue is only needed for .css('filter') in IE9, see #12537\n\t\tret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,\n\t\tstyle = elem.style;\n\n\tif ( computed ) {\n\n\t\tif ( ret === \"\" && !jQuery.contains( elem.ownerDocument, elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// Support: Safari 5.1\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels\n\t\t// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values\n\t\tif ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret;\n};\n\n\nfunction setPositiveNumber( elem, value, subtract ) {\n\tvar matches = rnumsplit.exec( value );\n\treturn matches ?\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {\n\tvar i = extra === ( isBorderBox ? \"border\" : \"content\" ) ?\n\t\t// If we already have the right measurement, avoid augmentation\n\t\t4 :\n\t\t// Otherwise initialize for horizontal or vertical properties\n\t\tname === \"width\" ? 1 : 0,\n\n\t\tval = 0;\n\n\tfor ( ; i < 4; i += 2 ) {\n\t\t// both box models exclude margin, so add it if we want it\n\t\tif ( extra === \"margin\" ) {\n\t\t\tval += jQuery.css( elem, extra + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\tif ( isBorderBox ) {\n\t\t\t// border-box includes padding, so remove it if we want content\n\t\t\tif ( extra === \"content\" ) {\n\t\t\t\tval -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// at this point, extra isn't border nor margin, so remove border\n\t\t\tif ( extra !== \"margin\" ) {\n\t\t\t\tval -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t} else {\n\t\t\t// at this point, extra isn't content, so add padding\n\t\t\tval += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// at this point, extra isn't content nor padding, so add border\n\t\t\tif ( extra !== \"padding\" ) {\n\t\t\t\tval += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn val;\n}\n\nfunction getWidthOrHeight( elem, name, extra ) {\n\n\t// Start with offset property, which is equivalent to the border-box value\n\tvar valueIsBorderBox = true,\n\t\tval = name === \"width\" ? elem.offsetWidth : elem.offsetHeight,\n\t\tstyles = getStyles( elem ),\n\t\tisBorderBox = jQuery.support.boxSizing && jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t// some non-html elements return undefined for offsetWidth, so check for null/undefined\n\t// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285\n\t// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668\n\tif ( val <= 0 || val == null ) {\n\t\t// Fall back to computed then uncomputed css if necessary\n\t\tval = curCSS( elem, name, styles );\n\t\tif ( val < 0 || val == null ) {\n\t\t\tval = elem.style[ name ];\n\t\t}\n\n\t\t// Computed unit is not pixels. Stop here and return.\n\t\tif ( rnumnonpx.test(val) ) {\n\t\t\treturn val;\n\t\t}\n\n\t\t// we need the check for style in case a browser which returns unreliable values\n\t\t// for getComputedStyle silently falls back to the reliable elem.style\n\t\tvalueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );\n\n\t\t// Normalize \"\", auto, and prepare for extra\n\t\tval = parseFloat( val ) || 0;\n\t}\n\n\t// use the active box-sizing model to add/subtract irrelevant styles\n\treturn ( val +\n\t\taugmentWidthOrHeight(\n\t\t\telem,\n\t\t\tname,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles\n\t\t)\n\t) + \"px\";\n}\n\n// Try to determine the default display value of an element\nfunction css_defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = ( iframe ||\n\t\t\t\tjQuery(\"<iframe frameborder='0' width='0' height='0'/>\")\n\t\t\t\t.css( \"cssText\", \"display:block !important\" )\n\t\t\t).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;\n\t\t\tdoc.write(\"<!doctype html><html><body>\");\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}\n\n// Called ONLY from within css_defaultDisplay\nfunction actualDisplay( name, doc ) {\n\tvar elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\t\tdisplay = jQuery.css( elem[0], \"display\" );\n\telem.remove();\n\treturn display;\n}\n\njQuery.each([ \"height\", \"width\" ], function( i, name ) {\n\tjQuery.cssHooks[ name ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\t\t\t\t// certain elements can have dimension info if we invisibly show them\n\t\t\t\t// however, it must have a current display style that would benefit from this\n\t\t\t\treturn elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, \"display\" ) ) ?\n\t\t\t\t\tjQuery.swap( elem, cssShow, function() {\n\t\t\t\t\t\treturn getWidthOrHeight( elem, name, extra );\n\t\t\t\t\t}) :\n\t\t\t\t\tgetWidthOrHeight( elem, name, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar styles = extra && getStyles( elem );\n\t\t\treturn setPositiveNumber( elem, value, extra ?\n\t\t\t\taugmentWidthOrHeight(\n\t\t\t\t\telem,\n\t\t\t\t\tname,\n\t\t\t\t\textra,\n\t\t\t\t\tjQuery.support.boxSizing && jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\t\tstyles\n\t\t\t\t) : 0\n\t\t\t);\n\t\t}\n\t};\n});\n\n// These hooks cannot be added until DOM ready because the support test\n// for it is not run until after DOM ready\njQuery(function() {\n\t// Support: Android 2.3\n\tif ( !jQuery.support.reliableMarginRight ) {\n\t\tjQuery.cssHooks.marginRight = {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\t\t\t\t\t// Support: Android 2.3\n\t\t\t\t\t// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right\n\t\t\t\t\t// Work around by temporarily setting element display to inline-block\n\t\t\t\t\treturn jQuery.swap( elem, { \"display\": \"inline-block\" },\n\t\t\t\t\t\tcurCSS, [ elem, \"marginRight\" ] );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n\t// getComputedStyle returns percent when specified for top/left/bottom/right\n\t// rather than make the css module depend on the offset module, we just check for it here\n\tif ( !jQuery.support.pixelPosition && jQuery.fn.position ) {\n\t\tjQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n\t\t\tjQuery.cssHooks[ prop ] = {\n\t\t\t\tget: function( elem, computed ) {\n\t\t\t\t\tif ( computed ) {\n\t\t\t\t\t\tcomputed = curCSS( elem, prop );\n\t\t\t\t\t\t// if curCSS returns percentage, fallback to offset\n\t\t\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\t\t\tcomputed;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\n});\n\nif ( jQuery.expr && jQuery.expr.filters ) {\n\tjQuery.expr.filters.hidden = function( elem ) {\n\t\t// Support: Opera <= 12.12\n\t\t// Opera reports offsetWidths and offsetHeights less than zero on some elements\n\t\treturn elem.offsetWidth <= 0 && elem.offsetHeight <= 0;\n\t};\n\n\tjQuery.expr.filters.visible = function( elem ) {\n\t\treturn !jQuery.expr.filters.hidden( elem );\n\t};\n}\n\n// These hooks are used by animate to expand properties\njQuery.each({\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split(\" \") : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( !rmargin.test( prefix ) ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n});\nvar r20 = /%20/g,\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\njQuery.fn.extend({\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map(function(){\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t})\n\t\t.filter(function(){\n\t\t\tvar type = this.type;\n\t\t\t// Use .is(\":disabled\") so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !manipulation_rcheckableType.test( type ) );\n\t\t})\n\t\t.map(function( i, elem ){\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\treturn val == null ?\n\t\t\t\tnull :\n\t\t\t\tjQuery.isArray( val ) ?\n\t\t\t\t\tjQuery.map( val, function( val ){\n\t\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t\t}) :\n\t\t\t\t\t{ name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t}).get();\n\t}\n});\n\n//Serialize an array of form elements or a set of\n//key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, value ) {\n\t\t\t// If value is a function, invoke it and return its value\n\t\t\tvalue = jQuery.isFunction( value ) ? value() : ( value == null ? \"\" : value );\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" + encodeURIComponent( value );\n\t\t};\n\n\t// Set traditional to true for jQuery <= 1.3.2 behavior.\n\tif ( traditional === undefined ) {\n\t\ttraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t});\n\n\t} else {\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" ).replace( r20, \"+\" );\n};\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( jQuery.isArray( obj ) ) {\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams( prefix + \"[\" + ( typeof v === \"object\" ? i : \"\" ) + \"]\", v, traditional, add );\n\t\t\t}\n\t\t});\n\n\t} else if ( !traditional && jQuery.type( obj ) === \"object\" ) {\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\njQuery.each( (\"blur focus focusin focusout load resize scroll unload click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup error contextmenu\").split(\" \"), function( i, name ) {\n\n\t// Handle event binding\n\tjQuery.fn[ name ] = function( data, fn ) {\n\t\treturn arguments.length > 0 ?\n\t\t\tthis.on( name, null, data, fn ) :\n\t\t\tthis.trigger( name );\n\t};\n});\n\njQuery.fn.extend({\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t},\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ? this.off( selector, \"**\" ) : this.off( types, selector || \"**\", fn );\n\t}\n});\nvar\n\t// Document location\n\tajaxLocParts,\n\tajaxLocation,\n\n\tajax_nonce = jQuery.now(),\n\n\tajax_rquery = /\\?/,\n\trhash = /#.*$/,\n\trts = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\trurl = /^([\\w.+-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+)|)|)/,\n\n\t// Keep a copy of the old load method\n\t_load = jQuery.fn.load,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t *    - BEFORE asking for a transport\n\t *    - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat(\"*\");\n\n// #8138, IE may throw an exception when accessing\n// a field from window.location if document.domain has been set\ntry {\n\tajaxLocation = location.href;\n} catch( e ) {\n\t// Use the href attribute of an A element\n\t// since IE will modify it given document.location\n\tajaxLocation = document.createElement( \"a\" );\n\tajaxLocation.href = \"\";\n\tajaxLocation = ajaxLocation.href;\n}\n\n// Segment location into parts\najaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];\n\n\t\tif ( jQuery.isFunction( func ) ) {\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( (dataType = dataTypes[i++]) ) {\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[0] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\njQuery.fn.load = function( url, params, callback ) {\n\tif ( typeof url !== \"string\" && _load ) {\n\t\treturn _load.apply( this, arguments );\n\t}\n\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf(\" \");\n\n\tif ( off >= 0 ) {\n\t\tselector = url.slice( off );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( jQuery.isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax({\n\t\t\turl: url,\n\n\t\t\t// if \"type\" variable is undefined, then \"GET\" method will be used\n\t\t\ttype: type,\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t}).done(function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery(\"<div>\").append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t}).complete( callback && function( jqXHR, status ) {\n\t\t\tself.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t});\n\t}\n\n\treturn this;\n};\n\n// Attach a bunch of functions for handling common AJAX events\njQuery.each( [ \"ajaxStart\", \"ajaxStop\", \"ajaxComplete\", \"ajaxError\", \"ajaxSuccess\", \"ajaxSend\" ], function( i, type ){\n\tjQuery.fn[ type ] = function( fn ){\n\t\treturn this.on( type, fn );\n\t};\n});\n\njQuery.extend({\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: ajaxLocation,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /xml/,\n\t\t\thtml: /html/,\n\t\t\tjson: /json/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": jQuery.parseJSON,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\t\t\t// Cross-domain detection vars\n\t\t\tparts,\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\t\t\t// Loop variable\n\t\t\ti,\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\tjQuery.event,\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks(\"once memory\"),\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\t\t\t// The jqXHR state\n\t\t\tstate = 0,\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( state === 2 ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( (match = rheaders.exec( responseHeadersString )) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[1].toLowerCase() ] = match[ 2 ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match;\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn state === 2 ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tvar lname = name.toLowerCase();\n\t\t\t\t\tif ( !state ) {\n\t\t\t\t\t\tname = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( !state ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( state < 2 ) {\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\t// Lazy-add the new callback in a way that preserves old ones\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR ).complete = completeDeferred.add;\n\t\tjqXHR.success = jqXHR.done;\n\t\tjqXHR.error = jqXHR.fail;\n\n\t\t// Remove hash character (#7531: and string promotion)\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || ajaxLocation ) + \"\" ).replace( rhash, \"\" )\n\t\t\t.replace( rprotocol, ajaxLocParts[ 1 ] + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = jQuery.trim( s.dataType || \"*\" ).toLowerCase().match( core_rnotwhite ) || [\"\"];\n\n\t\t// A cross-domain request is in order when we have a protocol:host:port mismatch\n\t\tif ( s.crossDomain == null ) {\n\t\t\tparts = rurl.exec( s.url.toLowerCase() );\n\t\t\ts.crossDomain = !!( parts &&\n\t\t\t\t( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||\n\t\t\t\t\t( parts[ 3 ] || ( parts[ 1 ] === \"http:\" ? \"80\" : \"443\" ) ) !==\n\t\t\t\t\t\t( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === \"http:\" ? \"80\" : \"443\" ) ) )\n\t\t\t);\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( state === 2 ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\tfireGlobals = s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger(\"ajaxStart\");\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\tcacheURL = s.url;\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// If data is available, append data to url\n\t\t\tif ( s.data ) {\n\t\t\t\tcacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data );\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add anti-cache in url if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\ts.url = rts.test( cacheURL ) ?\n\n\t\t\t\t\t// If there is already a '_' parameter, set its value\n\t\t\t\t\tcacheURL.replace( rts, \"$1_=\" + ajax_nonce++ ) :\n\n\t\t\t\t\t// Otherwise add one to the end\n\t\t\t\t\tcacheURL + ( ajax_rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ajax_nonce++;\n\t\t\t}\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tfor ( i in { success: 1, error: 1, complete: 1 } ) {\n\t\t\tjqXHR[ i ]( s[ i ] );\n\t\t}\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = setTimeout(function() {\n\t\t\t\t\tjqXHR.abort(\"timeout\");\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tstate = 1;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\t\t\t\t// Propagate exception as error if not done\n\t\t\t\tif ( state < 2 ) {\n\t\t\t\t\tdone( -1, e );\n\t\t\t\t// Simply rethrow otherwise\n\t\t\t\t} else {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"Last-Modified\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"etag\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger(\"ajaxStop\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n});\n\njQuery.each( [ \"get\", \"post\" ], function( i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\t\t// shift arguments if data argument was omitted\n\t\tif ( jQuery.isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\treturn jQuery.ajax({\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t});\n\t};\n});\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n// Install script dataType\njQuery.ajaxSetup({\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /(?:java|ecma)script/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n});\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n});\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\t// This transport only deals with cross domain requests\n\tif ( s.crossDomain ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery(\"<script>\").prop({\n\t\t\t\t\tasync: true,\n\t\t\t\t\tcharset: s.scriptCharset,\n\t\t\t\t\tsrc: s.url\n\t\t\t\t}).on(\n\t\t\t\t\t\"load error\",\n\t\t\t\t\tcallback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n});\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup({\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( ajax_nonce++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n});\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" && !( s.contentType || \"\" ).indexOf(\"application/x-www-form-urlencoded\") && rjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( ajax_rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[\"script json\"] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always(function() {\n\t\t\t// Restore preexisting value\n\t\t\twindow[ callbackName ] = overwritten;\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\t\t\t\t// make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && jQuery.isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t});\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n});\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new XMLHttpRequest();\n\t} catch( e ) {}\n};\n\nvar xhrSupported = jQuery.ajaxSettings.xhr(),\n\txhrSuccessStatus = {\n\t\t// file protocol always yields status code 0, assume 200\n\t\t0: 200,\n\t\t// Support: IE9\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\t// Support: IE9\n\t// We need to keep track of outbound xhr and abort them manually\n\t// because IE is not smart enough to do it all by itself\n\txhrId = 0,\n\txhrCallbacks = {};\n\nif ( window.ActiveXObject ) {\n\tjQuery( window ).on( \"unload\", function() {\n\t\tfor( var key in xhrCallbacks ) {\n\t\t\txhrCallbacks[ key ]();\n\t\t}\n\t\txhrCallbacks = undefined;\n\t});\n}\n\njQuery.support.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\njQuery.support.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport(function( options ) {\n\tvar callback;\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( jQuery.support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i, id,\n\t\t\t\t\txhr = options.xhr();\n\t\t\t\txhr.open( options.type, options.url, options.async, options.username, options.password );\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[\"X-Requested-With\"] ) {\n\t\t\t\t\theaders[\"X-Requested-With\"] = \"XMLHttpRequest\";\n\t\t\t\t}\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tdelete xhrCallbacks[ id ];\n\t\t\t\t\t\t\tcallback = xhr.onload = xhr.onerror = null;\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\t// file protocol always yields status 0, assume 404\n\t\t\t\t\t\t\t\t\txhr.status || 404,\n\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\t\t\t\t\t\t\t\t\t// Support: IE9\n\t\t\t\t\t\t\t\t\t// #11426: When requesting binary data, IE9 will throw an exception\n\t\t\t\t\t\t\t\t\t// on any attempt to access responseText\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText === \"string\" ? {\n\t\t\t\t\t\t\t\t\t\ttext: xhr.responseText\n\t\t\t\t\t\t\t\t\t} : undefined,\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\txhr.onerror = callback(\"error\");\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = xhrCallbacks[( id = xhrId++ )] = callback(\"abort\");\n\t\t\t\t// Do send the request\n\t\t\t\t// This may raise an exception which is actually\n\t\t\t\t// handled in jQuery.ajax (so no try/catch here)\n\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n});\nvar fxNow, timerId,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trfxnum = new RegExp( \"^(?:([+-])=|)(\" + core_pnum + \")([a-z%]*)$\", \"i\" ),\n\trrun = /queueHooks$/,\n\tanimationPrefilters = [ defaultPrefilter ],\n\ttweeners = {\n\t\t\"*\": [function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value ),\n\t\t\t\ttarget = tween.cur(),\n\t\t\t\tparts = rfxnum.exec( value ),\n\t\t\t\tunit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t\t\t// Starting value computation is required for potential unit mismatches\n\t\t\t\tstart = ( jQuery.cssNumber[ prop ] || unit !== \"px\" && +target ) &&\n\t\t\t\t\trfxnum.exec( jQuery.css( tween.elem, prop ) ),\n\t\t\t\tscale = 1,\n\t\t\t\tmaxIterations = 20;\n\n\t\t\tif ( start && start[ 3 ] !== unit ) {\n\t\t\t\t// Trust units reported by jQuery.css\n\t\t\t\tunit = unit || start[ 3 ];\n\n\t\t\t\t// Make sure we update the tween properties later on\n\t\t\t\tparts = parts || [];\n\n\t\t\t\t// Iteratively approximate from a nonzero starting point\n\t\t\t\tstart = +target || 1;\n\n\t\t\t\tdo {\n\t\t\t\t\t// If previous iteration zeroed out, double until we get *something*\n\t\t\t\t\t// Use a string for doubling factor so we don't accidentally see scale as unchanged below\n\t\t\t\t\tscale = scale || \".5\";\n\n\t\t\t\t\t// Adjust and apply\n\t\t\t\t\tstart = start / scale;\n\t\t\t\t\tjQuery.style( tween.elem, prop, start + unit );\n\n\t\t\t\t// Update scale, tolerating zero or NaN from tween.cur()\n\t\t\t\t// And breaking the loop if scale is unchanged or perfect, or if we've just had enough\n\t\t\t\t} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );\n\t\t\t}\n\n\t\t\t// Update tween properties\n\t\t\tif ( parts ) {\n\t\t\t\tstart = tween.start = +start || +target || 0;\n\t\t\t\ttween.unit = unit;\n\t\t\t\t// If a +=/-= token was provided, we're doing a relative animation\n\t\t\t\ttween.end = parts[ 1 ] ?\n\t\t\t\t\tstart + ( parts[ 1 ] + 1 ) * parts[ 2 ] :\n\t\t\t\t\t+parts[ 2 ];\n\t\t\t}\n\n\t\t\treturn tween;\n\t\t}]\n\t};\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\tsetTimeout(function() {\n\t\tfxNow = undefined;\n\t});\n\treturn ( fxNow = jQuery.now() );\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( tweeners[ prop ] || [] ).concat( tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( (tween = collection[ index ].call( animation, prop, value )) ) {\n\n\t\t\t// we're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = animationPrefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\t\t\t// don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t}),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\t\t\t\t// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length ; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ]);\n\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t} else {\n\t\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tanimation = deferred.promise({\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, { specialEasing: {} }, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\t\t\t\t\t// if we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length ; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// resolve when we played the last frame\n\t\t\t\t// otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length ; index++ ) {\n\t\tresult = animationPrefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( jQuery.isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t})\n\t);\n\n\t// attach callbacks from options\n\treturn animation.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = jQuery.camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( jQuery.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// not quite $.extend, this wont overwrite keys already present.\n\t\t\t// also - reusing 'index' from above because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweener: function( props, callback ) {\n\t\tif ( jQuery.isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.split(\" \");\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length ; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\ttweeners[ prop ] = tweeners[ prop ] || [];\n\t\t\ttweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tanimationPrefilters.unshift( callback );\n\t\t} else {\n\t\t\tanimationPrefilters.push( callback );\n\t\t}\n\t}\n});\n\nfunction defaultPrefilter( elem, props, opts ) {\n\t/* jshint validthis: true */\n\tvar prop, value, toggle, tween, hooks, oldfire,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHidden( elem ),\n\t\tdataShow = data_priv.get( elem, \"fxshow\" );\n\n\t// handle queue: false promises\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always(function() {\n\t\t\t// doing this makes sure that the complete handler will be called\n\t\t\t// before this completes\n\t\t\tanim.always(function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t// height/width overflow pass\n\tif ( elem.nodeType === 1 && ( \"height\" in props || \"width\" in props ) ) {\n\t\t// Make sure that nothing sneaks out\n\t\t// Record all 3 overflow attributes because IE9-10 do not\n\t\t// change the overflow attribute when overflowX and\n\t\t// overflowY are set to the same value\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Set display property to inline-block for height/width\n\t\t// animations on inline elements that are having width/height animated\n\t\tif ( jQuery.css( elem, \"display\" ) === \"inline\" &&\n\t\t\t\tjQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\tstyle.display = \"inline-block\";\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always(function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t});\n\t}\n\n\n\t// show/hide pass\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.exec( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\tif ( !jQuery.isEmptyObject( orig ) ) {\n\t\tif ( dataShow ) {\n\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\thidden = dataShow.hidden;\n\t\t\t}\n\t\t} else {\n\t\t\tdataShow = data_priv.access( elem, \"fxshow\", {} );\n\t\t}\n\n\t\t// store state if its toggle - enables .stop().toggle() to \"reverse\"\n\t\tif ( toggle ) {\n\t\t\tdataShow.hidden = !hidden;\n\t\t}\n\t\tif ( hidden ) {\n\t\t\tjQuery( elem ).show();\n\t\t} else {\n\t\t\tanim.done(function() {\n\t\t\t\tjQuery( elem ).hide();\n\t\t\t});\n\t\t}\n\t\tanim.done(function() {\n\t\t\tvar prop;\n\n\t\t\tdata_priv.remove( elem, \"fxshow\" );\n\t\t\tfor ( prop in orig ) {\n\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t}\n\t\t});\n\t\tfor ( prop in orig ) {\n\t\t\ttween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\n\t\t\tif ( !( prop in dataShow ) ) {\n\t\t\t\tdataShow[ prop ] = tween.start;\n\t\t\t\tif ( hidden ) {\n\t\t\t\t\ttween.end = tween.start;\n\t\t\t\t\ttween.start = prop === \"width\" || prop === \"height\" ? 1 : 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || \"swing\";\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\tif ( tween.elem[ tween.prop ] != null &&\n\t\t\t\t(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails\n\t\t\t// so, simple values such as \"10px\" are parsed to Float.\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\t\t\t// use step hook for back compat - use cssHook if its there - use .style if its\n\t\t\t// available and use plain properties where available\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE9\n// Panic based approach to setting things on disconnected nodes\n\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.each([ \"toggle\", \"show\", \"hide\" ], function( i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n});\n\njQuery.fn.extend({\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHidden ).css( \"opacity\", 0 ).show()\n\n\t\t\t// animate to the value specified\n\t\t\t.end().animate({ opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || data_priv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue && type !== false ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = data_priv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// start the next in the queue if the last step wasn't forced\n\t\t\t// timers currently will call their complete callbacks, which will dequeue\n\t\t\t// but only if they were gotoEnd\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t});\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each(function() {\n\t\t\tvar index,\n\t\t\t\tdata = data_priv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t});\n\t}\n});\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\tattrs = { height: type },\n\t\ti = 0;\n\n\t// if we include width, step value is 1 to do all cssExpand values,\n\t// if we don't include width, step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth? 1 : 0;\n\tfor( ; i < 4 ; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\n// Generate shortcuts for custom animations\njQuery.each({\n\tslideDown: genFx(\"show\"),\n\tslideUp: genFx(\"hide\"),\n\tslideToggle: genFx(\"toggle\"),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n});\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tjQuery.isFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !jQuery.isFunction( easing ) && easing\n\t};\n\n\topt.duration = jQuery.fx.off ? 0 : typeof opt.duration === \"number\" ? opt.duration :\n\t\topt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;\n\n\t// normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( jQuery.isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p*Math.PI ) / 2;\n\t}\n};\n\njQuery.timers = [];\njQuery.fx = Tween.prototype.init;\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ttimers = jQuery.timers,\n\t\ti = 0;\n\n\tfxNow = jQuery.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\t\t// Checks the timer has not already been removed\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tif ( timer() && jQuery.timers.push( timer ) ) {\n\t\tjQuery.fx.start();\n\t}\n};\n\njQuery.fx.interval = 13;\n\njQuery.fx.start = function() {\n\tif ( !timerId ) {\n\t\ttimerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );\n\t}\n};\n\njQuery.fx.stop = function() {\n\tclearInterval( timerId );\n\ttimerId = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\t// Default speed\n\t_default: 400\n};\n\n// Back Compat <1.8 extension point\njQuery.fx.step = {};\n\nif ( jQuery.expr && jQuery.expr.filters ) {\n\tjQuery.expr.filters.animated = function( elem ) {\n\t\treturn jQuery.grep(jQuery.timers, function( fn ) {\n\t\t\treturn elem === fn.elem;\n\t\t}).length;\n\t};\n}\njQuery.fn.offset = function( options ) {\n\tif ( arguments.length ) {\n\t\treturn options === undefined ?\n\t\t\tthis :\n\t\t\tthis.each(function( i ) {\n\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t});\n\t}\n\n\tvar docElem, win,\n\t\telem = this[ 0 ],\n\t\tbox = { top: 0, left: 0 },\n\t\tdoc = elem && elem.ownerDocument;\n\n\tif ( !doc ) {\n\t\treturn;\n\t}\n\n\tdocElem = doc.documentElement;\n\n\t// Make sure it's not a disconnected DOM node\n\tif ( !jQuery.contains( docElem, elem ) ) {\n\t\treturn box;\n\t}\n\n\t// If we don't have gBCR, just use 0,0 rather than error\n\t// BlackBerry 5, iOS 3 (original iPhone)\n\tif ( typeof elem.getBoundingClientRect !== core_strundefined ) {\n\t\tbox = elem.getBoundingClientRect();\n\t}\n\twin = getWindow( doc );\n\treturn {\n\t\ttop: box.top + win.pageYOffset - docElem.clientTop,\n\t\tleft: box.left + win.pageXOffset - docElem.clientLeft\n\t};\n};\n\njQuery.offset = {\n\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) && ( curCSSTop + curCSSLeft ).indexOf(\"auto\") > -1;\n\n\t\t// Need to be able to calculate position if either top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( jQuery.isFunction( options ) ) {\n\t\t\toptions = options.call( elem, i, curOffset );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\n\njQuery.fn.extend({\n\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\t\t\t// We assume that getBoundingClientRect is available when computed position is fixed\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\t// Get *real* offsetParent\n\t\t\toffsetParent = this.offsetParent();\n\n\t\t\t// Get correct offsets\n\t\t\toffset = this.offset();\n\t\t\tif ( !jQuery.nodeName( offsetParent[ 0 ], \"html\" ) ) {\n\t\t\t\tparentOffset = offsetParent.offset();\n\t\t\t}\n\n\t\t\t// Add offsetParent borders\n\t\t\tparentOffset.top += jQuery.css( offsetParent[ 0 ], \"borderTopWidth\", true );\n\t\t\tparentOffset.left += jQuery.css( offsetParent[ 0 ], \"borderLeftWidth\", true );\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\toffsetParent: function() {\n\t\treturn this.map(function() {\n\t\t\tvar offsetParent = this.offsetParent || docElem;\n\n\t\t\twhile ( offsetParent && ( !jQuery.nodeName( offsetParent, \"html\" ) && jQuery.css( offsetParent, \"position\") === \"static\" ) ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || docElem;\n\t\t});\n\t}\n});\n\n\n// Create scrollLeft and scrollTop methods\njQuery.each( {scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\"}, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn jQuery.access( this, function( elem, method, val ) {\n\t\t\tvar win = getWindow( elem );\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : window.pageXOffset,\n\t\t\t\t\ttop ? val : window.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length, null );\n\t};\n});\n\nfunction getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name }, function( defaultExtra, funcName ) {\n\t\t// margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn jQuery.access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( jQuery.isWindow( elem ) ) {\n\t\t\t\t\t// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there\n\t\t\t\t\t// isn't a whole lot we can do. See pull request at this URL for discussion:\n\t\t\t\t\t// https://github.com/jquery/jquery/pull/764\n\t\t\t\t\treturn elem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable, null );\n\t\t};\n\t});\n});\n// Limit scope pollution from any deprecated API\n// (function() {\n\n// The number of elements contained in the matched element set\njQuery.fn.size = function() {\n\treturn this.length;\n};\n\njQuery.fn.andSelf = jQuery.fn.addBack;\n\n// })();\nif ( typeof module === \"object\" && module && typeof module.exports === \"object\" ) {\n\t// Expose jQuery as module.exports in loaders that implement the Node\n\t// module pattern (including browserify). Do not create the global, since\n\t// the user will be storing it themselves locally, and globals are frowned\n\t// upon in the Node module world.\n\tmodule.exports = jQuery;\n} else {\n\t// Register as a named AMD module, since jQuery can be concatenated with other\n\t// files that may use define, but not via a proper concatenation script that\n\t// understands anonymous AMD modules. A named AMD is safest and most robust\n\t// way to register. Lowercase jquery is used because AMD module names are\n\t// derived from file names, and jQuery is normally delivered in a lowercase\n\t// file name. Do this after creating the global so that if an AMD module wants\n\t// to call noConflict to hide this version of jQuery, it will work.\n\tif ( typeof define === \"function\" && define.amd ) {\n\t\tdefine( \"jquery\", [], function () { return jQuery; } );\n\t}\n}\n\n// If there is a window object, that at least has a document property,\n// define jQuery and $ identifiers\nif ( typeof window === \"object\" && typeof window.document === \"object\" ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n})( window );\n\n/**\n * @license\n * Lo-Dash 2.2.1 (Custom Build) <http://lodash.com/>\n * Build: `lodash modern -o ./dist/lodash.js`\n * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>\n * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>\n * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license <http://lodash.com/license>\n */\n;(function() {\n\n  /** Used as a safe reference for `undefined` in pre ES5 environments */\n  var undefined;\n\n  /** Used to pool arrays and objects used internally */\n  var arrayPool = [],\n      objectPool = [];\n\n  /** Used to generate unique IDs */\n  var idCounter = 0;\n\n  /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */\n  var keyPrefix = +new Date + '';\n\n  /** Used as the size when optimizations are enabled for large arrays */\n  var largeArraySize = 75;\n\n  /** Used as the max size of the `arrayPool` and `objectPool` */\n  var maxPoolSize = 40;\n\n  /** Used to detect and test whitespace */\n  var whitespace = (\n    // whitespace\n    ' \\t\\x0B\\f\\xA0\\ufeff' +\n\n    // line terminators\n    '\\n\\r\\u2028\\u2029' +\n\n    // unicode category \"Zs\" space separators\n    '\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000'\n  );\n\n  /** Used to match empty string literals in compiled template source */\n  var reEmptyStringLeading = /\\b__p \\+= '';/g,\n      reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n      reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n  /**\n   * Used to match ES6 template delimiters\n   * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6\n   */\n  var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n  /** Used to match regexp flags from their coerced string values */\n  var reFlags = /\\w*$/;\n\n  /** Used to detected named functions */\n  var reFuncName = /^function[ \\n\\r\\t]+\\w/;\n\n  /** Used to match \"interpolate\" template delimiters */\n  var reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n  /** Used to match leading whitespace and zeros to be removed */\n  var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)');\n\n  /** Used to ensure capturing order of template delimiters */\n  var reNoMatch = /($^)/;\n\n  /** Used to detect functions containing a `this` reference */\n  var reThis = /\\bthis\\b/;\n\n  /** Used to match unescaped characters in compiled string literals */\n  var reUnescapedString = /['\\n\\r\\t\\u2028\\u2029\\\\]/g;\n\n  /** Used to assign default `context` object properties */\n  var contextProps = [\n    'Array', 'Boolean', 'Date', 'Function', 'Math', 'Number', 'Object',\n    'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN',\n    'parseInt', 'setImmediate', 'setTimeout'\n  ];\n\n  /** Used to make template sourceURLs easier to identify */\n  var templateCounter = 0;\n\n  /** `Object#toString` result shortcuts */\n  var argsClass = '[object Arguments]',\n      arrayClass = '[object Array]',\n      boolClass = '[object Boolean]',\n      dateClass = '[object Date]',\n      funcClass = '[object Function]',\n      numberClass = '[object Number]',\n      objectClass = '[object Object]',\n      regexpClass = '[object RegExp]',\n      stringClass = '[object String]';\n\n  /** Used to identify object classifications that `_.clone` supports */\n  var cloneableClasses = {};\n  cloneableClasses[funcClass] = false;\n  cloneableClasses[argsClass] = cloneableClasses[arrayClass] =\n  cloneableClasses[boolClass] = cloneableClasses[dateClass] =\n  cloneableClasses[numberClass] = cloneableClasses[objectClass] =\n  cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true;\n\n  /** Used as an internal `_.debounce` options object */\n  var debounceOptions = {\n    'leading': false,\n    'maxWait': 0,\n    'trailing': false\n  };\n\n  /** Used as the property descriptor for `__bindData__` */\n  var descriptor = {\n    'configurable': false,\n    'enumerable': false,\n    'value': null,\n    'writable': false\n  };\n\n  /** Used to determine if values are of the language type Object */\n  var objectTypes = {\n    'boolean': false,\n    'function': true,\n    'object': true,\n    'number': false,\n    'string': false,\n    'undefined': false\n  };\n\n  /** Used to escape characters for inclusion in compiled string literals */\n  var stringEscapes = {\n    '\\\\': '\\\\',\n    \"'\": \"'\",\n    '\\n': 'n',\n    '\\r': 'r',\n    '\\t': 't',\n    '\\u2028': 'u2028',\n    '\\u2029': 'u2029'\n  };\n\n  /** Used as a reference to the global object */\n  var root = (objectTypes[typeof window] && window) || this;\n\n  /** Detect free variable `exports` */\n  var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n  /** Detect free variable `module` */\n  var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;\n\n  /** Detect the popular CommonJS extension `module.exports` */\n  var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;\n\n  /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */\n  var freeGlobal = objectTypes[typeof global] && global;\n  if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {\n    root = freeGlobal;\n  }\n\n  /*--------------------------------------------------------------------------*/\n\n  /**\n   * The base implementation of `_.indexOf` without support for binary searches\n   * or `fromIndex` constraints.\n   *\n   * @private\n   * @param {Array} array The array to search.\n   * @param {*} value The value to search for.\n   * @param {number} [fromIndex=0] The index to search from.\n   * @returns {number} Returns the index of the matched value or `-1`.\n   */\n  function baseIndexOf(array, value, fromIndex) {\n    var index = (fromIndex || 0) - 1,\n        length = array ? array.length : 0;\n\n    while (++index < length) {\n      if (array[index] === value) {\n        return index;\n      }\n    }\n    return -1;\n  }\n\n  /**\n   * An implementation of `_.contains` for cache objects that mimics the return\n   * signature of `_.indexOf` by returning `0` if the value is found, else `-1`.\n   *\n   * @private\n   * @param {Object} cache The cache object to inspect.\n   * @param {*} value The value to search for.\n   * @returns {number} Returns `0` if `value` is found, else `-1`.\n   */\n  function cacheIndexOf(cache, value) {\n    var type = typeof value;\n    cache = cache.cache;\n\n    if (type == 'boolean' || value == null) {\n      return cache[value] ? 0 : -1;\n    }\n    if (type != 'number' && type != 'string') {\n      type = 'object';\n    }\n    var key = type == 'number' ? value : keyPrefix + value;\n    cache = (cache = cache[type]) && cache[key];\n\n    return type == 'object'\n      ? (cache && baseIndexOf(cache, value) > -1 ? 0 : -1)\n      : (cache ? 0 : -1);\n  }\n\n  /**\n   * Adds a given value to the corresponding cache object.\n   *\n   * @private\n   * @param {*} value The value to add to the cache.\n   */\n  function cachePush(value) {\n    var cache = this.cache,\n        type = typeof value;\n\n    if (type == 'boolean' || value == null) {\n      cache[value] = true;\n    } else {\n      if (type != 'number' && type != 'string') {\n        type = 'object';\n      }\n      var key = type == 'number' ? value : keyPrefix + value,\n          typeCache = cache[type] || (cache[type] = {});\n\n      if (type == 'object') {\n        (typeCache[key] || (typeCache[key] = [])).push(value);\n      } else {\n        typeCache[key] = true;\n      }\n    }\n  }\n\n  /**\n   * Used by `_.max` and `_.min` as the default callback when a given\n   * collection is a string value.\n   *\n   * @private\n   * @param {string} value The character to inspect.\n   * @returns {number} Returns the code unit of given character.\n   */\n  function charAtCallback(value) {\n    return value.charCodeAt(0);\n  }\n\n  /**\n   * Used by `sortBy` to compare transformed `collection` elements, stable sorting\n   * them in ascending order.\n   *\n   * @private\n   * @param {Object} a The object to compare to `b`.\n   * @param {Object} b The object to compare to `a`.\n   * @returns {number} Returns the sort order indicator of `1` or `-1`.\n   */\n  function compareAscending(a, b) {\n    var ac = a.criteria,\n        bc = b.criteria;\n\n    // ensure a stable sort in V8 and other engines\n    // http://code.google.com/p/v8/issues/detail?id=90\n    if (ac !== bc) {\n      if (ac > bc || typeof ac == 'undefined') {\n        return 1;\n      }\n      if (ac < bc || typeof bc == 'undefined') {\n        return -1;\n      }\n    }\n    // The JS engine embedded in Adobe applications like InDesign has a buggy\n    // `Array#sort` implementation that causes it, under certain circumstances,\n    // to return the same value for `a` and `b`.\n    // See https://github.com/jashkenas/underscore/pull/1247\n    return a.index - b.index;\n  }\n\n  /**\n   * Creates a cache object to optimize linear searches of large arrays.\n   *\n   * @private\n   * @param {Array} [array=[]] The array to search.\n   * @returns {null|Object} Returns the cache object or `null` if caching should not be used.\n   */\n  function createCache(array) {\n    var index = -1,\n        length = array.length,\n        first = array[0],\n        mid = array[(length / 2) | 0],\n        last = array[length - 1];\n\n    if (first && typeof first == 'object' &&\n        mid && typeof mid == 'object' && last && typeof last == 'object') {\n      return false;\n    }\n    var cache = getObject();\n    cache['false'] = cache['null'] = cache['true'] = cache['undefined'] = false;\n\n    var result = getObject();\n    result.array = array;\n    result.cache = cache;\n    result.push = cachePush;\n\n    while (++index < length) {\n      result.push(array[index]);\n    }\n    return result;\n  }\n\n  /**\n   * Used by `template` to escape characters for inclusion in compiled\n   * string literals.\n   *\n   * @private\n   * @param {string} match The matched character to escape.\n   * @returns {string} Returns the escaped character.\n   */\n  function escapeStringChar(match) {\n    return '\\\\' + stringEscapes[match];\n  }\n\n  /**\n   * Gets an array from the array pool or creates a new one if the pool is empty.\n   *\n   * @private\n   * @returns {Array} The array from the pool.\n   */\n  function getArray() {\n    return arrayPool.pop() || [];\n  }\n\n  /**\n   * Gets an object from the object pool or creates a new one if the pool is empty.\n   *\n   * @private\n   * @returns {Object} The object from the pool.\n   */\n  function getObject() {\n    return objectPool.pop() || {\n      'array': null,\n      'cache': null,\n      'criteria': null,\n      'false': false,\n      'index': 0,\n      'null': false,\n      'number': null,\n      'object': null,\n      'push': null,\n      'string': null,\n      'true': false,\n      'undefined': false,\n      'value': null\n    };\n  }\n\n  /**\n   * A no-operation function.\n   *\n   * @private\n   */\n  function noop() {\n    // no operation performed\n  }\n\n  /**\n   * Releases the given array back to the array pool.\n   *\n   * @private\n   * @param {Array} [array] The array to release.\n   */\n  function releaseArray(array) {\n    array.length = 0;\n    if (arrayPool.length < maxPoolSize) {\n      arrayPool.push(array);\n    }\n  }\n\n  /**\n   * Releases the given object back to the object pool.\n   *\n   * @private\n   * @param {Object} [object] The object to release.\n   */\n  function releaseObject(object) {\n    var cache = object.cache;\n    if (cache) {\n      releaseObject(cache);\n    }\n    object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null;\n    if (objectPool.length < maxPoolSize) {\n      objectPool.push(object);\n    }\n  }\n\n  /**\n   * Slices the `collection` from the `start` index up to, but not including,\n   * the `end` index.\n   *\n   * Note: This function is used instead of `Array#slice` to support node lists\n   * in IE < 9 and to ensure dense arrays are returned.\n   *\n   * @private\n   * @param {Array|Object|string} collection The collection to slice.\n   * @param {number} start The start index.\n   * @param {number} end The end index.\n   * @returns {Array} Returns the new array.\n   */\n  function slice(array, start, end) {\n    start || (start = 0);\n    if (typeof end == 'undefined') {\n      end = array ? array.length : 0;\n    }\n    var index = -1,\n        length = end - start || 0,\n        result = Array(length < 0 ? 0 : length);\n\n    while (++index < length) {\n      result[index] = array[start + index];\n    }\n    return result;\n  }\n\n  /*--------------------------------------------------------------------------*/\n\n  /**\n   * Create a new `lodash` function using the given context object.\n   *\n   * @static\n   * @memberOf _\n   * @category Utilities\n   * @param {Object} [context=root] The context object.\n   * @returns {Function} Returns the `lodash` function.\n   */\n  function runInContext(context) {\n    // Avoid issues with some ES3 environments that attempt to use values, named\n    // after built-in constructors like `Object`, for the creation of literals.\n    // ES5 clears this up by stating that literals must use built-in constructors.\n    // See http://es5.github.io/#x11.1.5.\n    context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;\n\n    /** Native constructor references */\n    var Array = context.Array,\n        Boolean = context.Boolean,\n        Date = context.Date,\n        Function = context.Function,\n        Math = context.Math,\n        Number = context.Number,\n        Object = context.Object,\n        RegExp = context.RegExp,\n        String = context.String,\n        TypeError = context.TypeError;\n\n    /**\n     * Used for `Array` method references.\n     *\n     * Normally `Array.prototype` would suffice, however, using an array literal\n     * avoids issues in Narwhal.\n     */\n    var arrayRef = [];\n\n    /** Used for native method references */\n    var objectProto = Object.prototype;\n\n    /** Used to restore the original `_` reference in `noConflict` */\n    var oldDash = context._;\n\n    /** Used to detect if a method is native */\n    var reNative = RegExp('^' +\n      String(objectProto.valueOf)\n        .replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n        .replace(/valueOf|for [^\\]]+/g, '.+?') + '$'\n    );\n\n    /** Native method shortcuts */\n    var ceil = Math.ceil,\n        clearTimeout = context.clearTimeout,\n        floor = Math.floor,\n        fnToString = Function.prototype.toString,\n        getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf,\n        hasOwnProperty = objectProto.hasOwnProperty,\n        now = reNative.test(now = Date.now) && now || function() { return +new Date; },\n        push = arrayRef.push,\n        setImmediate = context.setImmediate,\n        setTimeout = context.setTimeout,\n        splice = arrayRef.splice,\n        toString = objectProto.toString,\n        unshift = arrayRef.unshift;\n\n    var defineProperty = (function() {\n      try {\n        var o = {},\n            func = reNative.test(func = Object.defineProperty) && func,\n            result = func(o, o, o) && func;\n      } catch(e) { }\n      return result;\n    }());\n\n    /* Native method shortcuts for methods with the same name as other `lodash` methods */\n    var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,\n        nativeCreate = reNative.test(nativeCreate = Object.create) && nativeCreate,\n        nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,\n        nativeIsFinite = context.isFinite,\n        nativeIsNaN = context.isNaN,\n        nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys,\n        nativeMax = Math.max,\n        nativeMin = Math.min,\n        nativeParseInt = context.parseInt,\n        nativeRandom = Math.random,\n        nativeSlice = arrayRef.slice;\n\n    /** Detect various environments */\n    var isIeOpera = reNative.test(context.attachEvent),\n        isV8 = nativeBind && !/\\n|true/.test(nativeBind + isIeOpera);\n\n    /** Used to lookup a built-in constructor by [[Class]] */\n    var ctorByClass = {};\n    ctorByClass[arrayClass] = Array;\n    ctorByClass[boolClass] = Boolean;\n    ctorByClass[dateClass] = Date;\n    ctorByClass[funcClass] = Function;\n    ctorByClass[objectClass] = Object;\n    ctorByClass[numberClass] = Number;\n    ctorByClass[regexpClass] = RegExp;\n    ctorByClass[stringClass] = String;\n\n    /*--------------------------------------------------------------------------*/\n\n    /**\n     * Creates a `lodash` object which wraps the given value to enable intuitive\n     * method chaining.\n     *\n     * In addition to Lo-Dash methods, wrappers also have the following `Array` methods:\n     * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`,\n     * and `unshift`\n     *\n     * Chaining is supported in custom builds as long as the `value` method is\n     * implicitly or explicitly included in the build.\n     *\n     * The chainable wrapper functions are:\n     * `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`,\n     * `compose`, `concat`, `countBy`, `createCallback`, `curry`, `debounce`,\n     * `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`,\n     * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`,\n     * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,\n     * `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, `once`, `pairs`,\n     * `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`, `range`, `reject`,\n     * `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,\n     * `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`,\n     * `unzip`, `values`, `where`, `without`, `wrap`, and `zip`\n     *\n     * The non-chainable wrapper functions are:\n     * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `findIndex`,\n     * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `has`, `identity`,\n     * `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,\n     * `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`,\n     * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`,\n     * `lastIndexOf`, `mixin`, `noConflict`, `parseInt`, `pop`, `random`, `reduce`,\n     * `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `runInContext`,\n     * `template`, `unescape`, `uniqueId`, and `value`\n     *\n     * The wrapper functions `first` and `last` return wrapped values when `n` is\n     * provided, otherwise they return unwrapped values.\n     *\n     * Explicit chaining can be enabled by using the `_.chain` method.\n     *\n     * @name _\n     * @constructor\n     * @category Chaining\n     * @param {*} value The value to wrap in a `lodash` instance.\n     * @returns {Object} Returns a `lodash` instance.\n     * @example\n     *\n     * var wrapped = _([1, 2, 3]);\n     *\n     * // returns an unwrapped value\n     * wrapped.reduce(function(sum, num) {\n     *   return sum + num;\n     * });\n     * // => 6\n     *\n     * // returns a wrapped value\n     * var squares = wrapped.map(function(num) {\n     *   return num * num;\n     * });\n     *\n     * _.isArray(squares);\n     * // => false\n     *\n     * _.isArray(squares.value());\n     * // => true\n     */\n    function lodash(value) {\n      // don't wrap if already wrapped, even if wrapped by a different `lodash` constructor\n      return (value && typeof value == 'object' && !isArray(value) && hasOwnProperty.call(value, '__wrapped__'))\n       ? value\n       : new lodashWrapper(value);\n    }\n\n    /**\n     * A fast path for creating `lodash` wrapper objects.\n     *\n     * @private\n     * @param {*} value The value to wrap in a `lodash` instance.\n     * @param {boolean} chainAll A flag to enable chaining for all methods\n     * @returns {Object} Returns a `lodash` instance.\n     */\n    function lodashWrapper(value, chainAll) {\n      this.__chain__ = !!chainAll;\n      this.__wrapped__ = value;\n    }\n    // ensure `new lodashWrapper` is an instance of `lodash`\n    lodashWrapper.prototype = lodash.prototype;\n\n    /**\n     * An object used to flag environments features.\n     *\n     * @static\n     * @memberOf _\n     * @type Object\n     */\n    var support = lodash.support = {};\n\n    /**\n     * Detect if `Function#bind` exists and is inferred to be fast (all but V8).\n     *\n     * @memberOf _.support\n     * @type boolean\n     */\n    support.fastBind = nativeBind && !isV8;\n\n    /**\n     * Detect if functions can be decompiled by `Function#toString`\n     * (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps).\n     *\n     * @memberOf _.support\n     * @type boolean\n     */\n    support.funcDecomp = !reNative.test(context.WinRTError) && reThis.test(runInContext);\n\n    /**\n     * Detect if `Function#name` is supported (all but IE).\n     *\n     * @memberOf _.support\n     * @type boolean\n     */\n    support.funcNames = typeof Function.name == 'string';\n\n    /**\n     * By default, the template delimiters used by Lo-Dash are similar to those in\n     * embedded Ruby (ERB). Change the following template settings to use alternative\n     * delimiters.\n     *\n     * @static\n     * @memberOf _\n     * @type Object\n     */\n    lodash.templateSettings = {\n\n      /**\n       * Used to detect `data` property values to be HTML-escaped.\n       *\n       * @memberOf _.templateSettings\n       * @type RegExp\n       */\n      'escape': /<%-([\\s\\S]+?)%>/g,\n\n      /**\n       * Used to detect code to be evaluated.\n       *\n       * @memberOf _.templateSettings\n       * @type RegExp\n       */\n      'evaluate': /<%([\\s\\S]+?)%>/g,\n\n      /**\n       * Used to detect `data` property values to inject.\n       *\n       * @memberOf _.templateSettings\n       * @type RegExp\n       */\n      'interpolate': reInterpolate,\n\n      /**\n       * Used to reference the data object in the template text.\n       *\n       * @memberOf _.templateSettings\n       * @type string\n       */\n      'variable': '',\n\n      /**\n       * Used to import variables into the compiled template.\n       *\n       * @memberOf _.templateSettings\n       * @type Object\n       */\n      'imports': {\n\n        /**\n         * A reference to the `lodash` function.\n         *\n         * @memberOf _.templateSettings.imports\n         * @type Function\n         */\n        '_': lodash\n      }\n    };\n\n    /*--------------------------------------------------------------------------*/\n\n    /**\n     * The base implementation of `_.clone` without argument juggling or support\n     * for `thisArg` binding.\n     *\n     * @private\n     * @param {*} value The value to clone.\n     * @param {boolean} [deep=false] Specify a deep clone.\n     * @param {Function} [callback] The function to customize cloning values.\n     * @param {Array} [stackA=[]] Tracks traversed source objects.\n     * @param {Array} [stackB=[]] Associates clones with source counterparts.\n     * @returns {*} Returns the cloned value.\n     */\n    function baseClone(value, deep, callback, stackA, stackB) {\n      if (callback) {\n        var result = callback(value);\n        if (typeof result != 'undefined') {\n          return result;\n        }\n      }\n      // inspect [[Class]]\n      var isObj = isObject(value);\n      if (isObj) {\n        var className = toString.call(value);\n        if (!cloneableClasses[className]) {\n          return value;\n        }\n        var ctor = ctorByClass[className];\n        switch (className) {\n          case boolClass:\n          case dateClass:\n            return new ctor(+value);\n\n          case numberClass:\n          case stringClass:\n            return new ctor(value);\n\n          case regexpClass:\n            result = ctor(value.source, reFlags.exec(value));\n            result.lastIndex = value.lastIndex;\n            return result;\n        }\n      } else {\n        return value;\n      }\n      var isArr = isArray(value);\n      if (deep) {\n        // check for circular references and return corresponding clone\n        var initedStack = !stackA;\n        stackA || (stackA = getArray());\n        stackB || (stackB = getArray());\n\n        var length = stackA.length;\n        while (length--) {\n          if (stackA[length] == value) {\n            return stackB[length];\n          }\n        }\n        result = isArr ? ctor(value.length) : {};\n      }\n      else {\n        result = isArr ? slice(value) : assign({}, value);\n      }\n      // add array properties assigned by `RegExp#exec`\n      if (isArr) {\n        if (hasOwnProperty.call(value, 'index')) {\n          result.index = value.index;\n        }\n        if (hasOwnProperty.call(value, 'input')) {\n          result.input = value.input;\n        }\n      }\n      // exit for shallow clone\n      if (!deep) {\n        return result;\n      }\n      // add the source value to the stack of traversed objects\n      // and associate it with its clone\n      stackA.push(value);\n      stackB.push(result);\n\n      // recursively populate clone (susceptible to call stack limits)\n      (isArr ? forEach : forOwn)(value, function(objValue, key) {\n        result[key] = baseClone(objValue, deep, callback, stackA, stackB);\n      });\n\n      if (initedStack) {\n        releaseArray(stackA);\n        releaseArray(stackB);\n      }\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.createCallback` without support for creating\n     * \"_.pluck\" or \"_.where\" style callbacks.\n     *\n     * @private\n     * @param {*} [func=identity] The value to convert to a callback.\n     * @param {*} [thisArg] The `this` binding of the created callback.\n     * @param {number} [argCount] The number of arguments the callback accepts.\n     * @returns {Function} Returns a callback function.\n     */\n    function baseCreateCallback(func, thisArg, argCount) {\n      if (typeof func != 'function') {\n        return identity;\n      }\n      // exit early if there is no `thisArg`\n      if (typeof thisArg == 'undefined') {\n        return func;\n      }\n      var bindData = func.__bindData__ || (support.funcNames && !func.name);\n      if (typeof bindData == 'undefined') {\n        var source = reThis && fnToString.call(func);\n        if (!support.funcNames && source && !reFuncName.test(source)) {\n          bindData = true;\n        }\n        if (support.funcNames || !bindData) {\n          // checks if `func` references the `this` keyword and stores the result\n          bindData = !support.funcDecomp || reThis.test(source);\n          setBindData(func, bindData);\n        }\n      }\n      // exit early if there are no `this` references or `func` is bound\n      if (bindData !== true && (bindData && bindData[1] & 1)) {\n        return func;\n      }\n      switch (argCount) {\n        case 1: return function(value) {\n          return func.call(thisArg, value);\n        };\n        case 2: return function(a, b) {\n          return func.call(thisArg, a, b);\n        };\n        case 3: return function(value, index, collection) {\n          return func.call(thisArg, value, index, collection);\n        };\n        case 4: return function(accumulator, value, index, collection) {\n          return func.call(thisArg, accumulator, value, index, collection);\n        };\n      }\n      return bind(func, thisArg);\n    }\n\n    /**\n     * The base implementation of `_.flatten` without support for callback\n     * shorthands or `thisArg` binding.\n     *\n     * @private\n     * @param {Array} array The array to flatten.\n     * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level.\n     * @param {boolean} [isArgArrays=false] A flag to restrict flattening to arrays and `arguments` objects.\n     * @param {number} [fromIndex=0] The index to start from.\n     * @returns {Array} Returns a new flattened array.\n     */\n    function baseFlatten(array, isShallow, isArgArrays, fromIndex) {\n      var index = (fromIndex || 0) - 1,\n          length = array ? array.length : 0,\n          result = [];\n\n      while (++index < length) {\n        var value = array[index];\n\n        if (value && typeof value == 'object' && typeof value.length == 'number'\n            && (isArray(value) || isArguments(value))) {\n          // recursively flatten arrays (susceptible to call stack limits)\n          if (!isShallow) {\n            value = baseFlatten(value, isShallow, isArgArrays);\n          }\n          var valIndex = -1,\n              valLength = value.length,\n              resIndex = result.length;\n\n          result.length += valLength;\n          while (++valIndex < valLength) {\n            result[resIndex++] = value[valIndex];\n          }\n        } else if (!isArgArrays) {\n          result.push(value);\n        }\n      }\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.isEqual`, without support for `thisArg` binding,\n     * that allows partial \"_.where\" style comparisons.\n     *\n     * @private\n     * @param {*} a The value to compare.\n     * @param {*} b The other value to compare.\n     * @param {Function} [callback] The function to customize comparing values.\n     * @param {Function} [isWhere=false] A flag to indicate performing partial comparisons.\n     * @param {Array} [stackA=[]] Tracks traversed `a` objects.\n     * @param {Array} [stackB=[]] Tracks traversed `b` objects.\n     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n     */\n    function baseIsEqual(a, b, callback, isWhere, stackA, stackB) {\n      // used to indicate that when comparing objects, `a` has at least the properties of `b`\n      if (callback) {\n        var result = callback(a, b);\n        if (typeof result != 'undefined') {\n          return !!result;\n        }\n      }\n      // exit early for identical values\n      if (a === b) {\n        // treat `+0` vs. `-0` as not equal\n        return a !== 0 || (1 / a == 1 / b);\n      }\n      var type = typeof a,\n          otherType = typeof b;\n\n      // exit early for unlike primitive values\n      if (a === a &&\n          !(a && objectTypes[type]) &&\n          !(b && objectTypes[otherType])) {\n        return false;\n      }\n      // exit early for `null` and `undefined` avoiding ES3's Function#call behavior\n      // http://es5.github.io/#x15.3.4.4\n      if (a == null || b == null) {\n        return a === b;\n      }\n      // compare [[Class]] names\n      var className = toString.call(a),\n          otherClass = toString.call(b);\n\n      if (className == argsClass) {\n        className = objectClass;\n      }\n      if (otherClass == argsClass) {\n        otherClass = objectClass;\n      }\n      if (className != otherClass) {\n        return false;\n      }\n      switch (className) {\n        case boolClass:\n        case dateClass:\n          // coerce dates and booleans to numbers, dates to milliseconds and booleans\n          // to `1` or `0` treating invalid dates coerced to `NaN` as not equal\n          return +a == +b;\n\n        case numberClass:\n          // treat `NaN` vs. `NaN` as equal\n          return (a != +a)\n            ? b != +b\n            // but treat `+0` vs. `-0` as not equal\n            : (a == 0 ? (1 / a == 1 / b) : a == +b);\n\n        case regexpClass:\n        case stringClass:\n          // coerce regexes to strings (http://es5.github.io/#x15.10.6.4)\n          // treat string primitives and their corresponding object instances as equal\n          return a == String(b);\n      }\n      var isArr = className == arrayClass;\n      if (!isArr) {\n        // unwrap any `lodash` wrapped values\n        if (hasOwnProperty.call(a, '__wrapped__ ') || hasOwnProperty.call(b, '__wrapped__')) {\n          return baseIsEqual(a.__wrapped__ || a, b.__wrapped__ || b, callback, isWhere, stackA, stackB);\n        }\n        // exit for functions and DOM nodes\n        if (className != objectClass) {\n          return false;\n        }\n        // in older versions of Opera, `arguments` objects have `Array` constructors\n        var ctorA = a.constructor,\n            ctorB = b.constructor;\n\n        // non `Object` object instances with different constructors are not equal\n        if (ctorA != ctorB && !(\n              isFunction(ctorA) && ctorA instanceof ctorA &&\n              isFunction(ctorB) && ctorB instanceof ctorB\n            )) {\n          return false;\n        }\n      }\n      // assume cyclic structures are equal\n      // the algorithm for detecting cyclic structures is adapted from ES 5.1\n      // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)\n      var initedStack = !stackA;\n      stackA || (stackA = getArray());\n      stackB || (stackB = getArray());\n\n      var length = stackA.length;\n      while (length--) {\n        if (stackA[length] == a) {\n          return stackB[length] == b;\n        }\n      }\n      var size = 0;\n      result = true;\n\n      // add `a` and `b` to the stack of traversed objects\n      stackA.push(a);\n      stackB.push(b);\n\n      // recursively compare objects and arrays (susceptible to call stack limits)\n      if (isArr) {\n        length = a.length;\n        size = b.length;\n\n        // compare lengths to determine if a deep comparison is necessary\n        result = size == a.length;\n        if (!result && !isWhere) {\n          return result;\n        }\n        // deep compare the contents, ignoring non-numeric properties\n        while (size--) {\n          var index = length,\n              value = b[size];\n\n          if (isWhere) {\n            while (index--) {\n              if ((result = baseIsEqual(a[index], value, callback, isWhere, stackA, stackB))) {\n                break;\n              }\n            }\n          } else if (!(result = baseIsEqual(a[size], value, callback, isWhere, stackA, stackB))) {\n            break;\n          }\n        }\n        return result;\n      }\n      // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`\n      // which, in this case, is more costly\n      forIn(b, function(value, key, b) {\n        if (hasOwnProperty.call(b, key)) {\n          // count the number of properties.\n          size++;\n          // deep compare each property value.\n          return (result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, callback, isWhere, stackA, stackB));\n        }\n      });\n\n      if (result && !isWhere) {\n        // ensure both objects have the same number of properties\n        forIn(a, function(value, key, a) {\n          if (hasOwnProperty.call(a, key)) {\n            // `size` will be `-1` if `a` has more properties than `b`\n            return (result = --size > -1);\n          }\n        });\n      }\n      if (initedStack) {\n        releaseArray(stackA);\n        releaseArray(stackB);\n      }\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.merge` without argument juggling or support\n     * for `thisArg` binding.\n     *\n     * @private\n     * @param {Object} object The destination object.\n     * @param {Object} source The source object.\n     * @param {Function} [callback] The function to customize merging properties.\n     * @param {Array} [stackA=[]] Tracks traversed source objects.\n     * @param {Array} [stackB=[]] Associates values with source counterparts.\n     */\n    function baseMerge(object, source, callback, stackA, stackB) {\n      (isArray(source) ? forEach : forOwn)(source, function(source, key) {\n        var found,\n            isArr,\n            result = source,\n            value = object[key];\n\n        if (source && ((isArr = isArray(source)) || isPlainObject(source))) {\n          // avoid merging previously merged cyclic sources\n          var stackLength = stackA.length;\n          while (stackLength--) {\n            if ((found = stackA[stackLength] == source)) {\n              value = stackB[stackLength];\n              break;\n            }\n          }\n          if (!found) {\n            var isShallow;\n            if (callback) {\n              result = callback(value, source);\n              if ((isShallow = typeof result != 'undefined')) {\n                value = result;\n              }\n            }\n            if (!isShallow) {\n              value = isArr\n                ? (isArray(value) ? value : [])\n                : (isPlainObject(value) ? value : {});\n            }\n            // add `source` and associated `value` to the stack of traversed objects\n            stackA.push(source);\n            stackB.push(value);\n\n            // recursively merge objects and arrays (susceptible to call stack limits)\n            if (!isShallow) {\n              baseMerge(value, source, callback, stackA, stackB);\n            }\n          }\n        }\n        else {\n          if (callback) {\n            result = callback(value, source);\n            if (typeof result == 'undefined') {\n              result = source;\n            }\n          }\n          if (typeof result != 'undefined') {\n            value = result;\n          }\n        }\n        object[key] = value;\n      });\n    }\n\n    /**\n     * The base implementation of `_.uniq` without support for callback shorthands\n     * or `thisArg` binding.\n     *\n     * @private\n     * @param {Array} array The array to process.\n     * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted.\n     * @param {Function} [callback] The function called per iteration.\n     * @returns {Array} Returns a duplicate-value-free array.\n     */\n    function baseUniq(array, isSorted, callback) {\n      var index = -1,\n          indexOf = getIndexOf(),\n          length = array ? array.length : 0,\n          result = [];\n\n      var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf,\n          seen = (callback || isLarge) ? getArray() : result;\n\n      if (isLarge) {\n        var cache = createCache(seen);\n        if (cache) {\n          indexOf = cacheIndexOf;\n          seen = cache;\n        } else {\n          isLarge = false;\n          seen = callback ? seen : (releaseArray(seen), result);\n        }\n      }\n      while (++index < length) {\n        var value = array[index],\n            computed = callback ? callback(value, index, array) : value;\n\n        if (isSorted\n              ? !index || seen[seen.length - 1] !== computed\n              : indexOf(seen, computed) < 0\n            ) {\n          if (callback || isLarge) {\n            seen.push(computed);\n          }\n          result.push(value);\n        }\n      }\n      if (isLarge) {\n        releaseArray(seen.array);\n        releaseObject(seen);\n      } else if (callback) {\n        releaseArray(seen);\n      }\n      return result;\n    }\n\n    /**\n     * Creates a function that aggregates a collection, creating an object composed\n     * of keys generated from the results of running each element of the collection\n     * through a callback. The given `setter` function sets the keys and values\n     * of the composed object.\n     *\n     * @private\n     * @param {Function} setter The setter function.\n     * @returns {Function} Returns the new aggregator function.\n     */\n    function createAggregator(setter) {\n      return function(collection, callback, thisArg) {\n        var result = {};\n        callback = lodash.createCallback(callback, thisArg, 3);\n\n        var index = -1,\n            length = collection ? collection.length : 0;\n\n        if (typeof length == 'number') {\n          while (++index < length) {\n            var value = collection[index];\n            setter(result, value, callback(value, index, collection), collection);\n          }\n        } else {\n          forOwn(collection, function(value, key, collection) {\n            setter(result, value, callback(value, key, collection), collection);\n          });\n        }\n        return result;\n      };\n    }\n\n    /**\n     * Creates a function that, when called, either curries or invokes `func`\n     * with an optional `this` binding and partially applied arguments.\n     *\n     * @private\n     * @param {Function|string} func The function or method name to reference.\n     * @param {number} bitmask The bitmask of method flags to compose.\n     *  The bitmask may be composed of the following flags:\n     *  1 - `_.bind`\n     *  2 - `_.bindKey`\n     *  4 - `_.curry`\n     *  8 - `_.curry` (bound)\n     *  16 - `_.partial`\n     *  32 - `_.partialRight`\n     * @param {Array} [partialArgs] An array of arguments to prepend to those\n     *  provided to the new function.\n     * @param {Array} [partialRightArgs] An array of arguments to append to those\n     *  provided to the new function.\n     * @param {*} [thisArg] The `this` binding of `func`.\n     * @param {number} [arity] The arity of `func`.\n     * @returns {Function} Returns the new bound function.\n     */\n    function createBound(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) {\n      var isBind = bitmask & 1,\n          isBindKey = bitmask & 2,\n          isCurry = bitmask & 4,\n          isCurryBound = bitmask & 8,\n          isPartial = bitmask & 16,\n          isPartialRight = bitmask & 32,\n          key = func;\n\n      if (!isBindKey && !isFunction(func)) {\n        throw new TypeError;\n      }\n      if (isPartial && !partialArgs.length) {\n        bitmask &= ~16;\n        isPartial = partialArgs = false;\n      }\n      if (isPartialRight && !partialRightArgs.length) {\n        bitmask &= ~32;\n        isPartialRight = partialRightArgs = false;\n      }\n      var bindData = func && func.__bindData__;\n      if (bindData) {\n        if (isBind && !(bindData[1] & 1)) {\n          bindData[4] = thisArg;\n        }\n        if (!isBind && bindData[1] & 1) {\n          bitmask |= 8;\n        }\n        if (isCurry && !(bindData[1] & 4)) {\n          bindData[5] = arity;\n        }\n        if (isPartial) {\n          push.apply(bindData[2] || (bindData[2] = []), partialArgs);\n        }\n        if (isPartialRight) {\n          push.apply(bindData[3] || (bindData[3] = []), partialRightArgs);\n        }\n        bindData[1] |= bitmask;\n        return createBound.apply(null, bindData);\n      }\n      // use `Function#bind` if it exists and is fast\n      // (in V8 `Function#bind` is slower except when partially applied)\n      if (isBind && !(isBindKey || isCurry || isPartialRight) &&\n          (support.fastBind || (nativeBind && isPartial))) {\n        if (isPartial) {\n          var args = [thisArg];\n          push.apply(args, partialArgs);\n        }\n        var bound = isPartial\n          ? nativeBind.apply(func, args)\n          : nativeBind.call(func, thisArg);\n      }\n      else {\n        bound = function() {\n          // `Function#bind` spec\n          // http://es5.github.io/#x15.3.4.5\n          var args = arguments,\n              thisBinding = isBind ? thisArg : this;\n\n          if (isCurry || isPartial || isPartialRight) {\n            args = nativeSlice.call(args);\n            if (isPartial) {\n              unshift.apply(args, partialArgs);\n            }\n            if (isPartialRight) {\n              push.apply(args, partialRightArgs);\n            }\n            if (isCurry && args.length < arity) {\n              bitmask |= 16 & ~32;\n              return createBound(func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity);\n            }\n          }\n          if (isBindKey) {\n            func = thisBinding[key];\n          }\n          if (this instanceof bound) {\n            // ensure `new bound` is an instance of `func`\n            thisBinding = createObject(func.prototype);\n\n            // mimic the constructor's `return` behavior\n            // http://es5.github.io/#x13.2.2\n            var result = func.apply(thisBinding, args);\n            return isObject(result) ? result : thisBinding;\n          }\n          return func.apply(thisBinding, args);\n        };\n      }\n      setBindData(bound, nativeSlice.call(arguments));\n      return bound;\n    }\n\n    /**\n     * Creates a new object with the specified `prototype`.\n     *\n     * @private\n     * @param {Object} prototype The prototype object.\n     * @returns {Object} Returns the new object.\n     */\n    function createObject(prototype) {\n      return isObject(prototype) ? nativeCreate(prototype) : {};\n    }\n    // fallback for browsers without `Object.create`\n    if (!nativeCreate) {\n      createObject = function(prototype) {\n        if (isObject(prototype)) {\n          noop.prototype = prototype;\n          var result = new noop;\n          noop.prototype = null;\n        }\n        return result || {};\n      };\n    }\n\n    /**\n     * Used by `escape` to convert characters to HTML entities.\n     *\n     * @private\n     * @param {string} match The matched character to escape.\n     * @returns {string} Returns the escaped character.\n     */\n    function escapeHtmlChar(match) {\n      return htmlEscapes[match];\n    }\n\n    /**\n     * Gets the appropriate \"indexOf\" function. If the `_.indexOf` method is\n     * customized, this method returns the custom method, otherwise it returns\n     * the `baseIndexOf` function.\n     *\n     * @private\n     * @returns {Function} Returns the \"indexOf\" function.\n     */\n    function getIndexOf() {\n      var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result;\n      return result;\n    }\n\n    /**\n     * Sets `this` binding data on a given function.\n     *\n     * @private\n     * @param {Function} func The function to set data on.\n     * @param {*} value The value to set.\n     */\n    var setBindData = !defineProperty ? noop : function(func, value) {\n      descriptor.value = value;\n      defineProperty(func, '__bindData__', descriptor);\n    };\n\n    /**\n     * A fallback implementation of `isPlainObject` which checks if a given value\n     * is an object created by the `Object` constructor, assuming objects created\n     * by the `Object` constructor have no inherited enumerable properties and that\n     * there are no `Object.prototype` extensions.\n     *\n     * @private\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n     */\n    function shimIsPlainObject(value) {\n      var ctor,\n          result;\n\n      // avoid non Object objects, `arguments` objects, and DOM elements\n      if (!(value && toString.call(value) == objectClass) ||\n          (ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor))) {\n        return false;\n      }\n      // In most environments an object's own properties are iterated before\n      // its inherited properties. If the last iterated property is an object's\n      // own property then there are no inherited enumerable properties.\n      forIn(value, function(value, key) {\n        result = key;\n      });\n      return typeof result == 'undefined' || hasOwnProperty.call(value, result);\n    }\n\n    /**\n     * Used by `unescape` to convert HTML entities to characters.\n     *\n     * @private\n     * @param {string} match The matched character to unescape.\n     * @returns {string} Returns the unescaped character.\n     */\n    function unescapeHtmlChar(match) {\n      return htmlUnescapes[match];\n    }\n\n    /*--------------------------------------------------------------------------*/\n\n    /**\n     * Checks if `value` is an `arguments` object.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`.\n     * @example\n     *\n     * (function() { return _.isArguments(arguments); })(1, 2, 3);\n     * // => true\n     *\n     * _.isArguments([1, 2, 3]);\n     * // => false\n     */\n    function isArguments(value) {\n      return value && typeof value == 'object' && typeof value.length == 'number' &&\n        toString.call(value) == argsClass || false;\n    }\n\n    /**\n     * Checks if `value` is an array.\n     *\n     * @static\n     * @memberOf _\n     * @type Function\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is an array, else `false`.\n     * @example\n     *\n     * (function() { return _.isArray(arguments); })();\n     * // => false\n     *\n     * _.isArray([1, 2, 3]);\n     * // => true\n     */\n    var isArray = nativeIsArray || function(value) {\n      return value && typeof value == 'object' && typeof value.length == 'number' &&\n        toString.call(value) == arrayClass || false;\n    };\n\n    /**\n     * A fallback implementation of `Object.keys` which produces an array of the\n     * given object's own enumerable property names.\n     *\n     * @private\n     * @type Function\n     * @param {Object} object The object to inspect.\n     * @returns {Array} Returns an array of property names.\n     */\n    var shimKeys = function(object) {\n      var index, iterable = object, result = [];\n      if (!iterable) return result;\n      if (!(objectTypes[typeof object])) return result;\n        for (index in iterable) {\n          if (hasOwnProperty.call(iterable, index)) {\n            result.push(index);\n          }\n        }\n      return result\n    };\n\n    /**\n     * Creates an array composed of the own enumerable property names of an object.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The object to inspect.\n     * @returns {Array} Returns an array of property names.\n     * @example\n     *\n     * _.keys({ 'one': 1, 'two': 2, 'three': 3 });\n     * // => ['one', 'two', 'three'] (property order is not guaranteed across environments)\n     */\n    var keys = !nativeKeys ? shimKeys : function(object) {\n      if (!isObject(object)) {\n        return [];\n      }\n      return nativeKeys(object);\n    };\n\n    /**\n     * Used to convert characters to HTML entities:\n     *\n     * Though the `>` character is escaped for symmetry, characters like `>` and `/`\n     * don't require escaping in HTML and have no special meaning unless they're part\n     * of a tag or an unquoted attribute value.\n     * http://mathiasbynens.be/notes/ambiguous-ampersands (under \"semi-related fun fact\")\n     */\n    var htmlEscapes = {\n      '&': '&amp;',\n      '<': '&lt;',\n      '>': '&gt;',\n      '\"': '&quot;',\n      \"'\": '&#39;'\n    };\n\n    /** Used to convert HTML entities to characters */\n    var htmlUnescapes = invert(htmlEscapes);\n\n    /** Used to match HTML entities and HTML characters */\n    var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'),\n        reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g');\n\n    /*--------------------------------------------------------------------------*/\n\n    /**\n     * Assigns own enumerable properties of source object(s) to the destination\n     * object. Subsequent sources will overwrite property assignments of previous\n     * sources. If a callback is provided it will be executed to produce the\n     * assigned values. The callback is bound to `thisArg` and invoked with two\n     * arguments; (objectValue, sourceValue).\n     *\n     * @static\n     * @memberOf _\n     * @type Function\n     * @alias extend\n     * @category Objects\n     * @param {Object} object The destination object.\n     * @param {...Object} [source] The source objects.\n     * @param {Function} [callback] The function to customize assigning values.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Object} Returns the destination object.\n     * @example\n     *\n     * _.assign({ 'name': 'moe' }, { 'age': 40 });\n     * // => { 'name': 'moe', 'age': 40 }\n     *\n     * var defaults = _.partialRight(_.assign, function(a, b) {\n     *   return typeof a == 'undefined' ? b : a;\n     * });\n     *\n     * var food = { 'name': 'apple' };\n     * defaults(food, { 'name': 'banana', 'type': 'fruit' });\n     * // => { 'name': 'apple', 'type': 'fruit' }\n     */\n    var assign = function(object, source, guard) {\n      var index, iterable = object, result = iterable;\n      if (!iterable) return result;\n      var args = arguments,\n          argsIndex = 0,\n          argsLength = typeof guard == 'number' ? 2 : args.length;\n      if (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n        var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2);\n      } else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n        callback = args[--argsLength];\n      }\n      while (++argsIndex < argsLength) {\n        iterable = args[argsIndex];\n        if (iterable && objectTypes[typeof iterable]) {\n        var ownIndex = -1,\n            ownProps = objectTypes[typeof iterable] && keys(iterable),\n            length = ownProps ? ownProps.length : 0;\n\n        while (++ownIndex < length) {\n          index = ownProps[ownIndex];\n          result[index] = callback ? callback(result[index], iterable[index]) : iterable[index];\n        }\n        }\n      }\n      return result\n    };\n\n    /**\n     * Creates a clone of `value`. If `deep` is `true` nested objects will also\n     * be cloned, otherwise they will be assigned by reference. If a callback\n     * is provided it will be executed to produce the cloned values. If the\n     * callback returns `undefined` cloning will be handled by the method instead.\n     * The callback is bound to `thisArg` and invoked with one argument; (value).\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to clone.\n     * @param {boolean} [deep=false] Specify a deep clone.\n     * @param {Function} [callback] The function to customize cloning values.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {*} Returns the cloned value.\n     * @example\n     *\n     * var stooges = [\n     *   { 'name': 'moe', 'age': 40 },\n     *   { 'name': 'larry', 'age': 50 }\n     * ];\n     *\n     * var shallow = _.clone(stooges);\n     * shallow[0] === stooges[0];\n     * // => true\n     *\n     * var deep = _.clone(stooges, true);\n     * deep[0] === stooges[0];\n     * // => false\n     *\n     * _.mixin({\n     *   'clone': _.partialRight(_.clone, function(value) {\n     *     return _.isElement(value) ? value.cloneNode(false) : undefined;\n     *   })\n     * });\n     *\n     * var clone = _.clone(document.body);\n     * clone.childNodes.length;\n     * // => 0\n     */\n    function clone(value, deep, callback, thisArg) {\n      // allows working with \"Collections\" methods without using their `index`\n      // and `collection` arguments for `deep` and `callback`\n      if (typeof deep != 'boolean' && deep != null) {\n        thisArg = callback;\n        callback = deep;\n        deep = false;\n      }\n      return baseClone(value, deep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1));\n    }\n\n    /**\n     * Creates a deep clone of `value`. If a callback is provided it will be\n     * executed to produce the cloned values. If the callback returns `undefined`\n     * cloning will be handled by the method instead. The callback is bound to\n     * `thisArg` and invoked with one argument; (value).\n     *\n     * Note: This method is loosely based on the structured clone algorithm. Functions\n     * and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and\n     * objects created by constructors other than `Object` are cloned to plain `Object` objects.\n     * See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to deep clone.\n     * @param {Function} [callback] The function to customize cloning values.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {*} Returns the deep cloned value.\n     * @example\n     *\n     * var stooges = [\n     *   { 'name': 'moe', 'age': 40 },\n     *   { 'name': 'larry', 'age': 50 }\n     * ];\n     *\n     * var deep = _.cloneDeep(stooges);\n     * deep[0] === stooges[0];\n     * // => false\n     *\n     * var view = {\n     *   'label': 'docs',\n     *   'node': element\n     * };\n     *\n     * var clone = _.cloneDeep(view, function(value) {\n     *   return _.isElement(value) ? value.cloneNode(true) : undefined;\n     * });\n     *\n     * clone.node == view.node;\n     * // => false\n     */\n    function cloneDeep(value, callback, thisArg) {\n      return baseClone(value, true, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1));\n    }\n\n    /**\n     * Assigns own enumerable properties of source object(s) to the destination\n     * object for all destination properties that resolve to `undefined`. Once a\n     * property is set, additional defaults of the same property will be ignored.\n     *\n     * @static\n     * @memberOf _\n     * @type Function\n     * @category Objects\n     * @param {Object} object The destination object.\n     * @param {...Object} [source] The source objects.\n     * @param- {Object} [guard] Allows working with `_.reduce` without using its\n     *  `key` and `object` arguments as sources.\n     * @returns {Object} Returns the destination object.\n     * @example\n     *\n     * var food = { 'name': 'apple' };\n     * _.defaults(food, { 'name': 'banana', 'type': 'fruit' });\n     * // => { 'name': 'apple', 'type': 'fruit' }\n     */\n    var defaults = function(object, source, guard) {\n      var index, iterable = object, result = iterable;\n      if (!iterable) return result;\n      var args = arguments,\n          argsIndex = 0,\n          argsLength = typeof guard == 'number' ? 2 : args.length;\n      while (++argsIndex < argsLength) {\n        iterable = args[argsIndex];\n        if (iterable && objectTypes[typeof iterable]) {\n        var ownIndex = -1,\n            ownProps = objectTypes[typeof iterable] && keys(iterable),\n            length = ownProps ? ownProps.length : 0;\n\n        while (++ownIndex < length) {\n          index = ownProps[ownIndex];\n          if (typeof result[index] == 'undefined') result[index] = iterable[index];\n        }\n        }\n      }\n      return result\n    };\n\n    /**\n     * This method is like `_.findIndex` except that it returns the key of the\n     * first element that passes the callback check, instead of the element itself.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The object to search.\n     * @param {Function|Object|string} [callback=identity] The function called per\n     *  iteration. If a property name or object is provided it will be used to\n     *  create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {string|undefined} Returns the key of the found element, else `undefined`.\n     * @example\n     *\n     * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {\n     *   return num % 2 == 0;\n     * });\n     * // => 'b' (property order is not guaranteed across environments)\n     */\n    function findKey(object, callback, thisArg) {\n      var result;\n      callback = lodash.createCallback(callback, thisArg, 3);\n      forOwn(object, function(value, key, object) {\n        if (callback(value, key, object)) {\n          result = key;\n          return false;\n        }\n      });\n      return result;\n    }\n\n    /**\n     * This method is like `_.findKey` except that it iterates over elements\n     * of a `collection` in the opposite order.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The object to search.\n     * @param {Function|Object|string} [callback=identity] The function called per\n     *  iteration. If a property name or object is provided it will be used to\n     *  create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {string|undefined} Returns the key of the found element, else `undefined`.\n     * @example\n     *\n     * _.findLastKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {\n     *   return num % 2 == 1;\n     * });\n     * // => returns `c`, assuming `_.findKey` returns `a`\n     */\n    function findLastKey(object, callback, thisArg) {\n      var result;\n      callback = lodash.createCallback(callback, thisArg, 3);\n      forOwnRight(object, function(value, key, object) {\n        if (callback(value, key, object)) {\n          result = key;\n          return false;\n        }\n      });\n      return result;\n    }\n\n    /**\n     * Iterates over own and inherited enumerable properties of an object,\n     * executing the callback for each property. The callback is bound to `thisArg`\n     * and invoked with three arguments; (value, key, object). Callbacks may exit\n     * iteration early by explicitly returning `false`.\n     *\n     * @static\n     * @memberOf _\n     * @type Function\n     * @category Objects\n     * @param {Object} object The object to iterate over.\n     * @param {Function} [callback=identity] The function called per iteration.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * function Dog(name) {\n     *   this.name = name;\n     * }\n     *\n     * Dog.prototype.bark = function() {\n     *   console.log('Woof, woof!');\n     * };\n     *\n     * _.forIn(new Dog('Dagny'), function(value, key) {\n     *   console.log(key);\n     * });\n     * // => logs 'bark' and 'name' (property order is not guaranteed across environments)\n     */\n    var forIn = function(collection, callback, thisArg) {\n      var index, iterable = collection, result = iterable;\n      if (!iterable) return result;\n      if (!objectTypes[typeof iterable]) return result;\n      callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3);\n        for (index in iterable) {\n          if (callback(iterable[index], index, collection) === false) return result;\n        }\n      return result\n    };\n\n    /**\n     * This method is like `_.forIn` except that it iterates over elements\n     * of a `collection` in the opposite order.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The object to iterate over.\n     * @param {Function} [callback=identity] The function called per iteration.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * function Dog(name) {\n     *   this.name = name;\n     * }\n     *\n     * Dog.prototype.bark = function() {\n     *   console.log('Woof, woof!');\n     * };\n     *\n     * _.forInRight(new Dog('Dagny'), function(value, key) {\n     *   console.log(key);\n     * });\n     * // => logs 'name' and 'bark' assuming `_.forIn ` logs 'bark' and 'name'\n     */\n    function forInRight(object, callback, thisArg) {\n      var pairs = [];\n\n      forIn(object, function(value, key) {\n        pairs.push(key, value);\n      });\n\n      var length = pairs.length;\n      callback = baseCreateCallback(callback, thisArg, 3);\n      while (length--) {\n        if (callback(pairs[length--], pairs[length], object) === false) {\n          break;\n        }\n      }\n      return object;\n    }\n\n    /**\n     * Iterates over own enumerable properties of an object, executing the callback\n     * for each property. The callback is bound to `thisArg` and invoked with three\n     * arguments; (value, key, object). Callbacks may exit iteration early by\n     * explicitly returning `false`.\n     *\n     * @static\n     * @memberOf _\n     * @type Function\n     * @category Objects\n     * @param {Object} object The object to iterate over.\n     * @param {Function} [callback=identity] The function called per iteration.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {\n     *   console.log(key);\n     * });\n     * // => logs '0', '1', and 'length' (property order is not guaranteed across environments)\n     */\n    var forOwn = function(collection, callback, thisArg) {\n      var index, iterable = collection, result = iterable;\n      if (!iterable) return result;\n      if (!objectTypes[typeof iterable]) return result;\n      callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3);\n        var ownIndex = -1,\n            ownProps = objectTypes[typeof iterable] && keys(iterable),\n            length = ownProps ? ownProps.length : 0;\n\n        while (++ownIndex < length) {\n          index = ownProps[ownIndex];\n          if (callback(iterable[index], index, collection) === false) return result;\n        }\n      return result\n    };\n\n    /**\n     * This method is like `_.forOwn` except that it iterates over elements\n     * of a `collection` in the opposite order.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The object to iterate over.\n     * @param {Function} [callback=identity] The function called per iteration.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {\n     *   console.log(key);\n     * });\n     * // => logs 'length', '1', and '0' assuming `_.forOwn` logs '0', '1', and 'length'\n     */\n    function forOwnRight(object, callback, thisArg) {\n      var props = keys(object),\n          length = props.length;\n\n      callback = baseCreateCallback(callback, thisArg, 3);\n      while (length--) {\n        var key = props[length];\n        if (callback(object[key], key, object) === false) {\n          break;\n        }\n      }\n      return object;\n    }\n\n    /**\n     * Creates a sorted array of property names of all enumerable properties,\n     * own and inherited, of `object` that have function values.\n     *\n     * @static\n     * @memberOf _\n     * @alias methods\n     * @category Objects\n     * @param {Object} object The object to inspect.\n     * @returns {Array} Returns an array of property names that have function values.\n     * @example\n     *\n     * _.functions(_);\n     * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...]\n     */\n    function functions(object) {\n      var result = [];\n      forIn(object, function(value, key) {\n        if (isFunction(value)) {\n          result.push(key);\n        }\n      });\n      return result.sort();\n    }\n\n    /**\n     * Checks if the specified object `property` exists and is a direct property,\n     * instead of an inherited property.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The object to check.\n     * @param {string} property The property to check for.\n     * @returns {boolean} Returns `true` if key is a direct property, else `false`.\n     * @example\n     *\n     * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');\n     * // => true\n     */\n    function has(object, property) {\n      return object ? hasOwnProperty.call(object, property) : false;\n    }\n\n    /**\n     * Creates an object composed of the inverted keys and values of the given object.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The object to invert.\n     * @returns {Object} Returns the created inverted object.\n     * @example\n     *\n     *  _.invert({ 'first': 'moe', 'second': 'larry' });\n     * // => { 'moe': 'first', 'larry': 'second' }\n     */\n    function invert(object) {\n      var index = -1,\n          props = keys(object),\n          length = props.length,\n          result = {};\n\n      while (++index < length) {\n        var key = props[index];\n        result[object[key]] = key;\n      }\n      return result;\n    }\n\n    /**\n     * Checks if `value` is a boolean value.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is a boolean value, else `false`.\n     * @example\n     *\n     * _.isBoolean(null);\n     * // => false\n     */\n    function isBoolean(value) {\n      return value === true || value === false || toString.call(value) == boolClass;\n    }\n\n    /**\n     * Checks if `value` is a date.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is a date, else `false`.\n     * @example\n     *\n     * _.isDate(new Date);\n     * // => true\n     */\n    function isDate(value) {\n      return value ? (typeof value == 'object' && toString.call(value) == dateClass) : false;\n    }\n\n    /**\n     * Checks if `value` is a DOM element.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is a DOM element, else `false`.\n     * @example\n     *\n     * _.isElement(document.body);\n     * // => true\n     */\n    function isElement(value) {\n      return value ? value.nodeType === 1 : false;\n    }\n\n    /**\n     * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a\n     * length of `0` and objects with no own enumerable properties are considered\n     * \"empty\".\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Array|Object|string} value The value to inspect.\n     * @returns {boolean} Returns `true` if the `value` is empty, else `false`.\n     * @example\n     *\n     * _.isEmpty([1, 2, 3]);\n     * // => false\n     *\n     * _.isEmpty({});\n     * // => true\n     *\n     * _.isEmpty('');\n     * // => true\n     */\n    function isEmpty(value) {\n      var result = true;\n      if (!value) {\n        return result;\n      }\n      var className = toString.call(value),\n          length = value.length;\n\n      if ((className == arrayClass || className == stringClass || className == argsClass ) ||\n          (className == objectClass && typeof length == 'number' && isFunction(value.splice))) {\n        return !length;\n      }\n      forOwn(value, function() {\n        return (result = false);\n      });\n      return result;\n    }\n\n    /**\n     * Performs a deep comparison between two values to determine if they are\n     * equivalent to each other. If a callback is provided it will be executed\n     * to compare values. If the callback returns `undefined` comparisons will\n     * be handled by the method instead. The callback is bound to `thisArg` and\n     * invoked with two arguments; (a, b).\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} a The value to compare.\n     * @param {*} b The other value to compare.\n     * @param {Function} [callback] The function to customize comparing values.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n     * @example\n     *\n     * var moe = { 'name': 'moe', 'age': 40 };\n     * var copy = { 'name': 'moe', 'age': 40 };\n     *\n     * moe == copy;\n     * // => false\n     *\n     * _.isEqual(moe, copy);\n     * // => true\n     *\n     * var words = ['hello', 'goodbye'];\n     * var otherWords = ['hi', 'goodbye'];\n     *\n     * _.isEqual(words, otherWords, function(a, b) {\n     *   var reGreet = /^(?:hello|hi)$/i,\n     *       aGreet = _.isString(a) && reGreet.test(a),\n     *       bGreet = _.isString(b) && reGreet.test(b);\n     *\n     *   return (aGreet || bGreet) ? (aGreet == bGreet) : undefined;\n     * });\n     * // => true\n     */\n    function isEqual(a, b, callback, thisArg) {\n      return baseIsEqual(a, b, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 2));\n    }\n\n    /**\n     * Checks if `value` is, or can be coerced to, a finite number.\n     *\n     * Note: This is not the same as native `isFinite` which will return true for\n     * booleans and empty strings. See http://es5.github.io/#x15.1.2.5.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is finite, else `false`.\n     * @example\n     *\n     * _.isFinite(-101);\n     * // => true\n     *\n     * _.isFinite('10');\n     * // => true\n     *\n     * _.isFinite(true);\n     * // => false\n     *\n     * _.isFinite('');\n     * // => false\n     *\n     * _.isFinite(Infinity);\n     * // => false\n     */\n    function isFinite(value) {\n      return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value));\n    }\n\n    /**\n     * Checks if `value` is a function.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is a function, else `false`.\n     * @example\n     *\n     * _.isFunction(_);\n     * // => true\n     */\n    function isFunction(value) {\n      return typeof value == 'function';\n    }\n\n    /**\n     * Checks if `value` is the language type of Object.\n     * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is an object, else `false`.\n     * @example\n     *\n     * _.isObject({});\n     * // => true\n     *\n     * _.isObject([1, 2, 3]);\n     * // => true\n     *\n     * _.isObject(1);\n     * // => false\n     */\n    function isObject(value) {\n      // check if the value is the ECMAScript language type of Object\n      // http://es5.github.io/#x8\n      // and avoid a V8 bug\n      // http://code.google.com/p/v8/issues/detail?id=2291\n      return !!(value && objectTypes[typeof value]);\n    }\n\n    /**\n     * Checks if `value` is `NaN`.\n     *\n     * Note: This is not the same as native `isNaN` which will return `true` for\n     * `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is `NaN`, else `false`.\n     * @example\n     *\n     * _.isNaN(NaN);\n     * // => true\n     *\n     * _.isNaN(new Number(NaN));\n     * // => true\n     *\n     * isNaN(undefined);\n     * // => true\n     *\n     * _.isNaN(undefined);\n     * // => false\n     */\n    function isNaN(value) {\n      // `NaN` as a primitive is the only value that is not equal to itself\n      // (perform the [[Class]] check first to avoid errors with some host objects in IE)\n      return isNumber(value) && value != +value;\n    }\n\n    /**\n     * Checks if `value` is `null`.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is `null`, else `false`.\n     * @example\n     *\n     * _.isNull(null);\n     * // => true\n     *\n     * _.isNull(undefined);\n     * // => false\n     */\n    function isNull(value) {\n      return value === null;\n    }\n\n    /**\n     * Checks if `value` is a number.\n     *\n     * Note: `NaN` is considered a number. See http://es5.github.io/#x8.5.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is a number, else `false`.\n     * @example\n     *\n     * _.isNumber(8.4 * 5);\n     * // => true\n     */\n    function isNumber(value) {\n      return typeof value == 'number' || toString.call(value) == numberClass;\n    }\n\n    /**\n     * Checks if `value` is an object created by the `Object` constructor.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n     * @example\n     *\n     * function Stooge(name, age) {\n     *   this.name = name;\n     *   this.age = age;\n     * }\n     *\n     * _.isPlainObject(new Stooge('moe', 40));\n     * // => false\n     *\n     * _.isPlainObject([1, 2, 3]);\n     * // => false\n     *\n     * _.isPlainObject({ 'name': 'moe', 'age': 40 });\n     * // => true\n     */\n    var isPlainObject = function(value) {\n      if (!(value && toString.call(value) == objectClass)) {\n        return false;\n      }\n      var valueOf = value.valueOf,\n          objProto = typeof valueOf == 'function' && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);\n\n      return objProto\n        ? (value == objProto || getPrototypeOf(value) == objProto)\n        : shimIsPlainObject(value);\n    };\n\n    /**\n     * Checks if `value` is a regular expression.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is a regular expression, else `false`.\n     * @example\n     *\n     * _.isRegExp(/moe/);\n     * // => true\n     */\n    function isRegExp(value) {\n      return value ? (typeof value == 'object' && toString.call(value) == regexpClass) : false;\n    }\n\n    /**\n     * Checks if `value` is a string.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is a string, else `false`.\n     * @example\n     *\n     * _.isString('moe');\n     * // => true\n     */\n    function isString(value) {\n      return typeof value == 'string' || toString.call(value) == stringClass;\n    }\n\n    /**\n     * Checks if `value` is `undefined`.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if the `value` is `undefined`, else `false`.\n     * @example\n     *\n     * _.isUndefined(void 0);\n     * // => true\n     */\n    function isUndefined(value) {\n      return typeof value == 'undefined';\n    }\n\n    /**\n     * Recursively merges own enumerable properties of the source object(s), that\n     * don't resolve to `undefined` into the destination object. Subsequent sources\n     * will overwrite property assignments of previous sources. If a callback is\n     * provided it will be executed to produce the merged values of the destination\n     * and source properties. If the callback returns `undefined` merging will\n     * be handled by the method instead. The callback is bound to `thisArg` and\n     * invoked with two arguments; (objectValue, sourceValue).\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The destination object.\n     * @param {...Object} [source] The source objects.\n     * @param {Function} [callback] The function to customize merging properties.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Object} Returns the destination object.\n     * @example\n     *\n     * var names = {\n     *   'stooges': [\n     *     { 'name': 'moe' },\n     *     { 'name': 'larry' }\n     *   ]\n     * };\n     *\n     * var ages = {\n     *   'stooges': [\n     *     { 'age': 40 },\n     *     { 'age': 50 }\n     *   ]\n     * };\n     *\n     * _.merge(names, ages);\n     * // => { 'stooges': [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] }\n     *\n     * var food = {\n     *   'fruits': ['apple'],\n     *   'vegetables': ['beet']\n     * };\n     *\n     * var otherFood = {\n     *   'fruits': ['banana'],\n     *   'vegetables': ['carrot']\n     * };\n     *\n     * _.merge(food, otherFood, function(a, b) {\n     *   return _.isArray(a) ? a.concat(b) : undefined;\n     * });\n     * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] }\n     */\n    function merge(object) {\n      var args = arguments,\n          length = 2;\n\n      if (!isObject(object)) {\n        return object;\n      }\n      // allows working with `_.reduce` and `_.reduceRight` without using\n      // their `index` and `collection` arguments\n      if (typeof args[2] != 'number') {\n        length = args.length;\n      }\n      if (length > 3 && typeof args[length - 2] == 'function') {\n        var callback = baseCreateCallback(args[--length - 1], args[length--], 2);\n      } else if (length > 2 && typeof args[length - 1] == 'function') {\n        callback = args[--length];\n      }\n      var sources = nativeSlice.call(arguments, 1, length),\n          index = -1,\n          stackA = getArray(),\n          stackB = getArray();\n\n      while (++index < length) {\n        baseMerge(object, sources[index], callback, stackA, stackB);\n      }\n      releaseArray(stackA);\n      releaseArray(stackB);\n      return object;\n    }\n\n    /**\n     * Creates a shallow clone of `object` excluding the specified properties.\n     * Property names may be specified as individual arguments or as arrays of\n     * property names. If a callback is provided it will be executed for each\n     * property of `object` omitting the properties the callback returns truey\n     * for. The callback is bound to `thisArg` and invoked with three arguments;\n     * (value, key, object).\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The source object.\n     * @param {Function|...string|string[]} [callback] The properties to omit or the\n     *  function called per iteration.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Object} Returns an object without the omitted properties.\n     * @example\n     *\n     * _.omit({ 'name': 'moe', 'age': 40 }, 'age');\n     * // => { 'name': 'moe' }\n     *\n     * _.omit({ 'name': 'moe', 'age': 40 }, function(value) {\n     *   return typeof value == 'number';\n     * });\n     * // => { 'name': 'moe' }\n     */\n    function omit(object, callback, thisArg) {\n      var indexOf = getIndexOf(),\n          isFunc = typeof callback == 'function',\n          result = {};\n\n      if (isFunc) {\n        callback = lodash.createCallback(callback, thisArg, 3);\n      } else {\n        var props = baseFlatten(arguments, true, false, 1);\n      }\n      forIn(object, function(value, key, object) {\n        if (isFunc\n              ? !callback(value, key, object)\n              : indexOf(props, key) < 0\n            ) {\n          result[key] = value;\n        }\n      });\n      return result;\n    }\n\n    /**\n     * Creates a two dimensional array of an object's key-value pairs,\n     * i.e. `[[key1, value1], [key2, value2]]`.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The object to inspect.\n     * @returns {Array} Returns new array of key-value pairs.\n     * @example\n     *\n     * _.pairs({ 'moe': 30, 'larry': 40 });\n     * // => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments)\n     */\n    function pairs(object) {\n      var index = -1,\n          props = keys(object),\n          length = props.length,\n          result = Array(length);\n\n      while (++index < length) {\n        var key = props[index];\n        result[index] = [key, object[key]];\n      }\n      return result;\n    }\n\n    /**\n     * Creates a shallow clone of `object` composed of the specified properties.\n     * Property names may be specified as individual arguments or as arrays of\n     * property names. If a callback is provided it will be executed for each\n     * property of `object` picking the properties the callback returns truey\n     * for. The callback is bound to `thisArg` and invoked with three arguments;\n     * (value, key, object).\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The source object.\n     * @param {Function|...string|string[]} [callback] The function called per\n     *  iteration or property names to pick, specified as individual property\n     *  names or arrays of property names.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Object} Returns an object composed of the picked properties.\n     * @example\n     *\n     * _.pick({ 'name': 'moe', '_userid': 'moe1' }, 'name');\n     * // => { 'name': 'moe' }\n     *\n     * _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) {\n     *   return key.charAt(0) != '_';\n     * });\n     * // => { 'name': 'moe' }\n     */\n    function pick(object, callback, thisArg) {\n      var result = {};\n      if (typeof callback != 'function') {\n        var index = -1,\n            props = baseFlatten(arguments, true, false, 1),\n            length = isObject(object) ? props.length : 0;\n\n        while (++index < length) {\n          var key = props[index];\n          if (key in object) {\n            result[key] = object[key];\n          }\n        }\n      } else {\n        callback = lodash.createCallback(callback, thisArg, 3);\n        forIn(object, function(value, key, object) {\n          if (callback(value, key, object)) {\n            result[key] = value;\n          }\n        });\n      }\n      return result;\n    }\n\n    /**\n     * An alternative to `_.reduce` this method transforms `object` to a new\n     * `accumulator` object which is the result of running each of its elements\n     * through a callback, with each callback execution potentially mutating\n     * the `accumulator` object. The callback is bound to `thisArg` and invoked\n     * with four arguments; (accumulator, value, key, object). Callbacks may exit\n     * iteration early by explicitly returning `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Array|Object} collection The collection to iterate over.\n     * @param {Function} [callback=identity] The function called per iteration.\n     * @param {*} [accumulator] The custom accumulator value.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {*} Returns the accumulated value.\n     * @example\n     *\n     * var squares = _.transform([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function(result, num) {\n     *   num *= num;\n     *   if (num % 2) {\n     *     return result.push(num) < 3;\n     *   }\n     * });\n     * // => [1, 9, 25]\n     *\n     * var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) {\n     *   result[key] = num * 3;\n     * });\n     * // => { 'a': 3, 'b': 6, 'c': 9 }\n     */\n    function transform(object, callback, accumulator, thisArg) {\n      var isArr = isArray(object);\n      callback = baseCreateCallback(callback, thisArg, 4);\n\n      if (accumulator == null) {\n        if (isArr) {\n          accumulator = [];\n        } else {\n          var ctor = object && object.constructor,\n              proto = ctor && ctor.prototype;\n\n          accumulator = createObject(proto);\n        }\n      }\n      (isArr ? forEach : forOwn)(object, function(value, index, object) {\n        return callback(accumulator, value, index, object);\n      });\n      return accumulator;\n    }\n\n    /**\n     * Creates an array composed of the own enumerable property values of `object`.\n     *\n     * @static\n     * @memberOf _\n     * @category Objects\n     * @param {Object} object The object to inspect.\n     * @returns {Array} Returns an array of property values.\n     * @example\n     *\n     * _.values({ 'one': 1, 'two': 2, 'three': 3 });\n     * // => [1, 2, 3] (property order is not guaranteed across environments)\n     */\n    function values(object) {\n      var index = -1,\n          props = keys(object),\n          length = props.length,\n          result = Array(length);\n\n      while (++index < length) {\n        result[index] = object[props[index]];\n      }\n      return result;\n    }\n\n    /*--------------------------------------------------------------------------*/\n\n    /**\n     * Creates an array of elements from the specified indexes, or keys, of the\n     * `collection`. Indexes may be specified as individual arguments or as arrays\n     * of indexes.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {...(number|number[]|string|string[])} [index] The indexes of `collection`\n     *   to retrieve, specified as individual indexes or arrays of indexes.\n     * @returns {Array} Returns a new array of elements corresponding to the\n     *  provided indexes.\n     * @example\n     *\n     * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]);\n     * // => ['a', 'c', 'e']\n     *\n     * _.at(['moe', 'larry', 'curly'], 0, 2);\n     * // => ['moe', 'curly']\n     */\n    function at(collection) {\n      var args = arguments,\n          index = -1,\n          props = baseFlatten(args, true, false, 1),\n          length = (args[2] && args[2][args[1]] === collection) ? 1 : props.length,\n          result = Array(length);\n\n      while(++index < length) {\n        result[index] = collection[props[index]];\n      }\n      return result;\n    }\n\n    /**\n     * Checks if a given value is present in a collection using strict equality\n     * for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the\n     * offset from the end of the collection.\n     *\n     * @static\n     * @memberOf _\n     * @alias include\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {*} target The value to check for.\n     * @param {number} [fromIndex=0] The index to search from.\n     * @returns {boolean} Returns `true` if the `target` element is found, else `false`.\n     * @example\n     *\n     * _.contains([1, 2, 3], 1);\n     * // => true\n     *\n     * _.contains([1, 2, 3], 1, 2);\n     * // => false\n     *\n     * _.contains({ 'name': 'moe', 'age': 40 }, 'moe');\n     * // => true\n     *\n     * _.contains('curly', 'ur');\n     * // => true\n     */\n    function contains(collection, target, fromIndex) {\n      var index = -1,\n          indexOf = getIndexOf(),\n          length = collection ? collection.length : 0,\n          result = false;\n\n      fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0;\n      if (isArray(collection)) {\n        result = indexOf(collection, target, fromIndex) > -1;\n      } else if (typeof length == 'number') {\n        result = (isString(collection) ? collection.indexOf(target, fromIndex) : indexOf(collection, target, fromIndex)) > -1;\n      } else {\n        forOwn(collection, function(value) {\n          if (++index >= fromIndex) {\n            return !(result = value === target);\n          }\n        });\n      }\n      return result;\n    }\n\n    /**\n     * Creates an object composed of keys generated from the results of running\n     * each element of `collection` through the callback. The corresponding value\n     * of each key is the number of times the key was returned by the callback.\n     * The callback is bound to `thisArg` and invoked with three arguments;\n     * (value, index|key, collection).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Object} Returns the composed aggregate object.\n     * @example\n     *\n     * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); });\n     * // => { '4': 1, '6': 2 }\n     *\n     * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math);\n     * // => { '4': 1, '6': 2 }\n     *\n     * _.countBy(['one', 'two', 'three'], 'length');\n     * // => { '3': 2, '5': 1 }\n     */\n    var countBy = createAggregator(function(result, value, key) {\n      (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1);\n    });\n\n    /**\n     * Checks if the given callback returns truey value for **all** elements of\n     * a collection. The callback is bound to `thisArg` and invoked with three\n     * arguments; (value, index|key, collection).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias all\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {boolean} Returns `true` if all elements passed the callback check,\n     *  else `false`.\n     * @example\n     *\n     * _.every([true, 1, null, 'yes'], Boolean);\n     * // => false\n     *\n     * var stooges = [\n     *   { 'name': 'moe', 'age': 40 },\n     *   { 'name': 'larry', 'age': 50 }\n     * ];\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.every(stooges, 'age');\n     * // => true\n     *\n     * // using \"_.where\" callback shorthand\n     * _.every(stooges, { 'age': 50 });\n     * // => false\n     */\n    function every(collection, callback, thisArg) {\n      var result = true;\n      callback = lodash.createCallback(callback, thisArg, 3);\n\n      var index = -1,\n          length = collection ? collection.length : 0;\n\n      if (typeof length == 'number') {\n        while (++index < length) {\n          if (!(result = !!callback(collection[index], index, collection))) {\n            break;\n          }\n        }\n      } else {\n        forOwn(collection, function(value, index, collection) {\n          return (result = !!callback(value, index, collection));\n        });\n      }\n      return result;\n    }\n\n    /**\n     * Iterates over elements of a collection, returning an array of all elements\n     * the callback returns truey for. The callback is bound to `thisArg` and\n     * invoked with three arguments; (value, index|key, collection).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias select\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array} Returns a new array of elements that passed the callback check.\n     * @example\n     *\n     * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });\n     * // => [2, 4, 6]\n     *\n     * var food = [\n     *   { 'name': 'apple',  'organic': false, 'type': 'fruit' },\n     *   { 'name': 'carrot', 'organic': true,  'type': 'vegetable' }\n     * ];\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.filter(food, 'organic');\n     * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]\n     *\n     * // using \"_.where\" callback shorthand\n     * _.filter(food, { 'type': 'fruit' });\n     * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]\n     */\n    function filter(collection, callback, thisArg) {\n      var result = [];\n      callback = lodash.createCallback(callback, thisArg, 3);\n\n      var index = -1,\n          length = collection ? collection.length : 0;\n\n      if (typeof length == 'number') {\n        while (++index < length) {\n          var value = collection[index];\n          if (callback(value, index, collection)) {\n            result.push(value);\n          }\n        }\n      } else {\n        forOwn(collection, function(value, index, collection) {\n          if (callback(value, index, collection)) {\n            result.push(value);\n          }\n        });\n      }\n      return result;\n    }\n\n    /**\n     * Iterates over elements of a collection, returning the first element that\n     * the callback returns truey for. The callback is bound to `thisArg` and\n     * invoked with three arguments; (value, index|key, collection).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias detect, findWhere\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {*} Returns the found element, else `undefined`.\n     * @example\n     *\n     * _.find([1, 2, 3, 4], function(num) {\n     *   return num % 2 == 0;\n     * });\n     * // => 2\n     *\n     * var food = [\n     *   { 'name': 'apple',  'organic': false, 'type': 'fruit' },\n     *   { 'name': 'banana', 'organic': true,  'type': 'fruit' },\n     *   { 'name': 'beet',   'organic': false, 'type': 'vegetable' }\n     * ];\n     *\n     * // using \"_.where\" callback shorthand\n     * _.find(food, { 'type': 'vegetable' });\n     * // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' }\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.find(food, 'organic');\n     * // => { 'name': 'banana', 'organic': true, 'type': 'fruit' }\n     */\n    function find(collection, callback, thisArg) {\n      callback = lodash.createCallback(callback, thisArg, 3);\n\n      var index = -1,\n          length = collection ? collection.length : 0;\n\n      if (typeof length == 'number') {\n        while (++index < length) {\n          var value = collection[index];\n          if (callback(value, index, collection)) {\n            return value;\n          }\n        }\n      } else {\n        var result;\n        forOwn(collection, function(value, index, collection) {\n          if (callback(value, index, collection)) {\n            result = value;\n            return false;\n          }\n        });\n        return result;\n      }\n    }\n\n    /**\n     * This method is like `_.find` except that it iterates over elements\n     * of a `collection` from right to left.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {*} Returns the found element, else `undefined`.\n     * @example\n     *\n     * _.findLast([1, 2, 3, 4], function(num) {\n     *   return num % 2 == 1;\n     * });\n     * // => 3\n     */\n    function findLast(collection, callback, thisArg) {\n      var result;\n      callback = lodash.createCallback(callback, thisArg, 3);\n      forEachRight(collection, function(value, index, collection) {\n        if (callback(value, index, collection)) {\n          result = value;\n          return false;\n        }\n      });\n      return result;\n    }\n\n    /**\n     * Iterates over elements of a collection, executing the callback for each\n     * element. The callback is bound to `thisArg` and invoked with three arguments;\n     * (value, index|key, collection). Callbacks may exit iteration early by\n     * explicitly returning `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias each\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} [callback=identity] The function called per iteration.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array|Object|string} Returns `collection`.\n     * @example\n     *\n     * _([1, 2, 3]).forEach(function(num) { console.log(num); }).join(',');\n     * // => logs each number and returns '1,2,3'\n     *\n     * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });\n     * // => logs each number and returns the object (property order is not guaranteed across environments)\n     */\n    function forEach(collection, callback, thisArg) {\n      var index = -1,\n          length = collection ? collection.length : 0;\n\n      callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3);\n      if (typeof length == 'number') {\n        while (++index < length) {\n          if (callback(collection[index], index, collection) === false) {\n            break;\n          }\n        }\n      } else {\n        forOwn(collection, callback);\n      }\n      return collection;\n    }\n\n    /**\n     * This method is like `_.forEach` except that it iterates over elements\n     * of a `collection` from right to left.\n     *\n     * @static\n     * @memberOf _\n     * @alias eachRight\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} [callback=identity] The function called per iteration.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array|Object|string} Returns `collection`.\n     * @example\n     *\n     * _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(',');\n     * // => logs each number from right to left and returns '3,2,1'\n     */\n    function forEachRight(collection, callback, thisArg) {\n      var length = collection ? collection.length : 0;\n      callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3);\n      if (typeof length == 'number') {\n        while (length--) {\n          if (callback(collection[length], length, collection) === false) {\n            break;\n          }\n        }\n      } else {\n        var props = keys(collection);\n        length = props.length;\n        forOwn(collection, function(value, key, collection) {\n          key = props ? props[--length] : --length;\n          return callback(collection[key], key, collection);\n        });\n      }\n      return collection;\n    }\n\n    /**\n     * Creates an object composed of keys generated from the results of running\n     * each element of a collection through the callback. The corresponding value\n     * of each key is an array of the elements responsible for generating the key.\n     * The callback is bound to `thisArg` and invoked with three arguments;\n     * (value, index|key, collection).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Object} Returns the composed aggregate object.\n     * @example\n     *\n     * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); });\n     * // => { '4': [4.2], '6': [6.1, 6.4] }\n     *\n     * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math);\n     * // => { '4': [4.2], '6': [6.1, 6.4] }\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.groupBy(['one', 'two', 'three'], 'length');\n     * // => { '3': ['one', 'two'], '5': ['three'] }\n     */\n    var groupBy = createAggregator(function(result, value, key) {\n      (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value);\n    });\n\n    /**\n     * Creates an object composed of keys generated from the results of running\n     * each element of the collection through the given callback. The corresponding\n     * value of each key is the last element responsible for generating the key.\n     * The callback is bound to `thisArg` and invoked with three arguments;\n     * (value, index|key, collection).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Object} Returns the composed aggregate object.\n     * @example\n     *\n     * var keys = [\n     *   { 'dir': 'left', 'code': 97 },\n     *   { 'dir': 'right', 'code': 100 }\n     * ];\n     *\n     * _.indexBy(keys, 'dir');\n     * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n     *\n     * _.indexBy(keys, function(key) { return String.fromCharCode(key.code); });\n     * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n     *\n     * _.indexBy(stooges, function(key) { this.fromCharCode(key.code); }, String);\n     * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n     */\n    var indexBy = createAggregator(function(result, value, key) {\n      result[key] = value;\n    });\n\n    /**\n     * Invokes the method named by `methodName` on each element in the `collection`\n     * returning an array of the results of each invoked method. Additional arguments\n     * will be provided to each invoked method. If `methodName` is a function it\n     * will be invoked for, and `this` bound to, each element in the `collection`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|string} methodName The name of the method to invoke or\n     *  the function invoked per iteration.\n     * @param {...*} [arg] Arguments to invoke the method with.\n     * @returns {Array} Returns a new array of the results of each invoked method.\n     * @example\n     *\n     * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');\n     * // => [[1, 5, 7], [1, 2, 3]]\n     *\n     * _.invoke([123, 456], String.prototype.split, '');\n     * // => [['1', '2', '3'], ['4', '5', '6']]\n     */\n    function invoke(collection, methodName) {\n      var args = nativeSlice.call(arguments, 2),\n          index = -1,\n          isFunc = typeof methodName == 'function',\n          length = collection ? collection.length : 0,\n          result = Array(typeof length == 'number' ? length : 0);\n\n      forEach(collection, function(value) {\n        result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args);\n      });\n      return result;\n    }\n\n    /**\n     * Creates an array of values by running each element in the collection\n     * through the callback. The callback is bound to `thisArg` and invoked with\n     * three arguments; (value, index|key, collection).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias collect\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array} Returns a new array of the results of each `callback` execution.\n     * @example\n     *\n     * _.map([1, 2, 3], function(num) { return num * 3; });\n     * // => [3, 6, 9]\n     *\n     * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });\n     * // => [3, 6, 9] (property order is not guaranteed across environments)\n     *\n     * var stooges = [\n     *   { 'name': 'moe', 'age': 40 },\n     *   { 'name': 'larry', 'age': 50 }\n     * ];\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.map(stooges, 'name');\n     * // => ['moe', 'larry']\n     */\n    function map(collection, callback, thisArg) {\n      var index = -1,\n          length = collection ? collection.length : 0;\n\n      callback = lodash.createCallback(callback, thisArg, 3);\n      if (typeof length == 'number') {\n        var result = Array(length);\n        while (++index < length) {\n          result[index] = callback(collection[index], index, collection);\n        }\n      } else {\n        result = [];\n        forOwn(collection, function(value, key, collection) {\n          result[++index] = callback(value, key, collection);\n        });\n      }\n      return result;\n    }\n\n    /**\n     * Retrieves the maximum value of a collection. If the collection is empty or\n     * falsey `-Infinity` is returned. If a callback is provided it will be executed\n     * for each value in the collection to generate the criterion by which the value\n     * is ranked. The callback is bound to `thisArg` and invoked with three\n     * arguments; (value, index, collection).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {*} Returns the maximum value.\n     * @example\n     *\n     * _.max([4, 2, 8, 6]);\n     * // => 8\n     *\n     * var stooges = [\n     *   { 'name': 'moe', 'age': 40 },\n     *   { 'name': 'larry', 'age': 50 }\n     * ];\n     *\n     * _.max(stooges, function(stooge) { return stooge.age; });\n     * // => { 'name': 'larry', 'age': 50 };\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.max(stooges, 'age');\n     * // => { 'name': 'larry', 'age': 50 };\n     */\n    function max(collection, callback, thisArg) {\n      var computed = -Infinity,\n          result = computed;\n\n      if (!callback && isArray(collection)) {\n        var index = -1,\n            length = collection.length;\n\n        while (++index < length) {\n          var value = collection[index];\n          if (value > result) {\n            result = value;\n          }\n        }\n      } else {\n        callback = (!callback && isString(collection))\n          ? charAtCallback\n          : lodash.createCallback(callback, thisArg, 3);\n\n        forEach(collection, function(value, index, collection) {\n          var current = callback(value, index, collection);\n          if (current > computed) {\n            computed = current;\n            result = value;\n          }\n        });\n      }\n      return result;\n    }\n\n    /**\n     * Retrieves the minimum value of a collection. If the collection is empty or\n     * falsey `Infinity` is returned. If a callback is provided it will be executed\n     * for each value in the collection to generate the criterion by which the value\n     * is ranked. The callback is bound to `thisArg` and invoked with three\n     * arguments; (value, index, collection).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {*} Returns the minimum value.\n     * @example\n     *\n     * _.min([4, 2, 8, 6]);\n     * // => 2\n     *\n     * var stooges = [\n     *   { 'name': 'moe', 'age': 40 },\n     *   { 'name': 'larry', 'age': 50 }\n     * ];\n     *\n     * _.min(stooges, function(stooge) { return stooge.age; });\n     * // => { 'name': 'moe', 'age': 40 };\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.min(stooges, 'age');\n     * // => { 'name': 'moe', 'age': 40 };\n     */\n    function min(collection, callback, thisArg) {\n      var computed = Infinity,\n          result = computed;\n\n      if (!callback && isArray(collection)) {\n        var index = -1,\n            length = collection.length;\n\n        while (++index < length) {\n          var value = collection[index];\n          if (value < result) {\n            result = value;\n          }\n        }\n      } else {\n        callback = (!callback && isString(collection))\n          ? charAtCallback\n          : lodash.createCallback(callback, thisArg, 3);\n\n        forEach(collection, function(value, index, collection) {\n          var current = callback(value, index, collection);\n          if (current < computed) {\n            computed = current;\n            result = value;\n          }\n        });\n      }\n      return result;\n    }\n\n    /**\n     * Retrieves the value of a specified property from all elements in the `collection`.\n     *\n     * @static\n     * @memberOf _\n     * @type Function\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {string} property The property to pluck.\n     * @returns {Array} Returns a new array of property values.\n     * @example\n     *\n     * var stooges = [\n     *   { 'name': 'moe', 'age': 40 },\n     *   { 'name': 'larry', 'age': 50 }\n     * ];\n     *\n     * _.pluck(stooges, 'name');\n     * // => ['moe', 'larry']\n     */\n    function pluck(collection, property) {\n      var index = -1,\n          length = collection ? collection.length : 0;\n\n      if (typeof length == 'number') {\n        var result = Array(length);\n        while (++index < length) {\n          result[index] = collection[index][property];\n        }\n      }\n      return result || map(collection, property);\n    }\n\n    /**\n     * Reduces a collection to a value which is the accumulated result of running\n     * each element in the collection through the callback, where each successive\n     * callback execution consumes the return value of the previous execution. If\n     * `accumulator` is not provided the first element of the collection will be\n     * used as the initial `accumulator` value. The callback is bound to `thisArg`\n     * and invoked with four arguments; (accumulator, value, index|key, collection).\n     *\n     * @static\n     * @memberOf _\n     * @alias foldl, inject\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} [callback=identity] The function called per iteration.\n     * @param {*} [accumulator] Initial value of the accumulator.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {*} Returns the accumulated value.\n     * @example\n     *\n     * var sum = _.reduce([1, 2, 3], function(sum, num) {\n     *   return sum + num;\n     * });\n     * // => 6\n     *\n     * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) {\n     *   result[key] = num * 3;\n     *   return result;\n     * }, {});\n     * // => { 'a': 3, 'b': 6, 'c': 9 }\n     */\n    function reduce(collection, callback, accumulator, thisArg) {\n      if (!collection) return accumulator;\n      var noaccum = arguments.length < 3;\n      callback = baseCreateCallback(callback, thisArg, 4);\n\n      var index = -1,\n          length = collection.length;\n\n      if (typeof length == 'number') {\n        if (noaccum) {\n          accumulator = collection[++index];\n        }\n        while (++index < length) {\n          accumulator = callback(accumulator, collection[index], index, collection);\n        }\n      } else {\n        forOwn(collection, function(value, index, collection) {\n          accumulator = noaccum\n            ? (noaccum = false, value)\n            : callback(accumulator, value, index, collection)\n        });\n      }\n      return accumulator;\n    }\n\n    /**\n     * This method is like `_.reduce` except that it iterates over elements\n     * of a `collection` from right to left.\n     *\n     * @static\n     * @memberOf _\n     * @alias foldr\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} [callback=identity] The function called per iteration.\n     * @param {*} [accumulator] Initial value of the accumulator.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {*} Returns the accumulated value.\n     * @example\n     *\n     * var list = [[0, 1], [2, 3], [4, 5]];\n     * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);\n     * // => [4, 5, 2, 3, 0, 1]\n     */\n    function reduceRight(collection, callback, accumulator, thisArg) {\n      var noaccum = arguments.length < 3;\n      callback = baseCreateCallback(callback, thisArg, 4);\n      forEachRight(collection, function(value, index, collection) {\n        accumulator = noaccum\n          ? (noaccum = false, value)\n          : callback(accumulator, value, index, collection);\n      });\n      return accumulator;\n    }\n\n    /**\n     * The opposite of `_.filter` this method returns the elements of a\n     * collection that the callback does **not** return truey for.\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array} Returns a new array of elements that failed the callback check.\n     * @example\n     *\n     * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });\n     * // => [1, 3, 5]\n     *\n     * var food = [\n     *   { 'name': 'apple',  'organic': false, 'type': 'fruit' },\n     *   { 'name': 'carrot', 'organic': true,  'type': 'vegetable' }\n     * ];\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.reject(food, 'organic');\n     * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]\n     *\n     * // using \"_.where\" callback shorthand\n     * _.reject(food, { 'type': 'fruit' });\n     * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]\n     */\n    function reject(collection, callback, thisArg) {\n      callback = lodash.createCallback(callback, thisArg, 3);\n      return filter(collection, function(value, index, collection) {\n        return !callback(value, index, collection);\n      });\n    }\n\n    /**\n     * Retrieves a random element or `n` random elements from a collection.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to sample.\n     * @param {number} [n] The number of elements to sample.\n     * @param- {Object} [guard] Allows working with functions, like `_.map`,\n     *  without using their `key` and `object` arguments as sources.\n     * @returns {Array} Returns the random sample(s) of `collection`.\n     * @example\n     *\n     * _.sample([1, 2, 3, 4]);\n     * // => 2\n     *\n     * _.sample([1, 2, 3, 4], 2);\n     * // => [3, 1]\n     */\n    function sample(collection, n, guard) {\n      var length = collection ? collection.length : 0;\n      if (typeof length != 'number') {\n        collection = values(collection);\n      }\n      if (n == null || guard) {\n        return collection ? collection[random(length - 1)] : undefined;\n      }\n      var result = shuffle(collection);\n      result.length = nativeMin(nativeMax(0, n), result.length);\n      return result;\n    }\n\n    /**\n     * Creates an array of shuffled values, using a version of the Fisher-Yates\n     * shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to shuffle.\n     * @returns {Array} Returns a new shuffled collection.\n     * @example\n     *\n     * _.shuffle([1, 2, 3, 4, 5, 6]);\n     * // => [4, 1, 6, 3, 5, 2]\n     */\n    function shuffle(collection) {\n      var index = -1,\n          length = collection ? collection.length : 0,\n          result = Array(typeof length == 'number' ? length : 0);\n\n      forEach(collection, function(value) {\n        var rand = random(++index);\n        result[index] = result[rand];\n        result[rand] = value;\n      });\n      return result;\n    }\n\n    /**\n     * Gets the size of the `collection` by returning `collection.length` for arrays\n     * and array-like objects or the number of own enumerable properties for objects.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to inspect.\n     * @returns {number} Returns `collection.length` or number of own enumerable properties.\n     * @example\n     *\n     * _.size([1, 2]);\n     * // => 2\n     *\n     * _.size({ 'one': 1, 'two': 2, 'three': 3 });\n     * // => 3\n     *\n     * _.size('curly');\n     * // => 5\n     */\n    function size(collection) {\n      var length = collection ? collection.length : 0;\n      return typeof length == 'number' ? length : keys(collection).length;\n    }\n\n    /**\n     * Checks if the callback returns a truey value for **any** element of a\n     * collection. The function returns as soon as it finds a passing value and\n     * does not iterate over the entire collection. The callback is bound to\n     * `thisArg` and invoked with three arguments; (value, index|key, collection).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias any\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {boolean} Returns `true` if any element passed the callback check,\n     *  else `false`.\n     * @example\n     *\n     * _.some([null, 0, 'yes', false], Boolean);\n     * // => true\n     *\n     * var food = [\n     *   { 'name': 'apple',  'organic': false, 'type': 'fruit' },\n     *   { 'name': 'carrot', 'organic': true,  'type': 'vegetable' }\n     * ];\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.some(food, 'organic');\n     * // => true\n     *\n     * // using \"_.where\" callback shorthand\n     * _.some(food, { 'type': 'meat' });\n     * // => false\n     */\n    function some(collection, callback, thisArg) {\n      var result;\n      callback = lodash.createCallback(callback, thisArg, 3);\n\n      var index = -1,\n          length = collection ? collection.length : 0;\n\n      if (typeof length == 'number') {\n        while (++index < length) {\n          if ((result = callback(collection[index], index, collection))) {\n            break;\n          }\n        }\n      } else {\n        forOwn(collection, function(value, index, collection) {\n          return !(result = callback(value, index, collection));\n        });\n      }\n      return !!result;\n    }\n\n    /**\n     * Creates an array of elements, sorted in ascending order by the results of\n     * running each element in a collection through the callback. This method\n     * performs a stable sort, that is, it will preserve the original sort order\n     * of equal elements. The callback is bound to `thisArg` and invoked with\n     * three arguments; (value, index|key, collection).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array} Returns a new array of sorted elements.\n     * @example\n     *\n     * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); });\n     * // => [3, 1, 2]\n     *\n     * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);\n     * // => [3, 1, 2]\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.sortBy(['banana', 'strawberry', 'apple'], 'length');\n     * // => ['apple', 'banana', 'strawberry']\n     */\n    function sortBy(collection, callback, thisArg) {\n      var index = -1,\n          length = collection ? collection.length : 0,\n          result = Array(typeof length == 'number' ? length : 0);\n\n      callback = lodash.createCallback(callback, thisArg, 3);\n      forEach(collection, function(value, key, collection) {\n        var object = result[++index] = getObject();\n        object.criteria = callback(value, key, collection);\n        object.index = index;\n        object.value = value;\n      });\n\n      length = result.length;\n      result.sort(compareAscending);\n      while (length--) {\n        var object = result[length];\n        result[length] = object.value;\n        releaseObject(object);\n      }\n      return result;\n    }\n\n    /**\n     * Converts the `collection` to an array.\n     *\n     * @static\n     * @memberOf _\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to convert.\n     * @returns {Array} Returns the new converted array.\n     * @example\n     *\n     * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4);\n     * // => [2, 3, 4]\n     */\n    function toArray(collection) {\n      if (collection && typeof collection.length == 'number') {\n        return slice(collection);\n      }\n      return values(collection);\n    }\n\n    /**\n     * Performs a deep comparison of each element in a `collection` to the given\n     * `properties` object, returning an array of all elements that have equivalent\n     * property values.\n     *\n     * @static\n     * @memberOf _\n     * @type Function\n     * @category Collections\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Object} properties The object of property values to filter by.\n     * @returns {Array} Returns a new array of elements that have the given properties.\n     * @example\n     *\n     * var stooges = [\n     *   { 'name': 'curly', 'age': 30, 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] },\n     *   { 'name': 'moe', 'age': 40, 'quotes': ['Spread out!', 'You knucklehead!'] }\n     * ];\n     *\n     * _.where(stooges, { 'age': 40 });\n     * // => [{ 'name': 'moe', 'age': 40, 'quotes': ['Spread out!', 'You knucklehead!'] }]\n     *\n     * _.where(stooges, { 'quotes': ['Poifect!'] });\n     * // => [{ 'name': 'curly', 'age': 30, 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] }]\n     */\n    var where = filter;\n\n    /*--------------------------------------------------------------------------*/\n\n    /**\n     * Creates an array with all falsey values removed. The values `false`, `null`,\n     * `0`, `\"\"`, `undefined`, and `NaN` are all falsey.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to compact.\n     * @returns {Array} Returns a new array of filtered values.\n     * @example\n     *\n     * _.compact([0, 1, false, 2, '', 3]);\n     * // => [1, 2, 3]\n     */\n    function compact(array) {\n      var index = -1,\n          length = array ? array.length : 0,\n          result = [];\n\n      while (++index < length) {\n        var value = array[index];\n        if (value) {\n          result.push(value);\n        }\n      }\n      return result;\n    }\n\n    /**\n     * Creates an array excluding all values of the provided arrays using strict\n     * equality for comparisons, i.e. `===`.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to process.\n     * @param {...Array} [array] The arrays of values to exclude.\n     * @returns {Array} Returns a new array of filtered values.\n     * @example\n     *\n     * _.difference([1, 2, 3, 4, 5], [5, 2, 10]);\n     * // => [1, 3, 4]\n     */\n    function difference(array) {\n      var index = -1,\n          indexOf = getIndexOf(),\n          length = array ? array.length : 0,\n          seen = baseFlatten(arguments, true, true, 1),\n          result = [];\n\n      var isLarge = length >= largeArraySize && indexOf === baseIndexOf;\n\n      if (isLarge) {\n        var cache = createCache(seen);\n        if (cache) {\n          indexOf = cacheIndexOf;\n          seen = cache;\n        } else {\n          isLarge = false;\n        }\n      }\n      while (++index < length) {\n        var value = array[index];\n        if (indexOf(seen, value) < 0) {\n          result.push(value);\n        }\n      }\n      if (isLarge) {\n        releaseObject(seen);\n      }\n      return result;\n    }\n\n    /**\n     * This method is like `_.find` except that it returns the index of the first\n     * element that passes the callback check, instead of the element itself.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to search.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {number} Returns the index of the found element, else `-1`.\n     * @example\n     *\n     * _.findIndex(['apple', 'banana', 'beet'], function(food) {\n     *   return /^b/.test(food);\n     * });\n     * // => 1\n     */\n    function findIndex(array, callback, thisArg) {\n      var index = -1,\n          length = array ? array.length : 0;\n\n      callback = lodash.createCallback(callback, thisArg, 3);\n      while (++index < length) {\n        if (callback(array[index], index, array)) {\n          return index;\n        }\n      }\n      return -1;\n    }\n\n    /**\n     * This method is like `_.findIndex` except that it iterates over elements\n     * of a `collection` from right to left.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to search.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {number} Returns the index of the found element, else `-1`.\n     * @example\n     *\n     * _.findLastIndex(['apple', 'banana', 'beet'], function(food) {\n     *   return /^b/.test(food);\n     * });\n     * // => 2\n     */\n    function findLastIndex(array, callback, thisArg) {\n      var length = array ? array.length : 0;\n      callback = lodash.createCallback(callback, thisArg, 3);\n      while (length--) {\n        if (callback(array[length], length, array)) {\n          return length;\n        }\n      }\n      return -1;\n    }\n\n    /**\n     * Gets the first element or first `n` elements of an array. If a callback\n     * is provided elements at the beginning of the array are returned as long\n     * as the callback returns truey. The callback is bound to `thisArg` and\n     * invoked with three arguments; (value, index, array).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias head, take\n     * @category Arrays\n     * @param {Array} array The array to query.\n     * @param {Function|Object|number|string} [callback] The function called\n     *  per element or the number of elements to return. If a property name or\n     *  object is provided it will be used to create a \"_.pluck\" or \"_.where\"\n     *  style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {*} Returns the first element(s) of `array`.\n     * @example\n     *\n     * _.first([1, 2, 3]);\n     * // => 1\n     *\n     * _.first([1, 2, 3], 2);\n     * // => [1, 2]\n     *\n     * _.first([1, 2, 3], function(num) {\n     *   return num < 3;\n     * });\n     * // => [1, 2]\n     *\n     * var food = [\n     *   { 'name': 'banana', 'organic': true },\n     *   { 'name': 'beet',   'organic': false },\n     * ];\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.first(food, 'organic');\n     * // => [{ 'name': 'banana', 'organic': true }]\n     *\n     * var food = [\n     *   { 'name': 'apple',  'type': 'fruit' },\n     *   { 'name': 'banana', 'type': 'fruit' },\n     *   { 'name': 'beet',   'type': 'vegetable' }\n     * ];\n     *\n     * // using \"_.where\" callback shorthand\n     * _.first(food, { 'type': 'fruit' });\n     * // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }]\n     */\n    function first(array, callback, thisArg) {\n      var n = 0,\n          length = array ? array.length : 0;\n\n      if (typeof callback != 'number' && callback != null) {\n        var index = -1;\n        callback = lodash.createCallback(callback, thisArg, 3);\n        while (++index < length && callback(array[index], index, array)) {\n          n++;\n        }\n      } else {\n        n = callback;\n        if (n == null || thisArg) {\n          return array ? array[0] : undefined;\n        }\n      }\n      return slice(array, 0, nativeMin(nativeMax(0, n), length));\n    }\n\n    /**\n     * Flattens a nested array (the nesting can be to any depth). If `isShallow`\n     * is truey, the array will only be flattened a single level. If a callback\n     * is provided each element of the array is passed through the callback before\n     * flattening. The callback is bound to `thisArg` and invoked with three\n     * arguments; (value, index, array).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to flatten.\n     * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array} Returns a new flattened array.\n     * @example\n     *\n     * _.flatten([1, [2], [3, [[4]]]]);\n     * // => [1, 2, 3, 4];\n     *\n     * _.flatten([1, [2], [3, [[4]]]], true);\n     * // => [1, 2, 3, [[4]]];\n     *\n     * var stooges = [\n     *   { 'name': 'curly', 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] },\n     *   { 'name': 'moe', 'quotes': ['Spread out!', 'You knucklehead!'] }\n     * ];\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.flatten(stooges, 'quotes');\n     * // => ['Oh, a wise guy, eh?', 'Poifect!', 'Spread out!', 'You knucklehead!']\n     */\n    function flatten(array, isShallow, callback, thisArg) {\n      // juggle arguments\n      if (typeof isShallow != 'boolean' && isShallow != null) {\n        thisArg = callback;\n        callback = !(thisArg && thisArg[isShallow] === array) ? isShallow : null;\n        isShallow = false;\n      }\n      if (callback != null) {\n        array = map(array, callback, thisArg);\n      }\n      return baseFlatten(array, isShallow);\n    }\n\n    /**\n     * Gets the index at which the first occurrence of `value` is found using\n     * strict equality for comparisons, i.e. `===`. If the array is already sorted\n     * providing `true` for `fromIndex` will run a faster binary search.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to search.\n     * @param {*} value The value to search for.\n     * @param {boolean|number} [fromIndex=0] The index to search from or `true`\n     *  to perform a binary search on a sorted array.\n     * @returns {number} Returns the index of the matched value or `-1`.\n     * @example\n     *\n     * _.indexOf([1, 2, 3, 1, 2, 3], 2);\n     * // => 1\n     *\n     * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3);\n     * // => 4\n     *\n     * _.indexOf([1, 1, 2, 2, 3, 3], 2, true);\n     * // => 2\n     */\n    function indexOf(array, value, fromIndex) {\n      if (typeof fromIndex == 'number') {\n        var length = array ? array.length : 0;\n        fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0);\n      } else if (fromIndex) {\n        var index = sortedIndex(array, value);\n        return array[index] === value ? index : -1;\n      }\n      return baseIndexOf(array, value, fromIndex);\n    }\n\n    /**\n     * Gets all but the last element or last `n` elements of an array. If a\n     * callback is provided elements at the end of the array are excluded from\n     * the result as long as the callback returns truey. The callback is bound\n     * to `thisArg` and invoked with three arguments; (value, index, array).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to query.\n     * @param {Function|Object|number|string} [callback=1] The function called\n     *  per element or the number of elements to exclude. If a property name or\n     *  object is provided it will be used to create a \"_.pluck\" or \"_.where\"\n     *  style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array} Returns a slice of `array`.\n     * @example\n     *\n     * _.initial([1, 2, 3]);\n     * // => [1, 2]\n     *\n     * _.initial([1, 2, 3], 2);\n     * // => [1]\n     *\n     * _.initial([1, 2, 3], function(num) {\n     *   return num > 1;\n     * });\n     * // => [1]\n     *\n     * var food = [\n     *   { 'name': 'beet',   'organic': false },\n     *   { 'name': 'carrot', 'organic': true }\n     * ];\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.initial(food, 'organic');\n     * // => [{ 'name': 'beet',   'organic': false }]\n     *\n     * var food = [\n     *   { 'name': 'banana', 'type': 'fruit' },\n     *   { 'name': 'beet',   'type': 'vegetable' },\n     *   { 'name': 'carrot', 'type': 'vegetable' }\n     * ];\n     *\n     * // using \"_.where\" callback shorthand\n     * _.initial(food, { 'type': 'vegetable' });\n     * // => [{ 'name': 'banana', 'type': 'fruit' }]\n     */\n    function initial(array, callback, thisArg) {\n      var n = 0,\n          length = array ? array.length : 0;\n\n      if (typeof callback != 'number' && callback != null) {\n        var index = length;\n        callback = lodash.createCallback(callback, thisArg, 3);\n        while (index-- && callback(array[index], index, array)) {\n          n++;\n        }\n      } else {\n        n = (callback == null || thisArg) ? 1 : callback || n;\n      }\n      return slice(array, 0, nativeMin(nativeMax(0, length - n), length));\n    }\n\n    /**\n     * Creates an array of unique values present in all provided arrays using\n     * strict equality for comparisons, i.e. `===`.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {...Array} [array] The arrays to inspect.\n     * @returns {Array} Returns an array of composite values.\n     * @example\n     *\n     * _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);\n     * // => [1, 2]\n     */\n    function intersection(array) {\n      var args = arguments,\n          argsLength = args.length,\n          argsIndex = -1,\n          caches = getArray(),\n          index = -1,\n          indexOf = getIndexOf(),\n          length = array ? array.length : 0,\n          result = [],\n          seen = getArray();\n\n      while (++argsIndex < argsLength) {\n        var value = args[argsIndex];\n        caches[argsIndex] = indexOf === baseIndexOf &&\n          (value ? value.length : 0) >= largeArraySize &&\n          createCache(argsIndex ? args[argsIndex] : seen);\n      }\n      outer:\n      while (++index < length) {\n        var cache = caches[0];\n        value = array[index];\n\n        if ((cache ? cacheIndexOf(cache, value) : indexOf(seen, value)) < 0) {\n          argsIndex = argsLength;\n          (cache || seen).push(value);\n          while (--argsIndex) {\n            cache = caches[argsIndex];\n            if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) {\n              continue outer;\n            }\n          }\n          result.push(value);\n        }\n      }\n      while (argsLength--) {\n        cache = caches[argsLength];\n        if (cache) {\n          releaseObject(cache);\n        }\n      }\n      releaseArray(caches);\n      releaseArray(seen);\n      return result;\n    }\n\n    /**\n     * Gets the last element or last `n` elements of an array. If a callback is\n     * provided elements at the end of the array are returned as long as the\n     * callback returns truey. The callback is bound to `thisArg` and invoked\n     * with three arguments; (value, index, array).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to query.\n     * @param {Function|Object|number|string} [callback] The function called\n     *  per element or the number of elements to return. If a property name or\n     *  object is provided it will be used to create a \"_.pluck\" or \"_.where\"\n     *  style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {*} Returns the last element(s) of `array`.\n     * @example\n     *\n     * _.last([1, 2, 3]);\n     * // => 3\n     *\n     * _.last([1, 2, 3], 2);\n     * // => [2, 3]\n     *\n     * _.last([1, 2, 3], function(num) {\n     *   return num > 1;\n     * });\n     * // => [2, 3]\n     *\n     * var food = [\n     *   { 'name': 'beet',   'organic': false },\n     *   { 'name': 'carrot', 'organic': true }\n     * ];\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.last(food, 'organic');\n     * // => [{ 'name': 'carrot', 'organic': true }]\n     *\n     * var food = [\n     *   { 'name': 'banana', 'type': 'fruit' },\n     *   { 'name': 'beet',   'type': 'vegetable' },\n     *   { 'name': 'carrot', 'type': 'vegetable' }\n     * ];\n     *\n     * // using \"_.where\" callback shorthand\n     * _.last(food, { 'type': 'vegetable' });\n     * // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }]\n     */\n    function last(array, callback, thisArg) {\n      var n = 0,\n          length = array ? array.length : 0;\n\n      if (typeof callback != 'number' && callback != null) {\n        var index = length;\n        callback = lodash.createCallback(callback, thisArg, 3);\n        while (index-- && callback(array[index], index, array)) {\n          n++;\n        }\n      } else {\n        n = callback;\n        if (n == null || thisArg) {\n          return array ? array[length - 1] : undefined;\n        }\n      }\n      return slice(array, nativeMax(0, length - n));\n    }\n\n    /**\n     * Gets the index at which the last occurrence of `value` is found using strict\n     * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used\n     * as the offset from the end of the collection.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to search.\n     * @param {*} value The value to search for.\n     * @param {number} [fromIndex=array.length-1] The index to search from.\n     * @returns {number} Returns the index of the matched value or `-1`.\n     * @example\n     *\n     * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2);\n     * // => 4\n     *\n     * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3);\n     * // => 1\n     */\n    function lastIndexOf(array, value, fromIndex) {\n      var index = array ? array.length : 0;\n      if (typeof fromIndex == 'number') {\n        index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1;\n      }\n      while (index--) {\n        if (array[index] === value) {\n          return index;\n        }\n      }\n      return -1;\n    }\n\n    /**\n     * Removes all provided values from the given array using strict equality for\n     * comparisons, i.e. `===`.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to modify.\n     * @param {...*} [value] The values to remove.\n     * @returns {Array} Returns `array`.\n     * @example\n     *\n     * var array = [1, 2, 3, 1, 2, 3];\n     * _.pull(array, 2, 3);\n     * console.log(array);\n     * // => [1, 1]\n     */\n    function pull(array) {\n      var args = arguments,\n          argsIndex = 0,\n          argsLength = args.length,\n          length = array ? array.length : 0;\n\n      while (++argsIndex < argsLength) {\n        var index = -1,\n            value = args[argsIndex];\n        while (++index < length) {\n          if (array[index] === value) {\n            splice.call(array, index--, 1);\n            length--;\n          }\n        }\n      }\n      return array;\n    }\n\n    /**\n     * Creates an array of numbers (positive and/or negative) progressing from\n     * `start` up to but not including `end`. If `start` is less than `stop` a\n     * zero-length range is created unless a negative `step` is specified.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {number} [start=0] The start of the range.\n     * @param {number} end The end of the range.\n     * @param {number} [step=1] The value to increment or decrement by.\n     * @returns {Array} Returns a new range array.\n     * @example\n     *\n     * _.range(10);\n     * // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n     *\n     * _.range(1, 11);\n     * // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n     *\n     * _.range(0, 30, 5);\n     * // => [0, 5, 10, 15, 20, 25]\n     *\n     * _.range(0, -10, -1);\n     * // => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]\n     *\n     * _.range(1, 4, 0);\n     * // => [1, 1, 1]\n     *\n     * _.range(0);\n     * // => []\n     */\n    function range(start, end, step) {\n      start = +start || 0;\n      step = typeof step == 'number' ? step : (+step || 1);\n\n      if (end == null) {\n        end = start;\n        start = 0;\n      }\n      // use `Array(length)` so engines, like Chakra and V8, avoid slower modes\n      // http://youtu.be/XAqIpGU8ZZk#t=17m25s\n      var index = -1,\n          length = nativeMax(0, ceil((end - start) / (step || 1))),\n          result = Array(length);\n\n      while (++index < length) {\n        result[index] = start;\n        start += step;\n      }\n      return result;\n    }\n\n    /**\n     * Removes all elements from an array that the callback returns truey for\n     * and returns an array of removed elements. The callback is bound to `thisArg`\n     * and invoked with three arguments; (value, index, array).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to modify.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array} Returns a new array of removed elements.\n     * @example\n     *\n     * var array = [1, 2, 3, 4, 5, 6];\n     * var evens = _.remove(array, function(num) { return num % 2 == 0; });\n     *\n     * console.log(array);\n     * // => [1, 3, 5]\n     *\n     * console.log(evens);\n     * // => [2, 4, 6]\n     */\n    function remove(array, callback, thisArg) {\n      var index = -1,\n          length = array ? array.length : 0,\n          result = [];\n\n      callback = lodash.createCallback(callback, thisArg, 3);\n      while (++index < length) {\n        var value = array[index];\n        if (callback(value, index, array)) {\n          result.push(value);\n          splice.call(array, index--, 1);\n          length--;\n        }\n      }\n      return result;\n    }\n\n    /**\n     * The opposite of `_.initial` this method gets all but the first element or\n     * first `n` elements of an array. If a callback function is provided elements\n     * at the beginning of the array are excluded from the result as long as the\n     * callback returns truey. The callback is bound to `thisArg` and invoked\n     * with three arguments; (value, index, array).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias drop, tail\n     * @category Arrays\n     * @param {Array} array The array to query.\n     * @param {Function|Object|number|string} [callback=1] The function called\n     *  per element or the number of elements to exclude. If a property name or\n     *  object is provided it will be used to create a \"_.pluck\" or \"_.where\"\n     *  style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array} Returns a slice of `array`.\n     * @example\n     *\n     * _.rest([1, 2, 3]);\n     * // => [2, 3]\n     *\n     * _.rest([1, 2, 3], 2);\n     * // => [3]\n     *\n     * _.rest([1, 2, 3], function(num) {\n     *   return num < 3;\n     * });\n     * // => [3]\n     *\n     * var food = [\n     *   { 'name': 'banana', 'organic': true },\n     *   { 'name': 'beet',   'organic': false },\n     * ];\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.rest(food, 'organic');\n     * // => [{ 'name': 'beet', 'organic': false }]\n     *\n     * var food = [\n     *   { 'name': 'apple',  'type': 'fruit' },\n     *   { 'name': 'banana', 'type': 'fruit' },\n     *   { 'name': 'beet',   'type': 'vegetable' }\n     * ];\n     *\n     * // using \"_.where\" callback shorthand\n     * _.rest(food, { 'type': 'fruit' });\n     * // => [{ 'name': 'beet', 'type': 'vegetable' }]\n     */\n    function rest(array, callback, thisArg) {\n      if (typeof callback != 'number' && callback != null) {\n        var n = 0,\n            index = -1,\n            length = array ? array.length : 0;\n\n        callback = lodash.createCallback(callback, thisArg, 3);\n        while (++index < length && callback(array[index], index, array)) {\n          n++;\n        }\n      } else {\n        n = (callback == null || thisArg) ? 1 : nativeMax(0, callback);\n      }\n      return slice(array, n);\n    }\n\n    /**\n     * Uses a binary search to determine the smallest index at which a value\n     * should be inserted into a given sorted array in order to maintain the sort\n     * order of the array. If a callback is provided it will be executed for\n     * `value` and each element of `array` to compute their sort ranking. The\n     * callback is bound to `thisArg` and invoked with one argument; (value).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to inspect.\n     * @param {*} value The value to evaluate.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {number} Returns the index at which `value` should be inserted\n     *  into `array`.\n     * @example\n     *\n     * _.sortedIndex([20, 30, 50], 40);\n     * // => 2\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');\n     * // => 2\n     *\n     * var dict = {\n     *   'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 }\n     * };\n     *\n     * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) {\n     *   return dict.wordToNumber[word];\n     * });\n     * // => 2\n     *\n     * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) {\n     *   return this.wordToNumber[word];\n     * }, dict);\n     * // => 2\n     */\n    function sortedIndex(array, value, callback, thisArg) {\n      var low = 0,\n          high = array ? array.length : low;\n\n      // explicitly reference `identity` for better inlining in Firefox\n      callback = callback ? lodash.createCallback(callback, thisArg, 1) : identity;\n      value = callback(value);\n\n      while (low < high) {\n        var mid = (low + high) >>> 1;\n        (callback(array[mid]) < value)\n          ? low = mid + 1\n          : high = mid;\n      }\n      return low;\n    }\n\n    /**\n     * Creates an array of unique values, in order, of the provided arrays using\n     * strict equality for comparisons, i.e. `===`.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {...Array} [array] The arrays to inspect.\n     * @returns {Array} Returns an array of composite values.\n     * @example\n     *\n     * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);\n     * // => [1, 2, 3, 101, 10]\n     */\n    function union(array) {\n      return baseUniq(baseFlatten(arguments, true, true));\n    }\n\n    /**\n     * Creates a duplicate-value-free version of an array using strict equality\n     * for comparisons, i.e. `===`. If the array is sorted, providing\n     * `true` for `isSorted` will use a faster algorithm. If a callback is provided\n     * each element of `array` is passed through the callback before uniqueness\n     * is computed. The callback is bound to `thisArg` and invoked with three\n     * arguments; (value, index, array).\n     *\n     * If a property name is provided for `callback` the created \"_.pluck\" style\n     * callback will return the property value of the given element.\n     *\n     * If an object is provided for `callback` the created \"_.where\" style callback\n     * will return `true` for elements that have the properties of the given object,\n     * else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias unique\n     * @category Arrays\n     * @param {Array} array The array to process.\n     * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted.\n     * @param {Function|Object|string} [callback=identity] The function called\n     *  per iteration. If a property name or object is provided it will be used\n     *  to create a \"_.pluck\" or \"_.where\" style callback, respectively.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array} Returns a duplicate-value-free array.\n     * @example\n     *\n     * _.uniq([1, 2, 1, 3, 1]);\n     * // => [1, 2, 3]\n     *\n     * _.uniq([1, 1, 2, 2, 3], true);\n     * // => [1, 2, 3]\n     *\n     * _.uniq(['A', 'b', 'C', 'a', 'B', 'c'], function(letter) { return letter.toLowerCase(); });\n     * // => ['A', 'b', 'C']\n     *\n     * _.uniq([1, 2.5, 3, 1.5, 2, 3.5], function(num) { return this.floor(num); }, Math);\n     * // => [1, 2.5, 3]\n     *\n     * // using \"_.pluck\" callback shorthand\n     * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n     * // => [{ 'x': 1 }, { 'x': 2 }]\n     */\n    function uniq(array, isSorted, callback, thisArg) {\n      // juggle arguments\n      if (typeof isSorted != 'boolean' && isSorted != null) {\n        thisArg = callback;\n        callback = !(thisArg && thisArg[isSorted] === array) ? isSorted : null;\n        isSorted = false;\n      }\n      if (callback != null) {\n        callback = lodash.createCallback(callback, thisArg, 3);\n      }\n      return baseUniq(array, isSorted, callback);\n    }\n\n    /**\n     * Creates an array excluding all provided values using strict equality for\n     * comparisons, i.e. `===`.\n     *\n     * @static\n     * @memberOf _\n     * @category Arrays\n     * @param {Array} array The array to filter.\n     * @param {...*} [value] The values to exclude.\n     * @returns {Array} Returns a new array of filtered values.\n     * @example\n     *\n     * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1);\n     * // => [2, 3, 4]\n     */\n    function without(array) {\n      return difference(array, nativeSlice.call(arguments, 1));\n    }\n\n    /**\n     * Creates an array of grouped elements, the first of which contains the first\n     * elements of the given arrays, the second of which contains the second\n     * elements of the given arrays, and so on.\n     *\n     * @static\n     * @memberOf _\n     * @alias unzip\n     * @category Arrays\n     * @param {...Array} [array] Arrays to process.\n     * @returns {Array} Returns a new array of grouped elements.\n     * @example\n     *\n     * _.zip(['moe', 'larry'], [30, 40], [true, false]);\n     * // => [['moe', 30, true], ['larry', 40, false]]\n     */\n    function zip() {\n      var array = arguments.length > 1 ? arguments : arguments[0],\n          index = -1,\n          length = array ? max(pluck(array, 'length')) : 0,\n          result = Array(length < 0 ? 0 : length);\n\n      while (++index < length) {\n        result[index] = pluck(array, index);\n      }\n      return result;\n    }\n\n    /**\n     * Creates an object composed from arrays of `keys` and `values`. Provide\n     * either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`\n     * or two arrays, one of `keys` and one of corresponding `values`.\n     *\n     * @static\n     * @memberOf _\n     * @alias object\n     * @category Arrays\n     * @param {Array} keys The array of keys.\n     * @param {Array} [values=[]] The array of values.\n     * @returns {Object} Returns an object composed of the given keys and\n     *  corresponding values.\n     * @example\n     *\n     * _.zipObject(['moe', 'larry'], [30, 40]);\n     * // => { 'moe': 30, 'larry': 40 }\n     */\n    function zipObject(keys, values) {\n      var index = -1,\n          length = keys ? keys.length : 0,\n          result = {};\n\n      while (++index < length) {\n        var key = keys[index];\n        if (values) {\n          result[key] = values[index];\n        } else if (key) {\n          result[key[0]] = key[1];\n        }\n      }\n      return result;\n    }\n\n    /*--------------------------------------------------------------------------*/\n\n    /**\n     * Creates a function that executes `func`, with  the `this` binding and\n     * arguments of the created function, only after being called `n` times.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {number} n The number of times the function must be called before\n     *  `func` is executed.\n     * @param {Function} func The function to restrict.\n     * @returns {Function} Returns the new restricted function.\n     * @example\n     *\n     * var saves = ['profile', 'settings'];\n     *\n     * var done = _.after(saves.length, function() {\n     *   console.log('Done saving!');\n     * });\n     *\n     * _.forEach(saves, function(type) {\n     *   asyncSave({ 'type': type, 'complete': done });\n     * });\n     * // => logs 'Done saving!', after all saves have completed\n     */\n    function after(n, func) {\n      if (!isFunction(func)) {\n        throw new TypeError;\n      }\n      return function() {\n        if (--n < 1) {\n          return func.apply(this, arguments);\n        }\n      };\n    }\n\n    /**\n     * Creates a function that, when called, invokes `func` with the `this`\n     * binding of `thisArg` and prepends any additional `bind` arguments to those\n     * provided to the bound function.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Function} func The function to bind.\n     * @param {*} [thisArg] The `this` binding of `func`.\n     * @param {...*} [arg] Arguments to be partially applied.\n     * @returns {Function} Returns the new bound function.\n     * @example\n     *\n     * var func = function(greeting) {\n     *   return greeting + ' ' + this.name;\n     * };\n     *\n     * func = _.bind(func, { 'name': 'moe' }, 'hi');\n     * func();\n     * // => 'hi moe'\n     */\n    function bind(func, thisArg) {\n      return arguments.length > 2\n        ? createBound(func, 17, nativeSlice.call(arguments, 2), null, thisArg)\n        : createBound(func, 1, null, null, thisArg);\n    }\n\n    /**\n     * Binds methods of an object to the object itself, overwriting the existing\n     * method. Method names may be specified as individual arguments or as arrays\n     * of method names. If no method names are provided all the function properties\n     * of `object` will be bound.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Object} object The object to bind and assign the bound methods to.\n     * @param {...string} [methodName] The object method names to\n     *  bind, specified as individual method names or arrays of method names.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * var view = {\n     *  'label': 'docs',\n     *  'onClick': function() { console.log('clicked ' + this.label); }\n     * };\n     *\n     * _.bindAll(view);\n     * jQuery('#docs').on('click', view.onClick);\n     * // => logs 'clicked docs', when the button is clicked\n     */\n    function bindAll(object) {\n      var funcs = arguments.length > 1 ? baseFlatten(arguments, true, false, 1) : functions(object),\n          index = -1,\n          length = funcs.length;\n\n      while (++index < length) {\n        var key = funcs[index];\n        object[key] = createBound(object[key], 1, null, null, object);\n      }\n      return object;\n    }\n\n    /**\n     * Creates a function that, when called, invokes the method at `object[key]`\n     * and prepends any additional `bindKey` arguments to those provided to the bound\n     * function. This method differs from `_.bind` by allowing bound functions to\n     * reference methods that will be redefined or don't yet exist.\n     * See http://michaux.ca/articles/lazy-function-definition-pattern.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Object} object The object the method belongs to.\n     * @param {string} key The key of the method.\n     * @param {...*} [arg] Arguments to be partially applied.\n     * @returns {Function} Returns the new bound function.\n     * @example\n     *\n     * var object = {\n     *   'name': 'moe',\n     *   'greet': function(greeting) {\n     *     return greeting + ' ' + this.name;\n     *   }\n     * };\n     *\n     * var func = _.bindKey(object, 'greet', 'hi');\n     * func();\n     * // => 'hi moe'\n     *\n     * object.greet = function(greeting) {\n     *   return greeting + ', ' + this.name + '!';\n     * };\n     *\n     * func();\n     * // => 'hi, moe!'\n     */\n    function bindKey(object, key) {\n      return arguments.length > 2\n        ? createBound(key, 19, nativeSlice.call(arguments, 2), null, object)\n        : createBound(key, 3, null, null, object);\n    }\n\n    /**\n     * Creates a function that is the composition of the provided functions,\n     * where each function consumes the return value of the function that follows.\n     * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`.\n     * Each function is executed with the `this` binding of the composed function.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {...Function} [func] Functions to compose.\n     * @returns {Function} Returns the new composed function.\n     * @example\n     *\n     * var realNameMap = {\n     *   'curly': 'jerome'\n     * };\n     *\n     * var format = function(name) {\n     *   name = realNameMap[name.toLowerCase()] || name;\n     *   return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase();\n     * };\n     *\n     * var greet = function(formatted) {\n     *   return 'Hiya ' + formatted + '!';\n     * };\n     *\n     * var welcome = _.compose(greet, format);\n     * welcome('curly');\n     * // => 'Hiya Jerome!'\n     */\n    function compose() {\n      var funcs = arguments,\n          length = funcs.length;\n\n      while (length--) {\n        if (!isFunction(funcs[length])) {\n          throw new TypeError;\n        }\n      }\n      return function() {\n        var args = arguments,\n            length = funcs.length;\n\n        while (length--) {\n          args = [funcs[length].apply(this, args)];\n        }\n        return args[0];\n      };\n    }\n\n    /**\n     * Produces a callback bound to an optional `thisArg`. If `func` is a property\n     * name the created callback will return the property value for a given element.\n     * If `func` is an object the created callback will return `true` for elements\n     * that contain the equivalent object properties, otherwise it will return `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {*} [func=identity] The value to convert to a callback.\n     * @param {*} [thisArg] The `this` binding of the created callback.\n     * @param {number} [argCount] The number of arguments the callback accepts.\n     * @returns {Function} Returns a callback function.\n     * @example\n     *\n     * var stooges = [\n     *   { 'name': 'moe', 'age': 40 },\n     *   { 'name': 'larry', 'age': 50 }\n     * ];\n     *\n     * // wrap to create custom callback shorthands\n     * _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {\n     *   var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);\n     *   return !match ? func(callback, thisArg) : function(object) {\n     *     return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];\n     *   };\n     * });\n     *\n     * _.filter(stooges, 'age__gt45');\n     * // => [{ 'name': 'larry', 'age': 50 }]\n     */\n    function createCallback(func, thisArg, argCount) {\n      var type = typeof func;\n      if (func == null || type == 'function') {\n        return baseCreateCallback(func, thisArg, argCount);\n      }\n      // handle \"_.pluck\" style callback shorthands\n      if (type != 'object') {\n        return function(object) {\n          return object[func];\n        };\n      }\n      var props = keys(func),\n          key = props[0],\n          a = func[key];\n\n      // handle \"_.where\" style callback shorthands\n      if (props.length == 1 && a === a && !isObject(a)) {\n        // fast path the common case of providing an object with a single\n        // property containing a primitive value\n        return function(object) {\n          var b = object[key];\n          return a === b && (a !== 0 || (1 / a == 1 / b));\n        };\n      }\n      return function(object) {\n        var length = props.length,\n            result = false;\n\n        while (length--) {\n          if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) {\n            break;\n          }\n        }\n        return result;\n      };\n    }\n\n    /**\n     * Creates a function which accepts one or more arguments of `func` that when\n     * invoked either executes `func` returning its result, if all `func` arguments\n     * have been provided, or returns a function that accepts one or more of the\n     * remaining `func` arguments, and so on. The arity of `func` can be specified\n     * if `func.length` is not sufficient.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Function} func The function to curry.\n     * @param {number} [arity=func.length] The arity of `func`.\n     * @returns {Function} Returns the new curried function.\n     * @example\n     *\n     * var curried = _.curry(function(a, b, c) {\n     *   console.log(a + b + c);\n     * });\n     *\n     * curried(1)(2)(3);\n     * // => 6\n     *\n     * curried(1, 2)(3);\n     * // => 6\n     *\n     * curried(1, 2, 3);\n     * // => 6\n     */\n    function curry(func, arity) {\n      arity = typeof arity == 'number' ? arity : (+arity || func.length);\n      return createBound(func, 4, null, null, null, arity);\n    }\n\n    /**\n     * Creates a function that will delay the execution of `func` until after\n     * `wait` milliseconds have elapsed since the last time it was invoked.\n     * Provide an options object to indicate that `func` should be invoked on\n     * the leading and/or trailing edge of the `wait` timeout. Subsequent calls\n     * to the debounced function will return the result of the last `func` call.\n     *\n     * Note: If `leading` and `trailing` options are `true` `func` will be called\n     * on the trailing edge of the timeout only if the the debounced function is\n     * invoked more than once during the `wait` timeout.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Function} func The function to debounce.\n     * @param {number} wait The number of milliseconds to delay.\n     * @param {Object} [options] The options object.\n     * @param {boolean} [options.leading=false] Specify execution on the leading edge of the timeout.\n     * @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's called.\n     * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout.\n     * @returns {Function} Returns the new debounced function.\n     * @example\n     *\n     * // avoid costly calculations while the window size is in flux\n     * var lazyLayout = _.debounce(calculateLayout, 150);\n     * jQuery(window).on('resize', lazyLayout);\n     *\n     * // execute `sendMail` when the click event is fired, debouncing subsequent calls\n     * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {\n     *   'leading': true,\n     *   'trailing': false\n     * });\n     *\n     * // ensure `batchLog` is executed once after 1 second of debounced calls\n     * var source = new EventSource('/stream');\n     * source.addEventListener('message', _.debounce(batchLog, 250, {\n     *   'maxWait': 1000\n     * }, false);\n     */\n    function debounce(func, wait, options) {\n      var args,\n          maxTimeoutId,\n          result,\n          stamp,\n          thisArg,\n          timeoutId,\n          trailingCall,\n          lastCalled = 0,\n          maxWait = false,\n          trailing = true;\n\n      if (!isFunction(func)) {\n        throw new TypeError;\n      }\n      wait = nativeMax(0, wait) || 0;\n      if (options === true) {\n        var leading = true;\n        trailing = false;\n      } else if (isObject(options)) {\n        leading = options.leading;\n        maxWait = 'maxWait' in options && (nativeMax(wait, options.maxWait) || 0);\n        trailing = 'trailing' in options ? options.trailing : trailing;\n      }\n      var delayed = function() {\n        var remaining = wait - (now() - stamp);\n        if (remaining <= 0) {\n          if (maxTimeoutId) {\n            clearTimeout(maxTimeoutId);\n          }\n          var isCalled = trailingCall;\n          maxTimeoutId = timeoutId = trailingCall = undefined;\n          if (isCalled) {\n            lastCalled = now();\n            result = func.apply(thisArg, args);\n          }\n        } else {\n          timeoutId = setTimeout(delayed, remaining);\n        }\n      };\n\n      var maxDelayed = function() {\n        if (timeoutId) {\n          clearTimeout(timeoutId);\n        }\n        maxTimeoutId = timeoutId = trailingCall = undefined;\n        if (trailing || (maxWait !== wait)) {\n          lastCalled = now();\n          result = func.apply(thisArg, args);\n        }\n      };\n\n      return function() {\n        args = arguments;\n        stamp = now();\n        thisArg = this;\n        trailingCall = trailing && (timeoutId || !leading);\n\n        if (maxWait === false) {\n          var leadingCall = leading && !timeoutId;\n        } else {\n          if (!maxTimeoutId && !leading) {\n            lastCalled = stamp;\n          }\n          var remaining = maxWait - (stamp - lastCalled);\n          if (remaining <= 0) {\n            if (maxTimeoutId) {\n              maxTimeoutId = clearTimeout(maxTimeoutId);\n            }\n            lastCalled = stamp;\n            result = func.apply(thisArg, args);\n          }\n          else if (!maxTimeoutId) {\n            maxTimeoutId = setTimeout(maxDelayed, remaining);\n          }\n        }\n        if (!timeoutId && wait !== maxWait) {\n          timeoutId = setTimeout(delayed, wait);\n        }\n        if (leadingCall) {\n          result = func.apply(thisArg, args);\n        }\n        return result;\n      };\n    }\n\n    /**\n     * Defers executing the `func` function until the current call stack has cleared.\n     * Additional arguments will be provided to `func` when it is invoked.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Function} func The function to defer.\n     * @param {...*} [arg] Arguments to invoke the function with.\n     * @returns {number} Returns the timer id.\n     * @example\n     *\n     * _.defer(function() { console.log('deferred'); });\n     * // returns from the function before 'deferred' is logged\n     */\n    function defer(func) {\n      if (!isFunction(func)) {\n        throw new TypeError;\n      }\n      var args = nativeSlice.call(arguments, 1);\n      return setTimeout(function() { func.apply(undefined, args); }, 1);\n    }\n    // use `setImmediate` if available in Node.js\n    if (isV8 && moduleExports && typeof setImmediate == 'function') {\n      defer = function(func) {\n        if (!isFunction(func)) {\n          throw new TypeError;\n        }\n        return setImmediate.apply(context, arguments);\n      };\n    }\n\n    /**\n     * Executes the `func` function after `wait` milliseconds. Additional arguments\n     * will be provided to `func` when it is invoked.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Function} func The function to delay.\n     * @param {number} wait The number of milliseconds to delay execution.\n     * @param {...*} [arg] Arguments to invoke the function with.\n     * @returns {number} Returns the timer id.\n     * @example\n     *\n     * var log = _.bind(console.log, console);\n     * _.delay(log, 1000, 'logged later');\n     * // => 'logged later' (Appears after one second.)\n     */\n    function delay(func, wait) {\n      if (!isFunction(func)) {\n        throw new TypeError;\n      }\n      var args = nativeSlice.call(arguments, 2);\n      return setTimeout(function() { func.apply(undefined, args); }, wait);\n    }\n\n    /**\n     * Creates a function that memoizes the result of `func`. If `resolver` is\n     * provided it will be used to determine the cache key for storing the result\n     * based on the arguments provided to the memoized function. By default, the\n     * first argument provided to the memoized function is used as the cache key.\n     * The `func` is executed with the `this` binding of the memoized function.\n     * The result cache is exposed as the `cache` property on the memoized function.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Function} func The function to have its output memoized.\n     * @param {Function} [resolver] A function used to resolve the cache key.\n     * @returns {Function} Returns the new memoizing function.\n     * @example\n     *\n     * var fibonacci = _.memoize(function(n) {\n     *   return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);\n     * });\n     *\n     * var data = {\n     *   'moe': { 'name': 'moe', 'age': 40 },\n     *   'curly': { 'name': 'curly', 'age': 60 }\n     * };\n     *\n     * // modifying the result cache\n     * var stooge = _.memoize(function(name) { return data[name]; }, _.identity);\n     * stooge('curly');\n     * // => { 'name': 'curly', 'age': 60 }\n     *\n     * stooge.cache.curly.name = 'jerome';\n     * stooge('curly');\n     * // => { 'name': 'jerome', 'age': 60 }\n     */\n    function memoize(func, resolver) {\n      if (!isFunction(func)) {\n        throw new TypeError;\n      }\n      var memoized = function() {\n        var cache = memoized.cache,\n            key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0];\n\n        return hasOwnProperty.call(cache, key)\n          ? cache[key]\n          : (cache[key] = func.apply(this, arguments));\n      }\n      memoized.cache = {};\n      return memoized;\n    }\n\n    /**\n     * Creates a function that is restricted to execute `func` once. Repeat calls to\n     * the function will return the value of the first call. The `func` is executed\n     * with the `this` binding of the created function.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Function} func The function to restrict.\n     * @returns {Function} Returns the new restricted function.\n     * @example\n     *\n     * var initialize = _.once(createApplication);\n     * initialize();\n     * initialize();\n     * // `initialize` executes `createApplication` once\n     */\n    function once(func) {\n      var ran,\n          result;\n\n      if (!isFunction(func)) {\n        throw new TypeError;\n      }\n      return function() {\n        if (ran) {\n          return result;\n        }\n        ran = true;\n        result = func.apply(this, arguments);\n\n        // clear the `func` variable so the function may be garbage collected\n        func = null;\n        return result;\n      };\n    }\n\n    /**\n     * Creates a function that, when called, invokes `func` with any additional\n     * `partial` arguments prepended to those provided to the new function. This\n     * method is similar to `_.bind` except it does **not** alter the `this` binding.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Function} func The function to partially apply arguments to.\n     * @param {...*} [arg] Arguments to be partially applied.\n     * @returns {Function} Returns the new partially applied function.\n     * @example\n     *\n     * var greet = function(greeting, name) { return greeting + ' ' + name; };\n     * var hi = _.partial(greet, 'hi');\n     * hi('moe');\n     * // => 'hi moe'\n     */\n    function partial(func) {\n      return createBound(func, 16, nativeSlice.call(arguments, 1));\n    }\n\n    /**\n     * This method is like `_.partial` except that `partial` arguments are\n     * appended to those provided to the new function.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Function} func The function to partially apply arguments to.\n     * @param {...*} [arg] Arguments to be partially applied.\n     * @returns {Function} Returns the new partially applied function.\n     * @example\n     *\n     * var defaultsDeep = _.partialRight(_.merge, _.defaults);\n     *\n     * var options = {\n     *   'variable': 'data',\n     *   'imports': { 'jq': $ }\n     * };\n     *\n     * defaultsDeep(options, _.templateSettings);\n     *\n     * options.variable\n     * // => 'data'\n     *\n     * options.imports\n     * // => { '_': _, 'jq': $ }\n     */\n    function partialRight(func) {\n      return createBound(func, 32, null, nativeSlice.call(arguments, 1));\n    }\n\n    /**\n     * Creates a function that, when executed, will only call the `func` function\n     * at most once per every `wait` milliseconds. Provide an options object to\n     * indicate that `func` should be invoked on the leading and/or trailing edge\n     * of the `wait` timeout. Subsequent calls to the throttled function will\n     * return the result of the last `func` call.\n     *\n     * Note: If `leading` and `trailing` options are `true` `func` will be called\n     * on the trailing edge of the timeout only if the the throttled function is\n     * invoked more than once during the `wait` timeout.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {Function} func The function to throttle.\n     * @param {number} wait The number of milliseconds to throttle executions to.\n     * @param {Object} [options] The options object.\n     * @param {boolean} [options.leading=true] Specify execution on the leading edge of the timeout.\n     * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout.\n     * @returns {Function} Returns the new throttled function.\n     * @example\n     *\n     * // avoid excessively updating the position while scrolling\n     * var throttled = _.throttle(updatePosition, 100);\n     * jQuery(window).on('scroll', throttled);\n     *\n     * // execute `renewToken` when the click event is fired, but not more than once every 5 minutes\n     * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {\n     *   'trailing': false\n     * }));\n     */\n    function throttle(func, wait, options) {\n      var leading = true,\n          trailing = true;\n\n      if (!isFunction(func)) {\n        throw new TypeError;\n      }\n      if (options === false) {\n        leading = false;\n      } else if (isObject(options)) {\n        leading = 'leading' in options ? options.leading : leading;\n        trailing = 'trailing' in options ? options.trailing : trailing;\n      }\n      debounceOptions.leading = leading;\n      debounceOptions.maxWait = wait;\n      debounceOptions.trailing = trailing;\n\n      var result = debounce(func, wait, debounceOptions);\n      return result;\n    }\n\n    /**\n     * Creates a function that provides `value` to the wrapper function as its\n     * first argument. Additional arguments provided to the function are appended\n     * to those provided to the wrapper function. The wrapper is executed with\n     * the `this` binding of the created function.\n     *\n     * @static\n     * @memberOf _\n     * @category Functions\n     * @param {*} value The value to wrap.\n     * @param {Function} wrapper The wrapper function.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var hello = function(name) { return 'hello ' + name; };\n     * hello = _.wrap(hello, function(func) {\n     *   return 'before, ' + func('moe') + ', after';\n     * });\n     * hello();\n     * // => 'before, hello moe, after'\n     */\n    function wrap(value, wrapper) {\n      if (!isFunction(wrapper)) {\n        throw new TypeError;\n      }\n      return function() {\n        var args = [value];\n        push.apply(args, arguments);\n        return wrapper.apply(this, args);\n      };\n    }\n\n    /*--------------------------------------------------------------------------*/\n\n    /**\n     * Converts the characters `&`, `<`, `>`, `\"`, and `'` in `string` to their\n     * corresponding HTML entities.\n     *\n     * @static\n     * @memberOf _\n     * @category Utilities\n     * @param {string} string The string to escape.\n     * @returns {string} Returns the escaped string.\n     * @example\n     *\n     * _.escape('Moe, Larry & Curly');\n     * // => 'Moe, Larry &amp; Curly'\n     */\n    function escape(string) {\n      return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar);\n    }\n\n    /**\n     * This method returns the first argument provided to it.\n     *\n     * @static\n     * @memberOf _\n     * @category Utilities\n     * @param {*} value Any value.\n     * @returns {*} Returns `value`.\n     * @example\n     *\n     * var moe = { 'name': 'moe' };\n     * moe === _.identity(moe);\n     * // => true\n     */\n    function identity(value) {\n      return value;\n    }\n\n    /**\n     * Adds function properties of a source object to the `lodash` function and\n     * chainable wrapper.\n     *\n     * @static\n     * @memberOf _\n     * @category Utilities\n     * @param {Object} object The object of function properties to add to `lodash`.\n     * @param {Object} object The object of function properties to add to `lodash`.\n     * @example\n     *\n     * _.mixin({\n     *   'capitalize': function(string) {\n     *     return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n     *   }\n     * });\n     *\n     * _.capitalize('moe');\n     * // => 'Moe'\n     *\n     * _('moe').capitalize();\n     * // => 'Moe'\n     */\n    function mixin(object, source) {\n      var ctor = object,\n          isFunc = !source || isFunction(ctor);\n\n      if (!source) {\n        ctor = lodashWrapper;\n        source = object;\n        object = lodash;\n      }\n      forEach(functions(source), function(methodName) {\n        var func = object[methodName] = source[methodName];\n        if (isFunc) {\n          ctor.prototype[methodName] = function() {\n            var value = this.__wrapped__,\n                args = [value];\n\n            push.apply(args, arguments);\n            var result = func.apply(object, args);\n            if (value && typeof value == 'object' && value === result) {\n              return this;\n            }\n            result = new ctor(result);\n            result.__chain__ = this.__chain__;\n            return result;\n          };\n        }\n      });\n    }\n\n    /**\n     * Reverts the '_' variable to its previous value and returns a reference to\n     * the `lodash` function.\n     *\n     * @static\n     * @memberOf _\n     * @category Utilities\n     * @returns {Function} Returns the `lodash` function.\n     * @example\n     *\n     * var lodash = _.noConflict();\n     */\n    function noConflict() {\n      context._ = oldDash;\n      return this;\n    }\n\n    /**\n     * Converts the given value into an integer of the specified radix.\n     * If `radix` is `undefined` or `0` a `radix` of `10` is used unless the\n     * `value` is a hexadecimal, in which case a `radix` of `16` is used.\n     *\n     * Note: This method avoids differences in native ES3 and ES5 `parseInt`\n     * implementations. See http://es5.github.io/#E.\n     *\n     * @static\n     * @memberOf _\n     * @category Utilities\n     * @param {string} value The value to parse.\n     * @param {number} [radix] The radix used to interpret the value to parse.\n     * @returns {number} Returns the new integer value.\n     * @example\n     *\n     * _.parseInt('08');\n     * // => 8\n     */\n    var parseInt = nativeParseInt(whitespace + '08') == 8 ? nativeParseInt : function(value, radix) {\n      // Firefox and Opera still follow the ES3 specified implementation of `parseInt`\n      return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0);\n    };\n\n    /**\n     * Produces a random number between `min` and `max` (inclusive). If only one\n     * argument is provided a number between `0` and the given number will be\n     * returned. If `floating` is truey or either `min` or `max` are floats a\n     * floating-point number will be returned instead of an integer.\n     *\n     * @static\n     * @memberOf _\n     * @category Utilities\n     * @param {number} [min=0] The minimum possible value.\n     * @param {number} [max=1] The maximum possible value.\n     * @param {boolean} [floating=false] Specify returning a floating-point number.\n     * @returns {number} Returns a random number.\n     * @example\n     *\n     * _.random(0, 5);\n     * // => an integer between 0 and 5\n     *\n     * _.random(5);\n     * // => also an integer between 0 and 5\n     *\n     * _.random(5, true);\n     * // => a floating-point number between 0 and 5\n     *\n     * _.random(1.2, 5.2);\n     * // => a floating-point number between 1.2 and 5.2\n     */\n    function random(min, max, floating) {\n      var noMin = min == null,\n          noMax = max == null;\n\n      if (floating == null) {\n        if (typeof min == 'boolean' && noMax) {\n          floating = min;\n          min = 1;\n        }\n        else if (!noMax && typeof max == 'boolean') {\n          floating = max;\n          noMax = true;\n        }\n      }\n      if (noMin && noMax) {\n        max = 1;\n      }\n      min = +min || 0;\n      if (noMax) {\n        max = min;\n        min = 0;\n      } else {\n        max = +max || 0;\n      }\n      var rand = nativeRandom();\n      return (floating || min % 1 || max % 1)\n        ? nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1)))), max)\n        : min + floor(rand * (max - min + 1));\n    }\n\n    /**\n     * Resolves the value of `property` on `object`. If `property` is a function\n     * it will be invoked with the `this` binding of `object` and its result returned,\n     * else the property value is returned. If `object` is falsey then `undefined`\n     * is returned.\n     *\n     * @static\n     * @memberOf _\n     * @category Utilities\n     * @param {Object} object The object to inspect.\n     * @param {string} property The property to get the value of.\n     * @returns {*} Returns the resolved value.\n     * @example\n     *\n     * var object = {\n     *   'cheese': 'crumpets',\n     *   'stuff': function() {\n     *     return 'nonsense';\n     *   }\n     * };\n     *\n     * _.result(object, 'cheese');\n     * // => 'crumpets'\n     *\n     * _.result(object, 'stuff');\n     * // => 'nonsense'\n     */\n    function result(object, property) {\n      if (object) {\n        var value = object[property];\n        return isFunction(value) ? object[property]() : value;\n      }\n    }\n\n    /**\n     * A micro-templating method that handles arbitrary delimiters, preserves\n     * whitespace, and correctly escapes quotes within interpolated code.\n     *\n     * Note: In the development build, `_.template` utilizes sourceURLs for easier\n     * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl\n     *\n     * For more information on precompiling templates see:\n     * http://lodash.com/#custom-builds\n     *\n     * For more information on Chrome extension sandboxes see:\n     * http://developer.chrome.com/stable/extensions/sandboxingEval.html\n     *\n     * @static\n     * @memberOf _\n     * @category Utilities\n     * @param {string} text The template text.\n     * @param {Object} data The data object used to populate the text.\n     * @param {Object} [options] The options object.\n     * @param {RegExp} [options.escape] The \"escape\" delimiter.\n     * @param {RegExp} [options.evaluate] The \"evaluate\" delimiter.\n     * @param {Object} [options.imports] An object to import into the template as local variables.\n     * @param {RegExp} [options.interpolate] The \"interpolate\" delimiter.\n     * @param {string} [sourceURL] The sourceURL of the template's compiled source.\n     * @param {string} [variable] The data object variable name.\n     * @returns {Function|string} Returns a compiled function when no `data` object\n     *  is given, else it returns the interpolated text.\n     * @example\n     *\n     * // using the \"interpolate\" delimiter to create a compiled template\n     * var compiled = _.template('hello <%= name %>');\n     * compiled({ 'name': 'moe' });\n     * // => 'hello moe'\n     *\n     * // using the \"escape\" delimiter to escape HTML in data property values\n     * _.template('<b><%- value %></b>', { 'value': '<script>' });\n     * // => '<b>&lt;script&gt;</b>'\n     *\n     * // using the \"evaluate\" delimiter to generate HTML\n     * var list = '<% _.forEach(people, function(name) { %><li><%- name %></li><% }); %>';\n     * _.template(list, { 'people': ['moe', 'larry'] });\n     * // => '<li>moe</li><li>larry</li>'\n     *\n     * // using the ES6 delimiter as an alternative to the default \"interpolate\" delimiter\n     * _.template('hello ${ name }', { 'name': 'curly' });\n     * // => 'hello curly'\n     *\n     * // using the internal `print` function in \"evaluate\" delimiters\n     * _.template('<% print(\"hello \" + name); %>!', { 'name': 'larry' });\n     * // => 'hello larry!'\n     *\n     * // using a custom template delimiters\n     * _.templateSettings = {\n     *   'interpolate': /{{([\\s\\S]+?)}}/g\n     * };\n     *\n     * _.template('hello {{ name }}!', { 'name': 'mustache' });\n     * // => 'hello mustache!'\n     *\n     * // using the `imports` option to import jQuery\n     * var list = '<% $.each(people, function(name) { %><li><%- name %></li><% }); %>';\n     * _.template(list, { 'people': ['moe', 'larry'] }, { 'imports': { '$': jQuery } });\n     * // => '<li>moe</li><li>larry</li>'\n     *\n     * // using the `sourceURL` option to specify a custom sourceURL for the template\n     * var compiled = _.template('hello <%= name %>', null, { 'sourceURL': '/basic/greeting.jst' });\n     * compiled(data);\n     * // => find the source of \"greeting.jst\" under the Sources tab or Resources panel of the web inspector\n     *\n     * // using the `variable` option to ensure a with-statement isn't used in the compiled template\n     * var compiled = _.template('hi <%= data.name %>!', null, { 'variable': 'data' });\n     * compiled.source;\n     * // => function(data) {\n     *   var __t, __p = '', __e = _.escape;\n     *   __p += 'hi ' + ((__t = ( data.name )) == null ? '' : __t) + '!';\n     *   return __p;\n     * }\n     *\n     * // using the `source` property to inline compiled templates for meaningful\n     * // line numbers in error messages and a stack trace\n     * fs.writeFileSync(path.join(cwd, 'jst.js'), '\\\n     *   var JST = {\\\n     *     \"main\": ' + _.template(mainText).source + '\\\n     *   };\\\n     * ');\n     */\n    function template(text, data, options) {\n      // based on John Resig's `tmpl` implementation\n      // http://ejohn.org/blog/javascript-micro-templating/\n      // and Laura Doktorova's doT.js\n      // https://github.com/olado/doT\n      var settings = lodash.templateSettings;\n      text || (text = '');\n\n      // avoid missing dependencies when `iteratorTemplate` is not defined\n      options = defaults({}, options, settings);\n\n      var imports = defaults({}, options.imports, settings.imports),\n          importsKeys = keys(imports),\n          importsValues = values(imports);\n\n      var isEvaluating,\n          index = 0,\n          interpolate = options.interpolate || reNoMatch,\n          source = \"__p += '\";\n\n      // compile the regexp to match each delimiter\n      var reDelimiters = RegExp(\n        (options.escape || reNoMatch).source + '|' +\n        interpolate.source + '|' +\n        (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +\n        (options.evaluate || reNoMatch).source + '|$'\n      , 'g');\n\n      text.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {\n        interpolateValue || (interpolateValue = esTemplateValue);\n\n        // escape characters that cannot be included in string literals\n        source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);\n\n        // replace delimiters with snippets\n        if (escapeValue) {\n          source += \"' +\\n__e(\" + escapeValue + \") +\\n'\";\n        }\n        if (evaluateValue) {\n          isEvaluating = true;\n          source += \"';\\n\" + evaluateValue + \";\\n__p += '\";\n        }\n        if (interpolateValue) {\n          source += \"' +\\n((__t = (\" + interpolateValue + \")) == null ? '' : __t) +\\n'\";\n        }\n        index = offset + match.length;\n\n        // the JS engine embedded in Adobe products requires returning the `match`\n        // string in order to produce the correct `offset` value\n        return match;\n      });\n\n      source += \"';\\n\";\n\n      // if `variable` is not specified, wrap a with-statement around the generated\n      // code to add the data object to the top of the scope chain\n      var variable = options.variable,\n          hasVariable = variable;\n\n      if (!hasVariable) {\n        variable = 'obj';\n        source = 'with (' + variable + ') {\\n' + source + '\\n}\\n';\n      }\n      // cleanup code by stripping empty strings\n      source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)\n        .replace(reEmptyStringMiddle, '$1')\n        .replace(reEmptyStringTrailing, '$1;');\n\n      // frame code as the function body\n      source = 'function(' + variable + ') {\\n' +\n        (hasVariable ? '' : variable + ' || (' + variable + ' = {});\\n') +\n        \"var __t, __p = '', __e = _.escape\" +\n        (isEvaluating\n          ? ', __j = Array.prototype.join;\\n' +\n            \"function print() { __p += __j.call(arguments, '') }\\n\"\n          : ';\\n'\n        ) +\n        source +\n        'return __p\\n}';\n\n      // Use a sourceURL for easier debugging.\n      // http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl\n      var sourceURL = '\\n/*\\n//# sourceURL=' + (options.sourceURL || '/lodash/template/source[' + (templateCounter++) + ']') + '\\n*/';\n\n      try {\n        var result = Function(importsKeys, 'return ' + source + sourceURL).apply(undefined, importsValues);\n      } catch(e) {\n        e.source = source;\n        throw e;\n      }\n      if (data) {\n        return result(data);\n      }\n      // provide the compiled function's source by its `toString` method, in\n      // supported environments, or the `source` property as a convenience for\n      // inlining compiled templates during the build process\n      result.source = source;\n      return result;\n    }\n\n    /**\n     * Executes the callback `n` times, returning an array of the results\n     * of each callback execution. The callback is bound to `thisArg` and invoked\n     * with one argument; (index).\n     *\n     * @static\n     * @memberOf _\n     * @category Utilities\n     * @param {number} n The number of times to execute the callback.\n     * @param {Function} callback The function called per iteration.\n     * @param {*} [thisArg] The `this` binding of `callback`.\n     * @returns {Array} Returns an array of the results of each `callback` execution.\n     * @example\n     *\n     * var diceRolls = _.times(3, _.partial(_.random, 1, 6));\n     * // => [3, 6, 4]\n     *\n     * _.times(3, function(n) { mage.castSpell(n); });\n     * // => calls `mage.castSpell(n)` three times, passing `n` of `0`, `1`, and `2` respectively\n     *\n     * _.times(3, function(n) { this.cast(n); }, mage);\n     * // => also calls `mage.castSpell(n)` three times\n     */\n    function times(n, callback, thisArg) {\n      n = (n = +n) > -1 ? n : 0;\n      var index = -1,\n          result = Array(n);\n\n      callback = baseCreateCallback(callback, thisArg, 1);\n      while (++index < n) {\n        result[index] = callback(index);\n      }\n      return result;\n    }\n\n    /**\n     * The inverse of `_.escape` this method converts the HTML entities\n     * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to their\n     * corresponding characters.\n     *\n     * @static\n     * @memberOf _\n     * @category Utilities\n     * @param {string} string The string to unescape.\n     * @returns {string} Returns the unescaped string.\n     * @example\n     *\n     * _.unescape('Moe, Larry &amp; Curly');\n     * // => 'Moe, Larry & Curly'\n     */\n    function unescape(string) {\n      return string == null ? '' : String(string).replace(reEscapedHtml, unescapeHtmlChar);\n    }\n\n    /**\n     * Generates a unique ID. If `prefix` is provided the ID will be appended to it.\n     *\n     * @static\n     * @memberOf _\n     * @category Utilities\n     * @param {string} [prefix] The value to prefix the ID with.\n     * @returns {string} Returns the unique ID.\n     * @example\n     *\n     * _.uniqueId('contact_');\n     * // => 'contact_104'\n     *\n     * _.uniqueId();\n     * // => '105'\n     */\n    function uniqueId(prefix) {\n      var id = ++idCounter;\n      return String(prefix == null ? '' : prefix) + id;\n    }\n\n    /*--------------------------------------------------------------------------*/\n\n    /**\n     * Creates a `lodash` object that wraps the given value with explicit\n     * method chaining enabled.\n     *\n     * @static\n     * @memberOf _\n     * @category Chaining\n     * @param {*} value The value to wrap.\n     * @returns {Object} Returns the wrapper object.\n     * @example\n     *\n     * var stooges = [\n     *   { 'name': 'moe', 'age': 40 },\n     *   { 'name': 'larry', 'age': 50 },\n     *   { 'name': 'curly', 'age': 60 }\n     * ];\n     *\n     * var youngest = _.chain(stooges)\n     *     .sortBy('age')\n     *     .map(function(stooge) { return stooge.name + ' is ' + stooge.age; })\n     *     .first()\n     *     .value();\n     * // => 'moe is 40'\n     */\n    function chain(value) {\n      value = new lodashWrapper(value);\n      value.__chain__ = true;\n      return value;\n    }\n\n    /**\n     * Invokes `interceptor` with the `value` as the first argument and then\n     * returns `value`. The purpose of this method is to \"tap into\" a method\n     * chain in order to perform operations on intermediate results within\n     * the chain.\n     *\n     * @static\n     * @memberOf _\n     * @category Chaining\n     * @param {*} value The value to provide to `interceptor`.\n     * @param {Function} interceptor The function to invoke.\n     * @returns {*} Returns `value`.\n     * @example\n     *\n     * _([1, 2, 3, 4])\n     *  .filter(function(num) { return num % 2 == 0; })\n     *  .tap(function(array) { console.log(array); })\n     *  .map(function(num) { return num * num; })\n     *  .value();\n     * // => // [2, 4] (logged)\n     * // => [4, 16]\n     */\n    function tap(value, interceptor) {\n      interceptor(value);\n      return value;\n    }\n\n    /**\n     * Enables explicit method chaining on the wrapper object.\n     *\n     * @name chain\n     * @memberOf _\n     * @category Chaining\n     * @returns {*} Returns the wrapper object.\n     * @example\n     *\n     * var stooges = [\n     *   { 'name': 'moe', 'age': 40 },\n     *   { 'name': 'larry', 'age': 50 }\n     * ];\n     *\n     * // without explicit chaining\n     * _(stooges).first();\n     * // => { 'name': 'moe', 'age': 40 }\n     *\n     * // with explicit chaining\n     * _(stooges).chain()\n     *   .first()\n     *   .pick('age')\n     *   .value()\n     * // => { 'age': 40 }\n     */\n    function wrapperChain() {\n      this.__chain__ = true;\n      return this;\n    }\n\n    /**\n     * Produces the `toString` result of the wrapped value.\n     *\n     * @name toString\n     * @memberOf _\n     * @category Chaining\n     * @returns {string} Returns the string result.\n     * @example\n     *\n     * _([1, 2, 3]).toString();\n     * // => '1,2,3'\n     */\n    function wrapperToString() {\n      return String(this.__wrapped__);\n    }\n\n    /**\n     * Extracts the wrapped value.\n     *\n     * @name valueOf\n     * @memberOf _\n     * @alias value\n     * @category Chaining\n     * @returns {*} Returns the wrapped value.\n     * @example\n     *\n     * _([1, 2, 3]).valueOf();\n     * // => [1, 2, 3]\n     */\n    function wrapperValueOf() {\n      return this.__wrapped__;\n    }\n\n    /*--------------------------------------------------------------------------*/\n\n    // add functions that return wrapped values when chaining\n    lodash.after = after;\n    lodash.assign = assign;\n    lodash.at = at;\n    lodash.bind = bind;\n    lodash.bindAll = bindAll;\n    lodash.bindKey = bindKey;\n    lodash.chain = chain;\n    lodash.compact = compact;\n    lodash.compose = compose;\n    lodash.countBy = countBy;\n    lodash.createCallback = createCallback;\n    lodash.curry = curry;\n    lodash.debounce = debounce;\n    lodash.defaults = defaults;\n    lodash.defer = defer;\n    lodash.delay = delay;\n    lodash.difference = difference;\n    lodash.filter = filter;\n    lodash.flatten = flatten;\n    lodash.forEach = forEach;\n    lodash.forEachRight = forEachRight;\n    lodash.forIn = forIn;\n    lodash.forInRight = forInRight;\n    lodash.forOwn = forOwn;\n    lodash.forOwnRight = forOwnRight;\n    lodash.functions = functions;\n    lodash.groupBy = groupBy;\n    lodash.indexBy = indexBy;\n    lodash.initial = initial;\n    lodash.intersection = intersection;\n    lodash.invert = invert;\n    lodash.invoke = invoke;\n    lodash.keys = keys;\n    lodash.map = map;\n    lodash.max = max;\n    lodash.memoize = memoize;\n    lodash.merge = merge;\n    lodash.min = min;\n    lodash.omit = omit;\n    lodash.once = once;\n    lodash.pairs = pairs;\n    lodash.partial = partial;\n    lodash.partialRight = partialRight;\n    lodash.pick = pick;\n    lodash.pluck = pluck;\n    lodash.pull = pull;\n    lodash.range = range;\n    lodash.reject = reject;\n    lodash.remove = remove;\n    lodash.rest = rest;\n    lodash.shuffle = shuffle;\n    lodash.sortBy = sortBy;\n    lodash.tap = tap;\n    lodash.throttle = throttle;\n    lodash.times = times;\n    lodash.toArray = toArray;\n    lodash.transform = transform;\n    lodash.union = union;\n    lodash.uniq = uniq;\n    lodash.values = values;\n    lodash.where = where;\n    lodash.without = without;\n    lodash.wrap = wrap;\n    lodash.zip = zip;\n    lodash.zipObject = zipObject;\n\n    // add aliases\n    lodash.collect = map;\n    lodash.drop = rest;\n    lodash.each = forEach;\n    lodash.eachRight = forEachRight;\n    lodash.extend = assign;\n    lodash.methods = functions;\n    lodash.object = zipObject;\n    lodash.select = filter;\n    lodash.tail = rest;\n    lodash.unique = uniq;\n    lodash.unzip = zip;\n\n    // add functions to `lodash.prototype`\n    mixin(lodash);\n\n    /*--------------------------------------------------------------------------*/\n\n    // add functions that return unwrapped values when chaining\n    lodash.clone = clone;\n    lodash.cloneDeep = cloneDeep;\n    lodash.contains = contains;\n    lodash.escape = escape;\n    lodash.every = every;\n    lodash.find = find;\n    lodash.findIndex = findIndex;\n    lodash.findKey = findKey;\n    lodash.findLast = findLast;\n    lodash.findLastIndex = findLastIndex;\n    lodash.findLastKey = findLastKey;\n    lodash.has = has;\n    lodash.identity = identity;\n    lodash.indexOf = indexOf;\n    lodash.isArguments = isArguments;\n    lodash.isArray = isArray;\n    lodash.isBoolean = isBoolean;\n    lodash.isDate = isDate;\n    lodash.isElement = isElement;\n    lodash.isEmpty = isEmpty;\n    lodash.isEqual = isEqual;\n    lodash.isFinite = isFinite;\n    lodash.isFunction = isFunction;\n    lodash.isNaN = isNaN;\n    lodash.isNull = isNull;\n    lodash.isNumber = isNumber;\n    lodash.isObject = isObject;\n    lodash.isPlainObject = isPlainObject;\n    lodash.isRegExp = isRegExp;\n    lodash.isString = isString;\n    lodash.isUndefined = isUndefined;\n    lodash.lastIndexOf = lastIndexOf;\n    lodash.mixin = mixin;\n    lodash.noConflict = noConflict;\n    lodash.parseInt = parseInt;\n    lodash.random = random;\n    lodash.reduce = reduce;\n    lodash.reduceRight = reduceRight;\n    lodash.result = result;\n    lodash.runInContext = runInContext;\n    lodash.size = size;\n    lodash.some = some;\n    lodash.sortedIndex = sortedIndex;\n    lodash.template = template;\n    lodash.unescape = unescape;\n    lodash.uniqueId = uniqueId;\n\n    // add aliases\n    lodash.all = every;\n    lodash.any = some;\n    lodash.detect = find;\n    lodash.findWhere = find;\n    lodash.foldl = reduce;\n    lodash.foldr = reduceRight;\n    lodash.include = contains;\n    lodash.inject = reduce;\n\n    forOwn(lodash, function(func, methodName) {\n      if (!lodash.prototype[methodName]) {\n        lodash.prototype[methodName] = function() {\n          var args = [this.__wrapped__],\n              chainAll = this.__chain__;\n\n          push.apply(args, arguments);\n          var result = func.apply(lodash, args);\n          return chainAll\n            ? new lodashWrapper(result, chainAll)\n            : result;\n        };\n      }\n    });\n\n    /*--------------------------------------------------------------------------*/\n\n    // add functions capable of returning wrapped and unwrapped values when chaining\n    lodash.first = first;\n    lodash.last = last;\n    lodash.sample = sample;\n\n    // add aliases\n    lodash.take = first;\n    lodash.head = first;\n\n    forOwn(lodash, function(func, methodName) {\n      var callbackable = methodName !== 'sample';\n      if (!lodash.prototype[methodName]) {\n        lodash.prototype[methodName]= function(n, guard) {\n          var chainAll = this.__chain__,\n              result = func(this.__wrapped__, n, guard);\n\n          return !chainAll && (n == null || (guard && !(callbackable && typeof n == 'function')))\n            ? result\n            : new lodashWrapper(result, chainAll);\n        };\n      }\n    });\n\n    /*--------------------------------------------------------------------------*/\n\n    /**\n     * The semantic version number.\n     *\n     * @static\n     * @memberOf _\n     * @type string\n     */\n    lodash.VERSION = '2.2.1';\n\n    // add \"Chaining\" functions to the wrapper\n    lodash.prototype.chain = wrapperChain;\n    lodash.prototype.toString = wrapperToString;\n    lodash.prototype.value = wrapperValueOf;\n    lodash.prototype.valueOf = wrapperValueOf;\n\n    // add `Array` functions that return unwrapped values\n    forEach(['join', 'pop', 'shift'], function(methodName) {\n      var func = arrayRef[methodName];\n      lodash.prototype[methodName] = function() {\n        var chainAll = this.__chain__,\n            result = func.apply(this.__wrapped__, arguments);\n\n        return chainAll\n          ? new lodashWrapper(result, chainAll)\n          : result;\n      };\n    });\n\n    // add `Array` functions that return the wrapped value\n    forEach(['push', 'reverse', 'sort', 'unshift'], function(methodName) {\n      var func = arrayRef[methodName];\n      lodash.prototype[methodName] = function() {\n        func.apply(this.__wrapped__, arguments);\n        return this;\n      };\n    });\n\n    // add `Array` functions that return new wrapped values\n    forEach(['concat', 'slice', 'splice'], function(methodName) {\n      var func = arrayRef[methodName];\n      lodash.prototype[methodName] = function() {\n        return new lodashWrapper(func.apply(this.__wrapped__, arguments), this.__chain__);\n      };\n    });\n\n    return lodash;\n  }\n\n  /*--------------------------------------------------------------------------*/\n\n  // expose Lo-Dash\n  var _ = runInContext();\n\n  // some AMD build optimizers, like r.js, check for condition patterns like the following:\n  if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\n    // Expose Lo-Dash to the global object even when an AMD loader is present in\n    // case Lo-Dash was injected by a third-party script and not intended to be\n    // loaded as a module. The global assignment can be reverted in the Lo-Dash\n    // module by its `noConflict()` method.\n    root._ = _;\n\n    // define as an anonymous module so, through path mapping, it can be\n    // referenced as the \"underscore\" module\n    define(function() {\n      return _;\n    });\n  }\n  // check for `exports` after `define` in case a build optimizer adds an `exports` object\n  else if (freeExports && freeModule) {\n    // in Node.js or RingoJS\n    if (moduleExports) {\n      (freeModule.exports = _)._ = _;\n    }\n    // in Narwhal or Rhino -require\n    else {\n      freeExports._ = _;\n    }\n  }\n  else {\n    // in a browser or Rhino\n    root._ = _;\n  }\n}.call(this));\n\n//     Backbone.js 1.0.0\n\n//     (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.\n//     Backbone may be freely distributed under the MIT license.\n//     For all details and documentation:\n//     http://backbonejs.org\n\n(function(){\n\n  // Initial Setup\n  // -------------\n\n  // Save a reference to the global object (`window` in the browser, `exports`\n  // on the server).\n  var root = this;\n\n  // Save the previous value of the `Backbone` variable, so that it can be\n  // restored later on, if `noConflict` is used.\n  var previousBackbone = root.Backbone;\n\n  // Create local references to array methods we'll want to use later.\n  var array = [];\n  var push = array.push;\n  var slice = array.slice;\n  var splice = array.splice;\n\n  // The top-level namespace. All public Backbone classes and modules will\n  // be attached to this. Exported for both the browser and the server.\n  var Backbone;\n  if (typeof exports !== 'undefined') {\n    Backbone = exports;\n  } else {\n    Backbone = root.Backbone = {};\n  }\n\n  // Current version of the library. Keep in sync with `package.json`.\n  Backbone.VERSION = '1.0.0';\n\n  // Require Underscore, if we're on the server, and it's not already present.\n  var _ = root._;\n  if (!_ && (typeof require !== 'undefined')) _ = require('underscore');\n\n  // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns\n  // the `$` variable.\n  Backbone.$ = root.jQuery || root.Zepto || root.ender || root.$;\n\n  // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable\n  // to its previous owner. Returns a reference to this Backbone object.\n  Backbone.noConflict = function() {\n    root.Backbone = previousBackbone;\n    return this;\n  };\n\n  // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option\n  // will fake `\"PUT\"` and `\"DELETE\"` requests via the `_method` parameter and\n  // set a `X-Http-Method-Override` header.\n  Backbone.emulateHTTP = false;\n\n  // Turn on `emulateJSON` to support legacy servers that can't deal with direct\n  // `application/json` requests ... will encode the body as\n  // `application/x-www-form-urlencoded` instead and will send the model in a\n  // form param named `model`.\n  Backbone.emulateJSON = false;\n\n  // Backbone.Events\n  // ---------------\n\n  // A module that can be mixed in to *any object* in order to provide it with\n  // custom events. You may bind with `on` or remove with `off` callback\n  // functions to an event; `trigger`-ing an event fires all callbacks in\n  // succession.\n  //\n  //     var object = {};\n  //     _.extend(object, Backbone.Events);\n  //     object.on('expand', function(){ alert('expanded'); });\n  //     object.trigger('expand');\n  //\n  var Events = Backbone.Events = {\n\n    // Bind an event to a `callback` function. Passing `\"all\"` will bind\n    // the callback to all events fired.\n    on: function(name, callback, context) {\n      if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;\n      this._events || (this._events = {});\n      var events = this._events[name] || (this._events[name] = []);\n      events.push({callback: callback, context: context, ctx: context || this});\n      return this;\n    },\n\n    // Bind an event to only be triggered a single time. After the first time\n    // the callback is invoked, it will be removed.\n    once: function(name, callback, context) {\n      if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;\n      var self = this;\n      var once = _.once(function() {\n        self.off(name, once);\n        callback.apply(this, arguments);\n      });\n      once._callback = callback;\n      return this.on(name, once, context);\n    },\n\n    // Remove one or many callbacks. If `context` is null, removes all\n    // callbacks with that function. If `callback` is null, removes all\n    // callbacks for the event. If `name` is null, removes all bound\n    // callbacks for all events.\n    off: function(name, callback, context) {\n      var retain, ev, events, names, i, l, j, k;\n      if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;\n      if (!name && !callback && !context) {\n        this._events = {};\n        return this;\n      }\n\n      names = name ? [name] : _.keys(this._events);\n      for (i = 0, l = names.length; i < l; i++) {\n        name = names[i];\n        if (events = this._events[name]) {\n          this._events[name] = retain = [];\n          if (callback || context) {\n            for (j = 0, k = events.length; j < k; j++) {\n              ev = events[j];\n              if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||\n                  (context && context !== ev.context)) {\n                retain.push(ev);\n              }\n            }\n          }\n          if (!retain.length) delete this._events[name];\n        }\n      }\n\n      return this;\n    },\n\n    // Trigger one or many events, firing all bound callbacks. Callbacks are\n    // passed the same arguments as `trigger` is, apart from the event name\n    // (unless you're listening on `\"all\"`, which will cause your callback to\n    // receive the true name of the event as the first argument).\n    trigger: function(name) {\n      if (!this._events) return this;\n      var args = slice.call(arguments, 1);\n      if (!eventsApi(this, 'trigger', name, args)) return this;\n      var events = this._events[name];\n      var allEvents = this._events.all;\n      if (events) triggerEvents(events, args);\n      if (allEvents) triggerEvents(allEvents, arguments);\n      return this;\n    },\n\n    // Tell this object to stop listening to either specific events ... or\n    // to every object it's currently listening to.\n    stopListening: function(obj, name, callback) {\n      var listeners = this._listeners;\n      if (!listeners) return this;\n      var deleteListener = !name && !callback;\n      if (typeof name === 'object') callback = this;\n      if (obj) (listeners = {})[obj._listenerId] = obj;\n      for (var id in listeners) {\n        listeners[id].off(name, callback, this);\n        if (deleteListener) delete this._listeners[id];\n      }\n      return this;\n    }\n\n  };\n\n  // Regular expression used to split event strings.\n  var eventSplitter = /\\s+/;\n\n  // Implement fancy features of the Events API such as multiple event\n  // names `\"change blur\"` and jQuery-style event maps `{change: action}`\n  // in terms of the existing API.\n  var eventsApi = function(obj, action, name, rest) {\n    if (!name) return true;\n\n    // Handle event maps.\n    if (typeof name === 'object') {\n      for (var key in name) {\n        obj[action].apply(obj, [key, name[key]].concat(rest));\n      }\n      return false;\n    }\n\n    // Handle space separated event names.\n    if (eventSplitter.test(name)) {\n      var names = name.split(eventSplitter);\n      for (var i = 0, l = names.length; i < l; i++) {\n        obj[action].apply(obj, [names[i]].concat(rest));\n      }\n      return false;\n    }\n\n    return true;\n  };\n\n  // A difficult-to-believe, but optimized internal dispatch function for\n  // triggering events. Tries to keep the usual cases speedy (most internal\n  // Backbone events have 3 arguments).\n  var triggerEvents = function(events, args) {\n    var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];\n    switch (args.length) {\n      case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;\n      case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;\n      case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;\n      case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;\n      default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);\n    }\n  };\n\n  var listenMethods = {listenTo: 'on', listenToOnce: 'once'};\n\n  // Inversion-of-control versions of `on` and `once`. Tell *this* object to\n  // listen to an event in another object ... keeping track of what it's\n  // listening to.\n  _.each(listenMethods, function(implementation, method) {\n    Events[method] = function(obj, name, callback) {\n      var listeners = this._listeners || (this._listeners = {});\n      var id = obj._listenerId || (obj._listenerId = _.uniqueId('l'));\n      listeners[id] = obj;\n      if (typeof name === 'object') callback = this;\n      obj[implementation](name, callback, this);\n      return this;\n    };\n  });\n\n  // Aliases for backwards compatibility.\n  Events.bind   = Events.on;\n  Events.unbind = Events.off;\n\n  // Allow the `Backbone` object to serve as a global event bus, for folks who\n  // want global \"pubsub\" in a convenient place.\n  _.extend(Backbone, Events);\n\n  // Backbone.Model\n  // --------------\n\n  // Backbone **Models** are the basic data object in the framework --\n  // frequently representing a row in a table in a database on your server.\n  // A discrete chunk of data and a bunch of useful, related methods for\n  // performing computations and transformations on that data.\n\n  // Create a new model with the specified attributes. A client id (`cid`)\n  // is automatically generated and assigned for you.\n  var Model = Backbone.Model = function(attributes, options) {\n    var defaults;\n    var attrs = attributes || {};\n    options || (options = {});\n    this.cid = _.uniqueId('c');\n    this.attributes = {};\n    _.extend(this, _.pick(options, modelOptions));\n    if (options.parse) attrs = this.parse(attrs, options) || {};\n    if (defaults = _.result(this, 'defaults')) {\n      attrs = _.defaults({}, attrs, defaults);\n    }\n    this.set(attrs, options);\n    this.changed = {};\n    this.initialize.apply(this, arguments);\n  };\n\n  // A list of options to be attached directly to the model, if provided.\n  var modelOptions = ['url', 'urlRoot', 'collection'];\n\n  // Attach all inheritable methods to the Model prototype.\n  _.extend(Model.prototype, Events, {\n\n    // A hash of attributes whose current and previous value differ.\n    changed: null,\n\n    // The value returned during the last failed validation.\n    validationError: null,\n\n    // The default name for the JSON `id` attribute is `\"id\"`. MongoDB and\n    // CouchDB users may want to set this to `\"_id\"`.\n    idAttribute: 'id',\n\n    // Initialize is an empty function by default. Override it with your own\n    // initialization logic.\n    initialize: function(){},\n\n    // Return a copy of the model's `attributes` object.\n    toJSON: function(options) {\n      return _.clone(this.attributes);\n    },\n\n    // Proxy `Backbone.sync` by default -- but override this if you need\n    // custom syncing semantics for *this* particular model.\n    sync: function() {\n      return Backbone.sync.apply(this, arguments);\n    },\n\n    // Get the value of an attribute.\n    get: function(attr) {\n      return this.attributes[attr];\n    },\n\n    // Get the HTML-escaped value of an attribute.\n    escape: function(attr) {\n      return _.escape(this.get(attr));\n    },\n\n    // Returns `true` if the attribute contains a value that is not null\n    // or undefined.\n    has: function(attr) {\n      return this.get(attr) != null;\n    },\n\n    // Set a hash of model attributes on the object, firing `\"change\"`. This is\n    // the core primitive operation of a model, updating the data and notifying\n    // anyone who needs to know about the change in state. The heart of the beast.\n    set: function(key, val, options) {\n      var attr, attrs, unset, changes, silent, changing, prev, current;\n      if (key == null) return this;\n\n      // Handle both `\"key\", value` and `{key: value}` -style arguments.\n      if (typeof key === 'object') {\n        attrs = key;\n        options = val;\n      } else {\n        (attrs = {})[key] = val;\n      }\n\n      options || (options = {});\n\n      // Run validation.\n      if (!this._validate(attrs, options)) return false;\n\n      // Extract attributes and options.\n      unset           = options.unset;\n      silent          = options.silent;\n      changes         = [];\n      changing        = this._changing;\n      this._changing  = true;\n\n      if (!changing) {\n        this._previousAttributes = _.clone(this.attributes);\n        this.changed = {};\n      }\n      current = this.attributes, prev = this._previousAttributes;\n\n      // Check for changes of `id`.\n      if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];\n\n      // For each `set` attribute, update or delete the current value.\n      for (attr in attrs) {\n        val = attrs[attr];\n        if (!_.isEqual(current[attr], val)) changes.push(attr);\n        if (!_.isEqual(prev[attr], val)) {\n          this.changed[attr] = val;\n        } else {\n          delete this.changed[attr];\n        }\n        unset ? delete current[attr] : current[attr] = val;\n      }\n\n      // Trigger all relevant attribute changes.\n      if (!silent) {\n        if (changes.length) this._pending = true;\n        for (var i = 0, l = changes.length; i < l; i++) {\n          this.trigger('change:' + changes[i], this, current[changes[i]], options);\n        }\n      }\n\n      // You might be wondering why there's a `while` loop here. Changes can\n      // be recursively nested within `\"change\"` events.\n      if (changing) return this;\n      if (!silent) {\n        while (this._pending) {\n          this._pending = false;\n          this.trigger('change', this, options);\n        }\n      }\n      this._pending = false;\n      this._changing = false;\n      return this;\n    },\n\n    // Remove an attribute from the model, firing `\"change\"`. `unset` is a noop\n    // if the attribute doesn't exist.\n    unset: function(attr, options) {\n      return this.set(attr, void 0, _.extend({}, options, {unset: true}));\n    },\n\n    // Clear all attributes on the model, firing `\"change\"`.\n    clear: function(options) {\n      var attrs = {};\n      for (var key in this.attributes) attrs[key] = void 0;\n      return this.set(attrs, _.extend({}, options, {unset: true}));\n    },\n\n    // Determine if the model has changed since the last `\"change\"` event.\n    // If you specify an attribute name, determine if that attribute has changed.\n    hasChanged: function(attr) {\n      if (attr == null) return !_.isEmpty(this.changed);\n      return _.has(this.changed, attr);\n    },\n\n    // Return an object containing all the attributes that have changed, or\n    // false if there are no changed attributes. Useful for determining what\n    // parts of a view need to be updated and/or what attributes need to be\n    // persisted to the server. Unset attributes will be set to undefined.\n    // You can also pass an attributes object to diff against the model,\n    // determining if there *would be* a change.\n    changedAttributes: function(diff) {\n      if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;\n      var val, changed = false;\n      var old = this._changing ? this._previousAttributes : this.attributes;\n      for (var attr in diff) {\n        if (_.isEqual(old[attr], (val = diff[attr]))) continue;\n        (changed || (changed = {}))[attr] = val;\n      }\n      return changed;\n    },\n\n    // Get the previous value of an attribute, recorded at the time the last\n    // `\"change\"` event was fired.\n    previous: function(attr) {\n      if (attr == null || !this._previousAttributes) return null;\n      return this._previousAttributes[attr];\n    },\n\n    // Get all of the attributes of the model at the time of the previous\n    // `\"change\"` event.\n    previousAttributes: function() {\n      return _.clone(this._previousAttributes);\n    },\n\n    // Fetch the model from the server. If the server's representation of the\n    // model differs from its current attributes, they will be overridden,\n    // triggering a `\"change\"` event.\n    fetch: function(options) {\n      options = options ? _.clone(options) : {};\n      if (options.parse === void 0) options.parse = true;\n      var model = this;\n      var success = options.success;\n      options.success = function(resp) {\n        if (!model.set(model.parse(resp, options), options)) return false;\n        if (success) success(model, resp, options);\n        model.trigger('sync', model, resp, options);\n      };\n      wrapError(this, options);\n      return this.sync('read', this, options);\n    },\n\n    // Set a hash of model attributes, and sync the model to the server.\n    // If the server returns an attributes hash that differs, the model's\n    // state will be `set` again.\n    save: function(key, val, options) {\n      var attrs, method, xhr, attributes = this.attributes;\n\n      // Handle both `\"key\", value` and `{key: value}` -style arguments.\n      if (key == null || typeof key === 'object') {\n        attrs = key;\n        options = val;\n      } else {\n        (attrs = {})[key] = val;\n      }\n\n      // If we're not waiting and attributes exist, save acts as `set(attr).save(null, opts)`.\n      if (attrs && (!options || !options.wait) && !this.set(attrs, options)) return false;\n\n      options = _.extend({validate: true}, options);\n\n      // Do not persist invalid models.\n      if (!this._validate(attrs, options)) return false;\n\n      // Set temporary attributes if `{wait: true}`.\n      if (attrs && options.wait) {\n        this.attributes = _.extend({}, attributes, attrs);\n      }\n\n      // After a successful server-side save, the client is (optionally)\n      // updated with the server-side state.\n      if (options.parse === void 0) options.parse = true;\n      var model = this;\n      var success = options.success;\n      options.success = function(resp) {\n        // Ensure attributes are restored during synchronous saves.\n        model.attributes = attributes;\n        var serverAttrs = model.parse(resp, options);\n        if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);\n        if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {\n          return false;\n        }\n        if (success) success(model, resp, options);\n        model.trigger('sync', model, resp, options);\n      };\n      wrapError(this, options);\n\n      method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');\n      if (method === 'patch') options.attrs = attrs;\n      xhr = this.sync(method, this, options);\n\n      // Restore attributes.\n      if (attrs && options.wait) this.attributes = attributes;\n\n      return xhr;\n    },\n\n    // Destroy this model on the server if it was already persisted.\n    // Optimistically removes the model from its collection, if it has one.\n    // If `wait: true` is passed, waits for the server to respond before removal.\n    destroy: function(options) {\n      options = options ? _.clone(options) : {};\n      var model = this;\n      var success = options.success;\n\n      var destroy = function() {\n        model.trigger('destroy', model, model.collection, options);\n      };\n\n      options.success = function(resp) {\n        if (options.wait || model.isNew()) destroy();\n        if (success) success(model, resp, options);\n        if (!model.isNew()) model.trigger('sync', model, resp, options);\n      };\n\n      if (this.isNew()) {\n        options.success();\n        return false;\n      }\n      wrapError(this, options);\n\n      var xhr = this.sync('delete', this, options);\n      if (!options.wait) destroy();\n      return xhr;\n    },\n\n    // Default URL for the model's representation on the server -- if you're\n    // using Backbone's restful methods, override this to change the endpoint\n    // that will be called.\n    url: function() {\n      var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();\n      if (this.isNew()) return base;\n      return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + encodeURIComponent(this.id);\n    },\n\n    // **parse** converts a response into the hash of attributes to be `set` on\n    // the model. The default implementation is just to pass the response along.\n    parse: function(resp, options) {\n      return resp;\n    },\n\n    // Create a new model with identical attributes to this one.\n    clone: function() {\n      return new this.constructor(this.attributes);\n    },\n\n    // A model is new if it has never been saved to the server, and lacks an id.\n    isNew: function() {\n      return this.id == null;\n    },\n\n    // Check if the model is currently in a valid state.\n    isValid: function(options) {\n      return this._validate({}, _.extend(options || {}, { validate: true }));\n    },\n\n    // Run validation against the next complete set of model attributes,\n    // returning `true` if all is well. Otherwise, fire an `\"invalid\"` event.\n    _validate: function(attrs, options) {\n      if (!options.validate || !this.validate) return true;\n      attrs = _.extend({}, this.attributes, attrs);\n      var error = this.validationError = this.validate(attrs, options) || null;\n      if (!error) return true;\n      this.trigger('invalid', this, error, _.extend(options || {}, {validationError: error}));\n      return false;\n    }\n\n  });\n\n  // Underscore methods that we want to implement on the Model.\n  var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit'];\n\n  // Mix in each Underscore method as a proxy to `Model#attributes`.\n  _.each(modelMethods, function(method) {\n    Model.prototype[method] = function() {\n      var args = slice.call(arguments);\n      args.unshift(this.attributes);\n      return _[method].apply(_, args);\n    };\n  });\n\n  // Backbone.Collection\n  // -------------------\n\n  // If models tend to represent a single row of data, a Backbone Collection is\n  // more analagous to a table full of data ... or a small slice or page of that\n  // table, or a collection of rows that belong together for a particular reason\n  // -- all of the messages in this particular folder, all of the documents\n  // belonging to this particular author, and so on. Collections maintain\n  // indexes of their models, both in order, and for lookup by `id`.\n\n  // Create a new **Collection**, perhaps to contain a specific type of `model`.\n  // If a `comparator` is specified, the Collection will maintain\n  // its models in sort order, as they're added and removed.\n  var Collection = Backbone.Collection = function(models, options) {\n    options || (options = {});\n    if (options.url) this.url = options.url;\n    if (options.model) this.model = options.model;\n    if (options.comparator !== void 0) this.comparator = options.comparator;\n    this._reset();\n    this.initialize.apply(this, arguments);\n    if (models) this.reset(models, _.extend({silent: true}, options));\n  };\n\n  // Default options for `Collection#set`.\n  var setOptions = {add: true, remove: true, merge: true};\n  var addOptions = {add: true, merge: false, remove: false};\n\n  // Define the Collection's inheritable methods.\n  _.extend(Collection.prototype, Events, {\n\n    // The default model for a collection is just a **Backbone.Model**.\n    // This should be overridden in most cases.\n    model: Model,\n\n    // Initialize is an empty function by default. Override it with your own\n    // initialization logic.\n    initialize: function(){},\n\n    // The JSON representation of a Collection is an array of the\n    // models' attributes.\n    toJSON: function(options) {\n      return this.map(function(model){ return model.toJSON(options); });\n    },\n\n    // Proxy `Backbone.sync` by default.\n    sync: function() {\n      return Backbone.sync.apply(this, arguments);\n    },\n\n    // Add a model, or list of models to the set.\n    add: function(models, options) {\n      return this.set(models, _.defaults(options || {}, addOptions));\n    },\n\n    // Remove a model, or a list of models from the set.\n    remove: function(models, options) {\n      models = _.isArray(models) ? models.slice() : [models];\n      options || (options = {});\n      var i, l, index, model;\n      for (i = 0, l = models.length; i < l; i++) {\n        model = this.get(models[i]);\n        if (!model) continue;\n        delete this._byId[model.id];\n        delete this._byId[model.cid];\n        index = this.indexOf(model);\n        this.models.splice(index, 1);\n        this.length--;\n        if (!options.silent) {\n          options.index = index;\n          model.trigger('remove', model, this, options);\n        }\n        this._removeReference(model);\n      }\n      return this;\n    },\n\n    // Update a collection by `set`-ing a new list of models, adding new ones,\n    // removing models that are no longer present, and merging models that\n    // already exist in the collection, as necessary. Similar to **Model#set**,\n    // the core operation for updating the data contained by the collection.\n    set: function(models, options) {\n      options = _.defaults(options || {}, setOptions);\n      if (options.parse) models = this.parse(models, options);\n      if (!_.isArray(models)) models = models ? [models] : [];\n      var i, l, model, attrs, existing, sort;\n      var at = options.at;\n      var sortable = this.comparator && (at == null) && options.sort !== false;\n      var sortAttr = _.isString(this.comparator) ? this.comparator : null;\n      var toAdd = [], toRemove = [], modelMap = {};\n\n      // Turn bare objects into model references, and prevent invalid models\n      // from being added.\n      for (i = 0, l = models.length; i < l; i++) {\n        if (!(model = this._prepareModel(models[i], options))) continue;\n\n        // If a duplicate is found, prevent it from being added and\n        // optionally merge it into the existing model.\n        if (existing = this.get(model)) {\n          if (options.remove) modelMap[existing.cid] = true;\n          if (options.merge) {\n            existing.set(model.attributes, options);\n            if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;\n          }\n\n        // This is a new model, push it to the `toAdd` list.\n        } else if (options.add) {\n          toAdd.push(model);\n\n          // Listen to added models' events, and index models for lookup by\n          // `id` and by `cid`.\n          model.on('all', this._onModelEvent, this);\n          this._byId[model.cid] = model;\n          if (model.id != null) this._byId[model.id] = model;\n        }\n      }\n\n      // Remove nonexistent models if appropriate.\n      if (options.remove) {\n        for (i = 0, l = this.length; i < l; ++i) {\n          if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);\n        }\n        if (toRemove.length) this.remove(toRemove, options);\n      }\n\n      // See if sorting is needed, update `length` and splice in new models.\n      if (toAdd.length) {\n        if (sortable) sort = true;\n        this.length += toAdd.length;\n        if (at != null) {\n          splice.apply(this.models, [at, 0].concat(toAdd));\n        } else {\n          push.apply(this.models, toAdd);\n        }\n      }\n\n      // Silently sort the collection if appropriate.\n      if (sort) this.sort({silent: true});\n\n      if (options.silent) return this;\n\n      // Trigger `add` events.\n      for (i = 0, l = toAdd.length; i < l; i++) {\n        (model = toAdd[i]).trigger('add', model, this, options);\n      }\n\n      // Trigger `sort` if the collection was sorted.\n      if (sort) this.trigger('sort', this, options);\n      return this;\n    },\n\n    // When you have more items than you want to add or remove individually,\n    // you can reset the entire set with a new list of models, without firing\n    // any granular `add` or `remove` events. Fires `reset` when finished.\n    // Useful for bulk operations and optimizations.\n    reset: function(models, options) {\n      options || (options = {});\n      for (var i = 0, l = this.models.length; i < l; i++) {\n        this._removeReference(this.models[i]);\n      }\n      options.previousModels = this.models;\n      this._reset();\n      this.add(models, _.extend({silent: true}, options));\n      if (!options.silent) this.trigger('reset', this, options);\n      return this;\n    },\n\n    // Add a model to the end of the collection.\n    push: function(model, options) {\n      model = this._prepareModel(model, options);\n      this.add(model, _.extend({at: this.length}, options));\n      return model;\n    },\n\n    // Remove a model from the end of the collection.\n    pop: function(options) {\n      var model = this.at(this.length - 1);\n      this.remove(model, options);\n      return model;\n    },\n\n    // Add a model to the beginning of the collection.\n    unshift: function(model, options) {\n      model = this._prepareModel(model, options);\n      this.add(model, _.extend({at: 0}, options));\n      return model;\n    },\n\n    // Remove a model from the beginning of the collection.\n    shift: function(options) {\n      var model = this.at(0);\n      this.remove(model, options);\n      return model;\n    },\n\n    // Slice out a sub-array of models from the collection.\n    slice: function(begin, end) {\n      return this.models.slice(begin, end);\n    },\n\n    // Get a model from the set by id.\n    get: function(obj) {\n      if (obj == null) return void 0;\n      return this._byId[obj.id != null ? obj.id : obj.cid || obj];\n    },\n\n    // Get the model at the given index.\n    at: function(index) {\n      return this.models[index];\n    },\n\n    // Return models with matching attributes. Useful for simple cases of\n    // `filter`.\n    where: function(attrs, first) {\n      if (_.isEmpty(attrs)) return first ? void 0 : [];\n      return this[first ? 'find' : 'filter'](function(model) {\n        for (var key in attrs) {\n          if (attrs[key] !== model.get(key)) return false;\n        }\n        return true;\n      });\n    },\n\n    // Return the first model with matching attributes. Useful for simple cases\n    // of `find`.\n    findWhere: function(attrs) {\n      return this.where(attrs, true);\n    },\n\n    // Force the collection to re-sort itself. You don't need to call this under\n    // normal circumstances, as the set will maintain sort order as each item\n    // is added.\n    sort: function(options) {\n      if (!this.comparator) throw new Error('Cannot sort a set without a comparator');\n      options || (options = {});\n\n      // Run sort based on type of `comparator`.\n      if (_.isString(this.comparator) || this.comparator.length === 1) {\n        this.models = this.sortBy(this.comparator, this);\n      } else {\n        this.models.sort(_.bind(this.comparator, this));\n      }\n\n      if (!options.silent) this.trigger('sort', this, options);\n      return this;\n    },\n\n    // Figure out the smallest index at which a model should be inserted so as\n    // to maintain order.\n    sortedIndex: function(model, value, context) {\n      value || (value = this.comparator);\n      var iterator = _.isFunction(value) ? value : function(model) {\n        return model.get(value);\n      };\n      return _.sortedIndex(this.models, model, iterator, context);\n    },\n\n    // Pluck an attribute from each model in the collection.\n    pluck: function(attr) {\n      return _.invoke(this.models, 'get', attr);\n    },\n\n    // Fetch the default set of models for this collection, resetting the\n    // collection when they arrive. If `reset: true` is passed, the response\n    // data will be passed through the `reset` method instead of `set`.\n    fetch: function(options) {\n      options = options ? _.clone(options) : {};\n      if (options.parse === void 0) options.parse = true;\n      var success = options.success;\n      var collection = this;\n      options.success = function(resp) {\n        var method = options.reset ? 'reset' : 'set';\n        collection[method](resp, options);\n        if (success) success(collection, resp, options);\n        collection.trigger('sync', collection, resp, options);\n      };\n      wrapError(this, options);\n      return this.sync('read', this, options);\n    },\n\n    // Create a new instance of a model in this collection. Add the model to the\n    // collection immediately, unless `wait: true` is passed, in which case we\n    // wait for the server to agree.\n    create: function(model, options) {\n      options = options ? _.clone(options) : {};\n      if (!(model = this._prepareModel(model, options))) return false;\n      if (!options.wait) this.add(model, options);\n      var collection = this;\n      var success = options.success;\n      options.success = function(resp) {\n        if (options.wait) collection.add(model, options);\n        if (success) success(model, resp, options);\n      };\n      model.save(null, options);\n      return model;\n    },\n\n    // **parse** converts a response into a list of models to be added to the\n    // collection. The default implementation is just to pass it through.\n    parse: function(resp, options) {\n      return resp;\n    },\n\n    // Create a new collection with an identical list of models as this one.\n    clone: function() {\n      return new this.constructor(this.models);\n    },\n\n    // Private method to reset all internal state. Called when the collection\n    // is first initialized or reset.\n    _reset: function() {\n      this.length = 0;\n      this.models = [];\n      this._byId  = {};\n    },\n\n    // Prepare a hash of attributes (or other model) to be added to this\n    // collection.\n    _prepareModel: function(attrs, options) {\n      if (attrs instanceof Model) {\n        if (!attrs.collection) attrs.collection = this;\n        return attrs;\n      }\n      options || (options = {});\n      options.collection = this;\n      var model = new this.model(attrs, options);\n      if (!model._validate(attrs, options)) {\n        this.trigger('invalid', this, attrs, options);\n        return false;\n      }\n      return model;\n    },\n\n    // Internal method to sever a model's ties to a collection.\n    _removeReference: function(model) {\n      if (this === model.collection) delete model.collection;\n      model.off('all', this._onModelEvent, this);\n    },\n\n    // Internal method called every time a model in the set fires an event.\n    // Sets need to update their indexes when models change ids. All other\n    // events simply proxy through. \"add\" and \"remove\" events that originate\n    // in other collections are ignored.\n    _onModelEvent: function(event, model, collection, options) {\n      if ((event === 'add' || event === 'remove') && collection !== this) return;\n      if (event === 'destroy') this.remove(model, options);\n      if (model && event === 'change:' + model.idAttribute) {\n        delete this._byId[model.previous(model.idAttribute)];\n        if (model.id != null) this._byId[model.id] = model;\n      }\n      this.trigger.apply(this, arguments);\n    }\n\n  });\n\n  // Underscore methods that we want to implement on the Collection.\n  // 90% of the core usefulness of Backbone Collections is actually implemented\n  // right here:\n  var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',\n    'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',\n    'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',\n    'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',\n    'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle', 'lastIndexOf',\n    'isEmpty', 'chain'];\n\n  // Mix in each Underscore method as a proxy to `Collection#models`.\n  _.each(methods, function(method) {\n    Collection.prototype[method] = function() {\n      var args = slice.call(arguments);\n      args.unshift(this.models);\n      return _[method].apply(_, args);\n    };\n  });\n\n  // Underscore methods that take a property name as an argument.\n  var attributeMethods = ['groupBy', 'countBy', 'sortBy'];\n\n  // Use attributes instead of properties.\n  _.each(attributeMethods, function(method) {\n    Collection.prototype[method] = function(value, context) {\n      var iterator = _.isFunction(value) ? value : function(model) {\n        return model.get(value);\n      };\n      return _[method](this.models, iterator, context);\n    };\n  });\n\n  // Backbone.View\n  // -------------\n\n  // Backbone Views are almost more convention than they are actual code. A View\n  // is simply a JavaScript object that represents a logical chunk of UI in the\n  // DOM. This might be a single item, an entire list, a sidebar or panel, or\n  // even the surrounding frame which wraps your whole app. Defining a chunk of\n  // UI as a **View** allows you to define your DOM events declaratively, without\n  // having to worry about render order ... and makes it easy for the view to\n  // react to specific changes in the state of your models.\n\n  // Creating a Backbone.View creates its initial element outside of the DOM,\n  // if an existing element is not provided...\n  var View = Backbone.View = function(options) {\n    this.cid = _.uniqueId('view');\n    this._configure(options || {});\n    this._ensureElement();\n    this.initialize.apply(this, arguments);\n    this.delegateEvents();\n  };\n\n  // Cached regex to split keys for `delegate`.\n  var delegateEventSplitter = /^(\\S+)\\s*(.*)$/;\n\n  // List of view options to be merged as properties.\n  var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];\n\n  // Set up all inheritable **Backbone.View** properties and methods.\n  _.extend(View.prototype, Events, {\n\n    // The default `tagName` of a View's element is `\"div\"`.\n    tagName: 'div',\n\n    // jQuery delegate for element lookup, scoped to DOM elements within the\n    // current view. This should be prefered to global lookups where possible.\n    $: function(selector) {\n      return this.$el.find(selector);\n    },\n\n    // Initialize is an empty function by default. Override it with your own\n    // initialization logic.\n    initialize: function(){},\n\n    // **render** is the core function that your view should override, in order\n    // to populate its element (`this.el`), with the appropriate HTML. The\n    // convention is for **render** to always return `this`.\n    render: function() {\n      return this;\n    },\n\n    // Remove this view by taking the element out of the DOM, and removing any\n    // applicable Backbone.Events listeners.\n    remove: function() {\n      this.$el.remove();\n      this.stopListening();\n      return this;\n    },\n\n    // Change the view's element (`this.el` property), including event\n    // re-delegation.\n    setElement: function(element, delegate) {\n      if (this.$el) this.undelegateEvents();\n      this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);\n      this.el = this.$el[0];\n      if (delegate !== false) this.delegateEvents();\n      return this;\n    },\n\n    // Set callbacks, where `this.events` is a hash of\n    //\n    // *{\"event selector\": \"callback\"}*\n    //\n    //     {\n    //       'mousedown .title':  'edit',\n    //       'click .button':     'save'\n    //       'click .open':       function(e) { ... }\n    //     }\n    //\n    // pairs. Callbacks will be bound to the view, with `this` set properly.\n    // Uses event delegation for efficiency.\n    // Omitting the selector binds the event to `this.el`.\n    // This only works for delegate-able events: not `focus`, `blur`, and\n    // not `change`, `submit`, and `reset` in Internet Explorer.\n    delegateEvents: function(events) {\n      if (!(events || (events = _.result(this, 'events')))) return this;\n      this.undelegateEvents();\n      for (var key in events) {\n        var method = events[key];\n        if (!_.isFunction(method)) method = this[events[key]];\n        if (!method) continue;\n\n        var match = key.match(delegateEventSplitter);\n        var eventName = match[1], selector = match[2];\n        method = _.bind(method, this);\n        eventName += '.delegateEvents' + this.cid;\n        if (selector === '') {\n          this.$el.on(eventName, method);\n        } else {\n          this.$el.on(eventName, selector, method);\n        }\n      }\n      return this;\n    },\n\n    // Clears all callbacks previously bound to the view with `delegateEvents`.\n    // You usually don't need to use this, but may wish to if you have multiple\n    // Backbone views attached to the same DOM element.\n    undelegateEvents: function() {\n      this.$el.off('.delegateEvents' + this.cid);\n      return this;\n    },\n\n    // Performs the initial configuration of a View with a set of options.\n    // Keys with special meaning *(e.g. model, collection, id, className)* are\n    // attached directly to the view.  See `viewOptions` for an exhaustive\n    // list.\n    _configure: function(options) {\n      if (this.options) options = _.extend({}, _.result(this, 'options'), options);\n      _.extend(this, _.pick(options, viewOptions));\n      this.options = options;\n    },\n\n    // Ensure that the View has a DOM element to render into.\n    // If `this.el` is a string, pass it through `$()`, take the first\n    // matching element, and re-assign it to `el`. Otherwise, create\n    // an element from the `id`, `className` and `tagName` properties.\n    _ensureElement: function() {\n      if (!this.el) {\n        var attrs = _.extend({}, _.result(this, 'attributes'));\n        if (this.id) attrs.id = _.result(this, 'id');\n        if (this.className) attrs['class'] = _.result(this, 'className');\n        var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs);\n        this.setElement($el, false);\n      } else {\n        this.setElement(_.result(this, 'el'), false);\n      }\n    }\n\n  });\n\n  // Backbone.sync\n  // -------------\n\n  // Override this function to change the manner in which Backbone persists\n  // models to the server. You will be passed the type of request, and the\n  // model in question. By default, makes a RESTful Ajax request\n  // to the model's `url()`. Some possible customizations could be:\n  //\n  // * Use `setTimeout` to batch rapid-fire updates into a single request.\n  // * Send up the models as XML instead of JSON.\n  // * Persist models via WebSockets instead of Ajax.\n  //\n  // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests\n  // as `POST`, with a `_method` parameter containing the true HTTP method,\n  // as well as all requests with the body as `application/x-www-form-urlencoded`\n  // instead of `application/json` with the model in a param named `model`.\n  // Useful when interfacing with server-side languages like **PHP** that make\n  // it difficult to read the body of `PUT` requests.\n  Backbone.sync = function(method, model, options) {\n    var type = methodMap[method];\n\n    // Default options, unless specified.\n    _.defaults(options || (options = {}), {\n      emulateHTTP: Backbone.emulateHTTP,\n      emulateJSON: Backbone.emulateJSON\n    });\n\n    // Default JSON-request options.\n    var params = {type: type, dataType: 'json'};\n\n    // Ensure that we have a URL.\n    if (!options.url) {\n      params.url = _.result(model, 'url') || urlError();\n    }\n\n    // Ensure that we have the appropriate request data.\n    if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {\n      params.contentType = 'application/json';\n      params.data = JSON.stringify(options.attrs || model.toJSON(options));\n    }\n\n    // For older servers, emulate JSON by encoding the request into an HTML-form.\n    if (options.emulateJSON) {\n      params.contentType = 'application/x-www-form-urlencoded';\n      params.data = params.data ? {model: params.data} : {};\n    }\n\n    // For older servers, emulate HTTP by mimicking the HTTP method with `_method`\n    // And an `X-HTTP-Method-Override` header.\n    if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {\n      params.type = 'POST';\n      if (options.emulateJSON) params.data._method = type;\n      var beforeSend = options.beforeSend;\n      options.beforeSend = function(xhr) {\n        xhr.setRequestHeader('X-HTTP-Method-Override', type);\n        if (beforeSend) return beforeSend.apply(this, arguments);\n      };\n    }\n\n    // Don't process data on a non-GET request.\n    if (params.type !== 'GET' && !options.emulateJSON) {\n      params.processData = false;\n    }\n\n    // If we're sending a `PATCH` request, and we're in an old Internet Explorer\n    // that still has ActiveX enabled by default, override jQuery to use that\n    // for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.\n    if (params.type === 'PATCH' && window.ActiveXObject &&\n          !(window.external && window.external.msActiveXFilteringEnabled)) {\n      params.xhr = function() {\n        return new ActiveXObject(\"Microsoft.XMLHTTP\");\n      };\n    }\n\n    // Make the request, allowing the user to override any Ajax options.\n    var xhr = options.xhr = Backbone.ajax(_.extend(params, options));\n    model.trigger('request', model, xhr, options);\n    return xhr;\n  };\n\n  // Map from CRUD to HTTP for our default `Backbone.sync` implementation.\n  var methodMap = {\n    'create': 'POST',\n    'update': 'PUT',\n    'patch':  'PATCH',\n    'delete': 'DELETE',\n    'read':   'GET'\n  };\n\n  // Set the default implementation of `Backbone.ajax` to proxy through to `$`.\n  // Override this if you'd like to use a different library.\n  Backbone.ajax = function() {\n    return Backbone.$.ajax.apply(Backbone.$, arguments);\n  };\n\n  // Backbone.Router\n  // ---------------\n\n  // Routers map faux-URLs to actions, and fire events when routes are\n  // matched. Creating a new one sets its `routes` hash, if not set statically.\n  var Router = Backbone.Router = function(options) {\n    options || (options = {});\n    if (options.routes) this.routes = options.routes;\n    this._bindRoutes();\n    this.initialize.apply(this, arguments);\n  };\n\n  // Cached regular expressions for matching named param parts and splatted\n  // parts of route strings.\n  var optionalParam = /\\((.*?)\\)/g;\n  var namedParam    = /(\\(\\?)?:\\w+/g;\n  var splatParam    = /\\*\\w+/g;\n  var escapeRegExp  = /[\\-{}\\[\\]+?.,\\\\\\^$|#\\s]/g;\n\n  // Set up all inheritable **Backbone.Router** properties and methods.\n  _.extend(Router.prototype, Events, {\n\n    // Initialize is an empty function by default. Override it with your own\n    // initialization logic.\n    initialize: function(){},\n\n    // Manually bind a single named route to a callback. For example:\n    //\n    //     this.route('search/:query/p:num', 'search', function(query, num) {\n    //       ...\n    //     });\n    //\n    route: function(route, name, callback) {\n      if (!_.isRegExp(route)) route = this._routeToRegExp(route);\n      if (_.isFunction(name)) {\n        callback = name;\n        name = '';\n      }\n      if (!callback) callback = this[name];\n      var router = this;\n      Backbone.history.route(route, function(fragment) {\n        var args = router._extractParameters(route, fragment);\n        callback && callback.apply(router, args);\n        router.trigger.apply(router, ['route:' + name].concat(args));\n        router.trigger('route', name, args);\n        Backbone.history.trigger('route', router, name, args);\n      });\n      return this;\n    },\n\n    // Simple proxy to `Backbone.history` to save a fragment into the history.\n    navigate: function(fragment, options) {\n      Backbone.history.navigate(fragment, options);\n      return this;\n    },\n\n    // Bind all defined routes to `Backbone.history`. We have to reverse the\n    // order of the routes here to support behavior where the most general\n    // routes can be defined at the bottom of the route map.\n    _bindRoutes: function() {\n      if (!this.routes) return;\n      this.routes = _.result(this, 'routes');\n      var route, routes = _.keys(this.routes);\n      while ((route = routes.pop()) != null) {\n        this.route(route, this.routes[route]);\n      }\n    },\n\n    // Convert a route string into a regular expression, suitable for matching\n    // against the current location hash.\n    _routeToRegExp: function(route) {\n      route = route.replace(escapeRegExp, '\\\\$&')\n                   .replace(optionalParam, '(?:$1)?')\n                   .replace(namedParam, function(match, optional){\n                     return optional ? match : '([^\\/]+)';\n                   })\n                   .replace(splatParam, '(.*?)');\n      return new RegExp('^' + route + '$');\n    },\n\n    // Given a route, and a URL fragment that it matches, return the array of\n    // extracted decoded parameters. Empty or unmatched parameters will be\n    // treated as `null` to normalize cross-browser behavior.\n    _extractParameters: function(route, fragment) {\n      var params = route.exec(fragment).slice(1);\n      return _.map(params, function(param) {\n        return param ? decodeURIComponent(param) : null;\n      });\n    }\n\n  });\n\n  // Backbone.History\n  // ----------------\n\n  // Handles cross-browser history management, based on either\n  // [pushState](http://diveintohtml5.info/history.html) and real URLs, or\n  // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)\n  // and URL fragments. If the browser supports neither (old IE, natch),\n  // falls back to polling.\n  var History = Backbone.History = function() {\n    this.handlers = [];\n    _.bindAll(this, 'checkUrl');\n\n    // Ensure that `History` can be used outside of the browser.\n    if (typeof window !== 'undefined') {\n      this.location = window.location;\n      this.history = window.history;\n    }\n  };\n\n  // Cached regex for stripping a leading hash/slash and trailing space.\n  var routeStripper = /^[#\\/]|\\s+$/g;\n\n  // Cached regex for stripping leading and trailing slashes.\n  var rootStripper = /^\\/+|\\/+$/g;\n\n  // Cached regex for detecting MSIE.\n  var isExplorer = /msie [\\w.]+/;\n\n  // Cached regex for removing a trailing slash.\n  var trailingSlash = /\\/$/;\n\n  // Has the history handling already been started?\n  History.started = false;\n\n  // Set up all inheritable **Backbone.History** properties and methods.\n  _.extend(History.prototype, Events, {\n\n    // The default interval to poll for hash changes, if necessary, is\n    // twenty times a second.\n    interval: 50,\n\n    // Gets the true hash value. Cannot use location.hash directly due to bug\n    // in Firefox where location.hash will always be decoded.\n    getHash: function(window) {\n      var match = (window || this).location.href.match(/#(.*)$/);\n      return match ? match[1] : '';\n    },\n\n    // Get the cross-browser normalized URL fragment, either from the URL,\n    // the hash, or the override.\n    getFragment: function(fragment, forcePushState) {\n      if (fragment == null) {\n        if (this._hasPushState || !this._wantsHashChange || forcePushState) {\n          fragment = this.location.pathname;\n          var root = this.root.replace(trailingSlash, '');\n          if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);\n        } else {\n          fragment = this.getHash();\n        }\n      }\n      return fragment.replace(routeStripper, '');\n    },\n\n    // Start the hash change handling, returning `true` if the current URL matches\n    // an existing route, and `false` otherwise.\n    start: function(options) {\n      if (History.started) throw new Error(\"Backbone.history has already been started\");\n      History.started = true;\n\n      // Figure out the initial configuration. Do we need an iframe?\n      // Is pushState desired ... is it available?\n      this.options          = _.extend({}, {root: '/'}, this.options, options);\n      this.root             = this.options.root;\n      this._wantsHashChange = this.options.hashChange !== false;\n      this._wantsPushState  = !!this.options.pushState;\n      this._hasPushState    = !!(this.options.pushState && this.history && this.history.pushState);\n      var fragment          = this.getFragment();\n      var docMode           = document.documentMode;\n      var oldIE             = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));\n\n      // Normalize root to always include a leading and trailing slash.\n      this.root = ('/' + this.root + '/').replace(rootStripper, '/');\n\n      if (oldIE && this._wantsHashChange) {\n        this.iframe = Backbone.$('<iframe src=\"javascript:0\" tabindex=\"-1\" />').hide().appendTo('body')[0].contentWindow;\n        this.navigate(fragment);\n      }\n\n      // Depending on whether we're using pushState or hashes, and whether\n      // 'onhashchange' is supported, determine how we check the URL state.\n      if (this._hasPushState) {\n        Backbone.$(window).on('popstate', this.checkUrl);\n      } else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {\n        Backbone.$(window).on('hashchange', this.checkUrl);\n      } else if (this._wantsHashChange) {\n        this._checkUrlInterval = setInterval(this.checkUrl, this.interval);\n      }\n\n      // Determine if we need to change the base url, for a pushState link\n      // opened by a non-pushState browser.\n      this.fragment = fragment;\n      var loc = this.location;\n      var atRoot = loc.pathname.replace(/[^\\/]$/, '$&/') === this.root;\n\n      // If we've started off with a route from a `pushState`-enabled browser,\n      // but we're currently in a browser that doesn't support it...\n      if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {\n        this.fragment = this.getFragment(null, true);\n        this.location.replace(this.root + this.location.search + '#' + this.fragment);\n        // Return immediately as browser will do redirect to new url\n        return true;\n\n      // Or if we've started out with a hash-based route, but we're currently\n      // in a browser where it could be `pushState`-based instead...\n      } else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {\n        this.fragment = this.getHash().replace(routeStripper, '');\n        this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);\n      }\n\n      if (!this.options.silent) return this.loadUrl();\n    },\n\n    // Disable Backbone.history, perhaps temporarily. Not useful in a real app,\n    // but possibly useful for unit testing Routers.\n    stop: function() {\n      Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);\n      clearInterval(this._checkUrlInterval);\n      History.started = false;\n    },\n\n    // Add a route to be tested when the fragment changes. Routes added later\n    // may override previous routes.\n    route: function(route, callback) {\n      this.handlers.unshift({route: route, callback: callback});\n    },\n\n    // Checks the current URL to see if it has changed, and if it has,\n    // calls `loadUrl`, normalizing across the hidden iframe.\n    checkUrl: function(e) {\n      var current = this.getFragment();\n      if (current === this.fragment && this.iframe) {\n        current = this.getFragment(this.getHash(this.iframe));\n      }\n      if (current === this.fragment) return false;\n      if (this.iframe) this.navigate(current);\n      this.loadUrl() || this.loadUrl(this.getHash());\n    },\n\n    // Attempt to load the current URL fragment. If a route succeeds with a\n    // match, returns `true`. If no defined routes matches the fragment,\n    // returns `false`.\n    loadUrl: function(fragmentOverride) {\n      var fragment = this.fragment = this.getFragment(fragmentOverride);\n      var matched = _.any(this.handlers, function(handler) {\n        if (handler.route.test(fragment)) {\n          handler.callback(fragment);\n          return true;\n        }\n      });\n      return matched;\n    },\n\n    // Save a fragment into the hash history, or replace the URL state if the\n    // 'replace' option is passed. You are responsible for properly URL-encoding\n    // the fragment in advance.\n    //\n    // The options object can contain `trigger: true` if you wish to have the\n    // route callback be fired (not usually desirable), or `replace: true`, if\n    // you wish to modify the current URL without adding an entry to the history.\n    navigate: function(fragment, options) {\n      if (!History.started) return false;\n      if (!options || options === true) options = {trigger: options};\n      fragment = this.getFragment(fragment || '');\n      if (this.fragment === fragment) return;\n      this.fragment = fragment;\n      var url = this.root + fragment;\n\n      // If pushState is available, we use it to set the fragment as a real URL.\n      if (this._hasPushState) {\n        this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);\n\n      // If hash changes haven't been explicitly disabled, update the hash\n      // fragment to store history.\n      } else if (this._wantsHashChange) {\n        this._updateHash(this.location, fragment, options.replace);\n        if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) {\n          // Opening and closing the iframe tricks IE7 and earlier to push a\n          // history entry on hash-tag change.  When replace is true, we don't\n          // want this.\n          if(!options.replace) this.iframe.document.open().close();\n          this._updateHash(this.iframe.location, fragment, options.replace);\n        }\n\n      // If you've told us that you explicitly don't want fallback hashchange-\n      // based history, then `navigate` becomes a page refresh.\n      } else {\n        return this.location.assign(url);\n      }\n      if (options.trigger) this.loadUrl(fragment);\n    },\n\n    // Update the hash location, either replacing the current entry, or adding\n    // a new one to the browser history.\n    _updateHash: function(location, fragment, replace) {\n      if (replace) {\n        var href = location.href.replace(/(javascript:|#).*$/, '');\n        location.replace(href + '#' + fragment);\n      } else {\n        // Some browsers require that `hash` contains a leading #.\n        location.hash = '#' + fragment;\n      }\n    }\n\n  });\n\n  // Create the default Backbone.history.\n  Backbone.history = new History;\n\n  // Helpers\n  // -------\n\n  // Helper function to correctly set up the prototype chain, for subclasses.\n  // Similar to `goog.inherits`, but uses a hash of prototype properties and\n  // class properties to be extended.\n  var extend = function(protoProps, staticProps) {\n    var parent = this;\n    var child;\n\n    // The constructor function for the new subclass is either defined by you\n    // (the \"constructor\" property in your `extend` definition), or defaulted\n    // by us to simply call the parent's constructor.\n    if (protoProps && _.has(protoProps, 'constructor')) {\n      child = protoProps.constructor;\n    } else {\n      child = function(){ return parent.apply(this, arguments); };\n    }\n\n    // Add static properties to the constructor function, if supplied.\n    _.extend(child, parent, staticProps);\n\n    // Set the prototype chain to inherit from `parent`, without calling\n    // `parent`'s constructor function.\n    var Surrogate = function(){ this.constructor = child; };\n    Surrogate.prototype = parent.prototype;\n    child.prototype = new Surrogate;\n\n    // Add prototype properties (instance properties) to the subclass,\n    // if supplied.\n    if (protoProps) _.extend(child.prototype, protoProps);\n\n    // Set a convenience property in case the parent's prototype is needed\n    // later.\n    child.__super__ = parent.prototype;\n\n    return child;\n  };\n\n  // Set up inheritance for the model, collection, router, view and history.\n  Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;\n\n  // Throw an error when a URL is needed, and none is supplied.\n  var urlError = function() {\n    throw new Error('A \"url\" property or function must be specified');\n  };\n\n  // Wrap an optional error callback with a fallback error event.\n  var wrapError = function (model, options) {\n    var error = options.error;\n    options.error = function(resp) {\n      if (error) error(model, resp, options);\n      model.trigger('error', model, resp, options);\n    };\n  };\n\n}).call(this);\n\n/**\n * jQuery.fn.sortElements\n * --------------\n * @author James Padolsey (http://james.padolsey.com)\n * @version 0.11\n * @updated 18-MAR-2010\n * --------------\n * @param Function comparator:\n *   Exactly the same behaviour as [1,2,3].sort(comparator)\n *   \n * @param Function getSortable\n *   A function that should return the element that is\n *   to be sorted. The comparator will run on the\n *   current collection, but you may want the actual\n *   resulting sort to occur on a parent or another\n *   associated element.\n *   \n *   E.g. $('td').sortElements(comparator, function(){\n *      return this.parentNode; \n *   })\n *   \n *   The <td>'s parent (<tr>) will be sorted instead\n *   of the <td> itself.\n */\njQuery.fn.sortElements = (function(){\n    \n    var sort = [].sort;\n    \n    return function(comparator, getSortable) {\n        \n        getSortable = getSortable || function(){return this;};\n        \n        var placements = this.map(function(){\n            \n            var sortElement = getSortable.call(this),\n                parentNode = sortElement.parentNode,\n                \n                // Since the element itself will change position, we have\n                // to have some way of storing it's original position in\n                // the DOM. The easiest way is to have a 'flag' node:\n                nextSibling = parentNode.insertBefore(\n                    document.createTextNode(''),\n                    sortElement.nextSibling\n                );\n            \n            return function() {\n                \n                if (parentNode === this) {\n                    throw new Error(\n                        \"You can't sort elements if any one is a descendant of another.\"\n                    );\n                }\n                \n                // Insert before flag:\n                parentNode.insertBefore(this, nextSibling);\n                // Remove flag:\n                parentNode.removeChild(nextSibling);\n                \n            };\n            \n        });\n       \n        return sort.call(this, comparator).each(function(i){\n            placements[i].call(getSortable.call(this));\n        });\n        \n    };\n    \n})();\n//      JointJS library.\n//      (c) 2011-2013 client IO\n\nif (typeof exports === 'object') {\n\n    var _ = require('lodash');\n}\n\n\n// Global namespace.\n\nvar joint = {\n\n    // `joint.dia` namespace.\n    dia: {},\n\n    // `joint.ui` namespace.\n    ui: {},\n\n    // `joint.layout` namespace.\n    layout: {},\n\n    // `joint.shapes` namespace.\n    shapes: {},\n\n    // `joint.format` namespace.\n    format: {},\n\n    util: {\n\n        // Return a simple hash code from a string. See http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/.\n        hashCode: function(str) {\n\n            var hash = 0;\n            if (str.length == 0) return hash;\n            for (var i = 0; i < str.length; i++) {\n                var c = str.charCodeAt(i);\n                hash = ((hash << 5) - hash) + c;\n                hash = hash & hash; // Convert to 32bit integer\n            }\n            return hash;\n        },\n\n        getByPath: function(obj, path, delim) {\n            \n            delim = delim || '.';\n            var keys = path.split(delim);\n            var key;\n            \n            while (keys.length) {\n                key = keys.shift();\n                if (key in obj) {\n                    obj = obj[key];\n                } else {\n                    return undefined;\n                }\n            }\n            return obj;\n        },\n\n        setByPath: function(obj, path, value, delim) {\n\n            delim = delim || '.';\n\n            var keys = path.split(delim);\n            var diver = obj;\n            var i = 0;\n\n            if (path.indexOf(delim) > -1) {\n\n                for (var len = keys.length; i < len - 1; i++) {\n                    // diver creates an empty object if there is no nested object under such a key.\n                    // This means that one can populate an empty nested object with setByPath().\n                    diver = diver[keys[i]] || (diver[keys[i]] = {});\n                }\n                diver[keys[len - 1]] = value;\n            } else {\n                obj[path] = value;\n            }\n            return obj;\n        },\n\n        flattenObject: function(obj, delim, stop) {\n            \n            delim = delim || '.';\n            var ret = {};\n\t    \n\t    for (var key in obj) {\n\t\tif (!obj.hasOwnProperty(key)) continue;\n\n                var shouldGoDeeper = typeof obj[key] === 'object';\n                if (shouldGoDeeper && stop && stop(obj[key])) {\n                    shouldGoDeeper = false;\n                }\n                \n\t\tif (shouldGoDeeper) {\n\t\t    var flatObject = this.flattenObject(obj[key], delim, stop);\n\t\t    for (var flatKey in flatObject) {\n\t\t\tif (!flatObject.hasOwnProperty(flatKey)) continue;\n\t\t\t\n\t\t\tret[key + delim + flatKey] = flatObject[flatKey];\n\t\t    }\n\t\t} else {\n\t\t    ret[key] = obj[key];\n\t\t}\n\t    }\n\t    return ret;\n        },\n\n        uuid: function() {\n\n            // credit: http://stackoverflow.com/posts/2117523/revisions\n            \n            return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n                var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n                return v.toString(16);\n            });\n        },\n\n        // Generate global unique id for obj and store it as a property of the object.\n        guid: function(obj) {\n            \n            this.guid.id = this.guid.id || 1;\n            obj.id = (obj.id === undefined ? 'j_' + this.guid.id++ : obj.id);\n            return obj.id;\n        },\n\n        // Copy all the properties to the first argument from the following arguments.\n        // All the properties will be overwritten by the properties from the following\n        // arguments. Inherited properties are ignored.\n        mixin: function() {\n            \n            var target = arguments[0];\n            \n            for (var i = 1, l = arguments.length; i < l; i++) {\n                \n                var extension = arguments[i];\n                \n                // Only functions and objects can be mixined.\n\n                if ((Object(extension) !== extension) &&\n                    !_.isFunction(extension) &&\n                    (extension === null || extension === undefined)) {\n\n                    continue;\n                }\n\n                _.each(extension, function(copy, key) {\n                    \n                    if (this.mixin.deep && (Object(copy) === copy)) {\n\n                        if (!target[key]) {\n\n                            target[key] = _.isArray(copy) ? [] : {};\n                        }\n                        \n                        this.mixin(target[key], copy);\n                        return;\n                    }\n                    \n                    if (target[key] !== copy) {\n                        \n                        if (!this.mixin.supplement || !target.hasOwnProperty(key)) {\n                            \n\t                    target[key] = copy;\n                        }\n\n                    }\n                    \n                }, this);\n            }\n            \n            return target;\n        },\n\n        // Copy all properties to the first argument from the following\n        // arguments only in case if they don't exists in the first argument.\n        // All the function propererties in the first argument will get\n        // additional property base pointing to the extenders same named\n        // property function's call method.\n        supplement: function() {\n\n            this.mixin.supplement = true;\n            var ret = this.mixin.apply(this, arguments);\n            this.mixin.supplement = false;\n            return ret;\n        },\n\n        // Same as `mixin()` but deep version.\n        deepMixin: function() {\n            \n            this.mixin.deep = true;\n            var ret = this.mixin.apply(this, arguments);\n            this.mixin.deep = false;\n            return ret;\n        },\n\n        // Same as `supplement()` but deep version.\n        deepSupplement: function() {\n            \n            this.mixin.deep = this.mixin.supplement = true;\n            var ret = this.mixin.apply(this, arguments);\n            this.mixin.deep = this.mixin.supplement = false;\n            return ret;\n        },\n\n        normalizeEvent: function(evt) {\n\n            return (evt.originalEvent && evt.originalEvent.changedTouches && evt.originalEvent.changedTouches.length) ? evt.originalEvent.changedTouches[0] : evt;\n        },\n\n\tnextFrame:(function() {\n\n\t    var raf;\n\t    var client = typeof window != 'undefined';\n\n\t    if (client) {\n\n\t\traf = window.requestAnimationFrame       ||\n\t\t      window.webkitRequestAnimationFrame ||\n\t              window.mozRequestAnimationFrame    ||\n\t\t      window.oRequestAnimationFrame      ||\n\t\t      window.msRequestAnimationFrame;\n\n\t    }\n\n\t    if (!raf) {\n\n\t\tvar lastTime = 0;\n\n\t\traf = function(callback) {\n\n\t\t    var currTime = new Date().getTime();\n\t\t    var timeToCall = Math.max(0, 16 - (currTime - lastTime));\n\t\t    var id = setTimeout(function() { callback(currTime + timeToCall); }, timeToCall);\n\t\t    lastTime = currTime + timeToCall;\n\t\t    return id;\n\n\t\t};\n\t    }\n\n\t    return client ? _.bind(raf, window) : raf;\n\t})(),\n\n\tcancelFrame: (function() {\n\n\t    var caf;\n\t    var client = typeof window != 'undefined';\n\n\t    if (client) {\n\n\t\tcaf = window.cancelAnimationFrame              ||\n\t\t      window.webkitCancelAnimationFrame        ||\n\t              window.webkitCancelRequestAnimationFrame ||\n\t\t      window.msCancelAnimationFrame            ||\n\t              window.msCancelRequestAnimationFrame     ||\n\t\t      window.oCancelAnimationFrame             ||\n\t              window.oCancelRequestAnimationFrame      ||\n\t              window.mozCancelAnimationFrame           ||\n\t\t      window.mozCancelRequestAnimationFrame;\n\n\t    }\n\n\t    caf = caf || clearTimeout;\n\n\t    return client ? _.bind(caf, window) : caf;\n\t})(),\n\n\ttiming: {\n\n\t    linear: function(t) {\n\t\treturn t;\n\t    },\n\n\t    quad: function(t) {\n\t\treturn t * t;\n\t    },\n\n\t    cubic: function(t) {\n\t\treturn t * t * t;\n\t    },\n\n\t    inout: function(t) {\n\t\tif (t <= 0) return 0;\n\t\tif (t >= 1) return 1;\n\t\tvar t2 = t * t, t3 = t2 * t;\n\t\treturn 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75);\n\t    },\n\n\t    exponential: function(t) {\n\t\treturn Math.pow(2, 10 * (t - 1));\n\t    },\n\n\t    bounce: function(t) {\n\t\tfor(var a = 0, b = 1; 1; a += b, b /= 2) {\n\t\t    if (t >= (7 - 4 * a) / 11) {\n\t\t\tvar q = (11 - 6 * a - 11 * t) / 4;\n\t\t\treturn -q * q + b * b;\n\t\t    }\n\t\t}\n\t    },\n\n\t    reverse: function(f) {\n\t\treturn function(t) {\n\t\t    return 1 - f(1 - t)\n\t\t}\n\t    },\n\n\t    reflect: function(f) {\n\t\treturn function(t) {\n\t\t    return .5 * (t < .5 ? f(2 * t) : (2 - f(2 - 2 * t)));\n\t\t};\n\t    },\n\n\t    clamp: function(f,n,x) {\n\t\tn = n || 0;\n\t\tx = x || 1;\n\t\treturn function(t) {\n\t\t    var r = f(t);\n\t\t    return r < n ? n : r > x ? x : r;\n\t\t}\n\t    },\n\n\t    back: function(s) {\n\t\tif (!s) s = 1.70158;\n\t\treturn function(t) {\n\t\t    return t * t * ((s + 1) * t - s);\n\t\t};\n\t    },\n\n\t    elastic: function(x) {\n\t\tif (!x) x = 1.5;\n\t\treturn function(t) {\n\t\t    return Math.pow(2, 10 * (t - 1)) * Math.cos(20*Math.PI*x/3*t);\n\t\t}\n\t    }\n\n\t},\n\n\tinterpolate: {\n\n\t    number: function(a, b) {\n\t\tvar d = b - a;\n\t\treturn function(t) { return a + d * t; };\n\t    },\n\n\t    object: function(a, b) {\n\t\tvar s = _.keys(a);\n\t\treturn function(t) {\n\t\t    var i, p, r = {};\n\t\t    for (i = s.length - 1; i != -1; i--) {\n\t\t\tp = s[i];\n\t\t\tr[p] = a[p] + (b[p] - a[p]) * t;\n\t\t    }\n\t\t    return  r;\n\t\t}\n\t    },\n\n\t    hexColor: function(a, b) {\n\n\t\tvar ca = parseInt(a.slice(1), 16), cb = parseInt(b.slice(1), 16);\n\n\t\tvar ra = ca & 0x0000ff, rd = (cb & 0x0000ff) - ra;\n\t\tvar ga = ca & 0x00ff00, gd = (cb & 0x00ff00) - ga;\n\t\tvar ba = ca & 0xff0000, bd = (cb & 0xff0000) - ba;\n\n\t\treturn function(t) {\n\t\t    return '#' + (1 << 24 |(ra + rd * t)|(ga + gd * t)|(ba + bd * t)).toString(16).slice(1);\n\t\t};\n\t    },\n\n\t    unit: function(a, b) {\n\n\t\tvar r = /(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/;\n\n\t\tvar ma = r.exec(a), mb = r.exec(b);\n\t\tvar p = mb[1].indexOf('.'), f = p > 0 ? mb[1].length - p - 1 : 0;\n\t\tvar a = +ma[1], d = +mb[1] - a, u = ma[2];\n\n\t\treturn function(t) {\n\t\t    return (a + d * t).toFixed(f) + u;\n\t\t}\n\t    }\n\t},\n\n        // SVG filters.\n        filter: {\n\n            // `x` ... horizontal blur\n            // `y` ... vertical blur (optional)\n            blur: function(args) {\n                \n                var x = _.isFinite(args.x) ? args.x : 2;\n\n                return _.template('<filter><feGaussianBlur stdDeviation=\"${stdDeviation}\"/></filter>', {\n                    stdDeviation: _.isFinite(args.y) ? [x, args.y] : x\n                });\n            },\n\n            // `dx` ... horizontal shift\n            // `dy` ... vertical shift\n            // `blur` ... blur\n            // `color` ... color\n            dropShadow: function(args) {\n                \n                return _.template('<filter><feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"${blur}\"/><feOffset dx=\"${dx}\" dy=\"${dy}\" result=\"offsetblur\"/><feFlood flood-color=\"${color}\"/><feComposite in2=\"offsetblur\" operator=\"in\"/><feMerge><feMergeNode/><feMergeNode in=\"SourceGraphic\"/></feMerge></filter>', {\n                    dx: args.dx || 0,\n                    dy: args.dy || 0,\n                    color: args.color || 'black',\n                    blur: _.isFinite(args.blur) ? args.blur : 4\n                });\n            },\n\n            // `amount` ... the proportion of the conversion. A value of 1 is completely grayscale. A value of 0 leaves the input unchanged.\n            grayscale: function(args) {\n\n                var amount = _.isFinite(args.amount) ? args.amount : 1;\n                \n                return _.template('<filter><feColorMatrix type=\"matrix\" values=\"${a} ${b} ${c} 0 0 ${d} ${e} ${f} 0 0 ${g} ${b} ${h} 0 0 0 0 0 1 0\"/></filter>', {\n                    a: 0.2126 + 0.7874 * (1 - amount),\n                    b: 0.7152 - 0.7152 * (1 - amount),\n                    c: 0.0722 - 0.0722 * (1 - amount),\n                    d: 0.2126 - 0.2126 * (1 - amount),\n                    e: 0.7152 + 0.2848 * (1 - amount),\n                    f: 0.0722 - 0.0722 * (1 - amount),\n                    g: 0.2126 - 0.2126 * (1 - amount),\n                    h: 0.0722 + 0.9278 * (1 - amount)\n                });\n            },\n\n            // `amount` ... the proportion of the conversion. A value of 1 is completely sepia. A value of 0 leaves the input unchanged.\n            sepia: function(args) {\n\n                var amount = _.isFinite(args.amount) ? args.amount : 1;\n\n                return _.template('<filter><feColorMatrix type=\"matrix\" values=\"${a} ${b} ${c} 0 0 ${d} ${e} ${f} 0 0 ${g} ${h} ${i} 0 0 0 0 0 1 0\"/></filter>', {\n                    a: 0.393 + 0.607 * (1 - amount),\n                    b: 0.769 - 0.769 * (1 - amount),\n                    c: 0.189 - 0.189 * (1 - amount),\n                    d: 0.349 - 0.349 * (1 - amount),\n                    e: 0.686 + 0.314 * (1 - amount),\n                    f: 0.168 - 0.168 * (1 - amount),\n                    g: 0.272 - 0.272 * (1 - amount),\n                    h: 0.534 - 0.534 * (1 - amount),\n                    i: 0.131 + 0.869 * (1 - amount)\n                });\n            },\n\n            // `amount` ... the proportion of the conversion. A value of 0 is completely un-saturated. A value of 1 leaves the input unchanged.\n            saturate: function(args) {\n\n                var amount = _.isFinite(args.amount) ? args.amount : 1;\n\n                return _.template('<filter><feColorMatrix type=\"saturate\" values=\"${amount}\"/></filter>', {\n                    amount: 1 - amount\n                });\n            },\n\n            // `angle` ...  the number of degrees around the color circle the input samples will be adjusted.\n            hueRotate: function(args) {\n\n                return _.template('<filter><feColorMatrix type=\"hueRotate\" values=\"${angle}\"/></filter>', {\n                    angle: args.angle || 0\n                });\n            },\n\n            // `amount` ... the proportion of the conversion. A value of 1 is completely inverted. A value of 0 leaves the input unchanged.\n            invert: function(args) {\n\n                var amount = _.isFinite(args.amount) ? args.amount : 1;\n                \n                return _.template('<filter><feComponentTransfer><feFuncR type=\"table\" tableValues=\"${amount} ${amount2}\"/><feFuncG type=\"table\" tableValues=\"${amount} ${amount2}\"/><feFuncB type=\"table\" tableValues=\"${amount} ${amount2}\"/></feComponentTransfer></filter>', {\n                    amount: amount,\n                    amount2: 1 - amount\n                });\n            },\n\n            // `amount` ... proportion of the conversion. A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged.\n            brightness: function(args) {\n\n                return _.template('<filter><feComponentTransfer><feFuncR type=\"linear\" slope=\"${amount}\"/><feFuncG type=\"linear\" slope=\"${amount}\"/><feFuncB type=\"linear\" slope=\"${amount}\"/></feComponentTransfer></filter>', {\n                    amount: _.isFinite(args.amount) ? args.amount : 1\n                });\n            },\n\n            // `amount` ... proportion of the conversion. A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged.\n            contrast: function(args) {\n\n                var amount = _.isFinite(args.amount) ? args.amount : 1;\n                \n                return _.template('<filter><feComponentTransfer><feFuncR type=\"linear\" slope=\"${amount}\" intercept=\"${amount2}\"/><feFuncG type=\"linear\" slope=\"${amount}\" intercept=\"${amount2}\"/><feFuncB type=\"linear\" slope=\"${amount}\" intercept=\"${amount2}\"/></feComponentTransfer></filter>', {\n                    amount: amount,\n                    amount2: .5 - amount / 2\n                });\n            }\n        }\n    }\n};\n\nif (typeof exports === 'object') {\n\n    module.exports = joint;\n}\n// Vectorizer.\n// -----------\n\n// A tiny library for making your live easier when dealing with SVG.\n\n// Copyright Â© 2012 - 2013 client IO\n\n(function(root, factory) {\n\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define(['lodash'], factory);\n        \n    } else {\n        // Browser globals.\n        root.Vectorizer = root.V = factory(root._);\n    }\n\n}(this, function(_) {\n\n    // Well, if SVG is not supported, this library is useless.\n    var SVGsupported = !!(window.SVGAngle || document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1'));\n\n    // XML namespaces.\n    var ns = {\n        xmlns: 'http://www.w3.org/2000/svg',\n        xlink: 'http://www.w3.org/1999/xlink'\n    };\n    // SVG version.\n    var SVGversion = '1.1';\n\n    // Create SVG element.\n    // -------------------\n\n    function createElement(el, attrs, children) {\n\n        if (!el) return undefined;\n        \n        // If `el` is an object, it is probably a native SVG element. Wrap it to VElement.\n        if (typeof el === 'object') {\n            return new VElement(el);\n        }\n        attrs = attrs || {};\n\n        // If `el` is a `'svg'` or `'SVG'` string, create a new SVG canvas.\n        if (el.toLowerCase() === 'svg') {\n            \n            attrs.xmlns = ns.xmlns;\n            attrs['xmlns:xlink'] = ns.xlink;\n            attrs.version = SVGversion;\n            \n        } else if (el[0] === '<') {\n            // Create element from an SVG string.\n            // Allows constructs of type: `document.appendChild(Vectorizer('<rect></rect>').node)`.\n            \n            var svg = '<svg xmlns=\"' + ns.xmlns + '\" xmlns:xlink=\"' + ns.xlink + '\" version=\"' + SVGversion + '\">' + el + '</svg>';\n            var parser = new DOMParser();\n            parser.async = false;\n            var svgDoc = parser.parseFromString(svg, 'text/xml').documentElement;\n\n            // Note that `createElement()` might also return an array should the SVG string passed as\n            // the first argument contain more then one root element.\n            if (svgDoc.childNodes.length > 1) {\n\n                return _.map(svgDoc.childNodes, function(childNode) {\n\n                    return new VElement(document.importNode(childNode, true));\n                });\n            }\n            \n            return new VElement(document.importNode(svgDoc.firstChild, true));\n        }\n        \n        el = document.createElementNS(ns.xmlns, el);\n\n        // Set attributes.\n        for (var key in attrs) {\n\n            setAttribute(el, key, attrs[key]);\n        }\n        \n        // Normalize `children` array.\n        if (Object.prototype.toString.call(children) != '[object Array]') children = [children];\n\n        // Append children if they are specified.\n        var i = 0, len = (children[0] && children.length) || 0, child;\n        for (; i < len; i++) {\n            child = children[i];\n            el.appendChild(child instanceof VElement ? child.node : child);\n        }\n        \n        return new VElement(el);\n    }\n\n    function setAttribute(el, name, value) {\n        \n        if (name.indexOf(':') > -1) {\n            // Attribute names can be namespaced. E.g. `image` elements\n            // have a `xlink:href` attribute to set the source of the image.\n            var combinedKey = name.split(':');\n            el.setAttributeNS(ns[combinedKey[0]], combinedKey[1], value);\n        } else if (name === 'id') {\n            el.id = value;\n        } else {\n            el.setAttribute(name, value);\n        }\n    }\n\n    function parseTransformString(transform) {\n        var translate,\n            rotate,\n            scale;\n        \n        if (transform) {\n            var translateMatch = transform.match(/translate\\((.*)\\)/);\n            if (translateMatch) {\n                translate = translateMatch[1].split(',');\n            }\n            var rotateMatch = transform.match(/rotate\\((.*)\\)/);\n            if (rotateMatch) {\n                rotate = rotateMatch[1].split(',');\n            }\n            var scaleMatch = transform.match(/scale\\((.*)\\)/);\n            if (scaleMatch) {\n                scale = scaleMatch[1].split(',');\n            }\n        }\n\n        var sx = (scale && scale[0]) ? parseFloat(scale[0]) : 1;\n        \n        return {\n            translate: {\n                tx: (translate && translate[0]) ? parseInt(translate[0], 10) : 0,\n                ty: (translate && translate[1]) ? parseInt(translate[1], 10) : 0\n            },\n            rotate: {\n                angle: (rotate && rotate[0]) ? parseInt(rotate[0], 10) : 0,\n                cx: (rotate && rotate[1]) ? parseInt(rotate[1], 10) : undefined,\n                cy: (rotate && rotate[2]) ? parseInt(rotate[2], 10) : undefined\n            },\n            scale: {\n                sx: sx,\n                sy: (scale && scale[1]) ? parseFloat(scale[1]) : sx\n            }\n        };\n    }\n\n\n    // Matrix decomposition.\n    // ---------------------\n\n    function deltaTransformPoint(matrix, point)  {\n        \n\tvar dx = point.x * matrix.a + point.y * matrix.c + 0;\n\tvar dy = point.x * matrix.b + point.y * matrix.d + 0;\n\treturn { x: dx, y: dy };\n    }\n\n    function decomposeMatrix(matrix) {\n\n        // @see https://gist.github.com/2052247\n        \n        // calculate delta transform point\n\tvar px = deltaTransformPoint(matrix, { x: 0, y: 1 });\n\tvar py = deltaTransformPoint(matrix, { x: 1, y: 0 });\n        \n\t// calculate skew\n\tvar skewX = ((180 / Math.PI) * Math.atan2(px.y, px.x) - 90);\n\tvar skewY = ((180 / Math.PI) * Math.atan2(py.y, py.x));\n        \n\treturn {\n            \n\t    translateX: matrix.e,\n\t    translateY: matrix.f,\n\t    scaleX: Math.sqrt(matrix.a * matrix.a + matrix.b * matrix.b),\n\t    scaleY: Math.sqrt(matrix.c * matrix.c + matrix.d * matrix.d),\n\t    skewX: skewX,\n\t    skewY: skewY,\n\t    rotation: skewX // rotation is the same as skew x\n\t};\n    }\n    \n    // VElement.\n    // ---------\n\n    function VElement(el) {\n        this.node = el;\n        if (!this.node.id) {\n            this.node.id = _.uniqueId('v_');\n        }\n    }\n\n    // VElement public API.\n    // --------------------\n\n    VElement.prototype = {\n        \n        translate: function(tx, ty) {\n            ty = ty || 0;\n            \n            var transformAttr = this.attr('transform') || '',\n                transform = parseTransformString(transformAttr);\n\n            // Is it a getter?\n            if (typeof tx === 'undefined') {\n                return transform.translate;\n            }\n            \n            transformAttr = transformAttr.replace(/translate\\([^\\)]*\\)/g, '').trim();\n\n            var newTx = transform.translate.tx + tx,\n                newTy = transform.translate.ty + ty;\n\n            // Note that `translate()` is always the first transformation. This is\n            // usually the desired case.\n            this.attr('transform', 'translate(' + newTx + ',' + newTy + ') ' + transformAttr);\n            return this;\n        },\n\n        rotate: function(angle, cx, cy) {\n            var transformAttr = this.attr('transform') || '',\n                transform = parseTransformString(transformAttr);\n\n            // Is it a getter?\n            if (typeof angle === 'undefined') {\n                return transform.rotate;\n            }\n            \n            transformAttr = transformAttr.replace(/rotate\\([^\\)]*\\)/g, '').trim();\n\n            var newAngle = transform.rotate.angle + angle % 360,\n                newOrigin = (cx !== undefined && cy !== undefined) ? ',' + cx + ',' + cy : '';\n            \n            this.attr('transform', transformAttr + ' rotate(' + newAngle + newOrigin + ')');\n            return this;\n        },\n\n        // Note that `scale` as the only transformation does not combine with previous values.\n        scale: function(sx, sy) {\n            sy = (typeof sy === 'undefined') ? sx : sy;\n            \n            var transformAttr = this.attr('transform') || '',\n                transform = parseTransformString(transformAttr);\n\n            // Is it a getter?\n            if (typeof sx === 'undefined') {\n                return transform.scale;\n            }\n            \n            transformAttr = transformAttr.replace(/scale\\([^\\)]*\\)/g, '').trim();\n\n            this.attr('transform', transformAttr + ' scale(' + sx + ',' + sy + ')');\n            return this;\n        },\n\n        // Get SVGRect that contains coordinates and dimension of the real bounding box,\n        // i.e. after transformations are applied.\n        // If `target` is specified, bounding box will be computed relatively to `target` element.\n        bbox: function(withoutTransformations, target) {\n\n            // If the element is not in the live DOM, it does not have a bounding box defined and\n            // so fall back to 'zero' dimension element.\n            if (!this.node.ownerSVGElement) return { x: 0, y: 0, width: 0, height: 0 };\n            \n            var box;\n            try {\n\n                box = this.node.getBBox();\n\n\t\t// Opera returns infinite values in some cases.\n\t\t// Note that Infinity | 0 produces 0 as opposed to Infinity || 0.\n\t\t// We also have to create new object as the standard says that you can't\n\t\t// modify the attributes of a bbox.\n\t\tbox = { x: box.x | 0, y: box.y | 0, width: box.width | 0, height: box.height | 0};\n\n            } catch (e) {\n\n                // Fallback for IE.\n                box = {\n                    x: this.node.clientLeft,\n                    y: this.node.clientTop,\n                    width: this.node.clientWidth,\n                    height: this.node.clientHeight\n                };\n            }\n\n            if (withoutTransformations) {\n\n                return box;\n            }\n\n            var matrix = this.node.getTransformToElement(target || this.node.ownerSVGElement);\n            var corners = [];\n            var point = this.node.ownerSVGElement.createSVGPoint();\n\n\n            point.x = box.x;\n            point.y = box.y;\n            corners.push(point.matrixTransform(matrix));\n            \n            point.x = box.x + box.width;\n            point.y = box.y;\n            corners.push(point.matrixTransform(matrix));\n            \n            point.x = box.x + box.width;\n            point.y = box.y + box.height;\n            corners.push(point.matrixTransform(matrix));\n            \n            point.x = box.x;\n            point.y = box.y + box.height;\n            corners.push(point.matrixTransform(matrix));\n\n            var minX = corners[0].x;\n            var maxX = minX;\n            var minY = corners[0].y;\n            var maxY = minY;\n            \n            for (var i = 1, len = corners.length; i < len; i++) {\n                \n                var x = corners[i].x;\n                var y = corners[i].y;\n\n                if (x < minX) {\n                    minX = x;\n                } else if (x > maxX) {\n                    maxX = x;\n                }\n                \n                if (y < minY) {\n                    minY = y;\n                } else if (y > maxY) {\n                    maxY = y;\n                }\n            }\n\n            return {\n                x: minX,\n                y: minY,\n                width: maxX - minX,\n                height: maxY - minY\n            };\n        },\n\n        text: function(content) {\n            var lines = content.split('\\n'), i = 0,\n                tspan;\n\n            // `alignment-baseline` does not work in Firefox.\n\t    // Setting `dominant-baseline` on the `<text>` element doesn't work in IE9.\n            // In order to have the 0,0 coordinate of the `<text>` element (or the first `<tspan>`)\n\t    // in the top left corner we translate the `<text>` element by `0.8em`.\n\t    // See `http://www.w3.org/Graphics/SVG/WG/wiki/How_to_determine_dominant_baseline`.\n\t    // See also `http://apike.ca/prog_svg_text_style.html`.\n\t    this.attr('y', '0.8em');\n            \n            if (lines.length === 1) {\n                this.node.textContent = content;\n                return this;\n            }\n            // Easy way to erase all `<tspan>` children;\n            this.node.textContent = '';\n            \n            for (; i < lines.length; i++) {\n\n                // Shift all the <tspan> but first by one line (`1em`)\n                tspan = V('tspan', { dy: (i == 0 ? '0em' : '1em'), x: this.attr('x') || 0});\n                tspan.node.textContent = lines[i];\n                \n                this.append(tspan);\n            }\n            return this;\n        },\n        \n        attr: function(name, value) {\n            \n            if (typeof name === 'string' && typeof value === 'undefined') {\n                return this.node.getAttribute(name);\n            }\n            \n            if (typeof name === 'object') {\n                \n                _.each(name, function(value, name) {\n\n                    setAttribute(this.node, name, value);\n                    \n                }, this);\n                \n            } else {\n\n                setAttribute(this.node, name, value);\n            }\n\n            return this;\n        },\n\n        remove: function() {\n            if (this.node.parentNode) {\n                this.node.parentNode.removeChild(this.node);\n            }\n        },\n\n        append: function(el) {\n\n            var els = el;\n            \n            if (!_.isArray(el)) {\n                \n                els = [el];\n            }\n\n            _.each(els, function(el) {\n\n                this.node.appendChild(el instanceof VElement ? el.node : el);\n                \n            }, this);\n            \n            return this;\n        },\n\n        prepend: function(el) {\n            this.node.insertBefore(el instanceof VElement ? el.node : el, this.node.firstChild);\n        },\n\n        svg: function() {\n\n            return this.node instanceof window.SVGSVGElement ? this : V(this.node.ownerSVGElement);\n        },\n\n        defs: function() {\n\n            var defs = this.svg().node.getElementsByTagName('defs');\n            \n            return (defs && defs.length) ? V(defs[0]) : undefined;\n        },\n\n        clone: function() {\n            var clone = V(this.node.cloneNode(true));\n            // Note that clone inherits also ID. Therefore, we need to change it here.\n            clone.node.id = _.uniqueId('v-');\n            return clone;\n        },\n\n        // Convert global point into the coordinate space of this element.\n        toLocalPoint: function(x, y) {\n\n            var svg = this.svg().node;\n            \n            var p = svg.createSVGPoint();\n            p.x = x;\n            p.y = y;\n\n\t    try {\n\n\t\tvar globalPoint = p.matrixTransform(svg.getScreenCTM().inverse());\n\t\tvar globalToLocalMatrix = this.node.getTransformToElement(svg).inverse();\n\n\t    } catch(e) {\n\t\t// IE9 throws an exception in odd cases. (`Unexpected call to method or property access`)\n\t\t// We have to make do with the original coordianates.\n\t\treturn p;\n\t    }\n\n            return globalPoint.matrixTransform(globalToLocalMatrix);\n        },\n\n        translateCenterToPoint: function(p) {\n\n            var bbox = this.bbox();\n            var center = g.rect(bbox).center();\n\n            this.translate(p.x - center.x, p.y - center.y);\n        },\n\n        // Efficiently auto-orient an element. This basically implements the orient=auto attribute\n        // of markers. The easiest way of understanding on what this does is to imagine the element is an\n        // arrowhead. Calling this method on the arrowhead makes it point to the `position` point while\n        // being auto-oriented (properly rotated) towards the `reference` point.\n        // `target` is the element relative to which the transformations are applied. Usually a viewport.\n        translateAndAutoOrient: function(position, reference, target) {\n\n            // Clean-up previously set transformations except the scale. If we didn't clean up the\n            // previous transformations then they'd add up with the old ones. Scale is an exception as\n            // it doesn't add up, consider: `this.scale(2).scale(2).scale(2)`. The result is that the\n            // element is scaled by the factor 2, not 8.\n\n            var s = this.scale();\n            this.attr('transform', '');\n            this.scale(s.sx, s.sy);\n\n            var svg = this.svg().node;\n            var bbox = this.bbox(false, target);\n\n            // 1. Translate to origin.\n            var translateToOrigin = svg.createSVGTransform();\n            translateToOrigin.setTranslate(-bbox.x - bbox.width/2, -bbox.y - bbox.height/2);\n\n            // 2. Rotate around origin.\n            var rotateAroundOrigin = svg.createSVGTransform();\n            var angle = g.point(position).changeInAngle(position.x - reference.x, position.y - reference.y, reference);\n            rotateAroundOrigin.setRotate(angle, 0, 0);\n\n            // 3. Translate to the `position` + the offset (half my width) towards the `reference` point.\n            var translateFinal = svg.createSVGTransform();\n            var finalPosition = g.point(position).move(reference, bbox.width/2);\n            translateFinal.setTranslate(position.x + (position.x - finalPosition.x), position.y + (position.y - finalPosition.y));\n\n            // 4. Apply transformations.\n            var ctm = this.node.getTransformToElement(target);\n            var transform = svg.createSVGTransform();\n            transform.setMatrix(\n                translateFinal.matrix.multiply(\n                    rotateAroundOrigin.matrix.multiply(\n                        translateToOrigin.matrix.multiply(\n                            ctm)))\n            );\n\n            // Instead of directly setting the `matrix()` transform on the element, first, decompose\n            // the matrix into separate transforms. This allows us to use normal Vectorizer methods\n            // as they don't work on matrices. An example of this is to retrieve a scale of an element.\n            // this.node.transform.baseVal.initialize(transform);\n\n            var decomposition = decomposeMatrix(transform.matrix);\n\n            this.translate(decomposition.translateX, decomposition.translateY);\n            this.rotate(decomposition.rotation);\n            // Note that scale has been already applied, hence the following line stays commented. (it's here just for reference).\n            //this.scale(decomposition.scaleX, decomposition.scaleY);\n\n            return this;\n        },\n\n        animateAlongPath: function(attrs, path) {\n\n            var animateMotion = V('animateMotion', attrs);\n            var mpath = V('mpath', { 'xlink:href': '#' + V(path).node.id });\n\n            animateMotion.append(mpath);\n\n            this.append(animateMotion);\n            try {\n                animateMotion.node.beginElement();\n            } catch (e) {\n                // Fallback for IE 9.\n\t\t// Run the animation programatically if FakeSmile (`http://leunen.me/fakesmile/`) present \n\t\tif (document.documentElement.getAttribute('smiling') === 'fake') {\n\n\t\t    // Register the animation. (See `https://answers.launchpad.net/smil/+question/203333`)\n\t\t    var animation = animateMotion.node;\n\t\t    animation.animators = new Array();\n\n\t\t    var animationID = animation.getAttribute('id');\n\t\t    if (animationID) id2anim[animationID] = animation;\n\n\t\t    _.each(getTargets(animation), function(target, index) {\n\t\t\tvar animator = new Animator(animation, target, index);\n\t\t\tanimators.push(animator);\n\t\t\tanimation.animators[index] = animator;\n\t\t    });\n\n\t\t    _.invoke(animation.animators, 'register');\n\t\t}\n            }\n        },\n\n        hasClass: function(className) {\n\n            return new RegExp('(\\\\s|^)' + className + '(\\\\s|$)').test(this.node.getAttribute('class'));\n        },\n\n        addClass: function(className) {\n\n            if (!this.hasClass(className)) {\n                this.node.setAttribute('class', this.node.getAttribute('class') + ' ' + className);\n            }\n        },\n\n        removeClass: function(className) {\n\n            var removedClass = this.node.getAttribute('class').replace(new RegExp('(\\\\s|^)' + className + '(\\\\s|$)', 'g'), '$2');\n\n            if (this.hasClass(className)) {\n                this.node.setAttribute('class', removedClass);\n            }\n        },\n\n        toggleClass: function(className, toAdd) {\n\n            var toRemove = typeof toAdd === 'undefined' ? this.hasClass(className) : !toAdd;\n\n            if (toRemove) {\n                this.removeClass(className);\n            } else {\n                this.addClass(className);\n            }\n        }\n    };\n\n    var V = createElement;\n\n    V.decomposeMatrix = decomposeMatrix;\n\n    var svgDocument = V('svg').node;\n    \n    V.createSVGMatrix = function(m) {\n        \n        return _.extend(svgDocument.createSVGMatrix(), m);\n    };\n\n    V.createSVGTransform = function() {\n\n        return svgDocument.createSVGTransform();\n    };\n\n    V.createSVGPoint = function(x, y) {\n\n        var p = svgDocument.createSVGPoint();\n        p.x = x;\n        p.y = y;\n        return p;\n    };\n\n    return V;\n\n}));\n\n\n//      Geometry library.\n//      (c) 2011-2013 client IO\n\n\n(function(root, factory) {\n\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define([], factory);\n        \n    } else {\n        // Browser globals.\n        root.g = factory();\n    }\n\n}(this, function() {\n\n\n    // Declare shorthands to the most used math functions.\n    var math = Math;\n    var abs = math.abs;\n    var cos = math.cos;\n    var sin = math.sin;\n    var sqrt = math.sqrt;\n    var mmin = math.min;\n    var mmax = math.max;\n    var atan = math.atan;\n    var atan2 = math.atan2;\n    var acos = math.acos;\n    var round = math.round;\n    var floor = math.floor;\n    var PI = math.PI;\n    var random = math.random;\n    var toDeg = function(rad) { return (180*rad / PI) % 360; };\n    var toRad = function(deg) { return (deg % 360) * PI / 180; };\n    var snapToGrid = function(val, gridSize) { return gridSize * Math.round(val/gridSize); };\n    var normalizeAngle = function(angle) { return (angle % 360) + (angle < 0 ? 360 : 0); };\n\n    // Point\n    // -----\n\n    // Point is the most basic object consisting of x/y coordinate,.\n\n    // Possible instantiations are:\n\n    // * `point(10, 20)`\n    // * `new point(10, 20)`\n    // * `point('10 20')`\n    // * `point(point(10, 20))`\n    function point(x, y) {\n        if (!(this instanceof point))\n            return new point(x, y);\n        var xy;\n        if (y === undefined && Object(x) !== x) {\n            xy = x.split(_.indexOf(x, \"@\") === -1 ? \" \" : \"@\");\n            this.x = parseInt(xy[0], 10);\n            this.y = parseInt(xy[1], 10);\n        } else if (Object(x) === x) {\n            this.x = x.x;\n            this.y = x.y;\n        } else {\n            this.x = x;\n            this.y = y;\n        }\n    }\n\n    point.prototype = {\n        toString: function() {\n            return this.x + \"@\" + this.y;\n        },\n        // If point lies outside rectangle `r`, return the nearest point on the boundary of rect `r`,\n        // otherwise return point itself.\n        // (see Squeak Smalltalk, Point>>adhereTo:)\n        adhereToRect: function(r) {\n\t    if (r.containsPoint(this)){\n\t        return this;\n\t    }\n\t    this.x = mmin(mmax(this.x, r.x), r.x + r.width);\n\t    this.y = mmin(mmax(this.y, r.y), r.y + r.height);\n\t    return this;\n        },\n        // Compute the angle between me and `p` and the x axis.\n        // (cartesian-to-polar coordinates conversion)\n        // Return theta angle in degrees.\n        theta: function(p) {\n            p = point(p);\n            // Invert the y-axis.\n\t    var y = -(p.y - this.y);\n\t    var x = p.x - this.x;\n            // Makes sure that the comparison with zero takes rounding errors into account.\n            var PRECISION = 10;\n            // Note that `atan2` is not defined for `x`, `y` both equal zero.\n\t    var rad = (y.toFixed(PRECISION) == 0 && x.toFixed(PRECISION) == 0) ? 0 : atan2(y, x); \n\n            // Correction for III. and IV. quadrant.\n\t    if (rad < 0) { \n\t        rad = 2*PI + rad;\n\t    }\n\t    return 180*rad / PI;\n        },\n        // Returns distance between me and point `p`.\n        distance: function(p) {\n\t    return line(this, p).length();\n        },\n        // Returns a manhattan (taxi-cab) distance between me and point `p`.\n        manhattanDistance: function(p) {\n            return abs(p.x - this.x) + abs(p.y - this.y);\n        },\n        // Offset me by the specified amount.\n        offset: function(dx, dy) {\n\t    this.x += dx || 0;\n\t    this.y += dy || 0;\n\t    return this;\n        },\n        magnitude: function() {\n            return sqrt((this.x*this.x) + (this.y*this.y)) || 0.01;\n        },\n        update: function(x, y) {\n            this.x = x || 0;\n            this.y = y || 0;\n            return this;\n        },\n        round: function(decimals) {\n            this.x = decimals ? this.x.toFixed(decimals) : round(this.x);\n            this.y = decimals ? this.y.toFixed(decimals) : round(this.y);\n            return this;\n        },\n        // Scale the line segment between (0,0) and me to have a length of len.\n        normalize: function(len) {\n\t    var s = (len || 1) / this.magnitude();\n\t    this.x = s * this.x;\n\t    this.y = s * this.y;\n\t    return this;\n        },\n        difference: function(p) {\n            return point(this.x - p.x, this.y - p.y);\n        },\n        // Converts rectangular to polar coordinates.\n        // An origin can be specified, otherwise it's 0@0.\n        toPolar: function(o) {\n            o = (o && point(o)) || point(0,0);\n            var x = this.x;\n            var y = this.y;\n            this.x = sqrt((x-o.x)*(x-o.x) + (y-o.y)*(y-o.y));   // r\n            this.y = toRad(o.theta(point(x,y)));\n            return this;\n        },\n        // Rotate point by angle around origin o.\n        rotate: function(o, angle) {\n            angle = (angle + 360) % 360;\n            this.toPolar(o);\n            this.y += toRad(angle);\n            var p = point.fromPolar(this.x, this.y, o);\n            this.x = p.x;\n            this.y = p.y;\n            return this;\n        },\n        // Move point on line starting from ref ending at me by\n        // distance distance.\n        move: function(ref, distance) {\n            var theta = toRad(point(ref).theta(this));\n            return this.offset(cos(theta) * distance, -sin(theta) * distance);\n        },\n        // Returns change in angle from my previous position (-dx, -dy) to my new position\n        // relative to ref point.\n        changeInAngle: function(dx, dy, ref) {\n            // Revert the translation and measure the change in angle around x-axis.\n            return point(this).offset(-dx, -dy).theta(ref) - this.theta(ref);\n        },\n        equals: function(p) {\n            return this.x === p.x && this.y === p.y;\n        }\n    };\n    // Alternative constructor, from polar coordinates.\n    // @param {number} r Distance.\n    // @param {number} angle Angle in radians.\n    // @param {point} [optional] o Origin.\n    point.fromPolar = function(r, angle, o) {\n        o = (o && point(o)) || point(0,0);\n        var x = abs(r * cos(angle));\n        var y = abs(r * sin(angle));\n        var deg = normalizeAngle(toDeg(angle));\n\n        if (deg < 90) y = -y;\n        else if (deg < 180) { x = -x; y = -y; }\n        else if (deg < 270) x = -x;\n        \n        return point(o.x + x, o.y + y);\n    };\n\n    // Create a point with random coordinates that fall into the range `[x1, x2]` and `[y1, y2]`.\n    point.random = function(x1, x2, y1, y2) {\n        return point(floor(random() * (x2 - x1 + 1) + x1), floor(random() * (y2 - y1 + 1) + y1));\n    };\n\n    // Line.\n    // -----\n    function line(p1, p2) {\n        if (!(this instanceof line))\n            return new line(p1, p2);\n            this.start = point(p1);\n        this.end = point(p2);\n    }\n    \n    line.prototype = {\n        toString: function() {\n\t    return this.start.toString() + ' ' + this.end.toString();\n        },\n        // @return {double} length of the line\n        length: function() {\n            return sqrt(this.squaredLength());\n        },\n        // @return {integer} length without sqrt\n        // @note for applications where the exact length is not necessary (e.g. compare only)\n        squaredLength: function() {\n\t    var x0 = this.start.x;\n            var y0 = this.start.y;\n\t    var x1 = this.end.x;\n            var y1 = this.end.y;\n\t    return (x0 -= x1)*x0 + (y0 -= y1)*y0;\n        },\n        // @return {point} my midpoint\n        midpoint: function() {\n\t    return point((this.start.x + this.end.x) / 2,\n\t\t         (this.start.y + this.end.y) / 2);\n        },\n        // @return {point} Point where I'm intersecting l.\n        // @see Squeak Smalltalk, LineSegment>>intersectionWith:\n        intersection: function(l) {\n\t    var pt1Dir = point(this.end.x - this.start.x, this.end.y - this.start.y);\n\t    var pt2Dir = point(l.end.x - l.start.x, l.end.y - l.start.y);\n\t    var det = (pt1Dir.x * pt2Dir.y) - (pt1Dir.y * pt2Dir.x);\n\t    var deltaPt = point(l.start.x - this.start.x, l.start.y - this.start.y);\n\t    var alpha = (deltaPt.x * pt2Dir.y) - (deltaPt.y * pt2Dir.x);\n\t    var beta = (deltaPt.x * pt1Dir.y) - (deltaPt.y * pt1Dir.x);\n\n\t    if (det === 0 ||\n\t        alpha * det < 0 ||\n\t        beta * det < 0) {\n                // No intersection found.\n\t        return null;\t\n\t    }\n\t    if (det > 0){\n\t        if (alpha > det || beta > det){\n\t\t    return null;\n\t        }\n\t    } else {\n\t        if (alpha < det || beta < det){\n\t\t    return null;\n\t        }\n\t    }\n\t    return point(this.start.x + (alpha * pt1Dir.x / det),\n\t\t         this.start.y + (alpha * pt1Dir.y / det));\n        }\n    };\n\n    // Rectangle.\n    // ----------\n    function rect(x, y, w, h) {\n        if (!(this instanceof rect))\n            return new rect(x, y, w, h);\n        if (y === undefined) {\n            y = x.y;\n            w = x.width;\n            h = x.height;\n            x = x.x;        \n        }\n        this.x = x;\n        this.y = y;\n        this.width = w;\n        this.height = h;\n    }\n    \n    rect.prototype = {\n        toString: function() {\n\t    return this.origin().toString() + ' ' + this.corner().toString();\n        },\n        origin: function() {\n            return point(this.x, this.y);\n        },\n        corner: function() {\n            return point(this.x + this.width, this.y + this.height);\n        },\n        topRight: function() {\n            return point(this.x + this.width, this.y);\n        },\n        bottomLeft: function() {\n            return point(this.x, this.y + this.height);\n        },\n        center: function() {\n            return point(this.x + this.width/2, this.y + this.height/2);\n        },\n        // @return {boolean} true if rectangles intersect\n        intersect: function(r) {\n\t    var myOrigin = this.origin();\n\t    var myCorner = this.corner();\n\t    var rOrigin = r.origin();\n\t    var rCorner = r.corner();\n            \n\t    if (rCorner.x <= myOrigin.x ||\n\t        rCorner.y <= myOrigin.y ||\n\t        rOrigin.x >= myCorner.x ||\n\t        rOrigin.y >= myCorner.y) return false;\n\t    return true;\n        },\n        // @return {string} (left|right|top|bottom) side which is nearest to point\n        // @see Squeak Smalltalk, Rectangle>>sideNearestTo:\n        sideNearestToPoint: function(p) {\n            p = point(p);\n\t    var distToLeft = p.x - this.x;\n\t    var distToRight = (this.x + this.width) - p.x;\n\t    var distToTop = p.y - this.y;\n\t    var distToBottom = (this.y + this.height) - p.y;\n\t    var closest = distToLeft;\n\t    var side = 'left';\n            \n\t    if (distToRight < closest) {\n\t        closest = distToRight;\n\t        side = 'right';\n\t    }\n\t    if (distToTop < closest) {\n\t        closest = distToTop;\n\t        side = 'top';\n\t    }\n\t    if (distToBottom < closest) {\n\t        closest = distToBottom;\n\t        side = 'bottom';\n\t    }\n\t    return side;\n        },\n        // @return {bool} true if point p is insight me\n        containsPoint: function(p) {\n            p = point(p);\n\t    if (p.x >= this.x && p.x <= this.x + this.width &&\n\t        p.y >= this.y && p.y <= this.y + this.height) {\n\t        return true;\n\t    }\n\t    return false;\n        },\n        // @return {point} a point on my boundary nearest to p\n        // @see Squeak Smalltalk, Rectangle>>pointNearestTo:\n        pointNearestToPoint: function(p) {\n            p = point(p);\n\t    if (this.containsPoint(p)) {\n\t        var side = this.sideNearestToPoint(p);\n\t        switch (side){\n\t          case \"right\": return point(this.x + this.width, p.y);\n\t          case \"left\": return point(this.x, p.y);\n\t          case \"bottom\": return point(p.x, this.y + this.height);\n\t          case \"top\": return point(p.x, this.y);\n\t        }\n\t    }\n\t    return p.adhereToRect(this);\n        },\n        // Find point on my boundary where line starting\n        // from my center ending in point p intersects me.\n        // @param {number} angle If angle is specified, intersection with rotated rectangle is computed.\n        intersectionWithLineFromCenterToPoint: function(p, angle) {\n            p = point(p);\n\t    var center = point(this.x + this.width/2, this.y + this.height/2);\n            var result;\n            if (angle) p.rotate(center, angle);\n            \n\t    // (clockwise, starting from the top side)\n\t    var sides = [\n\t        line(this.origin(), this.topRight()),\n\t        line(this.topRight(), this.corner()),\n\t        line(this.corner(), this.bottomLeft()),\n\t        line(this.bottomLeft(), this.origin())\n\t    ];\n\t    var connector = line(center, p);\n            \n\t    for (var i = sides.length - 1; i >= 0; --i){\n\t        var intersection = sides[i].intersection(connector);\n\t        if (intersection !== null){\n\t\t    result = intersection;\n                    break;\n\t        }\n\t    }\n            if (result && angle) result.rotate(center, -angle);\n            return result;\n        },\n        // Move and expand me.\n        // @param r {rectangle} representing deltas\n        moveAndExpand: function(r) {\n\t    this.x += r.x;\n\t    this.y += r.y;\n\t    this.width += r.width;\n\t    this.height += r.height;\n\t    return this;\n        },\n        round: function(decimals) {\n            this.x = decimals ? this.x.toFixed(decimals) : round(this.x);\n            this.y = decimals ? this.y.toFixed(decimals) : round(this.y);\n            this.width = decimals ? this.width.toFixed(decimals) : round(this.width);\n            this.height = decimals ? this.height.toFixed(decimals) : round(this.height);\n            return this;\n        }\n    };\n\n    // Ellipse.\n    // --------\n    function ellipse(c, a, b) {\n        if (!(this instanceof ellipse))\n            return new ellipse(c, a, b);\n        c = point(c);\n        this.x = c.x;\n        this.y = c.y;\n        this.a = a;\n        this.b = b;\n    }\n\n    ellipse.prototype = {\n        toString: function() {\n            return point(this.x, this.y).toString() + ' ' + this.a + ' ' + this.b;\n        },\n        bbox: function() {\n\t        return rect(this.x - this.a, this.y - this.b, 2*this.a, 2*this.b);\n        },\n        // Find point on me where line from my center to\n        // point p intersects my boundary.\n        // @param {number} angle If angle is specified, intersection with rotated ellipse is computed.\n        intersectionWithLineFromCenterToPoint: function(p, angle) {\n\t    p = point(p);\n            if (angle) p.rotate(point(this.x, this.y), angle);\n            var dx = p.x - this.x;\n\t    var dy = p.y - this.y;\n            var result;\n\t    if (dx === 0) {\n\t        result = this.bbox().pointNearestToPoint(p);\n                if (angle) return result.rotate(point(this.x, this.y), -angle);\n                return result;\n\t    }\n\t    var m = dy / dx;\n\t    var mSquared = m * m;\n\t    var aSquared = this.a * this.a;\n\t    var bSquared = this.b * this.b;\n\t    var x = sqrt(1 / ((1 / aSquared) + (mSquared / bSquared)));\n\n            x = dx < 0 ? -x : x;\n\t    var y = m * x;\n\t    result = point(this.x + x, this.y + y);\n            if (angle) return result.rotate(point(this.x, this.y), -angle);\n            return result;\n        }\n    };\n\n    // Bezier curve.\n    // -------------\n    var bezier = {\n        // Cubic Bezier curve path through points.\n        // Ported from C# implementation by Oleg V. Polikarpotchkin and Peter Lee (http://www.codeproject.com/KB/graphics/BezierSpline.aspx).\n        // @param {array} points Array of points through which the smooth line will go.\n        // @return {array} SVG Path commands as an array\n        curveThroughPoints: function(points) {\n            var controlPoints = this.getCurveControlPoints(points);\n            var path = ['M', points[0].x, points[0].y];\n\n            for (var i = 0; i < controlPoints[0].length; i++) {\n                path.push('C', controlPoints[0][i].x, controlPoints[0][i].y, controlPoints[1][i].x, controlPoints[1][i].y, points[i+1].x, points[i+1].y);        \n            }\n            return path;\n        },\n        \n        // Get open-ended Bezier Spline Control Points.\n        // @param knots Input Knot Bezier spline points (At least two points!).\n        // @param firstControlPoints Output First Control points. Array of knots.length - 1 length.\n        //  @param secondControlPoints Output Second Control points. Array of knots.length - 1 length.\n        getCurveControlPoints: function(knots) {\n            var firstControlPoints = [];\n            var secondControlPoints = [];\n            var n = knots.length - 1;\n            var i;\n\n            // Special case: Bezier curve should be a straight line.\n            if (n == 1) { \n\t        // 3P1 = 2P0 + P3\n\t        firstControlPoints[0] = point((2 * knots[0].x + knots[1].x) / 3,\n\t                                      (2 * knots[0].y + knots[1].y) / 3);\n\t        // P2 = 2P1 â€“ P0\n\t        secondControlPoints[0] = point(2 * firstControlPoints[0].x - knots[0].x,\n\t                                       2 * firstControlPoints[0].y - knots[0].y);\n\t        return [firstControlPoints, secondControlPoints];\n            }\n            \n                // Calculate first Bezier control points.\n            // Right hand side vector.\n            var rhs = [];\n            \n            // Set right hand side X values.\n            for (i = 1; i < n - 1; i++) {\n                rhs[i] = 4 * knots[i].x + 2 * knots[i + 1].x;\n            }\n            rhs[0] = knots[0].x + 2 * knots[1].x;\n            rhs[n - 1] = (8 * knots[n - 1].x + knots[n].x) / 2.0;\n            // Get first control points X-values.\n            var x = this.getFirstControlPoints(rhs);\n            \n            // Set right hand side Y values.\n            for (i = 1; i < n - 1; ++i) {\n\t        rhs[i] = 4 * knots[i].y + 2 * knots[i + 1].y;\n            }\n            rhs[0] = knots[0].y + 2 * knots[1].y;\n            rhs[n - 1] = (8 * knots[n - 1].y + knots[n].y) / 2.0;\n            // Get first control points Y-values.\n            var y = this.getFirstControlPoints(rhs);\n            \n            // Fill output arrays.\n            for (i = 0; i < n; i++) {\n\t        // First control point.\n\t        firstControlPoints.push(point(x[i], y[i]));\n\t        // Second control point.\n\t        if (i < n - 1) {\n\t            secondControlPoints.push(point(2 * knots [i + 1].x - x[i + 1],\n                                                   2 * knots[i + 1].y - y[i + 1]));\n\t        } else {\n\t            secondControlPoints.push(point((knots[n].x + x[n - 1]) / 2,\n\t\t\t\t\t           (knots[n].y + y[n - 1]) / 2));\n\t        }\n            }\n            return [firstControlPoints, secondControlPoints];\n        },\n\n        // Solves a tridiagonal system for one of coordinates (x or y) of first Bezier control points.\n        // @param rhs Right hand side vector.\n        // @return Solution vector.\n        getFirstControlPoints: function(rhs) {\n            var n = rhs.length;\n            // `x` is a solution vector.\n            var x = [];\n            var tmp = [];\n            var b = 2.0;\n            \n            x[0] = rhs[0] / b;\n            // Decomposition and forward substitution.\n            for (var i = 1; i < n; i++) { \n\t        tmp[i] = 1 / b;\n\t        b = (i < n - 1 ? 4.0 : 3.5) - tmp[i];\n\t        x[i] = (rhs[i] - x[i - 1]) / b;\n            }\n            for (i = 1; i < n; i++) {\n                // Backsubstitution.\n\t        x[n - i - 1] -= tmp[n - i] * x[n - i]; \n            }\n            return x;\n        }\n    };\n\n    return {\n\n        toDeg: toDeg,\n        toRad: toRad,\n        snapToGrid: snapToGrid,\n\tnormalizeAngle: normalizeAngle,\n        point: point,\n        line: line,\n        rect: rect,\n        ellipse: ellipse,\n        bezier: bezier\n    }\n}));\n\n//      JointJS, the JavaScript diagramming library.\n//      (c) 2011-2013 client IO\n\n\nif (typeof exports === 'object') {\n\n    var joint = {\n        dia: {\n            Link: require('./joint.dia.link').Link,\n            Element: require('./joint.dia.element').Element\n        },\n        shapes: require('../plugins/shapes')\n    };\n    var Backbone = require('backbone');\n    var _ = require('lodash');\n    var g = require('./geometry').g;\n}\n\n\n\njoint.dia.GraphCells = Backbone.Collection.extend({\n\n    initialize: function() {\n        \n        // Backbone automatically doesn't trigger re-sort if models attributes are changed later when\n        // they're already in the collection. Therefore, we're triggering sort manually here.\n        this.on('change:z', this.sort, this);\n    },\n\n    model: function(attrs, options) {\n\n        if (attrs.type === 'link') {\n\n            return new joint.dia.Link(attrs, options);\n        }\n\n        var module = attrs.type.split('.')[0];\n        var entity = attrs.type.split('.')[1];\n\n        if (joint.shapes[module] && joint.shapes[module][entity]) {\n\n            return new joint.shapes[module][entity](attrs, options);\n        }\n        \n        return new joint.dia.Element(attrs, options);\n    },\n\n    // `comparator` makes it easy to sort cells based on their `z` index.\n    comparator: function(model) {\n\n        return model.get('z') || 0;\n    },\n\n    // Get all inbound and outbound links connected to the cell `model`.\n    getConnectedLinks: function(model, opt) {\n\n        opt = opt || {};\n\n        if (_.isUndefined(opt.inbound) && _.isUndefined(opt.outbound)) {\n            opt.inbound = opt.outbound = true;\n        }\n\n        var links = [];\n        \n        this.each(function(cell) {\n\n            var source = cell.get('source');\n            var target = cell.get('target');\n\n            if (source && source.id === model.id && opt.outbound) {\n                \n                links.push(cell);\n            }\n\n            if (target && target.id === model.id && opt.inbound) {\n\n                links.push(cell);\n            }\n        });\n\n        return links;\n    }\n});\n\n\njoint.dia.Graph = Backbone.Model.extend({\n\n    initialize: function() {\n\n        this.set('cells', new joint.dia.GraphCells);\n\n        // Make all the events fired in the `cells` collection available.\n        // to the outside world.\n        this.get('cells').on('all', this.trigger, this);\n        \n        this.get('cells').on('remove', this.removeCell, this);\n    },\n\n    toJSON: function() {\n\n        // Backbone does not recursively call `toJSON()` on attributes that are themselves models/collections.\n        // It just clones the attributes. Therefore, we must call `toJSON()` on the cells collection explicitely.\n        var json = Backbone.Model.prototype.toJSON.apply(this, arguments);\n        json.cells = this.get('cells').toJSON();\n        return json;\n    },\n\n    fromJSON: function(json) {\n\n        if (!json.cells) {\n\n            throw new Error('Graph JSON must contain cells array.');\n        }\n\n        var attrs = json;\n\n        // Cells are the only attribute that is being set differently, using `cells.add()`.\n        var cells = json.cells;\n        delete attrs.cells;\n        \n        this.set(attrs);\n        \n        this.resetCells(cells);\n    },\n\n    clear: function() {\n\n        this.get('cells').remove(this.get('cells').models);\n    },\n\n    _prepareCell: function(cell) {\n\n        if (cell instanceof Backbone.Model && _.isUndefined(cell.get('z'))) {\n\n            cell.set('z', this.get('cells').length, { silent: true });\n            \n        } else if (_.isUndefined(cell.z)) {\n\n            cell.z = this.get('cells').length;\n        }\n\n        return cell;\n    },\n    \n    addCell: function(cell, options) {\n\n        if (_.isArray(cell)) {\n\n            return this.addCells(cell, options);\n        }\n\n        this.get('cells').add(this._prepareCell(cell), options || {});\n\n        return this;\n    },\n\n    addCells: function(cells, options) {\n\n        _.each(cells, function(cell) { this.addCell(cell, options); }, this);\n\n        return this;\n    },\n\n    // When adding a lot of cells, it is much more efficient to\n    // reset the entire cells collection in one go.\n    // Useful for bulk operations and optimizations.\n    resetCells: function(cells) {\n        \n        this.get('cells').reset(_.map(cells, this._prepareCell, this));\n\n        return this;\n    },\n\n    removeCell: function(cell, collection, options) {\n\n        // Applications might provide a `disconnectLinks` option set to `true` in order to\n        // disconnect links when a cell is removed rather then removing them. The default\n        // is to remove all the associated links.\n        if (options && options.disconnectLinks) {\n            \n            this.disconnectLinks(cell);\n\n        } else {\n\n            this.removeLinks(cell);\n        }\n\n        // Silently remove the cell from the cells collection. Silently, because\n        // `joint.dia.Cell.prototype.remove` already triggers the `remove` event which is\n        // then propagated to the graph model. If we didn't remove the cell silently, two `remove` events\n        // would be triggered on the graph model.\n        this.get('cells').remove(cell, { silent: true });\n    },\n\n    // Get a cell by `id`.\n    getCell: function(id) {\n\n        return this.get('cells').get(id);\n    },\n\n    getElements: function() {\n\n        return this.get('cells').filter(function(cell) {\n\n            return cell instanceof joint.dia.Element;\n        });\n    },\n    \n    getLinks: function() {\n\n        return this.get('cells').filter(function(cell) {\n\n            return cell instanceof joint.dia.Link;\n        });\n    },\n\n    // Get all inbound and outbound links connected to the cell `model`.\n    getConnectedLinks: function(model, opt) {\n\n        return this.get('cells').getConnectedLinks(model, opt);\n    },\n\n    getNeighbors: function(el) {\n\n        var links = this.getConnectedLinks(el);\n        var neighbors = [];\n        var cells = this.get('cells');\n        \n        _.each(links, function(link) {\n\n            var source = link.get('source');\n            var target = link.get('target');\n\n            // Discard if it is a point.\n            if (!source.x) {\n                var sourceElement = cells.get(source.id);\n                if (sourceElement !== el) {\n\n                    neighbors.push(sourceElement);\n                }\n            }\n            if (!target.x) {\n                var targetElement = cells.get(target.id);\n                if (targetElement !== el) {\n\n                    neighbors.push(targetElement);\n                }\n            }\n        });\n\n        return neighbors;\n    },\n    \n    // Disconnect links connected to the cell `model`.\n    disconnectLinks: function(model) {\n\n        _.each(this.getConnectedLinks(model), function(link) {\n\n            link.set(link.get('source').id === model.id ? 'source' : 'target', g.point(0, 0));\n        });\n    },\n\n    // Remove links connected to the cell `model` completely.\n    removeLinks: function(model) {\n\n        _.invoke(this.getConnectedLinks(model), 'remove');\n    },\n\n    // Find all views at given point\n    findModelsFromPoint: function(p) {\n\n\treturn _.filter(this.getElements(), function(el) {\n\t    return el.getBBox().containsPoint(p);\n\t});\n    },\n\n\n    // Find all views in given area\n    findModelsInArea: function(r) {\n\n\treturn _.filter(this.getElements(), function(el) {\n\t    return el.getBBox().intersect(r);\n\t});\n    }\n\n});\n\n\nif (typeof exports === 'object') {\n\n    module.exports.Graph = joint.dia.Graph;\n}\n//      JointJS.\n//      (c) 2011-2013 client IO\n\n\nif (typeof exports === 'object') {\n\n    var joint = {\n        util: require('./core').util,\n        dia: {\n            Link: require('./joint.dia.link').Link\n        }\n    };\n    var Backbone = require('backbone');\n    var _ = require('lodash');\n}\n\n\n// joint.dia.Cell base model.\n// --------------------------\n\njoint.dia.Cell = Backbone.Model.extend({\n\n    // This is the same as Backbone.Model with the only difference that is uses _.merge\n    // instead of just _.extend. The reason is that we want to mixin attributes set in upper classes.\n    constructor: function(attributes, options) {\n\n        var defaults;\n        var attrs = attributes || {};\n        this.cid = _.uniqueId('c');\n        this.attributes = {};\n        if (options && options.collection) this.collection = options.collection;\n        if (options && options.parse) attrs = this.parse(attrs, options) || {};\n        if (defaults = _.result(this, 'defaults')) {\n            //<custom code>\n            // Replaced the call to _.defaults with _.merge.\n            attrs = _.merge({}, defaults, attrs);\n            //</custom code>\n        }\n        this.set(attrs, options);\n        this.changed = {};\n        this.initialize.apply(this, arguments);\n    },\n\n    toJSON: function() {\n\n        var defaultAttrs = this.constructor.prototype.defaults.attrs || {};\n        var attrs = this.attributes.attrs;\n        var finalAttrs = {};\n\n        // Loop through all the attributes and\n        // omit the default attributes as they are implicitly reconstructable by the cell 'type'.\n        _.each(attrs, function(attr, selector) {\n\n            var defaultAttr = defaultAttrs[selector];\n\n            _.each(attr, function(value, name) {\n                \n                // attr is mainly flat though it might have one more level (consider the `style` attribute).\n                // Check if the `value` is object and if yes, go one level deep.\n                if (_.isObject(value) && !_.isArray(value)) {\n                    \n                    _.each(value, function(value2, name2) {\n\n                        if (!defaultAttr || !defaultAttr[name] || !_.isEqual(defaultAttr[name][name2], value2)) {\n\n                            finalAttrs[selector] = finalAttrs[selector] || {};\n                            (finalAttrs[selector][name] || (finalAttrs[selector][name] = {}))[name2] = value2;\n                        }\n                    });\n\n                } else if (!defaultAttr || !_.isEqual(defaultAttr[name], value)) {\n                    // `value` is not an object, default attribute for such a selector does not exist\n                    // or it is different than the attribute value set on the model.\n\n                    finalAttrs[selector] = finalAttrs[selector] || {};\n                    finalAttrs[selector][name] = value;\n                }\n            });\n        });\n\n        var attributes = _.cloneDeep(_.omit(this.attributes, 'attrs'));\n        //var attributes = JSON.parse(JSON.stringify(_.omit(this.attributes, 'attrs')));\n        attributes.attrs = finalAttrs;\n\n        return attributes;\n    },\n\n    initialize: function(options) {\n\n        if (!options || !options.id) {\n\n            this.set('id', joint.util.uuid(), { silent: true });\n        }\n\n\tthis._transitionIds = {};\n\n        // Collect ports defined in `attrs` and keep collecting whenever `attrs` object changes.\n        this.processPorts();\n        this.on('change:attrs', this.processPorts, this);\n    },\n\n    processPorts: function() {\n\n        // Whenever `attrs` changes, we extract ports from the `attrs` object and store it\n        // in a more accessible way. Also, if any port got removed and there were links that had `target`/`source`\n        // set to that port, we remove those links as well (to follow the same behaviour as\n        // with a removed element).\n\n        var previousPorts = this.ports;\n\n        // Collect ports from the `attrs` object.\n        var ports = {};\n        _.each(this.get('attrs'), function(attrs, selector) {\n\n            if (attrs.port) {\n\n                // `port` can either be directly an `id` or an object containing an `id` (and potentially other data).\n                if (!_.isUndefined(attrs.port.id)) {\n                    ports[attrs.port.id] = attrs.port;\n                } else {\n                    ports[attrs.port] = { id: attrs.port };\n                }\n            }\n        });\n\n        // Collect ports that have been removed (compared to the previous ports) - if any.\n        // Use hash table for quick lookup.\n        var removedPorts = {};\n        _.each(previousPorts, function(port, id) {\n\n            if (!ports[id]) removedPorts[id] = true;\n        });\n\n        // Remove all the incoming/outgoing links that have source/target port set to any of the removed ports.\n        if (this.collection && !_.isEmpty(removedPorts)) {\n            \n            var inboundLinks = this.collection.getConnectedLinks(this, { inbound: true });\n            _.each(inboundLinks, function(link) {\n\n                if (removedPorts[link.get('target').port]) link.remove();\n            });\n\n            var outboundLinks = this.collection.getConnectedLinks(this, { outbound: true });\n            _.each(outboundLinks, function(link) {\n\n                if (removedPorts[link.get('source').port]) link.remove();\n            });\n        }\n\n        // Update the `ports` object.\n        this.ports = ports;\n    },\n\n    remove: function(options) {\n\n\tvar collection = this.collection;\n\n\tif (collection) {\n\t    collection.trigger('batch:start');\n\t}\n\n        // First, unembed this cell from its parent cell if there is one.\n        var parentCellId = this.get('parent');\n        if (parentCellId) {\n            \n            var parentCell = this.collection && this.collection.get(parentCellId);\n            parentCell.unembed(this);\n        }\n        \n        _.invoke(this.getEmbeddedCells(), 'remove', options);\n        \n        this.trigger('remove', this, this.collection, options);\n\n\tif (collection) {\n\t    collection.trigger('batch:stop');\n\t}\n    },\n\n    toFront: function() {\n\n        if (this.collection) {\n\n            this.set('z', (this.collection.last().get('z') || 0) + 1);\n        }\n    },\n    \n    toBack: function() {\n\n        if (this.collection) {\n            \n            this.set('z', (this.collection.first().get('z') || 0) - 1);\n        }\n    },\n\n    embed: function(cell) {\n\n\tif (this.get('parent') == cell.id) {\n\n\t    throw new Error('Recursive embedding not allowed.');\n\n\t} else {\n\n\t    this.trigger('batch:start');\n\n\t    cell.set('parent', this.id);\n\t    this.set('embeds', _.uniq((this.get('embeds') || []).concat([cell.id])));\n\n\t    this.trigger('batch:stop');\n\t}\n    },\n\n    unembed: function(cell) {\n\n\tthis.trigger('batch:start');\n\n        var cellId = cell.id;\n        cell.unset('parent');\n\n        this.set('embeds', _.without(this.get('embeds'), cellId));\n\n\tthis.trigger('batch:stop');\n    },\n\n    getEmbeddedCells: function() {\n\n        // Cell models can only be retrieved when this element is part of a collection.\n        // There is no way this element knows about other cells otherwise.\n        // This also means that calling e.g. `translate()` on an element with embeds before\n        // adding it to a graph does not translate its embeds.\n        if (this.collection) {\n\n            return _.map(this.get('embeds') || [], function(cellId) {\n\n                return this.collection.get(cellId);\n                \n            }, this);\n        }\n        return [];\n    },\n\n    clone: function(opt) {\n\n        opt = opt || {};\n\n        var clone = Backbone.Model.prototype.clone.apply(this, arguments);\n        \n        // We don't want the clone to have the same ID as the original.\n        clone.set('id', joint.util.uuid(), { silent: true });\n        clone.set('embeds', '');\n\n        if (!opt.deep) return clone;\n\n        // The rest of the `clone()` method deals with embeds. If `deep` option is set to `true`,\n        // the return value is an array of all the embedded clones created.\n\n        var embeds = this.getEmbeddedCells();\n\n        var clones = [clone];\n\n        // This mapping stores cloned links under the `id`s of they originals.\n        // This prevents cloning a link more then once. Consider a link 'self loop' for example.\n        var linkCloneMapping = {};\n        \n        _.each(embeds, function(embed) {\n\n            var embedClones = embed.clone({ deep: true });\n\n            // Embed the first clone returned from `clone({ deep: true })` above. The first\n            // cell is always the clone of the cell that called the `clone()` method, i.e. clone of `embed` in this case.\n            clone.embed(embedClones[0]);\n\n            _.each(embedClones, function(embedClone) {\n\n                clones.push(embedClone);\n\n                // Skip links. Inbound/outbound links are not relevant for them.\n                if (embedClone instanceof joint.dia.Link) {\n\n                    return;\n                }\n\n                // Collect all inbound links, clone them (if not done already) and set their target to the `embedClone.id`.\n                var inboundLinks = this.collection.getConnectedLinks(embed, { inbound: true });\n\n                _.each(inboundLinks, function(link) {\n\n                    var linkClone = linkCloneMapping[link.id] || link.clone();\n\n                    // Make sure we don't clone a link more then once.\n                    linkCloneMapping[link.id] = linkClone;\n\n                    var target = _.clone(linkClone.get('target'));\n                    target.id = embedClone.id;\n                    linkClone.set('target', target);\n                });\n\n                // Collect all inbound links, clone them (if not done already) and set their source to the `embedClone.id`.\n                var outboundLinks = this.collection.getConnectedLinks(embed, { outbound: true });\n\n                _.each(outboundLinks, function(link) {\n\n                    var linkClone = linkCloneMapping[link.id] || link.clone();\n\n                    // Make sure we don't clone a link more then once.\n                    linkCloneMapping[link.id] = linkClone;\n\n                    var source = _.clone(linkClone.get('source'));\n                    source.id = embedClone.id;\n                    linkClone.set('source', source);\n                });\n\n            }, this);\n            \n        }, this);\n\n        // Add link clones to the array of all the new clones.\n        clones = clones.concat(_.values(linkCloneMapping));\n\n        return clones;\n    },\n\n    // A convenient way to set nested attributes.\n    attr: function(attrs, value, opt) {\n\n        var currentAttrs = this.get('attrs');\n        var delim = '/';\n        \n        if (_.isString(attrs)) {\n            // Get/set an attribute by a special path syntax that delimits\n            // nested objects by the colon character.\n\n            if (value) {\n\n                var attr = {};\n                joint.util.setByPath(attr, attrs, value, delim);\n                return this.set('attrs', _.merge({}, currentAttrs, attr), opt);\n                \n            } else {\n                \n                return joint.util.getByPath(currentAttrs, attrs, delim);\n            }\n        }\n        \n        return this.set('attrs', _.merge({}, currentAttrs, attrs), value);\n    },\n\n    transition: function(path, value, opt, delim) {\n\n\tdelim = delim || '/';\n\n\tvar defaults = {\n\t    duration: 100,\n\t    delay: 10,\n\t    timingFunction: joint.util.timing.linear,\n\t    valueFunction: joint.util.interpolate.number\n\t};\n\n\topt = _.extend(defaults, opt);\n\n\tvar pathArray = path.split(delim);\n        var property = pathArray[0];\n\tvar isPropertyNested = pathArray.length > 1;\n\tvar firstFrameTime = 0;\n\tvar interpolatingFunction;\n\n\tvar setter = _.bind(function(runtime) {\n\n\t    var id, progress, propertyValue, status;\n\n\t    firstFrameTime = firstFrameTime || runtime;\n\t    runtime -= firstFrameTime;\n\t    progress = runtime / opt.duration;\n\n\t    if (progress < 1) {\n\t\tthis._transitionIds[path] = id = joint.util.nextFrame(setter);\n\t    } else {\n\t\tprogress = 1;\n\t\tdelete this._transitionIds[path];\n\t    }\n\n\t    propertyValue = interpolatingFunction(opt.timingFunction(progress));\n\n\t    if (isPropertyNested) {\n\t\tvar nestedPropertyValue = joint.util.setByPath({}, path, propertyValue, delim)[property];\n\t\tpropertyValue = _.merge({}, this.get(property), nestedPropertyValue);\n\t    }\n\n\t    opt.transitionId = id;\n\n\t    this.set(property, propertyValue, opt);\n\n\t    if (!id) this.trigger('transition:end', this, path);\n\n\t}, this);\n\n\tvar initiator =_.bind(function(callback) {\n\n\t    this.stopTransitions(path);\n\n\t    interpolatingFunction = opt.valueFunction(joint.util.getByPath(this.attributes, path, delim), value);\n\n\t    this._transitionIds[path] = joint.util.nextFrame(callback);\n\n\t    this.trigger('transition:start', this, path);\n\n\t}, this);\n\n\treturn _.delay(initiator, opt.delay, setter);\n    },\n\n    getTransitions: function() {\n\treturn _.keys(this._transitionIds);\n    },\n\n    stopTransitions: function(path, delim) {\n\n\tdelim = delim || '/';\n\n\tvar pathArray = path && path.split(delim);\n\n\t_(this._transitionIds).keys().filter(pathArray && function(key) {\n\n\t    return _.isEqual(pathArray, key.split(delim).slice(0, pathArray.length));\n\n\t}).each(function(key) {\n\n\t    joint.util.cancelFrame(this._transitionIds[key]);\n\n\t    delete this._transitionIds[key];\n\n\t    this.trigger('transition:end', this, key);\n\n\t}, this);\n    }\n});\n\n// joint.dia.CellView base view and controller.\n// --------------------------------------------\n\n// This is the base view and controller for `joint.dia.ElementView` and `joint.dia.LinkView`.\n\njoint.dia.CellView = Backbone.View.extend({\n\n    tagName: 'g',\n\n    attributes: function() {\n\n        return { 'model-id': this.model.id }\n    },\n\n    initialize: function() {\n\n        _.bindAll(this, 'remove', 'update');\n\n        // Store reference to this to the <g> DOM element so that the view is accessible through the DOM tree.\n        this.$el.data('view', this);\n\n\tthis.listenTo(this.model, 'remove', this.remove);\n\tthis.listenTo(this.model, 'change:attrs', this.update);\n    },\n\n    _configure: function(options) {\n\n        // Make sure a global unique id is assigned to this view. Store this id also to the properties object.\n        // The global unique id makes sure that the same view can be rendered on e.g. different machines and\n        // still be associated to the same object among all those clients. This is necessary for real-time\n        // collaboration mechanism.\n        options.id = options.id || joint.util.guid(this);\n        \n        Backbone.View.prototype._configure.apply(this, arguments);\n    },\n\n    // Override the Backbone `_ensureElement()` method in order to create a `<g>` node that wraps\n    // all the nodes of the Cell view.\n    _ensureElement: function() {\n\n        var el;\n\n        if (!this.el) {\n\n            var attrs = _.extend({ id: this.id }, _.result(this, 'attributes'));\n            if (this.className) attrs['class'] = _.result(this, 'className');\n            el = V(_.result(this, 'tagName'), attrs).node;\n\n        } else {\n\n            el = _.result(this, 'el')\n        }\n\n        this.setElement(el, false);\n    },\n    \n    findBySelector: function(selector) {\n\n        // These are either descendants of `this.$el` of `this.$el` itself. \n       // `.` is a special selector used to select the wrapping `<g>` element.\n        var $selected = selector === '.' ? this.$el : this.$el.find(selector);\n        return $selected;\n    },\n\n    notify: function(evt) {\n\n        if (this.paper) {\n\n            var args = Array.prototype.slice.call(arguments, 1);\n\n            // Trigger the event on both the element itself and also on the paper.\n            this.trigger.apply(this, [evt].concat(args));\n            \n            // Paper event handlers receive the view object as the first argument.\n            this.paper.trigger.apply(this.paper, [evt, this].concat(args));\n        }\n    },\n\n    getStrokeBBox: function(el) {\n        // Return a bounding box rectangle that takes into account stroke.\n        // Note that this is a naive and ad-hoc implementation that does not\n        // works only in certain cases and should be replaced as soon as browsers will\n        // start supporting the getStrokeBBox() SVG method.\n        // @TODO any better solution is very welcome!\n\n        var isMagnet = !!el;\n        \n        el = el || this.el;\n        var bbox = V(el).bbox(false, this.paper.viewport);\n\n        var strokeWidth;\n        if (isMagnet) {\n\n            strokeWidth = V(el).attr('stroke-width');\n            \n        } else {\n\n            strokeWidth = this.model.attr('rect/stroke-width') || this.model.attr('circle/stroke-width') || this.model.attr('ellipse/stroke-width') || this.model.attr('path/stroke-width');\n        }\n\n        strokeWidth = parseFloat(strokeWidth) || 0;\n\n        return g.rect(bbox).moveAndExpand({ x: -strokeWidth/2, y: -strokeWidth/2, width: strokeWidth, height: strokeWidth });\n    },\n    \n    getBBox: function() {\n\n        return V(this.el).bbox();\n    },\n\n    highlight: function(el) {\n\n        el = !el ? this.el : this.$(el)[0] || this.el;\n\n        V(el).addClass('highlighted');\n    },\n\n    unhighlight: function(el) {\n\n        el = !el ? this.el : this.$(el)[0] || this.el;\n\n        V(el).removeClass('highlighted');\n    },\n\n    // Find the closest element that has the `magnet` attribute set to `true`. If there was not such\n    // an element found, return the root element of the cell view.\n    findMagnet: function(el) {\n\n        var $el = this.$(el);\n\n        if ($el.length === 0 || $el[0] === this.el) {\n\n            // If the overall cell has set `magnet === false`, then return `undefined` to\n            // announce there is no magnet found for this cell.\n            // This is especially useful to set on cells that have 'ports'. In this case,\n            // only the ports have set `magnet === true` and the overall element has `magnet === false`.\n            var attrs = this.model.get('attrs') || {};\n            if (attrs['.'] && attrs['.']['magnet'] === false) {\n                return undefined;\n            }\n\n            return this.el;\n        }\n\n        if ($el.attr('magnet')) {\n\n            return $el[0];\n        }\n\n        return this.findMagnet($el.parent());\n    },\n\n    // `selector` is a CSS selector or `'.'`. `filter` must be in the special JointJS filter format:\n    // `{ name: <name of the filter>, args: { <arguments>, ... }`.\n    // An example is: `{ filter: { name: 'blur', args: { radius: 5 } } }`.\n    applyFilter: function(selector, filter) {\n\n        var $selected = this.findBySelector(selector);\n\n        // Generate a hash code from the stringified filter definition. This gives us\n        // a unique filter ID for different definitions.\n        var filterId = filter.name + this.paper.svg.id + joint.util.hashCode(JSON.stringify(filter));\n\n        // If the filter already exists in the document,\n        // we're done and we can just use it (reference it using `url()`).\n        // If not, create one.\n        if (!this.paper.svg.getElementById(filterId)) {\n\n            var filterSVGString = joint.util.filter[filter.name] && joint.util.filter[filter.name](filter.args || {});\n            if (!filterSVGString) {\n                throw new Error('Non-existing filter ' + filter.name);\n            }\n            var filterElement = V(filterSVGString);\n            filterElement.attr('filterUnits', 'userSpaceOnUse');\n            filterElement.node.id = filterId;\n            V(this.paper.svg).defs().append(filterElement);\n        }\n\n        $selected.each(function() {\n            \n            V(this).attr('filter', 'url(#' + filterId + ')');\n        });\n    },\n\n    // `selector` is a CSS selector or `'.'`. `attr` is either a `'fill'` or `'stroke'`.\n    // `gradient` must be in the special JointJS gradient format:\n    // `{ type: <linearGradient|radialGradient>, stops: [ { offset: <offset>, color: <color> }, ... ]`.\n    // An example is: `{ fill: { type: 'linearGradient', stops: [ { offset: '10%', color: 'green' }, { offset: '50%', color: 'blue' } ] } }`.\n    applyGradient: function(selector, attr, gradient) {\n\n        var $selected = this.findBySelector(selector);\n\n        // Generate a hash code from the stringified filter definition. This gives us\n        // a unique filter ID for different definitions.\n        var gradientId = gradient.type + this.paper.svg.id + joint.util.hashCode(JSON.stringify(gradient));\n\n        // If the gradient already exists in the document,\n        // we're done and we can just use it (reference it using `url()`).\n        // If not, create one.\n        if (!this.paper.svg.getElementById(gradientId)) {\n\n            var gradientSVGString = [\n                '<' + gradient.type + '>',\n                _.map(gradient.stops, function(stop) {\n                    return '<stop offset=\"' + stop.offset + '\" stop-color=\"' + stop.color + '\" stop-opacity=\"' + (_.isFinite(stop.opacity) ? stop.opacity : 1) + '\" />'\n                }).join(''),\n                '</' + gradient.type + '>'\n            ].join('');\n            \n            var gradientElement = V(gradientSVGString);\n            if (gradient.attrs) { gradientElement.attr(gradient.attrs); }\n            gradientElement.node.id = gradientId;\n            V(this.paper.svg).defs().append(gradientElement);\n        }\n\n        $selected.each(function() {\n            \n            V(this).attr(attr, 'url(#' + gradientId + ')');\n        });\n    },\n\n    // Construct a unique selector for the `el` element within this view.\n    // `selector` is being collected through the recursive call. No value for `selector` is expected when using this method.\n    getSelector: function(el, selector) {\n\n        if (el === this.el) {\n\n            return selector;\n        }\n\n        var index = $(el).index();\n\n        selector = el.tagName + ':nth-child(' + (index + 1) + ')' + ' ' + (selector || '');\n\n        return this.getSelector($(el).parent()[0], selector + ' ');\n    },\n\n    // Interaction. The controller part.\n    // ---------------------------------\n\n    // Interaction is handled by the paper and delegated to the view in interest.\n    // `x` & `y` parameters passed to these functions represent the coordinates already snapped to the paper grid.\n    // If necessary, real coordinates can be obtained from the `evt` event object.\n\n    // These functions are supposed to be overriden by the views that inherit from `joint.dia.Cell`,\n    // i.e. `joint.dia.Element` and `joint.dia.Link`.\n\n    pointerdblclick: function(evt, x, y) {\n\n        this.notify('cell:pointerdblclick', evt, x, y);\n    },\n    \n    pointerdown: function(evt, x, y) {\n\n\tif (this.model.collection) {\n\t    this.model.trigger('batch:start');\n\t    this._collection = this.model.collection;\n\t}\n\n        this.notify('cell:pointerdown', evt, x, y);\n    },\n    \n    pointermove: function(evt, x, y) {\n\n        this.notify('cell:pointermove', evt, x, y);\n    },\n    \n    pointerup: function(evt, x, y) {\n\n        this.notify('cell:pointerup', evt, x, y);\n\n\tif (this._collection) {\n\t    // we don't want to trigger event on model as model doesn't\n\t    // need to be member of collection anymore (remove)\n\t    this._collection.trigger('batch:stop');\n\t    delete this._collection;\n\t}\n\n    }\n});\n\n\nif (typeof exports === 'object') {\n\n    module.exports.Cell = joint.dia.Cell;\n    module.exports.CellView = joint.dia.CellView;\n}\n\n//      JointJS library.\n//      (c) 2011-2013 client IO\n\n\nif (typeof exports === 'object') {\n\n    var joint = {\n        util: require('./core').util,\n        dia: {\n            Cell: require('./joint.dia.cell').Cell,\n            CellView: require('./joint.dia.cell').CellView\n        }\n    };\n    var Backbone = require('backbone');\n    var _ = require('lodash');\n}\n\n\n// joint.dia.Element base model.\n// -----------------------------\n\njoint.dia.Element = joint.dia.Cell.extend({\n\n    defaults: {\n        position: { x: 0, y: 0 },\n\tsize: { width: 1, height: 1 },\n        angle: 0\n    },\n\n    position: function(x, y) {\n\n        this.set('position', { x: x, y: y });\n    },\n    \n    translate: function(tx, ty, opt) {\n\n        ty = ty || 0;\n\n        if (tx === 0 && ty === 0) {\n            // Like nothing has happened.\n            return this;\n        }\n\n        var position = this.get('position') || { x: 0, y: 0 };\n\tvar translatedPosition = { x: position.x + tx || 0, y: position.y + ty || 0 };\n\n\tif (opt && opt.transition) {\n\n\t    if (!_.isObject(opt.transition)) opt.transition = {};\n\n\t    this.transition('position', translatedPosition, _.extend({}, opt.transition, {\n\t\tvalueFunction: joint.util.interpolate.object\n\t    }));\n\n\t} else {\n\n            this.set('position', translatedPosition, opt);\n\n            // Recursively call `translate()` on all the embeds cells.\n            _.invoke(this.getEmbeddedCells(), 'translate', tx, ty, opt);\n\t}\n\n        return this;\n    },\n\n    resize: function(width, height) {\n\n\tthis.trigger('batch:start');\n        this.set('size', { width: width, height: height });\n\tthis.trigger('batch:stop');\n\n\treturn this;\n    },\n\n    rotate: function(angle, absolute) {\n\n        return this.set('angle', absolute ? angle : ((this.get('angle') || 0) + angle) % 360);\n    },\n\n    getBBox: function() {\n\n\tvar position = this.get('position');\n\tvar size = this.get('size');\n\n\treturn g.rect(position.x, position.y, size.width, size.height);\n    }\n});\n\n// joint.dia.Element base view and controller.\n// -------------------------------------------\n\njoint.dia.ElementView = joint.dia.CellView.extend({\n\n    className: function() {\n        return 'element ' + this.model.get('type').split('.').join(' ');\n    },\n\n    initialize: function() {\n\n        _.bindAll(this, 'translate', 'resize', 'rotate');\n\n        joint.dia.CellView.prototype.initialize.apply(this, arguments);\n        \n\tthis.listenTo(this.model, 'change:position', this.translate);\n\tthis.listenTo(this.model, 'change:size', this.resize);\n\tthis.listenTo(this.model, 'change:angle', this.rotate);\n    },\n\n    // Default is to process the `attrs` object and set attributes on subelements based on the selectors.\n    update: function(cell, renderingOnlyAttrs) {\n\n        var allAttrs = this.model.get('attrs');\n\n        var rotatable = V(this.$('.rotatable')[0]);\n        if (rotatable) {\n\n            var rotation = rotatable.attr('transform');\n            rotatable.attr('transform', '');\n        }\n        \n        var relativelyPositioned = [];\n\n        _.each(renderingOnlyAttrs || allAttrs, function(attrs, selector) {\n\n            // Elements that should be updated.\n            var $selected = this.findBySelector(selector);\n\n            // No element matched by the `selector` was found. We're done then.\n            if ($selected.length === 0) return;\n\n            // Special attributes are treated by JointJS, not by SVG.\n            var specialAttributes = ['style', 'text', 'html', 'ref-x', 'ref-y', 'ref-dx', 'ref-dy', 'ref', 'x-alignment', 'y-alignment', 'port'];\n\n            // If the `filter` attribute is an object, it is in the special JointJS filter format and so\n            // it becomes a special attribute and is treated separately.\n            if (_.isObject(attrs.filter)) {\n\n                specialAttributes.push('filter');\n                this.applyFilter(selector, attrs.filter);\n            }\n\n            // If the `fill` or `stroke` attribute is an object, it is in the special JointJS gradient format and so\n            // it becomes a special attribute and is treated separately.\n            if (_.isObject(attrs.fill)) {\n\n                specialAttributes.push('fill');\n                this.applyGradient(selector, 'fill', attrs.fill);\n            }\n            if (_.isObject(attrs.stroke)) {\n\n                specialAttributes.push('stroke');\n                this.applyGradient(selector, 'stroke', attrs.stroke);\n            }\n            \n            // Set regular attributes on the `$selected` subelement. Note that we cannot use the jQuery attr()\n            // method as some of the attributes might be namespaced (e.g. xlink:href) which fails with jQuery attr().\n            var finalAttributes = _.omit(attrs, specialAttributes);\n            \n            $selected.each(function() {\n                \n                V(this).attr(finalAttributes);\n            });\n\n            // `port` attribute contains the `id` of the port that the underlying magnet represents.\n            if (attrs.port) {\n\n                $selected.attr('port', _.isUndefined(attrs.port.id) ? attrs.port : attrs.port.id);\n            }\n\n            // `style` attribute is special in the sense that it sets the CSS style of the subelement.\n            if (attrs.style) {\n\n                $selected.css(attrs.style);\n            }\n            \n            // Make special case for `text` attribute. So that we can set text content of the `<text>` element\n            // via the `attrs` object as well.\n            if (!_.isUndefined(attrs.text)) {\n\n                $selected.each(function() {\n\n                    V(this).text(attrs.text + '');\n                });\n            }\n\n            if (!_.isUndefined(attrs.html)) {\n\n                $selected.each(function() {\n\n                    $(this).html(attrs.html + '');\n                });\n            }\n            \n            // Special `ref-x` and `ref-y` attributes make it possible to set both absolute or\n            // relative positioning of subelements.\n            if (!_.isUndefined(attrs['ref-x']) ||\n                !_.isUndefined(attrs['ref-y']) ||\n                !_.isUndefined(attrs['ref-dx']) ||\n                !_.isUndefined(attrs['ref-dy']) ||\n\t\t!_.isUndefined(attrs['x-alignment']) ||\n\t\t!_.isUndefined(attrs['y-alignment'])\n               ) {\n\n                relativelyPositioned.push($selected);\n            }\n            \n        }, this);\n\n        // We don't want the sub elements to affect the bounding box of the root element when\n        // positioning the sub elements relatively to the bounding box.\n        //_.invoke(relativelyPositioned, 'hide');\n        //_.invoke(relativelyPositioned, 'show');\n\n        // Note that we're using the bounding box without transformation because we are already inside\n        // a transformed coordinate system.\n        var bbox = this.el.getBBox();        \n\n        renderingOnlyAttrs = renderingOnlyAttrs || {};\n\n        _.each(relativelyPositioned, function($el) {\n\n            // if there was a special attribute affecting the position amongst renderingOnlyAttributes\n            // we have to merge it with rest of the element's attributes as they are necessary\n            // to update the position relatively (i.e `ref`)\n            var renderingOnlyElAttrs = renderingOnlyAttrs[$el.selector];\n            var elAttrs = renderingOnlyElAttrs\n                ? _.merge({}, allAttrs[$el.selector], renderingOnlyElAttrs)\n                : allAttrs[$el.selector];\n\n            this.positionRelative($el, bbox, elAttrs);\n            \n        }, this);\n\n        if (rotatable) {\n\n            rotatable.attr('transform', rotation || '');\n        }\n    },\n\n    positionRelative: function($el, bbox, elAttrs) {\n\n        var ref = elAttrs['ref'];\n        var refX = parseFloat(elAttrs['ref-x']);\n        var refY = parseFloat(elAttrs['ref-y']);\n        var refDx = parseFloat(elAttrs['ref-dx']);\n        var refDy = parseFloat(elAttrs['ref-dy']);\n        var yAlignment = elAttrs['y-alignment'];\n        var xAlignment = elAttrs['x-alignment'];\n\n        // `ref` is the selector of the reference element. If no `ref` is passed, reference\n        // element is the root element.\n\n        var isScalable = _.contains(_.pluck(_.pluck($el.parents('g'), 'className'), 'baseVal'), 'scalable');\n\n        if (ref) {\n\n            // Get the bounding box of the reference element relative to the root `<g>` element.\n            bbox = V(this.findBySelector(ref)[0]).bbox(false, this.el);\n        }\n\n        var vel = V($el[0]);\n\n        // Remove the previous translate() from the transform attribute and translate the element\n        // relative to the root bounding box following the `ref-x` and `ref-y` attributes.\n        if (vel.attr('transform')) {\n\n            vel.attr('transform', vel.attr('transform').replace(/translate\\([^)]*\\)/g, '') || '');\n        }\n\n        function isDefined(x) {\n            return _.isNumber(x) && !_.isNaN(x);\n        }\n\n        // The final translation of the subelement.\n        var tx = 0;\n        var ty = 0;\n\n        // `ref-dx` and `ref-dy` define the offset of the subelement relative to the right and/or bottom\n        // coordinate of the reference element.\n        if (isDefined(refDx)) {\n\n            if (isScalable) {\n\n                // Compensate for the scale grid in case the elemnt is in the scalable group.\n                var scale = V(this.$('.scalable')[0]).scale();\n                tx = bbox.x + bbox.width + refDx / scale.sx;\n                \n            } else {\n                \n                tx = bbox.x + bbox.width + refDx;\n            }\n        }\n        if (isDefined(refDy)) {\n\n            if (isScalable) {\n                \n                // Compensate for the scale grid in case the elemnt is in the scalable group.\n                var scale = V(this.$('.scalable')[0]).scale();\n                ty = bbox.y + bbox.height + refDy / scale.sy;\n            } else {\n                \n                ty = bbox.y + bbox.height + refDy;\n            }\n        }\n\n        // if `refX` is in [0, 1] then `refX` is a fraction of bounding box width\n        // if `refX` is < 0 then `refX`'s absolute values is the right coordinate of the bounding box\n        // otherwise, `refX` is the left coordinate of the bounding box\n        // Analogical rules apply for `refY`.\n        if (isDefined(refX)) {\n\n            if (refX > 0 && refX < 1) {\n\n                tx = bbox.x + bbox.width * refX;\n\n            } else if (isScalable) {\n\n                // Compensate for the scale grid in case the elemnt is in the scalable group.\n                var scale = V(this.$('.scalable')[0]).scale();\n                tx = bbox.x + refX / scale.sx;\n                \n            } else {\n\n                tx = bbox.x + refX;\n            }\n        }\n        if (isDefined(refY)) {\n\n            if (refY > 0 && refY < 1) {\n                \n                ty = bbox.y + bbox.height * refY;\n                \n            } else if (isScalable) {\n\n                // Compensate for the scale grid in case the elemnt is in the scalable group.\n                var scale = V(this.$('.scalable')[0]).scale();\n                ty = bbox.y + refY / scale.sy;\n                \n            } else {\n\n                ty = bbox.y + refY;\n            }\n        }\n\n\tvar velbbox = vel.bbox(false, this.paper.viewport);\n        // `y-alignment` when set to `middle` causes centering of the subelement around its new y coordinate.\n        if (yAlignment === 'middle') {\n\n            ty -= velbbox.height/2;\n            \n        } else if (isDefined(yAlignment)) {\n\n            ty += (yAlignment > 0 && yAlignment < 1) ?  velbbox.height * yAlignment : yAlignment;\n        }\n\n        // `x-alignment` when set to `middle` causes centering of the subelement around its new x coordinate.\n        if (xAlignment === 'middle') {\n            \n            tx -= velbbox.width/2;\n            \n        } else if (isDefined(xAlignment)) {\n\n            tx += (xAlignment > 0 && xAlignment < 1) ?  velbbox.width * xAlignment : xAlignment;\n        }\n\n        vel.translate(tx, ty);\n    },\n\n    // `prototype.markup` is rendered by default. Set the `markup` attribute on the model if the\n    // default markup is not desirable.\n    render: function() {\n\n        var markup = this.model.markup || this.model.get('markup');\n        \n        if (markup) {\n\n            var nodes = V(markup);\n            V(this.el).append(nodes);\n            \n        } else {\n\n            throw new Error('properties.markup is missing while the default render() implementation is used.');\n        }\n\n        this.update();\n\n        this.resize();\n        this.rotate();\n        this.translate();        \n\n        return this;\n    },\n\n    // Scale the whole `<g>` group. Note the difference between `scale()` and `resize()` here.\n    // `resize()` doesn't scale the whole `<g>` group but rather adjusts the `box.sx`/`box.sy` only.\n    // `update()` is then responsible for scaling only those elements that have the `follow-scale`\n    // attribute set to `true`. This is desirable in elements that have e.g. a `<text>` subelement\n    // that is not supposed to be scaled together with a surrounding `<rect>` element that IS supposed\n    // be be scaled.\n    scale: function(sx, sy) {\n\n        // TODO: take into account the origin coordinates `ox` and `oy`.\n        V(this.el).scale(sx, sy);\n    },\n\n    resize: function() {\n\n        var size = this.model.get('size') || { width: 1, height: 1 };\n        var angle = this.model.get('angle') || 0;\n        \n        var scalable = V(this.$('.scalable')[0]);\n        if (!scalable) {\n            // If there is no scalable elements, than there is nothing to resize.\n            return;\n        }\n        var scalableBbox = scalable.bbox(true);\n        \n        scalable.attr('transform', 'scale(' + (size.width / scalableBbox.width) + ',' + (size.height / scalableBbox.height) + ')');\n\n        // Now the interesting part. The goal is to be able to store the object geometry via just `x`, `y`, `angle`, `width` and `height`\n        // Order of transformations is significant but we want to reconstruct the object always in the order:\n        // resize(), rotate(), translate() no matter of how the object was transformed. For that to work,\n        // we must adjust the `x` and `y` coordinates of the object whenever we resize it (because the origin of the\n        // rotation changes). The new `x` and `y` coordinates are computed by canceling the previous rotation\n        // around the center of the resized object (which is a different origin then the origin of the previous rotation)\n        // and getting the top-left corner of the resulting object. Then we clean up the rotation back to what it originally was.\n        \n        // Cancel the rotation but now around a different origin, which is the center of the scaled object.\n        var rotatable = V(this.$('.rotatable')[0]);\n        var rotation = rotatable && rotatable.attr('transform');\n        if (rotation && rotation !== 'null') {\n\n            rotatable.attr('transform', rotation + ' rotate(' + (-angle) + ',' + (size.width/2) + ',' + (size.height/2) + ')');\n            var rotatableBbox = scalable.bbox(false, this.paper.viewport);\n            \n            // Store new x, y and perform rotate() again against the new rotation origin.\n            this.model.set('position', { x: rotatableBbox.x, y: rotatableBbox.y });\n            this.rotate();\n        }\n\n        // Update must always be called on non-rotated element. Otherwise, relative positioning\n        // would work with wrong (rotated) bounding boxes.\n        this.update();\n    },\n\n    translate: function(model, changes, opt) {\n\n        var position = this.model.get('position') || { x: 0, y: 0 };\n\n        V(this.el).attr('transform', 'translate(' + position.x + ',' + position.y + ')');\n    },\n\n    rotate: function() {\n\n        var rotatable = V(this.$('.rotatable')[0]);\n        if (!rotatable) {\n            // If there is no rotatable elements, then there is nothing to rotate.\n            return;\n        }\n        \n        var angle = this.model.get('angle') || 0;\n        var size = this.model.get('size') || { width: 1, height: 1 };\n\n        var ox = size.width/2;\n        var oy = size.height/2;\n        \n\n        rotatable.attr('transform', 'rotate(' + angle + ',' + ox + ',' + oy + ')');\n    },\n\n    // Interaction. The controller part.\n    // ---------------------------------\n\n    \n    pointerdown: function(evt, x, y) {\n\n        if ( // target is a valid magnet start linking\n            evt.target.getAttribute('magnet') &&\n            this.paper.options.validateMagnet.call(this.paper, this, evt.target)\n        ) {\n                this.model.trigger('batch:start');\n\n                var link = this.paper.getDefaultLink(this, evt.target);\n                link.set({\n                    source: {\n                        id: this.model.id,\n                        selector: this.getSelector(evt.target),\n                        port: $(evt.target).attr('port')\n                    },\n                    target: { x: x, y: y }\n                });\n\n                this.paper.model.addCell(link);\n\n\t        this._linkView = this.paper.findViewByModel(link);\n                this._linkView.startArrowheadMove('target');\n\n        } else {\n\n            this._dx = x;\n            this._dy = y;\n\n            joint.dia.CellView.prototype.pointerdown.apply(this, arguments);\n        }\n    },\n\n    pointermove: function(evt, x, y) {\n\n        if (this._linkView) {\n\n            // let the linkview deal with this event\n            this._linkView.pointermove(evt, x, y);\n\n        } else {\n\n\t    var grid = this.paper.options.gridSize;\n\n            if (this.options.interactive !== false) {\n\n\t        var position = this.model.get('position');\n\n\t        // Make sure the new element's position always snaps to the current grid after\n\t        // translate as the previous one could be calculated with a different grid size.\n\t        this.model.translate(\n\t\t    g.snapToGrid(position.x, grid) - position.x + g.snapToGrid(x - this._dx, grid),\n\t\t    g.snapToGrid(position.y, grid) - position.y + g.snapToGrid(y - this._dy, grid)\n\t        );\n            }\n\n            this._dx = g.snapToGrid(x, grid);\n            this._dy = g.snapToGrid(y, grid);\n\n            joint.dia.CellView.prototype.pointermove.apply(this, arguments);\n        }\n    },\n\n    pointerup: function(evt, x, y) {\n\n        if (this._linkView) {\n\n            // let the linkview deal with this event\n            this._linkView.pointerup(evt, x, y);\n\n            delete this._linkView;\n\n            this.model.trigger('batch:stop');\n\n        } else {\n\n            joint.dia.CellView.prototype.pointerup.apply(this, arguments);\n        }\n    }\n\n});\n\nif (typeof exports === 'object') {\n\n    module.exports.Element = joint.dia.Element;\n    module.exports.ElementView = joint.dia.ElementView;\n}\n\n//      JointJS diagramming library.\n//      (c) 2011-2013 client IO\n\n\nif (typeof exports === 'object') {\n\n    var joint = {\n        dia: {\n            Cell: require('./joint.dia.cell').Cell,\n            CellView: require('./joint.dia.cell').CellView\n        }\n    };\n    var Backbone = require('backbone');\n    var _ = require('lodash');\n    var g = require('./geometry').g;\n}\n\n\n\n// joint.dia.Link base model.\n// --------------------------\njoint.dia.Link = joint.dia.Cell.extend({\n\n    // The default markup for links.\n    markup: [\n        '<path class=\"connection\" stroke=\"black\"/>',\n        '<path class=\"marker-source\" fill=\"black\" stroke=\"black\" />',\n        '<path class=\"marker-target\" fill=\"black\" stroke=\"black\" />',\n        '<path class=\"connection-wrap\"/>',\n        '<g class=\"labels\"/>',\n        '<g class=\"marker-vertices\"/>',\n        '<g class=\"marker-arrowheads\"/>',\n        '<g class=\"link-tools\"/>'\n    ].join(''),\n\n    labelMarkup: [\n        '<g class=\"label\">',\n        '<rect />',\n        '<text />',\n        '</g>'\n    ].join(''),\n\n    toolMarkup: [\n        '<g class=\"link-tool\">',\n        '<g class=\"tool-remove\" event=\"remove\">',\n        '<circle r=\"11\" />',\n        '<path transform=\"scale(.8) translate(-16, -16)\" d=\"M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z\"/>',\n        '<title>Remove link.</title>',\n        '</g>',\n        '<g class=\"tool-options\" event=\"link:options\">',\n        '<circle r=\"11\" transform=\"translate(25)\"/>',\n        '<path fill=\"white\" transform=\"scale(.55) translate(29, -16)\" d=\"M31.229,17.736c0.064-0.571,0.104-1.148,0.104-1.736s-0.04-1.166-0.104-1.737l-4.377-1.557c-0.218-0.716-0.504-1.401-0.851-2.05l1.993-4.192c-0.725-0.91-1.549-1.734-2.458-2.459l-4.193,1.994c-0.647-0.347-1.334-0.632-2.049-0.849l-1.558-4.378C17.165,0.708,16.588,0.667,16,0.667s-1.166,0.041-1.737,0.105L12.707,5.15c-0.716,0.217-1.401,0.502-2.05,0.849L6.464,4.005C5.554,4.73,4.73,5.554,4.005,6.464l1.994,4.192c-0.347,0.648-0.632,1.334-0.849,2.05l-4.378,1.557C0.708,14.834,0.667,15.412,0.667,16s0.041,1.165,0.105,1.736l4.378,1.558c0.217,0.715,0.502,1.401,0.849,2.049l-1.994,4.193c0.725,0.909,1.549,1.733,2.459,2.458l4.192-1.993c0.648,0.347,1.334,0.633,2.05,0.851l1.557,4.377c0.571,0.064,1.148,0.104,1.737,0.104c0.588,0,1.165-0.04,1.736-0.104l1.558-4.377c0.715-0.218,1.399-0.504,2.049-0.851l4.193,1.993c0.909-0.725,1.733-1.549,2.458-2.458l-1.993-4.193c0.347-0.647,0.633-1.334,0.851-2.049L31.229,17.736zM16,20.871c-2.69,0-4.872-2.182-4.872-4.871c0-2.69,2.182-4.872,4.872-4.872c2.689,0,4.871,2.182,4.871,4.872C20.871,18.689,18.689,20.871,16,20.871z\"/>',\n        '<title>Link options.</title>',\n        '</g>',\n        '</g>'\n    ].join(''),\n\n    // The default markup for showing/removing vertices. These elements are the children of the .marker-vertices element (see `this.markup`).\n    // Only .marker-vertex and .marker-vertex-remove element have special meaning. The former is used for\n    // dragging vertices (changin their position). The latter is used for removing vertices.\n    vertexMarkup: [\n        '<g class=\"marker-vertex-group\" transform=\"translate(<%= x %>, <%= y %>)\">',\n        '<circle class=\"marker-vertex\" idx=\"<%= idx %>\" r=\"10\" />',\n        '<path class=\"marker-vertex-remove-area\" idx=\"<%= idx %>\" d=\"M16,5.333c-7.732,0-14,4.701-14,10.5c0,1.982,0.741,3.833,2.016,5.414L2,25.667l5.613-1.441c2.339,1.317,5.237,2.107,8.387,2.107c7.732,0,14-4.701,14-10.5C30,10.034,23.732,5.333,16,5.333z\" transform=\"translate(5, -33)\"/>',\n        '<path class=\"marker-vertex-remove\" idx=\"<%= idx %>\" transform=\"scale(.8) translate(9.5, -37)\" d=\"M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z\">',\n        '<title>Remove vertex.</title>',\n        '</path>',\n        '</g>'\n    ].join(''),\n\n    arrowheadMarkup: [\n        '<g class=\"marker-arrowhead-group marker-arrowhead-group-<%= end %>\">',\n        '<path class=\"marker-arrowhead\" end=\"<%= end %>\" d=\"M 26 0 L 0 13 L 26 26 z\" />',\n        '</g>'\n    ].join(''),\n\n    defaults: {\n\n        type: 'link'\n    },\n\n    disconnect: function() {\n\n        return this.set({ source: g.point(0, 0), target: g.point(0, 0) });\n    },\n\n    // A convenient way to set labels. Currently set values will be mixined with `value` if used as a setter.\n    label: function(idx, value) {\n\n        idx = idx || 0;\n        \n        var labels = this.get('labels') || [];\n        \n        // Is it a getter?\n        if (arguments.length === 0 || arguments.length === 1) {\n            \n            return labels[idx];\n        }\n\n        var newValue = _.merge({}, labels[idx], value);\n\n        var newLabels = labels.slice();\n        newLabels[idx] = newValue;\n        \n        return this.set({ labels: newLabels });\n    }\n});\n\n\n// joint.dia.Link base view and controller.\n// ----------------------------------------\n\njoint.dia.LinkView = joint.dia.CellView.extend({\n\n    className: 'link',\n\n    options: {\n\n        shortLinkLength: 100\n    },\n    \n    initialize: function() {\n\n        joint.dia.CellView.prototype.initialize.apply(this, arguments);\n\n        // create methods in prototype, so they can be accessed from any instance and\n        // don't need to be create over and over\n        if (typeof this.constructor.prototype.watchSource !== 'function') {\n            this.constructor.prototype.watchSource = this._createWatcher('source');\n            this.constructor.prototype.watchTarget = this._createWatcher('target');\n        }\n\n        // `_.labelCache` is a mapping of indexes of labels in the `this.get('labels')` array to\n        // `<g class=\"label\">` nodes wrapped by Vectorizer. This allows for quick access to the\n        // nodes in `updateLabelPosition()` in order to update the label positions.\n        this._labelCache = {};\n\n        // bind events\n        this.startListening();\n    },\n\n    startListening: function() {\n\n\tthis.listenTo(this.model, 'change:markup', this.render);\n\tthis.listenTo(this.model, 'change:smooth change:manhattan', this.update);\n        this.listenTo(this.model, 'change:toolMarkup', function() {\n            this.renderTools().updateToolsPosition();\n        });\n\tthis.listenTo(this.model, 'change:labels change:labelMarkup', function() {\n            this.renderLabels().updateLabelPositions();\n        });\n        this.listenTo(this.model, 'change:vertices change:vertexMarkup', function() {\n            this.renderVertexMarkers().update();\n        });\n\tthis.listenTo(this.model, 'change:source', function(cell, source) {\n            this.watchSource(cell, source).update();\n        });\n\tthis.listenTo(this.model, 'change:target', function(cell, target) {\n            this.watchTarget(cell, target).update();\n        });\n    },\n\n    // Rendering\n    //----------\n\n    render: function() {\n\n\tthis.$el.empty();\n\n        // A special markup can be given in the `properties.markup` property. This might be handy\n        // if e.g. arrowhead markers should be `<image>` elements or any other element than `<path>`s.\n        // `.connection`, `.connection-wrap`, `.marker-source` and `.marker-target` selectors\n        // of elements with special meaning though. Therefore, those classes should be preserved in any\n        // special markup passed in `properties.markup`.\n        var children = V(this.model.get('markup') || this.model.markup);\n\n        // custom markup may contain only one children\n        if (!_.isArray(children)) children = [children];\n\n        // Cache all children elements for quicker access.\n        this._V = {} // vectorized markup;\n        _.each(children, function(child) {\n            var c = child.attr('class');\n            c && (this._V[$.camelCase(c)] = child);\n        }, this);\n\n        // Only the connection path is mandatory\n        if (!this._V.connection) throw new Error('link: no connection path in the markup');\n\n        // partial rendering\n        this.renderTools();\n        this.renderVertexMarkers();\n        this.renderArrowheadMarkers();\n\n        V(this.el).append(children);\n\n        // rendering labels has to be run after the link is appended to DOM tree. (otherwise <Text> bbox\n        // returns zero values)\n        this.renderLabels();\n\n        // start watching the ends of the link for changes\n        this.watchSource(this.model, this.model.get('source'))\n            .watchTarget(this.model, this.model.get('target'))\n            .update();\n\n        return this;\n    },\n\n    renderLabels: function() {\n\n        if (!this._V.labels) return this;\n\n        this._labelCache = {};\n        var $labels = $(this._V.labels.node).empty();\n\n        var labels = this.model.get('labels') || [];\n        if (!labels.length) return this;\n        \n        var labelTemplate = _.template(this.model.get('labelMarkup') || this.model.labelMarkup);\n        // This is a prepared instance of a vectorized SVGDOM node for the label element resulting from\n        // compilation of the labelTemplate. The purpose is that all labels will just `clone()` this\n        // node to create a duplicate.\n        var labelNodeInstance = V(labelTemplate());\n\n        _.each(labels, function(label, idx) {\n\n            var labelNode = labelNodeInstance.clone().node;\n            // Cache label nodes so that the `updateLabels()` can just update the label node positions.\n            this._labelCache[idx] = V(labelNode);\n\n            var $text = $(labelNode).find('text');\n            var $rect = $(labelNode).find('rect');\n\n            // Text attributes with the default `text-anchor` set.\n            var textAttributes = _.extend({ 'text-anchor': 'middle' }, joint.util.getByPath(label, 'attrs/text', '/'));\n            \n            $text.attr(_.omit(textAttributes, 'text'));\n                \n            if (!_.isUndefined(textAttributes.text)) {\n\n                V($text[0]).text(textAttributes.text + '');\n            }\n\n            // Note that we first need to append the `<text>` element to the DOM in order to\n            // get its bounding box.\n            $labels.append(labelNode);\n\n            // `y-alignment` - center the text element around its y coordinate.\n            var textBbox = V($text[0]).bbox(true, $labels[0]);\n            V($text[0]).translate(0, -textBbox.height/2);\n\n            // Add default values.\n            var rectAttributes = _.extend({\n\n                fill: 'white',\n                rx: 3,\n                ry: 3\n                \n            }, joint.util.getByPath(label, 'attrs/rect', '/'));\n            \n            $rect.attr(_.extend(rectAttributes, {\n\n                x: textBbox.x,\n                y: textBbox.y - textBbox.height/2,  // Take into account the y-alignment translation.\n                width: textBbox.width,\n                height: textBbox.height\n            }));\n            \n        }, this);\n\n        return this;\n    },\n\n    renderTools: function() {\n\n        if (!this._V.linkTools) return this;\n\n        // Tools are a group of clickable elements that manipulate the whole link.\n        // A good example of this is the remove tool that removes the whole link.\n        // Tools appear after hovering the link close to the `source` element/point of the link\n        // but are offset a bit so that they don't cover the `marker-arrowhead`.\n\n        var $tools = $(this._V.linkTools.node).empty();\n        var toolTemplate = _.template(this.model.get('toolMarkup') || this.model.toolMarkup);\n        var tool = V(toolTemplate());\n\n        $tools.append(tool.node);\n\n        // Cache the tool node so that the `updateToolsPosition()` can update the tool position quickly.\n        this._toolCache = tool;\n\n        return this;\n    },\n\n    renderVertexMarkers: function() {\n\n        if (!this._V.markerVertices) return this;\n\n        var $markerVertices = $(this._V.markerVertices.node).empty();\n\n        // A special markup can be given in the `properties.vertexMarkup` property. This might be handy\n        // if default styling (elements) are not desired. This makes it possible to use any\n        // SVG elements for .marker-vertex and .marker-vertex-remove tools.\n        var markupTemplate = _.template(this.model.get('vertexMarkup') || this.model.vertexMarkup);\n        \n        _.each(this.model.get('vertices'), function(vertex, idx) {\n\n            $markerVertices.append(V(markupTemplate(_.extend({ idx: idx }, vertex))).node);\n        });\n        \n        return this;\n    },\n\n    renderArrowheadMarkers: function() {\n\n        // Custom markups might not have arrowhead markers. Therefore, jump of this function immediately if that's the case.\n        if (!this._V.markerArrowheads) return this;\n\n        var $markerArrowheads = $(this._V.markerArrowheads.node);\n\n        $markerArrowheads.empty();\n\n        // A special markup can be given in the `properties.vertexMarkup` property. This might be handy\n        // if default styling (elements) are not desired. This makes it possible to use any\n        // SVG elements for .marker-vertex and .marker-vertex-remove tools.\n        var markupTemplate = _.template(this.model.get('arrowheadMarkup') || this.model.arrowheadMarkup);\n\n        this._sourceArrowhead = V(markupTemplate({ end: 'source' }));\n        this._targetArrowhead = V(markupTemplate({ end: 'target' }));\n\n        $markerArrowheads.append(this._sourceArrowhead.node, this._targetArrowhead.node);\n\n        return this;\n    },\n\n    // Updating\n    //---------\n\n    // Default is to process the `attrs` object and set attributes on subelements based on the selectors.\n    update: function() {\n\n        // Update attributes.\n        _.each(this.model.get('attrs'), function(attrs, selector) {\n            \n            // If the `filter` attribute is an object, it is in the special JointJS filter format and so\n            // it becomes a special attribute and is treated separately.\n            if (_.isObject(attrs.filter)) {\n                \n                this.findBySelector(selector).attr(_.omit(attrs, 'filter'));\n                this.applyFilter(selector, attrs.filter);\n                \n            } else {\n                \n                this.findBySelector(selector).attr(attrs);\n            }\n        }, this);\n\n        var vertices = this.model.get('vertices');\n\n        if (this.model.get('manhattan')) {\n            // If manhattan routing is enabled, find new vertices so that the link is orthogonally routed.\n            vertices = this.findManhattanRoute(vertices);\n        }\n\n        this._firstVertex = _.first(vertices);\n        this._sourcePoint = this.getConnectionPoint(\n            'source',\n            this.model.get('source'),\n            this._firstVertex || this.model.get('target')).round();\n\n        this._lastVertex = _.last(vertices);\n        this._targetPoint = this.getConnectionPoint(\n            'target',\n            this.model.get('target'),\n            this._lastVertex || this._sourcePoint\n        );\n\n        // Make the markers \"point\" to their sticky points being auto-oriented towards\n        // `targetPosition`/`sourcePosition`. And do so only if there is a markup for them.\n        if (this._V.markerSource) {\n            this._V.markerSource.translateAndAutoOrient(\n                this._sourcePoint,\n                this._firstVertex || this._targetPoint,\n                this.paper.viewport\n            );\n        }\n\n        if (this._V.markerTarget) {\n            this._V.markerTarget.translateAndAutoOrient(\n                this._targetPoint,\n                this._lastVertex || this._sourcePoint,\n                this.paper.viewport\n            );\n        }\n\n        var pathData = this.getPathData(vertices);\n        // The markup needs to contain a `.connection`\n        this._V.connection.attr('d', pathData);\n        this._V.connectionWrap && this._V.connectionWrap.attr('d', pathData);\n\n        //partials updates\n        this.updateLabelPositions();\n        this.updateToolsPosition();\n        this.updateArrowheadMarkers();\n\n        return this;\n    },\n\n    updateLabelPositions: function() {\n\n        if (!this._V.labels) return this;\n\n        // This method assumes all the label nodes are stored in the `this._labelCache` hash table\n        // by their indexes in the `this.get('labels')` array. This is done in the `renderLabels()` method.\n\n        var labels = this.model.get('labels') || [];\n        if (!labels.length) return this;\n\n        var connectionElement = this._V.connection.node;\n        var connectionLength = connectionElement.getTotalLength();\n\n        _.each(labels, function(label, idx) {\n\n            var position = label.position;\n            position = (position > connectionLength) ? connectionLength : position; // sanity check\n            position = (position < 0) ? connectionLength + position : position;\n            position = position > 1 ? position : connectionLength * position;\n\n            var labelCoordinates = connectionElement.getPointAtLength(position);\n\n            this._labelCache[idx].attr('transform', 'translate(' + labelCoordinates.x + ', ' + labelCoordinates.y + ')');\n\n        }, this);\n\n        return this;\n    },\n\n\n    updateToolsPosition: function() {\n\n        if (!this._V.linkTools) return this;\n\n        // Move the tools a bit to the target position but don't cover the `sourceArrowhead` marker.\n        // Note that the offset is hardcoded here. The offset should be always\n        // more than the `this.$('.marker-arrowhead[end=\"source\"]')[0].bbox().width` but looking\n        // this up all the time would be slow.\n\n        var scale = '';\n        var offset = 40;\n\n        // If the link is too short, make the tools half the size and the offset twice as low.\n        if (this.getConnectionLength() < this.options.shortLinkLength) {\n            scale = 'scale(.5)';\n            offset /= 2;\n        }\n\n        var toolPosition = this.getPointAtLength(offset);\n        \n        this._toolCache.attr('transform', 'translate(' + toolPosition.x + ', ' + toolPosition.y + ') ' + scale);\n\n        return this;\n    },\n\n\n    updateArrowheadMarkers: function() {\n\n        if (!this._V.markerArrowheads) return this;\n\n        // getting bbox of an element with `display=\"none\"` in IE9 ends up with access violation\n        if ($.css(this._V.markerArrowheads.node, 'display') === 'none') return this;\n\n        var sx = this.getConnectionLength() < this.options.shortLinkLength ? .5 : 1\n        this._sourceArrowhead.scale(sx);\n        this._targetArrowhead.scale(sx);\n\n        // Make the markers \"point\" to their sticky points being auto-oriented towards `targetPosition`/`sourcePosition`.\n        this._sourceArrowhead.translateAndAutoOrient(\n            this._sourcePoint,\n            this._firstVertex || this._targetPoint,\n            this.paper.viewport\n        );\n\n        this._targetArrowhead.translateAndAutoOrient(\n            this._targetPoint,\n            this._lastVertex || this._sourcePoint,\n            this.paper.viewport\n        );\n\n        return this;\n    },\n\n    // Returns a function observing changes on an end of the link. If a change happens and new end is a new model,\n    // it stops listening on the previous one and starts listening to the new one.\n    _createWatcher: function(endType) {\n\n        function watchEnd(link, end) {\n\n            end = end || {};\n\n            var previousEnd = link.previous(endType) || {};\n\n            // Pick updateMethod this._sourceBboxUpdate or this._targetBboxUpdate.\n            var updateEndFunction = this['_' + endType + 'BBoxUpdate'];\n\n            if (this._isModel(previousEnd)) {\n                this.stopListening(this.paper.getModelById(previousEnd.id), 'change', updateEndFunction);\n            }\n\n            if (this._isModel(end)) {\n                // If the observed model changes, it caches a new bbox and do the link update.\n                this.listenTo(this.paper.getModelById(end.id), 'change', updateEndFunction);\n            }\n\n            _.bind(updateEndFunction, this)({ cacheOnly: true });\n\n            return this;\n        }\n\n        return watchEnd;\n    },\n\n    // It's important to keep both methods (sourceBboxUpdate and targetBboxUpdate) as unique methods\n    // because of loop links. We have to be able to determine, which method we want to stop listen to.\n    // ListenTo(model, event, handler) as model and event will be identical.\n    _sourceBBoxUpdate: function(update) {\n\n        update = update || {};\n        var end = this.model.get('source');\n\n        if (this._isModel(end)) {\n\n            var selector = this._makeSelector(end);\n            var view = this.paper.findViewByModel(end.id);\n            var magnetElement = this.paper.viewport.querySelector(selector);\n\n            this._sourceBbox = view.getStrokeBBox(magnetElement);\n\n        } else {\n            // the link end is a point ~ rect 1x1\n            this._sourceBbox = {\n                width: 1, height: 1,\n                x: end.x, y: end.y\n            };\n        }\n\n        if (!update.cacheOnly) this.update();\n    },\n\n    _targetBBoxUpdate: function(update) {\n\n        update = update || {};\n        var end = this.model.get('target');\n\n        if (this._isModel(end)) {\n\n            var selector = this._makeSelector(end);\n            var view = this.paper.findViewByModel(end.id);\n            var magnetElement = this.paper.viewport.querySelector(selector);\n\n            this._targetBbox = view.getStrokeBBox(magnetElement);\n\n        } else {\n            // the link end is a point ~ rect 1x1\n            this._targetBbox = {\n                width: 1, height: 1,\n                x: end.x, y: end.y\n            };\n        }\n\n        if (!update.cacheOnly) this.update();\n    },\n\n\n    removeVertex: function(idx) {\n\n        var vertices = _.clone(this.model.get('vertices'));\n        \n        if (vertices && vertices.length) {\n\n            vertices.splice(idx, 1);\n            this.model.set('vertices', vertices);\n        }\n\n        return this;\n    },\n\n    // This method ads a new vertex to the `vertices` array of `.connection`. This method\n    // uses a heuristic to find the index at which the new `vertex` should be placed at assuming\n    // the new vertex is somewhere on the path.\n    addVertex: function(vertex) {\n\n        this.model.set('attrs', this.model.get('attrs') || {});\n        var attrs = this.model.get('attrs');\n        \n        // As it is very hard to find a correct index of the newly created vertex,\n        // a little heuristics is taking place here.\n        // The heuristics checks if length of the newly created\n        // path is lot more than length of the old path. If this is the case,\n        // new vertex was probably put into a wrong index.\n        // Try to put it into another index and repeat the heuristics again.\n\n        var vertices = (this.model.get('vertices') || []).slice();\n        // Store the original vertices for a later revert if needed.\n        var originalVertices = vertices.slice();\n\n        // A `<path>` element used to compute the length of the path during heuristics.\n        var path = this._V.connection.node.cloneNode(false);\n        \n        // Length of the original path.        \n        var originalPathLength = path.getTotalLength();\n        // Current path length.\n        var pathLength;\n        // Tolerance determines the highest possible difference between the length\n        // of the old and new path. The number has been chosen heuristically.\n        var pathLengthTolerance = 20;\n        // Total number of vertices including source and target points.\n        var idx = vertices.length + 1;\n\n        // Loop through all possible indexes and check if the difference between\n        // path lengths changes significantly. If not, the found index is\n        // most probably the right one.\n        while (idx--) {\n\n            vertices.splice(idx, 0, vertex);\n            V(path).attr('d', this.getPathData(vertices));\n\n            pathLength = path.getTotalLength();\n\n            // Check if the path lengths changed significantly.\n            if (pathLength - originalPathLength > pathLengthTolerance) {\n\n                // Revert vertices to the original array. The path length has changed too much\n                // so that the index was not found yet.\n                vertices = originalVertices.slice();\n                \n            } else {\n\n                break;\n            }\n        }\n\n        this.model.set('vertices', vertices);\n\n        // In manhattan routing, if there are no vertices, the path length changes significantly\n        // with the first vertex added. Shall we check vertices.length === 0? at beginning of addVertex()\n        // in order to avoid the temporary path construction and other operations?\n        return Math.max(idx, 0);\n    },\n\n    // Return the `d` attribute value of the `<path>` element representing the link between `source` and `target`.\n    getPathData: function(vertices) {\n\n        var sourcePoint = g.point(this._sourcePoint);\n        var targetPoint = g.point(this._targetPoint);\n\n        // Move the source point by the width of the marker taking into account its scale around x-axis.\n        // Note that scale is the only transform that makes sense to be set in `.marker-source` attributes object\n        // as all other transforms (translate/rotate) will be replaced by the `translateAndAutoOrient()` function.\n\n        if (this._V.markerSource) {\n            this._markerSourceBbox = this._markerSourceBbox || this._V.markerSource.bbox(true);\n            sourcePoint.move(\n                this._firstVertex || targetPoint,\n                this._markerSourceBbox.width * -this._V.markerSource.scale().sx\n            );\n        }\n\n        if (this._V.markerTarget) {\n            this._markerTargetBbox = this._markerTargetBbox || this._V.markerTarget.bbox(true);\n            targetPoint.move(\n                this._lastVertex || sourcePoint,\n                this._markerTargetBbox.width * -this._V.markerTarget.scale().sx\n            );\n        }\n\n        var d;\n        if (this.model.get('smooth')) {\n\n            if (vertices && vertices.length) {\n                d = g.bezier.curveThroughPoints([sourcePoint].concat(vertices || []).concat([targetPoint]));\n            } else {\n                // if we have no vertices use a default cubic bezier curve, cubic bezier requires two control points.\n                // the two control points are both defined with X as mid way between the source and target points.\n                // sourceControlPoint Y is equal to sourcePoint Y and targetControlPointY being equal to targetPointY.\n                // handle situation were sourcePointX is greater or less then targetPointX.\n                var controlPointX = (sourcePoint.x < targetPoint.x) \n                    ? targetPoint.x - ((targetPoint.x - sourcePoint.x) / 2)\n                    : sourcePoint.x - ((sourcePoint.x - targetPoint.x) / 2);\n                    d = ['M', sourcePoint.x, sourcePoint.y, 'C', controlPointX, sourcePoint.y, controlPointX, targetPoint.y, targetPoint.x, targetPoint.y];\n            }\n            \n        } else {\n            \n            // Construct the `d` attribute of the `<path>` element.\n            d = ['M', sourcePoint.x, sourcePoint.y];\n            _.each(vertices, function(vertex) {\n\n                d.push(vertex.x, vertex.y);\n            });\n            d.push(targetPoint.x, targetPoint.y);\n        }\n\n        return d.join(' ');\n    },\n\n    // Find a point that is the start of the connection.\n    // If `selectorOrPoint` is a point, then we're done and that point is the start of the connection.\n    // If the `selectorOrPoint` is an element however, we need to know a reference point (or element)\n    // that the link leads to in order to determine the start of the connection on the original element.\n    getConnectionPoint: function(end, selectorOrPoint, referenceSelectorOrPoint) {\n\n        var spot;\n\n        if (this._isPoint(selectorOrPoint)) {\n\n            // If the source is a point, we don't need a reference point to find the sticky point of connection.\n            spot = g.point(selectorOrPoint);\n\n        } else {\n\n            // If the source is an element, we need to find a point on the element boundary that is closest\n            // to the reference point (or reference element).\n            // Get the bounding box of the spot relative to the paper viewport. This is necessary\n            // in order to follow paper viewport transformations (scale/rotate).\n            // `_sourceBbox` (`_targetBbox`) comes from `_sourceBboxUpdate` (`_sourceBboxUpdate`)\n            // method, it exists since first render and are automatically updated\n            var spotBbox = end === 'source' ? this._sourceBbox : this._targetBbox;\n            \n            var reference;\n            \n            if (this._isPoint(referenceSelectorOrPoint)) {\n\n                // Reference was passed as a point, therefore, we're ready to find the sticky point of connection on the source element.\n                reference = g.point(referenceSelectorOrPoint);\n\n            } else {\n\n                // Reference was passed as an element, therefore we need to find a point on the reference\n                // element boundary closest to the source element.\n                // Get the bounding box of the spot relative to the paper viewport. This is necessary\n                // in order to follow paper viewport transformations (scale/rotate).\n                var referenceBbox = end === 'source' ? this._targetBbox : this._sourceBbox;\n\n                reference = g.rect(referenceBbox).intersectionWithLineFromCenterToPoint(g.rect(spotBbox).center());\n                reference = reference || g.rect(referenceBbox).center();\n            }\n\n            // If `perpendicularLinks` flag is set on the paper and there are vertices\n            // on the link, then try to find a connection point that makes the link perpendicular\n            // even though the link won't point to the center of the targeted object.\n            if (this.paper.options.perpendicularLinks) {\n\n                var horizontalLineRect = g.rect(0, reference.y, this.paper.options.width, 1);\n                var verticalLineRect = g.rect(reference.x, 0, 1, this.paper.options.height);\n                var nearestSide;\n\n                if (horizontalLineRect.intersect(g.rect(spotBbox))) {\n\n                    nearestSide = g.rect(spotBbox).sideNearestToPoint(reference);\n                    switch (nearestSide) {\n                      case 'left':\n                        spot = g.point(spotBbox.x, reference.y);\n                        break;\n                      case 'right':\n                        spot = g.point(spotBbox.x + spotBbox.width, reference.y);\n                        break;\n                    default:\n                        spot = g.rect(spotBbox).center();\n                        break;\n                    }\n                    \n                } else if (verticalLineRect.intersect(g.rect(spotBbox))) {\n\n                    nearestSide = g.rect(spotBbox).sideNearestToPoint(reference);\n                    switch (nearestSide) {\n                      case 'top':\n                        spot = g.point(reference.x, spotBbox.y);\n                        break;\n                      case 'bottom':\n                        spot = g.point(reference.x, spotBbox.y + spotBbox.height);\n                        break;\n                    default:\n                        spot = g.rect(spotBbox).center();\n                        break;\n                    }\n                    \n                } else {\n\n                    // If there is no intersection horizontally or vertically with the object bounding box,\n                    // then we fall back to the regular situation finding straight line (not perpendicular)\n                    // between the object and the reference point.\n\n                    spot = g.rect(spotBbox).intersectionWithLineFromCenterToPoint(reference);\n                    spot = spot || g.rect(spotBbox).center();\n                }\n                \n            } else {\n            \n                spot = g.rect(spotBbox).intersectionWithLineFromCenterToPoint(reference);\n                spot = spot || g.rect(spotBbox).center();\n            }\n        }\n\n        return spot;\n    },\n\n    _isModel: function(end) {\n\n        return end && end.id;\n    },\n\n    _isPoint: function(end) {\n\n        return !this._isModel(end);\n    },\n\n    _makeSelector: function(end) {\n\n        var selector = '[model-id=\"' + end.id + '\"]';\n        // `port` has a higher precendence over `selector`. This is because the selector to the magnet\n        // might change while the name of the port can stay the same.\n        if (end.port) {\n            selector += ' [port=\"' + end.port + '\"]';\n        } else if (end.selector) {\n            selector += ' ' + end.selector;\n        }\n\n        return selector;\n    },\n\n    // Return points that one needs to draw a connection through in order to have a manhattan link routing from\n    // source to target going through `vertices`.\n    findManhattanRoute: function(vertices) {\n\n        vertices = (vertices || []).slice();\n        var manhattanVertices = [];\n\n        // Return the direction that one would have to take traveling from `p1` to `p2`.\n        // This function assumes the line between `p1` and `p2` is orthogonal.\n        function direction(p1, p2) {\n            \n            if (p1.y < p2.y && p1.x === p2.x) {\n                return 'down';\n            } else if (p1.y > p2.y && p1.x === p2.x) {\n                return 'up';\n            } else if (p1.x < p2.x && p1.y === p2.y) {\n                return 'right';\n            }\n            return 'left';\n        }\n        \n        function bestDirection(p1, p2, preferredDirection) {\n\n            var directions;\n\n            // This branching determines possible directions that one can take to travel\n            // from `p1` to `p2`.\n            if (p1.x < p2.x) {\n                \n                if (p1.y > p2.y) { directions = ['up', 'right']; }\n                else if (p1.y < p2.y) { directions = ['down', 'right']; }\n                else { directions = ['right']; }\n                \n            } else if (p1.x > p2.x) {\n                \n                if (p1.y > p2.y) { directions = ['up', 'left']; }\n                else if (p1.y < p2.y) { directions = ['down', 'left']; }\n                else { directions = ['left']; }\n                \n            } else {\n                \n                if (p1.y > p2.y) { directions = ['up']; }\n                else { directions = ['down']; }\n            }\n            \n            if (_.contains(directions, preferredDirection)) {\n                return preferredDirection;\n            }\n            \n            var direction = _.first(directions);\n\n            // Should the direction be the exact opposite of the preferred direction,\n            // try another one if such direction exists.\n            switch (preferredDirection) {\n              case 'down': if (direction === 'up') return _.last(directions); break;\n              case 'up': if (direction === 'down') return _.last(directions); break;\n              case 'left': if (direction === 'right') return _.last(directions); break;\n              case 'right': if (direction === 'left') return _.last(directions); break;\n            }\n            return direction;\n        }\n        \n        // Find a vertex in between the vertices `p1` and `p2` so that the route between those vertices\n        // is orthogonal. Prefer going the direction determined by `preferredDirection`.\n        function findMiddleVertex(p1, p2, preferredDirection) {\n            \n            var direction = bestDirection(p1, p2, preferredDirection);\n            if (direction === 'down' || direction === 'up') {\n                return { x: p1.x, y: p2.y, d: direction };\n            }\n            return { x: p2.x, y: p1.y, d: direction };\n        }\n\n        var sourceCenter = g.rect(this._sourceBbox).center();\n        var targetCenter = g.rect(this._targetBbox).center();\n\n        vertices.unshift(sourceCenter);\n        vertices.push(targetCenter);\n\n        var manhattanVertex;\n        var lastManhattanVertex;\n        var vertex;\n        var nextVertex;\n\n        // For all the pairs of link model vertices...\n        for (var i = 0; i < vertices.length - 1; i++) {\n\n            vertex = vertices[i];\n            nextVertex = vertices[i + 1];\n            lastManhattanVertex = _.last(manhattanVertices);\n            \n            if (i > 0) {\n                // Push all the link vertices to the manhattan route.\n                manhattanVertex = vertex;\n                // Determine a direction between the last vertex and the new one.\n                // Therefore, each vertex contains the `d` property describing the direction that one\n                // would have to take to travel to that vertex.\n                manhattanVertex.d = lastManhattanVertex ? direction(lastManhattanVertex, vertex) : 'top';\n                manhattanVertices.push(manhattanVertex);\n                lastManhattanVertex = manhattanVertex;\n            }\n\n            // Make sure that we don't create a vertex that would go the opposite direction then that of the\n            // previous one. Othwerwise, a 'spike' segment would be created which is not desirable.\n            // Find a dummy vertex to keep the link orthogonal. Preferably, take the same direction\n            // as the previous one.\n            var d = lastManhattanVertex && lastManhattanVertex.d;\n            manhattanVertex = findMiddleVertex(vertex, nextVertex, d);\n\n            // Do not add a new vertex that is the same as one of the vertices already added.\n            if (!g.point(manhattanVertex).equals(g.point(vertex)) && !g.point(manhattanVertex).equals(g.point(nextVertex))) {\n\n                manhattanVertices.push(manhattanVertex);\n            }\n        }\n        return manhattanVertices;\n    },\n\n    // Public API\n    // ----------\n\n    getConnectionLength: function() {\n\n        return this._V.connection.node.getTotalLength();\n    },\n\n    getPointAtLength: function(length) {\n\n        return this._V.connection.node.getPointAtLength(length);\n    },\n\n    // Interaction. The controller part.\n    // ---------------------------------\n\n    _beforeArrowheadMove: function() {\n\n        this.model.trigger('batch:start');\n\n        this._z = this.model.get('z');\n        this.model.set('z', Number.MAX_VALUE);\n\n        // Let the pointer propagate throught the link view elements so that\n        // the `evt.target` is another element under the pointer, not the link itself.\n        this.el.style.pointerEvents = 'none';\n    },\n\n    _afterArrowheadMove: function() {\n\n        if (this._z) {\n            this.model.set('z', this._z);\n            delete this._z;\n        }\n\n        // Put `pointer-events` back to its original value. See `startArrowheadMove()` for explanation.\n\t// Value `auto` doesn't work in IE9. We force to use `visiblePainted` instead.\n\t// See `https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events`.\n        this.el.style.pointerEvents = 'visiblePainted';\n\n        this.model.trigger('batch:stop');\n    },\n\n    _createValidateConnectionArgs: function(arrowhead) {\n        // It makes sure the arguments for validateConnection have the following form:\n        // (source view, source magnet, target view, target magnet and link view)\n        var args = [];\n\n        args[4] = arrowhead;\n        args[5] = this;\n\n        var oppositeArrowhead, i = 0, j = 0;\n\n        if (arrowhead === 'source') {\n            i = 2;\n            oppositeArrowhead = 'target';\n        } else {\n            j = 2;\n            oppositeArrowhead = 'source';\n        }\n\n        var end = this.model.get(oppositeArrowhead);\n\n        if (end.id) {\n            args[i] = this.paper.findViewByModel(end.id)\n            args[i+1] = end.selector && args[i].el.querySelector(end.selector);\n        }\n\n        function validateConnectionArgs(cellView, magnet) {\n            args[j] = cellView;\n            args[j+1] = cellView.el === magnet ? undefined : magnet;\n            return args;\n        }\n\n        return validateConnectionArgs;\n    },\n\n    startArrowheadMove: function(end) {\n        // Allow to delegate events from an another view to this linkView in order to trigger arrowhead\n        // move without need to click on the actual arrowhead dom element.\n        this._action = 'arrowhead-move';\n        this._arrowhead = end;\n        this._beforeArrowheadMove();\n        this._validateConnectionArgs = this._createValidateConnectionArgs(this._arrowhead);\n    },\n\n    pointerdown: function(evt, x, y) {\n\n        joint.dia.CellView.prototype.pointerdown.apply(this, arguments);\n\n\tthis._dx = x;\n        this._dy = y;\n\n        if (this.options.interactive === false) return;\n\n        var className = evt.target.getAttribute('class');\n\n        switch (className) {\n\n        case 'marker-vertex':\n            this._action = 'vertex-move';\n            this._vertexIdx = evt.target.getAttribute('idx');\n            break;\n\n        case 'marker-vertex-remove':\n        case 'marker-vertex-remove-area':\n            this.removeVertex(evt.target.getAttribute('idx'));\n            break;\n\n        case 'marker-arrowhead':\n            this.startArrowheadMove(evt.target.getAttribute('end'));\n            break;\n\n        default:\n\n            var targetParentEvent = evt.target.parentNode.getAttribute('event');\n\n            if (targetParentEvent) {\n\n                // `remove` event is built-in. Other custom events are triggered on the paper.\n                if (targetParentEvent === 'remove') {\n                    this.model.remove();\n                } else {\n                    this.paper.trigger(targetParentEvent, evt, this, x, y);\n                }\n\n            } else {\n\n                // Store the index at which the new vertex has just been placed.\n                // We'll be update the very same vertex position in `pointermove()`.\n                this._vertexIdx = this.addVertex({ x: x, y: y });\n                this._action = 'vertex-move';\n            }\n        }\n    },\n\n    pointermove: function(evt, x, y) {\n\n        joint.dia.CellView.prototype.pointermove.apply(this, arguments);\n\n        switch (this._action) {\n\n          case 'vertex-move':\n\n            var vertices = _.clone(this.model.get('vertices'));\n            vertices[this._vertexIdx] = { x: x, y: y };\n            this.model.set('vertices', vertices);\n            break;\n\n          case 'arrowhead-move':\n\n            if (this.paper.options.snapLinks) {\n\n                // checking view in close area of the pointer\n\n                var r = this.paper.options.snapLinks.radius || 50;\n                var viewsInArea = this.paper.findViewsInArea({ x: x - r, y: y - r, width: 2 * r, height: 2 * r });\n\n                this._closestView && this._closestView.unhighlight(this._closestEnd.selector);\n                this._closestView = this._closestEnd = null;\n\n                var pointer = g.point(x,y);\n                var distance, minDistance = Number.MAX_VALUE;\n\n                _.each(viewsInArea, function(view) {\n\n                    // skip connecting to the element in case '.': { magnet: false } attribute present\n                    if (view.el.getAttribute('magnet') !== 'false') {\n\n                        // find distance from the center of the model to pointer coordinates\n                        distance = view.model.getBBox().center().distance(pointer);\n\n                        // the connection is looked up in a circle area by `distance < r`\n                        if (distance < r && distance < minDistance) {\n\n                            if (this.paper.options.validateConnection.apply(\n                                this.paper, this._validateConnectionArgs(view, null)\n                            )) {\n                                minDistance = distance;\n                                this._closestView = view;\n                                this._closestEnd = { id: view.model.id };\n                            }\n                        }\n                    }\n\n                    view.$('[magnet]').each(_.bind(function(index, magnet) {\n\n                        var bbox = V(magnet).bbox(false, this.paper.viewport);\n\n                        distance = pointer.distance({\n                            x: bbox.x + bbox.width / 2,\n                            y: bbox.y + bbox.height / 2\n                        });\n\n                        if (distance < r && distance < minDistance) {\n\n                            if (this.paper.options.validateConnection.apply(\n                                this.paper, this._validateConnectionArgs(view, magnet)\n                            )) {\n                                minDistance = distance;\n                                this._closestView = view;\n                                this._closestEnd = {\n                                    id: view.model.id,\n                                    selector: view.getSelector(magnet),\n                                    port: magnet.getAttribute('port')\n                                }\n                            }\n                        }\n\n                    }, this));\n\n                }, this);\n\n                this._closestView && this._closestView.highlight(this._closestEnd.selector);\n\n                this.model.set(this._arrowhead, this._closestEnd || { x: x, y: y });\n\n            } else {\n\n                // checking views right under the pointer\n\n                // Touchmove event's target is not reflecting the element under the coordinates as mousemove does.\n                // It holds the element when a touchstart triggered.\n                var target = (evt.type === 'mousemove')\n                    ? evt.target\n                    : document.elementFromPoint(evt.clientX, evt.clientY)\n\n                if (this._targetEvent !== target) {\n                    // Unhighlight the previous view under pointer if there was one.\n                    this._magnetUnderPointer && this._viewUnderPointer.unhighlight(this._magnetUnderPointer);\n                    this._viewUnderPointer = this.paper.findView(target);\n                    if (this._viewUnderPointer) {\n                        // If we found a view that is under the pointer, we need to find the closest\n                        // magnet based on the real target element of the event.\n                        this._magnetUnderPointer = this._viewUnderPointer.findMagnet(target);\n\n                        if (this._magnetUnderPointer && this.paper.options.validateConnection.apply(\n                            this.paper,\n                            this._validateConnectionArgs(this._viewUnderPointer, this._magnetUnderPointer)\n                        )) {\n                            // If there was no magnet found, do not highlight anything and assume there\n                            // is no view under pointer we're interested in reconnecting to.\n                            // This can only happen if the overall element has the attribute `'.': { magnet: false }`.\n                            this._magnetUnderPointer && this._viewUnderPointer.highlight(this._magnetUnderPointer);\n                        } else {\n                            // This type of connection is not valid. Disregard this magnet.\n                            this._magnetUnderPointer = null;\n                        }\n                    } else {\n                        // Make sure we'll delete previous magnet\n                        this._magnetUnderPointer = null;\n                    }\n                }\n\n\t        this._targetEvent = target;\n\n                this.model.set(this._arrowhead, { x: x, y: y });\n            }\n\n            break;\n        }\n\n        this._dx = x;\n        this._dy = y;\n    },\n\n    pointerup: function(evt) {\n\n        joint.dia.CellView.prototype.pointerup.apply(this, arguments);\n\n        if (this._action === 'arrowhead-move') {\n\n            if (this.paper.options.snapLinks) {\n\n                this._closestView && this._closestView.unhighlight(this._closestEnd.selector);\n                this._closestView = this._closestEnd = null;\n\n            } else {\n\n                if (this._magnetUnderPointer) {\n                    this._viewUnderPointer.unhighlight(this._magnetUnderPointer);\n                    // Find a unique `selector` of the element under pointer that is a magnet. If the\n                    // `this._magnetUnderPointer` is the root element of the `this._viewUnderPointer` itself,\n                    // the returned `selector` will be `undefined`. That means we can directly pass it to the\n                    // `source`/`target` attribute of the link model below.\n\t\t    this.model.set(this._arrowhead, {\n                        id: this._viewUnderPointer.model.id,\n                        selector: this._viewUnderPointer.getSelector(this._magnetUnderPointer),\n                        port: $(this._magnetUnderPointer).attr('port')\n                    });\n                }\n\n                delete this._viewUnderPointer;\n                delete this._magnetUnderPointer;\n                delete this._staticView;\n                delete this._staticMagnet;\n            }\n\n            this._afterArrowheadMove();\n        }\n\n        delete this._action;\n    }\n});\n\n\nif (typeof exports === 'object') {\n\n    module.exports.Link = joint.dia.Link;\n    module.exports.LinkView = joint.dia.LinkView;\n}\n//      JointJS library.\n//      (c) 2011-2013 client IO\n\n\njoint.dia.Paper = Backbone.View.extend({\n\n    options: {\n\n        width: 800,\n        height: 600,\n        gridSize: 50,\n        perpendicularLinks: false,\n        elementView: joint.dia.ElementView,\n        linkView: joint.dia.LinkView,\n        snapLinks: false, // false, true, { radius: value }\n\n        // Defines what link model is added to the graph after an user clicks on an active magnet.\n        // Value could be the Backbone.model or a function returning the Backbone.model\n        // defaultLink: function(elementView, magnet) { return condition ? new customLink1() : new customLink2() }\n        defaultLink: new joint.dia.Link,\n\n        // Check whether to add a new link to the graph when user clicks on an a magnet.\n        validateMagnet: function(cellView, magnet) {\n            return magnet.getAttribute('magnet') !== 'passive';\n        },\n\n        // Check whether to allow or disallow the link connection while an arrowhead end (source/target)\n        // being changed.\n        validateConnection: function(cellViewS, magnetS, cellViewT, magnetT, end, linkView) {\n            return (end === 'target' ? cellViewT : cellViewS) instanceof joint.dia.ElementView;\n        }\n    },\n\n    events: {\n\n        'mousedown': 'pointerdown',\n        'dblclick': 'mousedblclick',\n        'touchstart': 'pointerdown',\n        'mousemove': 'pointermove',\n        'touchmove': 'pointermove'\n    },\n\n    initialize: function() {\n\n        _.bindAll(this, 'addCell', 'sortCells', 'resetCells', 'pointerup');\n\n        this.svg = V('svg').node;\n        this.viewport = V('g').node;\n\n        // Append `<defs>` element to the SVG document. This is useful for filters and gradients.\n        V(this.svg).append(V('defs').node);\n\n        V(this.viewport).attr({ 'class': 'viewport' });\n        \n        V(this.svg).append(this.viewport);\n\n        this.$el.append(this.svg);\n\n        this.setDimensions();\n\n\tthis.listenTo(this.model, 'add', this.addCell);\n\tthis.listenTo(this.model, 'reset', this.resetCells);\n\tthis.listenTo(this.model, 'sort', this.sortCells);\n\n\t$(document).on('mouseup touchend', this.pointerup);\n    },\n\n    remove: function() {\n\n\t$(document).off('mouseup touchend', this.pointerup);\n\n\tBackbone.View.prototype.remove.call(this);\n    },\n\n    setDimensions: function(width, height) {\n\n        if (width) this.options.width = width;\n        if (height) this.options.height = height;\n        \n        V(this.svg).attr('width', this.options.width);\n        V(this.svg).attr('height', this.options.height);\n\n\tthis.trigger('resize');\n    },\n\n    // Expand/shrink the paper to fit the content. Snap the width/height to the grid\n    // defined in `gridWidth`, `gridHeight`. `padding` adds to the resulting width/height of the paper.\n    fitToContent: function(gridWidth, gridHeight, padding) {\n\n\tgridWidth = gridWidth || 1;\n\tgridHeight = gridHeight || 1;\n        padding = padding || 0;\n\n\t// Calculate the paper size to accomodate all the graph's elements.\n\tvar bbox = V(this.viewport).bbox(true, this.svg);\n\n\tvar calcWidth = Math.ceil((bbox.width + bbox.x) / gridWidth) * gridWidth;\n\tvar calcHeight = Math.ceil((bbox.height + bbox.y) / gridHeight) * gridHeight;\n\n        calcWidth += padding;\n        calcHeight += padding;\n        \n\t// Change the dimensions only if there is a size discrepency\n\tif (calcWidth != this.options.width || calcHeight != this.options.height) {\n\t    this.setDimensions(calcWidth || this.options.width , calcHeight || this.options.height);\n\t}\n    },\n\n    getContentBBox: function() {\n\n        var crect = this.viewport.getBoundingClientRect();\n\n        // Using Screen CTM was the only way to get the real viewport bounding box working in both\n        // Google Chrome and Firefox.\n        var ctm = this.viewport.getScreenCTM();\n\n        var bbox = g.rect(Math.abs(crect.left - ctm.e), Math.abs(crect.top - ctm.f), crect.width, crect.height);\n\n        return bbox;\n    },\n\n    createViewForModel: function(cell) {\n\n        var view;\n        \n        var type = cell.get('type');\n        var module = type.split('.')[0];\n        var entity = type.split('.')[1];\n\n        // If there is a special view defined for this model, use that one instead of the default `elementView`/`linkView`.\n        if (joint.shapes[module] && joint.shapes[module][entity + 'View']) {\n\n            view = new joint.shapes[module][entity + 'View']({ model: cell, interactive: this.options.interactive });\n            \n        } else if (cell instanceof joint.dia.Element) {\n                \n            view = new this.options.elementView({ model: cell, interactive: this.options.interactive });\n\n        } else {\n\n            view = new this.options.linkView({ model: cell, interactive: this.options.interactive });\n        }\n\n        return view;\n    },\n    \n    addCell: function(cell) {\n\n        var view = this.createViewForModel(cell);\n\n        V(this.viewport).append(view.el);\n        view.paper = this;\n        view.render();\n\n        // This is the only way to prevent image dragging in Firefox that works.\n        // Setting -moz-user-select: none, draggable=\"false\" attribute or user-drag: none didn't help.\n        $(view.el).find('image').on('dragstart', function() { return false; });\n    },\n\n    resetCells: function(cellsCollection) {\n\n        $(this.viewport).empty();\n\n        var cells = cellsCollection.models.slice();\n\n        // Make sure links are always added AFTER elements.\n        // They wouldn't find their sources/targets in the DOM otherwise.\n        cells.sort(function(a, b) { return a instanceof joint.dia.Link ? 1 : -1; });\n        \n        _.each(cells, this.addCell, this);\n\n        // Sort the cells in the DOM manually as we might have changed the order they\n        // were added to the DOM (see above).\n        this.sortCells();\n    },\n\n    sortCells: function() {\n\n        // Run insertion sort algorithm in order to efficiently sort DOM elements according to their\n        // associated model `z` attribute.\n\n        var $cells = $(this.viewport).children('[model-id]');\n        var cells = this.model.get('cells');\n\n        // Using the jquery.sortElements plugin by Padolsey.\n        // See http://james.padolsey.com/javascript/sorting-elements-with-jquery/.\n        $cells.sortElements(function(a, b) {\n\n            var cellA = cells.get($(a).attr('model-id'));\n            var cellB = cells.get($(b).attr('model-id'));\n            \n            return (cellA.get('z') || 0) > (cellB.get('z') || 0) ? 1 : -1;\n        });\n    },\n\n    scale: function(sx, sy, ox, oy) {\n\n        if (!ox) {\n\n            ox = 0;\n            oy = 0;\n        }\n\n        // Remove previous transform so that the new scale is not affected by previous scales, especially\n        // the old translate() does not affect the new translate if an origin is specified.\n        V(this.viewport).attr('transform', '');\n        \n        // TODO: V.scale() doesn't support setting scale origin. #Fix        \n        if (ox || oy) {\n            V(this.viewport).translate(-ox * (sx - 1), -oy * (sy - 1));\n        }\n        \n        V(this.viewport).scale(sx, sy);\n\n\tthis.trigger('scale', ox, oy);\n\n        return this;\n    },\n\n    rotate: function(deg, ox, oy) {\n        \n        // If the origin is not set explicitely, rotate around the center. Note that\n        // we must use the plain bounding box (`this.el.getBBox()` instead of the one that gives us\n        // the real bounding box (`bbox()`) including transformations).\n        if (_.isUndefined(ox)) {\n\n            var bbox = this.viewport.getBBox();\n            ox = bbox.width/2;\n            oy = bbox.height/2;\n        }\n\n        V(this.viewport).rotate(deg, ox, oy);\n    },\n\n    // Find the first view climbing up the DOM tree starting at element `el`. Note that `el` can also\n    // be a selector or a jQuery object.\n    findView: function(el) {\n\n        var $el = this.$(el);\n\n        if ($el.length === 0 || $el[0] === this.el) {\n\n            return undefined;\n        }\n\n        if ($el.data('view')) {\n\n            return $el.data('view');\n        }\n\n        return this.findView($el.parent());\n    },\n\n    // Find a view for a model `cell`. `cell` can also be a string representing a model `id`.\n    findViewByModel: function(cell) {\n\n        var id = _.isString(cell) ? cell : cell.id;\n        \n        var $view = this.$('[model-id=\"' + id + '\"]');\n        if ($view.length) {\n\n            return $view.data('view');\n        }\n        return undefined;\n    },\n\n    // Find all views at given point\n    findViewsFromPoint: function(p) {\n\n\tp = g.point(p);\n\n        var views = _.map(this.model.getElements(), this.findViewByModel);\n\n\treturn _.filter(views, function(view) {\n\t    return g.rect(V(view.el).bbox(false, this.viewport)).containsPoint(p);\n\t}, this);\n    },\n\n    // Find all views in given area\n    findViewsInArea: function(r) {\n\n\tr = g.rect(r);\n\n        var views = _.map(this.model.getElements(), this.findViewByModel);\n\n\treturn _.filter(views, function(view) {\n\t    return r.intersect(g.rect(V(view.el).bbox(false, this.viewport)));\n\t}, this);\n    },\n\n    getModelById: function(id) {\n\n        return this.model.getCell(id);\n    },\n\n    snapToGrid: function(p) {\n\n        // Convert global coordinates to the local ones of the `viewport`. Otherwise,\n        // improper transformation would be applied when the viewport gets transformed (scaled/rotated). \n        var localPoint = V(this.viewport).toLocalPoint(p.x, p.y);\n\n        return {\n            x: g.snapToGrid(localPoint.x, this.options.gridSize),\n            y: g.snapToGrid(localPoint.y, this.options.gridSize)\n        };\n    },\n\n    getDefaultLink: function(cellView, magnet) {\n\n        return _.isFunction(this.options.defaultLink)\n        // default link is a function producing link model\n            ? this.options.defultLink.call(this, cellView, magnet)\n        // default link is the Backbone model\n            : this.options.defaultLink.clone();\n    },\n\n    // Interaction.\n    // ------------\n\n    mousedblclick: function(evt) {\n        \n        evt.preventDefault();\n        evt = joint.util.normalizeEvent(evt);\n        \n        var view = this.findView(evt.target);\n        var localPoint = this.snapToGrid({ x: evt.clientX, y: evt.clientY });\n\n        if (view) {\n            \n            view.pointerdblclick(evt, localPoint.x, localPoint.y);\n            \n        } else {\n            \n            this.trigger('blank:pointerdblclick', evt, localPoint.x, localPoint.y);\n        }\n    },\n\n    pointerdown: function(evt) {\n\n        evt.preventDefault();\n        evt = joint.util.normalizeEvent(evt);\n        \n        var view = this.findView(evt.target);\n\n        var localPoint = this.snapToGrid({ x: evt.clientX, y: evt.clientY });\n        \n        if (view) {\n\n            this.sourceView = view;\n\n            view.pointerdown(evt, localPoint.x, localPoint.y);\n            \n        } else {\n\n            this.trigger('blank:pointerdown', evt, localPoint.x, localPoint.y);\n        }\n    },\n\n    pointermove: function(evt) {\n\n        evt.preventDefault();\n        evt = joint.util.normalizeEvent(evt);\n\n        if (this.sourceView) {\n\n            var localPoint = this.snapToGrid({ x: evt.clientX, y: evt.clientY });\n\n            this.sourceView.pointermove(evt, localPoint.x, localPoint.y);\n        }\n    },\n\n    pointerup: function(evt) {\n\n        evt = joint.util.normalizeEvent(evt);\n\n        var localPoint = this.snapToGrid({ x: evt.clientX, y: evt.clientY });\n        \n        if (this.sourceView) {\n\n            this.sourceView.pointerup(evt, localPoint.x, localPoint.y);\n\n            //\"delete sourceView\" occasionally throws an error in chrome (illegal access exception)\n\t    this.sourceView = null;\n\n        } else {\n\n            this.trigger('blank:pointerup', evt, localPoint.x, localPoint.y);\n        }\n    }\n});\n\n//      JointJS library.\n//      (c) 2011-2013 client IO\n\n\nif (typeof exports === 'object') {\n\n    var joint = {\n        util: require('../src/core').util,\n        shapes: {},\n        dia: {\n            Element: require('../src/joint.dia.element').Element\n        }\n    };\n    var _ = require('lodash');\n}\n\n\njoint.shapes.basic = {};\n\n\njoint.shapes.basic.Generic = joint.dia.Element.extend({\n\n    defaults: joint.util.deepSupplement({\n        \n        type: 'basic.Generic',\n        attrs: {\n            '.': { fill: '#FFFFFF', stroke: 'none' }\n        }\n        \n    }, joint.dia.Element.prototype.defaults)\n});\n\njoint.shapes.basic.Rect = joint.shapes.basic.Generic.extend({\n\n    markup: '<g class=\"rotatable\"><g class=\"scalable\"><rect/></g><text/></g>',\n    \n    defaults: joint.util.deepSupplement({\n    \n        type: 'basic.Rect',\n        attrs: {\n            'rect': { fill: '#FFFFFF', stroke: 'black', width: 100, height: 60 },\n            'text': { 'font-size': 14, text: '', 'ref-x': .5, 'ref-y': .5, ref: 'rect', 'y-alignment': 'middle', 'x-alignment': 'middle', fill: 'black', 'font-family': 'Arial, helvetica, sans-serif' }\n        }\n        \n    }, joint.shapes.basic.Generic.prototype.defaults)\n});\n\njoint.shapes.basic.Text = joint.shapes.basic.Generic.extend({\n\n    markup: '<g class=\"rotatable\"><g class=\"scalable\"><text/></g></g>',\n    \n    defaults: joint.util.deepSupplement({\n        \n        type: 'basic.Text',\n        attrs: {\n            'text': { 'font-size': 18, fill: 'black' }\n        }\n        \n    }, joint.shapes.basic.Generic.prototype.defaults)\n});\n\njoint.shapes.basic.Circle = joint.shapes.basic.Generic.extend({\n\n    markup: '<g class=\"rotatable\"><g class=\"scalable\"><circle/></g><text/></g>',\n    \n    defaults: joint.util.deepSupplement({\n\n        type: 'basic.Circle',\n        size: { width: 60, height: 60 },\n        attrs: {\n            'circle': { fill: '#FFFFFF', stroke: 'black', r: 30, transform: 'translate(30, 30)' },\n            'text': { 'font-size': 14, text: '', 'text-anchor': 'middle', 'ref-x': .5, 'ref-y': .5, ref: 'circle', 'y-alignment': 'middle', fill: 'black', 'font-family': 'Arial, helvetica, sans-serif' }\n        }\n    }, joint.shapes.basic.Generic.prototype.defaults)\n});\n\njoint.shapes.basic.Image = joint.shapes.basic.Generic.extend({\n\n    markup: '<g class=\"rotatable\"><g class=\"scalable\"><image/></g><text/></g>',\n    \n    defaults: joint.util.deepSupplement({\n\n        type: 'basic.Image',\n        attrs: {\n            'text': { 'font-size': 14, text: '', 'text-anchor': 'middle', 'ref-x': .5, 'ref-dy': 20, ref: 'image', 'y-alignment': 'middle', fill: 'black', 'font-family': 'Arial, helvetica, sans-serif' }\n        }\n    }, joint.shapes.basic.Generic.prototype.defaults)\n});\n\njoint.shapes.basic.Path = joint.shapes.basic.Generic.extend({\n\n    markup: '<g class=\"rotatable\"><g class=\"scalable\"><path/></g><text/></g>',\n    \n    defaults: joint.util.deepSupplement({\n\n        type: 'basic.Path',\n        size: { width: 60, height: 60 },\n        attrs: {\n            'path': { fill: '#FFFFFF', stroke: 'black' },\n            'text': { 'font-size': 14, text: '', 'text-anchor': 'middle', 'ref-x': .5, 'ref-dy': 20, ref: 'path', 'y-alignment': 'middle', fill: 'black', 'font-family': 'Arial, helvetica, sans-serif' }\n        }\n    }, joint.shapes.basic.Generic.prototype.defaults)\n});\n\n// PortsModelInterface is a common interface for shapes that have ports. This interface makes it easy\n// to create new shapes with ports functionality. It is assumed that the new shapes have\n// `inPorts` and `outPorts` array properties. Only these properties should be used to set ports.\n// In other words, using this interface, it is no longer recommended to set ports directly through the\n// `attrs` object.\n\n// Usage:\n// joint.shapes.custom.MyElementWithPorts = joint.shapes.basic.Path.extend(_.extend({}, joint.shapes.basic.PortsModelInterface, {\n//     getPortAttrs: function(portName, index, total, selector, type) {\n//         var attrs = {};\n//         var portClass = 'port' + index;\n//         var portSelector = selector + '>.' + portClass;\n//         var portTextSelector = portSelector + '>text';\n//         var portCircleSelector = portSelector + '>circle';\n//\n//         attrs[portTextSelector] = { text: portName };\n//         attrs[portCircleSelector] = { port: { id: portName || _.uniqueId(type) , type: type } };\n//         attrs[portSelector] = { ref: 'rect', 'ref-y': (index + 0.5) * (1 / total) };\n//\n//         if (selector === '.outPorts') { attrs[portSelector]['ref-dx'] = 0; }\n//\n//         return attrs;\n//     }\n//}));\njoint.shapes.basic.PortsModelInterface = {\n\n    initialize: function() {\n\n        this.updatePortsAttrs();\n        this.on('change:inPorts change:outPorts', this.updatePortsAttrs, this);\n\n        // Call the `initialize()` of the parent.\n        this.constructor.__super__.constructor.__super__.initialize.apply(this, arguments);\n    },\n    \n    updatePortsAttrs: function(eventName) {\n\n        // Delete previously set attributes for ports.\n        var currAttrs = this.get('attrs');\n        _.each(this._portSelectors, function(selector) {\n            if (currAttrs[selector]) delete currAttrs[selector];\n        });\n        \n        // This holds keys to the `attrs` object for all the port specific attribute that\n        // we set in this method. This is necessary in order to remove previously set\n        // attributes for previous ports.\n        this._portSelectors = [];\n        \n        var attrs = {};\n        \n        _.each(this.get('inPorts'), function(portName, index, ports) {\n            var portAttributes = this.getPortAttrs(portName, index, ports.length, '.inPorts', 'in');\n            this._portSelectors = this._portSelectors.concat(_.keys(portAttributes));\n            _.extend(attrs, portAttributes);\n        }, this);\n        \n        _.each(this.get('outPorts'), function(portName, index, ports) {\n            var portAttributes = this.getPortAttrs(portName, index, ports.length, '.outPorts', 'out');\n            this._portSelectors = this._portSelectors.concat(_.keys(portAttributes));\n            _.extend(attrs, portAttributes);\n        }, this);\n\n        // Silently set `attrs` on the cell so that noone knows the attrs have changed. This makes sure\n        // that, for example, command manager does not register `change:attrs` command but only\n        // the important `change:inPorts`/`change:outPorts` command.\n        this.attr(attrs, { silent: true });\n        // Manually call the `processPorts()` method that is normally called on `change:attrs` (that we just made silent).\n        this.processPorts();\n        // Let the outside world (mainly the `ModelView`) know that we're done configuring the `attrs` object.\n        this.trigger('process:ports');\n    },\n\n    getPortSelector: function(name) {\n\n        var selector = '.inPorts';\n        var index = this.get('inPorts').indexOf(name);\n\n        if (index < 0) {\n            selector = '.outPorts';\n            index = this.get('outPorts').indexOf(name);\n\n            if (index < 0) throw new Error(\"getPortSelector(): Port doesn't exist.\");\n        }\n\n        return selector + '>g:nth-child(' + (index + 1) + ')>circle';\n    }\n};\n\njoint.shapes.basic.PortsViewInterface = {\n    \n    initialize: function() {\n\n        // `Model` emits the `process:ports` whenever it's done configuring the `attrs` object for ports.\n        this.listenTo(this.model, 'process:ports', this.update);\n        \n        joint.dia.ElementView.prototype.initialize.apply(this, arguments);\n    },\n\n    update: function() {\n\n        // First render ports so that `attrs` can be applied to those newly created DOM elements\n        // in `ElementView.prototype.update()`.\n        this.renderPorts();\n        joint.dia.ElementView.prototype.update.apply(this, arguments);\n    },\n\n    renderPorts: function() {\n\n        var $inPorts = this.$('.inPorts').empty();\n        var $outPorts = this.$('.outPorts').empty();\n\n        var portTemplate = _.template(this.model.portMarkup);\n\n        _.each(_.filter(this.model.ports, function(p) { return p.type === 'in' }), function(port, index) {\n\n            $inPorts.append(V(portTemplate({ id: index, port: port })).node);\n        });\n        _.each(_.filter(this.model.ports, function(p) { return p.type === 'out' }), function(port, index) {\n\n            $outPorts.append(V(portTemplate({ id: index, port: port })).node);\n        });\n    }\n};\n\njoint.shapes.basic.TextBlock = joint.shapes.basic.Rect.extend({\n\n    markup: ['<g class=\"rotatable\"><g class=\"scalable\"><rect/></g><switch>',\n\n             // if foreignObject supported\n             '<foreignObject requiredFeatures=\"http://www.w3.org/TR/SVG11/feature#Extensibility\" class=\"fobj\">',\n             '<body xmlns=\"http://www.w3.org/1999/xhtml\"><div/></body>',\n             '</foreignObject>',\n\n             // else foreignObject is not supported (fallback for IE)\n             '<svg overflow=\"hidden\"><text/></svg>',\n\n             '</switch></g>'].join(''),\n\n    defaults: joint.util.deepSupplement({\n\n        type: 'basic.TextBlock',\n\n        // see joint.css for the element styles\n\n        content: ''\n\n    }, joint.shapes.basic.Rect.prototype.defaults),\n\n    initialize: function() {\n\n        if (typeof SVGForeignObjectElement !== 'undefined') {\n\n            // foreignObject supported\n            this.setForeignObjectSize(this, this.get('size'));\n            this.setDivContent(this, this.get('content'));\n            this.listenTo(this, 'change:size', this.setForeignObjectSize);\n            this.listenTo(this, 'change:content', this.setDivContent);\n\n        } else {\n\n            // no foreignObject\n            this.setSvgSize(this, this.get('size'));\n            this.setTextContent(this, this.get('content'));\n            this.listenTo(this, 'change:size', this.setSvgSize);\n            this.listenTo(this, 'change:content', this.setTextContent);\n\n        }\n\n        joint.shapes.basic.Generic.prototype.initialize.apply(this, arguments);\n    },\n\n    setForeignObjectSize: function(cell, size) {\n\n        // Selector `foreignObject' doesn't work accross all browsers, we'r using class selector instead.\n        // We have to clone size as we don't want attributes.div.style to be same object as attributes.size.\n        cell.attr({\n            '.fobj': _.clone(size),\n            div: { style: _.clone(size) }\n        });\n    },\n\n    setSvgSize: function(cell, size) {\n\n        // Trim a text overflowing the element.\n        cell.attr({ svg: _.clone(size) });\n    },\n\n    setDivContent: function(cell, content) {\n\n        // Append the content to div as html.\n        cell.attr({ div : {\n            html: content\n        }});\n    },\n\n    setTextContent: function(cell, content) {\n\n        // This could be overriden in order to break the text lines to fit to a content of the element.\n        cell.attr({ text: {\n            text: content\n        }});\n    }\n\n});\n\nif (typeof exports === 'object') {\n\n    module.exports = joint.shapes.basic;\n}"
  },
  {
    "path": "Dialogger/lib/joint.shapes.devs.js",
    "content": "/*! JointJS v0.8.1 - JavaScript diagramming library  2014-02-24 \n\n\nThis Source Code Form is subject to the terms of the Mozilla Public\nLicense, v. 2.0. If a copy of the MPL was not distributed with this\nfile, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\nif (typeof exports === 'object') {\n\n    var joint = {\n        util: require('../src/core').util,\n        shapes: {\n            basic: require('./joint.shapes.basic')\n        },\n        dia: {\n            ElementView: require('../src/joint.dia.element').ElementView,\n            Link: require('../src/joint.dia.link').Link\n        }\n    };\n    var _ = require('lodash');\n}\n\njoint.shapes.devs = {};\n\njoint.shapes.devs.Model = joint.shapes.basic.Generic.extend(_.extend({}, joint.shapes.basic.PortsModelInterface, {\n\n    markup: '<g class=\"rotatable\"><g class=\"scalable\"><rect/></g><text class=\"label\"/><g class=\"inPorts\"/><g class=\"outPorts\"/></g>',\n    portMarkup: '<g class=\"port<%= id %>\"><circle/><text/></g>',\n\n    defaults: joint.util.deepSupplement({\n\n        type: 'devs.Model',\n        size: { width: 1, height: 1 },\n        \n        inPorts: [],\n        outPorts: [],\n\n        attrs: {\n            '.': { magnet: false },\n            rect: {\n                width: 150, height: 250,\n                stroke: 'black'\n            },\n            circle: {\n                r: 10,\n                stroke: 'black'\n            },\n            text: {\n                fill: 'black',\n                'pointer-events': 'none'\n            },\n            '.label': { text: 'Model', 'ref-x': .3, 'ref-y': .2 },\n            '.inPorts text': { x:-15, dy: 4, 'text-anchor': 'end' },\n            '.outPorts text':{ x: 15, dy: 4 }\n        }\n\n    }, joint.shapes.basic.Generic.prototype.defaults),\n\n    getPortAttrs: function(portName, index, total, selector, type) {\n\n        var attrs = {};\n        \n        var portClass = 'port' + index;\n        var portSelector = selector + '>.' + portClass;\n        var portTextSelector = portSelector + '>text';\n        var portCircleSelector = portSelector + '>circle';\n\n        attrs[portTextSelector] = { text: portName };\n        attrs[portCircleSelector] = { port: { id: portName || _.uniqueId(type) , type: type } };\n        attrs[portSelector] = { ref: 'rect', 'ref-y': (index + 0.5) * (1 / total) };\n        \n        if (selector === '.outPorts') { attrs[portSelector]['ref-dx'] = 0; }\n\n        return attrs;\n    }\n}));\n\n\njoint.shapes.devs.Atomic = joint.shapes.devs.Model.extend({\n\n    defaults: joint.util.deepSupplement({\n\n        type: 'devs.Atomic',\n        size: { width: 80, height: 80 },\n        attrs: {\n            rect: { fill: 'salmon' },\n            '.label': { text: 'Atomic' },\n            '.inPorts circle': { fill: 'PaleGreen' },\n            '.outPorts circle': { fill: 'Tomato' }\n        }\n\n    }, joint.shapes.devs.Model.prototype.defaults)\n\n});\n\njoint.shapes.devs.Coupled = joint.shapes.devs.Model.extend({\n\n    defaults: joint.util.deepSupplement({\n\n        type: 'devs.Coupled',\n        size: { width: 200, height: 300 },\n        attrs: {\n            rect: { fill: 'seaGreen' },\n            '.label': { text: 'Coupled' },\n            '.inPorts circle': { fill: 'PaleGreen' },\n            '.outPorts circle': { fill: 'Tomato' }\n        }\n\n    }, joint.shapes.devs.Model.prototype.defaults)\n});\n\njoint.shapes.devs.Link = joint.dia.Link.extend({\n\n    defaults: {\n        type: 'devs.Link',\n        attrs: { '.connection' : { 'stroke-width' :  2 }}\n    }\n});\n\njoint.shapes.devs.ModelView = joint.dia.ElementView.extend(joint.shapes.basic.PortsViewInterface);\njoint.shapes.devs.AtomicView = joint.shapes.devs.ModelView;\njoint.shapes.devs.CoupledView = joint.shapes.devs.ModelView;\n\n\nif (typeof exports === 'object') {\n\n    module.exports = joint.shapes.devs;\n}\n"
  },
  {
    "path": "Dialogger/lib/jquery.contextmenu.js",
    "content": "(function($) {\n    function returnfalse() { return false; };\n    $.fn.contextmenu = function(option) {\n        option = $.extend({ alias: \"cmroot\", width: 150 }, option);\n        var ruleName = null, target = null,\n\t    groups = {}, mitems = {}, actions = {}, showGroups = [],\n        itemTpl = \"<div class='b-m-$[type]' unselectable=on><nobr unselectable=on><span unselectable=on>$[text]</span></nobr></div>\";\n        var gTemplet = $(\"<div/>\").addClass(\"b-m-mpanel\").attr(\"unselectable\", \"on\").css(\"display\", \"none\");\n        var iTemplet = $(\"<div/>\").addClass(\"b-m-item\").attr(\"unselectable\", \"on\");\n        var sTemplet = $(\"<div/>\").addClass(\"b-m-split\");\n        //build group item, which has sub items\n        var buildGroup = function(obj) {\n            groups[obj.alias] = this;\n            this.gidx = obj.alias;\n            this.id = obj.alias;\n            if (obj.disable) {\n                this.disable = obj.disable;\n                this.className = \"b-m-idisable\";\n            }\n            $(this).width(obj.width).click(returnfalse).mousedown(returnfalse).appendTo($(\"body\"));\n            obj = null;\n            return this;\n        };\n        var buildItem = function(obj) {\n            var T = this;\n            T.idx = obj.alias;\n            T.gidx = obj.gidx;\n            T.data = obj;\n            T.innerHTML = itemTpl.replace(/\\$\\[([^\\]]+)\\]/g, function() {\n                return obj[arguments[1]];\n            });\n            if (obj.id)\n                T.setAttribute('id', obj.id);\n            if (obj.disable) {\n                T.disable = obj.disable;\n                T.className = \"b-m-idisable\";\n            }\n            obj.items && (T.group = true);\n            obj.action && (actions[obj.alias] = obj.action);\n            mitems[obj.alias] = T;\n            T = obj = null;\n            return this;\n        };\n        //add new items\n        var addItems = function(gidx, items) {\n            var tmp = null;\n            for (var i = 0; i < items.length; i++) {\n                if (items[i].type == \"splitLine\") {\n                    //split line\n                    tmp = sTemplet.clone()[0];\n                } else {\n                    items[i].gidx = gidx;\n                    if (items[i].type == \"group\") {\n                        //group \n                        buildGroup.apply(gTemplet.clone()[0], [items[i]]);\n                        arguments.callee(items[i].alias, items[i].items);\n                        items[i].type = \"arrow\";\n                        tmp = buildItem.apply(iTemplet.clone()[0], [items[i]]);\n                    } else {\n                        //normal item\n                        items[i].type = \"ibody\";\n                        tmp = buildItem.apply(iTemplet.clone()[0], [items[i]]);\n                        $(tmp).click(function(e) {\n                            if (!this.disable) {\n                                if ($.isFunction(actions[this.idx])) {\n                                    actions[this.idx].call(this, target);\n                                }\n                                hideMenuPane();\n                            }\n                            return false;\n                        });\n\n                    } //end if\n                    $(tmp).bind(\"contextmenu\", returnfalse).hover(overItem, outItem);\n                } \n                groups[gidx].appendChild(tmp);\n                tmp = items[i] = items[i].items = null;\n            } //end for\n            gidx = items = null;\n        };\n        var overItem = function(e) {\n            //menu item is disabled          \n            if (this.disable)\n                return false;\n            hideMenuPane.call(groups[this.gidx]);\n            //has sub items\n            if (this.group) {\n                var pos = $(this).offset();\n                var width = $(this).outerWidth();\n                showMenuGroup.apply(groups[this.idx], [pos, width]);\n            }\n            this.className = \"b-m-ifocus\";\n            return false;\n        };\n        //menu loses focus\n        var outItem = function(e) {\n            //disabled item\n            if (this.disable )\n                return false;\n            if (!this.group) {\n                //normal item\n                this.className = \"b-m-item\";\n            } //Endif\n            return false;\n        };\n        //show menu group at specified position\n        var reversed = false;\n        var showMenuGroup = function(pos, width) {\n            var bwidth = $(\"body\").width();\n            var bheight = document.documentElement.clientHeight;\n            var mwidth = $(this).outerWidth();\n            var mheight = $(this).outerHeight();\n            var originalPosTop = pos.top;\n            pos.left = (pos.left + width + mwidth > bwidth) ? (pos.left - mwidth < 0 ? 0 : pos.left - mwidth) : pos.left + width;\n            pos.top = (pos.top + mheight > bheight) ? (pos.top - mheight + (width > 0 ? 25 : 0) < 0 ? 0 : pos.top - mheight + (width > 0 ? 25 : 0)) : pos.top;\n            var needsReversed = originalPosTop > pos.top;\n            var $this = $(this);\n            if (reversed != needsReversed)\n                $this.children().each(function(i, child) { $this.prepend(child); });\n            reversed = needsReversed;\n\n            $(this).css(pos).show();\n            showGroups.push(this.gidx);\n        };\n        //to hide menu\n        var hideMenuPane = function() {\n            var alias = null;\n            for (var i = showGroups.length - 1; i >= 0; i--) {\n                if (showGroups[i] == this.gidx)\n                    break;\n                alias = showGroups.pop();\n                groups[alias].style.display = \"none\";\n                mitems[alias] && (mitems[alias].className = \"b-m-item\");\n            } //Endfor\n            //CollectGarbage();\n        };\n        function applyRule(rule) {\n            if (ruleName && ruleName == rule.name)\n                return false;\n            for (var i in mitems)\n                disable(i, !rule.disable);\n            for (var i = 0; i < rule.items.length; i++)\n                disable(rule.items[i], rule.disable);\n            ruleName = rule.name;\n        };\n        function disable(alias, disabled) {\n            var item = mitems[alias];\n            item.className = (item.disable = item.lastChild.disabled = disabled) ? \"b-m-idisable\" : \"b-m-item\";\n        };\n\n        /* to show menu  */\n        function showMenu(e, menutarget) {\n            target = menutarget;\n            showMenuGroup.call(groups.cmroot, { left: e.pageX, top: e.pageY }, 0);\n            $(document).one('mousedown', hideMenuPane);\n        }\n        var $root = $(\"#\" + option.alias);\n        var root = null;\n        if ($root.length == 0) {\n            root = buildGroup.apply(gTemplet.clone()[0], [option]);\n            root.applyrule = applyRule;\n            root.showMenu = showMenu;\n            addItems(option.alias, option.items);\n        }\n        else {\n            root = $root[0];\n        }\n        var me = $(this).each(function() {\n            return $(this).bind('contextmenu', function(e) {\n                var bShowContext = (option.onContextMenu && $.isFunction(option.onContextMenu)) ? option.onContextMenu.call(this, e) : true;\n                if (bShowContext) {\n                    if (option.onShow && $.isFunction(option.onShow)) {\n                        option.onShow.call(this, root);\n                    }\n                    root.showMenu(e, this);\n                }\n                return false;\n            });\n        });\n        //to apply rule\n        if (option.rule) {\n            applyRule(option.rule);\n        }\n        gTemplet = iTemplet = sTemplet = itemTpl = buildGroup = buildItem = null;\n        addItems = overItem = outItem = null;\n        //CollectGarbage();\n        return me;\n    }\n})(jQuery);"
  },
  {
    "path": "Excel/Build.Debug.CF.bat",
    "content": "@echo off\n\nREM ************Compact Framework. DEBUG to Bin\\Release\\CF\\Excel.dll************\nREM **********************************************************************\nSET CSC=C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe /nologo\n\nSET SC_PATH=%cd%\n\nREM **CLEAN\n\nRD /S /Q %SC_PATH%\\Bin\\Debug\\CF\\\nMKDIR %SC_PATH%\\Bin\\Debug\\CF\\\n\nif \"%NETCF_PATH%\" == \"\" (\n**set NETCF_PATH=C:\\Program Files\\Microsoft.NET\\SDK\\v2.0\\CompactFramework\\WindowsCE)\n  set NETCF_PATH=C:\\Program Files\\Microsoft Visual Studio 8\\SmartDevices\\SDK\\CompactFramework\\2.0\\v2.0\\WindowsCE\n\nif DEFINED REF ( set REF= )\n\nset REF=%REF% \"/r:%NETCF_PATH%\\MsCorlib.dll\"\nset REF=%REF% \"/r:%NETCF_PATH%\\System.dll\"\nset REF=%REF% \"/r:%NETCF_PATH%\\System.Data.dll\"\nset REF=%REF% \"/r:%NETCF_PATH%\\System.Xml.dll\"\nset REF=%REF% \"/r:%SC_PATH%\\Binaries\\netcf-20\\ICSharpCode.SharpZipLib.dll\"\n\n%CSC% /nologo /debug -nostdlib -noconfig  /out:%SC_PATH%\\Bin\\Debug\\CF\\Excel.dll /target:library %REF% /recurse:*.cs\n\nREM **********************************************************************"
  },
  {
    "path": "Excel/Build.Release.CF.bat",
    "content": "@echo off\n\nREM ************Compact Framework. RELEASE to Bin\\Release\\CF\\Excel.dll************\nREM **********************************************************************\nSET CSC=C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe /nologo\n\nSET SC_PATH=%cd%\n\nREM **CLEAN\n\nRD /S /Q %SC_PATH%\\Bin\\Release\\CF\\\nMKDIR %SC_PATH%\\Bin\\Release\\CF\\\n\nset NETCF_PATH=C:\\Program Files\\Microsoft.NET\\SDK\\CompactFramework\\v2.0\\WindowsCE\n\n\nif DEFINED REF ( set REF= )\n\nset REF=%REF% \"/r:%NETCF_PATH%\\MsCorlib.dll\"\nset REF=%REF% \"/r:%NETCF_PATH%\\System.dll\"\nset REF=%REF% \"/r:%NETCF_PATH%\\System.Data.dll\"\nset REF=%REF% \"/r:%NETCF_PATH%\\System.Xml.dll\"\nset REF=%REF% /r:\"%SC_PATH%\\..\\Lib\\cf\\ICSharpCode.SharpZipLib.dll\"\n\n@echo on\n%CSC% /define:CF_RELEASE /nologo -nostdlib -noconfig /o /out:\"%SC_PATH%\\Bin\\Release\\CF\\Excel.dll\" /target:library %REF% /recurse:*.cs"
  },
  {
    "path": "Excel/Core/Binary12Format/Enums.cs",
    "content": "namespace Excel.Core.Binary12Format\n{\n\t/// <summary>\n\t/// BIFF 12 Record Types\n\t/// </summary>\n\tinternal enum BIFF12 : ushort\n\t{\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tDEFINEDNAME = 0x27,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFILEVERSION = 0x0180,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tWORKBOOK = 0x0183,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tWORKBOOK_END = 0x0184,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tBOOKVIEWS = 0x0187,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tBOOKVIEWS_END = 0x0188,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSHEETS = 0x018F,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSHEETS_END = 0x0190,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tWORKBOOKPR = 0x0199,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSHEET = 0x019C,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCALCPR = 0x019D,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tWORKBOOKVIEW = 0x019E,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tEXTERNALREFERENCES = 0x02E1,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tEXTERNALREFERENCES_END = 0x02E2,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tEXTERNALREFERENCE = 0x02E3,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tWEBPUBLISHING = 0x04A9,\n\n\t\t// Worksheet records\n\t\t/// <summary>\n\t\t/// Row info.\n\t\t/// </summary>\n\t\tROW = 0x00,\n\t\t/// <summary>\n\t\t/// Empty cell.\n\t\t/// </summary>\n\t\tBLANK = 0x01,\n\t\t/// <summary>\n\t\t/// Single-precision float.\n\t\t/// </summary>\n\t\tNUM = 0x02,\n\t\t/// <summary>\n\t\t/// Error identifier.\n\t\t/// </summary>\n\t\tBOOLERR = 0x03,\n\t\t/// <summary>\n\t\t/// Boolean value.\n\t\t/// </summary>\n\t\tBOOL = 0x04,\n\t\t/// <summary>\n\t\t/// Double-precision float.\n\t\t/// </summary>\n\t\tFLOAT = 0x05,\n\t\t/// <summary>\n\t\t/// String (shared string index).\n\t\t/// </summary>\n\t\tSTRING = 0x07,\n\t\t/// <summary>\n\t\t/// Formula returning a string (inline string).\n\t\t/// </summary>\n\t\tFORMULA_STRING = 0x08,\n\t\t/// <summary>\n\t\t/// Formula returning a double-precision float.\n\t\t/// </summary>\n\t\tFORMULA_FLOAT = 0x09,\n\t\t/// <summary>\n\t\t/// Formula returning a boolean.\n\t\t/// </summary>\n\t\tFORMULA_BOOL = 0x0A,\n\t\t/// <summary>\n\t\t/// Formula returning an error identifier.\n\t\t/// </summary>\n\t\tFORMULA_BOOLERR = 0x0B,\n\t\t/// <summary>\n\t\t/// Column info.\n\t\t/// </summary>\n\t\tCOL = 0x3C,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tWORKSHEET = 0x0181,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tWORKSHEET_END = 0x0182,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSHEETVIEWS = 0x0185,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSHEETVIEWS_END = 0x0186,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSHEETVIEW = 0x0189,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSHEETVIEW_END = 0x018A,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSHEETDATA = 0x0191,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSHEETDATA_END = 0x0192,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSHEETPR = 0x0193,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tDIMENSION = 0x0194,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSELECTION = 0x0198,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOLS = 0x0386,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOLS_END = 0x0387,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCONDITIONALFORMATTING = 0x03CD,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCONDITIONALFORMATTING_END = 0x03CE,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCFRULE = 0x03CF,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCFRULE_END = 0x03D0,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tICONSET = 0x03D1,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tICONSET_END = 0x03D2,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tDATABAR = 0x03D3,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tDATABAR_END = 0x03D4,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOLORSCALE = 0x03D5,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOLORSCALE_END = 0x03D6,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCFVO = 0x03D7,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tPAGEMARGINS = 0x03DC,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tPRINTOPTIONS = 0x03DD,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tPAGESETUP = 0x03DE,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tHEADERFOOTER = 0x03DF,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSHEETFORMATPR = 0x03E5,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tHYPERLINK = 0x03EE,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tDRAWING = 0x04A6,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tLEGACYDRAWING = 0x04A7,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOLOR = 0x04B4,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tOLEOBJECTS = 0x04FE,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tOLEOBJECT = 0x04FF,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tOLEOBJECTS_END = 0x0580,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLEPARTS = 0x0594,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLEPART = 0x0595,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLEPARTS_END = 0x0596,\n\n\t\t//SharedStrings records\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSI = 0x13,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSST = 0x019F,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSST_END = 0x01A0,\n\n\t\t//Styles records\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFONT = 0x2B,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFILL = 0x2D,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tBORDER = 0x2E,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tXF = 0x2F,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCELLSTYLE = 0x30,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSTYLESHEET = 0x0296,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSTYLESHEET_END = 0x0297,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOLORS = 0x03D9,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOLORS_END = 0x03DA,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tDXFS = 0x03F9,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tDXFS_END = 0x03FA,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLESTYLES = 0x03FC,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLESTYLES_END = 0x03FD,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFILLS = 0x04DB,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFILLS_END = 0x04DC,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFONTS = 0x04E3,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFONTS_END = 0x04E4,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tBORDERS = 0x04E5,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tBORDERS_END = 0x04E6,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCELLXFS = 0x04E9,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCELLXFS_END = 0x04EA,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCELLSTYLES = 0x04EB,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCELLSTYLES_END = 0x04EC,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCELLSTYLEXFS = 0x04F2,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCELLSTYLEXFS_END = 0x04F3,\n\n\t\t//Comment records\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOMMENTS = 0x04F4,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOMMENTS_END = 0x04F5,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tAUTHORS = 0x04F6,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tAUTHORS_END = 0x04F7,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tAUTHOR = 0x04F8,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOMMENTLIST = 0x04F9,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOMMENTLIST_END = 0x04FA,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOMMENT = 0x04FB,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCOMMENT_END = 0x04FC,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTEXT = 0x04FD,\n\n\t\t//Table records\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tAUTOFILTER = 0x01A1,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tAUTOFILTER_END = 0x01A2,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFILTERCOLUMN = 0x01A3,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFILTERCOLUMN_END = 0x01A4,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFILTERS = 0x01A5,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFILTERS_END = 0x01A6,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tFILTER = 0x01A7,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLE = 0x02D7,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLE_END = 0x02D8,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLECOLUMNS = 0x02D9,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLECOLUMNS_END = 0x02DA,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLECOLUMN = 0x02DB,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLECOLUMN_END = 0x02DC,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tTABLESTYLEINFO = 0x0481,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSORTSTATE = 0x0492,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSORTCONDITION = 0x0494,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tSORTSTATE_END = 0x0495,\n\n\t\t//QueryTable records\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tQUERYTABLE = 0x03BF,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tQUERYTABLE_END = 0x03C0,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tQUERYTABLEREFRESH = 0x03C1,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tQUERYTABLEREFRESH_END = 0x03C2,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tQUERYTABLEFIELDS = 0x03C7,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tQUERYTABLEFIELDS_END = 0x03C8,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tQUERYTABLEFIELD = 0x03C9,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tQUERYTABLEFIELD_END = 0x03CA,\n\n\t\t//Connection records\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCONNECTIONS = 0x03AD,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCONNECTIONS_END = 0x03AE,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCONNECTION = 0x01C9,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tCONNECTION_END = 0x01CA,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tDBPR = 0x01CB,\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tDBPR_END = 0x01CC,\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tUNKNOWN = 0x0\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/Binary12Format/XlsbDimension.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Excel.Core.OpenXmlFormat;\n\nnamespace Excel.Core.Binary12Format\n{\n\tinternal class XlsbDimension : XlsxDimension\n\t{\n\t\tpublic XlsbDimension():base(string.Empty) {}\n\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/Binary12Format/XlsbNumFmt.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Excel.Core.OpenXmlFormat;\n\nnamespace Excel.Core.Binary12Format\n{\n\tinternal class XlsbNumFmt : XlsxNumFmt\n\t{\n\t\tpublic XlsbNumFmt(int id, string formatCode) : base(id, formatCode) { }\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/Binary12Format/XlsbRecord.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\n\nnamespace Excel.Core.Binary12Format\n{\n\t/// <summary>\n\t/// Represents basic BIFF12 record\n\t/// Base class for all BIFF12 record types\n\t/// </summary>\n\tinternal class XlsbRecord\n\t{\n\t\t#region Members and Properties\n\n\t\tprotected byte[] _bytes;\n\t\t/// <summary>\n\t\t/// read offset\n\t\t/// </summary>\n\t\tprotected int _offset;\n\n\t\tpublic BIFF12 ID\n\t\t{\n\t\t\tget { return GetID(_bytes, _offset); }\n\t\t}\n\n\t\tprivate static BIFF12 GetID(byte[] bytes, int offset)\n\t\t{\n\t\t\tBIFF12 val1 = (BIFF12)BitConverter.ToUInt16(bytes, offset - 4);\n\n\t\t\tBIFF12 val2 = BIFF12.UNKNOWN;\n\n\t\t\tuint recid = 0;\n\n\t\t\tif (offset < bytes.Length)\n\t\t\t{\n\n\t\t\t\tbyte b1 = bytes[offset++];\n\t\t\t\trecid = (UInt32)(b1);\n\n\t\t\t\tif ((b1 & 0x80) > 0)\n\t\t\t\t{\n\t\t\t\t\tif (offset < bytes.Length)\n\t\t\t\t\t{\n\t\t\t\t\t\tbyte b2 = bytes[offset++];\n\t\t\t\t\t\trecid = ((UInt32)(b2) << 8) | recid;\n\n\t\t\t\t\t\tif ((b2 & 0x80) == 0)\n\t\t\t\t\t\t\treturn (BIFF12)b2;\n\n\t\t\t\t\t\tif (offset >= bytes.Length)\n\t\t\t\t\t\t\treturn BIFF12.UNKNOWN;\n\t\t\t\t\t\tbyte b3 = bytes[offset++];\n\t\t\t\t\t\trecid = ((UInt32)(b3) << 16) | recid;\n\n\t\t\t\t\t\tif ((b3 & 0x80) == 0)\n\t\t\t\t\t\t\treturn (BIFF12)b3; ;\n\n\t\t\t\t\t\tif (offset >= bytes.Length)\n\t\t\t\t\t\t\treturn BIFF12.UNKNOWN;\n\t\t\t\t\t\tbyte b4 = bytes[offset++];\n\t\t\t\t\t\trecid = ((UInt32)(b4) << 24) | recid;\n\n\t\t\t\t\t\treturn (BIFF12)b4;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn val2;\n\t\t}\n\n\t\tpublic uint GetLength()\n\t\t{\n\t\t\tuint reclen = 0;\n\n\t\t\tif (_offset >= _bytes.Length)\n\t\t\t\treturn 0;\n\n\t\t\tbyte b1 = _bytes[_offset++];\n\t\t\treclen = (UInt32)(b1 & 0x7F);\n\n\t\t\tif ((b1 & 0x80) == 0)\n\t\t\t\treturn reclen;\n\n\t\t\tif (_offset >= _bytes.Length)\n\t\t\t\treturn 0;\n\n\t\t\tbyte b2 = _bytes[_offset++];\n\t\t\treclen = ((UInt32)(b2 & 0x7F) << 7) | reclen;\n\n\t\t\tif ((b2 & 0x80) == 0)\n\t\t\t\treturn reclen;\n\n\t\t\tif (_offset >= _bytes.Length)\n\t\t\t\treturn 0;\n\n\t\t\tbyte b3 = _bytes[_offset++];\n\t\t\treclen = ((UInt32)(b3 & 0x7F) << 14) | reclen;\n\n\t\t\tif ((b3 & 0x80) == 0)\n\t\t\t\treturn reclen;\n\n\t\t\tif (_offset >= _bytes.Length)\n\t\t\t\treturn 0;\n\n\t\t\tbyte b4 = _bytes[_offset++];\n\t\t\treclen = ((UInt32)(b4 & 0x7F) << 21) | reclen;\n\n\t\t\treturn reclen;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the record bytes.\n\t\t/// </summary>\n\t\t/// <value>The record bytes.</value>\n\t\tinternal byte[] Bytes\n\t\t{\n\t\t\tget { return _bytes; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the read offset.\n\t\t/// </summary>\n\t\t/// <value>The read offset.</value>\n\t\tinternal int Offset\n\t\t{\n\t\t\tget { return _offset - 4; }\n\t\t}\n\n\t\tpublic ushort RecordSize\n\t\t{\n\t\t\tget { return BitConverter.ToUInt16(_bytes, _offset - 2); }\n\t\t}\n\n\t\tpublic int Size\n\t\t{\n\t\t\tget { return 4 + RecordSize; }\n\t\t}\n\n\t\t#endregion\n\n\t\tprotected XlsbRecord(byte[] bytes)\n\t\t\t: this(bytes, 0)\n\t\t{\n\t\t}\n\n\t\tprotected XlsbRecord(byte[] bytes, uint offset)\n\t\t{\n\t\t\tif (bytes.Length - offset < 4)\n\t\t\t\tthrow new ArgumentException(Errors.ErrorBIFFRecordSize);\n\n\t\t\t_bytes = bytes;\n\t\t\t_offset = (int)(4 + offset);\n\n\t\t\t//if (_bytes.Length < _offset + Size)//Size\n\t\t\t//    throw new ArgumentException(Errors.ErrorBIFFBufferSize);\n\t\t}\n\n\n\t\tpublic static XlsbRecord GetRecord(byte[] bytes, uint offset)\n\t\t{\n\t\t\treturn new XlsbRecord(bytes, offset);\n\t\t}\n\n\t\tpublic int ReadUInt32(int offset)\n\t\t{\n\t\t\tint val1 = (int)BitConverter.ToUInt32(_bytes, _offset + offset);\n\n\t\t\tUInt32 val2 = ((UInt32)(_bytes[_offset + offset + 3]) << 24) +\n\t\t\t\t((UInt32)(_bytes[_offset + offset + 2]) << 16) +\n\t\t\t\t((UInt32)(_bytes[_offset + offset + 1]) << 8) +\n\t\t\t\t((UInt32)(_bytes[_offset + offset + 0]));\n\n\t\t\tSystem.Diagnostics.Debug.Assert(val1 == (int)val2);\n\n\t\t\treturn (int)val2;\n\t\t}\n\n\t\tpublic ushort ReadUInt16(int offset)\n\t\t{\n\t\t\tushort val1 = BitConverter.ToUInt16(_bytes, _offset + offset);\n\n\t\t\tUInt16 val = (UInt16)(_bytes[_offset + offset + 1] << 8);\n\t\t\tval += (UInt16)(_bytes[_offset + offset + 0]);\n\n\t\t\tSystem.Diagnostics.Debug.Assert(val1 == val);\n\n\t\t\treturn val;\n\t\t}\n\n\t\tpublic byte ReadByte(int offset)\n\t\t{\n\t\t\tbyte val1 = Buffer.GetByte(_bytes, _offset + offset);\n\n\t\t\tbyte val2 = _bytes[_offset + offset];\n\n\t\t\tSystem.Diagnostics.Debug.Assert(val1 == val2);\n\n\t\t\treturn val2;\n\t\t}\n\n\t\tpublic string ReadString(int offset, int len)\n\t\t{\n\t\t\t//StringBuilder sb = new StringBuilder((int)len);\n\t\t\t//for (UInt32 i = offset; i < offset + 2 * len; i += 2)\n\t\t\t//    sb.Append((Char)GetWord(buffer, i));\n\t\t\t//return sb.ToString();\n\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic double ReadFloat(int offset)\n\t\t{\n\t\t\tdouble d = 0;\n\n\t\t\t// When it's a simple precision float, Excel uses a special\n\t\t\t// encoding\n\t\t\tint rk = ReadUInt32(_offset + offset);\n\t\t\tif ((rk & 0x02) != 0)\n\t\t\t{\n\t\t\t\t// int\n\t\t\t\td = (double)(rk >> 2);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tusing (MemoryStream mem = new MemoryStream())\n\t\t\t\t{\n\t\t\t\t\tBinaryWriter bw = new BinaryWriter(mem);\n\n\t\t\t\t\tbw.Write(0);\n\t\t\t\t\tbw.Write(rk & -4);\n\n\t\t\t\t\tmem.Seek(0, SeekOrigin.Begin);\n\n\t\t\t\t\tBinaryReader br = new BinaryReader(mem);\n\t\t\t\t\td = br.ReadDouble();\n\t\t\t\t\tbr.Close();\n\t\t\t\t\tbw.Close();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((rk & 0x01) != 0)\n\t\t\t{\n\t\t\t\t// divide by 100\n\t\t\t\td /= 100;\n\t\t\t}\n\n\t\t\tfloat val1 = BitConverter.ToSingle(_bytes, _offset + offset);\n\n\t\t\tSystem.Diagnostics.Debug.Assert(val1 == (float)d);\n\n\t\t\treturn d;\n\t\t}\n\n\t\tpublic double ReadDouble(int offset)\n\t\t{\n\t\t\tdouble d = 0;\n\n\t\t\tusing (MemoryStream mem = new MemoryStream())\n\t\t\t{\n\t\t\t\tBinaryWriter bw = new BinaryWriter(mem);\n\n\t\t\t\tfor (UInt32 i = 0; i < 8; i++)\n\t\t\t\t\tbw.Write(_bytes[offset + _offset + i]);\n\n\t\t\t\tmem.Seek(0, SeekOrigin.Begin);\n\n\t\t\t\tBinaryReader br = new BinaryReader(mem);\n\t\t\t\td = br.ReadDouble();\n\t\t\t\tbr.Close();\n\t\t\t\tbw.Close();\n\t\t\t}\n\n\t\t\tdouble val1 = BitConverter.ToDouble(_bytes, _offset + offset);\n\n\t\t\tSystem.Diagnostics.Debug.Assert(val1 == d);\n\n\t\t\treturn d;\n\t\t}\n\n\t\t//public static bool GetRecordID(byte[] buffer, ref UInt32 offset, ref UInt32 recid)\n\t\t//{\n\t\t//    recid = 0;\n\n\t\t//    if (offset >= buffer.Length)\n\t\t//        return false;\n\t\t//    byte b1 = buffer[offset++];\n\t\t//    recid = (UInt32)(b1);\n\n\t\t//    if ((b1 & 0x80) == 0)\n\t\t//        return true;\n\n\t\t//    if (offset >= buffer.Length)\n\t\t//        return false;\n\t\t//    byte b2 = buffer[offset++];\n\t\t//    recid = ((UInt32)(b2) << 8) | recid;\n\n\t\t//    if ((b2 & 0x80) == 0)\n\t\t//        return true;\n\n\t\t//    if (offset >= buffer.Length)\n\t\t//        return false;\n\t\t//    byte b3 = buffer[offset++];\n\t\t//    recid = ((UInt32)(b3) << 16) | recid;\n\n\t\t//    if ((b3 & 0x80) == 0)\n\t\t//        return true;\n\n\t\t//    if (offset >= buffer.Length)\n\t\t//        return false;\n\t\t//    byte b4 = buffer[offset++];\n\t\t//    recid = ((UInt32)(b4) << 24) | recid;\n\n\t\t//    return true;\n\t\t//}\n\n\t\t//public static bool GetRecordLen(byte[] buffer, ref UInt32 offset, ref UInt32 reclen)\n\t\t//{\n\t\t//    reclen = 0;\n\n\t\t//    if (offset >= buffer.Length)\n\t\t//        return false;\n\t\t//    byte b1 = buffer[offset++];\n\t\t//    reclen = (UInt32)(b1 & 0x7F);\n\n\t\t//    if ((b1 & 0x80) == 0)\n\t\t//        return true;\n\n\t\t//    if (offset >= buffer.Length)\n\t\t//        return false;\n\t\t//    byte b2 = buffer[offset++];\n\t\t//    reclen = ((UInt32)(b2 & 0x7F) << 7) | reclen;\n\n\t\t//    if ((b2 & 0x80) == 0)\n\t\t//        return true;\n\n\t\t//    if (offset >= buffer.Length)\n\t\t//        return false;\n\t\t//    byte b3 = buffer[offset++];\n\t\t//    reclen = ((UInt32)(b3 & 0x7F) << 14) | reclen;\n\n\t\t//    if ((b3 & 0x80) == 0)\n\t\t//        return true;\n\n\t\t//    if (offset >= buffer.Length)\n\t\t//        return false;\n\t\t//    byte b4 = buffer[offset++];\n\t\t//    reclen = ((UInt32)(b4 & 0x7F) << 21) | reclen;\n\n\t\t//    return true;\n\t\t//}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/Binary12Format/XlsbSST.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.Binary12Format\n{\n\tinternal class XlsbSST : List<string>\n\t{\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/Binary12Format/XlsbStyles.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.Binary12Format\n{\n\tinternal class XlsbStyles\n\t{\n\t\tpublic XlsbStyles()\n\t\t{\n\t\t\t_cellXfs = new List<XlsbXf>();\n\t\t\t_NumFmts = new List<XlsbNumFmt>();\n\t\t}\n\n\t\tprivate List<XlsbXf> _cellXfs;\n\n\t\tpublic List<XlsbXf> CellXfs\n\t\t{\n\t\t\tget { return _cellXfs; }\n\t\t\tset { _cellXfs = value; }\n\t\t}\n\n\t\tprivate List<XlsbNumFmt> _NumFmts;\n\n\t\tpublic List<XlsbNumFmt> NumFmts\n\t\t{\n\t\t\tget { return _NumFmts; }\n\t\t\tset { _NumFmts = value; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/Binary12Format/XlsbWorkbook.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\n\nnamespace Excel.Core.Binary12Format\n{\n\tinternal class XlsbWorkbook\n\t{\n\t\tprivate XlsbWorkbook() { }\n\n\t\tpublic XlsbWorkbook(Stream workbookStream, Stream sharedStringsStream, Stream stylesStream)\n\t\t{\n\t\t\tif (null == workbookStream) throw new ArgumentNullException();\n\n\t\t\tReadWorkbook(workbookStream);\n\n\t\t\tReadSharedStrings(sharedStringsStream);\n\n\t\t\tReadStyles(stylesStream);\n\t\t}\n\n\t\tprivate List<XlsbWorksheet> sheets;\n\n\t\tpublic List<XlsbWorksheet> Sheets\n\t\t{\n\t\t\tget { return sheets; }\n\t\t\tset { sheets = value; }\n\t\t}\n\n\t\tprivate XlsbSST _SST;\n\n\t\tpublic XlsbSST SST\n\t\t{\n\t\t\tget { return _SST; }\n\t\t}\n\n\t\tprivate XlsbStyles _Styles;\n\n\t\tpublic XlsbStyles Styles\n\t\t{\n\t\t\tget { return _Styles; }\n\t\t}\n\n\n\t\tprivate void ReadStyles(Stream fileStream)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tprivate void ReadSharedStrings(Stream fileStream)\n\t\t{\n\t\t\tif (null == fileStream) return;\n\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tprivate void ReadWorkbook(Stream fileStream)\n\t\t{\n\t\t\t//TODO: Try finaly, release resources\n\n\t\t\tbyte[] buffer = new BinaryReader(fileStream).ReadBytes((int)fileStream.Length);\n\n\t\t\tUInt32 offset = 0;\n\n\t\t\t\n\n\t\t\twhile (offset < buffer.Length)\n\t\t\t{\n\t\t\t\tXlsbRecord record = XlsbRecord.GetRecord(buffer, offset);\n\t\t\t\tshort recId = 0;\n\t\t\t\tUInt32 reclen = 0;\n\n\t\t\t\trecId = (short)record.ID;\n\t\t\t\treclen = (UInt32)record.GetLength();\n\n\t\t\t\tif (recId == 0 && reclen == 0)\n\t\t\t\t\tcontinue;\n\n\n\t\t\t\t//BaseRecord rec = (BaseRecord) Activator.CreateInstance(h[recid].GetType());\n\n\t\t\t\t//if (recHandler != null)\n\t\t\t\t//{\n\t\t\t\t//    Console.Write(String.Format(\"<{0}>\\r\\n[rec=0x{1:X} len=0x{2:X}]\", recHandler.GetTag(), recid, reclen));\n\n\t\t\t\t//    for (int i = 0; i < reclen; i++)\n\t\t\t\t//    {\n\t\t\t\t//        Console.Write(String.Format(\" {0:X2}\", buffer[offset + i]));\n\t\t\t\t//    }\n\n\t\t\t\t//    Console.WriteLine();\n\n\t\t\t\t//    recHandler.Read(buffer, ref offset, (int)recid, (int)reclen, h, w);\n\n\t\t\t\t//    if (offset == UInt32.MaxValue)\n\t\t\t\t//    {\n\t\t\t\t//        Console.WriteLine(\"***Damaged buffer***\");\n\t\t\t\t//        break;\n\t\t\t\t//    }\n\n\t\t\t\t//}\n\t\t\t\t//else\n\t\t\t\t//{\n\t\t\t\t//    Console.Write(String.Format(\"[rec=0x{0:X} len=0x{1:X}]\", recid, reclen));\n\n\t\t\t\t//    for (int i = 0; i < reclen; i++)\n\t\t\t\t//    {\n\t\t\t\t//        Console.Write(String.Format(\" {0:X2}\", buffer[offset + i]));\n\t\t\t\t//    }\n\n\t\t\t\t//    Console.WriteLine();\n\t\t\t\t//}\n\n\t\t\t\toffset += reclen;\n\n\t\t\t\t//Console.WriteLine();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/Binary12Format/XlsbWorksheet.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.Binary12Format\n{\n\tinternal class XlsbWorksheet\n\t{\n\t\tprivate XlsbDimension _dimension;\n\n\t\tpublic XlsbDimension Dimension\n\t\t{\n\t\t\tget { return _dimension; }\n\t\t\tset { _dimension = value; }\n\t\t}\n\n\t\tpublic int ColumnsCount\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _dimension == null ? -1 : _dimension.LastCol - _dimension.FirstCol + 1;\n\t\t\t}\n\t\t}\n\n\t\tpublic int RowsCount\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _dimension == null ? -1 : _dimension.LastRow - _dimension.FirstRow + 1;\n\t\t\t}\n\t\t}\n\n\t\tprivate string _Name;\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget { return _Name; }\n\t\t}\n\n\t\tprivate int _id;\n\n\t\tpublic int Id\n\t\t{\n\t\t\tget { return _id; }\n\t\t}\n\n\t\tpublic XlsbWorksheet(string name, int id)\n\t\t{\n\t\t\t_Name = name;\n\t\t\t_id = id;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/Binary12Format/XlsbXf.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Excel.Core.OpenXmlFormat;\n\nnamespace Excel.Core.Binary12Format\n{\n\tinternal class XlsbXf : XlsxXf\n\t{\n\t\tpublic XlsbXf(int id, int numFmtId, string applyNumberFormat) : base(id, numFmtId, applyNumberFormat) { }\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/Enums.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\tinternal enum STGTY : byte\n\t{\n\t\tSTGTY_INVALID = 0,\n\t\tSTGTY_STORAGE = 1,\n\t\tSTGTY_STREAM = 2,\n\t\tSTGTY_LOCKBYTES = 3,\n\t\tSTGTY_PROPERTY = 4,\n\t\tSTGTY_ROOT = 5\n\t}\n\n\tinternal enum DECOLOR : byte\n\t{\n\t\tDE_RED = 0,\n\t\tDE_BLACK = 1\n\t}\n\n\tinternal enum FATMARKERS : uint\n\t{\n\t\tFAT_EndOfChain = 0xFFFFFFFE,\n\t\tFAT_FreeSpace = 0xFFFFFFFF,\n\t\tFAT_FatSector = 0xFFFFFFFD,\n\t\tFAT_DifSector = 0xFFFFFFFC\n\t}\n\n\tinternal enum BIFFTYPE : ushort\n\t{\n\t\tWorkbookGlobals = 0x0005,\n\t\tVBModule = 0x0006,\n\t\tWorksheet = 0x0010,\n\t\tChart = 0x0020,\n\t\tv4MacroSheet = 0x0040,\n\t\tv4WorkbookGlobals = 0x0100\n\t}\n\n\tinternal enum BIFFRECORDTYPE : ushort\n\t{\n\t\tINTERFACEHDR = 0x00E1,\n\t\tMMS = 0x00C1,\n\t\tINTERFACEEND = 0x00E2,\n\t\tWRITEACCESS = 0x005C,\n\t\tCODEPAGE = 0x0042,\n\t\tDSF = 0x0161,\n\t\tTABID = 0x013D,\n\t\tFNGROUPCOUNT = 0x009C,\n\t\tWINDOWPROTECT = 0x0019,\n\t\tPROTECT = 0x0012,\n\t\tPASSWORD = 0x0013,\n\t\tPROT4REV = 0x01AF,\n\t\tPROT4REVPASSWORD = 0x01BC,\n\t\tWINDOW1 = 0x003D,\n\t\tBACKUP = 0x0040,\n\t\tHIDEOBJ = 0x008D,\n\t\tRECORD1904 = 0x0022,\n\t\tREFRESHALL = 0x01B7,\n\t\tBOOKBOOL = 0x00DA,\n\n\t\tFONT = 0x0031, // Font record, BIFF2, 5 and later\n\n\t\tFONT_V34 = 0x0231, // Font record, BIFF3, 4\n\n\n\t\tFORMAT = 0x041E, // Format record, BIFF4 and later\n\n\t\tFORMAT_V23 = 0x001E, // Format record, BIFF2, 3\n\n\n\t\tXF = 0x00E0, // Extended format record, BIFF5 and later\n\n\t\tXF_V4 = 0x0443, // Extended format record, BIFF4\n\n\t\tXF_V3 = 0x0243, // Extended format record, BIFF3\n\n\t\tXF_V2 = 0x0043, // Extended format record, BIFF2\n\n\n\t\tSTYLE = 0x0293,\n\t\tBOUNDSHEET = 0x0085,\n\t\tCOUNTRY = 0x008C,\n\t\tSST = 0x00FC, // Global string storage (for BIFF8)\n\n\t\tCONTINUE = 0x003C,\n\t\tEXTSST = 0x00FF,\n\t\tBOF = 0x0809, // BOF ID for BIFF5 and later\n\n\t\tBOF_V2 = 0x0009, // BOF ID for BIFF2\n\n\t\tBOF_V3 = 0x0209, // BOF ID for BIFF3\n\n\t\tBOF_V4 = 0x0409, // BOF ID for BIFF5\n\n\t\tEOF = 0x000A, // End of block started with BOF\n\n\t\tCALCCOUNT = 0x000C,\n\t\tCALCMODE = 0x000D,\n\t\tPRECISION = 0x000E,\n\t\tREFMODE = 0x000F,\n\t\tDELTA = 0x0010,\n\t\tITERATION = 0x0011,\n\t\tSAVERECALC = 0x005F,\n\t\tPRINTHEADERS = 0x002A,\n\t\tPRINTGRIDLINES = 0x002B,\n\t\tGUTS = 0x0080,\n\t\tWSBOOL = 0x0081,\n\t\tGRIDSET = 0x0082,\n\t\tDEFAULTROWHEIGHT = 0x0225,\n\t\tHEADER = 0x0014,\n\t\tFOOTER = 0x0015,\n\t\tHCENTER = 0x0083,\n\t\tVCENTER = 0x0084,\n\t\tPRINTSETUP = 0x00A1,\n\t\tDFAULTCOLWIDTH = 0x0055,\n\t\tDIMENSIONS = 0x0200, // Size of area used for data\n\n\t\tROW = 0x0208, // Row record\n\n\t\tWINDOW2 = 0x023E,\n\t\tSELECTION = 0x001D,\n\t\tINDEX = 0x020B, // Index record, unsure about signature\n\n\t\tDBCELL = 0x00D7, // DBCell record, unsure about signature\n\n\t\tBLANK = 0x0201, // Empty cell\n\n\t\tBLANK_OLD = 0x0001, // Empty cell, old format\n\n\t\tMULBLANK = 0x00BE, // Equivalent of up to 256 blank cells\n\n\t\tINTEGER = 0x0202, // Integer cell (0..65535)\n\n\t\tINTEGER_OLD = 0x0002, // Integer cell (0..65535), old format\n\n\t\tNUMBER = 0x0203, // Numeric cell\n\n\t\tNUMBER_OLD = 0x0003, // Numeric cell, old format\n\n\t\tLABEL = 0x0204, // String cell (up to 255 symbols)\n\n\t\tLABEL_OLD = 0x0004, // String cell (up to 255 symbols), old format\n\n\t\tLABELSST = 0x00FD, // String cell with value from SST (for BIFF8)\n\n\t\tFORMULA = 0x0406, // Formula cell\n\n\t\tFORMULA_OLD = 0x0006, // Formula cell, old format\n\n\t\tBOOLERR = 0x0205, // Boolean or error cell\n\n\t\tBOOLERR_OLD = 0x0005, // Boolean or error cell, old format\n\n\t\tARRAY = 0x0221, // Range of cells for multi-cell formula\n\n\t\tRK = 0x027E, // RK-format numeric cell\n\n\t\tMULRK = 0x00BD, // Equivalent of up to 256 RK cells\n\n\t\tRSTRING = 0x00D6, // Rich-formatted string cell\n\n\t\tSHRFMLA = 0x04BC, // One more formula optimization element\n\n\t\tSHRFMLA_OLD = 0x00BC, // One more formula optimization element, old format\n\n\t\tSTRING = 0x0207, // And one more, for string formula results\n\n\t\tCF = 0x01B1,\n\t\tCODENAME = 0x01BA,\n\t\tCONDFMT = 0x01B0,\n\t\tDCONBIN = 0x01B5,\n\t\tDV = 0x01BE,\n\t\tDVAL = 0x01B2,\n\t\tHLINK = 0x01B8,\n\t\tMSODRAWINGGROUP = 0x00EB,\n\t\tMSODRAWING = 0x00EC,\n\t\tMSODRAWINGSELECTION = 0x00ED,\n\t\tPARAMQRY = 0x00DC,\n\t\tQSI = 0x01AD,\n\t\tSUPBOOK = 0x01AE,\n\t\tSXDB = 0x00C6,\n\t\tSXDBEX = 0x0122,\n\t\tSXFDBTYPE = 0x01BB,\n\t\tSXRULE = 0x00F0,\n\t\tSXEX = 0x00F1,\n\t\tSXFILT = 0x00F2,\n\t\tSXNAME = 0x00F6,\n\t\tSXSELECT = 0x00F7,\n\t\tSXPAIR = 0x00F8,\n\t\tSXFMLA = 0x00F9,\n\t\tSXFORMAT = 0x00FB,\n\t\tSXFORMULA = 0x0103,\n\t\tSXVDEX = 0x0100,\n\t\tTXO = 0x01B6,\n\t\tUSERBVIEW = 0x01A9,\n\t\tUSERSVIEWBEGIN = 0x01AA,\n\t\tUSERSVIEWEND = 0x01AB,\n\t\tUSESELFS = 0x0160,\n\t\tXL5MODIFY = 0x0162,\n\t\tOBJ = 0x005D,\n\t\tNOTE = 0x001C,\n\t\tSXEXT = 0x00DC,\n\t\tVERTICALPAGEBREAKS = 0x001A,\n\t\tXCT = 0x0059,\n\n\t\t/// <summary>\n\t\t/// If present the Calculate Message was in the status bar when Excel saved the file.\n\t\t/// This occurs if the sheet changed, the Manual calculation option was on, and the Recalculate Before Save option was off.        \n\t\t/// </summary>\n\t\tUNCALCED = 0x005E,\n\t\tQUICKTIP = 0x0800\n\t}\n\n\tinternal enum FORMULAERROR : byte\n\t{\n\t\tNULL = 0x00, // #NULL!\n\n\t\tDIV0 = 0x07, // #DIV/0!\n\n\t\tVALUE = 0x0F, // #VALUE!\n\n\t\tREF = 0x17, // #REF!\n\n\t\tNAME = 0x1D, // #NAME?\n\n\t\tNUM = 0x24, // #NUM!\n\n\t\tNA = 0x2A, // #N/A\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffBOF.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents BIFF BOF record\n\t/// </summary>\n\tinternal class XlsBiffBOF : XlsBiffRecord\n\t{\n\t\tinternal XlsBiffBOF(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Version\n\t\t/// </summary>\n\t\tpublic ushort Version\n\t\t{\n\t\t\tget { return ReadUInt16(0x0); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Type of BIFF block\n\t\t/// </summary>\n\t\tpublic BIFFTYPE Type\n\t\t{\n\t\t\tget { return (BIFFTYPE) ReadUInt16(0x2); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creation ID\n\t\t/// </summary>\n\t\t/// <remarks>Not used before BIFF5</remarks>\n\t\tpublic ushort CreationID\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (RecordSize < 6) return 0;\n\t\t\t\treturn ReadUInt16(0x4);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creation year\n\t\t/// </summary>\n\t\t/// <remarks>Not used before BIFF5</remarks>\n\t\tpublic ushort CreationYear\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (RecordSize < 8) return 0;\n\t\t\t\treturn ReadUInt16(0x6);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// File history flag\n\t\t/// </summary>\n\t\t/// <remarks>Not used before BIFF8</remarks>\n\t\tpublic uint HistoryFlag\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (RecordSize < 12) return 0;\n\t\t\t\treturn ReadUInt32(0x8);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Minimum Excel version to open this file\n\t\t/// </summary>\n\t\t/// <remarks>Not used before BIFF8</remarks>\n\t\tpublic uint MinVersionToOpen\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (RecordSize < 16) return 0;\n\t\t\t\treturn ReadUInt32(0xC);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffBlankCell.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents blank cell\n\t/// Base class for all cell types\n\t/// </summary>\n\tinternal class XlsBiffBlankCell : XlsBiffRecord\n\t{\n\t\tinternal XlsBiffBlankCell(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Zero-based index of row containing this cell\n\t\t/// </summary>\n\t\tpublic ushort RowIndex\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x0); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Zero-based index of column containing this cell\n\t\t/// </summary>\n\t\tpublic ushort ColumnIndex\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x2); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Format used for this cell\n\t\t/// </summary>\n\t\tpublic ushort XFormat\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x4); }\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffBoolErr.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.BinaryFormat\n{\n    internal class XlsBiffBoolErr : XlsBiffBlankCell\n    {\n        internal XlsBiffBoolErr(byte[] bytes)\n\t\t\t: this(bytes, 0)\n\t\t{\n\n\t\t}\n\n        internal XlsBiffBoolErr(byte[] bytes, uint offset)\n\t\t\t: base(bytes, offset)\n\t\t{\n\n\t\t}\n\n        public bool BoolValue\n        {\n            get { return this.ReadByte(0x6) == 1; }\n        }\n    }\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffBoundSheet.cs",
    "content": "using System.Text;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents Sheet record in Workbook Globals\n\t/// </summary>\n\tinternal class XlsBiffBoundSheet : XlsBiffRecord\n\t{\n\t\t#region SheetType enum\n\n\t\tpublic enum SheetType : byte\n\t\t{\n\t\t\tWorksheet = 0x0,\n\t\t\tMacroSheet = 0x1,\n\t\t\tChart = 0x2,\n\t\t\tVBModule = 0x6\n\t\t}\n\n\t\t#endregion\n\n\t\t#region SheetVisibility enum\n\n\t\tpublic enum SheetVisibility : byte\n\t\t{\n\t\t\tVisible = 0x0,\n\t\t\tHidden = 0x1,\n\t\t\tVeryHidden = 0x2\n\t\t}\n\n\t\t#endregion\n\n\t\tprivate bool isV8 = true;\n\t\tprivate Encoding m_UseEncoding = Encoding.Default;\n\n\t\tinternal XlsBiffBoundSheet(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\t\t/// <summary>\n\t\t/// Worksheet data start offset\n\t\t/// </summary>\n\t\tpublic uint StartOffset\n\t\t{\n\t\t\tget { return base.ReadUInt32(0x0); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Type of worksheet\n\t\t/// </summary>\n\t\tpublic SheetType Type\n\t\t{\n\t\t\tget { return (SheetType)base.ReadByte(0x4); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Visibility of worksheet\n\t\t/// </summary>\n\t\tpublic SheetVisibility VisibleState\n\t\t{\n\t\t\tget { return (SheetVisibility)(base.ReadByte(0x5) & 0x3); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Name of worksheet\n\t\t/// </summary>\n\t\tpublic string SheetName\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tushort len = base.ReadByte(0x6);\n\n\t\t\t\tint start = 0x8;\n\t\t\t\tif (isV8)\n\t\t\t\t\tif (base.ReadByte(0x7) == 0)\n\t\t\t\t\t\treturn Encoding.Default.GetString(m_bytes, m_readoffset + start, len);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn m_UseEncoding.GetString(m_bytes, m_readoffset + start, Helpers.IsSingleByteEncoding(m_UseEncoding) ? len : len * 2);\n\t\t\t\telse\n\t\t\t\t\treturn Encoding.Default.GetString(m_bytes, m_readoffset + start - 1, len);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Encoding used to deal with strings\n\t\t/// </summary>\n\t\tpublic Encoding UseEncoding\n\t\t{\n\t\t\tget { return m_UseEncoding; }\n\t\t\tset { m_UseEncoding = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Specifies if BIFF8 format should be used\n\t\t/// </summary>\n\t\tpublic bool IsV8\n\t\t{\n\t\t\tget { return isV8; }\n\t\t\tset { isV8 = value; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffContinue.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents additional space for very large records\n\t/// </summary>\n\tinternal class XlsBiffContinue : XlsBiffRecord\n\t{\n\t\tinternal XlsBiffContinue(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffDbCell.cs",
    "content": "using System.Collections.Generic;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents cell-indexing record, finishes each row values block\n\t/// </summary>\n\tinternal class XlsBiffDbCell : XlsBiffRecord\n\t{\n\t\tinternal XlsBiffDbCell(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Offset of first row linked with this record\n\t\t/// </summary>\n\t\tpublic int RowAddress\n\t\t{\n\t\t\tget { return (Offset - base.ReadInt32(0x0)); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Addresses of cell values\n\t\t/// </summary>\n\t\tpublic uint[] CellAddresses\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tint a = RowAddress - 20; // 20 assumed to be row structure size\n\n\t\t\t\tList<uint> tmp = new List<uint>();\n\t\t\t\tfor (int i = 0x4; i < RecordSize; i += 4)\n\t\t\t\t\ttmp.Add((uint) a + base.ReadUInt16(i));\n\t\t\t\treturn tmp.ToArray();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffDimensions.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents Dimensions of worksheet\n\t/// </summary>\n\tinternal class XlsBiffDimensions : XlsBiffRecord\n\t{\n\t\tprivate bool isV8 = true;\n\n\t\tinternal XlsBiffDimensions(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets if BIFF8 addressing is used\n\t\t/// </summary>\n\t\tpublic bool IsV8\n\t\t{\n\t\t\tget { return isV8; }\n\t\t\tset { isV8 = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Index of first row\n\t\t/// </summary>\n\t\tpublic uint FirstRow\n\t\t{\n\t\t\tget { return (isV8) ? base.ReadUInt32(0x0) : base.ReadUInt16(0x0); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Index of last row + 1\n\t\t/// </summary>\n\t\tpublic uint LastRow\n\t\t{\n\t\t\tget { return (isV8) ? base.ReadUInt32(0x4) : base.ReadUInt16(0x2); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Index of first column\n\t\t/// </summary>\n\t\tpublic ushort FirstColumn\n\t\t{\n\t\t\tget { return (isV8) ? base.ReadUInt16(0x8) : base.ReadUInt16(0x4); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Index of last column + 1\n\t\t/// </summary>\n\t\tpublic ushort LastColumn\n\t\t{\n\t\t\tget { return (isV8) ? (ushort)((base.ReadUInt16(0x9) >> 8) + 1) : base.ReadUInt16(0x6); }\n\t\t\tset { throw new System.NotImplementedException(); }\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffEOF.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents BIFF EOF resord\n\t/// </summary>\n\tinternal class XlsBiffEOF : XlsBiffRecord\n\t{\n\t\tinternal XlsBiffEOF(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffFormatString.cs",
    "content": "using System.Text;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents a string value of formula\n\t/// </summary>\n\tinternal class XlsBiffFormatString : XlsBiffRecord\n\t{\n\n        private Encoding m_UseEncoding =  Encoding.Default;\n\t\tprivate string m_value = null;\n\t\t\n        internal XlsBiffFormatString(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\n        /// <summary>\n        /// Encoding used to deal with strings\n        /// </summary>\n        public Encoding UseEncoding\n        {\n            get { return m_UseEncoding; }\n            set { m_UseEncoding = value; }\n        }\n\n\t\t/// <summary>\n\t\t/// Length of the string\n\t\t/// </summary>\n\t\tpublic ushort Length\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t     switch (ID)\n\t\t\t     {\n\t\t\t         case BIFFRECORDTYPE.FORMAT_V23:\n\t\t\t             return base.ReadByte(0x0);\n\t\t\t         default:\n\t\t\t             return base.ReadUInt16(2);\n\t\t\t     }\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// String text\n\t\t/// </summary>\n        public string Value\n        {\n            get\n            {\n                if (m_value == null)\n                {\n                    switch (ID)\n                    {\n                        case BIFFRECORDTYPE.FORMAT_V23:\n                            m_value = m_UseEncoding.GetString(m_bytes, m_readoffset + 1, Length);\n                            break;\n                        case BIFFRECORDTYPE.FORMAT:\n                            var offset = m_readoffset + 5;\n                            var flags = ReadByte(3);\n                            m_UseEncoding = (flags & 0x01) == 0x01 ? Encoding.Unicode : Encoding.Default;\n                            if ((flags & 0x04) == 0x01) // asian phonetic block size\n                                offset += 4;\n                            if ((flags & 0x08) == 0x01) // number of rtf blocks\n                                offset += 2;\n                            m_value = m_UseEncoding.IsSingleByte ? m_UseEncoding.GetString(m_bytes, offset, Length) : m_UseEncoding.GetString(m_bytes, offset, Length*2);\n\n                            break;\n\n\n                    }\n                   \n\n                }\n                return m_value;\n            }\n        }\n\n        public ushort Index\n        {\n            get\n            {\n                switch (ID)\n                {\n                    case BIFFRECORDTYPE.FORMAT_V23:\n                        return 0;\n                    default:\n                        return ReadUInt16(0);\n\n                }\n            }\n        }\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffFormulaCell.cs",
    "content": "using System;\nusing System.Text;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents a cell containing formula\n\t/// </summary>\n\tinternal class XlsBiffFormulaCell : XlsBiffNumberCell\n\t{\n\t\t#region FormulaFlags enum\n\n\t\t[Flags]\n\t\tpublic enum FormulaFlags : ushort\n\t\t{\n\t\t\tAlwaysCalc = 0x0001,\n\t\t\tCalcOnLoad = 0x0002,\n\t\t\tSharedFormulaGroup = 0x0008\n\t\t}\n\n\t\t#endregion\n\n\t\tprivate Encoding m_UseEncoding = Encoding.Default;\n\n\t\tinternal XlsBiffFormulaCell(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Encoding used to deal with strings\n\t\t/// </summary>\n\t\tpublic Encoding UseEncoding\n\t\t{\n\t\t\tget { return m_UseEncoding; }\n\t\t\tset { m_UseEncoding = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Formula flags\n\t\t/// </summary>\n\t\tpublic FormulaFlags Flags\n\t\t{\n\t\t\tget { return (FormulaFlags)(base.ReadUInt16(0xE)); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Length of formula string\n\t\t/// </summary>\n\t\tpublic byte FormulaLength\n\t\t{\n\t\t\tget { return base.ReadByte(0xF); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns type-dependent value of formula\n\t\t/// </summary>\n\t\tpublic new object Value\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tlong val = base.ReadInt64(0x6);\n\t\t\t\tif (((ulong)val & 0xFFFF000000000000) == 0xFFFF000000000000)\n\t\t\t\t{\n\t\t\t\t\tbyte type = (byte)(val & 0xFF);\n\t\t\t\t\tbyte code = (byte)((val >> 16) & 0xFF);\n\t\t\t\t\tswitch (type)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 0: // String\n\n                            //////////////fix\n                            XlsBiffRecord rec = GetRecord(m_bytes, (uint)(Offset + Size), reader);\n                            XlsBiffFormulaString str;\n                            if (rec.ID == BIFFRECORDTYPE.SHRFMLA)\n\t\t\t\t\t\t\t\tstr = GetRecord(m_bytes, (uint)(Offset + Size + rec.Size), reader) as XlsBiffFormulaString;\n                            else\n                                str = rec as XlsBiffFormulaString;\n                            //////////////fix\n\n                            if (str == null)\n                                return string.Empty;\n                            else\n                            {\n                                str.UseEncoding = m_UseEncoding;\n                                return str.Value;\n                            }\n\t\t\t\t\t\tcase 1: // Boolean\n\n\t\t\t\t\t\t\treturn (code != 0);\n\t\t\t\t\t\tcase 2: // Error\n\n\t\t\t\t\t\t\treturn (FORMULAERROR)code;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn Helpers.Int64BitsToDouble(val);\n\t\t\t}\n\t\t}\n\n\t\tpublic string Formula\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tbyte[] bts = base.ReadArray(0x10, FormulaLength);\n\t\t\t\treturn Encoding.Default.GetString(bts, 0, bts.Length);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffFormulaString.cs",
    "content": "using System.Text;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents a string value of formula\n\t/// </summary>\n\tinternal class XlsBiffFormulaString : XlsBiffRecord\n\t{\n\t\tprivate Encoding m_UseEncoding = Encoding.Default;\n\t\tprivate const int LEADING_BYTES_COUNT = 3;\n\n\t\tinternal XlsBiffFormulaString(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Encoding used to deal with strings\n\t\t/// </summary>\n\t\tpublic Encoding UseEncoding\n\t\t{\n\t\t\tget { return m_UseEncoding; }\n\t\t\tset { m_UseEncoding = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Length of the string\n\t\t/// </summary>\n\t\tpublic ushort Length\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x0); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// String text\n\t\t/// </summary>\n\t\tpublic string Value\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\t//is unicode?\n\t\t\t\tif (base.ReadUInt16(0x01) != 0)\n\t\t\t\t{\n\t\t\t\t\treturn Encoding.Unicode.GetString(m_bytes, m_readoffset + LEADING_BYTES_COUNT, Length * 2);\n\t\t\t\t}\n\n\t\t\t\treturn m_UseEncoding.GetString(m_bytes, m_readoffset + LEADING_BYTES_COUNT, Length);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffIndex.cs",
    "content": "using System.Collections.Generic;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents a worksheet index\n\t/// </summary>\n\tinternal class XlsBiffIndex : XlsBiffRecord\n\t{\n\t\tprivate bool isV8 = true;\n\n\t\tinternal XlsBiffIndex(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets if BIFF8 addressing is used\n\t\t/// </summary>\n\t\tpublic bool IsV8\n\t\t{\n\t\t\tget { return isV8; }\n\t\t\tset { isV8 = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns zero-based index of first existing row\n\t\t/// </summary>\n\t\tpublic uint FirstExistingRow\n\t\t{\n\t\t\tget { return (isV8) ? base.ReadUInt32(0x4) : base.ReadUInt16(0x4); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns zero-based index of last existing row\n\t\t/// </summary>\n\t\tpublic uint LastExistingRow\n\t\t{\n\t\t\tget { return (isV8) ? base.ReadUInt32(0x8) : base.ReadUInt16(0x6); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns addresses of DbCell records\n\t\t/// </summary>\n\t\tpublic uint[] DbCellAddresses\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tint size = RecordSize;\n\t\t\t\tint firstIdx = (isV8) ? 16 : 12;\n\t\t\t\tif (size <= firstIdx)\n\t\t\t\t\treturn new uint[0];\n\t\t\t\tList<uint> cells = new List<uint>((size - firstIdx)/4);\n\t\t\t\tfor (int i = firstIdx; i < size; i += 4)\n\t\t\t\t\tcells.Add(base.ReadUInt32(i));\n\t\t\t\treturn cells.ToArray();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffIntegerCell.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents a constant integer number in range 0..65535\n\t/// </summary>\n\tinternal class XlsBiffIntegerCell : XlsBiffBlankCell\n\t{\n\t\tinternal XlsBiffIntegerCell(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns value of this cell\n\t\t/// </summary>\n\t\tpublic uint Value\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x6); }\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffInterfaceHdr.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\n\t/// <summary>\n\t/// Represents InterfaceHdr record in Wokrbook Globals\n\t/// </summary>\n\tinternal class XlsBiffInterfaceHdr : XlsBiffRecord\n\t{\n\t\tinternal XlsBiffInterfaceHdr(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns CodePage for Interface Header\n\t\t/// </summary>\n\t\tpublic ushort CodePage\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x0); }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffLabelCell.cs",
    "content": "using System.Text;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents a string (max 255 bytes)\n\t/// </summary>\n\tinternal class XlsBiffLabelCell : XlsBiffBlankCell\n\t{\n\t\tprivate Encoding m_UseEncoding = Encoding.Default;\n\n\t\tinternal XlsBiffLabelCell(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Encoding used to deal with strings\n\t\t/// </summary>\n\t\tpublic Encoding UseEncoding\n\t\t{\n\t\t\tget { return m_UseEncoding; }\n\t\t\tset { m_UseEncoding = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Length of string value\n\t\t/// </summary>\n\t\tpublic ushort Length\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x6); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns value of this cell\n\t\t/// </summary>\n\t\tpublic string Value\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tbyte[] bts;\n\n\t\t\t\tif (reader.isV8())\n\t\t\t\t{\n\t\t\t\t\t//issue 11636 - according to spec character data starts at byte 9 for biff8 (was using 8)\n\t\t\t\t\tbts = base.ReadArray(0x9, Length * (Helpers.IsSingleByteEncoding(m_UseEncoding) ? 1 : 2));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ //biff 3-5\n\t\t\t\t\tbts = base.ReadArray(0x2, Length * (Helpers.IsSingleByteEncoding(m_UseEncoding) ? 1 : 2));\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\treturn m_UseEncoding.GetString(bts, 0, bts.Length);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffLabelSSTCell.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents a string stored in SST\n\t/// </summary>\n\tinternal class XlsBiffLabelSSTCell : XlsBiffBlankCell\n\t{\n\t\tinternal XlsBiffLabelSSTCell(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Index of string in Shared String Table\n\t\t/// </summary>\n\t\tpublic uint SSTIndex\n\t\t{\n\t\t\tget { return base.ReadUInt32(0x6); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns text using specified SST\n\t\t/// </summary>\n\t\t/// <param name=\"sst\">Shared String Table record</param>\n\t\t/// <returns></returns>\n\t\tpublic string Text(XlsBiffSST sst)\n\t\t{\n\t\t\treturn sst.GetString(SSTIndex);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffMulBlankCell.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents multiple Blank cell\n\t/// </summary>\n\tinternal class XlsBiffMulBlankCell : XlsBiffBlankCell\n\t{\n\t\tinternal XlsBiffMulBlankCell(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Zero-based index of last described column\n\t\t/// </summary>\n\t\tpublic ushort LastColumnIndex\n\t\t{\n\t\t\tget { return base.ReadUInt16(RecordSize - 2); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns format forspecified column, column must be between ColumnIndex and LastColumnIndex\n\t\t/// </summary>\n\t\t/// <param name=\"ColumnIdx\">Index of column</param>\n\t\t/// <returns>Format</returns>\n\t\tpublic ushort GetXF(ushort ColumnIdx)\n\t\t{\n\t\t\tint ofs = 4 + 6*(ColumnIdx - ColumnIndex);\n\t\t\tif (ofs > RecordSize - 2)\n\t\t\t\treturn 0;\n\t\t\treturn base.ReadUInt16(ofs);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffMulRKCell.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents multiple RK number cells\n\t/// </summary>\n\tinternal class XlsBiffMulRKCell : XlsBiffBlankCell\n\t{\n\t\tinternal XlsBiffMulRKCell(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns zero-based index of last described column\n\t\t/// </summary>\n\t\tpublic ushort LastColumnIndex\n\t\t{\n\t\t\tget { return base.ReadUInt16(RecordSize - 2); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns format for specified column\n\t\t/// </summary>\n\t\t/// <param name=\"ColumnIdx\">Index of column, must be between ColumnIndex and LastColumnIndex</param>\n\t\t/// <returns></returns>\n\t\tpublic ushort GetXF(ushort ColumnIdx)\n\t\t{\n\t\t\tint ofs = 4 + 6*(ColumnIdx - ColumnIndex);\n\t\t\tif (ofs > RecordSize - 2)\n\t\t\t\treturn 0;\n\t\t\treturn base.ReadUInt16(ofs);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns value for specified column\n\t\t/// </summary>\n\t\t/// <param name=\"ColumnIdx\">Index of column, must be between ColumnIndex and LastColumnIndex</param>\n\t\t/// <returns></returns>\n\t\tpublic double GetValue(ushort ColumnIdx)\n\t\t{\n\t\t\tint ofs = 6 + 6*(ColumnIdx - ColumnIndex);\n\t\t\tif (ofs > RecordSize)\n\t\t\t\treturn 0;\n\t\t\treturn XlsBiffRKCell.NumFromRK(base.ReadUInt32(ofs));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffNumberCell.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents a floating-point number \n\t/// </summary>\n\tinternal class XlsBiffNumberCell : XlsBiffBlankCell\n\t{\n\t\tinternal XlsBiffNumberCell(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns value of this cell\n\t\t/// </summary>\n\t\tpublic double Value\n\t\t{\n\t\t\tget { return base.ReadDouble(0x6); }\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffQuickTip.cs",
    "content": "using System;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// For now QuickTip will do nothing, it seems to have a different\n\t/// </summary>\n\tinternal class XlsBiffQuickTip : XlsBiffRecord\n\t{\n\n        internal XlsBiffQuickTip(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n        {\n        }\n\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffRKCell.cs",
    "content": "using System;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents an RK number cell\n\t/// </summary>\n\tinternal class XlsBiffRKCell : XlsBiffBlankCell\n\t{\n\t\tinternal XlsBiffRKCell(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns value of this cell\n\t\t/// </summary>\n\t\tpublic double Value\n\t\t{\n\t\t\tget { return NumFromRK(base.ReadUInt32(0x6)); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Decodes RK-encoded number\n\t\t/// </summary>\n\t\t/// <param name=\"rk\">Encoded number</param>\n\t\t/// <returns></returns>\n\t\tpublic static double NumFromRK(uint rk)\n\t\t{\n\t\t\tdouble num;\n\t\t\tif ((rk & 0x2) == 0x2)\n\t\t\t{\n                num = (int)(rk >> 2 | ((rk & 0x80000000) == 0 ? 0 : 0xC0000000));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// hi words of IEEE num\n\t\t\t\tnum = Helpers.Int64BitsToDouble(((long)(rk & 0xfffffffc) << 32));\n\t\t\t}\n\t\t\tif ((rk & 0x1) == 0x1)\n\t\t\t\tnum /= 100; // divide by 100\n\n\t\t\treturn num;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffRecord.cs",
    "content": "using System;\nusing System.IO;\n\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents basic BIFF record\n\t/// Base class for all BIFF record types\n\t/// </summary>\n\tinternal class XlsBiffRecord\n\t{\n\t\tprotected byte[] m_bytes;\n\t\tprotected readonly ExcelBinaryReader reader;\n\t\tprotected int m_readoffset;\n\n\t\tprotected XlsBiffRecord(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t{\n\t\t\tif (bytes.Length - offset < 4)\n\t\t\t\tthrow new ArgumentException(Errors.ErrorBIFFRecordSize);\n\t\t\tm_bytes = bytes;\n\t\t\tthis.reader = reader;\n\t\t\tm_readoffset = (int)(4 + offset);\n\n\t\t\t//Set readOption to loose to not cause exception here (sql reporting services)\n\t\t\tif (reader.ReadOption == ReadOption.Strict)\n\t\t\t{\n\t\t\t\tif (bytes.Length < offset + Size)\n\t\t\t\t\tthrow new ArgumentException(Errors.ErrorBIFFBufferSize);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tinternal byte[] Bytes\n\t\t{\n\t\t\tget { return m_bytes; }\n\t\t}\n\n\t\tinternal int Offset\n\t\t{\n\t\t\tget { return m_readoffset - 4; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns type ID of this entry\n\t\t/// </summary>\n\t\tpublic BIFFRECORDTYPE ID\n\t\t{\n\t\t\tget { return (BIFFRECORDTYPE)BitConverter.ToUInt16(m_bytes, m_readoffset - 4); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns data size of this entry\n\t\t/// </summary>\n\t\tpublic ushort RecordSize\n\t\t{\n\t\t\tget { return BitConverter.ToUInt16(m_bytes, m_readoffset - 2); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns whole size of structure\n\t\t/// </summary>\n\t\tpublic int Size\n\t\t{\n\t\t\tget { return 4 + RecordSize; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns record at specified offset\n\t\t/// </summary>\n\t\t/// <param name=\"bytes\">byte array</param>\n\t\t/// <param name=\"offset\">position in array</param>\n\t\t/// <param name=\"reader\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static XlsBiffRecord GetRecord(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t{\n            if ((uint)offset >= bytes.Length)\n                return null;\n\n\t\t\tuint ID = BitConverter.ToUInt16(bytes, (int)offset);\n\t\t\t//Console.WriteLine(\"GetRecord {0}\", (BIFFRECORDTYPE)ID);\n\t\t\tswitch ((BIFFRECORDTYPE)ID)\n\t\t\t{\n\t\t\t\tcase BIFFRECORDTYPE.BOF_V2:\n\t\t\t\tcase BIFFRECORDTYPE.BOF_V3:\n\t\t\t\tcase BIFFRECORDTYPE.BOF_V4:\n\t\t\t\tcase BIFFRECORDTYPE.BOF:\n\t\t\t\t\treturn new XlsBiffBOF(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.EOF:\n\t\t\t\t\treturn new XlsBiffEOF(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.INTERFACEHDR:\n\t\t\t\t\treturn new XlsBiffInterfaceHdr(bytes, offset, reader);\n\n\t\t\t\tcase BIFFRECORDTYPE.SST:\n\t\t\t\t\treturn new XlsBiffSST(bytes, offset, reader);\n\n\t\t\t\tcase BIFFRECORDTYPE.INDEX:\n\t\t\t\t\treturn new XlsBiffIndex(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.ROW:\n\t\t\t\t\treturn new XlsBiffRow(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.DBCELL:\n\t\t\t\t\treturn new XlsBiffDbCell(bytes, offset, reader);\n\n                case BIFFRECORDTYPE.BOOLERR:\n                case BIFFRECORDTYPE.BOOLERR_OLD:\n\t\t\t\tcase BIFFRECORDTYPE.BLANK:\n\t\t\t\tcase BIFFRECORDTYPE.BLANK_OLD:\n\t\t\t\t\treturn new XlsBiffBlankCell(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.MULBLANK:\n\t\t\t\t\treturn new XlsBiffMulBlankCell(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.LABEL:\n\t\t\t\tcase BIFFRECORDTYPE.LABEL_OLD:\n\t\t\t\tcase BIFFRECORDTYPE.RSTRING:\n\t\t\t\t\treturn new XlsBiffLabelCell(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.LABELSST:\n\t\t\t\t\treturn new XlsBiffLabelSSTCell(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.INTEGER:\n\t\t\t\tcase BIFFRECORDTYPE.INTEGER_OLD:\n\t\t\t\t\treturn new XlsBiffIntegerCell(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.NUMBER:\n\t\t\t\tcase BIFFRECORDTYPE.NUMBER_OLD:\n\t\t\t\t\treturn new XlsBiffNumberCell(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.RK:\n\t\t\t\t\treturn new XlsBiffRKCell(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.MULRK:\n\t\t\t\t\treturn new XlsBiffMulRKCell(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.FORMULA:\n\t\t\t\tcase BIFFRECORDTYPE.FORMULA_OLD:\n\t\t\t\t\treturn new XlsBiffFormulaCell(bytes, offset, reader);\n                case BIFFRECORDTYPE.FORMAT_V23:\n                case BIFFRECORDTYPE.FORMAT:\n\t\t\t\t\treturn new XlsBiffFormatString(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.STRING:\n\t\t\t\t\treturn new XlsBiffFormulaString(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.CONTINUE:\n\t\t\t\t\treturn new XlsBiffContinue(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.DIMENSIONS:\n\t\t\t\t\treturn new XlsBiffDimensions(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.BOUNDSHEET:\n\t\t\t\t\treturn new XlsBiffBoundSheet(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.WINDOW1:\n\t\t\t\t\treturn new XlsBiffWindow1(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.CODEPAGE:\n\t\t\t\t\treturn new XlsBiffSimpleValueRecord(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.FNGROUPCOUNT:\n\t\t\t\t\treturn new XlsBiffSimpleValueRecord(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.RECORD1904:\n\t\t\t\t\treturn new XlsBiffSimpleValueRecord(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.BOOKBOOL:\n\t\t\t\t\treturn new XlsBiffSimpleValueRecord(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.BACKUP:\n\t\t\t\t\treturn new XlsBiffSimpleValueRecord(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.HIDEOBJ:\n\t\t\t\t\treturn new XlsBiffSimpleValueRecord(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.USESELFS:\n\t\t\t\t\treturn new XlsBiffSimpleValueRecord(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.UNCALCED:\n\t\t\t\t\treturn new XlsBiffUncalced(bytes, offset, reader);\n\t\t\t\tcase BIFFRECORDTYPE.QUICKTIP:\n\t\t\t\t\treturn new XlsBiffQuickTip(bytes, offset, reader);\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn new XlsBiffRecord(bytes, offset, reader);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsCell\n\t\t{\n\t\t\tget\n\t\t\t{//FORMULA / Blank / MulBlank / RK / MulRk / BoolErr / Number / LabelSst\n\t\t\t\tvar isCell = false;\n\t\t\t\tswitch ((BIFFRECORDTYPE) ID)\n\t\t\t\t{\n\t\t\t\t\tcase BIFFRECORDTYPE.FORMULA:\n\t\t\t\t\tcase BIFFRECORDTYPE.BLANK:\n\t\t\t\t\tcase BIFFRECORDTYPE.MULBLANK:\n\t\t\t\t\tcase BIFFRECORDTYPE.RK:\n\t\t\t\t\tcase BIFFRECORDTYPE.MULRK:\n\t\t\t\t\tcase BIFFRECORDTYPE.BOOLERR:\n\t\t\t\t\tcase BIFFRECORDTYPE.NUMBER:\n\t\t\t\t\tcase BIFFRECORDTYPE.LABELSST:\n\t\t\t\t\t\tisCell = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\treturn isCell;\n\t\t\t}\n\t\t}\n\n\t\tpublic byte ReadByte(int offset)\n\t\t{\n\t\t\treturn Buffer.GetByte(m_bytes, m_readoffset + offset);\n\t\t}\n\n\t\tpublic ushort ReadUInt16(int offset)\n\t\t{\n\t\t\treturn BitConverter.ToUInt16(m_bytes, m_readoffset + offset);\n\t\t}\n\n\t\tpublic uint ReadUInt32(int offset)\n\t\t{\n\t\t\treturn BitConverter.ToUInt32(m_bytes, m_readoffset + offset);\n\t\t}\n\n\t\tpublic ulong ReadUInt64(int offset)\n\t\t{\n\t\t\treturn BitConverter.ToUInt64(m_bytes, m_readoffset + offset);\n\t\t}\n\n\t\tpublic short ReadInt16(int offset)\n\t\t{\n\t\t\treturn BitConverter.ToInt16(m_bytes, m_readoffset + offset);\n\t\t}\n\n\t\tpublic int ReadInt32(int offset)\n\t\t{\n\t\t\treturn BitConverter.ToInt32(m_bytes, m_readoffset + offset);\n\t\t}\n\n\t\tpublic long ReadInt64(int offset)\n\t\t{\n\t\t\treturn BitConverter.ToInt64(m_bytes, m_readoffset + offset);\n\t\t}\n\n\t\tpublic byte[] ReadArray(int offset, int size)\n\t\t{\n\t\t\tbyte[] tmp = new byte[size];\n\t\t\tBuffer.BlockCopy(m_bytes, m_readoffset + offset, tmp, 0, size);\n\t\t\treturn tmp;\n\t\t}\n\n\t\tpublic float ReadFloat(int offset)\n\t\t{\n\t\t\treturn BitConverter.ToSingle(m_bytes, m_readoffset + offset);\n\t\t}\n\n\t\tpublic double ReadDouble(int offset)\n\t\t{\n\t\t\treturn BitConverter.ToDouble(m_bytes, m_readoffset + offset);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffRow.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents row record in table\n\t/// </summary>\n\tinternal class XlsBiffRow : XlsBiffRecord\n\t{\n\t\tinternal XlsBiffRow(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Zero-based index of row described\n\t\t/// </summary>\n\t\tpublic ushort RowIndex\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x0); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Index of first defined column\n\t\t/// </summary>\n\t\tpublic ushort FirstDefinedColumn\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x2); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Index of last defined column\n\t\t/// </summary>\n\t\tpublic ushort LastDefinedColumn\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x4); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns row height\n\t\t/// </summary>\n\t\tpublic uint RowHeight\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x6); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns row flags\n\t\t/// </summary>\n\t\tpublic ushort Flags\n\t\t{\n\t\t\tget { return base.ReadUInt16(0xC); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns default format for this row\n\t\t/// </summary>\n\t\tpublic ushort XFormat\n\t\t{\n\t\t\tget { return base.ReadUInt16(0xE); }\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffSST.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents a Shared String Table in BIFF8 format\n\t/// </summary>\n\tinternal class XlsBiffSST : XlsBiffRecord\n\t{\n\t\tprivate readonly List<uint> continues = new List<uint>();\n\t\tprivate readonly List<string> m_strings;\n\t\tprivate uint m_size;\n\n\t\tinternal XlsBiffSST(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t\tm_size = RecordSize;\n\t\t\tm_strings = new List<string>();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns count of strings in SST\n\t\t/// </summary>\n\t\tpublic uint Count\n\t\t{\n\t\t\tget { return base.ReadUInt32(0x0); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns count of unique strings in SST\n\t\t/// </summary>\n\t\tpublic uint UniqueCount\n\t\t{\n\t\t\tget { return base.ReadUInt32(0x4); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads strings from BIFF stream into SST array\n\t\t/// </summary>\n\t\tpublic void ReadStrings()\n\t\t{\n\t\t\tuint offset = (uint)m_readoffset + 8;\n\t\t\tuint last = (uint)m_readoffset + RecordSize;\n\t\t\tint lastcontinue = 0;\n\t\t\tuint count = UniqueCount;\n\t\t\twhile (offset < last)\n\t\t\t{\n\t\t\t\tXlsFormattedUnicodeString str = new XlsFormattedUnicodeString(m_bytes, offset);\n\t\t\t\tuint prefix = str.HeadSize;\n\t\t\t\tuint postfix = str.TailSize;\n\t\t\t\tuint len = str.CharacterCount;\n\t\t\t\tuint size = prefix + postfix + len + ((str.IsMultiByte) ? len : 0);\n\t\t\t\tif (offset + size > last)\n\t\t\t\t{\n\t\t\t\t\tif (lastcontinue >= continues.Count)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tuint contoffset = continues[lastcontinue];\n\t\t\t\t\tbyte encoding = Buffer.GetByte(m_bytes, (int)contoffset + 4);\n\t\t\t\t\tbyte[] buff = new byte[size * 2];\n\t\t\t\t\tBuffer.BlockCopy(m_bytes, (int)offset, buff, 0, (int)(last - offset));\n\t\t\t\t\tif (encoding == 0 && str.IsMultiByte)\n\t\t\t\t\t{\n\t\t\t\t\t\tlen -= (last - prefix - offset) / 2;\n\t\t\t\t\t\tstring temp = Encoding.Default.GetString(m_bytes,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (int)contoffset + 5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (int)len);\n\t\t\t\t\t\tbyte[] tempbytes = Encoding.Unicode.GetBytes(temp);\n\t\t\t\t\t\tBuffer.BlockCopy(tempbytes, 0, buff, (int)(last - offset), tempbytes.Length);\n\t\t\t\t\t\tBuffer.BlockCopy(m_bytes, (int)(contoffset + 5 + len), buff, (int)(last - offset + len + len), (int)postfix);\n\t\t\t\t\t\toffset = contoffset + 5 + len + postfix;\n\t\t\t\t\t}\n\t\t\t\t\telse if (encoding == 1 && str.IsMultiByte == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tlen -= (last - offset - prefix);\n\t\t\t\t\t\tstring temp = Encoding.Unicode.GetString(m_bytes,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (int)contoffset + 5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (int)(len + len));\n\t\t\t\t\t\tbyte[] tempbytes = Encoding.Default.GetBytes(temp);\n\t\t\t\t\t\tBuffer.BlockCopy(tempbytes, 0, buff, (int)(last - offset), tempbytes.Length);\n\t\t\t\t\t\tBuffer.BlockCopy(m_bytes, (int)(contoffset + 5 + len + len), buff, (int)(last - offset + len), (int)postfix);\n\t\t\t\t\t\toffset = contoffset + 5 + len + len + postfix;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tBuffer.BlockCopy(m_bytes, (int)contoffset + 5, buff, (int)(last - offset), (int)(size - last + offset));\n\t\t\t\t\t\toffset = contoffset + 5 + size - last + offset;\n\t\t\t\t\t}\n\t\t\t\t\tlast = contoffset + 4 + BitConverter.ToUInt16(m_bytes, (int)contoffset + 2);\n\t\t\t\t\tlastcontinue++;\n\n\t\t\t\t\tstr = new XlsFormattedUnicodeString(buff, 0);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\toffset += size;\n\t\t\t\t\tif (offset == last)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (lastcontinue < continues.Count)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tuint contoffset = continues[lastcontinue];\n\t\t\t\t\t\t\toffset = contoffset + 4;\n\t\t\t\t\t\t\tlast = offset + BitConverter.ToUInt16(m_bytes, (int)contoffset + 2);\n\t\t\t\t\t\t\tlastcontinue++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcount = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tm_strings.Add(str.Value);\n\t\t\t\tcount--;\n\t\t\t\tif (count == 0)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns string at specified index\n\t\t/// </summary>\n\t\t/// <param name=\"SSTIndex\">Index of string to get</param>\n\t\t/// <returns>string value if it was found, empty string otherwise</returns>\n\t\tpublic string GetString(uint SSTIndex)\n\t\t{\n\t\t\tif (SSTIndex < m_strings.Count)\n\t\t\t\treturn m_strings[(int)SSTIndex];\n\n\n\t\t\treturn string.Empty;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Appends Continue record to SST\n\t\t/// </summary>\n\t\t/// <param name=\"fragment\">Continue record</param>\n\t\tpublic void Append(XlsBiffContinue fragment)\n\t\t{\n\t\t\tcontinues.Add((uint)fragment.Offset);\n\t\t\tm_size += (uint)fragment.Size;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffSimpleValueRecord.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents record with the only two-bytes value\n\t/// </summary>\n\tinternal class XlsBiffSimpleValueRecord : XlsBiffRecord\n\t{\n\t\tinternal XlsBiffSimpleValueRecord(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns value\n\t\t/// </summary>\n\t\tpublic ushort Value\n\t\t{\n\t\t\tget { return ReadUInt16(0x0); }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffStream.cs",
    "content": "using System;\nusing System.IO;\nusing System.Runtime.CompilerServices;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents a BIFF stream\n\t/// </summary>\n\tinternal class XlsBiffStream : XlsStream\n\t{\n\t\tprivate readonly ExcelBinaryReader reader;\n\t\tprivate readonly byte[] bytes;\n\t\tprivate readonly int m_size;\n\t\tprivate int m_offset;\n\n\t\tpublic XlsBiffStream(XlsHeader hdr, uint streamStart, bool isMini, XlsRootDirectory rootDir, ExcelBinaryReader reader)\n\t\t\t: base(hdr, streamStart, isMini, rootDir)\n\t\t{\n\t\t\tthis.reader = reader;\n\t\t\tbytes = base.ReadStream();\n\t\t\tm_size = bytes.Length;\n\t\t\tm_offset = 0;\n\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns size of BIFF stream in bytes\n\t\t/// </summary>\n\t\tpublic int Size\n\t\t{\n\t\t\tget { return m_size; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns current position in BIFF stream\n\t\t/// </summary>\n\t\tpublic int Position\n\t\t{\n\t\t\tget { return m_offset; }\n\t\t}\n\n\t\t//TODO:Remove ReadStream\n\t\t/// <summary>\n\t\t/// Always returns null, use biff-specific methods\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\t[Obsolete(\"Use BIFF-specific methods for this stream\")]\n\t\tpublic new byte[] ReadStream()\n\t\t{\n\t\t\treturn bytes;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Sets stream pointer to the specified offset\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">Offset value</param>\n\t\t/// <param name=\"origin\">Offset origin</param>\n\t\t[MethodImpl(MethodImplOptions.Synchronized)]\n\t\tpublic void Seek(int offset, SeekOrigin origin)\n\t\t{\n\t\t\tswitch (origin)\n\t\t\t{\n\t\t\t\tcase SeekOrigin.Begin:\n\t\t\t\t\tm_offset = offset;\n\t\t\t\t\tbreak;\n\t\t\t\tcase SeekOrigin.Current:\n\t\t\t\t\tm_offset += offset;\n\t\t\t\t\tbreak;\n\t\t\t\tcase SeekOrigin.End:\n\t\t\t\t\tm_offset = m_size - offset;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (m_offset < 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(string.Format(\"{0} On offset={1}\", Errors.ErrorBIFFIlegalBefore, offset));\n\t\t\tif (m_offset > m_size)\n\t\t\t\tthrow new ArgumentOutOfRangeException(string.Format(\"{0} On offset={1}\", Errors.ErrorBIFFIlegalAfter, offset));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads record under cursor and advances cursor position to next record\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\t[MethodImpl(MethodImplOptions.Synchronized)]\n\t\tpublic XlsBiffRecord Read()\n\t\t{\n            if ((uint)m_offset >= bytes.Length)\n                return null;\n\n\t\t\tXlsBiffRecord rec = XlsBiffRecord.GetRecord(bytes, (uint)m_offset, reader);\n\t\t\tm_offset += rec.Size;\n\t\t\tif (m_offset > m_size)\n\t\t\t\treturn null;\n\t\t\treturn rec;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads record at specified offset, does not change cursor position\n\t\t/// </summary>\n\t\t/// <param name=\"offset\"></param>\n\t\t/// <returns></returns>\n\t\tpublic XlsBiffRecord ReadAt(int offset)\n\t\t{\n            if ((uint)offset >= bytes.Length)\n                return null;\n\n\t\t\tXlsBiffRecord rec = XlsBiffRecord.GetRecord(bytes, (uint)offset, reader);\n\n\t\t\t//choose ReadOption.Loose to skip this check (e.g. sql reporting services)\n\t\t\tif (reader.ReadOption == ReadOption.Strict)\n\t\t\t{\n\t\t\t\tif (m_offset + rec.Size > m_size)\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\treturn rec;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffUncalced.cs",
    "content": "namespace Excel.Core.BinaryFormat\n{\n    /// <summary>\n    /// If present the Calculate Message was in the status bar when Excel saved the file.\n    /// This occurs if the sheet changed, the Manual calculation option was on, and the Recalculate Before Save option was off.    \n    /// </summary>\n    internal class XlsBiffUncalced : XlsBiffRecord\n    {\n        internal XlsBiffUncalced(byte[] bytes, uint offset, ExcelBinaryReader reader)\n            : base(bytes, offset, reader)\n        {\n        }\n\n    }\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsBiffWindow1.cs",
    "content": "using System;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents Workbook's global window description\n\t/// </summary>\n\tinternal class XlsBiffWindow1 : XlsBiffRecord\n\t{\n\t\t#region Window1Flags enum\n\n\t\t[Flags]\n\t\tpublic enum Window1Flags : ushort\n\t\t{\n\t\t\tHidden = 0x1,\n\t\t\tMinimized = 0x2,\n\t\t\t//(Reserved) = 0x4,\n\n\t\t\tHScrollVisible = 0x8,\n\t\t\tVScrollVisible = 0x10,\n\t\t\tWorkbookTabs = 0x20\n\t\t\t//(Other bits are reserved)\n\t\t}\n\n\t\t#endregion\n\n\t\tinternal XlsBiffWindow1(byte[] bytes, uint offset, ExcelBinaryReader reader)\n\t\t\t: base(bytes, offset, reader)\n\t\t{\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Returns X position of a window\n\t\t/// </summary>\n\t\tpublic ushort Left\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x0); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns Y position of a window\n\t\t/// </summary>\n\t\tpublic ushort Top\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x2); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns width of a window\n\t\t/// </summary>\n\t\tpublic ushort Width\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x4); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns height of a window\n\t\t/// </summary>\n\t\tpublic ushort Height\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x6); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns window flags\n\t\t/// </summary>\n\t\tpublic Window1Flags Flags\n\t\t{\n\t\t\tget { return (Window1Flags) base.ReadUInt16(0x8); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns active workbook tab (zero-based)\n\t\t/// </summary>\n\t\tpublic ushort ActiveTab\n\t\t{\n\t\t\tget { return base.ReadUInt16(0xA); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns first visible workbook tab (zero-based)\n\t\t/// </summary>\n\t\tpublic ushort FirstVisibleTab\n\t\t{\n\t\t\tget { return base.ReadUInt16(0xC); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns number of selected workbook tabs\n\t\t/// </summary>\n\t\tpublic ushort SelectedTabCount\n\t\t{\n\t\t\tget { return base.ReadUInt16(0xE); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns workbook tab width to horizontal scrollbar width\n\t\t/// </summary>\n\t\tpublic ushort TabRatio\n\t\t{\n\t\t\tget { return base.ReadUInt16(0x10); }\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsDirectoryEntry.cs",
    "content": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents single Root Directory record\n\t/// </summary>\n\tinternal class XlsDirectoryEntry\n\t{\n\t\t/// <summary>\n\t\t/// Length of structure in bytes\n\t\t/// </summary>\n\t\tpublic const int Length = 0x80;\n\n\t\tprivate readonly byte[] m_bytes;\n\t\tprivate XlsDirectoryEntry m_child;\n\t\tprivate XlsDirectoryEntry m_leftSibling;\n\t\tprivate XlsDirectoryEntry m_rightSibling;\n\t\tprivate XlsHeader m_header;\n\n\t\t/// <summary>\n\t\t/// Constructor\n\t\t/// </summary>\n\t\t/// <param name=\"bytes\">byte array representing current object</param>\n\t\t/// <param name=\"header\"></param>\n\t\tpublic XlsDirectoryEntry(byte[] bytes, XlsHeader header)\n\t\t{\n\t\t\tif (bytes.Length < Length)\n\t\t\t\tthrow new Excel.Exceptions.BiffRecordException(Errors.ErrorDirectoryEntryArray);\n\t\t\tm_bytes = bytes;\n\t\t\tm_header = header;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns name of directory entry\n\t\t/// </summary>\n\t\tpublic string EntryName\n\t\t{\n\t\t\tget { return Encoding.Unicode.GetString(m_bytes, 0x0, EntryLength).TrimEnd('\\0'); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns size in bytes of entry's name (with terminating zero)\n\t\t/// </summary>\n\t\tpublic ushort EntryLength\n\t\t{\n\t\t\tget { return BitConverter.ToUInt16(m_bytes, 0x40); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns entry type\n\t\t/// </summary>\n\t\tpublic STGTY EntryType\n\t\t{\n\t\t\tget { return (STGTY)Buffer.GetByte(m_bytes, 0x42); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Retuns entry \"color\" in directory tree\n\t\t/// </summary>\n\t\tpublic DECOLOR EntryColor\n\t\t{\n\t\t\tget { return (DECOLOR)Buffer.GetByte(m_bytes, 0x43); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns SID of left sibling\n\t\t/// </summary>\n\t\t/// <remarks>0xFFFFFFFF if there's no one</remarks>\n\t\tpublic uint LeftSiblingSid\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x44); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns left sibling\n\t\t/// </summary>\n\t\tpublic XlsDirectoryEntry LeftSibling\n\t\t{\n\t\t\tget { return m_leftSibling; }\n\t\t\tset { if (m_leftSibling == null) m_leftSibling = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns SID of right sibling\n\t\t/// </summary>\n\t\t/// <remarks>0xFFFFFFFF if there's no one</remarks>\n\t\tpublic uint RightSiblingSid\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x48); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns right sibling\n\t\t/// </summary>\n\t\tpublic XlsDirectoryEntry RightSibling\n\t\t{\n\t\t\tget { return m_rightSibling; }\n\t\t\tset { if (m_rightSibling == null) m_rightSibling = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns SID of first child (if EntryType is STGTY_STORAGE)\n\t\t/// </summary>\n\t\t/// <remarks>0xFFFFFFFF if there's no one</remarks>\n\t\tpublic uint ChildSid\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x4C); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns child\n\t\t/// </summary>\n\t\tpublic XlsDirectoryEntry Child\n\t\t{\n\t\t\tget { return m_child; }\n\t\t\tset { if (m_child == null) m_child = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// CLSID of container (if EntryType is STGTY_STORAGE)\n\t\t/// </summary>\n\t\tpublic Guid ClassId\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tbyte[] tmp = new byte[16];\n\t\t\t\tBuffer.BlockCopy(m_bytes, 0x50, tmp, 0, 16);\n\t\t\t\treturn new Guid(tmp);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns user flags of container (if EntryType is STGTY_STORAGE)\n\t\t/// </summary>\n\t\tpublic uint UserFlags\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x60); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns creation time of entry\n\t\t/// </summary>\n\t\tpublic DateTime CreationTime\n\t\t{\n\t\t\tget { return DateTime.FromFileTime(BitConverter.ToInt64(m_bytes, 0x64)); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns last modification time of entry\n\t\t/// </summary>\n\t\tpublic DateTime LastWriteTime\n\t\t{\n\t\t\tget { return DateTime.FromFileTime(BitConverter.ToInt64(m_bytes, 0x6C)); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// First sector of data stream (if EntryType is STGTY_STREAM)\n\t\t/// </summary>\n\t\t/// <remarks>if EntryType is STGTY_ROOT, this can be first sector of MiniStream</remarks>\n\t\tpublic uint StreamFirstSector\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x74); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Size of data stream (if EntryType is STGTY_STREAM)\n\t\t/// </summary>\n\t\t/// <remarks>if EntryType is STGTY_ROOT, this can be size of MiniStream</remarks>\n\t\tpublic uint StreamSize\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x78); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determines whether this entry relats to a ministream\n\t\t/// </summary>\n\t\tpublic bool IsEntryMiniStream\n\t\t{\n\t\t\tget { return (StreamSize < m_header.MiniStreamCutoff); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reserved, must be 0\n\t\t/// </summary>\n\t\tpublic uint PropType\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x7C); }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsFat.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents Excel file FAT table\n\t/// </summary>\n\tinternal class XlsFat\n\t{\n\t\tprivate readonly List<uint> m_fat;\n\t\tprivate readonly XlsHeader m_hdr;\n\t\tprivate readonly int m_sectors;\n\t\tprivate readonly int m_sectors_for_fat;\n\t\tprivate readonly int m_sectorSize;\n\t\tprivate readonly bool m_isMini;\n\t\tprivate readonly XlsRootDirectory m_rootDir = null;\n\n\t\t/// <summary>\n\t\t/// Constructs FAT table from list of sectors\n\t\t/// </summary>\n\t\t/// <param name=\"hdr\">XlsHeader</param>\n\t\t/// <param name=\"sectors\">Sectors list</param>\n\t\t/// <param name=\"sizeOfSector\"></param>\n\t\t/// <param name=\"isMini\"></param>\n\t\t/// <param name=\"rootDir\"></param>\n\t\tpublic XlsFat(XlsHeader hdr, List<uint> sectors, int sizeOfSector, bool isMini, XlsRootDirectory rootDir)\n\t\t{\n\t\t\tm_isMini = isMini;\n\t\t\tm_rootDir = rootDir;\n\t\t\tm_hdr = hdr;\n\t\t\tm_sectors_for_fat = sectors.Count;\n\t\t\tsizeOfSector = hdr.SectorSize;\n\t\t\tuint sector = 0, prevSector = 0;\n\n\t\t\t//calc offset of stream . If mini stream then find mini stream container stream\n\t\t\t//long offset = 0;\n\t\t\t//if (rootDir != null)\n\t\t\t//\toffset = isMini ? (hdr.MiniFatFirstSector + 1) * hdr.SectorSize : 0;\n\n\t\t\tbyte[] buff = new byte[sizeOfSector];\n\t\t\tStream file = hdr.FileStream;\n\t\t\tusing (MemoryStream ms = new MemoryStream(sizeOfSector * m_sectors_for_fat))\n\t\t\t{\n\t\t\t\tlock (file)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < sectors.Count; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tsector = sectors[i];\n\t\t\t\t\t\tif (prevSector == 0 || (sector - prevSector) != 1)\n\t\t\t\t\t\t\tfile.Seek((sector + 1) * sizeOfSector, SeekOrigin.Begin);\n\t\t\t\t\t\tprevSector = sector;\n\t\t\t\t\t\tfile.Read(buff, 0, sizeOfSector);\n\t\t\t\t\t\tms.Write(buff, 0, sizeOfSector);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tms.Seek(0, SeekOrigin.Begin);\n\t\t\t\tBinaryReader rd = new BinaryReader(ms);\n\t\t\t\tm_sectors = (int)ms.Length / 4;\n\t\t\t\tm_fat = new List<uint>(m_sectors);\n\t\t\t\tfor (int i = 0; i < m_sectors; i++)\n\t\t\t\t\tm_fat.Add(rd.ReadUInt32());\n\t\t\t\trd.Close();\n\t\t\t\tms.Close();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Resurns number of sectors used by FAT itself\n\t\t/// </summary>\n\t\tpublic int SectorsForFat\n\t\t{\n\t\t\tget { return m_sectors_for_fat; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns number of sectors described by FAT\n\t\t/// </summary>\n\t\tpublic int SectorsCount\n\t\t{\n\t\t\tget { return m_sectors; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns underlying XlsHeader object\n\t\t/// </summary>\n\t\tpublic XlsHeader Header\n\t\t{\n\t\t\tget { return m_hdr; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns next data sector using FAT\n\t\t/// </summary>\n\t\t/// <param name=\"sector\">Current data sector</param>\n\t\t/// <returns>Next data sector</returns>\n\t\tpublic uint GetNextSector(uint sector)\n\t\t{\n\t\t\tif (m_fat.Count <= sector)\n\t\t\t\tthrow new ArgumentException(Errors.ErrorFATBadSector);\n\t\t\tuint value = m_fat[(int)sector];\n\t\t\tif (value == (uint)FATMARKERS.FAT_FatSector || value == (uint)FATMARKERS.FAT_DifSector)\n\t\t\t\tthrow new InvalidOperationException(Errors.ErrorFATRead);\n\t\t\treturn value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsFormattedUnicodeString.cs",
    "content": "using System;\nusing System.Text;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents formatted unicode string in SST\n\t/// </summary>\n\tinternal class XlsFormattedUnicodeString\n\t{\n\t\t#region FormattedUnicodeStringFlags enum\n\n\t\t[Flags]\n\t\tpublic enum FormattedUnicodeStringFlags : byte\n\t\t{\n\t\t\tMultiByte = 0x01,\n\t\t\tHasExtendedString = 0x04,\n\t\t\tHasFormatting = 0x08,\n\t\t}\n\n\t\t#endregion\n\n\t\tprotected byte[] m_bytes;\n\t\tprotected uint m_offset;\n\n\t\tpublic XlsFormattedUnicodeString(byte[] bytes, uint offset)\n\t\t{\n\t\t\tm_bytes = bytes;\n\t\t\tm_offset = offset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Count of characters in string\n\t\t/// </summary>\n\t\tpublic ushort CharacterCount\n\t\t{\n\t\t\tget { return BitConverter.ToUInt16(m_bytes, (int)m_offset); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// String flags\n\t\t/// </summary>\n\t\tpublic FormattedUnicodeStringFlags Flags\n\t\t{\n\t\t\tget { return (FormattedUnicodeStringFlags)Buffer.GetByte(m_bytes, (int)m_offset + 2); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Checks if string has Extended record\n\t\t/// </summary>\n\t\tpublic bool HasExtString\n\t\t{\n\t\t\tget { return false; }\n\t\t\t// ((Flags & FormattedUnicodeStringFlags.HasExtendedString) == FormattedUnicodeStringFlags.HasExtendedString); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Checks if string has formatting\n\t\t/// </summary>\n\t\tpublic bool HasFormatting\n\t\t{\n\t\t\tget { return ((Flags & FormattedUnicodeStringFlags.HasFormatting) == FormattedUnicodeStringFlags.HasFormatting); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Checks if string is unicode\n\t\t/// </summary>\n\t\tpublic bool IsMultiByte\n\t\t{\n\t\t\tget { return ((Flags & FormattedUnicodeStringFlags.MultiByte) == FormattedUnicodeStringFlags.MultiByte); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns length of string in bytes\n\t\t/// </summary>\n\t\tprivate uint ByteCount\n\t\t{\n\t\t\tget { return (uint)(CharacterCount * ((IsMultiByte) ? 2 : 1)); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns number of formats used for formatting (0 if string has no formatting)\n\t\t/// </summary>\n\t\tpublic ushort FormatCount\n\t\t{\n\t\t\tget { return (HasFormatting) ? BitConverter.ToUInt16(m_bytes, (int)m_offset + 3) : (ushort)0; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns size of extended string in bytes, 0 if there is no one\n\t\t/// </summary>\n\t\tpublic uint ExtendedStringSize\n\t\t{\n\t\t\tget { return (HasExtString) ? (uint)BitConverter.ToUInt16(m_bytes, (int)m_offset + ((HasFormatting) ? 5 : 3)) : 0; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns head (before string data) size in bytes\n\t\t/// </summary>\n\t\tpublic uint HeadSize\n\t\t{\n\t\t\tget { return (uint)((HasFormatting) ? 2 : 0) + (uint)((HasExtString) ? 4 : 0) + 3; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns tail (after string data) size in bytes\n\t\t/// </summary>\n\t\tpublic uint TailSize\n\t\t{\n\t\t\tget { return (uint)((HasFormatting) ? 4 * FormatCount : 0) + ((HasExtString) ? ExtendedStringSize : 0); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns size of whole record in bytes\n\t\t/// </summary>\n\t\tpublic uint Size\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tuint extraSize = (uint)((HasFormatting) ? (2 + FormatCount * 4) : 0) +\n\t\t\t\t\t\t\t\t ((HasExtString) ? (4 + ExtendedStringSize) : 0) + 3;\n\t\t\t\tif (!IsMultiByte)\n\t\t\t\t\treturn extraSize + CharacterCount;\n\t\t\t\treturn extraSize + (uint)CharacterCount * 2;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns string represented by this instance\n\t\t/// </summary>\n\t\tpublic string Value\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn IsMultiByte ?\n\t\t\t\t\tEncoding.Unicode.GetString(m_bytes, (int)(m_offset + HeadSize), (int)ByteCount) :\n\t\t\t\t\t Encoding.Default.GetString(m_bytes, (int)(m_offset + HeadSize), (int)ByteCount);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsHeader.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing Excel.Exceptions;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents Excel file header\n\t/// </summary>\n\tinternal class XlsHeader\n\t{\n\t\tprivate readonly byte[] m_bytes;\n\t\tprivate readonly Stream m_file;\n\t\tprivate XlsFat m_fat;\n\t\tprivate XlsFat m_minifat;\n\n\t\tprivate XlsHeader(Stream file)\n\t\t{\n\t\t\tm_bytes = new byte[512];\n\t\t\tm_file = file;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns file signature\n\t\t/// </summary>\n\t\tpublic ulong Signature\n\t\t{\n\t\t\tget { return BitConverter.ToUInt64(m_bytes, 0x0); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Checks if file signature is valid\n\t\t/// </summary>\n\t\tpublic bool IsSignatureValid\n\t\t{\n\t\t\tget { return (Signature == 0xE11AB1A1E011CFD0); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Typically filled with zeroes\n\t\t/// </summary>\n\t\tpublic Guid ClassId\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tbyte[] tmp = new byte[16];\n\t\t\t\tBuffer.BlockCopy(m_bytes, 0x8, tmp, 0, 16);\n\t\t\t\treturn new Guid(tmp);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Must be 0x003E\n\t\t/// </summary>\n\t\tpublic ushort Version\n\t\t{\n\t\t\tget { return BitConverter.ToUInt16(m_bytes, 0x18); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Must be 0x0003\n\t\t/// </summary>\n\t\tpublic ushort DllVersion\n\t\t{\n\t\t\tget { return BitConverter.ToUInt16(m_bytes, 0x1A); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Must be 0xFFFE\n\t\t/// </summary>\n\t\tpublic ushort ByteOrder\n\t\t{\n\t\t\tget { return BitConverter.ToUInt16(m_bytes, 0x1C); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Typically 512\n\t\t/// </summary>\n\t\tpublic int SectorSize\n\t\t{\n\t\t\tget { return (1 << BitConverter.ToUInt16(m_bytes, 0x1E)); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Typically 64\n\t\t/// </summary>\n\t\tpublic int MiniSectorSize\n\t\t{\n\t\t\tget { return (1 << BitConverter.ToUInt16(m_bytes, 0x20)); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Number of FAT sectors\n\t\t/// </summary>\n\t\tpublic int FatSectorCount\n\t\t{\n\t\t\tget { return BitConverter.ToInt32(m_bytes, 0x2C); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Number of first Root Directory Entry (Property Set Storage, FAT Directory) sector\n\t\t/// </summary>\n\t\tpublic uint RootDirectoryEntryStart\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x30); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Transaction signature, 0 for Excel\n\t\t/// </summary>\n\t\tpublic uint TransactionSignature\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x34); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Maximum size for small stream, typically 4096 bytes\n\t\t/// </summary>\n\t\tpublic uint MiniStreamCutoff\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x38); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// First sector of Mini FAT, FAT_EndOfChain if there's no one\n\t\t/// </summary>\n\t\tpublic uint MiniFatFirstSector\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x3C); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Number of sectors in Mini FAT, 0 if there's no one\n\t\t/// </summary>\n\t\tpublic int MiniFatSectorCount\n\t\t{\n\t\t\tget { return BitConverter.ToInt32(m_bytes, 0x40); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// First sector of DIF, FAT_EndOfChain if there's no one\n\t\t/// </summary>\n\t\tpublic uint DifFirstSector\n\t\t{\n\t\t\tget { return BitConverter.ToUInt32(m_bytes, 0x44); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Number of sectors in DIF, 0 if there's no one\n\t\t/// </summary>\n\t\tpublic int DifSectorCount\n\t\t{\n\t\t\tget { return BitConverter.ToInt32(m_bytes, 0x48); }\n\t\t}\n\n\t\tpublic Stream FileStream\n\t\t{\n\t\t\tget { return m_file; }\n\t\t}\n\n\t\t\n\t\t/// <summary>\n\t\t/// Returns mini FAT table\n\t\t/// </summary>\n\t\tpublic XlsFat GetMiniFAT(XlsRootDirectory rootDir)\n\t\t{\n\t\t\tif (m_minifat != null)\n\t\t\t\treturn m_minifat;\n\n\t\t\t//if no minifat then return null\n\t\t\tif (MiniFatSectorCount == 0 || MiniSectorSize == 0xFFFFFFFE)\n\t\t\t\treturn null;\n\n\t\t\tuint value;\n\t\t\tint miniSectorSize = MiniSectorSize;\n\t\t\tList<uint> sectors = new List<uint>(MiniFatSectorCount);\n\n\t\t\t//find the sector where the minifat starts\n\t\t\tvar miniFatStartSector = BitConverter.ToUInt32(m_bytes, 0x3c);\n\t\t\tsectors.Add(miniFatStartSector);\n\t\t\t//lock (m_file)\n\t\t\t//{\n\t\t\t//\t//work out the file location of minifat then read each sector\n\t\t\t//\tvar miniFatStartOffset = (miniFatStartSector + 1)*SectorSize;\n\t\t\t//\tvar miniFatSize = MiniFatSectorCount * SectorSize;\n\t\t\t//\tm_file.Seek(miniFatStartOffset, SeekOrigin.Begin);\n\n\t\t\t//\tbyte[] sectorBuff = new byte[SectorSize];\n\n\t\t\t//\tfor (var i = 0; i < MiniFatSectorCount; i += SectorSize)\n\t\t\t//\t{\n\t\t\t//\t\tm_file.Read(sectorBuff, 0, 4);\n\t\t\t//\t\tvar secId = BitConverter.ToUInt32(sectorBuff, 0);\n\t\t\t//\t\tsectors.Add(secId);\n\t\t\t//\t}\n\t\t\t//}\n\t\t\t\t\n\t\t\tm_minifat = new XlsFat(this, sectors, this.MiniSectorSize, true, rootDir);\n\t\t\treturn m_minifat;\n\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns full FAT table, including DIF sectors\n\t\t/// </summary>\n\t\tpublic XlsFat FAT\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (m_fat != null)\n\t\t\t\t\treturn m_fat;\n\n\t\t\t\tuint value;\n\t\t\t\tint sectorSize = SectorSize;\n\t\t\t\tList<uint> sectors = new List<uint>(FatSectorCount);\n\t\t\t\tfor (int i = 0x4C; i < sectorSize; i += 4)\n\t\t\t\t{\n\t\t\t\t\tvalue = BitConverter.ToUInt32(m_bytes, i);\n\t\t\t\t\tif (value == (uint)FATMARKERS.FAT_FreeSpace)\n\t\t\t\t\t\tgoto XlsHeader_Fat_Ready;\n\t\t\t\t\tsectors.Add(value);\n\t\t\t\t}\n\t\t\t\tint difCount;\n\t\t\t\tif ((difCount = DifSectorCount) == 0)\n\t\t\t\t\tgoto XlsHeader_Fat_Ready;\n\t\t\t\tlock (m_file)\n\t\t\t\t{\n\t\t\t\t\tuint difSector = DifFirstSector;\n\t\t\t\t\tbyte[] buff = new byte[sectorSize];\n\t\t\t\t\tuint prevSector = 0;\n\t\t\t\t\twhile (difCount > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tsectors.Capacity += 128;\n\t\t\t\t\t\tif (prevSector == 0 || (difSector - prevSector) != 1)\n\t\t\t\t\t\t\tm_file.Seek((difSector + 1) * sectorSize, SeekOrigin.Begin);\n\t\t\t\t\t\tprevSector = difSector;\n\t\t\t\t\t\tm_file.Read(buff, 0, sectorSize);\n\t\t\t\t\t\tfor (int i = 0; i < 508; i += 4)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = BitConverter.ToUInt32(buff, i);\n\t\t\t\t\t\t\tif (value == (uint)FATMARKERS.FAT_FreeSpace)\n\t\t\t\t\t\t\t\tgoto XlsHeader_Fat_Ready;\n\t\t\t\t\t\t\tsectors.Add(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue = BitConverter.ToUInt32(buff, 508);\n\t\t\t\t\t\tif (value == (uint)FATMARKERS.FAT_FreeSpace)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tif ((difCount--) > 1)\n\t\t\t\t\t\t\tdifSector = value;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tsectors.Add(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tXlsHeader_Fat_Ready:\n\t\t\t\tm_fat = new XlsFat(this, sectors, this.SectorSize, false, null);\n\t\t\t\treturn m_fat;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads Excel header from Stream\n\t\t/// </summary>\n\t\t/// <param name=\"file\">Stream with Excel file</param>\n\t\t/// <returns>XlsHeader representing specified file</returns>\n\t\tpublic static XlsHeader ReadHeader(Stream file)\n\t\t{\n\t\t\tXlsHeader hdr = new XlsHeader(file);\n\t\t\tlock (file)\n\t\t\t{\n\t\t\t\tfile.Seek(0, SeekOrigin.Begin);\n\t\t\t\tfile.Read(hdr.m_bytes, 0, 512);\n\t\t\t}\n\t\t\tif (!hdr.IsSignatureValid)\n\t\t\t\tthrow new HeaderException(Errors.ErrorHeaderSignature);\n\t\t\tif (hdr.ByteOrder != 0xFFFE)\n\t\t\t\tthrow new FormatException(Errors.ErrorHeaderOrder);\n\t\t\treturn hdr;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsRootDirectory.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents Root Directory in file\n\t/// </summary>\n\tinternal class XlsRootDirectory\n\t{\n\t\tprivate readonly List<XlsDirectoryEntry> m_entries;\n\t\tprivate readonly XlsDirectoryEntry m_root;\n\n\t\t/// <summary>\n\t\t/// Creates Root Directory catalog from XlsHeader\n\t\t/// </summary>\n\t\t/// <param name=\"hdr\">XlsHeader object</param>\n\t\tpublic XlsRootDirectory(XlsHeader hdr)\n\t\t{\n\t\t\tXlsStream stream = new XlsStream(hdr, hdr.RootDirectoryEntryStart, false, null);\n\t\t\tbyte[] array = stream.ReadStream();\n\t\t\tbyte[] tmp;\n\t\t\tXlsDirectoryEntry entry;\n\t\t\tList<XlsDirectoryEntry> entries = new List<XlsDirectoryEntry>();\n\t\t\tfor (int i = 0; i < array.Length; i += XlsDirectoryEntry.Length)\n\t\t\t{\n\t\t\t\ttmp = new byte[XlsDirectoryEntry.Length];\n\t\t\t\tBuffer.BlockCopy(array, i, tmp, 0, tmp.Length);\n\t\t\t\tentries.Add(new XlsDirectoryEntry(tmp, hdr));\n\t\t\t}\n\t\t\tm_entries = entries;\n\t\t\tfor (int i = 0; i < entries.Count; i++)\n\t\t\t{\n\t\t\t\tentry = entries[i];\n\n\t\t\t\t//Console.WriteLine(\"Directory Entry:{0} type:{1}, firstsector:{2}, streamSize:{3}, isEntryMiniStream:{4}\", entry.EntryName, entry.EntryType.ToString(), entry.StreamFirstSector, entry.StreamSize, entry.IsEntryMiniStream);\n\t\t\t\tif (m_root == null && entry.EntryType == STGTY.STGTY_ROOT)\n\t\t\t\t\tm_root = entry;\n\t\t\t\tif (entry.ChildSid != (uint)FATMARKERS.FAT_FreeSpace)\n\t\t\t\t\tentry.Child = entries[(int)entry.ChildSid];\n\t\t\t\tif (entry.LeftSiblingSid != (uint)FATMARKERS.FAT_FreeSpace)\n\t\t\t\t\tentry.LeftSibling = entries[(int)entry.LeftSiblingSid];\n\t\t\t\tif (entry.RightSiblingSid != (uint)FATMARKERS.FAT_FreeSpace)\n\t\t\t\t\tentry.RightSibling = entries[(int)entry.RightSiblingSid];\n\t\t\t}\n\t\t\tstream.CalculateMiniFat(this);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns all entries in Root Directory\n\t\t/// </summary>\n\t\tpublic ReadOnlyCollection<XlsDirectoryEntry> Entries\n\t\t{\n\t\t\tget { return m_entries.AsReadOnly(); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the Root Entry\n\t\t/// </summary>\n\t\tpublic XlsDirectoryEntry RootEntry\n\t\t{\n\t\t\tget { return m_root; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Searches for first matching entry by its name\n\t\t/// </summary>\n\t\t/// <param name=\"EntryName\">String name of entry</param>\n\t\t/// <returns>Entry if found, null otherwise</returns>\n\t\tpublic XlsDirectoryEntry FindEntry(string EntryName)\n\t\t{\n\t\t\tforeach (XlsDirectoryEntry e in m_entries)\n\t\t\t{\n                if (string.Equals(e.EntryName, EntryName, StringComparison.CurrentCultureIgnoreCase))\n\t\t\t\t\treturn e;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsStream.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents an Excel file stream\n\t/// </summary>\n\tinternal class XlsStream\n\t{\n\t\tprotected XlsFat m_fat;\n\t\tprotected XlsFat m_minifat;\n\t\tprotected Stream m_fileStream;\n\t\tprotected XlsHeader m_hdr;\n\t\tprotected uint m_startSector;\n\t\tprotected bool m_isMini;\n\t\tprotected XlsRootDirectory m_rootDir;\n\n\t\tpublic XlsStream(XlsHeader hdr, uint startSector, bool isMini, XlsRootDirectory rootDir)\n\t\t{\n\t\t\tm_fileStream = hdr.FileStream;\n\t\t\tm_fat = hdr.FAT;\n\t\t\tm_hdr = hdr;\n\t\t\tm_startSector = startSector;\n\t\t\tm_isMini = isMini;\n\t\t\tm_rootDir = rootDir;\n\n\t\t\tCalculateMiniFat(rootDir);\n\n\t\t}\n\n\t\tpublic void CalculateMiniFat(XlsRootDirectory rootDir)\n\t\t{\n\t\t\tm_minifat = m_hdr.GetMiniFAT(rootDir);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns offset of first stream sector\n\t\t/// </summary>\n\t\tpublic uint BaseOffset\n\t\t{\n\t\t\tget { return (uint)((m_startSector + 1) * m_hdr.SectorSize); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns number of first stream sector\n\t\t/// </summary>\n\t\tpublic uint BaseSector\n\t\t{\n\t\t\tget { return (m_startSector); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads stream data from file\n\t\t/// </summary>\n\t\t/// <returns>Stream data</returns>\n\t\tpublic byte[] ReadStream()\n\t\t{\n\n\t\t\tuint sector = m_startSector, prevSector = 0;\n\t\t\tint sectorSize = m_isMini ? m_hdr.MiniSectorSize : m_hdr.SectorSize;\n\t\t\tvar fat = m_isMini ? m_minifat : m_fat;\n\t\t\tlong offset = 0;\n\t\t\tif (m_isMini && m_rootDir != null)\n\t\t\t{\n\t\t\t\toffset = (m_rootDir.RootEntry.StreamFirstSector + 1)*m_hdr.SectorSize;\n\t\t\t}\n\n\t\t\tbyte[] buff = new byte[sectorSize];\n\t\t\tbyte[] ret;\n\n\t\t\tusing (MemoryStream ms = new MemoryStream(sectorSize * 8))\n\t\t\t{\n\t\t\t\tlock (m_fileStream)\n\t\t\t\t{\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tif (prevSector == 0 || (sector - prevSector) != 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar adjustedSector = m_isMini ? sector : sector + 1; //standard sector is + 1 because header is first\n\t\t\t\t\t\t\tm_fileStream.Seek(adjustedSector * sectorSize + offset, SeekOrigin.Begin);\n\t\t\t\t\t\t}\n\n                        if (prevSector != 0 && prevSector == sector)\n                            throw new InvalidOperationException(\"The excel file may be corrupt. We appear to be stuck\");\n\n\t\t\t\t\t\tprevSector = sector;\n\t\t\t\t\t\tm_fileStream.Read(buff, 0, sectorSize);\n\t\t\t\t\t\tms.Write(buff, 0, sectorSize);\n\n\t\t\t\t\t    sector = fat.GetNextSector(sector);\n\n                        if (sector == 0)\n                            throw new InvalidOperationException(\"Next sector cannot be 0. Possibly corrupt excel file\");\n\t\t\t\t\t} while (sector != (uint)FATMARKERS.FAT_EndOfChain);\n\t\t\t\t}\n\n\t\t\t\tret = ms.ToArray();\n\t\t\t}\n\n\t\t\treturn ret;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsWorkbookGlobals.cs",
    "content": "using System.Collections.Generic;\n\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents Globals section of workbook\n\t/// </summary>\n\tinternal class XlsWorkbookGlobals\n\t{\n\t\tprivate readonly List<XlsBiffRecord> m_ExtendedFormats = new List<XlsBiffRecord>();\n\t\tprivate readonly List<XlsBiffRecord> m_Fonts = new List<XlsBiffRecord>();\n        private readonly Dictionary<ushort, XlsBiffFormatString> m_Formats = new Dictionary<ushort, XlsBiffFormatString>();\n\t\tprivate readonly List<XlsBiffBoundSheet> m_Sheets = new List<XlsBiffBoundSheet>();\n\t\tprivate readonly List<XlsBiffRecord> m_Styles = new List<XlsBiffRecord>();\n\t\tprivate XlsBiffSimpleValueRecord m_Backup;\n\t\tprivate XlsBiffSimpleValueRecord m_CodePage;\n\t\tprivate XlsBiffRecord m_Country;\n\t\tprivate XlsBiffRecord m_DSF;\n\t\tprivate XlsBiffRecord m_ExtSST;\n\t\tprivate XlsBiffInterfaceHdr m_InterfaceHdr;\n\n\t\tprivate XlsBiffRecord m_MMS;\n\t\tprivate XlsBiffSST m_SST;\n\n\t\tprivate XlsBiffRecord m_WriteAccess;\n\n\t\tpublic XlsBiffInterfaceHdr InterfaceHdr\n\t\t{\n\t\t\tget { return m_InterfaceHdr; }\n\t\t\tset { m_InterfaceHdr = value; }\n\t\t}\n\n\t\tpublic XlsBiffRecord MMS\n\t\t{\n\t\t\tget { return m_MMS; }\n\t\t\tset { m_MMS = value; }\n\t\t}\n\n\t\tpublic XlsBiffRecord WriteAccess\n\t\t{\n\t\t\tget { return m_WriteAccess; }\n\t\t\tset { m_WriteAccess = value; }\n\t\t}\n\n\t\tpublic XlsBiffSimpleValueRecord CodePage\n\t\t{\n\t\t\tget { return m_CodePage; }\n\t\t\tset { m_CodePage = value; }\n\t\t}\n\n\t\tpublic XlsBiffRecord DSF\n\t\t{\n\t\t\tget { return m_DSF; }\n\t\t\tset { m_DSF = value; }\n\t\t}\n\n\t\tpublic XlsBiffRecord Country\n\t\t{\n\t\t\tget { return m_Country; }\n\t\t\tset { m_Country = value; }\n\t\t}\n\n\t\tpublic XlsBiffSimpleValueRecord Backup\n\t\t{\n\t\t\tget { return m_Backup; }\n\t\t\tset { m_Backup = value; }\n\t\t}\n\n\t\tpublic List<XlsBiffRecord> Fonts\n\t\t{\n\t\t\tget { return m_Fonts; }\n\t\t}\n\n        public Dictionary<ushort, XlsBiffFormatString> Formats\n\t\t{\n\t\t\tget { return m_Formats; }\n\t\t}\n\n        \n\n\t\tpublic List<XlsBiffRecord> ExtendedFormats\n\t\t{\n\t\t\tget { return m_ExtendedFormats; }\n\t\t}\n\n\t\tpublic List<XlsBiffRecord> Styles\n\t\t{\n\t\t\tget { return m_Styles; }\n\t\t}\n\n\t\tpublic List<XlsBiffBoundSheet> Sheets\n\t\t{\n\t\t\tget { return m_Sheets; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Shared String Table of workbook\n\t\t/// </summary>\n\t\tpublic XlsBiffSST SST\n\t\t{\n\t\t\tget { return m_SST; }\n\t\t\tset { m_SST = value; }\n\t\t}\n\n\t\tpublic XlsBiffRecord ExtSST\n\t\t{\n\t\t\tget { return m_ExtSST; }\n\t\t\tset { m_ExtSST = value; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "Excel/Core/BinaryFormat/XlsWorksheet.cs",
    "content": "\nnamespace Excel.Core.BinaryFormat\n{\n\t/// <summary>\n\t/// Represents Worksheet section in workbook\n\t/// </summary>\n\tinternal class XlsWorksheet\n\t{\n\t\tprivate readonly uint m_dataOffset;\n\t\tprivate readonly int m_Index;\n\t\tprivate readonly string m_Name = string.Empty;\n\t\tprivate XlsBiffSimpleValueRecord m_CalcCount;\n\t\tprivate XlsBiffSimpleValueRecord m_CalcMode;\n\t\tprivate XlsBiffRecord m_Delta;\n\t\tprivate XlsBiffDimensions m_Dimensions;\n\t\tprivate XlsBiffSimpleValueRecord m_Iteration;\n\t\tprivate XlsBiffSimpleValueRecord m_RefMode;\n\t\tprivate XlsBiffRecord m_Window;\n\n\t\tpublic XlsWorksheet(int index, XlsBiffBoundSheet refSheet)\n\t\t{\n\t\t\tm_Index = index;\n\t\t\tm_Name = refSheet.SheetName;\n\t\t\tm_dataOffset = refSheet.StartOffset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Name of worksheet\n\t\t/// </summary>\n\t\tpublic string Name\n\t\t{\n\t\t\tget { return m_Name; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Zero-based index of worksheet\n\t\t/// </summary>\n\t\tpublic int Index\n\t\t{\n\t\t\tget { return m_Index; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Offset of worksheet data\n\t\t/// </summary>\n\t\tpublic uint DataOffset\n\t\t{\n\t\t\tget { return m_dataOffset; }\n\t\t}\n\n\t\tpublic XlsBiffSimpleValueRecord CalcMode\n\t\t{\n\t\t\tget { return m_CalcMode; }\n\t\t\tset { m_CalcMode = value; }\n\t\t}\n\n\t\tpublic XlsBiffSimpleValueRecord CalcCount\n\t\t{\n\t\t\tget { return m_CalcCount; }\n\t\t\tset { m_CalcCount = value; }\n\t\t}\n\n\t\tpublic XlsBiffSimpleValueRecord RefMode\n\t\t{\n\t\t\tget { return m_RefMode; }\n\t\t\tset { m_RefMode = value; }\n\t\t}\n\n\t\tpublic XlsBiffSimpleValueRecord Iteration\n\t\t{\n\t\t\tget { return m_Iteration; }\n\t\t\tset { m_Iteration = value; }\n\t\t}\n\n\t\tpublic XlsBiffRecord Delta\n\t\t{\n\t\t\tget { return m_Delta; }\n\t\t\tset { m_Delta = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Dimensions of worksheet\n\t\t/// </summary>\n\t\tpublic XlsBiffDimensions Dimensions\n\t\t{\n\t\t\tget { return m_Dimensions; }\n\t\t\tset { m_Dimensions = value; }\n\t\t}\n\n\t\tpublic XlsBiffRecord Window\n\t\t{\n\t\t\tget { return m_Window; }\n\t\t\tset { m_Window = value; }\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "Excel/Core/FormatReader.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core\n{\n\tpublic class FormatReader\n\t{\n\t\tprivate const char escapeChar = '\\\\';\n\t\tpublic string FormatString { get; set; }\n\t\tpublic FormatReader()\n\t\t{\n\t\t\t\n\t\t}\n\n\t\tpublic bool IsDateFormatString()\n\t\t{\n\t\t\t//it is a date if it contains y,m,d,s,h but only\n\t\t\t//if the term is not contained in [ ] (i.e. a color) e.g. [Red] \n\t\t\t//or the term is not in quotes \"d\" (means display d)\n\t\t\t//or the term is not preceded by a backslash e.g. \\d (means display d)\n\n\t\t\tvar dateChars = new char[] { 'y', 'm', 'd', 's', 'h', 'Y', 'M', 'D', 'S', 'H' };\n\t\t\tif (FormatString.IndexOfAny(dateChars) >= 0)\n\t\t\t{\n\t\t\t\tvar isDate = false;\n\t\t\t\t//it is a date candidate\n\t\t\t\tforeach (var dateChar in dateChars)\n\t\t\t\t{\n\t\t\t\t\t//perform our checks for each occurance of the character\n\t\t\t\t\tvar pos = FormatString.IndexOf(dateChar);\n\t\t\t\t\twhile (pos > -1)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t//could probably do this with regex...\n\t\t\t\t\t\tif (!IsSurroundedByBracket(dateChar, pos) &&\n\t\t\t\t\t\t\t\t!IsPrecededByBackSlash(dateChar, pos) &&\n\t\t\t\t\t\t\t\t!IsSurroundedByQuotes(dateChar, pos))\n\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\t//get next occurance\n\t\t\t\t\t\tpos = FormatString.IndexOf(dateChar, pos + 1);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate bool IsSurroundedByQuotes(char dateChar, int pos)\n\t\t{\n\t\t\t//char was at end then can't be surrounded\n\t\t\tif (pos == FormatString.Length - 1)\n\t\t\t\treturn false;\n\n\t\t\t//is there an odd number of quotes after pos\n\t\t\t//is there an odd number of quotes before pos\n\t\t\tint numAfter = NumberOfUnescapedOccurances('\"', FormatString.Substring(pos + 1));\n\t\t\tint numBefore = NumberOfUnescapedOccurances('\"', FormatString.Substring(0, pos));\n\n\t\t\treturn numAfter % 2 == 1 && numBefore % 2 == 1;\n\n\t\t}\n\n\t\tprivate bool IsPrecededByBackSlash(char dateChar, int pos)\n\t\t{\n\t\t\tif (pos == 0)\n\t\t\t\treturn false;\n\n\n\t\t\tchar lastChar = FormatString[pos - 1];\n\t\t\tif (lastChar.CompareTo(escapeChar) == 0)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate bool IsSurroundedByBracket(char dateChar, int pos)\n\t\t{\n\t\t\t//char was at end then can't be surrounded\n\t\t\tif (pos == FormatString.Length - 1)\n\t\t\t\treturn false;\n\n\t\t\t//if number of [ before minus number of [ before is odd and \n\t\t\t//if number of ] after minus number of ] after is odd then it is surrounded \n\t\t\tint numOpenBefore = NumberOfUnescapedOccurances('[', FormatString.Substring(0, pos));\n\t\t\tint numClosedBefore = NumberOfUnescapedOccurances(']', FormatString.Substring(0, pos));\n\t\t\tnumOpenBefore = numOpenBefore - numClosedBefore;\n\n\t\t\tint numOpenAfter = NumberOfUnescapedOccurances('[', FormatString.Substring(pos + 1));\n\t\t\tint numClosedAfter = NumberOfUnescapedOccurances(']', FormatString.Substring(pos + 1));\n\t\t\tnumClosedAfter = numClosedAfter - numOpenAfter;\n\n\t\t\treturn numOpenBefore % 2 == 1 && numClosedAfter % 2 == 1;\n\t\t}\n\n\t\tprivate int NumberOfUnescapedOccurances(char value, string src)\n\t\t{\n\t\t\tvar numOccurances = 0;\n\t\t\tchar lastChar = Char.MinValue;\n\t\t\tforeach (char c in src)\n\t\t\t{\n\t\t\t\tif (c != value)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (lastChar != Char.MinValue && lastChar.CompareTo(escapeChar) == 0) //ignore if escaped\n\t\t\t\t\tcontinue;\n\n\t\t\t\tnumOccurances++;\n\t\t\t\tlastChar = c;\n\t\t\t}\n\n\t\t\treturn numOccurances;\n\t\t}\n\n\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/Helpers.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.Globalization;\nusing System.Text.RegularExpressions;\nusing System.Text;\n\nnamespace Excel.Core\n{\n\t/// <summary>\n\t/// Helpers class\n\t/// </summary>\n\tinternal static class Helpers\n\t{\n#if CF_DEBUG || CF_RELEASE\n\n\t\t/// <summary>\n\t\t/// Determines whether [is single byte] [the specified encoding].\n\t\t/// </summary>\n\t\t/// <param name=\"encoding\">The encoding.</param>\n\t\t/// <returns>\n\t\t/// \t<c>true</c> if [is single byte] [the specified encoding]; otherwise, <c>false</c>.\n\t\t/// </returns>\n\t\tpublic static bool IsSingleByteEncoding(Encoding encoding)\n\t\t{\n\t\t\treturn encoding.GetChars(new byte[] { 0xc2, 0xb5 }).Length == 1;\n\t\t}\n#else\n\n\t\t/// <summary>\n\t\t/// Determines whether [is single byte] [the specified encoding].\n\t\t/// </summary>\n\t\t/// <param name=\"encoding\">The encoding.</param>\n\t\t/// <returns>\n\t\t/// \t<c>true</c> if [is single byte] [the specified encoding]; otherwise, <c>false</c>.\n\t\t/// </returns>\n\t\tpublic static bool IsSingleByteEncoding(Encoding encoding)\n\t\t{\n\t\t\treturn encoding.IsSingleByte;\n\t\t}\n#endif\n\n\t\tpublic static double Int64BitsToDouble(long value)\n\t\t{\n\t\t\treturn BitConverter.ToDouble(BitConverter.GetBytes(value), 0);\n\t\t}\n\n\t    private static Regex re = new Regex(\"_x([0-9A-F]{4,4})_\");\n\n        public static string ConvertEscapeChars(string input)\n        {\n            return re.Replace(input, m => (((char)UInt32.Parse(m.Groups[1].Value, NumberStyles.HexNumber))).ToString());\n        }\n\n\t    public static object ConvertFromOATime(double value)\n\t    {\n\t        if ((value >= 0.0) && (value < 60.0))\n\t        {\n\t            value++;\n\t        }\n\t        //if (date1904)\n\t        //{\n\t        //    Value += 1462.0;\n\t        //}\n\t        return DateTime.FromOADate(value);\n\t    }\n\n        internal static void FixDataTypes(DataSet dataset)\n        {\n            var tables = new List<DataTable>(dataset.Tables.Count);\n            bool convert = false;\n            foreach (DataTable table in dataset.Tables)\n            {\n               \n                if ( table.Rows.Count == 0)\n                {\n                    tables.Add(table);\n                    continue;\n                }\n                DataTable newTable = null;\n                for (int i = 0; i < table.Columns.Count; i++)\n                {\n                    Type type = null;\n                    foreach (DataRow row  in table.Rows)\n                    {\n                        if (row.IsNull(i))\n                            continue;\n                        var curType = row[i].GetType();\n                        if (curType != type)\n                        {\n                            if (type == null)\n                                type = curType;\n                            else\n                            {\n                                type = null;\n                                break;\n                            }\n                        }\n                    }\n                    if (type != null)\n                    {\n                        convert = true;\n                        if (newTable == null)\n                            newTable = table.Clone();\n                        newTable.Columns[i].DataType = type;\n\n                    }\n                }\n                if (newTable != null)\n                {\n                    newTable.BeginLoadData();\n                    foreach (DataRow row in table.Rows)\n                    {\n                        newTable.ImportRow(row);\n                    }\n\n                    newTable.EndLoadData();\n                    tables.Add(newTable);\n\n                }\n                else tables.Add(table);\n            }\n            if (convert)\n            {\n                dataset.Tables.Clear();\n                dataset.Tables.AddRange(tables.ToArray());\n            }\n        }\n\n\t\tpublic static void AddColumnHandleDuplicate(DataTable table, string columnName)\n\t\t{\n\t\t\t//if a colum  already exists with the name append _i to the duplicates\n\t\t\tvar adjustedColumnName = columnName;\n\t\t\tvar column = table.Columns[columnName];\n\t\t\tvar i = 1;\n\t\t\twhile (column != null)\n\t\t\t{\n\t\t\t\tadjustedColumnName = string.Format(\"{0}_{1}\", columnName, i);\n\t\t\t\tcolumn = table.Columns[adjustedColumnName];\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\ttable.Columns.Add(adjustedColumnName, typeof(Object));\n\t\t}\n\n\n    }\n}"
  },
  {
    "path": "Excel/Core/OpenXmlFormat/XlsxDimension.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.OpenXmlFormat\n{\n\tinternal class XlsxDimension\n\t{\n\t\tpublic XlsxDimension(string value)\n\t\t{\n\t\t\tParseDimensions(value);\n\t\t}\n\n\t\tpublic XlsxDimension(int rows, int cols)\n\t\t{\n\t\t\tthis.FirstRow = 1;\n\t\t\tthis.LastRow = rows;\n\t\t\tthis.FirstCol = 1;\n\t\t\tthis.LastCol = cols;\n\t\t}\n\n\t\tprivate int _FirstRow;\n\n\t\tpublic int FirstRow\n\t\t{\n\t\t\tget { return _FirstRow; }\n\t\t\tset { _FirstRow = value; }\n\t\t}\n\n\t\tprivate int _LastRow;\n\n\t\tpublic int LastRow\n\t\t{\n\t\t\tget { return _LastRow; }\n\t\t\tset { _LastRow = value; }\n\t\t}\n\n\t\tprivate int _FirstCol;\n\n\t\tpublic int FirstCol\n\t\t{\n\t\t\tget { return _FirstCol; }\n\t\t\tset { _FirstCol = value; }\n\t\t}\n\n\t\tprivate int _LastCol;\n\n\t\tpublic int LastCol\n\t\t{\n\t\t\tget { return _LastCol; }\n\t\t\tset { _LastCol = value; }\n\t\t}\n\n\t\tpublic void ParseDimensions(string value)\n\t\t{\n\t\t\tstring[] parts = value.Split(':');\n\n\t\t\tint col;\n\t\t\tint row;\n\n\t\t\tXlsxDim(parts[0], out col, out row);\n\t\t\tFirstCol = col;\n\t\t\tFirstRow = row;\n\n\t\t\tif (parts.Length == 1)\n\t\t\t{\n\t\t\t\tLastCol = FirstCol;\n\t\t\t\tLastRow = FirstRow;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tXlsxDim(parts[1], out col, out row);\n\t\t\t\tLastCol = col;\n\t\t\t\tLastRow = row;\n\t\t\t}\n\t\t\t\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Logic for the Excel dimensions. Ex: A15\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value.</param>\n\t\t/// <param name=\"val1\">out val1.</param>\n\t\t/// <param name=\"val2\">out val2.</param>\n\t\tpublic static void XlsxDim(string value, out int val1, out int val2)\n\t\t{//INFO: Check for a simple Solution\n\t\t\tint index = 0;\n\t\t\tval1 = 0;\n\t\t\tint[] arr = new int[value.Length - 1];\n\n\t\t\twhile (index < value.Length)\n\t\t\t{\n\t\t\t\tif (char.IsDigit(value[index])) break;\n\t\t\t\tarr[index] = value[index] - 'A' + 1;\n\t\t\t\tindex++;\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < index; i++)\n\t\t\t{\n\t\t\t\tval1 += (int)(arr[i] * Math.Pow(26, index - i - 1));\n\t\t\t}\n\n\t\t\tval2 = int.Parse(value.Substring(index));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/OpenXmlFormat/XlsxNumFmt.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.OpenXmlFormat\n{\n\tinternal class XlsxNumFmt\n\t{\n\t\tpublic const string N_numFmt = \"numFmt\";\n\t\tpublic const string A_numFmtId = \"numFmtId\";\n\t\tpublic const string A_formatCode = \"formatCode\";\n\n\t\tprivate int _Id;\n\n\t\tpublic int Id\n\t\t{\n\t\t\tget { return _Id; }\n\t\t\tset { _Id = value; }\n\t\t}\n\n\t\tprivate string _FormatCode;\n\n\t\tpublic string FormatCode\n\t\t{\n\t\t\tget { return _FormatCode; }\n\t\t\tset { _FormatCode = value; }\n\t\t}\n\n\t\tpublic XlsxNumFmt(int id, string formatCode)\n\t\t{\n\t\t\t_Id = id;\n\t\t\t_FormatCode = formatCode;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/OpenXmlFormat/XlsxSST.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.OpenXmlFormat\n{\n\t/// <summary>\n\t/// Shared string table\n\t/// </summary>\n\tinternal class XlsxSST : List<string>\n\t{\n\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/OpenXmlFormat/XlsxStyles.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.OpenXmlFormat\n{\n\tinternal class XlsxStyles\n\t{\n\t\tpublic XlsxStyles()\n\t\t{\n\t\t\t_cellXfs = new List<XlsxXf>();\n\t\t\t_NumFmts = new List<XlsxNumFmt>();\n\t\t}\n\n\t\tprivate List<XlsxXf> _cellXfs;\n\n\t\tpublic List<XlsxXf> CellXfs\n\t\t{\n\t\t\tget { return _cellXfs; }\n\t\t\tset { _cellXfs = value; }\n\t\t}\n\n\t\tprivate List<XlsxNumFmt> _NumFmts;\n\n\t\tpublic List<XlsxNumFmt> NumFmts\n\t\t{\n\t\t\tget { return _NumFmts; }\n\t\t\tset { _NumFmts = value; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/OpenXmlFormat/XlsxWorkbook.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Xml;\nusing System.IO;\n\n\nnamespace Excel.Core.OpenXmlFormat\n{\n    internal class XlsxWorkbook\n    {\n        private const string N_sheet = \"sheet\";\n        private const string N_t = \"t\";\n        private const string N_si = \"si\";\n        private const string N_cellXfs = \"cellXfs\";\n        private const string N_numFmts = \"numFmts\";\n\n        private const string A_sheetId = \"sheetId\";\n        private const string A_name = \"name\";\n        private const string A_rid = \"r:id\";\n\n        private const string N_rel = \"Relationship\";\n        private const string A_id = \"Id\";\n        private const string A_target = \"Target\";\n\n        private XlsxWorkbook() { }\n\n        public XlsxWorkbook(Stream workbookStream, Stream relsStream, Stream sharedStringsStream, Stream stylesStream)\n        {\n            if (null == workbookStream) throw new ArgumentNullException();\n\n            ReadWorkbook(workbookStream);\n\n            ReadWorkbookRels(relsStream);\n\n            ReadSharedStrings(sharedStringsStream);\n\n            ReadStyles(stylesStream);\n        }\n\n        private List<XlsxWorksheet> sheets;\n\n        public List<XlsxWorksheet> Sheets\n        {\n            get { return sheets; }\n            set { sheets = value; }\n        }\n\n        private XlsxSST _SST;\n\n        public XlsxSST SST\n        {\n            get { return _SST; }\n        }\n\n        private XlsxStyles _Styles;\n\n        public XlsxStyles Styles\n        {\n            get { return _Styles; }\n        }\n\n\n        private void ReadStyles(Stream xmlFileStream)\n        {\n            if (null == xmlFileStream) return;\n\n            _Styles = new XlsxStyles();\n\n            bool rXlsxNumFmt = false;\n\n            using (XmlReader reader = XmlReader.Create(xmlFileStream))\n            {\n                while (reader.Read())\n                {\n                    if (!rXlsxNumFmt && reader.NodeType == XmlNodeType.Element && reader.LocalName == N_numFmts)\n                    {\n                        while (reader.Read())\n                        {\n                            if (reader.NodeType == XmlNodeType.Element && reader.Depth == 1) break;\n\n                            if (reader.NodeType == XmlNodeType.Element && reader.LocalName == XlsxNumFmt.N_numFmt)\n                            {\n                                _Styles.NumFmts.Add(\n                                    new XlsxNumFmt(\n                                        int.Parse(reader.GetAttribute(XlsxNumFmt.A_numFmtId)),\n                                        reader.GetAttribute(XlsxNumFmt.A_formatCode)\n                                        ));\n                            }\n                        }\n\n                        rXlsxNumFmt = true;\n                    }\n\n                    if (reader.NodeType == XmlNodeType.Element && reader.LocalName == N_cellXfs)\n                    {\n                        while (reader.Read())\n                        {\n                            if (reader.NodeType == XmlNodeType.Element && reader.Depth == 1) break;\n\n                            if (reader.NodeType == XmlNodeType.Element && reader.LocalName == XlsxXf.N_xf)\n                            {\n\t                            var xfId = reader.GetAttribute(XlsxXf.A_xfId);\n\t                            var numFmtId = reader.GetAttribute(XlsxXf.A_numFmtId);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t_Styles.CellXfs.Add(\n                                    new XlsxXf(\n\t\t\t\t\t\t\t\t\t\txfId == null ? -1 : int.Parse(xfId),\n\t\t\t\t\t\t\t\t\t\tnumFmtId == null ? -1 : int.Parse(numFmtId),\n                                        reader.GetAttribute(XlsxXf.A_applyNumberFormat)\n                                        ));\n                            }\n                        }\n\n                        break;\n                    }\n                }\n\n                xmlFileStream.Close();\n            }\n        }\n\n        private void ReadSharedStrings(Stream xmlFileStream)\n        {\n            if (null == xmlFileStream) return;\n\n            _SST = new XlsxSST();\n\n            using (XmlReader reader = XmlReader.Create(xmlFileStream))\n            {\n                // There are multiple <t> in a <si>. Concatenate <t> within an <si>.\n                bool bAddStringItem = false;\n                string sStringItem = \"\";\n\n                while (reader.Read())\n                {\n                    // There are multiple <t> in a <si>. Concatenate <t> within an <si>.\n                    if (reader.NodeType == XmlNodeType.Element && reader.LocalName == N_si)\n                    {\n                        // Do not add the string item until the next string item is read.\n                        if (bAddStringItem)\n                        {\n                            // Add the string item to XlsxSST.\n                            _SST.Add(sStringItem);\n                        }\n                        else\n                        {\n                            // Add the string items from here on.\n                            bAddStringItem = true;\n                        }\n\n                        // Reset the string item.\n                        sStringItem = \"\";\n                    }\n\n                    if (reader.NodeType == XmlNodeType.Element && reader.LocalName == N_t)\n                    {\n                        // Append to the string item.\n                        sStringItem += reader.ReadElementContentAsString();\n                    }\n                }\n                // Do not add the last string item unless we have read previous string items.\n                if (bAddStringItem)\n                {\n                    // Add the string item to XlsxSST.\n                    _SST.Add(sStringItem);\n                }\n\n                xmlFileStream.Close();\n            }\n        }\n\n\n        private void ReadWorkbook(Stream xmlFileStream)\n        {\n            sheets = new List<XlsxWorksheet>();\n\n            using (XmlReader reader = XmlReader.Create(xmlFileStream))\n            {\n                while (reader.Read())\n                {\n                    if (reader.NodeType == XmlNodeType.Element && reader.LocalName == N_sheet)\n                    {\n                        sheets.Add(new XlsxWorksheet(\n                                               reader.GetAttribute(A_name),\n                                               int.Parse(reader.GetAttribute(A_sheetId)), reader.GetAttribute(A_rid)));\n                    }\n\n                }\n\n                xmlFileStream.Close();\n            }\n\n        }\n\n        private void ReadWorkbookRels(Stream xmlFileStream)\n        {\n            using (XmlReader reader = XmlReader.Create(xmlFileStream))\n            {\n                while (reader.Read())\n                {\n                    if (reader.NodeType == XmlNodeType.Element && reader.LocalName == N_rel)\n                    {\n                        string rid = reader.GetAttribute(A_id);\n\n                        for (int i = 0; i < sheets.Count; i++)\n                        {\n                            XlsxWorksheet tempSheet = sheets[i];\n\n                            if (tempSheet.RID == rid)\n                            {\n                                tempSheet.Path = reader.GetAttribute(A_target);\n                                sheets[i] = tempSheet;\n                                break;\n                            }\n                        }\n                    }\n\n                }\n\n                xmlFileStream.Close();\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "Excel/Core/OpenXmlFormat/XlsxWorksheet.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.OpenXmlFormat\n{\n\tinternal class XlsxWorksheet\n\t{\n\t\tpublic const string N_dimension = \"dimension\";\n\t\tpublic const string N_worksheet = \"worksheet\";\n\t\tpublic const string N_row = \"row\";\n\t\tpublic const string N_col = \"col\";\n\t\tpublic const string N_c = \"c\"; //cell\n\t\tpublic const string N_v = \"v\";\n\t\tpublic const string N_t = \"t\";\n\t\tpublic const string A_ref = \"ref\";\n\t\tpublic const string A_r = \"r\";\n\t\tpublic const string A_t = \"t\";\n\t\tpublic const string A_s = \"s\";\n\t\tpublic const string N_sheetData = \"sheetData\";\n\t\tpublic const string N_inlineStr = \"inlineStr\";\n\n\t\tprivate XlsxDimension _dimension;\n\n\t\tpublic bool IsEmpty { get; set; }\n\n\t\tpublic XlsxDimension Dimension\n\t\t{\n\t\t\tget { return _dimension; }\n\t\t\tset { _dimension = value; }\n\t\t}\n\n\t\tpublic int ColumnsCount\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn IsEmpty ? 0 : (_dimension == null ? -1 : _dimension.LastCol);\n\t\t\t}\n\t\t}\n\n\t\tpublic int RowsCount\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _dimension == null ? -1 : _dimension.LastRow - _dimension.FirstRow + 1;\n\t\t\t}\n\t\t}\n\n\t\tprivate string _Name;\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget { return _Name; }\n\t\t}\n\n\t\tprivate int _id;\n\n\t\tpublic int Id\n\t\t{\n\t\t\tget { return _id; }\n\t\t}\n\n\t\tprivate string _rid;\n\n\t\tpublic string RID\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _rid;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\t_rid = value;\n\t\t\t}\n\t\t}\n\n\t\tprivate string _path;\n\t\t\n\n\t\tpublic string Path\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _path;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\t_path = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic XlsxWorksheet(string name, int id, string rid)\n\t\t{\n\t\t\t_Name = name;\n\t\t\t_id = id;\n\t\t\t_rid = rid;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/OpenXmlFormat/XlsxXf.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.OpenXmlFormat\n{\n\tinternal class XlsxXf\n\t{\n\t\tpublic const string N_xf = \"xf\";\n\t\tpublic const string A_numFmtId = \"numFmtId\";\n\t\tpublic const string A_xfId = \"xfId\";\n\t\tpublic const string A_applyNumberFormat = \"applyNumberFormat\";\n\n\t\tprivate int _Id;\n\n\t\tpublic int Id\n\t\t{\n\t\t\tget { return _Id; }\n\t\t\tset { _Id = value; }\n\t\t}\n\n\t\tprivate int _numFmtId;\n\n\t\tpublic int NumFmtId\n\t\t{\n\t\t\tget { return _numFmtId; }\n\t\t\tset { _numFmtId = value; }\n\t\t}\n\n\t\tprivate bool _applyNumberFormat;\n\n\t\tpublic bool ApplyNumberFormat\n\t\t{\n\t\t\tget { return _applyNumberFormat; }\n\t\t\tset { _applyNumberFormat = value; }\n\t\t}\n\n\t\tpublic XlsxXf(int id, int numFmtId, string applyNumberFormat)\n\t\t{\n\t\t\t_Id = id;\n\t\t\t_numFmtId = numFmtId;\n\t\t\t_applyNumberFormat = null != applyNumberFormat && applyNumberFormat == \"1\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Core/OpenXmlFormat/XmlReaderExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Core.OpenXmlFormat\n{\n\tpublic static class XmlReaderExtensions\n\t{\n\t\t//public bool \n\t}\n}\n"
  },
  {
    "path": "Excel/Core/ReferenceHelper.cs",
    "content": "﻿\nusing System.Text.RegularExpressions;\n\nnamespace Excel.Core\n{\n    public static class ReferenceHelper\n    {\n        /// <summary>\n        /// Converts references of form A1, B1, C3, DD99 etc to row and col\n        /// </summary>\n        /// <param name=\"reference\"></param>\n        /// <returns>array of two elements 0 index is row num, 1 index is col. Note that the result is 1-based</returns>\n        public static int[] ReferenceToColumnAndRow(string reference)\n        {\n            //split the string into row and column parts\n            \n\n            Regex matchLettersNumbers = new Regex(\"([a-zA-Z]*)([0-9]*)\");\n            string column = matchLettersNumbers.Match(reference).Groups[1].Value.ToUpper();\n            string rowString = matchLettersNumbers.Match(reference).Groups[2].Value;\n\n            //.net 3.5 or 4.5 we could do this awesomeness\n            //return reference.Aggregate(0, (s,c)=>{s*26+c-'A'+1});\n            //but we are trying to retain 2.0 support so do it a longer way\n            //this is basically base 26 arithmetic\n            int columnValue = 0;\n            int pow = 1;\n\n            //reverse through the string\n            for (int i = column.Length - 1; i >= 0; i--)\n            {\n                int pos = column[i] - 'A' + 1;\n                columnValue += pow * pos;\n                pow *= 26;\n            }\n\n            return new int[2] { int.Parse(rowString), columnValue };\n        }\n    }\n}\n"
  },
  {
    "path": "Excel/Core/ZipWorker.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing Excel.Log;\nusing ICSharpCode.SharpZipLib.Zip;\nusing System.Collections;\n\nnamespace Excel.Core\n{\n\tpublic class ZipWorker : IDisposable\n\t{\n\t\t#region Members and Properties\n\n\t\tprivate byte[] buffer;\n\n\t\tprivate bool disposed;\n\t\tprivate bool _isCleaned;\n\n\t\tprivate const string TMP = \"TMP_Z\";\n\t\tprivate const string FOLDER_xl = \"xl\";\n\t\tprivate const string FOLDER_worksheets = \"worksheets\";\n\t\tprivate const string FILE_sharedStrings = \"sharedStrings.{0}\";\n\t\tprivate const string FILE_styles = \"styles.{0}\";\n\t\tprivate const string FILE_workbook = \"workbook.{0}\";\n\t\tprivate const string FILE_sheet = \"sheet{0}.{1}\";\n\t\tprivate const string FOLDER_rels = \"_rels\";\n\t\tprivate const string FILE_rels = \"workbook.{0}.rels\";\n\n\t\tprivate string _tempPath;\n\t\tprivate string _tempEnv;\n\t\tprivate string _exceptionMessage;\n\t\tprivate string _xlPath;\n\t\tprivate string _format = \"xml\";\n\n\t\tprivate bool _isValid;\n\t\t//private bool _isBinary12Format;\n\n\t\t/// <summary>\n\t\t/// Gets a value indicating whether this instance is valid.\n\t\t/// </summary>\n\t\t/// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value>\n\t\tpublic bool IsValid\n\t\t{\n\t\t\tget { return _isValid; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the temp path for extracted files.\n\t\t/// </summary>\n\t\t/// <value>The temp path for extracted files.</value>\n\t\tpublic string TempPath\n\t\t{\n\t\t\tget { return _tempPath; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the exception message.\n\t\t/// </summary>\n\t\t/// <value>The exception message.</value>\n\t\tpublic string ExceptionMessage\n\t\t{\n\t\t\tget { return _exceptionMessage; }\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic ZipWorker()\n\t\t{\n\t\t\t_tempEnv = System.IO.Path.GetTempPath();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Extracts the specified zip file stream.\n\t\t/// </summary>\n\t\t/// <param name=\"fileStream\">The zip file stream.</param>\n\t\t/// <returns></returns>\n\t\tpublic bool Extract(Stream fileStream)\n\t\t{\n\t\t\tif (null == fileStream) return false;\n\n\t\t\tCleanFromTemp(false);\n\n\t\t\tNewTempPath();\n\n\t\t\t_isValid = true;\n\n\t\t\tZipFile zipFile = null;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tzipFile = new ZipFile(fileStream);\n\n\t\t\t\tIEnumerator enumerator = zipFile.GetEnumerator();\n\n\t\t\t\twhile (enumerator.MoveNext())\n\t\t\t\t{\n\t\t\t\t\tZipEntry entry = (ZipEntry)enumerator.Current;\n\n\t\t\t\t\tExtractZipEntry(zipFile, entry);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception ex)\n\t\t\t{\n\t\t\t\t_isValid = false;\n\t\t\t\t_exceptionMessage = ex.Message;\n\n\t\t\t\tCleanFromTemp(true); //true tells CleanFromTemp not to raise an IO Exception if this operation fails. If it did then the real error here would be masked\n\t\t\t\t\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tfileStream.Close();\n\n\t\t\t\tif (null != zipFile) zipFile.Close();\n\t\t\t}\n\n\t\t\treturn _isValid ? CheckFolderTree() : false;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the shared strings stream.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic Stream GetSharedStringsStream()\n\t\t{\n\t\t\treturn GetStream(Path.Combine(_xlPath, string.Format(FILE_sharedStrings, _format)));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the styles stream.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic Stream GetStylesStream()\n\t\t{\n\t\t\treturn GetStream(Path.Combine(_xlPath, string.Format(FILE_styles, _format)));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the workbook stream.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic Stream GetWorkbookStream()\n\t\t{\n\t\t\treturn GetStream(Path.Combine(_xlPath, string.Format(FILE_workbook, _format)));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the worksheet stream.\n\t\t/// </summary>\n\t\t/// <param name=\"sheetId\">The sheet id.</param>\n\t\t/// <returns></returns>\n\t\tpublic Stream GetWorksheetStream(int sheetId)\n\t\t{\n\t\t\treturn GetStream(Path.Combine(\n\t\t\t\tPath.Combine(_xlPath, FOLDER_worksheets),\n\t\t\t\tstring.Format(FILE_sheet, sheetId, _format)));\n\t\t}\n\n        public Stream GetWorksheetStream(string sheetPath)\n        {\n\t\t\t//its possible sheetPath starts with /xl. in this case trim the /xl\n\t        if (sheetPath.StartsWith(\"/xl/\"))\n\t\t        sheetPath = sheetPath.Substring(4);\n            return GetStream(Path.Combine(_xlPath, sheetPath));\n        }\n\n\n\t\t/// <summary>\n\t\t/// Gets the workbook rels stream.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic Stream GetWorkbookRelsStream()\n\t\t{\n\t\t\treturn GetStream(Path.Combine(_xlPath, Path.Combine(FOLDER_rels, string.Format(FILE_rels, _format))));\n\t\t}\n\n\t\tprivate void CleanFromTemp(bool catchIoError)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(_tempPath)) return;\n\n\t\t\t_isCleaned = true;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (Directory.Exists(_tempPath))\n\t\t\t\t{\n\t\t\t\t\tDirectory.Delete(_tempPath, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException ex)\n\t\t\t{\n\t\t\t\t//TODO: minimally add some logging so we know this happened. log4net?\n\t\t\t\tif (!catchIoError)\n\t\t\t\t\tthrow;\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tprivate void ExtractZipEntry(ZipFile zipFile, ZipEntry entry)\n\t\t{\n\t\t\tif (!entry.IsCompressionMethodSupported() || string.IsNullOrEmpty(entry.Name)) return;\n\n\t\t\tstring tPath = Path.Combine(_tempPath, entry.Name);\n\t\t\tstring path = entry.IsDirectory ? tPath : Path.GetDirectoryName(Path.GetFullPath(tPath));\n\n\t\t\tif (!Directory.Exists(path))\n\t\t\t{\n\t\t\t\tDirectory.CreateDirectory(path);\n\t\t\t}\n\n\t\t\tif (!entry.IsFile) return;\n\n//\t\t\ttry\n//\t\t\t{\n\t\t\t\tusing (FileStream stream = File.Create(tPath))\n\t\t\t\t{\n\t\t\t\t\tif (buffer == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tbuffer = new byte[0x1000];\n\t\t\t\t\t}\n\n\t\t\t\t\tusing(Stream inputStream = zipFile.GetInputStream(entry))\n\t\t\t\t\t{\n\t\t\t\t\t\tint count;\n\t\t\t\t\t\twhile ((count = inputStream.Read(buffer, 0, buffer.Length)) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstream.Write(buffer, 0, count);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\tstream.Flush();\n\t\t\t\t}\n//\t\t\t}\n//\t\t\tcatch\n//\t\t\t{\n//\t\t\t\tthrow;\n//\t\t\t}\n\t\t}\n\n\t\tprivate void NewTempPath()\n\t\t{\n\t\t    var tempID = Guid.NewGuid().ToString(\"N\");\n            _tempPath = Path.Combine(_tempEnv, TMP + DateTime.Now.ToFileTimeUtc().ToString() + tempID);\n\n\t\t\t_isCleaned = false;\n\n            LogManager.Log(this).Debug(\"Using temp path {0}\", _tempPath);\n\n\t\t\tDirectory.CreateDirectory(_tempPath);\n\t\t}\n\n\t\tprivate bool CheckFolderTree()\n\t\t{\n\t\t\t_xlPath = Path.Combine(_tempPath, FOLDER_xl);\n\n\t\t\treturn Directory.Exists(_xlPath) &&\n\t\t\t\tDirectory.Exists(Path.Combine(_xlPath, FOLDER_worksheets)) &&\n\t\t\t\tFile.Exists(Path.Combine(_xlPath, FILE_workbook)) &&\n\t\t\t\tFile.Exists(Path.Combine(_xlPath, FILE_styles));\n\t\t}\n\n\t\tprivate static Stream GetStream(string filePath)\n\t\t{\n\t\t\tif (File.Exists(filePath))\n\t\t\t{\n\t\t\t\treturn File.Open(filePath, FileMode.Open, FileAccess.Read);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t#region IDisposable Members\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDispose(true);\n\n\t\t\tGC.SuppressFinalize(this);\n\t\t}\n\n\t\tprivate void Dispose(bool disposing)\n\t\t{\n\t\t\t// Check to see if Dispose has already been called.\n\t\t\tif (!this.disposed)\n\t\t\t{\n\t\t\t\tif (disposing)\n\t\t\t\t{\n\t\t\t\t\tif (!_isCleaned)\n\t\t\t\t\t\tCleanFromTemp(false);\n\t\t\t\t}\n\n\t\t\t\tbuffer = null;\n\n\t\t\t\tdisposed = true;\n\t\t\t}\n\t\t}\n\n\t\t~ZipWorker()\n\t\t{\n\t\t\tDispose(false);\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "Excel/Errors.cs",
    "content": "namespace Excel\n{\n\tinternal static class Errors\n\t{\n\t\tpublic const string ErrorStreamWorkbookNotFound = \"Error: Neither stream 'Workbook' nor 'Book' was found in file.\";\n\t\tpublic const string ErrorWorkbookIsNotStream = \"Error: Workbook directory entry is not a Stream.\";\n\t\tpublic const string ErrorWorkbookGlobalsInvalidData = \"Error reading Workbook Globals - Stream has invalid data.\";\n\t\tpublic const string ErrorFATBadSector = \"Error reading as FAT table : There's no such sector in FAT.\";\n\t\tpublic const string ErrorFATRead = \"Error reading stream from FAT area.\";\n\t\tpublic const string ErrorHeaderSignature = \"Error: Invalid file signature.\";\n\t\tpublic const string ErrorHeaderOrder = \"Error: Invalid byte order specified in header.\";\n\t\tpublic const string ErrorBIFFRecordSize = \"Error: Buffer size is less than minimum BIFF record size.\";\n\t\tpublic const string ErrorBIFFBufferSize = \"BIFF Stream error: Buffer size is less than entry length.\";\n\t\tpublic const string ErrorBIFFIlegalBefore = \"BIFF Stream error: Moving before stream start.\";\n\t\tpublic const string ErrorBIFFIlegalAfter = \"BIFF Stream error: Moving after stream end.\";\n\n\t\tpublic const string ErrorDirectoryEntryArray = \"Directory Entry error: Array is too small.\";\n\t}\n}\n"
  },
  {
    "path": "Excel/Excel.4.0.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.50727</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <ProjectGuid>{EEE7DE52-61FB-474C-8810-BB494164D4B3}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Excel</RootNamespace>\n    <AssemblyName>Excel.4.0</AssemblyName>\n    <StartupObject>\n    </StartupObject>\n    <SignAssembly>true</SignAssembly>\n    <AssemblyOriginatorKeyFile>Excel.snk</AssemblyOriginatorKeyFile>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <OldToolsVersion>2.0</OldToolsVersion>\n    <UpgradeBackupLocation />\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRules>\n    </CodeAnalysisRules>\n    <CodeAnalysisRuleSet>Migrated rules for Excel.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRules>\n    </CodeAnalysisRules>\n    <CodeAnalysisRuleSet>Migrated rules for Excel (2).ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'NUNIT_DEBUG|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\NUNIT_DEBUG\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>\n    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'NUNIT_RELEASE|AnyCPU' \">\n    <OutputPath>bin\\NUNIT_RELEASE\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <CodeAnalysisRuleAssemblies>\n    </CodeAnalysisRuleAssemblies>\n    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>\n    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>Migrated rules for Excel (3).ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'MSTEST_DEBUG|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\MSTEST_DEBUG\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <CodeAnalysisRuleAssemblies>\n    </CodeAnalysisRuleAssemblies>\n    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>\n    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>Migrated rules for Excel (3).ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'MSTEST_RELEASE|AnyCPU' \">\n    <OutputPath>bin\\MSTEST_RELEASE\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <CodeAnalysisRuleAssemblies>\n    </CodeAnalysisRuleAssemblies>\n    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>\n    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>Migrated rules for Excel (3).ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"ICSharpCode.SharpZipLib, Version=0.85.5.452, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\Lib\\ICSharpCode.SharpZipLib.dll</HintPath>\n      <Private>True</Private>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.XML\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Core\\BinaryFormat\\Enums.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffBlankCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffBOF.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffBoolErr.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffBoundSheet.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffContinue.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffDbCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffDimensions.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffEOF.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffFormatString.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffFormulaCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffFormulaString.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffIndex.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffIntegerCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffInterfaceHdr.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffLabelCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffLabelSSTCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffMulBlankCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffMulRKCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffNumberCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffRecord.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffRKCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffRow.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffSimpleValueRecord.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffSST.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffStream.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffUncalced.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffWindow1.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsDirectoryEntry.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsFormattedUnicodeString.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsRootDirectory.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsStream.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsWorkbookGlobals.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsWorksheet.cs\" />\n    <Compile Include=\"Core\\FormatReader.cs\" />\n    <Compile Include=\"Core\\Helpers.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxDimension.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxNumFmt.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxSST.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxStyles.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxWorkbook.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxWorksheet.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxXf.cs\" />\n    <Compile Include=\"Core\\ZipWorker.cs\" />\n    <Compile Include=\"Exceptions\\BiffRecordException.cs\" />\n    <Compile Include=\"Exceptions\\HeaderException.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsFat.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsHeader.cs\" />\n    <Compile Include=\"Errors.cs\" />\n    <Compile Include=\"ExcelBinaryReader.cs\" />\n    <Compile Include=\"ExcelReaderFactory.cs\" />\n    <Compile Include=\"IExcelDataReader.cs\" />\n    <Compile Include=\"ExcelOpenXmlReader.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Excel.snk\" />\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.3.1\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 3.1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "Excel/Excel.4.5.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{D1905BBD-5F3B-4112-90BD-2D97C8B539C9}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Excel</RootNamespace>\n    <AssemblyName>Excel</AssemblyName>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SccProjectName>SAK</SccProjectName>\n    <SccLocalPath>SAK</SccLocalPath>\n    <SccAuxPath>SAK</SccAuxPath>\n    <SccProvider>SAK</SccProvider>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug45\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release45\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>Excel.snk</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"ICSharpCode.SharpZipLib, Version=0.85.5.452, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\Lib\\ICSharpCode.SharpZipLib.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Core\\BinaryFormat\\Enums.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffBlankCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffBOF.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffBoundSheet.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffContinue.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffDbCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffDimensions.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffEOF.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffFormatString.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffFormulaCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffFormulaString.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffIndex.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffIntegerCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffInterfaceHdr.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffLabelCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffLabelSSTCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffMulBlankCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffMulRKCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffNumberCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffQuickTip.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffRecord.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffRKCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffRow.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffSimpleValueRecord.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffSST.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffStream.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffUncalced.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffWindow1.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsDirectoryEntry.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsFat.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsFormattedUnicodeString.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsHeader.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsRootDirectory.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsStream.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsWorkbookGlobals.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsWorksheet.cs\" />\n    <Compile Include=\"Core\\FormatReader.cs\" />\n    <Compile Include=\"Core\\Helpers.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxDimension.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxNumFmt.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxSST.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxStyles.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxWorkbook.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxWorksheet.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxXf.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XmlReaderExtensions.cs\" />\n    <Compile Include=\"Core\\ReferenceHelper.cs\" />\n    <Compile Include=\"Core\\ZipWorker.cs\" />\n    <Compile Include=\"Errors.cs\" />\n    <Compile Include=\"ExcelBinaryReader.cs\" />\n    <Compile Include=\"ExcelOpenXmlReader.cs\" />\n    <Compile Include=\"ExcelReaderFactory.cs\" />\n    <Compile Include=\"Exceptions\\BiffRecordException.cs\" />\n    <Compile Include=\"Exceptions\\HeaderException.cs\" />\n    <Compile Include=\"IExcelDataReader.cs\" />\n    <Compile Include=\"Log\\ILog-4.5.cs\" />\n    <Compile Include=\"Log\\ILog.cs\" />\n    <Compile Include=\"Log\\Log.cs\" />\n    <Compile Include=\"Log\\LogExtensions.cs\" />\n    <Compile Include=\"Log\\Logger\\NullLog-4.5.cs\" />\n    <Compile Include=\"Log\\Logger\\NullLog.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Log\\LogManager.cs\" />\n    <Compile Include=\"Log\\StringExtensions.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Excel.snk\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "Excel/Excel.4.5.csproj.vspscc",
    "content": "﻿\"\"\n{\n\"FILE_VERSION\" = \"9237\"\n\"ENLISTMENT_CHOICE\" = \"NEVER\"\n\"PROJECT_FILE_RELATIVE_PATH\" = \"\"\n\"NUMBER_OF_EXCLUDED_FILES\" = \"0\"\n\"ORIGINAL_PROJECT_FILE_PATH\" = \"\"\n\"NUMBER_OF_NESTED_PROJECTS\" = \"0\"\n\"SOURCE_CONTROL_SETTINGS_PROVIDER\" = \"PROVIDER\"\n}\n"
  },
  {
    "path": "Excel/Excel.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.50727</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{4CB0690E-3E7A-497C-9116-D52024F63195}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Excel</RootNamespace>\n    <AssemblyName>Excel</AssemblyName>\n    <StartupObject>\n    </StartupObject>\n    <SignAssembly>false</SignAssembly>\n    <AssemblyOriginatorKeyFile>\n    </AssemblyOriginatorKeyFile>\n    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <OldToolsVersion>2.0</OldToolsVersion>\n    <UpgradeBackupLocation />\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n    <SccProjectName>\n    </SccProjectName>\n    <SccLocalPath>\n    </SccLocalPath>\n    <SccAuxPath>\n    </SccAuxPath>\n    <SccProvider>\n    </SccProvider>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRules>\n    </CodeAnalysisRules>\n    <CodeAnalysisRuleSet>Migrated rules for Excel.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRules>\n    </CodeAnalysisRules>\n    <CodeAnalysisRuleSet>Migrated rules for Excel (2).ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'NUNIT_DEBUG|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\NUNIT_DEBUG\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>\n    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'NUNIT_RELEASE|AnyCPU' \">\n    <OutputPath>bin\\NUNIT_RELEASE\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <CodeAnalysisRuleAssemblies>\n    </CodeAnalysisRuleAssemblies>\n    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>\n    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>Migrated rules for Excel (3).ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'MSTEST_DEBUG|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\MSTEST_DEBUG\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <DebugType>full</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <CodeAnalysisRuleAssemblies>\n    </CodeAnalysisRuleAssemblies>\n    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>\n    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>Migrated rules for Excel (3).ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'MSTEST_RELEASE|AnyCPU' \">\n    <OutputPath>bin\\MSTEST_RELEASE\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <CodeAnalysisRuleAssemblies>\n    </CodeAnalysisRuleAssemblies>\n    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>\n    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>Migrated rules for Excel (3).ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.XML\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Core\\BinaryFormat\\Enums.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffBlankCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffBOF.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffBoundSheet.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffContinue.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffDbCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffDimensions.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffEOF.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffFormatString.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffFormulaCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffFormulaString.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffIndex.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffIntegerCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffInterfaceHdr.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffLabelCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffLabelSSTCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffMulBlankCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffMulRKCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffNumberCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffQuickTip.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffRecord.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffRKCell.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffRow.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffSimpleValueRecord.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffSST.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffStream.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffUncalced.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsBiffWindow1.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsDirectoryEntry.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsFormattedUnicodeString.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsRootDirectory.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsStream.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsWorkbookGlobals.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsWorksheet.cs\" />\n    <Compile Include=\"Core\\FormatReader.cs\" />\n    <Compile Include=\"Core\\Helpers.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxDimension.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxNumFmt.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxSST.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxStyles.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxWorkbook.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxWorksheet.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XlsxXf.cs\" />\n    <Compile Include=\"Core\\OpenXmlFormat\\XmlReaderExtensions.cs\" />\n    <Compile Include=\"Core\\ReferenceHelper.cs\" />\n    <Compile Include=\"Core\\ZipWorker.cs\" />\n    <Compile Include=\"Exceptions\\BiffRecordException.cs\" />\n    <Compile Include=\"Exceptions\\HeaderException.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsFat.cs\" />\n    <Compile Include=\"Core\\BinaryFormat\\XlsHeader.cs\" />\n    <Compile Include=\"Errors.cs\" />\n    <Compile Include=\"ExcelBinaryReader.cs\" />\n    <Compile Include=\"ExcelReaderFactory.cs\" />\n    <Compile Include=\"IExcelDataReader.cs\" />\n    <Compile Include=\"ExcelOpenXmlReader.cs\" />\n    <Compile Include=\"Log\\ILog.cs\" />\n    <Compile Include=\"Log\\Log.cs\" />\n    <Compile Include=\"Log\\LogManager.cs\" />\n    <Compile Include=\"Log\\Logger\\NullLog.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.3.1\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 3.1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\SharpZipLib\\src\\ICSharpCode.SharpZLib.csproj\">\n      <Project>{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}</Project>\n      <Name>ICSharpCode.SharpZLib</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "Excel/Excel.csproj.vspscc",
    "content": "﻿\"\"\n{\n\"FILE_VERSION\" = \"9237\"\n\"ENLISTMENT_CHOICE\" = \"NEVER\"\n\"PROJECT_FILE_RELATIVE_PATH\" = \"\"\n\"NUMBER_OF_EXCLUDED_FILES\" = \"0\"\n\"ORIGINAL_PROJECT_FILE_PATH\" = \"\"\n\"NUMBER_OF_NESTED_PROJECTS\" = \"0\"\n\"SOURCE_CONTROL_SETTINGS_PROVIDER\" = \"PROVIDER\"\n}\n"
  },
  {
    "path": "Excel/ExcelBinary12Reader.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Excel.Core.Binary12Format;\nusing System.IO;\nusing Excel.Core;\nusing System.Data;\n\nnamespace Excel\n{\n\tpublic class ExcelBinary12Reader : IExcelDataReader\n\t{\n\t\t#region Members\n\n\t\tprivate XlsbWorkbook _workbook;\n\t\tprivate bool _isValid;\n\t\tprivate bool _isClosed;\n\t\tprivate bool _isFirstRead;\n\t\tprivate string _exceptionMessage;\n\t\tprivate int _depth;\n\t\tprivate int _resultIndex;\n\t\tprivate int _emptyRowCount;\n\t\tprivate ZipWorker _zipWorker;\n\n\t\tprivate Stream _sheetStream;\n\t\tprivate object[] _cellsValues;\n\t\tprivate object[] _savedCellsValues;\n\n\t\tprivate bool disposed;\n\n\t\t#endregion\n\n\t\tinternal ExcelBinary12Reader()\n\t\t{\n\t\t\t_isValid = true;\n\t\t\t_isFirstRead = true;\n\t\t}\n\n\t\tprivate void ReadGlobals()\n\t\t{\n\t\t\t_workbook = new XlsbWorkbook(\n\t\t\t\t_zipWorker.GetWorkbookStream(),\n\t\t\t\t_zipWorker.GetSharedStringsStream(),\n\t\t\t\t_zipWorker.GetStylesStream());\n\t\t}\n\n\t\t#region IExcelDataReader Members\n\n\t\tpublic void Initialize(System.IO.Stream fileStream)\n\t\t{\n\t\t\t_zipWorker = new ZipWorker(true);\n\t\t\t_zipWorker.Extract(fileStream);\n\n\t\t\tif (!_zipWorker.IsValid)\n\t\t\t{\n\t\t\t\t_isValid = false;\n\t\t\t\t_exceptionMessage = _zipWorker.ExceptionMessage;\n\n\t\t\t\tClose();\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tReadGlobals();\n\t\t}\n\n\n\t\tpublic System.Data.DataSet AsDataSet()\n\t\t{\n\t\t\treturn AsDataSet(false);\n\t\t}\n\n\t\tpublic System.Data.DataSet AsDataSet(bool convertOADateTime)\n\t\t{\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\n\t\tpublic bool IsValid\n\t\t{\n\t\t\tget { return _isValid; }\n\t\t}\n\n\t\tpublic string ExceptionMessage\n\t\t{\n\t\t\tget { return _exceptionMessage; }\n\t\t}\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn (_resultIndex >= 0 && _resultIndex < ResultsCount) ? _workbook.Sheets[_resultIndex].Name : null;\n\t\t\t}\n\t\t}\n\n\t\tpublic int ResultsCount\n\t\t{\n\t\t\tget { return _workbook == null ? -1 : _workbook.Sheets.Count; }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IDataReader Members\n\n\t\tpublic void Close()\n\t\t{\n\t\t\t_isClosed = true;\n\n\t\t\tif (_sheetStream != null) _sheetStream.Close();\n\n\t\t\tif (_zipWorker != null) _zipWorker.Dispose();\n\t\t}\n\n\t\tpublic int Depth\n\t\t{\n\t\t\tget { return _depth; }\n\t\t}\n\n\t\tpublic bool IsClosed\n\t\t{\n\t\t\tget { return _isClosed; }\n\t\t}\n\n\t\tpublic bool NextResult()\n\t\t{\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\n\t\tpublic bool Read()\n\t\t{\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IDataRecord Members\n\n\t\tpublic int FieldCount\n\t\t{\n\t\t\tget { return (_resultIndex >= 0 && _resultIndex < ResultsCount) ? _workbook.Sheets[_resultIndex].ColumnsCount : -1; }\n\n\t\t}\n\n\t\tpublic bool GetBoolean(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return false;\n\n\t\t\treturn Boolean.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic DateTime GetDateTime(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return DateTime.MinValue;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn (DateTime)_cellsValues[i];\n\t\t\t}\n\t\t\tcatch (InvalidCastException)\n\t\t\t{\n\t\t\t\treturn DateTime.MinValue;\n\t\t\t}\n\n\t\t}\n\n\t\tpublic decimal GetDecimal(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return decimal.MinValue;\n\n\t\t\treturn decimal.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic double GetDouble(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return double.MinValue;\n\n\t\t\treturn double.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic float GetFloat(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return float.MinValue;\n\n\t\t\treturn float.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic short GetInt16(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return short.MinValue;\n\n\t\t\treturn short.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic int GetInt32(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return int.MinValue;\n\n\t\t\treturn int.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic long GetInt64(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return long.MinValue;\n\n\t\t\treturn long.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic string GetString(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return null;\n\n\t\t\treturn _cellsValues[i].ToString();\n\t\t}\n\n\t\tpublic object GetValue(int i)\n\t\t{\n\t\t\treturn _cellsValues[i];\n\t\t}\n\n\t\tpublic bool IsDBNull(int i)\n\t\t{\n\t\t\treturn (null == _cellsValues[i]) || (DBNull.Value == _cellsValues[i]);\n\t\t}\n\n\t\tpublic object this[int i]\n\t\t{\n\t\t\tget { return _cellsValues[i]; }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IDisposable Members\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDispose(true);\n\n\t\t\tGC.SuppressFinalize(this);\n\t\t}\n\n\t\tprivate void Dispose(bool disposing)\n\t\t{\n\t\t\t// Check to see if Dispose has already been called.\n\t\t\tif (!this.disposed)\n\t\t\t{\n\t\t\t\tif (disposing)\n\t\t\t\t{\n\t\t\t\t\tif (_zipWorker != null) _zipWorker.Dispose();\n\t\t\t\t\tif (_sheetStream != null) _sheetStream.Close();\n\t\t\t\t}\n\n\t\t\t\t_zipWorker = null;\n\t\t\t\t_sheetStream = null;\n\n\t\t\t\t_workbook = null;\n\t\t\t\t_cellsValues = null;\n\t\t\t\t_savedCellsValues = null;\n\n\t\t\t\tdisposed = true;\n\t\t\t}\n\t\t}\n\n\t\t~ExcelBinary12Reader()\n\t\t{\n\t\t\tDispose(false);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region  Not Supported IDataReader Members\n\n\t\tpublic DataTable GetSchemaTable()\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic int RecordsAffected\n\t\t{\n\t\t\tget { throw new NotSupportedException(); }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Not Supported IDataRecord Members\n\n\t\tpublic byte GetByte(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic char GetChar(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic IDataReader GetData(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic string GetDataTypeName(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic Type GetFieldType(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic Guid GetGuid(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic string GetName(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic int GetOrdinal(string name)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic int GetValues(object[] values)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic object this[string name]\n\t\t{\n\t\t\tget { throw new NotSupportedException(); }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IExcelDataReader Members\n\n\n\t\tpublic bool IsFirstRowAsColumnNames\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "Excel/ExcelBinaryReader.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.IO;\nusing System.Text;\nusing Excel.Core;\nusing Excel.Core.BinaryFormat;\nusing Excel.Log;\n\nnamespace Excel\n{\n\t/// <summary>\n\t/// ExcelDataReader Class\n\t/// </summary>\n\tpublic class ExcelBinaryReader : IExcelDataReader\n\t{\n\t\t#region Members\n\n\t\tprivate Stream m_file;\n\t\tprivate XlsHeader m_hdr;\n\t\tprivate List<XlsWorksheet> m_sheets;\n\t\tprivate XlsBiffStream m_stream;\n\t\tprivate DataSet m_workbookData;\n\t\tprivate XlsWorkbookGlobals m_globals;\n\t\tprivate ushort m_version;\n\t\tprivate bool m_ConvertOADate;\n\t\tprivate Encoding m_encoding;\n\t\tprivate bool m_isValid;\n\t\tprivate bool m_isClosed;\n\t\tprivate readonly Encoding m_Default_Encoding = Encoding.UTF8;\n\t\tprivate string m_exceptionMessage;\n\t\tprivate object[] m_cellsValues;\n\t\tprivate uint[] m_dbCellAddrs;\n\t\tprivate int m_dbCellAddrsIndex;\n\t\tprivate bool m_canRead;\n\t\tprivate int m_SheetIndex;\n\t\tprivate int m_depth;\n\t\tprivate int m_cellOffset;\n\t\tprivate int m_maxCol;\n\t\tprivate int m_maxRow;\n\t\tprivate bool m_noIndex;\n\t\tprivate XlsBiffRow m_currentRowRecord;\n\t\tprivate readonly ReadOption m_ReadOption = ReadOption.Strict;\n\n\t\tprivate bool m_IsFirstRead;\n\t\tprivate bool _isFirstRowAsColumnNames;\n\n\t\tprivate const string WORKBOOK = \"Workbook\";\n\t\tprivate const string BOOK = \"Book\";\n\t\tprivate const string COLUMN = \"Column\";\n\n\t\tprivate bool disposed;\n\t\t\n\t\t#endregion\n\n\t\tinternal ExcelBinaryReader()\n\t\t{\n\t\t\tm_encoding = m_Default_Encoding;\n\t\t\tm_version = 0x0600;\n\t\t\tm_isValid = true;\n\t\t\tm_SheetIndex = -1;\n\t\t\tm_IsFirstRead = true;\n\t\t}\n\n\t\tinternal ExcelBinaryReader(ReadOption readOption) : this()\n\t\t{\n\t\t\tm_ReadOption = readOption;\n\t\t}\n\n\t\t#region IDisposable Members\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDispose(true);\n\n\t\t\tGC.SuppressFinalize(this);\n\t\t}\n\n\t\tprivate void Dispose(bool disposing)\n\t\t{\n\t\t\t// Check to see if Dispose has already been called.\n\t\t\tif (!this.disposed)\n\t\t\t{\n\t\t\t\tif (disposing)\n\t\t\t\t{\n\t\t\t\t\tif (m_workbookData != null) m_workbookData.Dispose();\n\n\t\t\t\t\tif (m_sheets != null) m_sheets.Clear();\n\t\t\t\t}\n\n\t\t\t\tm_workbookData = null;\n\t\t\t\tm_sheets = null;\n\t\t\t\tm_stream = null;\n\t\t\t\tm_globals = null;\n\t\t\t\tm_encoding = null;\n\t\t\t\tm_hdr = null;\n\n\t\t\t\tdisposed = true;\n\t\t\t}\n\t\t}\n\n\t\t~ExcelBinaryReader()\n\t\t{\n\t\t\tDispose(false);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Private methods\n\n\t\tprivate int findFirstDataCellOffset(int startOffset)\n\t\t{\n\t\t\t//seek to the first dbcell record\n\t\t\tvar record = m_stream.ReadAt(startOffset);\n\t\t\twhile (!(record is XlsBiffDbCell))\n\t\t\t{\n\t\t\t\tif (m_stream.Position >= m_stream.Size)\n\t\t\t\t\treturn -1;\n\n\t\t\t\tif (record is XlsBiffEOF)\n\t\t\t\t\treturn -1;\n\n\t\t\t\trecord = m_stream.Read();\n\t\t\t}\n\n\t\t\tXlsBiffDbCell startCell = (XlsBiffDbCell)record;\n\t\t\tXlsBiffRow row = null;\n\n\t\t\tint offs = startCell.RowAddress;\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\trow = m_stream.ReadAt(offs) as XlsBiffRow;\n\t\t\t\tif (row == null) break;\n\n\t\t\t\toffs += row.Size;\n\n\t\t\t} while (null != row);\n\n\t\t\treturn offs;\n\t\t}\n\n\t\tprivate void readWorkBookGlobals()\n\t\t{\n\t\t\t//Read Header\n\t\t\ttry\n\t\t\t{\n\t\t\t\tm_hdr = XlsHeader.ReadHeader(m_file);\n\t\t\t}\n\t\t\tcatch (Exceptions.HeaderException ex)\n\t\t\t{\n\t\t\t\tfail(ex.Message);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcatch (FormatException ex)\n\t\t\t{\n\t\t\t\tfail(ex.Message);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tXlsRootDirectory dir = new XlsRootDirectory(m_hdr);\n\t\t\tXlsDirectoryEntry workbookEntry = dir.FindEntry(WORKBOOK) ?? dir.FindEntry(BOOK);\n\n\t\t\tif (workbookEntry == null)\n\t\t\t{ fail(Errors.ErrorStreamWorkbookNotFound); return; }\n\n\t\t\tif (workbookEntry.EntryType != STGTY.STGTY_STREAM)\n\t\t\t{ fail(Errors.ErrorWorkbookIsNotStream); return; }\n\n\t\t\tm_stream = new XlsBiffStream(m_hdr, workbookEntry.StreamFirstSector, workbookEntry.IsEntryMiniStream, dir, this);\n\n\t\t\tm_globals = new XlsWorkbookGlobals();\n\n\t\t\tm_stream.Seek(0, SeekOrigin.Begin);\n\n\t\t\tXlsBiffRecord rec = m_stream.Read();\n\t\t\tXlsBiffBOF bof = rec as XlsBiffBOF;\n\n\t\t\tif (bof == null || bof.Type != BIFFTYPE.WorkbookGlobals)\n\t\t\t{ fail(Errors.ErrorWorkbookGlobalsInvalidData); return; }\n\n\t\t\tbool sst = false;\n\n\t\t\tm_version = bof.Version;\n\t\t\tm_sheets = new List<XlsWorksheet>();\n\n\t\t\twhile (null != (rec = m_stream.Read()))\n\t\t\t{\n\t\t\t\tswitch (rec.ID)\n\t\t\t\t{\n\t\t\t\t\tcase BIFFRECORDTYPE.INTERFACEHDR:\n\t\t\t\t\t\tm_globals.InterfaceHdr = (XlsBiffInterfaceHdr)rec;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.BOUNDSHEET:\n\t\t\t\t\t\tXlsBiffBoundSheet sheet = (XlsBiffBoundSheet)rec;\n\n\t\t\t\t\t\tif (sheet.Type != XlsBiffBoundSheet.SheetType.Worksheet) break;\n\n\t\t\t\t\t\tsheet.IsV8 = isV8();\n\t\t\t\t\t\tsheet.UseEncoding = m_encoding;\n\t\t\t\t\t\tLogManager.Log(this).Debug(\"BOUNDSHEET IsV8={0}\", sheet.IsV8);\n\n\t\t\t\t\t\tm_sheets.Add(new XlsWorksheet(m_globals.Sheets.Count, sheet));\n\t\t\t\t\t\tm_globals.Sheets.Add(sheet);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.MMS:\n\t\t\t\t\t\tm_globals.MMS = rec;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.COUNTRY:\n\t\t\t\t\t\tm_globals.Country = rec;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.CODEPAGE:\n\n\t\t\t\t\t\tm_globals.CodePage = (XlsBiffSimpleValueRecord)rec;\n\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tm_encoding = Encoding.GetEncoding(m_globals.CodePage.Value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (ArgumentException)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Warning - Password protection\n\t\t\t\t\t\t\t// TODO: Attach to ILog\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.FONT:\n\t\t\t\t\tcase BIFFRECORDTYPE.FONT_V34:\n\t\t\t\t\t\tm_globals.Fonts.Add(rec);\n\t\t\t\t\t\tbreak;\n                    case BIFFRECORDTYPE.FORMAT_V23:\n\t\t\t\t        {\n\t\t\t\t            var fmt = (XlsBiffFormatString) rec;\n\t\t\t\t            fmt.UseEncoding = m_encoding;\n\t\t\t\t            m_globals.Formats.Add((ushort) m_globals.Formats.Count, fmt);\n\t\t\t\t        }\n                        break;\n                    case BIFFRECORDTYPE.FORMAT:\n\t\t\t\t        {\n\t\t\t\t            var fmt = (XlsBiffFormatString) rec;\n                            m_globals.Formats.Add(fmt.Index, fmt);\n\t\t\t\t        }\n\t\t\t\t        break;\n\t\t\t\t\tcase BIFFRECORDTYPE.XF:\n\t\t\t\t\tcase BIFFRECORDTYPE.XF_V4:\n\t\t\t\t\tcase BIFFRECORDTYPE.XF_V3:\n\t\t\t\t\tcase BIFFRECORDTYPE.XF_V2:\n\t\t\t\t\t\tm_globals.ExtendedFormats.Add(rec);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.SST:\n\t\t\t\t\t\tm_globals.SST = (XlsBiffSST)rec;\n\t\t\t\t\t\tsst = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.CONTINUE:\n\t\t\t\t\t\tif (!sst) break;\n\t\t\t\t\t\tXlsBiffContinue contSST = (XlsBiffContinue)rec;\n\t\t\t\t\t\tm_globals.SST.Append(contSST);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.EXTSST:\n\t\t\t\t\t\tm_globals.ExtSST = rec;\n\t\t\t\t\t\tsst = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.PROTECT:\n\t\t\t\t\tcase BIFFRECORDTYPE.PASSWORD:\n\t\t\t\t\tcase BIFFRECORDTYPE.PROT4REVPASSWORD:\n\t\t\t\t\t\t//IsProtected\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.EOF:\n\t\t\t\t\t\tif (m_globals.SST != null)\n\t\t\t\t\t\t\tm_globals.SST.ReadStrings();\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate bool readWorkSheetGlobals(XlsWorksheet sheet, out XlsBiffIndex idx, out XlsBiffRow row)\n\t\t{\n\t\t\tidx = null;\n\t\t\trow = null;\n\n\t\t\tm_stream.Seek((int)sheet.DataOffset, SeekOrigin.Begin);\n\n\t\t\tXlsBiffBOF bof = m_stream.Read() as XlsBiffBOF;\n\t\t\tif (bof == null || bof.Type != BIFFTYPE.Worksheet) return false;\n\n\t\t\t//DumpBiffRecords();\n\n\t\t\tXlsBiffRecord rec = m_stream.Read();\n\t\t\tif (rec == null) return false;\n\t\t\tif (rec is XlsBiffIndex)\n\t\t\t{\n\t\t\t\tidx = rec as XlsBiffIndex;\n\t\t\t}\n\t\t\telse if (rec is XlsBiffUncalced)\n\t\t\t{\n\t\t\t\t// Sometimes this come before the index...\n\t\t\t\tidx = m_stream.Read() as XlsBiffIndex;\n\t\t\t}\n\n\t\t\t//if (null == idx)\n\t\t\t//{\n\t\t\t//\t// There is a record before the index! Chech his type and see the MS Biff Documentation\n\t\t\t//\treturn false;\n\t\t\t//}\n\n\t\t\tif (idx != null)\n\t\t\t{\n\t\t\t\tidx.IsV8 = isV8();\n\t\t\t\tLogManager.Log(this).Debug(\"INDEX IsV8={0}\", idx.IsV8);\n\t\t\t}\n\t\t\t\t\n\n\n\t\t\tXlsBiffRecord trec;\n\t\t\tXlsBiffDimensions dims = null;\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\ttrec = m_stream.Read();\n\t\t\t\tif (trec.ID == BIFFRECORDTYPE.DIMENSIONS)\n\t\t\t\t{\n\t\t\t\t\tdims = (XlsBiffDimensions)trec;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t} while (trec != null && trec.ID != BIFFRECORDTYPE.ROW);\n\n\t\t\t//if we are already on row record then set that as the row, otherwise step forward till we get to a row record\n\t\t\tif (trec.ID == BIFFRECORDTYPE.ROW)\n\t\t\t\trow = (XlsBiffRow)trec;\n\n\t\t\tXlsBiffRow rowRecord = null;\n\t\t\twhile (rowRecord == null)\n\t\t\t{\n\t\t\t\tif (m_stream.Position >= m_stream.Size)\n\t\t\t\t\tbreak;\n\t\t\t\tvar thisRec = m_stream.Read();\n\n\t\t\t\tLogManager.Log(this).Debug(\"finding rowRecord offset {0}, rec: {1}\", thisRec.Offset, thisRec.ID);\n\t\t\t\tif (thisRec is XlsBiffEOF)\n\t\t\t\t\tbreak;\n\t\t\t\trowRecord = thisRec as XlsBiffRow;\n\t\t\t}\n\n\t\t\tif (rowRecord != null)\n\t\t\t\tLogManager.Log(this).Debug(\"Got row {0}, rec: id={1},rowindex={2}, rowColumnStart={3}, rowColumnEnd={4}\", rowRecord.Offset, rowRecord.ID, rowRecord.RowIndex, rowRecord.FirstDefinedColumn, rowRecord.LastDefinedColumn);\n\n\t\t\trow = rowRecord;\n\n            if (dims != null) {\n                dims.IsV8 = isV8();\n\t\t\t\tLogManager.Log(this).Debug(\"dims IsV8={0}\", dims.IsV8);\n                m_maxCol = dims.LastColumn - 1;\n\n\t\t\t\t//handle case where sheet reports last column is 1 but there are actually more\n\t\t\t\tif (m_maxCol <= 0 && rowRecord != null)\n\t\t\t\t{\n\t\t\t\t\tm_maxCol = rowRecord.LastDefinedColumn;\n\t\t\t\t}\n\t\t\t\t\n                m_maxRow = (int)dims.LastRow;\n                sheet.Dimensions = dims;\n            } else {\n                m_maxCol = 256;\n                m_maxRow = (int)idx.LastExistingRow;\n            }\n\n\t\t\tif (idx != null && idx.LastExistingRow <= idx.FirstExistingRow)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse if (row == null)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tm_depth = 0;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate void DumpBiffRecords()\n\t\t{\n\t\t\tXlsBiffRecord rec = null;\n\t\t\tvar startPos = m_stream.Position;\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\trec = m_stream.Read();\n\t\t\t\tLogManager.Log(this).Debug(rec.ID.ToString());\n\t\t\t} while (rec != null && m_stream.Position < m_stream.Size);\n\n\t\t\tm_stream.Seek(startPos, SeekOrigin.Begin);\n\t\t}\n\n\t\tprivate bool readWorkSheetRow()\n\t\t{\n\t\t\tm_cellsValues = new object[m_maxCol];\n\n\t\t\twhile (m_cellOffset < m_stream.Size)\n\t\t\t{\n\t\t\t\tXlsBiffRecord rec = m_stream.ReadAt(m_cellOffset);\n\t\t\t\tm_cellOffset += rec.Size;\n\n\t\t\t\tif ((rec is XlsBiffDbCell)) { break; };//break;\n\t\t\t\tif (rec is XlsBiffEOF) { return false; };\n\n\t\t\t\tXlsBiffBlankCell cell = rec as XlsBiffBlankCell;\n\n\t\t\t\tif ((null == cell) || (cell.ColumnIndex >= m_maxCol)) continue;\n\t\t\t\tif (cell.RowIndex != m_depth) { m_cellOffset -= rec.Size; break; };\n\n\t\t\t\tpushCellValue(cell);\n\t\t\t}\n\n\t\t\tm_depth++;\n\n\t\t\treturn m_depth < m_maxRow;\n\t\t}\n\n\t\tprivate DataTable readWholeWorkSheet(XlsWorksheet sheet)\n\t\t{\n\t\t\tXlsBiffIndex idx;\n\n\t\t\tif (!readWorkSheetGlobals(sheet, out idx, out m_currentRowRecord)) return null;\n\n\t\t\tDataTable table = new DataTable(sheet.Name);\n\n\t\t\tbool triggerCreateColumns = true;\n\n\t\t\tif (idx != null)\n\t\t\t\treadWholeWorkSheetWithIndex(idx, triggerCreateColumns, table);\n\t\t\telse \n\t\t\t\treadWholeWorkSheetNoIndex(triggerCreateColumns, table);\n\n\t\t\ttable.EndLoadData();\n\t\t\treturn table;\n\t\t}\n\n\t\t//TODO: quite a bit of duplication with the noindex version\n\t\tprivate void readWholeWorkSheetWithIndex(XlsBiffIndex idx, bool triggerCreateColumns, DataTable table)\n\t\t{\n\t\t\tm_dbCellAddrs = idx.DbCellAddresses;\n\n\t\t\tfor (int index = 0; index < m_dbCellAddrs.Length; index++)\n\t\t\t{\n\t\t\t\tif (m_depth == m_maxRow) break;\n\n\t\t\t\t// init reading data\n\t\t\t\tm_cellOffset = findFirstDataCellOffset((int) m_dbCellAddrs[index]);\n\t\t\t\tif (m_cellOffset < 0)\n\t\t\t\t\treturn;\n\n\t\t\t\t//DataTable columns\n\t\t\t\tif (triggerCreateColumns)\n\t\t\t\t{\n\t\t\t\t\tif (_isFirstRowAsColumnNames && readWorkSheetRow() || (_isFirstRowAsColumnNames && m_maxRow == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int i = 0; i < m_maxCol; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (m_cellsValues[i] != null && m_cellsValues[i].ToString().Length > 0)\n\t\t\t\t\t\t\t\tHelpers.AddColumnHandleDuplicate(table, m_cellsValues[i].ToString());\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tHelpers.AddColumnHandleDuplicate(table, string.Concat(COLUMN, i));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int i = 0; i < m_maxCol; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttable.Columns.Add(null, typeof (Object));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttriggerCreateColumns = false;\n\n\t\t\t\t\ttable.BeginLoadData();\n\t\t\t\t}\n\n\t\t\t\twhile (readWorkSheetRow())\n\t\t\t\t{\n\t\t\t\t\ttable.Rows.Add(m_cellsValues);\n\t\t\t\t}\n\n\t\t\t\t//add the row\n\t\t\t\tif (m_depth > 0 && !(_isFirstRowAsColumnNames && m_maxRow == 1))\n\t\t\t\t{\n\t\t\t\t\ttable.Rows.Add(m_cellsValues);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\tprivate void readWholeWorkSheetNoIndex(bool triggerCreateColumns, DataTable table)\n\t\t{\n\t\t\twhile (Read())\n\t\t\t{\n\t\t\t\tif (m_depth == m_maxRow) break;\n\n\t\t\t\tbool justAddedColumns = false;\n\t\t\t\t//DataTable columns\n\t\t\t\tif (triggerCreateColumns)\n\t\t\t\t{\n\t\t\t\t\tif (_isFirstRowAsColumnNames || (_isFirstRowAsColumnNames && m_maxRow == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int i = 0; i < m_maxCol; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (m_cellsValues[i] != null && m_cellsValues[i].ToString().Length > 0)\n\t\t\t\t\t\t\t\tHelpers.AddColumnHandleDuplicate(table, m_cellsValues[i].ToString());\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tHelpers.AddColumnHandleDuplicate(table, string.Concat(COLUMN, i));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int i = 0; i < m_maxCol; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttable.Columns.Add(null, typeof(Object));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttriggerCreateColumns = false;\n\t\t\t\t\tjustAddedColumns = true;\n\t\t\t\t\ttable.BeginLoadData();\n\t\t\t\t}\n\n\t\t\t\tif (!justAddedColumns && m_depth > 0 && !(_isFirstRowAsColumnNames && m_maxRow == 1))\n\t\t\t\t{\n\t\t\t\t\ttable.Rows.Add(m_cellsValues);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (m_depth > 0 && !(_isFirstRowAsColumnNames && m_maxRow == 1))\n\t\t\t{\n\t\t\t\ttable.Rows.Add(m_cellsValues);\n\t\t\t}\n\t\t}\n\n\t\tprivate void pushCellValue(XlsBiffBlankCell cell)\n\t\t{\n\t\t\tdouble _dValue;\n\t\t\tLogManager.Log(this).Debug(\"pushCellValue {0}\", cell.ID);\n\t\t\tswitch (cell.ID)\n\t\t\t{\n                case BIFFRECORDTYPE.BOOLERR:\n                    if (cell.ReadByte(7) == 0)\n                        m_cellsValues[cell.ColumnIndex] = cell.ReadByte(6) != 0;\n                    break;\n                case BIFFRECORDTYPE.BOOLERR_OLD:\n                    if (cell.ReadByte(8) == 0)\n                        m_cellsValues[cell.ColumnIndex] = cell.ReadByte(7) != 0;\n                    break;\n\t\t\t\tcase BIFFRECORDTYPE.INTEGER:\n\t\t\t\tcase BIFFRECORDTYPE.INTEGER_OLD:\n\t\t\t\t\tm_cellsValues[cell.ColumnIndex] = ((XlsBiffIntegerCell)cell).Value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BIFFRECORDTYPE.NUMBER:\n\t\t\t\tcase BIFFRECORDTYPE.NUMBER_OLD:\n\n\t\t\t\t\t_dValue = ((XlsBiffNumberCell)cell).Value;\n\n\t\t\t\t\tm_cellsValues[cell.ColumnIndex] = !ConvertOaDate ?\n\t\t\t\t\t\t_dValue : tryConvertOADateTime(_dValue, cell.XFormat);\n\n\t\t\t\t\tLogManager.Log(this).Debug(\"VALUE: {0}\", _dValue);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BIFFRECORDTYPE.LABEL:\n\t\t\t\tcase BIFFRECORDTYPE.LABEL_OLD:\n\t\t\t\tcase BIFFRECORDTYPE.RSTRING:\n\t\t\t\t\t\n\t\t\t\t\tm_cellsValues[cell.ColumnIndex] = ((XlsBiffLabelCell)cell).Value;\n\n\t\t\t\t\tLogManager.Log(this).Debug(\"VALUE: {0}\", m_cellsValues[cell.ColumnIndex]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BIFFRECORDTYPE.LABELSST:\n\t\t\t\t\tstring tmp = m_globals.SST.GetString(((XlsBiffLabelSSTCell)cell).SSTIndex);\n\t\t\t\t\tLogManager.Log(this).Debug(\"VALUE: {0}\", tmp);\n\t\t\t\t\tm_cellsValues[cell.ColumnIndex] = tmp;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BIFFRECORDTYPE.RK:\n\n\t\t\t\t\t_dValue = ((XlsBiffRKCell)cell).Value;\n\n\t\t\t\t\tm_cellsValues[cell.ColumnIndex] = !ConvertOaDate ?\n\t\t\t\t\t\t_dValue : tryConvertOADateTime(_dValue, cell.XFormat);\n\n\t\t\t\t\tLogManager.Log(this).Debug(\"VALUE: {0}\", _dValue);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BIFFRECORDTYPE.MULRK:\n\n\t\t\t\t\tXlsBiffMulRKCell _rkCell = (XlsBiffMulRKCell)cell;\n\t\t\t\t\tfor (ushort j = cell.ColumnIndex; j <= _rkCell.LastColumnIndex; j++)\n\t\t\t\t\t{\n                        _dValue = _rkCell.GetValue(j);\n\t\t\t\t\t\tLogManager.Log(this).Debug(\"VALUE[{1}]: {0}\", _dValue, j);\n                        m_cellsValues[j] = !ConvertOaDate ? _dValue : tryConvertOADateTime(_dValue, _rkCell.GetXF(j));\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase BIFFRECORDTYPE.BLANK:\n\t\t\t\tcase BIFFRECORDTYPE.BLANK_OLD:\n\t\t\t\tcase BIFFRECORDTYPE.MULBLANK:\n\t\t\t\t\t// Skip blank cells\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase BIFFRECORDTYPE.FORMULA:\n\t\t\t\tcase BIFFRECORDTYPE.FORMULA_OLD:\n\n\t\t\t\t\tobject _oValue = ((XlsBiffFormulaCell)cell).Value;\n\n\t\t\t\t\tif (null != _oValue && _oValue is FORMULAERROR)\n\t\t\t\t\t{\n\t\t\t\t\t\t_oValue = null;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tm_cellsValues[cell.ColumnIndex] = !ConvertOaDate ?\n\t\t\t\t\t\t\t_oValue : tryConvertOADateTime(_oValue, (ushort)(cell.XFormat));//date time offset\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tprivate bool moveToNextRecord()\n\t\t{\n\t\t\t//if sheet has no index\n\t\t\tif (m_noIndex)\n\t\t\t{\n\t\t\t\tLogManager.Log(this).Debug(\"No index\");\n\t\t\t\treturn moveToNextRecordNoIndex();\n\t\t\t}\n\n\t\t\t//if sheet has index\n\t\t\tif (null == m_dbCellAddrs ||\n\t\t\t\tm_dbCellAddrsIndex == m_dbCellAddrs.Length ||\n\t\t\t\tm_depth == m_maxRow) return false;\n\n\t\t\tm_canRead = readWorkSheetRow();\n\n\t\t\t//read last row\n\t\t\tif (!m_canRead && m_depth > 0) m_canRead = true;\n\n\t\t\tif (!m_canRead && m_dbCellAddrsIndex < (m_dbCellAddrs.Length - 1))\n\t\t\t{\n\t\t\t\tm_dbCellAddrsIndex++;\n\t\t\t\tm_cellOffset = findFirstDataCellOffset((int)m_dbCellAddrs[m_dbCellAddrsIndex]);\n\t\t\t\tif (m_cellOffset < 0)\n\t\t\t\t\treturn false;\n\t\t\t\tm_canRead = readWorkSheetRow();\n\t\t\t}\n\n\t\t\treturn m_canRead;\n\t\t}\n\n\t\tprivate bool moveToNextRecordNoIndex()\n\t\t{\n\t\t\t//seek from current row record to start of cell data where that cell relates to the next row record\n\t\t\tXlsBiffRow rowRecord = m_currentRowRecord;\n\n\t\t\tif (rowRecord == null)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tif (rowRecord.RowIndex < m_depth)\n\t\t\t{\n\t\t\t\tm_stream.Seek(rowRecord.Offset + rowRecord.Size, SeekOrigin.Begin);\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tif (m_stream.Position >= m_stream.Size)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar record = m_stream.Read();\n\t\t\t\t\tif (record is XlsBiffEOF)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\trowRecord = record as XlsBiffRow;\n\n\t\t\t\t} while (rowRecord == null || rowRecord.RowIndex < m_depth);\n\t\t\t}\n\n\t\t\tm_currentRowRecord = rowRecord;\n\t\t\t//m_depth = m_currentRowRecord.RowIndex;\n\n\t\t\t//we have now found the row record for the new row, the we need to seek forward to the first cell record\n\t\t\tXlsBiffBlankCell cell = null;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif (m_stream.Position >= m_stream.Size)\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar record = m_stream.Read();\n\t\t\t\tif (record is XlsBiffEOF)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (record.IsCell)\n\t\t\t\t{\n\t\t\t\t\tvar candidateCell = record as XlsBiffBlankCell;\n\t\t\t\t\tif (candidateCell != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (candidateCell.RowIndex == m_currentRowRecord.RowIndex)\n\t\t\t\t\t\t\tcell = candidateCell;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (cell == null);\n\n\t\t\tm_cellOffset = cell.Offset;\n\t\t\tm_canRead = readWorkSheetRow();\n\n\n\t\t\t//read last row\n\t\t\t//if (!m_canRead && m_depth > 0) m_canRead = true;\n\n\t\t\t//if (!m_canRead && m_dbCellAddrsIndex < (m_dbCellAddrs.Length - 1))\n\t\t\t//{\n\t\t\t//\tm_dbCellAddrsIndex++;\n\t\t\t//\tm_cellOffset = findFirstDataCellOffset((int)m_dbCellAddrs[m_dbCellAddrsIndex]);\n\n\t\t\t//\tm_canRead = readWorkSheetRow();\n\t\t\t//}\n\n\t\t\treturn m_canRead;\n\t\t}\n\n\t\tprivate void initializeSheetRead()\n\t\t{\n\t\t\tif (m_SheetIndex == ResultsCount) return;\n\n\t\t\tm_dbCellAddrs = null;\n\n\t\t\tm_IsFirstRead = false;\n\n\t\t\tif (m_SheetIndex == -1) m_SheetIndex = 0;\n\n\t\t\tXlsBiffIndex idx;\n\n\t\t\tif (!readWorkSheetGlobals(m_sheets[m_SheetIndex], out idx, out m_currentRowRecord))\n\t\t\t{\n\t\t\t\t//read next sheet\n\t\t\t\tm_SheetIndex++;\n\t\t\t\tinitializeSheetRead();\n\t\t\t\treturn;\n\t\t\t};\n\n\t\t\tif (idx == null)\n\t\t\t{\n\t\t\t\t//no index, but should have the first row record\n\t\t\t\tm_noIndex = true;\n\t\t\t}\n\t\t\telse\t\t\t\n\t\t\t{\n\t\t\t\tm_dbCellAddrs = idx.DbCellAddresses;\n\t\t\t\tm_dbCellAddrsIndex = 0;\n\t\t\t\tm_cellOffset = findFirstDataCellOffset((int)m_dbCellAddrs[m_dbCellAddrsIndex]);\n\t\t\t\tif (m_cellOffset < 0)\n\t\t\t\t{\n\t\t\t\t\tfail(\"Badly formed binary file. Has INDEX but no DBCELL\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\n\t\tprivate void fail(string message)\n\t\t{\n\t\t\tm_exceptionMessage = message;\n\t\t\tm_isValid = false;\n\n\t\t\tm_file.Close();\n\t\t\tm_isClosed = true;\n\n\t\t\tm_workbookData = null;\n\t\t\tm_sheets = null;\n\t\t\tm_stream = null;\n\t\t\tm_globals = null;\n\t\t\tm_encoding = null;\n\t\t\tm_hdr = null;\n\t\t}\n\n\t\tprivate  object tryConvertOADateTime(double value, ushort XFormat)\n\t\t{\n\t\t    ushort format = 0;\n            if (XFormat >= 0 && XFormat < m_globals.ExtendedFormats.Count)\n            {\n                var rec = m_globals.ExtendedFormats[XFormat];\n                switch (rec.ID)\n                {\n                    case BIFFRECORDTYPE.XF_V2:\n                        format = (ushort) (rec.ReadByte(2) & 0x3F);\n                        break;\n                    case BIFFRECORDTYPE.XF_V3:\n                          if ((rec.ReadByte(3) & 4) == 0)\n                            return value;\n                        format = rec.ReadByte(1);\n                        break;\n                    case BIFFRECORDTYPE.XF_V4:\n                        if ((rec.ReadByte(5) & 4) == 0)\n                            return value;\n                        format = rec.ReadByte(1);\n                        break;\n                    \n                    default:\n                        if ((rec.ReadByte(m_globals.Sheets[m_globals.Sheets.Count-1].IsV8 ? 9 : 7) & 4) == 0)\n                            return value;\n                        \n                        format = rec.ReadUInt16(2);\n                        break;\n                }\n            }\n\t\t\telse\n            {\n            \tformat = XFormat;\n            }\n\n           \n            switch (format)\n            {\n                // numeric built in formats\n                case 0: //\"General\";\n                case 1: //\"0\";\n                case 2: //\"0.00\";\n                case 3: //\"#,##0\";\n                case 4: //\"#,##0.00\";\n                case 5: //\"\\\"$\\\"#,##0_);(\\\"$\\\"#,##0)\";\n                case 6: //\"\\\"$\\\"#,##0_);[Red](\\\"$\\\"#,##0)\";\n                case 7: //\"\\\"$\\\"#,##0.00_);(\\\"$\\\"#,##0.00)\";\n                case 8: //\"\\\"$\\\"#,##0.00_);[Red](\\\"$\\\"#,##0.00)\";\n                case 9: //\"0%\";\n                case 10: //\"0.00%\";\n                case 11: //\"0.00E+00\";\n                case 12: //\"# ?/?\";\n                case 13: //\"# ??/??\";\n                case 0x30:// \"##0.0E+0\";\n               \n                case 0x25:// \"_(#,##0_);(#,##0)\";\n                case 0x26:// \"_(#,##0_);[Red](#,##0)\";\n                case 0x27:// \"_(#,##0.00_);(#,##0.00)\";\n                case 40:// \"_(#,##0.00_);[Red](#,##0.00)\";\n                case 0x29:// \"_(\\\"$\\\"* #,##0_);_(\\\"$\\\"* (#,##0);_(\\\"$\\\"* \\\"-\\\"_);_(@_)\";\n                case 0x2a:// \"_(\\\"$\\\"* #,##0_);_(\\\"$\\\"* (#,##0);_(\\\"$\\\"* \\\"-\\\"_);_(@_)\";\n                case 0x2b:// \"_(\\\"$\\\"* #,##0.00_);_(\\\"$\\\"* (#,##0.00);_(\\\"$\\\"* \\\"-\\\"??_);_(@_)\";\n                case 0x2c:// \"_(* #,##0.00_);_(* (#,##0.00);_(* \\\"-\\\"??_);_(@_)\";\n                    return value;\n\n                    // date formats\n                case 14: //this.GetDefaultDateFormat();\n                case 15: //\"D-MM-YY\";\n                case 0x10: // \"D-MMM\";\n                case 0x11: // \"MMM-YY\";\n                case 0x12: // \"h:mm AM/PM\";\n                case 0x13: // \"h:mm:ss AM/PM\";\n                case 20: // \"h:mm\";\n                case 0x15: // \"h:mm:ss\";\n                case 0x16: // string.Format(\"{0} {1}\", this.GetDefaultDateFormat(), this.GetDefaultTimeFormat());\n                   \n                case 0x2d: // \"mm:ss\";\n                case 0x2e: // \"[h]:mm:ss\";\n                case 0x2f: // \"mm:ss.0\";\n                    return Helpers.ConvertFromOATime(value);\n                 case 0x31:// \"@\";\n                    return value.ToString();\n\n                default:\n                    XlsBiffFormatString fmtString;\n                    if (m_globals.Formats.TryGetValue(format, out fmtString) )\n                    {\n                        var fmt = fmtString.Value;\n                    \tvar formatReader = new FormatReader() {FormatString = fmt};\n\t\t\t\t\t\tif (formatReader.IsDateFormatString())\n                            return Helpers.ConvertFromOATime(value); \n\n                    }\n                    return value;\n\n\n\n            }\n\n\t\t    \n\t\t}\n\n\t    private  object tryConvertOADateTime(object value, ushort XFormat)\n\t    {\n\t        double _dValue;\n\n\n\t\t\tif (double.TryParse(value.ToString(), out _dValue))\n\t\t\t\treturn tryConvertOADateTime(_dValue, XFormat);\n\n\t\t\treturn value;\n\n\t    }\n\n\t    public bool isV8()\n\t\t{\n\t\t\treturn m_version >= 0x600;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IExcelDataReader Members\n\n\t\tpublic void Initialize(Stream fileStream)\n\t\t{\n\t\t\tm_file = fileStream;\n\n            readWorkBookGlobals();\n\n            // set the sheet index to the index of the first sheet.. this is so that properties such as Name which use m_sheetIndex reflect the first sheet in the file without having to perform a read() operation\n            m_SheetIndex = 0;\n\t\t}\n\n\t\tpublic DataSet AsDataSet()\n\t\t{\n\t\t\treturn AsDataSet(false);\n\t\t}\n\n\t\tpublic DataSet AsDataSet(bool convertOADateTime)\n\t\t{\n\t\t\tif (!m_isValid) return null;\n\n\t\t\tif (m_isClosed) return m_workbookData;\n\n\t\t\tConvertOaDate = convertOADateTime;\n\t\t\tm_workbookData = new DataSet();\n            \n\n\t\t\tfor (int index = 0; index < ResultsCount; index++)\n\t\t\t{\n\t\t\t\tDataTable table = readWholeWorkSheet(m_sheets[index]);\n\n\t\t\t\tif (null != table)\n\t\t\t\t\tm_workbookData.Tables.Add(table);\n\t\t\t}\n\n\t\t\tm_file.Close();\n\t\t\tm_isClosed = true;\n\t\t    m_workbookData.AcceptChanges();\n\t\t    Helpers.FixDataTypes(m_workbookData);\n\n\t\t\treturn m_workbookData;\n\t\t}\n\n\t\tpublic string ExceptionMessage\n\t\t{\n\t\t\tget { return m_exceptionMessage; }\n\t\t}\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (null != m_sheets && m_sheets.Count > 0)\n\t\t\t\t\treturn m_sheets[m_SheetIndex].Name;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsValid\n\t\t{\n\t\t\tget { return m_isValid; }\n\t\t}\n\n\t\tpublic void Close()\n\t\t{\n\t\t\tm_file.Close();\n\t\t\tm_isClosed = true;\n\t\t}\n\n\t\tpublic int Depth\n\t\t{\n\t\t\tget { return m_depth; }\n\t\t}\n\n\t\tpublic int ResultsCount\n\t\t{\n\t\t\tget { return m_globals.Sheets.Count; }\n\t\t}\n\n\t\tpublic bool IsClosed\n\t\t{\n\t\t\tget { return m_isClosed; }\n\t\t}\n\n\t\tpublic bool NextResult()\n\t\t{\n\t\t\tif (m_SheetIndex >= (this.ResultsCount - 1)) return false;\n\n\t\t\tm_SheetIndex++;\n\n\t\t\tm_IsFirstRead = true;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic bool Read()\n\t\t{\n\t\t\tif (!m_isValid) return false;\n\n\t\t\tif (m_IsFirstRead) initializeSheetRead();\n\n\t\t\treturn moveToNextRecord();\n\t\t}\n\n\t\tpublic int FieldCount\n\t\t{\n\t\t\tget { return m_maxCol; }\n\t\t}\n\n\t\tpublic bool GetBoolean(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return false;\n\n\t\t\treturn Boolean.Parse(m_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic DateTime GetDateTime(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return DateTime.MinValue;\n\n            // requested change: 3\n\t\t\tobject val = m_cellsValues[i];\n\n            if (val is DateTime)\n            {\n                // if the value is already a datetime.. return it without further conversion\n                return (DateTime)val;\n            }\n\n            // otherwise proceed with conversion attempts\n            string valString = val.ToString();\n            double dVal;\n\n\t\t\ttry\n\t\t\t{\n                dVal = double.Parse(valString);\n\t\t\t}\n\t\t\tcatch (FormatException)\n\t\t\t{\n                return DateTime.Parse(valString);\n\t\t\t}\n\n\t\t\treturn DateTime.FromOADate(dVal);\n\t\t}\n\n\t\tpublic decimal GetDecimal(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return decimal.MinValue;\n\n\t\t\treturn decimal.Parse(m_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic double GetDouble(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return double.MinValue;\n\n\t\t\treturn double.Parse(m_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic float GetFloat(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return float.MinValue;\n\n\t\t\treturn float.Parse(m_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic short GetInt16(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return short.MinValue;\n\n\t\t\treturn short.Parse(m_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic int GetInt32(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return int.MinValue;\n\n\t\t\treturn int.Parse(m_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic long GetInt64(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return long.MinValue;\n\n\t\t\treturn long.Parse(m_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic string GetString(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return null;\n\n\t\t\treturn m_cellsValues[i].ToString();\n\t\t}\n\n\t\tpublic object GetValue(int i)\n\t\t{\n\t\t\treturn m_cellsValues[i];\n\t\t}\n\n\t\tpublic bool IsDBNull(int i)\n\t\t{\n\t\t\treturn (null == m_cellsValues[i]) || (DBNull.Value == m_cellsValues[i]);\n\t\t}\n\n\t\tpublic object this[int i]\n\t\t{\n\t\t\tget { return m_cellsValues[i]; }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region  Not Supported IDataReader Members\n\n\n\t\tpublic DataTable GetSchemaTable()\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic int RecordsAffected\n\t\t{\n\t\t\tget { throw new NotSupportedException(); }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Not Supported IDataRecord Members\n\n\n\t\tpublic byte GetByte(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic char GetChar(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic IDataReader GetData(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic string GetDataTypeName(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic Type GetFieldType(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic Guid GetGuid(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic string GetName(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic int GetOrdinal(string name)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic int GetValues(object[] values)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic object this[string name]\n\t\t{\n\t\t\tget { throw new NotSupportedException(); }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IExcelDataReader Members\n\n\n\t\tpublic bool IsFirstRowAsColumnNames\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _isFirstRowAsColumnNames;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\t_isFirstRowAsColumnNames = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool ConvertOaDate\n\t\t{\n\t\t\tget { return m_ConvertOADate; }\n\t\t\tset { m_ConvertOADate = value; }\n\t\t}\n\n\t\tpublic ReadOption ReadOption\n\t\t{\n\t\t\tget { return m_ReadOption; }\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t/// <summary>\n\t/// Strict is as normal, Loose is more forgiving and will not cause an exception if a record size takes it beyond the end of the file. It will be trunacted in this case (SQl Reporting Services)\n\t/// </summary>\n\tpublic enum ReadOption\n\t{\n\t\tStrict,\n\t\tLoose\n\t}\n}"
  },
  {
    "path": "Excel/ExcelDataReader.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\nusing Excel.Core.BinaryFormat;\n\nnamespace Excel\n{\n\t/// <summary>\n\t/// ExcelDataReader Class\n\t/// </summary>\n\tpublic class ExcelDataReader : IDisposable\n\t{\n\t\t#region Members\n\n\t\tprivate Stream m_file;\n\t\tprivate XlsHeader m_hdr;\n\t\tprivate List<XlsWorksheet> m_sheets;\n\t\tprivate XlsBiffStream m_stream;\n\t\tprivate DataSet m_workbookData;\n\t\tprivate XlsWorkbookGlobals m_globals;\n\t\tprivate ushort m_version;\n\t\tprivate bool m_PromoteToColumns;\n\t\tprivate bool m_ConvertOADate;\n\t\tprivate bool m_IsProtected;\n\t\tprivate Encoding m_encoding;\n\n\t\tprivate readonly Encoding m_Default_Encoding = Encoding.UTF8;\n\n\t\tprivate const string WORKBOOK = \"Workbook\";\n\t\tprivate const string BOOK = \"Book\";\n\t\tprivate const string COLUMN_DEFAULT_NAME = \"Column\";\n\n\t\tprivate bool disposed;\n\n\t\t#endregion\n\n\t\t#region Properties\n\n\t\t/// <summary>\n\t\t/// DataSet with workbook data, Tables represent Sheets\n\t\t/// </summary>\n\t\tpublic DataSet WorkbookData\n\t\t{\n\t\t\tget { return m_workbookData; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets a value indicating whether the Xls file is protected.\n\t\t/// </summary>\n\t\t/// <value>\n\t\t/// \t<c>true</c> if this Xls file is proteted; otherwise, <c>false</c>.\n\t\t/// </value>\n\t\tpublic bool IsProtected\n\t\t{\n\t\t\tget { return m_IsProtected; }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Constructor and IDisposable Members\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ExcelDataReader\"/> class.\n\t\t/// </summary>\n\t\t/// <param name=\"fileStream\">Xls Stream</param>\n\t\tpublic ExcelDataReader(Stream fileStream)\n\t\t\t: this(fileStream, false, true)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ExcelDataReader\"/> class.\n\t\t/// </summary>\n\t\t/// <param name=\"fileStream\">Xls Stream</param>\n\t\t/// <param name=\"promoteToColumns\">if is set to <c>true</c> the first row will be moved in to column names.</param>\n\t\t/// <param name=\"convertOADate\">if is set to <c>true</c> the Date and Time values from the Xls Stream will be mapped as strings in the output DataSet.</param>\n\t\tpublic ExcelDataReader(Stream fileStream, bool promoteToColumns, bool convertOADate)\n\t\t{\n\t\t\tm_PromoteToColumns = promoteToColumns;\n\t\t\tm_encoding = m_Default_Encoding;\n\t\t\tm_version = 0x0600;\n\t\t\tm_ConvertOADate = convertOADate;\n\t\t\tm_sheets = new List<XlsWorksheet>();\n\n\t\t\tParseXlsStream(fileStream);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDispose(true);\n\n\t\t\tGC.SuppressFinalize(this);\n\t\t}\n\n\t\tprivate void Dispose(bool disposing)\n\t\t{\n\t\t\t// Check to see if Dispose has already been called.\n\t\t\tif (!this.disposed)\n\t\t\t{\n\t\t\t\tif (disposing)\n\t\t\t\t{\n\t\t\t\t\tm_workbookData.Dispose();\n\n\t\t\t\t\tm_sheets.Clear();\n\t\t\t\t}\n\n\t\t\t\tm_workbookData = null;\n\t\t\t\tm_sheets = null;\n\t\t\t\tm_stream = null;\n\t\t\t\tm_globals = null;\n\t\t\t\tm_encoding = null;\n\t\t\t\tm_hdr = null;\n\n\t\t\t\tdisposed = true;\n\t\t\t}\n\t\t}\n\n\t\t~ExcelDataReader()\n\t\t{\n\t\t\tDispose(false);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Private methods\n\n\t\tprivate void ParseXlsStream(Stream fileStream)\n\t\t{\n\t\t\tusing (m_file = fileStream)\n\t\t\t{\n\t\t\t\tm_hdr = XlsHeader.ReadHeader(m_file);\n\t\t\t\tXlsRootDirectory dir = new XlsRootDirectory(m_hdr);\n\t\t\t\tXlsDirectoryEntry workbookEntry = dir.FindEntry(WORKBOOK) ?? dir.FindEntry(BOOK);\n\n\t\t\t\tif (workbookEntry == null)\n\t\t\t\t\tthrow new FileNotFoundException(Errors.ErrorStreamWorkbookNotFound);\n\t\t\t\tif (workbookEntry.EntryType != STGTY.STGTY_STREAM)\n\t\t\t\t\tthrow new FormatException(Errors.ErrorWorkbookIsNotStream);\n\n\t\t\t\tm_stream = new XlsBiffStream(m_hdr, workbookEntry.StreamFirstSector);\n\n\t\t\t\tReadWorkbookGlobals();\n\n\t\t\t\tm_workbookData = new DataSet();\n\n\t\t\t\tfor (int i = 0; i < m_sheets.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tif (ReadWorksheet(m_sheets[i]))\n\t\t\t\t\t\tm_workbookData.Tables.Add(m_sheets[i].Data);\n\t\t\t\t}\n\n\t\t\t\tm_globals.SST = null;\n\t\t\t\tm_globals = null;\n\t\t\t\tm_sheets = null;\n\t\t\t\tm_stream = null;\n\t\t\t\tm_hdr = null;\n\n\t\t\t\tGC.Collect();\n\t\t\t\tGC.SuppressFinalize(this);\n\t\t\t}\n\t\t}\n\n\t\tprivate void ReadWorkbookGlobals()\n\t\t{\n\t\t\tm_globals = new XlsWorkbookGlobals();\n\n\t\t\tm_stream.Seek(0, SeekOrigin.Begin);\n\n\t\t\tXlsBiffRecord rec = m_stream.Read();\n\t\t\tXlsBiffBOF bof = rec as XlsBiffBOF;\n\n\t\t\tif (bof == null || bof.Type != BIFFTYPE.WorkbookGlobals)\n\t\t\t\tthrow new ArgumentException(Errors.ErrorWorkbookGlobalsInvalidData);\n\n\t\t\tm_version = bof.Version;\n\n\t\t\tbool sst = false;\n\n\t\t\twhile (null != (rec = m_stream.Read()))\n\t\t\t{\n\t\t\t\tswitch (rec.ID)\n\t\t\t\t{\n\t\t\t\t\tcase BIFFRECORDTYPE.INTERFACEHDR:\n\t\t\t\t\t\tm_globals.InterfaceHdr = (XlsBiffInterfaceHdr)rec;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.BOUNDSHEET:\n\t\t\t\t\t\tXlsBiffBoundSheet sheet = (XlsBiffBoundSheet)rec;\n\n\t\t\t\t\t\tif (sheet.Type != XlsBiffBoundSheet.SheetType.Worksheet) break;\n\n\t\t\t\t\t\tsheet.IsV8 = IsV8();\n\t\t\t\t\t\tsheet.UseEncoding = m_encoding;\n\n\t\t\t\t\t\tm_sheets.Add(new XlsWorksheet(m_globals.Sheets.Count, sheet));\n\t\t\t\t\t\tm_globals.Sheets.Add(sheet);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.MMS:\n\t\t\t\t\t\tm_globals.MMS = rec;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.COUNTRY:\n\t\t\t\t\t\tm_globals.Country = rec;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.CODEPAGE:\n\n\t\t\t\t\t\tm_globals.CodePage = (XlsBiffSimpleValueRecord)rec;\n\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tm_encoding = Encoding.GetEncoding(m_globals.CodePage.Value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Warning - Password protection\n\t\t\t\t\t\t\t// TODO: Attach to ILog\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.FONT:\n\t\t\t\t\tcase BIFFRECORDTYPE.FONT_V34:\n\t\t\t\t\t\tm_globals.Fonts.Add(rec);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.FORMAT:\n\t\t\t\t\tcase BIFFRECORDTYPE.FORMAT_V23:\n\t\t\t\t\t\tm_globals.Formats.Add(rec);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.XF:\n\t\t\t\t\tcase BIFFRECORDTYPE.XF_V4:\n\t\t\t\t\tcase BIFFRECORDTYPE.XF_V3:\n\t\t\t\t\tcase BIFFRECORDTYPE.XF_V2:\n\t\t\t\t\t\tm_globals.ExtendedFormats.Add(rec);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.SST:\n\t\t\t\t\t\tm_globals.SST = (XlsBiffSST)rec;\n\t\t\t\t\t\tsst = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.CONTINUE:\n\t\t\t\t\t\tif (!sst) break;\n\t\t\t\t\t\tXlsBiffContinue contSST = (XlsBiffContinue)rec;\n\t\t\t\t\t\tm_globals.SST.Append(contSST);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.EXTSST:\n\t\t\t\t\t\tm_globals.ExtSST = rec;\n\t\t\t\t\t\tsst = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.PROTECT:\n\t\t\t\t\tcase BIFFRECORDTYPE.PASSWORD:\n\t\t\t\t\tcase BIFFRECORDTYPE.PROT4REVPASSWORD:\n\t\t\t\t\t\tm_IsProtected = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BIFFRECORDTYPE.EOF:\n\t\t\t\t\t\tif (m_globals.SST != null)\n\t\t\t\t\t\t\tm_globals.SST.ReadStrings();\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate bool ReadWorksheet(XlsWorksheet sheet)\n\t\t{\n\t\t\tm_stream.Seek((int)sheet.DataOffset, SeekOrigin.Begin);\n\n\t\t\tXlsBiffBOF bof = m_stream.Read() as XlsBiffBOF;\n\t\t\tif (bof == null || bof.Type != BIFFTYPE.Worksheet)\n\t\t\t\treturn false;\n\n\t\t\tXlsBiffIndex idx = m_stream.Read() as XlsBiffIndex;\n\n\t\t\tif (null == idx) return false;\n\n\t\t\tidx.IsV8 = IsV8();\n\n\t\t\tDataTable dt = new DataTable(sheet.Name);\n\n\t\t\tXlsBiffRecord trec;\n\t\t\tXlsBiffDimensions dims = null;\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\ttrec = m_stream.Read();\n\t\t\t\tif (trec.ID == BIFFRECORDTYPE.DIMENSIONS)\n\t\t\t\t{\n\t\t\t\t\tdims = (XlsBiffDimensions)trec;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t} while (trec != null && trec.ID != BIFFRECORDTYPE.ROW);\n\n\t\t\tint maxCol = 256;\n\n\t\t\tif (dims != null)\n\t\t\t{\n\t\t\t\tdims.IsV8 = IsV8();\n\t\t\t\tmaxCol = dims.LastColumn - 1;\n\t\t\t\tsheet.Dimensions = dims;\n\t\t\t}\n\n\t\t\tInitializeColumns(ref dt, maxCol);\n\n\t\t\tsheet.Data = dt;\n\n\t\t\tuint maxRow = idx.LastExistingRow;\n\t\t\tif (idx.LastExistingRow <= idx.FirstExistingRow)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tdt.BeginLoadData();\n\n\t\t\tfor (int i = 0; i < maxRow; i++)\n\t\t\t{\n\t\t\t\tdt.Rows.Add(dt.NewRow());\n\t\t\t}\n\n\t\t\tuint[] dbCellAddrs = idx.DbCellAddresses;\n\n\t\t\tfor (int i = 0; i < dbCellAddrs.Length; i++)\n\t\t\t{\n\t\t\t\tXlsBiffDbCell dbCell = (XlsBiffDbCell)m_stream.ReadAt((int)dbCellAddrs[i]);\n\t\t\t\tXlsBiffRow row = null;\n\t\t\t\tint offs = dbCell.RowAddress;\n\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\trow = m_stream.ReadAt(offs) as XlsBiffRow;\n\t\t\t\t\tif (row == null) break;\n\n\t\t\t\t\toffs += row.Size;\n\n\t\t\t\t} while (null != row);\n\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tXlsBiffRecord rec = m_stream.ReadAt(offs);\n\t\t\t\t\toffs += rec.Size;\n\t\t\t\t\tif (rec is XlsBiffDbCell) break;\n\t\t\t\t\tif (rec is XlsBiffEOF) break;\n\t\t\t\t\tXlsBiffBlankCell cell = rec as XlsBiffBlankCell;\n\n\t\t\t\t\tif (cell == null) continue;\n\t\t\t\t\tif (cell.ColumnIndex >= maxCol) continue;\n\t\t\t\t\tif (cell.RowIndex > maxRow) continue;\n\n\t\t\t\t\tstring _sValue;\n\t\t\t\t\tdouble _dValue;\n\n\t\t\t\t\tswitch (cell.ID)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase BIFFRECORDTYPE.INTEGER:\n\t\t\t\t\t\tcase BIFFRECORDTYPE.INTEGER_OLD:\n\t\t\t\t\t\t\tdt.Rows[cell.RowIndex][cell.ColumnIndex] = ((XlsBiffIntegerCell)cell).Value.ToString();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase BIFFRECORDTYPE.NUMBER:\n\t\t\t\t\t\tcase BIFFRECORDTYPE.NUMBER_OLD:\n\n\t\t\t\t\t\t\t_dValue = ((XlsBiffNumberCell)cell).Value;\n\n\t\t\t\t\t\t\tif ((_sValue = TryConvertOADate(_dValue, cell.XFormat)) != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdt.Rows[cell.RowIndex][cell.ColumnIndex] = _sValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdt.Rows[cell.RowIndex][cell.ColumnIndex] = _dValue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase BIFFRECORDTYPE.LABEL:\n\t\t\t\t\t\tcase BIFFRECORDTYPE.LABEL_OLD:\n\t\t\t\t\t\tcase BIFFRECORDTYPE.RSTRING:\n\t\t\t\t\t\t\tdt.Rows[cell.RowIndex][cell.ColumnIndex] = ((XlsBiffLabelCell)cell).Value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase BIFFRECORDTYPE.LABELSST:\n\t\t\t\t\t\t\tstring tmp = m_globals.SST.GetString(((XlsBiffLabelSSTCell)cell).SSTIndex);\n\t\t\t\t\t\t\tdt.Rows[cell.RowIndex][cell.ColumnIndex] = tmp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase BIFFRECORDTYPE.RK:\n\n\t\t\t\t\t\t\t_dValue = ((XlsBiffRKCell)cell).Value;\n\n\t\t\t\t\t\t\tif ((_sValue = TryConvertOADate(_dValue, cell.XFormat)) != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdt.Rows[cell.RowIndex][cell.ColumnIndex] = _sValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdt.Rows[cell.RowIndex][cell.ColumnIndex] = _dValue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase BIFFRECORDTYPE.MULRK:\n\n\t\t\t\t\t\t\tXlsBiffMulRKCell _rkCell = (XlsBiffMulRKCell)cell;\n\t\t\t\t\t\t\tfor (ushort j = cell.ColumnIndex; j <= _rkCell.LastColumnIndex; j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdt.Rows[cell.RowIndex][j] = _rkCell.GetValue(j);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase BIFFRECORDTYPE.BLANK:\n\t\t\t\t\t\tcase BIFFRECORDTYPE.BLANK_OLD:\n\t\t\t\t\t\tcase BIFFRECORDTYPE.MULBLANK:\n\t\t\t\t\t\t\t// Skip blank cells\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase BIFFRECORDTYPE.FORMULA:\n\t\t\t\t\t\tcase BIFFRECORDTYPE.FORMULA_OLD:\n\n\t\t\t\t\t\t\tobject _oValue = ((XlsBiffFormulaCell)cell).Value;\n\n\t\t\t\t\t\t\tif (null != _oValue && _oValue is FORMULAERROR) _oValue = null;\n\n\t\t\t\t\t\t\tif (null != _oValue\n\t\t\t\t\t\t\t\t&& (_sValue = TryConvertOADate(_oValue, cell.XFormat)) != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdt.Rows[cell.RowIndex][cell.ColumnIndex] = _sValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdt.Rows[cell.RowIndex][cell.ColumnIndex] = _oValue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdt.EndLoadData();\n\n\t\t\tif (m_PromoteToColumns)\n\t\t\t{\n\t\t\t\tRemapColumnsNames(ref dt, dt.Rows[0].ItemArray);\n\t\t\t\tdt.Rows.RemoveAt(0);\n\t\t\t\tdt.AcceptChanges();\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate string TryConvertOADate(double value, ushort XFormat)\n\t\t{\n\t\t\tif (!m_ConvertOADate) return null;\n\n\t\t\tswitch (XFormat)\n\t\t\t{\n\t\t\t\t//Time format\n\t\t\t\tcase 63:\n\t\t\t\tcase 68:\n\t\t\t\t\tDateTime time = DateTime.FromOADate(value);\n\n\t\t\t\t\treturn (time.Second == 0)\n\t\t\t\t\t\t? time.ToShortTimeString()\n\t\t\t\t\t\t: time.ToLongTimeString();\n\n\t\t\t\t//Date Format\n\t\t\t\tcase 62:\n\t\t\t\tcase 64:\n\t\t\t\tcase 67:\n\t\t\t\tcase 69:\n\t\t\t\tcase 70: return DateTime.FromOADate(value).ToShortDateString();\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tprivate string TryConvertOADate(object value, ushort XFormat)\n\t\t{\n\t\t\tif (!m_ConvertOADate || null == value) return null;\n\n\t\t\tdouble _dValue;\n\t\t\tstring _re;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_dValue = double.Parse(value.ToString());\n\n\t\t\t\t_re = TryConvertOADate(_dValue, XFormat);\n\t\t\t}\n\t\t\tcatch\n\t\t\t{\n\t\t\t\t_re = null;\n\t\t\t}\n\n\n\t\t\treturn _re;\n\n\t\t}\n\n\t\tprivate static void InitializeColumns(ref DataTable dataTable, int columnsCount)\n\t\t{\n\t\t\tfor (int i = 0; i < columnsCount; i++)\n\t\t\t{\n\t\t\t\tdataTable.Columns.Add(COLUMN_DEFAULT_NAME + (i + 1), typeof(string));\n\t\t\t}\n\t\t}\n\n\t\tprivate static void RemapColumnsNames(ref DataTable dataTable, object[] columnNames)\n\t\t{\n\t\t\tfor (int index = 0; index < columnNames.Length; index++)\n\t\t\t{\n\t\t\t\tif (!string.IsNullOrEmpty(columnNames[index].ToString().Trim()))\n\t\t\t\t{\n\t\t\t\t\tdataTable.Columns[index].ColumnName = columnNames[index].ToString().Trim();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate bool IsV8()\n\t\t{\n\t\t\treturn m_version >= 0x600;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}"
  },
  {
    "path": "Excel/ExcelFileType.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel\n{\n\tpublic enum ExcelFileType\n\t{\n\t\tBinary,\n\t\tOpenXml\n\t}\n}\n"
  },
  {
    "path": "Excel/ExcelOpenXmlReader.cs",
    "content": "#define DEBUGREADERS\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Excel.Core.OpenXmlFormat;\nusing System.IO;\nusing Excel.Core;\nusing System.Data;\nusing System.Xml;\nusing System.Globalization;\n\nnamespace Excel\n{\n\t\n\tpublic class ExcelOpenXmlReader : IExcelDataReader\n\t{\n\t\t#region Members\n\n\t\tprivate XlsxWorkbook _workbook;\n\t\tprivate bool _isValid;\n\t\tprivate bool _isClosed;\n\t\tprivate bool _isFirstRead;\n\t\tprivate string _exceptionMessage;\n\t\tprivate int _depth;\n\t\tprivate int _resultIndex;\n\t\tprivate int _emptyRowCount;\n\t\tprivate ZipWorker _zipWorker;\n\t\tprivate XmlReader _xmlReader;\n\t\tprivate Stream _sheetStream;\n\t\tprivate object[] _cellsValues;\n\t\tprivate object[] _savedCellsValues;\n\n\t\tprivate bool disposed;\n\t\tprivate bool _isFirstRowAsColumnNames;\n\t\tprivate const string COLUMN = \"Column\";\n\t\tprivate string instanceId = Guid.NewGuid().ToString();\n\n\t\tprivate List<int> _defaultDateTimeStyles;\n\t\tprivate string _namespaceUri;\n\n\t\t#endregion\n\n\t\tinternal ExcelOpenXmlReader()\n\t\t{\n\t\t\t_isValid = true;\n\t\t\t_isFirstRead = true;\n\n\t\t\t_defaultDateTimeStyles = new List<int>(new int[] \n\t\t\t{\n\t\t\t\t14, 15, 16, 17, 18, 19, 20, 21, 22, 45, 46, 47\n\t\t\t});\n\n\t\t}\n\n\t\tprivate void ReadGlobals()\n\t\t{\n\t\t\t_workbook = new XlsxWorkbook(\n\t\t\t\t_zipWorker.GetWorkbookStream(),\n\t\t\t\t_zipWorker.GetWorkbookRelsStream(),\n\t\t\t\t_zipWorker.GetSharedStringsStream(),\n\t\t\t\t_zipWorker.GetStylesStream());\n\n\t\t\tCheckDateTimeNumFmts(_workbook.Styles.NumFmts);\n\n\t\t}\n\n\t\tprivate void CheckDateTimeNumFmts(List<XlsxNumFmt> list)\n\t\t{\n\t\t\tif (list.Count == 0) return;\n\n\t\t\tforeach (XlsxNumFmt numFmt in list)\n\t\t\t{\n\t\t\t\tif (string.IsNullOrEmpty(numFmt.FormatCode)) continue;\n\t\t\t\tstring fc = numFmt.FormatCode.ToLower();\n\n\t\t\t\tint pos;\n\t\t\t\twhile ((pos = fc.IndexOf('\"')) > 0)\n\t\t\t\t{\n\t\t\t\t\tint endPos = fc.IndexOf('\"', pos + 1);\n\n\t\t\t\t\tif (endPos > 0) fc = fc.Remove(pos, endPos - pos + 1);\n\t\t\t\t}\n\n\t\t\t\t//it should only detect it as a date if it contains\n\t\t\t\t//dd mm mmm yy yyyy\n\t\t\t\t//h hh ss\n\t\t\t\t//AM PM\n\t\t\t\t//and only if these appear as \"words\" so either contained in [ ]\n\t\t\t\t//or delimted in someway\n\t\t\t\t//updated to not detect as date if format contains a #\n\t\t\t\tvar formatReader = new FormatReader() {FormatString = fc};\n\t\t\t\tif (formatReader.IsDateFormatString())\n\t\t\t\t{\n\t\t\t\t\t_defaultDateTimeStyles.Add(numFmt.Id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void ReadSheetGlobals(XlsxWorksheet sheet)\n\t\t{\n\t\t\tif (_xmlReader != null) _xmlReader.Close();\n\t\t\tif (_sheetStream != null) _sheetStream.Close();\n\n\t\t\t_sheetStream = _zipWorker.GetWorksheetStream(sheet.Path);\n\n\t\t\tif (null == _sheetStream) return;\n\n\t\t\t_xmlReader = XmlReader.Create(_sheetStream);\n\n\t\t\t//count rows and cols in case there is no dimension elements\n\t\t\tint rows = 0;\n\t\t\tint cols = 0;\n\n\t\t\t_namespaceUri = null;\n\t\t    int biggestColumn = 0; //used when no col elements and no dimension\n\t\t\twhile (_xmlReader.Read())\n\t\t\t{\n\t\t\t\tif (_xmlReader.NodeType == XmlNodeType.Element && _xmlReader.LocalName == XlsxWorksheet.N_worksheet)\n\t\t\t\t{\n\t\t\t\t\t//grab the namespaceuri from the worksheet element\n\t\t\t\t\t_namespaceUri = _xmlReader.NamespaceURI;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (_xmlReader.NodeType == XmlNodeType.Element && _xmlReader.LocalName == XlsxWorksheet.N_dimension)\n\t\t\t\t{\n\t\t\t\t\tstring dimValue = _xmlReader.GetAttribute(XlsxWorksheet.A_ref);\n\n\t\t\t\t\tsheet.Dimension = new XlsxDimension(dimValue);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n                //removed: Do not use col to work out number of columns as this is really for defining formatting, so may not contain all columns\n                //if (_xmlReader.NodeType == XmlNodeType.Element && _xmlReader.LocalName == XlsxWorksheet.N_col)\n                //    cols++;\n\n\t\t\t\tif (_xmlReader.NodeType == XmlNodeType.Element && _xmlReader.LocalName == XlsxWorksheet.N_row)\n                    rows++;\n\n                //check cells so we can find size of sheet if can't work it out from dimension or col elements (dimension should have been set before the cells if it was available)\n                //ditto for cols\n                if (sheet.Dimension == null && cols == 0 && _xmlReader.NodeType == XmlNodeType.Element && _xmlReader.LocalName == XlsxWorksheet.N_c)\n                {\n                    var refAttribute = _xmlReader.GetAttribute(XlsxWorksheet.A_r);\n\n                    if (refAttribute != null)\n                    {\n                        var thisRef = ReferenceHelper.ReferenceToColumnAndRow(refAttribute);\n                        if (thisRef[1] > biggestColumn)\n                            biggestColumn = thisRef[1];\n                    }\n                }\n\t\t\t\t\t\n\t\t\t}\n\n\n\t\t\t//if we didn't get a dimension element then use the calculated rows/cols to create it\n\t\t\tif (sheet.Dimension == null)\n\t\t\t{\n                if (cols == 0)\n                    cols = biggestColumn;\n\n\t\t\t\tif (rows == 0 || cols == 0) \n\t\t\t\t{\n\t\t\t\t\tsheet.IsEmpty = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsheet.Dimension = new XlsxDimension(rows, cols);\n\t\t\t\t\n\t\t\t\t//we need to reset our position to sheet data\n\t\t\t\t_xmlReader.Close();\n\t\t\t\t_sheetStream.Close();\n\t\t\t\t_sheetStream = _zipWorker.GetWorksheetStream(sheet.Path);\n\t\t\t\t_xmlReader = XmlReader.Create(_sheetStream);\n\n\t\t\t}\n\n\t\t\t//read up to the sheetData element. if this element is empty then there aren't any rows and we need to null out dimension\n\n\t\t\t_xmlReader.ReadToFollowing(XlsxWorksheet.N_sheetData, _namespaceUri);\n\t\t\tif (_xmlReader.IsEmptyElement)\n\t\t\t{\n\t\t\t\tsheet.IsEmpty = true;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\n\t\tprivate bool ReadSheetRow(XlsxWorksheet sheet)\n\t\t{\n\t\t\tif (null == _xmlReader) return false;\n\n\t\t\tif (_emptyRowCount != 0)\n\t\t\t{\n\t\t\t\t_cellsValues = new object[sheet.ColumnsCount];\n\t\t\t\t_emptyRowCount--;\n\t\t\t\t_depth++;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (_savedCellsValues != null)\n\t\t\t{\n\t\t\t\t_cellsValues = _savedCellsValues;\n\t\t\t\t_savedCellsValues = null;\n\t\t\t\t_depth++;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n            if ((_xmlReader.NodeType == XmlNodeType.Element && _xmlReader.LocalName == XlsxWorksheet.N_row) ||\n                _xmlReader.ReadToFollowing(XlsxWorksheet.N_row, _namespaceUri))\n\t\t\t{\n\t\t\t\t_cellsValues = new object[sheet.ColumnsCount];\n\n\t\t\t\tint rowIndex = int.Parse(_xmlReader.GetAttribute(XlsxWorksheet.A_r));\n\t\t\t\tif (rowIndex != (_depth + 1))\n\t\t\t\tif (rowIndex != (_depth + 1))\n\t\t\t\t{\n\t\t\t\t\t_emptyRowCount = rowIndex - _depth - 1;\n\t\t\t\t}\n\t\t\t\tbool hasValue = false;\n\t\t\t\tstring a_s = String.Empty;\n\t\t\t\tstring a_t = String.Empty;\n\t\t\t\tstring a_r = String.Empty;\n\t\t\t\tint col = 0;\n\t\t\t\tint row = 0;\n\n                while (_xmlReader.Read())\n                {\n                    if (_xmlReader.Depth == 2) break;\n\n                    if (_xmlReader.NodeType == XmlNodeType.Element)\n                    {\n                        hasValue = false;\n\n                        if (_xmlReader.LocalName == XlsxWorksheet.N_c)\n                        {\n                            a_s = _xmlReader.GetAttribute(XlsxWorksheet.A_s);\n                            a_t = _xmlReader.GetAttribute(XlsxWorksheet.A_t);\n                            a_r = _xmlReader.GetAttribute(XlsxWorksheet.A_r);\n                            XlsxDimension.XlsxDim(a_r, out col, out row);\n                        }\n                        else if (_xmlReader.LocalName == XlsxWorksheet.N_v || _xmlReader.LocalName == XlsxWorksheet.N_t)\n                        {\n                            hasValue = true;\n                        }\n                    }\n\n                    if (_xmlReader.NodeType == XmlNodeType.Text && hasValue)\n                    {\n                    \tdouble number;\n                        object o = _xmlReader.Value;\n\n\t                    var style = NumberStyles.Any;\n\t\t\t\t\t\tvar culture = CultureInfo.InvariantCulture;\n                        \n                        if (double.TryParse(o.ToString(), style, culture, out number))\n                            o = number;\n                        \t\n                        if (null != a_t && a_t == XlsxWorksheet.A_s) //if string\n                        {\n                            o = Helpers.ConvertEscapeChars(_workbook.SST[int.Parse(o.ToString())]);\n                        } // Requested change 4: missing (it appears that if should be else if)\n                        else if (null != a_t && a_t == XlsxWorksheet.N_inlineStr) //if string inline\n                        {\n                            o = Helpers.ConvertEscapeChars(o.ToString());\n                        }\n                        else if (a_t == \"b\") //boolean\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\to = _xmlReader.Value == \"1\";\n\t\t\t\t\t\t}  \n                        else if (null != a_s) //if something else\n                        {\n                            XlsxXf xf = _workbook.Styles.CellXfs[int.Parse(a_s)];\n                            if (xf.ApplyNumberFormat && o != null && o.ToString() != string.Empty && IsDateTimeStyle(xf.NumFmtId))\n                                o = Helpers.ConvertFromOATime(number);\n                            else if (xf.NumFmtId == 49)\n                                o = o.ToString();\n                        }\n                                                \n\n\n                        if (col - 1 < _cellsValues.Length)\n                            _cellsValues[col - 1] = o;\n                    }\n                }\n\n\t\t\t\tif (_emptyRowCount > 0)\n\t\t\t\t{\n\t\t\t\t\t_savedCellsValues = _cellsValues;\n\t\t\t\t\treturn ReadSheetRow(sheet);\n\t\t\t\t}\n\t\t\t\t_depth++;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t_xmlReader.Close();\n\t\t\tif (_sheetStream != null) _sheetStream.Close();\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate bool InitializeSheetRead()\n\t\t{\n\t\t\tif (ResultsCount <= 0) return false;\n\n\t\t\tReadSheetGlobals(_workbook.Sheets[_resultIndex]);\n\n\t\t\tif (_workbook.Sheets[_resultIndex].Dimension == null) return false;\n\n\t\t\t_isFirstRead = false;\n\n\t\t\t_depth = 0;\n\t\t\t_emptyRowCount = 0;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate bool IsDateTimeStyle(int styleId)\n\t\t{\n\t\t\treturn _defaultDateTimeStyles.Contains(styleId);\n\t\t}\n\n\n\t\t#region IExcelDataReader Members\n\n\t\tpublic void Initialize(System.IO.Stream fileStream)\n\t\t{\n\t\t\t_zipWorker = new ZipWorker();\n\t\t\t_zipWorker.Extract(fileStream);\n\n\t\t\tif (!_zipWorker.IsValid)\n\t\t\t{\n\t\t\t\t_isValid = false;\n\t\t\t\t_exceptionMessage = _zipWorker.ExceptionMessage;\n\n\t\t\t\tClose();\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tReadGlobals();\n\t\t}\n\n\t\tpublic System.Data.DataSet AsDataSet()\n\t\t{\n\t\t\treturn AsDataSet(true);\n\t\t}\n\n\t\tpublic System.Data.DataSet AsDataSet(bool convertOADateTime)\n\t\t{\n\t\t\tif (!_isValid) return null;\n\n\t\t\tDataSet dataset = new DataSet();\n\n\t\t\tfor (int ind = 0; ind < _workbook.Sheets.Count; ind++)\n\t\t\t{\n\t\t\t\tDataTable table = new DataTable(_workbook.Sheets[ind].Name);\n\n\t\t\t\tReadSheetGlobals(_workbook.Sheets[ind]);\n\n\t\t\t\tif (_workbook.Sheets[ind].Dimension == null) continue;\n\n\t\t\t\t_depth = 0;\n\t\t\t\t_emptyRowCount = 0;\n\n\t\t\t\t//DataTable columns\n\t\t\t\tif (!_isFirstRowAsColumnNames)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < _workbook.Sheets[ind].ColumnsCount; i++)\n\t\t\t\t\t{\n                        table.Columns.Add(null, typeof(Object));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (ReadSheetRow(_workbook.Sheets[ind]))\n\t\t\t\t{\n\t\t\t\t\tfor (int index = 0; index < _cellsValues.Length; index++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (_cellsValues[index] != null && _cellsValues[index].ToString().Length > 0)\n\t\t\t\t\t\t\tHelpers.AddColumnHandleDuplicate(table, _cellsValues[index].ToString());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tHelpers.AddColumnHandleDuplicate(table, string.Concat(COLUMN, index));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse continue;\n                \n                table.BeginLoadData();\n\n\t\t\t\twhile (ReadSheetRow(_workbook.Sheets[ind]))\n\t\t\t\t{\n\t\t\t\t\ttable.Rows.Add(_cellsValues);\n\t\t\t\t}\n\n\t\t\t\tif (table.Rows.Count > 0)\n\t\t\t\t\tdataset.Tables.Add(table);\n                table.EndLoadData();\n\t\t\t}\n            dataset.AcceptChanges();\n\t\t    Helpers.FixDataTypes(dataset);\n\t\t\treturn dataset;\n\t\t}\n\n\t\tpublic bool IsFirstRowAsColumnNames\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _isFirstRowAsColumnNames;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\t_isFirstRowAsColumnNames = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsValid\n\t\t{\n\t\t\tget { return _isValid; }\n\t\t}\n\n\t\tpublic string ExceptionMessage\n\t\t{\n\t\t\tget { return _exceptionMessage; }\n\t\t}\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn (_resultIndex >= 0 && _resultIndex < ResultsCount) ? _workbook.Sheets[_resultIndex].Name : null;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Close()\n\t\t{\n\t\t\t_isClosed = true;\n\n\t\t\tif (_xmlReader != null) _xmlReader.Close();\n\n\t\t\tif (_sheetStream != null) _sheetStream.Close();\n\n\t\t\tif (_zipWorker != null) _zipWorker.Dispose();\n\t\t}\n\n\t\tpublic int Depth\n\t\t{\n\t\t\tget { return _depth; }\n\t\t}\n\n\t\tpublic int ResultsCount\n\t\t{\n\t\t\tget { return _workbook == null ? -1 : _workbook.Sheets.Count; }\n\t\t}\n\n\t\tpublic bool IsClosed\n\t\t{\n\t\t\tget { return _isClosed; }\n\t\t}\n\n\t\tpublic bool NextResult()\n\t\t{\n\t\t\tif (_resultIndex >= (this.ResultsCount - 1)) return false;\n\n\t\t\t_resultIndex++;\n\n\t\t\t_isFirstRead = true;\n\t\t    _savedCellsValues = null;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic bool Read()\n\t\t{\n\t\t\tif (!_isValid) return false;\n\n\t\t\tif (_isFirstRead && !InitializeSheetRead())\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn ReadSheetRow(_workbook.Sheets[_resultIndex]);\n\t\t}\n\n\t\tpublic int FieldCount\n\t\t{\n\t\t\tget { return (_resultIndex >= 0 && _resultIndex < ResultsCount) ? _workbook.Sheets[_resultIndex].ColumnsCount : -1; }\n\t\t}\n\n\t\tpublic bool GetBoolean(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return false;\n\n\t\t\treturn Boolean.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic DateTime GetDateTime(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return DateTime.MinValue;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn (DateTime)_cellsValues[i];\n\t\t\t}\n\t\t\tcatch (InvalidCastException)\n\t\t\t{\n\t\t\t\treturn DateTime.MinValue;\n\t\t\t}\n\n\t\t}\n\n\t\tpublic decimal GetDecimal(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return decimal.MinValue;\n\n\t\t\treturn decimal.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic double GetDouble(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return double.MinValue;\n\n\t\t\treturn double.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic float GetFloat(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return float.MinValue;\n\n\t\t\treturn float.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic short GetInt16(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return short.MinValue;\n\n\t\t\treturn short.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic int GetInt32(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return int.MinValue;\n\n\t\t\treturn int.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic long GetInt64(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return long.MinValue;\n\n\t\t\treturn long.Parse(_cellsValues[i].ToString());\n\t\t}\n\n\t\tpublic string GetString(int i)\n\t\t{\n\t\t\tif (IsDBNull(i)) return null;\n\n\t\t\treturn _cellsValues[i].ToString();\n\t\t}\n\n\t\tpublic object GetValue(int i)\n\t\t{\n\t\t\treturn _cellsValues[i];\n\t\t}\n\n\t\tpublic bool IsDBNull(int i)\n\t\t{\n\t\t\treturn (null == _cellsValues[i]) || (DBNull.Value == _cellsValues[i]);\n\t\t}\n\n\t\tpublic object this[int i]\n\t\t{\n\t\t\tget { return _cellsValues[i]; }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IDisposable Members\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDispose(true);\n\n\t\t\tGC.SuppressFinalize(this);\n\t\t}\n\n\t\tprivate void Dispose(bool disposing)\n\t\t{\n\t\t\t// Check to see if Dispose has already been called.\n\n\t\t\tif (!this.disposed)\n\t\t\t{\n\t\t\t\tif (disposing)\n\t\t\t\t{\n\t\t\t\t\tif (_xmlReader != null) ((IDisposable) _xmlReader).Dispose();\n\t\t\t\t\tif (_sheetStream != null) _sheetStream.Dispose();\n\t\t\t\t\tif (_zipWorker != null) _zipWorker.Dispose();\n\t\t\t\t}\n\n\t\t\t\t_zipWorker = null;\n\t\t\t\t_xmlReader = null;\n\t\t\t\t_sheetStream = null;\n\n\t\t\t\t_workbook = null;\n\t\t\t\t_cellsValues = null;\n\t\t\t\t_savedCellsValues = null;\n\n\t\t\t\tdisposed = true;\n\t\t\t}\n\t\t}\n\n\t\t~ExcelOpenXmlReader()\n\t\t{\n\t\t\tDispose(false);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region  Not Supported IDataReader Members\n\n\n\t\tpublic DataTable GetSchemaTable()\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic int RecordsAffected\n\t\t{\n\t\t\tget { throw new NotSupportedException(); }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Not Supported IDataRecord Members\n\n\n\t\tpublic byte GetByte(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic char GetChar(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic IDataReader GetData(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic string GetDataTypeName(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic Type GetFieldType(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic Guid GetGuid(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic string GetName(int i)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic int GetOrdinal(string name)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic int GetValues(object[] values)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic object this[string name]\n\t\t{\n\t\t\tget { throw new NotSupportedException(); }\n\t\t}\n\n\t\t#endregion\n\n\n\t}\n}\n"
  },
  {
    "path": "Excel/ExcelReaderFactory.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\n\nnamespace Excel\n{\n\t/// <summary>\n\t/// The ExcelReader Factory\n\t/// </summary>\n\tpublic static class ExcelReaderFactory\n\t{\n\n\t\t/// <summary>\n\t\t/// Creates an instance of <see cref=\"ExcelBinaryReader\"/>\n\t\t/// </summary>\n\t\t/// <param name=\"fileStream\">The file stream.</param>\n\t\t/// <returns></returns>\n\t\tpublic static IExcelDataReader CreateBinaryReader(Stream fileStream)\n\t\t{\n\t\t\tIExcelDataReader reader = new ExcelBinaryReader();\n\t\t\treader.Initialize(fileStream);\n\n\t\t\treturn reader;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates an instance of <see cref=\"ExcelBinaryReader\"/>\n\t\t/// </summary>\n\t\t/// <param name=\"fileStream\">The file stream.</param>\n\t\t/// <returns></returns>\n\t\tpublic static IExcelDataReader CreateBinaryReader(Stream fileStream, ReadOption option)\n\t\t{\n\t\t\tIExcelDataReader reader = new ExcelBinaryReader(option);\n\t\t\treader.Initialize(fileStream);\n\n\t\t\treturn reader;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates an instance of <see cref=\"ExcelBinaryReader\"/>\n\t\t/// </summary>\n\t\t/// <param name=\"fileStream\">The file stream.</param>\n\t\t/// <returns></returns>\n\t\tpublic static IExcelDataReader CreateBinaryReader(Stream fileStream, bool convertOADate)\n\t\t{\n\t\t\tIExcelDataReader reader = CreateBinaryReader(fileStream);\n\t\t\t((ExcelBinaryReader) reader).ConvertOaDate = convertOADate;\n\n\t\t\treturn reader;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates an instance of <see cref=\"ExcelBinaryReader\"/>\n\t\t/// </summary>\n\t\t/// <param name=\"fileStream\">The file stream.</param>\n\t\t/// <returns></returns>\n\t\tpublic static IExcelDataReader CreateBinaryReader(Stream fileStream, bool convertOADate, ReadOption readOption)\n\t\t{\n\t\t\tIExcelDataReader reader = CreateBinaryReader(fileStream, readOption);\n\t\t\t((ExcelBinaryReader)reader).ConvertOaDate = convertOADate;\n\n\t\t\treturn reader;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates an instance of <see cref=\"ExcelOpenXmlReader\"/>\n\t\t/// </summary>\n\t\t/// <param name=\"fileStream\">The file stream.</param>\n\t\t/// <returns></returns>\n\t\tpublic static IExcelDataReader CreateOpenXmlReader(Stream fileStream)\n\t\t{\n\t\t\tIExcelDataReader reader = new ExcelOpenXmlReader();\n\t\t\treader.Initialize(fileStream);\n\n\t\t\treturn reader;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Exceptions/BiffRecordException.cs",
    "content": "using System;\n\nnamespace Excel.Exceptions\n{\n\tpublic class BiffRecordException : Exception\n\t{\n\t\tpublic BiffRecordException()\n\t\t{\n\t\t}\n\n\t\tpublic BiffRecordException(string message)\n\t\t\t: base(message)\n\t\t{\n\t\t}\n\n\t\tpublic BiffRecordException(string message, Exception innerException)\n\t\t\t: base(message, innerException)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Exceptions/HeaderException.cs",
    "content": "using System;\n\nnamespace Excel.Exceptions\n{\n\tpublic class HeaderException : Exception\n\t{\n\t\tpublic HeaderException()\n\t\t{\n\t\t}\n\n\t\tpublic HeaderException(string message)\n\t\t\t: base(message)\n\t\t{\n\t\t}\n\n\t\tpublic HeaderException(string message, Exception innerException)\n\t\t\t: base(message, innerException)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Factory.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\n\nnamespace Excel\n{\n\tpublic static class Factory\n\t{\n\t\tpublic static IExcelDataReader CreateReader(Stream fileStream, ExcelFileType excelFileType)\n\t\t{\n\t\t\tIExcelDataReader reader = null;\n\n\t\t\tswitch (excelFileType)\n\t\t\t{\n\t\t\t\tcase ExcelFileType.Binary:\n\t\t\t\t\treader = new ExcelBinaryReader();\n\t\t\t\t\treader.Initialize(fileStream);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ExcelFileType.OpenXml:\n\t\t\t\t\treader = new ExcelOpenXmlReader();\n\t\t\t\t\treader.Initialize(fileStream);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn reader;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "Excel/IExcelDataReader.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Data;\nusing System.IO;\n\nnamespace Excel\n{\n\tpublic interface IExcelDataReader : IDataReader\n\t{\n\t\t/// <summary>\n\t\t/// Initializes the instance with specified file stream.\n\t\t/// </summary>\n\t\t/// <param name=\"fileStream\">The file stream.</param>\n\t\tvoid Initialize(Stream fileStream);\n\n\t\t/// <summary>\n\t\t/// Read all data in to DataSet and return it\n\t\t/// </summary>\n\t\t/// <returns>The DataSet</returns>\n\t\tDataSet AsDataSet();\n\n\t\t/// <summary>\n\t\t///Read all data in to DataSet and return it\n\t\t/// </summary>\n\t\t/// <param name=\"convertOADateTime\">if set to <c>true</c> [try auto convert OA date time format].</param>\n\t\t/// <returns>The DataSet</returns>\n\t\tDataSet AsDataSet(bool convertOADateTime);\n\n\t\t/// <summary>\n\t\t/// Gets a value indicating whether file stream is valid.\n\t\t/// </summary>\n\t\t/// <value><c>true</c> if file stream is valid; otherwise, <c>false</c>.</value>\n\t\tbool IsValid { get;}\n\n\t\t/// <summary>\n\t\t/// Gets the exception message in case of error.\n\t\t/// </summary>\n\t\t/// <value>The exception message.</value>\n\t\tstring ExceptionMessage { get;}\n\n\t\t/// <summary>\n\t\t/// Gets the sheet name.\n\t\t/// </summary>\n\t\t/// <value>The sheet name.</value>\n\t\tstring Name { get;}\n\n\t\t/// <summary>\n\t\t/// Gets the number of results (workbooks).\n\t\t/// </summary>\n\t\t/// <value>The results count.</value>\n\t\tint ResultsCount { get;}\n\n\t\t/// <summary>\n\t\t/// Gets or sets a value indicating whether the first row contains the column names.\n\t\t/// </summary>\n\t\t/// <value>\n\t\t/// \t<c>true</c> if the first row contains column names; otherwise, <c>false</c>.\n\t\t/// </value>\n\t\tbool IsFirstRowAsColumnNames { get;set;}\n\n\t}\n}"
  },
  {
    "path": "Excel/Log/ILog-4.5.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Excel.Log\n{\n\t/// <summary>\n\t/// Custom interface for logging messages\n\t/// </summary>\n\tpublic partial interface ILog\n\t{\n\t\t/// <summary>\n\t\t/// Debug level of the specified message.\n\t\t/// </summary>\n\t\t/// <param name=\"message\">The message.</param>\n\t\tvoid Debug(Func<string> message);\n\n\t\t/// <summary>\n\t\t/// Info level of the specified message.\n\t\t/// </summary>\n\t\t/// <param name=\"message\">The message.</param>\n\t\tvoid Info(Func<string> message);\n\n\t\t/// <summary>\n\t\t/// Warn level of the specified message.\n\t\t/// </summary>\n\t\t/// <param name=\"message\">The message.</param>\n\t\tvoid Warn(Func<string> message);\n\n\t\t/// <summary>\n\t\t/// Error level of the specified message.\n\t\t/// </summary>\n\t\t/// <param name=\"message\">The message.</param>\n\t\tvoid Error(Func<string> message);\n\n\t\t/// <summary>\n\t\t/// Fatal level of the specified message.\n\t\t/// </summary>\n\t\t/// <param name=\"message\">The message.</param>\n\t\tvoid Fatal(Func<string> message);\n\t}\n\n\n}\n"
  },
  {
    "path": "Excel/Log/ILog.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Log\n{\n/// <summary>\n/// Custom interface for logging messages\n/// </summary>\npublic partial interface ILog\n{\n    /// <summary>\n    /// Initializes the instance for the logger name\n    /// </summary>\n    /// <param name=\"loggerName\">Name of the logger</param>\n    void InitializeFor(string loggerName);\n    \n    /// <summary>\n    /// Debug level of the specified message. The other method is preferred since the execution is deferred.\n    /// </summary>\n    /// <param name=\"message\">The message.</param>\n    /// <param name=\"formatting\">The formatting.</param>\n    void Debug(string message, params object[] formatting);\n\n    /// <summary>\n    /// Info level of the specified message. The other method is preferred since the execution is deferred.\n    /// </summary>\n    /// <param name=\"message\">The message.</param>\n    /// <param name=\"formatting\">The formatting.</param>\n    void Info(string message, params object[] formatting);\n\n    /// <summary>\n    /// Warn level of the specified message. The other method is preferred since the execution is deferred.\n    /// </summary>\n    /// <param name=\"message\">The message.</param>\n    /// <param name=\"formatting\">The formatting.</param>\n    void Warn(string message, params object[] formatting);\n\n    /// <summary>\n    /// Error level of the specified message. The other method is preferred since the execution is deferred.\n    /// </summary>\n    /// <param name=\"message\">The message.</param>\n    /// <param name=\"formatting\">The formatting.</param>\n    void Error(string message, params object[] formatting);\n\n    /// <summary>\n    /// Fatal level of the specified message. The other method is preferred since the execution is deferred.\n    /// </summary>\n    /// <param name=\"message\">The message.</param>\n    /// <param name=\"formatting\">The formatting.</param>\n    void Fatal(string message, params object[] formatting);\n\n}\n\n/// <summary>\n/// Ensures a default constructor for the logger type\n/// </summary>\n/// <typeparam name=\"T\"></typeparam>\npublic interface ILog<T> where T : new()\n{\n}\n\n}\n\n"
  },
  {
    "path": "Excel/Log/Log.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Excel.Log.Logger;\n\nnamespace Excel.Log\n{\n\t/// <summary>\n\t/// Logger type initialization\n\t/// </summary>\n\tpublic static partial class Log\n\t{\n\t\tprivate static Type _logType = typeof(NullLog);\n\t\tprivate static ILog _logger;\n\n\t\t/// <summary>\n\t\t/// Sets up logging to be with a certain type\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\">The type of ILog for the application to use</typeparam>\n\t\tpublic static void InitializeWith<T>() where T : ILog, new()\n\t\t{\n\t\t\t_logType = typeof(T);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Sets up logging to be with a certain instance. The other method is preferred.\n\t\t/// </summary>\n\t\t/// <param name=\"loggerType\">Type of the logger.</param>\n\t\t/// <remarks>This is mostly geared towards testing</remarks>\n\t\tpublic static void InitializeWith(ILog loggerType)\n\t\t{\n\t\t\t_logType = loggerType.GetType();\n\t\t\t_logger = loggerType;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of a logger for an object.\n\t\t/// This should be done only once per object name.\n\t\t/// </summary>\n\t\t/// <param name=\"objectName\">Name of the object.</param>\n\t\t/// <returns>ILog instance for an object if log type has been intialized; otherwise null</returns>\n\t\tpublic static ILog GetLoggerFor(string objectName)\n\t\t{\n\t\t\tvar logger = _logger;\n\n\t\t\tif (_logger == null)\n\t\t\t{\n\t\t\t\tlogger = Activator.CreateInstance(_logType) as ILog;\n\t\t\t\tif (logger != null)\n\t\t\t\t{\n\t\t\t\t\tlogger.InitializeFor(objectName);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn logger;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Log/LogExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Log\n{\n\t/// <summary>\n\t/// Extensions to help make logging awesome\n\t/// </summary>\n\tpublic static class LogExtensions\n\t{\n\t\t/// <summary>\n\t\t/// Concurrent dictionary that ensures only one instance of a logger for a type.\n\t\t/// </summary>\n\t\tprivate static readonly Lazy<ConcurrentDictionary<string, ILog>> _dictionary = new Lazy<ConcurrentDictionary<string, ILog>>(() => new ConcurrentDictionary<string, ILog>());\n\n\t\t/// <summary>\n\t\t/// Gets the logger for <see cref=\"T\"/>.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\"></typeparam>\n\t\t/// <param name=\"type\">The type to get the logger for.</param>\n\t\t/// <returns>Instance of a logger for the object.</returns>\n\t\tpublic static ILog Log<T>(this T type)\n\t\t{\n\t\t\tstring objectName = typeof(T).FullName;\n\t\t\treturn Log(objectName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the logger for the specified object name.\n\t\t/// </summary>\n\t\t/// <param name=\"objectName\">Either use the fully qualified object name or the short. If used with Log&lt;T&gt;() you must use the fully qualified object name\"/></param>\n\t\t/// <returns>Instance of a logger for the object.</returns>\n\t\tpublic static ILog Log(this string objectName)\n\t\t{\n\t\t\treturn _dictionary.Value.GetOrAdd(objectName, Excel.Log.Log.GetLoggerFor);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Log/LogManager.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Excel.Log\n{\n\t/// <summary>\n\t/// 2.0 version of LogExtensions, not as awesome as Extension methods\n\t/// </summary>\n\tpublic static class LogManager\n\t{\n\t\t/// <summary>\n\t\t/// Concurrent dictionary that ensures only one instance of a logger for a type.\n\t\t/// </summary>\n\t\tprivate static readonly Dictionary<string, ILog> _dictionary = new Dictionary<string, ILog>();\n\n\t\tprivate static object _sync = new Object();\n\n\t\t/// <summary>\n\t\t/// Gets the logger for <see cref=\"T\"/>.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\"></typeparam>\n\t\t/// <param name=\"type\">The type to get the logger for.</param>\n\t\t/// <returns>Instance of a logger for the object.</returns>\n\t\tpublic static ILog Log<T>(T type)\n\t\t{\n\t\t\tstring objectName = typeof(T).FullName;\n\t\t\treturn Log(objectName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the logger for the specified object name.\n\t\t/// </summary>\n\t\t/// <param name=\"objectName\">Either use the fully qualified object name or the short. If used with Log&lt;T&gt;() you must use the fully qualified object name\"/></param>\n\t\t/// <returns>Instance of a logger for the object.</returns>\n\t\tpublic static ILog Log(string objectName)\n\t\t{\n\t\t\tILog result = null;\n\n\t\t\tif (_dictionary.ContainsKey(objectName))\n\t\t\t\tresult = _dictionary[objectName];\n\n\t\t\tif (result == null)\n\t\t\t{\n\t\t\t\tlock (_sync)\n\t\t\t\t{\n\t\t\t\t\tresult = Excel.Log.Log.GetLoggerFor(objectName);\n\t\t\t\t\t_dictionary.Add(objectName, result);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Excel/Log/Logger/NullLog-4.5.cs",
    "content": "﻿using System;\n\nnamespace Excel.Log.Logger\n{\n\t/// <summary>\n\t/// The default logger until one is set.\n\t/// </summary>\n\tpublic partial class NullLog : ILog, ILog<NullLog>\n\t{\n\t\tpublic void Debug(Func<string> message)\n\t\t{\n\t\t}\n\n\t\tpublic void Info(Func<string> message)\n\t\t{\n\t\t}\n\n\t\tpublic void Warn(Func<string> message)\n\t\t{\n\t\t}\n\n\t\tpublic void Error(Func<string> message)\n\t\t{\n\t\t}\n\n\t\tpublic void Fatal(Func<string> message)\n\t\t{\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "Excel/Log/Logger/NullLog.cs",
    "content": "﻿using System;\n\nnamespace Excel.Log.Logger\n{\n\t/// <summary>\n\t/// The default logger until one is set.\n\t/// </summary>\n\tpublic partial class NullLog : ILog, ILog<NullLog>\n\t{\n\t\tpublic void InitializeFor(string loggerName)\n\t\t{\n\t\t}\n\n\t\tpublic void Debug(string message, params object[] formatting)\n\t\t{\n\t\t}\n\n\t\tpublic void Info(string message, params object[] formatting)\n\t\t{\n\t\t}\n\n\t\tpublic void Warn(string message, params object[] formatting)\n\t\t{\n\t\t}\n\n\t\tpublic void Error(string message, params object[] formatting)\n\t\t{\n\t\t}\n\n\t\tpublic void Fatal(string message, params object[] formatting)\n\t\t{\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "Excel/Log/StringExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Excel.Log\n{\n\tpublic static class StringExtensions\n\t{\n\t\t/// <summary>\n\t\t/// Formats string with the formatting passed in. This is a shortcut to string.Format().\n\t\t/// </summary>\n\t\t/// <param name=\"input\">The input.</param>\n\t\t/// <param name=\"formatting\">The formatting.</param>\n\t\t/// <returns>A formatted string.</returns>\n\t\tpublic static string FormatWith(this string input, params object[] formatting)\n\t\t{\n\t\t\treturn string.Format(input, formatting);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "Excel/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System;\nusing System.Runtime.InteropServices;\n\n[assembly: AssemblyTitle(\"ExcelDataReader\")]\n[assembly: AssemblyDescription(\"Excel data reader for .Net\")]\n[assembly: AssemblyProduct(\"ExcelDataReader\")]\n[assembly: AssemblyVersion(\"2.1.2.2\")]\n\n[assembly: ComVisible(false)]\n\n[assembly: Guid(\"e0bcbc74-51d2-48a3-bddb-b0b407516397\")]\n\n[assembly: CLSCompliant(true)]"
  },
  {
    "path": "Excel/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"SharpZipLib\" version=\"0.86.0\" targetFramework=\"net20\" />\n</packages>"
  },
  {
    "path": "Lemma/.gitignore",
    "content": "\n*.cachefile\nbin\nobj\n*.user"
  },
  {
    "path": "Lemma/AdapterSelectorForm.Designer.cs",
    "content": "﻿namespace Lemma\n{\n\tpartial class AdapterSelectorForm\n\t{\n\t\t/// <summary>\n\t\t/// Required designer variable.\n\t\t/// </summary>\n\t\tprivate System.ComponentModel.IContainer components = null;\n\n\t\t/// <summary>\n\t\t/// Clean up any resources being used.\n\t\t/// </summary>\n\t\t/// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n\t\tprotected override void Dispose(bool disposing)\n\t\t{\n\t\t\tif (disposing && (components != null))\n\t\t\t{\n\t\t\t\tcomponents.Dispose();\n\t\t\t}\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\n\t\t#region Windows Form Designer generated code\n\n\t\t/// <summary>\n\t\t/// Required method for Designer support - do not modify\n\t\t/// the contents of this method with the code editor.\n\t\t/// </summary>\n\t\tprivate void InitializeComponent()\n\t\t{\n\t\t\tSystem.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdapterSelectorForm));\n\t\t\tthis.label1 = new System.Windows.Forms.Label();\n\t\t\tthis.button1 = new System.Windows.Forms.Button();\n\t\t\tthis.checkBox1 = new System.Windows.Forms.CheckBox();\n\t\t\tthis.comboBox1 = new System.Windows.Forms.ComboBox();\n\t\t\tthis.SuspendLayout();\n\t\t\t// \n\t\t\t// label1\n\t\t\t// \n\t\t\tthis.label1.AutoSize = true;\n\t\t\tthis.label1.Location = new System.Drawing.Point(13, 13);\n\t\t\tthis.label1.Name = \"label1\";\n\t\t\tthis.label1.Size = new System.Drawing.Size(45, 13);\n\t\t\tthis.label1.TabIndex = 0;\n\t\t\tthis.label1.Text = \"Monitor:\";\n\t\t\t// \n\t\t\t// button1\n\t\t\t// \n\t\t\tthis.button1.Location = new System.Drawing.Point(193, 8);\n\t\t\tthis.button1.Name = \"button1\";\n\t\t\tthis.button1.Size = new System.Drawing.Size(79, 23);\n\t\t\tthis.button1.TabIndex = 2;\n\t\t\tthis.button1.Text = \"Play\";\n\t\t\tthis.button1.UseVisualStyleBackColor = true;\n\t\t\tthis.button1.Click += new System.EventHandler(this.button1_Click);\n\t\t\t// \n\t\t\t// checkBox1\n\t\t\t// \n\t\t\tthis.checkBox1.AutoSize = true;\n\t\t\tthis.checkBox1.Location = new System.Drawing.Point(122, 12);\n\t\t\tthis.checkBox1.Name = \"checkBox1\";\n\t\t\tthis.checkBox1.Size = new System.Drawing.Size(41, 17);\n\t\t\tthis.checkBox1.TabIndex = 3;\n\t\t\tthis.checkBox1.Text = \"VR\";\n\t\t\tthis.checkBox1.UseVisualStyleBackColor = true;\n\t\t\t// \n\t\t\t// comboBox1\n\t\t\t// \n\t\t\tthis.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\n\t\t\tthis.comboBox1.FormattingEnabled = true;\n\t\t\tthis.comboBox1.Location = new System.Drawing.Point(64, 10);\n\t\t\tthis.comboBox1.Name = \"comboBox1\";\n\t\t\tthis.comboBox1.Size = new System.Drawing.Size(52, 21);\n\t\t\tthis.comboBox1.TabIndex = 4;\n\t\t\t// \n\t\t\t// AdapterSelectorForm\n\t\t\t// \n\t\t\tthis.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n\t\t\tthis.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n\t\t\tthis.ClientSize = new System.Drawing.Size(284, 41);\n\t\t\tthis.Controls.Add(this.comboBox1);\n\t\t\tthis.Controls.Add(this.checkBox1);\n\t\t\tthis.Controls.Add(this.button1);\n\t\t\tthis.Controls.Add(this.label1);\n\t\t\tthis.Icon = ((System.Drawing.Icon)(resources.GetObject(\"$this.Icon\")));\n\t\t\tthis.MaximumSize = new System.Drawing.Size(300, 80);\n\t\t\tthis.MinimumSize = new System.Drawing.Size(300, 80);\n\t\t\tthis.Name = \"AdapterSelectorForm\";\n\t\t\tthis.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;\n\t\t\tthis.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\n\t\t\tthis.Text = \"Lemma\";\n\t\t\tthis.Load += new System.EventHandler(this.AdapterSelectorForm_Load);\n\t\t\tthis.ResumeLayout(false);\n\t\t\tthis.PerformLayout();\n\n\t\t}\n\n\t\t#endregion\n\n\t\tprivate System.Windows.Forms.Label label1;\n\t\tprivate System.Windows.Forms.Button button1;\n\t\tprivate System.Windows.Forms.CheckBox checkBox1;\n\t\tprivate System.Windows.Forms.ComboBox comboBox1;\n\t}\n}"
  },
  {
    "path": "Lemma/AdapterSelectorForm.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\nusing System.Windows.Forms;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma\n{\n\tpublic partial class AdapterSelectorForm : Form\n\t{\n\t\tpublic bool VR;\n\t\tpublic int Monitor;\n\t\tpublic bool Go;\n\t\tpublic AdapterSelectorForm(bool vr)\n\t\t{\n\t\t\tInitializeComponent();\n\t\t\tthis.VR = vr;\n\t\t}\n\n\t\tprivate class Entry\n\t\t{\n\t\t\tpublic int ID { get; set; }\n\t\t\tpublic string Display { get; set; }\n\t\t}\n\n\t\tprivate void AdapterSelectorForm_Load(object sender, EventArgs e)\n\t\t{\n\t\t\tthis.checkBox1.Checked = this.VR;\n\t\t\tthis.comboBox1.ValueMember = \"ID\";\n\t\t\tthis.comboBox1.DisplayMember = \"Display\";\n\t\t\tint selected = 0;\n\t\t\tfor (int i = 0; i < GraphicsAdapter.Adapters.Count; i++)\n\t\t\t{\n\t\t\t\tthis.comboBox1.Items.Add(new Entry { ID = i, Display = (i + 1).ToString() });\n\t\t\t\tif (GraphicsAdapter.Adapters[i] == GraphicsAdapter.DefaultAdapter)\n\t\t\t\t\tselected = i;\n\t\t\t}\n\t\t\tthis.comboBox1.SelectedIndex = selected;\n\t\t}\n\n\t\tprivate void button1_Click(object sender, EventArgs e)\n\t\t{\n\t\t\tthis.VR = this.checkBox1.Checked;\n\t\t\tthis.Monitor = this.comboBox1.SelectedIndex;\n\t\t\tthis.Go = true;\n\t\t\tthis.Close();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/AdapterSelectorForm.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"$this.Locked\" type=\"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>True</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"$this.Icon\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        AAABAAEAgIAAAAEAGAAoyAAAFgAAACgAAACAAAAAAAEAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP\n        DQcPDQcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS9oVS9oVQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1u+olQIBwQA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAIBwS+olTNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vMrVfKq1LTuG7Zw4XGr28IBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLq1Pcx4zx6dH////////////+/v7CqWII\n        BwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNrlrMrVfi0J/7\n        +fL////////////////////////axYm+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vMrlnn2bH///3////////////////////////////////StmnNr1u+olQIBwQAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFXi0J7+/fv/////////////////////////////\n        ///////y69XLrVbNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFTcyI77+fL/////\n        ///////////////////////////////////////Qs2PNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vQtGX1797////////////////////////////////////////////////ey5PNr1vNr1vN\n        r1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+\n        olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLq1Pfy5X/////////////////////////////////////\n        ///////////////r3rzLrFXNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vKq1Pcx4v38+f/////////\n        ///////////////////////////////////////////eypPMrVbNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vN\n        r1vMrlneypL69u3////////////////////////////////////////////////////8+/bTuW7Nr1rN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI\n        BwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vYwYD/////////////////////////////////////////\n        ///////////////////t4cLMrljNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+\n        olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vj0aL/////////\n        ///////////////////////////////////////////////////Vu3TNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vLq1P28OD////////////////////////////////////////////////////1\n        7t3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVbn2bD/////////////////////////\n        ///////////////////////////////q3bjNrlrNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFbaw4T8\n        +vT////////////////////////////////////////////////////////////UunLNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vLrFXw587/////////////////////////////////////////////////////\n        ///////////+/fvTuXDNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrlnl1ar/////////////////////////\n        ///////////////////////////////////////////////gzprNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCAS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vU\n        u3P////////////////////////////////////////////////////////////////////////////h\n        z53Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1u+olQJCAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABdUCnTtF7Nr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vMrlju5Mj/////////////////////////////////////////////\n        ///////////////////////////////l1qrNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF5dUCkAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVbz69f/////////////\n        ///////////////////////////////////////////////////////////////r373MrlnNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0A\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vN\n        r1vNr1vNr1vNr1rfzJf/////////////////////////////////////////////////////////////\n        ///////////////38uPLrFXNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vMrlnXv337+PD/////////////////////\n        ///////////////////////////////////////////////////Ps2PNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAMCgUsJhMAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vLrFXq3bn/////////////////////////////////////////////////////////////////\n        ///o2rLNrlrNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5k\n        Vi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAsJhMMCgUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS9olTQsVwmIREAAAAAAAAAAAAAAAAAAAAA\n        AAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFbj06T/////////////////////////////\n        ///////////////////////////////////////PsmHNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQsVy9olQIBwQAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTN\n        r1vNr1vQslwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        rlrOsF3j06X////////////////////////////////////////////////////////////u5MfMrVbN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAmIRHQslzNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABk\n        Vi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1veypP/////////////////////////////////////\n        ///////////////////////////Zw4TNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vU\n        tV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vQ\n        slwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFTx6dH/\n        ///////////////////////////////////////////////////////////9+/fMrlnNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzNr1vNr1vN\n        r1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+\n        olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7N\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1r8+vT/////////////////////////////////////////////\n        ///////////////t4sPMrVbNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vQslwmIREA\n        AAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vVu3P/////////////\n        ///////////////////////////////////////////////////dyI7Nr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vN\n        r1vNr1vNr1vNr1vNrlri0J//////////////////////////////////////////////////////////\n        ///////RtWjNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI\n        BwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAA\n        AAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1rLq1Px6ND/////////////////////\n        ///////////////////////////////////////49OnLrFTNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+\n        olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABjVSvSs1vKq1LTuW/hz5zn167o\n        27Xq3rrq3bn////////////////////////////////////////////////////////////////69/DW\n        vXfMrljUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAAAAAhISFS\n        UlJycnKEhYjb1L39/Pj/////////////////////////////////////////////////////////////\n        ///////////////////////////////////s3rdeUCYAAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vLrFXTt2h8e3jDw8P/////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////////l5eYsLCwA\n        AAAAAAAAAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFTcxor1797/////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////+Ojo4AAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrljWvXj49On/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////o6OgvLy8kHgzQ\n        slzNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vLrFTn2bH/////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////t48TOsF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFXw6ND/////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        /////////////////////////////////////////////////////////////////v7gzZnLrFTNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrlno2rP/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////8+/bj06PMrlnNr1rNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vRtWf/////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////l1anMrFbNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1rn2bD/////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////38uXQs2TNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVjv5sz/\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////8+/bNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQI\n        BwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vMrVfy6tT/////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////n2LDNr1rNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVbz69b/////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////1793LrFbNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vLrFb1793/////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////////////////1\n        797LrFbNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrVb07dr/////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////t4sTMrlnNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrlju48b/\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////WvnrNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+\n        olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vgzpr/////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////8+vXfy5TMrljNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vRtGb/////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////9+/fXv3zPs2PKq1LNr1rNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALCgW9olTNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vLrFb07dr/////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////Ps2PNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u9olQLCgUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAA1LRfStF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vdyY//////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////TuW/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vStF01\n        LRcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vL\n        q1T8+/b/////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////OsF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXT\n        tF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vi0aD/////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////////////v5crM\n        rVfNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFb49On/////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////m2K7MrVfNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vT\n        tF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vRtWf+/fz/////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////29vbGxsbn5+f+/v7/\n        ///////////////////////////////49Ojy6dPv5svq3rzfzJbNr1zNrlrNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTuW/9/Pn/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////+5ubkPDw8AAAAAAAALDAxvZEbfx4TdyY/fzJjVvXfLrFbLrFTMrVfMrVjNrlnN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vPsmL18OD/////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////Ozs6Pj485OTkAAABkVi3U\n        tV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFXXv3v+/fv/////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////Ozs4FBghlVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vPsmH28eP/////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////6+voFBgllVi3UtV7Nr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vfzZj/////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////c3NwAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFT6\n        9+//////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////////////////////////+VlZUAAABkVi3UtV7Nr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAw\n        KRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vMrVbz7Nf/////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////8dHR0AAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFbTuG7j0aHy5sXR\n        0M7/////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////////////+8vLwAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3N\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vUtV5kVSoAAAANDQ16enro6Oj/////////////////////////////////\n        //////////////////////////////////////////////////////////////////////////8YGBgA\n        AAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAABA\n        QEDb29v/////////////////////////////////////////////////////////////////////////\n        //////////////////////////+Xl5cAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vU\n        tV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmHwru4bz/////////////////////////////////////\n        //////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAABk\n        Vi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3LrVb7+PH/\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////9WVlYAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1rNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAwKRXTtF3Nr1vNr1vXv3v/////////////////////////////////////////////////\n        ///////////////////////////////////////////////FxcUAAAAAAAAAAAAAAAAAAABkVi3UtV7N\n        r1vMrFbbxoro2rPaxYfLrFTMrlnNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vLrFby6tP/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //8aGhoAAAAAAAAAAAAAAAAAAABkVi3Sslnq3rz////////////y69Xp3LbSuG3MrlnKqlLNrlrNr1vN\n        r1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vN\n        r1vNr1vNr1vNr1vUu3T/////////////////////////////////////////////////////////////\n        //////////////////////////////////+Xl5cAAAAAAAAAAAAAAAAAAAAAAACPhmz/////////////\n        ///////////////o2rT////bxYjNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vMrVby6dL/////////////////////////\n        //////////////////////////////////////////////////////////////////////8FBQUAAAAA\n        AAAAAAAAAAAUFBT////////////////////////////////////////z7NjLrVbNr1vNr1vNr1vTtF0w\n        KRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vUunH/////////////////////////////////////////////////////////////////////////\n        //////////////////////+FhIMAAAAAAAAAAAAAAADi4uL/////////////////////////////////\n        ///////////Qs2PNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXT\n        tF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3N\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVjt4sP/////////////////////////////////////\n        ///////////////////////////////////////////////////////////////b29vLy8v39/f/////\n        ///////////////////////////////////////////v5MjLrFTTtF4wKRUAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vPsmD/////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////////////////z\n        6c5NRTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vN\n        r1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1rhzpv/////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////////////96enoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXT\n        tF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFTz7Nj/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////////////////////////////////////////////////9ubm4A\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3UtV5kVi0AAAAA\n        AAB+fn7Ly8uZmZmJiYlFRkYsJA3TtF7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vPsmH/////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////8fHx8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAzLBdnWC4AAAAAAAAAAAAkJCTY2Nj////+/v7////99+fStmrNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vMrlnMrljMrlnMrlnNr1vNr1vNr1vLrFXm2K7/////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////Hx8cAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnJyf/\n        ///////////+/frPsmHMrVfMrVfLrFXKqlLPsWDXv3zfzZjl1qvr3rzu5Mft4sPs4L/k1KfaxIbbxovz\n        7Nj/////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////8uLi4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAC9vb3////////////u7u7n5+f////////////////////x6NDw58318OD+/v3/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////////////////////////9oaGgAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABNTU2YmJjT09P+/v7/////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //+GhoYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACFhYX/////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////69+/cyI759ev/////////////////////////////////////////////\n        //////////////////////////////////+GhoYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAACSkpL/////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////l1ajLrFXNr1vLrFX59er/////////\n        //////////////////////////////////////////////////////////////////95eXkAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATExP/////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////////////x6dHQ\n        tGbNrlrNr1vNr1vNr1vZwoL/////////////////////////////////////////////////////////\n        //////////////////9UVFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AADp6en////////////////////////////49Ojx6NDq3bnn2bHl1qvk06Xi0Z/q3rr179//////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////48+fYwX/LrFbNr1vNr1vNr1vNr1vNr1vLq1P48+f/////////////////////\n        //////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEAAAAAAAAKCgoVFRUhISESEhIAAAA5LhLTs1jMrVfNrlrN\n        r1vNr1vNr1vNr1vNrlrLrFXKq1LSt2vVu3TWvnnTuG/t48X/////////////////////////////////\n        ///////////////////////////////z7Njq3bnl1argzprXwH3Lq1PNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vgzZj///////////////////////////////////////////////////////////////////+f\n        n58AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVbZwoL8+vX/////\n        ///////////////////////////////////////////////////////+/fvj0aLLrFTNrlrNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1r/////////////////////////////////////\n        //////////////////////////////8JCQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vOsF3u5Mj////////////////////////////////////////////////////////////6\n        9+7gzZnLrFXNr1rNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vRsVna187/\n        //////////////////////////////////////////////////////////9paWkAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vMrVfaxYj+/vz/////////////////////////////////\n        ///////////////////////w5szZwoLLq1PNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vVtl88MxtNTU7/////////////////////////////////////////////////\n        //////+7u7sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vMrVjs4L//////////\n        ///////////////////////////////////7+fLu5Mj////u5MfRtWfMrVfNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vVtl88MxsAAAAAAACpqan/////////////\n        ///////////////////////////////////KysoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAA7MhrPr1XZw4P7+fL////////////////////////////////////////z69fZwoLKq1PMrVfTuW/M\n        rVjNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vVtl88\n        MxsAAAAAAAAAAAAAAADJycn///////////////////////////////////////91dXUAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBwd3eHju7u7/////////////////////////////////////\n        ///48+fYwH/LrFXNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vVtl88MxsAAAAAAAAAAAAAAAAAAAAwMDD/////////////////////////\n        //////+6uroWFhYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Nzeurq7/////////////////\n        ///////////////////////////8+vTdypHLq1TNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vVtl88MxsAAAAAAAAAAAAAAAAAAABf\n        X1/////////////////////////8/Pybm5stLS0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABY\n        WFjk5OT//////////////////////////////////////////////v3i0qLLrFXNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vV\n        tl88MxsAAAAAAAAAAAB4eHjg4OD///////////////////////////+pqakAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAABTU1Pm5ub////////////////////////////////////////////////p\n        3LfNr1rNr1rNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vVtl88MxsAAAAAAAAbGxu7u7v/////////////////////////////\n        //////8ICAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAuLi7Z2dn/////////////////////////\n        ///////////////////////GxsXZvG7MrlnNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vVtl88MxsAAAAdHR2urq7/////\n        //////////////////////////////////90dHQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALCwusrKz/\n        ///////////////////////////////////////////////u7u5ISEgAAAA8MxvVtl/Nr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vQsFg/Nh5dXV7FxcX////////////////////////////////5+fnc3NywsLBdXV0AAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAABTU1P////////////////////////////////////////////////8/PxwcHAA\n        AAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vMrlnKq1PRtGbgz5vm4NH///////////////////////////////////+enp4x\n        MTEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwsLD/////////////////////////////\n        //////////////////+CgoIAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNrlrMrVjLrFbKqlLQs2PdyZDs4MD7+PD/////////////////////\n        ///////////////w8PBoaGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6Ojr09PT/\n        //////////////////////////////////////////+VlZUGBgYAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrljk1Kfv5sv07tz+/vz/////\n        ///////////////////////////////////////l5eVbW1sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAANDQ2ysrL///////////////////////////////////////////+MjIwLCwsAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vLrFT49er////////////////////////////////////////////////Z2dlNTU0AAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB7e3v/////////////////////////////////\n        ///////39/d3d3cAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8\n        MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vKq1P07tz/////////////////////////////////\n        ///////Jyck/Pz8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcHBxqamq1tbXPz8/CwsJfX182NjaPj4//////////\n        ///////////////////////////////MzMxgYGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vLrFXq3rr/////\n        //////////////////////////////+rq6smJiYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDAysrKz/////////\n        ///////////////////////////////////////////////////h4eF4eHgREREAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/N\n        r1vNr1vNr1vNr1vNrlnn2K/r3rvfy5XdyY/y6dP///////////////+Ojo4ODg4AAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAMDAyJiYn///////////////////////////////////////////////////////////+0tLQ1\n        NTUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vLrFXNrlrNr1vNr1vTsliVkYjDw8Nf\n        X18AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB5eXn////////u7u6AgIDQ0ND/////////////////////\n        ///////////////+/v6MjIwQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vN\n        r1vNr1vNr1vNr1vVtl88MxsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXFxdtbW05OTkA\n        AAAgICD////////////////////////////////y8vJkZGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vVtl88MxsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABqamr///////////////////////////////+AgIAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vVtl88MxsA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABhYWHs7Oz/////////////////\n        //////////+tra0ODg4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAA8MxvVtl/Vtl88MxsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB2\n        dnb39/f///////////////////////////+mpqYcHBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBOB1BOB0AAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAHBwft7e3///////////////////////////+WlpYQEBAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcHBz////////////////////t\n        7e13d3cFBQUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAD////////////5+fmwsLBCQkIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVFRViYmIfHx8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\n</value>\n  </data>\n</root>"
  },
  {
    "path": "Lemma/ComponentInterfaces.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma\n{\n\tpublic interface IDrawableComponent : IGraphicsComponent\n\t{\n\t\tProperty<string> OrderKey { get; }\n\t\tvoid Draw(GameTime time, RenderParameters parameters);\n\t\tbool IsVisible(BoundingFrustum frustum);\n\t\tfloat GetDistance(Vector3 camera);\n\t}\n\n\tpublic interface IDrawableAlphaComponent : IGraphicsComponent\n\t{\n\t\tvoid DrawAlpha(GameTime time, RenderParameters parameters);\n\t\tProperty<int> DrawOrder { get; }\n\t}\n\n\tpublic interface IDrawablePostAlphaComponent : IGraphicsComponent\n\t{\n\t\tvoid DrawPostAlpha(GameTime time, RenderParameters parameters);\n\t\tProperty<int> DrawOrder { get; }\n\t}\n\n\tpublic interface IDrawablePreFrameComponent : IGraphicsComponent\n\t{\n\t\tvoid DrawPreFrame(GameTime time, RenderParameters parameters);\n\t}\n\n\tpublic interface INonPostProcessedDrawableComponent : IGraphicsComponent\n\t{\n\t\tvoid DrawNonPostProcessed(GameTime time, RenderParameters parameters);\n\t\tProperty<int> DrawOrder { get; }\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/AI.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing System.Collections;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\t[XmlInclude(typeof(AI.Task))]\n\t[XmlInclude(typeof(AI.AIState))]\n\tpublic class AI : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic class Task\n\t\t{\n\t\t\tpublic float _leftOverIntervalTime;\n\t\t\t[XmlIgnore]\n\t\t\tpublic float Interval = 0.0f;\n\t\t\t[XmlIgnore]\n\t\t\tpublic Action Action;\n\t\t}\n\n\t\tpublic class AIState\n\t\t{\n\t\t\tpublic string Name;\n\t\t\t[XmlIgnore]\n\t\t\tpublic Action<AIState> Enter;\n\t\t\t[XmlIgnore]\n\t\t\tpublic Action<AIState> Exit;\n\t\t\tpublic Task[] Tasks;\n\t\t\t[XmlIgnore]\n\t\t\tpublic bool _valid;\n\n\t\t\tpublic AIState()\n\t\t\t{\n\t\t\t\tthis.Tasks = new AI.Task[] { };\n\t\t\t}\n\t\t}\n\n\t\t[XmlArray(\"States\")]\n\t\t[XmlArrayItem(\"State\", Type = typeof(AIState))]\n\t\tpublic AIState[] States\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.states.Values.ToArray();\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tforeach (AIState state in value)\n\t\t\t\t{\n\t\t\t\t\tAIState existingState = null;\n\t\t\t\t\tif (this.states.TryGetValue(state.Name, out existingState))\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int i = 0; i < Math.Min(state.Tasks.Length, existingState.Tasks.Length); i++)\n\t\t\t\t\t\t\texistingState.Tasks[i]._leftOverIntervalTime = state.Tasks[i]._leftOverIntervalTime;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.states[state.Name] = state;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<string> CurrentState = new Property<string>();\n\n\t\tpublic Property<Entity.Handle> TargetAgent = new Property<Entity.Handle>();\n\n\t\tpublic Property<float> TimeInCurrentState = new Property<float>();\n\n\t\tprivate Dictionary<string, AIState> states = new Dictionary<string, AIState>();\n\n\t\tprivate AIState currentState;\n\n\t\tpublic void Setup(params AIState[] states)\n\t\t{\n\t\t\tforeach (AIState state in states)\n\t\t\t\tthis.Add(state);\n\t\t}\n\n\t\tpublic void Add(AIState state)\n\t\t{\n\t\t\tif (this.currentState == null && this.CurrentState.Value == null)\n\t\t\t{\n\t\t\t\tthis.currentState = state;\n\t\t\t\tthis.CurrentState.SetStealthy(state.Name);\n\t\t\t}\n\t\t\tAIState existingState = null;\n\t\t\tif (this.states.TryGetValue(state.Name, out existingState))\n\t\t\t{\n\t\t\t\texistingState._valid = true;\n\t\t\t\texistingState.Enter = state.Enter;\n\t\t\t\texistingState.Exit = state.Exit;\n\t\t\t\tif (state.Tasks != null && existingState.Tasks != null)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < Math.Min(state.Tasks.Length, existingState.Tasks.Length); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tTask existingTask = existingState.Tasks[i], task = state.Tasks[i];\n\t\t\t\t\t\ttask._leftOverIntervalTime = existingTask._leftOverIntervalTime;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\texistingState.Tasks = state.Tasks;\n\t\t\t\tif (existingState == this.currentState && this.TimeInCurrentState == 0.0f && existingState.Enter != null)\n\t\t\t\t\texistingState.Enter(null);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.states[state.Name] = state;\n\t\t\t\tstate._valid = true;\n\t\t\t}\n\t\t}\n\n\t\tprivate bool switching = false;\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Serialize = true;\n\n\t\t\tforeach (AIState s in this.states.Values.ToList())\n\t\t\t{\n\t\t\t\tif (!s._valid)\n\t\t\t\t\tthis.states.Remove(s.Name);\n\t\t\t}\n\n\t\t\tif (this.states.Count == 0)\n\t\t\t\tthis.CurrentState.Value = null;\n\t\t\telse if (!this.states.ContainsKey(this.CurrentState))\n\t\t\t\tthis.CurrentState.Value = this.states.Keys.First();\n\n\t\t\tbool initializing = true;\n\t\t\tthis.Add(new ChangeBinding<string>(this.CurrentState, delegate(string old, string value)\n\t\t\t{\n\t\t\t\tif (this.switching)\n\t\t\t\t\tthrow new Exception(\"Cannot switch states from inside a state exit function.\");\n\t\t\t\tif ((value == old && !initializing) || value == null || main.EditorEnabled)\n\t\t\t\t\treturn;\n\t\t\t\tAIState oldState = this.currentState;\n\t\t\t\tthis.currentState = this.states[value];\n\t\t\t\tif (!initializing || this.TimeInCurrentState == 0.0f)\n\t\t\t\t{\n\t\t\t\t\tthis.TimeInCurrentState.Value = 0.0f;\n\t\t\t\t\tthis.switching = true;\n\t\t\t\t\tforeach (Task t in this.currentState.Tasks)\n\t\t\t\t\t\tt._leftOverIntervalTime = 0.0f;\n\t\t\t\t\tif (oldState != null && oldState.Exit != null)\n\t\t\t\t\t\toldState.Exit(this.currentState);\n\t\t\t\t\tthis.switching = false;\n\t\t\t\t\tif (this.currentState.Enter != null)\n\t\t\t\t\t\tthis.currentState.Enter(oldState);\n\t\t\t\t}\n\t\t\t}));\n\t\t\tinitializing = false;\n\t\t}\n\n\t\tpublic void Update(float elapsedTime)\n\t\t{\n\t\t\tAIState originalState = this.currentState;\n\t\t\tif (originalState == null)\n\t\t\t\treturn;\n\t\t\tthis.TimeInCurrentState.Value += elapsedTime;\n\t\t\tforeach (Task t in this.currentState.Tasks)\n\t\t\t{\n\t\t\t\tif (t.Action != null)\n\t\t\t\t{\n\t\t\t\t\tif (t.Interval == 0.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Call once per frame\n\t\t\t\t\t\tt.Action();\n\t\t\t\t\t\tif (this.currentState != originalState || !this.Active)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat timeToSpend = t._leftOverIntervalTime + elapsedTime;\n\t\t\t\t\t\twhile (timeToSpend > t.Interval)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tt.Action();\n\t\t\t\t\t\t\tif (this.currentState != originalState || !this.Active)\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\ttimeToSpend -= t.Interval;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tt._leftOverIntervalTime = timeToSpend;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Agent.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing System.Collections;\nusing Microsoft.Xna.Framework;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Agent : Component<Main>\n\t{\n\t\tprivate static List<Agent> agents = new List<Agent>();\n\n\t\tpublic static bool Query(Vector3 pos, float visionRadius, float soundRadius, Agent agent)\n\t\t{\n\t\t\treturn Agent.query(pos, visionRadius, soundRadius, new[] { agent }) != null;\n\t\t}\n\n\t\tpublic static Agent Query(Vector3 pos, float visionRadius, float soundRadius, Func<Agent, bool> filter = null)\n\t\t{\n\t\t\treturn Agent.query(pos, visionRadius, soundRadius, Agent.agents, filter);\n\t\t}\n\n\t\tprivate static Agent query(Vector3 pos, float visionRadius, float soundRadius, IEnumerable<Agent> agents, Func<Agent, bool> filter = null)\n\t\t{\n\t\t\tvisionRadius *= visionRadius;\n\t\t\tsoundRadius *= soundRadius;\n\t\t\tforeach (Agent agent in agents)\n\t\t\t{\n\t\t\t\tif (agent.Active && agent.Enabled && !agent.Suspended && (filter == null || filter(agent)))\n\t\t\t\t{\n\t\t\t\t\tVector3 toAgent = agent.Position - pos;\n\t\t\t\t\tfloat distance = toAgent.LengthSquared();\n\t\t\t\t\tif (distance < soundRadius && agent.Loud)\n\t\t\t\t\t\treturn agent;\n\t\t\t\t\telse if (distance < visionRadius)\n\t\t\t\t\t{\n\t\t\t\t\t\tdistance = (float)Math.Sqrt(distance);\n\t\t\t\t\t\ttoAgent /= distance;\n\t\t\t\t\t\tVoxel.GlobalRaycastResult hit = Voxel.GlobalRaycast(pos, toAgent, distance, delegate(int i, Voxel.t t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (i < 5 && (t == Voxel.t.Neutral || t == Voxel.t.Infected || t == Voxel.t.Hard || t == Voxel.t.HardInfected))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (hit.Voxel == null || hit.Voxel.Entity == agent.Entity)\n\t\t\t\t\t\t\treturn agent;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\n\t\tpublic Property<float> Health = new Property<float> { Value = 1.0f };\n\n\t\t[XmlIgnore]\n\t\tpublic Command<float> Damage = new Command<float>();\n\n\t\tpublic Property<bool> Loud = new Property<bool> { Value = true };\n\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> Killed = new Property<bool>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tAgent.agents.Add(this);\n\t\t\tthis.Add(new CommandBinding(this.Delete, delegate()\n\t\t\t{\n\t\t\t\tAgent.agents.Remove(this);\n\t\t\t}));\n\n\t\t\tthis.Damage.Action = delegate(float value)\n\t\t\t{\n\t\t\t\tfloat health = Math.Max(this.Health - value, 0);\n\t\t\t\tif (health == 0.0f)\n\t\t\t\t\tthis.Killed.Value = true;\n\t\t\t\tthis.Health.Value = health;\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/AmbientSound.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class AmbientSound : Component<Main>\n\t{\n\t\tpublic Property<uint> PlayCue = new Property<uint>();\n\t\tpublic Property<uint> StopCue = new Property<uint>();\n\n\t\tpublic Property<bool> Is3D = new Property<bool>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\n\t\tprivate bool playing;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tSound.AttachTracker(this.Entity, this.Position);\n\n\t\t\tthis.Entity.CannotSuspendByDistance = !this.Is3D;\n\t\t\tthis.Entity.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tthis.Entity.CannotSuspendByDistance = !this.Is3D;\n\t\t\t}, this.Is3D));\n\n\t\t\tthis.Add(new CommandBinding(this.Enable, (Action)this.play));\n\t\t\tthis.Add(new CommandBinding(this.OnResumed, (Action)this.play));\n\t\t\tthis.Add(new CommandBinding(this.Disable, (Action)this.stop));\n\t\t\tthis.Add(new CommandBinding(this.OnSuspended, (Action)this.stop));\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (this.Enabled)\n\t\t\t\tthis.play();\n\t\t}\n\n\t\tprivate void play()\n\t\t{\n\t\t\tif (this.PlayCue != 0 && !this.Suspended && !this.main.EditorEnabled && !this.playing)\n\t\t\t{\n\t\t\t\tAkSoundEngine.PostEvent(this.PlayCue, this.Entity);\n\t\t\t\tthis.playing = true;\n\t\t\t}\n\t\t}\n\n\t\tprivate void stop()\n\t\t{\n\t\t\tif (this.StopCue != 0)\n\t\t\t\tAkSoundEngine.PostEvent(this.StopCue, this.Entity);\n\t\t\tthis.playing = false;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tthis.stop();\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Analytics.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\nusing System.IO;\nusing System.Collections.Specialized;\nusing System.Net;\nusing ComponentBind;\nusing System.Management;\nusing ICSharpCode.SharpZipLib.GZip;\nusing System.Threading;\nusing Lemma.Util;\n\nnamespace Lemma.Components\n{\n\tpublic class Session\n\t{\n\t\tpublic class ContinuousProperty\n\t\t{\n\t\t\tpublic string Name;\n\t\t\tpublic bool Independent = true;\n\n\t\t\tprivate List<float> data = new List<float>();\n\n\t\t\tprivate float interval;\n\n\t\t\tpublic void Initialize(Session session)\n\t\t\t{\n\t\t\t\tthis.interval = session.Interval;\n\t\t\t}\n\n\t\t\tpublic float this[int index]\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn this.data.Count == 0 ? 0.0f : this.data[Math.Min(index, this.data.Count - 1)];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic float this[float time]\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\tint index = (int)Math.Floor(time / this.interval);\n\t\t\t\t\tfloat blend = (time - (index * this.interval)) / this.interval;\n\t\t\t\t\treturn (this[index] * (1.0f - blend)) + (this[index + 1] * blend);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic int Count\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn this.data.Count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void Record(float value)\n\t\t\t{\n\t\t\t\tdata.Add(value);\n\t\t\t}\n\n\t\t\tpublic unsafe static string serialize(List<float> data)\n\t\t\t{\n\t\t\t\tbyte[] result = new byte[data.Count * 4];\n\t\t\t\tfor (int i = 0; i < data.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tfloat value = data[i];\n\t\t\t\t\tint intValue = *((int*)&value);\n\t\t\t\t\tint j = i * 4;\n\t\t\t\t\tresult[j] = (byte)(intValue >> 24);\n\t\t\t\t\tresult[j + 1] = (byte)(intValue >> 16);\n\t\t\t\t\tresult[j + 2] = (byte)(intValue >> 8);\n\t\t\t\t\tresult[j + 3] = (byte)intValue;\n\t\t\t\t}\n\t\t\t\treturn System.Convert.ToBase64String(result);\n\t\t\t}\n\n\t\t\tpublic unsafe static List<float> deserialize(string input)\n\t\t\t{\n\t\t\t\tbyte[] temp = System.Convert.FromBase64String(input);\n\t\t\t\tList<float> result = new List<float>();\n\t\t\t\tfor (int i = 0; i < temp.Length / 4; i++)\n\t\t\t\t{\n\t\t\t\t\tint j = i * 4;\n\t\t\t\t\tint intValue = (temp[j] << 24)\n\t\t\t\t\t\t| (temp[j + 1] << 16)\n\t\t\t\t\t\t| (temp[j + 2] << 8)\n\t\t\t\t\t\t| temp[j + 3];\n\t\t\t\t\tresult.Add(*((float*)&intValue));\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic string Data\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn serialize(this.data);\n\t\t\t\t}\n\t\t\t\tset\n\t\t\t\t{\n\t\t\t\t\tthis.data = deserialize(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void Clear()\n\t\t\t{\n\t\t\t\tthis.data.Clear();\n\t\t\t}\n\t\t}\n\n\t\tpublic class PositionProperty\n\t\t{\n\t\t\tprivate ContinuousProperty[] coordinates;\n\n\t\t\tpublic string Name;\n\n\t\t\tprivate float interval;\n\n\t\t\tpublic void Initialize(Session session)\n\t\t\t{\n\t\t\t\tthis.interval = session.Interval;\n\t\t\t\tif (!session.continuousProperties.ContainsKey(this.Name + \"X\"))\n\t\t\t\t{\n\t\t\t\t\tthis.coordinates = new ContinuousProperty[3];\n\t\t\t\t\tthis.coordinates[0] = session.continuousProperties[this.Name + \"X\"] = new ContinuousProperty\n\t\t\t\t\t{\n\t\t\t\t\t\tName = this.Name + \"X\",\n\t\t\t\t\t\tIndependent = false,\n\t\t\t\t\t};\n\t\t\t\t\tthis.coordinates[1] = session.continuousProperties[this.Name + \"Y\"] = new ContinuousProperty\n\t\t\t\t\t{\n\t\t\t\t\t\tName = this.Name + \"Y\",\n\t\t\t\t\t\tIndependent = false,\n\t\t\t\t\t};\n\t\t\t\t\tthis.coordinates[2] = session.continuousProperties[this.Name + \"Z\"] = new ContinuousProperty\n\t\t\t\t\t{\n\t\t\t\t\t\tName = this.Name + \"Z\",\n\t\t\t\t\t\tIndependent = false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.coordinates = new[]\n\t\t\t\t\t{\n\t\t\t\t\t\tsession.continuousProperties[this.Name + \"X\"],\n\t\t\t\t\t\tsession.continuousProperties[this.Name + \"Y\"],\n\t\t\t\t\t\tsession.continuousProperties[this.Name + \"Z\"],\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic Vector3 this[float time]\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\tint index = (int)Math.Floor(time / this.interval);\n\t\t\t\t\tfloat blend = (time - (index * this.interval)) / this.interval;\n\t\t\t\t\treturn Vector3.Lerp(this[index], this[index + 1], blend);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic Vector3 this[int index]\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn new Vector3\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.coordinates[0][index],\n\t\t\t\t\t\tthis.coordinates[1][index],\n\t\t\t\t\t\tthis.coordinates[2][index]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic Vector3 GetLastRecordedPosition(float time)\n\t\t\t{\n\t\t\t\tint index = (int)Math.Floor(time / this.interval);\n\t\t\t\treturn this[index];\n\t\t\t}\n\n\t\t\tpublic void Record(Vector3 value)\n\t\t\t{\n\t\t\t\tthis.coordinates[0].Record(value.X);\n\t\t\t\tthis.coordinates[1].Record(value.Y);\n\t\t\t\tthis.coordinates[2].Record(value.Z);\n\t\t\t}\n\t\t}\n\n\t\tpublic class EventList\n\t\t{\n\t\t\t[XmlIgnore]\n\t\t\tpublic Session Session;\n\t\t\tpublic string Name;\n\t\t\tpublic List<Event> Events = new List<Event>();\n\t\t}\n\n\t\tpublic class Event\n\t\t{\n\t\t\tpublic float Time;\n\t\t\tpublic string Data;\n\t\t}\n\n\t\tpublic ContinuousProperty GetContinuousProperty(string name)\n\t\t{\n\t\t\tContinuousProperty result = null;\n\t\t\tthis.continuousProperties.TryGetValue(name, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic ContinuousProperty[] ContinuousProperties\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.continuousProperties.Values.ToArray();\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.continuousProperties.Clear();\n\t\t\t\tforeach (ContinuousProperty prop in value)\n\t\t\t\t\tthis.continuousProperties.Add(prop.Name, prop);\n\t\t\t}\n\t\t}\n\n\t\tpublic PositionProperty[] PositionProperties\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.positionProperties.Values.ToArray();\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.positionProperties.Clear();\n\t\t\t\tforeach (PositionProperty prop in value)\n\t\t\t\t\tthis.positionProperties.Add(prop.Name, prop);\n\t\t\t}\n\t\t}\n\n\t\tpublic EventList[] Events\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.events.Values.ToArray();\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.events.Clear();\n\t\t\t\tforeach (EventList el in value)\n\t\t\t\t\tthis.events.Add(el.Name, el);\n\t\t\t}\n\t\t}\n\n\t\tpublic float TotalTime;\n\n\t\tpublic string Map;\n\n\t\tpublic float Interval;\n\n\t\tpublic static Session Load(string path)\n\t\t{\n\t\t\tSession s;\n\t\t\tusing (Stream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.None))\n\t\t\t{\n\t\t\t\tStream stream = null;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tstream = new GZipInputStream(fs);\n\t\t\t\t\ts = (Session)new XmlSerializer(typeof(Session)).Deserialize(stream);\n\t\t\t\t}\n\t\t\t\tcatch (GZipException)\n\t\t\t\t{\n\t\t\t\t\tfs.Seek(0, SeekOrigin.Begin);\n\t\t\t\t\ts = (Session)new XmlSerializer(typeof(Session)).Deserialize(fs);\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\tif (stream != null)\n\t\t\t\t\t\tstream.Dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach (ContinuousProperty prop in s.continuousProperties.Values)\n\t\t\t\tprop.Initialize(s);\n\t\t\tforeach (PositionProperty prop in s.positionProperties.Values)\n\t\t\t\tprop.Initialize(s);\n\t\t\tforeach (EventList el in s.events.Values)\n\t\t\t\tel.Session = s;\n\t\t\treturn s;\n\t\t}\n\n\t\tprivate Dictionary<string, ContinuousProperty> continuousProperties = new Dictionary<string, ContinuousProperty>();\n\n\t\tprivate Dictionary<string, PositionProperty> positionProperties = new Dictionary<string, PositionProperty>();\n\n\t\tprivate Dictionary<string, EventList> events = new Dictionary<string, EventList>();\n\n\t\tpublic DateTime Date;\n\n\t\tpublic int Build;\n\n\t\tpublic string UUID;\n\n\t\tpublic string OS;\n\n\t\tpublic string CPU;\n\n\t\tpublic string GPU;\n\n\t\tpublic bool Is64BitOS;\n\n\t\tpublic Point ScreenSize;\n\n\t\tpublic bool VR;\n\n\t\tpublic bool IsFullscreen;\n\n\t\tpublic int Memory;\n\n\t\tpublic string ID;\n\n\t\tpublic string LastSession;\n\n\t\tpublic bool Demo;\n\n\t\tpublic class Recorder: Component<Main>\n\t\t{\n\t\t\tpublic static void Event(Main main, string name, string data = null)\n\t\t\t{\n#if ANALYTICS\n\t\t\t\tmain.SessionRecorder.RecordEvent(name, data);\n#endif\n\t\t\t}\n\n\t\t\tpublic static void UploadSession(string file)\n\t\t\t{\n\t\t\t\tstring url = \"http://powerful-dusk-6047.herokuapp.com/\" + Path.GetFileName(file);\n\t\t\t\tnew WebClient().UploadData(url, \"PUT\", File.ReadAllBytes(file));\n\t\t\t\tFile.Delete(file);\n\t\t\t}\n\n\t\t\tpublic const float Interval = 0.25f;\n\n\t\t\tprivate float intervalTime = 0.0f;\n\n\t\t\tprivate Session data = new Session();\n\n\t\t\tprivate Thread workThread;\n\t\t\tprivate BlockingQueue<string> workQueue = new BlockingQueue<string>();\n\t\t\tprivate bool inProgress = false;\n\t\t\tprivate void worker()\n\t\t\t{\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tstring filename = this.workQueue.Dequeue();\n\t\t\t\t\tlock (this)\n\t\t\t\t\t\tthis.inProgress = true;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tRecorder.UploadSession(filename);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.d(string.Format(\"Failed to upload analytics session.\\n{0}\", e.ToString()));\n\t\t\t\t\t}\n\t\t\t\t\tlock (this)\n\t\t\t\t\t\tthis.inProgress = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic Property<bool> EnableUpload = new Property<bool>();\n\t\t\t\n\t\t\tpublic bool Uploading\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\tlock (this)\n\t\t\t\t\t\treturn this.workQueue.Count > 0 || this.inProgress;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic Recorder(Main main)\n\t\t\t{\n\t\t\t\tthis.main = main;\n\t\t\t\tthis.data.Date = DateTime.Now;\n\t\t\t\tthis.data.Interval = Interval;\n\t\t\t\tthis.data.Build = Main.Build;\n\t\t\t\tthis.data.OS = Environment.OSVersion.VersionString;\n\t\t\t\tthis.data.Is64BitOS = Environment.Is64BitOperatingSystem;\n\t\t\t\tthis.Add(new ChangeBinding<bool>(this.EnableUpload, delegate(bool old, bool value)\n\t\t\t\t{\n\t\t\t\t\tif (value)\n\t\t\t\t\t{\n#if ANALYTICS\n\t\t\t\t\t\tforeach (string file in this.main.AnalyticsSessionFiles)\n\t\t\t\t\t\t\tthis.workQueue.Enqueue(file);\n#endif\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.workQueue.Clear();\n\t\t\t\t}));\n\n\t\t\t\tthis.workThread = new Thread(new ThreadStart(this.worker));\n\t\t\t\tthis.workThread.IsBackground = true;\n\t\t\t\tthis.workThread.Start();\n\n#if WINDOWS\n\t\t\t\tthis.data.Memory = (int)(new Microsoft.VisualBasic.Devices.ComputerInfo().TotalPhysicalMemory / (ulong)1048576);\n\t\t\t\tManagementObject cpu = new ManagementObjectSearcher(\"select * from Win32_Processor\").Get().Cast<ManagementObject>().First();\n\t\t\t\tthis.data.CPU = string.Format(\"{0} {1}\", cpu[\"Name\"], cpu[\"Caption\"]);\n\t\t\t\tManagementObjectSearcher searcher = new ManagementObjectSearcher(\"select * from Win32_DisplayConfiguration\");\n\t\t\t\tforeach (ManagementObject mo in searcher.Get())\n\t\t\t\t{\n\t\t\t\t\tforeach (PropertyData property in mo.Properties)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (property.Name == \"Description\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.data.GPU = property.Value.ToString();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n#endif\n\t\t\t}\n\n\t\t\tpublic void Save(string path, int build, string map, float totalTime)\n\t\t\t{\n\t\t\t\tthis.data.Map = string.IsNullOrEmpty(map) ? null : Path.GetFileNameWithoutExtension(map);\n\t\t\t\tthis.data.TotalTime = totalTime;\n\t\t\t\tthis.data.Map = map;\n\t\t\t\tthis.data.UUID = this.main.Settings.UUID;\n#if DEMO\n\t\t\t\tthis.data.Demo = true;\n#endif\n\n\t\t\t\tPoint screenSize;\n#if VR\n\t\t\t\tthis.data.VR = this.main.VR;\n\t\t\t\tif (this.main.VR)\n\t\t\t\t\tscreenSize = this.main.VRActualScreenSize;\n\t\t\t\telse\n#endif\n\t\t\t\t\tscreenSize = this.main.ScreenSize;\n\n\t\t\t\tthis.data.ScreenSize = screenSize;\n\t\t\t\tthis.data.IsFullscreen = this.main.Settings.Fullscreen;\n\n\t\t\t\tstring filename = Path.Combine(path, string.Format(\"{0}-{1}-{2}.xml.gz\", build, this.data.Map == null ? \"null\" : this.data.Map, this.data.ID));\n\t\t\t\tusing (Stream fs = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.None))\n\t\t\t\tusing (Stream stream = new GZipOutputStream(fs))\n\t\t\t\t\tnew XmlSerializer(typeof(Session)).Serialize(stream, this.data);\n\n\t\t\t\tif (this.EnableUpload)\n\t\t\t\t\tthis.workQueue.Enqueue(filename);\n\t\t\t}\n\n\t\t\tpublic void Reset()\n\t\t\t{\n\t\t\t\tforeach (ContinuousProperty prop in this.data.continuousProperties.Values)\n\t\t\t\t\tprop.Clear();\n\t\t\t\tthis.data.LastSession = this.data.ID;\n\t\t\t\tthis.data.ID = Guid.NewGuid().ToString().Replace(\"-\", string.Empty).Substring(0, 32);\n\t\t\t\tthis.data.events.Clear();\n\t\t\t\tthis.data.Date = DateTime.Now;\n\t\t\t}\n\n\t\t\tprivate List<Action> recordActions = new List<Action>();\n\n\t\t\tpublic void Add(string name, Func<float> get)\n\t\t\t{\n\t\t\t\tContinuousProperty prop;\n\t\t\t\tif (!this.data.continuousProperties.TryGetValue(name, out prop))\n\t\t\t\t{\n\t\t\t\t\tprop = this.data.continuousProperties[name] = new ContinuousProperty\n\t\t\t\t\t{\n\t\t\t\t\t\tName = name,\n\t\t\t\t\t};\n\t\t\t\t\tprop.Initialize(this.data);\n\t\t\t\t}\n\t\t\t\tthis.recordActions.Add(delegate()\n\t\t\t\t{\n\t\t\t\t\tprop.Record(get());\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tpublic void Add(string name, Func<Vector3> get)\n\t\t\t{\n\t\t\t\tPositionProperty prop;\n\t\t\t\tif (!this.data.positionProperties.TryGetValue(name, out prop))\n\t\t\t\t{\n\t\t\t\t\tprop = this.data.positionProperties[name] = new PositionProperty\n\t\t\t\t\t{\n\t\t\t\t\t\tName = name,\n\t\t\t\t\t};\n\t\t\t\t\tprop.Initialize(this.data);\n\t\t\t\t}\n\t\t\t\tthis.recordActions.Add(delegate()\n\t\t\t\t{\n\t\t\t\t\tprop.Record(get());\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tpublic void RecordEvent(string name, string data = null)\n\t\t\t{\n\t\t\t\tEventList eventList;\n\t\t\t\tif (!this.data.events.TryGetValue(name, out eventList))\n\t\t\t\t{\n\t\t\t\t\teventList = this.data.events[name] = new EventList\n\t\t\t\t\t{\n\t\t\t\t\t\tName = name,\n\t\t\t\t\t\tSession = this.data,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\teventList.Events.Add(new Session.Event\n\t\t\t\t{\n\t\t\t\t\tTime = main.TotalTime,\n\t\t\t\t\tData = data,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tpublic void Update(float dt)\n\t\t\t{\n\t\t\t\tthis.intervalTime += dt;\n\t\t\t\twhile (this.intervalTime > Interval)\n\t\t\t\t{\n\t\t\t\t\tforeach (Action action in this.recordActions)\n\t\t\t\t\t\taction();\n\t\t\t\t\tthis.intervalTime -= Interval;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/AnimatedProp.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class AnimatedProp : Component<Main>\n\t{\n\t\tpublic Property<string> Clip = new Property<string>();\n\t\tpublic Property<bool> Loop = new Property<bool>();\n\t\tprivate AnimatedModel model;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.model = this.Entity.Get<AnimatedModel>();\n\n\t\t\tthis.Add(new ChangeBinding<string>(this.Clip, delegate(string old, string value)\n\t\t\t{\n\t\t\t\tif (old != value)\n\t\t\t\t{\n\t\t\t\t\tif (!string.IsNullOrEmpty(old))\n\t\t\t\t\t\tthis.model.Stop(old);\n\t\t\t\t\tif (!string.IsNullOrEmpty(this.Clip) && this.model.Clips.ContainsKey(this.Clip))\n\t\t\t\t\t\tthis.model[value].Loop = this.Loop;\n\t\t\t\t\tif (this.Enabled)\n\t\t\t\t\t\tthis.play();\n\t\t\t\t}\n\t\t\t}));\n\t\t\tthis.Add(new ChangeBinding<bool>(this.Loop, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (!string.IsNullOrEmpty(this.Clip) && this.model.Clips.ContainsKey(this.Clip))\n\t\t\t\t\tthis.model[this.Clip].Loop = value;\n\t\t\t}));\n\t\t\tthis.Add(new CommandBinding(this.Enable, (Action)this.play));\n\t\t\tthis.Add(new CommandBinding(this.Disable, (Action)this.stop));\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (this.Enabled)\n\t\t\t\tthis.play();\n\t\t}\n\n\t\tprivate void play()\n\t\t{\n\t\t\tif (!string.IsNullOrEmpty(this.Clip) && this.Enabled && !this.model.IsPlaying(this.Clip) && this.model.Clips.ContainsKey(this.Clip))\n\t\t\t\tthis.model.StartClip(this.Clip, 0, this.Loop);\n\t\t}\n\n\t\tprivate void stop()\n\t\t{\n\t\t\tif (!string.IsNullOrEmpty(this.Clip))\n\t\t\t\tthis.model.Stop(this.Clip);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Animation.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic static class EaseTypeExtensions\n\t{\n\t\tpublic static bool IsIn(this Animation.Ease.EaseType type)\n\t\t{\n\t\t\treturn type == Animation.Ease.EaseType.None\n\t\t\t\t|| type == Animation.Ease.EaseType.InQuadratic\n\t\t\t\t|| type == Animation.Ease.EaseType.InOutQuadratic\n\t\t\t\t|| type == Animation.Ease.EaseType.InCubic\n\t\t\t\t|| type == Animation.Ease.EaseType.InOutCubic\n\t\t\t\t|| type == Animation.Ease.EaseType.InSin\n\t\t\t\t|| type == Animation.Ease.EaseType.InOutSin\n\t\t\t\t|| type == Animation.Ease.EaseType.InExponential\n\t\t\t\t|| type == Animation.Ease.EaseType.InOutExponential;\n\t\t}\n\n\t\tpublic static bool IsOut(this Animation.Ease.EaseType type)\n\t\t{\n\t\t\treturn type == Animation.Ease.EaseType.None\n\t\t\t\t|| type == Animation.Ease.EaseType.OutQuadratic\n\t\t\t\t|| type == Animation.Ease.EaseType.InOutQuadratic\n\t\t\t\t|| type == Animation.Ease.EaseType.OutCubic\n\t\t\t\t|| type == Animation.Ease.EaseType.InOutCubic\n\t\t\t\t|| type == Animation.Ease.EaseType.OutSin\n\t\t\t\t|| type == Animation.Ease.EaseType.InOutSin\n\t\t\t\t|| type == Animation.Ease.EaseType.OutExponential\n\t\t\t\t|| type == Animation.Ease.EaseType.InOutExponential;\n\t\t}\n\n\t\tpublic static bool BlendsInto(this Animation.Ease.EaseType type, Animation.Ease.EaseType other)\n\t\t{\n\t\t\treturn (!IsOut(type) && !IsIn(other));\n\t\t}\n\t}\n\n\tpublic class Animation : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic abstract class Base\n\t\t{\n\t\t\tpublic bool Done { get; protected set; }\n\t\t\tpublic abstract void Reset();\n\t\t\tpublic abstract void Update(float dt);\n\t\t}\n\n\t\tpublic abstract class Interval : Base\n\t\t{\n\t\t\tpublic float Duration;\n\t\t\tprivate float time;\n\n\t\t\tpublic Interval(float duration)\n\t\t\t{\n\t\t\t\tthis.Duration = duration;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tthis.time = 0.0f;\n\t\t\t\tthis.Done = false;\n\t\t\t}\n\n\t\t\tpublic override void Update(float dt)\n\t\t\t{\n\t\t\t\tthis.time += dt;\n\t\t\t\tthis.UpdateInterval(this.Duration == 0.0f ? 1.0f : Math.Min(this.time / this.Duration, 1.0f));\n\t\t\t\tthis.Done = this.time > this.Duration;\n\t\t\t}\n\n\t\t\tpublic abstract void UpdateInterval(float x);\n\t\t}\n\n\t\tpublic class Custom : Interval\n\t\t{\n\t\t\tprivate Action<float> action;\n\n\t\t\tpublic Custom(Action<float> action, float duration)\n\t\t\t\t: base(duration)\n\t\t\t{\n\t\t\t\tthis.action = action;\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.action(x);\n\t\t\t}\n\t\t}\n\n\t\tpublic abstract class Move<T> : Interval\n\t\t{\n\t\t\tprotected Property<T> property;\n\t\t\tprotected T start;\n\t\t\tprotected T parameter;\n\n\t\t\tpublic Move(Property<T> p, T t, float duration)\n\t\t\t\t: base(duration)\n\t\t\t{\n\t\t\t\tthis.property = p;\n\t\t\t\tthis.parameter = t;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.start = this.property.Value;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector2MoveTo : Move<Vector2>\n\t\t{\n\t\t\tpublic Vector2MoveTo(Property<Vector2> p, Vector2 t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = this.start + (this.parameter - this.start) * x;\n\t\t\t}\n\t\t}\n\n\t\tpublic class MatrixMoveTo : Move<Matrix>\n\t\t{\n\t\t\tpublic MatrixMoveTo(Property<Matrix> p, Matrix t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tMatrix input = Matrix.Lerp(this.start, this.parameter, x);\n\t\t\t\tMatrix result = input;\n\t\t\t\tresult.Forward = Vector3.Normalize(Vector3.TransformNormal(new Vector3(0, 0, -1.0f), input));\n\t\t\t\tresult.Up = Vector3.Normalize(Vector3.TransformNormal(new Vector3(0.0f, 1.0f, 0), input));\n\t\t\t\tresult.Right = Vector3.Normalize(Vector3.Cross(result.Forward, result.Up));\n\t\t\t\tthis.property.Value = result;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector2MoveToSpeed : Vector2MoveTo\n\t\t{\n\t\t\tprivate float speed;\n\t\t\tpublic Vector2MoveToSpeed(Property<Vector2> p, Vector2 t, float speed)\n\t\t\t\t: base(p, t, 1.0f)\n\t\t\t{\n\t\t\t\tthis.speed = speed;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.Duration = (this.parameter - this.start).Length() / this.speed;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector2MoveBy : Move<Vector2>\n\t\t{\n\t\t\tpublic Vector2MoveBy(Property<Vector2> p, Vector2 t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = this.start + this.parameter * x;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector2MoveBySpeed : Vector2MoveBy\n\t\t{\n\t\t\tpublic Vector2MoveBySpeed(Property<Vector2> p, Vector2 t, float speed)\n\t\t\t\t: base(p, t, t.Length() / speed)\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector3MoveTo : Move<Vector3>\n\t\t{\n\t\t\tpublic Vector3MoveTo(Property<Vector3> p, Vector3 t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = this.start + (this.parameter - this.start) * x;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector3MoveToSpeed : Vector3MoveTo\n\t\t{\n\t\t\tprivate float speed;\n\t\t\tpublic Vector3MoveToSpeed(Property<Vector3> p, Vector3 t, float speed)\n\t\t\t\t: base(p, t, 1.0f)\n\t\t\t{\n\t\t\t\tthis.speed = speed;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.Duration = (this.parameter - this.start).Length() / this.speed;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector3MoveBy : Move<Vector3>\n\t\t{\n\t\t\tpublic Vector3MoveBy(Property<Vector3> p, Vector3 t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = this.start + this.parameter * x;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector3MoveBySpeed : Vector3MoveBy\n\t\t{\n\t\t\tpublic Vector3MoveBySpeed(Property<Vector3> p, Vector3 t, float speed)\n\t\t\t\t: base(p, t, t.Length() / speed)\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector4MoveTo : Move<Vector4>\n\t\t{\n\t\t\tpublic Vector4MoveTo(Property<Vector4> p, Vector4 t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = this.start + (this.parameter - this.start) * x;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector4MoveToSpeed : Vector4MoveTo\n\t\t{\n\t\t\tprivate float speed;\n\n\t\t\tpublic Vector4MoveToSpeed(Property<Vector4> p, Vector4 t, float speed)\n\t\t\t\t: base(p, t, 1.0f)\n\t\t\t{\n\t\t\t\tthis.speed = speed;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.Duration = (this.parameter - this.start).Length() / this.speed;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector4MoveBy : Move<Vector4>\n\t\t{\n\t\t\tpublic Vector4MoveBy(Property<Vector4> p, Vector4 t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = this.start + this.parameter * x;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Vector4MoveBySpeed : Vector4MoveBy\n\t\t{\n\t\t\tpublic Vector4MoveBySpeed(Property<Vector4> p, Vector4 t, float speed)\n\t\t\t\t: base(p, t, t.Length() / speed)\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\tpublic class QuaternionMoveTo : Move<Quaternion>\n\t\t{\n\t\t\tpublic QuaternionMoveTo(Property<Quaternion> p, Quaternion t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = Quaternion.Lerp(this.start, this.parameter, x);\n\t\t\t}\n\t\t}\n\n\t\tpublic class QuaternionMoveToSpeed : QuaternionMoveTo\n\t\t{\n\t\t\tprivate float speed;\n\n\t\t\tpublic QuaternionMoveToSpeed(Property<Quaternion> p, Quaternion t, float speed)\n\t\t\t\t: base(p, t, 1.0f)\n\t\t\t{\n\t\t\t\tthis.speed = speed;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.Duration = (this.parameter - this.start).Length() / this.speed;\n\t\t\t}\n\t\t}\n\n\t\tpublic class ColorMoveTo : Move<Color>\n\t\t{\n\t\t\tpublic ColorMoveTo(Property<Color> p, Color t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = new Color(this.start.ToVector4() + (this.parameter.ToVector4() - this.start.ToVector4()) * x);\n\t\t\t}\n\t\t}\n\n\t\tpublic class ColorMoveToSpeed : ColorMoveTo\n\t\t{\n\t\t\tprivate float speed;\n\t\t\tpublic ColorMoveToSpeed(Property<Color> p, Color t, float speed)\n\t\t\t\t: base(p, t, 1.0f)\n\t\t\t{\n\t\t\t\tthis.speed = speed;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.Duration = (new Vector3(this.start.R, this.start.G, this.start.B) - new Vector3(this.parameter.R, this.parameter.G, this.parameter.B)).Length() / this.speed;\n\t\t\t}\n\t\t}\n\n\t\tpublic class IntMoveTo : Move<int>\n\t\t{\n\t\t\tpublic IntMoveTo(Property<int> p, int t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = (int)(this.start + (this.parameter - this.start) * x);\n\t\t\t}\n\t\t}\n\n\t\tpublic class IntMoveToSpeed : IntMoveTo\n\t\t{\n\t\t\tprivate float speed;\n\t\t\tpublic IntMoveToSpeed(Property<int> p, int t, float speed)\n\t\t\t\t: base(p, t, 1.0f)\n\t\t\t{\n\t\t\t\tthis.speed = speed;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.Duration = Math.Abs(this.parameter - this.start) / this.speed;\n\t\t\t}\n\t\t}\n\n\t\tpublic class IntMoveBy : Move<int>\n\t\t{\n\t\t\tpublic IntMoveBy(Property<int> p, int t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = (int)(this.start + this.parameter * x);\n\t\t\t}\n\t\t}\n\n\t\tpublic class IntMoveBySpeed : IntMoveBy\n\t\t{\n\t\t\tpublic IntMoveBySpeed(Property<int> p, int t, float speed)\n\t\t\t\t: base(p, t, Math.Abs(t / speed))\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\tpublic class FloatMoveTo : Move<float>\n\t\t{\n\t\t\tpublic FloatMoveTo(Property<float> p, float t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = this.start + (this.parameter - this.start) * x;\n\t\t\t}\n\t\t}\n\n\t\tpublic class FloatMoveToSpeed : FloatMoveTo\n\t\t{\n\t\t\tprivate float speed;\n\t\t\tpublic FloatMoveToSpeed(Property<float> p, float t, float speed)\n\t\t\t\t: base(p, t, 1.0f)\n\t\t\t{\n\t\t\t\tthis.speed = speed;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.Duration = Math.Abs(this.parameter - this.start) / this.speed;\n\t\t\t}\n\t\t}\n\n\t\tpublic class FloatMoveBy : Move<float>\n\t\t{\n\t\t\tpublic FloatMoveBy(Property<float> p, float t, float duration)\n\t\t\t\t: base(p, t, duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.property.Value = this.start + this.parameter * x;\n\t\t\t}\n\t\t}\n\n\t\tpublic class FloatMoveBySpeed : FloatMoveBy\n\t\t{\n\t\t\tpublic FloatMoveBySpeed(Property<float> p, float t, float speed)\n\t\t\t\t: base(p, t, Math.Abs(t / speed))\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\tpublic class Delay : Interval\n\t\t{\n\t\t\tpublic Delay(float duration)\n\t\t\t\t: base(duration)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\t// Do nothing!\n\t\t\t}\n\t\t}\n\n\t\tpublic class Execute : Interval\n\t\t{\n\t\t\tprivate Command action;\n\t\t\tprivate bool executed;\n\n\t\t\tpublic Execute(Action action)\n\t\t\t\t: this(new Command { Action = action })\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic Execute(Command action)\n\t\t\t\t: base(0)\n\t\t\t{\n\t\t\t\tthis.action = action;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.executed = false;\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tif (!this.executed)\n\t\t\t\t\tthis.action.Execute();\n\t\t\t\tthis.executed = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Execute<T> : Interval\n\t\t{\n\t\t\tprivate Command<T> action;\n\t\t\tprivate bool executed;\n\t\t\tprivate T parameter;\n\n\t\t\tpublic Execute(Action<T> action, T parameter)\n\t\t\t\t: this(new Command<T> { Action = action }, parameter)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tpublic Execute(Command<T> action, T parameter)\n\t\t\t\t: base(0)\n\t\t\t{\n\t\t\t\tthis.action = action;\n\t\t\t\tthis.parameter = parameter;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.executed = false;\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tif (!this.executed)\n\t\t\t\t\tthis.action.Execute(this.parameter);\n\t\t\t\tthis.executed = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Set<T> : Interval\n\t\t{\n\t\t\tprivate Property<T> property;\n\t\t\tprivate T value;\n\t\t\tprivate bool executed;\n\n\t\t\tpublic Set(Property<T> p, T t)\n\t\t\t\t: base(0)\n\t\t\t{\n\t\t\t\tthis.property = p;\n\t\t\t\tthis.value = t;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.executed = false;\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tif (!this.executed)\n\t\t\t\t\tthis.property.Value = this.value;\n\t\t\t\tthis.executed = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Parallel : Interval\n\t\t{\n\t\t\tprivate bool[] finished;\n\t\t\tprivate Interval[] intervals;\n\n\t\t\tpublic Parallel(params Interval[] intervals)\n\t\t\t\t: base(intervals.Max(x => x.Duration))\n\t\t\t{\n\t\t\t\tthis.intervals = intervals;\n\t\t\t\tthis.finished = new bool[this.intervals.Length];\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tforeach (Interval i in this.intervals)\n\t\t\t\t\ti.Reset();\n\t\t\t\tfor (int i = 0; i < this.finished.Length; i++)\n\t\t\t\t\tthis.finished[i] = false;\n\t\t\t\tthis.Duration = this.intervals.Max(x => x.Duration);\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tfloat time = x * this.Duration;\n\t\t\t\tfor (int i = 0; i < this.intervals.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tInterval interval = this.intervals[i];\n\t\t\t\t\tfloat intervalTime = interval.Duration == 0.0f ? 1.0f : time / interval.Duration;\n\t\t\t\t\tif (intervalTime >= 1.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!this.finished[i])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinterval.UpdateInterval(1.0f);\n\t\t\t\t\t\t\tthis.finished[i] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tinterval.UpdateInterval(intervalTime);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic class Sequence : Interval\n\t\t{\n\t\t\tprivate float[] criticalPoints;\n\t\t\tprivate Interval[] intervals;\n\t\t\tprivate int currentIndex;\n\n\t\t\tpublic Sequence(params Interval[] intervals)\n\t\t\t\t: base(Math.Max(intervals.Sum(x => x.Duration), 0.001f))\n\t\t\t{\n\t\t\t\tthis.intervals = intervals;\n\t\t\t}\n\n\t\t\tpublic void Add(Interval interval)\n\t\t\t{\n\t\t\t\tInterval[] newIntervals = new Interval[this.intervals.Length + 1];\n\t\t\t\tArray.Copy(this.intervals, newIntervals, this.intervals.Length);\n\t\t\t\tnewIntervals[newIntervals.Length - 1] = interval;\n\t\t\t\tthis.intervals = newIntervals;\n\t\t\t\tthis.Duration += interval.Duration;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.criticalPoints = new float[this.intervals.Length];\n\t\t\t\tforeach (Interval interval in this.intervals)\n\t\t\t\t\tinterval.Reset();\n\t\t\t\tthis.Duration = this.intervals.Sum(x => x.Duration);\n\t\t\t\tfloat total = 0.0f;\n\t\t\t\tint i = 0;\n\t\t\t\tforeach (Interval interval in this.intervals)\n\t\t\t\t{\n\t\t\t\t\tthis.criticalPoints[i] = total;\n\t\t\t\t\ttotal += this.Duration == 0.0f ? 0.0f : interval.Duration / this.Duration;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tthis.currentIndex = 0;\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\t// Advance the index if necessary\n\t\t\t\tint maxIndex = this.intervals.Length - 1;\n\t\t\t\tif (this.currentIndex < maxIndex)\n\t\t\t\t{\n\t\t\t\t\twhile (x >= this.criticalPoints[this.currentIndex + 1])\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.intervals[this.currentIndex].UpdateInterval(1.0f);\n\t\t\t\t\t\tthis.currentIndex++;\n\t\t\t\t\t\tthis.intervals[this.currentIndex].Reset();\n\t\t\t\t\t\tif (this.currentIndex == maxIndex)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Retreat the index if necessary\n\t\t\t\tif (this.currentIndex > 0)\n\t\t\t\t{\n\t\t\t\t\twhile (x < this.criticalPoints[this.currentIndex])\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.intervals[this.currentIndex].UpdateInterval(0.0f);\n\t\t\t\t\t\tthis.currentIndex--;\n\t\t\t\t\t\tthis.intervals[this.currentIndex].Reset();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Update the current interval\n\t\t\t\tfloat lastCriticalPoint = this.criticalPoints[this.currentIndex];\n\t\t\t\tfloat nextCriticalPoint = this.currentIndex >= maxIndex ? 1.0f : this.criticalPoints[this.currentIndex + 1];\n\t\t\t\tthis.intervals[this.currentIndex].UpdateInterval((x - lastCriticalPoint) / (nextCriticalPoint - lastCriticalPoint));\n\t\t\t}\n\t\t}\n\n\t\tpublic class Repeat : Interval\n\t\t{\n\t\t\tprivate Interval interval;\n\t\t\tprivate int count;\n\t\t\tprivate int index;\n\n\t\t\tpublic Repeat(Interval interval, int count)\n\t\t\t\t: base(interval.Duration * count)\n\t\t\t{\n\t\t\t\tthis.interval = interval;\n\t\t\t\tthis.count = count;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.interval.Reset();\n\t\t\t\tthis.Duration = this.interval.Duration;\n\t\t\t\tthis.index = 0;\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tfloat d = x / (1.0f / this.count);\n\t\t\t\tint newIndex = (int)Math.Floor(d);\n\t\t\t\tif (newIndex != this.index)\n\t\t\t\t\tthis.interval.Reset();\n\t\t\t\tthis.index = newIndex;\n\t\t\t\tthis.interval.UpdateInterval(d - newIndex);\n\t\t\t}\n\t\t}\n\n\t\tpublic class Reverse : Interval\n\t\t{\n\t\t\tprivate Interval interval;\n\n\t\t\tpublic Reverse(Interval interval)\n\t\t\t\t: base(interval.Duration)\n\t\t\t{\n\t\t\t\tthis.interval = interval;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.interval.Reset();\n\t\t\t\tthis.Duration = this.interval.Duration;\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.interval.UpdateInterval(1.0f - x);\n\t\t\t}\n\t\t}\n\n\t\tpublic class Speed : Interval\n\t\t{\n\t\t\tprivate Interval interval;\n\t\t\tprivate float speed;\n\n\t\t\tpublic Speed(Interval interval, float speed)\n\t\t\t\t: base(interval.Duration / speed)\n\t\t\t{\n\t\t\t\tthis.interval = interval;\n\t\t\t\tthis.speed = speed;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.interval.Reset();\n\t\t\t\tthis.Duration = this.interval.Duration;\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tthis.interval.UpdateInterval(x);\n\t\t\t}\n\t\t}\n\n\t\tpublic class Ease : Interval\n\t\t{\n\t\t\tpublic enum EaseType\n\t\t\t{\n\t\t\t\tNone,\n\t\t\t\tLinear,\n\t\t\t\tInQuadratic,\n\t\t\t\tOutQuadratic,\n\t\t\t\tInOutQuadratic,\n\t\t\t\tInCubic,\n\t\t\t\tOutCubic,\n\t\t\t\tInOutCubic,\n\t\t\t\tInSin,\n\t\t\t\tOutSin,\n\t\t\t\tInOutSin,\n\t\t\t\tInExponential,\n\t\t\t\tOutExponential,\n\t\t\t\tInOutExponential,\n\t\t\t}\n\n\t\t\tprivate Interval interval;\n\t\t\tprivate EaseType _easeType;\n\t\t\t\n\t\t\tpublic Ease(Interval interval, EaseType _easeType = EaseType.InQuadratic)\n\t\t\t\t: base(interval.Duration)\n\t\t\t{\n\t\t\t\tthis.interval = interval;\n\t\t\t\tthis._easeType = _easeType;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tbase.Reset();\n\t\t\t\tthis.interval.Reset();\n\t\t\t\tthis.Duration = this.interval.Duration;\n\t\t\t}\n\n\t\t\tpublic override void UpdateInterval(float x)\n\t\t\t{\n\t\t\t\tswitch (this._easeType)\n\t\t\t\t{\n\t\t\t\t\tcase EaseType.None:\n\t\t\t\t\t\tthis.interval.UpdateInterval(x < 1.0f ? 0.0f : 1.0f);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.Linear:\n\t\t\t\t\t\tthis.interval.UpdateInterval(x);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.InQuadratic:\n\t\t\t\t\t\tthis.interval.UpdateInterval(x * x);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.OutQuadratic:\n\t\t\t\t\t\tthis.interval.UpdateInterval(-1 * x * (x - 2));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.InOutQuadratic:\n\t\t\t\t\t\tx *= 2;\n\t\t\t\t\t\tif (x < 1)\n\t\t\t\t\t\t\tthis.interval.UpdateInterval(0.5f * x * x);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\tthis.interval.UpdateInterval(-0.5f * (x * (x - 2) - 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.InCubic:\n\t\t\t\t\t\tthis.interval.UpdateInterval(x * x * x);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.OutCubic:\n\t\t\t\t\t\tx--;\n\t\t\t\t\t\tthis.interval.UpdateInterval(x * x * x + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.InOutCubic:\n\t\t\t\t\t\tx *= 2;\n\t\t\t\t\t\tif (x < 1)\n\t\t\t\t\t\t\tthis.interval.UpdateInterval(0.5f * x * x * x);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tx -= 2;\n\t\t\t\t\t\t\tthis.interval.UpdateInterval(0.5f * (x * x * x + 2));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.InSin:\n\t\t\t\t\t\tthis.interval.UpdateInterval((float)-Math.Cos(x * Math.PI * 0.5) + 1.0f);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.OutSin:\n\t\t\t\t\t\tthis.interval.UpdateInterval((float)Math.Sin(x * Math.PI * 0.5));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.InOutSin:\n\t\t\t\t\t\tthis.interval.UpdateInterval(-0.5f * ((float)Math.Cos(Math.PI * x) - 1.0f));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.InExponential:\n\t\t\t\t\t\tthis.interval.UpdateInterval((float)Math.Pow(2, 10 * (x - 1.0)));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.OutExponential:\n\t\t\t\t\t\tthis.interval.UpdateInterval((float)-Math.Pow(2, -10 * x) + 1.0f);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EaseType.InOutExponential:\n\t\t\t\t\t\tx *= 2;\n\t\t\t\t\t\tif (x < 1)\n\t\t\t\t\t\t\tthis.interval.UpdateInterval(0.5f * (float)Math.Pow(2, 10 * (x - 1)));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\tthis.interval.UpdateInterval(0.5f * ((float)-Math.Pow(2, -10 * x) + 2));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic class RepeatForever : Base\n\t\t{\n\t\t\tprivate Interval interval;\n\t\t\tprivate float time;\n\n\t\t\tpublic RepeatForever(Interval interval)\n\t\t\t{\n\t\t\t\tthis.interval = interval;\n\t\t\t}\n\n\t\t\tpublic override void Reset()\n\t\t\t{\n\t\t\t\tthis.interval.Reset();\n\t\t\t\tthis.time = 0.0f;\n\t\t\t}\n\n\t\t\tpublic sealed override void Update(float dt)\n\t\t\t{\n\t\t\t\tif (this.time > this.interval.Duration)\n\t\t\t\t{\n\t\t\t\t\tthis.interval.Reset();\n\t\t\t\t\tthis.time = 0.0f;\n\t\t\t\t}\n\t\t\t\tthis.time += dt;\n\t\t\t\tthis.interval.UpdateInterval(this.interval.Duration == 0.0f ? 1.0f : this.time / this.interval.Duration);\n\t\t\t}\n\t\t}\n\n\t\tprivate Base action;\n\t\tpublic float RunTime { get; private set; }\n\n\t\tpublic override Entity Entity\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn base.Entity;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tbase.Entity = value;\n\n\t\t\t\t// By default, animations that are attached to entities will pause when the game pauses.\n\t\t\t\t// Other animations, like for the pause menu UI, will continue.\n\t\t\t\tthis.EnabledWhenPaused = false;\n\t\t\t}\n\t\t}\n\n\t\tpublic Base Action\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.action;\n\t\t\t}\n\t\t}\n\n\t\tpublic Animation(Base action)\n\t\t{\n\t\t\tthis.Serialize = false;\n\t\t\tthis.action = action;\n\t\t\tthis.action.Reset();\n\t\t}\n\n\t\tpublic Animation(params Interval[] intervals)\n\t\t\t: this((Base)(intervals.Length == 1 ? intervals[0] : new Sequence(intervals)))\n\t\t{\n\n\t\t}\n\n\t\tvoid IUpdateableComponent.Update(float dt)\n\t\t{\n\t\t\tif (this.action.Done)\n\t\t\t\tthis.Delete.Execute();\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.RunTime += dt;\n\t\t\t\tthis.action.Update(dt);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Block.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Block : Component<Main>\n\t{\n\t\tpublic Property<Voxel.t> StateId = new Property<Voxel.t>();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/BlockCloud.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class BlockCloud : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic ListProperty<Entity.Handle> Blocks = new ListProperty<Entity.Handle>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\n\t\tpublic Property<Vector3> AveragePosition = new Property<Vector3>();\n\n\t\tpublic Property<Voxel.t> Type = new Property<Voxel.t>();\n\n\t\tprivate List<PhysicsBlock> blocks = new List<PhysicsBlock>();\n\n\t\tpublic Property<float> Scale = new Property<float> { Value = 1.0f };\n\n\t\tpublic const int TotalBlocks = 30;\n\n\t\tprivate static Random random = new Random();\n\n\t\tprivate Noise3D noise = new Noise3D();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Clear = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command<BEPUphysics.BroadPhaseEntries.Collidable, BEPUphysics.NarrowPhaseSystems.Pairs.ContactCollection> Collided = new Command<BEPUphysics.BroadPhaseEntries.Collidable, BEPUphysics.NarrowPhaseSystems.Pairs.ContactCollection>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Clear.Action = this.clear;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.EnabledInEditMode = false;\n\t\t}\n\n\t\tprivate bool active = true;\n\t\tprivate void clear()\n\t\t{\n\t\t\tfor (int i = 0; i < this.Blocks.Count; i++)\n\t\t\t{\n\t\t\t\tEntity e = this.Blocks[i];\n\t\t\t\tif (e != null)\n\t\t\t\t\te.Delete.Execute();\n\t\t\t}\n\t\t\tthis.Blocks.Clear();\n\t\t\tthis.active = false;\n\t\t}\n\n\t\tvoid Blocks_Cleared()\n\t\t{\n\t\t\tthis.blocks.Clear();\n\t\t}\n\n\t\tvoid Blocks_ItemChanged(int index, Entity.Handle old, Entity.Handle newValue)\n\t\t{\n\t\t\tPhysicsBlock block = newValue.Target.Get<PhysicsBlock>();\n\t\t\tblock.Add(new CommandBinding<BEPUphysics.BroadPhaseEntries.Collidable, BEPUphysics.NarrowPhaseSystems.Pairs.ContactCollection>(block.Collided, this.Collided));\n\t\t\tthis.blocks[index] = block;\n\t\t}\n\n\t\tvoid Blocks_ItemAdded(int index, Entity.Handle e)\n\t\t{\n\t\t\tPhysicsBlock block = e.Target.Get<PhysicsBlock>();\n\t\t\tblock.Add(new CommandBinding<BEPUphysics.BroadPhaseEntries.Collidable, BEPUphysics.NarrowPhaseSystems.Pairs.ContactCollection>(block.Collided, this.Collided));\n\t\t\tthis.blocks.Add(block);\n\t\t}\n\n\t\tvoid Blocks_ItemRemoved(int index, Entity.Handle t)\n\t\t{\n\t\t\tthis.blocks.RemoveAt(index);\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tthis.Blocks.ItemAdded -= this.Blocks_ItemAdded;\n\t\t\tthis.Blocks.ItemRemoved -= this.Blocks_ItemRemoved;\n\t\t\tthis.Blocks.ItemChanged -= this.Blocks_ItemChanged;\n\t\t\tthis.Blocks.Cleared -= this.Blocks_Cleared;\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (!main.EditorEnabled)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Blocks.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tEntity e = this.Blocks[i];\n\t\t\t\t\tif (e == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Blocks.RemoveAt(i);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.Blocks_ItemAdded(i, e);\n\t\t\t\t}\n\t\t\t\tthis.Blocks.ItemAdded += this.Blocks_ItemAdded;\n\t\t\t\tthis.Blocks.ItemRemoved += this.Blocks_ItemRemoved;\n\t\t\t\tthis.Blocks.ItemChanged += this.Blocks_ItemChanged;\n\t\t\t\tthis.Blocks.Cleared += this.Blocks_Cleared;\n\t\t\t}\n\t\t}\n\n\t\tprivate const float forceMultiplier = 0.15f;\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.active)\n\t\t\t{\n\t\t\t\tif (this.Type.Value != Voxel.t.Empty && this.Blocks.Length == 0)\n\t\t\t\t{\n\t\t\t\t\tSceneryBlockFactory factory = Factory.Get<SceneryBlockFactory>();\n\t\t\t\t\tVector3 blockSpawnPoint = this.Position;\n\t\t\t\t\tfor (int i = 0; i < TotalBlocks; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tEntity block = factory.CreateAndBind(main);\n\t\t\t\t\t\tblock.Get<Transform>().Position.Value = blockSpawnPoint + new Vector3(((float)BlockCloud.random.NextDouble() - 0.5f) * 2.0f, ((float)BlockCloud.random.NextDouble() - 0.5f) * 2.0f, ((float)BlockCloud.random.NextDouble() - 0.5f) * 2.0f);\n\t\t\t\t\t\tSceneryBlock sceneryBlock = block.Get<SceneryBlock>();\n\t\t\t\t\t\tsceneryBlock.Type.Value = this.Type;\n\t\t\t\t\t\tsceneryBlock.Scale.Value = this.Scale;\n\t\t\t\t\t\tblock.Get<PhysicsBlock>().Box.LinearDamping = 0.75f;\n\t\t\t\t\t\tthis.Blocks.Add(block);\n\t\t\t\t\t\tmain.Add(block);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tVector3 avg = Vector3.Zero;\n\t\t\t\tfor (int i = 0; i < this.blocks.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tPhysicsBlock block = this.blocks[i];\n\t\t\t\t\tif (block.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!block.Suspended)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVector3 toCenter = this.Position - block.Box.Position;\n\t\t\t\t\t\t\tif (toCenter.Length() > 20.0f)\n\t\t\t\t\t\t\t\tblock.Box.Position = this.Position + Vector3.Normalize(toCenter) * -20.0f;\n\n\t\t\t\t\t\t\tfloat offset = i + this.main.TotalTime;\n\t\t\t\t\t\t\tVector3 force = toCenter + new Vector3(this.noise.Sample(new Vector3(offset)), this.noise.Sample(new Vector3(offset + 64)), noise.Sample(new Vector3(offset + 128))) * 10.0f * this.Scale;\n\t\t\t\t\t\t\tforce *= main.ElapsedTime * forceMultiplier / this.Scale;\n\t\t\t\t\t\t\tblock.Box.ApplyLinearImpulse(ref force);\n\n\t\t\t\t\t\t\tavg += block.Box.Position;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Blocks.RemoveAt(i);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tavg /= this.blocks.Count;\n\t\t\t\tthis.AveragePosition.Value = avg;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Bouncer.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing BEPUphysics;\nusing BEPUphysics.Constraints.SolverGroups;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Paths.PathFollowing;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Bouncer : Component<Main>, IUpdateableComponent\n\t{\n\t\t[XmlIgnore]\n\t\tpublic Command<float, float> PhysicsUpdated = new Command<float, float>(); // mass and volume\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Entity.Handle> Parent = new Property<Entity.Handle>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Voxel.Coord> Coord = new Property<Voxel.Coord>();\n\n\t\tprivate NoRotationJoint joint = null;\n\t\tprivate EntityMover mover = null;\n\n\t\tprivate void physicsUpdated(float mass, float volume)\n\t\t{\n\t\t\tif (this.mover != null)\n\t\t\t{\n\t\t\t\tfloat density = mass / volume;\n\t\t\t\tthis.mover.LinearMotor.Settings.Servo.SpringSettings.StiffnessConstant = 200.0f * density;\n\t\t\t\tthis.mover.LinearMotor.Settings.Servo.SpringSettings.DampingConstant = 7.0f * density;\n\t\t\t}\n\t\t}\n\n\t\tpublic ISpaceObject CreateJoint(BEPUphysics.Entities.Entity entity1, BEPUphysics.Entities.Entity entity2, Vector3 pos, Vector3 direction, Vector3 anchor)\n\t\t{\n\t\t\t// entity1 is us\n\t\t\t// entity2 is the main map we are attaching to\n\t\t\tVector3 originalPos = entity1.Position;\n\t\t\tentity1.Position = pos;\n\t\t\tthis.joint = new NoRotationJoint(entity2, entity1);\n\t\t\tentity1.Position = originalPos;\n\t\t\tif (this.mover != null && this.mover.Space != null)\n\t\t\t\tthis.main.Space.Remove(this.mover);\n\t\t\tthis.mover = new EntityMover(entity1);\n\t\t\tthis.main.Space.Add(this.mover);\n\t\t\tthis.physicsUpdated(entity1.Mass, entity1.Volume);\n\t\t\treturn this.joint;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new CommandBinding<float, float>(this.PhysicsUpdated, this.physicsUpdated));\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.mover != null)\n\t\t\t{\n\t\t\t\tEntity parentEntity = this.Parent.Value.Target;\n\t\t\t\tif (parentEntity != null && parentEntity.Active)\n\t\t\t\t{\n\t\t\t\t\tVoxel parentMap = parentEntity.Get<Voxel>();\n\t\t\t\t\tVoxel.Coord coord = this.Coord;\n\t\t\t\t\tthis.mover.TargetPosition = parentMap.GetAbsolutePosition(new Vector3(coord.X + 1.0f, coord.Y + 1.0f, coord.Z + 1.0f));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (this.mover != null && this.mover.Space != null)\n\t\t\t\t\t\tthis.main.Space.Remove(this.mover);\n\t\t\t\t\tthis.mover = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/CameraStop.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class CameraStop : Component<Main>\n\t{\n\t\tpublic static Property<bool> CinematicActive = new Property<bool>();\n\n\t\tpublic Property<float> Offset = new Property<float>();\n\n\t\tpublic Property<Entity.Handle> Next = new Property<Entity.Handle>();\n\n\t\tpublic Property<Animation.Ease.EaseType> Blend = new Property<Animation.Ease.EaseType>();\n\n\t\tpublic Property<float> Duration = new Property<float>();\n\n\t\tpublic Property<float> FieldOfView = new Property<float> { Value = 80.0f };\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnDone = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Go = new Command();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Go.Action = (Action)this.animate;\n\t\t}\n\n\t\tprivate void animate()\n\t\t{\n\t\t\tAnimation.Sequence sequence = new Animation.Sequence();\n\n\t\t\tbool originalCanPause = false;\n\t\t\tsequence.Add(new Animation.Execute(delegate()\n\t\t\t{\n\t\t\t\tEntity p = PlayerFactory.Instance;\n\t\t\t\tif (p != null)\n\t\t\t\t{\n\t\t\t\t\tp.Get<Model>(\"FirstPersonModel\").Enabled.Value = false;\n\t\t\t\t\tp.Get<Model>(\"Model\").Enabled.Value = false;\n\t\t\t\t\tp.Get<CameraController>().Enabled.Value = false;\n\t\t\t\t\tp.Get<FPSInput>().Enabled.Value = false;\n\t\t\t\t\tp.Get<UIRenderer>(\"UI\").Enabled.Value = false;\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_PLAYER_BREATHING_SOFT, p);\n\t\t\t\t}\n\t\t\t\tCameraStop.CinematicActive.Value = true;\n\t\t\t\toriginalCanPause = this.main.Menu.CanPause;\n#if !DEVELOPMENT\n\t\t\t\tthis.main.Menu.CanPause.Value = false;\n#endif\n\t\t\t}));\n\n\t\t\tsequence.Add(new Animation.Set<Matrix>(this.main.Camera.RotationMatrix, Matrix.CreateFromQuaternion(this.Entity.Get<Transform>().Quaternion)));\n\t\t\tsequence.Add(new Animation.Set<Vector3>(this.main.Camera.Position, Vector3.Transform(new Vector3(0, 0, this.Offset), this.Entity.Get<Transform>().Matrix)));\n\n\t\t\tAnimation.Ease.EaseType lastEase = Animation.Ease.EaseType.None;\n\t\t\tBSpline spline = null;\n\t\t\tEntity current = this.Entity;\n\t\t\tfloat totalDuration = 0.0f;\n\t\t\twhile (current != null)\n\t\t\t{\n\t\t\t\tCameraStop currentStop = current.Get<CameraStop>();\n\t\t\t\tTransform currentTransform = current.Get<Transform>();\n\n\t\t\t\tEntity next = currentStop.Next.Value.Target;\n\t\t\t\tCameraStop nextStop = next == null ? null : next.Get<CameraStop>();\n\n\t\t\t\tif (!lastEase.BlendsInto(currentStop.Blend) || next == null)\n\t\t\t\t{\n\t\t\t\t\tif (spline != null)\n\t\t\t\t\t\tspline.Add(currentTransform.Position, currentTransform.Quaternion, currentStop.Offset, currentStop.FieldOfView);\n\t\t\t\t\tspline = new BSpline();\n\t\t\t\t}\n\n\t\t\t\tfloat currentTime = spline.Duration;\n\t\t\t\tspline.Duration += currentStop.Duration;\n\t\t\t\ttotalDuration += currentStop.Duration;\n\n\t\t\t\tif (currentStop.Blend != Animation.Ease.EaseType.None && next != null)\n\t\t\t\t{\n\t\t\t\t\tBSpline currentSpline = spline;\n\t\t\t\t\tcurrentSpline.Add(currentTransform.Position, currentTransform.Quaternion, currentStop.Offset, currentStop.FieldOfView);\n\t\t\t\t\tTransform nextTransform = next.Get<Transform>();\n\t\t\t\t\tsequence.Add\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Ease\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew Animation.Custom\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tdelegate(float x)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfloat lerpValue = (currentTime + x * currentStop.Duration) / currentSpline.Duration;\n\t\t\t\t\t\t\t\t\tBSpline.ControlPoint point = currentSpline.Evaluate(lerpValue);\n\t\t\t\t\t\t\t\t\tMatrix rotationMatrix = Matrix.CreateFromQuaternion(point.Orientation);\n\t\t\t\t\t\t\t\t\tthis.main.Camera.FieldOfView.Value = MathHelper.Clamp(point.FieldOfView, 0.01f, (float)Math.PI * 0.99f);\n\t\t\t\t\t\t\t\t\tthis.main.Camera.RotationMatrix.Value = rotationMatrix;\n\t\t\t\t\t\t\t\t\tMatrix m = rotationMatrix * Matrix.CreateTranslation(point.Position);\n\t\t\t\t\t\t\t\t\tthis.main.Camera.Position.Value = Vector3.Transform(new Vector3(0, 0, point.Offset), m);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tcurrentStop.Duration\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tcurrentStop.Blend\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsequence.Add\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Custom\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tdelegate(float x)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.main.Camera.RotationMatrix.Value = Matrix.CreateFromQuaternion(currentTransform.Quaternion);\n\t\t\t\t\t\t\t\tthis.main.Camera.Position.Value = Vector3.Transform(new Vector3(0, 0, currentStop.Offset), currentTransform.Matrix);\n\t\t\t\t\t\t\t\tthis.main.Camera.FieldOfView.Value = MathHelper.ToRadians(currentStop.FieldOfView);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcurrentStop.Duration\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tsequence.Add(new Animation.Execute(currentStop.OnDone));\n\n\t\t\t\tlastEase = currentStop.Blend;\n\t\t\t\tcurrent = next;\n\t\t\t}\n\n\t\t\tAction done = delegate()\n\t\t\t{\n\t\t\t\tEntity p = PlayerFactory.Instance;\n\t\t\t\tif (p != null)\n\t\t\t\t{\n\t\t\t\t\tp.Get<Model>(\"FirstPersonModel\").Enabled.Value = true;\n\t\t\t\t\tp.Get<Model>(\"Model\").Enabled.Value = true;\n\t\t\t\t\tp.Get<CameraController>().Enabled.Value = true;\n\t\t\t\t\tp.Get<FPSInput>().Enabled.Value = true;\n\t\t\t\t\tp.Get<UIRenderer>(\"UI\").Enabled.Value = true;\n\t\t\t\t}\n\t\t\t\tthis.main.Camera.FieldOfView.Value = this.main.Settings.FieldOfView;\n\t\t\t\tCameraStop.CinematicActive.Value = false;\n\t\t\t\tthis.main.Menu.CanPause.Value = originalCanPause;\n\t\t\t};\n\n\t\t\tAnimation anim;\n\t\t\tif (PlayerFactory.Instance != null && totalDuration > 0.0f) // Fade in and out\n\t\t\t{\n\t\t\t\tanim = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector3MoveTo(this.main.Renderer.Tint, Vector3.Zero, 0.5f),\n\t\t\t\t\tnew Animation.Parallel(sequence, new Animation.Vector3MoveTo(this.main.Renderer.Tint, Vector3.One, 0.5f)),\n\t\t\t\t\tnew Animation.Vector3MoveTo(this.main.Renderer.Tint, Vector3.Zero, 0.5f),\n\t\t\t\t\tnew Animation.Execute(done),\n\t\t\t\t\tnew Animation.Vector3MoveTo(this.main.Renderer.Tint, Vector3.One, 0.5f)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Just do it\n\t\t\t\tanim = new Animation\n\t\t\t\t(\n\t\t\t\t\tsequence,\n\t\t\t\t\tnew Animation.Execute(done)\n\t\t\t\t);\n\t\t\t}\n\t\t\tanim.EnabledWhenPaused = false;\n\t\t\tWorldFactory.Instance.Add(anim);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Collectible.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nusing Lemma.Util;\nusing System.Xml.Serialization;\nusing Lemma.Factories;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Collectible : Component<Main>\n\t{\n\t\tpublic static List<Collectible> Collectibles = new List<Collectible>();\n\n\t\tconst int totalCollectibles = 49;\n\n\t\t[XmlIgnore]\n\t\tpublic Command PlayerTouched = new Command();\n\n\t\tpublic Property<bool> PickedUp = new Property<bool>(); \n\n\t\tpublic static int ActiveCount\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Collectible.Collectibles.Count(x => !x.PickedUp);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tCollectible.Collectibles.Add(this);\n\n\t\t\tthis.PlayerTouched.Action = delegate\n\t\t\t{\n\t\t\t\tif (!this.PickedUp)\n\t\t\t\t{\n\t\t\t\t\tthis.PickedUp.Value = true;\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_COLLECTIBLE, this.Entity);\n\t\t\t\t\tfloat originalGamma = main.Renderer.InternalGamma.Value;\n\t\t\t\t\tfloat originalBrightness = main.Renderer.Brightness.Value;\n\t\t\t\t\tthis.Entity.Add\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew Animation.FloatMoveTo(main.Renderer.InternalGamma, 10.0f, 0.2f),\n\t\t\t\t\t\t\tnew Animation.FloatMoveTo(main.Renderer.InternalGamma, originalGamma, 0.4f)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\tPlayerData playerData = PlayerDataFactory.Instance.Get<PlayerData>();\n\t\t\t\t\tplayerData.Collectibles.Value++;\n\t\t\t\t\tSteamWorker.SetStat(\"stat_orbs_collected\", playerData.Collectibles);\n\t\t\t\t\tif (SteamWorker.GetStat(\"stat_orbs_collected\") == playerData.Collectibles)\n\t\t\t\t\t\tSteamWorker.IndicateAchievementProgress(\"cheevo_orbs\", (uint)playerData.Collectibles.Value, (uint)totalCollectibles);\n\n\t\t\t\t\tint collected = Collectible.Collectibles.Count(x => x.PickedUp);\n\t\t\t\t\tint total = Collectible.Collectibles.Count;\n\n\t\t\t\t\tthis.main.Menu.HideMessage\n\t\t\t\t\t(\n\t\t\t\t\t\tWorldFactory.Instance,\n\t\t\t\t\t\tthis.main.Menu.ShowMessageFormat(WorldFactory.Instance, \"\\\\orbs collected\", collected, total),\n\t\t\t\t\t\t4.0f\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tCollectible.Collectibles.Remove(this);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Data.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Data : Component<Main>\n\t{\n\t\tprivate Dictionary<string, IProperty> properties = new Dictionary<string, IProperty>();\n\t\tprivate Dictionary<string, Command> commands = new Dictionary<string, Command>();\n\n\t\t[XmlArray(\"Properties\")]\n\t\t[XmlArrayItem(\"Property\", Type = typeof(DictionaryEntry))]\n\t\tpublic DictionaryEntry[] Properties\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.properties.Select(x => new DictionaryEntry(x.Key, x.Value)).ToArray();\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.properties.Clear();\n\t\t\t\tfor (int i = 0; i < value.Length; i++)\n\t\t\t\t\tthis.properties.Add((string)value[i].Key, (IProperty)value[i].Value);\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<T> Property<T>(string name, T defaultValue = default(T))\n\t\t{\n\t\t\tIProperty result;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t\tthis.properties[name] = result = new Property<T> { Value = defaultValue };\n\t\t\treturn (Property<T>)result;\n\t\t}\n\n\t\tpublic ListProperty<T> ListProperty<T>(string name)\n\t\t{\n\t\t\tIProperty result;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t\tthis.properties[name] = result = new ListProperty<T>();\n\t\t\treturn (ListProperty<T>)result;\n\t\t}\n\n\t\tpublic Command Command(string name)\n\t\t{\n\t\t\tCommand result;\n\t\t\tif (!this.commands.TryGetValue(name, out result))\n\t\t\t\tthis.commands[name] = result = new Command();\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/DialogueFile.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Lemma.IO;\nusing Lemma.Util;\n\nnamespace Lemma.Components\n{\n\tpublic class DialogueFile : Component<Main>\n\t{\n\t\tpublic Property<string> Name = new Property<string>();\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (!this.main.EditorEnabled && !string.IsNullOrEmpty(this.Name))\n\t\t\t{\n\t\t\t\tPhone phone = PlayerDataFactory.Instance.GetOrCreate<Phone>(\"Phone\");\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tDialogueForest forest = WorldFactory.Instance.Get<World>().DialogueForest;\n\t\t\t\t\tforest.Load(File.ReadAllText(Path.Combine(this.main.Content.RootDirectory, this.Name + \".dlz\")));\n#if DEBUG\n\t\t\t\t\tforest.Validate(this.main.Strings);\n#endif\n\t\t\t\t\tphone.Bind(forest);\n\t\t\t\t}\n\t\t\t\tcatch (IOException)\n\t\t\t\t{\n\t\t\t\t\tLog.d(\"Failed to load dialogue file: \" + this.Name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"Name\", this.Name, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(this.main, Path.Combine(this.main.Content.RootDirectory), new[] { MapLoader.MapDirectory }, \".dlz\"),\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/EffectBlock.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class EffectBlock : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic struct Entry\n\t\t{\n\t\t\tpublic Voxel Voxel;\n\t\t\tpublic Voxel.Coord Coordinate;\n\t\t}\n\n\t\tprivate static Dictionary<Entry, bool> animatingBlocks = new Dictionary<Entry, bool>();\n\n\t\tpublic static bool IsAnimating(Entry block)\n\t\t{\n\t\t\treturn EffectBlock.animatingBlocks.ContainsKey(block);\n\t\t}\n\n\t\tpublic bool DoScale = true;\n\t\tpublic Vector3 StartPosition;\n\t\tpublic Quaternion StartOrientation = Quaternion.Identity;\n\t\tpublic Entity.Handle TargetVoxel;\n\t\tpublic Voxel.Coord Coord;\n\t\tpublic Voxel.t StateId;\n\t\tpublic float Delay;\n\n\t\t// IO properties\n\t\tpublic Property<Vector3> Offset = new Property<Vector3>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> Transform = new Property<Matrix>();\n\n\t\tpublic float TotalLifetime;\n\t\tpublic float Lifetime;\n\n\t\tpublic bool CheckAdjacent;\n\n\t\tprivate static float lastSound;\n\t\tprivate static bool soundTimerSetup;\n\n\t\tprivate Entry entry = new Entry();\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\n\t\t\tthis.addEntry();\n\t\t\tthis.Add(new CommandBinding(this.Delete, delegate()\n\t\t\t{\n\t\t\t\tif (this.entry.Voxel != null)\n\t\t\t\t\tEffectBlock.animatingBlocks.Remove(this.entry);\n\t\t\t\tthis.entry.Voxel = null;\n\t\t\t}));\n\t\t\t\n\t\t\tEffectBlock.setupSoundTimer(main);\n\t\t}\n\n\t\tprivate static void setupSoundTimer(Main main)\n\t\t{\n\t\t\tif (!EffectBlock.soundTimerSetup)\n\t\t\t{\n\t\t\t\tEffectBlock.soundTimerSetup = true;\n\t\t\t\tnew CommandBinding<string>(main.LoadingMap, delegate(string map)\n\t\t\t\t{\n\t\t\t\t\tEffectBlock.lastSound = 0;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tprivate void addEntry()\n\t\t{\n\t\t\tEntity m = this.TargetVoxel.Target;\n\t\t\tthis.entry.Voxel = m != null ? m.Get<Voxel>() : null;\n\t\t\t\n\t\t\tif (this.entry.Voxel != null)\n\t\t\t{\n\t\t\t\tthis.entry.Coordinate = this.Coord;\n\t\t\t\tEffectBlock.animatingBlocks[this.entry] = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Setup(Entity map, Voxel.Coord c, Voxel.t s)\n\t\t{\n\t\t\tthis.TargetVoxel = map;\n\t\t\tthis.Coord = c;\n\t\t\tthis.StateId = s;\n\t\t\tthis.addEntry();\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.TargetVoxel.Target == null || !this.TargetVoxel.Target.Active)\n\t\t\t{\n\t\t\t\tthis.Delete.Execute();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.Lifetime += dt;\n\n\t\t\tif (this.Lifetime < this.Delay)\n\t\t\t\treturn;\n\n\t\t\tfloat blend = (this.Lifetime - this.Delay) / this.TotalLifetime;\n\n\t\t\tVoxel m = this.TargetVoxel.Target.Get<Voxel>();\n\n\t\t\tMatrix finalOrientation = m.Transform;\n\t\t\tfinalOrientation.Translation = Vector3.Zero;\n\t\t\tQuaternion finalQuat = Quaternion.CreateFromRotationMatrix(finalOrientation);\n\n\t\t\tVector3 finalPosition = m.GetAbsolutePosition(this.Coord);\n\n\t\t\tif (blend > 1.0f)\n\t\t\t{\n\t\t\t\tif (this.StateId != Voxel.t.Empty)\n\t\t\t\t{\n\t\t\t\t\tVoxel.Coord c = this.Coord;\n\n\t\t\t\t\tbool blue = this.StateId == Voxel.t.Blue;\n\t\t\t\t\tbool foundAdjacentCell = false;\n\t\t\t\t\tbool foundConflict = false;\n\t\t\t\t\tif (this.CheckAdjacent)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (Direction dir in DirectionExtensions.Directions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord adjacent = c.Move(dir);\n\t\t\t\t\t\t\tVoxel.t adjacentID = m[adjacent].ID;\n\t\t\t\t\t\t\tif (adjacentID != Voxel.t.Empty)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (blue && (adjacentID == Voxel.t.Infected || adjacentID == Voxel.t.HardInfected || adjacentID == Voxel.t.Slider || adjacentID == Voxel.t.SliderPowered || adjacentID == Voxel.t.SocketWhite || adjacentID == Voxel.t.SocketBlue || adjacentID == Voxel.t.SocketYellow))\n\t\t\t\t\t\t\t\t\tfoundConflict = true;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfoundAdjacentCell = true;\n\t\t\t\t\t\t\t\t\tif (blue)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (adjacentID == Voxel.t.Reset)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tthis.StateId = Voxel.t.Neutral;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (adjacentID == Voxel.t.Powered || adjacentID == Voxel.t.PermanentPowered || adjacentID == Voxel.t.PoweredSwitch || adjacentID == Voxel.t.HardPowered)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tthis.StateId = Voxel.t.Powered;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tfoundAdjacentCell = true;\n\n\t\t\t\t\tif (foundAdjacentCell)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 absolutePos = m.GetAbsolutePosition(c);\n\n\t\t\t\t\t\tif (blue && !Zone.CanBuild(absolutePos))\n\t\t\t\t\t\t\tfoundConflict = true;\n\n\t\t\t\t\t\tif (!foundConflict)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbool isDynamic = m.GetType() == typeof(DynamicVoxel);\n\t\t\t\t\t\t\tforeach (Voxel m2 in Voxel.ActivePhysicsVoxels)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbool atLeastOneDynamic = isDynamic || m2.GetType() == typeof(DynamicVoxel);\n\t\t\t\t\t\t\t\tif (m2 != m && atLeastOneDynamic && m2[absolutePos].ID != 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfoundConflict = true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!foundConflict)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.State state = m[this.Coord];\n\t\t\t\t\t\t\tif (state.Permanent || state.Hard || state.ID == this.StateId || (blue && state == Voxel.States.Powered))\n\t\t\t\t\t\t\t\tfoundConflict = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (state.ID != 0)\n\t\t\t\t\t\t\t\t\tm.Empty(this.Coord);\n\t\t\t\t\t\t\t\tm.Fill(this.Coord, Voxel.States.All[this.StateId]);\n\t\t\t\t\t\t\t\tm.Regenerate();\n\t\t\t\t\t\t\t\tif (this.main.TotalTime - EffectBlock.lastSound > 0.15f)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tEffectBlock.lastSound = this.main.TotalTime;\n\t\t\t\t\t\t\t\t\tSound.PostEvent(this.StateId == Voxel.t.Floater ? AK.EVENTS.PLAY_FLOATER_BUILD : AK.EVENTS.PLAY_BLOCK_BUILD, absolutePos);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.Entity.Delete.Execute();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// For one reason or another, we can't fill the cell\n\t\t\t\t\t// Animate nicely into oblivion\n\t\t\t\t\tthis.StateId = Voxel.t.Empty;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// For one reason or another, we can't fill the cell\n\t\t\t\t\t// Animate nicely into oblivion\n\t\t\t\t\tif (blend > 2.0f)\n\t\t\t\t\t\tthis.Delete.Execute();\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tMatrix result = Matrix.CreateFromQuaternion(finalQuat);\n\t\t\t\t\t\tfloat scale = 2.0f - blend;\n\t\t\t\t\t\tresult.Right *= scale;\n\t\t\t\t\t\tresult.Up *= scale;\n\t\t\t\t\t\tresult.Forward *= scale;\n\t\t\t\t\t\tresult.Translation = finalPosition;\n\t\t\t\t\t\tthis.Transform.Value = result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfloat scale;\n\t\t\t\tif (this.DoScale)\n\t\t\t\t\tscale = blend;\n\t\t\t\telse\n\t\t\t\t\tscale = 1.0f;\n\n\t\t\t\tfloat distance = (finalPosition - this.StartPosition).Length() * 0.1f * Math.Max(0.0f, 0.5f - Math.Abs(blend - 0.5f));\n\n\t\t\t\tMatrix result = Matrix.CreateFromQuaternion(Quaternion.Lerp(this.StartOrientation, finalQuat, blend));\n\t\t\t\tresult.Right *= scale;\n\t\t\t\tresult.Up *= scale;\n\t\t\t\tresult.Forward *= scale;\n\t\t\t\tresult.Translation = Vector3.Lerp(this.StartPosition, finalPosition, blend) + new Vector3((float)Math.Sin(blend * Math.PI) * distance);\n\t\t\t\tthis.Transform.Value = result;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/EnemyBase.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Factories;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class EnemyBase : Component<Main>\n\t{\n\t\tpublic Property<Matrix> Transform = new Property<Matrix>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<float> Offset = new Property<float> { Value = 4.0f };\n\t\tpublic Property<Entity.Handle> Voxel = new Property<Entity.Handle>();\n\t\tpublic ListProperty<Voxel.Box> BaseBoxes = new ListProperty<Voxel.Box>();\n\n\t\tprivate CommandBinding<IEnumerable<Voxel.Coord>, Voxel> cellEmptiedBinding;\n\n\t\tpublic bool EnableCellEmptyBinding\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.cellEmptiedBinding != null && this.cellEmptiedBinding.Enabled;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (this.cellEmptiedBinding != null)\n\t\t\t\t\tthis.cellEmptiedBinding.Enabled = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsValid\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tEntity mapEntity = this.Voxel.Value.Target;\n\t\t\t\tif (mapEntity == null || !mapEntity.Active)\n\t\t\t\t\treturn false;\n\n\t\t\t\tVoxel m = mapEntity.Get<Voxel>();\n\n\t\t\t\tbool found = false;\n\t\t\t\tList<Voxel.Box> boxRemovals = null;\n\t\t\t\tforeach (Voxel.Box box in this.BaseBoxes)\n\t\t\t\t{\n\t\t\t\t\tforeach (Voxel.Coord coord in box.GetCoords())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (m[coord].ID == Components.Voxel.t.HardInfected)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!found)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (boxRemovals == null)\n\t\t\t\t\t\t\tboxRemovals = new List<Voxel.Box>();\n\t\t\t\t\t\tboxRemovals.Add(box);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (boxRemovals != null)\n\t\t\t\t{\n\t\t\t\t\tforeach (Voxel.Box box in boxRemovals)\n\t\t\t\t\t\tthis.BaseBoxes.Remove(box);\n\t\t\t\t}\n\n\t\t\t\treturn found;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void AttachEditorComponents(Entity entity, Main main, Vector3 color)\n\t\t{\n\t\t\tProperty<float> offset = entity.Get<EnemyBase>().Offset;\n\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\cone\";\n\t\t\tmodel.Color.Value = color;\n\t\t\tmodel.IsInstanced.Value = false;\n\t\t\tmodel.Add(new Binding<Vector3, float>(model.Scale, x => new Vector3(1.0f, 1.0f, x), offset));\n\t\t\tmodel.Serialize = false;\n\n\t\t\tentity.Add(\"EditorModel2\", model);\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, entity.Get<EnemyBase>().Transform));\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new Binding<Vector3>(this.Position, () => Vector3.Transform(new Vector3(0.0f, 0.0f, this.Offset), this.Transform), this.Offset, this.Transform));\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tAction setupMap = delegate()\n\t\t\t\t{\n\t\t\t\t\tEntity entity = this.Voxel.Value.Target;\n\t\t\t\t\tif (entity == null || !entity.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Delete.Execute();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.cellEmptiedBinding != null)\n\t\t\t\t\t\t\tthis.Remove(this.cellEmptiedBinding);\n\t\t\t\t\t\tthis.cellEmptiedBinding = new CommandBinding<IEnumerable<Voxel.Coord>, Voxel>(entity.Get<Voxel>().CellsEmptied, delegate(IEnumerable<Voxel.Coord> coords, Voxel newMap)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!this.IsValid)\n\t\t\t\t\t\t\t\tthis.Delete.Execute();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.Add(this.cellEmptiedBinding);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis.Add(new NotifyBinding(setupMap, this.Voxel));\n\t\t\t\tif (this.Voxel.Value.Target != null)\n\t\t\t\t\tsetupMap();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (!this.main.EditorEnabled && (this.Voxel.Value.Target == null || !this.Voxel.Value.Target.Active))\n\t\t\t{\n\t\t\t\tthis.BaseBoxes.Clear();\n\n\t\t\t\tbool found = false;\n\t\t\t\tforeach (Voxel m in Lemma.Components.Voxel.Voxels)\n\t\t\t\t{\n\t\t\t\t\tVoxel.Box box = m.GetBox(this.Position);\n\t\t\t\t\tif (box != null && box.Type.ID == Components.Voxel.t.HardInfected)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (Voxel.Box b in m.GetContiguousByType(new[] { box }))\n\t\t\t\t\t\t\tthis.BaseBoxes.Add(b);\n\t\t\t\t\t\tthis.Voxel.Value = m.Entity;\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!found)\n\t\t\t\t\tthis.Delete.Execute();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Exploder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Exploder : Component<Main>\n\t{\n\t\tpublic ListProperty<Voxel.Coord> CoordQueue = new ListProperty<Voxel.Coord>();\n\n\t\tpublic Property<Voxel.Coord> ExplosionOriginalCoord = new Property<Voxel.Coord>();\n\n\t\tpublic Property<bool> Exploded = new Property<bool>();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Explosion.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing Lemma.Util;\nusing Lemma.Factories;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class Explosion : Component<Main>\n\t{\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Go = new Command();\n\n\t\tpublic Property<bool> DeleteAfter = new Property<bool> { Value = true };\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Go.Action = delegate()\n\t\t\t{\n\t\t\t\tExplosion.Explode(this.main, this.Position);\n\t\t\t\tif (this.DeleteAfter)\n\t\t\t\t\tthis.Delete.Execute();\n\t\t\t};\n\t\t}\n\n\t\tpublic static void Explode(Main main, Vector3 pos, int radius = 8, float physicsRadius = 12.0f)\n\t\t{\n\t\t\tExplosion.explode(main, null, new Voxel.Coord(), pos, radius, physicsRadius);\n\t\t}\n\n\t\tpublic static void Explode(Main main, Voxel map, Voxel.Coord coord, int radius = 8, float physicsRadius = 12.0f)\n\t\t{\n\t\t\tVector3 pos = map.GetAbsolutePosition(coord);\n\t\t\tExplosion.explode(main, map, coord, pos, radius, physicsRadius);\n\t\t}\n\n\t\tprivate static Random random = new Random();\n\n\t\tprivate static void explode(Main main, Voxel map, Voxel.Coord coord, Vector3 pos, int radius, float physicsRadius)\n\t\t{\n\t\t\tfloat distanceToCamera = (main.Camera.Position.Value - pos).Length();\n\t\t\t// Kaboom\n\t\t\tSound.PostEvent(distanceToCamera < physicsRadius * 1.5f ? AK.EVENTS.PLAY_EXPLOSION_CLOSE : AK.EVENTS.PLAY_EXPLOSION, pos);\n\n\t\t\tEntity lightEntity = Factory.Get<PointLightFactory>().CreateAndBind(main);\n\t\t\tlightEntity.Serialize = false;\n\t\t\tPointLight light = lightEntity.Get<PointLight>();\n\t\t\tlight.Color.Value = new Vector3(1.3f, 1.1f, 0.9f);\n\t\t\tlight.Attenuation.Value = 20.0f;\n\t\t\tlight.Position.Value = pos;\n\t\t\tlightEntity.Add(new Animation\n\t\t\t(\n\t\t\t\tnew Animation.FloatMoveTo(light.Attenuation, 0.0f, 1.0f),\n\t\t\t\tnew Animation.Execute(light.Delete)\n\t\t\t));\n\t\t\tmain.Add(lightEntity);\n\n\t\t\tSmokeFactory smokeFactory = Factory.Get<SmokeFactory>();\n\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t{\n\t\t\t\tEntity smoke = smokeFactory.CreateAndBind(main);\n\t\t\t\tsmoke.Get<Transform>().Position.Value = pos;\n\t\t\t\tmain.Add(smoke);\n\t\t\t}\n\n\t\t\tParticleEmitter.Emit(main, \"Smoke\", pos, physicsRadius * 0.4f, 250);\n\n\t\t\tEntity player = PlayerFactory.Instance;\n\t\t\tif (player != null && player.Active)\n\t\t\t\tplayer.Get<CameraController>().Shake.Execute(pos, 50.0f);\n\t\t\n\t\t\tconst float physicsImpulse = 70.0f;\n\t\t\tconst float minPlayerDamage = 0.1f;\n\t\t\tconst float playerDamageMultiplier = 2.0f;\n\t\t\n\t\t\t// Remove the cells\n\t\t\tBlockFactory blockFactory = Factory.Get<BlockFactory>();\n\t\t\t\n\t\t\tforeach (Voxel m in Voxel.ActiveVoxels.ToList())\n\t\t\t{\n\t\t\t\tList<Voxel.Coord> removals = new List<Voxel.Coord>();\n\t\t\t\n\t\t\t\tVoxel.Coord c = m.GetCoordinate(pos);\n\t\t\t\tVector3 relativePos = m.GetRelativePosition(c);\n\t\t\t\t\n\t\t\t\tQuaternion quat = m.Entity.Get<Transform>().Quaternion;\n\t\t\t\n\t\t\t\tfor (Voxel.Coord x = c.Move(Direction.NegativeX, radius - 1); x.X < c.X + radius; x.X++)\n\t\t\t\t{\n\t\t\t\t\tfor (Voxel.Coord y = x.Move(Direction.NegativeY, radius - 1); y.Y < c.Y + radius; y.Y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (Voxel.Coord z = y.Move(Direction.NegativeZ, radius - 1); z.Z < c.Z + radius; z.Z++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.State s = m[z];\n\t\t\t\t\t\t\tif (s.ID == 0 || s.Permanent)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tVector3 cellPos = m.GetRelativePosition(z);\n\t\t\t\t\t\t\tif ((cellPos - relativePos).Length() < radius - 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tremovals.Add(z);\n\t\t\t\t\t\t\t\tif (random.NextDouble() > 0.5)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tEntity block = blockFactory.CreateAndBind(main);\n\t\t\t\t\t\t\t\t\tTransform blockTransform = block.Get<Transform>();\n\t\t\t\t\t\t\t\t\tblockTransform.Position.Value = m.GetAbsolutePosition(cellPos);\n\t\t\t\t\t\t\t\t\tblockTransform.Quaternion.Value = Quaternion.CreateFromYawPitchRoll(((float)random.NextDouble() - 0.5f) * 2.0f * (float)Math.PI, ((float)random.NextDouble() - 0.5f) * 2.0f * (float)Math.PI, ((float)random.NextDouble() - 0.5f) * 2.0f * (float)Math.PI);\n\t\t\t\t\t\t\t\t\ts.ApplyToBlock(block);\n\t\t\t\t\t\t\t\t\tmain.Add(block);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (removals.Count > 0)\n\t\t\t\t{\n\t\t\t\t\tm.Empty(removals);\n\t\t\t\t\tm.Regenerate();\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t// Damage the player\n\t\t\tif (player != null && player.Active)\n\t\t\t{\n\t\t\t\tVector3 toPlayer = player.Get<Transform>().Position - pos;\n\t\t\t\tfloat d = toPlayer.Length();\n\t\t\t\tif (d < physicsRadius)\n\t\t\t\t{\n\t\t\t\t\tfloat attenuation = 1.0f;\n\t\t\t\t\tif (d > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.GlobalRaycast(pos, toPlayer / d, d, delegate(int x, Voxel.t c)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.State s = Voxel.States.All[c];\n\t\t\t\t\t\t\tif (s.Permanent)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tattenuation = 0.0f;\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (s.Hard)\n\t\t\t\t\t\t\t\tattenuation -= 0.6f;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tattenuation -= 0.35f;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tattenuation = Math.Max(0, attenuation);\n\t\t\t\t\t}\n\t\t\t\t\tplayer.Get<Agent>().Damage.Execute(attenuation * (minPlayerDamage + (1.0f - (d / physicsRadius)) * playerDamageMultiplier));\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t// Apply impulse to dynamic maps\n\t\t\tforeach (Voxel m in Voxel.ActiveVoxels)\n\t\t\t{\n\t\t\t\tDynamicVoxel dm = m as DynamicVoxel;\n\t\t\t\tif (dm == null)\n\t\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\tVector3 toMap = dm.Transform.Value.Translation - pos;\n\t\t\t\tfloat distanceToMap = toMap.Length();\n\t\t\t\ttoMap /= distanceToMap;\n\t\t\t\n\t\t\t\ttoMap *= Math.Max(0.0f, 1.0f - (distanceToMap / physicsRadius)) * Math.Min(200.0f, dm.PhysicsEntity.Mass) * physicsImpulse;\n\t\t\t\n\t\t\t\tdm.PhysicsEntity.ApplyImpulse(dm.Transform.Value.Translation + new Vector3(((float)random.NextDouble() - 0.5f) * 2.0f, ((float)random.NextDouble() - 0.5f) * 2.0f, ((float)random.NextDouble() - 0.5f) * 2.0f), toMap);\n\t\t\t}\n\t\t\n\t\t\t// Apply impulse to physics blocks\n\t\t\tforeach (Entity b in main.Get(\"Block\"))\n\t\t\t{\n\t\t\t\tPhysicsBlock block = b.Get<PhysicsBlock>();\n\t\t\t\tVector3 fromExplosion = b.Get<Transform>().Position.Value - pos;\n\t\t\t\tfloat distance = fromExplosion.Length();\n\t\t\t\tif (distance > 0.0f && distance < physicsRadius)\n\t\t\t\t{\n\t\t\t\t\tfloat blend = 1.0f - (distance / physicsRadius);\n\t\t\t\t\tblock.Box.LinearVelocity += fromExplosion * blend * 10.0f / distance;\n\t\t\t\t\tblock.Box.AngularVelocity += new Vector3(((float)random.NextDouble() - 0.5f) * 2.0f, ((float)random.NextDouble() - 0.5f) * 2.0f, ((float)random.NextDouble() - 0.5f) * 2.0f) * blend;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/FallingTower.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class FallingTower : Component<Main>, IUpdateableComponent\n\t{\n\t\t// Input properties\n\t\tpublic Property<bool> IsTriggered = new Property<bool>();\n\n\t\t// Settings\n\t\tpublic Property<float> TimeUntilRebuild = new Property<float>();\n\t\tpublic Property<float> TimeUntilRebuildComplete = new Property<float>();\n\n\t\tpublic ListProperty<Entity.Handle> DynamicVoxels = new ListProperty<Entity.Handle>();\n\n\t\tprivate const float RebuildDelay = 2.5f;\n\t\tprivate const float RebuildTime = 1.0f;\n\n\t\t[XmlIgnore]\n\t\tpublic EnemyBase Base;\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Entity.Handle> TargetVoxel = new Property<Entity.Handle>();\n\n\t\tconst float rebuildTimeMultiplier = 0.03f;\n\n\t\tprivate static Random random = new Random();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Fall = new Command();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Fall.Action = this.fall;\n\t\t}\n\n\t\tprivate void fall()\n\t\t{\n\t\t\tif (this.TimeUntilRebuild.Value > 0 || this.TimeUntilRebuildComplete.Value > 0)\n\t\t\t\treturn;\n\n\t\t\tEntity targetVoxel = this.TargetVoxel.Value.Target;\n\t\t\tif (targetVoxel == null || !targetVoxel.Active)\n\t\t\t\treturn;\n\n\t\t\t// Disable the cell-emptied notification.\n\t\t\t// This way, we won't think that the base has been destroyed by the player.\n\t\t\t// We are not in fact dying, we're just destroying the base so we can fall over.\n\t\t\tthis.Base.EnableCellEmptyBinding = false;\n\n\t\t\tVoxel m = targetVoxel.Get<Voxel>();\n\n\t\t\tm.Empty(this.Base.BaseBoxes.SelectMany(x => x.GetCoords()));\n\t\t\tVector3 basePosition = Vector3.Zero;\n\t\t\tint baseSize = 0;\n\t\t\tforeach (Voxel.Coord c in this.Base.BaseBoxes.SelectMany(x => x.GetCoords()))\n\t\t\t{\n\t\t\t\tParticleSystem shatter = ParticleSystem.Get(main, \"InfectedShatter\");\n\t\t\t\tVector3 pos = m.GetAbsolutePosition(c);\n\t\t\t\tfor (int i = 0; i < 50; i++)\n\t\t\t\t{\n\t\t\t\t\tVector3 offset = new Vector3((float)random.NextDouble() - 0.5f, (float)random.NextDouble() - 0.5f, (float)random.NextDouble() - 0.5f);\n\t\t\t\t\tshatter.AddParticle(pos + offset, offset);\n\t\t\t\t}\n\t\t\t\tbasePosition += pos;\n\t\t\t\tbaseSize++;\n\t\t\t}\n\t\t\tbasePosition /= (float)baseSize;\n\t\t\tSound.PostEvent(AK.EVENTS.PLAY_TOWER_FALL, basePosition);\n\n\t\t\tm.Regenerate(delegate(List<DynamicVoxel> spawnedMaps)\n\t\t\t{\n\t\t\t\tif (spawnedMaps.Count == 0)\n\t\t\t\t\tthis.Delete.Execute();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tVector3 playerPos = PlayerFactory.Instance.Get<Transform>().Position;\n\t\t\t\t\tplayerPos += PlayerFactory.Instance.Get<Player>().Character.LinearVelocity.Value * 0.65f;\n\t\t\t\t\tforeach (DynamicVoxel newMap in spawnedMaps)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMap.Dangerous.Value = true;\n\t\t\t\t\t\tVector3 toPlayer = playerPos - newMap.PhysicsEntity.Position;\n\t\t\t\t\t\ttoPlayer.Normalize();\n\t\t\t\t\t\tif (Math.Abs(toPlayer.Y) < 0.9f)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttoPlayer *= 25.0f * newMap.PhysicsEntity.Mass;\n\n\t\t\t\t\t\t\tVector3 positionAtPlayerHeight = newMap.PhysicsEntity.Position;\n\t\t\t\t\t\t\tVector3 impulseAtBase = toPlayer * -0.75f;\n\t\t\t\t\t\t\timpulseAtBase.Y = 0.0f;\n\t\t\t\t\t\t\tpositionAtPlayerHeight.Y = playerPos.Y;\n\t\t\t\t\t\t\tnewMap.PhysicsEntity.ApplyImpulse(ref positionAtPlayerHeight, ref impulseAtBase);\n\n\t\t\t\t\t\t\tnewMap.PhysicsEntity.ApplyLinearImpulse(ref toPlayer);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewMap.PhysicsEntity.Material.KineticFriction = 1.0f;\n\t\t\t\t\t\tnewMap.PhysicsEntity.Material.StaticFriction = 1.0f;\n\t\t\t\t\t\tthis.DynamicVoxels.Add(newMap.Entity);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.TimeUntilRebuild.Value = RebuildDelay;\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tforeach (Entity.Handle map in this.DynamicVoxels)\n\t\t\t{\n\t\t\t\tif (map.Target != null)\n\t\t\t\t{\n\t\t\t\t\tBEPUphysics.Entities.MorphableEntity e = map.Target.Get<DynamicVoxel>().PhysicsEntity;\n\t\t\t\t\te.Material.KineticFriction = 1.0f;\n\t\t\t\t\te.Material.StaticFriction = 1.0f;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.TimeUntilRebuild > 0)\n\t\t\t{\n\t\t\t\tif (this.TargetVoxel.Value.Target == null || !this.TargetVoxel.Value.Target.Active)\n\t\t\t\t{\n\t\t\t\t\tthis.Delete.Execute();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfloat newValue = Math.Max(0.0f, this.TimeUntilRebuild.Value - dt);\n\t\t\t\tthis.TimeUntilRebuild.Value = newValue;\n\t\t\t\tif (newValue == 0.0f)\n\t\t\t\t{\n\t\t\t\t\t// Rebuild\n\t\t\t\t\tEntity targetMap = this.TargetVoxel.Value.Target;\n\n\t\t\t\t\tVoxel m = targetMap.Get<Voxel>();\n\n\t\t\t\t\tEffectBlockFactory factory = Factory.Get<EffectBlockFactory>();\n\n\t\t\t\t\tint startIndex = this.Base.BaseBoxes.Sum(x => x.Volume);\n\t\t\t\t\tint index = startIndex;\n\n\t\t\t\t\tforeach (Entity.Handle e in this.DynamicVoxels)\n\t\t\t\t\t{\n\t\t\t\t\t\tEntity dynamicMap = e.Target;\n\t\t\t\t\t\tVoxel dynamicMapComponent = dynamicMap != null && dynamicMap.Active ? dynamicMap.Get<Voxel>() : null;\n\n\t\t\t\t\t\tif (dynamicMap == null || !dynamicMap.Active)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tQuaternion orientation = Quaternion.CreateFromRotationMatrix(dynamicMapComponent.Transform.Value);\n\n\t\t\t\t\t\tList<Voxel.Coord> coords = new List<Voxel.Coord>();\n\n\t\t\t\t\t\tforeach (Voxel.Coord c in dynamicMapComponent.Chunks.SelectMany(x => x.Boxes).SelectMany(x => x.GetCoords()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (m[c].ID == 0)\n\t\t\t\t\t\t\t\tcoords.Add(c);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach (Voxel.Coord c in coords.OrderBy(x => (new Vector3(x.X, x.Y, x.Z) - this.Base.Position).LengthSquared()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tEntity blockEntity = factory.CreateAndBind(main);\n\t\t\t\t\t\t\tc.Data.ApplyToEffectBlock(blockEntity.Get<ModelInstance>());\n\t\t\t\t\t\t\tEffectBlock effectBlock = blockEntity.Get<EffectBlock>();\n\t\t\t\t\t\t\teffectBlock.Offset.Value = m.GetRelativePosition(c);\n\t\t\t\t\t\t\teffectBlock.DoScale = dynamicMapComponent == null;\n\t\t\t\t\t\t\tif (dynamicMapComponent != null && dynamicMapComponent[c].ID == c.Data.ID)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\teffectBlock.StartPosition = dynamicMapComponent.GetAbsolutePosition(c);\n\t\t\t\t\t\t\t\teffectBlock.StartOrientation = orientation;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\teffectBlock.StartPosition = m.GetAbsolutePosition(c) + new Vector3(0.25f, 0.5f, 0.25f) * index;\n\t\t\t\t\t\t\t\teffectBlock.StartOrientation = Quaternion.CreateFromYawPitchRoll(0.15f * index, 0.15f * index, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\teffectBlock.TotalLifetime = 0.05f + (index * rebuildTimeMultiplier * RebuildTime);\n\t\t\t\t\t\t\teffectBlock.Setup(targetMap, c, c.Data.ID);\n\t\t\t\t\t\t\tmain.Add(blockEntity);\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdynamicMap.Delete.Execute();\n\t\t\t\t\t}\n\t\t\t\t\tthis.DynamicVoxels.Clear();\n\n\t\t\t\t\tif (index > startIndex) // We built some stuff. Build the base.\n\t\t\t\t\t{\n\t\t\t\t\t\tint baseIndex = 0;\n\t\t\t\t\t\tforeach (Voxel.Coord c in this.Base.BaseBoxes.SelectMany(x => x.GetCoords()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (m[c].ID == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tEntity blockEntity = factory.CreateAndBind(main);\n\t\t\t\t\t\t\t\tEffectBlock effectBlock = blockEntity.Get<EffectBlock>();\n\t\t\t\t\t\t\t\tc.Data.ApplyToEffectBlock(blockEntity.Get<ModelInstance>());\n\t\t\t\t\t\t\t\teffectBlock.Offset.Value = m.GetRelativePosition(c);\n\t\t\t\t\t\t\t\teffectBlock.StartPosition = m.GetAbsolutePosition(c) + new Vector3(0.25f, 0.5f, 0.25f) * baseIndex;\n\t\t\t\t\t\t\t\teffectBlock.StartOrientation = Quaternion.CreateFromYawPitchRoll(0.15f * baseIndex, 0.15f * baseIndex, 0);\n\t\t\t\t\t\t\t\teffectBlock.TotalLifetime = 0.05f + (baseIndex * rebuildTimeMultiplier * RebuildTime);\n\t\t\t\t\t\t\t\teffectBlock.Setup(targetMap, c, c.Data.ID);\n\t\t\t\t\t\t\t\tmain.Add(blockEntity);\n\t\t\t\t\t\t\t\tbaseIndex++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.TimeUntilRebuildComplete.Value = 0.05f + (index * rebuildTimeMultiplier * RebuildTime);\n\t\t\t\t\t}\n\t\t\t\t\telse // We didn't build anything. Delete ourselves.\n\t\t\t\t\t\tthis.Delete.Execute();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (this.TimeUntilRebuildComplete > 0)\n\t\t\t{\n\t\t\t\t// Rebuilding\n\t\t\t\tfloat newValue = Math.Max(0.0f, this.TimeUntilRebuildComplete.Value - dt);\n\t\t\t\tthis.TimeUntilRebuildComplete.Value = newValue;\n\t\t\t\tif (newValue == 0.0f)\n\t\t\t\t{\n\t\t\t\t\t// Done rebuilding\n\t\t\t\t\tif (!this.Base.IsValid)\n\t\t\t\t\t\tthis.Delete.Execute();\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Base.EnableCellEmptyBinding = !main.EditorEnabled;\n\t\t\t\t\t\tif (this.IsTriggered)\n\t\t\t\t\t\t\tfall();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/ImplodeBlock.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class ImplodeBlock : Component<Main>, IUpdateableComponent\n\t{\n\t\tprivate const float totalLifetimeIn = 0.4f;\n\t\tprivate const float totalLifetimeUp = 2.0f;\n\n\t\tpublic Rift.Style Type;\n\n\t\tpublic Voxel.t StateId;\n\t\tpublic float Lifetime;\n\t\tpublic bool DoScale;\n\t\tpublic Vector3 StartPosition;\n\t\tpublic Vector3 EndPosition;\n\t\tpublic Quaternion StartOrientation;\n\t\tpublic Quaternion EndOrientation;\n\n\t\tpublic Property<Matrix> Transform = new Property<Matrix>();\n\t\tpublic Property<Vector3> Offset = new Property<Vector3>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tthis.Lifetime += dt;\n\n\t\t\tfloat blend = this.Lifetime / (this.Type == Rift.Style.In ? totalLifetimeIn : totalLifetimeUp);\n\n\t\t\tif (blend > 1.0f)\n\t\t\t\tthis.Delete.Execute();\n\t\t\telse\n\t\t\t{\n\t\t\t\tMatrix result = Matrix.CreateFromQuaternion(Quaternion.Lerp(this.StartOrientation, this.EndOrientation, blend));\n\t\t\t\tfloat scale = 1.0f - blend;\n\t\t\t\tresult.Right *= scale;\n\t\t\t\tresult.Up *= scale;\n\t\t\t\tresult.Forward *= scale;\n\t\t\t\tresult.Translation = Vector3.Lerp(this.StartPosition, this.EndPosition, blend);\n\t\t\t\tthis.Transform.Value = result;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Joint.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Util;\n\nnamespace Lemma.Components\n{\n\tpublic class Joint : Component<Main>\n\t{\n\t\tpublic Property<Entity.Handle> Parent = new Property<Entity.Handle>();\n\t\tpublic Property<Voxel.Coord> Coord = new Property<Voxel.Coord>();\n\t\tpublic Property<Direction> Direction = new Property<Direction>();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Levitator.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Levitator : Component<Main>\n\t{\n\t\tpublic Property<Entity.Handle> LevitatingVoxel = new Property<Entity.Handle>();\n\t\tpublic Property<Voxel.Coord> GrabCoord = new Property<Voxel.Coord>();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/MapExit.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.IO;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class MapExit : Component<Main>\n\t{\n\t\tpublic Property<string> NextMap = new Property<string>();\n\t\tpublic Property<string> StartSpawnPoint = new Property<string>();\n\n\t\tpublic static List<MapExit> All = new List<MapExit>();\n\n\t\tpublic static MapExit Query(Vector3 pos, float radius)\n\t\t{\n\t\t\tforeach (MapExit e in MapExit.All)\n\t\t\t{\n\t\t\t\tif ((e.Entity.Get<Transform>().Position - pos).Length() < radius)\n\t\t\t\t\treturn e;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic void Go()\n\t\t{\n\t\t\tif (!string.IsNullOrEmpty(this.NextMap))\n\t\t\t\tMapLoader.Transition(main, this.NextMap, this.StartSpawnPoint);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tMapExit.All.Add(this);\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tMapExit.All.Remove(this);\n\t\t\tbase.delete();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Note.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Lemma.Util;\n\nnamespace Lemma.Components\n{\n\tpublic class Note : Component<Main>\n\t{\n\t\tpublic Property<string> Text = new Property<string>();\n\t\tpublic Property<string> Image = new Property<string>();\n\t\tpublic Property<bool> IsCollected = new Property<bool>();\n\n\t\tconst int totalNotes = 36;\n\n\t\tpublic static List<Note> Notes = new List<Note>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Collected = new Command();\n\n\t\tpublic static int UncollectedCount\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Note.Notes.Where(x => !x.IsCollected).Count();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tNote.Notes.Add(this);\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (this.IsCollected)\n\t\t\t\t{\n\t\t\t\t\tint notesCollected = Note.Notes.Where(x => x.IsCollected).Count();\n\t\t\t\t\tint total = Note.Notes.Count;\n\n\t\t\t\t\tContainer msg = this.main.Menu.ShowMessageFormat\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.Entity,\n\t\t\t\t\t\t\"\\\\notes read\",\n\t\t\t\t\t\tnotesCollected, total\n\t\t\t\t\t);\n\t\t\t\t\tthis.main.Menu.HideMessage(this.Entity, msg, 4.0f);\n\t\t\t\t\tthis.Collected.Execute();\n\t\t\t\t\tPlayerData playerData = PlayerDataFactory.Instance.Get<PlayerData>();\n\t\t\t\t\tplayerData.Notes.Value++;\n\t\t\t\t\tSteamWorker.SetStat(\"stat_notes_read\", playerData.Notes);\n\t\t\t\t\tif (SteamWorker.GetStat(\"stat_notes_read\") == playerData.Notes)\n\t\t\t\t\t\tSteamWorker.IndicateAchievementProgress(\"cheevo_notes\", (uint)playerData.Notes.Value, (uint)totalNotes);\n\t\t\t\t}\n\t\t\t}, this.IsCollected));\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tNote.Notes.Remove(this);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/PID.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class PID : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<float> Input = new Property<float>();\n\t\tpublic Property<float> Target = new Property<float>();\n\t\tpublic Property<float> Output = new Property<float>();\n\n\t\tpublic Property<float> P = new Property<float> { Value = 1.0f };\n\t\tpublic Property<float> I = new Property<float> { Value = 1.0f };\n\t\tpublic Property<float> D = new Property<float> { Value = 1.0f };\n\n\t\tpublic Property<float> PreviousError = new Property<float>();\n\t\tpublic Property<float> Integral = new Property<float>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tfloat error = this.Target - this.Input;\n\t\t\tthis.Integral.Value += error * dt;\n\t\t\tfloat derivative = (error - this.PreviousError) / dt;\n\t\t\tthis.Output.Value = (this.P * error) + (this.I * this.Integral) + (this.D * derivative);\n\t\t\tthis.PreviousError.Value = error;\n\t\t}\n\t}\n\n\tpublic class PID3 : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<Vector3> Input = new Property<Vector3>();\n\t\tpublic Property<Vector3> Target = new Property<Vector3>();\n\t\tpublic Property<Vector3> Output = new Property<Vector3>();\n\n\t\tpublic Property<float> P = new Property<float>();\n\t\tpublic Property<float> I = new Property<float>();\n\t\tpublic Property<float> D = new Property<float>();\n\n\t\tpublic Property<Vector3> PreviousError = new Property<Vector3>();\n\t\tpublic Property<Vector3> Integral = new Property<Vector3>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tVector3 error = this.Target.Value - this.Input;\n\t\t\tthis.Integral.Value += error * dt;\n\t\t\tVector3 derivative = (error - this.PreviousError) / dt;\n\t\t\tthis.Output.Value = (this.P * error) + (this.I * this.Integral.Value) + (this.D * derivative);\n\t\t\tthis.PreviousError.Value = error;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/ParticleWind.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma.Components\n{\n\tpublic class ParticleWind : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<float> KernelSpacing = new Property<float> { Value = 8.0f };\n\t\tpublic const int KernelSize = 10;\n\t\tpublic const float RaycastHeight = 30.0f;\n\t\tpublic const float RaycastInterval = 0.25f;\n\t\tpublic const float StartHeightMultiplier = 2.0f;\n\n\t\t[XmlIgnore]\n\t\tpublic float[,] RaycastDistances = new float[KernelSize, KernelSize];\n\n\t\tprivate float raycastTimer = RaycastInterval;\n\n\t\tprivate static Random random = new Random();\n\n\t\t// Input properties\n\t\tpublic Property<Quaternion> Orientation = new Property<Quaternion>();\n\t\tpublic Property<float> Speed = new Property<float>();\n\n\t\t// Output properties\n\t\tpublic Property<Vector3> Jitter = new Property<Vector3>();\n\t\tpublic Property<Vector3> KernelOffset = new Property<Vector3>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledInEditMode = true;\n\t\t\tthis.EnabledWhenPaused = false;\n\n\t\t\tthis.Add(new Binding<Vector3, float>(this.Jitter, x => new Vector3(x * KernelSize * 0.5f, x * KernelSize * 0.1f, x * KernelSize * 0.5f), this.KernelSpacing));\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tthis.raycastTimer += dt;\n\t\t\tif (this.raycastTimer > RaycastInterval)\n\t\t\t\tthis.Update();\n\t\t}\n\n\t\tpublic void Update()\n\t\t{\n\t\t\tthis.raycastTimer = 0.0f;\n\t\t\tthis.KernelOffset.Value = main.Camera.Position + Vector3.Transform(new Vector3(KernelSize * this.KernelSpacing * -0.5f, RaycastHeight + this.Speed * StartHeightMultiplier, KernelSize * this.KernelSpacing * -0.5f), this.Orientation);\n\t\t\tVector3 dir = Vector3.Transform(Vector3.Down, this.Orientation);\n\t\t\tfor (int x = 0; x < KernelSize; x++)\n\t\t\t{\n\t\t\t\tfor (int y = 0; y < KernelSize; y++)\n\t\t\t\t{\n\t\t\t\t\tVector3 pos = this.KernelOffset + Vector3.Transform(new Vector3(x * this.KernelSpacing, 0, y * this.KernelSpacing), this.Orientation);\n\t\t\t\t\tVoxel.GlobalRaycastResult raycast = Voxel.GlobalRaycast(pos, dir, (this.Speed * StartHeightMultiplier * 2.0f) + RaycastHeight, (index, type) => type != Voxel.t.Invisible);\n\t\t\t\t\tthis.RaycastDistances[x, y] = raycast.Voxel == null ? float.MaxValue : raycast.Distance - (RaycastHeight + this.KernelSpacing);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/PhysicsBlock.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.Entities.Prefabs;\nusing BEPUphysics;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests;\nusing System.Xml.Serialization;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class PhysicsBlock : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<Matrix> Transform = new Property<Matrix>();\n\t\tpublic Property<float> Mass = new Property<float> { Value = 0.25f };\n\t\tpublic Property<Vector3> Size = new Property<Vector3> { Value = new Vector3(0.5f) };\n\t\tpublic Property<bool> IsAffectedByGravity = new Property<bool> { Value = true };\n\n\t\t[XmlIgnore]\n\t\tpublic Command<Collidable, ContactCollection> Collided = new Command<Collidable, ContactCollection>();\n\t\t[XmlIgnore]\n\t\tpublic Box Box;\n\n\t\tpublic static void CancelPlayerCollisions(PhysicsBlock block)\n\t\t{\n\t\t\tblock.Box.CollisionInformation.CollisionRules.Group = Util.Character.NoCollideGroup;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tif (this.Mass == 0.0f)\n\t\t\t\tthis.Box = new Box(Vector3.Zero, this.Size.Value.X, this.Size.Value.Y, this.Size.Value.Z);\n\t\t\telse\n\t\t\t\tthis.Box = new Box(Vector3.Zero, this.Size.Value.X, this.Size.Value.Y, this.Size.Value.Z, this.Mass);\n\t\t\tthis.Box.Tag = this;\n\t\t\tthis.Box.CollisionInformation.Events.ContactCreated += new BEPUphysics.BroadPhaseEntries.Events.ContactCreatedEventHandler<EntityCollidable>(Events_ContactCreated);\n\t\t\tthis.Add(new SetBinding<Matrix>(this.Transform, delegate(Matrix matrix)\n\t\t\t{\n\t\t\t\tthis.Box.WorldTransform = matrix;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.Mass, delegate(float m)\n\t\t\t{\n\t\t\t\tthis.Box.Mass = m;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<bool>(this.IsAffectedByGravity, delegate(bool g)\n\t\t\t{\n\t\t\t\tthis.Box.IsAffectedByGravity = g;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<Vector3>(this.Size, delegate(Vector3 s)\n\t\t\t{\n\t\t\t\tthis.Box.Width = s.X;\n\t\t\t\tthis.Box.Height = s.Y;\n\t\t\t\tthis.Box.Length = s.Z;\n\t\t\t}));\n\n\t\t\tAction remove = delegate()\n\t\t\t{\n\t\t\t\tif (this.Box.Space != null)\n\t\t\t\t\tthis.main.Space.Remove(this.Box);\n\t\t\t};\n\t\t\tthis.Add(new CommandBinding(this.Disable, remove));\n\t\t\tthis.Add(new CommandBinding(this.OnSuspended, remove));\n\n\t\t\tif (!this.Enabled)\n\t\t\t\tremove();\n\n\t\t\tAction add = delegate()\n\t\t\t{\n\t\t\t\tthis.Box.LinearVelocity = Vector3.Zero;\n\t\t\t\tif (this.Box.Space == null && this.Enabled && !this.Suspended)\n\t\t\t\t\tthis.main.Space.Add(this.Box);\n\t\t\t};\n\t\t\tthis.Add(new CommandBinding(this.Enable, add));\n\t\t\tthis.Add(new CommandBinding(this.OnResumed, add));\n\n\t\t\tthis.main.Space.Add(this.Box);\n\t\t}\n\n\t\tvoid Events_ContactCreated(EntityCollidable sender, Collidable other, BEPUphysics.NarrowPhaseSystems.Pairs.CollidablePairHandler pair, ContactData contact)\n\t\t{\n\t\t\tthis.Collided.Execute(other, pair.Contacts);\n\t\t}\n\n\t\tvoid IUpdateableComponent.Update(float dt)\n\t\t{\n\t\t\tthis.Transform.Value = this.Box.WorldTransform;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tif (this.Box.Space != null)\n\t\t\t\tthis.main.Space.Remove(this.Box);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/PhysicsSphere.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.Entities.Prefabs;\nusing BEPUphysics;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.CollisionTests;\nusing System.Xml.Serialization;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class PhysicsSphere : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<Matrix> Transform = new Property<Matrix>();\n\t\tpublic Property<float> Mass = new Property<float> { Value = 0.25f };\n\t\tpublic Property<float> Radius = new Property<float> { Value = 0.5f };\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\t\tpublic Property<Vector3> AngularVelocity = new Property<Vector3>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command<Collidable, ContactCollection> Collided = new Command<Collidable, ContactCollection>();\n\t\t[XmlIgnore]\n\t\tpublic Sphere Sphere;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tif (this.Mass == 0.0f)\n\t\t\t\tthis.Sphere = new Sphere(Vector3.Zero, this.Radius);\n\t\t\telse\n\t\t\t\tthis.Sphere = new Sphere(Vector3.Zero, this.Radius, this.Mass);\n\t\t\tthis.Sphere.CollisionInformation.Events.ContactCreated += new BEPUphysics.BroadPhaseEntries.Events.ContactCreatedEventHandler<EntityCollidable>(Events_ContactCreated);\n\t\t\tthis.Sphere.CollisionInformation.CollisionRules.Group = Util.Character.NoCollideGroup;\n\t\t\tthis.Add(new SetBinding<Matrix>(this.Transform, delegate(Matrix value)\n\t\t\t{\n\t\t\t\tthis.Sphere.WorldTransform = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.Mass, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.Sphere.Mass = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<Vector3>(this.LinearVelocity, delegate(Vector3 value)\n\t\t\t{\n\t\t\t\tthis.Sphere.LinearVelocity = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<Vector3>(this.AngularVelocity, delegate(Vector3 value)\n\t\t\t{\n\t\t\t\tthis.Sphere.AngularVelocity = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.Radius, delegate(float s)\n\t\t\t{\n\t\t\t\tthis.Sphere.Radius = s;\n\t\t\t\tif (s < 0.5f)\n\t\t\t\t\tthis.Sphere.PositionUpdateMode = BEPUphysics.PositionUpdating.PositionUpdateMode.Continuous;\n\t\t\t\telse\n\t\t\t\t\tthis.Sphere.PositionUpdateMode = BEPUphysics.PositionUpdating.PositionUpdateMode.Discrete;\n\t\t\t}));\n\n\t\t\tAction remove = delegate()\n\t\t\t{\n\t\t\t\tif (this.Sphere.Space != null)\n\t\t\t\t\tthis.main.Space.Remove(this.Sphere);\n\t\t\t};\n\t\t\tthis.Add(new CommandBinding(this.Disable, remove));\n\t\t\tthis.Add(new CommandBinding(this.OnSuspended, remove));\n\n\t\t\tAction add = delegate()\n\t\t\t{\n\t\t\t\tthis.Sphere.LinearVelocity = Vector3.Zero;\n\t\t\t\tif (this.Sphere.Space == null && this.Enabled && !this.Suspended)\n\t\t\t\t\tthis.main.Space.Add(this.Sphere);\n\t\t\t};\n\t\t\tthis.Add(new CommandBinding(this.Enable, add));\n\t\t\tthis.Add(new CommandBinding(this.OnResumed, add));\n\n\t\t\tthis.main.Space.Add(this.Sphere);\n\t\t}\n\n\t\tvoid Events_ContactCreated(EntityCollidable sender, Collidable other, BEPUphysics.NarrowPhaseSystems.Pairs.CollidablePairHandler pair, ContactData contact)\n\t\t{\n\t\t\tthis.Collided.Execute(other, pair.Contacts);\n\t\t}\n\n\t\tvoid IUpdateableComponent.Update(float dt)\n\t\t{\n\t\t\tthis.Transform.Value = this.Sphere.WorldTransform;\n\t\t\tthis.LinearVelocity.Value = this.Sphere.LinearVelocity;\n\t\t\tthis.AngularVelocity.Value = this.Sphere.AngularVelocity;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tif (this.Sphere.Space != null)\n\t\t\t\tthis.main.Space.Remove(this.Sphere);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/PlayerCylinderTrigger.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nusing Lemma.Util;\nusing System.Xml.Serialization;\nusing Lemma.Factories;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class PlayerCylinderTrigger : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<float> Radius = new Property<float> { Value = 5.0f };\n\t\tpublic Property<float> Top = new Property<float> { Value = 10.0f };\n\t\tpublic Property<float> Bottom = new Property<float> { Value = 0.0f };\n\t\tpublic Property<Matrix> Transform = new Property<Matrix>();\n\t\tpublic Property<bool> IsTriggered = new Property<bool>();\n\t\tpublic Property<Entity.Handle> Player = new Property<Entity.Handle>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command PlayerEntered = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command PlayerExited = new Command();\n\n\t\tpublic PlayerCylinderTrigger()\n\t\t{\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new CommandBinding(this.Disable, delegate() { this.IsTriggered.Value = false; }));\n\t\t}\n\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"Radius\", this.Radius);\n\t\t\tthis.Entity.Add(\"Top\", this.Top);\n\t\t\tthis.Entity.Add(\"Bottom\", this.Bottom);\n\t\t}\n\n\t\tpublic void Update(float elapsedTime)\n\t\t{\n\t\t\tbool playerFound = false;\n\t\t\tEntity player = PlayerFactory.Instance;\n\t\t\tif (player != null)\n\t\t\t{\n\t\t\t\tVector3 pos = Vector3.Transform(player.Get<Transform>().Position, Matrix.Invert(this.Transform));\n\t\t\t\tif (pos.Y > this.Bottom && pos.Y < this.Top)\n\t\t\t\t{\n\t\t\t\t\tpos.Y = 0.0f;\n\t\t\t\t\tif (pos.Length() < this.Radius)\n\t\t\t\t\t{\n\t\t\t\t\t\tplayerFound = true;\n\t\t\t\t\t\tif (!this.IsTriggered)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.Player.Value = player;\n\t\t\t\t\t\t\tthis.IsTriggered.Value = true;\n\t\t\t\t\t\t\tthis.PlayerEntered.Execute();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!playerFound && this.IsTriggered)\n\t\t\t{\n\t\t\t\tthis.PlayerExited.Execute();\n\t\t\t\tthis.IsTriggered.Value = false;\n\t\t\t\tthis.Player.Value = null;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void AttachEditorComponents(Entity entity, Main main, Vector3 color)\n\t\t{\n\t\t\tPlayerCylinderTrigger trigger = entity.Get<PlayerCylinderTrigger>();\n\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\cylinder\";\n\t\t\tmodel.Alpha.Value = 0.15f;\n\t\t\tmodel.Color.Value = color;\n\t\t\tmodel.DisableCulling.Value = true;\n\t\t\tmodel.Add(new Binding<Vector3>(model.Scale, () => new Vector3(trigger.Radius * 2.0f, trigger.Top - trigger.Bottom, trigger.Radius * 2.0f), trigger.Top, trigger.Bottom, trigger.Radius));\n\t\t\tmodel.Serialize = false;\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, entity.EditorSelected));\n\n\t\t\tentity.Add(model);\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, () => Matrix.CreateTranslation(0.0f, (trigger.Top + trigger.Bottom) * 0.5f, 0.0f) * trigger.Transform, trigger.Transform, trigger.Top, trigger.Bottom));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/PlayerData.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Util;\n\nnamespace Lemma.Components\n{\n\tpublic class PlayerData : Component<Main>, IUpdateableComponent\n\t{\n\t\tprivate const bool enabled = true;\n\t\tpublic Property<bool> EnableRoll = new Property<bool> { Value = enabled };\n\t\tpublic Property<bool> EnableCrouch = new Property<bool> { Value = enabled };\n\t\tpublic Property<bool> EnableKick = new Property<bool> { Value = enabled };\n\t\tpublic Property<bool> EnableWallRun = new Property<bool> { Value = enabled };\n\t\tpublic Property<bool> EnableWallRunHorizontal = new Property<bool> { Value = enabled };\n\t\tpublic Property<bool> EnableEnhancedWallRun = new Property<bool> { Value = enabled };\n\t\tpublic Property<bool> EnableSlowMotion = new Property<bool> { Value = enabled };\n\t\tpublic Property<bool> EnableMoves = new Property<bool> { Value = true };\n\t\tpublic Property<float> MaxSpeed = new Property<float> { Value = Character.DefaultMaxSpeed };\n\t\tpublic Property<float> GameTime = new Property<float>();\n\t\tpublic ListProperty<RespawnLocation> RespawnLocations = new ListProperty<RespawnLocation>();\n\t\tpublic Property<bool> PhoneActive = new Property<bool>();\n\t\tpublic Property<bool> NoteActive = new Property<bool>();\n\t\tpublic Property<int> Collectibles = new Property<int>();\n\t\tpublic Property<int> Notes = new Property<int>();\n\t\tpublic Property<Voxel.t> CloudType = new Property<Voxel.t>();\n\t\tpublic Property<int> CollapseLevel = new Property<int>();\n\t\tpublic Property<int> VictimsHandled = new Property<int>();\n\t\tpublic Property<bool> ThirdPerson = new Property<bool>();\n\t\tpublic Property<bool> DebugVelocity = new Property<bool>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tbase.Awake();\n\t\t\tforeach (RespawnLocation l in this.RespawnLocations)\n\t\t\t\tl.Coordinate.Data = null;\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tthis.GameTime.Value += dt;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/PlayerSpawn.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class PlayerSpawn : Component<Main>\n\t{\n\t\tpublic Property<bool> IsActivated = new Property<bool>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<float> Rotation = new Property<float>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Activate = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command Deactivate = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command OnSpawn = new Command();\n\n\t\tprivate static List<PlayerSpawn> spawns = new List<PlayerSpawn>();\n\n\t\tpublic static PlayerSpawn FirstActive()\n\t\t{\n\t\t\treturn PlayerSpawn.spawns.FirstOrDefault(x => x.IsActivated);\n\t\t}\n\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"IsActivated\", this.IsActivated);\n\t\t\tthis.Entity.Add(\"Activate\", this.Activate);\n\t\t\tthis.Entity.Add(\"Deactivate\", this.Deactivate);\n\t\t\tthis.Entity.Add(\"OnSpawn\", this.OnSpawn);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tPlayerSpawn.spawns.Add(this);\n\n\t\t\tthis.Add(new CommandBinding(this.Delete, delegate() { PlayerSpawn.spawns.Remove(this); }));\n\n\t\t\tthis.Activate.Action = delegate()\n\t\t\t{\n\t\t\t\tthis.IsActivated.Value = true;\n\t\t\t};\n\n\t\t\tthis.Deactivate.Action = delegate()\n\t\t\t{\n\t\t\t\tthis.IsActivated.Value = false;\n\t\t\t};\n\n\t\t\tthis.Add(new SetBinding<bool>(this.IsActivated, delegate(bool value)\n\t\t\t{\n\t\t\t\tif (value)\n\t\t\t\t{\n\t\t\t\t\tforeach (PlayerSpawn spawn in PlayerSpawn.spawns)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (spawn != this)\n\t\t\t\t\t\t\tspawn.Deactivate.Execute();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/PlayerTrigger.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nusing Lemma.Util;\nusing System.Xml.Serialization;\nusing Lemma.Factories;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class PlayerTrigger : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<float> Radius = new Property<float> { Value = 10.0f };\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<bool> IsTriggered = new Property<bool>();\n\t\tpublic Property<Entity.Handle> Player = new Property<Entity.Handle>();\n\t\tpublic Property<bool> DeleteOnTrigger = new Property<bool>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command PlayerEntered = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command PlayerExited = new Command();\n\n\t\tpublic PlayerTrigger()\n\t\t{\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"Radius\", this.Radius);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tAction clear = delegate()\n\t\t\t{\n\t\t\t\tthis.IsTriggered.Value = false;\n\t\t\t\tthis.Player.Value = null;\n\t\t\t};\n\t\t\tthis.Add(new CommandBinding(this.OnSuspended, clear));\n\t\t\tthis.Add(new CommandBinding(this.Disable, clear));\n\t\t\tthis.Add(new CommandBinding(this.PlayerEntered, delegate()\n\t\t\t{\n\t\t\t\tif (this.DeleteOnTrigger) // Make sure other command bindings have a chance to execute\n\t\t\t\t\tthis.Entity.Add(new Animation(new Animation.Execute(this.Entity.Delete)));\n\t\t\t}));\n\t\t}\n\n\t\tpublic void Update(float elapsedTime)\n\t\t{\n\t\t\tbool playerFound = false;\n\t\t\tEntity player = PlayerFactory.Instance;\n\t\t\tif (player != null && (player.Get<Transform>().Position.Value - this.Position.Value).Length() < this.Radius)\n\t\t\t{\n\t\t\t\tplayerFound = true;\n\t\t\t\tif (!this.IsTriggered)\n\t\t\t\t{\n\t\t\t\t\tthis.Player.Value = player;\n\t\t\t\t\tthis.IsTriggered.Value = true;\n\t\t\t\t\tthis.PlayerEntered.Execute();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!playerFound && this.IsTriggered)\n\t\t\t{\n\t\t\t\tthis.PlayerExited.Execute();\n\t\t\t\tthis.IsTriggered.Value = false;\n\t\t\t\tthis.Player.Value = null;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void AttachEditorComponents(Entity entity, Main main, Vector3 color)\n\t\t{\n\t\t\tTransform transform = entity.Get<Transform>();\n\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\sphere\";\n\t\t\tmodel.Alpha.Value = 0.15f;\n\t\t\tmodel.Color.Value = color;\n\t\t\tmodel.DisableCulling.Value = true;\n\t\t\tPlayerTrigger trigger = entity.Get<PlayerTrigger>();\n\t\t\tmodel.Add(new Binding<Vector3, float>(model.Scale, x => new Vector3(x), trigger.Radius));\n\t\t\tmodel.DrawOrder.Value = 11; // In front of water\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, () => entity.EditorSelected, entity.EditorSelected));\n\n\t\t\tentity.Add(model);\n\n\t\t\tmodel.Add(new Binding<Matrix, Vector3>(model.Transform, x => Matrix.CreateTranslation(x), trigger.Position));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/PostInitialization.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\nusing ComponentBind;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class PostInitialization : Component<Main>\n\t{\n\t\tpublic PostInitialization()\n\t\t{\n\t\t\t\n\t\t}\n\n\t\tpublic PostInitialization(Action a)\n\t\t{\n\t\t\tthis.Action = a;\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic Action Action;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Serialize = false;\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tthis.Action();\n\t\t\tthis.Delete.Execute();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/PowerBlockSocket.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class PowerBlockSocket : Component<Main>\n\t{\n\t\tpublic Property<bool> Powered = new Property<bool>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnPowerOn = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnPowerOff = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Entity.Handle> AttachedVoxel = new Property<Entity.Handle>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Voxel.Coord> Coord = new Property<Voxel.Coord>();\n\n\t\tpublic Property<Voxel.t> Type = new Property<Voxel.t>();\n\n\t\tpublic Property<bool> PowerOnOnly = new Property<bool>();\n\t\tpublic Property<bool> PowerOffOnly = new Property<bool>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.Add(new ChangeBinding<bool>(this.Powered, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (value && !old)\n\t\t\t\t\tthis.OnPowerOn.Execute();\n\t\t\t\telse if (!value && old)\n\t\t\t\t\tthis.OnPowerOff.Execute();\n\t\t\t}));\n\n\t\t\tthis.Add(new NotifyBinding(this.updatePower, this.Coord));\n\t\t}\n\n\t\tprivate void updatePower()\n\t\t{\n\t\t\tEntity v = this.AttachedVoxel.Value.Target;\n\t\t\tbool powered = false;\n\t\t\tif (v != null)\n\t\t\t{\n\t\t\t\tVoxel voxel = v.Get<Voxel>();\n\t\t\t\tVoxel.Coord coord = this.Coord;\n\t\t\t\tfor (int i = 0; i < 6; i++)\n\t\t\t\t{\n\t\t\t\t\tDirection dir = DirectionExtensions.Directions[i];\n\t\t\t\t\tif (voxel[coord.Move(dir)].ID == this.Type)\n\t\t\t\t\t{\n\t\t\t\t\t\tpowered = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.Powered.Value = powered;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Propagator.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Components;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\t[XmlInclude(typeof(ScheduledBlock))]\n\t[XmlInclude(typeof(ListProperty<ScheduledBlock>))]\n\tpublic class Propagator : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic enum Spark\n\t\t{\n\t\t\tNormal, Dangerous, Burn, Expander, Count\n\t\t}\n\n\t\tpublic class ScheduledBlock\n\t\t{\n\t\t\tpublic Entity.Handle Voxel;\n\t\t\tpublic Voxel.Coord Coordinate;\n\t\t\tpublic float Time;\n\t\t\t[System.ComponentModel.DefaultValue(0)]\n\t\t\tpublic int Generation;\n\t\t\t[System.ComponentModel.DefaultValue(false)]\n\t\t\tpublic bool Removing;\n\t\t}\n\n\t\tprivate const float sparkLightFadeTime = 0.5f;\n\t\tprivate const float sparkLightBrightness = 2.0f;\n\t\tprivate const int maxSparkLights = 10;\n\t\tprivate const float propagateDelay = 0.07f;\n\t\tprivate const int maxGenerations = 4;\n\n\t\tpublic ListProperty<ScheduledBlock> BlockQueue = new ListProperty<ScheduledBlock>();\n\t\tprivate Random random = new Random();\n\t\tprivate List<PointLight> sparkLights = new List<PointLight>();\n\t\tprivate int activeSparkLights = 0;\n\t\tprivate int oldestSparkLight = 0;\n\t\tprivate ParticleSystem particles;\n\t\tprivate Dictionary<EffectBlock.Entry, int> generations = new Dictionary<EffectBlock.Entry, int>();\n\t\tprivate EffectBlockFactory blockFactory;\n\n\t\tprivate List<Voxel.Coord> removedPoweredCoords = new List<Voxel.Coord>();\n\n\t\tprivate float lastShatterSound;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.blockFactory = Factory.Get<EffectBlockFactory>();\n\n\t\t\tthis.EnabledWhenPaused = false;\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t\tthis.BlockQueue.Clear();\n\n\t\t\tthis.particles = ParticleSystem.Get(main, \"WhiteShatter\");\n\n\t\t\tfor (int i = 0; i < maxSparkLights; i++)\n\t\t\t{\n\t\t\t\tPointLight light = new PointLight();\n\t\t\t\tlight.Serialize = false;\n\t\t\t\tlight.Color.Value = new Vector3(1.0f);\n\t\t\t\tlight.Enabled.Value = false;\n\t\t\t\tthis.Entity.Add(light);\n\t\t\t\tthis.sparkLights.Add(light);\n\t\t\t}\n\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tthis.Add(new CommandBinding<Voxel, IEnumerable<Voxel.Coord>, Voxel>(Voxel.GlobalCellsFilled, delegate(Voxel map, IEnumerable<Voxel.Coord> coords, Voxel transferredFromMap)\n\t\t\t\t{\n\t\t\t\t\tforeach (Voxel.Coord c in coords)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.t id = c.Data.ID;\n\t\t\t\t\t\tif (id == Voxel.t.Powered || id == Voxel.t.PoweredSwitch || id == Voxel.t.HardPowered || id == Voxel.t.Infected || id == Voxel.t.HardInfected\n\t\t\t\t\t\t\t|| (transferredFromMap == null && (id == Voxel.t.Blue || id == Voxel.t.Neutral || id == Voxel.t.Hard)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord newCoord = c;\n\t\t\t\t\t\t\tnewCoord.Data = Voxel.States.Empty;\n\t\t\t\t\t\t\tint generation;\n\t\t\t\t\t\t\tEffectBlock.Entry generationsKey = new EffectBlock.Entry { Voxel = map, Coordinate = newCoord };\n\t\t\t\t\t\t\tif (this.generations.TryGetValue(generationsKey, out generation))\n\t\t\t\t\t\t\t\tthis.generations.Remove(generationsKey);\n\t\t\t\t\t\t\tif (!this.isInQueue(map.Entity, newCoord, false))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.BlockQueue.Add(new ScheduledBlock\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tVoxel = map.Entity,\n\t\t\t\t\t\t\t\t\tCoordinate = newCoord,\n\t\t\t\t\t\t\t\t\tTime = propagateDelay,\n\t\t\t\t\t\t\t\t\tGeneration = generation,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}));\n\n\t\t\t\tthis.Add(new CommandBinding<Voxel, IEnumerable<Voxel.Coord>, Voxel>(Voxel.GlobalCellsEmptied, delegate(Voxel map, IEnumerable<Voxel.Coord> coords, Voxel transferringToNewMap)\n\t\t\t\t{\n\t\t\t\t\tforeach (Voxel.Coord coord in coords)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.t id = coord.Data.ID;\n\t\t\t\t\t\tif (id == Voxel.t.Powered || id == Voxel.t.PoweredSwitch || id == Voxel.t.HardPowered || id == Voxel.t.PermanentPowered)\n\t\t\t\t\t\t\tthis.removedPoweredCoords.Add(coord);\n\t\t\t\t\t\tif (transferringToNewMap != null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (id == Voxel.t.Critical) // Critical. Explodes when destroyed.\n\t\t\t\t\t\t\tExplosion.Explode(main, map, coord);\n\t\t\t\t\t\telse if (id == Voxel.t.Powered || id == Voxel.t.Blue || id == Voxel.t.Neutral || id == Voxel.t.Infected || id == Voxel.t.Floater)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint generation;\n\t\t\t\t\t\t\tVoxel.Coord c = coord;\n\t\t\t\t\t\t\tc.Data = Voxel.States.Empty;\n\t\t\t\t\t\t\tEffectBlock.Entry generationKey = new EffectBlock.Entry { Voxel = map, Coordinate = c };\n\t\t\t\t\t\t\tif (this.generations.TryGetValue(generationKey, out generation))\n\t\t\t\t\t\t\t\tthis.generations.Remove(generationKey);\n\n\t\t\t\t\t\t\tif (id == Voxel.t.Floater)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tEntity blockEntity = this.blockFactory.CreateAndBind(main);\n\t\t\t\t\t\t\t\tEffectBlock effectBlock = blockEntity.Get<EffectBlock>();\n\t\t\t\t\t\t\t\tcoord.Data.ApplyToEffectBlock(blockEntity.Get<ModelInstance>());\n\t\t\t\t\t\t\t\teffectBlock.Delay = 4.0f;\n\t\t\t\t\t\t\t\teffectBlock.Offset.Value = map.GetRelativePosition(coord);\n\t\t\t\t\t\t\t\teffectBlock.StartPosition = map.GetAbsolutePosition(coord) + new Vector3(2.5f, 5.0f, 2.5f);\n\t\t\t\t\t\t\t\teffectBlock.StartOrientation = Quaternion.CreateFromYawPitchRoll(1.0f, 1.0f, 0);\n\t\t\t\t\t\t\t\teffectBlock.TotalLifetime = 0.5f;\n\t\t\t\t\t\t\t\teffectBlock.Setup(map.Entity, coord, coord.Data.ID);\n\t\t\t\t\t\t\t\tmain.Add(blockEntity);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (generation == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!this.isInQueue(map.Entity, coord, true))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis.BlockQueue.Add(new ScheduledBlock\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tVoxel = map.Entity,\n\t\t\t\t\t\t\t\t\t\tCoordinate = coord,\n\t\t\t\t\t\t\t\t\t\tTime = propagateDelay,\n\t\t\t\t\t\t\t\t\t\tRemoving = true,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (generation < maxGenerations)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tDirection down = map.GetRelativeDirection(Direction.NegativeY);\n\t\t\t\t\t\t\t\tfor (int i = 0; i < 6; i++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tDirection dir = DirectionExtensions.Directions[i];\n\t\t\t\t\t\t\t\t\tVoxel.Coord adjacent = coord.Move(dir);\n\t\t\t\t\t\t\t\t\tif (!coords.Contains(adjacent))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tVoxel.t adjacentID = map[adjacent].ID;\n\t\t\t\t\t\t\t\t\t\tbool adjacentIsFloater = adjacentID == Voxel.t.Floater;\n\t\t\t\t\t\t\t\t\t\tif (dir != down || adjacentIsFloater)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (adjacentID == Voxel.t.Powered || adjacentID == Voxel.t.Blue || adjacentID == Voxel.t.Neutral || adjacentID == Voxel.t.Infected || adjacentIsFloater)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (!this.isInQueue(map.Entity, adjacent, true))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.BlockQueue.Add(new ScheduledBlock\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tVoxel = map.Entity,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCoordinate = adjacent,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTime = propagateDelay,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tRemoving = true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGeneration = generation + 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (id == Voxel.t.White || id == Voxel.t.Glass) // Shatter effects.\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tParticleSystem shatter = ParticleSystem.Get(main, \"WhiteShatter\");\n\t\t\t\t\t\t\tVector3 pos = map.GetAbsolutePosition(coord);\n\t\t\t\t\t\t\tfor (int i = 0; i < 50; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tVector3 offset = new Vector3((float)this.random.NextDouble() - 0.5f, (float)this.random.NextDouble() - 0.5f, (float)this.random.NextDouble() - 0.5f);\n\t\t\t\t\t\t\t\tshatter.AddParticle(pos + offset, offset);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfloat time = this.main.TotalTime;\n\t\t\t\t\t\t\tif (time - this.lastShatterSound > 0.3f)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.lastShatterSound = time;\n\t\t\t\t\t\t\t\tSound.PostEvent(AK.EVENTS.PLAY_WHITE_SHATTER, pos);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.removedPoweredCoords.Count > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tIEnumerable<IEnumerable<Voxel.Box>> poweredIslands = map.GetAdjacentIslands(this.removedPoweredCoords, x => x.ID == Voxel.t.Powered || x.ID == Voxel.t.HardPowered, x => x == Voxel.States.PermanentPowered || x == Voxel.States.PoweredSwitch);\n\t\t\t\t\t\tList<Voxel.Coord> poweredCoords = poweredIslands.SelectMany(x => x).SelectMany(x => x.GetCoords()).ToList();\n\t\t\t\t\t\tif (poweredCoords.Count > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (map.MutationLock)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmap.Empty(poweredCoords, true, true, map, false);\n\t\t\t\t\t\t\t\tfor (int i = 0; i < poweredCoords.Count; i++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tVoxel.Coord coord = poweredCoords[i];\n\t\t\t\t\t\t\t\t\tif (coord.Data.ID == Voxel.t.HardPowered)\n\t\t\t\t\t\t\t\t\t\tmap.Fill(coord, Voxel.States.Hard, true, map);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tmap.Fill(coord, Voxel.States.Blue, true, map);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.toRegenerate.Add(map);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.removedPoweredCoords.Clear();\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\n\t\tprivate bool isInQueue(Entity m, Voxel.Coord c, bool removing)\n\t\t{\n\t\t\tfor (int i = 0; i < this.BlockQueue.Count; i++)\n\t\t\t{\n\t\t\t\tScheduledBlock b = this.BlockQueue[i];\n\t\t\t\tif (b.Removing == removing && m == b.Voxel.Target && b.Coordinate.Equivalent(c))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate List<Voxel> toRegenerate = new List<Voxel>();\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tfloat sparkLightFade = sparkLightBrightness * dt / sparkLightFadeTime;\n\t\t\tfor (int i = 0; i < activeSparkLights; i++)\n\t\t\t{\n\t\t\t\tPointLight light = this.sparkLights[i];\n\t\t\t\tfloat a = light.Color.Value.X - sparkLightFade;\n\t\t\t\tif (a < 0.0f)\n\t\t\t\t{\n\t\t\t\t\tlight.Enabled.Value = false;\n\t\t\t\t\tPointLight swap = this.sparkLights[activeSparkLights - 1];\n\t\t\t\t\tthis.sparkLights[i] = swap;\n\t\t\t\t\tthis.sparkLights[activeSparkLights - 1] = light;\n\t\t\t\t\tactiveSparkLights--;\n\t\t\t\t\toldestSparkLight = activeSparkLights;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tlight.Color.Value = new Vector3(a);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < this.BlockQueue.Length; i++)\n\t\t\t{\n\t\t\t\tScheduledBlock entry = this.BlockQueue[i];\n\t\t\t\tentry.Time -= dt;\n\t\t\t\tif (entry.Time < 0.0f)\n\t\t\t\t{\n\t\t\t\t\tthis.BlockQueue.RemoveAt(i);\n\t\t\t\t\ti--;\n\n\t\t\t\t\tEntity mapEntity = entry.Voxel.Target;\n\t\t\t\t\tif (mapEntity != null && mapEntity.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel map = mapEntity.Get<Voxel>();\n\t\t\t\t\t\tVoxel.Coord c = entry.Coordinate;\n\t\t\t\t\t\tVoxel.t id = map[c].ID;\n\n\t\t\t\t\t\tbool regenerate = false;\n\n\t\t\t\t\t\tif (entry.Removing)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (entry.Generation == 0 && id == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tDirection down = map.GetRelativeDirection(Direction.NegativeY);\n\t\t\t\t\t\t\t\tfor (int j = 0; j < 6; j++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tDirection dir = DirectionExtensions.Directions[j];\n\t\t\t\t\t\t\t\t\tVoxel.Coord adjacent = c.Move(dir);\n\t\t\t\t\t\t\t\t\tVoxel.t adjacentID = map[adjacent].ID;\n\t\t\t\t\t\t\t\t\tbool adjacentIsFloater = adjacentID == Voxel.t.Floater;\n\t\t\t\t\t\t\t\t\tif (dir != down || adjacentIsFloater)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (adjacentID == Voxel.t.Powered || adjacentID == Voxel.t.Blue || adjacentID == Voxel.t.Neutral || adjacentID == Voxel.t.Infected || adjacentIsFloater)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (!this.isInQueue(map.Entity, adjacent, true))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tthis.BlockQueue.Add(new ScheduledBlock\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tVoxel = map.Entity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tCoordinate = adjacent,\n\t\t\t\t\t\t\t\t\t\t\t\t\tTime = propagateDelay,\n\t\t\t\t\t\t\t\t\t\t\t\t\tRemoving = true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tGeneration = 1,\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (entry.Generation > 0 && (id == Voxel.t.Blue || id == Voxel.t.Infected || id == Voxel.t.Powered || id == Voxel.t.PermanentPowered || id == Voxel.t.HardPowered || id == Voxel.t.PoweredSwitch || id == Voxel.t.Neutral || id == Voxel.t.Floater))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.generations[new EffectBlock.Entry { Voxel = map, Coordinate = c }] = entry.Generation;\n\t\t\t\t\t\t\t\tmap.Empty(c);\n\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(c), Spark.Burn);\n\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (id == Voxel.t.Blue)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int j = 0; j < 6; j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tDirection dir = DirectionExtensions.Directions[j];\n\t\t\t\t\t\t\t\tVoxel.Coord adjacent = c.Move(dir);\n\t\t\t\t\t\t\t\tVoxel.t adjacentID = map[adjacent].ID;\n\n\t\t\t\t\t\t\t\tif (adjacentID == Voxel.t.Powered || adjacentID == Voxel.t.PermanentPowered || adjacentID == Voxel.t.HardPowered || adjacentID == Voxel.t.PoweredSwitch)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(c, false, true, map);\n\t\t\t\t\t\t\t\t\tmap.Fill(c, Voxel.States.Powered);\n\t\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(c), Spark.Normal);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (adjacentID == Voxel.t.Neutral && entry.Generation < maxGenerations)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent, false, true, map);\n\t\t\t\t\t\t\t\t\tthis.generations[new EffectBlock.Entry { Voxel = map, Coordinate = adjacent }] = entry.Generation + 1;\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacent, Voxel.States.Blue);\n\t\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(adjacent), Spark.Normal);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (id == Voxel.t.Neutral)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int j = 0; j < 6; j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tDirection dir = DirectionExtensions.Directions[j];\n\t\t\t\t\t\t\t\tVoxel.Coord adjacent = c.Move(dir);\n\t\t\t\t\t\t\t\tVoxel.t adjacentID = map[adjacent].ID;\n\t\t\t\t\t\t\t\tif (adjacentID == Voxel.t.Infected || adjacentID == Voxel.t.Blue || adjacentID == Voxel.t.Powered)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent, false, true, map);\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacent, Voxel.States.Neutral);\n\t\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(adjacent), Spark.Normal);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (adjacentID == Voxel.t.HardInfected)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent, false, true, map);\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacent, Voxel.States.Hard);\n\t\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(adjacent), Spark.Normal);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (id == Voxel.t.Hard)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int j = 0; j < 6; j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tDirection dir = DirectionExtensions.Directions[j];\n\t\t\t\t\t\t\t\tVoxel.Coord adjacent = c.Move(dir);\n\t\t\t\t\t\t\t\tVoxel.t adjacentID = map[adjacent].ID;\n\t\t\t\t\t\t\t\tif (adjacentID == Voxel.t.HardInfected)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent, false, true, map);\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacent, Voxel.States.Hard);\n\t\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(adjacent), Spark.Normal);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (id == Voxel.t.Powered || id == Voxel.t.PermanentPowered || id == Voxel.t.HardPowered || id == Voxel.t.PoweredSwitch)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int j = 0; j < 6; j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tDirection dir = DirectionExtensions.Directions[j];\n\t\t\t\t\t\t\t\tVoxel.Coord adjacent = c.Move(dir);\n\t\t\t\t\t\t\t\tVoxel.t adjacentID = map[adjacent].ID;\n\n\t\t\t\t\t\t\t\tif (id == Voxel.t.Powered && adjacentID == Voxel.t.Neutral && entry.Generation < maxGenerations)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent, false, true, map);\n\t\t\t\t\t\t\t\t\tthis.generations[new EffectBlock.Entry { Voxel = map, Coordinate = adjacent }] = entry.Generation + 1;\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacent, Voxel.States.Powered);\n\t\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(adjacent), Spark.Normal);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (adjacentID == Voxel.t.Blue)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent, false, true, map);\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacent, Voxel.States.Powered);\n\t\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(adjacent), Spark.Normal);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (adjacentID == Voxel.t.Switch)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent, true, true, map);\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacent, Voxel.States.PoweredSwitch);\n\t\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(adjacent), Spark.Normal);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (adjacentID == Voxel.t.Hard)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent, true, true, map);\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacent, Voxel.States.HardPowered);\n\t\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(adjacent), Spark.Normal);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (adjacentID == Voxel.t.Critical)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (id == Voxel.t.Infected || id == Voxel.t.HardInfected)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int j = 0; j < 6; j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tDirection dir = DirectionExtensions.Directions[j];\n\t\t\t\t\t\t\t\tVoxel.Coord adjacent = c.Move(dir);\n\t\t\t\t\t\t\t\tVoxel.t adjacentID = map[adjacent].ID;\n\t\t\t\t\t\t\t\tif (adjacentID == Voxel.t.Neutral && entry.Generation < maxGenerations)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent, false, true, map);\n\t\t\t\t\t\t\t\t\tthis.generations[new EffectBlock.Entry { Voxel = map, Coordinate = adjacent }] = entry.Generation + 1;\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacent, Voxel.States.Infected);\n\t\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(adjacent), Spark.Dangerous);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (adjacentID == Voxel.t.Hard && entry.Generation < maxGenerations)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent, false, true, map);\n\t\t\t\t\t\t\t\t\tthis.generations[new EffectBlock.Entry { Voxel = map, Coordinate = adjacent }] = entry.Generation + 1;\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacent, Voxel.States.HardInfected);\n\t\t\t\t\t\t\t\t\tthis.SparksLowPriority(map.GetAbsolutePosition(adjacent), Spark.Dangerous);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (adjacentID == Voxel.t.Critical)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacent);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (regenerate)\n\t\t\t\t\t\t\tthis.toRegenerate.Add(map);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < this.toRegenerate.Count; i++)\n\t\t\t\tthis.toRegenerate[i].Regenerate();\n\t\t\tthis.toRegenerate.Clear();\n\t\t}\n\n\t\tprivate float[] lastSound = new float[(int)Spark.Count];\n\t\tprivate float soundRadiusSquared = 30.0f * 30.0f;\n\t\tpublic void SparksLowPriority(Vector3 pos, Spark type)\n\t\t{\n\t\t\tif (this.random.Next(0, 2) == 0)\n\t\t\t{\n\t\t\t\tbool sound = this.main.TotalTime - this.lastSound[(int)type] > 0.15f\n\t\t\t\t\t&& (this.main.Camera.Position - pos).LengthSquared() < soundRadiusSquared;\n\t\t\t\tthis.Sparks(pos, type, sound);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Sparks(Vector3 pos, Spark type, bool playSound = true)\n\t\t{\n\t\t\tfor (int j = 0; j < 20; j++)\n\t\t\t{\n\t\t\t\tVector3 offset = new Vector3((float)this.random.NextDouble() - 0.5f, (float)this.random.NextDouble() - 0.5f, (float)this.random.NextDouble() - 0.5f);\n\t\t\t\tthis.particles.AddParticle(pos + offset, offset);\n\t\t\t}\n\n\t\t\tPointLight light;\n\t\t\tif (this.activeSparkLights < Propagator.maxSparkLights)\n\t\t\t{\n\t\t\t\tlight = this.sparkLights[this.activeSparkLights];\n\t\t\t\tlight.Enabled.Value = true;\n\t\t\t\tthis.activeSparkLights++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlight = this.sparkLights[this.oldestSparkLight % this.activeSparkLights];\n\t\t\t\tthis.oldestSparkLight = (this.oldestSparkLight + 1) % Propagator.maxSparkLights;\n\t\t\t}\n\n\t\t\tlight.Color.Value = Vector3.One;\n\t\t\tlight.Position.Value = pos;\n\n\t\t\tlight.Attenuation.Value = type == Spark.Expander ? 10.0f : 5.0f;\n\n\t\t\tif (playSound)\n\t\t\t{\n\t\t\t\tthis.lastSound[(int)type] = this.main.TotalTime;\n\t\t\t\tuint sound;\n\t\t\t\tswitch (type)\n\t\t\t\t{\n\t\t\t\t\tcase Spark.Dangerous:\n\t\t\t\t\t\tsound = AK.EVENTS.PLAY_RED_BURN;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Spark.Burn:\n\t\t\t\t\t\tsound = AK.EVENTS.PLAY_ORANGE_BURN;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tsound = AK.EVENTS.PLAY_BLUE_BURN;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSound.PostEvent(sound, pos);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Rain.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma.Components\n{\n\tpublic class Rain : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic const float KernelSpacing = 8.0f;\n\t\tpublic const int KernelSize = 10;\n\t\tpublic const float RaycastHeight = 30.0f;\n\t\tpublic const float RaycastInterval = 0.25f;\n\t\tpublic const float VerticalSpeed = 90.0f;\n\t\tpublic const float MaxLifetime = 1.0f;\n\t\tpublic const float StartHeight = 25.0f;\n\n\t\tprivate float[,] audioKernel = new float[KernelSize, KernelSize];\n\n\t\t[XmlIgnore]\n\t\tpublic float[,] RaycastHeights = new float[KernelSize, KernelSize];\n\n\t\tprivate float raycastTimer = RaycastInterval;\n\n\t\tprivate float thunderTimer;\n\n\t\tprivate ModelAlpha skybox;\n\n\t\tprivate static Random random = new Random();\n\n\t\t// Input properties\n\t\tpublic Property<float> ThunderIntervalMin = new Property<float> { Value = 12.0f };\n\t\tpublic Property<float> ThunderIntervalMax = new Property<float> { Value = 36.0f };\n\t\tpublic Property<float> ThunderMaxDelay = new Property<float> { Value = 5.0f };\n\t\tpublic Property<Vector3> LightningColor = new Property<Vector3>();\n\t\tpublic Property<bool> LightningShadowed = new Property<bool>();\n\t\tpublic Property<Vector3> SkyboxColor = new Property<Vector3>();\n\t\t[XmlIgnore]\n\t\tpublic Property<int> ParticlesPerSecond = new Property<int>();\n\n\t\t// Output properties\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> Jitter = new Property<Vector3>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> KernelOffset = new Property<Vector3>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> CurrentLightningColor = new Property<Vector3>();\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> LightningEnabled = new Property<bool>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledInEditMode = true;\n\t\t\tthis.EnabledWhenPaused = false;\n\n\t\t\tfloat sum = 0.0f;\n\t\t\tfor (int x = 0; x < KernelSize; x++)\n\t\t\t{\n\t\t\t\tfor (int y = 0; y < KernelSize; y++)\n\t\t\t\t{\n\t\t\t\t\tfloat cell = (KernelSize / 2) - new Vector2(x - (KernelSize / 2), y - (KernelSize / 2)).Length();\n\t\t\t\t\taudioKernel[x, y] = cell;\n\t\t\t\t\tsum += cell;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int x = 0; x < KernelSize; x++)\n\t\t\t{\n\t\t\t\tfor (int y = 0; y < KernelSize; y++)\n\t\t\t\t\taudioKernel[x, y] /= sum;\n\t\t\t}\n\n\t\t\tthis.Jitter.Value = new Vector3(KernelSpacing * KernelSize * 0.5f, 0.0f, KernelSpacing * KernelSize * 0.5f);\n\n\t\t\tif (ParticleSystem.Get(main, \"Rain\") == null)\n\t\t\t{\n\t\t\t\tParticleSystem.Add(main, \"Rain\",\n\t\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t\t{\n\t\t\t\t\tTextureName = \"Particles\\\\default\",\n\t\t\t\t\tEffectFile = \"Effects\\\\ParticleRain\",\n\t\t\t\t\tMaxParticles = 25000,\n\t\t\t\t\tDuration = TimeSpan.FromSeconds(MaxLifetime),\n\t\t\t\t\tMinHorizontalVelocity = 0.0f,\n\t\t\t\t\tMaxHorizontalVelocity = 0.0f,\n\t\t\t\t\tMinVerticalVelocity = -VerticalSpeed,\n\t\t\t\t\tMaxVerticalVelocity = -VerticalSpeed,\n\t\t\t\t\tGravity = new Vector3(0.0f, 0.0f, 0.0f),\n\t\t\t\t\tMinRotateSpeed = 0.0f,\n\t\t\t\t\tMaxRotateSpeed = 0.0f,\n\t\t\t\t\tMinStartSize = 0.3f,\n\t\t\t\t\tMaxStartSize = 0.3f,\n\t\t\t\t\tMinEndSize = 0.3f,\n\t\t\t\t\tMaxEndSize = 0.3f,\n\t\t\t\t\tBlendState = BlendState.Opaque,\n\t\t\t\t\tMinColor = new Vector4(0.6f, 0.6f, 0.6f, 1.0f),\n\t\t\t\t\tMaxColor = new Vector4(0.6f, 0.6f, 0.6f, 1.0f),\n\t\t\t\t\tMaterial = new Components.Model.Material { SpecularIntensity = 0.0f, SpecularPower = 1.0f },\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (this.main.EditorEnabled)\n\t\t\t\tthis.Add(new Binding<Vector3>(this.CurrentLightningColor, this.LightningColor));\n\n\t\t\tthis.thunderTimer = this.ThunderIntervalMin + ((float)random.NextDouble() * (this.ThunderIntervalMax - this.ThunderIntervalMin));\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_RAIN, this.Entity);\n\n\t\t\t\tEntity skyboxEntity = main.Get(\"Skybox\").FirstOrDefault();\n\t\t\t\tif (skyboxEntity != null)\n\t\t\t\t{\n\t\t\t\t\tthis.skybox = skyboxEntity.Get<ModelAlpha>();\n\t\t\t\t\tif (this.SkyboxColor.Value.LengthSquared() == 0.0f)\n\t\t\t\t\t\tthis.SkyboxColor.Value = this.skybox.Color;\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.skybox.Color.Value = this.SkyboxColor;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Update()\n\t\t{\n\t\t\tif (this.ParticlesPerSecond > 0)\n\t\t\t{\n\t\t\t\tthis.raycastTimer = 0.0f;\n\t\t\t\tVector3 cameraPos = main.Camera.Position;\n\t\t\t\tfloat averageHeight = 0.0f;\n\t\t\t\tfloat min = float.MinValue;\n\t\t\t\tforeach (Water w in Water.ActiveInstances)\n\t\t\t\t{\n\t\t\t\t\tif (w.CannotSuspendByDistance) // It's big\n\t\t\t\t\t\tmin = Math.Max(min, w.Position.Value.Y);\n\t\t\t\t}\n\t\t\t\tthis.KernelOffset.Value = main.Camera.Position + new Vector3(KernelSize * KernelSpacing * -0.5f, RaycastHeight + StartHeight, KernelSize * KernelSpacing * -0.5f);\n\t\t\t\tfor (int x = 0; x < KernelSize; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = 0; y < KernelSize; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 pos = KernelOffset + new Vector3(x * KernelSpacing, 0, y * KernelSpacing);\n\t\t\t\t\t\tVoxel.GlobalRaycastResult raycast = Voxel.GlobalRaycast(pos, Vector3.Down, StartHeight + RaycastHeight + (VerticalSpeed * MaxLifetime));\n\t\t\t\t\t\tfloat height = raycast.Voxel == null ? min : raycast.Position.Y;\n\t\t\t\t\t\tthis.RaycastHeights[x, y] = height;\n\t\t\t\t\t\taverageHeight += Math.Max(cameraPos.Y, Math.Min(height, cameraPos.Y + StartHeight)) * audioKernel[x, y];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.RAIN_VOLUME, (float)Math.Min((float)this.ParticlesPerSecond.Value / 2000.0f, 1.0f) * (1.0f - ((averageHeight - cameraPos.Y) / StartHeight)));\n\t\t\t}\n\t\t\telse\n\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.RAIN_VOLUME, 0.0f);\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tthis.raycastTimer += dt;\n\t\t\tif (this.raycastTimer > RaycastInterval)\n\t\t\t\tthis.Update();\n\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tthis.thunderTimer -= dt;\n\t\t\t\tif (this.thunderTimer < 0)\n\t\t\t\t{\n\t\t\t\t\tfloat volume = 0.6f + ((float)random.NextDouble() * 0.4f);\n\t\t\t\t\tthis.CurrentLightningColor.Value = Vector3.Zero;\n\t\t\t\t\tProperty<Vector3> skyboxColor;\n\t\t\t\t\tif (this.skybox == null)\n\t\t\t\t\t\tskyboxColor = new Property<Vector3>(); // Dummy property\n\t\t\t\t\telse\n\t\t\t\t\t\tskyboxColor = this.skybox.Color;\n\n\t\t\t\t\tthis.Entity.Add(new Animation\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Set<bool>(this.LightningEnabled, true),\n\t\t\t\t\t\tnew Animation.Parallel\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew Animation.Vector3MoveTo(this.CurrentLightningColor, this.LightningColor.Value * volume, 0.2f),\n\t\t\t\t\t\t\tnew Animation.Vector3MoveTo(skyboxColor, this.SkyboxColor.Value + this.LightningColor.Value * volume, 0.2f)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnew Animation.Parallel\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew Animation.Vector3MoveTo(this.CurrentLightningColor, Vector3.Zero, 0.5f),\n\t\t\t\t\t\t\tnew Animation.Vector3MoveTo(skyboxColor, this.SkyboxColor, 0.5f)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnew Animation.Set<bool>(this.LightningEnabled, false),\n\t\t\t\t\t\tnew Animation.Delay((1.0f - volume) * this.ThunderMaxDelay),\n\t\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSound.PostEvent(AK.EVENTS.PLAY_THUNDER, main.Camera.Position + Vector3.Normalize(new Vector3(2.0f * ((float)random.NextDouble() - 0.5f), 1.0f, 2.0f * ((float)random.NextDouble() - 0.5f))) * 1000.0f);\n\t\t\t\t\t\t})\n\t\t\t\t\t));\n\t\t\t\t\tthis.thunderTimer = this.ThunderIntervalMin + ((float)random.NextDouble() * (this.ThunderIntervalMax - this.ThunderIntervalMin));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_RAIN, this.Entity);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/RaycastAI.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\nusing Lemma.Factories;\nusing ComponentBind;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class RaycastAI : Component<Main>\n\t{\n\t\tpublic Property<Entity.Handle> Voxel = new Property<Entity.Handle>();\n\t\tpublic Property<Voxel.Coord> Coord = new Property<Voxel.Coord>();\n\t\tpublic Property<Entity.Handle> LastVoxel = new Property<Entity.Handle>();\n\t\tpublic Property<Voxel.Coord> LastCoord = new Property<Voxel.Coord>();\n\t\tpublic Property<Direction> Normal = new Property<Direction>();\n\t\tpublic Property<float> Blend = new Property<float> { Value = 1.0f };\n\t\tpublic Property<float> BlendTime = new Property<float> { Value = 0.1f };\n\t\tpublic Property<float> MovementDistance = new Property<float> { Value = 15.0f };\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<Quaternion> Orientation = new Property<Quaternion>();\n\n\t\t[XmlIgnore]\n\t\tpublic Func<Voxel.t, bool> VoxelFilter;\n\n\t\t[XmlIgnore]\n\t\tpublic Func<Vector3, bool> PositionFilter;\n\n\t\tpublic RaycastAI()\n\t\t{\n\t\t\tthis.VoxelFilter = RaycastAI.DefaultVoxelFilter;\n\t\t\tthis.PositionFilter = RaycastAI.DefaultPositionFilter;\n\t\t}\n\n\t\tpublic static bool DefaultVoxelFilter(Voxel.t x)\n\t\t{\n\t\t\treturn x != Components.Voxel.t.AvoidAI;\n\t\t}\n\n\t\tpublic static bool WaterFilter(Vector3 pos)\n\t\t{\n\t\t\tforeach (Water w in Water.ActiveInstances)\n\t\t\t{\n\t\t\t\tif (w.Fluid.BoundingBox.Contains(pos) != ContainmentType.Disjoint)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static bool SignalTowerFilter(Vector3 pos)\n\t\t{\n\t\t\tforeach (SignalTower t in SignalTower.All)\n\t\t\t{\n\t\t\t\tif ((t.Entity.Get<Transform>().Position - pos).Length() < 20.0f)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static bool MapExitFilter(Vector3 pos)\n\t\t{\n\t\t\tforeach (MapExit e in MapExit.All)\n\t\t\t{\n\t\t\t\tif ((e.Entity.Get<Transform>().Position - pos).Length() < 20.0f)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static bool DefaultPositionFilter(Vector3 pos)\n\t\t{\n\t\t\treturn RaycastAI.WaterFilter(pos)\n\t\t\t\t&& RaycastAI.SignalTowerFilter(pos)\n\t\t\t\t&& RaycastAI.MapExitFilter(pos);\n\t\t}\n\n\t\tprivate Random random = new Random();\n\n\t\tpublic void Update()\n\t\t{\n\t\t\tEntity mapEntity = this.Voxel.Value.Target;\n\t\t\tif (mapEntity != null && mapEntity.Active)\n\t\t\t{\n\t\t\t\tVoxel currentMap = mapEntity.Get<Voxel>();\n\t\t\t\tVector3 currentPosition = currentMap.GetAbsolutePosition(this.Coord);\n\t\t\t\tEntity lastMapEntity = this.LastVoxel.Value.Target;\n\t\t\t\tif (this.Blend < 1.0f && lastMapEntity != null && lastMapEntity.Active)\n\t\t\t\t{\n\t\t\t\t\tVoxel lastM = lastMapEntity.Get<Voxel>();\n\t\t\t\t\tthis.Position.Value = Vector3.Lerp(lastM.GetAbsolutePosition(this.LastCoord), currentPosition, this.Blend);\n\t\t\t\t\tthis.Orientation.Value = Quaternion.Lerp(Quaternion.CreateFromRotationMatrix(lastM.Transform), Quaternion.CreateFromRotationMatrix(currentMap.Transform), this.Blend);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.Position.Value = currentPosition;\n\t\t\t\t\tthis.Orientation.Value = Quaternion.CreateFromRotationMatrix(currentMap.Transform);\n\t\t\t\t}\n\t\t\t\tthis.Blend.Value += this.main.ElapsedTime.Value / this.BlendTime;\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis.Voxel.Value = null;\n\t\t}\n\n\t\tpublic void MoveTo(Voxel.Coord coord, Voxel map = null)\n\t\t{\n\t\t\tthis.LastCoord.Value = this.Coord;\n\t\t\tthis.LastVoxel.Value = this.Voxel;\n\t\t\tif (map != null)\n\t\t\t\tthis.Voxel.Value = map.Entity;\n\t\t\tthis.Coord.Value = coord;\n\t\t\tthis.Blend.Value = 0.0f;\n\t\t}\n\n\t\tpublic void Move(Vector3 dir)\n\t\t{\n\t\t\tfloat dirLength = dir.Length();\n\t\t\tif (dirLength == 0.0f)\n\t\t\t\treturn; // We're already where we need to be\n\t\t\telse\n\t\t\t\tdir /= dirLength; // Normalize\n\n\t\t\tVector3 pos;\n\n\t\t\tif (this.Voxel.Value.Target != null && this.Voxel.Value.Target.Active)\n\t\t\t{\n\t\t\t\tVoxel m = this.Voxel.Value.Target.Get<Voxel>();\n\t\t\t\tVoxel.Coord adjacent = this.Coord.Value.Move(this.Normal);\n\t\t\t\tif (m[adjacent].ID == 0)\n\t\t\t\t\tpos = m.GetAbsolutePosition(adjacent);\n\t\t\t\telse\n\t\t\t\t\tpos = this.Position;\n\t\t\t}\n\t\t\telse\n\t\t\t\tpos = this.Position;\n\n\t\t\tfloat radius = 0.0f;\n\t\t\tconst int attempts = 20;\n\n\t\t\tVector3 up = Vector3.Up;\n\t\t\tif ((float)Math.Abs(dir.Y) == 1.0f)\n\t\t\t\tup = Vector3.Right;\n\n\t\t\tMatrix mat = Matrix.Identity;\n\t\t\tmat.Forward = -dir;\n\t\t\tmat.Right = Vector3.Cross(dir, up);\n\t\t\tmat.Up = Vector3.Cross(mat.Right, dir);\n\t\t\t\n\t\t\tfor (int i = 0; i < attempts; i++)\n\t\t\t{\n\t\t\t\tfloat x = ((float)Math.PI * 0.5f) + (((float)this.random.NextDouble() * 2.0f) - 1.0f) * radius;\n\t\t\t\tfloat y = (((float)this.random.NextDouble() * 2.0f) - 1.0f) * radius;\n\t\t\t\tVector3 ray = new Vector3((float)Math.Cos(x) * (float)Math.Cos(y), (float)Math.Sin(y), (float)Math.Sin(x) * (float)Math.Cos(y));\n\t\t\t\tVoxel.GlobalRaycastResult hit = Lemma.Components.Voxel.GlobalRaycast(pos, Vector3.TransformNormal(ray, mat), this.MovementDistance, (distance, block) => distance > 1);\n\t\t\t\tif (hit.Voxel != null && hit.Distance > 2.0f && this.VoxelFilter(hit.Coordinate.Value.Data.ID) && this.PositionFilter(hit.Position))\n\t\t\t\t{\n\t\t\t\t\tVoxel.Coord newCoord = hit.Coordinate.Value.Move(hit.Normal);\n\t\t\t\t\tif (hit.Voxel[newCoord].ID == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.LastCoord.Value = this.Coord;\n\t\t\t\t\t\tthis.Coord.Value = newCoord;\n\t\t\t\t\t\tthis.LastVoxel.Value = this.Voxel;\n\t\t\t\t\t\tthis.Voxel.Value = hit.Voxel.Entity;\n\t\t\t\t\t\tthis.Normal.Value = hit.Normal;\n\t\t\t\t\t\tthis.Blend.Value = 0.0f;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tradius += (float)Math.PI * 2.0f / (float)attempts;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/RaycastAIMovement.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class RaycastAIMovement : Component<Main>\n\t{\n\t\tpublic Property<int> OperationalRadius = new Property<int> { Value = 100 };\n\t\tpublic Property<Vector3> LastPosition = new Property<Vector3>();\n\t\tpublic Property<Vector3> NextPosition = new Property<Vector3>();\n\t\tpublic Property<float> PositionBlend = new Property<float>();\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Rift.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nusing Lemma.Util;\nusing System.Xml.Serialization;\nusing Lemma.Factories;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Rift : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic enum Style\n\t\t{\n\t\t\tIn, Up\n\t\t}\n\n\t\tprivate const float damageTime = 2.0f; // How long the player can stand in a rift before they die\n\t\tprivate const float interval = 0.015f; // A coordinate is emptied every x seconds\n\t\tprivate const int batch = 8; // Empty coordinates in batches\n\t\tprivate const float batchInterval = interval * batch;\n\t\tprivate const float particleInterval = 0.015f; // A particle is emitted every x seconds\n\t\tprivate const float inSoundInterval = 0.25f; // A sound is played every x seconds (In style)\n\t\tpublic Property<int> Radius = new Property<int> { Value = 10 };\n\t\tpublic Property<float> CurrentRadius = new Property<float>();\n\t\tpublic Property<int> CurrentIndex = new Property<int>();\n\t\tpublic Property<Entity.Handle> Voxel = new Property<Entity.Handle>();\n\t\tpublic Property<Voxel.Coord> Coordinate = new Property<Voxel.Coord>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic ListProperty<Voxel.Coord> Coords = new ListProperty<Voxel.Coord>();\n\t\tpublic Property<Style> Type = new Property<Style>();\n\n\t\tprivate Voxel voxel;\n\t\tprivate float intervalTimer;\n\t\tprivate float particleIntervalTimer;\n\t\tprivate float soundIntervalTimer;\n\t\tprivate ParticleSystem particles;\n\n\t\tprivate static List<VoxelFill.CoordinateEntry> coordSortCache = new List<VoxelFill.CoordinateEntry>();\n\t\tprivate static List<Rift> rifts = new List<Rift>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tSound.AttachTracker(this.Entity, this.Position);\n\t\t\tthis.particles = ParticleSystem.Get(this.main, \"Rift\");\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Add(new CommandBinding(this.Enable, (Action)this.go));\n\t\t\trifts.Add(this);\n\t\t}\n\n\t\tprivate void go()\n\t\t{\n\t\t\tif (this.Coords.Length == 0)\n\t\t\t{\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_RIFT_OPEN, this.Entity);\n\t\t\t\tif (PlayerFactory.Instance != null)\n\t\t\t\t\tPlayerFactory.Instance.Get<CameraController>().Shake.Execute(this.Position, 30.0f);\n\t\t\t\tEntity voxelEntity = this.Voxel.Value.Target;\n\t\t\t\tif (voxelEntity != null && voxelEntity.Active)\n\t\t\t\t{\n\t\t\t\t\tVoxel v = voxelEntity.Get<Voxel>();\n\t\t\t\t\tVoxel.Coord center = this.Coordinate;\n\t\t\t\t\tVector3 pos = v.GetRelativePosition(center);\n\t\t\t\t\tint radius = this.Radius;\n\t\t\t\t\tList<VoxelFill.CoordinateEntry> coords = Rift.coordSortCache;\n\t\t\t\t\tfor (Voxel.Coord x = center.Move(Direction.NegativeX, radius); x.X < center.X + radius; x.X++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (Voxel.Coord y = x.Move(Direction.NegativeY, radius); y.Y < center.Y + radius; y.Y++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (Voxel.Coord z = y.Move(Direction.NegativeZ, radius); z.Z < center.Z + radius; z.Z++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfloat distance = (pos - v.GetRelativePosition(z)).Length();\n\t\t\t\t\t\t\t\tif (distance <= radius && v[z] != Components.Voxel.States.Empty)\n\t\t\t\t\t\t\t\t\tcoords.Add(new VoxelFill.CoordinateEntry { Coord = z.Clone(), Distance = distance });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (coords.Count == 0)\n\t\t\t\t\t\tthis.Entity.Delete.Execute();\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcoords.Sort(new LambdaComparer<VoxelFill.CoordinateEntry>((x, y) => x.Distance.CompareTo(y.Distance)));\n\t\t\t\t\t\tthis.Coords.AddAll(coords.Select(x => x.Coord));\n\t\t\t\t\t\tcoords.Clear();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\trifts.Remove(this);\n\t\t}\n\n\t\tpublic static Rift Query(Vector3 pos)\n\t\t{\n\t\t\tfor (int i = 0; i < rifts.Count; i++)\n\t\t\t{\n\t\t\t\tRift r = rifts[i];\n\t\t\t\tif ((pos - r.Position).Length() < r.CurrentRadius)\n\t\t\t\t\treturn r;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate ImplodeBlockFactory blockFactory = Factory.Get<ImplodeBlockFactory>();\n\n\t\tprivate List<Voxel.Coord> removals = new List<Voxel.Coord>();\n\t\tprivate Random random = new Random();\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.Coords.Length == 0)\n\t\t\t\tthis.go();\n\t\t\telse if (this.CurrentIndex < this.Coords.Length)\n\t\t\t{\n\t\t\t\tif (this.voxel == null)\n\t\t\t\t{\n\t\t\t\t\tEntity v = this.Voxel.Value.Target;\n\t\t\t\t\tif (v != null && v.Active)\n\t\t\t\t\t\tthis.voxel = v.Get<Voxel>();\n\t\t\t\t}\n\t\t\t\telse if (this.voxel.Active)\n\t\t\t\t{\n\t\t\t\t\tthis.intervalTimer += dt;\n\n\t\t\t\t\tif (this.Type == Style.In)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.particleIntervalTimer += dt;\n\t\t\t\t\t\twhile (this.particleIntervalTimer > particleInterval)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.particleIntervalTimer -= particleInterval;\n\t\t\t\t\t\t\tthis.particles.AddParticle(this.Position, Vector3.Zero, -1.0f, this.CurrentRadius * 2.0f);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.soundIntervalTimer += dt;\n\t\t\t\t\tfloat soundInterval = this.Type == Style.In ? inSoundInterval : 0.35f + (float)random.NextDouble() * 0.35f;\n\t\t\t\t\twhile (this.soundIntervalTimer > soundInterval)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.soundIntervalTimer -= soundInterval;\n\t\t\t\t\t\tAkSoundEngine.PostEvent(this.Type == Style.In ? AK.EVENTS.PLAY_RIFT : AK.EVENTS.PLAY_RIFT_BLOCK, this.Entity);\n\t\t\t\t\t}\n\n\t\t\t\t\tbool regenerate = false;\n\t\t\t\t\tif (this.intervalTimer > batchInterval)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int i = 0; i < batch && this.CurrentIndex < this.Coords.Length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord c = this.Coords[this.CurrentIndex];\n\t\t\t\t\t\t\tif ((c.Data = this.voxel[c]) != Components.Voxel.States.Empty)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\tthis.removals.Add(c);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.CurrentIndex.Value++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (regenerate)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.intervalTimer -= batchInterval;\n\t\t\t\t\t\tthis.voxel.Empty(this.removals, true, true);\n\t\t\t\t\t\tforeach (Voxel.Coord c in this.removals)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.Type == Style.In)\n\t\t\t\t\t\t\t\tthis.blockFactory.Implode(main, this.voxel, c, c.Data, this.Position);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tthis.blockFactory.BlowAway(main, this.voxel, c, c.Data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.removals.Clear();\n\t\t\t\t\t\tthis.voxel.Regenerate();\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.CurrentRadius.Value = (this.voxel.GetRelativePosition(this.Coords[Math.Max(0, this.CurrentIndex - 1)]) - this.voxel.GetRelativePosition(this.Coordinate)).Length();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.Entity.Delete.Execute();\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis.Entity.Delete.Execute();\n\t\t}\n\n\t\tpublic static void AttachEditorComponents(Entity entity, Main main, Vector3 color)\n\t\t{\n\t\t\tRift rift = entity.Get<Rift>();\n\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\sphere\";\n\t\t\tmodel.Alpha.Value = 0.15f;\n\t\t\tmodel.Color.Value = color;\n\t\t\tmodel.DisableCulling.Value = true;\n\t\t\tmodel.Add(new Binding<Vector3, int>(model.Scale, x => new Vector3(x), rift.Radius));\n\t\t\tmodel.Serialize = false;\n\t\t\tmodel.DrawOrder.Value = 11; // In front of water\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, entity.EditorSelected));\n\n\t\t\tentity.Add(model);\n\n\t\t\tmodel.Add(new Binding<Matrix, Vector3>(model.Transform, x => Matrix.CreateTranslation(x), rift.Position));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Rotator.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Rotator : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<Vector3> Velocity = new Property<Vector3>();\n\t\tpublic ListProperty<Entity.Handle> Targets = new ListProperty<Entity.Handle>();\n\n\t\tpublic Rotator()\n\t\t{\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"Velocity\", this.Velocity);\n\t\t}\n\n\t\tprivate List<Transform> transforms = new List<Transform>();\n\t\tprivate List<Voxel> voxels = new List<Voxel>();\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tforeach (Entity.Handle handle in this.Targets)\n\t\t\t\t{\n\t\t\t\t\tEntity e = handle.Target;\n\t\t\t\t\tif (e != null && e.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.transforms.Add(e.Get<Transform>());\n\t\t\t\t\t\tVoxel v = e.Get<Voxel>();\n\t\t\t\t\t\tif (v != null)\n\t\t\t\t\t\t\tthis.voxels.Add(v);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.transforms.Count == 0)\n\t\t\t\tthis.Delete.Execute();\n\t\t\telse\n\t\t\t{\n\t\t\t\tVector3 v = this.Velocity.Value * dt;\n\t\t\t\tQuaternion diff = Microsoft.Xna.Framework.Quaternion.CreateFromYawPitchRoll(v.Y, v.X, v.Z);\n\t\t\t\tfor (int i = 0; i < this.transforms.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tTransform t = this.transforms[i];\n\t\t\t\t\tif (t.Active)\n\t\t\t\t\t\tt.Quaternion.Value *= diff;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.transforms.RemoveAt(i);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tv = this.Velocity;\n\t\t\t\tfor (int i = 0; i < this.voxels.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tVoxel voxel = this.voxels[i];\n\t\t\t\t\tif (voxel.Active)\n\t\t\t\t\t\tvoxel.AngularVelocity.Value = v;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.voxels.RemoveAt(i);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/SceneryBlock.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class SceneryBlock : Component<Main>\n\t{\n\t\tpublic static List<SceneryBlock> All = new List<SceneryBlock>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> Valid = new Property<bool>();\n\n\t\tpublic Property<Voxel.t> Type = new Property<Voxel.t>();\n\n\t\tpublic Property<float> Scale = new Property<float> { Value = 1.0f };\n\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"Type\", this.Type);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.Add(new SetBinding<Voxel.t>(this.Type, delegate(Voxel.t value)\n\t\t\t{\n\t\t\t\tif (value == Voxel.t.Empty)\n\t\t\t\t\tthis.Valid.Value = false;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tVoxel.States.All[value].ApplyToBlock(this.Entity);\n\t\t\t\t\tthis.Valid.Value = true;\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tSceneryBlock.All.Add(this);\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tSceneryBlock.All.Remove(this);\n\t\t\tbase.delete();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Script.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Console;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing System.CodeDom.Compiler;\nusing System.Reflection;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Script : Component<Main>\n\t{\n\t\tpublic const string ScriptExtension = \"cs\";\n\t\tpublic const string BinaryExtension = \"dll\";\n\t\tpublic const string ScriptNamespace = \"Lemma.GameScripts\";\n\n\t\tpublic Property<string> Name = new Property<string>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Execute = new Command();\n\n\t\tpublic Property<bool> ExecuteOnLoad = new Property<bool> { Value = true };\n\n\t\tpublic Property<bool> DeleteOnExecute = new Property<bool>();\n\n\t\tprivate struct ScriptMethods\n\t\t{\n\t\t\tpublic MethodInfo Run;\n\t\t\tpublic MethodInfo EditorProperties;\n\t\t\tpublic MethodInfo Commands;\n\t\t}\n\n\t\tprivate ScriptMethods methods;\n\n\t\t/// <summary>\n\t\t/// Tries to use reflection to load \n\t\t/// </summary>\n\t\t/// <param name=\"main\"></param>\n\t\t/// <param name=\"name\"></param>\n\t\t/// <param name=\"scriptEntity\"></param>\n\t\t/// <param name=\"errors\"></param>\n\t\t/// <returns></returns>\n\t\tprivate static ScriptMethods GetInternalScriptMethods(Main main, string name, Entity scriptEntity, out string errors)\n\t\t{\n\t\t\terrors = null;\n\t\t\tAssembly assembly = Assembly.GetExecutingAssembly();\n\t\t\tforeach (var type in assembly.GetTypes())\n\t\t\t{\n\t\t\t\tif (type.Namespace == Script.ScriptNamespace)\n\t\t\t\t{\n\t\t\t\t\tif (type.IsClass && type.BaseType == typeof(GameScripts.ScriptBase) && type.Name == name)\n\t\t\t\t\t{\n\t\t\t\t\t\tMethodInfo run = type.GetMethod(\"Run\", BindingFlags.Static | BindingFlags.Public);\n\t\t\t\t\t\tif (run == null)\n\t\t\t\t\t\t\terrors = \"Could not find public static method Run in \" + name;\n\n\t\t\t\t\t\treturn new ScriptMethods\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tRun = run,\n\t\t\t\t\t\t\tEditorProperties = type.GetMethod(\"EditorProperties\", BindingFlags.Static | BindingFlags.Public),\n\t\t\t\t\t\t\tCommands = type.GetMethod(\"Commands\", BindingFlags.Static | BindingFlags.Public),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\terrors = \"Could not find class \" + name;\n\t\t\treturn new ScriptMethods();\n\t\t}\n\n\t\tprivate bool loadedPreviously;\n\t\tprivate IEnumerable<string> editorProperties;\n\t\tprivate IEnumerable<string> commands;\n\n\t\tprivate void load(string name)\n\t\t{\n\t\t\tif (this.loadedPreviously)\n\t\t\t{\n\t\t\t\tif (this.editorProperties != null)\n\t\t\t\t{\n\t\t\t\t\tforeach (string prop in this.editorProperties)\n\t\t\t\t\t\tthis.Entity.RemoveProperty(prop);\n\t\t\t\t\tthis.editorProperties = null;\n\t\t\t\t}\n\t\t\t\tif (this.commands != null)\n\t\t\t\t{\n\t\t\t\t\tforeach (string cmd in this.commands)\n\t\t\t\t\t\tthis.Entity.RemoveCommand(cmd);\n\t\t\t\t\tthis.commands = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.methods = new ScriptMethods();\n\t\t\tif (!string.IsNullOrEmpty(name))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tstring errors;\n\t\t\t\t\tthis.methods = GetInternalScriptMethods(this.main, name, this.Entity, out errors);\n\t\t\t\t\tif (this.methods.EditorProperties != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tobject result = this.methods.EditorProperties.Invoke(null, this.parameters);\n\t\t\t\t\t\tthis.editorProperties = result as IEnumerable<string>;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.methods.Commands != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tobject result = this.methods.Commands.Invoke(null, this.parameters);\n\t\t\t\t\t\tthis.commands = result as IEnumerable<string>;\n\t\t\t\t\t}\n\t\t\t\t\tthis.loadedPreviously = true;\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tLog.d(e.ToString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate object[] parameters;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tif (Lemma.GameScripts.ScriptBase.main == null)\n\t\t\t{\n\t\t\t\tLemma.GameScripts.ScriptBase.main = main;\n\t\t\t\tLemma.GameScripts.ScriptBase.renderer = main.Renderer;\n\t\t\t}\n\t\t\tthis.parameters = new object[] { this.Entity };\n\t\t\tthis.Add(new ChangeBinding<string>(this.Name, delegate(string old, string value)\n\t\t\t{\n\t\t\t\tif (value != old)\n\t\t\t\t\tthis.load(value);\n\t\t\t}));\n\n\t\t\tthis.Execute.Action = delegate()\n\t\t\t{\n\t\t\t\tif (this.methods.Run != null)\n\t\t\t\t\tthis.methods.Run.Invoke(null, this.parameters);\n\n\t\t\t\tif (this.DeleteOnExecute)\n\t\t\t\t{\n\t\t\t\t\tif (this.Entity != null)\n\t\t\t\t\t\tthis.Entity.Add(new Animation(new Animation.Execute(this.Delete)));\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.main.AddComponent(new Animation(new Animation.Execute(this.Delete)));\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (!this.main.EditorEnabled && this.ExecuteOnLoad)\n\t\t\t\tthis.Execute.Execute();\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Scriptlike/AnimatedSetter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class AnimatedSetter : Setter\n\t{\n\t\tpublic Property<Animation.Ease.EaseType> Blend = new Property<Animation.Ease.EaseType>();\n\t\tpublic Property<float> Duration = new Property<float>();\n\t\t[XmlIgnore]\n\t\tpublic Command OnDone = new Command();\n\t\tprivate Animation animation;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Set.Action = this.set;\n\t\t\tthis.OnDone.Action = this.onDone;\n\t\t}\n\n\t\tprivate void onDone()\n\t\t{\n\t\t\tthis.animation = null;\n\t\t}\n\n\t\tprivate void set()\n\t\t{\n\t\t\tthis.FindProperties();\n\t\t\tif (this.targetProperty != null)\n\t\t\t{\n\t\t\t\tif (this.animation != null && this.animation.Active)\n\t\t\t\t\tthis.animation.Delete.Execute();\n\n\t\t\t\tAnimation.Interval interval = null;\n\t\t\t\tswitch (this.PropertyType.Value)\n\t\t\t\t{\n\t\t\t\t\tcase PropType.Bool:\n\t\t\t\t\t\tinterval = new Animation.Set<bool>((Property<bool>)this.targetProperty, this.Bool);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Int:\n\t\t\t\t\t\tinterval = new Animation.IntMoveTo((Property<int>)this.targetProperty, this.Int, this.Duration);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Float:\n\t\t\t\t\t\tinterval = new Animation.FloatMoveTo((Property<float>)this.targetProperty, this.Float, this.Duration);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Vector2:\n\t\t\t\t\t\tinterval = new Animation.Vector2MoveTo((Property<Vector2>)this.targetProperty, this.Vector2, this.Duration);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Vector3:\n\t\t\t\t\t\tinterval = new Animation.Vector3MoveTo((Property<Vector3>)this.targetProperty, this.Vector3, this.Duration);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Vector4:\n\t\t\t\t\t\tinterval = new Animation.Vector4MoveTo((Property<Vector4>)this.targetProperty, this.Vector4, this.Duration);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Coord:\n\t\t\t\t\t\tinterval = new Animation.Set<Voxel.Coord>((Property<Voxel.Coord>)this.targetProperty, this.Coord);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Direction:\n\t\t\t\t\t\tinterval = new Animation.Set<Direction>((Property<Direction>)this.targetProperty, this.Direction);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.String:\n\t\t\t\t\t\tinterval = new Animation.Set<string>((Property<string>)this.targetProperty, this.String);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthis.animation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Ease(interval, this.Blend),\n\t\t\t\t\tnew Animation.Execute(this.OnDone)\n\t\t\t\t);\n\t\t\t\tthis.Entity.Add(this.animation);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Scriptlike/Binder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing GeeUI.Views;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Binder : Component<Main>\n\t{\n\t\tpublic Property<Setter.PropType> PropertyType = new Property<Setter.PropType>();\n\n\t\tpublic Property<Entity.Handle> InTarget = new Property<Entity.Handle>();\n\t\tpublic Property<Entity.Handle> OutTarget = new Property<Entity.Handle>();\n\n\t\tpublic Property<string> TargetInProperty = new Property<string>();\n\t\tpublic Property<string> TargetOutProperty = new Property<string>();\n\n\t\tpublic Property<bool> TwoWay = new Property<bool>();\n\t\tpublic Property<bool> BindImmediately = new Property<bool> { Value = true };\n\n\t\t[XmlIgnore]\n\t\tpublic Command Bind = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command UnBind = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Set = new Command();\n\n\t\tprivate IProperty targetInProperty;\n\t\tprivate IProperty targetOutProperty;\n\n\t\tprivate NotifyBinding _inChanged;\n\t\tprivate NotifyBinding _outChanged;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Bind.Action = () =>\n\t\t\t{\n\t\t\t\tthis.FindProperties();\n\t\t\t\tif (this.targetInProperty != null)\n\t\t\t\t{\n\t\t\t\t\tif (this._inChanged == null)\n\t\t\t\t\t\t_inChanged = new NotifyBinding(InChanged, this.Enabled, targetInProperty);\n\t\t\t\t\tthis.Add(_inChanged);\n\t\t\t\t\tif (this.Enabled)\n\t\t\t\t\t\tInChanged();\n\t\t\t\t}\n\n\t\t\t\tif (this.targetOutProperty != null && this.TwoWay)\n\t\t\t\t{\n\t\t\t\t\tif (this._outChanged == null)\n\t\t\t\t\t\t_outChanged = new NotifyBinding(OutChanged, this.Enabled, targetOutProperty);\n\t\t\t\t\tthis.Add(_outChanged);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.UnBind.Action = () =>\n\t\t\t{\n\t\t\t\tif (this._inChanged != null) this.Remove(_inChanged);\n\t\t\t\tif (this._outChanged != null) this.Remove(_outChanged);\n\t\t\t};\n\n\t\t\tthis.Set.Action = () =>\n\t\t\t{\n\t\t\t\tthis.FindProperties();\n\t\t\t\tif (this.targetInProperty != null)\n\t\t\t\t{\n\t\t\t\t\tInChanged();\n\t\t\t\t}\n\t\t\t};\n\t\t\tbase.Awake();\n\n\t\t\tif (this.BindImmediately)\n\t\t\t\tthis.Bind.Execute();\n\t\t}\n\n\t\tprivate object GetPropertyValue(ref IProperty prop)\n\t\t{\n\t\t\tif (prop == null) return null;\n\t\t\tswitch (this.PropertyType.Value)\n\t\t\t{\n\t\t\t\tcase Setter.PropType.Bool:\n\t\t\t\t\treturn ((Property<bool>)prop).Value;\n\t\t\t\tcase Setter.PropType.Int:\n\t\t\t\t\treturn ((Property<int>)prop).Value;\n\t\t\t\tcase Setter.PropType.Float:\n\t\t\t\t\treturn ((Property<float>)prop).Value;\n\t\t\t\tcase Setter.PropType.Vector2:\n\t\t\t\t\treturn ((Property<Vector2>)prop).Value;\n\t\t\t\tcase Setter.PropType.Vector3:\n\t\t\t\t\treturn ((Property<Vector3>)prop).Value;\n\t\t\t\tcase Setter.PropType.Vector4:\n\t\t\t\t\treturn ((Property<Vector4>)prop).Value;\n\t\t\t\tcase Setter.PropType.Coord:\n\t\t\t\t\treturn ((Property<Voxel.Coord>)prop).Value;\n\t\t\t\tcase Setter.PropType.Direction:\n\t\t\t\t\treturn ((Property<Direction>)prop).Value;\n\t\t\t\tcase Setter.PropType.String:\n\t\t\t\t\treturn ((Property<string>)prop).Value;\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tprivate void SetPropertyValue(ref IProperty prop, object value)\n\t\t{\n\t\t\tif (prop == null) return;\n\t\t\tswitch (this.PropertyType.Value)\n\t\t\t{\n\t\t\t\tcase Setter.PropType.Bool:\n\t\t\t\t\t((Property<bool>)prop).Value = (bool)value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Setter.PropType.Int:\n\t\t\t\t\t((Property<int>)prop).Value = (int)value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Setter.PropType.Float:\n\t\t\t\t\t((Property<float>)prop).Value = (float)value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Setter.PropType.Vector2:\n\t\t\t\t\t((Property<Vector2>)prop).Value = (Vector2)value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Setter.PropType.Vector3:\n\t\t\t\t\t((Property<Vector3>)prop).Value = (Vector3)value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Setter.PropType.Vector4:\n\t\t\t\t\t((Property<Vector4>)prop).Value = (Vector4)value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Setter.PropType.Coord:\n\t\t\t\t\t((Property<Voxel.Coord>)prop).Value = (Voxel.Coord)value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Setter.PropType.Direction:\n\t\t\t\t\t((Property<Direction>)prop).Value = (Direction)value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Setter.PropType.String:\n\t\t\t\t\t((Property<string>)prop).Value = (string)value;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tprivate void InChanged()\n\t\t{\n\t\t\tif (this.targetOutProperty != null)\n\t\t\t{\n\t\t\t\tobject val = GetPropertyValue(ref targetInProperty);\n\t\t\t\tif (val != null)\n\t\t\t\t\tSetPropertyValue(ref targetOutProperty, val);\n\t\t\t}\n\t\t}\n\n\t\tprivate void OutChanged()\n\t\t{\n\t\t\tif (this.targetInProperty != null && this.TwoWay)\n\t\t\t{\n\t\t\t\tobject val = GetPropertyValue(ref targetOutProperty);\n\t\t\t\tobject inVal = GetPropertyValue(ref targetInProperty);\n\n\t\t\t\t//Avoid stack overflow\n\t\t\t\tif (val != null && !val.Equals(inVal))\n\t\t\t\t\tSetPropertyValue(ref targetInProperty, val);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tthis.FindProperties();\n\t\t}\n\n\t\tprivate void FindProperty(ref IProperty prop, Entity entity, string name)\n\t\t{\n\t\t\tif (entity != null && entity.Active)\n\t\t\t{\n\t\t\t\tswitch (this.PropertyType.Value)\n\t\t\t\t{\n\t\t\t\t\tcase Setter.PropType.Bool:\n\t\t\t\t\t\tprop = entity.GetProperty<bool>(name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Setter.PropType.Int:\n\t\t\t\t\t\tprop = entity.GetProperty<int>(name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Setter.PropType.Float:\n\t\t\t\t\t\tprop = entity.GetProperty<float>(name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Setter.PropType.Vector2:\n\t\t\t\t\t\tprop = entity.GetProperty<Vector2>(name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Setter.PropType.Vector3:\n\t\t\t\t\t\tprop = entity.GetProperty<Vector3>(name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Setter.PropType.Vector4:\n\t\t\t\t\t\tprop = entity.GetProperty<Vector4>(name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Setter.PropType.Coord:\n\t\t\t\t\t\tprop = entity.GetProperty<Voxel.Coord>(name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Setter.PropType.Direction:\n\t\t\t\t\t\tprop = entity.GetProperty<Direction>(name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Setter.PropType.String:\n\t\t\t\t\t\tprop = entity.GetProperty<string>(name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void FindProperties()\n\t\t{\n\t\t\tif (this.targetInProperty == null)\n\t\t\t{\n\t\t\t\tEntity entity = this.InTarget.Value.Target;\n\t\t\t\tFindProperty(ref targetInProperty, entity, TargetInProperty);\n\t\t\t}\n\t\t\tif (this.targetOutProperty == null)\n\t\t\t{\n\t\t\t\tEntity entity = this.OutTarget.Value.Target;\n\t\t\t\tFindProperty(ref targetOutProperty, entity, TargetOutProperty);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Scriptlike/ConsoleCommand.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Factories;\nusing ComponentBind;\nusing System.Xml.Serialization;\nusing Lemma.Console;\n\nnamespace Lemma.Components\n{\n\tpublic class ConsoleCommand : Component<Main>\n\t{\n\t\tpublic Property<string> Name = new Property<string>();\n\t\tpublic Property<string> Description = new Property<string>();\n\t\tpublic Property<bool> EnabledInRelease = new Property<bool>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Execute = new Command();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n#if !DEVELOPMENT\n\t\t\tif (!this.EnabledInRelease)\n\t\t\t\tthis.Delete.Execute();\n\t\t\telse\n\t\t\t{\n#endif\n\t\t\t\tLemma.Console.Console.AddConCommand(new ConCommand(this.Name, this.Description, collection =>\n\t\t\t\t{\n\t\t\t\t\tif (this.Active)\n\t\t\t\t\t\tthis.Execute.Execute();\n\t\t\t\t}));\n#if !DEVELOPMENT\n\t\t\t}\n#endif\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n#if !DEVELOPMENT\n\t\t\tif (this.EnabledInRelease)\n#endif\n\t\t\t\tLemma.Console.Console.RemoveConCommand(this.Name);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Scriptlike/Constant.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Constant : Component<Main>\n\t{\n\t\tpublic Property<float> FloatProperty = new Property<float>();\n\t\tpublic Property<int> IntProperty = new Property<int>();\n\t\tpublic Property<bool> BoolProperty = new Property<bool>();\n\t\tpublic Property<string> StringProperty = new Property<string>();\n\t\tpublic Property<Vector3> Vector3Property = new Property<Vector3>();\n\t\tpublic Property<Vector4> Vector4Property = new Property<Vector4>();\n\t\tpublic Property<Direction> DirectionProperty = new Property<Direction>();\n\n\t\tpublic Constant()\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Scriptlike/Counter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Runtime.Remoting.Messaging;\nusing System.Text;\nusing System.Windows.Forms;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Counter : Component<Main>\n\t{\n\t\tpublic Property<int> IncrementBy = new Property<int> { Value = 1 };\n\t\tpublic Property<int> StartingValue = new Property<int>();\n\n\t\tpublic Property<bool> OnlyOnce = new Property<bool>();\n\t\tpublic Property<bool> HasHitTarget = new Property<bool>();\n\n\t\tpublic Property<int> Target = new Property<int> { Value = 4 };\n\n\t\tpublic Property<int> Count = new Property<int>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Increment = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Reset = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnTargetHit = new Command();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Reset.Action = () =>\n\t\t\t{\n\t\t\t\tthis.Count.Value = this.StartingValue.Value;\n\t\t\t\tthis.HasHitTarget.Value = false;\n\t\t\t};\n\t\t\tthis.Increment.Action = () =>\n\t\t\t{\n\t\t\t\tint oldCount = this.Count;\n\t\t\t\tthis.Count.Value += this.IncrementBy.Value;\n\t\t\t\t\n\t\t\t\tif (!this.OnlyOnce || !this.HasHitTarget)\n\t\t\t\t{\n\t\t\t\t\tbool execute = false;\n\t\t\t\t\tif (this.IncrementBy.Value < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.Count <= this.Target && oldCount > this.Target)\n\t\t\t\t\t\t\texecute = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.IncrementBy.Value > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.Count >= this.Target && oldCount < this.Target)\n\t\t\t\t\t\t\texecute = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (execute)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.HasHitTarget.Value = true;\n\t\t\t\t\t\tthis.OnTargetHit.Execute();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (this.main.EditorEnabled)\n\t\t\t\tthis.Add(new Binding<int>(this.Count, this.StartingValue));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Scriptlike/LogicGate.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Runtime.Remoting.Messaging;\nusing System.Text;\nusing System.Windows.Forms;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class LogicGate : Component<Main>\n\t{\n\t\tpublic enum LogicMode { And, Nand, Or, Nor, ExclusiveOr, ExclusiveNor }\n\n\t\tpublic Property<LogicMode> Mode = new Property<LogicMode>();\n\n\t\tpublic Property<bool> Input1 = new Property<bool>();\n\n\t\tpublic Property<Entity.Handle> Input1Target = new Property<Entity.Handle>();\n\n\t\tpublic Property<string> Input1TargetProperty = new Property<string>();\n\n\t\tpublic Property<bool> Input2 = new Property<bool>();\n\n\t\tpublic Property<Entity.Handle> Input2Target = new Property<Entity.Handle>();\n\n\t\tpublic Property<string> Input2TargetProperty = new Property<string>();\n\n\t\tpublic Property<bool> Output = new Property<bool>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Input1On = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Input1Off = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Input2On = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Input2Off = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OutputOn = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OutputOff = new Command();\n\n\t\tprotected Binding<bool> input1Binding;\n\t\tprotected Binding<bool> input2Binding;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Add(new CommandBinding(this.Input1On, () => !this.Input1, delegate()\n\t\t\t{\n\t\t\t\tthis.Input1.Value = true;\n\t\t\t}));\n\t\t\tthis.Add(new CommandBinding(this.Input1Off, () => this.Input1, delegate()\n\t\t\t{\n\t\t\t\tthis.Input1.Value = false;\n\t\t\t}));\n\t\t\tthis.Add(new CommandBinding(this.Input2On, () => !this.Input2, delegate()\n\t\t\t{\n\t\t\t\tthis.Input2.Value = true;\n\t\t\t}));\n\t\t\tthis.Add(new CommandBinding(this.Input2Off, () => this.Input2, delegate()\n\t\t\t{\n\t\t\t\tthis.Input2.Value = false;\n\t\t\t}));\n\t\t\tthis.Add(new ChangeBinding<bool>(this.Input1, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (!old && value)\n\t\t\t\t\tthis.Input1On.Execute();\n\t\t\t\telse if (old && !value)\n\t\t\t\t\tthis.Input1Off.Execute();\n\t\t\t}));\n\t\t\tthis.Add(new ChangeBinding<bool>(this.Input2, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (!old && value)\n\t\t\t\t\tthis.Input2On.Execute();\n\t\t\t\telse if (old && !value)\n\t\t\t\t\tthis.Input2Off.Execute();\n\t\t\t}));\n\t\t\tthis.Add(new ChangeBinding<bool>(this.Output, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (!old && value)\n\t\t\t\t\tthis.OutputOn.Execute();\n\t\t\t\telse if (old && !value)\n\t\t\t\t\tthis.OutputOff.Execute();\n\t\t\t}));\n\t\t\tthis.Add(new NotifyBinding(this.evaluate, this.Input1, this.Input2, this.Mode));\n\t\t}\n\n\t\tprivate void evaluate()\n\t\t{\n\t\t\tswitch (this.Mode.Value)\n\t\t\t{\n\t\t\t\tcase LogicMode.And:\n\t\t\t\t\tthis.Output.Value = this.Input1 && this.Input2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LogicMode.Nand:\n\t\t\t\t\tthis.Output.Value = !(this.Input1 && this.Input2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LogicMode.Or:\n\t\t\t\t\tthis.Output.Value = this.Input1 || this.Input2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LogicMode.Nor:\n\t\t\t\t\tthis.Output.Value = !(this.Input1 || this.Input2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LogicMode.ExclusiveOr:\n\t\t\t\t\tthis.Output.Value = this.Input1 ^ this.Input2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LogicMode.ExclusiveNor:\n\t\t\t\t\tthis.Output.Value = !(this.Input1 ^ this.Input2);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tthis.FindProperties();\n\t\t}\n\n\t\tpublic void FindProperties()\n\t\t{\n\t\t\tif (this.input1Binding == null)\n\t\t\t{\n\t\t\t\tEntity entity = this.Input1Target.Value.Target;\n\t\t\t\tif (entity != null && entity.Active)\n\t\t\t\t{\n\t\t\t\t\tProperty<bool> targetProperty = entity.GetProperty<bool>(this.Input1TargetProperty);\n\t\t\t\t\tif (targetProperty != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.input1Binding = new Binding<bool>(this.Input1, targetProperty);\n\t\t\t\t\t\tentity.Add(this.input1Binding);\n\t\t\t\t\t\tentity.Add(new CommandBinding(entity.Delete, delegate() { this.input1Binding = null; }));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.input2Binding == null)\n\t\t\t{\n\t\t\t\tEntity entity = this.Input2Target.Value.Target;\n\t\t\t\tif (entity != null && entity.Active)\n\t\t\t\t{\n\t\t\t\t\tProperty<bool> targetProperty = entity.GetProperty<bool>(this.Input2TargetProperty);\n\t\t\t\t\tif (targetProperty != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.input2Binding = new Binding<bool>(this.Input2, targetProperty);\n\t\t\t\t\t\tentity.Add(this.input2Binding);\n\t\t\t\t\t\tentity.Add(new CommandBinding(entity.Delete, delegate() { this.input2Binding = null; }));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tif (this.input1Binding != null)\n\t\t\t{\n\t\t\t\tEntity entity = this.Input1Target.Value.Target;\n\t\t\t\tif (entity != null && entity.Active)\n\t\t\t\t\tentity.Remove(this.input1Binding);\n\t\t\t\tthis.input1Binding = null;\n\t\t\t}\n\t\t\tif (this.input2Binding != null)\n\t\t\t{\n\t\t\t\tEntity entity = this.Input2Target.Value.Target;\n\t\t\t\tif (entity != null && entity.Active)\n\t\t\t\t\tentity.Remove(this.input2Binding);\n\t\t\t\tthis.input2Binding = null;\n\t\t\t}\n\t\t\tbase.delete();\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Scriptlike/MessageDisplayer.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class MessageDisplayer : Component<Main>\n\t{\n\t\tpublic Property<string> Message = new Property<string>();\n\t\tpublic Property<float> DisplayLength = new Property<float>();\n\t\tpublic Property<bool> OneTimeOnly = new Property<bool>();\n\n\t\tprivate bool displayed;\n \n\t\t[XmlIgnore]\n\t\tpublic Command Display = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Hide = new Command();\n\n\t\tprivate Container messageContainer = null;\n\n\t\tpublic MessageDisplayer()\n\t\t{\n\t\t\tthis.Display.Action = () =>\n\t\t\t{\n\t\t\t\tif (!this.displayed || !this.OneTimeOnly)\n\t\t\t\t{\n\t\t\t\t\tthis.displayed = true;\n\t\t\t\t\tthis.messageContainer = this.main.Menu.ShowMessage(Entity, () => Message.Value, Message);\n\t\t\t\t\tif (this.DisplayLength > 0)\n\t\t\t\t\t\tthis.main.Menu.HideMessage(this.Entity, this.messageContainer, this.DisplayLength);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.Hide.Action = () =>\n\t\t\t{\n\t\t\t\tthis.main.Menu.HideMessage(Entity, this.messageContainer);\n\t\t\t\tthis.messageContainer = null;\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Scriptlike/RandomTicker.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class RandomTicker : Component<Main>, IUpdateableComponent\n\t{\n\t\tprivate static Random random = new Random();\n\t\tpublic Property<float> MaxInterval = new Property<float> { Value = 2 };\n\t\tpublic Property<float> MinInterval = new Property<float> { Value = 1 };\n\t\tpublic Property<int> NumToFire = new Property<int> { Value = -1 };\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnFire = new Command();\n\n\t\tpublic Property<float> Timer = new Property<float>();\n\n\t\tpublic RandomTicker()\n\t\t{\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\t\t\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tif (this.Timer == 0)\n\t\t\t\tthis.Timer.Value = this.MinInterval + ((float)random.NextDouble() * (this.MaxInterval - this.MinInterval));\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.NumToFire != 0)\n\t\t\t{\n\t\t\t\tthis.Timer.Value -= dt;\n\t\t\t\tif (this.Timer < 0)\n\t\t\t\t{\n\t\t\t\t\tthis.Timer.Value = this.MinInterval + ((float)random.NextDouble() * (this.MaxInterval - this.MinInterval));\n\t\t\t\t\tthis.NumToFire.Value--;\n\t\t\t\t\tthis.OnFire.Execute();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Scriptlike/Scriptlike.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Scriptlike : Component<Main>\n\t{\n\t\tpublic static void AttachEditorComponents(Entity entity, Main main, Vector3 color)\n\t\t{\n\t\t\tTransform transform = entity.Get<Transform>();\n\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\pyramid\";\n\t\t\tmodel.Color.Value = color;\n\t\t\tmodel.DisableCulling.Value = true;\n\t\t\tmodel.Serialize = false;\n\n\t\t\tentity.Add(model);\n\n\t\t\tmodel.Add(new Binding<Matrix, Vector3>(model.Transform, x => Matrix.CreateTranslation(x), transform.Position));\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Scriptlike/Sequence.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Sequence : Component<Main>\n\t{\n\t\t[XmlIgnore]\n\t\tpublic Command Commands = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Advance = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Reset = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Done = new Command();\n\n\t\tpublic Property<int> Index = new Property<int>();\n\n\t\tpublic Sequence()\n\t\t{\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Advance.Action = this.advance;\n\t\t\tthis.Reset.Action = this.reset;\n\t\t}\n\n\t\tprivate void reset()\n\t\t{\n\t\t\tthis.Index.Value = 0;\n\t\t}\n\t\t\n\t\tprivate void advance()\n\t\t{\n\t\t\tif (this.Index < this.Commands.Bindings.Count)\n\t\t\t\t((CommandBinding)this.Commands.Bindings[this.Index]).Execute();\n\t\t\telse if (this.Index == this.Commands.Bindings.Count - 1)\n\t\t\t\tthis.Done.Execute();\n\t\t\tthis.Index.Value++;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Scriptlike/Setter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Setter : Component<Main>\n\t{\n\t\tpublic enum PropType { Bool, Int, Float, Direction, String, Vector2, Vector3, Vector4, Coord }\n\t\tpublic Property<bool> Bool = new Property<bool>();\n\t\tpublic Property<int> Int = new Property<int>();\n\t\tpublic Property<float> Float = new Property<float>();\n\t\tpublic Property<Direction> Direction = new Property<Direction>();\n\t\tpublic Property<string> String = new Property<string>();\n\t\tpublic Property<Vector2> Vector2 = new Property<Vector2>();\n\t\tpublic Property<Vector3> Vector3 = new Property<Vector3>();\n\t\tpublic Property<Vector4> Vector4 = new Property<Vector4>();\n\t\tpublic Property<Voxel.Coord> Coord = new Property<Voxel.Coord>();\n\t\tpublic Property<PropType> PropertyType = new Property<PropType>();\n\n\t\tpublic static Dictionary<PropType, Type> TypeMapping = new Dictionary<PropType,Type>\n\t\t{\n\t\t\t{ PropType.Bool, typeof(bool) },\n\t\t\t{ PropType.Int, typeof(int) },\n\t\t\t{ PropType.Float, typeof(float) },\n\t\t\t{ PropType.Direction, typeof(Direction) },\n\t\t\t{ PropType.String, typeof(string) },\n\t\t\t{ PropType.Vector2, typeof(Vector2) },\n\t\t\t{ PropType.Vector3, typeof(Vector3) },\n\t\t\t{ PropType.Vector4, typeof(Vector4) },\n\t\t\t{ PropType.Coord, typeof(Voxel.Coord) },\n\t\t};\n\n\t\tpublic Property<Entity.Handle> Target = new Property<Entity.Handle>();\n\n\t\tpublic Property<string> TargetProperty = new Property<string>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Set = new Command();\n\n\t\tprotected IProperty targetProperty;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Set.Action = this.set;\n\t\t\tbase.Awake();\n\t\t}\n\n\t\tprivate void set()\n\t\t{\n\t\t\tthis.FindProperties();\n\t\t\tif (this.targetProperty != null)\n\t\t\t{\n\t\t\t\tswitch (this.PropertyType.Value)\n\t\t\t\t{\n\t\t\t\t\tcase PropType.Bool:\n\t\t\t\t\t\t((Property<bool>)this.targetProperty).Value = this.Bool;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Int:\n\t\t\t\t\t\t((Property<int>)this.targetProperty).Value = this.Int;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Float:\n\t\t\t\t\t\t((Property<float>)this.targetProperty).Value = this.Float;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Vector2:\n\t\t\t\t\t\t((Property<Vector2>)this.targetProperty).Value = this.Vector2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Vector3:\n\t\t\t\t\t\t((Property<Vector3>)this.targetProperty).Value = this.Vector3;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Vector4:\n\t\t\t\t\t\t((Property<Vector4>)this.targetProperty).Value = this.Vector4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Coord:\n\t\t\t\t\t\t((Property<Voxel.Coord>)this.targetProperty).Value = this.Coord;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.Direction:\n\t\t\t\t\t\t((Property<Direction>)this.targetProperty).Value = this.Direction;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PropType.String:\n\t\t\t\t\t\t((Property<string>)this.targetProperty).Value = this.String;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tthis.FindProperties();\n\t\t}\n\n\t\tpublic void FindProperties()\n\t\t{\n\t\t\tif (this.targetProperty == null)\n\t\t\t{\n\t\t\t\tEntity entity = this.Target.Value.Target;\n\t\t\t\tif (entity != null && entity.Active)\n\t\t\t\t{\n\t\t\t\t\tswitch (this.PropertyType.Value)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase PropType.Bool:\n\t\t\t\t\t\t\tthis.targetProperty = entity.GetProperty<bool>(this.TargetProperty);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase PropType.Int:\n\t\t\t\t\t\t\tthis.targetProperty = entity.GetProperty<int>(this.TargetProperty);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase PropType.Float:\n\t\t\t\t\t\t\tthis.targetProperty = entity.GetProperty<float>(this.TargetProperty);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase PropType.Vector2:\n\t\t\t\t\t\t\tthis.targetProperty = entity.GetProperty<Vector2>(this.TargetProperty);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase PropType.Vector3:\n\t\t\t\t\t\t\tthis.targetProperty = entity.GetProperty<Vector3>(this.TargetProperty);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase PropType.Vector4:\n\t\t\t\t\t\t\tthis.targetProperty = entity.GetProperty<Vector4>(this.TargetProperty);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase PropType.Coord:\n\t\t\t\t\t\t\tthis.targetProperty = entity.GetProperty<Voxel.Coord>(this.TargetProperty);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase PropType.Direction:\n\t\t\t\t\t\t\tthis.targetProperty = entity.GetProperty<Direction>(this.TargetProperty);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase PropType.String:\n\t\t\t\t\t\t\tthis.targetProperty = entity.GetProperty<string>(this.TargetProperty);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Scriptlike/Ticker.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Ticker : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<float> Interval = new Property<float> { Value = 1 };\n\t\tpublic Property<int> NumToFire = new Property<int> { Value = -1 };\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnFire = new Command();\n\n\t\tpublic Property<float> Timer = new Property<float>();\n\n\t\tpublic Ticker()\n\t\t{\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.NumToFire != 0)\n\t\t\t{\n\t\t\t\tthis.Timer.Value += dt;\n\t\t\t\tif (this.Interval.Value > 0 && this.Timer > this.Interval.Value)\n\t\t\t\t{\n\t\t\t\t\tthis.Timer.Value -= this.Interval.Value;\n\t\t\t\t\tif (this.NumToFire > 0)\n\t\t\t\t\t\tthis.NumToFire.Value--;\n\t\t\t\t\tthis.OnFire.Execute();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/SignalTower.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nusing Lemma.Util;\nusing System.Xml.Serialization;\nusing Lemma.Factories;\nusing Microsoft.Xna.Framework.Input;\nusing Microsoft.Xna.Framework.Audio;\nusing System.IO;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class SignalTower : Component<Main>\n\t{\n\t\tpublic static List<SignalTower> All = new List<SignalTower>();\n\n\t\tpublic Property<string> Initial = new Property<string>();\n\t\tpublic Property<Entity.Handle> Player = new Property<Entity.Handle>();\n\n\t\tprivate const float messageDelay = 2.0f;\n\n\t\t[XmlIgnore]\n\t\tpublic Command PlayerEnteredRange = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command PlayerExitedRange = new Command();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.PlayerEnteredRange.Action = delegate()\n\t\t\t{\n\t\t\t\tPhone phone = PlayerDataFactory.Instance.Get<Phone>();\n\n\t\t\t\tif (!string.IsNullOrEmpty(this.Initial))\n\t\t\t\t{\n\t\t\t\t\tDialogueForest forest = WorldFactory.Instance.Get<World>().DialogueForest;\n\t\t\t\t\tDialogueForest.Node n = forest.GetByName(this.Initial);\n\t\t\t\t\tif (n == null)\n\t\t\t\t\t\tLog.d(string.Format(\"Could not find dialogue node {0}\", this.Initial));\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (n.type == DialogueForest.Node.Type.Choice)\n\t\t\t\t\t\t\tthrow new Exception(\"Cannot start dialogue tree with a choice\");\n\t\t\t\t\t\tphone.Execute(n);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (phone.Schedules.Length > 0) // We sent a message. That means this signal tower cannot execute again.\n\t\t\t\t\t\tthis.Initial.Value = null;\n\t\t\t\t\t\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_SIGNAL_TOWER_ACTIVATE, this.Entity);\n\t\t\t\t}\n\n\t\t\t\tPlayerFactory.Instance.Get<Player>().SignalTower.Value = this.Entity;\n\t\t\t};\n\n\t\t\tthis.PlayerExitedRange.Action = delegate()\n\t\t\t{\n\t\t\t\tPhone phone = PlayerDataFactory.Instance.Get<Phone>();\n\n\t\t\t\tif (!string.IsNullOrEmpty(this.Initial)) // The player did not interact.\n\t\t\t\t\tphone.ActiveAnswers.Clear();\n\n\t\t\t\tif (PlayerFactory.Instance != null)\n\t\t\t\t\tPlayerFactory.Instance.Get<Player>().SignalTower.Value = null;\n\t\t\t};\n\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_SIGNAL_TOWER_LOOP, this.Entity);\n\n\t\t\tSignalTower.All.Add(this);\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tSignalTower.All.Remove(this);\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_SIGNAL_TOWER_LOOP, this.Entity);\n\t\t\tEntity player = this.Player.Value.Target;\n\t\t\tif (player != null && player.Active)\n\t\t\t{\n\t\t\t\tProperty<Entity.Handle> signalTowerHandle = player.Get<Player>().SignalTower;\n\t\t\t\tif (signalTowerHandle.Value.Target == this.Entity)\n\t\t\t\t\tsignalTowerHandle.Value = null;\n\t\t\t}\n\t\t\tbase.delete();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Skybox.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Skybox : Component<Main>\n\t{\n\t\tpublic Property<bool> Vertical = new Property<bool>();\n\t\tpublic Property<float> GodRays = new Property<float> { Value = 0.25f };\n\t\tpublic Property<float> GodRayExtinction = new Property<float> { Value = 1.0f };\n\t\tpublic Property<float> VerticalSize = new Property<float> { Value = 10.0f };\n\t\tpublic Property<float> VerticalCenter = new Property<float>();\n\t\tpublic Property<float> StartDistance = new Property<float> { Value = 50.0f };\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Slider.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing BEPUphysics;\nusing BEPUphysics.Constraints.SolverGroups;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Slider : Component<Main>, IUpdateableComponent\n\t{\n\t\t[XmlIgnore]\n\t\tpublic Property<Direction> Direction = new Property<Direction>();\n\n\t\tpublic Property<uint> MovementLoop = new Property<uint> { Value = AK.EVENTS.SLIDER2_LOOP };\n\t\tpublic Property<uint> MovementStop = new Property<uint> { Value = AK.EVENTS.SLIDER2_STOP };\n\t\tpublic Property<int> Minimum = new Property<int>();\n\t\tpublic Property<int> Maximum = new Property<int>();\n\t\tpublic Property<bool> Locked = new Property<bool>();\n\t\tpublic Property<float> Speed = new Property<float>();\n\t\tpublic Property<int> Goal = new Property<int>();\n\t\tpublic Property<bool> Servo = new Property<bool>();\n\t\tpublic Property<bool> StartAtMinimum = new Property<bool>();\n\t\tpublic Property<float> MaxForce = new Property<float>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnHitMin = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnHitMax = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Forward = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Backward = new Command();\n\n\t\tprivate PrismaticJoint joint = null;\n\t\tprivate float lastX;\n\t\tprivate bool soundPlaying;\n\n\t\tprivate void setLimits()\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t{\n\t\t\t\tint min = this.Minimum, max = this.Maximum;\n\t\t\t\tif (max > min)\n\t\t\t\t{\n\t\t\t\t\tthis.joint.Limit.IsActive = true;\n\t\t\t\t\tthis.joint.Limit.Minimum = this.Minimum;\n\t\t\t\t\tthis.joint.Limit.Maximum = this.Maximum;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.joint.Limit.IsActive = false;\n\t\t\t}\n\t\t}\n\n\t\tprivate void updateMaterial()\n\t\t{\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tDynamicVoxel map = this.Entity.Get<DynamicVoxel>();\n\t\t\t\tif (map != null)\n\t\t\t\t{\n\t\t\t\t\tbool active = this.Locked && (!this.Servo || (this.Servo && this.Goal.Value != this.Minimum.Value));\n\n\t\t\t\t\tVoxel.State desired = active ? Voxel.States.SliderPowered : Voxel.States.Slider;\n\t\t\t\t\tVoxel.t currentID = map[0, 0, 0].ID;\n\t\t\t\t\tif (currentID != desired.ID & (currentID == Voxel.t.Slider || currentID == Voxel.t.SliderPowered))\n\t\t\t\t\t{\n\t\t\t\t\t\tList<Voxel.Coord> coords = map.GetContiguousByType(new[] { map.GetBox(0, 0, 0) }).SelectMany(x => x.GetCoords()).ToList();\n\t\t\t\t\t\tmap.Empty(coords, true, true, null, false);\n\t\t\t\t\t\tforeach (Voxel.Coord c in coords)\n\t\t\t\t\t\t\tmap.Fill(c, desired);\n\t\t\t\t\t\tmap.Regenerate();\n\t\t\t\t\t}\n\t\t\t\t\tmap.PhysicsEntity.ActivityInformation.Activate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void setSpeed()\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t{\n\t\t\t\tthis.joint.Motor.Settings.Servo.BaseCorrectiveSpeed = this.Speed;\n\t\t\t\tthis.joint.Motor.Settings.VelocityMotor.GoalVelocity = this.Speed;\n\t\t\t}\n\t\t\tthis.updateMaterial();\n\t\t}\n\n\t\tprivate void setLocked()\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t\tthis.joint.Motor.IsActive = this.Locked;\n\t\t\tthis.updateMaterial();\n\t\t}\n\n\t\tprivate void setGoal()\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t\tthis.joint.Motor.Settings.Servo.Goal = this.Goal;\n\t\t\tthis.updateMaterial();\n\t\t}\n\n\t\tprivate void setMode()\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t\tthis.joint.Motor.Settings.Mode = this.Servo ? MotorMode.Servomechanism : MotorMode.VelocityMotor;\n\t\t\tthis.updateMaterial();\n\t\t}\n\n\t\tprivate void setMaxForce()\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t{\n\t\t\t\tfloat f = this.MaxForce;\n\t\t\t\tthis.joint.Motor.Settings.MaximumForce = f == 0.0f ? float.MaxValue : f;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Move(int value)\n\t\t{\n\t\t\tif (this.Locked)\n\t\t\t\tthis.Goal.Value = value;\n\t\t}\n\n\t\tprivate BEPUphysics.Entities.Entity physicsEntity;\n\t\tpublic ISpaceObject CreateJoint(BEPUphysics.Entities.Entity entity1, BEPUphysics.Entities.Entity entity2, Vector3 pos, Vector3 direction, Vector3 anchor)\n\t\t{\n\t\t\t// entity1 is us\n\t\t\t// entity2 is the main map we are attaching to\n\t\t\tthis.physicsEntity = entity1;\n\t\t\tVector3 originalPos = entity1.Position;\n\t\t\tentity1.Position = pos;\n\t\t\tthis.joint = new PrismaticJoint(entity2, entity1, pos, direction, pos);\n\t\t\tentity1.Position = originalPos;\n\t\t\tthis.setLimits();\n\t\t\tthis.setLocked();\n\t\t\tthis.setSpeed();\n\t\t\tthis.setGoal();\n\t\t\tthis.setMode();\n\t\t\tthis.setMaxForce();\n\t\t\tthis.joint.Motor.Settings.Servo.SpringSettings.StiffnessConstant = 0.03f;\n\t\t\tthis.joint.Limit.Update(0.0f);\n\t\t\tVector3 separation = this.joint.Limit.AnchorB - this.joint.Limit.AnchorA;\n\t\t\tthis.lastX = Vector3.Dot(separation, this.joint.Limit.Axis);\n\t\t\treturn this.joint;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.Add(new NotifyBinding(this.setLimits, this.Minimum, this.Maximum));\n\t\t\tthis.Add(new NotifyBinding(this.setSpeed, this.Speed));\n\t\t\tthis.Add(new NotifyBinding(this.setLocked, this.Locked));\n\t\t\tthis.Add(new NotifyBinding(this.setGoal, this.Goal));\n\t\t\tthis.Add(new NotifyBinding(this.setMode, this.Servo));\n\t\t\tthis.Add(new NotifyBinding(this.setMaxForce, this.MaxForce));\n\n\t\t\tthis.Forward.Action = delegate() { this.Move(this.Maximum); };\n\t\t\tthis.Backward.Action = delegate() { this.Move(this.Minimum); };\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tif (this.StartAtMinimum)\n\t\t\t\t{\n\t\t\t\t\tthis.StartAtMinimum.Value = false;\n\t\t\t\t\tTransform transform = this.Entity.GetOrCreate<Transform>(\"MapTransform\");\n\t\t\t\t\ttransform.Selectable.Value = false;\n\t\t\t\t\tDynamicVoxel map = this.Entity.Get<DynamicVoxel>();\n\t\t\t\t\ttransform.Position.Value = map.GetAbsolutePosition(new Voxel.Coord().Move(this.Direction, this.Minimum));\n\t\t\t\t}\n\n\t\t\t\tAction stopMovement = delegate()\n\t\t\t\t{\n\t\t\t\t\tif (this.main.TotalTime > 0.1f && this.MovementStop.Value != 0)\n\t\t\t\t\t\tAkSoundEngine.PostEvent(this.MovementStop, this.Entity);\n\t\t\t\t\telse\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_ALL_OBJECT, this.Entity);\n\t\t\t\t\tthis.soundPlaying = false;\n\t\t\t\t};\n\t\t\t\tthis.Add(new CommandBinding(this.OnHitMax, stopMovement));\n\t\t\t\tthis.Add(new CommandBinding(this.OnHitMin, stopMovement));\n\t\t\t}\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t{\n\t\t\t\tVector3 separation = this.joint.Limit.AnchorB - this.joint.Limit.AnchorA;\n\n\t\t\t\tfloat x = Vector3.Dot(separation, this.joint.Limit.Axis);\n\n\t\t\t\tbool nearEdge = false;\n\t\t\t\tconst float threshold = 0.1f;\n\t\t\t\tif (x > this.Maximum - threshold)\n\t\t\t\t{\n\t\t\t\t\tif (this.lastX <= this.Maximum - threshold)\n\t\t\t\t\t\tthis.OnHitMax.Execute();\n\t\t\t\t\tnearEdge = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (x < this.Minimum + threshold)\n\t\t\t\t{\n\t\t\t\t\tif (this.lastX >= this.Minimum + threshold)\n\t\t\t\t\t\tthis.OnHitMin.Execute();\n\t\t\t\t\tnearEdge = true;\n\t\t\t\t}\n\n\t\t\t\tthis.lastX = x;\n\n\t\t\t\tif (!nearEdge)\n\t\t\t\t{\n\t\t\t\t\tfloat speed = Vector3.Dot(this.physicsEntity.LinearVelocity, this.joint.Limit.Axis);\n\t\t\t\t\tbool moving = speed > 0.5f;\n\t\t\t\t\tif (this.soundPlaying && !moving)\n\t\t\t\t\t{\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_ALL_OBJECT, this.Entity);\n\t\t\t\t\t\tthis.soundPlaying = false;\n\t\t\t\t\t}\n\t\t\t\t\telse if (!this.soundPlaying && moving)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.MovementLoop.Value != 0)\n\t\t\t\t\t\t\tAkSoundEngine.PostEvent(this.MovementLoop, this.Entity);\n\t\t\t\t\t\tthis.soundPlaying = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/SliderCommon.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class SliderCommon : Component<Main>\n\t{\n\t\t// Original transform of the slider at spawn\n\t\tpublic Property<Matrix> OriginalTransform = new Property<Matrix>();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Smoke.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Smoke : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<Vector3> Velocity = new Property<Vector3>();\n\t\tpublic Property<float> Lifetime = new Property<float>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tthis.Lifetime.Value += dt;\n\t\t\tif (this.Lifetime > 1.0f)\n\t\t\t\tthis.Delete.Execute();\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.Velocity.Value += new Vector3(0, dt * -11.0f, 0);\n\t\t\t\tthis.Position.Value += this.Velocity.Value * dt;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Snake.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Snake : Component<Main>\n\t{\n\t\tpublic Property<float> OperationalRadius = new Property<float> { Value = 100.0f };\n\n\t\tpublic ListProperty<Voxel.Coord> Path = new ListProperty<Voxel.Coord>();\n\n\t\tpublic Property<Voxel.Coord> CrushCoordinate = new Property<Voxel.Coord>();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Sound.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Sound : Component<Main>\n\t{\n\t\tpublic Property<uint> PlayCue = new Property<uint>();\n\t\tpublic Property<uint> StopCue = new Property<uint>();\n\t\tpublic Property<bool> Is3D = new Property<bool>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Play = new Command();\n\n\t\tpublic static void AttachTracker(Entity entity, Property<Matrix> property = null)\n\t\t{\n\t\t\tAkGameObjectTracker tracker = entity.Get<AkGameObjectTracker>();\n\t\t\tif (tracker == null)\n\t\t\t{\n\t\t\t\ttracker = new AkGameObjectTracker();\n\t\t\t\tentity.Add(tracker);\n\t\t\t\tif (property == null)\n\t\t\t\t\tproperty = entity.Get<Transform>().Matrix;\n\t\t\t\ttracker.Add(new Binding<Matrix>(tracker.Matrix, property));\n\t\t\t\tAkAuxSendArray aux = new AkAuxSendArray(Zone.MaxAuxSend);\n\t\t\t\ttracker.Add(new NotifyBinding(delegate() { tracker.AuxSend(aux, Zone.AuxSend(property.Value.Translation, aux)); }, property));\n\t\t\t}\n\t\t}\n\n\t\tpublic static void AttachTracker(Entity entity, Property<Vector3> property)\n\t\t{\n\t\t\tAkGameObjectTracker tracker = entity.Get<AkGameObjectTracker>();\n\t\t\tif (tracker == null)\n\t\t\t{\n\t\t\t\ttracker = new AkGameObjectTracker();\n\t\t\t\tentity.Add(tracker);\n\t\t\t\ttracker.Add(new Binding<Matrix, Vector3>(tracker.Matrix, x => Microsoft.Xna.Framework.Matrix.CreateTranslation(x), property));\n\t\t\t\tAkAuxSendArray aux = new AkAuxSendArray(Zone.MaxAuxSend);\n\t\t\t\ttracker.Add(new NotifyBinding(delegate() { tracker.AuxSend(aux, Zone.AuxSend(property, aux)); }, property));\n\t\t\t}\n\t\t}\n\n\t\tpublic static uint RegisterTemp(Vector3 pos)\n\t\t{\n\t\t\tAkAuxSendArray array = new AkAuxSendArray(Zone.MaxAuxSend);\n\t\t\tZone.AuxSend(pos, array);\n\t\t\treturn AkSoundEngine.RegisterTemp(pos, array);\n\t\t}\n\n\t\tpublic static void PostEvent(uint e, Vector3 pos)\n\t\t{\n\t\t\tAkAuxSendArray array = new AkAuxSendArray(Zone.MaxAuxSend);\n\t\t\tZone.AuxSend(pos, array);\n\t\t\tAkSoundEngine.PostEvent(e, pos, array);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tSound.AttachTracker(this.Entity, this.Position);\n\n\t\t\tthis.Entity.CannotSuspendByDistance = !this.Is3D;\n\t\t\tthis.Entity.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tthis.Entity.CannotSuspendByDistance = !this.Is3D;\n\t\t\t}, this.Is3D));\n\n\t\t\tthis.Play.Action = this.play;\n\t\t\tthis.Add(new CommandBinding(this.Disable, (Action)this.stop));\n\t\t\tthis.Add(new CommandBinding(this.OnSuspended, (Action)this.stop));\n\t\t}\n\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"Play\", this.Play);\n\t\t\tthis.Entity.Add(\"PlayCue\", this.PlayCue, new PropertyEntry.EditorData { Options = WwisePicker.Get(main) });\n\t\t\tthis.Entity.Add(\"StopCue\", this.StopCue, new PropertyEntry.EditorData { Options = WwisePicker.Get(main) });\n\t\t\tthis.Entity.Add(\"Is3D\", this.Is3D);\n\t\t}\n\n\t\tprivate void play()\n\t\t{\n\t\t\tif (this.PlayCue != 0 && this.Enabled && !this.Suspended && !this.main.EditorEnabled)\n\t\t\t\tAkSoundEngine.PostEvent(this.PlayCue, this.Entity);\n\t\t}\n\n\t\tprivate void stop()\n\t\t{\n\t\t\tif (this.StopCue != 0)\n\t\t\t\tAkSoundEngine.PostEvent(this.StopCue, this.Entity);\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tthis.stop();\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/SoundBank.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class SoundBank : Component<Main>\n\t{\n\t\tpublic Property<string> Name = new Property<string>();\n\n\t\tpublic const string Extension = \".bnk\";\n\n\t\tprivate uint bank_id;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tif (!this.main.EditorEnabled && !string.IsNullOrEmpty(this.Name))\n\t\t\t{\n\t\t\t\tAKRESULT result = AkSoundEngine.LoadBank(this.Name, AkSoundEngine.AK_DEFAULT_POOL_ID, out this.bank_id);\n\t\t\t\tif (result != AKRESULT.AK_Success)\n\t\t\t\t\tLog.d(string.Format(\"Failed to load soundbank {0}: {1}\", this.Name, result));\n\t\t\t}\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tif (this.bank_id != 0)\n\t\t\t{\n\t\t\t\tint memory_pool_id;\n\t\t\t\tAkSoundEngine.UnloadBank(this.bank_id, IntPtr.Zero, out memory_pool_id);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/SoundKiller.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing System.Collections;\nusing Microsoft.Xna.Framework;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class SoundKiller : Component<Main>\n\t{\n\t\tpublic ListProperty<uint> Events = new ListProperty<uint>();\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Serialize = false;\n\n\t\t\tthis.Add(new CommandBinding(this.Delete, delegate()\n\t\t\t{\n\t\t\t\tforeach (uint e in this.Events)\n\t\t\t\t\tAkSoundEngine.PostEvent(e, this.Entity);\n\t\t\t}));\n\t\t}\n\n\t\tpublic static void Add(Entity entity, params uint[] events)\n\t\t{\n\t\t\tSoundKiller killer = entity.GetOrCreate<SoundKiller>();\n\t\t\tforeach (uint e in events)\n\t\t\t\tkiller.Events.Add(e);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Spawner.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Spawner : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic bool CanSpawn = true;\n\n\t\tprivate const float StartGamma = 10.0f;\n\t\tprivate static Vector3 StartTint = new Vector3(2.0f);\n\n\t\tpublic Property<string> StartSpawnPoint = new Property<string>();\n\t\tpublic Property<ulong> StartSpawnPointGUID = new Property<ulong>();\n\n\t\tpublic Command PlayerSpawned = new Command();\n\n\t\tprivate float respawnTimer;\n\n\t\tpublic const int RespawnMemoryLength = 200;\n\t\tpublic const float DefaultRespawnDistance = 0.0f;\n\t\tpublic const float DefaultRespawnInterval = 0.5f;\n\t\tpublic const float KilledRespawnDistance = 60.0f;\n\t\tpublic const float KilledRespawnInterval = 4.0f;\n\n\t\tpublic float RespawnDistance = DefaultRespawnDistance;\n\t\tpublic float RespawnInterval = DefaultRespawnInterval;\n\n\t\tprivate const float spawnHeightOffset = 2;\n\n\t\tprivate Vector3 lastPlayerPosition;\n\n\t\tprivate Entity editor;\n\n\t\tprivate Vector3 lastEditorPosition;\n\t\tprivate Vector2 lastEditorMouse;\n\t\tprivate string lastEditorSpawnPoint;\n\t\tprivate ulong lastEditorSpawnPointGUID;\n\n\t\tprivate bool mapJustLoaded = false;\n\n\t\tpublic void ResetTimer()\n\t\t{\n\t\t\tthis.respawnTimer = 0.01f; // To avoid spawning duplicate flash animations\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tthis.EnabledInEditMode = true;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tbase.Awake();\n\n\t\t\tstring lastMap = this.main.MapFile;\n\t\t\tthis.Add(new CommandBinding(this.main.MapLoaded, delegate()\n\t\t\t{\n\t\t\t\tCameraStop.CinematicActive.Value = false;\n\t\t\t\tif (this.main.MapFile.Value == Main.MenuMap)\n\t\t\t\t{\n\t\t\t\t\tthis.CanSpawn = false;\n\t\t\t\t\tthis.main.Renderer.InternalGamma.Value = 0.0f;\n\t\t\t\t\tthis.main.Renderer.Brightness.Value = 0.0f;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.CanSpawn = true;\n\t\t\t\t\tthis.main.Renderer.InternalGamma.Value = Spawner.StartGamma;\n\t\t\t\t\tthis.main.Renderer.Brightness.Value = 1.0f;\n\t\t\t\t}\n\n\t\t\t\tif (PlayerFactory.Instance == null)\n\t\t\t\t\tthis.RespawnInterval = 0.0f;\n\n\t\t\t\tif (this.main.MapFile != lastMap)\n\t\t\t\t{\n\t\t\t\t\tthis.lastEditorPosition = Vector3.Zero;\n\t\t\t\t\tthis.lastEditorMouse = Vector2.Zero;\n\t\t\t\t\tthis.lastEditorSpawnPoint = null;\n\t\t\t\t\tthis.lastEditorSpawnPointGUID = 0;\n\t\t\t\t\tlastMap = this.main.MapFile;\n\t\t\t\t}\n\n\t\t\t\tthis.respawnTimer = 0.0f;\n\t\t\t\tthis.mapJustLoaded = true;\n\t\t\t}));\n\t\t}\n\n\t\tpublic Animation.Parallel FlashAnimation()\n\t\t{\n\t\t\treturn new Animation.Parallel\n\t\t\t(\n\t\t\t\tnew Animation.Vector3MoveTo(this.main.Renderer.Tint, Spawner.StartTint, 0.5f),\n\t\t\t\tnew Animation.FloatMoveTo(this.main.Renderer.InternalGamma, Spawner.StartGamma, 0.5f),\n\t\t\t\tnew Animation.FloatMoveTo(this.main.Renderer.Brightness, 1.0f, 0.5f)\n\t\t\t);\n\t\t}\n\n\t\tpublic Animation.Parallel EndFlashAnimation()\n\t\t{\n\t\t\treturn new Animation.Parallel\n\t\t\t(\n\t\t\t\tnew Animation.Vector3MoveTo(this.main.Renderer.Tint, Vector3.One, 0.5f),\n\t\t\t\tnew Animation.FloatMoveTo(this.main.Renderer.InternalGamma, 0.0f, 0.5f),\n\t\t\t\tnew Animation.FloatMoveTo(this.main.Renderer.Brightness, 0.0f, 0.5f)\n\t\t\t);\n\t\t}\n\n\t\tprivate void spawn()\n\t\t{\n\t\t\tFactory.Get<PlayerFactory>().CreateAndBind(this.main);\n\t\t\tthis.main.Add(PlayerFactory.Instance);\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\t// Spawn an editor or a player if needed\n\t\t\tif (this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tthis.main.Renderer.InternalGamma.Value = 0.0f;\n\t\t\t\tthis.main.Renderer.Brightness.Value = 0.0f;\n\t\t\t\tif (this.editor == null || !this.editor.Active)\n\t\t\t\t{\n\t\t\t\t\tthis.editor = Factory.Get<EditorFactory>().CreateAndBind(this.main);\n\t\t\t\t\tFPSInput.RecenterMouse();\n\t\t\t\t\tthis.editor.Get<Editor>().Position.Value = this.lastEditorPosition;\n\t\t\t\t\tthis.editor.Get<FPSInput>().Mouse.Value = this.lastEditorMouse;\n\t\t\t\t\tthis.StartSpawnPoint.Value = this.lastEditorSpawnPoint;\n\t\t\t\t\tthis.StartSpawnPointGUID.Value = this.lastEditorSpawnPointGUID;\n\t\t\t\t\tthis.main.Add(this.editor);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.lastEditorPosition = this.editor.Get<Editor>().Position;\n\t\t\t\t\tthis.lastEditorMouse = this.editor.Get<FPSInput>().Mouse;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (this.main.MapFile.Value == null || !this.CanSpawn || CameraStop.CinematicActive)\n\t\t\t\t\treturn;\n\n\t\t\t\tthis.editor = null;\n\n\t\t\t\tbool createPlayer = PlayerFactory.Instance == null;\n\n\t\t\t\tif (this.mapJustLoaded)\n\t\t\t\t{\n\t\t\t\t\tif (!createPlayer)\n\t\t\t\t\t{\n\t\t\t\t\t\t// We just loaded a save game\n\t\t\t\t\t\tthis.main.Renderer.InternalGamma.Value = 0.0f;\n\t\t\t\t\t\tthis.main.Renderer.Brightness.Value = 0.0f;\n\t\t\t\t\t\tthis.PlayerSpawned.Execute();\n\t\t\t\t\t}\n\t\t\t\t\tthis.respawnTimer = 0;\n\t\t\t\t}\n\t\t\t\telse if (createPlayer)\n\t\t\t\t{\n\t\t\t\t\tif (this.respawnTimer == 0)\n\t\t\t\t\t\tthis.main.AddComponent(new Animation(this.FlashAnimation()));\n\n\t\t\t\t\tif (this.respawnTimer > this.RespawnInterval)\n\t\t\t\t\t{\n\t\t\t\t\t\tbool spawnFound = false;\n\n\t\t\t\t\t\tRespawnLocation foundSpawnLocation = default(RespawnLocation);\n\t\t\t\t\t\tVector3 foundSpawnAbsolutePosition = Vector3.Zero;\n\n\t\t\t\t\t\tif (string.IsNullOrEmpty(this.StartSpawnPoint) && this.StartSpawnPointGUID == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Look for an autosaved spawn point\n\t\t\t\t\t\t\tEntity playerData = PlayerDataFactory.Instance;\n\t\t\t\t\t\t\tif (playerData != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tListProperty<RespawnLocation> respawnLocations = playerData.Get<PlayerData>().RespawnLocations;\n\t\t\t\t\t\t\t\tint supportedLocations = 0;\n\t\t\t\t\t\t\t\tfloat lowerLimit = Factory.Get<LowerLimitFactory>().GetLowerLimit();\n\t\t\t\t\t\t\t\twhile (respawnLocations.Length > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tRespawnLocation respawnLocation = respawnLocations[respawnLocations.Length - 1];\n\t\t\t\t\t\t\t\t\tEntity respawnMapEntity = respawnLocation.Map.Target;\n\t\t\t\t\t\t\t\t\tif (respawnMapEntity != null && respawnMapEntity.Active)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tVoxel respawnMap = respawnMapEntity.Get<Voxel>();\n\t\t\t\t\t\t\t\t\t\tVector3 absolutePos = respawnMap.GetAbsolutePosition(respawnLocation.Coordinate);\n\t\t\t\t\t\t\t\t\t\tif (respawnMap.Active\n\t\t\t\t\t\t\t\t\t\t\t&& absolutePos.Y > lowerLimit\n\t\t\t\t\t\t\t\t\t\t\t&& respawnMap.GetAbsoluteVector(respawnMap.GetRelativeDirection(Direction.PositiveY).GetVector()).Y > 0.5f\n\t\t\t\t\t\t\t\t\t\t\t&& Agent.Query(absolutePos, 0.0f, 20.0f) == null\n\t\t\t\t\t\t\t\t\t\t\t&& Rift.Query(absolutePos) == null\n\t\t\t\t\t\t\t\t\t\t\t&& Zone.CanSpawnAt(absolutePos))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tVoxel.State state = respawnMap[respawnLocation.Coordinate];\n\t\t\t\t\t\t\t\t\t\t\tif (state != Voxel.States.Empty && state != Voxel.States.Infected && state != Voxel.States.HardInfected && state != Voxel.States.Floater)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tsupportedLocations++;\n\t\t\t\t\t\t\t\t\t\t\t\tDynamicVoxel dynamicMap = respawnMap as DynamicVoxel;\n\t\t\t\t\t\t\t\t\t\t\t\tif (dynamicMap == null || absolutePos.Y > respawnLocation.OriginalPosition.Y - 1.0f)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tVoxel.GlobalRaycastResult hit = Voxel.GlobalRaycast(absolutePos + new Vector3(0, 1, 0), Vector3.Up, 2);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (hit.Voxel == null)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// We can spawn here\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tspawnFound = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfoundSpawnLocation = respawnLocation;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfoundSpawnAbsolutePosition = absolutePos;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (supportedLocations >= 40 || (spawnFound && (foundSpawnAbsolutePosition - this.lastPlayerPosition).Length() > this.RespawnDistance))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (supportedLocations > 3) // We should try to spawn the player back at least a few steps\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\trespawnLocations.RemoveAt(respawnLocations.Length - 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (spawnFound)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Spawn at an autosaved location\n\t\t\t\t\t\t\tif (createPlayer)\n\t\t\t\t\t\t\t\tthis.spawn();\n\t\t\t\t\t\t\tVector3 absolutePos = foundSpawnLocation.Map.Target.Get<Voxel>().GetAbsolutePosition(foundSpawnLocation.Coordinate);\n\t\t\t\t\t\t\tPlayerFactory.Instance.Get<Transform>().Position.Value = this.main.Camera.Position.Value = absolutePos + new Vector3(0, spawnHeightOffset, 0);\n\n\t\t\t\t\t\t\tFPSInput.RecenterMouse();\n\t\t\t\t\t\t\tPlayerFactory.Instance.Get<FPSInput>().Mouse.Value = new Vector2(foundSpawnLocation.Rotation, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Spawn at a spawn point\n\t\t\t\t\t\t\tPlayerSpawn spawn = null;\n\t\t\t\t\t\t\tEntity spawnEntity = null;\n\t\t\t\t\t\t\tif (this.StartSpawnPointGUID != 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tspawnEntity = this.main.GetByGUID(this.StartSpawnPointGUID);\n\t\t\t\t\t\t\t\tif (spawnEntity != null)\n\t\t\t\t\t\t\t\t\tspawn = spawnEntity.Get<PlayerSpawn>();\n\t\t\t\t\t\t\t\tthis.lastEditorSpawnPointGUID = this.StartSpawnPointGUID;\n\t\t\t\t\t\t\t\tthis.StartSpawnPointGUID.Value = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (!string.IsNullOrEmpty(this.StartSpawnPoint.Value))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tspawnEntity = this.main.GetByID(this.StartSpawnPoint);\n\t\t\t\t\t\t\t\tif (spawnEntity != null)\n\t\t\t\t\t\t\t\t\tspawn = spawnEntity.Get<PlayerSpawn>();\n\t\t\t\t\t\t\t\tthis.lastEditorSpawnPoint = this.StartSpawnPoint;\n\t\t\t\t\t\t\t\tthis.StartSpawnPoint.Value = null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (spawnEntity == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tspawn = PlayerSpawn.FirstActive();\n\t\t\t\t\t\t\t\tspawnEntity = spawn == null ? null : spawn.Entity;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (spawnEntity != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tVector3 pos = spawnEntity.Get<Transform>().Position;\n\t\t\t\t\t\t\t\tmain.Camera.Position.Value = pos;\n\t\t\t\t\t\t\t\tWorldFactory.Instance.Get<World>().UpdateZones();\n\t\t\t\t\t\t\t\tVoxel.GlobalRaycastResult hit = Voxel.GlobalRaycast(pos + new Vector3(0, 2, 0), Vector3.Down, 8, null, false, true);\n\t\t\t\t\t\t\t\tif (hit.Voxel == null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// There is nowhere to spawn. Reload the map.\n\t\t\t\t\t\t\t\t\tthis.respawnTimer = 0;\n\t\t\t\t\t\t\t\t\tIO.MapLoader.Load(this.main, this.main.MapFile);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (createPlayer)\n\t\t\t\t\t\t\t\t\t\tthis.spawn();\n\t\t\t\t\t\t\t\t\tpos = hit.Position + new Vector3(0, spawnHeightOffset, 0);\n\t\t\t\t\t\t\t\t\tPlayerFactory.Instance.Get<Transform>().Position.Value = this.main.Camera.Position.Value = pos;\n\n\t\t\t\t\t\t\t\t\tif (spawn != null)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tspawn.IsActivated.Value = true;\n\t\t\t\t\t\t\t\t\t\tFPSInput.RecenterMouse();\n\t\t\t\t\t\t\t\t\t\tPlayerFactory.Instance.Get<FPSInput>().Mouse.Value = new Vector2(spawn.Rotation, 0);\n\t\t\t\t\t\t\t\t\t\tspawn.OnSpawn.Execute();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// When the player teleports to a new map, show the number of orbs and notes on that map\n\t\t\t\t\t\t// If mapJustLoaded is true, we just loaded a save game\n\t\t\t\t\t\tif (this.main.TotalTime < Spawner.DefaultRespawnInterval * 2 && !this.mapJustLoaded)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tWorldFactory.Instance.Add(new Animation\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tnew Animation.Delay(1.5f),\n\t\t\t\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tint notes = Note.UncollectedCount;\n\t\t\t\t\t\t\t\t\tif (notes > 0)\n\t\t\t\t\t\t\t\t\t\tthis.main.Menu.HideMessage(WorldFactory.Instance, this.main.Menu.ShowMessageFormat(WorldFactory.Instance, notes == 1 ? \"\\\\one note\" : \"\\\\note count\", notes), 3.0f);\n\n\t\t\t\t\t\t\t\t\tint orbs = Collectible.ActiveCount;\n\t\t\t\t\t\t\t\t\tif (orbs > 0)\n\t\t\t\t\t\t\t\t\t\tthis.main.Menu.HideMessage(WorldFactory.Instance, this.main.Menu.ShowMessageFormat(WorldFactory.Instance, orbs == 1 ? \"\\\\one orb\" : \"\\\\orb count\", orbs), 3.0f);\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tWorldFactory.Instance.Add(new Animation(this.EndFlashAnimation()));\n\t\t\t\t\t\tthis.respawnTimer = 0;\n\n\t\t\t\t\t\tif (PlayerFactory.Instance != null)\n\t\t\t\t\t\t\tthis.PlayerSpawned.Execute();\n\n\t\t\t\t\t\tthis.RespawnInterval = Spawner.DefaultRespawnInterval;\n\t\t\t\t\t\tthis.RespawnDistance = Spawner.DefaultRespawnDistance;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.respawnTimer += dt;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.lastPlayerPosition = PlayerFactory.Instance.Get<Transform>().Position;\n\t\t\t}\n\t\t\tthis.mapJustLoaded = false;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Spinner.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing BEPUphysics;\nusing BEPUphysics.Constraints.SolverGroups;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Spinner : Component<Main>, IUpdateableComponent\n\t{\n\t\t[XmlIgnore]\n\t\tpublic Property<Direction> Direction = new Property<Direction>();\n\n\t\tpublic Property<float> Minimum = new Property<float>();\n\t\tpublic Property<float> Maximum = new Property<float>();\n\t\tpublic Property<bool> Locked = new Property<bool>();\n\t\tpublic Property<float> Speed = new Property<float>();\n\t\tpublic Property<float> Goal = new Property<float>();\n\t\tpublic Property<bool> Servo = new Property<bool>();\n\t\tpublic Property<uint> MovementLoop = new Property<uint> { Value = AK.EVENTS.SLIDER2_LOOP };\n\t\tpublic Property<uint> MovementStop = new Property<uint> { Value = AK.EVENTS.SLIDER2_STOP };\n\n\t\tpublic Property<Quaternion> OriginalRotation = new Property<Quaternion>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Forward = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Backward = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command HitMin = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command HitMax = new Command();\n\n\t\tprivate void forward()\n\t\t{\n\t\t\tif (joint != null && this.Locked)\n\t\t\t\tjoint.Motor.Settings.Servo.Goal = this.Maximum;\n\t\t}\n\n\t\tprivate void backward()\n\t\t{\n\t\t\tif (joint != null && this.Locked)\n\t\t\t\tjoint.Motor.Settings.Servo.Goal = this.Minimum;\n\t\t}\n\n\t\tprivate RevoluteJoint joint = null;\n\t\tprivate void setLimits()\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t{\n\t\t\t\tfloat min = this.Minimum, max = this.Maximum;\n\t\t\t\tif (max > min)\n\t\t\t\t{\n\t\t\t\t\tthis.joint.Limit.IsActive = true;\n\t\t\t\t\tthis.joint.Limit.MinimumAngle = min;\n\t\t\t\t\tthis.joint.Limit.MaximumAngle = max;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.joint.Limit.IsActive = false;\n\t\t\t}\n\t\t}\n\n\t\tprivate void setSpeed()\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t{\n\t\t\t\tthis.joint.Motor.Settings.Servo.BaseCorrectiveSpeed = joint.Motor.Settings.Servo.MaxCorrectiveVelocity = this.Speed;\n\t\t\t\tthis.joint.Motor.Settings.VelocityMotor.GoalVelocity = this.Speed;\n\t\t\t}\n\t\t}\n\n\t\tprivate void setLocked()\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t\tthis.joint.Motor.IsActive = this.Locked;\n\t\t}\n\n\t\tprivate void setGoal()\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t\tthis.joint.Motor.Settings.Servo.Goal = this.Goal;\n\t\t}\n\n\t\tprivate void setMode()\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t\tthis.joint.Motor.Settings.Mode = this.Servo ? MotorMode.Servomechanism : MotorMode.VelocityMotor;\n\t\t}\n\n\t\tpublic void Move(int value)\n\t\t{\n\t\t\tif (this.Locked)\n\t\t\t\tthis.Goal.Value = value;\n\t\t}\n\n\t\tprivate bool soundPlaying;\n\t\tprivate BEPUphysics.Entities.Entity physicsEntity;\n\n\t\tpublic ISpaceObject CreateJoint(BEPUphysics.Entities.Entity entity1, BEPUphysics.Entities.Entity entity2, Vector3 pos, Vector3 direction, Vector3 anchor)\n\t\t{\n\t\t\t// entity1 is us\n\t\t\t// entity2 is the main map we are attaching to\n\t\t\tthis.physicsEntity = entity1;\n\t\t\tVector3 originalPos = entity1.Position;\n\t\t\tQuaternion originalRotation = entity1.Orientation;\n\t\t\tentity1.Position = pos;\n\t\t\tentity1.Orientation = this.OriginalRotation;\n\t\t\tthis.joint = new RevoluteJoint(entity1, entity2, anchor, direction);\n\t\t\tentity1.Position = originalPos;\n\t\t\tentity1.Orientation = originalRotation;\n\t\t\tfloat multiplier = Math.Max(1.0f, entity1.Mass);\n\t\t\tthis.joint.AngularJoint.SpringSettings.StiffnessConstant *= multiplier;\n\t\t\tthis.joint.Limit.SpringSettings.StiffnessConstant *= multiplier;\n\t\t\tthis.joint.Motor.Settings.Mode = MotorMode.Servomechanism;\n\t\t\tthis.setLimits();\n\t\t\tthis.setLocked();\n\t\t\tthis.setSpeed();\n\t\t\tthis.setMode();\n\t\t\tthis.setGoal();\n\t\t\treturn joint;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.Add(new NotifyBinding(this.setLimits, this.Minimum, this.Maximum));\n\t\t\tthis.Add(new NotifyBinding(this.setSpeed, this.Speed));\n\t\t\tthis.Add(new NotifyBinding(this.setLocked, this.Locked));\n\t\t\tthis.Add(new NotifyBinding(this.setGoal, this.Goal));\n\t\t\tthis.Add(new NotifyBinding(this.setMode, this.Servo));\n\n\t\t\tthis.Forward.Action = (Action)this.forward;\n\t\t\tthis.Backward.Action = (Action)this.backward;\n\t\t\tAction movementStop = delegate()\n\t\t\t{\n\t\t\t\tif (this.MovementStop.Value != 0)\n\t\t\t\t\tAkSoundEngine.PostEvent(this.MovementStop, this.Entity);\n\t\t\t\tthis.soundPlaying = false;\n\t\t\t};\n\t\t\tthis.Add(new CommandBinding(this.HitMax, movementStop));\n\t\t\tthis.Add(new CommandBinding(this.HitMin, movementStop));\n\t\t}\n\n\t\tprivate bool lastLimitExceeded;\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.joint != null)\n\t\t\t{\n\t\t\t\tbool limitExceeded = this.joint.Limit.IsLimitExceeded;\n\t\t\t\tif (limitExceeded && !this.lastLimitExceeded)\n\t\t\t\t{\n\t\t\t\t\tif (Math.Abs(joint.Limit.Error.X) > 0.0001f)\n\t\t\t\t\t\tthis.HitMin.Execute();\n\t\t\t\t\telse if (Math.Abs(joint.Limit.Error.Y) > 0.0001f)\n\t\t\t\t\t\tthis.HitMax.Execute();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbool moving = this.Locked && Math.Abs(Vector3.Dot(this.physicsEntity.AngularVelocity, this.joint.AngularJoint.WorldFreeAxisA)) > 0.1f;\n\t\t\t\t\tif (this.soundPlaying && !moving)\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_ALL_OBJECT, this.Entity);\n\t\t\t\t\telse if (!this.soundPlaying && moving)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.MovementLoop.Value != 0)\n\t\t\t\t\t\t\tAkSoundEngine.PostEvent(this.MovementLoop, this.Entity);\n\t\t\t\t\t}\n\t\t\t\t\tthis.soundPlaying = moving;\n\t\t\t\t}\n\t\t\t\tthis.lastLimitExceeded = limitExceeded;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Starter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Starter : Component<Main>\n\t{\n\t\t[XmlIgnore]\n\t\tpublic Command Command = new Command();\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t\tthis.Command.Execute();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/StaticSlider.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing BEPUphysics;\nusing BEPUphysics.Constraints.SolverGroups;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.UpdateableSystems;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class StaticSlider : Component<Main>, IUpdateableComponent\n\t{\n\t\t// Config properties\n\t\tpublic Property<Direction> Direction = new Property<Direction>();\n\t\tpublic Property<int> Minimum = new Property<int>();\n\t\tpublic Property<int> Maximum = new Property<int>();\n\t\tpublic Property<float> Speed = new Property<float>();\n\t\tpublic Property<int> Goal = new Property<int>();\n\t\tpublic Property<uint> MovementLoop = new Property<uint> { Value = AK.EVENTS.SLIDER1_LOOP };\n\t\tpublic Property<uint> MovementStop = new Property<uint> { Value = AK.EVENTS.SLIDER1_STOP };\n\t\tpublic Property<bool> StartAtMinimum = new Property<bool>();\n\t\tpublic Property<Entity.Handle> Parent = new Property<Entity.Handle>();\n\n\t\t// Internal properties\n\t\tpublic Property<Voxel.Coord> Coord = new Property<Voxel.Coord>();\n\t\tpublic Property<float> Position = new Property<float>();\n\n\t\t// I/O properties\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> Transform = new Property<Matrix>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> EditorTransform = new Property<Matrix>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnHitMin = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnHitMax = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Forward = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Backward = new Command();\n\n\t\tprivate float lastPosition;\n\t\tprivate Vector3 lastTranslation;\n\t\tprivate bool playingSound;\n\n\t\tpublic void Move(int value)\n\t\t{\n\t\t\tthis.Goal.Value = value;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.EnabledInEditMode = false;\n\n\t\t\tthis.Forward.Action = delegate() { this.Move(this.Maximum); };\n\t\t\tthis.Backward.Action = delegate() { this.Move(this.Minimum); };\n\n\t\t\tif (this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t\t{\n\t\t\t\t\tEntity parent = this.Parent.Value.Target;\n\t\t\t\t\tif (parent == null || parent.Get<Voxel>() == null)\n\t\t\t\t\t\tthis.Transform.Value = this.EditorTransform;\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.Coord.Value = parent.Get<Voxel>().GetCoordinate(this.EditorTransform.Value.Translation);\n\t\t\t\t}, this.EditorTransform));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.Add(new SetBinding<int>(this.Goal, delegate(int value)\n\t\t\t\t{\n\t\t\t\t\tif (!this.playingSound && Math.Abs(this.Position - this.Goal) > 0.5f)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.playingSound = true;\n\t\t\t\t\t\tif (this.MovementLoop.Value != 0)\n\t\t\t\t\t\t\tAkSoundEngine.PostEvent(this.MovementLoop, this.Entity);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tAction stopMovement = delegate()\n\t\t\t\t{\n\t\t\t\t\tif (this.main.TotalTime > 0.1f && this.MovementStop.Value != 0)\n\t\t\t\t\t\tAkSoundEngine.PostEvent(this.MovementStop, this.Entity);\n\t\t\t\t\telse\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_ALL_OBJECT, this.Entity);\n\t\t\t\t\tthis.playingSound = false;\n\t\t\t\t};\n\t\t\t\tthis.Add(new CommandBinding(this.OnHitMax, stopMovement));\n\t\t\t\tthis.Add(new CommandBinding(this.OnHitMin, stopMovement));\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (!this.main.EditorEnabled && this.StartAtMinimum)\n\t\t\t{\n\t\t\t\tthis.StartAtMinimum.Value = false;\n\t\t\t\tthis.Position.Value = this.Minimum;\n\t\t\t}\n\n\t\t\tBinding<Matrix> attachmentBinding = null;\n\t\t\tthis.Add(new ChangeBinding<Entity.Handle>(this.Parent, delegate(Entity.Handle old, Entity.Handle value)\n\t\t\t{\n\t\t\t\tif (attachmentBinding != null)\n\t\t\t\t\tthis.Remove(attachmentBinding);\n\n\t\t\t\tif (value.Target != null)\n\t\t\t\t{\n\t\t\t\t\tVoxel m = value.Target.Get<Voxel>();\n\t\t\t\t\tSliderCommon s = m.Entity.Get<SliderCommon>();\n\t\t\t\t\tMatrix voxelTransform = s != null ? s.OriginalTransform : m.Transform;\n\n\t\t\t\t\tif (old.Target != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 pos = this.Transform.Value.Translation;\n\t\t\t\t\t\tVector3 relativePos = Vector3.Transform(pos, Matrix.Invert(voxelTransform));\n\t\t\t\t\t\tthis.Coord.Value = m.GetCoordinateFromRelative(relativePos);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.main.EditorEnabled)\n\t\t\t\t\t\tthis.Coord.Value = m.GetCoordinate(this.EditorTransform.Value.Translation);\n\n\t\t\t\t\tattachmentBinding = new Binding<Matrix>(this.Transform, () => Matrix.CreateTranslation(m.GetRelativePosition(this.Coord) - new Vector3(0.5f) + this.Direction.Value.GetVector() * this.Position) * m.Transform, m.Transform, m.Offset, this.Direction, this.Coord, this.Position);\n\t\t\t\t\tthis.Add(attachmentBinding);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tfloat pos = this.Position;\n\t\t\tif (pos < this.Goal)\n\t\t\t\tpos = Math.Min(pos + this.Speed * dt, this.Goal);\n\t\t\telse if (this.Position > this.Goal)\n\t\t\t\tpos = Math.Max(pos - this.Speed * dt, this.Goal);\n\t\t\tpos = MathHelper.Clamp(pos, this.Minimum, this.Maximum);\n\n\t\t\tthis.Position.Value = pos;\n\n\t\t\tVector3 translation = this.Transform.Value.Translation;\n\t\t\tthis.LinearVelocity.Value = (translation - this.lastTranslation) / dt;\n\t\t\tthis.lastTranslation = this.Transform.Value.Translation;\n\n\t\t\tif (this.Position == this.Maximum && this.lastPosition != this.Maximum)\n\t\t\t\tthis.OnHitMax.Execute();\n\t\t\t\n\t\t\tif (this.Position == this.Minimum && this.lastPosition != this.Minimum)\n\t\t\t\tthis.OnHitMin.Execute();\n\n\t\t\tthis.lastPosition = this.Position;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Switch.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Switch : Component<Main>\n\t{\n\t\tprivate static List<Switch> all = new List<Switch>();\n\n\t\t// Output properties\n\t\tpublic Property<bool> On = new Property<bool>();\n\n\t\t// Input properties\n\t\t[XmlIgnore]\n\t\tpublic Property<Entity.Handle> AttachedVoxel = new Property<Entity.Handle>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Voxel.Coord> Coord = new Property<Voxel.Coord>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnPowerOn = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnPowerOff = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\n\t\tpublic Property<uint> PowerOnCue = new Property<uint> { Value = AK.EVENTS.PLAY_SWITCH_ON };\n\n\t\tprivate static bool canConnect(Voxel.State state)\n\t\t{\n\t\t\treturn state == Voxel.States.Powered\n\t\t\t\t|| state == Voxel.States.HardPowered\n\t\t\t\t|| state == Voxel.States.PoweredSwitch\n\t\t\t\t|| state == Voxel.States.Blue\n\t\t\t\t|| state == Voxel.States.Neutral\n\t\t\t\t|| state == Voxel.States.Switch\n\t\t\t\t|| state == Voxel.States.Hard;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tSwitch.all.Add(this);\n\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (this.On)\n\t\t\t\t\tthis.OnPowerOn.Execute();\n\t\t\t\telse\n\t\t\t\t\tthis.OnPowerOff.Execute();\n\t\t\t}, this.On));\n\n\t\t\tthis.Add(new CommandBinding(this.OnPowerOff, delegate()\n\t\t\t{\n\t\t\t\tif (this.main.TotalTime > 0.1f)\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_SWITCH_OFF, this.Entity);\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_WHITE_LIGHT, this.Entity);\n\t\t\t}));\n\n\t\t\tthis.Add(new CommandBinding(this.OnPowerOn, delegate()\n\t\t\t{\n\t\t\t\tif (this.main.TotalTime > 0.1f && this.PowerOnCue != 0)\n\t\t\t\t\tAkSoundEngine.PostEvent(this.PowerOnCue, this.Entity);\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_WHITE_LIGHT, this.Entity);\n\n\t\t\t\tVoxel map = this.AttachedVoxel.Value.Target.Get<Voxel>();\n\n\t\t\t\tSwitch closestConnectedSwitch = null;\n\t\t\t\tStack<Voxel.Box> closestConnectedPath = null;\n\n\t\t\t\tforeach (Switch s in Switch.all)\n\t\t\t\t{\n\t\t\t\t\tStack<Voxel.Box> path = new Stack<Voxel.Box>();\n\t\t\t\t\tif (s.On && s != this && s.AttachedVoxel.Value.Target == this.AttachedVoxel.Value.Target\n\t\t\t\t\t\t&& VoxelAStar.Broadphase(map, map.GetBox(this.Coord), s.Coord, canConnect, path, 2000))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (closestConnectedPath == null || path.Count < closestConnectedPath.Count)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclosestConnectedSwitch = s;\n\t\t\t\t\t\t\tclosestConnectedPath = path;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (closestConnectedSwitch != null)\n\t\t\t\t{\n\t\t\t\t\tList<Voxel.Coord> changes = new List<Voxel.Coord>();\n\t\t\t\t\tQueue<Voxel.Coord> queue = new Queue<Voxel.Coord>();\n\t\t\t\t\tVoxel.Coord start = closestConnectedSwitch.Coord;\n\t\t\t\t\tstart.Data = null;\n\t\t\t\t\tqueue.Enqueue(start);\n\t\t\t\t\tVoxel.CoordSetCache.Add(start);\n\n\t\t\t\t\tstart.Data = Voxel.States.Switch;\n\t\t\t\t\tchanges.Add(start);\n\t\t\t\t\twhile (queue.Count > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord c = queue.Dequeue();\n\n\t\t\t\t\t\tforeach (Direction adjacentDirection in DirectionExtensions.Directions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord adjacentCoord = c.Move(adjacentDirection);\n\t\t\t\t\t\t\tif (!Voxel.CoordSetCache.Contains(adjacentCoord))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tVoxel.CoordSetCache.Add(adjacentCoord);\n\t\t\t\t\t\t\t\tVoxel.State adjacentState = map[adjacentCoord];\n\t\t\t\t\t\t\t\tif (adjacentState == Voxel.States.PoweredSwitch)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tqueue.Enqueue(adjacentCoord);\n\n\t\t\t\t\t\t\t\t\tadjacentCoord.Data = Voxel.States.Switch;\n\t\t\t\t\t\t\t\t\tchanges.Add(adjacentCoord);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (adjacentState == Voxel.States.Hard)\n\t\t\t\t\t\t\t\t\tqueue.Enqueue(adjacentCoord);\n\t\t\t\t\t\t\t\telse if (adjacentState == Voxel.States.HardPowered)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tqueue.Enqueue(adjacentCoord);\n\n\t\t\t\t\t\t\t\t\tadjacentCoord.Data = Voxel.States.Hard;\n\t\t\t\t\t\t\t\t\tchanges.Add(adjacentCoord);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if ((adjacentState == Voxel.States.Blue || adjacentState == Voxel.States.Powered)\n\t\t\t\t\t\t\t\t\t&& closestConnectedPath.Contains(map.GetBox(adjacentCoord)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tadjacentCoord.Data = Voxel.States.Neutral;\n\t\t\t\t\t\t\t\t\tchanges.Add(adjacentCoord);\n\t\t\t\t\t\t\t\t\tadjacentCoord.Data = null;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tVoxel.CoordSetCache.Clear();\n\t\t\t\t\tif (changes.Count > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlock (map.MutationLock)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmap.Empty(changes, true, true, map);\n\t\t\t\t\t\t\tmap.Fill(changes);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmap.Regenerate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tSwitch.all.Remove(this);\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_WHITE_LIGHT, this.Entity);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/TimeTrial.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Lemma.GInterfaces;\nusing Lemma.Util;\nusing Steamworks;\n\nnamespace Lemma.Components\n{\n\tpublic class TimeTrial : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<string> NextMap = new Property<string>();\n\n\t\tpublic Property<bool> AllowRespawn = new Property<bool>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<float> ElapsedTime = new Property<float>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Retry = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<float> BestTime = new Property<float>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command ShowUI = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic LeaderboardProxy Proxy = new LeaderboardProxy();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Enabled.Value = false;\n\n\t\t\tthis.Retry.Action = this.retry;\n\n\t\t\tif (!this.AllowRespawn)\n\t\t\t{\n\t\t\t\tthis.Add(new CommandBinding(this.main.Spawner.PlayerSpawned, delegate()\n\t\t\t\t{\n\t\t\t\t\tPlayerFactory.Instance.Add(new CommandBinding(PlayerFactory.Instance.Get<Player>().Die, (Action)this.retryDeath));\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\tthis.BestTime.Value = this.main.GetMapTime(WorldFactory.Instance.Get<World>().UUID);\n\n\t\t\tthis.Add(new CommandBinding(this.Disable, delegate()\n\t\t\t{\n\t\t\t\tthis.main.BaseTimeMultiplier.Value = 0.0f;\n\t\t\t\tthis.main.Menu.CanPause.Value = false;\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_ALL, this.Entity);\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_MUSIC_STINGER, this.Entity);\n\t\t\t\tthis.BestTime.Value = this.main.SaveMapTime(WorldFactory.Instance.Get<World>().UUID, this.ElapsedTime);\n\t\t\t\tPlayerFactory.Instance.Get<FPSInput>().Enabled.Value = false;\n\t\t\t\tthis.ShowUI.Execute();\n#if STEAMWORKS\n\t\t\t\tSteamWorker.IncrementStat(\"stat_challenge_levels_played\", 1);\n\t\t\t\tstring uuid = WorldFactory.Instance.Get<World>().UUID;\n\t\t\t\tint score = (int)(this.BestTime.Value * 1000.0f);\n\t\t\t\tthis.Proxy.Sync(uuid, score);\n#endif\n\t\t\t}));\n\t\t}\n\n\t\tprivate void retryDeath()\n\t\t{\n\t\t\tthis.main.Spawner.CanSpawn = false;\n\t\t\tthis.Entity.Add(new Animation\n\t\t\t(\n\t\t\t\tnew Animation.Delay(0.5f),\n\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t{\n\t\t\t\t\tthis.main.CurrentSave.Value = null;\n\t\t\t\t\tthis.main.EditorEnabled.Value = false;\n\t\t\t\t\tIO.MapLoader.Load(this.main, this.main.MapFile);\n\t\t\t\t})\n\t\t\t));\n\t\t}\n\n\t\tprivate void retry()\n\t\t{\n\t\t\tthis.main.Spawner.CanSpawn = false;\n\t\t\tthis.main.CurrentSave.Value = null;\n\t\t\tthis.main.EditorEnabled.Value = false;\n\t\t\tIO.MapLoader.Load(this.main, this.main.MapFile);\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tthis.ElapsedTime.Value += dt;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tthis.Proxy.Unregister();\n\t\t\tbase.delete();\n\t\t\tthis.main.BaseTimeMultiplier.Value = 1.0f;\n\t\t\tthis.main.Menu.CanPause.Value = true;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/TimeTrialUI.cs",
    "content": "﻿using System.Windows.Forms;\nusing System.Windows.Forms.VisualStyles;\nusing ComponentBind;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GeeUI;\nusing GeeUI.ViewLayouts;\nusing GeeUI.Views;\nusing Lemma.Console;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing System.IO;\nusing System.Xml.Serialization;\nusing Microsoft.Xna.Framework.Input;\nusing Steamworks;\n\nnamespace Lemma.Components\n{\n\tpublic class TimeTrialUI : Component<Main>, IUpdateableComponent\n\t{\n\t\t// Input properties\n\t\tpublic Property<float> ElapsedTime = new Property<float>();\n\t\tpublic Property<string> NextMap = new Property<string>();\n\t\t[XmlIgnore]\n\t\tpublic Property<float> BestTime = new Property<float>();\n\n\t\tprivate Property<float> verticalSpeed = new Property<float>();\n\t\tprivate Property<float> horizontalSpeed = new Property<float>();\n\n\t\t// Output commands\n\t\t[XmlIgnore]\n\t\tpublic Command Retry = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command MainMenu = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Edit = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command LoadNextMap = new Command();\n\n\t\t// Input commands\n\n\t\t[XmlIgnore]\n\t\tpublic Command Show = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command ShowEnd = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnLeaderboardError = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command<LeaderboardScoresDownloaded_t, LeaderboardScoresDownloaded_t> OnLeaderboardSync = new Command<LeaderboardScoresDownloaded_t, LeaderboardScoresDownloaded_t>();\n\t\tpublic Property<bool> PersonaNotification = new Property<bool>();\n\n\t\tprivate bool shown;\n\n\t\tprivate float width\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn 400.0f * this.main.FontMultiplier;\n\t\t\t}\n\t\t}\n\n\t\tprivate float spacing\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn 8.0f * this.main.FontMultiplier;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tthis.Serialize = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\n\t\t\t{\n\t\t\t\tContainer container = this.main.UIFactory.CreateContainer();\n\t\t\t\tcontainer.Opacity.Value = UIFactory.Opacity;\n\t\t\t\tcontainer.PaddingBottom.Value = container.PaddingLeft.Value = container.PaddingRight.Value = container.PaddingTop.Value = 16.0f * this.main.FontMultiplier;\n\t\t\t\tcontainer.AnchorPoint.Value = new Vector2(1.0f, 0.0f);\n\t\t\t\tbool vr = false;\n#if VR\n\t\t\t\tvr = this.main.VR;\n#endif\n\t\t\t\tcontainer.Add(new Binding<Vector2, Point>(container.Position, x => new Vector2(x.X * 0.9f, x.Y * (vr ? 0.3f : 0.1f)), this.main.ScreenSize));\n\t\t\t\tcontainer.Visible.Value = false;\n\t\t\t\tthis.main.UI.Root.Children.Add(container);\n\t\t\t\tcontainer.Add(new CommandBinding(this.Delete, container.Delete));\n\t\t\t\tcontainer.Add(new CommandBinding(this.ShowEnd, container.Delete));\n\t\t\t\tcontainer.Add(new CommandBinding(this.Show, delegate() { container.Visible.Value = true; }));\n\n\t\t\t\tListContainer list = new ListContainer();\n\t\t\t\tlist.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\t\tlist.Alignment.Value = ListContainer.ListAlignment.Max;\n\t\t\t\tcontainer.Children.Add(list);\n\n\t\t\t\tTextElement elapsedTime = new TextElement();\n\t\t\t\telapsedTime.FontFile.Value = this.main.FontLarge;\n\t\t\t\telapsedTime.Add(new Binding<string, float>(elapsedTime.Text, SecondsToTimeString, this.ElapsedTime));\n\t\t\t\tlist.Children.Add(elapsedTime);\n\n\t\t\t\tTextElement vertSpeed = this.main.UIFactory.CreateLabel();\n\t\t\t\tvertSpeed.Add(new Binding<string, float>(vertSpeed.Text, x => x.ToString(\"00.00\"), this.verticalSpeed));\n\t\t\t\tlist.Children.Add(vertSpeed);\n\n\t\t\t\tTextElement horizontalSpeed = main.UIFactory.CreateLabel();\n\t\t\t\thorizontalSpeed.Add(new Binding<string, float>(horizontalSpeed.Text, x => x.ToString(\"00.00\"), this.horizontalSpeed));\n\t\t\t\tlist.Children.Add(horizontalSpeed);\n\n\t\t\t\tTextElement bestTime = this.main.UIFactory.CreateLabel();\n\t\t\t\tbestTime.Add(new Binding<string, float>(bestTime.Text, SecondsToTimeString, this.BestTime));\n\t\t\t\tlist.Children.Add(bestTime);\n\t\t\t}\n\n\t\t\tthis.ShowEnd.Action = delegate()\n\t\t\t{\n\t\t\t\tif (this.shown)\n\t\t\t\t\treturn;\n\t\t\t\tthis.shown = true;\n\n\t\t\t\tContainer container = this.main.UIFactory.CreateContainer();\n\t\t\t\tcontainer.Opacity.Value = UIFactory.Opacity;\n\t\t\t\tcontainer.PaddingBottom.Value = container.PaddingLeft.Value = container.PaddingRight.Value = container.PaddingTop.Value = 16.0f * this.main.FontMultiplier;\n\t\t\t\tcontainer.AnchorPoint.Value = new Vector2(0.5f, 0.5f);\n\t\t\t\tcontainer.Add(new Binding<Vector2, Point>(container.Position, x => new Vector2(x.X * 0.5f, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\t\tthis.main.UI.Root.Children.Add(container);\n\t\t\t\tcontainer.Add(new CommandBinding(this.Delete, container.Delete));\n\n\t\t\t\tListContainer list = new ListContainer();\n\t\t\t\tlist.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\t\tlist.Alignment.Value = ListContainer.ListAlignment.Middle;\n\t\t\t\tlist.Spacing.Value = this.spacing;\n\t\t\t\tcontainer.Children.Add(list);\n\n\t\t\t\tTextElement elapsedTime = new TextElement();\n\t\t\t\telapsedTime.FontFile.Value = this.main.FontLarge;\n\t\t\t\telapsedTime.Add(new Binding<string, float>(elapsedTime.Text, SecondsToTimeString, this.ElapsedTime));\n\t\t\t\tlist.Children.Add(elapsedTime);\n\n\t\t\t\tTextElement bestTime = this.main.UIFactory.CreateLabel();\n\t\t\t\tbestTime.Add(new Binding<string>(bestTime.Text, () => string.Format(main.Strings.Get(\"best time\"), SecondsToTimeString(this.BestTime)), this.BestTime, main.Strings.Language));\n\t\t\t\tlist.Children.Add(bestTime);\n\n#if STEAMWORKS\n\t\t\t\tContainer leaderboard = this.main.UIFactory.CreateContainer();\n\t\t\t\tthis.resizeContainer(leaderboard);\n\t\t\t\tlist.Children.Add(leaderboard);\n\n\t\t\t\tListContainer leaderboardList = new ListContainer();\n\t\t\t\tleaderboardList.ResizePerpendicular.Value = false;\n\t\t\t\tleaderboardList.Size.Value = new Vector2(this.width - 8.0f, 0);\n\t\t\t\tleaderboardList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\t\tleaderboardList.Alignment.Value = ListContainer.ListAlignment.Middle;\n\t\t\t\tleaderboardList.Spacing.Value = 0;\n\n\t\t\t\tScroller scroller = new Scroller();\n\t\t\t\tscroller.Children.Add(leaderboardList);\n\t\t\t\tscroller.Add(new Binding<Vector2>(scroller.Size, () => new Vector2(leaderboardList.Size.Value.X, this.main.ScreenSize.Value.Y * 0.5f), leaderboardList.Size, this.main.ScreenSize));\n\t\t\t\tleaderboard.Children.Add(scroller);\n\n\t\t\t\t{\n\t\t\t\t\tTextElement leaderboardLabel = this.main.UIFactory.CreateLabel();\n\t\t\t\t\tleaderboardLabel.Text.Value = \"\\\\leaderboard\";\n\t\t\t\t\tleaderboardList.Children.Add(leaderboardLabel);\n\t\t\t\t\tTextElement loading = this.main.UIFactory.CreateLabel();\n\t\t\t\t\tloading.Text.Value = \"\\\\loading\";\n\t\t\t\t\tleaderboardList.Children.Add(loading);\n\t\t\t\t}\n\n\t\t\t\tthis.OnLeaderboardSync.Action = delegate(LeaderboardScoresDownloaded_t globalScores, LeaderboardScoresDownloaded_t friendScores)\n\t\t\t\t{\n\t\t\t\t\tleaderboardList.Children.Clear();\n\n\t\t\t\t\t{\n\t\t\t\t\t\tTextElement leaderboardLabel = this.main.UIFactory.CreateLabel(\"\\\\leaderboard\");\n\t\t\t\t\t\tContainer labelContainer = this.main.UIFactory.CreateContainer();\n\t\t\t\t\t\tleaderboardList.Children.Add(labelContainer);\n\t\t\t\t\t\tlabelContainer.Children.Add(leaderboardLabel);\n\t\t\t\t\t}\n\n\t\t\t\t\tint[] details = new int[] {};\n\t\t\t\t\tfor (int i = 0; i < globalScores.m_cEntryCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tLeaderboardEntry_t entry;\n\t\t\t\t\t\tSteamUserStats.GetDownloadedLeaderboardEntry(globalScores.m_hSteamLeaderboardEntries, i, out entry, details, 0);\n\t\t\t\t\t\tleaderboardList.Children.Add(this.leaderboardEntry(entry));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (friendScores.m_cEntryCount > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tTextElement friendsLabel = this.main.UIFactory.CreateLabel(\"\\\\friends\");\n\t\t\t\t\t\t\tContainer labelContainer = this.main.UIFactory.CreateContainer();\n\t\t\t\t\t\t\tleaderboardList.Children.Add(labelContainer);\n\t\t\t\t\t\t\tlabelContainer.Children.Add(friendsLabel);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (int i = 0; i < friendScores.m_cEntryCount; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLeaderboardEntry_t entry;\n\t\t\t\t\t\t\tSteamUserStats.GetDownloadedLeaderboardEntry(friendScores.m_hSteamLeaderboardEntries, i, out entry, details, 0);\n\t\t\t\t\t\t\tleaderboardList.Children.Add(this.leaderboardEntry(entry));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tthis.OnLeaderboardError.Action = delegate()\n\t\t\t\t{\n\t\t\t\t\tleaderboardList.Children.Clear();\n\t\t\t\t\tTextElement error = this.main.UIFactory.CreateLabel();\n\t\t\t\t\terror.Text.Value = \"\\\\leaderboard error\";\n\t\t\t\t\tleaderboardList.Children.Add(error);\n\t\t\t\t};\n#endif\n\n\t\t\t\tContainer retry = this.main.UIFactory.CreateButton(\"\\\\retry\", delegate()\n\t\t\t\t{\n\t\t\t\t\tthis.Retry.Execute();\n\t\t\t\t});\n\t\t\t\tthis.resizeButton(retry);\n\t\t\t\tlist.Children.Add(retry);\n\n\t\t\t\tif (this.main.Settings.GodModeProperty || Path.GetDirectoryName(this.main.MapFile) == this.main.CustomMapDirectory)\n\t\t\t\t{\n\t\t\t\t\tContainer edit = this.main.UIFactory.CreateButton(\"\\\\edit mode\", delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Edit.Execute();\n\t\t\t\t\t});\n\t\t\t\t\tthis.resizeButton(edit);\n\t\t\t\t\tlist.Children.Add(edit);\n\t\t\t\t}\n\n\t\t\t\tif (!string.IsNullOrEmpty(this.NextMap))\n\t\t\t\t{\n\t\t\t\t\tContainer next = this.main.UIFactory.CreateButton(\"\\\\next level\", delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.LoadNextMap.Execute();\n\t\t\t\t\t});\n\t\t\t\t\tthis.resizeButton(next);\n\t\t\t\t\tlist.Children.Add(next);\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\tContainer challenge = this.main.UIFactory.CreateButton(\"\\\\challenge levels\", delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.MainMenu.Execute();\n\t\t\t\t\t\tthis.main.Menu.ShowChallengeMenu();\n\t\t\t\t\t});\n\t\t\t\t\tthis.resizeButton(challenge);\n\t\t\t\t\tlist.Children.Add(challenge);\n\t\t\t\t}\n\n\t\t\t\tContainer mainMenu = this.main.UIFactory.CreateButton(\"\\\\main menu\", delegate()\n\t\t\t\t{\n\t\t\t\t\tthis.MainMenu.Execute();\n\t\t\t\t});\n\t\t\t\tthis.resizeButton(mainMenu);\n\t\t\t\tlist.Children.Add(mainMenu);\n\n\t\t\t\tthis.main.UI.IsMouseVisible.Value = true;\n\n\t\t\t\tconst float gamepadMoveInterval = 0.1f;\n\t\t\t\tfloat lastGamepadMove = 0.0f;\n\n\t\t\t\tFunc<int, int, int> nextButton = delegate(int search, int dir)\n\t\t\t\t{\n\t\t\t\t\tint i = search;\n\t\t\t\t\twhile (true)\n\t\t\t\t\t{\n\t\t\t\t\t\ti = i + dir;\n\t\t\t\t\t\tif (i < 0)\n\t\t\t\t\t\t\ti = list.Children.Count - 1;\n\t\t\t\t\t\telse if (i >= list.Children.Count)\n\t\t\t\t\t\t\ti = 0;\n\t\t\t\t\t\tUIComponent item = list.Children[i];\n\t\t\t\t\t\tif (item is Container)\n\t\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tint selected = nextButton(0, 1);\n\t\t\t\tif (main.GamePadConnected)\n\t\t\t\t\tlist.Children[selected].Highlighted.Value = true;\n\n\t\t\t\tPCInput input = this.Entity.GetOrCreate<PCInput>();\n\t\t\t\tAction<int> moveSelection = delegate(int delta)\n\t\t\t\t{\n\t\t\t\t\tif (this.main.GameTime.TotalGameTime.TotalSeconds - lastGamepadMove > gamepadMoveInterval)\n\t\t\t\t\t{\n\t\t\t\t\t\tContainer button;\n\t\t\t\t\t\tif (selected < list.Children.Length)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbutton = (Container)list.Children[selected];\n\t\t\t\t\t\t\tbutton.Highlighted.Value = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tselected = nextButton(selected, delta);\n\n\t\t\t\t\t\tbutton = (Container)list.Children[selected];\n\t\t\t\t\t\tbutton.Highlighted.Value = true;\n\t\t\t\t\t\tlastGamepadMove = (float)this.main.GameTime.TotalGameTime.TotalSeconds;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.LeftThumbstickUp), delegate()\n\t\t\t\t{\n\t\t\t\t\tmoveSelection(-1);\n\t\t\t\t}));\n\n\t\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.DPadUp), delegate()\n\t\t\t\t{\n\t\t\t\t\tmoveSelection(-1);\n\t\t\t\t}));\n\n\t\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.LeftThumbstickDown), delegate()\n\t\t\t\t{\n\t\t\t\t\tmoveSelection(1);\n\t\t\t\t}));\n\n\t\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.DPadDown), delegate()\n\t\t\t\t{\n\t\t\t\t\tmoveSelection(1);\n\t\t\t\t}));\n\n\t\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.A), delegate()\n\t\t\t\t{\n\t\t\t\t\tif (selected < list.Children.Count)\n\t\t\t\t\t{\n\t\t\t\t\t\tUIComponent selectedItem = list.Children[selected];\n\t\t\t\t\t\tselectedItem.MouseLeftUp.Execute();\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t};\n\t\t}\n\n\t\tvoid IUpdateableComponent.Update(float dt)\n\t\t{\n\t\t\tEntity player = PlayerFactory.Instance;\n\t\t\tif (player != null)\n\t\t\t{\n\t\t\t\tVector3 v = player.Get<Player>().Character.LinearVelocity.Value;\n\t\t\t\tthis.verticalSpeed.Value = Math.Abs(v.Y);\n\t\t\t\tv.Y = 0.0f;\n\t\t\t\tthis.horizontalSpeed.Value = v.Length();\n\t\t\t}\n\t\t}\n\n#if STEAMWORKS\n\t\tprivate Container leaderboardEntry(LeaderboardEntry_t entry)\n\t\t{\n\t\t\tContainer container = this.main.UIFactory.CreateButton(delegate()\n\t\t\t{\n\t\t\t\tif (SteamWorker.SteamInitialized)\n\t\t\t\t\tSteamFriends.ActivateGameOverlayToUser(\"steamid\", entry.m_steamIDUser);\n\t\t\t});\n\t\t\tthis.resizeContainer(container, 4.0f);\n\n\t\t\tTextElement rank = this.main.UIFactory.CreateLabel(entry.m_nGlobalRank.ToString());\n\t\t\trank.AnchorPoint.Value = new Vector2(1, 0);\n\t\t\trank.Position.Value = new Vector2(this.width * 0.15f, 0);\n\t\t\tcontainer.Children.Add(rank);\n\n\t\t\tTextElement name = this.main.UIFactory.CreateLabel();\n\t\t\tname.FilterUnicode.Value = true;\n\t\t\tif (SteamFriends.RequestUserInformation(entry.m_steamIDUser, true))\n\t\t\t{\n\t\t\t\t// Need to wait for a callback before we know their username\n\t\t\t\tname.Add(new Binding<string>(name.Text, () => SteamFriends.GetFriendPersonaName(entry.m_steamIDUser), this.PersonaNotification));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// We already know the username\n\t\t\t\tname.Text.Value = SteamFriends.GetFriendPersonaName(entry.m_steamIDUser);\n\t\t\t}\n\t\t\tname.Position.Value = new Vector2(this.width * 0.15f + this.spacing, 0);\n\t\t\tcontainer.Children.Add(name);\n\n\t\t\tTextElement score = this.main.UIFactory.CreateLabel(SecondsToTimeString((float)entry.m_nScore / 1000.0f));\n\t\t\tscore.AnchorPoint.Value = new Vector2(1, 0);\n\t\t\tscore.Position.Value = new Vector2(this.width - 4.0f - this.spacing, 0);\n\t\t\tcontainer.Children.Add(score);\n\t\t\treturn container;\n\t\t}\n#endif\n\n\t\tprivate void resizeContainer(Container container, float padding = 0.0f)\n\t\t{\n\t\t\tcontainer.ResizeHorizontal.Value = false;\n\t\t\tcontainer.Size.Value = new Vector2(this.width - padding * 2.0f, 0.0f);\n\t\t}\n\n\t\tprivate void resizeButton(Container button, float padding = 0.0f)\n\t\t{\n\t\t\tthis.resizeContainer(button, padding);\n\t\t\tTextElement label = (TextElement)button.Children[0];\n\t\t\tlabel.WrapWidth.Value = this.width - padding * 2.0f;\n\t\t\tlabel.AnchorPoint.Value = new Vector2(0.5f, 0.5f);\n\t\t\tlabel.Add(new Binding<Vector2>(label.Position, x => x * new Vector2(0.5f, 0.5f), button.Size));\n\t\t}\n\n\t\tpublic static string SecondsToTimeString(float seconds)\n\t\t{\n\t\t\tif (seconds == 0.0f)\n\t\t\t\treturn \"--\";\n\n\t\t\tTimeSpan t = TimeSpan.FromSeconds(seconds);\n\t\t\treturn string.Format(\"{0:D2}:{1:D2}:{2:D3}\", \n\t\t\t\tt.Minutes, \n\t\t\t\tt.Seconds, \n\t\t\t\tt.Milliseconds);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Timer.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Timer : Component<Main>, IUpdateableComponent\n\t{\n\t\tprotected float time = 0.0f;\n\t\tpublic Property<bool> Repeat = new Property<bool>();\n\t\tpublic Property<float> Interval = new Property<float> { Value = 1.0f };\n\t\tpublic Property<bool> ResetOnEnable = new Property<bool>();\n\t\t[XmlIgnore]\n\t\tpublic Command Command = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command Reset = new Command();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\n\t\t\tthis.Add(new CommandBinding(this.Enable, delegate()\n\t\t\t{\n\t\t\t\tif (this.ResetOnEnable)\n\t\t\t\t\tthis.Reset.Execute();\n\t\t\t}));\n\n\t\t\tthis.Reset.Action = delegate()\n\t\t\t{\n\t\t\t\tthis.time = 0.0f;\n\t\t\t};\n\t\t}\n\n\t\tpublic void Update(float elapsedTime)\n\t\t{\n\t\t\tif (this.time < 0.0f)\n\t\t\t\treturn;\n\n\t\t\tthis.time += elapsedTime;\n\t\t\tif (this.time > this.Interval)\n\t\t\t{\n\t\t\t\tthis.Command.Execute();\n\t\t\t\tif (this.Repeat)\n\t\t\t\t\tthis.Reset.Execute();\n\t\t\t\telse\n\t\t\t\t\tthis.time = -1.0f;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Trigger.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nusing Lemma.Util;\nusing System.Xml.Serialization;\nusing Lemma.Factories;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Trigger : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic Property<float> Radius = new Property<float> { Value = 10.0f };\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<bool> IsTriggered = new Property<bool>();\n\t\tpublic Property<Entity.Handle> Target = new Property<Entity.Handle>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Entered = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Exited = new Command();\n\n\t\tpublic Trigger()\n\t\t{\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"Radius\", this.Radius);\n\t\t\tthis.Entity.Add(\"Enabled\", this.Enabled);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tAction clear = delegate()\n\t\t\t{\n\t\t\t\tthis.IsTriggered.Value = false;\n\t\t\t};\n\t\t\tthis.Add(new CommandBinding(this.OnSuspended, clear));\n\t\t\tthis.Add(new CommandBinding(this.Disable, clear));\n\t\t}\n\n\t\tpublic void Update(float elapsedTime)\n\t\t{\n\t\t\tbool targetFound = false;\n\t\t\tEntity target = this.Target.Value.Target;\n\t\t\tif (target != null && target.Active && (target.Get<Transform>().Position.Value - this.Position.Value).Length() <= this.Radius)\n\t\t\t{\n\t\t\t\ttargetFound = true;\n\t\t\t\tif (!this.IsTriggered)\n\t\t\t\t{\n\t\t\t\t\tthis.Target.Value = target;\n\t\t\t\t\tthis.IsTriggered.Value = true;\n\t\t\t\t\tthis.Entered.Execute();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!targetFound && this.IsTriggered)\n\t\t\t\tthis.IsTriggered.Value = false;\n\t\t}\n\n\t\tpublic static void AttachEditorComponents(Entity entity, Main main, Vector3 color)\n\t\t{\n\t\t\tTransform transform = entity.Get<Transform>();\n\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\sphere\";\n\t\t\tmodel.Alpha.Value = 0.15f;\n\t\t\tmodel.Color.Value = color;\n\t\t\tmodel.DisableCulling.Value = true;\n\t\t\tmodel.Add(new Binding<Vector3, float>(model.Scale, x => new Vector3(x), entity.Get<Trigger>().Radius));\n\t\t\tmodel.Serialize = false;\n\t\t\tmodel.DrawOrder.Value = 11; // In front of water\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, entity.EditorSelected));\n\n\t\t\tentity.Add(model);\n\n\t\t\tmodel.Add(new Binding<Matrix, Vector3>(model.Transform, x => Matrix.CreateTranslation(x), transform.Position));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Turret.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Turret : Component<Main>\n\t{\n\t\tpublic Property<Vector3> Reticle = new Property<Vector3>();\n\t\tpublic Property<bool> On = new Property<bool> { Value = true };\n\t\t[XmlIgnore]\n\t\tpublic Command PowerOn = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command PowerOff = new Command();\n\n\t\tprivate bool suppressCommandNotification;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.Add(new ChangeBinding<bool>(this.On, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (!this.suppressCommandNotification)\n\t\t\t\t{\n\t\t\t\t\tif (value)\n\t\t\t\t\t\tthis.PowerOn.Execute();\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.PowerOff.Execute();\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis.Add(new CommandBinding(this.PowerOn, delegate()\n\t\t\t{\n\t\t\t\tthis.suppressCommandNotification = true;\n\t\t\t\tthis.On.Value = true;\n\t\t\t\tthis.suppressCommandNotification = false;\n\t\t\t}));\n\n\t\t\tthis.Add(new CommandBinding(this.PowerOff, delegate()\n\t\t\t{\n\t\t\t\tthis.suppressCommandNotification = true;\n\t\t\t\tthis.On.Value = false;\n\t\t\t\tthis.suppressCommandNotification = false;\n\t\t\t}));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/Updater.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\nusing ComponentBind;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class Updater : Component<Main>, IUpdateableComponent\n\t{\n\t\t[XmlIgnore]\n\t\tpublic Action<float> Action;\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tthis.Action = null;\n\t\t}\n\n\t\tpublic Updater()\n\t\t{\n\n\t\t}\n\n\t\tpublic Updater(Action<float> action)\n\t\t{\n\t\t\tthis.Action = action;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Serialize = false;\n\t\t\tthis.EnabledInEditMode = false;\n\t\t}\n\n\t\tpublic override Entity Entity\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn base.Entity;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tbase.Entity = value;\n\t\t\t\tthis.EnabledWhenPaused = false;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Update(float elapsedTime)\n\t\t{\n\t\t\tthis.Action(elapsedTime);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Voxel.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing System.IO;\n\nusing Lemma.Util;\nusing System.Xml.Serialization;\nusing BEPUphysics.Entities;\nusing BEPUphysics.CollisionShapes;\nusing BEPUphysics.CollisionShapes.ConvexShapes;\nusing Lemma.Factories;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing System.ComponentModel;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing System.Threading;\nusing System.Collections;\nusing BEPUphysics.Materials;\nusing System.Reflection;\n\nnamespace Lemma.Components\n{\n\t[XmlInclude(typeof(State))]\n\t[XmlInclude(typeof(Property<State>))]\n\t[XmlInclude(typeof(ListProperty<State>))]\n\t[XmlInclude(typeof(Coord))]\n\t[XmlInclude(typeof(ListProperty<Coord>))]\n\t[XmlInclude(typeof(Box))]\n\t[XmlInclude(typeof(Property<Box>))]\n\t[XmlInclude(typeof(ListProperty<Box>))]\n\t[XmlInclude(typeof(Property<Coord>))]\n\t[XmlInclude(typeof(Direction))]\n\t[XmlInclude(typeof(Property<Direction>))]\n\t[XmlInclude(typeof(ListProperty<Direction>))]\n\t[XmlInclude(typeof(t))]\n\t[XmlInclude(typeof(Property<t>))]\n\t[XmlInclude(typeof(ListProperty<t>))]\n\tpublic class Voxel : ComponentBind.Component<Main>\n\t{\n\t\tpublic static HashSet<Voxel.Coord> CoordSetCache = new HashSet<Voxel.Coord>();\n\n\t\tprivate static LargeObjectHeap<Box[, ,][, ,]> subchunkHeap = LargeObjectHeap<Box[, ,][, ,]>.Get(x => new Box[x, x, x][,,], y => y * y * y * IntPtr.Size >= 85000);\n\t\tprivate static LargeObjectHeap<Box[, ,]> boxHeap = LargeObjectHeap<Box[, ,]>.Get(x => new Box[x, x, x], y => y * y * y * IntPtr.Size >= 85000);\n\t\tprivate static LargeObjectHeap<Chunk[, ,]> chunkHeap = LargeObjectHeap<Chunk[, ,]>.Get(x => new Chunk[x, x, x], y => y * y * y * IntPtr.Size >= 85000);\n\t\tprivate static LargeObjectHeap<Vertex[]> vertexHeap = LargeObjectHeap<Vertex[]>.Get(x => new Vertex[x], y => y * Vertex.SizeInBytes >= 85000);\n\t\tprivate static LargeObjectHeap<Vector3[]> physicsVertexHeap = LargeObjectHeap<Vector3[]>.Get(x => new Vector3[x], y => y * sizeof(float) * 3 >= 85000);\n\n\t\tpublic static Command<Voxel, IEnumerable<Coord>, Voxel> GlobalCellsEmptied = new Command<Voxel, IEnumerable<Coord>, Voxel>();\n\n\t\tpublic static Command<Voxel, IEnumerable<Coord>, Voxel> GlobalCellsFilled = new Command<Voxel, IEnumerable<Coord>, Voxel>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command<IEnumerable<Coord>, Voxel> CellsEmptied = new Command<IEnumerable<Coord>, Voxel>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command<IEnumerable<Coord>, Voxel> CellsFilled = new Command<IEnumerable<Coord>, Voxel>();\n\n\t\tpublic enum t // Material type\n\t\t{\n\t\t\tEmpty = 0,\n\t\t\tRock = 1,\n\t\t\tBlue = 2,\n\t\t\tAvoidAI = 3,\n\t\t\tDirt = 4,\n\t\t\tReset = 5,\n\t\t\tCritical = 6,\n\t\t\tFoliage = 7,\n\t\t\tHard = 8,\n\t\t\tFloater = 9,\n\t\t\tGlass = 10,\n\t\t\tWood = 11,\n\t\t\tSnow = 12,\n\t\t\tHardPowered = 13,\n\t\t\tRockGrassy = 15,\n\t\t\tBrick = 16,\n\t\t\tLattice = 17,\n\t\t\tNeutral = 18,\n\t\t\tConcrete = 19,\n\t\t\tGravel = 20,\n\t\t\tGlowGreen = 21,\n\t\t\tGlowRed = 22,\n\t\t\tRockChunky = 23,\n\t\t\tRockRed = 24,\n\t\t\tGlowYellow = 25,\n\t\t\tGlowBlue = 26,\n\t\t\tSocketWhite = 27,\n\t\t\tSocketYellow = 28,\n\t\t\tSocketBlue = 29,\n\t\t\tWhite = 30,\n\t\t\tMetal = 31,\n\t\t\tMetalSwirl = 32,\n\t\t\tHex = 33,\n\t\t\tInvisible = 34,\n\t\t\tWhitePermanent = 35,\n\t\t\tSwitch = 36,\n\t\t\tPoweredSwitch = 37,\n\t\t\tPowered = 38,\n\t\t\tPermanentPowered = 39,\n\t\t\tHardInfected = 40,\n\t\t\tInfected = 41,\n\t\t\tBlack = 42,\n\t\t\tSlider = 43,\n\t\t\tSliderPowered = 44,\n\t\t}\n\n\t\tpublic static class States\n\t\t{\n\t\t\tpublic static void Add(params State[] states)\n\t\t\t{\n\t\t\t\tforeach (State state in states)\n\t\t\t\t{\n\t\t\t\t\tVoxel.States.All[state.ID] = state;\n\t\t\t\t\tVoxel.States.List.Add(state);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic static void Remove(params State[] states)\n\t\t\t{\n\t\t\t\tforeach (State state in states)\n\t\t\t\t{\n\t\t\t\t\tVoxel.States.All.Remove(state.ID);\n\t\t\t\t\tVoxel.States.List.Remove(state);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic static Dictionary<t, State> All = new Dictionary<t, State>();\n\t\t\tpublic static List<State> List = new List<State>();\n\n\t\t\tpublic static readonly State Empty = new State\n\t\t\t{\n\t\t\t\tID = 0,\n\t\t\t\tFake = true,\n\t\t\t\tInvisible = true,\n\t\t\t\tPermanent = false,\n\t\t\t\tHard = false,\n\t\t\t};\n\n\t\t\tpublic static readonly State Rock = new State\n\t\t\t{\n\t\t\t\tID = t.Rock,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\rock\",\n\t\t\t\tNormalMap = \"Textures\\\\rock-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.2f,\n\t\t\t\t\t},\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 150.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.2f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(0.88f, 0.89f, 0.9f),\n\t\t\t};\n\t\t\tpublic static readonly State Blue = new State\n\t\t\t{\n\t\t\t\tID = t.Blue,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = false,\n\t\t\t\tDensity = 0.25f,\n\t\t\t\tDiffuseMap = \"Textures\\\\white\",\n\t\t\t\tNormalMap = \"Textures\\\\temporary-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(0.3f, 0.5f, 0.7f),\n\t\t\t};\n\t\t\tpublic static readonly State AvoidAI = new State\n\t\t\t{\n\t\t\t\tID = t.AvoidAI,\n\t\t\t\tPermanent = true,\n\t\t\t\tHard = true,\n\t\t\t\tSupported = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\dirty\",\n\t\t\t\tNormalMap = \"Textures\\\\dirty-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(0.15f),\n\t\t\t};\n\t\t\tpublic static readonly State Dirt = new State\n\t\t\t{\n\t\t\t\tID = t.Dirt,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\dirt\",\n\t\t\t\tNormalMap = \"Textures\\\\dirt-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.SAND,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State Reset = new State\n\t\t\t{\n\t\t\t\tID = t.Reset,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tTint = new Vector3(0.7f, 0.3f, 2.0f),\n\t\t\t\tDiffuseMap = \"Textures\\\\powered-permanent\",\n\t\t\t\tNormalMap = \"Textures\\\\temporary-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State Critical = new State\n\t\t\t{\n\t\t\t\tID = t.Critical,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\danger\",\n\t\t\t\tNormalMap = \"Textures\\\\plain-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State Foliage = new State\n\t\t\t{\n\t\t\t\tID = t.Foliage,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = false,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\foliage\",\n\t\t\t\tNormalMap = \"Textures\\\\plain-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.SAND,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t},\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tAllowAlpha = true,\n\t\t\t\tTiling = 3.0f,\n\t\t\t};\n\t\t\tpublic static readonly State Hard = new State\n\t\t\t{\n\t\t\t\tID = t.Hard,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2.0f,\n\t\t\t\tDiffuseMap = \"Textures\\\\dirty\",\n\t\t\t\tNormalMap = \"Textures\\\\metal-channels-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.WOOD,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(0.55f, 0.47f, 0.4f),\n\t\t\t};\n\t\t\tpublic static readonly State Floater = new State\n\t\t\t{\n\t\t\t\tID = t.Floater,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = false,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\white\",\n\t\t\t\tNormalMap = \"Textures\\\\temporary-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(1.0f, 0.8f, 0.0f),\n\t\t\t};\n\t\t\tpublic static readonly State Glass = new State\n\t\t\t{\n\t\t\t\tID = t.Glass,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = false,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\glass\",\n\t\t\t\tNormalMap = \"Textures\\\\glass-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tShadowCast = true,\n\t\t\t\tAlphaShadowMask = true,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.2f,\n\t\t\t\t\t},\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 1.5f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTiling = 4.0f,\n\t\t\t};\n\t\t\tpublic static readonly State Wood = new State\n\t\t\t{\n\t\t\t\tID = t.Wood,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 0.25f,\n\t\t\t\tDiffuseMap = \"Textures\\\\wood\",\n\t\t\t\tNormalMap = \"Textures\\\\wood-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.WOOD,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTiling = 1.5f,\n\t\t\t};\n\t\t\tpublic static readonly State HardPowered = new State\n\t\t\t{\n\t\t\t\tID = t.HardPowered,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\powered-hard\",\n\t\t\t\tNormalMap = \"Textures\\\\temporary-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.WOOD,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State Neutral = new State\n\t\t\t{\n\t\t\t\tID = t.Neutral,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = false,\n\t\t\t\tDensity = 1,\n\t\t\t\tDiffuseMap = \"Textures\\\\white\",\n\t\t\t\tNormalMap = \"Textures\\\\temporary-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(0.7f),\n\t\t\t};\n\t\t\tpublic static readonly State Concrete = new State\n\t\t\t{\n\t\t\t\tID = t.Concrete,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\concrete\",\n\t\t\t\tNormalMap = \"Textures\\\\concrete-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State Gravel = new State\n\t\t\t{\n\t\t\t\tID = t.Gravel,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 1,\n\t\t\t\tDiffuseMap = \"Textures\\\\gravel\",\n\t\t\t\tNormalMap = \"Textures\\\\gravel-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.GRAVEL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State RockGrassy = new State\n\t\t\t{\n\t\t\t\tID = t.RockGrassy,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\rock-grassy\",\n\t\t\t\tNormalMap = \"Textures\\\\rock-grassy-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTiling = 0.7f,\n\t\t\t};\n\t\t\tpublic static readonly State Brick = new State\n\t\t\t{\n\t\t\t\tID = t.Brick,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\bricks\",\n\t\t\t\tNormalMap = \"Textures\\\\bricks-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTiling = 1.25f,\n\t\t\t};\n\t\t\tpublic static readonly State Lattice = new State\n\t\t\t{\n\t\t\t\tID = t.Lattice,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\lattice\",\n\t\t\t\tNormalMap = \"Textures\\\\lattice-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 100.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.3f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State RockChunky = new State\n\t\t\t{\n\t\t\t\tID = t.RockChunky,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\rock-chunky\",\n\t\t\t\tNormalMap = \"Textures\\\\rock-chunky-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTiling = 0.5f,\n\t\t\t\tTint = new Vector3(0.88f, 0.89f, 0.9f),\n\t\t\t};\n\t\t\tpublic static readonly State RockRed = new State\n\t\t\t{\n\t\t\t\tID = t.RockRed,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\red-rock\",\n\t\t\t\tNormalMap = \"Textures\\\\red-rock-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tTiling = 0.5f,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State GlowYellow = new State\n\t\t\t{\n\t\t\t\tID = t.GlowYellow,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tShadowCast = false,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\white\",\n\t\t\t\tNormalMap = \"Textures\\\\plain-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(1.4f, 1.4f, 0.7f),\n\t\t\t\tAllowOverlay = false,\n\t\t\t};\n\t\t\tpublic static readonly State GlowBlue = new State\n\t\t\t{\n\t\t\t\tID = t.GlowBlue,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tShadowCast = false,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\white\",\n\t\t\t\tNormalMap = \"Textures\\\\plain-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(0.7f, 0.8f, 1.4f),\n\t\t\t\tAllowOverlay = false,\n\t\t\t};\n\t\t\tpublic static readonly State GlowGreen = new State\n\t\t\t{\n\t\t\t\tID = t.GlowGreen,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tShadowCast = false,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\white\",\n\t\t\t\tNormalMap = \"Textures\\\\plain-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(0.7f, 1.4f, 0.7f),\n\t\t\t\tAllowOverlay = false,\n\t\t\t};\n\t\t\tpublic static readonly State GlowRed = new State\n\t\t\t{\n\t\t\t\tID = t.GlowRed,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tShadowCast = false,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\white\",\n\t\t\t\tNormalMap = \"Textures\\\\plain-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(1.4f, 0.7f, 0.7f),\n\t\t\t\tAllowOverlay = false,\n\t\t\t};\n\t\t\tpublic static readonly State SocketWhite = new State\n\t\t\t{\n\t\t\t\tID = t.SocketWhite,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\rectangles\",\n\t\t\t\tNormalMap = \"Textures\\\\rectangles-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(0.4f, 0.4f, 0.4f),\n\t\t\t};\n\t\t\tpublic static readonly State SocketYellow = new State\n\t\t\t{\n\t\t\t\tID = t.SocketYellow,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\rectangles\",\n\t\t\t\tNormalMap = \"Textures\\\\rectangles-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(0.5f, 0.5f, 0.1f),\n\t\t\t};\n\t\t\tpublic static readonly State SocketBlue = new State\n\t\t\t{\n\t\t\t\tID = t.SocketBlue,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\rectangles\",\n\t\t\t\tNormalMap = \"Textures\\\\rectangles-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTint = new Vector3(0.1f, 0.3f, 0.5f),\n\t\t\t};\n\t\t\tpublic static readonly State White = new State\n\t\t\t{\n\t\t\t\tID = t.White,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = false,\n\t\t\t\tShadowCast = false,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\white\",\n\t\t\t\tNormalMap = \"Textures\\\\plain-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t},\n\t\t\t\tAllowOverlay = false,\n\t\t\t};\n\t\t\tpublic static readonly State Metal = new State\n\t\t\t{\n\t\t\t\tID = t.Metal,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 1,\n\t\t\t\tDiffuseMap = \"Textures\\\\metal-channels2\",\n\t\t\t\tNormalMap = \"Textures\\\\metal-channels2-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.2f,\n\t\t\t\t\t},\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.15f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State MetalSwirl = new State\n\t\t\t{\n\t\t\t\tID = t.MetalSwirl,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 1,\n\t\t\t\tDiffuseMap = \"Textures\\\\metal-swirl\",\n\t\t\t\tNormalMap = \"Textures\\\\metal-swirl-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.2f,\n\t\t\t\t\t},\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.15f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State Hex = new State\n\t\t\t{\n\t\t\t\tID = t.Hex,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 1,\n\t\t\t\tDiffuseMap = \"Textures\\\\hex\",\n\t\t\t\tNormalMap = \"Textures\\\\hex-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State Invisible = new State\n\t\t\t{\n\t\t\t\tID = t.Invisible,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tInvisible = true,\n\t\t\t\tAllowAlpha = true,\n\t\t\t\tDensity = 1,\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.WOOD,\n\t\t\t\tDiffuseMap = \"Textures\\\\white\",\n\t\t\t\tNormalMap = \"Textures\\\\plain-normal\",\n\t\t\t\tTint = new Vector3(0.5f),\n\t\t\t\tAllowOverlay = false,\n\t\t\t};\n\t\t\tpublic static readonly State WhitePermanent = new State\n\t\t\t{\n\t\t\t\tID = t.WhitePermanent,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tShadowCast = false,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\white\",\n\t\t\t\tNormalMap = \"Textures\\\\plain-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t},\n\t\t\t\tAllowOverlay = false,\n\t\t\t};\n\t\t\tpublic static readonly State Switch = new State\n\t\t\t{\n\t\t\t\tID = t.Switch,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 1,\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tDiffuseMap = \"Textures\\\\switch\",\n\t\t\t\tNormalMap = \"Textures\\\\switch-normal\",\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t},\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTiling = 3.0f,\n\t\t\t\tTint = new Vector3(0.3f, 0.6f, 0.8f),\n\t\t\t};\n\t\t\tpublic static readonly State PoweredSwitch = new State\n\t\t\t{\n\t\t\t\tID = t.PoweredSwitch,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 1,\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t\tDiffuseMap = \"Textures\\\\powered-switch\",\n\t\t\t\tNormalMap = \"Textures\\\\switch-normal\",\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTiling = 3.0f,\n\t\t\t};\n\t\t\tpublic static readonly State Powered = new State\n\t\t\t{\n\t\t\t\tID = t.Powered,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = false,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\powered\",\n\t\t\t\tNormalMap = \"Textures\\\\temporary-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State PermanentPowered = new State\n\t\t\t{\n\t\t\t\tID = t.PermanentPowered,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2,\n\t\t\t\tDiffuseMap = \"Textures\\\\powered-permanent\",\n\t\t\t\tNormalMap = \"Textures\\\\temporary-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State HardInfected = new State\n\t\t\t{\n\t\t\t\tID = t.HardInfected,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 2.0f,\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tDiffuseMap = \"Textures\\\\infected-hard\",\n\t\t\t\tNormalMap = \"Textures\\\\temporary-normal\",\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State Infected = new State\n\t\t\t{\n\t\t\t\tID = t.Infected,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = false,\n\t\t\t\tDensity = 3,\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tDiffuseMap = \"Textures\\\\infected\",\n\t\t\t\tNormalMap = \"Textures\\\\temporary-normal\",\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t\tpublic static readonly State Black = new State\n\t\t\t{\n\t\t\t\tID = t.Black,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tShadowCast = true,\n\t\t\t\tDensity = 0.1f,\n\t\t\t\tDiffuseMap = \"Textures\\\\white\",\n\t\t\t\tNormalMap = \"Textures\\\\plain-normal\",\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.STONE,\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTint = Vector3.Zero,\n\t\t\t\tAllowOverlay = false,\n\t\t\t};\n\t\t\tpublic static readonly State Slider = new State\n\t\t\t{\n\t\t\t\tID = t.Slider,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 1,\n\t\t\t\tDiffuseMap = \"Textures\\\\slider\",\n\t\t\t\tNormalMap = \"Textures\\\\slider-normal\",\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tKineticFriction = 0,\n\t\t\t\tStaticFriction = 0,\n\t\t\t\tTiling = 2.0f,\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t};\n\t\t\tpublic static readonly State SliderPowered = new State\n\t\t\t{\n\t\t\t\tID = t.SliderPowered,\n\t\t\t\tPermanent = true,\n\t\t\t\tSupported = true,\n\t\t\t\tHard = true,\n\t\t\t\tDensity = 1,\n\t\t\t\tDiffuseMap = \"Textures\\\\slider\",\n\t\t\t\tNormalMap = \"Textures\\\\slider-normal\",\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tModel.Material.Unlit,\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 200.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tKineticFriction = 0,\n\t\t\t\tStaticFriction = 0,\n\t\t\t\tTiling = 2.0f,\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.METAL,\n\t\t\t};\n\t\t\tpublic static readonly State Snow = new State\n\t\t\t{\n\t\t\t\tID = t.Snow,\n\t\t\t\tPermanent = false,\n\t\t\t\tSupported = false,\n\t\t\t\tHard = false,\n\t\t\t\tDensity = 0.5f,\n\t\t\t\tTiling = 0.5f,\n\t\t\t\tDiffuseMap = \"Textures\\\\snow\",\n\t\t\t\tNormalMap = \"Textures\\\\snow-normal\",\n\t\t\t\tMaterials = new[]\n\t\t\t\t{\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\t\t},\n\t\t\t\t\tnew Model.Material\n\t\t\t\t\t{\n\t\t\t\t\t\tSpecularPower = 50.0f,\n\t\t\t\t\t\tSpecularIntensity = 0.4f,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFootstepSwitch = AK.SWITCHES.FOOTSTEP_MATERIAL.SWITCH.GRAVEL,\n\t\t\t\tAllowOverlay = false,\n\t\t\t};\n\n\t\t\tpublic static void Init()\n\t\t\t{\n\t\t\t\tforeach (FieldInfo field in typeof(States).GetFields(BindingFlags.Static | BindingFlags.Public))\n\t\t\t\t{\n\t\t\t\t\tif (field.FieldType == typeof(State))\n\t\t\t\t\t\tStates.Add((State)field.GetValue(null));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic struct Vertex\n\t\t{\n\t\t\tpublic Vector3 Position;\n\t\t\tpublic Vector3 Normal;\n\t\t\tpublic Vector3 Binormal;\n\t\t\tpublic Vector3 Tangent;\n\n\t\t\tpublic static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration\n\t\t\t(\n\t\t\t\tnew VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),\n\t\t\t\tnew VertexElement(12, VertexElementFormat.Vector3, VertexElementUsage.Normal, 0),\n\t\t\t\tnew VertexElement(24, VertexElementFormat.Vector3, VertexElementUsage.Binormal, 0),\n\t\t\t\tnew VertexElement(36, VertexElementFormat.Vector3, VertexElementUsage.Tangent, 0)\n\t\t\t);\n\n\t\t\tpublic const int SizeInBytes = 48;\n\t\t}\n\n\t\tpublic class Snapshot\n\t\t{\n\t\t\tprivate Dictionary<Coord, ChunkData> chunks = new Dictionary<Coord, ChunkData>();\n\t\t\tprivate Voxel map;\n\n\t\t\tpublic Snapshot(Voxel m, Coord start, Coord end)\n\t\t\t{\n\t\t\t\tthis.map = m;\n\t\t\t\tthis.Add(start, end);\n\t\t\t}\n\n\t\t\tpublic void Add(Coord start, Coord end)\n\t\t\t{\n\t\t\t\tforeach (Chunk chunk in this.map.GetChunksBetween(start, end))\n\t\t\t\t{\n\t\t\t\t\tCoord chunkKey = new Coord { X = chunk.IndexX, Y = chunk.IndexY, Z = chunk.IndexZ };\n\t\t\t\t\tChunkData data;\n\t\t\t\t\tif (!this.chunks.TryGetValue(chunkKey, out data))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.chunks[chunkKey] = data = new ChunkData(this.map.chunkSize);\n\t\t\t\t\t\tdata.X = chunk.X;\n\t\t\t\t\t\tdata.Y = chunk.Y;\n\t\t\t\t\t\tdata.Z = chunk.Z;\n\t\t\t\t\t\tdata.IndexX = chunk.IndexX;\n\t\t\t\t\t\tdata.IndexY = chunk.IndexY;\n\t\t\t\t\t\tdata.IndexZ = chunk.IndexZ;\n\t\t\t\t\t\tfor (int u = 0; u < this.map.chunkSize; u++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int v = 0; v < this.map.chunkSize; v++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (int w = 0; w < this.map.chunkSize; w++)\n\t\t\t\t\t\t\t\t\tdata[u, v, w] = chunk[u, v, w];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void Free()\n\t\t\t{\n\t\t\t\tthis.chunks.Clear();\n\t\t\t}\n\n\t\t\tpublic State this[Coord coord]\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\tint indexX = (coord.X - this.map.minX) / this.map.chunkSize;\n\t\t\t\t\tint indexY = (coord.Y - this.map.minY) / this.map.chunkSize;\n\t\t\t\t\tint indexZ = (coord.Z - this.map.minZ) / this.map.chunkSize;\n\t\t\t\t\tChunkData data;\n\t\t\t\t\tif (this.chunks.TryGetValue(new Coord { X = indexX, Y = indexY, Z = indexZ }, out data))\n\t\t\t\t\t{\n\t\t\t\t\t\tBox box = data[coord.X - data.X, coord.Y - data.Y, coord.Z - data.Z];\n\t\t\t\t\t\tif (box != null)\n\t\t\t\t\t\t\treturn box.Type;\n\t\t\t\t\t}\n\t\t\t\t\treturn Voxel.States.Empty;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic class State\n\t\t{\n\t\t\tpublic t ID;\n\t\t\tpublic bool Permanent;\n\t\t\tpublic bool Supported;\n\t\t\tpublic bool Hard;\n\t\t\t[DefaultValue(true)]\n\t\t\tpublic bool AllowOverlay = true;\n\t\t\tpublic string DiffuseMap;\n\t\t\tpublic string NormalMap;\n\t\t\tpublic uint FootstepSwitch;\n\t\t\tpublic uint RubbleEvent;\n\t\t\tpublic float KineticFriction = MaterialManager.DefaultKineticFriction;\n\t\t\tpublic float StaticFriction = MaterialManager.DefaultStaticFriction;\n\t\t\tpublic float Density;\n\t\t\t[DefaultValue(false)]\n\t\t\tpublic bool AllowAlpha;\n\t\t\t[DefaultValue(false)]\n\t\t\tpublic bool AlphaShadowMask;\n\t\t\t[DefaultValue(true)]\n\t\t\tpublic bool ShadowCast = true;\n\t\t\t[DefaultValue(false)]\n\t\t\tpublic bool Fake;\n\t\t\t[DefaultValue(false)]\n\t\t\tpublic bool Invisible;\n\t\t\tpublic Model.Material[] Materials = new[]\n\t\t\t{\n\t\t\t\tnew Model.Material(),\n\t\t\t\tnew Model.Material()\n\t\t\t};\n\t\t\t[DefaultValue(1.0f)]\n\t\t\tpublic float Tiling = 1.0f;\n\t\t\tpublic Vector3 Tint = Vector3.One;\n\n\t\t\tpublic void ApplyTo(Model model)\n\t\t\t{\n\t\t\t\tmodel.DiffuseTexture.Value = this.DiffuseMap;\n\t\t\t\tmodel.NormalMap.Value = this.NormalMap;\n\t\t\t\tmodel.Materials = this.Materials;\n\t\t\t\tmodel.DisableCulling.Value = this.AllowAlpha;\n\t\t\t\tmodel.Color.Value = this.Tint;\n\t\t\t\tif (this.AllowOverlay)\n\t\t\t\t{\n\t\t\t\t\tWorld world = WorldFactory.Instance.Get<World>();\n\t\t\t\t\tmodel.Add(new Binding<string>(model.TechniquePostfix, delegate(string overlay)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (string.IsNullOrEmpty(overlay))\n\t\t\t\t\t\t\treturn this.AllowAlpha ? \"Alpha\" : (this.AlphaShadowMask ? \"ShadowMask\" : \"\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn this.AllowAlpha ? \"OverlayAlpha\" : (this.AlphaShadowMask ? \"OverlayShadowMask\" : \"Overlay\");\n\t\t\t\t\t}, world.OverlayTexture));\n\t\t\t\t\tmodel.Add(new Binding<Texture2D>(model.GetTexture2DParameter(\"Overlay\" + Model.SamplerPostfix), world.OverlayTextureHandle));\n\t\t\t\t\tmodel.Add(new Binding<float>(model.GetFloatParameter(\"OverlayTiling\"), x => 0.075f * x, world.OverlayTiling));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void ApplyToBlock(ComponentBind.Entity block)\n\t\t\t{\n\t\t\t\tBlock b = block.Get<Block>();\n\t\t\t\tif (b != null)\n\t\t\t\t\tb.StateId.Value = this.ID;\n\t\t\t\tblock.Get<PhysicsBlock>().Box.Mass = this.Density * 0.5f * 0.5f * 0.5f;\n\t\t\t\tthis.ApplyToEffectBlock(block.Get<ModelInstance>());\n\t\t\t}\n\n\t\t\tpublic void ApplyToEffectBlock(ModelInstance modelInstance)\n\t\t\t{\n\t\t\t\tmodelInstance.Setup(\"InstancedModels\\\\block\", (int)this.ID);\n\t\t\t\tif (modelInstance.IsFirstInstance)\n\t\t\t\t{\n\t\t\t\t\tModel model = modelInstance.Model;\n\t\t\t\t\tthis.ApplyTo(model);\n\t\t\t\t\tmodel.GetMatrixParameter(\"UVScaleRotation\").Value = Matrix.CreateScale(0.075f * this.Tiling);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn this.ID.ToString();\n\t\t\t}\n\t\t}\n\n\t\tpublic class ChunkData\n\t\t{\n\t\t\tpublic int IndexX, IndexY, IndexZ;\n\t\t\tpublic int X, Y, Z;\n\t\t\tprivate Box[, ,][, ,] data;\n\t\t\tprivate int size;\n\t\t\tprivate int subchunkSize;\n\t\t\tprivate const int subchunks = 10;\n\n\t\t\tpublic ChunkData(int size)\n\t\t\t{\n\t\t\t\tif (size % subchunks != 0)\n\t\t\t\t\tthrow new Exception(string.Format(\"Chunk size must be a multiple of {0}.\", subchunks));\n\t\t\t\tthis.size = size;\n\t\t\t\tthis.subchunkSize = size / subchunks;\n\t\t\t\tthis.data = Voxel.subchunkHeap.Get(subchunks);\n\t\t\t}\n\n\t\t\tpublic Box this[int x, int y, int z]\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\tint ix = x / this.subchunkSize, iy = y / this.subchunkSize, iz = z / this.subchunkSize;\n\t\t\t\t\tBox[, ,] subchunk = this.data[ix, iy, iz];\n\t\t\t\t\tif (subchunk == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\treturn subchunk[x - (ix * this.subchunkSize), y - (iy * this.subchunkSize), z - (iz * this.subchunkSize)];\n\t\t\t\t}\n\t\t\t\tset\n\t\t\t\t{\n\t\t\t\t\tint ix = x / this.subchunkSize, iy = y / this.subchunkSize, iz = z / this.subchunkSize;\n\t\t\t\t\tBox[, ,] subchunk = this.data[ix, iy, iz];\n\t\t\t\t\tif (subchunk == null)\n\t\t\t\t\t\tthis.data[ix, iy, iz] = subchunk = Voxel.boxHeap.Get(this.subchunkSize);\n\t\t\t\t\tsubchunk[x - (ix * this.subchunkSize), y - (iy * this.subchunkSize), z - (iz * this.subchunkSize)] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void Free()\n\t\t\t{\n\t\t\t\tfor (int x = 0; x < subchunks; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = 0; y < subchunks; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int z = 0; z < subchunks; z++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.data[x, y, z] = null;\n\t\t\t\t\t\t\tBox[,,] subchunk = this.data[x, y, z];\n\t\t\t\t\t\t\tif (subchunk != null)\n\t\t\t\t\t\t\t\tVoxel.boxHeap.Free(this.subchunkSize, subchunk);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tVoxel.subchunkHeap.Free(subchunks, this.data);\n\t\t\t}\n\t\t}\n\n\t\tpublic class Chunk : ChunkData\n\t\t{\n\t\t\tprotected class MeshEntry\n\t\t\t{\n\t\t\t\tpublic StaticMesh Mesh;\n\t\t\t\tpublic DynamicModel<Vertex> Model;\n\t\t\t\tpublic bool Dirty;\n\t\t\t\tpublic bool Added;\n\t\t\t}\n\n\t\t\tpublic bool Active = false;\n\t\t\tpublic bool EnablePhysics;\n\t\t\tpublic Voxel Voxel;\n\t\t\tpublic ListProperty<Box> Boxes = new ListProperty<Box>();\n\t\t\tpublic BoundingBox RelativeBoundingBox;\n\n\t\t\tpublic List<Box> DataBoxes;\n\n\t\t\tprotected Dictionary<t, MeshEntry> meshes = new Dictionary<t, MeshEntry>();\n\n\t\t\tpublic void UpdateTransform(BEPUutilities.AffineTransform t)\n\t\t\t{\n\t\t\t\tlock (this.meshes)\n\t\t\t\t{\n\t\t\t\t\tforeach (KeyValuePair<t, MeshEntry> pair in this.meshes)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (pair.Value.Mesh != null)\n\t\t\t\t\t\t\tpair.Value.Mesh.WorldTransform = t;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void MarkDirty(Box box)\n\t\t\t{\n\t\t\t\tMeshEntry entry = null;\n\t\t\t\tif (!this.meshes.TryGetValue(box.Type.ID, out entry))\n\t\t\t\t{\n\t\t\t\t\tlock (this.meshes)\n\t\t\t\t\t{\n\t\t\t\t\t\tentry = new MeshEntry();\n\t\t\t\t\t\tif (this.Voxel.CreateModel != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVector3 min = new Vector3(this.X, this.Y, this.Z);\n\t\t\t\t\t\t\tVector3 max = min + new Vector3(this.Voxel.chunkSize);\n\t\t\t\t\t\t\tentry.Model = this.Voxel.CreateModel(min, max, box.Type);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.meshes[box.Type.ID] = entry;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tentry.Dirty = true;\n\t\t\t}\n\n\t\t\tpublic Chunk(int size)\n\t\t\t\t: base(size)\n\t\t\t{\n\t\t\t\tthis.Boxes.ItemAdded += delegate(int index, Box t)\n\t\t\t\t{\n\t\t\t\t\tint chunkHalfSize = this.Voxel.chunkHalfSize;\n\t\t\t\t\tthis.MarkDirty(t);\n\t\t\t\t\tt.Added = true;\n\t\t\t\t\tt.ChunkIndex = index;\n\t\t\t\t};\n\n\t\t\t\tthis.Boxes.ItemChanged += delegate(int index, Box old, Box newValue)\n\t\t\t\t{\n\t\t\t\t\tthis.MarkDirty(old);\n\t\t\t\t\tnewValue.ChunkIndex = old.ChunkIndex;\n\t\t\t\t};\n\n\t\t\t\tthis.Boxes.ItemRemoved += delegate(int index, Box t)\n\t\t\t\t{\n\t\t\t\t\tt.Added = false;\n\t\t\t\t\tfor (int i = index; i < this.Boxes.Length; i++)\n\t\t\t\t\t\tthis.Boxes[i].ChunkIndex = i;\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tprivate static Vertex negativeX = new Vertex { Normal = Vector3.Left, Binormal = Vector3.Up, Tangent = Vector3.Backward };\n\t\t\tprivate static Vertex positiveX = new Vertex { Normal = Vector3.Right, Binormal = Vector3.Up, Tangent = Vector3.Forward };\n\t\t\tprivate static Vertex negativeY = new Vertex { Normal = Vector3.Down, Binormal = Vector3.Right, Tangent = Vector3.Backward };\n\t\t\tprivate static Vertex positiveY = new Vertex { Normal = Vector3.Up, Binormal = Vector3.Right, Tangent = Vector3.Forward };\n\t\t\tprivate static Vertex negativeZ = new Vertex { Normal = Vector3.Forward, Binormal = Vector3.Up, Tangent = Vector3.Left };\n\t\t\tprivate static Vertex positiveZ = new Vertex { Normal = Vector3.Backward, Binormal = Vector3.Up, Tangent = Vector3.Right };\n\n\t\t\tpublic void RefreshImmediately()\n\t\t\t{\n\t\t\t\tlock (this.meshes)\n\t\t\t\t{\n\t\t\t\t\tforeach (KeyValuePair<t, MeshEntry> pair in this.meshes)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!pair.Value.Dirty)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tMeshEntry entry = pair.Value;\n\t\t\t\t\t\tentry.Dirty = false;\n\n\t\t\t\t\t\tint surfaces = 0;\n\t\t\t\t\t\tfor (int i = 0; i < this.Boxes.Count; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBox b = this.Boxes[i];\n\t\t\t\t\t\t\tif (b.Type.ID == pair.Key)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Count number of set bits\n\t\t\t\t\t\t\t\tsurfaces +=\n\t\t\t\t\t\t\t\t\t((b.Surfaces & (1 << 0)) != 0 ? 1 : 0)\n\t\t\t\t\t\t\t\t\t+ ((b.Surfaces & (1 << 1)) != 0 ? 1 : 0)\n\t\t\t\t\t\t\t\t\t+ ((b.Surfaces & (1 << 2)) != 0 ? 1 : 0)\n\t\t\t\t\t\t\t\t\t+ ((b.Surfaces & (1 << 3)) != 0 ? 1 : 0)\n\t\t\t\t\t\t\t\t\t+ ((b.Surfaces & (1 << 4)) != 0 ? 1 : 0)\n\t\t\t\t\t\t\t\t\t+ ((b.Surfaces & (1 << 5)) != 0 ? 1 : 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tState type = Voxel.States.All[pair.Key];\n\n\t\t\t\t\t\tVertex[] vertices = null;\n\t\t\t\t\t\tVector3[] physicsVertices = null;\n\n\t\t\t\t\t\tDynamicModel<Vertex> model = pair.Value.Model;\n\n\t\t\t\t\t\tif (surfaces > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (model != null)\n\t\t\t\t\t\t\t\tvertices = Voxel.vertexHeap.Get((int)Math.Pow(LargeObjectHeap<Vertex[]>.GrowthFactor, Math.Ceiling(Math.Log(surfaces * 4, LargeObjectHeap<Vertex[]>.GrowthFactor))));\n\n\t\t\t\t\t\t\tif (this.EnablePhysics && !type.Fake)\n\t\t\t\t\t\t\t\tphysicsVertices = Voxel.physicsVertexHeap.Get((int)Math.Pow(LargeObjectHeap<Vector3[]>.GrowthFactor, Math.Ceiling(Math.Log(surfaces * 4, LargeObjectHeap<Vector3[]>.GrowthFactor))));\n\n\t\t\t\t\t\t\tuint vertexIndex = 0;\n\t\t\t\t\t\t\tfor (int i = 0; i < this.Boxes.Count; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBox box = this.Boxes[i];\n\t\t\t\t\t\t\t\tif (box.Type.ID == pair.Key)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tVector3 a = new Vector3(box.X, box.Y, box.Z);\n\t\t\t\t\t\t\t\t\tVector3 b = new Vector3(box.X, box.Y, box.Z + box.Depth);\n\t\t\t\t\t\t\t\t\tVector3 c = new Vector3(box.X, box.Y + box.Height, box.Z);\n\t\t\t\t\t\t\t\t\tVector3 d = new Vector3(box.X, box.Y + box.Height, box.Z + box.Depth);\n\t\t\t\t\t\t\t\t\tVector3 e = new Vector3(box.X + box.Width, box.Y, box.Z);\n\t\t\t\t\t\t\t\t\tVector3 f = new Vector3(box.X + box.Width, box.Y, box.Z + box.Depth);\n\t\t\t\t\t\t\t\t\tVector3 g = new Vector3(box.X + box.Width, box.Y + box.Height, box.Z);\n\t\t\t\t\t\t\t\t\tVector3 h = new Vector3(box.X + box.Width, box.Y + box.Height, box.Z + box.Depth);\n\n\t\t\t\t\t\t\t\t\tif ((box.Surfaces & (1 << (int)Direction.NegativeX)) != 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (vertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeX.Position = a; vertices[vertexIndex + 0] = Chunk.negativeX;\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeX.Position = b; vertices[vertexIndex + 1] = Chunk.negativeX;\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeX.Position = c; vertices[vertexIndex + 2] = Chunk.negativeX;\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeX.Position = d; vertices[vertexIndex + 3] = Chunk.negativeX;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (physicsVertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 0] = a;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 1] = b;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 2] = c;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 3] = d;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvertexIndex += 4;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ((box.Surfaces & (1 << (int)Direction.PositiveX)) != 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (vertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveX.Position = e; vertices[vertexIndex + 0] = Chunk.positiveX;\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveX.Position = g; vertices[vertexIndex + 1] = Chunk.positiveX;\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveX.Position = f; vertices[vertexIndex + 2] = Chunk.positiveX;\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveX.Position = h; vertices[vertexIndex + 3] = Chunk.positiveX;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (physicsVertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 0] = e;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 1] = g;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 2] = f;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 3] = h;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvertexIndex += 4;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ((box.Surfaces & (1 << (int)Direction.NegativeY)) != 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (vertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeY.Position = a; vertices[vertexIndex + 0] = Chunk.negativeY;\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeY.Position = e; vertices[vertexIndex + 1] = Chunk.negativeY;\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeY.Position = b; vertices[vertexIndex + 2] = Chunk.negativeY;\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeY.Position = f; vertices[vertexIndex + 3] = Chunk.negativeY;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (physicsVertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 0] = a;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 1] = e;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 2] = b;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 3] = f;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvertexIndex += 4;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ((box.Surfaces & (1 << (int)Direction.PositiveY)) != 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (vertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveY.Position = c; vertices[vertexIndex + 0] = Chunk.positiveY;\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveY.Position = d; vertices[vertexIndex + 1] = Chunk.positiveY;\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveY.Position = g; vertices[vertexIndex + 2] = Chunk.positiveY;\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveY.Position = h; vertices[vertexIndex + 3] = Chunk.positiveY;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (physicsVertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 0] = c;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 1] = d;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 2] = g;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 3] = h;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvertexIndex += 4;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ((box.Surfaces & (1 << (int)Direction.NegativeZ)) != 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (vertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeZ.Position = a; vertices[vertexIndex + 0] = Chunk.negativeZ;\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeZ.Position = c; vertices[vertexIndex + 1] = Chunk.negativeZ;\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeZ.Position = e; vertices[vertexIndex + 2] = Chunk.negativeZ;\n\t\t\t\t\t\t\t\t\t\t\tChunk.negativeZ.Position = g; vertices[vertexIndex + 3] = Chunk.negativeZ;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (physicsVertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 0] = a;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 1] = c;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 2] = e;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 3] = g;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvertexIndex += 4;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ((box.Surfaces & (1 << (int)Direction.PositiveZ)) != 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (vertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveZ.Position = b; vertices[vertexIndex + 0] = Chunk.positiveZ;\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveZ.Position = f; vertices[vertexIndex + 1] = Chunk.positiveZ;\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveZ.Position = d; vertices[vertexIndex + 2] = Chunk.positiveZ;\n\t\t\t\t\t\t\t\t\t\t\tChunk.positiveZ.Position = h; vertices[vertexIndex + 3] = Chunk.positiveZ;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (physicsVertices != null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 0] = b;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 1] = f;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 2] = d;\n\t\t\t\t\t\t\t\t\t\t\tphysicsVertices[vertexIndex + 3] = h;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvertexIndex += 4;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tVertex[] verticesCopy = null;\n\t\t\t\t\t\tif (vertices != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tverticesCopy = Voxel.vertexHeap.Get(vertices.Length);\n\t\t\t\t\t\t\tArray.Copy(vertices, verticesCopy, surfaces * 4);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (model != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (model.Lock)\n\t\t\t\t\t\t\t\tmodel.UpdateVertices(verticesCopy, surfaces);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (vertices != null)\n\t\t\t\t\t\t\tVoxel.vertexHeap.Free(vertices.Length, vertices);\n\n\t\t\t\t\t\tStaticMesh oldMesh = null;\n\t\t\t\t\t\tif (entry.Mesh != null && entry.Added)\n\t\t\t\t\t\t\toldMesh = entry.Mesh;\n\n\t\t\t\t\t\tif (physicsVertices != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tMatrix transform = this.Voxel.Transform;\n\t\t\t\t\t\t\tVector3[] physicsVerticesCopy = Voxel.physicsVertexHeap.Get(physicsVertices.Length);\n\t\t\t\t\t\t\tArray.Copy(physicsVertices, physicsVerticesCopy, surfaces * 4);\n\t\t\t\t\t\t\tStaticMesh mesh = new StaticMesh(physicsVerticesCopy, DynamicModel<Vertex>.GetIndices(surfaces * 6), surfaces * 6, new BEPUutilities.AffineTransform(BEPUutilities.Matrix3x3.CreateFromMatrix(transform), transform.Translation));\n\t\t\t\t\t\t\tmesh.Material.KineticFriction = type.KineticFriction;\n\t\t\t\t\t\t\tmesh.Material.StaticFriction = type.StaticFriction;\n\t\t\t\t\t\t\tmesh.Tag = this.Voxel;\n\t\t\t\t\t\t\tmesh.Sidedness = BEPUutilities.TriangleSidedness.Counterclockwise;\n\t\t\t\t\t\t\tentry.Mesh = mesh;\n\t\t\t\t\t\t\tif (this.Active)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tentry.Added = true;\n\t\t\t\t\t\t\t\tthis.Voxel.main.Space.SpaceObjectBuffer.Add(mesh);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tVoxel.physicsVertexHeap.Free(physicsVertices.Length, physicsVertices);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tentry.Mesh = null;\n\n\t\t\t\t\t\tif (oldMesh != null)\n\t\t\t\t\t\t\tthis.Voxel.main.Space.SpaceObjectBuffer.Remove(oldMesh);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void Instantiate()\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.DataBoxes.Count; i++)\n\t\t\t\t\tthis.Voxel.addBoxWithoutAdjacency(this.DataBoxes[i]);\n\n\t\t\t\tthis.Boxes.AddAll(this.DataBoxes);\n\t\t\t\tthis.DataBoxes.Clear();\n\t\t\t\tthis.DataBoxes = null;\n\n\t\t\t\tif (!this.Voxel.main.EditorEnabled && !this.Voxel.Mutable)\n\t\t\t\t{\n\t\t\t\t\tthis.Free();\n\t\t\t\t\tfor (int i = 0; i < this.Boxes.Count; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox box = this.Boxes[i];\n\t\t\t\t\t\tbox.Adjacent.Clear();\n\t\t\t\t\t\tbox.Adjacent = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.RefreshImmediately();\n\t\t\t}\n\n\t\t\tpublic void RebuildAdjacency()\n\t\t\t{\n\t\t\t\tthis.Voxel.calculateAdjacency(this.Boxes);\n\t\t\t\tfor (int i = 0; i < this.Boxes.Count; i++)\n\t\t\t\t\tthis.Voxel.regenerateSurfaces(this.Boxes[i]);\n\t\t\t\tthis.RefreshImmediately();\n\t\t\t}\n\n\t\t\tpublic virtual void Activate()\n\t\t\t{\n\t\t\t\tif (!this.Active && this.EnablePhysics)\n\t\t\t\t{\n\t\t\t\t\tlock (this.meshes)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (MeshEntry entry in this.meshes.Values)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!entry.Added)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tentry.Added = true;\n\t\t\t\t\t\t\t\tif (entry.Mesh != null)\n\t\t\t\t\t\t\t\t\tthis.Voxel.main.Space.SpaceObjectBuffer.Add(entry.Mesh);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.Active = true;\n\t\t\t}\n\n\t\t\tpublic virtual void Deactivate()\n\t\t\t{\n\t\t\t\tif (this.Active && this.EnablePhysics)\n\t\t\t\t{\n\t\t\t\t\tlock (this.meshes)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (MeshEntry entry in this.meshes.Values)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (entry.Added)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tentry.Added = false;\n\t\t\t\t\t\t\t\tif (entry.Mesh != null)\n\t\t\t\t\t\t\t\t\tthis.Voxel.main.Space.SpaceObjectBuffer.Remove(entry.Mesh);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.Active = false;\n\t\t\t}\n\n\t\t\tpublic virtual void Delete()\n\t\t\t{\n\t\t\t\tif (this.Active && this.EnablePhysics)\n\t\t\t\t{\n\t\t\t\t\tlock (this.meshes)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (MeshEntry entry in this.meshes.Values)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (entry.Added)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tentry.Added = false;\n\t\t\t\t\t\t\t\tif (entry.Mesh != null)\n\t\t\t\t\t\t\t\t\tthis.Voxel.main.Space.SpaceObjectBuffer.Remove(entry.Mesh);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.Active = false;\n\t\t\t\tthis.Free();\n\t\t\t\tlock (this.meshes)\n\t\t\t\t\tthis.meshes.Clear();\n\t\t\t\tfor (int i = 0; i < this.Boxes.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tBox box = this.Boxes[i];\n\t\t\t\t\tif (box.Adjacent != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.Adjacent.Clear();\n\t\t\t\t\t\tbox.Adjacent = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.Boxes.Clear();\n\t\t\t\tthis.Boxes = null;\n\t\t\t}\n\t\t}\n\n\t\tpublic struct Coord\n\t\t{\n\t\t\tpublic int X;\n\t\t\tpublic int Y;\n\t\t\tpublic int Z;\n\t\t\tpublic State Data;\n\n\t\t\tpublic Coord WithData(State state)\n\t\t\t{\n\t\t\t\treturn new Coord\n\t\t\t\t{\n\t\t\t\t\tX = this.X,\n\t\t\t\t\tY = this.Y,\n\t\t\t\t\tZ = this.Z,\n\t\t\t\t\tData = state,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tpublic static readonly int SizeInBytes = 3 * sizeof(int) + IntPtr.Size;\n\n\t\t\tpublic Coord Move(Direction dir, int amount)\n\t\t\t{\n\t\t\t\tint x = this.X, y = this.Y, z = this.Z;\n\t\t\t\tswitch (dir)\n\t\t\t\t{\n\t\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\t\tx -= amount;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\t\tx += amount;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.NegativeY:\n\t\t\t\t\t\ty -= amount;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.PositiveY:\n\t\t\t\t\t\ty += amount;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\t\tz -= amount;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\t\tz += amount;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn new Coord { X = x, Y = y, Z = z, Data = this.Data };\n\t\t\t}\n\n\t\t\tpublic static Coord Max(Coord a, Coord b)\n\t\t\t{\n\t\t\t\treturn new Coord\n\t\t\t\t{\n\t\t\t\t\tX = Math.Max(a.X, b.X),\n\t\t\t\t\tY = Math.Max(a.Y, b.Y),\n\t\t\t\t\tZ = Math.Max(a.Z, b.Z),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tpublic static Coord Min(Coord a, Coord b)\n\t\t\t{\n\t\t\t\treturn new Coord\n\t\t\t\t{\n\t\t\t\t\tX = Math.Min(a.X, b.X),\n\t\t\t\t\tY = Math.Min(a.Y, b.Y),\n\t\t\t\t\tZ = Math.Min(a.Z, b.Z),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tpublic Coord Plus(Coord other)\n\t\t\t{\n\t\t\t\treturn new Coord { X = this.X + other.X, Y = this.Y + other.Y, Z = this.Z + other.Z };\n\t\t\t}\n\n\t\t\tpublic Coord Minus(Coord other)\n\t\t\t{\n\t\t\t\treturn new Coord { X = this.X - other.X, Y = this.Y - other.Y, Z = this.Z - other.Z };\n\t\t\t}\n\n\t\t\t// Expects every dimension of A to be smaller than every dimension of B.\n\t\t\tpublic bool Between(Coord a, Coord b)\n\t\t\t{\n\t\t\t\treturn this.X >= a.X && this.X < b.X\n\t\t\t\t\t&& this.Y >= a.Y && this.Y < b.Y\n\t\t\t\t\t&& this.Z >= a.Z && this.Z < b.Z;\n\t\t\t}\n\n\t\t\tpublic IEnumerable<Coord> CoordinatesBetween(Coord b)\n\t\t\t{\n\t\t\t\tfor (int x = this.X; x < b.X; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = this.Y; y < b.Y; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int z = this.Z; z < b.Z; z++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyield return new Coord { X = x, Y = y, Z = z };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool Equivalent(Coord coord)\n\t\t\t{\n\t\t\t\treturn coord.X == this.X && coord.Y == this.Y && coord.Z == this.Z;\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\tint hash = 23;\n\t\t\t\thash = hash * 31 + this.X;\n\t\t\t\thash = hash * 31 + this.Y;\n\t\t\t\thash = hash * 31 + this.Z;\n\t\t\t\treturn hash;\n\t\t\t}\n\n\t\t\tpublic Coord Reorient(Direction x, Direction y, Direction z)\n\t\t\t{\n\t\t\t\tCoord c = new Coord();\n\t\t\t\tc.SetComponent(x, this.X);\n\t\t\t\tc.SetComponent(y, this.Y);\n\t\t\t\tc.SetComponent(z, this.Z);\n\t\t\t\treturn c;\n\t\t\t}\n\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tif (obj.GetType() == typeof(Voxel.Coord))\n\t\t\t\t{\n\t\t\t\t\tVoxel.Coord coord = (Voxel.Coord)obj;\n\t\t\t\t\treturn coord.X == this.X && coord.Y == this.Y && coord.Z == this.Z;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpublic Coord Move(int x, int y, int z)\n\t\t\t{\n\t\t\t\treturn new Coord { X = this.X + x, Y = this.Y + y, Z = this.Z + z, Data = this.Data };\n\t\t\t}\n\n\t\t\tpublic Coord Move(Direction dir)\n\t\t\t{\n\t\t\t\treturn this.Move(dir, 1);\n\t\t\t}\n\n\t\t\tpublic Coord Clone()\n\t\t\t{\n\t\t\t\treturn new Coord { X = this.X, Y = this.Y, Z = this.Z, Data = this.Data };\n\t\t\t}\n\n\t\t\tpublic int GetComponent(Direction dir)\n\t\t\t{\n\t\t\t\tswitch (dir)\n\t\t\t\t{\n\t\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\t\treturn -this.X;\n\t\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\t\treturn this.X;\n\t\t\t\t\tcase Direction.NegativeY:\n\t\t\t\t\t\treturn -this.Y;\n\t\t\t\t\tcase Direction.PositiveY:\n\t\t\t\t\t\treturn this.Y;\n\t\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\t\treturn -this.Z;\n\t\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\t\treturn this.Z;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void SetComponent(Direction dir, int value)\n\t\t\t{\n\t\t\t\tswitch (dir)\n\t\t\t\t{\n\t\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\t\tthis.X = -value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\t\tthis.X = value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.NegativeY:\n\t\t\t\t\t\tthis.Y = -value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.PositiveY:\n\t\t\t\t\t\tthis.Y = value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\t\tthis.Z = -value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\t\tthis.Z = value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn string.Format(\"[{0},{1},{2}]\", this.X, this.Y, this.Z);\n\t\t\t}\n\t\t}\n\n\t\tpublic class Box\n\t\t{\n\t\t\tpublic int X;\n\t\t\tpublic int Y;\n\t\t\tpublic int Z;\n\t\t\tpublic int Width;\n\t\t\tpublic int Height;\n\t\t\tpublic int Depth;\n\t\t\tpublic State Type;\n\n\t\t\t[XmlIgnore]\n\t\t\tpublic bool Active = true;\n\t\t\t[XmlIgnore]\n\t\t\tpublic bool Added;\n\t\t\t[XmlIgnore]\n\t\t\tpublic int ChunkIndex;\n\t\t\t[XmlIgnore]\n\t\t\tpublic Chunk Chunk;\n\t\t\t[XmlIgnore]\n\t\t\tpublic List<Box> Adjacent = new List<Box>();\n\t\t\t[XmlIgnore]\n\t\t\tpublic byte Surfaces;\n\n\t\t\t[XmlIgnore]\n\t\t\tpublic int Volume\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn this.Width * this.Height * this.Depth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic int GetComponent(Direction dir)\n\t\t\t{\n\t\t\t\tswitch (dir)\n\t\t\t\t{\n\t\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\t\treturn -this.X;\n\t\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\t\treturn this.X;\n\t\t\t\t\tcase Direction.NegativeY:\n\t\t\t\t\t\treturn -this.Y;\n\t\t\t\t\tcase Direction.PositiveY:\n\t\t\t\t\t\treturn this.Y;\n\t\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\t\treturn -this.Z;\n\t\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\t\treturn this.Z;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic IEnumerable<Voxel.Coord> GetCoords()\n\t\t\t{\n\t\t\t\tfor (int x = this.X; x < this.X + this.Width; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = this.Y; y < this.Y + this.Height; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int z = this.Z; z < this.Z + this.Depth; z++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyield return new Voxel.Coord { X = x, Y = y, Z = z, Data = this.Type };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic Vector3 GetCenter()\n\t\t\t{\n\t\t\t\treturn new Vector3(this.X + (this.Width * 0.5f), this.Y + (this.Height * 0.5f), this.Z + (this.Depth * 0.5f));\n\t\t\t}\n\n\t\t\tpublic int GetSizeComponent(Direction dir)\n\t\t\t{\n\t\t\t\tswitch (dir)\n\t\t\t\t{\n\t\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\t\treturn this.Width;\n\t\t\t\t\tcase Direction.NegativeY:\n\t\t\t\t\tcase Direction.PositiveY:\n\t\t\t\t\t\treturn this.Height;\n\t\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\t\treturn this.Depth;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool Contains(Coord coord)\n\t\t\t{\n\t\t\t\treturn coord.X >= this.X && coord.X < this.X + this.Width\n\t\t\t\t\t&& coord.Y >= this.Y && coord.Y < this.Y + this.Height\n\t\t\t\t\t&& coord.Z >= this.Z && coord.Z < this.Z + this.Depth;\n\t\t\t}\n\n\t\t\tpublic bool Between(Coord a, Coord b)\n\t\t\t{\n\t\t\t\treturn (a.X < this.X + this.Width || b.X >= this.X)\n\t\t\t\t\t&& (a.Y < this.Y + this.Height || b.Y >= this.Y)\n\t\t\t\t\t&& (a.Z < this.Z + this.Depth || b.Z >= this.Z);\n\t\t\t}\n\n\t\t\tpublic CompoundShapeEntry GetCompoundShapeEntry()\n\t\t\t{\n\t\t\t\treturn new CompoundShapeEntry(new BoxShape(this.Width, this.Height, this.Depth), new Vector3(this.X + (this.Width * 0.5f), this.Y + (this.Height * 0.5f), this.Z + (this.Depth * 0.5f)), this.Type.Density * this.Width * this.Height * this.Depth);\n\t\t\t}\n\t\t}\n\n\t\tpublic static readonly List<Voxel> Voxels = new List<Voxel>();\n\n\t\tpublic static IEnumerable<Voxel> ActivePhysicsVoxels\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Voxel.Voxels.Where(x => x.Active && !x.Suspended && x.EnablePhysics && x.Scale.Value == 1.0f);\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<Voxel> ActiveVoxels\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Voxel.Voxels.Where(x => x.Active && !x.Suspended);\n\t\t\t}\n\t\t}\n\n\t\tpublic struct GlobalRaycastResult\n\t\t{\n\t\t\tpublic Voxel Voxel;\n\t\t\tpublic Voxel.Coord? Coordinate;\n\t\t\tpublic Vector3 Position;\n\t\t\tpublic Direction Normal;\n\t\t\tpublic float Distance;\n\t\t}\n\n\t\tpublic struct RaycastResult\n\t\t{\n\t\t\tpublic Voxel.Coord? Coordinate;\n\t\t\tpublic Vector3 Position;\n\t\t\tpublic Direction Normal;\n\t\t\tpublic float Distance;\n\t\t}\n\n\t\tpublic static GlobalRaycastResult GlobalRaycast(Vector3 start, Vector3 ray, float length, Func<int, t, bool> filter = null, bool includeScenery = false, bool includeInactive = false)\n\t\t{\n\t\t\t// Voxel raycasting\n\t\t\tGlobalRaycastResult result = new GlobalRaycastResult();\n\t\t\tresult.Distance = length;\n\t\t\tresult.Position = start + ray * length;\n\n\t\t\tIEnumerable<Voxel> maps = Voxel.Voxels.Where(x => x.Active);\n\n\t\t\tif (!includeInactive)\n\t\t\t\tmaps = maps.Where(x => !x.Suspended);\n\n\t\t\tif (!includeScenery)\n\t\t\t\tmaps = maps.Where(x => x.EnablePhysics);\n\n\t\t\tforeach (Voxel map in maps)\n\t\t\t{\n\t\t\t\tRaycastResult hit = map.Raycast(start, ray, result.Distance, filter);\n\t\t\t\tif (hit.Coordinate != null && hit.Distance < result.Distance)\n\t\t\t\t{\n\t\t\t\t\tresult.Voxel = map;\n\t\t\t\t\tresult.Coordinate = hit.Coordinate;\n\t\t\t\t\tresult.Normal = hit.Normal;\n\t\t\t\t\tresult.Position = hit.Position;\n\t\t\t\t\tresult.Distance = hit.Distance;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> Transform = new Property<Matrix> { Value = Matrix.Identity };\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> AngularVelocity = new Property<Vector3>();\n\n\t\tpublic class SerializedVoxelData\n\t\t{\n\t\t\tpublic string Value;\n\t\t}\n\n\t\tprivate static List<Box> boxCache = new List<Box>();\n\n\t\tprivate int[] serializedVoxelData;\n\t\tpublic SerializedVoxelData Data\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tList<int> result = new List<int>();\n\t\t\t\tlock (this.MutationLock)\n\t\t\t\t{\n\t\t\t\t\tif (main.EditorEnabled)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.boxCache.AddRange(this.Chunks.SelectMany(x => x.Boxes));\n\t\t\t\t\t\tbool[] modifications = this.simplify(Voxel.boxCache);\n\t\t\t\t\t\tthis.simplify(Voxel.boxCache, modifications);\n\t\t\t\t\t\tthis.applyChanges(Voxel.boxCache, modifications);\n\t\t\t\t\t\tthis.updateGraphics(this.Chunks);\n\t\t\t\t\t\tVoxel.boxCache.Clear();\n\t\t\t\t\t}\n\n\t\t\t\t\tVoxel.boxCache.AddRange(this.Chunks.SelectMany(x => x.Boxes));\n\n\t\t\t\t\tresult.Add(Voxel.boxCache.Count);\n\n\t\t\t\t\tDictionary<Box, int> indexLookup = new Dictionary<Box, int>();\n\n\t\t\t\t\tfor (int i = 0; i < Voxel.boxCache.Count; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox box = Voxel.boxCache[i];\n\t\t\t\t\t\tresult.Add(box.X);\n\t\t\t\t\t\tresult.Add(box.Y);\n\t\t\t\t\t\tresult.Add(box.Z);\n\t\t\t\t\t\tint packedData = 0;\n\t\t\t\t\t\tint ID = (int)box.Type.ID;\n\t\t\t\t\t\t/*Store the data in a packed integer*/\n\t\t\t\t\t\tpackedData = packedData.StoreByte((byte)box.Width);\n\t\t\t\t\t\tpackedData = packedData.StoreByte((byte)box.Height, 8);\n\t\t\t\t\t\tpackedData = packedData.StoreByte((byte)box.Depth, 16);\n\t\t\t\t\t\tpackedData = packedData.StoreByte((byte)ID, 24);\n\t\t\t\t\t\tresult.Add(packedData);\n\n\t\t\t\t\t\t//We need to use 11 bits to store each value.\n\t\t\t\t\t\t//So pack it all up nice and tidy. This will store them in 9 ints, as opposed to 24. Nice.\n\t\t\t\t\t\tresult.Add(box.Surfaces);\n\t\t\t\t\t\tindexLookup.Add(box, i);\n\t\t\t\t\t}\n\n\t\t\t\t\tList<int> indexData = new List<int>();\n\t\t\t\t\tfor (int i = 0; i < Voxel.boxCache.Count; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox box = Voxel.boxCache[i];\n\t\t\t\t\t\tif (box.Adjacent != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach (Box adjacent in box.Adjacent)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tBoxRelationship relationship1 = new BoxRelationship { A = box, B = adjacent };\n\t\t\t\t\t\t\t\t\tBoxRelationship relationship2 = new BoxRelationship { A = adjacent, B = box };\n\t\t\t\t\t\t\t\t\tif (!this.relationshipCache.ContainsKey(relationship1) && !this.relationshipCache.ContainsKey(relationship2))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tint adjacentIndex;\n\t\t\t\t\t\t\t\t\t\tif (indexLookup.TryGetValue(adjacent, out adjacentIndex))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tthis.relationshipCache[relationship1] = true;\n\t\t\t\t\t\t\t\t\t\t\tindexData.Add(i);\n\t\t\t\t\t\t\t\t\t\t\tindexData.Add(adjacentIndex);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.relationshipCache.Clear();\n\n\t\t\t\t\tBitWorker.PackInts(result, 17, indexData);\n\t\t\t\t\tVoxel.boxCache.Clear();\n\t\t\t\t}\n\t\t\t\treturn Voxel.serializeData(result);\n\t\t\t}\n\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (this.awoken)\n\t\t\t\t\tthis.processSerializedData(Voxel.deserializeData(value));\n\t\t\t\telse\n\t\t\t\t\tthis.serializedVoxelData = Voxel.deserializeData(value);\n\t\t\t}\n\t\t}\n\n\t\tprotected int minX;\n\t\tprotected int minY;\n\t\tprotected int minZ;\n\t\tprotected int maxX;\n\t\tprotected int maxY;\n\t\tprotected int maxZ;\n\n\t\t[XmlIgnore]\n\t\tpublic int MinX\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.minX;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic int MinY\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.minY;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic int MinZ\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.minZ;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic int MaxX\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.maxX;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic int MaxY\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.maxY;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic int MaxZ\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.maxZ;\n\t\t\t}\n\t\t}\n\n\t\tprotected int maxChunks;\n\t\tprotected int chunkHalfSize;\n\t\tprotected int chunkSize;\n\n\t\tpublic int ChunkSize\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.chunkSize;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic Command CompletelyEmptied = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic ListProperty<Chunk> Chunks = new ListProperty<Chunk>();\n\n\t\tprivate Chunk[, ,] chunks;\n\n\t\tprotected List<Box> additions = new List<Box>();\n\t\tprotected List<Box> removals = new List<Box>();\n\t\tprotected List<Coord> removalCoords = new List<Coord>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> Offset = new Property<Vector3>();\n\n\t\tpublic Property<bool> EnablePhysics = new Property<bool> { Value = true };\n\t\tpublic Property<bool> Mutable = new Property<bool> { Value = true };\n\n\t\t[DefaultValueAttribute(0)]\n\t\tpublic int OffsetX { get; set; }\n\t\t[DefaultValueAttribute(0)]\n\t\tpublic int OffsetY { get; set; }\n\t\t[DefaultValueAttribute(0)]\n\t\tpublic int OffsetZ { get; set; }\n\n\t\tpublic Property<float> Scale = new Property<float> { Value = 1.0f };\n\n\t\tpublic Property<float> UVRotation = new Property<float>();\n\t\tpublic Property<Vector2> UVOffset = new Property<Vector2>();\n\n\t\t[XmlIgnore]\n\t\tpublic Func<Vector3, Vector3, State, DynamicModel<Voxel.Vertex>> CreateModel;\n\n\t\tpublic Voxel()\n\t\t\t: this(0, 0, 0)\n\t\t{\n\n\t\t}\n\n\t\tpublic Voxel(int offsetX, int offsetY, int offsetZ)\n\t\t\t: this(20, 40)\n\t\t{\n\t\t\tthis.OffsetX = offsetX;\n\t\t\tthis.OffsetY = offsetY;\n\t\t\tthis.OffsetZ = offsetZ;\n\t\t}\n\n\t\tprotected Voxel(int maxChunks, int chunkHalfSize)\n\t\t{\n\t\t\tthis.chunkHalfSize = chunkHalfSize;\n\t\t\tthis.chunkSize = chunkHalfSize * 2;\n\t\t\tthis.maxChunks = maxChunks;\n\t\t\tthis.chunks = Voxel.chunkHeap.Get(maxChunks);\n\t\t}\n\n\t\tpublic virtual void updatePhysics()\n\t\t{\n\t\t}\n\n\t\tprivate void updateBounds()\n\t\t{\n\t\t\tint min = (-this.chunkHalfSize * this.maxChunks) - this.chunkHalfSize;\n\t\t\tint max = (this.chunkHalfSize * this.maxChunks) - this.chunkHalfSize;\n\t\t\tthis.minX = this.OffsetX + min;\n\t\t\tthis.minY = this.OffsetY + min;\n\t\t\tthis.minZ = this.OffsetZ + min;\n\t\t\tthis.maxX = this.OffsetX + max;\n\t\t\tthis.maxY = this.OffsetY + max;\n\t\t\tthis.maxZ = this.OffsetZ + max;\n\t\t}\n\n\t\tprivate struct BoxRelationship\n\t\t{\n\t\t\tpublic Box A;\n\t\t\tpublic Box B;\n\t\t}\n\n\t\tprivate static Updater spawner;\n\t\tprivate class SpawnGroup\n\t\t{\n\t\t\tpublic List<List<Box>> Islands;\n\t\t\tpublic Voxel Source;\n\t\t\tpublic Action<List<DynamicVoxel>> Callback;\n\t\t}\n\t\tprivate static List<SpawnGroup> spawns = new List<SpawnGroup>();\n\n\t\tprotected virtual void transformBinding()\n\t\t{\n\t\t\tif (this.EnablePhysics && !this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tthis.Add(new ChangeBinding<Matrix>(this.Transform, delegate(Matrix old, Matrix value)\n\t\t\t\t{\n\t\t\t\t\tBEPUutilities.AffineTransform t = new BEPUutilities.AffineTransform(BEPUutilities.Matrix3x3.CreateFromMatrix(value), value.Translation);\n\t\t\t\t\tfor (int i = 0; i < this.Chunks.Count; i++)\n\t\t\t\t\t\tthis.Chunks[i].UpdateTransform(t);\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\n\t\tprivate bool awoken = false;\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.transformBinding();\n\t\t\tthis.updateBounds();\n\n\t\t\tif (Voxel.workThread == null)\n\t\t\t{\n\t\t\t\tVoxel.workThread = new Thread(new ThreadStart(Voxel.worker));\n\t\t\t\tVoxel.workThread.IsBackground = true;\n\t\t\t\tVoxel.workThread.Start();\n\t\t\t\tMain m = this.main;\n\t\t\t\tVoxel.spawner = new Updater\n\t\t\t\t(\n\t\t\t\t\tdelegate(float dt)\n\t\t\t\t\t{\n\t\t\t\t\t\tDynamicVoxelFactory factory = Factory.Get<DynamicVoxelFactory>();\n\t\t\t\t\t\tBlockFactory blockFactory = Factory.Get<BlockFactory>();\n\t\t\t\t\t\tList<SpawnGroup> spawns = new List<SpawnGroup>();\n\t\t\t\t\t\tlock (Voxel.spawns)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tspawns.AddRange(Voxel.spawns);\n\t\t\t\t\t\t\tVoxel.spawns.Clear();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (int i = 0; i < spawns.Count; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSpawnGroup spawn = spawns[i];\n\t\t\t\t\t\t\tList<DynamicVoxel> spawnedMaps = new List<DynamicVoxel>();\n\t\t\t\t\t\t\tfor (int j = 0; j < spawn.Islands.Count; j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tList<Box> island = spawn.Islands[j];\n\t\t\t\t\t\t\t\tBox firstBox = island.First();\n\t\t\t\t\t\t\t\tif (island.Count == 1 && firstBox.Width * firstBox.Height * firstBox.Depth == 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Just create a temporary physics block instead of a full-blown map\n\t\t\t\t\t\t\t\t\tCoord coord = new Coord { X = firstBox.X, Y = firstBox.Y, Z = firstBox.Z };\n\t\t\t\t\t\t\t\t\tComponentBind.Entity block = blockFactory.CreateAndBind(main);\n\t\t\t\t\t\t\t\t\tblock.Get<Transform>().Matrix.Value = this.Transform;\n\t\t\t\t\t\t\t\t\tblock.Get<Transform>().Position.Value = this.GetAbsolutePosition(coord);\n\t\t\t\t\t\t\t\t\tfirstBox.Type.ApplyToBlock(block);\n\t\t\t\t\t\t\t\t\tblock.Get<ModelInstance>().Param.Value = this.GetRelativePosition(coord);\n\t\t\t\t\t\t\t\t\tmain.Add(block);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tComponentBind.Entity newMap = factory.CreateAndBind(spawn.Source.main, firstBox.X, firstBox.Y, firstBox.Z);\n\t\t\t\t\t\t\t\t\tnewMap.Get<Transform>().Matrix.Value = spawn.Source.Transform;\n\t\t\t\t\t\t\t\t\tDynamicVoxel newMapComponent = newMap.Get<DynamicVoxel>();\n\t\t\t\t\t\t\t\t\tnewMapComponent.Offset.Value = spawn.Source.Offset;\n\t\t\t\t\t\t\t\t\tnewMapComponent.BuildFromBoxes(island);\n\t\t\t\t\t\t\t\t\tnewMapComponent.UpdatePhysicsImmediately();\n\t\t\t\t\t\t\t\t\tnewMapComponent.Transform.Value = newMapComponent.PhysicsEntity.WorldTransform;\n\t\t\t\t\t\t\t\t\tif (spawn.Source is DynamicVoxel)\n\t\t\t\t\t\t\t\t\t\tnewMapComponent.IsAffectedByGravity.Value = ((DynamicVoxel)spawn.Source).IsAffectedByGravity;\n\t\t\t\t\t\t\t\t\tspawn.Source.notifyEmptied(island.SelectMany(x => x.GetCoords()), newMapComponent);\n\t\t\t\t\t\t\t\t\tspawn.Source.main.Add(newMap);\n\t\t\t\t\t\t\t\t\tspawnedMaps.Add(newMapComponent);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (spawn.Callback != null)\n\t\t\t\t\t\t\t\tspawn.Callback(spawnedMaps);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tspawns.Clear();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tVoxel.spawner.EnabledInEditMode = true;\n\t\t\t\tVoxel.spawner.EnabledWhenPaused = true;\n\t\t\t\tthis.main.AddComponent(Voxel.spawner);\n\t\t\t}\n\n\t\t\tVoxel.Voxels.Add(this);\n\n\t\t\tif (this.serializedVoxelData != null)\n\t\t\t{\n\t\t\t\tint[] data = this.serializedVoxelData;\n\t\t\t\tthis.serializedVoxelData = null;\n\t\t\t\tthis.processSerializedData(data);\n\t\t\t}\n\n\t\t\tthis.awoken = true;\n\t\t}\n\n\t\tprivate void processSerializedData(int[] data)\n\t\t{\n\t\t\tint boxCount = data[0];\n\n\t\t\tbool rebuildAdjacency = false;\n\t\t\tconst int boxDataSize = 5;\n\n\t\t\tfor (int i = 0; i < boxCount; i++)\n\t\t\t{\n\t\t\t\t// Format:\n\t\t\t\t// x\n\t\t\t\t// y\n\t\t\t\t// z\n\t\t\t\t// width-height-depth-type, packed in one int\n\t\t\t\t// one bool for each of six surfaces, packed in one int\n\t\t\t\tint index = 1 + (i * boxDataSize);\n\t\t\t\tint packedData = data[index + 3];\n\t\t\t\tint v = packedData.ExtractBits(24, 8);\n\t\t\t\tif (v != 0)\n\t\t\t\t{\n\t\t\t\t\tint x = data[index], y = data[index + 1], z = data[index + 2];\n\t\t\t\t\tint w = packedData.ExtractBits(0, 8), h = packedData.ExtractBits(8, 8), d = packedData.ExtractBits(16, 8);\n\t\t\t\t\tint surfaces = data[index + 4];\n\t\t\t\t\tState state = Voxel.States.All[(t)v];\n\t\t\t\t\tint chunkX = this.minX + ((x - this.minX) / this.chunkSize) * this.chunkSize, chunkY = this.minY + ((y - this.minY) / this.chunkSize) * this.chunkSize, chunkZ = this.minZ + ((z - this.minZ) / this.chunkSize) * this.chunkSize;\n\t\t\t\t\tint nextChunkX = this.minX + ((x + w - this.minX - 1) / this.chunkSize) * this.chunkSize, nextChunkY = this.minY + ((y + h - this.minY - 1) / this.chunkSize) * this.chunkSize, nextChunkZ = this.minZ + ((z + d - this.minZ - 1) / this.chunkSize) * this.chunkSize;\n\t\t\t\t\trebuildAdjacency |= chunkX != nextChunkX || chunkY != nextChunkY || chunkZ != nextChunkZ;\n\t\t\t\t\tfor (int ix = chunkX; ix <= nextChunkX; ix += this.chunkSize)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int iy = chunkY; iy <= nextChunkY; iy += this.chunkSize)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int iz = chunkZ; iz <= nextChunkZ; iz += this.chunkSize)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tint bx = Math.Max(ix, x), by = Math.Max(iy, y), bz = Math.Max(iz, z);\n\t\t\t\t\t\t\t\tBox box = new Box\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tX = bx,\n\t\t\t\t\t\t\t\t\tY = by,\n\t\t\t\t\t\t\t\t\tZ = bz,\n\t\t\t\t\t\t\t\t\tWidth = Math.Min(bx + w, ix + this.chunkSize) - bx,\n\t\t\t\t\t\t\t\t\tHeight = Math.Min(by + h, iy + this.chunkSize) - by,\n\t\t\t\t\t\t\t\t\tDepth = Math.Min(bz + d, iz + this.chunkSize) - bz,\n\t\t\t\t\t\t\t\t\tType = state,\n\t\t\t\t\t\t\t\t\tActive = true,\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tif (box.Width > 0 && box.Height > 0 && box.Depth > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tChunk chunk = this.GetChunk(bx, by, bz);\n\t\t\t\t\t\t\t\t\tVoxel.boxCache.Add(box);\n\t\t\t\t\t\t\t\t\tif (chunk.DataBoxes == null)\n\t\t\t\t\t\t\t\t\t\tchunk.DataBoxes = new List<Box>();\n\t\t\t\t\t\t\t\t\tchunk.DataBoxes.Add(box);\n\t\t\t\t\t\t\t\t\tbox.Chunk = chunk;\n\t\t\t\t\t\t\t\t\tbox.Surfaces = (byte)surfaces;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint packedBoxesStart = 1 + boxCount * boxDataSize;\n\t\t\tint[] packedBoxes = new int[data.Length - packedBoxesStart];\n\t\t\tfor (int i = packedBoxesStart; i < data.Length; i++)\n\t\t\t\tpackedBoxes[i - packedBoxesStart] = data[i];\n\n\t\t\tint[] unPackedBoxes = BitWorker.UnPackInts(17, -1, packedBoxes);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (rebuildAdjacency)\n\t\t\t\t\tthrow new Exception();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < unPackedBoxes.Length- 1; i += 2)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox box1 = Voxel.boxCache[unPackedBoxes[i]], box2 = Voxel.boxCache[unPackedBoxes[i + 1]];\n\t\t\t\t\t\tif (box1 != null && box2 != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox1.Adjacent.Add(box2);\n\t\t\t\t\t\t\tbox2.Adjacent.Add(box1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tVoxel.boxCache.Clear();\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\tLog.d(\"Error reading adjacency data. Rebuilding adjacency...\");\n\t\t\t\tVoxel.boxCache.Clear();\n\t\t\t\tthis.RebuildAdjacency();\n\t\t\t}\n\n\n\t\t\tthis.postDeserialization();\n\t\t}\n\n\t\tpublic IEnumerable<Chunk> GetChunksBetween(Voxel.Coord a, Voxel.Coord b)\n\t\t{\n\t\t\ta.X = Math.Max(this.minX, a.X);\n\t\t\tb.X = Math.Min(this.maxX - 1, b.X);\n\t\t\ta.Y = Math.Max(this.minY, a.Y);\n\t\t\tb.Y = Math.Min(this.maxY - 1, b.Y);\t\n\t\t\ta.Z = Math.Max(this.minX, a.Z);\n\t\t\tb.Z = Math.Min(this.maxX - 1, b.Z);\n\t\t\tif (b.X > a.X && b.Y > a.Y && b.Z > a.Z)\n\t\t\t{\n\t\t\t\tint chunkX = ((a.X - this.minX) / this.chunkSize), chunkY = ((a.Y - this.minY) / this.chunkSize), chunkZ = ((a.Z - this.minZ) / this.chunkSize);\n\t\t\t\tint nextChunkX = ((b.X - this.minX) / this.chunkSize), nextChunkY = ((b.Y - this.minY) / this.chunkSize), nextChunkZ = ((b.Z - this.minZ) / this.chunkSize);\n\t\t\t\tint numChunks = this.chunks.GetLength(0); // Same number of chunks in each dimension\n\t\t\t\tfor (int ix = chunkX; ix <= nextChunkX; ix++)\n\t\t\t\t{\n\t\t\t\t\tfor (int iy = chunkY; iy <= nextChunkY; iy++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int iz = chunkZ; iz <= nextChunkZ; iz++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tChunk chunk = this.chunks[ix, iy, iz];\n\t\t\t\t\t\t\tif (chunk != null)\n\t\t\t\t\t\t\t\tyield return chunk;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected virtual void postDeserialization()\n\t\t{\n\t\t\tfor (int i = 0; i < this.Chunks.Count; i++)\n\t\t\t\tthis.Chunks[i].Instantiate();\n\t\t\tthis.updatePhysics();\n\t\t}\n\n\t\tprotected static SerializedVoxelData serializeData(List<int> data)\n\t\t{\n\t\t\tbyte[] result = new byte[data.Count * 4];\n\t\t\tfor (int i = 0; i < data.Count; i++)\n\t\t\t{\n\t\t\t\tint value = data[i];\n\t\t\t\tint j = i * 4;\n\t\t\t\tresult[j] = (byte)(value >> 24);\n\t\t\t\tresult[j + 1] = (byte)(value >> 16);\n\t\t\t\tresult[j + 2] = (byte)(value >> 8);\n\t\t\t\tresult[j + 3] = (byte)value;\n\t\t\t}\n\t\t\treturn new SerializedVoxelData { Value = System.Convert.ToBase64String(result) };\n\t\t}\n\n\t\tprotected static int[] deserializeData(SerializedVoxelData data)\n\t\t{\n\t\t\tbyte[] temp = System.Convert.FromBase64String(data.Value);\n\t\t\tint[] result = new int[temp.Length / 4];\n\t\t\tfor (int i = 0; i < result.Length; i++)\n\t\t\t{\n\t\t\t\tint j = i * 4;\n\t\t\t\tresult[i] = (temp[j] << 24)\n\t\t\t\t\t| (temp[j + 1] << 16)\n\t\t\t\t\t| (temp[j + 2] << 8)\n\t\t\t\t\t| temp[j + 3];\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Direction GetRelativeDirection(Direction dir)\n\t\t{\n\t\t\treturn this.GetRelativeDirection(dir.GetVector());\n\t\t}\n\n\t\tpublic Direction GetRelativeDirection(Vector3 vector)\n\t\t{\n\t\t\treturn DirectionExtensions.GetDirectionFromVector(this.GetRelativeVector(vector));\n\t\t}\n\n\t\tpublic Direction GetAbsoluteDirection(Direction dir)\n\t\t{\n\t\t\treturn DirectionExtensions.GetDirectionFromVector(this.GetAbsoluteVector(dir.GetVector()));\n\t\t}\n\n\t\tpublic Vector3 GetRelativeVector(Vector3 vector)\n\t\t{\n\t\t\treturn Vector3.TransformNormal(vector, Matrix.Invert(this.Transform));\n\t\t}\n\n\t\tpublic Vector3 GetAbsoluteVector(Vector3 vector)\n\t\t{\n\t\t\treturn Vector3.TransformNormal(vector, this.Transform);\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tlock (this.MutationLock)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Chunks.Count; i++)\n\t\t\t\t\tthis.Chunks[i].Delete();\n\t\t\t\tthis.Chunks.Clear();\n\n\t\t\t\tfor (int i = 0; i < this.maxChunks; i++)\n\t\t\t\t{\n\t\t\t\t\tfor (int j = 0; j < this.maxChunks; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int k = 0; k < this.maxChunks; k++)\n\t\t\t\t\t\t\tthis.chunks[i, j, k] = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.chunks = null;\n\t\t\t\tthis.CreateModel = null;\n\t\t\t}\n\t\t\tVoxel.Voxels.Remove(this);\n\t\t}\n\n\t\tpublic Chunk GetChunk(Coord coord, bool createIfNonExistent = true)\n\t\t{\n\t\t\treturn this.GetChunk(coord.X, coord.Y, coord.Z, createIfNonExistent);\n\t\t}\n\n\t\tpublic Chunk GetChunk(int x, int y, int z, bool createIfNonExistent = true)\n\t\t{\n\t\t\tif (this.chunks == null)\n\t\t\t\treturn null;\n\t\t\twhile (x < this.minX || x >= this.maxX || y < this.minY || y >= this.maxY || z < this.minZ || z >= this.maxZ)\n\t\t\t{\n\t\t\t\tif (createIfNonExistent)\n\t\t\t\t{\n\t\t\t\t\tint originalChunkArraySize = this.maxChunks;\n\t\t\t\t\tint oldMin = this.maxChunks / -2, oldMax = this.maxChunks / 2;\n\t\t\t\t\tthis.maxChunks *= 2;\n\t\t\t\t\tint newMin = this.maxChunks / -2;\n\n\t\t\t\t\tChunk[, ,] newChunks = Voxel.chunkHeap.Get(this.maxChunks);\n\n\t\t\t\t\tfor (int i = oldMin; i < oldMax; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int j = oldMin; j < oldMax; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int k = oldMin; k < oldMax; k++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tint i2 = i - oldMin, j2 = j - oldMin, k2 = k - oldMin;\n\t\t\t\t\t\t\t\tnewChunks[i - newMin, j - newMin, k - newMin] = this.chunks[i2, j2, k2];\n\t\t\t\t\t\t\t\tthis.chunks[i2, j2, k2] = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tVoxel.chunkHeap.Free(originalChunkArraySize, this.chunks);\n\n\t\t\t\t\tthis.chunks = newChunks;\n\t\t\t\t\tthis.updateBounds();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tint ix = (x - this.minX) / this.chunkSize, iy = (y - this.minY) / this.chunkSize, iz = (z - this.minZ) / this.chunkSize;\n\t\t\tChunk chunk = this.chunks[ix, iy, iz];\n\t\t\tif (createIfNonExistent && chunk == null)\n\t\t\t{\n\t\t\t\tchunk = this.newChunk();\n\t\t\t\tchunk.Voxel = this;\n\t\t\t\tchunk.X = this.minX + (ix * this.chunkSize);\n\t\t\t\tchunk.Y = this.minY + (iy * this.chunkSize);\n\t\t\t\tchunk.Z = this.minZ + (iz * this.chunkSize);\n\t\t\t\tchunk.IndexX = ix;\n\t\t\t\tchunk.IndexY = iy;\n\t\t\t\tchunk.IndexZ = iz;\n\t\t\t\tchunk.RelativeBoundingBox = new BoundingBox(new Vector3(chunk.X, chunk.Y, chunk.Z), new Vector3(chunk.X + this.chunkSize, chunk.Y + this.chunkSize, chunk.Z + this.chunkSize));\n\t\t\t\tthis.chunks[ix, iy, iz] = chunk;\n\t\t\t\tthis.Chunks.Add(chunk);\n\t\t\t}\n\t\t\treturn chunk;\n\t\t}\n\n\t\tprotected virtual Chunk newChunk()\n\t\t{\n\t\t\tChunk chunk = new Chunk(this.chunkSize) { EnablePhysics = !this.main.EditorEnabled && this.EnablePhysics };\n\t\t\tchunk.Voxel = this;\n\t\t\treturn chunk;\n\t\t}\n\n\t\tpublic bool Contains(Coord coord)\n\t\t{\n\t\t\treturn coord.X >= this.minX && coord.X < this.maxX\n\t\t\t\t&& coord.Y >= this.minY && coord.Y < this.maxY\n\t\t\t\t&& coord.Z >= this.minZ && coord.Z < this.maxZ;\n\t\t}\n\n\t\tpublic bool Fill(Vector3 pos, State state, bool notify = true)\n\t\t{\n\t\t\treturn this.Fill(this.GetCoordinate(pos), state, notify);\n\t\t}\n\n\t\tpublic bool Fill(Coord start, Coord end, State state, bool notify = true)\n\t\t{\n\t\t\tbool changed = false;\n\t\t\tfor (int x = start.X; x < end.X; x++)\n\t\t\t{\n\t\t\t\tfor (int y = start.Y; y < end.Y; y++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = start.Z; z < end.Z; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tchanged |= this.Fill(x, y, z, state, notify);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn changed;\n\t\t}\n\n\t\tpublic bool Fill(Coord coord, State state, bool notify = true, Voxel transferredFromMap = null)\n\t\t{\n\t\t\treturn this.Fill(coord.X, coord.Y, coord.Z, state, notify, transferredFromMap);\n\t\t}\n\n\t\tpublic bool Empty(Vector3 pos, bool force = false, bool forceHard = true, Voxel transferringToNewMap = null, bool notify = true)\n\t\t{\n\t\t\treturn this.Empty(this.GetCoordinate(pos), force, forceHard, transferringToNewMap, notify);\n\t\t}\n\n\t\tpublic bool Empty(Coord coord, bool force = false, bool forceHard = true, Voxel transferringToNewMap = null, bool notify = true)\n\t\t{\n\t\t\treturn this.Empty(coord.X, coord.Y, coord.Z, force, forceHard, transferringToNewMap, notify);\n\t\t}\n\n\t\tpublic bool Empty(Coord a, Coord b, bool force = false, bool forceHard = true, Voxel transferringToNewMap = null, bool notify = true)\n\t\t{\n\t\t\tint minY = Math.Min(a.Y, b.Y);\n\t\t\tint minZ = Math.Min(a.Z, b.Z);\n\t\t\tint maxX = Math.Max(a.X, b.X);\n\t\t\tint maxY = Math.Max(a.Y, b.Y);\n\t\t\tint maxZ = Math.Max(a.Z, b.Z);\n\t\t\tList<Voxel.Coord> coords = new List<Coord>();\n\t\t\tfor (int x = Math.Min(a.X, b.X); x < maxX; x++)\n\t\t\t{\n\t\t\t\tfor (int y = minY; y < maxY; y++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = minZ; z < maxZ; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcoords.Add(new Voxel.Coord { X = x, Y = y, Z = z });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.Empty(coords, force, forceHard, transferringToNewMap, notify);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Fills the specified location. This change will not take effect until Generate() or Regenerate() is called.\n\t\t/// </summary>\n\t\t/// <param name=\"x\"></param>\n\t\t/// <param name=\"y\"></param>\n\t\t/// <param name=\"z\"></param>\n\t\tpublic bool Fill(int x, int y, int z, State state, bool notify = true, Voxel transferredFromMap = null)\n\t\t{\n\t\t\tif (state == Voxel.States.Empty || (!this.main.EditorEnabled && !this.Mutable))\n\t\t\t\treturn false;\n\n\t\t\tbool filled = false;\n\t\t\tlock (this.MutationLock)\n\t\t\t{\n\t\t\t\tChunk chunk = this.GetChunk(x, y, z);\n\t\t\t\tif (chunk != null)\n\t\t\t\t{\n\t\t\t\t\tif (chunk[x - chunk.X, y - chunk.Y, z - chunk.Z] == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.addBox(new Box { Type = state, X = x, Y = y, Z = z, Depth = 1, Height = 1, Width = 1 });\n\t\t\t\t\t\tfilled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (filled && notify)\n\t\t\t\tthis.notifyFilled(new Coord[] { new Coord { X = x, Y = y, Z = z, Data = state } }, transferredFromMap);\n\t\t\treturn filled;\n\t\t}\n\n\t\tpublic void Fill(IEnumerable<Coord> coords, bool notify = true, Voxel transferredFromMap = null)\n\t\t{\n\t\t\tif (!this.main.EditorEnabled && !this.Mutable)\n\t\t\t\treturn;\n\n\t\t\tList<Coord> notifyList = null;\n\t\t\tif (notify)\n\t\t\t\tnotifyList = new List<Coord>();\n\t\t\tlock (this.MutationLock)\n\t\t\t{\n\t\t\t\tforeach (Voxel.Coord c in coords)\n\t\t\t\t{\n\t\t\t\t\tint x = c.X, y = c.Y, z = c.Z;\n\t\t\t\t\tChunk chunk = this.GetChunk(x, y, z);\n\t\t\t\t\tif (chunk != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (chunk[x - chunk.X, y - chunk.Y, z - chunk.Z] == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.addBox(new Box { Type = c.Data, X = x, Y = y, Z = z, Depth = 1, Height = 1, Width = 1 });\n\t\t\t\t\t\t\tnotifyList.Add(c);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (notify)\n\t\t\t\tthis.notifyFilled(notifyList, transferredFromMap);\n\t\t\treturn;\n\t\t}\n\n\t\tprivate void notifyFilled(IEnumerable<Coord> coords, Voxel transferredFromMap)\n\t\t{\n\t\t\tthis.CellsFilled.Execute(coords, transferredFromMap);\n\t\t\tVoxel.GlobalCellsFilled.Execute(this, coords, transferredFromMap);\n\t\t}\n\n\t\tprivate void notifyEmptied(IEnumerable<Coord> coords, Voxel transferringToNewMap)\n\t\t{\n\t\t\tthis.CellsEmptied.Execute(coords, transferringToNewMap);\n\t\t\tVoxel.GlobalCellsEmptied.Execute(this, coords, transferringToNewMap);\n\n\t\t\tbool completelyEmptied = true;\n\t\t\tlock (this.MutationLock)\n\t\t\t{\n\t\t\t\tif (this.additions.FirstOrDefault(x => x.Active) != null)\n\t\t\t\t\tcompletelyEmptied = false;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < this.Chunks.Count; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tChunk chunk = this.Chunks[i];\n\t\t\t\t\t\tforeach (Box box in chunk.Boxes)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (box.Active)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcompletelyEmptied = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!completelyEmptied)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (completelyEmptied)\n\t\t\t\tthis.CompletelyEmptied.Execute();\n\t\t}\n\n\t\tpublic bool Empty(IEnumerable<Coord> coords, bool force = false, bool forceHard = true, Voxel transferringToNewMap = null, bool notify = true)\n\t\t{\n\t\t\tif (!this.main.EditorEnabled && !this.Mutable)\n\t\t\t\treturn false;\n\n\t\t\tbool modified = false;\n\t\t\tList<Box> boxAdditions = new List<Box>();\n\t\t\tList<Coord> removed = new List<Coord>();\n\t\t\tlock (this.MutationLock)\n\t\t\t{\n\t\t\t\tforeach (Voxel.Coord coord in coords)\n\t\t\t\t{\n\t\t\t\t\tChunk chunk = this.GetChunk(coord.X, coord.Y, coord.Z, false);\n\n\t\t\t\t\tif (chunk == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tBox box = chunk[coord.X - chunk.X, coord.Y - chunk.Y, coord.Z - chunk.Z];\n\t\t\t\t\tif (box != null && (force || !box.Type.Permanent) && (forceHard || !box.Type.Hard))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.removalCoords.Add(coord);\n\t\t\t\t\t\tif (box != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.removeBox(box);\n\n\t\t\t\t\t\t\t// Left\n\t\t\t\t\t\t\tif (coord.X > box.X)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tX = box.X,\n\t\t\t\t\t\t\t\t\tY = box.Y,\n\t\t\t\t\t\t\t\t\tZ = box.Z,\n\t\t\t\t\t\t\t\t\tWidth = coord.X - box.X,\n\t\t\t\t\t\t\t\t\tHeight = box.Height,\n\t\t\t\t\t\t\t\t\tDepth = box.Depth,\n\t\t\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Right\n\t\t\t\t\t\t\tif (box.X + box.Width > coord.X + 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tX = coord.X + 1,\n\t\t\t\t\t\t\t\t\tY = box.Y,\n\t\t\t\t\t\t\t\t\tZ = box.Z,\n\t\t\t\t\t\t\t\t\tWidth = box.X + box.Width - (coord.X + 1),\n\t\t\t\t\t\t\t\t\tHeight = box.Height,\n\t\t\t\t\t\t\t\t\tDepth = box.Depth,\n\t\t\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Bottom\n\t\t\t\t\t\t\tif (coord.Y > box.Y)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tX = coord.X,\n\t\t\t\t\t\t\t\t\tY = box.Y,\n\t\t\t\t\t\t\t\t\tZ = box.Z,\n\t\t\t\t\t\t\t\t\tWidth = 1,\n\t\t\t\t\t\t\t\t\tHeight = coord.Y - box.Y,\n\t\t\t\t\t\t\t\t\tDepth = box.Depth,\n\t\t\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Top\n\t\t\t\t\t\t\tif (box.Y + box.Height > coord.Y + 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tX = coord.X,\n\t\t\t\t\t\t\t\t\tY = coord.Y + 1,\n\t\t\t\t\t\t\t\t\tZ = box.Z,\n\t\t\t\t\t\t\t\t\tWidth = 1,\n\t\t\t\t\t\t\t\t\tHeight = box.Y + box.Height - (coord.Y + 1),\n\t\t\t\t\t\t\t\t\tDepth = box.Depth,\n\t\t\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Back\n\t\t\t\t\t\t\tif (coord.Z > box.Z)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tX = coord.X,\n\t\t\t\t\t\t\t\t\tY = coord.Y,\n\t\t\t\t\t\t\t\t\tZ = box.Z,\n\t\t\t\t\t\t\t\t\tWidth = 1,\n\t\t\t\t\t\t\t\t\tHeight = 1,\n\t\t\t\t\t\t\t\t\tDepth = coord.Z - box.Z,\n\t\t\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Front\n\t\t\t\t\t\t\tif (box.Z + box.Depth > coord.Z + 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tX = coord.X,\n\t\t\t\t\t\t\t\t\tY = coord.Y,\n\t\t\t\t\t\t\t\t\tZ = coord.Z + 1,\n\t\t\t\t\t\t\t\t\tWidth = 1,\n\t\t\t\t\t\t\t\t\tHeight = 1,\n\t\t\t\t\t\t\t\t\tDepth = box.Z + box.Depth - (coord.Z + 1),\n\t\t\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tremoved.Add(new Voxel.Coord { X = coord.X, Y = coord.Y, Z = coord.Z, Data = box.Type });\n\t\t\t\t\t\t\tmodified = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.calculateAdjacency(boxAdditions.Where(x => x.Active));\n\t\t\t}\n\n\t\t\tif (modified && notify)\n\t\t\t\tthis.notifyEmptied(removed, transferringToNewMap);\n\n\t\t\treturn modified;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// If the specified location is currently filled, it is emptied.\n\t\t/// This change will not take effect until Generate() or Regenerate() is called.\n\t\t/// </summary>\n\t\t/// <param name=\"x\"></param>\n\t\t/// <param name=\"y\"></param>\n\t\t/// <param name=\"z\"></param>\n\t\tpublic bool Empty(int x, int y, int z, bool force = false, bool forceHard = true, Voxel transferringToNewMap = null, bool notify = true)\n\t\t{\n\t\t\tif (!this.main.EditorEnabled && !this.Mutable)\n\t\t\t\treturn false;\n\n\t\t\tbool modified = false;\n\t\t\tVoxel.Coord coord = new Coord { X = x, Y = y, Z = z, };\n\t\t\tlock (this.MutationLock)\n\t\t\t{\n\t\t\t\tChunk chunk = this.GetChunk(x, y, z, false);\n\n\t\t\t\tif (chunk == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tBox box = chunk[x - chunk.X, y - chunk.Y, z - chunk.Z];\n\t\t\t\tif (box != null && (force || !box.Type.Permanent) && (forceHard || !box.Type.Hard))\n\t\t\t\t{\n\t\t\t\t\tList<Box> boxAdditions = new List<Box>();\n\t\t\t\t\tcoord.Data = box.Type;\n\t\t\t\t\tthis.removalCoords.Add(coord);\n\t\t\t\t\tthis.removeBox(box);\n\n\t\t\t\t\t// Left\n\t\t\t\t\tif (coord.X > box.X)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tX = box.X,\n\t\t\t\t\t\t\tY = box.Y,\n\t\t\t\t\t\t\tZ = box.Z,\n\t\t\t\t\t\t\tWidth = coord.X - box.X,\n\t\t\t\t\t\t\tHeight = box.Height,\n\t\t\t\t\t\t\tDepth = box.Depth,\n\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Right\n\t\t\t\t\tif (box.X + box.Width > coord.X + 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tX = coord.X + 1,\n\t\t\t\t\t\t\tY = box.Y,\n\t\t\t\t\t\t\tZ = box.Z,\n\t\t\t\t\t\t\tWidth = box.X + box.Width - (coord.X + 1),\n\t\t\t\t\t\t\tHeight = box.Height,\n\t\t\t\t\t\t\tDepth = box.Depth,\n\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Bottom\n\t\t\t\t\tif (coord.Y > box.Y)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tX = coord.X,\n\t\t\t\t\t\t\tY = box.Y,\n\t\t\t\t\t\t\tZ = box.Z,\n\t\t\t\t\t\t\tWidth = 1,\n\t\t\t\t\t\t\tHeight = coord.Y - box.Y,\n\t\t\t\t\t\t\tDepth = box.Depth,\n\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Top\n\t\t\t\t\tif (box.Y + box.Height > coord.Y + 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tX = coord.X,\n\t\t\t\t\t\t\tY = coord.Y + 1,\n\t\t\t\t\t\t\tZ = box.Z,\n\t\t\t\t\t\t\tWidth = 1,\n\t\t\t\t\t\t\tHeight = box.Y + box.Height - (coord.Y + 1),\n\t\t\t\t\t\t\tDepth = box.Depth,\n\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Back\n\t\t\t\t\tif (coord.Z > box.Z)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tX = coord.X,\n\t\t\t\t\t\t\tY = coord.Y,\n\t\t\t\t\t\t\tZ = box.Z,\n\t\t\t\t\t\t\tWidth = 1,\n\t\t\t\t\t\t\tHeight = 1,\n\t\t\t\t\t\t\tDepth = coord.Z - box.Z,\n\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Front\n\t\t\t\t\tif (box.Z + box.Depth > coord.Z + 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox newBox = new Box\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tX = coord.X,\n\t\t\t\t\t\t\tY = coord.Y,\n\t\t\t\t\t\t\tZ = coord.Z + 1,\n\t\t\t\t\t\t\tWidth = 1,\n\t\t\t\t\t\t\tHeight = 1,\n\t\t\t\t\t\t\tDepth = box.Z + box.Depth - (coord.Z + 1),\n\t\t\t\t\t\t\tType = box.Type,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.addBoxWithoutAdjacency(newBox);\n\t\t\t\t\t\tboxAdditions.Add(newBox);\n\t\t\t\t\t}\n\t\t\t\t\tmodified = true;\n\t\t\t\t\tthis.calculateAdjacency(boxAdditions.Where(a => a.Active));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (modified && notify)\n\t\t\t\tthis.notifyEmptied(new Coord[] { coord }, transferringToNewMap);\n\n\t\t\treturn modified;\n\t\t}\n\n\t\tprotected void addBoxWithoutAdjacency(Box box)\n\t\t{\n\t\t\tChunk chunk = this.GetChunk(box.X, box.Y, box.Z);\n\t\t\tif (chunk != null)\n\t\t\t{\n\t\t\t\tchunk.MarkDirty(box);\n\n\t\t\t\tbox.Chunk = chunk;\n\n\t\t\t\tfor (int x = box.X - chunk.X; x < box.X + box.Width - chunk.X; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = box.Y - chunk.Y; y < box.Y + box.Height - chunk.Y; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int z = box.Z - chunk.Z; z < box.Z + box.Depth - chunk.Z; z++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchunk[x, y, z] = box;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate Dictionary<Box, bool> adjacentCache = new Dictionary<Box, bool>();\n\t\tprotected void addBox(Box box)\n\t\t{\n\t\t\tthis.addBoxWithoutAdjacency(box);\n\n\t\t\tthis.additions.Add(box);\n\n\t\t\t// Front face\n\t\t\tfor (int x = box.X; x < box.X + box.Width; x++)\n\t\t\t{\n\t\t\t\tfor (int y = box.Y; y < box.Y + box.Height; )\n\t\t\t\t{\n\t\t\t\t\tBox adjacent = this.GetBox(x, y, box.Z + box.Depth);\n\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!this.adjacentCache.ContainsKey(adjacent))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.adjacentCache[adjacent] = true;\n\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ty = adjacent.Y + adjacent.Height;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ty++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Back face\n\t\t\tfor (int x = box.X; x < box.X + box.Width; x++)\n\t\t\t{\n\t\t\t\tfor (int y = box.Y; y < box.Y + box.Height; )\n\t\t\t\t{\n\t\t\t\t\tBox adjacent = this.GetBox(x, y, box.Z - 1);\n\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!this.adjacentCache.ContainsKey(adjacent))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.adjacentCache[adjacent] = true;\n\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ty = adjacent.Y + adjacent.Height;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ty++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Right face\n\t\t\tfor (int z = box.Z; z < box.Z + box.Depth; z++)\n\t\t\t{\n\t\t\t\tfor (int y = box.Y; y < box.Y + box.Height; )\n\t\t\t\t{\n\t\t\t\t\tBox adjacent = this.GetBox(box.X + box.Width, y, z);\n\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!this.adjacentCache.ContainsKey(adjacent))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.adjacentCache[adjacent] = true;\n\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ty = adjacent.Y + adjacent.Height;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ty++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Left face\n\t\t\tfor (int z = box.Z; z < box.Z + box.Depth; z++)\n\t\t\t{\n\t\t\t\tfor (int y = box.Y; y < box.Y + box.Height; )\n\t\t\t\t{\n\t\t\t\t\tBox adjacent = this.GetBox(box.X - 1, y, z);\n\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!this.adjacentCache.ContainsKey(adjacent))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.adjacentCache[adjacent] = true;\n\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ty = adjacent.Y + adjacent.Height;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ty++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Top face\n\t\t\tfor (int x = box.X; x < box.X + box.Width; x++)\n\t\t\t{\n\t\t\t\tfor (int z = box.Z; z < box.Z + box.Depth; )\n\t\t\t\t{\n\t\t\t\t\tBox adjacent = this.GetBox(x, box.Y + box.Height, z);\n\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!this.adjacentCache.ContainsKey(adjacent))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.adjacentCache[adjacent] = true;\n\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tz = adjacent.Z + adjacent.Depth;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tz++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Bottom face\n\t\t\tfor (int x = box.X; x < box.X + box.Width; x++)\n\t\t\t{\n\t\t\t\tfor (int z = box.Z; z < box.Z + box.Depth; )\n\t\t\t\t{\n\t\t\t\t\tBox adjacent = this.GetBox(x, box.Y - 1, z);\n\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!this.adjacentCache.ContainsKey(adjacent))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.adjacentCache[adjacent] = true;\n\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tz = adjacent.Z + adjacent.Depth;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tz++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.adjacentCache.Clear();\n\t\t}\n\n\t\tpublic void RebuildAdjacency()\n\t\t{\n\t\t\tfor (int i = 0; i < this.Chunks.Count; i++)\n\t\t\t\tthis.Chunks[i].RebuildAdjacency();\n\t\t}\n\n\t\tprivate Dictionary<BoxRelationship, bool> relationshipCache = new Dictionary<BoxRelationship, bool>();\n\t\tprotected void calculateAdjacency(IEnumerable<Box> boxes)\n\t\t{\n\t\t\tforeach (Box box in boxes)\n\t\t\t{\n\t\t\t\tif (box.Adjacent == null)\n\t\t\t\t\tbox.Adjacent = new List<Box>();\n\t\t\t\telse\n\t\t\t\t\tbox.Adjacent.Clear();\n\t\t\t}\n\n\t\t\tforeach (Box box in boxes)\n\t\t\t{\n\t\t\t\tthis.additions.Add(box);\n\t\t\t\t// Front face\n\t\t\t\tfor (int x = box.X; x < box.X + box.Width; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = box.Y; y < box.Y + box.Height; )\n\t\t\t\t\t{\n\t\t\t\t\t\tBox adjacent = this.GetBox(x, y, box.Z + box.Depth);\n\t\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBoxRelationship relationship1 = new BoxRelationship { A = box, B = adjacent };\n\t\t\t\t\t\t\tBoxRelationship relationship2 = new BoxRelationship { A = adjacent, B = box };\n\t\t\t\t\t\t\tif (!this.relationshipCache.ContainsKey(relationship1) && !this.relationshipCache.ContainsKey(relationship2))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.relationshipCache[relationship1] = true;\n\t\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ty = adjacent.Y + adjacent.Height;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Back face\n\t\t\t\tfor (int x = box.X; x < box.X + box.Width; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = box.Y; y < box.Y + box.Height; )\n\t\t\t\t\t{\n\t\t\t\t\t\tBox adjacent = this.GetBox(x, y, box.Z - 1);\n\t\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBoxRelationship relationship1 = new BoxRelationship { A = box, B = adjacent };\n\t\t\t\t\t\t\tBoxRelationship relationship2 = new BoxRelationship { A = adjacent, B = box };\n\t\t\t\t\t\t\tif (!this.relationshipCache.ContainsKey(relationship1) && !this.relationshipCache.ContainsKey(relationship2))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.relationshipCache[relationship1] = true;\n\t\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ty = adjacent.Y + adjacent.Height;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Right face\n\t\t\t\tfor (int z = box.Z; z < box.Z + box.Depth; z++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = box.Y; y < box.Y + box.Height; )\n\t\t\t\t\t{\n\t\t\t\t\t\tBox adjacent = this.GetBox(box.X + box.Width, y, z);\n\t\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBoxRelationship relationship1 = new BoxRelationship { A = box, B = adjacent };\n\t\t\t\t\t\t\tBoxRelationship relationship2 = new BoxRelationship { A = adjacent, B = box };\n\t\t\t\t\t\t\tif (!this.relationshipCache.ContainsKey(relationship1) && !this.relationshipCache.ContainsKey(relationship2))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.relationshipCache[relationship1] = true;\n\t\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ty = adjacent.Y + adjacent.Height;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Left face\n\t\t\t\tfor (int z = box.Z; z < box.Z + box.Depth; z++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = box.Y; y < box.Y + box.Height; )\n\t\t\t\t\t{\n\t\t\t\t\t\tBox adjacent = this.GetBox(box.X - 1, y, z);\n\t\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBoxRelationship relationship1 = new BoxRelationship { A = box, B = adjacent };\n\t\t\t\t\t\t\tBoxRelationship relationship2 = new BoxRelationship { A = adjacent, B = box };\n\t\t\t\t\t\t\tif (!this.relationshipCache.ContainsKey(relationship1) && !this.relationshipCache.ContainsKey(relationship2))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.relationshipCache[relationship1] = true;\n\t\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ty = adjacent.Y + adjacent.Height;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Top face\n\t\t\t\tfor (int x = box.X; x < box.X + box.Width; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = box.Z; z < box.Z + box.Depth; )\n\t\t\t\t\t{\n\t\t\t\t\t\tBox adjacent = this.GetBox(x, box.Y + box.Height, z);\n\t\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBoxRelationship relationship1 = new BoxRelationship { A = box, B = adjacent };\n\t\t\t\t\t\t\tBoxRelationship relationship2 = new BoxRelationship { A = adjacent, B = box };\n\t\t\t\t\t\t\tif (!this.relationshipCache.ContainsKey(relationship1) && !this.relationshipCache.ContainsKey(relationship2))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.relationshipCache[relationship1] = true;\n\t\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tz = adjacent.Z + adjacent.Depth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tz++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Bottom face\n\t\t\t\tfor (int x = box.X; x < box.X + box.Width; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = box.Z; z < box.Z + box.Depth; )\n\t\t\t\t\t{\n\t\t\t\t\t\tBox adjacent = this.GetBox(x, box.Y - 1, z);\n\t\t\t\t\t\tif (adjacent != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBoxRelationship relationship1 = new BoxRelationship { A = box, B = adjacent };\n\t\t\t\t\t\t\tBoxRelationship relationship2 = new BoxRelationship { A = adjacent, B = box };\n\t\t\t\t\t\t\tif (!this.relationshipCache.ContainsKey(relationship1) && !this.relationshipCache.ContainsKey(relationship2))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.relationshipCache[relationship1] = true;\n\t\t\t\t\t\t\t\tlock (box.Adjacent)\n\t\t\t\t\t\t\t\t\tbox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(box);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tz = adjacent.Z + adjacent.Depth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tz++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.relationshipCache.Clear();\n\t\t}\n\n\t\tprotected bool regenerateSurfaces(Box box)\n\t\t{\n\t\t\tint x, y, z;\n\t\t\tState type = box.Type;\n\t\t\tbool stop;\n\t\t\tBox adjacent;\n\n\t\t\tbox.Surfaces = 0;\n\t\t\tx = box.X + box.Width;\n\t\t\tstop = false;\n\n\t\t\tfor (y = box.Y; y < box.Y + box.Height; y++)\n\t\t\t{\n\t\t\t\tfor (z = box.Z; z < box.Z + box.Depth; z++)\n\t\t\t\t{\n\t\t\t\t\tadjacent = this.GetBox(x, y, z);\n\t\t\t\t\tif (adjacent == null || adjacent.Type != type)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.Surfaces |= 1 << (int)Direction.PositiveX;\n\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stop)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tx = box.X - 1;\n\t\t\tstop = false;\n\n\t\t\tfor (y = box.Y; y < box.Y + box.Height; y++)\n\t\t\t{\n\t\t\t\tfor (z = box.Z; z < box.Z + box.Depth; z++)\n\t\t\t\t{\n\t\t\t\t\tadjacent = this.GetBox(x, y, z);\n\t\t\t\t\tif (adjacent == null || adjacent.Type != type)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.Surfaces |= 1 << (int)Direction.NegativeX;\n\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stop)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\ty = box.Y + box.Height;\n\t\t\tstop = false;\n\n\t\t\tfor (x = box.X; x < box.X + box.Width; x++)\n\t\t\t{\n\t\t\t\tfor (z = box.Z; z < box.Z + box.Depth; z++)\n\t\t\t\t{\n\t\t\t\t\tadjacent = this.GetBox(x, y, z);\n\t\t\t\t\tif (adjacent == null || adjacent.Type != type)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.Surfaces |= 1 << (int)Direction.PositiveY;\n\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stop)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\ty = box.Y - 1;\n\t\t\tstop = false;\n\n\t\t\tfor (x = box.X; x < box.X + box.Width; x++)\n\t\t\t{\n\t\t\t\tfor (z = box.Z; z < box.Z + box.Depth; z++)\n\t\t\t\t{\n\t\t\t\t\tadjacent = this.GetBox(x, y, z);\n\t\t\t\t\tif (adjacent == null || adjacent.Type != type)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.Surfaces |= 1 << (int)Direction.NegativeY;\n\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stop)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tz = box.Z + box.Depth;\n\t\t\tstop = false;\n\n\t\t\tfor (y = box.Y; y < box.Y + box.Height; y++)\n\t\t\t{\n\t\t\t\tfor (x = box.X; x < box.X + box.Width; x++)\n\t\t\t\t{\n\t\t\t\t\tadjacent = this.GetBox(x, y, z);\n\t\t\t\t\tif (adjacent == null || adjacent.Type != type)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.Surfaces |= 1 << (int)Direction.PositiveZ;\n\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tz = box.Z - 1;\n\t\t\tstop = false;\n\n\t\t\tfor (y = box.Y; y < box.Y + box.Height; y++)\n\t\t\t{\n\t\t\t\tfor (x = box.X; x < box.X + box.Width; x++)\n\t\t\t\t{\n\t\t\t\t\tadjacent = this.GetBox(x, y, z);\n\t\t\t\t\tif (adjacent == null || adjacent.Type != type)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.Surfaces |= 1 << (int)Direction.NegativeZ;\n\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stop)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (box.Added)\n\t\t\t{\n\t\t\t\tbox.Chunk.MarkDirty(box);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected void removeBox(Box box)\n\t\t{\n\t\t\tChunk chunk = box.Chunk;\n\t\t\tfor (int x = box.X - chunk.X; x < box.X + box.Width - chunk.X; x++)\n\t\t\t{\n\t\t\t\tfor (int y = box.Y - chunk.Y; y < box.Y + box.Height - chunk.Y; y++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = box.Z - chunk.Z; z < box.Z + box.Depth - chunk.Z; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tchunk[x, y, z] = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.removeBoxAdjacency(box);\n\t\t\tbox.Active = false;\n\t\t\tchunk.MarkDirty(box);\n\t\t\tthis.removals.Add(box);\n\t\t}\n\n\t\tprotected void removeBoxAdjacency(Box box)\n\t\t{\n\t\t\tlock (box.Adjacent)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < box.Adjacent.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tBox box2 = box.Adjacent[i];\n\t\t\t\t\tlock (box2.Adjacent)\n\t\t\t\t\t\tbox2.Adjacent.Remove(box);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Regenerate(Action<List<DynamicVoxel>> callback = null)\n\t\t{\n\t\t\tworkQueue.Enqueue(new WorkItem { Voxel = this, Callback = callback });\n\t\t}\n\n\t\tprivate struct WorkItem\n\t\t{\n\t\t\tpublic Voxel Voxel;\n\t\t\tpublic Action<List<DynamicVoxel>> Callback;\n\t\t}\n\n\t\tprivate static BlockingQueue<WorkItem> workQueue = new BlockingQueue<WorkItem>(32);\n\n\t\tprivate static void worker()\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tWorkItem item = Voxel.workQueue.Dequeue();\n\t\t\t\titem.Voxel.RegenerateImmediately(item.Callback);\n\t\t\t}\n\t\t}\n\n\t\tprivate static Thread workThread;\n\n\t\tpublic object MutationLock = new object();\n\n\t\tprivate Dictionary<Box, bool> regeneratedCache = new Dictionary<Box, bool>();\n\n\t\t/// <summary>\n\t\t/// Applies any changes made to the map.\n\t\t/// </summary>\n\t\tpublic void RegenerateImmediately(Action<List<DynamicVoxel>> callback = null)\n\t\t{\n\t\t\tList<DynamicVoxel> spawnedMaps = new List<DynamicVoxel>();\n\n\t\t\tif (!this.main.EditorEnabled && !this.Mutable)\n\t\t\t\treturn;\n\t\t\tList<Chunk> chunks;\n\t\t\tlock (this.MutationLock)\n\t\t\t{\n\t\t\t\tif (!this.Active)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!this.main.EditorEnabled)\n\t\t\t\t{\n\t\t\t\t\t// Spawn new maps for portions that have been cut off\n\n\t\t\t\t\tIEnumerable<IEnumerable<Box>> islands;\n\t\t\t\t\tif (this.getAdjacentIslands(this.removalCoords, out islands))\n\t\t\t\t\t{\n\t\t\t\t\t\tList<List<Box>> finalIslands = new List<List<Box>>();\n\n\t\t\t\t\t\tforeach (IEnumerable<Box> island in islands)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinalIslands.Add(island.ToList());\n\n\t\t\t\t\t\t\t// Remove these boxes from the map\n\t\t\t\t\t\t\tforeach (Box adjacent in island)\n\t\t\t\t\t\t\t\tthis.removeBox(adjacent);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (finalIslands.Count > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (Voxel.spawns)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tVoxel.spawns.Add(new SpawnGroup\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tSource = this,\n\t\t\t\t\t\t\t\t\tCallback = callback,\n\t\t\t\t\t\t\t\t\tIslands = finalIslands\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.removalCoords.Clear();\n\n\t\t\t\t// Figure out which blocks need updating\n\n\t\t\t\t// Update graphics\n\n\t\t\t\tfor (int i = 0; i < this.removals.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tBox box = this.removals[i];\n\t\t\t\t\tfor (int j = 0; j < box.Adjacent.Count; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox adjacent = box.Adjacent[j];\n\t\t\t\t\t\tif (adjacent.Active && adjacent.Type == box.Type && !this.regeneratedCache.ContainsKey(adjacent))\n\t\t\t\t\t\t\tthis.regeneratedCache[adjacent] = this.regenerateSurfaces(adjacent);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (int i = 0; i < this.additions.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tBox box = this.additions[i];\n\t\t\t\t\tif (box.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!this.regeneratedCache.ContainsKey(box))\n\t\t\t\t\t\t\tthis.regeneratedCache[box] = this.regenerateSurfaces(box);\n\n\t\t\t\t\t\tforeach (Box adjacent in box.Adjacent)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (adjacent.Active && adjacent.Type == box.Type && !this.regeneratedCache.ContainsKey(adjacent))\n\t\t\t\t\t\t\t\tthis.regeneratedCache[adjacent] = this.regenerateSurfaces(adjacent);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tList<Box> boxes = this.regeneratedCache.Keys.ToList();\n\n\t\t\t\tbool[] modifications = this.regeneratedCache.Values.ToArray();\n\t\t\t\tthis.regeneratedCache.Clear();\n\t\t\t\tthis.simplify(boxes, modifications);\n\t\t\t\tthis.simplify(boxes, modifications);\n\n\t\t\t\tthis.applyChanges(boxes, modifications);\n\t\t\t\tchunks = this.Chunks.ToList();\n\t\t\t}\n\t\t\tthis.updateGraphics(chunks);\n\t\t}\n\n\t\tprivate void updateGraphics(IEnumerable<Chunk> chunks)\n\t\t{\n\t\t\tforeach (Chunk chunk in chunks)\n\t\t\t\tchunk.RefreshImmediately();\n\t\t}\n\n\t\tprivate void applyChanges(List<Box> boxes, bool[] modifications)\n\t\t{\n\t\t\tfor (int i = 0; i < this.removals.Count; i++)\n\t\t\t{\n\t\t\t\tBox box = this.removals[i];\n\t\t\t\tif (box.Added)\n\t\t\t\t\tbox.Chunk.Boxes.RemoveAt(box.ChunkIndex);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < boxes.Count; i++)\n\t\t\t{\n\t\t\t\tBox box = boxes[i];\n\t\t\t\tif (box.Added)\n\t\t\t\t{\n\t\t\t\t\tif (box.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (modifications[i])\n\t\t\t\t\t\t\tbox.Chunk.Boxes.Changed(box.ChunkIndex, box);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tbox.Chunk.Boxes.RemoveAt(box.ChunkIndex);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < this.additions.Count; i++)\n\t\t\t{\n\t\t\t\tBox box = this.additions[i];\n\t\t\t\tif (box.Active && !box.Added)\n\t\t\t\t\tbox.Chunk.Boxes.Add(box);\n\t\t\t}\n\n\t\t\tthis.removals.Clear();\n\t\t\tthis.additions.Clear();\n\n\t\t\tthis.updatePhysics();\n\t\t}\n\n\t\tpublic void BuildFromBoxes(IEnumerable<Box> boxes)\n\t\t{\n\t\t\tList<Box> boxAdditions = new List<Box>();\n\t\t\tforeach (Box source in boxes)\n\t\t\t{\n\t\t\t\tChunk baseChunk = this.GetChunk(source.X, source.Y, source.Z);\n\t\t\t\tChunk nextChunk = this.GetChunk(source.X + source.Width, source.Y + source.Height, source.Z + source.Depth);\n\t\t\t\tfor (int ix = baseChunk.X; ix <= nextChunk.X; ix += this.chunkSize)\n\t\t\t\t{\n\t\t\t\t\tfor (int iy = baseChunk.Y; iy <= nextChunk.Y; iy += this.chunkSize)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int iz = baseChunk.Z; iz <= nextChunk.Z; iz += this.chunkSize)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint bx = Math.Max(ix, source.X), by = Math.Max(iy, source.Y), bz = Math.Max(iz, source.Z);\n\t\t\t\t\t\t\tBox box = new Box\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tX = bx,\n\t\t\t\t\t\t\t\tY = by,\n\t\t\t\t\t\t\t\tZ = bz,\n\t\t\t\t\t\t\t\tWidth = Math.Min(source.X + source.Width, ix + this.chunkSize) - bx,\n\t\t\t\t\t\t\t\tHeight = Math.Min(source.Y + source.Height, iy + this.chunkSize) - by,\n\t\t\t\t\t\t\t\tDepth = Math.Min(source.Z + source.Depth, iz + this.chunkSize) - bz,\n\t\t\t\t\t\t\t\tType = source.Type,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (box.Width > 0 && box.Height > 0 && box.Depth > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.addBoxWithoutAdjacency(box);\n\t\t\t\t\t\t\t\tboxAdditions.Add(box);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.calculateAdjacency(boxAdditions);\n\n\t\t\tthis.RegenerateImmediately(null);\n\t\t}\n\n\t\tpublic List<Box> GetContiguousByType(IEnumerable<Box> input)\n\t\t{\n\t\t\tState state = input.First().Type;\n\t\t\treturn this.GetContiguous(input, x => x.Type == state);\n\t\t}\n\n\t\tpublic List<Box> GetContiguous(IEnumerable<Box> input, Func<Box, bool> filter)\n\t\t{\n\t\t\tQueue<Box> boxes = new Queue<Box>();\n\n\t\t\tforeach (Box box in input)\n\t\t\t\tboxes.Enqueue(box);\n\n\t\t\tList<Box> result = new List<Box>();\n\t\t\tDictionary<Box, bool> alreadyVisited = new Dictionary<Box, bool>();\n\n\t\t\twhile (boxes.Count > 0)\n\t\t\t{\n\t\t\t\tBox b = boxes.Dequeue();\n\n\t\t\t\tif (filter(b))\n\t\t\t\t{\n\t\t\t\t\tresult.Add(b);\n\t\t\t\t\tif (b.Adjacent != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tlock (b.Adjacent)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int i = 0; i < b.Adjacent.Count; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBox adjacent = b.Adjacent[i];\n\t\t\t\t\t\t\t\tif (!alreadyVisited.ContainsKey(adjacent))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tboxes.Enqueue(adjacent);\n\t\t\t\t\t\t\t\t\talreadyVisited.Add(adjacent, true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tprivate bool getAdjacentIslands(IEnumerable<Coord> removals, out IEnumerable<IEnumerable<Box>> islands)\n\t\t{\n\t\t\tList<Dictionary<Box, bool>> lists = new List<Dictionary<Box, bool>>();\n\n\t\t\tint allLists = 0;\n\t\t\t// Build adjacency lists\n\t\t\tforeach (Coord removal in removals)\n\t\t\t{\n\t\t\t\tif (this[removal] != Voxel.States.Empty) // A new block was subsequently filled in after removal. Forget about it.\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfor (int i = 0; i < 6; i++)\n\t\t\t\t{\n\t\t\t\t\tCoord adjacentCoord = removal.Move(DirectionExtensions.Directions[i]);\n\t\t\t\t\tBox box = this.GetBox(adjacentCoord);\n\t\t\t\t\tif (box == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tbool alreadyFound = false;\n\t\t\t\t\tfor (int j = 0; j < lists.Count; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tDictionary<Box, bool> list = lists[j];\n\t\t\t\t\t\tif (list.ContainsKey(box))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talreadyFound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (alreadyFound)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tDictionary<Box, bool> newList = new Dictionary<Box, bool>();\n\t\t\t\t\tbool supported = this.buildAdjacency(box, this.internalBoxAdjacencyCache, newList);\n\t\t\t\t\tif (newList.Count > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tallLists++;\n\t\t\t\t\t\tif (!supported)\n\t\t\t\t\t\t\tlists.Add(newList);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Spawn the dynamic maps\n\t\t\tislands = lists.Select(x => x.Keys);\n\t\t\treturn allLists > 1;\n\t\t}\n\n\t\tpublic IEnumerable<IEnumerable<Box>> GetAdjacentIslands(IEnumerable<Coord> removals, Func<State, bool> filter, Func<State, bool> search)\n\t\t{\n\t\t\tList<Dictionary<Box, bool>> lists = new List<Dictionary<Box, bool>>();\n\n\t\t\t// Build adjacency lists\n\t\t\tforeach (Coord removal in removals)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < 6; i++)\n\t\t\t\t{\n\t\t\t\t\tCoord adjacentCoord = removal.Move(DirectionExtensions.Directions[i]);\n\t\t\t\t\tBox box = this.GetBox(adjacentCoord);\n\t\t\t\t\tif (box == null || (!filter(box.Type) && !search(box.Type)))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tbool alreadyFound = false;\n\t\t\t\t\tfor (int j = 0; j < lists.Count; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tDictionary<Box, bool> list = lists[j];\n\t\t\t\t\t\tif (list.ContainsKey(box))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talreadyFound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (alreadyFound)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tDictionary<Box, bool> newList = new Dictionary<Box, bool>();\n\t\t\t\t\tbool found = this.buildAdjacency(box, this.externalBoxAdjacencyCache, newList, filter, search);\n\t\t\t\t\tif (!found && newList.Count > 0)\n\t\t\t\t\t\tlists.Add(newList);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn lists.Select(x => x.Keys);\n\t\t}\n\n\t\tpublic Coord? FindClosestFilledCell(Coord coord, int maxDistance = 20)\n\t\t{\n\t\t\tif (this[coord].ID != 0)\n\t\t\t\treturn coord;\n\n\t\t\tVector3 pos = this.GetRelativePosition(coord);\n\n\t\t\tCoord? closestCoord = null;\n\n\t\t\tfor (int radius = 1; radius < maxDistance; radius++)\n\t\t\t{\n\t\t\t\tfloat closestDistance = float.MaxValue;\n\n\t\t\t\t// Left\n\t\t\t\tfor (int y = -radius; y <= radius; y++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = -radius; z <= radius; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tCoord c = coord.Move(-radius, y, z);\n\t\t\t\t\t\tif (this[c].ID != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat distance = (this.GetRelativePosition(c) - pos).LengthSquared();\n\t\t\t\t\t\t\tif (distance < closestDistance)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclosestDistance = distance;\n\t\t\t\t\t\t\t\tclosestCoord = c;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Right\n\t\t\t\tfor (int y = -radius; y <= radius; y++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = -radius; z <= radius; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tCoord c = coord.Move(radius, y, z);\n\t\t\t\t\t\tif (this[c].ID != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat distance = (this.GetRelativePosition(c) - pos).LengthSquared();\n\t\t\t\t\t\t\tif (distance < closestDistance)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclosestDistance = distance;\n\t\t\t\t\t\t\t\tclosestCoord = c;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Bottom\n\t\t\t\tfor (int x = -radius + 1; x < radius; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = -radius + 1; z < radius; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tCoord c = coord.Move(x, -radius, z);\n\t\t\t\t\t\tif (this[c].ID != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat distance = (this.GetRelativePosition(c) - pos).LengthSquared();\n\t\t\t\t\t\t\tif (distance < closestDistance)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclosestDistance = distance;\n\t\t\t\t\t\t\t\tclosestCoord = c;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Top\n\t\t\t\tfor (int x = -radius + 1; x < radius; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = -radius + 1; z < radius; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tCoord c = coord.Move(x, radius, z);\n\t\t\t\t\t\tif (this[c].ID != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat distance = (this.GetRelativePosition(c) - pos).LengthSquared();\n\t\t\t\t\t\t\tif (distance < closestDistance)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclosestDistance = distance;\n\t\t\t\t\t\t\t\tclosestCoord = c;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Backward\n\t\t\t\tfor (int x = -radius + 1; x < radius; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = -radius; y <= radius; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tCoord c = coord.Move(x, y, -radius);\n\t\t\t\t\t\tif (this[c].ID != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat distance = (this.GetRelativePosition(c) - pos).LengthSquared();\n\t\t\t\t\t\t\tif (distance < closestDistance)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclosestDistance = distance;\n\t\t\t\t\t\t\t\tclosestCoord = c;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Forward\n\t\t\t\tfor (int x = -radius + 1; x < radius; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = -radius; y <= radius; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tCoord c = coord.Move(x, y, radius);\n\t\t\t\t\t\tif (this[c].ID != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat distance = (this.GetRelativePosition(c) - pos).LengthSquared();\n\t\t\t\t\t\t\tif (distance < closestDistance)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclosestDistance = distance;\n\t\t\t\t\t\t\t\tclosestCoord = c;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (closestCoord.HasValue)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn closestCoord;\n\t\t}\n\n\t\tprivate Queue<Box> externalBoxAdjacencyCache = new Queue<Box>();\n\t\tprivate Queue<Box> internalBoxAdjacencyCache = new Queue<Box>();\n\n\t\tprivate bool buildAdjacency(Box box, Queue<Box> boxAdjacencyCache, Dictionary<Box, bool> list, Func<State, bool> filter, Func<State, bool> search)\n\t\t{\n\t\t\tif (search(box.Type))\n\t\t\t{\n\t\t\t\tlist.Add(box, true);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (filter(box.Type) && !list.ContainsKey(box))\n\t\t\t{\n\t\t\t\tboxAdjacencyCache.Enqueue(box);\n\t\t\t\tlist.Add(box, true);\n\t\t\t}\n\n\t\t\twhile (boxAdjacencyCache.Count > 0)\n\t\t\t{\n\t\t\t\tBox b = boxAdjacencyCache.Dequeue();\n\n\t\t\t\tif (b.Adjacent != null)\n\t\t\t\t{\n\t\t\t\t\tlock (b.Adjacent)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int i = 0; i < b.Adjacent.Count; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBox adjacent = b.Adjacent[i];\n\t\t\t\t\t\t\tif (!list.ContainsKey(adjacent))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (search(adjacent.Type))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tboxAdjacencyCache.Clear();\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (filter(adjacent.Type))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tboxAdjacencyCache.Enqueue(adjacent);\n\t\t\t\t\t\t\t\t\tlist.Add(adjacent, true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tboxAdjacencyCache.Clear();\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate bool buildAdjacency(Box box, Queue<Box> boxAdjacencyCache, Dictionary<Box, bool> list)\n\t\t{\n\t\t\tif (!list.ContainsKey(box))\n\t\t\t{\n\t\t\t\tboxAdjacencyCache.Enqueue(box);\n\t\t\t\tlist.Add(box, true);\n\t\t\t}\n\n\t\t\twhile (boxAdjacencyCache.Count > 0)\n\t\t\t{\n\t\t\t\tBox b = boxAdjacencyCache.Dequeue();\n\n\t\t\t\tif (b.Type.Supported)\n\t\t\t\t{\n\t\t\t\t\tboxAdjacencyCache.Clear();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (b.Adjacent != null)\n\t\t\t\t{\n\t\t\t\t\tlock (b.Adjacent)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int i = 0; i < b.Adjacent.Count; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBox adjacent = b.Adjacent[i];\n\t\t\t\t\t\t\tif (!list.ContainsKey(adjacent))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tboxAdjacencyCache.Enqueue(adjacent);\n\t\t\t\t\t\t\t\tlist.Add(adjacent, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tboxAdjacencyCache.Clear();\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate bool[] simplify(List<Box> list, bool[] modified = null)\n\t\t{\n\t\t\tif (modified == null)\n\t\t\t\tmodified = new bool[list.Count];\n\n\t\t\t// Z\n\t\t\tfor (int i = 0; i < list.Count; i++)\n\t\t\t{\n\t\t\t\tBox baseBox = list[i];\n\t\t\t\tif (!baseBox.Active)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tChunk chunk = baseBox.Chunk;\n\t\t\t\tfor (int z2 = baseBox.Z + baseBox.Depth - chunk.Z; z2 < this.chunkSize; )\n\t\t\t\t{\n\t\t\t\t\tBox box = chunk[baseBox.X - chunk.X, baseBox.Y - chunk.Y, z2];\n\t\t\t\t\tif (box != null && box.X == baseBox.X && box.Y == baseBox.Y && box.Z == z2 + chunk.Z && box.Type == baseBox.Type && box.Width == baseBox.Width && box.Height == baseBox.Height)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.Active = false;\n\t\t\t\t\t\tforeach (Box adjacent in box.Adjacent)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (adjacent == baseBox)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tlock (baseBox.Adjacent)\n\t\t\t\t\t\t\t\tbaseBox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(baseBox);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.removeBoxAdjacency(box);\n\t\t\t\t\t\tthis.removals.Add(box);\n\t\t\t\t\t\tbaseBox.Depth += box.Depth;\n\t\t\t\t\t\tbox.Chunk.MarkDirty(box);\n\n\t\t\t\t\t\tbool negativeZ = (baseBox.Surfaces & (1 << (int)Direction.NegativeZ)) != 0;\n\t\t\t\t\t\tbaseBox.Surfaces |= box.Surfaces;\n\t\t\t\t\t\tbaseBox.Surfaces = baseBox.Surfaces.SetBit((int)Direction.NegativeZ, negativeZ);\n\n\t\t\t\t\t\tfor (int x = box.X - chunk.X; x < box.X + box.Width - chunk.X; x++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int y = box.Y - chunk.Y; y < box.Y + box.Height - chunk.Y; y++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (z2 = box.Z - chunk.Z; z2 < box.Z + box.Depth - chunk.Z; z2++)\n\t\t\t\t\t\t\t\t\tchunk[x, y, z2] = baseBox;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmodified[i] = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// X\n\t\t\tfor (int i = 0; i < list.Count; i++)\n\t\t\t{\n\t\t\t\tBox baseBox = list[i];\n\t\t\t\tif (!baseBox.Active)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tChunk chunk = baseBox.Chunk;\n\t\t\t\tfor (int x2 = baseBox.X + baseBox.Width - chunk.X; x2 < this.chunkSize; )\n\t\t\t\t{\n\t\t\t\t\tBox box = chunk[x2, baseBox.Y - chunk.Y, baseBox.Z - chunk.Z];\n\t\t\t\t\tif (box != null && box.X == x2 + chunk.X && box.Y == baseBox.Y && box.Z == baseBox.Z && box.Type == baseBox.Type && box.Depth == baseBox.Depth && box.Height == baseBox.Height)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.Active = false;\n\t\t\t\t\t\tforeach (Box adjacent in box.Adjacent)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (adjacent == baseBox)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tlock (baseBox.Adjacent)\n\t\t\t\t\t\t\t\tbaseBox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(baseBox);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.removeBoxAdjacency(box);\n\t\t\t\t\t\tthis.removals.Add(box);\n\t\t\t\t\t\tbaseBox.Width += box.Width;\n\t\t\t\t\t\tbox.Chunk.MarkDirty(box);\n\n\t\t\t\t\t\tbool negativeX = (baseBox.Surfaces & (1 << (int)Direction.NegativeX)) != 0;\n\t\t\t\t\t\tbaseBox.Surfaces |= box.Surfaces;\n\t\t\t\t\t\tbaseBox.Surfaces = baseBox.Surfaces.SetBit((int)Direction.NegativeX, negativeX);\n\n\t\t\t\t\t\tfor (x2 = box.X - chunk.X; x2 < box.X + box.Width - chunk.X; x2++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int y = box.Y - chunk.Y; y < box.Y + box.Height - chunk.Y; y++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (int z = box.Z - chunk.Z; z < box.Z + box.Depth - chunk.Z; z++)\n\t\t\t\t\t\t\t\t\tchunk[x2, y, z] = baseBox;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmodified[i] = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Y\n\t\t\tfor (int i = 0; i < list.Count; i++)\n\t\t\t{\n\t\t\t\tBox baseBox = list[i];\n\t\t\t\tif (!baseBox.Active)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tChunk chunk = baseBox.Chunk;\n\t\t\t\tfor (int y2 = baseBox.Y + baseBox.Height - chunk.Y; y2 < this.chunkSize; )\n\t\t\t\t{\n\t\t\t\t\tBox box = chunk[baseBox.X - chunk.X, y2, baseBox.Z - chunk.Z];\n\t\t\t\t\tif (box != null && box.X == baseBox.X && box.Y == y2 + chunk.Y && box.Z == baseBox.Z && box.Type == baseBox.Type && box.Depth == baseBox.Depth && box.Width == baseBox.Width)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.Active = false;\n\t\t\t\t\t\tforeach (Box adjacent in box.Adjacent)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (adjacent == baseBox)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tlock (baseBox.Adjacent)\n\t\t\t\t\t\t\t\tbaseBox.Adjacent.Add(adjacent);\n\t\t\t\t\t\t\tlock (adjacent.Adjacent)\n\t\t\t\t\t\t\t\tadjacent.Adjacent.Add(baseBox);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.removeBoxAdjacency(box);\n\t\t\t\t\t\tthis.removals.Add(box);\n\t\t\t\t\t\tbaseBox.Height += box.Height;\n\t\t\t\t\t\tbox.Chunk.MarkDirty(box);\n\n\t\t\t\t\t\tbool negativeY = (baseBox.Surfaces & (1 << (int)Direction.NegativeY)) != 0;\n\t\t\t\t\t\tbaseBox.Surfaces |= box.Surfaces;\n\t\t\t\t\t\tbaseBox.Surfaces = baseBox.Surfaces.SetBit((int)Direction.NegativeY, negativeY);\n\n\t\t\t\t\t\tfor (int x = box.X - chunk.X; x < box.X + box.Width - chunk.X; x++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (y2 = box.Y - chunk.Y; y2 < box.Y + box.Height - chunk.Y; y2++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (int z = box.Z - chunk.Z; z < box.Z + box.Depth - chunk.Z; z++)\n\t\t\t\t\t\t\t\t\tchunk[x, y2, z] = baseBox;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmodified[i] = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn modified;\n\t\t}\n\n\t\tpublic RaycastResult Raycast(Coord start, Direction dir, int length, Func<int, t, bool> filter = null)\n\t\t{\n\t\t\treturn this.Raycast(start, start.Move(dir, length), filter);\n\t\t}\n\n\t\tpublic RaycastResult Raycast(Coord start, Coord end, Func<int, t, bool> filter = null)\n\t\t{\n\t\t\treturn this.Raycast(this.GetRelativePosition(start), this.GetRelativePosition(end), filter);\n\t\t}\n\n\t\tprivate Coord getChunkCoordinateFromCoordinate(Coord coord)\n\t\t{\n\t\t\treturn new Coord { X = (coord.X - this.minX) / this.chunkSize, Y = (coord.Y - this.minY) / this.chunkSize, Z = (coord.Z - this.minZ) / this.chunkSize };\n\t\t}\n\n\t\tprivate IEnumerable<Chunk> rasterizeChunks(Vector3 startRelative, Vector3 endRelative)\n\t\t{\n\t\t\t// Adapted from PolyVox\n\t\t\t// http://www.volumesoffun.com/polyvox/documentation/library/doc/html/_raycast_8inl_source.html\n\n\t\t\tstartRelative = (startRelative - new Vector3(this.minX, this.minY, this.minZ)) / this.chunkSize;\n\t\t\tendRelative = (endRelative - new Vector3(this.minX, this.minY, this.minZ)) / this.chunkSize;\n\n\t\t\tCoord startCoord = new Coord { X = (int)startRelative.X, Y = (int)startRelative.Y, Z = (int)startRelative.Z };\n\t\t\tCoord endCoord = new Coord { X = (int)endRelative.X, Y = (int)endRelative.Y, Z = (int)endRelative.Z };\n\n\t\t\tint dx = ((startRelative.X < endRelative.X) ? 1 : ((startRelative.X > endRelative.X) ? -1 : 0));\n\t\t\tint dy = ((startRelative.Y < endRelative.Y) ? 1 : ((startRelative.Y > endRelative.Y) ? -1 : 0));\n\t\t\tint dz = ((startRelative.Z < endRelative.Z) ? 1 : ((startRelative.Z > endRelative.Z) ? -1 : 0));\n\n\t\t\tfloat minx = startCoord.X, maxx = minx + 1.0f;\n\t\t\tfloat tx = ((startRelative.X > endRelative.X) ? (startRelative.X - minx) : (maxx - startRelative.X)) / Math.Abs(endRelative.X - startRelative.X);\n\t\t\tfloat miny = startCoord.Y, maxy = miny + 1.0f;\n\t\t\tfloat ty = ((startRelative.Y > endRelative.Y) ? (startRelative.Y - miny) : (maxy - startRelative.Y)) / Math.Abs(endRelative.Y - startRelative.Y);\n\t\t\tfloat minz = startCoord.Z, maxz = minz + 1.0f;\n\t\t\tfloat tz = ((startRelative.Z > endRelative.Z) ? (startRelative.Z - minz) : (maxz - startRelative.Z)) / Math.Abs(endRelative.Z - startRelative.Z);\n\n\t\t\tfloat deltatx = 1.0f / Math.Abs(endRelative.X - startRelative.X);\n\t\t\tfloat deltaty = 1.0f / Math.Abs(endRelative.Y - startRelative.Y);\n\t\t\tfloat deltatz = 1.0f / Math.Abs(endRelative.Z - startRelative.Z);\n\n\t\t\tCoord coord = startCoord.Clone();\n\n\t\t\tDirection xDirection = dx > 0 ? Direction.NegativeX : (dx < 0 ? Direction.PositiveX : Direction.None);\n\t\t\tDirection yDirection = dy > 0 ? Direction.NegativeY : (dy < 0 ? Direction.PositiveY : Direction.None);\n\t\t\tDirection zDirection = dz > 0 ? Direction.NegativeZ : (dz < 0 ? Direction.PositiveZ : Direction.None);\n\n\t\t\tfor (; ; )\n\t\t\t{\n\t\t\t\tif (coord.X >= 0 && coord.X < this.maxChunks\n\t\t\t\t\t&& coord.Y >= 0 && coord.Y < this.maxChunks\n\t\t\t\t\t&& coord.Z >= 0 && coord.Z < this.maxChunks)\n\t\t\t\t{\n\t\t\t\t\tif (this.chunks == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse\n\t\t\t\t\t\tyield return this.chunks[coord.X, coord.Y, coord.Z];\n\t\t\t\t}\n\n\t\t\t\tif (tx <= ty && tx <= tz)\n\t\t\t\t{\n\t\t\t\t\tif (coord.X == endCoord.X)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\ttx += deltatx;\n\t\t\t\t\tcoord.X += dx;\n\t\t\t\t}\n\t\t\t\telse if (ty <= tz)\n\t\t\t\t{\n\t\t\t\t\tif (coord.Y == endCoord.Y)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tty += deltaty;\n\t\t\t\t\tcoord.Y += dy;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (coord.Z == endCoord.Z)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\ttz += deltatz;\n\t\t\t\t\tcoord.Z += dz;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<Coord> Rasterize(Vector3 start, Vector3 end)\n\t\t{\n\t\t\tstart = this.GetRelativePosition(start);\n\t\t\tend = this.GetRelativePosition(end);\n\n\t\t\tCoord startCoord = this.GetCoordinateFromRelative(start);\n\t\t\tCoord endCoord = this.GetCoordinateFromRelative(end);\n\n\t\t\tforeach (Coord coord in this.rasterize(start, end, startCoord, endCoord))\n\t\t\t\tyield return coord;\n\t\t}\n\n\t\tpublic IEnumerable<Coord> Rasterize(Coord startCoord, Coord endCoord)\n\t\t{\n\t\t\tVector3 start = this.GetRelativePosition(startCoord);\n\t\t\tVector3 end = this.GetRelativePosition(endCoord);\n\n\t\t\tforeach (Coord coord in this.rasterize(start, end, startCoord, endCoord))\n\t\t\t\tyield return coord;\n\t\t}\n\n\t\tprivate IEnumerable<Coord> rasterize(Vector3 start, Vector3 end, Coord startCoord, Coord endCoord)\n\t\t{\n\t\t\t// Adapted from PolyVox\n\t\t\t// http://www.volumesoffun.com/polyvox/documentation/library/doc/html/_raycast_8inl_source.html\n\n\t\t\tint dx = ((start.X < end.X) ? 1 : ((start.X > end.X) ? -1 : 0));\n\t\t\tint dy = ((start.Y < end.Y) ? 1 : ((start.Y > end.Y) ? -1 : 0));\n\t\t\tint dz = ((start.Z < end.Z) ? 1 : ((start.Z > end.Z) ? -1 : 0));\n\n\t\t\tfloat minx = startCoord.X, maxx = minx + 1.0f;\n\t\t\tfloat tx = ((start.X > end.X) ? (start.X - minx) : (maxx - start.X)) / Math.Abs(end.X - start.X);\n\t\t\tfloat miny = startCoord.Y, maxy = miny + 1.0f;\n\t\t\tfloat ty = ((start.Y > end.Y) ? (start.Y - miny) : (maxy - start.Y)) / Math.Abs(end.Y - start.Y);\n\t\t\tfloat minz = startCoord.Z, maxz = minz + 1.0f;\n\t\t\tfloat tz = ((start.Z > end.Z) ? (start.Z - minz) : (maxz - start.Z)) / Math.Abs(end.Z - start.Z);\n\n\t\t\tfloat deltatx = 1.0f / Math.Abs(end.X - start.X);\n\t\t\tfloat deltaty = 1.0f / Math.Abs(end.Y - start.Y);\n\t\t\tfloat deltatz = 1.0f / Math.Abs(end.Z - start.Z);\n\n\t\t\tCoord coord = startCoord.Clone();\n\n\t\t\tDirection normal = Direction.None;\n\n\t\t\tDirection xDirection = dx > 0 ? Direction.NegativeX : (dx < 0 ? Direction.PositiveX : Direction.None);\n\t\t\tDirection yDirection = dy > 0 ? Direction.NegativeY : (dy < 0 ? Direction.PositiveY : Direction.None);\n\t\t\tDirection zDirection = dz > 0 ? Direction.NegativeZ : (dz < 0 ? Direction.PositiveZ : Direction.None);\n\n\t\t\tfor (; ; )\n\t\t\t{\n\t\t\t\tyield return coord;\n\n\t\t\t\tif (tx <= ty && tx <= tz)\n\t\t\t\t{\n\t\t\t\t\tif (coord.X == endCoord.X)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\ttx += deltatx;\n\t\t\t\t\tcoord.X += dx;\n\t\t\t\t\tnormal = xDirection;\n\t\t\t\t}\n\t\t\t\telse if (ty <= tz)\n\t\t\t\t{\n\t\t\t\t\tif (coord.Y == endCoord.Y)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tty += deltaty;\n\t\t\t\t\tcoord.Y += dy;\n\t\t\t\t\tnormal = yDirection;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (coord.Z == endCoord.Z)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\ttz += deltatz;\n\t\t\t\t\tcoord.Z += dz;\n\t\t\t\t\tnormal = zDirection;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic RaycastResult Raycast(Vector3 start, Vector3 end, Func<int, t, bool> filter = null)\n\t\t{\n\t\t\tif (!this.main.EditorEnabled && !this.EnablePhysics)\n\t\t\t\treturn new RaycastResult();\n\n\t\t\t// Adapted from PolyVox\n\t\t\t// http://www.volumesoffun.com/polyvox/documentation/library/doc/html/_raycast_8inl_source.html\n\n\t\t\tVector3 absoluteStart = start;\n\t\t\tstart = this.GetRelativePosition(start);\n\t\t\tend = this.GetRelativePosition(end);\n\n\t\t\tVector3 ray = end - start;\n\n\t\t\tforeach (Chunk c in this.rasterizeChunks(start, end))\n\t\t\t{\n\t\t\t\tif (c == null || !c.Active)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tVector3 min = new Vector3(c.X, c.Y, c.Z), max = new Vector3(c.X + this.chunkSize, c.Y + this.chunkSize, c.Z + this.chunkSize);\n\n\t\t\t\tVector3[] intersections = new Vector3[2];\n\t\t\t\tint intersectionIndex = 0;\n\n\t\t\t\tbool startInChunk = c.RelativeBoundingBox.Contains(start) != ContainmentType.Disjoint, endInChunk = c.RelativeBoundingBox.Contains(end) != ContainmentType.Disjoint;\n\n\t\t\t\tint expectedIntersections = 0;\n\n\t\t\t\tif (startInChunk && endInChunk)\n\t\t\t\t{\n\t\t\t\t\tintersections[0] = start;\n\t\t\t\t\tintersections[1] = end;\n\t\t\t\t\tgoto done;\n\t\t\t\t}\n\t\t\t\telse if (startInChunk && !endInChunk)\n\t\t\t\t{\n\t\t\t\t\tintersections[1] = start;\n\t\t\t\t\texpectedIntersections = 1;\n\t\t\t\t}\n\t\t\t\telse if (!startInChunk && endInChunk)\n\t\t\t\t{\n\t\t\t\t\tintersections[1] = end;\n\t\t\t\t\texpectedIntersections = 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\texpectedIntersections = 2;\n\n\t\t\t\t// Negative X\n\t\t\t\tVector3 intersection;\n\t\t\t\tfloat ratio = Vector3.Dot((min - start), Vector3.Left) / Vector3.Dot(ray, Vector3.Left);\n\t\t\t\tif (ratio > 0.0f && ratio <= 1.0f)\n\t\t\t\t{\n\t\t\t\t\tintersection = start + (ray * ratio);\n\t\t\t\t\tif (intersection.Y >= min.Y && intersection.Y <= max.Y\n\t\t\t\t\t\t&& intersection.Z >= min.Z && intersection.Z <= max.Z)\n\t\t\t\t\t{\n\t\t\t\t\t\tintersections[intersectionIndex] = intersection;\n\t\t\t\t\t\tintersectionIndex++;\n\t\t\t\t\t\tif (intersectionIndex == expectedIntersections)\n\t\t\t\t\t\t\tgoto done;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Positive X\n\t\t\t\tratio = Vector3.Dot((max - start), Vector3.Right) / Vector3.Dot(ray, Vector3.Right);\n\t\t\t\tif (ratio > 0.0f && ratio <= 1.0f)\n\t\t\t\t{\n\t\t\t\t\tintersection = start + (ray * ratio);\n\t\t\t\t\tif (intersection.Y >= min.Y && intersection.Y <= max.Y\n\t\t\t\t\t\t&& intersection.Z >= min.Z && intersection.Z <= max.Z)\n\t\t\t\t\t{\n\t\t\t\t\t\tintersections[intersectionIndex] = intersection;\n\t\t\t\t\t\tintersectionIndex++;\n\t\t\t\t\t\tif (intersectionIndex == expectedIntersections)\n\t\t\t\t\t\t\tgoto done;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Negative Y\n\t\t\t\tratio = Vector3.Dot((min - start), Vector3.Down) / Vector3.Dot(ray, Vector3.Down);\n\t\t\t\tif (ratio > 0.0f && ratio <= 1.0f)\n\t\t\t\t{\n\t\t\t\t\tintersection = start + (ray * ratio);\n\t\t\t\t\tif (intersection.X >= min.X && intersection.X <= max.X\n\t\t\t\t\t\t&& intersection.Z >= min.Z && intersection.Z <= max.Z)\n\t\t\t\t\t{\n\t\t\t\t\t\tintersections[intersectionIndex] = intersection;\n\t\t\t\t\t\tintersectionIndex++;\n\t\t\t\t\t\tif (intersectionIndex == expectedIntersections)\n\t\t\t\t\t\t\tgoto done;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Positive Y\n\t\t\t\tratio = Vector3.Dot((max - start), Vector3.Up) / Vector3.Dot(ray, Vector3.Up);\n\t\t\t\tif (ratio > 0.0f && ratio <= 1.0f)\n\t\t\t\t{\n\t\t\t\t\tintersection = start + (ray * ratio);\n\t\t\t\t\tif (intersection.X >= min.X && intersection.X <= max.X\n\t\t\t\t\t\t&& intersection.Z >= min.Z && intersection.Z <= max.Z)\n\t\t\t\t\t{\n\t\t\t\t\t\tintersections[intersectionIndex] = intersection;\n\t\t\t\t\t\tintersectionIndex++;\n\t\t\t\t\t\tif (intersectionIndex == 2)\n\t\t\t\t\t\t\tgoto done;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Negative Z\n\t\t\t\tratio = Vector3.Dot((min - start), Vector3.Forward) / Vector3.Dot(ray, Vector3.Forward);\n\t\t\t\tif (ratio > 0.0f && ratio <= 1.0f)\n\t\t\t\t{\n\t\t\t\t\tintersection = start + (ray * ratio);\n\t\t\t\t\tif (intersection.X >= min.X && intersection.X <= max.X\n\t\t\t\t\t\t&& intersection.Y >= min.Y && intersection.Y <= max.Y)\n\t\t\t\t\t{\n\t\t\t\t\t\tintersections[intersectionIndex] = intersection;\n\t\t\t\t\t\tintersectionIndex++;\n\t\t\t\t\t\tif (intersectionIndex == expectedIntersections)\n\t\t\t\t\t\t\tgoto done;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Positive Z\n\t\t\t\tratio = Vector3.Dot((max - start), Vector3.Backward) / Vector3.Dot(ray, Vector3.Backward);\n\t\t\t\tif (ratio > 0.0f && ratio <= 1.0f)\n\t\t\t\t{\n\t\t\t\t\tintersection = start + (ray * ratio);\n\t\t\t\t\tif (intersection.X >= min.X && intersection.X <= max.X\n\t\t\t\t\t\t&& intersection.Y >= min.Y && intersection.Y <= max.Y)\n\t\t\t\t\t{\n\t\t\t\t\t\tintersections[intersectionIndex] = intersection;\n\t\t\t\t\t\tintersectionIndex++;\n\t\t\t\t\t\tif (intersectionIndex == expectedIntersections)\n\t\t\t\t\t\t\tgoto done;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tdone:\n\t\t\t\tif (intersectionIndex == expectedIntersections)\n\t\t\t\t{\n\t\t\t\t\tif ((intersections[0] - start).LengthSquared() > (intersections[1] - start).LengthSquared())\n\t\t\t\t\t{\n\t\t\t\t\t\t// Swap intersections to the correct order.\n\t\t\t\t\t\tVector3 tmp = intersections[1];\n\t\t\t\t\t\tintersections[1] = intersections[0];\n\t\t\t\t\t\tintersections[0] = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\tRaycastResult result = this.raycastChunk(intersections[0], intersections[1], c, filter);\n\t\t\t\t\tif (result.Coordinate != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult.Distance = (result.Position - absoluteStart).Length();\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new RaycastResult { Coordinate = null };\n\t\t}\n\n\t\tprivate RaycastResult raycastChunk(Vector3 start, Vector3 end, Chunk c, Func<int, t, bool> filter)\n\t\t{\n\t\t\tif (filter == null)\n\t\t\t\tfilter = (x, y) => true;\n\n\t\t\tVector3 actualStart = start, actualEnd = end;\n\n\t\t\tstart -= new Vector3(c.X, c.Y, c.Z);\n\t\t\tend -= new Vector3(c.X, c.Y, c.Z);\n\n\t\t\tCoord startCoord = new Coord { X = (int)start.X, Y = (int)start.Y, Z = (int)start.Z };\n\t\t\tCoord endCoord = new Coord { X = (int)end.X, Y = (int)end.Y, Z = (int)end.Z };\n\n\t\t\tint dx = ((start.X < end.X) ? 1 : ((start.X > end.X) ? -1 : 0));\n\t\t\tint dy = ((start.Y < end.Y) ? 1 : ((start.Y > end.Y) ? -1 : 0));\n\t\t\tint dz = ((start.Z < end.Z) ? 1 : ((start.Z > end.Z) ? -1 : 0));\n\n\t\t\tfloat minx = startCoord.X, maxx = minx + 1.0f;\n\t\t\tfloat tx = ((start.X > end.X) ? (start.X - minx) : (maxx - start.X)) / Math.Abs(end.X - start.X);\n\t\t\tfloat miny = startCoord.Y, maxy = miny + 1.0f;\n\t\t\tfloat ty = ((start.Y > end.Y) ? (start.Y - miny) : (maxy - start.Y)) / Math.Abs(end.Y - start.Y);\n\t\t\tfloat minz = startCoord.Z, maxz = minz + 1.0f;\n\t\t\tfloat tz = ((start.Z > end.Z) ? (start.Z - minz) : (maxz - start.Z)) / Math.Abs(end.Z - start.Z);\n\n\t\t\tfloat deltatx = 1.0f / Math.Abs(end.X - start.X);\n\t\t\tfloat deltaty = 1.0f / Math.Abs(end.Y - start.Y);\n\t\t\tfloat deltatz = 1.0f / Math.Abs(end.Z - start.Z);\n\n\t\t\tCoord coord = startCoord.Clone();\n\n\t\t\tDirection normal = Direction.None;\n\n\t\t\tDirection xDirection = dx > 0 ? Direction.NegativeX : (dx < 0 ? Direction.PositiveX : Direction.None);\n\t\t\tDirection yDirection = dy > 0 ? Direction.NegativeY : (dy < 0 ? Direction.PositiveY : Direction.None);\n\t\t\tDirection zDirection = dz > 0 ? Direction.NegativeZ : (dz < 0 ? Direction.PositiveZ : Direction.None);\n\n\t\t\tint i = 0;\n\n\t\t\tfor (; ; )\n\t\t\t{\n\t\t\t\tif (coord.X >= 0 && coord.X < this.chunkSize\n\t\t\t\t\t&& coord.Y >= 0 && coord.Y < this.chunkSize\n\t\t\t\t\t&& coord.Z >= 0 && coord.Z < this.chunkSize)\n\t\t\t\t{\n\t\t\t\t\tBox box = c[coord.X, coord.Y, coord.Z];\n\t\t\t\t\tif (box != null && filter(i, box.Type.ID))\n\t\t\t\t\t{\n\t\t\t\t\t\tCoord actualCoord = coord.Move(c.X, c.Y, c.Z);\n\t\t\t\t\t\tactualCoord.Data = box.Type;\n\n\t\t\t\t\t\t// Found intersection\n\n\t\t\t\t\t\tVector3 ray = actualEnd - actualStart;\n\n\t\t\t\t\t\tif (normal == Direction.None)\n\t\t\t\t\t\t\tnormal = DirectionExtensions.GetDirectionFromVector(-Vector3.Normalize(ray));\n\n\t\t\t\t\t\tVector3 norm = normal.GetVector();\n\n\t\t\t\t\t\tVector3 planePosition = new Vector3(actualCoord.X + 0.5f, actualCoord.Y + 0.5f, actualCoord.Z + 0.5f) + norm * 0.5f;\n\n\t\t\t\t\t\treturn new RaycastResult { Coordinate = actualCoord, Normal = normal, Position = this.GetAbsolutePosition(actualStart + (ray * Vector3.Dot((planePosition - actualStart), norm) / Vector3.Dot(ray, norm))) };\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (tx <= ty && tx <= tz)\n\t\t\t\t{\n\t\t\t\t\tif (coord.X == endCoord.X)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\ttx += deltatx;\n\t\t\t\t\tcoord.X += dx;\n\t\t\t\t\tnormal = xDirection;\n\t\t\t\t}\n\t\t\t\telse if (ty <= tz)\n\t\t\t\t{\n\t\t\t\t\tif (coord.Y == endCoord.Y)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tty += deltaty;\n\t\t\t\t\tcoord.Y += dy;\n\t\t\t\t\tnormal = yDirection;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (coord.Z == endCoord.Z)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\ttz += deltatz;\n\t\t\t\t\tcoord.Z += dz;\n\t\t\t\t\tnormal = zDirection;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn new RaycastResult { Coordinate = null };\n\t\t}\n\n\t\tpublic RaycastResult Raycast(Vector3 rayStart, Vector3 ray, float length, Func<int, t, bool> filter = null)\n\t\t{\n\t\t\treturn this.Raycast(rayStart, rayStart + (ray * length), filter);\n\t\t}\n\n\t\tpublic State this[Coord coord]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this[coord.X, coord.Y, coord.Z];\n\t\t\t}\n\t\t}\n\n\t\tpublic State this[int x, int y, int z]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tChunk chunk = this.GetChunk(x, y, z, false);\n\t\t\t\tif (chunk == null)\n\t\t\t\t\treturn Voxel.States.Empty;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tBox box = chunk[x - chunk.X, y - chunk.Y, z - chunk.Z];\n\t\t\t\t\tif (box == null)\n\t\t\t\t\t\treturn Voxel.States.Empty;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn box.Type;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic State this[Vector3 pos]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this[this.GetCoordinate(pos)];\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the coordinates for the specified position in space.\n\t\t/// </summary>\n\t\t/// <param name=\"position\"></param>\n\t\t/// <returns></returns>\n\t\tpublic Coord GetCoordinate(Vector3 position)\n\t\t{\n\t\t\treturn this.GetCoordinateFromRelative(this.GetRelativePosition(position));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the coordinates for the specified position in space.\n\t\t/// </summary>\n\t\t/// <param name=\"position\"></param>\n\t\t/// <returns></returns>\n\t\tpublic Coord GetCoordinateFromRelative(Vector3 pos)\n\t\t{\n\t\t\treturn new Coord\n\t\t\t{\n\t\t\t\tX = (int)Math.Floor(pos.X),\n\t\t\t\tY = (int)Math.Floor(pos.Y),\n\t\t\t\tZ = (int)Math.Floor(pos.Z)\n\t\t\t};\n\t\t}\n\n\t\tpublic Coord GetCoordinate(int x, int y, int z)\n\t\t{\n\t\t\treturn new Coord\n\t\t\t{\n\t\t\t\tX = x,\n\t\t\t\tY = y,\n\t\t\t\tZ = z\n\t\t\t};\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Transforms the given relative position into absolute world space.\n\t\t/// </summary>\n\t\t/// <param name=\"position\"></param>\n\t\t/// <returns></returns>\n\t\tpublic Vector3 GetAbsolutePosition(Vector3 position)\n\t\t{\n\t\t\treturn Vector3.Transform(position - this.Offset, this.Transform);\n\t\t}\n\n\t\tpublic Vector3 GetRelativePosition(Vector3 position)\n\t\t{\n\t\t\treturn Vector3.Transform(position, Matrix.Invert(this.Transform)) + this.Offset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the absolute position in space of the given location (position is the center of the box).\n\t\t/// </summary>\n\t\t/// <param name=\"coord\"></param>\n\t\t/// <returns></returns>\n\t\tpublic Vector3 GetAbsolutePosition(int x, int y, int z)\n\t\t{\n\t\t\treturn Vector3.Transform(new Vector3(x + 0.5f, y + 0.5f, z + 0.5f) - this.Offset, this.Transform);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the relative position in space of the given location (position is the center of the box).\n\t\t/// </summary>\n\t\t/// <param name=\"coord\"></param>\n\t\t/// <returns></returns>\n\t\tpublic Vector3 GetRelativePosition(int x, int y, int z)\n\t\t{\n\t\t\treturn new Vector3(x + 0.5f, y + 0.5f, z + 0.5f) - this.Offset;\n\t\t}\n\n\t\tpublic Vector3 GetAbsolutePosition(Coord coord)\n\t\t{\n\t\t\treturn this.GetAbsolutePosition(coord.X, coord.Y, coord.Z);\n\t\t}\n\n\t\tpublic Vector3 GetRelativePosition(Coord coord)\n\t\t{\n\t\t\treturn this.GetRelativePosition(coord.X, coord.Y, coord.Z);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the box containing the specified position in space.\n\t\t/// </summary>\n\t\t/// <param name=\"position\"></param>\n\t\t/// <returns></returns>\n\t\tpublic Box GetBox(Vector3 position)\n\t\t{\n\t\t\treturn this.GetBox(this.GetCoordinate(position));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the box containing the specified coordinate.\n\t\t/// </summary>\n\t\t/// <param name=\"coord\"></param>\n\t\t/// <returns></returns>\n\t\tpublic Box GetBox(Coord coord)\n\t\t{\n\t\t\treturn this.GetBox(coord.X, coord.Y, coord.Z);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the box containing the specified location, or null if there is none.\n\t\t/// </summary>\n\t\t/// <param name=\"x\"></param>\n\t\t/// <param name=\"y\"></param>\n\t\t/// <param name=\"z\"></param>\n\t\t/// <returns></returns>\n\t\tpublic Box GetBox(int x, int y, int z)\n\t\t{\n\t\t\tChunk chunk = this.GetChunk(x, y, z, false);\n\t\t\tif (chunk == null)\n\t\t\t\treturn null;\n\t\t\telse\n\t\t\t\treturn chunk[x - chunk.X, y - chunk.Y, z - chunk.Z];\n\t\t}\n\t}\n\n\tpublic class DynamicVoxel : Voxel, IUpdateableComponent\n\t{\n\t\tprivate const float defaultLinearDamping = .03f;\n\t\tprivate const float defaultAngularDamping = .15f;\n\n\t\tprivate const float floatingLinearDamping = .4f;\n\t\tprivate const float floatingAngularDamping = .5f;\n\n\t\tprivate bool addedToSpace = false;\n\n\t\t[XmlIgnore]\n\t\tpublic MorphableEntity PhysicsEntity { get; protected set; }\n\n\t\t[XmlIgnore]\n\t\tpublic Command<Collidable, ContactCollection> Collided = new Command<Collidable, ContactCollection>();\n\n\t\tpublic Property<bool> IsAffectedByGravity = new Property<bool> { Value = true };\n\n\t\tpublic Property<bool> IsAlwaysActive = new Property<bool> { Value = false };\n\n\t\tpublic Property<float> KineticFriction = new Property<float> { Value = MaterialManager.DefaultKineticFriction };\n\n\t\tpublic Property<float> StaticFriction = new Property<float> { Value = MaterialManager.DefaultStaticFriction };\n\n\t\tpublic Property<bool> CannotSuspendByDistance = new Property<bool>();\n\n\t\tpublic Property<bool> Dangerous = new Property<bool>();\n\n\t\tprivate bool firstPhysicsUpdate = true;\n\t\tprivate bool physicsDirty;\n\n\t\t[XmlIgnore]\n\t\tpublic Command PhysicsUpdated = new Command();\n\n\t\tpublic DynamicVoxel()\n\t\t\t: this(0, 0, 0)\n\t\t{\n\n\t\t}\n\n\t\tpublic DynamicVoxel(int offsetX, int offsetY, int offsetZ)\n\t\t\t: base(4, 20)\n\t\t{\n\t\t\tthis.OffsetX = offsetX;\n\t\t\tthis.OffsetY = offsetY;\n\t\t\tthis.OffsetZ = offsetZ;\n\t\t}\n\n\t\tprotected override Chunk newChunk()\n\t\t{\n\t\t\tChunk chunk = new Chunk(this.chunkSize);\n\t\t\tchunk.Voxel = this;\n\t\t\treturn chunk;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tthis.PhysicsEntity = new MorphableEntity(new CompoundShape(new CompoundShapeEntry[] { new CompoundShapeEntry(new BoxShape(1, 1, 1), Vector3.Zero, 1.0f) }));\n\t\t\tthis.PhysicsEntity.Tag = this;\n\t\t\tif (this.main.EditorEnabled)\n\t\t\t\tthis.PhysicsEntity.BecomeKinematic();\n\t\t\tbase.Awake();\n\n\t\t\tthis.PhysicsEntity.IsAffectedByGravity = false;\n\t\t\tthis.Add(new SetBinding<bool>(this.IsAffectedByGravity, delegate(bool value)\n\t\t\t{\n\t\t\t\tif (value)\n\t\t\t\t{\n\t\t\t\t\tthis.PhysicsEntity.LinearDamping = DynamicVoxel.defaultLinearDamping;\n\t\t\t\t\tthis.PhysicsEntity.AngularDamping = DynamicVoxel.defaultAngularDamping;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.PhysicsEntity.LinearDamping = DynamicVoxel.floatingLinearDamping;\n\t\t\t\t\tthis.PhysicsEntity.AngularDamping = DynamicVoxel.floatingAngularDamping;\n\t\t\t\t}\n\t\t\t\tthis.PhysicsEntity.IsAffectedByGravity = value;\n\t\t\t\tthis.PhysicsEntity.ActivityInformation.Activate();\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.KineticFriction, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.PhysicsEntity.Material.KineticFriction = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.StaticFriction, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.PhysicsEntity.Material.StaticFriction = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<bool>(this.IsAlwaysActive, delegate(bool value)\n\t\t\t{\n\t\t\t\tthis.PhysicsEntity.ActivityInformation.IsAlwaysActive = value;\n\t\t\t\tthis.PhysicsEntity.ActivityInformation.Activate();\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<Matrix>(this.Transform, delegate(Matrix value)\n\t\t\t{\n\t\t\t\tthis.PhysicsEntity.WorldTransform = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<Vector3>(this.LinearVelocity, delegate(Vector3 value)\n\t\t\t{\n\t\t\t\tthis.PhysicsEntity.LinearVelocity = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<Vector3>(this.AngularVelocity, delegate(Vector3 value)\n\t\t\t{\n\t\t\t\tthis.PhysicsEntity.AngularVelocity = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new CommandBinding(this.OnSuspended, delegate()\n\t\t\t{\n\t\t\t\tif (this.addedToSpace)\n\t\t\t\t{\n\t\t\t\t\tthis.main.Space.SpaceObjectBuffer.Remove(this.PhysicsEntity);\n\t\t\t\t\tthis.addedToSpace = false;\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < this.Chunks.Count; i++)\n\t\t\t\t\tthis.Chunks[i].Deactivate();\n\t\t\t}));\n\n\t\t\tthis.Add(new CommandBinding(this.OnResumed, delegate()\n\t\t\t{\n\t\t\t\tthis.PhysicsEntity.LinearVelocity = Vector3.Zero;\n\t\t\t\tif (!this.addedToSpace && this.PhysicsEntity.Volume > 0.0f && !this.main.EditorEnabled)\n\t\t\t\t{\n\t\t\t\t\tthis.main.Space.SpaceObjectBuffer.Add(this.PhysicsEntity);\n\t\t\t\t\tthis.addedToSpace = true;\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < this.Chunks.Count; i++)\n\t\t\t\t\tthis.Chunks[i].Activate();\n\t\t\t\tthis.PhysicsEntity.ActivityInformation.Activate();\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<bool>(this.CannotSuspendByDistance, delegate(bool value)\n\t\t\t{\n\t\t\t\tthis.Entity.CannotSuspendByDistance = value;\n\t\t\t}));\n\t\t}\n\n\t\tvoid Events_ContactCreated(EntityCollidable sender, Collidable other, BEPUphysics.NarrowPhaseSystems.Pairs.CollidablePairHandler pair, ContactData contact)\n\t\t{\n\t\t\tthis.Collided.Execute(other, pair.Contacts);\n\t\t}\n\n\t\tprotected override void postDeserialization()\n\t\t{\n\t\t\tbase.postDeserialization();\n\t\t\tthis.UpdatePhysicsImmediately();\n\t\t}\n\n\t\tpublic override void updatePhysics()\n\t\t{\n\t\t\tthis.physicsDirty = true;\n\t\t}\n\n\t\tprotected override void transformBinding()\n\t\t{\n\t\t\t// Disable chunk transform binding, we already handle it\n\t\t}\n\n\t\tprivate void updatePhysicsImmediately()\n\t\t{\n\t\t\tfor (int i = 0; i < this.Chunks.Count; i++)\n\t\t\t\tthis.Chunks[i].Activate();\n\n\t\t\tbool hasVolume = false;\n\t\t\tList<CompoundShapeEntry> bodies = new List<CompoundShapeEntry>();\n\t\t\tfloat mass = 0.0f;\n\t\t\tlock (this.MutationLock)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Chunks.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tChunk c = this.Chunks[i];\n\t\t\t\t\tfor (int j = 0; j < c.Boxes.Count; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tBox box = c.Boxes[j];\n\t\t\t\t\t\tif (!box.Type.Fake)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbodies.Add(box.GetCompoundShapeEntry());\n\t\t\t\t\t\t\tmass += box.Width * box.Height * box.Depth * box.Type.Density;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (bodies.Count > 0)\n\t\t\t{\n\t\t\t\tVector3 c;\n\t\t\t\tCompoundShape shape = new CompoundShape(bodies, out c);\n\t\t\t\tthis.PhysicsEntity.Position += Vector3.TransformNormal(c - this.Offset.Value, this.Transform);\n\t\t\t\tthis.Offset.Value = c;\n\t\t\t\tif (!this.main.EditorEnabled && this.EnablePhysics)\n\t\t\t\t{\n\t\t\t\t\thasVolume = true;\n\t\t\t\t\tEntityCollidable collisionInfo = shape.GetCollidableInstance();\n\t\t\t\t\tcollisionInfo.Events.ContactCreated += new BEPUphysics.BroadPhaseEntries.Events.ContactCreatedEventHandler<BEPUphysics.BroadPhaseEntries.MobileCollidables.EntityCollidable>(Events_ContactCreated);\n\t\t\t\t\tcollisionInfo.Tag = this;\n\t\t\t\t\tthis.PhysicsEntity.SetCollisionInformation(collisionInfo, mass);\n\t\t\t\t\tthis.PhysicsEntity.ActivityInformation.Activate();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!this.addedToSpace && hasVolume && !this.Suspended && !this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tthis.main.Space.SpaceObjectBuffer.Add(this.PhysicsEntity);\n\t\t\t\tthis.addedToSpace = true;\n\t\t\t}\n\t\t\telse if (this.addedToSpace && !hasVolume)\n\t\t\t{\n\t\t\t\tthis.main.Space.SpaceObjectBuffer.Remove(this.PhysicsEntity);\n\t\t\t\tthis.addedToSpace = false;\n\t\t\t}\n\n\t\t\tthis.firstPhysicsUpdate = false;\n\t\t}\n\n\t\tpublic void UpdatePhysicsImmediately()\n\t\t{\n\t\t\tthis.physicsDirty = false;\n\t\t\tthis.updatePhysicsImmediately();\n\t\t}\n\n\t\tvoid IUpdateableComponent.Update(float dt)\n\t\t{\n\t\t\tbool dirty = this.physicsDirty;\n\t\t\tif (dirty)\n\t\t\t{\n\t\t\t\tthis.physicsDirty = false;\n\t\t\t\tthis.updatePhysicsImmediately();\n\t\t\t}\n\n\t\t\tif (dirty && !this.firstPhysicsUpdate)\n\t\t\t{\n\t\t\t\tthis.PhysicsUpdated.Execute();\n\t\t\t\tthis.firstPhysicsUpdate = false;\n\t\t\t}\n\n\t\t\tthis.Transform.Value = this.PhysicsEntity.WorldTransform;\n\t\t\tthis.LinearVelocity.Value = this.PhysicsEntity.LinearVelocity;\n\t\t\tthis.AngularVelocity.Value = this.PhysicsEntity.AngularVelocity;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tif (this.addedToSpace)\n\t\t\t{\n\t\t\t\tthis.main.Space.SpaceObjectBuffer.Remove(this.PhysicsEntity);\n\t\t\t\tthis.addedToSpace = false;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/VoxelChaseAI.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Factories\n{\n\tpublic class VoxelChaseAI : Component<Main>, IUpdateableComponent\n\t{\n\t\tprivate Random random = new Random();\n\n\t\tprivate static bool filter(Voxel.State state)\n\t\t{\n\t\t\treturn state != Components.Voxel.States.Empty && !state.Hard;\n\t\t}\n\n\t\tpublic Property<bool> EnableMovement = new Property<bool> { Value = true };\n\t\tpublic Property<Entity.Handle> Voxel = new Property<Entity.Handle>();\n\t\tpublic Property<Voxel.Coord> LastCoord = new Property<Voxel.Coord>();\n\t\tpublic Property<float> Blend = new Property<float>();\n\t\tpublic Property<Voxel.Coord> Coord = new Property<Voxel.Coord>();\n\t\tpublic ListProperty<Voxel.Coord> History = new ListProperty<Voxel.Coord>();\n\t\tpublic Property<bool> EnablePathfinding = new Property<bool> { Value = true };\n\t\tpublic Property<float> Speed = new Property<float> { Value = 8.0f };\n\n\t\tpublic bool HasPath\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.broadphasePath.Count > 0 || this.narrowphasePath.Count > 0;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic Func<Voxel.State, bool> Filter = VoxelChaseAI.filter;\n\t\t[XmlIgnore]\n\t\tpublic Command<Voxel, Voxel.Coord> Moved = new Command<Voxel, Voxel.Coord>();\n\n\t\tpublic Property<Vector3> Target = new Property<Vector3>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Serialize = true;\n\t\t}\n\n\t\tprivate Stack<Voxel.Box> broadphasePath = new Stack<Voxel.Box>();\n\t\tprivate Stack<Voxel.Coord> narrowphasePath = new Stack<Voxel.Coord>();\n\t\tprivate float lastPathCalculation;\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tEntity mapEntity = this.Voxel.Value.Target;\n\t\t\tif (mapEntity == null || !mapEntity.Active)\n\t\t\t{\n\t\t\t\t// Find closest map\n\t\t\t\tint closest = 5;\n\t\t\t\tVoxel.Coord newCoord = default(Voxel.Coord);\n\t\t\t\tforeach (Voxel m in Lemma.Components.Voxel.Voxels)\n\t\t\t\t{\n\t\t\t\t\tVoxel.Coord mCoord = m.GetCoordinate(this.Position);\n\t\t\t\t\tVoxel.Coord? c = m.FindClosestFilledCell(mCoord, closest);\n\t\t\t\t\tif (c.HasValue)\n\t\t\t\t\t{\n\t\t\t\t\t\tmapEntity = m.Entity;\n\t\t\t\t\t\tnewCoord = c.Value;\n\t\t\t\t\t\tclosest = Math.Min(Math.Abs(mCoord.X - newCoord.X), Math.Min(Math.Abs(mCoord.Y - newCoord.Y), Math.Abs(mCoord.Z - newCoord.Z)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (mapEntity == null)\n\t\t\t\t\tthis.Delete.Execute();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.Voxel.Value = mapEntity;\n\t\t\t\t\tthis.Coord.Value = this.LastCoord.Value = newCoord;\n\t\t\t\t\tthis.Blend.Value = 1.0f;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tVoxel m = mapEntity.Get<Voxel>();\n\n\t\t\t\tif (this.EnableMovement)\n\t\t\t\t\tthis.Blend.Value += dt * this.Speed;\n\n\t\t\t\tif (this.Blend > 1.0f)\n\t\t\t\t{\n\t\t\t\t\tthis.Blend.Value = 0.0f;\n\n\t\t\t\t\tVoxel.Coord c = this.Coord.Value;\n\n\t\t\t\t\tthis.Moved.Execute(m, c);\n\n\t\t\t\t\tthis.LastCoord.Value = c;\n\n\t\t\t\t\tif (this.EnablePathfinding)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.broadphasePath.Count == 0 || this.main.TotalTime - this.lastPathCalculation > 1.0f)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.lastPathCalculation = this.main.TotalTime;\n\t\t\t\t\t\t\tVoxel.Coord? targetCoord = m.FindClosestFilledCell(m.GetCoordinate(this.Target));\n\t\t\t\t\t\t\tif (targetCoord.HasValue)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (VoxelAStar.BroadphaseSearch(m, targetCoord.Value, 6, x => x.Type == Lemma.Components.Voxel.States.Reset) == null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Target is not near a reset block\n\t\t\t\t\t\t\t\t\tthis.narrowphasePath.Clear();\n\t\t\t\t\t\t\t\t\tthis.broadphasePath.Clear();\n\t\t\t\t\t\t\t\t\tVoxel.Box box = m.GetBox(c);\n\t\t\t\t\t\t\t\t\tVoxelAStar.Broadphase(m, box, targetCoord.Value, this.Filter, this.broadphasePath);\n\t\t\t\t\t\t\t\t\tif (this.broadphasePath.Count > 0)\n\t\t\t\t\t\t\t\t\t\tthis.broadphasePath.Pop(); // First box is the current one\n\t\t\t\t\t\t\t\t\t//this.debugBroadphase(m, this.broadphasePath);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.narrowphasePath.Count == 0 && this.broadphasePath.Count > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxelAStar.Narrowphase(m, this.Coord, this.broadphasePath.Pop(), this.narrowphasePath);\n\t\t\t\t\t\t\tif (this.narrowphasePath.Count <= 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.broadphasePath.Clear();\n\t\t\t\t\t\t\t\tthis.narrowphasePath.Clear();\n\t\t\t\t\t\t\t\tthis.Blend.Value = 1.0f;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tthis.narrowphasePath.Pop(); // First coordinate is the current one\n\t\t\t\t\t\t\t//this.debugNarrowphase(m, this.narrowphasePath);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.narrowphasePath.Count > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord newCoord = this.narrowphasePath.Pop();\n\t\t\t\t\t\t\tif (this.Filter(m[newCoord]))\n\t\t\t\t\t\t\t\tthis.Coord.Value = newCoord;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.broadphasePath.Clear();\n\t\t\t\t\t\t\t\tthis.narrowphasePath.Clear();\n\t\t\t\t\t\t\t\tthis.Blend.Value = 1.0f;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tVector3 last = m.GetAbsolutePosition(this.LastCoord), current = m.GetAbsolutePosition(this.Coord);\n\t\t\t\tthis.Position.Value = Vector3.Lerp(last, current, this.Blend);\n\t\t\t}\n\t\t}\n\n\t\tprivate void debugBroadphase(Voxel m, Stack<Voxel.Box> path)\n\t\t{\n\t\t\tint i = 0;\n\t\t\tforeach (Voxel.Box b in path)\n\t\t\t{\n\t\t\t\tVector3 start = m.GetRelativePosition(b.X, b.Y, b.Z) - new Vector3(0.1f), end = m.GetRelativePosition(b.X + b.Width, b.Y + b.Height, b.Z + b.Depth) + new Vector3(0.1f);\n\n\t\t\t\tMatrix matrix = Matrix.CreateScale(Math.Abs(end.X - start.X), Math.Abs(end.Y - start.Y), Math.Abs(end.Z - start.Z)) * Matrix.CreateTranslation(new Vector3(-0.5f) + (start + end) * 0.5f);\n\n\t\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\t\tmodel.Filename.Value = \"AlphaModels\\\\box\";\n\t\t\t\tmodel.Color.Value = new Vector3((float)i / (float)path.Count);\n\t\t\t\tmodel.Alpha.Value = 1.0f;\n\t\t\t\tmodel.IsInstanced.Value = false;\n\t\t\t\tmodel.Serialize = false;\n\t\t\t\tmodel.DrawOrder.Value = 11; // In front of water\n\t\t\t\tmodel.CullBoundingBox.Value = false;\n\t\t\t\tmodel.DisableCulling.Value = true;\n\t\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, () => matrix * Matrix.CreateTranslation(-m.Offset.Value) * m.Transform, m.Transform, m.Offset));\n\t\t\t\tthis.main.AddComponent(model);\n\n\t\t\t\tthis.main.AddComponent(new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.FloatMoveTo(model.Alpha, 0.0f, 3.0f),\n\t\t\t\t\tnew Animation.Execute(model.Delete)\n\t\t\t\t));\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\tprivate void debugNarrowphase(Voxel m, Stack<Voxel.Coord> path)\n\t\t{\n\t\t\tint i = 0;\n\t\t\tforeach (Voxel.Coord b in path)\n\t\t\t{\n\t\t\t\tVector3 start = m.GetRelativePosition(b.X, b.Y, b.Z) - new Vector3(0.1f), end = m.GetRelativePosition(b.X + 1, b.Y + 1, b.Z + 1) + new Vector3(0.1f);\n\n\t\t\t\tMatrix matrix = Matrix.CreateScale(Math.Abs(end.X - start.X), Math.Abs(end.Y - start.Y), Math.Abs(end.Z - start.Z)) * Matrix.CreateTranslation(new Vector3(-0.5f) + (start + end) * 0.5f);\n\n\t\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\t\tmodel.Filename.Value = \"AlphaModels\\\\box\";\n\t\t\t\tmodel.Color.Value = new Vector3((float)i / (float)path.Count);\n\t\t\t\tmodel.Alpha.Value = 1.0f;\n\t\t\t\tmodel.IsInstanced.Value = false;\n\t\t\t\tmodel.Serialize = false;\n\t\t\t\tmodel.DrawOrder.Value = 11; // In front of water\n\t\t\t\tmodel.CullBoundingBox.Value = false;\n\t\t\t\tmodel.DisableCulling.Value = true;\n\t\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, () => matrix * Matrix.CreateTranslation(-m.Offset.Value) * m.Transform, m.Transform, m.Offset));\n\t\t\t\tthis.main.AddComponent(model);\n\n\t\t\t\tthis.main.AddComponent(new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.FloatMoveTo(model.Alpha, 0.0f, 3.0f),\n\t\t\t\t\tnew Animation.Execute(model.Delete)\n\t\t\t\t));\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/VoxelFill.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\t[XmlInclude(typeof(CoordinateEntry))]\n\t[XmlInclude(typeof(Property<CoordinateEntry>))]\n\t[XmlInclude(typeof(ListProperty<CoordinateEntry>))]\n\tpublic class VoxelFill : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic class CoordinateEntry\n\t\t{\n\t\t\tpublic Voxel.Coord Coord;\n\t\t\tpublic Vector3 Position;\n\t\t\tpublic float Distance;\n\t\t}\n\n\t\tpublic Property<Entity.Handle> Target = new Property<Entity.Handle>();\n\n\t\tpublic Property<float> IntervalMultiplier = new Property<float> { Value = 0.1f };\n\n\t\tpublic Property<int> Index = new Property<int>();\n\n\t\tpublic Property<float> BlockLifetime = new Property<float> { Value = 0.5f };\n\n\t\tpublic ListProperty<CoordinateEntry> Coords = new ListProperty<CoordinateEntry>();\n\n\t\t// Output properties\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> RumblePosition = new Property<Vector3>();\n\n\t\tprivate float intervalTimer;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.EnabledInEditMode = false;\n\n\t\t\tif (this.main.EditorEnabled)\n\t\t\t\tthis.Coords.Clear();\n\n\t\t\tthis.Add(new CommandBinding(this.Enable, delegate()\n\t\t\t{\n\t\t\t\tif (this.Index > 0)\n\t\t\t\t\treturn; // We're already filling\n\n\t\t\t\tthis.populateCoords();\n\t\t\t\tthis.sortCoords();\n\t\t\t}));\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tif (this.rumbling)\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_BLOCK_RUMBLE, this.Entity);\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t\tthis.populateCoords();\n\t\t}\n\n\t\tprivate void populateCoords()\n\t\t{\n\t\t\tif (this.Coords.Length == 0)\n\t\t\t{\n\t\t\t\tVoxel map = this.Entity.Get<Voxel>();\n\t\t\t\tEntity targetEntity = this.Target.Value.Target;\n\t\t\t\tif (targetEntity != null && targetEntity.Active)\n\t\t\t\t{\n\t\t\t\t\tVoxel m = targetEntity.Get<Voxel>();\n\t\t\t\t\tlock (map.MutationLock)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (CoordinateEntry e in map.Chunks.SelectMany(c => c.Boxes.SelectMany(x => x.GetCoords())).Select(delegate(Voxel.Coord y)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord z = m.GetCoordinate(map.GetAbsolutePosition(y));\n\t\t\t\t\t\t\tz.Data = y.Data;\n\t\t\t\t\t\t\treturn new CoordinateEntry { Coord = z, };\n\t\t\t\t\t\t}))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.Coords.Add(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static List<CoordinateEntry> coordSortCache = new List<CoordinateEntry>();\n\n\t\tprivate void sortCoords()\n\t\t{\n\t\t\tEntity targetEntity = this.Target.Value.Target;\n\t\t\tif (targetEntity != null && targetEntity.Active)\n\t\t\t{\n\t\t\t\tVoxel m = targetEntity.Get<Voxel>();\n\t\t\t\tVector3 focusPoint = this.main.Camera.Position;\n\t\t\t\tforeach (CoordinateEntry entry in this.Coords)\n\t\t\t\t{\n\t\t\t\t\tentry.Position = m.GetAbsolutePosition(entry.Coord);\n\t\t\t\t\tentry.Distance = (focusPoint - entry.Position).LengthSquared();\n\t\t\t\t}\n\n\t\t\t\tList<CoordinateEntry> coordList = VoxelFill.coordSortCache;\n\t\t\t\tcoordList.AddRange(this.Coords);\n\t\t\t\tthis.Coords.Clear();\n\t\t\t\tcoordList.Sort(new LambdaComparer<CoordinateEntry>((x, y) => x.Distance.CompareTo(y.Distance)));\n\t\t\t\tforeach (CoordinateEntry e in coordList)\n\t\t\t\t\tthis.Coords.Add(e);\n\t\t\t\tcoordList.Clear();\n\t\t\t}\n\t\t}\n\n\t\tprivate bool rumbling;\n\t\tprivate Vector3 rumbleSum;\n\t\tprivate const int rumbleCount = 50; // Average the last X block positions to get the position of the rumble\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tintervalTimer += dt;\n\t\t\tEntity targetEntity = this.Target.Value.Target;\n\t\t\tif (targetEntity != null && targetEntity.Active && this.Index < this.Coords.Length)\n\t\t\t{\n\t\t\t\tEffectBlockFactory factory = Factory.Get<EffectBlockFactory>();\n\t\t\t\tVoxel m = targetEntity.Get<Voxel>();\n\n\t\t\t\tfloat interval = 0.03f * this.IntervalMultiplier;\n\n\t\t\t\twhile (intervalTimer > interval && this.Index < this.Coords.Length)\n\t\t\t\t{\n\t\t\t\t\tCoordinateEntry entry = this.Coords[this.Index];\n\t\t\t\t\tEntity blockEntity = factory.CreateAndBind(main);\n\t\t\t\t\tEffectBlock effectBlock = blockEntity.Get<EffectBlock>();\n\t\t\t\t\tentry.Coord.Data.ApplyToEffectBlock(blockEntity.Get<ModelInstance>());\n\t\t\t\t\teffectBlock.CheckAdjacent = false;\n\t\t\t\t\teffectBlock.Offset.Value = m.GetRelativePosition(entry.Coord);\n\t\t\t\t\teffectBlock.DoScale = true;\n\n\t\t\t\t\teffectBlock.StartPosition = entry.Position + new Vector3(8.0f, 20.0f, 8.0f) * this.BlockLifetime.Value;\n\t\t\t\t\teffectBlock.StartOrientation = Quaternion.CreateFromYawPitchRoll(0.15f * this.Index, 0.15f * this.Index, 0);\n\n\t\t\t\t\teffectBlock.TotalLifetime = this.BlockLifetime;\n\t\t\t\t\teffectBlock.Setup(targetEntity, entry.Coord, entry.Coord.Data.ID);\n\t\t\t\t\tmain.Add(blockEntity);\n\n\t\t\t\t\tthis.rumbleSum += entry.Position;\n\t\t\t\t\tint lastIndex = this.Index - rumbleCount;\n\t\t\t\t\tif (lastIndex >= 0)\n\t\t\t\t\t\tthis.rumbleSum -= this.Coords[lastIndex].Position;\n\n\t\t\t\t\tthis.Index.Value++;\n\t\t\t\t\tintervalTimer -= interval;\n\t\t\t\t}\n\t\t\t\tif (this.Coords.Count > 200)\n\t\t\t\t{\n\t\t\t\t\tthis.RumblePosition.Value = this.rumbleSum / Math.Min(this.Index + 1, rumbleCount);\n\t\t\t\t\tif (!this.rumbling)\n\t\t\t\t\t{\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_BLOCK_RUMBLE, this.Entity);\n\t\t\t\t\t\tthis.rumbling = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis.Delete.Execute();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/VoxelSetter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class VoxelSetter : Component<Main>\n\t{\n\t\t// Input properties\n\t\tpublic Property<Entity.Handle> AttachedVoxel = new Property<Entity.Handle>();\n\t\tpublic Property<Voxel.Coord> Coord = new Property<Voxel.Coord>();\n\t\tpublic Property<Voxel.t> State = new Property<Voxel.t>();\n\t\tpublic Property<bool> Contiguous = new Property<bool>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Set = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnSet = new Command();\n\n\t\tpublic Voxel.State GetState()\n\t\t{\n\t\t\tEntity voxelEntity = this.AttachedVoxel.Value.Target;\n\t\t\tif (voxelEntity == null)\n\t\t\t\treturn Voxel.States.Empty;\n\n\t\t\tVoxel map = voxelEntity.Get<Voxel>();\n\t\t\tif (map == null)\n\t\t\t\treturn Voxel.States.Empty;\n\t\t\telse\n\t\t\t\treturn map[this.Coord];\n\t\t}\n\n\t\tprivate void set()\n\t\t{\n\t\t\tEntity voxelEntity = this.AttachedVoxel.Value.Target;\n\t\t\tif (voxelEntity == null)\n\t\t\t\treturn;\n\n\t\t\tVoxel map = voxelEntity.Get<Voxel>();\n\t\t\tif (map == null)\n\t\t\t\treturn;\n\n\t\t\tVoxel.State state = Voxel.States.All[this.State];\n\t\t\tif (this.Contiguous)\n\t\t\t{\n\t\t\t\tlock (map.MutationLock)\n\t\t\t\t{\n\t\t\t\t\tVoxel.Box b = map.GetBox(this.Coord);\n\t\t\t\t\tif (b != null && b.Type != state)\n\t\t\t\t\t{\n\t\t\t\t\t\tList<Voxel.Coord> coords = map.GetContiguousByType(new[] { b }).SelectMany(x => x.GetCoords()).Select(x => x.WithData(state)).ToList();\n\t\t\t\t\t\tmap.Empty(coords, true, true, map);\n\t\t\t\t\t\tmap.Fill(coords, true, map);\n\t\t\t\t\t\tmap.Regenerate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlock (map.MutationLock)\n\t\t\t\t{\n\t\t\t\t\tif (map[this.Coord] != state)\n\t\t\t\t\t{\n\t\t\t\t\t\tmap.Empty(this.Coord, true, true, map);\n\t\t\t\t\t\tmap.Fill(this.Coord, state, true, map);\n\t\t\t\t\t\tmap.Regenerate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.OnSet.Execute();\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.Set.Action = delegate()\n\t\t\t{\n\t\t\t\t// HACK\n\t\t\t\tthis.Entity.Add(new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Delay(0.01f),\n\t\t\t\t\tnew Animation.Execute(this.set)\n\t\t\t\t));\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/VoxelTrigger.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class VoxelTrigger : Component<Main>\n\t{\n\t\t// Output properties\n\t\tpublic Property<bool> Triggered = new Property<bool>();\n\n\t\t// Input properties\n\t\tpublic Property<Voxel.t> State = new Property<Voxel.t>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Entity.Handle> AttachedVoxel = new Property<Entity.Handle>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Voxel.Coord> Coord = new Property<Voxel.Coord>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnTriggerOn = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command OnTriggerOff = new Command();\n\n\t\tprivate CommandBinding<IEnumerable<Voxel.Coord>, Voxel> voxelBinding;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new CommandBinding(this.OnTriggerOn, () => !this.Triggered, delegate()\n\t\t\t{\n\t\t\t\tthis.Triggered.Value = true;\n\t\t\t}));\n\n\t\t\tthis.Add(new CommandBinding(this.OnTriggerOff, () => this.Triggered, delegate()\n\t\t\t{\n\t\t\t\tthis.Triggered.Value = false;\n\t\t\t}));\n\n\t\t\tthis.Add(new ChangeBinding<bool>(this.Triggered, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (!old && value)\n\t\t\t\t\tthis.OnTriggerOn.Execute();\n\t\t\t\telse if (old && !value)\n\t\t\t\t\tthis.OnTriggerOff.Execute();\n\t\t\t}));\n\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t\tthis.Add(new NotifyBinding(this.bindVoxel, this.AttachedVoxel));\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t\tthis.bindVoxel();\n\t\t}\n\n\t\tprivate void bindVoxel()\n\t\t{\n\t\t\tif (this.voxelBinding != null)\n\t\t\t{\n\t\t\t\tthis.Remove(this.voxelBinding);\n\t\t\t\tthis.voxelBinding = null;\n\t\t\t}\n\t\t\tEntity attachedVoxel = this.AttachedVoxel.Value.Target;\n\t\t\tif (attachedVoxel != null && attachedVoxel.Active)\n\t\t\t{\n\t\t\t\tVoxel m = this.AttachedVoxel.Value.Target.Get<Voxel>();\n\t\t\t\tthis.Triggered.Value = m[this.Coord].ID == this.State.Value;\n\t\t\t\tthis.voxelBinding = new CommandBinding<IEnumerable<Voxel.Coord>, Voxel>(m.CellsFilled, delegate(IEnumerable<Voxel.Coord> coords, Voxel v)\n\t\t\t\t{\n\t\t\t\t\tforeach (Voxel.Coord c in coords)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (c.Equivalent(this.Coord))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (m[c].ID == this.State.Value)\n\t\t\t\t\t\t\t\tthis.OnTriggerOn.Execute();\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tthis.OnTriggerOff.Execute();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis.Add(this.voxelBinding);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"State\", this.State);\n\t\t\tthis.Entity.Add(\"OnTriggerOn\", this.OnTriggerOn);\n\t\t\tthis.Entity.Add(\"OnTriggerOff\", this.OnTriggerOff);\n\t\t\tthis.Entity.Add(\"Triggered\", this.Triggered, new PropertyEntry.EditorData { Readonly = true });\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Water.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Water : Component<Main>, IDrawableAlphaComponent, IDrawablePreFrameComponent, IUpdateableComponent\n\t{\n\t\tprivate static List<Water> instances = new List<Water>();\n\n\t\tpublic static IEnumerable<Water> ActiveInstances\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn instances.Where(x => !x.Suspended);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// A struct that represents a single vertex in the\n\t\t/// vertex buffer.\n\t\t/// </summary>\n\t\tprivate struct QuadVertex : IVertexType\n\t\t{\n\t\t\tpublic Vector3 Position;\n\t\t\tpublic Vector2 TexCoord;\n\t\t\tpublic Vector3 Normal;\n\t\t\tpublic VertexDeclaration VertexDeclaration\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn Water.VertexDeclaration;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<int> DrawOrder { get; set; }\n\n\t\tprivate VertexBuffer surfaceVertexBuffer;\n\t\tprivate VertexBuffer underwaterVertexBuffer;\n\n\t\tprivate static VertexDeclaration vertexDeclaration;\n\t\tpublic static VertexDeclaration VertexDeclaration\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (Water.vertexDeclaration == null)\n\t\t\t\t{\n\t\t\t\t\tMicrosoft.Xna.Framework.Graphics.VertexElement[] declElements = new VertexElement[3];\n\t\t\t\t\tdeclElements[0].Offset = 0;\n\t\t\t\t\tdeclElements[0].UsageIndex = 0;\n\t\t\t\t\tdeclElements[0].VertexElementFormat = VertexElementFormat.Vector3;\n\t\t\t\t\tdeclElements[0].VertexElementUsage = VertexElementUsage.Position;\n\t\t\t\t\tdeclElements[1].Offset = sizeof(float) * 3;\n\t\t\t\t\tdeclElements[1].UsageIndex = 0;\n\t\t\t\t\tdeclElements[1].VertexElementFormat = VertexElementFormat.Vector2;\n\t\t\t\t\tdeclElements[1].VertexElementUsage = VertexElementUsage.TextureCoordinate;\n\t\t\t\t\tdeclElements[2].Offset = sizeof(float) * 5;\n\t\t\t\t\tdeclElements[2].UsageIndex = 0;\n\t\t\t\t\tdeclElements[2].VertexElementFormat = VertexElementFormat.Vector3;\n\t\t\t\t\tdeclElements[2].VertexElementUsage = VertexElementUsage.Normal;\n\t\t\t\t\tWater.vertexDeclaration = new VertexDeclaration(declElements);\n\t\t\t\t}\n\t\t\t\treturn Water.vertexDeclaration;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Property<bool> BigWaterShader = new Property<bool>();\n\t\tpublic static Property<float> BigWaterHeight = new Property<float>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<Vector3> Color = new Property<Vector3> { Value = new Vector3(0.7f, 0.9f, 1.0f) };\n\t\tpublic Property<Vector3> UnderwaterColor = new Property<Vector3> { Value = new Vector3(0.0f, 0.07f, 0.13f) };\n\t\tpublic Property<float> Fresnel = new Property<float> { Value = 0.6f };\n\t\tpublic Property<float> Speed = new Property<float> { Value = 0.075f };\n\t\tpublic Property<float> RippleDensity = new Property<float> { Value = 1.0f };\n\t\tpublic Property<bool> EnableReflection = new Property<bool> { Value = true };\n\t\tpublic Property<float> Distortion = new Property<float> { Value = 0.25f };\n\t\tpublic Property<float> Brightness = new Property<float> { Value = 0.1f };\n\t\tpublic Property<float> Clearness = new Property<float> { Value = 0.25f };\n\t\tpublic Property<float> Depth = new Property<float> { Value = 100.0f };\n\t\tpublic Property<float> Refraction = new Property<float> { Value = 0.0f };\n\t\tpublic Property<Vector2> Scale = new Property<Vector2> { Value = new Vector2(100.0f, 100.0f) };\n\t\tpublic Property<bool> CannotSuspendByDistance = new Property<bool>();\n\n\t\tpublic static Water Get(Vector3 pos)\n\t\t{\n\t\t\tfor (int i = 0; i < Water.instances.Count; i++)\n\t\t\t{\n\t\t\t\tWater water = Water.instances[i];\n\t\t\t\tif (water.Fluid.BoundingBox.Contains(pos) != ContainmentType.Disjoint)\n\t\t\t\t\treturn water;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static Water Raycast(Vector3 pos, Vector3 ray, float radius, out Vector3 hit)\n\t\t{\n\t\t\thit = Vector3.Zero;\n\t\t\tif (ray.Y == 0)\n\t\t\t\treturn null;\n\t\t\tfor (int i = 0; i < Water.instances.Count; i++)\n\t\t\t{\n\t\t\t\tWater water = Water.instances[i];\n\t\t\t\tfloat height = water.Position.Value.Y;\n\t\t\t\tfloat distance = (height - pos.Y) / ray.Y;\n\t\t\t\tif (distance > 0 && distance < radius)\n\t\t\t\t{\n\t\t\t\t\tVector3 p = pos + (ray * distance);\n\t\t\t\t\tBoundingBox b = water.Fluid.BoundingBox;\n\t\t\t\t\tif (p.X > b.Min.X && p.Z > b.Min.Z\n\t\t\t\t\t\t&& p.Z < b.Max.X && p.Z < b.Max.Z)\n\t\t\t\t\t{\n\t\t\t\t\t\thit = p;\n\t\t\t\t\t\treturn water;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate Renderer renderer;\n\t\tprivate RenderTarget2D buffer;\n\t\tprivate Effect effect;\n\t\tprivate RenderParameters parameters;\n\t\tprivate Camera camera;\n\n\t\tprivate bool underwater;\n\n\t\t[XmlIgnore]\n\t\tpublic Util.CustomFluidVolume Fluid;\n\n\t\tprivate bool needResize = false;\n\n\t\tprivate static Random random = new Random();\n\n\t\tpublic Water()\n\t\t{\n\t\t\tthis.DrawOrder = new Property<int> { Value = 10 };\n\t\t}\n\n\t\tprivate const float resolutionRatio = 0.25f;\n\n\t\tprivate void resize()\n\t\t{\n\t\t\tPoint size = this.main.ScreenSize;\n\t\t\tsize.X = (int)((float)size.X * Water.resolutionRatio);\n\t\t\tsize.Y = (int)((float)size.Y * Water.resolutionRatio);\n\t\t\tif (this.renderer == null)\n\t\t\t{\n\t\t\t\tthis.renderer = new Renderer(this.main, false, false, false, false, false);\n\t\t\t\tthis.renderer.MotionBlurAmount.Value = 0.0f;\n\t\t\t\tthis.renderer.LightRampTexture.Value = \"LightRamps\\\\default\";\n\t\t\t\tthis.main.AddComponent(this.renderer);\n\t\t\t\tthis.renderer.ReallocateBuffers(size);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis.renderer.ReallocateBuffers(size);\n\n\t\t\tif (this.buffer != null)\n\t\t\t\tthis.buffer.Dispose();\n\t\t\tthis.buffer = new RenderTarget2D(this.main.GraphicsDevice, size.X, size.Y);\n\n\t\t\tthis.needResize = false;\n\t\t}\n\n\t\tprivate void loadEffectAndVertexBuffers()\n\t\t{\n\t\t\tthis.effect = this.main.Content.Load<Effect>(\"Effects\\\\Water\").Clone();\n\t\t\tthis.effect.Parameters[\"NormalMap\" + Model.SamplerPostfix].SetValue(this.main.Content.Load<Texture2D>(\"Textures\\\\water-normal\"));\n\n\t\t\tthis.Color.Reset();\n\t\t\tthis.Scale.Reset();\n\t\t\tthis.Fresnel.Reset();\n\t\t\tthis.Speed.Reset();\n\t\t\tthis.RippleDensity.Reset();\n\t\t\tthis.Distortion.Reset();\n\t\t\tthis.Brightness.Reset();\n\t\t\tthis.Refraction.Reset();\n\t\t\tthis.UnderwaterColor.Reset();\n\t\t\t\n\t\t\t// Can't just call this.Position.Reset() because it will try to write to the Water.BigWaterHeight property\n\t\t\t// which sets a skybox effect parameter. The skybox effect might not have been loaded yet.\n\t\t\tthis.effect.Parameters[\"Position\"].SetValue(this.Position);\n\n\t\t\t// Surface\n\t\t\tthis.surfaceVertexBuffer = new VertexBuffer(this.main.GraphicsDevice, typeof(QuadVertex), Water.VertexDeclaration.VertexStride * 4, BufferUsage.None);\n\t\t\tQuadVertex[] surfaceData = new QuadVertex[4];\n\n\t\t\t// Upper right\n\t\t\tconst float scale = 0.5f;\n\t\t\tsurfaceData[0].Position = new Vector3(scale, 0, scale);\n\t\t\tsurfaceData[0].TexCoord = new Vector2(1, 0);\n\n\t\t\t// Upper left\n\t\t\tsurfaceData[1].Position = new Vector3(-scale, 0, scale);\n\t\t\tsurfaceData[1].TexCoord = new Vector2(0, 0);\n\n\t\t\t// Lower right\n\t\t\tsurfaceData[2].Position = new Vector3(scale, 0, -scale);\n\t\t\tsurfaceData[2].TexCoord = new Vector2(1, 1);\n\n\t\t\t// Lower left\n\t\t\tsurfaceData[3].Position = new Vector3(-scale, 0, -scale);\n\t\t\tsurfaceData[3].TexCoord = new Vector2(0, 1);\n\n\t\t\tsurfaceData[0].Normal = surfaceData[1].Normal = surfaceData[2].Normal = surfaceData[3].Normal = new Vector3(0, 1, 0);\n\n\t\t\tthis.surfaceVertexBuffer.SetData(surfaceData);\n\n\t\t\t// Underwater\n\t\t\tthis.underwaterVertexBuffer = new VertexBuffer(this.main.GraphicsDevice, typeof(QuadVertex), Water.VertexDeclaration.VertexStride * 4, BufferUsage.None);\n\n\t\t\tQuadVertex[] underwaterData = new QuadVertex[4];\n\n\t\t\t// Upper right\n\t\t\tunderwaterData[0].Position = new Vector3(1, 1, 1);\n\t\t\tunderwaterData[0].TexCoord = new Vector2(1, 0);\n\n\t\t\t// Lower right\n\t\t\tunderwaterData[1].Position = new Vector3(1, -1, 1);\n\t\t\tunderwaterData[1].TexCoord = new Vector2(1, 1);\n\n\t\t\t// Upper left\n\t\t\tunderwaterData[2].Position = new Vector3(-1, 1, 1);\n\t\t\tunderwaterData[2].TexCoord = new Vector2(0, 0);\n\n\t\t\t// Lower left\n\t\t\tunderwaterData[3].Position = new Vector3(-1, -1, 1);\n\t\t\tunderwaterData[3].TexCoord = new Vector2(0, 1);\n\n\t\t\tunderwaterData[0].Normal = underwaterData[1].Normal = underwaterData[2].Normal = underwaterData[3].Normal = new Vector3(0, 0, -1);\n\n\t\t\tthis.underwaterVertexBuffer.SetData(underwaterData);\n\t\t}\n\n\t\tpublic void LoadContent(bool reload)\n\t\t{\n\t\t\tthis.loadEffectAndVertexBuffers();\n\t\t\tthis.resize();\n\t\t}\n\n\t\tprivate Property<Vector3> soundPosition = new Property<Vector3>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = true;\n\n\t\t\tthis.Add(new NotifyBinding(main.AlphaDrawablesModified, this.DrawOrder));\n\n\t\t\tthis.Add(new SetBinding<bool>(this.CannotSuspendByDistance, delegate(bool value)\n\t\t\t{\n\t\t\t\tthis.Entity.CannotSuspendByDistance = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new NotifyBinding(delegate() { this.needResize = true; }, this.main.ScreenSize));\n\n\t\t\tAction removeFluid = delegate()\n\t\t\t{\n\t\t\t\tif (this.Fluid.Space != null)\n\t\t\t\t\tthis.main.Space.Remove(this.Fluid);\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_WATER_LOOP, this.Entity);\n\t\t\t};\n\n\t\t\tAction addFluid = delegate()\n\t\t\t{\n\t\t\t\tif (this.Fluid.Space == null && this.Enabled && !this.Suspended)\n\t\t\t\t{\n\t\t\t\t\tthis.main.Space.Add(this.Fluid);\n\t\t\t\t\tif (!this.main.EditorEnabled)\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_WATER_LOOP, this.Entity);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.Add(new CommandBinding(this.OnSuspended, removeFluid));\n\t\t\tthis.Add(new CommandBinding(this.Disable, removeFluid));\n\t\t\tthis.Add(new CommandBinding(this.OnResumed, addFluid));\n\t\t\tthis.Add(new CommandBinding(this.Enable, addFluid));\n\n\t\t\tthis.camera = new Camera();\n\t\t\tthis.main.AddComponent(this.camera);\n\t\t\tthis.parameters = new RenderParameters\n\t\t\t{\n\t\t\t\tCamera = this.camera,\n\t\t\t\tTechnique = Technique.Clip,\n\t\t\t\tReverseCullOrder = true,\n\t\t\t};\n\n\t\t\tthis.Add(new SetBinding<Vector3>(this.Color, delegate(Vector3 value)\n\t\t\t{\n\t\t\t\tthis.effect.Parameters[\"Color\"].SetValue(value);\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<Vector2>(this.Scale, delegate(Vector2 value)\n\t\t\t{\n\t\t\t\tthis.effect.Parameters[\"Scale\"].SetValue(value);\n\t\t\t\tthis.updatePhysics();\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<Vector3>(this.UnderwaterColor, delegate(Vector3 value)\n\t\t\t{\n\t\t\t\tthis.effect.Parameters[\"UnderwaterColor\"].SetValue(value);\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.Fresnel, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.effect.Parameters[\"Fresnel\"].SetValue(value);\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.Speed, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.effect.Parameters[\"Speed\"].SetValue(value);\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.RippleDensity, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.effect.Parameters[\"RippleDensity\"].SetValue(value);\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.Distortion, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.effect.Parameters[\"Distortion\"].SetValue(value);\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.Brightness, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.effect.Parameters[\"Brightness\"].SetValue(value);\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.Refraction, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.effect.Parameters[\"Refraction\"].SetValue(value);\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<Vector3>(this.Position, delegate(Vector3 value)\n\t\t\t{\n\t\t\t\tthis.effect.Parameters[\"Position\"].SetValue(this.Position);\n\t\t\t\tif (this.CannotSuspendByDistance)\n\t\t\t\t\tWater.BigWaterHeight.Value = value.Y;\n\t\t\t\tthis.updatePhysics();\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.Depth, delegate(float value)\n\t\t\t{\n\t\t\t\t this.updatePhysics();\n\t\t\t}));\n\n\t\t\tinstances.Add(this);\n\n\t\t\tthis.Add(new Binding<Vector3>(this.soundPosition,\n\t\t\tdelegate(Vector3 pos)\n\t\t\t{\n\t\t\t\tBoundingBox box = this.Fluid.BoundingBox;\n\t\t\t\tpos.X = Math.Max(box.Min.X, Math.Min(pos.X, box.Max.X));\n\t\t\t\tpos.Y = this.Position.Value.Y;\n\t\t\t\tpos.Z = Math.Max(box.Min.Z, Math.Min(pos.Z, box.Max.Z));\n\t\t\t\treturn pos;\n\t\t\t}, this.main.Camera.Position));\n\t\t\tSound.AttachTracker(this.Entity, this.soundPosition);\n\n\t\t\tif (!this.main.EditorEnabled && this.Enabled && !this.Suspended)\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_WATER_LOOP, this.Entity);\n\t\t}\n\n\t\tprivate void updatePhysics()\n\t\t{\n\t\t\tif (this.Fluid != null)\n\t\t\t\tthis.main.Space.Remove(this.Fluid);\n\n\t\t\tList<Vector3[]> tris = new List<Vector3[]>();\n\t\t\tfloat width = this.Scale.Value.X;\n\t\t\tfloat length = this.Scale.Value.Y;\n\t\t\tVector3 pos = this.Position;\n\n\t\t\ttris.Add(new[]\n\t\t\t{\n\t\t\t\tpos + new Vector3(width / -2, 0, length / -2),\n\t\t\t\tpos + new Vector3(width / 2, 0, length / -2),\n\t\t\t\tpos + new Vector3(width / -2, 0, length / 2)\n\t\t\t});\n\t\t\ttris.Add(new[]\n\t\t\t{\n\t\t\t\tpos + new Vector3(width / -2, 0, length / 2),\n\t\t\t\tpos + new Vector3(width / 2, 0, length / -2),\n\t\t\t\tpos + new Vector3(width / 2, 0, length / 2)\n\t\t\t});\n\n\t\t\tthis.Fluid = new Util.CustomFluidVolume(Vector3.Up, this.main.Space.ForceUpdater.Gravity.Y, tris, this.Depth, 0.8f, 0.997f, 0.2f, this.main.Space.BroadPhase.QueryAccelerator, this.main.Space.ThreadManager);\n\t\t\tthis.main.Space.Add(this.Fluid);\n\t\t}\n\n\t\tprivate bool isVisible(Camera c)\n\t\t{\n\t\t\tVector3 cameraPos = c.Position;\n\t\t\tbool underwater = this.Fluid.BoundingBox.Contains(cameraPos) != ContainmentType.Disjoint;\n\t\t\tif (!underwater && cameraPos.Y < this.Position.Value.Y)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tif (!c.BoundingFrustum.Intersects(this.Fluid.BoundingBox))\n\t\t\t\treturn false;\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\n\t\tvoid IDrawableAlphaComponent.DrawAlpha(Microsoft.Xna.Framework.GameTime time, RenderParameters p)\n\t\t{\n\t\t\tif (!p.IsMainRender || !this.isVisible(p.Camera))\n\t\t\t\treturn;\n\n\t\t\tVector3 cameraPos = p.Camera.Position;\n\t\t\tVector3 pos = this.Position;\n\n\t\t\tRasterizerState originalState = this.main.GraphicsDevice.RasterizerState;\n\t\t\tthis.main.GraphicsDevice.RasterizerState = new RasterizerState { CullMode = CullMode.None };\n\n\t\t\tfloat oldFarPlane = p.Camera.FarPlaneDistance;\n\t\t\tp.Camera.FarPlaneDistance.Value = 1000.0f;\n\n\t\t\tp.Camera.SetParameters(this.effect);\n\t\t\tthis.effect.Parameters[\"ActualFarPlaneDistance\"].SetValue(oldFarPlane);\n\t\t\tthis.effect.Parameters[\"Reflection\" + Model.SamplerPostfix].SetValue(this.buffer);\n\t\t\tthis.effect.Parameters[\"Time\"].SetValue(this.main.TotalTime);\n\t\t\tthis.effect.Parameters[\"Depth\" + Model.SamplerPostfix].SetValue(p.DepthBuffer);\n\t\t\tthis.effect.Parameters[\"Frame\" + Model.SamplerPostfix].SetValue(p.FrameBuffer);\n\t\t\tthis.effect.Parameters[\"CameraPosition\"].SetValue(cameraPos);\n\n\t\t\tbool reflection = this.EnableReflection && this.main.Settings.Reflections;\n\n\t\t\t// Draw surface\n\t\t\tthis.effect.Parameters[\"Clearness\"].SetValue(this.underwater ? 1.0f : this.Clearness);\n\t\t\tthis.effect.CurrentTechnique = this.effect.Techniques[this.underwater || !reflection ? \"Surface\" : \"SurfaceReflection\"];\n\t\t\tthis.effect.CurrentTechnique.Passes[0].Apply();\n\n\t\t\tif (this.surfaceVertexBuffer.IsDisposed)\n\t\t\t\tthis.loadEffectAndVertexBuffers();\n\n\t\t\tthis.main.GraphicsDevice.SetVertexBuffer(this.surfaceVertexBuffer);\n\t\t\tthis.main.GraphicsDevice.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2);\n\t\t\tModel.DrawCallCounter++;\n\t\t\tModel.TriangleCounter += 2;\n\n\t\t\tthis.main.GraphicsDevice.RasterizerState = originalState;\n\n\t\t\tp.Camera.FarPlaneDistance.Value = oldFarPlane;\n\n\t\t\tif (this.underwater)\n\t\t\t{\n\t\t\t\t// Draw underwater stuff\n\t\t\t\tthis.effect.Parameters[\"Clearness\"].SetValue(this.Clearness);\n\t\t\t\tthis.effect.CurrentTechnique = this.effect.Techniques[\"Underwater\"];\n\n\t\t\t\t// Ugh\n\t\t\t\tp.Camera.Position.Value = Vector3.Zero;\n\t\t\t\tp.Camera.SetParameters(this.effect);\n\t\t\t\tp.Camera.Position.Value = cameraPos;\n\n\t\t\t\tthis.effect.CurrentTechnique.Passes[0].Apply();\n\n\t\t\t\tif (this.surfaceVertexBuffer.IsDisposed)\n\t\t\t\t\tthis.loadEffectAndVertexBuffers();\n\t\t\t\tthis.main.GraphicsDevice.SetVertexBuffer(this.underwaterVertexBuffer);\n\t\t\t\tthis.main.GraphicsDevice.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2);\n\t\t\t\tModel.DrawCallCounter++;\n\t\t\t\tModel.TriangleCounter += 2;\n\t\t\t}\n\t\t}\n\n\t\tvoid IDrawablePreFrameComponent.DrawPreFrame(GameTime time, RenderParameters p)\n\t\t{\n\t\t\tbool reflection = this.EnableReflection && this.main.Settings.Reflections;\n\n\t\t\tif (!reflection || !this.isVisible(p.Camera))\n\t\t\t\treturn;\n\n\t\t\tif (this.needResize)\n\t\t\t\tthis.resize();\n\n\t\t\tfloat waterHeight = this.Position.Value.Y;\n\t\t\tif (p.Camera.Position.Value.Y > waterHeight)\n\t\t\t{\n\t\t\t\tthis.parameters.ClipPlanes = new[] { new Plane(Vector3.Up, -waterHeight) };\n\t\t\t\tMatrix reflect = Matrix.CreateTranslation(0.0f, -waterHeight, 0.0f) * Matrix.CreateScale(1.0f, -1.0f, 1.0f) * Matrix.CreateTranslation(0.0f, waterHeight, 0.0f);\n\t\t\t\tthis.camera.Position.Value = Vector3.Transform(p.Camera.Position, reflect);\n\t\t\t\tthis.camera.View.Value = reflect * p.Camera.View;\n\t\t\t\tthis.camera.SetProjectionFromCamera(p.Camera);\n\t\t\t\tthis.renderer.SetRenderTargets(this.parameters);\n\n\t\t\t\tthis.main.DrawScene(this.parameters);\n\n\t\t\t\tthis.renderer.PostProcess(this.buffer, this.parameters);\n\t\t\t}\n\t\t}\n\n\t\tprivate Dictionary<BEPUphysics.BroadPhaseEntries.MobileCollidables.EntityCollidable, float> submerged = new Dictionary<BEPUphysics.BroadPhaseEntries.MobileCollidables.EntityCollidable, float>();\n\n\t\tprivate const float speedMassVolumeCoefficient = 1.0f / 50.0f;\n\n\t\tprivate List<KeyValuePair<BEPUphysics.BroadPhaseEntries.MobileCollidables.EntityCollidable, float>> submergedCache = new List<KeyValuePair<BEPUphysics.BroadPhaseEntries.MobileCollidables.EntityCollidable, float>>();\n\t\tvoid IUpdateableComponent.Update(float dt)\n\t\t{\n\t\t\tif (this.main.Paused)\n\t\t\t\treturn;\n\n\t\t\tbool newUnderwater = this.Fluid.BoundingBox.Contains(this.main.Camera.Position) != ContainmentType.Disjoint;\n\t\t\tif (newUnderwater != this.underwater)\n\t\t\t\tAkSoundEngine.SetState(AK.STATES.WATER.GROUP, newUnderwater ? AK.STATES.WATER.STATE.UNDERWATER : AK.STATES.WATER.STATE.NORMAL);\n\t\t\tthis.underwater = newUnderwater;\n\n\t\t\tint drawOrder = this.CannotSuspendByDistance && newUnderwater ? 10 : -15;\n\t\t\tif (this.DrawOrder != drawOrder)\n\t\t\t\tthis.DrawOrder.Value = drawOrder;\n\n\t\t\tWater.BigWaterShader.Value = this.CannotSuspendByDistance && !newUnderwater;\n\n\t\t\tfloat waterHeight = this.Position.Value.Y;\n\n\t\t\tfloat time = this.main.TotalTime;\n\n\t\t\tlock (this.Fluid.NotifyEntries)\n\t\t\t{\n\t\t\t\tforeach (BEPUphysics.BroadPhaseEntries.MobileCollidables.EntityCollidable collidable in this.Fluid.NotifyEntries)\n\t\t\t\t{\n\t\t\t\t\tif (collidable.Entity == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tfloat speed = collidable.Entity.LinearVelocity.Length();\n\n\t\t\t\t\tif (speed > 9.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat volume = Math.Min(speed * collidable.Entity.Mass * speedMassVolumeCoefficient, 1.0f);\n\t\t\t\t\t\tif (volume > 0.1f && !this.submerged.ContainsKey(collidable))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tuint temp = Sound.RegisterTemp(collidable.Entity.Position);\n\t\t\t\t\t\t\tif (collidable.Entity.Mass > 40.0f)\n\t\t\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_WATER_SPLASH_HEAVY, temp);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_WATER_SPLASH, temp);\n\t\t\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_WATER_SPLASH_VOLUME, volume, temp);\n\t\t\t\t\t\t\tAkSoundEngine.UnregisterTemp(temp);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (speed > 5.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\tcollidable.UpdateBoundingBox();\n\t\t\t\t\t\tWater.SplashParticles(this.main, collidable.BoundingBox, collidable.Tag as Voxel, waterHeight);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.submerged[collidable] = time;\n\t\t\t\t}\n\t\t\t\tthis.Fluid.NotifyEntries.Clear();\n\t\t\t}\n\n\t\t\tthis.submergedCache.AddRange(this.submerged);\n\t\t\tfor (int i = 0; i < this.submergedCache.Count; i++)\n\t\t\t{\n\t\t\t\tvar p = this.submergedCache[i];\n\t\t\t\tif (time - p.Value > 0.1f)\n\t\t\t\t{\n\t\t\t\t\tif (p.Key.Entity != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat speed = p.Key.Entity.LinearVelocity.Y;\n\t\t\t\t\t\tif (speed > 2.0f)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat volume = Math.Min(speed * p.Key.Entity.Mass * speedMassVolumeCoefficient, 1.0f);\n\t\t\t\t\t\t\tif (volume > 0.1f)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tuint temp = Sound.RegisterTemp(p.Key.Entity.Position);\n\t\t\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_WATER_SPLASH_OUT, temp);\n\t\t\t\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_WATER_SPLASH_VOLUME, volume, temp);\n\t\t\t\t\t\t\t\tAkSoundEngine.UnregisterTemp(temp);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.submerged.Remove(p.Key);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.submergedCache.Clear();\n\t\t}\n\n\t\tpublic static void SplashParticles(Main main, Vector3 pos, float radius)\n\t\t{\n\t\t\tfloat radius_squared = radius * radius;\n\t\t\tVector3[] particlePositions = new Vector3[5 * (int)radius_squared];\n\n\t\t\tVector3 min = pos + new Vector3(-radius, 0, -radius);\n\n\t\t\tint particleIndex = 0;\n\t\t\tfor (int i = 0; i < particlePositions.Length; i++)\n\t\t\t{\n\t\t\t\tVector3 particle = particlePositions[particleIndex] = new Vector3\n\t\t\t\t(\n\t\t\t\t\tmin.X + ((float)random.NextDouble() * 2.0f * radius),\n\t\t\t\t\tpos.Y,\n\t\t\t\t\tmin.Z + ((float)random.NextDouble() * 2.0f * radius)\n\t\t\t\t);\n\t\t\t\tif ((particle - pos).LengthSquared() < radius_squared)\n\t\t\t\t\tparticleIndex++;\n\t\t\t}\n\n\t\t\tParticleEmitter.Emit(main, \"Splash\", particlePositions.Take(particleIndex));\n\n\t\t\tParticleEmitter.Emit(main, \"BigSplash\", particlePositions.Take(particleIndex / 5));\n\t\t}\n\n\t\tpublic static void SplashParticles(Main main, BoundingBox boundingBox, Voxel v, float waterHeight)\n\t\t{\n\t\t\tVector3 diff = boundingBox.Max - boundingBox.Min;\n\t\t\tVector3[] particlePositions = new Vector3[5 * (int)(diff.X * diff.Z)];\n\n\t\t\tint particleIndex = 0;\n\t\t\tfor (int i = 0; i < particlePositions.Length; i++)\n\t\t\t{\n\t\t\t\tVector3 pos = particlePositions[particleIndex] = new Vector3\n\t\t\t\t(\n\t\t\t\t\tboundingBox.Min.X + ((float)random.NextDouble() * diff.X),\n\t\t\t\t\twaterHeight,\n\t\t\t\t\tboundingBox.Min.Z + ((float)random.NextDouble() * diff.Z)\n\t\t\t\t);\n\t\t\t\tif (v == null || v[pos] != Voxel.States.Empty)\n\t\t\t\t\tparticleIndex++;\n\t\t\t}\n\n\t\t\tParticleEmitter.Emit(main, \"Splash\", particlePositions.Take(particleIndex));\n\n\t\t\tParticleEmitter.Emit(main, \"BigSplash\", particlePositions.Take(particleIndex / 5));\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tthis.camera.Delete.Execute();\n\t\t\tthis.effect.Dispose();\n\t\t\tthis.renderer.Delete.Execute();\n\t\t\tthis.buffer.Dispose();\n\t\t\tthis.surfaceVertexBuffer.Dispose();\n\t\t\tthis.underwaterVertexBuffer.Dispose();\n\t\t\tif (this.Fluid.Space != null)\n\t\t\t\tthis.main.Space.Remove(this.Fluid);\n\t\t\tinstances.Remove(this);\n\t\t\tbase.delete();\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_WATER_LOOP, this.Entity);\n\t\t\tWater.BigWaterShader.Value = false;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Components/World.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma.Components\n{\n\tpublic class World : Component<Main>, IUpdateableComponent, IGraphicsComponent\n\t{\n\t\tpublic static readonly Color DefaultBackgroundColor = new Color(16.0f / 255.0f, 26.0f / 255.0f, 38.0f / 255.0f, 1.0f);\n\n\t\t[XmlIgnore]\n\t\tpublic DialogueForest DialogueForest = new DialogueForest();\n\n\t\tpublic Property<string> LightRampTexture = new Property<string> { Value = \"LightRamps\\\\default\" };\n\t\tpublic Property<string> EnvironmentMap = new Property<string> { Value = \"EnvironmentMaps\\\\env0\" };\n\t\tpublic Property<Vector3> EnvironmentColor = new Property<Vector3> { Value = Vector3.One };\n\t\tpublic Property<Color> BackgroundColor = new Property<Color> { Value = World.DefaultBackgroundColor };\n\t\tpublic Property<float> FarPlaneDistance = new Property<float> { Value = 100.0f };\n\t\tpublic Property<Vector3> Gravity = new Property<Vector3> { Value = new Vector3(0.0f, -18.0f, -0.0f) };\n\t\tpublic Property<string> UUID = new Property<string>();\n\t\tpublic Property<Entity.Handle> ThumbnailCamera = new Property<Entity.Handle>();\n\t\tpublic Property<string> OverlayTexture = new Property<string>();\n\t\tpublic Property<float> OverlayTiling = new Property<float> { Value = 1.0f };\n\t\tpublic Property<float> CameraShakeAmount = new Property<float>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Texture2D> OverlayTextureHandle = new Property<Texture2D>();\n\n\t\tprivate Vector3 lastUpdatedCameraPosition = new Vector3(float.MinValue);\n\t\tprivate bool lastFrameUpdated = false;\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Zone> CurrentZone = new Property<Zone>();\n\n\t\tpublic void NewUUID()\n\t\t{\n\t\t\tthis.UUID.Value = Guid.NewGuid().ToString().Replace(\"-\", string.Empty);\n\t\t}\n\n\t\tpublic void LoadContent(bool reload)\n\t\t{\n\t\t\tif (reload)\n\t\t\t\tthis.OverlayTexture.Changed();\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledInEditMode = true;\n\t\t\tthis.EnabledWhenPaused = false;\n\n\t\t\tif (string.IsNullOrEmpty(this.UUID))\n\t\t\t\tthis.NewUUID();\n\n\t\t\tthis.Add(new Binding<Texture2D, string>(this.OverlayTextureHandle, file => file == null ? (Texture2D)null : this.main.MapContent.Load<Texture2D>(file), this.OverlayTexture));\n\t\t\tthis.Add(new Binding<string>(this.main.Renderer.LightRampTexture, this.LightRampTexture));\n\t\t\tthis.Add(new Binding<string>(this.main.LightingManager.EnvironmentMap, this.EnvironmentMap));\n\t\t\tthis.Add(new Binding<Vector3>(this.main.LightingManager.EnvironmentColor, this.EnvironmentColor));\n\t\t\tthis.Add(new Binding<Color>(this.main.LightingManager.BackgroundColor, this.BackgroundColor));\n\t\t\tthis.Add(new Binding<float>(this.main.Camera.FarPlaneDistance, this.FarPlaneDistance));\n\n\t\t\tthis.Add(new SetBinding<Vector3>(this.Gravity, delegate(Vector3 value)\n\t\t\t{\n\t\t\t\tthis.main.Space.ForceUpdater.Gravity = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new CommandBinding<Entity>(this.main.EntityAdded, delegate(Entity e)\n\t\t\t{\n\t\t\t\tif (!e.CannotSuspend)\n\t\t\t\t\tprocessEntity(e, this.CurrentZone, getActiveBoundingBoxes(this.main.Camera, this.CurrentZone), this.main.Camera.Position, this.main.Camera.FarPlaneDistance);\n\t\t\t}));\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (PlayerDataFactory.Instance == null && !this.main.EditorEnabled)\n\t\t\t\tthis.main.Add(Factory.Get<PlayerDataFactory>().CreateAndBind(main));\n\t\t}\n\n\t\tprivate static bool boxesContain(IEnumerable<NonAxisAlignedBoundingBox> boxes, Vector3 position)\n\t\t{\n\t\t\tforeach (NonAxisAlignedBoundingBox box in boxes)\n\t\t\t{\n\t\t\t\tif (box.BoundingBox.Contains(Vector3.Transform(position, box.Transform)) != ContainmentType.Disjoint)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate static void processMap(Voxel map, IEnumerable<NonAxisAlignedBoundingBox> boxes)\n\t\t{\n\t\t\tfor (int i = 0; i < map.Chunks.Count; i++)\n\t\t\t{\n\t\t\t\tVoxel.Chunk chunk = map.Chunks[i];\n\t\t\t\tBoundingBox absoluteChunkBoundingBox = chunk.RelativeBoundingBox.Transform(map.Transform);\n\t\t\t\tbool active = false;\n\t\t\t\tforeach (NonAxisAlignedBoundingBox box in boxes)\n\t\t\t\t{\n\t\t\t\t\tif (box.BoundingBox.Intersects(absoluteChunkBoundingBox.Transform(box.Transform)))\n\t\t\t\t\t{\n\t\t\t\t\t\tactive = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (chunk.Active && !active)\n\t\t\t\t\tchunk.Deactivate();\n\t\t\t\telse if (!chunk.Active && active)\n\t\t\t\t\tchunk.Activate();\n\t\t\t}\n\t\t}\n\n\t\tprivate static void processEntity(Entity entity, Zone currentZone, IEnumerable<NonAxisAlignedBoundingBox> boxes, Vector3 cameraPosition, float suspendDistance)\n\t\t{\n\t\t\tVoxel map = entity.Get<Voxel>();\n\t\t\tif (map != null && !typeof(DynamicVoxel).IsAssignableFrom(map.GetType()))\n\t\t\t\tprocessMap(map, boxes);\n\t\t\telse\n\t\t\t{\n\t\t\t\tTransform transform = entity.Get<Transform>();\n\t\t\t\tbool hasPosition = transform != null;\n\n\t\t\t\tVector3 pos = Vector3.Zero;\n\n\t\t\t\tif (hasPosition)\n\t\t\t\t\tpos = transform.Position;\n\n\t\t\t\tif (map != null)\n\t\t\t\t{\n\t\t\t\t\t// Dynamic map\n\t\t\t\t\thasPosition = true;\n\t\t\t\t\tpos = Vector3.Transform(Vector3.Zero, map.Transform);\n\t\t\t\t\tsuspendDistance += Math.Max(Math.Max(map.MaxX - map.MinX, map.MaxY - map.MinY), map.MaxZ - map.MinZ) * 0.5f;\n\t\t\t\t}\n\n\t\t\t\tbool suspended;\n\t\t\t\tif (currentZone != null && currentZone.Exclusive) // Suspend everything outside the current zone, unless it's connected\n\t\t\t\t{\n\t\t\t\t\tsuspended = hasPosition && !boxesContain(boxes, pos);\n\t\t\t\t\t// Allow the editor to reverse the decision\n\t\t\t\t\tif (currentZone.ConnectedEntities.Contains(entity))\n\t\t\t\t\t\tsuspended = !suspended;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Only suspend things that are in a different (exclusive) zone, or that are just too far away\n\t\t\t\t\tsuspended = false;\n\t\t\t\t\tif (hasPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!entity.CannotSuspendByDistance && !boxesContain(boxes, pos) && (pos - cameraPosition).Length() > suspendDistance)\n\t\t\t\t\t\t\tsuspended = true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int i = 0; i < Zone.Zones.Count; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tZone z = Zone.Zones[i];\n\t\t\t\t\t\t\t\tif (z != currentZone && z.Exclusive && z.BoundingBox.Value.Contains(Vector3.Transform(pos, Matrix.Invert(z.Transform))) != ContainmentType.Disjoint)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tsuspended = true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Allow the editor to reverse the decision\n\t\t\t\t\tif (currentZone != null && currentZone.ConnectedEntities.Contains(entity))\n\t\t\t\t\t\tsuspended = !suspended;\n\t\t\t\t}\n\n\t\t\t\tentity.SetSuspended(suspended);\n\t\t\t}\n\t\t}\n\n\t\tprivate class NonAxisAlignedBoundingBox\n\t\t{\n\t\t\tpublic BoundingBox BoundingBox;\n\t\t\tpublic Matrix Transform;\n\t\t}\n\n\t\tprivate static IEnumerable<NonAxisAlignedBoundingBox> getActiveBoundingBoxes(Camera camera, Zone currentZone)\n\t\t{\n\t\t\tif (currentZone == null)\n\t\t\t{\n\t\t\t\tVector3 pos = camera.Position;\n\t\t\t\tfloat radius = camera.FarPlaneDistance;\n\t\t\t\treturn new[] { new NonAxisAlignedBoundingBox { BoundingBox = new BoundingBox(pos - new Vector3(radius), pos + new Vector3(radius)), Transform = Matrix.Identity } };\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn Zone.GetConnectedZones(currentZone).Select(x => new NonAxisAlignedBoundingBox { BoundingBox = x.BoundingBox, Transform = Matrix.Invert(x.Transform) }).ToList();\n\t\t}\n\n\t\tprivate void updateZones(Zone newZone)\n\t\t{\n\t\t\tthis.CurrentZone.Value = newZone;\n\n\t\t\tif (newZone == null)\n\t\t\t\tthis.main.LightingManager.EnableDetailGlobalShadowMap.Value = true;\n\t\t\telse\n\t\t\t\tthis.main.LightingManager.EnableDetailGlobalShadowMap.Value = newZone.DetailedShadows;\n\n\t\t\tIEnumerable<NonAxisAlignedBoundingBox> boxes = getActiveBoundingBoxes(this.main.Camera, newZone);\n\t\t\tVector3 cameraPosition = this.main.Camera.Position;\n\t\t\tfloat suspendDistance = this.main.Camera.FarPlaneDistance;\n\t\t\tfor (int i = 0; i < this.main.Entities.Count; i++)\n\t\t\t{\n\t\t\t\tEntity e = this.main.Entities[i];\n\t\t\t\tif (!e.CannotSuspend)\n\t\t\t\t\tprocessEntity(e, newZone, boxes, cameraPosition, suspendDistance);\n\t\t\t}\n\n\t\t\tthis.lastUpdatedCameraPosition = this.main.Camera.Position;\n\t\t}\n\n\t\tpublic void UpdateZones()\n\t\t{\n\t\t\tthis.updateZones(Zone.Get(this.main.Camera.Position));\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\t// Update every other frame\n\t\t\tif (this.lastFrameUpdated)\n\t\t\t{\n\t\t\t\tthis.lastFrameUpdated = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.lastFrameUpdated = true;\n\n\t\t\tZone newZone = Zone.Get(this.main.Camera.Position);\n\n\t\t\tif (newZone != this.CurrentZone.Value || (newZone == null && (this.main.Camera.Position - this.lastUpdatedCameraPosition).Length() > 10.0f))\n\t\t\t\tthis.updateZones(newZone);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Components/Zone.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Zone : Component<Main>\n\t{\n\t\tpublic enum BuildMode { CanBuild, NoBuild, ExclusiveBuild };\n\t\tpublic enum ReverbMode { None, Room, Subtle }\n\n\t\tpublic Property<ReverbMode> Reverb = new Property<ReverbMode>();\n\n\t\tpublic Property<bool> CanSpawn = new Property<bool> { Value = true };\n\n\t\tpublic static List<Zone> Zones = new List<Zone>();\n\n\t\tpublic ListProperty<Entity.Handle> ConnectedEntities = new ListProperty<Entity.Handle>();\n\n\t\tpublic Property<Entity.Handle> Parent = new Property<Entity.Handle>();\n\n\t\tpublic Property<Matrix> Transform = new Property<Matrix>();\n\n\t\tpublic Property<BoundingBox> BoundingBox = new Property<BoundingBox> { Value = new BoundingBox(new Vector3(-5.0f), new Vector3(5.0f)) };\n\n\t\tpublic Property<bool> Exclusive = new Property<bool> { Value = true };\n\n\t\tpublic Property<int> Priority = new Property<int> { Value = 0 };\n\n\t\tpublic Property<BuildMode> Build = new Property<BuildMode> { Value = BuildMode.CanBuild };\n\n\t\tpublic Property<bool> RiftProof = new Property<bool>();\n\n\t\tpublic Property<bool> DetailedShadows = new Property<bool> { Value = true };\n\n\t\tpublic static IEnumerable<Zone> GetConnectedZones(Zone zone)\n\t\t{\n\t\t\tIEnumerable<Zone> result = new Zone[] { zone };\n\t\t\tforeach (Entity e in zone.ConnectedEntities)\n\t\t\t{\n\t\t\t\tZone z;\n\t\t\t\tif (e != null && (z = e.Get<Zone>()) != null)\n\t\t\t\t\tresult = result.Concat(Zone.GetConnectedZones(z));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tZone.Zones.Add(this);\n\t\t\tthis.Add(new CommandBinding(this.Delete, delegate() { Zone.Zones.Remove(this); }));\n\n\t\t\tIBinding[] parentBindings = null;\n\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (parentBindings != null)\n\t\t\t\t{\n\t\t\t\t\tforeach (IBinding binding in parentBindings)\n\t\t\t\t\t\tthis.Remove(binding);\n\t\t\t\t}\n\n\t\t\t\tEntity parent = this.Parent.Value.Target;\n\t\t\t\tif (parent != null)\n\t\t\t\t{\n\t\t\t\t\tZone z = parent.Get<Zone>();\n\t\t\t\t\tif (z != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tparentBindings = new IBinding[]\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnew TwoWayBinding<bool>(z.Exclusive, this.Exclusive),\n\t\t\t\t\t\t\tnew TwoWayBinding<bool>(z.DetailedShadows, this.DetailedShadows),\n\t\t\t\t\t\t\tnew TwoWayBinding<BuildMode>(z.Build, this.Build),\n\t\t\t\t\t\t\tnew TwoWayBinding<bool>(z.RiftProof, this.RiftProof),\n\t\t\t\t\t\t};\n\t\t\t\t\t\tforeach (IBinding binding in parentBindings)\n\t\t\t\t\t\t\tthis.Add(binding);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, this.Parent));\n\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tLemma.Factories.WorldFactory.Instance.Get<World>().UpdateZones();\n\t\t\t}, this.Parent, this.Exclusive, this.BoundingBox, this.Transform));\n\n\t\t\tthis.main.AddComponent(new PostInitialization(this.Parent.Reset));\n\t\t}\n\n\t\tpublic bool Contains(Vector3 x)\n\t\t{\n\t\t\treturn this.BoundingBox.Value.Contains(Vector3.Transform(x, Matrix.Invert(this.Transform))) == ContainmentType.Contains;\n\t\t}\n\n\t\tpublic static Zone Get(Vector3 x)\n\t\t{\n\t\t\tZone result = null;\n\t\t\tint minPriority = int.MaxValue;\n\t\t\tforeach (Zone z in Zone.Zones)\n\t\t\t{\n\t\t\t\tif (z.Contains(x))\n\t\t\t\t{\n\t\t\t\t\tZone zone = z;\n\t\t\t\t\twhile (zone.Parent.Value.Target != null)\n\t\t\t\t\t\tzone = zone.Parent.Value.Target.Get<Zone>();\n\t\t\t\t\tif (zone.Priority < minPriority)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult = zone;\n\t\t\t\t\t\tminPriority = zone.Priority;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic static bool CanSpawnAt(Vector3 x)\n\t\t{\n\t\t\tZone z = Zone.Get(x);\n\t\t\treturn z == null || z.CanSpawn.Value;\n\t\t}\n\n\t\tpublic static uint MaxAuxSend = 1;\n\t\tpublic static uint AuxSend(Vector3 pos, AkAuxSendArray array)\n\t\t{\n\t\t\tarray.Reset();\n\t\t\tZone z = Zone.Get(pos);\n\t\t\tif (z == null)\n\t\t\t\treturn 0;\n\t\t\telse\n\t\t\t{\n\t\t\t\tuint count;\n\t\t\t\tswitch (z.Reverb.Value)\n\t\t\t\t{\n\t\t\t\t\tcase ReverbMode.Room:\n\t\t\t\t\t\tarray.Add(AK.AUX_BUSSES.REVERB, 1.0f);\n\t\t\t\t\t\tcount = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ReverbMode.Subtle:\n\t\t\t\t\t\tarray.Add(AK.AUX_BUSSES.REVERB_SUBTLE, 1.0f);\n\t\t\t\t\t\tcount = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn count;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool CanBuild(Vector3 pos)\n\t\t{\n\t\t\tbool defaultValue = true;\n\t\t\tforeach (Zone z in Zone.Zones)\n\t\t\t{\n\t\t\t\tbool inZone = z.Contains(pos);\n\t\t\t\tif (inZone)\n\t\t\t\t{\n\t\t\t\t\tif (z.Build == Zone.BuildMode.NoBuild)\n\t\t\t\t\t\tdefaultValue = false;\n\t\t\t\t\telse if (z.Build == Zone.BuildMode.CanBuild)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if (z.Build == Zone.BuildMode.ExclusiveBuild)\n\t\t\t\t\tdefaultValue = false;\n\t\t\t}\n\t\t\treturn defaultValue;\n\t\t}\n\t\t\n\t\tpublic static bool CanSpawnRift(Vector3 pos)\n\t\t{\n\t\t\tforeach (Zone z in Zone.Zones)\n\t\t\t{\n\t\t\t\tif (z.Contains(pos) && z.RiftProof)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Console/AutoConCommand.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Lemma.Console\n{\n\t[AttributeUsage(AttributeTargets.Method)]\n\tpublic class AutoConCommand : System.Attribute\n\t{\n\t\tpublic readonly string ConVarName;\n\t\tpublic readonly string ConVarDesc;\n\t\tpublic AutoConCommand(string name, string description)\n\t\t{\n\t\t\tthis.ConVarName = name;\n\t\t\tthis.ConVarDesc = description;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Console/AutoConVar.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Lemma.Console\n{\n\t[AttributeUsage(AttributeTargets.Field)]\n\tpublic class AutoConVar : System.Attribute\n\t{\n\t\tpublic readonly string ConVarName;\n\t\tpublic readonly string ConVarDesc;\n\t\tpublic AutoConVar(string name, string description)\n\t\t{\n\t\t\tthis.ConVarName = name;\n\t\t\tthis.ConVarDesc = description;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Console/ConCommand.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Runtime.Remoting.Messaging;\nusing System.Text;\nusing System.Windows.Forms.VisualStyles;\nusing ComponentBind;\n\nnamespace Lemma.Console\n{\n\tpublic class ConCommand\n\t{\n\t\tpublic Property<string> Name = new Property<string>();\n\t\tpublic Property<string> Description = new Property<string>();\n\t\tpublic Property<Action<ArgCollection>> OnCalled = new Property<Action<ArgCollection>>();\n\t\tpublic Property<CommandArgument[]> Arguments = new Property<CommandArgument[]>();\n\n\n\t\tpublic int NumArgs\n\t\t{\n\t\t\tget { return Arguments.Value.Length; }\n\t\t}\n\n\t\tpublic int NumRequiredArgs\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tint ret = 0;\n\t\t\t\tforeach (var arg in Arguments.Value)\n\t\t\t\t\tif (!arg.Optional) ret++;\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\n\t\tpublic int NumOptionalArgs\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tint ret = 0;\n\t\t\t\tforeach (var arg in Arguments.Value)\n\t\t\t\t\tif (arg.Optional) ret++;\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t}\n\n\t\t//Only one constructor; OnCalled needs to be set. It's a command.\n\t\tpublic ConCommand(string name, string description, Action<ArgCollection> onCalled, params CommandArgument[] args)\n\t\t{\n\t\t\tthis.Name.Value = name;\n\t\t\tthis.Description.Value = description;\n\t\t\tthis.OnCalled.Value = onCalled;\n\t\t\tthis.Arguments.Value = args;\n\t\t}\n\n\t\tpublic void SetArgs(CommandArgument[] args)\n\t\t{\n\t\t\tbool pastOptional = false;\n\t\t\tforeach (var arg in args)\n\t\t\t{\n\t\t\t\tif (arg.Optional) pastOptional = true;\n\t\t\t\tif (!arg.Optional && pastOptional) throw new Exception(\"Cannot define a non-optional argument after an optional argument has been defined.\");\n\t\t\t\tif (string.IsNullOrEmpty(arg.Name)) throw new Exception(\"Empty or null name for command argument\");\n\t\t\t\tif (arg.CommandType == null) throw new Exception(\"Invalid type for command argument\");\n\t\t\t}\n\t\t\tthis.Arguments.Value = args;\n\t\t}\n\n\t\tpublic ParsedArgument[] ParseArguments(ConsoleParser.ParseResult.ParseToken[] tokens)\n\t\t{\n\t\t\tif (tokens == null) return null;\n\t\t\tList<ParsedArgument> ret = new List<ParsedArgument>();\n\n\t\t\tint curArg = 0;\n\t\t\tforeach (var token in tokens)\n\t\t\t{\n\t\t\t\tif (token.Type == ConsoleParser.ParseResult.ParseToken.TokenType.CmdOrVar) continue;\n\t\t\t\tCommandArgument arg = Arguments.Value[curArg];\n\t\t\t\tif (!arg.IsGoodValue(token.Value)) return null;\n\n\t\t\t\tParsedArgument newArg = new ParsedArgument()\n\t\t\t\t{\n\t\t\t\t\tName = arg.Name,\n\t\t\t\t\tCommandType = arg.CommandType,\n\t\t\t\t\tStrValue = token.Value,\n\t\t\t\t\tValue = arg.GetConvertedValue(token.Value)\n\t\t\t\t};\n\t\t\t\tcurArg++;\n\t\t\t\tret.Add(newArg);\n\t\t\t}\n\n\t\t\t//Required argument(s) not passed.\n\t\t\tif (curArg < NumRequiredArgs) return null;\n\n\t\t\t//Have to populate the list with any optional arguments not passed in.\n\t\t\tfor (int i = curArg; i < NumArgs; i++)\n\t\t\t{\n\t\t\t\tCommandArgument arg = Arguments.Value[i];\n\t\t\t\tParsedArgument newArg = new ParsedArgument()\n\t\t\t\t{\n\t\t\t\t\tName = arg.Name,\n\t\t\t\t\tCommandType = arg.CommandType,\n\t\t\t\t\tStrValue = arg.DefaultVal == null ? null : arg.DefaultVal.ToString(),\n\t\t\t\t\tValue = arg.DefaultVal\n\t\t\t\t};\n\t\t\t\tcurArg++;\n\t\t\t\tret.Add(newArg);\n\t\t\t}\n\n\t\t\treturn ret.ToArray();\n\t\t}\n\n\t\tpublic CommandArgument GetArgument(string name)\n\t\t{\n\t\t\tforeach (var arg in Arguments.Value)\n\t\t\t\tif (arg.Name == name) return arg;\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic class CommandArgument\n\t\t{\n\t\t\tpublic Type CommandType = typeof(string);\n\t\t\tpublic string Name;\n\t\t\tpublic bool Optional = false;\n\t\t\tpublic object DefaultVal = null;\n\t\t\tpublic Func<object, bool> Validate = o => true;\n\n\t\t\tpublic object GetConvertedValue(string input, bool ignore = false)\n\t\t\t{\n\t\t\t\tif (!ignore && !IsGoodValue(input)) return null;\n\t\t\t\tvar typeConverter = TypeDescriptor.GetConverter(CommandType);\n\t\t\t\treturn typeConverter.ConvertFromString(input);\n\t\t\t}\n\n\t\t\tpublic bool IsGoodValue(string input)\n\t\t\t{\n\t\t\t\tType T = CommandType;\n\t\t\t\tif (T == null) return true;\n\t\t\t\tvar typeConverter = TypeDescriptor.GetConverter(T);\n\t\t\t\treturn typeConverter.CanConvertFrom(typeof(string)) && IsGood(T, input) && Validate(GetConvertedValue(input, true));\n\t\t\t}\n\n\t\t\tpublic bool IsGood(Type T, string input)\n\t\t\t{\n\t\t\t\tif (T == typeof(bool))\n\t\t\t\t{\n\t\t\t\t\tstring[] good = new string[] { \"true\", \"false\" };\n\t\t\t\t\treturn good.Contains(input.ToLower());\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic class ParsedArgument\n\t\t{\n\t\t\tpublic string Name;\n\t\t\tpublic Type CommandType;\n\t\t\tpublic string StrValue;\n\t\t\tpublic object Value;\n\t\t}\n\n\t\tpublic class ArgCollection\n\t\t{\n\t\t\tpublic ParsedArgument[] ParsedArgs;\n\n\t\t\tpublic object Get(int i)\n\t\t\t{\n\t\t\t\tif (ParsedArgs == null || ParsedArgs.Length <= i) return null;\n\t\t\t\treturn ParsedArgs[i].Value;\n\t\t\t}\n\n\t\t\tpublic object Get(string name)\n\t\t\t{\n\t\t\t\tif (ParsedArgs == null) return null;\n\t\t\t\tforeach(var arg in ParsedArgs)\n\t\t\t\t\tif (arg.Name == name)\n\t\t\t\t\t\treturn arg.Value;\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Console/ConVar.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Windows.Forms;\nusing ComponentBind;\nusing Lemma.Components;\n\nnamespace Lemma.Console\n{\n\tpublic class ConVar\n\t{\n\t\tpublic Property<string> Name = new Property<string>();\n\t\tpublic Property<string> Description = new Property<string>();\n\t\tpublic Property<string> Value = new Property<string>();\n\t\tpublic Property<Action<string>> OnChanged = new Property<Action<string>>();\n\t\tpublic Func<object, bool> Validate = o => true;\n\n\t\tpublic Type TypeConstraint;\n\n\t\tpublic Type OutCastConstraint\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (TypeConstraint == null) return typeof(string);\n\t\t\t\treturn TypeConstraint;\n\t\t\t}\n\t\t}\n\n\t\tpublic ConVar(string name, string description, Action<string> onChanged, string defaultValue)\n\t\t{\n\t\t\tthis.Name.Value = name;\n\t\t\tthis.Description.Value = description;\n\t\t\tthis.OnChanged.Value = onChanged;\n\t\t\tthis.Value.Value = defaultValue;\n\t\t}\n\n\t\tpublic ConVar(string name, string description, string defaultValue)\n\t\t\t: this(name, description, s => { }, defaultValue)\n\t\t{\n\t\t}\n\n\t\tpublic ConVar(string name, string description, Action<string> onChanged)\n\t\t\t: this(name, description, onChanged, \"\")\n\t\t{\n\n\t\t}\n\n\t\tpublic ConVar(string name, string description)\n\t\t\t: this(name, description, s => { }, \"\")\n\t\t{\n\n\t\t}\n\n\t\tpublic object GetCastedValue(string input = null)\n\t\t{\n\t\t\tstring toConvert = input ?? Value.Value;\n\t\t\tType T = OutCastConstraint;\n\t\t\tvar typeConverter = TypeDescriptor.GetConverter(T);\n\t\t\tif (typeConverter.CanConvertFrom(typeof(string)) && typeConverter.IsValid(toConvert))\n\t\t\t{\n\t\t\t\treturn typeConverter.ConvertFromString(toConvert);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic bool IsGoodValue(string input)\n\t\t{\n\t\t\tType T = TypeConstraint;\n\t\t\tif (T == null) return true;\n\t\t\tvar typeConverter = TypeDescriptor.GetConverter(T);\n\t\t\tif (typeConverter.CanConvertFrom(typeof(string)) && IsGood(T, input))\n\t\t\t{\n\t\t\t\tobject castedValue = GetCastedValue(input);\n\t\t\t\tif (castedValue != null)\n\t\t\t\t\treturn Validate(castedValue);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic bool IsGood(Type T, string input)\n\t\t{\n\t\t\tif (T == typeof(bool))\n\t\t\t{\n\t\t\t\tstring[] good = new string[] { \"true\", \"false\"};\n\t\t\t\treturn good.Contains(input.ToLower());\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "Lemma/Console/Console.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing GeeUI.ViewLayouts;\nusing GeeUI.Views;\nusing Lemma;\nusing ComponentBind;\nusing Lemma.Components;\nusing Lemma.GInterfaces;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma.Console\n{\n\tpublic class Console : Component<Main>\n\t{\n\t\tpublic static List<ConVar> ConVars = new List<ConVar>();\n\t\tpublic static List<ConCommand> Commands = new List<ConCommand>();\n\n\t\tprivate const int MaxHistory = 100;\n\t\tpublic List<string> History = new List<string>();\n\n\t\tpublic static Console Instance;\n\n\t\tpublic void ConsoleUserInput(string input)\n\t\t{\n\t\t\tif (this.History.Count == 0 || input != this.History[this.History.Count - 1])\n\t\t\t\tthis.History.Add(input);\n\t\t\twhile (this.History.Count > MaxHistory)\n\t\t\t\tthis.History.RemoveAt(0);\n\n\t\t\tConsoleParser.ParseResult parsed = ConsoleParser.Parse(input);\n\t\t\tLog(\">\" + input);\n\t\t\tif (parsed.ParsedResult.Length == 0 || !IsConVarOrCmd(parsed.ParsedResult[0].Value))\n\t\t\t{\n\t\t\t\tLog(\"Incorrect input\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tstring ConObject = parsed.ParsedResult[0].Value;\n\t\t\tif (IsConCommand(ConObject))\n\t\t\t{\n\t\t\t\tint NumArgs = parsed.ParsedResult.Length - 1;\n\t\t\t\tvar command = GetConCommand(ConObject);\n\t\t\t\tif (NumArgs >= command.NumRequiredArgs && NumArgs <= command.NumArgs)\n\t\t\t\t{\n\t\t\t\t\tvar parsedArgs = command.ParseArguments(parsed.ParsedResult);\n\t\t\t\t\tif (parsedArgs == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tLog(\"ERROR: Bad arguments\");\n\t\t\t\t\t\tPrintConCommandDescription(command);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar collection = new ConCommand.ArgCollection() { ParsedArgs = parsedArgs };\n\t\t\t\t\t\tcommand.OnCalled.Value(collection);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tLog(\"ERROR: Wrong number of arguments.\");\n\t\t\t\t\tPrintConCommandDescription(command);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (IsConVar(ConObject))\n\t\t\t{\n\t\t\t\tif (parsed.ParsedResult.Length == 1)\n\t\t\t\t{\n\t\t\t\t\tvar convar = GetConVar(parsed.ParsedResult[0].Value);\n\t\t\t\t\tLog(convar.Name + \": \" + convar.Description + \" (Value: \" + convar.GetCastedValue() + \" \" +\n\t\t\t\t\t\tconvar.OutCastConstraint.ToString().Replace(\"System.\", \"\") + \")\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar argument = parsed.ParsedResult[1].Value;\n\t\t\t\t\tSetConVarValue(parsed.ParsedResult[0].Value, argument);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tpublic static void Log(string input)\n\t\t{\n\t\t\tConsole.Instance.main.ConsoleUI.LogText(input);\n\t\t}\n\n\t\tpublic void ListAllConsoleStuff()\n\t\t{\n\t\t\tforeach (var command in Commands)\n\t\t\t{\n\t\t\t\tPrintConCommandDescription(command);\n\t\t\t}\n\t\t\tforeach (var convar in ConVars)\n\t\t\t{\n\t\t\t\tLog(convar.Name + \": \" + convar.Description + \" (Value: \" + convar.GetCastedValue() + \" \" +\n\t\t\t\t\t\tconvar.OutCastConstraint.ToString().Replace(\"System.\", \"\") + \")\");\n\t\t\t}\n\t\t}\n\n\t\tpublic void PrintConCommandDescription(string name)\n\t\t{\n\t\t\tPrintConCommandDescription(GetConCommand(name));\n\t\t}\n\n\t\tpublic void PrintConCommandDescription(ConCommand cmd)\n\t\t{\n\t\t\tif (cmd == null) return;\n\t\t\tstring print = cmd.Name + \": \" + cmd.Description;\n\t\t\tif (cmd.NumArgs > 0)\n\t\t\t{\n\t\t\t\tprint += \" ( \";\n\t\t\t\tint i = 0;\n\t\t\t\tforeach (var arg in cmd.Arguments.Value)\n\t\t\t\t{\n\t\t\t\t\tif (i++ > 0) print += \", \";\n\t\t\t\t\tstring type = arg.CommandType.ToString().Replace(\"System.\", \"\");\n\t\t\t\t\tif (arg.Optional)\n\t\t\t\t\t{\n\t\t\t\t\t\tprint += \"[\" + type + \" \" + arg.Name + \" = \" + arg.DefaultVal + \"]\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tprint += type + \" \" + arg.Name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprint += \" )\";\n\t\t\t}\n\t\t\tLog(print);\n\t\t}\n\n\t\tpublic static void SetConVarValue(string name, string value)\n\t\t{\n\t\t\tvar convar = GetConVar(name);\n\t\t\tif (convar == null || !convar.IsGoodValue(value))\n\t\t\t{\n\t\t\t\tLog(\"Incorrect input\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconvar.Value.Value = value;\n\t\t\tif (convar.OnChanged.Value != null)\n\t\t\t\tconvar.OnChanged.Value(value);\n\t\t}\n\n\t\tpublic static string GetConVarValue(string name, string defaultVal = \"\")\n\t\t{\n\t\t\tvar convar = GetConVar(name);\n\t\t\treturn convar == null ? defaultVal : convar.Value.Value;\n\t\t}\n\n\t\tpublic static ConCommand GetConCommand(string name)\n\t\t{\n\t\t\tif (!IsConCommand(name)) return null;\n\t\t\treturn (from command in Commands where command.Name == name select command).First();\n\t\t}\n\n\t\tpublic static ConVar GetConVar(string name)\n\t\t{\n\t\t\tif (!IsConVar(name)) return null;\n\t\t\treturn (from convar in ConVars where convar.Name == name select convar).First();\n\t\t}\n\n\t\tpublic static bool IsConVar(string name)\n\t\t{\n\t\t\treturn (from convar in ConVars where convar.Name == name select convar).Any();\n\t\t}\n\n\t\tpublic static void RemoveConVar(string name)\n\t\t{\n\t\t\tConVars.Remove(GetConVar(name));\n\t\t}\n\n\t\tpublic static void RemoveConCommand(string name)\n\t\t{\n\t\t\tCommands.Remove(GetConCommand(name));\n\t\t}\n\n\t\tpublic static void AddConVar(ConVar c)\n\t\t{\n\t\t\tif (IsConVar(c.Name)) return;\n\t\t\tConVars.Add(c);\n\t\t}\n\n\t\tpublic static void AddConCommand(ConCommand c)\n\t\t{\n\t\t\tif (IsConCommand(c.Name)) return;\n\t\t\tCommands.Add(c);\n\t\t}\n\n\t\tpublic static bool IsConCommand(string name)\n\t\t{\n\t\t\treturn (from command in Commands where command.Name == name select command).Any();\n\t\t}\n\n\t\tpublic static bool IsConVarOrCmd(string name)\n\t\t{\n\t\t\treturn IsConVar(name) || IsConCommand(name);\n\t\t}\n\n\t\tpublic static void BindAllTypes()\n\t\t{\n\t\t\tAssembly a = Assembly.GetExecutingAssembly();\n\t\t\tforeach (Type t in a.GetTypes())\n\t\t\t\tBindType(t);\n\t\t}\n\n\t\tpublic static void BindType(Type t, object instance = null)\n\t\t{\n\t\t\tif (instance != null) t = instance.GetType();\n\t\t\tList<MemberInfo> members = new List<MemberInfo>();\n\t\t\tvar bindingFlags = BindingFlags.Public | BindingFlags.Static;\n\t\t\tif (instance != null)\n\t\t\t{\n\t\t\t\tbindingFlags = BindingFlags.Instance | BindingFlags.Public;\n\t\t\t}\n\t\t\tforeach (FieldInfo m in t.GetFields(bindingFlags))\n\t\t\t{\n\t\t\t\tmembers.Add(m);\n\t\t\t}\n\t\t\tforeach (PropertyInfo m in t.GetProperties(bindingFlags))\n\t\t\t{\n\t\t\t\tmembers.Add(m);\n\t\t\t}\n\t\t\tforeach (MethodInfo m in t.GetMethods(bindingFlags))\n\t\t\t\tmembers.Add(m);\n\t\t\tforeach (MemberInfo m in members)\n\t\t\t{\n\t\t\t\tforeach (var attribute in m.GetCustomAttributes(false))\n\t\t\t\t{\n\t\t\t\t\tif (attribute is AutoConVar)\n\t\t\t\t\t{\n\t\t\t\t\t\tBindMember(m, (AutoConVar)attribute, instance);\n\t\t\t\t\t}\n\t\t\t\t\telse if (attribute is AutoConCommand)\n\t\t\t\t\t{\n\t\t\t\t\t\tBindMethod((MethodInfo)m, (AutoConCommand)attribute, instance);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static void CallMethod(MethodInfo member, ConCommand.ArgCollection collection, object instance = null)\n\t\t{\n\t\t\tList<object> invokeParams = new List<object>();\n\t\t\tforeach (var o in collection.ParsedArgs)\n\t\t\t\tinvokeParams.Add(o.Value);\n\t\t\tmember.Invoke(instance, invokeParams.ToArray());\n\t\t}\n\n\t\tpublic static void BindMethod(MethodInfo member, AutoConCommand command, object instance = null)\n\t\t{\n\t\t\tbool instantiated = instance != null;\n\t\t\tList<Type> allowedTypes = new Type[] { typeof(bool), typeof(int), typeof(float), typeof(double), typeof(string) }.ToList();\n\t\t\tList<ConCommand.CommandArgument> args = new List<ConCommand.CommandArgument>();\n\t\t\tint numParams = member.GetParameters().Length;\n\t\t\tforeach (var param in member.GetParameters())\n\t\t\t{\n\t\t\t\tnumParams++;\n\t\t\t\tvar paramType = param.ParameterType;\n\t\t\t\tif (!allowedTypes.Contains(paramType)) return;\n\t\t\t\tobject defaultValue = param.DefaultValue;\n\t\t\t\tbool isOptional = param.IsOptional;\n\t\t\t\tstring name = param.Name;\n\t\t\t\targs.Add(new ConCommand.CommandArgument()\n\t\t\t\t{\n\t\t\t\t\tCommandType = paramType,\n\t\t\t\t\tDefaultVal = defaultValue,\n\t\t\t\t\tName = name,\n\t\t\t\t\tOptional = isOptional\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (instantiated)\n\t\t\t\tRemoveConCommand(command.ConVarName);\n\t\t\tAddConCommand(new ConCommand(command.ConVarName, command.ConVarDesc, collection =>\n\t\t\t{\n\t\t\t\tif (instantiated && instance == null)\n\t\t\t\t{\n\t\t\t\t\tLog(\"Removing concommand \" + command.ConVarName + \": linked instance is null\");\n\t\t\t\t\tRemoveConCommand(command.ConVarName);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tCallMethod(member, collection, instance);\n\t\t\t}, args.ToArray()));\n\t\t}\n\n\t\tpublic static void BindMember(MemberInfo member, AutoConVar convar, object instance = null)\n\t\t{\n\t\t\tList<Type> allowedTypes = new Type[] { typeof(bool), typeof(int), typeof(float), typeof(double), typeof(string) }.ToList();\n\t\t\tList<Type> generics = allowedTypes.Select(Type => typeof(Property<>).MakeGenericType(Type)).ToList();\n\t\t\tallowedTypes.AddRange(generics);\n\n\t\t\tbool instantiated = instance != null;\n\n\t\t\tType curType = null;\n\t\t\tobject value = \"null\";\n\t\t\tbool isProperty = true;\n\n\t\t\tstring name = convar.ConVarName;\n\t\t\tstring desc = convar.ConVarDesc;\n\n\t\t\tswitch (member.MemberType)\n\t\t\t{\n\t\t\t\tcase MemberTypes.Field:\n\t\t\t\t\tcurType = ((FieldInfo)member).FieldType;\n\t\t\t\t\tvalue = ((FieldInfo)member).GetValue(instance);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MemberTypes.Property:\n\t\t\t\t\tcurType = ((PropertyInfo)member).PropertyType;\n\t\t\t\t\tvalue = ((PropertyInfo)member).GetValue(instance, null);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (curType == null) return;\n\t\t\tif (!allowedTypes.Contains(curType))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Cannot auto-bind convar to type \" + curType.ToString());\n\t\t\t}\n\n\t\t\tobject propertyValue = value;\n\t\t\tvar binding = new NotifyBinding(() =>\n\t\t\t{\n\t\t\t\tif (propertyValue == null || propertyValue.GetType().GetProperty(\"Value\") == null || propertyValue.GetType().GetProperty(\"Value\").GetValue(propertyValue, null) == null) return;\n\t\t\t\tGetConVar(name).Value.Value =\n\t\t\t\t\tpropertyValue.GetType().GetProperty(\"Value\").GetValue(propertyValue, null).ToString();\n\t\t\t});\n\n\t\t\tif (generics.Contains(curType))\n\t\t\t{\n\t\t\t\tvalue = propertyValue.GetType().GetProperty(\"Value\").GetValue(propertyValue, null);\n\t\t\t\tif (value == null) value = \"null\";\n\t\t\t\telse value = value.ToString();\n\t\t\t\tcurType = curType.GetGenericArguments()[0];\n\t\t\t\tpropertyValue.GetType()\n\t\t\t\t\t.InvokeMember(\"AddBinding\", BindingFlags.InvokeMethod, null, propertyValue, new object[] { binding });\n\t\t\t}\n\t\t\telse\n\t\t\t\tisProperty = false;\n\n\n\t\t\tif (instantiated)\n\t\t\t\tRemoveConVar(name);\n\n\t\t\tif (!isProperty)\n\t\t\t{\n\t\t\t\tAddConVar(new ConVar(name, desc, (string)value)\n\t\t\t\t{\n\t\t\t\t\tTypeConstraint = curType,\n\t\t\t\t\tValue = new Property<string>() { Value = (string)value },\n\t\t\t\t\tOnChanged = new Property<Action<string>>()\n\t\t\t\t\t{\n\t\t\t\t\t\tValue = (s) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (instantiated && instance == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tLog(\"Removing convar \" + name + \": linked instance is null\");\n\t\t\t\t\t\t\t\tRemoveConVar(name);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tswitch (member.MemberType)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase MemberTypes.Field:\n\t\t\t\t\t\t\t\t\t((FieldInfo)member).SetValue(instance, GetConVar(name).GetCastedValue());\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase MemberTypes.Property:\n\t\t\t\t\t\t\t\t\t((PropertyInfo)member).SetValue(instance, GetConVar(name).GetCastedValue(), null);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAddConVar(new ConVar(name, desc, (string)value)\n\t\t\t\t{\n\t\t\t\t\tTypeConstraint = curType,\n\t\t\t\t\tValue = new Property<string>() { Value = (string)value },\n\t\t\t\t\tOnChanged = new Property<Action<string>>()\n\t\t\t\t\t{\n\t\t\t\t\t\tValue = (s) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (instantiated && instance == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tLog(\"Removing convar \" + name + \": linked instance is null\");\n\t\t\t\t\t\t\t\tRemoveConVar(name);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tobject val = GetConVar(name).GetCastedValue();\n\t\t\t\t\t\t\tpropertyValue.GetType().GetProperty(\"Value\").SetValue(propertyValue, val, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tAssembly a = Assembly.GetExecutingAssembly();\n\t\t\tforeach (Type t in a.GetTypes())\n\t\t\t\tBindType(t);\n\n\t\t\tConsole.Instance = this;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Console/ConsoleParser.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Lemma.Console\n{\n\tpublic static class ConsoleParser\n\t{\n\t\tpublic class ParseResult\n\t\t{\n\t\t\tpublic class ParseToken\n\t\t\t{\n\t\t\t\tpublic enum TokenType\n\t\t\t\t{\n\t\t\t\t\tCmdOrVar,\n\t\t\t\t\tArgument,\n\t\t\t\t\tConVar\n\t\t\t\t}\n\n\t\t\t\tpublic TokenType Type;\n\t\t\t\tpublic string Value;\n\t\t\t}\n\n\t\t\tpublic string EntireString;\n\t\t\tpublic ParseToken[] ParsedResult;\n\t\t}\n\n\t\tprivate enum ParseState\n\t\t{\n\t\t\tFindingToken,\n\t\t\tParsingToken\n\t\t}\n\n\t\t//Rather simple parser for right now--first token is going to be the name, any subsequent tokens will be arguments.\n\t\tpublic static ParseResult Parse(string input)\n\t\t{\n\t\t\tParseResult ret = new ParseResult();\n\t\t\tret.EntireString = input;\n\n\t\t\tList<ParseResult.ParseToken> tokens = new List<ParseResult.ParseToken>();\n\n\t\t\tstring acceptableForNewToken = \"\\\"'abcdefghijklmnopqrstuvwxyz1234567890_-%\";\n\t\t\tstring acceptableForCurToken = \"\\\"'abcdefghijklmnopqrstuvwxyz1234567890_-!@#$%^&*()<>?,./|\\\\][}{ \";\n\n\t\t\tParseResult.ParseToken curToken = new ParseResult.ParseToken();\n\t\t\tbool parsingInQuotes = false;\n\t\t\tstring tokenStr = \"\";\n\t\t\tParseState curState = ParseState.FindingToken;\n\n\t\t\tbool alreadyFoundName = false;\n\n\t\t\tforeach (char c in input)\n\t\t\t{\n\t\t\t\tbool append = true;\n\t\t\t\tswitch (curState)\n\t\t\t\t{\n\t\t\t\t\tcase ParseState.FindingToken:\n\t\t\t\t\t\tif (acceptableForNewToken.Contains(c.ToString().ToLower()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (c == '\"')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tparsingInQuotes = true;\n\t\t\t\t\t\t\t\tappend = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcurState = ParseState.ParsingToken;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ParseState.ParsingToken:\n\t\t\t\t\t\tif (acceptableForCurToken.Contains(c.ToString().ToLower()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (c == '\"' && parsingInQuotes)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tparsingInQuotes = false;\n\t\t\t\t\t\t\t\tappend = false;\n\t\t\t\t\t\t\t\tcurState = ParseState.FindingToken;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (c == ' ' && !parsingInQuotes)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tparsingInQuotes = false;\n\t\t\t\t\t\t\t\tappend = false;\n\t\t\t\t\t\t\t\tcurState = ParseState.FindingToken;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (curState == ParseState.FindingToken)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcurToken.Type = alreadyFoundName\n\t\t\t\t\t\t\t\t\t? ParseResult.ParseToken.TokenType.Argument\n\t\t\t\t\t\t\t\t\t: ParseResult.ParseToken.TokenType.CmdOrVar;\n\t\t\t\t\t\t\t\talreadyFoundName = true;\n\t\t\t\t\t\t\t\tcurToken.Value = tokenStr;\n\n\t\t\t\t\t\t\t\ttokenStr = \"\";\n\t\t\t\t\t\t\t\ttokens.Add(curToken);\n\t\t\t\t\t\t\t\tcurToken = new ParseResult.ParseToken();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (append && curState == ParseState.ParsingToken)\n\t\t\t\t\ttokenStr += c;\n\t\t\t}\n\n\t\t\tif (!string.IsNullOrEmpty(tokenStr))\n\t\t\t{\n\t\t\t\tcurToken.Type = alreadyFoundName\n\t\t\t\t\t\t\t\t\t? ParseResult.ParseToken.TokenType.Argument\n\t\t\t\t\t\t\t\t\t: ParseResult.ParseToken.TokenType.CmdOrVar;\n\t\t\t\tcurToken.Value = tokenStr;\n\n\t\t\t\ttokens.Add(curToken);\n\t\t\t}\n\n\t\t\t\n\t\t\tfor(int i = 0; i < tokens.Count; i++)\n\t\t\t{\n\t\t\t\tvar token = tokens[i];\n\t\t\t\tif (token.Type == ParseResult.ParseToken.TokenType.Argument && token.Value.Length >= 3)\n\t\t\t\t{\n\t\t\t\t\tif (token.Value[0] == '%' && token.Value[token.Value.Length - 1] == '%')\n\t\t\t\t\t{\n\t\t\t\t\t\tvar conVar = token.Value.Substring(1, token.Value.Length - 2);\n\t\t\t\t\t\tif (Console.IsConVar(conVar))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttoken.Value = Console.GetConVarValue(conVar, token.Value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tret.ParsedResult = tokens.ToArray();\n\n\t\t\treturn ret;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/AlphaModels/box.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender XNA FBX Exporter(s)\n; Project home: http://code.google.com/p/blender-to-xna/\n; ------------------------------------------------------\n\nFBXHeaderExtension:  {\n    FBXHeaderVersion: 1003\n    FBXVersion: 6100\n    CreationTimeStamp:  {\n        Version: 1000\n        Year: 2010\n        Month: 12\n        Day: 29\n        Hour: 23\n        Minute: 41\n        Second: 15\n        Millisecond: 0\n    }\n    Creator: \"FBX SDK/FBX Plugins build 20070228\"\n    OtherFlags:  {\n        FlagPLE: 0\n    }\n}\nCreationTime: \"2010-12-29 23:41:15:000\"\nCreator: \"Blender version 2.55 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n    Version: 100\n    Count: 12\n    ObjectType: \"Model\" {\n        Count: 10\n    }\n    ObjectType: \"Geometry\" {\n        Count: 1\n    }\n    ObjectType: \"Material\" {\n        Count: 1\n    }\n        ObjectType: \"Pose\" {\n            Count: 1\n        }\n    ObjectType: \"GlobalSettings\" {\n        Count: 1\n    }\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n    Model: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n        Version: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n            Property: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n            Property: \"Camera Index\", \"Integer\", \"A+\",100\n        }\n        MultiLayer: 0\n        MultiTake: 1\n        Hidden: \"True\"\n        Shading: W\n        Culling: \"CullingOff\"\n        Version: 101\n        Name: \"Model::Camera Switcher\"\n        CameraId: 0\n        CameraName: 100\n        CameraIndexName:\n    }\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.500000,0.500000,-0.500000,0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,0.500000,-0.500000,0.500000,0.500000,0.500000,0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000\n\t\t,-0.500000,0.500000,0.500000,0.500000,0.500000,-0.500000,0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000\n\t\t,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,0.500000,0.500000,-0.500000,0.500000,0.500000,0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000\n\t\t,-0.500000,0.500000,0.500000,-0.500000,0.500000,0.500000,0.500000,0.500000,0.500000\n\t\tPolygonVertexIndex: 0,1,2,-4,4,7,6,-6,8,18,17,-16,14,16,19,-14,12,20,21,-12,23,9,10,-23\n\t\tGeometryVersion: 124\n        LayerElementNormal: 0 {\n            Version: 101\n            Name: \"\"\n            MappingInformationType: \"ByVertice\"\n            ReferenceInformationType: \"Direct\"\n            Normals: 0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000\n\t\t\t ,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000\n\t\t\t ,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t\t ,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t\t ,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000\n\t\t\t ,-1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,-1.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,-1.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000\n\t\t\t ,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000\n\t\t\t ,-1.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVTex\"\n            MappingInformationType: \"ByPolygonVertex\"\n            ReferenceInformationType: \"IndexToDirect\"\n            UV: 0.700000,0.350000,1.000000,0.350000,1.000000,0.650000,0.700000,0.650000,0.350000,0.350000,0.650000,0.350000,0.650000,0.650000\n\t\t\t ,0.350000,0.650000,0.003125,0.350000,0.303125,0.350000,0.303125,0.650000,0.003125,0.650000,0.003125,0.693750,0.303125,0.693750\n\t\t\t ,0.303125,0.993750,0.003125,0.993750,0.350000,0.696875,0.650000,0.696875,0.650000,0.996875,0.350000,0.996875,0.703125,0.696875\n\t\t\t ,1.003125,0.696875,1.003125,0.996875,0.703125,0.996875\n\t\t\tUVIndex: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23\n\t\t}\n        LayerElementTexture: 0 {\n            Version: 101\n            Name: \"\"\n            MappingInformationType: \"NoMappingInformation\"\n            ReferenceInformationType: \"IndexToDirect\"\n            BlendMode: \"Translucent\"\n            TextureAlpha: 1\n            TextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n        Layer: 0 {\n            Version: 100\n            LayerElement:  {\n                Type: \"LayerElementNormal\"\n                TypedIndex: 0\n            }\n            LayerElement:  {\n                Type: \"LayerElementMaterial\"\n                TypedIndex: 0\n            }\n            LayerElement:  {\n                Type: \"LayerElementUV\"\n                TypedIndex: 0\n            }\n\t\t}\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,71.299999999999997,287.500000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",10.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",4000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",0\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,71.300000,287.500000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,-4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,-4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,-4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,-4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: -4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2500\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",9.6\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n        Pose: \"Pose::BIND_POSES\", \"BindPose\" {\n            Type: \"BindPose\"\n            Version: 100\n            Properties60:  {\n            }\n            NbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n    GlobalSettings:  {\n        Version: 1000\n        Properties60:  {\n            Property: \"UpAxis\", \"int\", \"\",1\n            Property: \"UpAxisSign\", \"int\", \"\",1\n            Property: \"FrontAxis\", \"int\", \"\",2\n            Property: \"FrontAxisSign\", \"int\", \"\",1\n            Property: \"CoordAxis\", \"int\", \"\",0\n            Property: \"CoordAxisSign\", \"int\", \"\",1\n            Property: \"UnitScaleFactor\", \"double\", \"\",1\n        }\n    }\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n    Model: \"Model::Producer Perspective\", \"Camera\" {\n    }\n    Model: \"Model::Producer Top\", \"Camera\" {\n    }\n    Model: \"Model::Producer Bottom\", \"Camera\" {\n    }\n    Model: \"Model::Producer Front\", \"Camera\" {\n    }\n    Model: \"Model::Producer Back\", \"Camera\" {\n    }\n    Model: \"Model::Producer Right\", \"Camera\" {\n    }\n    Model: \"Model::Producer Left\", \"Camera\" {\n    }\n    Model: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n    }\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFlogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/AlphaModels/clouds.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2014\n\t\tMonth: 07\n\t\tDay: 25\n\t\tHour: 10\n\t\tMinute: 26\n\t\tSecond: 07\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2014-07-25 10:26:07:000\"\nCreator: \"Blender version 2.70 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 13\n\tObjectType: \"Model\" {\n\t\tCount: 11\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Camera Index\", \"Integer\", \"A+\",100\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tHidden: \"True\"\n\t\tShading: W\n\t\tCulling: \"CullingOff\"\n\t\tVersion: 101\n\t\tName: \"Model::Camera Switcher\"\n\t\tCameraId: 0\n\t\tCameraName: 100\n\t\tCameraIndexName:\n\t}\n\tModel: \"Model::Camera\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",7.481131553649902,5.343665122985840,6.507639884948730\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",23.240195056629602,142.362356870423241,34.212069212897042\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,0.999999940395355,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",49.134342\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",49.134342\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",28.841546\n\t\t\tProperty: \"FocalLength\", \"Number\", \"A+\",35.000000\n\t\t\tProperty: \"FilmOffsetX\", \"Number\", \"A+\",0.000000\n\t\t\tProperty: \"FilmOffsetY\", \"Number\", \"A+\",0.000000\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0,0,0\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",3\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",2\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",1920\n\t\t\tProperty: \"AspectH\", \"double\", \"\",1080\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",0.100000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",99.999994\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",1.259843\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.708661\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.777778\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.777778\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",0\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 7.481132,5.343665,6.507640\n\t\tUp: -0.317370,0.895343,-0.312469\n\t\tLookAt: -0.685881,0.010817,0.727634\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Lamp\", \"Light\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",4.076245307922363,5.903861999511719,-1.005453944206238\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",47.533574547422390,107.220753553002154,10.743666437040241\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,0.999999880790710,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t\tProperty: \"LightType\", \"enum\", \"\",1\n\t\t\tProperty: \"CastLightOnObject\", \"bool\", \"\",1\n\t\t\tProperty: \"DrawVolumetricLight\", \"bool\", \"\",1\n\t\t\tProperty: \"DrawGroundProjection\", \"bool\", \"\",1\n\t\t\tProperty: \"DrawFrontFacingVolumetricLight\", \"bool\", \"\",0\n\t\t\tProperty: \"GoboProperty\", \"object\", \"\"\n\t\t\tProperty: \"Color\", \"Color\", \"A+\",1,1,1\n\t\t\tProperty: \"Fog\", \"Fog\", \"A+\",50\n\t\t\tProperty: \"Color\", \"Color\", \"A\",1.00,1.00,1.00\n\t\t\tProperty: \"Intensity\", \"Intensity\", \"A+\",100.00\n\t\t\tProperty: \"Fog\", \"Fog\", \"A+\",50\n\t\t\tProperty: \"LightType\", \"enum\", \"\",1\n\t\t\tProperty: \"CastLightOnObject\", \"bool\", \"\",1\n\t\t\tProperty: \"DrawGroundProjection\", \"bool\", \"\",1\n\t\t\tProperty: \"DrawFrontFacingVolumetricLight\", \"bool\", \"\",0\n\t\t\tProperty: \"DrawVolumetricLight\", \"bool\", \"\",1\n\t\t\tProperty: \"GoboProperty\", \"object\", \"\"\n\t\t\tProperty: \"CastShadows\", \"bool\", \"\",1\n\t\t\tProperty: \"ShadowColor\", \"ColorRGBA\", \"\",0,0,0,1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Light\"\n\t\tGeometryVersion: 124\n\t}\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-90.000009334538021,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: -0.990000,0.000000,-0.990000,-0.990000,0.000000,0.990000,0.990000,0.000000,0.990000,0.990000,0.000000,-0.990000\n\t\tPolygonVertexIndex: 0,3,2,-2\n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.000000,-1.000000,0.000000,0.000000,-1.000000,0.000000,0.000000,-1.000000,0.000000,0.000000,-1.000000,0.000000\n\t\t}\n\t\tLayerElementSmoothing: 0 {\n\t\t\tVersion: 102\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygon\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tSmoothing: 0\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000\n\t\t\tUVIndex: 0,2,1,3\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementSmoothing\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementTexture\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,71.299999999999997,287.500000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",10.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",4000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",0\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,71.300000,287.500000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,-4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,-4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,-4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,-4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: -4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Camera\", \"Camera\" {\n\t}\n\tModel: \"Model::Lamp\", \"Light\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Model::Lamp\", \"Model::Scene\"\n\tConnect: \"OO\", \"Model::Camera\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n\tTake: \"Default Take\" {\n\t\tFileName: \"Default_Take.tak\"\n\t\tLocalTime: 0,479181389250\n\t\tReferenceTime: 0,479181389250\n\n\t\t;Models animation\n\t\t;----------------------------------------------------\n\t\tModel: \"Model::Cube\" {\n\t\t\tVersion: 1.1\n\t\t\tChannel: \"Transform\" {\n\t\t\t\tChannel: \"T\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 1\n\t\t\t\t}\n\t\t\t\tChannel: \"R\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: -90.000002504348856\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-90.000002504348856,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: -0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 2\n\t\t\t\t}\n\t\t\t\tChannel: \"S\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 3\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tModel: \"Model::Camera\" {\n\t\t\tVersion: 1.1\n\t\t\tChannel: \"Transform\" {\n\t\t\t\tChannel: \"T\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 7.481131553649902\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,7.481131553649902,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 5.343665122985840\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,5.343665122985840,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 6.507639884948730\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,6.507639884948730,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 1\n\t\t\t\t}\n\t\t\t\tChannel: \"R\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 23.240198471724188\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,23.240198471724188,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 142.362356870423241\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,142.362356870423241,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 34.212069212897042\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,34.212069212897042,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 2\n\t\t\t\t}\n\t\t\t\tChannel: \"S\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 0.999999940395355\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.999999940395355,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 3\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tModel: \"Model::Lamp\" {\n\t\t\tVersion: 1.1\n\t\t\tChannel: \"Transform\" {\n\t\t\t\tChannel: \"T\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 4.076245307922363\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,4.076245307922363,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 5.903861999511719\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,5.903861999511719,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: -1.005453944206238\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-1.005453944206238,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 1\n\t\t\t\t}\n\t\t\t\tChannel: \"R\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 47.533574547422390\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,47.533574547422390,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 107.220760383191333\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,107.220760383191333,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 10.743664729492949\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,10.743664729492949,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 2\n\t\t\t\t}\n\t\t\t\tChannel: \"S\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 0.999999880790710\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.999999880790710,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 3\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.0,0.1,0.2,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/AlphaModels/cone.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2014\n\t\tMonth: 02\n\t\tDay: 24\n\t\tHour: 15\n\t\tMinute: 51\n\t\tSecond: 59\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2014-02-24 15:51:59:000\"\nCreator: \"Blender version 2.66 (sub 1)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.000000,0.500000,0.000000,0.097545,0.490393,0.000000,0.191342,0.461940,0.000000,0.277785,0.415735,0.000000,0.353553,0.353553,0.000000,0.415735,0.277785,0.000000,0.461940,0.191342,0.000000\n\t\t,0.490393,0.097545,0.000000,0.500000,0.000000,0.000000,0.490393,-0.097545,0.000000,0.461940,-0.191342,0.000000,0.415735,-0.277785,0.000000,0.353553,-0.353553,0.000000,0.277785,-0.415735,0.000000\n\t\t,0.191342,-0.461940,0.000000,0.097545,-0.490393,0.000000,-0.000000,-0.500000,0.000000,-0.097545,-0.490393,0.000000,-0.191342,-0.461940,0.000000,-0.277785,-0.415735,0.000000,-0.353554,-0.353553,0.000000\n\t\t,-0.415735,-0.277785,0.000000,-0.461940,-0.191341,0.000000,-0.490393,-0.097545,0.000000,-0.500000,0.000000,0.000000,-0.490393,0.097546,0.000000,-0.461940,0.191342,0.000000,-0.415734,0.277786,0.000000\n\t\t,-0.353553,0.353554,0.000000,-0.277785,0.415735,0.000000,-0.191341,0.461940,0.000000,-0.097544,0.490393,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000\n\t\tPolygonVertexIndex: 1,0,-33,32,2,-2,32,3,-3,32,4,-4,32,5,-5,32,6,-6,32,7,-7,32,8,-8,32,9,-9,32,10,-10,32,11,-11,32,12,-12,32,13,-13\n\t\t,32,14,-14,32,15,-15,32,16,-16,32,17,-17,32,18,-18,32,19,-19,32,20,-20,32,21,-21,32,22,-22,32,23,-23,32,24,-24,32,25,-25,32,26,-26\n\t\t,32,27,-27,32,28,-28,32,29,-29,32,30,-30,32,31,-31,32,0,-32,33,0,-2,33,1,-3,33,2,-4,33,3,-5,33,4,-6,33,5,-7,33,6,-8\n\t\t,33,7,-9,33,8,-10,33,9,-11,33,10,-12,33,11,-13,33,12,-14,33,13,-15,33,14,-16,33,15,-17,33,16,-18,33,17,-19,33,18,-20,33,19,-21\n\t\t,33,20,-22,33,21,-23,33,22,-24,33,23,-25,33,24,-26,33,25,-27,33,26,-28,33,27,-29,33,28,-30,33,29,-31,33,30,-32,31,0,-34\n\t\tEdges: \n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByVertice\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.000000000000000,0.864101052284241,-0.503280758857727,0.168553724884987,0.847499012947083,-0.503280758857727\n\t\t\t ,0.330668061971664,0.798333704471588,-0.503280758857727,0.480056166648865,0.718466758728027,-0.503280758857727\n\t\t\t ,0.611011087894440,0.611011087894440,-0.503280758857727,0.718466758728027,0.480056166648865,-0.503280758857727\n\t\t\t ,0.798333704471588,0.330668061971664,-0.503280758857727,0.847499012947083,0.168553724884987,-0.503280758857727\n\t\t\t ,0.864101052284241,0.000000000000000,-0.503280758857727,0.847499012947083,-0.168553724884987,-0.503280758857727\n\t\t\t ,0.798333704471588,-0.330668061971664,-0.503280758857727,0.718466758728027,-0.480056166648865,-0.503280758857727\n\t\t\t ,0.611011087894440,-0.611011087894440,-0.503280758857727,0.480056166648865,-0.718466758728027,-0.503280758857727\n\t\t\t ,0.330668061971664,-0.798333704471588,-0.503280758857727,0.168553724884987,-0.847499012947083,-0.503280758857727\n\t\t\t ,0.000000000000000,-0.864101052284241,-0.503280758857727,-0.168553724884987,-0.847499012947083,-0.503280758857727\n\t\t\t ,-0.330668061971664,-0.798333704471588,-0.503280758857727,-0.480056166648865,-0.718466758728027,-0.503280758857727\n\t\t\t ,-0.611011087894440,-0.611011087894440,-0.503280758857727,-0.718466758728027,-0.480056166648865,-0.503280758857727\n\t\t\t ,-0.798333704471588,-0.330668061971664,-0.503280758857727,-0.847499012947083,-0.168553724884987,-0.503280758857727\n\t\t\t ,-0.864101052284241,0.000000000000000,-0.503280758857727,-0.847499012947083,0.168553724884987,-0.503280758857727\n\t\t\t ,-0.798333704471588,0.330668061971664,-0.503280758857727,-0.718466758728027,0.480056166648865,-0.503280758857727\n\t\t\t ,-0.611011087894440,0.611011087894440,-0.503280758857727,-0.480056166648865,0.718466758728027,-0.503280758857727\n\t\t\t ,-0.330668061971664,0.798333704471588,-0.503280758857727,-0.168553724884987,0.847499012947083,-0.503280758857727\n\t\t\t ,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\tUVIndex: 0,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\n\t\t\t\t,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109\n\t\t\t\t,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164\n\t\t\t\t,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2500\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",9.6\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.0,0.1,0.2,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/AlphaModels/cylinder.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2012\n\t\tMonth: 09\n\t\tDay: 19\n\t\tHour: 11\n\t\tMinute: 29\n\t\tSecond: 23\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2012-09-19 11:29:23:000\"\nCreator: \"Blender version 2.62 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: -0.000000,0.500000,0.500000,0.191342,0.500000,0.461940,0.353553,0.500000,0.353553,0.461940,0.500000,0.191342,0.500000,0.500000,-0.000000,0.461940,0.500000,-0.191342,0.353553,0.500000,-0.353554\n\t\t,0.191342,0.500000,-0.461940,0.000000,0.500000,-0.500000,-0.191342,0.500000,-0.461940,-0.353553,0.500000,-0.353554,-0.461940,0.500000,-0.191342,-0.500000,0.500000,-0.000000,-0.461940,0.500000,0.191342\n\t\t,-0.353553,0.500000,0.353553,-0.191342,0.500000,0.461940,0.000000,-0.500000,0.500000,0.191342,-0.500000,0.461940,0.353554,-0.500000,0.353553,0.461940,-0.500000,0.191341,0.500000,-0.500000,-0.000001\n\t\t,0.461939,-0.500000,-0.191342,0.353553,-0.500000,-0.353554,0.191341,-0.500000,-0.461940,-0.000001,-0.500000,-0.500000,-0.191343,-0.500000,-0.461939,-0.353554,-0.500000,-0.353553,-0.461940,-0.500000,-0.191341\n\t\t,-0.500000,-0.500000,0.000001,-0.461939,-0.500000,0.191343,-0.353552,-0.500000,0.353554,-0.191340,-0.500000,0.461940,-0.000000,0.500000,-0.000000,-0.000000,-0.500000,-0.000000\n\t\tPolygonVertexIndex: 32,0,-2,33,17,-17,32,1,-3,33,18,-18,32,2,-4,33,19,-19,32,3,-5,33,20,-20,32,4,-6,33,21,-21,32,5,-7,33,22,-22,32,6,-8\n\t\t,33,23,-23,32,7,-9,33,24,-24,32,8,-10,33,25,-25,32,9,-11,33,26,-26,32,10,-12,33,27,-27,32,11,-13,33,28,-28,32,12,-14,33,29,-29\n\t\t,32,13,-15,33,30,-30,32,14,-16,33,31,-31,15,0,-33,33,16,-32,0,16,17,-2,1,17,18,-3,2,18,19,-4,3,19,20,-5,4,20,21,-6,5,21,22,-7,6,22,23,-8\n\t\t,7,23,24,-9,8,24,25,-10,9,25,26,-11,10,26,27,-12,11,27,28,-13,12,28,29,-14,13,29,30,-15,14,30,31,-16,16,0,15,-32\n\t\tEdges: \n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByVertice\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.000000000000000,0.665700256824493,0.746177554130554,0.285531163215637,0.665700256824493,0.689382612705231\n\t\t\t ,0.527634501457214,0.665700256824493,0.527634501457214,0.689382612705231,0.665700256824493,0.285531163215637\n\t\t\t ,0.746177554130554,0.665700256824493,0.000000000000000,0.689382612705231,0.665700256824493,-0.285531163215637\n\t\t\t ,0.527634501457214,0.665700256824493,-0.527634501457214,0.285531163215637,0.665700256824493,-0.689382612705231\n\t\t\t ,0.000000000000000,0.665700256824493,-0.746177554130554,-0.285531163215637,0.665700256824493,-0.689382612705231\n\t\t\t ,-0.527634501457214,0.665700256824493,-0.527634501457214,-0.689382612705231,0.665700256824493,-0.285531163215637\n\t\t\t ,-0.746177554130554,0.665700256824493,0.000000000000000,-0.689382612705231,0.665700256824493,0.285531163215637\n\t\t\t ,-0.527634501457214,0.665700256824493,0.527634501457214,-0.285531163215637,0.665700256824493,0.689382612705231\n\t\t\t ,0.000000000000000,-0.665700256824493,0.746177554130554,0.285531163215637,-0.665700256824493,0.689382612705231\n\t\t\t ,0.527634501457214,-0.665700256824493,0.527634501457214,0.689382612705231,-0.665700256824493,0.285531163215637\n\t\t\t ,0.746177554130554,-0.665700256824493,0.000000000000000,0.689382612705231,-0.665700256824493,-0.285531163215637\n\t\t\t ,0.527634501457214,-0.665700256824493,-0.527634501457214,0.285531163215637,-0.665700256824493,-0.689382612705231\n\t\t\t ,0.000000000000000,-0.665700256824493,-0.746177554130554,-0.285531163215637,-0.665700256824493,-0.689382612705231\n\t\t\t ,-0.527634501457214,-0.665700256824493,-0.527634501457214,-0.689382612705231,-0.665700256824493,-0.285531163215637\n\t\t\t ,-0.746177554130554,-0.665700256824493,0.000000000000000,-0.689382612705231,-0.665700256824493,0.285531163215637\n\t\t\t ,-0.527634501457214,-0.665700256824493,0.527634501457214,-0.285531163215637,-0.665700256824493,0.689382612705231\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000\n\t\t\tUVIndex: 0,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\n\t\t\t\t,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109\n\t\t\t\t,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t},-0.000000,0.500000,0.500000,0.191342,0.500000,0.461940,0.353553,0.500000,0.353553,0.461940,0.500000,0.191342,0.500000,0.500000,-0.000000,0.461940,0.500000,-0.191342,0.353553,0.500000,-0.353554,0.191342,0.500000,-0.461940,0.000000,0.500000,-0.500000,-0.191342,0.500000,-0.461940,-0.353553,0.500000,-0.353554,-0.461940,0.500000,-0.191342,-0.500000,0.500000,-0.000000,-0.461940,0.500000,0.191342,-0.353553,0.500000,0.353553,-0.191342,0.500000,0.461940,0.000000,-0.500000,0.500000,0.191342,-0.500000,0.461940,0.353554,-0.500000,0.353553,0.461940,-0.500000,0.191341,0.500000,-0.500000,-0.000001,0.461939,-0.500000,-0.191342,0.353553,-0.500000,-0.353554,0.191341,-0.500000,-0.461940,-0.000001,-0.500000,-0.500000,-0.191343,-0.500000,-0.461939,-0.353554,-0.500000,-0.353553,-0.461940,-0.500000,-0.191341,-0.500000,-0.500000,0.000001,-0.461939,-0.500000,0.191343,-0.353552,-0.500000,0.353554,-0.191340,-0.500000,0.461940,-0.000000,0.500000,-0.000000,-0.000000,-0.500000,-0.000000\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2500\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",9.6\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFlogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.0,0.1,0.2,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/AlphaModels/distortion-box.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2015\n\t\tMonth: 01\n\t\tDay: 06\n\t\tHour: 18\n\t\tMinute: 57\n\t\tSecond: 14\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2015-01-06 18:57:14:000\"\nCreator: \"Blender version 2.70 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-90.000009334538021,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.500000,0.500000,-0.500000,0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,0.500000,-0.500000,\n\t\t          0.500000,0.500000,0.500000,0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,0.500000,0.500000\n\t\tPolygonVertexIndex: 0,1,2,-4,4,7,6,-6,0,4,5,-2,1,5,6,-3,2,6,7,-4,4,0,3,-8\n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.000000,0.000000,-1.000000,0.000000,0.000000,-1.000000,0.000000,0.000000,-1.000000,0.000000,0.000000,-1.000000,\n\t\t\t         0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,\n\t\t\t         1.000000,-0.000000,0.000000,1.000000,-0.000000,0.000000,1.000000,-0.000000,0.000000,1.000000,-0.000000,0.000000,\n\t\t\t         -0.000000,-1.000000,-0.000000,-0.000000,-1.000000,-0.000000,-0.000000,-1.000000,-0.000000,-0.000000,-1.000000,-0.000000,\n\t\t\t         -1.000000,0.000000,-0.000000,-1.000000,0.000000,-0.000000,-1.000000,0.000000,-0.000000,-1.000000,0.000000,-0.000000,\n\t\t\t         0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t}\n\t\tLayerElementSmoothing: 0 {\n\t\t\tVersion: 102\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygon\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tSmoothing: 0,0,0,0,0,0\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000\n\t\t\tUVIndex: 2,1,3,0,2,1,3,0,2,1,3,0,2,1,3,0,2,1,3,0,2,1,3,0\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementSmoothing\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementTexture\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.5000\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",12.3\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",12.3\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/AlphaModels/light.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2012\n\t\tMonth: 09\n\t\tDay: 19\n\t\tHour: 10\n\t\tMinute: 41\n\t\tSecond: 47\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2012-09-19 10:41:47:000\"\nCreator: \"Blender version 2.62 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.000000,0.000000,-0.500000,0.361800,-0.262860,-0.223607,-0.138193,-0.425320,-0.223607,-0.447212,0.000000,-0.223607,-0.138193,0.425320,-0.223607,0.361800,0.262860,-0.223607,0.138193,-0.425320,0.223607\n\t\t,-0.361800,-0.262860,0.223607,-0.361800,0.262860,0.223607,0.138193,0.425320,0.223607,0.447212,0.000000,0.223607,0.000000,0.000000,0.500000,0.212661,-0.154506,-0.425327,-0.081228,-0.249998,-0.425327\n\t\t,0.131434,-0.404506,-0.262869,0.212661,0.154506,-0.425327,0.425324,0.000000,-0.262868,-0.262865,0.000000,-0.425326,-0.344095,-0.249998,-0.262868,-0.081228,0.249998,-0.425327,-0.344095,0.249998,-0.262868\n\t\t,0.131434,0.404506,-0.262869,0.475529,0.154506,0.000000,0.475529,-0.154506,0.000000,0.293893,-0.404508,0.000000,0.000000,-0.500000,0.000000,-0.293893,-0.404508,0.000000,-0.475529,-0.154506,0.000000\n\t\t,-0.475529,0.154506,0.000000,-0.293893,0.404508,0.000000,0.000000,0.500000,0.000000,0.293893,0.404508,0.000000,0.344095,-0.249998,0.262868,-0.131434,-0.404506,0.262869,-0.425324,0.000000,0.262868\n\t\t,-0.131434,0.404506,0.262869,0.344095,0.249998,0.262868,0.262865,0.000000,0.425326,0.081228,-0.249998,0.425327,-0.212661,-0.154506,0.425327,-0.212661,0.154506,0.425327,0.081228,0.249998,0.425327\n\t\t,0.110538,-0.080309,-0.480970,0.298597,-0.216941,-0.337307,-0.042221,-0.129945,-0.480970,-0.114052,-0.351021,-0.337308,0.256376,-0.346888,-0.252864,-0.003513,-0.431332,-0.252864,0.110538,0.080309,-0.480970\n\t\t,0.298597,0.216941,-0.337307,0.409136,-0.136631,-0.252863,0.409136,0.136631,-0.252863,-0.136633,0.000000,-0.480969,-0.369087,0.000000,-0.337305,-0.411309,-0.129945,-0.252862,-0.250687,-0.351022,-0.252864\n\t\t,-0.042221,0.129945,-0.480970,-0.114052,0.351021,-0.337308,-0.250687,0.351022,-0.252864,-0.411309,0.129945,-0.252862,-0.003513,0.431332,-0.252864,0.256376,0.346888,-0.252864,0.479626,0.080310,0.116228\n\t\t,0.435233,0.216942,-0.116228,0.435233,-0.216942,-0.116228,0.479626,-0.080310,0.116228,0.340821,-0.346889,-0.116228,0.224592,-0.431334,0.116228,-0.071831,-0.480969,-0.116228,0.071831,-0.480969,0.116228\n\t\t,-0.340821,-0.346889,0.116228,-0.224592,-0.431334,-0.116228,-0.435233,-0.216942,0.116228,-0.479626,-0.080310,-0.116228,-0.435233,0.216942,0.116228,-0.479626,0.080310,-0.116228,-0.340821,0.346889,0.116228\n\t\t,-0.224592,0.431334,-0.116228,0.071831,0.480969,0.116228,-0.071831,0.480969,-0.116228,0.224592,0.431334,0.116228,0.340821,0.346889,-0.116228,0.411309,-0.129945,0.252862,0.250687,-0.351022,0.252864\n\t\t,-0.256376,-0.346888,0.252864,0.003513,-0.431332,0.252864,-0.409136,0.136631,0.252863,-0.409136,-0.136631,0.252863,0.003513,0.431332,0.252864,-0.256376,0.346888,0.252864,0.250687,0.351022,0.252864\n\t\t,0.411309,0.129945,0.252862,0.369087,0.000000,0.337305,0.136633,0.000000,0.480969,0.042221,-0.129945,0.480970,0.114052,-0.351021,0.337308,-0.110538,-0.080309,0.480970,-0.298597,-0.216941,0.337307\n\t\t,-0.110538,0.080309,0.480970,-0.298597,0.216941,0.337307,0.114052,0.351021,0.337308,0.042221,0.129945,0.480970,0.180902,-0.293890,-0.361806,0.069099,-0.212660,-0.447215,0.026395,-0.344093,-0.361806\n\t\t,0.335409,-0.081228,-0.361805,0.223605,0.000000,-0.447215,0.335409,0.081228,-0.361805,-0.223605,-0.262864,-0.361806,-0.180900,-0.131431,-0.447215,-0.319097,-0.131432,-0.361805,-0.319097,0.131432,-0.361805\n\t\t,-0.180900,0.131431,-0.447215,-0.223605,0.262864,-0.361806,0.026395,0.344093,-0.361806,0.069099,0.212660,-0.447215,0.180902,0.293890,-0.361806,0.473607,-0.081229,-0.138198,0.473607,0.081229,-0.138198\n\t\t,0.500000,0.000000,0.000000,0.069099,-0.475528,-0.138199,0.223608,-0.425324,-0.138198,0.154509,-0.475528,0.000000,-0.430902,-0.212661,-0.138198,-0.335410,-0.344095,-0.138198,-0.404509,-0.293892,0.000000\n\t\t,-0.335410,0.344095,-0.138198,-0.430902,0.212661,-0.138198,-0.404509,0.293892,0.000000,0.223608,0.425324,-0.138198,0.069099,0.475528,-0.138199,0.154509,0.475528,0.000000,0.430902,-0.212661,0.138198\n\t\t,0.404509,-0.293892,0.000000,0.335410,-0.344095,0.138198,-0.069099,-0.475528,0.138199,-0.154509,-0.475528,0.000000,-0.223608,-0.425324,0.138198,-0.473607,-0.081229,0.138198,-0.500000,0.000000,0.000000\n\t\t,-0.473607,0.081229,0.138198,-0.223608,0.425324,0.138198,-0.154509,0.475528,0.000000,-0.069099,0.475528,0.138199,0.335410,0.344095,0.138198,0.404509,0.293892,0.000000,0.430902,0.212661,0.138198\n\t\t,0.223605,-0.262864,0.361806,0.319097,-0.131432,0.361805,0.180900,-0.131431,0.447215,-0.180902,-0.293890,0.361806,-0.026395,-0.344093,0.361806,-0.069099,-0.212660,0.447215,-0.335409,0.081228,0.361805\n\t\t,-0.335409,-0.081228,0.361805,-0.223605,0.000000,0.447215,-0.026395,0.344093,0.361806,-0.180902,0.293890,0.361806,-0.069099,0.212660,0.447215,0.319097,0.131432,0.361805,0.223605,0.262864,0.361806\n\t\t,0.180900,0.131431,0.447215,0.000000,0.239263,0.891168,0.046678,0.234666,0.891168,0.091562,0.221051,0.891168,0.132928,0.198940,0.891168,0.169185,0.169185,0.891168,0.198940,0.132928,0.891168\n\t\t,0.221050,0.091562,0.891168,0.234666,0.046678,0.891168,0.239263,0.000000,0.891168,0.234666,-0.046678,0.891168,0.221050,-0.091562,0.891168,0.198940,-0.132927,0.891168,0.169185,-0.169185,0.891168\n\t\t,0.132928,-0.198940,0.891168,0.091562,-0.221050,0.891168,0.046678,-0.234666,0.891168,-0.000000,-0.239263,0.891168,-0.046678,-0.234666,0.891168,-0.091562,-0.221050,0.891168,-0.132928,-0.198940,0.891168\n\t\t,-0.169185,-0.169185,0.891168,-0.198940,-0.132927,0.891168,-0.221051,-0.091562,0.891168,-0.234666,-0.046678,0.891168,-0.239263,0.000000,0.891168,-0.234666,0.046678,0.891168,-0.221050,0.091562,0.891168\n\t\t,-0.198940,0.132928,0.891168,-0.169184,0.169185,0.891168,-0.132927,0.198940,0.891168,-0.091562,0.221051,0.891168,-0.046678,0.234666,0.891168,0.000000,0.000000,1.222458,-0.000000,0.086093,0.485574\n\t\t,0.016796,0.084439,0.485574,0.032947,0.079540,0.485574,0.047831,0.071584,0.485574,0.060877,0.060877,0.485574,0.071584,0.047831,0.485574,0.079540,0.032946,0.485574,0.084439,0.016796,0.485574\n\t\t,0.086093,-0.000000,0.485574,0.084439,-0.016796,0.485574,0.079540,-0.032947,0.485574,0.071584,-0.047831,0.485574,0.060877,-0.060878,0.485574,0.047831,-0.071584,0.485574,0.032946,-0.079540,0.485574\n\t\t,0.016796,-0.084439,0.485574,-0.000000,-0.086094,0.485574,-0.016796,-0.084439,0.485574,-0.032947,-0.079540,0.485574,-0.047831,-0.071584,0.485574,-0.060877,-0.060878,0.485574,-0.071584,-0.047831,0.485574\n\t\t,-0.079540,-0.032947,0.485574,-0.084439,-0.016796,0.485574,-0.086093,-0.000000,0.485574,-0.084439,0.016796,0.485574,-0.079540,0.032946,0.485574,-0.071584,0.047831,0.485574,-0.060877,0.060877,0.485574\n\t\t,-0.047831,0.071584,0.485574,-0.032946,0.079540,0.485574,-0.016796,0.084439,0.485574,0.000000,0.086093,0.890994,0.016796,0.084439,0.890994,0.032947,0.079540,0.890994,0.047831,0.071584,0.890994\n\t\t,0.060877,0.060877,0.890994,0.071584,0.047830,0.890994,0.079540,0.032946,0.890994,0.084439,0.016796,0.890994,0.086093,-0.000001,0.890994,0.084439,-0.016796,0.890994,0.079540,-0.032947,0.890994\n\t\t,0.071584,-0.047831,0.890994,0.060877,-0.060878,0.890994,0.047831,-0.071584,0.890994,0.032947,-0.079540,0.890994,0.016796,-0.084439,0.890994,0.000000,-0.086094,0.890994,-0.016796,-0.084440,0.890994\n\t\t,-0.032946,-0.079540,0.890994,-0.047831,-0.071585,0.890994,-0.060877,-0.060878,0.890994,-0.071584,-0.047831,0.890994,-0.079540,-0.032947,0.890994,-0.084439,-0.016797,0.890994,-0.086093,-0.000001,0.890994\n\t\t,-0.084439,0.016795,0.890994,-0.079540,0.032946,0.890994,-0.071584,0.047830,0.890994,-0.060878,0.060877,0.890994,-0.047831,0.071583,0.890994,-0.032947,0.079539,0.890994,-0.016797,0.084439,0.890994\n\t\tPolygonVertexIndex: 102,46,-15,46,102,-44,12,43,-103,43,1,-47,102,103,-13,103,102,-105,14,104,-103,104,13,-104,45,47,-3,47,45,-105,13,104,-46,104,14,-48,44,103,-14\n\t\t,103,44,-43,0,42,-45,42,12,-104,105,16,-51,50,43,-106,12,105,-44,43,50,-2,105,12,-107,106,107,-106,16,105,-108,107,106,-16,49,5,-52,51,107,-50\n\t\t,15,49,-108,107,51,-17,48,15,-107,106,42,-49,0,48,-43,42,106,-13,108,55,-19,55,108,-46,13,45,-109,45,2,-56,108,109,-14,109,108,-111,18,110,-109\n\t\t,110,17,-110,53,54,-4,54,53,-111,17,110,-54,110,18,-55,52,109,-18,109,52,-45,0,44,-53,44,13,-110,111,59,-21,59,111,-54,17,53,-112,53,3,-60\n\t\t,111,112,-18,112,111,-114,20,113,-112,113,19,-113,57,58,-5,58,57,-114,19,113,-58,113,20,-59,56,112,-20,112,56,-53,0,52,-57,52,17,-113,114,60,-22\n\t\t,60,114,-58,19,57,-115,57,4,-61,114,115,-20,115,114,-117,21,116,-115,116,15,-116,49,61,-6,61,49,-117,15,116,-50,116,21,-62,48,115,-16,115,48,-57\n\t\t,0,56,-49,56,19,-116,117,23,-65,64,50,-118,16,117,-51,50,64,-2,117,16,-119,118,119,-118,23,117,-120,119,118,-23,62,10,-66,65,119,-63,22,62,-120\n\t\t,119,65,-24,63,22,-119,118,51,-64,5,63,-52,51,118,-17,120,25,-69,68,47,-121,14,120,-48,47,68,-3,120,14,-122,121,122,-121,25,120,-123,122,121,-25\n\t\t,67,6,-70,69,122,-68,24,67,-123,122,69,-26,66,24,-122,121,46,-67,1,66,-47,46,121,-15,123,27,-74,73,54,-124,18,123,-55,54,73,-4,123,18,-125\n\t\t,124,125,-124,27,123,-126,125,124,-27,70,7,-73,72,125,-71,26,70,-126,125,72,-28,71,26,-125,124,55,-72,2,71,-56,55,124,-19,126,29,-78,77,58,-127\n\t\t,20,126,-59,58,77,-5,126,20,-128,127,128,-127,29,126,-129,128,127,-29,74,8,-77,76,128,-75,28,74,-129,128,76,-30,75,28,-128,127,59,-76,3,75,-60\n\t\t,59,127,-21,129,31,-82,81,61,-130,21,129,-62,61,81,-6,129,21,-131,130,131,-130,31,129,-132,131,130,-31,78,9,-81,80,131,-79,30,78,-132,131,80,-32\n\t\t,79,30,-131,130,60,-80,4,79,-61,60,130,-22,132,82,-33,82,132,-66,23,65,-133,65,10,-83,132,133,-24,133,132,-135,32,134,-133,134,24,-134,67,83,-7\n\t\t,83,67,-135,24,134,-68,134,32,-84,66,133,-25,133,66,-65,1,64,-67,64,23,-134,135,85,-34,85,135,-70,25,69,-136,69,6,-86,135,136,-26,136,135,-138\n\t\t,33,137,-136,137,26,-137,70,84,-8,84,70,-138,26,137,-71,137,33,-85,71,136,-27,136,71,-69,2,68,-72,68,25,-137,138,87,-35,87,138,-73,27,72,-139\n\t\t,72,7,-88,138,139,-28,139,138,-141,34,140,-139,140,28,-140,74,86,-9,86,74,-141,28,140,-75,140,34,-87,75,139,-29,139,75,-74,3,73,-76,73,27,-140\n\t\t,141,89,-36,89,141,-77,29,76,-142,76,8,-90,141,142,-30,142,141,-144,35,143,-142,143,30,-143,78,88,-10,88,78,-144,30,143,-79,143,35,-89,79,142,-31\n\t\t,142,79,-78,4,77,-80,77,29,-143,144,90,-37,90,144,-81,31,80,-145,80,9,-91,144,145,-32,145,144,-147,36,146,-145,146,22,-146,62,91,-11,91,62,-147\n\t\t,22,146,-63,146,36,-92,63,145,-23,145,63,-82,5,81,-64,81,31,-146,147,38,-96,95,83,-148,32,147,-84,83,95,-7,147,32,-149,148,149,-148,38,147,-150\n\t\t,149,148,-38,93,11,-95,94,149,-94,37,93,-150,149,94,-39,92,37,-149,148,82,-93,10,92,-83,82,148,-33,150,39,-98,97,84,-151,33,150,-85,84,97,-8\n\t\t,150,33,-152,151,152,-151,39,150,-153,152,151,-39,94,11,-97,96,152,-95,38,94,-153,152,96,-40,95,38,-152,151,85,-96,6,95,-86,85,151,-34,153,40,-100\n\t\t,99,86,-154,34,153,-87,86,99,-9,153,34,-155,154,155,-154,40,153,-156,155,154,-40,96,11,-99,98,155,-97,39,96,-156,155,98,-41,97,39,-155,154,87,-98\n\t\t,7,97,-88,87,154,-35,156,41,-101,100,88,-157,35,156,-89,88,100,-10,156,35,-158,157,158,-157,41,156,-159,158,157,-41,98,11,-102,101,158,-99,40,98,-159\n\t\t,158,101,-42,99,40,-158,157,89,-100,8,99,-90,89,157,-36,159,37,-93,92,91,-160,36,159,-92,91,92,-11,159,36,-161,160,161,-160,37,159,-162,161,160,-42\n\t\t,101,11,-94,93,161,-102,41,101,-162,161,93,-38,100,41,-161,160,90,-101,9,100,-91,90,160,-37,194,163,-163,194,164,-164,194,165,-165,194,166,-166,194,167,-167\n\t\t,194,168,-168,194,169,-169,194,170,-170,194,171,-171,194,172,-172,194,173,-173,194,174,-174,194,175,-175,194,176,-176,194,177,-177,194,178,-178,194,179,-179,194,180,-180\n\t\t,194,181,-181,194,182,-182,194,183,-183,194,184,-184,194,185,-185,194,186,-186,194,187,-187,194,188,-188,194,189,-189,194,190,-190,194,191,-191,194,192,-192,194,193,-193\n\t\t,194,162,-194,195,227,228,-197,196,228,229,-198,197,229,230,-199,198,230,231,-200,199,231,232,-201,200,232,233,-202,201,233,234,-203,202,234,235,-204,203,235,236,-205,204,236,237,-206,205,237,238,-207,206,238,239,-208\n\t\t,207,239,240,-209,208,240,241,-210,209,241,242,-211,210,242,243,-212,211,243,244,-213,212,244,245,-214,213,245,246,-215,214,246,247,-216,215,247,248,-217,216,248,249,-218,217,249,250,-219,218,250,251,-220,219,251,252,-221\n\t\t,220,252,253,-222,221,253,254,-223,222,254,255,-224,223,255,256,-225,224,256,257,-226,225,257,258,-227,226,258,227,-196,170,235,-235,251,186,-253,251,185,-187,171,235,-171,171,236,-236,250,185,-252\n\t\t,187,252,-187,187,253,-253,169,234,-234,169,170,-235,162,164,-194,162,163,-165,233,168,-170,233,232,-169,253,188,-255,253,187,-189,236,172,-238,236,171,-173,250,184,-186\n\t\t,250,249,-185,178,179,-181,249,183,-185,249,248,-184,237,173,-239,237,172,-174,242,181,-244,244,243,-182,181,178,-181,232,167,-169,232,231,-168,254,189,-256,254,188,-190\n\t\t,229,228,-166,245,244,-182,231,166,-168,231,230,-167,230,165,-167,230,229,-166,246,245,-182,248,182,-184,248,247,-183,227,258,-194,247,181,-183,247,246,-182,177,242,-177\n\t\t,192,193,-259,228,227,-194,255,190,-257,255,189,-191,176,242,-242,238,174,-240,238,173,-175,178,242,-178,178,181,-243,164,228,-194,164,165,-229,256,191,-258,256,190,-192\n\t\t,239,175,-241,239,174,-176,192,257,-192,192,258,-258,240,176,-242,240,175,-177\n\t\tEdges: \n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByVertice\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.000000000000000,0.000000000000000,-1.000000000000000,0.723593831062317,-0.525711834430695,-0.447218239307404\n\t\t\t ,-0.276375621557236,-0.850642442703247,-0.447218239307404,-0.894405961036682,0.000000000000000,-0.447187721729279\n\t\t\t ,-0.276375621557236,0.850642442703247,-0.447218239307404,0.723593831062317,0.525711834430695,-0.447218239307404\n\t\t\t ,0.276375621557236,-0.850642442703247,0.447218239307404,-0.723593831062317,-0.525711834430695,0.447218239307404\n\t\t\t ,-0.723593831062317,0.525711834430695,0.447218239307404,0.276375621557236,0.850642442703247,0.447218239307404\n\t\t\t ,0.894405961036682,0.000000000000000,0.447187721729279,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t\t ,0.425305962562561,-0.308999896049500,-0.850642442703247,-0.162450030446053,-0.499984741210938,-0.850642442703247\n\t\t\t ,0.262855917215347,-0.808984637260437,-0.525711834430695,0.425305962562561,0.308999896049500,-0.850642442703247\n\t\t\t ,0.850642442703247,0.000000000000000,-0.525711834430695,-0.525711834430695,0.000000000000000,-0.850642442703247\n\t\t\t ,-0.688161849975586,-0.499984741210938,-0.525711834430695,-0.162450030446053,0.499984741210938,-0.850642442703247\n\t\t\t ,-0.688161849975586,0.499984741210938,-0.525711834430695,0.262855917215347,0.808984637260437,-0.525711834430695\n\t\t\t ,0.951048314571381,0.308999896049500,0.000000000000000,0.951048314571381,-0.308999896049500,0.000000000000000\n\t\t\t ,0.587755978107452,-0.809015154838562,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000\n\t\t\t ,-0.587755978107452,-0.809015154838562,0.000000000000000,-0.951048314571381,-0.308999896049500,0.000000000000000\n\t\t\t ,-0.951048314571381,0.308999896049500,0.000000000000000,-0.587755978107452,0.809015154838562,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.587755978107452,0.809015154838562,0.000000000000000\n\t\t\t ,0.688161849975586,-0.499984741210938,0.525711834430695,-0.262855917215347,-0.808984637260437,0.525711834430695\n\t\t\t ,-0.850642442703247,0.000000000000000,0.525711834430695,-0.262855917215347,0.808984637260437,0.525711834430695\n\t\t\t ,0.688161849975586,0.499984741210938,0.525711834430695,0.525711834430695,0.000000000000000,0.850642442703247\n\t\t\t ,0.162450030446053,-0.499984741210938,0.850642442703247,-0.425305962562561,-0.308999896049500,0.850642442703247\n\t\t\t ,-0.425305962562561,0.308999896049500,0.850642442703247,0.162450030446053,0.499984741210938,0.850642442703247\n\t\t\t ,0.219458594918251,-0.159459218382835,-0.962492763996124,0.598284840583801,-0.434675127267838,-0.673085749149323\n\t\t\t ,-0.083834342658520,-0.258003473281860,-0.962492763996124,-0.228522598743439,-0.703329563140869,-0.673085749149323\n\t\t\t ,0.514481008052826,-0.692709147930145,-0.505417048931122,-0.009033478796482,-0.862819314002991,-0.505417048931122\n\t\t\t ,0.219458594918251,0.159459218382835,-0.962492763996124,0.598284840583801,0.434675127267838,-0.673085749149323\n\t\t\t ,0.817773997783661,-0.275215923786163,-0.505417048931122,0.817773997783661,0.275215923786163,-0.505417048931122\n\t\t\t ,-0.271279036998749,0.000000000000000,-0.962492763996124,-0.739524543285370,0.000000000000000,-0.673085749149323\n\t\t\t ,-0.823358893394470,-0.258003473281860,-0.505417048931122,-0.499801635742188,-0.703329563140869,-0.505417048931122\n\t\t\t ,-0.083834342658520,0.258003473281860,-0.962492763996124,-0.228522598743439,0.703329563140869,-0.673085749149323\n\t\t\t ,-0.499801635742188,0.703329563140869,-0.505417048931122,-0.823358893394470,0.258003473281860,-0.505417048931122\n\t\t\t ,-0.009033478796482,0.862819314002991,-0.505417048931122,0.514481008052826,0.692709147930145,-0.505417048931122\n\t\t\t ,0.959013640880585,0.159459218382835,0.234107479453087,0.869594395160675,0.434675127267838,-0.234107479453087\n\t\t\t ,0.869594395160675,-0.434675127267838,-0.234107479453087,0.959013640880585,-0.159459218382835,0.234107479453087\n\t\t\t ,0.682149708271027,-0.692709147930145,-0.234107479453087,0.448011726140976,-0.862819314002991,0.234107479453087\n\t\t\t ,-0.144688248634338,-0.961363554000854,-0.234107479453087,0.144688248634338,-0.961363554000854,0.234107479453087\n\t\t\t ,-0.682149708271027,-0.692709147930145,0.234107479453087,-0.448011726140976,-0.862819314002991,-0.234107479453087\n\t\t\t ,-0.869594395160675,-0.434675127267838,0.234107479453087,-0.959013640880585,-0.159459218382835,-0.234107479453087\n\t\t\t ,-0.869594395160675,0.434675127267838,0.234107479453087,-0.959013640880585,0.159459218382835,-0.234107479453087\n\t\t\t ,-0.682149708271027,0.692709147930145,0.234107479453087,-0.448011726140976,0.862819314002991,-0.234107479453087\n\t\t\t ,0.144688248634338,0.961363554000854,0.234107479453087,-0.144688248634338,0.961363554000854,-0.234107479453087\n\t\t\t ,0.448011726140976,0.862819314002991,0.234107479453087,0.682149708271027,0.692709147930145,-0.234107479453087\n\t\t\t ,0.823358893394470,-0.258003473281860,0.505417048931122,0.499801635742188,-0.703329563140869,0.505417048931122\n\t\t\t ,-0.514481008052826,-0.692709147930145,0.505417048931122,0.009033478796482,-0.862819314002991,0.505417048931122\n\t\t\t ,-0.817773997783661,0.275215923786163,0.505417048931122,-0.817773997783661,-0.275215923786163,0.505417048931122\n\t\t\t ,0.009033478796482,0.862819314002991,0.505417048931122,-0.514481008052826,0.692709147930145,0.505417048931122\n\t\t\t ,0.499801635742188,0.703329563140869,0.505417048931122,0.823358893394470,0.258003473281860,0.505417048931122\n\t\t\t ,0.739524543285370,0.000000000000000,0.673085749149323,0.271279036998749,0.000000000000000,0.962492763996124\n\t\t\t ,0.083834342658520,-0.258003473281860,0.962492763996124,0.228522598743439,-0.703329563140869,0.673085749149323\n\t\t\t ,-0.219458594918251,-0.159459218382835,0.962492763996124,-0.598284840583801,-0.434675127267838,0.673085749149323\n\t\t\t ,-0.219458594918251,0.159459218382835,0.962492763996124,-0.598284840583801,0.434675127267838,0.673085749149323\n\t\t\t ,0.228522598743439,0.703329563140869,0.673085749149323,0.083834342658520,0.258003473281860,0.962492763996124\n\t\t\t ,0.352458268404007,-0.587725460529327,-0.728202164173126,0.141056552529335,-0.434125810861588,-0.889706134796143\n\t\t\t ,0.060304574668407,-0.682668566703796,-0.728202164173126,0.667897582054138,-0.153599664568901,-0.728202164173126\n\t\t\t ,0.456465333700180,0.000000000000000,-0.889706134796143,0.667897582054138,0.153599664568901,-0.728202164173126\n\t\t\t ,-0.450056463479996,-0.516830980777740,-0.728202164173126,-0.369273960590363,-0.268288224935532,-0.889706134796143\n\t\t\t ,-0.630634486675262,-0.268288224935532,-0.728202164173126,-0.630634486675262,0.268288224935532,-0.728202164173126\n\t\t\t ,-0.369273960590363,0.268288224935532,-0.889706134796143,-0.450056463479996,0.516830980777740,-0.728202164173126\n\t\t\t ,0.060304574668407,0.682668566703796,-0.728202164173126,0.141056552529335,0.434125810861588,-0.889706134796143\n\t\t\t ,0.352458268404007,0.587725460529327,-0.728202164173126,0.950010657310486,-0.153599664568901,-0.271706283092499\n\t\t\t ,0.950010657310486,0.153599664568901,-0.271706283092499,0.999938964843750,0.000000000000000,-0.010376293212175\n\t\t\t ,0.147465437650681,-0.950987279415131,-0.271706283092499,0.439649641513824,-0.856044173240662,-0.271706283092499\n\t\t\t ,0.308999896049500,-0.950987279415131,-0.010376293212175,-0.858882427215576,-0.434125810861588,-0.271706283092499\n\t\t\t ,-0.678304374217987,-0.682668566703796,-0.271706283092499,-0.808954119682312,-0.587725460529327,-0.010376293212175\n\t\t\t ,-0.678304374217987,0.682668566703796,-0.271706283092499,-0.858882427215576,0.434125810861588,-0.271706283092499\n\t\t\t ,-0.808954119682312,0.587725460529327,-0.010376293212175,0.439649641513824,0.856044173240662,-0.271706283092499\n\t\t\t ,0.147465437650681,0.950987279415131,-0.271706283092499,0.308999896049500,0.950987279415131,-0.010376293212175\n\t\t\t ,0.858882427215576,-0.434125810861588,0.271706283092499,0.808954119682312,-0.587725460529327,0.010376293212175\n\t\t\t ,0.678304374217987,-0.682668566703796,0.271706283092499,-0.147465437650681,-0.950987279415131,0.271706283092499\n\t\t\t ,-0.308999896049500,-0.950987279415131,0.010376293212175,-0.439649641513824,-0.856044173240662,0.271706283092499\n\t\t\t ,-0.950010657310486,-0.153599664568901,0.271706283092499,-0.999938964843750,0.000000000000000,0.010376293212175\n\t\t\t ,-0.950010657310486,0.153599664568901,0.271706283092499,-0.439649641513824,0.856044173240662,0.271706283092499\n\t\t\t ,-0.308999896049500,0.950987279415131,0.010376293212175,-0.147465437650681,0.950987279415131,0.271706283092499\n\t\t\t ,0.678304374217987,0.682668566703796,0.271706283092499,0.808954119682312,0.587725460529327,0.010376293212175\n\t\t\t ,0.858882427215576,0.434125810861588,0.271706283092499,0.450056463479996,-0.516830980777740,0.728202164173126\n\t\t\t ,0.630634486675262,-0.268288224935532,0.728202164173126,0.369273960590363,-0.268288224935532,0.889706134796143\n\t\t\t ,-0.352458268404007,-0.587725460529327,0.728202164173126,-0.060304574668407,-0.682668566703796,0.728202164173126\n\t\t\t ,-0.141056552529335,-0.434125810861588,0.889706134796143,-0.667897582054138,0.153599664568901,0.728202164173126\n\t\t\t ,-0.667897582054138,-0.153599664568901,0.728202164173126,-0.456465333700180,0.000000000000000,0.889706134796143\n\t\t\t ,-0.060304574668407,0.682668566703796,0.728202164173126,-0.352458268404007,0.587725460529327,0.728202164173126\n\t\t\t ,-0.141056552529335,0.434125810861588,0.889706134796143,0.630634486675262,0.268288224935532,0.728202164173126\n\t\t\t ,0.450056463479996,0.516830980777740,0.728202164173126,0.369273960590363,0.268288224935532,0.889706134796143\n\t\t\t ,0.000000000000000,0.900845348834991,-0.434125810861588,0.175725579261780,0.883510828018188,-0.434125810861588\n\t\t\t ,0.344737082719803,0.832483887672424,-0.433668017387390,0.500595092773438,0.749198913574219,-0.433637499809265\n\t\t\t ,0.637134909629822,0.637134909629822,-0.433637499809265,0.749198913574219,0.500595092773438,-0.433637499809265\n\t\t\t ,0.832483887672424,0.344798117876053,-0.433637499809265,0.883754968643188,0.175786614418030,-0.433637499809265\n\t\t\t ,0.901058971881866,0.000000000000000,-0.433637499809265,0.883754968643188,-0.175786614418030,-0.433637499809265\n\t\t\t ,0.832483887672424,-0.344798117876053,-0.433637499809265,0.749198913574219,-0.500595092773438,-0.433637499809265\n\t\t\t ,0.637134909629822,-0.637134909629822,-0.433637499809265,0.500595092773438,-0.749198913574219,-0.433637499809265\n\t\t\t ,0.344798117876053,-0.832483887672424,-0.433637499809265,0.175786614418030,-0.883754968643188,-0.433637499809265\n\t\t\t ,-0.000091555528343,-0.901058971881866,-0.433668017387390,-0.175725579261780,-0.883510828018188,-0.434125810861588\n\t\t\t ,-0.344737082719803,-0.832270264625549,-0.434125810861588,-0.500503540039062,-0.749259948730469,-0.433668017387390\n\t\t\t ,-0.637134909629822,-0.637134909629822,-0.433637499809265,-0.749198913574219,-0.500595092773438,-0.433637499809265\n\t\t\t ,-0.832483887672424,-0.344798117876053,-0.433637499809265,-0.883754968643188,-0.175786614418030,-0.433637499809265\n\t\t\t ,-0.901058971881866,0.000000000000000,-0.433637499809265,-0.883754968643188,0.175786614418030,-0.433637499809265\n\t\t\t ,-0.832483887672424,0.344828635454178,-0.433637499809265,-0.749198913574219,0.500595092773438,-0.433637499809265\n\t\t\t ,-0.637134909629822,0.637134909629822,-0.433637499809265,-0.500595092773438,0.749198913574219,-0.433637499809265\n\t\t\t ,-0.344798117876053,0.832483887672424,-0.433637499809265,-0.175695061683655,0.883754968643188,-0.433668017387390\n\t\t\t ,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.195074319839478,0.980773329734802,0.000000000000000,0.382671594619751,0.923856317996979,0.000000000000000\n\t\t\t ,0.555558919906616,0.831446290016174,0.000000000000000,0.707083344459534,0.707083344459534,0.000000000000000\n\t\t\t ,0.831446290016174,0.555558919906616,0.000000000000000,0.923856317996979,0.382671594619751,0.000000000000000\n\t\t\t ,0.980773329734802,0.195074319839478,0.000000000000000,0.999969482421875,0.000000000000000,0.000000000000000\n\t\t\t ,0.980773329734802,-0.195074319839478,0.000000000000000,0.923856317996979,-0.382671594619751,0.000000000000000\n\t\t\t ,0.831446290016174,-0.555558919906616,0.000000000000000,0.707083344459534,-0.707083344459534,0.000000000000000\n\t\t\t ,0.555558919906616,-0.831446290016174,0.000000000000000,0.382671594619751,-0.923856317996979,0.000000000000000\n\t\t\t ,0.195074319839478,-0.980773329734802,0.000000000000000,0.000000000000000,-0.999969482421875,0.000000000000000\n\t\t\t ,-0.195074319839478,-0.980773329734802,0.000000000000000,-0.382671594619751,-0.923856317996979,0.000000000000000\n\t\t\t ,-0.555558919906616,-0.831446290016174,0.000000000000000,-0.707083344459534,-0.707083344459534,0.000000000000000\n\t\t\t ,-0.831446290016174,-0.555558919906616,0.000000000000000,-0.923856317996979,-0.382671594619751,0.000000000000000\n\t\t\t ,-0.980773329734802,-0.195074319839478,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000\n\t\t\t ,-0.980773329734802,0.195074319839478,0.000000000000000,-0.923856317996979,0.382671594619751,0.000000000000000\n\t\t\t ,-0.831446290016174,0.555558919906616,0.000000000000000,-0.707083344459534,0.707083344459534,0.000000000000000\n\t\t\t ,-0.555558919906616,0.831446290016174,0.000000000000000,-0.382671594619751,0.923856317996979,0.000000000000000\n\t\t\t ,-0.195074319839478,0.980773329734802,0.000000000000000,0.000000000000000,0.684041857719421,-0.729392349720001\n\t\t\t ,0.133426919579506,0.670918941497803,-0.729392349720001,0.261757254600525,0.631977319717407,-0.729392349720001\n\t\t\t ,0.380016475915909,0.568742930889130,-0.729422867298126,0.483687847852707,0.483687847852707,-0.729422867298126\n\t\t\t ,0.568742930889130,0.380016475915909,-0.729422867298126,0.631977319717407,0.261757254600525,-0.729422867298126\n\t\t\t ,0.670888364315033,0.133426919579506,-0.729422867298126,0.684041857719421,0.000000000000000,-0.729422867298126\n\t\t\t ,0.670888364315033,-0.133426919579506,-0.729422867298126,0.631977319717407,-0.261757254600525,-0.729422867298126\n\t\t\t ,0.568742930889130,-0.380016475915909,-0.729422867298126,0.483687847852707,-0.483687847852707,-0.729422867298126\n\t\t\t ,0.380016475915909,-0.568742930889130,-0.729422867298126,0.261757254600525,-0.631977319717407,-0.729422867298126\n\t\t\t ,0.133365884423256,-0.670918941497803,-0.729392349720001,0.000061037018895,-0.684224963188171,-0.729239761829376\n\t\t\t ,-0.133396402001381,-0.670979976654053,-0.729361832141876,-0.261757254600525,-0.631977319717407,-0.729392349720001\n\t\t\t ,-0.380016475915909,-0.568742930889130,-0.729422867298126,-0.483687847852707,-0.483687847852707,-0.729422867298126\n\t\t\t ,-0.568742930889130,-0.380016475915909,-0.729422867298126,-0.631977319717407,-0.261757254600525,-0.729422867298126\n\t\t\t ,-0.670888364315033,-0.133426919579506,-0.729422867298126,-0.684041857719421,0.000000000000000,-0.729422867298126\n\t\t\t ,-0.670888364315033,0.133426919579506,-0.729422867298126,-0.631977319717407,0.261757254600525,-0.729422867298126\n\t\t\t ,-0.568742930889130,0.380016475915909,-0.729422867298126,-0.483687847852707,0.483687847852707,-0.729422867298126\n\t\t\t ,-0.380016475915909,0.568742930889130,-0.729422867298126,-0.261757254600525,0.631977319717407,-0.729422867298126\n\t\t\t ,-0.133426919579506,0.670888364315033,-0.729422867298126\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVTex\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,1.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000,0.000000,1.000000,0.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\tUVIndex: 0,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\n\t\t\t\t,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109\n\t\t\t\t,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164\n\t\t\t\t,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219\n\t\t\t\t,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274\n\t\t\t\t,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329\n\t\t\t\t,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384\n\t\t\t\t,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439\n\t\t\t\t,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494\n\t\t\t\t,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549\n\t\t\t\t,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604\n\t\t\t\t,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659\n\t\t\t\t,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714\n\t\t\t\t,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769\n\t\t\t\t,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824\n\t\t\t\t,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879\n\t\t\t\t,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934\n\t\t\t\t,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989\n\t\t\t\t,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044\n\t\t\t\t,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099\n\t\t\t\t,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154\n\t\t\t\t,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,1191,1192,1193,1194,1195,1196,1197,1198,1199,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209\n\t\t\t\t,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222,1223,1224,1225,1226,1227,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1248,1249,1250,1251,1252,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263,1264\n\t\t\t\t,1265,1266,1267,1268,1269,1270,1271,1272,1273,1274,1275,1276,1277,1278,1279,1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1316,1317,1318,1319\n\t\t\t\t,1320,1321,1322,1323,1324,1325,1326,1327,1328,1329,1330,1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,1341,1342,1343,1344,1345,1346,1347,1348,1349,1350,1351,1352,1353,1354,1355,1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1367,1368,1369,1370,1371,1372,1373,1374\n\t\t\t\t,1375\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t},0.000000,0.000000,-0.500000,0.361800,-0.262860,-0.223607,-0.138193,-0.425320,-0.223607,-0.447212,0.000000,-0.223607,-0.138193,0.425320,-0.223607,0.361800,0.262860,-0.223607\n\t\t,0.138193,-0.425320,0.223607,-0.361800,-0.262860,0.223607,-0.361800,0.262860,0.223607,0.138193,0.425320,0.223607,0.447212,0.000000,0.223607,0.000000,0.000000,0.500000,0.212661,-0.154506,-0.425327\n\t\t,-0.081228,-0.249998,-0.425327,0.131434,-0.404506,-0.262869,0.212661,0.154506,-0.425327,0.425324,0.000000,-0.262868,-0.262865,0.000000,-0.425326,-0.344095,-0.249998,-0.262868,-0.081228,0.249998,-0.425327\n\t\t,-0.344095,0.249998,-0.262868,0.131434,0.404506,-0.262869,0.475529,0.154506,0.000000,0.475529,-0.154506,0.000000,0.293893,-0.404508,0.000000,0.000000,-0.500000,0.000000,-0.293893,-0.404508,0.000000\n\t\t,-0.475529,-0.154506,0.000000,-0.475529,0.154506,0.000000,-0.293893,0.404508,0.000000,0.000000,0.500000,0.000000,0.293893,0.404508,0.000000,0.344095,-0.249998,0.262868,-0.131434,-0.404506,0.262869\n\t\t,-0.425324,0.000000,0.262868,-0.131434,0.404506,0.262869,0.344095,0.249998,0.262868,0.262865,0.000000,0.425326,0.081228,-0.249998,0.425327,-0.212661,-0.154506,0.425327,-0.212661,0.154506,0.425327\n\t\t,0.081228,0.249998,0.425327,0.110538,-0.080309,-0.480970,0.298597,-0.216941,-0.337307,-0.042221,-0.129945,-0.480970,-0.114052,-0.351021,-0.337308,0.256376,-0.346888,-0.252864,-0.003513,-0.431332,-0.252864\n\t\t,0.110538,0.080309,-0.480970,0.298597,0.216941,-0.337307,0.409136,-0.136631,-0.252863,0.409136,0.136631,-0.252863,-0.136633,0.000000,-0.480969,-0.369087,0.000000,-0.337305,-0.411309,-0.129945,-0.252862\n\t\t,-0.250687,-0.351022,-0.252864,-0.042221,0.129945,-0.480970,-0.114052,0.351021,-0.337308,-0.250687,0.351022,-0.252864,-0.411309,0.129945,-0.252862,-0.003513,0.431332,-0.252864,0.256376,0.346888,-0.252864\n\t\t,0.479626,0.080310,0.116228,0.435233,0.216942,-0.116228,0.435233,-0.216942,-0.116228,0.479626,-0.080310,0.116228,0.340821,-0.346889,-0.116228,0.224592,-0.431334,0.116228,-0.071831,-0.480969,-0.116228\n\t\t,0.071831,-0.480969,0.116228,-0.340821,-0.346889,0.116228,-0.224592,-0.431334,-0.116228,-0.435233,-0.216942,0.116228,-0.479626,-0.080310,-0.116228,-0.435233,0.216942,0.116228,-0.479626,0.080310,-0.116228\n\t\t,-0.340821,0.346889,0.116228,-0.224592,0.431334,-0.116228,0.071831,0.480969,0.116228,-0.071831,0.480969,-0.116228,0.224592,0.431334,0.116228,0.340821,0.346889,-0.116228,0.411309,-0.129945,0.252862\n\t\t,0.250687,-0.351022,0.252864,-0.256376,-0.346888,0.252864,0.003513,-0.431332,0.252864,-0.409136,0.136631,0.252863,-0.409136,-0.136631,0.252863,0.003513,0.431332,0.252864,-0.256376,0.346888,0.252864\n\t\t,0.250687,0.351022,0.252864,0.411309,0.129945,0.252862,0.369087,0.000000,0.337305,0.136633,0.000000,0.480969,0.042221,-0.129945,0.480970,0.114052,-0.351021,0.337308,-0.110538,-0.080309,0.480970\n\t\t,-0.298597,-0.216941,0.337307,-0.110538,0.080309,0.480970,-0.298597,0.216941,0.337307,0.114052,0.351021,0.337308,0.042221,0.129945,0.480970,0.180902,-0.293890,-0.361806,0.069099,-0.212660,-0.447215\n\t\t,0.026395,-0.344093,-0.361806,0.335409,-0.081228,-0.361805,0.223605,0.000000,-0.447215,0.335409,0.081228,-0.361805,-0.223605,-0.262864,-0.361806,-0.180900,-0.131431,-0.447215,-0.319097,-0.131432,-0.361805\n\t\t,-0.319097,0.131432,-0.361805,-0.180900,0.131431,-0.447215,-0.223605,0.262864,-0.361806,0.026395,0.344093,-0.361806,0.069099,0.212660,-0.447215,0.180902,0.293890,-0.361806,0.473607,-0.081229,-0.138198\n\t\t,0.473607,0.081229,-0.138198,0.500000,0.000000,0.000000,0.069099,-0.475528,-0.138199,0.223608,-0.425324,-0.138198,0.154509,-0.475528,0.000000,-0.430902,-0.212661,-0.138198,-0.335410,-0.344095,-0.138198\n\t\t,-0.404509,-0.293892,0.000000,-0.335410,0.344095,-0.138198,-0.430902,0.212661,-0.138198,-0.404509,0.293892,0.000000,0.223608,0.425324,-0.138198,0.069099,0.475528,-0.138199,0.154509,0.475528,0.000000\n\t\t,0.430902,-0.212661,0.138198,0.404509,-0.293892,0.000000,0.335410,-0.344095,0.138198,-0.069099,-0.475528,0.138199,-0.154509,-0.475528,0.000000,-0.223608,-0.425324,0.138198,-0.473607,-0.081229,0.138198\n\t\t,-0.500000,0.000000,0.000000,-0.473607,0.081229,0.138198,-0.223608,0.425324,0.138198,-0.154509,0.475528,0.000000,-0.069099,0.475528,0.138199,0.335410,0.344095,0.138198,0.404509,0.293892,0.000000\n\t\t,0.430902,0.212661,0.138198,0.223605,-0.262864,0.361806,0.319097,-0.131432,0.361805,0.180900,-0.131431,0.447215,-0.180902,-0.293890,0.361806,-0.026395,-0.344093,0.361806,-0.069099,-0.212660,0.447215\n\t\t,-0.335409,0.081228,0.361805,-0.335409,-0.081228,0.361805,-0.223605,0.000000,0.447215,-0.026395,0.344093,0.361806,-0.180902,0.293890,0.361806,-0.069099,0.212660,0.447215,0.319097,0.131432,0.361805\n\t\t,0.223605,0.262864,0.361806,0.180900,0.131431,0.447215,0.000000,0.239263,0.891168,0.046678,0.234666,0.891168,0.091562,0.221051,0.891168,0.132928,0.198940,0.891168,0.169185,0.169185,0.891168\n\t\t,0.198940,0.132928,0.891168,0.221050,0.091562,0.891168,0.234666,0.046678,0.891168,0.239263,0.000000,0.891168,0.234666,-0.046678,0.891168,0.221050,-0.091562,0.891168,0.198940,-0.132927,0.891168\n\t\t,0.169185,-0.169185,0.891168,0.132928,-0.198940,0.891168,0.091562,-0.221050,0.891168,0.046678,-0.234666,0.891168,-0.000000,-0.239263,0.891168,-0.046678,-0.234666,0.891168,-0.091562,-0.221050,0.891168\n\t\t,-0.132928,-0.198940,0.891168,-0.169185,-0.169185,0.891168,-0.198940,-0.132927,0.891168,-0.221051,-0.091562,0.891168,-0.234666,-0.046678,0.891168,-0.239263,0.000000,0.891168,-0.234666,0.046678,0.891168\n\t\t,-0.221050,0.091562,0.891168,-0.198940,0.132928,0.891168,-0.169184,0.169185,0.891168,-0.132927,0.198940,0.891168,-0.091562,0.221051,0.891168,-0.046678,0.234666,0.891168,0.000000,0.000000,1.222458\n\t\t,-0.000000,0.086093,0.485574,0.016796,0.084439,0.485574,0.032947,0.079540,0.485574,0.047831,0.071584,0.485574,0.060877,0.060877,0.485574,0.071584,0.047831,0.485574,0.079540,0.032946,0.485574\n\t\t,0.084439,0.016796,0.485574,0.086093,-0.000000,0.485574,0.084439,-0.016796,0.485574,0.079540,-0.032947,0.485574,0.071584,-0.047831,0.485574,0.060877,-0.060878,0.485574,0.047831,-0.071584,0.485574\n\t\t,0.032946,-0.079540,0.485574,0.016796,-0.084439,0.485574,-0.000000,-0.086094,0.485574,-0.016796,-0.084439,0.485574,-0.032947,-0.079540,0.485574,-0.047831,-0.071584,0.485574,-0.060877,-0.060878,0.485574\n\t\t,-0.071584,-0.047831,0.485574,-0.079540,-0.032947,0.485574,-0.084439,-0.016796,0.485574,-0.086093,-0.000000,0.485574,-0.084439,0.016796,0.485574,-0.079540,0.032946,0.485574,-0.071584,0.047831,0.485574\n\t\t,-0.060877,0.060877,0.485574,-0.047831,0.071584,0.485574,-0.032946,0.079540,0.485574,-0.016796,0.084439,0.485574,0.000000,0.086093,0.890994,0.016796,0.084439,0.890994,0.032947,0.079540,0.890994\n\t\t,0.047831,0.071584,0.890994,0.060877,0.060877,0.890994,0.071584,0.047830,0.890994,0.079540,0.032946,0.890994,0.084439,0.016796,0.890994,0.086093,-0.000001,0.890994,0.084439,-0.016796,0.890994\n\t\t,0.079540,-0.032947,0.890994,0.071584,-0.047831,0.890994,0.060877,-0.060878,0.890994,0.047831,-0.071584,0.890994,0.032947,-0.079540,0.890994,0.016796,-0.084439,0.890994,0.000000,-0.086094,0.890994\n\t\t,-0.016796,-0.084440,0.890994,-0.032946,-0.079540,0.890994,-0.047831,-0.071585,0.890994,-0.060877,-0.060878,0.890994,-0.071584,-0.047831,0.890994,-0.079540,-0.032947,0.890994,-0.084439,-0.016797,0.890994\n\t\t,-0.086093,-0.000001,0.890994,-0.084439,0.016795,0.890994,-0.079540,0.032946,0.890994,-0.071584,0.047830,0.890994,-0.060878,0.060877,0.890994,-0.047831,0.071583,0.890994,-0.032947,0.079539,0.890994\n\t\t,-0.016797,0.084439,0.890994\n\t}\n\tMaterial: \"Material::unnamed\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"phong\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Phong\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",0.5000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2000\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Shininess\", \"double\", \"\",20.0\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Icosphere\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::unnamed\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Icosphere\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::unnamed\", \"Model::Icosphere\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFlogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/AlphaModels/pyramid.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2014\n\t\tMonth: 04\n\t\tDay: 03\n\t\tHour: 16\n\t\tMinute: 43\n\t\tSecond: 22\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2014-04-03 16:43:22:000\"\nCreator: \"Blender version 2.66 (sub 1)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.000000,-0.000000,-0.004929,-1.000000,-1.000000,1.995070,-1.000000,1.000000,1.995070,1.000000,-1.000000,1.995071,1.000000,0.999999,1.995071\n\t\tPolygonVertexIndex: 1,3,4,-3,0,1,-3,0,4,-4,0,3,-2,0,2,-5\n\t\tEdges: \n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByVertice\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.000000000000000,0.000000000000000,-1.000000000000000,-0.662617862224579,-0.662617862224579,0.349040180444717\n\t\t\t ,-0.662617862224579,0.662617862224579,0.349040180444717,0.662617862224579,-0.662617862224579,0.349040180444717\n\t\t\t ,0.662617862224579,0.662617862224579,0.349040180444717\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000\n\t\t\tUVIndex: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2500\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",9.6\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/AlphaModels/selector.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2012\n\t\tMonth: 10\n\t\tDay: 11\n\t\tHour: 22\n\t\tMinute: 55\n\t\tSecond: 05\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2012-10-11 22:55:05:000\"\nCreator: \"Blender version 2.62 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: -0.771861,-0.771861,0.886380,-0.771861,-0.771861,-0.886380,-0.771861,0.771861,0.886380,-0.771861,0.771861,-0.886380,0.771861,-0.771861,0.886380,0.771861,-0.771861,-0.886380,0.771861,0.771861,0.886380\n\t\t,0.771861,0.771861,-0.886380,-1.660348,-1.660348,1.906688,-1.660348,-1.660348,-1.906688,-1.660348,1.660348,1.906688,-1.660348,1.660348,-1.906688,1.660348,-1.660348,1.906688,1.660348,-1.660348,-1.906688\n\t\t,1.660348,1.660348,1.906688,1.660348,1.660348,-1.906688,-1.965830,-1.541855,1.770616,-1.965830,-1.541855,-1.770616,-1.965830,1.541855,1.770616,-1.965830,1.541855,-1.770616,1.965830,-1.541855,1.770616\n\t\t,1.965830,-1.541855,-1.770616,1.965830,1.541855,1.770616,1.965830,1.541855,-1.770616,-1.629773,-1.145200,1.315111,-1.629773,-1.145200,-1.315111,-1.629773,1.145200,1.315111,-1.629773,1.145200,-1.315111\n\t\t,1.629773,-1.145200,1.315111,1.629773,-1.145200,-1.315111,1.629773,1.145200,1.315111,1.629773,1.145200,-1.315111,-1.541856,-1.965829,1.770616,-1.541856,-1.965829,-1.770616,-1.541856,1.965829,1.770616\n\t\t,-1.541856,1.965829,-1.770616,1.541856,-1.965829,1.770616,1.541856,-1.965829,-1.770616,1.541856,1.965829,1.770616,1.541856,1.965829,-1.770616,-1.145201,-1.629773,1.315111,-1.145201,-1.629773,-1.315111\n\t\t,-1.145201,1.629773,1.315111,-1.145201,1.629773,-1.315111,1.145201,-1.629773,1.315111,1.145201,-1.629773,-1.315111,1.145201,1.629773,1.315111,1.145201,1.629773,-1.315111\n\t\tPolygonVertexIndex: 0,8,16,-25,17,9,1,-26,18,10,2,-27,3,11,19,-28,20,12,4,-29,5,13,21,-30,6,14,22,-31,23,15,7,-32,8,0,40,-33,41,1,9,-34,42,2,10,-35,11,3,43,-36,44,4,12,-37\n\t\t,13,5,45,-38,14,6,46,-39,47,7,15,-40,16,32,40,-25,41,33,17,-26,42,34,18,-27,19,35,43,-28,44,36,20,-29,21,37,45,-30,22,38,46,-31,47,39,23,-32,8,32,-17,17,33,-10\n\t\t,18,34,-11,11,35,-20,20,36,-13,13,37,-22,14,38,-23,23,39,-16,0,24,-41,41,25,-2,42,26,-3,3,27,-44,44,28,-5,5,29,-46,6,30,-47\n\t\t,47,31,-8\n\t\tEdges: \n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByVertice\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: -0.608752727508545,-0.608752727508545,0.508682489395142,-0.608752727508545,-0.608752727508545,-0.508682489395142\n\t\t\t ,-0.608752727508545,0.608752727508545,0.508682489395142,-0.608752727508545,0.608752727508545,-0.508682489395142\n\t\t\t ,0.608752727508545,-0.608752727508545,0.508682489395142,0.608752727508545,-0.608752727508545,-0.508682489395142\n\t\t\t ,0.608752727508545,0.608752727508545,0.508682489395142,0.608752727508545,0.608752727508545,-0.508682489395142\n\t\t\t ,-0.056367687880993,-0.056367687880993,-0.996795535087585,-0.056367687880993,-0.056367687880993,0.996795535087585\n\t\t\t ,-0.056367687880993,0.056367687880993,-0.996795535087585,-0.056367687880993,0.056367687880993,0.996795535087585\n\t\t\t ,0.056367687880993,-0.056367687880993,-0.996795535087585,0.056367687880993,-0.056367687880993,0.996795535087585\n\t\t\t ,0.056367687880993,0.056367687880993,-0.996795535087585,0.056367687880993,0.056367687880993,0.996795535087585\n\t\t\t ,0.969328880310059,-0.143803209066391,-0.199133276939392,0.969328880310059,-0.143803209066391,0.199133276939392\n\t\t\t ,0.969328880310059,0.143803209066391,-0.199133276939392,0.969328880310059,0.143803209066391,0.199133276939392\n\t\t\t ,-0.969328880310059,-0.143803209066391,-0.199133276939392,-0.969328880310059,-0.143803209066391,0.199133276939392\n\t\t\t ,-0.969328880310059,0.143803209066391,-0.199133276939392,-0.969328880310059,0.143803209066391,0.199133276939392\n\t\t\t ,0.722739338874817,-0.610339641571045,0.324167609214783,0.722739338874817,-0.610339641571045,-0.324167609214783\n\t\t\t ,0.722739338874817,0.610339641571045,0.324167609214783,0.722739338874817,0.610339641571045,-0.324167609214783\n\t\t\t ,-0.722739338874817,-0.610339641571045,0.324167609214783,-0.722739338874817,-0.610339641571045,-0.324167609214783\n\t\t\t ,-0.722739338874817,0.610339641571045,0.324167609214783,-0.722739338874817,0.610339641571045,-0.324167609214783\n\t\t\t ,-0.143803209066391,0.969328880310059,-0.199133276939392,-0.143803209066391,0.969328880310059,0.199133276939392\n\t\t\t ,-0.143803209066391,-0.969328880310059,-0.199133276939392,-0.143803209066391,-0.969328880310059,0.199133276939392\n\t\t\t ,0.143803209066391,0.969328880310059,-0.199133276939392,0.143803209066391,0.969328880310059,0.199133276939392\n\t\t\t ,0.143803209066391,-0.969328880310059,-0.199133276939392,0.143803209066391,-0.969328880310059,0.199133276939392\n\t\t\t ,-0.610339641571045,0.722739338874817,0.324167609214783,-0.610339641571045,0.722739338874817,-0.324167609214783\n\t\t\t ,-0.610339641571045,-0.722739338874817,0.324167609214783,-0.610339641571045,-0.722739338874817,-0.324167609214783\n\t\t\t ,0.610339641571045,0.722739338874817,0.324167609214783,0.610339641571045,0.722739338874817,-0.324167609214783\n\t\t\t ,0.610339641571045,-0.722739338874817,0.324167609214783,0.610339641571045,-0.722739338874817,-0.324167609214783\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVTex\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,1.000000,1.000000\n\t\t\t ,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,1.000000,1.000000,1.000000,0.000000,0.000000,0.000000\n\t\t\tUVIndex: 0,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\n\t\t\t\t,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109\n\t\t\t\t,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t},-0.771861,-0.771861,0.886380,-0.771861,-0.771861,-0.886380,-0.771861,0.771861,0.886380,-0.771861,0.771861,-0.886380,0.771861,-0.771861,0.886380,0.771861,-0.771861,-0.886380,0.771861,0.771861,0.886380,0.771861,0.771861,-0.886380,-1.660348,-1.660348,1.906688,-1.660348,-1.660348,-1.906688,-1.660348,1.660348,1.906688,-1.660348,1.660348,-1.906688,1.660348,-1.660348,1.906688,1.660348,-1.660348,-1.906688,1.660348,1.660348,1.906688,1.660348,1.660348,-1.906688,-1.965830,-1.541855,1.770616,-1.965830,-1.541855,-1.770616,-1.965830,1.541855,1.770616,-1.965830,1.541855,-1.770616,1.965830,-1.541855,1.770616,1.965830,-1.541855,-1.770616,1.965830,1.541855,1.770616,1.965830,1.541855,-1.770616,-1.629773,-1.145200,1.315111,-1.629773,-1.145200,-1.315111,-1.629773,1.145200,1.315111,-1.629773,1.145200,-1.315111,1.629773,-1.145200,1.315111,1.629773,-1.145200,-1.315111,1.629773,1.145200,1.315111,1.629773,1.145200,-1.315111,-1.541856,-1.965829,1.770616,-1.541856,-1.965829,-1.770616,-1.541856,1.965829,1.770616,-1.541856,1.965829,-1.770616,1.541856,-1.965829,1.770616,1.541856,-1.965829,-1.770616,1.541856,1.965829,1.770616,1.541856,1.965829,-1.770616,-1.145201,-1.629773,1.315111,-1.145201,-1.629773,-1.315111,-1.145201,1.629773,1.315111,-1.145201,1.629773,-1.315111,1.145201,-1.629773,1.315111,1.145201,-1.629773,-1.315111,1.145201,1.629773,1.315111,1.145201,1.629773,-1.315111\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2500\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",9.6\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFlogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/AlphaModels/sphere.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n    FBXHeaderVersion: 1003\n    FBXVersion: 6100\n    CreationTimeStamp:  {\n        Version: 1000\n        Year: 2010\n        Month: 12\n        Day: 27\n        Hour: 13\n        Minute: 18\n        Second: 59\n        Millisecond: 0\n    }\n    Creator: \"FBX SDK/FBX Plugins build 20070228\"\n    OtherFlags:  {\n        FlagPLE: 0\n    }\n}\nCreationTime: \"2010-12-27 13:18:59:000\"\nCreator: \"Blender version 2.55 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n    Version: 100\n    Count: 12\n    ObjectType: \"Model\" {\n        Count: 10\n    }\n    ObjectType: \"Geometry\" {\n        Count: 1\n    }\n    ObjectType: \"Material\" {\n        Count: 1\n    }\n    ObjectType: \"Pose\" {\n        Count: 1\n    }\n    ObjectType: \"GlobalSettings\" {\n        Count: 1\n    }\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n    Model: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n        Version: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n            Property: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n            Property: \"Camera Index\", \"Integer\", \"A+\",100\n        }\n        MultiLayer: 0\n        MultiTake: 1\n        Hidden: \"True\"\n        Shading: W\n        Culling: \"CullingOff\"\n        Version: 101\n        Name: \"Model::Camera Switcher\"\n        CameraId: 0\n        CameraName: 100\n        CameraIndexName:\n    }\n\tModel: \"Model::blend_root\", \"Null\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n        }\n        MultiLayer: 0\n        MultiTake: 1\n        Shading: Y\n        Culling: \"CullingOff\"\n        TypeFlags: \"Null\"\n    }\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-90.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.000000,0.000000,-1.000000,0.723600,-0.525720,-0.447215,-0.276385,-0.850640,-0.447215,-0.894425,0.000000,-0.447215,-0.276385,0.850640,-0.447215,0.723600,0.525720,-0.447215,0.276385,-0.850640,0.447215\n\t\t,-0.723600,-0.525720,0.447215,-0.723600,0.525720,0.447215,0.276385,0.850640,0.447215,0.894425,0.000000,0.447215,0.000000,0.000000,1.000000,0.425323,-0.309011,-0.850654,-0.162456,-0.499995,-0.850654\n\t\t,0.262869,-0.809012,-0.525738,0.425323,0.309011,-0.850654,0.850648,0.000000,-0.525736,-0.525730,0.000000,-0.850652,-0.688189,-0.499997,-0.525736,-0.162456,0.499995,-0.850654,-0.688189,0.499997,-0.525736\n\t\t,0.262869,0.809012,-0.525738,0.951058,0.309013,0.000000,0.951058,-0.309013,0.000000,0.587786,-0.809017,0.000000,0.000000,-1.000000,0.000000,-0.587786,-0.809017,0.000000,-0.951058,-0.309013,0.000000\n\t\t,-0.951058,0.309013,0.000000,-0.587786,0.809017,0.000000,0.000000,1.000000,0.000000,0.587786,0.809017,0.000000,0.688189,-0.499997,0.525736,-0.262869,-0.809012,0.525738,-0.850648,0.000000,0.525736\n\t\t,-0.262869,0.809012,0.525738,0.688189,0.499997,0.525736,0.525730,0.000000,0.850652,0.162456,-0.499995,0.850654,-0.425323,-0.309011,0.850654,-0.425323,0.309011,0.850654,0.162456,0.499995,0.850654\n\t\t,0.221076,-0.160619,-0.961939,0.597194,-0.433882,-0.674615,-0.084442,-0.259889,-0.961939,-0.228103,-0.702042,-0.674615,0.512753,-0.693775,-0.505727,-0.007026,-0.862665,-0.505728,0.221076,0.160619,-0.961939\n\t\t,0.597194,0.433882,-0.674615,0.818272,-0.273262,-0.505726,0.818272,0.273262,-0.505726,-0.273266,0.000000,-0.961939,-0.738174,0.000000,-0.674610,-0.822618,-0.259890,-0.505724,-0.501373,-0.702043,-0.505727\n\t\t,-0.084442,0.259889,-0.961939,-0.228103,0.702042,-0.674615,-0.501373,0.702043,-0.505727,-0.822618,0.259890,-0.505724,-0.007026,0.862665,-0.505728,0.512753,0.693775,-0.505727,0.959253,0.160620,0.232455\n\t\t,0.870465,0.433883,-0.232456,0.870465,-0.433883,-0.232456,0.959253,-0.160620,0.232455,0.681641,-0.693779,-0.232457,0.449185,-0.862668,0.232457,-0.143661,-0.961938,-0.232456,0.143661,-0.961938,0.232456\n\t\t,-0.681641,-0.693779,0.232457,-0.449185,-0.862668,-0.232457,-0.870465,-0.433883,0.232456,-0.959253,-0.160620,-0.232455,-0.870465,0.433883,0.232456,-0.959253,0.160620,-0.232455,-0.681641,0.693779,0.232457\n\t\t,-0.449185,0.862668,-0.232457,0.143661,0.961938,0.232456,-0.143661,0.961938,-0.232456,0.449185,0.862668,0.232457,0.681641,0.693779,-0.232457,0.822618,-0.259890,0.505724,0.501373,-0.702043,0.505727\n\t\t,-0.512753,-0.693775,0.505727,0.007026,-0.862665,0.505728,-0.818272,0.273262,0.505726,-0.818272,-0.273262,0.505726,0.007026,0.862665,0.505728,-0.512753,0.693775,0.505727,0.501373,0.702043,0.505727\n\t\t,0.822618,0.259890,0.505724,0.738174,0.000000,0.674610,0.273266,0.000000,0.961939,0.084442,-0.259889,0.961939,0.228103,-0.702042,0.674615,-0.221076,-0.160619,0.961939,-0.597194,-0.433882,0.674615\n\t\t,-0.221076,0.160619,0.961939,-0.597194,0.433882,0.674615,0.228103,0.702042,0.674615,0.084442,0.259889,0.961939,0.361804,-0.587779,-0.723612,0.138197,-0.425320,-0.894430,0.052790,-0.688185,-0.723612\n\t\t,0.670817,-0.162457,-0.723611,0.447210,0.000000,-0.894429,0.670817,0.162457,-0.723611,-0.447211,-0.525727,-0.723611,-0.361800,-0.262863,-0.894429,-0.638195,-0.262864,-0.723609,-0.638195,0.262864,-0.723609\n\t\t,-0.361800,0.262863,-0.894429,-0.447211,0.525727,-0.723611,0.052790,0.688185,-0.723612,0.138197,0.425320,-0.894430,0.361804,0.587779,-0.723612,0.947213,-0.162458,-0.276396,0.947213,0.162458,-0.276396\n\t\t,1.000000,0.000000,0.000000,0.138199,-0.951055,-0.276397,0.447216,-0.850648,-0.276397,0.309017,-0.951056,0.000000,-0.861804,-0.425322,-0.276396,-0.670820,-0.688190,-0.276396,-0.809018,-0.587783,0.000000\n\t\t,-0.670820,0.688190,-0.276396,-0.861804,0.425322,-0.276396,-0.809018,0.587783,0.000000,0.447216,0.850648,-0.276397,0.138199,0.951055,-0.276397,0.309017,0.951056,0.000000,0.861804,-0.425322,0.276396\n\t\t,0.809018,-0.587783,0.000000,0.670820,-0.688190,0.276396,-0.138199,-0.951055,0.276397,-0.309017,-0.951056,0.000000,-0.447216,-0.850648,0.276397,-0.947213,-0.162458,0.276396,-1.000000,0.000000,0.000000\n\t\t,-0.947213,0.162458,0.276396,-0.447216,0.850648,0.276397,-0.309017,0.951056,0.000000,-0.138199,0.951055,0.276397,0.670820,0.688190,0.276396,0.809018,0.587783,0.000000,0.861804,0.425322,0.276396\n\t\t,0.447211,-0.525727,0.723611,0.638195,-0.262864,0.723609,0.361800,-0.262863,0.894429,-0.361804,-0.587779,0.723612,-0.052790,-0.688185,0.723612,-0.138197,-0.425320,0.894430,-0.670817,0.162457,0.723611\n\t\t,-0.670817,-0.162457,0.723611,-0.447210,0.000000,0.894429,-0.052790,0.688185,0.723612,-0.361804,0.587779,0.723612,-0.138197,0.425320,0.894430,0.638195,0.262864,0.723609,0.447211,0.525727,0.723612\n\t\t,0.361800,0.262863,0.894429\n\t\tPolygonVertexIndex: 102,46,-15,46,102,-44,12,43,-103,43,1,-47,102,103,-13,103,102,-105,14,104,-103,104,13,-104,45,47,-3,47,45,-105,13,104,-46,104,14,-48,44,103,-14\n\t\t,103,44,-43,0,42,-45,42,12,-104,105,16,-51,50,43,-106,12,105,-44,43,50,-2,105,12,-107,106,107,-106,16,105,-108,107,106,-16,49,5,-52,51,107,-50\n\t\t,15,49,-108,107,51,-17,48,15,-107,106,42,-49,0,48,-43,42,106,-13,108,55,-19,55,108,-46,13,45,-109,45,2,-56,108,109,-14,109,108,-111,18,110,-109\n\t\t,110,17,-110,53,54,-4,54,53,-111,17,110,-54,110,18,-55,52,109,-18,109,52,-45,0,44,-53,44,13,-110,111,59,-21,59,111,-54,17,53,-112,53,3,-60\n\t\t,111,112,-18,112,111,-114,20,113,-112,113,19,-113,57,58,-5,58,57,-114,19,113,-58,113,20,-59,56,112,-20,112,56,-53,0,52,-57,52,17,-113,114,60,-22\n\t\t,60,114,-58,19,57,-115,57,4,-61,114,115,-20,115,114,-117,21,116,-115,116,15,-116,49,61,-6,61,49,-117,15,116,-50,116,21,-62,48,115,-16,115,48,-57\n\t\t,0,56,-49,56,19,-116,117,23,-65,64,50,-118,16,117,-51,50,64,-2,117,16,-119,118,119,-118,23,117,-120,119,118,-23,62,10,-66,65,119,-63,22,62,-120\n\t\t,119,65,-24,63,22,-119,118,51,-64,5,63,-52,51,118,-17,120,25,-69,68,47,-121,14,120,-48,47,68,-3,120,14,-122,121,122,-121,25,120,-123,122,121,-25\n\t\t,67,6,-70,69,122,-68,24,67,-123,122,69,-26,66,24,-122,121,46,-67,1,66,-47,46,121,-15,123,27,-74,73,54,-124,18,123,-55,54,73,-4,123,18,-125\n\t\t,124,125,-124,27,123,-126,125,124,-27,70,7,-73,72,125,-71,26,70,-126,125,72,-28,71,26,-125,124,55,-72,2,71,-56,55,124,-19,126,29,-78,77,58,-127\n\t\t,20,126,-59,58,77,-5,126,20,-128,127,128,-127,29,126,-129,128,127,-29,74,8,-77,76,128,-75,28,74,-129,128,76,-30,75,28,-128,127,59,-76,3,75,-60\n\t\t,59,127,-21,129,31,-82,81,61,-130,21,129,-62,61,81,-6,129,21,-131,130,131,-130,31,129,-132,131,130,-31,78,9,-81,80,131,-79,30,78,-132,131,80,-32\n\t\t,79,30,-131,130,60,-80,4,79,-61,60,130,-22,132,82,-33,82,132,-66,23,65,-133,65,10,-83,132,133,-24,133,132,-135,32,134,-133,134,24,-134,67,83,-7\n\t\t,83,67,-135,24,134,-68,134,32,-84,66,133,-25,133,66,-65,1,64,-67,64,23,-134,135,85,-34,85,135,-70,25,69,-136,69,6,-86,135,136,-26,136,135,-138\n\t\t,33,137,-136,137,26,-137,70,84,-8,84,70,-138,26,137,-71,137,33,-85,71,136,-27,136,71,-69,2,68,-72,68,25,-137,138,87,-35,87,138,-73,27,72,-139\n\t\t,72,7,-88,138,139,-28,139,138,-141,34,140,-139,140,28,-140,74,86,-9,86,74,-141,28,140,-75,140,34,-87,75,139,-29,139,75,-74,3,73,-76,73,27,-140\n\t\t,141,89,-36,89,141,-77,29,76,-142,76,8,-90,141,142,-30,142,141,-144,35,143,-142,143,30,-143,78,88,-10,88,78,-144,30,143,-79,143,35,-89,79,142,-31\n\t\t,142,79,-78,4,77,-80,77,29,-143,144,90,-37,90,144,-81,31,80,-145,80,9,-91,144,145,-32,145,144,-147,36,146,-145,146,22,-146,62,91,-11,91,62,-147\n\t\t,22,146,-63,146,36,-92,63,145,-23,145,63,-82,5,81,-64,81,31,-146,147,38,-96,95,83,-148,32,147,-84,83,95,-7,147,32,-149,148,149,-148,38,147,-150\n\t\t,149,148,-38,93,11,-95,94,149,-94,37,93,-150,149,94,-39,92,37,-149,148,82,-93,10,92,-83,82,148,-33,150,39,-98,97,84,-151,33,150,-85,84,97,-8\n\t\t,150,33,-152,151,152,-151,39,150,-153,152,151,-39,94,11,-97,96,152,-95,38,94,-153,152,96,-40,95,38,-152,151,85,-96,6,95,-86,85,151,-34,153,40,-100\n\t\t,99,86,-154,34,153,-87,86,99,-9,153,34,-155,154,155,-154,40,153,-156,155,154,-40,96,11,-99,98,155,-97,39,96,-156,155,98,-41,97,39,-155,154,87,-98\n\t\t,7,97,-88,87,154,-35,156,41,-101,100,88,-157,35,156,-89,88,100,-10,156,35,-158,157,158,-157,41,156,-159,158,157,-41,98,11,-102,101,158,-99,40,98,-159\n\t\t,158,101,-42,99,40,-158,157,89,-100,8,99,-90,89,157,-36,159,37,-93,92,91,-160,36,159,-92,91,92,-11,159,36,-161,160,161,-160,37,159,-162,161,160,-42\n\t\t,101,11,-94,93,161,-102,41,101,-162,161,93,-38,100,41,-161,160,90,-101,9,100,-91,90,160,-37\n\t\tEdges: 0,42,12,42,1,43,12,43,0,44,13,44,2,45,45,13,1,46,14,46,2,47,14,47,0,48\n\t\t,15,48,5,49,15,49,1,50,50,16,5,51,51,16,0,52,52,17,3,53,53,17,3,54,54,18\n\t\t,2,55,18,55,0,56,19,56,4,57,19,57,4,58,20,58,3,59,20,59,4,60,21,60,5,61\n\t\t,21,61,10,62,22,62,5,63,22,63,1,64,23,64,10,65,23,65,1,66,24,66,6,67,24,67\n\t\t,2,68,25,68,6,69,25,69,7,70,26,70,2,71,26,71,7,72,27,72,3,73,27,73,8,74\n\t\t,28,74,3,75,28,75,8,76,29,76,4,77,29,77,9,78,30,78,4,79,30,79,9,80,31,80\n\t\t,5,81,31,81,10,82,32,82,6,83,32,83,7,84,33,84,6,85,33,85,8,86,34,86,7,87\n\t\t,34,87,9,88,35,88,8,89,35,89,9,90,36,90,10,91,36,91,10,92,37,92,11,93,37,93\n\t\t,11,94,38,94,6,95,38,95,11,96,39,96,7,97,39,97,11,98,40,98,8,99,40,99,9,100\n\t\t,41,100,11,101,41,101,12,102,14,102,12,103,13,103,13,104,14,104,12,105,16,105,12,106,15,106\n\t\t,15,107,16,107,13,108,18,108,13,109,17,109,17,110,18,110,17,111,20,111,17,112,19,112,19,113\n\t\t,20,113,19,114,21,114,15,115,19,115,15,116,21,116,16,117,23,117,16,118,22,118,22,119,23,119\n\t\t,14,120,25,120,14,121,24,121,24,122,25,122,18,123,27,123,18,124,26,124,26,125,27,125,20,126\n\t\t,29,126,20,127,28,127,28,128,29,128,21,129,31,129,21,130,30,130,30,131,31,131,23,132,32,132\n\t\t,23,133,24,133,24,134,32,134,25,135,33,135,25,136,26,136,26,137,33,137,27,138,34,138,27,139\n\t\t,28,139,28,140,34,140,29,141,35,141,29,142,30,142,30,143,35,143,31,144,36,144,22,145,31,145\n\t\t,22,146,36,146,32,147,38,147,32,148,37,148,37,149,38,149,33,150,39,150,33,151,38,151,38,152\n\t\t,39,152,34,153,40,153,34,154,39,154,39,155,40,155,35,156,41,156,35,157,40,157,40,158,41,158\n\t\t,36,159,37,159,36,160,41,160,37,161,41,161,46,102,43,46,43,102,102,103,103,104,102,104,45,47\n\t\t,47,104,45,104,44,103,42,103,44,42,50,105,50,43,43,105,105,106,106,107,105,107,51,49,51,107\n\t\t,49,107,48,106,42,106,48,42,55,108,45,55,45,108,108,109,109,110,108,110,54,53,54,110,53,110\n\t\t,52,109,44,109,52,44,59,111,53,59,53,111,111,112,112,113,111,113,57,58,58,113,57,113,56,112\n\t\t,52,112,52,56,60,114,57,60,57,114,114,115,115,116,114,116,49,61,61,116,49,116,48,115,56,115\n\t\t,48,56,64,117,50,64,50,117,117,118,118,119,117,119,62,65,65,119,62,119,63,118,51,118,51,63\n\t\t,68,120,47,68,47,120,120,121,121,122,120,122,67,69,69,122,67,122,66,121,46,121,46,66,73,123\n\t\t,54,73,54,123,123,124,124,125,123,125,70,72,72,125,70,125,71,124,55,124,55,71,77,126,58,77\n\t\t,58,126,126,127,127,128,126,128,74,76,76,128,74,128,75,127,59,127,59,75,81,129,61,81,61,129\n\t\t,129,130,130,131,129,131,78,80,80,131,78,131,79,130,60,130,60,79,82,132,65,82,65,132,132,133\n\t\t,133,134,132,134,67,83,83,134,67,134,66,133,64,133,64,66,85,135,69,85,69,135,135,136,136,137\n\t\t,135,137,70,84,84,137,70,137,71,136,68,136,68,71,87,138,72,87,72,138,138,139,139,140,138,140\n\t\t,74,86,86,140,74,140,75,139,73,139,73,75,89,141,76,89,76,141,141,142,142,143,141,143,78,88\n\t\t,88,143,78,143,79,142,77,142,77,79,90,144,80,90,80,144,144,145,145,146,144,146,62,91,91,146\n\t\t,62,146,63,145,81,145,63,81,95,147,83,95,83,147,147,148,148,149,147,149,93,94,94,149,93,149\n\t\t,92,148,82,148,82,92,97,150,84,97,84,150,150,151,151,152,150,152,94,96,96,152,94,152,95,151\n\t\t,85,151,85,95,99,153,86,99,86,153,153,154,154,155,153,155,96,98,98,155,96,155,97,154,87,154\n\t\t,87,97,100,156,88,100,88,156,156,157,157,158,156,158,98,101,101,158,98,158,99,157,89,157,89,99\n\t\t,92,159,91,92,91,159,159,160,160,161,159,161,93,101,93,161,101,161,100,160,90,160,90,100\n\t\tGeometryVersion: 124\n        LayerElementNormal: 0 {\n            Version: 101\n            Name: \"\"\n            MappingInformationType: \"ByVertice\"\n            ReferenceInformationType: \"Direct\"\n            Normals: 0.000000000000000,0.000000000000000,-0.999969482421875,0.723593831062317,-0.525711834430695,-0.447218239307404\n\t\t\t ,-0.276375621557236,-0.850642442703247,-0.447218239307404,-0.894405961036682,0.000000000000000,-0.447187721729279\n\t\t\t ,-0.276375621557236,0.850642442703247,-0.447218239307404,0.723593831062317,0.525711834430695,-0.447218239307404\n\t\t\t ,0.276375621557236,-0.850642442703247,0.447218239307404,-0.723593831062317,-0.525711834430695,0.447218239307404\n\t\t\t ,-0.723593831062317,0.525711834430695,0.447218239307404,0.276375621557236,0.850642442703247,0.447218239307404\n\t\t\t ,0.894405961036682,0.000000000000000,0.447187721729279,0.000000000000000,0.000000000000000,0.999969482421875\n\t\t\t ,0.425305962562561,-0.308999896049500,-0.850642442703247,-0.162450030446053,-0.499984741210938,-0.850642442703247\n\t\t\t ,0.262855917215347,-0.808984637260437,-0.525711834430695,0.425305962562561,0.308999896049500,-0.850642442703247\n\t\t\t ,0.850642442703247,0.000000000000000,-0.525711834430695,-0.525711834430695,0.000000000000000,-0.850642442703247\n\t\t\t ,-0.688161849975586,-0.499984741210938,-0.525711834430695,-0.162450030446053,0.499984741210938,-0.850642442703247\n\t\t\t ,-0.688161849975586,0.499984741210938,-0.525711834430695,0.262855917215347,0.808984637260437,-0.525711834430695\n\t\t\t ,0.951048314571381,0.308999896049500,0.000000000000000,0.951048314571381,-0.308999896049500,0.000000000000000\n\t\t\t ,0.587755978107452,-0.809015154838562,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000\n\t\t\t ,-0.587755978107452,-0.809015154838562,0.000000000000000,-0.951048314571381,-0.308999896049500,0.000000000000000\n\t\t\t ,-0.951048314571381,0.308999896049500,0.000000000000000,-0.587755978107452,0.809015154838562,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.587755978107452,0.809015154838562,0.000000000000000\n\t\t\t ,0.688161849975586,-0.499984741210938,0.525711834430695,-0.262855917215347,-0.808984637260437,0.525711834430695\n\t\t\t ,-0.850642442703247,0.000000000000000,0.525711834430695,-0.262855917215347,0.808984637260437,0.525711834430695\n\t\t\t ,0.688161849975586,0.499984741210938,0.525711834430695,0.525711834430695,0.000000000000000,0.850642442703247\n\t\t\t ,0.162450030446053,-0.499984741210938,0.850642442703247,-0.425305962562561,-0.308999896049500,0.850642442703247\n\t\t\t ,-0.425305962562561,0.308999896049500,0.850642442703247,0.162450030446053,0.499984741210938,0.850642442703247\n\t\t\t ,0.210730314254761,-0.153080850839615,-0.965453028678894,0.604358017444611,-0.439100325107574,-0.664754152297974\n\t\t\t ,-0.080477312207222,-0.247718736529350,-0.965453028678894,-0.230842009186745,-0.710470914840698,-0.664754152297974\n\t\t\t ,0.523880720138550,-0.686819076538086,-0.503769040107727,-0.020111698657274,-0.863582253456116,-0.503769040107727\n\t\t\t ,0.210730314254761,0.153080850839615,-0.965453028678894,0.604358017444611,0.439100325107574,-0.664754152297974\n\t\t\t ,0.815088331699371,-0.285988956689835,-0.503769040107727,0.815088331699371,0.285988956689835,-0.503769040107727\n\t\t\t ,-0.260475486516953,0.000000000000000,-0.965453028678894,-0.747032046318054,0.000000000000000,-0.664754152297974\n\t\t\t ,-0.827539920806885,-0.247718736529350,-0.503769040107727,-0.491317480802536,-0.710470914840698,-0.503769040107727\n\t\t\t ,-0.080477312207222,0.247718736529350,-0.965453028678894,-0.230842009186745,0.710470914840698,-0.664754152297974\n\t\t\t ,-0.491317480802536,0.710470914840698,-0.503769040107727,-0.827539920806885,0.247718736529350,-0.503769040107727\n\t\t\t ,-0.020111698657274,0.863582253456116,-0.503769040107727,0.523880720138550,0.686819076538086,-0.503769040107727\n\t\t\t ,0.957792878150940,0.153080850839615,0.243263036012650,0.864833533763885,0.439100325107574,-0.243293553590775\n\t\t\t ,0.864833533763885,-0.439100325107574,-0.243293553590775,0.957792878150940,-0.153080850839615,0.243263036012650\n\t\t\t ,0.684865891933441,-0.686819076538086,-0.243293553590775,0.441572308540344,-0.863582253456116,0.243293553590775\n\t\t\t ,-0.150334179401398,-0.958220183849335,-0.243293553590775,0.150334179401398,-0.958220183849335,0.243293553590775\n\t\t\t ,-0.684865891933441,-0.686819076538086,0.243293553590775,-0.441572308540344,-0.863582253456116,-0.243293553590775\n\t\t\t ,-0.864833533763885,-0.439100325107574,0.243293553590775,-0.957792878150940,-0.153080850839615,-0.243263036012650\n\t\t\t ,-0.864833533763885,0.439100325107574,0.243293553590775,-0.957792878150940,0.153080850839615,-0.243263036012650\n\t\t\t ,-0.684865891933441,0.686819076538086,0.243293553590775,-0.441572308540344,0.863582253456116,-0.243293553590775\n\t\t\t ,0.150334179401398,0.958220183849335,0.243293553590775,-0.150334179401398,0.958220183849335,-0.243293553590775\n\t\t\t ,0.441572308540344,0.863582253456116,0.243293553590775,0.684865891933441,0.686819076538086,-0.243293553590775\n\t\t\t ,0.827539920806885,-0.247718736529350,0.503769040107727,0.491317480802536,-0.710470914840698,0.503769040107727\n\t\t\t ,-0.523880720138550,-0.686819076538086,0.503769040107727,0.020111698657274,-0.863582253456116,0.503769040107727\n\t\t\t ,-0.815088331699371,0.285988956689835,0.503769040107727,-0.815088331699371,-0.285988956689835,0.503769040107727\n\t\t\t ,0.020111698657274,0.863582253456116,0.503769040107727,-0.523880720138550,0.686819076538086,0.503769040107727\n\t\t\t ,0.491317480802536,0.710470914840698,0.503769040107727,0.827539920806885,0.247718736529350,0.503769040107727\n\t\t\t ,0.747032046318054,0.000000000000000,0.664754152297974,0.260475486516953,0.000000000000000,0.965453028678894\n\t\t\t ,0.080477312207222,-0.247718736529350,0.965453028678894,0.230842009186745,-0.710470914840698,0.664754152297974\n\t\t\t ,-0.210730314254761,-0.153080850839615,0.965453028678894,-0.604358017444611,-0.439100325107574,0.664754152297974\n\t\t\t ,-0.210730314254761,0.153080850839615,0.965453028678894,-0.604358017444611,0.439100325107574,0.664754152297974\n\t\t\t ,0.230842009186745,0.710470914840698,0.664754152297974,0.080477312207222,0.247718736529350,0.965453028678894\n\t\t\t ,0.350016772747040,-0.587725460529327,-0.729422867298126,0.141788989305496,-0.436445206403732,-0.888454854488373\n\t\t\t ,0.062288276851177,-0.681203663349152,-0.729422867298126,0.667104125022888,-0.151249736547470,-0.729422867298126\n\t\t\t ,0.458906829357147,0.000000000000000,-0.888454854488373,0.667104125022888,0.151249736547470,-0.729422867298126\n\t\t\t ,-0.450788915157318,-0.514481008052826,-0.729422867298126,-0.371257662773132,-0.269722580909729,-0.888454854488373\n\t\t\t ,-0.628620266914368,-0.269722580909729,-0.729422867298126,-0.628620266914368,0.269722580909729,-0.729422867298126\n\t\t\t ,-0.371257662773132,0.269722580909729,-0.888454854488373,-0.450788915157318,0.514481008052826,-0.729422867298126\n\t\t\t ,0.062288276851177,0.681203663349152,-0.729422867298126,0.141788989305496,0.436445206403732,-0.888454854488373\n\t\t\t ,0.350016772747040,0.587725460529327,-0.729422867298126,0.950743138790131,-0.151249736547470,-0.270485550165176\n\t\t\t ,0.950743138790131,0.151249736547470,-0.270485550165176,0.999908447265625,0.000000000000000,-0.013122959062457\n\t\t\t ,0.149937435984612,-0.950956761837006,-0.270485550165176,0.437665939331055,-0.857478559017181,-0.270485550165176\n\t\t\t ,0.308969378471375,-0.950956761837006,-0.013122959062457,-0.858088910579681,-0.436445206403732,-0.270485550165176\n\t\t\t ,-0.680257558822632,-0.681203663349152,-0.270485550165176,-0.808923602104187,-0.587725460529327,-0.013122959062457\n\t\t\t ,-0.680257558822632,0.681203663349152,-0.270485550165176,-0.858088910579681,0.436445206403732,-0.270485550165176\n\t\t\t ,-0.808923602104187,0.587725460529327,-0.013122959062457,0.437665939331055,0.857478559017181,-0.270485550165176\n\t\t\t ,0.149937435984612,0.950956761837006,-0.270485550165176,0.308969378471375,0.950956761837006,-0.013122959062457\n\t\t\t ,0.858088910579681,-0.436445206403732,0.270485550165176,0.808923602104187,-0.587725460529327,0.013122959062457\n\t\t\t ,0.680257558822632,-0.681203663349152,0.270485550165176,-0.149937435984612,-0.950956761837006,0.270485550165176\n\t\t\t ,-0.308969378471375,-0.950956761837006,0.013122959062457,-0.437665939331055,-0.857478559017181,0.270485550165176\n\t\t\t ,-0.950743138790131,-0.151249736547470,0.270485550165176,-0.999908447265625,0.000000000000000,0.013122959062457\n\t\t\t ,-0.950743138790131,0.151249736547470,0.270485550165176,-0.437665939331055,0.857478559017181,0.270485550165176\n\t\t\t ,-0.308969378471375,0.950956761837006,0.013122959062457,-0.149937435984612,0.950956761837006,0.270485550165176\n\t\t\t ,0.680257558822632,0.681203663349152,0.270485550165176,0.808923602104187,0.587725460529327,0.013122959062457\n\t\t\t ,0.858088910579681,0.436445206403732,0.270485550165176,0.450788915157318,-0.514481008052826,0.729422867298126\n\t\t\t ,0.628620266914368,-0.269722580909729,0.729422867298126,0.371257662773132,-0.269722580909729,0.888454854488373\n\t\t\t ,-0.350016772747040,-0.587725460529327,0.729422867298126,-0.062288276851177,-0.681203663349152,0.729422867298126\n\t\t\t ,-0.141788989305496,-0.436445206403732,0.888454854488373,-0.667104125022888,0.151249736547470,0.729422867298126\n\t\t\t ,-0.667104125022888,-0.151249736547470,0.729422867298126,-0.458906829357147,0.000000000000000,0.888454854488373\n\t\t\t ,-0.062288276851177,0.681203663349152,0.729422867298126,-0.350016772747040,0.587725460529327,0.729422867298126\n\t\t\t ,-0.141788989305496,0.436445206403732,0.888454854488373,0.628620266914368,0.269722580909729,0.729422867298126\n\t\t\t ,0.450788915157318,0.514481008052826,0.729422867298126,0.371257662773132,0.269722580909729,0.888454854488373\n\t\t}\n        LayerElementSmoothing: 0 {\n            Version: 102\n            Name: \"\"\n            MappingInformationType: \"ByPolygon\"\n            ReferenceInformationType: \"Direct\"\n            Smoothing: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t}\n        LayerElementSmoothing: 0 {\n            Version: 101\n            Name: \"\"\n            MappingInformationType: \"ByEdge\"\n            ReferenceInformationType: \"Direct\"\n            Smoothing: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVTex\"\n            MappingInformationType: \"ByPolygonVertex\"\n            ReferenceInformationType: \"IndexToDirect\"\n            UV: 0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000\n\t\t\tUVIndex: 0,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\n\t\t\t\t,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109\n\t\t\t\t,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164\n\t\t\t\t,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219\n\t\t\t\t,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274\n\t\t\t\t,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329\n\t\t\t\t,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384\n\t\t\t\t,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439\n\t\t\t\t,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494\n\t\t\t\t,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549\n\t\t\t\t,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604\n\t\t\t\t,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659\n\t\t\t\t,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714\n\t\t\t\t,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769\n\t\t\t\t,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824\n\t\t\t\t,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879\n\t\t\t\t,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934\n\t\t\t\t,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959\n\t\t}\n        LayerElementTexture: 0 {\n            Version: 101\n            Name: \"\"\n            MappingInformationType: \"NoMappingInformation\"\n            ReferenceInformationType: \"IndexToDirect\"\n            BlendMode: \"Translucent\"\n            TextureAlpha: 1\n            TextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n        Layer: 0 {\n            Version: 100\n            LayerElement:  {\n                Type: \"LayerElementNormal\"\n                TypedIndex: 0\n            }\n            LayerElement:  {\n                Type: \"LayerElementMaterial\"\n                TypedIndex: 0\n            }\n            LayerElement:  {\n                Type: \"LayerElementUV\"\n                TypedIndex: 0\n            }\n\t\t}\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,71.299999999999997,287.500000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",10.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",4000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",0\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,71.300000,287.500000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,-4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,-4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,-4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,-4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: -4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tMaterial: \"Material::unnamed\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"phong\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Phong\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",0.5000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2000\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Shininess\", \"double\", \"\",20.0\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n    Pose: \"Pose::BIND_POSES\", \"BindPose\" {\n        Type: \"BindPose\"\n        Version: 100\n        Properties60:  {\n        }\n        NbPoseNodes: 2\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::blend_root\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Icosphere\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-0.000000043711388,-1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,-0.000000043711388,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n    GlobalSettings:  {\n        Version: 1000\n        Properties60:  {\n            Property: \"UpAxis\", \"int\", \"\",1\n            Property: \"UpAxisSign\", \"int\", \"\",1\n            Property: \"FrontAxis\", \"int\", \"\",2\n            Property: \"FrontAxisSign\", \"int\", \"\",1\n            Property: \"CoordAxis\", \"int\", \"\",0\n            Property: \"CoordAxisSign\", \"int\", \"\",1\n            Property: \"UnitScaleFactor\", \"double\", \"\",100\n        }\n    }\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::blend_root\", \"Null\" {\n\t}\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t}\n    Model: \"Model::Producer Perspective\", \"Camera\" {\n    }\n    Model: \"Model::Producer Top\", \"Camera\" {\n    }\n    Model: \"Model::Producer Bottom\", \"Camera\" {\n    }\n    Model: \"Model::Producer Front\", \"Camera\" {\n    }\n    Model: \"Model::Producer Back\", \"Camera\" {\n    }\n    Model: \"Model::Producer Right\", \"Camera\" {\n    }\n    Model: \"Model::Producer Left\", \"Camera\" {\n    }\n    Model: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n    }\n\tMaterial: \"Material::unnamed\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::blend_root\", \"Model::Scene\"\n\tConnect: \"OO\", \"Model::Icosphere\", \"Model::blend_root\"\n\tConnect: \"OO\", \"Material::unnamed\", \"Model::Icosphere\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n\tTake: \"Default Take\" {\n\t\tFileName: \"Default_Take.tak\"\n\t\tLocalTime: 0,479181389250\n\t\tReferenceTime: 0,479181389250\n\n        ;Models animation\n        ;----------------------------------------------------\n\t\tModel: \"Model::Icosphere\" {\n\t\t\tVersion: 1.1\n\t\t\tChannel: \"Transform\" {\n\t\t\t\tChannel: \"T\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 1\n\t\t\t\t}\n\t\t\t\tChannel: \"R\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: -90.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-90.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: -0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 2\n\t\t\t\t}\n\t\t\t\tChannel: \"S\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 3\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFlogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/AlphaModels/waterfall.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2014\n\t\tMonth: 08\n\t\tDay: 14\n\t\tHour: 21\n\t\tMinute: 53\n\t\tSecond: 31\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2014-08-14 21:53:31:000\"\nCreator: \"Blender version 2.70 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 13\n\tObjectType: \"Model\" {\n\t\tCount: 11\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Camera Index\", \"Integer\", \"A+\",100\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tHidden: \"True\"\n\t\tShading: W\n\t\tCulling: \"CullingOff\"\n\t\tVersion: 101\n\t\tName: \"Model::Camera Switcher\"\n\t\tCameraId: 0\n\t\tCameraName: 100\n\t\tCameraIndexName:\n\t}\n\tModel: \"Model::Camera\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",7.481131553649902,5.343665122985840,6.507639884948730\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",23.240195056629602,142.362356870423241,34.212069212897042\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,0.999999940395355,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",49.134342\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",49.134342\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",28.841546\n\t\t\tProperty: \"FocalLength\", \"Number\", \"A+\",35.000000\n\t\t\tProperty: \"FilmOffsetX\", \"Number\", \"A+\",0.000000\n\t\t\tProperty: \"FilmOffsetY\", \"Number\", \"A+\",0.000000\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0,0,0\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",3\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",2\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",1920\n\t\t\tProperty: \"AspectH\", \"double\", \"\",1080\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",0.100000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",99.999994\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",1.259843\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.708661\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.777778\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.777778\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",0\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 7.481132,5.343665,6.507640\n\t\tUp: -0.317370,0.895343,-0.312469\n\t\tLookAt: -0.685881,0.010817,0.727634\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Lamp\", \"Light\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",4.076245307922363,5.903861999511719,-1.005453944206238\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",47.533574547422390,107.220753553002154,10.743666437040241\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,0.999999880790710,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t\tProperty: \"LightType\", \"enum\", \"\",0\n\t\t\tProperty: \"CastLightOnObject\", \"bool\", \"\",1\n\t\t\tProperty: \"DrawVolumetricLight\", \"bool\", \"\",1\n\t\t\tProperty: \"DrawGroundProjection\", \"bool\", \"\",1\n\t\t\tProperty: \"DrawFrontFacingVolumetricLight\", \"bool\", \"\",0\n\t\t\tProperty: \"GoboProperty\", \"object\", \"\"\n\t\t\tProperty: \"Color\", \"Color\", \"A+\",1,1,1\n\t\t\tProperty: \"Fog\", \"Fog\", \"A+\",50\n\t\t\tProperty: \"Color\", \"Color\", \"A\",1.00,1.00,1.00\n\t\t\tProperty: \"Intensity\", \"Intensity\", \"A+\",100.00\n\t\t\tProperty: \"Fog\", \"Fog\", \"A+\",50\n\t\t\tProperty: \"LightType\", \"enum\", \"\",0\n\t\t\tProperty: \"CastLightOnObject\", \"bool\", \"\",1\n\t\t\tProperty: \"DrawGroundProjection\", \"bool\", \"\",1\n\t\t\tProperty: \"DrawFrontFacingVolumetricLight\", \"bool\", \"\",0\n\t\t\tProperty: \"DrawVolumetricLight\", \"bool\", \"\",1\n\t\t\tProperty: \"GoboProperty\", \"object\", \"\"\n\t\t\tProperty: \"DecayType\", \"enum\", \"\",2\n\t\t\tProperty: \"EnableFarAttenuation\", \"bool\", \"\",1\n\t\t\tProperty: \"FarAttenuationEnd\", \"double\", \"\",60.00\n\t\t\tProperty: \"CastShadows\", \"bool\", \"\",1\n\t\t\tProperty: \"ShadowColor\", \"ColorRGBA\", \"\",0,0,0,1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Light\"\n\t\tGeometryVersion: 124\n\t}\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-90.000009334538021,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.411097,-75.115028,-0.139114,-0.411062,-75.115028,-0.139113,-0.411062,-75.115028,-0.015596,0.411097,-75.115028,-0.015597,\n\t\t          0.411075,-0.111062,-0.139040,-0.411080,-0.111063,-0.139039,-0.411076,-0.114583,-0.015665,0.411071,-0.114582,-0.015666,\n\t\t          0.411055,0.036762,0.149689,0.411010,0.160086,0.145433,-0.490158,0.099818,0.147388,0.490153,0.099819,0.147387,\n\t\t          -0.411015,0.160086,0.145434,-0.411060,0.036762,0.149690,-0.411046,0.032921,0.106189,-0.411083,0.152570,0.075508,\n\t\t          0.490156,0.094081,0.090587,-0.490161,0.094081,0.090588,0.411078,0.152570,0.075507,0.411042,0.032921,0.106189,\n\t\t          0.411048,0.018769,0.067834,0.411089,0.126415,0.007273,-0.490159,0.073841,0.036957,0.490154,0.073841,0.036956,\n\t\t          -0.411094,0.126415,0.007274,-0.411053,0.018769,0.067834,-0.411053,-0.004804,0.034500,-0.411094,0.083500,-0.051858,\n\t\t          0.490154,0.040400,-0.009580,-0.411054,-0.073335,-0.008696,-0.411082,-0.039984,-0.127622,-0.490159,0.040400,-0.009579,\n\t\t          -0.490181,-0.112623,-0.078271,-0.490182,-75.115028,-0.077355,0.490176,-0.112623,-0.078271,0.490215,-75.115028,-0.077355,\n\t\t          0.411089,0.083500,-0.051858,0.411048,-0.004803,0.034499,0.411048,-0.036201,0.008402,0.411089,0.026743,-0.097868,\n\t\t          -0.490159,-0.003946,-0.045874,0.490154,-0.003946,-0.045875,-0.411094,0.026742,-0.097867,-0.411052,-0.036202,0.008402,\n\t\t          0.490157,-0.056202,-0.069428,-0.490162,-0.056203,-0.069427,0.411077,-0.039983,-0.127623,0.411049,-0.073335,-0.008696,\n\t\t          0.411090,-23.081871,-0.139114,0.411087,-15.221762,-0.139114,0.411084,-8.902851,-0.139114,0.411080,-4.632687,-0.139114,\n\t\t          0.411096,-1.901482,-0.139107,-0.411101,-1.901483,-0.139106,-0.411078,-4.632688,-0.139113,-0.411075,-8.902851,-0.139113,\n\t\t          -0.411072,-15.221762,-0.139113,-0.411068,-23.081871,-0.139113,-0.411065,-1.901485,-0.015590,-0.411078,-4.632688,-0.015596,\n\t\t          -0.411075,-8.902851,-0.015596,-0.411072,-15.221762,-0.015596,-0.411068,-23.081871,-0.015596,0.411060,-1.901484,-0.015591,\n\t\t          0.411080,-4.632687,-0.015597,0.411084,-8.902851,-0.015597,0.411087,-15.221760,-0.015597,0.411090,-23.081871,-0.015597,\n\t\t          -0.490200,-1.901484,-0.077319,-0.490197,-4.632687,-0.077355,-0.490194,-8.902851,-0.077355,-0.490191,-15.221762,-0.077355,\n\t\t          -0.490188,-23.081871,-0.077355,0.490195,-1.901483,-0.077320,0.490198,-4.632687,-0.077355,0.490202,-8.902851,-0.077355,\n\t\t          0.490205,-15.221760,-0.077355,0.490208,-23.081871,-0.077355\n\t\tPolygonVertexIndex: 48,0,1,-58,72,33,2,-63,62,2,3,-68,77,35,0,-49,25,14,17,-23,20,19,14,-26,24,15,18,-22,18,9,11,-17,\n\t\t                    31,22,24,-28,21,18,16,-24,14,13,10,-18,42,27,36,-40,36,21,23,-29,28,23,20,-38,23,16,19,-21,46,39,41,-45,\n\t\t                    39,36,28,-42,38,37,26,-44,26,25,22,-32,4,46,44,-35,44,41,38,-48,30,42,39,-47,41,28,37,-39,32,45,30,-6,\n\t\t                    7,47,29,-7,5,30,46,-5,47,38,43,-30,57,1,33,-73,67,3,35,-78,16,11,8,-20,17,10,12,-16,15,12,9,-19,\n\t\t                    22,17,15,-25,19,8,13,-15,37,20,25,-27,27,24,21,-37,43,26,31,-41,40,31,27,-43,45,40,42,-31,29,43,40,-46,\n\t\t                    34,44,47,-8,6,29,45,-33,4,52,53,-6,52,51,54,-54,51,50,55,-55,50,49,56,-56,49,48,57,-57,32,68,58,-7,\n\t\t                    68,69,59,-59,69,70,60,-60,70,71,61,-61,71,72,62,-62,6,58,63,-8,58,59,64,-64,59,60,65,-65,60,61,66,-66,\n\t\t                    61,62,67,-67,34,73,52,-5,73,74,51,-53,74,75,50,-52,75,76,49,-51,76,77,48,-50,5,53,68,-33,53,54,69,-69,\n\t\t                    54,55,70,-70,55,56,71,-71,56,57,72,-72,7,63,73,-35,63,64,74,-74,64,65,75,-75,65,66,76,-76,66,67,77,-77\n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.325358,0.000000,-0.945585,0.325363,0.000000,-0.945589,-0.325359,-0.000000,-0.945591,-0.325358,0.000000,-0.945585,\n\t\t\t         -1.000000,0.000000,0.000000,-1.000000,-0.000000,0.000001,-0.325357,-0.000000,0.945591,-0.325327,0.000000,0.945585,\n\t\t\t         -0.325327,0.000000,0.945585,-0.325357,-0.000000,0.945591,0.325364,0.000000,0.945589,0.325358,0.000000,0.945585,\n\t\t\t         1.000000,0.000000,0.000000,1.000000,0.000000,-0.000001,0.325363,0.000000,-0.945589,0.325358,0.000000,-0.945585,\n\t\t\t         -0.339305,-0.831782,0.439283,-0.339579,-0.917325,0.207739,-0.997101,0.072970,-0.020478,-0.997070,0.065950,-0.038026,\n\t\t\t         0.339305,-0.831782,0.439283,0.339549,-0.917325,0.207739,-0.339579,-0.917325,0.207739,-0.339305,-0.831782,0.439283,\n\t\t\t         -0.312510,0.835261,-0.452376,-0.312723,0.923551,-0.221809,0.312723,0.923551,-0.221809,0.312510,0.835261,-0.452376,\n\t\t\t         0.312723,0.923551,-0.221809,0.313718,0.944222,-0.100125,0.999007,0.043422,-0.009954,0.997101,0.072970,-0.020478,\n\t\t\t         -0.997101,0.053804,-0.053774,-0.997070,0.065950,-0.038026,-0.312510,0.835261,-0.452376,-0.312479,0.689688,-0.653157,\n\t\t\t         0.312510,0.835261,-0.452376,0.312723,0.923551,-0.221809,0.997101,0.072970,-0.020478,0.997070,0.065950,-0.038026,\n\t\t\t         -0.339579,-0.917325,0.207739,-0.332177,-0.939298,0.085899,-0.999007,0.043423,-0.009958,-0.997101,0.072970,-0.020478,\n\t\t\t         -0.312510,0.497085,-0.809442,-0.312479,0.689688,-0.653157,0.312479,0.689688,-0.653157,0.312510,0.497085,-0.809442,\n\t\t\t         0.312479,0.689688,-0.653157,0.312510,0.835261,-0.452376,0.997070,0.065950,-0.038026,0.997101,0.053804,-0.053743,\n\t\t\t         0.997101,0.053804,-0.053743,0.997070,0.065950,-0.038026,0.339305,-0.831782,0.439283,0.339274,-0.689657,0.639699,\n\t\t\t         0.997070,0.065950,-0.038026,0.997101,0.072970,-0.020478,0.339549,-0.917325,0.207739,0.339305,-0.831782,0.439283,\n\t\t\t         0.313059,0.270669,-0.910337,0.312510,0.497085,-0.809442,0.997070,0.038148,-0.065920,0.997040,0.020661,-0.073855,\n\t\t\t         0.312510,0.497085,-0.809442,0.312479,0.689688,-0.653157,0.997101,0.053804,-0.053743,0.997070,0.038148,-0.065920,\n\t\t\t         0.339274,-0.500473,0.796472,0.339274,-0.689657,0.639699,-0.339274,-0.689657,0.639699,-0.339274,-0.500473,0.796472,\n\t\t\t         -0.339274,-0.689657,0.639699,-0.339305,-0.831782,0.439283,-0.997070,0.065950,-0.038026,-0.997101,0.053804,-0.053774,\n\t\t\t         0.317392,0.074465,-0.945341,0.313059,0.270669,-0.910337,0.997040,0.020661,-0.073855,0.998962,0.004975,-0.045076,\n\t\t\t         0.997040,0.020661,-0.073855,0.997070,0.038148,-0.065920,0.339274,-0.500473,0.796472,0.339000,-0.275552,0.899503,\n\t\t\t         -0.313059,0.270669,-0.910337,-0.312510,0.497085,-0.809442,0.312510,0.497085,-0.809442,0.313059,0.270669,-0.910337,\n\t\t\t         0.997070,0.038148,-0.065920,0.997101,0.053804,-0.053743,0.339274,-0.689657,0.639699,0.339274,-0.500473,0.796472,\n\t\t\t         -0.998962,0.004975,-0.045076,-0.997040,0.020661,-0.073855,-0.313059,0.270669,-0.910337,-0.317392,0.074465,-0.945341,\n\t\t\t         0.333689,-0.077853,0.939451,0.339000,-0.275552,0.899503,-0.339000,-0.275552,0.899503,-0.333689,-0.077853,0.939451,\n\t\t\t         -0.317392,0.074465,-0.945341,-0.313059,0.270669,-0.910337,0.313059,0.270669,-0.910337,0.317392,0.074465,-0.945341,\n\t\t\t         0.339000,-0.275552,0.899503,0.339274,-0.500473,0.796472,-0.339274,-0.500473,0.796472,-0.339000,-0.275552,0.899503,\n\t\t\t         -0.325358,0.000000,-0.945585,-0.325359,-0.000000,-0.945591,-1.000000,-0.000000,0.000001,-1.000000,0.000000,0.000000,\n\t\t\t         0.325358,0.000000,0.945585,0.325364,0.000000,0.945589,1.000000,0.000000,-0.000001,1.000000,0.000000,0.000000,\n\t\t\t         0.997101,0.072970,-0.020478,0.999007,0.043422,-0.009954,0.332178,-0.939297,0.085902,0.339549,-0.917325,0.207739,\n\t\t\t         -0.997101,0.072970,-0.020478,-0.999007,0.043423,-0.009958,-0.313718,0.944222,-0.100124,-0.312723,0.923551,-0.221809,\n\t\t\t         -0.312723,0.923551,-0.221809,-0.313718,0.944222,-0.100124,0.313718,0.944222,-0.100125,0.312723,0.923551,-0.221809,\n\t\t\t         -0.997070,0.065950,-0.038026,-0.997101,0.072970,-0.020478,-0.312723,0.923551,-0.221809,-0.312510,0.835261,-0.452376,\n\t\t\t         0.339549,-0.917325,0.207739,0.332178,-0.939297,0.085902,-0.332177,-0.939298,0.085899,-0.339579,-0.917325,0.207739,\n\t\t\t         0.339274,-0.689657,0.639699,0.339305,-0.831782,0.439283,-0.339305,-0.831782,0.439283,-0.339274,-0.689657,0.639699,\n\t\t\t         -0.312479,0.689688,-0.653157,-0.312510,0.835261,-0.452376,0.312510,0.835261,-0.452376,0.312479,0.689688,-0.653157,\n\t\t\t         -0.339274,-0.500473,0.796472,-0.339274,-0.689657,0.639699,-0.997101,0.053804,-0.053774,-0.997070,0.038148,-0.065920,\n\t\t\t         -0.997070,0.038148,-0.065920,-0.997101,0.053804,-0.053774,-0.312479,0.689688,-0.653157,-0.312510,0.497085,-0.809442,\n\t\t\t         -0.997040,0.020661,-0.073855,-0.997070,0.038148,-0.065920,-0.312510,0.497085,-0.809442,-0.313059,0.270669,-0.910337,\n\t\t\t         -0.339000,-0.275552,0.899503,-0.339274,-0.500473,0.796472,-0.997070,0.038148,-0.065920,-0.997040,0.020661,-0.073855,\n\t\t\t         0.998962,0.004975,-0.045076,0.997040,0.020661,-0.073855,0.339000,-0.275552,0.899503,0.333689,-0.077853,0.939451,\n\t\t\t         -0.333689,-0.077853,0.939451,-0.339000,-0.275552,0.899503,-0.997040,0.020661,-0.073855,-0.998962,0.004975,-0.045076,\n\t\t\t         0.317392,0.074465,-0.945341,0.324503,-0.000031,-0.945860,-0.324534,-0.000031,-0.945860,-0.317392,0.074465,-0.945341,\n\t\t\t         0.324503,-0.000031,-0.945860,0.325388,0.000000,-0.945555,-0.325388,0.000000,-0.945555,-0.324534,-0.000031,-0.945860,\n\t\t\t         0.325388,0.000000,-0.945555,0.325358,0.000000,-0.945585,-0.325358,0.000000,-0.945585,-0.325388,0.000000,-0.945555,\n\t\t\t         0.325358,0.000000,-0.945585,0.325358,0.000000,-0.945585,-0.325358,0.000000,-0.945585,-0.325358,0.000000,-0.945585,\n\t\t\t         0.325358,0.000000,-0.945585,0.325358,0.000000,-0.945585,-0.325358,0.000000,-0.945585,-0.325358,0.000000,-0.945585,\n\t\t\t         -0.998962,0.004975,-0.045076,-0.999969,0.000000,-0.001465,-0.326060,0.000061,0.945341,-0.333689,-0.077853,0.939451,\n\t\t\t         -0.999969,0.000000,-0.001465,-0.999969,0.000000,0.000061,-0.325297,0.000000,0.945585,-0.326060,0.000061,0.945341,\n\t\t\t         -0.999969,0.000000,0.000061,-1.000000,0.000000,0.000000,-0.325358,0.000000,0.945585,-0.325297,0.000000,0.945585,\n\t\t\t         -1.000000,0.000000,0.000000,-0.999969,0.000000,0.000000,-0.325358,0.000000,0.945585,-0.325358,0.000000,0.945585,\n\t\t\t         -0.999969,0.000000,0.000000,-1.000000,0.000000,0.000000,-0.325327,0.000000,0.945585,-0.325358,0.000000,0.945585,\n\t\t\t         -0.333689,-0.077853,0.939451,-0.326060,0.000061,0.945341,0.326060,0.000061,0.945341,0.333689,-0.077853,0.939451,\n\t\t\t         -0.326060,0.000061,0.945341,-0.325297,0.000000,0.945585,0.325297,0.000000,0.945585,0.326060,0.000061,0.945341,\n\t\t\t         -0.325297,0.000000,0.945585,-0.325358,0.000000,0.945585,0.325358,0.000000,0.945585,0.325297,0.000000,0.945585,\n\t\t\t         -0.325358,0.000000,0.945585,-0.325358,0.000000,0.945585,0.325358,0.000000,0.945585,0.325358,0.000000,0.945585,\n\t\t\t         -0.325358,0.000000,0.945585,-0.325327,0.000000,0.945585,0.325358,0.000000,0.945585,0.325358,0.000000,0.945585,\n\t\t\t         0.998962,0.004975,-0.045076,0.999969,0.000000,-0.001495,0.324503,-0.000031,-0.945860,0.317392,0.074465,-0.945341,\n\t\t\t         0.999969,0.000000,-0.001495,1.000000,0.000000,0.000061,0.325388,0.000000,-0.945555,0.324503,-0.000031,-0.945860,\n\t\t\t         1.000000,0.000000,0.000061,1.000000,0.000000,0.000000,0.325358,0.000000,-0.945585,0.325388,0.000000,-0.945555,\n\t\t\t         1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.325358,0.000000,-0.945585,0.325358,0.000000,-0.945585,\n\t\t\t         1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.325358,0.000000,-0.945585,0.325358,0.000000,-0.945585,\n\t\t\t         -0.317392,0.074465,-0.945341,-0.324534,-0.000031,-0.945860,-0.999969,0.000000,-0.001465,-0.998962,0.004975,-0.045076,\n\t\t\t         -0.324534,-0.000031,-0.945860,-0.325388,0.000000,-0.945555,-0.999969,0.000000,0.000061,-0.999969,0.000000,-0.001465,\n\t\t\t         -0.325388,0.000000,-0.945555,-0.325358,0.000000,-0.945585,-1.000000,0.000000,0.000000,-0.999969,0.000000,0.000061,\n\t\t\t         -0.325358,0.000000,-0.945585,-0.325358,0.000000,-0.945585,-0.999969,0.000000,0.000000,-1.000000,0.000000,0.000000,\n\t\t\t         -0.325358,0.000000,-0.945585,-0.325358,0.000000,-0.945585,-1.000000,0.000000,0.000000,-0.999969,0.000000,0.000000,\n\t\t\t         0.333689,-0.077853,0.939451,0.326060,0.000061,0.945341,0.999969,0.000000,-0.001495,0.998962,0.004975,-0.045076,\n\t\t\t         0.326060,0.000061,0.945341,0.325297,0.000000,0.945585,1.000000,0.000000,0.000061,0.999969,0.000000,-0.001495,\n\t\t\t         0.325297,0.000000,0.945585,0.325358,0.000000,0.945585,1.000000,0.000000,0.000000,1.000000,0.000000,0.000061,\n\t\t\t         0.325358,0.000000,0.945585,0.325358,0.000000,0.945585,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,\n\t\t\t         0.325358,0.000000,0.945585,0.325358,0.000000,0.945585,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000\n\t\t}\n\t\tLayerElementSmoothing: 0 {\n\t\t\tVersion: 102\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygon\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tSmoothing: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.508049,1.296450,0.477319,0.698345,0.326199,1.344703,0.477527,-1.012048,0.339164,1.363796,0.490832,1.107122,\n\t\t\t    0.476170,1.373649,0.477111,1.313511,0.489687,-1.011867,0.338432,1.344167,0.477180,1.107458,0.490304,1.084134,\n\t\t\t    0.493474,1.308169,0.646591,0.484429,0.647122,1.285333,0.508155,1.328105,0.489497,1.355560,0.487131,1.376592,\n\t\t\t    0.325454,1.311144,0.508365,1.285159,0.492259,1.297605,0.663007,1.298032,0.477737,1.323977,0.661666,1.308556,\n\t\t\t    0.327632,1.365604,0.490348,1.286048,0.490145,0.493763,0.490374,0.698216,0.490087,-1.012048,0.325503,1.323055,\n\t\t\t    0.665113,1.286519,0.338705,1.323719,0.477388,0.493788,0.508583,1.083884,0.339919,1.373133,0.648407,1.349023,\n\t\t\t    0.324723,0.289157,0.490131,0.284567,0.325161,0.902528,0.647397,1.338630,0.324576,-1.012024,0.325790,1.334085,\n\t\t\t    0.646856,0.884103,0.477930,1.334293,0.491061,1.311694,0.477458,0.289232,0.326764,1.355166,0.490550,1.334483,\n\t\t\t    0.646325,-1.011969,0.508802,0.884050,0.488604,1.366062,0.660886,1.318626,0.489916,0.289310,0.647009,1.307560,\n\t\t\t    0.329067,1.376004,0.340590,-1.012048,0.665215,0.884459,0.665367,0.284865,0.490261,0.884242,0.477250,0.902901,\n\t\t\t    0.508158,1.307285,0.340015,0.698308,0.646458,0.284592,0.494172,1.318276,0.490908,1.323507,0.509020,0.684217,\n\t\t\t    0.490218,0.684351,0.660832,1.337934,0.646922,1.328366,0.340398,0.289220,0.660580,1.328412,0.508259,1.317782,\n\t\t\t    0.506630,1.349023,0.339440,1.313210,0.665316,0.484730,0.477840,1.344436,0.338419,1.334036,0.492866,1.346953,\n\t\t\t    0.509676,-1.012007,0.490094,1.345081,0.339632,1.107397,0.476971,1.364143,0.665417,-1.011724,0.665164,1.084324,\n\t\t\t    0.494103,1.337695,0.665265,0.684595,0.324869,0.493614,0.325015,0.698071,0.509239,0.484384,0.477524,1.354401,\n\t\t\t    0.646845,1.318063,0.490603,0.902669,0.490174,0.484459,0.494415,1.328107,0.646724,0.684266,0.338681,1.354101,\n\t\t\t    0.325308,1.106984,0.507679,1.338423,0.509457,0.284550,0.340207,0.493764,0.646989,1.083941,0.661983,1.347062,\n\t\t\t    0.339823,0.902853,0.647232,1.296702\n\t\t\tUVIndex: 62,48,78,98,52,8,3,45,45,3,55,69,57,82,48,62,89,81,50,16,95,4,81,89,15,97,39,68,39,35,101,67,63,93,15,71,68,39,67,70,81,6,17,50,60,71,90,53,90,68,70,51,2,46,95,9,46,24,4,95,103,53,23,21,\n\t\t\t         53,90,51,23,76,9,75,43,75,89,16,79,14,103,21,30,29,41,76,31,0,60,53,103,41,2,9,76,25,20,0,19,73,31,22,7,19,0,103,14,31,76,43,22,98,78,28,37,69,55,40,36,24,54,34,4,84,77,72,97,97,72,35,39,\n\t\t\t         93,84,97,15,4,34,6,81,9,95,89,75,71,15,68,90,43,75,79,47,12,63,71,60,20,12,60,0,22,43,47,64,18,29,31,73,7,22,64,44,14,100,33,19,100,42,49,33,42,94,65,49,94,13,88,65,13,62,98,88,44,5,10,7,\n\t\t\t         5,91,59,10,91,27,1,59,27,26,32,1,26,52,45,32,7,10,80,73,10,59,102,80,59,1,61,102,1,32,99,61,32,45,69,99,30,83,100,14,83,56,42,100,56,85,94,42,85,74,13,94,74,57,62,13,19,33,11,25,33,49,58,11,\n\t\t\t         49,65,66,58,65,88,92,66,88,98,37,92,73,80,96,18,80,102,38,96,102,61,87,38,61,99,86,87,99,69,36,86\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementSmoothing\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementTexture\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,71.299999999999997,287.500000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",10.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",4000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",0\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,71.300000,287.500000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,-4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,-4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,-4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,-4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: -4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tMaterial: \"Material::unnamed\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"phong\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Phong\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.5000\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",12.3\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",12.3\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Camera\", \"Camera\" {\n\t}\n\tModel: \"Model::Lamp\", \"Light\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::unnamed\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Model::Lamp\", \"Model::Scene\"\n\tConnect: \"OO\", \"Model::Camera\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::unnamed\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n\tTake: \"Default Take\" {\n\t\tFileName: \"Default_Take.tak\"\n\t\tLocalTime: 0,479181389250\n\t\tReferenceTime: 0,479181389250\n\n\t\t;Models animation\n\t\t;----------------------------------------------------\n\t\tModel: \"Model::Cube\" {\n\t\t\tVersion: 1.1\n\t\t\tChannel: \"Transform\" {\n\t\t\t\tChannel: \"T\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 1\n\t\t\t\t}\n\t\t\t\tChannel: \"R\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: -90.000002504348856\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-90.000002504348856,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: -0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 2\n\t\t\t\t}\n\t\t\t\tChannel: \"S\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 3\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tModel: \"Model::Camera\" {\n\t\t\tVersion: 1.1\n\t\t\tChannel: \"Transform\" {\n\t\t\t\tChannel: \"T\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 7.481131553649902\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,7.481131553649902,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 5.343665122985840\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,5.343665122985840,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 6.507639884948730\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,6.507639884948730,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 1\n\t\t\t\t}\n\t\t\t\tChannel: \"R\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 23.240198471724188\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,23.240198471724188,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 142.362356870423241\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,142.362356870423241,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 34.212069212897042\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,34.212069212897042,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 2\n\t\t\t\t}\n\t\t\t\tChannel: \"S\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 0.999999940395355\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.999999940395355,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 3\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tModel: \"Model::Lamp\" {\n\t\t\tVersion: 1.1\n\t\t\tChannel: \"Transform\" {\n\t\t\t\tChannel: \"T\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 4.076245307922363\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,4.076245307922363,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 5.903861999511719\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,5.903861999511719,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: -1.005453944206238\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-1.005453944206238,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 1\n\t\t\t\t}\n\t\t\t\tChannel: \"R\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 47.533574547422390\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,47.533574547422390,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 107.220760383191333\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,107.220760383191333,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 10.743664729492949\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,10.743664729492949,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 2\n\t\t\t\t}\n\t\t\t\tChannel: \"S\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 0.999999880790710\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.999999880790710,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 3\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Effects/AdditiveClouds.fx",
    "content": "#include \"CloudCommon.fxh\"\n\n// No shadow technique. We don't want the clouds casting shadows.\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = One;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS(false);\n\t\tPixelShader = compile ps_3_0 CloudPS(false);\n\t}\n}\n\ntechnique RenderInfinite\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = One;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS(true);\n\t\tPixelShader = compile ps_3_0 CloudPS(true);\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = One;\n\n\t\tVertexShader = compile vs_3_0 RenderVS(false);\n\t\tPixelShader = compile ps_3_0 CloudPS(false);\n\t}\n}\n\ntechnique ClipInfinite\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = One;\n\n\t\tVertexShader = compile vs_3_0 RenderVS(true);\n\t\tPixelShader = compile ps_3_0 CloudPS(true);\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/Animation.fx",
    "content": "#include \"AnimationCommon.fxh\"\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureFlatPlainPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureFlatPlainPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/AnimationCommon.fxh",
    "content": "#include \"RenderCommon.fxh\"\n\nfloat4x3 Bones[78];\n\nfloat2 UVOffset;\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n\tint4 indices : BLENDINDICES0;\n\tfloat4 weights : BLENDWEIGHT0;\n};\n\n// Motion blur vertex shader\nvoid RenderVS (\tin RenderVSInput input,\n\t\t\t\t\tout RenderVSOutput vs,\n\t\t\t\t\tout RenderPSInput output,\n\t\t\t\t\tout TexturePSInput tex,\n\t\t\t\t\tout FlatPSInput flat,\n\t\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\tfloat4x3 skinning = 0;\n\n\t[unroll]\n\tfor (int i = 0; i < 4; i++)\n\t\tskinning += Bones[input.indices[i]] * input.weights[i];\n\n\tfloat4 pos = float4(mul(input.position, skinning), input.position.w);\n\tinput.normal = mul(input.normal, (float3x3)skinning);\n\tfloat4 worldPosition = mul(pos, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\ttex.uvCoordinates = input.uvCoordinates + UVOffset;\n\n\tflat.normal = mul(input.normal, WorldMatrix);\n\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(pos, LastFrameWorldViewProjectionMatrix);\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout FlatPSInput flat,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, tex, flat, motionBlur);\n\tclipData = GetClipData(output.position);\n}\n\n// Shadow vertex shader\nvoid ShadowVS (\tin float4 in_Position\t\t\t: POSITION,\n\t\t\t\tin int4 in_Indices\t\t\t\t: BLENDINDICES0,\n\t\t\t\tin float4 in_Weights\t\t\t: BLENDWEIGHT0,\n\t\t\t\tout ShadowVSOutput vs,\n\t\t\t\tout ShadowPSInput output)\n{\n\t// Calculate shadow-space position\n\tfloat4x3 skinning = 0;\n\n\t[unroll]\n\tfor (int i = 0; i < 3; i++)\n\t\tskinning += Bones[in_Indices[i]] * in_Weights[i];\n\tfloat4 pos = float4(mul(in_Position, skinning), in_Position.w);\n\t\n\t// Calculate shadow-space position\n\tfloat4 worldPosition = mul(pos, WorldMatrix);\n\toutput.worldPosition = worldPosition.xyz;\n\tvs.position = mul(worldPosition, ViewProjectionMatrix);\n\toutput.clipSpacePosition = vs.position;\n}\n"
  },
  {
    "path": "Lemma/Content/Effects/AnimationNormalMap.fx",
    "content": "#include \"AnimationNormalMapCommon.fxh\"\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapPlainPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/AnimationNormalMapCommon.fxh",
    "content": "#include \"RenderCommon.fxh\"\n\nfloat4x3 Bones[67];\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n\tfloat3 binormal : BINORMAL0;\n\tfloat3 tangent : TANGENT0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n\tint4 indices : BLENDINDICES0;\n\tfloat4 weights : BLENDWEIGHT0;\n};\n\n// Motion blur vertex shader\nvoid RenderVS (\tin RenderVSInput input,\n\t\t\t\t\tout RenderVSOutput vs,\n\t\t\t\t\tout RenderPSInput output,\n\t\t\t\t\tout TexturePSInput tex,\n\t\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\tfloat4x3 skinning = 0;\n\n\t[unroll]\n\tfor (int i = 0; i < 4; i++)\n\t\tskinning += Bones[input.indices[i]] * input.weights[i];\n\n\tfloat4 pos = float4(mul(input.position, skinning), input.position.w);\n\tinput.normal = mul(input.normal, (float3x3)skinning);\n\tinput.binormal = mul(input.binormal, (float3x3)skinning);\n\tinput.tangent = mul(input.tangent, (float3x3)skinning);\n\tfloat4 worldPosition = mul(pos, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\ttex.uvCoordinates = input.uvCoordinates;\n\n\tnormalMap.tangentToWorld[0] = normalize(mul(input.tangent, WorldMatrix));\n\tnormalMap.tangentToWorld[1] = normalize(mul(input.binormal, WorldMatrix));\n\tnormalMap.tangentToWorld[2] = normalize(mul(input.normal, WorldMatrix));\n\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(pos, LastFrameWorldViewProjectionMatrix);\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, tex, normalMap, motionBlur);\n\tclipData = GetClipData(output.position);\n}\n\n// Shadow vertex shader\nvoid ShadowVS (\tin float4 in_Position\t\t\t: POSITION,\n\t\t\t\tin int4 in_Indices\t\t\t\t: BLENDINDICES0,\n\t\t\t\tin float4 in_Weights\t\t\t: BLENDWEIGHT0,\n\t\t\t\tout ShadowVSOutput vs,\n\t\t\t\tout ShadowPSInput output)\n{\n\tfloat4x3 skinning = 0;\n\n\t[unroll]\n\tfor (int i = 0; i < 4; i++)\n\t\tskinning += Bones[in_Indices[i]] * in_Weights[i];\n\n\tfloat4 pos = float4(mul(in_Position, skinning), in_Position.w);\n\tfloat4 worldPosition = mul(pos, WorldMatrix);\n\toutput.worldPosition = worldPosition;\n\tvs.position = mul(worldPosition, ViewProjectionMatrix);\n\toutput.clipSpacePosition = vs.position;\n}"
  },
  {
    "path": "Lemma/Content/Effects/AnimationUnlit.fx",
    "content": "#include \"AnimationCommon.fxh\"\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTexturePlainPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTexturePlainPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/ClipCommon.fxh",
    "content": "float4 ClipPlanes[4] = { (float4)0, (float4)0, (float4)0, (float4)0 };\n\nClipPSInput GetClipData(float4 position)\n{\n\tClipPSInput result;\n\tresult.clipPlaneDistances.x = dot(position, ClipPlanes[0]);\n\tresult.clipPlaneDistances.y = dot(position, ClipPlanes[1]);\n\tresult.clipPlaneDistances.z = dot(position, ClipPlanes[2]);\n\tresult.clipPlaneDistances.w = dot(position, ClipPlanes[3]);\n\treturn result;\n}\n\nvoid HandleClipPlanes(float4 clipPlanes)\n{\n\tclip(clipPlanes.xyz);\n\tclip(clipPlanes.w);\n}"
  },
  {
    "path": "Lemma/Content/Effects/CloudCommon.fxh",
    "content": "#include \"RenderCommonAlpha.fxh\"\n\nfloat StartDistance;\n\nfloat Time;\nfloat2 Velocity;\nfloat Height;\nfloat3 CameraPosition;\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tuniform bool infinite,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout AlphaPSInput alpha,\n\t\t\t\tout TexturePSInput tex)\n{\n\tfloat3 worldPosition;\n\tif (infinite)\n\t{\n\t\tworldPosition = input.position * 4.5f;\n\t\tworldPosition.y += Height;\n\t\ttex.uvCoordinates = input.uvCoordinates;\n\t}\n\telse\n\t{\n\t\tworldPosition = input.position * FarPlaneDistance;\n\t\tworldPosition.y += Height - CameraPosition.y;\n\t\ttex.uvCoordinates = input.uvCoordinates + (CameraPosition.zx / FarPlaneDistance) * 0.5f;\n\t}\n\toutput.position = float4(worldPosition, 1);\n\tfloat3 viewSpacePosition = mul(worldPosition, (float3x3)ViewMatrix);\n\tvs.position = mul(float4(viewSpacePosition, 1), ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\talpha.clipSpacePosition = vs.position;\n\n}\n\nvoid CloudPS(in RenderPSInput input,\n\t\t\t\t\t\tuniform bool infinite,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tfloat2 uv = 0.5f * alpha.clipSpacePosition.xy / alpha.clipSpacePosition.w + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\tuv = (round(uv * DestinationDimensions) + float2(0.5f, 0.5f)) / DestinationDimensions;\n\tfloat depth = tex2D(DepthSampler, uv).r;\n\tfloat4 texColor = tex2D(DiffuseSampler, tex.uvCoordinates + Velocity * Time);\n\toutput.rgb = DiffuseColor.rgb * texColor.rgb;\n\n\tfloat blend = (depth - StartDistance) / (FarPlaneDistance - StartDistance);\n\tif (infinite)\n\t\tblend *= max(1.0f - 2.0f * length(tex.uvCoordinates - float2(0.5f, 0.5f)), 0);\n\telse\n\t\tblend *= max(1.0f - (length(input.position.xyz) - StartDistance) / (FarPlaneDistance - StartDistance), 0);\n\n\toutput.a = Alpha * texColor.a * clamp(blend, 0, 1);\n}\n\nvoid ClipCloudPS(in RenderPSInput input,\n\t\t\t\t\t\tuniform bool infinite,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tCloudPS(input, infinite, tex, alpha, output);\n}"
  },
  {
    "path": "Lemma/Content/Effects/Clouds.fx",
    "content": "#include \"CloudCommon.fxh\"\n\n// No shadow technique. We don't want the clouds casting shadows.\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS(false);\n\t\tPixelShader = compile ps_3_0 CloudPS(false);\n\t}\n}\n\ntechnique RenderInfinite\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS(true);\n\t\tPixelShader = compile ps_3_0 CloudPS(true);\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 RenderVS(false);\n\t\tPixelShader = compile ps_3_0 CloudPS(false);\n\t}\n}\n\ntechnique ClipInfinite\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 RenderVS(true);\n\t\tPixelShader = compile ps_3_0 CloudPS(true);\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/Common.fxh",
    "content": "// Camera matrices\nfloat4x4 ViewMatrix;\nfloat4x4 ProjectionMatrix;\nfloat4x4 ViewProjectionMatrix;\n\n// Constants\nstatic const float PI = 3.14159265f;\n\nfloat3 DecodeNormalMap(float3 enc)\n{\n\treturn (2.0f * enc) - 1.0f;\n}\n\nfloat3 EncodeNormalBuffer(float3 enc)\n{\n\treturn (enc * 0.5f) + 0.5f;\n}\n\nfloat3 DecodeNormalBuffer(float3 enc)\n{\n\treturn (2.0f * enc) - 1.0f;\n}\n\nfloat2 EncodeNormal(float2 v)\n{\n\treturn v * 0.5f + 0.5f;\n}\n\nfloat2 DecodeNormal(float2 v)\n{\n\treturn (2.0f * v) - 1.0f;\n}\n\nconst float MotionBlurMax = 32.0f;\n\nfloat2 EncodeVelocity(float2 v, float2 p)\n{\n\t// p = screen dimensions\n\treturn (v * p * (1.0f / MotionBlurMax)) * 0.5f + 0.5f;\n}\n\nfloat2 DecodeVelocity(float2 v, float2 p)\n{\n\treturn ((2.0f * v) - 1.0f) * (MotionBlurMax / p);\n}\n\nfloat EncodeMaterial(int id)\n{\n\treturn (float)id * (1.0f / 255.0f);\n}\n\nint DecodeMaterial(float x)\n{\n\treturn (int)ceil(x * 255.0f);\n}\n\n// Input and output structures\nstruct RenderPSInput\n{\n\tfloat4 position : TEXCOORD0;\n\tfloat3 viewSpacePosition : TEXCOORD1;\n};\n\nstruct RenderVSOutput\n{\n\tfloat4 position : POSITION0;\n};\n\nstruct ShadowVSOutput\n{\n\tfloat4 position : POSITION0;\n};\n\nstruct ShadowPSInput\n{\n\tfloat4 clipSpacePosition : TEXCOORD0;\n\tfloat3 worldPosition : TEXCOORD1;\n};\n\nstruct TexturePSInput\n{\n\tfloat2 uvCoordinates : TEXCOORD2;\n};\n\nstruct ClipPSInput\n{\n\tfloat4 clipPlaneDistances : TEXCOORD3;\n};\n\nstruct NormalMapPSInput\n{\n\tfloat3x3 tangentToWorld : TEXCOORD4;\n};\n\nstruct FlatPSInput\n{\n\tfloat3 normal : TEXCOORD4;\n};\n\nstruct AlphaPSInput\n{\n\tfloat4 clipSpacePosition : TEXCOORD4;\n};\n\nstruct VertexColorPSInput\n{\n\tfloat4 color : TEXCOORD5;\n};\n\nstruct RenderPSOutput\n{\n\tfloat4 color : COLOR0;\n\tfloat4 depth : COLOR1;\n\tfloat4 normal : COLOR2;\n};\n\nstruct MotionBlurPSInput\n{\n\tfloat4 previousPosition : TEXCOORD7;\n\tfloat4 currentPosition : TEXCOORD8;\n};\n\nstruct OverlayPSInput\n{\n\tfloat2 uvCoordinates : TEXCOORD9;\n};\n"
  },
  {
    "path": "Lemma/Content/Effects/Default.fx",
    "content": "#include \"DefaultCommon.fxh\"\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureFlatPlainPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureFlatPlainPS();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Effects/DefaultAlpha.fx",
    "content": "#include \"RenderCommonAlpha.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout AlphaPSInput alpha,\n\t\t\t\tout TexturePSInput tex)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\talpha.clipSpacePosition = vs.position;\n\n\ttex.uvCoordinates = input.uvCoordinates;\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout AlphaPSInput alpha,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, alpha, tex);\n\tclipData = GetClipData(output.position);\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureAlphaPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureAlphaPS();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Effects/DefaultAlphaClip.fx",
    "content": "#include \"DefaultCommon.fxh\"\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowAlphaPS();\n\t}\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureFlatClipAlphaPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureFlatClipAlphaPS();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Effects/DefaultCommon.fxh",
    "content": "#include \"RenderCommon.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout FlatPSInput flat,\n\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\ttex.uvCoordinates = input.uvCoordinates;\n\tflat.normal = mul(input.normal, WorldMatrix);\n\t\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(input.position, LastFrameWorldViewProjectionMatrix);\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout FlatPSInput flat,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, tex, flat, motionBlur);\n\tclipData = GetClipData(output.position);\n}\n\n// Shadow vertex shader\nvoid ShadowVS (\tin float4 in_Position : POSITION,\n\t\t\t\tin float2 in_UvCoordinates : TEXCOORD0,\n\t\t\t\tout ShadowVSOutput vs,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout ShadowPSInput output)\n{\n\t// Calculate shadow-space position\n\tfloat4 worldPosition = mul(in_Position, WorldMatrix);\n\toutput.worldPosition = worldPosition.xyz;\n\tvs.position = mul(worldPosition, ViewProjectionMatrix);\n\toutput.clipSpacePosition = vs.position;\n\ttex.uvCoordinates = in_UvCoordinates;\n}"
  },
  {
    "path": "Lemma/Content/Effects/DefaultNormalMap.fx",
    "content": "#include \"RenderCommon.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n\tfloat3 binormal : BINORMAL0;\n\tfloat3 tangent : TANGENT0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\ttex.uvCoordinates = input.uvCoordinates;\n\n\tnormalMap.tangentToWorld[0] = normalize(mul(input.tangent, WorldMatrix));\n\tnormalMap.tangentToWorld[1] = normalize(mul(input.binormal, WorldMatrix));\n\tnormalMap.tangentToWorld[2] = normalize(mul(input.normal, WorldMatrix));\n\t\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(input.position, LastFrameWorldViewProjectionMatrix);\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, tex, normalMap, motionBlur);\n\tclipData = GetClipData(output.position);\n}\n\n// Shadow vertex shader\nvoid ShadowVS (\tin float4 in_Position : POSITION,\n\t\t\t\tout ShadowVSOutput vs,\n\t\t\t\tout ShadowPSInput output)\n{\n\t// Calculate shadow-space position\n\tfloat4 worldPosition = mul(in_Position, WorldMatrix);\n\toutput.worldPosition = worldPosition.xyz;\n\tvs.position = mul(worldPosition, ViewProjectionMatrix);\n\toutput.clipSpacePosition = vs.position;\n}\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapPlainPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainPS();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Effects/DefaultSingleMaterial.fx",
    "content": "#include \"DefaultCommon.fxh\"\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureFlatPlainSingleMaterialPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureFlatPlainSingleMaterialPS();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Effects/DefaultSolidColor.fx",
    "content": "#include \"RenderCommon.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout FlatPSInput flat,\n\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\tflat.normal = mul(input.normal, WorldMatrix);\n\t\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(input.position, LastFrameWorldViewProjectionMatrix);\n}\n\n// Shadow vertex shader\nvoid ShadowVS (\tin float4 in_Position : POSITION,\n\t\t\t\tout ShadowVSOutput vs,\n\t\t\t\tout ShadowPSInput output)\n{\n\t// Calculate shadow-space position\n\tfloat4 worldPosition = mul(in_Position, WorldMatrix);\n\toutput.worldPosition = worldPosition.xyz;\n\tvs.position = mul(worldPosition, ViewProjectionMatrix);\n\toutput.clipSpacePosition = vs.position;\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout FlatPSInput flat,\n\t\t\t\tout ClipPSInput clipData,\n\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\tRenderVS(input, vs, output, flat, motionBlur);\n\tclipData = GetClipData(output.position);\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderFlatPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipFlatPS();\n\t}\n}\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/DefaultSolidColorAlpha.fx",
    "content": "#include \"RenderCommonAlpha.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout AlphaPSInput alpha)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\talpha.clipSpacePosition = vs.position;\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout AlphaPSInput alpha,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, alpha);\n\tclipData = GetClipData(output.position);\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderSolidColorAlphaPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipSolidColorAlphaPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/DistortionBox.fx",
    "content": "#include \"RenderCommonAlpha.fxh\"\n\nfloat3 Scale;\nfloat3 Offset;\n\n// Frame buffer sampler\ntexture2D FrameTexture;\nsampler2D FrameSampler = sampler_state\n{\n\tTexture = <FrameTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n\tfloat2 uv : TEXCOORD0;\n};\n\nstruct EdgePSInput\n{\n\tfloat2 uv : TEXCOORD8;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout AlphaPSInput alpha,\n\t\t\t\tout EdgePSInput edge)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\talpha.clipSpacePosition = vs.position;\n\n\tfloat diff = length(input.position * input.normal) * 2;\n\n\tfloat3 pos = (input.position.xyz + Offset) * Scale;\n\n\ttex.uvCoordinates = float2(diff + pos.x + (pos.z * input.normal.x), diff - pos.y + (pos.z * input.normal.y)) * 0.125f;\n\tedge.uv = input.uv;\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout AlphaPSInput alpha,\n\t\t\t\tout EdgePSInput edge,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, tex, alpha, edge);\n\tclipData = GetClipData(output.position);\n}\n\nvoid DistortionPS(\n\tin RenderPSInput input,\n\tin TexturePSInput tex,\n\tin AlphaPSInput alpha,\n\tin EdgePSInput edge,\n\tout float4 output : COLOR0)\n{\n\t// Convert from clip space to UV coordinate space\n\tfloat2 uv = 0.5f * alpha.clipSpacePosition.xy / alpha.clipSpacePosition.w + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\n\tfloat depth = length(input.viewSpacePosition);\n\tclip(tex2D(DepthSampler, uv).r - depth);\n\n\tfloat4 t = tex2D(NormalMapSampler, tex.uvCoordinates);\n\t\n\tfloat a = t.a * Alpha;\n\tfloat2 distortion = ((t.xy * 2.0f) - 1.0f) * a * 0.2f * (1.0f - (depth / FarPlaneDistance));\n\n\tfloat3 color = tex2D(FrameSampler, uv + distortion).rgb * DiffuseColor.rgb;\n\n\t// Edge highlight\n\tconst float radius = 0.15f;\n\tfloat2 diff = float2(min(max(edge.uv.x, radius), 1.0f - radius), min(max(edge.uv.y, radius), 1.0f - radius)) - edge.uv;\n\tcolor *= 0.6f + (5.0f * (diff.x * diff.x + diff.y * diff.y) / radius);\n\n\toutput = float4(color, a);\n}\n\nvoid ClipDistortionPS(in RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tin EdgePSInput edge,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tDistortionPS(input, tex, alpha, edge, output);\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 DistortionPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipDistortionPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/Environment.fx",
    "content": "#include \"EnvironmentCommon.fxh\"\n\nfloat3 Offset;\n\nstruct RenderVSInput\n{\n\tfloat3 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n\tfloat3 binormal : BINORMAL0;\n\tfloat3 tangent : TANGENT0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout NormalMapPSInput normalMap)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(float4(input.position - Offset, 1), WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\tnormalMap.tangentToWorld[0] = normalize(mul(input.tangent, WorldMatrix));\n\tnormalMap.tangentToWorld[1] = normalize(mul(input.binormal, WorldMatrix));\n\tnormalMap.tangentToWorld[2] = normalize(mul(input.normal, WorldMatrix));\n\n\ttex.uvCoordinates = CalculateUVs(input.position, input.normal);\n\t\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(float4(input.position - Offset, 1), LastFrameWorldViewProjectionMatrix);\n}\n\nvoid RenderOverlayVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tout OverlayPSInput overlay)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(float4(input.position - Offset, 1), WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\tnormalMap.tangentToWorld[0] = normalize(mul(input.tangent, WorldMatrix));\n\tnormalMap.tangentToWorld[1] = normalize(mul(input.binormal, WorldMatrix));\n\tnormalMap.tangentToWorld[2] = normalize(mul(input.normal, WorldMatrix));\n\n\tCalculateOverlayUVs(input.position, input.normal, tex, overlay);\n\t\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(float4(input.position - Offset, 1), LastFrameWorldViewProjectionMatrix);\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, tex, motionBlur, normalMap);\n\tclipData = GetClipData(output.position);\n}\n\nvoid ClipOverlayVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tout OverlayPSInput overlay,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderOverlayVS(input, vs, output, tex, motionBlur, normalMap, overlay);\n\tclipData = GetClipData(output.position);\n}\n\nvoid ShadowVS(\tin float3 inPosition : POSITION0,\n\t\t\t\tout ShadowVSOutput vs,\n\t\t\t\tout ShadowPSInput output)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(float4(inPosition - Offset, 1), WorldMatrix);\n\toutput.worldPosition = worldPosition.xyz;\n\tvs.position = mul(worldPosition, ViewProjectionMatrix);\n\toutput.clipSpacePosition = vs.position;\n}\n\nvoid ShadowAlphaVS(\tin float3 inPosition : POSITION0,\n\t\t\t\tin float3 inNormal : NORMAL0,\n\t\t\t\tout ShadowVSOutput vs,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout ShadowPSInput output)\n{\n\t// Calculate the clip-space vertex position\n\tfloat3 localPosition = inPosition - Offset;\n\tfloat4 worldPosition = mul(float4(localPosition, 1), WorldMatrix);\n\toutput.worldPosition = worldPosition.xyz;\n\tvs.position = mul(worldPosition, ViewProjectionMatrix);\n\toutput.clipSpacePosition = vs.position;\n\n\ttex.uvCoordinates = CalculateUVs(localPosition, inNormal);\n}\n\n// Regular techniques\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique ShadowOverlay\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique ShadowShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowAlphaVS();\n\t\tPixelShader = compile ps_3_0 ShadowAlphaPS();\n\t}\n}\n\ntechnique ShadowOverlayShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowAlphaVS();\n\t\tPixelShader = compile ps_3_0 ShadowAlphaPS();\n\t}\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapPlainPS();\n\t}\n}\n\ntechnique RenderShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapPlainPS();\n\t}\n}\n\ntechnique RenderOverlay\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderOverlayVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapPlainOverlayPS();\n\t}\n}\n\ntechnique RenderOverlayShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderOverlayVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapPlainOverlayPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainPS();\n\t}\n}\n\ntechnique ClipShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainPS();\n\t}\n}\n\ntechnique ClipOverlay\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipOverlayVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainOverlayPS();\n\t}\n}\n\ntechnique ClipOverlayShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipOverlayVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainOverlayPS();\n\t}\n}\n\n// Alpha techniques\n\ntechnique ShadowAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowAlphaVS();\n\t\tPixelShader = compile ps_3_0 ShadowAlphaPS();\n\t}\n}\n\ntechnique ShadowOverlayAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowAlphaVS();\n\t\tPixelShader = compile ps_3_0 ShadowAlphaPS();\n\t}\n}\n\ntechnique RenderAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapClipAlphaPS();\n\t}\n}\n\ntechnique RenderOverlayAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderOverlayVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapClipOverlayAlphaPS();\n\t}\n}\n\ntechnique ClipAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapClipAlphaPS();\n\t}\n}\n\ntechnique ClipOverlayAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipOverlayVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapClipOverlayAlphaPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/EnvironmentBlock.fx",
    "content": "#include \"EnvironmentCommon.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n\tfloat3 binormal : BINORMAL0;\n\tfloat3 tangent : TANGENT0;\n\tfloat3 offset : BLENDWEIGHT8;\n\tfloat4x4 instanceTransform : BLENDWEIGHT0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tin float4x4 lastInstanceTransform : BLENDWEIGHT4,\n\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4x4 world = mul(WorldMatrix, transpose(input.instanceTransform));\n\tfloat4 worldPosition = mul(input.position, world);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\tnormalMap.tangentToWorld[0] = normalize(mul(input.tangent, world));\n\tnormalMap.tangentToWorld[1] = normalize(mul(input.binormal, world));\n\tnormalMap.tangentToWorld[2] = normalize(mul(input.normal, world));\n\n\tfloat3 pos = input.position + input.offset;\n\n\ttex.uvCoordinates = CalculateUVs(pos, input.normal);\n\t\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(input.position, mul(transpose(lastInstanceTransform), LastFrameWorldViewProjectionMatrix));\n}\n\nvoid RenderOverlayVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tin float4x4 lastInstanceTransform : BLENDWEIGHT4,\n\t\t\t\tout OverlayPSInput overlay,\n\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4x4 world = mul(WorldMatrix, transpose(input.instanceTransform));\n\tfloat4 worldPosition = mul(input.position, world);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\tnormalMap.tangentToWorld[0] = normalize(mul(input.tangent, world));\n\tnormalMap.tangentToWorld[1] = normalize(mul(input.binormal, world));\n\tnormalMap.tangentToWorld[2] = normalize(mul(input.normal, world));\n\n\tfloat3 pos = input.position + input.offset;\n\n\tCalculateOverlayUVs(pos, input.normal, tex, overlay);\n\t\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(input.position, mul(transpose(lastInstanceTransform), LastFrameWorldViewProjectionMatrix));\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tin float4x4 lastInstanceTransform : BLENDWEIGHT4,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, tex, normalMap, lastInstanceTransform, motionBlur);\n\tclipData = GetClipData(output.position);\n}\n\nvoid ClipOverlayVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tin float4x4 lastInstanceTransform : BLENDWEIGHT4,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout OverlayPSInput overlay,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderOverlayVS(input, vs, output, tex, normalMap, lastInstanceTransform, overlay, motionBlur);\n\tclipData = GetClipData(output.position);\n}\n\n// Shadow vertex shader\nvoid ShadowVS (\tin float4 in_Position\t\t\t: POSITION0,\n\t\t\t\tin float3 in_Normal\t\t\t\t: NORMAL0,\n\t\t\t\tin float4x4 instanceTransform\t: BLENDWEIGHT0,\n\t\t\t\tout ShadowVSOutput vs,\n\t\t\t\tout ShadowPSInput output)\n{\n\t// Calculate shadow-space position\n\tfloat4x4 world = mul(WorldMatrix, transpose(instanceTransform));\n\tfloat4 worldPosition = mul(in_Position, world);\n\toutput.worldPosition = worldPosition.xyz;\n\tvs.position = mul(worldPosition, ViewProjectionMatrix);\n\toutput.clipSpacePosition = vs.position;\n}\n\nvoid ShadowAlphaVS(\tin float4 in_Position\t\t\t: POSITION0,\n\t\t\t\tin float3 in_Normal\t\t\t\t: NORMAL0,\n\t\t\t\tin float4x4 instanceTransform\t: BLENDWEIGHT0,\n\t\t\t\tout ShadowVSOutput vs,\n\t\t\t\tout ShadowPSInput output,\n\t\t\t\tout TexturePSInput tex)\n{\n\tShadowVS(in_Position, in_Normal, instanceTransform, vs, output);\n\ttex.uvCoordinates = CalculateUVs(in_Position, in_Normal);\n}\n\n// Regular techniques\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique ShadowShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique ShadowOverlay\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique ShadowOverlayShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapPlainPS();\n\t}\n}\n\ntechnique RenderShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapPlainPS();\n\t}\n}\n\ntechnique RenderOverlay\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderOverlayVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapPlainOverlayPS();\n\t}\n}\n\ntechnique RenderOverlayShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderOverlayVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapPlainOverlayPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainPS();\n\t}\n}\n\ntechnique ClipShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainPS();\n\t}\n}\n\ntechnique ClipOverlay\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipOverlayVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainOverlayPS();\n\t}\n}\n\ntechnique ClipOverlayShadowMask\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipOverlayVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainOverlayPS();\n\t}\n}\n\n// Alpha techniques\n\ntechnique ShadowAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowAlphaVS();\n\t\tPixelShader = compile ps_3_0 ShadowAlphaPS();\n\t}\n}\n\ntechnique ShadowOverlayAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowAlphaVS();\n\t\tPixelShader = compile ps_3_0 ShadowAlphaPS();\n\t}\n}\n\ntechnique RenderAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapClipAlphaPS();\n\t}\n}\n\ntechnique RenderOverlayAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderOverlayVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapClipOverlayAlphaPS();\n\t}\n}\n\ntechnique ClipAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapClipAlphaPS();\n\t}\n}\n\ntechnique ClipOverlayAlpha\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipOverlayVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapClipOverlayAlphaPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/EnvironmentCommon.fxh",
    "content": "#include \"RenderCommon.fxh\"\n\nfloat2x2 UVScaleRotation;\nfloat2 UVOffset;\nfloat OverlayTiling;\n\nfloat2 CalculateUVs(float3 pos, float3 normal)\n{\n\tfloat diff = length(pos * normal) * 2;\n\tfloat2 uv = float2(diff + pos.x + (pos.z * normal.x), diff - pos.y + (pos.z * normal.y));\n\treturn mul(uv, UVScaleRotation) + UVOffset;\n}\n\nvoid CalculateOverlayUVs(float3 pos, float3 normal, out TexturePSInput tex, out OverlayPSInput overlay)\n{\n\tfloat diff = length(pos * normal) * 2;\n\tfloat2 uv = float2(diff + pos.x + (pos.z * normal.x), diff - pos.y + (pos.z * normal.y));\n\toverlay.uvCoordinates = uv * OverlayTiling + UVOffset;\n\ttex.uvCoordinates = mul(uv, UVScaleRotation) + UVOffset;\n}\n\n// Overlay pixel shaders\ntexture2D OverlayTexture;\nsampler2D OverlaySampler = sampler_state\n{\n\tTexture = <OverlayTexture>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tAddressU = WRAP;\n\tAddressV = WRAP;\n};\n\nvoid RenderTextureNormalMapPlainOverlayPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tin OverlayPSInput overlay,\n\t\t\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tRenderTextureNormalMapOverlayPS(input, tex, normalMap, output, motionBlurInput, overlay, OverlaySampler, false);\n}\n\n\nvoid ClipTextureNormalMapPlainOverlayPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tin OverlayPSInput overlay,\n\t\t\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tClipTextureNormalMapOverlayPS(input, tex, normalMap, clipData, output, motionBlurInput, overlay, OverlaySampler, false);\n}\n\nvoid RenderTextureNormalMapClipOverlayAlphaPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tin OverlayPSInput overlay,\n\t\t\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tRenderTextureNormalMapOverlayPS(input, tex, normalMap, output, motionBlurInput, overlay, OverlaySampler, true);\n}\n\nvoid ClipTextureNormalMapClipOverlayAlphaPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tin OverlayPSInput overlay,\n\t\t\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tClipTextureNormalMapOverlayPS(input, tex, normalMap, clipData, output, motionBlurInput, overlay, OverlaySampler, true);\n}"
  },
  {
    "path": "Lemma/Content/Effects/InstancedNormalMap.fx",
    "content": "#include \"RenderCommon.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n\tfloat3 binormal : BINORMAL0;\n\tfloat3 tangent : TANGENT0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n\tfloat4x4 instanceTransform : BLENDWEIGHT0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tin float4x4 lastInstanceTransform : BLENDWEIGHT4,\n\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4x4 world = mul(WorldMatrix, transpose(input.instanceTransform));\n\tfloat4 worldPosition = mul(input.position, world);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\ttex.uvCoordinates = input.uvCoordinates;\n\n\tnormalMap.tangentToWorld[0] = normalize(mul(input.tangent, world));\n\tnormalMap.tangentToWorld[1] = normalize(mul(input.binormal, world));\n\tnormalMap.tangentToWorld[2] = normalize(mul(input.normal, world));\n\t\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(input.position, mul(transpose(lastInstanceTransform), LastFrameWorldViewProjectionMatrix));\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout NormalMapPSInput normalMap,\n\t\t\t\tin float4x4 lastInstanceTransform : BLENDWEIGHT4,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, tex, normalMap, lastInstanceTransform, motionBlur);\n\tclipData = GetClipData(output.position);\n}\n\n// Shadow vertex shader\nvoid ShadowVS (\tin float4 in_Position\t\t\t: POSITION,\n\t\t\t\tin float4x4 instanceTransform\t: BLENDWEIGHT,\n\t\t\t\tout ShadowVSOutput vs,\n\t\t\t\tout ShadowPSInput output)\n{\n\t// Calculate shadow-space position\n\tfloat4x4 world = mul(WorldMatrix, transpose(instanceTransform));\n\tfloat4 worldPosition = mul(in_Position, world);\n\toutput.worldPosition = worldPosition.xyz;\n\tvs.position = mul(worldPosition, ViewProjectionMatrix);\n\toutput.clipSpacePosition = vs.position;\n}\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMapPlainPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/InstancedSolidColor.fx",
    "content": "#include \"RenderCommon.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat4x4 instanceTransform : BLENDWEIGHT0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tin float4x4 lastInstanceTransform : BLENDWEIGHT4,\n\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4x4 world = mul(WorldMatrix, transpose(input.instanceTransform));\n\tfloat4 worldPosition = mul(input.position, world);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\t\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(input.position, mul(transpose(lastInstanceTransform), LastFrameWorldViewProjectionMatrix));\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tin float4x4 lastInstanceTransform : BLENDWEIGHT4,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, lastInstanceTransform, motionBlur);\n\tclipData = GetClipData(output.position);\n}\n\n// Shadow vertex shader\nvoid ShadowVS (\tin float4 in_Position\t\t\t: POSITION,\n\t\t\t\tin float4x4 instanceTransform\t: BLENDWEIGHT,\n\t\t\t\tout ShadowVSOutput vs,\n\t\t\t\tout ShadowPSInput output)\n{\n\t// Calculate shadow-space position\n\tfloat4x4 world = mul(WorldMatrix, transpose(instanceTransform));\n\tfloat4 worldPosition = mul(in_Position, world);\n\toutput.worldPosition = worldPosition.xyz;\n\tvs.position = mul(worldPosition, ViewProjectionMatrix);\n\toutput.clipSpacePosition = vs.position;\n}\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderSolidColorPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipSolidColorPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/Lines.fx",
    "content": "#include \"RenderCommonAlpha.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat4 color : COLOR0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout VertexColorPSInput color,\n\t\t\t\tout AlphaPSInput alpha)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = input.position;\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\talpha.clipSpacePosition = vs.position;\n\tcolor.color = input.color;\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout VertexColorPSInput color,\n\t\t\t\tout AlphaPSInput alpha,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, color, alpha);\n\tclipData = GetClipData(output.position);\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderVertexColorAlphaPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipVertexColorAlphaPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/Lines2D.fx",
    "content": "#include \"Common.fxh\"\n\nfloat4x4 Transform;\nfloat4 Color = float4(1, 1, 1, 1);\n\nstruct VSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat4 color : COLOR0;\n};\n\nstruct PSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat4 color: TEXCOORD0;\n};\n\nvoid RenderVS(\tin VSInput input,\n\t\t\t\tout PSInput output)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(input.position, Transform);\n\toutput.position = worldPosition;\n\toutput.color = input.color * Color;\n}\n\nvoid RenderPS (in PSInput input, out float4 color : COLOR0)\n{\n\tcolor = input.color;\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/Oculus.fx",
    "content": "float2 EyeToSourceUVScale, EyeToSourceUVOffset;\n\nfloat4x4 EyeRotationStart, EyeRotationEnd;\n\nfloat2 TimewarpTexCoord(float2 TexCoord, float4x4 rotMat)\n{\n\t// Vertex inputs are in TanEyeAngle space for the R,G,B channels (i.e. after chromatic\n\t// aberration and distortion). These are now \"real world\" vectors in direction (x,y,1)\n\t// relative to the eye of the HMD. Apply the 3x3 timewarp rotation to these vectors.\n\tfloat3 transformed = float3( mul ( rotMat, float4(TexCoord.xy, 1, 1) ).xyz);\n\t// Project them back onto the Z=1 plane of the rendered images.\n\tfloat2 flattened = (transformed.xy / transformed.z);\n\t// Scale them into ([0,0.5],[0,1]) or ([0.5,0],[0,1]) UV lookup space (depending on eye)\n\treturn(EyeToSourceUVScale * flattened + EyeToSourceUVOffset);\n}\n\nvoid OculusVS\n(\n\tin float2 Position : POSITION,\n\tin float timewarpLerpFactor : POSITION1,\n\tin float Vignette : POSITION2,\n\tin float2 TexCoord0 : TEXCOORD0,\n\tin float2 TexCoord1 : TEXCOORD1,\n\tin float2 TexCoord2 : TEXCOORD2,\n\tout float4 oPosition : POSITION,\n\tout float2 oTexCoord0 : TEXCOORD0,\n\tout float2 oTexCoord1 : TEXCOORD1,\n\tout float2 oTexCoord2 : TEXCOORD2,\n\tout float oVignette : TEXCOORD3\n)\n{\n\tfloat4x4 lerpedEyeRot = lerp(EyeRotationStart, EyeRotationEnd, timewarpLerpFactor);\n\toTexCoord0 = TimewarpTexCoord(TexCoord0, lerpedEyeRot);\n\toTexCoord1 = TimewarpTexCoord(TexCoord1, lerpedEyeRot);\n\toTexCoord2 = TimewarpTexCoord(TexCoord2, lerpedEyeRot);\n\toPosition = float4(Position.xy, 0.5, 1.0);\n\toVignette = Vignette; /* For vignette fade */\n}\n\ntexture2D FrameBufferTexture;\nsampler2D FrameBufferSampler = sampler_state\n{\n\tTexture = <FrameBufferTexture>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nfloat4 OculusPS\n(\n\tin float4 oPosition : SV_Position,\n\tin float2 oTexCoord0 : TEXCOORD0,\n\tin float2 oTexCoord1 : TEXCOORD1,\n\tin float2 oTexCoord2 : TEXCOORD2,\n\tin float oVignette : TEXCOORD3\n) : COLOR0\n{\n\t// 3 samples for fixing chromatic aberrations\n\tfloat R = tex2D(FrameBufferSampler, oTexCoord0.xy).r;\n\tfloat G = tex2D(FrameBufferSampler, oTexCoord1.xy).g;\n\tfloat B = tex2D(FrameBufferSampler, oTexCoord2.xy).b;\n\treturn oVignette * float4(R, G, B, 1);\n}\n\ntechnique Oculus\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 OculusVS();\n\t\tPixelShader = compile ps_3_0 OculusPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/Particle.fx",
    "content": "#include \"ParticleCommon.fxh\"\n\n// Depth texture sampler\ntexture2D DepthTexture;\nsampler2D DepthSampler = sampler_state\n{\n\tTexture = <DepthTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\n// Pixel shader for drawing particles.\nfloat4 ParticlePS(VertexShaderOutput input) : COLOR0\n{\n\t// Convert from clip space to UV coordinate space\n\tfloat2 uv = 0.5f * input.ClipSpacePosition.xy / input.ClipSpacePosition.w + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\n\tclip(tex2D(DepthSampler, uv).r - length(input.ViewSpacePosition));\n\n\treturn tex2D(Sampler, input.TextureCoordinate) * input.Color;\n}\n\nfloat4 ClipParticlePS(VertexShaderOutput input, ClipPSInput clipData) : COLOR0\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\treturn ParticlePS(input);\n}\n\n// Effect technique for drawing particles with additive blending.\ntechnique RenderAdditiveParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = One;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}\n\n// Effect technique for drawing particles with alpha blending.\ntechnique RenderAlphaParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}\n\n// Effect technique for drawing particles with additive blending.\ntechnique ClipAdditiveParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ClipParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ClipParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = One;\n\t\tDestBlend = One;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}\n\n// Effect technique for drawing particles with alpha blending.\ntechnique ClipAlphaParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ClipParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ClipParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/ParticleCommon.fxh",
    "content": "#include \"Common.fxh\"\n#include \"ClipCommon.fxh\"\n\n// Camera parameters.\nfloat4x4 View;\nfloat4x4 InverseView;\nfloat4x4 Projection;\nfloat2 ViewportScale;\n\n// The current time, in seconds.\nfloat CurrentTime;\n\n// Parameters describing how the particles animate.\nfloat DurationRandomness;\nfloat3 Gravity;\nfloat EndVelocity;\nfloat4 MinColor;\nfloat4 MaxColor;\n\n// These float2 parameters describe the min and max of a range.\n// The actual value is chosen differently for each particle,\n// interpolating between x and y by some random amount.\nfloat2 RotateSpeed;\nfloat2 EndSize;\n\n// Particle texture and sampler.\ntexture2D Texture;\n\nsampler2D Sampler = sampler_state\n{\n\tTexture = (Texture);\n\t\n\tMinFilter = Linear;\n\tMagFilter = Linear;\n\tMipFilter = Point;\n\t\n\tAddressU = Clamp;\n\tAddressV = Clamp;\n};\n\n// Vertex shader input structure describes the start position and\n// velocity of the particle, and the time at which it was created,\n// along with some random values that affect its size and rotation.\nstruct VertexShaderInput\n{\n\tfloat2 Corner : POSITION0;\n\tfloat3 Position : POSITION1;\n\tfloat3 Velocity : NORMAL0;\n\tfloat4 Random : COLOR0;\n\tfloat Time : TEXCOORD0;\n\tfloat Lifetime : TEXCOORD1;\n\tfloat StartSize : TEXCOORD2;\n};\n\n// Vertex shader output structure specifies the position and color of the particle.\nstruct VertexShaderOutput\n{\n\tfloat4 Position : POSITION0;\n\tfloat4 Color : COLOR0;\n\tfloat2 TextureCoordinate : COLOR1;\n\tfloat4 ViewSpacePosition : TEXCOORD0;\n\tfloat4 ClipSpacePosition : TEXCOORD1;\n\tfloat3 WorldSpacePosition : TEXCOORD2;\n};\n\n// Vertex shader helper for computing the position of a particle.\nfloat3 ComputeParticlePosition(float3 position, float3 velocity, float age, float normalizedAge, float lifetime)\n{\n\tfloat startVelocity = length(velocity);\n\n\t// Work out how fast the particle should be moving at the end of its life,\n\t// by applying a constant scaling factor to its starting velocity.\n\tfloat endVelocity = startVelocity * EndVelocity;\n\t\n\t// Our particles have constant acceleration, so given a starting velocity\n\t// S and ending velocity E, at time T their velocity should be S + (E-S)*T.\n\t// The particle position is the sum of this velocity over the range 0 to T.\n\t// To compute the position directly, we must integrate the velocity\n\t// equation. Integrating S + (E-S)*T for T produces S*T + (E-S)*T*T/2.\n\n\tfloat velocityIntegral = startVelocity * normalizedAge +\n\t\t\t\t\t\t\t (endVelocity - startVelocity) * normalizedAge *\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t normalizedAge / 2;\n\t \n\tposition += normalize(velocity) * velocityIntegral * lifetime;\n\t\n\t// Apply the gravitational force.\n\tposition += Gravity * age * normalizedAge;\n\t\n\t// Apply the camera view and projection transforms.\n\treturn position;\n}\n\n// Vertex shader helper for computing the size of a particle.\nfloat ComputeParticleSize(float startSize, float randomValue, float normalizedAge)\n{\n\t// Apply a random factor to make each particle a slightly different size.\n\tfloat endSize = lerp(EndSize.x, EndSize.y, randomValue);\n\t\n\t// Compute the actual size based on the age of the particle.\n\tfloat size = lerp(startSize, endSize, normalizedAge);\n\t\n\t// Project the size into screen coordinates.\n\treturn size * Projection._m11;\n}\n\n// Vertex shader helper for computing the color of a particle.\nfloat4 ComputeParticleColor(float4 projectedPosition,\n\t\t\t\t\t\t\tfloat randomValue, float normalizedAge, uniform bool fade)\n{\n\t// Apply a random factor to make each particle a slightly different color.\n\tfloat4 color = lerp(MinColor, MaxColor, randomValue);\n\t\n\tif (fade)\n\t\tcolor.a *= normalizedAge < 0.1f ? normalizedAge / 0.1f : 1.0f - ((normalizedAge - 0.1f) * (1.0f / 0.9f));\n\telse\n\t\tcolor.a = normalizedAge < 1.0f;\n   \n\treturn color;\n}\n\n// Vertex shader helper for computing the rotation of a particle.\nfloat2x2 ComputeParticleRotation(float randomValue, float age)\n{    \n\t// Apply a random factor to make each particle rotate at a different speed.\n\tfloat rotateSpeed = lerp(RotateSpeed.x, RotateSpeed.y, randomValue);\n\t\n\tfloat rotation = randomValue * 3.1415 * 2.0 + (rotateSpeed * age);\n\n\t// Compute a 2x2 rotation matrix.\n\tfloat c = cos(rotation);\n\tfloat s = sin(rotation);\n\t\n\treturn float2x2(c, -s, s, c);\n}\n\n// Custom vertex shader animates particles entirely on the GPU.\nvoid ParticleVS(in VertexShaderInput input, out VertexShaderOutput output, uniform bool fade)\n{\t\n\t// Compute the age of the particle.\n\tfloat age = CurrentTime - input.Time;\n\t\n\t// Apply a random factor to make different particles age at different rates.\n\tage *= 1 + input.Random.x * DurationRandomness;\n\t\n\t// Normalize the age into the range zero to one.\n\tfloat normalizedAge = saturate(age / input.Lifetime);\n\n\t// Compute the particle position, size, color, and rotation.\n\tfloat3 worldPosition = ComputeParticlePosition(input.Position, input.Velocity, age, normalizedAge, input.Lifetime);\n\toutput.WorldSpacePosition = worldPosition;\n\tfloat4 viewSpacePosition = mul(float4(worldPosition, 1), View);\n\toutput.ViewSpacePosition = viewSpacePosition;\n\tfloat4 pos = mul(viewSpacePosition, Projection);\n\n\tfloat size = ComputeParticleSize(input.StartSize, input.Random.y, normalizedAge);\n\tfloat2x2 rotation = ComputeParticleRotation(input.Random.w, age);\n\n\tpos.xy += mul(input.Corner, rotation) * size * ViewportScale;\n\t\n\toutput.Color = ComputeParticleColor(output.Position, input.Random.z, normalizedAge, fade);\n\toutput.TextureCoordinate = (input.Corner + 1) / 2;\n\toutput.Position = output.ClipSpacePosition = pos;\n}\n\nvoid ClipParticleVS(in VertexShaderInput input, out VertexShaderOutput output, out ClipPSInput clipData, uniform bool fade)\n{\n\tParticleVS(input, output, fade);\n\tclipData = GetClipData(float4(output.WorldSpacePosition, 1));\n}"
  },
  {
    "path": "Lemma/Content/Effects/ParticleFrameBufferDistortion.fx",
    "content": "#include \"ParticleCommon.fxh\"\n\n// Depth texture sampler\ntexture2D DepthTexture;\nsampler2D DepthSampler = sampler_state\n{\n\tTexture = <DepthTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\n// Frame buffer sampler\ntexture2D FrameTexture;\nsampler2D FrameSampler = sampler_state\n{\n\tTexture = <FrameTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\n// Pixel shader for drawing particles.\nfloat4 ParticlePS(VertexShaderOutput input) : COLOR0\n{\n\t// Convert from clip space to UV coordinate space\n\tfloat2 uv = 0.5f * input.ClipSpacePosition.xy / input.ClipSpacePosition.w + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\n\tclip(tex2D(DepthSampler, uv).r - length(input.ViewSpacePosition));\n\n\tfloat4 t = tex2D(Sampler, input.TextureCoordinate);\n\tclip(t.a - 0.1f);\n\t\n\tfloat alpha = t.a * input.Color.a;\n\tfloat2 distortion = ((t.xy * 2.0f) - 1.0f) * alpha * 0.12f;\n\n\tfloat4 color = tex2D(FrameSampler, uv + distortion) * input.Color;\n\treturn float4(color.rgb, alpha);\n}\n\nfloat4 ClipParticlePS(VertexShaderOutput input, ClipPSInput clipData) : COLOR0\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\treturn ParticlePS(input);\n}\n\n// Effect technique for drawing particles with additive blending.\ntechnique RenderAdditiveParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = One;\n\t\tDestBlend = One;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}\n\n// Effect technique for drawing particles with alpha blending.\ntechnique RenderAlphaParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}\n\n// Effect technique for drawing particles with additive blending.\ntechnique ClipAdditiveParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ClipParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ClipParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = One;\n\t\tDestBlend = One;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}\n\n// Effect technique for drawing particles with alpha blending.\ntechnique ClipAlphaParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ClipParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ClipParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/ParticleOpaqueCommon.fxh",
    "content": "#include \"ParticleCommon.fxh\"\n\nint MaterialID;\n\n// Custom vertex shader animates particles entirely on the GPU.\nvoid OpaqueVS(in VertexShaderInput input, out VertexShaderOutput output, uniform bool vertical, uniform float thickness)\n{\t\n\t// Compute the age of the particle.\n\tfloat age = CurrentTime - input.Time;\n\t\n\t// Apply a random factor to make different particles age at different rates.\n\tage *= 1 + input.Random.x * DurationRandomness;\n\t\n\t// Normalize the age into the range zero to one.\n\tfloat normalizedAge = saturate(age / input.Lifetime);\n\n\t// Compute the particle position, size, color, and rotation.\n\tfloat3 worldPosition = ComputeParticlePosition(input.Position, input.Velocity, age, normalizedAge, input.Lifetime);\n\n\tif (vertical)\n\t{\n\t\tworldPosition -= input.Corner.x * thickness * InverseView._m00_m01_m02;\n\t\tworldPosition.y += input.Corner.y;\n\t}\n\n\toutput.WorldSpacePosition = worldPosition;\n\tfloat4 viewSpacePosition = mul(float4(worldPosition, 1), View);\n\toutput.ViewSpacePosition = viewSpacePosition;\n\tfloat4 pos = mul(viewSpacePosition, Projection);\n\n\tif (!vertical)\n\t{\n\t\tfloat size = ComputeParticleSize(input.StartSize, input.Random.y, normalizedAge);\n\t\tfloat2x2 rotation = ComputeParticleRotation(input.Random.w, age);\n\t\tpos.xy += mul(input.Corner, rotation) * size * ViewportScale;\n\t}\n\t\n\toutput.Color = ComputeParticleColor(output.Position, input.Random.z, normalizedAge, false);\n\toutput.TextureCoordinate = (input.Corner + 1) / 2;\n\toutput.Position = output.ClipSpacePosition = pos;\n}\n\nvoid ClipOpaqueVS(in VertexShaderInput input, out VertexShaderOutput output, out ClipPSInput clipData, uniform bool vertical, uniform float thickness)\n{\n\tOpaqueVS(input, output, vertical, thickness);\n\tclipData = GetClipData(float4(output.WorldSpacePosition, 1));\n}\n\nvoid OpaquePS(VertexShaderOutput input, out RenderPSOutput output)\n{\n\tclip(input.Color.a - 0.01f);\n\tfloat4 color = tex2D(Sampler, input.TextureCoordinate) * float4(input.Color.xyz, 1.0f);\n\tclip(color.a - 0.5f);\n\t\n\toutput.color.rgb = color.rgb;\n\toutput.color.a = EncodeMaterial(MaterialID);\n\toutput.depth.x = length(input.ViewSpacePosition);\n\toutput.normal.xy = EncodeNormal(float2(0, 0));\n\toutput.depth.y = 0.0f;\n\toutput.depth.zw = (float2)0;\n\toutput.normal.zw = EncodeVelocity(float2(0, 0), float2(0, 0));\n}\n\nvoid ClipOpaquePS(VertexShaderOutput input, ClipPSInput clipData, out RenderPSOutput output)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tOpaquePS(input, output);\n}"
  },
  {
    "path": "Lemma/Content/Effects/ParticleRain.fx",
    "content": "#include \"ParticleOpaqueCommon.fxh\"\n\ntechnique RenderOpaqueParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 OpaqueVS(true, 0.01f);\n\t\tPixelShader = compile ps_3_0 OpaquePS();\n\t\tAlphaBlendEnable = false;\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/ParticleSnow.fx",
    "content": "#include \"ParticleOpaqueCommon.fxh\"\n\ntechnique RenderOpaqueParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 OpaqueVS(false, 1.0f);\n\t\tPixelShader = compile ps_3_0 OpaquePS();\n\t\tAlphaBlendEnable = false;\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t}\n}\n\ntechnique ClipOpaqueParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ClipOpaqueVS(false, 1.0f);\n\t\tPixelShader = compile ps_3_0 ClipOpaquePS();\n\t\tAlphaBlendEnable = false;\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/ParticleVolume.fx",
    "content": "#include \"ParticleCommon.fxh\"\n\n// Depth texture sampler\ntexture2D DepthTexture;\nsampler2D DepthSampler = sampler_state\n{\n\tTexture = <DepthTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\n// Pixel shader for drawing particles.\nfloat4 ParticlePS(VertexShaderOutput input) : COLOR0\n{\n\t// Convert from clip space to UV coordinate space\n\tfloat2 uv = 0.5f * input.ClipSpacePosition.xy / input.ClipSpacePosition.w + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\n\tfloat depth = length(input.ViewSpacePosition);\n\tfloat depthDiff = tex2D(DepthSampler, uv).r - depth;\n\tclip(depthDiff);\n\n\tfloat4 color = tex2D(Sampler, input.TextureCoordinate) * input.Color;\n\tcolor.a *= min(1, depth * 0.05f) * min(1, depthDiff * 0.2f);\n\treturn color;\n}\n\nfloat4 ClipParticlePS(VertexShaderOutput input, ClipPSInput clipData) : COLOR0\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\treturn ParticlePS(input);\n}\n\n// Effect technique for drawing particles with additive blending.\ntechnique RenderAdditiveParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = One;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}\n\n// Effect technique for drawing particles with alpha blending.\ntechnique RenderAlphaParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}\n\n// Effect technique for drawing particles with additive blending.\ntechnique ClipAdditiveParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ClipParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ClipParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = One;\n\t\tDestBlend = One;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}\n\n// Effect technique for drawing particles with alpha blending.\ntechnique ClipAlphaParticles\n{\n\tpass P0\n\t{\n\t\tVertexShader = compile vs_3_0 ClipParticleVS(true);\n\t\tPixelShader = compile ps_3_0 ClipParticlePS();\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/Player.fx",
    "content": "#include \"AnimationNormalMapCommon.fxh\"\n\ntechnique Shadow\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 ShadowVS();\n\t\tPixelShader = compile ps_3_0 ShadowPS();\n\t}\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureNormalMap3MaterialsPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureNormalMapPlainPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/Bloom.fx",
    "content": "#include \"EffectCommon.fxh\"\n#include \"BloomCommon.fxh\"\n\n// Samplers\nfloat2 SourceDimensions0;\ntexture2D SourceTexture0;\nsampler2D SourceSampler0 = sampler_state\n{\n\tTexture = <SourceTexture0>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nfloat2 SourceDimensions1;\ntexture2D SourceTexture1;\nsampler2D SourceSampler1 = sampler_state\n{\n\tTexture = <SourceTexture1>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nfloat3 Tint = float3(1, 1, 1);\n\nfloat Gamma = 1.0f;\nfloat Brightness = 0.0f;\n\ntexture1D RampTexture;\nsampler1D RampSampler = sampler_state\n{\n\tTexture = <RampTexture>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nfloat3 toneMap(float3 color)\n{\n\tcolor.x = tex1D(RampSampler, color.x).x;\n\tcolor.y = tex1D(RampSampler, color.y).y;\n\tcolor.z = tex1D(RampSampler, color.z).z;\n\treturn Brightness + color * Tint;\n}\n\nconst float GaussianKernel[16] = { 0.003829872f, 0.0088129551f, 0.0181463396f, 0.03343381f, 0.0551230286f, 0.0813255467f, 0.1073650667f, 0.1268369298f, 0.1340827751f, 0.1268369298f, 0.1073650667f, 0.0813255467f, 0.0551230286f, 0.03343381f, 0.0181463396f, 0.0088129551 };\n\nvoid DownsamplePS(in PostProcessPSInput input, out float4 output : COLOR0)\n{\n\tfloat2 pixelSize = 1.0f / SourceDimensions0;\n\n\tfloat2 pos = floor(input.texCoord * SourceDimensions0) * pixelSize;\n\n\tfloat3 bl = tex2D(SourceSampler0, pos + float2(0, 0)).rgb;\n\tfloat3 br = tex2D(SourceSampler0, pos + float2(pixelSize.x, 0)).rgb;\n\tfloat3 tl = tex2D(SourceSampler0, pos + float2(0, pixelSize.y)).rgb;\n\tfloat3 tr = tex2D(SourceSampler0, pos + pixelSize).rgb;\n\n\toutput = float4(toneMap(max(max(bl, br), max(tl, tr))) - BloomThreshold, 1);\n}\n\nvoid BlurHorizontalPS(\tin PostProcessPSInput input,\n\t\t\t\t\t\tout float4 out_Color\t\t: COLOR0)\n{\n\tfloat xInterval = 1.0f / SourceDimensions0.x;\n\n\tfloat3 sum = 0;\n\t[unroll]\n\tfor (int x = -8; x < 8; x++)\n\t\tsum += tex2D(SourceSampler0, float2(input.texCoord.x + (x * xInterval), input.texCoord.y)).rgb * GaussianKernel[x + 8];\n\t\n\t// Return the average color of all the samples\n\tout_Color.rgb = sum;\n\tout_Color.a = 1.0f;\n}\n\nvoid BlurVerticalPS(\tin PostProcessPSInput input,\n\t\t\t\t\t\tout float4 out_Color\t\t: COLOR0)\n{\n\tfloat yInterval = 1.0f / SourceDimensions0.y;\n\n\tfloat3 sum = 0;\n\t[unroll]\n\tfor (int y = -8; y < 8; y++)\n\t\tsum += tex2D(SourceSampler0, float2(input.texCoord.x, input.texCoord.y + (y * yInterval))).rgb * GaussianKernel[y + 8];\n\t\n\t// Return the average color of all the samples\n\tout_Color.rgb = sum;\n\tout_Color.a = 1.0f;\n}\n\nvoid CompositePS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 out_Color\t\t: COLOR0)\n{\n\tout_Color.rgb = (toneMap(tex2D(SourceSampler0, input.texCoord).rgb) + tex2D(SourceSampler1, input.texCoord).rgb / (1.0f - BloomThreshold)) * Gamma;\n\tout_Color.a = 1.0f;\n}\n\nvoid ToneMapPS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 out_Color\t\t: COLOR0)\n{\n\tout_Color.rgb = toneMap(tex2D(SourceSampler0, input.texCoord).rgb) * Gamma;\n\tout_Color.a = 1.0f;\n}\n\ntechnique Downsample\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 DownsamplePS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique BlurHorizontal\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 BlurHorizontalPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique BlurVertical\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 BlurVerticalPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique Composite\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 CompositePS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique ToneMapOnly\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 ToneMapPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/BloomCommon.fxh",
    "content": "const float3 BloomThreshold = (float3)0.9f;"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/Blur.fx",
    "content": "#include \"EffectCommon.fxh\"\n#include \"EffectSamplers.fxh\"\n\nconst float GaussianKernel[16] = { 0.003829872f, 0.0088129551f, 0.0181463396f, 0.03343381f, 0.0551230286f, 0.0813255467f, 0.1073650667f, 0.1268369298f, 0.1340827751f, 0.1268369298f, 0.1073650667f, 0.0813255467f, 0.0551230286f, 0.03343381f, 0.0181463396f, 0.0088129551 };\n\nfloat BlurAmount = 1.5f;\n\nvoid BlurHorizontalPS(\tin PostProcessPSInput input,\n\t\t\t\t\t\tout float4 out_Color\t\t: COLOR0)\n{\n\tfloat xInterval = (1.0f / SourceDimensions0.x) * BlurAmount;\n\n\tfloat3 sum = 0;\n\t[unroll]\n\tfor (int x = -8; x < 8; x++)\n\t\tsum += tex2D(SourceSampler0, float2(input.texCoord.x + (x * xInterval), input.texCoord.y)).xyz * GaussianKernel[x + 8];\n\t\n\t// Return the average color of all the samples\n\tout_Color.xyz = sum;\n\tout_Color.w = 1.0f;\n}\n\nvoid CompositePS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 out_Color\t\t: COLOR0)\n{\n\tfloat yInterval = (1.0f / SourceDimensions0.y) * BlurAmount;\n\n\tfloat3 sum = 0;\n\t[unroll]\n\tfor (int y = -8; y < 8; y++)\n\t\tsum += tex2D(SourceSampler0, float2(input.texCoord.x, input.texCoord.y + (y * yInterval))).xyz * GaussianKernel[y + 8];\n\t\n\tout_Color.xyz = sum;\n\tout_Color.w = 1.0f;\n}\n\ntechnique BlurHorizontal\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 BlurHorizontalPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique Composite\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 CompositePS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/Clear.fx",
    "content": "#include \"EffectCommon.fxh\"\nfloat4x4 LastFrameViewProjectionMatrixRotationOnly;\nfloat4x4 InverseViewMatrixRotationOnly;\n\nfloat3 BackgroundColor;\n\nstruct ClearPSInput\n{\n\tfloat2 velocity : TEXCOORD3;\n\tfloat3 normal : TEXCOORD4;\n};\n\nvoid ClearVS (\tin float3 position : POSITION,\n\t\t\t\t\t\tin float3 texCoord : TEXCOORD0,\n\t\t\t\t\t\tout float4 outputPosition : POSITION,\n\t\t\t\t\t\tout PostProcessPSInput output,\n\t\t\t\t\t\tout ClearPSInput clear)\n{\n\t// Offset the position by half a pixel to correctly align texels to pixels\n\toutputPosition.x = position.x - (0.5f / DestinationDimensions.x);\n\toutputPosition.y = position.y + (0.5f / DestinationDimensions.y);\n\toutputPosition.z = position.z;\n\toutputPosition.w = 1.0f;\n\t\n\t// Pass along the texture coordinate and the world-space view ray\n\toutput.texCoord = texCoord.xy;\n\tfloat4 v = mul(outputPosition, InverseViewProjectionMatrix);\n\toutput.viewRay = v.xyz / v.w;\n\n\toutput.viewSpacePosition = mul(outputPosition, InverseProjectionMatrix);\n\n\tfloat4 currentPos = outputPosition;\n\n\tfloat4 worldRay = mul(float4(output.viewSpacePosition, 1), InverseViewMatrixRotationOnly);\n\tfloat4 previousPos = mul(worldRay, LastFrameViewProjectionMatrixRotationOnly);\n\n\tclear.velocity = (currentPos.xy / currentPos.w) - (previousPos.xy / previousPos.w);\n\tclear.velocity.y *= -1.0f;\n\n\tclear.normal = -worldRay.xyz;\n}\n\nvoid ClearPS(\n\tin PostProcessPSInput input,\n\tin ClearPSInput clear,\n\tout RenderPSOutput output\n\t)\n{\n\tfloat3 normal = normalize(clear.normal);\n\toutput.color = float4(BackgroundColor, 0.0f);\n\toutput.depth = float4(FarPlaneDistance, normal.z, 0.0f, 0.0f);\n\toutput.normal.xy = EncodeNormal(normal.xy);\n\toutput.normal.zw = EncodeVelocity(clear.velocity, DestinationDimensions);\n}\n\ntechnique Clear\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 ClearVS();\n\t\tPixelShader = compile ps_3_0 ClearPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/Composite.fx",
    "content": "#include \"EffectCommon.fxh\"\n\nfloat3 AmbientLightColor;\n\nfloat2 SourceDimensions0;\ntexture2D SourceTexture0;\nsampler2D SourceSampler0 = sampler_state\n{\n\tTexture = <SourceTexture0>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nfloat2 SourceDimensions1;\ntexture2D SourceTexture1;\nsampler2D SourceSampler1 = sampler_state\n{\n\tTexture = <SourceTexture1>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nfloat2 SourceDimensions2;\ntexture2D SourceTexture2;\nsampler2D SourceSampler2 = sampler_state\n{\n\tTexture = <SourceTexture2>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nfloat2 SourceDimensions3;\ntexture2D SourceTexture3;\nsampler2D SourceSampler3 = sampler_state\n{\n\tTexture = <SourceTexture3>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nconst float SSAOIntensity = 0.6f;\n\nfloat2 Materials[16];\n\nfloat4 CompositePS(in PostProcessPSInput input, uniform bool ssao)\t: COLOR0\n{\n\tfloat4 color = tex2D(SourceSampler0, input.texCoord);\n\tfloat2 specularData = Materials[DecodeMaterial(color.a)];\n\tfloat3 result;\n\tif (specularData.x == 0.0f)\n\t\tresult = color.rgb;\n\telse\n\t{\n\t\tfloat4 lighting = tex2D(SourceSampler1, input.texCoord);\n\t\tfloat4 specular = tex2D(SourceSampler2, input.texCoord);\n\t\tfloat3 ambient = AmbientLightColor;\n\t\tif (ssao)\n\t\t{\n\t\t\tfloat ao = tex2D(SourceSampler3, input.texCoord).x;\n\t\t\tambient -= (1.0f - ao) * SSAOIntensity;\n\t\t}\n\t\t\n\t\tresult = color.rgb * (ambient + DecodeColor(lighting.rgb)) + DecodeColor(specular.rgb);\n\t}\n\t\n\treturn float4(result, 1.0f);\n}\n\nfloat4 CompositeSSAOPS(in PostProcessPSInput input) : COLOR0\n{\n\treturn CompositePS(input, true);\n}\n\nfloat4 CompositeNormalPS(in PostProcessPSInput input) : COLOR0\n{\n\treturn CompositePS(input, false);\n}\n\ntechnique Composite\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 CompositeNormalPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique CompositeSSAO\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 CompositeSSAOPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/Downsample.fx",
    "content": "#include \"EffectCommon.fxh\"\n#include \"EffectSamplers.fxh\"\n#include \"BloomCommon.fxh\"\n\nvoid DownsampleDepthPS(\n\tin PostProcessPSInput input,\n\tout float4 depth : COLOR0,\n\tout float4 normal : COLOR1)\n{\n\tfloat2 pixelSize = 1.0f / SourceDimensions0;\n\tfloat2 sample0 = input.texCoord;\n\tfloat2 sample1 = input.texCoord + float2(pixelSize.x, 0);\n\tfloat2 sample2 = input.texCoord + float2(0, pixelSize.y);\n\tfloat2 sample3 = input.texCoord + pixelSize;\n\tfloat2 depth0 = tex2D(SourceSampler0, sample0).xy;\n\tfloat2 depth1 = tex2D(SourceSampler0, sample1).xy;\n\tfloat2 depth2 = tex2D(SourceSampler0, sample2).xy;\n\tfloat2 depth3 = tex2D(SourceSampler0, sample3).xy;\n\tdepth = float4(max(max(depth0.x, depth1.x), max(depth2.x, depth3.x)), 0, 0, 1);\n\n\tfloat3 normal0 = float3(DecodeNormal(tex2D(SourceSampler1, sample0).xy), depth0.y);\n\tfloat3 normal1 = float3(DecodeNormal(tex2D(SourceSampler1, sample1).xy), depth1.y);\n\tfloat3 normal2 = float3(DecodeNormal(tex2D(SourceSampler1, sample2).xy), depth2.y);\n\tfloat3 normal3 = float3(DecodeNormal(tex2D(SourceSampler1, sample3).xy), depth3.y);\n\tnormal = float4(EncodeNormalBuffer(normal0 * 0.25f + normal1 * 0.25f + normal2 * 0.25f + normal3 * 0.25f), 1.0f);\n}\n\ntechnique DownsampleDepth\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 DownsampleDepthPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/EffectCommon.fxh",
    "content": "#include \"../Common.fxh\"\n\n// Transform matrices\nfloat4x4 InverseViewProjectionMatrix;\nfloat4x4 InverseProjectionMatrix;\nfloat NearPlaneDistance;\nfloat FarPlaneDistance;\n\nfloat2 DestinationDimensions;\n\nstruct PostProcessPSInput\n{\n\tfloat2 texCoord : TEXCOORD0;\n\tfloat3 viewRay : TEXCOORD1;\n\tfloat3 viewSpacePosition : TEXCOORD2;\n};\n\nvoid PostProcessVS (\tin float3 position : POSITION,\n\t\t\t\t\t\tin float3 texCoord : TEXCOORD0,\n\t\t\t\t\t\tout float4 outputPosition : POSITION,\n\t\t\t\t\t\tout PostProcessPSInput output)\n{\n\t// Offset the position by half a pixel to correctly align texels to pixels\n\toutputPosition.x = position.x - (0.5f / DestinationDimensions.x);\n\toutputPosition.y = position.y + (0.5f / DestinationDimensions.y);\n\toutputPosition.z = position.z;\n\toutputPosition.w = 1.0f;\n\t\n\t// Pass along the texture coordinate and the world-space view ray\n\toutput.texCoord = texCoord.xy;\n\tfloat4 v = mul(outputPosition, InverseViewProjectionMatrix);\n\toutput.viewRay = v.xyz / v.w;\n\n\toutput.viewSpacePosition = mul(outputPosition, InverseProjectionMatrix);\n}\n\n// Reconstruct position from a linear depth\nfloat3 PositionFromDepth(float depth, float3 viewRay)\n{\n\treturn viewRay * depth;\n}\n\n// Reconstruct position from a linear depth buffer\nfloat3 PositionFromDepthSampler(sampler2D DepthSampler, float2 texCoord, float3 viewRay)\n{\n\treturn PositionFromDepth(tex2D(DepthSampler, texCoord).x, viewRay);\n}\n\nconst float lightingEncodeRatio = 2.0f;\n\nfloat3 EncodeColor(float3 color)\n{\n\treturn color * (1.0f / lightingEncodeRatio);\n}\n\nfloat3 DecodeColor(float3 color)\n{\n\treturn color * lightingEncodeRatio;\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/EffectSamplers.fxh",
    "content": "float2 SourceDimensions0;\ntexture2D SourceTexture0;\nsampler2D SourceSampler0 = sampler_state\n{\n\tTexture = <SourceTexture0>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nfloat2 SourceDimensions1;\ntexture2D SourceTexture1;\nsampler2D SourceSampler1 = sampler_state\n{\n\tTexture = <SourceTexture1>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nfloat2 SourceDimensions2;\ntexture2D SourceTexture2;\nsampler2D SourceSampler2 = sampler_state\n{\n\tTexture = <SourceTexture2>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nfloat2 SourceDimensions3;\ntexture2D SourceTexture3;\nsampler2D SourceSampler3 = sampler_state\n{\n\tTexture = <SourceTexture3>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/Fog.fx",
    "content": "#include \"EffectCommon.fxh\"\n#include \"EffectSamplers.fxh\"\n\nfloat4 Color;\nfloat StartDistance;\nfloat EndDistance;\nfloat VerticalSize;\nfloat VerticalCenter;\n\ntexture2D DepthTexture;\nsampler2D DepthSampler = sampler_state\n{\n\tTexture = <DepthTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nvoid FogVerticalLimitPS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 color : COLOR0)\n{\n\t// Convert from clip space to UV coordinate space\n\n\tfloat3 worldPosition = PositionFromDepthSampler(DepthSampler, input.texCoord, normalize(input.viewRay));\n\n\tfloat verticalBlend = 1.0f - clamp((worldPosition.y - VerticalCenter) / VerticalSize, 0, 1);\n\n\tcolor = float4(Color.rgb, Color.a * verticalBlend);\n}\n\nvoid FogPS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 color : COLOR0)\n{\n\t// Convert from clip space to UV coordinate space\n\tfloat depth = tex2D(DepthSampler, input.texCoord).r;\n\n\tfloat blend = clamp(lerp(0, 1, (depth - StartDistance) / (EndDistance - StartDistance)), 0, 1);\n\n\tcolor = float4(Color.rgb, Color.a * blend);\n}\n\ntechnique FogVerticalLimit\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\t\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 FogVerticalLimitPS();\n\t}\n}\n\ntechnique Fog\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\t\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 FogPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/GlobalLight.fx",
    "content": "#include \"LightingCommon.fxh\"\n#include \"Shadow2D.fxh\"\n\n// Lighting parameters\nstatic const int NUM_DIRECTIONAL_LIGHTS = 3;\nfloat3 DirectionalLightDirections[NUM_DIRECTIONAL_LIGHTS];\nfloat3 DirectionalLightColors[NUM_DIRECTIONAL_LIGHTS];\n\nfloat4x4 ShadowViewProjectionMatrix;\nfloat4x4 DetailShadowViewProjectionMatrix;\n\nfloat3 EnvironmentColor = float3(1, 1, 1);\n\nfloat2 Materials[16];\n\nfloat CloudShadow;\nfloat2 CloudOffset;\nfloat3 CameraPosition;\nconst float CloudUVMultiplier = 0.003f;\n\ntextureCUBE EnvironmentTexture;\nsamplerCUBE EnvironmentSampler = sampler_state\n{\n\tTexture = <EnvironmentTexture>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tAddressU = WRAP;\n\tAddressV = WRAP;\n};\n\ntexture2D CloudTexture;\nsampler2D CloudSampler = sampler_state\n{\n\tTexture = <CloudTexture>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tMaxAnisotropy = 1;\n\tAddressU = WRAP;\n\tAddressV = WRAP;\n};\n\n// Calculate the contribution of a directional light\nLightingOutput CalcDirectionalLighting(\n\t\t\t\t\t\tfloat3 lightColor,\n\t\t\t\t\t\tfloat3 normal,\n\t\t\t\t\t\tfloat2 specularData,\n\t\t\t\t\t\tfloat3 cameraToPoint,\n\t\t\t\t\t\tfloat3 lightDir,\n\t\t\t\t\t\tfloat3 reflectedViewRay,\n\t\t\t\t\t\tbool ignoreNormal)\n{\n\tLightingOutput output;\n\tif (ignoreNormal)\n\t\toutput.lighting = lightColor;\n\telse\n\t\toutput.lighting = lightColor * saturate(dot(normal, lightDir));\n\toutput.specular = lightColor * pow(saturate(dot(reflectedViewRay, lightDir)), specularData.x) * specularData.y;\n\treturn output;\n}\n\nvoid GlobalLightPS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 lighting : COLOR0,\n\t\t\t\t\tout float4 specular : COLOR1,\n\t\t\t\t\tuniform bool shadow,\n\t\t\t\t\tuniform bool detail,\n\t\t\t\t\tuniform bool clouds)\n{\n\tfloat2 depthValue = tex2D(SourceSampler0, input.texCoord).xy;\n\tfloat4 normalValue = tex2D(SourceSampler1, input.texCoord);\n\tfloat3 normal = float3(DecodeNormal(normalValue.xy), depthValue.y);\n\n\tfloat3 viewRay = normalize(input.viewRay);\n\tfloat3 worldPos = PositionFromDepth(depthValue.x, viewRay);\n\tfloat materialParam = tex2D(SourceSampler2, input.texCoord).a;\n\tfloat2 specularData = Materials[DecodeMaterial(materialParam)];\n\n\tfloat3 reflectedViewRay = reflect(viewRay, normal);\n\n\tLightingOutput output;\n\toutput.lighting = float3(0, 0, 0);\n\toutput.specular = float3(0, 0, 0);\n\n\t// Directional lights\n\tbool ignoreNormal = dot(normal, normal) < 0.01f;\n\n\tif (shadow)\n\t{\n\t\t// Shadowed light\n\t\tLightingOutput shadowLight = CalcDirectionalLighting(DirectionalLightColors[0],\n\t\t\t\t\t\t\t\tnormal,\n\t\t\t\t\t\t\t\tspecularData,\n\t\t\t\t\t\t\t\tviewRay,\n\t\t\t\t\t\t\t\t-DirectionalLightDirections[0],\n\t\t\t\t\t\t\t\treflectedViewRay,\n\t\t\t\t\t\t\t\tignoreNormal);\n\n\t\tfloat shadowValue;\n\t\tfloat4 shadowPos = mul(float4(worldPos + normal * NormalShadowBias, 1.0f), ShadowViewProjectionMatrix);\n\t\tif (detail)\n\t\t{\n\t\t\tfloat4 detailShadowPos = mul(float4(worldPos + normal * NormalDetailShadowBias, 1.0f), DetailShadowViewProjectionMatrix);\n\t\t\tshadowValue = GetShadowValueDetail(detailShadowPos, shadowPos);\n\t\t}\n\t\telse\n\t\t\tshadowValue = GetShadowValue(shadowPos);\n\n\t\tif (clouds)\n\t\t{\n\t\t\tfloat3 worldPosWithCamera = worldPos + CameraPosition;\n\n\t\t\tfloat t = -worldPosWithCamera.y / DirectionalLightDirections[0].y;\n\t\t\tfloat2 p = worldPosWithCamera.xz + t * DirectionalLightDirections[0].xz;\n\n\t\t\tshadowValue = max(0, shadowValue - tex2D(CloudSampler, p * CloudUVMultiplier + CloudOffset).a * CloudShadow);\n\t\t}\n\n\t\toutput.lighting += shadowLight.lighting * shadowValue;\n\t\toutput.specular += shadowLight.specular * shadowValue;\n\t}\n\n\t[unroll]\n\tfor(int i = shadow ? 1 : 0; i < NUM_DIRECTIONAL_LIGHTS; i++)\n\t{\n\t\tLightingOutput light = CalcDirectionalLighting(DirectionalLightColors[i],\n\t\t\t\t\t\t\t\tnormal,\n\t\t\t\t\t\t\t\tspecularData,\n\t\t\t\t\t\t\t\tviewRay,\n\t\t\t\t\t\t\t\t-DirectionalLightDirections[i],\n\t\t\t\t\t\t\t\treflectedViewRay,\n\t\t\t\t\t\t\t\tignoreNormal);\n\t\toutput.lighting += light.lighting;\n\t\toutput.specular += light.specular;\n\t}\n\n\toutput.specular += texCUBE(EnvironmentSampler, reflectedViewRay).xyz * EnvironmentColor * specularData.y * specularData.x * (0.3f / 255.0f);\n\n\tlighting.rgb = EncodeColor(output.lighting);\n\tlighting.a = 1.0f;\n\tspecular.rgb = EncodeColor(output.specular);\n\tspecular.a = 1.0f;\n}\n\nvoid GlobalLightUnshadowedPS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 lighting : COLOR0,\n\t\t\t\t\tout float4 specular : COLOR1)\n{\n\tGlobalLightPS(input, lighting, specular, false, false, false);\n}\n\nvoid GlobalLightShadowedPS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 lighting : COLOR0,\n\t\t\t\t\tout float4 specular : COLOR1)\n{\n\tGlobalLightPS(input, lighting, specular, true, false, false);\n}\n\nvoid GlobalLightDetailShadowedPS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 lighting : COLOR0,\n\t\t\t\t\tout float4 specular : COLOR1)\n{\n\tGlobalLightPS(input, lighting, specular, true, true, false);\n}\n\nvoid GlobalLightShadowedCloudsPS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 lighting : COLOR0,\n\t\t\t\t\tout float4 specular : COLOR1)\n{\n\tGlobalLightPS(input, lighting, specular, true, false, true);\n}\n\nvoid GlobalLightDetailShadowedCloudsPS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 lighting : COLOR0,\n\t\t\t\t\tout float4 specular : COLOR1)\n{\n\tGlobalLightPS(input, lighting, specular, true, true, true);\n}\n\ntechnique GlobalLightDetailShadow\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 GlobalLightDetailShadowedPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique GlobalLightShadow\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 GlobalLightShadowedPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique GlobalLightDetailShadowClouds\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 GlobalLightDetailShadowedCloudsPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique GlobalLightShadowClouds\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 GlobalLightShadowedCloudsPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique GlobalLight\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 GlobalLightUnshadowedPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/LightingCommon.fxh",
    "content": "#include \"EffectCommon.fxh\"\n#include \"EffectSamplers.fxh\"\n\nstruct LightingOutput\n{\n\tfloat3 lighting;\n\tfloat3 specular;\n};\n"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/MotionBlur.fx",
    "content": "#include \"EffectCommon.fxh\"\n#include \"EffectSamplers.fxh\"\n\nfloat MotionBlurAmount = 1.0f;\nfloat SpeedBlurAmount = 1.0f;\n\nfloat4 SampleMotionBlur(float2 texCoord, float2 pixelVelocity)\n{\n\tconst int numSamples = 16;\n\n\t// Clamp to a max velocity.  The max we can go without artifacts os\n\t// is 1.4f * iNumSamples...but we can fudge things a little.\n\tfloat2 maxVelocity = (MotionBlurAmount * 1.4f * numSamples) / SourceDimensions0;\n\tpixelVelocity = clamp(pixelVelocity, -maxVelocity, maxVelocity);\n\n\t// For each sample, sum up each sample's color in \"vSum\" and then divide\n\t// to average the color after all the samples are added.\n\tfloat4 sum = 0;\n\t[unroll]\n\tfor (int i = (numSamples / -2) + 1; i < (numSamples / 2) + 1; i++)\n\t\tsum += tex2D(SourceSampler0, texCoord + (pixelVelocity * ((float)i  / (float)numSamples)));\n\t\n\t// Return the average color of all the samples\n\treturn sum / (float)numSamples;\n}\n\nfloat4 MotionBlurPS(in PostProcessPSInput input)\t: COLOR0\n{\n\tconst float threshold = 1.0f / 127.0f;\n\tconst float thresholdSquared = threshold * threshold;\n\t// Sample velocity from our velocity buffers\n\tfloat2 currentFramePixelVelocity = DecodeVelocity(tex2D(SourceSampler1, input.texCoord).zw, SourceDimensions1);\n\n\tfloat2 lastFramePixelVelocity = DecodeVelocity(tex2D(SourceSampler2, input.texCoord).zw, SourceDimensions2);\n\n\t// We'll compare the magnitude of the velocity from the current frame and from\n\t// the previous frame, and then use whichever is larger\n\tfloat2 pixelVelocity = 0;\n\n\tfloat currentVelocitySquared = currentFramePixelVelocity.x * currentFramePixelVelocity.x +\n\t\t\t\t\t\t   currentFramePixelVelocity.y * currentFramePixelVelocity.y;\n\n\t// Speed blurring\n\tfloat2 speedOffset = (input.texCoord + float2(-0.5f, -0.5f)) * SpeedBlurAmount * 0.08f;\n\tfloat speedOffsetSquared = speedOffset.x * speedOffset.x + speedOffset.y * speedOffset.y;\n\tif (speedOffsetSquared > thresholdSquared)\n\t{\n\t\tcurrentFramePixelVelocity = speedOffset * (1.0f - threshold / sqrt(speedOffsetSquared));\n\t\tcurrentVelocitySquared = speedOffsetSquared;\n\t}\n\n\tfloat lastVelocitySquared = lastFramePixelVelocity.x * lastFramePixelVelocity.x +\n\t\t\t\t\t\t\t  lastFramePixelVelocity.y * lastFramePixelVelocity.y;\n\n\tfloat velocitySquared;\n\tif (lastVelocitySquared > currentVelocitySquared)\n\t{\n\t\tpixelVelocity = lastFramePixelVelocity;\n\t\tvelocitySquared = lastVelocitySquared;\n\t}\n\telse\n\t{\n\t\tpixelVelocity = currentFramePixelVelocity;\n\t\tvelocitySquared = currentVelocitySquared;\n\t}\n\n\tif (velocitySquared < thresholdSquared)\n\t\treturn tex2D(SourceSampler0, input.texCoord);\n\treturn SampleMotionBlur(input.texCoord, pixelVelocity);\n}\n\ntechnique MotionBlur\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 MotionBlurPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/PointLight.fx",
    "content": "#include \"LightingCommon.fxh\"\n\nfloat4x4 WorldMatrix;\nfloat3 PointLightPosition;\nfloat PointLightRadius;\nfloat3 PointLightColor;\n\nfloat2 Materials[16];\n\n// Calculate the contribution of a point light\nLightingOutput CalcPointLighting(float3 lightColor,\n\t\t\t\t\t\tfloat lightAttenuation,\n\t\t\t\t\t\tfloat3 normal,\n\t\t\t\t\t\tfloat3 lightPos,\n\t\t\t\t\t\tfloat3 pixelPos,\n\t\t\t\t\t\tfloat3 cameraToPoint,\n\t\t\t\t\t\tfloat materialParam)\n{\n\tLightingOutput output;\n\t// Calculate the raw lighting terms\n\tfloat3 direction = lightPos - pixelPos;\n\tfloat distance = length(direction);\n\tdirection /= distance;\n\t\n\tfloat attenuation = saturate(1.0f - distance / lightAttenuation);\n\tfloat3 totalLightColor = lightColor * attenuation;\n\tfloat2 specularData = Materials[DecodeMaterial(materialParam)];\n\tif (dot(normal, normal) < 0.01f)\n\t\toutput.lighting = totalLightColor;\n\telse\n\t\toutput.lighting = totalLightColor * saturate(dot(normal, direction));\n\toutput.specular = totalLightColor * pow(saturate(dot(normal, normalize(direction - cameraToPoint))), specularData.x) * specularData.y;\n\treturn output;\n}\n\nstruct PointLightVSInput\n{\n\tfloat4 position : POSITION0;\n};\n\nstruct PointLightPSInput\n{\n\tfloat4 projectedPosition : TEXCOORD0;\n\tfloat3 worldPosition : TEXCOORD1;\n};\n\nvoid PointLightVS(\tin PointLightVSInput input,\n\t\t\t\t\tout float4 outputPosition : POSITION0,\n\t\t\t\t\tout PointLightPSInput output)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutputPosition = mul(worldPosition, ViewProjectionMatrix);\n\n\toutput.projectedPosition = outputPosition;\n\n\toutput.worldPosition = worldPosition;\n}\n\nvoid PointLightPS(\tin PointLightPSInput input,\n\t\t\t\t\tout float4 lighting : COLOR0,\n\t\t\t\t\tout float4 specular : COLOR1)\n{\n\tfloat2 texCoord = (0.5f * input.projectedPosition.xy / input.projectedPosition.w) + float2(0.5f, 0.5f);\n\ttexCoord.y = 1.0f - texCoord.y;\n\ttexCoord = (round(texCoord * DestinationDimensions) + float2(0.5f, 0.5f)) / DestinationDimensions;\n\tfloat4 normalValue = tex2D(SourceSampler1, texCoord);\n\tfloat2 depthValue = tex2D(SourceSampler0, texCoord).xy;\n\tfloat3 normal = float3(DecodeNormal(normalValue.xy), depthValue.y);\n\tfloat3 viewRay = normalize(input.worldPosition);\n\tfloat3 position = PositionFromDepth(depthValue.x, viewRay);\n\tLightingOutput data = CalcPointLighting(PointLightColor, PointLightRadius, normal, PointLightPosition, position, viewRay, tex2D(SourceSampler2, texCoord).a);\n\tlighting.rgb = EncodeColor(data.lighting);\n\tlighting.a = 1.0f;\n\tspecular.rgb = EncodeColor(data.specular);\n\tspecular.a = 1.0f;\n}\n\ntechnique PointLight\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PointLightVS();\n\t\tPixelShader = compile ps_3_0 PointLightPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = One;\n\t\tDestBlend = One;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/SSAO.fx",
    "content": "#include \"EffectCommon.fxh\"\n#include \"EffectSamplers.fxh\"\n\nconst float GaussianKernel[16] = { 0.003829872f, 0.0088129551f, 0.0181463396f, 0.03343381f, 0.0551230286f, 0.0813255467f, 0.1073650667f, 0.1268369298f, 0.1340827751f, 0.1268369298f, 0.1073650667f, 0.0813255467f, 0.0551230286f, 0.03343381f, 0.0181463396f, 0.0088129551 };\n\n// Adapted from http://jcoluna.wordpress.com/2011/10/28/xna-light-pre-pass-ambient-light-ssao-and-more/\n// Jorge Adriano Luna 2011\n// http://jcoluna.wordpress.com\n\nconst float Radius = 0.7f;\nconst float RandomTile = 50.0f;\nconst float Bias = 0.2f;\n\ntexture2D RandomTexture;\nsampler2D RandomSampler = sampler_state\n{\n\tTexture = <RandomTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = WRAP;\n\tAddressV = WRAP;\n};\n\n#define SAMPLE_COUNT 12\nfloat3 SAMPLES[SAMPLE_COUNT] =\n{\n\tfloat3( 0.5381, 0.1856,-0.4319),\n\tfloat3( 0.1379, 0.2486, 0.4430),\n\tfloat3( 0.3371, 0.5679,-0.0057),\n\tfloat3(-0.6999,-0.0451,-0.0019),\n\tfloat3( 0.0689,-0.1598,-0.8547),\n\tfloat3( 0.0560, 0.0069,-0.1843),\n\tfloat3(-0.0146, 0.1402, 0.0762),\n\tfloat3( 0.0100,-0.1924,-0.0344),\n\tfloat3(-0.3577,-0.5301,-0.4358),\n\tfloat3(-0.3169, 0.1063, 0.0158),\n\tfloat3( 0.0103,-0.5869, 0.0046),\n\tfloat3(-0.0897,-0.4940, 0.3287),\n};\n\nvoid SSAOPS(in PostProcessPSInput input, out float4 output : COLOR0)\n{\n\tfloat depth = tex2D(SourceSampler0, input.texCoord).x;\n\t\n\tfloat3 normal = mul(normalize(DecodeNormalBuffer(tex2D(SourceSampler1, input.texCoord).xyz)), (float3x3)ViewMatrix);\n\tnormal.y *= -1.0f;\n\tfloat3 normalScaled = normal * 0.5f;\n\n\tfloat3 randomNormal = DecodeNormalMap(tex2D(RandomSampler, input.texCoord * RandomTile).xyz);\n\n\tfloat ao = SAMPLE_COUNT;\n\t[unroll]\n\tfor (int i = 0; i < SAMPLE_COUNT; i++)\n\t{\n\t\tfloat3 randomDirection = reflect(SAMPLES[i], randomNormal);\n\t\t\n\t\t// Prevent it pointing inside the geometry\n\t\trandomDirection *= sign(dot(normal, randomDirection));\n\n\t\t// add that scaled normal\n\t\trandomDirection += normalScaled;\n\n\t\tfloat sampleDepth = tex2D(SourceSampler0, input.texCoord + randomDirection.xy * Radius / depth).x;\n\t\t\n\t\t// we only care about samples in front of our original-modifies \n\t\tfloat deltaDepth = saturate((depth - randomDirection.z * Radius) - sampleDepth);\n\t\t\n\t\t// ignore negative deltas\n\t\tao -= (1 - deltaDepth) * (deltaDepth > Bias);\n\t}\n \n\t// output the result\n\toutput = float4(float3(ao, ao, ao) / SAMPLE_COUNT, 1.0f);\n}\n\ntechnique SSAO\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 SSAOPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\nconst float BlurAmount = 1.0f;\nconst float BlurDiscardThreshold = 0.05f;\n\nvoid BlurHorizontalPS(\tin PostProcessPSInput input,\n\t\t\t\t\t\tout float4 out_Color\t\t: COLOR0)\n{\n\tfloat xInterval = (1.0f / SourceDimensions0.x) * BlurAmount;\n\n\tfloat depth = tex2D(SourceSampler1, input.texCoord).x;\n\n\tfloat3 sum = 0;\n\tfloat count = 0;\n\t[unroll]\n\tfor (int x = -8; x < 8; x++)\n\t{\n\t\tfloat2 tap = float2(input.texCoord.x + (x * xInterval), input.texCoord.y);\n\t\tif (abs(depth - tex2D(SourceSampler1, tap).x) < BlurDiscardThreshold * depth)\n\t\t{\n\t\t\tsum += tex2D(SourceSampler0, tap).xyz * GaussianKernel[x + 8];\n\t\t\tcount += GaussianKernel[x + 8];\n\t\t}\n\t}\n\t\n\t// Return the average color of all the samples\n\tout_Color.xyz = sum / count;\n\tout_Color.w = 1.0f;\n}\n\nvoid CompositePS(\tin PostProcessPSInput input,\n\t\t\t\t\tout float4 out_Color\t\t: COLOR0)\n{\n\tfloat yInterval = (1.0f / SourceDimensions0.y) * BlurAmount;\n\n\tfloat depth = tex2D(SourceSampler1, input.texCoord).x;\n\n\tfloat3 sum = 0;\n\tfloat count = 0;\n\t[unroll]\n\tfor (int y = -8; y < 8; y++)\n\t{\n\t\tfloat2 tap = float2(input.texCoord.x, input.texCoord.y + (y * yInterval));\n\t\tif (abs(depth - tex2D(SourceSampler1, tap).x) < BlurDiscardThreshold * depth)\n\t\t{\n\t\t\tsum += tex2D(SourceSampler0, tap).xyz * GaussianKernel[y + 8];\n\t\t\tcount += GaussianKernel[y + 8];\n\t\t}\n\t}\n\t\n\tout_Color.xyz = sum / count;\n\tout_Color.w = 1.0f;\n}\n\ntechnique BlurHorizontal\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 BlurHorizontalPS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique Composite\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 PostProcessVS();\n\t\tPixelShader = compile ps_3_0 CompositePS();\n\t\t\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/Shadow2D.fxh",
    "content": "// Shadow map\ntexture2D ShadowMapTexture;\nsampler2D ShadowMapSampler = sampler_state\n{\n\tTexture = <ShadowMapTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\nfloat ShadowMapSize;\n\ntexture2D DetailShadowMapTexture;\nsampler2D DetailShadowMapSampler = sampler_state\n{\n\tTexture = <DetailShadowMapTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tMaxAnisotropy = 1;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\nfloat DetailShadowMapSize;\n\nconst float NormalShadowBias = 0.2f;\nconst float NormalDetailShadowBias = 0.03f;\n\n// Shadow map sampling with simple filtering\nfloat GetShadowValueFromClip(float2 clipPos, float depth)\n{\n\tif (abs(clipPos.x) > 1.0f || abs(clipPos.y) > 1.0f)\n\t\treturn 1.0f;\n\n\t// UV coordinates of the uppermost, leftmost pixel\n\tfloat2 pos = floor(clipPos * ShadowMapSize) / ShadowMapSize;\n\t\n\t// Collect samples from the surrounding four shadow map pixels\n\t// These will all evaluate to 1.0 or 0.0\n\tfloat inverseShadowSize = 1 / ShadowMapSize;\n\tfloat bl = tex2D(ShadowMapSampler, pos + float2(0, 0)).r < depth; // Bottom left sample\n\tfloat br = tex2D(ShadowMapSampler, pos + float2(inverseShadowSize, 0)).r < depth; // Bottom right sample\n\tfloat tl = tex2D(ShadowMapSampler, pos + float2(0, inverseShadowSize)).r < depth; // Top left sample\n\tfloat tr = tex2D(ShadowMapSampler, pos + float2(inverseShadowSize, inverseShadowSize)).r < depth; // Top right sample\n\t\n\t// Blend between the four samples\n\tfloat horizontalBlend = (clipPos.x - pos.x) * ShadowMapSize;\n\tfloat verticalBlend = (clipPos.y - pos.y) * ShadowMapSize;\n\tfloat bottom = (bl * (1.0f - horizontalBlend)) + (br * horizontalBlend);\n\tfloat top = (tl * (1.0f - horizontalBlend)) + (tr * horizontalBlend);\n\treturn (bottom * (1.0f - verticalBlend)) + (top * verticalBlend);\n}\n\n// Shadow map sampling with simple filtering\nfloat GetShadowValueFromClipDetail(float2 clipPos, float depth)\n{\n\tif (abs(clipPos.x) > 1.0f || abs(clipPos.y) > 1.0f)\n\t\treturn 1.0f;\n\n\t// UV coordinates of the uppermost, leftmost pixel\n\tfloat2 pos = floor(clipPos * DetailShadowMapSize) / DetailShadowMapSize;\n\t\n\t// Collect samples from the surrounding four shadow map pixels\n\t// These will all evaluate to 1.0 or 0.0\n\tfloat inverseShadowSize = 1 / DetailShadowMapSize;\n\tfloat bl = tex2D(DetailShadowMapSampler, pos + float2(0, 0)).r < depth; // Bottom left sample\n\tfloat br = tex2D(DetailShadowMapSampler, pos + float2(inverseShadowSize, 0)).r < depth; // Bottom right sample\n\tfloat tl = tex2D(DetailShadowMapSampler, pos + float2(0, inverseShadowSize)).r < depth; // Top left sample\n\tfloat tr = tex2D(DetailShadowMapSampler, pos + float2(inverseShadowSize, inverseShadowSize)).r < depth; // Top right sample\n\t\n\t// Blend between the four samples\n\tfloat horizontalBlend = (clipPos.x - pos.x) * DetailShadowMapSize;\n\tfloat verticalBlend = (clipPos.y - pos.y) * DetailShadowMapSize;\n\tfloat bottom = (bl * (1.0f - horizontalBlend)) + (br * horizontalBlend);\n\tfloat top = (tl * (1.0f - horizontalBlend)) + (tr * horizontalBlend);\n\treturn (bottom * (1.0f - verticalBlend)) + (top * verticalBlend);\n}\n\nfloat GetShadowValue(float4 position)\n{\n\t// Get the shadow map depth value for this pixel\n\tfloat depth = 1.0f - (position.z / position.w);\n\n\t// Convert from clip space to UV coordinate space\n\tfloat2 ShadowTexClipPosition = (0.5f * (position.xy / position.w)) + float2(0.5f, 0.5f);\n\tShadowTexClipPosition.y = 1.0f - ShadowTexClipPosition.y;\n\n\treturn GetShadowValueFromClip(ShadowTexClipPosition, depth);\n}\n\nfloat GetShadowValueRaw(float4 position)\n{\n\t// Get the shadow map depth value for this pixel\n\tfloat depth = 1.0f - (position.z / position.w);\n\n\t// Convert from clip space to UV coordinate space\n\tfloat2 clipPos = (0.5f * (position.xy / position.w)) + float2(0.5f, 0.5f);\n\n\tclipPos.y = 1.0f - clipPos.y;\n\treturn tex2D(ShadowMapSampler, clipPos).r - depth;\n}\n\nfloat GetShadowValueDetail(float4 detailPosition, float4 position)\n{\n\tdetailPosition.xyz /= detailPosition.w;\n\n\tif (abs(detailPosition.x) < 1.0f && abs(detailPosition.y) < 1.0f)\n\t{\n\t\tfloat2 ShadowTexClipPosition = (0.5f * detailPosition.xy) + float2(0.5f, 0.5f);\n\n\t\t// Convert from clip space to UV coordinate space\n\t\tShadowTexClipPosition = (0.5f * detailPosition.xy) + float2(0.5f, 0.5f);\n\t\tShadowTexClipPosition.y = 1.0f - ShadowTexClipPosition.y;\n\n\t\tfloat depth = 1.0004f - detailPosition.z;\n\n\t\treturn GetShadowValueFromClipDetail(ShadowTexClipPosition, depth);\n\t}\n\telse\n\t{\n\t\tposition.xyz /= position.w;\n\n\t\tfloat depth = 1.0004f - position.z;\n\n\t\tfloat2 ShadowTexClipPosition = (0.5f * position.xy) + float2(0.5f, 0.5f);\n\n\t\t// Convert from clip space to UV coordinate space\n\t\tShadowTexClipPosition = (0.5f * position.xy) + float2(0.5f, 0.5f);\n\t\tShadowTexClipPosition.y = 1.0f - ShadowTexClipPosition.y;\n\n\t\treturn GetShadowValueFromClip(ShadowTexClipPosition, depth);\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/PostProcess/SpotLight.fx",
    "content": "#include \"LightingCommon.fxh\"\n#include \"Shadow2D.fxh\"\n\nfloat4x4 WorldMatrix;\nfloat3 SpotLightPosition;\nfloat3 SpotLightDirection;\nfloat SpotLightRadius;\nfloat3 SpotLightColor;\nfloat4x4 SpotLightViewProjectionMatrix;\n\nfloat2 Materials[16];\n\ntexture2D CookieTexture;\nsampler2D CookieSampler = sampler_state\n{\n\tTexture = <CookieTexture>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nconst float SpotlightNormalShadowBias = 0.01f;\n\n// Calculate the contribution of a spot light\nLightingOutput CalcSpotLighting(float3 lightColor,\n\t\t\t\t\t\tfloat lightAttenuation,\n\t\t\t\t\t\tfloat3 normal,\n\t\t\t\t\t\tfloat3 lightPos,\n\t\t\t\t\t\tfloat3 lightDirection,\n\t\t\t\t\t\tfloat3 pixelPos,\n\t\t\t\t\t\tfloat3 cameraToPoint,\n\t\t\t\t\t\tfloat materialParam,\n\t\t\t\t\t\tfloat3 cookieColor)\n{\n\tLightingOutput output = (LightingOutput)0;\n\t// Calculate the raw lighting terms\n\tfloat3 direction = lightPos - pixelPos;\n\tfloat distance = length(direction);\n\tdirection /= distance;\n\tif (dot(direction, lightDirection) < 0)\n\t\treturn output;\n\t\n\t// Modulate the lighting terms based on the material colors, and the attenuation factor\n\tfloat attenuation = saturate(1.0f - max(0.01f, distance) / lightAttenuation);\n\tfloat3 totalLightColor = lightColor * cookieColor * attenuation;\n\tfloat2 specularData = Materials[DecodeMaterial(materialParam)];\n\tif (dot(normal, normal) < 0.01f)\n\t\toutput.lighting = totalLightColor;\n\telse\n\t\toutput.lighting = totalLightColor * saturate(dot(normal, direction));\n\toutput.specular = totalLightColor * pow(saturate(dot(normal, normalize(direction - cameraToPoint))), specularData.x) * specularData.y;\n\treturn output;\n}\n\nstruct SpotLightVSInput\n{\n\tfloat4 position : POSITION0;\n};\n\nstruct SpotLightPSInput\n{\n\tfloat4 projectedPosition : TEXCOORD0;\n\tfloat4 worldPosition : TEXCOORD1;\n};\n\nvoid SpotLightVS(\tin SpotLightVSInput input,\n\t\t\t\t\tout float4 outputPosition : POSITION0,\n\t\t\t\t\tout SpotLightPSInput output)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutputPosition = mul(worldPosition, ViewProjectionMatrix);\n\n\toutput.projectedPosition = outputPosition;\n\n\toutput.worldPosition = worldPosition;\n}\n\nvoid SpotLightPS(\tin SpotLightPSInput input,\n\t\t\t\t\tout float4 lighting : COLOR0,\n\t\t\t\t\tout float4 specular : COLOR1,\n\t\t\t\t\tuniform bool shadow)\n{\n\tfloat2 texCoord = (0.5f * input.projectedPosition.xy / input.projectedPosition.w) + float2(0.5f, 0.5f);\n\ttexCoord.y = 1.0f - texCoord.y;\n\ttexCoord = (round(texCoord * DestinationDimensions) + float2(0.5f, 0.5f)) / DestinationDimensions;\n\tfloat4 normalValue = tex2D(SourceSampler1, texCoord);\n\tfloat2 depthValue = tex2D(SourceSampler0, texCoord).xy;\n\tfloat3 normal = float3(DecodeNormal(normalValue.xy), depthValue.y);\n\tfloat3 viewRay = normalize(input.worldPosition);\n\tfloat3 position = PositionFromDepth(depthValue.x, viewRay);\n\n\tfloat4 spotProjectedPosition = mul(float4(position + normal * SpotlightNormalShadowBias, 1.0f), SpotLightViewProjectionMatrix);\n\tfloat2 spotClipPosition = 0.5f * spotProjectedPosition.xy / spotProjectedPosition.w + float2(0.5f, 0.5f);\n\tspotClipPosition.y = 1.0f - spotClipPosition.y;\n\tfloat3 cookieColor = tex2D(CookieSampler, spotClipPosition).xyz;\n\t\n\tLightingOutput data = CalcSpotLighting(SpotLightColor, SpotLightRadius, normal, SpotLightPosition, SpotLightDirection, position, viewRay, tex2D(SourceSampler2, texCoord).a, cookieColor);\n\t\n\tif (shadow)\n\t{\n\t\tfloat shadowValue = GetShadowValueFromClip(spotClipPosition, 1.0f - (spotProjectedPosition.z / spotProjectedPosition.w));\n\t\tdata.lighting *= shadowValue;\n\t\tdata.specular *= shadowValue;\n\t}\n\n\tlighting.rgb = EncodeColor(data.lighting);\n\tlighting.a = 1.0f;\n\tspecular.rgb = EncodeColor(data.specular);\n\tspecular.a = 1.0f;\n}\n\ntechnique SpotLight\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 SpotLightVS();\n\t\tPixelShader = compile ps_3_0 SpotLightPS(false);\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = One;\n\t\tDestBlend = One;\n\t}\n}\n\ntechnique SpotLightShadowed\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 SpotLightVS();\n\t\tPixelShader = compile ps_3_0 SpotLightPS(true);\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = One;\n\t\tDestBlend = One;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/RenderCommon.fxh",
    "content": "#include \"Common.fxh\"\n#include \"ClipCommon.fxh\"\n\n// Transform matrices\nfloat4x4 WorldMatrix;\nfloat4x4 LastFrameWorldViewProjectionMatrix;\nfloat2 DestinationDimensions;\n\nconst float MaterialAlphaThreshold = 0.9f;\n\n// Diffuse texture (optional)\ntexture2D DiffuseTexture;\nsampler2D DiffuseSampler = sampler_state\n{\n\tTexture = <DiffuseTexture>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tAddressU = WRAP;\n\tAddressV = WRAP;\n};\n\n// Normal map (optional)\ntexture2D NormalMapTexture;\nsampler2D NormalMapSampler = sampler_state\n{\n\tTexture = <NormalMapTexture>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tAddressU = WRAP;\n\tAddressV = WRAP;\n};\n\n// Far clip plane\nfloat FarPlaneDistance;\n\n// Material parameters\nfloat3 DiffuseColor = float3(1.0f, 1.0f, 1.0f);\nint Materials[3];\n\n// Motion blur\nfloat2 ProcessMotionBlur(in MotionBlurPSInput input)\n{\n\tfloat2 velocity = (input.currentPosition.xy / input.currentPosition.w) - (input.previousPosition.xy / input.previousPosition.w);\n\tvelocity.y *= -1.0f;\n\treturn EncodeVelocity(velocity, DestinationDimensions);\n}\n\n// Shadow pixel shader\nvoid ShadowPS (\tin ShadowPSInput input,\n\t\t\t\tout float4 out_Depth : COLOR0)\n{\n\tout_Depth = float4(1.0f - (input.clipSpacePosition.z / input.clipSpacePosition.w), 1.0f, 1.0f, 1.0f);\n}\n\nvoid ShadowAlphaPS (\tin ShadowPSInput input,\n\t\t\t\tin TexturePSInput tex,\n\t\t\t\tout float4 out_Depth : COLOR0)\n{\n\tclip(tex2D(DiffuseSampler, tex.uvCoordinates).a - 0.5f);\n\tout_Depth = float4(1.0f - (input.clipSpacePosition.z / input.clipSpacePosition.w), 1.0f, 1.0f, 1.0f);\n}\n\n// Prefab pixel shaders\n\nvoid RenderTextureFlatPS(in RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tuniform bool clipAlpha,\n\t\t\t\t\t\tuniform bool multipleMaterials)\n{\n\tfloat4 color = tex2D(DiffuseSampler, tex.uvCoordinates);\n\n\tif (clipAlpha)\n\t\tclip(color.a - 0.5f);\n\n\tfloat3 normal = normalize(flat.normal);\n\t\n\toutput.color.rgb = DiffuseColor.rgb * color.rgb;\n\tif (clipAlpha)\n\t\toutput.color.a = EncodeMaterial(Materials[0]);\n\telse if (multipleMaterials)\n\t\toutput.color.a = EncodeMaterial(Materials[(int)(color.a < MaterialAlphaThreshold)]);\n\telse\n\t\toutput.color.a = EncodeMaterial(Materials[0]);\n\toutput.depth.x = length(input.viewSpacePosition);\n\toutput.normal.xy = EncodeNormal(normal.xy);\n\toutput.depth.y = normal.z;\n\toutput.depth.zw = (float2)0;\n\toutput.normal.zw = ProcessMotionBlur(motionBlurInput);\n}\n\nvoid RenderTextureFlatPlainPS(in RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tRenderTextureFlatPS(input, tex, flat, output, motionBlurInput, false, true);\n}\n\nvoid RenderTextureFlatPlainSingleMaterialPS(in RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tRenderTextureFlatPS(input, tex, flat, output, motionBlurInput, false, false);\n}\n\nvoid RenderTextureFlatClipAlphaPS(in RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tRenderTextureFlatPS(input, tex, flat, output, motionBlurInput, true, true);\n}\n\nvoid ClipTextureFlatPS(in RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tuniform bool clipAlpha,\n\t\t\t\t\t\tuniform bool multipleMaterials)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tRenderTextureFlatPS(input, tex, flat, output, motionBlurInput, clipAlpha, multipleMaterials);\n}\n\nvoid ClipTextureFlatPlainSingleMaterialPS(in RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput)\n{\n\tClipTextureFlatPS(input, tex, flat, clipData, output, motionBlurInput, false, false);\n}\n\nvoid ClipTextureFlatPlainPS(in RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tClipTextureFlatPS(input, tex, flat, clipData, output, motionBlurInput, false, true);\n}\n\nvoid ClipTextureFlatClipAlphaPS(in RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tClipTextureFlatPS(input, tex, flat, clipData, output, motionBlurInput, true, true);\n}\n\nvoid RenderTextureNormalMapPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tuniform bool clipAlpha)\n{\n\tfloat4 color = tex2D(DiffuseSampler, tex.uvCoordinates);\n\tif (clipAlpha)\n\t\tclip(color.a - 0.5f);\n\tfloat3 normal = mul(DecodeNormalMap(tex2D(NormalMapSampler, tex.uvCoordinates).xyz), normalMap.tangentToWorld);\n\toutput.color.rgb = DiffuseColor.rgb * color.rgb;\n\tif (clipAlpha)\n\t\toutput.color.a = EncodeMaterial(Materials[0]);\n\telse\n\t\toutput.color.a = EncodeMaterial(Materials[(int)(color.a < MaterialAlphaThreshold)]);\n\toutput.depth.x = length(input.viewSpacePosition);\n\toutput.normal.xy = EncodeNormal(normal.xy);\n\toutput.depth.y = normal.z;\n\toutput.depth.zw = (float2)0;\n\toutput.normal.zw = ProcessMotionBlur(motionBlurInput);\n}\n\nvoid RenderTextureNormalMapOverlayPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tin OverlayPSInput overlay,\n\t\t\t\t\t\t\t\tuniform sampler2D overlaySampler,\n\t\t\t\t\t\t\t\tuniform bool clipAlpha)\n{\n\tfloat4 color = tex2D(DiffuseSampler, tex.uvCoordinates);\n\tif (clipAlpha)\n\t\tclip(color.a - 0.5f);\n\tfloat3 normal = mul(DecodeNormalMap(tex2D(NormalMapSampler, tex.uvCoordinates).xyz), normalMap.tangentToWorld);\n\tfloat4 overlayColor = tex2D(overlaySampler, overlay.uvCoordinates);\n\toutput.color.rgb = lerp(DiffuseColor.rgb * color.rgb, overlayColor.rgb, overlayColor.a);\n\tif (clipAlpha)\n\t\toutput.color.a = EncodeMaterial(Materials[0]);\n\telse\n\t\toutput.color.a = EncodeMaterial(Materials[(int)(color.a < MaterialAlphaThreshold)]);\n\toutput.depth.x = length(input.viewSpacePosition);\n\toutput.normal.xy = EncodeNormal(normal.xy);\n\toutput.depth.y = normal.z;\n\toutput.depth.zw = (float2)0;\n\toutput.normal.zw = ProcessMotionBlur(motionBlurInput);\n}\n\nvoid RenderTextureNormalMapPlainPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tRenderTextureNormalMapPS(input, tex, normalMap, output, motionBlurInput, false);\n}\n\nvoid RenderTextureNormalMapClipAlphaPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tRenderTextureNormalMapPS(input, tex, normalMap, output, motionBlurInput, true);\n}\n\nvoid ClipTextureNormalMapPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tuniform bool clipAlpha)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tRenderTextureNormalMapPS(input, tex, normalMap, output, motionBlurInput, clipAlpha);\n}\n\nvoid ClipTextureNormalMapOverlayPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tin OverlayPSInput overlay,\n\t\t\t\t\t\t\t\tuniform sampler2D overlaySampler,\n\t\t\t\t\t\t\t\tuniform bool clipAlpha)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tRenderTextureNormalMapOverlayPS(input, tex, normalMap, output, motionBlurInput, overlay, overlaySampler, clipAlpha);\n}\n\nvoid ClipTextureNormalMapPlainPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tClipTextureNormalMapPS(input, tex, normalMap, clipData, output, motionBlurInput, false);\n}\n\nvoid ClipTextureNormalMapClipAlphaPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tClipTextureNormalMapPS(input, tex, normalMap, clipData, output, motionBlurInput, true);\n}\n\nvoid RenderTextureNormalMap3MaterialsPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\t\t\tin NormalMapPSInput normalMap,\n\t\t\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput)\n{\n\tfloat4 color = tex2D(DiffuseSampler, tex.uvCoordinates);\n\tfloat3 normal = mul(DecodeNormalMap(tex2D(NormalMapSampler, tex.uvCoordinates).xyz), normalMap.tangentToWorld);\n\toutput.color.rgb = DiffuseColor.rgb * color.rgb;\n\toutput.color.a = EncodeMaterial(Materials[(int)color.a * 2.0f]);\n\toutput.depth.x = length(input.viewSpacePosition);\n\toutput.normal.xy = EncodeNormal(normal.xy);\n\toutput.depth.y = normal.z;\n\toutput.depth.zw = (float2)0;\n\toutput.normal.zw = ProcessMotionBlur(motionBlurInput);\n}\n\nvoid RenderFlatPS(in RenderPSInput input,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tfloat3 normal = normalize(flat.normal);\n\t\n\toutput.color.rgb = DiffuseColor.rgb;\n\toutput.color.a = EncodeMaterial(Materials[0]);\n\toutput.depth.x = length(input.viewSpacePosition);\n\toutput.normal.xy = EncodeNormal(normal.xy);\n\toutput.depth.y = normal.z;\n\toutput.depth.zw = (float2)0;\n\toutput.normal.zw = ProcessMotionBlur(motionBlurInput);\n}\n\nvoid ClipFlatPS(in RenderPSInput input,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tRenderFlatPS(input, flat, motionBlurInput, output);\n}\n\nvoid RenderTexturePS(\tin RenderPSInput input,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tuniform bool clipAlpha)\n{\n\tfloat3 normal = normalize(flat.normal);\n\tfloat4 color = tex2D(DiffuseSampler, tex.uvCoordinates);\n\tif (clipAlpha)\n\t\tclip(color.a - 0.5f);\n\toutput.color.rgb = DiffuseColor.rgb * color.rgb;\n\toutput.color.a = 0.0f;\n\toutput.depth.x = float4(length(input.viewSpacePosition), 1.0f, 1.0f, 1.0f);\n\toutput.normal.xy = EncodeNormal(normal.xy);\n\toutput.depth.y = normal.z;\n\toutput.depth.zw = (float2)0;\n\toutput.normal.zw = ProcessMotionBlur(motionBlurInput);\n}\n\nvoid RenderTexturePlainPS(\tin RenderPSInput input,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tRenderTexturePS(input, flat, tex, output, motionBlurInput, false);\n}\n\nvoid RenderTextureClipAlphaPS(\tin RenderPSInput input,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tRenderTexturePS(input, flat, tex, output, motionBlurInput, true);\n}\n\nvoid ClipTexturePS(\tin RenderPSInput input,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tuniform bool clipAlpha)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tRenderTexturePS(input, flat, tex, output, motionBlurInput, clipAlpha);\n}\n\nvoid ClipTexturePlainPS(\tin RenderPSInput input,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tClipTexturePS(input, flat, tex, clipData, output, motionBlurInput, false);\n}\n\nvoid ClipTextureClipAlphaPS(\tin RenderPSInput input,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tClipTexturePS(input, flat, tex, clipData, output, motionBlurInput, true);\n}\n\nvoid RenderTextureNoDepthPS(\tin RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tuniform bool clipAlpha)\n{\n\tfloat4 color = tex2D(DiffuseSampler, tex.uvCoordinates);\n\tif (clipAlpha)\n\t\tclip(color.a - 0.5f);\n\toutput.color.rgb = DiffuseColor.rgb * color.rgb;\n\toutput.color.a = 0.0f;\n\toutput.depth.x = FarPlaneDistance;\n\toutput.depth.zw = (float2)0;\n\toutput.normal.xy = EncodeNormal(float2(0.0f, 0.0f));\n\toutput.depth.y = 1.0f;\n\toutput.normal.zw = ProcessMotionBlur(motionBlurInput);\n}\n\nvoid RenderTextureNoDepthPlainPS(\tin RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tRenderTextureNoDepthPS(input, tex, output, motionBlurInput, false);\n}\n\nvoid RenderTextureNoDepthClipAlphaPS(\tin RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tRenderTextureNoDepthPS(input, tex, output, motionBlurInput, true);\n}\n\nvoid ClipTextureNoDepthPS(\tin RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tout RenderPSOutput output,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tuniform bool clipAlpha)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tRenderTextureNoDepthPS(input, tex, output, motionBlurInput, clipAlpha);\n}\n\nvoid ClipTextureNoDepthPlainPS(\tin RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tClipTextureNoDepthPS(input, tex, clipData, output, motionBlurInput, false);\n}\n\nvoid ClipTextureNoDepthClipAlphaPS(\tin RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tClipTextureNoDepthPS(input, tex, clipData, output, motionBlurInput, true);\n}\n\nvoid RenderSolidColorPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tfloat3 normal = normalize(flat.normal);\n\n\toutput.color.rgb = DiffuseColor.rgb;\n\toutput.color.a = 0.0f;\n\toutput.depth.x = length(input.viewSpacePosition);\n\toutput.normal.xy = EncodeNormal(normal.xy);\n\toutput.depth.y = normal.z;\n\toutput.depth.zw = (float2)0;\n\toutput.normal.zw = ProcessMotionBlur(motionBlurInput);\n}\n\nvoid ClipSolidColorPS(\tin RenderPSInput input,\n\t\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\t\tin MotionBlurPSInput motionBlurInput,\n\t\t\t\t\t\t\tout RenderPSOutput output)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tRenderSolidColorPS(input, flat, motionBlurInput, output);\n}"
  },
  {
    "path": "Lemma/Content/Effects/RenderCommonAlpha.fxh",
    "content": "#include \"RenderCommon.fxh\"\n\nfloat Alpha = 1.0f;\n\ntexture2D DepthTexture;\nsampler2D DepthSampler = sampler_state\n{\n\tTexture = <DepthTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nvoid RenderTextureAlphaPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tfloat2 uv = 0.5f * alpha.clipSpacePosition.xy / alpha.clipSpacePosition.w + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\tuv = (round(uv * DestinationDimensions) + float2(0.5f, 0.5f)) / DestinationDimensions;\n\tclip(tex2D(DepthSampler, uv).r - length(input.viewSpacePosition));\n\tfloat4 color = tex2D(DiffuseSampler, tex.uvCoordinates);\n\t\n\toutput.rgb = DiffuseColor.rgb * color.rgb;\n\toutput.a = Alpha * color.a;\n}\n\nvoid ClipTextureAlphaPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tRenderTextureAlphaPS(input, alpha, tex, output);\n}\n\nvoid RenderSolidColorAlphaPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tfloat2 uv = 0.5f * alpha.clipSpacePosition.xy / alpha.clipSpacePosition.w + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\tuv = (round(uv * DestinationDimensions) + float2(0.5f, 0.5f)) / DestinationDimensions;\n\tclip(tex2D(DepthSampler, uv).r - length(input.viewSpacePosition));\n\toutput.rgb = DiffuseColor.rgb;\n\toutput.a = Alpha;\n}\n\nvoid ClipSolidColorAlphaPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tRenderSolidColorAlphaPS(input, alpha, output);\n}\n\nvoid RenderVertexColorAlphaPS(in RenderPSInput input,\n\t\t\t\t\t\tin VertexColorPSInput color,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tfloat2 uv = 0.5f * alpha.clipSpacePosition.xy / alpha.clipSpacePosition.w + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\tuv = (round(uv * DestinationDimensions) + float2(0.5f, 0.5f)) / DestinationDimensions;\n\tclip(tex2D(DepthSampler, uv).r - length(input.viewSpacePosition));\n\toutput.rgb = DiffuseColor.rgb * color.color.rgb;\n\toutput.a = Alpha * color.color.a;\n}\n\nvoid ClipVertexColorAlphaPS(in RenderPSInput input,\n\t\t\t\t\t\tin VertexColorPSInput color,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tRenderVertexColorAlphaPS(input, color, alpha, output);\n}"
  },
  {
    "path": "Lemma/Content/Effects/SkyDecal.fx",
    "content": "#include \"RenderCommonAlpha.fxh\"\n\nfloat3 CameraPosition;\nfloat4x4 ViewMatrixRotationOnly;\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout AlphaPSInput alpha)\n{\n\tfloat4 worldPosition = float4(mul(input.position.xyz + float3(1, 0, 0), (float3x3)WorldMatrix), 1);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrixRotationOnly);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\ttex.uvCoordinates = input.uvCoordinates;\n\talpha.clipSpacePosition = vs.position;\n}\n\nvoid SkyDecalPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tfloat2 uv = 0.5f * alpha.clipSpacePosition.xy / alpha.clipSpacePosition.w + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\tuv = (round(uv * DestinationDimensions) + float2(0.5f, 0.5f)) / DestinationDimensions;\n\tclip(tex2D(DepthSampler, uv).r - FarPlaneDistance);\n\tfloat4 color = tex2D(DiffuseSampler, tex.uvCoordinates);\n\t\n\toutput.rgb = DiffuseColor.rgb * color.rgb;\n\toutput.a = Alpha * color.a;\n}\n\n// No shadow technique. We don't want the sky decal casting shadows.\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyDecalPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyDecalPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/Skybox.fx",
    "content": "#include \"RenderCommonAlpha.fxh\"\n#include \"PostProcess\\Shadow2D.fxh\"\n\nfloat StartDistance;\nfloat VerticalSize;\nfloat VerticalCenter;\nfloat3 CameraPosition;\nfloat GodRayStrength;\nfloat GodRayExtinction;\nfloat WaterHeight;\n\nsampler2D SkyboxSampler = sampler_state\n{\n\tTexture = <DiffuseTexture>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nfloat4x4 ShadowViewProjectionMatrix;\n\nfloat4x4 ViewMatrixRotationOnly;\n\ntexture2D RandomTexture;\nsampler2D RandomSampler = sampler_state\n{\n\tTexture = <RandomTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = WRAP;\n\tAddressV = WRAP;\n};\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout AlphaPSInput alpha)\n{\n\tfloat4 worldPosition = float4(mul(input.position.xyz, (float3x3)WorldMatrix), 1);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrixRotationOnly);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\ttex.uvCoordinates = input.uvCoordinates;\n\talpha.clipSpacePosition = vs.position;\n}\n\n#define FOG_SHADOW_SAMPLES 11\nvoid SkyboxPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tout float4 output : COLOR0,\n\t\t\t\t\t\tuniform bool vertical,\n\t\t\t\t\t\tuniform bool shadow,\n\t\t\t\t\t\tuniform bool water)\n{\n\tfloat2 uv = (0.5f * alpha.clipSpacePosition.xy / alpha.clipSpacePosition.w) + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\tuv = (round(uv * DestinationDimensions) + float2(0.5f, 0.5f)) / DestinationDimensions;\n\n\tfloat depth = tex2D(DepthSampler, uv).r;\n\n\tfloat3 viewRay = normalize(input.position);\n\n\tif (water)\n\t{\n\t\tfloat waterDepth = (WaterHeight - CameraPosition.y) / viewRay.y;\n\t\tif (waterDepth > 0)\n\t\t\tdepth = min(depth, waterDepth);\n\t}\n\n\tfloat blend = max(0, (depth - StartDistance) / (FarPlaneDistance - StartDistance));\n\n\tif (vertical)\n\t\tblend += max(0, 1.0f - ((CameraPosition + viewRay * depth).y - VerticalCenter) / VerticalSize);\n\n\tfloat4 color = tex2D(SkyboxSampler, tex.uvCoordinates);\n\n\tfloat interval = (depth - StartDistance) / FOG_SHADOW_SAMPLES;\n\n\tif (shadow)\n\t{\n\t\tfloat shadowValue = FOG_SHADOW_SAMPLES;\n\n\t\tfloat3 s = CameraPosition + viewRay * StartDistance;\n\t\tviewRay *= interval;\n\n\t\tfloat lastValue = 0.0f;\n\t\t[unroll]\n\t\tfor (int i = 0; i < FOG_SHADOW_SAMPLES; i++)\n\t\t{\n\t\t\ts += viewRay;\n\t\t\tfloat4 shadowPos = mul(float4(s + tex2D(RandomSampler, s.xy), 1.0f), ShadowViewProjectionMatrix);\n\t\t\tfloat v = GetShadowValueRaw(shadowPos);\n\t\t\tfloat newValue = 0.0f;\n\t\t\tif (v > 0.0f)\n\t\t\t\tnewValue = 1.0f - min(v * GodRayExtinction, 1);\n\t\t\tshadowValue -= (newValue + lastValue) * 0.5f;\n\t\t\tlastValue = newValue;\n\t\t}\n\t\toutput.rgb = DiffuseColor.rgb * color.rgb * ((1.0f - GodRayStrength) + (shadowValue / FOG_SHADOW_SAMPLES) * GodRayStrength);\n\t}\n\telse\n\t\toutput.rgb = DiffuseColor.rgb * color.rgb;\n\n\toutput.a = min(blend, 1);\n}\n\nvoid SkyboxNormalPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tSkyboxPS(input, alpha, tex, output, false, false, false);\n}\n\nvoid SkyboxVerticalPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tSkyboxPS(input, alpha, tex, output, true, false, false);\n}\n\nvoid SkyboxNormalGodRayPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tSkyboxPS(input, alpha, tex, output, false, true, false);\n}\n\nvoid SkyboxVerticalGodRayPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tSkyboxPS(input, alpha, tex, output, true, true, false);\n}\n\nvoid SkyboxWaterPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tSkyboxPS(input, alpha, tex, output, false, false, true);\n}\n\nvoid SkyboxWaterGodRayPS(in RenderPSInput input,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tSkyboxPS(input, alpha, tex, output, false, true, true);\n}\n\n// No shadow technique. We don't want the skybox casting shadows.\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxNormalPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxNormalPS();\n\t}\n}\n\ntechnique RenderGodRays\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxNormalGodRayPS();\n\t}\n}\n\ntechnique ClipGodRays\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxNormalPS();\n\t}\n}\n\ntechnique RenderVertical\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxVerticalPS();\n\t}\n}\n\ntechnique ClipVertical\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxVerticalPS();\n\t}\n}\n\ntechnique RenderVerticalGodRays\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxVerticalGodRayPS();\n\t}\n}\n\ntechnique ClipVerticalGodRays\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxVerticalPS();\n\t}\n}\n\ntechnique RenderWater\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxWaterPS();\n\t}\n}\n\ntechnique ClipWater\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxNormalPS();\n\t}\n}\n\ntechnique RenderWaterGodRays\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxWaterGodRayPS();\n\t}\n}\n\ntechnique ClipWaterGodRays\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 SkyboxNormalPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/Unlit.fx",
    "content": "#include \"RenderCommon.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout FlatPSInput flat,\n\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\ttex.uvCoordinates = input.uvCoordinates;\n\n\tflat.normal = mul(input.normal, WorldMatrix);\n\t\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(input.position, LastFrameWorldViewProjectionMatrix);\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout FlatPSInput flat,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, tex, flat, motionBlur);\n\tclipData = GetClipData(output.position);\n}\n\n// No shadow technique. We don't want unlit objects casting shadows.\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTexturePlainPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTexturePlainPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/UnlitSolidColor.fx",
    "content": "#include \"RenderCommon.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout FlatPSInput flat,\n\t\t\t\tout MotionBlurPSInput motionBlur)\n{\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\tflat.normal = mul(input.normal, WorldMatrix);\n\t\n\t// Pass along the current vertex position in clip-space,\n\t// as well as the previous vertex position in clip-space\n\tmotionBlur.currentPosition = vs.position;\n\tmotionBlur.previousPosition = mul(input.position, LastFrameWorldViewProjectionMatrix);\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout FlatPSInput flat,\n\t\t\t\tout MotionBlurPSInput motionBlur,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, flat, motionBlur);\n\tclipData = GetClipData(output.position);\n}\n\n// No shadow technique. We don't want unlit objects casting shadows.\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderSolidColorPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = true;\n\t\tAlphaBlendEnable = false;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipSolidColorPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/VirtualUI.fx",
    "content": "#include \"RenderCommonAlpha.fxh\"\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\n\ttex.uvCoordinates = input.uvCoordinates;\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, tex);\n\tclipData = GetClipData(output.position);\n}\n\nvoid RenderTextureAlphaNoDepthPS(in TexturePSInput tex,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tfloat4 color = tex2D(DiffuseSampler, tex.uvCoordinates);\n\t\n\toutput.rgb = DiffuseColor.rgb * color.rgb;\n\toutput.a = Alpha * color.a;\n}\n\nvoid ClipTextureAlphaNoDepthPS(in TexturePSInput tex,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tRenderTextureAlphaNoDepthPS(tex, output);\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 RenderTextureAlphaNoDepthPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipTextureAlphaNoDepthPS();\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Effects/Water.fx",
    "content": "#include \"Common.fxh\"\n\nfloat3 Position;\nfloat3 CameraPosition;\nfloat2 Scale;\n\nfloat3 Color = float3(1, 1, 1);\nfloat3 UnderwaterColor = float3(1, 1, 1);\nfloat Brightness = 0.5f;\nfloat Fresnel = 0.7f;\nfloat ActualFarPlaneDistance;\nfloat2 DestinationDimensions;\nfloat Clearness = 1.0f;\nfloat Refraction = 0.0f;\nfloat4x4 InverseViewProjectionMatrix;\n\nfloat Distortion = 1.0f;\n\nfloat RippleDensity = 1.0f;\n\nfloat Speed = 0.075f;\n\nfloat Time = 0.0f;\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat2 uvCoordinates : TEXCOORD0;\n\tfloat3 normal : NORMAL0;\n};\n\nstruct SurfacePSInput\n{\n\tfloat4 clipSpacePosition : TEXCOORD5;\n\tfloat3 worldPosition : TEXCOORD6;\n\tfloat distortionAmount : TEXCOORD7;\n\tfloat4 viewSpacePosition : TEXCOORD8;\n};\n\ntexture2D DepthTexture;\nsampler2D DepthSampler = sampler_state\n{\n\tTexture = <DepthTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\ntexture2D NormalMapTexture;\nsampler2D NormalMapSampler = sampler_state\n{\n\tTexture = <NormalMapTexture>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tAddressU = WRAP;\n\tAddressV = WRAP;\n};\n\ntexture2D FrameTexture;\nsampler2D FrameSampler = sampler_state\n{\n\tTexture = <FrameTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\ntexture2D ReflectionTexture;\nsampler2D ReflectionSampler = sampler_state\n{\n\tTexture = <ReflectionTexture>;\n\tMinFilter = linear;\n\tMagFilter = linear;\n\tMipFilter = linear;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nvoid SurfaceVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout SurfacePSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout FlatPSInput flat)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = input.position;\n\tworldPosition.xyz *= float3(Scale.x, 1.0f, Scale.y);\n\tworldPosition.xyz += Position;\n\toutput.worldPosition = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\tfloat4 clipSpacePosition = mul(viewSpacePosition, ProjectionMatrix);\n\tvs.position = clipSpacePosition;\n\toutput.clipSpacePosition = clipSpacePosition;\n\n\tfloat4 clipSpacePosition2 = mul(worldPosition + float4(0, 0, 0.2f, 0), ViewProjectionMatrix);\n\toutput.distortionAmount = length(clipSpacePosition2 - clipSpacePosition) * Distortion;\n\n\ttex.uvCoordinates = input.uvCoordinates * Scale * RippleDensity * (200.0f / 2000.0f) + (float2(Time, Time) * Speed);\n\tflat.normal = input.normal;\n}\n\nvoid SurfacePS(\tin SurfacePSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tuniform bool reflection,\n\t\t\t\t\t\tout float4 color : COLOR0)\n{\n\t// Convert from clip space to UV coordinate space\n\tfloat2 uv = 0.5f * input.clipSpacePosition.xy / input.clipSpacePosition.w + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\tuv = (round(uv * DestinationDimensions) + float2(0.5f, 0.5f)) / DestinationDimensions;\n\n\tfloat2 distortion = (tex2D(NormalMapSampler, tex.uvCoordinates).xy - float2(0.5f, 0.5f)) * 2.0f * input.distortionAmount;\n\n\tfloat existingDepth = tex2D(DepthSampler, uv).r;\n\n\tfloat pixelDepth = length(input.viewSpacePosition) - distortion.x * 5.0f;\n\n\tfloat depth = existingDepth - pixelDepth;\n\n\tif (existingDepth < ActualFarPlaneDistance)\n\t\tclip(depth);\n\n\tuv += distortion;\n\n\tfloat depthBlend = clamp(depth * 0.5f * (1.0f - Clearness), 0.0f, 1.0f);\n\n\tfloat3 normal = flat.normal;\n\tnormal.xz += distortion;\n\tnormal = normalize(normal);\n\tfloat fresnel = abs(dot(normalize(input.worldPosition - CameraPosition), normal));\n\n\tfloat3 refraction = lerp(tex2D(FrameSampler, uv).xyz * Color + Brightness, UnderwaterColor, depthBlend);\n\n\tif (reflection)\n\t\tcolor = float4(lerp(tex2D(ReflectionSampler, uv).rgb, refraction, clamp(Refraction + fresnel * Fresnel, 0.0f, 1.0f)), 1.0f);\n\telse\n\t\tcolor = float4(refraction, 1.0f);\n}\n\nstruct UnderwaterPSInput\n{\n\tfloat2 texCoord : TEXCOORD5;\n\tfloat3 viewRay : TEXCOORD6;\n};\n\nvoid UnderwaterVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout UnderwaterPSInput output)\n{\n\tfloat4 pos = float4(input.position.xyz, 1.0f);\n\tvs.position = pos;\n\n\t// Convert from clip space to UV coordinate space\n\toutput.texCoord = 0.5f * pos.xy / pos.w + float2(0.5f, 0.5f);\n\toutput.texCoord.y = 1.0f - output.texCoord.y;\n\toutput.texCoord = (round(output.texCoord * DestinationDimensions) + float2(0.5f, 0.5f)) / DestinationDimensions;\n\n\tfloat4 v = mul(pos, InverseViewProjectionMatrix);\n\toutput.viewRay = v.xyz / v.w;\n}\n\nvoid UnderwaterPS(\tin UnderwaterPSInput input,\n\t\t\t\t\tout float4 color : COLOR0)\n{\n\tfloat depth = tex2D(DepthSampler, input.texCoord).r;\n\n\tfloat3 viewRay = normalize(input.viewRay);\n\tif (viewRay.y > 0.0f) // Intersect with water surface above us\n\t\tdepth = min(depth, (Position.y - CameraPosition.y) / viewRay.y);\n\n\tfloat depthBlend = clamp((depth - 2.0f) * 0.25f * (1.0f - Clearness), 0.0f, 1.0f);\n\n\tcolor = float4(UnderwaterColor, 0.2f + (0.8f * depthBlend));\n}\n\nvoid SurfaceWithReflection(in SurfacePSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tout float4 color : COLOR0)\n{\n\tSurfacePS(input, tex, flat, true, color);\n}\n\nvoid SurfaceWithoutReflection(in SurfacePSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin FlatPSInput flat,\n\t\t\t\t\t\tout float4 color : COLOR0)\n{\n\tSurfacePS(input, tex, flat, false, color);\n}\n\ntechnique SurfaceReflection\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 SurfaceVS();\n\t\tPixelShader = compile ps_3_0 SurfaceWithReflection();\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique Surface\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 SurfaceVS();\n\t\tPixelShader = compile ps_3_0 SurfaceWithoutReflection();\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = false;\n\t}\n}\n\ntechnique Underwater\n{\n\tpass p0\n\t{\n\t\tVertexShader = compile vs_3_0 UnderwaterVS();\n\t\tPixelShader = compile ps_3_0 UnderwaterPS();\n\t\tZEnable = false;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t}\n}"
  },
  {
    "path": "Lemma/Content/Effects/Waterfall.fx",
    "content": "#include \"RenderCommonAlpha.fxh\"\n\nfloat2 UVScale;\nfloat2 Offset;\n\n// Frame buffer sampler\ntexture2D FrameTexture;\nsampler2D FrameSampler = sampler_state\n{\n\tTexture = <FrameTexture>;\n\tMinFilter = point;\n\tMagFilter = point;\n\tMipFilter = point;\n\tAddressU = CLAMP;\n\tAddressV = CLAMP;\n};\n\nstruct RenderVSInput\n{\n\tfloat4 position : POSITION0;\n\tfloat3 normal : NORMAL0;\n\tfloat2 uv : TEXCOORD0;\n};\n\nvoid RenderVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout AlphaPSInput alpha)\n{\n\t// Calculate the clip-space vertex position\n\tfloat4 worldPosition = mul(input.position, WorldMatrix);\n\toutput.position = worldPosition;\n\tfloat4 viewSpacePosition = mul(worldPosition, ViewMatrix);\n\tvs.position = mul(viewSpacePosition, ProjectionMatrix);\n\toutput.viewSpacePosition = viewSpacePosition;\n\talpha.clipSpacePosition = vs.position;\n\ttex.uvCoordinates = input.uv * UVScale;\n}\n\nvoid ClipVS(\tin RenderVSInput input,\n\t\t\t\tout RenderVSOutput vs,\n\t\t\t\tout RenderPSInput output,\n\t\t\t\tout TexturePSInput tex,\n\t\t\t\tout AlphaPSInput alpha,\n\t\t\t\tout ClipPSInput clipData)\n{\n\tRenderVS(input, vs, output, tex, alpha);\n\tclipData = GetClipData(output.position);\n}\n\nvoid DistortionPS(\n\tin RenderPSInput input,\n\tin TexturePSInput tex,\n\tin AlphaPSInput alpha,\n\tout float4 output : COLOR0)\n{\n\t// Convert from clip space to UV coordinate space\n\tfloat2 uv = 0.5f * alpha.clipSpacePosition.xy / alpha.clipSpacePosition.w + float2(0.5f, 0.5f);\n\tuv.y = 1.0f - uv.y;\n\n\tfloat depth = length(input.viewSpacePosition);\n\tclip(tex2D(DepthSampler, uv).r - depth);\n\n\tfloat4 t = tex2D(NormalMapSampler, tex.uvCoordinates + Offset);\n\t\n\tfloat2 distortion = ((t.xy * 2.0f) - 1.0f) * t.a * 0.1f * (1.0f - (depth / FarPlaneDistance));\n\n\tfloat3 color = tex2D(FrameSampler, uv + distortion).rgb * DiffuseColor.rgb;\n\toutput = float4(color, saturate((1.0f - tex.uvCoordinates.y * 0.5f) * Alpha));\n}\n\nvoid ClipDistortionPS(in RenderPSInput input,\n\t\t\t\t\t\tin TexturePSInput tex,\n\t\t\t\t\t\tin AlphaPSInput alpha,\n\t\t\t\t\t\tin ClipPSInput clipData,\n\t\t\t\t\t\tout float4 output : COLOR0)\n{\n\tHandleClipPlanes(clipData.clipPlaneDistances);\n\tDistortionPS(input, tex, alpha, output);\n}\n\ntechnique Render\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\t\n\t\tVertexShader = compile vs_3_0 RenderVS();\n\t\tPixelShader = compile ps_3_0 DistortionPS();\n\t}\n}\n\ntechnique Clip\n{\n\tpass p0\n\t{\n\t\tZEnable = true;\n\t\tZWriteEnable = false;\n\t\tAlphaBlendEnable = true;\n\t\tSrcBlend = SrcAlpha;\n\t\tDestBlend = InvSrcAlpha;\n\n\t\tVertexShader = compile vs_3_0 ClipVS();\n\t\tPixelShader = compile ps_3_0 ClipDistortionPS();\n\t}\n}"
  },
  {
    "path": "Lemma/Content/EngineContent.XNA.contentproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <ProjectGuid>{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}</ProjectGuid>\n    <ProjectTypeGuids>{96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>\n    <PlatformTarget>x86</PlatformTarget>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <ContentRootDirectory>Content</ContentRootDirectory>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Development|x86' \">\n    <XnaPlatform>Windows</XnaPlatform>\n    <OutputPath>bin\\x86\\Development</OutputPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|x86' \">\n    <XnaPlatform>Windows</XnaPlatform>\n    <OutputPath>bin\\x86\\Debug</OutputPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|x86' \">\n    <XnaPlatform>Windows</XnaPlatform>\n    <OutputPath>bin\\x86\\Release</OutputPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|Xbox 360' \">\n    <XnaPlatform>Xbox 360</XnaPlatform>\n    <OutputPath>bin\\Xbox 360\\Debug</OutputPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|Xbox 360' \">\n    <XnaPlatform>Xbox 360</XnaPlatform>\n    <OutputPath>bin\\Xbox 360\\Release</OutputPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Editor|x86' \">\n    <XnaPlatform>Windows</XnaPlatform>\n    <OutputPath>bin\\x86\\Editor</OutputPath>\n  </PropertyGroup>\n  <ItemGroup>\n    <Folder Include=\"Properties\\\" />\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.0\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.3.1\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 3.1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\PostProcess\\SpotLight.fx\">\n      <Name>SpotLight</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\Water.fx\">\n      <Name>Water</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\PostProcess\\Clear.fx\">\n      <Name>Clear</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"AlphaModels\\box.fbx\">\n      <Name>box</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\DefaultSolidColorAlpha.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n    </Compile>\n    <Compile Include=\"AlphaModels\\clouds.fbx\">\n      <Name>clouds</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n      <ProcessorParameters_DiffuseTexture>clouds.png</ProcessorParameters_DiffuseTexture>\n      <ProcessorParameters_EffectFileName>..\\Effects\\Clouds.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"AlphaModels\\cylinder.fbx\">\n      <Name>cylinder</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\DefaultSolidColorAlpha.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n    </Compile>\n    <Compile Include=\"AlphaModels\\distortion-box.fbx\">\n      <Name>distortion-box</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n      <ProcessorParameters_EffectFileName>..\\Effects\\DistortionBox.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_NormalMapTexture>..\\Textures\\water-normal.jpg</ProcessorParameters_NormalMapTexture>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"AlphaModels\\sphere.fbx\">\n      <Name>sphere</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\DefaultSolidColorAlpha.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n    </Compile>\n    <Compile Include=\"AlphaModels\\cone.fbx\">\n      <Name>cone</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\DefaultSolidColorAlpha.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"AlphaModels\\light.fbx\">\n      <Name>light</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n      <ProcessorParameters_EffectFileName>..\\Effects\\DefaultSolidColorAlpha.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"AlphaModels\\pyramid.fbx\">\n      <Name>pyramid</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n      <ProcessorParameters_EffectFileName>..\\Effects\\DefaultSolidColorAlpha.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"AlphaModels\\selector.fbx\">\n      <Name>selector</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\DefaultSolidColorAlpha.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"AlphaModels\\waterfall.fbx\">\n      <Name>waterfall</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_NormalMapTexture>..\\Textures\\water-normal.jpg</ProcessorParameters_NormalMapTexture>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_EffectFileName>..\\Effects\\Waterfall.fx</ProcessorParameters_EffectFileName>\n    </Compile>\n    <None Include=\"Effects\\AnimationNormalMapCommon.fxh\">\n      <Name>AnimationNormalMapCommon</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <None Include=\"Effects\\ClipCommon.fxh\">\n      <Name>ClipCommon</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <Compile Include=\"Effects\\PostProcess\\Fog.fx\">\n      <Name>Fog</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\DefaultAlpha.fx\">\n      <Name>DefaultAlpha</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\DefaultSolidColorAlpha.fx\">\n      <Name>DefaultSolidColorAlpha</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\Lines.fx\">\n      <Name>Lines</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\Environment.fx\">\n      <Name>Environment</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\AnimationNormalMap.fx\">\n      <Name>AnimationNormalMap</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\ParticleFrameBufferDistortion.fx\">\n      <Name>ParticleFrameBufferDistortion</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\Clouds.fx\">\n      <Name>Clouds</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\ParticleRain.fx\">\n      <Name>ParticleRain</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\Lines2D.fx\">\n      <Name>Lines2D</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\InstancedSolidColor.fx\">\n      <Name>InstancedSolidColor</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\AdditiveClouds.fx\">\n      <Name>AdditiveClouds</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <None Include=\"Effects\\CloudCommon.fxh\">\n      <Name>CloudCommon</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <Compile Include=\"Effects\\DistortionBox.fx\">\n      <Name>DistortionBox</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\AnimationUnlit.fx\">\n      <Name>AnimationUnlit</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\Player.fx\">\n      <Name>Player</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <None Include=\"Effects\\AnimationCommon.fxh\">\n      <Name>AnimationCommon</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <None Include=\"Effects\\ParticleOpaqueCommon.fxh\">\n      <Name>ParticleOpaqueCommon</Name>\n    </None>\n    <None Include=\"Effects\\ParticleCommon.fxh\">\n      <Name>ParticleCommon</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <Compile Include=\"Effects\\PostProcess\\Downsample.fx\">\n      <Name>Downsample</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\PostProcess\\SSAO.fx\">\n      <Name>SSAO</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <None Include=\"Effects\\PostProcess\\BloomCommon.fxh\">\n      <Name>BloomCommon</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <None Include=\"Effects\\PostProcess\\EffectSamplers.fxh\">\n      <Name>EffectSamplers</Name>\n    </None>\n    <Compile Include=\"Effects\\PostProcess\\PointLight.fx\">\n      <Name>PointLight</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <None Include=\"Effects\\PostProcess\\Shadow2D.fxh\">\n      <Name>Shadow2D</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <None Include=\"Effects\\RenderCommonAlpha.fxh\">\n      <Name>RenderCommonAlpha</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <Compile Include=\"InstancedModels\\block.fbx\">\n      <Name>block</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\EnvironmentBlock.fx</ProcessorParameters_EffectFileName>\n    </Compile>\n    <Compile Include=\"InternalModels\\pointlight.fbx\">\n      <Name>pointlight</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>ModelProcessor</Processor>\n    </Compile>\n    <Compile Include=\"InternalModels\\skybox.fbx\">\n      <Name>skybox</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\Skybox.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n    </Compile>\n    <Compile Include=\"InternalModels\\spotlight.fbx\">\n      <Name>spotlight</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>ModelProcessor</Processor>\n    </Compile>\n    <Compile Include=\"InstancedModels\\position-model.fbx\">\n      <Name>position-model</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n      <ProcessorParameters_EffectFileName>..\\Effects\\InstancedSolidColor.fx</ProcessorParameters_EffectFileName>\n    </Compile>\n    <Compile Include=\"FontVR.spritefont\">\n      <Name>FontVR</Name>\n      <Importer>FontDescriptionImporter</Importer>\n      <Processor>FontDescriptionProcessor</Processor>\n    </Compile>\n    <Compile Include=\"FontLarge.spritefont\">\n      <Name>FontLarge</Name>\n      <Importer>FontDescriptionImporter</Importer>\n      <Processor>FontDescriptionProcessor</Processor>\n    </Compile>\n    <Compile Include=\"FontLargeVR.spritefont\">\n      <Name>FontLargeVR</Name>\n      <Importer>FontDescriptionImporter</Importer>\n      <Processor>FontDescriptionProcessor</Processor>\n    </Compile>\n    <None Include=\"menu.map\">\n      <Name>menu</Name>\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <Compile Include=\"Models\\papers.fbx\">\n      <Name>papers</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\Default.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_DiffuseTexture>papers.jpg</ProcessorParameters_DiffuseTexture>\n    </Compile>\n    <Compile Include=\"Models\\plane.fbx\">\n      <Name>plane</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\Unlit.fx</ProcessorParameters_EffectFileName>\n    </Compile>\n    <Compile Include=\"Models\\phone.fbx\">\n      <Name>phone</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\DefaultSolidColor.fx</ProcessorParameters_EffectFileName>\n    </Compile>\n    <Compile Include=\"Models\\joan.fbx\">\n      <Name>joan</Name>\n      <Importer>SkinnedModelImporter</Importer>\n      <Processor>SkinnedModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\Player.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_DiffuseTexture>joan.png</ProcessorParameters_DiffuseTexture>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n      <ProcessorParameters_NormalMapTexture>joan-normal.png</ProcessorParameters_NormalMapTexture>\n    </Compile>\n    <Compile Include=\"Models\\joan-firstperson.fbx\">\n      <Name>joan-firstperson</Name>\n      <Importer>SkinnedModelImporter</Importer>\n      <Processor>SkinnedModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\Player.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_PremultiplyTextureAlpha>False</ProcessorParameters_PremultiplyTextureAlpha>\n      <ProcessorParameters_DiffuseTexture>joan.png</ProcessorParameters_DiffuseTexture>\n      <ProcessorParameters_NormalMapTexture>joan-normal.png</ProcessorParameters_NormalMapTexture>\n    </Compile>\n    <Compile Include=\"Models\\note.fbx\">\n      <Name>note</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\DefaultSingleMaterial.fx</ProcessorParameters_EffectFileName>\n      <ProcessorParameters_RotationX>-90</ProcessorParameters_RotationX>\n    </Compile>\n    <None Include=\"Strings.xlsx\">\n      <Name>Strings</Name>\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"template.map\">\n      <Name>template</Name>\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Wwise\\**\\*.bnk\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\Animation.fx\">\n      <Name>Animation</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Reference Include=\"Microsoft.Xna.Framework.Content.Pipeline, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Content.Pipeline.AudioImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Content.Pipeline.EffectImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Content.Pipeline.FBXImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Content.Pipeline.TextureImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Content.Pipeline.VideoImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Font.spritefont\">\n      <Name>Font</Name>\n      <Importer>FontDescriptionImporter</Importer>\n      <Processor>FontDescriptionProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\Default.fx\">\n      <Name>Default</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\DefaultNormalMap.fx\">\n      <Name>DefaultNormalMap</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\InstancedNormalMap.fx\">\n      <Name>InstancedNormalMap</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\Unlit.fx\">\n      <Name>Unlit</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\Particle.fx\">\n      <Name>Particle</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\PostProcess\\GlobalLight.fx\">\n      <Name>GlobalLight</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <None Include=\"Effects\\Common.fxh\">\n      <Name>Common</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <Compile Include=\"Effects\\PostProcess\\Composite.fx\">\n      <Name>Composite</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\EnvironmentBlock.fx\">\n      <Name>EnvironmentBlock</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\UnlitSolidColor.fx\">\n      <Name>UnlitSolidColor</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\Skybox.fx\">\n      <Name>Skybox</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\PostProcess\\Blur.fx\">\n      <Name>Blur</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <None Include=\"Effects\\PostProcess\\EffectCommon.fxh\">\n      <Name>EffectCommon</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <Compile Include=\"Effects\\PostProcess\\MotionBlur.fx\">\n      <Name>MotionBlur</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <Compile Include=\"Effects\\PostProcess\\Bloom.fx\">\n      <Name>Bloom</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n    <None Include=\"Effects\\PostProcess\\LightingCommon.fxh\">\n      <Name>LightingCommon</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <None Include=\"Effects\\RenderCommon.fxh\">\n      <Name>RenderCommon</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n    <Compile Include=\"Models\\sphere.fbx\">\n      <Name>sphere</Name>\n      <Importer>FbxImporter</Importer>\n      <Processor>CustomModelProcessor</Processor>\n      <ProcessorParameters_EffectFileName>..\\Effects\\UnlitSolidColor.fx</ProcessorParameters_EffectFileName>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\DefaultSolidColor.fx\">\n      <Name>DefaultSolidColor</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Particles\\spark.png\">\n      <Name>spark</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\damage.png\">\n      <Name>damage</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\water-normal.jpg\">\n      <Name>water-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Particles\\splash.png\">\n      <Name>splash</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\logo.png\">\n      <Name>logo</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Particles\\smoke.png\">\n      <Name>smoke</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Particles\\debug.png\">\n      <Name>debug</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Particles\\distortion.png\">\n      <Name>distortion</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Particles\\default.png\">\n      <Name>default</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\random.jpg\">\n      <Name>random</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\PipelineExtensions\\PipelineExtensions.XNA.csproj\">\n      <Project>{4636C7E1-B845-4B83-B96D-64A11B8A4515}</Project>\n      <Name>PipelineExtensions.XNA</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\target.png\">\n      <Name>target</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\target-pointer.png\">\n      <Name>target-pointer</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\danger.jpg\">\n      <Name>danger</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\dirty-normal.jpg\">\n      <Name>dirty-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\foliage.png\">\n      <Name>foliage</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\metal-channels-normal.jpg\">\n      <Name>metal-channels-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\metal-channels2-normal.jpg\">\n      <Name>metal-channels2-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\metal-swirl-normal.jpg\">\n      <Name>metal-swirl-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\pattern4.png\">\n      <Name>pattern4</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\plain-normal.jpg\">\n      <Name>plain-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\powered-permanent.png\">\n      <Name>powered-permanent</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\powered.png\">\n      <Name>powered</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\rock-chunky-normal.jpg\">\n      <Name>rock-chunky-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\rock-chunky.jpg\">\n      <Name>rock-chunky</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\rock-normal.jpg\">\n      <Name>rock-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\temporary-normal.jpg\">\n      <Name>temporary-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\white.jpg\">\n      <Name>white</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\dirt-normal.jpg\">\n      <Name>dirt-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\dirt.jpg\">\n      <Name>dirt</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\switch.png\">\n      <Name>switch</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\powered-switch.png\">\n      <Name>powered-switch</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\switch-normal.png\">\n      <Name>switch-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\powered-hard.png\">\n      <Name>powered-hard</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\wood-normal.jpg\">\n      <Name>wood-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Textures\\wood.jpg\">\n      <Name>wood</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\signal.png\">\n      <Name>signal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\en.png\">\n      <Name>en</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\rock.png\">\n      <Name>rock</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\dirty.jpg\">\n      <Name>dirty</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\metal-channels2.png\">\n      <Name>metal-channels2</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\metal-swirl.png\">\n      <Name>metal-swirl</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Particles\\big-splash.png\">\n      <Name>big-splash</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Particles\\rift.png\">\n      <Name>rift</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Skyboxes\\skybox-sun.jpg\">\n      <Name>skybox-sun</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Skyboxes\\skybox1.jpg\">\n      <Name>skybox1</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n    <Compile Include=\"Skyboxes\\skybox2.jpg\">\n      <Name>skybox2</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"LightRamps\\bright.png\">\n      <Name>bright</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n    <Compile Include=\"LightRamps\\default.png\">\n      <Name>default</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n    <Compile Include=\"LightRamps\\ultrabright.png\">\n      <Name>ultrabright</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"EnvironmentMaps\\env0.jpg\">\n      <Name>env0</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>CubemapProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Cookies\\default.png\">\n      <Name>default</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\infected-hard.png\">\n      <Name>infected-hard</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\infected.png\">\n      <Name>infected</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\reticle.png\">\n      <Name>reticle</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\snow-normal.png\">\n      <Name>snow-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n    <Compile Include=\"Textures\\snow.png\">\n      <Name>snow</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\ParticleSnow.fx\">\n      <Name>ParticleSnow</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Particles\\wind.png\">\n      <Name>wind</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\red-rock-normal.png\">\n      <Name>red-rock-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n    <Compile Include=\"Textures\\red-rock.png\">\n      <Name>red-rock</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\ParticleVolume.fx\">\n      <Name>ParticleVolume</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Skyboxes\\sun-clouds.jpg\">\n      <Name>sun-clouds</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Skyboxes\\stormy.jpg\">\n      <Name>stormy</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AlphaModels\\clouds.png\">\n      <Name>cloud_texture</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\Waterfall.fx\">\n      <Name>Waterfall</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Skyboxes\\skybox-night.jpg\">\n      <Name>skybox-night</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\Oculus.fx\">\n      <Name>Oculus</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\VirtualUI.fx\">\n      <Name>VirtualUI</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Skyboxes\\eerie.jpg\">\n      <Name>eerie</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\cursor.png\">\n      <Name>cursor</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\rock-grassy-normal.png\">\n      <Name>rock-grassy-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n    <Compile Include=\"Textures\\rock-grassy.png\">\n      <Name>rock-grassy</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\hex-normal.png\">\n      <Name>hex-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n    <Compile Include=\"Textures\\hex.png\">\n      <Name>hex</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\bricks-normal.png\">\n      <Name>bricks-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n    <Compile Include=\"Textures\\bricks.png\">\n      <Name>bricks</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\lattice-normal.png\">\n      <Name>lattice-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n    <Compile Include=\"Textures\\lattice.png\">\n      <Name>lattice</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\slider-normal.png\">\n      <Name>slider-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n    <Compile Include=\"Textures\\slider.png\">\n      <Name>slider</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Effects\\DefaultCommon.fxh\">\n      <Name>DefaultCommon</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\DefaultSingleMaterial.fx\">\n      <Name>DefaultSingleMaterial</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"LightRamps\\vibrant.png\">\n      <Name>vibrant</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\SkyDecal.fx\">\n      <Name>SkyDecal</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\moon.png\">\n      <Name>moon</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\circle.png\">\n      <Name>circle</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\rectangles-normal.png\">\n      <Name>rectangles-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n    <Compile Include=\"Textures\\rectangles.png\">\n      <Name>rectangles</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\snow-overlay.png\">\n      <Name>snow-overlay</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Effects\\EnvironmentCommon.fxh\">\n      <Name>EnvironmentCommon</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\glass-normal.png\">\n      <Name>glass-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n    <Compile Include=\"Textures\\glass.png\">\n      <Name>glass</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"EnvironmentMaps\\env1.png\">\n      <Name>env1</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>CubemapProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Skyboxes\\skybox-horizon.jpg\">\n      <Name>skybox-horizon</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Skyboxes\\skybox-blue-horizon.jpg\">\n      <Name>skybox-blue-horizon</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\concrete.png\">\n      <Name>concrete</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\concrete-normal.png\">\n      <Name>concrete-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Textures\\gravel-normal.jpg\">\n      <Name>gravel-normal</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n    <Compile Include=\"Textures\\gravel.jpg\">\n      <Name>gravel</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\flare.png\">\n      <Name>flare</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_PremultiplyAlpha>False</ProcessorParameters_PremultiplyAlpha>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n      <ProcessorParameters_GenerateMipmaps>True</ProcessorParameters_GenerateMipmaps>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"EnvironmentMaps\\env1-mono.png\">\n      <Name>env1-mono</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>CubemapProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Effects\\DefaultAlphaClip.fx\">\n      <Name>DefaultAlphaClip</Name>\n      <Importer>EffectImporter</Importer>\n      <Processor>EffectProcessor</Processor>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\pl.png\">\n      <Name>pl</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\es.png\">\n      <Name>es</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\hu.png\">\n      <Name>hu</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\tr.png\">\n      <Name>tr</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Images\\fr.png\">\n      <Name>fr</Name>\n      <Importer>TextureImporter</Importer>\n      <Processor>TextureProcessor</Processor>\n      <ProcessorParameters_ColorKeyEnabled>False</ProcessorParameters_ColorKeyEnabled>\n    </Compile>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildExtensionsPath)\\Microsoft\\XNA Game Studio\\$(XnaFrameworkVersion)\\Microsoft.Xna.GameStudio.ContentPipeline.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "Lemma/Content/Font.spritefont",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nThis file contains an xml description of a font, and will be read by the XNA\nFramework Content Pipeline. Follow the comments to customize the appearance\nof the font in your game, and to change the characters which are available to draw\nwith.\n-->\n<XnaContent xmlns:Graphics=\"Microsoft.Xna.Framework.Content.Pipeline.Graphics\">\n  <Asset Type=\"Graphics:FontDescription\">\n\n    <!--\n    Modify this string to change the font that will be imported.\n    -->\n    <FontName>Tahoma</FontName>\n\n    <!--\n    Size is a float value, measured in points. Modify this value to change\n    the size of the font.\n    -->\n    <Size>11</Size>\n\n    <!--\n    Spacing is a float value, measured in pixels. Modify this value to change\n    the amount of spacing in between characters.\n    -->\n    <Spacing>0</Spacing>\n\n    <!--\n    UseKerning controls the layout of the font. If this value is true, kerning information\n    will be used when placing characters.\n    -->\n    <UseKerning>true</UseKerning>\n\n    <!--\n    Style controls the style of the font. Valid entries are \"Regular\", \"Bold\", \"Italic\",\n    and \"Bold, Italic\", and are case sensitive.\n    -->\n    <Style>Regular</Style>\n\n    <!--\n    If you uncomment this line, the default character will be substituted if you draw\n    or measure text that contains characters which were not included in the font.\n    -->\n    <!-- <DefaultCharacter>*</DefaultCharacter> -->\n\n    <!--\n    CharacterRegions control what letters are available in the font. Every\n    character from Start to End will be built and made available for drawing. The\n    default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin\n    character set. The characters are ordered according to the Unicode standard.\n    See the documentation for more information.\n    -->\n    <CharacterRegions>\n      <!-- ASCII -->\n      <CharacterRegion>\n        <Start>&#32;</Start>\n        <End>&#126;</End>\n      </CharacterRegion>\n\n      <!-- Extended latin characters and Spanish -->\n      <CharacterRegion>\n        <Start>&#160;</Start>\n        <End>&#253;</End>\n      </CharacterRegion>\n\n      <!-- Punctuation -->\n      <CharacterRegion>\n        <Start>&#8208;</Start>\n        <End>&#8231;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic -->\n      <CharacterRegion>\n        <Start>&#1024;</Start>\n        <End>&#1279;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Supplement -->\n      <CharacterRegion>\n        <Start>&#1280;</Start>\n        <End>&#1327;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Extended-A -->\n      <CharacterRegion>\n        <Start>&#11744;</Start>\n        <End>&#11775;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Extended-B -->\n      <CharacterRegion>\n        <Start>&#42560;</Start>\n        <End>&#42655;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Phonetic Extensions -->\n      <CharacterRegion>\n        <Start>&#7467;</Start>\n        <End>&#7467;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#7544;</Start>\n        <End>&#7544;</End>\n      </CharacterRegion>\n\n      <!-- Polish -->\n      <CharacterRegion>\n        <Start>&#260;</Start>\n        <End>&#263;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#280;</Start>\n        <End>&#281;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#321;</Start>\n        <End>&#324;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#211;</Start>\n        <End>&#211;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#243;</Start>\n        <End>&#243;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#346;</Start>\n        <End>&#347;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#377;</Start>\n        <End>&#380;</End>\n      </CharacterRegion>\n\n      <!-- Hungarian -->\n      <CharacterRegion>\n        <Start>&#193;</Start>\n        <End>&#193;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#225;</Start>\n        <End>&#225;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#201;</Start>\n        <End>&#201;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#233;</Start>\n        <End>&#233;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#205;</Start>\n        <End>&#205;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#237;</Start>\n        <End>&#237;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#211;</Start>\n        <End>&#211;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#243;</Start>\n        <End>&#243;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#218;</Start>\n        <End>&#218;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#250;</Start>\n        <End>&#250;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#214;</Start>\n        <End>&#214;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#246;</Start>\n        <End>&#246;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#220;</Start>\n        <End>&#220;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#252;</Start>\n        <End>&#252;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#336;</Start>\n        <End>&#337;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#368;</Start>\n        <End>&#369;</End>\n      </CharacterRegion>\n\n      <!-- Turkish -->\n      <CharacterRegion>\n        <Start>&#286;</Start>\n        <End>&#287;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#350;</Start>\n        <End>&#351;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#231;</Start>\n        <End>&#231;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#199;</Start>\n        <End>&#199;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#304;</Start>\n        <End>&#305;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#252;</Start>\n        <End>&#252;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#220;</Start>\n        <End>&#220;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#246;</Start>\n        <End>&#246;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#214;</Start>\n        <End>&#214;</End>\n      </CharacterRegion>\n    </CharacterRegions>\n  </Asset>\n</XnaContent>\n"
  },
  {
    "path": "Lemma/Content/FontLarge.spritefont",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nThis file contains an xml description of a font, and will be read by the XNA\nFramework Content Pipeline. Follow the comments to customize the appearance\nof the font in your game, and to change the characters which are available to draw\nwith.\n-->\n<XnaContent xmlns:Graphics=\"Microsoft.Xna.Framework.Content.Pipeline.Graphics\">\n  <Asset Type=\"Graphics:FontDescription\">\n\n    <!--\n    Modify this string to change the font that will be imported.\n    -->\n    <FontName>Tahoma</FontName>\n\n    <!--\n    Size is a float value, measured in points. Modify this value to change\n    the size of the font.\n    -->\n    <Size>24</Size>\n\n    <!--\n    Spacing is a float value, measured in pixels. Modify this value to change\n    the amount of spacing in between characters.\n    -->\n    <Spacing>0</Spacing>\n\n    <!--\n    UseKerning controls the layout of the font. If this value is true, kerning information\n    will be used when placing characters.\n    -->\n    <UseKerning>true</UseKerning>\n\n    <!--\n    Style controls the style of the font. Valid entries are \"Regular\", \"Bold\", \"Italic\",\n    and \"Bold, Italic\", and are case sensitive.\n    -->\n    <Style>Regular</Style>\n\n    <!--\n    If you uncomment this line, the default character will be substituted if you draw\n    or measure text that contains characters which were not included in the font.\n    -->\n    <!-- <DefaultCharacter>*</DefaultCharacter> -->\n\n    <!--\n    CharacterRegions control what letters are available in the font. Every\n    character from Start to End will be built and made available for drawing. The\n    default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin\n    character set. The characters are ordered according to the Unicode standard.\n    See the documentation for more information.\n    -->\n    <CharacterRegions>\n      <!-- ASCII -->\n      <CharacterRegion>\n        <Start>&#32;</Start>\n        <End>&#126;</End>\n      </CharacterRegion>\n\n      <!-- Extended latin characters and Spanish -->\n      <CharacterRegion>\n        <Start>&#160;</Start>\n        <End>&#253;</End>\n      </CharacterRegion>\n\n      <!-- Punctuation -->\n      <CharacterRegion>\n        <Start>&#8208;</Start>\n        <End>&#8231;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic -->\n      <CharacterRegion>\n        <Start>&#1024;</Start>\n        <End>&#1279;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Supplement -->\n      <CharacterRegion>\n        <Start>&#1280;</Start>\n        <End>&#1327;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Extended-A -->\n      <CharacterRegion>\n        <Start>&#11744;</Start>\n        <End>&#11775;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Extended-B -->\n      <CharacterRegion>\n        <Start>&#42560;</Start>\n        <End>&#42655;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Phonetic Extensions -->\n      <CharacterRegion>\n        <Start>&#7467;</Start>\n        <End>&#7467;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#7544;</Start>\n        <End>&#7544;</End>\n      </CharacterRegion>\n\n      <!-- Polish -->\n      <CharacterRegion>\n        <Start>&#260;</Start>\n        <End>&#263;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#280;</Start>\n        <End>&#281;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#321;</Start>\n        <End>&#324;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#211;</Start>\n        <End>&#211;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#243;</Start>\n        <End>&#243;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#346;</Start>\n        <End>&#347;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#377;</Start>\n        <End>&#380;</End>\n      </CharacterRegion>\n      \n      <!-- Hungarian -->\n      <CharacterRegion>\n        <Start>&#193;</Start>\n        <End>&#193;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#225;</Start>\n        <End>&#225;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#201;</Start>\n        <End>&#201;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#233;</Start>\n        <End>&#233;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#205;</Start>\n        <End>&#205;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#237;</Start>\n        <End>&#237;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#211;</Start>\n        <End>&#211;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#243;</Start>\n        <End>&#243;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#218;</Start>\n        <End>&#218;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#250;</Start>\n        <End>&#250;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#214;</Start>\n        <End>&#214;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#246;</Start>\n        <End>&#246;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#220;</Start>\n        <End>&#220;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#252;</Start>\n        <End>&#252;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#336;</Start>\n        <End>&#337;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#368;</Start>\n        <End>&#369;</End>\n      </CharacterRegion>\n      \n      <!-- Turkish -->\n      <CharacterRegion>\n        <Start>&#286;</Start>\n        <End>&#287;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#350;</Start>\n        <End>&#351;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#231;</Start>\n        <End>&#231;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#199;</Start>\n        <End>&#199;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#304;</Start>\n        <End>&#305;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#252;</Start>\n        <End>&#252;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#220;</Start>\n        <End>&#220;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#246;</Start>\n        <End>&#246;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#214;</Start>\n        <End>&#214;</End>\n      </CharacterRegion>\n    </CharacterRegions>\n  </Asset>\n</XnaContent>\n"
  },
  {
    "path": "Lemma/Content/FontLargeVR.spritefont",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nThis file contains an xml description of a font, and will be read by the XNA\nFramework Content Pipeline. Follow the comments to customize the appearance\nof the font in your game, and to change the characters which are available to draw\nwith.\n-->\n<XnaContent xmlns:Graphics=\"Microsoft.Xna.Framework.Content.Pipeline.Graphics\">\n  <Asset Type=\"Graphics:FontDescription\">\n\n    <!--\n    Modify this string to change the font that will be imported.\n    -->\n    <FontName>Tahoma</FontName>\n\n    <!--\n    Size is a float value, measured in points. Modify this value to change\n    the size of the font.\n    -->\n    <Size>36</Size>\n\n    <!--\n    Spacing is a float value, measured in pixels. Modify this value to change\n    the amount of spacing in between characters.\n    -->\n    <Spacing>0</Spacing>\n\n    <!--\n    UseKerning controls the layout of the font. If this value is true, kerning information\n    will be used when placing characters.\n    -->\n    <UseKerning>true</UseKerning>\n\n    <!--\n    Style controls the style of the font. Valid entries are \"Regular\", \"Bold\", \"Italic\",\n    and \"Bold, Italic\", and are case sensitive.\n    -->\n    <Style>Regular</Style>\n\n    <!--\n    If you uncomment this line, the default character will be substituted if you draw\n    or measure text that contains characters which were not included in the font.\n    -->\n    <!-- <DefaultCharacter>*</DefaultCharacter> -->\n\n    <!--\n    CharacterRegions control what letters are available in the font. Every\n    character from Start to End will be built and made available for drawing. The\n    default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin\n    character set. The characters are ordered according to the Unicode standard.\n    See the documentation for more information.\n    -->\n    <CharacterRegions>\n      <!-- ASCII -->\n      <CharacterRegion>\n        <Start>&#32;</Start>\n        <End>&#126;</End>\n      </CharacterRegion>\n\n      <!-- Extended latin characters and Spanish -->\n      <CharacterRegion>\n        <Start>&#160;</Start>\n        <End>&#253;</End>\n      </CharacterRegion>\n\n      <!-- Punctuation -->\n      <CharacterRegion>\n        <Start>&#8208;</Start>\n        <End>&#8231;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic -->\n      <CharacterRegion>\n        <Start>&#1024;</Start>\n        <End>&#1279;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Supplement -->\n      <CharacterRegion>\n        <Start>&#1280;</Start>\n        <End>&#1327;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Extended-A -->\n      <CharacterRegion>\n        <Start>&#11744;</Start>\n        <End>&#11775;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Extended-B -->\n      <CharacterRegion>\n        <Start>&#42560;</Start>\n        <End>&#42655;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Phonetic Extensions -->\n      <CharacterRegion>\n        <Start>&#7467;</Start>\n        <End>&#7467;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#7544;</Start>\n        <End>&#7544;</End>\n      </CharacterRegion>\n      \n      <!-- Polish -->\n      <CharacterRegion>\n        <Start>&#260;</Start>\n        <End>&#263;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#280;</Start>\n        <End>&#281;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#321;</Start>\n        <End>&#324;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#211;</Start>\n        <End>&#211;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#243;</Start>\n        <End>&#243;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#346;</Start>\n        <End>&#347;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#377;</Start>\n        <End>&#380;</End>\n      </CharacterRegion>\n\n      <!-- Hungarian -->\n      <CharacterRegion>\n        <Start>&#193;</Start>\n        <End>&#193;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#225;</Start>\n        <End>&#225;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#201;</Start>\n        <End>&#201;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#233;</Start>\n        <End>&#233;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#205;</Start>\n        <End>&#205;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#237;</Start>\n        <End>&#237;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#211;</Start>\n        <End>&#211;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#243;</Start>\n        <End>&#243;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#218;</Start>\n        <End>&#218;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#250;</Start>\n        <End>&#250;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#214;</Start>\n        <End>&#214;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#246;</Start>\n        <End>&#246;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#220;</Start>\n        <End>&#220;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#252;</Start>\n        <End>&#252;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#336;</Start>\n        <End>&#337;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#368;</Start>\n        <End>&#369;</End>\n      </CharacterRegion>\n      \n      <!-- Turkish -->\n      <CharacterRegion>\n        <Start>&#286;</Start>\n        <End>&#287;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#350;</Start>\n        <End>&#351;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#231;</Start>\n        <End>&#231;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#199;</Start>\n        <End>&#199;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#304;</Start>\n        <End>&#305;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#252;</Start>\n        <End>&#252;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#220;</Start>\n        <End>&#220;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#246;</Start>\n        <End>&#246;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#214;</Start>\n        <End>&#214;</End>\n      </CharacterRegion>\n    </CharacterRegions>\n  </Asset>\n</XnaContent>\n"
  },
  {
    "path": "Lemma/Content/FontVR.spritefont",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\nThis file contains an xml description of a font, and will be read by the XNA\nFramework Content Pipeline. Follow the comments to customize the appearance\nof the font in your game, and to change the characters which are available to draw\nwith.\n-->\n<XnaContent xmlns:Graphics=\"Microsoft.Xna.Framework.Content.Pipeline.Graphics\">\n  <Asset Type=\"Graphics:FontDescription\">\n\n    <!--\n    Modify this string to change the font that will be imported.\n    -->\n    <FontName>Tahoma</FontName>\n\n    <!--\n    Size is a float value, measured in points. Modify this value to change\n    the size of the font.\n    -->\n    <Size>16</Size>\n\n    <!--\n    Spacing is a float value, measured in pixels. Modify this value to change\n    the amount of spacing in between characters.\n    -->\n    <Spacing>0</Spacing>\n\n    <!--\n    UseKerning controls the layout of the font. If this value is true, kerning information\n    will be used when placing characters.\n    -->\n    <UseKerning>true</UseKerning>\n\n    <!--\n    Style controls the style of the font. Valid entries are \"Regular\", \"Bold\", \"Italic\",\n    and \"Bold, Italic\", and are case sensitive.\n    -->\n    <Style>Regular</Style>\n\n    <!--\n    If you uncomment this line, the default character will be substituted if you draw\n    or measure text that contains characters which were not included in the font.\n    -->\n    <!-- <DefaultCharacter>*</DefaultCharacter> -->\n\n    <!--\n    CharacterRegions control what letters are available in the font. Every\n    character from Start to End will be built and made available for drawing. The\n    default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin\n    character set. The characters are ordered according to the Unicode standard.\n    See the documentation for more information.\n    -->\n    <CharacterRegions>\n      <!-- ASCII -->\n      <CharacterRegion>\n        <Start>&#32;</Start>\n        <End>&#126;</End>\n      </CharacterRegion>\n\n      <!-- Extended latin characters and Spanish -->\n      <CharacterRegion>\n        <Start>&#160;</Start>\n        <End>&#253;</End>\n      </CharacterRegion>\n\n      <!-- Punctuation -->\n      <CharacterRegion>\n        <Start>&#8208;</Start>\n        <End>&#8231;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic -->\n      <CharacterRegion>\n        <Start>&#1024;</Start>\n        <End>&#1279;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Supplement -->\n      <CharacterRegion>\n        <Start>&#1280;</Start>\n        <End>&#1327;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Extended-A -->\n      <CharacterRegion>\n        <Start>&#11744;</Start>\n        <End>&#11775;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Extended-B -->\n      <CharacterRegion>\n        <Start>&#42560;</Start>\n        <End>&#42655;</End>\n      </CharacterRegion>\n\n      <!-- Cyrillic Phonetic Extensions -->\n      <CharacterRegion>\n        <Start>&#7467;</Start>\n        <End>&#7467;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#7544;</Start>\n        <End>&#7544;</End>\n      </CharacterRegion>\n      \n      <!-- Polish -->\n      <CharacterRegion>\n        <Start>&#260;</Start>\n        <End>&#263;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#280;</Start>\n        <End>&#281;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#321;</Start>\n        <End>&#324;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#211;</Start>\n        <End>&#211;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#243;</Start>\n        <End>&#243;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#346;</Start>\n        <End>&#347;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#377;</Start>\n        <End>&#380;</End>\n      </CharacterRegion>\n\n      <!-- Hungarian -->\n      <CharacterRegion>\n        <Start>&#193;</Start>\n        <End>&#193;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#225;</Start>\n        <End>&#225;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#201;</Start>\n        <End>&#201;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#233;</Start>\n        <End>&#233;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#205;</Start>\n        <End>&#205;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#237;</Start>\n        <End>&#237;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#211;</Start>\n        <End>&#211;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#243;</Start>\n        <End>&#243;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#218;</Start>\n        <End>&#218;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#250;</Start>\n        <End>&#250;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#214;</Start>\n        <End>&#214;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#246;</Start>\n        <End>&#246;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#220;</Start>\n        <End>&#220;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#252;</Start>\n        <End>&#252;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#336;</Start>\n        <End>&#337;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#368;</Start>\n        <End>&#369;</End>\n      </CharacterRegion>\n      \n      <!-- Turkish -->\n      <CharacterRegion>\n        <Start>&#286;</Start>\n        <End>&#287;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#350;</Start>\n        <End>&#351;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#231;</Start>\n        <End>&#231;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#199;</Start>\n        <End>&#199;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#304;</Start>\n        <End>&#305;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#252;</Start>\n        <End>&#252;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#220;</Start>\n        <End>&#220;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#246;</Start>\n        <End>&#246;</End>\n      </CharacterRegion>\n      <CharacterRegion>\n        <Start>&#214;</Start>\n        <End>&#214;</End>\n      </CharacterRegion>\n    </CharacterRegions>\n  </Asset>\n</XnaContent>\n"
  },
  {
    "path": "Lemma/Content/InstancedModels/block.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2012\n\t\tMonth: 09\n\t\tDay: 12\n\t\tHour: 13\n\t\tMinute: 20\n\t\tSecond: 07\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2012-09-12 13:20:07:000\"\nCreator: \"Blender version 2.62 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.500000,0.500000,-0.500000,0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,0.500000,-0.500000,0.500000,0.500000,0.500000,0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000\n\t\t,-0.500000,0.500000,0.500000,0.500000,0.500000,-0.500000,0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000\n\t\t,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,0.500000,0.500000,-0.500000,0.500000,0.500000,0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000\n\t\t,-0.500000,0.500000,0.500000,-0.500000,0.500000,0.500000,0.500000,0.500000,0.500000\n\t\tPolygonVertexIndex: 0,1,2,-4,4,7,6,-6,8,18,17,-16,14,16,19,-14,12,20,21,-12,23,9,10,-23\n\t\tEdges: \n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByVertice\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.000000000000000,0.000000000000000,-0.999969482421875,0.000000000000000,0.000000000000000,-1.000000000000000\n\t\t\t ,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000,-0.999969482421875\n\t\t\t ,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t\t ,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t\t ,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,0.999969482421875,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000\n\t\t\t ,-1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-0.999969482421875,0.000000000000000\n\t\t\t ,0.000000000000000,-1.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,-1.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000\n\t\t\t ,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000\n\t\t\t ,-1.000000000000000,0.000000000000000,0.000000000000000,-0.999969482421875,0.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVTex\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.700000,0.350000,1.000000,0.350000,1.000000,0.650000,0.700000,0.650000,0.350000,0.350000,0.650000,0.350000,0.650000,0.650000\n\t\t\t ,0.350000,0.650000,0.003125,0.350000,0.303125,0.350000,0.303125,0.650000,0.003125,0.650000,0.003125,0.693750,0.303125,0.693750\n\t\t\t ,0.303125,0.993750,0.003125,0.993750,0.350000,0.696875,0.650000,0.696875,0.650000,0.996875,0.350000,0.996875,0.703125,0.696875\n\t\t\t ,1.003125,0.696875,1.003125,0.996875,0.703125,0.996875\n\t\t\tUVIndex: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t},0.500000,0.500000,-0.500000,0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,0.500000,-0.500000,0.500000,0.500000,0.500000,0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,0.500000,0.500000,0.500000,0.500000,-0.500000,0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,0.500000,0.500000,-0.500000,0.500000,0.500000,0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,-0.500000,0.500000,-0.500000,0.500000,0.500000,-0.500000,0.500000,0.500000,0.500000,0.500000,0.500000\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2500\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",9.6\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFlogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/InstancedModels/position-model.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n    FBXHeaderVersion: 1003\n    FBXVersion: 6100\n    CreationTimeStamp:  {\n        Version: 1000\n        Year: 2010\n        Month: 12\n        Day: 27\n        Hour: 13\n        Minute: 18\n        Second: 59\n        Millisecond: 0\n    }\n    Creator: \"FBX SDK/FBX Plugins build 20070228\"\n    OtherFlags:  {\n        FlagPLE: 0\n    }\n}\nCreationTime: \"2010-12-27 13:18:59:000\"\nCreator: \"Blender version 2.55 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n    Version: 100\n    Count: 12\n    ObjectType: \"Model\" {\n        Count: 10\n    }\n    ObjectType: \"Geometry\" {\n        Count: 1\n    }\n    ObjectType: \"Material\" {\n        Count: 1\n    }\n    ObjectType: \"Pose\" {\n        Count: 1\n    }\n    ObjectType: \"GlobalSettings\" {\n        Count: 1\n    }\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n    Model: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n        Version: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n            Property: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n            Property: \"Camera Index\", \"Integer\", \"A+\",100\n        }\n        MultiLayer: 0\n        MultiTake: 1\n        Hidden: \"True\"\n        Shading: W\n        Culling: \"CullingOff\"\n        Version: 101\n        Name: \"Model::Camera Switcher\"\n        CameraId: 0\n        CameraName: 100\n        CameraIndexName:\n    }\n\tModel: \"Model::blend_root\", \"Null\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n        }\n        MultiLayer: 0\n        MultiTake: 1\n        Shading: Y\n        Culling: \"CullingOff\"\n        TypeFlags: \"Null\"\n    }\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-90.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.000000,0.000000,-1.000000,0.723600,-0.525720,-0.447215,-0.276385,-0.850640,-0.447215,-0.894425,0.000000,-0.447215,-0.276385,0.850640,-0.447215,0.723600,0.525720,-0.447215,0.276385,-0.850640,0.447215\n\t\t,-0.723600,-0.525720,0.447215,-0.723600,0.525720,0.447215,0.276385,0.850640,0.447215,0.894425,0.000000,0.447215,0.000000,0.000000,1.000000,0.425323,-0.309011,-0.850654,-0.162456,-0.499995,-0.850654\n\t\t,0.262869,-0.809012,-0.525738,0.425323,0.309011,-0.850654,0.850648,0.000000,-0.525736,-0.525730,0.000000,-0.850652,-0.688189,-0.499997,-0.525736,-0.162456,0.499995,-0.850654,-0.688189,0.499997,-0.525736\n\t\t,0.262869,0.809012,-0.525738,0.951058,0.309013,0.000000,0.951058,-0.309013,0.000000,0.587786,-0.809017,0.000000,0.000000,-1.000000,0.000000,-0.587786,-0.809017,0.000000,-0.951058,-0.309013,0.000000\n\t\t,-0.951058,0.309013,0.000000,-0.587786,0.809017,0.000000,0.000000,1.000000,0.000000,0.587786,0.809017,0.000000,0.688189,-0.499997,0.525736,-0.262869,-0.809012,0.525738,-0.850648,0.000000,0.525736\n\t\t,-0.262869,0.809012,0.525738,0.688189,0.499997,0.525736,0.525730,0.000000,0.850652,0.162456,-0.499995,0.850654,-0.425323,-0.309011,0.850654,-0.425323,0.309011,0.850654,0.162456,0.499995,0.850654\n\t\t,0.221076,-0.160619,-0.961939,0.597194,-0.433882,-0.674615,-0.084442,-0.259889,-0.961939,-0.228103,-0.702042,-0.674615,0.512753,-0.693775,-0.505727,-0.007026,-0.862665,-0.505728,0.221076,0.160619,-0.961939\n\t\t,0.597194,0.433882,-0.674615,0.818272,-0.273262,-0.505726,0.818272,0.273262,-0.505726,-0.273266,0.000000,-0.961939,-0.738174,0.000000,-0.674610,-0.822618,-0.259890,-0.505724,-0.501373,-0.702043,-0.505727\n\t\t,-0.084442,0.259889,-0.961939,-0.228103,0.702042,-0.674615,-0.501373,0.702043,-0.505727,-0.822618,0.259890,-0.505724,-0.007026,0.862665,-0.505728,0.512753,0.693775,-0.505727,0.959253,0.160620,0.232455\n\t\t,0.870465,0.433883,-0.232456,0.870465,-0.433883,-0.232456,0.959253,-0.160620,0.232455,0.681641,-0.693779,-0.232457,0.449185,-0.862668,0.232457,-0.143661,-0.961938,-0.232456,0.143661,-0.961938,0.232456\n\t\t,-0.681641,-0.693779,0.232457,-0.449185,-0.862668,-0.232457,-0.870465,-0.433883,0.232456,-0.959253,-0.160620,-0.232455,-0.870465,0.433883,0.232456,-0.959253,0.160620,-0.232455,-0.681641,0.693779,0.232457\n\t\t,-0.449185,0.862668,-0.232457,0.143661,0.961938,0.232456,-0.143661,0.961938,-0.232456,0.449185,0.862668,0.232457,0.681641,0.693779,-0.232457,0.822618,-0.259890,0.505724,0.501373,-0.702043,0.505727\n\t\t,-0.512753,-0.693775,0.505727,0.007026,-0.862665,0.505728,-0.818272,0.273262,0.505726,-0.818272,-0.273262,0.505726,0.007026,0.862665,0.505728,-0.512753,0.693775,0.505727,0.501373,0.702043,0.505727\n\t\t,0.822618,0.259890,0.505724,0.738174,0.000000,0.674610,0.273266,0.000000,0.961939,0.084442,-0.259889,0.961939,0.228103,-0.702042,0.674615,-0.221076,-0.160619,0.961939,-0.597194,-0.433882,0.674615\n\t\t,-0.221076,0.160619,0.961939,-0.597194,0.433882,0.674615,0.228103,0.702042,0.674615,0.084442,0.259889,0.961939,0.361804,-0.587779,-0.723612,0.138197,-0.425320,-0.894430,0.052790,-0.688185,-0.723612\n\t\t,0.670817,-0.162457,-0.723611,0.447210,0.000000,-0.894429,0.670817,0.162457,-0.723611,-0.447211,-0.525727,-0.723611,-0.361800,-0.262863,-0.894429,-0.638195,-0.262864,-0.723609,-0.638195,0.262864,-0.723609\n\t\t,-0.361800,0.262863,-0.894429,-0.447211,0.525727,-0.723611,0.052790,0.688185,-0.723612,0.138197,0.425320,-0.894430,0.361804,0.587779,-0.723612,0.947213,-0.162458,-0.276396,0.947213,0.162458,-0.276396\n\t\t,1.000000,0.000000,0.000000,0.138199,-0.951055,-0.276397,0.447216,-0.850648,-0.276397,0.309017,-0.951056,0.000000,-0.861804,-0.425322,-0.276396,-0.670820,-0.688190,-0.276396,-0.809018,-0.587783,0.000000\n\t\t,-0.670820,0.688190,-0.276396,-0.861804,0.425322,-0.276396,-0.809018,0.587783,0.000000,0.447216,0.850648,-0.276397,0.138199,0.951055,-0.276397,0.309017,0.951056,0.000000,0.861804,-0.425322,0.276396\n\t\t,0.809018,-0.587783,0.000000,0.670820,-0.688190,0.276396,-0.138199,-0.951055,0.276397,-0.309017,-0.951056,0.000000,-0.447216,-0.850648,0.276397,-0.947213,-0.162458,0.276396,-1.000000,0.000000,0.000000\n\t\t,-0.947213,0.162458,0.276396,-0.447216,0.850648,0.276397,-0.309017,0.951056,0.000000,-0.138199,0.951055,0.276397,0.670820,0.688190,0.276396,0.809018,0.587783,0.000000,0.861804,0.425322,0.276396\n\t\t,0.447211,-0.525727,0.723611,0.638195,-0.262864,0.723609,0.361800,-0.262863,0.894429,-0.361804,-0.587779,0.723612,-0.052790,-0.688185,0.723612,-0.138197,-0.425320,0.894430,-0.670817,0.162457,0.723611\n\t\t,-0.670817,-0.162457,0.723611,-0.447210,0.000000,0.894429,-0.052790,0.688185,0.723612,-0.361804,0.587779,0.723612,-0.138197,0.425320,0.894430,0.638195,0.262864,0.723609,0.447211,0.525727,0.723612\n\t\t,0.361800,0.262863,0.894429\n\t\tPolygonVertexIndex: 102,46,-15,46,102,-44,12,43,-103,43,1,-47,102,103,-13,103,102,-105,14,104,-103,104,13,-104,45,47,-3,47,45,-105,13,104,-46,104,14,-48,44,103,-14\n\t\t,103,44,-43,0,42,-45,42,12,-104,105,16,-51,50,43,-106,12,105,-44,43,50,-2,105,12,-107,106,107,-106,16,105,-108,107,106,-16,49,5,-52,51,107,-50\n\t\t,15,49,-108,107,51,-17,48,15,-107,106,42,-49,0,48,-43,42,106,-13,108,55,-19,55,108,-46,13,45,-109,45,2,-56,108,109,-14,109,108,-111,18,110,-109\n\t\t,110,17,-110,53,54,-4,54,53,-111,17,110,-54,110,18,-55,52,109,-18,109,52,-45,0,44,-53,44,13,-110,111,59,-21,59,111,-54,17,53,-112,53,3,-60\n\t\t,111,112,-18,112,111,-114,20,113,-112,113,19,-113,57,58,-5,58,57,-114,19,113,-58,113,20,-59,56,112,-20,112,56,-53,0,52,-57,52,17,-113,114,60,-22\n\t\t,60,114,-58,19,57,-115,57,4,-61,114,115,-20,115,114,-117,21,116,-115,116,15,-116,49,61,-6,61,49,-117,15,116,-50,116,21,-62,48,115,-16,115,48,-57\n\t\t,0,56,-49,56,19,-116,117,23,-65,64,50,-118,16,117,-51,50,64,-2,117,16,-119,118,119,-118,23,117,-120,119,118,-23,62,10,-66,65,119,-63,22,62,-120\n\t\t,119,65,-24,63,22,-119,118,51,-64,5,63,-52,51,118,-17,120,25,-69,68,47,-121,14,120,-48,47,68,-3,120,14,-122,121,122,-121,25,120,-123,122,121,-25\n\t\t,67,6,-70,69,122,-68,24,67,-123,122,69,-26,66,24,-122,121,46,-67,1,66,-47,46,121,-15,123,27,-74,73,54,-124,18,123,-55,54,73,-4,123,18,-125\n\t\t,124,125,-124,27,123,-126,125,124,-27,70,7,-73,72,125,-71,26,70,-126,125,72,-28,71,26,-125,124,55,-72,2,71,-56,55,124,-19,126,29,-78,77,58,-127\n\t\t,20,126,-59,58,77,-5,126,20,-128,127,128,-127,29,126,-129,128,127,-29,74,8,-77,76,128,-75,28,74,-129,128,76,-30,75,28,-128,127,59,-76,3,75,-60\n\t\t,59,127,-21,129,31,-82,81,61,-130,21,129,-62,61,81,-6,129,21,-131,130,131,-130,31,129,-132,131,130,-31,78,9,-81,80,131,-79,30,78,-132,131,80,-32\n\t\t,79,30,-131,130,60,-80,4,79,-61,60,130,-22,132,82,-33,82,132,-66,23,65,-133,65,10,-83,132,133,-24,133,132,-135,32,134,-133,134,24,-134,67,83,-7\n\t\t,83,67,-135,24,134,-68,134,32,-84,66,133,-25,133,66,-65,1,64,-67,64,23,-134,135,85,-34,85,135,-70,25,69,-136,69,6,-86,135,136,-26,136,135,-138\n\t\t,33,137,-136,137,26,-137,70,84,-8,84,70,-138,26,137,-71,137,33,-85,71,136,-27,136,71,-69,2,68,-72,68,25,-137,138,87,-35,87,138,-73,27,72,-139\n\t\t,72,7,-88,138,139,-28,139,138,-141,34,140,-139,140,28,-140,74,86,-9,86,74,-141,28,140,-75,140,34,-87,75,139,-29,139,75,-74,3,73,-76,73,27,-140\n\t\t,141,89,-36,89,141,-77,29,76,-142,76,8,-90,141,142,-30,142,141,-144,35,143,-142,143,30,-143,78,88,-10,88,78,-144,30,143,-79,143,35,-89,79,142,-31\n\t\t,142,79,-78,4,77,-80,77,29,-143,144,90,-37,90,144,-81,31,80,-145,80,9,-91,144,145,-32,145,144,-147,36,146,-145,146,22,-146,62,91,-11,91,62,-147\n\t\t,22,146,-63,146,36,-92,63,145,-23,145,63,-82,5,81,-64,81,31,-146,147,38,-96,95,83,-148,32,147,-84,83,95,-7,147,32,-149,148,149,-148,38,147,-150\n\t\t,149,148,-38,93,11,-95,94,149,-94,37,93,-150,149,94,-39,92,37,-149,148,82,-93,10,92,-83,82,148,-33,150,39,-98,97,84,-151,33,150,-85,84,97,-8\n\t\t,150,33,-152,151,152,-151,39,150,-153,152,151,-39,94,11,-97,96,152,-95,38,94,-153,152,96,-40,95,38,-152,151,85,-96,6,95,-86,85,151,-34,153,40,-100\n\t\t,99,86,-154,34,153,-87,86,99,-9,153,34,-155,154,155,-154,40,153,-156,155,154,-40,96,11,-99,98,155,-97,39,96,-156,155,98,-41,97,39,-155,154,87,-98\n\t\t,7,97,-88,87,154,-35,156,41,-101,100,88,-157,35,156,-89,88,100,-10,156,35,-158,157,158,-157,41,156,-159,158,157,-41,98,11,-102,101,158,-99,40,98,-159\n\t\t,158,101,-42,99,40,-158,157,89,-100,8,99,-90,89,157,-36,159,37,-93,92,91,-160,36,159,-92,91,92,-11,159,36,-161,160,161,-160,37,159,-162,161,160,-42\n\t\t,101,11,-94,93,161,-102,41,101,-162,161,93,-38,100,41,-161,160,90,-101,9,100,-91,90,160,-37\n\t\tEdges: 0,42,12,42,1,43,12,43,0,44,13,44,2,45,45,13,1,46,14,46,2,47,14,47,0,48\n\t\t,15,48,5,49,15,49,1,50,50,16,5,51,51,16,0,52,52,17,3,53,53,17,3,54,54,18\n\t\t,2,55,18,55,0,56,19,56,4,57,19,57,4,58,20,58,3,59,20,59,4,60,21,60,5,61\n\t\t,21,61,10,62,22,62,5,63,22,63,1,64,23,64,10,65,23,65,1,66,24,66,6,67,24,67\n\t\t,2,68,25,68,6,69,25,69,7,70,26,70,2,71,26,71,7,72,27,72,3,73,27,73,8,74\n\t\t,28,74,3,75,28,75,8,76,29,76,4,77,29,77,9,78,30,78,4,79,30,79,9,80,31,80\n\t\t,5,81,31,81,10,82,32,82,6,83,32,83,7,84,33,84,6,85,33,85,8,86,34,86,7,87\n\t\t,34,87,9,88,35,88,8,89,35,89,9,90,36,90,10,91,36,91,10,92,37,92,11,93,37,93\n\t\t,11,94,38,94,6,95,38,95,11,96,39,96,7,97,39,97,11,98,40,98,8,99,40,99,9,100\n\t\t,41,100,11,101,41,101,12,102,14,102,12,103,13,103,13,104,14,104,12,105,16,105,12,106,15,106\n\t\t,15,107,16,107,13,108,18,108,13,109,17,109,17,110,18,110,17,111,20,111,17,112,19,112,19,113\n\t\t,20,113,19,114,21,114,15,115,19,115,15,116,21,116,16,117,23,117,16,118,22,118,22,119,23,119\n\t\t,14,120,25,120,14,121,24,121,24,122,25,122,18,123,27,123,18,124,26,124,26,125,27,125,20,126\n\t\t,29,126,20,127,28,127,28,128,29,128,21,129,31,129,21,130,30,130,30,131,31,131,23,132,32,132\n\t\t,23,133,24,133,24,134,32,134,25,135,33,135,25,136,26,136,26,137,33,137,27,138,34,138,27,139\n\t\t,28,139,28,140,34,140,29,141,35,141,29,142,30,142,30,143,35,143,31,144,36,144,22,145,31,145\n\t\t,22,146,36,146,32,147,38,147,32,148,37,148,37,149,38,149,33,150,39,150,33,151,38,151,38,152\n\t\t,39,152,34,153,40,153,34,154,39,154,39,155,40,155,35,156,41,156,35,157,40,157,40,158,41,158\n\t\t,36,159,37,159,36,160,41,160,37,161,41,161,46,102,43,46,43,102,102,103,103,104,102,104,45,47\n\t\t,47,104,45,104,44,103,42,103,44,42,50,105,50,43,43,105,105,106,106,107,105,107,51,49,51,107\n\t\t,49,107,48,106,42,106,48,42,55,108,45,55,45,108,108,109,109,110,108,110,54,53,54,110,53,110\n\t\t,52,109,44,109,52,44,59,111,53,59,53,111,111,112,112,113,111,113,57,58,58,113,57,113,56,112\n\t\t,52,112,52,56,60,114,57,60,57,114,114,115,115,116,114,116,49,61,61,116,49,116,48,115,56,115\n\t\t,48,56,64,117,50,64,50,117,117,118,118,119,117,119,62,65,65,119,62,119,63,118,51,118,51,63\n\t\t,68,120,47,68,47,120,120,121,121,122,120,122,67,69,69,122,67,122,66,121,46,121,46,66,73,123\n\t\t,54,73,54,123,123,124,124,125,123,125,70,72,72,125,70,125,71,124,55,124,55,71,77,126,58,77\n\t\t,58,126,126,127,127,128,126,128,74,76,76,128,74,128,75,127,59,127,59,75,81,129,61,81,61,129\n\t\t,129,130,130,131,129,131,78,80,80,131,78,131,79,130,60,130,60,79,82,132,65,82,65,132,132,133\n\t\t,133,134,132,134,67,83,83,134,67,134,66,133,64,133,64,66,85,135,69,85,69,135,135,136,136,137\n\t\t,135,137,70,84,84,137,70,137,71,136,68,136,68,71,87,138,72,87,72,138,138,139,139,140,138,140\n\t\t,74,86,86,140,74,140,75,139,73,139,73,75,89,141,76,89,76,141,141,142,142,143,141,143,78,88\n\t\t,88,143,78,143,79,142,77,142,77,79,90,144,80,90,80,144,144,145,145,146,144,146,62,91,91,146\n\t\t,62,146,63,145,81,145,63,81,95,147,83,95,83,147,147,148,148,149,147,149,93,94,94,149,93,149\n\t\t,92,148,82,148,82,92,97,150,84,97,84,150,150,151,151,152,150,152,94,96,96,152,94,152,95,151\n\t\t,85,151,85,95,99,153,86,99,86,153,153,154,154,155,153,155,96,98,98,155,96,155,97,154,87,154\n\t\t,87,97,100,156,88,100,88,156,156,157,157,158,156,158,98,101,101,158,98,158,99,157,89,157,89,99\n\t\t,92,159,91,92,91,159,159,160,160,161,159,161,93,101,93,161,101,161,100,160,90,160,90,100\n\t\tGeometryVersion: 124\n        LayerElementNormal: 0 {\n            Version: 101\n            Name: \"\"\n            MappingInformationType: \"ByVertice\"\n            ReferenceInformationType: \"Direct\"\n            Normals: 0.000000000000000,0.000000000000000,-0.999969482421875,0.723593831062317,-0.525711834430695,-0.447218239307404\n\t\t\t ,-0.276375621557236,-0.850642442703247,-0.447218239307404,-0.894405961036682,0.000000000000000,-0.447187721729279\n\t\t\t ,-0.276375621557236,0.850642442703247,-0.447218239307404,0.723593831062317,0.525711834430695,-0.447218239307404\n\t\t\t ,0.276375621557236,-0.850642442703247,0.447218239307404,-0.723593831062317,-0.525711834430695,0.447218239307404\n\t\t\t ,-0.723593831062317,0.525711834430695,0.447218239307404,0.276375621557236,0.850642442703247,0.447218239307404\n\t\t\t ,0.894405961036682,0.000000000000000,0.447187721729279,0.000000000000000,0.000000000000000,0.999969482421875\n\t\t\t ,0.425305962562561,-0.308999896049500,-0.850642442703247,-0.162450030446053,-0.499984741210938,-0.850642442703247\n\t\t\t ,0.262855917215347,-0.808984637260437,-0.525711834430695,0.425305962562561,0.308999896049500,-0.850642442703247\n\t\t\t ,0.850642442703247,0.000000000000000,-0.525711834430695,-0.525711834430695,0.000000000000000,-0.850642442703247\n\t\t\t ,-0.688161849975586,-0.499984741210938,-0.525711834430695,-0.162450030446053,0.499984741210938,-0.850642442703247\n\t\t\t ,-0.688161849975586,0.499984741210938,-0.525711834430695,0.262855917215347,0.808984637260437,-0.525711834430695\n\t\t\t ,0.951048314571381,0.308999896049500,0.000000000000000,0.951048314571381,-0.308999896049500,0.000000000000000\n\t\t\t ,0.587755978107452,-0.809015154838562,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000\n\t\t\t ,-0.587755978107452,-0.809015154838562,0.000000000000000,-0.951048314571381,-0.308999896049500,0.000000000000000\n\t\t\t ,-0.951048314571381,0.308999896049500,0.000000000000000,-0.587755978107452,0.809015154838562,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.587755978107452,0.809015154838562,0.000000000000000\n\t\t\t ,0.688161849975586,-0.499984741210938,0.525711834430695,-0.262855917215347,-0.808984637260437,0.525711834430695\n\t\t\t ,-0.850642442703247,0.000000000000000,0.525711834430695,-0.262855917215347,0.808984637260437,0.525711834430695\n\t\t\t ,0.688161849975586,0.499984741210938,0.525711834430695,0.525711834430695,0.000000000000000,0.850642442703247\n\t\t\t ,0.162450030446053,-0.499984741210938,0.850642442703247,-0.425305962562561,-0.308999896049500,0.850642442703247\n\t\t\t ,-0.425305962562561,0.308999896049500,0.850642442703247,0.162450030446053,0.499984741210938,0.850642442703247\n\t\t\t ,0.210730314254761,-0.153080850839615,-0.965453028678894,0.604358017444611,-0.439100325107574,-0.664754152297974\n\t\t\t ,-0.080477312207222,-0.247718736529350,-0.965453028678894,-0.230842009186745,-0.710470914840698,-0.664754152297974\n\t\t\t ,0.523880720138550,-0.686819076538086,-0.503769040107727,-0.020111698657274,-0.863582253456116,-0.503769040107727\n\t\t\t ,0.210730314254761,0.153080850839615,-0.965453028678894,0.604358017444611,0.439100325107574,-0.664754152297974\n\t\t\t ,0.815088331699371,-0.285988956689835,-0.503769040107727,0.815088331699371,0.285988956689835,-0.503769040107727\n\t\t\t ,-0.260475486516953,0.000000000000000,-0.965453028678894,-0.747032046318054,0.000000000000000,-0.664754152297974\n\t\t\t ,-0.827539920806885,-0.247718736529350,-0.503769040107727,-0.491317480802536,-0.710470914840698,-0.503769040107727\n\t\t\t ,-0.080477312207222,0.247718736529350,-0.965453028678894,-0.230842009186745,0.710470914840698,-0.664754152297974\n\t\t\t ,-0.491317480802536,0.710470914840698,-0.503769040107727,-0.827539920806885,0.247718736529350,-0.503769040107727\n\t\t\t ,-0.020111698657274,0.863582253456116,-0.503769040107727,0.523880720138550,0.686819076538086,-0.503769040107727\n\t\t\t ,0.957792878150940,0.153080850839615,0.243263036012650,0.864833533763885,0.439100325107574,-0.243293553590775\n\t\t\t ,0.864833533763885,-0.439100325107574,-0.243293553590775,0.957792878150940,-0.153080850839615,0.243263036012650\n\t\t\t ,0.684865891933441,-0.686819076538086,-0.243293553590775,0.441572308540344,-0.863582253456116,0.243293553590775\n\t\t\t ,-0.150334179401398,-0.958220183849335,-0.243293553590775,0.150334179401398,-0.958220183849335,0.243293553590775\n\t\t\t ,-0.684865891933441,-0.686819076538086,0.243293553590775,-0.441572308540344,-0.863582253456116,-0.243293553590775\n\t\t\t ,-0.864833533763885,-0.439100325107574,0.243293553590775,-0.957792878150940,-0.153080850839615,-0.243263036012650\n\t\t\t ,-0.864833533763885,0.439100325107574,0.243293553590775,-0.957792878150940,0.153080850839615,-0.243263036012650\n\t\t\t ,-0.684865891933441,0.686819076538086,0.243293553590775,-0.441572308540344,0.863582253456116,-0.243293553590775\n\t\t\t ,0.150334179401398,0.958220183849335,0.243293553590775,-0.150334179401398,0.958220183849335,-0.243293553590775\n\t\t\t ,0.441572308540344,0.863582253456116,0.243293553590775,0.684865891933441,0.686819076538086,-0.243293553590775\n\t\t\t ,0.827539920806885,-0.247718736529350,0.503769040107727,0.491317480802536,-0.710470914840698,0.503769040107727\n\t\t\t ,-0.523880720138550,-0.686819076538086,0.503769040107727,0.020111698657274,-0.863582253456116,0.503769040107727\n\t\t\t ,-0.815088331699371,0.285988956689835,0.503769040107727,-0.815088331699371,-0.285988956689835,0.503769040107727\n\t\t\t ,0.020111698657274,0.863582253456116,0.503769040107727,-0.523880720138550,0.686819076538086,0.503769040107727\n\t\t\t ,0.491317480802536,0.710470914840698,0.503769040107727,0.827539920806885,0.247718736529350,0.503769040107727\n\t\t\t ,0.747032046318054,0.000000000000000,0.664754152297974,0.260475486516953,0.000000000000000,0.965453028678894\n\t\t\t ,0.080477312207222,-0.247718736529350,0.965453028678894,0.230842009186745,-0.710470914840698,0.664754152297974\n\t\t\t ,-0.210730314254761,-0.153080850839615,0.965453028678894,-0.604358017444611,-0.439100325107574,0.664754152297974\n\t\t\t ,-0.210730314254761,0.153080850839615,0.965453028678894,-0.604358017444611,0.439100325107574,0.664754152297974\n\t\t\t ,0.230842009186745,0.710470914840698,0.664754152297974,0.080477312207222,0.247718736529350,0.965453028678894\n\t\t\t ,0.350016772747040,-0.587725460529327,-0.729422867298126,0.141788989305496,-0.436445206403732,-0.888454854488373\n\t\t\t ,0.062288276851177,-0.681203663349152,-0.729422867298126,0.667104125022888,-0.151249736547470,-0.729422867298126\n\t\t\t ,0.458906829357147,0.000000000000000,-0.888454854488373,0.667104125022888,0.151249736547470,-0.729422867298126\n\t\t\t ,-0.450788915157318,-0.514481008052826,-0.729422867298126,-0.371257662773132,-0.269722580909729,-0.888454854488373\n\t\t\t ,-0.628620266914368,-0.269722580909729,-0.729422867298126,-0.628620266914368,0.269722580909729,-0.729422867298126\n\t\t\t ,-0.371257662773132,0.269722580909729,-0.888454854488373,-0.450788915157318,0.514481008052826,-0.729422867298126\n\t\t\t ,0.062288276851177,0.681203663349152,-0.729422867298126,0.141788989305496,0.436445206403732,-0.888454854488373\n\t\t\t ,0.350016772747040,0.587725460529327,-0.729422867298126,0.950743138790131,-0.151249736547470,-0.270485550165176\n\t\t\t ,0.950743138790131,0.151249736547470,-0.270485550165176,0.999908447265625,0.000000000000000,-0.013122959062457\n\t\t\t ,0.149937435984612,-0.950956761837006,-0.270485550165176,0.437665939331055,-0.857478559017181,-0.270485550165176\n\t\t\t ,0.308969378471375,-0.950956761837006,-0.013122959062457,-0.858088910579681,-0.436445206403732,-0.270485550165176\n\t\t\t ,-0.680257558822632,-0.681203663349152,-0.270485550165176,-0.808923602104187,-0.587725460529327,-0.013122959062457\n\t\t\t ,-0.680257558822632,0.681203663349152,-0.270485550165176,-0.858088910579681,0.436445206403732,-0.270485550165176\n\t\t\t ,-0.808923602104187,0.587725460529327,-0.013122959062457,0.437665939331055,0.857478559017181,-0.270485550165176\n\t\t\t ,0.149937435984612,0.950956761837006,-0.270485550165176,0.308969378471375,0.950956761837006,-0.013122959062457\n\t\t\t ,0.858088910579681,-0.436445206403732,0.270485550165176,0.808923602104187,-0.587725460529327,0.013122959062457\n\t\t\t ,0.680257558822632,-0.681203663349152,0.270485550165176,-0.149937435984612,-0.950956761837006,0.270485550165176\n\t\t\t ,-0.308969378471375,-0.950956761837006,0.013122959062457,-0.437665939331055,-0.857478559017181,0.270485550165176\n\t\t\t ,-0.950743138790131,-0.151249736547470,0.270485550165176,-0.999908447265625,0.000000000000000,0.013122959062457\n\t\t\t ,-0.950743138790131,0.151249736547470,0.270485550165176,-0.437665939331055,0.857478559017181,0.270485550165176\n\t\t\t ,-0.308969378471375,0.950956761837006,0.013122959062457,-0.149937435984612,0.950956761837006,0.270485550165176\n\t\t\t ,0.680257558822632,0.681203663349152,0.270485550165176,0.808923602104187,0.587725460529327,0.013122959062457\n\t\t\t ,0.858088910579681,0.436445206403732,0.270485550165176,0.450788915157318,-0.514481008052826,0.729422867298126\n\t\t\t ,0.628620266914368,-0.269722580909729,0.729422867298126,0.371257662773132,-0.269722580909729,0.888454854488373\n\t\t\t ,-0.350016772747040,-0.587725460529327,0.729422867298126,-0.062288276851177,-0.681203663349152,0.729422867298126\n\t\t\t ,-0.141788989305496,-0.436445206403732,0.888454854488373,-0.667104125022888,0.151249736547470,0.729422867298126\n\t\t\t ,-0.667104125022888,-0.151249736547470,0.729422867298126,-0.458906829357147,0.000000000000000,0.888454854488373\n\t\t\t ,-0.062288276851177,0.681203663349152,0.729422867298126,-0.350016772747040,0.587725460529327,0.729422867298126\n\t\t\t ,-0.141788989305496,0.436445206403732,0.888454854488373,0.628620266914368,0.269722580909729,0.729422867298126\n\t\t\t ,0.450788915157318,0.514481008052826,0.729422867298126,0.371257662773132,0.269722580909729,0.888454854488373\n\t\t}\n        LayerElementSmoothing: 0 {\n            Version: 102\n            Name: \"\"\n            MappingInformationType: \"ByPolygon\"\n            ReferenceInformationType: \"Direct\"\n            Smoothing: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t}\n        LayerElementSmoothing: 0 {\n            Version: 101\n            Name: \"\"\n            MappingInformationType: \"ByEdge\"\n            ReferenceInformationType: \"Direct\"\n            Smoothing: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVTex\"\n            MappingInformationType: \"ByPolygonVertex\"\n            ReferenceInformationType: \"IndexToDirect\"\n            UV: 0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000\n\t\t\tUVIndex: 0,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\n\t\t\t\t,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109\n\t\t\t\t,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164\n\t\t\t\t,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219\n\t\t\t\t,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274\n\t\t\t\t,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329\n\t\t\t\t,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384\n\t\t\t\t,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439\n\t\t\t\t,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494\n\t\t\t\t,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549\n\t\t\t\t,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604\n\t\t\t\t,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659\n\t\t\t\t,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714\n\t\t\t\t,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769\n\t\t\t\t,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824\n\t\t\t\t,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879\n\t\t\t\t,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934\n\t\t\t\t,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959\n\t\t}\n        LayerElementTexture: 0 {\n            Version: 101\n            Name: \"\"\n            MappingInformationType: \"NoMappingInformation\"\n            ReferenceInformationType: \"IndexToDirect\"\n            BlendMode: \"Translucent\"\n            TextureAlpha: 1\n            TextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n        Layer: 0 {\n            Version: 100\n            LayerElement:  {\n                Type: \"LayerElementNormal\"\n                TypedIndex: 0\n            }\n            LayerElement:  {\n                Type: \"LayerElementMaterial\"\n                TypedIndex: 0\n            }\n            LayerElement:  {\n                Type: \"LayerElementUV\"\n                TypedIndex: 0\n            }\n\t\t}\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,71.299999999999997,287.500000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",10.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",4000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",0\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,71.300000,287.500000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,-4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,-4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,-4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,-4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: -4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tMaterial: \"Material::unnamed\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"phong\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Phong\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",0.5000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2000\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Shininess\", \"double\", \"\",20.0\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n    Pose: \"Pose::BIND_POSES\", \"BindPose\" {\n        Type: \"BindPose\"\n        Version: 100\n        Properties60:  {\n        }\n        NbPoseNodes: 2\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::blend_root\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Icosphere\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-0.000000043711388,-1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,-0.000000043711388,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n    GlobalSettings:  {\n        Version: 1000\n        Properties60:  {\n            Property: \"UpAxis\", \"int\", \"\",1\n            Property: \"UpAxisSign\", \"int\", \"\",1\n            Property: \"FrontAxis\", \"int\", \"\",2\n            Property: \"FrontAxisSign\", \"int\", \"\",1\n            Property: \"CoordAxis\", \"int\", \"\",0\n            Property: \"CoordAxisSign\", \"int\", \"\",1\n            Property: \"UnitScaleFactor\", \"double\", \"\",100\n        }\n    }\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::blend_root\", \"Null\" {\n\t}\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t}\n    Model: \"Model::Producer Perspective\", \"Camera\" {\n    }\n    Model: \"Model::Producer Top\", \"Camera\" {\n    }\n    Model: \"Model::Producer Bottom\", \"Camera\" {\n    }\n    Model: \"Model::Producer Front\", \"Camera\" {\n    }\n    Model: \"Model::Producer Back\", \"Camera\" {\n    }\n    Model: \"Model::Producer Right\", \"Camera\" {\n    }\n    Model: \"Model::Producer Left\", \"Camera\" {\n    }\n    Model: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n    }\n\tMaterial: \"Material::unnamed\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::blend_root\", \"Model::Scene\"\n\tConnect: \"OO\", \"Model::Icosphere\", \"Model::blend_root\"\n\tConnect: \"OO\", \"Material::unnamed\", \"Model::Icosphere\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n\tTake: \"Default Take\" {\n\t\tFileName: \"Default_Take.tak\"\n\t\tLocalTime: 0,479181389250\n\t\tReferenceTime: 0,479181389250\n\n        ;Models animation\n        ;----------------------------------------------------\n\t\tModel: \"Model::Icosphere\" {\n\t\t\tVersion: 1.1\n\t\t\tChannel: \"Transform\" {\n\t\t\t\tChannel: \"T\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 1\n\t\t\t\t}\n\t\t\t\tChannel: \"R\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: -90.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-90.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: -0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 2\n\t\t\t\t}\n\t\t\t\tChannel: \"S\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 3\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFlogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/InternalModels/pointlight.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2014\n\t\tMonth: 02\n\t\tDay: 20\n\t\tHour: 18\n\t\tMinute: 14\n\t\tSecond: 07\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2014-02-20 18:14:07:000\"\nCreator: \"Blender version 2.66 (sub 1)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.000000,-0.000000,-1.050000,0.759788,-0.552012,-0.469580,-0.290207,-0.893182,-0.469581,-0.939147,-0.000000,-0.469576,-0.290207,0.893182,-0.469581,0.759788,0.552012,-0.469580,0.290207,-0.893182,0.469581\n\t\t,-0.759788,-0.552012,0.469580,-0.759788,0.552012,0.469580,0.290207,0.893182,0.469581,0.939147,-0.000000,0.469576,0.000000,-0.000000,1.050000,0.446589,-0.324462,-0.893187,0.276012,-0.849462,-0.552024\n\t\t,-0.170578,-0.524995,-0.893187,0.446589,0.324462,-0.893187,0.893180,-0.000000,-0.552023,-0.722599,-0.524997,-0.552023,-0.552016,-0.000000,-0.893184,-0.722599,0.524997,-0.552023,-0.170578,0.524995,-0.893187\n\t\t,0.276012,0.849462,-0.552024,0.998611,0.324463,-0.000000,0.998611,-0.324463,-0.000000,0.617175,-0.849468,-0.000000,0.000000,-1.050000,-0.000000,-0.617175,-0.849468,-0.000000,-0.998611,-0.324463,-0.000000\n\t\t,-0.998611,0.324463,-0.000000,-0.617175,0.849468,-0.000000,0.000000,1.050000,-0.000000,0.617175,0.849468,-0.000000,0.722599,-0.524997,0.552023,-0.276012,-0.849462,0.552024,-0.893180,-0.000000,0.552023\n\t\t,-0.276012,0.849462,0.552024,0.722599,0.524997,0.552023,0.552016,-0.000000,0.893184,0.170578,-0.524995,0.893187,-0.446589,-0.324462,0.893187,-0.446589,0.324462,0.893187,0.170578,0.524995,0.893187\n\t\tPolygonVertexIndex: 0,12,-15,1,12,-17,0,14,-19,0,18,-21,0,20,-16,1,16,-24,2,13,-26,3,17,-28,4,19,-30,5,21,-32,1,23,-25,2,25,-27,3,27,-29\n\t\t,4,29,-31,5,31,-23,6,32,-39,7,33,-40,8,34,-41,9,35,-42,10,36,-38,14,13,-3,14,12,-14,12,1,-14,16,15,-6,16,12,-16,12,0,-16\n\t\t,18,17,-4,18,14,-18,14,2,-18,20,19,-5,20,18,-20,18,3,-20,15,21,-6,15,20,-22,20,4,-22,23,22,-11,23,16,-23,16,5,-23,25,24,-7\n\t\t,25,13,-25,13,1,-25,27,26,-8,27,17,-27,17,2,-27,29,28,-9,29,19,-29,19,3,-29,31,30,-10,31,21,-31,21,4,-31,24,32,-7,24,23,-33\n\t\t,23,10,-33,26,33,-8,26,25,-34,25,6,-34,28,34,-9,28,27,-35,27,7,-35,30,35,-10,30,29,-36,29,8,-36,22,36,-11,22,31,-37,31,9,-37\n\t\t,38,37,-12,38,32,-38,32,10,-38,39,38,-12,39,33,-39,33,6,-39,40,39,-12,40,34,-40,34,7,-40,41,40,-12,41,35,-41,35,8,-41,37,41,-12\n\t\t,37,36,-42,36,9,-42\n\t\tEdges: \n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByVertice\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.000000000000000,0.000000000000000,-1.000000000000000,0.723593831062317,-0.525711834430695,-0.447187721729279\n\t\t\t ,-0.276375621557236,-0.850642442703247,-0.447218239307404,-0.894405961036682,0.000000000000000,-0.447187721729279\n\t\t\t ,-0.276375621557236,0.850642442703247,-0.447218239307404,0.723593831062317,0.525711834430695,-0.447187721729279\n\t\t\t ,0.276375621557236,-0.850642442703247,0.447218239307404,-0.723593831062317,-0.525711834430695,0.447187721729279\n\t\t\t ,-0.723593831062317,0.525711834430695,0.447187721729279,0.276375621557236,0.850642442703247,0.447218239307404\n\t\t\t ,0.894405961036682,0.000000000000000,0.447187721729279,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t\t ,0.425305962562561,-0.308999896049500,-0.850642442703247,0.262855917215347,-0.808984637260437,-0.525711834430695\n\t\t\t ,-0.162450030446053,-0.499984741210938,-0.850642442703247,0.425305962562561,0.308999896049500,-0.850642442703247\n\t\t\t ,0.850642442703247,0.000000000000000,-0.525711834430695,-0.688161849975586,-0.499984741210938,-0.525711834430695\n\t\t\t ,-0.525711834430695,0.000000000000000,-0.850642442703247,-0.688161849975586,0.499984741210938,-0.525711834430695\n\t\t\t ,-0.162450030446053,0.499984741210938,-0.850642442703247,0.262855917215347,0.808984637260437,-0.525711834430695\n\t\t\t ,0.951048314571381,0.308999896049500,0.000000000000000,0.951048314571381,-0.308999896049500,0.000000000000000\n\t\t\t ,0.587755978107452,-0.809015154838562,0.000000000000000,0.000000000000000,-0.999969482421875,0.000000000000000\n\t\t\t ,-0.587755978107452,-0.809015154838562,0.000000000000000,-0.951048314571381,-0.308999896049500,0.000000000000000\n\t\t\t ,-0.951048314571381,0.308999896049500,0.000000000000000,-0.587755978107452,0.809015154838562,0.000000000000000\n\t\t\t ,0.000000000000000,0.999969482421875,0.000000000000000,0.587755978107452,0.809015154838562,0.000000000000000\n\t\t\t ,0.688161849975586,-0.499984741210938,0.525711834430695,-0.262855917215347,-0.808984637260437,0.525711834430695\n\t\t\t ,-0.850642442703247,0.000000000000000,0.525711834430695,-0.262855917215347,0.808984637260437,0.525711834430695\n\t\t\t ,0.688161849975586,0.499984741210938,0.525711834430695,0.525711834430695,0.000000000000000,0.850642442703247\n\t\t\t ,0.162450030446053,-0.499984741210938,0.850642442703247,-0.425305962562561,-0.308999896049500,0.850642442703247\n\t\t\t ,-0.425305962562561,0.308999896049500,0.850642442703247,0.162450030446053,0.499984741210938,0.850642442703247\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVTex\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000\n\t\t\t ,0.000000,0.000000,0.000000,0.000000\n\t\t\tUVIndex: 0,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\n\t\t\t\t,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109\n\t\t\t\t,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164\n\t\t\t\t,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219\n\t\t\t\t,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tMaterial: \"Material::unnamed\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"phong\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Phong\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",0.5000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2000\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Shininess\", \"double\", \"\",20.0\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Icosphere\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::unnamed\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Icosphere\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::unnamed\", \"Model::Icosphere\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/InternalModels/skybox.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2014\n\t\tMonth: 08\n\t\tDay: 05\n\t\tHour: 13\n\t\tMinute: 21\n\t\tSecond: 50\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2014-08-05 13:21:50:000\"\nCreator: \"Blender version 2.70 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Sphere\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-90.000009334538021,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 1.000000,1.000000,1.000000,1.000000,1.000000,-1.000000,-1.000000,1.000000,-1.000000,-1.000000,1.000000,1.000000,\n\t\t          1.000000,-1.000000,1.000000,0.999999,-1.000000,-1.000000,-1.000000,-1.000000,-1.000000,-1.000000,-1.000000,1.000000\n\t\tPolygonVertexIndex: 0,3,2,-2,4,5,6,-8,0,1,5,-5,1,2,6,-6,2,3,7,-7,3,0,4,-8\n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: -0.000000,-1.000000,0.000000,-0.000000,-1.000000,0.000000,-0.000000,-1.000000,0.000000,-0.000000,-1.000000,0.000000,\n\t\t\t         -0.000000,1.000000,-0.000000,-0.000000,1.000000,-0.000000,-0.000000,1.000000,-0.000000,-0.000000,1.000000,-0.000000,\n\t\t\t         -1.000000,0.000000,0.000000,-1.000000,0.000000,0.000000,-1.000000,0.000000,0.000000,-1.000000,0.000000,0.000000,\n\t\t\t         0.000000,-0.000000,1.000000,0.000000,-0.000000,1.000000,0.000000,-0.000000,1.000000,0.000000,-0.000000,1.000000,\n\t\t\t         1.000000,-0.000000,-0.000000,1.000000,-0.000000,-0.000000,1.000000,-0.000000,-0.000000,1.000000,-0.000000,-0.000000,\n\t\t\t         -0.000000,0.000000,-1.000000,-0.000000,0.000000,-1.000000,-0.000000,0.000000,-1.000000,-0.000000,0.000000,-1.000000\n\t\t}\n\t\tLayerElementSmoothing: 0 {\n\t\t\tVersion: 102\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygon\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tSmoothing: 0,0,0,0,0,0\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVTex\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: -0.000030,0.500009,0.750039,1.000082,0.499512,0.498047,0.249985,0.500009,0.249985,1.000038,0.750039,0.500052,\n\t\t\t    0.249023,0.498047,0.249986,0.500010,0.750038,0.500047,0.500001,0.500010,1.000053,1.000077,0.500023,0.500052,\n\t\t\t    -0.000030,1.000038,0.000000,0.000000,0.000000,0.498047,1.000053,0.500047,0.249986,1.000040,0.500001,1.000040,\n\t\t\t    0.750038,1.000077,0.499512,0.000000,0.500023,1.000082,0.250488,0.000000,0.249023,0.000000,0.250488,0.498047\n\t\t\tUVIndex: 14,6,22,13,21,23,2,19,18,10,15,8,12,4,3,0,16,17,9,7,20,1,5,11\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementSmoothing\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementTexture\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Sphere\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Sphere\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Sphere\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Sphere\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/InternalModels/spotlight.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2014\n\t\tMonth: 02\n\t\tDay: 20\n\t\tHour: 17\n\t\tMinute: 42\n\t\tSecond: 50\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2014-02-20 17:42:50:000\"\nCreator: \"Blender version 2.66 (sub 1)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-90.000009334538021,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: -1.000424,1.000424,0.998504,-1.000424,-1.000424,0.998503,1.000424,-1.000424,0.998503,1.000424,1.000424,0.998503,-0.000000,0.000000,-0.001497\n\t\tPolygonVertexIndex: 4,0,-2,4,1,-3,4,2,-4,3,0,-5,1,0,3,-3\n\t\tEdges: \n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByVertice\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.689107954502106,-0.689107954502106,-0.224097415804863,0.689107954502106,0.689107954502106,-0.224097415804863\n\t\t\t ,-0.689107954502106,0.689107954502106,-0.224097415804863,-0.689107954502106,-0.689107954502106,-0.224097415804863\n\t\t\t ,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t\tLayerElementSmoothing: 0 {\n\t\t\tVersion: 102\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygon\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tSmoothing: 0,0,0,0,0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementSmoothing\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tMaterial: \"Material::unnamed\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"phong\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Phong\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",0.5000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2000\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Shininess\", \"double\", \"\",20.0\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Icosphere\"\n\t\t\tMatrix: 0.000000075497901,0.000000000000000,-1.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,-0.000000075497901,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::unnamed\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Icosphere\", \"Model::Scene\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n\tTake: \"Default Take\" {\n\t\tFileName: \"Default_Take.tak\"\n\t\tLocalTime: 0,479181389250\n\t\tReferenceTime: 0,479181389250\n\n\t\t;Models animation\n\t\t;----------------------------------------------------\n\t\tModel: \"Model::Icosphere\" {\n\t\t\tVersion: 1.1\n\t\t\tChannel: \"Transform\" {\n\t\t\t\tChannel: \"T\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 1\n\t\t\t\t}\n\t\t\t\tChannel: \"R\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: -90.000002504348856\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-90.000002504348856,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: -0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 2\n\t\t\t\t}\n\t\t\t\tChannel: \"S\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 3\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Models/.gitignore",
    "content": "\n*.blend1\n*.blend2"
  },
  {
    "path": "Lemma/Content/Models/joan-firstperson.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2015\n\t\tMonth: 01\n\t\tDay: 14\n\t\tHour: 20\n\t\tMinute: 48\n\t\tSecond: 18\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2015-01-14 20:48:18:000\"\nCreator: \"Blender version 2.70 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 138\n\tObjectType: \"Model\" {\n\t\tCount: 68\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 2\n\t}\n\tObjectType: \"Texture\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Video\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Deformer\" {\n\t\tCount: 66\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::rig\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-90.000009334538021,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::testBody_000\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 1.144554,-0.687734,2.297113,1.166638,-0.664973,2.276405,1.172610,-0.676795,2.288699,1.160645,-0.687098,2.299720,\n\t\t          1.160666,-0.663598,2.324450,1.175176,-0.650976,2.313040,1.170311,-0.641104,2.298058,1.145786,-0.665999,2.320018,\n\t\t          1.140532,-0.644798,2.336027,1.165550,-0.616968,2.314969,1.169593,-0.627435,2.327570,1.157095,-0.631581,2.346206,\n\t\t          1.168465,-0.616229,2.335062,1.162451,-0.604694,2.313983,1.137843,-0.633859,2.345078,1.157751,-0.642766,2.337750,\n\t\t          1.140183,-0.664829,2.317453,1.139279,-0.686010,2.293562,1.156130,-0.599564,2.310453,1.158798,-0.615080,2.310987,\n\t\t          1.161179,-0.638313,2.292516,1.160152,-0.661587,2.273038,1.129674,-0.630698,2.339700,1.134046,-0.642643,2.332065,\n\t\t          1.149357,-0.731737,2.252043,1.159639,-0.720655,2.263618,1.148618,-0.737340,2.242274,1.170722,-0.717494,2.238046,\n\t\t          1.170147,-0.723097,2.230021,1.156951,-0.736478,2.227148,1.170168,-0.712958,2.255942,1.166125,-0.716775,2.261750,\n\t\t          1.160255,-0.737197,2.229282,1.164708,-0.717843,2.259247,1.152189,-0.738941,2.241349,1.170189,-0.726422,2.230247,\n\t\t          1.168444,-0.714271,2.252966,1.169840,-0.720716,2.237552,1.152107,-0.733359,2.249990,1.169327,-0.683260,2.296621,\n\t\t          1.171769,-0.657708,2.320756,1.165304,-0.625177,2.342040,1.166679,-0.636466,2.334487,1.158080,-0.722091,2.260293,\n\t\t          1.137843,-0.666943,2.277246,1.139875,-0.648862,2.295922,1.132692,-0.606336,2.320593,1.133389,-0.622694,2.312137,\n\t\t          1.160173,-0.718130,2.267620,1.146011,-0.724985,2.258158,1.168834,-0.708956,2.239359,1.171009,-0.710742,2.258118,\n\t\t          1.165632,-0.712753,2.231786,1.143795,-0.727551,2.252002,1.166966,-0.714436,2.264973,1.146873,-0.728864,2.227229,\n\t\t          1.140696,-0.704687,2.244983,1.168136,-0.708586,2.272176,1.140039,-0.712219,2.265630,1.160440,-0.694117,2.244983,\n\t\t          1.171646,-0.703435,2.265527,1.166145,-0.694507,2.249764,1.142522,-0.712301,2.269591,1.159434,-0.712589,2.274845,\n\t\t          1.167336,-0.625608,2.310597,1.170106,-0.636486,2.322706,1.157936,-0.648862,2.333461,1.159968,-0.624418,2.305774,\n\t\t          1.137001,-0.650565,2.327222,1.142482,-0.651633,2.330649,1.168198,-0.643649,2.330465,1.135545,-0.633469,2.305815,\n\t\t          1.171748,-0.662818,2.316036,1.161056,-0.642069,2.289642,1.177331,-0.654937,2.307396,1.170332,-0.644449,2.294588,\n\t\t          1.138890,-0.654034,2.289704,1.171605,-0.668196,2.310638,1.139813,-0.672198,2.309387,1.160501,-0.645496,2.286666,\n\t\t          1.159618,-0.706801,2.281145,1.143240,-0.703948,2.278190,1.166043,-0.685087,2.259759,1.172528,-0.697668,2.271993,\n\t\t          1.159414,-0.682747,2.257153,1.140470,-0.701998,2.276220,1.168485,-0.703107,2.278169,1.141250,-0.689171,2.260766,\n\t\t          1.138644,-0.656517,2.286276,1.139300,-0.675995,2.304501,1.161445,-0.680284,2.308606,1.143877,-0.679012,2.306247,\n\t\t          1.176695,-0.660048,2.302141,1.161466,-0.674845,2.314497,1.169716,-0.648226,2.290853,1.145108,-0.674414,2.311932,\n\t\t          1.169039,-0.653357,2.286544,1.174868,-0.666020,2.296826,1.171051,-0.675358,2.304871,1.160152,-0.650299,2.282048,\n\t\t          1.139834,-0.661197,2.320531,1.145047,-0.661833,2.323323,1.170538,-0.652638,2.324553,1.138459,-0.644408,2.297770,\n\t\t          1.139259,-0.651818,2.293254,1.139854,-0.668852,2.312752,1.145950,-0.670515,2.316098,1.160994,-0.670063,2.320634,\n\t\t          1.169737,-0.635213,2.302839,1.172549,-0.645229,2.316755,1.160050,-0.658960,2.327283,1.161363,-0.632853,2.296846,\n\t\t          1.159618,-0.698755,2.287898,1.166904,-0.678847,2.265773,1.159537,-0.676980,2.261566,1.168054,-0.695102,2.284861,\n\t\t          1.141250,-0.682911,2.265588,1.144267,-0.698715,2.284573,1.171933,-0.689315,2.278580,1.140737,-0.697134,2.281884,\n\t\t          1.159618,-0.703373,2.283957,1.166700,-0.681926,2.262510,1.159721,-0.679525,2.259226,1.168403,-0.700049,2.280735,\n\t\t          1.141599,-0.686133,2.263721,1.143959,-0.701444,2.281392,1.172241,-0.694076,2.275317,1.140676,-0.699782,2.278683,\n\t\t          1.141845,-0.718253,2.233078,1.141086,-0.717945,2.259759,1.171297,-0.706822,2.261196,1.162164,-0.702614,2.238251,\n\t\t          1.167582,-0.701259,2.244346,1.167767,-0.711316,2.268400,1.159701,-0.715421,2.271294,1.143015,-0.717617,2.263782,\n\t\t          1.134046,-0.673655,2.282664,1.135134,-0.656579,2.304564,1.127130,-0.617543,2.325579,1.128607,-0.631560,2.318828,\n\t\t          1.151943,-0.739044,2.232586,1.154529,-0.740563,2.234146,1.142707,-0.731779,2.235233,1.137371,-0.708156,2.251447,\n\t\t          1.131050,-0.642315,2.314230,1.134354,-0.662161,2.298098,1.133738,-0.665753,2.293398,1.137987,-0.694076,2.265732,\n\t\t          1.133903,-0.652967,2.306698,1.135011,-0.659904,2.301669,1.137268,-0.687570,2.271622,1.138274,-0.691347,2.269550,\n\t\t          1.138561,-0.719546,2.242643,1.148166,-0.681926,2.259904,1.147756,-0.678519,2.261792,1.149008,-0.645619,2.289971,\n\t\t          1.146176,-0.637594,2.294917,1.150527,-0.711398,2.229918,1.144924,-0.627558,2.302285,1.157361,-0.722256,2.224171,\n\t\t          1.165263,-0.732271,2.226984,1.142358,-0.617460,2.309243,1.147859,-0.684922,2.257030,1.148208,-0.648513,2.286256,\n\t\t          1.148166,-0.699412,2.241391,1.148105,-0.651530,2.282459,1.140162,-0.593694,2.311829,1.148187,-0.642458,2.292413,\n\t\t          1.147120,-0.662428,2.271725,1.164442,-0.730670,2.224972,1.162615,-0.717063,2.258076,1.161260,-0.737340,2.231642,\n\t\t          1.153770,-0.737915,2.240324,1.167746,-0.727386,2.230821,1.166843,-0.714682,2.252166,1.167418,-0.722132,2.236916,\n\t\t          1.152764,-0.732599,2.247733,1.157977,-0.721435,2.258220,1.156376,-0.738859,2.235295,1.166125,-0.732107,2.229425,\n\t\t          1.163334,-0.730116,2.242664,1.162348,-0.734693,2.236239,1.159763,-0.687037,2.252227,1.165899,-0.688494,2.256126,\n\t\t          1.140676,-0.693563,2.255778,1.159495,-0.709305,2.278149,1.171872,-0.700377,2.269200,1.168341,-0.705857,2.275378,\n\t\t          1.139813,-0.705549,2.271827,1.142646,-0.706822,2.274885,1.137535,-0.698058,2.259801,1.147325,-0.689315,2.251715,\n\t\t          1.196028,-0.654116,2.235645,1.214746,-0.626922,2.220477,1.220780,-0.638272,2.232237,1.209020,-0.652495,2.237491,\n\t\t          1.205695,-0.631047,2.273901,1.219651,-0.613602,2.266491,1.212920,-0.600590,2.253069,1.191657,-0.632156,2.270104,\n\t\t          1.177002,-0.609477,2.293233,1.201262,-0.579717,2.277081,1.209923,-0.590389,2.294547,1.189584,-0.594043,2.317041,\n\t\t          1.207932,-0.574607,2.309016,1.191657,-0.564714,2.291858,1.165632,-0.598271,2.310043,1.195535,-0.605864,2.299371,\n\t\t          1.186239,-0.630267,2.267764,1.190692,-0.653131,2.232237,1.185499,-0.561738,2.284860,1.193360,-0.576536,2.271416,\n\t\t          1.206290,-0.598127,2.248267,1.206331,-0.624008,2.215223,1.159865,-0.594453,2.306061,1.170846,-0.605331,2.288985,\n\t\t          1.213514,-0.689151,2.190306,1.217352,-0.678581,2.199789,1.214438,-0.693727,2.182713,1.227491,-0.667477,2.180804,\n\t\t          1.228168,-0.672608,2.170419,1.221806,-0.689089,2.165103,1.226116,-0.666102,2.193878,1.222545,-0.671459,2.199276,\n\t\t          1.224638,-0.689130,2.168120,1.221416,-0.672382,2.196320,1.217208,-0.693543,2.182077,1.228764,-0.675810,2.171671,\n\t\t          1.224371,-0.668155,2.192256,1.227963,-0.670535,2.179511,1.214725,-0.689253,2.189158,1.218359,-0.645742,2.237244,\n\t\t          1.215813,-0.623064,2.272423,1.202760,-0.587475,2.313594,1.205346,-0.599297,2.300028,1.216675,-0.678909,2.196751,\n\t\t          1.188558,-0.635583,2.218527,1.181456,-0.611221,2.251427,1.155330,-0.568532,2.285455,1.169286,-0.587434,2.272299,\n\t\t          1.217352,-0.676836,2.203483,1.209656,-0.685969,2.195294,1.226690,-0.662121,2.182938,1.226403,-0.664173,2.196280,\n\t\t          1.224659,-0.665056,2.173744,1.207583,-0.691162,2.185832,1.223202,-0.670166,2.201780,1.210723,-0.684019,2.162723,\n\t\t          1.196541,-0.661710,2.184684,1.222976,-0.666266,2.208204,1.201302,-0.675974,2.203873,1.214971,-0.649232,2.187742,\n\t\t          1.226095,-0.659227,2.203483,1.221642,-0.649847,2.193139,1.205469,-0.676282,2.206952,1.215793,-0.672547,2.210523,\n\t\t          1.203602,-0.584027,2.272073,1.212078,-0.596793,2.287241,1.197321,-0.612145,2.292166,1.196254,-0.581400,2.265712,\n\t\t          1.174806,-0.612330,2.283403,1.181087,-0.614710,2.288123,1.207891,-0.605762,2.292269,1.172097,-0.594310,2.267209,\n\t\t          1.216162,-0.628051,2.265609,1.206864,-0.601165,2.244305,1.219795,-0.619390,2.259062,1.213740,-0.604920,2.248451,\n\t\t          1.181579,-0.618323,2.242438,1.216060,-0.634352,2.255060,1.188475,-0.639072,2.256311,1.207049,-0.606829,2.237573,\n\t\t          1.213206,-0.668832,2.216557,1.203088,-0.669591,2.215675,1.219713,-0.643054,2.201903,1.224864,-0.653234,2.209846,\n\t\t          1.212222,-0.640365,2.197346,1.198491,-0.668216,2.214053,1.222381,-0.661956,2.215325,1.193258,-0.650791,2.199522,\n\t\t          1.185027,-0.627168,2.229630,1.188701,-0.644962,2.244983,1.207049,-0.644449,2.249190,1.193524,-0.646461,2.246851,\n\t\t          1.219405,-0.625793,2.250421,1.206947,-0.639051,2.257092,1.213761,-0.611344,2.241863,1.193729,-0.640139,2.257297,\n\t\t          1.213699,-0.618220,2.232669,1.219549,-0.631499,2.242725,1.216860,-0.638990,2.247650,1.205059,-0.615285,2.226224,\n\t\t          1.184843,-0.627312,2.271397,1.190425,-0.628318,2.274495,1.213699,-0.617994,2.278641,1.179896,-0.608122,2.254198,\n\t\t          1.181559,-0.614177,2.247363,1.187182,-0.633510,2.263639,1.192950,-0.635522,2.265322,1.205715,-0.634660,2.266902,\n\t\t          1.211483,-0.596978,2.258015,1.217332,-0.608635,2.272340,1.203048,-0.625855,2.278580,1.204607,-0.594761,2.252186,\n\t\t          1.211503,-0.662798,2.225649,1.218132,-0.637143,2.209455,1.211134,-0.634290,2.204366,1.221088,-0.655286,2.224910,\n\t\t          1.193873,-0.645886,2.207896,1.200687,-0.663619,2.223740,1.223243,-0.646912,2.219450,1.196623,-0.662880,2.220724,\n\t\t          1.212283,-0.666082,2.220909,1.219036,-0.640345,2.205638,1.211667,-0.637574,2.201164,1.222340,-0.658488,2.220477,\n\t\t          1.193421,-0.648513,2.203709,1.201816,-0.666410,2.219985,1.224721,-0.649868,2.214771,1.197383,-0.665343,2.217419,\n\t\t          1.200769,-0.673039,2.170830,1.203889,-0.683240,2.194945,1.226095,-0.662203,2.198312,1.219487,-0.657934,2.178588,\n\t\t          1.224638,-0.656641,2.186449,1.222791,-0.668914,2.203361,1.216490,-0.675461,2.205762,1.207871,-0.681516,2.201000,\n\t\t          1.186198,-0.643054,2.222119,1.180553,-0.620621,2.257687,1.147222,-0.579861,2.300376,1.166884,-0.596116,2.279134,\n\t\t          1.217763,-0.694610,2.171364,1.220677,-0.693789,2.172369,1.206434,-0.691285,2.170419,1.194078,-0.669448,2.191251,\n\t\t          1.169881,-0.603545,2.273654,1.180081,-0.626881,2.248595,1.182421,-0.635316,2.235193,1.191020,-0.658878,2.204859,\n\t\t          1.178419,-0.618076,2.261175,1.180348,-0.624336,2.254034,1.191513,-0.653603,2.213274,1.191123,-0.655922,2.208758,\n\t\t          1.198080,-0.680161,2.177582,1.199189,-0.642315,2.200425,1.199230,-0.639852,2.204489,1.188701,-0.606316,2.243340,\n\t\t          1.187039,-0.600611,2.250010,1.207275,-0.664563,2.170460,1.180594,-0.586572,2.263515,1.216408,-0.675317,2.161348,\n\t\t          1.227204,-0.682932,2.166930,1.177023,-0.580743,2.270288,1.199209,-0.644532,2.196362,1.188804,-0.610585,2.236979,\n\t\t          1.203088,-0.654650,2.182754,1.191041,-0.619657,2.225710,1.170476,-0.557161,2.284675,1.188948,-0.603381,2.247117,\n\t\t          1.193873,-0.628974,2.215100,1.225295,-0.681536,2.163565,1.220574,-0.673183,2.194883,1.225069,-0.688596,2.170686,\n\t\t          1.218132,-0.692475,2.179491,1.228045,-0.677370,2.171897,1.223304,-0.668442,2.191580,1.226711,-0.673060,2.179121,\n\t\t          1.216265,-0.687940,2.186715,1.216572,-0.678458,2.195601,1.221847,-0.691695,2.172739,1.226526,-0.683506,2.168448,\n\t\t          1.222996,-0.680941,2.183062,1.224392,-0.685620,2.176371,1.213145,-0.643403,2.193756,1.220369,-0.645681,2.198413,\n\t\t          1.193873,-0.654342,2.194453,1.214561,-0.670433,2.213786,1.225398,-0.655943,2.207075,1.222463,-0.664132,2.211570,\n\t\t          1.200071,-0.671315,2.210625,1.204053,-0.672321,2.212391,1.191636,-0.662326,2.199932,1.199763,-0.648041,2.191559,\n\t\t          1.225747,-0.589835,2.228193,1.239867,-0.562395,2.216926,1.245121,-0.570112,2.223432,1.237261,-0.585402,2.229959,\n\t\t          1.230365,-0.570358,2.263003,1.239293,-0.553795,2.256066,1.234633,-0.544724,2.247487,1.217763,-0.575756,2.259473,\n\t\t          1.203642,-0.563031,2.279873,1.221355,-0.528797,2.269550,1.228292,-0.539880,2.282767,1.211627,-0.551907,2.298632,\n\t\t          1.225972,-0.531219,2.295799,1.205531,-0.514123,2.279586,1.195433,-0.556648,2.289232,1.217045,-0.556361,2.286194,\n\t\t          1.211565,-0.573950,2.256045,1.219056,-0.588973,2.225156,1.201016,-0.513959,2.270534,1.215320,-0.527299,2.263125,\n\t\t          1.228046,-0.540948,2.242171,1.233156,-0.559111,2.212020,1.189091,-0.557551,2.283793,1.198778,-0.561328,2.274414,\n\t\t          1.246866,-0.622078,2.167957,1.248775,-0.609395,2.181419,1.245984,-0.625280,2.159070,1.256923,-0.598045,2.158495,\n\t\t          1.257517,-0.602006,2.150675,1.249678,-0.615819,2.146160,1.254316,-0.596403,2.175837,1.252777,-0.601924,2.181091,\n\t\t          1.254152,-0.617850,2.147433,1.252305,-0.603094,2.178772,1.249821,-0.624582,2.157592,1.259365,-0.605228,2.151845,\n\t\t          1.254152,-0.598045,2.173867,1.259221,-0.601041,2.157448,1.249185,-0.622489,2.165843,1.244670,-0.577952,2.228296,\n\t\t          1.237897,-0.561861,2.260991,1.221519,-0.542466,2.298118,1.224946,-0.548972,2.286297,1.248262,-0.610010,2.178792,\n\t\t          1.213884,-0.568963,2.213314,1.205038,-0.552256,2.241781,1.181600,-0.529885,2.272710,1.192006,-0.540147,2.260930,\n\t\t          1.248405,-0.608184,2.184621,1.240955,-0.619082,2.172985,1.254234,-0.592893,2.163318,1.254747,-0.594761,2.178382,\n\t\t          1.252243,-0.594309,2.156032,1.238225,-0.621668,2.165864,1.253043,-0.600713,2.184417,1.239231,-0.609743,2.148849,\n\t\t          1.225562,-0.591723,2.172657,1.252243,-0.595705,2.192831,1.228456,-0.609210,2.186961,1.243213,-0.581072,2.175612,\n\t\t          1.252612,-0.588994,2.187885,1.248590,-0.582611,2.179901,1.233894,-0.609292,2.191210,1.245963,-0.602293,2.194883,\n\t\t          1.225316,-0.534277,2.264480,1.230878,-0.543985,2.275235,1.220390,-0.559542,2.279770,1.218810,-0.530993,2.258837,\n\t\t          1.202431,-0.564365,2.271438,1.208506,-0.566356,2.275645,1.227717,-0.551640,2.279873,1.194817,-0.542179,2.256538,\n\t\t          1.239990,-0.564468,2.255963,1.228764,-0.542651,2.238168,1.241448,-0.556792,2.250996,1.236234,-0.546612,2.242560,\n\t\t          1.207706,-0.555889,2.235890,1.240544,-0.566541,2.250339,1.213617,-0.578055,2.248718,1.229113,-0.545114,2.233714,\n\t\t          1.243787,-0.598927,2.203565,1.231699,-0.603730,2.201430,1.245634,-0.575920,2.191517,1.251504,-0.584171,2.197388,\n\t\t          1.238308,-0.573498,2.188071,1.225152,-0.602704,2.198948,1.250642,-0.591169,2.201185,1.222956,-0.581646,2.190881,\n\t\t          1.208219,-0.557572,2.233160,1.214212,-0.580128,2.244140,1.234613,-0.576741,2.247548,1.220328,-0.581770,2.246850,\n\t\t          1.241653,-0.559665,2.245803,1.234223,-0.574401,2.253499,1.236891,-0.549465,2.237922,1.219795,-0.579553,2.251981,\n\t\t          1.236850,-0.551989,2.233099,1.242022,-0.562005,2.240098,1.241242,-0.569168,2.244818,1.229933,-0.546961,2.230144,\n\t\t          1.210148,-0.571877,2.260211,1.216408,-0.573129,2.264132,1.235167,-0.559522,2.265979,1.203191,-0.549650,2.244079,\n\t\t          1.206557,-0.554165,2.240282,1.212632,-0.575510,2.253233,1.218768,-0.577665,2.256209,1.232848,-0.572554,2.259103,\n\t\t          1.232027,-0.542302,2.253336,1.236933,-0.551353,2.261012,1.227573,-0.567362,2.266696,1.225808,-0.538751,2.247117,\n\t\t          1.240401,-0.593735,2.213355,1.243787,-0.570543,2.201923,1.237692,-0.568244,2.196957,1.248015,-0.584602,2.211898,\n\t\t          1.219528,-0.576721,2.197962,1.230016,-0.598435,2.211673,1.247749,-0.577172,2.208450,1.223571,-0.597840,2.209353,\n\t\t          1.241837,-0.596731,2.207978,1.244855,-0.573621,2.196505,1.238225,-0.571200,2.191908,1.249103,-0.588440,2.206192,\n\t\t          1.221745,-0.579799,2.193631,1.231062,-0.601616,2.205987,1.249554,-0.580702,2.201718,1.224741,-0.600549,2.203525,\n\t\t          1.230714,-0.601267,2.158577,1.232868,-0.615121,2.175591,1.254152,-0.592647,2.183001,1.248385,-0.588706,2.164077,\n\t\t          1.252530,-0.588419,2.170830,1.252612,-0.598353,2.188480,1.247399,-0.605515,2.189630,1.238082,-0.614382,2.182118,\n\t\t          1.212160,-0.577603,2.216987,1.204279,-0.562949,2.247158,1.180738,-0.545606,2.280468,1.191000,-0.550532,2.265280,\n\t\t          1.246476,-0.621483,2.149567,1.251587,-0.621955,2.149937,1.236789,-0.616434,2.153158,1.222976,-0.599769,2.176864,\n\t\t          1.194120,-0.552708,2.260970,1.206885,-0.566274,2.241001,1.207008,-0.568183,2.237265,1.220144,-0.590574,2.193756,\n\t\t          1.201877,-0.560445,2.249908,1.205962,-0.564653,2.245249,1.216839,-0.585135,2.201307,1.219322,-0.588727,2.197182,\n\t\t          1.228312,-0.608327,2.163688,1.227183,-0.573888,2.191805,1.225623,-0.570522,2.195355,1.213494,-0.544806,2.238066,\n\t\t          1.210333,-0.541481,2.242458,1.236686,-0.594494,2.156791,1.203048,-0.534277,2.254238,1.243541,-0.602827,2.147268,\n\t\t          1.257456,-0.613191,2.146242,1.199969,-0.531383,2.258693,1.228887,-0.575838,2.188111,1.215156,-0.547064,2.234577,\n\t\t          1.231575,-0.585258,2.170850,1.215526,-0.549301,2.230862,1.186649,-0.513938,2.270617,1.212386,-0.543308,2.240180,\n\t\t          1.220903,-0.561102,2.210666,1.253988,-0.610585,2.144908,1.250149,-0.603401,2.176864,1.254849,-0.617070,2.150285,\n\t\t          1.250683,-0.622263,2.159213,1.259139,-0.607322,2.152871,1.253372,-0.598989,2.172595,1.258852,-0.603053,2.158085,\n\t\t          1.249657,-0.620416,2.165042,1.247728,-0.610051,2.177356,1.252612,-0.620559,2.151804,1.256799,-0.613130,2.149013,\n\t\t          1.255773,-0.612802,2.161471,1.256615,-0.615162,2.157079,1.239600,-0.575818,2.183862,1.246558,-0.578301,2.186694,\n\t\t          1.223017,-0.583965,2.185257,1.244896,-0.600672,2.199399,1.252079,-0.586531,2.192873,1.251463,-0.593653,2.197018,\n\t\t          1.226013,-0.604961,2.194576,1.232499,-0.606213,2.197223,1.220246,-0.593242,2.188788,1.229790,-0.577583,2.183616,\n\t\t          1.223571,-0.521552,2.228543,1.231699,-0.495877,2.220292,1.239005,-0.503840,2.226470,1.235845,-0.514882,2.228994,\n\t\t          1.233320,-0.506426,2.254731,1.236891,-0.494379,2.250607,1.228107,-0.486970,2.240488,1.219446,-0.516052,2.251673,\n\t\t          1.211503,-0.508992,2.270946,1.220328,-0.478699,2.258672,1.228620,-0.486826,2.270534,1.221539,-0.494091,2.291797,\n\t\t          1.223469,-0.481120,2.286235,1.214541,-0.471885,2.269017,1.207748,-0.507350,2.280324,1.225193,-0.498525,2.276568,\n\t\t          1.213453,-0.514328,2.248328,1.218399,-0.521060,2.226921,1.207275,-0.472603,2.262223,1.213617,-0.477939,2.253746,\n\t\t          1.220965,-0.485451,2.236670,1.226465,-0.494235,2.217501,1.203048,-0.508520,2.272259,1.205982,-0.509135,2.267518,\n\t\t          1.235167,-0.535858,2.185442,1.238779,-0.528572,2.191641,1.234982,-0.537233,2.180866,1.241776,-0.517366,2.176433,\n\t\t          1.241591,-0.518802,2.172225,1.239580,-0.530706,2.168265,1.241427,-0.518741,2.186407,1.240565,-0.523112,2.190163,\n\t\t          1.241714,-0.530809,2.169722,1.240647,-0.523769,2.188850,1.237240,-0.537151,2.180086,1.243130,-0.520506,2.172636,\n\t\t          1.241714,-0.518884,2.185524,1.243192,-0.518946,2.176453,1.237363,-0.535550,2.184232,1.239375,-0.509874,2.228543,\n\t\t          1.236830,-0.500372,2.253849,1.224577,-0.487154,2.289910,1.227758,-0.492675,2.274784,1.238943,-0.528818,2.190184,\n\t\t          1.212529,-0.503471,2.218240,1.206783,-0.497109,2.238230,1.195864,-0.489453,2.263351,1.200215,-0.491793,2.255738,\n\t\t          1.238595,-0.527710,2.194576,1.232109,-0.534298,2.189487,1.240052,-0.514061,2.178710,1.241324,-0.517099,2.188993,\n\t\t          1.239087,-0.515108,2.174134,1.230590,-0.535673,2.184581,1.240668,-0.522086,2.192606,1.231001,-0.527997,2.167484,\n\t\t          1.217866,-0.515580,2.189014,1.242084,-0.518741,2.202335,1.224413,-0.529906,2.199665,1.232889,-0.504723,2.190800,\n\t\t          1.242269,-0.512666,2.198927,1.237117,-0.505462,2.193200,1.228846,-0.529926,2.202415,1.239005,-0.524857,2.203545,\n\t\t          1.222299,-0.481141,2.254136,1.230078,-0.488673,2.264152,1.227204,-0.500536,2.269385,1.215793,-0.479827,2.250298,\n\t\t          1.207234,-0.509505,2.262552,1.213022,-0.510079,2.265917,1.230180,-0.495159,2.268092,1.202145,-0.492080,2.251673,\n\t\t          1.237466,-0.502486,2.248471,1.222524,-0.487503,2.232381,1.237486,-0.496657,2.245680,1.229174,-0.489166,2.236321,\n\t\t          1.209225,-0.500126,2.229589,1.237815,-0.504990,2.242519,1.215320,-0.516996,2.238948,1.223448,-0.489268,2.228646,\n\t\t          1.238123,-0.520608,2.214833,1.227101,-0.526396,2.213293,1.235536,-0.500844,2.205042,1.241817,-0.508869,2.211508,\n\t\t          1.230590,-0.499407,2.202683,1.222361,-0.525842,2.211549,1.241468,-0.515026,2.214279,1.215752,-0.509607,2.202970,\n\t\t          1.210539,-0.501336,2.225013,1.216573,-0.518700,2.233119,1.234901,-0.512378,2.236773,1.222381,-0.519192,2.235418,\n\t\t          1.237753,-0.499346,2.239913,1.234141,-0.510326,2.243218,1.229893,-0.491321,2.232134,1.220923,-0.518166,2.241391,\n\t\t          1.230426,-0.493065,2.226942,1.238000,-0.501049,2.233038,1.238143,-0.507329,2.236568,1.224126,-0.491608,2.224397,\n\t\t          1.212653,-0.513343,2.252823,1.218276,-0.514533,2.256722,1.234839,-0.498997,2.258057,1.205756,-0.495425,2.242356,\n\t\t          1.207768,-0.498791,2.233427,1.214315,-0.515847,2.243382,1.220205,-0.517181,2.246522,1.233997,-0.508356,2.249231,\n\t\t          1.226896,-0.484815,2.245003,1.235249,-0.492757,2.254362,1.231411,-0.504846,2.259001,1.219774,-0.483316,2.240631,\n\t\t          1.236563,-0.518146,2.221893,1.233710,-0.498525,2.212513,1.229072,-0.496862,2.209969,1.239950,-0.512461,2.221565,\n\t\t          1.215526,-0.507227,2.210133,1.225336,-0.524179,2.220909,1.240031,-0.506509,2.218876,1.220185,-0.523625,2.219348,\n\t\t          1.237220,-0.518987,2.218342,1.234633,-0.499407,2.209025,1.229749,-0.498032,2.206603,1.240626,-0.513630,2.218261,\n\t\t          1.215916,-0.508315,2.206398,1.226342,-0.525021,2.216742,1.240976,-0.507699,2.215490,1.221683,-0.524610,2.215243,\n\t\t          1.221765,-0.522086,2.175201,1.226999,-0.532943,2.191292,1.242207,-0.515067,2.193200,1.236358,-0.510203,2.179921,\n\t\t          1.239026,-0.509792,2.184067,1.242105,-0.520526,2.196957,1.239395,-0.527176,2.199235,1.230303,-0.532060,2.195869,\n\t\t          1.210970,-0.510059,2.220107,1.206126,-0.502198,2.240016,1.194120,-0.500290,2.271191,1.200112,-0.497416,2.258590,\n\t\t          1.236891,-0.535098,2.171281,1.239539,-0.535098,2.172574,1.228292,-0.533785,2.171795,1.217312,-0.521758,2.191620,\n\t\t          1.201939,-0.497704,2.254095,1.208035,-0.505790,2.231621,1.209451,-0.507042,2.226717,1.215075,-0.516688,2.205556,\n\t\t          1.205367,-0.500905,2.244757,1.207008,-0.504374,2.235705,1.214377,-0.512768,2.212349,1.215054,-0.514554,2.208861,\n\t\t          1.220759,-0.527586,2.179121,1.219590,-0.502588,2.205084,1.218584,-0.501808,2.208717,1.210457,-0.493825,2.232094,\n\t\t          1.207932,-0.490418,2.240509,1.226240,-0.515826,2.173560,1.204300,-0.486929,2.249600,1.234100,-0.521347,2.166499,\n\t\t          1.243192,-0.525575,2.169270,1.202021,-0.486046,2.253171,1.219651,-0.503655,2.200897,1.211893,-0.495036,2.228153,\n\t\t          1.221724,-0.509341,2.187392,1.213453,-0.496472,2.224151,1.198122,-0.483727,2.259412,1.209266,-0.492142,2.236547,\n\t\t          1.215834,-0.498463,2.216475,1.241078,-0.524754,2.167772,1.240442,-0.523871,2.187331,1.243069,-0.530747,2.171835,\n\t\t          1.238800,-0.535632,2.178567,1.243090,-0.521758,2.173990,1.241283,-0.519746,2.184232,1.242843,-0.520342,2.176556,\n\t\t          1.237383,-0.534872,2.183205,1.238657,-0.529228,2.189014,1.240565,-0.534544,2.174154,1.243726,-0.526253,2.170932,\n\t\t          1.241345,-0.527751,2.179942,1.242166,-0.528756,2.176905,1.231596,-0.500967,2.198803,1.236152,-0.502424,2.200753,\n\t\t          1.215834,-0.511229,2.198968,1.238328,-0.522209,2.210174,1.242146,-0.510428,2.205987,1.241714,-0.516750,2.209189,\n\t\t          1.222730,-0.527402,2.207342,1.227635,-0.527484,2.209128,1.215218,-0.518474,2.201739,1.219815,-0.504661,2.197429,\n\t\t          1.005608,-0.610154,2.367736,1.046656,-0.624377,2.364965,1.032474,-0.624808,2.376601,1.008050,-0.616824,2.376540,\n\t\t          1.008030,-0.604859,2.358726,1.046471,-0.616516,2.357863,0.994648,-0.645352,2.340623,1.002571,-0.641063,2.351768,\n\t\t          0.991508,-0.651304,2.331983,1.026480,-0.659185,2.350558,1.024962,-0.664665,2.340603,1.010390,-0.664768,2.326729,\n\t\t          1.020570,-0.650709,2.356715,1.011765,-0.643915,2.357556,1.006141,-0.670474,2.331224,1.011375,-0.645414,2.355237,\n\t\t          0.992144,-0.658877,2.334466,1.018763,-0.670002,2.341486,1.019112,-0.653480,2.355134,1.021719,-0.661669,2.351193,\n\t\t          0.995038,-0.649313,2.340870,1.017573,-0.623228,2.381486,1.002221,-0.642992,2.350680,1.032925,-0.604222,2.348690,\n\t\t          1.003145,-0.638354,2.353882,0.995038,-0.640427,2.343353,1.030154,-0.655553,2.350948,1.022335,-0.648164,2.357802,\n\t\t          1.030154,-0.658323,2.341239,0.993335,-0.642951,2.333255,1.012422,-0.641761,2.359772,1.014043,-0.656558,2.325436,\n\t\t          1.023443,-0.633346,2.331182,1.014166,-0.637902,2.364800,0.999635,-0.627743,2.339228,1.038098,-0.642643,2.344462,\n\t\t          1.025783,-0.642069,2.361496,1.036783,-0.645106,2.353369,0.998342,-0.629898,2.349941,1.004848,-0.632833,2.360163,\n\t\t          1.005936,-0.627845,2.365786,1.001483,-0.622263,2.356304,1.041073,-0.636404,2.357207,1.028841,-0.636219,2.366196,\n\t\t          1.043249,-0.630534,2.349716,1.003248,-0.617543,2.346904,1.015583,-0.634002,2.370158,1.029087,-0.618097,2.338038,\n\t\t          1.035429,-0.596629,2.353020,1.010082,-0.598332,2.363713,1.010328,-0.609251,2.381364,1.007701,-0.603648,2.372559,\n\t\t          1.049365,-0.616455,2.370301,1.035121,-0.617748,2.381322,1.020487,-0.616598,2.385817,1.049939,-0.609066,2.362830,\n\t\t          1.006326,-0.622017,2.372559,1.043392,-0.628543,2.361516,1.045137,-0.622222,2.354539,1.016260,-0.628646,2.377464,\n\t\t          1.030770,-0.610031,2.342820,1.003802,-0.615264,2.363220,1.030852,-0.629590,2.371984,1.005977,-0.610113,2.353533,\n\t\t          1.005690,-0.625485,2.368865,1.042469,-0.632915,2.358870,1.044295,-0.626655,2.352014,1.015480,-0.632135,2.373914,\n\t\t          1.029846,-0.613458,2.340460,1.002488,-0.619472,2.359342,1.029662,-0.633818,2.368433,1.004356,-0.614341,2.349552,\n\t\t          1.019092,-0.644264,2.327140,0.996228,-0.634392,2.335123,1.023915,-0.645373,2.359506,1.034239,-0.651325,2.342451,\n\t\t          1.033787,-0.650873,2.351891,1.013263,-0.639954,2.361764,1.004007,-0.635583,2.356796,0.996741,-0.634947,2.346575,\n\t\t          1.017122,-0.601534,2.349695,0.998117,-0.658714,2.325724,0.995921,-0.664645,2.331182,1.000949,-0.650155,2.324410,\n\t\t          1.009569,-0.627743,2.330321,1.019892,-0.594392,2.355872,1.014125,-0.614177,2.337545,1.016260,-0.607239,2.343292,\n\t\t          1.014987,-0.611077,2.339639,1.005423,-0.638990,2.325887,1.040478,-0.620683,2.346206,1.041381,-0.616804,2.348813,\n\t\t          1.029723,-0.649190,2.334959,1.024962,-0.658529,2.333255,1.014761,-0.672013,2.335102,1.039329,-0.624336,2.344092,\n\t\t          1.033992,-0.638682,2.338243,1.045917,-0.603648,2.356899,1.043987,-0.612453,2.353985,1.019585,-0.666184,2.332681,\n\t\t          1.011375,-0.646112,2.353512,1.004623,-0.668791,2.336170,0.994874,-0.660171,2.335329,1.015952,-0.668565,2.343148,\n\t\t          1.019318,-0.653398,2.354272,1.019728,-0.660355,2.349428,0.996269,-0.651509,2.341055,1.002365,-0.643300,2.349695,\n\t\t          0.997480,-0.665055,2.334487,1.013140,-0.670761,2.339043,1.006203,-0.658652,2.346288,1.004643,-0.665979,2.340418,\n\t\t          1.041402,-0.635255,2.347376,1.039123,-0.640570,2.355093,1.027917,-0.621237,2.336519,1.005444,-0.630411,2.363262,\n\t\t          1.027445,-0.639585,2.363919,1.014802,-0.636240,2.367695,1.001975,-0.621647,2.343559,0.999964,-0.625608,2.353615,\n\t\t          1.013037,-0.618363,2.335062,1.037563,-0.629446,2.341937,1.150363,-0.688329,2.299268,1.171051,-0.670617,2.281351,\n\t\t          1.174150,-0.645537,2.305179,1.151553,-0.666287,2.322481,1.166494,-0.606911,2.324697,1.148085,-0.634146,2.346761,\n\t\t          1.148023,-0.644716,2.338284,1.169080,-0.622304,2.322296,1.153133,-0.725457,2.261381,1.171051,-0.713328,2.246502,\n\t\t          1.154016,-0.726791,2.256763,1.169039,-0.716221,2.244941,1.171872,-0.709367,2.248328,1.150568,-0.721599,2.265096,\n\t\t          1.149336,-0.650832,2.332640,1.170045,-0.631129,2.317206,1.173780,-0.653233,2.295389,1.151984,-0.676159,2.314168,\n\t\t          1.147325,-0.712712,2.273101,1.171256,-0.689315,2.264808,1.147715,-0.706021,2.280448,1.173185,-0.658365,2.291140,\n\t\t          1.151060,-0.681126,2.308360,1.170968,-0.697360,2.257646,1.174232,-0.648883,2.300664,1.152436,-0.671664,2.318293,\n\t\t          1.150732,-0.661587,2.325600,1.172652,-0.640468,2.310352,1.149706,-0.700315,2.286769,1.171256,-0.682809,2.271212,\n\t\t          1.148372,-0.703291,2.283260,1.171543,-0.686318,2.267887,1.171071,-0.702511,2.251817,1.148105,-0.717371,2.268975,\n\t\t          1.167726,-0.716570,2.244203,1.154262,-0.726586,2.255450,1.163641,-0.725929,2.248122,1.171153,-0.692906,2.261689,\n\t\t          1.147140,-0.708135,2.277554,1.201795,-0.654260,2.236773,1.218584,-0.631335,2.225403,1.218687,-0.606460,2.260683,\n\t\t          1.198635,-0.632402,2.272259,1.196746,-0.563072,2.301484,1.171851,-0.595213,2.317226,1.185458,-0.609703,2.296395,\n\t\t          1.206721,-0.583986,2.285701,1.213905,-0.684266,2.196854,1.227060,-0.664953,2.187207,1.214192,-0.684122,2.194165,\n\t\t          1.226198,-0.667211,2.187104,1.227306,-0.661710,2.189670,1.213145,-0.681967,2.200856,1.188845,-0.614382,2.290895,\n\t\t          1.210210,-0.588809,2.279689,1.217825,-0.617932,2.245659,1.199948,-0.640755,2.256989,1.210682,-0.674866,2.209928,\n\t\t          1.223243,-0.647179,2.205453,1.209081,-0.669550,2.217296,1.217558,-0.623453,2.236876,1.199989,-0.646050,2.248471,\n\t\t          1.224700,-0.653357,2.197716,1.219569,-0.611447,2.255101,1.199620,-0.635870,2.266224,1.197096,-0.627907,2.277081,\n\t\t          1.216060,-0.602068,2.264931,1.207008,-0.663639,2.225403,1.221498,-0.641248,2.213889,1.207419,-0.667108,2.220825,\n\t\t          1.222443,-0.644080,2.209415,1.226383,-0.658201,2.192482,1.212160,-0.678991,2.204981,1.225664,-0.668483,2.186325,\n\t\t          1.215054,-0.683589,2.192873,1.221683,-0.677021,2.189076,1.223797,-0.649601,2.202047,1.209635,-0.672136,2.213375,\n\t\t          1.231637,-0.588132,2.230021,1.243069,-0.566089,2.220456,1.237938,-0.548664,2.251817,1.223161,-0.573929,2.261832,\n\t\t          1.220267,-0.518741,2.296477,1.198491,-0.554042,2.296600,1.210415,-0.561328,2.284389,1.225706,-0.532512,2.276159,\n\t\t          1.246763,-0.616167,2.176391,1.256019,-0.596095,2.166910,1.247461,-0.616496,2.173662,1.257374,-0.597922,2.166047,\n\t\t          1.255219,-0.593427,2.170030,1.245244,-0.614649,2.180619,1.214109,-0.563852,2.278929,1.228333,-0.537315,2.268667,\n\t\t          1.240360,-0.554083,2.241657,1.224844,-0.578670,2.254341,1.239950,-0.607034,2.194104,1.249000,-0.578978,2.193653,\n\t\t          1.237753,-0.602232,2.203380,1.239950,-0.557120,2.236281,1.226424,-0.580743,2.248225,1.251648,-0.585156,2.183780,\n\t\t          1.239929,-0.550861,2.247219,1.223858,-0.576454,2.258630,1.221396,-0.570974,2.265958,1.234613,-0.546079,2.257420,\n\t\t          1.235393,-0.596690,2.212883,1.246147,-0.573601,2.205084,1.236645,-0.599666,2.207649,1.247892,-0.576351,2.199234,\n\t\t          1.253824,-0.589692,2.177438,1.242310,-0.610687,2.187433,1.256820,-0.599707,2.165884,1.248507,-0.615388,2.172636,\n\t\t          1.253392,-0.608492,2.168120,1.249945,-0.581236,2.189322,1.239046,-0.604161,2.199132,1.229974,-0.519254,2.229097,\n\t\t          1.236440,-0.499510,2.224130,1.234880,-0.490664,2.246933,1.227450,-0.513117,2.254136,1.221273,-0.476564,2.279955,\n\t\t          1.215895,-0.503922,2.291654,1.220205,-0.504620,2.275460,1.226116,-0.482598,2.264911,1.236522,-0.532471,2.190040,\n\t\t          1.241591,-0.516976,2.181830,1.237383,-0.532697,2.188541,1.242289,-0.518597,2.180948,1.240852,-0.514472,2.184540,\n\t\t          1.235126,-0.531322,2.193488,1.222319,-0.506262,2.269222,1.227409,-0.484322,2.259657,1.234716,-0.494666,2.236916,\n\t\t          1.228271,-0.515170,2.242643,1.234326,-0.528756,2.204427,1.240052,-0.505174,2.208655,1.233176,-0.524590,2.214443,\n\t\t          1.235270,-0.497150,2.230575,1.228948,-0.516955,2.236486,1.240421,-0.508458,2.195951,1.235023,-0.493168,2.241616,\n\t\t          1.228148,-0.514164,2.248903,1.226198,-0.510983,2.258877,1.233587,-0.489022,2.251077,1.231616,-0.521983,2.221791,\n\t\t          1.238164,-0.502527,2.215982,1.232479,-0.523215,2.218240,1.239108,-0.503676,2.211652,1.240811,-0.510346,2.188378,\n\t\t          1.234182,-0.530193,2.198681,1.242166,-0.519397,2.180825,1.237322,-0.532081,2.186756,1.240463,-0.525842,2.184149,\n\t\t          1.240360,-0.506570,2.204263,1.233935,-0.525924,2.209969,1.134928,-0.681351,2.289335,1.136037,-0.662408,2.312486,\n\t\t          1.127027,-0.624295,2.334056,1.129470,-0.637923,2.326996,1.167418,-0.727448,2.225588,1.152743,-0.740747,2.236855,\n\t\t          1.153605,-0.660478,2.271910,1.154899,-0.639770,2.291757,1.147038,-0.596157,2.308709,1.150691,-0.614669,2.309859,\n\t\t          1.142030,-0.730609,2.242191,1.138089,-0.711460,2.260602,1.132589,-0.647569,2.321332,1.135791,-0.669058,2.305897,\n\t\t          1.135565,-0.672382,2.301300,1.138232,-0.699207,2.272833,1.135545,-0.658960,2.315031,1.135811,-0.665958,2.309325,\n\t\t          1.138089,-0.694466,2.278662,1.138418,-0.697032,2.275624,1.156992,-0.705446,2.233900,1.149090,-0.738634,2.236958,\n\t\t          1.139526,-0.718643,2.254259,1.153421,-0.679956,2.258837,1.154611,-0.643587,2.289520,1.154447,-0.634536,2.295800,\n\t\t          1.153092,-0.676939,2.260396,1.153605,-0.624623,2.303147,1.168095,-0.728248,2.227538,1.162841,-0.716837,2.226717,\n\t\t          1.153400,-0.682747,2.256373,1.153461,-0.696683,2.241781,1.154488,-0.650771,2.282151,1.154611,-0.646502,2.286154,\n\t\t          1.154899,-0.739434,2.237697,1.167356,-0.729500,2.229425,1.161445,-0.735268,2.234002,1.137637,-0.702840,2.268626,\n\t\t          1.152990,-0.686852,2.251653,1.186792,-0.649006,2.227168,1.181620,-0.626019,2.262202,1.151696,-0.589240,2.301608,\n\t\t          1.167418,-0.600405,2.283957,1.227368,-0.675749,2.166397,1.218214,-0.695595,2.176556,1.200379,-0.624233,2.212247,\n\t\t          1.197916,-0.599215,2.245927,1.179609,-0.559994,2.284573,1.186300,-0.577152,2.269139,1.205613,-0.692455,2.178198,\n\t\t          1.196562,-0.674148,2.198291,1.171379,-0.608389,2.278518,1.182236,-0.634044,2.252658,1.183775,-0.641350,2.240570,\n\t\t          1.193524,-0.665035,2.209887,1.180143,-0.623125,2.265916,1.182216,-0.629426,2.258795,1.192683,-0.659288,2.217829,\n\t\t          1.193278,-0.661874,2.214053,1.212981,-0.661382,2.171897,1.215793,-0.696047,2.175262,1.199230,-0.682973,2.185689,\n\t\t          1.205920,-0.638456,2.200159,1.197978,-0.602170,2.242211,1.196480,-0.595603,2.249785,1.205490,-0.635481,2.203463,\n\t\t          1.189440,-0.581667,2.262284,1.228107,-0.679545,2.168490,1.221662,-0.670371,2.165309,1.206454,-0.641145,2.195992,\n\t\t          1.209758,-0.650832,2.184273,1.198450,-0.614874,2.223843,1.198778,-0.606870,2.235049,1.219774,-0.693604,2.176309,\n\t\t          1.227347,-0.680654,2.169249,1.224967,-0.687303,2.172739,1.194160,-0.668298,2.206007,1.207173,-0.644285,2.191785,\n\t\t          1.214684,-0.585751,2.221708,1.207132,-0.569722,2.251817,1.184863,-0.552154,2.281248,1.194120,-0.557387,2.269509,\n\t\t          1.256820,-0.606090,2.146468,1.250642,-0.623802,2.152276,1.227758,-0.558803,2.210707,1.220677,-0.540311,2.239728,\n\t\t          1.195125,-0.515252,2.269836,1.207398,-0.528140,2.259924,1.236789,-0.619862,2.158249,1.224926,-0.606562,2.182487,\n\t\t          1.197014,-0.559891,2.265670,1.209656,-0.573683,2.245105,1.210251,-0.575859,2.240692,1.221621,-0.598291,2.196403,\n\t\t          1.205284,-0.567526,2.255183,1.208589,-0.571282,2.249375,1.219179,-0.594474,2.206090,1.220801,-0.596280,2.200938,\n\t\t          1.241694,-0.591683,2.158023,1.245655,-0.623864,2.152974,1.229810,-0.613294,2.169373,1.232930,-0.571610,2.190943,\n\t\t          1.220698,-0.541891,2.237122,1.218379,-0.538423,2.243525,1.232848,-0.567690,2.195786,1.211380,-0.531486,2.255080,\n\t\t          1.259139,-0.609805,2.147391,1.246763,-0.598948,2.148910,1.233033,-0.574237,2.187454,1.236399,-0.582693,2.171487,\n\t\t          1.222504,-0.545976,2.230575,1.221334,-0.544108,2.233940,1.251648,-0.621442,2.154801,1.258318,-0.611221,2.150265,\n\t\t          1.255937,-0.616434,2.153179,1.222217,-0.601411,2.191600,1.234244,-0.576023,2.183083,1.212858,-0.516894,2.223022,\n\t\t          1.207830,-0.508725,2.243443,1.198347,-0.503861,2.271993,1.200625,-0.502568,2.262449,1.241283,-0.520793,2.169824,\n\t\t          1.238000,-0.536453,2.175448,1.220719,-0.495220,2.215879,1.214274,-0.487196,2.235418,1.201406,-0.476420,2.259657,\n\t\t          1.206660,-0.480320,2.251694,1.229256,-0.535550,2.178588,1.219056,-0.526745,2.195335,1.202329,-0.503122,2.256661,\n\t\t          1.210026,-0.512235,2.235726,1.211195,-0.514307,2.230164,1.217496,-0.522455,2.208552,1.207152,-0.506611,2.247650,\n\t\t          1.209163,-0.510921,2.239728,1.215793,-0.518967,2.215777,1.216922,-0.520259,2.212041,1.232663,-0.513056,2.177253,\n\t\t          1.235393,-0.536535,2.175858,1.223325,-0.531158,2.184888,1.224413,-0.498894,2.205268,1.215957,-0.489022,2.231498,\n\t\t          1.213042,-0.485595,2.239585,1.223386,-0.497827,2.208409,1.207480,-0.481326,2.247630,1.243028,-0.522250,2.170727,\n\t\t          1.237445,-0.517406,2.171056,1.225336,-0.500043,2.201430,1.228230,-0.505421,2.188726,1.218543,-0.492819,2.223165,\n\t\t          1.217373,-0.490890,2.227599,1.239683,-0.535611,2.176536,1.243623,-0.523297,2.172266,1.242453,-0.529023,2.175119,\n\t\t          1.217455,-0.523995,2.204263,1.226178,-0.501193,2.197798,1.155453,-0.626696,2.352815,1.170127,-0.608532,2.340789,\n\t\t          1.136591,-0.628400,2.349470,1.127519,-0.624664,2.344113,1.164647,-0.618692,2.348136,1.129798,-0.601883,2.322809,\n\t\t          1.128177,-0.608389,2.327961,1.135606,-0.587619,2.315072,1.189666,-0.587557,2.327447,1.206372,-0.567382,2.319894,\n\t\t          1.201857,-0.579450,2.323097,1.148864,-0.558331,2.293439,1.141845,-0.571384,2.302264,1.158921,-0.548336,2.290525,\n\t\t          1.208220,-0.546099,2.309859,1.223756,-0.523687,2.307272,1.220000,-0.536268,2.308237,1.175464,-0.522702,2.276938,\n\t\t          1.168383,-0.534175,2.282911,1.183488,-0.509731,2.272136,1.216224,-0.492778,2.302798,1.219590,-0.475127,2.294260,\n\t\t          1.210498,-0.467636,2.274702,1.201960,-0.468909,2.267928,1.220267,-0.483542,2.298714,1.192560,-0.485861,2.267416,\n\t\t          1.189276,-0.496206,2.271684,1.195064,-0.482167,2.263721,1.148639,-0.628071,2.351645,1.217024,-0.472336,2.288206,\n\t\t          1.124605,-0.609395,2.336047,1.194879,-0.476195,2.265179,1.156314,-0.617132,2.358274,1.168608,-0.604777,2.349120,\n\t\t          1.130311,-0.616824,2.357207,1.164175,-0.609764,2.357063,1.119249,-0.588316,2.332845,1.118489,-0.604264,2.342779,\n\t\t          1.123086,-0.572924,2.324718,1.191000,-0.577562,2.336334,1.203109,-0.563873,2.329992,1.198307,-0.568121,2.338489,\n\t\t          1.139424,-0.544519,2.311911,1.131460,-0.557038,2.317554,1.148967,-0.531199,2.306266,1.207707,-0.534401,2.319074,\n\t\t          1.217722,-0.520013,2.317267,1.213289,-0.525945,2.321721,1.163909,-0.505318,2.288349,1.155761,-0.517284,2.297769,\n\t\t          1.171626,-0.492121,2.280222,1.212714,-0.485677,2.310761,1.214602,-0.473568,2.301526,1.206455,-0.463162,2.284471,\n\t\t          1.212981,-0.477796,2.309612,1.193771,-0.466364,2.272299,1.179958,-0.476256,2.273264,1.148762,-0.614608,2.362728,\n\t\t          1.209759,-0.465522,2.301382,1.165140,-0.482516,2.285147,1.124502,-0.604099,2.368331,1.162616,-0.601267,2.365088,\n\t\t          1.114733,-0.597429,2.346781,1.112968,-0.583801,2.341547,1.116437,-0.565843,2.332989,1.194407,-0.560343,2.346473,\n\t\t          1.136345,-0.537356,2.321084,1.126247,-0.551066,2.326914,1.145355,-0.523687,2.316344,1.151573,-0.509628,2.308935,\n\t\t          1.173678,-0.431022,2.306944,1.026008,-0.535426,2.421385,1.028061,-0.528920,2.399814,1.199415,-0.538197,2.326032,\n\t\t          1.170497,-0.593653,2.349223,1.172857,-0.517078,2.389861,1.139382,-0.600446,2.374961,1.102768,-0.574976,2.351275,\n\t\t          1.158531,-0.436296,2.300623,1.097021,-0.578773,2.390230,1.108494,-0.557018,2.347294,1.130270,-0.528961,2.335472,\n\t\t          1.120172,-0.541399,2.340972,1.140203,-0.516791,2.328987,1.151409,-0.488078,2.310331,1.147120,-0.503492,2.321558,\n\t\t          1.156951,-0.470592,2.296250,1.203602,-0.481264,2.327447,1.203930,-0.458319,2.307704,1.186095,-0.448795,2.288534,\n\t\t          1.190425,-0.460371,2.278806,1.205367,-0.467226,2.322049,1.034649,-0.530029,2.380810,1.051130,-0.538177,2.371306,\n\t\t          1.201816,-0.548193,2.312629,1.129695,-0.551004,2.414222,1.194489,-0.447995,2.304132,1.183550,-0.538259,2.370219,\n\t\t          1.160317,-0.562374,2.382534,1.198861,-0.484199,2.343887,1.030113,-0.511126,2.425552,1.035203,-0.504641,2.399569,\n\t\t          1.042448,-0.508520,2.380728,1.061823,-0.521676,2.368926,1.087908,-0.544642,2.359444,1.146915,-0.575469,2.390230,\n\t\t          1.199025,-0.471926,2.337381,1.198594,-0.450561,2.317082,1.201016,-0.456081,2.294445,1.200379,-0.459673,2.330362,\n\t\t          1.069067,-0.551292,2.367879,1.083557,-0.563318,2.366483,1.212530,-0.506550,2.320387,1.186813,-0.525370,2.359896,\n\t\t          1.172713,-0.550491,2.375658,1.199148,-0.497745,2.350742,1.049898,-0.527238,2.444494,1.084994,-0.559008,2.424648,\n\t\t          1.193627,-0.461171,2.348690,1.195269,-0.449822,2.339556,1.158264,-0.494584,2.297687,1.199948,-0.552584,2.331491,\n\t\t          1.124092,-0.497150,2.446835,1.191759,-0.511250,2.353390,1.196582,-0.526150,2.337935,1.203827,-0.511598,2.338776,\n\t\t          1.171154,-0.437220,2.397762,1.158121,-0.464989,2.424525,1.138767,-0.486395,2.438811,1.168506,-0.445778,2.407243,\n\t\t          1.163642,-0.455137,2.416418,1.102604,-0.506324,2.454798,1.172795,-0.429134,2.388506,1.140778,-0.393053,2.354723,\n\t\t          1.130024,-0.415957,2.331264,1.173164,-0.415773,2.371902,1.074075,-0.564878,2.420749,1.203027,-0.557716,2.319340,\n\t\t          1.150363,-0.475394,2.431894,1.184371,-0.493886,2.372621,1.137310,-0.402165,2.336867,1.184104,-0.433669,2.317678,\n\t\t          1.177680,-0.565884,2.357207,1.192149,-0.542076,2.342286,1.205449,-0.496308,2.332290,1.191041,-0.482311,2.366832,\n\t\t          1.160604,-0.528572,2.396141,1.178562,-0.505503,2.380810,1.167520,-0.577726,2.363898,1.190897,-0.555109,2.352774,\n\t\t          1.157731,-0.592544,2.374571,1.192088,-0.471536,2.357556,1.147612,-0.540250,2.404536,1.181025,-0.578712,2.342060,\n\t\t          1.217702,-0.512440,2.306144,1.138972,-0.639667,2.340193,1.157608,-0.637307,2.341691,1.168957,-0.621832,2.329870,\n\t\t          1.164093,-0.612022,2.315913,1.157074,-0.609682,2.312958,1.131891,-0.637184,2.335985,1.165673,-0.631027,2.337935,\n\t\t          1.133246,-0.617440,2.316180,1.127725,-0.624356,2.322953,1.142748,-0.611078,2.313963,1.148023,-0.639093,2.342614,\n\t\t          1.168177,-0.616681,2.322666,1.127991,-0.631745,2.331224,1.149521,-0.608676,2.311747,1.162102,-0.575818,2.280735,\n\t\t          1.203458,-0.591662,2.308915,1.166864,-0.599379,2.296661,1.188106,-0.568450,2.280406,1.202719,-0.576700,2.292290,\n\t\t          1.180553,-0.603114,2.305425,1.172672,-0.568552,2.278354,1.158736,-0.584191,2.287097,1.218563,-0.475907,2.263762,\n\t\t          1.226260,-0.484117,2.277944,1.180800,-0.568060,2.279441,1.161876,-0.592770,2.291038,1.190959,-0.554657,2.273757,\n\t\t          1.203930,-0.523646,2.265404,1.208650,-0.521491,2.269282,1.193053,-0.558824,2.276897,1.198594,-0.560342,2.282377,\n\t\t          1.215485,-0.554083,2.290586,1.187798,-0.549137,2.268709,1.197547,-0.526724,2.263475,1.206947,-0.558762,2.288000,\n\t\t          1.223448,-0.527976,2.283527,1.223694,-0.495590,2.284737,1.212139,-0.508540,2.275256,1.223592,-0.545463,2.291593,\n\t\t          1.188804,-0.537376,2.264296,1.226342,-0.536535,2.289130,1.215485,-0.521881,2.274885,1.205079,-0.478555,2.255163,\n\t\t          1.200893,-0.503101,2.267025,1.198552,-0.491177,2.258959,1.225993,-0.489802,2.282274,1.224290,-0.479417,2.271684,\n\t\t          1.218132,-0.503409,2.283362,1.196828,-0.571816,2.285496,1.207952,-0.583371,2.302347,1.191472,-0.599441,2.308094,\n\t\t          1.171892,-0.602889,2.300622,1.211873,-0.475600,2.257851,1.205921,-0.509197,2.269591,1.200379,-0.484650,2.255860,\n\t\t          1.198388,-0.497683,2.263229,1.096282,-0.397773,2.498719,1.073295,-0.413638,2.503111,1.061269,-0.419344,2.499910,\n\t\t          1.039000,-0.410765,2.482607,1.035778,-0.403828,2.473720,1.035182,-0.395064,2.463028,1.085548,-0.406906,2.502270,\n\t\t          1.121958,-0.358059,2.471176,1.119125,-0.366659,2.479734,1.113317,-0.377352,2.487513,1.105231,-0.388127,2.493916,\n\t\t          1.121116,-0.350671,2.462331,1.115677,-0.344165,2.452273,1.055953,-0.354919,2.430251,1.044788,-0.368054,2.440329,\n\t\t          1.037358,-0.382914,2.451288,1.108043,-0.340635,2.441458,1.118859,-0.426650,2.473105,1.095420,-0.444054,2.481048,\n\t\t          1.080828,-0.449083,2.480022,1.057512,-0.436214,2.462945,1.051971,-0.426917,2.455024,1.050514,-0.417106,2.447266,\n\t\t          1.108617,-0.436173,2.478544,1.138849,-0.389625,2.441273,1.136304,-0.398389,2.449811,1.132035,-0.408035,2.458862,\n\t\t          1.126288,-0.417538,2.466743,1.138726,-0.381621,2.432673,1.135216,-0.373021,2.423458,1.070668,-0.376798,2.415495,\n\t\t          1.058908,-0.390692,2.426167,1.052115,-0.405552,2.437311,1.129059,-0.365099,2.416214,1.112907,-0.477611,2.461591,\n\t\t          1.073562,-0.483973,2.464629,1.041053,-0.480525,2.424484,1.094270,-0.483768,2.465039,1.152107,-0.437466,2.433617,\n\t\t          1.146279,-0.447092,2.441703,1.138582,-0.457025,2.449113,1.127581,-0.468211,2.455701,1.156253,-0.428210,2.424669,\n\t\t          1.159455,-0.409184,2.407511,1.175669,-0.589220,2.328802,1.169409,-0.600651,2.334938,1.206701,-0.520116,2.331675,\n\t\t          1.214377,-0.499530,2.302757,1.208076,-0.489043,2.317945,1.208630,-0.474471,2.317267,1.158901,-0.419385,2.415248,\n\t\t          1.039020,-0.587065,2.357945,1.012771,-0.590533,2.369111,1.013201,-0.602437,2.385448,1.010451,-0.595972,2.376848,\n\t\t          1.053305,-0.606891,2.375144,1.038816,-0.610154,2.388013,1.023566,-0.608800,2.390373,1.054065,-0.599564,2.367346,\n\t\t          1.022170,-0.585135,2.361332,1.049590,-0.594043,2.361557,1.041401,-0.580784,2.360962,1.015336,-0.582713,2.373113,\n\t\t          1.016588,-0.593263,2.389429,1.013756,-0.587434,2.380953,1.057143,-0.598517,2.378428,1.043536,-0.602129,2.391851,\n\t\t          1.027548,-0.599851,2.395565,1.057451,-0.591498,2.370897,1.023115,-0.578383,2.365006,1.052607,-0.587106,2.364780,\n\t\t          1.043392,-0.576618,2.362933,1.016465,-0.575694,2.376334,1.018702,-0.583822,2.393103,1.016095,-0.579348,2.384709,\n\t\t          1.061289,-0.591744,2.380994,1.047558,-0.594925,2.396428,1.030113,-0.590718,2.401250,1.061330,-0.585115,2.373605,\n\t\t          1.024448,-0.573970,2.367119,1.055522,-0.581728,2.367304,1.045588,-0.572308,2.364656,1.019154,-0.569394,2.378531,\n\t\t          1.021350,-0.575489,2.398070,1.017881,-0.571774,2.388382,1.065845,-0.586080,2.383251,1.052156,-0.588583,2.400923,\n\t\t          1.032720,-0.581441,2.407757,1.065209,-0.580045,2.375226,1.027281,-0.568573,2.369233,1.058128,-0.576782,2.368762,\n\t\t          1.048975,-0.567157,2.366648,1.022540,-0.561287,2.380666,1.023402,-0.564940,2.404822,1.019974,-0.561615,2.392282,\n\t\t          1.072044,-0.581544,2.387233,1.057595,-0.581646,2.405787,1.037481,-0.573088,2.415453,1.070627,-0.574873,2.376397,\n\t\t          1.028615,-0.563996,2.371122,1.062603,-0.571097,2.370609,1.058888,-0.559911,2.369213,1.028369,-0.547556,2.380973,\n\t\t          1.025290,-0.552010,2.414017,1.024059,-0.547269,2.396736,1.083947,-0.577234,2.391379,1.062479,-0.574155,2.413094,\n\t\t          1.037399,-0.561020,2.423089,1.081423,-0.574176,2.377895,1.042571,-0.551784,2.370649,1.071243,-0.566623,2.371614,\n\t\t          1.044870,-0.481900,2.399158,1.051109,-0.489433,2.383355,1.070812,-0.504908,2.367858,1.099607,-0.526109,2.354887,\n\t\t          1.081854,-0.490130,2.367510,1.112024,-0.512194,2.353225,1.093594,-0.477324,2.365642,1.123497,-0.500126,2.351193,\n\t\t          1.063629,-0.436050,2.410221,1.105251,-0.465132,2.362748,1.130557,-0.487175,2.343374,1.072475,-0.421663,2.400985,\n\t\t          1.112907,-0.451032,2.348217,1.135627,-0.471536,2.330854,1.083250,-0.406906,2.388958,1.126144,-0.437548,2.330197,\n\t\t          1.142954,-0.454214,2.314579,1.099238,-0.394941,2.370691,1.175812,-0.469155,2.276302,1.182832,-0.455589,2.376889,\n\t\t          1.174622,-0.475025,2.394909,1.172364,-0.420000,2.329952,1.186074,-0.434880,2.353678,1.149357,-0.506816,2.417240,\n\t\t          1.161876,-0.495816,2.411041,1.180225,-0.465153,2.387172,1.085056,-0.416450,2.378244,1.147674,-0.425419,2.311972,\n\t\t          1.169060,-0.485102,2.403180,1.114384,-0.528079,2.437374,1.185643,-0.447872,2.365520,1.041914,-0.546181,2.433762,\n\t\t          1.135278,-0.518453,2.427091,1.160050,-0.420329,2.318048,1.171482,-0.456389,2.284491,1.075923,-0.506960,2.457568,\n\t\t          1.054947,-0.451853,2.413381,1.097822,-0.381867,2.391666,1.079925,-0.393627,2.402380,1.125283,-0.377639,2.383026,\n\t\t          1.068555,-0.408712,2.411637,1.059750,-0.437774,2.430190,1.062274,-0.423695,2.422002,1.061125,-0.476051,2.453197,\n\t\t          1.048769,-0.417106,2.491864,1.067077,-0.444362,2.471976,1.055214,-0.457990,2.438337,1.092321,-0.341291,2.430560,\n\t\t          1.109479,-0.362431,2.407614,1.156048,-0.396398,2.393657,1.137310,-0.565145,2.309448,1.169655,-0.513856,2.283649,\n\t\t          1.161466,-0.524754,2.288267,1.124236,-0.595254,2.327365,1.146093,-0.551374,2.301793,1.153483,-0.539552,2.297442,\n\t\t          1.183693,-0.487585,2.271889,1.191226,-0.476810,2.268113,1.121834,-0.613171,2.351275,1.130516,-0.581379,2.318499,\n\t\t          1.177865,-0.502424,2.278149,1.093799,-0.580251,2.373256,1.109889,-0.585813,2.384976,1.103383,-0.591313,2.366279,\n\t\t          1.095626,-0.569640,2.359875,1.106298,-0.555868,2.421139,1.127766,-0.583842,2.391071,1.084809,-0.531424,2.446917,\n\t\t          1.055070,-0.501090,2.449954,1.103199,-0.405470,2.357166,1.110054,-0.420944,2.345262,1.093737,-0.430160,2.363405,\n\t\t          1.074096,-0.430960,2.392652,1.082860,-0.443131,2.378942,1.065271,-0.444444,2.398562,1.072885,-0.456369,2.384113,\n\t\t          1.054516,-0.459652,2.399609,1.061473,-0.471310,2.385202,1.111388,-0.601472,2.356756,1.171277,-0.405921,2.361825,\n\t\t          1.070032,-0.344904,2.425018,1.086349,-0.364976,2.406771,1.182626,-0.425070,2.344728,1.149706,-0.383899,2.386125,\n\t\t          1.192375,-0.440422,2.328617,1.116375,-0.404464,2.478585,1.108329,-0.413597,2.484597,1.129921,-0.367972,2.446158,\n\t\t          1.130229,-0.375566,2.454469,1.045280,-0.416039,2.462206,1.050001,-0.424126,2.471422,1.126555,-0.360194,2.437229,\n\t\t          1.121116,-0.354283,2.429245,1.044172,-0.408096,2.453218,1.064593,-0.367870,2.420913,1.098540,-0.422196,2.488601,\n\t\t          1.086103,-0.429770,2.489996,1.053449,-0.381703,2.431668,1.123025,-0.393894,2.471258,1.071962,-0.433916,2.486754,\n\t\t          1.046615,-0.396870,2.442832,1.127828,-0.383878,2.462864,1.059852,-0.430919,2.480494,1.102726,-0.353134,2.419251,\n\t\t          1.078939,-0.356274,2.413277,1.116847,-0.369573,2.394520,1.139957,-0.374417,2.400985,1.145355,-0.384515,2.408886,\n\t\t          1.148598,-0.395084,2.419538,1.148516,-0.403951,2.428876,1.145991,-0.412899,2.438502,1.141496,-0.422032,2.447512,\n\t\t          1.135955,-0.431330,2.455599,1.128382,-0.441099,2.462474,1.117853,-0.451053,2.468467,1.104041,-0.459755,2.472428,\n\t\t          1.087929,-0.464373,2.472633,1.092732,-0.372898,2.400964,1.075697,-0.385336,2.409317,1.065517,-0.400667,2.419702,\n\t\t          1.057841,-0.414623,2.429841,1.056384,-0.427266,2.438974,1.058580,-0.440483,2.446179,1.063752,-0.453434,2.456378,\n\t\t          1.072413,-0.461602,2.466579,-1.144554,-0.687734,2.297113,-1.166638,-0.664973,2.276405,-1.172610,-0.676795,2.288699,\n\t\t          -1.160645,-0.687098,2.299720,-1.160666,-0.663598,2.324450,-1.175176,-0.650976,2.313040,-1.170311,-0.641104,2.298058,\n\t\t          -1.145786,-0.665999,2.320018,-1.140532,-0.644798,2.336027,-1.165550,-0.616968,2.314969,-1.169593,-0.627435,2.327570,\n\t\t          -1.157095,-0.631581,2.346206,-1.168465,-0.616229,2.335062,-1.162451,-0.604694,2.313983,-1.137843,-0.633859,2.345078,\n\t\t          -1.157751,-0.642766,2.337750,-1.140183,-0.664829,2.317453,-1.139279,-0.686010,2.293562,-1.156130,-0.599564,2.310453,\n\t\t          -1.158798,-0.615080,2.310987,-1.161179,-0.638313,2.292516,-1.160152,-0.661587,2.273038,-1.129674,-0.630698,2.339700,\n\t\t          -1.134046,-0.642643,2.332065,-1.149357,-0.731737,2.252043,-1.159639,-0.720655,2.263618,-1.148618,-0.737340,2.242274,\n\t\t          -1.170722,-0.717494,2.238046,-1.170147,-0.723097,2.230021,-1.156951,-0.736478,2.227148,-1.170168,-0.712958,2.255942,\n\t\t          -1.166125,-0.716775,2.261750,-1.160255,-0.737197,2.229282,-1.164708,-0.717843,2.259247,-1.152189,-0.738941,2.241349,\n\t\t          -1.170189,-0.726422,2.230247,-1.168444,-0.714271,2.252966,-1.169840,-0.720716,2.237552,-1.152107,-0.733359,2.249990,\n\t\t          -1.169327,-0.683260,2.296621,-1.171769,-0.657708,2.320756,-1.165304,-0.625177,2.342040,-1.166679,-0.636466,2.334487,\n\t\t          -1.158080,-0.722091,2.260293,-1.137843,-0.666943,2.277246,-1.139875,-0.648862,2.295922,-1.132692,-0.606336,2.320593,\n\t\t          -1.133389,-0.622694,2.312137,-1.160173,-0.718130,2.267620,-1.146011,-0.724985,2.258158,-1.168834,-0.708956,2.239359,\n\t\t          -1.171009,-0.710742,2.258118,-1.165632,-0.712753,2.231786,-1.143795,-0.727551,2.252002,-1.166966,-0.714436,2.264973,\n\t\t          -1.146873,-0.728864,2.227229,-1.140696,-0.704687,2.244983,-1.168136,-0.708586,2.272176,-1.140039,-0.712219,2.265630,\n\t\t          -1.160440,-0.694117,2.244983,-1.171646,-0.703435,2.265527,-1.166145,-0.694507,2.249764,-1.142522,-0.712301,2.269591,\n\t\t          -1.159434,-0.712589,2.274845,-1.167336,-0.625608,2.310597,-1.170106,-0.636486,2.322706,-1.157936,-0.648862,2.333461,\n\t\t          -1.159968,-0.624418,2.305774,-1.137001,-0.650565,2.327222,-1.142482,-0.651633,2.330649,-1.168198,-0.643649,2.330465,\n\t\t          -1.135545,-0.633469,2.305815,-1.171748,-0.662818,2.316036,-1.161056,-0.642069,2.289642,-1.177331,-0.654937,2.307396,\n\t\t          -1.170332,-0.644449,2.294588,-1.138890,-0.654034,2.289704,-1.171605,-0.668196,2.310638,-1.139813,-0.672198,2.309387,\n\t\t          -1.160501,-0.645496,2.286666,-1.159618,-0.706801,2.281145,-1.143240,-0.703948,2.278190,-1.166043,-0.685087,2.259759,\n\t\t          -1.172528,-0.697668,2.271993,-1.159414,-0.682747,2.257153,-1.140470,-0.701998,2.276220,-1.168485,-0.703107,2.278169,\n\t\t          -1.141250,-0.689171,2.260766,-1.138644,-0.656517,2.286276,-1.139300,-0.675995,2.304501,-1.161445,-0.680284,2.308606,\n\t\t          -1.143877,-0.679012,2.306247,-1.176695,-0.660048,2.302141,-1.161466,-0.674845,2.314497,-1.169716,-0.648226,2.290853,\n\t\t          -1.145108,-0.674414,2.311932,-1.169039,-0.653357,2.286544,-1.174868,-0.666020,2.296826,-1.171051,-0.675358,2.304871,\n\t\t          -1.160152,-0.650299,2.282048,-1.139834,-0.661197,2.320531,-1.145047,-0.661833,2.323323,-1.170538,-0.652638,2.324553,\n\t\t          -1.138459,-0.644408,2.297770,-1.139259,-0.651818,2.293254,-1.139854,-0.668852,2.312752,-1.145950,-0.670515,2.316098,\n\t\t          -1.160994,-0.670063,2.320634,-1.169737,-0.635213,2.302839,-1.172549,-0.645229,2.316755,-1.160050,-0.658960,2.327283,\n\t\t          -1.161363,-0.632853,2.296846,-1.159618,-0.698755,2.287898,-1.166904,-0.678847,2.265773,-1.159537,-0.676980,2.261566,\n\t\t          -1.168054,-0.695102,2.284861,-1.141250,-0.682911,2.265588,-1.144267,-0.698715,2.284573,-1.171933,-0.689315,2.278580,\n\t\t          -1.140737,-0.697134,2.281884,-1.159618,-0.703373,2.283957,-1.166700,-0.681926,2.262510,-1.159721,-0.679525,2.259226,\n\t\t          -1.168403,-0.700049,2.280735,-1.141599,-0.686133,2.263721,-1.143959,-0.701444,2.281392,-1.172241,-0.694076,2.275317,\n\t\t          -1.140676,-0.699782,2.278683,-1.141845,-0.718253,2.233078,-1.141086,-0.717945,2.259759,-1.171297,-0.706822,2.261196,\n\t\t          -1.162164,-0.702614,2.238251,-1.167582,-0.701259,2.244346,-1.167767,-0.711316,2.268400,-1.159701,-0.715421,2.271294,\n\t\t          -1.143015,-0.717617,2.263782,-1.134046,-0.673655,2.282664,-1.135134,-0.656579,2.304564,-1.127130,-0.617543,2.325579,\n\t\t          -1.128607,-0.631560,2.318828,-1.151943,-0.739044,2.232586,-1.154529,-0.740563,2.234146,-1.142707,-0.731779,2.235233,\n\t\t          -1.137371,-0.708156,2.251447,-1.131050,-0.642315,2.314230,-1.134354,-0.662161,2.298098,-1.133738,-0.665753,2.293398,\n\t\t          -1.137987,-0.694076,2.265732,-1.133903,-0.652967,2.306698,-1.135011,-0.659904,2.301669,-1.137268,-0.687570,2.271622,\n\t\t          -1.138274,-0.691347,2.269550,-1.138561,-0.719546,2.242643,-1.148166,-0.681926,2.259904,-1.147756,-0.678519,2.261792,\n\t\t          -1.149008,-0.645619,2.289971,-1.146176,-0.637594,2.294917,-1.150527,-0.711398,2.229918,-1.144924,-0.627558,2.302285,\n\t\t          -1.157361,-0.722256,2.224171,-1.165263,-0.732271,2.226984,-1.142358,-0.617460,2.309243,-1.147859,-0.684922,2.257030,\n\t\t          -1.148208,-0.648513,2.286256,-1.148166,-0.699412,2.241391,-1.148105,-0.651530,2.282459,-1.140162,-0.593694,2.311829,\n\t\t          -1.148187,-0.642458,2.292413,-1.147120,-0.662428,2.271725,-1.164442,-0.730670,2.224972,-1.162615,-0.717063,2.258076,\n\t\t          -1.161260,-0.737340,2.231642,-1.153770,-0.737915,2.240324,-1.167746,-0.727386,2.230821,-1.166843,-0.714682,2.252166,\n\t\t          -1.167418,-0.722132,2.236916,-1.152764,-0.732599,2.247733,-1.157977,-0.721435,2.258220,-1.156376,-0.738859,2.235295,\n\t\t          -1.166125,-0.732107,2.229425,-1.163334,-0.730116,2.242664,-1.162348,-0.734693,2.236239,-1.159763,-0.687037,2.252227,\n\t\t          -1.165899,-0.688494,2.256126,-1.140676,-0.693563,2.255778,-1.159495,-0.709305,2.278149,-1.171872,-0.700377,2.269200,\n\t\t          -1.168341,-0.705857,2.275378,-1.139813,-0.705549,2.271827,-1.142646,-0.706822,2.274885,-1.137535,-0.698058,2.259801,\n\t\t          -1.147325,-0.689315,2.251715,-1.196028,-0.654116,2.235645,-1.214746,-0.626922,2.220477,-1.220780,-0.638272,2.232237,\n\t\t          -1.209020,-0.652495,2.237491,-1.205695,-0.631047,2.273901,-1.219651,-0.613602,2.266491,-1.212920,-0.600590,2.253069,\n\t\t          -1.191657,-0.632156,2.270104,-1.177002,-0.609477,2.293233,-1.201262,-0.579717,2.277081,-1.209923,-0.590389,2.294547,\n\t\t          -1.189584,-0.594043,2.317041,-1.207932,-0.574607,2.309016,-1.191657,-0.564714,2.291858,-1.165632,-0.598271,2.310043,\n\t\t          -1.195535,-0.605864,2.299371,-1.186239,-0.630267,2.267764,-1.190692,-0.653131,2.232237,-1.185499,-0.561738,2.284860,\n\t\t          -1.193360,-0.576536,2.271416,-1.206290,-0.598127,2.248267,-1.206331,-0.624008,2.215223,-1.159865,-0.594453,2.306061,\n\t\t          -1.170846,-0.605331,2.288985,-1.213514,-0.689151,2.190306,-1.217352,-0.678581,2.199789,-1.214438,-0.693727,2.182713,\n\t\t          -1.227491,-0.667477,2.180804,-1.228168,-0.672608,2.170419,-1.221806,-0.689089,2.165103,-1.226116,-0.666102,2.193878,\n\t\t          -1.222545,-0.671459,2.199276,-1.224638,-0.689130,2.168120,-1.221416,-0.672382,2.196320,-1.217208,-0.693543,2.182077,\n\t\t          -1.228764,-0.675810,2.171671,-1.224371,-0.668155,2.192256,-1.227963,-0.670535,2.179511,-1.214725,-0.689253,2.189158,\n\t\t          -1.218359,-0.645742,2.237244,-1.215813,-0.623064,2.272423,-1.202760,-0.587475,2.313594,-1.205346,-0.599297,2.300028,\n\t\t          -1.216675,-0.678909,2.196751,-1.188558,-0.635583,2.218527,-1.181456,-0.611221,2.251427,-1.155330,-0.568532,2.285455,\n\t\t          -1.169286,-0.587434,2.272299,-1.217352,-0.676836,2.203483,-1.209656,-0.685969,2.195294,-1.226690,-0.662121,2.182938,\n\t\t          -1.226403,-0.664173,2.196280,-1.224659,-0.665056,2.173744,-1.207583,-0.691162,2.185832,-1.223202,-0.670166,2.201780,\n\t\t          -1.210723,-0.684019,2.162723,-1.196541,-0.661710,2.184684,-1.222976,-0.666266,2.208204,-1.201302,-0.675974,2.203873,\n\t\t          -1.214971,-0.649232,2.187742,-1.226095,-0.659227,2.203483,-1.221642,-0.649847,2.193139,-1.205469,-0.676282,2.206952,\n\t\t          -1.215793,-0.672547,2.210523,-1.203602,-0.584027,2.272073,-1.212078,-0.596793,2.287241,-1.197321,-0.612145,2.292166,\n\t\t          -1.196254,-0.581400,2.265712,-1.174806,-0.612330,2.283403,-1.181087,-0.614710,2.288123,-1.207891,-0.605762,2.292269,\n\t\t          -1.172097,-0.594310,2.267209,-1.216162,-0.628051,2.265609,-1.206864,-0.601165,2.244305,-1.219795,-0.619390,2.259062,\n\t\t          -1.213740,-0.604920,2.248451,-1.181579,-0.618323,2.242438,-1.216060,-0.634352,2.255060,-1.188475,-0.639072,2.256311,\n\t\t          -1.207049,-0.606829,2.237573,-1.213206,-0.668832,2.216557,-1.203088,-0.669591,2.215675,-1.219713,-0.643054,2.201903,\n\t\t          -1.224864,-0.653234,2.209846,-1.212222,-0.640365,2.197346,-1.198491,-0.668216,2.214053,-1.222381,-0.661956,2.215325,\n\t\t          -1.193258,-0.650791,2.199522,-1.185027,-0.627168,2.229630,-1.188701,-0.644962,2.244983,-1.207049,-0.644449,2.249190,\n\t\t          -1.193524,-0.646461,2.246851,-1.219405,-0.625793,2.250421,-1.206947,-0.639051,2.257092,-1.213761,-0.611344,2.241863,\n\t\t          -1.193729,-0.640139,2.257297,-1.213699,-0.618220,2.232669,-1.219549,-0.631499,2.242725,-1.216860,-0.638990,2.247650,\n\t\t          -1.205059,-0.615285,2.226224,-1.184843,-0.627312,2.271397,-1.190425,-0.628318,2.274495,-1.213699,-0.617994,2.278641,\n\t\t          -1.179896,-0.608122,2.254198,-1.181559,-0.614177,2.247363,-1.187182,-0.633510,2.263639,-1.192950,-0.635522,2.265322,\n\t\t          -1.205715,-0.634660,2.266902,-1.211483,-0.596978,2.258015,-1.217332,-0.608635,2.272340,-1.203048,-0.625855,2.278580,\n\t\t          -1.204607,-0.594761,2.252186,-1.211503,-0.662798,2.225649,-1.218132,-0.637143,2.209455,-1.211134,-0.634290,2.204366,\n\t\t          -1.221088,-0.655286,2.224910,-1.193873,-0.645886,2.207896,-1.200687,-0.663619,2.223740,-1.223243,-0.646912,2.219450,\n\t\t          -1.196623,-0.662880,2.220724,-1.212283,-0.666082,2.220909,-1.219036,-0.640345,2.205638,-1.211667,-0.637574,2.201164,\n\t\t          -1.222340,-0.658488,2.220477,-1.193421,-0.648513,2.203709,-1.201816,-0.666410,2.219985,-1.224721,-0.649868,2.214771,\n\t\t          -1.197383,-0.665343,2.217419,-1.200769,-0.673039,2.170830,-1.203889,-0.683240,2.194945,-1.226095,-0.662203,2.198312,\n\t\t          -1.219487,-0.657934,2.178588,-1.224638,-0.656641,2.186449,-1.222791,-0.668914,2.203361,-1.216490,-0.675461,2.205762,\n\t\t          -1.207871,-0.681516,2.201000,-1.186198,-0.643054,2.222119,-1.180553,-0.620621,2.257687,-1.147222,-0.579861,2.300376,\n\t\t          -1.166884,-0.596116,2.279134,-1.217763,-0.694610,2.171364,-1.220677,-0.693789,2.172369,-1.206434,-0.691285,2.170419,\n\t\t          -1.194078,-0.669448,2.191251,-1.169881,-0.603545,2.273654,-1.180081,-0.626881,2.248595,-1.182421,-0.635316,2.235193,\n\t\t          -1.191020,-0.658878,2.204859,-1.178419,-0.618076,2.261175,-1.180348,-0.624336,2.254034,-1.191513,-0.653603,2.213274,\n\t\t          -1.191123,-0.655922,2.208758,-1.198080,-0.680161,2.177582,-1.199189,-0.642315,2.200425,-1.199230,-0.639852,2.204489,\n\t\t          -1.188701,-0.606316,2.243340,-1.187039,-0.600611,2.250010,-1.207275,-0.664563,2.170460,-1.180594,-0.586572,2.263515,\n\t\t          -1.216408,-0.675317,2.161348,-1.227204,-0.682932,2.166930,-1.177023,-0.580743,2.270288,-1.199209,-0.644532,2.196362,\n\t\t          -1.188804,-0.610585,2.236979,-1.203088,-0.654650,2.182754,-1.191041,-0.619657,2.225710,-1.170476,-0.557161,2.284675,\n\t\t          -1.188948,-0.603381,2.247117,-1.193873,-0.628974,2.215100,-1.225295,-0.681536,2.163565,-1.220574,-0.673183,2.194883,\n\t\t          -1.225069,-0.688596,2.170686,-1.218132,-0.692475,2.179491,-1.228045,-0.677370,2.171897,-1.223304,-0.668442,2.191580,\n\t\t          -1.226711,-0.673060,2.179121,-1.216265,-0.687940,2.186715,-1.216572,-0.678458,2.195601,-1.221847,-0.691695,2.172739,\n\t\t          -1.226526,-0.683506,2.168448,-1.222996,-0.680941,2.183062,-1.224392,-0.685620,2.176371,-1.213145,-0.643403,2.193756,\n\t\t          -1.220369,-0.645681,2.198413,-1.193873,-0.654342,2.194453,-1.214561,-0.670433,2.213786,-1.225398,-0.655943,2.207075,\n\t\t          -1.222463,-0.664132,2.211570,-1.200071,-0.671315,2.210625,-1.204053,-0.672321,2.212391,-1.191636,-0.662326,2.199932,\n\t\t          -1.199763,-0.648041,2.191559,-1.225747,-0.589835,2.228193,-1.239867,-0.562395,2.216926,-1.245121,-0.570112,2.223432,\n\t\t          -1.237261,-0.585402,2.229959,-1.230365,-0.570358,2.263003,-1.239293,-0.553795,2.256066,-1.234633,-0.544724,2.247487,\n\t\t          -1.217763,-0.575756,2.259473,-1.203642,-0.563031,2.279873,-1.221355,-0.528797,2.269550,-1.228292,-0.539880,2.282767,\n\t\t          -1.211627,-0.551907,2.298632,-1.225972,-0.531219,2.295799,-1.205531,-0.514123,2.279586,-1.195433,-0.556648,2.289232,\n\t\t          -1.217045,-0.556361,2.286194,-1.211565,-0.573950,2.256045,-1.219056,-0.588973,2.225156,-1.201016,-0.513959,2.270534,\n\t\t          -1.215320,-0.527299,2.263125,-1.228046,-0.540948,2.242171,-1.233156,-0.559111,2.212020,-1.189091,-0.557551,2.283793,\n\t\t          -1.198778,-0.561328,2.274414,-1.246866,-0.622078,2.167957,-1.248775,-0.609395,2.181419,-1.245984,-0.625280,2.159070,\n\t\t          -1.256923,-0.598045,2.158495,-1.257517,-0.602006,2.150675,-1.249678,-0.615819,2.146160,-1.254316,-0.596403,2.175837,\n\t\t          -1.252777,-0.601924,2.181091,-1.254152,-0.617850,2.147433,-1.252305,-0.603094,2.178772,-1.249821,-0.624582,2.157592,\n\t\t          -1.259365,-0.605228,2.151845,-1.254152,-0.598045,2.173867,-1.259221,-0.601041,2.157448,-1.249185,-0.622489,2.165843,\n\t\t          -1.244670,-0.577952,2.228296,-1.237897,-0.561861,2.260991,-1.221519,-0.542466,2.298118,-1.224946,-0.548972,2.286297,\n\t\t          -1.248262,-0.610010,2.178792,-1.213884,-0.568963,2.213314,-1.205038,-0.552256,2.241781,-1.181600,-0.529885,2.272710,\n\t\t          -1.192006,-0.540147,2.260930,-1.248405,-0.608184,2.184621,-1.240955,-0.619082,2.172985,-1.254234,-0.592893,2.163318,\n\t\t          -1.254747,-0.594761,2.178382,-1.252243,-0.594309,2.156032,-1.238225,-0.621668,2.165864,-1.253043,-0.600713,2.184417,\n\t\t          -1.239231,-0.609743,2.148849,-1.225562,-0.591723,2.172657,-1.252243,-0.595705,2.192831,-1.228456,-0.609210,2.186961,\n\t\t          -1.243213,-0.581072,2.175612,-1.252612,-0.588994,2.187885,-1.248590,-0.582611,2.179901,-1.233894,-0.609292,2.191210,\n\t\t          -1.245963,-0.602293,2.194883,-1.225316,-0.534277,2.264480,-1.230878,-0.543985,2.275235,-1.220390,-0.559542,2.279770,\n\t\t          -1.218810,-0.530993,2.258837,-1.202431,-0.564365,2.271438,-1.208506,-0.566356,2.275645,-1.227717,-0.551640,2.279873,\n\t\t          -1.194817,-0.542179,2.256538,-1.239990,-0.564468,2.255963,-1.228764,-0.542651,2.238168,-1.241448,-0.556792,2.250996,\n\t\t          -1.236234,-0.546612,2.242560,-1.207706,-0.555889,2.235890,-1.240544,-0.566541,2.250339,-1.213617,-0.578055,2.248718,\n\t\t          -1.229113,-0.545114,2.233714,-1.243787,-0.598927,2.203565,-1.231699,-0.603730,2.201430,-1.245634,-0.575920,2.191517,\n\t\t          -1.251504,-0.584171,2.197388,-1.238308,-0.573498,2.188071,-1.225152,-0.602704,2.198948,-1.250642,-0.591169,2.201185,\n\t\t          -1.222956,-0.581646,2.190881,-1.208219,-0.557572,2.233160,-1.214212,-0.580128,2.244140,-1.234613,-0.576741,2.247548,\n\t\t          -1.220328,-0.581770,2.246850,-1.241653,-0.559665,2.245803,-1.234223,-0.574401,2.253499,-1.236891,-0.549465,2.237922,\n\t\t          -1.219795,-0.579553,2.251981,-1.236850,-0.551989,2.233099,-1.242022,-0.562005,2.240098,-1.241242,-0.569168,2.244818,\n\t\t          -1.229933,-0.546961,2.230144,-1.210148,-0.571877,2.260211,-1.216408,-0.573129,2.264132,-1.235167,-0.559522,2.265979,\n\t\t          -1.203191,-0.549650,2.244079,-1.206557,-0.554165,2.240282,-1.212632,-0.575510,2.253233,-1.218768,-0.577665,2.256209,\n\t\t          -1.232848,-0.572554,2.259103,-1.232027,-0.542302,2.253336,-1.236933,-0.551353,2.261012,-1.227573,-0.567362,2.266696,\n\t\t          -1.225808,-0.538751,2.247117,-1.240401,-0.593735,2.213355,-1.243787,-0.570543,2.201923,-1.237692,-0.568244,2.196957,\n\t\t          -1.248015,-0.584602,2.211898,-1.219528,-0.576721,2.197962,-1.230016,-0.598435,2.211673,-1.247749,-0.577172,2.208450,\n\t\t          -1.223571,-0.597840,2.209353,-1.241837,-0.596731,2.207978,-1.244855,-0.573621,2.196505,-1.238225,-0.571200,2.191908,\n\t\t          -1.249103,-0.588440,2.206192,-1.221745,-0.579799,2.193631,-1.231062,-0.601616,2.205987,-1.249554,-0.580702,2.201718,\n\t\t          -1.224741,-0.600549,2.203525,-1.230714,-0.601267,2.158577,-1.232868,-0.615121,2.175591,-1.254152,-0.592647,2.183001,\n\t\t          -1.248385,-0.588706,2.164077,-1.252530,-0.588419,2.170830,-1.252612,-0.598353,2.188480,-1.247399,-0.605515,2.189630,\n\t\t          -1.238082,-0.614382,2.182118,-1.212160,-0.577603,2.216987,-1.204279,-0.562949,2.247158,-1.180738,-0.545606,2.280468,\n\t\t          -1.191000,-0.550532,2.265280,-1.246476,-0.621483,2.149567,-1.251587,-0.621955,2.149937,-1.236789,-0.616434,2.153158,\n\t\t          -1.222976,-0.599769,2.176864,-1.194120,-0.552708,2.260970,-1.206885,-0.566274,2.241001,-1.207008,-0.568183,2.237265,\n\t\t          -1.220144,-0.590574,2.193756,-1.201877,-0.560445,2.249908,-1.205962,-0.564653,2.245249,-1.216839,-0.585135,2.201307,\n\t\t          -1.219322,-0.588727,2.197182,-1.228312,-0.608327,2.163688,-1.227183,-0.573888,2.191805,-1.225623,-0.570522,2.195355,\n\t\t          -1.213494,-0.544806,2.238066,-1.210333,-0.541481,2.242458,-1.236686,-0.594494,2.156791,-1.203048,-0.534277,2.254238,\n\t\t          -1.243541,-0.602827,2.147268,-1.257456,-0.613191,2.146242,-1.199969,-0.531383,2.258693,-1.228887,-0.575838,2.188111,\n\t\t          -1.215156,-0.547064,2.234577,-1.231575,-0.585258,2.170850,-1.215526,-0.549301,2.230862,-1.186649,-0.513938,2.270617,\n\t\t          -1.212386,-0.543308,2.240180,-1.220903,-0.561102,2.210666,-1.253988,-0.610585,2.144908,-1.250149,-0.603401,2.176864,\n\t\t          -1.254849,-0.617070,2.150285,-1.250683,-0.622263,2.159213,-1.259139,-0.607322,2.152871,-1.253372,-0.598989,2.172595,\n\t\t          -1.258852,-0.603053,2.158085,-1.249657,-0.620416,2.165042,-1.247728,-0.610051,2.177356,-1.252612,-0.620559,2.151804,\n\t\t          -1.256799,-0.613130,2.149013,-1.255773,-0.612802,2.161471,-1.256615,-0.615162,2.157079,-1.239600,-0.575818,2.183862,\n\t\t          -1.246558,-0.578301,2.186694,-1.223017,-0.583965,2.185257,-1.244896,-0.600672,2.199399,-1.252079,-0.586531,2.192873,\n\t\t          -1.251463,-0.593653,2.197018,-1.226013,-0.604961,2.194576,-1.232499,-0.606213,2.197223,-1.220246,-0.593242,2.188788,\n\t\t          -1.229790,-0.577583,2.183616,-1.223571,-0.521552,2.228543,-1.231699,-0.495877,2.220292,-1.239005,-0.503840,2.226470,\n\t\t          -1.235845,-0.514882,2.228994,-1.233320,-0.506426,2.254731,-1.236891,-0.494379,2.250607,-1.228107,-0.486970,2.240488,\n\t\t          -1.219446,-0.516052,2.251673,-1.211503,-0.508992,2.270946,-1.220328,-0.478699,2.258672,-1.228620,-0.486826,2.270534,\n\t\t          -1.221539,-0.494091,2.291797,-1.223469,-0.481120,2.286235,-1.214541,-0.471885,2.269017,-1.207748,-0.507350,2.280324,\n\t\t          -1.225193,-0.498525,2.276568,-1.213453,-0.514328,2.248328,-1.218399,-0.521060,2.226921,-1.207275,-0.472603,2.262223,\n\t\t          -1.213617,-0.477939,2.253746,-1.220965,-0.485451,2.236670,-1.226465,-0.494235,2.217501,-1.203048,-0.508520,2.272259,\n\t\t          -1.205982,-0.509135,2.267518,-1.235167,-0.535858,2.185442,-1.238779,-0.528572,2.191641,-1.234982,-0.537233,2.180866,\n\t\t          -1.241776,-0.517366,2.176433,-1.241591,-0.518802,2.172225,-1.239580,-0.530706,2.168265,-1.241427,-0.518741,2.186407,\n\t\t          -1.240565,-0.523112,2.190163,-1.241714,-0.530809,2.169722,-1.240647,-0.523769,2.188850,-1.237240,-0.537151,2.180086,\n\t\t          -1.243130,-0.520506,2.172636,-1.241714,-0.518884,2.185524,-1.243192,-0.518946,2.176453,-1.237363,-0.535550,2.184232,\n\t\t          -1.239375,-0.509874,2.228543,-1.236830,-0.500372,2.253849,-1.224577,-0.487154,2.289910,-1.227758,-0.492675,2.274784,\n\t\t          -1.238943,-0.528818,2.190184,-1.212529,-0.503471,2.218240,-1.206783,-0.497109,2.238230,-1.195864,-0.489453,2.263351,\n\t\t          -1.200215,-0.491793,2.255738,-1.238595,-0.527710,2.194576,-1.232109,-0.534298,2.189487,-1.240052,-0.514061,2.178710,\n\t\t          -1.241324,-0.517099,2.188993,-1.239087,-0.515108,2.174134,-1.230590,-0.535673,2.184581,-1.240668,-0.522086,2.192606,\n\t\t          -1.231001,-0.527997,2.167484,-1.217866,-0.515580,2.189014,-1.242084,-0.518741,2.202335,-1.224413,-0.529906,2.199665,\n\t\t          -1.232889,-0.504723,2.190800,-1.242269,-0.512666,2.198927,-1.237117,-0.505462,2.193200,-1.228846,-0.529926,2.202415,\n\t\t          -1.239005,-0.524857,2.203545,-1.222299,-0.481141,2.254136,-1.230078,-0.488673,2.264152,-1.227204,-0.500536,2.269385,\n\t\t          -1.215793,-0.479827,2.250298,-1.207234,-0.509505,2.262552,-1.213022,-0.510079,2.265917,-1.230180,-0.495159,2.268092,\n\t\t          -1.202145,-0.492080,2.251673,-1.237466,-0.502486,2.248471,-1.222524,-0.487503,2.232381,-1.237486,-0.496657,2.245680,\n\t\t          -1.229174,-0.489166,2.236321,-1.209225,-0.500126,2.229589,-1.237815,-0.504990,2.242519,-1.215320,-0.516996,2.238948,\n\t\t          -1.223448,-0.489268,2.228646,-1.238123,-0.520608,2.214833,-1.227101,-0.526396,2.213293,-1.235536,-0.500844,2.205042,\n\t\t          -1.241817,-0.508869,2.211508,-1.230590,-0.499407,2.202683,-1.222361,-0.525842,2.211549,-1.241468,-0.515026,2.214279,\n\t\t          -1.215752,-0.509607,2.202970,-1.210539,-0.501336,2.225013,-1.216573,-0.518700,2.233119,-1.234901,-0.512378,2.236773,\n\t\t          -1.222381,-0.519192,2.235418,-1.237753,-0.499346,2.239913,-1.234141,-0.510326,2.243218,-1.229893,-0.491321,2.232134,\n\t\t          -1.220923,-0.518166,2.241391,-1.230426,-0.493065,2.226942,-1.238000,-0.501049,2.233038,-1.238143,-0.507329,2.236568,\n\t\t          -1.224126,-0.491608,2.224397,-1.212653,-0.513343,2.252823,-1.218276,-0.514533,2.256722,-1.234839,-0.498997,2.258057,\n\t\t          -1.205756,-0.495425,2.242356,-1.207768,-0.498791,2.233427,-1.214315,-0.515847,2.243382,-1.220205,-0.517181,2.246522,\n\t\t          -1.233997,-0.508356,2.249231,-1.226896,-0.484815,2.245003,-1.235249,-0.492757,2.254362,-1.231411,-0.504846,2.259001,\n\t\t          -1.219774,-0.483316,2.240631,-1.236563,-0.518146,2.221893,-1.233710,-0.498525,2.212513,-1.229072,-0.496862,2.209969,\n\t\t          -1.239950,-0.512461,2.221565,-1.215526,-0.507227,2.210133,-1.225336,-0.524179,2.220909,-1.240031,-0.506509,2.218876,\n\t\t          -1.220185,-0.523625,2.219348,-1.237220,-0.518987,2.218342,-1.234633,-0.499407,2.209025,-1.229749,-0.498032,2.206603,\n\t\t          -1.240626,-0.513630,2.218261,-1.215916,-0.508315,2.206398,-1.226342,-0.525021,2.216742,-1.240976,-0.507699,2.215490,\n\t\t          -1.221683,-0.524610,2.215243,-1.221765,-0.522086,2.175201,-1.226999,-0.532943,2.191292,-1.242207,-0.515067,2.193200,\n\t\t          -1.236358,-0.510203,2.179921,-1.239026,-0.509792,2.184067,-1.242105,-0.520526,2.196957,-1.239395,-0.527176,2.199235,\n\t\t          -1.230303,-0.532060,2.195869,-1.210970,-0.510059,2.220107,-1.206126,-0.502198,2.240016,-1.194120,-0.500290,2.271191,\n\t\t          -1.200112,-0.497416,2.258590,-1.236891,-0.535098,2.171281,-1.239539,-0.535098,2.172574,-1.228292,-0.533785,2.171795,\n\t\t          -1.217312,-0.521758,2.191620,-1.201939,-0.497704,2.254095,-1.208035,-0.505790,2.231621,-1.209451,-0.507042,2.226717,\n\t\t          -1.215075,-0.516688,2.205556,-1.205367,-0.500905,2.244757,-1.207008,-0.504374,2.235705,-1.214377,-0.512768,2.212349,\n\t\t          -1.215054,-0.514554,2.208861,-1.220759,-0.527586,2.179121,-1.219590,-0.502588,2.205084,-1.218584,-0.501808,2.208717,\n\t\t          -1.210457,-0.493825,2.232094,-1.207932,-0.490418,2.240509,-1.226240,-0.515826,2.173560,-1.204300,-0.486929,2.249600,\n\t\t          -1.234100,-0.521347,2.166499,-1.243192,-0.525575,2.169270,-1.202021,-0.486046,2.253171,-1.219651,-0.503655,2.200897,\n\t\t          -1.211893,-0.495036,2.228153,-1.221724,-0.509341,2.187392,-1.213453,-0.496472,2.224151,-1.198122,-0.483727,2.259412,\n\t\t          -1.209266,-0.492142,2.236547,-1.215834,-0.498463,2.216475,-1.241078,-0.524754,2.167772,-1.240442,-0.523871,2.187331,\n\t\t          -1.243069,-0.530747,2.171835,-1.238800,-0.535632,2.178567,-1.243090,-0.521758,2.173990,-1.241283,-0.519746,2.184232,\n\t\t          -1.242843,-0.520342,2.176556,-1.237383,-0.534872,2.183205,-1.238657,-0.529228,2.189014,-1.240565,-0.534544,2.174154,\n\t\t          -1.243726,-0.526253,2.170932,-1.241345,-0.527751,2.179942,-1.242166,-0.528756,2.176905,-1.231596,-0.500967,2.198803,\n\t\t          -1.236152,-0.502424,2.200753,-1.215834,-0.511229,2.198968,-1.238328,-0.522209,2.210174,-1.242146,-0.510428,2.205987,\n\t\t          -1.241714,-0.516750,2.209189,-1.222730,-0.527402,2.207342,-1.227635,-0.527484,2.209128,-1.215218,-0.518474,2.201739,\n\t\t          -1.219815,-0.504661,2.197429,-1.005608,-0.610154,2.367736,-1.046656,-0.624377,2.364965,-1.032474,-0.624808,2.376601,\n\t\t          -1.008050,-0.616824,2.376540,-1.008030,-0.604859,2.358726,-1.046471,-0.616516,2.357863,-0.994648,-0.645352,2.340623,\n\t\t          -1.002571,-0.641063,2.351768,-0.991508,-0.651304,2.331983,-1.026480,-0.659185,2.350558,-1.024962,-0.664665,2.340603,\n\t\t          -1.010390,-0.664768,2.326729,-1.020570,-0.650709,2.356715,-1.011765,-0.643915,2.357556,-1.006141,-0.670474,2.331224,\n\t\t          -1.011375,-0.645414,2.355237,-0.992144,-0.658877,2.334466,-1.018763,-0.670002,2.341486,-1.019112,-0.653480,2.355134,\n\t\t          -1.021719,-0.661669,2.351193,-0.995038,-0.649313,2.340870,-1.017573,-0.623228,2.381486,-1.002221,-0.642992,2.350680,\n\t\t          -1.032925,-0.604222,2.348690,-1.003145,-0.638354,2.353882,-0.995038,-0.640427,2.343353,-1.030154,-0.655553,2.350948,\n\t\t          -1.022335,-0.648164,2.357802,-1.030154,-0.658323,2.341239,-0.993335,-0.642951,2.333255,-1.012422,-0.641761,2.359772,\n\t\t          -1.014043,-0.656558,2.325436,-1.023443,-0.633346,2.331182,-1.014166,-0.637902,2.364800,-0.999635,-0.627743,2.339228,\n\t\t          -1.038098,-0.642643,2.344462,-1.025783,-0.642069,2.361496,-1.036783,-0.645106,2.353369,-0.998342,-0.629898,2.349941,\n\t\t          -1.004848,-0.632833,2.360163,-1.005936,-0.627845,2.365786,-1.001483,-0.622263,2.356304,-1.041073,-0.636404,2.357207,\n\t\t          -1.028841,-0.636219,2.366196,-1.043249,-0.630534,2.349716,-1.003248,-0.617543,2.346904,-1.015583,-0.634002,2.370158,\n\t\t          -1.029087,-0.618097,2.338038,-1.035429,-0.596629,2.353020,-1.010082,-0.598332,2.363713,-1.010328,-0.609251,2.381364,\n\t\t          -1.007701,-0.603648,2.372559,-1.049365,-0.616455,2.370301,-1.035121,-0.617748,2.381322,-1.020487,-0.616598,2.385817,\n\t\t          -1.049939,-0.609066,2.362830,-1.006326,-0.622017,2.372559,-1.043392,-0.628543,2.361516,-1.045137,-0.622222,2.354539,\n\t\t          -1.016260,-0.628646,2.377464,-1.030770,-0.610031,2.342820,-1.003802,-0.615264,2.363220,-1.030852,-0.629590,2.371984,\n\t\t          -1.005977,-0.610113,2.353533,-1.005690,-0.625485,2.368865,-1.042469,-0.632915,2.358870,-1.044295,-0.626655,2.352014,\n\t\t          -1.015480,-0.632135,2.373914,-1.029846,-0.613458,2.340460,-1.002488,-0.619472,2.359342,-1.029662,-0.633818,2.368433,\n\t\t          -1.004356,-0.614341,2.349552,-1.019092,-0.644264,2.327140,-0.996228,-0.634392,2.335123,-1.023915,-0.645373,2.359506,\n\t\t          -1.034239,-0.651325,2.342451,-1.033787,-0.650873,2.351891,-1.013263,-0.639954,2.361764,-1.004007,-0.635583,2.356796,\n\t\t          -0.996741,-0.634947,2.346575,-1.017122,-0.601534,2.349695,-0.998117,-0.658714,2.325724,-0.995921,-0.664645,2.331182,\n\t\t          -1.000949,-0.650155,2.324410,-1.009569,-0.627743,2.330321,-1.019892,-0.594392,2.355872,-1.014125,-0.614177,2.337545,\n\t\t          -1.016260,-0.607239,2.343292,-1.014987,-0.611077,2.339639,-1.005423,-0.638990,2.325887,-1.040478,-0.620683,2.346206,\n\t\t          -1.041381,-0.616804,2.348813,-1.029723,-0.649190,2.334959,-1.024962,-0.658529,2.333255,-1.014761,-0.672013,2.335102,\n\t\t          -1.039329,-0.624336,2.344092,-1.033992,-0.638682,2.338243,-1.045917,-0.603648,2.356899,-1.043987,-0.612453,2.353985,\n\t\t          -1.019585,-0.666184,2.332681,-1.011375,-0.646112,2.353512,-1.004623,-0.668791,2.336170,-0.994874,-0.660171,2.335329,\n\t\t          -1.015952,-0.668565,2.343148,-1.019318,-0.653398,2.354272,-1.019728,-0.660355,2.349428,-0.996269,-0.651509,2.341055,\n\t\t          -1.002365,-0.643300,2.349695,-0.997480,-0.665055,2.334487,-1.013140,-0.670761,2.339043,-1.006203,-0.658652,2.346288,\n\t\t          -1.004643,-0.665979,2.340418,-1.041402,-0.635255,2.347376,-1.039123,-0.640570,2.355093,-1.027917,-0.621237,2.336519,\n\t\t          -1.005444,-0.630411,2.363262,-1.027445,-0.639585,2.363919,-1.014802,-0.636240,2.367695,-1.001975,-0.621647,2.343559,\n\t\t          -0.999964,-0.625608,2.353615,-1.013037,-0.618363,2.335062,-1.037563,-0.629446,2.341937,-1.150363,-0.688329,2.299268,\n\t\t          -1.171051,-0.670617,2.281351,-1.174150,-0.645537,2.305179,-1.151553,-0.666287,2.322481,-1.166494,-0.606911,2.324697,\n\t\t          -1.148085,-0.634146,2.346761,-1.148023,-0.644716,2.338284,-1.169080,-0.622304,2.322296,-1.153133,-0.725457,2.261381,\n\t\t          -1.171051,-0.713328,2.246502,-1.154016,-0.726791,2.256763,-1.169039,-0.716221,2.244941,-1.171872,-0.709367,2.248328,\n\t\t          -1.150568,-0.721599,2.265096,-1.149336,-0.650832,2.332640,-1.170045,-0.631129,2.317206,-1.173780,-0.653233,2.295389,\n\t\t          -1.151984,-0.676159,2.314168,-1.147325,-0.712712,2.273101,-1.171256,-0.689315,2.264808,-1.147715,-0.706021,2.280448,\n\t\t          -1.173185,-0.658365,2.291140,-1.151060,-0.681126,2.308360,-1.170968,-0.697360,2.257646,-1.174232,-0.648883,2.300664,\n\t\t          -1.152436,-0.671664,2.318293,-1.150732,-0.661587,2.325600,-1.172652,-0.640468,2.310352,-1.149706,-0.700315,2.286769,\n\t\t          -1.171256,-0.682809,2.271212,-1.148372,-0.703291,2.283260,-1.171543,-0.686318,2.267887,-1.171071,-0.702511,2.251817,\n\t\t          -1.148105,-0.717371,2.268975,-1.167726,-0.716570,2.244203,-1.154262,-0.726586,2.255450,-1.163641,-0.725929,2.248122,\n\t\t          -1.171153,-0.692906,2.261689,-1.147140,-0.708135,2.277554,-1.201795,-0.654260,2.236773,-1.218584,-0.631335,2.225403,\n\t\t          -1.218687,-0.606460,2.260683,-1.198635,-0.632402,2.272259,-1.196746,-0.563072,2.301484,-1.171851,-0.595213,2.317226,\n\t\t          -1.185458,-0.609703,2.296395,-1.206721,-0.583986,2.285701,-1.213905,-0.684266,2.196854,-1.227060,-0.664953,2.187207,\n\t\t          -1.214192,-0.684122,2.194165,-1.226198,-0.667211,2.187104,-1.227306,-0.661710,2.189670,-1.213145,-0.681967,2.200856,\n\t\t          -1.188845,-0.614382,2.290895,-1.210210,-0.588809,2.279689,-1.217825,-0.617932,2.245659,-1.199948,-0.640755,2.256989,\n\t\t          -1.210682,-0.674866,2.209928,-1.223243,-0.647179,2.205453,-1.209081,-0.669550,2.217296,-1.217558,-0.623453,2.236876,\n\t\t          -1.199989,-0.646050,2.248471,-1.224700,-0.653357,2.197716,-1.219569,-0.611447,2.255101,-1.199620,-0.635870,2.266224,\n\t\t          -1.197096,-0.627907,2.277081,-1.216060,-0.602068,2.264931,-1.207008,-0.663639,2.225403,-1.221498,-0.641248,2.213889,\n\t\t          -1.207419,-0.667108,2.220825,-1.222443,-0.644080,2.209415,-1.226383,-0.658201,2.192482,-1.212160,-0.678991,2.204981,\n\t\t          -1.225664,-0.668483,2.186325,-1.215054,-0.683589,2.192873,-1.221683,-0.677021,2.189076,-1.223797,-0.649601,2.202047,\n\t\t          -1.209635,-0.672136,2.213375,-1.231637,-0.588132,2.230021,-1.243069,-0.566089,2.220456,-1.237938,-0.548664,2.251817,\n\t\t          -1.223161,-0.573929,2.261832,-1.220267,-0.518741,2.296477,-1.198491,-0.554042,2.296600,-1.210415,-0.561328,2.284389,\n\t\t          -1.225706,-0.532512,2.276159,-1.246763,-0.616167,2.176391,-1.256019,-0.596095,2.166910,-1.247461,-0.616496,2.173662,\n\t\t          -1.257374,-0.597922,2.166047,-1.255219,-0.593427,2.170030,-1.245244,-0.614649,2.180619,-1.214109,-0.563852,2.278929,\n\t\t          -1.228333,-0.537315,2.268667,-1.240360,-0.554083,2.241657,-1.224844,-0.578670,2.254341,-1.239950,-0.607034,2.194104,\n\t\t          -1.249000,-0.578978,2.193653,-1.237753,-0.602232,2.203380,-1.239950,-0.557120,2.236281,-1.226424,-0.580743,2.248225,\n\t\t          -1.251648,-0.585156,2.183780,-1.239929,-0.550861,2.247219,-1.223858,-0.576454,2.258630,-1.221396,-0.570974,2.265958,\n\t\t          -1.234613,-0.546079,2.257420,-1.235393,-0.596690,2.212883,-1.246147,-0.573601,2.205084,-1.236645,-0.599666,2.207649,\n\t\t          -1.247892,-0.576351,2.199234,-1.253824,-0.589692,2.177438,-1.242310,-0.610687,2.187433,-1.256820,-0.599707,2.165884,\n\t\t          -1.248507,-0.615388,2.172636,-1.253392,-0.608492,2.168120,-1.249945,-0.581236,2.189322,-1.239046,-0.604161,2.199132,\n\t\t          -1.229974,-0.519254,2.229097,-1.236440,-0.499510,2.224130,-1.234880,-0.490664,2.246933,-1.227450,-0.513117,2.254136,\n\t\t          -1.221273,-0.476564,2.279955,-1.215895,-0.503922,2.291654,-1.220205,-0.504620,2.275460,-1.226116,-0.482598,2.264911,\n\t\t          -1.236522,-0.532471,2.190040,-1.241591,-0.516976,2.181830,-1.237383,-0.532697,2.188541,-1.242289,-0.518597,2.180948,\n\t\t          -1.240852,-0.514472,2.184540,-1.235126,-0.531322,2.193488,-1.222319,-0.506262,2.269222,-1.227409,-0.484322,2.259657,\n\t\t          -1.234716,-0.494666,2.236916,-1.228271,-0.515170,2.242643,-1.234326,-0.528756,2.204427,-1.240052,-0.505174,2.208655,\n\t\t          -1.233176,-0.524590,2.214443,-1.235270,-0.497150,2.230575,-1.228948,-0.516955,2.236486,-1.240421,-0.508458,2.195951,\n\t\t          -1.235023,-0.493168,2.241616,-1.228148,-0.514164,2.248903,-1.226198,-0.510983,2.258877,-1.233587,-0.489022,2.251077,\n\t\t          -1.231616,-0.521983,2.221791,-1.238164,-0.502527,2.215982,-1.232479,-0.523215,2.218240,-1.239108,-0.503676,2.211652,\n\t\t          -1.240811,-0.510346,2.188378,-1.234182,-0.530193,2.198681,-1.242166,-0.519397,2.180825,-1.237322,-0.532081,2.186756,\n\t\t          -1.240463,-0.525842,2.184149,-1.240360,-0.506570,2.204263,-1.233935,-0.525924,2.209969,-1.134928,-0.681351,2.289335,\n\t\t          -1.136037,-0.662408,2.312486,-1.127027,-0.624295,2.334056,-1.129470,-0.637923,2.326996,-1.167418,-0.727448,2.225588,\n\t\t          -1.152743,-0.740747,2.236855,-1.153605,-0.660478,2.271910,-1.154899,-0.639770,2.291757,-1.147038,-0.596157,2.308709,\n\t\t          -1.150691,-0.614669,2.309859,-1.142030,-0.730609,2.242191,-1.138089,-0.711460,2.260602,-1.132589,-0.647569,2.321332,\n\t\t          -1.135791,-0.669058,2.305897,-1.135565,-0.672382,2.301300,-1.138232,-0.699207,2.272833,-1.135545,-0.658960,2.315031,\n\t\t          -1.135811,-0.665958,2.309325,-1.138089,-0.694466,2.278662,-1.138418,-0.697032,2.275624,-1.156992,-0.705446,2.233900,\n\t\t          -1.149090,-0.738634,2.236958,-1.139526,-0.718643,2.254259,-1.153421,-0.679956,2.258837,-1.154611,-0.643587,2.289520,\n\t\t          -1.154447,-0.634536,2.295800,-1.153092,-0.676939,2.260396,-1.153605,-0.624623,2.303147,-1.168095,-0.728248,2.227538,\n\t\t          -1.162841,-0.716837,2.226717,-1.153400,-0.682747,2.256373,-1.153461,-0.696683,2.241781,-1.154488,-0.650771,2.282151,\n\t\t          -1.154611,-0.646502,2.286154,-1.154899,-0.739434,2.237697,-1.167356,-0.729500,2.229425,-1.161445,-0.735268,2.234002,\n\t\t          -1.137637,-0.702840,2.268626,-1.152990,-0.686852,2.251653,-1.186792,-0.649006,2.227168,-1.181620,-0.626019,2.262202,\n\t\t          -1.151696,-0.589240,2.301608,-1.167418,-0.600405,2.283957,-1.227368,-0.675749,2.166397,-1.218214,-0.695595,2.176556,\n\t\t          -1.200379,-0.624233,2.212247,-1.197916,-0.599215,2.245927,-1.179609,-0.559994,2.284573,-1.186300,-0.577152,2.269139,\n\t\t          -1.205613,-0.692455,2.178198,-1.196562,-0.674148,2.198291,-1.171379,-0.608389,2.278518,-1.182236,-0.634044,2.252658,\n\t\t          -1.183775,-0.641350,2.240570,-1.193524,-0.665035,2.209887,-1.180143,-0.623125,2.265916,-1.182216,-0.629426,2.258795,\n\t\t          -1.192683,-0.659288,2.217829,-1.193278,-0.661874,2.214053,-1.212981,-0.661382,2.171897,-1.215793,-0.696047,2.175262,\n\t\t          -1.199230,-0.682973,2.185689,-1.205920,-0.638456,2.200159,-1.197978,-0.602170,2.242211,-1.196480,-0.595603,2.249785,\n\t\t          -1.205490,-0.635481,2.203463,-1.189440,-0.581667,2.262284,-1.228107,-0.679545,2.168490,-1.221662,-0.670371,2.165309,\n\t\t          -1.206454,-0.641145,2.195992,-1.209758,-0.650832,2.184273,-1.198450,-0.614874,2.223843,-1.198778,-0.606870,2.235049,\n\t\t          -1.219774,-0.693604,2.176309,-1.227347,-0.680654,2.169249,-1.224967,-0.687303,2.172739,-1.194160,-0.668298,2.206007,\n\t\t          -1.207173,-0.644285,2.191785,-1.214684,-0.585751,2.221708,-1.207132,-0.569722,2.251817,-1.184863,-0.552154,2.281248,\n\t\t          -1.194120,-0.557387,2.269509,-1.256820,-0.606090,2.146468,-1.250642,-0.623802,2.152276,-1.227758,-0.558803,2.210707,\n\t\t          -1.220677,-0.540311,2.239728,-1.195125,-0.515252,2.269836,-1.207398,-0.528140,2.259924,-1.236789,-0.619862,2.158249,\n\t\t          -1.224926,-0.606562,2.182487,-1.197014,-0.559891,2.265670,-1.209656,-0.573683,2.245105,-1.210251,-0.575859,2.240692,\n\t\t          -1.221621,-0.598291,2.196403,-1.205284,-0.567526,2.255183,-1.208589,-0.571282,2.249375,-1.219179,-0.594474,2.206090,\n\t\t          -1.220801,-0.596280,2.200938,-1.241694,-0.591683,2.158023,-1.245655,-0.623864,2.152974,-1.229810,-0.613294,2.169373,\n\t\t          -1.232930,-0.571610,2.190943,-1.220698,-0.541891,2.237122,-1.218379,-0.538423,2.243525,-1.232848,-0.567690,2.195786,\n\t\t          -1.211380,-0.531486,2.255080,-1.259139,-0.609805,2.147391,-1.246763,-0.598948,2.148910,-1.233033,-0.574237,2.187454,\n\t\t          -1.236399,-0.582693,2.171487,-1.222504,-0.545976,2.230575,-1.221334,-0.544108,2.233940,-1.251648,-0.621442,2.154801,\n\t\t          -1.258318,-0.611221,2.150265,-1.255937,-0.616434,2.153179,-1.222217,-0.601411,2.191600,-1.234244,-0.576023,2.183083,\n\t\t          -1.212858,-0.516894,2.223022,-1.207830,-0.508725,2.243443,-1.198347,-0.503861,2.271993,-1.200625,-0.502568,2.262449,\n\t\t          -1.241283,-0.520793,2.169824,-1.238000,-0.536453,2.175448,-1.220719,-0.495220,2.215879,-1.214274,-0.487196,2.235418,\n\t\t          -1.201406,-0.476420,2.259657,-1.206660,-0.480320,2.251694,-1.229256,-0.535550,2.178588,-1.219056,-0.526745,2.195335,\n\t\t          -1.202329,-0.503122,2.256661,-1.210026,-0.512235,2.235726,-1.211195,-0.514307,2.230164,-1.217496,-0.522455,2.208552,\n\t\t          -1.207152,-0.506611,2.247650,-1.209163,-0.510921,2.239728,-1.215793,-0.518967,2.215777,-1.216922,-0.520259,2.212041,\n\t\t          -1.232663,-0.513056,2.177253,-1.235393,-0.536535,2.175858,-1.223325,-0.531158,2.184888,-1.224413,-0.498894,2.205268,\n\t\t          -1.215957,-0.489022,2.231498,-1.213042,-0.485595,2.239585,-1.223386,-0.497827,2.208409,-1.207480,-0.481326,2.247630,\n\t\t          -1.243028,-0.522250,2.170727,-1.237445,-0.517406,2.171056,-1.225336,-0.500043,2.201430,-1.228230,-0.505421,2.188726,\n\t\t          -1.218543,-0.492819,2.223165,-1.217373,-0.490890,2.227599,-1.239683,-0.535611,2.176536,-1.243623,-0.523297,2.172266,\n\t\t          -1.242453,-0.529023,2.175119,-1.217455,-0.523995,2.204263,-1.226178,-0.501193,2.197798,-1.155453,-0.626696,2.352815,\n\t\t          -1.170127,-0.608532,2.340789,-1.136591,-0.628400,2.349470,-1.127519,-0.624664,2.344113,-1.164647,-0.618692,2.348136,\n\t\t          -1.129798,-0.601883,2.322809,-1.128177,-0.608389,2.327961,-1.135606,-0.587619,2.315072,-1.189666,-0.587557,2.327447,\n\t\t          -1.206372,-0.567382,2.319894,-1.201857,-0.579450,2.323097,-1.148864,-0.558331,2.293439,-1.141845,-0.571384,2.302264,\n\t\t          -1.158921,-0.548336,2.290525,-1.208220,-0.546099,2.309859,-1.223756,-0.523687,2.307272,-1.220000,-0.536268,2.308237,\n\t\t          -1.175464,-0.522702,2.276938,-1.168383,-0.534175,2.282911,-1.183488,-0.509731,2.272136,-1.216224,-0.492778,2.302798,\n\t\t          -1.219590,-0.475127,2.294260,-1.210498,-0.467636,2.274702,-1.201960,-0.468909,2.267928,-1.220267,-0.483542,2.298714,\n\t\t          -1.192560,-0.485861,2.267416,-1.189276,-0.496206,2.271684,-1.195064,-0.482167,2.263721,-1.148639,-0.628071,2.351645,\n\t\t          -1.217024,-0.472336,2.288206,-1.124605,-0.609395,2.336047,-1.194879,-0.476195,2.265179,-1.156314,-0.617132,2.358274,\n\t\t          -1.168608,-0.604777,2.349120,-1.130311,-0.616824,2.357207,-1.164175,-0.609764,2.357063,-1.119249,-0.588316,2.332845,\n\t\t          -1.118489,-0.604264,2.342779,-1.123086,-0.572924,2.324718,-1.191000,-0.577562,2.336334,-1.203109,-0.563873,2.329992,\n\t\t          -1.198307,-0.568121,2.338489,-1.139424,-0.544519,2.311911,-1.131460,-0.557038,2.317554,-1.148967,-0.531199,2.306266,\n\t\t          -1.207707,-0.534401,2.319074,-1.217722,-0.520013,2.317267,-1.213289,-0.525945,2.321721,-1.163909,-0.505318,2.288349,\n\t\t          -1.155761,-0.517284,2.297769,-1.171626,-0.492121,2.280222,-1.212714,-0.485677,2.310761,-1.214602,-0.473568,2.301526,\n\t\t          -1.206455,-0.463162,2.284471,-1.212981,-0.477796,2.309612,-1.193771,-0.466364,2.272299,-1.179958,-0.476256,2.273264,\n\t\t          -1.148762,-0.614608,2.362728,-1.209759,-0.465522,2.301382,-1.165140,-0.482516,2.285147,-1.124502,-0.604099,2.368331,\n\t\t          -1.162616,-0.601267,2.365088,-1.114733,-0.597429,2.346781,-1.112968,-0.583801,2.341547,-1.116437,-0.565843,2.332989,\n\t\t          -1.194407,-0.560343,2.346473,-1.136345,-0.537356,2.321084,-1.126247,-0.551066,2.326914,-1.145355,-0.523687,2.316344,\n\t\t          -1.151573,-0.509628,2.308935,-1.173678,-0.431022,2.306944,-1.026008,-0.535426,2.421385,-1.028061,-0.528920,2.399814,\n\t\t          -1.199415,-0.538197,2.326032,-1.170497,-0.593653,2.349223,-1.172857,-0.517078,2.389861,-1.139382,-0.600446,2.374961,\n\t\t          -1.102768,-0.574976,2.351275,-1.158531,-0.436296,2.300623,-1.097021,-0.578773,2.390230,-1.108494,-0.557018,2.347294,\n\t\t          -1.130270,-0.528961,2.335472,-1.120172,-0.541399,2.340972,-1.140203,-0.516791,2.328987,-1.151409,-0.488078,2.310331,\n\t\t          -1.147120,-0.503492,2.321558,-1.156951,-0.470592,2.296250,-1.203602,-0.481264,2.327447,-1.203930,-0.458319,2.307704,\n\t\t          -1.186095,-0.448795,2.288534,-1.190425,-0.460371,2.278806,-1.205367,-0.467226,2.322049,-1.034649,-0.530029,2.380810,\n\t\t          -1.051130,-0.538177,2.371306,-1.201816,-0.548193,2.312629,-1.129695,-0.551004,2.414222,-1.194489,-0.447995,2.304132,\n\t\t          -1.183550,-0.538259,2.370219,-1.160317,-0.562374,2.382534,-1.198861,-0.484199,2.343887,-1.030113,-0.511126,2.425552,\n\t\t          -1.035203,-0.504641,2.399569,-1.042448,-0.508520,2.380728,-1.061823,-0.521676,2.368926,-1.087908,-0.544642,2.359444,\n\t\t          -1.146915,-0.575469,2.390230,-1.199025,-0.471926,2.337381,-1.198594,-0.450561,2.317082,-1.201016,-0.456081,2.294445,\n\t\t          -1.200379,-0.459673,2.330362,-1.069067,-0.551292,2.367879,-1.083557,-0.563318,2.366483,-1.212530,-0.506550,2.320387,\n\t\t          -1.186813,-0.525370,2.359896,-1.172713,-0.550491,2.375658,-1.199148,-0.497745,2.350742,-1.049898,-0.527238,2.444494,\n\t\t          -1.084994,-0.559008,2.424648,-1.193627,-0.461171,2.348690,-1.195269,-0.449822,2.339556,-1.158264,-0.494584,2.297687,\n\t\t          -1.199948,-0.552584,2.331491,-1.124092,-0.497150,2.446835,-1.191759,-0.511250,2.353390,-1.196582,-0.526150,2.337935,\n\t\t          -1.203827,-0.511598,2.338776,-1.171154,-0.437220,2.397762,-1.158121,-0.464989,2.424525,-1.138767,-0.486395,2.438811,\n\t\t          -1.168506,-0.445778,2.407243,-1.163642,-0.455137,2.416418,-1.102604,-0.506324,2.454798,-1.172795,-0.429134,2.388506,\n\t\t          -1.140778,-0.393053,2.354723,-1.130024,-0.415957,2.331264,-1.173164,-0.415773,2.371902,-1.074075,-0.564878,2.420749,\n\t\t          -1.203027,-0.557716,2.319340,-1.150363,-0.475394,2.431894,-1.184371,-0.493886,2.372621,-1.137310,-0.402165,2.336867,\n\t\t          -1.184104,-0.433669,2.317678,-1.177680,-0.565884,2.357207,-1.192149,-0.542076,2.342286,-1.205449,-0.496308,2.332290,\n\t\t          -1.191041,-0.482311,2.366832,-1.160604,-0.528572,2.396141,-1.178562,-0.505503,2.380810,-1.167520,-0.577726,2.363898,\n\t\t          -1.190897,-0.555109,2.352774,-1.157731,-0.592544,2.374571,-1.192088,-0.471536,2.357556,-1.147612,-0.540250,2.404536,\n\t\t          -1.181025,-0.578712,2.342060,-1.217702,-0.512440,2.306144,-1.138972,-0.639667,2.340193,-1.157608,-0.637307,2.341691,\n\t\t          -1.168957,-0.621832,2.329870,-1.164093,-0.612022,2.315913,-1.157074,-0.609682,2.312958,-1.131891,-0.637184,2.335985,\n\t\t          -1.165673,-0.631027,2.337935,-1.133246,-0.617440,2.316180,-1.127725,-0.624356,2.322953,-1.142748,-0.611078,2.313963,\n\t\t          -1.148023,-0.639093,2.342614,-1.168177,-0.616681,2.322666,-1.127991,-0.631745,2.331224,-1.149521,-0.608676,2.311747,\n\t\t          -1.162102,-0.575818,2.280735,-1.203458,-0.591662,2.308915,-1.166864,-0.599379,2.296661,-1.188106,-0.568450,2.280406,\n\t\t          -1.202719,-0.576700,2.292290,-1.180553,-0.603114,2.305425,-1.172672,-0.568552,2.278354,-1.158736,-0.584191,2.287097,\n\t\t          -1.218563,-0.475907,2.263762,-1.226260,-0.484117,2.277944,-1.180800,-0.568060,2.279441,-1.161876,-0.592770,2.291038,\n\t\t          -1.190959,-0.554657,2.273757,-1.203930,-0.523646,2.265404,-1.208650,-0.521491,2.269282,-1.193053,-0.558824,2.276897,\n\t\t          -1.198594,-0.560342,2.282377,-1.215485,-0.554083,2.290586,-1.187798,-0.549137,2.268709,-1.197547,-0.526724,2.263475,\n\t\t          -1.206947,-0.558762,2.288000,-1.223448,-0.527976,2.283527,-1.223694,-0.495590,2.284737,-1.212139,-0.508540,2.275256,\n\t\t          -1.223592,-0.545463,2.291593,-1.188804,-0.537376,2.264296,-1.226342,-0.536535,2.289130,-1.215485,-0.521881,2.274885,\n\t\t          -1.205079,-0.478555,2.255163,-1.200893,-0.503101,2.267025,-1.198552,-0.491177,2.258959,-1.225993,-0.489802,2.282274,\n\t\t          -1.224290,-0.479417,2.271684,-1.218132,-0.503409,2.283362,-1.196828,-0.571816,2.285496,-1.207952,-0.583371,2.302347,\n\t\t          -1.191472,-0.599441,2.308094,-1.171892,-0.602889,2.300622,-1.211873,-0.475600,2.257851,-1.205921,-0.509197,2.269591,\n\t\t          -1.200379,-0.484650,2.255860,-1.198388,-0.497683,2.263229,-1.096282,-0.397773,2.498719,-1.073295,-0.413638,2.503112,\n\t\t          -1.061269,-0.419344,2.499910,-1.039000,-0.410765,2.482607,-1.035778,-0.403828,2.473720,-1.035182,-0.395064,2.463028,\n\t\t          -1.085548,-0.406906,2.502270,-1.121958,-0.358059,2.471176,-1.119125,-0.366659,2.479734,-1.113317,-0.377352,2.487513,\n\t\t          -1.105231,-0.388127,2.493916,-1.121116,-0.350671,2.462331,-1.115677,-0.344165,2.452273,-1.055953,-0.354919,2.430251,\n\t\t          -1.044788,-0.368055,2.440329,-1.037358,-0.382914,2.451288,-1.108043,-0.340635,2.441458,-1.118859,-0.426650,2.473105,\n\t\t          -1.095420,-0.444054,2.481048,-1.080828,-0.449083,2.480022,-1.057512,-0.436214,2.462946,-1.051971,-0.426917,2.455024,\n\t\t          -1.050514,-0.417106,2.447266,-1.108617,-0.436173,2.478544,-1.138849,-0.389625,2.441273,-1.136304,-0.398389,2.449811,\n\t\t          -1.132035,-0.408035,2.458862,-1.126288,-0.417538,2.466743,-1.138726,-0.381621,2.432673,-1.135216,-0.373021,2.423458,\n\t\t          -1.070668,-0.376798,2.415495,-1.058908,-0.390692,2.426167,-1.052115,-0.405552,2.437311,-1.129059,-0.365099,2.416214,\n\t\t          -1.112907,-0.477611,2.461591,-1.073562,-0.483973,2.464629,-1.041053,-0.480525,2.424484,-1.094270,-0.483768,2.465039,\n\t\t          -1.152107,-0.437466,2.433617,-1.146279,-0.447092,2.441703,-1.138582,-0.457025,2.449113,-1.127581,-0.468211,2.455701,\n\t\t          -1.156253,-0.428210,2.424669,-1.159455,-0.409184,2.407511,-1.175669,-0.589220,2.328802,-1.169409,-0.600651,2.334938,\n\t\t          -1.206701,-0.520116,2.331675,-1.214377,-0.499530,2.302757,-1.208076,-0.489043,2.317945,-1.208630,-0.474471,2.317267,\n\t\t          -1.158901,-0.419385,2.415248,-1.039020,-0.587065,2.357945,-1.012771,-0.590533,2.369111,-1.013201,-0.602437,2.385448,\n\t\t          -1.010451,-0.595972,2.376848,-1.053305,-0.606891,2.375144,-1.038816,-0.610154,2.388013,-1.023566,-0.608800,2.390373,\n\t\t          -1.054065,-0.599564,2.367346,-1.022170,-0.585135,2.361332,-1.049590,-0.594043,2.361557,-1.041401,-0.580784,2.360962,\n\t\t          -1.015336,-0.582713,2.373113,-1.016588,-0.593263,2.389429,-1.013756,-0.587434,2.380953,-1.057143,-0.598517,2.378428,\n\t\t          -1.043536,-0.602129,2.391851,-1.027548,-0.599851,2.395565,-1.057451,-0.591498,2.370897,-1.023115,-0.578383,2.365006,\n\t\t          -1.052607,-0.587106,2.364780,-1.043392,-0.576618,2.362933,-1.016465,-0.575694,2.376334,-1.018702,-0.583822,2.393103,\n\t\t          -1.016095,-0.579348,2.384709,-1.061289,-0.591744,2.380994,-1.047558,-0.594925,2.396428,-1.030113,-0.590718,2.401250,\n\t\t          -1.061330,-0.585115,2.373605,-1.024448,-0.573970,2.367119,-1.055522,-0.581728,2.367304,-1.045588,-0.572308,2.364656,\n\t\t          -1.019154,-0.569394,2.378531,-1.021350,-0.575489,2.398070,-1.017881,-0.571774,2.388382,-1.065845,-0.586080,2.383251,\n\t\t          -1.052156,-0.588583,2.400923,-1.032720,-0.581441,2.407757,-1.065209,-0.580045,2.375226,-1.027281,-0.568573,2.369233,\n\t\t          -1.058128,-0.576782,2.368762,-1.048975,-0.567157,2.366648,-1.022540,-0.561287,2.380666,-1.023402,-0.564940,2.404822,\n\t\t          -1.019974,-0.561615,2.392282,-1.072044,-0.581544,2.387233,-1.057595,-0.581646,2.405787,-1.037481,-0.573088,2.415453,\n\t\t          -1.070627,-0.574873,2.376397,-1.028615,-0.563996,2.371122,-1.062603,-0.571097,2.370609,-1.058888,-0.559911,2.369213,\n\t\t          -1.028369,-0.547556,2.380973,-1.025290,-0.552010,2.414017,-1.024059,-0.547269,2.396736,-1.083947,-0.577234,2.391379,\n\t\t          -1.062479,-0.574155,2.413094,-1.037399,-0.561020,2.423089,-1.081423,-0.574176,2.377895,-1.042571,-0.551784,2.370649,\n\t\t          -1.071243,-0.566623,2.371614,-1.044870,-0.481900,2.399158,-1.051109,-0.489433,2.383355,-1.070812,-0.504908,2.367858,\n\t\t          -1.099607,-0.526109,2.354887,-1.081854,-0.490130,2.367510,-1.112024,-0.512194,2.353225,-1.093594,-0.477324,2.365642,\n\t\t          -1.123497,-0.500126,2.351193,-1.063629,-0.436050,2.410221,-1.105251,-0.465132,2.362748,-1.130557,-0.487175,2.343374,\n\t\t          -1.072475,-0.421663,2.400985,-1.112907,-0.451032,2.348217,-1.135627,-0.471536,2.330854,-1.083250,-0.406906,2.388958,\n\t\t          -1.126144,-0.437548,2.330197,-1.142954,-0.454214,2.314579,-1.099238,-0.394941,2.370691,-1.175812,-0.469155,2.276302,\n\t\t          -1.182832,-0.455589,2.376889,-1.174622,-0.475025,2.394909,-1.172364,-0.420000,2.329952,-1.186074,-0.434880,2.353678,\n\t\t          -1.149357,-0.506816,2.417240,-1.161876,-0.495816,2.411041,-1.180225,-0.465153,2.387172,-1.085056,-0.416450,2.378244,\n\t\t          -1.147674,-0.425419,2.311972,-1.169060,-0.485102,2.403180,-1.114384,-0.528079,2.437374,-1.185643,-0.447872,2.365520,\n\t\t          -1.041914,-0.546181,2.433762,-1.135278,-0.518453,2.427091,-1.160050,-0.420329,2.318048,-1.171482,-0.456389,2.284491,\n\t\t          -1.075923,-0.506960,2.457568,-1.054947,-0.451853,2.413381,-1.097822,-0.381867,2.391666,-1.079925,-0.393627,2.402380,\n\t\t          -1.125283,-0.377639,2.383026,-1.068555,-0.408712,2.411637,-1.059750,-0.437774,2.430190,-1.062274,-0.423695,2.422002,\n\t\t          -1.061125,-0.476051,2.453197,-1.048769,-0.417106,2.491864,-1.067077,-0.444362,2.471976,-1.055214,-0.457990,2.438337,\n\t\t          -1.092321,-0.341291,2.430560,-1.109479,-0.362431,2.407614,-1.156048,-0.396398,2.393657,-1.137310,-0.565145,2.309448,\n\t\t          -1.169655,-0.513856,2.283649,-1.161466,-0.524754,2.288267,-1.124236,-0.595254,2.327365,-1.146093,-0.551374,2.301793,\n\t\t          -1.153483,-0.539552,2.297442,-1.183693,-0.487585,2.271889,-1.191226,-0.476810,2.268113,-1.121834,-0.613171,2.351275,\n\t\t          -1.130516,-0.581379,2.318499,-1.177865,-0.502424,2.278149,-1.093799,-0.580251,2.373256,-1.109889,-0.585813,2.384976,\n\t\t          -1.103383,-0.591313,2.366279,-1.095626,-0.569640,2.359875,-1.106298,-0.555868,2.421139,-1.127766,-0.583842,2.391071,\n\t\t          -1.084809,-0.531424,2.446917,-1.055070,-0.501090,2.449954,-1.103199,-0.405470,2.357166,-1.110054,-0.420944,2.345262,\n\t\t          -1.093737,-0.430160,2.363405,-1.074096,-0.430960,2.392652,-1.082860,-0.443131,2.378942,-1.065271,-0.444444,2.398562,\n\t\t          -1.072885,-0.456369,2.384113,-1.054516,-0.459652,2.399609,-1.061473,-0.471310,2.385202,-1.111388,-0.601472,2.356756,\n\t\t          -1.171277,-0.405921,2.361825,-1.070032,-0.344904,2.425018,-1.086349,-0.364976,2.406771,-1.182626,-0.425070,2.344728,\n\t\t          -1.149706,-0.383899,2.386125,-1.192375,-0.440422,2.328617,-1.116375,-0.404464,2.478585,-1.108329,-0.413597,2.484598,\n\t\t          -1.129921,-0.367972,2.446158,-1.130229,-0.375566,2.454470,-1.045280,-0.416039,2.462207,-1.050001,-0.424126,2.471422,\n\t\t          -1.126555,-0.360194,2.437229,-1.121116,-0.354283,2.429246,-1.044172,-0.408096,2.453218,-1.064594,-0.367870,2.420913,\n\t\t          -1.098540,-0.422196,2.488601,-1.086103,-0.429770,2.489996,-1.053449,-0.381703,2.431668,-1.123025,-0.393894,2.471258,\n\t\t          -1.071962,-0.433916,2.486754,-1.046615,-0.396870,2.442832,-1.127828,-0.383878,2.462864,-1.059852,-0.430919,2.480494,\n\t\t          -1.102726,-0.353134,2.419251,-1.078939,-0.356274,2.413278,-1.116847,-0.369573,2.394520,-1.139957,-0.374417,2.400985,\n\t\t          -1.145355,-0.384515,2.408886,-1.148598,-0.395084,2.419538,-1.148516,-0.403951,2.428876,-1.145991,-0.412899,2.438502,\n\t\t          -1.141496,-0.422032,2.447512,-1.135955,-0.431330,2.455599,-1.128382,-0.441099,2.462474,-1.117853,-0.451053,2.468467,\n\t\t          -1.104041,-0.459755,2.472429,-1.087929,-0.464373,2.472633,-1.092732,-0.372898,2.400964,-1.075697,-0.385336,2.409317,\n\t\t          -1.065517,-0.400667,2.419702,-1.057841,-0.414623,2.429841,-1.056384,-0.427266,2.438974,-1.058580,-0.440483,2.446179,\n\t\t          -1.063752,-0.453434,2.456378,-1.072413,-0.461602,2.466579,0.070379,-0.066694,3.443300,0.071508,-0.057348,3.447438,\n\t\t          0.120234,-0.059413,3.409788,0.123851,-0.045453,3.416239,0.000000,-0.060616,3.464888,0.065074,-0.082020,3.433696,\n\t\t          0.068291,-0.075855,3.438486,0.110299,-0.082894,3.394871,0.115286,-0.073085,3.402398,0.061328,-0.088000,3.428649,\n\t\t          0.104745,-0.092337,3.388422,0.042504,-0.130414,3.360445,0.024573,-0.109982,3.411813,0.008154,-0.113961,3.410462,\n\t\t          0.033304,-0.107084,3.413544,0.016357,-0.112020,3.410842,0.041237,-0.102786,3.415730,0.013570,-0.134263,3.358472,\n\t\t          0.057846,-0.125064,3.363153,0.027407,-0.133138,3.359429,0.071883,-0.118778,3.367078,0.071263,-0.047205,3.451024,\n\t\t          0.125060,-0.030523,3.421385,0.070023,-0.037123,3.453001,0.124196,-0.016420,3.424985,0.067468,-0.027200,3.454597,\n\t\t          0.120590,-0.000864,3.428103,0.062912,-0.015902,3.456243,0.112313,0.016196,3.429501,0.055286,-0.005931,3.456071,\n\t\t          0.099405,0.033514,3.429361,0.042920,0.003218,3.454032,0.076725,0.048138,3.425046,0.056207,-0.093698,3.423491,\n\t\t          0.095940,-0.103073,3.381292,0.026365,0.059571,3.416440,0.014184,0.009457,3.451331,0.027238,0.008229,3.452252,\n\t\t          0.049224,0.056533,3.419685,0.177307,-0.136110,3.263751,0.137444,-0.146763,3.259666,0.074080,-0.122665,3.321594,\n\t\t          0.055011,-0.130897,3.318967,0.128433,-0.092574,3.338036,0.139682,-0.078698,3.346760,0.147523,-0.066813,3.353636,\n\t\t          0.117411,-0.175692,3.230314,0.035736,-0.260734,3.107977,0.053984,-0.163533,3.257019,0.032965,-0.237490,3.145252,\n\t\t          0.031467,-0.217893,3.176699,0.064884,0.080730,3.383933,0.033376,0.084507,3.378986,0.099163,0.071391,3.391138,\n\t\t          0.130938,0.058603,3.394833,0.150622,0.038364,3.391384,0.161973,0.020752,3.389147,0.167495,0.002278,3.384918,\n\t\t          0.030933,-0.200970,3.202562,0.167782,-0.012891,3.380772,0.166530,-0.026438,3.373588,0.161111,-0.039883,3.367327,\n\t\t          0.071493,-0.200170,3.202870,0.073731,-0.217787,3.175878,0.066341,-0.183579,3.228754,0.091630,-0.155487,3.258024,\n\t\t          0.035572,-0.132313,3.318125,0.094380,-0.114291,3.324427,0.154440,-0.053923,3.360554,0.132805,-0.116056,3.293638,\n\t\t          0.042756,-0.140770,3.288485,0.095427,-0.128002,3.290353,0.070262,-0.140647,3.289512,0.179359,-0.088038,3.307329,\n\t\t          0.192496,-0.068271,3.315847,0.204237,-0.053594,3.324263,0.212981,-0.039821,3.331406,0.016195,-0.128926,3.318023,\n\t\t          0.019110,-0.137280,3.284360,0.024981,-0.159305,3.255910,0.028573,-0.181144,3.229801,0.075270,-0.239193,3.144801,\n\t\t          0.115030,-0.102960,3.331529,0.085810,-0.111455,3.373604,0.050337,-0.098230,3.419365,0.158853,-0.102509,3.299713,\n\t\t          0.000000,-0.114513,3.410069,0.000000,-0.133977,3.358433,0.000000,0.008916,3.450717,-0.000000,0.060830,3.414722,\n\t\t          -0.000000,-0.201667,3.201269,-0.000000,-0.218126,3.175508,-0.000000,-0.236578,3.143036,0.000000,-0.259282,3.106068,\n\t\t          0.000000,-0.271681,3.072076,-0.000000,0.084774,3.376872,-0.000000,-0.129398,3.317920,-0.000000,-0.134797,3.283108,\n\t\t          -0.000000,-0.157355,3.254289,-0.000000,-0.180817,3.228282,-0.070379,-0.066694,3.443300,-0.071508,-0.057348,3.447438,\n\t\t          -0.120234,-0.059413,3.409788,-0.123851,-0.045453,3.416239,-0.065074,-0.082020,3.433696,-0.068291,-0.075855,3.438486,\n\t\t          -0.110299,-0.082894,3.394871,-0.115286,-0.073085,3.402398,-0.061328,-0.088000,3.428649,-0.104745,-0.092337,3.388422,\n\t\t          -0.042504,-0.130414,3.360445,-0.024573,-0.109982,3.411813,-0.008154,-0.113961,3.410462,-0.033304,-0.107084,3.413544,\n\t\t          -0.016357,-0.112020,3.410842,-0.041237,-0.102786,3.415730,-0.013570,-0.134263,3.358472,-0.057846,-0.125064,3.363153,\n\t\t          -0.027407,-0.133138,3.359429,-0.071883,-0.118778,3.367078,-0.071263,-0.047205,3.451024,-0.125060,-0.030523,3.421385,\n\t\t          -0.070023,-0.037123,3.453001,-0.124196,-0.016420,3.424985,-0.067468,-0.027200,3.454598,-0.120590,-0.000864,3.428103,\n\t\t          -0.062912,-0.015902,3.456243,-0.112313,0.016196,3.429501,-0.055286,-0.005931,3.456071,-0.099405,0.033514,3.429361,\n\t\t          -0.042920,0.003218,3.454033,-0.076725,0.048138,3.425046,-0.056207,-0.093698,3.423491,-0.095940,-0.103073,3.381292,\n\t\t          -0.026365,0.059571,3.416440,-0.014184,0.009457,3.451331,-0.027238,0.008229,3.452252,-0.049224,0.056533,3.419685,\n\t\t          -0.189663,-0.166668,3.228384,-0.177307,-0.136110,3.263751,-0.137444,-0.146763,3.259666,-0.074080,-0.122665,3.321594,\n\t\t          -0.055011,-0.130897,3.318967,-0.128433,-0.092574,3.338036,-0.139682,-0.078698,3.346760,-0.147523,-0.066813,3.353636,\n\t\t          -0.117411,-0.175658,3.230314,-0.035736,-0.260666,3.107977,-0.053984,-0.163533,3.257019,-0.032965,-0.237428,3.145252,\n\t\t          -0.031467,-0.217844,3.176699,-0.064884,0.080730,3.383933,-0.033376,0.084507,3.378986,-0.099163,0.071391,3.391138,\n\t\t          -0.130938,0.058603,3.394833,-0.150622,0.038364,3.391384,-0.161973,0.020752,3.389147,-0.167495,0.002278,3.384918,\n\t\t          -0.030933,-0.200937,3.202562,-0.167782,-0.012891,3.380772,-0.166530,-0.026438,3.373588,-0.161111,-0.039883,3.367327,\n\t\t          -0.071493,-0.200121,3.202870,-0.073731,-0.217721,3.175878,-0.066341,-0.183555,3.228754,-0.091630,-0.155487,3.258024,\n\t\t          -0.035572,-0.132313,3.318125,-0.094380,-0.114291,3.324427,-0.154440,-0.053923,3.360554,-0.132805,-0.116056,3.293638,\n\t\t          -0.042756,-0.140770,3.288485,-0.095427,-0.128002,3.290353,-0.070262,-0.140647,3.289512,-0.179359,-0.088038,3.307329,\n\t\t          -0.192496,-0.068271,3.315847,-0.204237,-0.053594,3.324263,-0.016195,-0.128926,3.318023,-0.019110,-0.137280,3.284360,\n\t\t          -0.024981,-0.159305,3.255910,-0.028573,-0.181136,3.229801,-0.075270,-0.239115,3.144801,-0.124143,-0.215801,3.177253,\n\t\t          -0.122234,-0.196143,3.203219,-0.115030,-0.102960,3.331529,-0.085810,-0.111455,3.373604,-0.050337,-0.098230,3.419365,\n\t\t          -0.158853,-0.102509,3.299713,0.222129,0.148850,2.207668,0.231012,0.131401,2.225092,0.240624,0.143210,2.196329,\n\t\t          0.190734,0.169231,2.215758,0.190313,0.164707,2.226107,0.273043,0.117151,2.210388,0.206217,0.166863,2.189370,\n\t\t          0.384379,-0.032925,2.154726,0.404237,-0.095650,2.148732,0.388420,-0.036750,2.139272,0.374351,0.020558,2.159200,\n\t\t          0.372880,-0.035687,2.196745,0.388753,-0.086517,2.181361,0.405823,-0.096484,2.143368,0.376546,0.018416,2.153233,\n\t\t          0.360163,0.018795,2.195767,0.398998,-0.045471,2.010858,0.406493,-0.092552,2.008539,0.404155,-0.047797,1.964035,\n\t\t          0.382462,0.001606,2.012313,0.393535,-0.044081,2.054065,0.401149,-0.090804,2.050995,0.411384,-0.094732,1.962408,\n\t\t          0.387717,-0.001090,1.964764,0.377273,0.002678,2.056217,0.109287,0.180920,2.209575,0.079699,0.175035,2.234742,\n\t\t          0.136151,0.180771,2.204288,0.089219,0.186922,2.202552,0.064264,0.180780,2.223971,0.131465,0.164364,2.235603,\n\t\t          0.133378,0.188162,2.190008,0.176621,-0.309711,2.116599,0.079497,-0.323356,2.118767,0.167153,-0.309904,2.103735,\n\t\t          0.246720,-0.293715,2.122524,0.174705,-0.309394,2.121554,0.080178,-0.323791,2.124807,0.074172,-0.320969,2.103170,\n\t\t          0.225413,-0.298548,2.100381,0.243695,-0.291964,2.141898,0.051285,0.188257,2.159375,0.027902,0.184675,2.167685,\n\t\t          0.063385,0.190288,2.183707,0.064425,0.193497,2.120854,0.034564,0.188362,2.115983,0.043626,0.186995,2.194012,\n\t\t          0.099338,0.194010,2.141618,0.302000,0.118816,2.175648,0.300324,0.120349,2.179723,0.318127,0.094738,2.170982,\n\t\t          0.296690,0.120287,2.154789,0.260131,0.144550,2.140507,0.304710,0.114259,2.185457,0.321319,0.085831,2.138142,\n\t\t          0.284488,0.129199,2.009415,0.324259,0.090541,2.011535,0.288592,0.124796,1.958738,0.239467,0.161451,2.006661,\n\t\t          0.282900,0.130462,2.056084,0.321323,0.091273,2.056378,0.330859,0.088198,1.962500,0.241878,0.156688,1.952542,\n\t\t          0.238355,0.164391,2.058265,0.091341,0.188245,1.993150,0.140672,0.190932,1.997912,0.091439,0.171613,1.947765,\n\t\t          0.045657,0.179266,1.990247,0.087947,0.197368,2.039107,0.137682,0.198192,2.049167,0.141267,0.179064,1.947000,\n\t\t          0.043943,0.160694,1.946985,0.044875,0.189893,2.033960,0.070456,0.077979,1.840596,0.032598,0.059386,1.847110,\n\t\t          0.079906,0.114158,1.870969,0.105271,0.092086,1.833932,0.062983,0.039981,1.814592,0.030510,0.011322,1.824548,\n\t\t          0.036421,0.100296,1.874457,0.122664,0.126834,1.864480,0.089763,0.061585,1.807035,0.049131,-0.201111,1.863479,\n\t\t          0.060133,-0.221867,1.879740,0.027579,-0.188716,1.861192,0.058960,-0.193914,1.849465,0.083993,-0.228920,1.866205,\n\t\t          0.031508,-0.214808,1.883270,0.030001,-0.162296,1.841599,0.112264,-0.269710,1.979807,0.057133,-0.272118,1.982799,\n\t\t          0.102527,-0.253862,1.943967,0.164785,-0.276506,1.978540,0.129094,-0.283549,2.022272,0.065431,-0.283693,2.022388,\n\t\t          0.048122,-0.257116,1.944449,0.137134,-0.261763,1.935916,0.190534,-0.283330,2.019760,0.371313,-0.202367,2.134308,\n\t\t          0.368977,-0.212617,2.111404,0.376060,-0.194260,2.138925,0.365349,-0.198246,2.161164,0.327677,-0.246482,2.125882,\n\t\t          0.330460,-0.252218,2.104401,0.379787,-0.195226,2.120979,0.372572,-0.188184,2.160842,0.323302,-0.239077,2.150893,\n\t\t          0.257237,-0.286651,1.956470,0.249762,-0.282988,1.924880,0.285280,-0.284252,1.969444,0.229278,-0.290322,1.966981,\n\t\t          0.214509,-0.279997,1.930920,0.288712,-0.286468,1.933244,0.266457,-0.286991,1.998428,0.375544,-0.223827,1.998609,\n\t\t          0.351941,-0.259008,1.993036,0.382358,-0.229705,1.954758,0.396974,-0.184240,1.998531,0.367666,-0.218511,2.040846,\n\t\t          0.339437,-0.252699,2.032610,0.360262,-0.266038,1.950483,0.404567,-0.184524,1.955706,0.388166,-0.179508,2.045863,\n\t\t          0.389503,-0.238783,1.791994,0.371248,-0.278937,1.790173,0.392123,-0.240304,1.721487,0.404216,-0.185319,1.791624,\n\t\t          0.387467,-0.235950,1.852709,0.367451,-0.274292,1.850385,0.375367,-0.281908,1.719619,0.410331,-0.190615,1.722116,\n\t\t          0.401277,-0.180933,1.852022,0.246940,-0.304872,1.775141,0.220289,-0.292572,1.770195,0.254917,-0.315332,1.706899,\n\t\t          0.289963,-0.308704,1.781438,0.242364,-0.291082,1.832496,0.210499,-0.283839,1.829937,0.228977,-0.298215,1.701689,\n\t\t          0.295398,-0.314826,1.711846,0.286789,-0.299647,1.839981,0.322009,0.087131,1.788667,0.357462,0.053263,1.793501,\n\t\t          0.335741,0.070137,1.719697,0.282653,0.115440,1.781104,0.308044,0.103205,1.849418,0.352653,0.072106,1.854679,\n\t\t          0.366933,0.037459,1.723611,0.298627,0.095685,1.713906,0.264446,0.133303,1.841117,0.167031,0.092703,1.749125,\n\t\t          0.153174,0.099918,1.791257,0.203626,0.115981,1.761379,0.178303,0.081470,1.693555,0.134383,0.066056,1.736674,\n\t\t          0.124441,0.073591,1.772486,0.185168,0.128374,1.811509,0.218111,0.099695,1.701057,0.142398,0.056143,1.685407,\n\t\t          0.421005,-0.065110,1.797735,0.425076,-0.108259,1.797091,0.429035,-0.071937,1.727368,0.418191,-0.018930,1.797722,\n\t\t          0.414298,-0.058124,1.858871,0.420127,-0.102653,1.858099,0.431750,-0.114019,1.726743,0.425421,-0.029409,1.727374,\n\t\t          0.405206,-0.011427,1.858819,0.058198,-0.030489,1.715284,0.077066,0.006124,1.717881,0.058830,-0.040031,1.662704,\n\t\t          0.052331,-0.071726,1.718012,0.057504,-0.016346,1.756181,0.076180,0.018610,1.753639,0.078091,-0.003821,1.668074,\n\t\t          0.059658,-0.081694,1.662822,0.041665,-0.057213,1.763618,0.093095,-0.213312,1.738523,0.075659,-0.160206,1.731399,\n\t\t          0.118580,-0.226748,1.675377,0.125478,-0.243079,1.749953,0.081282,-0.200998,1.787109,0.057166,-0.147781,1.780075,\n\t\t          0.087267,-0.173018,1.671741,0.130766,-0.242251,1.684774,0.122475,-0.240554,1.799101,0.150669,-0.221927,1.412004,\n\t\t          0.139085,-0.176698,1.413053,0.177861,-0.206255,1.318158,0.186665,-0.247012,1.416259,0.152798,-0.172613,1.315883,\n\t\t          0.207768,-0.233205,1.321407,0.093023,-0.049651,1.410718,0.101084,-0.012619,1.414283,0.112989,-0.054041,1.315446,\n\t\t          0.100676,-0.091999,1.409511,0.121005,-0.019098,1.318220,0.118323,-0.093504,1.314393,0.407631,-0.224539,1.438418,\n\t\t          0.382938,-0.267120,1.436044,0.415780,-0.218584,1.340587,0.416855,-0.194618,1.440564,0.387924,-0.258225,1.337630,\n\t\t          0.426038,-0.193514,1.343885,0.289049,-0.308368,1.426103,0.259552,-0.286127,1.424311,0.299748,-0.298191,1.327935,\n\t\t          0.322366,-0.304679,1.429590,0.267778,-0.284578,1.327042,0.333352,-0.297078,1.331151,0.364794,0.029346,1.442240,\n\t\t          0.395454,0.003787,1.444353,0.376859,0.038191,1.337557,0.332019,0.052966,1.439713,0.407381,0.005381,1.346434,\n\t\t          0.351192,0.054660,1.334173,0.213161,0.045694,1.431383,0.255165,0.062577,1.434377,0.226403,0.040248,1.333261,\n\t\t          0.167809,0.030286,1.426223,0.266906,0.059712,1.336205,0.184261,0.021612,1.328797,0.445971,-0.084771,1.446412,\n\t\t          0.441250,-0.120555,1.445057,0.449416,-0.085870,1.348133,0.446402,-0.049947,1.447188,0.445781,-0.119308,1.346766,\n\t\t          0.450007,-0.052340,1.349138,0.208753,-0.192333,1.128215,0.200684,-0.196081,1.173235,0.183962,-0.159895,1.125992,\n\t\t          0.216246,-0.187356,1.094372,0.235427,-0.219785,1.130398,0.228313,-0.222681,1.175649,0.175602,-0.164135,1.171008,\n\t\t          0.191004,-0.154716,1.091935,0.243002,-0.215134,1.096621,0.153509,-0.055014,1.123390,0.144116,-0.057833,1.169360,\n\t\t          0.164877,-0.024421,1.124689,0.161912,-0.050307,1.088314,0.153878,-0.089127,1.123273,0.145241,-0.092497,1.168831,\n\t\t          0.154968,-0.027134,1.171345,0.174585,-0.019522,1.088440,0.161219,-0.084199,1.088725,0.425170,-0.202212,1.148376,\n\t\t          0.402079,-0.227587,1.146315,0.433602,-0.197699,1.114665,0.445138,-0.173398,1.149709,0.418618,-0.209035,1.193483,\n\t\t          0.398380,-0.239212,1.190980,0.408932,-0.220414,1.112879,0.452607,-0.167810,1.116170,0.437811,-0.178223,1.195244,\n\t\t          0.322605,-0.275168,1.135509,0.292790,-0.264184,1.133609,0.329196,-0.268616,1.101762,0.352010,-0.269492,1.139040,\n\t\t          0.316143,-0.281190,1.180797,0.285596,-0.269569,1.178766,0.299775,-0.258431,1.099848,0.357926,-0.261759,1.105536,\n\t\t          0.347385,-0.278495,1.184070,0.402293,0.036863,1.136742,0.428240,0.008620,1.137156,0.410435,0.044358,1.097148,\n\t\t          0.370125,0.061708,1.136888,0.395753,0.034316,1.190524,0.423116,0.006446,1.193083,0.433265,0.017430,1.106337,\n\t\t          0.381438,0.065474,1.091387,0.356912,0.062822,1.190575,0.265181,0.052019,1.126469,0.249497,0.036705,1.181658,\n\t\t          0.291059,0.070708,1.134233,0.267378,0.062616,1.087372,0.221007,0.021393,1.129545,0.213062,0.014478,1.178760,\n\t\t          0.294870,0.069664,1.177055,0.293775,0.069713,1.094100,0.234999,0.035885,1.086567,0.463214,-0.078231,1.148438,\n\t\t          0.463543,-0.108706,1.149905,0.469072,-0.071241,1.116850,0.457266,-0.048175,1.144903,0.458865,-0.082456,1.196425,\n\t\t          0.457523,-0.113344,1.196652,0.470326,-0.102849,1.117363,0.461897,-0.039403,1.115967,0.454755,-0.052560,1.196052,\n\t\t          0.250491,-0.159687,0.995622,0.232003,-0.172028,1.035276,0.212503,-0.127750,1.000120,0.262752,-0.144897,0.957701,\n\t\t          0.275062,-0.180102,0.999718,0.262577,-0.197622,1.032954,0.203409,-0.138327,1.034430,0.233642,-0.118736,0.952494,\n\t\t          0.276866,-0.166157,0.969092,0.189100,-0.018788,0.990468,0.179435,-0.031920,1.026379,0.205528,0.013877,0.984648,\n\t\t          0.197040,-0.005290,0.954088,0.184450,-0.054486,0.994492,0.175611,-0.066272,1.028649,0.195668,-0.000879,1.024550,\n\t\t          0.209629,0.020484,0.957738,0.195463,-0.042024,0.954012,0.457925,-0.175184,1.024914,0.435425,-0.200517,1.022774,\n\t\t          0.465030,-0.165051,0.974174,0.475700,-0.143871,1.027979,0.450019,-0.184482,1.058648,0.426190,-0.207932,1.056661,\n\t\t          0.444906,-0.189477,0.972649,0.484096,-0.135825,0.980184,0.467517,-0.152838,1.061185,0.350056,-0.234620,1.013649,\n\t\t          0.318755,-0.226004,1.010177,0.360844,-0.223931,0.970060,0.379477,-0.229032,1.017470,0.343046,-0.248910,1.046225,\n\t\t          0.313426,-0.240555,1.042010,0.329555,-0.216601,0.967656,0.390571,-0.220086,0.973013,0.370985,-0.240717,1.050435,\n\t\t          0.404773,0.062993,1.034210,0.436143,0.032989,1.030639,0.422376,0.063583,0.982612,0.373383,0.085463,1.031858,\n\t\t          0.402930,0.060128,1.062979,0.428918,0.030634,1.068026,0.449052,0.040912,0.984002,0.390968,0.079931,0.981712,\n\t\t          0.378468,0.081137,1.050707,0.288200,0.081424,0.998962,0.279201,0.072864,1.024338,0.318756,0.092781,1.010795,\n\t\t          0.288198,0.076869,0.978303,0.256990,0.064129,0.991410,0.250618,0.057901,1.027589,0.319861,0.089608,1.025279,\n\t\t          0.319474,0.086824,0.983662,0.258803,0.062099,0.971337,0.487718,-0.050617,1.033244,0.491491,-0.080098,1.032453,\n\t\t          0.501828,-0.041588,0.987699,0.476282,-0.022295,1.032674,0.480110,-0.058826,1.066073,0.483216,-0.088336,1.065279,\n\t\t          0.504864,-0.071406,0.987266,0.489921,-0.013011,0.986808,0.469602,-0.030347,1.066645,0.295319,-0.139389,0.721021,\n\t\t          0.267196,-0.104934,0.719587,0.314581,-0.142379,0.616051,0.326332,-0.162614,0.722247,0.283647,-0.105555,0.615854,\n\t\t          0.336009,-0.162597,0.619334,0.240535,-0.003538,0.724997,0.248840,0.019711,0.725703,0.258222,-0.007714,0.612688,\n\t\t          0.241403,-0.033702,0.720322,0.264628,0.020421,0.613320,0.264589,-0.037761,0.613488,0.492255,-0.158459,0.737055,\n\t\t          0.479096,-0.169020,0.737040,0.499121,-0.150610,0.631515,0.514253,-0.132842,0.740385,0.488162,-0.162321,0.633653,\n\t\t          0.519193,-0.131134,0.632277,0.398015,-0.218730,0.732499,0.359657,-0.202260,0.728155,0.407529,-0.222448,0.629683,\n\t\t          0.435882,-0.201822,0.734740,0.372450,-0.209985,0.626243,0.443008,-0.207876,0.633304,0.464211,0.073397,0.738545,\n\t\t          0.489929,0.051392,0.740865,0.476416,0.076356,0.633373,0.434159,0.090058,0.736051,0.501586,0.051751,0.635862,\n\t\t          0.447430,0.096776,0.630462,0.329675,0.073979,0.725844,0.356866,0.092297,0.730404,0.338184,0.076804,0.623957,\n\t\t          0.309165,0.067255,0.723893,0.376438,0.106077,0.623861,0.324245,0.064247,0.621160,0.541066,-0.028449,0.745878,\n\t\t          0.542327,-0.056914,0.746025,0.552433,-0.029732,0.640510,0.529780,-0.000690,0.744737,0.555669,-0.059129,0.640839,\n\t\t          0.541086,-0.002064,0.639524,0.316278,-0.146642,0.422422,0.314326,-0.158065,0.258808,0.335260,-0.172986,0.429666,\n\t\t          0.297991,-0.109772,0.414768,0.301471,-0.117231,0.253812,0.333997,-0.196936,0.264610,0.285588,-0.014451,0.411562,\n\t\t          0.313962,-0.009860,0.248496,0.283222,-0.042524,0.411266,0.299909,0.012987,0.412315,0.325153,0.004966,0.253228,\n\t\t          0.297550,-0.040606,0.247559,0.525464,-0.184833,0.265235,0.516944,-0.154022,0.430241,0.506170,-0.172529,0.431594,\n\t\t          0.505184,-0.216953,0.269381,0.541928,-0.150873,0.260913,0.526840,-0.138607,0.426893,0.426708,-0.273179,0.276688,\n\t\t          0.422478,-0.237462,0.432662,0.390930,-0.226568,0.429638,0.393003,-0.259337,0.274433,0.455973,-0.265683,0.276219,\n\t\t          0.451879,-0.230531,0.433734,0.507084,0.056484,0.251296,0.494088,0.067295,0.425402,0.519042,0.043815,0.427111,\n\t\t          0.529443,0.035972,0.250945,0.480278,0.070775,0.252326,0.466548,0.087017,0.423393,0.363192,0.078051,0.420991,\n\t\t          0.379804,0.078531,0.251785,0.346605,0.052937,0.418904,0.401062,0.100566,0.418981,0.414334,0.083553,0.252674,\n\t\t          0.349243,0.055656,0.253590,0.558155,-0.049253,0.253517,0.559256,-0.037543,0.429355,0.556414,-0.071450,0.428515,\n\t\t          0.558394,-0.082005,0.254474,0.554677,-0.018059,0.252288,0.552977,-0.009147,0.429067,0.077364,0.151971,2.468073,\n\t\t          0.076798,0.146920,2.418971,0.032046,0.162294,2.458345,0.078742,0.140604,2.536199,0.119224,0.145794,2.467021,\n\t\t          0.118841,0.143447,2.414274,0.036689,0.155138,2.432747,0.039373,0.143336,2.536957,0.118079,0.135801,2.534705,\n\t\t          0.238628,0.105035,2.458179,0.200828,0.126476,2.460130,0.230827,0.096564,2.525232,0.275363,0.079915,2.453902,\n\t\t          0.242841,0.106459,2.400473,0.201861,0.124401,2.404856,0.194822,0.114774,2.529022,0.266377,0.072201,2.524325,\n\t\t          0.280867,0.082199,2.396140,0.342051,-0.033999,2.436098,0.326238,0.010605,2.443225,0.320123,-0.039342,2.519628,\n\t\t          0.349149,-0.081870,2.435855,0.348372,-0.031336,2.377059,0.334297,0.011907,2.384316,0.314770,-0.006670,2.513952,\n\t\t          0.324002,-0.077397,2.522646,0.357261,-0.075535,2.370390,0.331126,-0.206113,2.413231,0.345810,-0.165964,2.422738,\n\t\t          0.299579,-0.199124,2.465178,0.282571,-0.253910,2.405319,0.340233,-0.211099,2.359660,0.354997,-0.165487,2.358456,\n\t\t          0.314438,-0.163482,2.475743,0.274982,-0.231413,2.466640,0.300213,-0.254405,2.358176,0.143776,-0.300700,2.396183,\n\t\t          0.198147,-0.297100,2.387034,0.138517,-0.292617,2.446489,0.061924,-0.312414,2.380689,0.140200,-0.311382,2.330882,\n\t\t          0.216754,-0.300744,2.352762,0.202079,-0.263066,2.456055,0.071865,-0.305424,2.443949,0.066342,-0.324112,2.327836,\n\t\t          0.084993,0.176021,2.740424,0.082216,0.164866,2.673844,0.043263,0.179629,2.730484,0.080955,0.178379,2.812747,\n\t\t          0.126977,0.171638,2.752354,0.117702,0.159021,2.676557,0.040797,0.168653,2.671556,0.040709,0.178433,2.796570,\n\t\t          0.123556,0.177067,2.833428,0.246799,0.116756,2.758750,0.206383,0.142687,2.763109,0.249763,0.123606,2.841504,\n\t\t          0.292318,0.091504,2.752390,0.235683,0.107698,2.672656,0.203015,0.129652,2.681125,0.208921,0.149674,2.849693,\n\t\t          0.288875,0.091509,2.833675,0.267933,0.080752,2.660738,0.338148,-0.010476,2.678548,0.328359,0.038838,2.703096,\n\t\t          0.346086,-0.012472,2.763455,0.338340,-0.061266,2.664270,0.328271,-0.030238,2.634007,0.317784,0.015542,2.641469,\n\t\t          0.333790,0.028576,2.798178,0.344597,-0.062913,2.726983,0.333554,-0.075639,2.621278,0.300120,-0.216579,2.617356,\n\t\t          0.317695,-0.169910,2.645859,0.292987,-0.218890,2.675023,0.265660,-0.257336,2.636470,0.296770,-0.219119,2.592112,\n\t\t          0.322438,-0.168965,2.602618,0.317078,-0.170062,2.697218,0.258643,-0.258196,2.665686,0.263632,-0.253635,2.575407,\n\t\t          0.131341,-0.344460,2.626269,0.181473,-0.328811,2.628812,0.136276,-0.356272,2.691763,0.065473,-0.344199,2.637394,\n\t\t          0.117447,-0.320952,2.561450,0.179565,-0.311418,2.574970,0.186432,-0.324161,2.666314,0.061497,-0.351464,2.709194,\n\t\t          0.065465,-0.317093,2.573539,0.166559,-0.375836,2.820075,0.146248,-0.374604,2.789188,0.204169,-0.365382,2.828981,\n\t\t          0.154636,-0.384331,2.847704,0.118865,-0.378387,2.811921,0.194333,-0.350747,2.785294,0.201695,-0.376273,2.869522,\n\t\t          0.286414,-0.279470,2.811132,0.285201,-0.251466,2.773589,0.294385,-0.267661,2.828332,0.269905,-0.308865,2.819785,\n\t\t          0.263405,-0.286215,2.774558,0.306080,-0.218560,2.792645,0.272813,-0.314168,2.858566,0.085647,-0.369326,2.942119,\n\t\t          0.105181,-0.360566,2.970618,0.035307,-0.364665,2.941895,0.106708,-0.380862,2.914539,0.152266,-0.374677,2.941171,\n\t\t          0.046583,-0.339641,2.995378,0.047273,-0.379101,2.894340,0.342393,-0.197732,2.897794,0.325907,-0.221293,2.879549,\n\t\t          0.357187,-0.154662,2.891131,0.341581,-0.215865,2.923137,0.311985,-0.266139,2.911547,0.339199,-0.166429,2.855913,\n\t\t          0.370774,-0.153341,2.933697,0.363392,-0.017631,2.867942,0.349693,-0.015893,2.846123,0.375102,-0.001705,2.904260,\n\t\t          0.372922,-0.053676,2.883675,0.347381,-0.052838,2.826468,0.351153,0.019731,2.872380,0.386932,-0.043240,2.924122,\n\t\t          0.341024,-0.254430,3.016700,0.350755,-0.235564,3.013953,0.326956,-0.274224,3.028850,0.345111,-0.243890,3.003127,\n\t\t          0.365815,-0.202968,2.989803,0.333058,-0.260411,3.038158,0.307302,-0.291543,2.989047,0.262328,-0.286486,3.086500,\n\t\t          0.264390,-0.263461,3.117203,0.244992,-0.295646,3.079687,0.280358,-0.296505,3.061540,0.288968,-0.267296,3.098622,\n\t\t          0.237103,-0.258614,3.129939,0.258956,-0.320305,3.032752,0.393312,-0.189786,3.071599,0.383323,-0.191639,3.058606,\n\t\t          0.406961,-0.176347,3.060088,0.388803,-0.198543,3.096715,0.368819,-0.209260,3.090132,0.399884,-0.159709,3.030452,\n\t\t          0.409978,-0.187530,3.095339,0.404558,0.068617,2.992110,0.395977,0.047474,2.971253,0.391504,0.089537,3.002204,\n\t\t          0.411052,0.065435,2.995512,0.411609,0.020486,2.977209,0.358199,0.074531,2.947349,0.397529,0.096952,3.022112,\n\t\t          0.153248,-0.306096,3.071483,0.131100,-0.282718,3.102708,0.143561,-0.325142,3.042757,0.184206,-0.306414,3.070741,\n\t\t          0.169043,-0.268182,3.122400,0.096001,-0.296399,3.078414,0.190823,-0.337271,3.020611,0.439466,-0.138829,3.233850,\n\t\t          0.438158,-0.124487,3.254369,0.422157,-0.146653,3.228034,0.458113,-0.144711,3.218042,0.468707,-0.124177,3.241652,\n\t\t          0.409222,-0.129575,3.257953,0.440589,-0.160194,3.197521,0.293994,-0.187919,3.210717,0.281614,-0.205873,3.188374,\n\t\t          0.313498,-0.185456,3.210587,0.287126,-0.171877,3.232332,0.259102,-0.191809,3.209649,0.306327,-0.210164,3.174253,\n\t\t          0.317578,-0.159228,3.244819,0.373412,-0.183848,3.187246,0.358338,-0.183586,3.197144,0.376992,-0.194691,3.162516,\n\t\t          0.385194,-0.172506,3.201380,0.368157,-0.161184,3.228168,0.354753,-0.202738,3.161678,0.398483,-0.184419,3.169096,\n\t\t          0.430015,-0.059917,3.298316,0.412077,-0.051077,3.308006,0.433403,-0.080401,3.291071,0.444225,-0.047884,3.293661,\n\t\t          0.422828,-0.023815,3.305044,0.404710,-0.080390,3.300425,0.461149,-0.073991,3.280643,0.495584,-0.001119,3.260373,\n\t\t          0.488325,0.019300,3.259222,0.481455,-0.014219,3.272407,0.515524,-0.008883,3.247884,0.514038,0.018899,3.237310,\n\t\t          0.461968,0.012640,3.278629,0.504986,-0.036624,3.258705,0.456458,0.074937,3.213747,0.467526,0.080164,3.190696,\n\t\t          0.434852,0.080562,3.216640,0.466036,0.062685,3.232509,0.489498,0.064149,3.207714,0.438744,0.092182,3.177578,\n\t\t          0.437934,0.062703,3.250241,0.292455,0.141440,3.050153,0.250214,0.162454,3.078578,0.308615,0.154537,3.104180,\n\t\t          0.327514,0.127507,3.032125,0.272522,0.135004,2.990913,0.230310,0.157946,3.011260,0.278037,0.164512,3.137434,\n\t\t          0.341469,0.138213,3.075717,0.314959,0.107976,2.976382,0.356572,0.114627,3.217110,0.378283,0.102478,3.218553,\n\t\t          0.344411,0.130173,3.191358,0.346692,0.110104,3.240218,0.376850,0.086562,3.255020,0.374643,0.118113,3.176719,\n\t\t          0.316903,0.134705,3.214784,0.319959,0.078141,3.310657,0.297013,0.087356,3.310838,0.333901,0.056498,3.325830,\n\t\t          0.327452,0.089538,3.292900,0.292696,0.113133,3.278892,0.306086,0.054712,3.334097,0.355056,0.062458,3.309365,\n\t\t          0.356595,-0.020343,3.339760,0.353777,0.001109,3.343217,0.344086,-0.034655,3.340782,0.371083,-0.028066,3.332021,\n\t\t          0.376618,0.002363,3.331116,0.330402,-0.008908,3.348507,0.359405,-0.056810,3.326621,0.276176,-0.097948,3.303296,\n\t\t          0.296667,-0.078185,3.319363,0.252598,-0.096477,3.305875,0.275761,-0.120603,3.284843,0.309444,-0.103593,3.300958,\n\t\t          0.278752,-0.059123,3.328948,0.242031,-0.134435,3.272547,0.223767,-0.099313,3.317965,0.227036,-0.099704,3.313858,\n\t\t          0.240551,-0.044434,3.344686,0.218416,-0.101051,3.322402,0.196950,-0.151284,3.286896,0.201563,-0.152156,3.280097,\n\t\t          0.245607,-0.045288,3.340653,0.235844,-0.044022,3.349352,0.190452,-0.153736,3.291292,0.236296,0.116889,3.323431,\n\t\t          0.248309,0.108748,3.316093,0.230846,0.153931,3.278384,0.229802,0.120482,3.330271,0.244091,0.066142,3.353887,\n\t\t          0.256151,0.059946,3.345754,0.243138,0.143434,3.270200,0.221905,0.162626,3.285979,0.236323,0.068822,3.360134,\n\t\t          0.206236,0.192526,3.110855,0.212875,0.189330,3.109694,0.172122,0.203583,3.044764,0.156921,0.242478,3.099692,\n\t\t          0.217834,0.191809,3.167503,0.222454,0.187692,3.166666,0.183792,0.194312,3.040854,0.137535,0.245412,3.060768,\n\t\t          0.196360,0.207718,3.174495,0.075577,0.209015,2.928299,0.072726,0.188234,2.905043,0.038942,0.195693,2.898396,\n\t\t          0.072441,0.222388,2.939337,0.097059,0.221694,2.952431,0.103470,0.213277,2.946484,0.038401,0.183570,2.875914,\n\t\t          0.036930,0.205410,2.907177,0.093740,0.224857,2.953933,0.114099,-0.239890,3.186093,0.136448,-0.224051,3.211219,\n\t\t          0.098448,-0.244431,3.180985,0.108102,-0.248921,3.167186,0.142386,-0.228321,3.199161,0.126810,-0.224721,3.215635,\n\t\t          0.073590,-0.254967,3.150936,0.184564,-0.102980,3.345776,0.196871,-0.104518,3.343387,0.202511,-0.049010,3.376647,\n\t\t          0.160517,-0.098384,3.340487,0.160168,-0.152593,3.299930,0.175318,-0.155293,3.299530,0.214496,-0.046457,3.373259,\n\t\t          0.175495,-0.050208,3.375893,0.141439,-0.144321,3.293115,0.077739,0.196876,3.297230,0.052845,0.188304,3.299977,\n\t\t          0.082758,0.186494,3.312220,0.076556,0.210274,3.274139,0.049222,0.213142,3.265772,0.061435,0.160755,3.330663,\n\t\t          0.092179,0.203774,3.282760,0.068630,0.258241,3.122799,0.140582,0.245697,3.087684,0.078785,0.257561,3.041541,\n\t\t          0.033980,0.264344,3.121891,0.076902,0.248292,3.178339,0.122248,0.234220,3.176844,0.122846,0.248448,3.043920,\n\t\t          0.038724,0.262959,3.050737,0.032068,0.252029,3.172195,0.088032,-0.234617,3.190449,0.105839,-0.220639,3.214749,\n\t\t          0.074437,-0.238221,3.173883,0.084101,-0.241886,3.183456,0.112300,-0.224600,3.216297,0.097176,-0.216216,3.204489,\n\t\t          0.055867,-0.250350,3.153941,0.051581,0.240807,2.948352,0.058599,0.232109,2.941106,0.027171,0.236702,2.930771,\n\t\t          0.057293,0.247309,2.965199,0.077045,0.235306,2.956293,0.031079,0.220854,2.915233,0.037796,0.255652,2.971040,\n\t\t          0.161127,0.096602,3.378060,0.123398,0.087984,3.398586,0.190033,0.055505,3.392343,0.203800,0.108679,3.358340,\n\t\t          0.101554,0.136531,3.364606,0.099173,0.125001,3.377545,0.158541,0.042339,3.405040,0.220472,0.063064,3.378618,\n\t\t          0.168163,0.150819,3.325432,0.526231,0.083189,3.097845,0.509179,0.084108,3.125700,0.554108,0.058719,3.116914,\n\t\t          0.557438,0.077077,3.061513,0.504403,0.094943,3.069079,0.483230,0.096775,3.101928,0.529213,0.067067,3.152048,\n\t\t          0.585608,0.055923,3.082653,0.522748,0.093300,3.036405,0.591564,-0.029765,3.159682,0.564326,-0.024678,3.194007,\n\t\t          0.588903,-0.064010,3.166913,0.626036,-0.033962,3.125578,0.587680,0.003154,3.148798,0.561887,0.008612,3.181690,\n\t\t          0.558350,-0.060277,3.203816,0.624942,-0.068264,3.131102,0.620021,-0.000825,3.115314,0.530898,-0.174668,3.134152,\n\t\t          0.511569,-0.171647,3.156360,0.513268,-0.187791,3.112811,0.575711,-0.168830,3.104274,0.564560,-0.136057,3.156152,\n\t\t          0.531765,-0.131397,3.190460,0.508050,-0.185275,3.130347,0.533196,-0.181764,3.085803,0.598992,-0.140775,3.120476,\n\t\t          0.455516,0.035788,2.998153,0.425975,0.048499,3.000405,0.468601,0.073818,3.020667,0.477922,0.033141,2.979247,\n\t\t          0.453176,-0.014081,2.978816,0.422245,-0.008538,2.979109,0.437842,0.079172,3.041376,0.495533,0.073731,2.991675,\n\t\t          0.469661,-0.017118,2.969789,0.469771,-0.137364,3.022692,0.438048,-0.142814,3.032364,0.455341,-0.105101,3.000266,\n\t\t          0.494712,-0.135680,3.004916,0.500677,-0.172273,3.053334,0.456797,-0.168396,3.074196,0.426039,-0.120758,3.004916,\n\t\t          0.485350,-0.104167,2.983108,0.502654,-0.162896,3.034716,0.668230,-0.167646,2.971180,0.643835,-0.181453,2.957198,\n\t\t          0.699396,-0.165416,2.925806,0.688304,-0.141283,2.980107,0.637873,-0.169570,3.019586,0.610832,-0.179757,3.003824,\n\t\t          0.677078,-0.177746,2.912742,0.717589,-0.141003,2.933228,0.660847,-0.142997,3.031112,0.717169,-0.049529,2.986308,\n\t\t          0.713774,-0.078637,2.987833,0.747844,-0.054221,2.938675,0.712245,-0.022214,2.979077,0.689816,-0.043864,3.037946,\n\t\t          0.687989,-0.075608,3.040701,0.742603,-0.082063,2.939504,0.745762,-0.027596,2.932796,0.682897,-0.013876,3.029316,\n\t\t          0.657407,0.054964,2.928525,0.680614,0.030306,2.948967,0.689218,0.035333,2.879874,0.630773,0.075256,2.905768,\n\t\t          0.623584,0.067887,2.975958,0.648259,0.042051,2.997531,0.717604,0.025911,2.903674,0.671335,0.062809,2.864166,\n\t\t          0.594573,0.087264,2.951212,0.564147,0.022873,2.864856,0.581953,0.060252,2.872044,0.617379,0.010462,2.833010,\n\t\t          0.554227,-0.021064,2.865030,0.533800,0.023545,2.916797,0.546397,0.065056,2.918799,0.631895,0.042043,2.838628,\n\t\t          0.606459,-0.024513,2.831028,0.528048,-0.020601,2.920764,0.579426,-0.120986,2.905040,0.564191,-0.091883,2.887584,\n\t\t          0.617578,-0.120125,2.860034,0.597498,-0.153937,2.922681,0.544036,-0.118741,2.952057,0.532498,-0.090015,2.938201,\n\t\t          0.606514,-0.090553,2.845101,0.633742,-0.151612,2.877662,0.561358,-0.149706,2.968330,0.803448,0.040246,2.782096,\n\t\t          0.765247,0.035459,2.805476,0.826427,0.017692,2.806488,0.833965,0.032381,2.758760,0.778591,0.058236,2.758717,\n\t\t          0.744377,0.048398,2.786989,0.789757,0.018048,2.829705,0.854837,0.009568,2.782343,0.809043,0.048524,2.735393,\n\t\t          0.843368,-0.076292,2.849238,0.813360,-0.067836,2.870974,0.835670,-0.108700,2.855921,0.868470,-0.083078,2.829809,\n\t\t          0.845578,-0.043851,2.839482,0.813665,-0.038413,2.862370,0.806729,-0.097960,2.875636,0.858524,-0.116218,2.837311,\n\t\t          0.871760,-0.051042,2.818101,0.776031,-0.184739,2.837701,0.755857,-0.176763,2.860517,0.752269,-0.190874,2.821481,\n\t\t          0.792141,-0.186456,2.818807,0.799442,-0.161512,2.848356,0.776259,-0.154381,2.870294,0.732714,-0.185870,2.844802,\n\t\t          0.766518,-0.188787,2.800208,0.818106,-0.169953,2.831981,0.699923,-0.121040,2.755836,0.673741,-0.123022,2.780704,\n\t\t          0.693071,-0.090979,2.738150,0.713552,-0.127849,2.730384,0.712099,-0.149640,2.776958,0.688183,-0.152976,2.800915,\n\t\t          0.667562,-0.091118,2.765529,0.709479,-0.096397,2.712001,0.725543,-0.155415,2.753709,0.713188,0.017235,2.718750,\n\t\t          0.686201,0.014431,2.751384,0.731082,0.046439,2.725081,0.740104,0.011844,2.694838,0.700316,-0.019444,2.719156,\n\t\t          0.674895,-0.021079,2.751103,0.702870,0.043999,2.757923,0.760028,0.038539,2.701813,0.723811,-0.023628,2.694008,\n\t\t          0.904802,-0.006152,2.707592,0.883814,0.010671,2.723159,0.921192,-0.024111,2.729090,0.926437,-0.028731,2.690596,\n\t\t          0.880340,0.002463,2.685277,0.859572,0.021929,2.700132,0.901352,-0.009510,2.745915,0.943457,-0.042454,2.710583,\n\t\t          0.901053,-0.024702,2.670588,0.915077,-0.105589,2.772117,0.901246,-0.095790,2.792212,0.899540,-0.134212,2.778476,\n\t\t          0.931097,-0.119241,2.751596,0.925300,-0.076466,2.761882,0.909716,-0.065242,2.781465,0.886598,-0.125815,2.798211,\n\t\t          0.914081,-0.146518,2.758080,0.944106,-0.090911,2.741819,0.831247,-0.207407,2.773845,0.818955,-0.191863,2.784748,\n\t\t          0.802040,-0.210357,2.753754,0.845042,-0.222404,2.760492,0.858577,-0.189139,2.782226,0.844975,-0.178034,2.796271,\n\t\t          0.792361,-0.193947,2.766104,0.816049,-0.222501,2.739289,0.872463,-0.203553,2.766917,0.752920,-0.149651,2.672890,\n\t\t          0.736605,-0.142617,2.688828,0.756512,-0.116514,2.654328,0.781109,-0.154874,2.663187,0.761144,-0.180891,2.700657,\n\t\t          0.749873,-0.168967,2.716890,0.735316,-0.110224,2.667666,0.782869,-0.127082,2.642986,0.784012,-0.186337,2.687894,\n\t\t          0.803159,-0.030619,2.641701,0.784410,-0.012468,2.657898,0.826582,-0.010826,2.650619,0.824550,-0.055424,2.627886,\n\t\t          0.782475,-0.056478,2.638597,0.763527,-0.042138,2.654870,0.807440,0.009576,2.666202,0.847209,-0.039326,2.637645,\n\t\t          0.804947,-0.076663,2.624555,1.009830,-0.125450,2.602958,0.982919,-0.088270,2.636984,1.024347,-0.134842,2.622377,\n\t\t          1.026112,-0.172097,2.573362,0.985587,-0.127617,2.588080,0.958571,-0.086074,2.617604,0.992535,-0.102230,2.656329,\n\t\t          1.039558,-0.180738,2.591875,1.007692,-0.169344,2.555705,1.000138,-0.205162,2.666927,0.980774,-0.169401,2.705192,\n\t\t          0.982774,-0.229311,2.674643,1.024640,-0.241442,2.636155,1.018648,-0.177637,2.656092,0.999727,-0.139465,2.693432,\n\t\t          0.959627,-0.195201,2.710732,1.007493,-0.264620,2.642890,1.038924,-0.216884,2.624579,0.914728,-0.282617,2.670146,\n\t\t          0.888649,-0.252501,2.704290,0.892951,-0.283892,2.655063,0.943015,-0.310292,2.632417,0.939009,-0.270739,2.677632,\n\t\t          0.912989,-0.242298,2.713846,0.866419,-0.248929,2.684996,0.919491,-0.316791,2.619161,0.966749,-0.297946,2.640013,\n\t\t          0.853333,-0.240976,2.582495,0.825083,-0.205852,2.614587,0.857876,-0.217194,2.564771,0.890826,-0.275324,2.554129,\n\t\t          0.862670,-0.258000,2.606961,0.833010,-0.226490,2.639585,0.830669,-0.180079,2.596197,0.897074,-0.250530,2.538281,\n\t\t          0.891615,-0.297460,2.575974,0.908158,-0.156145,2.552558,0.877771,-0.118061,2.581935,0.931510,-0.141873,2.558626,\n\t\t          0.939541,-0.195316,2.524369,0.888280,-0.172932,2.551148,0.858295,-0.135242,2.579998,0.900763,-0.104329,2.589565,\n\t\t          0.960738,-0.182688,2.530413,0.921441,-0.210140,2.523223,1.058226,-0.242386,2.515721,1.052509,-0.229247,2.529058,\n\t\t          1.071940,-0.251276,2.531471,1.059062,-0.250719,2.512270,1.039508,-0.239901,2.502181,1.034459,-0.226899,2.514040,\n\t\t          1.065573,-0.237808,2.545828,1.071972,-0.259247,2.526805,1.041158,-0.247404,2.499885,1.063433,-0.304464,2.574011,\n\t\t          1.055123,-0.291669,2.587526,1.046058,-0.323535,2.581762,1.064075,-0.308868,2.568557,1.074739,-0.284476,2.562368,\n\t\t          1.066879,-0.270713,2.576505,1.038387,-0.312060,2.594524,1.047926,-0.325950,2.576458,1.074579,-0.290326,2.556719,\n\t\t          0.987815,-0.348990,2.570902,0.981902,-0.341670,2.582280,0.974986,-0.346490,2.558973,0.990368,-0.348772,2.568567,\n\t\t          1.005356,-0.346978,2.579854,0.999692,-0.338159,2.591660,0.967466,-0.340221,2.569841,0.977179,-0.346109,2.557541,\n\t\t          1.008390,-0.346953,2.576263,0.961013,-0.317786,2.520201,0.950755,-0.309985,2.525310,0.962023,-0.303212,2.508281,\n\t\t          0.962757,-0.318812,2.521423,0.962277,-0.330188,2.532589,0.951544,-0.323986,2.539685,0.952713,-0.293308,2.512938,\n\t\t          0.963862,-0.305061,2.509531,0.964168,-0.330360,2.533015,0.984607,-0.262720,2.487504,0.979176,-0.250314,2.494161,\n\t\t          1.000335,-0.251422,2.487813,0.986818,-0.265791,2.487464,0.972946,-0.275022,2.490590,0.966112,-0.262711,2.495991,\n\t\t          0.995724,-0.238763,2.496143,1.002680,-0.255800,2.487211,0.975033,-0.277688,2.491042,1.099923,-0.300035,2.475071,\n\t\t          1.080197,-0.277824,2.494069,1.108772,-0.308334,2.490599,1.117121,-0.320700,2.456025,1.086445,-0.296164,2.461423,\n\t\t          1.065323,-0.273910,2.481198,1.090339,-0.286045,2.508886,1.125280,-0.329062,2.472135,1.104241,-0.316493,2.441611,\n\t\t          1.096000,-0.354068,2.530858,1.079910,-0.332442,2.549165,1.081751,-0.370406,2.538327,1.110539,-0.374187,2.513746,\n\t\t          1.106455,-0.336905,2.519986,1.089898,-0.315018,2.538029,1.065737,-0.348463,2.556563,1.095923,-0.390429,2.521739,\n\t\t          1.121568,-0.357288,2.502450,1.031102,-0.397358,2.533822,1.012103,-0.373235,2.551691,1.017581,-0.395617,2.523404,\n\t\t          1.046171,-0.417623,2.518687,1.047630,-0.393329,2.540144,1.029980,-0.369784,2.558064,0.997806,-0.371455,2.541146,\n\t\t          1.032491,-0.416245,2.508527,1.062193,-0.413515,2.524598,0.999077,-0.364280,2.479973,0.981473,-0.340838,2.501198,\n\t\t          1.000881,-0.349749,2.466038,1.013882,-0.384919,2.463542,1.001429,-0.377598,2.494936,0.983401,-0.353745,2.514859,\n\t\t          0.982656,-0.326709,2.487577,1.016268,-0.369586,2.448367,1.015961,-0.398626,2.479449,1.034823,-0.309677,2.443954,\n\t\t          1.013291,-0.288095,2.466447,1.051937,-0.301328,2.444947,1.051371,-0.328984,2.422396,1.020130,-0.320830,2.447396,\n\t\t          0.998901,-0.299294,2.469135,1.029967,-0.279598,2.467077,1.069691,-0.320920,2.423961,1.034891,-0.340303,2.425953,\n\t\t          1.139844,-0.358576,2.425313,1.137200,-0.349790,2.430599,1.146427,-0.366225,2.440839,1.133956,-0.363859,2.426788,\n\t\t          1.128417,-0.354648,2.411654,1.125043,-0.345731,2.416364,1.144456,-0.357806,2.446751,1.139355,-0.370098,2.440229,\n\t\t          1.124432,-0.360660,2.415121,1.129357,-0.406428,2.482047,1.127594,-0.400458,2.489619,1.115108,-0.420842,2.490471,\n\t\t          1.123504,-0.404566,2.477277,1.140590,-0.391398,2.470581,1.139096,-0.384533,2.477722,1.112821,-0.415732,2.498325,\n\t\t          1.110507,-0.417367,2.485319,1.133779,-0.391323,2.466581,1.069831,-0.444763,2.490730,1.064692,-0.441386,2.497934,\n\t\t          1.057626,-0.443833,2.482131,1.071455,-0.437943,2.487106,1.084028,-0.441155,2.495198,1.079993,-0.437418,2.502940,\n\t\t          1.051359,-0.440535,2.488492,1.061422,-0.437135,2.480242,1.083258,-0.434968,2.490440,1.041482,-0.416015,2.440228,\n\t\t          1.034179,-0.410825,2.444084,1.043818,-0.402312,2.424994,1.047977,-0.412799,2.443222,1.043000,-0.428546,2.455696,\n\t\t          1.035712,-0.424151,2.460250,1.036715,-0.396258,2.428287,1.050282,-0.400575,2.429168,1.049132,-0.423968,2.457365,\n\t\t          1.078635,-0.366250,2.397109,1.073092,-0.357958,2.400085,1.095966,-0.358807,2.396756,1.081784,-0.369764,2.403615,\n\t\t          1.062973,-0.376386,2.402129,1.056653,-0.368728,2.404787,1.091187,-0.350116,2.400271,1.097018,-0.363764,2.402954,\n\t\t          1.067740,-0.378200,2.408372,0.079106,0.168941,2.298903,0.080094,0.171296,2.284955,0.041358,0.169257,2.303293,\n\t\t          0.078121,0.156222,2.335142,0.121322,0.162779,2.300107,0.124016,0.164954,2.287610,0.045263,0.171714,2.290912,\n\t\t          0.038697,0.154308,2.339539,0.118739,0.154655,2.328392,0.248175,0.115987,2.284756,0.206342,0.135735,2.293620,\n\t\t          0.244588,0.110789,2.314411,0.289733,0.087771,2.278573,0.249455,0.117523,2.273625,0.206627,0.139644,2.279968,\n\t\t          0.204269,0.131686,2.311133,0.286036,0.083201,2.314021,0.290039,0.091673,2.263577,0.364694,-0.029773,2.267056,\n\t\t          0.348162,0.016511,2.269207,0.355010,-0.030968,2.290147,0.374963,-0.074680,2.259556,0.370588,-0.029246,2.236522,\n\t\t          0.354232,0.022427,2.241590,0.339790,0.011489,2.299247,0.364918,-0.075003,2.286800,0.380865,-0.076809,2.229327,\n\t\t          0.352260,-0.207507,2.235878,0.371218,-0.164227,2.240623,0.356285,-0.213651,2.269069,0.320279,-0.240768,2.250049,\n\t\t          0.358910,-0.203525,2.209550,0.374039,-0.167403,2.216665,0.372486,-0.166174,2.275274,0.316240,-0.246246,2.275750,\n\t\t          0.325792,-0.242216,2.208793,0.152814,-0.321777,2.227257,0.222105,-0.297588,2.219785,0.153765,-0.325921,2.244179,\n\t\t          0.077899,-0.337161,2.222344,0.150965,-0.313682,2.200688,0.229101,-0.294672,2.197985,0.218961,-0.310021,2.259684,\n\t\t          0.076818,-0.340113,2.240066,0.075543,-0.331267,2.199811,0.319694,-0.164945,0.155104,0.315749,-0.166069,0.170484,\n\t\t          0.307335,-0.122158,0.149219,0.320158,-0.164692,0.155460,0.338807,-0.204578,0.161304,0.334360,-0.207812,0.177075,\n\t\t          0.304028,-0.122256,0.164556,0.308778,-0.122287,0.149751,0.338625,-0.203428,0.161228,0.304977,-0.016577,0.143739,\n\t\t          0.303095,-0.015807,0.161563,0.315515,0.010132,0.141496,0.307398,-0.017636,0.143958,0.300196,-0.046401,0.144000,\n\t\t          0.297756,-0.045496,0.160062,0.313243,0.010855,0.158812,0.317448,0.009130,0.141003,0.302806,-0.047154,0.144593,\n\t\t          0.521278,-0.199338,0.153666,0.522878,-0.198437,0.170082,0.501853,-0.231147,0.161129,0.519631,-0.198367,0.153819,\n\t\t          0.536800,-0.164602,0.146566,0.538857,-0.163146,0.163254,0.503316,-0.231565,0.177342,0.500631,-0.229883,0.161302,\n\t\t          0.534762,-0.164081,0.146704,0.426311,-0.278993,0.167683,0.426083,-0.286504,0.185251,0.394708,-0.265302,0.167583,\n\t\t          0.426602,-0.278024,0.167781,0.454298,-0.274731,0.168138,0.455171,-0.280131,0.185175,0.392399,-0.272586,0.184764,\n\t\t          0.394692,-0.263819,0.167367,0.454222,-0.273661,0.168339,0.505315,0.041094,0.140010,0.509383,0.048696,0.154438,\n\t\t          0.525406,0.022775,0.136721,0.503876,0.037656,0.139983,0.481857,0.054041,0.142281,0.484429,0.062095,0.157021,\n\t\t          0.529961,0.029140,0.151892,0.523732,0.019994,0.136204,0.480861,0.050053,0.142569,0.391451,0.056551,0.145319,\n\t\t          0.388067,0.064353,0.160097,0.423849,0.061555,0.145357,0.392843,0.052589,0.145614,0.359986,0.047031,0.142578,\n\t\t          0.356813,0.052139,0.158355,0.422005,0.070021,0.160256,0.424488,0.057107,0.145902,0.361467,0.044458,0.142067,\n\t\t          0.554424,-0.060502,0.134224,0.557704,-0.058041,0.152326,0.553620,-0.093984,0.136591,0.552016,-0.061558,0.133710,\n\t\t          0.550341,-0.028897,0.133230,0.554195,-0.025419,0.150733,0.556542,-0.092059,0.154371,0.551159,-0.094517,0.136393,\n\t\t          0.548184,-0.030462,0.132421,0.333412,-0.156815,0.225336,0.326563,-0.160719,0.193240,0.321338,-0.118241,0.219841,\n\t\t          0.338597,-0.153412,0.262513,0.349905,-0.193692,0.231294,0.343372,-0.198611,0.198969,0.315543,-0.120262,0.187723,\n\t\t          0.326216,-0.116714,0.257186,0.355014,-0.188349,0.268326,0.317856,-0.023920,0.215648,0.313742,-0.021358,0.182746,\n\t\t          0.328444,-0.001270,0.216455,0.322121,-0.026425,0.253371,0.313185,-0.050409,0.215059,0.309188,-0.049156,0.182808,\n\t\t          0.323865,0.003305,0.181565,0.332675,-0.005156,0.254858,0.317504,-0.051763,0.252566,0.512876,-0.190040,0.223636,\n\t\t          0.515524,-0.193406,0.191643,0.495617,-0.220747,0.230823,0.509809,-0.186053,0.260842,0.527207,-0.157958,0.216973,\n\t\t          0.530155,-0.160318,0.184797,0.497695,-0.224899,0.198968,0.493050,-0.214882,0.267793,0.523517,-0.155386,0.254419,\n\t\t          0.428025,-0.278153,0.242461,0.427592,-0.281432,0.208623,0.399194,-0.260254,0.240736,0.427991,-0.266108,0.280157,\n\t\t          0.453338,-0.270778,0.241131,0.454083,-0.274518,0.208070,0.396487,-0.264330,0.207206,0.401367,-0.249842,0.278180,\n\t\t          0.452026,-0.260035,0.278493,0.503723,0.034787,0.209666,0.504743,0.036847,0.176818,0.520615,0.015909,0.209239,\n\t\t          0.498677,0.027510,0.248888,0.482011,0.047691,0.211416,0.482212,0.049437,0.179266,0.522913,0.018358,0.174863,\n\t\t          0.514887,0.009859,0.248669,0.478296,0.039776,0.250076,0.392170,0.056562,0.215122,0.392101,0.055866,0.182761,\n\t\t          0.423734,0.060089,0.214395,0.394650,0.048012,0.253576,0.365785,0.041016,0.216167,0.363596,0.043321,0.181604,\n\t\t          0.423961,0.059659,0.182672,0.424179,0.051396,0.252556,0.369363,0.033761,0.255025,0.544604,-0.063096,0.208547,\n\t\t          0.547979,-0.062371,0.174227,0.543508,-0.093730,0.209314,0.538607,-0.064350,0.247034,0.541020,-0.034114,0.208764,\n\t\t          0.544596,-0.032329,0.173450,0.546739,-0.094004,0.175968,0.538195,-0.093610,0.247387,0.534851,-0.036952,0.247724,\n\t\t          -0.229640,0.147065,2.201617,-0.192363,0.170240,2.199985,-0.245004,0.144739,2.193233,-0.233627,0.130845,2.221418,\n\t\t          -0.192527,0.155071,2.220074,-0.213631,0.167180,2.183909,-0.273863,0.114743,2.208838,-0.386377,-0.031030,2.174030,\n\t\t          -0.384894,-0.030612,2.181954,-0.372876,0.005309,2.172107,-0.385181,-0.042055,2.145869,-0.392918,-0.088878,2.164870,\n\t\t          -0.389543,-0.082745,2.177601,-0.365354,0.011484,2.183843,-0.372472,0.001853,2.150929,-0.392332,-0.091510,2.139932,\n\t\t          -0.398390,-0.045830,2.010775,-0.393520,-0.044087,2.054063,-0.379892,0.000432,2.012012,-0.404132,-0.048208,1.963991,\n\t\t          -0.412283,-0.092674,2.009268,-0.401356,-0.090814,2.051022,-0.377222,0.002657,2.056211,-0.382503,-0.003663,1.964194,\n\t\t          -0.423698,-0.094949,1.963974,-0.120083,0.179186,2.209971,-0.108209,0.186536,2.200189,-0.163805,0.180308,2.203323,\n\t\t          -0.101167,0.164089,2.239889,-0.063565,0.184235,2.211100,-0.151522,0.188300,2.190925,-0.144115,0.166966,2.227275,\n\t\t          -0.145911,-0.320494,2.119548,-0.146335,-0.321287,2.125438,-0.240697,-0.297919,2.131543,-0.149339,-0.316495,2.103427,\n\t\t          -0.076851,-0.317408,2.114220,-0.080220,-0.320729,2.131027,-0.248622,-0.295608,2.147900,-0.220650,-0.302405,2.102533,\n\t\t          -0.076085,-0.315215,2.098467,-0.059049,0.192709,2.163926,-0.070215,0.198058,2.124671,-0.072401,0.193500,2.184394,\n\t\t          -0.031946,0.188458,2.170929,-0.031911,0.191341,2.118035,-0.107327,0.197091,2.146284,-0.049632,0.190432,2.196770,\n\t\t          -0.303635,0.106580,2.167212,-0.291773,0.118366,2.134967,-0.325847,0.085312,2.174368,-0.288519,0.119836,2.177446,\n\t\t          -0.259292,0.145160,2.145160,-0.324524,0.083212,2.141514,-0.310104,0.098315,2.194960,-0.284352,0.129051,2.009432,\n\t\t          -0.282925,0.130529,2.056074,-0.239496,0.161668,2.006601,-0.290126,0.126198,1.958760,-0.324266,0.090507,2.011555,\n\t\t          -0.321323,0.091273,2.056378,-0.238456,0.164662,2.058226,-0.241501,0.155962,1.952585,-0.332751,0.090398,1.962406,\n\t\t          -0.094464,0.189390,1.992856,-0.092675,0.199916,2.039249,-0.046215,0.179956,1.990069,-0.093030,0.172010,1.947404,\n\t\t          -0.143178,0.192032,1.997638,-0.141775,0.200116,2.049230,-0.043732,0.191546,2.034062,-0.046968,0.160750,1.946851,\n\t\t          -0.141953,0.179765,1.946501,-0.074038,0.073038,1.846509,-0.067557,0.033084,1.821441,-0.104627,0.093751,1.835304,\n\t\t          -0.080467,0.113325,1.872768,-0.040394,0.055194,1.851286,-0.035475,0.008188,1.827508,-0.095368,0.056404,1.813391,\n\t\t          -0.120006,0.129794,1.863512,-0.043282,0.098170,1.876534,-0.049864,-0.199949,1.864025,-0.060536,-0.191652,1.850483,\n\t\t          -0.027923,-0.188701,1.861199,-0.061150,-0.220021,1.880722,-0.085673,-0.226982,1.867793,-0.031349,-0.162295,1.841599,\n\t\t          -0.031572,-0.214666,1.883338,-0.116275,-0.266295,1.982935,-0.125344,-0.273848,2.021634,-0.165978,-0.278987,1.978161,\n\t\t          -0.100511,-0.263772,1.940202,-0.057013,-0.272521,1.982673,-0.065342,-0.283922,2.022410,-0.196993,-0.290193,2.016483,\n\t\t          -0.130870,-0.265548,1.934953,-0.047945,-0.257982,1.944167,-0.356928,-0.221687,2.148299,-0.331457,-0.247557,2.136481,\n\t\t          -0.351128,-0.224839,2.160311,-0.389079,-0.167613,2.155954,-0.359550,-0.216882,2.122500,-0.323210,-0.254444,2.113519,\n\t\t          -0.341893,-0.233476,2.158842,-0.393044,-0.151973,2.166480,-0.382285,-0.179096,2.132475,-0.254003,-0.288124,1.951474,\n\t\t          -0.237036,-0.289192,1.962727,-0.285926,-0.291859,1.969738,-0.247501,-0.296475,1.919877,-0.211919,-0.297690,1.925684,\n\t\t          -0.260929,-0.281545,1.994464,-0.289668,-0.299879,1.934263,-0.373078,-0.225191,1.996072,-0.367074,-0.217747,2.038506,\n\t\t          -0.392598,-0.181312,2.002384,-0.379466,-0.228711,1.952660,-0.349344,-0.250206,1.992333,-0.337626,-0.250420,2.031499,\n\t\t          -0.387911,-0.179121,2.043492,-0.395165,-0.182315,1.957087,-0.350415,-0.252925,1.948807,-0.383780,-0.229257,1.790872,\n\t\t          -0.381104,-0.224686,1.851549,-0.415833,-0.198233,1.793753,-0.387606,-0.231939,1.720869,-0.359895,-0.267122,1.788555,\n\t\t          -0.356033,-0.261168,1.848511,-0.406297,-0.193830,1.852492,-0.421593,-0.199507,1.723746,-0.364629,-0.272222,1.718623,\n\t\t          -0.241822,-0.311986,1.776441,-0.242252,-0.307736,1.834348,-0.293301,-0.320350,1.782922,-0.242790,-0.315327,1.705830,\n\t\t          -0.227743,-0.306212,1.768112,-0.197126,-0.288875,1.831028,-0.288464,-0.314003,1.841834,-0.299353,-0.323878,1.712653,\n\t\t          -0.232270,-0.310869,1.700029,-0.326782,0.090373,1.788942,-0.313381,0.107461,1.849565,-0.281788,0.107444,1.783380,\n\t\t          -0.337659,0.071255,1.719929,-0.355851,0.049679,1.794030,-0.346888,0.067512,1.854773,-0.262848,0.125802,1.842979,\n\t\t          -0.300307,0.094550,1.714975,-0.367518,0.033378,1.724315,-0.165951,0.094489,1.748006,-0.138526,0.066086,1.737609,\n\t\t          -0.181447,0.076164,1.695022,-0.201744,0.114021,1.761239,-0.150477,0.105644,1.788252,-0.127915,0.075044,1.773317,\n\t\t          -0.151690,0.049646,1.688424,-0.218657,0.095300,1.702218,-0.182234,0.129971,1.809574,-0.434789,-0.065289,1.798505,\n\t\t          -0.422891,-0.058065,1.859340,-0.410891,-0.027368,1.797660,-0.446685,-0.072206,1.728288,-0.452043,-0.107532,1.799341,\n\t\t          -0.441540,-0.102541,1.860299,-0.399357,-0.017660,1.858636,-0.422673,-0.036926,1.727505,-0.460413,-0.112059,1.728553,\n\t\t          -0.073240,-0.037097,1.722160,-0.065819,-0.021845,1.761821,-0.062315,-0.075573,1.722391,-0.081004,-0.048392,1.670331,\n\t\t          -0.094692,-0.003741,1.725915,-0.089661,0.008676,1.762113,-0.047585,-0.060062,1.766869,-0.074451,-0.086913,1.667850,\n\t\t          -0.100405,-0.014672,1.675835,-0.104868,-0.203285,1.740476,-0.089364,-0.191954,1.789938,-0.129005,-0.259539,1.746424,\n\t\t          -0.121838,-0.216928,1.673258,-0.078115,-0.159334,1.731947,-0.058990,-0.147859,1.780284,-0.126342,-0.235952,1.805030,\n\t\t          -0.125478,-0.264942,1.687658,-0.094138,-0.169384,1.672909,-0.157293,-0.210651,1.413484,-0.192567,-0.246394,1.416626,\n\t\t          -0.177763,-0.208117,1.317995,-0.124481,-0.184699,1.409349,-0.204373,-0.237850,1.320309,-0.144788,-0.169954,1.318924,\n\t\t          -0.118865,-0.068009,1.416584,-0.117337,-0.103437,1.413274,-0.134935,-0.070800,1.320218,-0.134591,-0.036977,1.421764,\n\t\t          -0.127433,-0.109133,1.315970,-0.153323,-0.043615,1.325227,-0.404858,-0.227854,1.439265,-0.430104,-0.190823,1.443071,\n\t\t          -0.409623,-0.220863,1.340953,-0.384358,-0.267824,1.436040,-0.433016,-0.186414,1.343786,-0.384678,-0.250311,1.338070,\n\t\t          -0.287803,-0.305866,1.426262,-0.321198,-0.302728,1.429699,-0.297118,-0.294896,1.327991,-0.241250,-0.286466,1.424998,\n\t\t          -0.328210,-0.289988,1.331395,-0.265329,-0.284149,1.325315,-0.368047,0.023947,1.440460,-0.332807,0.040757,1.439250,\n\t\t          -0.367693,0.011806,1.327990,-0.401958,0.003720,1.442956,-0.342764,0.020351,1.321778,-0.397953,-0.000559,1.338037,\n\t\t          -0.225708,0.024506,1.435296,-0.191621,0.008937,1.431908,-0.241257,0.016844,1.333039,-0.259290,0.041857,1.436794,\n\t\t          -0.207496,0.000517,1.333912,-0.280106,0.025562,1.326364,-0.470109,-0.083367,1.446964,-0.451486,-0.051883,1.446831,\n\t\t          -0.471530,-0.083998,1.349459,-0.470740,-0.117034,1.446103,-0.455278,-0.052236,1.348876,-0.470013,-0.116390,1.348396,\n\t\t          -0.208670,-0.193304,1.128073,-0.234992,-0.220823,1.130129,-0.215488,-0.189574,1.093798,-0.183899,-0.162277,1.125724,\n\t\t          -0.200095,-0.197410,1.172999,-0.226558,-0.225069,1.175068,-0.241356,-0.217782,1.095667,-0.191120,-0.157852,1.091587,\n\t\t          -0.175741,-0.165799,1.170904,-0.170631,-0.061534,1.122300,-0.160850,-0.096483,1.123762,-0.183726,-0.053873,1.087190,\n\t\t          -0.196893,-0.026468,1.118369,-0.156028,-0.066248,1.171407,-0.150886,-0.098359,1.169638,-0.170955,-0.091053,1.088627,\n\t\t          -0.207112,-0.019789,1.085576,-0.179166,-0.034519,1.171405,-0.428718,-0.205321,1.148570,-0.421920,-0.209817,1.193776,\n\t\t          -0.448770,-0.174612,1.151191,-0.435728,-0.200360,1.114691,-0.405828,-0.231604,1.145938,-0.398569,-0.236629,1.190969,\n\t\t          -0.442934,-0.178409,1.196654,-0.454913,-0.169946,1.116992,-0.413199,-0.226450,1.112268,-0.321947,-0.266911,1.136892,\n\t\t          -0.314079,-0.274813,1.181561,-0.351722,-0.263972,1.139947,-0.329575,-0.260942,1.103317,-0.292214,-0.259140,1.134431,\n\t\t          -0.284081,-0.265927,1.179160,-0.344067,-0.271123,1.184695,-0.359272,-0.258203,1.106397,-0.299827,-0.253667,1.100786,\n\t\t          -0.392211,0.012180,1.141475,-0.372906,0.014718,1.203889,-0.346031,0.029587,1.150521,-0.393766,0.010886,1.106509,\n\t\t          -0.420301,-0.011170,1.140791,-0.416809,-0.005014,1.201776,-0.331869,0.026043,1.200346,-0.364116,0.027782,1.100739,\n\t\t          -0.416668,-0.006707,1.116256,-0.263471,0.024536,1.130534,-0.246905,0.015837,1.120822,-0.260525,0.024012,1.104227,\n\t\t          -0.279982,0.029990,1.140877,-0.266908,0.026642,1.169202,-0.244703,0.016458,1.163268,-0.245801,0.015470,1.095741,\n\t\t          -0.281487,0.032213,1.111251,-0.284918,0.029916,1.180854,-0.464855,-0.079907,1.157122,-0.468162,-0.082894,1.198836,\n\t\t          -0.453615,-0.054202,1.154154,-0.473615,-0.076811,1.123111,-0.470269,-0.109217,1.155635,-0.468180,-0.112693,1.200175,\n\t\t          -0.460785,-0.055994,1.197897,-0.460973,-0.048418,1.124829,-0.475674,-0.106631,1.120703,-0.236168,-0.167788,1.002352,\n\t\t          -0.260580,-0.197181,1.003877,-0.249778,-0.156143,0.959175,-0.215611,-0.133907,1.001376,-0.227287,-0.177790,1.035843,\n\t\t          -0.252618,-0.206819,1.037544,-0.272328,-0.185840,0.960509,-0.229913,-0.122943,0.958166,-0.205645,-0.143752,1.034642,\n\t\t          -0.206302,-0.030117,1.009497,-0.197805,-0.064307,1.002704,-0.215093,-0.024113,0.961182,-0.218828,-0.004160,1.017278,\n\t\t          -0.200945,-0.036705,1.038366,-0.189113,-0.073256,1.034018,-0.208400,-0.057643,0.958153,-0.231586,0.003212,0.960222,\n\t\t          -0.216554,-0.009499,1.044419,-0.457811,-0.176665,1.024336,-0.450119,-0.185713,1.058154,-0.473780,-0.146205,1.025782,\n\t\t          -0.465353,-0.171581,0.977937,-0.437156,-0.204982,1.017469,-0.428263,-0.211743,1.056103,-0.467504,-0.155428,1.059835,\n\t\t          -0.480019,-0.137370,0.980805,-0.448521,-0.202607,0.972434,-0.352760,-0.238268,1.012793,-0.344654,-0.246800,1.047062,\n\t\t          -0.382689,-0.235127,1.016559,-0.359963,-0.234733,0.958423,-0.322906,-0.230436,1.010799,-0.314703,-0.239542,1.044462,\n\t\t          -0.374377,-0.243892,1.050248,-0.388129,-0.229226,0.968551,-0.337358,-0.226552,0.960030,-0.421327,0.050202,1.021287,\n\t\t          -0.407753,0.036032,1.059096,-0.390994,0.065183,1.019342,-0.428794,0.059142,0.972492,-0.446109,0.028689,1.023471,\n\t\t          -0.439555,0.017898,1.058251,-0.370233,0.043640,1.057008,-0.401038,0.074658,0.970273,-0.451593,0.037592,0.975036,\n\t\t          -0.295248,0.046637,1.007521,-0.261617,0.035811,1.012971,-0.297525,0.053995,0.971146,-0.316746,0.051499,1.015773,\n\t\t          -0.277028,0.038526,1.049283,-0.246406,0.021873,1.055784,-0.277413,0.040746,0.964928,-0.329920,0.075718,0.971043,\n\t\t          -0.314525,0.045112,1.042214,-0.486839,-0.052781,1.026895,-0.483153,-0.062358,1.061580,-0.479248,-0.023934,1.026281,\n\t\t          -0.490795,-0.043849,0.981411,-0.488444,-0.082915,1.027014,-0.484517,-0.092334,1.061602,-0.475335,-0.033794,1.060954,\n\t\t          -0.482530,-0.014756,0.979153,-0.492108,-0.073932,0.981599,-0.284231,-0.138822,0.721323,-0.308904,-0.166612,0.723774,\n\t\t          -0.292608,-0.139793,0.617331,-0.259266,-0.106789,0.718625,-0.319281,-0.166598,0.620282,-0.267759,-0.107364,0.614362,\n\t\t          -0.236129,-0.012184,0.716129,-0.229861,-0.044341,0.715420,-0.246468,-0.009477,0.611838,-0.251493,0.017060,0.717725,\n\t\t          -0.240595,-0.041769,0.611202,-0.261286,0.018904,0.613403,-0.483124,-0.145831,0.741090,-0.502081,-0.107701,0.748639,\n\t\t          -0.485038,-0.147524,0.633039,-0.469165,-0.174844,0.738984,-0.495230,-0.111333,0.636321,-0.478541,-0.182365,0.630084,\n\t\t          -0.389783,-0.222281,0.729333,-0.427461,-0.217503,0.731871,-0.394089,-0.219104,0.626933,-0.373425,-0.218478,0.726723,\n\t\t          -0.436381,-0.210370,0.632729,-0.377375,-0.217471,0.624054,-0.465617,0.071572,0.738418,-0.436550,0.087222,0.735647,\n\t\t          -0.475383,0.067624,0.633781,-0.487366,0.048789,0.740256,-0.448006,0.083978,0.630994,-0.493512,0.043695,0.635673,\n\t\t          -0.334541,0.081878,0.725875,-0.302465,0.064995,0.722775,-0.346525,0.079738,0.621621,-0.368651,0.092230,0.729152,\n\t\t          -0.313252,0.064000,0.618512,-0.380996,0.089610,0.624791,-0.528545,-0.028223,0.735248,-0.520733,-0.002255,0.738196,\n\t\t          -0.524196,-0.027694,0.638656,-0.525334,-0.054022,0.737126,-0.518614,-0.005288,0.638225,-0.517888,-0.052440,0.638109,\n\t\t          -0.311048,-0.160828,0.251678,-0.305270,-0.146180,0.416689,-0.335667,-0.174376,0.420975,-0.333589,-0.198533,0.256546,\n\t\t          -0.291729,-0.119430,0.248205,-0.281576,-0.112477,0.412830,-0.301724,-0.024014,0.254746,-0.273022,-0.010160,0.410219,\n\t\t          -0.267288,-0.041126,0.409538,-0.296429,-0.048709,0.253383,-0.307586,0.009204,0.252185,-0.286334,0.016550,0.411344,\n\t\t          -0.498383,-0.156727,0.429791,-0.521459,-0.187004,0.263846,-0.489153,-0.187867,0.431797,-0.513125,-0.115444,0.432630,\n\t\t          -0.529407,-0.151890,0.259013,-0.505421,-0.219248,0.268633,-0.405818,-0.229785,0.426729,-0.415036,-0.264054,0.275490,\n\t\t          -0.386051,-0.228288,0.426622,-0.448486,-0.225080,0.432460,-0.444835,-0.259295,0.273220,-0.398848,-0.258687,0.275671,\n\t\t          -0.487974,0.057260,0.425575,-0.498778,0.055481,0.254808,-0.502298,0.033745,0.426856,-0.462661,0.072934,0.425477,\n\t\t          -0.476512,0.071634,0.254229,-0.514622,0.033022,0.255262,-0.380115,0.073185,0.253126,-0.372458,0.054440,0.418357,\n\t\t          -0.348955,0.046870,0.406847,-0.347952,0.058858,0.252360,-0.414916,0.080631,0.253463,-0.395147,0.064023,0.427573,\n\t\t          -0.524628,-0.043996,0.426834,-0.541742,-0.049568,0.261399,-0.525320,-0.076564,0.419599,-0.520250,-0.017300,0.427970,\n\t\t          -0.537309,-0.027460,0.258908,-0.537277,-0.082335,0.255173,-0.080821,0.181548,2.477012,-0.122461,0.180323,2.481554,\n\t\t          -0.081802,0.165254,2.529388,-0.039766,0.175958,2.470989,-0.079267,0.151316,2.416910,-0.119510,0.147953,2.413544,\n\t\t          -0.126998,0.170826,2.519608,-0.040456,0.155965,2.535323,-0.039063,0.149409,2.420027,-0.246206,0.124963,2.470719,\n\t\t          -0.238644,0.102904,2.400107,-0.276729,0.087622,2.460067,-0.255147,0.131193,2.523095,-0.208062,0.151340,2.479104,\n\t\t          -0.200867,0.124022,2.404986,-0.270281,0.074844,2.394513,-0.285156,0.097357,2.523984,-0.210418,0.152407,2.523774,\n\t\t          -0.323319,-0.035437,2.430513,-0.330438,-0.035203,2.373891,-0.326591,-0.076560,2.422230,-0.331574,-0.031070,2.487640,\n\t\t          -0.313393,0.005706,2.439548,-0.316547,0.004357,2.381317,-0.336704,-0.075960,2.366101,-0.329753,-0.072226,2.483515,\n\t\t          -0.322987,0.012572,2.494598,-0.308756,-0.206371,2.396891,-0.326490,-0.198191,2.350940,-0.292857,-0.236193,2.402456,\n\t\t          -0.293570,-0.190505,2.466770,-0.319211,-0.157823,2.408448,-0.334630,-0.165602,2.349678,-0.298646,-0.241307,2.341889,\n\t\t          -0.276130,-0.237956,2.455882,-0.308747,-0.153553,2.472000,-0.131633,-0.330952,2.374211,-0.144377,-0.328614,2.325722,\n\t\t          -0.086884,-0.331696,2.384709,-0.134670,-0.326032,2.435821,-0.205807,-0.306345,2.386015,-0.215072,-0.311418,2.331733,\n\t\t          -0.079825,-0.330294,2.327070,-0.081305,-0.330054,2.439927,-0.196218,-0.292327,2.446514,-0.083859,0.177889,2.740148,\n\t\t          -0.128065,0.172449,2.751910,-0.082870,0.175242,2.807198,-0.040813,0.180960,2.730354,-0.083542,0.170855,2.674813,\n\t\t          -0.125350,0.166427,2.679930,-0.129942,0.176940,2.826929,-0.039649,0.175949,2.793436,-0.042241,0.171920,2.671962,\n\t\t          -0.259896,0.129963,2.759907,-0.253266,0.122167,2.688107,-0.283524,0.100979,2.747409,-0.264880,0.137288,2.844671,\n\t\t          -0.223970,0.154083,2.771787,-0.211840,0.148272,2.686554,-0.277079,0.086041,2.679945,-0.287763,0.107336,2.830338,\n\t\t          -0.222304,0.164700,2.842587,-0.322810,-0.016872,2.686261,-0.318192,-0.022060,2.635609,-0.330126,-0.060994,2.673807,\n\t\t          -0.346995,-0.016619,2.761324,-0.310871,0.028034,2.707422,-0.311223,0.016046,2.646120,-0.317213,-0.066674,2.619722,\n\t\t          -0.343878,-0.065723,2.741625,-0.334395,0.029907,2.793694,-0.305033,-0.197804,2.628742,-0.287322,-0.183322,2.585803,\n\t\t          -0.276134,-0.242478,2.622215,-0.300641,-0.195039,2.688558,-0.323361,-0.152167,2.640324,-0.301527,-0.145693,2.593793,\n\t\t          -0.268250,-0.227034,2.579665,-0.271225,-0.241587,2.679664,-0.324189,-0.154886,2.698871,-0.135158,-0.333285,2.628833,\n\t\t          -0.142342,-0.315408,2.570612,-0.077993,-0.339443,2.641564,-0.135938,-0.332582,2.694253,-0.198421,-0.311135,2.628214,\n\t\t          -0.194690,-0.295697,2.569018,-0.062838,-0.331924,2.566039,-0.072612,-0.351075,2.706098,-0.191482,-0.310113,2.684324,\n\t\t          -0.173823,-0.371334,2.822994,-0.158177,-0.386904,2.848635,-0.205438,-0.362800,2.827076,-0.156026,-0.357999,2.793430,\n\t\t          -0.114768,-0.374604,2.817593,-0.204052,-0.380494,2.868437,-0.195582,-0.335464,2.783656,-0.282507,-0.265412,2.816082,\n\t\t          -0.267990,-0.301848,2.824756,-0.297116,-0.259305,2.835005,-0.282596,-0.235250,2.784756,-0.258972,-0.272127,2.780230,\n\t\t          -0.276444,-0.311298,2.854340,-0.306119,-0.206695,2.803668,-0.084544,-0.370070,2.940602,-0.104232,-0.383283,2.913108,\n\t\t          -0.037321,-0.363792,2.938755,-0.101899,-0.360991,2.969200,-0.149370,-0.378131,2.939913,-0.053324,-0.379797,2.892752,\n\t\t          -0.050326,-0.338822,2.993969,-0.336232,-0.195626,2.898501,-0.334626,-0.214260,2.923770,-0.352951,-0.154098,2.890736,\n\t\t          -0.321608,-0.218111,2.878299,-0.308057,-0.266355,2.912352,-0.362596,-0.155525,2.925216,-0.341868,-0.164210,2.846661,\n\t\t          -0.378439,-0.022250,2.863791,-0.376494,-0.054197,2.871435,-0.378680,-0.010402,2.906614,-0.380081,-0.017048,2.850026,\n\t\t          -0.376247,-0.060476,2.838640,-0.393433,-0.051383,2.922077,-0.372887,0.023805,2.866276,-0.339582,-0.247373,3.020042,\n\t\t          -0.335651,-0.246242,2.988306,-0.320533,-0.277783,3.023476,-0.357744,-0.226722,3.037153,-0.367398,-0.193880,3.004152,\n\t\t          -0.308030,-0.296585,2.986439,-0.340309,-0.254017,3.060957,-0.263265,-0.287496,3.086673,-0.278742,-0.299310,3.063310,\n\t\t          -0.245710,-0.296725,3.079549,-0.265953,-0.264217,3.116838,-0.304532,-0.269899,3.095284,-0.260641,-0.323760,3.032797,\n\t\t          -0.238687,-0.259417,3.128379,-0.390800,-0.181397,3.075255,-0.386720,-0.191249,3.099342,-0.404713,-0.166638,3.063228,\n\t\t          -0.378972,-0.189402,3.051124,-0.367515,-0.204597,3.093079,-0.407031,-0.177052,3.098368,-0.394207,-0.162140,3.019665,\n\t\t          -0.400902,0.072950,2.979506,-0.407363,0.068862,2.985821,-0.394960,0.099936,2.997683,-0.399106,0.046876,2.959336,\n\t\t          -0.405985,0.016836,2.962561,-0.402649,0.115365,3.010430,-0.382466,0.076652,2.953598,-0.154662,-0.306907,3.070113,\n\t\t          -0.184701,-0.307222,3.070276,-0.144004,-0.325468,3.042487,-0.135518,-0.284603,3.098782,-0.172997,-0.270184,3.118303,\n\t\t          -0.190932,-0.339260,3.020747,-0.100747,-0.297415,3.076047,-0.438058,-0.135499,3.233038,-0.455366,-0.138282,3.216385,\n\t\t          -0.421087,-0.143897,3.227540,-0.437315,-0.123024,3.253721,-0.465930,-0.119758,3.239286,-0.437716,-0.152708,3.196113,\n\t\t          -0.408903,-0.128859,3.257844,-0.294396,-0.188099,3.210675,-0.288274,-0.172286,3.231898,-0.313664,-0.185667,3.210716,\n\t\t          -0.282083,-0.206202,3.188191,-0.261297,-0.192764,3.207860,-0.318011,-0.159364,3.244836,-0.307215,-0.211246,3.174450,\n\t\t          -0.372637,-0.181788,3.187086,-0.384192,-0.169993,3.201043,-0.375838,-0.191517,3.162371,-0.358208,-0.182897,3.197064,\n\t\t          -0.367757,-0.160300,3.228040,-0.396233,-0.178724,3.168422,-0.355232,-0.202333,3.161681,-0.430302,-0.059801,3.298928,\n\t\t          -0.444883,-0.047626,3.295037,-0.433201,-0.080154,3.290958,-0.412235,-0.051072,3.308306,-0.423506,-0.023804,3.306237,\n\t\t          -0.460386,-0.073013,3.280183,-0.404663,-0.080380,3.300431,-0.495028,-0.001147,3.260200,-0.513514,-0.008933,3.246113,\n\t\t          -0.481747,-0.014034,3.273436,-0.488202,0.019282,3.259235,-0.513036,0.018825,3.236469,-0.502962,-0.035877,3.257099,\n\t\t          -0.462606,0.012639,3.279774,-0.457904,0.079113,3.214057,-0.466606,0.064154,3.232671,-0.435650,0.083106,3.216758,\n\t\t          -0.475531,0.091780,3.188257,-0.491081,0.070649,3.207859,-0.437982,0.062845,3.250237,-0.441671,0.101651,3.178075,\n\t\t          -0.299078,0.156912,3.045861,-0.284247,0.169134,2.967554,-0.347632,0.147541,3.030676,-0.320393,0.158399,3.104693,\n\t\t          -0.265522,0.174968,3.063306,-0.250249,0.189076,2.987690,-0.321071,0.136961,2.956591,-0.348728,0.146862,3.076509,\n\t\t          -0.296586,0.165471,3.133395,-0.355983,0.113485,3.216723,-0.346484,0.108525,3.239600,-0.344019,0.127983,3.190926,\n\t\t          -0.378078,0.103168,3.218432,-0.376151,0.086175,3.254666,-0.319727,0.130781,3.214068,-0.374597,0.120383,3.176586,\n\t\t          -0.320803,0.077578,3.310231,-0.327625,0.088303,3.292223,-0.334129,0.056420,3.325703,-0.300408,0.086723,3.310432,\n\t\t          -0.297838,0.110892,3.278135,-0.353994,0.061894,3.308947,-0.309584,0.054801,3.334266,-0.356318,-0.020359,3.339742,\n\t\t          -0.370820,-0.028085,3.331985,-0.343846,-0.034635,3.340817,-0.353878,0.001104,3.343251,-0.376352,0.002325,3.331068,\n\t\t          -0.358829,-0.056818,3.326578,-0.332137,-0.008743,3.348886,-0.284039,-0.098087,3.303614,-0.283391,-0.121746,3.284179,\n\t\t          -0.265797,-0.094181,3.304836,-0.303052,-0.078787,3.319335,-0.313676,-0.104522,3.300547,-0.252405,-0.133797,3.269999,\n\t\t          -0.286461,-0.057746,3.330371,-0.218321,-0.086638,3.327111,-0.190466,-0.140308,3.294337,-0.214974,-0.087857,3.328608,\n\t\t          -0.240136,-0.032028,3.349719,-0.223562,-0.086394,3.323065,-0.198584,-0.140589,3.283101,-0.187036,-0.142590,3.296275,\n\t\t          -0.235508,-0.031468,3.353100,-0.247257,-0.033987,3.345706,-0.237912,0.128028,3.320573,-0.248573,0.072839,3.345898,\n\t\t          -0.234641,0.131007,3.328040,-0.228187,0.169972,3.277252,-0.252888,0.111273,3.311527,-0.263658,0.065279,3.340511,\n\t\t          -0.241103,0.076010,3.354384,-0.221709,0.179124,3.282324,-0.243333,0.148836,3.269374,-0.188359,0.238371,3.104396,\n\t\t          -0.202371,0.229213,3.166631,-0.177546,0.254462,3.115587,-0.172294,0.234900,3.035323,-0.210121,0.212379,3.085384,\n\t\t          -0.224742,0.194237,3.156076,-0.197689,0.237032,3.170161,-0.161097,0.248556,3.041725,-0.190707,0.218201,3.024364,\n\t\t          -0.071897,0.204163,2.907644,-0.111692,0.214104,2.935753,-0.066903,0.210727,2.912466,-0.031026,0.195083,2.890610,\n\t\t          -0.071968,0.191097,2.896471,-0.116771,0.203005,2.926762,-0.102599,0.223662,2.941025,-0.026861,0.203782,2.899168,\n\t\t          -0.030679,0.184750,2.878822,-0.114631,-0.237197,3.191944,-0.106565,-0.246466,3.173385,-0.100803,-0.241967,3.185882,\n\t\t          -0.136836,-0.219164,3.217115,-0.140295,-0.223918,3.203524,-0.080472,-0.255602,3.154533,-0.128571,-0.219980,3.221126,\n\t\t          -0.180300,-0.098128,3.342292,-0.162374,-0.146151,3.299834,-0.159038,-0.096179,3.340225,-0.196972,-0.045840,3.377956,\n\t\t          -0.200322,-0.094785,3.336616,-0.177480,-0.147105,3.298485,-0.139537,-0.139306,3.295995,-0.173584,-0.049529,3.377730,\n\t\t          -0.212001,-0.040344,3.372719,-0.062668,0.195506,3.298009,-0.064170,0.213163,3.267452,-0.068054,0.184368,3.317924,\n\t\t          -0.060920,0.193979,3.298821,-0.054583,0.213638,3.265646,-0.109080,0.213597,3.280184,-0.067146,0.170618,3.334074,\n\t\t          -0.071746,0.254577,3.117950,-0.058259,0.243616,3.192662,-0.034233,0.261461,3.119765,-0.085865,0.276703,3.035071,\n\t\t          -0.141580,0.261652,3.104289,-0.131203,0.241186,3.175081,-0.047213,0.245317,3.193011,-0.033202,0.265164,3.047059,\n\t\t          -0.108116,0.277350,3.041690,-0.088005,-0.232329,3.194541,-0.085470,-0.240197,3.187468,-0.072274,-0.237192,3.176321,\n\t\t          -0.107017,-0.216243,3.220548,-0.114678,-0.221082,3.222638,-0.056486,-0.249456,3.156245,-0.092579,-0.211532,3.209495,\n\t\t          -0.021070,0.248960,2.939440,-0.031769,0.273553,2.972925,-0.004611,0.242564,2.928703,-0.036981,0.232930,2.924484,\n\t\t          -0.054848,0.267455,2.967467,-0.013218,0.267418,2.965976,-0.009964,0.230379,2.917112,-0.170193,0.110287,3.390369,\n\t\t          -0.139205,0.147226,3.368785,-0.198945,0.127101,3.368241,-0.194464,0.064248,3.402463,-0.131057,0.084706,3.405108,\n\t\t          -0.092988,0.114057,3.386417,-0.172719,0.171196,3.337719,-0.209396,0.072571,3.391287,-0.159446,0.045131,3.411329,\n\t\t          -0.537771,0.104969,3.097723,-0.497873,0.117588,3.081579,-0.568654,0.095764,3.063987,-0.565876,0.078629,3.119771,\n\t\t          -0.504714,0.122619,3.133997,-0.491447,0.128305,3.117012,-0.538883,0.098535,3.041684,-0.594398,0.071906,3.085978,\n\t\t          -0.535833,0.083933,3.151987,-0.596171,-0.028521,3.163092,-0.594441,0.007300,3.153613,-0.626566,-0.033203,3.126484,\n\t\t          -0.589782,-0.063641,3.167484,-0.566251,-0.023881,3.194994,-0.565730,0.011404,3.184250,-0.624093,0.001810,3.118382,\n\t\t          -0.627844,-0.070295,3.134618,-0.557425,-0.059598,3.202286,-0.530416,-0.137393,3.133592,-0.555870,-0.118272,3.151160,\n\t\t          -0.562755,-0.134388,3.097748,-0.493300,-0.158523,3.116995,-0.500882,-0.148132,3.165857,-0.516992,-0.127967,3.185736,\n\t\t          -0.587523,-0.118044,3.114075,-0.538160,-0.146737,3.078698,-0.488059,-0.159508,3.138433,-0.450067,0.039965,2.990764,\n\t\t          -0.446169,-0.013423,2.973141,-0.468411,0.024724,2.979145,-0.459276,0.087859,3.012878,-0.443906,0.049953,2.995525,\n\t\t          -0.431947,-0.010464,2.973175,-0.462298,-0.019410,2.967316,-0.483753,0.060779,2.998611,-0.449363,0.101317,3.023159,\n\t\t          -0.457075,-0.136250,3.025823,-0.470097,-0.158537,3.058076,-0.473213,-0.129096,3.013515,-0.444917,-0.106569,2.986882,\n\t\t          -0.441968,-0.142149,3.035111,-0.457013,-0.164702,3.074280,-0.487511,-0.151717,3.036681,-0.461184,-0.100050,2.983076,\n\t\t          -0.428168,-0.120207,2.994387,-0.671886,-0.162128,2.975679,-0.632037,-0.141791,3.016889,-0.699859,-0.143423,2.991361,\n\t\t          -0.703267,-0.154134,2.928570,-0.641802,-0.168287,2.955623,-0.604461,-0.151477,2.999654,-0.668603,-0.139719,3.040941,\n\t\t          -0.728516,-0.146642,2.943104,-0.678524,-0.155631,2.912499,-0.722968,-0.049075,2.990795,-0.687173,-0.043754,3.036612,\n\t\t          -0.720094,-0.017325,2.984471,-0.752461,-0.055608,2.942811,-0.720086,-0.081410,2.993592,-0.685271,-0.075321,3.039872,\n\t\t          -0.683665,-0.012290,3.030067,-0.749583,-0.025660,2.935951,-0.750609,-0.087294,2.946842,-0.664916,0.060721,2.935127,\n\t\t          -0.630478,0.072661,2.981737,-0.639444,0.066263,2.915544,-0.706910,0.063878,2.892417,-0.690560,0.042690,2.955746,\n\t\t          -0.654577,0.049842,3.001901,-0.603263,0.085611,2.959280,-0.678045,0.070725,2.869120,-0.732078,0.043162,2.914164,\n\t\t          -0.577408,0.008680,2.877964,-0.528760,0.018607,2.909524,-0.566877,-0.027617,2.875912,-0.618952,0.006866,2.834385,\n\t\t          -0.593912,0.038379,2.885697,-0.548243,0.051524,2.921390,-0.520061,-0.022367,2.908941,-0.609493,-0.026781,2.833543,\n\t\t          -0.633347,0.037102,2.839974,-0.575246,-0.129273,2.900115,-0.538084,-0.128054,2.944767,-0.591629,-0.149370,2.916213,\n\t\t          -0.617919,-0.120605,2.859132,-0.565543,-0.100670,2.887450,-0.527366,-0.099695,2.930006,-0.555972,-0.145761,2.962713,\n\t\t          -0.633348,-0.138949,2.875428,-0.608742,-0.094085,2.846319,-0.805999,0.051880,2.780279,-0.780797,0.065716,2.756923,\n\t\t          -0.833793,0.039854,2.757858,-0.827351,0.025772,2.803802,-0.774381,0.051569,2.810483,-0.749341,0.063475,2.788239,\n\t\t          -0.809323,0.054155,2.734054,-0.854476,0.015546,2.781447,-0.795905,0.027310,2.832568,-0.841190,-0.071627,2.844703,\n\t\t          -0.845275,-0.039593,2.837022,-0.866348,-0.079563,2.826264,-0.832332,-0.101972,2.849061,-0.814337,-0.065796,2.870008,\n\t\t          -0.816347,-0.034675,2.863295,-0.871468,-0.047223,2.816863,-0.855787,-0.110940,2.832206,-0.806982,-0.096078,2.872745,\n\t\t          -0.774224,-0.163955,2.829702,-0.796664,-0.149786,2.840437,-0.790796,-0.177822,2.814866,-0.750507,-0.169393,2.814888,\n\t\t          -0.756039,-0.160867,2.855893,-0.776897,-0.146614,2.865836,-0.817190,-0.164168,2.827824,-0.763292,-0.183968,2.797045,\n\t\t          -0.733420,-0.162182,2.841185,-0.698433,-0.123154,2.755728,-0.710609,-0.148894,2.776348,-0.710995,-0.130046,2.729758,\n\t\t          -0.693095,-0.090568,2.738146,-0.683540,-0.114038,2.787619,-0.695544,-0.136869,2.805379,-0.720357,-0.160821,2.751897,\n\t\t          -0.709357,-0.094422,2.711856,-0.676263,-0.085876,2.771756,-0.712596,0.023077,2.714652,-0.700887,-0.013471,2.716653,\n\t\t          -0.738974,0.016624,2.690785,-0.731353,0.050516,2.721841,-0.686177,0.018009,2.748909,-0.676988,-0.016685,2.750810,\n\t\t          -0.723665,-0.018160,2.691216,-0.759629,0.042312,2.698442,-0.702561,0.045426,2.755331,-0.898274,-0.010988,2.706636,\n\t\t          -0.876139,-0.003105,2.685817,-0.923112,-0.028119,2.686250,-0.916058,-0.026346,2.728577,-0.877867,0.005497,2.723789,\n\t\t          -0.855290,0.016258,2.701734,-0.900872,-0.022328,2.665412,-0.939785,-0.042370,2.709112,-0.896666,-0.012213,2.745958,\n\t\t          -0.915261,-0.103082,2.774348,-0.924976,-0.074736,2.764015,-0.932425,-0.117367,2.756381,-0.898820,-0.129373,2.778782,\n\t\t          -0.902080,-0.094451,2.792815,-0.909766,-0.064379,2.782063,-0.943745,-0.089489,2.745359,-0.916135,-0.143511,2.762707,\n\t\t          -0.886644,-0.122702,2.797314,-0.828413,-0.192521,2.768258,-0.853728,-0.174416,2.775206,-0.842281,-0.203289,2.751244,\n\t\t          -0.803335,-0.199068,2.753945,-0.816542,-0.193227,2.786873,-0.843560,-0.173884,2.795487,-0.868167,-0.188204,2.759391,\n\t\t          -0.817356,-0.209440,2.737272,-0.789095,-0.199159,2.769876,-0.767449,-0.137258,2.684828,-0.772664,-0.165434,2.708964,\n\t\t          -0.785755,-0.151018,2.668279,-0.767608,-0.109887,2.664767,-0.748894,-0.131096,2.698679,-0.755246,-0.160878,2.722161,\n\t\t          -0.787693,-0.180752,2.692976,-0.787816,-0.124531,2.648330,-0.747364,-0.101690,2.678294,-0.806499,-0.033613,2.648267,\n\t\t          -0.787705,-0.057042,2.646192,-0.827802,-0.056061,2.631388,-0.828389,-0.015066,2.655599,-0.785772,-0.013914,2.661182,\n\t\t          -0.766667,-0.040978,2.658985,-0.808971,-0.076995,2.629923,-0.850787,-0.037756,2.637361,-0.807613,0.006483,2.669042,\n\t\t          -0.995908,-0.135319,2.604935,-0.976407,-0.132699,2.587637,-1.024337,-0.171399,2.574033,-1.010514,-0.145005,2.624797,\n\t\t          -0.969126,-0.096376,2.637391,-0.948069,-0.093717,2.618816,-1.003813,-0.167563,2.555501,-1.042669,-0.180110,2.594398,\n\t\t          -0.985835,-0.105431,2.657753,-1.008977,-0.209978,2.679512,-1.018438,-0.183418,2.663671,-1.023971,-0.242710,2.637412,\n\t\t          -0.989859,-0.234688,2.686309,-0.973413,-0.170411,2.701308,-0.987354,-0.144910,2.691388,-1.045031,-0.217961,2.630320,\n\t\t          -1.006172,-0.265624,2.643875,-0.960175,-0.197627,2.714146,-0.917892,-0.271631,2.664592,-0.940611,-0.264446,2.674406,\n\t\t          -0.945667,-0.303604,2.634284,-0.896909,-0.273558,2.651566,-0.888435,-0.248356,2.702340,-0.914975,-0.240557,2.715931,\n\t\t          -0.966766,-0.297458,2.643338,-0.925800,-0.303723,2.620351,-0.861576,-0.254779,2.687454,-0.862855,-0.234657,2.590129,\n\t\t          -0.867798,-0.254301,2.612481,-0.892859,-0.266400,2.560458,-0.866664,-0.212337,2.572298,-0.819164,-0.209843,2.613221,\n\t\t          -0.823690,-0.236528,2.641041,-0.897919,-0.284582,2.581710,-0.894624,-0.244534,2.540766,-0.825410,-0.181532,2.592628,\n\t\t          -0.911661,-0.157796,2.559561,-0.892850,-0.172778,2.557587,-0.936855,-0.187828,2.519792,-0.932970,-0.144901,2.564892,\n\t\t          -0.879276,-0.119357,2.584290,-0.857621,-0.136225,2.580040,-0.916745,-0.203828,2.517976,-0.959849,-0.175352,2.527531,\n\t\t          -0.903014,-0.105277,2.592149,-1.056801,-0.246961,2.528224,-1.042271,-0.242273,2.512943,-1.059425,-0.255647,2.522358,\n\t\t          -1.065411,-0.254387,2.542947,-1.049952,-0.231385,2.536980,-1.034871,-0.226090,2.520833,-1.045569,-0.251872,2.508083,\n\t\t          -1.067705,-0.262140,2.536255,-1.059489,-0.240066,2.552422,-1.058858,-0.299838,2.579490,-1.066307,-0.280724,2.569423,\n\t\t          -1.062082,-0.307383,2.570494,-1.045775,-0.322375,2.585750,-1.051643,-0.289460,2.591206,-1.060246,-0.269216,2.580206,\n\t\t          -1.069189,-0.288413,2.561043,-1.048542,-0.327724,2.576751,-1.038099,-0.312490,2.598749,-0.990503,-0.352688,2.571306,\n\t\t          -1.009228,-0.351472,2.581607,-0.995235,-0.354013,2.564676,-0.974964,-0.347751,2.557588,-0.982651,-0.344871,2.586462,\n\t\t          -1.001764,-0.342409,2.596570,-1.012822,-0.353102,2.573897,-0.979945,-0.348992,2.552165,-0.965955,-0.341261,2.572127,\n\t\t          -0.957740,-0.312244,2.512432,-0.958432,-0.325907,2.526692,-0.962876,-0.314020,2.510706,-0.960519,-0.298855,2.500119,\n\t\t          -0.942792,-0.305139,2.521009,-0.945594,-0.320292,2.538029,-0.963423,-0.327320,2.523702,-0.965797,-0.301345,2.499852,\n\t\t          -0.943502,-0.288585,2.504259,-0.990643,-0.259541,2.484583,-0.976874,-0.272240,2.484732,-0.996287,-0.266635,2.484603,\n\t\t          -1.007171,-0.248651,2.489924,-0.976476,-0.242688,2.485116,-0.959802,-0.256522,2.483613,-0.982688,-0.277443,2.485838,\n\t\t          -1.012067,-0.257542,2.488029,-0.996555,-0.231639,2.493988,-1.098379,-0.302071,2.475735,-1.085659,-0.298097,2.462196,\n\t\t          -1.115176,-0.322341,2.456375,-1.106632,-0.309911,2.490601,-1.080125,-0.281393,2.496189,-1.067086,-0.277932,2.482741,\n\t\t          -1.102736,-0.318254,2.442627,-1.123060,-0.330369,2.471766,-1.088547,-0.288383,2.510360,-1.094505,-0.354058,2.528831,\n\t\t          -1.104498,-0.337207,2.518375,-1.108675,-0.373715,2.512034,-1.080523,-0.370166,2.536181,-1.079691,-0.334020,2.546124,\n\t\t          -1.088457,-0.316029,2.536284,-1.119464,-0.357346,2.500932,-1.094411,-0.389500,2.519906,-1.065486,-0.350726,2.553265,\n\t\t          -1.031793,-0.396447,2.531951,-1.047715,-0.392493,2.537994,-1.046034,-0.416049,2.517365,-1.017691,-0.395401,2.522078,\n\t\t          -1.015476,-0.375252,2.547300,-1.031662,-0.372440,2.554177,-1.061728,-0.411792,2.522845,-1.032359,-0.415412,2.507868,\n\t\t          -1.000662,-0.372784,2.536716,-0.998159,-0.364543,2.478663,-1.000261,-0.378477,2.494071,-1.013470,-0.385232,2.463601,\n\t\t          -1.000493,-0.349212,2.464425,-0.980944,-0.340306,2.494857,-0.982716,-0.354127,2.509043,-1.015513,-0.399075,2.479665,\n\t\t          -1.015955,-0.369833,2.448440,-0.983323,-0.325758,2.482271,-1.035379,-0.309953,2.443133,-1.019827,-0.320705,2.445736,\n\t\t          -1.051846,-0.330142,2.424603,-1.052594,-0.302244,2.445049,-1.017444,-0.289463,2.463312,-1.002259,-0.299391,2.465715,\n\t\t          -1.035889,-0.341027,2.427913,-1.069466,-0.322368,2.425945,-1.034174,-0.282179,2.465317,-1.137665,-0.359141,2.426445,\n\t\t          -1.126753,-0.355436,2.413375,-1.133956,-0.363859,2.426788,-1.143963,-0.366361,2.441348,-1.135223,-0.351179,2.431315,\n\t\t          -1.123618,-0.347318,2.417706,-1.124432,-0.360660,2.415121,-1.139355,-0.370098,2.440229,-1.142126,-0.358766,2.446775,\n\t\t          -1.127315,-0.405095,2.481411,-1.138305,-0.390446,2.470109,-1.123505,-0.404566,2.477278,-1.113339,-0.419191,2.489768,\n\t\t          -1.125647,-0.399770,2.488174,-1.136884,-0.384275,2.476543,-1.133780,-0.391323,2.466581,-1.110507,-0.417367,2.485319,\n\t\t          -1.111190,-0.414682,2.496717,-1.069328,-0.442581,2.490390,-1.083118,-0.438935,2.494571,-1.071087,-0.438227,2.487063,\n\t\t          -1.057572,-0.441808,2.482285,-1.064612,-0.439639,2.496625,-1.079378,-0.435684,2.501292,-1.083149,-0.435052,2.490427,\n\t\t          -1.060897,-0.437539,2.480180,-1.051939,-0.438893,2.487823,-1.041939,-0.414756,2.441283,-1.043438,-0.427044,2.456611,\n\t\t          -1.047292,-0.413146,2.442896,-1.044538,-0.401164,2.426387,-1.035084,-0.410218,2.444597,-1.036705,-0.423252,2.460580,\n\t\t          -1.048522,-0.424326,2.457140,-1.049846,-0.400793,2.428959,-1.037795,-0.395799,2.429195,-1.078994,-0.366218,2.399603,\n\t\t          -1.063732,-0.375863,2.404475,-1.081784,-0.369764,2.403616,-1.095765,-0.359226,2.399233,-1.073772,-0.358687,2.402400,\n\t\t          -1.057858,-0.368905,2.406994,-1.067740,-0.378200,2.408372,-1.097018,-0.363764,2.402955,-1.091240,-0.351316,2.402487,\n\t\t          -0.077659,0.163086,2.302102,-0.117654,0.157497,2.300212,-0.077527,0.146972,2.337427,-0.038172,0.166258,2.303706,\n\t\t          -0.080818,0.165152,2.292071,-0.119318,0.160122,2.289062,-0.116769,0.141425,2.333152,-0.038752,0.149640,2.340296,\n\t\t          -0.039332,0.169089,2.291921,-0.248289,0.115741,2.294661,-0.245954,0.120882,2.272381,-0.289065,0.088553,2.286708,\n\t\t          -0.243526,0.106852,2.314361,-0.203971,0.133707,2.298026,-0.203219,0.139266,2.277418,-0.290045,0.093384,2.262034,\n\t\t          -0.283122,0.082344,2.309379,-0.201175,0.123019,2.319859,-0.366548,-0.030458,2.264507,-0.369788,-0.030906,2.244626,\n\t\t          -0.375040,-0.076052,2.256442,-0.359476,-0.030511,2.293698,-0.347929,0.013916,2.274566,-0.350403,0.016371,2.251252,\n\t\t          -0.378156,-0.077014,2.240752,-0.367961,-0.074806,2.286247,-0.342031,0.012621,2.299157,-0.347897,-0.205109,2.236376,\n\t\t          -0.346605,-0.205738,2.215532,-0.318270,-0.240745,2.234137,-0.349227,-0.207103,2.265365,-0.367371,-0.164386,2.241177,\n\t\t          -0.368496,-0.166481,2.225096,-0.320383,-0.237472,2.209840,-0.314620,-0.242001,2.255599,-0.368110,-0.165449,2.272940,\n\t\t          -0.155787,-0.319168,2.225403,-0.157209,-0.322178,2.195866,-0.077734,-0.343747,2.214164,-0.155754,-0.318862,2.245008,\n\t\t          -0.222420,-0.298799,2.223390,-0.238375,-0.299370,2.188407,-0.086838,-0.345044,2.198472,-0.084345,-0.338439,2.244885,\n\t\t          -0.218675,-0.297811,2.245780,-0.324209,-0.163893,0.150957,-0.343326,-0.203601,0.157534,-0.327217,-0.162421,0.151756,\n\t\t          -0.310125,-0.121766,0.145155,-0.315970,-0.167916,0.162259,-0.336149,-0.208685,0.168264,-0.345771,-0.201662,0.157940,\n\t\t          -0.313755,-0.120788,0.145692,-0.301780,-0.124655,0.157894,-0.309362,-0.018830,0.139446,-0.302735,-0.047506,0.139343,\n\t\t          -0.311488,-0.019725,0.140253,-0.320892,0.005351,0.140547,-0.307678,-0.018314,0.154610,-0.298873,-0.048533,0.154218,\n\t\t          -0.305744,-0.047697,0.139687,-0.322909,0.003664,0.141953,-0.317513,0.009117,0.156049,-0.522374,-0.200271,0.150967,\n\t\t          -0.536759,-0.165962,0.143172,-0.520524,-0.198963,0.151309,-0.502590,-0.229945,0.159158,-0.526882,-0.201130,0.168403,\n\t\t          -0.539535,-0.165510,0.161430,-0.535262,-0.165391,0.142789,-0.501102,-0.228399,0.159140,-0.506815,-0.232089,0.175637,\n\t\t          -0.422838,-0.265019,0.170871,-0.451524,-0.263713,0.170017,-0.423161,-0.262721,0.170951,-0.393950,-0.256111,0.168492,\n\t\t          -0.421999,-0.269102,0.184656,-0.452657,-0.267350,0.184769,-0.451259,-0.261742,0.169713,-0.395025,-0.253711,0.168492,\n\t\t          -0.390797,-0.261096,0.180813,-0.497429,0.039816,0.142848,-0.477614,0.053790,0.143459,-0.494794,0.035383,0.143278,\n\t\t          -0.513037,0.020293,0.142239,-0.501030,0.048059,0.158875,-0.480067,0.063321,0.159195,-0.475808,0.048780,0.143968,\n\t\t          -0.509983,0.016655,0.142584,-0.516960,0.026821,0.158554,-0.392478,0.054322,0.144060,-0.363207,0.042168,0.143262,\n\t\t          -0.394060,0.049645,0.145401,-0.423619,0.061020,0.144224,-0.388316,0.065157,0.159763,-0.357438,0.051785,0.159054,\n\t\t          -0.365284,0.038455,0.144971,-0.424160,0.055830,0.145190,-0.421801,0.072006,0.159806,-0.541561,-0.062269,0.138423,\n\t\t          -0.534729,-0.031569,0.139996,-0.538996,-0.063477,0.138362,-0.545681,-0.095235,0.136969,-0.543194,-0.060091,0.155679,\n\t\t          -0.537412,-0.028350,0.156834,-0.531722,-0.033479,0.140201,-0.543915,-0.095986,0.136219,-0.546466,-0.093427,0.155011,\n\t\t          -0.316973,-0.169957,0.212105,-0.336131,-0.208739,0.216497,-0.327030,-0.162348,0.254114,-0.307898,-0.127704,0.210762,\n\t\t          -0.319214,-0.168386,0.182303,-0.338240,-0.207801,0.186987,-0.345020,-0.198545,0.258884,-0.315836,-0.123054,0.251495,\n\t\t          -0.308949,-0.125870,0.179446,-0.320529,-0.026581,0.213631,-0.311718,-0.054298,0.212101,-0.323309,-0.027968,0.252271,\n\t\t          -0.330509,-0.002279,0.215864,-0.317246,-0.023997,0.180067,-0.309543,-0.052011,0.178538,-0.315046,-0.054181,0.250955,\n\t\t          -0.333573,-0.005370,0.254178,-0.327390,0.000457,0.182581,-0.511209,-0.189612,0.223255,-0.521317,-0.158043,0.216427,\n\t\t          -0.505721,-0.185537,0.260582,-0.495597,-0.218831,0.230035,-0.515825,-0.193553,0.190704,-0.528301,-0.161270,0.182891,\n\t\t          -0.512573,-0.154437,0.253943,-0.492382,-0.214749,0.267629,-0.498395,-0.222975,0.197443,-0.421650,-0.253367,0.236974,\n\t\t          -0.449915,-0.251294,0.238110,-0.422997,-0.245954,0.275132,-0.391493,-0.250749,0.230924,-0.422011,-0.258030,0.205740,\n\t\t          -0.450573,-0.256117,0.205964,-0.449651,-0.245797,0.275890,-0.395332,-0.240869,0.270836,-0.392152,-0.253467,0.200432,\n\t\t          -0.494003,0.036842,0.212692,-0.477448,0.054040,0.212835,-0.488203,0.027990,0.250568,-0.504974,0.014554,0.212519,\n\t\t          -0.494619,0.037018,0.180814,-0.477105,0.052949,0.181132,-0.472916,0.043476,0.250880,-0.498590,0.007670,0.250232,\n\t\t          -0.507206,0.015894,0.180473,-0.394407,0.053451,0.216122,-0.366915,0.038375,0.217357,-0.396393,0.044250,0.254244,\n\t\t          -0.425382,0.062563,0.214611,-0.393988,0.053129,0.184155,-0.365712,0.039534,0.184979,-0.370124,0.031219,0.255396,\n\t\t          -0.425161,0.051774,0.252787,-0.424899,0.061111,0.182903,-0.523578,-0.066538,0.209886,-0.518809,-0.038200,0.210931,\n\t\t          -0.516134,-0.068100,0.247460,-0.526569,-0.095710,0.209553,-0.530021,-0.065290,0.177177,-0.524043,-0.036158,0.178623,\n\t\t          -0.512128,-0.041478,0.248466,-0.516954,-0.095142,0.247278,-0.534528,-0.096023,0.175833,0.238538,-0.290131,2.170654,\n\t\t          0.153637,-0.304586,2.170406,0.077355,-0.324703,2.155562,0.372777,-0.172263,2.204684,0.359714,-0.201396,2.197350,\n\t\t          0.322737,-0.240055,2.191806,0.356620,0.018984,2.232054,0.373161,-0.031660,2.224100,0.382967,-0.079476,2.217628,\n\t\t          0.202318,0.140108,2.265292,0.245931,0.117291,2.262339,0.283428,0.095359,2.253567,0.129311,0.160892,2.275517,\n\t\t          0.082536,0.169623,2.269296,0.062337,0.171758,2.258189,-0.003283,-0.324305,2.142828,0.000004,-0.321100,2.120669,\n\t\t          0.001679,-0.315047,2.098118,-0.000000,-0.211898,1.882231,-0.000253,-0.182374,1.859592,-0.001011,-0.147603,1.839811,\n\t\t          -0.003690,-0.009567,1.833202,-0.005491,0.043800,1.852757,-0.005112,0.088996,1.877270,-0.001242,0.182518,2.193694,\n\t\t          -0.000044,0.183694,2.172271,0.004400,0.185312,2.117009,0.385476,-0.181819,2.089888,0.364547,-0.218380,2.085422,\n\t\t          0.332410,-0.251035,2.079634,0.374519,0.004908,2.108311,0.388302,-0.042457,2.098693,0.397947,-0.090076,2.101966,\n\t\t          0.243247,0.160615,2.103432,0.284696,0.127357,2.097064,0.319995,0.089270,2.096386,0.058560,0.183963,2.211994,\n\t\t          0.074475,0.190088,2.196499,0.125121,0.191457,2.171213,0.184228,0.166404,2.226115,0.185711,0.171179,2.215139,\n\t\t          0.176560,0.179667,2.184842,0.351712,0.046096,2.144356,0.348805,0.050576,2.166114,0.335010,0.057967,2.190954,\n\t\t          0.400343,-0.117874,2.132282,0.403652,-0.100592,2.148027,0.390283,-0.112806,2.172850,0.279905,-0.289302,2.104959,\n\t\t          0.266372,-0.291160,2.119452,0.264425,-0.288846,2.130580,0.126110,0.199669,2.096384,0.079532,0.199160,2.082509,\n\t\t          0.041278,0.192855,2.076401,0.214523,-0.292653,2.073078,0.146075,-0.299099,2.073229,0.073900,-0.309098,2.081605,\n\t\t          0.230733,0.160598,2.157325,0.283343,0.126873,2.182469,0.299930,0.117184,2.190924,0.393649,-0.005998,1.913571,\n\t\t          0.409190,-0.051778,1.913428,0.415904,-0.097910,1.912346,0.189384,0.188491,2.057700,0.190946,0.183346,2.002939,\n\t\t          0.191873,0.176531,1.947520,-0.001925,0.154273,1.946226,0.000761,0.173368,1.989219,0.002853,0.184906,2.032641,\n\t\t          0.040606,0.134215,1.907386,0.087874,0.146662,1.906205,0.136443,0.158415,1.901248,0.159353,0.133597,1.847093,\n\t\t          0.133674,0.100676,1.819571,0.110374,0.073712,1.795178,0.032708,-0.031687,1.799257,0.058487,0.006034,1.788275,\n\t\t          0.079134,0.036355,1.781295,0.117701,-0.241229,1.900207,0.076662,-0.244092,1.907094,0.039250,-0.238272,1.910263,\n\t\t          0.039611,-0.145342,1.817057,0.071058,-0.192247,1.824510,0.116002,-0.234816,1.839331,0.235990,-0.291925,2.004844,\n\t\t          0.210404,-0.291113,1.968169,0.181096,-0.284764,1.926879,0.000121,-0.283577,2.022120,0.000032,-0.271563,1.982563,\n\t\t          -0.000000,-0.256054,1.944136,0.408943,-0.140625,1.960035,0.404480,-0.138293,2.005625,0.399481,-0.136757,2.048054,\n\t\t          0.352992,0.048215,2.057104,0.357383,0.047377,2.012630,0.363486,0.044966,1.964337,0.249090,0.147814,1.897089,\n\t\t          0.296332,0.116586,1.905066,0.344035,0.085598,1.909977,0.296418,-0.278971,2.024479,0.320413,-0.278852,1.983535,\n\t\t          0.326688,-0.283414,1.943177,0.202277,-0.278531,1.883784,0.241965,-0.281816,1.882708,0.286240,-0.291070,1.889805,\n\t\t          0.400923,-0.179741,1.906694,0.385993,-0.232835,1.906200,0.363902,-0.269857,1.903019,0.431284,-0.039220,1.645155,\n\t\t          0.435473,-0.078335,1.645063,0.437449,-0.118572,1.644392,0.230406,0.082320,1.626829,0.188359,0.068298,1.621717,\n\t\t          0.148988,0.046631,1.615855,0.312060,0.076469,1.635265,0.347678,0.053578,1.639121,0.376633,0.022961,1.642043,\n\t\t          0.237697,-0.299561,1.621218,0.265395,-0.320116,1.625295,0.302814,-0.316423,1.629368,0.415222,-0.196936,1.640340,\n\t\t          0.394961,-0.238739,1.638851,0.378491,-0.281188,1.636526,0.337301,-0.302290,1.715827,0.332593,-0.297969,1.785903,\n\t\t          0.329211,-0.291816,1.845484,0.412077,-0.148640,1.856227,0.419271,-0.151757,1.795643,0.428243,-0.155661,1.725456,\n\t\t          0.188996,-0.271829,1.696141,0.176031,-0.263420,1.763608,0.151696,-0.261668,1.822164,0.401131,0.005243,1.726116,\n\t\t          0.397147,0.020959,1.796391,0.389717,0.035748,1.857569,0.221673,0.144740,1.829225,0.242337,0.127447,1.772036,\n\t\t          0.258804,0.106824,1.707598,0.098535,0.047831,1.758510,0.104314,0.037761,1.725386,0.108909,0.027701,1.676527,\n\t\t          0.073356,-0.125669,1.666660,0.058762,-0.115272,1.724080,0.038293,-0.101644,1.772631,0.068323,-0.087781,1.593591,\n\t\t          0.063329,-0.045591,1.594611,0.081206,-0.010017,1.600710,0.154589,-0.246334,1.608796,0.122565,-0.229776,1.600813,\n\t\t          0.096570,-0.182639,1.597875,0.238204,-0.259059,1.324012,0.225141,-0.268664,1.420923,0.117797,-0.135595,1.409957,\n\t\t          0.132946,-0.134143,1.314670,0.125209,0.016478,1.419473,0.144078,0.007605,1.322656,0.365242,-0.285531,1.334427,\n\t\t          0.357807,-0.294160,1.432880,0.436551,-0.155412,1.443620,0.439483,-0.152750,1.345205,0.437264,-0.022243,1.348826,\n\t\t          0.429317,-0.020627,1.446470,0.295730,0.066737,1.436993,0.306792,0.066423,1.338922,0.465701,-0.034971,1.094548,\n\t\t          0.475010,-0.065129,1.092731,0.477131,-0.095979,1.091617,0.310972,0.077649,1.055754,0.267096,0.065024,1.058937,\n\t\t          0.246221,0.052178,1.053970,0.383581,0.073567,1.065490,0.408982,0.052323,1.080058,0.430908,0.024847,1.089812,\n\t\t          0.306752,-0.251619,1.071676,0.336019,-0.260361,1.073892,0.364128,-0.252457,1.077924,0.460098,-0.161058,1.088656,\n\t\t          0.442006,-0.192273,1.086642,0.417321,-0.214735,1.084889,0.168164,-0.076864,1.059184,0.170246,-0.042885,1.058015,\n\t\t          0.184638,-0.011842,1.056947,0.250182,-0.209436,1.067994,0.222996,-0.180972,1.065942,0.197296,-0.147796,1.063269,\n\t\t          0.270951,-0.238632,1.098506,0.263495,-0.243453,1.132258,0.256415,-0.247169,1.177483,0.156337,-0.128662,1.169466,\n\t\t          0.164509,-0.124745,1.124189,0.171314,-0.119550,1.089868,0.179294,-0.004287,1.174791,0.187874,0.000966,1.126894,\n\t\t          0.198102,0.007690,1.088786,0.383663,-0.241993,1.109914,0.378082,-0.250781,1.143183,0.375843,-0.264218,1.187752,\n\t\t          0.450624,-0.145313,1.196373,0.457546,-0.140283,1.150362,0.464786,-0.134346,1.117201,0.450794,-0.012416,1.113150,\n\t\t          0.446529,-0.020416,1.140265,0.443427,-0.023109,1.195087,0.319759,0.077826,1.187993,0.327865,0.074359,1.136968,\n\t\t          0.343902,0.075884,1.093451,0.505665,-0.005314,0.924202,0.517598,-0.033917,0.925521,0.519593,-0.063801,0.925542,\n\t\t          0.336196,0.083371,0.918080,0.302474,0.072017,0.916339,0.271582,0.057398,0.912757,0.405767,0.082574,0.918871,\n\t\t          0.437665,0.068507,0.919261,0.464480,0.047344,0.920527,0.337705,-0.199022,0.904106,0.372336,-0.216692,0.910036,\n\t\t          0.406988,-0.210176,0.910904,0.487864,-0.133306,0.914132,0.467418,-0.157215,0.904485,0.454533,-0.171933,0.902905,\n\t\t          0.210581,-0.036290,0.896839,0.208047,-0.005449,0.900267,0.221019,0.018968,0.904380,0.293228,-0.162945,0.903590,\n\t\t          0.265960,-0.126742,0.906418,0.254618,-0.103280,0.894319,0.298485,-0.193679,0.970793,0.292957,-0.199931,1.006323,\n\t\t          0.286643,-0.219813,1.036312,0.183750,-0.102295,1.031345,0.192109,-0.090713,0.997516,0.204522,-0.078788,0.955407,\n\t\t          0.222540,0.030080,1.022418,0.229199,0.041853,0.985036,0.231826,0.042740,0.964178,0.419882,-0.208444,0.973754,\n\t\t          0.408012,-0.216953,1.020772,0.398950,-0.225834,1.054252,0.479022,-0.119541,1.063522,0.487515,-0.111070,1.030604,\n\t\t          0.499140,-0.102700,0.985473,0.471533,0.014448,0.985331,0.458700,0.005301,1.031367,0.452518,-0.001506,1.067211,\n\t\t          0.351463,0.091177,1.036971,0.346683,0.094478,1.022618,0.354238,0.089097,0.984712,0.552073,-0.004900,0.532304,\n\t\t          0.564133,-0.032380,0.533093,0.562335,-0.062458,0.533038,0.390880,0.109299,0.518424,0.351647,0.079840,0.518954,\n\t\t          0.337422,0.060590,0.516963,0.458660,0.098281,0.524168,0.486745,0.075748,0.526834,0.511403,0.049634,0.529110,\n\t\t          0.384769,-0.216673,0.524283,0.416319,-0.227697,0.527311,0.447918,-0.218260,0.529430,0.521899,-0.133624,0.526740,\n\t\t          0.509663,-0.149449,0.528124,0.500433,-0.163607,0.528199,0.280810,-0.039878,0.509516,0.275706,-0.011377,0.509054,\n\t\t          0.282639,0.016162,0.509869,0.341515,-0.162474,0.516067,0.325280,-0.147378,0.511348,0.295611,-0.108641,0.512239,\n\t\t          0.345097,-0.176685,0.621267,0.337728,-0.173634,0.724663,0.250354,-0.070708,0.717860,0.274060,-0.071118,0.614595,\n\t\t          0.266635,0.045252,0.723155,0.291751,0.049063,0.616681,0.473297,-0.179837,0.633891,0.465009,-0.180781,0.735385,\n\t\t          0.534186,-0.088851,0.745034,0.545823,-0.095225,0.638586,0.523092,0.024948,0.637915,0.511667,0.026032,0.742950,\n\t\t          0.400007,0.099263,0.733286,0.414414,0.108480,0.627241,0.556667,-0.021361,0.189046,0.559675,-0.054262,0.191071,\n\t\t          0.558579,-0.088237,0.192687,0.418864,0.078642,0.194672,0.383811,0.072759,0.194177,0.353111,0.057362,0.193260,\n\t\t          0.485071,0.069309,0.191974,0.511499,0.055485,0.189466,0.532828,0.034927,0.187904,0.390813,-0.274366,0.220013,\n\t\t          0.426141,-0.288565,0.221312,0.456007,-0.280301,0.220765,0.540718,-0.158884,0.199952,0.524325,-0.194209,0.206030,\n\t\t          0.504573,-0.227913,0.212551,0.298751,-0.042010,0.197190,0.309165,-0.014923,0.205173,0.316216,0.005214,0.204717,\n\t\t          0.330888,-0.207231,0.210767,0.312551,-0.164848,0.204189,0.301270,-0.121106,0.198505,0.360289,-0.231481,0.270169,\n\t\t          0.357841,-0.202130,0.427974,0.288147,-0.073733,0.412237,0.294655,-0.078172,0.250468,0.330454,0.039805,0.414718,\n\t\t          0.332583,0.021189,0.259562,0.481797,-0.244422,0.273590,0.483248,-0.203070,0.433623,0.542132,-0.110940,0.426004,\n\t\t          0.553543,-0.116100,0.256541,0.545819,0.010654,0.251274,0.539285,0.017818,0.428383,0.435705,0.099304,0.421212,\n\t\t          0.449277,0.079561,0.253098,0.173291,-0.282041,2.512177,0.133853,-0.298699,2.516031,0.071420,-0.306976,2.502196,\n\t\t          0.320151,-0.164039,2.537185,0.302910,-0.203506,2.532619,0.286054,-0.226305,2.528600,0.297112,0.013221,2.552033,\n\t\t          0.316120,-0.039666,2.542701,0.322724,-0.073156,2.538157,0.191799,0.110453,2.602754,0.224963,0.091986,2.598115,\n\t\t          0.255609,0.068067,2.583508,0.117943,0.129930,2.605149,0.078885,0.132449,2.603967,0.039368,0.133579,2.602611,\n\t\t          0.161437,0.147165,2.319814,0.163689,0.152773,2.296336,0.166238,0.155706,2.282699,0.004591,0.152463,2.430374,\n\t\t          0.000176,0.168557,2.464272,-0.000130,0.147138,2.537354,0.312557,0.050899,2.390994,0.305997,0.049026,2.451962,\n\t\t          0.294386,0.038793,2.518002,0.359790,-0.120300,2.363952,0.351006,-0.124249,2.430123,0.326335,-0.116833,2.504690,\n\t\t          0.261257,-0.277369,2.348329,0.249695,-0.274757,2.381415,0.221262,-0.252333,2.458479,-0.024060,-0.324515,2.325908,\n\t\t          -0.023264,-0.318361,2.379792,-0.019135,-0.310736,2.439499,0.183172,-0.344327,2.741090,0.139747,-0.365068,2.752140,\n\t\t          0.080441,-0.362305,2.774532,0.307457,-0.181811,2.765651,0.293234,-0.228076,2.754088,0.270520,-0.272981,2.743490,\n\t\t          0.340297,0.018190,2.853852,0.343568,-0.020464,2.823344,0.338782,-0.065654,2.801517,0.215443,0.150810,2.932708,\n\t\t          0.253672,0.124989,2.915460,0.293267,0.099849,2.900320,0.116600,0.179828,2.901478,0.074359,0.183979,2.866737,\n\t\t          0.039753,0.178562,2.854223,0.166802,0.169246,2.848959,0.167869,0.162018,2.761538,0.166774,0.145575,2.684445,\n\t\t          -0.000809,0.170849,2.670336,0.001437,0.181553,2.725690,0.001088,0.177525,2.788830,0.297904,0.048772,2.644817,\n\t\t          0.314359,0.067948,2.731730,0.313995,0.064694,2.815523,0.332415,-0.122999,2.611808,0.331610,-0.114269,2.659998,\n\t\t          0.333487,-0.116787,2.709872,0.224742,-0.272111,2.560180,0.228358,-0.284471,2.637777,0.226240,-0.283028,2.660303,\n\t\t          -0.013685,-0.315254,2.571552,-0.013145,-0.333881,2.646923,-0.006560,-0.340492,2.715755,0.235311,-0.319803,2.780595,\n\t\t          0.239745,-0.343330,2.827506,0.242906,-0.353195,2.873885,0.072674,-0.379882,2.853386,0.132147,-0.387421,2.881223,\n\t\t          0.186211,-0.380213,2.907488,0.320673,-0.186555,2.817011,0.305723,-0.246762,2.855652,0.286169,-0.300800,2.890835,\n\t\t          0.182208,-0.359653,2.976010,0.126924,-0.344608,3.007128,0.067692,-0.313309,3.044440,-0.002548,-0.381082,2.882056,\n\t\t          -0.002492,-0.362491,2.937841,-0.002555,-0.334240,3.001692,0.344169,-0.105917,2.831642,0.369198,-0.100491,2.885685,\n\t\t          0.387104,-0.097602,2.931381,0.303379,-0.292522,2.948340,0.340042,-0.232721,2.960189,0.375900,-0.171305,2.968202,\n\t\t          0.354406,0.050316,2.912609,0.380877,0.020179,2.937728,0.398659,-0.024266,2.953038,0.340268,0.087043,2.952385,\n\t\t          0.364578,0.113373,3.018921,0.373841,0.119483,3.049988,0.381462,-0.165476,2.999475,0.367488,-0.201961,3.039828,\n\t\t          0.349882,-0.224551,3.075400,0.279199,-0.322765,2.998494,0.309618,-0.289431,3.038722,0.312984,-0.268106,3.069870,\n\t\t          0.358036,-0.213179,3.124948,0.382413,-0.201840,3.129572,0.407064,-0.191346,3.133140,0.418583,-0.131999,3.008178,\n\t\t          0.424681,-0.156812,3.044054,0.431386,-0.176802,3.087573,0.415502,0.000147,2.975759,0.415974,0.058043,2.996804,\n\t\t          0.411678,0.089842,3.040682,0.297625,-0.236415,3.136657,0.269841,-0.231922,3.155182,0.240196,-0.220342,3.175830,\n\t\t          0.066983,-0.267651,3.118837,0.106937,-0.259561,3.146505,0.143913,-0.238736,3.173857,0.205762,-0.258317,3.132964,\n\t\t          0.218259,-0.302072,3.073614,0.231339,-0.334604,3.015921,0.466748,-0.170726,3.166997,0.485365,-0.153240,3.192921,\n\t\t          0.500176,-0.126971,3.220242,0.531103,-0.052627,3.236263,0.540315,-0.017963,3.224694,0.538434,0.015654,3.211502,\n\t\t          0.453064,0.096942,3.137634,0.486337,0.083015,3.156874,0.516620,0.064349,3.178145,0.331340,-0.208025,3.165839,\n\t\t          0.337500,-0.183282,3.206290,0.346056,-0.155140,3.244350,0.470381,-0.100101,3.263979,0.436513,-0.104187,3.275708,\n\t\t          0.403001,-0.107855,3.283381,0.244905,-0.167776,3.237342,0.280249,-0.148425,3.258621,0.316811,-0.131797,3.275444,\n\t\t          0.384891,-0.141216,3.250015,0.402217,-0.158207,3.216542,0.419568,-0.172686,3.180928,0.505040,0.044359,3.223905,\n\t\t          0.477633,0.043075,3.250082,0.447227,0.039698,3.272774,0.378800,-0.072884,3.311382,0.390150,-0.039232,3.318997,\n\t\t          0.399459,-0.005745,3.316845,0.438835,-0.001582,3.294324,0.462438,-0.031380,3.283813,0.485744,-0.059839,3.269676,\n\t\t          0.406465,0.103719,3.171812,0.406479,0.088942,3.218003,0.407292,0.069091,3.258568,0.194641,0.185306,3.036600,\n\t\t          0.218097,0.185865,3.103068,0.231426,0.181224,3.159661,0.364752,0.129385,3.130811,0.327424,0.144560,3.151588,\n\t\t          0.289076,0.156373,3.175326,0.001633,0.199980,3.264652,0.000108,0.172817,3.299897,-0.000346,0.140014,3.337457,\n\t\t          0.369416,0.072507,3.285498,0.335851,0.101589,3.267186,0.297778,0.129697,3.244720,0.261944,0.130841,3.269418,\n\t\t          0.269651,0.097769,3.310332,0.277022,0.056072,3.339002,0.372460,0.033023,3.323649,0.346459,0.028431,3.338879,\n\t\t          0.317890,0.020768,3.347158,0.339541,-0.082456,3.315928,0.323690,-0.055188,3.333891,0.305899,-0.028666,3.344488,\n\t\t          0.212146,-0.148246,3.272566,0.233305,-0.099131,3.309735,0.256099,-0.048680,3.335883,0.088364,0.228261,2.954687,\n\t\t          0.067125,0.226543,2.940468,0.034436,0.211744,2.910465,0.134620,0.246588,3.058777,0.153367,0.243765,3.094738,\n\t\t          0.172543,0.221051,3.171441,0.208825,0.160789,3.298952,0.222488,0.117099,3.340693,0.229011,0.068245,3.368825,\n\t\t          0.183817,-0.156114,3.295171,0.208040,-0.103355,3.332087,0.226681,-0.043980,3.359812,0.160203,-0.193611,3.252043,\n\t\t          0.169656,-0.192005,3.247809,0.175291,-0.195161,3.237729,0.255645,0.007807,3.355787,0.246302,0.011460,3.362267,\n\t\t          0.240190,0.014397,3.368373,0.232352,0.172452,3.217002,0.221350,0.183721,3.221953,0.211305,0.191934,3.231607,\n\t\t          0.141983,0.207506,2.987819,0.138674,0.214886,2.994532,0.133596,0.219121,2.995825,0.006462,0.182558,2.869931,\n\t\t          0.008274,0.191575,2.886633,0.010326,0.204669,2.900935,0.051515,-0.254872,3.145953,0.087111,-0.245108,3.179311,\n\t\t          0.118681,-0.226507,3.214633,0.086917,0.138943,3.359977,0.090727,0.164205,3.338019,0.137730,0.182229,3.295408,\n\t\t          0.004473,0.265422,3.054118,-0.001932,0.262537,3.116087,0.006256,0.250853,3.173587,0.027806,-0.254690,3.124662,\n\t\t          0.060729,-0.238717,3.154222,0.087204,-0.211432,3.189946,0.126367,-0.134260,3.282537,0.140023,-0.090866,3.331043,\n\t\t          0.150537,-0.049503,3.369699,0.120278,-0.184470,3.244629,0.130847,-0.191675,3.253161,0.140912,-0.195678,3.254370,\n\t\t          0.225494,0.013069,3.384896,0.207982,0.006288,3.392509,0.175596,-0.001822,3.398641,0.115221,0.220163,3.234565,\n\t\t          0.081884,0.229256,3.231516,0.045126,0.232362,3.231242,0.088321,0.251614,3.011693,0.064527,0.256444,2.999418,\n\t\t          0.037338,0.262295,2.989316,0.049770,0.073933,3.407104,0.095743,0.058431,3.416863,0.129857,0.027967,3.413570,\n\t\t          0.008719,0.258789,2.959798,0.010457,0.239471,2.927326,0.010582,0.226882,2.915156,0.491213,-0.099232,2.975527,\n\t\t          0.497604,-0.124048,2.991749,0.509960,-0.148753,3.012800,0.489474,-0.022641,2.959171,0.498863,0.025937,2.962214,\n\t\t          0.508801,0.062371,2.971932,0.578773,-0.177064,3.047531,0.607349,-0.170273,3.065719,0.632109,-0.143653,3.079984,\n\t\t          0.660094,-0.072357,3.090869,0.661025,-0.038313,3.086673,0.653546,-0.005705,3.076924,0.562477,0.084551,2.999057,\n\t\t          0.591491,0.073307,3.022508,0.617383,0.052217,3.043955,0.506546,0.089848,3.010633,0.491828,0.094438,3.044206,\n\t\t          0.451605,0.096614,3.076297,0.547963,0.041392,3.168958,0.576140,0.032811,3.134385,0.606634,0.029639,3.100831,\n\t\t          0.546637,-0.096380,3.204783,0.579850,-0.099476,3.166926,0.616131,-0.103834,3.130023,0.497571,-0.185761,3.108354,\n\t\t          0.508434,-0.185533,3.086135,0.509810,-0.179342,3.063796,0.473169,-0.065021,2.971992,0.452098,-0.062568,2.978303,\n\t\t          0.421184,-0.071157,2.977952,0.645191,-0.024295,2.789305,0.655745,0.009870,2.790538,0.670660,0.040353,2.796507,\n\t\t          0.666403,-0.148003,2.836730,0.651802,-0.118814,2.818255,0.642771,-0.089511,2.803337,0.758419,-0.156803,2.906884,\n\t\t          0.734989,-0.180858,2.893282,0.709003,-0.187527,2.875702,0.782508,-0.032260,2.895010,0.785207,-0.059853,2.903782,\n\t\t          0.782575,-0.090117,2.909740,0.709703,0.051785,2.822613,0.728949,0.038667,2.838907,0.755211,0.023684,2.863223,\n\t\t          0.583927,-0.173240,2.986011,0.618974,-0.178338,2.940314,0.654052,-0.174355,2.896027,0.731898,-0.111022,2.937086,\n\t\t          0.703629,-0.109300,2.985237,0.678103,-0.108766,3.038213,0.735850,-0.001210,2.921313,0.699770,0.004003,2.966511,\n\t\t          0.668543,0.014414,3.015596,0.649634,0.062440,2.848451,0.604507,0.079439,2.885751,0.567055,0.087777,2.930490,\n\t\t          0.602261,-0.059622,2.834800,0.555119,-0.060585,2.873580,0.526983,-0.059087,2.927446,0.745006,-0.031803,2.673350,\n\t\t          0.764620,0.001022,2.675828,0.786387,0.024993,2.683549,0.737994,-0.161399,2.734098,0.725529,-0.135089,2.708944,\n\t\t          0.722337,-0.103547,2.688455,0.832234,-0.173544,2.813827,0.806022,-0.187018,2.800666,0.779580,-0.187908,2.781461,\n\t\t          0.894429,-0.057342,2.800174,0.888414,-0.089268,2.812059,0.874370,-0.120817,2.818143,0.836434,0.035730,2.716424,\n\t\t          0.860882,0.022449,2.739167,0.880070,0.000723,2.762183,0.783145,0.052173,2.715228,0.753064,0.061907,2.738282,\n\t\t          0.724445,0.051071,2.771312,0.805822,-0.010225,2.848480,0.842975,-0.010207,2.828138,0.867989,-0.019368,2.802669,\n\t\t          0.793811,-0.126928,2.875371,0.821192,-0.138738,2.856479,0.842076,-0.148142,2.839692,0.708667,-0.174724,2.823092,\n\t\t          0.729488,-0.173703,2.799112,0.743353,-0.175027,2.777232,0.668334,-0.057315,2.755745,0.693144,-0.057543,2.725649,\n\t\t          0.712990,-0.061751,2.699628,0.830412,-0.103074,2.607236,0.849105,-0.085648,2.610613,0.871062,-0.072682,2.620636,\n\t\t          0.811084,-0.197761,2.669811,0.807235,-0.171620,2.645451,0.808937,-0.146810,2.625276,0.888781,-0.218454,2.743882,\n\t\t          0.863636,-0.230540,2.734324,0.839635,-0.227100,2.714623,0.967718,-0.108925,2.720389,0.948889,-0.138368,2.729618,\n\t\t          0.931043,-0.163635,2.735713,0.926220,-0.055702,2.650145,0.956012,-0.053425,2.668313,0.974406,-0.063196,2.688695,\n\t\t          0.872755,-0.028867,2.652382,0.852460,0.001117,2.665159,0.832546,0.021854,2.680135,0.910140,-0.035786,2.765874,\n\t\t          0.927571,-0.048028,2.747233,0.949520,-0.064013,2.728180,0.868008,-0.154620,2.800390,0.881261,-0.163161,2.783106,\n\t\t          0.894712,-0.173789,2.762765,0.768563,-0.186904,2.743244,0.778131,-0.202160,2.729019,0.794813,-0.211777,2.714872,\n\t\t          0.746695,-0.075549,2.657885,0.766975,-0.085587,2.642990,0.790391,-0.101172,2.629104,0.949842,-0.242029,2.503034,\n\t\t          0.965548,-0.228233,2.502370,0.984424,-0.215814,2.506564,0.930545,-0.313927,2.551829,0.929546,-0.297145,2.534022,\n\t\t          0.932317,-0.277460,2.520112,0.988860,-0.325518,2.612350,0.969121,-0.331136,2.602036,0.951384,-0.331267,2.588219,\n\t\t          1.058072,-0.249348,2.598611,1.045030,-0.272419,2.610046,1.028296,-0.294859,2.616668,1.026474,-0.203094,2.529336,\n\t\t          1.045401,-0.205314,2.546491,1.058734,-0.214017,2.565233,0.983851,-0.173650,2.541057,0.957788,-0.132039,2.570702,\n\t\t          0.927442,-0.094076,2.602079,1.003656,-0.114797,2.674820,1.031319,-0.150874,2.640856,1.046082,-0.194901,2.609286,\n\t\t          0.937343,-0.220007,2.714007,0.962872,-0.250345,2.677608,0.988097,-0.284005,2.644231,0.848274,-0.240602,2.664251,\n\t\t          0.876847,-0.272750,2.632820,0.901282,-0.312448,2.599635,0.842353,-0.156068,2.584524,0.871134,-0.192870,2.554348,\n\t\t          0.907339,-0.227975,2.527761,0.980381,-0.281686,2.485548,0.993566,-0.270130,2.482077,1.010240,-0.261276,2.482205,\n\t\t          0.967607,-0.335299,2.530555,0.966168,-0.323380,2.518384,0.967345,-0.309492,2.505496,1.014898,-0.351287,2.572444,\n\t\t          0.996229,-0.353729,2.565910,0.981787,-0.351484,2.555303,1.077438,-0.297504,2.551945,1.067457,-0.315275,2.563598,\n\t\t          1.052735,-0.331226,2.571227,1.047856,-0.255494,2.495597,1.064481,-0.259524,2.508068,1.076143,-0.267806,2.522450,\n\t\t          1.021297,-0.249150,2.490995,1.019077,-0.243125,2.492336,1.014504,-0.230245,2.502495,1.071186,-0.251868,2.562320,\n\t\t          1.078219,-0.265776,2.547746,1.077808,-0.272744,2.542228,1.019100,-0.328639,2.596301,1.025589,-0.338887,2.584117,\n\t\t          1.028536,-0.339552,2.579346,0.956986,-0.334244,2.555227,0.966508,-0.340037,2.545535,0.968559,-0.339681,2.544927,\n\t\t          0.957402,-0.276707,2.502538,0.965715,-0.288380,2.497848,0.967717,-0.290831,2.498748,1.047723,-0.357419,2.412188,\n\t\t          1.064525,-0.346255,2.407981,1.082936,-0.338200,2.408767,1.027226,-0.414758,2.467794,1.025495,-0.401038,2.451429,\n\t\t          1.028136,-0.385840,2.435644,1.073179,-0.428702,2.512059,1.057245,-0.432834,2.506632,1.043348,-0.431897,2.496759,\n\t\t          1.133138,-0.373862,2.487668,1.121683,-0.390398,2.499497,1.106770,-0.406262,2.508045,1.117468,-0.333766,2.425740,\n\t\t          1.130082,-0.337921,2.440218,1.137829,-0.346160,2.456547,1.087953,-0.316549,2.430390,1.069881,-0.296501,2.450765,\n\t\t          1.047858,-0.274566,2.471819,1.094047,-0.298572,2.524141,1.111404,-0.320826,2.506249,1.127203,-0.341462,2.488296,\n\t\t          1.048622,-0.361501,2.559763,1.065103,-0.384162,2.541738,1.079234,-0.404246,2.525698,0.988526,-0.364466,2.528346,\n\t\t          1.007537,-0.388766,2.510030,1.021900,-0.409891,2.495006,0.987895,-0.312582,2.475886,1.008215,-0.334428,2.454616,\n\t\t          1.022976,-0.354113,2.435098,1.069661,-0.379672,2.410902,1.082881,-0.371866,2.406151,1.097180,-0.366314,2.405262,\n\t\t          1.051953,-0.422014,2.457537,1.050948,-0.411684,2.444201,1.053164,-0.400377,2.430879,1.083243,-0.432193,2.488101,\n\t\t          1.072361,-0.434941,2.485167,1.063164,-0.434191,2.478886,1.130696,-0.391815,2.464953,1.120919,-0.404069,2.475156,\n\t\t          1.108654,-0.415915,2.482887,1.122718,-0.363441,2.416374,1.131467,-0.366401,2.427311,1.136322,-0.372175,2.439980,\n\t\t          1.111786,-0.360597,2.406688,1.113290,-0.354698,2.401518,1.109212,-0.345809,2.405646,1.145464,-0.369585,2.463137,\n\t\t          1.146999,-0.377324,2.456571,1.139630,-0.379284,2.453980,1.096367,-0.428722,2.503105,1.099428,-0.433044,2.495164,\n\t\t          1.096493,-0.428074,2.489954,1.041407,-0.434668,2.475577,1.048419,-0.438358,2.470175,1.053742,-0.432511,2.470193,\n\t\t          1.043665,-0.381867,2.414280,1.050612,-0.388684,2.411531,1.056584,-0.388655,2.416940,0.159749,0.136537,2.409306,\n\t\t          0.159619,0.136915,2.464215,0.156907,0.127597,2.532366,-0.000114,0.151278,2.341492,0.001154,0.167946,2.303867,\n\t\t          0.001771,0.170729,2.291301,0.318845,0.050992,2.308556,0.324149,0.055974,2.272042,0.329914,0.057923,2.251681,\n\t\t          0.369868,-0.119129,2.283855,0.377854,-0.119917,2.250680,0.382336,-0.122287,2.222916,0.283743,-0.279256,2.266599,\n\t\t          0.277807,-0.273922,2.224024,0.276306,-0.275280,2.202078,-0.023099,-0.338149,2.241719,-0.022129,-0.339413,2.220382,\n\t\t          -0.009778,-0.336966,2.206068,0.038459,0.140172,2.372562,0.077764,0.142758,2.370202,0.118327,0.142458,2.366742,\n\t\t          0.202391,0.124450,2.358158,0.243781,0.105301,2.353537,0.281677,0.080162,2.348794,0.331362,0.008819,2.335686,\n\t\t          0.341114,-0.034575,2.327356,0.347595,-0.077717,2.319882,0.350532,-0.163520,2.308993,0.345020,-0.207013,2.304379,\n\t\t          0.309024,-0.250526,2.294101,0.218623,-0.308551,2.284250,0.146879,-0.321806,2.285975,0.071298,-0.333772,2.283443,\n\t\t          0.546634,-0.031233,0.146447,0.550020,-0.061937,0.147979,0.548938,-0.094308,0.150583,0.424374,0.056526,0.159228,\n\t\t          0.392854,0.052388,0.158817,0.362317,0.043521,0.155511,0.481096,0.048922,0.155645,0.504029,0.036775,0.152778,\n\t\t          0.523410,0.019091,0.149273,0.394551,-0.264656,0.181459,0.427011,-0.280028,0.182457,0.454349,-0.274422,0.182682,\n\t\t          0.532596,-0.162385,0.160503,0.517770,-0.196173,0.167494,0.499346,-0.227793,0.174903,0.305675,-0.048054,0.158444,\n\t\t          0.310138,-0.019131,0.157803,0.319884,0.007222,0.154857,0.338563,-0.202170,0.174549,0.321120,-0.163790,0.169017,\n\t\t          0.310725,-0.121902,0.163477,0.363647,-0.236977,0.165661,0.364028,-0.238787,0.166053,0.359898,-0.244360,0.182458,\n\t\t          0.298253,-0.080700,0.160482,0.301061,-0.081036,0.145053,0.303368,-0.081384,0.145621,0.330917,0.034192,0.156962,\n\t\t          0.333370,0.031916,0.140265,0.334843,0.030657,0.139212,0.545459,-0.128854,0.140660,0.547791,-0.128848,0.140612,\n\t\t          0.550372,-0.127188,0.157728,0.480602,-0.259730,0.183038,0.479277,-0.257216,0.166702,0.478562,-0.255892,0.166895,\n\t\t          0.454472,0.056699,0.144398,0.454783,0.061049,0.143931,0.455251,0.069237,0.159131,0.545213,0.004183,0.150339,\n\t\t          0.540843,-0.000646,0.133950,0.538984,-0.002767,0.133070,0.527387,-0.040316,0.288506,0.531299,-0.065867,0.287605,\n\t\t          0.531840,-0.093567,0.287823,0.424959,0.038143,0.293935,0.398336,0.034839,0.295077,0.373635,0.024031,0.296029,\n\t\t          0.472823,0.028776,0.291991,0.491619,0.017624,0.291295,0.507446,0.002009,0.290625,0.403246,-0.236291,0.317586,\n\t\t          0.427725,-0.249681,0.319782,0.450431,-0.245791,0.318004,0.519456,-0.152709,0.294500,0.506532,-0.181756,0.300655,\n\t\t          0.490240,-0.208161,0.307319,0.321983,-0.053168,0.292703,0.326463,-0.028900,0.293504,0.336732,-0.008698,0.295017,\n\t\t          0.358858,-0.183246,0.307788,0.342557,-0.150477,0.302262,0.330516,-0.115483,0.297150,0.375820,-0.220751,0.273817,\n\t\t          0.371577,-0.228346,0.236749,0.366502,-0.233345,0.203946,0.309892,-0.081615,0.183788,0.314367,-0.081571,0.216014,\n\t\t          0.318857,-0.081688,0.253490,0.340251,0.024857,0.180704,0.344552,0.019667,0.216841,0.348607,0.014190,0.255814,\n\t\t          0.533277,-0.124149,0.249582,0.537715,-0.125516,0.211859,0.540817,-0.126797,0.179287,0.477078,-0.252652,0.205026,\n\t\t          0.475685,-0.248265,0.237125,0.473652,-0.240126,0.274075,0.453533,0.047467,0.251532,0.455381,0.055748,0.213366,\n\t\t          0.455293,0.056812,0.181465,0.536329,-0.005034,0.173656,0.532957,-0.007530,0.209238,0.526941,-0.012016,0.248565,\n\t\t          -0.247094,-0.296720,2.163576,-0.150910,-0.323233,2.149887,-0.087263,-0.335630,2.180209,-0.388757,-0.154976,2.173890,\n\t\t          -0.351948,-0.219428,2.172156,-0.340772,-0.232727,2.168738,-0.351415,0.014795,2.215495,-0.381234,-0.031337,2.193818,\n\t\t          -0.382195,-0.077272,2.203347,-0.199148,0.135681,2.261295,-0.237931,0.118585,2.255090,-0.292457,0.095820,2.225924,\n\t\t          -0.123097,0.156438,2.272472,-0.086099,0.161546,2.275812,-0.048229,0.163128,2.270492,-0.383076,-0.176813,2.082124,\n\t\t          -0.361412,-0.216389,2.077847,-0.328263,-0.251044,2.072895,-0.371849,0.002955,2.096579,-0.387492,-0.042905,2.093746,\n\t\t          -0.395175,-0.088930,2.089989,-0.243265,0.160675,2.103416,-0.284694,0.127369,2.097058,-0.319970,0.089264,2.096361,\n\t\t          -0.055845,0.188973,2.203656,-0.086199,0.191890,2.193262,-0.136443,0.192598,2.173498,-0.172489,0.174998,2.209479,\n\t\t          -0.174048,0.179299,2.202183,-0.179379,0.183474,2.184575,-0.350871,0.045375,2.150343,-0.350793,0.049588,2.173074,\n\t\t          -0.340221,0.058757,2.185056,-0.393020,-0.138595,2.139163,-0.396104,-0.143745,2.164423,-0.394964,-0.142807,2.168546,\n\t\t          -0.278259,-0.283015,2.106454,-0.279351,-0.282304,2.123882,-0.268357,-0.283847,2.144427,-0.131517,0.202373,2.097250,\n\t\t          -0.085349,0.202994,2.083669,-0.039101,0.195381,2.077156,-0.211656,-0.294977,2.070277,-0.141566,-0.301639,2.073365,\n\t\t          -0.070766,-0.302709,2.073195,-0.231589,0.161133,2.165183,-0.264087,0.136326,2.185380,-0.306734,0.099608,2.199349,\n\t\t          -0.389427,-0.009114,1.913173,-0.412065,-0.051936,1.913576,-0.431365,-0.097839,1.914222,-0.190534,0.189310,2.057667,\n\t\t          -0.191732,0.184063,2.002769,-0.192028,0.176688,1.947257,-0.045914,0.133654,1.907793,-0.088305,0.146957,1.906209,\n\t\t          -0.135226,0.159768,1.900426,-0.156158,0.137662,1.844425,-0.130621,0.107538,1.816403,-0.115202,0.073162,1.798010,\n\t\t          -0.036615,-0.034248,1.801777,-0.062517,0.000643,1.793297,-0.089262,0.026839,1.789803,-0.117921,-0.251448,1.896154,\n\t\t          -0.075645,-0.249188,1.905535,-0.039243,-0.238392,1.910235,-0.041741,-0.145374,1.817105,-0.074909,-0.187183,1.826540,\n\t\t          -0.114363,-0.233312,1.843049,-0.235504,-0.292762,2.010135,-0.207300,-0.296424,1.973580,-0.184695,-0.288263,1.925836,\n\t\t          -0.417320,-0.140611,1.961143,-0.409161,-0.138390,2.006210,-0.399708,-0.136246,2.047384,-0.352992,0.048215,2.057104,\n\t\t          -0.357380,0.047333,2.012638,-0.362499,0.043956,1.964366,-0.248127,0.144238,1.897845,-0.300437,0.120255,1.905081,\n\t\t          -0.340831,0.083830,1.909769,-0.303909,-0.273466,2.018644,-0.316330,-0.274927,1.982968,-0.321101,-0.279715,1.942531,\n\t\t          -0.194190,-0.291612,1.882219,-0.243237,-0.302692,1.883895,-0.286559,-0.306663,1.891501,-0.397870,-0.183950,1.907500,\n\t\t          -0.384390,-0.220855,1.906386,-0.352948,-0.256139,1.901127,-0.433024,-0.045087,1.645329,-0.457368,-0.077602,1.645934,\n\t\t          -0.466093,-0.114816,1.645586,-0.234564,0.071914,1.629672,-0.196736,0.054374,1.625779,-0.165210,0.030846,1.621374,\n\t\t          -0.314876,0.078324,1.635768,-0.347438,0.050457,1.639813,-0.379914,0.019628,1.642756,-0.232494,-0.309404,1.620405,\n\t\t          -0.254623,-0.319283,1.624478,-0.305767,-0.321482,1.629626,-0.426396,-0.198821,1.641395,-0.391234,-0.232372,1.638616,\n\t\t          -0.371818,-0.276694,1.636154,-0.337083,-0.309761,1.716322,-0.330993,-0.304669,1.786672,-0.326242,-0.296153,1.846022,\n\t\t          -0.430226,-0.146799,1.857736,-0.437547,-0.150318,1.796819,-0.442650,-0.152998,1.726201,-0.175714,-0.278179,1.696113,\n\t\t          -0.153211,-0.281883,1.763236,-0.156224,-0.283835,1.816662,-0.395451,-0.002272,1.726248,-0.385022,0.011759,1.796317,\n\t\t          -0.376372,0.025721,1.857507,-0.220094,0.140743,1.829611,-0.240946,0.120497,1.773719,-0.258077,0.101806,1.709099,\n\t\t          -0.111682,0.039287,1.766014,-0.119129,0.029148,1.731797,-0.127792,0.016017,1.683020,-0.078712,-0.127548,1.668445,\n\t\t          -0.062745,-0.116564,1.725605,-0.041981,-0.102505,1.773682,-0.085149,-0.093867,1.598304,-0.089125,-0.055639,1.601964,\n\t\t          -0.106679,-0.022631,1.608152,-0.149056,-0.257276,1.609569,-0.115384,-0.222188,1.603429,-0.117767,-0.184347,1.596273,\n\t\t          -0.233998,-0.263277,1.322903,-0.229331,-0.279396,1.419503,-0.122654,-0.151996,1.407357,-0.123954,-0.144140,1.317410,\n\t\t          -0.159777,-0.010188,1.427198,-0.179629,-0.020508,1.330430,-0.357703,-0.273707,1.334947,-0.356520,-0.292939,1.432900,\n\t\t          -0.449913,-0.152624,1.444176,-0.452415,-0.150382,1.346303,-0.431567,-0.022809,1.345791,-0.431002,-0.022573,1.445733,\n\t\t          -0.295747,0.049490,1.438274,-0.314889,0.026177,1.320507,-0.471428,-0.042765,1.090638,-0.479587,-0.071049,1.090989,\n\t\t          -0.480377,-0.100797,1.090816,-0.298417,0.039498,1.076330,-0.262042,0.027454,1.082301,-0.244810,0.016494,1.076890,\n\t\t          -0.365870,0.030784,1.079282,-0.393913,0.019749,1.087481,-0.423365,0.004687,1.092618,-0.307192,-0.247772,1.072636,\n\t\t          -0.337099,-0.254906,1.075239,-0.366797,-0.252085,1.078384,-0.461208,-0.163767,1.088419,-0.442884,-0.194101,1.086449,\n\t\t          -0.420679,-0.220164,1.084228,-0.180384,-0.083184,1.060520,-0.193723,-0.045434,1.061349,-0.212870,-0.014373,1.063659,\n\t\t          -0.247012,-0.213551,1.066615,-0.221270,-0.185044,1.064752,-0.198113,-0.151916,1.063035,-0.269905,-0.239132,1.098145,\n\t\t          -0.263010,-0.243056,1.132250,-0.254698,-0.248126,1.177119,-0.157878,-0.132145,1.169534,-0.166069,-0.129541,1.124052,\n\t\t          -0.173566,-0.125396,1.089640,-0.215127,-0.004090,1.165831,-0.225917,0.000148,1.116204,-0.229037,0.002481,1.088373,\n\t\t          -0.387617,-0.246352,1.109557,-0.380148,-0.251732,1.143121,-0.372684,-0.257510,1.188014,-0.459309,-0.145301,1.199223,\n\t\t          -0.463899,-0.142226,1.153461,-0.468959,-0.137901,1.118890,-0.439154,-0.024832,1.123437,-0.437919,-0.032233,1.147415,\n\t\t          -0.445792,-0.029806,1.198195,-0.303584,0.030065,1.191803,-0.305162,0.033146,1.149054,-0.322507,0.037248,1.107126,\n\t\t          -0.484041,-0.006497,0.922500,-0.496558,-0.034461,0.921334,-0.498150,-0.065262,0.920671,-0.351344,0.077394,0.895383,\n\t\t          -0.315879,0.075725,0.897373,-0.279682,0.060097,0.903651,-0.401929,0.069505,0.913877,-0.428389,0.058210,0.919163,\n\t\t          -0.450947,0.040011,0.921038,-0.350399,-0.226993,0.902317,-0.363851,-0.232169,0.904738,-0.393159,-0.224416,0.910123,\n\t\t          -0.485872,-0.128753,0.919937,-0.473398,-0.169468,0.913765,-0.463248,-0.190964,0.916609,-0.218784,-0.051440,0.895604,\n\t\t          -0.224081,-0.018399,0.898026,-0.237116,0.009635,0.902641,-0.285256,-0.175963,0.901273,-0.264138,-0.146010,0.899971,\n\t\t          -0.243798,-0.113525,0.898558,-0.301578,-0.208099,0.963042,-0.290623,-0.217481,1.007211,-0.282696,-0.227073,1.040770,\n\t\t          -0.189661,-0.110096,1.032943,-0.199873,-0.100457,1.000150,-0.213135,-0.091361,0.956616,-0.230578,0.007706,1.051318,\n\t\t          -0.233628,0.015549,1.021593,-0.253151,0.024134,0.959839,-0.432791,-0.213459,0.975940,-0.414037,-0.222298,1.017280,\n\t\t          -0.402749,-0.231735,1.053502,-0.479333,-0.123449,1.061021,-0.484084,-0.114126,1.026643,-0.488151,-0.105067,0.981315,\n\t\t          -0.469243,0.011947,0.976593,-0.465671,0.003323,1.025149,-0.461009,-0.006897,1.059692,-0.339742,0.044755,1.050435,\n\t\t          -0.348968,0.062617,1.019751,-0.368904,0.083662,0.970478,-0.516283,-0.012217,0.530677,-0.520923,-0.034295,0.530836,\n\t\t          -0.515940,-0.058140,0.530294,-0.394809,0.083004,0.516006,-0.357768,0.076218,0.516681,-0.323868,0.061621,0.513800,\n\t\t          -0.452452,0.072689,0.517018,-0.479471,0.061325,0.524929,-0.496966,0.037561,0.528645,-0.379895,-0.218088,0.521316,\n\t\t          -0.402460,-0.219712,0.523544,-0.444275,-0.214669,0.528655,-0.501667,-0.125709,0.523025,-0.498685,-0.146021,0.529361,\n\t\t          -0.486633,-0.168844,0.531928,-0.253935,-0.040361,0.506982,-0.259163,-0.008283,0.507537,-0.272648,0.019192,0.509004,\n\t\t          -0.328846,-0.170273,0.516949,-0.299569,-0.142570,0.513402,-0.275985,-0.109535,0.510141,-0.358081,-0.199046,0.620478,\n\t\t          -0.344843,-0.194053,0.725753,-0.236707,-0.076456,0.716126,-0.247306,-0.074779,0.611953,-0.274192,0.042937,0.720008,\n\t\t          -0.283923,0.043391,0.615696,-0.470885,-0.194458,0.634897,-0.448528,-0.204452,0.730685,-0.516082,-0.079219,0.744991,\n\t\t          -0.506098,-0.080121,0.637144,-0.506577,0.017568,0.637109,-0.504782,0.023051,0.740419,-0.403189,0.094522,0.732459,\n\t\t          -0.415283,0.091671,0.627942,-0.537732,-0.025067,0.194039,-0.542379,-0.057112,0.193285,-0.544166,-0.089987,0.193151,\n\t\t          -0.418851,0.081105,0.195148,-0.383540,0.074121,0.195217,-0.351259,0.059838,0.194652,-0.480567,0.071296,0.194883,\n\t\t          -0.502508,0.054989,0.194986,-0.518554,0.032357,0.195053,-0.389253,-0.261065,0.213002,-0.421438,-0.268685,0.220786,\n\t\t          -0.452946,-0.266772,0.219319,-0.538712,-0.161623,0.199424,-0.528445,-0.197915,0.205427,-0.509264,-0.230099,0.211241,\n\t\t          -0.294166,-0.049040,0.189248,-0.304235,-0.017512,0.189290,-0.312803,0.012522,0.191264,-0.330737,-0.209476,0.198484,\n\t\t          -0.309326,-0.168792,0.193291,-0.294392,-0.125482,0.190176,-0.364647,-0.232748,0.264651,-0.371866,-0.214492,0.424747,\n\t\t          -0.270027,-0.075353,0.410241,-0.288790,-0.075460,0.248878,-0.316147,0.037061,0.406375,-0.322241,0.038583,0.250989,\n\t\t          -0.481865,-0.243984,0.272156,-0.474342,-0.212429,0.433137,-0.522200,-0.093950,0.426464,-0.533177,-0.116729,0.255379,\n\t\t          -0.525805,0.006006,0.255426,-0.511666,0.007447,0.427650,-0.426663,0.074124,0.429507,-0.448375,0.080384,0.253717,\n\t\t          -0.195422,-0.286977,2.509223,-0.135968,-0.313307,2.501804,-0.068391,-0.324506,2.500656,-0.299767,-0.147650,2.539946,\n\t\t          -0.283872,-0.183886,2.532453,-0.265475,-0.228958,2.520710,-0.313018,0.013293,2.575566,-0.320665,-0.030328,2.565427,\n\t\t          -0.319982,-0.073262,2.555487,-0.200176,0.114666,2.600164,-0.238226,0.103017,2.586745,-0.269546,0.083033,2.587244,\n\t\t          -0.119227,0.137706,2.606440,-0.079940,0.142798,2.605011,-0.040128,0.139989,2.603087,-0.157744,0.133860,2.325989,\n\t\t          -0.159373,0.147128,2.299898,-0.159977,0.151961,2.283001,-0.296141,0.041447,2.388238,-0.298059,0.046917,2.450146,\n\t\t          -0.306845,0.053809,2.504212,-0.336778,-0.117299,2.358660,-0.324537,-0.117435,2.414588,-0.319682,-0.116529,2.477734,\n\t\t          -0.265361,-0.282711,2.336336,-0.254198,-0.274745,2.392204,-0.246799,-0.267744,2.452802,-0.186701,-0.312689,2.736566,\n\t\t          -0.138569,-0.337772,2.748007,-0.083602,-0.355654,2.772451,-0.312745,-0.168454,2.758457,-0.287760,-0.206491,2.742144,\n\t\t          -0.260212,-0.246455,2.734669,-0.370753,0.030014,2.855002,-0.357934,-0.018674,2.822572,-0.352615,-0.066369,2.805044,\n\t\t          -0.250586,0.185956,2.924616,-0.291125,0.170761,2.924117,-0.331701,0.134787,2.903326,-0.127637,0.181889,2.889345,\n\t\t          -0.079762,0.172148,2.862684,-0.036761,0.169185,2.846628,-0.177533,0.175328,2.842216,-0.173193,0.163844,2.761959,\n\t\t          -0.168406,0.159164,2.685124,-0.292401,0.054699,2.664145,-0.301111,0.067427,2.730676,-0.311105,0.069080,2.814876,\n\t\t          -0.312887,-0.103833,2.604179,-0.327166,-0.105095,2.658500,-0.336691,-0.111236,2.720621,-0.247537,-0.271140,2.572995,\n\t\t          -0.246194,-0.280410,2.619106,-0.239309,-0.279816,2.679357,-0.230773,-0.307185,2.781507,-0.239941,-0.336868,2.827073,\n\t\t          -0.244866,-0.355413,2.873160,-0.079399,-0.381733,2.852244,-0.133504,-0.391557,2.880273,-0.186905,-0.385994,2.906479,\n\t\t          -0.328714,-0.185011,2.827772,-0.309018,-0.242748,2.850472,-0.286295,-0.302337,2.889188,-0.182034,-0.363028,2.975328,\n\t\t          -0.126645,-0.345084,3.006547,-0.072636,-0.313297,3.043575,-0.364069,-0.109605,2.833898,-0.370431,-0.103113,2.883441,\n\t\t          -0.385074,-0.095379,2.920851,-0.302431,-0.295981,2.948604,-0.334708,-0.233803,2.955982,-0.366088,-0.169425,2.959785,\n\t\t          -0.364313,0.049486,2.912645,-0.390056,0.013172,2.936716,-0.401466,-0.028788,2.944484,-0.352813,0.106555,2.953356,\n\t\t          -0.386261,0.129127,3.015258,-0.377326,0.134995,3.048556,-0.388311,-0.165864,3.011438,-0.368852,-0.206481,3.034541,\n\t\t          -0.348882,-0.236969,3.063884,-0.281829,-0.328044,2.998323,-0.299126,-0.299562,3.038687,-0.323998,-0.267482,3.079771,\n\t\t          -0.358455,-0.211886,3.125728,-0.380709,-0.196716,3.130144,-0.403856,-0.182472,3.133192,-0.417323,-0.132280,3.001759,\n\t\t          -0.429087,-0.148546,3.045232,-0.435154,-0.165120,3.086636,-0.419834,-0.005417,2.968522,-0.427177,0.058381,2.995532,\n\t\t          -0.431055,0.108703,3.026538,-0.299562,-0.239025,3.136142,-0.270669,-0.232554,3.154831,-0.242840,-0.221610,3.173194,\n\t\t          -0.074289,-0.268805,3.116643,-0.113739,-0.258763,3.137867,-0.158843,-0.238363,3.160960,-0.208843,-0.259874,3.129781,\n\t\t          -0.219077,-0.303329,3.073164,-0.232623,-0.338301,3.015812,-0.466917,-0.156216,3.161501,-0.491700,-0.142715,3.183208,\n\t\t          -0.497739,-0.121771,3.211471,-0.527703,-0.051522,3.232728,-0.538173,-0.017811,3.222502,-0.538435,0.014965,3.211474,\n\t\t          -0.481051,0.122616,3.131382,-0.504634,0.113673,3.149654,-0.511845,0.085125,3.175471,-0.332872,-0.209432,3.165870,\n\t\t          -0.337781,-0.183468,3.206302,-0.346005,-0.154938,3.244332,-0.468055,-0.097785,3.261618,-0.435879,-0.103515,3.275106,\n\t\t          -0.402862,-0.107663,3.283362,-0.249768,-0.169118,3.234711,-0.283861,-0.149371,3.257766,-0.318575,-0.132273,3.275289,\n\t\t          -0.384461,-0.140278,3.249876,-0.401049,-0.155223,3.216053,-0.416749,-0.165359,3.179712,-0.504544,0.045689,3.224990,\n\t\t          -0.477817,0.043490,3.250187,-0.447398,0.039733,3.273058,-0.378597,-0.072873,3.311380,-0.390111,-0.039233,3.319065,\n\t\t          -0.399561,-0.005752,3.317132,-0.439842,-0.001569,3.296102,-0.463333,-0.031011,3.285791,-0.484284,-0.058430,3.268699,\n\t\t          -0.408230,0.110700,3.171988,-0.406937,0.090907,3.218019,-0.407169,0.069145,3.258475,-0.227569,0.198533,3.002843,\n\t\t          -0.231737,0.195810,3.078199,-0.255276,0.177708,3.145959,-0.365101,0.133409,3.130713,-0.323698,0.147726,3.145573,\n\t\t          -0.291588,0.162051,3.170670,-0.368296,0.071664,3.284951,-0.335970,0.099592,3.266295,-0.303676,0.126011,3.243855,\n\t\t          -0.269159,0.129427,3.269059,-0.274880,0.097835,3.309613,-0.284958,0.057652,3.337671,-0.371914,0.032842,3.323498,\n\t\t          -0.346840,0.028419,3.338920,-0.321462,0.021017,3.347723,-0.339931,-0.082692,3.315787,-0.325119,-0.055294,3.333958,\n\t\t          -0.310027,-0.028072,3.345440,-0.224572,-0.139681,3.264467,-0.239075,-0.088260,3.312370,-0.263843,-0.042035,3.338503,\n\t\t          -0.087864,0.242073,2.949344,-0.057020,0.218596,2.915962,-0.019578,0.215015,2.906605,-0.132889,0.268026,3.051263,\n\t\t          -0.167682,0.260222,3.111973,-0.188742,0.241658,3.167774,-0.214292,0.177129,3.296276,-0.229447,0.128623,3.339132,\n\t\t          -0.234521,0.073752,3.366629,-0.183798,-0.145719,3.296785,-0.210499,-0.090809,3.330612,-0.227173,-0.033802,3.359565,\n\t\t          -0.159399,-0.186881,3.258346,-0.165361,-0.185772,3.253941,-0.171767,-0.189124,3.240533,-0.263023,0.016060,3.353624,\n\t\t          -0.249256,0.021506,3.359222,-0.243339,0.022928,3.364488,-0.235899,0.173815,3.216853,-0.215643,0.203414,3.228748,\n\t\t          -0.209740,0.212797,3.232607,-0.161025,0.218266,2.965194,-0.145885,0.230654,2.981937,-0.130475,0.256346,2.994713,\n\t\t          -0.056703,-0.254332,3.148241,-0.088718,-0.243463,3.183289,-0.120236,-0.223199,3.221049,-0.074967,0.149998,3.360024,\n\t\t          -0.076686,0.168279,3.342829,-0.138617,0.201709,3.309739,-0.024474,-0.257772,3.120756,-0.053547,-0.238156,3.154231,\n\t\t          -0.075321,-0.206602,3.193628,-0.119650,-0.130678,3.288020,-0.138400,-0.091069,3.334289,-0.151611,-0.050413,3.373077,\n\t\t          -0.115833,-0.177420,3.250802,-0.134247,-0.185628,3.258600,-0.146242,-0.190384,3.260375,-0.215193,0.016907,3.393275,\n\t\t          -0.202877,0.010212,3.400479,-0.176237,-0.001285,3.403140,-0.114548,0.225615,3.243315,-0.073552,0.230936,3.231541,\n\t\t          -0.050507,0.230042,3.231237,-0.085966,0.276408,3.002936,-0.053722,0.279817,2.996278,-0.030792,0.278283,2.985300,\n\t\t          -0.050866,0.073031,3.402917,-0.096121,0.056643,3.411329,-0.131545,0.027015,3.411730,-0.494668,-0.096638,2.966033,\n\t\t          -0.505940,-0.125076,2.984269,-0.520784,-0.152535,3.001537,-0.490789,-0.021973,2.949674,-0.501338,0.018677,2.954557,\n\t\t          -0.516826,0.053128,2.965528,-0.569288,-0.147721,3.042208,-0.597441,-0.141113,3.061515,-0.626296,-0.125661,3.078821,\n\t\t          -0.654395,-0.071476,3.087996,-0.656700,-0.038039,3.084250,-0.654047,-0.004806,3.077539,-0.569271,0.101508,3.000374,\n\t\t          -0.602811,0.095848,3.026137,-0.624452,0.062208,3.047477,-0.507865,0.085442,3.020518,-0.475379,0.106212,3.051404,\n\t\t          -0.460407,0.118163,3.078225,-0.556497,0.046019,3.169710,-0.584327,0.043249,3.139074,-0.613678,0.037125,3.105002,\n\t\t          -0.542473,-0.092345,3.200989,-0.575611,-0.094498,3.163924,-0.614741,-0.099842,3.130707,-0.473483,-0.168677,3.108557,\n\t\t          -0.479787,-0.170210,3.088316,-0.510108,-0.159691,3.057046,-0.458502,-0.068228,2.965061,-0.447676,-0.078108,2.969138,\n\t\t          -0.439022,-0.085425,2.972589,-0.647812,-0.022822,2.790703,-0.656152,0.009808,2.790005,-0.670674,0.037613,2.795794,\n\t\t          -0.670821,-0.131504,2.838422,-0.657076,-0.112230,2.821700,-0.648565,-0.086753,2.807558,-0.754672,-0.146930,2.900214,\n\t\t          -0.735060,-0.163757,2.890799,-0.710695,-0.156677,2.873890,-0.784508,-0.030641,2.896123,-0.785309,-0.061032,2.902928,\n\t\t          -0.780934,-0.092522,2.906287,-0.714891,0.058450,2.826340,-0.739527,0.048418,2.847285,-0.761078,0.026808,2.867590,\n\t\t          -0.578405,-0.154019,2.981296,-0.614097,-0.163126,2.935061,-0.654128,-0.149974,2.893962,-0.742147,-0.116757,2.946424,\n\t\t          -0.711212,-0.111278,2.992581,-0.680779,-0.109530,3.042787,-0.740770,0.003283,2.925185,-0.709974,0.013494,2.973338,\n\t\t          -0.673284,0.018951,3.018930,-0.652174,0.062122,2.850462,-0.614923,0.058453,2.898347,-0.573703,0.075778,2.938612,\n\t\t          -0.605964,-0.061763,2.837658,-0.562787,-0.065521,2.879197,-0.520396,-0.063782,2.916582,-0.745455,-0.028214,2.672572,\n\t\t          -0.763853,0.002882,2.674049,-0.785635,0.025929,2.681916,-0.735369,-0.163566,2.734608,-0.728807,-0.130774,2.711951,\n\t\t          -0.728129,-0.097144,2.692982,-0.832608,-0.173286,2.813862,-0.804630,-0.190089,2.802362,-0.775897,-0.195477,2.783597,\n\t\t          -0.893454,-0.056005,2.799612,-0.887373,-0.087739,2.810322,-0.873603,-0.117991,2.815244,-0.834345,0.035449,2.716650,\n\t\t          -0.857753,0.022167,2.740075,-0.877507,0.001321,2.763000,-0.783718,0.055842,2.713196,-0.754873,0.065766,2.736516,\n\t\t          -0.724247,0.061827,2.768850,-0.810898,-0.003404,2.851252,-0.841546,-0.006692,2.823911,-0.868119,-0.014802,2.802043,\n\t\t          -0.794400,-0.123614,2.871334,-0.817274,-0.128862,2.847782,-0.839344,-0.140374,2.833248,-0.712201,-0.153276,2.823688,\n\t\t          -0.728184,-0.164960,2.796762,-0.738441,-0.180238,2.775845,-0.673923,-0.053185,2.759016,-0.694155,-0.053470,2.724808,\n\t\t          -0.713505,-0.056855,2.698389,-0.831978,-0.102522,2.608337,-0.851674,-0.083325,2.609794,-0.875684,-0.065232,2.614603,\n\t\t          -0.798153,-0.210405,2.671026,-0.798793,-0.177318,2.643716,-0.805902,-0.147995,2.624282,-0.887885,-0.212726,2.743292,\n\t\t          -0.859659,-0.231424,2.736933,-0.829424,-0.241239,2.721479,-0.964798,-0.111784,2.722254,-0.950935,-0.138733,2.732284,\n\t\t          -0.934217,-0.164283,2.739211,-0.926602,-0.048584,2.641465,-0.948152,-0.053656,2.662704,-0.964239,-0.066569,2.685942,\n\t\t          -0.875839,-0.025404,2.648487,-0.852046,-0.004022,2.668133,-0.831137,0.017458,2.682561,-0.908396,-0.035846,2.766097,\n\t\t          -0.926092,-0.047992,2.748688,-0.947697,-0.063383,2.730088,-0.866203,-0.148287,2.797143,-0.877590,-0.153066,2.778485,\n\t\t          -0.894062,-0.167212,2.763276,-0.767035,-0.189153,2.747363,-0.783825,-0.188992,2.733260,-0.797302,-0.203474,2.717697,\n\t\t          -0.752973,-0.071355,2.664130,-0.774058,-0.083188,2.651112,-0.795305,-0.100003,2.634920,-0.938012,-0.233396,2.489419,\n\t\t          -0.957504,-0.218215,2.491087,-0.981159,-0.206610,2.502154,-0.924230,-0.309292,2.555436,-0.919466,-0.292181,2.535240,\n\t\t          -0.918733,-0.272139,2.513748,-0.988669,-0.327053,2.618298,-0.968318,-0.331399,2.608361,-0.949585,-0.329581,2.593435,\n\t\t          -1.052191,-0.250310,2.598144,-1.041712,-0.272500,2.610016,-1.026872,-0.295785,2.618683,-1.025327,-0.199933,2.532288,\n\t\t          -1.043332,-0.204601,2.549745,-1.054414,-0.214953,2.567349,-0.982535,-0.168289,2.539301,-0.955036,-0.135906,2.573988,\n\t\t          -0.925888,-0.096216,2.603112,-0.993503,-0.121647,2.677102,-1.017167,-0.161156,2.643956,-1.051456,-0.195826,2.614754,\n\t\t          -0.940939,-0.224054,2.721976,-0.965011,-0.252411,2.682106,-0.987475,-0.284920,2.646780,-0.838192,-0.252941,2.667570,\n\t\t          -0.879534,-0.268164,2.634236,-0.909204,-0.297490,2.602506,-0.839359,-0.156491,2.581870,-0.877416,-0.190721,2.561071,\n\t\t          -0.902251,-0.222730,2.524838,-0.988050,-0.282894,2.481268,-1.002746,-0.273343,2.479185,-1.019005,-0.265940,2.481448,\n\t\t          -0.968445,-0.334236,2.520425,-0.967215,-0.320623,2.507300,-0.969779,-0.307087,2.496147,-1.018416,-0.357434,2.567469,\n\t\t          -1.001721,-0.358974,2.559531,-0.986336,-0.354878,2.548044,-1.075365,-0.298270,2.551543,-1.067734,-0.317258,2.560988,\n\t\t          -1.053460,-0.335258,2.567882,-1.052037,-0.261294,2.499608,-1.065444,-0.264476,2.513254,-1.073864,-0.270749,2.526963,\n\t\t          -1.028858,-0.252049,2.495814,-1.024778,-0.242169,2.499451,-1.016448,-0.225657,2.506116,-1.063122,-0.252504,2.566896,\n\t\t          -1.068418,-0.265406,2.556803,-1.070776,-0.272682,2.549321,-1.021008,-0.332181,2.601111,-1.028628,-0.341918,2.586920,\n\t\t          -1.031204,-0.344695,2.578383,-0.953121,-0.332697,2.555377,-0.963837,-0.338296,2.542146,-0.968724,-0.339585,2.537937,\n\t\t          -0.948354,-0.272121,2.490068,-0.966760,-0.285593,2.490373,-0.972292,-0.289193,2.491318,-1.049021,-0.357887,2.414315,\n\t\t          -1.065180,-0.347271,2.410208,-1.082947,-0.339653,2.410834,-1.027845,-0.414477,2.467835,-1.026037,-0.400930,2.451602,\n\t\t          -1.028704,-0.385918,2.436099,-1.072624,-0.427219,2.510171,-1.057258,-0.431344,2.505105,-1.043972,-0.430630,2.495881,\n\t\t          -1.131030,-0.373864,2.486252,-1.119837,-0.389942,2.497819,-1.105257,-0.405419,2.506202,-1.116106,-0.335565,2.426873,\n\t\t          -1.128211,-0.339553,2.440717,-1.135621,-0.347400,2.456346,-1.087041,-0.318221,2.431965,-1.069907,-0.298105,2.451439,\n\t\t          -1.051177,-0.278130,2.471797,-1.091538,-0.299743,2.524170,-1.109075,-0.321693,2.505375,-1.124938,-0.342184,2.487225,\n\t\t          -1.048558,-0.364230,2.556426,-1.064319,-0.383657,2.539572,-1.078226,-0.402859,2.523811,-0.989118,-0.365564,2.523535,\n\t\t          -1.006766,-0.389373,2.509141,-1.021860,-0.409743,2.495032,-0.990300,-0.311649,2.472184,-1.007614,-0.334011,2.452870,\n\t\t          -1.023322,-0.354489,2.435895,-1.069662,-0.379672,2.410902,-1.082881,-0.371866,2.406151,-1.097180,-0.366314,2.405262,\n\t\t          -1.051373,-0.422354,2.457323,-1.050307,-0.412009,2.443898,-1.052764,-0.400578,2.430688,-1.083130,-0.432280,2.488088,\n\t\t          -1.072003,-0.435217,2.485126,-1.062657,-0.434581,2.478825,-1.130696,-0.391815,2.464953,-1.120919,-0.404069,2.475156,\n\t\t          -1.108654,-0.415915,2.482887,-1.122718,-0.363441,2.416374,-1.131468,-0.366401,2.427311,-1.136322,-0.372175,2.439980,\n\t\t          -1.111786,-0.360597,2.406688,-1.112347,-0.355435,2.403736,-1.108510,-0.347330,2.407528,-1.143061,-0.369925,2.462459,\n\t\t          -1.144517,-0.376899,2.456486,-1.139630,-0.379284,2.453980,-1.095194,-0.427280,2.501402,-1.098042,-0.431066,2.494446,\n\t\t          -1.096488,-0.428078,2.489953,-1.042382,-0.433383,2.475570,-1.048722,-0.436591,2.470833,-1.053177,-0.432926,2.470099,\n\t\t          -1.045255,-0.381475,2.416036,-1.051660,-0.387681,2.413528,-1.056542,-0.388676,2.416920,-0.160105,0.138828,2.409385,\n\t\t          -0.163465,0.170002,2.483011,-0.168261,0.165019,2.522419,-0.316175,0.051209,2.305112,-0.321401,0.054347,2.281744,\n\t\t          -0.320737,0.061077,2.256362,-0.370421,-0.119815,2.279107,-0.374704,-0.120526,2.249215,-0.378431,-0.123107,2.231852,\n\t\t          -0.271657,-0.272996,2.249498,-0.276222,-0.273334,2.229884,-0.277116,-0.271420,2.208343,-0.038720,0.136645,2.372638,\n\t\t          -0.077284,0.135292,2.370232,-0.115970,0.130231,2.366484,-0.196384,0.110802,2.357394,-0.236244,0.094789,2.352472,\n\t\t          -0.272493,0.071781,2.347049,-0.327791,0.006402,2.334465,-0.344342,-0.033501,2.327362,-0.352271,-0.075456,2.319880,\n\t\t          -0.351149,-0.162689,2.308421,-0.339970,-0.206163,2.301795,-0.313382,-0.247463,2.295736,-0.216294,-0.300530,2.286168,\n\t\t          -0.153151,-0.324185,2.295383,-0.080841,-0.332426,2.282586,-0.528218,-0.034776,0.154170,-0.535236,-0.064292,0.152334,\n\t\t          -0.540440,-0.096106,0.150071,-0.424296,0.056004,0.159238,-0.394188,0.049717,0.160022,-0.365506,0.038344,0.160203,\n\t\t          -0.475391,0.048448,0.157575,-0.493674,0.034528,0.156991,-0.507979,0.015368,0.156394,-0.394325,-0.253096,0.179557,\n\t\t          -0.422906,-0.260846,0.183156,-0.451173,-0.259766,0.182237,-0.533094,-0.163819,0.157091,-0.519090,-0.196843,0.165773,\n\t\t          -0.500366,-0.226419,0.172823,-0.307985,-0.049175,0.153377,-0.314101,-0.021335,0.154603,-0.324698,0.002539,0.157041,\n\t\t          -0.343927,-0.203014,0.168189,-0.325413,-0.163814,0.162818,-0.313189,-0.122048,0.157719,-0.368634,-0.233696,0.163700,\n\t\t          -0.366799,-0.235977,0.163756,-0.361398,-0.241550,0.174814,-0.295455,-0.083371,0.155203,-0.302494,-0.081532,0.140995,\n\t\t          -0.306294,-0.081101,0.141189,-0.332670,0.032802,0.157781,-0.338461,0.025523,0.142026,-0.340633,0.022911,0.143842,\n\t\t          -0.543623,-0.130220,0.136714,-0.544832,-0.129967,0.137822,-0.545741,-0.128514,0.156404,-0.481389,-0.255218,0.181602,\n\t\t          -0.478582,-0.252065,0.166067,-0.477760,-0.250418,0.165527,-0.452453,0.055909,0.144619,-0.453156,0.061197,0.143956,\n\t\t          -0.453762,0.071629,0.159508,-0.528780,0.000915,0.157963,-0.525212,-0.003821,0.141374,-0.522063,-0.006574,0.141641,\n\t\t          -0.504723,-0.045374,0.288616,-0.508191,-0.069819,0.287467,-0.506510,-0.094446,0.287006,-0.424587,0.034865,0.294198,\n\t\t          -0.399163,0.030287,0.295443,-0.374337,0.021065,0.296267,-0.465947,0.027085,0.292096,-0.479811,0.014799,0.291443,\n\t\t          -0.490131,-0.001986,0.290779,-0.401419,-0.227407,0.315459,-0.425198,-0.237165,0.316752,-0.449585,-0.239962,0.316486,\n\t\t          -0.502949,-0.150642,0.293448,-0.499798,-0.181395,0.300296,-0.488958,-0.210699,0.307724,-0.320484,-0.052871,0.292544,\n\t\t          -0.326192,-0.028755,0.293469,-0.336617,-0.008637,0.295009,-0.359409,-0.182785,0.307710,-0.342980,-0.150209,0.302216,\n\t\t          -0.328461,-0.115438,0.296958,-0.368668,-0.226434,0.264817,-0.362101,-0.237764,0.223065,-0.363421,-0.238149,0.193147,\n\t\t          -0.306148,-0.085373,0.178246,-0.306540,-0.087365,0.211171,-0.311465,-0.085433,0.250572,-0.342653,0.021563,0.184684,\n\t\t          -0.344939,0.019182,0.217532,-0.348478,0.014180,0.255592,-0.515472,-0.123591,0.249059,-0.526308,-0.126088,0.211283,\n\t\t          -0.534858,-0.128101,0.176951,-0.476486,-0.245256,0.202675,-0.474995,-0.240969,0.235431,-0.473408,-0.236646,0.273319,\n\t\t          -0.452109,0.052085,0.251506,-0.454758,0.063497,0.213342,-0.454065,0.061658,0.181728,-0.516478,-0.008978,0.179834,\n\t\t          -0.512522,-0.011051,0.212028,-0.505944,-0.015985,0.249617,0.267924,-0.277058,2.179104,0.382885,-0.123919,2.212791,\n\t\t          0.327103,0.059815,2.240571,0.170640,0.153332,2.266677,0.285000,-0.285400,2.066601,0.394954,-0.136784,2.089331,\n\t\t          0.349322,0.047346,2.098122,0.186231,0.191187,2.121338,0.192125,0.164176,1.885889,0.095762,0.053116,1.778517,\n\t\t          0.151632,-0.270582,1.873869,0.411000,-0.144980,1.910303,0.377542,0.044523,1.912544,0.327354,-0.286452,1.897137,\n\t\t          0.272422,0.086314,1.631227,0.112726,0.020560,1.608754,0.200454,-0.276633,1.616497,0.435370,-0.158144,1.643179,\n\t\t          0.408621,-0.007185,1.644128,0.343604,-0.303718,1.633170,0.085821,-0.132788,1.595742,0.353293,0.084504,1.055060,\n\t\t          0.209528,0.016561,1.055797,0.278222,-0.232780,1.069597,0.472045,-0.127450,1.090413,0.451076,-0.006176,1.094538,\n\t\t          0.390983,-0.234653,1.082164,0.177484,-0.112320,1.060816,0.371154,0.088033,0.918697,0.244265,0.039682,0.908308,\n\t\t          0.319871,-0.180492,0.899112,0.510049,-0.097351,0.923217,0.486912,0.021824,0.922297,0.436610,-0.191388,0.907171,\n\t\t          0.233169,-0.072848,0.888800,0.426856,0.111362,0.521310,0.313368,0.046203,0.514468,0.351294,-0.181385,0.517936,\n\t\t          0.541826,-0.101484,0.530225,0.532550,0.021999,0.530931,0.481148,-0.188023,0.529129,0.290229,-0.072196,0.510882,\n\t\t          0.454031,0.076872,0.194139,0.328397,0.032447,0.195868,0.356802,-0.244867,0.216591,0.552541,-0.123155,0.195208,\n\t\t          0.548177,0.008893,0.187645,0.481716,-0.257457,0.217976,0.295894,-0.079766,0.194750,0.223680,-0.265291,2.527737,\n\t\t          0.327689,-0.124027,2.539016,0.283632,0.039502,2.560424,0.155816,0.123133,2.605072,0.235768,-0.310383,2.740942,\n\t\t          0.325139,-0.125960,2.788754,0.338317,0.060763,2.897192,0.165514,0.175386,2.944974,0.250532,-0.356612,2.940897,\n\t\t          0.402808,-0.095306,2.965012,0.408512,0.110227,3.108022,0.328401,-0.231997,3.116763,0.437905,-0.182550,3.136923,\n\t\t          0.197312,-0.200631,3.207942,0.510290,-0.091216,3.245542,0.529782,0.047067,3.196314,0.361283,-0.115388,3.288113,\n\t\t          0.407145,0.036006,3.300431,0.255619,0.158251,3.214207,0.282571,0.004585,3.350971,0.117208,0.229465,2.996951,\n\t\t          0.150871,-0.196328,3.252304,0.170297,0.206372,3.249763,0.234133,0.016111,3.375642,0.108957,-0.175669,3.232676,\n\t\t          0.149839,-0.009965,3.397534,0.487988,-0.066108,2.963968,0.529867,0.081862,2.982224,0.546566,-0.167885,3.028832,\n\t\t          0.650531,-0.107562,3.088858,0.638664,0.024720,3.062419,0.689374,0.056793,2.807563,0.640315,-0.058426,2.793308,\n\t\t          0.684510,-0.174835,2.855572,0.774115,-0.122828,2.911669,0.772574,-0.004794,2.881456,0.810321,0.037450,2.696939,\n\t\t          0.729676,-0.068347,2.676785,0.756440,-0.179620,2.759041,0.855531,-0.150753,2.819577,0.891951,-0.026802,2.783268,\n\t\t          0.896354,-0.063215,2.634616,0.816513,-0.123837,2.611723,0.821584,-0.218018,2.693997,0.911253,-0.190565,2.740726,\n\t\t          0.979839,-0.080961,2.706891,1.005099,-0.206784,2.515462,0.938832,-0.258029,2.509471,0.937618,-0.325830,2.571313,\n\t\t          1.009147,-0.313585,2.617696,1.063836,-0.228822,2.583346,1.028884,-0.256000,2.486449,0.971806,-0.295061,2.493704,\n\t\t          0.972218,-0.345045,2.542711,1.034706,-0.343846,2.574376,1.080995,-0.280585,2.537640,1.101262,-0.333821,2.414670,\n\t\t          1.034721,-0.371007,2.421526,1.033114,-0.425671,2.483434,1.089993,-0.419737,2.512574,1.139265,-0.358345,2.473054,\n\t\t          1.110984,-0.363383,2.408561,1.059142,-0.389343,2.419210,1.056155,-0.429912,2.469559,1.095526,-0.425821,2.487436,\n\t\t          1.136369,-0.380675,2.452991,0.160011,0.137230,2.362605,0.312174,0.048096,2.343091,0.349278,-0.120740,2.313365,\n\t\t          0.283558,-0.270967,2.299749,0.454560,0.055512,0.157814,0.336686,0.028830,0.152972,0.363042,-0.236104,0.179040,\n\t\t          0.543195,-0.127930,0.154632,0.538018,-0.003717,0.146655,0.477986,-0.254718,0.180657,0.306027,-0.081619,0.159446,\n\t\t          0.450717,0.035578,0.292831,0.352539,0.008569,0.296205,0.379340,-0.212156,0.313072,0.528171,-0.122739,0.289880,\n\t\t          0.519602,-0.017497,0.289766,0.471299,-0.230110,0.313450,0.323353,-0.081886,0.293591,0.000635,0.160622,2.246261,\n\t\t          -0.004107,-0.326087,2.162668,-0.276174,-0.277167,2.172102,-0.391373,-0.133087,2.181451,-0.310775,0.088473,2.208978,\n\t\t          -0.160773,0.149286,2.263373,0.001670,-0.302261,2.072476,-0.000000,-0.236387,1.909742,-0.002639,-0.084489,1.822991,\n\t\t          -0.005878,0.124073,1.903101,0.004138,0.188884,2.075478,-0.277305,-0.280280,2.061152,-0.394004,-0.133925,2.085734,\n\t\t          -0.349044,0.047430,2.097456,-0.187065,0.191478,2.122808,-0.191197,0.163714,1.885334,-0.106103,0.046050,1.785485,\n\t\t          -0.155051,-0.277172,1.869336,-0.422904,-0.143146,1.911620,-0.368838,0.037172,1.912570,-0.322778,-0.287033,1.897064,\n\t\t          -0.273576,0.080418,1.632885,-0.135914,0.003682,1.615828,-0.196173,-0.287842,1.614730,-0.446315,-0.154263,1.643561,\n\t\t          -0.406684,-0.013868,1.644312,-0.344162,-0.309829,1.633165,-0.092460,-0.134777,1.597511,-0.337863,0.039203,1.071435,\n\t\t          -0.229971,0.004554,1.069183,-0.276192,-0.234448,1.069433,-0.474192,-0.131789,1.089939,-0.452412,-0.016575,1.092244,\n\t\t          -0.395136,-0.240108,1.081594,-0.181223,-0.118971,1.060984,-0.377468,0.074682,0.904129,-0.254785,0.035228,0.904310,\n\t\t          -0.317517,-0.202800,0.903033,-0.492998,-0.096146,0.920291,-0.468811,0.017189,0.922230,-0.442114,-0.203530,0.917530,\n\t\t          -0.225164,-0.083570,0.896327,-0.427065,0.078924,0.512925,-0.294259,0.042385,0.511165,-0.366154,-0.206037,0.518126,\n\t\t          -0.506435,-0.084576,0.529637,-0.506809,0.010804,0.529958,-0.468048,-0.200487,0.529973,-0.259809,-0.074192,0.507771,\n\t\t          -0.452693,0.080320,0.194890,-0.326262,0.039043,0.193364,-0.357556,-0.241995,0.204932,-0.542980,-0.124541,0.194807,\n\t\t          -0.529898,0.005104,0.194825,-0.483594,-0.254262,0.215765,-0.288601,-0.083833,0.189246,-0.000430,0.135671,2.601773,\n\t\t          -0.014704,-0.307652,2.503875,-0.247666,-0.258882,2.515880,-0.311558,-0.111936,2.547445,-0.295287,0.049697,2.579940,\n\t\t          -0.158620,0.122743,2.605815,0.003519,0.172172,2.844605,-0.004081,-0.378875,2.813692,-0.227431,-0.282404,2.733620,\n\t\t          -0.339470,-0.124106,2.790603,-0.353938,0.085210,2.885792,-0.184603,0.194276,2.930155,-0.252841,-0.363455,2.939879,\n\t\t          -0.004462,-0.268936,3.102088,-0.411346,-0.094757,2.968925,-0.412521,0.122648,3.107455,-0.329414,-0.239307,3.113872,\n\t\t          -0.434237,-0.170618,3.135450,-0.206682,-0.201780,3.199624,-0.505901,-0.087645,3.240961,-0.529973,0.046483,3.197989,\n\t\t          -0.361244,-0.115312,3.288092,-0.407105,0.035926,3.300564,-0.272015,0.158821,3.204462,-0.000622,0.078140,3.397754,\n\t\t          -0.292570,0.006443,3.351702,0.010651,0.215056,2.907648,-0.117800,0.265250,2.995390,-0.153301,-0.190973,3.259378,\n\t\t          -0.189010,0.216889,3.247825,-0.234108,0.021719,3.373389,0.006253,0.268148,2.980361,-0.097802,-0.169039,3.239418,\n\t\t          -0.007448,0.227106,3.224286,-0.151816,-0.010466,3.400264,-0.485754,-0.062543,2.952643,-0.537356,0.087324,2.977809,\n\t\t          -0.544281,-0.154678,3.023085,-0.650069,-0.106415,3.091328,-0.643634,0.028680,3.065589,-0.690538,0.055673,2.807916,\n\t\t          -0.645430,-0.056481,2.796917,-0.688971,-0.145882,2.856295,-0.770741,-0.121692,2.905443,-0.776956,-0.001358,2.884726,\n\t\t          -0.809549,0.037819,2.696130,-0.732851,-0.062952,2.678584,-0.751536,-0.187485,2.760349,-0.855616,-0.147703,2.817247,\n\t\t          -0.890457,-0.025324,2.783490,-0.901630,-0.052227,2.624605,-0.816675,-0.123681,2.612340,-0.807186,-0.235094,2.699088,\n\t\t          -0.913407,-0.188847,2.742932,-0.970937,-0.086445,2.707236,-1.004109,-0.200453,2.516465,-0.923961,-0.251769,2.496178,\n\t\t          -0.934285,-0.322059,2.575225,-1.008800,-0.315522,2.622115,-1.057168,-0.230590,2.583822,-1.035810,-0.261612,2.488207,\n\t\t          -0.976544,-0.294264,2.487212,-0.974486,-0.346267,2.534472,-1.035890,-0.349620,2.570620,-1.077162,-0.281610,2.540021,\n\t\t          -1.100563,-0.335561,2.416358,-1.036243,-0.370986,2.423028,-1.033876,-0.424973,2.483197,-1.088950,-0.418496,2.510632,\n\t\t          -1.136978,-0.358972,2.472139,-1.110985,-0.363383,2.408561,-1.059098,-0.389365,2.419190,-1.055608,-0.430312,2.469465,\n\t\t          -1.095519,-0.425826,2.487435,-1.136369,-0.380675,2.452991,-0.155448,0.121916,2.362004,-0.000174,0.137276,2.373486,\n\t\t          -0.303547,0.042176,2.341068,-0.352981,-0.118179,2.312656,-0.272255,-0.281065,2.290169,-0.024514,-0.330328,2.282073,\n\t\t          -0.452481,0.055988,0.158281,-0.341319,0.022435,0.159353,-0.367356,-0.234492,0.173785,-0.540753,-0.129517,0.150588,\n\t\t          -0.519197,-0.008057,0.155537,-0.477526,-0.248681,0.178293,-0.307349,-0.082305,0.154152,-0.447789,0.034048,0.292945,\n\t\t          -0.352644,0.007867,0.296259,-0.379179,-0.209632,0.312486,-0.503493,-0.120854,0.288558,-0.498054,-0.022351,0.289903,\n\t\t          -0.471773,-0.232305,0.313773,-0.320277,-0.081662,0.293311,-0.367310,-0.105172,-0.007174,-0.363726,-0.474855,0.011151,\n\t\t          -0.347086,-0.429383,-0.007041,-0.374978,0.002718,-0.009041,-0.363082,-0.210431,-0.011262,-0.371540,-0.031511,-0.029190,\n\t\t          -0.393128,0.040113,-0.002874,-0.413063,0.029280,-0.039973,-0.373388,-0.149363,-0.016975,-0.362189,-0.065672,-0.009992,\n\t\t          -0.387246,0.027500,-0.021720,-0.415800,0.052724,-0.013081,-0.365938,-0.094377,-0.022050,-0.407603,-0.033349,-0.049801,\n\t\t          -0.403217,-0.112419,-0.039772,-0.406302,-0.180179,-0.028191,-0.399050,-0.359157,-0.037026,-0.395700,-0.435380,-0.026316,\n\t\t          -0.406306,-0.487914,-0.007664,-0.407957,-0.513759,0.020732,-0.408470,-0.264630,-0.033402,-0.343345,-0.344143,-0.004805,\n\t\t          -0.360326,-0.276235,-0.023958,-0.344615,-0.380232,-0.012662,-0.421521,0.064236,0.019986,-0.395551,0.044071,0.015728,\n\t\t          -0.401044,-0.511024,0.071991,-0.404306,-0.497664,0.092982,-0.410128,-0.456768,0.108352,-0.352076,-0.463624,0.062237,\n\t\t          -0.361006,-0.450520,0.086650,-0.350565,-0.467605,0.042827,-0.377661,-0.397656,0.110945,-0.366462,-0.098970,0.005374,\n\t\t          -0.337165,-0.374555,0.063947,-0.339785,-0.308519,0.032064,-0.340610,-0.297798,0.074410,-0.345493,-0.250940,0.032144,\n\t\t          -0.341255,-0.243113,0.081479,-0.350289,-0.161805,0.039539,-0.339134,-0.159772,0.095308,-0.351840,-0.189209,0.181216,\n\t\t          -0.360093,-0.239102,0.160788,-0.366724,-0.295445,0.139709,-0.368804,-0.354767,0.118948,-0.349041,-0.366287,0.093466,\n\t\t          -0.349421,-0.292504,0.112077,-0.345624,-0.238624,0.126865,-0.339516,-0.170787,0.147835,-0.505361,-0.098970,0.005374,\n\t\t          -0.416589,0.060128,0.037605,-0.382036,0.034113,0.066838,-0.360246,-0.009172,0.050199,-0.345575,-0.027450,0.108011,\n\t\t          -0.360728,0.012604,0.124757,-0.378589,0.036241,0.141741,-0.426742,0.044130,0.150963,-0.352789,0.003146,0.177336,\n\t\t          -0.344162,-0.011153,0.167152,-0.375259,0.026254,0.172641,-0.405785,0.046235,0.138117,-0.504946,-0.105172,-0.007174,\n\t\t          -0.512309,-0.474855,0.011151,-0.534861,-0.429383,-0.007041,-0.491784,0.002718,-0.009041,-0.522398,-0.210431,-0.011262,\n\t\t          -0.500176,-0.031511,-0.029190,-0.470462,0.040113,-0.002874,-0.452619,0.029280,-0.039973,-0.502562,-0.149363,-0.016975,\n\t\t          -0.512530,-0.065672,-0.009992,-0.476635,0.027500,-0.021719,-0.446285,0.052724,-0.013081,-0.509252,-0.094377,-0.022050,\n\t\t          -0.466176,-0.033349,-0.049801,-0.472366,-0.112419,-0.039772,-0.472308,-0.180179,-0.028191,-0.495390,-0.359157,-0.037026,\n\t\t          -0.482979,-0.435380,-0.026316,-0.469635,-0.487914,-0.007664,-0.463471,-0.513759,0.020732,-0.491156,-0.264630,-0.033402,\n\t\t          -0.551514,-0.344143,-0.004805,-0.537894,-0.276235,-0.023958,-0.544136,-0.380232,-0.012662,-0.438996,0.064236,0.019986,\n\t\t          -0.467768,0.044071,0.015728,-0.467640,-0.511024,0.071991,-0.462408,-0.497664,0.092982,-0.391313,0.035093,0.020855,\n\t\t          -0.452953,-0.456766,0.108658,-0.521051,-0.463624,0.062237,-0.509390,-0.450520,0.085424,-0.522818,-0.467605,0.042827,\n\t\t          -0.488729,-0.434438,0.101795,-0.472464,0.035093,0.020855,-0.548926,-0.374555,0.059289,-0.555545,-0.308519,0.032064,\n\t\t          -0.552555,-0.297798,0.065093,-0.545530,-0.250940,0.032144,-0.543779,-0.243113,0.072898,-0.522654,-0.161047,0.039151,\n\t\t          -0.526827,-0.159772,0.089875,-0.505858,-0.189251,0.168395,-0.507446,-0.239029,0.144560,-0.513283,-0.294834,0.121408,\n\t\t          -0.535972,-0.366287,0.082924,-0.539882,-0.292504,0.093199,-0.532670,-0.238624,0.109213,-0.522792,-0.170787,0.136724,\n\t\t          -0.514699,-0.096245,0.044059,-0.550889,-0.315070,-0.001040,-0.521382,-0.094576,0.100507,-0.443327,0.060128,0.037647,\n\t\t          -0.477592,0.034113,0.066838,-0.503863,-0.009172,0.050199,-0.416394,0.054057,0.042991,-0.513036,-0.027450,0.102153,\n\t\t          -0.494627,0.012604,0.120409,-0.475923,0.036241,0.141741,-0.449585,0.037335,0.172893,-0.501672,0.003146,0.174877,\n\t\t          -0.511183,-0.011153,0.158895,-0.478449,0.026254,0.172641,-0.491363,-0.397979,0.106245,-0.377166,-0.434402,0.103011,\n\t\t          -0.509667,-0.354669,0.106289,-0.426086,0.029886,0.178311,-0.494747,-0.294860,0.134381,-0.486699,-0.238081,0.160583,\n\t\t          -0.488261,-0.195362,0.180603,-0.491546,-0.345071,0.117835,-0.475616,-0.392012,0.114100,-0.448002,-0.422455,0.114543,\n\t\t          -0.375497,-0.293760,0.147192,-0.370999,-0.238434,0.174138,-0.364497,-0.196155,0.194148,-0.378219,-0.344999,0.126658,\n\t\t          -0.386823,-0.392642,0.115758,-0.413130,-0.422337,0.113530,-0.400577,-0.239511,0.173230,-0.406717,-0.293847,0.144354,\n\t\t          -0.478236,-0.190163,0.183190,-0.461579,-0.341855,0.120165,-0.403935,-0.398935,0.108428,-0.459925,-0.399252,0.107602,\n\t\t          -0.415271,-0.382627,0.115597,-0.455300,-0.239499,0.166621,-0.462717,-0.293851,0.137624,-0.408112,-0.341844,0.125157,\n\t\t          -0.448817,-0.382638,0.113411,-0.402009,-0.196176,0.201513,-0.372288,-0.190650,0.194643,-0.447899,-0.196165,0.196262,\n\t\t          -0.473790,-0.174295,0.185651,-0.344976,-0.029456,0.168267,-0.504072,-0.161715,0.176631,-0.342564,-0.082324,0.137942,\n\t\t          -0.443833,-0.174303,0.204345,-0.377004,-0.174348,0.195411,-0.351672,-0.161726,0.186016,-0.447766,0.046235,0.138117,\n\t\t          -0.496586,-0.009453,0.179074,-0.343287,-0.126872,0.159271,-0.514468,-0.046125,0.133024,-0.488581,-0.174076,0.182074,\n\t\t          -0.356698,-0.009453,0.182514,-0.342449,-0.046125,0.143951,-0.363077,-0.174533,0.193953,-0.406842,-0.174303,0.208098,\n\t\t          -0.403919,0.037335,0.172893,-0.470806,0.015222,0.180042,-0.510076,-0.029456,0.156718,-0.381122,0.015137,0.179986,\n\t\t          -0.518255,-0.081281,0.131983,-0.516339,-0.126872,0.153637,-0.426846,0.037041,0.174084,-0.426753,0.043704,0.179114,\n\t\t          -0.426633,0.063768,0.193707,-0.426647,0.075442,0.201368,-0.426189,0.057202,0.204104,-0.426252,0.038865,0.191413,\n\t\t          -0.408103,0.025918,0.176376,-0.443576,0.025918,0.176376,-0.400980,-0.515410,0.052722,-0.519750,-0.064640,0.096402,\n\t\t          -0.443115,0.054057,0.043134,-0.334746,-0.379830,0.036477,-0.344878,-0.315070,-0.001040,-0.353078,-0.256128,-0.005869,\n\t\t          -0.411525,0.053841,0.088272,-0.468088,-0.515410,0.052722,-0.541156,-0.256128,-0.005869,-0.551772,-0.379830,0.036477,\n\t\t          -0.359951,-0.061926,0.011635,-0.515191,-0.060432,0.044878,-0.510890,-0.061926,0.011635,-0.444362,0.053841,0.088272,\n\t\t          -0.521139,-0.463987,0.029113,-0.352974,-0.463987,0.029113,-0.512273,-0.162540,0.000180,-0.365056,-0.162540,0.000180,\n\t\t          -0.498826,-0.007364,0.012911,-0.369027,-0.007364,0.012911,-0.467269,-0.511723,0.036784,-0.402774,-0.511723,0.036784,\n\t\t          -0.549227,-0.380046,0.017603,-0.337947,-0.380046,0.017603,-0.352057,-0.062490,0.044967,-0.352961,-0.099061,0.044535,\n\t\t          -0.341162,-0.096866,0.103899,-0.342366,-0.066930,0.099794,-0.437425,-0.491083,-0.008184,-0.447961,-0.361473,-0.040026,\n\t\t          -0.433624,0.029655,-0.040741,-0.439653,-0.185654,-0.030581,-0.434170,-0.520939,0.054861,-0.433738,-0.502541,0.094187,\n\t\t          -0.432149,-0.460201,0.109151,-0.378574,-0.481001,0.090195,-0.412883,-0.430896,0.113154,-0.349220,-0.171357,0.187132,\n\t\t          -0.339725,-0.072900,0.127546,-0.340126,-0.040045,0.135720,-0.341948,-0.022866,0.169622,-0.353394,-0.003566,0.183368,\n\t\t          -0.378239,0.021550,0.180211,-0.414921,0.038865,0.191413,-0.414952,0.057202,0.204104,-0.415500,0.075442,0.201368,\n\t\t          -0.415414,0.063768,0.193707,-0.415462,0.043704,0.179114,-0.449853,0.041252,0.160530,-0.429507,0.063499,0.042594,\n\t\t          -0.430045,0.066556,0.023032,-0.431020,0.055361,-0.014537,-0.435506,-0.518327,0.021756,-0.433957,-0.516483,0.074159,\n\t\t          -0.438739,-0.438944,-0.028176,-0.450484,-0.264692,-0.036543,-0.437337,-0.034992,-0.050334,-0.437518,-0.119187,-0.040906,\n\t\t          -0.362291,-0.251073,-0.018350,-0.360044,-0.061841,0.004874,-0.392874,0.041145,0.008093,-0.362639,-0.430317,-0.019637,\n\t\t          -0.383230,-0.499465,0.017313,-0.354965,-0.245178,-0.009607,-0.366182,-0.099785,0.000513,-0.376884,-0.101141,-0.034207,\n\t\t          -0.395936,0.028460,-0.034641,-0.343815,-0.323266,-0.004086,-0.355035,-0.468777,0.024304,-0.403826,-0.514672,0.032907,\n\t\t          -0.361079,-0.362110,-0.027935,-0.381904,-0.166999,-0.022996,-0.370150,-0.003403,0.006145,-0.402544,0.046934,-0.009073,\n\t\t          -0.392114,0.039105,0.018765,-0.383496,-0.031248,-0.044115,-0.375521,-0.267470,-0.027899,-0.380373,-0.481481,-0.002440,\n\t\t          -0.351120,-0.448603,0.002837,-0.388721,0.033248,-0.010254,-0.371431,-0.171841,-0.013222,-0.373404,-0.011520,-0.019266,\n\t\t          -0.418149,0.059970,0.003447,-0.365291,-0.052209,-0.019504,-0.381973,0.018194,-0.016945,-0.363811,-0.080665,-0.017980,\n\t\t          -0.370915,-0.121172,-0.013632,-0.365813,-0.101357,-0.011660,-0.414222,0.042494,-0.028065,-0.411224,0.006270,-0.047614,\n\t\t          -0.404251,-0.077079,-0.047023,-0.404007,-0.144932,-0.032132,-0.409223,-0.219598,-0.028447,-0.404228,-0.312181,-0.037960,\n\t\t          -0.395315,-0.401557,-0.032508,-0.399936,-0.463281,-0.018138,-0.410380,-0.505875,0.005246,-0.343117,-0.409808,-0.005999,\n\t\t          -0.351402,-0.307787,-0.020023,-0.343542,-0.366774,-0.006773,-0.418038,0.062278,0.029636,-0.416356,0.057488,0.041851,\n\t\t          -0.405283,0.052743,0.022220,-0.338452,-0.372498,0.011001,-0.372538,-0.493715,0.067384,-0.400658,-0.514005,0.061472,\n\t\t          -0.402229,-0.505800,0.082940,-0.407007,-0.482724,0.101550,-0.371963,-0.497929,0.048109,-0.390666,-0.447823,0.106295,\n\t\t          -0.351271,-0.410767,0.086392,-0.340129,-0.423117,0.059956,-0.350644,-0.466474,0.051273,-0.355363,-0.458494,0.074452,\n\t\t          -0.368442,-0.441816,0.096815,-0.337816,-0.427289,0.038431,-0.370924,-0.381413,0.112334,-0.339226,-0.139360,0.157720,\n\t\t          -0.341786,-0.370645,0.079784,-0.337566,-0.162146,0.125511,-0.341960,-0.239664,0.106548,-0.338845,-0.329072,0.070126,\n\t\t          -0.334908,-0.377718,0.048623,-0.364080,-0.174266,-0.004712,-0.343843,-0.293287,0.095471,-0.341521,-0.272042,0.077844,\n\t\t          -0.339221,-0.303666,0.052179,-0.340171,-0.207020,0.086803,-0.342685,-0.247397,0.055422,-0.339917,-0.117632,0.102503,\n\t\t          -0.343688,-0.160659,0.064294,-0.368640,-0.324245,0.129043,-0.350162,-0.324420,0.103489,-0.363347,-0.267205,0.150106,\n\t\t          -0.347643,-0.265564,0.119709,-0.342928,-0.208195,0.135566,-0.356491,-0.212694,0.171346,-0.344443,-0.181270,0.165327,\n\t\t          -0.351822,-0.238793,0.144262,-0.357133,-0.293710,0.125969,-0.358226,-0.361092,0.105948,-0.354308,-0.036329,0.045811,\n\t\t          -0.347695,-0.063698,0.067872,-0.343148,-0.047132,0.100548,-0.374221,0.027568,0.093504,-0.358271,-0.211746,-0.001031,\n\t\t          -0.396352,0.046860,0.077435,-0.354315,-0.014954,0.074835,-0.408792,0.050895,0.111936,-0.350987,-0.007624,0.117607,\n\t\t          -0.348735,-0.002922,0.152129,-0.371229,0.028728,0.131967,-0.374568,0.030637,0.159156,-0.391437,0.043451,0.136674,\n\t\t          -0.434756,0.045994,0.143678,-0.390932,0.034712,0.172234,-0.361187,0.014790,0.174284,-0.348218,-0.002733,0.171931,\n\t\t          -0.403878,0.041252,0.160530,-0.488264,-0.481001,0.089889,-0.448569,-0.430887,0.113515,-0.507261,-0.171346,0.176487,\n\t\t          -0.515662,-0.081187,0.045093,-0.520853,-0.070763,0.121883,-0.517185,-0.040045,0.125665,-0.513349,-0.022866,0.158478,\n\t\t          -0.500442,-0.003566,0.180049,-0.474451,0.021610,0.180251,-0.531726,-0.251073,-0.018350,-0.511899,-0.061841,0.004874,\n\t\t          -0.470919,0.041145,0.008093,-0.518856,-0.430317,-0.019637,-0.489733,-0.499465,0.017313,-0.537446,-0.245178,-0.009607,\n\t\t          -0.505897,-0.099785,0.000513,-0.499147,-0.101141,-0.034207,-0.467729,0.028460,-0.034641,-0.551995,-0.323266,-0.004086,\n\t\t          -0.519499,-0.468777,0.024304,-0.466572,-0.514672,0.032907,-0.530862,-0.362110,-0.027935,-0.495664,-0.166999,-0.022996,\n\t\t          -0.497561,-0.003403,0.006145,-0.459973,0.046934,-0.009073,-0.471584,0.039105,0.018765,-0.488872,-0.031248,-0.044115,\n\t\t          -0.522122,-0.267470,-0.027899,-0.496646,-0.481481,-0.002440,-0.529080,-0.448603,0.002837,-0.475320,0.033248,-0.010254,\n\t\t          -0.507408,-0.171841,-0.013222,-0.494767,-0.011520,-0.019266,-0.443167,0.059970,0.003447,-0.509378,-0.052209,-0.019504,\n\t\t          -0.483095,0.018194,-0.016945,-0.511996,-0.080665,-0.017980,-0.502388,-0.121172,-0.013632,-0.507134,-0.101357,-0.011660,\n\t\t          -0.449169,0.042494,-0.028065,-0.457875,0.006270,-0.047614,-0.472636,-0.077079,-0.047023,-0.470184,-0.144932,-0.032132,\n\t\t          -0.480025,-0.219598,-0.028447,-0.498347,-0.312181,-0.037960,-0.488178,-0.401557,-0.032508,-0.477840,-0.463281,-0.018138,\n\t\t          -0.462861,-0.505875,0.005246,-0.540165,-0.409808,-0.005999,-0.547323,-0.307787,-0.020023,-0.548474,-0.366774,-0.006773,\n\t\t          -0.442256,0.062278,0.029636,-0.443273,0.057488,0.042014,-0.456598,0.052743,0.022220,-0.550751,-0.372498,0.011001,\n\t\t          -0.498004,-0.493715,0.067384,-0.468058,-0.514005,0.061472,-0.466027,-0.505800,0.082940,-0.457774,-0.482724,0.101638,\n\t\t          -0.498862,-0.497929,0.048109,-0.471866,-0.447935,0.106277,-0.526381,-0.410767,0.082224,-0.538221,-0.423117,0.058792,\n\t\t          -0.522517,-0.466474,0.051273,-0.517091,-0.458494,0.074146,-0.499421,-0.441816,0.094991,-0.541248,-0.427289,0.038431,\n\t\t          -0.502680,-0.381474,0.104517,-0.520630,-0.139360,0.150513,-0.543941,-0.370645,0.071325,-0.525262,-0.162146,0.115942,\n\t\t          -0.538858,-0.239664,0.091409,-0.553100,-0.329072,0.061975,-0.348776,-0.291849,-0.007987,-0.551522,-0.377718,0.047459,\n\t\t          -0.515060,-0.174266,-0.004712,-0.547090,-0.293287,0.079106,-0.549242,-0.272042,0.068712,-0.548414,-0.291849,-0.007987,\n\t\t          -0.555598,-0.303666,0.049850,-0.528047,-0.211746,-0.001031,-0.535846,-0.207020,0.079377,-0.546260,-0.247397,0.053277,\n\t\t          -0.522577,-0.117060,0.098787,-0.526256,-0.160470,0.062839,-0.513048,-0.323713,0.111723,-0.539590,-0.324420,0.086818,\n\t\t          -0.511066,-0.266979,0.133082,-0.537218,-0.265564,0.101015,-0.527357,-0.208195,0.120285,-0.504932,-0.212602,0.156304,\n\t\t          -0.517201,-0.181270,0.153695,-0.522968,-0.238790,0.126749,-0.529267,-0.293585,0.107229,-0.525078,-0.361076,0.094372,\n\t\t          -0.511783,-0.035814,0.045789,-0.356158,-0.162697,0.023356,-0.517546,-0.046560,0.096725,-0.482799,0.027568,0.092417,\n\t\t          -0.461229,0.046860,0.077435,-0.507074,-0.014954,0.073370,-0.445401,0.050895,0.111936,-0.505591,-0.007624,0.110707,\n\t\t          -0.506524,-0.002922,0.144630,-0.483628,0.028728,0.130880,-0.479895,0.030637,0.159156,-0.462542,0.043451,0.136674,\n\t\t          -0.462472,0.034712,0.172234,-0.493042,0.014790,0.173670,-0.506836,-0.002733,0.167408,-0.491939,-0.413902,0.102898,\n\t\t          -0.376925,-0.413709,0.105328,-0.418609,0.027540,0.177178,-0.411098,-0.414042,0.108502,-0.393210,-0.391827,0.109689,\n\t\t          -0.387993,-0.342071,0.122360,-0.367423,-0.194804,0.192028,-0.380183,-0.237583,0.170093,-0.385770,-0.292473,0.142243,\n\t\t          -0.451208,-0.414591,0.109368,-0.472433,-0.392612,0.110198,-0.482893,-0.342172,0.113920,-0.485213,-0.194017,0.178928,\n\t\t          -0.477498,-0.237463,0.158387,-0.484962,-0.292672,0.130588,-0.492463,-0.266622,0.147468,-0.493954,-0.321211,0.123545,\n\t\t          -0.484326,-0.213204,0.172356,-0.490057,-0.182725,0.183640,-0.485337,-0.368284,0.115232,-0.463834,-0.412138,0.113929,\n\t\t          -0.430482,-0.424572,0.114652,-0.378113,-0.320236,0.134346,-0.372754,-0.266604,0.161284,-0.368532,-0.213902,0.186240,\n\t\t          -0.360929,-0.183389,0.196865,-0.380502,-0.368381,0.120886,-0.397385,-0.412812,0.113307,-0.476621,-0.181531,0.187307,\n\t\t          -0.451356,-0.214716,0.181928,-0.459457,-0.267046,0.151524,-0.463437,-0.319075,0.126633,-0.456961,-0.362857,0.116423,\n\t\t          -0.455488,-0.391533,0.108771,-0.408296,-0.391475,0.111283,-0.374286,-0.181635,0.197775,-0.399551,-0.214784,0.188183,\n\t\t          -0.403687,-0.267047,0.158235,-0.408332,-0.319060,0.132892,-0.409537,-0.362823,0.119831,-0.427430,-0.241151,0.174611,\n\t\t          -0.434279,-0.295175,0.145005,-0.424990,-0.196962,0.203366,-0.434459,-0.342316,0.126606,-0.431719,-0.387434,0.115694,\n\t\t          -0.405143,-0.182992,0.209520,-0.445612,-0.182992,0.205259,-0.467272,-0.193845,0.187177,-0.382989,-0.193994,0.196633,\n\t\t          -0.356662,-0.156187,0.181455,-0.349551,-0.081613,0.136450,-0.348354,-0.048948,0.142443,-0.350566,-0.033484,0.165001,\n\t\t          -0.361406,-0.014928,0.178217,-0.384000,0.007962,0.175924,-0.349088,-0.123855,0.156655,-0.498378,-0.156263,0.172867,\n\t\t          -0.510651,-0.081613,0.131223,-0.508223,-0.048948,0.132306,-0.504055,-0.033484,0.154286,-0.491408,-0.014928,0.175026,\n\t\t          -0.467348,0.007963,0.175924,-0.509934,-0.123855,0.151429,-0.439138,0.017885,0.172523,-0.485204,-0.168245,0.176644,\n\t\t          -0.366371,-0.168285,0.187493,-0.469960,-0.167857,0.180962,-0.380229,-0.167860,0.190036,-0.407807,-0.167856,0.201951,\n\t\t          -0.442240,-0.167856,0.198469,-0.484031,-0.174220,0.180212,-0.460490,-0.174303,0.195263,-0.343140,-0.036004,0.155980,\n\t\t          -0.349061,-0.022074,0.178037,-0.512748,-0.146696,0.167552,-0.342543,-0.104619,0.145769,-0.342399,-0.061129,0.136499,\n\t\t          -0.425381,-0.174303,0.209645,-0.390100,-0.174304,0.202399,-0.367685,-0.174598,0.191549,-0.346135,-0.146696,0.174121,\n\t\t          -0.447309,0.032789,0.177432,-0.456409,0.022614,0.176975,-0.484850,0.004336,0.181951,-0.505261,-0.022074,0.170850,\n\t\t          -0.512634,-0.036004,0.142251,-0.516140,-0.060868,0.129460,-0.367580,0.004336,0.182811,-0.395362,0.022614,0.176975,\n\t\t          -0.517450,-0.104359,0.140053,-0.437599,0.038865,0.191413,-0.437471,0.057202,0.204104,-0.437832,0.075442,0.201368,\n\t\t          -0.437895,0.063768,0.193707,-0.438088,0.043704,0.179114,-0.438206,0.037114,0.173786,-0.426873,0.040487,0.167736,\n\t\t          -0.426466,0.035279,0.181126,-0.426582,0.051183,0.188690,-0.426726,0.074257,0.196990,-0.426452,0.069149,0.204514,\n\t\t          -0.426066,0.045230,0.199836,-0.433168,0.027540,0.177178,-0.415442,0.037114,0.173786,-0.418607,0.045994,0.143678,\n\t\t          -0.405429,0.032789,0.177432,-0.339353,-0.092879,0.131489,-0.385788,0.034988,0.048020,-0.351328,-0.466774,0.037081,\n\t\t          -0.521781,-0.090742,0.125826,-0.520730,-0.080907,0.098543,-0.517162,-0.061625,0.066935,-0.358295,-0.100168,0.028523,\n\t\t          -0.518591,-0.095504,0.068945,-0.341519,-0.311330,0.018014,-0.427557,0.055890,0.093750,-0.362137,-0.035739,0.012187,\n\t\t          -0.336885,-0.336488,0.035007,-0.342951,-0.283984,0.030245,-0.347512,-0.210007,0.035872,-0.352988,-0.120201,0.042606,\n\t\t          -0.361660,-0.083733,0.009837,-0.369639,0.015476,0.057439,-0.348337,-0.253093,0.016042,-0.509841,-0.083733,0.009837,\n\t\t          -0.507541,-0.035739,0.012187,-0.555807,-0.336488,0.035007,-0.552219,-0.283984,0.030245,-0.535258,-0.209817,0.035775,\n\t\t          -0.335786,-0.380313,0.028459,-0.515608,-0.118550,0.042002,-0.492209,0.015476,0.057439,-0.401611,-0.514655,0.046222,\n\t\t          -0.363730,-0.008066,0.034723,-0.413490,0.054459,0.070310,-0.467840,-0.514655,0.046222,-0.522320,-0.466774,0.037081,\n\t\t          -0.551078,-0.380313,0.028459,-0.553949,-0.311330,0.018014,-0.543757,-0.253093,0.016042,-0.518569,-0.161560,0.022774,\n\t\t          -0.511130,-0.097101,0.027888,-0.513672,-0.060729,0.030999,-0.475833,0.034988,0.048020,-0.502107,-0.008066,0.034723,\n\t\t          -0.443984,0.054459,0.070310,-0.362959,-0.063565,0.013441,-0.356570,-0.255059,-0.002186,-0.368899,-0.100077,0.008031,\n\t\t          -0.348961,-0.313187,0.001953,-0.356593,-0.460846,0.028335,-0.404168,-0.507992,0.035387,-0.371549,-0.009800,0.014786,\n\t\t          -0.392825,0.032178,0.022392,-0.417033,0.050950,0.042601,-0.342202,-0.377725,0.018158,-0.367473,-0.162852,0.003337,\n\t\t          -0.507708,-0.063489,0.013437,-0.536851,-0.255059,-0.002186,-0.502602,-0.100001,0.008027,-0.546616,-0.313187,0.001953,\n\t\t          -0.517558,-0.460846,0.028335,-0.465883,-0.507992,0.035387,-0.496253,-0.009800,0.014786,-0.471117,0.032178,0.022392,\n\t\t          -0.442873,0.050950,0.042695,-0.545014,-0.377725,0.018158,-0.509229,-0.162852,0.003337,-0.362937,-0.162688,0.016139,\n\t\t          -0.390074,0.030583,0.036458,-0.356198,-0.460659,0.032482,-0.364780,-0.100472,0.020590,-0.347621,-0.310219,0.012950,\n\t\t          -0.354396,-0.252892,0.010446,-0.341617,-0.376641,0.024251,-0.403721,-0.507570,0.039927,-0.369050,-0.011456,0.026538,\n\t\t          -0.415606,0.049522,0.055521,-0.465990,-0.507570,0.039927,-0.517738,-0.460659,0.032482,-0.545543,-0.376641,0.024251,\n\t\t          -0.547674,-0.310219,0.012950,-0.537736,-0.252892,0.010446,-0.512302,-0.162498,0.016042,-0.505429,-0.099558,0.020462,\n\t\t          -0.508777,-0.063682,0.024028,-0.472770,0.030583,0.036458,-0.497675,-0.011456,0.026538,-0.443355,0.049522,0.055641,\n\t\t          -0.341311,-0.339800,0.009360,-0.429350,0.057044,0.045809,-0.457654,0.046328,0.030062,-0.404050,0.046328,0.030062,\n\t\t          -0.551323,-0.339800,0.009360,-0.486536,0.017985,0.015303,-0.379259,0.017985,0.015303,-0.503896,-0.120839,0.001178,\n\t\t          -0.369338,-0.120839,0.001178,-0.539773,-0.425033,0.024063,-0.497046,-0.493889,0.033204,-0.374516,-0.493889,0.033204,\n\t\t          -0.340126,-0.425033,0.024063,-0.434706,-0.517623,0.038447,-0.352126,-0.084464,0.045323,-0.355152,-0.062659,0.031052,\n\t\t          -0.360792,-0.064407,0.024059,-0.346556,-0.097766,0.069979,-0.342264,-0.084342,0.102121,-0.371686,-0.496729,0.056704,\n\t\t          -0.394785,-0.418441,0.112145,-0.342827,-0.157565,0.173767,-0.337840,-0.115617,0.138055,-0.339601,-0.055392,0.127646,\n\t\t          -0.341075,-0.025664,0.151772,-0.346178,-0.014957,0.178497,-0.364068,0.010186,0.182839,-0.393047,0.029536,0.177738,\n\t\t          -0.359224,-0.400182,-0.023419,-0.373616,-0.072181,-0.039514,-0.375619,-0.124243,-0.024284,-0.390883,-0.496750,0.006250,\n\t\t          -0.369083,-0.456332,-0.011685,-0.378442,-0.216258,-0.021413,-0.388082,0.008687,-0.039518,-0.380824,0.025025,0.007711,\n\t\t          -0.350132,-0.290861,-0.014858,-0.338731,-0.423970,0.016549,-0.376233,-0.497586,0.029154,-0.361288,-0.318067,-0.028297,\n\t\t          -0.406219,0.053623,0.009515,-0.361555,-0.085481,0.002053,-0.398826,0.038418,-0.022690,-0.370085,-0.124860,-0.005300,\n\t\t          -0.363082,-0.033566,0.002344,-0.404187,0.049786,0.027839,-0.340866,-0.344777,0.005726,-0.383861,-0.468395,0.099689,\n\t\t          -0.374756,-0.488576,0.078948,-0.338172,-0.425912,0.047729,-0.361344,-0.402263,0.098795,-0.344293,-0.418277,0.073411,\n\t\t          -0.349579,-0.039670,0.068753,-0.339896,-0.206482,0.114023,-0.343382,-0.325635,0.088745,-0.336656,-0.333200,0.051068,\n\t\t          -0.358622,-0.210629,-0.005140,-0.343242,-0.266872,0.101044,-0.341629,-0.278578,0.053211,-0.342970,-0.208598,0.059041,\n\t\t          -0.345474,-0.118681,0.068751,-0.358691,-0.324222,0.116059,-0.354466,-0.266227,0.135392,-0.348640,-0.210711,0.153817,\n\t\t          -0.362414,0.008207,0.083843,-0.389795,0.043748,0.107047,-0.357913,0.015234,0.158325,-0.390004,0.039048,0.159025,\n\t\t          -0.415107,0.037084,0.186162,-0.441823,-0.404995,-0.034970,-0.435545,0.005317,-0.048341,-0.445022,-0.220697,-0.031218,\n\t\t          -0.431980,0.044259,-0.028988,-0.436383,-0.509382,0.005466,-0.433977,-0.519397,0.063691,-0.433204,-0.486827,0.102250,\n\t\t          -0.431003,-0.434401,0.113938,-0.498868,-0.496729,0.056704,-0.467832,-0.419158,0.111137,-0.516586,-0.157565,0.165695,\n\t\t          -0.522418,-0.115275,0.131800,-0.519383,-0.054858,0.121125,-0.514745,-0.025664,0.138560,-0.508505,-0.014957,0.171716,\n\t\t          -0.489100,0.010186,0.182009,-0.459528,0.029536,0.177738,-0.414764,0.045230,0.199836,-0.415276,0.069149,0.204514,\n\t\t          -0.415567,0.074257,0.196990,-0.415293,0.051183,0.188690,-0.415626,0.041242,0.173186,-0.426751,0.052108,0.119996,\n\t\t          -0.429391,0.060594,0.045403,-0.429700,0.065554,0.037128,-0.430485,0.062835,0.002755,-0.434908,-0.520285,0.034508,\n\t\t          -0.433935,-0.511198,0.084810,-0.438015,-0.466560,-0.019347,-0.452252,-0.313123,-0.041248,-0.438246,-0.080188,-0.047571,\n\t\t          -0.436960,-0.153755,-0.034016,-0.524548,-0.400182,-0.023419,-0.504071,-0.072181,-0.039514,-0.498062,-0.124243,-0.024284,\n\t\t          -0.483520,-0.496750,0.006250,-0.511345,-0.456332,-0.011685,-0.509169,-0.216258,-0.021413,-0.477566,0.008687,-0.039518,\n\t\t          -0.484735,0.025025,0.007711,-0.547708,-0.290861,-0.014858,-0.542419,-0.423970,0.016549,-0.495700,-0.497586,0.029154,\n\t\t          -0.537941,-0.318067,-0.028297,-0.455883,0.053623,0.009515,-0.510877,-0.085481,0.002053,-0.464159,0.038418,-0.022690,\n\t\t          -0.503726,-0.124860,-0.005300,-0.507372,-0.033566,0.002344,-0.457597,0.049786,0.027839,-0.552068,-0.344777,0.005726,\n\t\t          -0.480001,-0.468395,0.099343,-0.494919,-0.488576,0.078872,-0.540553,-0.425912,0.047438,-0.514476,-0.402294,0.093662,\n\t\t          -0.533842,-0.418277,0.070913,-0.513986,-0.039152,0.067775,-0.532308,-0.206482,0.100920,-0.547469,-0.325635,0.074388,\n\t\t          -0.555894,-0.333200,0.049031,-0.527152,-0.210629,-0.005140,-0.543886,-0.266872,0.084955,-0.552187,-0.278578,0.050928,\n\t\t          -0.537278,-0.208551,0.057160,-0.520205,-0.117879,0.067654,-0.528872,-0.324157,0.099191,-0.526883,-0.266188,0.116932,\n\t\t          -0.518969,-0.210711,0.138422,-0.496612,0.008207,0.082118,-0.465284,0.043748,0.106873,-0.497314,0.015234,0.156731,\n\t\t          -0.463878,0.039048,0.159025,-0.400267,-0.406989,0.109586,-0.390151,-0.367947,0.114807,-0.374995,-0.210172,0.185107,\n\t\t          -0.365975,-0.183044,0.194300,-0.382863,-0.265238,0.155937,-0.387734,-0.318412,0.130467,-0.431033,-0.412878,0.109460,\n\t\t          -0.463274,-0.407268,0.110940,-0.477122,-0.368289,0.109909,-0.476794,-0.209614,0.172786,-0.486150,-0.182774,0.182226,\n\t\t          -0.481864,-0.265246,0.144073,-0.485562,-0.318671,0.120024,-0.425433,-0.183192,0.211205,-0.425103,-0.216114,0.189908,\n\t\t          -0.431092,-0.268646,0.159102,-0.435474,-0.319983,0.133711,-0.432901,-0.364142,0.121372,-0.387276,-0.182416,0.203776,\n\t\t          -0.463376,-0.182405,0.195826,-0.351623,-0.142245,0.170431,-0.348763,-0.102983,0.144025,-0.348614,-0.062637,0.135425,\n\t\t          -0.348933,-0.039559,0.153602,-0.354336,-0.026636,0.174064,-0.373261,-0.000815,0.179971,-0.390520,0.011381,0.175110,\n\t\t          -0.362292,-0.165107,0.187778,-0.506528,-0.142245,0.164337,-0.510739,-0.102983,0.138798,-0.509520,-0.062637,0.128971,\n\t\t          -0.506477,-0.039559,0.140866,-0.499530,-0.026636,0.167396,-0.480444,-0.002137,0.177695,-0.453222,0.014820,0.173078,\n\t\t          -0.489430,-0.165552,0.177395,-0.371574,-0.167946,0.185741,-0.479068,-0.167908,0.175081,-0.425054,-0.167856,0.203386,\n\t\t          -0.392285,-0.167856,0.196664,-0.457762,-0.167856,0.190044,-0.437784,0.037084,0.186162,-0.437413,0.045230,0.199836,\n\t\t          -0.437668,0.069149,0.204514,-0.437924,0.074257,0.196990,-0.437898,0.051183,0.188690,-0.438267,0.041242,0.173186,\n\t\t          -0.425168,0.018469,0.172818,-0.340229,-0.083818,0.122554,-0.347301,-0.084057,0.069259,-0.355851,-0.085121,0.030601,\n\t\t          -0.381282,0.015193,0.017182,-0.352649,-0.290178,-0.004094,-0.521586,-0.081017,0.117346,-0.513526,-0.081941,0.030375,\n\t\t          -0.405087,0.043361,0.030796,-0.365030,-0.037739,0.013955,-0.518198,-0.080900,0.068207,-0.371509,-0.121642,0.004330,\n\t\t          -0.434379,-0.520341,0.048200,-0.510292,-0.035444,0.031775,-0.428240,0.056880,0.076823,-0.344333,-0.422298,0.023793,\n\t\t          -0.372829,-0.496998,0.041959,-0.338513,-0.426905,0.032333,-0.338352,-0.338090,0.024129,-0.344971,-0.287257,0.014018,\n\t\t          -0.351763,-0.210890,0.020388,-0.359490,-0.121471,0.025786,-0.357378,-0.035926,0.031789,-0.373504,0.016910,0.040063,\n\t\t          -0.377149,-0.490400,0.032096,-0.399468,0.047170,0.058225,-0.498289,-0.496998,0.041959,-0.540870,-0.426905,0.032333,\n\t\t          -0.554143,-0.338090,0.024129,-0.550926,-0.287257,0.014018,-0.532153,-0.210606,0.020243,-0.345514,-0.337799,0.011016,\n\t\t          -0.511079,-0.119283,0.024900,-0.490244,0.016910,0.040063,-0.364492,-0.085078,0.011911,-0.460021,0.047170,0.058225,\n\t\t          -0.361198,-0.211420,0.002137,-0.429569,0.053846,0.045416,-0.434722,-0.513797,0.036916,-0.484571,0.015193,0.017182,\n\t\t          -0.543947,-0.290178,-0.004094,-0.535710,-0.422298,0.023793,-0.494365,-0.490400,0.032096,-0.506757,-0.084963,0.011905,\n\t\t          -0.501291,-0.121623,0.004329,-0.504519,-0.037720,0.013954,-0.456881,0.043361,0.030796,-0.547012,-0.337799,0.011016,\n\t\t          -0.524253,-0.211420,0.002137,-0.361729,-0.085801,0.023230,-0.508354,-0.084667,0.023160,-0.434537,-0.513212,0.041539,\n\t\t          -0.505587,-0.038610,0.024632,-0.429058,0.052070,0.060150,-0.376592,-0.490201,0.036454,-0.344040,-0.421841,0.028314,\n\t\t          -0.344419,-0.335840,0.019421,-0.351025,-0.286872,0.008679,-0.358043,-0.210692,0.014263,-0.366421,-0.121680,0.017704,\n\t\t          -0.362874,-0.038791,0.024640,-0.378468,0.013151,0.030297,-0.402788,0.042240,0.044952,-0.494656,-0.490201,0.036454,\n\t\t          -0.535858,-0.421841,0.028314,-0.547922,-0.335840,0.019421,-0.544832,-0.286872,0.008679,-0.525941,-0.210645,0.014239,\n\t\t          -0.504939,-0.121215,0.017551,-0.486323,0.013151,0.030297,-0.458086,0.042240,0.044952,0.367310,-0.105172,-0.007174,\n\t\t          0.363726,-0.474855,0.011151,0.347086,-0.429383,-0.007041,0.374978,0.002718,-0.009041,0.363082,-0.210431,-0.011262,\n\t\t          0.371540,-0.031511,-0.029190,0.393128,0.040113,-0.002874,0.413063,0.029280,-0.039973,0.373388,-0.149363,-0.016975,\n\t\t          0.362189,-0.065672,-0.009992,0.387246,0.027500,-0.021720,0.415800,0.052724,-0.013081,0.365938,-0.094377,-0.022050,\n\t\t          0.407603,-0.033349,-0.049801,0.403217,-0.112419,-0.039772,0.406302,-0.180179,-0.028191,0.399050,-0.359157,-0.037026,\n\t\t          0.395700,-0.435380,-0.026316,0.406306,-0.487914,-0.007664,0.407957,-0.513759,0.020732,0.408470,-0.264630,-0.033402,\n\t\t          0.343345,-0.344143,-0.004805,0.360326,-0.276235,-0.023958,0.344615,-0.380232,-0.012662,0.421521,0.064236,0.019986,\n\t\t          0.395551,0.044071,0.015728,0.401044,-0.511024,0.071991,0.404306,-0.497664,0.092982,0.410128,-0.456768,0.108352,\n\t\t          0.352076,-0.463624,0.062237,0.361006,-0.450520,0.086650,0.350565,-0.467605,0.042827,0.377661,-0.397656,0.110945,\n\t\t          0.366462,-0.098970,0.005374,0.337165,-0.374555,0.063947,0.339785,-0.308519,0.032064,0.340610,-0.297798,0.074410,\n\t\t          0.345493,-0.250940,0.032144,0.341255,-0.243113,0.081479,0.350289,-0.161805,0.039539,0.339134,-0.159772,0.095308,\n\t\t          0.351840,-0.189209,0.181216,0.360093,-0.239102,0.160788,0.366724,-0.295445,0.139709,0.368804,-0.354767,0.118948,\n\t\t          0.349041,-0.366287,0.093466,0.349421,-0.292504,0.112077,0.345624,-0.238624,0.126865,0.339516,-0.170787,0.147835,\n\t\t          0.505361,-0.098970,0.005374,0.416589,0.060128,0.037605,0.382036,0.034113,0.066838,0.360246,-0.009172,0.050199,\n\t\t          0.345575,-0.027450,0.108011,0.360728,0.012604,0.124757,0.378589,0.036241,0.141741,0.426742,0.044130,0.150963,\n\t\t          0.352789,0.003146,0.177336,0.344162,-0.011153,0.167152,0.375259,0.026254,0.172641,0.405785,0.046235,0.138117,\n\t\t          0.504946,-0.105172,-0.007174,0.512309,-0.474855,0.011151,0.534861,-0.429383,-0.007041,0.491784,0.002718,-0.009041,\n\t\t          0.522398,-0.210431,-0.011262,0.500176,-0.031511,-0.029190,0.470462,0.040113,-0.002874,0.452619,0.029280,-0.039973,\n\t\t          0.502562,-0.149363,-0.016975,0.512530,-0.065672,-0.009992,0.476635,0.027500,-0.021719,0.446285,0.052724,-0.013081,\n\t\t          0.509252,-0.094377,-0.022050,0.466176,-0.033349,-0.049801,0.472366,-0.112419,-0.039772,0.472308,-0.180179,-0.028191,\n\t\t          0.495390,-0.359157,-0.037026,0.482979,-0.435380,-0.026316,0.469635,-0.487914,-0.007664,0.463471,-0.513759,0.020732,\n\t\t          0.491156,-0.264630,-0.033402,0.551514,-0.344143,-0.004805,0.537894,-0.276235,-0.023958,0.544136,-0.380232,-0.012662,\n\t\t          0.438996,0.064236,0.019986,0.467768,0.044071,0.015728,0.467640,-0.511024,0.071991,0.462408,-0.497664,0.092982,\n\t\t          0.391313,0.035093,0.020855,0.452953,-0.456766,0.108658,0.521051,-0.463624,0.062237,0.509390,-0.450520,0.085424,\n\t\t          0.522818,-0.467605,0.042827,0.488729,-0.434438,0.101795,0.472464,0.035093,0.020855,0.548926,-0.374555,0.059289,\n\t\t          0.555545,-0.308519,0.032064,0.552555,-0.297798,0.065093,0.545530,-0.250940,0.032144,0.543779,-0.243113,0.072898,\n\t\t          0.522654,-0.161047,0.039151,0.526827,-0.159772,0.089875,0.505858,-0.189251,0.168395,0.507446,-0.239029,0.144560,\n\t\t          0.513283,-0.294834,0.121408,0.535972,-0.366287,0.082924,0.539882,-0.292504,0.093199,0.532670,-0.238624,0.109213,\n\t\t          0.522792,-0.170787,0.136724,0.514699,-0.096245,0.044059,0.550889,-0.315070,-0.001040,0.521382,-0.094576,0.100507,\n\t\t          0.443327,0.060128,0.037647,0.477592,0.034113,0.066838,0.503863,-0.009172,0.050199,0.416394,0.054057,0.042991,\n\t\t          0.513036,-0.027450,0.102153,0.494627,0.012604,0.120409,0.475923,0.036241,0.141741,0.449585,0.037335,0.172893,\n\t\t          0.501672,0.003146,0.174877,0.511183,-0.011153,0.158895,0.478449,0.026254,0.172641,0.491363,-0.397979,0.106245,\n\t\t          0.377166,-0.434402,0.103011,0.509667,-0.354669,0.106289,0.426086,0.029886,0.178311,0.494747,-0.294860,0.134381,\n\t\t          0.486699,-0.238081,0.160583,0.488261,-0.195362,0.180603,0.491546,-0.345071,0.117835,0.475616,-0.392012,0.114100,\n\t\t          0.448002,-0.422455,0.114543,0.375497,-0.293760,0.147192,0.370999,-0.238434,0.174138,0.364497,-0.196155,0.194148,\n\t\t          0.378219,-0.344999,0.126658,0.386823,-0.392642,0.115758,0.413130,-0.422337,0.113530,0.400577,-0.239511,0.173230,\n\t\t          0.406717,-0.293847,0.144354,0.478236,-0.190163,0.183190,0.461579,-0.341855,0.120165,0.403935,-0.398935,0.108428,\n\t\t          0.459925,-0.399252,0.107602,0.415271,-0.382627,0.115597,0.455300,-0.239499,0.166621,0.462717,-0.293851,0.137624,\n\t\t          0.408112,-0.341844,0.125157,0.448817,-0.382638,0.113411,0.402009,-0.196176,0.201513,0.372288,-0.190650,0.194643,\n\t\t          0.447899,-0.196165,0.196262,0.473790,-0.174295,0.185651,0.344976,-0.029456,0.168267,0.504072,-0.161715,0.176631,\n\t\t          0.342564,-0.082324,0.137942,0.443833,-0.174303,0.204345,0.377004,-0.174348,0.195411,0.351672,-0.161726,0.186016,\n\t\t          0.447766,0.046235,0.138117,0.496586,-0.009453,0.179074,0.343287,-0.126872,0.159271,0.514468,-0.046125,0.133024,\n\t\t          0.488581,-0.174076,0.182074,0.356698,-0.009453,0.182514,0.342449,-0.046125,0.143951,0.363077,-0.174533,0.193953,\n\t\t          0.406842,-0.174303,0.208098,0.403919,0.037335,0.172893,0.470806,0.015222,0.180042,0.510076,-0.029456,0.156718,\n\t\t          0.381122,0.015137,0.179986,0.518255,-0.081281,0.131983,0.516339,-0.126872,0.153637,0.426846,0.037041,0.174084,\n\t\t          0.426753,0.043704,0.179114,0.426633,0.063768,0.193707,0.426647,0.075442,0.201368,0.426189,0.057202,0.204104,\n\t\t          0.426252,0.038865,0.191413,0.408103,0.025918,0.176376,0.443576,0.025918,0.176376,0.400980,-0.515410,0.052722,\n\t\t          0.519750,-0.064640,0.096402,0.443115,0.054057,0.043134,0.334746,-0.379830,0.036477,0.344878,-0.315070,-0.001040,\n\t\t          0.353078,-0.256128,-0.005869,0.411525,0.053841,0.088272,0.468088,-0.515410,0.052722,0.541156,-0.256128,-0.005869,\n\t\t          0.551772,-0.379830,0.036477,0.359951,-0.061926,0.011635,0.515191,-0.060432,0.044878,0.510890,-0.061926,0.011635,\n\t\t          0.444362,0.053841,0.088272,0.521139,-0.463987,0.029113,0.352974,-0.463987,0.029113,0.512273,-0.162540,0.000180,\n\t\t          0.365056,-0.162540,0.000180,0.498826,-0.007364,0.012911,0.369027,-0.007364,0.012911,0.467269,-0.511723,0.036784,\n\t\t          0.402774,-0.511723,0.036784,0.549227,-0.380046,0.017603,0.337947,-0.380046,0.017603,0.352057,-0.062490,0.044967,\n\t\t          0.352961,-0.099061,0.044535,0.341162,-0.096866,0.103899,0.342366,-0.066930,0.099794,0.437425,-0.491083,-0.008184,\n\t\t          0.447961,-0.361473,-0.040026,0.433624,0.029655,-0.040741,0.439653,-0.185654,-0.030581,0.434170,-0.520939,0.054861,\n\t\t          0.433738,-0.502541,0.094187,0.432149,-0.460201,0.109151,0.378574,-0.481001,0.090195,0.412883,-0.430896,0.113154,\n\t\t          0.349220,-0.171357,0.187132,0.339725,-0.072900,0.127546,0.340126,-0.040045,0.135720,0.341948,-0.022866,0.169622,\n\t\t          0.353394,-0.003566,0.183368,0.378239,0.021550,0.180211,0.414921,0.038865,0.191413,0.414952,0.057202,0.204104,\n\t\t          0.415500,0.075442,0.201368,0.415414,0.063768,0.193707,0.415462,0.043704,0.179114,0.449853,0.041252,0.160530,\n\t\t          0.429507,0.063499,0.042594,0.430045,0.066556,0.023032,0.431020,0.055361,-0.014537,0.435506,-0.518327,0.021756,\n\t\t          0.433957,-0.516483,0.074159,0.438739,-0.438944,-0.028176,0.450484,-0.264692,-0.036543,0.437337,-0.034992,-0.050334,\n\t\t          0.437518,-0.119187,-0.040906,0.362291,-0.251073,-0.018350,0.360044,-0.061841,0.004874,0.392874,0.041145,0.008093,\n\t\t          0.362639,-0.430317,-0.019637,0.383230,-0.499465,0.017313,0.354965,-0.245178,-0.009607,0.366182,-0.099785,0.000513,\n\t\t          0.376884,-0.101141,-0.034207,0.395936,0.028460,-0.034641,0.343815,-0.323266,-0.004086,0.355035,-0.468777,0.024304,\n\t\t          0.403826,-0.514672,0.032907,0.361079,-0.362110,-0.027935,0.381904,-0.166999,-0.022996,0.370150,-0.003403,0.006145,\n\t\t          0.402544,0.046934,-0.009073,0.392114,0.039105,0.018765,0.383496,-0.031248,-0.044115,0.375521,-0.267470,-0.027899,\n\t\t          0.380373,-0.481481,-0.002440,0.351120,-0.448603,0.002837,0.388721,0.033248,-0.010254,0.371431,-0.171841,-0.013222,\n\t\t          0.373404,-0.011520,-0.019266,0.418149,0.059970,0.003447,0.365291,-0.052209,-0.019504,0.381973,0.018194,-0.016945,\n\t\t          0.363811,-0.080665,-0.017980,0.370915,-0.121172,-0.013632,0.365813,-0.101357,-0.011660,0.414222,0.042494,-0.028065,\n\t\t          0.411224,0.006270,-0.047614,0.404251,-0.077079,-0.047023,0.404007,-0.144932,-0.032132,0.409223,-0.219598,-0.028447,\n\t\t          0.404228,-0.312181,-0.037960,0.395315,-0.401557,-0.032508,0.399936,-0.463281,-0.018138,0.410380,-0.505875,0.005246,\n\t\t          0.343117,-0.409808,-0.005999,0.351402,-0.307787,-0.020023,0.343542,-0.366774,-0.006773,0.418038,0.062278,0.029636,\n\t\t          0.416356,0.057488,0.041851,0.405283,0.052743,0.022220,0.338452,-0.372498,0.011001,0.372538,-0.493715,0.067384,\n\t\t          0.400658,-0.514005,0.061472,0.402229,-0.505800,0.082940,0.407007,-0.482724,0.101550,0.371963,-0.497929,0.048109,\n\t\t          0.390666,-0.447823,0.106295,0.351271,-0.410767,0.086392,0.340129,-0.423117,0.059956,0.350644,-0.466474,0.051273,\n\t\t          0.355363,-0.458494,0.074452,0.368442,-0.441816,0.096815,0.337816,-0.427289,0.038431,0.370924,-0.381413,0.112334,\n\t\t          0.339226,-0.139360,0.157720,0.341786,-0.370645,0.079784,0.337566,-0.162146,0.125511,0.341960,-0.239664,0.106548,\n\t\t          0.338845,-0.329072,0.070126,0.334908,-0.377718,0.048623,0.364080,-0.174266,-0.004712,0.343843,-0.293287,0.095471,\n\t\t          0.341521,-0.272042,0.077844,0.339221,-0.303666,0.052179,0.340171,-0.207020,0.086803,0.342685,-0.247397,0.055422,\n\t\t          0.339917,-0.117632,0.102503,0.343688,-0.160659,0.064294,0.368640,-0.324245,0.129043,0.350162,-0.324420,0.103489,\n\t\t          0.363347,-0.267205,0.150106,0.347643,-0.265564,0.119709,0.342928,-0.208195,0.135566,0.356491,-0.212694,0.171346,\n\t\t          0.344443,-0.181270,0.165327,0.351822,-0.238793,0.144262,0.357133,-0.293710,0.125969,0.358226,-0.361092,0.105948,\n\t\t          0.354308,-0.036329,0.045811,0.347695,-0.063698,0.067872,0.343148,-0.047132,0.100548,0.374221,0.027568,0.093504,\n\t\t          0.358271,-0.211746,-0.001031,0.396352,0.046860,0.077435,0.354315,-0.014954,0.074835,0.408792,0.050895,0.111936,\n\t\t          0.350987,-0.007624,0.117607,0.348735,-0.002922,0.152129,0.371229,0.028728,0.131967,0.374568,0.030637,0.159156,\n\t\t          0.391437,0.043451,0.136674,0.434756,0.045994,0.143678,0.390932,0.034712,0.172234,0.361187,0.014790,0.174284,\n\t\t          0.348218,-0.002733,0.171931,0.403878,0.041252,0.160530,0.488264,-0.481001,0.089889,0.448569,-0.430887,0.113515,\n\t\t          0.507261,-0.171346,0.176487,0.515662,-0.081187,0.045093,0.520853,-0.070763,0.121883,0.517185,-0.040045,0.125665,\n\t\t          0.513349,-0.022866,0.158478,0.500442,-0.003566,0.180049,0.474451,0.021610,0.180251,0.531726,-0.251073,-0.018350,\n\t\t          0.511899,-0.061841,0.004874,0.470919,0.041145,0.008093,0.518856,-0.430317,-0.019637,0.489733,-0.499465,0.017313,\n\t\t          0.537446,-0.245178,-0.009607,0.505897,-0.099785,0.000513,0.499147,-0.101141,-0.034207,0.467729,0.028460,-0.034641,\n\t\t          0.551995,-0.323266,-0.004086,0.519499,-0.468777,0.024304,0.466572,-0.514672,0.032907,0.530862,-0.362110,-0.027935,\n\t\t          0.495664,-0.166999,-0.022996,0.497561,-0.003403,0.006145,0.459973,0.046934,-0.009073,0.471584,0.039105,0.018765,\n\t\t          0.488872,-0.031248,-0.044115,0.522122,-0.267470,-0.027899,0.496646,-0.481481,-0.002440,0.529080,-0.448603,0.002837,\n\t\t          0.475320,0.033248,-0.010254,0.507408,-0.171841,-0.013222,0.494767,-0.011520,-0.019266,0.443167,0.059970,0.003447,\n\t\t          0.509378,-0.052209,-0.019504,0.483095,0.018194,-0.016945,0.511996,-0.080665,-0.017980,0.502388,-0.121172,-0.013632,\n\t\t          0.507134,-0.101357,-0.011660,0.449169,0.042494,-0.028065,0.457875,0.006270,-0.047614,0.472636,-0.077079,-0.047023,\n\t\t          0.470184,-0.144932,-0.032132,0.480025,-0.219598,-0.028447,0.498347,-0.312181,-0.037960,0.488178,-0.401557,-0.032508,\n\t\t          0.477840,-0.463281,-0.018138,0.462861,-0.505875,0.005246,0.540165,-0.409808,-0.005999,0.547323,-0.307787,-0.020023,\n\t\t          0.548474,-0.366774,-0.006773,0.442256,0.062278,0.029636,0.443273,0.057488,0.042014,0.456598,0.052743,0.022220,\n\t\t          0.550751,-0.372498,0.011001,0.498004,-0.493715,0.067384,0.468058,-0.514005,0.061472,0.466027,-0.505800,0.082940,\n\t\t          0.457774,-0.482724,0.101638,0.498862,-0.497929,0.048109,0.471866,-0.447935,0.106277,0.526381,-0.410767,0.082224,\n\t\t          0.538221,-0.423117,0.058792,0.522517,-0.466474,0.051273,0.517091,-0.458494,0.074146,0.499421,-0.441816,0.094991,\n\t\t          0.541248,-0.427289,0.038431,0.502680,-0.381474,0.104517,0.520630,-0.139360,0.150513,0.543941,-0.370645,0.071325,\n\t\t          0.525262,-0.162146,0.115942,0.538858,-0.239664,0.091409,0.553100,-0.329072,0.061975,0.348776,-0.291849,-0.007987,\n\t\t          0.551522,-0.377718,0.047459,0.515060,-0.174266,-0.004712,0.547090,-0.293287,0.079106,0.549242,-0.272042,0.068712,\n\t\t          0.548414,-0.291849,-0.007987,0.555598,-0.303666,0.049850,0.528047,-0.211746,-0.001031,0.535846,-0.207020,0.079377,\n\t\t          0.546260,-0.247397,0.053277,0.522577,-0.117060,0.098787,0.526256,-0.160470,0.062839,0.513048,-0.323713,0.111723,\n\t\t          0.539590,-0.324420,0.086818,0.511066,-0.266979,0.133082,0.537218,-0.265564,0.101015,0.527357,-0.208195,0.120285,\n\t\t          0.504932,-0.212602,0.156304,0.517201,-0.181270,0.153695,0.522968,-0.238790,0.126749,0.529267,-0.293585,0.107229,\n\t\t          0.525078,-0.361076,0.094372,0.511783,-0.035814,0.045789,0.356158,-0.162697,0.023356,0.517546,-0.046560,0.096725,\n\t\t          0.482799,0.027568,0.092417,0.461229,0.046860,0.077435,0.507074,-0.014954,0.073370,0.445401,0.050895,0.111936,\n\t\t          0.505591,-0.007624,0.110707,0.506524,-0.002922,0.144630,0.483628,0.028728,0.130880,0.479895,0.030637,0.159156,\n\t\t          0.462542,0.043451,0.136674,0.462472,0.034712,0.172234,0.493042,0.014790,0.173670,0.506836,-0.002733,0.167408,\n\t\t          0.491939,-0.413902,0.102898,0.376925,-0.413709,0.105328,0.418609,0.027540,0.177178,0.411098,-0.414042,0.108502,\n\t\t          0.393210,-0.391827,0.109689,0.387993,-0.342071,0.122360,0.367423,-0.194804,0.192028,0.380183,-0.237583,0.170093,\n\t\t          0.385770,-0.292473,0.142243,0.451208,-0.414591,0.109368,0.472433,-0.392612,0.110198,0.482893,-0.342172,0.113920,\n\t\t          0.485213,-0.194017,0.178928,0.477498,-0.237463,0.158387,0.484962,-0.292672,0.130588,0.492463,-0.266622,0.147468,\n\t\t          0.493954,-0.321211,0.123545,0.484326,-0.213204,0.172356,0.490057,-0.182725,0.183640,0.485337,-0.368284,0.115232,\n\t\t          0.463834,-0.412138,0.113929,0.430482,-0.424572,0.114652,0.378113,-0.320236,0.134346,0.372754,-0.266604,0.161284,\n\t\t          0.368532,-0.213902,0.186240,0.360929,-0.183389,0.196865,0.380502,-0.368381,0.120886,0.397385,-0.412812,0.113307,\n\t\t          0.476621,-0.181531,0.187307,0.451356,-0.214716,0.181928,0.459457,-0.267046,0.151524,0.463437,-0.319075,0.126633,\n\t\t          0.456961,-0.362857,0.116423,0.455488,-0.391533,0.108771,0.408296,-0.391475,0.111283,0.374286,-0.181635,0.197775,\n\t\t          0.399551,-0.214784,0.188183,0.403687,-0.267047,0.158235,0.408332,-0.319060,0.132892,0.409537,-0.362823,0.119831,\n\t\t          0.427430,-0.241151,0.174611,0.434279,-0.295175,0.145005,0.424990,-0.196962,0.203366,0.434459,-0.342316,0.126606,\n\t\t          0.431719,-0.387434,0.115694,0.405143,-0.182992,0.209520,0.445612,-0.182992,0.205259,0.467272,-0.193845,0.187177,\n\t\t          0.382989,-0.193994,0.196633,0.356662,-0.156187,0.181455,0.349551,-0.081613,0.136450,0.348354,-0.048948,0.142443,\n\t\t          0.350566,-0.033484,0.165001,0.361406,-0.014928,0.178217,0.384000,0.007962,0.175924,0.349088,-0.123855,0.156655,\n\t\t          0.498378,-0.156263,0.172867,0.510651,-0.081613,0.131223,0.508223,-0.048948,0.132306,0.504055,-0.033484,0.154286,\n\t\t          0.491408,-0.014928,0.175026,0.467348,0.007963,0.175924,0.509934,-0.123855,0.151429,0.439138,0.017885,0.172523,\n\t\t          0.485204,-0.168245,0.176644,0.366371,-0.168285,0.187493,0.469960,-0.167857,0.180962,0.380229,-0.167860,0.190036,\n\t\t          0.407807,-0.167856,0.201951,0.442240,-0.167856,0.198469,0.484031,-0.174220,0.180212,0.460490,-0.174303,0.195263,\n\t\t          0.343140,-0.036004,0.155980,0.349061,-0.022074,0.178037,0.512748,-0.146696,0.167552,0.342543,-0.104619,0.145769,\n\t\t          0.342399,-0.061129,0.136499,0.425381,-0.174303,0.209645,0.390100,-0.174304,0.202399,0.367685,-0.174598,0.191549,\n\t\t          0.346135,-0.146696,0.174121,0.447309,0.032789,0.177432,0.456409,0.022614,0.176975,0.484850,0.004336,0.181951,\n\t\t          0.505261,-0.022074,0.170850,0.512634,-0.036004,0.142251,0.516140,-0.060868,0.129460,0.367580,0.004336,0.182811,\n\t\t          0.395362,0.022614,0.176975,0.517450,-0.104359,0.140053,0.437599,0.038865,0.191413,0.437471,0.057202,0.204104,\n\t\t          0.437832,0.075442,0.201368,0.437895,0.063768,0.193707,0.438088,0.043704,0.179114,0.438206,0.037114,0.173786,\n\t\t          0.426873,0.040487,0.167736,0.426466,0.035279,0.181126,0.426582,0.051183,0.188690,0.426726,0.074257,0.196990,\n\t\t          0.426452,0.069149,0.204514,0.426066,0.045230,0.199836,0.433168,0.027540,0.177178,0.415442,0.037114,0.173786,\n\t\t          0.418607,0.045994,0.143678,0.405429,0.032789,0.177432,0.339353,-0.092879,0.131489,0.385788,0.034988,0.048020,\n\t\t          0.351328,-0.466774,0.037081,0.521781,-0.090742,0.125826,0.520730,-0.080907,0.098543,0.517162,-0.061625,0.066935,\n\t\t          0.358295,-0.100168,0.028523,0.518591,-0.095504,0.068945,0.341519,-0.311330,0.018014,0.427557,0.055890,0.093750,\n\t\t          0.362137,-0.035739,0.012187,0.336885,-0.336488,0.035007,0.342951,-0.283984,0.030245,0.347512,-0.210007,0.035872,\n\t\t          0.352988,-0.120201,0.042606,0.361660,-0.083733,0.009837,0.369639,0.015476,0.057439,0.348337,-0.253093,0.016042,\n\t\t          0.509841,-0.083733,0.009837,0.507541,-0.035739,0.012187,0.555807,-0.336488,0.035007,0.552219,-0.283984,0.030245,\n\t\t          0.535258,-0.209817,0.035775,0.335786,-0.380313,0.028459,0.515608,-0.118550,0.042002,0.492209,0.015476,0.057439,\n\t\t          0.401611,-0.514655,0.046222,0.363730,-0.008066,0.034723,0.413490,0.054459,0.070310,0.467840,-0.514655,0.046222,\n\t\t          0.522320,-0.466774,0.037081,0.551078,-0.380313,0.028459,0.553949,-0.311330,0.018014,0.543757,-0.253093,0.016042,\n\t\t          0.518569,-0.161560,0.022774,0.511130,-0.097101,0.027888,0.513672,-0.060729,0.030999,0.475833,0.034988,0.048020,\n\t\t          0.502107,-0.008066,0.034723,0.443984,0.054459,0.070310,0.362959,-0.063565,0.013441,0.356570,-0.255059,-0.002186,\n\t\t          0.368899,-0.100077,0.008031,0.348961,-0.313187,0.001953,0.356593,-0.460846,0.028335,0.404168,-0.507992,0.035387,\n\t\t          0.371549,-0.009800,0.014786,0.392825,0.032178,0.022392,0.417033,0.050950,0.042601,0.342202,-0.377725,0.018158,\n\t\t          0.367473,-0.162852,0.003337,0.507708,-0.063489,0.013437,0.536851,-0.255059,-0.002186,0.502602,-0.100001,0.008027,\n\t\t          0.546616,-0.313187,0.001953,0.517558,-0.460846,0.028335,0.465883,-0.507992,0.035387,0.496253,-0.009800,0.014786,\n\t\t          0.471117,0.032178,0.022392,0.442873,0.050950,0.042695,0.545014,-0.377725,0.018158,0.509229,-0.162852,0.003337,\n\t\t          0.362937,-0.162688,0.016139,0.390074,0.030583,0.036458,0.356198,-0.460659,0.032482,0.364780,-0.100472,0.020590,\n\t\t          0.347621,-0.310219,0.012950,0.354396,-0.252892,0.010446,0.341617,-0.376641,0.024251,0.403721,-0.507570,0.039927,\n\t\t          0.369050,-0.011456,0.026538,0.415606,0.049522,0.055521,0.465990,-0.507570,0.039927,0.517738,-0.460659,0.032482,\n\t\t          0.545543,-0.376641,0.024251,0.547674,-0.310219,0.012950,0.537736,-0.252892,0.010446,0.512302,-0.162498,0.016042,\n\t\t          0.505429,-0.099558,0.020462,0.508777,-0.063682,0.024028,0.472770,0.030583,0.036458,0.497675,-0.011456,0.026538,\n\t\t          0.443355,0.049522,0.055641,0.341311,-0.339800,0.009360,0.429350,0.057044,0.045809,0.457654,0.046328,0.030062,\n\t\t          0.404050,0.046328,0.030062,0.551323,-0.339800,0.009360,0.486536,0.017985,0.015303,0.379259,0.017985,0.015303,\n\t\t          0.503896,-0.120839,0.001178,0.369338,-0.120839,0.001178,0.539773,-0.425033,0.024063,0.497046,-0.493889,0.033204,\n\t\t          0.374516,-0.493889,0.033204,0.340126,-0.425033,0.024063,0.434706,-0.517623,0.038447,0.352126,-0.084464,0.045323,\n\t\t          0.355152,-0.062659,0.031052,0.360792,-0.064407,0.024059,0.346556,-0.097766,0.069979,0.342264,-0.084342,0.102121,\n\t\t          0.371686,-0.496729,0.056704,0.394785,-0.418441,0.112145,0.342827,-0.157565,0.173767,0.337840,-0.115617,0.138055,\n\t\t          0.339601,-0.055392,0.127646,0.341075,-0.025664,0.151772,0.346178,-0.014957,0.178497,0.364068,0.010186,0.182839,\n\t\t          0.393047,0.029536,0.177738,0.359224,-0.400182,-0.023419,0.373616,-0.072181,-0.039514,0.375619,-0.124243,-0.024284,\n\t\t          0.390883,-0.496750,0.006250,0.369083,-0.456332,-0.011685,0.378442,-0.216258,-0.021413,0.388082,0.008687,-0.039518,\n\t\t          0.380824,0.025025,0.007711,0.350132,-0.290861,-0.014858,0.338731,-0.423970,0.016549,0.376233,-0.497586,0.029154,\n\t\t          0.361288,-0.318067,-0.028297,0.406219,0.053623,0.009515,0.361555,-0.085481,0.002053,0.398826,0.038418,-0.022690,\n\t\t          0.370085,-0.124860,-0.005300,0.363082,-0.033566,0.002344,0.404187,0.049786,0.027839,0.340866,-0.344777,0.005726,\n\t\t          0.383861,-0.468395,0.099689,0.374756,-0.488576,0.078948,0.338172,-0.425912,0.047729,0.361344,-0.402263,0.098795,\n\t\t          0.344293,-0.418277,0.073411,0.349579,-0.039670,0.068753,0.339896,-0.206482,0.114023,0.343382,-0.325635,0.088745,\n\t\t          0.336656,-0.333200,0.051068,0.358622,-0.210629,-0.005140,0.343242,-0.266872,0.101044,0.341629,-0.278578,0.053211,\n\t\t          0.342970,-0.208598,0.059041,0.345474,-0.118681,0.068751,0.358691,-0.324222,0.116059,0.354466,-0.266227,0.135392,\n\t\t          0.348640,-0.210711,0.153817,0.362414,0.008207,0.083843,0.389795,0.043748,0.107047,0.357913,0.015234,0.158325,\n\t\t          0.390004,0.039048,0.159025,0.415107,0.037084,0.186162,0.441823,-0.404995,-0.034970,0.435545,0.005317,-0.048341,\n\t\t          0.445022,-0.220697,-0.031218,0.431980,0.044259,-0.028988,0.436383,-0.509382,0.005466,0.433977,-0.519397,0.063691,\n\t\t          0.433204,-0.486827,0.102250,0.431003,-0.434401,0.113938,0.498868,-0.496729,0.056704,0.467832,-0.419158,0.111137,\n\t\t          0.516586,-0.157565,0.165695,0.522418,-0.115275,0.131800,0.519383,-0.054858,0.121125,0.514745,-0.025664,0.138560,\n\t\t          0.508505,-0.014957,0.171716,0.489100,0.010186,0.182009,0.459528,0.029536,0.177738,0.414764,0.045230,0.199836,\n\t\t          0.415276,0.069149,0.204514,0.415567,0.074257,0.196990,0.415293,0.051183,0.188690,0.415626,0.041242,0.173186,\n\t\t          0.426751,0.052108,0.119996,0.429391,0.060594,0.045403,0.429700,0.065554,0.037128,0.430485,0.062835,0.002755,\n\t\t          0.434908,-0.520285,0.034508,0.433935,-0.511198,0.084810,0.438015,-0.466560,-0.019347,0.452252,-0.313123,-0.041248,\n\t\t          0.438246,-0.080188,-0.047571,0.436960,-0.153755,-0.034016,0.524548,-0.400182,-0.023419,0.504071,-0.072181,-0.039514,\n\t\t          0.498062,-0.124243,-0.024284,0.483520,-0.496750,0.006250,0.511345,-0.456332,-0.011685,0.509169,-0.216258,-0.021413,\n\t\t          0.477566,0.008687,-0.039518,0.484735,0.025025,0.007711,0.547708,-0.290861,-0.014858,0.542419,-0.423970,0.016549,\n\t\t          0.495700,-0.497586,0.029154,0.537941,-0.318067,-0.028297,0.455883,0.053623,0.009515,0.510877,-0.085481,0.002053,\n\t\t          0.464159,0.038418,-0.022690,0.503726,-0.124860,-0.005300,0.507372,-0.033566,0.002344,0.457597,0.049786,0.027839,\n\t\t          0.552068,-0.344777,0.005726,0.480001,-0.468395,0.099343,0.494919,-0.488576,0.078872,0.540553,-0.425912,0.047438,\n\t\t          0.514476,-0.402294,0.093662,0.533842,-0.418277,0.070913,0.513986,-0.039152,0.067775,0.532308,-0.206482,0.100920,\n\t\t          0.547469,-0.325635,0.074388,0.555894,-0.333200,0.049031,0.527152,-0.210629,-0.005140,0.543886,-0.266872,0.084955,\n\t\t          0.552187,-0.278578,0.050928,0.537278,-0.208551,0.057160,0.520205,-0.117879,0.067654,0.528872,-0.324157,0.099191,\n\t\t          0.526883,-0.266188,0.116932,0.518969,-0.210711,0.138422,0.496612,0.008207,0.082118,0.465284,0.043748,0.106873,\n\t\t          0.497314,0.015234,0.156731,0.463878,0.039048,0.159025,0.400267,-0.406989,0.109586,0.390151,-0.367947,0.114807,\n\t\t          0.374995,-0.210172,0.185107,0.365975,-0.183044,0.194300,0.382863,-0.265238,0.155937,0.387734,-0.318412,0.130467,\n\t\t          0.431033,-0.412878,0.109460,0.463274,-0.407268,0.110940,0.477122,-0.368289,0.109909,0.476794,-0.209614,0.172786,\n\t\t          0.486150,-0.182774,0.182226,0.481864,-0.265246,0.144073,0.485562,-0.318671,0.120024,0.425433,-0.183192,0.211205,\n\t\t          0.425103,-0.216114,0.189908,0.431092,-0.268646,0.159102,0.435474,-0.319983,0.133711,0.432901,-0.364142,0.121372,\n\t\t          0.387276,-0.182416,0.203776,0.463376,-0.182405,0.195826,0.351623,-0.142245,0.170431,0.348763,-0.102983,0.144025,\n\t\t          0.348614,-0.062637,0.135425,0.348933,-0.039559,0.153602,0.354336,-0.026636,0.174064,0.373261,-0.000815,0.179971,\n\t\t          0.390520,0.011381,0.175110,0.362292,-0.165107,0.187778,0.506528,-0.142245,0.164337,0.510739,-0.102983,0.138798,\n\t\t          0.509520,-0.062637,0.128971,0.506477,-0.039559,0.140866,0.499530,-0.026636,0.167396,0.480444,-0.002137,0.177695,\n\t\t          0.453222,0.014820,0.173078,0.489430,-0.165552,0.177395,0.371574,-0.167946,0.185741,0.479068,-0.167908,0.175081,\n\t\t          0.425054,-0.167856,0.203386,0.392285,-0.167856,0.196664,0.457762,-0.167856,0.190044,0.437784,0.037084,0.186162,\n\t\t          0.437413,0.045230,0.199836,0.437668,0.069149,0.204514,0.437924,0.074257,0.196990,0.437898,0.051183,0.188690,\n\t\t          0.438267,0.041242,0.173186,0.425168,0.018469,0.172818,0.340229,-0.083818,0.122554,0.347301,-0.084057,0.069259,\n\t\t          0.355851,-0.085121,0.030601,0.381282,0.015193,0.017182,0.352649,-0.290178,-0.004094,0.521586,-0.081017,0.117346,\n\t\t          0.513526,-0.081941,0.030375,0.405087,0.043361,0.030796,0.365030,-0.037739,0.013955,0.518198,-0.080900,0.068207,\n\t\t          0.371509,-0.121642,0.004330,0.434379,-0.520341,0.048200,0.510292,-0.035444,0.031775,0.428240,0.056880,0.076823,\n\t\t          0.344333,-0.422298,0.023793,0.372829,-0.496998,0.041959,0.338513,-0.426905,0.032333,0.338352,-0.338090,0.024129,\n\t\t          0.344971,-0.287257,0.014018,0.351763,-0.210890,0.020388,0.359490,-0.121471,0.025786,0.357378,-0.035926,0.031789,\n\t\t          0.373504,0.016910,0.040063,0.377149,-0.490400,0.032096,0.399468,0.047170,0.058225,0.498289,-0.496998,0.041959,\n\t\t          0.540870,-0.426905,0.032333,0.554143,-0.338090,0.024129,0.550926,-0.287257,0.014018,0.532153,-0.210606,0.020243,\n\t\t          0.345514,-0.337799,0.011016,0.511079,-0.119283,0.024900,0.490244,0.016910,0.040063,0.364492,-0.085078,0.011911,\n\t\t          0.460021,0.047170,0.058225,0.361198,-0.211420,0.002137,0.429569,0.053846,0.045416,0.434722,-0.513797,0.036916,\n\t\t          0.484571,0.015193,0.017182,0.543947,-0.290178,-0.004094,0.535710,-0.422298,0.023793,0.494365,-0.490400,0.032096,\n\t\t          0.506757,-0.084963,0.011905,0.501291,-0.121623,0.004329,0.504519,-0.037720,0.013954,0.456881,0.043361,0.030796,\n\t\t          0.547012,-0.337799,0.011016,0.524253,-0.211420,0.002137,0.361729,-0.085801,0.023230,0.508354,-0.084667,0.023160,\n\t\t          0.434537,-0.513212,0.041539,0.505587,-0.038610,0.024632,0.429058,0.052070,0.060150,0.376592,-0.490201,0.036454,\n\t\t          0.344040,-0.421841,0.028314,0.344419,-0.335840,0.019421,0.351025,-0.286872,0.008679,0.358043,-0.210692,0.014263,\n\t\t          0.366421,-0.121680,0.017704,0.362874,-0.038791,0.024640,0.378468,0.013151,0.030297,0.402788,0.042240,0.044952,\n\t\t          0.494656,-0.490201,0.036454,0.535858,-0.421841,0.028314,0.547922,-0.335840,0.019421,0.544832,-0.286872,0.008679,\n\t\t          0.525941,-0.210645,0.014239,0.504939,-0.121215,0.017551,0.486323,0.013151,0.030297,0.458086,0.042240,0.044952\n\t\tPolygonVertexIndex: 915,107,4,-894,914,75,6,-893,72,74,5,-41,1363,1359,12,-42,1367,1358,11,-896,1368,1360,13,-895,918,112,3,-891,919,113,1,-892,\n\t\t                    115,118,2,-40,1060,1046,17,-90,102,40,5,-110,1062,1047,16,-101,1369,1049,23,-1363,67,19,9,-65,114,21,1,-114,1361,18,13,-1361,\n\t\t                    73,20,6,-76,89,17,0,-92,1362,23,8,-1358,69,8,23,-69,916,893,4,-111,917,892,6,-109,913,60,130,-923,57,63,134,-134,\n\t\t                    1056,53,129,-1069,908,62,135,-924,60,57,133,-131,903,49,24,-899,34,38,24,-27,52,50,27,-29,1051,34,26,-1068,902,51,30,-900,\n\t\t                    160,32,29,-170,54,48,25,-32,51,54,31,-31,30,31,33,-37,31,25,43,-34,107,72,40,-5,1358,1363,41,-12,112,115,39,-4,\n\t\t                    165,168,44,-89,110,4,40,-103,156,167,45,-104,1366,161,47,-1365,169,29,55,-160,899,30,36,-902,1067,26,53,-1057,28,27,37,-36,\n\t\t                    26,24,49,-54,898,24,38,-901,157,128,56,-165,129,135,62,-59,922,130,51,-903,1068,129,58,-1058,130,133,54,-52,131,132,50,-53,\n\t\t                    133,134,48,-55,923,135,49,-904,927,186,60,-914,187,185,63,-58,191,184,87,-163,42,70,65,-11,1049,1058,68,-24,111,67,64,-109,\n\t\t                    101,69,68,-101,896,904,66,-16,897,905,64,-10,15,66,70,-43,161,158,71,-48,98,97,92,-78,182,183,61,-60,911,96,94,-907,\n\t\t                    1083,188,85,-1062,127,85,81,-126,1063,1059,78,-106,155,163,76,-105,891,1,96,-912,90,98,77,-94,912,90,93,-908,66,110,102,-71,\n\t\t                    99,79,94,-97,163,165,88,-77,105,78,95,-107,928,189,62,-909,904,916,110,-67,186,187,57,-61,77,92,74,-73,153,162,87,-125,\n\t\t                    890,3,90,-913,39,2,97,-99,21,99,96,-2,1065,1061,85,-128,188,189,81,-86,906,94,75,-915,78,89,91,-96,1059,1060,89,-79,\n\t\t                    3,39,98,-91,20,111,108,-7,1058,1062,100,-69,70,102,109,-66,167,155,104,-46,16,105,106,-8,905,917,108,-65,7,101,100,-17,\n\t\t                    158,156,103,-72,1047,1063,105,-17,907,93,107,-916,93,77,72,-108,79,73,75,-95,920,120,112,-919,921,121,113,-920,123,126,118,-116,\n\t\t                    122,114,113,-122,120,123,115,-113,17,119,117,-1,168,154,116,-45,1046,1064,119,-18,119,127,125,-118,154,153,124,-117,1064,1065,127,-120,\n\t\t                    910,80,120,-921,909,82,121,-922,86,83,126,-124,84,122,121,-83,80,86,123,-121,59,61,132,-132,159,55,128,-158,53,49,135,-130,\n\t\t                    88,44,136,-147,103,45,137,-149,1364,47,139,-1366,55,142,152,-129,32,141,140,-30,29,140,142,-56,128,152,143,-57,47,71,144,-140,\n\t\t                    184,190,147,-88,104,76,145,-150,124,87,147,-152,76,88,146,-146,71,103,148,-145,45,104,149,-138,44,116,150,-137,116,124,151,-151,\n\t\t                    1073,1071,156,-159,1370,1055,161,-1367,1055,1073,158,-162,1069,1076,162,-154,1050,169,159,-1076,1053,1070,155,-168,1052,1072,154,-169,1066,157,164,-1078,\n\t\t                    1078,1052,168,-166,1071,1053,167,-157,1079,1078,165,-164,1075,159,157,-1067,1074,160,169,-1051,1072,1069,153,-155,1084,191,162,-1077,1070,1079,163,-156,\n\t\t                    179,171,32,-161,36,33,170,-175,141,32,171,-179,901,36,174,-925,172,176,38,-35,35,37,175,-174,1074,35,173,-1082,900,38,176,-926,\n\t\t                    1080,172,34,-1052,33,43,177,-171,1081,173,181,-1083,1080,1082,181,-173,172,181,180,-177,181,173,175,-181,926,924,174,-171,926,925,176,-181,\n\t\t                    909,83,186,-928,86,80,185,-188,164,56,184,-192,84,82,183,-183,1057,58,188,-1084,910,81,189,-929,83,86,187,-187,58,62,189,-189,\n\t\t                    56,143,190,-185,1077,164,191,-1085,954,299,196,-933,953,267,198,-932,264,266,197,-233,1372,1406,204,-234,1376,1407,203,-935,1375,1405,205,-934,\n\t\t                    957,304,195,-930,958,305,193,-931,307,310,194,-232,1099,1085,209,-282,294,232,197,-302,1101,1086,208,-293,1382,1088,215,-1374,259,211,201,-257,\n\t\t                    306,213,193,-306,1374,210,205,-1406,265,212,198,-268,281,209,192,-284,1373,215,200,-1409,261,200,215,-261,955,932,196,-303,956,931,198,-301,\n\t\t                    952,252,322,-962,249,255,326,-326,1095,245,321,-1108,947,254,327,-963,252,249,325,-323,942,241,216,-938,226,230,216,-219,244,242,219,-221,\n\t\t                    1090,226,218,-1107,941,243,222,-939,352,224,221,-362,246,240,217,-224,243,246,223,-223,222,223,225,-229,223,217,235,-226,299,264,232,-197,\n\t\t                    1407,1372,233,-204,304,307,231,-196,357,360,236,-281,302,196,232,-295,348,359,237,-296,1377,353,239,-1372,361,221,247,-352,938,222,228,-941,\n\t\t                    1106,218,245,-1096,220,219,229,-228,218,216,241,-246,937,216,230,-940,349,320,248,-357,321,327,254,-251,961,322,243,-942,1107,321,250,-1097,\n\t\t                    322,325,246,-244,323,324,242,-245,325,326,240,-247,962,327,241,-943,966,378,252,-953,379,377,255,-250,383,376,279,-355,234,262,257,-203,\n\t\t                    1088,1097,260,-216,303,259,256,-301,293,261,260,-293,935,943,258,-208,936,944,256,-202,207,258,262,-235,353,350,263,-240,290,289,284,-270,\n\t\t                    374,375,253,-252,950,288,286,-946,1122,380,277,-1101,319,277,273,-318,1102,1098,270,-298,347,355,268,-297,930,193,288,-951,282,290,269,-286,\n\t\t                    951,282,285,-947,258,302,294,-263,291,271,286,-289,355,357,280,-269,297,270,287,-299,967,381,254,-948,943,955,302,-259,378,379,249,-253,\n\t\t                    269,284,266,-265,345,354,279,-317,929,195,282,-952,231,194,289,-291,213,291,288,-194,1104,1100,277,-320,380,381,273,-278,945,286,267,-954,\n\t\t                    270,281,283,-288,1098,1099,281,-271,195,231,290,-283,212,303,300,-199,1097,1101,292,-261,262,294,301,-258,359,347,296,-238,208,297,298,-200,\n\t\t                    944,956,300,-257,199,293,292,-209,350,348,295,-264,1086,1102,297,-209,946,285,299,-955,285,269,264,-300,271,265,267,-287,959,312,304,-958,\n\t\t                    960,313,305,-959,315,318,310,-308,314,306,305,-314,312,315,307,-305,209,311,309,-193,360,346,308,-237,1085,1103,311,-210,311,319,317,-310,\n\t\t                    346,345,316,-309,1103,1104,319,-312,949,272,312,-960,948,274,313,-961,278,275,318,-316,276,314,313,-275,272,278,315,-313,251,253,324,-324,\n\t\t                    351,247,320,-350,245,241,327,-322,280,236,328,-339,295,237,329,-341,1371,239,331,-1379,247,334,344,-321,224,333,332,-222,221,332,334,-248,\n\t\t                    320,344,335,-249,239,263,336,-332,376,382,339,-280,296,268,337,-342,316,279,339,-344,268,280,338,-338,263,295,340,-337,237,296,341,-330,\n\t\t                    236,308,342,-329,308,316,343,-343,1112,1110,348,-351,1381,1094,353,-1378,1094,1112,350,-354,1108,1115,354,-346,1089,361,351,-1115,1092,1109,347,-360,\n\t\t                    1091,1111,346,-361,1105,349,356,-1117,1117,1091,360,-358,1110,1092,359,-349,1118,1117,357,-356,1114,351,349,-1106,1113,352,361,-1090,1111,1108,345,-347,\n\t\t                    1123,383,354,-1116,1109,1118,355,-348,371,363,224,-353,228,225,362,-367,333,224,363,-371,940,228,366,-964,364,368,230,-227,227,229,367,-366,\n\t\t                    1113,227,365,-1121,939,230,368,-965,1119,364,226,-1091,225,235,369,-363,1120,365,373,-1122,1119,1121,373,-365,364,373,372,-369,373,365,367,-373,\n\t\t                    965,963,366,-363,965,964,368,-373,948,275,378,-967,278,272,377,-380,356,248,376,-384,276,274,375,-375,1096,250,380,-1123,949,273,381,-968,\n\t\t                    275,278,379,-379,250,254,381,-381,248,335,382,-377,1116,356,383,-1124,993,491,388,-972,992,459,390,-971,456,458,389,-425,1395,1397,396,-426,\n\t\t                    1391,1388,395,-974,1392,1398,397,-973,996,496,387,-969,997,497,385,-970,499,502,386,-424,1138,1124,401,-474,486,424,389,-494,1140,1125,400,-485,\n\t\t                    1383,1127,407,-1387,451,403,393,-449,498,405,385,-498,1385,402,397,-1399,457,404,390,-460,473,401,384,-476,1386,407,392,-1388,453,392,407,-453,\n\t\t                    994,971,388,-495,995,970,390,-493,991,444,514,-1001,441,447,518,-518,1134,437,513,-1147,986,446,519,-1002,444,441,517,-515,981,433,408,-977,\n\t\t                    418,422,408,-411,436,434,411,-413,1129,418,410,-1146,980,435,414,-978,544,416,413,-554,438,432,409,-416,435,438,415,-415,414,415,417,-421,\n\t\t                    415,409,427,-418,491,456,424,-389,1388,1395,425,-396,496,499,423,-388,549,552,428,-473,494,388,424,-487,540,551,429,-488,1390,545,431,-1397,\n\t\t                    553,413,439,-544,977,414,420,-980,1145,410,437,-1135,412,411,421,-420,410,408,433,-438,976,408,422,-979,541,512,440,-549,513,519,446,-443,\n\t\t                    1000,514,435,-981,1146,513,442,-1136,514,517,438,-436,515,516,434,-437,517,518,432,-439,1001,519,433,-982,1005,570,444,-992,571,569,447,-442,\n\t\t                    575,568,471,-547,426,454,449,-395,1127,1136,452,-408,495,451,448,-493,485,453,452,-485,974,982,450,-400,975,983,448,-394,399,450,454,-427,\n\t\t                    545,542,455,-432,482,481,476,-462,566,567,445,-444,989,480,478,-985,1161,572,469,-1140,511,469,465,-510,1141,1137,462,-490,539,547,460,-489,\n\t\t                    969,385,480,-990,474,482,461,-478,990,474,477,-986,450,494,486,-455,483,463,478,-481,547,549,472,-461,489,462,479,-491,1006,573,446,-987,\n\t\t                    982,994,494,-451,570,571,441,-445,461,476,458,-457,537,546,471,-509,968,387,474,-991,423,386,481,-483,405,483,480,-386,1143,1139,469,-512,\n\t\t                    572,573,465,-470,984,478,459,-993,462,473,475,-480,1137,1138,473,-463,387,423,482,-475,404,495,492,-391,1136,1140,484,-453,454,486,493,-450,\n\t\t                    551,539,488,-430,400,489,490,-392,983,995,492,-449,391,485,484,-401,542,540,487,-456,1125,1141,489,-401,985,477,491,-994,477,461,456,-492,\n\t\t                    463,457,459,-479,998,504,496,-997,999,505,497,-998,507,510,502,-500,506,498,497,-506,504,507,499,-497,401,503,501,-385,552,538,500,-429,\n\t\t                    1124,1142,503,-402,503,511,509,-502,538,537,508,-501,1142,1143,511,-504,988,464,504,-999,987,466,505,-1000,470,467,510,-508,468,506,505,-467,\n\t\t                    464,470,507,-505,443,445,516,-516,543,439,512,-542,437,433,519,-514,472,428,520,-531,487,429,521,-533,1396,431,523,-1390,439,526,536,-513,\n\t\t                    416,525,524,-414,413,524,526,-440,512,536,527,-441,431,455,528,-524,568,574,531,-472,488,460,529,-534,508,471,531,-536,460,472,530,-530,\n\t\t                    455,487,532,-529,429,488,533,-522,428,500,534,-521,500,508,535,-535,1151,1149,540,-543,1384,1133,545,-1391,1133,1151,542,-546,1147,1154,546,-538,\n\t\t                    1128,553,543,-1154,1131,1148,539,-552,1130,1150,538,-553,1144,541,548,-1156,1156,1130,552,-550,1149,1131,551,-541,1157,1156,549,-548,1153,543,541,-1145,\n\t\t                    1152,544,553,-1129,1150,1147,537,-539,1162,575,546,-1155,1148,1157,547,-540,563,555,416,-545,420,417,554,-559,525,416,555,-563,979,420,558,-1003,\n\t\t                    556,560,422,-419,419,421,559,-558,1152,419,557,-1160,978,422,560,-1004,1158,556,418,-1130,417,427,561,-555,1159,557,565,-1161,1158,1160,565,-557,\n\t\t                    556,565,564,-561,565,557,559,-565,1004,1002,558,-555,1004,1003,560,-565,987,467,570,-1006,470,464,569,-572,548,440,568,-576,468,466,567,-567,\n\t\t                    1135,442,572,-1162,988,465,573,-1007,467,470,571,-571,442,446,573,-573,440,527,574,-569,1155,548,575,-1163,1032,683,580,-1011,1031,651,582,-1010,\n\t\t                    648,650,581,-617,1402,1380,588,-618,1404,1393,587,-1013,1403,1379,589,-1012,1035,688,579,-1008,1036,689,577,-1009,691,694,578,-616,1177,1163,593,-666,\n\t\t                    678,616,581,-686,1179,1164,592,-677,1400,1166,599,-1411,643,595,585,-641,690,597,577,-690,1409,594,589,-1380,649,596,582,-652,665,593,576,-668,\n\t\t                    1410,599,584,-1395,645,584,599,-645,1033,1010,580,-687,1034,1009,582,-685,1030,636,706,-1040,633,639,710,-710,1173,629,705,-1186,1025,638,711,-1041,\n\t\t                    636,633,709,-707,1020,625,600,-1016,610,614,600,-603,628,626,603,-605,1168,610,602,-1185,1019,627,606,-1017,736,608,605,-746,630,624,601,-608,\n\t\t                    627,630,607,-607,606,607,609,-613,607,601,619,-610,683,648,616,-581,1393,1402,617,-588,688,691,615,-580,741,744,620,-665,686,580,616,-679,\n\t\t                    732,743,621,-680,1411,737,623,-1402,745,605,631,-736,1016,606,612,-1019,1184,602,629,-1174,604,603,613,-612,602,600,625,-630,1015,600,614,-1018,\n\t\t                    733,704,632,-741,705,711,638,-635,1039,706,627,-1020,1185,705,634,-1175,706,709,630,-628,707,708,626,-629,709,710,624,-631,1040,711,625,-1021,\n\t\t                    1044,762,636,-1031,763,761,639,-634,767,760,663,-739,618,646,641,-587,1166,1175,644,-600,687,643,640,-685,677,645,644,-677,1013,1021,642,-592,\n\t\t                    1014,1022,640,-586,591,642,646,-619,737,734,647,-624,674,673,668,-654,758,759,637,-636,1028,672,670,-1024,1200,764,661,-1179,703,661,657,-702,\n\t\t                    1180,1176,654,-682,731,739,652,-681,1008,577,672,-1029,666,674,653,-670,1029,666,669,-1025,642,686,678,-647,675,655,670,-673,739,741,664,-653,\n\t\t                    681,654,671,-683,1045,765,638,-1026,1021,1033,686,-643,762,763,633,-637,653,668,650,-649,729,738,663,-701,1007,579,666,-1030,615,578,673,-675,\n\t\t                    597,675,672,-578,1182,1178,661,-704,764,765,657,-662,1023,670,651,-1032,654,665,667,-672,1176,1177,665,-655,579,615,674,-667,596,687,684,-583,\n\t\t                    1175,1179,676,-645,646,678,685,-642,743,731,680,-622,592,681,682,-584,1022,1034,684,-641,583,677,676,-593,734,732,679,-648,1164,1180,681,-593,\n\t\t                    1024,669,683,-1033,669,653,648,-684,655,649,651,-671,1037,696,688,-1036,1038,697,689,-1037,699,702,694,-692,698,690,689,-698,696,699,691,-689,\n\t\t                    593,695,693,-577,744,730,692,-621,1163,1181,695,-594,695,703,701,-694,730,729,700,-693,1181,1182,703,-696,1027,656,696,-1038,1026,658,697,-1039,\n\t\t                    662,659,702,-700,660,698,697,-659,656,662,699,-697,635,637,708,-708,735,631,704,-734,629,625,711,-706,664,620,712,-723,679,621,713,-725,\n\t\t                    1401,623,715,-1413,631,718,728,-705,608,717,716,-606,605,716,718,-632,704,728,719,-633,623,647,720,-716,760,766,723,-664,680,652,721,-726,\n\t\t                    700,663,723,-728,652,664,722,-722,647,679,724,-721,621,680,725,-714,620,692,726,-713,692,700,727,-727,1190,1188,732,-735,1399,1172,737,-1412,\n\t\t                    1172,1190,734,-738,1186,1193,738,-730,1167,745,735,-1193,1170,1187,731,-744,1169,1189,730,-745,1183,733,740,-1195,1195,1169,744,-742,1188,1170,743,-733,\n\t\t                    1196,1195,741,-740,1192,735,733,-1184,1191,736,745,-1168,1189,1186,729,-731,1201,767,738,-1194,1187,1196,739,-732,755,747,608,-737,612,609,746,-751,\n\t\t                    717,608,747,-755,1018,612,750,-1042,748,752,614,-611,611,613,751,-750,1191,611,749,-1199,1017,614,752,-1043,1197,748,610,-1169,609,619,753,-747,\n\t\t                    1198,749,757,-1200,1197,1199,757,-749,748,757,756,-753,757,749,751,-757,1043,1041,750,-747,1043,1042,752,-757,1026,659,762,-1045,662,656,761,-764,\n\t\t                    740,632,760,-768,660,658,759,-759,1174,634,764,-1201,1027,657,765,-1046,659,662,763,-763,634,638,765,-765,632,719,766,-761,1194,740,767,-1202,\n\t\t                    829,824,771,-769,830,825,769,-771,827,830,770,-790,853,848,772,-818,826,773,769,-826,817,772,768,-820,805,804,842,-845,801,807,846,-846,\n\t\t                    851,797,841,-858,807,806,847,-847,804,801,845,-843,792,793,774,-776,784,788,774,-777,796,794,777,-779,850,784,776,-850,794,795,780,-778,\n\t\t                    862,782,779,-868,798,792,775,-782,795,798,781,-781,780,781,783,-787,781,775,790,-784,824,827,789,-772,865,866,791,-817,867,779,799,-862,\n\t\t                    777,780,786,-788,849,776,797,-852,778,777,787,-786,776,774,793,-798,775,774,788,-791,860,840,800,-865,841,847,806,-803,844,842,795,-795,\n\t\t                    857,841,802,-853,842,845,798,-796,843,844,794,-797,845,846,792,-799,846,847,793,-793,881,884,804,-806,885,883,807,-802,889,882,815,-864,\n\t\t                    880,881,805,-804,888,886,813,-855,839,813,809,-838,770,769,820,-822,883,887,806,-808,884,885,801,-805,858,863,815,-837,768,771,818,-820,\n\t\t                    789,770,821,-823,773,823,820,-770,856,854,813,-840,886,887,809,-814,771,789,822,-819,837,832,824,-830,838,833,825,-831,835,838,830,-828,\n\t\t                    834,826,825,-834,832,835,827,-825,772,831,829,-769,866,859,828,-792,848,855,831,-773,831,839,837,-830,859,858,836,-829,855,856,839,-832,\n\t\t                    809,808,832,-838,811,810,833,-839,814,811,838,-836,812,834,833,-811,808,814,835,-833,803,805,844,-844,861,799,840,-861,797,793,847,-842,\n\t\t                    816,791,848,-854,799,851,857,-841,782,850,849,-780,779,849,851,-800,840,857,852,-801,882,888,854,-816,836,815,854,-857,791,828,855,-849,\n\t\t                    828,836,856,-856,834,812,863,-859,778,867,861,-797,773,826,859,-867,843,860,864,-804,823,773,866,-866,796,861,860,-844,785,862,867,-779,\n\t\t                    826,834,858,-860,880,889,863,-813,877,869,782,-863,786,783,868,-873,850,782,869,-877,787,786,872,-874,870,874,788,-785,785,787,873,-872,\n\t\t                    862,785,871,-878,790,788,874,-876,876,870,784,-851,783,790,875,-869,877,871,879,-870,876,869,879,-871,870,879,878,-875,879,871,873,-879,\n\t\t                    878,873,872,-869,868,875,874,-879,810,811,884,-882,814,808,883,-886,864,800,882,-890,812,810,881,-881,852,802,886,-889,808,809,887,-884,\n\t\t                    811,814,885,-885,802,806,887,-887,800,852,888,-883,803,864,889,-881,106,915,893,-8,74,914,892,-6,1357,1367,895,-15,1359,1368,894,-13,\n\t\t                    117,918,890,-1,118,919,891,-3,101,7,893,-917,109,5,892,-918,61,913,922,-133,63,908,923,-135,48,903,898,-26,50,902,899,-28,\n\t\t                    27,899,901,-38,25,898,900,-44,132,922,902,-51,134,923,903,-49,183,927,913,-62,8,69,904,-897,10,65,905,-898,97,911,906,-93,\n\t\t                    2,891,911,-98,91,912,907,-96,185,928,908,-64,69,101,916,-905,0,890,912,-92,92,906,914,-75,65,109,917,-906,95,907,915,-107,\n\t\t                    125,920,918,-118,126,921,919,-119,81,910,920,-126,83,909,921,-127,37,901,924,-176,43,900,925,-178,180,175,924,-927,170,177,925,-927,\n\t\t                    82,909,927,-184,80,910,928,-186,298,954,932,-200,266,953,931,-198,1408,1376,934,-207,1406,1375,933,-205,309,957,929,-193,310,958,930,-195,\n\t\t                    293,199,932,-956,301,197,931,-957,253,952,961,-325,255,947,962,-327,240,942,937,-218,242,941,938,-220,219,938,940,-230,217,937,939,-236,\n\t\t                    324,961,941,-243,326,962,942,-241,375,966,952,-254,200,261,943,-936,202,257,944,-937,289,950,945,-285,194,930,950,-290,283,951,946,-288,\n\t\t                    377,967,947,-256,261,293,955,-944,192,929,951,-284,284,945,953,-267,257,301,956,-945,287,946,954,-299,317,959,957,-310,318,960,958,-311,\n\t\t                    273,949,959,-318,275,948,960,-319,229,940,963,-368,235,939,964,-370,372,367,963,-966,362,369,964,-966,274,948,966,-376,272,949,967,-378,\n\t\t                    490,993,971,-392,458,992,970,-390,1387,1391,973,-399,1397,1392,972,-397,501,996,968,-385,502,997,969,-387,485,391,971,-995,493,389,970,-996,\n\t\t                    445,991,1000,-517,447,986,1001,-519,432,981,976,-410,434,980,977,-412,411,977,979,-422,409,976,978,-428,516,1000,980,-435,518,1001,981,-433,\n\t\t                    567,1005,991,-446,392,453,982,-975,394,449,983,-976,481,989,984,-477,386,969,989,-482,475,990,985,-480,569,1006,986,-448,453,485,994,-983,\n\t\t                    384,968,990,-476,476,984,992,-459,449,493,995,-984,479,985,993,-491,509,998,996,-502,510,999,997,-503,465,988,998,-510,467,987,999,-511,\n\t\t                    421,979,1002,-560,427,978,1003,-562,564,559,1002,-1005,554,561,1003,-1005,466,987,1005,-568,464,988,1006,-570,682,1032,1010,-584,650,1031,1009,-582,\n\t\t                    1394,1404,1012,-591,1380,1403,1011,-589,693,1035,1007,-577,694,1036,1008,-579,677,583,1010,-1034,685,581,1009,-1035,637,1030,1039,-709,639,1025,1040,-711,\n\t\t                    624,1020,1015,-602,626,1019,1016,-604,603,1016,1018,-614,601,1015,1017,-620,708,1039,1019,-627,710,1040,1020,-625,759,1044,1030,-638,584,645,1021,-1014,\n\t\t                    586,641,1022,-1015,673,1028,1023,-669,578,1008,1028,-674,667,1029,1024,-672,761,1045,1025,-640,645,677,1033,-1022,576,1007,1029,-668,668,1023,1031,-651,\n\t\t                    641,685,1034,-1023,671,1024,1032,-683,701,1037,1035,-694,702,1038,1036,-695,657,1027,1037,-702,659,1026,1038,-703,613,1018,1041,-752,619,1017,1042,-754,\n\t\t                    756,751,1041,-1044,746,753,1042,-1044,658,1026,1044,-760,656,1027,1045,-762,146,136,1046,-1061,148,137,1047,-1063,1365,139,1049,-1370,142,1056,1068,-153,\n\t\t                    141,1051,1067,-141,140,1067,1056,-143,152,1068,1057,-144,139,144,1058,-1050,190,1083,1061,-148,149,145,1059,-1064,151,147,1061,-1066,145,146,1060,-1060,\n\t\t                    144,148,1062,-1059,137,149,1063,-1048,136,150,1064,-1047,150,151,1065,-1065,67,111,1071,-1074,1361,19,1055,-1371,19,67,1073,-1056,122,84,1076,-1070,\n\t\t                    28,1050,1075,-53,20,73,1070,-1054,21,114,1072,-1053,131,1066,1077,-60,99,21,1052,-1079,111,20,1053,-1072,79,99,1078,-1080,52,1075,1066,-132,\n\t\t                    35,1074,1050,-29,114,122,1069,-1073,182,1084,1076,-85,73,79,1079,-1071,160,1074,1081,-180,178,1080,1051,-142,179,1081,1082,-172,178,171,1082,-1081,\n\t\t                    143,1057,1083,-191,59,1077,1084,-183,338,328,1085,-1100,340,329,1086,-1102,1378,331,1088,-1383,334,1095,1107,-345,333,1090,1106,-333,332,1106,1095,-335,\n\t\t                    344,1107,1096,-336,331,336,1097,-1089,382,1122,1100,-340,341,337,1098,-1103,343,339,1100,-1105,337,338,1099,-1099,336,340,1101,-1098,329,341,1102,-1087,\n\t\t                    328,342,1103,-1086,342,343,1104,-1104,259,303,1110,-1113,1374,211,1094,-1382,211,259,1112,-1095,314,276,1115,-1109,220,1089,1114,-245,212,265,1109,-1093,\n\t\t                    213,306,1111,-1092,323,1105,1116,-252,291,213,1091,-1118,303,212,1092,-1111,271,291,1117,-1119,244,1114,1105,-324,227,1113,1089,-221,306,314,1108,-1112,\n\t\t                    374,1123,1115,-277,265,271,1118,-1110,352,1113,1120,-372,370,1119,1090,-334,371,1120,1121,-364,370,363,1121,-1120,335,1096,1122,-383,251,1116,1123,-375,\n\t\t                    530,520,1124,-1139,532,521,1125,-1141,1389,523,1127,-1384,526,1134,1146,-537,525,1129,1145,-525,524,1145,1134,-527,536,1146,1135,-528,523,528,1136,-1128,\n\t\t                    574,1161,1139,-532,533,529,1137,-1142,535,531,1139,-1144,529,530,1138,-1138,528,532,1140,-1137,521,533,1141,-1126,520,534,1142,-1125,534,535,1143,-1143,\n\t\t                    451,495,1149,-1152,1385,403,1133,-1385,403,451,1151,-1134,506,468,1154,-1148,412,1128,1153,-437,404,457,1148,-1132,405,498,1150,-1131,515,1144,1155,-444,\n\t\t                    483,405,1130,-1157,495,404,1131,-1150,463,483,1156,-1158,436,1153,1144,-516,419,1152,1128,-413,498,506,1147,-1151,566,1162,1154,-469,457,463,1157,-1149,\n\t\t                    544,1152,1159,-564,562,1158,1129,-526,563,1159,1160,-556,562,555,1160,-1159,527,1135,1161,-575,443,1155,1162,-567,722,712,1163,-1178,724,713,1164,-1180,\n\t\t                    1412,715,1166,-1401,718,1173,1185,-729,717,1168,1184,-717,716,1184,1173,-719,728,1185,1174,-720,715,720,1175,-1167,766,1200,1178,-724,725,721,1176,-1181,\n\t\t                    727,723,1178,-1183,721,722,1177,-1177,720,724,1179,-1176,713,725,1180,-1165,712,726,1181,-1164,726,727,1182,-1182,643,687,1188,-1191,1409,595,1172,-1400,\n\t\t                    595,643,1190,-1173,698,660,1193,-1187,604,1167,1192,-629,596,649,1187,-1171,597,690,1189,-1170,707,1183,1194,-636,675,597,1169,-1196,687,596,1170,-1189,\n\t\t                    655,675,1195,-1197,628,1192,1183,-708,611,1191,1167,-605,690,698,1186,-1190,758,1201,1193,-661,649,655,1196,-1188,736,1191,1198,-756,754,1197,1168,-718,\n\t\t                    755,1198,1199,-748,754,747,1199,-1198,719,1174,1200,-767,635,1194,1201,-759,425,396,1217,-1219,358,238,1213,-1216,1226,1222,587,-618,1233,1225,594,-1172,\n\t\t                    895,11,1202,-1231,1232,1208,138,-1049,617,588,1223,-1227,1231,1223,588,-1012,742,622,1227,-1230,1171,742,1229,-1234,550,430,1219,-1222,1230,1204,14,-896,\n\t\t                    1214,1213,238,-331,1212,1210,203,-234,1208,1207,46,-139,1228,1227,622,-715,1048,22,1205,-1233,1220,1219,430,-523,233,204,1211,-1213,1206,1202,11,-42,\n\t\t                    1204,1205,22,-15,1225,1224,589,-595,1011,589,1224,-1232,166,46,1207,-1210,1218,1216,395,-426,41,12,1203,-1207,1576,1575,1219,-1221,1579,1578,1244,-1247,\n\t\t                    1580,1581,1227,-1229,1255,1257,1292,-1311,1574,1578,1213,-1215,1584,1575,1250,-1253,1583,1577,1238,-1241,1266,1269,1245,-1241,1252,1261,1542,-1259,972,1356,1217,-397,\n\t\t                    1266,1240,1238,-1266,1266,1265,1279,-1283,1246,1244,1268,-1271,1278,1262,1236,-1260,1269,1268,1244,-1246,1296,973,395,-1217,1288,1261,1322,-1287,1284,1283,1268,-1270,\n\t\t                    1261,1252,1250,-1323,1270,1268,1283,-1286,1311,1308,1289,-1294,1351,1345,1315,-1300,1293,1290,1309,-1312,1345,1326,1325,-1316,1317,1325,1326,-1328,1606,1603,1337,-1547,\n\t\t                    1301,1317,1327,-1347,1546,1337,1334,-1555,1299,1316,1344,-1352,1547,1556,1354,-1349,1548,1552,1329,-1341,1549,1544,1341,-1348,1556,1553,1297,-1355,1344,1350,1276,-1356,\n\t\t                    933,1339,1211,-205,1552,1544,1332,-1330,1543,1549,1347,-1354,1548,1547,1348,-1278,1323,1275,1326,-1346,1350,1352,1263,-1277,1462,1293,1289,-1462,1316,1300,1350,-1345,\n\t\t                    1289,1346,1314,-1462,42,10,1359,-1364,896,15,1358,-1368,897,9,1360,-1369,1048,1369,1362,-23,19,1361,1360,-10,22,1362,1357,-15,15,42,1363,-1359,\n\t\t                    166,1366,1364,-47,46,1364,1365,-139,1054,1370,1366,-167,8,896,1367,-1358,10,897,1368,-1360,138,1365,1369,-1049,18,1361,1370,-1055,1093,1381,1377,-359,\n\t\t                    935,207,1407,-1377,936,201,1405,-1376,211,1374,1405,-202,403,1385,1398,-394,1087,1382,1373,-215,1132,1384,1390,-551,430,1396,1389,-523,358,1377,1371,-239,\n\t\t                    399,426,1395,-1389,330,1378,1382,-1088,202,936,1375,-1407,975,393,1398,-1393,200,935,1376,-1409,974,399,1388,-1392,210,1374,1381,-1094,238,1371,1378,-331,\n\t\t                    622,1401,1412,-715,207,234,1372,-1408,214,1373,1408,-207,522,1389,1383,-1127,234,202,1406,-1373,402,1385,1384,-1133,742,1411,1401,-623,1126,1383,1386,-407,\n\t\t                    618,586,1380,-1403,1165,1400,1410,-599,1013,591,1393,-1405,394,975,1392,-1398,406,1386,1387,-399,426,394,1397,-1396,392,974,1391,-1388,550,1390,1396,-431,\n\t\t                    586,1014,1403,-1381,591,618,1402,-1394,714,1412,1400,-1166,1171,1399,1411,-743,584,1013,1404,-1395,594,1409,1399,-1172,598,1410,1394,-591,1014,585,1379,-1404,\n\t\t                    595,1409,1379,-586,1610,1609,1423,-1414,1612,1611,1424,-1421,1614,1613,1434,-1434,1616,1615,1442,-1447,1611,1615,1425,-1425,1613,1617,1435,-1435,1628,1618,1426,-1605,\n\t\t                    1619,1610,1413,-1420,1619,1620,1431,-1437,1618,1621,1427,-1427,1609,1622,1422,-1424,1620,1623,1432,-1432,1621,1624,1428,-1428,1622,1625,1421,-1423,1624,1617,1418,-1429,\n\t\t                    1625,1612,1420,-1422,1346,1327,1459,-1315,1351,1344,1355,-1268,1259,1263,1352,-1279,1267,1323,1345,-1352,1249,1459,1275,-1248,1243,1267,1355,-1242,1327,1326,1275,-1460,\n\t\t                    1256,1226,1223,-1255,1457,934,203,-1211,894,1458,1203,-13,934,894,13,-207,894,934,1457,-1459,1226,1256,1253,-1223,1461,1460,1222,-1254,973,933,205,-399,\n\t\t                    1459,1249,1248,-1315,933,973,1296,-1340,1314,1356,1460,-1462,1462,1256,1254,-1261,1293,1462,1260,-1291,1460,1012,587,-1223,972,1012,1460,-1357,1012,972,397,-591,\n\t\t                    1256,1462,1461,-1254,1271,1287,1286,-1323,1639,1431,1432,-1641,1638,1436,1431,-1640,817,819,1467,-1466,1471,1468,820,-824,1472,1464,816,-854,865,816,1464,-1474,\n\t\t                    1469,1470,822,-822,1468,1469,821,-821,1473,1471,823,-866,1470,1466,818,-823,853,817,1465,-1473,1466,1467,819,-819,1480,1476,1466,-1471,1476,1477,1467,-1467,\n\t\t                    1472,1465,1475,-1483,1481,1478,1468,-1472,1465,1467,1477,-1476,1482,1474,1464,-1473,1473,1464,1474,-1484,1483,1481,1471,-1474,1479,1480,1470,-1470,1478,1479,1469,-1469,\n\t\t                    1489,1490,1480,-1480,1488,1489,1479,-1479,1490,1486,1476,-1481,1486,1487,1477,-1477,1482,1475,1485,-1493,1491,1488,1478,-1482,1475,1477,1487,-1486,1492,1484,1474,-1483,\n\t\t                    1483,1474,1484,-1494,1493,1491,1481,-1484,1502,1494,1484,-1493,1493,1484,1494,-1504,1503,1501,1491,-1494,1499,1500,1490,-1490,1498,1499,1489,-1489,1500,1496,1486,-1491,\n\t\t                    1496,1497,1487,-1487,1492,1485,1495,-1503,1501,1498,1488,-1492,1485,1487,1497,-1496,1502,1495,1505,-1513,1511,1508,1498,-1502,1495,1497,1507,-1506,1512,1504,1494,-1503,\n\t\t                    1503,1494,1504,-1514,1513,1511,1501,-1504,1509,1510,1500,-1500,1508,1509,1499,-1499,1510,1506,1496,-1501,1506,1507,1497,-1497,1520,1516,1506,-1511,1516,1517,1507,-1507,\n\t\t                    1512,1505,1515,-1523,1521,1518,1508,-1512,1505,1507,1517,-1516,1522,1514,1504,-1513,1513,1504,1514,-1524,1523,1521,1511,-1514,1519,1520,1510,-1510,1518,1519,1509,-1509,\n\t\t                    1274,1517,1516,-1274,1294,1515,1517,-1275,1306,1305,1526,-1528,1305,1304,1525,-1527,1304,1303,1524,-1526,1527,1526,1528,-1530,1529,1528,1530,-1532,1531,1530,1533,-1535,\n\t\t                    1318,1591,1559,-1593,1534,1533,1536,-1538,1537,1536,1539,-1541,1551,1539,1594,-1337,1280,1540,1539,-1552,18,214,206,-14,210,406,398,-206,1054,1087,214,-19,\n\t\t                    1087,1054,166,-331,330,166,1209,-1215,1583,1574,1214,-1210,1279,1588,1306,-1283,1269,1266,1282,-1285,1295,1522,1515,-1295,1093,1126,406,-211,1126,1093,358,-523,\n\t\t                    402,598,590,-398,1132,1165,598,-403,1165,1132,550,-715,714,550,1221,-1229,1584,1580,1228,-1222,1271,1251,1246,-1271,1287,1271,1270,-1286,1322,1250,1251,-1272,\n\t\t                    1576,1579,1246,-1252,1215,1220,522,-359,1258,1542,1292,-1258,1543,1554,1334,-1329,1346,1289,1308,-1302,1263,1237,1235,-1277,1263,1259,1234,-1238,1267,1243,1242,-1324,\n\t\t                    1290,1260,1255,-1311,1312,1514,1522,-1296,1321,1546,1554,-1321,1330,1324,1556,-1548,1353,1320,1554,-1544,1328,1331,1549,-1544,1324,1333,1553,-1557,1277,1349,1552,-1549,\n\t\t                    1331,1332,1544,-1550,1340,1330,1547,-1549,1349,1341,1544,-1553,1292,1542,1558,-1292,1536,1595,1594,-1540,1261,1288,1558,-1543,1533,1597,1595,-1537,1313,1523,1514,-1313,\n\t\t                    1523,1313,1585,-1522,1281,1518,1521,-1586,1338,1519,1518,-1282,1519,1338,1555,-1521,1553,1333,1559,-1592,1545,1557,1342,-1336,1557,1545,1343,-1273,1309,1290,1310,-1299,\n\t\t                    1302,1318,1592,-1450,1638,1454,1453,-1638,1637,1453,1452,-1637,1636,1452,1451,-1636,1635,1451,1455,-1635,1634,1455,1463,-1634,1626,1568,1416,-1615,1633,1463,1456,-1633,\n\t\t                    1632,1456,1573,-1632,1330,1454,1447,-1325,1340,1453,1454,-1331,1453,1340,1329,-1453,1452,1329,1332,-1452,1331,1455,1451,-1333,1328,1463,1455,-1332,1463,1328,1334,-1457,\n\t\t                    1630,1446,1442,-1632,1623,1626,1569,-1433,1616,1627,1571,-1430,1629,1572,1446,-1631,1337,1573,1456,-1335,1248,1217,1356,-1315,1251,1250,1575,-1577,1239,1238,1577,-1233,\n\t\t                    1249,1218,1217,-1249,1218,1249,1247,-1217,1215,1213,1578,-1580,1275,1296,1216,-1248,1258,1257,1581,-1581,1232,1577,1207,-1209,1296,1275,1323,-1340,1242,1211,1339,-1324,\n\t\t                    1243,1212,1211,-1243,1212,1243,1241,-1211,1245,1244,1578,-1575,1221,1219,1575,-1585,1233,1581,1257,-1226,1355,1457,1210,-1242,1209,1207,1577,-1584,1457,1355,1276,-1459,\n\t\t                    1235,1203,1458,-1277,1237,1206,1203,-1236,1233,1229,1227,-1582,1206,1237,1234,-1203,1259,1230,1202,-1235,1230,1259,1236,-1205,1262,1602,1582,-1237,1239,1582,1602,-1265,\n\t\t                    1225,1257,1255,-1225,1260,1231,1224,-1256,1231,1260,1254,-1224,1204,1236,1582,-1206,1240,1245,1574,-1584,1252,1258,1580,-1585,1220,1215,1579,-1577,1520,1555,1273,-1517,\n\t\t                    1586,1281,1585,-1588,1319,1338,1281,-1587,1352,1350,1300,-1308,1591,1589,1297,-1554,1603,1607,1573,-1338,1318,1555,1338,-1320,1603,1335,1563,-1608,1590,1278,1352,-1308,\n\t\t                    1307,1297,1589,-1591,1589,1319,1586,-1591,1278,1590,1586,-1263,1300,1354,1297,-1308,1316,1348,1354,-1301,1551,1557,1272,-1281,1557,1551,1336,-1343,1541,1561,1563,-1336,\n\t\t                    1538,1562,1561,-1542,1535,1564,1562,-1539,1532,1566,1564,-1536,1560,1565,1566,-1533,1449,1570,1565,-1561,1592,1567,1570,-1450,1559,1448,1567,-1593,1541,1335,1342,-1594,\n\t\t                    1524,1303,1302,-1450,1538,1541,1593,-1551,1342,1336,1594,-1594,1530,1599,1597,-1534,1599,1530,1528,-1602,1595,1550,1593,-1595,1550,1595,1597,-1597,1596,1597,1599,-1599,\n\t\t                    1598,1599,1601,-1601,1535,1538,1550,-1597,1598,1532,1535,-1597,1532,1598,1600,-1561,1528,1526,1525,-1602,1601,1525,1524,-1601,1524,1449,1560,-1601,1310,1292,1291,-1299,\n\t\t                    1299,1277,1348,-1317,1277,1299,1315,-1350,1349,1315,1325,-1342,1317,1347,1341,-1326,1301,1353,1347,-1318,1308,1320,1353,-1302,1311,1321,1320,-1309,1291,1272,1343,-1299,\n\t\t                    1272,1291,1558,-1281,1288,1540,1280,-1559,1540,1288,1286,-1538,1287,1534,1537,-1287,1534,1287,1285,-1532,1531,1285,1283,-1530,1284,1527,1529,-1284,1527,1284,1282,-1307,\n\t\t                    1239,1232,1205,-1583,1265,1264,1602,-1280,1239,1264,1265,-1239,1262,1586,1587,-1603,1545,1335,1603,-1607,1627,1628,1604,-1572,1333,1450,1448,-1560,1324,1447,1450,-1334,\n\t\t                    1298,1343,1608,-1310,1545,1606,1608,-1344,1321,1311,1309,-1609,1606,1546,1321,-1609,1319,1589,1591,-1319,1313,1588,1587,-1586,1588,1313,1312,-1307,1306,1312,1295,-1306,\n\t\t                    1305,1295,1294,-1305,1304,1294,1274,-1304,1303,1274,1273,-1303,1302,1273,1555,-1319,1648,1569,1433,-1648,1647,1433,1434,-1647,1646,1434,1435,-1646,1644,1566,1565,-1646,\n\t\t                    1643,1564,1566,-1645,1642,1562,1564,-1644,1641,1561,1562,-1643,1641,1605,1572,-1630,1640,1432,1569,-1649,1430,1440,1609,-1611,1437,1441,1611,-1613,1416,1417,1613,-1615,\n\t\t                    1429,1425,1615,-1617,1441,1442,1615,-1612,1417,1418,1617,-1614,1605,1443,1618,-1629,1436,1430,1610,-1620,1419,1414,1620,-1620,1443,1444,1621,-1619,1440,1439,1622,-1610,\n\t\t                    1414,1415,1623,-1621,1444,1445,1624,-1622,1439,1438,1625,-1623,1445,1435,1617,-1625,1438,1437,1612,-1626,1569,1626,1614,-1434,1415,1568,1626,-1624,1446,1572,1627,-1617,\n\t\t                    1572,1605,1628,-1628,1563,1629,1630,-1608,1436,1638,1637,-1431,1444,1643,1644,-1446,1454,1638,1639,-1448,1570,1646,1645,-1566,1447,1639,1640,-1451,1441,1632,1631,-1443,\n\t\t                    1450,1640,1648,-1449,1439,1635,1634,-1439,1437,1633,1632,-1442,1567,1647,1646,-1571,1605,1641,1642,-1444,1440,1636,1635,-1440,1438,1634,1633,-1438,1561,1641,1629,-1564,\n\t\t                    1445,1644,1645,-1436,1430,1637,1636,-1441,1607,1630,1631,-1574,1443,1642,1643,-1445,1448,1648,1647,-1568,1602,1587,1588,-1280,2564,2542,1653,-1757,2563,2541,1655,-1725,\n\t\t                    1721,1689,1654,-1724,3012,1690,1661,-3009,3016,2544,1660,-3008,3017,2543,1662,-3010,2567,2539,1652,-1762,2568,2540,1650,-1763,1764,1688,1651,-1768,2709,1738,1666,-2696,\n\t\t                    1751,1758,1654,-1690,2711,1749,1665,-2697,3018,3011,1672,-2699,1716,1713,1658,-1669,1763,1762,1650,-1671,3010,3009,1662,-1668,1722,1724,1655,-1670,1738,1740,1649,-1667,\n\t\t                    3011,3006,1657,-1673,1718,1717,1672,-1658,2565,1759,1653,-2543,2566,1757,1655,-2542,2562,2571,1779,-1710,1706,1782,1783,-1713,2705,2717,1778,-1703,2557,2572,1784,-1712,\n\t\t                    1709,1779,1782,-1707,2552,2547,1673,-1699,1683,1675,1673,-1688,1701,1677,1676,-1700,2700,2716,1675,-1684,2551,2548,1679,-1701,1809,1818,1678,-1682,1703,1680,1674,-1698,\n\t\t                    1700,1679,1680,-1704,1679,1685,1682,-1681,1680,1682,1692,-1675,1756,1653,1689,-1722,3007,1660,1690,-3013,1761,1652,1688,-1765,1814,1737,1693,-1818,1759,1751,1689,-1654,\n\t\t                    1805,1752,1694,-1817,3015,3013,1696,-1811,1818,1808,1704,-1679,2548,2550,1685,-1680,2716,2705,1702,-1676,1677,1684,1686,-1677,1675,1702,1698,-1674,2547,2549,1687,-1674,\n\t\t                    1806,1813,1705,-1778,1778,1707,1711,-1785,2571,2551,1700,-1780,2717,2706,1707,-1779,1779,1700,1703,-1783,1780,1701,1699,-1782,1782,1703,1697,-1784,2572,2552,1698,-1785,\n\t\t                    2576,2562,1709,-1836,1836,1706,1712,-1835,1840,1811,1736,-1834,1691,1659,1714,-1720,2698,1672,1717,-2708,1760,1757,1713,-1717,1750,1749,1717,-1719,2545,1664,1715,-2554,\n\t\t                    2546,1658,1713,-2555,1664,1691,1719,-1716,1810,1696,1720,-1808,1747,1726,1741,-1747,1831,1708,1710,-1833,2560,2555,1743,-1746,2732,2710,1734,-1838,1776,1774,1730,-1735,\n\t\t                    2712,1754,1727,-2709,1804,1753,1725,-1813,2540,2560,1745,-1651,1739,1742,1726,-1748,2561,2556,1742,-1740,1715,1719,1751,-1760,1748,1745,1743,-1729,1812,1725,1737,-1815,\n\t\t                    1754,1755,1744,-1728,2577,2557,1711,-1839,2553,1715,1759,-2566,1835,1709,1706,-1837,1726,1721,1723,-1742,1802,1773,1736,-1812,2539,2561,1739,-1653,1688,1747,1746,-1652,\n\t\t                    1670,1650,1745,-1749,2714,1776,1734,-2711,1837,1734,1730,-1839,2555,2563,1724,-1744,1727,1744,1740,-1739,2708,1727,1738,-2710,1652,1739,1747,-1689,1669,1655,1757,-1761,\n\t\t                    2707,1717,1749,-2712,1719,1714,1758,-1752,1816,1694,1753,-1805,1665,1656,1755,-1755,2554,1713,1757,-2567,1656,1665,1749,-1751,1807,1720,1752,-1806,2696,1665,1754,-2713,\n\t\t                    2556,2564,1756,-1743,1742,1756,1721,-1727,1728,1743,1724,-1723,2569,2567,1761,-1770,2570,2568,1762,-1771,1772,1764,1767,-1776,1771,1770,1762,-1764,1769,1761,1764,-1773,\n\t\t                    1666,1649,1766,-1769,1817,1693,1765,-1804,2695,1666,1768,-2714,1768,1766,1774,-1777,1803,1765,1773,-1803,2713,1768,1776,-2715,2559,2569,1769,-1730,2558,2570,1770,-1732,\n\t\t                    1735,1772,1775,-1733,1733,1731,1770,-1772,1729,1769,1772,-1736,1708,1780,1781,-1711,1808,1806,1777,-1705,1702,1778,1784,-1699,1737,1795,1785,-1694,1752,1797,1786,-1695,\n\t\t                    3013,3014,1788,-1697,1704,1777,1801,-1792,1681,1678,1789,-1791,1678,1704,1791,-1790,1777,1705,1792,-1802,1696,1788,1793,-1721,1833,1736,1796,-1840,1753,1798,1794,-1726,\n\t\t                    1773,1800,1796,-1737,1725,1794,1795,-1738,1720,1793,1797,-1753,1694,1786,1798,-1754,1693,1785,1799,-1766,1765,1799,1800,-1774,2722,1807,1805,-2721,3019,3015,1810,-2705,\n\t\t                    2704,1810,1807,-2723,2718,1802,1811,-2726,2699,2724,1808,-1819,2702,1816,1804,-2720,2701,1817,1803,-2722,2715,2726,1813,-1807,2727,1814,1817,-2702,2720,1805,1816,-2703,\n\t\t                    2728,1812,1814,-2728,2724,2715,1806,-1809,2723,2699,1818,-1810,2721,1803,1802,-2719,2733,2725,1811,-1841,2719,1804,1812,-2729,1828,1809,1681,-1821,1685,1823,1819,-1683,\n\t\t                    1790,1827,1820,-1682,2550,2573,1823,-1686,1821,1683,1687,-1826,1684,1822,1824,-1687,2723,2730,1822,-1685,2549,2574,1825,-1688,2729,2700,1683,-1822,1682,1819,1826,-1693,\n\t\t                    2730,2731,1830,-1823,2729,1821,1830,-2732,1821,1825,1829,-1831,1830,1829,1824,-1823,2575,1819,1823,-2574,2575,1829,1825,-2575,2558,2576,1835,-1733,1735,1836,1834,-1730,\n\t\t                    1813,1840,1833,-1706,1733,1831,1832,-1732,2706,2732,1837,-1708,2559,2577,1838,-1731,1732,1835,1836,-1736,1707,1837,1838,-1712,1705,1833,1839,-1793,2726,2733,1840,-1814,\n\t\t                    2603,2581,1845,-1949,2602,2580,1847,-1917,1913,1881,1846,-1916,3021,1882,1853,-3056,3025,2583,1852,-3057,3024,2582,1854,-3055,2606,2578,1844,-1954,2607,2579,1842,-1955,\n\t\t                    1956,1880,1843,-1960,2748,1930,1858,-2735,1943,1950,1846,-1882,2750,1941,1857,-2736,3031,3022,1864,-2738,1908,1905,1850,-1861,1955,1954,1842,-1863,3023,3054,1854,-1860,\n\t\t                    1914,1916,1847,-1862,1930,1932,1841,-1859,3022,3057,1849,-1865,1910,1909,1864,-1850,2604,1951,1845,-2582,2605,1949,1847,-2581,2601,2610,1971,-1902,1898,1974,1975,-1905,\n\t\t                    2744,2756,1970,-1895,2596,2611,1976,-1904,1901,1971,1974,-1899,2591,2586,1865,-1891,1875,1867,1865,-1880,1893,1869,1868,-1892,2739,2755,1867,-1876,2590,2587,1871,-1893,\n\t\t                    2001,2010,1870,-1874,1895,1872,1866,-1890,1892,1871,1872,-1896,1871,1877,1874,-1873,1872,1874,1884,-1867,1948,1845,1881,-1914,3056,1852,1882,-3022,1953,1844,1880,-1957,\n\t\t                    2006,1929,1885,-2010,1951,1943,1881,-1846,1997,1944,1886,-2009,3026,3020,1888,-2003,2010,2000,1896,-1871,2587,2589,1877,-1872,2755,2744,1894,-1868,1869,1876,1878,-1869,\n\t\t                    1867,1894,1890,-1866,2586,2588,1879,-1866,1998,2005,1897,-1970,1970,1899,1903,-1977,2610,2590,1892,-1972,2756,2745,1899,-1971,1971,1892,1895,-1975,1972,1893,1891,-1974,\n\t\t                    1974,1895,1889,-1976,2611,2591,1890,-1977,2615,2601,1901,-2028,2028,1898,1904,-2027,2032,2003,1928,-2026,1883,1851,1906,-1912,2737,1864,1909,-2747,1952,1949,1905,-1909,\n\t\t                    1942,1941,1909,-1911,2584,1856,1907,-2593,2585,1850,1905,-2594,1856,1883,1911,-1908,2002,1888,1912,-2000,1939,1918,1933,-1939,2023,1900,1902,-2025,2599,2594,1935,-1938,\n\t\t                    2771,2749,1926,-2030,1968,1966,1922,-1927,2751,1946,1919,-2748,1996,1945,1917,-2005,2579,2599,1937,-1843,1931,1934,1918,-1940,2600,2595,1934,-1932,1907,1911,1943,-1952,\n\t\t                    1940,1937,1935,-1921,2004,1917,1929,-2007,1946,1947,1936,-1920,2616,2596,1903,-2031,2592,1907,1951,-2605,2027,1901,1898,-2029,1918,1913,1915,-1934,1994,1965,1928,-2004,\n\t\t                    2578,2600,1931,-1845,1880,1939,1938,-1844,1862,1842,1937,-1941,2753,1968,1926,-2750,2029,1926,1922,-2031,2594,2602,1916,-1936,1919,1936,1932,-1931,2747,1919,1930,-2749,\n\t\t                    1844,1931,1939,-1881,1861,1847,1949,-1953,2746,1909,1941,-2751,1911,1906,1950,-1944,2008,1886,1945,-1997,1857,1848,1947,-1947,2593,1905,1949,-2606,1848,1857,1941,-1943,\n\t\t                    1999,1912,1944,-1998,2735,1857,1946,-2752,2595,2603,1948,-1935,1934,1948,1913,-1919,1920,1935,1916,-1915,2608,2606,1953,-1962,2609,2607,1954,-1963,1964,1956,1959,-1968,\n\t\t                    1963,1962,1954,-1956,1961,1953,1956,-1965,1858,1841,1958,-1961,2009,1885,1957,-1996,2734,1858,1960,-2753,1960,1958,1966,-1969,1995,1957,1965,-1995,2752,1960,1968,-2754,\n\t\t                    2598,2608,1961,-1922,2597,2609,1962,-1924,1927,1964,1967,-1925,1925,1923,1962,-1964,1921,1961,1964,-1928,1900,1972,1973,-1903,2000,1998,1969,-1897,1894,1970,1976,-1891,\n\t\t                    1929,1987,1977,-1886,1944,1989,1978,-1887,3020,3027,1980,-1889,1896,1969,1993,-1984,1873,1870,1981,-1983,1870,1896,1983,-1982,1969,1897,1984,-1994,1888,1980,1985,-1913,\n\t\t                    2025,1928,1988,-2032,1945,1990,1986,-1918,1965,1992,1988,-1929,1917,1986,1987,-1930,1912,1985,1989,-1945,1886,1978,1990,-1946,1885,1977,1991,-1958,1957,1991,1992,-1966,\n\t\t                    2761,1999,1997,-2760,3030,3026,2002,-2744,2743,2002,1999,-2762,2757,1994,2003,-2765,2738,2763,2000,-2011,2741,2008,1996,-2759,2740,2009,1995,-2761,2754,2765,2005,-1999,\n\t\t                    2766,2006,2009,-2741,2759,1997,2008,-2742,2767,2004,2006,-2767,2763,2754,1998,-2001,2762,2738,2010,-2002,2760,1995,1994,-2758,2772,2764,2003,-2033,2758,1996,2004,-2768,\n\t\t                    2020,2001,1873,-2013,1877,2015,2011,-1875,1982,2019,2012,-1874,2589,2612,2015,-1878,2013,1875,1879,-2018,1876,2014,2016,-1879,2762,2769,2014,-1877,2588,2613,2017,-1880,\n\t\t                    2768,2739,1875,-2014,1874,2011,2018,-1885,2769,2770,2022,-2015,2768,2013,2022,-2771,2013,2017,2021,-2023,2022,2021,2016,-2015,2614,2011,2015,-2613,2614,2021,2017,-2614,\n\t\t                    2597,2615,2027,-1925,1927,2028,2026,-1922,2005,2032,2025,-1898,1925,2023,2024,-1924,2745,2771,2029,-1900,2598,2616,2030,-1923,1924,2027,2028,-1928,1899,2029,2030,-1904,\n\t\t                    1897,2025,2031,-1985,2765,2772,2032,-2006,2642,2620,2037,-2141,2641,2619,2039,-2109,2105,2073,2038,-2108,3044,2074,2045,-3047,3040,2622,2044,-3038,3041,2621,2046,-3048,\n\t\t                    2645,2617,2036,-2146,2646,2618,2034,-2147,2148,2072,2035,-2152,2787,2122,2050,-2774,2135,2142,2038,-2074,2789,2133,2049,-2775,3032,3035,2056,-2777,2100,2097,2042,-2053,\n\t\t                    2147,2146,2034,-2055,3034,3047,2046,-2052,2106,2108,2039,-2054,2122,2124,2033,-2051,3035,3036,2041,-2057,2102,2101,2056,-2042,2643,2143,2037,-2621,2644,2141,2039,-2620,\n\t\t                    2640,2649,2163,-2094,2090,2166,2167,-2097,2783,2795,2162,-2087,2635,2650,2168,-2096,2093,2163,2166,-2091,2630,2625,2057,-2083,2067,2059,2057,-2072,2085,2061,2060,-2084,\n\t\t                    2778,2794,2059,-2068,2629,2626,2063,-2085,2193,2202,2062,-2066,2087,2064,2058,-2082,2084,2063,2064,-2088,2063,2069,2066,-2065,2064,2066,2076,-2059,2140,2037,2073,-2106,\n\t\t                    3037,2044,2074,-3045,2145,2036,2072,-2149,2198,2121,2077,-2202,2143,2135,2073,-2038,2189,2136,2078,-2201,3039,3045,2080,-2195,2202,2192,2088,-2063,2626,2628,2069,-2064,\n\t\t                    2794,2783,2086,-2060,2061,2068,2070,-2061,2059,2086,2082,-2058,2625,2627,2071,-2058,2190,2197,2089,-2162,2162,2091,2095,-2169,2649,2629,2084,-2164,2795,2784,2091,-2163,\n\t\t                    2163,2084,2087,-2167,2164,2085,2083,-2166,2166,2087,2081,-2168,2650,2630,2082,-2169,2654,2640,2093,-2220,2220,2090,2096,-2219,2224,2195,2120,-2218,2075,2043,2098,-2104,\n\t\t                    2776,2056,2101,-2786,2144,2141,2097,-2101,2134,2133,2101,-2103,2623,2048,2099,-2632,2624,2042,2097,-2633,2048,2075,2103,-2100,2194,2080,2104,-2192,2131,2110,2125,-2131,\n\t\t                    2215,2092,2094,-2217,2638,2633,2127,-2130,2810,2788,2118,-2222,2160,2158,2114,-2119,2790,2138,2111,-2787,2188,2137,2109,-2197,2618,2638,2129,-2035,2123,2126,2110,-2132,\n\t\t                    2639,2634,2126,-2124,2099,2103,2135,-2144,2132,2129,2127,-2113,2196,2109,2121,-2199,2138,2139,2128,-2112,2655,2635,2095,-2223,2631,2099,2143,-2644,2219,2093,2090,-2221,\n\t\t                    2110,2105,2107,-2126,2186,2157,2120,-2196,2617,2639,2123,-2037,2072,2131,2130,-2036,2054,2034,2129,-2133,2792,2160,2118,-2789,2221,2118,2114,-2223,2633,2641,2108,-2128,\n\t\t                    2111,2128,2124,-2123,2786,2111,2122,-2788,2036,2123,2131,-2073,2053,2039,2141,-2145,2785,2101,2133,-2790,2103,2098,2142,-2136,2200,2078,2137,-2189,2049,2040,2139,-2139,\n\t\t                    2632,2097,2141,-2645,2040,2049,2133,-2135,2191,2104,2136,-2190,2774,2049,2138,-2791,2634,2642,2140,-2127,2126,2140,2105,-2111,2112,2127,2108,-2107,2647,2645,2145,-2154,\n\t\t                    2648,2646,2146,-2155,2156,2148,2151,-2160,2155,2154,2146,-2148,2153,2145,2148,-2157,2050,2033,2150,-2153,2201,2077,2149,-2188,2773,2050,2152,-2792,2152,2150,2158,-2161,\n\t\t                    2187,2149,2157,-2187,2791,2152,2160,-2793,2637,2647,2153,-2114,2636,2648,2154,-2116,2119,2156,2159,-2117,2117,2115,2154,-2156,2113,2153,2156,-2120,2092,2164,2165,-2095,\n\t\t                    2192,2190,2161,-2089,2086,2162,2168,-2083,2121,2179,2169,-2078,2136,2181,2170,-2079,3045,3038,2172,-2081,2088,2161,2185,-2176,2065,2062,2173,-2175,2062,2088,2175,-2174,\n\t\t                    2161,2089,2176,-2186,2080,2172,2177,-2105,2217,2120,2180,-2224,2137,2182,2178,-2110,2157,2184,2180,-2121,2109,2178,2179,-2122,2104,2177,2181,-2137,2078,2170,2182,-2138,\n\t\t                    2077,2169,2183,-2150,2149,2183,2184,-2158,2800,2191,2189,-2799,3033,3039,2194,-2783,2782,2194,2191,-2801,2796,2186,2195,-2804,2777,2802,2192,-2203,2780,2200,2188,-2798,\n\t\t                    2779,2201,2187,-2800,2793,2804,2197,-2191,2805,2198,2201,-2780,2798,2189,2200,-2781,2806,2196,2198,-2806,2802,2793,2190,-2193,2801,2777,2202,-2194,2799,2187,2186,-2797,\n\t\t                    2811,2803,2195,-2225,2797,2188,2196,-2807,2212,2193,2065,-2205,2069,2207,2203,-2067,2174,2211,2204,-2066,2628,2651,2207,-2070,2205,2067,2071,-2210,2068,2206,2208,-2071,\n\t\t                    2801,2808,2206,-2069,2627,2652,2209,-2072,2807,2778,2067,-2206,2066,2203,2210,-2077,2808,2809,2214,-2207,2807,2205,2214,-2810,2205,2209,2213,-2215,2214,2213,2208,-2207,\n\t\t                    2653,2203,2207,-2652,2653,2213,2209,-2653,2636,2654,2219,-2117,2119,2220,2218,-2114,2197,2224,2217,-2090,2117,2215,2216,-2116,2784,2810,2221,-2092,2637,2655,2222,-2115,\n\t\t                    2116,2219,2220,-2120,2091,2221,2222,-2096,2089,2217,2223,-2177,2804,2811,2224,-2198,2681,2659,2229,-2333,2680,2658,2231,-2301,2297,2265,2230,-2300,3051,2266,2237,-3030,\n\t\t                    3053,2661,2236,-3043,3052,2660,2238,-3029,2684,2656,2228,-2338,2685,2657,2226,-2339,2340,2264,2227,-2344,2826,2314,2242,-2813,2327,2334,2230,-2266,2828,2325,2241,-2814,\n\t\t                    3049,3059,2248,-2816,2292,2289,2234,-2245,2339,2338,2226,-2247,3058,3028,2238,-2244,2298,2300,2231,-2246,2314,2316,2225,-2243,3059,3043,2233,-2249,2294,2293,2248,-2234,\n\t\t                    2682,2335,2229,-2660,2683,2333,2231,-2659,2679,2688,2355,-2286,2282,2358,2359,-2289,2822,2834,2354,-2279,2674,2689,2360,-2288,2285,2355,2358,-2283,2669,2664,2249,-2275,\n\t\t                    2259,2251,2249,-2264,2277,2253,2252,-2276,2817,2833,2251,-2260,2668,2665,2255,-2277,2385,2394,2254,-2258,2279,2256,2250,-2274,2276,2255,2256,-2280,2255,2261,2258,-2257,\n\t\t                    2256,2258,2268,-2251,2332,2229,2265,-2298,3042,2236,2266,-3052,2337,2228,2264,-2341,2390,2313,2269,-2394,2335,2327,2265,-2230,2381,2328,2270,-2393,3060,3050,2272,-2387,\n\t\t                    2394,2384,2280,-2255,2665,2667,2261,-2256,2833,2822,2278,-2252,2253,2260,2262,-2253,2251,2278,2274,-2250,2664,2666,2263,-2250,2382,2389,2281,-2354,2354,2283,2287,-2361,\n\t\t                    2688,2668,2276,-2356,2834,2823,2283,-2355,2355,2276,2279,-2359,2356,2277,2275,-2358,2358,2279,2273,-2360,2689,2669,2274,-2361,2693,2679,2285,-2412,2412,2282,2288,-2411,\n\t\t                    2416,2387,2312,-2410,2267,2235,2290,-2296,2815,2248,2293,-2825,2336,2333,2289,-2293,2326,2325,2293,-2295,2662,2240,2291,-2671,2663,2234,2289,-2672,2240,2267,2295,-2292,\n\t\t                    2386,2272,2296,-2384,2323,2302,2317,-2323,2407,2284,2286,-2409,2677,2672,2319,-2322,2849,2827,2310,-2414,2352,2350,2306,-2311,2829,2330,2303,-2826,2380,2329,2301,-2389,\n\t\t                    2657,2677,2321,-2227,2315,2318,2302,-2324,2678,2673,2318,-2316,2291,2295,2327,-2336,2324,2321,2319,-2305,2388,2301,2313,-2391,2330,2331,2320,-2304,2694,2674,2287,-2415,\n\t\t                    2670,2291,2335,-2683,2411,2285,2282,-2413,2302,2297,2299,-2318,2378,2349,2312,-2388,2656,2678,2315,-2229,2264,2323,2322,-2228,2246,2226,2321,-2325,2831,2352,2310,-2828,\n\t\t                    2413,2310,2306,-2415,2672,2680,2300,-2320,2303,2320,2316,-2315,2825,2303,2314,-2827,2228,2315,2323,-2265,2245,2231,2333,-2337,2824,2293,2325,-2829,2295,2290,2334,-2328,\n\t\t                    2392,2270,2329,-2381,2241,2232,2331,-2331,2671,2289,2333,-2684,2232,2241,2325,-2327,2383,2296,2328,-2382,2813,2241,2330,-2830,2673,2681,2332,-2319,2318,2332,2297,-2303,\n\t\t                    2304,2319,2300,-2299,2686,2684,2337,-2346,2687,2685,2338,-2347,2348,2340,2343,-2352,2347,2346,2338,-2340,2345,2337,2340,-2349,2242,2225,2342,-2345,2393,2269,2341,-2380,\n\t\t                    2812,2242,2344,-2831,2344,2342,2350,-2353,2379,2341,2349,-2379,2830,2344,2352,-2832,2676,2686,2345,-2306,2675,2687,2346,-2308,2311,2348,2351,-2309,2309,2307,2346,-2348,\n\t\t                    2305,2345,2348,-2312,2284,2356,2357,-2287,2384,2382,2353,-2281,2278,2354,2360,-2275,2313,2371,2361,-2270,2328,2373,2362,-2271,3050,3061,2364,-2273,2280,2353,2377,-2368,\n\t\t                    2257,2254,2365,-2367,2254,2280,2367,-2366,2353,2281,2368,-2378,2272,2364,2369,-2297,2409,2312,2372,-2416,2329,2374,2370,-2302,2349,2376,2372,-2313,2301,2370,2371,-2314,\n\t\t                    2296,2369,2373,-2329,2270,2362,2374,-2330,2269,2361,2375,-2342,2341,2375,2376,-2350,2839,2383,2381,-2838,3048,3060,2386,-2822,2821,2386,2383,-2840,2835,2378,2387,-2843,\n\t\t                    2816,2841,2384,-2395,2819,2392,2380,-2837,2818,2393,2379,-2839,2832,2843,2389,-2383,2844,2390,2393,-2819,2837,2381,2392,-2820,2845,2388,2390,-2845,2841,2832,2382,-2385,\n\t\t                    2840,2816,2394,-2386,2838,2379,2378,-2836,2850,2842,2387,-2417,2836,2380,2388,-2846,2404,2385,2257,-2397,2261,2399,2395,-2259,2366,2403,2396,-2258,2667,2690,2399,-2262,\n\t\t                    2397,2259,2263,-2402,2260,2398,2400,-2263,2840,2847,2398,-2261,2666,2691,2401,-2264,2846,2817,2259,-2398,2258,2395,2402,-2269,2847,2848,2406,-2399,2846,2397,2406,-2849,\n\t\t                    2397,2401,2405,-2407,2406,2405,2400,-2399,2692,2395,2399,-2691,2692,2405,2401,-2692,2675,2693,2411,-2309,2311,2412,2410,-2306,2389,2416,2409,-2282,2309,2407,2408,-2308,\n\t\t                    2823,2849,2413,-2284,2676,2694,2414,-2307,2308,2411,2412,-2312,2283,2413,2414,-2288,2281,2409,2415,-2369,2843,2850,2416,-2390,2478,2417,2420,-2474,2479,2419,2418,-2475,\n\t\t                    2476,2438,2419,-2480,2502,2466,2421,-2498,2475,2474,2418,-2423,2466,2468,2417,-2422,2454,2493,2491,-2454,2450,2494,2495,-2457,2500,2506,2490,-2447,2456,2495,2496,-2456,\n\t\t                    2453,2491,2494,-2451,2441,2424,2423,-2443,2433,2425,2423,-2438,2445,2427,2426,-2444,2499,2498,2425,-2434,2443,2426,2429,-2445,2511,2516,2428,-2432,2447,2430,2424,-2442,\n\t\t                    2444,2429,2430,-2448,2429,2435,2432,-2431,2430,2432,2439,-2425,2473,2420,2438,-2477,2514,2465,2440,-2516,2516,2510,2448,-2429,2426,2436,2435,-2430,2498,2500,2446,-2426,\n\t\t                    2427,2434,2436,-2427,2425,2446,2442,-2424,2424,2439,2437,-2424,2509,2513,2449,-2490,2490,2451,2455,-2497,2493,2443,2444,-2492,2506,2501,2451,-2491,2491,2444,2447,-2495,\n\t\t                    2492,2445,2443,-2494,2494,2447,2441,-2496,2495,2441,2442,-2497,2530,2454,2453,-2534,2534,2450,2456,-2533,2538,2512,2464,-2532,2529,2452,2454,-2531,2537,2503,2462,-2536,\n\t\t                    2488,2486,2458,-2463,2419,2470,2469,-2419,2532,2456,2455,-2537,2533,2453,2450,-2535,2507,2485,2464,-2513,2417,2468,2467,-2421,2438,2471,2470,-2420,2422,2418,2469,-2473,\n\t\t                    2505,2488,2462,-2504,2535,2462,2458,-2537,2420,2467,2471,-2439,2486,2478,2473,-2482,2487,2479,2474,-2483,2484,2476,2479,-2488,2483,2482,2474,-2476,2481,2473,2476,-2485,\n\t\t                    2421,2417,2478,-2481,2515,2440,2477,-2509,2497,2421,2480,-2505,2480,2478,2486,-2489,2508,2477,2485,-2508,2504,2480,2488,-2506,2458,2486,2481,-2458,2460,2487,2482,-2460,\n\t\t                    2463,2484,2487,-2461,2461,2459,2482,-2484,2457,2481,2484,-2464,2452,2492,2493,-2455,2510,2509,2489,-2449,2446,2490,2496,-2443,2465,2502,2497,-2441,2448,2489,2506,-2501,\n\t\t                    2431,2428,2498,-2500,2428,2448,2500,-2499,2489,2449,2501,-2507,2531,2464,2503,-2538,2485,2505,2503,-2465,2440,2497,2504,-2478,2477,2504,2505,-2486,2483,2507,2512,-2462,\n\t\t                    2427,2445,2510,-2517,2422,2515,2508,-2476,2492,2452,2513,-2510,2472,2514,2515,-2423,2445,2492,2509,-2511,2434,2427,2516,-2512,2475,2508,2507,-2484,2529,2461,2512,-2539,\n\t\t                    2526,2511,2431,-2519,2435,2521,2517,-2433,2499,2525,2518,-2432,2436,2522,2521,-2436,2519,2433,2437,-2524,2434,2520,2522,-2437,2511,2526,2520,-2435,2439,2524,2523,-2438,\n\t\t                    2525,2499,2433,-2520,2432,2517,2524,-2440,2526,2518,2528,-2521,2525,2519,2528,-2519,2519,2523,2527,-2529,2528,2527,2522,-2521,2527,2517,2521,-2523,2517,2527,2523,-2525,\n\t\t                    2459,2530,2533,-2461,2463,2534,2532,-2458,2513,2538,2531,-2450,2461,2529,2530,-2460,2501,2537,2535,-2452,2457,2532,2536,-2459,2460,2533,2534,-2464,2451,2535,2536,-2456,\n\t\t                    2449,2531,2537,-2502,2452,2529,2538,-2514,1755,1656,2542,-2565,1723,1654,2541,-2564,3006,1663,2544,-3017,3008,1661,2543,-3018,1766,1649,2539,-2568,1767,1651,2540,-2569,\n\t\t                    1750,2565,2542,-1657,1758,2566,2541,-1655,1710,1781,2571,-2563,1712,1783,2572,-2558,1697,1674,2547,-2553,1699,1676,2548,-2552,1676,1686,2550,-2549,1674,1692,2549,-2548,\n\t\t                    1781,1699,2551,-2572,1783,1697,2552,-2573,1832,1710,2562,-2577,1657,2545,2553,-1719,1659,2546,2554,-1715,1746,1741,2555,-2561,1651,1746,2560,-2541,1740,1744,2556,-2562,\n\t\t                    1834,1712,2557,-2578,1718,2553,2565,-1751,1649,1740,2561,-2540,1741,1723,2563,-2556,1714,2554,2566,-1759,1744,1755,2564,-2557,1774,1766,2567,-2570,1775,1767,2568,-2571,\n\t\t                    1730,1774,2569,-2560,1732,1775,2570,-2559,1686,1824,2573,-2551,1692,1826,2574,-2550,1829,2575,2573,-1825,1819,2575,2574,-1827,1731,1832,2576,-2559,1729,1834,2577,-2560,\n\t\t                    1947,1848,2581,-2604,1915,1846,2580,-2603,3057,1855,2583,-3026,3055,1853,2582,-3025,1958,1841,2578,-2607,1959,1843,2579,-2608,1942,2604,2581,-1849,1950,2605,2580,-1847,\n\t\t                    1902,1973,2610,-2602,1904,1975,2611,-2597,1889,1866,2586,-2592,1891,1868,2587,-2591,1868,1878,2589,-2588,1866,1884,2588,-2587,1973,1891,2590,-2611,1975,1889,2591,-2612,\n\t\t                    2024,1902,2601,-2616,1849,2584,2592,-1911,1851,2585,2593,-1907,1938,1933,2594,-2600,1843,1938,2599,-2580,1932,1936,2595,-2601,2026,1904,2596,-2617,1910,2592,2604,-1943,\n\t\t                    1841,1932,2600,-2579,1933,1915,2602,-2595,1906,2593,2605,-1951,1936,1947,2603,-2596,1966,1958,2606,-2609,1967,1959,2607,-2610,1922,1966,2608,-2599,1924,1967,2609,-2598,\n\t\t                    1878,2016,2612,-2590,1884,2018,2613,-2589,2021,2614,2612,-2017,2011,2614,2613,-2019,1923,2024,2615,-2598,1921,2026,2616,-2599,2139,2040,2620,-2643,2107,2038,2619,-2642,\n\t\t                    3036,2047,2622,-3041,3046,2045,2621,-3042,2150,2033,2617,-2646,2151,2035,2618,-2647,2134,2643,2620,-2041,2142,2644,2619,-2039,2094,2165,2649,-2641,2096,2167,2650,-2636,\n\t\t                    2081,2058,2625,-2631,2083,2060,2626,-2630,2060,2070,2628,-2627,2058,2076,2627,-2626,2165,2083,2629,-2650,2167,2081,2630,-2651,2216,2094,2640,-2655,2041,2623,2631,-2103,\n\t\t                    2043,2624,2632,-2099,2130,2125,2633,-2639,2035,2130,2638,-2619,2124,2128,2634,-2640,2218,2096,2635,-2656,2102,2631,2643,-2135,2033,2124,2639,-2618,2125,2107,2641,-2634,\n\t\t                    2098,2632,2644,-2143,2128,2139,2642,-2635,2158,2150,2645,-2648,2159,2151,2646,-2649,2114,2158,2647,-2638,2116,2159,2648,-2637,2070,2208,2651,-2629,2076,2210,2652,-2628,\n\t\t                    2213,2653,2651,-2209,2203,2653,2652,-2211,2115,2216,2654,-2637,2113,2218,2655,-2638,2331,2232,2659,-2682,2299,2230,2658,-2681,3043,2239,2661,-3054,3029,2237,2660,-3053,\n\t\t                    2342,2225,2656,-2685,2343,2227,2657,-2686,2326,2682,2659,-2233,2334,2683,2658,-2231,2286,2357,2688,-2680,2288,2359,2689,-2675,2273,2250,2664,-2670,2275,2252,2665,-2669,\n\t\t                    2252,2262,2667,-2666,2250,2268,2666,-2665,2357,2275,2668,-2689,2359,2273,2669,-2690,2408,2286,2679,-2694,2233,2662,2670,-2295,2235,2663,2671,-2291,2322,2317,2672,-2678,\n\t\t                    2227,2322,2677,-2658,2316,2320,2673,-2679,2410,2288,2674,-2695,2294,2670,2682,-2327,2225,2316,2678,-2657,2317,2299,2680,-2673,2290,2671,2683,-2335,2320,2331,2681,-2674,\n\t\t                    2350,2342,2684,-2687,2351,2343,2685,-2688,2306,2350,2686,-2677,2308,2351,2687,-2676,2262,2400,2690,-2668,2268,2402,2691,-2667,2405,2692,2690,-2401,2395,2692,2691,-2403,\n\t\t                    2307,2408,2693,-2676,2305,2410,2694,-2677,1795,2709,2695,-1786,1797,2711,2696,-1787,3014,3018,2698,-1789,1791,1801,2717,-2706,1790,1789,2716,-2701,1789,1791,2705,-2717,\n\t\t                    1801,1792,2706,-2718,1788,2698,2707,-1794,1839,1796,2710,-2733,1798,2712,2708,-1795,1800,2714,2710,-1797,1794,2708,2709,-1796,1793,2707,2711,-1798,1786,2696,2712,-1799,\n\t\t                    1785,2695,2713,-1800,1799,2713,2714,-1801,1716,2722,2720,-1761,3010,3019,2704,-1669,1668,2704,2722,-1717,1771,2718,2725,-1734,1677,1701,2724,-2700,1669,2702,2719,-1723,\n\t\t                    1670,2701,2721,-1764,1780,1708,2726,-2716,1748,2727,2701,-1671,1760,2720,2702,-1670,1728,2728,2727,-1749,1701,1780,2715,-2725,1684,1677,2699,-2724,1763,2721,2718,-1772,\n\t\t                    1831,1733,2725,-2734,1722,2719,2728,-1729,1809,1828,2730,-2724,1827,1790,2700,-2730,1828,1820,2731,-2731,1827,2729,2731,-1821,1792,1839,2732,-2707,1708,1831,2733,-2727,\n\t\t                    1987,2748,2734,-1978,1989,2750,2735,-1979,3027,3031,2737,-1981,1983,1993,2756,-2745,1982,1981,2755,-2740,1981,1983,2744,-2756,1993,1984,2745,-2757,1980,2737,2746,-1986,\n\t\t                    2031,1988,2749,-2772,1990,2751,2747,-1987,1992,2753,2749,-1989,1986,2747,2748,-1988,1985,2746,2750,-1990,1978,2735,2751,-1991,1977,2734,2752,-1992,1991,2752,2753,-1993,\n\t\t                    1908,2761,2759,-1953,3023,3030,2743,-1861,1860,2743,2761,-1909,1963,2757,2764,-1926,1869,1893,2763,-2739,1861,2741,2758,-1915,1862,2740,2760,-1956,1972,1900,2765,-2755,\n\t\t                    1940,2766,2740,-1863,1952,2759,2741,-1862,1920,2767,2766,-1941,1893,1972,2754,-2764,1876,1869,2738,-2763,1955,2760,2757,-1964,2023,1925,2764,-2773,1914,2758,2767,-1921,\n\t\t                    2001,2020,2769,-2763,2019,1982,2739,-2769,2020,2012,2770,-2770,2019,2768,2770,-2013,1984,2031,2771,-2746,1900,2023,2772,-2766,2179,2787,2773,-2170,2181,2789,2774,-2171,\n\t\t                    3038,3032,2776,-2173,2175,2185,2795,-2784,2174,2173,2794,-2779,2173,2175,2783,-2795,2185,2176,2784,-2796,2172,2776,2785,-2178,2223,2180,2788,-2811,2182,2790,2786,-2179,\n\t\t                    2184,2792,2788,-2181,2178,2786,2787,-2180,2177,2785,2789,-2182,2170,2774,2790,-2183,2169,2773,2791,-2184,2183,2791,2792,-2185,2100,2800,2798,-2145,3034,3033,2782,-2053,\n\t\t                    2052,2782,2800,-2101,2155,2796,2803,-2118,2061,2085,2802,-2778,2053,2780,2797,-2107,2054,2779,2799,-2148,2164,2092,2804,-2794,2132,2805,2779,-2055,2144,2798,2780,-2054,\n\t\t                    2112,2806,2805,-2133,2085,2164,2793,-2803,2068,2061,2777,-2802,2147,2799,2796,-2156,2215,2117,2803,-2812,2106,2797,2806,-2113,2193,2212,2808,-2802,2211,2174,2778,-2808,\n\t\t                    2212,2204,2809,-2809,2211,2807,2809,-2205,2176,2223,2810,-2785,2092,2215,2811,-2805,2371,2826,2812,-2362,2373,2828,2813,-2363,3061,3049,2815,-2365,2367,2377,2834,-2823,\n\t\t                    2366,2365,2833,-2818,2365,2367,2822,-2834,2377,2368,2823,-2835,2364,2815,2824,-2370,2415,2372,2827,-2850,2374,2829,2825,-2371,2376,2831,2827,-2373,2370,2825,2826,-2372,\n\t\t                    2369,2824,2828,-2374,2362,2813,2829,-2375,2361,2812,2830,-2376,2375,2830,2831,-2377,2292,2839,2837,-2337,3058,3048,2821,-2245,2244,2821,2839,-2293,2347,2835,2842,-2310,\n\t\t                    2253,2277,2841,-2817,2245,2819,2836,-2299,2246,2818,2838,-2340,2356,2284,2843,-2833,2324,2844,2818,-2247,2336,2837,2819,-2246,2304,2845,2844,-2325,2277,2356,2832,-2842,\n\t\t                    2260,2253,2816,-2841,2339,2838,2835,-2348,2407,2309,2842,-2851,2298,2836,2845,-2305,2385,2404,2847,-2841,2403,2366,2817,-2847,2404,2396,2848,-2848,2403,2846,2848,-2397,\n\t\t                    2368,2415,2849,-2824,2284,2407,2850,-2844,2074,2867,2866,-2046,2007,2864,2862,-1888,2875,2266,2236,-2872,2882,2820,2243,-2875,2544,2879,2851,-1661,2881,2697,1787,-2858,\n\t\t                    2266,2875,2872,-2238,2880,2660,2237,-2873,2391,2878,2876,-2272,2820,2882,2878,-2392,2199,2870,2868,-2080,2879,2544,1663,-2854,2863,1979,1887,-2863,2861,1882,1852,-2860,\n\t\t                    2857,1787,1695,-2857,2877,2363,2271,-2877,2697,2881,2854,-1672,2869,2171,2079,-2869,1882,2861,2860,-1854,2855,1690,1660,-2852,2853,1663,1671,-2855,2874,2243,2238,-2874,\n\t\t                    2660,2880,2873,-2239,1815,2858,2856,-1696,2867,2074,2044,-2866,1690,2855,2852,-1662,3225,2869,2868,-3225,3228,2895,2893,-3228,3229,2877,2876,-3231,2904,2959,2941,-2907,\n\t\t                    3223,2863,2862,-3228,3233,2901,2899,-3225,3232,2889,2887,-3227,2915,2889,2894,-2919,2901,2907,3191,-2911,2621,2045,2866,-3006,2915,2914,2887,-2890,2915,2931,2928,-2915,\n\t\t                    2895,2919,2917,-2894,2927,2908,2885,-2912,2918,2894,2893,-2918,2945,2865,2044,-2623,2937,2935,2971,-2911,2933,2918,2917,-2933,2910,2971,2899,-2902,2919,2934,2932,-2918,\n\t\t                    2960,2942,2938,-2958,3000,2948,2964,-2995,2942,2960,2958,-2940,2994,2964,2974,-2976,2966,2976,2975,-2975,3255,3195,2986,-3253,2950,2995,2976,-2967,3195,3203,2983,-2987,\n\t\t                    2948,3000,2993,-2966,3196,2997,3003,-3206,3197,2989,2978,-3202,3198,2996,2990,-3194,3205,3003,2946,-3203,2993,3004,2925,-3000,2582,1853,2860,-2989,3201,2978,2981,-3194,\n\t\t                    3192,3002,2996,-3199,3197,2926,2997,-3197,2972,2994,2975,-2925,2999,2925,2912,-3002,3111,3110,2938,-2943,2965,2993,2999,-2950,2938,3110,2963,-2996,1691,3012,3008,-1660,\n\t\t                    2545,3016,3007,-1665,2546,3017,3009,-1659,2697,1671,3011,-3019,1668,1658,3009,-3011,1671,1663,3006,-3012,1664,3007,3012,-1692,1815,1695,3013,-3016,1695,1787,3014,-3014,\n\t\t                    2703,1815,3015,-3020,1657,3006,3016,-2546,1659,3008,3017,-2547,1787,2697,3018,-3015,1667,2703,3019,-3011,2742,2007,3026,-3031,2584,3025,3056,-1857,2585,3024,3054,-1851,\n\t\t                    1860,1850,3054,-3024,2052,2042,3047,-3035,2736,1863,3022,-3032,2781,2199,3039,-3034,2079,2171,3038,-3046,2007,1887,3020,-3027,2048,3037,3044,-2076,1979,2736,3031,-3028,\n\t\t                    1851,3055,3024,-2586,2624,3041,3047,-2043,1849,3057,3025,-2585,2623,3040,3037,-2049,1859,2742,3030,-3024,1887,1979,3027,-3021,2271,2363,3061,-3051,1856,3056,3021,-1884,\n\t\t                    1863,1855,3057,-3023,2171,2775,3032,-3039,1883,3021,3055,-1852,2051,2781,3033,-3035,2391,2271,3050,-3061,2775,2055,3035,-3033,2267,3051,3029,-2236,2814,2247,3059,-3050,\n\t\t                    2662,3053,3042,-2241,2043,3046,3041,-2625,2055,2047,3036,-3036,2075,3044,3046,-2044,2041,3036,3040,-2624,2199,2079,3045,-3040,2235,3029,3052,-2664,2240,3042,3051,-2268,\n\t\t                    2363,2814,3049,-3062,2820,2391,3060,-3049,2233,3043,3053,-2663,2243,2820,3048,-3059,2247,2239,3043,-3060,2663,3052,3028,-2235,2244,2234,3028,-3059,3259,3062,3072,-3259,\n\t\t                    3261,3069,3073,-3261,3263,3082,3083,-3263,3265,3095,3091,-3265,3260,3073,3074,-3265,3262,3083,3084,-3267,3277,3253,3075,-3268,3268,3068,3062,-3260,3268,3085,3080,-3270,\n\t\t                    3267,3075,3076,-3271,3258,3072,3071,-3272,3269,3080,3081,-3273,3270,3076,3077,-3274,3271,3071,3070,-3275,3273,3077,3067,-3267,3274,3070,3069,-3262,2995,2963,3108,-2977,\n\t\t                    3000,2916,3004,-2994,2908,2927,3001,-2913,2916,3000,2994,-2973,2898,2896,2924,-3109,2892,2890,3004,-2917,2976,3108,2924,-2976,2905,2903,2872,-2876,3106,2859,1852,-2584,\n\t\t                    2543,1661,2852,-3108,2583,1855,1662,-2544,2543,3107,3106,-2584,2875,2871,2902,-2906,3110,2902,2871,-3110,2622,2047,1854,-2583,3108,2963,2897,-2899,2582,2988,2945,-2623,\n\t\t                    2963,3110,3109,-3006,3111,2909,2903,-2906,2942,2939,2909,-3112,3109,2871,2236,-2662,2621,3005,3109,-2662,2661,2239,2046,-2622,2905,2902,3110,-3112,2920,2971,2935,-2937,\n\t\t                    3288,3289,3081,-3081,3287,3288,3080,-3086,2466,3114,3116,-2469,3120,2472,2469,-3118,3121,2502,2465,-3114,2514,3122,3113,-2466,3118,2470,2471,-3120,3117,2469,2470,-3119,\n\t\t                    3122,2514,2472,-3121,3119,2471,2467,-3116,2502,3121,3114,-2467,3115,2467,2468,-3117,3129,3119,3115,-3126,3125,3115,3116,-3127,3121,3131,3124,-3115,3130,3120,3117,-3128,\n\t\t                    3114,3124,3126,-3117,3131,3121,3113,-3124,3122,3132,3123,-3114,3132,3122,3120,-3131,3128,3118,3119,-3130,3127,3117,3118,-3129,3138,3128,3129,-3140,3137,3127,3128,-3139,\n\t\t                    3139,3129,3125,-3136,3135,3125,3126,-3137,3131,3141,3134,-3125,3140,3130,3127,-3138,3124,3134,3136,-3127,3141,3131,3123,-3134,3132,3142,3133,-3124,3142,3132,3130,-3141,\n\t\t                    3151,3141,3133,-3144,3142,3152,3143,-3134,3152,3142,3140,-3151,3148,3138,3139,-3150,3147,3137,3138,-3149,3149,3139,3135,-3146,3145,3135,3136,-3147,3141,3151,3144,-3135,\n\t\t                    3150,3140,3137,-3148,3134,3144,3146,-3137,3151,3161,3154,-3145,3160,3150,3147,-3158,3144,3154,3156,-3147,3161,3151,3143,-3154,3152,3162,3153,-3144,3162,3152,3150,-3161,\n\t\t                    3158,3148,3149,-3160,3157,3147,3148,-3159,3159,3149,3145,-3156,3155,3145,3146,-3157,3169,3159,3155,-3166,3165,3155,3156,-3167,3161,3171,3164,-3155,3170,3160,3157,-3168,\n\t\t                    3154,3164,3166,-3157,3171,3161,3153,-3164,3162,3172,3163,-3154,3172,3162,3160,-3171,3168,3158,3159,-3170,3167,3157,3158,-3169,2923,2922,3165,-3167,2943,2923,3166,-3165,\n\t\t                    2955,3176,3175,-2955,2954,3175,3174,-2954,2953,3174,3173,-2953,3176,3178,3177,-3176,3178,3180,3179,-3178,3180,3183,3182,-3180,2967,3241,3208,-3241,3183,3186,3185,-3183,\n\t\t                    3186,3189,3188,-3186,3200,2985,3243,-3189,2929,3200,3188,-3190,1667,1662,1855,-1864,1859,1854,2047,-2056,2703,1667,1863,-2737,2736,1979,1815,-2704,1979,2863,2858,-1816,\n\t\t                    3232,2858,2863,-3224,2928,2931,2955,-3238,2918,2933,2931,-2916,2944,2943,3164,-3172,2742,1859,2055,-2776,2775,2171,2007,-2743,2051,2046,2239,-2248,2781,2051,2247,-2815,\n\t\t                    2814,2363,2199,-2782,2363,2877,2870,-2200,3233,2870,2877,-3230,2920,2919,2895,-2901,2936,2934,2919,-2921,2971,2920,2900,-2900,3225,2900,2895,-3229,2864,2007,2171,-2870,\n\t\t                    2907,2906,2941,-3192,3192,2977,2983,-3204,2995,2950,2957,-2939,2912,2925,2884,-2887,2912,2886,2883,-2909,2916,2972,2891,-2893,2939,2959,2904,-2910,2961,2944,3171,-3164,\n\t\t                    2970,2969,3203,-3196,2979,3196,3205,-2974,3002,3192,3203,-2970,2977,3192,3198,-2981,2973,3205,3202,-2983,2926,3197,3201,-2999,2980,3198,3193,-2982,2989,3197,3196,-2980,\n\t\t                    2998,3201,3193,-2991,2941,2940,3207,-3192,3185,3188,3243,-3245,2910,3191,3207,-2938,3182,3185,3244,-3247,2962,2961,3163,-3173,3172,3170,3234,-2963,2930,3234,3170,-3168,\n\t\t                    2987,2930,3167,-3169,3168,3169,3204,-2988,3202,3240,3208,-2983,3194,2984,2991,-3207,3206,2921,2992,-3195,2958,2947,2959,-2940,2951,3098,3241,-2968,3287,3286,3102,-3104,\n\t\t                    3286,3285,3101,-3103,3285,3284,3100,-3102,3284,3283,3104,-3101,3283,3282,3112,-3105,3275,3263,3065,-3218,3282,3281,3105,-3113,3281,3280,3222,-3106,2979,2973,3096,-3104,\n\t\t                    2989,2979,3103,-3103,3102,3101,2978,-2990,3101,3100,2981,-2979,2980,2981,3100,-3105,2977,2980,3104,-3113,3112,3105,2983,-2978,3279,3280,3091,-3096,3272,3081,3218,-3276,\n\t\t                    3265,3078,3220,-3277,3278,3279,3095,-3222,2986,2983,3105,-3223,2897,2963,3005,-2867,2900,3225,3224,-2900,2888,2881,3226,-2888,2898,2897,2866,-2868,2867,2865,2896,-2899,\n\t\t                    2864,3228,3227,-2863,2924,2896,2865,-2946,2907,3229,3230,-2907,2881,2857,2856,-3227,2945,2988,2972,-2925,2891,2972,2988,-2861,2892,2891,2860,-2862,2861,2859,2890,-2893,\n\t\t                    2894,3223,3227,-2894,2870,3233,3224,-2869,2882,2874,2906,-3231,3004,2890,2859,-3107,2858,3232,3226,-2857,3106,3107,2925,-3005,2884,2925,3107,-2853,2886,2884,2852,-2856,\n\t\t                    2882,3230,2876,-2879,2855,2851,2883,-2887,2908,2883,2851,-2880,2879,2853,2885,-2909,2911,2885,3231,-3252,2888,2913,3251,-3232,2874,2873,2904,-2907,2909,2904,2873,-2881,\n\t\t                    2880,2872,2903,-2910,2853,2854,3231,-2886,2889,3232,3223,-2895,2901,3233,3229,-2908,2869,3225,3228,-2865,3169,3165,2922,-3205,3235,3236,3234,-2931,2968,3235,2930,-2988,\n\t\t                    3001,2956,2949,-3000,3240,3202,2946,-3239,3252,2986,3222,-3257,2967,2968,2987,-3205,3252,3256,3212,-2985,3239,2956,3001,-2928,2956,3239,3238,-2947,3238,3239,3235,-2969,\n\t\t                    2927,2911,3235,-3240,2949,2956,2946,-3004,2965,2949,3003,-2998,3200,2929,2921,-3207,3206,2991,2985,-3201,3190,2984,3212,-3211,3187,3190,3210,-3212,3184,3187,3211,-3214,\n\t\t                    3181,3184,3213,-3216,3209,3181,3215,-3215,3098,3209,3214,-3220,3241,3098,3219,-3217,3208,3241,3216,-3098,3190,3242,2991,-2985,3173,3098,2951,-2953,3187,3199,3242,-3191,\n\t\t                    2991,3242,3243,-2986,3179,3182,3246,-3249,3248,3250,3177,-3180,3244,3243,3242,-3200,3199,3245,3246,-3245,3245,3247,3248,-3247,3247,3249,3250,-3249,3184,3245,3199,-3188,\n\t\t                    3247,3245,3184,-3182,3181,3209,3249,-3248,3177,3250,3174,-3176,3250,3249,3173,-3175,3173,3249,3209,-3099,2959,2947,2940,-2942,2948,2965,2997,-2927,2926,2998,2964,-2949,\n\t\t                    2998,2990,2974,-2965,2966,2974,2990,-2997,2950,2966,2996,-3003,2957,2950,3002,-2970,2960,2957,2969,-2971,2940,2947,2992,-2922,2921,2929,3207,-2941,2937,3207,2929,-3190,\n\t\t                    3189,3186,2935,-2938,2936,2935,3186,-3184,3183,3180,2934,-2937,3180,3178,2932,-2935,2933,2932,3178,-3177,3176,2955,2931,-2934,2888,3231,2854,-2882,2914,2928,3251,-2914,\n\t\t                    2888,2887,2914,-2914,2911,3251,3236,-3236,3194,3255,3252,-2985,3276,3220,3253,-3278,2982,3208,3097,-3100,2973,2982,3099,-3097,2947,2958,3257,-2993,3194,2992,3257,-3256,\n\t\t                    2970,3257,2958,-2961,3255,3257,2970,-3196,2968,2967,3240,-3239,2962,3234,3236,-3238,3237,2955,2961,-2963,2955,2954,2944,-2962,2954,2953,2943,-2945,2953,2952,2923,-2944,\n\t\t                    2952,2951,2922,-2924,2951,2967,3204,-2923,3297,3296,3082,-3219,3296,3295,3083,-3083,3295,3294,3084,-3084,3293,3294,3214,-3216,3292,3293,3215,-3214,3291,3292,3213,-3212,\n\t\t                    3290,3291,3211,-3211,3290,3278,3221,-3255,3289,3297,3218,-3082,3079,3259,3258,-3090,3086,3261,3260,-3091,3065,3263,3262,-3067,3078,3265,3264,-3075,3090,3260,3264,-3092,\n\t\t                    3066,3262,3266,-3068,3254,3277,3267,-3093,3085,3268,3259,-3080,3068,3268,3269,-3064,3092,3267,3270,-3094,3089,3258,3271,-3089,3063,3269,3272,-3065,3093,3270,3273,-3095,\n\t\t                    3088,3271,3274,-3088,3094,3273,3266,-3085,3087,3274,3261,-3087,3218,3082,3263,-3276,3064,3272,3275,-3218,3095,3265,3276,-3222,3221,3276,3277,-3255,3212,3256,3279,-3279,\n\t\t                    3085,3079,3286,-3288,3093,3094,3293,-3293,3103,3096,3288,-3288,3219,3214,3294,-3296,3096,3099,3289,-3289,3090,3091,3280,-3282,3099,3097,3297,-3290,3088,3087,3283,-3285,\n\t\t                    3086,3090,3281,-3283,3216,3219,3295,-3297,3254,3092,3291,-3291,3089,3088,3284,-3286,3087,3086,3282,-3284,3210,3212,3278,-3291,3094,3084,3294,-3294,3079,3089,3285,-3287,\n\t\t                    3256,3222,3280,-3280,3092,3093,3292,-3292,3097,3216,3296,-3298,3251,2928,3237,-3237,3300,3301,3299,-3299,3305,3306,3304,-3304,3313,3311,3315,-3318,3316,3312,3310,-3310,\n\t\t                    3303,3307,3308,-3306,3298,3304,3306,-3301,3299,3301,3320,-3320,3319,3320,3322,-3322,3321,3322,3324,-3324,3323,3324,3326,-3326,3325,3326,3328,-3328,3327,3328,3330,-3330,\n\t\t                    3334,3333,3387,-3387,3311,3384,3385,-3316,3313,3317,3309,-3311,3314,3312,3316,-3319,3307,3331,3332,-3309,3335,3336,3333,-3335,3329,3330,3336,-3336,3388,3356,3378,-3398,\n\t\t                    3356,3360,3362,-3379,3390,3391,3345,-3348,3391,3392,-3346,3389,3390,3347,-3349,3388,3389,3348,-3357,3341,3342,3308,-3333,3356,3348,3361,-3361,3338,3363,-3345,3347,3345,\n\t\t                    -3380,3348,3347,3379,-3362,3363,3346,3362,-3345,3340,3339,3316,-3310,3364,3340,3309,-3318,3339,3365,3318,-3317,3343,3366,3306,-3306,3354,3353,3326,-3325,3349,3350,3333,\n\t\t                    -3337,3355,3354,3324,-3323,3350,3393,3387,-3334,3336,3330,3351,-3350,3357,3355,3322,-3321,3359,3358,3301,-3301,3352,3351,3330,-3329,3358,3357,3320,-3302,3353,3352,3328,\n\t\t                    -3327,3371,3372,3342,-3342,3370,3369,3339,-3341,3368,3370,3340,-3365,3369,3367,3365,-3340,3305,3308,3342,-3344,3373,3374,3366,-3344,3338,3337,3367,-3370,3343,3342,3372,\n\t\t                    -3374,3346,3363,3370,-3369,3363,3338,3369,-3371,3359,3300,3306,-3367,3315,3385,3394,-3376,3375,3394,3395,-3377,3377,3396,3397,-3379,3344,3362,3360,3361,-3380,3364,3317,\n\t\t                    3315,-3376,3376,3368,3364,-3376,3368,3376,3377,-3347,3346,3377,3378,-3363,3380,3341,3332,-3382,3381,3332,3331,-3383,3383,3371,3341,-3381,3365,3380,3381,-3319,3318,3381,\n\t\t                    3382,-3315,3367,3383,3380,-3366,3376,3395,3396,-3378,3400,3398,3399,-3402,3404,3402,3403,-3406,3412,3416,3414,-3411,3415,3408,3409,-3412,3402,3404,3407,-3407,3398,3400,\n\t\t                    3405,-3404,3399,3418,3419,-3402,3418,3420,3421,-3420,3420,3422,3423,-3422,3422,3424,3425,-3424,3424,3426,3427,-3426,3426,3428,3429,-3428,3433,3386,3387,-3433,3410,3414,\n\t\t                    3385,-3385,3412,3409,3408,-3417,3413,3417,3415,-3412,3406,3407,3431,-3431,3434,3433,3432,-3436,3428,3434,3435,-3430,3444,3480,3460,-3463,3388,3397,3477,-3457,3456,3477,\n\t\t                    3462,-3461,3390,3447,3445,-3392,3391,3445,-3393,3389,3448,3447,-3391,3388,3456,3448,-3390,3441,3431,3407,-3443,3456,3460,3461,-3449,3438,3436,3444,-3464,3447,3478,-3446,\n\t\t                    3448,3461,3478,-3448,3463,3444,3462,-3447,3440,3408,3415,-3440,3464,3416,3408,-3441,3439,3415,3417,-3466,3443,3404,3405,-3467,3454,3423,3425,-3454,3449,3435,3432,-3451,\n\t\t                    3455,3421,3423,-3455,3450,3432,3387,-3394,3435,3449,3451,-3430,3457,3419,3421,-3456,3459,3400,3401,-3459,3452,3427,3429,-3452,3458,3401,3419,-3458,3453,3425,3427,-3453,\n\t\t                    3471,3441,3442,-3473,3470,3440,3439,-3470,3468,3464,3440,-3471,3469,3439,3465,-3468,3404,3443,3442,-3408,3438,3469,3467,-3438,3443,3473,3472,-3443,3446,3468,3470,-3464,\n\t\t                    3463,3470,3469,-3439,3459,3466,3405,-3401,3414,3474,3394,-3386,3474,3475,3395,-3395,3476,3477,3397,-3397,3460,3480,3479,-3462,3464,3474,3414,-3417,3475,3474,3464,-3469,\n\t\t                    3468,3446,3476,-3476,3446,3462,3477,-3477,3481,3482,3431,-3442,3482,3483,3430,-3432,3484,3481,3441,-3472,3465,3417,3482,-3482,3417,3413,3483,-3483,3467,3465,3481,-3485,\n\t\t                    3433,3434,-3303,3335,3334,-3303,3304,3298,-3303,3428,3426,-3303,3420,3418,-3303,3483,3413,-3303,3402,3406,-3303,3298,3299,-3303,3313,3310,-3303,3426,3424,-3303,3403,3402,\n\t\t                    -3303,3327,3329,-3303,3323,3325,-3303,3321,3323,-3303,3399,3398,-3303,3310,3312,-3303,3418,3399,-3303,3334,3386,-3303,3434,3428,-3303,3303,3304,-3303,3410,3384,-3303,3314,\n\t\t                    3382,-3303,3413,3411,-3303,3384,3311,-3303,3319,3321,-3303,3430,3483,-3303,3329,3335,-3303,3331,3307,-3303,3412,3410,-3303,3411,3409,-3303,3398,3403,-3303,3422,3420,-3303,\n\t\t                    3307,3303,-3303,3325,3327,-3303,3299,3319,-3303,3382,3331,-3303,3312,3314,-3303,3386,3433,-3303,3406,3430,-3303,3311,3313,-3303,3424,3422,-3303,3409,3412,-3303,3475,3476,\n\t\t                    3396,-3396,3485,3488,3489,-3487,3486,3489,6092,-6094,3488,6123,6122,-3490,3489,6122,7853,-6093,3485,3486,3490,-3488,3487,3490,6142,-6142,3486,6093,6094,-3491,3490,6094,\n\t\t                    7852,-6143,3485,3487,3491,-3489,3488,3491,6124,-6124,3487,6141,6140,-3492,3491,6140,7857,-6125,3492,3496,3497,-3494,3493,3497,6130,-6130,3496,6090,6091,-3498,3497,6091,\n\t\t                    7851,-6131,3492,3493,3498,-3495,3494,3498,6115,-6115,3493,6129,6128,-3499,3498,6128,7855,-6116,3492,3494,3499,-3496,3495,3499,6125,-6127,3494,6114,6113,-3500,3499,6113,\n\t\t                    7856,-6126,3492,3495,3500,-3497,3496,3500,6089,-6091,3495,6126,6127,-3501,3500,6127,7852,-6090,3501,3505,3506,-3503,3502,3506,6175,-6175,3505,6114,6115,-3507,3506,6115,\n\t\t                    7855,-6176,3501,3502,3507,-3504,3503,3507,6145,-6145,3502,6174,6173,-3508,3507,6173,7861,-6146,3501,3503,3508,-3505,3504,3508,6178,-6178,3503,6144,6143,-3509,3508,6143,\n\t\t                    7862,-6179,3501,3504,3509,-3506,3505,3509,6113,-6115,3504,6177,6176,-3510,3509,6176,7856,-6114,3510,3513,3514,-3512,3511,3514,6097,-6097,3513,6120,6119,-3515,3514,6119,\n\t\t                    7983,-6098,3510,3511,3515,-3513,3512,3515,6122,-6124,3511,6096,6095,-3516,3515,6095,7853,-6123,3510,3512,3516,-3514,3513,3516,6121,-6121,3512,6123,6124,-3517,3516,6124,\n\t\t                    7857,-6122,3517,3521,3522,-3519,3518,3522,6098,-6100,3521,6084,6085,-3523,3522,6085,7984,-6099,3517,3518,3523,-3520,3519,3523,6139,-6139,3518,6099,6100,-3524,3523,6100,\n\t\t                    7989,-6140,3517,3519,3524,-3521,3520,3524,6131,-6133,3519,6138,6137,-3525,3524,6137,7854,-6132,3517,3520,3525,-3522,3521,3525,6083,-6085,3520,6132,6133,-3526,3525,6133,\n\t\t                    7850,-6084,3526,3529,3530,-3528,3527,3530,6109,-6109,3529,6135,6136,-3531,3530,6136,7993,-6110,3526,3527,3531,-3529,3528,3531,6119,-6121,3527,6108,6107,-3532,3531,6107,\n\t\t                    7983,-6120,3526,3528,3532,-3530,3529,3532,6134,-6136,3528,6120,6121,-3533,3532,6121,7857,-6135,3533,3536,3537,-3535,3534,3537,6140,-6142,3536,6117,6116,-3538,3537,6116,\n\t\t                    7857,-6141,3533,3534,3538,-3536,3535,3538,6127,-6127,3534,6141,6142,-3539,3538,6142,7852,-6128,3533,3535,3539,-3537,3536,3539,6118,-6118,3535,6126,6125,-3540,3539,6125,\n\t\t                    7856,-6119,3540,3544,3545,-3542,3541,3545,6176,-6178,3544,6117,6118,-3546,3545,6118,7856,-6177,3540,3541,3546,-3543,3542,3546,6181,-6181,3541,6177,6178,-3547,3546,6178,\n\t\t                    7862,-6182,3540,3542,3547,-3544,3543,3547,6148,-6148,3542,6180,6179,-3548,3547,6179,7858,-6149,3540,3543,3548,-3545,3544,3548,6116,-6118,3543,6147,6146,-3549,3548,6146,\n\t\t                    7857,-6117,3549,3553,3554,-3551,3550,3554,6146,-6148,3553,6135,6134,-3555,3554,6134,7857,-6147,3549,3550,3555,-3552,3551,3555,6154,-6154,3550,6147,6148,-3556,3555,6148,\n\t\t                    7858,-6155,3549,3551,3556,-3553,3552,3556,6149,-6151,3551,6153,6152,-3557,3556,6152,7992,-6150,3549,3552,3557,-3554,3553,3557,6136,-6136,3552,6150,6151,-3558,3557,6151,\n\t\t                    7993,-6137,3558,3562,3563,-3560,3559,3563,6104,-6106,3562,6159,6158,-3564,3563,6158,7991,-6105,3558,3559,3564,-3561,3560,3564,6152,-6154,3559,6105,6106,-3565,3564,6106,\n\t\t                    7992,-6153,3558,3560,3565,-3562,3561,3565,6155,-6157,3560,6153,6154,-3566,3565,6154,7858,-6156,3558,3561,3566,-3563,3562,3566,6160,-6160,3561,6156,6157,-3567,3566,6157,\n\t\t                    7859,-6161,3567,3570,3571,-3569,3568,3571,6161,-6163,3570,6165,6166,-3572,3571,6166,7860,-6162,3567,3568,3572,-3570,3569,3572,6101,-6103,3568,6162,6163,-3573,3572,6163,\n\t\t                    7990,-6102,3567,3569,3573,-3571,3570,3573,6164,-6166,3569,6102,6103,-3574,3573,6103,7991,-6165,3574,3578,3579,-3576,3575,3579,6170,-6172,3578,6138,6139,-3580,3579,6139,\n\t\t                    7989,-6171,3574,3575,3580,-3577,3576,3580,6163,-6163,3575,6171,6172,-3581,3580,6172,7990,-6164,3574,3576,3581,-3578,3577,3581,6169,-6169,3576,6162,6161,-3582,3581,6161,\n\t\t                    7860,-6170,3574,3577,3582,-3579,3578,3582,6137,-6139,3577,6168,6167,-3583,3582,6167,7854,-6138,3583,3587,3588,-3585,3584,3588,6112,-6112,3587,6132,6131,-3589,3588,6131,\n\t\t                    7854,-6113,3583,3584,3589,-3586,3585,3589,6128,-6130,3584,6111,6110,-3590,3589,6110,7855,-6129,3583,3585,3590,-3587,3586,3590,6086,-6088,3585,6129,6130,-3591,3590,6130,\n\t\t                    7851,-6087,3583,3586,3591,-3588,3587,3591,6133,-6133,3586,6087,6088,-3592,3591,6088,7850,-6134,3592,3595,3596,-3594,3593,3596,6185,-6187,3595,6168,6169,-3597,3596,6169,\n\t\t                    7860,-6186,3592,3593,3597,-3595,3594,3597,6184,-6184,3593,6186,6187,-3598,3597,6187,7863,-6185,3592,3594,3598,-3596,3595,3598,6167,-6169,3594,6183,6182,-3599,3598,6182,\n\t\t                    7854,-6168,3599,3603,3604,-3601,3600,3604,6182,-6184,3603,6111,6112,-3605,3604,6112,7854,-6183,3599,3600,3605,-3602,3601,3605,6190,-6190,3600,6183,6184,-3606,3605,6184,\n\t\t                    7863,-6191,3599,3601,3606,-3603,3602,3606,6173,-6175,3601,6189,6188,-3607,3606,6188,7861,-6174,3599,3602,3607,-3604,3603,3607,6110,-6112,3602,6174,6175,-3608,3607,6175,\n\t\t                    7855,-6111,3608,3612,3613,-3610,3609,3613,6208,-6208,3612,6189,6190,-3614,3613,6190,7863,-6209,3608,3609,3614,-3611,3610,3614,6205,-6205,3609,6207,6206,-3615,3614,6206,\n\t\t                    7869,-6206,3608,3610,3615,-3612,3611,3615,6211,-6211,3610,6204,6203,-3616,3615,6203,7867,-6212,3608,3611,3616,-3613,3612,3616,6188,-6190,3611,6210,6209,-3617,3616,6209,\n\t\t                    7861,-6189,3617,3621,3622,-3619,3618,3622,6214,-6214,3621,6186,6185,-3623,3622,6185,7860,-6215,3617,3618,3623,-3620,3619,3623,6200,-6202,3618,6213,6212,-3624,3623,6212,\n\t\t                    7866,-6201,3617,3619,3624,-3621,3620,3624,6206,-6208,3619,6201,6202,-3625,3624,6202,7869,-6207,3617,3620,3625,-3622,3621,3625,6187,-6187,3620,6207,6208,-3626,3625,6208,\n\t\t                    7863,-6188,3626,3630,3631,-3628,3627,3631,6217,-6217,3630,6180,6181,-3632,3631,6181,7862,-6218,3626,3627,3632,-3629,3628,3632,6199,-6199,3627,6216,6215,-3633,3632,6215,\n\t\t                    7868,-6200,3626,3628,3633,-3630,3629,3633,6220,-6220,3628,6198,6197,-3634,3633,6197,7864,-6221,3626,3629,3634,-3631,3630,3634,6179,-6181,3629,6219,6218,-3635,3634,6218,\n\t\t                    7858,-6180,3635,3639,3640,-3637,3636,3640,6157,-6157,3639,6222,6221,-3641,3640,6221,7859,-6158,3635,3636,3641,-3638,3637,3641,6218,-6220,3636,6156,6155,-3642,3641,6155,\n\t\t                    7858,-6219,3635,3637,3642,-3639,3638,3642,6194,-6196,3637,6219,6220,-3643,3642,6220,7864,-6195,3635,3638,3643,-3640,3639,3643,6223,-6223,3638,6195,6196,-3644,3643,6196,\n\t\t                    7865,-6224,3644,3648,3649,-3646,3645,3649,6209,-6211,3648,6144,6145,-3650,3649,6145,7861,-6210,3644,3645,3650,-3647,3646,3650,6193,-6193,3645,6210,6211,-3651,3650,6211,\n\t\t                    7867,-6194,3644,3646,3651,-3648,3647,3651,6215,-6217,3646,6192,6191,-3652,3651,6191,7868,-6216,3644,3647,3652,-3649,3648,3652,6143,-6145,3647,6216,6217,-3653,3652,6217,\n\t\t                    7862,-6144,3653,3657,3658,-3655,3654,3658,6221,-6223,3657,6159,6160,-3659,3658,6160,7859,-6222,3653,3654,3659,-3656,3655,3659,6229,-6229,3654,6222,6223,-3660,3659,6223,\n\t\t                    7865,-6230,3653,3655,3660,-3657,3656,3660,6224,-6226,3655,6228,6227,-3661,3660,6227,7870,-6225,3653,3656,3661,-3658,3657,3661,6158,-6160,3656,6225,6226,-3662,3661,6226,\n\t\t                    7991,-6159,3662,3666,3667,-3664,3663,3667,6226,-6226,3666,6165,6164,-3668,3667,6164,7991,-6227,3662,3663,3668,-3665,3664,3668,6232,-6232,3663,6225,6224,-3669,3668,6224,\n\t\t                    7870,-6233,3662,3664,3669,-3666,3665,3669,6212,-6214,3664,6231,6230,-3670,3669,6230,7866,-6213,3662,3665,3670,-3667,3666,3670,6166,-6166,3665,6213,6214,-3671,3670,6214,\n\t\t                    7860,-6167,6234,7866,6230,-3675,3671,6231,6232,-3673,3672,6232,7870,-6236,3680,6227,6228,-3678,3671,3672,3675,-3674,3719,3675,6236,-6272,3672,6235,6236,-3676,5072,5010,\n\t\t                    7134,-7177,3671,3673,3676,-3675,3674,3676,6233,-6235,3714,3673,3675,-3720,3714,3718,3676,-3674,7870,6227,3680,-6236,3677,6228,6229,-3679,3678,6229,7865,-6238,3683,6204,\n\t\t                    6205,-3685,3677,3678,3681,-3680,3728,3681,6238,-6275,3678,6237,6238,-3682,3718,6270,6233,-3677,3677,3679,3682,-3681,3680,3682,6236,-6236,3723,3679,3681,-3729,3723,3727,\n\t\t                    3682,-3680,3684,6205,7869,-6241,3686,6203,6204,-3684,3683,3684,3687,-3686,3736,3687,6239,-6280,3684,6240,6239,-3688,3727,6271,6236,-3683,3683,3685,3688,-3687,3686,3688,\n\t\t                    6242,-6242,3735,3685,3687,-3737,3735,3739,3688,-3686,7867,6203,3686,-6242,3689,6201,6200,-3691,3690,6200,7866,-6235,3692,6202,6201,-3690,3689,3690,3693,-3692,3744,3748,\n\t\t                    3694,-3692,3690,6234,6233,-3694,3744,3691,3693,-3746,3689,3691,3694,-3693,3692,3694,6239,-6241,3748,6279,6239,-3695,3739,6280,6242,-3689,6240,7869,6202,-3693,3695,6198,\n\t\t                    6199,-3697,3696,6199,7868,-6245,3698,6197,6198,-3696,3695,3696,3699,-3698,3754,3699,6243,-6286,3696,6244,6243,-3700,3745,3693,6233,-6271,3695,3697,3700,-3699,3698,3700,\n\t\t                    6246,-6246,3753,3697,3699,-3755,3753,3757,3700,-3698,7864,6197,3698,-6246,3704,6196,6195,-3702,7865,6196,3704,-6238,3701,6195,6194,-3703,3702,6194,7864,-6246,3707,6192,\n\t\t                    6193,-3709,3701,3702,3705,-3704,3759,3763,3706,-3704,3702,6245,6246,-3706,3759,3703,3705,-3765,3701,3703,3706,-3705,3704,3706,6238,-6238,3763,6274,6238,-3707,3757,6286,\n\t\t                    6246,-3701,3708,6193,7867,-6242,3710,6191,6192,-3708,3707,3708,3711,-3710,3772,3711,6242,-6281,3708,6241,6242,-3712,3764,3705,6246,-6287,3707,3709,3712,-3711,3710,3712,\n\t\t                    6243,-6245,3771,3709,3711,-3773,3771,3775,3712,-3710,6244,7868,6191,-3711,3713,3717,3718,-3715,3717,6269,6270,-3719,3713,3714,3719,-3716,3715,3719,6271,-6273,3713,3715,\n\t\t                    3720,-3717,3716,3720,6267,-6267,3715,6272,6273,-3721,3720,6273,7877,-6268,3713,3716,3721,-3718,3717,3721,6268,-6270,3716,6266,6265,-3722,3721,6265,7873,-6269,3722,3726,\n\t\t                    3727,-3724,3726,6272,6271,-3728,3722,3723,3728,-3725,3724,3728,6274,-6276,3722,3724,3729,-3726,3725,3729,6264,-6264,3724,6275,6276,-3730,3729,6276,7872,-6265,3722,3725,\n\t\t                    3730,-3727,3726,3730,6273,-6273,3725,6263,6262,-3731,3730,6262,7877,-6274,3731,3735,3736,-3733,3732,3736,6279,-6279,3731,3732,3737,-3734,3733,3737,6261,-6261,3732,6278,\n\t\t                    6277,-3738,3737,6277,7876,-6262,3731,3733,3738,-3735,3734,3738,6282,-6282,3733,6260,6259,-3739,3738,6259,7874,-6283,3731,3734,3739,-3736,3734,6281,6280,-3740,3740,3744,\n\t\t                    3745,-3742,3741,3745,6270,-6270,3740,3741,3746,-3743,3742,3746,6256,-6258,3741,6269,6268,-3747,3746,6268,7873,-6257,3740,3742,3747,-3744,3743,3747,6277,-6279,3742,6257,\n\t\t                    6258,-3748,3747,6258,7876,-6278,3740,3743,3748,-3745,3743,6278,6279,-3749,3749,3753,3754,-3751,3750,3754,6285,-6285,3749,3750,3755,-3752,3751,3755,6255,-6255,3750,6284,\n\t\t                    6283,-3756,3755,6283,7875,-6256,3749,3751,3756,-3753,3752,3756,6288,-6288,3751,6254,6253,-3757,3756,6253,7871,-6289,3749,3752,3757,-3754,3752,6287,6286,-3758,3758,3762,\n\t\t                    3763,-3760,3762,6275,6274,-3764,3758,3759,3764,-3761,3760,3764,6286,-6288,3758,3760,3765,-3762,3761,3765,6250,-6252,3760,6287,6288,-3766,3765,6288,7871,-6251,3758,3761,\n\t\t                    3766,-3763,3762,3766,6276,-6276,3761,6251,6252,-3767,3766,6252,7872,-6277,3767,3771,3772,-3769,3768,3772,6280,-6282,3767,3768,3773,-3770,3769,3773,6249,-6249,3768,6281,\n\t\t                    6282,-3774,3773,6282,7874,-6250,3767,3769,3774,-3771,3770,3774,6283,-6285,3769,6248,6247,-3775,3774,6247,7875,-6284,3767,3770,3775,-3772,3770,6284,6285,-3776,3776,3780,\n\t\t                    3781,-3778,3777,3781,6265,-6267,3780,6311,6312,-3782,3781,6312,7873,-6266,3776,3777,3782,-3779,3778,3782,6313,-6315,3777,6266,6267,-3783,3782,6267,7877,-6314,3776,3778,\n\t\t                    3783,-3780,3779,3783,6309,-6309,3778,6314,6315,-3784,3783,6315,7884,-6310,3776,3779,3784,-3781,3780,3784,6310,-6312,3779,6308,6307,-3785,3784,6307,7880,-6311,3785,3789,\n\t\t                    3790,-3787,3786,3790,6262,-6264,3789,6314,6313,-3791,3790,6313,7877,-6263,3785,3786,3791,-3788,3787,3791,6316,-6318,3786,6263,6264,-3792,3791,6264,7872,-6317,3785,3787,\n\t\t                    3792,-3789,3788,3792,6306,-6306,3787,6317,6318,-3793,3792,6318,7879,-6307,3785,3788,3793,-3790,3789,3793,6315,-6315,3788,6305,6304,-3794,3793,6304,7884,-6316,3794,3798,\n\t\t                    3799,-3796,3795,3799,6321,-6321,3798,6260,6261,-3800,3799,6261,7876,-6322,3794,3795,3800,-3797,3796,3800,6303,-6303,3795,6320,6319,-3801,3800,6319,7883,-6304,3794,3796,\n\t\t                    3801,-3798,3797,3801,6324,-6324,3796,6302,6301,-3802,3801,6301,7881,-6325,3794,3797,3802,-3799,3798,3802,6259,-6261,3797,6323,6322,-3803,3802,6322,7874,-6260,3803,3807,\n\t\t                    3808,-3805,3804,3808,6312,-6312,3807,6257,6256,-3809,3808,6256,7873,-6313,3803,3804,3809,-3806,3805,3809,6298,-6300,3804,6311,6310,-3810,3809,6310,7880,-6299,3803,3805,\n\t\t                    3810,-3807,3806,3810,6319,-6321,3805,6299,6300,-3811,3810,6300,7883,-6320,3803,3806,3811,-3808,3807,3811,6258,-6258,3806,6320,6321,-3812,3811,6321,7876,-6259,3812,3816,\n\t\t                    3817,-3814,3813,3817,6327,-6327,3816,6254,6255,-3818,3817,6255,7875,-6328,3812,3813,3818,-3815,3814,3818,6297,-6297,3813,6326,6325,-3819,3818,6325,7882,-6298,3812,3814,\n\t\t                    3819,-3816,3815,3819,6330,-6330,3814,6296,6295,-3820,3819,6295,7878,-6331,3812,3815,3820,-3817,3816,3820,6253,-6255,3815,6329,6328,-3821,3820,6328,7871,-6254,3821,3825,\n\t\t                    3826,-3823,3822,3826,6252,-6252,3825,6317,6316,-3827,3826,6316,7872,-6253,3821,3822,3827,-3824,3823,3827,6328,-6330,3822,6251,6250,-3828,3827,6250,7871,-6329,3821,3823,\n\t\t                    3828,-3825,3824,3828,6292,-6294,3823,6329,6330,-3829,3828,6330,7878,-6293,3821,3824,3829,-3826,3825,3829,6318,-6318,3824,6293,6294,-3830,3829,6294,7879,-6319,3830,3834,\n\t\t                    3835,-3832,3831,3835,6322,-6324,3834,6248,6249,-3836,3835,6249,7874,-6323,3830,3831,3836,-3833,3832,3836,6291,-6291,3831,6323,6324,-3837,3836,6324,7881,-6292,3830,3832,\n\t\t                    3837,-3834,3833,3837,6325,-6327,3832,6290,6289,-3838,3837,6289,7882,-6326,3830,3833,3838,-3835,3834,3838,6247,-6249,3833,6326,6327,-3839,3838,6327,7875,-6248,6353,7880,\n\t\t                    6307,-3843,3839,6308,6309,-3841,3840,6309,7884,-6355,3848,6304,6305,-3846,3839,3840,3843,-3842,3841,3843,6351,-6351,3840,6354,6355,-3844,3843,6355,7891,-6352,3839,3841,\n\t\t                    3844,-3843,3842,3844,6352,-6354,3841,6350,6349,-3845,3844,6349,7887,-6353,7884,6304,3848,-6355,3845,6305,6306,-3847,3846,6306,7879,-6357,3851,6302,6303,-3853,3845,3846,\n\t\t                    3849,-3848,3847,3849,6348,-6348,3846,6356,6357,-3850,3849,6357,7886,-6349,3845,3847,3850,-3849,3848,3850,6355,-6355,3847,6347,6346,-3851,3850,6346,7891,-6356,3852,6303,\n\t\t                    7883,-6360,3854,6301,6302,-3852,3851,3852,3855,-3854,3853,3855,6345,-6345,3852,6359,6358,-3856,3855,6358,7890,-6346,3851,3853,3856,-3855,3854,3856,6361,-6361,3853,6344,\n\t\t                    6343,-3857,3856,6343,7888,-6362,7881,6301,3854,-6361,3857,6299,6298,-3859,3858,6298,7880,-6354,3860,6300,6299,-3858,3857,3858,3861,-3860,3859,3861,6340,-6342,3858,6353,\n\t\t                    6352,-3862,3861,6352,7887,-6341,3857,3859,3862,-3861,3860,3862,6358,-6360,3859,6341,6342,-3863,3862,6342,7890,-6359,6359,7883,6300,-3861,3863,6296,6297,-3865,3864,6297,\n\t\t                    7882,-6364,3866,6295,6296,-3864,3863,3864,3867,-3866,3865,3867,6339,-6339,3864,6363,6362,-3868,3867,6362,7889,-6340,3863,3865,3868,-3867,3866,3868,6365,-6365,3865,6338,\n\t\t                    6337,-3869,3868,6337,7885,-6366,7878,6295,3866,-6365,3872,6294,6293,-3870,7879,6294,3872,-6357,3869,6293,6292,-3871,3870,6292,7878,-6365,3875,6290,6291,-3877,3869,3870,\n\t\t                    3873,-3872,3871,3873,6334,-6336,3870,6364,6365,-3874,3873,6365,7885,-6335,3869,3871,3874,-3873,3872,3874,6357,-6357,3871,6335,6336,-3875,3874,6336,7886,-6358,3876,6291,\n\t\t                    7881,-6361,3878,6289,6290,-3876,3875,3876,3879,-3878,3877,3879,6333,-6333,3876,6360,6361,-3880,3879,6361,7888,-6334,3875,3877,3880,-3879,3878,3880,6362,-6364,3877,6332,\n\t\t                    6331,-3881,3880,6331,7889,-6363,6363,7882,6289,-3879,5138,7199,7198,-5140,3883,3886,6387,-6389,3881,3883,6349,-6351,3890,3891,3888,-3888,3883,6388,7887,-6350,6389,6390,\n\t\t                    3885,-3885,3881,3882,3886,-3884,3881,6350,6351,-3885,3884,6351,7891,-6390,3882,3885,6386,-6386,3885,6390,7898,-6387,3882,6385,6384,-3887,3886,6384,7894,-6388,3889,3892,\n\t\t                    6390,-6390,3887,3889,6346,-6348,3895,3896,3893,-3895,3889,6389,7891,-6347,6391,6392,3891,-3891,3887,3888,3892,-3890,3887,6347,6348,-3891,3890,6348,7886,-6392,3888,3891,\n\t\t                    6383,-6383,3891,6392,7893,-6384,3888,6382,6381,-3893,3892,6381,7898,-6391,6393,3896,3895,-6395,3897,3898,3894,-3894,3894,6344,6345,-3896,3895,6345,7890,-6395,3893,3896,\n\t\t                    6380,-6380,3896,6393,7897,-6381,6395,3898,3897,-6397,3901,3902,3899,-3901,3893,6379,6378,-3898,3897,6378,7895,-6397,3894,3898,6343,-6345,3898,6395,7888,-6344,6387,3902,\n\t\t                    3901,-6389,3903,3904,3900,-3900,3900,6341,6340,-3902,3901,6340,7887,-6389,3899,3902,6375,-6377,3902,6387,7894,-6376,6393,6394,3904,-3904,3907,3908,3905,-3907,3899,6376,\n\t\t                    6377,-3904,3903,6377,7897,-6394,3900,3904,6342,-6342,3904,6394,7890,-6343,6397,3908,3907,-6399,3909,3910,3906,-3906,3906,6338,6339,-3908,3907,6339,7889,-6399,3905,3908,\n\t\t                    6374,-6374,3908,6397,7896,-6375,6399,3910,3909,-6401,3914,3915,3912,-3912,3905,6373,6372,-3910,3909,6372,7892,-6401,3906,3910,6337,-6339,3910,6399,7885,-6338,3913,3916,\n\t\t                    6392,-6392,3911,3913,6336,-6336,3919,3920,3917,-3919,3913,6391,7886,-6337,6399,6400,3915,-3915,3911,3912,3916,-3914,3911,6335,6334,-3915,3914,6334,7885,-6400,3912,3915,\n\t\t                    6369,-6371,3915,6400,7892,-6370,3912,6370,6371,-3917,3916,6371,7893,-6393,6395,6396,3920,-3920,3921,3922,3918,-3918,3918,6332,6333,-3920,3919,6333,7888,-6396,3917,3920,\n\t\t                    6368,-6368,3920,6396,7895,-6369,6397,6398,3922,-3922,5182,5183,5180,-5182,3917,6367,6366,-3922,3921,6366,7896,-6398,3918,3922,6331,-6333,3922,6398,7889,-6332,3923,3927,\n\t\t                    3928,-3925,3924,3928,6895,-6895,3927,6876,6875,-3929,3928,6875,7965,-6896,3923,3924,3929,-3926,3925,3929,6419,-6421,3924,6894,6893,-3930,3929,6893,8115,-6420,3923,3925,\n\t\t                    3930,-3927,3926,3930,6415,-6415,3925,6420,6421,-3931,3930,6421,8039,-6416,3923,3926,3931,-3928,3927,3931,6877,-6877,3926,6414,6413,-3932,3931,6413,7902,-6878,3932,3936,\n\t\t                    3937,-3934,3933,3937,6875,-6877,3936,6897,6896,-3938,3937,6896,7965,-6876,3932,3933,3938,-3935,3934,3938,6410,-6412,3933,6876,6877,-3939,3938,6877,7902,-6411,3932,3934,\n\t\t                    3939,-3936,3935,3939,6424,-6424,3934,6411,6412,-3940,3939,6412,7901,-6425,3932,3935,3940,-3937,3936,3940,6898,-6898,3935,6423,6422,-3941,3940,6422,7966,-6899,3941,3945,\n\t\t                    3946,-3943,3942,3946,6422,-6424,3945,6900,6899,-3947,3946,6899,7966,-6423,3941,3942,3947,-3944,3943,3947,6407,-6409,3942,6423,6424,-3948,3947,6424,7901,-6408,3941,3943,\n\t\t                    3948,-3945,3944,3948,6427,-6427,3943,6408,6409,-3949,3948,6409,7900,-6428,3941,3944,3949,-3946,3945,3949,6901,-6901,3944,6426,6425,-3950,3949,6425,7967,-6902,3950,3954,\n\t\t                    3955,-3952,3951,3955,6425,-6427,3954,6903,6902,-3956,3955,6902,7967,-6426,3950,3951,3956,-3953,3952,3956,6404,-6406,3951,6426,6427,-3957,3956,6427,7900,-6405,3950,3952,\n\t\t                    3957,-3954,3953,3957,6430,-6430,3952,6405,6406,-3958,3957,6406,7899,-6431,3950,3953,3958,-3955,3954,3958,6904,-6904,3953,6429,6428,-3959,3958,6428,7968,-6905,3959,3963,\n\t\t                    3964,-3961,3960,3964,6428,-6430,3963,6906,6905,-3965,3964,6905,7968,-6429,3959,3960,3965,-3962,3961,3965,6401,-6403,3960,6429,6430,-3966,3965,6430,7899,-6402,3959,3961,\n\t\t                    3966,-3963,3962,3966,6433,-6433,3961,6402,6403,-3967,3966,6403,8040,-6434,3959,3962,3967,-3964,3963,3967,6907,-6907,3962,6432,6431,-3968,3967,6431,8119,-6908,3968,3972,\n\t\t                    3973,-3970,3969,3973,6413,-6415,3972,6450,6451,-3974,3973,6451,7902,-6414,3968,3969,3974,-3971,3970,3974,6452,-6454,3969,6414,6415,-3975,3974,6415,8039,-6453,3968,3970,\n\t\t                    3975,-3972,3971,3975,6448,-6448,3970,6453,6454,-3976,3975,6454,8045,-6449,3968,3971,3976,-3973,3972,3976,6449,-6451,3971,6447,6446,-3977,3976,6446,7906,-6450,3977,3981,\n\t\t                    3982,-3979,3978,3982,6451,-6451,3981,6411,6410,-3983,3982,6410,7902,-6452,3977,3978,3983,-3980,3979,3983,6443,-6445,3978,6450,6449,-3984,3983,6449,7906,-6444,3977,3979,\n\t\t                    3984,-3981,3980,3984,6457,-6457,3979,6444,6445,-3985,3984,6445,7905,-6458,3977,3980,3985,-3982,3981,3985,6412,-6412,3980,6456,6455,-3986,3985,6455,7901,-6413,3986,3990,\n\t\t                    3991,-3988,3987,3991,6455,-6457,3990,6408,6407,-3992,3991,6407,7901,-6456,3986,3987,3992,-3989,3988,3992,6440,-6442,3987,6456,6457,-3993,3992,6457,7905,-6441,3986,3988,\n\t\t                    3993,-3990,3989,3993,6460,-6460,3988,6441,6442,-3994,3993,6442,7904,-6461,3986,3989,3994,-3991,3990,3994,6409,-6409,3989,6459,6458,-3995,3994,6458,7900,-6410,3995,3999,\n\t\t                    4000,-3997,3996,4000,6458,-6460,3999,6405,6404,-4001,4000,6404,7900,-6459,3995,3996,4001,-3998,3997,4001,6437,-6439,3996,6459,6460,-4002,4001,6460,7904,-6438,3995,3997,\n\t\t                    4002,-3999,3998,4002,6463,-6463,3997,6438,6439,-4003,4002,6439,7903,-6464,3995,3998,4003,-4000,3999,4003,6406,-6406,3998,6462,6461,-4004,4003,6461,7899,-6407,4004,4008,\n\t\t                    4009,-4006,4005,4009,6461,-6463,4008,6402,6401,-4010,4009,6401,7899,-6462,4004,4005,4010,-4007,4006,4010,6434,-6436,4005,6462,6463,-4011,4010,6463,7903,-6435,4004,4006,\n\t\t                    4011,-4008,4007,4011,6466,-6466,4006,6435,6436,-4012,4011,6436,8046,-6467,4004,4007,4012,-4009,4008,4012,6403,-6403,4007,6465,6464,-4013,4012,6464,8040,-6404,4013,4016,\n\t\t                    4017,-4015,4014,4017,6436,-6436,4016,6471,6470,-4018,4017,6470,8046,-6437,4013,4014,4018,-4016,4015,4018,6467,-6469,4014,6435,6434,-4019,4018,6434,7903,-6468,4013,4015,\n\t\t                    4019,-4017,4016,4019,6472,-6472,4015,6468,6469,-4020,4019,6469,7907,-6473,4020,4023,4024,-4022,4021,4024,6439,-6439,4023,6468,6467,-4025,4024,6467,7903,-6440,4020,4021,\n\t\t                    4025,-4023,4022,4025,6473,-6475,4021,6438,6437,-4026,4025,6437,7904,-6474,4020,4022,4026,-4024,4023,4026,6469,-6469,4022,6474,6475,-4027,4026,6475,7907,-6470,4027,4030,\n\t\t                    4031,-4029,4028,4031,6476,-6478,4030,6471,6472,-4032,4031,6472,7907,-6477,4027,4028,4032,-4030,4029,4032,6481,-6481,4028,6477,6478,-4033,4032,6478,8052,-6482,4027,4029,\n\t\t                    4033,-4031,4030,4033,6470,-6472,4029,6480,6479,-4034,4033,6479,8046,-6471,4034,4037,4038,-4036,4035,4038,6475,-6475,4037,6486,6485,-4039,4038,6485,7907,-6476,4034,4035,\n\t\t                    4039,-4037,4036,4039,6482,-6484,4035,6474,6473,-4040,4039,6473,7904,-6483,4034,4036,4040,-4038,4037,4040,6487,-6487,4036,6483,6484,-4041,4040,6484,7908,-6488,4041,4044,\n\t\t                    4045,-4043,4042,4045,6442,-6442,4044,6483,6482,-4046,4045,6482,7904,-6443,4041,4042,4046,-4044,4043,4046,6488,-6490,4042,6441,6440,-4047,4046,6440,7905,-6489,4041,4043,\n\t\t                    4047,-4045,4044,4047,6484,-6484,4043,6489,6490,-4048,4047,6490,7908,-6485,4048,4051,4052,-4050,4049,4052,6494,-6496,4051,6486,6487,-4053,4052,6487,7908,-6495,4048,4049,\n\t\t                    4053,-4051,4050,4053,6499,-6499,4049,6495,6496,-4054,4053,6496,7910,-6500,4048,4050,4054,-4052,4051,4054,6485,-6487,4050,6498,6497,-4055,4054,6497,7907,-6486,4055,4058,\n\t\t                    4059,-4057,4056,4059,6509,-6511,4058,6498,6499,-4060,4059,6499,7910,-6510,4055,4056,4060,-4058,4057,4060,6515,-6517,4056,6510,6511,-4061,4060,6511,7912,-6516,4055,4057,\n\t\t                    4061,-4059,4058,4061,6497,-6499,4057,6516,6517,-4062,4061,6517,7907,-6498,4062,4065,4066,-4064,4063,4066,6496,-6496,4065,6501,6500,-4067,4066,6500,7910,-6497,4062,4063,\n\t\t                    4067,-4065,4064,4067,6503,-6505,4063,6495,6494,-4068,4067,6494,7908,-6504,4062,4064,4068,-4066,4065,4068,6502,-6502,4064,6504,6505,-4069,4068,6505,7911,-6503,4069,4072,\n\t\t                    4073,-4071,4070,4073,6490,-6490,4072,6507,6506,-4074,4073,6506,7908,-6491,4069,4070,4074,-4072,4071,4074,6491,-6493,4070,6489,6488,-4075,4074,6488,7905,-6492,4069,4071,\n\t\t                    4075,-4073,4072,4075,6508,-6508,4071,6492,6493,-4076,4075,6493,7909,-6509,4076,4079,4080,-4078,4077,4080,6514,-6514,4079,6516,6515,-4081,4080,6515,7912,-6515,4076,4077,\n\t\t                    4081,-4079,4078,4081,6478,-6478,4077,6513,6512,-4082,4081,6512,8052,-6479,4076,4078,4082,-4080,4079,4082,6517,-6517,4078,6477,6476,-4083,4082,6476,7907,-6518,4083,4086,\n\t\t                    4087,-4085,4084,4087,6530,-6532,4086,6519,6520,-4088,4087,6520,7913,-6531,4083,4084,4088,-4086,4085,4088,6536,-6538,4084,6531,6532,-4089,4088,6532,7915,-6537,4083,4085,\n\t\t                    4089,-4087,4086,4089,6518,-6520,4085,6537,6538,-4090,4089,6538,7911,-6519,4090,4093,4094,-4092,4091,4094,6511,-6511,4093,6534,6533,-4095,4094,6533,7912,-6512,4090,4091,\n\t\t                    4095,-4093,4092,4095,6527,-6529,4091,6510,6509,-4096,4095,6509,7910,-6528,4090,4092,4096,-4094,4093,4096,6535,-6535,4092,6528,6529,-4097,4096,6529,7915,-6536,4097,4100,\n\t\t                    4101,-4099,4098,4101,6529,-6529,4100,6537,6536,-4102,4101,6536,7915,-6530,4097,4098,4102,-4100,4099,4102,6500,-6502,4098,6528,6527,-4103,4102,6527,7910,-6501,4097,4099,\n\t\t                    4103,-4101,4100,4103,6538,-6538,4099,6501,6502,-4104,4103,6502,7911,-6539,4104,4107,4108,-4106,4105,4108,6544,-6544,4107,6546,6545,-4109,4108,6545,7916,-6545,4104,4105,\n\t\t                    4109,-4107,4106,4109,6532,-6532,4105,6543,6542,-4110,4109,6542,7915,-6533,4104,4106,4110,-4108,4107,4110,6547,-6547,4106,6531,6530,-4111,4110,6530,7913,-6548,4111,4114,\n\t\t                    4115,-4113,4112,4115,6539,-6541,4114,6522,6523,-4116,4115,6523,7914,-6540,4111,4112,4116,-4114,4113,4116,6545,-6547,4112,6540,6541,-4117,4116,6541,7916,-6546,4111,4113,\n\t\t                    4117,-4115,4114,4117,6521,-6523,4113,6546,6547,-4118,4117,6547,7913,-6522,4118,4121,4122,-4120,4119,4122,6526,-6526,4121,6540,6539,-4123,4122,6539,7914,-6527,4118,4119,\n\t\t                    4123,-4121,4120,4123,6548,-6550,4119,6525,6524,-4124,4123,6524,7909,-6549,4118,4120,4124,-4122,4121,4124,6541,-6541,4120,6549,6550,-4125,4124,6550,7916,-6542,4125,4129,\n\t\t                    4130,-4127,4126,4130,6551,-6553,4129,6444,6443,-4131,4130,6443,7906,-6552,4125,4126,4131,-4128,4127,4131,6556,-6556,4126,6552,6553,-4132,4131,6553,7917,-6557,4125,4127,\n\t\t                    4132,-4129,4128,4132,6493,-6493,4127,6555,6554,-4133,4132,6554,7909,-6494,4125,4128,4133,-4130,4129,4133,6445,-6445,4128,6492,6491,-4134,4133,6491,7905,-6446,4134,4137,\n\t\t                    4138,-4136,4135,4138,6550,-6550,4137,6561,6560,-4139,4138,6560,7916,-6551,4134,4135,4139,-4137,4136,4139,6554,-6556,4135,6549,6548,-4140,4139,6548,7909,-6555,4134,4136,\n\t\t                    4140,-4138,4137,4140,6562,-6562,4136,6555,6556,-4141,4140,6556,7917,-6563,4141,4144,4145,-4143,4142,4145,6563,-6565,4144,6561,6562,-4146,4145,6562,7917,-6564,4141,4142,\n\t\t                    4146,-4144,4143,4146,6568,-6568,4142,6564,6565,-4147,4146,6565,7918,-6569,4141,4143,4147,-4145,4144,4147,6560,-6562,4143,6567,6566,-4148,4147,6566,7916,-6561,4148,4151,\n\t\t                    4152,-4150,4149,4152,6566,-6568,4151,6543,6544,-4153,4152,6544,7916,-6567,4148,4149,4153,-4151,4150,4153,6571,-6571,4149,6567,6568,-4154,4153,6568,7918,-6572,4148,4150,\n\t\t                    4154,-4152,4151,4154,6542,-6544,4150,6570,6569,-4155,4154,6569,7915,-6543,4155,4158,4159,-4157,4156,4159,6569,-6571,4158,6534,6535,-4160,4159,6535,7915,-6570,4155,4156,\n\t\t                    4160,-4158,4157,4160,6574,-6574,4156,6570,6571,-4161,4160,6571,7918,-6575,4155,4157,4161,-4159,4158,4161,6533,-6535,4157,6573,6572,-4162,4161,6572,7912,-6534,4162,4166,\n\t\t                    4167,-4164,4163,4167,6572,-6574,4166,6588,6589,-4168,4167,6589,7912,-6573,4162,4163,4168,-4165,4164,4168,6590,-6592,4163,6573,6574,-4169,4168,6574,7918,-6591,4162,4164,\n\t\t                    4169,-4166,4165,4169,6586,-6586,4164,6591,6592,-4170,4169,6592,7922,-6587,4162,4165,4170,-4167,4166,4170,6587,-6589,4165,6585,6584,-4171,4170,6584,7920,-6588,4171,4175,\n\t\t                    4176,-4173,4172,4176,6565,-6565,4175,6591,6590,-4177,4176,6590,7918,-6566,4171,4172,4177,-4174,4173,4177,6593,-6595,4172,6564,6563,-4178,4177,6563,7917,-6594,4171,4173,\n\t\t                    4178,-4175,4174,4178,6581,-6583,4173,6594,6595,-4179,4178,6595,7921,-6582,4171,4174,4179,-4176,4175,4179,6592,-6592,4174,6582,6583,-4180,4179,6583,7922,-6593,4180,4184,\n\t\t                    4185,-4182,4181,4185,6553,-6553,4184,6594,6593,-4186,4185,6593,7917,-6554,4180,4181,4186,-4183,4182,4186,6596,-6598,4181,6552,6551,-4187,4186,6551,7906,-6597,4180,4182,\n\t\t                    4187,-4184,4183,4187,6578,-6580,4182,6597,6598,-4188,4187,6598,7919,-6579,4180,4183,4188,-4185,4184,4188,6595,-6595,4183,6579,6580,-4189,4188,6580,7921,-6596,4189,4193,\n\t\t                    4194,-4191,4190,4194,6446,-6448,4193,6597,6596,-4195,4194,6596,7906,-6447,4189,4190,4195,-4192,4191,4195,6599,-6601,4190,6447,6448,-4196,4195,6448,8045,-6600,4189,4191,\n\t\t                    4196,-4193,4192,4196,6577,-6577,4191,6600,6601,-4197,4196,6601,8065,-6578,4189,4192,4197,-4194,4193,4197,6598,-6598,4192,6576,6575,-4198,4197,6575,7919,-6599,4198,4201,\n\t\t                    4202,-4200,4199,4202,6589,-6589,4201,6513,6514,-4203,4202,6514,7912,-6590,4198,4199,4203,-4201,4200,4203,6604,-6604,4199,6588,6587,-4204,4203,6587,7920,-6605,4198,4200,\n\t\t                    4204,-4202,4201,4204,6512,-6514,4200,6603,6602,-4205,4204,6602,8052,-6513,4205,4209,4210,-4207,4206,4210,6584,-6586,4209,6618,6619,-4211,4210,6619,7920,-6585,4205,4206,\n\t\t                    4211,-4208,4207,4211,6620,-6622,4206,6585,6586,-4212,4211,6586,7922,-6621,4205,4207,4212,-4209,4208,4212,6616,-6616,4207,6621,6622,-4213,4212,6622,7924,-6617,4205,4208,\n\t\t                    4213,-4210,4209,4213,6617,-6619,4208,6615,6614,-4214,4213,6614,7923,-6618,4214,4217,4218,-4216,4215,4218,6557,-6559,4217,6624,6625,-4219,4218,6625,8072,-6558,4214,4215,\n\t\t                    4219,-4217,4216,4219,6605,-6607,4215,6558,6559,-4220,4219,6559,8063,-6606,4214,4216,4220,-4218,4217,4220,6623,-6625,4216,6606,6607,-4221,4220,6607,7921,-6624,4221,4225,\n\t\t                    4226,-4223,4222,4226,6580,-6580,4225,6624,6623,-4227,4226,6623,7921,-6581,4221,4222,4227,-4224,4223,4227,6626,-6628,4222,6579,6578,-4228,4227,6578,7919,-6627,4221,4223,\n\t\t                    4228,-4225,4224,4228,6608,-6610,4223,6627,6628,-4229,4228,6628,8070,-6609,4221,4224,4229,-4226,4225,4229,6625,-6625,4224,6609,6610,-4230,4229,6610,8072,-6626,4230,4233,\n\t\t                    4234,-4232,4231,4234,6619,-6619,4233,6603,6604,-4235,4234,6604,7920,-6620,4230,4231,4235,-4233,4232,4235,6613,-6613,4231,6618,6617,-4236,4235,6617,7923,-6614,4230,4232,\n\t\t                    4236,-4234,4233,4236,6602,-6604,4232,6612,6611,-4237,4236,6611,8052,-6603,4237,4240,4241,-4239,4238,4241,6575,-6577,4240,6627,6626,-4242,4241,6626,7919,-6576,4237,4238,\n\t\t                    4242,-4240,4239,4242,6634,-6634,4238,6576,6577,-4243,4242,6577,8065,-6635,4237,4239,4243,-4241,4240,4243,6628,-6628,4239,6633,6632,-4244,4243,6632,8070,-6629,4244,4248,\n\t\t                    4249,-4246,4245,4249,6629,-6631,4248,6606,6605,-4250,4249,6605,8063,-6630,4244,4245,4250,-4247,4246,4250,6622,-6622,4245,6630,6631,-4251,4250,6631,7924,-6623,4244,4246,\n\t\t                    4251,-4248,4247,4251,6583,-6583,4246,6621,6620,-4252,4251,6620,7922,-6584,4244,4247,4252,-4249,4248,4252,6607,-6607,4247,6582,6581,-4253,4252,6581,7921,-6608,4253,4257,\n\t\t                    4258,-4255,4254,4258,6524,-6526,4257,6651,6652,-4259,4258,6652,7909,-6525,4253,4254,4259,-4256,4255,4259,6653,-6655,4254,6525,6526,-4260,4259,6526,7914,-6654,4253,4255,\n\t\t                    4260,-4257,4256,4260,6649,-6649,4255,6654,6655,-4261,4260,6655,7929,-6650,4253,4256,4261,-4258,4257,4261,6650,-6652,4256,6648,6647,-4262,4261,6647,7926,-6651,4262,4266,\n\t\t                    4267,-4264,4263,4267,6523,-6523,4266,6654,6653,-4268,4267,6653,7914,-6524,4262,4263,4268,-4265,4264,4268,6656,-6658,4263,6522,6521,-4269,4268,6521,7913,-6657,4262,4264,\n\t\t                    4269,-4266,4265,4269,6644,-6646,4264,6657,6658,-4270,4269,6658,7928,-6645,4262,4265,4270,-4267,4266,4270,6655,-6655,4265,6645,6646,-4271,4270,6646,7929,-6656,4271,4275,\n\t\t                    4276,-4273,4272,4276,6520,-6520,4275,6657,6656,-4277,4276,6656,7913,-6521,4271,4272,4277,-4274,4273,4277,6659,-6661,4272,6519,6518,-4278,4277,6518,7911,-6660,4271,4273,\n\t\t                    4278,-4275,4274,4278,6641,-6643,4273,6660,6661,-4279,4278,6661,7927,-6642,4271,4274,4279,-4276,4275,4279,6658,-6658,4274,6642,6643,-4280,4279,6643,7928,-6659,4280,4284,\n\t\t                    4285,-4282,4281,4285,6506,-6508,4284,6663,6664,-4286,4285,6664,7908,-6507,4280,4281,4286,-4283,4282,4286,6652,-6652,4281,6507,6508,-4287,4286,6508,7909,-6653,4280,4282,\n\t\t                    4287,-4284,4283,4287,6640,-6640,4282,6651,6650,-4288,4287,6650,7926,-6641,4280,4283,4288,-4285,4284,4288,6662,-6664,4283,6639,6638,-4289,4288,6638,7925,-6663,4289,4293,\n\t\t                    4294,-4291,4290,4294,6505,-6505,4293,6660,6659,-4295,4294,6659,7911,-6506,4289,4290,4295,-4292,4291,4295,6664,-6664,4290,6504,6503,-4296,4295,6503,7908,-6665,4289,4291,\n\t\t                    4296,-4293,4292,4296,6635,-6637,4291,6663,6662,-4297,4296,6662,7925,-6636,4289,4292,4297,-4294,4293,4297,6661,-6661,4292,6636,6637,-4298,4297,6637,7927,-6662,4298,4302,\n\t\t                    4303,-4300,4299,4303,6680,-6682,4302,6642,6641,-4304,4303,6641,7927,-6681,4298,4299,4304,-4301,4300,4304,6673,-6673,4299,6681,6682,-4305,4304,6682,7932,-6674,4298,4300,\n\t\t                    4305,-4302,4301,4305,6683,-6685,4300,6672,6671,-4306,4305,6671,7933,-6684,4298,4301,4306,-4303,4302,4306,6643,-6643,4301,6684,6685,-4307,4306,6685,7928,-6644,4307,4311,\n\t\t                    4312,-4309,4308,4312,6685,-6685,4311,6645,6644,-4313,4312,6644,7928,-6686,4307,4308,4313,-4310,4309,4313,6676,-6676,4308,6684,6683,-4314,4313,6683,7933,-6677,4307,4309,\n\t\t                    4314,-4311,4310,4314,6686,-6688,4309,6675,6674,-4315,4314,6674,7934,-6687,4307,4310,4315,-4312,4311,4315,6646,-6646,4310,6687,6688,-4316,4315,6688,7929,-6647,4316,4320,\n\t\t                    4321,-4318,4317,4321,6688,-6688,4320,6648,6649,-4322,4321,6649,7929,-6689,4316,4317,4322,-4319,4318,4322,6679,-6679,4317,6687,6686,-4323,4322,6686,7934,-6680,4316,4318,\n\t\t                    4323,-4320,4319,4323,6689,-6691,4318,6678,6677,-4324,4323,6677,7930,-6690,4316,4319,4324,-4321,4320,4324,6647,-6649,4319,6690,6691,-4325,4324,6691,7926,-6648,4325,4329,\n\t\t                    4330,-4327,4326,4330,6691,-6691,4329,6639,6640,-4331,4330,6640,7926,-6692,4325,4326,4331,-4328,4327,4331,6667,-6667,4326,6690,6689,-4332,4331,6689,7930,-6668,4325,4327,\n\t\t                    4332,-4329,4328,4332,6692,-6694,4327,6666,6665,-4333,4332,6665,7931,-6693,4325,4328,4333,-4330,4329,4333,6638,-6640,4328,6693,6694,-4334,4333,6694,7925,-6639,4334,4338,\n\t\t                    4339,-4336,4335,4339,6694,-6694,4338,6636,6635,-4340,4339,6635,7925,-6695,4334,4335,4340,-4337,4336,4340,6670,-6670,4335,6693,6692,-4341,4340,6692,7931,-6671,4334,4336,\n\t\t                    4341,-4338,4337,4341,6682,-6682,4336,6669,6668,-4342,4341,6668,7932,-6683,4334,4337,4342,-4339,4338,4342,6637,-6637,4337,6681,6680,-4343,4342,6680,7927,-6638,4343,4347,\n\t\t                    4348,-4345,4344,4348,6677,-6679,4347,6711,6712,-4349,4348,6712,7930,-6678,4343,4344,4349,-4346,4345,4349,6713,-6715,4344,6678,6679,-4350,4349,6679,7934,-6714,4343,4345,\n\t\t                    4350,-4347,4346,4350,6709,-6709,4345,6714,6715,-4351,4350,6715,7939,-6710,4343,4346,4351,-4348,4347,4351,6710,-6712,4346,6708,6707,-4352,4351,6707,7935,-6711,4352,4356,\n\t\t                    4357,-4354,4353,4357,6674,-6676,4356,6714,6713,-4358,4357,6713,7934,-6675,4352,4353,4358,-4355,4354,4358,6716,-6718,4353,6675,6676,-4359,4358,6676,7933,-6717,4352,4354,\n\t\t                    4359,-4356,4355,4359,6706,-6706,4354,6717,6718,-4360,4359,6718,7938,-6707,4352,4355,4360,-4357,4356,4360,6715,-6715,4355,6705,6704,-4361,4360,6704,7939,-6716,4361,4365,\n\t\t                    4366,-4363,4362,4366,6671,-6673,4365,6717,6716,-4367,4366,6716,7933,-6672,4361,4362,4367,-4364,4363,4367,6719,-6721,4362,6672,6673,-4368,4367,6673,7932,-6720,4361,4363,\n\t\t                    4368,-4365,4364,4368,6703,-6703,4363,6720,6721,-4369,4368,6721,7937,-6704,4361,4364,4369,-4366,4365,4369,6718,-6718,4364,6702,6701,-4370,4369,6701,7938,-6719,4370,4374,\n\t\t                    4375,-4372,4371,4375,6668,-6670,4374,6720,6719,-4376,4375,6719,7932,-6669,4370,4371,4376,-4373,4372,4376,6722,-6724,4371,6669,6670,-4377,4376,6670,7931,-6723,4370,4372,\n\t\t                    4377,-4374,4373,4377,6700,-6700,4372,6723,6724,-4378,4377,6724,7936,-6701,4370,4373,4378,-4375,4374,4378,6721,-6721,4373,6699,6698,-4379,4378,6698,7937,-6722,4379,4383,\n\t\t                    4384,-4381,4380,4384,6665,-6667,4383,6723,6722,-4385,4384,6722,7931,-6666,4379,4380,4385,-4382,4381,4385,6712,-6712,4380,6666,6667,-4386,4385,6667,7930,-6713,4379,4381,\n\t\t                    4386,-4383,4382,4386,6697,-6697,4381,6711,6710,-4387,4386,6710,7935,-6698,4379,4382,4387,-4384,4383,4387,6724,-6724,4382,6696,6695,-4388,4387,6695,7936,-6725,4388,4392,\n\t\t                    4393,-4390,4389,4393,6707,-6709,4392,6741,6742,-4394,4393,6742,7935,-6708,4388,4389,4394,-4391,4390,4394,6743,-6745,4389,6708,6709,-4395,4394,6709,7939,-6744,4388,4390,\n\t\t                    4395,-4392,4391,4395,6739,-6739,4390,6744,6745,-4396,4395,6745,7944,-6740,4388,4391,4396,-4393,4392,4396,6740,-6742,4391,6738,6737,-4397,4396,6737,7940,-6741,4397,4401,\n\t\t                    4402,-4399,4398,4402,6704,-6706,4401,6744,6743,-4403,4402,6743,7939,-6705,4397,4398,4403,-4400,4399,4403,6746,-6748,4398,6705,6706,-4404,4403,6706,7938,-6747,4397,4399,\n\t\t                    4404,-4401,4400,4404,6736,-6736,4399,6747,6748,-4405,4404,6748,7943,-6737,4397,4400,4405,-4402,4401,4405,6745,-6745,4400,6735,6734,-4406,4405,6734,7944,-6746,4406,4410,\n\t\t                    4411,-4408,4407,4411,6701,-6703,4410,6747,6746,-4412,4411,6746,7938,-6702,4406,4407,4412,-4409,4408,4412,6749,-6751,4407,6702,6703,-4413,4412,6703,7937,-6750,4406,4408,\n\t\t                    4413,-4410,4409,4413,6733,-6733,4408,6750,6751,-4414,4413,6751,7942,-6734,4406,4409,4414,-4411,4410,4414,6748,-6748,4409,6732,6731,-4415,4414,6731,7943,-6749,4415,4419,\n\t\t                    4420,-4417,4416,4420,6698,-6700,4419,6750,6749,-4421,4420,6749,7937,-6699,4415,4416,4421,-4418,4417,4421,6752,-6754,4416,6699,6700,-4422,4421,6700,7936,-6753,4415,4417,\n\t\t                    4422,-4419,4418,4422,6730,-6730,4417,6753,6754,-4423,4422,6754,7941,-6731,4415,4418,4423,-4420,4419,4423,6751,-6751,4418,6729,6728,-4424,4423,6728,7942,-6752,4424,4428,\n\t\t                    4429,-4426,4425,4429,6695,-6697,4428,6753,6752,-4430,4429,6752,7936,-6696,4424,4425,4430,-4427,4426,4430,6742,-6742,4425,6696,6697,-4431,4430,6697,7935,-6743,4424,4426,\n\t\t                    4431,-4428,4427,4431,6727,-6727,4426,6741,6740,-4432,4431,6740,7940,-6728,4424,4427,4432,-4429,4428,4432,6754,-6754,4427,6726,6725,-4433,4432,6725,7941,-6755,4433,4437,\n\t\t                    4438,-4435,4434,4438,6737,-6739,4437,6771,6772,-4439,4438,6772,7940,-6738,4433,4434,4439,-4436,4435,4439,6773,-6775,4434,6738,6739,-4440,4439,6739,7944,-6774,4433,4435,\n\t\t                    4440,-4437,4436,4440,6769,-6769,4435,6774,6775,-4441,4440,6775,7949,-6770,4433,4436,4441,-4438,4437,4441,6770,-6772,4436,6768,6767,-4442,4441,6767,7945,-6771,4442,4446,\n\t\t                    4447,-4444,4443,4447,6734,-6736,4446,6774,6773,-4448,4447,6773,7944,-6735,4442,4443,4448,-4445,4444,4448,6776,-6778,4443,6735,6736,-4449,4448,6736,7943,-6777,4442,4444,\n\t\t                    4449,-4446,4445,4449,6766,-6766,4444,6777,6778,-4450,4449,6778,7948,-6767,4442,4445,4450,-4447,4446,4450,6775,-6775,4445,6765,6764,-4451,4450,6764,7949,-6776,4451,4455,\n\t\t                    4456,-4453,4452,4456,6731,-6733,4455,6777,6776,-4457,4456,6776,7943,-6732,4451,4452,4457,-4454,4453,4457,6779,-6781,4452,6732,6733,-4458,4457,6733,7942,-6780,4451,4453,\n\t\t                    4458,-4455,4454,4458,6763,-6763,4453,6780,6781,-4459,4458,6781,7947,-6764,4451,4454,4459,-4456,4455,4459,6778,-6778,4454,6762,6761,-4460,4459,6761,7948,-6779,4460,4464,\n\t\t                    4465,-4462,4461,4465,6728,-6730,4464,6780,6779,-4466,4465,6779,7942,-6729,4460,4461,4466,-4463,4462,4466,6782,-6784,4461,6729,6730,-4467,4466,6730,7941,-6783,4460,4462,\n\t\t                    4467,-4464,4463,4467,6760,-6760,4462,6783,6784,-4468,4467,6784,7946,-6761,4460,4463,4468,-4465,4464,4468,6781,-6781,4463,6759,6758,-4469,4468,6758,7947,-6782,4469,4473,\n\t\t                    4474,-4471,4470,4474,6725,-6727,4473,6783,6782,-4475,4474,6782,7941,-6726,4469,4470,4475,-4472,4471,4475,6772,-6772,4470,6726,6727,-4476,4475,6727,7940,-6773,4469,4471,\n\t\t                    4476,-4473,4472,4476,6757,-6757,4471,6771,6770,-4477,4476,6770,7945,-6758,4469,4472,4477,-4474,4473,4477,6784,-6784,4472,6756,6755,-4478,4477,6755,7946,-6785,4478,4482,\n\t\t                    4483,-4480,4479,4483,6767,-6769,4482,6801,6802,-4484,4483,6802,7945,-6768,4478,4479,4484,-4481,4480,4484,6803,-6805,4479,6768,6769,-4485,4484,6769,7949,-6804,4478,4480,\n\t\t                    4485,-4482,4481,4485,6799,-6799,4480,6804,6805,-4486,4485,6805,7954,-6800,4478,4481,4486,-4483,4482,4486,6800,-6802,4481,6798,6797,-4487,4486,6797,7950,-6801,4487,4491,\n\t\t                    4492,-4489,4488,4492,6764,-6766,4491,6804,6803,-4493,4492,6803,7949,-6765,4487,4488,4493,-4490,4489,4493,6806,-6808,4488,6765,6766,-4494,4493,6766,7948,-6807,4487,4489,\n\t\t                    4494,-4491,4490,4494,6796,-6796,4489,6807,6808,-4495,4494,6808,7953,-6797,4487,4490,4495,-4492,4491,4495,6805,-6805,4490,6795,6794,-4496,4495,6794,7954,-6806,4496,4500,\n\t\t                    4501,-4498,4497,4501,6761,-6763,4500,6807,6806,-4502,4501,6806,7948,-6762,4496,4497,4502,-4499,4498,4502,6809,-6811,4497,6762,6763,-4503,4502,6763,7947,-6810,4496,4498,\n\t\t                    4503,-4500,4499,4503,6793,-6793,4498,6810,6811,-4504,4503,6811,7952,-6794,4496,4499,4504,-4501,4500,4504,6808,-6808,4499,6792,6791,-4505,4504,6791,7953,-6809,4505,4509,\n\t\t                    4510,-4507,4506,4510,6758,-6760,4509,6810,6809,-4511,4510,6809,7947,-6759,4505,4506,4511,-4508,4507,4511,6812,-6814,4506,6759,6760,-4512,4511,6760,7946,-6813,4505,4507,\n\t\t                    4512,-4509,4508,4512,6790,-6790,4507,6813,6814,-4513,4512,6814,7951,-6791,4505,4508,4513,-4510,4509,4513,6811,-6811,4508,6789,6788,-4514,4513,6788,7952,-6812,4514,4518,\n\t\t                    4519,-4516,4515,4519,6755,-6757,4518,6813,6812,-4520,4519,6812,7946,-6756,4514,4515,4520,-4517,4516,4520,6802,-6802,4515,6756,6757,-4521,4520,6757,7945,-6803,4514,4516,\n\t\t                    4521,-4518,4517,4521,6787,-6787,4516,6801,6800,-4522,4521,6800,7950,-6788,4514,4517,4522,-4519,4518,4522,6814,-6814,4517,6786,6785,-4523,4522,6785,7951,-6815,4523,4527,\n\t\t                    4528,-4525,4524,4528,6797,-6799,4527,6831,6832,-4529,4528,6832,7950,-6798,4523,4524,4529,-4526,4525,4529,6833,-6835,4524,6798,6799,-4530,4529,6799,7954,-6834,4523,4525,\n\t\t                    4530,-4527,4526,4530,6829,-6829,4525,6834,6835,-4531,4530,6835,7959,-6830,4523,4526,4531,-4528,4527,4531,6830,-6832,4526,6828,6827,-4532,4531,6827,7955,-6831,4532,4536,\n\t\t                    4537,-4534,4533,4537,6794,-6796,4536,6834,6833,-4538,4537,6833,7954,-6795,4532,4533,4538,-4535,4534,4538,6836,-6838,4533,6795,6796,-4539,4538,6796,7953,-6837,4532,4534,\n\t\t                    4539,-4536,4535,4539,6826,-6826,4534,6837,6838,-4540,4539,6838,7958,-6827,4532,4535,4540,-4537,4536,4540,6835,-6835,4535,6825,6824,-4541,4540,6824,7959,-6836,4541,4545,\n\t\t                    4546,-4543,4542,4546,6791,-6793,4545,6837,6836,-4547,4546,6836,7953,-6792,4541,4542,4547,-4544,4543,4547,6839,-6841,4542,6792,6793,-4548,4547,6793,7952,-6840,4541,4543,\n\t\t                    4548,-4545,4544,4548,6823,-6823,4543,6840,6841,-4549,4548,6841,7957,-6824,4541,4544,4549,-4546,4545,4549,6838,-6838,4544,6822,6821,-4550,4549,6821,7958,-6839,4550,4554,\n\t\t                    4555,-4552,4551,4555,6788,-6790,4554,6840,6839,-4556,4555,6839,7952,-6789,4550,4551,4556,-4553,4552,4556,6842,-6844,4551,6789,6790,-4557,4556,6790,7951,-6843,4550,4552,\n\t\t                    4557,-4554,4553,4557,6820,-6820,4552,6843,6844,-4558,4557,6844,7956,-6821,4550,4553,4558,-4555,4554,4558,6841,-6841,4553,6819,6818,-4559,4558,6818,7957,-6842,4559,4563,\n\t\t                    4564,-4561,4560,4564,6785,-6787,4563,6843,6842,-4565,4564,6842,7951,-6786,4559,4560,4565,-4562,4561,4565,6832,-6832,4560,6786,6787,-4566,4565,6787,7950,-6833,4559,4561,\n\t\t                    4566,-4563,4562,4566,6817,-6817,4561,6831,6830,-4567,4566,6830,7955,-6818,4559,4562,4567,-4564,4563,4567,6844,-6844,4562,6816,6815,-4568,4567,6815,7956,-6845,4568,4572,\n\t\t                    4573,-4570,4569,4573,6827,-6829,4572,6861,6862,-4574,4573,6862,7955,-6828,4568,4569,4574,-4571,4570,4574,6863,-6865,4569,6828,6829,-4575,4574,6829,7959,-6864,4568,4570,\n\t\t                    4575,-4572,4571,4575,6859,-6859,4570,6864,6865,-4576,4575,6865,7964,-6860,4568,4571,4576,-4573,4572,4576,6860,-6862,4571,6858,6857,-4577,4576,6857,7960,-6861,4577,4581,\n\t\t                    4582,-4579,4578,4582,6824,-6826,4581,6864,6863,-4583,4582,6863,7959,-6825,4577,4578,4583,-4580,4579,4583,6866,-6868,4578,6825,6826,-4584,4583,6826,7958,-6867,4577,4579,\n\t\t                    4584,-4581,4580,4584,6856,-6856,4579,6867,6868,-4585,4584,6868,7963,-6857,4577,4580,4585,-4582,4581,4585,6865,-6865,4580,6855,6854,-4586,4585,6854,7964,-6866,4586,4590,\n\t\t                    4591,-4588,4587,4591,6821,-6823,4590,6867,6866,-4592,4591,6866,7958,-6822,4586,4587,4592,-4589,4588,4592,6869,-6871,4587,6822,6823,-4593,4592,6823,7957,-6870,4586,4588,\n\t\t                    4593,-4590,4589,4593,6853,-6853,4588,6870,6871,-4594,4593,6871,7962,-6854,4586,4589,4594,-4591,4590,4594,6868,-6868,4589,6852,6851,-4595,4594,6851,7963,-6869,4595,4599,\n\t\t                    4600,-4597,4596,4600,6818,-6820,4599,6870,6869,-4601,4600,6869,7957,-6819,4595,4596,4601,-4598,4597,4601,6872,-6874,4596,6819,6820,-4602,4601,6820,7956,-6873,4595,4597,\n\t\t                    4602,-4599,4598,4602,6850,-6850,4597,6873,6874,-4603,4602,6874,7961,-6851,4595,4598,4603,-4600,4599,4603,6871,-6871,4598,6849,6848,-4604,4603,6848,7962,-6872,4604,4608,\n\t\t                    4609,-4606,4605,4609,6815,-6817,4608,6873,6872,-4610,4609,6872,7956,-6816,4604,4605,4610,-4607,4606,4610,6862,-6862,4605,6816,6817,-4611,4610,6817,7955,-6863,4604,4606,\n\t\t                    4611,-4608,4607,4611,6847,-6847,4606,6861,6860,-4612,4611,6860,7960,-6848,4604,4607,4612,-4609,4608,4612,6874,-6874,4607,6846,6845,-4613,4612,6845,7961,-6875,4613,4617,\n\t\t                    4618,-4615,4614,4618,6095,-6097,4617,6417,6418,-4619,4618,6418,7853,-6096,4613,4614,4619,-4616,4615,4619,6880,-6880,4614,6096,6097,-4620,4619,6097,7983,-6881,4613,4615,\n\t\t                    4620,-4617,4616,4620,6893,-6895,4615,6879,6878,-4621,4620,6878,8115,-6894,4613,4616,4621,-4618,4617,4621,6416,-6418,4616,6894,6895,-4622,4621,6895,7965,-6417,4622,4626,\n\t\t                    4627,-4624,4623,4627,6418,-6418,4626,6093,6092,-4628,4627,6092,7853,-6419,4622,4623,4628,-4625,4624,4628,6896,-6898,4623,6417,6416,-4629,4628,6416,7965,-6897,4622,4624,\n\t\t                    4629,-4626,4625,4629,6881,-6883,4624,6897,6898,-4630,4629,6898,7966,-6882,4622,4625,4630,-4627,4626,4630,6094,-6094,4625,6882,6883,-4631,4630,6883,7852,-6095,4631,4635,\n\t\t                    4636,-4633,4632,4636,6883,-6883,4635,6090,6089,-4637,4636,6089,7852,-6884,4631,4632,4637,-4634,4633,4637,6899,-6901,4632,6882,6881,-4638,4637,6881,7966,-6900,4631,4633,\n\t\t                    4638,-4635,4634,4638,6884,-6886,4633,6900,6901,-4639,4638,6901,7967,-6885,4631,4634,4639,-4636,4635,4639,6091,-6091,4634,6885,6886,-4640,4639,6886,7851,-6092,4640,4644,\n\t\t                    4645,-4642,4641,4645,6886,-6886,4644,6087,6086,-4646,4645,6086,7851,-6887,4640,4641,4646,-4643,4642,4646,6902,-6904,4641,6885,6884,-4647,4646,6884,7967,-6903,4640,4642,\n\t\t                    4647,-4644,4643,4647,6887,-6889,4642,6903,6904,-4648,4647,6904,7968,-6888,4640,4643,4648,-4645,4644,4648,6088,-6088,4643,6888,6889,-4649,4648,6889,7850,-6089,4649,4653,\n\t\t                    4654,-4651,4650,4654,6889,-6889,4653,6084,6083,-4655,4654,6083,7850,-6890,4649,4650,4655,-4652,4651,4655,6905,-6907,4650,6888,6887,-4656,4655,6887,7968,-6906,4649,4651,\n\t\t                    4656,-4653,4652,4656,6890,-6892,4651,6906,6907,-4657,4656,6907,8119,-6891,4649,4652,4657,-4654,4653,4657,6085,-6085,4652,6891,6892,-4658,4657,6892,7984,-6086,4658,4662,\n\t\t                    4663,-4660,4659,4663,6384,-6386,4662,6930,6931,-4664,4663,6931,7894,-6385,4658,4659,4664,-4661,4660,4664,6932,-6934,4659,6385,6386,-4665,4664,6386,7898,-6933,4658,4660,\n\t\t                    4665,-4662,4661,4665,6928,-6928,4660,6933,6934,-4666,4665,6934,7975,-6929,4658,4661,4666,-4663,4662,4666,6929,-6931,4661,6927,6926,-4667,4666,6926,7971,-6930,4667,4671,\n\t\t                    4672,-4669,4668,4672,6381,-6383,4671,6933,6932,-4673,4672,6932,7898,-6382,4667,4668,4673,-4670,4669,4673,6935,-6937,4668,6382,6383,-4674,4673,6383,7893,-6936,4667,4669,\n\t\t                    4674,-4671,4670,4674,6925,-6925,4669,6936,6937,-4675,4674,6937,7970,-6926,4667,4670,4675,-4672,4671,4675,6934,-6934,4670,6924,6923,-4676,4675,6923,7975,-6935,4676,4680,\n\t\t                    4681,-4678,4677,4681,6378,-6380,4680,6939,6940,-4682,4681,6940,7895,-6379,4676,4677,4682,-4679,4678,4682,6941,-6943,4677,6379,6380,-4683,4682,6380,7897,-6942,4676,4678,\n\t\t                    4683,-4680,4679,4683,6922,-6922,4678,6942,6943,-4684,4683,6943,7974,-6923,4676,4679,4684,-4681,4680,4684,6938,-6940,4679,6921,6920,-4685,4684,6920,7972,-6939,4685,4689,\n\t\t                    4690,-4687,4686,4690,6377,-6377,4689,6942,6941,-4691,4690,6941,7897,-6378,4685,4686,4691,-4688,4687,4691,6931,-6931,4686,6376,6375,-4692,4691,6375,7894,-6932,4685,4687,\n\t\t                    4692,-4689,4688,4692,6917,-6919,4687,6930,6929,-4693,4692,6929,7971,-6918,4685,4688,4693,-4690,4689,4693,6943,-6943,4688,6918,6919,-4694,4693,6919,7974,-6944,4694,4698,\n\t\t                    4699,-4696,4695,4699,6372,-6374,4698,6945,6946,-4700,4699,6946,7892,-6373,4694,4695,4700,-4697,4696,4700,6947,-6949,4695,6373,6374,-4701,4700,6374,7896,-6948,4694,4696,\n\t\t                    4701,-4698,4697,4701,6916,-6916,4696,6948,6949,-4702,4701,6949,7973,-6917,4694,4697,4702,-4699,4698,4702,6944,-6946,4697,6915,6914,-4703,4702,6914,7969,-6945,4703,4707,\n\t\t                    4708,-4705,4704,4708,6371,-6371,4707,6936,6935,-4709,4708,6935,7893,-6372,4703,4704,4709,-4706,4705,4709,6946,-6946,4704,6370,6369,-4710,4709,6369,7892,-6947,4703,4705,\n\t\t                    4710,-4707,4706,4710,6911,-6913,4705,6945,6944,-4711,4710,6944,7969,-6912,4703,4706,4711,-4708,4707,4711,6937,-6937,4706,6912,6913,-4712,4711,6913,7970,-6938,4712,4716,\n\t\t                    4717,-4714,4713,4717,6366,-6368,4716,6948,6947,-4718,4717,6947,7896,-6367,4712,4713,4718,-4715,4714,4718,6940,-6940,4713,6367,6368,-4719,4718,6368,7895,-6941,4712,4714,\n\t\t                    4719,-4716,4715,4719,6910,-6910,4714,6939,6938,-4720,4719,6938,7972,-6911,4712,4715,4720,-4717,4716,4720,6949,-6949,4715,6909,6908,-4721,4720,6908,7973,-6950,4721,4725,\n\t\t                    4726,-4723,4722,4726,6926,-6928,4725,6972,6973,-4727,4726,6973,7971,-6927,4721,4722,4727,-4724,4723,4727,6974,-6976,4722,6927,6928,-4728,4727,6928,7975,-6975,4721,4723,\n\t\t                    4728,-4725,4724,4728,6970,-6970,4723,6975,6976,-4729,4728,6976,7982,-6971,4721,4724,4729,-4726,4725,4729,6971,-6973,4724,6969,6968,-4730,4729,6968,7978,-6972,4730,4734,\n\t\t                    4735,-4732,4731,4735,6923,-6925,4734,6975,6974,-4736,4735,6974,7975,-6924,4730,4731,4736,-4733,4732,4736,6977,-6979,4731,6924,6925,-4737,4736,6925,7970,-6978,4730,4732,\n\t\t                    4737,-4734,4733,4737,6967,-6967,4732,6978,6979,-4738,4737,6979,7977,-6968,4730,4733,4738,-4735,4734,4738,6976,-6976,4733,6966,6965,-4739,4738,6965,7982,-6977,4739,4743,\n\t\t                    4744,-4741,4740,4744,6920,-6922,4743,6981,6982,-4745,4744,6982,7972,-6921,4739,4740,4745,-4742,4741,4745,6983,-6985,4740,6921,6922,-4746,4745,6922,7974,-6984,4739,4741,\n\t\t                    4746,-4743,4742,4746,6964,-6964,4741,6984,6985,-4747,4746,6985,7981,-6965,4739,4742,4747,-4744,4743,4747,6980,-6982,4742,6963,6962,-4748,4747,6962,7979,-6981,4748,4752,\n\t\t                    4753,-4750,4749,4753,6919,-6919,4752,6984,6983,-4754,4753,6983,7974,-6920,4748,4749,4754,-4751,4750,4754,6973,-6973,4749,6918,6917,-4755,4754,6917,7971,-6974,4748,4750,\n\t\t                    4755,-4752,4751,4755,6959,-6961,4750,6972,6971,-4756,4755,6971,7978,-6960,4748,4751,4756,-4753,4752,4756,6985,-6985,4751,6960,6961,-4757,4756,6961,7981,-6986,4757,4761,\n\t\t                    4762,-4759,4758,4762,6914,-6916,4761,6987,6988,-4763,4762,6988,7969,-6915,4757,4758,4763,-4760,4759,4763,6989,-6991,4758,6915,6916,-4764,4763,6916,7973,-6990,4757,4759,\n\t\t                    4764,-4761,4760,4764,6958,-6958,4759,6990,6991,-4765,4764,6991,7980,-6959,4757,4760,4765,-4762,4761,4765,6986,-6988,4760,6957,6956,-4766,4765,6956,7976,-6987,4766,4770,\n\t\t                    4771,-4768,4767,4771,6913,-6913,4770,6978,6977,-4772,4771,6977,7970,-6914,4766,4767,4772,-4769,4768,4772,6988,-6988,4767,6912,6911,-4773,4772,6911,7969,-6989,4766,4768,\n\t\t                    4773,-4770,4769,4773,6953,-6955,4768,6987,6986,-4774,4773,6986,7976,-6954,4766,4769,4774,-4771,4770,4774,6979,-6979,4769,6954,6955,-4775,4774,6955,7977,-6980,4775,4779,\n\t\t                    4780,-4777,4776,4780,6908,-6910,4779,6990,6989,-4781,4780,6989,7973,-6909,4775,4776,4781,-4778,4777,4781,6982,-6982,4776,6909,6910,-4782,4781,6910,7972,-6983,4775,4777,\n\t\t                    4782,-4779,4778,4782,6952,-6952,4777,6981,6980,-4783,4782,6980,7979,-6953,4775,4778,4783,-4780,4779,4783,6991,-6991,4778,6951,6950,-4784,4783,6950,7980,-6992,4784,4787,\n\t\t                    4788,-4786,4785,4788,7019,-7021,4787,7002,7001,-4789,4788,7001,7988,-7020,4784,4785,4789,-4787,4786,4789,7037,-7039,4785,7020,7021,-4790,4789,7021,7997,-7038,4784,4786,\n\t\t                    4790,-4788,4787,4790,7003,-7003,4786,7038,7039,-4791,4790,7039,7987,-7004,4791,4795,4796,-4793,4792,4796,7000,-7000,4795,7026,7027,-4797,4796,7027,7986,-7001,4791,4792,\n\t\t                    4797,-4794,4793,4797,7024,-7024,4792,6999,6998,-4798,4797,6998,7987,-7025,4791,4793,4798,-4795,4794,4798,7010,-7012,4793,7023,7022,-4799,4798,7022,7996,-7011,4791,4794,\n\t\t                    4799,-4796,4795,4799,7025,-7027,4794,7011,7012,-4800,4799,7012,7995,-7026,4800,4804,4805,-4802,4801,4805,7012,-7012,4804,7065,7066,-4806,4805,7066,7995,-7013,4800,4801,\n\t\t                    4806,-4803,4802,4806,7067,-7069,4801,7011,7010,-4807,4806,7010,7996,-7068,4800,4802,4807,-4804,4803,4807,7040,-7042,4802,7068,7069,-4808,4807,7069,8002,-7041,4800,4803,\n\t\t                    4808,-4805,4804,4808,7064,-7066,4803,7041,7042,-4809,4808,7042,8001,-7065,4809,4812,4813,-4811,4810,4813,7016,-7018,4812,7005,7006,-4814,4813,7006,7983,-7017,4809,4810,\n\t\t                    4814,-4812,4811,4814,7021,-7021,4810,7017,7018,-4815,4814,7018,7997,-7022,4809,4811,4815,-4813,4812,4815,7004,-7006,4811,7020,7019,-4816,4815,7019,7988,-7005,4816,4820,\n\t\t                    4821,-4818,4817,4821,6994,-6994,4820,6099,6098,-4822,4821,6098,7984,-6995,4816,4817,4822,-4819,4818,4822,7030,-7030,4817,6993,6992,-4823,4822,6992,7985,-7031,4816,4818,\n\t\t                    4823,-4820,4819,4823,7034,-7036,4818,7029,7028,-4824,4823,7028,7994,-7035,4816,4819,4824,-4821,4820,4824,6100,-6100,4819,7035,7036,-4825,4824,7036,7989,-6101,4825,4828,\n\t\t                    4829,-4827,4826,4829,7033,-7033,4828,6108,6109,-4830,4829,6109,7993,-7034,4825,4826,4830,-4828,4827,4830,7018,-7018,4826,7032,7031,-4831,4830,7031,7997,-7019,4825,4827,\n\t\t                    4831,-4829,4828,4831,6107,-6109,4827,7017,7016,-4832,4831,7016,7983,-6108,4832,4835,4836,-4834,4833,4836,7013,-7015,4835,7038,7037,-4837,4836,7037,7997,-7014,4832,4833,\n\t\t                    4837,-4835,4834,4837,7022,-7024,4833,7014,7015,-4838,4837,7015,7996,-7023,4832,4834,4838,-4836,4835,4838,7039,-7039,4834,7023,7024,-4839,4838,7024,7987,-7040,4839,4843,\n\t\t                    4844,-4841,4840,4844,7015,-7015,4843,7068,7067,-4845,4844,7067,7996,-7016,4839,4840,4845,-4842,4841,4845,7043,-7045,4840,7014,7013,-4846,4845,7013,7997,-7044,4839,4841,\n\t\t                    4846,-4843,4842,4846,7070,-7072,4841,7044,7045,-4847,4846,7045,7998,-7071,4839,4842,4847,-4844,4843,4847,7069,-7069,4842,7071,7072,-4848,4847,7072,8002,-7070,4848,4852,\n\t\t                    4853,-4850,4849,4853,7031,-7033,4852,7044,7043,-4854,4853,7043,7997,-7032,4848,4849,4854,-4851,4850,4854,6151,-6151,4849,7032,7033,-4855,4854,7033,7993,-6152,4848,4850,\n\t\t                    4855,-4852,4851,4855,7046,-7048,4850,6150,6149,-4856,4855,6149,7992,-7047,4848,4851,4856,-4853,4852,4856,7045,-7045,4851,7047,7048,-4857,4856,7048,7998,-7046,4857,4861,\n\t\t                    4862,-4859,4858,4862,7052,-7054,4861,6105,6104,-4863,4862,6104,7991,-7053,4857,4858,4863,-4860,4859,4863,7051,-7051,4858,7053,7054,-4864,4863,7054,7999,-7052,4857,4859,\n\t\t                    4864,-4861,4860,4864,7048,-7048,4859,7050,7049,-4865,4864,7049,7998,-7049,4857,4860,4865,-4862,4861,4865,6106,-6106,4860,7047,7046,-4866,4865,7046,7992,-6107,4866,4869,\n\t\t                    4870,-4868,4867,4870,7060,-7060,4869,7056,7055,-4871,4870,7055,8000,-7061,4866,4867,4871,-4869,4868,4871,6103,-6103,4867,7059,7058,-4872,4871,7058,7991,-6104,4866,4868,\n\t\t                    4872,-4870,4869,4872,7057,-7057,4868,6102,6101,-4873,4872,6101,7990,-7058,4873,4877,4878,-4875,4874,4878,7036,-7036,4877,6171,6170,-4879,4878,6170,7989,-7037,4873,4874,\n\t\t                    4879,-4876,4875,4879,7061,-7063,4874,7035,7034,-4880,4879,7034,7994,-7062,4873,4875,4880,-4877,4876,4880,7055,-7057,4875,7062,7063,-4881,4880,7063,8000,-7056,4873,4876,\n\t\t                    4881,-4878,4877,4881,6172,-6172,4876,7056,7057,-4882,4881,7057,7990,-6173,4882,4886,4887,-4884,4883,4887,7028,-7030,4886,7008,7009,-4888,4887,7009,7994,-7029,4882,4883,\n\t\t                    4888,-4885,4884,4888,6997,-6997,4883,7029,7030,-4889,4888,7030,7985,-6998,4882,4884,4889,-4886,4885,4889,7027,-7027,4884,6996,6995,-4890,4889,6995,7986,-7028,4882,4885,\n\t\t                    4890,-4887,4886,4890,7007,-7009,4885,7026,7025,-4891,4890,7025,7995,-7008,4891,4894,4895,-4893,4892,4895,7063,-7063,4894,7077,7076,-4896,4895,7076,8000,-7064,4891,4892,\n\t\t                    4896,-4894,4893,4896,7073,-7075,4892,7062,7061,-4897,4896,7061,7994,-7074,4891,4893,4897,-4895,4894,4897,7078,-7078,4893,7074,7075,-4898,4897,7075,8003,-7079,4898,4902,\n\t\t                    4903,-4900,4899,4903,7009,-7009,4902,7074,7073,-4904,4903,7073,7994,-7010,4898,4899,4904,-4901,4900,4904,7066,-7066,4899,7008,7007,-4905,4904,7007,7995,-7067,4898,4900,\n\t\t                    4905,-4902,4901,4905,7079,-7081,4900,7065,7064,-4906,4905,7064,8001,-7080,4898,4901,4906,-4903,4902,4906,7075,-7075,4901,7080,7081,-4907,4906,7081,8003,-7076,4907,4911,\n\t\t                    4912,-4909,4908,4912,7081,-7081,4911,7098,7099,-4913,4912,7099,8003,-7082,4907,4908,4913,-4910,4909,4913,7100,-7102,4908,7080,7079,-4914,4913,7079,8001,-7101,4907,4909,\n\t\t                    4914,-4911,4910,4914,7094,-7096,4909,7101,7102,-4915,4914,7102,8007,-7095,4907,4910,4915,-4912,4911,4915,7097,-7099,4910,7095,7096,-4916,4915,7096,8009,-7098,4916,4920,\n\t\t                    4921,-4918,4917,4921,7076,-7078,4920,7104,7105,-4922,4921,7105,8000,-7077,4916,4917,4922,-4919,4918,4922,7099,-7099,4917,7077,7078,-4923,4922,7078,8003,-7100,4916,4918,\n\t\t                    4923,-4920,4919,4923,7093,-7093,4918,7098,7097,-4924,4923,7097,8009,-7094,4916,4919,4924,-4921,4920,4924,7103,-7105,4919,7092,7091,-4925,4924,7091,8006,-7104,4925,4929,\n\t\t                    4930,-4927,4926,4930,7072,-7072,4929,7107,7108,-4931,4930,7108,8002,-7073,4925,4926,4931,-4928,4927,4931,7109,-7111,4926,7071,7070,-4932,4931,7070,7998,-7110,4925,4927,\n\t\t                    4932,-4929,4928,4932,7088,-7090,4927,7110,7111,-4933,4932,7111,8004,-7089,4925,4928,4933,-4930,4929,4933,7106,-7108,4928,7089,7090,-4934,4933,7090,8008,-7107,4934,4938,\n\t\t                    4939,-4936,4935,4939,7112,-7114,4938,7050,7051,-4940,4939,7051,7999,-7113,4934,4935,4940,-4937,4936,4940,7087,-7087,4935,7113,7114,-4941,4940,7114,8005,-7088,4934,4936,\n\t\t                    4941,-4938,4937,4941,7111,-7111,4936,7086,7085,-4942,4941,7085,8004,-7112,4934,4937,4942,-4939,4938,4942,7049,-7051,4937,7110,7109,-4943,4942,7109,7998,-7050,4943,4947,\n\t\t                    4948,-4945,4944,4948,7042,-7042,4947,7101,7100,-4949,4948,7100,8001,-7043,4943,4944,4949,-4946,4945,4949,7108,-7108,4944,7041,7040,-4950,4949,7040,8002,-7109,4943,4945,\n\t\t                    4950,-4947,4946,4950,7082,-7084,4945,7107,7106,-4951,4950,7106,8008,-7083,4943,4946,4951,-4948,4947,4951,7102,-7102,4946,7083,7084,-4952,4951,7084,8007,-7103,4952,4956,\n\t\t                    4957,-4954,4953,4957,7054,-7054,4956,7113,7112,-4958,4957,7112,7999,-7055,4952,4953,4958,-4955,4954,4958,7117,-7117,4953,7053,7052,-4959,4958,7052,7991,-7118,4952,4954,\n\t\t                    4959,-4956,4955,4959,7118,-7120,4954,7116,7115,-4960,4959,7115,8010,-7119,4952,4955,4960,-4957,4956,4960,7114,-7114,4955,7119,7120,-4961,4960,7120,8005,-7115,4961,4965,\n\t\t                    4966,-4963,4962,4966,7058,-7060,4965,7116,7117,-4967,4966,7117,7991,-7059,4961,4962,4967,-4964,4963,4967,7105,-7105,4962,7059,7060,-4968,4967,7060,8000,-7106,4961,4963,\n\t\t                    4968,-4965,4964,4968,7121,-7123,4963,7104,7103,-4969,4968,7103,8006,-7122,4961,4964,4969,-4966,4965,4969,7115,-7117,4964,7122,7123,-4970,4969,7123,8010,-7116,4971,7121,\n\t\t                    8006,-7126,4973,7123,7122,-4971,4970,4971,4974,-4973,5016,5020,4975,-4973,4971,7125,7124,-4975,5016,4972,4974,-5018,4970,4972,4975,-4974,4973,4975,7127,-7127,5020,7162,\n\t\t                    7127,-4976,8010,7123,4973,-7127,4976,7119,7118,-4978,4977,7118,8010,-7127,4979,7120,7119,-4977,4976,4977,4980,-4979,5025,5029,4981,-4979,4977,7126,7127,-4981,5025,4978,\n\t\t                    4980,-5027,4976,4978,4981,-4980,4979,4981,7129,-7129,5029,7165,7129,-4982,5017,4974,7124,-7162,8005,7120,4979,-7129,4985,7096,7095,-4983,7131,8009,7096,-4986,4982,7095,\n\t\t                    7094,-4984,4983,7094,8007,-7133,4991,7091,7092,-4989,4982,4983,4986,-4985,5031,5035,4987,-4985,4983,7132,7133,-4987,5031,4984,4986,-5037,4982,4984,4987,-4986,4985,4987,\n\t\t                    7130,-7132,5035,7170,7130,-4988,5026,4980,7127,-7163,7125,8006,7091,-4992,4988,7092,7093,-4990,4989,7093,8009,-7132,4997,7090,7089,-4995,4988,4989,4992,-4991,5045,4992,\n\t\t                    7130,-7171,4989,7131,7130,-4993,5036,4986,7133,-7172,4988,4990,4993,-4992,4991,4993,7124,-7126,5040,4990,4992,-5046,5040,5044,4993,-4991,7135,8008,7090,-4998,4994,7089,\n\t\t                    7088,-4996,4995,7088,8004,-7137,5000,7086,7087,-5002,4994,4995,4998,-4997,5049,5053,4999,-4997,4995,7136,7137,-4999,5049,4996,4998,-5055,4994,4996,4999,-4998,4997,4999,\n\t\t                    7134,-7136,5053,7176,7134,-5000,5044,7161,7124,-4994,5001,7087,8005,-7129,5003,7085,7086,-5001,5000,5001,5004,-5003,5062,5004,7129,-7166,5001,7128,7129,-5005,5054,4998,\n\t\t                    7137,-7178,5000,5002,5005,-5004,5003,5005,7137,-7137,5061,5002,5004,-5063,5061,5065,5005,-5003,8004,7085,5003,-7137,5009,7084,7083,-5007,8007,7084,5009,-7133,5006,7083,\n\t\t                    7082,-5008,5007,7082,8008,-7136,5006,5007,5010,-5009,5067,5071,5011,-5009,5007,7135,7134,-5011,5067,5008,5010,-5073,5006,5008,5011,-5010,5009,5011,7133,-7133,5071,7171,\n\t\t                    7133,-5012,5065,7177,7137,-5006,5012,5016,5017,-5014,5013,5017,7161,-7161,5012,5013,5018,-5015,5014,5018,7156,-7158,5013,7160,7159,-5019,5018,7159,8013,-7157,5012,5014,\n\t\t                    5019,-5016,5015,5019,7164,-7164,5014,7157,7158,-5020,5019,7158,8017,-7165,5012,5015,5020,-5017,5015,7163,7162,-5021,5021,5025,5026,-5023,5022,5026,7162,-7164,5021,5022,\n\t\t                    5027,-5024,5023,5027,7153,-7155,5022,7163,7164,-5028,5027,7164,8017,-7154,5021,5023,5028,-5025,5024,5028,7167,-7167,5023,7154,7155,-5029,5028,7155,8012,-7168,5021,5024,\n\t\t                    5029,-5026,5024,7166,7165,-5030,5030,5034,5035,-5032,5034,7169,7170,-5036,5030,5031,5036,-5033,5032,5036,7171,-7173,5030,5032,5037,-5034,5033,5037,7150,-7152,5032,7172,\n\t\t                    7173,-5038,5037,7173,8014,-7151,5030,5033,5038,-5035,5034,5038,7168,-7170,5033,7151,7152,-5039,5038,7152,8016,-7169,5039,5043,5044,-5041,5043,7160,7161,-5045,5039,5040,\n\t\t                    5045,-5042,5041,5045,7170,-7170,5039,5041,5046,-5043,5042,5046,7149,-7149,5041,7169,7168,-5047,5046,7168,8016,-7150,5039,5042,5047,-5044,5043,5047,7159,-7161,5042,7148,\n\t\t                    7147,-5048,5047,7147,8013,-7160,5048,5052,5053,-5050,5052,7175,7176,-5054,5048,5049,5054,-5051,5050,5054,7177,-7179,5048,5050,5055,-5052,5051,5055,7144,-7146,5050,7178,\n\t\t                    7179,-5056,5055,7179,8011,-7145,5048,5051,5056,-5053,5052,5056,7174,-7176,5051,7145,7146,-5057,5056,7146,8015,-7175,5057,5061,5062,-5059,5058,5062,7165,-7167,5057,5058,\n\t\t                    5063,-5060,5059,5063,7143,-7143,5058,7166,7167,-5064,5063,7167,8012,-7144,5057,5059,5064,-5061,5060,5064,7179,-7179,5059,7142,7141,-5065,5064,7141,8011,-7180,5057,5060,\n\t\t                    5065,-5062,5060,7178,7177,-5066,5066,5070,5071,-5068,5070,7172,7171,-5072,5066,5067,5072,-5069,5068,5072,7176,-7176,5066,5068,5073,-5070,5069,5073,7138,-7140,5068,7175,\n\t\t                    7174,-5074,5073,7174,8015,-7139,5066,5069,5074,-5071,5070,5074,7173,-7173,5069,7139,7140,-5075,5074,7140,8014,-7174,5075,5079,5080,-5077,5076,5080,7203,-7203,5079,7157,\n\t\t                    7156,-5081,5080,7156,8013,-7204,5075,5076,5081,-5078,5077,5081,7198,-7200,5076,7202,7201,-5082,5081,7201,8020,-7199,5075,5077,5082,-5079,5078,5082,7206,-7206,5077,7199,\n\t\t                    7200,-5083,5082,7200,8024,-7207,5075,5078,5083,-5080,5079,5083,7158,-7158,5078,7205,7204,-5084,5083,7204,8017,-7159,5084,5088,5089,-5086,5085,5089,7204,-7206,5088,7154,\n\t\t                    7153,-5090,5089,7153,8017,-7205,5084,5085,5090,-5087,5086,5090,7195,-7197,5085,7205,7206,-5091,5090,7206,8024,-7196,5084,5086,5091,-5088,5087,5091,7209,-7209,5086,7196,\n\t\t                    7197,-5092,5091,7197,8019,-7210,5084,5087,5092,-5089,5088,5092,7155,-7155,5087,7208,7207,-5093,5092,7207,8012,-7156,5093,5097,5098,-5095,5094,5098,7152,-7152,5097,7211,\n\t\t                    7212,-5099,5098,7212,8016,-7153,5093,5094,5099,-5096,5095,5099,7213,-7215,5094,7151,7150,-5100,5099,7150,8014,-7214,5093,5095,5100,-5097,5096,5100,7192,-7194,5095,7214,\n\t\t                    7215,-5101,5100,7215,8021,-7193,5093,5096,5101,-5098,5097,5101,7210,-7212,5096,7193,7194,-5102,5101,7194,8023,-7211,5102,5106,5107,-5104,5103,5107,7147,-7149,5106,7202,\n\t\t                    7203,-5108,5107,7203,8013,-7148,5102,5103,5108,-5105,5104,5108,7212,-7212,5103,7148,7149,-5109,5108,7149,8016,-7213,5102,5104,5109,-5106,5105,5109,7191,-7191,5104,7211,\n\t\t                    7210,-5110,5109,7210,8023,-7192,5102,5105,5110,-5107,5106,5110,7201,-7203,5105,7190,7189,-5111,5110,7189,8020,-7202,5111,5115,5116,-5113,5112,5116,7146,-7146,5115,7217,\n\t\t                    7218,-5117,5116,7218,8015,-7147,5111,5112,5117,-5114,5113,5117,7219,-7221,5112,7145,7144,-5118,5117,7144,8011,-7220,5111,5113,5118,-5115,5114,5118,7186,-7188,5113,7220,\n\t\t                    7221,-5119,5118,7221,8018,-7187,5111,5114,5119,-5116,5115,5119,7216,-7218,5114,7187,7188,-5120,5119,7188,8022,-7217,5120,5124,5125,-5122,5121,5125,7207,-7209,5124,7142,\n\t\t                    7143,-5126,5125,7143,8012,-7208,5120,5121,5126,-5123,5122,5126,7185,-7185,5121,7208,7209,-5127,5126,7209,8019,-7186,5120,5122,5127,-5124,5123,5127,7221,-7221,5122,7184,\n\t\t                    7183,-5128,5127,7183,8018,-7222,5120,5123,5128,-5125,5124,5128,7141,-7143,5123,7220,7219,-5129,5128,7219,8011,-7142,5129,5133,5134,-5131,5130,5134,7140,-7140,5133,7214,\n\t\t                    7213,-5135,5134,7213,8014,-7141,5129,5130,5135,-5132,5131,5135,7218,-7218,5130,7139,7138,-5136,5135,7138,8015,-7219,5129,5131,5136,-5133,5132,5136,7180,-7182,5131,7217,\n\t\t                    7216,-5137,5136,7216,8022,-7181,5129,5132,5137,-5134,5133,5137,7215,-7215,5132,7181,7182,-5138,5137,7182,8021,-7216,5139,7198,8020,-7245,5141,7200,7199,-5139,5138,5139,\n\t\t                    5142,-5141,5140,5142,7240,-7242,5139,7244,7243,-5143,5142,7243,8027,-7241,5138,5140,5143,-5142,5141,5143,7246,-7246,5140,7241,7242,-5144,5143,7242,8031,-7247,8024,7200,\n\t\t                    5141,-7246,5144,7196,7195,-5146,5145,7195,8024,-7246,5147,7197,7196,-5145,5144,5145,5148,-5147,5146,5148,7237,-7239,5145,7245,7246,-5149,5148,7246,8031,-7238,5144,5146,\n\t\t                    5149,-5148,5147,5149,7248,-7248,5146,7238,7239,-5150,5149,7239,8026,-7249,8019,7197,5147,-7248,5153,7194,7193,-5151,7250,8023,7194,-5154,5150,7193,7192,-5152,5151,7192,\n\t\t                    8021,-7252,5159,7189,7190,-5157,5150,5151,5154,-5153,5152,5154,7234,-7236,5151,7251,7252,-5155,5154,7252,8028,-7235,5150,5152,5155,-5154,5153,5155,7249,-7251,5152,7235,\n\t\t                    7236,-5156,5155,7236,8030,-7250,7244,8020,7189,-5160,5156,7190,7191,-5158,5157,7191,8023,-7251,5165,7188,7187,-5163,5156,5157,5160,-5159,5158,5160,7233,-7233,5157,7250,\n\t\t                    7249,-5161,5160,7249,8030,-7234,5156,5158,5161,-5160,5159,5161,7243,-7245,5158,7232,7231,-5162,5161,7231,8027,-7244,7254,8022,7188,-5166,5162,7187,7186,-5164,5163,7186,\n\t\t                    8018,-7256,5168,7184,7185,-5170,5162,5163,5166,-5165,5164,5166,7228,-7230,5163,7255,7256,-5167,5166,7256,8025,-7229,5162,5164,5167,-5166,5165,5167,7253,-7255,5164,7229,\n\t\t                    7230,-5168,5167,7230,8029,-7254,5169,7185,8019,-7248,5171,7183,7184,-5169,5168,5169,5172,-5171,5170,5172,7227,-7227,5169,7247,7248,-5173,5172,7248,8026,-7228,5168,5170,\n\t\t                    5173,-5172,5171,5173,7256,-7256,5170,7226,7225,-5174,5173,7225,8025,-7257,8018,7183,5171,-7256,5177,7182,7181,-5175,8021,7182,5177,-7252,5174,7181,7180,-5176,5175,7180,\n\t\t                    8022,-7255,3884,3885,3882,-3882,5174,5175,5178,-5177,5176,5178,7222,-7224,5175,7254,7253,-5179,5178,7253,8029,-7223,5174,5176,5179,-5178,5177,5179,7252,-7252,5176,7223,\n\t\t                    7224,-5180,5179,7224,8028,-7253,7278,5183,5182,-7280,5184,5185,5181,-5181,5181,7241,7240,-5183,5182,7240,8027,-7280,5180,5183,7275,-7277,5183,7278,8034,-7276,7280,5185,\n\t\t                    5184,-7282,5188,5189,5186,-5188,5180,7276,7277,-5185,5184,7277,8038,-7282,5181,5185,7242,-7242,5185,7280,8031,-7243,7280,7281,5189,-5189,5190,5191,5187,-5187,5187,7238,\n\t\t                    7237,-5189,5188,7237,8031,-7281,5186,5189,7272,-7274,5189,7281,8038,-7273,7282,5191,5190,-7284,5195,5196,5193,-5193,5186,7273,7274,-5191,5190,7274,8033,-7284,5187,5191,\n\t\t                    7239,-7239,5191,7282,8026,-7240,5194,5197,7284,-7286,5192,5194,7236,-7236,5201,5202,5199,-5199,5194,7285,8030,-7237,7286,7287,5196,-5196,5192,5193,5197,-5195,5192,7235,\n\t\t                    7234,-5196,5195,7234,8028,-7287,5193,5196,7269,-7271,5196,7287,8035,-7270,5193,7270,7271,-5198,5197,7271,8037,-7285,5200,5203,7278,-7280,5198,5200,7231,-7233,5207,5208,\n\t\t                    5205,-5205,5200,7279,8027,-7232,7284,5202,5201,-7286,5198,5199,5203,-5201,5198,7232,7233,-5202,5201,7233,8030,-7286,5199,5202,7268,-7268,5202,7284,8037,-7269,5199,7267,\n\t\t                    7266,-5204,5203,7266,8034,-7279,5206,5209,7288,-7290,5204,5206,7230,-7230,5212,5213,5210,-5212,5206,7289,8029,-7231,7290,7291,5208,-5208,5204,5205,5209,-5207,5204,7229,\n\t\t                    7228,-5208,5207,7228,8025,-7291,5205,5208,7263,-7265,5208,7291,8032,-7264,5205,7264,7265,-5210,5209,7265,8036,-7289,7282,7283,5213,-5213,5214,5215,5211,-5211,5211,7226,\n\t\t                    7227,-5213,5212,7227,8026,-7283,5210,5213,7262,-7262,5213,7283,8033,-7263,7290,5215,5214,-7292,5219,5220,5217,-5217,5210,7261,7260,-5215,5214,7260,8032,-7292,5211,5215,\n\t\t                    7225,-7227,5215,7290,8025,-7226,5218,5221,7287,-7287,5216,5218,7224,-7224,5218,7286,8028,-7225,7288,5220,5219,-7290,5216,5217,5221,-5219,5216,7223,7222,-5220,5219,7222,\n\t\t                    8029,-7290,5217,5220,7257,-7259,5220,7288,8036,-7258,5217,7258,7259,-5222,5221,7259,8035,-7288,5222,5226,5227,-5224,5223,5227,7739,-7741,5226,7752,7753,-5228,5227,7753,\n\t\t                    8114,-7740,5222,5223,5228,-5225,5224,5228,7304,-7306,5223,7740,7741,-5229,5228,7741,8044,-7305,5222,5224,5229,-5226,5225,5229,6421,-6421,5224,7305,7306,-5230,5229,7306,\n\t\t                    8039,-6422,5222,5225,5230,-5227,5226,5230,7751,-7753,5225,6420,6419,-5231,5230,6419,8115,-7752,5231,5235,5236,-5233,5232,5236,7754,-7756,5235,7740,7739,-5237,5236,7739,\n\t\t                    8114,-7755,5231,5232,5237,-5234,5233,5237,7310,-7312,5232,7755,7756,-5238,5237,7756,8116,-7311,5231,5233,5238,-5235,5234,5238,7303,-7303,5233,7311,7312,-5239,5238,7312,\n\t\t                    8043,-7304,5231,5234,5239,-5236,5235,5239,7741,-7741,5234,7302,7301,-5240,5239,7301,8044,-7742,5240,5244,5245,-5242,5241,5245,7757,-7759,5244,7311,7310,-5246,5245,7310,\n\t\t                    8116,-7758,5240,5241,5246,-5243,5242,5246,7313,-7315,5241,7758,7759,-5247,5246,7759,8117,-7314,5240,5242,5247,-5244,5243,5247,7300,-7300,5242,7314,7315,-5248,5247,7315,\n\t\t                    8042,-7301,5240,5243,5248,-5245,5244,5248,7312,-7312,5243,7299,7298,-5249,5248,7298,8043,-7313,5249,5253,5254,-5251,5250,5254,7760,-7762,5253,7314,7313,-5255,5254,7313,\n\t\t                    8117,-7761,5249,5250,5255,-5252,5251,5255,7316,-7318,5250,7761,7762,-5256,5255,7762,8118,-7317,5249,5251,5256,-5253,5252,5256,7297,-7297,5251,7317,7318,-5257,5256,7318,\n\t\t                    8041,-7298,5249,5252,5257,-5254,5253,5257,7315,-7315,5252,7296,7295,-5258,5257,7295,8042,-7316,5258,5262,5263,-5260,5259,5263,7763,-7765,5262,7317,7316,-5264,5263,7316,\n\t\t                    8118,-7764,5258,5259,5264,-5261,5260,5264,6431,-6433,5259,7764,7765,-5265,5264,7765,8119,-6432,5258,5260,5265,-5262,5261,5265,7294,-7294,5260,6432,6433,-5266,5265,6433,\n\t\t                    8040,-7295,5258,5261,5266,-5263,5262,5266,7318,-7318,5261,7293,7292,-5267,5266,7292,8041,-7319,5267,5271,5272,-5269,5268,5272,7336,-7336,5271,7305,7304,-5273,5272,7304,\n\t\t                    8044,-7337,5267,5268,5273,-5270,5269,5273,7331,-7333,5268,7335,7334,-5274,5273,7334,8050,-7332,5267,5269,5274,-5271,5270,5274,6454,-6454,5269,7332,7333,-5275,5274,7333,\n\t\t                    8045,-6455,5267,5270,5275,-5272,5271,5275,7306,-7306,5270,6453,6452,-5276,5275,6452,8039,-7307,5276,5280,5281,-5278,5277,5281,7301,-7303,5280,7335,7336,-5282,5281,7336,\n\t\t                    8044,-7302,5276,5277,5282,-5279,5278,5282,7337,-7339,5277,7302,7303,-5283,5282,7303,8043,-7338,5276,5278,5283,-5280,5279,5283,7330,-7330,5278,7338,7339,-5284,5283,7339,\n\t\t                    8049,-7331,5276,5279,5284,-5281,5280,5284,7334,-7336,5279,7329,7328,-5285,5284,7328,8050,-7335,5285,5289,5290,-5287,5286,5290,7298,-7300,5289,7338,7337,-5291,5290,7337,\n\t\t                    8043,-7299,5285,5286,5291,-5288,5287,5291,7340,-7342,5286,7299,7300,-5292,5291,7300,8042,-7341,5285,5287,5292,-5289,5288,5292,7327,-7327,5287,7341,7342,-5293,5292,7342,\n\t\t                    8048,-7328,5285,5288,5293,-5290,5289,5293,7339,-7339,5288,7326,7325,-5294,5293,7325,8049,-7340,5294,5298,5299,-5296,5295,5299,7295,-7297,5298,7341,7340,-5300,5299,7340,\n\t\t                    8042,-7296,5294,5295,5300,-5297,5296,5300,7343,-7345,5295,7296,7297,-5301,5300,7297,8041,-7344,5294,5296,5301,-5298,5297,5301,7324,-7324,5296,7344,7345,-5302,5301,7345,\n\t\t                    8047,-7325,5294,5297,5302,-5299,5298,5302,7342,-7342,5297,7323,7322,-5303,5302,7322,8048,-7343,5303,5307,5308,-5305,5304,5308,7292,-7294,5307,7344,7343,-5309,5308,7343,\n\t\t                    8041,-7293,5303,5304,5309,-5306,5305,5309,6464,-6466,5304,7293,7294,-5310,5309,7294,8040,-6465,5303,5305,5310,-5307,5306,5310,7321,-7321,5305,6465,6466,-5311,5310,6466,\n\t\t                    8046,-7322,5303,5306,5311,-5308,5307,5311,7345,-7345,5306,7320,7319,-5312,5311,7319,8047,-7346,5312,5315,5316,-5314,5313,5316,7349,-7351,5315,7320,7321,-5317,5316,7321,\n\t\t                    8046,-7350,5312,5313,5317,-5315,5314,5317,7348,-7348,5313,7350,7351,-5318,5317,7351,8051,-7349,5312,5314,5318,-5316,5315,5318,7319,-7321,5314,7347,7346,-5319,5318,7346,\n\t\t                    8047,-7320,5319,5322,5323,-5321,5320,5323,7346,-7348,5322,7323,7324,-5324,5323,7324,8047,-7347,5319,5320,5324,-5322,5321,5324,7354,-7354,5320,7347,7348,-5325,5324,7348,\n\t\t                    8051,-7355,5319,5321,5325,-5323,5322,5325,7322,-7324,5321,7353,7352,-5326,5325,7352,8048,-7323,5326,5329,5330,-5328,5327,5330,7351,-7351,5329,7356,7355,-5331,5330,7355,\n\t\t                    8051,-7352,5326,5327,5331,-5329,5328,5331,6479,-6481,5327,7350,7349,-5332,5331,7349,8046,-6480,5326,5328,5332,-5330,5329,5332,7357,-7357,5328,6480,6481,-5333,5332,6481,\n\t\t                    8052,-7358,5333,5336,5337,-5335,5334,5337,7361,-7363,5336,7353,7354,-5338,5337,7354,8051,-7362,5333,5334,5338,-5336,5335,5338,7360,-7360,5334,7362,7363,-5339,5338,7363,\n\t\t                    8053,-7361,5333,5335,5339,-5337,5336,5339,7352,-7354,5335,7359,7358,-5340,5339,7358,8048,-7353,5340,5343,5344,-5342,5341,5344,7358,-7360,5343,7326,7327,-5345,5344,7327,\n\t\t                    8048,-7359,5340,5341,5345,-5343,5342,5345,7366,-7366,5341,7359,7360,-5346,5345,7360,8053,-7367,5340,5342,5346,-5344,5343,5346,7325,-7327,5342,7365,7364,-5347,5346,7364,\n\t\t                    8049,-7326,5347,5350,5351,-5349,5348,5351,7363,-7363,5350,7371,7370,-5352,5351,7370,8053,-7364,5347,5348,5352,-5350,5349,5352,7373,-7375,5348,7362,7361,-5353,5352,7361,\n\t\t                    8051,-7374,5347,5349,5353,-5351,5350,5353,7372,-7372,5349,7374,7375,-5354,5353,7375,8055,-7373,5354,5357,5358,-5356,5355,5358,7375,-7375,5357,7386,7385,-5359,5358,7385,\n\t\t                    8055,-7376,5354,5355,5359,-5357,5356,5359,7393,-7393,5355,7374,7373,-5360,5359,7373,8051,-7394,5354,5356,5360,-5358,5357,5360,7387,-7387,5356,7392,7391,-5361,5360,7391,\n\t\t                    8057,-7388,5361,5364,5365,-5363,5362,5365,7376,-7378,5364,7371,7372,-5366,5365,7372,8055,-7377,5361,5362,5366,-5364,5363,5366,7381,-7381,5362,7377,7378,-5367,5366,7378,\n\t\t                    8056,-7382,5361,5363,5367,-5365,5364,5367,7370,-7372,5363,7380,7379,-5368,5367,7379,8053,-7371,5368,5371,5372,-5370,5369,5372,7382,-7384,5371,7365,7366,-5373,5372,7366,\n\t\t                    8053,-7383,5368,5369,5373,-5371,5370,5373,7369,-7369,5369,7383,7384,-5374,5373,7384,8054,-7370,5368,5370,5374,-5372,5371,5374,7364,-7366,5370,7368,7367,-5375,5374,7367,\n\t\t                    8049,-7365,5375,5378,5379,-5377,5376,5379,7391,-7393,5378,7389,7390,-5380,5379,7390,8057,-7392,5375,5376,5380,-5378,5377,5380,7355,-7357,5376,7392,7393,-5381,5380,7393,\n\t\t                    8051,-7356,5375,5377,5381,-5379,5378,5381,7388,-7390,5377,7356,7357,-5382,5381,7357,8052,-7389,5382,5385,5386,-5384,5383,5386,7396,-7396,5385,7407,7406,-5387,5386,7406,\n\t\t                    8058,-7397,5382,5383,5387,-5385,5384,5387,7414,-7414,5383,7395,7394,-5388,5387,7394,8056,-7415,5382,5384,5388,-5386,5385,5388,7408,-7408,5384,7413,7412,-5389,5388,7412,\n\t\t                    8060,-7409,5389,5392,5393,-5391,5390,5393,7409,-7411,5392,7386,7387,-5394,5393,7387,8057,-7410,5389,5390,5394,-5392,5391,5394,7405,-7405,5390,7410,7411,-5395,5394,7411,\n\t\t                    8060,-7406,5389,5391,5395,-5393,5392,5395,7385,-7387,5391,7404,7403,-5396,5395,7403,8055,-7386,5396,5399,5400,-5398,5397,5400,7412,-7414,5399,7404,7405,-5401,5400,7405,\n\t\t                    8060,-7413,5396,5397,5401,-5399,5398,5401,7378,-7378,5397,7413,7414,-5402,5401,7414,8056,-7379,5396,5398,5402,-5400,5399,5402,7403,-7405,5398,7377,7376,-5403,5402,7376,\n\t\t                    8055,-7404,5403,5406,5407,-5405,5404,5407,7421,-7423,5406,7419,7420,-5408,5407,7420,8061,-7422,5403,5404,5408,-5406,5405,5408,7406,-7408,5404,7422,7423,-5409,5408,7423,\n\t\t                    8058,-7407,5403,5405,5409,-5407,5406,5409,7418,-7420,5405,7407,7408,-5410,5409,7408,8060,-7419,5410,5413,5414,-5412,5411,5414,7399,-7399,5413,7416,7415,-5415,5414,7415,\n\t\t                    8059,-7400,5410,5411,5415,-5413,5412,5415,7423,-7423,5411,7398,7397,-5416,5415,7397,8058,-7424,5410,5412,5416,-5414,5413,5416,7417,-7417,5412,7422,7421,-5417,5416,7421,\n\t\t                    8061,-7418,5417,5420,5421,-5419,5418,5421,7415,-7417,5420,7401,7402,-5422,5421,7402,8059,-7416,5417,5418,5422,-5420,5419,5422,7426,-7426,5418,7416,7417,-5423,5422,7417,\n\t\t                    8061,-7427,5417,5419,5423,-5421,5420,5423,7400,-7402,5419,7425,7424,-5424,5423,7424,8054,-7401,5424,5428,5429,-5426,5425,5429,7328,-7330,5428,7428,7427,-5430,5429,7427,\n\t\t                    8050,-7329,5424,5425,5430,-5427,5426,5430,7367,-7369,5425,7329,7330,-5431,5430,7330,8049,-7368,5424,5426,5431,-5428,5427,5431,7430,-7432,5426,7368,7369,-5432,5431,7369,\n\t\t                    8054,-7431,5424,5427,5432,-5429,5428,5432,7429,-7429,5427,7431,7432,-5433,5432,7432,8062,-7430,5433,5436,5437,-5435,5434,5437,7433,-7435,5436,7425,7426,-5438,5437,7426,\n\t\t                    8061,-7434,5433,5434,5438,-5436,5435,5438,7432,-7432,5434,7434,7435,-5439,5438,7435,8062,-7433,5433,5435,5439,-5437,5436,5439,7424,-7426,5435,7431,7430,-5440,5439,7430,\n\t\t                    8054,-7425,5440,5443,5444,-5442,5441,5444,7435,-7435,5443,7437,7436,-5445,5444,7436,8062,-7436,5440,5441,5445,-5443,5442,5445,7439,-7441,5441,7434,7433,-5446,5445,7433,\n\t\t                    8061,-7440,5440,5442,5446,-5444,5443,5446,7438,-7438,5442,7440,7441,-5447,5446,7441,8064,-7439,5447,5450,5451,-5449,5448,5451,7420,-7420,5450,7440,7439,-5452,5451,7439,\n\t\t                    8061,-7421,5447,5448,5452,-5450,5449,5452,7442,-7444,5448,7419,7418,-5453,5452,7418,8060,-7443,5447,5449,5453,-5451,5450,5453,7441,-7441,5449,7443,7444,-5454,5453,7444,\n\t\t                    8064,-7442,5454,5457,5458,-5456,5455,5458,7411,-7411,5457,7443,7442,-5459,5458,7442,8060,-7412,5454,5455,5459,-5457,5456,5459,7445,-7447,5455,7410,7409,-5460,5459,7409,\n\t\t                    8057,-7446,5454,5456,5460,-5458,5457,5460,7444,-7444,5456,7446,7447,-5461,5460,7447,8064,-7445,5461,5465,5466,-5463,5462,5466,7462,-7462,5465,7446,7445,-5467,5466,7445,\n\t\t                    8057,-7463,5461,5462,5467,-5464,5463,5467,7457,-7459,5462,7461,7460,-5468,5467,7460,8067,-7458,5461,5463,5468,-5465,5464,5468,7465,-7465,5463,7458,7459,-5469,5468,7459,\n\t\t                    8069,-7466,5461,5464,5469,-5466,5465,5469,7447,-7447,5464,7464,7463,-5470,5469,7463,8064,-7448,5470,5474,5475,-5472,5471,5475,7463,-7465,5474,7437,7438,-5476,5475,7438,\n\t\t                    8064,-7464,5470,5471,5476,-5473,5472,5476,7456,-7456,5471,7464,7465,-5477,5476,7465,8069,-7457,5470,5472,5477,-5474,5473,5477,7468,-7468,5472,7455,7454,-5478,5477,7454,\n\t\t                    8068,-7469,5470,5473,5478,-5475,5474,5478,7436,-7438,5473,7467,7466,-5479,5478,7466,8062,-7437,5479,5483,5484,-5481,5480,5484,7466,-7468,5483,7428,7429,-5485,5484,7429,\n\t\t                    8062,-7467,5479,5480,5485,-5482,5481,5485,7453,-7453,5480,7467,7468,-5486,5485,7468,8068,-7454,5479,5481,5486,-5483,5482,5486,7471,-7471,5481,7452,7451,-5487,5486,7451,\n\t\t                    8066,-7472,5479,5482,5487,-5484,5483,5487,7427,-7429,5482,7470,7469,-5488,5487,7469,8050,-7428,5488,5492,5493,-5490,5489,5493,7469,-7471,5492,7332,7331,-5494,5493,7331,\n\t\t                    8050,-7470,5488,5489,5494,-5491,5490,5494,7448,-7450,5489,7470,7471,-5495,5494,7471,8066,-7449,5488,5490,5495,-5492,5491,5495,6601,-6601,5490,7449,7450,-5496,5495,7450,\n\t\t                    8065,-6602,5488,5491,5496,-5493,5492,5496,7333,-7333,5491,6600,6599,-5497,5496,6599,8045,-7334,5497,5500,5501,-5499,5498,5501,7390,-7390,5500,7461,7462,-5502,5501,7462,\n\t\t                    8057,-7391,5497,5498,5502,-5500,5499,5502,7472,-7474,5498,7389,7388,-5503,5502,7388,8052,-7473,5497,5499,5503,-5501,5500,5503,7460,-7462,5499,7473,7474,-5504,5503,7474,\n\t\t                    8067,-7461,5504,5508,5509,-5506,5505,5509,7486,-7486,5508,7458,7457,-5510,5509,7457,8067,-7487,5504,5505,5510,-5507,5506,5510,7481,-7483,5505,7485,7484,-5511,5510,7484,\n\t\t                    8071,-7482,5504,5506,5511,-5508,5507,5511,7489,-7489,5506,7482,7483,-5512,5511,7483,8073,-7490,5504,5507,5512,-5509,5508,5512,7459,-7459,5507,7488,7487,-5513,5512,7487,\n\t\t                    8069,-7460,5513,5516,5517,-5515,5514,5517,7492,-7492,5516,6558,6557,-5518,5517,6557,8072,-7493,5513,5514,5518,-5516,5515,5518,7477,-7477,5514,7491,7490,-5519,5518,7490,\n\t\t                    8068,-7478,5513,5515,5519,-5517,5516,5519,6559,-6559,5515,7476,7475,-5520,5519,7475,8063,-6560,5520,5524,5525,-5522,5521,5525,7490,-7492,5524,7452,7453,-5526,5525,7453,\n\t\t                    8068,-7491,5520,5521,5526,-5523,5522,5526,6610,-6610,5521,7491,7492,-5527,5526,7492,8072,-6611,5520,5522,5527,-5524,5523,5527,7495,-7495,5522,6609,6608,-5528,5527,6608,\n\t\t                    8070,-7496,5520,5523,5528,-5525,5524,5528,7451,-7453,5523,7494,7493,-5529,5528,7493,8066,-7452,5529,5532,5533,-5531,5530,5533,7474,-7474,5532,7485,7486,-5534,5533,7486,\n\t\t                    8067,-7475,5529,5530,5534,-5532,5531,5534,7478,-7480,5530,7473,7472,-5535,5534,7472,8052,-7479,5529,5531,5535,-5533,5532,5535,7484,-7486,5531,7479,7480,-5536,5535,7480,\n\t\t                    8071,-7485,5536,5539,5540,-5538,5537,5540,7493,-7495,5539,7449,7448,-5541,5540,7448,8066,-7494,5536,5537,5541,-5539,5538,5541,6632,-6634,5537,7494,7495,-5542,5541,7495,\n\t\t                    8070,-6633,5536,5538,5542,-5540,5539,5542,7450,-7450,5538,6633,6634,-5543,5542,6634,8065,-7451,5543,5547,5548,-5545,5544,5548,7475,-7477,5547,7497,7496,-5549,5548,7496,\n\t\t                    8063,-7476,5543,5544,5549,-5546,5545,5549,7454,-7456,5544,7476,7477,-5550,5549,7477,8068,-7455,5543,5545,5550,-5547,5546,5550,7487,-7489,5545,7455,7456,-5551,5550,7456,\n\t\t                    8069,-7488,5543,5546,5551,-5548,5547,5551,7498,-7498,5546,7488,7489,-5552,5551,7489,8073,-7499,5552,5556,5557,-5554,5553,5557,7516,-7516,5556,7401,7400,-5558,5557,7400,\n\t\t                    8054,-7517,5552,5553,5558,-5555,5554,5558,7511,-7513,5553,7515,7514,-5559,5558,7514,8075,-7512,5552,5554,5559,-5556,5555,5559,7519,-7519,5554,7512,7513,-5560,5559,7513,\n\t\t                    8078,-7520,5552,5555,5560,-5557,5556,5560,7402,-7402,5555,7518,7517,-5561,5560,7517,8059,-7403,5561,5565,5566,-5563,5562,5566,7517,-7519,5565,7398,7399,-5567,5566,7399,\n\t\t                    8059,-7518,5561,5562,5567,-5564,5563,5567,7510,-7510,5562,7518,7519,-5568,5567,7519,8078,-7511,5561,5563,5568,-5565,5564,5568,7522,-7522,5563,7509,7508,-5569,5568,7508,\n\t\t                    8077,-7523,5561,5564,5569,-5566,5565,5569,7397,-7399,5564,7521,7520,-5570,5569,7520,8058,-7398,5570,5574,5575,-5572,5571,5575,7520,-7522,5574,7395,7396,-5576,5575,7396,\n\t\t                    8058,-7521,5570,5571,5576,-5573,5572,5576,7507,-7507,5571,7521,7522,-5577,5576,7522,8077,-7508,5570,5572,5577,-5574,5573,5577,7525,-7525,5572,7506,7505,-5578,5577,7505,\n\t\t                    8076,-7526,5570,5573,5578,-5575,5574,5578,7394,-7396,5573,7524,7523,-5579,5578,7523,8056,-7395,5579,5583,5584,-5581,5580,5584,7528,-7528,5583,7383,7382,-5585,5584,7382,\n\t\t                    8053,-7529,5579,5580,5585,-5582,5581,5585,7502,-7504,5580,7527,7526,-5586,5585,7526,8074,-7503,5579,5581,5586,-5583,5582,5586,7514,-7516,5581,7503,7504,-5587,5586,7504,\n\t\t                    8075,-7515,5579,5582,5587,-5584,5583,5587,7384,-7384,5582,7515,7516,-5588,5587,7516,8054,-7385,5588,5592,5593,-5590,5589,5593,7523,-7525,5592,7380,7381,-5594,5593,7381,\n\t\t                    8056,-7524,5588,5589,5594,-5591,5590,5594,7501,-7501,5589,7524,7525,-5595,5594,7525,8076,-7502,5588,5590,5595,-5592,5591,5595,7526,-7528,5590,7500,7499,-5596,5595,7499,\n\t\t                    8074,-7527,5588,5591,5596,-5593,5592,5596,7379,-7381,5591,7527,7528,-5597,5596,7528,8053,-7380,5597,5601,5602,-5599,5598,5602,7505,-7507,5601,7545,7544,-5603,5602,7544,\n\t\t                    8076,-7506,5597,5598,5603,-5600,5599,5603,7549,-7549,5598,7506,7507,-5604,5603,7507,8077,-7550,5597,5599,5604,-5601,5600,5604,7535,-7537,5599,7548,7547,-5605,5604,7547,\n\t\t                    8082,-7536,5597,5600,5605,-5602,5601,5605,7546,-7546,5600,7536,7537,-5606,5605,7537,8081,-7547,5606,5610,5611,-5608,5607,5611,7508,-7510,5610,7548,7549,-5612,5611,7549,\n\t\t                    8077,-7509,5606,5607,5612,-5609,5608,5612,7552,-7552,5607,7509,7510,-5613,5612,7510,8078,-7553,5606,5608,5613,-5610,5609,5613,7538,-7540,5608,7551,7550,-5614,5613,7550,\n\t\t                    8083,-7539,5606,5609,5614,-5611,5610,5614,7547,-7549,5609,7539,7540,-5615,5614,7540,8082,-7548,5615,5619,5620,-5617,5616,5620,7513,-7513,5619,7551,7552,-5621,5620,7552,\n\t\t                    8078,-7514,5615,5616,5621,-5618,5617,5621,7555,-7555,5616,7512,7511,-5622,5621,7511,8075,-7556,5615,5617,5622,-5619,5618,5622,7541,-7543,5617,7554,7553,-5623,5622,7553,\n\t\t                    8079,-7542,5615,5618,5623,-5620,5619,5623,7550,-7552,5618,7542,7543,-5624,5623,7543,8083,-7551,5624,5628,5629,-5626,5625,5629,7504,-7504,5628,7554,7555,-5630,5629,7555,\n\t\t                    8075,-7505,5624,5625,5630,-5627,5626,5630,7558,-7558,5625,7503,7502,-5631,5630,7502,8074,-7559,5624,5626,5631,-5628,5627,5631,7529,-7531,5626,7557,7556,-5632,5631,7556,\n\t\t                    8080,-7530,5624,5627,5632,-5629,5628,5632,7553,-7555,5627,7530,7531,-5633,5632,7531,8079,-7554,5633,5637,5638,-5635,5634,5638,7499,-7501,5637,7557,7558,-5639,5638,7558,\n\t\t                    8074,-7500,5633,5634,5639,-5636,5635,5639,7544,-7546,5634,7500,7501,-5640,5639,7501,8076,-7545,5633,5635,5640,-5637,5636,5640,7532,-7534,5635,7545,7546,-5641,5640,7546,\n\t\t                    8081,-7533,5633,5636,5641,-5638,5637,5641,7556,-7558,5636,7533,7534,-5642,5641,7534,8080,-7557,5642,5646,5647,-5644,5643,5647,7576,-7576,5646,7542,7541,-5648,5647,7541,\n\t\t                    8079,-7577,5642,5643,5648,-5645,5644,5648,7571,-7573,5643,7575,7574,-5649,5648,7574,8084,-7572,5642,5644,5649,-5646,5645,5649,7579,-7579,5644,7572,7573,-5650,5649,7573,\n\t\t                    8088,-7580,5642,5645,5650,-5647,5646,5650,7543,-7543,5645,7578,7577,-5651,5650,7577,8083,-7544,5651,5655,5656,-5653,5652,5656,7577,-7579,5655,7539,7538,-5657,5656,7538,\n\t\t                    8083,-7578,5651,5652,5657,-5654,5653,5657,7568,-7570,5652,7578,7579,-5658,5657,7579,8088,-7569,5651,5653,5658,-5655,5654,5658,7582,-7582,5653,7569,7570,-5659,5658,7570,\n\t\t                    8087,-7583,5651,5654,5659,-5656,5655,5659,7540,-7540,5654,7581,7580,-5660,5659,7580,8082,-7541,5660,5664,5665,-5662,5661,5665,7580,-7582,5664,7536,7535,-5666,5665,7535,\n\t\t                    8082,-7581,5660,5661,5666,-5663,5662,5666,7565,-7567,5661,7581,7582,-5667,5666,7582,8087,-7566,5660,5662,5667,-5664,5663,5667,7585,-7585,5662,7566,7567,-5668,5667,7567,\n\t\t                    8086,-7586,5660,5663,5668,-5665,5664,5668,7537,-7537,5663,7584,7583,-5669,5668,7583,8081,-7538,5669,5673,5674,-5671,5670,5674,7583,-7585,5673,7533,7532,-5675,5674,7532,\n\t\t                    8081,-7584,5669,5670,5675,-5672,5671,5675,7562,-7564,5670,7584,7585,-5676,5675,7585,8086,-7563,5669,5671,5676,-5673,5672,5676,7588,-7588,5671,7563,7564,-5677,5676,7564,\n\t\t                    8085,-7589,5669,5672,5677,-5674,5673,5677,7534,-7534,5672,7587,7586,-5678,5677,7586,8080,-7535,5678,5682,5683,-5680,5679,5683,7586,-7588,5682,7530,7529,-5684,5683,7529,\n\t\t                    8080,-7587,5678,5679,5684,-5681,5680,5684,7559,-7561,5679,7587,7588,-5685,5684,7588,8085,-7560,5678,5680,5685,-5682,5681,5685,7574,-7576,5680,7560,7561,-5686,5685,7561,\n\t\t                    8084,-7575,5678,5681,5686,-5683,5682,5686,7531,-7531,5681,7575,7576,-5687,5686,7576,8079,-7532,5687,5691,5692,-5689,5688,5692,7606,-7606,5691,7572,7571,-5693,5692,7571,\n\t\t                    8084,-7607,5687,5688,5693,-5690,5689,5693,7601,-7603,5688,7605,7604,-5694,5693,7604,8089,-7602,5687,5689,5694,-5691,5690,5694,7609,-7609,5689,7602,7603,-5695,5694,7603,\n\t\t                    8093,-7610,5687,5690,5695,-5692,5691,5695,7573,-7573,5690,7608,7607,-5696,5695,7607,8088,-7574,5696,5700,5701,-5698,5697,5701,7607,-7609,5700,7569,7568,-5702,5701,7568,\n\t\t                    8088,-7608,5696,5697,5702,-5699,5698,5702,7598,-7600,5697,7608,7609,-5703,5702,7609,8093,-7599,5696,5698,5703,-5700,5699,5703,7612,-7612,5698,7599,7600,-5704,5703,7600,\n\t\t                    8092,-7613,5696,5699,5704,-5701,5700,5704,7570,-7570,5699,7611,7610,-5705,5704,7610,8087,-7571,5705,5709,5710,-5707,5706,5710,7610,-7612,5709,7566,7565,-5711,5710,7565,\n\t\t                    8087,-7611,5705,5706,5711,-5708,5707,5711,7595,-7597,5706,7611,7612,-5712,5711,7612,8092,-7596,5705,5707,5712,-5709,5708,5712,7615,-7615,5707,7596,7597,-5713,5712,7597,\n\t\t                    8091,-7616,5705,5708,5713,-5710,5709,5713,7567,-7567,5708,7614,7613,-5714,5713,7613,8086,-7568,5714,5718,5719,-5716,5715,5719,7613,-7615,5718,7563,7562,-5720,5719,7562,\n\t\t                    8086,-7614,5714,5715,5720,-5717,5716,5720,7592,-7594,5715,7614,7615,-5721,5720,7615,8091,-7593,5714,5716,5721,-5718,5717,5721,7618,-7618,5716,7593,7594,-5722,5721,7594,\n\t\t                    8090,-7619,5714,5717,5722,-5719,5718,5722,7564,-7564,5717,7617,7616,-5723,5722,7616,8085,-7565,5723,5727,5728,-5725,5724,5728,7616,-7618,5727,7560,7559,-5729,5728,7559,\n\t\t                    8085,-7617,5723,5724,5729,-5726,5725,5729,7589,-7591,5724,7617,7618,-5730,5729,7618,8090,-7590,5723,5725,5730,-5727,5726,5730,7604,-7606,5725,7590,7591,-5731,5730,7591,\n\t\t                    8089,-7605,5723,5726,5731,-5728,5727,5731,7561,-7561,5726,7605,7606,-5732,5731,7606,8084,-7562,5732,5736,5737,-5734,5733,5737,7636,-7636,5736,7602,7601,-5738,5737,7601,\n\t\t                    8089,-7637,5732,5733,5738,-5735,5734,5738,7631,-7633,5733,7635,7634,-5739,5738,7634,8094,-7632,5732,5734,5739,-5736,5735,5739,7639,-7639,5734,7632,7633,-5740,5739,7633,\n\t\t                    8098,-7640,5732,5735,5740,-5737,5736,5740,7603,-7603,5735,7638,7637,-5741,5740,7637,8093,-7604,5741,5745,5746,-5743,5742,5746,7637,-7639,5745,7599,7598,-5747,5746,7598,\n\t\t                    8093,-7638,5741,5742,5747,-5744,5743,5747,7628,-7630,5742,7638,7639,-5748,5747,7639,8098,-7629,5741,5743,5748,-5745,5744,5748,7642,-7642,5743,7629,7630,-5749,5748,7630,\n\t\t                    8097,-7643,5741,5744,5749,-5746,5745,5749,7600,-7600,5744,7641,7640,-5750,5749,7640,8092,-7601,5750,5754,5755,-5752,5751,5755,7640,-7642,5754,7596,7595,-5756,5755,7595,\n\t\t                    8092,-7641,5750,5751,5756,-5753,5752,5756,7625,-7627,5751,7641,7642,-5757,5756,7642,8097,-7626,5750,5752,5757,-5754,5753,5757,7645,-7645,5752,7626,7627,-5758,5757,7627,\n\t\t                    8096,-7646,5750,5753,5758,-5755,5754,5758,7597,-7597,5753,7644,7643,-5759,5758,7643,8091,-7598,5759,5763,5764,-5761,5760,5764,7643,-7645,5763,7593,7592,-5765,5764,7592,\n\t\t                    8091,-7644,5759,5760,5765,-5762,5761,5765,7622,-7624,5760,7644,7645,-5766,5765,7645,8096,-7623,5759,5761,5766,-5763,5762,5766,7648,-7648,5761,7623,7624,-5767,5766,7624,\n\t\t                    8095,-7649,5759,5762,5767,-5764,5763,5767,7594,-7594,5762,7647,7646,-5768,5767,7646,8090,-7595,5768,5772,5773,-5770,5769,5773,7646,-7648,5772,7590,7589,-5774,5773,7589,\n\t\t                    8090,-7647,5768,5769,5774,-5771,5770,5774,7619,-7621,5769,7647,7648,-5775,5774,7648,8095,-7620,5768,5770,5775,-5772,5771,5775,7634,-7636,5770,7620,7621,-5776,5775,7621,\n\t\t                    8094,-7635,5768,5771,5776,-5773,5772,5776,7591,-7591,5771,7635,7636,-5777,5776,7636,8089,-7592,5777,5781,5782,-5779,5778,5782,7666,-7666,5781,7632,7631,-5783,5782,7631,\n\t\t                    8094,-7667,5777,5778,5783,-5780,5779,5783,7661,-7663,5778,7665,7664,-5784,5783,7664,8099,-7662,5777,5779,5784,-5781,5780,5784,7669,-7669,5779,7662,7663,-5785,5784,7663,\n\t\t                    8103,-7670,5777,5780,5785,-5782,5781,5785,7633,-7633,5780,7668,7667,-5786,5785,7667,8098,-7634,5786,5790,5791,-5788,5787,5791,7667,-7669,5790,7629,7628,-5792,5791,7628,\n\t\t                    8098,-7668,5786,5787,5792,-5789,5788,5792,7658,-7660,5787,7668,7669,-5793,5792,7669,8103,-7659,5786,5788,5793,-5790,5789,5793,7672,-7672,5788,7659,7660,-5794,5793,7660,\n\t\t                    8102,-7673,5786,5789,5794,-5791,5790,5794,7630,-7630,5789,7671,7670,-5795,5794,7670,8097,-7631,5795,5799,5800,-5797,5796,5800,7670,-7672,5799,7626,7625,-5801,5800,7625,\n\t\t                    8097,-7671,5795,5796,5801,-5798,5797,5801,7655,-7657,5796,7671,7672,-5802,5801,7672,8102,-7656,5795,5797,5802,-5799,5798,5802,7675,-7675,5797,7656,7657,-5803,5802,7657,\n\t\t                    8101,-7676,5795,5798,5803,-5800,5799,5803,7627,-7627,5798,7674,7673,-5804,5803,7673,8096,-7628,5804,5808,5809,-5806,5805,5809,7673,-7675,5808,7623,7622,-5810,5809,7622,\n\t\t                    8096,-7674,5804,5805,5810,-5807,5806,5810,7652,-7654,5805,7674,7675,-5811,5810,7675,8101,-7653,5804,5806,5811,-5808,5807,5811,7678,-7678,5806,7653,7654,-5812,5811,7654,\n\t\t                    8100,-7679,5804,5807,5812,-5809,5808,5812,7624,-7624,5807,7677,7676,-5813,5812,7676,8095,-7625,5813,5817,5818,-5815,5814,5818,7676,-7678,5817,7620,7619,-5819,5818,7619,\n\t\t                    8095,-7677,5813,5814,5819,-5816,5815,5819,7649,-7651,5814,7677,7678,-5820,5819,7678,8100,-7650,5813,5815,5820,-5817,5816,5820,7664,-7666,5815,7650,7651,-5821,5820,7651,\n\t\t                    8099,-7665,5813,5816,5821,-5818,5817,5821,7621,-7621,5816,7665,7666,-5822,5821,7666,8094,-7622,5822,5826,5827,-5824,5823,5827,7696,-7696,5826,7662,7661,-5828,5827,7661,\n\t\t                    8099,-7697,5822,5823,5828,-5825,5824,5828,7691,-7693,5823,7695,7694,-5829,5828,7694,8104,-7692,5822,5824,5829,-5826,5825,5829,7699,-7699,5824,7692,7693,-5830,5829,7693,\n\t\t                    8108,-7700,5822,5825,5830,-5827,5826,5830,7663,-7663,5825,7698,7697,-5831,5830,7697,8103,-7664,5831,5835,5836,-5833,5832,5836,7697,-7699,5835,7659,7658,-5837,5836,7658,\n\t\t                    8103,-7698,5831,5832,5837,-5834,5833,5837,7688,-7690,5832,7698,7699,-5838,5837,7699,8108,-7689,5831,5833,5838,-5835,5834,5838,7702,-7702,5833,7689,7690,-5839,5838,7690,\n\t\t                    8107,-7703,5831,5834,5839,-5836,5835,5839,7660,-7660,5834,7701,7700,-5840,5839,7700,8102,-7661,5840,5844,5845,-5842,5841,5845,7700,-7702,5844,7656,7655,-5846,5845,7655,\n\t\t                    8102,-7701,5840,5841,5846,-5843,5842,5846,7685,-7687,5841,7701,7702,-5847,5846,7702,8107,-7686,5840,5842,5847,-5844,5843,5847,7705,-7705,5842,7686,7687,-5848,5847,7687,\n\t\t                    8106,-7706,5840,5843,5848,-5845,5844,5848,7657,-7657,5843,7704,7703,-5849,5848,7703,8101,-7658,5849,5853,5854,-5851,5850,5854,7703,-7705,5853,7653,7652,-5855,5854,7652,\n\t\t                    8101,-7704,5849,5850,5855,-5852,5851,5855,7682,-7684,5850,7704,7705,-5856,5855,7705,8106,-7683,5849,5851,5856,-5853,5852,5856,7708,-7708,5851,7683,7684,-5857,5856,7684,\n\t\t                    8105,-7709,5849,5852,5857,-5854,5853,5857,7654,-7654,5852,7707,7706,-5858,5857,7706,8100,-7655,5858,5862,5863,-5860,5859,5863,7706,-7708,5862,7650,7649,-5864,5863,7649,\n\t\t                    8100,-7707,5858,5859,5864,-5861,5860,5864,7679,-7681,5859,7707,7708,-5865,5864,7708,8105,-7680,5858,5860,5865,-5862,5861,5865,7694,-7696,5860,7680,7681,-5866,5865,7681,\n\t\t                    8104,-7695,5858,5861,5866,-5863,5862,5866,7651,-7651,5861,7695,7696,-5867,5866,7696,8099,-7652,5867,5871,5872,-5869,5868,5872,7726,-7726,5871,7692,7691,-5873,5872,7691,\n\t\t                    8104,-7727,5867,5868,5873,-5870,5869,5873,7721,-7723,5868,7725,7724,-5874,5873,7724,8109,-7722,5867,5869,5874,-5871,5870,5874,7729,-7729,5869,7722,7723,-5875,5874,7723,\n\t\t                    8113,-7730,5867,5870,5875,-5872,5871,5875,7693,-7693,5870,7728,7727,-5876,5875,7727,8108,-7694,5876,5880,5881,-5878,5877,5881,7727,-7729,5880,7689,7688,-5882,5881,7688,\n\t\t                    8108,-7728,5876,5877,5882,-5879,5878,5882,7718,-7720,5877,7728,7729,-5883,5882,7729,8113,-7719,5876,5878,5883,-5880,5879,5883,7732,-7732,5878,7719,7720,-5884,5883,7720,\n\t\t                    8112,-7733,5876,5879,5884,-5881,5880,5884,7690,-7690,5879,7731,7730,-5885,5884,7730,8107,-7691,5885,5889,5890,-5887,5886,5890,7730,-7732,5889,7686,7685,-5891,5890,7685,\n\t\t                    8107,-7731,5885,5886,5891,-5888,5887,5891,7715,-7717,5886,7731,7732,-5892,5891,7732,8112,-7716,5885,5887,5892,-5889,5888,5892,7735,-7735,5887,7716,7717,-5893,5892,7717,\n\t\t                    8111,-7736,5885,5888,5893,-5890,5889,5893,7687,-7687,5888,7734,7733,-5894,5893,7733,8106,-7688,5894,5898,5899,-5896,5895,5899,7733,-7735,5898,7683,7682,-5900,5899,7682,\n\t\t                    8106,-7734,5894,5895,5900,-5897,5896,5900,7712,-7714,5895,7734,7735,-5901,5900,7735,8111,-7713,5894,5896,5901,-5898,5897,5901,7738,-7738,5896,7713,7714,-5902,5901,7714,\n\t\t                    8110,-7739,5894,5897,5902,-5899,5898,5902,7684,-7684,5897,7737,7736,-5903,5902,7736,8105,-7685,5903,5907,5908,-5905,5904,5908,7736,-7738,5907,7680,7679,-5909,5908,7679,\n\t\t                    8105,-7737,5903,5904,5909,-5906,5905,5909,7709,-7711,5904,7737,7738,-5910,5909,7738,8110,-7710,5903,5905,5910,-5907,5906,5910,7724,-7726,5905,7710,7711,-5911,5910,7711,\n\t\t                    8109,-7725,5903,5906,5911,-5908,5907,5911,7681,-7681,5906,7725,7726,-5912,5911,7726,8104,-7682,5912,5916,5917,-5914,5913,5917,7309,-7309,5916,7005,7004,-5918,5917,7004,\n\t\t                    7988,-7310,5912,5913,5918,-5915,5914,5918,7753,-7753,5913,7308,7307,-5919,5918,7307,8114,-7754,5912,5914,5919,-5916,5915,5919,6878,-6880,5914,7752,7751,-5920,5919,7751,\n\t\t                    8115,-6879,5912,5915,5920,-5917,5916,5920,7006,-7006,5915,6879,6880,-5921,5920,6880,7983,-7007,5921,5925,5926,-5923,5922,5926,7001,-7003,5925,7308,7309,-5927,5926,7309,\n\t\t                    7988,-7002,5921,5922,5927,-5924,5923,5927,7744,-7744,5922,7002,7003,-5928,5927,7003,7987,-7745,5921,5923,5928,-5925,5924,5928,7756,-7756,5923,7743,7742,-5929,5928,7742,\n\t\t                    8116,-7757,5921,5924,5929,-5926,5925,5929,7307,-7309,5924,7755,7754,-5930,5929,7754,8114,-7308,5930,5934,5935,-5932,5931,5935,6998,-7000,5934,7743,7744,-5936,5935,7744,\n\t\t                    7987,-6999,5930,5931,5936,-5933,5932,5936,7747,-7747,5931,6999,7000,-5937,5936,7000,7986,-7748,5930,5932,5937,-5934,5933,5937,7759,-7759,5932,7746,7745,-5938,5937,7745,\n\t\t                    8117,-7760,5930,5933,5938,-5935,5934,5938,7742,-7744,5933,7758,7757,-5939,5938,7757,8116,-7743,5939,5943,5944,-5941,5940,5944,6995,-6997,5943,7746,7747,-5945,5944,7747,\n\t\t                    7986,-6996,5939,5940,5945,-5942,5941,5945,7750,-7750,5940,6996,6997,-5946,5945,6997,7985,-7751,5939,5941,5946,-5943,5942,5946,7762,-7762,5941,7749,7748,-5947,5946,7748,\n\t\t                    8118,-7763,5939,5942,5947,-5944,5943,5947,7745,-7747,5942,7761,7760,-5948,5947,7760,8117,-7746,5948,5952,5953,-5950,5949,5953,6992,-6994,5952,7749,7750,-5954,5953,7750,\n\t\t                    7985,-6993,5948,5949,5954,-5951,5950,5954,6892,-6892,5949,6993,6994,-5955,5954,6994,7984,-6893,5948,5950,5955,-5952,5951,5955,7765,-7765,5950,6891,6890,-5956,5955,6890,\n\t\t                    8119,-7766,5948,5951,5956,-5953,5952,5956,7748,-7750,5951,7764,7763,-5957,5956,7763,8118,-7749,5957,5961,5962,-5959,5958,5962,7789,-7789,5961,7276,7275,-5963,5962,7275,\n\t\t                    8034,-7790,5957,5958,5963,-5960,5959,5963,7784,-7786,5958,7788,7787,-5964,5963,7787,8122,-7785,5957,5959,5964,-5961,5960,5964,7792,-7792,5959,7785,7786,-5965,5964,7786,\n\t\t                    8126,-7793,5957,5960,5965,-5962,5961,5965,7277,-7277,5960,7791,7790,-5966,5965,7790,8038,-7278,5966,5970,5971,-5968,5967,5971,7790,-7792,5970,7273,7272,-5972,5971,7272,\n\t\t                    8038,-7791,5966,5967,5972,-5969,5968,5972,7781,-7783,5967,7791,7792,-5973,5972,7792,8126,-7782,5966,5968,5973,-5970,5969,5973,7795,-7795,5968,7782,7783,-5974,5973,7783,\n\t\t                    8121,-7796,5966,5969,5974,-5971,5970,5974,7274,-7274,5969,7794,7793,-5975,5974,7793,8033,-7275,5975,5979,5980,-5977,5976,5980,7798,-7798,5979,7270,7269,-5981,5980,7269,\n\t\t                    8035,-7799,5975,5976,5981,-5978,5977,5981,7778,-7780,5976,7797,7796,-5982,5981,7796,8123,-7779,5975,5977,5982,-5979,5978,5982,7801,-7801,5977,7779,7780,-5983,5982,7780,\n\t\t                    8125,-7802,5975,5978,5983,-5980,5979,5983,7271,-7271,5978,7800,7799,-5984,5983,7799,8037,-7272,5984,5988,5989,-5986,5985,5989,7799,-7801,5988,7267,7268,-5990,5989,7268,\n\t\t                    8037,-7800,5984,5985,5990,-5987,5986,5990,7777,-7777,5985,7800,7801,-5991,5990,7801,8125,-7778,5984,5986,5991,-5988,5987,5991,7787,-7789,5986,7776,7775,-5992,5991,7775,\n\t\t                    8122,-7788,5984,5987,5992,-5989,5988,5992,7266,-7268,5987,7788,7789,-5993,5992,7789,8034,-7267,5993,5997,5998,-5995,5994,5998,7804,-7804,5997,7264,7263,-5999,5998,7263,\n\t\t                    8032,-7805,5993,5994,5999,-5996,5995,5999,7772,-7774,5994,7803,7802,-6000,5999,7802,8120,-7773,5993,5995,6000,-5997,5996,6000,7807,-7807,5995,7773,7774,-6001,6000,7774,\n\t\t                    8124,-7808,5993,5996,6001,-5998,5997,6001,7265,-7265,5996,7806,7805,-6002,6001,7805,8036,-7266,6002,6006,6007,-6004,6003,6007,7793,-7795,6006,7261,7262,-6008,6007,7262,\n\t\t                    8033,-7794,6002,6003,6008,-6005,6004,6008,7771,-7771,6003,7794,7795,-6009,6008,7795,8121,-7772,6002,6004,6009,-6006,6005,6009,7802,-7804,6004,7770,7769,-6010,6009,7769,\n\t\t                    8120,-7803,6002,6005,6010,-6007,6006,6010,7260,-7262,6005,7803,7804,-6011,6010,7804,8032,-7261,6011,6015,6016,-6013,6012,6016,7805,-7807,6015,7258,7257,-6017,6016,7257,\n\t\t                    8036,-7806,6011,6012,6017,-6014,6013,6017,7766,-7768,6012,7806,7807,-6018,6017,7807,8124,-7767,6011,6013,6018,-6015,6014,6018,7796,-7798,6013,7767,7768,-6019,6018,7768,\n\t\t                    8123,-7797,6011,6014,6019,-6016,6015,6019,7259,-7259,6014,7797,7798,-6020,6019,7798,8035,-7260,6020,6024,6025,-6022,6021,6025,7831,-7831,6024,7785,7784,-6026,6025,7784,\n\t\t                    8122,-7832,6020,6021,6026,-6023,6022,6026,7826,-7828,6021,7830,7829,-6027,6026,7829,8129,-7827,6020,6022,6027,-6024,6023,6027,7834,-7834,6022,7827,7828,-6028,6027,7828,\n\t\t                    8133,-7835,6020,6023,6028,-6025,6024,6028,7786,-7786,6023,7833,7832,-6029,6028,7832,8126,-7787,6029,6033,6034,-6031,6030,6034,7832,-7834,6033,7782,7781,-6035,6034,7781,\n\t\t                    8126,-7833,6029,6030,6035,-6032,6031,6035,7823,-7825,6030,7833,7834,-6036,6035,7834,8133,-7824,6029,6031,6036,-6033,6032,6036,7837,-7837,6031,7824,7825,-6037,6036,7825,\n\t\t                    8128,-7838,6029,6032,6037,-6034,6033,6037,7783,-7783,6032,7836,7835,-6038,6037,7835,8121,-7784,6038,6042,6043,-6040,6039,6043,7840,-7840,6042,7779,7778,-6044,6043,7778,\n\t\t                    8123,-7841,6038,6039,6044,-6041,6040,6044,7820,-7822,6039,7839,7838,-6045,6044,7838,8130,-7821,6038,6040,6045,-6042,6041,6045,7843,-7843,6040,7821,7822,-6046,6045,7822,\n\t\t                    8132,-7844,6038,6041,6046,-6043,6042,6046,7780,-7780,6041,7842,7841,-6047,6046,7841,8125,-7781,6047,6051,6052,-6049,6048,6052,7841,-7843,6051,7776,7777,-6053,6052,7777,\n\t\t                    8125,-7842,6047,6048,6053,-6050,6049,6053,7819,-7819,6048,7842,7843,-6054,6053,7843,8132,-7820,6047,6049,6054,-6051,6050,6054,7829,-7831,6049,7818,7817,-6055,6054,7817,\n\t\t                    8129,-7830,6047,6050,6055,-6052,6051,6055,7775,-7777,6050,7830,7831,-6056,6055,7831,8122,-7776,6056,6060,6061,-6058,6057,6061,7846,-7846,6060,7773,7772,-6062,6061,7772,\n\t\t                    8120,-7847,6056,6057,6062,-6059,6058,6062,7814,-7816,6057,7845,7844,-6063,6062,7844,8127,-7815,6056,6058,6063,-6060,6059,6063,7849,-7849,6058,7815,7816,-6064,6063,7816,\n\t\t                    8131,-7850,6056,6059,6064,-6061,6060,6064,7774,-7774,6059,7848,7847,-6065,6064,7847,8124,-7775,6065,6069,6070,-6067,6066,6070,7835,-7837,6069,7770,7771,-6071,6070,7771,\n\t\t                    8121,-7836,6065,6066,6071,-6068,6067,6071,7813,-7813,6066,7836,7837,-6072,6071,7837,8128,-7814,6065,6067,6072,-6069,6068,6072,7844,-7846,6067,7812,7811,-6073,6072,7811,\n\t\t                    8127,-7845,6065,6068,6073,-6070,6069,6073,7769,-7771,6068,7845,7846,-6074,6073,7846,8120,-7770,6074,6078,6079,-6076,6075,6079,7847,-7849,6078,7767,7766,-6080,6079,7766,\n\t\t                    8124,-7848,6074,6075,6080,-6077,6076,6080,7808,-7810,6075,7848,7849,-6081,6080,7849,8131,-7809,6074,6076,6081,-6078,6077,6081,7838,-7840,6076,7809,7810,-6082,6081,7810,\n\t\t                    8130,-7839,6074,6077,6082,-6079,6078,6082,7768,-7768,6077,7839,7840,-6083,6082,7840,8123,-7769,8134,8404,8806,-8406,8134,8405,8817,-8383,8134,8382,8819,-8405,8135,8396,\n\t\t                    8813,-8387,8135,8386,8814,-8381,8135,8380,8807,-8396,8135,8395,8808,-8397,8136,8415,8813,-8397,8136,8396,8808,-8380,8136,8379,8804,-8416,8137,8390,8820,-8400,8137,8399,\n\t\t                    8810,-8403,8137,8402,8811,-8391,8138,8398,8819,-8442,8138,8441,8832,-8382,8138,8381,8812,-8377,8138,8376,8809,-8399,8139,8393,8810,-8400,8139,8399,8820,-8402,8139,8401,\n\t\t                    8805,-8394,8140,8391,8816,-8379,8140,8378,8811,-8398,8140,8397,8818,-8392,8141,8348,8848,-8407,8141,8406,8818,-8385,8141,8384,8810,-8408,8141,8407,8846,-8349,8142,8398,\n\t\t                    8809,-8390,8142,8389,8806,-8405,8142,8404,8819,-8399,8143,8401,8820,-8378,8143,8377,8817,-8404,8143,8403,8805,-8402,8144,8397,8811,-8403,8144,8402,8810,-8385,8144,8384,\n\t\t                    8818,-8398,8145,8369,8870,-8401,8145,8400,8816,-8392,8145,8391,8818,-8407,8145,8406,8848,-8370,8146,8403,8817,-8406,8146,8405,8806,-8384,8146,8383,8805,-8404,8147,8374,\n\t\t                    8846,-8408,8147,8407,8810,-8394,8147,8393,8805,-8409,8147,8408,8875,-8375,8148,8375,8875,-8409,8148,8408,8805,-8384,8148,8383,8806,-8410,8148,8409,8876,-8376,8149,8349,\n\t\t                    8876,-8410,8149,8409,8806,-8390,8149,8389,8809,-8411,8149,8410,8847,-8350,8150,8347,8874,-8412,8150,8411,8815,-8389,8150,8388,8804,-8413,8150,8412,8845,-8348,8151,8372,\n\t\t                    8845,-8413,8151,8412,8804,-8380,8151,8379,8808,-8414,8151,8413,8873,-8373,8152,8346,8873,-8414,8152,8413,8808,-8396,8152,8395,8807,-8415,8152,8414,8849,-8347,8153,8370,\n\t\t                    8849,-8415,8153,8414,8807,-8381,8153,8380,8814,-8388,8153,8387,8871,-8371,8154,8373,8847,-8411,8154,8410,8809,-8395,8154,8394,8815,-8412,8154,8411,8874,-8374,8155,8421,\n\t\t                    8813,-8418,8155,8417,8815,-8417,8155,8416,8812,-8386,8155,8385,8822,-8422,8156,8416,8815,-8395,8156,8394,8809,-8377,8156,8376,8812,-8417,8157,8417,8813,-8416,8157,8415,\n\t\t                    8804,-8389,8157,8388,8815,-8418,8158,8418,8816,-8401,8158,8400,8870,-8369,8158,8368,8869,-8419,8159,8420,8821,-8393,8159,8392,8811,-8379,8159,8378,8816,-8421,8160,8371,\n\t\t                    8850,-8424,8160,8423,8795,-8423,8160,8422,8824,-8425,8160,8424,8872,-8372,8161,8425,8851,-8352,8161,8351,8872,-8425,8161,8424,8824,-8354,8161,8353,8823,-8426,8992,9029,\n\t\t                    8767,-8725,8731,8774,9016,-8978,8162,8352,8851,-8426,8162,8425,8823,-8428,8162,8427,8796,-8355,8162,8354,8852,-8353,8163,8422,8795,-8431,8163,8430,8825,-8430,8163,8429,\n\t\t                    8827,-8432,8163,8431,8824,-8423,8164,8432,8823,-8354,8164,8353,8824,-8432,8164,8431,8827,-8429,8164,8428,8826,-8433,8165,8426,8980,-8696,8165,8695,8981,-8434,8165,8433,\n\t\t                    8825,-8431,8165,8430,8795,-8427,8271,8178,8449,-8610,8166,8588,8826,-8435,8167,8784,8819,-8383,8167,8382,8817,-8709,8167,8708,8998,-8736,8167,8735,8975,-8785,8168,8436,\n\t\t                    8827,-8430,8168,8429,8825,-8441,8168,8440,8831,-8440,8168,8439,8830,-8437,8169,8701,8983,-8706,8169,8705,8834,-8445,8169,8444,8831,-8705,8169,8704,8982,-8702,8170,8442,\n\t\t                    8830,-8440,8170,8439,8831,-8445,8170,8444,8834,-8444,8170,8443,8833,-8443,8171,8710,8984,-8707,8171,8706,8835,-8447,8171,8446,8834,-8706,8171,8705,8983,-8711,8172,8445,\n\t\t                    8829,-8439,8172,8438,8833,-8444,8172,8443,8834,-8447,8172,8446,8835,-8446,8173,8573,8985,-8708,8173,8707,8836,-8449,8173,8448,8835,-8707,8173,8706,8984,-8574,8174,8447,\n\t\t                    8798,-8438,8174,8437,8829,-8446,8174,8445,8835,-8449,8174,8448,8836,-8448,8270,8611,8454,-8176,8269,8610,8451,-8177,8175,8454,8839,-8456,8175,8455,8797,-8356,8268,8609,\n\t\t                    8449,-8178,8269,8176,8454,-8612,8176,8451,8838,-8457,8176,8456,8839,-8455,8268,8177,8451,-8611,8177,8449,8837,-8458,8177,8457,8838,-8452,8271,8613,8434,-8179,8270,8175,\n\t\t                    8355,-8613,8178,8434,8826,-8459,8178,8458,8837,-8450,8179,8428,8827,-8437,8179,8436,8830,-8451,8179,8450,8837,-8459,8179,8458,8826,-8429,8180,8442,8833,-8453,8180,8452,\n\t\t                    8838,-8458,8180,8457,8837,-8451,8180,8450,8830,-8443,8181,8438,8829,-8454,8181,8453,8839,-8457,8181,8456,8838,-8453,8181,8452,8833,-8439,8182,8437,8798,-8436,8182,8435,\n\t\t                    8797,-8456,8182,8455,8839,-8454,8182,8453,8829,-8438,8183,8711,8890,-8493,8183,8492,8892,-8784,8183,8783,9008,-8747,8183,8746,9007,-8712,8184,8419,8821,-8421,8184,8420,\n\t\t                    8816,-8419,8184,8418,8869,-8368,8184,8367,8868,-8420,8185,8709,8987,-8695,8185,8694,8989,-8465,8185,8464,8841,-8463,8185,8462,8840,-8710,8186,8720,8987,-8710,8186,8709,\n\t\t                    8840,-8466,8186,8465,8828,-8460,8186,8459,8986,-8721,8996,9032,8770,-8728,8724,8767,9028,-8992,8187,8467,8800,-8358,8187,8357,8799,-8462,8187,8461,8828,-8466,8187,8465,\n\t\t                    8840,-8468,8188,8462,8841,-8470,8188,8469,8842,-8469,8188,8468,8800,-8468,8188,8467,8840,-8463,8189,8470,8842,-8470,8189,8469,8841,-8472,8189,8471,8843,-8471,8190,8472,\n\t\t                    8963,-8684,8190,8683,8866,-8692,8190,8691,8867,-8473,8191,8475,8842,-8475,8191,8474,8802,-8360,8191,8359,8801,-8476,8192,8358,8800,-8469,8192,8468,8842,-8476,8192,8475,\n\t\t                    8801,-8359,8193,8474,8842,-8471,8193,8470,8843,-8474,8193,8473,8803,-8361,8193,8360,8802,-8475,8194,8466,8867,-8692,8194,8691,8866,-8477,8194,8476,8843,-8472,8194,8471,\n\t\t                    8841,-8467,8195,8515,8879,-8515,8195,8514,8892,-8493,8195,8492,8890,-8516,8196,8496,8886,-8507,8196,8506,8881,-8506,8196,8505,8880,-8491,8196,8490,8887,-8497,8197,8506,\n\t\t                    8886,-8526,8197,8525,8877,-8490,8197,8489,8881,-8507,8198,8509,8893,-8501,8198,8500,8884,-8513,8198,8512,8883,-8510,8199,8552,8892,-8509,8199,8508,8882,-8487,8199,8486,\n\t\t                    8885,-8492,8199,8491,8905,-8553,8200,8509,8883,-8504,8200,8503,8878,-8512,8200,8511,8893,-8510,8201,8488,8889,-8502,8201,8501,8891,-8508,8201,8507,8884,-8489,8202,8516,\n\t\t                    8848,-8349,8202,8348,8846,-8518,8202,8517,8883,-8495,8202,8494,8891,-8517,8203,8499,8882,-8509,8203,8508,8892,-8515,8203,8514,8879,-8500,8204,8487,8893,-8512,8204,8511,\n\t\t                    8878,-8514,8204,8513,8890,-8488,8205,8512,8884,-8508,8205,8507,8891,-8495,8205,8494,8883,-8513,8206,8510,8870,-8370,8206,8369,8848,-8517,8206,8516,8891,-8502,8206,8501,\n\t\t                    8889,-8511,8207,8515,8890,-8514,8207,8513,8878,-8494,8207,8493,8879,-8516,8208,8517,8846,-8375,8208,8374,8875,-8519,8208,8518,8878,-8504,8208,8503,8883,-8518,8209,8518,\n\t\t                    8875,-8376,8209,8375,8876,-8520,8209,8519,8879,-8494,8209,8493,8878,-8519,8210,8519,8876,-8350,8210,8349,8847,-8521,8210,8520,8882,-8500,8210,8499,8879,-8520,8211,8521,\n\t\t                    8874,-8348,8211,8347,8845,-8523,8211,8522,8877,-8499,8211,8498,8888,-8522,8212,8522,8845,-8373,8212,8372,8873,-8524,8212,8523,8881,-8490,8212,8489,8877,-8523,8213,8523,\n\t\t                    8873,-8347,8213,8346,8849,-8525,8213,8524,8880,-8506,8213,8505,8881,-8524,8214,8524,8849,-8371,8214,8370,8871,-8498,8214,8497,8887,-8491,8214,8490,8880,-8525,8215,8520,\n\t\t                    8847,-8374,8215,8373,8874,-8522,8215,8521,8888,-8505,8215,8504,8882,-8521,8216,8527,8886,-8532,8216,8531,8895,-8496,8216,8495,8885,-8527,8216,8526,8888,-8528,8217,8504,\n\t\t                    8888,-8527,8217,8526,8885,-8487,8217,8486,8882,-8505,8218,8525,8886,-8528,8218,8527,8888,-8499,8218,8498,8877,-8526,8219,8510,8889,-8529,8219,8528,8869,-8369,8219,8368,\n\t\t                    8870,-8511,8220,8502,8894,-8531,8220,8530,8889,-8489,8220,8488,8884,-8503,8221,8533,8850,-8372,8221,8371,8872,-8535,8221,8534,8897,-8533,8221,8532,8853,-8534,8222,8351,\n\t\t                    8851,-8536,8222,8535,8896,-8478,8222,8477,8897,-8535,8222,8534,8872,-8352,8223,8782,8811,-8393,8223,8392,8821,-8780,8223,8779,8972,-8741,8223,8740,8968,-8783,8224,8535,\n\t\t                    8851,-8353,8224,8352,8852,-8479,8224,8478,8854,-8538,8224,8537,8896,-8536,8225,8540,8853,-8533,8225,8532,8897,-8542,8225,8541,8900,-8540,8225,8539,8898,-8541,8226,8477,\n\t\t                    8896,-8543,8226,8542,8899,-8539,8226,8538,8900,-8542,8226,8541,8897,-8478,8227,8723,8990,-8537,8227,8536,8853,-8541,8227,8540,8898,-8544,8227,8543,8991,-8724,8228,8542,\n\t\t                    8896,-8538,8228,8537,8854,-8588,8228,8587,8899,-8543,8229,8778,8894,-8503,8229,8502,8884,-8782,8229,8781,9003,-8752,8229,8751,9010,-8779,8230,8539,8900,-8547,8230,8546,\n\t\t                    8903,-8550,8230,8549,8904,-8552,8230,8551,8898,-8540,8231,8714,8993,-8726,8231,8725,8992,-8714,8231,8713,8904,-8557,8231,8556,8907,-8715,8232,8549,8903,-8554,8232,8553,\n\t\t                    8906,-8555,8232,8554,8907,-8557,8232,8556,8904,-8550,8233,8715,8994,-8727,8233,8726,8993,-8715,8233,8714,8907,-8560,8233,8559,8908,-8716,8234,8548,8902,-8559,8234,8558,\n\t\t                    8908,-8560,8234,8559,8907,-8555,8234,8554,8906,-8549,8235,8717,8996,-8728,8235,8727,8994,-8716,8235,8715,8908,-8562,8235,8561,8909,-8718,8236,8547,8856,-8561,8236,8560,\n\t\t                    8909,-8562,8236,8561,8908,-8559,8236,8558,8902,-8548,8264,8237,8567,-8605,8237,8479,8855,-8569,8237,8568,8912,-8568,8263,8238,8564,-8603,8262,8239,8562,-8604,8238,8567,\n\t\t                    8912,-8570,8238,8569,8911,-8565,8263,8604,8567,-8239,8239,8564,8911,-8571,8239,8570,8910,-8563,8262,8602,8564,-8240,8240,8546,8900,-8539,8240,8538,8899,-8572,8240,8571,\n\t\t                    8910,-8564,8240,8563,8903,-8547,8241,8565,8906,-8554,8241,8553,8903,-8564,8241,8563,8910,-8571,8241,8570,8911,-8566,8242,8566,8902,-8549,8242,8548,8906,-8566,8242,8565,\n\t\t                    8911,-8570,8242,8569,8912,-8567,8243,8545,8856,-8548,8243,8547,8902,-8567,8243,8566,8912,-8569,8243,8568,8855,-8546,8244,8480,8971,-8729,8244,8728,8996,-8718,8244,8717,\n\t\t                    8909,-8701,8244,8700,8974,-8481,8245,8555,8885,-8496,8245,8495,8895,-8781,8245,8780,9011,-8748,8245,8747,9004,-8556,8246,8700,8909,-8561,8246,8560,8856,-8697,8246,8696,\n\t\t                    8970,-8698,8246,8697,8974,-8701,8247,8530,8894,-8530,8247,8529,8868,-8368,8247,8367,8869,-8529,8247,8528,8889,-8531,8248,8730,8997,-8719,8248,8718,8913,-8576,8248,8575,\n\t\t                    8914,-8577,8248,8576,8999,-8731,8249,8718,8997,-8732,8249,8731,8977,-8573,8249,8572,8901,-8578,8249,8577,8913,-8719,8250,8779,8821,-8420,8250,8419,8868,-8778,8250,8777,\n\t\t                    9001,-8742,8250,8741,8972,-8780,8251,8482,8858,-8580,8251,8579,8913,-8578,8251,8577,8901,-8575,8251,8574,8857,-8483,8252,8581,8914,-8576,8252,8575,8913,-8580,8252,8579,\n\t\t                    8858,-8581,8252,8580,8915,-8582,8253,8581,8915,-8583,8253,8582,8916,-8584,8253,8583,8914,-8582,8254,8682,8963,-8367,8254,8366,8916,-8585,8254,8584,8861,-8669,8254,8668,\n\t\t                    8958,-8683,8255,8585,8915,-8587,8255,8586,8859,-8485,8255,8484,8860,-8586,8256,8580,8858,-8484,8256,8483,8859,-8587,8256,8586,8915,-8581,8257,8582,8915,-8586,8257,8585,\n\t\t                    8860,-8486,8257,8485,8861,-8585,8257,8584,8916,-8583,8265,8603,8562,-8261,8258,8544,8899,-8588,8259,8588,8796,-8428,8259,8427,8823,-8433,8259,8432,8826,-8589,8265,8260,\n\t\t                    8544,-8607,8260,8562,8910,-8572,8260,8571,8899,-8545,8264,8605,8479,-8238,8261,8589,8844,-8685,8261,8684,8958,-8690,8261,8689,8964,-8590,8262,8603,8929,-8602,8262,8601,\n\t\t                    8928,-8603,8263,8602,8928,-8601,8263,8600,8926,-8605,8264,8604,8926,-8600,8264,8599,8927,-8606,8265,8606,8925,-8599,8265,8598,8929,-8604,8290,8479,8605,8299,8651,8952,\n\t\t                    -8644,8266,8607,8924,-8598,8266,8597,8925,-8607,8267,8607,8854,-8479,8267,8478,8852,-8609,8267,8608,8923,-8597,8267,8596,8924,-8608,8268,8610,8921,-8596,8268,8595,8922,\n\t\t                    -8610,8269,8611,8919,-8595,8269,8594,8921,-8611,8270,8612,8920,-8594,8270,8593,8919,-8612,8271,8609,8922,-8593,8271,8592,8918,-8614,8544,8258,8266,-8607,8272,8613,8918,\n\t\t                    -8592,8272,8591,8917,-8615,8273,8608,8852,-8355,8273,8354,8796,-8615,8273,8614,8917,-8591,8273,8590,8923,-8609,8274,8627,8932,-8625,8274,8624,8921,-8595,8274,8594,8919,\n\t\t                    -8624,8274,8623,8931,-8628,8275,8628,8933,-8626,8275,8625,8922,-8596,8275,8595,8921,-8625,8275,8624,8932,-8629,8276,8599,8926,-8635,8276,8634,8936,-8616,8276,8615,8927,\n\t\t                    -8600,8277,8619,8934,-8631,8277,8630,8933,-8619,8277,8618,8929,-8599,8277,8598,8925,-8620,8278,8590,8917,-8592,8278,8591,8918,-8622,8278,8621,8923,-8591,8279,8597,8924,\n\t\t                    -8597,8279,8596,8923,-8621,8279,8620,8925,-8598,8280,8626,8934,-8632,8280,8631,8923,-8622,8280,8621,8918,-8627,8281,8600,8928,-8618,8281,8617,8932,-8628,8281,8627,8931,\n\t\t                    -8617,8281,8616,8926,-8601,8282,8601,8929,-8619,8282,8618,8933,-8629,8282,8628,8932,-8618,8282,8617,8928,-8602,8283,8626,8918,-8593,8283,8592,8922,-8626,8283,8625,8933,\n\t\t                    -8631,8283,8630,8934,-8627,8284,8619,8925,-8621,8284,8620,8923,-8632,8284,8631,8934,-8620,8285,8629,8931,-8624,8285,8623,8919,-8636,8285,8635,8935,-8633,8285,8632,8930,\n\t\t                    -8630,8286,8622,8935,-8636,8286,8635,8919,-8594,8286,8593,8920,-8623,8287,8634,8926,-8617,8287,8616,8931,-8630,8287,8629,8930,-8634,8287,8633,8936,-8635,8288,8657,8927,\n\t\t                    -8616,8288,8615,8936,-8659,8288,8658,8957,-8654,8288,8653,8954,-8658,8289,8659,8800,-8359,8289,8358,8801,-8661,8289,8660,8941,-8640,8289,8639,8940,-8660,8290,8661,8855,\n\t\t                    -8480,8272,8614,8796,-8167,8166,8796,-8589,8290,8643,8945,-8662,8291,8662,8798,-8694,8291,8693,8965,-8357,8291,8356,8799,-8664,8291,8663,8939,-8638,8291,8637,8938,-8663,\n\t\t                    8292,8658,8936,-8634,8292,8633,8930,-8665,8292,8664,8955,-8657,8292,8656,8957,-8659,8293,8665,8935,-8623,8293,8622,8920,-8667,8293,8666,8953,-8655,8293,8654,8956,-8666,\n\t\t                    8607,8266,8258,-8855,8294,8355,8797,-8668,8294,8667,8937,-8637,8434,8613,8272,-8167,8295,8583,8916,-8367,8295,8366,8963,-8473,8295,8472,8867,-8579,8295,8578,8914,-8584,\n\t\t                    8296,8670,8860,-8485,8296,8484,8859,-8672,8296,8671,8949,-8648,8296,8647,8950,-8671,8297,8667,8797,-8436,8297,8435,8798,-8663,8297,8662,8938,-8643,8297,8642,8937,-8668,\n\t\t                    8298,8672,8858,-8483,8298,8482,8857,-8674,8298,8673,8947,-8646,8298,8645,8948,-8673,8299,8605,8927,-8658,8299,8657,8954,-8652,8302,8612,8355,8294,8636,8944,-8653,8300,\n\t\t                    8660,8801,-8360,8300,8359,8802,-8675,8300,8674,8942,-8641,8300,8640,8941,-8661,8301,8663,8799,-8358,8301,8357,8800,-8660,8301,8659,8940,-8639,8301,8638,8939,-8664,8302,\n\t\t                    8666,8920,-8613,8587,8854,-8259,8302,8652,8953,-8667,8303,8664,8930,-8633,8303,8632,8935,-8666,8303,8665,8956,-8656,8303,8655,8955,-8665,8304,8692,8803,-8474,8304,8473,\n\t\t                    8843,-8477,8304,8476,8866,-8691,8304,8690,8844,-8693,8305,8669,8861,-8486,8305,8485,8860,-8671,8305,8670,8950,-8649,8305,8648,8951,-8670,8306,8671,8859,-8484,8306,8483,\n\t\t                    8858,-8673,8306,8672,8948,-8647,8306,8646,8949,-8672,8307,8674,8802,-8361,8307,8360,8803,-8676,8307,8675,8943,-8642,8307,8641,8942,-8675,8308,8673,8857,-8482,8308,8481,\n\t\t                    8970,-8697,8308,8696,8856,-8677,8308,8676,8946,-8645,8308,8644,8947,-8674,8309,8676,8856,-8546,8309,8545,8855,-8662,8309,8661,8945,-8650,8309,8649,8946,-8677,8310,8690,\n\t\t                    8866,-8684,8310,8683,8963,-8683,8310,8682,8958,-8685,8310,8684,8844,-8691,8311,8365,8866,-8684,8311,8683,8963,-8682,8311,8681,8962,-8686,8311,8685,8865,-8366,8312,8364,\n\t\t                    8865,-8686,8312,8685,8962,-8681,8312,8680,8961,-8687,8312,8686,8864,-8365,8313,8363,8864,-8687,8313,8686,8961,-8680,8313,8679,8960,-8688,8313,8687,8863,-8364,8314,8362,\n\t\t                    8863,-8688,8314,8687,8960,-8679,8314,8678,8959,-8689,8314,8688,8862,-8363,8315,8361,8862,-8689,8315,8688,8959,-8678,8315,8677,8958,-8685,8315,8684,8844,-8362,8316,8675,\n\t\t                    8803,-8693,8316,8692,8844,-8590,8317,8650,8964,-8690,8317,8689,8958,-8669,8317,8668,8861,-8670,8317,8669,8951,-8651,8318,8423,8850,-8351,8318,8350,8976,-8720,8318,8719,\n\t\t                    8980,-8427,8318,8426,8795,-8424,8319,8481,8857,-8575,8319,8574,8901,-8699,8319,8698,8974,-8698,8319,8697,8970,-8482,8738,8988,9018,-8763,9018,8988,8737,-8758,8320,8777,\n\t\t                    8868,-8530,8320,8529,8894,-8779,8320,8778,9010,-8753,8320,8752,9001,-8778,8321,8440,8825,-8434,8321,8433,8981,-8717,8321,8716,8982,-8705,8321,8704,8831,-8441,8322,8776,\n\t\t                    8822,-8386,8322,8385,8812,-8551,8322,8550,8969,-8737,8322,8736,8995,-8777,9025,8756,8694,-8988,8727,8770,9031,-8995,9024,8763,8720,-8987,8694,8756,9026,-8990,8999,9034,\n\t\t                    8773,-8731,8720,8763,9025,-8988,8991,9028,8766,-8724,8730,8773,9033,-8998,8323,8550,8812,-8382,8323,8381,8832,-8464,8323,8463,9000,-8735,8323,8734,8969,-8551,8324,8702,\n\t\t                    8867,-8467,8324,8466,8841,-8465,8324,8464,8989,-8722,8324,8721,8978,-8703,8325,8350,8850,-8534,8325,8533,8853,-8537,8325,8536,8990,-8723,8325,8722,8976,-8351,8326,8557,\n\t\t                    8905,-8492,8326,8491,8885,-8556,8326,8555,9004,-8746,8326,8745,9012,-8558,8327,8543,8898,-8552,8327,8551,8904,-8714,8327,8713,8992,-8725,8327,8724,8991,-8544,8985,9023,\n\t\t                    8758,-8700,8723,8766,9027,-8991,8994,9031,8769,-8727,8699,8758,9013,-8968,9026,8764,8721,-8990,8726,8769,9030,-8994,8328,8708,8817,-8378,8328,8377,8820,-8704,8328,8703,\n\t\t                    8973,-8734,8328,8733,8998,-8709,8329,8480,8974,-8699,8329,8698,8901,-8573,8329,8572,8977,-8730,8329,8729,8971,-8481,8330,8712,8893,-8488,8330,8487,8890,-8712,8330,8711,\n\t\t                    9007,-8745,8330,8744,9009,-8713,8331,8578,8867,-8703,8331,8702,8978,-8733,8331,8732,8999,-8577,8331,8576,8914,-8579,8742,8995,9020,-8762,8759,9020,8995,-8737,8752,8775,\n\t\t                    9017,-9002,9017,8764,8741,-9002,8738,8762,9015,-9003,9015,8765,8749,-9003,8766,9028,9005,-8749,9028,8767,8753,-9006,9014,9007,8746,-8772,9014,8772,8744,-9008,8752,9010,\n\t\t                    9034,-8776,8773,9034,9010,-8752,8737,8979,9019,-8758,8742,8761,9019,-8980,8760,9021,8969,-8735,8759,8736,8969,-9022,8755,9022,9000,-8744,8760,8734,9000,-9023,8758,9023,\n\t\t                    8975,-8736,8755,8743,8975,-9024,8733,8792,9013,-8999,8758,8735,8998,-9014,8740,8972,9026,-8757,8764,9026,8972,-8742,9025,8968,8740,-8757,8763,8739,8968,-9026,8765,9027,\n\t\t                    9006,-8750,8766,8748,9006,-9028,8747,9011,9029,-8769,8767,9029,9011,-8754,8745,9004,9030,-8770,9030,9004,8747,-8769,9031,9012,8745,-8770,8746,9008,9032,-8772,9032,9008,\n\t\t                    8754,-8771,9033,9003,8750,-8775,8750,9009,9016,-8775,8772,9016,9009,-8745,8971,9014,8771,-8729,8721,8764,9017,-8979,8982,9020,8759,-8702,8728,8771,9032,-8997,8976,9015,\n\t\t                    8762,-8720,8701,8759,9021,-8984,8332,8785,8886,-8497,8332,8496,8887,-8787,8332,8786,9006,-8749,8332,8748,9005,-8786,8333,8787,8814,-8387,8333,8386,8813,-8789,8333,8788,\n\t\t                    8979,-8738,8333,8737,8988,-8788,8334,8783,8892,-8553,8334,8552,8905,-8558,8334,8557,9012,-8755,8334,8754,9008,-8784,9030,8768,8725,-8994,8719,8762,9018,-8981,8335,8463,\n\t\t                    8832,-8442,8335,8441,8819,-8785,8335,8784,8975,-8744,8335,8743,9000,-8464,8984,9022,8755,-8574,8725,8768,9029,-8993,9021,8760,8710,-8984,8573,8755,9023,-8986,9017,8775,\n\t\t                    8732,-8979,8710,8760,9022,-8985,8981,9019,8761,-8717,8732,8775,9034,-9000,9027,8765,8722,-8991,8716,8761,9020,-8983,8336,8781,8884,-8501,8336,8500,8893,-8713,8336,8712,\n\t\t                    9009,-8751,8336,8750,9003,-8782,8337,8703,8820,-8391,8337,8390,8811,-8783,8337,8782,8968,-8740,8337,8739,8973,-8704,9018,8757,8695,-8981,8722,8765,9015,-8977,9016,8772,\n\t\t                    8729,-8978,8695,8757,9019,-8982,9013,8792,8791,-8968,8729,8772,9014,-8972,8338,8786,8887,-8498,8338,8497,8871,-8790,8338,8789,9002,-8750,8338,8749,9006,-8787,8339,8789,\n\t\t                    8871,-8388,8339,8387,8814,-8788,8339,8787,8988,-8739,8339,8738,9002,-8790,8340,8780,8895,-8532,8340,8531,8886,-8786,8340,8785,9005,-8754,8340,8753,9011,-8781,8341,8788,\n\t\t                    8813,-8422,8341,8421,8822,-8777,8341,8776,8995,-8743,8341,8742,8979,-8789,8342,8460,8966,-8791,8342,8790,8967,-8792,8342,8791,8986,-8460,8342,8459,8828,-8461,8733,8973,\n\t\t                    9024,-8793,8763,9024,8973,-8740,8791,8792,9024,-8987,8343,8699,8967,-8791,8343,8790,8966,-8794,8343,8793,8836,-8708,8343,8707,8985,-8700,8344,8447,8836,-8794,8344,8793,\n\t\t                    8966,-8795,8344,8794,8965,-8694,8344,8693,8798,-8448,8345,8356,8965,-8795,8345,8794,8966,-8461,8345,8460,8828,-8462,8345,8461,8799,-8357,8754,9012,9031,-8771,8773,8751,\n\t\t                    9003,-9034,9033,8774,8731,-8998,9035,9306,9707,-9306,9035,9283,9718,-9307,9035,9305,9720,-9284,9036,9287,9714,-9298,9036,9281,9715,-9288,9036,9296,9708,-9282,9036,9297,\n\t\t                    9709,-9297,9037,9297,9714,-9317,9037,9280,9709,-9298,9037,9316,9705,-9281,9038,9300,9721,-9292,9038,9303,9711,-9301,9038,9291,9712,-9304,9039,9342,9720,-9300,9039,9282,\n\t\t                    9733,-9343,9039,9277,9713,-9283,9039,9299,9710,-9278,9040,9300,9711,-9295,9040,9302,9721,-9301,9040,9294,9706,-9303,9041,9279,9717,-9293,9041,9298,9712,-9280,9041,9292,\n\t\t                    9719,-9299,9042,9307,9749,-9250,9042,9285,9719,-9308,9042,9308,9711,-9286,9042,9249,9747,-9309,9043,9290,9710,-9300,9043,9305,9707,-9291,9043,9299,9720,-9306,9044,9278,\n\t\t                    9721,-9303,9044,9304,9718,-9279,9044,9302,9706,-9305,9045,9303,9712,-9299,9045,9285,9711,-9304,9045,9298,9719,-9286,9046,9301,9771,-9271,9046,9292,9717,-9302,9046,9307,\n\t\t                    9719,-9293,9046,9270,9749,-9308,9047,9306,9718,-9305,9047,9284,9707,-9307,9047,9304,9706,-9285,9048,9308,9747,-9276,9048,9294,9711,-9309,9048,9309,9706,-9295,9048,9275,\n\t\t                    9776,-9310,9049,9309,9776,-9277,9049,9284,9706,-9310,9049,9310,9707,-9285,9049,9276,9777,-9311,9050,9310,9777,-9251,9050,9290,9707,-9311,9050,9311,9710,-9291,9050,9250,\n\t\t                    9748,-9312,9051,9312,9775,-9249,9051,9289,9716,-9313,9051,9313,9705,-9290,9051,9248,9746,-9314,9052,9313,9746,-9274,9052,9280,9705,-9314,9052,9314,9709,-9281,9052,9273,\n\t\t                    9774,-9315,9053,9314,9774,-9248,9053,9296,9709,-9315,9053,9315,9708,-9297,9053,9247,9750,-9316,9054,9315,9750,-9272,9054,9281,9708,-9316,9054,9288,9715,-9282,9054,9271,\n\t\t                    9772,-9289,9055,9311,9748,-9275,9055,9295,9710,-9312,9055,9312,9716,-9296,9055,9274,9775,-9313,9056,9318,9714,-9323,9056,9317,9716,-9319,9056,9286,9713,-9318,9056,9322,\n\t\t                    9723,-9287,9057,9295,9716,-9318,9057,9277,9710,-9296,9057,9317,9713,-9278,9058,9316,9714,-9319,9058,9289,9705,-9317,9058,9318,9716,-9290,9059,9301,9717,-9320,9059,9269,\n\t\t                    9771,-9302,9059,9319,9770,-9270,9060,9293,9722,-9322,9060,9279,9712,-9294,9060,9321,9717,-9280,9061,9324,9751,-9273,9061,9323,9696,-9325,9061,9325,9725,-9324,9061,9272,\n\t\t                    9773,-9326,9062,9252,9752,-9327,9062,9325,9773,-9253,9062,9254,9725,-9326,9062,9326,9724,-9255,9893,9625,9668,-9931,9632,9878,9917,-9676,9063,9326,9752,-9254,9063,9328,\n\t\t                    9724,-9327,9063,9255,9697,-9329,9063,9253,9753,-9256,9064,9331,9696,-9324,9064,9330,9726,-9332,9064,9332,9728,-9331,9064,9323,9725,-9333,9065,9254,9724,-9334,9065,9332,\n\t\t                    9725,-9255,9065,9329,9728,-9333,9065,9333,9727,-9330,9066,9596,9881,-9328,9066,9334,9882,-9597,9066,9331,9726,-9335,9066,9327,9696,-9332,9172,9510,9350,-9080,9067,9335,\n\t\t                    9727,-9490,9068,9283,9720,-9686,9068,9609,9718,-9284,9068,9636,9899,-9610,9068,9685,9876,-9637,9069,9330,9728,-9338,9069,9341,9726,-9331,9069,9340,9732,-9342,9069,9337,\n\t\t                    9731,-9341,9070,9606,9884,-9603,9070,9345,9735,-9607,9070,9605,9732,-9346,9070,9602,9883,-9606,9071,9340,9731,-9344,9071,9345,9732,-9341,9071,9344,9735,-9346,9071,9343,\n\t\t                    9734,-9345,9072,9607,9885,-9612,9072,9347,9736,-9608,9072,9606,9735,-9348,9072,9611,9884,-9607,9073,9339,9730,-9347,9073,9344,9734,-9340,9073,9347,9735,-9345,9073,9346,\n\t\t                    9736,-9348,9074,9608,9886,-9475,9074,9349,9737,-9609,9074,9607,9736,-9350,9074,9474,9885,-9608,9075,9338,9699,-9349,9075,9346,9730,-9339,9075,9349,9736,-9347,9075,9348,\n\t\t                    9737,-9350,9171,9076,9355,-9513,9170,9077,9352,-9512,9076,9356,9740,-9356,9076,9256,9698,-9357,9169,9078,9350,-9511,9170,9512,9355,-9078,9077,9357,9739,-9353,9077,9355,\n\t\t                    9740,-9358,9169,9511,9352,-9079,9078,9358,9738,-9351,9078,9352,9739,-9359,9172,9079,9335,-9515,9171,9513,9256,-9077,9079,9359,9727,-9336,9079,9350,9738,-9360,9080,9337,\n\t\t                    9728,-9330,9080,9351,9731,-9338,9080,9359,9738,-9352,9080,9329,9727,-9360,9081,9353,9734,-9344,9081,9358,9739,-9354,9081,9351,9738,-9359,9081,9343,9731,-9352,9082,9354,\n\t\t                    9730,-9340,9082,9357,9740,-9355,9082,9353,9739,-9358,9082,9339,9734,-9354,9083,9336,9699,-9339,9083,9356,9698,-9337,9083,9354,9740,-9357,9083,9338,9730,-9355,9084,9393,\n\t\t                    9791,-9613,9084,9684,9793,-9394,9084,9647,9909,-9685,9084,9612,9908,-9648,9085,9321,9722,-9321,9085,9319,9717,-9322,9085,9268,9770,-9320,9085,9320,9769,-9269,9086,9595,\n\t\t                    9888,-9611,9086,9365,9890,-9596,9086,9363,9742,-9366,9086,9610,9741,-9364,9087,9610,9888,-9622,9087,9366,9741,-9611,9087,9360,9729,-9367,9087,9621,9887,-9361,9897,9628,\n\t\t                    9671,-9934,9625,9892,9929,-9669,9088,9258,9701,-9369,9088,9362,9700,-9259,9088,9366,9729,-9363,9088,9368,9741,-9367,9089,9370,9742,-9364,9089,9369,9743,-9371,9089,9368,\n\t\t                    9701,-9370,9089,9363,9741,-9369,9090,9370,9743,-9372,9090,9372,9742,-9371,9090,9371,9744,-9373,9091,9584,9864,-9374,9091,9592,9767,-9585,9091,9373,9768,-9593,9092,9375,\n\t\t                    9743,-9377,9092,9260,9703,-9376,9092,9376,9702,-9261,9093,9369,9701,-9260,9093,9376,9743,-9370,9093,9259,9702,-9377,9094,9371,9743,-9376,9094,9374,9744,-9372,9094,9261,\n\t\t                    9704,-9375,9094,9375,9703,-9262,9095,9592,9768,-9368,9095,9377,9767,-9593,9095,9372,9744,-9378,9095,9367,9742,-9373,9096,9415,9780,-9417,9096,9393,9793,-9416,9096,9416,\n\t\t                    9791,-9394,9097,9407,9787,-9398,9097,9406,9782,-9408,9097,9391,9781,-9407,9097,9397,9788,-9392,9098,9426,9787,-9408,9098,9390,9778,-9427,9098,9407,9782,-9391,9099,9401,\n\t\t                    9794,-9411,9099,9413,9785,-9402,9099,9410,9784,-9414,9100,9409,9793,-9454,9100,9387,9783,-9410,9100,9392,9786,-9388,9100,9453,9806,-9393,9101,9404,9784,-9411,9101,9412,\n\t\t                    9779,-9405,9101,9410,9794,-9413,9102,9402,9790,-9390,9102,9408,9792,-9403,9102,9389,9785,-9409,9103,9249,9749,-9418,9103,9418,9747,-9250,9103,9395,9784,-9419,9103,9417,\n\t\t                    9792,-9396,9104,9409,9783,-9401,9104,9415,9793,-9410,9104,9400,9780,-9416,9105,9412,9794,-9389,9105,9414,9779,-9413,9105,9388,9791,-9415,9106,9408,9785,-9414,9106,9395,\n\t\t                    9792,-9409,9106,9413,9784,-9396,9107,9270,9771,-9412,9107,9417,9749,-9271,9107,9402,9792,-9418,9107,9411,9790,-9403,9108,9414,9791,-9417,9108,9394,9779,-9415,9108,9416,\n\t\t                    9780,-9395,9109,9275,9747,-9419,9109,9419,9776,-9276,9109,9404,9779,-9420,9109,9418,9784,-9405,9110,9276,9776,-9420,9110,9420,9777,-9277,9110,9394,9780,-9421,9110,9419,\n\t\t                    9779,-9395,9111,9250,9777,-9421,9111,9421,9748,-9251,9111,9400,9783,-9422,9111,9420,9780,-9401,9112,9248,9775,-9423,9112,9423,9746,-9249,9112,9399,9778,-9424,9112,9422,\n\t\t                    9789,-9400,9113,9273,9746,-9424,9113,9424,9774,-9274,9113,9390,9782,-9425,9113,9423,9778,-9391,9114,9247,9774,-9425,9114,9425,9750,-9248,9114,9406,9781,-9426,9114,9424,\n\t\t                    9782,-9407,9115,9271,9750,-9426,9115,9398,9772,-9272,9115,9391,9788,-9399,9115,9425,9781,-9392,9116,9274,9748,-9422,9116,9422,9775,-9275,9116,9405,9789,-9423,9116,9421,\n\t\t                    9783,-9406,9117,9432,9787,-9429,9117,9396,9796,-9433,9117,9427,9786,-9397,9117,9428,9789,-9428,9118,9427,9789,-9406,9118,9387,9786,-9428,9118,9405,9783,-9388,9119,9428,\n\t\t                    9787,-9427,9119,9399,9789,-9429,9119,9426,9778,-9400,9120,9429,9790,-9412,9120,9269,9770,-9430,9120,9411,9771,-9270,9121,9431,9795,-9404,9121,9389,9790,-9432,9121,9403,\n\t\t                    9785,-9390,9122,9272,9751,-9435,9122,9435,9773,-9273,9122,9433,9798,-9436,9122,9434,9754,-9434,9123,9436,9752,-9253,9123,9378,9797,-9437,9123,9435,9798,-9379,9123,9252,\n\t\t                    9773,-9436,9124,9293,9712,-9684,9124,9680,9722,-9294,9124,9641,9873,-9681,9124,9683,9869,-9642,9125,9253,9752,-9437,9125,9379,9753,-9254,9125,9438,9755,-9380,9125,9436,\n\t\t                    9797,-9439,9126,9433,9754,-9442,9126,9442,9798,-9434,9126,9440,9801,-9443,9126,9441,9799,-9441,9127,9443,9797,-9379,9127,9439,9800,-9444,9127,9442,9801,-9440,9127,9378,\n\t\t                    9798,-9443,9128,9437,9891,-9625,9128,9441,9754,-9438,9128,9444,9799,-9442,9128,9624,9892,-9445,9129,9438,9797,-9444,9129,9488,9755,-9439,9129,9443,9800,-9489,9130,9403,\n\t\t                    9795,-9680,9130,9682,9785,-9404,9130,9652,9904,-9683,9130,9679,9911,-9653,9131,9447,9801,-9441,9131,9450,9804,-9448,9131,9452,9805,-9451,9131,9440,9799,-9453,9132,9626,\n\t\t                    9894,-9616,9132,9614,9893,-9627,9132,9457,9805,-9615,9132,9615,9808,-9458,9133,9454,9804,-9451,9133,9455,9807,-9455,9133,9457,9808,-9456,9133,9450,9805,-9458,9134,9627,\n\t\t                    9895,-9617,9134,9615,9894,-9628,9134,9460,9808,-9616,9134,9616,9809,-9461,9135,9459,9803,-9450,9135,9460,9809,-9460,9135,9455,9808,-9461,9135,9449,9807,-9456,9136,9628,\n\t\t                    9897,-9619,9136,9616,9895,-9629,9136,9462,9809,-9617,9136,9618,9810,-9463,9137,9461,9757,-9449,9137,9462,9810,-9462,9137,9459,9809,-9463,9137,9448,9803,-9460,9165,9505,\n\t\t                    9468,-9139,9138,9469,9756,-9381,9138,9468,9813,-9470,9164,9503,9465,-9140,9163,9504,9463,-9141,9139,9470,9813,-9469,9139,9465,9812,-9471,9164,9139,9468,-9506,9140,9471,\n\t\t                    9812,-9466,9140,9463,9811,-9472,9163,9140,9465,-9504,9141,9439,9801,-9448,9141,9472,9800,-9440,9141,9464,9811,-9473,9141,9447,9804,-9465,9142,9454,9807,-9467,9142,9464,\n\t\t                    9804,-9455,9142,9471,9811,-9465,9142,9466,9812,-9472,9143,9449,9803,-9468,9143,9466,9807,-9450,9143,9470,9812,-9467,9143,9467,9813,-9471,9144,9448,9757,-9447,9144,9467,\n\t\t                    9803,-9449,9144,9469,9813,-9468,9144,9446,9756,-9470,9145,9629,9872,-9382,9145,9618,9897,-9630,9145,9601,9810,-9619,9145,9381,9875,-9602,9146,9396,9786,-9457,9146,9681,\n\t\t                    9796,-9397,9146,9648,9912,-9682,9146,9456,9905,-9649,9147,9461,9810,-9602,9147,9597,9757,-9462,9147,9598,9871,-9598,9147,9601,9875,-9599,9148,9430,9795,-9432,9148,9268,\n\t\t                    9769,-9431,9148,9429,9770,-9269,9148,9431,9790,-9430,9149,9619,9898,-9632,9149,9476,9814,-9620,9149,9477,9815,-9477,9149,9631,9900,-9478,9150,9632,9898,-9620,9150,9473,\n\t\t                    9878,-9633,9150,9478,9802,-9474,9150,9619,9814,-9479,9151,9320,9722,-9681,9151,9678,9769,-9321,9151,9642,9902,-9679,9151,9680,9873,-9643,9152,9480,9759,-9384,9152,9478,\n\t\t                    9814,-9481,9152,9475,9802,-9479,9152,9383,9758,-9476,9153,9476,9815,-9483,9153,9480,9814,-9477,9153,9481,9759,-9481,9153,9482,9816,-9482,9154,9483,9816,-9483,9154,9484,\n\t\t                    9817,-9484,9154,9482,9815,-9485,9155,9267,9864,-9584,9155,9485,9817,-9268,9155,9569,9762,-9486,9155,9583,9859,-9570,9156,9487,9816,-9487,9156,9385,9760,-9488,9156,9486,\n\t\t                    9761,-9386,9157,9384,9759,-9482,9157,9487,9760,-9385,9157,9481,9816,-9488,9158,9486,9816,-9484,9158,9386,9761,-9487,9158,9485,9762,-9387,9158,9483,9817,-9486,9166,9161,\n\t\t                    9463,-9505,9159,9488,9800,-9446,9160,9328,9697,-9490,9160,9333,9724,-9329,9160,9489,9727,-9334,9166,9507,9445,-9162,9161,9472,9811,-9464,9161,9445,9800,-9473,9165,9138,\n\t\t                    9380,-9507,9162,9585,9745,-9491,9162,9590,9859,-9586,9162,9490,9865,-9591,9163,9502,9830,-9505,9163,9503,9829,-9503,9164,9501,9829,-9504,9164,9505,9827,-9502,9165,9500,\n\t\t                    9827,-9506,9165,9506,9828,-9501,9166,9499,9826,-9508,9166,9504,9830,-9500,9191,9544,9853,9552,9200,9506,-9381,9167,9498,9825,-9509,9167,9507,9826,-9499,9168,9379,9755,\n\t\t                    -9509,9168,9509,9753,-9380,9168,9497,9824,-9510,9168,9508,9825,-9498,9169,9496,9822,-9512,9169,9510,9823,-9497,9170,9495,9820,-9513,9170,9511,9822,-9496,9171,9494,9821,\n\t\t                    -9514,9171,9512,9820,-9495,9172,9493,9823,-9511,9172,9514,9819,-9494,9445,9507,9167,-9160,9173,9492,9819,-9515,9173,9515,9818,-9493,9174,9255,9753,-9510,9174,9515,9697,\n\t\t                    -9256,9174,9491,9818,-9516,9174,9509,9824,-9492,9175,9525,9833,-9529,9175,9495,9822,-9526,9175,9524,9820,-9496,9175,9528,9832,-9525,9176,9526,9834,-9530,9176,9496,9823,\n\t\t                    -9527,9176,9525,9822,-9497,9176,9529,9833,-9526,9177,9535,9827,-9501,9177,9516,9837,-9536,9177,9500,9828,-9517,9178,9531,9835,-9521,9178,9519,9834,-9532,9178,9499,9830,\n\t\t                    -9520,9178,9520,9826,-9500,9179,9492,9818,-9492,9179,9522,9819,-9493,9179,9491,9824,-9523,9180,9497,9825,-9499,9180,9521,9824,-9498,9180,9498,9826,-9522,9181,9532,9835,\n\t\t                    -9528,9181,9522,9824,-9533,9181,9527,9819,-9523,9182,9518,9829,-9502,9182,9528,9833,-9519,9182,9517,9832,-9529,9182,9501,9827,-9518,9183,9519,9830,-9503,9183,9529,9834,\n\t\t                    -9520,9183,9518,9833,-9530,9183,9502,9829,-9519,9184,9493,9819,-9528,9184,9526,9823,-9494,9184,9531,9834,-9527,9184,9527,9835,-9532,9185,9521,9826,-9521,9185,9532,9824,\n\t\t                    -9522,9185,9520,9835,-9533,9186,9524,9832,-9531,9186,9536,9820,-9525,9186,9533,9836,-9537,9186,9530,9831,-9534,9187,9536,9836,-9524,9187,9494,9820,-9537,9187,9523,9821,\n\t\t                    -9495,9188,9517,9827,-9536,9188,9530,9832,-9518,9188,9534,9831,-9531,9188,9535,9837,-9535,9189,9516,9828,-9559,9189,9559,9837,-9517,9189,9554,9858,-9560,9189,9558,9855,\n\t\t                    -9555,9190,9259,9701,-9561,9190,9561,9702,-9260,9190,9540,9842,-9562,9190,9560,9841,-9541,9191,9380,9756,-9563,9173,9067,9697,-9516,9067,9489,-9698,9191,9562,9846,-9545,\n\t\t                    9192,9594,9699,-9564,9192,9257,9866,-9595,9192,9564,9700,-9258,9192,9538,9840,-9565,9192,9563,9839,-9539,9193,9534,9837,-9560,9193,9565,9831,-9535,9193,9557,9856,-9566,\n\t\t                    9193,9559,9858,-9558,9194,9523,9836,-9567,9194,9567,9821,-9524,9194,9555,9854,-9568,9194,9566,9857,-9556,9508,9755,9159,-9168,9195,9568,9698,-9257,9195,9537,9838,-9569,\n\t\t                    9335,9067,9173,-9515,9196,9267,9817,-9485,9196,9373,9864,-9268,9196,9479,9768,-9374,9196,9484,9815,-9480,9197,9385,9761,-9572,9197,9572,9760,-9386,9197,9548,9850,-9573,\n\t\t                    9197,9571,9851,-9549,9198,9336,9698,-9569,9198,9563,9699,-9337,9198,9543,9839,-9564,9198,9568,9838,-9544,9199,9383,9759,-9574,9199,9574,9758,-9384,9199,9546,9848,-9575,\n\t\t                    9199,9573,9849,-9547,9200,9558,9828,-9507,9200,9552,9855,-9559,9203,9553,9845,9537,9195,9256,-9514,9201,9260,9702,-9562,9201,9575,9703,-9261,9201,9541,9843,-9576,9201,\n\t\t                    9561,9842,-9542,9202,9258,9700,-9565,9202,9560,9701,-9259,9202,9539,9841,-9561,9202,9564,9840,-9540,9203,9513,9821,-9568,9488,9159,-9756,9203,9567,9854,-9554,9204,9533,\n\t\t                    9831,-9566,9204,9566,9836,-9534,9204,9556,9857,-9567,9204,9565,9856,-9557,9205,9374,9704,-9594,9205,9377,9744,-9375,9205,9591,9767,-9378,9205,9593,9745,-9592,9206,9386,\n\t\t                    9762,-9571,9206,9571,9761,-9387,9206,9549,9851,-9572,9206,9570,9852,-9550,9207,9384,9760,-9573,9207,9573,9759,-9385,9207,9547,9849,-9574,9207,9572,9850,-9548,9208,9261,\n\t\t                    9703,-9576,9208,9576,9704,-9262,9208,9542,9844,-9577,9208,9575,9843,-9543,9209,9382,9758,-9575,9209,9597,9871,-9383,9209,9577,9757,-9598,9209,9545,9847,-9578,9209,9574,\n\t\t                    9848,-9546,9210,9446,9757,-9578,9210,9562,9756,-9447,9210,9550,9846,-9563,9210,9577,9847,-9551,9211,9584,9767,-9592,9211,9583,9864,-9585,9211,9585,9859,-9584,9211,9591,\n\t\t                    9745,-9586,9212,9584,9767,-9267,9212,9582,9864,-9585,9212,9586,9863,-9583,9212,9266,9766,-9587,9213,9586,9766,-9266,9213,9581,9863,-9587,9213,9587,9862,-9582,9213,9265,\n\t\t                    9765,-9588,9214,9587,9765,-9265,9214,9580,9862,-9588,9214,9588,9861,-9581,9214,9264,9764,-9589,9215,9588,9764,-9264,9215,9579,9861,-9589,9215,9589,9860,-9580,9215,9263,\n\t\t                    9763,-9590,9216,9589,9763,-9263,9216,9578,9860,-9590,9216,9585,9859,-9579,9216,9262,9745,-9586,9217,9593,9704,-9577,9217,9490,9745,-9594,9218,9590,9865,-9552,9218,9569,\n\t\t                    9859,-9591,9218,9570,9762,-9570,9218,9551,9852,-9571,9219,9251,9751,-9325,9219,9620,9877,-9252,9219,9327,9881,-9621,9219,9324,9696,-9328,9220,9475,9758,-9383,9220,9599,\n\t\t                    9802,-9476,9220,9598,9875,-9600,9220,9382,9871,-9599,9639,9663,9919,-9890,9919,9658,9638,-9890,9221,9430,9769,-9679,9221,9679,9795,-9431,9221,9653,9911,-9680,9221,9678,\n\t\t                    9902,-9654,9222,9334,9726,-9342,9222,9617,9882,-9335,9222,9605,9883,-9618,9222,9341,9732,-9606,9223,9286,9723,-9678,9223,9451,9713,-9287,9223,9637,9870,-9452,9223,9677,\n\t\t                    9896,-9638,9926,9888,9595,-9658,9628,9895,9932,-9672,9925,9887,9621,-9665,9595,9890,9927,-9658,9900,9631,9674,-9936,9621,9888,9926,-9665,9892,9624,9667,-9930,9631,9898,\n\t\t                    9934,-9675,9224,9282,9713,-9452,9224,9364,9733,-9283,9224,9635,9901,-9365,9224,9451,9870,-9636,9225,9367,9768,-9604,9225,9365,9742,-9368,9225,9622,9890,-9366,9225,9603,\n\t\t                    9879,-9623,9226,9434,9751,-9252,9226,9437,9754,-9435,9226,9623,9891,-9438,9226,9251,9877,-9624,9227,9392,9806,-9459,9227,9456,9786,-9393,9227,9646,9905,-9457,9227,9458,\n\t\t                    9913,-9647,9228,9452,9799,-9445,9228,9614,9805,-9453,9228,9625,9893,-9615,9228,9444,9892,-9626,9886,9600,9659,-9925,9624,9891,9928,-9668,9895,9627,9670,-9933,9600,9868,\n\t\t                    9914,-9660,9927,9890,9622,-9666,9627,9894,9931,-9671,9229,9278,9718,-9610,9229,9604,9721,-9279,9229,9634,9874,-9605,9229,9609,9899,-9635,9230,9599,9875,-9382,9230,9473,\n\t\t                    9802,-9600,9230,9630,9878,-9474,9230,9381,9872,-9631,9231,9388,9794,-9614,9231,9612,9791,-9389,9231,9645,9908,-9613,9231,9613,9910,-9646,9232,9603,9768,-9480,9232,9633,\n\t\t                    9879,-9604,9232,9477,9900,-9634,9232,9479,9815,-9478,9643,9662,9921,-9897,9660,9637,9896,-9922,9653,9902,9918,-9677,9918,9902,9642,-9666,9639,9903,9916,-9664,9916,9903,\n\t\t                    9650,-9667,9667,9649,9906,-9930,9929,9906,9654,-9669,9915,9672,9647,-9909,9915,9908,9645,-9674,9653,9676,9935,-9912,9674,9652,9911,-9936,9638,9658,9920,-9881,9643,9880,\n\t\t                    9920,-9663,9661,9635,9870,-9923,9660,9922,9870,-9638,9656,9644,9901,-9924,9661,9923,9901,-9636,9659,9636,9876,-9925,9656,9924,9876,-9645,9634,9899,9914,-9694,9659,9914,\n\t\t                    9899,-9637,9641,9657,9927,-9874,9665,9642,9873,-9928,9926,9657,9641,-9870,9664,9926,9869,-9641,9666,9650,9907,-9929,9667,9928,9907,-9650,9648,9669,9930,-9913,9668,9654,\n\t\t                    9912,-9931,9646,9670,9931,-9906,9931,9669,9648,-9906,9932,9670,9646,-9914,9647,9672,9933,-9910,9933,9671,9655,-9910,9934,9675,9651,-9905,9651,9675,9917,-9911,9673,9645,\n\t\t                    9910,-9918,9872,9629,9672,-9916,9622,9879,9918,-9666,9883,9602,9660,-9922,9629,9897,9933,-9673,9877,9620,9663,-9917,9602,9884,9922,-9661,9233,9397,9787,-9687,9233,9687,\n\t\t                    9788,-9398,9233,9649,9907,-9688,9233,9686,9906,-9650,9234,9287,9715,-9689,9234,9689,9714,-9288,9234,9638,9880,-9690,9234,9688,9889,-9639,9235,9453,9793,-9685,9235,9458,\n\t\t                    9806,-9454,9235,9655,9913,-9459,9235,9684,9909,-9656,9931,9894,9626,-9670,9620,9881,9919,-9664,9236,9342,9733,-9365,9236,9685,9720,-9343,9236,9644,9876,-9686,9236,9364,\n\t\t                    9901,-9645,9885,9474,9656,-9924,9626,9893,9930,-9670,9922,9884,9611,-9662,9474,9886,9924,-9657,9918,9879,9633,-9677,9611,9885,9923,-9662,9882,9617,9662,-9921,9633,9900,\n\t\t                    9935,-9677,9928,9891,9623,-9667,9617,9883,9921,-9663,9237,9401,9785,-9683,9237,9613,9794,-9402,9237,9651,9910,-9614,9237,9682,9904,-9652,9238,9291,9721,-9605,9238,9683,\n\t\t                    9712,-9292,9238,9640,9869,-9684,9238,9604,9874,-9641,9919,9881,9596,-9659,9623,9877,9916,-9667,9917,9878,9630,-9674,9596,9882,9920,-9659,9914,9868,9692,-9694,9630,9872,\n\t\t                    9915,-9674,9239,9398,9788,-9688,9239,9690,9772,-9399,9239,9650,9903,-9691,9239,9687,9907,-9651,9240,9288,9772,-9691,9240,9688,9715,-9289,9240,9639,9889,-9689,9240,9690,\n\t\t                    9903,-9640,9241,9432,9796,-9682,9241,9686,9787,-9433,9241,9654,9906,-9687,9241,9681,9912,-9655,9242,9322,9714,-9690,9242,9677,9723,-9323,9242,9643,9896,-9678,9242,9689,\n\t\t                    9880,-9644,9243,9691,9867,-9362,9243,9692,9868,-9692,9243,9360,9887,-9693,9243,9361,9729,-9361,9634,9693,9925,-9875,9664,9640,9874,-9926,9692,9887,9925,-9694,9244,9691,\n\t\t                    9868,-9601,9244,9694,9867,-9692,9244,9608,9737,-9695,9244,9600,9886,-9609,9245,9694,9737,-9349,9245,9695,9867,-9695,9245,9594,9866,-9696,9245,9348,9699,-9595,9246,9695,\n\t\t                    9866,-9258,9246,9361,9867,-9696,9246,9362,9729,-9362,9246,9257,9700,-9363,9655,9671,9932,-9914,9674,9934,9904,-9653,9934,9898,9632,-9676,3674,6230,6231,-3672,4970,7122,\n\t\t                    7121,-4972,3775,6285,6243,-3713,3842,6307,6308,-3840\n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: -0.175481,-0.658254,0.732017,0.281259,-0.628346,0.725272,0.258156,-0.527238,0.809503,-0.184240,-0.585528,0.789392,\n\t\t\t         0.926267,0.289712,-0.240883,0.725486,0.458541,-0.513169,0.764611,0.462233,-0.449080,0.941923,0.324168,-0.087374,\n\t\t\t         0.775903,-0.410352,0.479080,0.996979,0.007935,0.076907,0.967437,0.092746,0.235389,0.767968,-0.272469,0.579608,\n\t\t\t         0.820856,-0.261788,0.507553,0.991302,0.038545,0.125645,0.994324,-0.084017,0.064791,0.843867,-0.328104,0.424512,\n\t\t\t         0.010041,-0.627949,0.778161,0.417005,-0.521592,0.744316,0.453627,-0.571764,0.683554,0.017243,-0.653066,0.757073,\n\t\t\t         0.964629,0.188574,-0.184027,0.760491,0.213446,-0.613208,0.564959,-0.364299,-0.740318,0.963500,-0.153447,-0.219214,\n\t\t\t         -0.192297,-0.696860,0.690909,0.256294,-0.674367,0.692434,0.289041,-0.730857,0.618275,-0.160955,-0.737968,0.655324,\n\t\t\t         0.946379,0.225013,-0.231666,0.709220,0.466903,-0.528153,0.708152,0.408002,-0.576189,0.934568,0.167791,-0.313669,\n\t\t\t         0.740501,-0.452834,0.496536,0.988433,-0.089969,0.121830,0.990570,-0.136845,0.004059,0.768364,-0.511795,0.384259,\n\t\t\t         -0.921812,-0.278756,0.269265,-0.941527,-0.289407,0.172369,-0.717460,-0.532701,0.448805,-0.694143,-0.533555,0.483139,\n\t\t\t         0.760704,-0.196936,0.618488,0.767968,-0.272469,0.579608,0.967437,0.092746,0.235389,0.961150,0.140538,0.237526,\n\t\t\t         -0.904935,-0.360118,0.226630,-0.914609,-0.303720,0.266823,-0.618061,-0.544450,0.567034,-0.628163,-0.535081,0.564837,\n\t\t\t         -0.960936,-0.256600,0.103519,-0.933714,-0.335948,0.123692,-0.703726,-0.550035,0.449599,-0.742821,-0.513749,0.429243,\n\t\t\t         0.367534,0.591784,-0.717368,0.377422,0.445265,-0.811945,0.782617,0.350566,-0.514359,0.793786,0.442824,-0.416852,\n\t\t\t         0.338328,0.580035,-0.740989,0.358684,0.573809,-0.736229,0.708152,0.408002,-0.576189,0.709220,0.466903,-0.528153,\n\t\t\t         0.289682,0.074679,-0.954192,0.077761,-0.461257,-0.883847,0.564959,-0.364299,-0.740318,0.760491,0.213446,-0.613208,\n\t\t\t         0.227790,0.618793,-0.751793,0.258156,0.599841,-0.757286,0.764611,0.462233,-0.449080,0.725486,0.458541,-0.513169,\n\t\t\t         -0.694143,-0.533555,0.483139,-0.717460,-0.532701,0.448805,-0.478378,-0.653157,0.586932,-0.480422,-0.647267,0.591784,\n\t\t\t         -0.742821,-0.513749,0.429243,-0.703726,-0.550035,0.449599,-0.368297,-0.638050,0.676168,-0.380993,-0.629627,0.677023,\n\t\t\t         -0.356731,-0.611042,0.706626,-0.368297,-0.638050,0.676168,-0.703726,-0.550035,0.449599,-0.667989,-0.536790,0.515366,\n\t\t\t         -0.132450,-0.567186,0.812830,-0.184240,-0.585528,0.789392,0.258156,-0.527238,0.809503,0.244392,-0.490829,0.836238,\n\t\t\t         0.959838,0.280465,-0.001679,0.941923,0.324168,-0.087374,0.764611,0.462233,-0.449080,0.782342,0.485000,-0.390759,\n\t\t\t         0.950743,0.218482,-0.219764,0.981384,-0.174657,0.079501,0.980041,-0.167577,0.106815,0.953673,0.233039,-0.190100,\n\t\t\t         0.733238,-0.543352,0.408795,0.204566,-0.724631,0.658040,0.259041,-0.731223,0.631001,0.749290,-0.541704,0.380902,\n\t\t\t         -0.844234,-0.522385,0.119755,-0.697989,-0.607898,0.378460,-0.782617,-0.507309,0.360637,-0.920652,-0.346538,0.179693,\n\t\t\t         -0.312326,-0.678365,0.664998,-0.637379,-0.559160,0.530137,-0.614460,-0.612323,0.497452,-0.281075,-0.709830,0.645833,\n\t\t\t         0.981384,-0.174657,0.079501,0.733238,-0.543352,0.408795,0.749290,-0.541704,0.380902,0.980041,-0.167577,0.106815,\n\t\t\t         -0.162755,-0.743797,0.648274,-0.512558,-0.676778,0.528398,-0.202063,-0.814631,0.543626,0.135533,-0.829951,0.541093,\n\t\t\t         0.193548,-0.875332,0.443068,0.475326,-0.759026,0.444807,-0.202063,-0.814631,0.543626,-0.486190,-0.795740,0.361034,\n\t\t\t         0.601245,0.494491,-0.627613,0.821589,0.375225,-0.429151,0.995544,-0.040162,-0.085086,0.911893,0.131504,-0.388745,\n\t\t\t         -0.030457,-0.992370,0.119327,0.193548,-0.875332,0.443068,-0.486190,-0.795740,0.361034,-0.598529,-0.800958,0.013153,\n\t\t\t         0.992126,0.040529,-0.118229,0.947752,-0.284310,0.144566,0.828944,-0.553209,0.082400,0.945433,-0.325480,0.013794,\n\t\t\t         0.619129,-0.636189,-0.460311,0.382122,-0.830073,-0.406140,-0.109867,-0.616291,-0.779778,0.315500,-0.326823,-0.890835,\n\t\t\t         0.721885,-0.590045,0.361492,0.341350,-0.740837,0.578417,0.440230,-0.808252,0.390973,0.664693,-0.723716,0.185308,\n\t\t\t         0.947752,-0.284310,0.144566,0.721885,-0.590045,0.361492,0.664693,-0.723716,0.185308,0.828944,-0.553209,0.082400,\n\t\t\t         0.828944,-0.553209,0.082400,0.664693,-0.723716,0.185308,0.486404,-0.854488,-0.182287,0.469344,-0.882870,0.013581,\n\t\t\t         0.664693,-0.723716,0.185308,0.440230,-0.808252,0.390973,0.631184,-0.774560,-0.040193,0.486404,-0.854488,-0.182287,\n\t\t\t         0.281259,-0.628346,0.725272,0.775903,-0.410352,0.479080,0.767968,-0.272469,0.579608,0.258156,-0.527238,0.809503,\n\t\t\t         0.417005,-0.521592,0.744316,0.820856,-0.261788,0.507553,0.843867,-0.328104,0.424512,0.453627,-0.571764,0.683554,\n\t\t\t         0.256294,-0.674367,0.692434,0.740501,-0.452834,0.496536,0.768364,-0.511795,0.384259,0.289041,-0.730857,0.618275,\n\t\t\t         -0.372814,0.690756,-0.619526,-0.415723,0.562181,-0.714896,-0.783471,0.368725,-0.500198,-0.768090,0.504349,-0.394513,\n\t\t\t         0.244392,-0.490829,0.836238,0.258156,-0.527238,0.809503,0.767968,-0.272469,0.579608,0.760704,-0.196936,0.618488,\n\t\t\t         -0.370067,0.437605,-0.819453,-0.392682,0.443037,-0.805902,-0.772179,0.265175,-0.577380,-0.736961,0.166814,-0.654988,\n\t\t\t         -0.442854,0.185400,-0.877194,-0.357830,0.487594,-0.796350,-0.725211,0.306375,-0.616535,-0.727958,0.259499,-0.634571,\n\t\t\t         0.315500,-0.326823,-0.890835,-0.109867,-0.616291,-0.779778,-0.569384,-0.205359,-0.795984,-0.097934,0.152196,-0.983459,\n\t\t\t         0.945433,-0.325480,0.013794,0.828944,-0.553209,0.082400,0.469344,-0.882870,0.013581,0.506882,-0.797418,0.327311,\n\t\t\t         -0.598529,-0.800958,0.013153,-0.486190,-0.795740,0.361034,-0.697989,-0.607898,0.378460,-0.844234,-0.522385,0.119755,\n\t\t\t         0.911893,0.131504,-0.388745,0.995544,-0.040162,-0.085086,0.703574,-0.579333,0.411451,0.870968,-0.486129,0.071230,\n\t\t\t         -0.486190,-0.795740,0.361034,-0.202063,-0.814631,0.543626,-0.512558,-0.676778,0.528398,-0.697989,-0.607898,0.378460,\n\t\t\t         0.135533,-0.829951,0.541093,-0.202063,-0.814631,0.543626,0.475326,-0.759026,0.444807,0.645772,-0.721732,0.249092,\n\t\t\t         -0.334788,0.466048,-0.818934,-0.771691,0.170934,-0.612568,-0.797266,0.377667,-0.470840,-0.451979,0.591357,-0.667806,\n\t\t\t         -0.782617,-0.507309,0.360637,-0.614460,-0.612323,0.497452,-0.637379,-0.559160,0.530137,-0.815455,-0.443129,0.372295,\n\t\t\t         0.953673,0.233039,-0.190100,0.980041,-0.167577,0.106815,0.947752,-0.284310,0.144566,0.992126,0.040529,-0.118229,\n\t\t\t         -0.920652,-0.346538,0.179693,-0.782617,-0.507309,0.360637,-0.815455,-0.443129,0.372295,-0.953856,-0.249336,0.167211,\n\t\t\t         0.980041,-0.167577,0.106815,0.749290,-0.541704,0.380902,0.721885,-0.590045,0.361492,0.947752,-0.284310,0.144566,\n\t\t\t         0.400372,0.616230,-0.678152,0.734886,0.480636,-0.478408,0.821589,0.375225,-0.429151,0.601245,0.494491,-0.627613,\n\t\t\t         0.749290,-0.541704,0.380902,0.259041,-0.731223,0.631001,0.341350,-0.740837,0.578417,0.721885,-0.590045,0.361492,\n\t\t\t         -0.281075,-0.709830,0.645833,-0.614460,-0.612323,0.497452,-0.512558,-0.676778,0.528398,-0.162755,-0.743797,0.648274,\n\t\t\t         0.937407,0.214911,-0.273873,0.981170,-0.180334,0.068911,0.981384,-0.174657,0.079501,0.950743,0.218482,-0.219764,\n\t\t\t         0.721488,-0.539659,0.433821,0.190222,-0.732170,0.653981,0.204566,-0.724631,0.658040,0.733238,-0.543352,0.408795,\n\t\t\t         -0.498367,0.642445,-0.582110,-0.790551,0.467757,-0.395184,-0.796228,0.490768,-0.353710,-0.511734,0.650288,-0.561418,\n\t\t\t         0.802545,-0.236579,0.547624,0.776330,-0.218848,0.591083,0.978607,0.066347,0.194617,0.984405,0.028596,0.173498,\n\t\t\t         -0.933714,-0.335948,0.123692,-0.911496,-0.368999,0.181555,-0.667989,-0.536790,0.515366,-0.703726,-0.550035,0.449599,\n\t\t\t         0.319407,0.633076,-0.705100,0.367534,0.591784,-0.717368,0.793786,0.442824,-0.416852,0.782342,0.485000,-0.390759,\n\t\t\t         -0.361522,-0.591540,0.720634,-0.356731,-0.611042,0.706626,-0.667989,-0.536790,0.515366,-0.628163,-0.535081,0.564837,\n\t\t\t         -0.026612,-0.633045,0.773644,-0.063478,-0.605396,0.793359,0.269784,-0.509598,0.816980,0.350871,-0.519608,0.779015,\n\t\t\t         0.978881,0.176061,-0.103580,0.976897,0.209754,-0.040101,0.793786,0.442824,-0.416852,0.782617,0.350566,-0.514359,\n\t\t\t         0.350871,-0.519608,0.779015,0.269784,-0.509598,0.816980,0.776330,-0.218848,0.591083,0.802545,-0.236579,0.547624,\n\t\t\t         -0.357830,0.487594,-0.796350,-0.328440,0.493759,-0.805170,-0.752678,0.230140,-0.616810,-0.725211,0.306375,-0.616535,\n\t\t\t         0.783563,-0.496292,0.373760,0.987182,-0.145482,-0.065493,0.993683,-0.105502,-0.038026,0.791681,-0.465224,0.395978,\n\t\t\t         0.295969,0.705924,-0.643452,0.668661,0.538896,-0.512284,0.686087,0.535478,-0.492416,0.316080,0.670858,-0.670827,\n\t\t\t         0.914823,0.145482,-0.376659,0.704520,0.403272,-0.583941,0.695517,0.439558,-0.568316,0.911466,0.208014,-0.354839,\n\t\t\t         -0.972015,-0.139592,0.188788,-0.827509,-0.380291,0.412946,-0.805872,-0.397992,0.438307,-0.969481,-0.131016,0.207068,\n\t\t\t         -0.785394,-0.450972,0.423933,-0.805872,-0.397992,0.438307,-0.631794,-0.535417,0.560472,-0.594195,-0.562578,0.574786,\n\t\t\t         -0.916807,-0.260201,0.302835,-0.911039,-0.281625,0.301065,-0.655171,-0.542344,0.525895,-0.641224,-0.533555,0.551439,\n\t\t\t         -0.432539,0.643452,-0.631519,-0.412122,0.728874,-0.546678,-0.774834,0.552110,-0.307779,-0.803461,0.494247,-0.331828,\n\t\t\t         0.934568,0.167791,-0.313669,0.708152,0.408002,-0.576189,0.704520,0.403272,-0.583941,0.914823,0.145482,-0.376659,\n\t\t\t         0.314341,-0.723502,0.614551,0.783563,-0.496292,0.373760,0.791681,-0.465224,0.395978,0.334208,-0.690146,0.641835,\n\t\t\t         -0.160527,-0.747337,0.644734,0.314341,-0.723502,0.614551,0.334208,-0.690146,0.641835,-0.163457,-0.714316,0.680441,\n\t\t\t         0.269784,-0.509598,0.816980,0.244392,-0.490829,0.836238,0.760704,-0.196936,0.618488,0.776330,-0.218848,0.591083,\n\t\t\t         0.274606,0.628498,-0.727683,0.206183,0.657491,-0.724662,0.695517,0.439558,-0.568316,0.704520,0.403272,-0.583941,\n\t\t\t         -0.412122,0.728874,-0.546678,-0.372814,0.690756,-0.619526,-0.768090,0.504349,-0.394513,-0.774834,0.552110,-0.307779,\n\t\t\t         -0.641224,-0.533555,0.551439,-0.655171,-0.542344,0.525895,-0.457656,-0.625416,0.631947,-0.419294,-0.616627,0.666280,\n\t\t\t         -0.341075,-0.682089,0.646809,-0.642323,-0.532456,0.551225,-0.637379,-0.559160,0.530137,-0.312326,-0.678365,0.664998,\n\t\t\t         -0.063478,-0.605396,0.793359,-0.132450,-0.567186,0.812830,0.244392,-0.490829,0.836238,0.269784,-0.509598,0.816980,\n\t\t\t         0.981170,-0.180334,0.068911,0.721488,-0.539659,0.433821,0.733238,-0.543352,0.408795,0.981384,-0.174657,0.079501,\n\t\t\t         0.791681,-0.465224,0.395978,0.993683,-0.105502,-0.038026,0.996979,0.007935,0.076907,0.775903,-0.410352,0.479080,\n\t\t\t         -0.504654,0.501846,-0.702445,-0.511734,0.650288,-0.561418,-0.796228,0.490768,-0.353710,-0.800806,0.346049,-0.488754,\n\t\t\t         -0.160955,-0.737968,0.655324,0.289041,-0.730857,0.618275,0.314341,-0.723502,0.614551,-0.160527,-0.747337,0.644734,\n\t\t\t         0.768364,-0.511795,0.384259,0.990570,-0.136845,0.004059,0.987182,-0.145482,-0.065493,0.783563,-0.496292,0.373760,\n\t\t\t         0.358684,0.573809,-0.736229,0.274606,0.628498,-0.727683,0.704520,0.403272,-0.583941,0.708152,0.408002,-0.576189,\n\t\t\t         -0.959746,-0.228217,0.163579,-0.969481,-0.131016,0.207068,-0.805872,-0.397992,0.438307,-0.785394,-0.450972,0.423933,\n\t\t\t         -0.827509,-0.380291,0.412946,-0.642323,-0.532456,0.551225,-0.631794,-0.535417,0.560472,-0.805872,-0.397992,0.438307,\n\t\t\t         0.911466,0.208014,-0.354839,0.695517,0.439558,-0.568316,0.725486,0.458541,-0.513169,0.926267,0.289712,-0.240883,\n\t\t\t         -0.655171,-0.542344,0.525895,-0.694143,-0.533555,0.483139,-0.480422,-0.647267,0.591784,-0.457656,-0.625416,0.631947,\n\t\t\t         -0.911039,-0.281625,0.301065,-0.921812,-0.278756,0.269265,-0.694143,-0.533555,0.483139,-0.655171,-0.542344,0.525895,\n\t\t\t         0.289041,-0.730857,0.618275,0.768364,-0.511795,0.384259,0.783563,-0.496292,0.373760,0.314341,-0.723502,0.614551,\n\t\t\t         0.258156,0.599841,-0.757286,0.319407,0.633076,-0.705100,0.782342,0.485000,-0.390759,0.764611,0.462233,-0.449080,\n\t\t\t         -0.911496,-0.368999,0.181555,-0.904935,-0.360118,0.226630,-0.628163,-0.535081,0.564837,-0.667989,-0.536790,0.515366,\n\t\t\t         0.776330,-0.218848,0.591083,0.760704,-0.196936,0.618488,0.961150,0.140538,0.237526,0.978607,0.066347,0.194617,\n\t\t\t         -0.392682,0.443037,-0.805902,-0.432539,0.643452,-0.631519,-0.803461,0.494247,-0.331828,-0.772179,0.265175,-0.577380,\n\t\t\t         -0.618061,-0.544450,0.567034,-0.641224,-0.533555,0.551439,-0.419294,-0.616627,0.666280,-0.387036,-0.612079,0.689566,\n\t\t\t         0.976897,0.209754,-0.040101,0.959838,0.280465,-0.001679,0.782342,0.485000,-0.390759,0.793786,0.442824,-0.416852,\n\t\t\t         -0.387036,-0.612079,0.689566,-0.361522,-0.591540,0.720634,-0.628163,-0.535081,0.564837,-0.618061,-0.544450,0.567034,\n\t\t\t         -0.328440,0.493759,-0.805170,-0.370067,0.437605,-0.819453,-0.736961,0.166814,-0.654988,-0.752678,0.230140,-0.616810,\n\t\t\t         -0.914609,-0.303720,0.266823,-0.916807,-0.260201,0.302835,-0.641224,-0.533555,0.551439,-0.618061,-0.544450,0.567034,\n\t\t\t         -0.163457,-0.714316,0.680441,0.334208,-0.690146,0.641835,0.281259,-0.628346,0.725272,-0.175481,-0.658254,0.732017,\n\t\t\t         0.334208,-0.690146,0.641835,0.791681,-0.465224,0.395978,0.775903,-0.410352,0.479080,0.281259,-0.628346,0.725272,\n\t\t\t         0.206183,0.657491,-0.724662,0.227790,0.618793,-0.751793,0.725486,0.458541,-0.513169,0.695517,0.439558,-0.568316,\n\t\t\t         -0.292276,-0.654042,0.697684,0.222266,-0.644887,0.731223,0.256294,-0.674367,0.692434,-0.192297,-0.696860,0.690909,\n\t\t\t         0.942900,0.227973,-0.242775,0.671804,0.472396,-0.570513,0.709220,0.466903,-0.528153,0.946379,0.225013,-0.231666,\n\t\t\t         0.721854,-0.421674,0.548692,0.979858,-0.094607,0.175695,0.988433,-0.089969,0.121830,0.740501,-0.452834,0.496536,\n\t\t\t         0.294565,0.580889,-0.758782,0.338328,0.580035,-0.740989,0.709220,0.466903,-0.528153,0.671804,0.472396,-0.570513,\n\t\t\t         0.222266,-0.644887,0.731223,0.721854,-0.421674,0.548692,0.740501,-0.452834,0.496536,0.256294,-0.674367,0.692434,\n\t\t\t         -0.717460,-0.532701,0.448805,-0.742973,-0.516861,0.425214,-0.530808,-0.616932,0.581011,-0.478378,-0.653157,0.586932,\n\t\t\t         -0.415723,0.562181,-0.714896,-0.468123,0.422864,-0.775872,-0.764214,0.247353,-0.595630,-0.783471,0.368725,-0.500198,\n\t\t\t         -0.941527,-0.289407,0.172369,-0.937223,-0.318857,0.141179,-0.742973,-0.516861,0.425214,-0.717460,-0.532701,0.448805,\n\t\t\t         -0.742973,-0.516861,0.425214,-0.785394,-0.450972,0.423933,-0.594195,-0.562578,0.574786,-0.530808,-0.616932,0.581011,\n\t\t\t         -0.468123,0.422864,-0.775872,-0.504654,0.501846,-0.702445,-0.800806,0.346049,-0.488754,-0.764214,0.247353,-0.595630,\n\t\t\t         -0.937223,-0.318857,0.141179,-0.959746,-0.228217,0.163579,-0.785394,-0.450972,0.423933,-0.742973,-0.516861,0.425214,\n\t\t\t         -0.320658,-0.678304,0.661092,0.197394,-0.700003,0.686270,0.222266,-0.644887,0.731223,-0.292276,-0.654042,0.697684,\n\t\t\t         0.928617,0.217261,-0.300729,0.656636,0.482345,-0.579760,0.671804,0.472396,-0.570513,0.942900,0.227973,-0.242775,\n\t\t\t         0.718192,-0.491165,0.492843,0.983886,-0.148167,0.099857,0.979858,-0.094607,0.175695,0.721854,-0.421674,0.548692,\n\t\t\t         0.282174,0.639546,-0.715049,0.294565,0.580889,-0.758782,0.671804,0.472396,-0.570513,0.656636,0.482345,-0.579760,\n\t\t\t         0.197394,-0.700003,0.686270,0.718192,-0.491165,0.492843,0.721854,-0.421674,0.548692,0.222266,-0.644887,0.731223,\n\t\t\t         0.316080,0.670858,-0.670827,0.686087,0.535478,-0.492416,0.734886,0.480636,-0.478408,0.400372,0.616230,-0.678152,\n\t\t\t         -0.097934,0.152196,-0.983459,-0.569384,-0.205359,-0.795984,-0.771691,0.170934,-0.612568,-0.334788,0.466048,-0.818934,\n\t\t\t         -0.697989,-0.607898,0.378460,-0.512558,-0.676778,0.528398,-0.614460,-0.612323,0.497452,-0.782617,-0.507309,0.360637,\n\t\t\t         -0.768090,0.504349,-0.394513,-0.783471,0.368725,-0.500198,-0.979553,0.058351,-0.192419,-0.991241,0.121982,-0.050050,\n\t\t\t         -0.736961,0.166814,-0.654988,-0.772179,0.265175,-0.577380,-0.987640,-0.002594,-0.156499,-0.962249,-0.121220,-0.243660,\n\t\t\t         -0.727958,0.259499,-0.634571,-0.725211,0.306375,-0.616535,-0.963286,-0.033509,-0.266335,-0.963439,0.033723,-0.265664,\n\t\t\t         -0.569384,-0.205359,-0.795984,-0.827754,-0.466781,-0.311319,-0.981567,-0.092959,-0.166875,-0.771691,0.170934,-0.612568,\n\t\t\t         0.382122,-0.830073,-0.406140,0.120029,-0.978820,-0.165746,-0.424879,-0.788965,-0.443800,-0.109867,-0.616291,-0.779778,\n\t\t\t         -0.109867,-0.616291,-0.779778,-0.424879,-0.788965,-0.443800,-0.827754,-0.466781,-0.311319,-0.569384,-0.205359,-0.795984,\n\t\t\t         -0.771691,0.170934,-0.612568,-0.981567,-0.092959,-0.166875,-0.987091,0.063753,-0.146702,-0.797266,0.377667,-0.470840,\n\t\t\t         -0.725211,0.306375,-0.616535,-0.752678,0.230140,-0.616810,-0.968322,-0.112094,-0.223029,-0.963286,-0.033509,-0.266335,\n\t\t\t         -0.790551,0.467757,-0.395184,-0.971892,0.193274,-0.134251,-0.973174,0.214606,-0.082736,-0.796228,0.490768,-0.353710,\n\t\t\t         -0.803461,0.494247,-0.331828,-0.774834,0.552110,-0.307779,-0.985717,0.168279,-0.004578,-0.989349,0.144322,-0.018525,\n\t\t\t         -0.800806,0.346049,-0.488754,-0.796228,0.490768,-0.353710,-0.973174,0.214606,-0.082736,-0.984130,0.065462,-0.164739,\n\t\t\t         -0.774834,0.552110,-0.307779,-0.768090,0.504349,-0.394513,-0.991241,0.121982,-0.050050,-0.985717,0.168279,-0.004578,\n\t\t\t         -0.752678,0.230140,-0.616810,-0.736961,0.166814,-0.654988,-0.962249,-0.121220,-0.243660,-0.968322,-0.112094,-0.223029,\n\t\t\t         -0.772179,0.265175,-0.577380,-0.803461,0.494247,-0.331828,-0.989349,0.144322,-0.018525,-0.987640,-0.002594,-0.156499,\n\t\t\t         -0.783471,0.368725,-0.500198,-0.764214,0.247353,-0.595630,-0.959380,-0.016633,-0.281503,-0.979553,0.058351,-0.192419,\n\t\t\t         -0.764214,0.247353,-0.595630,-0.800806,0.346049,-0.488754,-0.984130,0.065462,-0.164739,-0.959380,-0.016633,-0.281503,\n\t\t\t         0.030335,0.592761,-0.804773,-0.061037,0.597797,-0.799310,-0.370067,0.437605,-0.819453,-0.328440,0.493759,-0.805170,\n\t\t\t         -0.093295,0.055269,-0.994079,0.002197,0.474807,-0.880062,-0.357830,0.487594,-0.796350,-0.442854,0.185400,-0.877194,\n\t\t\t         0.002197,0.474807,-0.880062,0.030335,0.592761,-0.804773,-0.328440,0.493759,-0.805170,-0.357830,0.487594,-0.796350,\n\t\t\t         -0.138524,0.570482,-0.809503,-0.141423,0.700888,-0.699088,-0.511734,0.650288,-0.561418,-0.504654,0.501846,-0.702445,\n\t\t\t         0.611255,-0.039369,-0.790429,0.315500,-0.326823,-0.890835,-0.097934,0.152196,-0.983459,0.313150,0.423536,-0.850002,\n\t\t\t         -0.135594,0.551836,-0.822840,-0.191626,0.641377,-0.742851,-0.432539,0.643452,-0.631519,-0.392682,0.443037,-0.805902,\n\t\t\t         -0.026063,0.641255,-0.766869,-0.085238,0.537645,-0.838832,-0.468123,0.422864,-0.775872,-0.415723,0.562181,-0.714896,\n\t\t\t         0.063570,0.624165,-0.778680,-0.334788,0.466048,-0.818934,-0.451979,0.591357,-0.667806,-0.080660,0.682028,-0.726829,\n\t\t\t         -0.072512,0.702567,-0.707877,-0.026063,0.641255,-0.766869,-0.415723,0.562181,-0.714896,-0.372814,0.690756,-0.619526,\n\t\t\t         -0.061037,0.597797,-0.799310,-0.135594,0.551836,-0.822840,-0.392682,0.443037,-0.805902,-0.370067,0.437605,-0.819453,\n\t\t\t         -0.159948,0.723258,-0.671743,-0.072512,0.702567,-0.707877,-0.372814,0.690756,-0.619526,-0.412122,0.728874,-0.546678,\n\t\t\t         0.313150,0.423536,-0.850002,-0.097934,0.152196,-0.983459,-0.334788,0.466048,-0.818934,0.063570,0.624165,-0.778680,\n\t\t\t         0.847499,-0.434278,-0.305155,0.619129,-0.636189,-0.460311,0.315500,-0.326823,-0.890835,0.611255,-0.039369,-0.790429,\n\t\t\t         -0.085238,0.537645,-0.838832,-0.138524,0.570482,-0.809503,-0.504654,0.501846,-0.702445,-0.468123,0.422864,-0.775872,\n\t\t\t         -0.132847,0.734397,-0.665548,-0.498367,0.642445,-0.582110,-0.511734,0.650288,-0.561418,-0.141423,0.700888,-0.699088,\n\t\t\t         -0.191626,0.641377,-0.742851,-0.159948,0.723258,-0.671743,-0.412122,0.728874,-0.546678,-0.432539,0.643452,-0.631519,\n\t\t\t         0.806146,-0.582629,0.103153,0.632832,-0.760918,0.143071,0.382122,-0.830073,-0.406140,0.619129,-0.636189,-0.460311,\n\t\t\t         0.469344,-0.882870,0.013581,0.486404,-0.854488,-0.182287,0.559984,-0.814356,-0.152379,0.497787,-0.860653,0.106815,\n\t\t\t         0.120029,-0.978820,-0.165746,0.382122,-0.830073,-0.406140,0.632832,-0.760918,0.143071,0.538682,-0.808863,0.235572,\n\t\t\t         0.506882,-0.797418,0.327311,0.469344,-0.882870,0.013581,0.497787,-0.860653,0.106815,0.562487,-0.715506,0.414289,\n\t\t\t         0.581195,-0.683065,0.442213,0.699789,-0.588855,0.404370,0.475326,-0.759026,0.444807,0.193548,-0.875332,0.443068,\n\t\t\t         0.870968,-0.486129,0.071230,0.703574,-0.579333,0.411451,0.660726,-0.602893,0.447096,0.707480,-0.623402,0.332896,\n\t\t\t         0.847499,-0.434278,-0.305155,0.870968,-0.486129,0.071230,0.707480,-0.623402,0.332896,0.804712,-0.585284,0.099277,\n\t\t\t         0.645772,-0.721732,0.249092,0.475326,-0.759026,0.444807,0.699789,-0.588855,0.404370,0.763207,-0.589618,0.264229,\n\t\t\t         0.530686,-0.773675,0.346080,0.581195,-0.683065,0.442213,0.193548,-0.875332,0.443068,-0.030457,-0.992370,0.119327,\n\t\t\t         0.486404,-0.854488,-0.182287,0.631184,-0.774560,-0.040193,0.685690,-0.725883,0.053896,0.559984,-0.814356,-0.152379,\n\t\t\t         0.804712,-0.585284,0.099277,0.707480,-0.623402,0.332896,0.700369,-0.633076,0.329630,0.693075,-0.635395,0.340373,\n\t\t\t         0.530686,-0.773675,0.346080,0.693075,-0.635395,0.340373,0.700369,-0.633076,0.329630,0.581195,-0.683065,0.442213,\n\t\t\t         0.581195,-0.683065,0.442213,0.700369,-0.633076,0.329630,0.722465,-0.570177,0.391003,0.699789,-0.588855,0.404370,\n\t\t\t         0.700369,-0.633076,0.329630,0.707480,-0.623402,0.332896,0.660726,-0.602893,0.447096,0.722465,-0.570177,0.391003,\n\t\t\t         0.728294,-0.547410,0.412152,0.562487,-0.715506,0.414289,0.497787,-0.860653,0.106815,0.559984,-0.814356,-0.152379,\n\t\t\t         0.728294,-0.547410,0.412152,0.763207,-0.589618,0.264229,0.699789,-0.588855,0.404370,0.722465,-0.570177,0.391003,\n\t\t\t         0.928617,0.217261,-0.300729,0.983886,-0.148167,0.099857,0.981170,-0.180334,0.068911,0.937407,0.214911,-0.273873,\n\t\t\t         0.718192,-0.491165,0.492843,0.197394,-0.700003,0.686270,0.190222,-0.732170,0.653981,0.721488,-0.539659,0.433821,\n\t\t\t         -0.451979,0.591357,-0.667806,-0.797266,0.377667,-0.470840,-0.790551,0.467757,-0.395184,-0.498367,0.642445,-0.582110,\n\t\t\t         0.282174,0.639546,-0.715049,0.656636,0.482345,-0.579760,0.668661,0.538896,-0.512284,0.295969,0.705924,-0.643452,\n\t\t\t         -0.953856,-0.249336,0.167211,-0.815455,-0.443129,0.372295,-0.827509,-0.380291,0.412946,-0.972015,-0.139592,0.188788,\n\t\t\t         -0.320658,-0.678304,0.661092,-0.631794,-0.535417,0.560472,-0.642323,-0.532456,0.551225,-0.341075,-0.682089,0.646809,\n\t\t\t         0.983886,-0.148167,0.099857,0.718192,-0.491165,0.492843,0.721488,-0.539659,0.433821,0.981170,-0.180334,0.068911,\n\t\t\t         -0.815455,-0.443129,0.372295,-0.637379,-0.559160,0.530137,-0.642323,-0.532456,0.551225,-0.827509,-0.380291,0.412946,\n\t\t\t         -0.797266,0.377667,-0.470840,-0.987091,0.063753,-0.146702,-0.971892,0.193274,-0.134251,-0.790551,0.467757,-0.395184,\n\t\t\t         -0.080660,0.682028,-0.726829,-0.451979,0.591357,-0.667806,-0.498367,0.642445,-0.582110,-0.132847,0.734397,-0.665548,\n\t\t\t         0.009980,-0.877560,0.479324,0.327342,-0.824641,0.461226,0.309091,-0.727317,0.612690,-0.061373,-0.807611,0.586444,\n\t\t\t         0.954192,0.232704,-0.187994,0.754509,0.512864,-0.409436,0.715720,0.618213,-0.324809,0.928800,0.366619,-0.053957,\n\t\t\t         0.783227,-0.524003,0.334544,0.992706,-0.105167,0.058412,0.977691,0.016877,0.209235,0.774102,-0.411634,0.480911,\n\t\t\t         0.707419,-0.482376,0.516556,0.989105,0.107181,0.100772,0.988861,0.144383,-0.036012,0.744530,-0.489181,0.454268,\n\t\t\t         -0.051027,-0.840449,0.539445,0.253975,-0.747887,0.613269,0.292673,-0.785485,0.545244,0.461684,-0.862300,0.207984,\n\t\t\t         0.808191,0.540239,-0.234291,0.659719,0.672903,-0.334544,0.839198,0.191961,-0.508774,0.934080,0.146916,-0.325388,\n\t\t\t         -0.005036,-0.790246,0.612720,0.323985,-0.713431,0.621296,0.314554,-0.725028,0.612629,-0.011689,-0.800378,0.599353,\n\t\t\t         0.905393,0.414624,-0.091159,0.723441,0.603076,-0.335978,0.712668,0.605487,-0.354167,0.917081,0.375805,-0.132939,\n\t\t\t         0.788110,-0.382855,0.481918,0.979827,0.125431,0.155400,0.991577,0.064119,0.112491,0.788079,-0.426221,0.444105,\n\t\t\t         -0.886502,-0.449171,0.110904,-0.896420,-0.443129,-0.003265,-0.631184,-0.709372,0.313578,-0.581744,-0.727287,0.364116,\n\t\t\t         0.707358,-0.356120,0.610553,0.774102,-0.411634,0.480911,0.977691,0.016877,0.209235,0.952239,0.109104,0.285195,\n\t\t\t         -0.852229,-0.522843,0.016663,-0.893429,-0.433821,0.116337,-0.621784,-0.688009,0.374096,-0.628864,-0.701163,0.335948,\n\t\t\t         -0.780023,-0.575976,-0.244392,-0.879238,-0.471206,-0.069735,-0.751061,-0.640034,0.161870,-0.669881,-0.742241,0.017090,\n\t\t\t         0.381146,0.780847,-0.494919,0.364177,0.794733,-0.485488,0.657277,0.700705,-0.277352,0.663320,0.696158,-0.274392,\n\t\t\t         0.346446,0.722068,-0.598804,0.378399,0.735435,-0.562059,0.712668,0.605487,-0.354167,0.723441,0.603076,-0.335978,\n\t\t\t         0.380779,0.727470,-0.570757,0.384777,0.123600,-0.914670,0.839198,0.191961,-0.508774,0.659719,0.672903,-0.334544,\n\t\t\t         0.379894,0.731498,-0.566179,0.360881,0.759850,-0.540696,0.715720,0.618213,-0.324809,0.754509,0.512864,-0.409436,\n\t\t\t         -0.581744,-0.727287,0.364116,-0.631184,-0.709372,0.313578,-0.289193,-0.810389,0.509476,-0.246681,-0.830988,0.498581,\n\t\t\t         -0.669881,-0.742241,0.017090,-0.751061,-0.640034,0.161870,-0.451766,-0.784143,0.425428,-0.433699,-0.849849,0.299326,\n\t\t\t         -0.384106,-0.766625,0.514512,-0.451766,-0.784143,0.425428,-0.751061,-0.640034,0.161870,-0.704856,-0.659932,0.260048,\n\t\t\t         -0.075564,-0.730094,0.679128,-0.061373,-0.807611,0.586444,0.309091,-0.727317,0.612690,0.233985,-0.641011,0.730949,\n\t\t\t         0.884976,0.465194,-0.019929,0.928800,0.366619,-0.053957,0.715720,0.618213,-0.324809,0.693960,0.668783,-0.266640,\n\t\t\t         0.930876,0.354564,-0.087832,0.989715,-0.043031,0.136357,0.984710,-0.047273,0.167516,0.951781,0.305399,-0.028779,\n\t\t\t         0.828791,-0.428144,0.360210,0.501724,-0.671834,0.544847,0.550981,-0.632771,0.544023,0.837306,-0.407422,0.364544,\n\t\t\t         -0.589221,-0.807703,0.020142,-0.391339,-0.836818,0.382824,-0.548143,-0.726890,0.413648,-0.822901,-0.552995,0.130253,\n\t\t\t         0.099399,-0.780572,0.617084,-0.273263,-0.791284,0.546953,-0.247322,-0.791559,0.558763,0.159856,-0.764733,0.624165,\n\t\t\t         0.989715,-0.043031,0.136357,0.828791,-0.428144,0.360210,0.837306,-0.407422,0.364544,0.984710,-0.047273,0.167516,\n\t\t\t         0.296579,-0.777490,0.554552,-0.149205,-0.824793,0.545335,0.352000,-0.778619,0.519425,0.569689,-0.728111,0.381146,\n\t\t\t         0.608509,-0.644978,0.462264,0.690329,-0.537248,0.484512,0.352000,-0.778619,0.519425,-0.014039,-0.917203,0.398114,\n\t\t\t         0.644368,0.602619,-0.470748,0.881710,0.408948,-0.235206,0.990051,0.139622,-0.015931,0.882290,0.340373,-0.325022,\n\t\t\t         0.509690,-0.835932,0.203375,0.608509,-0.644978,0.462264,-0.014039,-0.917203,0.398114,-0.067385,-0.996704,-0.044832,\n\t\t\t         0.992309,0.123600,0.001648,0.970397,-0.160253,0.180548,0.910337,-0.409284,0.061220,0.986633,-0.149052,0.065493,\n\t\t\t         0.914609,-0.314402,-0.254158,0.762596,-0.586291,-0.273293,0.274758,-0.581500,-0.765709,0.539201,-0.122135,-0.833247,\n\t\t\t         0.846614,-0.417188,0.330363,0.644002,-0.612354,0.458480,0.771722,-0.615528,0.159734,0.827052,-0.559130,0.057527,\n\t\t\t         0.970397,-0.160253,0.180548,0.846614,-0.417188,0.330363,0.827052,-0.559130,0.057527,0.910337,-0.409284,0.061220,\n\t\t\t         0.910337,-0.409284,0.061220,0.827052,-0.559130,0.057527,0.766564,-0.620960,-0.163518,0.753136,-0.657460,-0.021943,\n\t\t\t         0.827052,-0.559130,0.057527,0.771722,-0.615528,0.159734,0.858364,-0.509873,-0.056642,0.766564,-0.620960,-0.163518,\n\t\t\t         0.327342,-0.824641,0.461226,0.783227,-0.524003,0.334544,0.774102,-0.411634,0.480911,0.309091,-0.727317,0.612690,\n\t\t\t         0.253975,-0.747887,0.613269,0.707419,-0.482376,0.516556,0.744530,-0.489181,0.454268,0.292673,-0.785485,0.545244,\n\t\t\t         0.323985,-0.713431,0.621296,0.788110,-0.382855,0.481918,0.788079,-0.426221,0.444105,0.314554,-0.725028,0.612629,\n\t\t\t         -0.665670,0.506882,-0.547624,-0.663747,0.404950,-0.628834,-0.845393,0.186560,-0.500473,-0.883389,0.231147,-0.407575,\n\t\t\t         0.233985,-0.641011,0.730949,0.309091,-0.727317,0.612690,0.774102,-0.411634,0.480911,0.707358,-0.356120,0.610553,\n\t\t\t         -0.526841,0.431349,-0.732353,-0.552141,0.558184,-0.619282,-0.896268,0.180731,-0.404950,-0.814325,0.080325,-0.574755,\n\t\t\t         -0.217780,0.462203,-0.859584,-0.405011,0.492874,-0.770043,-0.731193,0.137669,-0.668081,-0.629841,0.090518,-0.771416,\n\t\t\t         0.539201,-0.122135,-0.833247,0.274758,-0.581500,-0.765709,-0.367260,-0.262368,-0.892331,-0.039644,0.229347,-0.972533,\n\t\t\t         0.986633,-0.149052,0.065493,0.910337,-0.409284,0.061220,0.753136,-0.657460,-0.021943,0.841823,-0.500626,0.201636,\n\t\t\t         -0.067385,-0.996704,-0.044832,-0.014039,-0.917203,0.398114,-0.391339,-0.836818,0.382824,-0.589221,-0.807703,0.020142,\n\t\t\t         0.882290,0.340373,-0.325022,0.990051,0.139622,-0.015931,0.959471,-0.175695,0.220283,0.987579,-0.137852,0.075045,\n\t\t\t         -0.014039,-0.917203,0.398114,0.352000,-0.778619,0.519425,-0.149205,-0.824793,0.545335,-0.391339,-0.836818,0.382824,\n\t\t\t         0.569689,-0.728111,0.381146,0.352000,-0.778619,0.519425,0.690329,-0.537248,0.484512,0.891934,-0.392987,0.223518,\n\t\t\t         -0.393262,0.527390,-0.753075,-0.755974,0.127659,-0.641987,-0.845576,0.264290,-0.463790,-0.483261,0.598804,-0.638661,\n\t\t\t         -0.548143,-0.726890,0.413648,-0.247322,-0.791559,0.558763,-0.273263,-0.791284,0.546953,-0.543718,-0.730796,0.412580,\n\t\t\t         0.951781,0.305399,-0.028779,0.984710,-0.047273,0.167516,0.970397,-0.160253,0.180548,0.992309,0.123600,0.001648,\n\t\t\t         -0.822901,-0.552995,0.130253,-0.548143,-0.726890,0.413648,-0.543718,-0.730796,0.412580,-0.813685,-0.547472,0.195379,\n\t\t\t         0.984710,-0.047273,0.167516,0.837306,-0.407422,0.364544,0.846614,-0.417188,0.330363,0.970397,-0.160253,0.180548,\n\t\t\t         0.409497,0.729118,-0.548326,0.736412,0.596301,-0.319498,0.881710,0.408948,-0.235206,0.644368,0.602619,-0.470748,\n\t\t\t         0.837306,-0.407422,0.364544,0.550981,-0.632771,0.544023,0.644002,-0.612354,0.458480,0.846614,-0.417188,0.330363,\n\t\t\t         0.159856,-0.764733,0.624165,-0.247322,-0.791559,0.558763,-0.149205,-0.824793,0.545335,0.296579,-0.777490,0.554552,\n\t\t\t         0.917112,0.378430,-0.125034,0.991546,0.024873,0.127262,0.989715,-0.043031,0.136357,0.930876,0.354564,-0.087832,\n\t\t\t         0.814112,-0.412427,0.408704,0.438398,-0.699545,0.564257,0.501724,-0.671834,0.544847,0.828791,-0.428144,0.360210,\n\t\t\t         -0.550066,0.601917,-0.578875,-0.873043,0.288461,-0.393139,-0.890133,0.363445,-0.274850,-0.589892,0.658071,-0.467910,\n\t\t\t         0.679495,-0.456648,0.574206,0.683584,-0.409406,0.604205,0.956816,0.101810,0.272195,0.969451,0.124271,0.211341,\n\t\t\t         -0.879238,-0.471206,-0.069735,-0.876186,-0.481948,0.001282,-0.704856,-0.659932,0.260048,-0.751061,-0.640034,0.161870,\n\t\t\t         0.372814,0.766137,-0.523453,0.381146,0.780847,-0.494919,0.663320,0.696158,-0.274392,0.693960,0.668783,-0.266640,\n\t\t\t         -0.329051,-0.761071,0.558977,-0.384106,-0.766625,0.514512,-0.704856,-0.659932,0.260048,-0.628864,-0.701163,0.335948,\n\t\t\t         -0.068667,-0.791559,0.607196,-0.060427,-0.750603,0.657949,0.230323,-0.672719,0.703116,0.254036,-0.708243,0.658620,\n\t\t\t         0.839656,0.534837,-0.094211,0.862178,0.504135,-0.049501,0.663320,0.696158,-0.274392,0.657277,0.700705,-0.277352,\n\t\t\t         0.254036,-0.708243,0.658620,0.230323,-0.672719,0.703116,0.683584,-0.409406,0.604205,0.679495,-0.456648,0.574206,\n\t\t\t         -0.405011,0.492874,-0.770043,-0.500381,0.479415,-0.720908,-0.804926,0.122227,-0.580615,-0.731193,0.137669,-0.668081,\n\t\t\t         0.774957,-0.488327,0.401135,0.996857,-0.010285,0.078219,0.996002,-0.083224,0.031953,0.769494,-0.533982,0.350230,\n\t\t\t         0.312906,0.763115,-0.565416,0.691763,0.626606,-0.358898,0.687918,0.633900,-0.353435,0.332194,0.752312,-0.568865,\n\t\t\t         0.933317,0.312296,-0.177068,0.749046,0.539323,-0.384716,0.771508,0.476089,-0.421979,0.943785,0.235420,-0.231971,\n\t\t\t         -0.823115,-0.525071,0.216193,-0.527635,-0.732994,0.429273,-0.569048,-0.703177,0.426252,-0.854183,-0.457320,0.247353,\n\t\t\t         -0.603687,-0.692831,0.394360,-0.569048,-0.703177,0.426252,-0.281167,-0.801141,0.528306,-0.307566,-0.800623,0.514176,\n\t\t\t         -0.886715,-0.391247,0.246193,-0.875240,-0.434462,0.212500,-0.535600,-0.733634,0.418165,-0.593799,-0.688986,0.415509,\n\t\t\t         -0.609088,0.638997,-0.469710,-0.627674,0.596759,-0.499832,-0.919767,0.264138,-0.290201,-0.921690,0.315622,-0.225501,\n\t\t\t         0.917081,0.375805,-0.132939,0.712668,0.605487,-0.354167,0.749046,0.539323,-0.384716,0.933317,0.312296,-0.177068,\n\t\t\t         0.315470,-0.774255,0.548601,0.774957,-0.488327,0.401135,0.769494,-0.533982,0.350230,0.343822,-0.805567,0.482498,\n\t\t\t         0.026063,-0.833461,0.551927,0.315470,-0.774255,0.548601,0.343822,-0.805567,0.482498,0.046083,-0.863826,0.501633,\n\t\t\t         0.230323,-0.672719,0.703116,0.233985,-0.641011,0.730949,0.707358,-0.356120,0.610553,0.683584,-0.409406,0.604205,\n\t\t\t         0.405774,0.732109,-0.547075,0.427473,0.705557,-0.565172,0.771508,0.476089,-0.421979,0.749046,0.539323,-0.384716,\n\t\t\t         -0.627674,0.596759,-0.499832,-0.665670,0.506882,-0.547624,-0.883389,0.231147,-0.407575,-0.919767,0.264138,-0.290201,\n\t\t\t         -0.593799,-0.688986,0.415509,-0.535600,-0.733634,0.418165,-0.207495,-0.846522,0.490188,-0.249428,-0.835841,0.488968,\n\t\t\t         0.060915,-0.801874,0.594317,-0.257576,-0.801691,0.539384,-0.273263,-0.791284,0.546953,0.099399,-0.780572,0.617084,\n\t\t\t         -0.060427,-0.750603,0.657949,-0.075564,-0.730094,0.679128,0.233985,-0.641011,0.730949,0.230323,-0.672719,0.703116,\n\t\t\t         0.991546,0.024873,0.127262,0.814112,-0.412427,0.408704,0.828791,-0.428144,0.360210,0.989715,-0.043031,0.136357,\n\t\t\t         0.769494,-0.533982,0.350230,0.996002,-0.083224,0.031953,0.992706,-0.105167,0.058412,0.783227,-0.524003,0.334544,\n\t\t\t         -0.629017,0.661092,-0.408979,-0.589892,0.658071,-0.467910,-0.890133,0.363445,-0.274850,-0.895077,0.403485,-0.189734,\n\t\t\t         -0.011689,-0.800378,0.599353,0.314554,-0.725028,0.612629,0.315470,-0.774255,0.548601,0.026063,-0.833461,0.551927,\n\t\t\t         0.788079,-0.426221,0.444105,0.991577,0.064119,0.112491,0.996857,-0.010285,0.078219,0.774957,-0.488327,0.401135,\n\t\t\t         0.378399,0.735435,-0.562059,0.405774,0.732109,-0.547075,0.749046,0.539323,-0.384716,0.712668,0.605487,-0.354167,\n\t\t\t         -0.878842,-0.419141,0.227821,-0.854183,-0.457320,0.247353,-0.569048,-0.703177,0.426252,-0.603687,-0.692831,0.394360,\n\t\t\t         -0.527635,-0.732994,0.429273,-0.257576,-0.801691,0.539384,-0.281167,-0.801141,0.528306,-0.569048,-0.703177,0.426252,\n\t\t\t         0.943785,0.235420,-0.231971,0.771508,0.476089,-0.421979,0.754509,0.512864,-0.409436,0.954192,0.232704,-0.187994,\n\t\t\t         -0.535600,-0.733634,0.418165,-0.581744,-0.727287,0.364116,-0.246681,-0.830988,0.498581,-0.207495,-0.846522,0.490188,\n\t\t\t         -0.875240,-0.434462,0.212500,-0.886502,-0.449171,0.110904,-0.581744,-0.727287,0.364116,-0.535600,-0.733634,0.418165,\n\t\t\t         0.314554,-0.725028,0.612629,0.788079,-0.426221,0.444105,0.774957,-0.488327,0.401135,0.315470,-0.774255,0.548601,\n\t\t\t         0.360881,0.759850,-0.540696,0.372814,0.766137,-0.523453,0.693960,0.668783,-0.266640,0.715720,0.618213,-0.324809,\n\t\t\t         -0.876186,-0.481948,0.001282,-0.852229,-0.522843,0.016663,-0.628864,-0.701163,0.335948,-0.704856,-0.659932,0.260048,\n\t\t\t         0.683584,-0.409406,0.604205,0.707358,-0.356120,0.610553,0.952239,0.109104,0.285195,0.956816,0.101810,0.272195,\n\t\t\t         -0.552141,0.558184,-0.619282,-0.609088,0.638997,-0.469710,-0.921690,0.315622,-0.225501,-0.896268,0.180731,-0.404950,\n\t\t\t         -0.621784,-0.688009,0.374096,-0.593799,-0.688986,0.415509,-0.249428,-0.835841,0.488968,-0.310648,-0.791528,0.526231,\n\t\t\t         0.862178,0.504135,-0.049501,0.884976,0.465194,-0.019929,0.693960,0.668783,-0.266640,0.663320,0.696158,-0.274392,\n\t\t\t         -0.310648,-0.791528,0.526231,-0.329051,-0.761071,0.558977,-0.628864,-0.701163,0.335948,-0.621784,-0.688009,0.374096,\n\t\t\t         -0.500381,0.479415,-0.720908,-0.526841,0.431349,-0.732353,-0.814325,0.080325,-0.574755,-0.804926,0.122227,-0.580615,\n\t\t\t         -0.893429,-0.433821,0.116337,-0.886715,-0.391247,0.246193,-0.593799,-0.688986,0.415509,-0.621784,-0.688009,0.374096,\n\t\t\t         0.046083,-0.863826,0.501633,0.343822,-0.805567,0.482498,0.327342,-0.824641,0.461226,0.009980,-0.877560,0.479324,\n\t\t\t         0.343822,-0.805567,0.482498,0.769494,-0.533982,0.350230,0.783227,-0.524003,0.334544,0.327342,-0.824641,0.461226,\n\t\t\t         0.427473,0.705557,-0.565172,0.379894,0.731498,-0.566179,0.754509,0.512864,-0.409436,0.771508,0.476089,-0.421979,\n\t\t\t         -0.015229,-0.816980,0.576403,0.356548,-0.740318,0.569872,0.323985,-0.713431,0.621296,-0.005036,-0.790246,0.612720,\n\t\t\t         0.900662,0.416303,-0.124302,0.711905,0.613330,-0.341990,0.723441,0.603076,-0.335978,0.905393,0.414624,-0.091159,\n\t\t\t         0.817011,-0.406171,0.409253,0.989532,0.100284,0.103732,0.979827,0.125431,0.155400,0.788110,-0.382855,0.481918,\n\t\t\t         0.290780,0.765130,-0.574419,0.346446,0.722068,-0.598804,0.723441,0.603076,-0.335978,0.711905,0.613330,-0.341990,\n\t\t\t         0.356548,-0.740318,0.569872,0.817011,-0.406171,0.409253,0.788110,-0.382855,0.481918,0.323985,-0.713431,0.621296,\n\t\t\t         -0.631184,-0.709372,0.313578,-0.609119,-0.711234,0.350841,-0.304422,-0.798151,0.519822,-0.289193,-0.810389,0.509476,\n\t\t\t         -0.663747,0.404950,-0.628834,-0.647420,0.503281,-0.572283,-0.879849,0.283242,-0.381603,-0.845393,0.186560,-0.500473,\n\t\t\t         -0.896420,-0.443129,-0.003265,-0.879238,-0.466109,0.098086,-0.609119,-0.711234,0.350841,-0.631184,-0.709372,0.313578,\n\t\t\t         -0.609119,-0.711234,0.350841,-0.603687,-0.692831,0.394360,-0.307566,-0.800623,0.514176,-0.304422,-0.798151,0.519822,\n\t\t\t         -0.647420,0.503281,-0.572283,-0.629017,0.661092,-0.408979,-0.895077,0.403485,-0.189734,-0.879849,0.283242,-0.381603,\n\t\t\t         -0.879238,-0.466109,0.098086,-0.878842,-0.419141,0.227821,-0.603687,-0.692831,0.394360,-0.609119,-0.711234,0.350841,\n\t\t\t         0.051546,-0.816767,0.574633,0.389080,-0.741417,0.546709,0.356548,-0.740318,0.569872,-0.015229,-0.816980,0.576403,\n\t\t\t         0.913175,0.382000,-0.141972,0.693655,0.631367,-0.346690,0.711905,0.613330,-0.341990,0.900662,0.416303,-0.124302,\n\t\t\t         0.814417,-0.450850,0.365246,0.997223,0.044130,0.059786,0.989532,0.100284,0.103732,0.817011,-0.406171,0.409253,\n\t\t\t         0.281381,0.793664,-0.539323,0.290780,0.765130,-0.574419,0.711905,0.613330,-0.341990,0.693655,0.631367,-0.346690,\n\t\t\t         0.389080,-0.741417,0.546709,0.814417,-0.450850,0.365246,0.817011,-0.406171,0.409253,0.356548,-0.740318,0.569872,\n\t\t\t         0.332194,0.752312,-0.568865,0.687918,0.633900,-0.353435,0.736412,0.596301,-0.319498,0.409497,0.729118,-0.548326,\n\t\t\t         -0.039644,0.229347,-0.972533,-0.367260,-0.262368,-0.892331,-0.755974,0.127659,-0.641987,-0.393262,0.527390,-0.753075,\n\t\t\t         -0.391339,-0.836818,0.382824,-0.149205,-0.824793,0.545335,-0.247322,-0.791559,0.558763,-0.548143,-0.726890,0.413648,\n\t\t\t         -0.883389,0.231147,-0.407575,-0.845393,0.186560,-0.500473,-0.946074,-0.107517,-0.305490,-0.980010,-0.089908,-0.177313,\n\t\t\t         -0.814325,0.080325,-0.574755,-0.896268,0.180731,-0.404950,-0.979247,-0.157537,-0.127323,-0.917661,-0.287362,-0.274361,\n\t\t\t         -0.629841,0.090518,-0.771416,-0.731193,0.137669,-0.668081,-0.907132,-0.249245,-0.339000,-0.795282,-0.301401,-0.525956,\n\t\t\t         -0.367260,-0.262368,-0.892331,-0.570574,-0.652974,-0.498032,-0.917722,-0.272317,-0.289071,-0.755974,0.127659,-0.641987,\n\t\t\t         0.762596,-0.586291,-0.273293,0.616138,-0.778893,-0.116947,0.067721,-0.890316,-0.450209,0.274758,-0.581500,-0.765709,\n\t\t\t         0.274758,-0.581500,-0.765709,0.067721,-0.890316,-0.450209,-0.570574,-0.652974,-0.498032,-0.367260,-0.262368,-0.892331,\n\t\t\t         -0.755974,0.127659,-0.641987,-0.917722,-0.272317,-0.289071,-0.974761,-0.173132,-0.140812,-0.845576,0.264290,-0.463790,\n\t\t\t         -0.731193,0.137669,-0.668081,-0.804926,0.122227,-0.580615,-0.929411,-0.245949,-0.275063,-0.907132,-0.249245,-0.339000,\n\t\t\t         -0.873043,0.288461,-0.393139,-0.986084,-0.129154,-0.104434,-0.998413,-0.053896,-0.014801,-0.890133,0.363445,-0.274850,\n\t\t\t         -0.921690,0.315622,-0.225501,-0.919767,0.264138,-0.290201,-0.997101,-0.066286,-0.037172,-0.996368,-0.065859,0.053896,\n\t\t\t         -0.895077,0.403485,-0.189734,-0.890133,0.363445,-0.274850,-0.998413,-0.053896,-0.014801,-0.999542,0.022248,0.020356,\n\t\t\t         -0.919767,0.264138,-0.290201,-0.883389,0.231147,-0.407575,-0.980010,-0.089908,-0.177313,-0.997101,-0.066286,-0.037172,\n\t\t\t         -0.804926,0.122227,-0.580615,-0.814325,0.080325,-0.574755,-0.917661,-0.287362,-0.274361,-0.929411,-0.245949,-0.275063,\n\t\t\t         -0.896268,0.180731,-0.404950,-0.921690,0.315622,-0.225501,-0.996368,-0.065859,0.053896,-0.979247,-0.157537,-0.127323,\n\t\t\t         -0.845393,0.186560,-0.500473,-0.879849,0.283242,-0.381603,-0.983551,-0.089694,-0.156652,-0.946074,-0.107517,-0.305490,\n\t\t\t         -0.879849,0.283242,-0.381603,-0.895077,0.403485,-0.189734,-0.999542,0.022248,0.020356,-0.983551,-0.089694,-0.156652,\n\t\t\t         -0.094302,0.717154,-0.690481,-0.098483,0.683340,-0.723411,-0.526841,0.431349,-0.732353,-0.500381,0.479415,-0.720908,\n\t\t\t         0.058596,0.617603,-0.784295,-0.070070,0.736686,-0.672536,-0.405011,0.492874,-0.770043,-0.217780,0.462203,-0.859584,\n\t\t\t         -0.070070,0.736686,-0.672536,-0.094302,0.717154,-0.690481,-0.500381,0.479415,-0.720908,-0.405011,0.492874,-0.770043,\n\t\t\t         -0.244057,0.772759,-0.585864,-0.185247,0.795984,-0.576250,-0.589892,0.658071,-0.467910,-0.629017,0.661092,-0.408979,\n\t\t\t         0.760613,0.235298,-0.605029,0.539201,-0.122135,-0.833247,-0.039644,0.229347,-0.972533,0.337596,0.541948,-0.769585,\n\t\t\t         -0.136509,0.742149,-0.656148,-0.166356,0.790826,-0.588977,-0.609088,0.638997,-0.469710,-0.552141,0.558184,-0.619282,\n\t\t\t         -0.213294,0.659322,-0.720939,-0.216102,0.665944,-0.713981,-0.647420,0.503281,-0.572283,-0.663747,0.404950,-0.628834,\n\t\t\t         0.033876,0.710929,-0.702445,-0.393262,0.527390,-0.753075,-0.483261,0.598804,-0.638661,-0.042512,0.750175,-0.659841,\n\t\t\t         -0.167455,0.757927,-0.630451,-0.213294,0.659322,-0.720939,-0.663747,0.404950,-0.628834,-0.665670,0.506882,-0.547624,\n\t\t\t         -0.098483,0.683340,-0.723411,-0.136509,0.742149,-0.656148,-0.552141,0.558184,-0.619282,-0.526841,0.431349,-0.732353,\n\t\t\t         -0.123081,0.793573,-0.595874,-0.167455,0.757927,-0.630451,-0.665670,0.506882,-0.547624,-0.627674,0.596759,-0.499832,\n\t\t\t         0.337596,0.541948,-0.769585,-0.039644,0.229347,-0.972533,-0.393262,0.527390,-0.753075,0.033876,0.710929,-0.702445,\n\t\t\t         0.975921,-0.196051,-0.095401,0.914609,-0.314402,-0.254158,0.539201,-0.122135,-0.833247,0.760613,0.235298,-0.605029,\n\t\t\t         -0.216102,0.665944,-0.713981,-0.244057,0.772759,-0.585864,-0.629017,0.661092,-0.408979,-0.647420,0.503281,-0.572283,\n\t\t\t         -0.120457,0.757927,-0.641072,-0.550066,0.601917,-0.578875,-0.589892,0.658071,-0.467910,-0.185247,0.795984,-0.576250,\n\t\t\t         -0.166356,0.790826,-0.588977,-0.123081,0.793573,-0.595874,-0.627674,0.596759,-0.499832,-0.609088,0.638997,-0.469710,\n\t\t\t         0.943022,-0.303262,0.136692,0.878079,-0.456984,0.141667,0.762596,-0.586291,-0.273293,0.914609,-0.314402,-0.254158,\n\t\t\t         0.753136,-0.657460,-0.021943,0.766564,-0.620960,-0.163518,0.831446,-0.552690,0.056490,0.798120,-0.590655,0.118656,\n\t\t\t         0.616138,-0.778893,-0.116947,0.762596,-0.586291,-0.273293,0.878079,-0.456984,0.141667,0.790124,-0.581927,0.192389,\n\t\t\t         0.841823,-0.500626,0.201636,0.753136,-0.657460,-0.021943,0.798120,-0.590655,0.118656,0.807703,-0.474654,0.349681,\n\t\t\t         0.827509,-0.369671,0.422559,0.833735,-0.339702,0.435255,0.690329,-0.537248,0.484512,0.608509,-0.644978,0.462264,\n\t\t\t         0.987579,-0.137852,0.075045,0.959471,-0.175695,0.220283,0.862087,-0.350963,0.365490,0.893063,-0.339305,0.295389,\n\t\t\t         0.975921,-0.196051,-0.095401,0.987579,-0.137852,0.075045,0.893063,-0.339305,0.295389,0.914365,-0.326212,0.239784,\n\t\t\t         0.891934,-0.392987,0.223518,0.690329,-0.537248,0.484512,0.833735,-0.339702,0.435255,0.837581,-0.409497,0.361522,\n\t\t\t         0.816279,-0.474654,0.329112,0.827509,-0.369671,0.422559,0.608509,-0.644978,0.462264,0.509690,-0.835932,0.203375,\n\t\t\t         0.766564,-0.620960,-0.163518,0.858364,-0.509873,-0.056642,0.836177,-0.522294,0.167302,0.831446,-0.552690,0.056490,\n\t\t\t         0.914365,-0.326212,0.239784,0.893063,-0.339305,0.295389,0.851802,-0.367229,0.373547,0.887295,-0.387494,0.250008,\n\t\t\t         0.816279,-0.474654,0.329112,0.887295,-0.387494,0.250008,0.851802,-0.367229,0.373547,0.827509,-0.369671,0.422559,\n\t\t\t         0.827509,-0.369671,0.422559,0.851802,-0.367229,0.373547,0.834162,-0.366955,0.411695,0.833735,-0.339702,0.435255,\n\t\t\t         0.851802,-0.367229,0.373547,0.893063,-0.339305,0.295389,0.862087,-0.350963,0.365490,0.834162,-0.366955,0.411695,\n\t\t\t         0.823634,-0.382244,0.418867,0.807703,-0.474654,0.349681,0.798120,-0.590655,0.118656,0.831446,-0.552690,0.056490,\n\t\t\t         0.823634,-0.382244,0.418867,0.837581,-0.409497,0.361522,0.833735,-0.339702,0.435255,0.834162,-0.366955,0.411695,\n\t\t\t         0.913175,0.382000,-0.141972,0.997223,0.044130,0.059786,0.991546,0.024873,0.127262,0.917112,0.378430,-0.125034,\n\t\t\t         0.814417,-0.450850,0.365246,0.389080,-0.741417,0.546709,0.438398,-0.699545,0.564257,0.814112,-0.412427,0.408704,\n\t\t\t         -0.483261,0.598804,-0.638661,-0.845576,0.264290,-0.463790,-0.873043,0.288461,-0.393139,-0.550066,0.601917,-0.578875,\n\t\t\t         0.281381,0.793664,-0.539323,0.693655,0.631367,-0.346690,0.691763,0.626606,-0.358898,0.312906,0.763115,-0.565416,\n\t\t\t         -0.813685,-0.547472,0.195379,-0.543718,-0.730796,0.412580,-0.527635,-0.732994,0.429273,-0.823115,-0.525071,0.216193,\n\t\t\t         0.051546,-0.816767,0.574633,-0.281167,-0.801141,0.528306,-0.257576,-0.801691,0.539384,0.060915,-0.801874,0.594317,\n\t\t\t         0.997223,0.044130,0.059786,0.814417,-0.450850,0.365246,0.814112,-0.412427,0.408704,0.991546,0.024873,0.127262,\n\t\t\t         -0.543718,-0.730796,0.412580,-0.273263,-0.791284,0.546953,-0.257576,-0.801691,0.539384,-0.527635,-0.732994,0.429273,\n\t\t\t         -0.845576,0.264290,-0.463790,-0.974761,-0.173132,-0.140812,-0.986084,-0.129154,-0.104434,-0.873043,0.288461,-0.393139,\n\t\t\t         -0.042512,0.750175,-0.659841,-0.483261,0.598804,-0.638661,-0.550066,0.601917,-0.578875,-0.120457,0.757927,-0.641072,\n\t\t\t         0.156102,-0.837764,0.523209,0.561296,-0.650929,0.511063,0.469192,-0.595050,0.652455,0.168401,-0.774346,0.609912,\n\t\t\t         0.896329,0.443251,-0.010254,0.708884,0.678671,-0.191961,0.667104,0.743645,-0.044099,0.827387,0.545640,0.132969,\n\t\t\t         0.892666,-0.262062,0.366680,0.979064,0.132664,0.154210,0.916837,0.257210,0.305307,0.826777,-0.186987,0.530503,\n\t\t\t         0.793115,-0.423811,0.437422,0.980407,0.058260,0.188116,0.989929,0.074923,0.119968,0.776330,-0.467391,0.422834,\n\t\t\t         0.043031,-0.857479,0.512680,0.432691,-0.721763,0.540147,0.396130,-0.786584,0.473617,0.619953,-0.776055,0.115665,\n\t\t\t         0.825434,0.553270,-0.111881,0.589221,0.753990,-0.290231,0.807917,0.315043,-0.498001,0.895138,0.406964,-0.181921,\n\t\t\t         0.273507,-0.821009,0.501083,0.565142,-0.670797,0.480209,0.572344,-0.690786,0.441786,0.267983,-0.848964,0.455397,\n\t\t\t         0.862117,0.504379,-0.048097,0.689444,0.690939,-0.217383,0.728324,0.647328,-0.224647,0.878933,0.470595,-0.077181,\n\t\t\t         0.919675,-0.232521,0.316416,0.963530,0.253029,0.087008,0.969695,0.234230,0.069063,0.907254,-0.283517,0.310556,\n\t\t\t         -0.863979,-0.495743,0.087863,-0.847407,-0.528703,0.048494,-0.516861,-0.810450,0.275613,-0.580584,-0.774773,0.250160,\n\t\t\t         0.784631,-0.246681,0.568743,0.826777,-0.186987,0.530503,0.916837,0.257210,0.305307,0.911649,0.262185,0.316355,\n\t\t\t         -0.770623,-0.632801,-0.075106,-0.793359,-0.604236,-0.073580,-0.588733,-0.783013,0.200598,-0.549486,-0.813623,0.189795,\n\t\t\t         -0.703848,-0.647023,-0.293039,-0.714408,-0.667196,-0.210730,-0.533769,-0.844722,0.038636,-0.543352,-0.833216,-0.102420,\n\t\t\t         0.403088,0.839991,-0.363140,0.351115,0.822504,-0.447371,0.645009,0.727622,-0.233467,0.690481,0.707572,-0.150090,\n\t\t\t         0.374187,0.823908,-0.425581,0.378826,0.824824,-0.419660,0.728324,0.647328,-0.224647,0.689444,0.690939,-0.217383,\n\t\t\t         0.367901,0.752159,-0.546678,0.414289,0.375652,-0.828974,0.807917,0.315043,-0.498001,0.589221,0.753990,-0.290231,\n\t\t\t         0.380566,0.842433,-0.381329,0.397656,0.880306,-0.258614,0.667104,0.743645,-0.044099,0.708884,0.678671,-0.191961,\n\t\t\t         -0.580584,-0.774773,0.250160,-0.516861,-0.810450,0.275613,-0.085818,-0.907620,0.410871,-0.155522,-0.918393,0.363750,\n\t\t\t         -0.543352,-0.833216,-0.102420,-0.533769,-0.844722,0.038636,-0.264840,-0.895718,0.357097,-0.252724,-0.925748,0.281167,\n\t\t\t         -0.187078,-0.894009,0.407086,-0.264840,-0.895718,0.357097,-0.533769,-0.844722,0.038636,-0.548997,-0.824854,0.134739,\n\t\t\t         0.217353,-0.766656,0.604114,0.168401,-0.774346,0.609912,0.469192,-0.595050,0.652455,0.461592,-0.600299,0.653096,\n\t\t\t         0.822230,0.558061,0.111545,0.827387,0.545640,0.132969,0.667104,0.743645,-0.044099,0.683493,0.728446,-0.046510,\n\t\t\t         0.873959,0.482955,-0.054079,0.978881,0.177618,0.100955,0.985687,0.098270,0.136937,0.913724,0.406262,-0.005768,\n\t\t\t         0.915250,-0.265816,0.302713,0.617664,-0.635884,0.462691,0.633839,-0.598132,0.490341,0.904386,-0.282662,0.319559,\n\t\t\t         -0.675008,-0.697562,-0.240211,-0.445143,-0.879849,0.166326,-0.518906,-0.822626,0.232368,-0.808924,-0.584033,-0.067202,\n\t\t\t         0.285318,-0.809473,0.513138,-0.120762,-0.889370,0.440870,-0.107852,-0.889920,0.443159,0.297067,-0.787439,0.540056,\n\t\t\t         0.978881,0.177618,0.100955,0.915250,-0.265816,0.302713,0.904386,-0.282662,0.319559,0.985687,0.098270,0.136937,\n\t\t\t         0.399243,-0.770012,0.497604,-0.100742,-0.890927,0.442793,0.255898,-0.854030,0.452864,0.625019,-0.672048,0.397046,\n\t\t\t         0.548265,-0.834437,0.055300,0.673482,-0.655477,0.341655,0.255898,-0.854030,0.452864,-0.132023,-0.989654,0.055879,\n\t\t\t         0.404492,0.771874,-0.490463,0.736473,0.643880,-0.207282,0.765191,0.614154,-0.193060,0.623371,0.596728,-0.505234,\n\t\t\t         0.458205,-0.848750,-0.263833,0.548265,-0.834437,0.055300,-0.132023,-0.989654,0.055879,-0.296823,-0.872280,-0.388562,\n\t\t\t         0.966186,0.257576,0.010132,0.996490,-0.024140,0.079775,0.984558,-0.147282,0.094272,0.945830,0.315104,0.078097,\n\t\t\t         0.684500,-0.407300,-0.604572,0.542070,-0.592029,-0.596332,-0.158177,-0.303873,-0.939451,0.088137,0.005554,-0.996063,\n\t\t\t         0.913816,-0.340403,0.221381,0.713340,-0.573992,0.401990,0.841273,-0.499161,0.207495,0.924223,-0.375225,0.070559,\n\t\t\t         0.996490,-0.024140,0.079775,0.913816,-0.340403,0.221381,0.924223,-0.375225,0.070559,0.984558,-0.147282,0.094272,\n\t\t\t         0.984558,-0.147282,0.094272,0.924223,-0.375225,0.070559,0.867092,-0.469832,-0.165349,0.943205,-0.317545,0.097476,\n\t\t\t         0.924223,-0.375225,0.070559,0.841273,-0.499161,0.207495,0.934812,-0.338450,-0.107456,0.867092,-0.469832,-0.165349,\n\t\t\t         0.561296,-0.650929,0.511063,0.892666,-0.262062,0.366680,0.826777,-0.186987,0.530503,0.469192,-0.595050,0.652455,\n\t\t\t         0.432691,-0.721763,0.540147,0.793115,-0.423811,0.437422,0.776330,-0.467391,0.422834,0.396130,-0.786584,0.473617,\n\t\t\t         0.565142,-0.670797,0.480209,0.919675,-0.232521,0.316416,0.907254,-0.283517,0.310556,0.572344,-0.690786,0.441786,\n\t\t\t         -0.563280,0.650899,-0.508896,-0.526139,0.651570,-0.546434,-0.864528,0.278939,-0.418012,-0.896634,0.285745,-0.338176,\n\t\t\t         0.461592,-0.600299,0.653096,0.469192,-0.595050,0.652455,0.826777,-0.186987,0.530503,0.784631,-0.246681,0.568743,\n\t\t\t         -0.422651,0.583972,-0.693014,-0.439131,0.560076,-0.702445,-0.738121,0.062807,-0.671712,-0.746300,0.130009,-0.652760,\n\t\t\t         -0.308634,0.459944,-0.832545,-0.416181,0.566363,-0.711325,-0.741142,0.112522,-0.661824,-0.713645,0.051515,-0.698569,\n\t\t\t         0.088137,0.005554,-0.996063,-0.158177,-0.303873,-0.939451,-0.561968,-0.052950,-0.825434,-0.306436,0.308359,-0.900540,\n\t\t\t         0.945830,0.315104,0.078097,0.984558,-0.147282,0.094272,0.943205,-0.317545,0.097476,0.974639,0.086917,0.206122,\n\t\t\t         -0.296823,-0.872280,-0.388562,-0.132023,-0.989654,0.055879,-0.445143,-0.879849,0.166326,-0.675008,-0.697562,-0.240211,\n\t\t\t         0.623371,0.596728,-0.505234,0.765191,0.614154,-0.193060,0.967956,0.250526,-0.015503,0.972167,0.170843,-0.160283,\n\t\t\t         -0.132023,-0.989654,0.055879,0.255898,-0.854030,0.452864,-0.100742,-0.890927,0.442793,-0.445143,-0.879849,0.166326,\n\t\t\t         0.625019,-0.672048,0.397046,0.255898,-0.854030,0.452864,0.673482,-0.655477,0.341655,0.862178,-0.374004,0.341655,\n\t\t\t         -0.490127,0.546648,-0.678884,-0.786401,0.174780,-0.592425,-0.837519,0.320780,-0.442244,-0.522019,0.651845,-0.550035,\n\t\t\t         -0.518906,-0.822626,0.232368,-0.107852,-0.889920,0.443159,-0.120762,-0.889370,0.440870,-0.524857,-0.811457,0.256935,\n\t\t\t         0.913724,0.406262,-0.005768,0.985687,0.098270,0.136937,0.996490,-0.024140,0.079775,0.966186,0.257576,0.010132,\n\t\t\t         -0.808924,-0.584033,-0.067202,-0.518906,-0.822626,0.232368,-0.524857,-0.811457,0.256935,-0.842860,-0.537858,0.014924,\n\t\t\t         0.985687,0.098270,0.136937,0.904386,-0.282662,0.319559,0.913816,-0.340403,0.221381,0.996490,-0.024140,0.079775,\n\t\t\t         0.311747,0.840815,-0.442518,0.701346,0.681814,-0.207801,0.736473,0.643880,-0.207282,0.404492,0.771874,-0.490463,\n\t\t\t         0.904386,-0.282662,0.319559,0.633839,-0.598132,0.490341,0.713340,-0.573992,0.401990,0.913816,-0.340403,0.221381,\n\t\t\t         0.297067,-0.787439,0.540056,-0.107852,-0.889920,0.443159,-0.100742,-0.890927,0.442793,0.399243,-0.770012,0.497604,\n\t\t\t         0.847102,0.519272,-0.112674,0.981170,0.181158,0.066591,0.978881,0.177618,0.100955,0.873959,0.482955,-0.054079,\n\t\t\t         0.907590,-0.292245,0.301401,0.601459,-0.664357,0.443648,0.617664,-0.635884,0.462691,0.915250,-0.265816,0.302713,\n\t\t\t         -0.531938,0.724387,-0.438490,-0.853145,0.416761,-0.313669,-0.849910,0.372082,-0.373058,-0.546983,0.685385,-0.480636,\n\t\t\t         0.762017,-0.418470,0.494125,0.780206,-0.335276,0.528031,0.942106,0.186987,0.278237,0.962554,0.117618,0.244240,\n\t\t\t         -0.714408,-0.667196,-0.210730,-0.747948,-0.651723,-0.125614,-0.548997,-0.824854,0.134739,-0.533769,-0.844722,0.038636,\n\t\t\t         0.406598,0.875088,-0.262459,0.403088,0.839991,-0.363140,0.690481,0.707572,-0.150090,0.683493,0.728446,-0.046510,\n\t\t\t         -0.136692,-0.881008,0.452834,-0.187078,-0.894009,0.407086,-0.548997,-0.824854,0.134739,-0.549486,-0.813623,0.189795,\n\t\t\t         0.133732,-0.810511,0.570208,0.220069,-0.793023,0.568011,0.488601,-0.638325,0.594775,0.458968,-0.672719,0.580309,\n\t\t\t         0.843471,0.536088,-0.033418,0.838954,0.544023,0.012696,0.690481,0.707572,-0.150090,0.645009,0.727622,-0.233467,\n\t\t\t         0.458968,-0.672719,0.580309,0.488601,-0.638325,0.594775,0.780206,-0.335276,0.528031,0.762017,-0.418470,0.494125,\n\t\t\t         -0.416181,0.566363,-0.711325,-0.424787,0.614765,-0.664541,-0.775384,0.155431,-0.612018,-0.741142,0.112522,-0.661824,\n\t\t\t         0.917753,-0.294870,0.265908,0.987365,0.154607,0.034455,0.997711,0.063845,0.021851,0.923002,-0.314768,0.221259,\n\t\t\t         0.237739,0.877438,-0.416578,0.595935,0.755028,-0.273385,0.627827,0.738090,-0.247017,0.284982,0.856594,-0.430097,\n\t\t\t         0.909513,0.391797,-0.138676,0.750877,0.600208,-0.275460,0.753960,0.589618,-0.289560,0.928709,0.335246,-0.158269,\n\t\t\t         -0.887997,-0.452773,0.080050,-0.564318,-0.769890,0.297891,-0.580218,-0.755821,0.303354,-0.912442,-0.400281,0.084597,\n\t\t\t         -0.533250,-0.799646,0.275979,-0.580218,-0.755821,0.303354,-0.103519,-0.888821,0.446364,-0.073611,-0.888943,0.451979,\n\t\t\t         -0.833399,-0.552568,-0.007935,-0.870205,-0.482986,0.096927,-0.606739,-0.751396,0.259224,-0.604450,-0.764031,0.225471,\n\t\t\t         -0.525315,0.580737,-0.621876,-0.557756,0.637989,-0.530869,-0.895352,0.285318,-0.341868,-0.841456,0.117161,-0.527390,\n\t\t\t         0.878933,0.470595,-0.077181,0.728324,0.647328,-0.224647,0.750877,0.600208,-0.275460,0.909513,0.391797,-0.138676,\n\t\t\t         0.599322,-0.696768,0.394024,0.917753,-0.294870,0.265908,0.923002,-0.314768,0.221259,0.619617,-0.694601,0.365429,\n\t\t\t         0.246315,-0.881619,0.402539,0.599322,-0.696768,0.394024,0.619617,-0.694601,0.365429,0.201483,-0.889401,0.410260,\n\t\t\t         0.488601,-0.638325,0.594775,0.461592,-0.600299,0.653096,0.784631,-0.246681,0.568743,0.780206,-0.335276,0.528031,\n\t\t\t         0.381512,0.818384,-0.429701,0.361095,0.830927,-0.423231,0.753960,0.589618,-0.289560,0.750877,0.600208,-0.275460,\n\t\t\t         -0.557756,0.637989,-0.530869,-0.563280,0.650899,-0.508896,-0.896634,0.285745,-0.338176,-0.895352,0.285318,-0.341868,\n\t\t\t         -0.604450,-0.764031,0.225471,-0.606739,-0.751396,0.259224,-0.190252,-0.908567,0.371838,-0.224616,-0.878903,0.420759,\n\t\t\t         0.292032,-0.828333,0.478042,-0.109378,-0.885952,0.450667,-0.120762,-0.889370,0.440870,0.285318,-0.809473,0.513138,\n\t\t\t         0.220069,-0.793023,0.568011,0.217353,-0.766656,0.604114,0.461592,-0.600299,0.653096,0.488601,-0.638325,0.594775,\n\t\t\t         0.981170,0.181158,0.066591,0.907590,-0.292245,0.301401,0.915250,-0.265816,0.302713,0.978881,0.177618,0.100955,\n\t\t\t         0.923002,-0.314768,0.221259,0.997711,0.063845,0.021851,0.979064,0.132664,0.154210,0.892666,-0.262062,0.366680,\n\t\t\t         -0.527268,0.571337,-0.628895,-0.546983,0.685385,-0.480636,-0.849910,0.372082,-0.373058,-0.798822,0.259316,-0.542772,\n\t\t\t         0.267983,-0.848964,0.455397,0.572344,-0.690786,0.441786,0.599322,-0.696768,0.394024,0.246315,-0.881619,0.402539,\n\t\t\t         0.907254,-0.283517,0.310556,0.969695,0.234230,0.069063,0.987365,0.154607,0.034455,0.917753,-0.294870,0.265908,\n\t\t\t         0.378826,0.824824,-0.419660,0.381512,0.818384,-0.429701,0.750877,0.600208,-0.275460,0.728324,0.647328,-0.224647,\n\t\t\t         -0.880459,-0.473891,-0.013611,-0.912442,-0.400281,0.084597,-0.580218,-0.755821,0.303354,-0.533250,-0.799646,0.275979,\n\t\t\t         -0.564318,-0.769890,0.297891,-0.109378,-0.885952,0.450667,-0.103519,-0.888821,0.446364,-0.580218,-0.755821,0.303354,\n\t\t\t         0.928709,0.335246,-0.158269,0.753960,0.589618,-0.289560,0.708884,0.678671,-0.191961,0.896329,0.443251,-0.010254,\n\t\t\t         -0.606739,-0.751396,0.259224,-0.580584,-0.774773,0.250160,-0.155522,-0.918393,0.363750,-0.190252,-0.908567,0.371838,\n\t\t\t         -0.870205,-0.482986,0.096927,-0.863979,-0.495743,0.087863,-0.580584,-0.774773,0.250160,-0.606739,-0.751396,0.259224,\n\t\t\t         0.572344,-0.690786,0.441786,0.907254,-0.283517,0.310556,0.917753,-0.294870,0.265908,0.599322,-0.696768,0.394024,\n\t\t\t         0.397656,0.880306,-0.258614,0.406598,0.875088,-0.262459,0.683493,0.728446,-0.046510,0.667104,0.743645,-0.044099,\n\t\t\t         -0.747948,-0.651723,-0.125614,-0.770623,-0.632801,-0.075106,-0.549486,-0.813623,0.189795,-0.548997,-0.824854,0.134739,\n\t\t\t         0.780206,-0.335276,0.528031,0.784631,-0.246681,0.568743,0.911649,0.262185,0.316355,0.942106,0.186987,0.278237,\n\t\t\t         -0.439131,0.560076,-0.702445,-0.525315,0.580737,-0.621876,-0.841456,0.117161,-0.527390,-0.738121,0.062807,-0.671712,\n\t\t\t         -0.588733,-0.783013,0.200598,-0.604450,-0.764031,0.225471,-0.224616,-0.878903,0.420759,-0.203528,-0.864834,0.458937,\n\t\t\t         0.838954,0.544023,0.012696,0.822230,0.558061,0.111545,0.683493,0.728446,-0.046510,0.690481,0.707572,-0.150090,\n\t\t\t         -0.203528,-0.864834,0.458937,-0.136692,-0.881008,0.452834,-0.549486,-0.813623,0.189795,-0.588733,-0.783013,0.200598,\n\t\t\t         -0.424787,0.614765,-0.664541,-0.422651,0.583972,-0.693014,-0.746300,0.130009,-0.652760,-0.775384,0.155431,-0.612018,\n\t\t\t         -0.793359,-0.604236,-0.073580,-0.833399,-0.552568,-0.007935,-0.604450,-0.764031,0.225471,-0.588733,-0.783013,0.200598,\n\t\t\t         0.201483,-0.889401,0.410260,0.619617,-0.694601,0.365429,0.561296,-0.650929,0.511063,0.156102,-0.837764,0.523209,\n\t\t\t         0.619617,-0.694601,0.365429,0.923002,-0.314768,0.221259,0.892666,-0.262062,0.366680,0.561296,-0.650929,0.511063,\n\t\t\t         0.361095,0.830927,-0.423231,0.380566,0.842433,-0.381329,0.708884,0.678671,-0.191961,0.753960,0.589618,-0.289560,\n\t\t\t         0.264321,-0.811121,0.521714,0.553575,-0.644093,0.527879,0.565142,-0.670797,0.480209,0.273507,-0.821009,0.501083,\n\t\t\t         0.847194,0.528581,-0.053194,0.650960,0.714499,-0.256294,0.689444,0.690939,-0.217383,0.862117,0.504379,-0.048097,\n\t\t\t         0.886685,-0.235450,0.397870,0.955290,0.263344,0.134342,0.963530,0.253029,0.087008,0.919675,-0.232521,0.316416,\n\t\t\t         0.303568,0.827052,-0.473067,0.374187,0.823908,-0.425581,0.689444,0.690939,-0.217383,0.650960,0.714499,-0.256294,\n\t\t\t         0.553575,-0.644093,0.527879,0.886685,-0.235450,0.397870,0.919675,-0.232521,0.316416,0.565142,-0.670797,0.480209,\n\t\t\t         -0.516861,-0.810450,0.275613,-0.490799,-0.821100,0.291330,-0.055696,-0.886837,0.458632,-0.085818,-0.907620,0.410871,\n\t\t\t         -0.526139,0.651570,-0.546434,-0.498520,0.611469,-0.614429,-0.812860,0.268014,-0.517075,-0.864528,0.278939,-0.418012,\n\t\t\t         -0.847407,-0.528703,0.048494,-0.842616,-0.538469,-0.001740,-0.490799,-0.821100,0.291330,-0.516861,-0.810450,0.275613,\n\t\t\t         -0.490799,-0.821100,0.291330,-0.533250,-0.799646,0.275979,-0.073611,-0.888943,0.451979,-0.055696,-0.886837,0.458632,\n\t\t\t         -0.498520,0.611469,-0.614429,-0.527268,0.571337,-0.628895,-0.798822,0.259316,-0.542772,-0.812860,0.268014,-0.517075,\n\t\t\t         -0.842616,-0.538469,-0.001740,-0.880459,-0.473891,-0.013611,-0.533250,-0.799646,0.275979,-0.490799,-0.821100,0.291330,\n\t\t\t         0.255715,-0.828455,0.498215,0.578906,-0.643788,0.500351,0.553575,-0.644093,0.527879,0.264321,-0.811121,0.521714,\n\t\t\t         0.835505,0.540483,-0.098758,0.601947,0.750969,-0.271401,0.650960,0.714499,-0.256294,0.847194,0.528581,-0.053194,\n\t\t\t         0.896084,-0.241768,0.372234,0.969512,0.210883,0.124516,0.955290,0.263344,0.134342,0.886685,-0.235450,0.397870,\n\t\t\t         0.212104,0.871181,-0.442732,0.303568,0.827052,-0.473067,0.650960,0.714499,-0.256294,0.601947,0.750969,-0.271401,\n\t\t\t         0.578906,-0.643788,0.500351,0.896084,-0.241768,0.372234,0.886685,-0.235450,0.397870,0.553575,-0.644093,0.527879,\n\t\t\t         0.284982,0.856594,-0.430097,0.627827,0.738090,-0.247017,0.701346,0.681814,-0.207801,0.311747,0.840815,-0.442518,\n\t\t\t         -0.306436,0.308359,-0.900540,-0.561968,-0.052950,-0.825434,-0.786401,0.174780,-0.592425,-0.490127,0.546648,-0.678884,\n\t\t\t         -0.445143,-0.879849,0.166326,-0.100742,-0.890927,0.442793,-0.107852,-0.889920,0.443159,-0.518906,-0.822626,0.232368,\n\t\t\t         -0.896634,0.285745,-0.338176,-0.864528,0.278939,-0.418012,-0.968566,-0.142186,-0.203955,-0.982757,-0.159703,-0.092868,\n\t\t\t         -0.746300,0.130009,-0.652760,-0.738121,0.062807,-0.671712,-0.852290,-0.362926,-0.376598,-0.859645,-0.348979,-0.373089,\n\t\t\t         -0.713645,0.051515,-0.698569,-0.741142,0.112522,-0.661824,-0.815302,-0.371746,-0.443922,-0.802484,-0.389264,-0.452132,\n\t\t\t         -0.561968,-0.052950,-0.825434,-0.694693,-0.411389,-0.590014,-0.903348,-0.235755,-0.358287,-0.786401,0.174780,-0.592425,\n\t\t\t         0.542070,-0.592029,-0.596332,0.464278,-0.727622,-0.504929,-0.286294,-0.606250,-0.741935,-0.158177,-0.303873,-0.939451,\n\t\t\t         -0.158177,-0.303873,-0.939451,-0.286294,-0.606250,-0.741935,-0.694693,-0.411389,-0.590014,-0.561968,-0.052950,-0.825434,\n\t\t\t         -0.786401,0.174780,-0.592425,-0.903348,-0.235755,-0.358287,-0.964721,-0.116703,-0.235939,-0.837519,0.320780,-0.442244,\n\t\t\t         -0.741142,0.112522,-0.661824,-0.775384,0.155431,-0.612018,-0.853542,-0.339457,-0.395184,-0.815302,-0.371746,-0.443922,\n\t\t\t         -0.853145,0.416761,-0.313669,-0.992737,-0.020295,-0.118473,-0.989746,-0.008423,-0.142521,-0.849910,0.372082,-0.373058,\n\t\t\t         -0.841456,0.117161,-0.527390,-0.895352,0.285318,-0.341868,-0.981201,-0.176519,-0.077548,-0.917142,-0.308817,-0.251839,\n\t\t\t         -0.798822,0.259316,-0.542772,-0.849910,0.372082,-0.373058,-0.989746,-0.008423,-0.142521,-0.946776,-0.106418,-0.303720,\n\t\t\t         -0.895352,0.285318,-0.341868,-0.896634,0.285745,-0.338176,-0.982757,-0.159703,-0.092868,-0.981201,-0.176519,-0.077548,\n\t\t\t         -0.775384,0.155431,-0.612018,-0.746300,0.130009,-0.652760,-0.859645,-0.348979,-0.373089,-0.853542,-0.339457,-0.395184,\n\t\t\t         -0.738121,0.062807,-0.671712,-0.841456,0.117161,-0.527390,-0.917142,-0.308817,-0.251839,-0.852290,-0.362926,-0.376598,\n\t\t\t         -0.864528,0.278939,-0.418012,-0.812860,0.268014,-0.517075,-0.940672,-0.114536,-0.319346,-0.968566,-0.142186,-0.203955,\n\t\t\t         -0.812860,0.268014,-0.517075,-0.798822,0.259316,-0.542772,-0.946776,-0.106418,-0.303720,-0.940672,-0.114536,-0.319346,\n\t\t\t         -0.004334,0.830287,-0.557268,-0.017304,0.855251,-0.517869,-0.422651,0.583972,-0.693014,-0.424787,0.614765,-0.664541,\n\t\t\t         0.057955,0.647572,-0.759758,-0.022309,0.778405,-0.627308,-0.416181,0.566363,-0.711325,-0.308634,0.459944,-0.832545,\n\t\t\t         -0.022309,0.778405,-0.627308,-0.004334,0.830287,-0.557268,-0.424787,0.614765,-0.664541,-0.416181,0.566363,-0.711325,\n\t\t\t         -0.143437,0.786584,-0.600543,-0.211554,0.838984,-0.501328,-0.546983,0.685385,-0.480636,-0.527268,0.571337,-0.628895,\n\t\t\t         0.462386,0.388653,-0.796930,0.088137,0.005554,-0.996063,-0.306436,0.308359,-0.900540,0.010193,0.629688,-0.776757,\n\t\t\t         -0.020051,0.872036,-0.488998,-0.120579,0.827418,-0.548448,-0.525315,0.580737,-0.621876,-0.439131,0.560076,-0.702445,\n\t\t\t         -0.077486,0.836390,-0.542589,-0.043489,0.820063,-0.570574,-0.498520,0.611469,-0.614429,-0.526139,0.651570,-0.546434,\n\t\t\t         -0.099612,0.780328,-0.617359,-0.490127,0.546648,-0.678884,-0.522019,0.651845,-0.550035,-0.126560,0.826868,-0.547929,\n\t\t\t         -0.123417,0.842494,-0.524369,-0.077486,0.836390,-0.542589,-0.526139,0.651570,-0.546434,-0.563280,0.650899,-0.508896,\n\t\t\t         -0.017304,0.855251,-0.517869,-0.020051,0.872036,-0.488998,-0.439131,0.560076,-0.702445,-0.422651,0.583972,-0.693014,\n\t\t\t         -0.155065,0.824702,-0.543840,-0.123417,0.842494,-0.524369,-0.563280,0.650899,-0.508896,-0.557756,0.637989,-0.530869,\n\t\t\t         0.010193,0.629688,-0.776757,-0.306436,0.308359,-0.900540,-0.490127,0.546648,-0.678884,-0.099612,0.780328,-0.617359,\n\t\t\t         0.889126,-0.095187,-0.447645,0.684500,-0.407300,-0.604572,0.088137,0.005554,-0.996063,0.462386,0.388653,-0.796930,\n\t\t\t         -0.043489,0.820063,-0.570574,-0.143437,0.786584,-0.600543,-0.527268,0.571337,-0.628895,-0.498520,0.611469,-0.614429,\n\t\t\t         -0.161504,0.862758,-0.479080,-0.531938,0.724387,-0.438490,-0.546983,0.685385,-0.480636,-0.211554,0.838984,-0.501328,\n\t\t\t         -0.120579,0.827418,-0.548448,-0.155065,0.824702,-0.543840,-0.557756,0.637989,-0.530869,-0.525315,0.580737,-0.621876,\n\t\t\t         0.853206,-0.520280,-0.036012,0.834620,-0.547655,-0.058351,0.542070,-0.592029,-0.596332,0.684500,-0.407300,-0.604572,\n\t\t\t         0.943205,-0.317545,0.097476,0.867092,-0.469832,-0.165349,0.882931,-0.462142,-0.082369,0.836604,-0.499191,0.225532,\n\t\t\t         0.464278,-0.727622,-0.504929,0.542070,-0.592029,-0.596332,0.834620,-0.547655,-0.058351,0.824244,-0.565935,-0.017304,\n\t\t\t         0.974639,0.086917,0.206122,0.943205,-0.317545,0.097476,0.836604,-0.499191,0.225532,0.881130,-0.291696,0.372143,\n\t\t\t         0.870052,-0.451460,0.197790,0.873684,-0.353404,0.334300,0.673482,-0.655477,0.341655,0.548265,-0.834437,0.055300,\n\t\t\t         0.972167,0.170843,-0.160283,0.967956,0.250526,-0.015503,0.952849,-0.166356,0.253670,0.971435,-0.197485,0.131504,\n\t\t\t         0.889126,-0.095187,-0.447645,0.972167,0.170843,-0.160283,0.971435,-0.197485,0.131504,0.924009,-0.381390,0.026460,\n\t\t\t         0.862178,-0.374004,0.341655,0.673482,-0.655477,0.341655,0.873684,-0.353404,0.334300,0.901425,-0.254524,0.350169,\n\t\t\t         0.835475,-0.546892,0.053194,0.870052,-0.451460,0.197790,0.548265,-0.834437,0.055300,0.458205,-0.848750,-0.263833,\n\t\t\t         0.867092,-0.469832,-0.165349,0.934812,-0.338450,-0.107456,0.957030,-0.271767,0.100925,0.882931,-0.462142,-0.082369,\n\t\t\t         0.924009,-0.381390,0.026460,0.971435,-0.197485,0.131504,0.885861,-0.424055,0.188055,0.850581,-0.524766,-0.032960,\n\t\t\t         0.835475,-0.546892,0.053194,0.850581,-0.524766,-0.032960,0.885861,-0.424055,0.188055,0.870052,-0.451460,0.197790,\n\t\t\t         0.870052,-0.451460,0.197790,0.885861,-0.424055,0.188055,0.875454,-0.324595,0.358043,0.873684,-0.353404,0.334300,\n\t\t\t         0.885861,-0.424055,0.188055,0.971435,-0.197485,0.131504,0.952849,-0.166356,0.253670,0.875454,-0.324595,0.358043,\n\t\t\t         0.859188,-0.267983,0.435835,0.881130,-0.291696,0.372143,0.836604,-0.499191,0.225532,0.882931,-0.462142,-0.082369,\n\t\t\t         0.859188,-0.267983,0.435835,0.901425,-0.254524,0.350169,0.873684,-0.353404,0.334300,0.875454,-0.324595,0.358043,\n\t\t\t         0.835505,0.540483,-0.098758,0.969512,0.210883,0.124516,0.981170,0.181158,0.066591,0.847102,0.519272,-0.112674,\n\t\t\t         0.896084,-0.241768,0.372234,0.578906,-0.643788,0.500351,0.601459,-0.664357,0.443648,0.907590,-0.292245,0.301401,\n\t\t\t         -0.522019,0.651845,-0.550035,-0.837519,0.320780,-0.442244,-0.853145,0.416761,-0.313669,-0.531938,0.724387,-0.438490,\n\t\t\t         0.212104,0.871181,-0.442732,0.601947,0.750969,-0.271401,0.595935,0.755028,-0.273385,0.237739,0.877438,-0.416578,\n\t\t\t         -0.842860,-0.537858,0.014924,-0.524857,-0.811457,0.256935,-0.564318,-0.769890,0.297891,-0.887997,-0.452773,0.080050,\n\t\t\t         0.255715,-0.828455,0.498215,-0.103519,-0.888821,0.446364,-0.109378,-0.885952,0.450667,0.292032,-0.828333,0.478042,\n\t\t\t         0.969512,0.210883,0.124516,0.896084,-0.241768,0.372234,0.907590,-0.292245,0.301401,0.981170,0.181158,0.066591,\n\t\t\t         -0.524857,-0.811457,0.256935,-0.120762,-0.889370,0.440870,-0.109378,-0.885952,0.450667,-0.564318,-0.769890,0.297891,\n\t\t\t         -0.837519,0.320780,-0.442244,-0.964721,-0.116703,-0.235939,-0.992737,-0.020295,-0.118473,-0.853145,0.416761,-0.313669,\n\t\t\t         -0.126560,0.826868,-0.547929,-0.522019,0.651845,-0.550035,-0.531938,0.724387,-0.438490,-0.161504,0.862758,-0.479080,\n\t\t\t         0.499863,-0.835505,0.228156,0.766289,-0.594073,0.244575,0.757805,-0.525376,0.386853,0.483840,-0.799676,0.355510,\n\t\t\t         0.799982,0.562395,-0.208960,0.552751,0.780816,-0.291055,0.516434,0.810297,-0.276894,0.780572,0.613758,-0.118168,\n\t\t\t         0.959136,-0.228248,0.167058,0.971038,0.235511,-0.039796,0.947722,0.296274,0.118442,0.933409,-0.149968,0.325938,\n\t\t\t         0.964110,-0.063967,0.257546,0.930906,0.330363,0.155675,0.905240,0.392743,0.162023,0.945952,-0.003754,0.324259,\n\t\t\t         0.584948,-0.770623,0.252815,0.857936,-0.419416,0.296579,0.865444,-0.348033,0.360302,0.953307,-0.301981,-0.000031,\n\t\t\t         0.761681,0.647664,-0.018769,0.513199,0.825220,-0.235817,0.468459,0.850337,-0.239631,0.751518,0.659597,0.009857,\n\t\t\t         0.422163,-0.831477,0.361095,0.698172,-0.630207,0.339610,0.701315,-0.636586,0.320719,0.420972,-0.831751,0.361797,\n\t\t\t         0.797418,0.603229,-0.014008,0.550035,0.826044,-0.122684,0.540971,0.821802,-0.178716,0.787317,0.610797,-0.083651,\n\t\t\t         0.943907,-0.234321,0.232521,0.957701,0.272866,0.091281,0.957213,0.287179,0.034974,0.953215,-0.225837,0.200873,\n\t\t\t         -0.838496,-0.544847,-0.007080,-0.829127,-0.555223,-0.065279,-0.437147,-0.879971,0.185736,-0.456893,-0.872280,0.174230,\n\t\t\t         0.888546,-0.100162,0.447676,0.933409,-0.149968,0.325938,0.947722,0.296274,0.118442,0.885556,0.381878,0.264412,\n\t\t\t         -0.863002,-0.496811,-0.091342,-0.875240,-0.483444,0.013703,-0.570544,-0.808802,0.142338,-0.533952,-0.839137,0.103427,\n\t\t\t         -0.707633,-0.641987,-0.295053,-0.848140,-0.502243,-0.168340,-0.464064,-0.885769,0.005554,-0.301675,-0.953063,-0.024812,\n\t\t\t         0.123447,0.930021,-0.346049,0.101718,0.907498,-0.407514,0.503250,0.830042,-0.240272,0.467483,0.867275,-0.170995,\n\t\t\t         0.177923,0.946471,-0.269234,0.157414,0.941679,-0.297342,0.540971,0.821802,-0.178716,0.550035,0.826044,-0.122684,\n\t\t\t         0.118992,0.877163,-0.465194,0.006348,0.850093,-0.526536,0.468459,0.850337,-0.239631,0.513199,0.825220,-0.235817,\n\t\t\t         0.144536,0.901028,-0.408918,0.107700,0.905454,-0.410474,0.516434,0.810297,-0.276894,0.552751,0.780816,-0.291055,\n\t\t\t         -0.456893,-0.872280,0.174230,-0.437147,-0.879971,0.185736,0.040468,-0.942656,0.331217,0.050050,-0.960143,0.274972,\n\t\t\t         -0.301675,-0.953063,-0.024812,-0.464064,-0.885769,0.005554,0.133549,-0.977508,0.163152,0.232215,-0.957671,0.169958,\n\t\t\t         0.010498,-0.955870,0.293558,0.133549,-0.977508,0.163152,-0.464064,-0.885769,0.005554,-0.520005,-0.854091,0.008728,\n\t\t\t         0.459975,-0.744682,0.483535,0.483840,-0.799676,0.355510,0.757805,-0.525376,0.386853,0.725974,-0.479476,0.492965,\n\t\t\t         0.727470,0.685385,0.031465,0.780572,0.613758,-0.118168,0.516434,0.810297,-0.276894,0.477798,0.858119,-0.187780,\n\t\t\t         0.854732,0.505142,-0.119236,0.986297,0.162084,-0.030641,0.993927,0.044038,-0.100742,0.891293,0.425764,-0.155828,\n\t\t\t         0.968963,-0.217078,0.118168,0.766656,-0.579089,0.277230,0.769921,-0.621418,0.144932,0.970824,-0.238807,-0.020173,\n\t\t\t         -0.447035,-0.888821,-0.100558,-0.300882,-0.940642,0.156987,-0.375591,-0.905515,0.197272,-0.693167,-0.720725,-0.006226,\n\t\t\t         0.366802,-0.857906,0.359722,-0.011811,-0.947813,0.318583,0.043550,-0.950011,0.309122,0.383831,-0.883328,0.269021,\n\t\t\t         0.986297,0.162084,-0.030641,0.968963,-0.217078,0.118168,0.970824,-0.238807,-0.020173,0.993927,0.044038,-0.100742,\n\t\t\t         0.470717,-0.817530,0.331645,0.058168,-0.928953,0.365520,0.167669,-0.909238,0.380993,0.532395,-0.727287,0.433119,\n\t\t\t         0.465377,-0.877773,0.113498,0.746269,-0.606708,0.273751,0.167669,-0.909238,0.380993,-0.047029,-0.994598,0.092318,\n\t\t\t         0.391369,0.751823,-0.530595,0.784936,0.571215,-0.239875,0.802301,0.576952,-0.153020,0.617664,0.626270,-0.475631,\n\t\t\t         0.291726,-0.941191,-0.170324,0.465377,-0.877773,0.113498,-0.047029,-0.994598,0.092318,-0.109500,-0.971892,-0.208258,\n\t\t\t         0.965606,0.239601,-0.100803,0.997162,-0.026490,-0.070040,0.993561,0.039979,0.105777,0.923460,0.381726,0.038728,\n\t\t\t         0.788446,0.012726,-0.614948,0.637440,-0.451735,-0.624134,0.234169,-0.417096,-0.878170,0.409833,0.113315,-0.905057,\n\t\t\t         0.964721,-0.259133,-0.046052,0.812433,-0.572344,0.110965,0.846553,-0.461501,0.265206,0.973968,-0.187078,0.127903,\n\t\t\t         0.997162,-0.026490,-0.070040,0.964721,-0.259133,-0.046052,0.973968,-0.187078,0.127903,0.993561,0.039979,0.105777,\n\t\t\t         0.993561,0.039979,0.105777,0.973968,-0.187078,0.127903,0.969604,-0.239204,0.051027,0.994690,0.035371,0.096530,\n\t\t\t         0.973968,-0.187078,0.127903,0.846553,-0.461501,0.265206,0.911954,-0.392468,0.119480,0.969604,-0.239204,0.051027,\n\t\t\t         0.766289,-0.594073,0.244575,0.959136,-0.228248,0.167058,0.933409,-0.149968,0.325938,0.757805,-0.525376,0.386853,\n\t\t\t         0.857936,-0.419416,0.296579,0.964110,-0.063967,0.257546,0.945952,-0.003754,0.324259,0.865444,-0.348033,0.360302,\n\t\t\t         0.698172,-0.630207,0.339610,0.943907,-0.234321,0.232521,0.953215,-0.225837,0.200873,0.701315,-0.636586,0.320719,\n\t\t\t         -0.716025,0.562273,-0.413617,-0.703238,0.566240,-0.429884,-0.888150,0.252052,-0.384228,-0.902249,0.258156,-0.345347,\n\t\t\t         0.725974,-0.479476,0.492965,0.757805,-0.525376,0.386853,0.933409,-0.149968,0.325938,0.888546,-0.100162,0.447676,\n\t\t\t         -0.798547,0.380963,-0.465957,-0.780358,0.467025,-0.415815,-0.942076,0.174139,-0.286569,-0.934874,0.108951,-0.337809,\n\t\t\t         -0.784204,0.224372,-0.578478,-0.821375,0.243385,-0.515824,-0.894955,-0.063814,-0.441511,-0.874538,-0.117130,-0.470565,\n\t\t\t         0.409833,0.113315,-0.905057,0.234169,-0.417096,-0.878170,-0.361980,-0.208350,-0.908567,-0.089389,0.345531,-0.934111,\n\t\t\t         0.923460,0.381726,0.038728,0.993561,0.039979,0.105777,0.994690,0.035371,0.096530,0.984832,0.107242,0.136265,\n\t\t\t         -0.109500,-0.971892,-0.208258,-0.047029,-0.994598,0.092318,-0.300882,-0.940642,0.156987,-0.447035,-0.888821,-0.100558,\n\t\t\t         0.617664,0.626270,-0.475631,0.802301,0.576952,-0.153020,0.963286,0.268349,0.001434,0.901914,0.363109,-0.233833,\n\t\t\t         -0.047029,-0.994598,0.092318,0.167669,-0.909238,0.380993,0.058168,-0.928953,0.365520,-0.300882,-0.940642,0.156987,\n\t\t\t         0.532395,-0.727287,0.433119,0.167669,-0.909238,0.380993,0.746269,-0.606708,0.273751,0.800409,-0.546525,0.246132,\n\t\t\t         -0.466842,0.579272,-0.668142,-0.814722,0.089846,-0.572832,-0.921354,0.213385,-0.324809,-0.597980,0.646870,-0.473190,\n\t\t\t         -0.375591,-0.905515,0.197272,0.043550,-0.950011,0.309122,-0.011811,-0.947813,0.318583,-0.387280,-0.897610,0.210364,\n\t\t\t         0.891293,0.425764,-0.155828,0.993927,0.044038,-0.100742,0.997162,-0.026490,-0.070040,0.965606,0.239601,-0.100803,\n\t\t\t         -0.693167,-0.720725,-0.006226,-0.375591,-0.905515,0.197272,-0.387280,-0.897610,0.210364,-0.774407,-0.632130,0.026307,\n\t\t\t         0.993927,0.044038,-0.100742,0.970824,-0.238807,-0.020173,0.964721,-0.259133,-0.046052,0.997162,-0.026490,-0.070040,\n\t\t\t         0.238594,0.837489,-0.491562,0.677725,0.676901,-0.287118,0.784936,0.571215,-0.239875,0.391369,0.751823,-0.530595,\n\t\t\t         0.970824,-0.238807,-0.020173,0.769921,-0.621418,0.144932,0.812433,-0.572344,0.110965,0.964721,-0.259133,-0.046052,\n\t\t\t         0.383831,-0.883328,0.269021,0.043550,-0.950011,0.309122,0.058168,-0.928953,0.365520,0.470717,-0.817530,0.331645,\n\t\t\t         0.848659,0.517106,-0.110996,0.983154,0.182409,-0.010559,0.986297,0.162084,-0.030641,0.854732,0.505142,-0.119236,\n\t\t\t         0.955809,-0.259011,0.138890,0.745384,-0.606128,0.277474,0.766656,-0.579089,0.277230,0.968963,-0.217078,0.118168,\n\t\t\t         -0.664479,0.661580,-0.347484,-0.945128,0.249275,-0.211097,-0.948027,0.297922,-0.111423,-0.695090,0.675527,-0.245857,\n\t\t\t         0.948485,-0.108493,0.297617,0.917508,-0.100406,0.384777,0.897977,0.386914,0.209510,0.938963,0.309122,0.150761,\n\t\t\t         -0.848140,-0.502243,-0.168340,-0.848476,-0.478378,-0.226264,-0.520005,-0.854091,0.008728,-0.464064,-0.885769,0.005554,\n\t\t\t         0.111148,0.920499,-0.374523,0.123447,0.930021,-0.346049,0.467483,0.867275,-0.170995,0.477798,0.858119,-0.187780,\n\t\t\t         -0.023286,-0.936216,0.350627,0.010498,-0.955870,0.293558,-0.520005,-0.854091,0.008728,-0.533952,-0.839137,0.103427,\n\t\t\t         0.552477,-0.777886,0.299387,0.480209,-0.761162,0.435835,0.763512,-0.471175,0.441603,0.812677,-0.468612,0.346294,\n\t\t\t         0.765374,0.641469,-0.051698,0.703879,0.710257,0.006592,0.467483,0.867275,-0.170995,0.503250,0.830042,-0.240272,\n\t\t\t         0.812677,-0.468612,0.346294,0.763512,-0.471175,0.441603,0.917508,-0.100406,0.384777,0.948485,-0.108493,0.297617,\n\t\t\t         -0.821375,0.243385,-0.515824,-0.824946,0.301706,-0.477889,-0.908139,0.026093,-0.417798,-0.894955,-0.063814,-0.441511,\n\t\t\t         0.950774,-0.251747,0.180609,0.950285,0.311258,-0.008057,0.968474,0.243721,-0.051363,0.956114,-0.254524,0.145085,\n\t\t\t         0.209510,0.916135,-0.341716,0.579455,0.783135,-0.225623,0.554491,0.793420,-0.250893,0.177252,0.896207,-0.406598,\n\t\t\t         0.780267,0.611896,-0.129185,0.539720,0.807398,-0.238197,0.568072,0.777215,-0.270516,0.785974,0.589648,-0.185705,\n\t\t\t         -0.805963,-0.581133,0.112461,-0.406568,-0.879330,0.247841,-0.434950,-0.859676,0.267830,-0.817286,-0.546892,0.181341,\n\t\t\t         -0.446699,-0.877865,0.172582,-0.434950,-0.859676,0.267830,0.011353,-0.947508,0.319468,0.021119,-0.954863,0.296213,\n\t\t\t         -0.839778,-0.542894,0.000061,-0.837031,-0.546800,-0.018677,-0.483657,-0.866298,0.124882,-0.530442,-0.837764,0.129368,\n\t\t\t         -0.755028,0.491775,-0.433607,-0.723991,0.525559,-0.446760,-0.907682,0.212592,-0.361736,-0.924772,0.195105,-0.326640,\n\t\t\t         0.787317,0.610797,-0.083651,0.540971,0.821802,-0.178716,0.539720,0.807398,-0.238197,0.780267,0.611896,-0.129185,\n\t\t\t         0.702689,-0.649403,0.290658,0.950774,-0.251747,0.180609,0.956114,-0.254524,0.145085,0.730186,-0.638905,0.242042,\n\t\t\t         0.436811,-0.845729,0.306406,0.702689,-0.649403,0.290658,0.730186,-0.638905,0.242042,0.469680,-0.849696,0.239570,\n\t\t\t         0.763512,-0.471175,0.441603,0.725974,-0.479476,0.492965,0.888546,-0.100162,0.447676,0.917508,-0.100406,0.384777,\n\t\t\t         0.127110,0.921903,-0.365886,0.146916,0.901120,-0.407819,0.568072,0.777215,-0.270516,0.539720,0.807398,-0.238197,\n\t\t\t         -0.723991,0.525559,-0.446760,-0.716025,0.562273,-0.413617,-0.902249,0.258156,-0.345347,-0.907682,0.212592,-0.361736,\n\t\t\t         -0.530442,-0.837764,0.129368,-0.483657,-0.866298,0.124882,0.021546,-0.978729,0.203986,-0.007202,-0.979430,0.201544,\n\t\t\t         0.407910,-0.841914,0.353160,-0.003021,-0.946348,0.323038,-0.011811,-0.947813,0.318583,0.366802,-0.857906,0.359722,\n\t\t\t         0.480209,-0.761162,0.435835,0.459975,-0.744682,0.483535,0.725974,-0.479476,0.492965,0.763512,-0.471175,0.441603,\n\t\t\t         0.983154,0.182409,-0.010559,0.955809,-0.259011,0.138890,0.968963,-0.217078,0.118168,0.986297,0.162084,-0.030641,\n\t\t\t         0.956114,-0.254524,0.145085,0.968474,0.243721,-0.051363,0.971038,0.235511,-0.039796,0.959136,-0.228248,0.167058,\n\t\t\t         -0.712272,0.644581,-0.277779,-0.695090,0.675527,-0.245857,-0.948027,0.297922,-0.111423,-0.938994,0.303507,-0.161748,\n\t\t\t         0.420972,-0.831751,0.361797,0.701315,-0.636586,0.320719,0.702689,-0.649403,0.290658,0.436811,-0.845729,0.306406,\n\t\t\t         0.953215,-0.225837,0.200873,0.957213,0.287179,0.034974,0.950285,0.311258,-0.008057,0.950774,-0.251747,0.180609,\n\t\t\t         0.157414,0.941679,-0.297342,0.127110,0.921903,-0.365886,0.539720,0.807398,-0.238197,0.540971,0.821802,-0.178716,\n\t\t\t         -0.854366,-0.517441,0.048006,-0.817286,-0.546892,0.181341,-0.434950,-0.859676,0.267830,-0.446699,-0.877865,0.172582,\n\t\t\t         -0.406568,-0.879330,0.247841,-0.003021,-0.946348,0.323038,0.011353,-0.947508,0.319468,-0.434950,-0.859676,0.267830,\n\t\t\t         0.785974,0.589648,-0.185705,0.568072,0.777215,-0.270516,0.552751,0.780816,-0.291055,0.799982,0.562395,-0.208960,\n\t\t\t         -0.483657,-0.866298,0.124882,-0.456893,-0.872280,0.174230,0.050050,-0.960143,0.274972,0.021546,-0.978729,0.203986,\n\t\t\t         -0.837031,-0.546800,-0.018677,-0.838496,-0.544847,-0.007080,-0.456893,-0.872280,0.174230,-0.483657,-0.866298,0.124882,\n\t\t\t         0.701315,-0.636586,0.320719,0.953215,-0.225837,0.200873,0.950774,-0.251747,0.180609,0.702689,-0.649403,0.290658,\n\t\t\t         0.107700,0.905454,-0.410474,0.111148,0.920499,-0.374523,0.477798,0.858119,-0.187780,0.516434,0.810297,-0.276894,\n\t\t\t         -0.848476,-0.478378,-0.226264,-0.863002,-0.496811,-0.091342,-0.533952,-0.839137,0.103427,-0.520005,-0.854091,0.008728,\n\t\t\t         0.917508,-0.100406,0.384777,0.888546,-0.100162,0.447676,0.885556,0.381878,0.264412,0.897977,0.386914,0.209510,\n\t\t\t         -0.780358,0.467025,-0.415815,-0.755028,0.491775,-0.433607,-0.924772,0.195105,-0.326640,-0.942076,0.174139,-0.286569,\n\t\t\t         -0.570544,-0.808802,0.142338,-0.530442,-0.837764,0.129368,-0.007202,-0.979430,0.201544,-0.032197,-0.966216,0.255684,\n\t\t\t         0.703879,0.710257,0.006592,0.727470,0.685385,0.031465,0.477798,0.858119,-0.187780,0.467483,0.867275,-0.170995,\n\t\t\t         -0.032197,-0.966216,0.255684,-0.023286,-0.936216,0.350627,-0.533952,-0.839137,0.103427,-0.570544,-0.808802,0.142338,\n\t\t\t         -0.824946,0.301706,-0.477889,-0.798547,0.380963,-0.465957,-0.934874,0.108951,-0.337809,-0.908139,0.026093,-0.417798,\n\t\t\t         -0.875240,-0.483444,0.013703,-0.839778,-0.542894,0.000061,-0.530442,-0.837764,0.129368,-0.570544,-0.808802,0.142338,\n\t\t\t         0.469680,-0.849696,0.239570,0.730186,-0.638905,0.242042,0.766289,-0.594073,0.244575,0.499863,-0.835505,0.228156,\n\t\t\t         0.730186,-0.638905,0.242042,0.956114,-0.254524,0.145085,0.959136,-0.228248,0.167058,0.766289,-0.594073,0.244575,\n\t\t\t         0.146916,0.901120,-0.407819,0.144536,0.901028,-0.408918,0.552751,0.780816,-0.291055,0.568072,0.777215,-0.270516,\n\t\t\t         0.413007,-0.832636,0.368938,0.710501,-0.602466,0.363567,0.698172,-0.630207,0.339610,0.422163,-0.831477,0.361095,\n\t\t\t         0.799493,0.600604,-0.004700,0.552995,0.821711,-0.137516,0.550035,0.826044,-0.122684,0.797418,0.603229,-0.014008,\n\t\t\t         0.932096,-0.226386,0.282693,0.955565,0.259774,0.139073,0.957701,0.272866,0.091281,0.943907,-0.234321,0.232521,\n\t\t\t         0.161473,0.946593,-0.279000,0.177923,0.946471,-0.269234,0.550035,0.826044,-0.122684,0.552995,0.821711,-0.137516,\n\t\t\t         0.710501,-0.602466,0.363567,0.932096,-0.226386,0.282693,0.943907,-0.234321,0.232521,0.698172,-0.630207,0.339610,\n\t\t\t         -0.437147,-0.879971,0.185736,-0.450087,-0.885403,0.115787,0.044069,-0.955657,0.291147,0.040468,-0.942656,0.331217,\n\t\t\t         -0.703238,0.566240,-0.429884,-0.723289,0.563311,-0.399365,-0.910886,0.244758,-0.332163,-0.888150,0.252052,-0.384228,\n\t\t\t         -0.829127,-0.555223,-0.065279,-0.827693,-0.552202,-0.099673,-0.450087,-0.885403,0.115787,-0.437147,-0.879971,0.185736,\n\t\t\t         -0.450087,-0.885403,0.115787,-0.446699,-0.877865,0.172582,0.021119,-0.954863,0.296213,0.044069,-0.955657,0.291147,\n\t\t\t         -0.723289,0.563311,-0.399365,-0.712272,0.644581,-0.277779,-0.938994,0.303507,-0.161748,-0.910886,0.244758,-0.332163,\n\t\t\t         -0.827693,-0.552202,-0.099673,-0.854366,-0.517441,0.048006,-0.446699,-0.877865,0.172582,-0.450087,-0.885403,0.115787,\n\t\t\t         0.400067,-0.844508,0.355937,0.720573,-0.610401,0.328806,0.710501,-0.602466,0.363567,0.413007,-0.832636,0.368938,\n\t\t\t         0.836390,0.544694,-0.060854,0.575182,0.795862,-0.188910,0.552995,0.821711,-0.137516,0.799493,0.600604,-0.004700,\n\t\t\t         0.943175,-0.245186,0.224219,0.973113,0.219977,0.067873,0.955565,0.259774,0.139073,0.932096,-0.226386,0.282693,\n\t\t\t         0.176305,0.938231,-0.297647,0.161473,0.946593,-0.279000,0.552995,0.821711,-0.137516,0.575182,0.795862,-0.188910,\n\t\t\t         0.720573,-0.610401,0.328806,0.943175,-0.245186,0.224219,0.932096,-0.226386,0.282693,0.710501,-0.602466,0.363567,\n\t\t\t         0.177252,0.896207,-0.406598,0.554491,0.793420,-0.250893,0.677725,0.676901,-0.287118,0.238594,0.837489,-0.491562,\n\t\t\t         -0.089389,0.345531,-0.934111,-0.361980,-0.208350,-0.908567,-0.814722,0.089846,-0.572832,-0.466842,0.579272,-0.668142,\n\t\t\t         -0.300882,-0.940642,0.156987,0.058168,-0.928953,0.365520,0.043550,-0.950011,0.309122,-0.375591,-0.905515,0.197272,\n\t\t\t         -0.902249,0.258156,-0.345347,-0.888150,0.252052,-0.384228,-0.955077,-0.123478,-0.269326,-0.972076,-0.092410,-0.215552,\n\t\t\t         -0.934874,0.108951,-0.337809,-0.942076,0.174139,-0.286569,-0.980804,-0.131138,-0.144292,-0.959838,-0.179754,-0.215308,\n\t\t\t         -0.874538,-0.117130,-0.470565,-0.894955,-0.063814,-0.441511,-0.914609,-0.241646,-0.324137,-0.848903,-0.364544,-0.382641,\n\t\t\t         -0.361980,-0.208350,-0.908567,-0.509445,-0.664357,-0.546831,-0.876553,-0.373028,-0.304117,-0.814722,0.089846,-0.572832,\n\t\t\t         0.637440,-0.451735,-0.624134,0.439619,-0.800501,-0.407300,0.022675,-0.801508,-0.597491,0.234169,-0.417096,-0.878170,\n\t\t\t         0.234169,-0.417096,-0.878170,0.022675,-0.801508,-0.597491,-0.509445,-0.664357,-0.546831,-0.361980,-0.208350,-0.908567,\n\t\t\t         -0.814722,0.089846,-0.572832,-0.876553,-0.373028,-0.304117,-0.961486,-0.227302,-0.154424,-0.921354,0.213385,-0.324809,\n\t\t\t         -0.894955,-0.063814,-0.441511,-0.908139,0.026093,-0.417798,-0.921476,-0.204718,-0.330058,-0.914609,-0.241646,-0.324137,\n\t\t\t         -0.945128,0.249275,-0.211097,-0.984191,-0.170324,-0.048128,-0.991394,-0.125065,0.038148,-0.948027,0.297922,-0.111423,\n\t\t\t         -0.924772,0.195105,-0.326640,-0.907682,0.212592,-0.361736,-0.966216,-0.144841,-0.213111,-0.970855,-0.159703,-0.178625,\n\t\t\t         -0.938994,0.303507,-0.161748,-0.948027,0.297922,-0.111423,-0.991394,-0.125065,0.038148,-0.993439,-0.101108,-0.052980,\n\t\t\t         -0.907682,0.212592,-0.361736,-0.902249,0.258156,-0.345347,-0.972076,-0.092410,-0.215552,-0.966216,-0.144841,-0.213111,\n\t\t\t         -0.908139,0.026093,-0.417798,-0.934874,0.108951,-0.337809,-0.959838,-0.179754,-0.215308,-0.921476,-0.204718,-0.330058,\n\t\t\t         -0.942076,0.174139,-0.286569,-0.924772,0.195105,-0.326640,-0.970855,-0.159703,-0.178625,-0.980804,-0.131138,-0.144292,\n\t\t\t         -0.888150,0.252052,-0.384228,-0.910886,0.244758,-0.332163,-0.961577,-0.122044,-0.245766,-0.955077,-0.123478,-0.269326,\n\t\t\t         -0.910886,0.244758,-0.332163,-0.938994,0.303507,-0.161748,-0.993439,-0.101108,-0.052980,-0.961577,-0.122044,-0.245766,\n\t\t\t         -0.490646,0.706442,-0.510025,-0.425092,0.749992,-0.506729,-0.798547,0.380963,-0.465957,-0.824946,0.301706,-0.477889,\n\t\t\t         -0.423963,0.660237,-0.619922,-0.470290,0.713675,-0.519089,-0.821375,0.243385,-0.515824,-0.784204,0.224372,-0.578478,\n\t\t\t         -0.470290,0.713675,-0.519089,-0.490646,0.706442,-0.510025,-0.824946,0.301706,-0.477889,-0.821375,0.243385,-0.515824,\n\t\t\t         -0.316568,0.884823,-0.341807,-0.271706,0.905545,-0.325724,-0.695090,0.675527,-0.245857,-0.712272,0.644581,-0.277779,\n\t\t\t         0.508774,0.511734,-0.692251,0.409833,0.113315,-0.905057,-0.089389,0.345531,-0.934111,0.176824,0.704794,-0.687002,\n\t\t\t         -0.428663,0.764244,-0.481826,-0.387341,0.783441,-0.485946,-0.755028,0.491775,-0.433607,-0.780358,0.467025,-0.415815,\n\t\t\t         -0.333842,0.849849,-0.407758,-0.328837,0.857204,-0.396283,-0.723289,0.563311,-0.399365,-0.703238,0.566240,-0.429884,\n\t\t\t         -0.100223,0.807062,-0.581835,-0.466842,0.579272,-0.668142,-0.597980,0.646870,-0.473190,-0.173620,0.854060,-0.490280,\n\t\t\t         -0.353771,0.831935,-0.427412,-0.333842,0.849849,-0.407758,-0.703238,0.566240,-0.429884,-0.716025,0.562273,-0.413617,\n\t\t\t         -0.425092,0.749992,-0.506729,-0.428663,0.764244,-0.481826,-0.780358,0.467025,-0.415815,-0.798547,0.380963,-0.465957,\n\t\t\t         -0.363720,0.800317,-0.476577,-0.353771,0.831935,-0.427412,-0.716025,0.562273,-0.413617,-0.723991,0.525559,-0.446760,\n\t\t\t         0.176824,0.704794,-0.687002,-0.089389,0.345531,-0.934111,-0.466842,0.579272,-0.668142,-0.100223,0.807062,-0.581835,\n\t\t\t         0.840297,0.319498,-0.437941,0.788446,0.012726,-0.614948,0.409833,0.113315,-0.905057,0.508774,0.511734,-0.692251,\n\t\t\t         -0.328837,0.857204,-0.396283,-0.316568,0.884823,-0.341807,-0.712272,0.644581,-0.277779,-0.723289,0.563311,-0.399365,\n\t\t\t         -0.208930,0.895779,-0.392254,-0.664479,0.661580,-0.347484,-0.695090,0.675527,-0.245857,-0.271706,0.905545,-0.325724,\n\t\t\t         -0.387341,0.783441,-0.485946,-0.363720,0.800317,-0.476577,-0.723991,0.525559,-0.446760,-0.755028,0.491775,-0.433607,\n\t\t\t         0.987213,-0.084872,-0.134831,0.920530,-0.376293,-0.104801,0.637440,-0.451735,-0.624134,0.788446,0.012726,-0.614948,\n\t\t\t         0.994690,0.035371,0.096530,0.969604,-0.239204,0.051027,0.959532,-0.281472,-0.003265,0.956603,-0.279214,0.083224,\n\t\t\t         0.439619,-0.800501,-0.407300,0.637440,-0.451735,-0.624134,0.920530,-0.376293,-0.104801,0.784143,-0.620197,-0.020936,\n\t\t\t         0.984832,0.107242,0.136265,0.994690,0.035371,0.096530,0.956603,-0.279214,0.083224,0.957060,-0.222480,0.185675,\n\t\t\t         0.807642,-0.548967,0.215155,0.930967,-0.286508,0.226203,0.746269,-0.606708,0.273751,0.465377,-0.877773,0.113498,\n\t\t\t         0.901914,0.363109,-0.233833,0.963286,0.268349,0.001434,0.977599,-0.123295,0.170446,0.992431,-0.017060,0.121555,\n\t\t\t         0.840297,0.319498,-0.437941,0.901914,0.363109,-0.233833,0.992431,-0.017060,0.121555,0.997253,0.069887,0.023255,\n\t\t\t         0.800409,-0.546525,0.246132,0.746269,-0.606708,0.273751,0.930967,-0.286508,0.226203,0.971862,-0.221625,0.079470,\n\t\t\t         0.764031,-0.632801,0.125645,0.807642,-0.548967,0.215155,0.465377,-0.877773,0.113498,0.291726,-0.941191,-0.170324,\n\t\t\t         0.969604,-0.239204,0.051027,0.911954,-0.392468,0.119480,0.937956,-0.343577,-0.046236,0.959532,-0.281472,-0.003265,\n\t\t\t         0.997253,0.069887,0.023255,0.992431,-0.017060,0.121555,0.937834,-0.208441,0.277444,0.944334,-0.193243,0.266213,\n\t\t\t         0.764031,-0.632801,0.125645,0.944334,-0.193243,0.266213,0.937834,-0.208441,0.277444,0.807642,-0.548967,0.215155,\n\t\t\t         0.807642,-0.548967,0.215155,0.937834,-0.208441,0.277444,0.934904,-0.223975,0.275216,0.930967,-0.286508,0.226203,\n\t\t\t         0.937834,-0.208441,0.277444,0.992431,-0.017060,0.121555,0.977599,-0.123295,0.170446,0.934904,-0.223975,0.275216,\n\t\t\t         0.948790,-0.245766,0.198401,0.957060,-0.222480,0.185675,0.956603,-0.279214,0.083224,0.959532,-0.281472,-0.003265,\n\t\t\t         0.948790,-0.245766,0.198401,0.971862,-0.221625,0.079470,0.930967,-0.286508,0.226203,0.934904,-0.223975,0.275216,\n\t\t\t         0.836390,0.544694,-0.060854,0.973113,0.219977,0.067873,0.983154,0.182409,-0.010559,0.848659,0.517106,-0.110996,\n\t\t\t         0.943175,-0.245186,0.224219,0.720573,-0.610401,0.328806,0.745384,-0.606128,0.277474,0.955809,-0.259011,0.138890,\n\t\t\t         -0.597980,0.646870,-0.473190,-0.921354,0.213385,-0.324809,-0.945128,0.249275,-0.211097,-0.664479,0.661580,-0.347484,\n\t\t\t         0.176305,0.938231,-0.297647,0.575182,0.795862,-0.188910,0.579455,0.783135,-0.225623,0.209510,0.916135,-0.341716,\n\t\t\t         -0.774407,-0.632130,0.026307,-0.387280,-0.897610,0.210364,-0.406568,-0.879330,0.247841,-0.805963,-0.581133,0.112461,\n\t\t\t         0.400067,-0.844508,0.355937,0.011353,-0.947508,0.319468,-0.003021,-0.946348,0.323038,0.407910,-0.841914,0.353160,\n\t\t\t         0.973113,0.219977,0.067873,0.943175,-0.245186,0.224219,0.955809,-0.259011,0.138890,0.983154,0.182409,-0.010559,\n\t\t\t         -0.387280,-0.897610,0.210364,-0.011811,-0.947813,0.318583,-0.003021,-0.946348,0.323038,-0.406568,-0.879330,0.247841,\n\t\t\t         -0.921354,0.213385,-0.324809,-0.961486,-0.227302,-0.154424,-0.984191,-0.170324,-0.048128,-0.945128,0.249275,-0.211097,\n\t\t\t         -0.173620,0.854060,-0.490280,-0.597980,0.646870,-0.473190,-0.664479,0.661580,-0.347484,-0.208930,0.895779,-0.392254,\n\t\t\t         -0.971587,0.190405,0.140355,-0.833003,-0.219489,0.507828,-0.811182,-0.140690,0.567583,-0.965850,0.213202,0.147191,\n\t\t\t         0.352855,-0.678823,0.643910,0.809259,-0.510483,0.290689,0.824519,-0.529862,0.198492,0.346324,-0.652089,0.674398,\n\t\t\t         -0.232856,-0.612903,0.755028,0.352855,-0.678823,0.643910,0.346324,-0.652089,0.674398,-0.233741,-0.519883,0.821619,\n\t\t\t         -0.382092,0.592456,-0.709189,-0.346507,0.686300,-0.639424,-0.827204,0.503952,-0.248482,-0.836329,0.474624,-0.274270,\n\t\t\t         0.949736,-0.090487,-0.299631,0.918119,-0.110050,-0.380657,0.824519,-0.529862,0.198492,0.809259,-0.510483,0.290689,\n\t\t\t         -0.836329,0.474624,-0.274270,-0.827204,0.503952,-0.248482,-0.965850,0.213202,0.147191,-0.960295,0.225532,0.164129,\n\t\t\t         0.727866,-0.553331,0.404981,0.164739,-0.663167,0.730094,0.113437,-0.572771,0.811792,0.687124,-0.555071,0.468734,\n\t\t\t         -0.348186,-0.681051,0.644093,-0.748894,-0.391156,0.534867,-0.717826,-0.361309,0.595080,-0.367199,-0.592608,0.716880,\n\t\t\t         -0.289743,0.114048,-0.950255,-0.901517,0.259835,-0.345988,-0.808313,0.439192,-0.392041,-0.202033,0.328257,-0.922697,\n\t\t\t         -0.748894,-0.391156,0.534867,-0.960326,0.116703,0.253212,-0.941740,0.089145,0.324259,-0.717826,-0.361309,0.595080,\n\t\t\t         0.164739,-0.663167,0.730094,-0.348186,-0.681051,0.644093,-0.367199,-0.592608,0.716880,0.113437,-0.572771,0.811792,\n\t\t\t         -0.687094,-0.344127,0.639882,-0.923826,-0.011078,0.382580,-0.909177,-0.023927,0.415662,-0.655995,-0.380261,0.651906,\n\t\t\t         -0.919126,-0.362163,0.154942,-0.762505,-0.220038,0.608356,-0.909177,-0.023927,0.415662,-0.956877,0.043184,-0.287210,\n\t\t\t         0.818812,-0.546770,-0.174780,0.602069,-0.596789,0.530381,0.516465,-0.621387,0.589129,0.719779,-0.692709,-0.045106,\n\t\t\t         -0.681204,-0.672750,-0.288614,-0.919126,-0.362163,0.154942,-0.956877,0.043184,-0.287210,-0.441115,-0.225074,-0.868740,\n\t\t\t         0.602069,-0.596789,0.530381,0.064180,-0.516800,0.853664,-0.044832,-0.494766,0.867855,0.516465,-0.621387,0.589129,\n\t\t\t         0.196844,-0.958190,-0.207617,-0.209052,-0.894650,-0.394787,0.143498,-0.449843,-0.881497,0.568224,-0.570666,-0.592792,\n\t\t\t         -0.398846,-0.513840,0.759514,-0.687094,-0.344127,0.639882,-0.655995,-0.380261,0.651906,-0.433027,-0.498123,0.751213,\n\t\t\t         0.064180,-0.516800,0.853664,-0.398846,-0.513840,0.759514,-0.433027,-0.498123,0.751213,-0.044832,-0.494766,0.867855,\n\t\t\t         -0.044832,-0.494766,0.867855,-0.433027,-0.498123,0.751213,-0.527146,-0.662709,0.531846,-0.396374,-0.609210,0.686789,\n\t\t\t         -0.433027,-0.498123,0.751213,-0.655995,-0.380261,0.651906,-0.634449,-0.490036,0.597736,-0.527146,-0.662709,0.531846,\n\t\t\t         -0.833003,-0.219489,0.507828,-0.232856,-0.612903,0.755028,-0.233741,-0.519883,0.821619,-0.811182,-0.140690,0.567583,\n\t\t\t         0.662069,0.118229,-0.740043,0.755577,0.160619,-0.634999,0.330149,0.508591,-0.795190,0.224647,0.412214,-0.882931,\n\t\t\t         0.568224,-0.570666,-0.592792,0.143498,-0.449843,-0.881497,0.300394,-0.140110,-0.943449,0.667562,-0.335704,-0.664541,\n\t\t\t         0.516465,-0.621387,0.589129,-0.044832,-0.494766,0.867855,-0.396374,-0.609210,0.686789,-0.005860,-0.688040,0.725639,\n\t\t\t         -0.441115,-0.225074,-0.868740,-0.956877,0.043184,-0.287210,-0.901517,0.259835,-0.345988,-0.289743,0.114048,-0.950255,\n\t\t\t         0.719779,-0.692709,-0.045106,0.516465,-0.621387,0.589129,-0.005860,-0.688040,0.725639,0.302042,-0.909268,0.286294,\n\t\t\t         -0.956877,0.043184,-0.287210,-0.909177,-0.023927,0.415662,-0.923826,-0.011078,0.382580,-0.901517,0.259835,-0.345988,\n\t\t\t         -0.655995,-0.380261,0.651906,-0.909177,-0.023927,0.415662,-0.762505,-0.220038,0.608356,-0.634449,-0.490036,0.597736,\n\t\t\t         0.696493,-0.151128,-0.701437,0.372692,0.076174,-0.924802,0.395917,0.208075,-0.894375,0.699240,-0.022645,-0.714499,\n\t\t\t         -0.808313,0.439192,-0.392041,-0.941740,0.089145,0.324259,-0.960326,0.116703,0.253212,-0.786004,0.506912,-0.353832,\n\t\t\t         0.687124,-0.555071,0.468734,0.113437,-0.572771,0.811792,0.064180,-0.516800,0.853664,0.602069,-0.596789,0.530381,\n\t\t\t         -0.202033,0.328257,-0.922697,-0.808313,0.439192,-0.392041,-0.786004,0.506912,-0.353832,-0.193793,0.478469,-0.856441,\n\t\t\t         0.113437,-0.572771,0.811792,-0.367199,-0.592608,0.716880,-0.398846,-0.513840,0.759514,0.064180,-0.516800,0.853664,\n\t\t\t         0.878933,-0.401105,-0.258003,0.687124,-0.555071,0.468734,0.602069,-0.596789,0.530381,0.818812,-0.546770,-0.174780,\n\t\t\t         -0.367199,-0.592608,0.716880,-0.717826,-0.361309,0.595080,-0.687094,-0.344127,0.639882,-0.398846,-0.513840,0.759514,\n\t\t\t         -0.717826,-0.361309,0.595080,-0.941740,0.089145,0.324259,-0.923826,-0.011078,0.382580,-0.687094,-0.344127,0.639882,\n\t\t\t         0.750542,-0.558763,0.352702,0.232734,-0.679128,0.696097,0.164739,-0.663167,0.730094,0.727866,-0.553331,0.404981,\n\t\t\t         -0.306803,-0.665792,0.680105,-0.771996,-0.348735,0.531388,-0.748894,-0.391156,0.534867,-0.348186,-0.681051,0.644093,\n\t\t\t         0.699728,0.043062,-0.713065,0.383770,0.280618,-0.879727,0.392132,0.341472,-0.854152,0.722770,0.121189,-0.680349,\n\t\t\t         0.911466,-0.242439,-0.332286,0.750542,-0.558763,0.352702,0.727866,-0.553331,0.404981,0.900754,-0.293588,-0.320017,\n\t\t\t         -0.223853,0.527329,-0.819605,-0.803461,0.498703,-0.325114,-0.825190,0.487533,-0.285134,-0.263619,0.569018,-0.778893,\n\t\t\t         -0.823542,0.504410,-0.259377,-0.825190,0.487533,-0.285134,-0.975036,0.132786,0.177831,-0.984130,0.109714,0.139286,\n\t\t\t         0.346324,-0.652089,0.674398,0.824519,-0.529862,0.198492,0.834712,-0.501511,0.227393,0.357646,-0.623218,0.695425,\n\t\t\t         -0.771996,-0.348735,0.531388,-0.966063,0.124088,0.226539,-0.960326,0.116703,0.253212,-0.748894,-0.391156,0.534867,\n\t\t\t         0.232734,-0.679128,0.696097,-0.306803,-0.665792,0.680105,-0.348186,-0.681051,0.644093,0.164739,-0.663167,0.730094,\n\t\t\t         0.753319,0.196814,-0.627461,0.722770,0.121189,-0.680349,0.392132,0.341472,-0.854152,0.374248,0.448286,-0.811762,\n\t\t\t         -0.965850,0.213202,0.147191,-0.811182,-0.140690,0.567583,-0.792047,-0.086154,0.604327,-0.960295,0.225532,0.164129,\n\t\t\t         -0.233741,-0.519883,0.821619,0.346324,-0.652089,0.674398,0.357646,-0.623218,0.695425,-0.209723,-0.480392,0.851588,\n\t\t\t         0.918119,-0.110050,-0.380657,0.903806,-0.153630,-0.399365,0.834712,-0.501511,0.227393,0.824519,-0.529862,0.198492,\n\t\t\t         -0.270638,0.634358,-0.724082,-0.263619,0.569018,-0.778893,-0.825190,0.487533,-0.285134,-0.823542,0.504410,-0.259377,\n\t\t\t         -0.803461,0.498703,-0.325114,-0.966063,0.124088,0.226539,-0.975036,0.132786,0.177831,-0.825190,0.487533,-0.285134,\n\t\t\t         -0.811182,-0.140690,0.567583,-0.233741,-0.519883,0.821619,-0.209723,-0.480392,0.851588,-0.792047,-0.086154,0.604327,\n\t\t\t         -0.984130,0.109714,0.139286,-0.842799,-0.354747,0.404736,-0.833003,-0.219489,0.507828,-0.971587,0.190405,0.140355,\n\t\t\t         0.333689,-0.689413,0.642872,0.817682,-0.466506,0.337260,0.809259,-0.510483,0.290689,0.352855,-0.678823,0.643910,\n\t\t\t         -0.275369,-0.727287,0.628620,0.333689,-0.689413,0.642872,0.352855,-0.678823,0.643910,-0.232856,-0.612903,0.755028,\n\t\t\t         0.964385,-0.098392,-0.245460,0.949736,-0.090487,-0.299631,0.809259,-0.510483,0.290689,0.817682,-0.466506,0.337260,\n\t\t\t         -0.842799,-0.354747,0.404736,-0.275369,-0.727287,0.628620,-0.232856,-0.612903,0.755028,-0.833003,-0.219489,0.507828,\n\t\t\t         -0.827204,0.503952,-0.248482,-0.818903,0.520096,-0.242561,-0.971587,0.190405,0.140355,-0.965850,0.213202,0.147191,\n\t\t\t         0.755577,0.160619,-0.634999,0.753288,0.255257,-0.606067,0.372997,0.549516,-0.747551,0.330149,0.508591,-0.795190,\n\t\t\t         -0.346507,0.686300,-0.639424,-0.266121,0.710715,-0.651143,-0.818903,0.520096,-0.242561,-0.827204,0.503952,-0.248482,\n\t\t\t         -0.818903,0.520096,-0.242561,-0.823542,0.504410,-0.259377,-0.984130,0.109714,0.139286,-0.971587,0.190405,0.140355,\n\t\t\t         0.753288,0.255257,-0.606067,0.753319,0.196814,-0.627461,0.374248,0.448286,-0.811762,0.372997,0.549516,-0.747551,\n\t\t\t         -0.266121,0.710715,-0.651143,-0.270638,0.634358,-0.724082,-0.823542,0.504410,-0.259377,-0.818903,0.520096,-0.242561,\n\t\t\t         -0.975036,0.132786,0.177831,-0.812281,-0.381054,0.441542,-0.842799,-0.354747,0.404736,-0.984130,0.109714,0.139286,\n\t\t\t         0.293435,-0.682333,0.669546,0.775933,-0.524583,0.350261,0.817682,-0.466506,0.337260,0.333689,-0.689413,0.642872,\n\t\t\t         -0.274056,-0.730155,0.625904,0.293435,-0.682333,0.669546,0.333689,-0.689413,0.642872,-0.275369,-0.727287,0.628620,\n\t\t\t         0.936094,-0.174718,-0.305185,0.964385,-0.098392,-0.245460,0.817682,-0.466506,0.337260,0.775933,-0.524583,0.350261,\n\t\t\t         -0.812281,-0.381054,0.441542,-0.274056,-0.730155,0.625904,-0.275369,-0.727287,0.628620,-0.842799,-0.354747,0.404736,\n\t\t\t         0.900754,-0.293588,-0.320017,0.727866,-0.553331,0.404981,0.687124,-0.555071,0.468734,0.878933,-0.401105,-0.258003,\n\t\t\t         0.667562,-0.335704,-0.664541,0.300394,-0.140110,-0.943449,0.372692,0.076174,-0.924802,0.696493,-0.151128,-0.701437,\n\t\t\t         -0.901517,0.259835,-0.345988,-0.923826,-0.011078,0.382580,-0.941740,0.089145,0.324259,-0.808313,0.439192,-0.392041,\n\t\t\t         0.224647,0.412214,-0.882931,0.330149,0.508591,-0.795190,-0.346507,0.686300,-0.639424,-0.382092,0.592456,-0.709189,\n\t\t\t         0.300394,-0.140110,-0.943449,-0.289743,0.114048,-0.950255,-0.202033,0.328257,-0.922697,0.372692,0.076174,-0.924802,\n\t\t\t         -0.209052,-0.894650,-0.394787,-0.681204,-0.672750,-0.288614,-0.441115,-0.225074,-0.868740,0.143498,-0.449843,-0.881497,\n\t\t\t         0.143498,-0.449843,-0.881497,-0.441115,-0.225074,-0.868740,-0.289743,0.114048,-0.950255,0.300394,-0.140110,-0.943449,\n\t\t\t         0.372692,0.076174,-0.924802,-0.202033,0.328257,-0.922697,-0.193793,0.478469,-0.856441,0.395917,0.208075,-0.894375,\n\t\t\t         0.383770,0.280618,-0.879727,-0.223853,0.527329,-0.819605,-0.263619,0.569018,-0.778893,0.392132,0.341472,-0.854152,\n\t\t\t         0.374248,0.448286,-0.811762,0.392132,0.341472,-0.854152,-0.263619,0.569018,-0.778893,-0.270638,0.634358,-0.724082,\n\t\t\t         0.330149,0.508591,-0.795190,0.372997,0.549516,-0.747551,-0.266121,0.710715,-0.651143,-0.346507,0.686300,-0.639424,\n\t\t\t         0.372997,0.549516,-0.747551,0.374248,0.448286,-0.811762,-0.270638,0.634358,-0.724082,-0.266121,0.710715,-0.651143,\n\t\t\t         0.964385,-0.098392,-0.245460,0.936094,-0.174718,-0.305185,0.722770,0.121189,-0.680349,0.753319,0.196814,-0.627461,\n\t\t\t         0.719779,-0.692709,-0.045106,0.568224,-0.570666,-0.592792,0.667562,-0.335704,-0.664541,0.818812,-0.546770,-0.174780,\n\t\t\t         0.918119,-0.110050,-0.380657,0.949736,-0.090487,-0.299631,0.753288,0.255257,-0.606067,0.755577,0.160619,-0.634999,\n\t\t\t         0.878933,-0.401105,-0.258003,0.696493,-0.151128,-0.701437,0.699240,-0.022645,-0.714499,0.900754,-0.293588,-0.320017,\n\t\t\t         0.903806,-0.153630,-0.399365,0.918119,-0.110050,-0.380657,0.755577,0.160619,-0.634999,0.662069,0.118229,-0.740043,\n\t\t\t         0.818812,-0.546770,-0.174780,0.667562,-0.335704,-0.664541,0.696493,-0.151128,-0.701437,0.878933,-0.401105,-0.258003,\n\t\t\t         0.302042,-0.909268,0.286294,0.196844,-0.958190,-0.207617,0.568224,-0.570666,-0.592792,0.719779,-0.692709,-0.045106,\n\t\t\t         0.949736,-0.090487,-0.299631,0.964385,-0.098392,-0.245460,0.753319,0.196814,-0.627461,0.753288,0.255257,-0.606067,\n\t\t\t         0.911466,-0.242439,-0.332286,0.699728,0.043062,-0.713065,0.722770,0.121189,-0.680349,0.936094,-0.174718,-0.305185,\n\t\t\t         -0.220374,-0.881466,0.417615,-0.434492,-0.818415,0.375958,-0.209052,-0.894650,-0.394787,0.196844,-0.958190,-0.207617,\n\t\t\t         -0.396374,-0.609210,0.686789,-0.527146,-0.662709,0.531846,-0.543046,-0.670095,0.505997,-0.669637,-0.532304,0.517869,\n\t\t\t         -0.681204,-0.672750,-0.288614,-0.209052,-0.894650,-0.394787,-0.434492,-0.818415,0.375958,-0.580401,-0.705771,0.406171,\n\t\t\t         -0.005860,-0.688040,0.725639,-0.396374,-0.609210,0.686789,-0.669637,-0.532304,0.517869,-0.485122,-0.505539,0.713462,\n\t\t\t         -0.620167,-0.488815,0.613483,-0.542161,-0.390728,0.743889,-0.762505,-0.220038,0.608356,-0.919126,-0.362163,0.154942,\n\t\t\t         0.302042,-0.909268,0.286294,-0.005860,-0.688040,0.725639,-0.485122,-0.505539,0.713462,-0.262123,-0.692343,0.672262,\n\t\t\t         0.196844,-0.958190,-0.207617,0.302042,-0.909268,0.286294,-0.262123,-0.692343,0.672262,-0.220374,-0.881466,0.417615,\n\t\t\t         -0.634449,-0.490036,0.597736,-0.762505,-0.220038,0.608356,-0.542161,-0.390728,0.743889,-0.497909,-0.543474,0.675771,\n\t\t\t         -0.580401,-0.705771,0.406171,-0.620167,-0.488815,0.613483,-0.919126,-0.362163,0.154942,-0.681204,-0.672750,-0.288614,\n\t\t\t         -0.527146,-0.662709,0.531846,-0.634449,-0.490036,0.597736,-0.497909,-0.543474,0.675771,-0.543046,-0.670095,0.505997,\n\t\t\t         -0.220374,-0.881466,0.417615,-0.262123,-0.692343,0.672262,-0.459761,-0.578204,0.673971,-0.434492,-0.818415,0.375958,\n\t\t\t         -0.580401,-0.705771,0.406171,-0.434492,-0.818415,0.375958,-0.459761,-0.578204,0.673971,-0.620167,-0.488815,0.613483,\n\t\t\t         -0.620167,-0.488815,0.613483,-0.459761,-0.578204,0.673971,-0.450148,-0.423658,0.786035,-0.542161,-0.390728,0.743889,\n\t\t\t         -0.459761,-0.578204,0.673971,-0.262123,-0.692343,0.672262,-0.485122,-0.505539,0.713462,-0.450148,-0.423658,0.786035,\n\t\t\t         -0.450148,-0.423658,0.786035,-0.485122,-0.505539,0.713462,-0.669637,-0.532304,0.517869,-0.543046,-0.670095,0.505997,\n\t\t\t         -0.543046,-0.670095,0.505997,-0.497909,-0.543474,0.675771,-0.542161,-0.390728,0.743889,-0.450148,-0.423658,0.786035,\n\t\t\t         0.775933,-0.524583,0.350261,0.293435,-0.682333,0.669546,0.232734,-0.679128,0.696097,0.750542,-0.558763,0.352702,\n\t\t\t         -0.274056,-0.730155,0.625904,-0.812281,-0.381054,0.441542,-0.771996,-0.348735,0.531388,-0.306803,-0.665792,0.680105,\n\t\t\t         0.699240,-0.022645,-0.714499,0.395917,0.208075,-0.894375,0.383770,0.280618,-0.879727,0.699728,0.043062,-0.713065,\n\t\t\t         0.936094,-0.174718,-0.305185,0.775933,-0.524583,0.350261,0.750542,-0.558763,0.352702,0.911466,-0.242439,-0.332286,\n\t\t\t         -0.193793,0.478469,-0.856441,-0.786004,0.506912,-0.353832,-0.803461,0.498703,-0.325114,-0.223853,0.527329,-0.819605,\n\t\t\t         -0.812281,-0.381054,0.441542,-0.975036,0.132786,0.177831,-0.966063,0.124088,0.226539,-0.771996,-0.348735,0.531388,\n\t\t\t         0.293435,-0.682333,0.669546,-0.274056,-0.730155,0.625904,-0.306803,-0.665792,0.680105,0.232734,-0.679128,0.696097,\n\t\t\t         -0.786004,0.506912,-0.353832,-0.960326,0.116703,0.253212,-0.966063,0.124088,0.226539,-0.803461,0.498703,-0.325114,\n\t\t\t         0.395917,0.208075,-0.894375,-0.193793,0.478469,-0.856441,-0.223853,0.527329,-0.819605,0.383770,0.280618,-0.879727,\n\t\t\t         0.900754,-0.293588,-0.320017,0.699240,-0.022645,-0.714499,0.699728,0.043062,-0.713065,0.911466,-0.242439,-0.332286,\n\t\t\t         -0.419294,-0.616627,0.666280,-0.175481,-0.658254,0.732017,-0.184240,-0.585528,0.789392,-0.387036,-0.612079,0.689566,\n\t\t\t         0.996979,0.007935,0.076907,0.926267,0.289712,-0.240883,0.941923,0.324168,-0.087374,0.967437,0.092746,0.235389,\n\t\t\t         -0.380993,-0.629627,0.677023,0.010041,-0.627949,0.778161,0.017243,-0.653066,0.757073,-0.368999,-0.627003,0.686056,\n\t\t\t         0.991302,0.038545,0.125645,0.964629,0.188574,-0.184027,0.963500,-0.153447,-0.219214,0.994324,-0.084017,0.064791,\n\t\t\t         -0.530808,-0.616932,0.581011,-0.192297,-0.696860,0.690909,-0.160955,-0.737968,0.655324,-0.478378,-0.653157,0.586932,\n\t\t\t         0.988433,-0.089969,0.121830,0.946379,0.225013,-0.231666,0.934568,0.167791,-0.313669,0.990570,-0.136845,0.004059,\n\t\t\t         -0.361522,-0.591540,0.720634,-0.387036,-0.612079,0.689566,-0.184240,-0.585528,0.789392,-0.132450,-0.567186,0.812830,\n\t\t\t         0.961150,0.140538,0.237526,0.967437,0.092746,0.235389,0.941923,0.324168,-0.087374,0.959838,0.280465,-0.001679,\n\t\t\t         0.686087,0.535478,-0.492416,0.950743,0.218482,-0.219764,0.953673,0.233039,-0.190100,0.734886,0.480636,-0.478408,\n\t\t\t         0.204566,-0.724631,0.658040,-0.312326,-0.678365,0.664998,-0.281075,-0.709830,0.645833,0.259041,-0.731223,0.631001,\n\t\t\t         0.341350,-0.740837,0.578417,-0.162755,-0.743797,0.648274,0.135533,-0.829951,0.541093,0.440230,-0.808252,0.390973,\n\t\t\t         0.821589,0.375225,-0.429151,0.992126,0.040529,-0.118229,0.945433,-0.325480,0.013794,0.995544,-0.040162,-0.085086,\n\t\t\t         0.995544,-0.040162,-0.085086,0.945433,-0.325480,0.013794,0.506882,-0.797418,0.327311,0.703574,-0.579333,0.411451,\n\t\t\t         0.440230,-0.808252,0.390973,0.135533,-0.829951,0.541093,0.645772,-0.721732,0.249092,0.631184,-0.774560,-0.040193,\n\t\t\t         0.734886,0.480636,-0.478408,0.953673,0.233039,-0.190100,0.992126,0.040529,-0.118229,0.821589,0.375225,-0.429151,\n\t\t\t         0.259041,-0.731223,0.631001,-0.281075,-0.709830,0.645833,-0.162755,-0.743797,0.648274,0.341350,-0.740837,0.578417,\n\t\t\t         0.668661,0.538896,-0.512284,0.937407,0.214911,-0.273873,0.950743,0.218482,-0.219764,0.686087,0.535478,-0.492416,\n\t\t\t         -0.368297,-0.638050,0.676168,-0.356731,-0.611042,0.706626,-0.063478,-0.605396,0.793359,-0.026612,-0.633045,0.773644,\n\t\t\t         0.984405,0.028596,0.173498,0.978607,0.066347,0.194617,0.976897,0.209754,-0.040101,0.978881,0.176061,-0.103580,\n\t\t\t         0.987182,-0.145482,-0.065493,0.914823,0.145482,-0.376659,0.911466,0.208014,-0.354839,0.993683,-0.105502,-0.038026,\n\t\t\t         0.990570,-0.136845,0.004059,0.934568,0.167791,-0.313669,0.914823,0.145482,-0.376659,0.987182,-0.145482,-0.065493,\n\t\t\t         -0.480422,-0.647267,0.591784,-0.160527,-0.747337,0.644734,-0.163457,-0.714316,0.680441,-0.457656,-0.625416,0.631947,\n\t\t\t         0.190222,-0.732170,0.653981,-0.341075,-0.682089,0.646809,-0.312326,-0.678365,0.664998,0.204566,-0.724631,0.658040,\n\t\t\t         -0.356731,-0.611042,0.706626,-0.361522,-0.591540,0.720634,-0.132450,-0.567186,0.812830,-0.063478,-0.605396,0.793359,\n\t\t\t         -0.478378,-0.653157,0.586932,-0.160955,-0.737968,0.655324,-0.160527,-0.747337,0.644734,-0.480422,-0.647267,0.591784,\n\t\t\t         0.993683,-0.105502,-0.038026,0.911466,0.208014,-0.354839,0.926267,0.289712,-0.240883,0.996979,0.007935,0.076907,\n\t\t\t         0.978607,0.066347,0.194617,0.961150,0.140538,0.237526,0.959838,0.280465,-0.001679,0.976897,0.209754,-0.040101,\n\t\t\t         -0.457656,-0.625416,0.631947,-0.163457,-0.714316,0.680441,-0.175481,-0.658254,0.732017,-0.419294,-0.616627,0.666280,\n\t\t\t         -0.594195,-0.562578,0.574786,-0.292276,-0.654042,0.697684,-0.192297,-0.696860,0.690909,-0.530808,-0.616932,0.581011,\n\t\t\t         0.979858,-0.094607,0.175695,0.942900,0.227973,-0.242775,0.946379,0.225013,-0.231666,0.988433,-0.089969,0.121830,\n\t\t\t         -0.631794,-0.535417,0.560472,-0.320658,-0.678304,0.661092,-0.292276,-0.654042,0.697684,-0.594195,-0.562578,0.574786,\n\t\t\t         0.983886,-0.148167,0.099857,0.928617,0.217261,-0.300729,0.942900,0.227973,-0.242775,0.979858,-0.094607,0.175695,\n\t\t\t         0.703574,-0.579333,0.411451,0.506882,-0.797418,0.327311,0.562487,-0.715506,0.414289,0.660726,-0.602893,0.447096,\n\t\t\t         0.631184,-0.774560,-0.040193,0.645772,-0.721732,0.249092,0.763207,-0.589618,0.264229,0.685690,-0.725883,0.053896,\n\t\t\t         0.722465,-0.570177,0.391003,0.660726,-0.602893,0.447096,0.562487,-0.715506,0.414289,0.728294,-0.547410,0.412152,\n\t\t\t         0.559984,-0.814356,-0.152379,0.685690,-0.725883,0.053896,0.763207,-0.589618,0.264229,0.728294,-0.547410,0.412152,\n\t\t\t         0.656636,0.482345,-0.579760,0.928617,0.217261,-0.300729,0.937407,0.214911,-0.273873,0.668661,0.538896,-0.512284,\n\t\t\t         0.197394,-0.700003,0.686270,-0.320658,-0.678304,0.661092,-0.341075,-0.682089,0.646809,0.190222,-0.732170,0.653981,\n\t\t\t         -0.249428,-0.835841,0.488968,0.009980,-0.877560,0.479324,-0.061373,-0.807611,0.586444,-0.310648,-0.791528,0.526231,\n\t\t\t         0.992706,-0.105167,0.058412,0.954192,0.232704,-0.187994,0.928800,0.366619,-0.053957,0.977691,0.016877,0.209235,\n\t\t\t         -0.433699,-0.849849,0.299326,-0.051027,-0.840449,0.539445,0.461684,-0.862300,0.207984,0.002472,-0.968963,-0.247169,\n\t\t\t         0.989105,0.107181,0.100772,0.808191,0.540239,-0.234291,0.934080,0.146916,-0.325388,0.988861,0.144383,-0.036012,\n\t\t\t         -0.304422,-0.798151,0.519822,-0.005036,-0.790246,0.612720,-0.011689,-0.800378,0.599353,-0.289193,-0.810389,0.509476,\n\t\t\t         0.979827,0.125431,0.155400,0.905393,0.414624,-0.091159,0.917081,0.375805,-0.132939,0.991577,0.064119,0.112491,\n\t\t\t         -0.329051,-0.761071,0.558977,-0.310648,-0.791528,0.526231,-0.061373,-0.807611,0.586444,-0.075564,-0.730094,0.679128,\n\t\t\t         0.952239,0.109104,0.285195,0.977691,0.016877,0.209235,0.928800,0.366619,-0.053957,0.884976,0.465194,-0.019929,\n\t\t\t         0.687918,0.633900,-0.353435,0.930876,0.354564,-0.087832,0.951781,0.305399,-0.028779,0.736412,0.596301,-0.319498,\n\t\t\t         0.501724,-0.671834,0.544847,0.099399,-0.780572,0.617084,0.159856,-0.764733,0.624165,0.550981,-0.632771,0.544023,\n\t\t\t         0.644002,-0.612354,0.458480,0.296579,-0.777490,0.554552,0.569689,-0.728111,0.381146,0.771722,-0.615528,0.159734,\n\t\t\t         0.881710,0.408948,-0.235206,0.992309,0.123600,0.001648,0.986633,-0.149052,0.065493,0.990051,0.139622,-0.015931,\n\t\t\t         0.990051,0.139622,-0.015931,0.986633,-0.149052,0.065493,0.841823,-0.500626,0.201636,0.959471,-0.175695,0.220283,\n\t\t\t         0.771722,-0.615528,0.159734,0.569689,-0.728111,0.381146,0.891934,-0.392987,0.223518,0.858364,-0.509873,-0.056642,\n\t\t\t         0.736412,0.596301,-0.319498,0.951781,0.305399,-0.028779,0.992309,0.123600,0.001648,0.881710,0.408948,-0.235206,\n\t\t\t         0.550981,-0.632771,0.544023,0.159856,-0.764733,0.624165,0.296579,-0.777490,0.554552,0.644002,-0.612354,0.458480,\n\t\t\t         0.691763,0.626606,-0.358898,0.917112,0.378430,-0.125034,0.930876,0.354564,-0.087832,0.687918,0.633900,-0.353435,\n\t\t\t         -0.451766,-0.784143,0.425428,-0.384106,-0.766625,0.514512,-0.060427,-0.750603,0.657949,-0.068667,-0.791559,0.607196,\n\t\t\t         0.969451,0.124271,0.211341,0.956816,0.101810,0.272195,0.862178,0.504135,-0.049501,0.839656,0.534837,-0.094211,\n\t\t\t         0.996857,-0.010285,0.078219,0.933317,0.312296,-0.177068,0.943785,0.235420,-0.231971,0.996002,-0.083224,0.031953,\n\t\t\t         0.991577,0.064119,0.112491,0.917081,0.375805,-0.132939,0.933317,0.312296,-0.177068,0.996857,-0.010285,0.078219,\n\t\t\t         -0.246681,-0.830988,0.498581,0.026063,-0.833461,0.551927,0.046083,-0.863826,0.501633,-0.207495,-0.846522,0.490188,\n\t\t\t         0.438398,-0.699545,0.564257,0.060915,-0.801874,0.594317,0.099399,-0.780572,0.617084,0.501724,-0.671834,0.544847,\n\t\t\t         -0.384106,-0.766625,0.514512,-0.329051,-0.761071,0.558977,-0.075564,-0.730094,0.679128,-0.060427,-0.750603,0.657949,\n\t\t\t         -0.289193,-0.810389,0.509476,-0.011689,-0.800378,0.599353,0.026063,-0.833461,0.551927,-0.246681,-0.830988,0.498581,\n\t\t\t         0.996002,-0.083224,0.031953,0.943785,0.235420,-0.231971,0.954192,0.232704,-0.187994,0.992706,-0.105167,0.058412,\n\t\t\t         0.956816,0.101810,0.272195,0.952239,0.109104,0.285195,0.884976,0.465194,-0.019929,0.862178,0.504135,-0.049501,\n\t\t\t         -0.207495,-0.846522,0.490188,0.046083,-0.863826,0.501633,0.009980,-0.877560,0.479324,-0.249428,-0.835841,0.488968,\n\t\t\t         -0.307566,-0.800623,0.514176,-0.015229,-0.816980,0.576403,-0.005036,-0.790246,0.612720,-0.304422,-0.798151,0.519822,\n\t\t\t         0.989532,0.100284,0.103732,0.900662,0.416303,-0.124302,0.905393,0.414624,-0.091159,0.979827,0.125431,0.155400,\n\t\t\t         -0.281167,-0.801141,0.528306,0.051546,-0.816767,0.574633,-0.015229,-0.816980,0.576403,-0.307566,-0.800623,0.514176,\n\t\t\t         0.997223,0.044130,0.059786,0.913175,0.382000,-0.141972,0.900662,0.416303,-0.124302,0.989532,0.100284,0.103732,\n\t\t\t         0.959471,-0.175695,0.220283,0.841823,-0.500626,0.201636,0.807703,-0.474654,0.349681,0.862087,-0.350963,0.365490,\n\t\t\t         0.858364,-0.509873,-0.056642,0.891934,-0.392987,0.223518,0.837581,-0.409497,0.361522,0.836177,-0.522294,0.167302,\n\t\t\t         0.834162,-0.366955,0.411695,0.862087,-0.350963,0.365490,0.807703,-0.474654,0.349681,0.823634,-0.382244,0.418867,\n\t\t\t         0.831446,-0.552690,0.056490,0.836177,-0.522294,0.167302,0.837581,-0.409497,0.361522,0.823634,-0.382244,0.418867,\n\t\t\t         0.693655,0.631367,-0.346690,0.913175,0.382000,-0.141972,0.917112,0.378430,-0.125034,0.691763,0.626606,-0.358898,\n\t\t\t         0.389080,-0.741417,0.546709,0.051546,-0.816767,0.574633,0.060915,-0.801874,0.594317,0.438398,-0.699545,0.564257,\n\t\t\t         -0.224616,-0.878903,0.420759,0.156102,-0.837764,0.523209,0.168401,-0.774346,0.609912,-0.203528,-0.864834,0.458937,\n\t\t\t         0.979064,0.132664,0.154210,0.896329,0.443251,-0.010254,0.827387,0.545640,0.132969,0.916837,0.257210,0.305307,\n\t\t\t         -0.252724,-0.925748,0.281167,0.043031,-0.857479,0.512680,0.619953,-0.776055,0.115665,0.323130,-0.945647,-0.036409,\n\t\t\t         0.980407,0.058260,0.188116,0.825434,0.553270,-0.111881,0.895138,0.406964,-0.181921,0.989929,0.074923,0.119968,\n\t\t\t         -0.055696,-0.886837,0.458632,0.273507,-0.821009,0.501083,0.267983,-0.848964,0.455397,-0.085818,-0.907620,0.410871,\n\t\t\t         0.963530,0.253029,0.087008,0.862117,0.504379,-0.048097,0.878933,0.470595,-0.077181,0.969695,0.234230,0.069063,\n\t\t\t         -0.136692,-0.881008,0.452834,-0.203528,-0.864834,0.458937,0.168401,-0.774346,0.609912,0.217353,-0.766656,0.604114,\n\t\t\t         0.911649,0.262185,0.316355,0.916837,0.257210,0.305307,0.827387,0.545640,0.132969,0.822230,0.558061,0.111545,\n\t\t\t         0.627827,0.738090,-0.247017,0.873959,0.482955,-0.054079,0.913724,0.406262,-0.005768,0.701346,0.681814,-0.207801,\n\t\t\t         0.617664,-0.635884,0.462691,0.285318,-0.809473,0.513138,0.297067,-0.787439,0.540056,0.633839,-0.598132,0.490341,\n\t\t\t         0.713340,-0.573992,0.401990,0.399243,-0.770012,0.497604,0.625019,-0.672048,0.397046,0.841273,-0.499161,0.207495,\n\t\t\t         0.736473,0.643880,-0.207282,0.966186,0.257576,0.010132,0.945830,0.315104,0.078097,0.765191,0.614154,-0.193060,\n\t\t\t         0.765191,0.614154,-0.193060,0.945830,0.315104,0.078097,0.974639,0.086917,0.206122,0.967956,0.250526,-0.015503,\n\t\t\t         0.841273,-0.499161,0.207495,0.625019,-0.672048,0.397046,0.862178,-0.374004,0.341655,0.934812,-0.338450,-0.107456,\n\t\t\t         0.701346,0.681814,-0.207801,0.913724,0.406262,-0.005768,0.966186,0.257576,0.010132,0.736473,0.643880,-0.207282,\n\t\t\t         0.633839,-0.598132,0.490341,0.297067,-0.787439,0.540056,0.399243,-0.770012,0.497604,0.713340,-0.573992,0.401990,\n\t\t\t         0.595935,0.755028,-0.273385,0.847102,0.519272,-0.112674,0.873959,0.482955,-0.054079,0.627827,0.738090,-0.247017,\n\t\t\t         -0.264840,-0.895718,0.357097,-0.187078,-0.894009,0.407086,0.220069,-0.793023,0.568011,0.133732,-0.810511,0.570208,\n\t\t\t         0.962554,0.117618,0.244240,0.942106,0.186987,0.278237,0.838954,0.544023,0.012696,0.843471,0.536088,-0.033418,\n\t\t\t         0.987365,0.154607,0.034455,0.909513,0.391797,-0.138676,0.928709,0.335246,-0.158269,0.997711,0.063845,0.021851,\n\t\t\t         0.969695,0.234230,0.069063,0.878933,0.470595,-0.077181,0.909513,0.391797,-0.138676,0.987365,0.154607,0.034455,\n\t\t\t         -0.155522,-0.918393,0.363750,0.246315,-0.881619,0.402539,0.201483,-0.889401,0.410260,-0.190252,-0.908567,0.371838,\n\t\t\t         0.601459,-0.664357,0.443648,0.292032,-0.828333,0.478042,0.285318,-0.809473,0.513138,0.617664,-0.635884,0.462691,\n\t\t\t         -0.187078,-0.894009,0.407086,-0.136692,-0.881008,0.452834,0.217353,-0.766656,0.604114,0.220069,-0.793023,0.568011,\n\t\t\t         -0.085818,-0.907620,0.410871,0.267983,-0.848964,0.455397,0.246315,-0.881619,0.402539,-0.155522,-0.918393,0.363750,\n\t\t\t         0.997711,0.063845,0.021851,0.928709,0.335246,-0.158269,0.896329,0.443251,-0.010254,0.979064,0.132664,0.154210,\n\t\t\t         0.942106,0.186987,0.278237,0.911649,0.262185,0.316355,0.822230,0.558061,0.111545,0.838954,0.544023,0.012696,\n\t\t\t         -0.190252,-0.908567,0.371838,0.201483,-0.889401,0.410260,0.156102,-0.837764,0.523209,-0.224616,-0.878903,0.420759,\n\t\t\t         -0.073611,-0.888943,0.451979,0.264321,-0.811121,0.521714,0.273507,-0.821009,0.501083,-0.055696,-0.886837,0.458632,\n\t\t\t         0.955290,0.263344,0.134342,0.847194,0.528581,-0.053194,0.862117,0.504379,-0.048097,0.963530,0.253029,0.087008,\n\t\t\t         -0.103519,-0.888821,0.446364,0.255715,-0.828455,0.498215,0.264321,-0.811121,0.521714,-0.073611,-0.888943,0.451979,\n\t\t\t         0.969512,0.210883,0.124516,0.835505,0.540483,-0.098758,0.847194,0.528581,-0.053194,0.955290,0.263344,0.134342,\n\t\t\t         0.967956,0.250526,-0.015503,0.974639,0.086917,0.206122,0.881130,-0.291696,0.372143,0.952849,-0.166356,0.253670,\n\t\t\t         0.934812,-0.338450,-0.107456,0.862178,-0.374004,0.341655,0.901425,-0.254524,0.350169,0.957030,-0.271767,0.100925,\n\t\t\t         0.875454,-0.324595,0.358043,0.952849,-0.166356,0.253670,0.881130,-0.291696,0.372143,0.859188,-0.267983,0.435835,\n\t\t\t         0.882931,-0.462142,-0.082369,0.957030,-0.271767,0.100925,0.901425,-0.254524,0.350169,0.859188,-0.267983,0.435835,\n\t\t\t         0.601947,0.750969,-0.271401,0.835505,0.540483,-0.098758,0.847102,0.519272,-0.112674,0.595935,0.755028,-0.273385,\n\t\t\t         0.578906,-0.643788,0.500351,0.255715,-0.828455,0.498215,0.292032,-0.828333,0.478042,0.601459,-0.664357,0.443648,\n\t\t\t         -0.007202,-0.979430,0.201544,0.499863,-0.835505,0.228156,0.483840,-0.799676,0.355510,-0.032197,-0.966216,0.255684,\n\t\t\t         0.971038,0.235511,-0.039796,0.799982,0.562395,-0.208960,0.780572,0.613758,-0.118168,0.947722,0.296274,0.118442,\n\t\t\t         0.232215,-0.957671,0.169958,0.584948,-0.770623,0.252815,0.953307,-0.301981,-0.000031,0.665395,-0.695212,-0.271828,\n\t\t\t         0.930906,0.330363,0.155675,0.761681,0.647664,-0.018769,0.751518,0.659597,0.009857,0.905240,0.392743,0.162023,\n\t\t\t         0.044069,-0.955657,0.291147,0.422163,-0.831477,0.361095,0.420972,-0.831751,0.361797,0.040468,-0.942656,0.331217,\n\t\t\t         0.957701,0.272866,0.091281,0.797418,0.603229,-0.014008,0.787317,0.610797,-0.083651,0.957213,0.287179,0.034974,\n\t\t\t         -0.023286,-0.936216,0.350627,-0.032197,-0.966216,0.255684,0.483840,-0.799676,0.355510,0.459975,-0.744682,0.483535,\n\t\t\t         0.885556,0.381878,0.264412,0.947722,0.296274,0.118442,0.780572,0.613758,-0.118168,0.727470,0.685385,0.031465,\n\t\t\t         0.554491,0.793420,-0.250893,0.854732,0.505142,-0.119236,0.891293,0.425764,-0.155828,0.677725,0.676901,-0.287118,\n\t\t\t         0.766656,-0.579089,0.277230,0.366802,-0.857906,0.359722,0.383831,-0.883328,0.269021,0.769921,-0.621418,0.144932,\n\t\t\t         0.812433,-0.572344,0.110965,0.470717,-0.817530,0.331645,0.532395,-0.727287,0.433119,0.846553,-0.461501,0.265206,\n\t\t\t         0.784936,0.571215,-0.239875,0.965606,0.239601,-0.100803,0.923460,0.381726,0.038728,0.802301,0.576952,-0.153020,\n\t\t\t         0.802301,0.576952,-0.153020,0.923460,0.381726,0.038728,0.984832,0.107242,0.136265,0.963286,0.268349,0.001434,\n\t\t\t         0.846553,-0.461501,0.265206,0.532395,-0.727287,0.433119,0.800409,-0.546525,0.246132,0.911954,-0.392468,0.119480,\n\t\t\t         0.677725,0.676901,-0.287118,0.891293,0.425764,-0.155828,0.965606,0.239601,-0.100803,0.784936,0.571215,-0.239875,\n\t\t\t         0.769921,-0.621418,0.144932,0.383831,-0.883328,0.269021,0.470717,-0.817530,0.331645,0.812433,-0.572344,0.110965,\n\t\t\t         0.579455,0.783135,-0.225623,0.848659,0.517106,-0.110996,0.854732,0.505142,-0.119236,0.554491,0.793420,-0.250893,\n\t\t\t         0.133549,-0.977508,0.163152,0.010498,-0.955870,0.293558,0.480209,-0.761162,0.435835,0.552477,-0.777886,0.299387,\n\t\t\t         0.938963,0.309122,0.150761,0.897977,0.386914,0.209510,0.703879,0.710257,0.006592,0.765374,0.641469,-0.051698,\n\t\t\t         0.950285,0.311258,-0.008057,0.780267,0.611896,-0.129185,0.785974,0.589648,-0.185705,0.968474,0.243721,-0.051363,\n\t\t\t         0.957213,0.287179,0.034974,0.787317,0.610797,-0.083651,0.780267,0.611896,-0.129185,0.950285,0.311258,-0.008057,\n\t\t\t         0.050050,-0.960143,0.274972,0.436811,-0.845729,0.306406,0.469680,-0.849696,0.239570,0.021546,-0.978729,0.203986,\n\t\t\t         0.745384,-0.606128,0.277474,0.407910,-0.841914,0.353160,0.366802,-0.857906,0.359722,0.766656,-0.579089,0.277230,\n\t\t\t         0.010498,-0.955870,0.293558,-0.023286,-0.936216,0.350627,0.459975,-0.744682,0.483535,0.480209,-0.761162,0.435835,\n\t\t\t         0.040468,-0.942656,0.331217,0.420972,-0.831751,0.361797,0.436811,-0.845729,0.306406,0.050050,-0.960143,0.274972,\n\t\t\t         0.968474,0.243721,-0.051363,0.785974,0.589648,-0.185705,0.799982,0.562395,-0.208960,0.971038,0.235511,-0.039796,\n\t\t\t         0.897977,0.386914,0.209510,0.885556,0.381878,0.264412,0.727470,0.685385,0.031465,0.703879,0.710257,0.006592,\n\t\t\t         0.021546,-0.978729,0.203986,0.469680,-0.849696,0.239570,0.499863,-0.835505,0.228156,-0.007202,-0.979430,0.201544,\n\t\t\t         0.021119,-0.954863,0.296213,0.413007,-0.832636,0.368938,0.422163,-0.831477,0.361095,0.044069,-0.955657,0.291147,\n\t\t\t         0.955565,0.259774,0.139073,0.799493,0.600604,-0.004700,0.797418,0.603229,-0.014008,0.957701,0.272866,0.091281,\n\t\t\t         0.011353,-0.947508,0.319468,0.400067,-0.844508,0.355937,0.413007,-0.832636,0.368938,0.021119,-0.954863,0.296213,\n\t\t\t         0.973113,0.219977,0.067873,0.836390,0.544694,-0.060854,0.799493,0.600604,-0.004700,0.955565,0.259774,0.139073,\n\t\t\t         0.963286,0.268349,0.001434,0.984832,0.107242,0.136265,0.957060,-0.222480,0.185675,0.977599,-0.123295,0.170446,\n\t\t\t         0.911954,-0.392468,0.119480,0.800409,-0.546525,0.246132,0.971862,-0.221625,0.079470,0.937956,-0.343577,-0.046236,\n\t\t\t         0.934904,-0.223975,0.275216,0.977599,-0.123295,0.170446,0.957060,-0.222480,0.185675,0.948790,-0.245766,0.198401,\n\t\t\t         0.959532,-0.281472,-0.003265,0.937956,-0.343577,-0.046236,0.971862,-0.221625,0.079470,0.948790,-0.245766,0.198401,\n\t\t\t         0.575182,0.795862,-0.188910,0.836390,0.544694,-0.060854,0.848659,0.517106,-0.110996,0.579455,0.783135,-0.225623,\n\t\t\t         0.720573,-0.610401,0.328806,0.400067,-0.844508,0.355937,0.407910,-0.841914,0.353160,0.745384,-0.606128,0.277474,\n\t\t\t         -0.991241,0.121982,-0.050050,-0.979553,0.058351,-0.192419,-0.941527,-0.289407,0.172369,-0.921812,-0.278756,0.269265,\n\t\t\t         -0.962249,-0.121220,-0.243660,-0.987640,-0.002594,-0.156499,-0.914609,-0.303720,0.266823,-0.904935,-0.360118,0.226630,\n\t\t\t         -0.963439,0.033723,-0.265664,-0.963286,-0.033509,-0.266335,-0.933714,-0.335948,0.123692,-0.960936,-0.256600,0.103519,\n\t\t\t         -0.827754,-0.466781,-0.311319,-0.844234,-0.522385,0.119755,-0.920652,-0.346538,0.179693,-0.981567,-0.092959,-0.166875,\n\t\t\t         0.120029,-0.978820,-0.165746,-0.030457,-0.992370,0.119327,-0.598529,-0.800958,0.013153,-0.424879,-0.788965,-0.443800,\n\t\t\t         -0.424879,-0.788965,-0.443800,-0.598529,-0.800958,0.013153,-0.844234,-0.522385,0.119755,-0.827754,-0.466781,-0.311319,\n\t\t\t         -0.981567,-0.092959,-0.166875,-0.920652,-0.346538,0.179693,-0.953856,-0.249336,0.167211,-0.987091,0.063753,-0.146702,\n\t\t\t         -0.963286,-0.033509,-0.266335,-0.968322,-0.112094,-0.223029,-0.911496,-0.368999,0.181555,-0.933714,-0.335948,0.123692,\n\t\t\t         -0.971892,0.193274,-0.134251,-0.972015,-0.139592,0.188788,-0.969481,-0.131016,0.207068,-0.973174,0.214606,-0.082736,\n\t\t\t         -0.989349,0.144322,-0.018525,-0.985717,0.168279,-0.004578,-0.911039,-0.281625,0.301065,-0.916807,-0.260201,0.302835,\n\t\t\t         -0.984130,0.065462,-0.164739,-0.973174,0.214606,-0.082736,-0.969481,-0.131016,0.207068,-0.959746,-0.228217,0.163579,\n\t\t\t         -0.985717,0.168279,-0.004578,-0.991241,0.121982,-0.050050,-0.921812,-0.278756,0.269265,-0.911039,-0.281625,0.301065,\n\t\t\t         -0.968322,-0.112094,-0.223029,-0.962249,-0.121220,-0.243660,-0.904935,-0.360118,0.226630,-0.911496,-0.368999,0.181555,\n\t\t\t         -0.987640,-0.002594,-0.156499,-0.989349,0.144322,-0.018525,-0.916807,-0.260201,0.302835,-0.914609,-0.303720,0.266823,\n\t\t\t         -0.979553,0.058351,-0.192419,-0.959380,-0.016633,-0.281503,-0.937223,-0.318857,0.141179,-0.941527,-0.289407,0.172369,\n\t\t\t         -0.959380,-0.016633,-0.281503,-0.984130,0.065462,-0.164739,-0.959746,-0.228217,0.163579,-0.937223,-0.318857,0.141179,\n\t\t\t         0.367534,0.591784,-0.717368,0.319407,0.633076,-0.705100,-0.061037,0.597797,-0.799310,0.030335,0.592761,-0.804773,\n\t\t\t         0.289682,0.074679,-0.954192,0.377422,0.445265,-0.811945,0.002197,0.474807,-0.880062,-0.093295,0.055269,-0.994079,\n\t\t\t         0.377422,0.445265,-0.811945,0.367534,0.591784,-0.717368,0.030335,0.592761,-0.804773,0.002197,0.474807,-0.880062,\n\t\t\t         0.294565,0.580889,-0.758782,0.282174,0.639546,-0.715049,-0.141423,0.700888,-0.699088,-0.138524,0.570482,-0.809503,\n\t\t\t         0.911893,0.131504,-0.388745,0.611255,-0.039369,-0.790429,0.313150,0.423536,-0.850002,0.601245,0.494491,-0.627613,\n\t\t\t         0.258156,0.599841,-0.757286,0.227790,0.618793,-0.751793,-0.191626,0.641377,-0.742851,-0.135594,0.551836,-0.822840,\n\t\t\t         0.358684,0.573809,-0.736229,0.338328,0.580035,-0.740989,-0.085238,0.537645,-0.838832,-0.026063,0.641255,-0.766869,\n\t\t\t         0.400372,0.616230,-0.678152,0.063570,0.624165,-0.778680,-0.080660,0.682028,-0.726829,0.316080,0.670858,-0.670827,\n\t\t\t         0.274606,0.628498,-0.727683,0.358684,0.573809,-0.736229,-0.026063,0.641255,-0.766869,-0.072512,0.702567,-0.707877,\n\t\t\t         0.319407,0.633076,-0.705100,0.258156,0.599841,-0.757286,-0.135594,0.551836,-0.822840,-0.061037,0.597797,-0.799310,\n\t\t\t         0.206183,0.657491,-0.724662,0.274606,0.628498,-0.727683,-0.072512,0.702567,-0.707877,-0.159948,0.723258,-0.671743,\n\t\t\t         0.601245,0.494491,-0.627613,0.313150,0.423536,-0.850002,0.063570,0.624165,-0.778680,0.400372,0.616230,-0.678152,\n\t\t\t         0.870968,-0.486129,0.071230,0.847499,-0.434278,-0.305155,0.611255,-0.039369,-0.790429,0.911893,0.131504,-0.388745,\n\t\t\t         0.338328,0.580035,-0.740989,0.294565,0.580889,-0.758782,-0.138524,0.570482,-0.809503,-0.085238,0.537645,-0.838832,\n\t\t\t         0.295969,0.705924,-0.643452,-0.132847,0.734397,-0.665548,-0.141423,0.700888,-0.699088,0.282174,0.639546,-0.715049,\n\t\t\t         0.227790,0.618793,-0.751793,0.206183,0.657491,-0.724662,-0.159948,0.723258,-0.671743,-0.191626,0.641377,-0.742851,\n\t\t\t         0.619129,-0.636189,-0.460311,0.847499,-0.434278,-0.305155,0.804712,-0.585284,0.099277,0.806146,-0.582629,0.103153,\n\t\t\t         0.538682,-0.808863,0.235572,0.530686,-0.773675,0.346080,-0.030457,-0.992370,0.119327,0.120029,-0.978820,-0.165746,\n\t\t\t         0.806146,-0.582629,0.103153,0.804712,-0.585284,0.099277,0.693075,-0.635395,0.340373,0.632832,-0.760918,0.143071,\n\t\t\t         0.538682,-0.808863,0.235572,0.632832,-0.760918,0.143071,0.693075,-0.635395,0.340373,0.530686,-0.773675,0.346080,\n\t\t\t         -0.987091,0.063753,-0.146702,-0.953856,-0.249336,0.167211,-0.972015,-0.139592,0.188788,-0.971892,0.193274,-0.134251,\n\t\t\t         0.316080,0.670858,-0.670827,-0.080660,0.682028,-0.726829,-0.132847,0.734397,-0.665548,0.295969,0.705924,-0.643452,\n\t\t\t         -0.980010,-0.089908,-0.177313,-0.946074,-0.107517,-0.305490,-0.896420,-0.443129,-0.003265,-0.886502,-0.449171,0.110904,\n\t\t\t         -0.917661,-0.287362,-0.274361,-0.979247,-0.157537,-0.127323,-0.893429,-0.433821,0.116337,-0.852229,-0.522843,0.016663,\n\t\t\t         -0.795282,-0.301401,-0.525956,-0.907132,-0.249245,-0.339000,-0.879238,-0.471206,-0.069735,-0.780023,-0.575976,-0.244392,\n\t\t\t         -0.570574,-0.652974,-0.498032,-0.589221,-0.807703,0.020142,-0.822901,-0.552995,0.130253,-0.917722,-0.272317,-0.289071,\n\t\t\t         0.616138,-0.778893,-0.116947,0.509690,-0.835932,0.203375,-0.067385,-0.996704,-0.044832,0.067721,-0.890316,-0.450209,\n\t\t\t         0.067721,-0.890316,-0.450209,-0.067385,-0.996704,-0.044832,-0.589221,-0.807703,0.020142,-0.570574,-0.652974,-0.498032,\n\t\t\t         -0.917722,-0.272317,-0.289071,-0.822901,-0.552995,0.130253,-0.813685,-0.547472,0.195379,-0.974761,-0.173132,-0.140812,\n\t\t\t         -0.907132,-0.249245,-0.339000,-0.929411,-0.245949,-0.275063,-0.876186,-0.481948,0.001282,-0.879238,-0.471206,-0.069735,\n\t\t\t         -0.986084,-0.129154,-0.104434,-0.823115,-0.525071,0.216193,-0.854183,-0.457320,0.247353,-0.998413,-0.053896,-0.014801,\n\t\t\t         -0.996368,-0.065859,0.053896,-0.997101,-0.066286,-0.037172,-0.875240,-0.434462,0.212500,-0.886715,-0.391247,0.246193,\n\t\t\t         -0.999542,0.022248,0.020356,-0.998413,-0.053896,-0.014801,-0.854183,-0.457320,0.247353,-0.878842,-0.419141,0.227821,\n\t\t\t         -0.997101,-0.066286,-0.037172,-0.980010,-0.089908,-0.177313,-0.886502,-0.449171,0.110904,-0.875240,-0.434462,0.212500,\n\t\t\t         -0.929411,-0.245949,-0.275063,-0.917661,-0.287362,-0.274361,-0.852229,-0.522843,0.016663,-0.876186,-0.481948,0.001282,\n\t\t\t         -0.979247,-0.157537,-0.127323,-0.996368,-0.065859,0.053896,-0.886715,-0.391247,0.246193,-0.893429,-0.433821,0.116337,\n\t\t\t         -0.946074,-0.107517,-0.305490,-0.983551,-0.089694,-0.156652,-0.879238,-0.466109,0.098086,-0.896420,-0.443129,-0.003265,\n\t\t\t         -0.983551,-0.089694,-0.156652,-0.999542,0.022248,0.020356,-0.878842,-0.419141,0.227821,-0.879238,-0.466109,0.098086,\n\t\t\t         0.381146,0.780847,-0.494919,0.372814,0.766137,-0.523453,-0.098483,0.683340,-0.723411,-0.094302,0.717154,-0.690481,\n\t\t\t         0.380779,0.727470,-0.570757,0.364177,0.794733,-0.485488,-0.070070,0.736686,-0.672536,0.058596,0.617603,-0.784295,\n\t\t\t         0.364177,0.794733,-0.485488,0.381146,0.780847,-0.494919,-0.094302,0.717154,-0.690481,-0.070070,0.736686,-0.672536,\n\t\t\t         0.290780,0.765130,-0.574419,0.281381,0.793664,-0.539323,-0.185247,0.795984,-0.576250,-0.244057,0.772759,-0.585864,\n\t\t\t         0.882290,0.340373,-0.325022,0.760613,0.235298,-0.605029,0.337596,0.541948,-0.769585,0.644368,0.602619,-0.470748,\n\t\t\t         0.360881,0.759850,-0.540696,0.379894,0.731498,-0.566179,-0.166356,0.790826,-0.588977,-0.136509,0.742149,-0.656148,\n\t\t\t         0.378399,0.735435,-0.562059,0.346446,0.722068,-0.598804,-0.216102,0.665944,-0.713981,-0.213294,0.659322,-0.720939,\n\t\t\t         0.409497,0.729118,-0.548326,0.033876,0.710929,-0.702445,-0.042512,0.750175,-0.659841,0.332194,0.752312,-0.568865,\n\t\t\t         0.405774,0.732109,-0.547075,0.378399,0.735435,-0.562059,-0.213294,0.659322,-0.720939,-0.167455,0.757927,-0.630451,\n\t\t\t         0.372814,0.766137,-0.523453,0.360881,0.759850,-0.540696,-0.136509,0.742149,-0.656148,-0.098483,0.683340,-0.723411,\n\t\t\t         0.427473,0.705557,-0.565172,0.405774,0.732109,-0.547075,-0.167455,0.757927,-0.630451,-0.123081,0.793573,-0.595874,\n\t\t\t         0.644368,0.602619,-0.470748,0.337596,0.541948,-0.769585,0.033876,0.710929,-0.702445,0.409497,0.729118,-0.548326,\n\t\t\t         0.987579,-0.137852,0.075045,0.975921,-0.196051,-0.095401,0.760613,0.235298,-0.605029,0.882290,0.340373,-0.325022,\n\t\t\t         0.346446,0.722068,-0.598804,0.290780,0.765130,-0.574419,-0.244057,0.772759,-0.585864,-0.216102,0.665944,-0.713981,\n\t\t\t         0.312906,0.763115,-0.565416,-0.120457,0.757927,-0.641072,-0.185247,0.795984,-0.576250,0.281381,0.793664,-0.539323,\n\t\t\t         0.379894,0.731498,-0.566179,0.427473,0.705557,-0.565172,-0.123081,0.793573,-0.595874,-0.166356,0.790826,-0.588977,\n\t\t\t         0.914609,-0.314402,-0.254158,0.975921,-0.196051,-0.095401,0.914365,-0.326212,0.239784,0.943022,-0.303262,0.136692,\n\t\t\t         0.790124,-0.581927,0.192389,0.816279,-0.474654,0.329112,0.509690,-0.835932,0.203375,0.616138,-0.778893,-0.116947,\n\t\t\t         0.943022,-0.303262,0.136692,0.914365,-0.326212,0.239784,0.887295,-0.387494,0.250008,0.878079,-0.456984,0.141667,\n\t\t\t         0.790124,-0.581927,0.192389,0.878079,-0.456984,0.141667,0.887295,-0.387494,0.250008,0.816279,-0.474654,0.329112,\n\t\t\t         -0.974761,-0.173132,-0.140812,-0.813685,-0.547472,0.195379,-0.823115,-0.525071,0.216193,-0.986084,-0.129154,-0.104434,\n\t\t\t         0.332194,0.752312,-0.568865,-0.042512,0.750175,-0.659841,-0.120457,0.757927,-0.641072,0.312906,0.763115,-0.565416,\n\t\t\t         -0.982757,-0.159703,-0.092868,-0.968566,-0.142186,-0.203955,-0.847407,-0.528703,0.048494,-0.863979,-0.495743,0.087863,\n\t\t\t         -0.859645,-0.348979,-0.373089,-0.852290,-0.362926,-0.376598,-0.793359,-0.604236,-0.073580,-0.770623,-0.632801,-0.075106,\n\t\t\t         -0.802484,-0.389264,-0.452132,-0.815302,-0.371746,-0.443922,-0.714408,-0.667196,-0.210730,-0.703848,-0.647023,-0.293039,\n\t\t\t         -0.694693,-0.411389,-0.590014,-0.675008,-0.697562,-0.240211,-0.808924,-0.584033,-0.067202,-0.903348,-0.235755,-0.358287,\n\t\t\t         0.464278,-0.727622,-0.504929,0.458205,-0.848750,-0.263833,-0.296823,-0.872280,-0.388562,-0.286294,-0.606250,-0.741935,\n\t\t\t         -0.286294,-0.606250,-0.741935,-0.296823,-0.872280,-0.388562,-0.675008,-0.697562,-0.240211,-0.694693,-0.411389,-0.590014,\n\t\t\t         -0.903348,-0.235755,-0.358287,-0.808924,-0.584033,-0.067202,-0.842860,-0.537858,0.014924,-0.964721,-0.116703,-0.235939,\n\t\t\t         -0.815302,-0.371746,-0.443922,-0.853542,-0.339457,-0.395184,-0.747948,-0.651723,-0.125614,-0.714408,-0.667196,-0.210730,\n\t\t\t         -0.992737,-0.020295,-0.118473,-0.887997,-0.452773,0.080050,-0.912442,-0.400281,0.084597,-0.989746,-0.008423,-0.142521,\n\t\t\t         -0.917142,-0.308817,-0.251839,-0.981201,-0.176519,-0.077548,-0.870205,-0.482986,0.096927,-0.833399,-0.552568,-0.007935,\n\t\t\t         -0.946776,-0.106418,-0.303720,-0.989746,-0.008423,-0.142521,-0.912442,-0.400281,0.084597,-0.880459,-0.473891,-0.013611,\n\t\t\t         -0.981201,-0.176519,-0.077548,-0.982757,-0.159703,-0.092868,-0.863979,-0.495743,0.087863,-0.870205,-0.482986,0.096927,\n\t\t\t         -0.853542,-0.339457,-0.395184,-0.859645,-0.348979,-0.373089,-0.770623,-0.632801,-0.075106,-0.747948,-0.651723,-0.125614,\n\t\t\t         -0.852290,-0.362926,-0.376598,-0.917142,-0.308817,-0.251839,-0.833399,-0.552568,-0.007935,-0.793359,-0.604236,-0.073580,\n\t\t\t         -0.968566,-0.142186,-0.203955,-0.940672,-0.114536,-0.319346,-0.842616,-0.538469,-0.001740,-0.847407,-0.528703,0.048494,\n\t\t\t         -0.940672,-0.114536,-0.319346,-0.946776,-0.106418,-0.303720,-0.880459,-0.473891,-0.013611,-0.842616,-0.538469,-0.001740,\n\t\t\t         0.403088,0.839991,-0.363140,0.406598,0.875088,-0.262459,-0.017304,0.855251,-0.517869,-0.004334,0.830287,-0.557268,\n\t\t\t         0.367901,0.752159,-0.546678,0.351115,0.822504,-0.447371,-0.022309,0.778405,-0.627308,0.057955,0.647572,-0.759758,\n\t\t\t         0.351115,0.822504,-0.447371,0.403088,0.839991,-0.363140,-0.004334,0.830287,-0.557268,-0.022309,0.778405,-0.627308,\n\t\t\t         0.303568,0.827052,-0.473067,0.212104,0.871181,-0.442732,-0.211554,0.838984,-0.501328,-0.143437,0.786584,-0.600543,\n\t\t\t         0.623371,0.596728,-0.505234,0.462386,0.388653,-0.796930,0.010193,0.629688,-0.776757,0.404492,0.771874,-0.490463,\n\t\t\t         0.397656,0.880306,-0.258614,0.380566,0.842433,-0.381329,-0.120579,0.827418,-0.548448,-0.020051,0.872036,-0.488998,\n\t\t\t         0.378826,0.824824,-0.419660,0.374187,0.823908,-0.425581,-0.043489,0.820063,-0.570574,-0.077486,0.836390,-0.542589,\n\t\t\t         0.311747,0.840815,-0.442518,-0.099612,0.780328,-0.617359,-0.126560,0.826868,-0.547929,0.284982,0.856594,-0.430097,\n\t\t\t         0.381512,0.818384,-0.429701,0.378826,0.824824,-0.419660,-0.077486,0.836390,-0.542589,-0.123417,0.842494,-0.524369,\n\t\t\t         0.406598,0.875088,-0.262459,0.397656,0.880306,-0.258614,-0.020051,0.872036,-0.488998,-0.017304,0.855251,-0.517869,\n\t\t\t         0.361095,0.830927,-0.423231,0.381512,0.818384,-0.429701,-0.123417,0.842494,-0.524369,-0.155065,0.824702,-0.543840,\n\t\t\t         0.404492,0.771874,-0.490463,0.010193,0.629688,-0.776757,-0.099612,0.780328,-0.617359,0.311747,0.840815,-0.442518,\n\t\t\t         0.972167,0.170843,-0.160283,0.889126,-0.095187,-0.447645,0.462386,0.388653,-0.796930,0.623371,0.596728,-0.505234,\n\t\t\t         0.374187,0.823908,-0.425581,0.303568,0.827052,-0.473067,-0.143437,0.786584,-0.600543,-0.043489,0.820063,-0.570574,\n\t\t\t         0.237739,0.877438,-0.416578,-0.161504,0.862758,-0.479080,-0.211554,0.838984,-0.501328,0.212104,0.871181,-0.442732,\n\t\t\t         0.380566,0.842433,-0.381329,0.361095,0.830927,-0.423231,-0.155065,0.824702,-0.543840,-0.120579,0.827418,-0.548448,\n\t\t\t         0.684500,-0.407300,-0.604572,0.889126,-0.095187,-0.447645,0.924009,-0.381390,0.026460,0.853206,-0.520280,-0.036012,\n\t\t\t         0.824244,-0.565935,-0.017304,0.835475,-0.546892,0.053194,0.458205,-0.848750,-0.263833,0.464278,-0.727622,-0.504929,\n\t\t\t         0.853206,-0.520280,-0.036012,0.924009,-0.381390,0.026460,0.850581,-0.524766,-0.032960,0.834620,-0.547655,-0.058351,\n\t\t\t         0.824244,-0.565935,-0.017304,0.834620,-0.547655,-0.058351,0.850581,-0.524766,-0.032960,0.835475,-0.546892,0.053194,\n\t\t\t         -0.964721,-0.116703,-0.235939,-0.842860,-0.537858,0.014924,-0.887997,-0.452773,0.080050,-0.992737,-0.020295,-0.118473,\n\t\t\t         0.284982,0.856594,-0.430097,-0.126560,0.826868,-0.547929,-0.161504,0.862758,-0.479080,0.237739,0.877438,-0.416578,\n\t\t\t         -0.972076,-0.092410,-0.215552,-0.955077,-0.123478,-0.269326,-0.829127,-0.555223,-0.065279,-0.838496,-0.544847,-0.007080,\n\t\t\t         -0.959838,-0.179754,-0.215308,-0.980804,-0.131138,-0.144292,-0.875240,-0.483444,0.013703,-0.863002,-0.496811,-0.091342,\n\t\t\t         -0.848903,-0.364544,-0.382641,-0.914609,-0.241646,-0.324137,-0.848140,-0.502243,-0.168340,-0.707633,-0.641987,-0.295053,\n\t\t\t         -0.509445,-0.664357,-0.546831,-0.447035,-0.888821,-0.100558,-0.693167,-0.720725,-0.006226,-0.876553,-0.373028,-0.304117,\n\t\t\t         0.439619,-0.800501,-0.407300,0.291726,-0.941191,-0.170324,-0.109500,-0.971892,-0.208258,0.022675,-0.801508,-0.597491,\n\t\t\t         0.022675,-0.801508,-0.597491,-0.109500,-0.971892,-0.208258,-0.447035,-0.888821,-0.100558,-0.509445,-0.664357,-0.546831,\n\t\t\t         -0.876553,-0.373028,-0.304117,-0.693167,-0.720725,-0.006226,-0.774407,-0.632130,0.026307,-0.961486,-0.227302,-0.154424,\n\t\t\t         -0.914609,-0.241646,-0.324137,-0.921476,-0.204718,-0.330058,-0.848476,-0.478378,-0.226264,-0.848140,-0.502243,-0.168340,\n\t\t\t         -0.984191,-0.170324,-0.048128,-0.805963,-0.581133,0.112461,-0.817286,-0.546892,0.181341,-0.991394,-0.125065,0.038148,\n\t\t\t         -0.970855,-0.159703,-0.178625,-0.966216,-0.144841,-0.213111,-0.837031,-0.546800,-0.018677,-0.839778,-0.542894,0.000061,\n\t\t\t         -0.993439,-0.101108,-0.052980,-0.991394,-0.125065,0.038148,-0.817286,-0.546892,0.181341,-0.854366,-0.517441,0.048006,\n\t\t\t         -0.966216,-0.144841,-0.213111,-0.972076,-0.092410,-0.215552,-0.838496,-0.544847,-0.007080,-0.837031,-0.546800,-0.018677,\n\t\t\t         -0.921476,-0.204718,-0.330058,-0.959838,-0.179754,-0.215308,-0.863002,-0.496811,-0.091342,-0.848476,-0.478378,-0.226264,\n\t\t\t         -0.980804,-0.131138,-0.144292,-0.970855,-0.159703,-0.178625,-0.839778,-0.542894,0.000061,-0.875240,-0.483444,0.013703,\n\t\t\t         -0.955077,-0.123478,-0.269326,-0.961577,-0.122044,-0.245766,-0.827693,-0.552202,-0.099673,-0.829127,-0.555223,-0.065279,\n\t\t\t         -0.961577,-0.122044,-0.245766,-0.993439,-0.101108,-0.052980,-0.854366,-0.517441,0.048006,-0.827693,-0.552202,-0.099673,\n\t\t\t         0.123447,0.930021,-0.346049,0.111148,0.920499,-0.374523,-0.425092,0.749992,-0.506729,-0.490646,0.706442,-0.510025,\n\t\t\t         0.118992,0.877163,-0.465194,0.101718,0.907498,-0.407514,-0.470290,0.713675,-0.519089,-0.423963,0.660237,-0.619922,\n\t\t\t         0.101718,0.907498,-0.407514,0.123447,0.930021,-0.346049,-0.490646,0.706442,-0.510025,-0.470290,0.713675,-0.519089,\n\t\t\t         0.161473,0.946593,-0.279000,0.176305,0.938231,-0.297647,-0.271706,0.905545,-0.325724,-0.316568,0.884823,-0.341807,\n\t\t\t         0.617664,0.626270,-0.475631,0.508774,0.511734,-0.692251,0.176824,0.704794,-0.687002,0.391369,0.751823,-0.530595,\n\t\t\t         0.107700,0.905454,-0.410474,0.144536,0.901028,-0.408918,-0.387341,0.783441,-0.485946,-0.428663,0.764244,-0.481826,\n\t\t\t         0.157414,0.941679,-0.297342,0.177923,0.946471,-0.269234,-0.328837,0.857204,-0.396283,-0.333842,0.849849,-0.407758,\n\t\t\t         0.238594,0.837489,-0.491562,-0.100223,0.807062,-0.581835,-0.173620,0.854060,-0.490280,0.177252,0.896207,-0.406598,\n\t\t\t         0.127110,0.921903,-0.365886,0.157414,0.941679,-0.297342,-0.333842,0.849849,-0.407758,-0.353771,0.831935,-0.427412,\n\t\t\t         0.111148,0.920499,-0.374523,0.107700,0.905454,-0.410474,-0.428663,0.764244,-0.481826,-0.425092,0.749992,-0.506729,\n\t\t\t         0.146916,0.901120,-0.407819,0.127110,0.921903,-0.365886,-0.353771,0.831935,-0.427412,-0.363720,0.800317,-0.476577,\n\t\t\t         0.391369,0.751823,-0.530595,0.176824,0.704794,-0.687002,-0.100223,0.807062,-0.581835,0.238594,0.837489,-0.491562,\n\t\t\t         0.901914,0.363109,-0.233833,0.840297,0.319498,-0.437941,0.508774,0.511734,-0.692251,0.617664,0.626270,-0.475631,\n\t\t\t         0.177923,0.946471,-0.269234,0.161473,0.946593,-0.279000,-0.316568,0.884823,-0.341807,-0.328837,0.857204,-0.396283,\n\t\t\t         0.209510,0.916135,-0.341716,-0.208930,0.895779,-0.392254,-0.271706,0.905545,-0.325724,0.176305,0.938231,-0.297647,\n\t\t\t         0.144536,0.901028,-0.408918,0.146916,0.901120,-0.407819,-0.363720,0.800317,-0.476577,-0.387341,0.783441,-0.485946,\n\t\t\t         0.788446,0.012726,-0.614948,0.840297,0.319498,-0.437941,0.997253,0.069887,0.023255,0.987213,-0.084872,-0.134831,\n\t\t\t         0.784143,-0.620197,-0.020936,0.764031,-0.632801,0.125645,0.291726,-0.941191,-0.170324,0.439619,-0.800501,-0.407300,\n\t\t\t         0.987213,-0.084872,-0.134831,0.997253,0.069887,0.023255,0.944334,-0.193243,0.266213,0.920530,-0.376293,-0.104801,\n\t\t\t         0.784143,-0.620197,-0.020936,0.920530,-0.376293,-0.104801,0.944334,-0.193243,0.266213,0.764031,-0.632801,0.125645,\n\t\t\t         -0.961486,-0.227302,-0.154424,-0.774407,-0.632130,0.026307,-0.805963,-0.581133,0.112461,-0.984191,-0.170324,-0.048128,\n\t\t\t         0.177252,0.896207,-0.406598,-0.173620,0.854060,-0.490280,-0.208930,0.895779,-0.392254,0.209510,0.916135,-0.341716,\n\t\t\t         0.776330,-0.467391,0.422834,0.989929,0.074923,0.119968,0.957244,0.131077,0.257790,0.746239,-0.418775,0.517411,\n\t\t\t         -0.267373,0.144932,-0.952605,-0.602283,0.058321,-0.796136,-0.681600,0.162328,-0.713462,-0.550432,0.141179,-0.822810,\n\t\t\t         0.893735,0.087710,0.439894,0.857082,-0.212500,0.469253,0.865444,-0.348033,0.360302,0.945952,-0.003754,0.324259,\n\t\t\t         -0.561052,0.383831,-0.733390,-0.072451,0.829951,-0.553087,0.006348,0.850093,-0.526536,-0.469893,0.577624,-0.667440,\n\t\t\t         0.017243,-0.653066,0.757073,0.453627,-0.571764,0.683554,0.386639,-0.594989,0.704581,0.005829,-0.647175,0.762291,\n\t\t\t         -0.914762,-0.253639,-0.314371,-0.897366,-0.089084,-0.432173,-0.937498,0.042024,-0.345347,-0.986053,-0.166295,-0.003174,\n\t\t\t         0.945952,-0.003754,0.324259,0.905240,0.392743,0.162023,0.840297,0.486068,0.240028,0.893735,0.087710,0.439894,\n\t\t\t         0.731651,0.681234,0.023835,0.840297,0.486068,0.240028,0.905240,0.392743,0.162023,0.751518,0.659597,0.009857,\n\t\t\t         -0.772698,0.139958,-0.619098,-0.795160,-0.159246,-0.585040,-0.623707,-0.119907,-0.772393,-0.750664,0.068422,-0.657094,\n\t\t\t         -0.469893,0.577624,-0.667440,-0.772698,0.139958,-0.619098,-0.750664,0.068422,-0.657094,-0.561052,0.383831,-0.733390,\n\t\t\t         -0.292398,0.134861,-0.946715,-0.614673,-0.059786,-0.786462,-0.588885,-0.007263,-0.808161,-0.440992,0.066042,-0.895047,\n\t\t\t         0.005829,-0.647175,0.762291,-0.355754,-0.637196,0.683645,-0.368999,-0.627003,0.686056,0.017243,-0.653066,0.757073,\n\t\t\t         -0.784082,-0.069826,-0.616688,-0.681600,0.162328,-0.713462,-0.602283,0.058321,-0.796136,-0.706565,-0.281320,-0.649281,\n\t\t\t         0.772485,-0.448744,0.449263,0.373028,-0.743645,0.554796,0.292673,-0.785485,0.545244,0.744530,-0.489181,0.454268,\n\t\t\t         -0.897366,-0.089084,-0.432173,-0.773217,-0.124149,-0.621815,-0.727836,0.017823,-0.685476,-0.937498,0.042024,-0.345347,\n\t\t\t         -0.474441,-0.083651,-0.876278,-0.623707,-0.119907,-0.772393,-0.795160,-0.159246,-0.585040,-0.427137,-0.214026,-0.878445,\n\t\t\t         -0.986053,-0.166295,-0.003174,-0.810663,-0.451521,0.372692,-0.826716,-0.497238,0.263131,-0.914762,-0.253639,-0.314371,\n\t\t\t         -0.581378,-0.075777,-0.810053,-0.588885,-0.007263,-0.808161,-0.614673,-0.059786,-0.786462,-0.575579,-0.285073,-0.766411,\n\t\t\t         0.744530,-0.489181,0.454268,0.988861,0.144383,-0.036012,0.990783,0.104251,0.086123,0.772485,-0.448744,0.449263,\n\t\t\t         0.814783,-0.384381,0.433973,0.386639,-0.594989,0.704581,0.453627,-0.571764,0.683554,0.843867,-0.328104,0.424512,\n\t\t\t         -0.355754,-0.637196,0.683645,-0.826716,-0.497238,0.263131,-0.810663,-0.451521,0.372692,-0.368999,-0.627003,0.686056,\n\t\t\t         -0.072451,0.829951,-0.553087,0.419477,0.874966,-0.241737,0.468459,0.850337,-0.239631,0.006348,0.850093,-0.526536,\n\t\t\t         0.751518,0.659597,0.009857,0.468459,0.850337,-0.239631,0.419477,0.874966,-0.241737,0.731651,0.681234,0.023835,\n\t\t\t         -0.589221,-0.202124,-0.782250,-0.727836,0.017823,-0.685476,-0.773217,-0.124149,-0.621815,-0.714866,-0.145604,-0.683889,\n\t\t\t         0.746239,-0.418775,0.517411,0.477889,-0.697470,0.533952,0.396130,-0.786584,0.473617,0.776330,-0.467391,0.422834,\n\t\t\t         0.843867,-0.328104,0.424512,0.994324,-0.084017,0.064791,0.987396,-0.147191,0.057802,0.814783,-0.384381,0.433973,\n\t\t\t         -0.723899,0.067019,-0.686636,-0.654256,0.056856,-0.754112,-0.588885,-0.007263,-0.808161,-0.581378,-0.075777,-0.810053,\n\t\t\t         -0.743309,0.160619,-0.649342,-0.747948,0.223457,-0.624989,-0.764794,0.255348,-0.591479,-0.816309,0.209357,-0.538285,\n\t\t\t         -0.477218,-0.047792,-0.877468,-0.503067,0.198523,-0.841121,-0.623707,-0.119907,-0.772393,-0.474441,-0.083651,-0.876278,\n\t\t\t         0.499985,0.830897,-0.244087,-0.126621,0.670553,-0.730949,0.100223,0.701804,-0.705252,0.629109,0.731529,-0.262764,\n\t\t\t         -0.781213,0.056612,-0.621632,-0.747948,0.223457,-0.624989,-0.681600,0.162328,-0.713462,-0.784082,-0.069826,-0.616688,\n\t\t\t         -0.569262,-0.013153,-0.822047,-0.654256,0.056856,-0.754112,-0.744835,0.014801,-0.667043,-0.638752,-0.067934,-0.766350,\n\t\t\t         -0.745811,-0.084384,-0.660756,-0.783624,-0.201727,-0.587542,-0.818781,-0.180792,-0.544877,-0.772271,-0.006836,-0.635243,\n\t\t\t         -0.793664,0.100742,-0.599933,-0.764855,0.279244,-0.580493,-0.759301,0.160436,-0.630604,-0.772271,-0.006836,-0.635243,\n\t\t\t         -0.638752,-0.067934,-0.766350,-0.756218,0.008454,-0.654256,-0.476547,0.302591,-0.825404,-0.469619,0.156957,-0.868770,\n\t\t\t         0.895138,0.406964,-0.181921,0.930967,0.342326,0.126835,0.957244,0.131077,0.257790,0.989929,0.074923,0.119968,\n\t\t\t         -0.793664,0.100742,-0.599933,-0.772271,-0.006836,-0.635243,-0.818781,-0.180792,-0.544877,-0.830866,-0.188238,-0.523606,\n\t\t\t         -0.793664,0.100742,-0.599933,-0.830866,-0.188238,-0.523606,-0.799554,-0.208594,-0.563189,-0.680776,0.060671,-0.729942,\n\t\t\t         -0.816309,0.209357,-0.538285,-0.764794,0.255348,-0.591479,-0.775780,0.331309,-0.536973,-0.839045,0.255470,-0.480331,\n\t\t\t         0.078646,-0.649770,0.756035,-0.334605,-0.740532,0.582781,-0.382061,-0.679250,0.626576,0.117618,-0.607562,0.785485,\n\t\t\t         -0.764855,0.279244,-0.580493,-0.775780,0.331309,-0.536973,-0.764794,0.255348,-0.591479,-0.759301,0.160436,-0.630604,\n\t\t\t         0.862575,-0.432173,0.262947,0.619953,-0.776055,0.115665,0.396130,-0.786584,0.473617,0.477889,-0.697470,0.533952,\n\t\t\t         -0.796228,0.017335,-0.604724,-0.756218,0.008454,-0.654256,-0.861293,-0.008332,-0.508011,-0.868740,-0.084750,-0.487930,\n\t\t\t         -0.647084,0.240638,-0.723411,-0.674703,0.298959,-0.674795,-0.775780,0.331309,-0.536973,-0.764855,0.279244,-0.580493,\n\t\t\t         -0.756218,0.008454,-0.654256,-0.638752,-0.067934,-0.766350,-0.744835,0.014801,-0.667043,-0.861293,-0.008332,-0.508011,\n\t\t\t         -0.839045,0.255470,-0.480331,-0.775780,0.331309,-0.536973,-0.674703,0.298959,-0.674795,-0.777490,0.217383,-0.590075,\n\t\t\t         0.930021,0.254006,0.265481,0.928800,0.131077,0.346599,0.921018,0.129307,0.367412,0.918943,0.250038,0.304941,\n\t\t\t         0.827052,-0.197272,0.526353,0.924467,0.045991,0.378430,0.918424,-0.047731,0.392621,0.831996,-0.172277,0.527299,\n\t\t\t         0.918943,0.250038,0.304941,0.835078,0.547166,0.056673,0.843226,0.537278,0.016144,0.930021,0.254006,0.265481,\n\t\t\t         0.924467,0.045991,0.378430,0.807978,-0.244728,0.535905,0.827296,-0.216041,0.518509,0.918424,-0.047731,0.392621,\n\t\t\t         0.883419,-0.068239,0.463546,0.827296,-0.216041,0.518509,0.807978,-0.244728,0.535905,0.837153,-0.153905,0.524827,\n\t\t\t         0.792169,0.608020,-0.052370,0.724784,0.685659,-0.067232,0.881832,0.402722,0.245216,0.912107,0.337962,0.231941,\n\t\t\t         0.936857,0.157659,0.312082,0.883419,-0.068239,0.463546,0.837153,-0.153905,0.524827,0.929441,0.149449,0.337260,\n\t\t\t         0.912107,0.337962,0.231941,0.881832,0.402722,0.245216,0.902768,0.284799,0.322275,0.922849,0.207251,0.324595,\n\t\t\t         0.831996,-0.172277,0.527299,0.685110,-0.350810,0.638356,0.694205,-0.425886,0.580218,0.827052,-0.197272,0.526353,\n\t\t\t         0.669912,-0.317881,0.670919,0.614215,-0.348460,0.707999,0.646168,-0.311350,0.696768,0.667806,-0.300638,0.680898,\n\t\t\t         0.752220,-0.235267,0.615436,0.851009,-0.107547,0.513962,0.814844,-0.084994,0.573351,0.727744,-0.212928,0.651936,\n\t\t\t         0.894955,0.029450,0.445112,0.861965,-0.085726,0.499649,0.847499,-0.154851,0.507675,0.895871,-0.010956,0.444166,\n\t\t\t         0.614215,-0.348460,0.707999,0.412641,-0.455580,0.788751,0.463301,-0.461074,0.756767,0.646168,-0.311350,0.696768,\n\t\t\t         0.694205,-0.425886,0.580218,0.794946,-0.286630,0.534684,0.912137,-0.275582,0.303323,0.632008,-0.555650,0.540178,\n\t\t\t         0.934080,0.146916,-0.325388,0.978179,0.204657,-0.035554,0.990783,0.104251,0.086123,0.988861,0.144383,-0.036012,\n\t\t\t         0.851009,-0.107547,0.513962,0.861965,-0.085726,0.499649,0.853969,-0.004669,0.520280,0.814844,-0.084994,0.573351,\n\t\t\t         0.922544,0.164922,0.348857,0.894955,0.029450,0.445112,0.895871,-0.010956,0.444166,0.933714,0.155065,0.322642,\n\t\t\t         0.752220,-0.235267,0.615436,0.669912,-0.317881,0.670919,0.667806,-0.300638,0.680898,0.785943,-0.188421,0.588855,\n\t\t\t         0.939787,0.145634,0.309061,0.847163,-0.219001,0.484054,0.807978,-0.244728,0.535905,0.924467,0.045991,0.378430,\n\t\t\t         0.794946,-0.286630,0.534684,0.591815,-0.397717,0.701071,0.688009,-0.359996,0.630055,0.912137,-0.275582,0.303323,\n\t\t\t         0.897305,0.188025,0.399335,0.918943,0.250038,0.304941,0.921018,0.129307,0.367412,0.916227,0.110416,0.385113,\n\t\t\t         0.685110,-0.350810,0.638356,0.702963,-0.297403,0.646016,0.794946,-0.286630,0.534684,0.694205,-0.425886,0.580218,\n\t\t\t         0.921018,0.129307,0.367412,0.929441,0.149449,0.337260,0.911557,0.199774,0.359355,0.916227,0.110416,0.385113,\n\t\t\t         0.802545,-0.236579,0.547624,0.984405,0.028596,0.173498,0.991302,0.038545,0.125645,0.820856,-0.261788,0.507553,\n\t\t\t         -0.026612,-0.633045,0.773644,0.350871,-0.519608,0.779015,0.417005,-0.521592,0.744316,0.010041,-0.627949,0.778161,\n\t\t\t         0.978881,0.176061,-0.103580,0.782617,0.350566,-0.514359,0.760491,0.213446,-0.613208,0.964629,0.188574,-0.184027,\n\t\t\t         -0.986053,-0.166295,-0.003174,-0.960936,-0.256600,0.103519,-0.742821,-0.513749,0.429243,-0.810663,-0.451521,0.372692,\n\t\t\t         0.377422,0.445265,-0.811945,0.289682,0.074679,-0.954192,0.760491,0.213446,-0.613208,0.782617,0.350566,-0.514359,\n\t\t\t         -0.810663,-0.451521,0.372692,-0.742821,-0.513749,0.429243,-0.380993,-0.629627,0.677023,-0.368999,-0.627003,0.686056,\n\t\t\t         0.350871,-0.519608,0.779015,0.802545,-0.236579,0.547624,0.820856,-0.261788,0.507553,0.417005,-0.521592,0.744316,\n\t\t\t         -0.589221,-0.202124,-0.782250,-0.442854,0.185400,-0.877194,-0.727958,0.259499,-0.634571,-0.727836,0.017823,-0.685476,\n\t\t\t         -0.727836,0.017823,-0.685476,-0.727958,0.259499,-0.634571,-0.963439,0.033723,-0.265664,-0.937498,0.042024,-0.345347,\n\t\t\t         -0.282205,-0.392834,-0.875210,-0.093295,0.055269,-0.994079,-0.442854,0.185400,-0.877194,-0.589221,-0.202124,-0.782250,\n\t\t\t         -0.368297,-0.638050,0.676168,-0.026612,-0.633045,0.773644,0.010041,-0.627949,0.778161,-0.380993,-0.629627,0.677023,\n\t\t\t         0.984405,0.028596,0.173498,0.978881,0.176061,-0.103580,0.964629,0.188574,-0.184027,0.991302,0.038545,0.125645,\n\t\t\t         -0.937498,0.042024,-0.345347,-0.963439,0.033723,-0.265664,-0.960936,-0.256600,0.103519,-0.986053,-0.166295,-0.003174,\n\t\t\t         0.077761,-0.461257,-0.883847,0.289682,0.074679,-0.954192,-0.093295,0.055269,-0.994079,-0.282205,-0.392834,-0.875210,\n\t\t\t         0.036012,0.135319,-0.990143,0.058596,0.617603,-0.784295,-0.217780,0.462203,-0.859584,-0.267373,0.144932,-0.952605,\n\t\t\t         -0.068667,-0.791559,0.607196,0.254036,-0.708243,0.658620,0.253975,-0.747887,0.613269,-0.051027,-0.840449,0.539445,\n\t\t\t         0.839656,0.534837,-0.094211,0.657277,0.700705,-0.277352,0.659719,0.672903,-0.334544,0.808191,0.540239,-0.234291,\n\t\t\t         0.364177,0.794733,-0.485488,0.380779,0.727470,-0.570757,0.659719,0.672903,-0.334544,0.657277,0.700705,-0.277352,\n\t\t\t         0.351115,0.822504,-0.447371,0.367901,0.752159,-0.546678,0.589221,0.753990,-0.290231,0.645009,0.727622,-0.233467,\n\t\t\t         -0.542192,-0.575945,-0.611774,-0.780023,-0.575976,-0.244392,-0.669881,-0.742241,0.017090,-0.341777,-0.812891,-0.471541,\n\t\t\t         0.073519,0.340312,-0.937407,0.057955,0.647572,-0.759758,-0.308634,0.459944,-0.832545,-0.292398,0.134861,-0.946715,\n\t\t\t         -0.614673,-0.059786,-0.786462,-0.713645,0.051515,-0.698569,-0.802484,-0.389264,-0.452132,-0.575579,-0.285073,-0.766411,\n\t\t\t         -0.267373,0.144932,-0.952605,-0.217780,0.462203,-0.859584,-0.629841,0.090518,-0.771416,-0.602283,0.058321,-0.796136,\n\t\t\t         0.458968,-0.672719,0.580309,0.762017,-0.418470,0.494125,0.793115,-0.423811,0.437422,0.432691,-0.721763,0.540147,\n\t\t\t         -0.706565,-0.281320,-0.649281,-0.795282,-0.301401,-0.525956,-0.780023,-0.575976,-0.244392,-0.542192,-0.575945,-0.611774,\n\t\t\t         0.969451,0.124271,0.211341,0.839656,0.534837,-0.094211,0.808191,0.540239,-0.234291,0.989105,0.107181,0.100772,\n\t\t\t         0.843471,0.536088,-0.033418,0.645009,0.727622,-0.233467,0.589221,0.753990,-0.290231,0.825434,0.553270,-0.111881,\n\t\t\t         -0.451766,-0.784143,0.425428,-0.068667,-0.791559,0.607196,-0.051027,-0.840449,0.539445,-0.433699,-0.849849,0.299326,\n\t\t\t         0.133732,-0.810511,0.570208,0.458968,-0.672719,0.580309,0.432691,-0.721763,0.540147,0.043031,-0.857479,0.512680,\n\t\t\t         0.384777,0.123600,-0.914670,0.380779,0.727470,-0.570757,0.058596,0.617603,-0.784295,0.036012,0.135319,-0.990143,\n\t\t\t         -0.602283,0.058321,-0.796136,-0.629841,0.090518,-0.771416,-0.795282,-0.301401,-0.525956,-0.706565,-0.281320,-0.649281,\n\t\t\t         -0.795160,-0.159246,-0.585040,-0.874538,-0.117130,-0.470565,-0.848903,-0.364544,-0.382641,-0.427137,-0.214026,-0.878445,\n\t\t\t         0.254036,-0.708243,0.658620,0.679495,-0.456648,0.574206,0.707419,-0.482376,0.516556,0.253975,-0.747887,0.613269,\n\t\t\t         -0.341777,-0.812891,-0.471541,-0.669881,-0.742241,0.017090,-0.433699,-0.849849,0.299326,0.002472,-0.968963,-0.247169,\n\t\t\t         -0.575579,-0.285073,-0.766411,-0.802484,-0.389264,-0.452132,-0.703848,-0.647023,-0.293039,-0.466781,-0.524857,-0.711753,\n\t\t\t         0.679495,-0.456648,0.574206,0.969451,0.124271,0.211341,0.989105,0.107181,0.100772,0.707419,-0.482376,0.516556,\n\t\t\t         0.414289,0.375652,-0.828974,0.367901,0.752159,-0.546678,0.057955,0.647572,-0.759758,0.073519,0.340312,-0.937407,\n\t\t\t         -0.772698,0.139958,-0.619098,-0.784204,0.224372,-0.578478,-0.874538,-0.117130,-0.470565,-0.795160,-0.159246,-0.585040,\n\t\t\t         -0.466781,-0.524857,-0.711753,-0.703848,-0.647023,-0.293039,-0.543352,-0.833216,-0.102420,-0.082186,-0.813746,-0.575335,\n\t\t\t         0.948485,-0.108493,0.297617,0.938963,0.309122,0.150761,0.930906,0.330363,0.155675,0.964110,-0.063967,0.257546,\n\t\t\t         -0.316630,-0.337504,-0.886441,-0.707633,-0.641987,-0.295053,-0.301675,-0.953063,-0.024812,0.135655,-0.682272,-0.718375,\n\t\t\t         0.552477,-0.777886,0.299387,0.812677,-0.468612,0.346294,0.857936,-0.419416,0.296579,0.584948,-0.770623,0.252815,\n\t\t\t         0.962554,0.117618,0.244240,0.843471,0.536088,-0.033418,0.825434,0.553270,-0.111881,0.980407,0.058260,0.188116,\n\t\t\t         -0.082186,-0.813746,-0.575335,-0.543352,-0.833216,-0.102420,-0.252724,-0.925748,0.281167,0.323130,-0.945647,-0.036409,\n\t\t\t         0.762017,-0.418470,0.494125,0.962554,0.117618,0.244240,0.980407,0.058260,0.188116,0.793115,-0.423811,0.437422,\n\t\t\t         -0.264840,-0.895718,0.357097,0.133732,-0.810511,0.570208,0.043031,-0.857479,0.512680,-0.252724,-0.925748,0.281167,\n\t\t\t         -0.292398,0.134861,-0.946715,-0.308634,0.459944,-0.832545,-0.713645,0.051515,-0.698569,-0.614673,-0.059786,-0.786462,\n\t\t\t         0.938963,0.309122,0.150761,0.765374,0.641469,-0.051698,0.761681,0.647664,-0.018769,0.930906,0.330363,0.155675,\n\t\t\t         0.812677,-0.468612,0.346294,0.948485,-0.108493,0.297617,0.964110,-0.063967,0.257546,0.857936,-0.419416,0.296579,\n\t\t\t         -0.427137,-0.214026,-0.878445,-0.848903,-0.364544,-0.382641,-0.707633,-0.641987,-0.295053,-0.316630,-0.337504,-0.886441,\n\t\t\t         -0.469893,0.577624,-0.667440,-0.423963,0.660237,-0.619922,-0.784204,0.224372,-0.578478,-0.772698,0.139958,-0.619098,\n\t\t\t         0.133549,-0.977508,0.163152,0.552477,-0.777886,0.299387,0.584948,-0.770623,0.252815,0.232215,-0.957671,0.169958,\n\t\t\t         0.006348,0.850093,-0.526536,0.118992,0.877163,-0.465194,-0.423963,0.660237,-0.619922,-0.469893,0.577624,-0.667440,\n\t\t\t         0.135655,-0.682272,-0.718375,-0.301675,-0.953063,-0.024812,0.232215,-0.957671,0.169958,0.665395,-0.695212,-0.271828,\n\t\t\t         0.765374,0.641469,-0.051698,0.503250,0.830042,-0.240272,0.513199,0.825220,-0.235817,0.761681,0.647664,-0.018769,\n\t\t\t         0.101718,0.907498,-0.407514,0.118992,0.877163,-0.465194,0.513199,0.825220,-0.235817,0.503250,0.830042,-0.240272,\n\t\t\t         0.616321,-0.194159,0.763146,0.728660,-0.104099,0.676870,0.715655,-0.154185,0.681223,0.598946,-0.235763,0.765297,\n\t\t\t         0.925169,0.213141,0.314005,0.905362,0.401349,0.138554,0.910258,0.404063,0.090351,0.940099,0.186359,0.285456,\n\t\t\t         -0.782281,-0.616108,0.091617,-0.863277,-0.472365,-0.177740,-0.901639,-0.413282,-0.127354,-0.847652,-0.501297,0.173559,\n\t\t\t         0.575091,0.761742,-0.298288,0.816309,0.577105,-0.023316,0.831111,0.547777,0.095584,0.580248,0.789850,-0.198431,\n\t\t\t         0.905362,0.401349,0.138554,0.816309,0.577105,-0.023316,0.788474,0.610503,-0.074794,0.910258,0.404063,0.090351,\n\t\t\t         -0.863277,-0.472365,-0.177740,-0.866146,-0.333720,-0.371990,-0.888668,-0.297555,-0.348827,-0.901639,-0.413282,-0.127354,\n\t\t\t         -0.285592,0.497940,-0.818812,-0.629871,0.113559,-0.768334,-0.641326,0.144426,-0.753553,-0.316504,0.508926,-0.800512,\n\t\t\t         0.450179,-0.319865,0.833644,0.616321,-0.194159,0.763146,0.598946,-0.235763,0.765297,0.425925,-0.371920,0.824781,\n\t\t\t         0.450179,-0.319865,0.833644,0.189337,-0.474166,0.859798,0.222571,-0.385418,0.895474,0.480880,-0.258461,0.837794,\n\t\t\t         -0.629871,0.113559,-0.768334,-0.735405,-0.043550,-0.676199,-0.734299,-0.035796,-0.677882,-0.641326,0.144426,-0.753553,\n\t\t\t         0.728660,-0.104099,0.676870,0.818812,-0.026795,0.573412,0.813646,-0.080258,0.575794,0.715655,-0.154185,0.681223,\n\t\t\t         0.189337,-0.474166,0.859798,-0.245247,-0.643971,0.724631,-0.219214,-0.504288,0.835231,0.222571,-0.385418,0.895474,\n\t\t\t         -0.735405,-0.043550,-0.676199,-0.817164,-0.185217,-0.545793,-0.810257,-0.178384,-0.558267,-0.734299,-0.035796,-0.677882,\n\t\t\t         0.818812,-0.026795,0.573412,0.887082,0.067751,0.456587,0.893779,0.024910,0.447815,0.813646,-0.080258,0.575794,\n\t\t\t         -0.817164,-0.185217,-0.545793,-0.866146,-0.333720,-0.371990,-0.865771,-0.336140,-0.370742,-0.810257,-0.178384,-0.558267,\n\t\t\t         0.887082,0.067751,0.456587,0.925169,0.213141,0.314005,0.940099,0.186359,0.285456,0.893779,0.024910,0.447815,\n\t\t\t         0.929441,0.149449,0.337260,0.837153,-0.153905,0.524827,0.761437,-0.233467,0.604694,0.911557,0.199774,0.359355,\n\t\t\t         0.827052,-0.197272,0.526353,0.694205,-0.425886,0.580218,0.632008,-0.555650,0.540178,0.788049,-0.183081,0.587725,\n\t\t\t         0.117618,-0.607562,0.785485,0.688009,-0.359996,0.630055,0.591815,-0.397717,0.701071,0.078646,-0.649770,0.756035,\n\t\t\t         0.788049,-0.183081,0.587725,0.939787,0.145634,0.309061,0.924467,0.045991,0.378430,0.827052,-0.197272,0.526353,\n\t\t\t         0.725639,-0.270425,0.632679,0.761437,-0.233467,0.604694,0.847163,-0.219001,0.484054,0.577227,-0.518479,0.630818,\n\t\t\t         0.752983,-0.297494,0.586932,0.788049,-0.183081,0.587725,0.632008,-0.555650,0.540178,0.464095,-0.614002,0.638417,\n\t\t\t         0.837153,-0.153905,0.524827,0.807978,-0.244728,0.535905,0.847163,-0.219001,0.484054,0.761437,-0.233467,0.604694,\n\t\t\t         0.865841,0.211371,0.453444,0.893735,0.087710,0.439894,0.840297,0.486068,0.240028,0.816523,0.474868,0.328196,\n\t\t\t         0.605182,-0.727866,0.322428,0.461684,-0.862300,0.207984,0.292673,-0.785485,0.545244,0.373028,-0.743645,0.554796,\n\t\t\t         0.963500,-0.153447,-0.219214,0.959075,-0.281625,-0.028352,0.987396,-0.147191,0.057802,0.994324,-0.084017,0.064791,\n\t\t\t         0.461684,-0.862300,0.207984,0.963500,-0.153447,-0.219214,0.564959,-0.364299,-0.740318,0.002472,-0.968963,-0.247169,\n\t\t\t         0.963500,-0.153447,-0.219214,0.461684,-0.862300,0.207984,0.605182,-0.727866,0.322428,0.959075,-0.281625,-0.028352,\n\t\t\t         0.893735,0.087710,0.439894,0.865841,0.211371,0.453444,0.853084,-0.076998,0.516007,0.857082,-0.212500,0.469253,\n\t\t\t         0.916227,0.110416,0.385113,0.958098,0.000641,0.286416,0.857082,-0.212500,0.469253,0.853084,-0.076998,0.516007,\n\t\t\t         0.619953,-0.776055,0.115665,0.934080,0.146916,-0.325388,0.839198,0.191961,-0.508774,0.323130,-0.945647,-0.036409,\n\t\t\t         0.761437,-0.233467,0.604694,0.725639,-0.270425,0.632679,0.868801,0.100040,0.484909,0.911557,0.199774,0.359355,\n\t\t\t         0.934080,0.146916,-0.325388,0.619953,-0.776055,0.115665,0.862575,-0.432173,0.262947,0.978179,0.204657,-0.035554,\n\t\t\t         0.911557,0.199774,0.359355,0.930967,0.342326,0.126835,0.958098,0.000641,0.286416,0.916227,0.110416,0.385113,\n\t\t\t         0.897305,0.188025,0.399335,0.865841,0.211371,0.453444,0.816523,0.474868,0.328196,0.803735,0.582629,0.120396,\n\t\t\t         0.918943,0.250038,0.304941,0.897305,0.188025,0.399335,0.803735,0.582629,0.120396,0.835078,0.547166,0.056673,\n\t\t\t         0.958098,0.000641,0.286416,0.953307,-0.301981,-0.000031,0.865444,-0.348033,0.360302,0.857082,-0.212500,0.469253,\n\t\t\t         0.895138,0.406964,-0.181921,0.953307,-0.301981,-0.000031,0.958098,0.000641,0.286416,0.930967,0.342326,0.126835,\n\t\t\t         0.953307,-0.301981,-0.000031,0.895138,0.406964,-0.181921,0.807917,0.315043,-0.498001,0.665395,-0.695212,-0.271828,\n\t\t\t         0.865841,0.211371,0.453444,0.897305,0.188025,0.399335,0.916227,0.110416,0.385113,0.853084,-0.076998,0.516007,\n\t\t\t         -0.888272,0.110843,-0.445692,-0.862209,0.029481,-0.505661,-0.868740,-0.084750,-0.487930,-0.861293,-0.008332,-0.508011,\n\t\t\t         0.303720,-0.347636,0.887051,0.222571,-0.385418,0.895474,-0.219214,-0.504288,0.835231,-0.070528,-0.379681,0.922391,\n\t\t\t         0.530747,-0.246986,0.810724,0.480880,-0.258461,0.837794,0.222571,-0.385418,0.895474,0.303720,-0.347636,0.887051,\n\t\t\t         -0.836329,0.474624,-0.274270,-0.960295,0.225532,0.164129,-0.948332,0.252297,0.192297,-0.858028,0.435438,-0.272317,\n\t\t\t         0.884396,-0.177740,-0.431501,0.844600,-0.498764,0.194555,0.834712,-0.501511,0.227393,0.903806,-0.153630,-0.399365,\n\t\t\t         -0.430555,0.518632,-0.738639,0.177465,0.383587,-0.906278,0.224647,0.412214,-0.882931,-0.382092,0.592456,-0.709189,\n\t\t\t         0.662069,0.118229,-0.740043,0.224647,0.412214,-0.882931,0.177465,0.383587,-0.906278,0.635487,0.105472,-0.764855,\n\t\t\t         0.351970,-0.597522,0.720450,-0.231910,-0.427168,0.873897,-0.209723,-0.480392,0.851588,0.357646,-0.623218,0.695425,\n\t\t\t         0.844600,-0.498764,0.194555,0.351970,-0.597522,0.720450,0.357646,-0.623218,0.695425,0.834712,-0.501511,0.227393,\n\t\t\t         0.635487,0.105472,-0.764855,0.884396,-0.177740,-0.431501,0.903806,-0.153630,-0.399365,0.662069,0.118229,-0.740043,\n\t\t\t         -0.231910,-0.427168,0.873897,-0.762291,-0.048799,0.645375,-0.792047,-0.086154,0.604327,-0.209723,-0.480392,0.851588,\n\t\t\t         -0.382092,0.592456,-0.709189,-0.836329,0.474624,-0.274270,-0.858028,0.435438,-0.272317,-0.430555,0.518632,-0.738639,\n\t\t\t         -0.762291,-0.048799,0.645375,-0.948332,0.252297,0.192297,-0.960295,0.225532,0.164129,-0.792047,-0.086154,0.604327,\n\t\t\t         -0.244667,-0.407849,0.879635,-0.782189,-0.050569,0.620960,-0.762291,-0.048799,0.645375,-0.231910,-0.427168,0.873897,\n\t\t\t         -0.782189,-0.050569,0.620960,-0.959014,0.208747,0.191534,-0.948332,0.252297,0.192297,-0.762291,-0.048799,0.645375,\n\t\t\t         -0.430555,0.518632,-0.738639,-0.858028,0.435438,-0.272317,-0.885708,0.371410,-0.278420,-0.475997,0.478805,-0.737632,\n\t\t\t         0.839534,-0.222938,-0.495437,0.846675,-0.516343,0.128422,0.844600,-0.498764,0.194555,0.884396,-0.177740,-0.431501,\n\t\t\t         -0.858028,0.435438,-0.272317,-0.948332,0.252297,0.192297,-0.959014,0.208747,0.191534,-0.885708,0.371410,-0.278420,\n\t\t\t         -0.475997,0.478805,-0.737632,0.149419,0.365642,-0.918668,0.177465,0.383587,-0.906278,-0.430555,0.518632,-0.738639,\n\t\t\t         0.635487,0.105472,-0.764855,0.177465,0.383587,-0.906278,0.149419,0.365642,-0.918668,0.600543,0.077303,-0.795831,\n\t\t\t         0.600543,0.077303,-0.795831,0.839534,-0.222938,-0.495437,0.884396,-0.177740,-0.431501,0.635487,0.105472,-0.764855,\n\t\t\t         0.398602,-0.592120,0.700308,-0.244667,-0.407849,0.879635,-0.231910,-0.427168,0.873897,0.351970,-0.597522,0.720450,\n\t\t\t         0.846675,-0.516343,0.128422,0.398602,-0.592120,0.700308,0.351970,-0.597522,0.720450,0.844600,-0.498764,0.194555,\n\t\t\t         0.372387,-0.650594,0.661794,-0.311045,-0.445967,0.839229,-0.244667,-0.407849,0.879635,0.398602,-0.592120,0.700308,\n\t\t\t         0.802820,-0.595325,0.031709,0.372387,-0.650594,0.661794,0.398602,-0.592120,0.700308,0.846675,-0.516343,0.128422,\n\t\t\t         -0.311045,-0.445967,0.839229,-0.832392,-0.073031,0.549333,-0.782189,-0.050569,0.620960,-0.244667,-0.407849,0.879635,\n\t\t\t         -0.832392,-0.073031,0.549333,-0.967650,0.175329,0.181280,-0.959014,0.208747,0.191534,-0.782189,-0.050569,0.620960,\n\t\t\t         -0.475997,0.478805,-0.737632,-0.885708,0.371410,-0.278420,-0.889584,0.375866,-0.259468,-0.467055,0.485214,-0.739189,\n\t\t\t         0.765984,-0.304331,-0.566240,0.802820,-0.595325,0.031709,0.846675,-0.516343,0.128422,0.839534,-0.222938,-0.495437,\n\t\t\t         -0.885708,0.371410,-0.278420,-0.959014,0.208747,0.191534,-0.967650,0.175329,0.181280,-0.889584,0.375866,-0.259468,\n\t\t\t         -0.467055,0.485214,-0.739189,0.132725,0.322672,-0.937132,0.149419,0.365642,-0.918668,-0.475997,0.478805,-0.737632,\n\t\t\t         0.600543,0.077303,-0.795831,0.149419,0.365642,-0.918668,0.132725,0.322672,-0.937132,0.555498,0.005585,-0.831477,\n\t\t\t         0.555498,0.005585,-0.831477,0.765984,-0.304331,-0.566240,0.839534,-0.222938,-0.495437,0.600543,0.077303,-0.795831,\n\t\t\t         -0.421003,0.474899,-0.772759,0.102603,0.286782,-0.952452,0.132725,0.322672,-0.937132,-0.467055,0.485214,-0.739189,\n\t\t\t         0.555498,0.005585,-0.831477,0.132725,0.322672,-0.937132,0.102603,0.286782,-0.952452,0.474807,-0.046236,-0.878872,\n\t\t\t         0.474807,-0.046236,-0.878872,0.669729,-0.390271,-0.631764,0.765984,-0.304331,-0.566240,0.555498,0.005585,-0.831477,\n\t\t\t         0.329051,-0.722434,0.608081,-0.367412,-0.476943,0.798425,-0.311045,-0.445967,0.839229,0.372387,-0.650594,0.661794,\n\t\t\t         0.720267,-0.690725,-0.063784,0.329051,-0.722434,0.608081,0.372387,-0.650594,0.661794,0.802820,-0.595325,0.031709,\n\t\t\t         -0.367412,-0.476943,0.798425,-0.844508,-0.108707,0.524338,-0.832392,-0.073031,0.549333,-0.311045,-0.445967,0.839229,\n\t\t\t         -0.844508,-0.108707,0.524338,-0.972320,0.185736,0.141575,-0.967650,0.175329,0.181280,-0.832392,-0.073031,0.549333,\n\t\t\t         -0.467055,0.485214,-0.739189,-0.889584,0.375866,-0.259468,-0.857204,0.412183,-0.308664,-0.421003,0.474899,-0.772759,\n\t\t\t         0.669729,-0.390271,-0.631764,0.720267,-0.690725,-0.063784,0.802820,-0.595325,0.031709,0.765984,-0.304331,-0.566240,\n\t\t\t         -0.889584,0.375866,-0.259468,-0.967650,0.175329,0.181280,-0.972320,0.185736,0.141575,-0.857204,0.412183,-0.308664,\n\t\t\t         -0.421003,0.474899,-0.772759,-0.857204,0.412183,-0.308664,-0.816950,0.399701,-0.415693,-0.447798,0.418134,-0.790338,\n\t\t\t         0.424848,-0.584185,-0.691488,0.489608,-0.871700,-0.019318,0.720267,-0.690725,-0.063784,0.669729,-0.390271,-0.631764,\n\t\t\t         -0.857204,0.412183,-0.308664,-0.972320,0.185736,0.141575,-0.976196,0.213385,0.038545,-0.816950,0.399701,-0.415693,\n\t\t\t         -0.447798,0.418134,-0.790338,0.072726,0.189734,-0.979125,0.102603,0.286782,-0.952452,-0.421003,0.474899,-0.772759,\n\t\t\t         0.474807,-0.046236,-0.878872,0.102603,0.286782,-0.952452,0.072726,0.189734,-0.979125,0.343944,-0.158971,-0.925413,\n\t\t\t         0.343944,-0.158971,-0.925413,0.424848,-0.584185,-0.691488,0.669729,-0.390271,-0.631764,0.474807,-0.046236,-0.878872,\n\t\t\t         0.259804,-0.771325,0.580981,-0.301035,-0.542070,0.784539,-0.367412,-0.476943,0.798425,0.329051,-0.722434,0.608081,\n\t\t\t         0.489608,-0.871700,-0.019318,0.259804,-0.771325,0.580981,0.329051,-0.722434,0.608081,0.720267,-0.690725,-0.063784,\n\t\t\t         -0.301035,-0.542070,0.784539,-0.878475,-0.118656,0.462783,-0.844508,-0.108707,0.524338,-0.367412,-0.476943,0.798425,\n\t\t\t         -0.878475,-0.118656,0.462783,-0.976196,0.213385,0.038545,-0.972320,0.185736,0.141575,-0.844508,-0.108707,0.524338,\n\t\t\t         -0.403455,-0.488754,0.773492,-0.902890,-0.115360,0.414075,-0.878475,-0.118656,0.462783,-0.301035,-0.542070,0.784539,\n\t\t\t         -0.902890,-0.115360,0.414075,-0.971618,0.223182,-0.077975,-0.976196,0.213385,0.038545,-0.878475,-0.118656,0.462783,\n\t\t\t         -0.447798,0.418134,-0.790338,-0.816950,0.399701,-0.415693,-0.754387,0.346080,-0.557726,-0.288369,0.226722,-0.930265,\n\t\t\t         -0.092380,-0.861782,-0.498733,0.113315,-0.978179,0.173956,0.489608,-0.871700,-0.019318,0.424848,-0.584185,-0.691488,\n\t\t\t         -0.816950,0.399701,-0.415693,-0.976196,0.213385,0.038545,-0.971618,0.223182,-0.077975,-0.754387,0.346080,-0.557726,\n\t\t\t         -0.288369,0.226722,-0.930265,-0.006012,-0.008454,-0.999939,0.072726,0.189734,-0.979125,-0.447798,0.418134,-0.790338,\n\t\t\t         0.343944,-0.158971,-0.925413,0.072726,0.189734,-0.979125,-0.006012,-0.008454,-0.999939,-0.004791,-0.396466,-0.918027,\n\t\t\t         -0.004791,-0.396466,-0.918027,-0.092380,-0.861782,-0.498733,0.424848,-0.584185,-0.691488,0.343944,-0.158971,-0.925413,\n\t\t\t         0.128086,-0.755089,0.642964,-0.403455,-0.488754,0.773492,-0.301035,-0.542070,0.784539,0.259804,-0.771325,0.580981,\n\t\t\t         0.113315,-0.978179,0.173956,0.128086,-0.755089,0.642964,0.259804,-0.771325,0.580981,0.489608,-0.871700,-0.019318,\n\t\t\t         -0.954741,0.237159,-0.179418,-0.971618,0.223182,-0.077975,-0.902890,-0.115360,0.414075,-0.919370,0.007416,0.393292,\n\t\t\t         -0.720389,0.255531,-0.644765,-0.754387,0.346080,-0.557726,-0.971618,0.223182,-0.077975,-0.954741,0.237159,-0.179418,\n\t\t\t         -0.440443,-0.050386,-0.896359,-0.381420,0.102268,-0.918699,-0.378796,0.204047,-0.902676,-0.413038,0.127079,-0.901791,\n\t\t\t         -0.381420,0.102268,-0.918699,-0.676687,0.284005,-0.679250,-0.629780,0.349834,-0.693472,-0.378796,0.204047,-0.902676,\n\t\t\t         -0.676687,0.284005,-0.679250,-0.910215,0.324198,-0.257637,-0.857570,0.386486,-0.339335,-0.629780,0.349834,-0.693472,\n\t\t\t         -0.413038,0.127079,-0.901791,-0.378796,0.204047,-0.902676,-0.382702,0.241523,-0.891720,-0.437941,0.204688,-0.875362,\n\t\t\t         -0.437941,0.204688,-0.875362,-0.382702,0.241523,-0.891720,-0.452254,0.163366,-0.876766,-0.569353,0.128178,-0.812006,\n\t\t\t         -0.569353,0.128178,-0.812006,-0.452254,0.163366,-0.876766,-0.632954,-0.077609,-0.770257,-0.730735,-0.086978,-0.677053,\n\t\t\t         -0.408338,-0.252052,0.877316,0.077700,-0.507797,0.857936,-0.132481,-0.319956,0.938108,-0.601337,-0.039094,0.797998,\n\t\t\t         -0.730735,-0.086978,-0.677053,-0.632954,-0.077609,-0.770257,-0.727928,-0.209693,-0.652791,-0.787103,-0.196814,-0.584552,\n\t\t\t         -0.787103,-0.196814,-0.584552,-0.727928,-0.209693,-0.652791,-0.704123,-0.036287,-0.709128,-0.754326,-0.052248,-0.654378,\n\t\t\t         -0.408032,0.448225,-0.795343,-0.704123,-0.036287,-0.709128,-0.683584,0.151799,-0.713889,-0.505539,0.405255,-0.761681,\n\t\t\t         -0.374889,0.462203,-0.803613,-0.754326,-0.052248,-0.654378,-0.704123,-0.036287,-0.709128,-0.408032,0.448225,-0.795343,\n\t\t\t         0.077761,-0.461257,-0.883847,-0.341777,-0.812891,-0.471541,0.002472,-0.968963,-0.247169,0.564959,-0.364299,-0.740318,\n\t\t\t         0.384777,0.123600,-0.914670,-0.082186,-0.813746,-0.575335,0.323130,-0.945647,-0.036409,0.839198,0.191961,-0.508774,\n\t\t\t         -0.282205,-0.392834,-0.875210,-0.542192,-0.575945,-0.611774,-0.341777,-0.812891,-0.471541,0.077761,-0.461257,-0.883847,\n\t\t\t         -0.542192,-0.575945,-0.611774,-0.282205,-0.392834,-0.875210,-0.589221,-0.202124,-0.782250,-0.706565,-0.281320,-0.649281,\n\t\t\t         -0.706565,-0.281320,-0.649281,-0.589221,-0.202124,-0.782250,-0.714866,-0.145604,-0.683889,-0.784082,-0.069826,-0.616688,\n\t\t\t         -0.745811,-0.084384,-0.660756,-0.781213,0.056612,-0.621632,-0.784082,-0.069826,-0.616688,-0.714866,-0.145604,-0.683889,\n\t\t\t         -0.799554,-0.208594,-0.563189,-0.696921,-0.318125,-0.642689,-0.440443,-0.050386,-0.896359,-0.680776,0.060671,-0.729942,\n\t\t\t         -0.764855,0.279244,-0.580493,-0.793664,0.100742,-0.599933,-0.680776,0.060671,-0.729942,-0.647084,0.240638,-0.723411,\n\t\t\t         -0.337626,0.101688,-0.935759,-0.288369,0.226722,-0.930265,-0.754387,0.346080,-0.557726,-0.720389,0.255531,-0.644765,\n\t\t\t         0.036012,0.135319,-0.990143,-0.466781,-0.524857,-0.711753,-0.082186,-0.813746,-0.575335,0.384777,0.123600,-0.914670,\n\t\t\t         -0.466781,-0.524857,-0.711753,0.036012,0.135319,-0.990143,-0.267373,0.144932,-0.952605,-0.575579,-0.285073,-0.766411,\n\t\t\t         0.414289,0.375652,-0.828974,0.135655,-0.682272,-0.718375,0.665395,-0.695212,-0.271828,0.807917,0.315043,-0.498001,\n\t\t\t         0.073519,0.340312,-0.937407,-0.316630,-0.337504,-0.886441,0.135655,-0.682272,-0.718375,0.414289,0.375652,-0.828974,\n\t\t\t         -0.316630,-0.337504,-0.886441,0.073519,0.340312,-0.937407,-0.292398,0.134861,-0.946715,-0.427137,-0.214026,-0.878445,\n\t\t\t         -0.427137,-0.214026,-0.878445,-0.292398,0.134861,-0.946715,-0.440992,0.066042,-0.895047,-0.474441,-0.083651,-0.876278,\n\t\t\t         -0.569262,-0.013153,-0.822047,-0.477218,-0.047792,-0.877468,-0.474441,-0.083651,-0.876278,-0.440992,0.066042,-0.895047,\n\t\t\t         -0.888272,0.110843,-0.445692,-0.834101,0.110233,-0.540452,-0.816309,0.209357,-0.538285,-0.839045,0.255470,-0.480331,\n\t\t\t         -0.862209,0.029481,-0.505661,-0.888272,0.110843,-0.445692,-0.839045,0.255470,-0.480331,-0.777490,0.217383,-0.590075,\n\t\t\t         -0.861293,-0.008332,-0.508011,-0.744835,0.014801,-0.667043,-0.834101,0.110233,-0.540452,-0.888272,0.110843,-0.445692,\n\t\t\t         -0.723899,0.067019,-0.686636,-0.743309,0.160619,-0.649342,-0.816309,0.209357,-0.538285,-0.834101,0.110233,-0.540452,\n\t\t\t         -0.550432,0.141179,-0.822810,-0.581378,-0.075777,-0.810053,-0.575579,-0.285073,-0.766411,-0.267373,0.144932,-0.952605,\n\t\t\t         -0.469619,0.156957,-0.868770,-0.476547,0.302591,-0.825404,0.100223,0.701804,-0.705252,-0.126621,0.670553,-0.730949,\n\t\t\t         0.922544,0.164922,0.348857,0.922849,0.207251,0.324595,0.902768,0.284799,0.322275,0.902860,0.195288,0.382946,\n\t\t\t         0.929441,0.149449,0.337260,0.921018,0.129307,0.367412,0.928800,0.131077,0.346599,0.936857,0.157659,0.312082,\n\t\t\t         0.688009,-0.359996,0.630055,0.750298,-0.370891,0.547227,0.951415,-0.173772,0.254067,0.912137,-0.275582,0.303323,\n\t\t\t         0.688009,-0.359996,0.630055,0.117618,-0.607562,0.785485,0.422101,-0.531693,0.734214,0.750298,-0.370891,0.547227,\n\t\t\t         0.788049,-0.183081,0.587725,0.752983,-0.297494,0.586932,0.941679,0.035279,0.334605,0.939787,0.145634,0.309061,\n\t\t\t         0.835078,0.547166,0.056673,0.803735,0.582629,0.120396,0.499985,0.830897,-0.244087,0.629109,0.731529,-0.262764,\n\t\t\t         -0.243873,-0.113285,-0.963134,-0.006012,-0.008454,-0.999939,-0.288369,0.226722,-0.930265,-0.337626,0.101688,-0.935759,\n\t\t\t         0.927122,0.291574,0.235389,0.912107,0.337962,0.231941,0.922849,0.207251,0.324595,0.930509,0.154363,0.332041,\n\t\t\t         0.645741,-0.299264,0.702414,0.536546,-0.343028,0.770959,0.614215,-0.348460,0.707999,0.669912,-0.317881,0.670919,\n\t\t\t         0.933714,0.155065,0.322642,0.930509,0.154363,0.332041,0.922849,0.207251,0.324595,0.922544,0.164922,0.348857,\n\t\t\t         0.902860,0.195288,0.382946,0.883999,0.097232,0.457198,0.894955,0.029450,0.445112,0.922544,0.164922,0.348857,\n\t\t\t         0.536546,-0.343028,0.770959,0.293313,-0.387158,0.874081,0.412641,-0.455580,0.788751,0.614215,-0.348460,0.707999,\n\t\t\t         0.785943,-0.188421,0.588855,0.882931,-0.081118,0.462416,0.851009,-0.107547,0.513962,0.752220,-0.235267,0.615436,\n\t\t\t         0.883999,0.097232,0.457198,0.853969,-0.004669,0.520280,0.861965,-0.085726,0.499649,0.894955,0.029450,0.445112,\n\t\t\t         0.727744,-0.212928,0.651936,0.645741,-0.299264,0.702414,0.669912,-0.317881,0.670919,0.752220,-0.235267,0.615436,\n\t\t\t         0.882931,-0.081118,0.462416,0.847499,-0.154851,0.507675,0.861965,-0.085726,0.499649,0.851009,-0.107547,0.513962,\n\t\t\t         0.100223,0.701804,-0.705252,-0.476547,0.302591,-0.825404,-0.416425,0.423170,-0.804651,0.265358,0.729209,-0.630696,\n\t\t\t         -0.727928,-0.209693,-0.652791,-0.775109,-0.029969,-0.631062,-0.683584,0.151799,-0.713889,-0.704123,-0.036287,-0.709128,\n\t\t\t         -0.756218,0.008454,-0.654256,-0.796228,0.017335,-0.604724,-0.416425,0.423170,-0.804651,-0.476547,0.302591,-0.825404,\n\t\t\t         -0.632954,-0.077609,-0.770257,-0.723624,0.075014,-0.686087,-0.775109,-0.029969,-0.631062,-0.727928,-0.209693,-0.652791,\n\t\t\t         -0.418928,-0.403485,-0.813410,-0.004791,-0.396466,-0.918027,-0.006012,-0.008454,-0.999939,-0.243873,-0.113285,-0.963134,\n\t\t\t         -0.004791,-0.396466,-0.918027,-0.418928,-0.403485,-0.813410,-0.570696,-0.796472,-0.199713,-0.092380,-0.861782,-0.498733,\n\t\t\t         -0.165319,-0.924345,0.343822,0.113315,-0.978179,0.173956,-0.092380,-0.861782,-0.498733,-0.570696,-0.796472,-0.199713,\n\t\t\t         0.040590,-0.729179,0.683065,0.128086,-0.755089,0.642964,0.113315,-0.978179,0.173956,-0.165319,-0.924345,0.343822,\n\t\t\t         0.128086,-0.755089,0.642964,0.040590,-0.729179,0.683065,-0.380810,-0.385662,0.840358,-0.403455,-0.488754,0.773492,\n\t\t\t         0.412641,-0.455580,0.788751,0.293313,-0.387158,0.874081,-0.132481,-0.319956,0.938108,0.077700,-0.507797,0.857936,\n\t\t\t         0.510330,0.792779,-0.333171,0.159612,0.801355,-0.576464,-0.107761,0.773522,-0.624531,0.123234,0.878231,-0.462020,\n\t\t\t         0.159612,0.801355,-0.576464,0.510330,0.792779,-0.333171,0.624714,0.736045,-0.260659,0.285318,0.784417,-0.550676,\n\t\t\t         0.843226,0.537278,0.016144,0.835078,0.547166,0.056673,0.629109,0.731529,-0.262764,0.663442,0.707602,-0.243080,\n\t\t\t         -0.918058,0.190649,0.347575,-0.408338,-0.252052,0.877316,-0.601337,-0.039094,0.797998,-0.928281,0.302316,0.216529,\n\t\t\t         0.530747,-0.246986,0.810724,0.589923,-0.265175,0.762627,0.702414,-0.164678,0.692404,0.671987,-0.135105,0.728111,\n\t\t\t         0.671987,-0.135105,0.728111,0.702414,-0.164678,0.692404,0.785058,-0.049135,0.617450,0.763390,-0.023408,0.645466,\n\t\t\t         0.763390,-0.023408,0.645466,0.785058,-0.049135,0.617450,0.835719,0.049287,0.546892,0.820643,0.075320,0.566424,\n\t\t\t         0.820643,0.075320,0.566424,0.835719,0.049287,0.546892,0.869259,0.145970,0.472243,0.858364,0.163518,0.486251,\n\t\t\t         0.858364,0.163518,0.486251,0.869259,0.145970,0.472243,0.884884,0.234779,0.402264,0.880245,0.265328,0.393353,\n\t\t\t         -0.602069,-0.690725,0.400433,-0.584273,-0.743435,0.325468,-0.768713,-0.638991,0.027748,-0.782281,-0.616108,0.091617,\n\t\t\t         0.880245,0.265328,0.393353,0.884884,0.234779,0.402264,0.879879,0.358592,0.311716,0.872799,0.404523,0.273019,\n\t\t\t         0.872799,0.404523,0.273019,0.879879,0.358592,0.311716,0.846339,0.480575,0.229652,0.830805,0.527757,0.176580,\n\t\t\t         0.645741,-0.299264,0.702414,0.589923,-0.265175,0.762627,0.414075,-0.329753,0.848384,0.536546,-0.343028,0.770959,\n\t\t\t         0.727744,-0.212928,0.651936,0.702414,-0.164678,0.692404,0.589923,-0.265175,0.762627,0.645741,-0.299264,0.702414,\n\t\t\t         0.702414,-0.164678,0.692404,0.727744,-0.212928,0.651936,0.814844,-0.084994,0.573351,0.785058,-0.049135,0.617450,\n\t\t\t         0.785058,-0.049135,0.617450,0.814844,-0.084994,0.573351,0.853969,-0.004669,0.520280,0.835719,0.049287,0.546892,\n\t\t\t         0.883999,0.097232,0.457198,0.869259,0.145970,0.472243,0.835719,0.049287,0.546892,0.853969,-0.004669,0.520280,\n\t\t\t         0.902860,0.195288,0.382946,0.884884,0.234779,0.402264,0.869259,0.145970,0.472243,0.883999,0.097232,0.457198,\n\t\t\t         0.884884,0.234779,0.402264,0.902860,0.195288,0.382946,0.902768,0.284799,0.322275,0.879879,0.358592,0.311716,\n\t\t\t         0.591754,0.797113,-0.119938,0.580248,0.789850,-0.198431,0.831111,0.547777,0.095584,0.830805,0.527757,0.176580,\n\t\t\t         -0.245247,-0.643971,0.724631,-0.602069,-0.690725,0.400433,-0.663472,-0.536180,0.521805,-0.219214,-0.504288,0.835231,\n\t\t\t         0.575091,0.761742,-0.298288,0.190374,0.775811,-0.601520,0.184549,0.764111,-0.618123,0.525459,0.772865,-0.355770,\n\t\t\t         0.002747,0.819880,-0.572497,0.103977,0.811274,-0.575335,0.580248,0.789850,-0.198431,0.591754,0.797113,-0.119938,\n\t\t\t         0.881832,0.402722,0.245216,0.846339,0.480575,0.229652,0.879879,0.358592,0.311716,0.902768,0.284799,0.322275,\n\t\t\t         0.868801,0.100040,0.484909,0.957244,0.131077,0.257790,0.930967,0.342326,0.126835,0.911557,0.199774,0.359355,\n\t\t\t         -0.834101,0.110233,-0.540452,-0.744835,0.014801,-0.667043,-0.654256,0.056856,-0.754112,-0.723899,0.067019,-0.686636,\n\t\t\t         -0.851375,-0.367321,-0.374401,-0.818781,-0.180792,-0.544877,-0.783624,-0.201727,-0.587542,-0.914762,-0.253639,-0.314371,\n\t\t\t         0.725639,-0.270425,0.632679,0.746239,-0.418775,0.517411,0.957244,0.131077,0.257790,0.868801,0.100040,0.484909,\n\t\t\t         0.746239,-0.418775,0.517411,0.725639,-0.270425,0.632679,0.577227,-0.518479,0.630818,0.477889,-0.697470,0.533952,\n\t\t\t         -0.550432,0.141179,-0.822810,-0.681600,0.162328,-0.713462,-0.747948,0.223457,-0.624989,-0.743309,0.160619,-0.649342,\n\t\t\t         0.847163,-0.219001,0.484054,0.862575,-0.432173,0.262947,0.477889,-0.697470,0.533952,0.577227,-0.518479,0.630818,\n\t\t\t         -0.469619,0.156957,-0.868770,-0.126621,0.670553,-0.730949,-0.503067,0.198523,-0.841121,-0.477218,-0.047792,-0.877468,\n\t\t\t         -0.914762,-0.253639,-0.314371,-0.783624,-0.201727,-0.587542,-0.773217,-0.124149,-0.621815,-0.897366,-0.089084,-0.432173,\n\t\t\t         0.862575,-0.432173,0.262947,0.847163,-0.219001,0.484054,0.939787,0.145634,0.309061,0.978179,0.204657,-0.035554,\n\t\t\t         0.941679,0.035279,0.334605,0.990783,0.104251,0.086123,0.978179,0.204657,-0.035554,0.939787,0.145634,0.309061,\n\t\t\t         0.752983,-0.297494,0.586932,0.772485,-0.448744,0.449263,0.990783,0.104251,0.086123,0.941679,0.035279,0.334605,\n\t\t\t         0.772485,-0.448744,0.449263,0.752983,-0.297494,0.586932,0.464095,-0.614002,0.638417,0.373028,-0.743645,0.554796,\n\t\t\t         -0.759301,0.160436,-0.630604,-0.764794,0.255348,-0.591479,-0.747948,0.223457,-0.624989,-0.781213,0.056612,-0.621632,\n\t\t\t         -0.440992,0.066042,-0.895047,-0.588885,-0.007263,-0.808161,-0.654256,0.056856,-0.754112,-0.569262,-0.013153,-0.822047,\n\t\t\t         -0.561052,0.383831,-0.733390,-0.503067,0.198523,-0.841121,-0.126621,0.670553,-0.730949,-0.072451,0.829951,-0.553087,\n\t\t\t         0.632008,-0.555650,0.540178,0.605182,-0.727866,0.322428,0.373028,-0.743645,0.554796,0.464095,-0.614002,0.638417,\n\t\t\t         -0.714866,-0.145604,-0.683889,-0.773217,-0.124149,-0.621815,-0.783624,-0.201727,-0.587542,-0.745811,-0.084384,-0.660756,\n\t\t\t         0.605182,-0.727866,0.322428,0.632008,-0.555650,0.540178,0.912137,-0.275582,0.303323,0.959075,-0.281625,-0.028352,\n\t\t\t         0.951415,-0.173772,0.254067,0.987396,-0.147191,0.057802,0.959075,-0.281625,-0.028352,0.912137,-0.275582,0.303323,\n\t\t\t         0.750298,-0.370891,0.547227,0.814783,-0.384381,0.433973,0.987396,-0.147191,0.057802,0.951415,-0.173772,0.254067,\n\t\t\t         -0.561052,0.383831,-0.733390,-0.750664,0.068422,-0.657094,-0.623707,-0.119907,-0.772393,-0.503067,0.198523,-0.841121,\n\t\t\t         0.814783,-0.384381,0.433973,0.750298,-0.370891,0.547227,0.422101,-0.531693,0.734214,0.386639,-0.594989,0.704581,\n\t\t\t         0.117618,-0.607562,0.785485,0.005829,-0.647175,0.762291,0.386639,-0.594989,0.704581,0.422101,-0.531693,0.734214,\n\t\t\t         0.005829,-0.647175,0.762291,0.117618,-0.607562,0.785485,-0.382061,-0.679250,0.626576,-0.355754,-0.637196,0.683645,\n\t\t\t         -0.334605,-0.740532,0.582781,-0.780663,-0.624561,-0.020966,-0.780908,-0.611042,0.129460,-0.382061,-0.679250,0.626576,\n\t\t\t         -0.851375,-0.367321,-0.374401,-0.780908,-0.611042,0.129460,-0.780663,-0.624561,-0.020966,-0.835902,-0.348094,-0.424299,\n\t\t\t         -0.072451,0.829951,-0.553087,-0.126621,0.670553,-0.730949,0.499985,0.830897,-0.244087,0.419477,0.874966,-0.241737,\n\t\t\t         0.803735,0.582629,0.120396,0.731651,0.681234,0.023835,0.419477,0.874966,-0.241737,0.499985,0.830897,-0.244087,\n\t\t\t         0.731651,0.681234,0.023835,0.803735,0.582629,0.120396,0.816523,0.474868,0.328196,0.840297,0.486068,0.240028,\n\t\t\t         -0.355754,-0.637196,0.683645,-0.382061,-0.679250,0.626576,-0.780908,-0.611042,0.129460,-0.826716,-0.497238,0.263131,\n\t\t\t         -0.772271,-0.006836,-0.635243,-0.759301,0.160436,-0.630604,-0.781213,0.056612,-0.621632,-0.745811,-0.084384,-0.660756,\n\t\t\t         -0.638752,-0.067934,-0.766350,-0.469619,0.156957,-0.868770,-0.477218,-0.047792,-0.877468,-0.569262,-0.013153,-0.822047,\n\t\t\t         -0.581378,-0.075777,-0.810053,-0.550432,0.141179,-0.822810,-0.743309,0.160619,-0.649342,-0.723899,0.067019,-0.686636,\n\t\t\t         -0.403455,-0.488754,0.773492,-0.380810,-0.385662,0.840358,-0.919370,0.007416,0.393292,-0.902890,-0.115360,0.414075,\n\t\t\t         -0.240242,-0.816980,0.524186,-0.165319,-0.924345,0.343822,-0.570696,-0.796472,-0.199713,-0.728050,-0.685476,-0.003540,\n\t\t\t         0.013215,-0.698813,0.715140,0.040590,-0.729179,0.683065,-0.165319,-0.924345,0.343822,-0.240242,-0.816980,0.524186,\n\t\t\t         0.591815,-0.397717,0.701071,0.794946,-0.286630,0.534684,0.702963,-0.297403,0.646016,0.509262,-0.426679,0.747368,\n\t\t\t         0.077700,-0.507797,0.857936,0.186010,-0.644551,0.741539,0.463301,-0.461074,0.756767,0.412641,-0.455580,0.788751,\n\t\t\t         0.724784,0.685659,-0.067232,0.626576,0.772393,-0.103763,0.846339,0.480575,0.229652,0.881832,0.402722,0.245216,\n\t\t\t         -0.408338,-0.252052,0.877316,-0.380810,-0.385662,0.840358,0.040590,-0.729179,0.683065,0.013215,-0.698813,0.715140,\n\t\t\t         0.724784,0.685659,-0.067232,0.123234,0.878231,-0.462020,0.027070,0.858089,-0.512711,0.626576,0.772393,-0.103763,\n\t\t\t         0.126865,-0.668142,0.733085,0.078646,-0.649770,0.756035,0.591815,-0.397717,0.701071,0.509262,-0.426679,0.747368,\n\t\t\t         0.509262,-0.426679,0.747368,0.463301,-0.461074,0.756767,0.186010,-0.644551,0.741539,0.126865,-0.668142,0.733085,\n\t\t\t         0.186010,-0.644551,0.741539,0.013215,-0.698813,0.715140,-0.240242,-0.816980,0.524186,0.126865,-0.668142,0.733085,\n\t\t\t         0.078646,-0.649770,0.756035,0.126865,-0.668142,0.733085,-0.240242,-0.816980,0.524186,-0.334605,-0.740532,0.582781,\n\t\t\t         0.702963,-0.297403,0.646016,0.646168,-0.311350,0.696768,0.463301,-0.461074,0.756767,0.509262,-0.426679,0.747368,\n\t\t\t         0.685110,-0.350810,0.638356,0.667806,-0.300638,0.680898,0.646168,-0.311350,0.696768,0.702963,-0.297403,0.646016,\n\t\t\t         -0.408032,0.448225,-0.795343,0.159612,0.801355,-0.576464,0.285318,0.784417,-0.550676,-0.374889,0.462203,-0.803613,\n\t\t\t         0.159612,0.801355,-0.576464,-0.408032,0.448225,-0.795343,-0.505539,0.405255,-0.761681,-0.107761,0.773522,-0.624531,\n\t\t\t         -0.563677,0.629139,-0.535173,-0.496994,0.587359,-0.638722,0.027070,0.858089,-0.512711,0.123234,0.878231,-0.462020,\n\t\t\t         -0.810175,0.344310,-0.474349,-0.748802,0.312937,-0.584216,-0.496994,0.587359,-0.638722,-0.563677,0.629139,-0.535173,\n\t\t\t         -0.862117,0.248817,-0.441359,-0.846370,0.171758,-0.504105,-0.748802,0.312937,-0.584216,-0.810175,0.344310,-0.474349,\n\t\t\t         -0.894650,0.312357,-0.319346,-0.925382,0.105686,-0.363903,-0.846370,0.171758,-0.504105,-0.862117,0.248817,-0.441359,\n\t\t\t         -0.905789,0.401959,-0.133854,-0.980193,0.158818,-0.118168,-0.925382,0.105686,-0.363903,-0.894650,0.312357,-0.319346,\n\t\t\t         -0.928281,0.302316,0.216529,-0.938383,0.185949,0.291269,-0.980193,0.158818,-0.118168,-0.905789,0.401959,-0.133854,\n\t\t\t         -0.601337,-0.039094,0.797998,-0.762688,0.009735,0.646687,-0.938383,0.185949,0.291269,-0.928281,0.302316,0.216529,\n\t\t\t         -0.132481,-0.319956,0.938108,-0.357341,-0.213141,0.909299,-0.762688,0.009735,0.646687,-0.601337,-0.039094,0.797998,\n\t\t\t         -0.563677,0.629139,-0.535173,0.123234,0.878231,-0.462020,-0.107761,0.773522,-0.624531,-0.615986,0.494003,-0.613575,\n\t\t\t         -0.857570,0.386486,-0.339335,-0.910215,0.324198,-0.257637,-0.918058,0.190649,0.347575,-0.928281,0.302316,0.216529,\n\t\t\t         -0.810175,0.344310,-0.474349,-0.563677,0.629139,-0.535173,-0.615986,0.494003,-0.613575,-0.828944,0.214698,-0.516434,\n\t\t\t         -0.107761,0.773522,-0.624531,-0.505539,0.405255,-0.761681,-0.683584,0.151799,-0.713889,-0.615986,0.494003,-0.613575,\n\t\t\t         -0.452254,0.163366,-0.876766,-0.593280,0.290048,-0.750877,-0.723624,0.075014,-0.686087,-0.632954,-0.077609,-0.770257,\n\t\t\t         -0.593280,0.290048,-0.750877,-0.452254,0.163366,-0.876766,-0.382702,0.241523,-0.891720,-0.582568,0.361644,-0.727866,\n\t\t\t         -0.775109,-0.029969,-0.631062,-0.828944,0.214698,-0.516434,-0.615986,0.494003,-0.613575,-0.683584,0.151799,-0.713889,\n\t\t\t         -0.828944,0.214698,-0.516434,-0.775109,-0.029969,-0.631062,-0.723624,0.075014,-0.686087,-0.830103,0.234016,-0.506088,\n\t\t\t         -0.830103,0.234016,-0.506088,-0.723624,0.075014,-0.686087,-0.593280,0.290048,-0.750877,-0.776879,0.372570,-0.507553,\n\t\t\t         -0.776879,0.372570,-0.507553,-0.593280,0.290048,-0.750877,-0.582568,0.361644,-0.727866,-0.798547,0.422773,-0.428388,\n\t\t\t         -0.862117,0.248817,-0.441359,-0.810175,0.344310,-0.474349,-0.828944,0.214698,-0.516434,-0.830103,0.234016,-0.506088,\n\t\t\t         -0.776879,0.372570,-0.507553,-0.894650,0.312357,-0.319346,-0.862117,0.248817,-0.441359,-0.830103,0.234016,-0.506088,\n\t\t\t         -0.894650,0.312357,-0.319346,-0.776879,0.372570,-0.507553,-0.798547,0.422773,-0.428388,-0.905789,0.401959,-0.133854,\n\t\t\t         -0.382702,0.241523,-0.891720,-0.378796,0.204047,-0.902676,-0.629780,0.349834,-0.693472,-0.582568,0.361644,-0.727866,\n\t\t\t         -0.582568,0.361644,-0.727866,-0.629780,0.349834,-0.693472,-0.857570,0.386486,-0.339335,-0.798547,0.422773,-0.428388,\n\t\t\t         -0.857570,0.386486,-0.339335,-0.928281,0.302316,0.216529,-0.905789,0.401959,-0.133854,-0.798547,0.422773,-0.428388,\n\t\t\t         0.629109,0.731529,-0.262764,0.100223,0.701804,-0.705252,0.265358,0.729209,-0.630696,0.663442,0.707602,-0.243080,\n\t\t\t         0.831996,-0.172277,0.527299,0.785943,-0.188421,0.588855,0.667806,-0.300638,0.680898,0.685110,-0.350810,0.638356,\n\t\t\t         0.785943,-0.188421,0.588855,0.831996,-0.172277,0.527299,0.918424,-0.047731,0.392621,0.882931,-0.081118,0.462416,\n\t\t\t         0.882931,-0.081118,0.462416,0.918424,-0.047731,0.392621,0.827296,-0.216041,0.518509,0.847499,-0.154851,0.507675,\n\t\t\t         0.883419,-0.068239,0.463546,0.895871,-0.010956,0.444166,0.847499,-0.154851,0.507675,0.827296,-0.216041,0.518509,\n\t\t\t         0.936857,0.157659,0.312082,0.933714,0.155065,0.322642,0.895871,-0.010956,0.444166,0.883419,-0.068239,0.463546,\n\t\t\t         0.928800,0.131077,0.346599,0.930509,0.154363,0.332041,0.933714,0.155065,0.322642,0.936857,0.157659,0.312082,\n\t\t\t         0.930021,0.254006,0.265481,0.927122,0.291574,0.235389,0.930509,0.154363,0.332041,0.928800,0.131077,0.346599,\n\t\t\t         0.265358,0.729209,-0.630696,0.285318,0.784417,-0.550676,0.624714,0.736045,-0.260659,0.663442,0.707602,-0.243080,\n\t\t\t         0.285318,0.784417,-0.550676,0.265358,0.729209,-0.630696,-0.416425,0.423170,-0.804651,-0.374889,0.462203,-0.803613,\n\t\t\t         -0.796228,0.017335,-0.604724,-0.754326,-0.052248,-0.654378,-0.374889,0.462203,-0.803613,-0.416425,0.423170,-0.804651,\n\t\t\t         -0.754326,-0.052248,-0.654378,-0.796228,0.017335,-0.604724,-0.868740,-0.084750,-0.487930,-0.787103,-0.196814,-0.584552,\n\t\t\t         -0.862209,0.029481,-0.505661,-0.730735,-0.086978,-0.677053,-0.787103,-0.196814,-0.584552,-0.868740,-0.084750,-0.487930,\n\t\t\t         -0.730735,-0.086978,-0.677053,-0.862209,0.029481,-0.505661,-0.777490,0.217383,-0.590075,-0.569353,0.128178,-0.812006,\n\t\t\t         -0.569353,0.128178,-0.812006,-0.777490,0.217383,-0.590075,-0.674703,0.298959,-0.674795,-0.437941,0.204688,-0.875362,\n\t\t\t         -0.647084,0.240638,-0.723411,-0.413038,0.127079,-0.901791,-0.437941,0.204688,-0.875362,-0.674703,0.298959,-0.674795,\n\t\t\t         -0.413038,0.127079,-0.901791,-0.647084,0.240638,-0.723411,-0.680776,0.060671,-0.729942,-0.440443,-0.050386,-0.896359,\n\t\t\t         -0.851375,-0.367321,-0.374401,-0.914762,-0.253639,-0.314371,-0.826716,-0.497238,0.263131,-0.780908,-0.611042,0.129460,\n\t\t\t         -0.830866,-0.188238,-0.523606,-0.835902,-0.348094,-0.424299,-0.780663,-0.624561,-0.020966,-0.799554,-0.208594,-0.563189,\n\t\t\t         -0.851375,-0.367321,-0.374401,-0.835902,-0.348094,-0.424299,-0.830866,-0.188238,-0.523606,-0.818781,-0.180792,-0.544877,\n\t\t\t         -0.334605,-0.740532,0.582781,-0.240242,-0.816980,0.524186,-0.728050,-0.685476,-0.003540,-0.780663,-0.624561,-0.020966,\n\t\t\t         0.510330,0.792779,-0.333171,0.123234,0.878231,-0.462020,0.724784,0.685659,-0.067232,0.792169,0.608020,-0.052370,\n\t\t\t         0.190374,0.775811,-0.601520,-0.285592,0.497940,-0.818812,-0.316504,0.508926,-0.800512,0.184549,0.764111,-0.618123,\n\t\t\t         0.293313,-0.387158,0.874081,0.121799,-0.335582,0.934080,-0.357341,-0.213141,0.909299,-0.132481,-0.319956,0.938108,\n\t\t\t         0.536546,-0.343028,0.770959,0.414075,-0.329753,0.848384,0.121799,-0.335582,0.934080,0.293313,-0.387158,0.874081,\n\t\t\t         0.663442,0.707602,-0.243080,0.624714,0.736045,-0.260659,0.834071,0.551439,-0.014985,0.843226,0.537278,0.016144,\n\t\t\t         0.510330,0.792779,-0.333171,0.792169,0.608020,-0.052370,0.834071,0.551439,-0.014985,0.624714,0.736045,-0.260659,\n\t\t\t         0.927122,0.291574,0.235389,0.930021,0.254006,0.265481,0.843226,0.537278,0.016144,0.834071,0.551439,-0.014985,\n\t\t\t         0.792169,0.608020,-0.052370,0.912107,0.337962,0.231941,0.927122,0.291574,0.235389,0.834071,0.551439,-0.014985,\n\t\t\t         0.013215,-0.698813,0.715140,0.186010,-0.644551,0.741539,0.077700,-0.507797,0.857936,-0.408338,-0.252052,0.877316,\n\t\t\t         -0.418928,-0.403485,-0.813410,-0.696921,-0.318125,-0.642689,-0.728050,-0.685476,-0.003540,-0.570696,-0.796472,-0.199713,\n\t\t\t         -0.696921,-0.318125,-0.642689,-0.418928,-0.403485,-0.813410,-0.243873,-0.113285,-0.963134,-0.440443,-0.050386,-0.896359,\n\t\t\t         -0.440443,-0.050386,-0.896359,-0.243873,-0.113285,-0.963134,-0.337626,0.101688,-0.935759,-0.381420,0.102268,-0.918699,\n\t\t\t         -0.381420,0.102268,-0.918699,-0.337626,0.101688,-0.935759,-0.720389,0.255531,-0.644765,-0.676687,0.284005,-0.679250,\n\t\t\t         -0.676687,0.284005,-0.679250,-0.720389,0.255531,-0.644765,-0.954741,0.237159,-0.179418,-0.910215,0.324198,-0.257637,\n\t\t\t         -0.910215,0.324198,-0.257637,-0.954741,0.237159,-0.179418,-0.919370,0.007416,0.393292,-0.918058,0.190649,0.347575,\n\t\t\t         -0.918058,0.190649,0.347575,-0.919370,0.007416,0.393292,-0.380810,-0.385662,0.840358,-0.408338,-0.252052,0.877316,\n\t\t\t         -0.588397,-0.297189,0.751946,-0.663472,-0.536180,0.521805,-0.847652,-0.501297,0.173559,-0.880703,-0.202612,0.428053,\n\t\t\t         -0.880703,-0.202612,0.428053,-0.847652,-0.501297,0.173559,-0.901639,-0.413282,-0.127354,-0.985595,-0.166387,0.029786,\n\t\t\t         -0.985595,-0.166387,0.029786,-0.901639,-0.413282,-0.127354,-0.888668,-0.297555,-0.348827,-0.947111,-0.159246,-0.278573,\n\t\t\t         -0.880184,-0.071841,-0.469100,-0.925382,0.105686,-0.363903,-0.980193,0.158818,-0.118168,-0.947111,-0.159246,-0.278573,\n\t\t\t         -0.796930,0.056856,-0.601337,-0.846370,0.171758,-0.504105,-0.925382,0.105686,-0.363903,-0.880184,-0.071841,-0.469100,\n\t\t\t         -0.678549,0.184179,-0.711081,-0.748802,0.312937,-0.584216,-0.846370,0.171758,-0.504105,-0.796930,0.056856,-0.601337,\n\t\t\t         -0.416791,0.505478,-0.755455,-0.496994,0.587359,-0.638722,-0.748802,0.312937,-0.584216,-0.678549,0.184179,-0.711081,\n\t\t\t         -0.416791,0.505478,-0.755455,-0.327250,0.479049,-0.814478,0.103977,0.811274,-0.575335,0.002747,0.819880,-0.572497,\n\t\t\t         -0.070528,-0.379681,0.922391,-0.219214,-0.504288,0.835231,-0.663472,-0.536180,0.521805,-0.588397,-0.297189,0.751946,\n\t\t\t         0.643422,-0.135197,0.753441,0.745079,-0.031739,0.666189,0.728660,-0.104099,0.676870,0.616321,-0.194159,0.763146,\n\t\t\t         0.895474,0.256783,0.363506,0.887387,0.406598,0.217139,0.905362,0.401349,0.138554,0.925169,0.213141,0.314005,\n\t\t\t         -0.768713,-0.638991,0.027748,-0.851440,-0.488403,-0.191082,-0.863277,-0.472365,-0.177740,-0.782281,-0.616108,0.091617,\n\t\t\t         0.525459,0.772865,-0.355770,0.788474,0.610503,-0.074794,0.816309,0.577105,-0.023316,0.575091,0.761742,-0.298288,\n\t\t\t         0.887387,0.406598,0.217139,0.831111,0.547777,0.095584,0.816309,0.577105,-0.023316,0.905362,0.401349,0.138554,\n\t\t\t         -0.851440,-0.488403,-0.191082,-0.865771,-0.336140,-0.370742,-0.866146,-0.333720,-0.371990,-0.863277,-0.472365,-0.177740,\n\t\t\t         -0.327250,0.479049,-0.814478,-0.632466,0.089846,-0.769311,-0.629871,0.113559,-0.768334,-0.285592,0.497940,-0.818812,\n\t\t\t         0.480880,-0.258461,0.837794,0.643422,-0.135197,0.753441,0.616321,-0.194159,0.763146,0.450179,-0.319865,0.833644,\n\t\t\t         0.425925,-0.371920,0.824781,0.179862,-0.550181,0.815445,0.189337,-0.474166,0.859798,0.450179,-0.319865,0.833644,\n\t\t\t         -0.632466,0.089846,-0.769311,-0.744652,-0.033540,-0.666585,-0.735405,-0.043550,-0.676199,-0.629871,0.113559,-0.768334,\n\t\t\t         0.745079,-0.031739,0.666189,0.816919,0.057772,0.573779,0.818812,-0.026795,0.573412,0.728660,-0.104099,0.676870,\n\t\t\t         0.179862,-0.550181,0.815445,-0.221615,-0.727705,0.649102,-0.245247,-0.643971,0.724631,0.189337,-0.474166,0.859798,\n\t\t\t         -0.744652,-0.033540,-0.666585,-0.833552,-0.162420,-0.527970,-0.817164,-0.185217,-0.545793,-0.735405,-0.043550,-0.676199,\n\t\t\t         0.816919,0.057772,0.573779,0.865169,0.141240,0.481155,0.887082,0.067751,0.456587,0.818812,-0.026795,0.573412,\n\t\t\t         -0.833552,-0.162420,-0.527970,-0.888668,-0.297555,-0.348827,-0.866146,-0.333720,-0.371990,-0.817164,-0.185217,-0.545793,\n\t\t\t         0.865169,0.141240,0.481155,0.895474,0.256783,0.363506,0.925169,0.213141,0.314005,0.887082,0.067751,0.456587,\n\t\t\t         -0.663472,-0.536180,0.521805,-0.602069,-0.690725,0.400433,-0.782281,-0.616108,0.091617,-0.847652,-0.501297,0.173559,\n\t\t\t         -0.221615,-0.727705,0.649102,-0.584273,-0.743435,0.325468,-0.602069,-0.690725,0.400433,-0.245247,-0.643971,0.724631,\n\t\t\t         0.580248,0.789850,-0.198431,0.103977,0.811274,-0.575335,0.190374,0.775811,-0.601520,0.575091,0.761742,-0.298288,\n\t\t\t         0.103977,0.811274,-0.575335,-0.327250,0.479049,-0.814478,-0.285592,0.497940,-0.818812,0.190374,0.775811,-0.601520,\n\t\t\t         0.027070,0.858089,-0.512711,0.002747,0.819880,-0.572497,0.591754,0.797113,-0.119938,0.626576,0.772393,-0.103763,\n\t\t\t         0.480880,-0.258461,0.837794,0.530747,-0.246986,0.810724,0.671987,-0.135105,0.728111,0.643422,-0.135197,0.753441,\n\t\t\t         -0.744652,-0.033540,-0.666585,-0.796930,0.056856,-0.601337,-0.880184,-0.071841,-0.469100,-0.833552,-0.162420,-0.527970,\n\t\t\t         0.589923,-0.265175,0.762627,0.530747,-0.246986,0.810724,0.303720,-0.347636,0.887051,0.414075,-0.329753,0.848384,\n\t\t\t         -0.938383,0.185949,0.291269,-0.985595,-0.166387,0.029786,-0.947111,-0.159246,-0.278573,-0.980193,0.158818,-0.118168,\n\t\t\t         0.414075,-0.329753,0.848384,0.303720,-0.347636,0.887051,-0.070528,-0.379681,0.922391,0.121799,-0.335582,0.934080,\n\t\t\t         0.887387,0.406598,0.217139,0.872799,0.404523,0.273019,0.830805,0.527757,0.176580,0.831111,0.547777,0.095584,\n\t\t\t         0.121799,-0.335582,0.934080,-0.070528,-0.379681,0.922391,-0.588397,-0.297189,0.751946,-0.357341,-0.213141,0.909299,\n\t\t\t         0.816919,0.057772,0.573779,0.820643,0.075320,0.566424,0.858364,0.163518,0.486251,0.865169,0.141240,0.481155,\n\t\t\t         0.895474,0.256783,0.363506,0.880245,0.265328,0.393353,0.872799,0.404523,0.273019,0.887387,0.406598,0.217139,\n\t\t\t         -0.762688,0.009735,0.646687,-0.880703,-0.202612,0.428053,-0.985595,-0.166387,0.029786,-0.938383,0.185949,0.291269,\n\t\t\t         -0.327250,0.479049,-0.814478,-0.416791,0.505478,-0.755455,-0.678549,0.184179,-0.711081,-0.632466,0.089846,-0.769311,\n\t\t\t         0.745079,-0.031739,0.666189,0.763390,-0.023408,0.645466,0.820643,0.075320,0.566424,0.816919,0.057772,0.573779,\n\t\t\t         0.865169,0.141240,0.481155,0.858364,0.163518,0.486251,0.880245,0.265328,0.393353,0.895474,0.256783,0.363506,\n\t\t\t         -0.496994,0.587359,-0.638722,-0.416791,0.505478,-0.755455,0.002747,0.819880,-0.572497,0.027070,0.858089,-0.512711,\n\t\t\t         -0.833552,-0.162420,-0.527970,-0.880184,-0.071841,-0.469100,-0.947111,-0.159246,-0.278573,-0.888668,-0.297555,-0.348827,\n\t\t\t         0.643422,-0.135197,0.753441,0.671987,-0.135105,0.728111,0.763390,-0.023408,0.645466,0.745079,-0.031739,0.666189,\n\t\t\t         0.626576,0.772393,-0.103763,0.591754,0.797113,-0.119938,0.830805,0.527757,0.176580,0.846339,0.480575,0.229652,\n\t\t\t         -0.632466,0.089846,-0.769311,-0.678549,0.184179,-0.711081,-0.796930,0.056856,-0.601337,-0.744652,-0.033540,-0.666585,\n\t\t\t         -0.357341,-0.213141,0.909299,-0.588397,-0.297189,0.751946,-0.880703,-0.202612,0.428053,-0.762688,0.009735,0.646687,\n\t\t\t         -0.780663,-0.624561,-0.020966,-0.728050,-0.685476,-0.003540,-0.696921,-0.318125,-0.642689,-0.799554,-0.208594,-0.563189,\n\t\t\t         0.175481,-0.658254,0.732017,0.184240,-0.585528,0.789392,-0.258156,-0.527238,0.809503,-0.281259,-0.628346,0.725272,\n\t\t\t         -0.926298,0.289712,-0.240883,-0.941923,0.324168,-0.087374,-0.764611,0.462233,-0.449080,-0.725486,0.458541,-0.513169,\n\t\t\t         -0.775903,-0.410352,0.479080,-0.767968,-0.272469,0.579608,-0.967437,0.092746,0.235389,-0.996979,0.007935,0.076907,\n\t\t\t         -0.820856,-0.261788,0.507553,-0.843867,-0.328104,0.424512,-0.994324,-0.084017,0.064791,-0.991302,0.038545,0.125645,\n\t\t\t         -0.010041,-0.627949,0.778161,-0.017243,-0.653066,0.757073,-0.453627,-0.571764,0.683554,-0.417005,-0.521592,0.744316,\n\t\t\t         -0.964629,0.188574,-0.184027,-0.963500,-0.153447,-0.219214,-0.564928,-0.364299,-0.740318,-0.760491,0.213446,-0.613208,\n\t\t\t         0.192297,-0.696860,0.690909,0.160955,-0.737968,0.655324,-0.289041,-0.730857,0.618275,-0.256294,-0.674367,0.692434,\n\t\t\t         -0.946379,0.225013,-0.231666,-0.934568,0.167791,-0.313669,-0.708152,0.408002,-0.576189,-0.709220,0.466903,-0.528153,\n\t\t\t         -0.740501,-0.452834,0.496536,-0.768364,-0.511795,0.384259,-0.990570,-0.136845,0.004059,-0.988433,-0.089969,0.121830,\n\t\t\t         0.921812,-0.278756,0.269265,0.694113,-0.533586,0.483169,0.717460,-0.532701,0.448805,0.941527,-0.289407,0.172369,\n\t\t\t         -0.760704,-0.196936,0.618488,-0.961150,0.140538,0.237526,-0.967437,0.092746,0.235389,-0.767968,-0.272469,0.579608,\n\t\t\t         0.904935,-0.360118,0.226630,0.628163,-0.535081,0.564867,0.618061,-0.544450,0.567034,0.914609,-0.303720,0.266823,\n\t\t\t         0.960936,-0.256600,0.103519,0.742821,-0.513749,0.429243,0.703726,-0.550035,0.449599,0.933714,-0.335948,0.123692,\n\t\t\t         -0.367534,0.591784,-0.717399,-0.793786,0.442824,-0.416852,-0.782617,0.350566,-0.514359,-0.377422,0.445265,-0.811945,\n\t\t\t         -0.338328,0.580035,-0.740989,-0.709220,0.466903,-0.528153,-0.708152,0.408002,-0.576189,-0.358684,0.573809,-0.736229,\n\t\t\t         -0.289682,0.074679,-0.954192,-0.760491,0.213446,-0.613208,-0.564928,-0.364299,-0.740318,-0.077761,-0.461257,-0.883847,\n\t\t\t         -0.227790,0.618793,-0.751793,-0.725486,0.458541,-0.513169,-0.764611,0.462233,-0.449080,-0.258156,0.599841,-0.757286,\n\t\t\t         0.694113,-0.533586,0.483169,0.480422,-0.647267,0.591784,0.478378,-0.653157,0.586932,0.717460,-0.532701,0.448805,\n\t\t\t         0.742821,-0.513749,0.429243,0.380993,-0.629627,0.677023,0.368297,-0.638050,0.676168,0.703726,-0.550035,0.449599,\n\t\t\t         0.356731,-0.611042,0.706626,0.667989,-0.536790,0.515366,0.703726,-0.550035,0.449599,0.368297,-0.638050,0.676168,\n\t\t\t         0.132450,-0.567186,0.812830,-0.244392,-0.490829,0.836268,-0.258156,-0.527238,0.809503,0.184240,-0.585528,0.789392,\n\t\t\t         -0.959838,0.280465,-0.001679,-0.782342,0.485000,-0.390759,-0.764611,0.462233,-0.449080,-0.941923,0.324168,-0.087374,\n\t\t\t         -0.950743,0.218513,-0.219764,-0.953673,0.233039,-0.190100,-0.980041,-0.167577,0.106815,-0.981384,-0.174657,0.079470,\n\t\t\t         -0.733238,-0.543352,0.408795,-0.749290,-0.541704,0.380902,-0.259041,-0.731223,0.631001,-0.204566,-0.724631,0.658040,\n\t\t\t         0.844234,-0.522385,0.119755,0.920652,-0.346538,0.179693,0.782617,-0.507340,0.360637,0.697958,-0.607898,0.378460,\n\t\t\t         0.312326,-0.678365,0.664998,0.281075,-0.709830,0.645833,0.614460,-0.612323,0.497452,0.637379,-0.559160,0.530137,\n\t\t\t         -0.981384,-0.174657,0.079470,-0.980041,-0.167577,0.106815,-0.749290,-0.541704,0.380902,-0.733238,-0.543352,0.408795,\n\t\t\t         0.162755,-0.743797,0.648274,-0.135533,-0.829951,0.541093,0.202063,-0.814631,0.543626,0.512558,-0.676778,0.528398,\n\t\t\t         -0.193548,-0.875301,0.443068,0.486190,-0.795740,0.361034,0.202063,-0.814631,0.543626,-0.475326,-0.759026,0.444807,\n\t\t\t         -0.601245,0.494491,-0.627613,-0.911893,0.131504,-0.388745,-0.995544,-0.040162,-0.085086,-0.821558,0.375225,-0.429151,\n\t\t\t         0.030457,-0.992370,0.119327,0.598529,-0.800958,0.013153,0.486190,-0.795740,0.361034,-0.193548,-0.875301,0.443068,\n\t\t\t         -0.992126,0.040529,-0.118229,-0.945433,-0.325480,0.013794,-0.828944,-0.553178,0.082400,-0.947752,-0.284310,0.144566,\n\t\t\t         -0.619129,-0.636189,-0.460311,-0.315500,-0.326823,-0.890835,0.109867,-0.616291,-0.779778,-0.382122,-0.830042,-0.406140,\n\t\t\t         -0.721885,-0.590045,0.361492,-0.664693,-0.723716,0.185308,-0.440230,-0.808252,0.390973,-0.341350,-0.740837,0.578417,\n\t\t\t         -0.947752,-0.284310,0.144566,-0.828944,-0.553178,0.082400,-0.664693,-0.723716,0.185308,-0.721885,-0.590045,0.361492,\n\t\t\t         -0.828944,-0.553178,0.082400,-0.469375,-0.882870,0.013581,-0.486404,-0.854488,-0.182287,-0.664693,-0.723716,0.185308,\n\t\t\t         -0.664693,-0.723716,0.185308,-0.486404,-0.854488,-0.182287,-0.631184,-0.774560,-0.040193,-0.440230,-0.808252,0.390973,\n\t\t\t         -0.281259,-0.628346,0.725272,-0.258156,-0.527238,0.809503,-0.767968,-0.272469,0.579608,-0.775903,-0.410352,0.479080,\n\t\t\t         -0.417005,-0.521592,0.744316,-0.453627,-0.571764,0.683554,-0.843867,-0.328104,0.424512,-0.820856,-0.261788,0.507553,\n\t\t\t         -0.256294,-0.674367,0.692434,-0.289041,-0.730857,0.618275,-0.768364,-0.511795,0.384259,-0.740501,-0.452834,0.496536,\n\t\t\t         0.372845,0.690756,-0.619526,0.768090,0.504349,-0.394513,0.783471,0.368725,-0.500198,0.415723,0.562181,-0.714896,\n\t\t\t         -0.244392,-0.490829,0.836268,-0.760704,-0.196936,0.618488,-0.767968,-0.272469,0.579608,-0.258156,-0.527238,0.809503,\n\t\t\t         0.370067,0.437605,-0.819453,0.736961,0.166814,-0.654988,0.772179,0.265175,-0.577380,0.392682,0.443037,-0.805902,\n\t\t\t         0.442854,0.185400,-0.877194,0.727958,0.259499,-0.634571,0.725211,0.306375,-0.616535,0.357799,0.487594,-0.796350,\n\t\t\t         -0.315500,-0.326823,-0.890835,0.097934,0.152196,-0.983459,0.569384,-0.205359,-0.795984,0.109867,-0.616291,-0.779778,\n\t\t\t         -0.945433,-0.325480,0.013794,-0.506912,-0.797418,0.327280,-0.469375,-0.882870,0.013581,-0.828944,-0.553178,0.082400,\n\t\t\t         0.598529,-0.800958,0.013153,0.844234,-0.522385,0.119755,0.697958,-0.607898,0.378460,0.486190,-0.795740,0.361034,\n\t\t\t         -0.911893,0.131504,-0.388745,-0.870968,-0.486129,0.071200,-0.703574,-0.579333,0.411451,-0.995544,-0.040162,-0.085086,\n\t\t\t         0.486190,-0.795740,0.361034,0.697958,-0.607898,0.378460,0.512558,-0.676778,0.528398,0.202063,-0.814631,0.543626,\n\t\t\t         -0.135533,-0.829951,0.541093,-0.645772,-0.721732,0.249092,-0.475326,-0.759026,0.444807,0.202063,-0.814631,0.543626,\n\t\t\t         0.334788,0.466048,-0.818934,0.451979,0.591357,-0.667806,0.797266,0.377667,-0.470840,0.771691,0.170934,-0.612568,\n\t\t\t         0.782617,-0.507340,0.360637,0.815485,-0.443129,0.372295,0.637379,-0.559160,0.530137,0.614460,-0.612323,0.497452,\n\t\t\t         -0.953673,0.233039,-0.190100,-0.992126,0.040529,-0.118229,-0.947752,-0.284310,0.144566,-0.980041,-0.167577,0.106815,\n\t\t\t         0.920652,-0.346538,0.179693,0.953856,-0.249336,0.167211,0.815485,-0.443129,0.372295,0.782617,-0.507340,0.360637,\n\t\t\t         -0.980041,-0.167577,0.106815,-0.947752,-0.284310,0.144566,-0.721885,-0.590045,0.361492,-0.749290,-0.541704,0.380902,\n\t\t\t         -0.400372,0.616230,-0.678152,-0.601245,0.494491,-0.627613,-0.821558,0.375225,-0.429151,-0.734886,0.480636,-0.478408,\n\t\t\t         -0.749290,-0.541704,0.380902,-0.721885,-0.590045,0.361492,-0.341350,-0.740837,0.578417,-0.259041,-0.731223,0.631001,\n\t\t\t         0.281075,-0.709830,0.645833,0.162755,-0.743797,0.648274,0.512558,-0.676778,0.528398,0.614460,-0.612323,0.497452,\n\t\t\t         -0.937407,0.214942,-0.273873,-0.950743,0.218513,-0.219764,-0.981384,-0.174657,0.079470,-0.981170,-0.180334,0.068911,\n\t\t\t         -0.721488,-0.539659,0.433821,-0.733238,-0.543352,0.408795,-0.204566,-0.724631,0.658040,-0.190222,-0.732170,0.653981,\n\t\t\t         0.498367,0.642445,-0.582110,0.511734,0.650288,-0.561418,0.796228,0.490768,-0.353710,0.790551,0.467757,-0.395184,\n\t\t\t         -0.802545,-0.236579,0.547624,-0.984405,0.028565,0.173498,-0.978607,0.066347,0.194617,-0.776330,-0.218848,0.591083,\n\t\t\t         0.933714,-0.335948,0.123692,0.703726,-0.550035,0.449599,0.667989,-0.536790,0.515366,0.911496,-0.368999,0.181555,\n\t\t\t         -0.319407,0.633076,-0.705100,-0.782342,0.485000,-0.390759,-0.793786,0.442824,-0.416852,-0.367534,0.591784,-0.717399,\n\t\t\t         0.361522,-0.591540,0.720634,0.628163,-0.535081,0.564867,0.667989,-0.536790,0.515366,0.356731,-0.611042,0.706626,\n\t\t\t         0.026612,-0.633045,0.773644,-0.350871,-0.519608,0.779015,-0.269784,-0.509598,0.816980,0.063478,-0.605396,0.793359,\n\t\t\t         -0.978881,0.176061,-0.103580,-0.782617,0.350566,-0.514359,-0.793786,0.442824,-0.416852,-0.976897,0.209754,-0.040101,\n\t\t\t         -0.350871,-0.519608,0.779015,-0.802545,-0.236579,0.547624,-0.776330,-0.218848,0.591083,-0.269784,-0.509598,0.816980,\n\t\t\t         0.357799,0.487594,-0.796350,0.725211,0.306375,-0.616535,0.752678,0.230140,-0.616810,0.328440,0.493759,-0.805170,\n\t\t\t         -0.783563,-0.496292,0.373760,-0.791681,-0.465224,0.395978,-0.993683,-0.105502,-0.038026,-0.987182,-0.145482,-0.065493,\n\t\t\t         -0.295969,0.705924,-0.643452,-0.316080,0.670858,-0.670827,-0.686087,0.535478,-0.492416,-0.668661,0.538896,-0.512284,\n\t\t\t         -0.914823,0.145482,-0.376659,-0.911466,0.208045,-0.354839,-0.695517,0.439558,-0.568316,-0.704520,0.403272,-0.583941,\n\t\t\t         0.972015,-0.139592,0.188788,0.969481,-0.131016,0.207068,0.805872,-0.397992,0.438337,0.827509,-0.380291,0.412946,\n\t\t\t         0.785394,-0.450972,0.423933,0.594195,-0.562578,0.574786,0.631794,-0.535417,0.560472,0.805872,-0.397992,0.438337,\n\t\t\t         0.916807,-0.260201,0.302835,0.641255,-0.533555,0.551439,0.655171,-0.542344,0.525895,0.911039,-0.281625,0.301065,\n\t\t\t         0.432539,0.643452,-0.631519,0.803461,0.494247,-0.331828,0.774834,0.552110,-0.307779,0.412122,0.728874,-0.546678,\n\t\t\t         -0.934568,0.167791,-0.313669,-0.914823,0.145482,-0.376659,-0.704520,0.403272,-0.583941,-0.708152,0.408002,-0.576189,\n\t\t\t         -0.314341,-0.723502,0.614551,-0.334208,-0.690146,0.641835,-0.791681,-0.465224,0.395978,-0.783563,-0.496292,0.373760,\n\t\t\t         0.160527,-0.747337,0.644734,0.163457,-0.714316,0.680441,-0.334208,-0.690146,0.641835,-0.314341,-0.723502,0.614551,\n\t\t\t         -0.269784,-0.509598,0.816980,-0.776330,-0.218848,0.591083,-0.760704,-0.196936,0.618488,-0.244392,-0.490829,0.836268,\n\t\t\t         -0.274575,0.628498,-0.727683,-0.704520,0.403272,-0.583941,-0.695517,0.439558,-0.568316,-0.206183,0.657491,-0.724662,\n\t\t\t         0.412122,0.728874,-0.546678,0.774834,0.552110,-0.307779,0.768090,0.504349,-0.394513,0.372845,0.690756,-0.619526,\n\t\t\t         0.641255,-0.533555,0.551439,0.419294,-0.616627,0.666280,0.457656,-0.625416,0.631947,0.655171,-0.542344,0.525895,\n\t\t\t         0.341075,-0.682089,0.646809,0.312326,-0.678365,0.664998,0.637379,-0.559160,0.530137,0.642323,-0.532456,0.551225,\n\t\t\t         0.063478,-0.605396,0.793359,-0.269784,-0.509598,0.816980,-0.244392,-0.490829,0.836268,0.132450,-0.567186,0.812830,\n\t\t\t         -0.981170,-0.180334,0.068911,-0.981384,-0.174657,0.079470,-0.733238,-0.543352,0.408795,-0.721488,-0.539659,0.433821,\n\t\t\t         -0.791681,-0.465224,0.395978,-0.775903,-0.410352,0.479080,-0.996979,0.007935,0.076907,-0.993683,-0.105502,-0.038026,\n\t\t\t         0.504654,0.501846,-0.702445,0.800806,0.346049,-0.488754,0.796228,0.490768,-0.353710,0.511734,0.650288,-0.561418,\n\t\t\t         0.160955,-0.737968,0.655324,0.160527,-0.747337,0.644734,-0.314341,-0.723502,0.614551,-0.289041,-0.730857,0.618275,\n\t\t\t         -0.768364,-0.511795,0.384259,-0.783563,-0.496292,0.373760,-0.987182,-0.145482,-0.065493,-0.990570,-0.136845,0.004059,\n\t\t\t         -0.358684,0.573809,-0.736229,-0.708152,0.408002,-0.576189,-0.704520,0.403272,-0.583941,-0.274575,0.628498,-0.727683,\n\t\t\t         0.959746,-0.228217,0.163579,0.785394,-0.450972,0.423933,0.805872,-0.397992,0.438337,0.969481,-0.131016,0.207068,\n\t\t\t         0.827509,-0.380291,0.412946,0.805872,-0.397992,0.438337,0.631794,-0.535417,0.560472,0.642323,-0.532456,0.551225,\n\t\t\t         -0.911466,0.208045,-0.354839,-0.926298,0.289712,-0.240883,-0.725486,0.458541,-0.513169,-0.695517,0.439558,-0.568316,\n\t\t\t         0.655171,-0.542344,0.525895,0.457656,-0.625416,0.631947,0.480422,-0.647267,0.591784,0.694113,-0.533586,0.483169,\n\t\t\t         0.911039,-0.281625,0.301065,0.655171,-0.542344,0.525895,0.694113,-0.533586,0.483169,0.921812,-0.278756,0.269265,\n\t\t\t         -0.289041,-0.730857,0.618275,-0.314341,-0.723502,0.614551,-0.783563,-0.496292,0.373760,-0.768364,-0.511795,0.384259,\n\t\t\t         -0.258156,0.599841,-0.757286,-0.764611,0.462233,-0.449080,-0.782342,0.485000,-0.390759,-0.319407,0.633076,-0.705100,\n\t\t\t         0.911496,-0.368999,0.181555,0.667989,-0.536790,0.515366,0.628163,-0.535081,0.564867,0.904935,-0.360118,0.226630,\n\t\t\t         -0.776330,-0.218848,0.591083,-0.978607,0.066347,0.194617,-0.961150,0.140538,0.237526,-0.760704,-0.196936,0.618488,\n\t\t\t         0.392682,0.443037,-0.805902,0.772179,0.265175,-0.577380,0.803461,0.494247,-0.331828,0.432539,0.643452,-0.631519,\n\t\t\t         0.618061,-0.544450,0.567034,0.387036,-0.612079,0.689566,0.419294,-0.616627,0.666280,0.641255,-0.533555,0.551439,\n\t\t\t         -0.976897,0.209754,-0.040101,-0.793786,0.442824,-0.416852,-0.782342,0.485000,-0.390759,-0.959838,0.280465,-0.001679,\n\t\t\t         0.387036,-0.612079,0.689566,0.618061,-0.544450,0.567034,0.628163,-0.535081,0.564867,0.361522,-0.591540,0.720634,\n\t\t\t         0.328440,0.493759,-0.805170,0.752678,0.230140,-0.616810,0.736961,0.166814,-0.654988,0.370067,0.437605,-0.819453,\n\t\t\t         0.914609,-0.303720,0.266823,0.618061,-0.544450,0.567034,0.641255,-0.533555,0.551439,0.916807,-0.260201,0.302835,\n\t\t\t         0.163457,-0.714316,0.680441,0.175481,-0.658254,0.732017,-0.281259,-0.628346,0.725272,-0.334208,-0.690146,0.641835,\n\t\t\t         -0.334208,-0.690146,0.641835,-0.281259,-0.628346,0.725272,-0.775903,-0.410352,0.479080,-0.791681,-0.465224,0.395978,\n\t\t\t         -0.206183,0.657491,-0.724662,-0.695517,0.439558,-0.568316,-0.725486,0.458541,-0.513169,-0.227790,0.618793,-0.751793,\n\t\t\t         0.292245,-0.654042,0.697684,0.192297,-0.696860,0.690909,-0.256294,-0.674367,0.692434,-0.222266,-0.644887,0.731223,\n\t\t\t         -0.942900,0.227973,-0.242775,-0.946379,0.225013,-0.231666,-0.709220,0.466903,-0.528153,-0.671804,0.472396,-0.570513,\n\t\t\t         -0.721854,-0.421674,0.548692,-0.740501,-0.452834,0.496536,-0.988433,-0.089969,0.121830,-0.979858,-0.094607,0.175695,\n\t\t\t         -0.294565,0.580889,-0.758782,-0.671804,0.472396,-0.570513,-0.709220,0.466903,-0.528153,-0.338328,0.580035,-0.740989,\n\t\t\t         -0.222266,-0.644887,0.731223,-0.256294,-0.674367,0.692434,-0.740501,-0.452834,0.496536,-0.721854,-0.421674,0.548692,\n\t\t\t         0.717460,-0.532701,0.448805,0.478378,-0.653157,0.586932,0.530808,-0.616932,0.581011,0.742973,-0.516861,0.425214,\n\t\t\t         0.415723,0.562181,-0.714896,0.783471,0.368725,-0.500198,0.764214,0.247353,-0.595630,0.468123,0.422864,-0.775872,\n\t\t\t         0.941527,-0.289407,0.172369,0.717460,-0.532701,0.448805,0.742973,-0.516861,0.425214,0.937223,-0.318857,0.141179,\n\t\t\t         0.742973,-0.516861,0.425214,0.530808,-0.616932,0.581011,0.594195,-0.562578,0.574786,0.785394,-0.450972,0.423933,\n\t\t\t         0.468123,0.422864,-0.775872,0.764214,0.247353,-0.595630,0.800806,0.346049,-0.488754,0.504654,0.501846,-0.702445,\n\t\t\t         0.937223,-0.318857,0.141179,0.742973,-0.516861,0.425214,0.785394,-0.450972,0.423933,0.959746,-0.228217,0.163579,\n\t\t\t         0.320658,-0.678304,0.661092,0.292245,-0.654042,0.697684,-0.222266,-0.644887,0.731223,-0.197394,-0.700003,0.686270,\n\t\t\t         -0.928617,0.217261,-0.300729,-0.942900,0.227973,-0.242775,-0.671804,0.472396,-0.570513,-0.656636,0.482345,-0.579760,\n\t\t\t         -0.718192,-0.491165,0.492843,-0.721854,-0.421674,0.548692,-0.979858,-0.094607,0.175695,-0.983886,-0.148167,0.099857,\n\t\t\t         -0.282174,0.639546,-0.715049,-0.656636,0.482345,-0.579760,-0.671804,0.472396,-0.570513,-0.294565,0.580889,-0.758782,\n\t\t\t         -0.197394,-0.700003,0.686270,-0.222266,-0.644887,0.731223,-0.721854,-0.421674,0.548692,-0.718192,-0.491165,0.492843,\n\t\t\t         -0.316080,0.670858,-0.670827,-0.400372,0.616230,-0.678152,-0.734886,0.480636,-0.478408,-0.686087,0.535478,-0.492416,\n\t\t\t         0.097934,0.152196,-0.983459,0.334788,0.466048,-0.818934,0.771691,0.170934,-0.612568,0.569384,-0.205359,-0.795984,\n\t\t\t         0.697958,-0.607898,0.378460,0.782617,-0.507340,0.360637,0.614460,-0.612323,0.497452,0.512558,-0.676778,0.528398,\n\t\t\t         0.768090,0.504349,-0.394513,0.991241,0.121982,-0.050050,0.979553,0.058351,-0.192419,0.783471,0.368725,-0.500198,\n\t\t\t         0.736961,0.166814,-0.654988,0.962249,-0.121220,-0.243660,0.987640,-0.002594,-0.156499,0.772179,0.265175,-0.577380,\n\t\t\t         0.727958,0.259499,-0.634571,0.963469,0.033723,-0.265664,0.963286,-0.033509,-0.266335,0.725211,0.306375,-0.616535,\n\t\t\t         0.569384,-0.205359,-0.795984,0.771691,0.170934,-0.612568,0.981567,-0.092959,-0.166875,0.827754,-0.466781,-0.311319,\n\t\t\t         -0.382122,-0.830042,-0.406140,0.109867,-0.616291,-0.779778,0.424879,-0.788965,-0.443800,-0.120029,-0.978820,-0.165746,\n\t\t\t         0.109867,-0.616291,-0.779778,0.569384,-0.205359,-0.795984,0.827754,-0.466781,-0.311319,0.424879,-0.788965,-0.443800,\n\t\t\t         0.771691,0.170934,-0.612568,0.797266,0.377667,-0.470840,0.987091,0.063753,-0.146733,0.981567,-0.092959,-0.166875,\n\t\t\t         0.725211,0.306375,-0.616535,0.963286,-0.033509,-0.266335,0.968322,-0.112094,-0.223029,0.752678,0.230140,-0.616810,\n\t\t\t         0.790551,0.467757,-0.395184,0.796228,0.490768,-0.353710,0.973174,0.214606,-0.082736,0.971892,0.193274,-0.134251,\n\t\t\t         0.803461,0.494247,-0.331828,0.989349,0.144292,-0.018525,0.985717,0.168279,-0.004578,0.774834,0.552110,-0.307779,\n\t\t\t         0.800806,0.346049,-0.488754,0.984130,0.065493,-0.164739,0.973174,0.214606,-0.082736,0.796228,0.490768,-0.353710,\n\t\t\t         0.774834,0.552110,-0.307779,0.985717,0.168279,-0.004578,0.991241,0.121982,-0.050050,0.768090,0.504349,-0.394513,\n\t\t\t         0.752678,0.230140,-0.616810,0.968322,-0.112094,-0.223029,0.962249,-0.121220,-0.243660,0.736961,0.166814,-0.654988,\n\t\t\t         0.772179,0.265175,-0.577380,0.987640,-0.002594,-0.156499,0.989349,0.144292,-0.018525,0.803461,0.494247,-0.331828,\n\t\t\t         0.783471,0.368725,-0.500198,0.979553,0.058351,-0.192419,0.959380,-0.016633,-0.281503,0.764214,0.247353,-0.595630,\n\t\t\t         0.764214,0.247353,-0.595630,0.959380,-0.016633,-0.281503,0.984130,0.065493,-0.164739,0.800806,0.346049,-0.488754,\n\t\t\t         -0.030335,0.592761,-0.804773,0.328440,0.493759,-0.805170,0.370067,0.437605,-0.819453,0.061037,0.597797,-0.799310,\n\t\t\t         0.093295,0.055269,-0.994079,0.442854,0.185400,-0.877194,0.357799,0.487594,-0.796350,-0.002228,0.474807,-0.880062,\n\t\t\t         -0.002228,0.474807,-0.880062,0.357799,0.487594,-0.796350,0.328440,0.493759,-0.805170,-0.030335,0.592761,-0.804773,\n\t\t\t         0.138524,0.570482,-0.809503,0.504654,0.501846,-0.702445,0.511734,0.650288,-0.561418,0.141453,0.700888,-0.699088,\n\t\t\t         -0.611225,-0.039399,-0.790429,-0.313150,0.423536,-0.850002,0.097934,0.152196,-0.983459,-0.315500,-0.326823,-0.890835,\n\t\t\t         0.135594,0.551836,-0.822840,0.392682,0.443037,-0.805902,0.432539,0.643452,-0.631519,0.191626,0.641407,-0.742851,\n\t\t\t         0.026063,0.641255,-0.766869,0.415723,0.562181,-0.714896,0.468123,0.422864,-0.775872,0.085269,0.537645,-0.838832,\n\t\t\t         -0.063570,0.624165,-0.778680,0.080660,0.682028,-0.726829,0.451979,0.591357,-0.667806,0.334788,0.466048,-0.818934,\n\t\t\t         0.072512,0.702567,-0.707877,0.372845,0.690756,-0.619526,0.415723,0.562181,-0.714896,0.026063,0.641255,-0.766869,\n\t\t\t         0.061037,0.597797,-0.799310,0.370067,0.437605,-0.819453,0.392682,0.443037,-0.805902,0.135594,0.551836,-0.822840,\n\t\t\t         0.159948,0.723258,-0.671743,0.412122,0.728874,-0.546678,0.372845,0.690756,-0.619526,0.072512,0.702567,-0.707877,\n\t\t\t         -0.313150,0.423536,-0.850002,-0.063570,0.624165,-0.778680,0.334788,0.466048,-0.818934,0.097934,0.152196,-0.983459,\n\t\t\t         -0.847499,-0.434278,-0.305155,-0.611225,-0.039399,-0.790429,-0.315500,-0.326823,-0.890835,-0.619129,-0.636189,-0.460311,\n\t\t\t         0.085269,0.537645,-0.838832,0.468123,0.422864,-0.775872,0.504654,0.501846,-0.702445,0.138524,0.570482,-0.809503,\n\t\t\t         0.132847,0.734397,-0.665548,0.141453,0.700888,-0.699088,0.511734,0.650288,-0.561418,0.498367,0.642445,-0.582110,\n\t\t\t         0.191626,0.641407,-0.742851,0.432539,0.643452,-0.631519,0.412122,0.728874,-0.546678,0.159948,0.723258,-0.671743,\n\t\t\t         -0.806146,-0.582629,0.103153,-0.619129,-0.636189,-0.460311,-0.382122,-0.830042,-0.406140,-0.632832,-0.760918,0.143071,\n\t\t\t         -0.469375,-0.882870,0.013581,-0.497787,-0.860653,0.106815,-0.559984,-0.814356,-0.152379,-0.486404,-0.854488,-0.182287,\n\t\t\t         -0.120029,-0.978820,-0.165746,-0.538682,-0.808893,0.235572,-0.632832,-0.760918,0.143071,-0.382122,-0.830042,-0.406140,\n\t\t\t         -0.506912,-0.797418,0.327280,-0.562487,-0.715506,0.414258,-0.497787,-0.860653,0.106815,-0.469375,-0.882870,0.013581,\n\t\t\t         -0.581195,-0.683065,0.442244,-0.193548,-0.875301,0.443068,-0.475326,-0.759026,0.444807,-0.699789,-0.588855,0.404370,\n\t\t\t         -0.870968,-0.486129,0.071200,-0.707480,-0.623402,0.332896,-0.660756,-0.602893,0.447096,-0.703574,-0.579333,0.411451,\n\t\t\t         -0.847499,-0.434278,-0.305155,-0.804712,-0.585284,0.099277,-0.707480,-0.623402,0.332896,-0.870968,-0.486129,0.071200,\n\t\t\t         -0.645772,-0.721732,0.249092,-0.763207,-0.589618,0.264229,-0.699789,-0.588855,0.404370,-0.475326,-0.759026,0.444807,\n\t\t\t         -0.530656,-0.773675,0.346080,0.030457,-0.992370,0.119327,-0.193548,-0.875301,0.443068,-0.581195,-0.683065,0.442244,\n\t\t\t         -0.486404,-0.854488,-0.182287,-0.559984,-0.814356,-0.152379,-0.685659,-0.725883,0.053896,-0.631184,-0.774560,-0.040193,\n\t\t\t         -0.804712,-0.585284,0.099277,-0.693075,-0.635395,0.340403,-0.700369,-0.633076,0.329630,-0.707480,-0.623402,0.332896,\n\t\t\t         -0.530656,-0.773675,0.346080,-0.581195,-0.683065,0.442244,-0.700369,-0.633076,0.329630,-0.693075,-0.635395,0.340403,\n\t\t\t         -0.581195,-0.683065,0.442244,-0.699789,-0.588855,0.404370,-0.722465,-0.570177,0.391003,-0.700369,-0.633076,0.329630,\n\t\t\t         -0.700369,-0.633076,0.329630,-0.722465,-0.570177,0.391003,-0.660756,-0.602893,0.447096,-0.707480,-0.623402,0.332896,\n\t\t\t         -0.728294,-0.547410,0.412152,-0.559984,-0.814356,-0.152379,-0.497787,-0.860653,0.106815,-0.562487,-0.715506,0.414258,\n\t\t\t         -0.728294,-0.547410,0.412152,-0.722465,-0.570177,0.391003,-0.699789,-0.588855,0.404370,-0.763207,-0.589618,0.264229,\n\t\t\t         -0.928617,0.217261,-0.300729,-0.937407,0.214942,-0.273873,-0.981170,-0.180334,0.068911,-0.983886,-0.148167,0.099857,\n\t\t\t         -0.718192,-0.491165,0.492843,-0.721488,-0.539659,0.433821,-0.190222,-0.732170,0.653981,-0.197394,-0.700003,0.686270,\n\t\t\t         0.451979,0.591357,-0.667806,0.498367,0.642445,-0.582110,0.790551,0.467757,-0.395184,0.797266,0.377667,-0.470840,\n\t\t\t         -0.282174,0.639546,-0.715049,-0.295969,0.705924,-0.643452,-0.668661,0.538896,-0.512284,-0.656636,0.482345,-0.579760,\n\t\t\t         0.953856,-0.249336,0.167211,0.972015,-0.139592,0.188788,0.827509,-0.380291,0.412946,0.815485,-0.443129,0.372295,\n\t\t\t         0.320658,-0.678304,0.661092,0.341075,-0.682089,0.646809,0.642323,-0.532456,0.551225,0.631794,-0.535417,0.560472,\n\t\t\t         -0.983886,-0.148167,0.099857,-0.981170,-0.180334,0.068911,-0.721488,-0.539659,0.433821,-0.718192,-0.491165,0.492843,\n\t\t\t         0.815485,-0.443129,0.372295,0.827509,-0.380291,0.412946,0.642323,-0.532456,0.551225,0.637379,-0.559160,0.530137,\n\t\t\t         0.797266,0.377667,-0.470840,0.790551,0.467757,-0.395184,0.971892,0.193274,-0.134251,0.987091,0.063753,-0.146733,\n\t\t\t         0.080660,0.682028,-0.726829,0.132847,0.734397,-0.665548,0.498367,0.642445,-0.582110,0.451979,0.591357,-0.667806,\n\t\t\t         -0.009980,-0.877560,0.479324,0.061403,-0.807611,0.586444,-0.309091,-0.727348,0.612690,-0.327342,-0.824641,0.461226,\n\t\t\t         -0.954192,0.232734,-0.187994,-0.928800,0.366619,-0.053957,-0.715720,0.618213,-0.324809,-0.754509,0.512864,-0.409436,\n\t\t\t         -0.783227,-0.524003,0.334544,-0.774102,-0.411634,0.480911,-0.977691,0.016877,0.209235,-0.992706,-0.105167,0.058412,\n\t\t\t         -0.707419,-0.482376,0.516556,-0.744530,-0.489181,0.454268,-0.988861,0.144383,-0.036012,-0.989105,0.107181,0.100772,\n\t\t\t         0.051027,-0.840449,0.539445,-0.461654,-0.862300,0.207984,-0.292673,-0.785485,0.545244,-0.253975,-0.747887,0.613269,\n\t\t\t         -0.808191,0.540239,-0.234291,-0.934080,0.146916,-0.325388,-0.839198,0.191931,-0.508774,-0.659719,0.672903,-0.334513,\n\t\t\t         0.005036,-0.790246,0.612720,0.011689,-0.800378,0.599353,-0.314554,-0.725028,0.612629,-0.323985,-0.713431,0.621296,\n\t\t\t         -0.905393,0.414624,-0.091159,-0.917081,0.375805,-0.132939,-0.712668,0.605487,-0.354167,-0.723441,0.603076,-0.335978,\n\t\t\t         -0.788110,-0.382855,0.481918,-0.788079,-0.426221,0.444105,-0.991577,0.064119,0.112491,-0.979827,0.125431,0.155400,\n\t\t\t         0.886502,-0.449171,0.110904,0.581744,-0.727287,0.364116,0.631184,-0.709372,0.313578,0.896420,-0.443129,-0.003265,\n\t\t\t         -0.707358,-0.356120,0.610553,-0.952208,0.109104,0.285195,-0.977691,0.016877,0.209235,-0.774102,-0.411634,0.480911,\n\t\t\t         0.852260,-0.522843,0.016663,0.628864,-0.701163,0.335948,0.621784,-0.688009,0.374096,0.893429,-0.433821,0.116337,\n\t\t\t         0.780023,-0.576006,-0.244392,0.669881,-0.742241,0.017090,0.751061,-0.640034,0.161870,0.879238,-0.471206,-0.069735,\n\t\t\t         -0.381146,0.780847,-0.494919,-0.663320,0.696158,-0.274392,-0.657277,0.700705,-0.277352,-0.364177,0.794733,-0.485488,\n\t\t\t         -0.346446,0.722068,-0.598804,-0.723441,0.603076,-0.335978,-0.712668,0.605487,-0.354167,-0.378399,0.735435,-0.562059,\n\t\t\t         -0.380749,0.727470,-0.570757,-0.659719,0.672903,-0.334513,-0.839198,0.191931,-0.508774,-0.384777,0.123600,-0.914670,\n\t\t\t         -0.379894,0.731498,-0.566179,-0.754509,0.512864,-0.409436,-0.715720,0.618213,-0.324809,-0.360912,0.759850,-0.540696,\n\t\t\t         0.581744,-0.727287,0.364116,0.246681,-0.830988,0.498581,0.289193,-0.810389,0.509476,0.631184,-0.709372,0.313578,\n\t\t\t         0.669881,-0.742241,0.017090,0.433699,-0.849849,0.299326,0.451766,-0.784143,0.425428,0.751061,-0.640034,0.161870,\n\t\t\t         0.384106,-0.766625,0.514512,0.704856,-0.659932,0.260018,0.751061,-0.640034,0.161870,0.451766,-0.784143,0.425428,\n\t\t\t         0.075564,-0.730094,0.679128,-0.233985,-0.641011,0.730949,-0.309091,-0.727348,0.612690,0.061403,-0.807611,0.586444,\n\t\t\t         -0.884976,0.465194,-0.019929,-0.693960,0.668783,-0.266640,-0.715720,0.618213,-0.324809,-0.928800,0.366619,-0.053957,\n\t\t\t         -0.930876,0.354564,-0.087832,-0.951781,0.305399,-0.028779,-0.984710,-0.047273,0.167516,-0.989715,-0.043031,0.136357,\n\t\t\t         -0.828791,-0.428144,0.360210,-0.837306,-0.407422,0.364544,-0.550981,-0.632771,0.544023,-0.501724,-0.671834,0.544847,\n\t\t\t         0.589221,-0.807703,0.020142,0.822901,-0.552995,0.130253,0.548143,-0.726890,0.413648,0.391339,-0.836818,0.382824,\n\t\t\t         -0.099399,-0.780572,0.617084,-0.159886,-0.764733,0.624165,0.247322,-0.791559,0.558763,0.273232,-0.791284,0.546953,\n\t\t\t         -0.989715,-0.043031,0.136357,-0.984710,-0.047273,0.167516,-0.837306,-0.407422,0.364544,-0.828791,-0.428144,0.360210,\n\t\t\t         -0.296579,-0.777490,0.554552,-0.569689,-0.728111,0.381146,-0.352000,-0.778619,0.519425,0.149205,-0.824793,0.545335,\n\t\t\t         -0.608509,-0.644978,0.462264,0.014039,-0.917203,0.398114,-0.352000,-0.778619,0.519425,-0.690329,-0.537278,0.484512,\n\t\t\t         -0.644368,0.602619,-0.470748,-0.882290,0.340403,-0.325022,-0.990051,0.139622,-0.015931,-0.881710,0.408948,-0.235206,\n\t\t\t         -0.509690,-0.835932,0.203375,0.067385,-0.996704,-0.044832,0.014039,-0.917203,0.398114,-0.608509,-0.644978,0.462264,\n\t\t\t         -0.992309,0.123600,0.001648,-0.986633,-0.149052,0.065493,-0.910337,-0.409284,0.061220,-0.970397,-0.160253,0.180578,\n\t\t\t         -0.914609,-0.314432,-0.254158,-0.539201,-0.122135,-0.833247,-0.274758,-0.581500,-0.765709,-0.762596,-0.586291,-0.273293,\n\t\t\t         -0.846614,-0.417188,0.330363,-0.827052,-0.559130,0.057527,-0.771722,-0.615528,0.159734,-0.644002,-0.612354,0.458480,\n\t\t\t         -0.970397,-0.160253,0.180578,-0.910337,-0.409284,0.061220,-0.827052,-0.559130,0.057527,-0.846614,-0.417188,0.330363,\n\t\t\t         -0.910337,-0.409284,0.061220,-0.753136,-0.657460,-0.021943,-0.766564,-0.620960,-0.163518,-0.827052,-0.559130,0.057527,\n\t\t\t         -0.827052,-0.559130,0.057527,-0.766564,-0.620960,-0.163518,-0.858364,-0.509842,-0.056642,-0.771722,-0.615528,0.159734,\n\t\t\t         -0.327342,-0.824641,0.461226,-0.309091,-0.727348,0.612690,-0.774102,-0.411634,0.480911,-0.783227,-0.524003,0.334544,\n\t\t\t         -0.253975,-0.747887,0.613269,-0.292673,-0.785485,0.545244,-0.744530,-0.489181,0.454268,-0.707419,-0.482376,0.516556,\n\t\t\t         -0.323985,-0.713431,0.621296,-0.314554,-0.725028,0.612629,-0.788079,-0.426221,0.444105,-0.788110,-0.382855,0.481918,\n\t\t\t         0.665670,0.506912,-0.547624,0.883389,0.231147,-0.407575,0.845393,0.186560,-0.500473,0.663747,0.404950,-0.628834,\n\t\t\t         -0.233985,-0.641011,0.730949,-0.707358,-0.356120,0.610553,-0.774102,-0.411634,0.480911,-0.309091,-0.727348,0.612690,\n\t\t\t         0.526841,0.431318,-0.732353,0.814325,0.080325,-0.574755,0.896268,0.180731,-0.404950,0.552141,0.558184,-0.619251,\n\t\t\t         0.217780,0.462203,-0.859584,0.629841,0.090518,-0.771416,0.731193,0.137669,-0.668081,0.405011,0.492874,-0.770043,\n\t\t\t         -0.539201,-0.122135,-0.833247,0.039644,0.229347,-0.972533,0.367260,-0.262368,-0.892331,-0.274758,-0.581500,-0.765709,\n\t\t\t         -0.986633,-0.149052,0.065493,-0.841823,-0.500626,0.201636,-0.753136,-0.657460,-0.021943,-0.910337,-0.409284,0.061220,\n\t\t\t         0.067385,-0.996704,-0.044832,0.589221,-0.807703,0.020142,0.391339,-0.836818,0.382824,0.014039,-0.917203,0.398114,\n\t\t\t         -0.882290,0.340403,-0.325022,-0.987579,-0.137852,0.075045,-0.959471,-0.175695,0.220283,-0.990051,0.139622,-0.015931,\n\t\t\t         0.014039,-0.917203,0.398114,0.391339,-0.836818,0.382824,0.149205,-0.824793,0.545335,-0.352000,-0.778619,0.519425,\n\t\t\t         -0.569689,-0.728111,0.381146,-0.891934,-0.393017,0.223518,-0.690329,-0.537278,0.484512,-0.352000,-0.778619,0.519425,\n\t\t\t         0.393262,0.527390,-0.753075,0.483230,0.598804,-0.638661,0.845576,0.264290,-0.463790,0.755974,0.127659,-0.641987,\n\t\t\t         0.548143,-0.726890,0.413648,0.543718,-0.730796,0.412580,0.273232,-0.791284,0.546953,0.247322,-0.791559,0.558763,\n\t\t\t         -0.951781,0.305399,-0.028779,-0.992309,0.123600,0.001648,-0.970397,-0.160253,0.180578,-0.984710,-0.047273,0.167516,\n\t\t\t         0.822901,-0.552995,0.130253,0.813685,-0.547472,0.195379,0.543718,-0.730796,0.412580,0.548143,-0.726890,0.413648,\n\t\t\t         -0.984710,-0.047273,0.167516,-0.970397,-0.160253,0.180578,-0.846614,-0.417188,0.330363,-0.837306,-0.407422,0.364544,\n\t\t\t         -0.409497,0.729118,-0.548326,-0.644368,0.602619,-0.470748,-0.881710,0.408948,-0.235206,-0.736412,0.596301,-0.319498,\n\t\t\t         -0.837306,-0.407422,0.364544,-0.846614,-0.417188,0.330363,-0.644002,-0.612354,0.458480,-0.550981,-0.632771,0.544023,\n\t\t\t         -0.159886,-0.764733,0.624165,-0.296579,-0.777490,0.554552,0.149205,-0.824793,0.545335,0.247322,-0.791559,0.558763,\n\t\t\t         -0.917112,0.378430,-0.125034,-0.930876,0.354564,-0.087832,-0.989715,-0.043031,0.136357,-0.991546,0.024873,0.127262,\n\t\t\t         -0.814112,-0.412427,0.408704,-0.828791,-0.428144,0.360210,-0.501724,-0.671834,0.544847,-0.438398,-0.699545,0.564257,\n\t\t\t         0.550066,0.601917,-0.578875,0.589892,0.658071,-0.467910,0.890133,0.363445,-0.274850,0.873043,0.288461,-0.393139,\n\t\t\t         -0.679495,-0.456648,0.574206,-0.969451,0.124271,0.211341,-0.956816,0.101810,0.272195,-0.683584,-0.409406,0.604205,\n\t\t\t         0.879238,-0.471206,-0.069735,0.751061,-0.640034,0.161870,0.704856,-0.659932,0.260018,0.876186,-0.481948,0.001282,\n\t\t\t         -0.372814,0.766137,-0.523453,-0.693960,0.668783,-0.266640,-0.663320,0.696158,-0.274392,-0.381146,0.780847,-0.494919,\n\t\t\t         0.329051,-0.761071,0.558977,0.628864,-0.701163,0.335948,0.704856,-0.659932,0.260018,0.384106,-0.766625,0.514512,\n\t\t\t         0.068667,-0.791559,0.607196,-0.254036,-0.708243,0.658620,-0.230323,-0.672719,0.703116,0.060427,-0.750603,0.657949,\n\t\t\t         -0.839656,0.534837,-0.094211,-0.657277,0.700705,-0.277352,-0.663320,0.696158,-0.274392,-0.862178,0.504135,-0.049501,\n\t\t\t         -0.254036,-0.708243,0.658620,-0.679495,-0.456648,0.574206,-0.683584,-0.409406,0.604205,-0.230323,-0.672719,0.703116,\n\t\t\t         0.405011,0.492874,-0.770043,0.731193,0.137669,-0.668081,0.804926,0.122227,-0.580615,0.500381,0.479415,-0.720908,\n\t\t\t         -0.774957,-0.488327,0.401135,-0.769494,-0.533982,0.350230,-0.996002,-0.083224,0.031953,-0.996857,-0.010285,0.078219,\n\t\t\t         -0.312906,0.763115,-0.565416,-0.332194,0.752312,-0.568865,-0.687918,0.633900,-0.353435,-0.691763,0.626606,-0.358898,\n\t\t\t         -0.933317,0.312296,-0.177068,-0.943785,0.235420,-0.231971,-0.771508,0.476089,-0.421979,-0.749046,0.539323,-0.384716,\n\t\t\t         0.823115,-0.525071,0.216193,0.854183,-0.457320,0.247353,0.569048,-0.703177,0.426252,0.527604,-0.732994,0.429273,\n\t\t\t         0.603687,-0.692831,0.394360,0.307566,-0.800623,0.514176,0.281167,-0.801111,0.528306,0.569048,-0.703177,0.426252,\n\t\t\t         0.886715,-0.391247,0.246193,0.593799,-0.688986,0.415509,0.535600,-0.733634,0.418165,0.875240,-0.434462,0.212470,\n\t\t\t         0.609088,0.638997,-0.469710,0.921690,0.315622,-0.225501,0.919767,0.264138,-0.290201,0.627674,0.596759,-0.499832,\n\t\t\t         -0.917081,0.375805,-0.132939,-0.933317,0.312296,-0.177068,-0.749046,0.539323,-0.384716,-0.712668,0.605487,-0.354167,\n\t\t\t         -0.315470,-0.774255,0.548601,-0.343822,-0.805567,0.482498,-0.769494,-0.533982,0.350230,-0.774957,-0.488327,0.401135,\n\t\t\t         -0.026063,-0.833461,0.551927,-0.046083,-0.863826,0.501633,-0.343822,-0.805567,0.482498,-0.315470,-0.774255,0.548601,\n\t\t\t         -0.230323,-0.672719,0.703116,-0.683584,-0.409406,0.604205,-0.707358,-0.356120,0.610553,-0.233985,-0.641011,0.730949,\n\t\t\t         -0.405774,0.732109,-0.547075,-0.749046,0.539323,-0.384716,-0.771508,0.476089,-0.421979,-0.427473,0.705557,-0.565172,\n\t\t\t         0.627674,0.596759,-0.499832,0.919767,0.264138,-0.290201,0.883389,0.231147,-0.407575,0.665670,0.506912,-0.547624,\n\t\t\t         0.593799,-0.688986,0.415509,0.249428,-0.835841,0.488968,0.207495,-0.846522,0.490188,0.535600,-0.733634,0.418165,\n\t\t\t         -0.060915,-0.801874,0.594317,-0.099399,-0.780572,0.617084,0.273232,-0.791284,0.546953,0.257576,-0.801691,0.539384,\n\t\t\t         0.060427,-0.750603,0.657949,-0.230323,-0.672719,0.703116,-0.233985,-0.641011,0.730949,0.075564,-0.730094,0.679128,\n\t\t\t         -0.991546,0.024873,0.127262,-0.989715,-0.043031,0.136357,-0.828791,-0.428144,0.360210,-0.814112,-0.412427,0.408704,\n\t\t\t         -0.769494,-0.533982,0.350230,-0.783227,-0.524003,0.334544,-0.992706,-0.105167,0.058412,-0.996002,-0.083224,0.031953,\n\t\t\t         0.629017,0.661092,-0.408979,0.895077,0.403485,-0.189734,0.890133,0.363445,-0.274850,0.589892,0.658071,-0.467910,\n\t\t\t         0.011689,-0.800378,0.599353,-0.026063,-0.833461,0.551927,-0.315470,-0.774255,0.548601,-0.314554,-0.725028,0.612629,\n\t\t\t         -0.788079,-0.426221,0.444105,-0.774957,-0.488327,0.401135,-0.996857,-0.010285,0.078219,-0.991577,0.064119,0.112491,\n\t\t\t         -0.378399,0.735435,-0.562059,-0.712668,0.605487,-0.354167,-0.749046,0.539323,-0.384716,-0.405774,0.732109,-0.547075,\n\t\t\t         0.878842,-0.419141,0.227821,0.603687,-0.692831,0.394360,0.569048,-0.703177,0.426252,0.854183,-0.457320,0.247353,\n\t\t\t         0.527604,-0.732994,0.429273,0.569048,-0.703177,0.426252,0.281167,-0.801111,0.528306,0.257576,-0.801691,0.539384,\n\t\t\t         -0.943785,0.235420,-0.231971,-0.954192,0.232734,-0.187994,-0.754509,0.512864,-0.409436,-0.771508,0.476089,-0.421979,\n\t\t\t         0.535600,-0.733634,0.418165,0.207495,-0.846522,0.490188,0.246681,-0.830988,0.498581,0.581744,-0.727287,0.364116,\n\t\t\t         0.875240,-0.434462,0.212470,0.535600,-0.733634,0.418165,0.581744,-0.727287,0.364116,0.886502,-0.449171,0.110904,\n\t\t\t         -0.314554,-0.725028,0.612629,-0.315470,-0.774255,0.548601,-0.774957,-0.488327,0.401135,-0.788079,-0.426221,0.444105,\n\t\t\t         -0.360912,0.759850,-0.540696,-0.715720,0.618213,-0.324809,-0.693960,0.668783,-0.266640,-0.372814,0.766137,-0.523453,\n\t\t\t         0.876186,-0.481948,0.001282,0.704856,-0.659932,0.260018,0.628864,-0.701163,0.335948,0.852260,-0.522843,0.016663,\n\t\t\t         -0.683584,-0.409406,0.604205,-0.956816,0.101810,0.272195,-0.952208,0.109104,0.285195,-0.707358,-0.356120,0.610553,\n\t\t\t         0.552141,0.558184,-0.619251,0.896268,0.180731,-0.404950,0.921690,0.315622,-0.225501,0.609088,0.638997,-0.469710,\n\t\t\t         0.621784,-0.688009,0.374096,0.310648,-0.791559,0.526231,0.249428,-0.835841,0.488968,0.593799,-0.688986,0.415509,\n\t\t\t         -0.862178,0.504135,-0.049501,-0.663320,0.696158,-0.274392,-0.693960,0.668783,-0.266640,-0.884976,0.465194,-0.019929,\n\t\t\t         0.310648,-0.791559,0.526231,0.621784,-0.688009,0.374096,0.628864,-0.701163,0.335948,0.329051,-0.761071,0.558977,\n\t\t\t         0.500381,0.479415,-0.720908,0.804926,0.122227,-0.580615,0.814325,0.080325,-0.574755,0.526841,0.431318,-0.732353,\n\t\t\t         0.893429,-0.433821,0.116337,0.621784,-0.688009,0.374096,0.593799,-0.688986,0.415509,0.886715,-0.391247,0.246193,\n\t\t\t         -0.046083,-0.863826,0.501633,-0.009980,-0.877560,0.479324,-0.327342,-0.824641,0.461226,-0.343822,-0.805567,0.482498,\n\t\t\t         -0.343822,-0.805567,0.482498,-0.327342,-0.824641,0.461226,-0.783227,-0.524003,0.334544,-0.769494,-0.533982,0.350230,\n\t\t\t         -0.427473,0.705557,-0.565172,-0.771508,0.476089,-0.421979,-0.754509,0.512864,-0.409436,-0.379894,0.731498,-0.566179,\n\t\t\t         0.015229,-0.816980,0.576403,0.005036,-0.790246,0.612720,-0.323985,-0.713431,0.621296,-0.356548,-0.740318,0.569872,\n\t\t\t         -0.900662,0.416303,-0.124302,-0.905393,0.414624,-0.091159,-0.723441,0.603076,-0.335978,-0.711905,0.613330,-0.341990,\n\t\t\t         -0.817011,-0.406171,0.409253,-0.788110,-0.382855,0.481918,-0.979827,0.125431,0.155400,-0.989532,0.100284,0.103732,\n\t\t\t         -0.290780,0.765130,-0.574419,-0.711905,0.613330,-0.341990,-0.723441,0.603076,-0.335978,-0.346446,0.722068,-0.598804,\n\t\t\t         -0.356548,-0.740318,0.569872,-0.323985,-0.713431,0.621296,-0.788110,-0.382855,0.481918,-0.817011,-0.406171,0.409253,\n\t\t\t         0.631184,-0.709372,0.313578,0.289193,-0.810389,0.509476,0.304422,-0.798151,0.519822,0.609119,-0.711234,0.350841,\n\t\t\t         0.663747,0.404950,-0.628834,0.845393,0.186560,-0.500473,0.879849,0.283242,-0.381603,0.647420,0.503281,-0.572283,\n\t\t\t         0.896420,-0.443129,-0.003265,0.631184,-0.709372,0.313578,0.609119,-0.711234,0.350841,0.879238,-0.466109,0.098086,\n\t\t\t         0.609119,-0.711234,0.350841,0.304422,-0.798151,0.519822,0.307566,-0.800623,0.514176,0.603687,-0.692831,0.394360,\n\t\t\t         0.647420,0.503281,-0.572283,0.879849,0.283242,-0.381603,0.895077,0.403485,-0.189734,0.629017,0.661092,-0.408979,\n\t\t\t         0.879238,-0.466109,0.098086,0.609119,-0.711234,0.350841,0.603687,-0.692831,0.394360,0.878842,-0.419141,0.227821,\n\t\t\t         -0.051546,-0.816767,0.574633,0.015229,-0.816980,0.576403,-0.356548,-0.740318,0.569872,-0.389080,-0.741417,0.546709,\n\t\t\t         -0.913175,0.382000,-0.141972,-0.900662,0.416303,-0.124302,-0.711905,0.613330,-0.341990,-0.693655,0.631367,-0.346690,\n\t\t\t         -0.814417,-0.450850,0.365215,-0.817011,-0.406171,0.409253,-0.989532,0.100284,0.103732,-0.997223,0.044130,0.059786,\n\t\t\t         -0.281381,0.793664,-0.539323,-0.693655,0.631367,-0.346690,-0.711905,0.613330,-0.341990,-0.290780,0.765130,-0.574419,\n\t\t\t         -0.389080,-0.741417,0.546709,-0.356548,-0.740318,0.569872,-0.817011,-0.406171,0.409253,-0.814417,-0.450850,0.365215,\n\t\t\t         -0.332194,0.752312,-0.568865,-0.409497,0.729118,-0.548326,-0.736412,0.596301,-0.319498,-0.687918,0.633900,-0.353435,\n\t\t\t         0.039644,0.229347,-0.972533,0.393262,0.527390,-0.753075,0.755974,0.127659,-0.641987,0.367260,-0.262368,-0.892331,\n\t\t\t         0.391339,-0.836818,0.382824,0.548143,-0.726890,0.413648,0.247322,-0.791559,0.558763,0.149205,-0.824793,0.545335,\n\t\t\t         0.883389,0.231147,-0.407575,0.980010,-0.089908,-0.177313,0.946074,-0.107517,-0.305490,0.845393,0.186560,-0.500473,\n\t\t\t         0.814325,0.080325,-0.574755,0.917661,-0.287362,-0.274361,0.979247,-0.157537,-0.127323,0.896268,0.180731,-0.404950,\n\t\t\t         0.629841,0.090518,-0.771416,0.795282,-0.301401,-0.525956,0.907132,-0.249245,-0.339000,0.731193,0.137669,-0.668081,\n\t\t\t         0.367260,-0.262368,-0.892331,0.755974,0.127659,-0.641987,0.917722,-0.272317,-0.289071,0.570574,-0.652974,-0.498032,\n\t\t\t         -0.762596,-0.586291,-0.273293,-0.274758,-0.581500,-0.765709,-0.067721,-0.890316,-0.450209,-0.616138,-0.778893,-0.116947,\n\t\t\t         -0.274758,-0.581500,-0.765709,0.367260,-0.262368,-0.892331,0.570574,-0.652974,-0.498032,-0.067721,-0.890316,-0.450209,\n\t\t\t         0.755974,0.127659,-0.641987,0.845576,0.264290,-0.463790,0.974761,-0.173132,-0.140812,0.917722,-0.272317,-0.289071,\n\t\t\t         0.731193,0.137669,-0.668081,0.907132,-0.249245,-0.339000,0.929411,-0.245949,-0.275063,0.804926,0.122227,-0.580615,\n\t\t\t         0.873043,0.288461,-0.393139,0.890133,0.363445,-0.274850,0.998413,-0.053896,-0.014801,0.986084,-0.129154,-0.104434,\n\t\t\t         0.921690,0.315622,-0.225501,0.996368,-0.065859,0.053896,0.997101,-0.066286,-0.037172,0.919767,0.264138,-0.290201,\n\t\t\t         0.895077,0.403485,-0.189734,0.999542,0.022248,0.020356,0.998413,-0.053896,-0.014801,0.890133,0.363445,-0.274850,\n\t\t\t         0.919767,0.264138,-0.290201,0.997101,-0.066286,-0.037172,0.980010,-0.089908,-0.177313,0.883389,0.231147,-0.407575,\n\t\t\t         0.804926,0.122227,-0.580615,0.929411,-0.245949,-0.275063,0.917661,-0.287362,-0.274361,0.814325,0.080325,-0.574755,\n\t\t\t         0.896268,0.180731,-0.404950,0.979247,-0.157537,-0.127323,0.996368,-0.065859,0.053896,0.921690,0.315622,-0.225501,\n\t\t\t         0.845393,0.186560,-0.500473,0.946074,-0.107517,-0.305490,0.983551,-0.089694,-0.156652,0.879849,0.283242,-0.381603,\n\t\t\t         0.879849,0.283242,-0.381603,0.983551,-0.089694,-0.156652,0.999542,0.022248,0.020356,0.895077,0.403485,-0.189734,\n\t\t\t         0.094302,0.717154,-0.690481,0.500381,0.479415,-0.720908,0.526841,0.431318,-0.732353,0.098514,0.683340,-0.723411,\n\t\t\t         -0.058596,0.617603,-0.784295,0.217780,0.462203,-0.859584,0.405011,0.492874,-0.770043,0.070101,0.736686,-0.672536,\n\t\t\t         0.070101,0.736686,-0.672536,0.405011,0.492874,-0.770043,0.500381,0.479415,-0.720908,0.094302,0.717154,-0.690481,\n\t\t\t         0.244057,0.772759,-0.585864,0.629017,0.661092,-0.408979,0.589892,0.658071,-0.467910,0.185247,0.795984,-0.576250,\n\t\t\t         -0.760613,0.235298,-0.605029,-0.337596,0.541948,-0.769585,0.039644,0.229347,-0.972533,-0.539201,-0.122135,-0.833247,\n\t\t\t         0.136509,0.742149,-0.656148,0.552141,0.558184,-0.619251,0.609088,0.638997,-0.469710,0.166356,0.790826,-0.588977,\n\t\t\t         0.213294,0.659322,-0.720939,0.663747,0.404950,-0.628834,0.647420,0.503281,-0.572283,0.216102,0.665944,-0.713981,\n\t\t\t         -0.033876,0.710929,-0.702445,0.042512,0.750175,-0.659841,0.483230,0.598804,-0.638661,0.393262,0.527390,-0.753075,\n\t\t\t         0.167455,0.757927,-0.630451,0.665670,0.506912,-0.547624,0.663747,0.404950,-0.628834,0.213294,0.659322,-0.720939,\n\t\t\t         0.098514,0.683340,-0.723411,0.526841,0.431318,-0.732353,0.552141,0.558184,-0.619251,0.136509,0.742149,-0.656148,\n\t\t\t         0.123051,0.793573,-0.595874,0.627674,0.596759,-0.499832,0.665670,0.506912,-0.547624,0.167455,0.757927,-0.630451,\n\t\t\t         -0.337596,0.541948,-0.769585,-0.033876,0.710929,-0.702445,0.393262,0.527390,-0.753075,0.039644,0.229347,-0.972533,\n\t\t\t         -0.975921,-0.196081,-0.095401,-0.760613,0.235298,-0.605029,-0.539201,-0.122135,-0.833247,-0.914609,-0.314432,-0.254158,\n\t\t\t         0.216102,0.665944,-0.713981,0.647420,0.503281,-0.572283,0.629017,0.661092,-0.408979,0.244057,0.772759,-0.585864,\n\t\t\t         0.120457,0.757927,-0.641072,0.185247,0.795984,-0.576250,0.589892,0.658071,-0.467910,0.550066,0.601917,-0.578875,\n\t\t\t         0.166356,0.790826,-0.588977,0.609088,0.638997,-0.469710,0.627674,0.596759,-0.499832,0.123051,0.793573,-0.595874,\n\t\t\t         -0.943022,-0.303232,0.136692,-0.914609,-0.314432,-0.254158,-0.762596,-0.586291,-0.273293,-0.878079,-0.456984,0.141667,\n\t\t\t         -0.753136,-0.657460,-0.021943,-0.798120,-0.590655,0.118656,-0.831446,-0.552660,0.056490,-0.766564,-0.620960,-0.163518,\n\t\t\t         -0.616138,-0.778893,-0.116947,-0.790124,-0.581927,0.192389,-0.878079,-0.456984,0.141667,-0.762596,-0.586291,-0.273293,\n\t\t\t         -0.841823,-0.500626,0.201636,-0.807703,-0.474654,0.349681,-0.798120,-0.590655,0.118656,-0.753136,-0.657460,-0.021943,\n\t\t\t         -0.827509,-0.369671,0.422559,-0.608509,-0.644978,0.462264,-0.690329,-0.537278,0.484512,-0.833735,-0.339732,0.435255,\n\t\t\t         -0.987579,-0.137852,0.075045,-0.893063,-0.339305,0.295389,-0.862087,-0.350963,0.365490,-0.959471,-0.175695,0.220283,\n\t\t\t         -0.975921,-0.196081,-0.095401,-0.914365,-0.326212,0.239814,-0.893063,-0.339305,0.295389,-0.987579,-0.137852,0.075045,\n\t\t\t         -0.891934,-0.393017,0.223518,-0.837581,-0.409497,0.361522,-0.833735,-0.339732,0.435255,-0.690329,-0.537278,0.484512,\n\t\t\t         -0.816279,-0.474654,0.329112,-0.509690,-0.835932,0.203375,-0.608509,-0.644978,0.462264,-0.827509,-0.369671,0.422559,\n\t\t\t         -0.766564,-0.620960,-0.163518,-0.831446,-0.552660,0.056490,-0.836177,-0.522263,0.167302,-0.858364,-0.509842,-0.056642,\n\t\t\t         -0.914365,-0.326212,0.239814,-0.887295,-0.387494,0.250008,-0.851802,-0.367229,0.373547,-0.893063,-0.339305,0.295389,\n\t\t\t         -0.816279,-0.474654,0.329112,-0.827509,-0.369671,0.422559,-0.851802,-0.367229,0.373547,-0.887295,-0.387494,0.250008,\n\t\t\t         -0.827509,-0.369671,0.422559,-0.833735,-0.339732,0.435255,-0.834162,-0.366955,0.411695,-0.851802,-0.367229,0.373547,\n\t\t\t         -0.851802,-0.367229,0.373547,-0.834162,-0.366955,0.411695,-0.862087,-0.350963,0.365490,-0.893063,-0.339305,0.295389,\n\t\t\t         -0.823634,-0.382244,0.418867,-0.831446,-0.552660,0.056490,-0.798120,-0.590655,0.118656,-0.807703,-0.474654,0.349681,\n\t\t\t         -0.823634,-0.382244,0.418867,-0.834162,-0.366955,0.411695,-0.833735,-0.339732,0.435255,-0.837581,-0.409497,0.361522,\n\t\t\t         -0.913175,0.382000,-0.141972,-0.917112,0.378430,-0.125034,-0.991546,0.024873,0.127262,-0.997223,0.044130,0.059786,\n\t\t\t         -0.814417,-0.450850,0.365215,-0.814112,-0.412427,0.408704,-0.438398,-0.699545,0.564257,-0.389080,-0.741417,0.546709,\n\t\t\t         0.483230,0.598804,-0.638661,0.550066,0.601917,-0.578875,0.873043,0.288461,-0.393139,0.845576,0.264290,-0.463790,\n\t\t\t         -0.281381,0.793664,-0.539323,-0.312906,0.763115,-0.565416,-0.691763,0.626606,-0.358898,-0.693655,0.631367,-0.346690,\n\t\t\t         0.813685,-0.547472,0.195379,0.823115,-0.525071,0.216193,0.527604,-0.732994,0.429273,0.543718,-0.730796,0.412580,\n\t\t\t         -0.051546,-0.816767,0.574633,-0.060915,-0.801874,0.594317,0.257576,-0.801691,0.539384,0.281167,-0.801111,0.528306,\n\t\t\t         -0.997223,0.044130,0.059786,-0.991546,0.024873,0.127262,-0.814112,-0.412427,0.408704,-0.814417,-0.450850,0.365215,\n\t\t\t         0.543718,-0.730796,0.412580,0.527604,-0.732994,0.429273,0.257576,-0.801691,0.539384,0.273232,-0.791284,0.546953,\n\t\t\t         0.845576,0.264290,-0.463790,0.873043,0.288461,-0.393139,0.986084,-0.129154,-0.104434,0.974761,-0.173132,-0.140812,\n\t\t\t         0.042512,0.750175,-0.659841,0.120457,0.757927,-0.641072,0.550066,0.601917,-0.578875,0.483230,0.598804,-0.638661,\n\t\t\t         -0.156102,-0.837764,0.523209,-0.168401,-0.774346,0.609912,-0.469192,-0.595050,0.652455,-0.561296,-0.650929,0.511063,\n\t\t\t         -0.896329,0.443251,-0.010254,-0.827387,0.545640,0.132969,-0.667104,0.743645,-0.044099,-0.708884,0.678671,-0.191961,\n\t\t\t         -0.892666,-0.262062,0.366680,-0.826777,-0.186987,0.530503,-0.916837,0.257210,0.305307,-0.979064,0.132664,0.154210,\n\t\t\t         -0.793115,-0.423811,0.437422,-0.776330,-0.467391,0.422864,-0.989929,0.074923,0.119968,-0.980407,0.058260,0.188116,\n\t\t\t         -0.043031,-0.857479,0.512680,-0.619953,-0.776055,0.115665,-0.396130,-0.786584,0.473617,-0.432691,-0.721763,0.540147,\n\t\t\t         -0.825434,0.553270,-0.111881,-0.895138,0.406964,-0.181921,-0.807917,0.315012,-0.498001,-0.589221,0.753990,-0.290231,\n\t\t\t         -0.273507,-0.821009,0.501083,-0.267983,-0.848964,0.455397,-0.572344,-0.690786,0.441786,-0.565142,-0.670797,0.480209,\n\t\t\t         -0.862117,0.504379,-0.048097,-0.878933,0.470595,-0.077151,-0.728324,0.647328,-0.224647,-0.689444,0.690939,-0.217383,\n\t\t\t         -0.919675,-0.232521,0.316416,-0.907254,-0.283517,0.310556,-0.969695,0.234230,0.069063,-0.963530,0.253029,0.087008,\n\t\t\t         0.863979,-0.495743,0.087863,0.580584,-0.774773,0.250160,0.516861,-0.810450,0.275643,0.847407,-0.528703,0.048494,\n\t\t\t         -0.784631,-0.246681,0.568743,-0.911649,0.262185,0.316355,-0.916837,0.257210,0.305307,-0.826777,-0.186987,0.530503,\n\t\t\t         0.770623,-0.632801,-0.075106,0.549486,-0.813623,0.189795,0.588733,-0.783013,0.200598,0.793390,-0.604236,-0.073580,\n\t\t\t         0.703848,-0.647023,-0.293039,0.543321,-0.833216,-0.102420,0.533769,-0.844722,0.038636,0.714408,-0.667196,-0.210730,\n\t\t\t         -0.403088,0.839991,-0.363140,-0.690481,0.707572,-0.150090,-0.645009,0.727622,-0.233467,-0.351115,0.822504,-0.447371,\n\t\t\t         -0.374187,0.823908,-0.425581,-0.689444,0.690939,-0.217383,-0.728324,0.647328,-0.224647,-0.378826,0.824824,-0.419660,\n\t\t\t         -0.367901,0.752159,-0.546678,-0.589221,0.753990,-0.290231,-0.807917,0.315012,-0.498001,-0.414289,0.375652,-0.828974,\n\t\t\t         -0.380566,0.842433,-0.381329,-0.708884,0.678671,-0.191961,-0.667104,0.743645,-0.044099,-0.397656,0.880306,-0.258614,\n\t\t\t         0.580584,-0.774773,0.250160,0.155553,-0.918393,0.363750,0.085818,-0.907620,0.410871,0.516861,-0.810450,0.275643,\n\t\t\t         0.543321,-0.833216,-0.102420,0.252724,-0.925748,0.281167,0.264840,-0.895718,0.357097,0.533769,-0.844722,0.038636,\n\t\t\t         0.187109,-0.894009,0.407086,0.548997,-0.824854,0.134739,0.533769,-0.844722,0.038636,0.264840,-0.895718,0.357097,\n\t\t\t         -0.217353,-0.766656,0.604114,-0.461592,-0.600299,0.653096,-0.469192,-0.595050,0.652455,-0.168401,-0.774346,0.609912,\n\t\t\t         -0.822230,0.558061,0.111545,-0.683493,0.728446,-0.046510,-0.667104,0.743645,-0.044099,-0.827387,0.545640,0.132969,\n\t\t\t         -0.873959,0.482955,-0.054079,-0.913724,0.406262,-0.005768,-0.985687,0.098270,0.136937,-0.978881,0.177618,0.100955,\n\t\t\t         -0.915250,-0.265816,0.302713,-0.904386,-0.282662,0.319559,-0.633839,-0.598132,0.490341,-0.617664,-0.635884,0.462691,\n\t\t\t         0.675008,-0.697562,-0.240211,0.808924,-0.584033,-0.067202,0.518906,-0.822626,0.232368,0.445143,-0.879849,0.166326,\n\t\t\t         -0.285318,-0.809473,0.513138,-0.297067,-0.787439,0.540056,0.107852,-0.889920,0.443159,0.120762,-0.889370,0.440870,\n\t\t\t         -0.978881,0.177618,0.100955,-0.985687,0.098270,0.136937,-0.904386,-0.282662,0.319559,-0.915250,-0.265816,0.302713,\n\t\t\t         -0.399243,-0.770012,0.497604,-0.625019,-0.672048,0.397046,-0.255898,-0.854030,0.452864,0.100742,-0.890927,0.442793,\n\t\t\t         -0.548265,-0.834437,0.055300,0.132023,-0.989654,0.055879,-0.255898,-0.854030,0.452864,-0.673482,-0.655477,0.341655,\n\t\t\t         -0.404492,0.771874,-0.490463,-0.623371,0.596728,-0.505234,-0.765191,0.614154,-0.193060,-0.736473,0.643880,-0.207282,\n\t\t\t         -0.458205,-0.848750,-0.263833,0.296823,-0.872280,-0.388562,0.132023,-0.989654,0.055879,-0.548265,-0.834437,0.055300,\n\t\t\t         -0.966186,0.257576,0.010132,-0.945830,0.315073,0.078097,-0.984558,-0.147313,0.094272,-0.996490,-0.024140,0.079775,\n\t\t\t         -0.684500,-0.407300,-0.604572,-0.088137,0.005554,-0.996063,0.158177,-0.303873,-0.939451,-0.542070,-0.592029,-0.596332,\n\t\t\t         -0.913816,-0.340403,0.221381,-0.924223,-0.375225,0.070559,-0.841273,-0.499161,0.207495,-0.713340,-0.573992,0.402020,\n\t\t\t         -0.996490,-0.024140,0.079775,-0.984558,-0.147313,0.094272,-0.924223,-0.375225,0.070559,-0.913816,-0.340403,0.221381,\n\t\t\t         -0.984558,-0.147313,0.094272,-0.943205,-0.317576,0.097476,-0.867092,-0.469832,-0.165349,-0.924223,-0.375225,0.070559,\n\t\t\t         -0.924223,-0.375225,0.070559,-0.867092,-0.469832,-0.165349,-0.934812,-0.338481,-0.107456,-0.841273,-0.499161,0.207495,\n\t\t\t         -0.561296,-0.650929,0.511063,-0.469192,-0.595050,0.652455,-0.826777,-0.186987,0.530503,-0.892666,-0.262062,0.366680,\n\t\t\t         -0.432691,-0.721763,0.540147,-0.396130,-0.786584,0.473617,-0.776330,-0.467391,0.422864,-0.793115,-0.423811,0.437422,\n\t\t\t         -0.565142,-0.670797,0.480209,-0.572344,-0.690786,0.441786,-0.907254,-0.283517,0.310556,-0.919675,-0.232521,0.316416,\n\t\t\t         0.563280,0.650899,-0.508896,0.896634,0.285745,-0.338176,0.864528,0.278939,-0.418012,0.526139,0.651570,-0.546434,\n\t\t\t         -0.461592,-0.600299,0.653096,-0.784631,-0.246681,0.568743,-0.826777,-0.186987,0.530503,-0.469192,-0.595050,0.652455,\n\t\t\t         0.422651,0.583972,-0.693014,0.746300,0.130009,-0.652760,0.738121,0.062807,-0.671712,0.439131,0.560076,-0.702445,\n\t\t\t         0.308634,0.459944,-0.832545,0.713645,0.051515,-0.698569,0.741142,0.112522,-0.661824,0.416181,0.566363,-0.711295,\n\t\t\t         -0.088137,0.005554,-0.996063,0.306436,0.308359,-0.900540,0.561968,-0.052980,-0.825434,0.158177,-0.303873,-0.939451,\n\t\t\t         -0.945830,0.315073,0.078097,-0.974639,0.086917,0.206122,-0.943205,-0.317576,0.097476,-0.984558,-0.147313,0.094272,\n\t\t\t         0.296823,-0.872280,-0.388562,0.675008,-0.697562,-0.240211,0.445143,-0.879849,0.166326,0.132023,-0.989654,0.055879,\n\t\t\t         -0.623371,0.596728,-0.505234,-0.972167,0.170843,-0.160283,-0.967956,0.250557,-0.015503,-0.765191,0.614154,-0.193060,\n\t\t\t         0.132023,-0.989654,0.055879,0.445143,-0.879849,0.166326,0.100742,-0.890927,0.442793,-0.255898,-0.854030,0.452864,\n\t\t\t         -0.625019,-0.672048,0.397046,-0.862178,-0.374004,0.341655,-0.673482,-0.655477,0.341655,-0.255898,-0.854030,0.452864,\n\t\t\t         0.490127,0.546648,-0.678884,0.522019,0.651845,-0.550035,0.837519,0.320780,-0.442244,0.786401,0.174780,-0.592425,\n\t\t\t         0.518906,-0.822626,0.232368,0.524857,-0.811457,0.256935,0.120762,-0.889370,0.440870,0.107852,-0.889920,0.443159,\n\t\t\t         -0.913724,0.406262,-0.005768,-0.966186,0.257576,0.010132,-0.996490,-0.024140,0.079775,-0.985687,0.098270,0.136937,\n\t\t\t         0.808924,-0.584033,-0.067202,0.842860,-0.537858,0.014954,0.524857,-0.811457,0.256935,0.518906,-0.822626,0.232368,\n\t\t\t         -0.985687,0.098270,0.136937,-0.996490,-0.024140,0.079775,-0.913816,-0.340403,0.221381,-0.904386,-0.282662,0.319559,\n\t\t\t         -0.311747,0.840815,-0.442518,-0.404492,0.771874,-0.490463,-0.736473,0.643880,-0.207282,-0.701346,0.681845,-0.207801,\n\t\t\t         -0.904386,-0.282662,0.319559,-0.913816,-0.340403,0.221381,-0.713340,-0.573992,0.402020,-0.633839,-0.598132,0.490341,\n\t\t\t         -0.297067,-0.787439,0.540056,-0.399243,-0.770012,0.497604,0.100742,-0.890927,0.442793,0.107852,-0.889920,0.443159,\n\t\t\t         -0.847102,0.519303,-0.112674,-0.873959,0.482955,-0.054079,-0.978881,0.177618,0.100955,-0.981170,0.181158,0.066591,\n\t\t\t         -0.907590,-0.292245,0.301401,-0.915250,-0.265816,0.302713,-0.617664,-0.635884,0.462691,-0.601459,-0.664357,0.443648,\n\t\t\t         0.531938,0.724387,-0.438490,0.546983,0.685385,-0.480636,0.849910,0.372082,-0.373058,0.853145,0.416761,-0.313669,\n\t\t\t         -0.762017,-0.418470,0.494125,-0.962554,0.117618,0.244240,-0.942106,0.186987,0.278237,-0.780206,-0.335276,0.528031,\n\t\t\t         0.714408,-0.667196,-0.210730,0.533769,-0.844722,0.038636,0.548997,-0.824854,0.134739,0.747948,-0.651723,-0.125614,\n\t\t\t         -0.406598,0.875088,-0.262459,-0.683493,0.728446,-0.046510,-0.690481,0.707572,-0.150090,-0.403088,0.839991,-0.363140,\n\t\t\t         0.136723,-0.881008,0.452834,0.549486,-0.813623,0.189795,0.548997,-0.824854,0.134739,0.187109,-0.894009,0.407086,\n\t\t\t         -0.133732,-0.810511,0.570208,-0.458968,-0.672719,0.580309,-0.488601,-0.638295,0.594775,-0.220069,-0.793023,0.568011,\n\t\t\t         -0.843471,0.536088,-0.033418,-0.645009,0.727622,-0.233467,-0.690481,0.707572,-0.150090,-0.838954,0.544023,0.012696,\n\t\t\t         -0.458968,-0.672719,0.580309,-0.762017,-0.418470,0.494125,-0.780206,-0.335276,0.528031,-0.488601,-0.638295,0.594775,\n\t\t\t         0.416181,0.566363,-0.711295,0.741142,0.112522,-0.661824,0.775384,0.155431,-0.612018,0.424787,0.614765,-0.664510,\n\t\t\t         -0.917753,-0.294870,0.265908,-0.923002,-0.314768,0.221259,-0.997711,0.063845,0.021851,-0.987365,0.154607,0.034455,\n\t\t\t         -0.237739,0.877438,-0.416578,-0.284982,0.856594,-0.430097,-0.627796,0.738090,-0.247017,-0.595935,0.755058,-0.273385,\n\t\t\t         -0.909513,0.391797,-0.138676,-0.928709,0.335246,-0.158269,-0.753960,0.589618,-0.289560,-0.750877,0.600208,-0.275460,\n\t\t\t         0.887997,-0.452773,0.080050,0.912442,-0.400281,0.084597,0.580218,-0.755821,0.303354,0.564318,-0.769921,0.297891,\n\t\t\t         0.533250,-0.799646,0.275979,0.073611,-0.888943,0.451979,0.103549,-0.888821,0.446364,0.580218,-0.755821,0.303354,\n\t\t\t         0.833399,-0.552568,-0.007935,0.604450,-0.764031,0.225471,0.606739,-0.751396,0.259255,0.870205,-0.482986,0.096927,\n\t\t\t         0.525315,0.580737,-0.621876,0.841487,0.117161,-0.527390,0.895352,0.285318,-0.341868,0.557756,0.637989,-0.530869,\n\t\t\t         -0.878933,0.470595,-0.077151,-0.909513,0.391797,-0.138676,-0.750877,0.600208,-0.275460,-0.728324,0.647328,-0.224647,\n\t\t\t         -0.599322,-0.696768,0.394024,-0.619617,-0.694601,0.365429,-0.923002,-0.314768,0.221259,-0.917753,-0.294870,0.265908,\n\t\t\t         -0.246315,-0.881619,0.402539,-0.201483,-0.889401,0.410260,-0.619617,-0.694601,0.365429,-0.599322,-0.696768,0.394024,\n\t\t\t         -0.488601,-0.638295,0.594775,-0.780206,-0.335276,0.528031,-0.784631,-0.246681,0.568743,-0.461592,-0.600299,0.653096,\n\t\t\t         -0.381481,0.818384,-0.429701,-0.750877,0.600208,-0.275460,-0.753960,0.589618,-0.289560,-0.361095,0.830927,-0.423231,\n\t\t\t         0.557756,0.637989,-0.530869,0.895352,0.285318,-0.341868,0.896634,0.285745,-0.338176,0.563280,0.650899,-0.508896,\n\t\t\t         0.604450,-0.764031,0.225471,0.224616,-0.878903,0.420759,0.190252,-0.908567,0.371838,0.606739,-0.751396,0.259255,\n\t\t\t         -0.292032,-0.828333,0.478042,-0.285318,-0.809473,0.513138,0.120762,-0.889370,0.440870,0.109378,-0.885952,0.450667,\n\t\t\t         -0.220069,-0.793023,0.568011,-0.488601,-0.638295,0.594775,-0.461592,-0.600299,0.653096,-0.217353,-0.766656,0.604114,\n\t\t\t         -0.981170,0.181158,0.066591,-0.978881,0.177618,0.100955,-0.915250,-0.265816,0.302713,-0.907590,-0.292245,0.301401,\n\t\t\t         -0.923002,-0.314768,0.221259,-0.892666,-0.262062,0.366680,-0.979064,0.132664,0.154210,-0.997711,0.063845,0.021851,\n\t\t\t         0.527268,0.571337,-0.628895,0.798822,0.259316,-0.542772,0.849910,0.372082,-0.373058,0.546983,0.685385,-0.480636,\n\t\t\t         -0.267983,-0.848964,0.455397,-0.246315,-0.881619,0.402539,-0.599322,-0.696768,0.394024,-0.572344,-0.690786,0.441786,\n\t\t\t         -0.907254,-0.283517,0.310556,-0.917753,-0.294870,0.265908,-0.987365,0.154607,0.034455,-0.969695,0.234230,0.069063,\n\t\t\t         -0.378826,0.824824,-0.419660,-0.728324,0.647328,-0.224647,-0.750877,0.600208,-0.275460,-0.381481,0.818384,-0.429701,\n\t\t\t         0.880459,-0.473891,-0.013611,0.533250,-0.799646,0.275979,0.580218,-0.755821,0.303354,0.912442,-0.400281,0.084597,\n\t\t\t         0.564318,-0.769921,0.297891,0.580218,-0.755821,0.303354,0.103549,-0.888821,0.446364,0.109378,-0.885952,0.450667,\n\t\t\t         -0.928709,0.335246,-0.158269,-0.896329,0.443251,-0.010254,-0.708884,0.678671,-0.191961,-0.753960,0.589618,-0.289560,\n\t\t\t         0.606739,-0.751396,0.259255,0.190252,-0.908567,0.371838,0.155553,-0.918393,0.363750,0.580584,-0.774773,0.250160,\n\t\t\t         0.870205,-0.482986,0.096927,0.606739,-0.751396,0.259255,0.580584,-0.774773,0.250160,0.863979,-0.495743,0.087863,\n\t\t\t         -0.572344,-0.690786,0.441786,-0.599322,-0.696768,0.394024,-0.917753,-0.294870,0.265908,-0.907254,-0.283517,0.310556,\n\t\t\t         -0.397656,0.880306,-0.258614,-0.667104,0.743645,-0.044099,-0.683493,0.728446,-0.046510,-0.406598,0.875088,-0.262459,\n\t\t\t         0.747948,-0.651723,-0.125614,0.548997,-0.824854,0.134739,0.549486,-0.813623,0.189795,0.770623,-0.632801,-0.075106,\n\t\t\t         -0.780206,-0.335276,0.528031,-0.942106,0.186987,0.278237,-0.911649,0.262185,0.316355,-0.784631,-0.246681,0.568743,\n\t\t\t         0.439131,0.560076,-0.702445,0.738121,0.062807,-0.671712,0.841487,0.117161,-0.527390,0.525315,0.580737,-0.621876,\n\t\t\t         0.588733,-0.783013,0.200598,0.203528,-0.864834,0.458937,0.224616,-0.878903,0.420759,0.604450,-0.764031,0.225471,\n\t\t\t         -0.838954,0.544023,0.012696,-0.690481,0.707572,-0.150090,-0.683493,0.728446,-0.046510,-0.822230,0.558061,0.111545,\n\t\t\t         0.203528,-0.864834,0.458937,0.588733,-0.783013,0.200598,0.549486,-0.813623,0.189795,0.136723,-0.881008,0.452834,\n\t\t\t         0.424787,0.614765,-0.664510,0.775384,0.155431,-0.612018,0.746300,0.130009,-0.652760,0.422651,0.583972,-0.693014,\n\t\t\t         0.793390,-0.604236,-0.073580,0.588733,-0.783013,0.200598,0.604450,-0.764031,0.225471,0.833399,-0.552568,-0.007935,\n\t\t\t         -0.201483,-0.889401,0.410260,-0.156102,-0.837764,0.523209,-0.561296,-0.650929,0.511063,-0.619617,-0.694601,0.365429,\n\t\t\t         -0.619617,-0.694601,0.365429,-0.561296,-0.650929,0.511063,-0.892666,-0.262062,0.366680,-0.923002,-0.314768,0.221259,\n\t\t\t         -0.361095,0.830927,-0.423231,-0.753960,0.589618,-0.289560,-0.708884,0.678671,-0.191961,-0.380566,0.842433,-0.381329,\n\t\t\t         -0.264321,-0.811121,0.521714,-0.273507,-0.821009,0.501083,-0.565142,-0.670797,0.480209,-0.553575,-0.644093,0.527879,\n\t\t\t         -0.847194,0.528581,-0.053194,-0.862117,0.504379,-0.048097,-0.689444,0.690939,-0.217383,-0.650960,0.714499,-0.256294,\n\t\t\t         -0.886685,-0.235450,0.397870,-0.919675,-0.232521,0.316416,-0.963530,0.253029,0.087008,-0.955290,0.263344,0.134342,\n\t\t\t         -0.303568,0.827052,-0.473067,-0.650960,0.714499,-0.256294,-0.689444,0.690939,-0.217383,-0.374187,0.823908,-0.425581,\n\t\t\t         -0.553575,-0.644093,0.527879,-0.565142,-0.670797,0.480209,-0.919675,-0.232521,0.316416,-0.886685,-0.235450,0.397870,\n\t\t\t         0.516861,-0.810450,0.275643,0.085818,-0.907620,0.410871,0.055696,-0.886837,0.458632,0.490799,-0.821100,0.291330,\n\t\t\t         0.526139,0.651570,-0.546434,0.864528,0.278939,-0.418012,0.812860,0.268014,-0.517075,0.498520,0.611469,-0.614429,\n\t\t\t         0.847407,-0.528703,0.048494,0.516861,-0.810450,0.275643,0.490799,-0.821100,0.291330,0.842616,-0.538469,-0.001740,\n\t\t\t         0.490799,-0.821100,0.291330,0.055696,-0.886837,0.458632,0.073611,-0.888943,0.451979,0.533250,-0.799646,0.275979,\n\t\t\t         0.498520,0.611469,-0.614429,0.812860,0.268014,-0.517075,0.798822,0.259316,-0.542772,0.527268,0.571337,-0.628895,\n\t\t\t         0.842616,-0.538469,-0.001740,0.490799,-0.821100,0.291330,0.533250,-0.799646,0.275979,0.880459,-0.473891,-0.013611,\n\t\t\t         -0.255715,-0.828455,0.498215,-0.264321,-0.811121,0.521714,-0.553575,-0.644093,0.527879,-0.578906,-0.643788,0.500351,\n\t\t\t         -0.835505,0.540483,-0.098758,-0.847194,0.528581,-0.053194,-0.650960,0.714499,-0.256294,-0.601947,0.750969,-0.271401,\n\t\t\t         -0.896084,-0.241768,0.372234,-0.886685,-0.235450,0.397870,-0.955290,0.263344,0.134342,-0.969512,0.210883,0.124546,\n\t\t\t         -0.212134,0.871181,-0.442732,-0.601947,0.750969,-0.271401,-0.650960,0.714499,-0.256294,-0.303568,0.827052,-0.473067,\n\t\t\t         -0.578906,-0.643788,0.500351,-0.553575,-0.644093,0.527879,-0.886685,-0.235450,0.397870,-0.896084,-0.241768,0.372234,\n\t\t\t         -0.284982,0.856594,-0.430097,-0.311747,0.840815,-0.442518,-0.701346,0.681845,-0.207801,-0.627796,0.738090,-0.247017,\n\t\t\t         0.306436,0.308359,-0.900540,0.490127,0.546648,-0.678884,0.786401,0.174780,-0.592425,0.561968,-0.052980,-0.825434,\n\t\t\t         0.445143,-0.879849,0.166326,0.518906,-0.822626,0.232368,0.107852,-0.889920,0.443159,0.100742,-0.890927,0.442793,\n\t\t\t         0.896634,0.285745,-0.338176,0.982757,-0.159703,-0.092868,0.968566,-0.142186,-0.203955,0.864528,0.278939,-0.418012,\n\t\t\t         0.746300,0.130009,-0.652760,0.859645,-0.348979,-0.373089,0.852290,-0.362926,-0.376598,0.738121,0.062807,-0.671712,\n\t\t\t         0.713645,0.051515,-0.698569,0.802484,-0.389264,-0.452132,0.815302,-0.371746,-0.443922,0.741142,0.112522,-0.661824,\n\t\t\t         0.561968,-0.052980,-0.825434,0.786401,0.174780,-0.592425,0.903348,-0.235755,-0.358287,0.694693,-0.411389,-0.590014,\n\t\t\t         -0.542070,-0.592029,-0.596332,0.158177,-0.303873,-0.939451,0.286294,-0.606250,-0.741935,-0.464278,-0.727622,-0.504929,\n\t\t\t         0.158177,-0.303873,-0.939451,0.561968,-0.052980,-0.825434,0.694693,-0.411389,-0.590014,0.286294,-0.606250,-0.741935,\n\t\t\t         0.786401,0.174780,-0.592425,0.837519,0.320780,-0.442244,0.964721,-0.116703,-0.235939,0.903348,-0.235755,-0.358287,\n\t\t\t         0.741142,0.112522,-0.661824,0.815302,-0.371746,-0.443922,0.853542,-0.339457,-0.395184,0.775384,0.155431,-0.612018,\n\t\t\t         0.853145,0.416761,-0.313669,0.849910,0.372082,-0.373058,0.989746,-0.008423,-0.142521,0.992737,-0.020295,-0.118473,\n\t\t\t         0.841487,0.117161,-0.527390,0.917142,-0.308817,-0.251839,0.981201,-0.176519,-0.077548,0.895352,0.285318,-0.341868,\n\t\t\t         0.798822,0.259316,-0.542772,0.946776,-0.106418,-0.303720,0.989746,-0.008423,-0.142521,0.849910,0.372082,-0.373058,\n\t\t\t         0.895352,0.285318,-0.341868,0.981201,-0.176519,-0.077548,0.982757,-0.159703,-0.092868,0.896634,0.285745,-0.338176,\n\t\t\t         0.775384,0.155431,-0.612018,0.853542,-0.339457,-0.395184,0.859645,-0.348979,-0.373089,0.746300,0.130009,-0.652760,\n\t\t\t         0.738121,0.062807,-0.671712,0.852290,-0.362926,-0.376598,0.917142,-0.308817,-0.251839,0.841487,0.117161,-0.527390,\n\t\t\t         0.864528,0.278939,-0.418012,0.968566,-0.142186,-0.203955,0.940672,-0.114536,-0.319346,0.812860,0.268014,-0.517075,\n\t\t\t         0.812860,0.268014,-0.517075,0.940672,-0.114536,-0.319346,0.946776,-0.106418,-0.303720,0.798822,0.259316,-0.542772,\n\t\t\t         0.004334,0.830287,-0.557268,0.424787,0.614765,-0.664510,0.422651,0.583972,-0.693014,0.017304,0.855251,-0.517869,\n\t\t\t         -0.057955,0.647572,-0.759758,0.308634,0.459944,-0.832545,0.416181,0.566363,-0.711295,0.022309,0.778405,-0.627308,\n\t\t\t         0.022309,0.778405,-0.627308,0.416181,0.566363,-0.711295,0.424787,0.614765,-0.664510,0.004334,0.830287,-0.557268,\n\t\t\t         0.143437,0.786584,-0.600543,0.527268,0.571337,-0.628895,0.546983,0.685385,-0.480636,0.211524,0.838984,-0.501328,\n\t\t\t         -0.462386,0.388653,-0.796930,-0.010193,0.629688,-0.776757,0.306436,0.308359,-0.900540,-0.088137,0.005554,-0.996063,\n\t\t\t         0.020051,0.872036,-0.488998,0.439131,0.560076,-0.702445,0.525315,0.580737,-0.621876,0.120579,0.827418,-0.548448,\n\t\t\t         0.077486,0.836390,-0.542589,0.526139,0.651570,-0.546434,0.498520,0.611469,-0.614429,0.043489,0.820093,-0.570544,\n\t\t\t         0.099612,0.780328,-0.617359,0.126560,0.826868,-0.547929,0.522019,0.651845,-0.550035,0.490127,0.546648,-0.678884,\n\t\t\t         0.123417,0.842463,-0.524369,0.563280,0.650899,-0.508896,0.526139,0.651570,-0.546434,0.077486,0.836390,-0.542589,\n\t\t\t         0.017304,0.855251,-0.517869,0.422651,0.583972,-0.693014,0.439131,0.560076,-0.702445,0.020051,0.872036,-0.488998,\n\t\t\t         0.155065,0.824702,-0.543870,0.557756,0.637989,-0.530869,0.563280,0.650899,-0.508896,0.123417,0.842463,-0.524369,\n\t\t\t         -0.010193,0.629688,-0.776757,0.099612,0.780328,-0.617359,0.490127,0.546648,-0.678884,0.306436,0.308359,-0.900540,\n\t\t\t         -0.889126,-0.095187,-0.447645,-0.462386,0.388653,-0.796930,-0.088137,0.005554,-0.996063,-0.684500,-0.407300,-0.604572,\n\t\t\t         0.043489,0.820093,-0.570544,0.498520,0.611469,-0.614429,0.527268,0.571337,-0.628895,0.143437,0.786584,-0.600543,\n\t\t\t         0.161473,0.862758,-0.479080,0.211524,0.838984,-0.501328,0.546983,0.685385,-0.480636,0.531938,0.724387,-0.438490,\n\t\t\t         0.120579,0.827418,-0.548448,0.525315,0.580737,-0.621876,0.557756,0.637989,-0.530869,0.155065,0.824702,-0.543870,\n\t\t\t         -0.853206,-0.520280,-0.036012,-0.684500,-0.407300,-0.604572,-0.542070,-0.592029,-0.596332,-0.834620,-0.547655,-0.058351,\n\t\t\t         -0.943205,-0.317576,0.097476,-0.836604,-0.499191,0.225532,-0.882962,-0.462142,-0.082369,-0.867092,-0.469832,-0.165349,\n\t\t\t         -0.464278,-0.727622,-0.504929,-0.824244,-0.565905,-0.017304,-0.834620,-0.547655,-0.058351,-0.542070,-0.592029,-0.596332,\n\t\t\t         -0.974639,0.086917,0.206122,-0.881130,-0.291696,0.372143,-0.836604,-0.499191,0.225532,-0.943205,-0.317576,0.097476,\n\t\t\t         -0.870052,-0.451460,0.197790,-0.548265,-0.834437,0.055300,-0.673482,-0.655477,0.341655,-0.873684,-0.353404,0.334300,\n\t\t\t         -0.972167,0.170843,-0.160283,-0.971435,-0.197485,0.131504,-0.952849,-0.166356,0.253670,-0.967956,0.250557,-0.015503,\n\t\t\t         -0.889126,-0.095187,-0.447645,-0.924009,-0.381390,0.026460,-0.971435,-0.197485,0.131504,-0.972167,0.170843,-0.160283,\n\t\t\t         -0.862178,-0.374004,0.341655,-0.901425,-0.254524,0.350169,-0.873684,-0.353404,0.334300,-0.673482,-0.655477,0.341655,\n\t\t\t         -0.835475,-0.546892,0.053194,-0.458205,-0.848750,-0.263833,-0.548265,-0.834437,0.055300,-0.870052,-0.451460,0.197790,\n\t\t\t         -0.867092,-0.469832,-0.165349,-0.882962,-0.462142,-0.082369,-0.957030,-0.271767,0.100925,-0.934812,-0.338481,-0.107456,\n\t\t\t         -0.924009,-0.381390,0.026460,-0.850581,-0.524735,-0.032960,-0.885861,-0.424055,0.188055,-0.971435,-0.197485,0.131504,\n\t\t\t         -0.835475,-0.546892,0.053194,-0.870052,-0.451460,0.197790,-0.885861,-0.424055,0.188055,-0.850581,-0.524735,-0.032960,\n\t\t\t         -0.870052,-0.451460,0.197790,-0.873684,-0.353404,0.334300,-0.875454,-0.324595,0.358043,-0.885861,-0.424055,0.188055,\n\t\t\t         -0.885861,-0.424055,0.188055,-0.875454,-0.324595,0.358043,-0.952849,-0.166356,0.253670,-0.971435,-0.197485,0.131504,\n\t\t\t         -0.859188,-0.267983,0.435835,-0.882962,-0.462142,-0.082369,-0.836604,-0.499191,0.225532,-0.881130,-0.291696,0.372143,\n\t\t\t         -0.859188,-0.267983,0.435835,-0.875454,-0.324595,0.358043,-0.873684,-0.353404,0.334300,-0.901425,-0.254524,0.350169,\n\t\t\t         -0.835505,0.540483,-0.098758,-0.847102,0.519303,-0.112674,-0.981170,0.181158,0.066591,-0.969512,0.210883,0.124546,\n\t\t\t         -0.896084,-0.241768,0.372234,-0.907590,-0.292245,0.301401,-0.601459,-0.664357,0.443648,-0.578906,-0.643788,0.500351,\n\t\t\t         0.522019,0.651845,-0.550035,0.531938,0.724387,-0.438490,0.853145,0.416761,-0.313669,0.837519,0.320780,-0.442244,\n\t\t\t         -0.212134,0.871181,-0.442732,-0.237739,0.877438,-0.416578,-0.595935,0.755058,-0.273385,-0.601947,0.750969,-0.271401,\n\t\t\t         0.842860,-0.537858,0.014954,0.887997,-0.452773,0.080050,0.564318,-0.769921,0.297891,0.524857,-0.811457,0.256935,\n\t\t\t         -0.255715,-0.828455,0.498215,-0.292032,-0.828333,0.478042,0.109378,-0.885952,0.450667,0.103549,-0.888821,0.446364,\n\t\t\t         -0.969512,0.210883,0.124546,-0.981170,0.181158,0.066591,-0.907590,-0.292245,0.301401,-0.896084,-0.241768,0.372234,\n\t\t\t         0.524857,-0.811457,0.256935,0.564318,-0.769921,0.297891,0.109378,-0.885952,0.450667,0.120762,-0.889370,0.440870,\n\t\t\t         0.837519,0.320780,-0.442244,0.853145,0.416761,-0.313669,0.992737,-0.020295,-0.118473,0.964721,-0.116703,-0.235939,\n\t\t\t         0.126560,0.826868,-0.547929,0.161473,0.862758,-0.479080,0.531938,0.724387,-0.438490,0.522019,0.651845,-0.550035,\n\t\t\t         -0.499863,-0.835505,0.228156,-0.483840,-0.799676,0.355510,-0.757805,-0.525376,0.386853,-0.766289,-0.594073,0.244575,\n\t\t\t         -0.799982,0.562395,-0.208960,-0.780572,0.613758,-0.118168,-0.516434,0.810297,-0.276894,-0.552751,0.780816,-0.291055,\n\t\t\t         -0.959136,-0.228248,0.167058,-0.933409,-0.149968,0.325938,-0.947722,0.296274,0.118442,-0.971038,0.235511,-0.039796,\n\t\t\t         -0.964110,-0.063967,0.257546,-0.945952,-0.003754,0.324259,-0.905240,0.392743,0.162023,-0.930906,0.330363,0.155675,\n\t\t\t         -0.584948,-0.770623,0.252815,-0.953307,-0.301981,-0.000031,-0.865444,-0.348033,0.360302,-0.857936,-0.419416,0.296579,\n\t\t\t         -0.761650,0.647664,-0.018769,-0.751518,0.659597,0.009857,-0.468429,0.850337,-0.239631,-0.513199,0.825220,-0.235786,\n\t\t\t         -0.422163,-0.831477,0.361095,-0.420972,-0.831751,0.361797,-0.701315,-0.636586,0.320719,-0.698172,-0.630207,0.339610,\n\t\t\t         -0.797418,0.603198,-0.014008,-0.787317,0.610797,-0.083651,-0.540971,0.821802,-0.178716,-0.550066,0.826044,-0.122684,\n\t\t\t         -0.943907,-0.234321,0.232521,-0.953215,-0.225837,0.200873,-0.957213,0.287179,0.034974,-0.957701,0.272866,0.091281,\n\t\t\t         0.838496,-0.544816,-0.007080,0.456893,-0.872280,0.174230,0.437147,-0.879971,0.185736,0.829127,-0.555223,-0.065279,\n\t\t\t         -0.888546,-0.100162,0.447676,-0.885556,0.381878,0.264412,-0.947722,0.296274,0.118442,-0.933409,-0.149968,0.325938,\n\t\t\t         0.863002,-0.496811,-0.091342,0.533952,-0.839137,0.103427,0.570544,-0.808802,0.142338,0.875240,-0.483444,0.013703,\n\t\t\t         0.707633,-0.641987,-0.295053,0.301675,-0.953063,-0.024812,0.464064,-0.885769,0.005554,0.848140,-0.502243,-0.168340,\n\t\t\t         -0.123447,0.930021,-0.346049,-0.467483,0.867275,-0.170995,-0.503250,0.830042,-0.240272,-0.101718,0.907498,-0.407514,\n\t\t\t         -0.177923,0.946471,-0.269234,-0.550066,0.826044,-0.122684,-0.540971,0.821802,-0.178716,-0.157414,0.941679,-0.297342,\n\t\t\t         -0.118992,0.877163,-0.465194,-0.513199,0.825220,-0.235786,-0.468429,0.850337,-0.239631,-0.006348,0.850093,-0.526536,\n\t\t\t         -0.144536,0.901028,-0.408918,-0.552751,0.780816,-0.291055,-0.516434,0.810297,-0.276894,-0.107700,0.905454,-0.410474,\n\t\t\t         0.456893,-0.872280,0.174230,-0.050050,-0.960143,0.274972,-0.040468,-0.942656,0.331217,0.437147,-0.879971,0.185736,\n\t\t\t         0.301675,-0.953063,-0.024812,-0.232215,-0.957671,0.169958,-0.133549,-0.977508,0.163152,0.464064,-0.885769,0.005554,\n\t\t\t         -0.010498,-0.955870,0.293558,0.520005,-0.854091,0.008728,0.464064,-0.885769,0.005554,-0.133549,-0.977508,0.163152,\n\t\t\t         -0.459975,-0.744682,0.483535,-0.725974,-0.479476,0.492965,-0.757805,-0.525376,0.386853,-0.483840,-0.799676,0.355510,\n\t\t\t         -0.727470,0.685385,0.031465,-0.477798,0.858150,-0.187780,-0.516434,0.810297,-0.276894,-0.780572,0.613758,-0.118168,\n\t\t\t         -0.854732,0.505142,-0.119236,-0.891293,0.425764,-0.155828,-0.993927,0.044038,-0.100742,-0.986297,0.162084,-0.030641,\n\t\t\t         -0.968963,-0.217078,0.118168,-0.970824,-0.238807,-0.020173,-0.769951,-0.621418,0.144932,-0.766656,-0.579089,0.277230,\n\t\t\t         0.447035,-0.888821,-0.100558,0.693167,-0.720725,-0.006226,0.375591,-0.905515,0.197272,0.300882,-0.940642,0.156987,\n\t\t\t         -0.366802,-0.857906,0.359722,-0.383831,-0.883328,0.269021,-0.043550,-0.950011,0.309122,0.011811,-0.947813,0.318583,\n\t\t\t         -0.986297,0.162084,-0.030641,-0.993927,0.044038,-0.100742,-0.970824,-0.238807,-0.020173,-0.968963,-0.217078,0.118168,\n\t\t\t         -0.470717,-0.817530,0.331645,-0.532395,-0.727287,0.433119,-0.167669,-0.909238,0.380993,-0.058168,-0.928953,0.365520,\n\t\t\t         -0.465377,-0.877773,0.113468,0.047029,-0.994598,0.092318,-0.167669,-0.909238,0.380993,-0.746269,-0.606708,0.273751,\n\t\t\t         -0.391369,0.751823,-0.530595,-0.617664,0.626270,-0.475631,-0.802271,0.576983,-0.153020,-0.784936,0.571245,-0.239875,\n\t\t\t         -0.291726,-0.941191,-0.170324,0.109500,-0.971892,-0.208258,0.047029,-0.994598,0.092318,-0.465377,-0.877773,0.113468,\n\t\t\t         -0.965606,0.239601,-0.100803,-0.923460,0.381726,0.038728,-0.993561,0.039979,0.105777,-0.997162,-0.026490,-0.070040,\n\t\t\t         -0.788446,0.012726,-0.614948,-0.409833,0.113315,-0.905087,-0.234138,-0.417096,-0.878170,-0.637440,-0.451735,-0.624134,\n\t\t\t         -0.964721,-0.259133,-0.046052,-0.973968,-0.187078,0.127903,-0.846553,-0.461501,0.265206,-0.812433,-0.572344,0.110965,\n\t\t\t         -0.997162,-0.026490,-0.070040,-0.993561,0.039979,0.105777,-0.973968,-0.187078,0.127903,-0.964721,-0.259133,-0.046052,\n\t\t\t         -0.993561,0.039979,0.105777,-0.994690,0.035371,0.096530,-0.969604,-0.239204,0.051027,-0.973968,-0.187078,0.127903,\n\t\t\t         -0.973968,-0.187078,0.127903,-0.969604,-0.239204,0.051027,-0.911954,-0.392468,0.119480,-0.846553,-0.461501,0.265206,\n\t\t\t         -0.766289,-0.594073,0.244575,-0.757805,-0.525376,0.386853,-0.933409,-0.149968,0.325938,-0.959136,-0.228248,0.167058,\n\t\t\t         -0.857936,-0.419416,0.296579,-0.865444,-0.348033,0.360302,-0.945952,-0.003754,0.324259,-0.964110,-0.063967,0.257546,\n\t\t\t         -0.698172,-0.630207,0.339610,-0.701315,-0.636586,0.320719,-0.953215,-0.225837,0.200873,-0.943907,-0.234321,0.232521,\n\t\t\t         0.716025,0.562273,-0.413617,0.902249,0.258126,-0.345347,0.888150,0.252052,-0.384228,0.703238,0.566240,-0.429884,\n\t\t\t         -0.725974,-0.479476,0.492965,-0.888546,-0.100162,0.447676,-0.933409,-0.149968,0.325938,-0.757805,-0.525376,0.386853,\n\t\t\t         0.798547,0.380963,-0.465957,0.934874,0.108951,-0.337809,0.942076,0.174139,-0.286569,0.780358,0.467025,-0.415815,\n\t\t\t         0.784204,0.224372,-0.578478,0.874538,-0.117130,-0.470565,0.894955,-0.063814,-0.441511,0.821375,0.243385,-0.515824,\n\t\t\t         -0.409833,0.113315,-0.905087,0.089389,0.345531,-0.934111,0.361980,-0.208380,-0.908567,-0.234138,-0.417096,-0.878170,\n\t\t\t         -0.923460,0.381726,0.038728,-0.984832,0.107212,0.136265,-0.994690,0.035371,0.096530,-0.993561,0.039979,0.105777,\n\t\t\t         0.109500,-0.971892,-0.208258,0.447035,-0.888821,-0.100558,0.300882,-0.940642,0.156987,0.047029,-0.994598,0.092318,\n\t\t\t         -0.617664,0.626270,-0.475631,-0.901883,0.363109,-0.233833,-0.963286,0.268349,0.001434,-0.802271,0.576983,-0.153020,\n\t\t\t         0.047029,-0.994598,0.092318,0.300882,-0.940642,0.156987,-0.058168,-0.928953,0.365520,-0.167669,-0.909238,0.380993,\n\t\t\t         -0.532395,-0.727287,0.433119,-0.800409,-0.546525,0.246132,-0.746269,-0.606708,0.273751,-0.167669,-0.909238,0.380993,\n\t\t\t         0.466842,0.579272,-0.668142,0.597980,0.646870,-0.473190,0.921354,0.213385,-0.324809,0.814722,0.089846,-0.572832,\n\t\t\t         0.375591,-0.905515,0.197272,0.387280,-0.897610,0.210364,0.011811,-0.947813,0.318583,-0.043550,-0.950011,0.309122,\n\t\t\t         -0.891293,0.425764,-0.155828,-0.965606,0.239601,-0.100803,-0.997162,-0.026490,-0.070040,-0.993927,0.044038,-0.100742,\n\t\t\t         0.693167,-0.720725,-0.006226,0.774407,-0.632130,0.026307,0.387280,-0.897610,0.210364,0.375591,-0.905515,0.197272,\n\t\t\t         -0.993927,0.044038,-0.100742,-0.997162,-0.026490,-0.070040,-0.964721,-0.259133,-0.046052,-0.970824,-0.238807,-0.020173,\n\t\t\t         -0.238594,0.837489,-0.491592,-0.391369,0.751823,-0.530595,-0.784936,0.571245,-0.239875,-0.677755,0.676901,-0.287118,\n\t\t\t         -0.970824,-0.238807,-0.020173,-0.964721,-0.259133,-0.046052,-0.812433,-0.572344,0.110965,-0.769951,-0.621418,0.144932,\n\t\t\t         -0.383831,-0.883328,0.269021,-0.470717,-0.817530,0.331645,-0.058168,-0.928953,0.365520,-0.043550,-0.950011,0.309122,\n\t\t\t         -0.848659,0.517106,-0.110996,-0.854732,0.505142,-0.119236,-0.986297,0.162084,-0.030641,-0.983154,0.182409,-0.010559,\n\t\t\t         -0.955809,-0.259011,0.138890,-0.968963,-0.217078,0.118168,-0.766656,-0.579089,0.277230,-0.745384,-0.606128,0.277474,\n\t\t\t         0.664479,0.661550,-0.347484,0.695120,0.675527,-0.245857,0.948027,0.297922,-0.111423,0.945128,0.249275,-0.211097,\n\t\t\t         -0.948485,-0.108493,0.297617,-0.938963,0.309153,0.150761,-0.897977,0.386914,0.209510,-0.917508,-0.100406,0.384777,\n\t\t\t         0.848140,-0.502243,-0.168340,0.464064,-0.885769,0.005554,0.520005,-0.854091,0.008728,0.848476,-0.478378,-0.226264,\n\t\t\t         -0.111148,0.920499,-0.374523,-0.477798,0.858150,-0.187780,-0.467483,0.867275,-0.170995,-0.123447,0.930021,-0.346049,\n\t\t\t         0.023286,-0.936216,0.350627,0.533952,-0.839137,0.103427,0.520005,-0.854091,0.008728,-0.010498,-0.955870,0.293558,\n\t\t\t         -0.552446,-0.777886,0.299387,-0.812677,-0.468612,0.346294,-0.763512,-0.471175,0.441603,-0.480209,-0.761193,0.435835,\n\t\t\t         -0.765374,0.641469,-0.051698,-0.503250,0.830042,-0.240272,-0.467483,0.867275,-0.170995,-0.703879,0.710257,0.006592,\n\t\t\t         -0.812677,-0.468612,0.346294,-0.948485,-0.108493,0.297617,-0.917508,-0.100406,0.384777,-0.763512,-0.471175,0.441603,\n\t\t\t         0.821375,0.243385,-0.515824,0.894955,-0.063814,-0.441511,0.908139,0.026093,-0.417798,0.824946,0.301706,-0.477889,\n\t\t\t         -0.950774,-0.251747,0.180609,-0.956114,-0.254524,0.145085,-0.968474,0.243721,-0.051363,-0.950285,0.311258,-0.008057,\n\t\t\t         -0.209510,0.916135,-0.341716,-0.177252,0.896207,-0.406598,-0.554491,0.793420,-0.250893,-0.579455,0.783135,-0.225623,\n\t\t\t         -0.780267,0.611896,-0.129185,-0.785974,0.589648,-0.185705,-0.568072,0.777215,-0.270516,-0.539720,0.807398,-0.238197,\n\t\t\t         0.805963,-0.581133,0.112461,0.817286,-0.546892,0.181341,0.434950,-0.859676,0.267830,0.406537,-0.879330,0.247841,\n\t\t\t         0.446699,-0.877865,0.172582,-0.021088,-0.954863,0.296213,-0.011353,-0.947508,0.319468,0.434950,-0.859676,0.267830,\n\t\t\t         0.839778,-0.542894,0.000061,0.530442,-0.837764,0.129368,0.483657,-0.866268,0.124882,0.837031,-0.546800,-0.018677,\n\t\t\t         0.755058,0.491775,-0.433607,0.924772,0.195105,-0.326640,0.907682,0.212561,-0.361736,0.723991,0.525559,-0.446760,\n\t\t\t         -0.787317,0.610797,-0.083651,-0.780267,0.611896,-0.129185,-0.539720,0.807398,-0.238197,-0.540971,0.821802,-0.178716,\n\t\t\t         -0.702689,-0.649403,0.290658,-0.730186,-0.638905,0.242042,-0.956114,-0.254524,0.145085,-0.950774,-0.251747,0.180609,\n\t\t\t         -0.436811,-0.845729,0.306406,-0.469680,-0.849696,0.239570,-0.730186,-0.638905,0.242042,-0.702689,-0.649403,0.290658,\n\t\t\t         -0.763512,-0.471175,0.441603,-0.917508,-0.100406,0.384777,-0.888546,-0.100162,0.447676,-0.725974,-0.479476,0.492965,\n\t\t\t         -0.127110,0.921903,-0.365886,-0.539720,0.807398,-0.238197,-0.568072,0.777215,-0.270516,-0.146916,0.901120,-0.407819,\n\t\t\t         0.723991,0.525559,-0.446760,0.907682,0.212561,-0.361736,0.902249,0.258126,-0.345347,0.716025,0.562273,-0.413617,\n\t\t\t         0.530442,-0.837764,0.129368,0.007202,-0.979430,0.201544,-0.021546,-0.978729,0.203986,0.483657,-0.866268,0.124882,\n\t\t\t         -0.407910,-0.841914,0.353160,-0.366802,-0.857906,0.359722,0.011811,-0.947813,0.318583,0.003021,-0.946348,0.323038,\n\t\t\t         -0.480209,-0.761193,0.435835,-0.763512,-0.471175,0.441603,-0.725974,-0.479476,0.492965,-0.459975,-0.744682,0.483535,\n\t\t\t         -0.983154,0.182409,-0.010559,-0.986297,0.162084,-0.030641,-0.968963,-0.217078,0.118168,-0.955809,-0.259011,0.138890,\n\t\t\t         -0.956114,-0.254524,0.145085,-0.959136,-0.228248,0.167058,-0.971038,0.235511,-0.039796,-0.968474,0.243721,-0.051363,\n\t\t\t         0.712272,0.644581,-0.277779,0.938994,0.303507,-0.161748,0.948027,0.297922,-0.111423,0.695120,0.675527,-0.245857,\n\t\t\t         -0.420972,-0.831751,0.361797,-0.436811,-0.845729,0.306406,-0.702689,-0.649403,0.290658,-0.701315,-0.636586,0.320719,\n\t\t\t         -0.953215,-0.225837,0.200873,-0.950774,-0.251747,0.180609,-0.950285,0.311258,-0.008057,-0.957213,0.287179,0.034974,\n\t\t\t         -0.157414,0.941679,-0.297342,-0.540971,0.821802,-0.178716,-0.539720,0.807398,-0.238197,-0.127110,0.921903,-0.365886,\n\t\t\t         0.854366,-0.517441,0.048006,0.446699,-0.877865,0.172582,0.434950,-0.859676,0.267830,0.817286,-0.546892,0.181341,\n\t\t\t         0.406537,-0.879330,0.247841,0.434950,-0.859676,0.267830,-0.011353,-0.947508,0.319468,0.003021,-0.946348,0.323038,\n\t\t\t         -0.785974,0.589648,-0.185705,-0.799982,0.562395,-0.208960,-0.552751,0.780816,-0.291055,-0.568072,0.777215,-0.270516,\n\t\t\t         0.483657,-0.866268,0.124882,-0.021546,-0.978729,0.203986,-0.050050,-0.960143,0.274972,0.456893,-0.872280,0.174230,\n\t\t\t         0.837031,-0.546800,-0.018677,0.483657,-0.866268,0.124882,0.456893,-0.872280,0.174230,0.838496,-0.544816,-0.007080,\n\t\t\t         -0.701315,-0.636586,0.320719,-0.702689,-0.649403,0.290658,-0.950774,-0.251747,0.180609,-0.953215,-0.225837,0.200873,\n\t\t\t         -0.107700,0.905454,-0.410474,-0.516434,0.810297,-0.276894,-0.477798,0.858150,-0.187780,-0.111148,0.920499,-0.374523,\n\t\t\t         0.848476,-0.478378,-0.226264,0.520005,-0.854091,0.008728,0.533952,-0.839137,0.103427,0.863002,-0.496811,-0.091342,\n\t\t\t         -0.917508,-0.100406,0.384777,-0.897977,0.386914,0.209510,-0.885556,0.381878,0.264412,-0.888546,-0.100162,0.447676,\n\t\t\t         0.780358,0.467025,-0.415815,0.942076,0.174139,-0.286569,0.924772,0.195105,-0.326640,0.755058,0.491775,-0.433607,\n\t\t\t         0.570544,-0.808802,0.142338,0.032197,-0.966216,0.255684,0.007202,-0.979430,0.201544,0.530442,-0.837764,0.129368,\n\t\t\t         -0.703879,0.710257,0.006592,-0.467483,0.867275,-0.170995,-0.477798,0.858150,-0.187780,-0.727470,0.685385,0.031465,\n\t\t\t         0.032197,-0.966216,0.255684,0.570544,-0.808802,0.142338,0.533952,-0.839137,0.103427,0.023286,-0.936216,0.350627,\n\t\t\t         0.824946,0.301706,-0.477889,0.908139,0.026093,-0.417798,0.934874,0.108951,-0.337809,0.798547,0.380963,-0.465957,\n\t\t\t         0.875240,-0.483444,0.013703,0.570544,-0.808802,0.142338,0.530442,-0.837764,0.129368,0.839778,-0.542894,0.000061,\n\t\t\t         -0.469680,-0.849696,0.239570,-0.499863,-0.835505,0.228156,-0.766289,-0.594073,0.244575,-0.730186,-0.638905,0.242042,\n\t\t\t         -0.730186,-0.638905,0.242042,-0.766289,-0.594073,0.244575,-0.959136,-0.228248,0.167058,-0.956114,-0.254524,0.145085,\n\t\t\t         -0.146916,0.901120,-0.407819,-0.568072,0.777215,-0.270516,-0.552751,0.780816,-0.291055,-0.144536,0.901028,-0.408918,\n\t\t\t         -0.412976,-0.832636,0.368938,-0.422163,-0.831477,0.361095,-0.698172,-0.630207,0.339610,-0.710501,-0.602466,0.363567,\n\t\t\t         -0.799493,0.600604,-0.004700,-0.797418,0.603198,-0.014008,-0.550066,0.826044,-0.122684,-0.552995,0.821711,-0.137516,\n\t\t\t         -0.932096,-0.226386,0.282693,-0.943907,-0.234321,0.232521,-0.957701,0.272866,0.091281,-0.955565,0.259774,0.139073,\n\t\t\t         -0.161473,0.946593,-0.279000,-0.552995,0.821711,-0.137516,-0.550066,0.826044,-0.122684,-0.177923,0.946471,-0.269234,\n\t\t\t         -0.710501,-0.602466,0.363567,-0.698172,-0.630207,0.339610,-0.943907,-0.234321,0.232521,-0.932096,-0.226386,0.282693,\n\t\t\t         0.437147,-0.879971,0.185736,-0.040468,-0.942656,0.331217,-0.044069,-0.955657,0.291147,0.450087,-0.885403,0.115787,\n\t\t\t         0.703238,0.566240,-0.429884,0.888150,0.252052,-0.384228,0.910886,0.244758,-0.332163,0.723289,0.563311,-0.399365,\n\t\t\t         0.829127,-0.555223,-0.065279,0.437147,-0.879971,0.185736,0.450087,-0.885403,0.115787,0.827693,-0.552202,-0.099673,\n\t\t\t         0.450087,-0.885403,0.115787,-0.044069,-0.955657,0.291147,-0.021088,-0.954863,0.296213,0.446699,-0.877865,0.172582,\n\t\t\t         0.723289,0.563311,-0.399365,0.910886,0.244758,-0.332163,0.938994,0.303507,-0.161748,0.712272,0.644581,-0.277779,\n\t\t\t         0.827693,-0.552202,-0.099673,0.450087,-0.885403,0.115787,0.446699,-0.877865,0.172582,0.854366,-0.517441,0.048006,\n\t\t\t         -0.400067,-0.844508,0.355937,-0.412976,-0.832636,0.368938,-0.710501,-0.602466,0.363567,-0.720573,-0.610431,0.328806,\n\t\t\t         -0.836390,0.544694,-0.060854,-0.799493,0.600604,-0.004700,-0.552995,0.821711,-0.137516,-0.575182,0.795892,-0.188910,\n\t\t\t         -0.943175,-0.245186,0.224219,-0.932096,-0.226386,0.282693,-0.955565,0.259774,0.139073,-0.973113,0.219977,0.067873,\n\t\t\t         -0.176305,0.938231,-0.297647,-0.575182,0.795892,-0.188910,-0.552995,0.821711,-0.137516,-0.161473,0.946593,-0.279000,\n\t\t\t         -0.720573,-0.610431,0.328806,-0.710501,-0.602466,0.363567,-0.932096,-0.226386,0.282693,-0.943175,-0.245186,0.224219,\n\t\t\t         -0.177252,0.896207,-0.406598,-0.238594,0.837489,-0.491592,-0.677755,0.676901,-0.287118,-0.554491,0.793420,-0.250893,\n\t\t\t         0.089389,0.345531,-0.934111,0.466842,0.579272,-0.668142,0.814722,0.089846,-0.572832,0.361980,-0.208380,-0.908567,\n\t\t\t         0.300882,-0.940642,0.156987,0.375591,-0.905515,0.197272,-0.043550,-0.950011,0.309122,-0.058168,-0.928953,0.365520,\n\t\t\t         0.902249,0.258126,-0.345347,0.972076,-0.092410,-0.215552,0.955077,-0.123478,-0.269326,0.888150,0.252052,-0.384228,\n\t\t\t         0.934874,0.108951,-0.337809,0.959838,-0.179754,-0.215308,0.980804,-0.131138,-0.144292,0.942076,0.174139,-0.286569,\n\t\t\t         0.874538,-0.117130,-0.470565,0.848903,-0.364544,-0.382641,0.914609,-0.241615,-0.324137,0.894955,-0.063814,-0.441511,\n\t\t\t         0.361980,-0.208380,-0.908567,0.814722,0.089846,-0.572832,0.876553,-0.373028,-0.304117,0.509445,-0.664357,-0.546831,\n\t\t\t         -0.637440,-0.451735,-0.624134,-0.234138,-0.417096,-0.878170,-0.022675,-0.801508,-0.597491,-0.439619,-0.800501,-0.407300,\n\t\t\t         -0.234138,-0.417096,-0.878170,0.361980,-0.208380,-0.908567,0.509445,-0.664357,-0.546831,-0.022675,-0.801508,-0.597491,\n\t\t\t         0.814722,0.089846,-0.572832,0.921354,0.213385,-0.324809,0.961486,-0.227302,-0.154424,0.876553,-0.373028,-0.304117,\n\t\t\t         0.894955,-0.063814,-0.441511,0.914609,-0.241615,-0.324137,0.921476,-0.204718,-0.330058,0.908139,0.026093,-0.417798,\n\t\t\t         0.945128,0.249275,-0.211097,0.948027,0.297922,-0.111423,0.991394,-0.125065,0.038148,0.984191,-0.170324,-0.048128,\n\t\t\t         0.924772,0.195105,-0.326640,0.970855,-0.159703,-0.178625,0.966216,-0.144841,-0.213111,0.907682,0.212561,-0.361736,\n\t\t\t         0.938994,0.303507,-0.161748,0.993439,-0.101108,-0.052980,0.991394,-0.125065,0.038148,0.948027,0.297922,-0.111423,\n\t\t\t         0.907682,0.212561,-0.361736,0.966216,-0.144841,-0.213111,0.972076,-0.092410,-0.215552,0.902249,0.258126,-0.345347,\n\t\t\t         0.908139,0.026093,-0.417798,0.921476,-0.204718,-0.330058,0.959838,-0.179754,-0.215308,0.934874,0.108951,-0.337809,\n\t\t\t         0.942076,0.174139,-0.286569,0.980804,-0.131138,-0.144292,0.970855,-0.159703,-0.178625,0.924772,0.195105,-0.326640,\n\t\t\t         0.888150,0.252052,-0.384228,0.955077,-0.123478,-0.269326,0.961577,-0.122044,-0.245766,0.910886,0.244758,-0.332163,\n\t\t\t         0.910886,0.244758,-0.332163,0.961577,-0.122044,-0.245766,0.993439,-0.101108,-0.052980,0.938994,0.303507,-0.161748,\n\t\t\t         0.490646,0.706442,-0.510025,0.824946,0.301706,-0.477889,0.798547,0.380963,-0.465957,0.425092,0.749992,-0.506729,\n\t\t\t         0.423963,0.660237,-0.619922,0.784204,0.224372,-0.578478,0.821375,0.243385,-0.515824,0.470290,0.713675,-0.519089,\n\t\t\t         0.470290,0.713675,-0.519089,0.821375,0.243385,-0.515824,0.824946,0.301706,-0.477889,0.490646,0.706442,-0.510025,\n\t\t\t         0.316538,0.884823,-0.341807,0.712272,0.644581,-0.277779,0.695120,0.675527,-0.245857,0.271706,0.905545,-0.325724,\n\t\t\t         -0.508774,0.511734,-0.692282,-0.176794,0.704794,-0.687002,0.089389,0.345531,-0.934111,-0.409833,0.113315,-0.905087,\n\t\t\t         0.428663,0.764244,-0.481826,0.780358,0.467025,-0.415815,0.755058,0.491775,-0.433607,0.387341,0.783441,-0.485946,\n\t\t\t         0.333842,0.849849,-0.407758,0.703238,0.566240,-0.429884,0.723289,0.563311,-0.399365,0.328837,0.857204,-0.396283,\n\t\t\t         0.100223,0.807062,-0.581835,0.173620,0.854060,-0.490280,0.597980,0.646870,-0.473190,0.466842,0.579272,-0.668142,\n\t\t\t         0.353771,0.831935,-0.427412,0.716025,0.562273,-0.413617,0.703238,0.566240,-0.429884,0.333842,0.849849,-0.407758,\n\t\t\t         0.425092,0.749992,-0.506729,0.798547,0.380963,-0.465957,0.780358,0.467025,-0.415815,0.428663,0.764244,-0.481826,\n\t\t\t         0.363720,0.800317,-0.476577,0.723991,0.525559,-0.446760,0.716025,0.562273,-0.413617,0.353771,0.831935,-0.427412,\n\t\t\t         -0.176794,0.704794,-0.687002,0.100223,0.807062,-0.581835,0.466842,0.579272,-0.668142,0.089389,0.345531,-0.934111,\n\t\t\t         -0.840297,0.319498,-0.437941,-0.508774,0.511734,-0.692282,-0.409833,0.113315,-0.905087,-0.788446,0.012726,-0.614948,\n\t\t\t         0.328837,0.857204,-0.396283,0.723289,0.563311,-0.399365,0.712272,0.644581,-0.277779,0.316538,0.884823,-0.341807,\n\t\t\t         0.208960,0.895779,-0.392254,0.271706,0.905545,-0.325724,0.695120,0.675527,-0.245857,0.664479,0.661550,-0.347484,\n\t\t\t         0.387341,0.783441,-0.485946,0.755058,0.491775,-0.433607,0.723991,0.525559,-0.446760,0.363720,0.800317,-0.476577,\n\t\t\t         -0.987213,-0.084872,-0.134861,-0.788446,0.012726,-0.614948,-0.637440,-0.451735,-0.624134,-0.920530,-0.376293,-0.104801,\n\t\t\t         -0.994690,0.035371,0.096530,-0.956603,-0.279214,0.083224,-0.959563,-0.281472,-0.003265,-0.969604,-0.239204,0.051027,\n\t\t\t         -0.439619,-0.800501,-0.407300,-0.784143,-0.620167,-0.020936,-0.920530,-0.376293,-0.104801,-0.637440,-0.451735,-0.624134,\n\t\t\t         -0.984832,0.107212,0.136265,-0.957060,-0.222510,0.185675,-0.956603,-0.279214,0.083224,-0.994690,0.035371,0.096530,\n\t\t\t         -0.807642,-0.548967,0.215155,-0.465377,-0.877773,0.113468,-0.746269,-0.606708,0.273751,-0.930967,-0.286538,0.226203,\n\t\t\t         -0.901883,0.363109,-0.233833,-0.992431,-0.017060,0.121555,-0.977599,-0.123295,0.170446,-0.963286,0.268349,0.001434,\n\t\t\t         -0.840297,0.319498,-0.437941,-0.997253,0.069887,0.023255,-0.992431,-0.017060,0.121555,-0.901883,0.363109,-0.233833,\n\t\t\t         -0.800409,-0.546525,0.246132,-0.971862,-0.221625,0.079470,-0.930967,-0.286538,0.226203,-0.746269,-0.606708,0.273751,\n\t\t\t         -0.764031,-0.632801,0.125645,-0.291726,-0.941191,-0.170324,-0.465377,-0.877773,0.113468,-0.807642,-0.548967,0.215155,\n\t\t\t         -0.969604,-0.239204,0.051027,-0.959563,-0.281472,-0.003265,-0.937956,-0.343577,-0.046205,-0.911954,-0.392468,0.119480,\n\t\t\t         -0.997253,0.069887,0.023255,-0.944334,-0.193243,0.266213,-0.937834,-0.208441,0.277444,-0.992431,-0.017060,0.121555,\n\t\t\t         -0.764031,-0.632801,0.125645,-0.807642,-0.548967,0.215155,-0.937834,-0.208441,0.277444,-0.944334,-0.193243,0.266213,\n\t\t\t         -0.807642,-0.548967,0.215155,-0.930967,-0.286538,0.226203,-0.934904,-0.223975,0.275216,-0.937834,-0.208441,0.277444,\n\t\t\t         -0.937834,-0.208441,0.277444,-0.934904,-0.223975,0.275216,-0.977599,-0.123295,0.170446,-0.992431,-0.017060,0.121555,\n\t\t\t         -0.948790,-0.245766,0.198401,-0.959563,-0.281472,-0.003265,-0.956603,-0.279214,0.083224,-0.957060,-0.222510,0.185675,\n\t\t\t         -0.948790,-0.245766,0.198401,-0.934904,-0.223975,0.275216,-0.930967,-0.286538,0.226203,-0.971862,-0.221625,0.079470,\n\t\t\t         -0.836390,0.544694,-0.060854,-0.848659,0.517106,-0.110996,-0.983154,0.182409,-0.010559,-0.973113,0.219977,0.067873,\n\t\t\t         -0.943175,-0.245186,0.224219,-0.955809,-0.259011,0.138890,-0.745384,-0.606128,0.277474,-0.720573,-0.610431,0.328806,\n\t\t\t         0.597980,0.646870,-0.473190,0.664479,0.661550,-0.347484,0.945128,0.249275,-0.211097,0.921354,0.213385,-0.324809,\n\t\t\t         -0.176305,0.938231,-0.297647,-0.209510,0.916135,-0.341716,-0.579455,0.783135,-0.225623,-0.575182,0.795892,-0.188910,\n\t\t\t         0.774407,-0.632130,0.026307,0.805963,-0.581133,0.112461,0.406537,-0.879330,0.247841,0.387280,-0.897610,0.210364,\n\t\t\t         -0.400067,-0.844508,0.355937,-0.407910,-0.841914,0.353160,0.003021,-0.946348,0.323038,-0.011353,-0.947508,0.319468,\n\t\t\t         -0.973113,0.219977,0.067873,-0.983154,0.182409,-0.010559,-0.955809,-0.259011,0.138890,-0.943175,-0.245186,0.224219,\n\t\t\t         0.387280,-0.897610,0.210364,0.406537,-0.879330,0.247841,0.003021,-0.946348,0.323038,0.011811,-0.947813,0.318583,\n\t\t\t         0.921354,0.213385,-0.324809,0.945128,0.249275,-0.211097,0.984191,-0.170324,-0.048128,0.961486,-0.227302,-0.154424,\n\t\t\t         0.173620,0.854060,-0.490280,0.208960,0.895779,-0.392254,0.664479,0.661550,-0.347484,0.597980,0.646870,-0.473190,\n\t\t\t         0.971587,0.190405,0.140355,0.965819,0.213202,0.147191,0.811182,-0.140690,0.567583,0.833003,-0.219489,0.507828,\n\t\t\t         -0.352855,-0.678823,0.643910,-0.346324,-0.652089,0.674398,-0.824519,-0.529862,0.198492,-0.809229,-0.510483,0.290689,\n\t\t\t         0.232856,-0.612903,0.755028,0.233741,-0.519883,0.821619,-0.346324,-0.652089,0.674398,-0.352855,-0.678823,0.643910,\n\t\t\t         0.382092,0.592456,-0.709189,0.836329,0.474624,-0.274270,0.827174,0.503952,-0.248482,0.346507,0.686300,-0.639424,\n\t\t\t         -0.949736,-0.090487,-0.299631,-0.809229,-0.510483,0.290689,-0.824519,-0.529862,0.198492,-0.918119,-0.110050,-0.380657,\n\t\t\t         0.836329,0.474624,-0.274270,0.960295,0.225532,0.164129,0.965819,0.213202,0.147191,0.827174,0.503952,-0.248482,\n\t\t\t         -0.727866,-0.553331,0.404981,-0.687124,-0.555071,0.468734,-0.113468,-0.572771,0.811792,-0.164769,-0.663167,0.730094,\n\t\t\t         0.348186,-0.681051,0.644093,0.367199,-0.592608,0.716880,0.717826,-0.361278,0.595080,0.748894,-0.391156,0.534867,\n\t\t\t         0.289743,0.114048,-0.950255,0.202033,0.328257,-0.922697,0.808313,0.439192,-0.392041,0.901517,0.259835,-0.345988,\n\t\t\t         0.748894,-0.391156,0.534867,0.717826,-0.361278,0.595080,0.941740,0.089145,0.324259,0.960326,0.116703,0.253212,\n\t\t\t         -0.164769,-0.663167,0.730094,-0.113468,-0.572771,0.811792,0.367199,-0.592608,0.716880,0.348186,-0.681051,0.644093,\n\t\t\t         0.687094,-0.344127,0.639882,0.655995,-0.380261,0.651906,0.909177,-0.023927,0.415662,0.923826,-0.011078,0.382580,\n\t\t\t         0.919126,-0.362163,0.154942,0.956877,0.043184,-0.287210,0.909177,-0.023927,0.415662,0.762505,-0.220038,0.608356,\n\t\t\t         -0.818812,-0.546770,-0.174780,-0.719779,-0.692709,-0.045106,-0.516465,-0.621387,0.589129,-0.602069,-0.596789,0.530381,\n\t\t\t         0.681204,-0.672750,-0.288614,0.441115,-0.225074,-0.868740,0.956877,0.043184,-0.287210,0.919126,-0.362163,0.154942,\n\t\t\t         -0.602069,-0.596789,0.530381,-0.516465,-0.621387,0.589129,0.044832,-0.494766,0.867855,-0.064180,-0.516800,0.853664,\n\t\t\t         -0.196844,-0.958190,-0.207617,-0.568224,-0.570666,-0.592822,-0.143498,-0.449843,-0.881497,0.209052,-0.894650,-0.394787,\n\t\t\t         0.398846,-0.513840,0.759514,0.433027,-0.498123,0.751213,0.655995,-0.380261,0.651906,0.687094,-0.344127,0.639882,\n\t\t\t         -0.064180,-0.516800,0.853664,0.044832,-0.494766,0.867855,0.433027,-0.498123,0.751213,0.398846,-0.513840,0.759514,\n\t\t\t         0.044832,-0.494766,0.867855,0.396374,-0.609241,0.686789,0.527146,-0.662709,0.531846,0.433027,-0.498123,0.751213,\n\t\t\t         0.433027,-0.498123,0.751213,0.527146,-0.662709,0.531846,0.634449,-0.490036,0.597736,0.655995,-0.380261,0.651906,\n\t\t\t         0.833003,-0.219489,0.507828,0.811182,-0.140690,0.567583,0.233741,-0.519883,0.821619,0.232856,-0.612903,0.755028,\n\t\t\t         -0.662069,0.118198,-0.740043,-0.224647,0.412214,-0.882931,-0.330149,0.508591,-0.795160,-0.755577,0.160619,-0.634999,\n\t\t\t         -0.568224,-0.570666,-0.592822,-0.667562,-0.335704,-0.664541,-0.300394,-0.140110,-0.943449,-0.143498,-0.449843,-0.881497,\n\t\t\t         -0.516465,-0.621387,0.589129,0.005829,-0.688040,0.725639,0.396374,-0.609241,0.686789,0.044832,-0.494766,0.867855,\n\t\t\t         0.441115,-0.225074,-0.868740,0.289743,0.114048,-0.950255,0.901517,0.259835,-0.345988,0.956877,0.043184,-0.287210,\n\t\t\t         -0.719779,-0.692709,-0.045106,-0.302042,-0.909268,0.286294,0.005829,-0.688040,0.725639,-0.516465,-0.621387,0.589129,\n\t\t\t         0.956877,0.043184,-0.287210,0.901517,0.259835,-0.345988,0.923826,-0.011078,0.382580,0.909177,-0.023927,0.415662,\n\t\t\t         0.655995,-0.380261,0.651906,0.634449,-0.490036,0.597736,0.762505,-0.220038,0.608356,0.909177,-0.023927,0.415662,\n\t\t\t         -0.696493,-0.151128,-0.701437,-0.699240,-0.022645,-0.714499,-0.395917,0.208075,-0.894375,-0.372692,0.076174,-0.924802,\n\t\t\t         0.808313,0.439192,-0.392041,0.786004,0.506912,-0.353832,0.960326,0.116703,0.253212,0.941740,0.089145,0.324259,\n\t\t\t         -0.687124,-0.555071,0.468734,-0.602069,-0.596789,0.530381,-0.064180,-0.516800,0.853664,-0.113468,-0.572771,0.811792,\n\t\t\t         0.202033,0.328257,-0.922697,0.193793,0.478469,-0.856441,0.786004,0.506912,-0.353832,0.808313,0.439192,-0.392041,\n\t\t\t         -0.113468,-0.572771,0.811792,-0.064180,-0.516800,0.853664,0.398846,-0.513840,0.759514,0.367199,-0.592608,0.716880,\n\t\t\t         -0.878933,-0.401105,-0.258003,-0.818812,-0.546770,-0.174780,-0.602069,-0.596789,0.530381,-0.687124,-0.555071,0.468734,\n\t\t\t         0.367199,-0.592608,0.716880,0.398846,-0.513840,0.759514,0.687094,-0.344127,0.639882,0.717826,-0.361278,0.595080,\n\t\t\t         0.717826,-0.361278,0.595080,0.687094,-0.344127,0.639882,0.923826,-0.011078,0.382580,0.941740,0.089145,0.324259,\n\t\t\t         -0.750542,-0.558763,0.352702,-0.727866,-0.553331,0.404981,-0.164769,-0.663167,0.730094,-0.232734,-0.679128,0.696097,\n\t\t\t         0.306803,-0.665792,0.680105,0.348186,-0.681051,0.644093,0.748894,-0.391156,0.534867,0.771996,-0.348735,0.531388,\n\t\t\t         -0.699728,0.043062,-0.713065,-0.722770,0.121189,-0.680349,-0.392132,0.341472,-0.854152,-0.383770,0.280618,-0.879727,\n\t\t\t         -0.911466,-0.242439,-0.332286,-0.900754,-0.293588,-0.320017,-0.727866,-0.553331,0.404981,-0.750542,-0.558763,0.352702,\n\t\t\t         0.223853,0.527329,-0.819605,0.263619,0.569018,-0.778893,0.825190,0.487533,-0.285134,0.803461,0.498703,-0.325114,\n\t\t\t         0.823542,0.504410,-0.259377,0.984130,0.109714,0.139286,0.975036,0.132786,0.177831,0.825190,0.487533,-0.285134,\n\t\t\t         -0.346324,-0.652089,0.674398,-0.357646,-0.623218,0.695425,-0.834712,-0.501511,0.227393,-0.824519,-0.529862,0.198492,\n\t\t\t         0.771996,-0.348735,0.531388,0.748894,-0.391156,0.534867,0.960326,0.116703,0.253212,0.966063,0.124088,0.226539,\n\t\t\t         -0.232734,-0.679128,0.696097,-0.164769,-0.663167,0.730094,0.348186,-0.681051,0.644093,0.306803,-0.665792,0.680105,\n\t\t\t         -0.753319,0.196814,-0.627461,-0.374248,0.448286,-0.811762,-0.392132,0.341472,-0.854152,-0.722770,0.121189,-0.680349,\n\t\t\t         0.965819,0.213202,0.147191,0.960295,0.225532,0.164129,0.792047,-0.086154,0.604327,0.811182,-0.140690,0.567583,\n\t\t\t         0.233741,-0.519883,0.821619,0.209723,-0.480392,0.851588,-0.357646,-0.623218,0.695425,-0.346324,-0.652089,0.674398,\n\t\t\t         -0.918119,-0.110050,-0.380657,-0.824519,-0.529862,0.198492,-0.834712,-0.501511,0.227393,-0.903806,-0.153630,-0.399365,\n\t\t\t         0.270638,0.634358,-0.724082,0.823542,0.504410,-0.259377,0.825190,0.487533,-0.285134,0.263619,0.569018,-0.778893,\n\t\t\t         0.803461,0.498703,-0.325114,0.825190,0.487533,-0.285134,0.975036,0.132786,0.177831,0.966063,0.124088,0.226539,\n\t\t\t         0.811182,-0.140690,0.567583,0.792047,-0.086154,0.604327,0.209723,-0.480392,0.851588,0.233741,-0.519883,0.821619,\n\t\t\t         0.984130,0.109714,0.139286,0.971587,0.190405,0.140355,0.833003,-0.219489,0.507828,0.842799,-0.354747,0.404736,\n\t\t\t         -0.333689,-0.689413,0.642903,-0.352855,-0.678823,0.643910,-0.809229,-0.510483,0.290689,-0.817682,-0.466506,0.337260,\n\t\t\t         0.275369,-0.727287,0.628620,0.232856,-0.612903,0.755028,-0.352855,-0.678823,0.643910,-0.333689,-0.689413,0.642903,\n\t\t\t         -0.964385,-0.098392,-0.245460,-0.817682,-0.466506,0.337260,-0.809229,-0.510483,0.290689,-0.949736,-0.090487,-0.299631,\n\t\t\t         0.842799,-0.354747,0.404736,0.833003,-0.219489,0.507828,0.232856,-0.612903,0.755028,0.275369,-0.727287,0.628620,\n\t\t\t         0.827174,0.503952,-0.248482,0.965819,0.213202,0.147191,0.971587,0.190405,0.140355,0.818903,0.520096,-0.242561,\n\t\t\t         -0.755577,0.160619,-0.634999,-0.330149,0.508591,-0.795160,-0.372997,0.549516,-0.747551,-0.753288,0.255257,-0.606067,\n\t\t\t         0.346507,0.686300,-0.639424,0.827174,0.503952,-0.248482,0.818903,0.520096,-0.242561,0.266121,0.710715,-0.651143,\n\t\t\t         0.818903,0.520096,-0.242561,0.971587,0.190405,0.140355,0.984130,0.109714,0.139286,0.823542,0.504410,-0.259377,\n\t\t\t         -0.753288,0.255257,-0.606067,-0.372997,0.549516,-0.747551,-0.374248,0.448286,-0.811762,-0.753319,0.196814,-0.627461,\n\t\t\t         0.266121,0.710715,-0.651143,0.818903,0.520096,-0.242561,0.823542,0.504410,-0.259377,0.270638,0.634358,-0.724082,\n\t\t\t         0.975036,0.132786,0.177831,0.984130,0.109714,0.139286,0.842799,-0.354747,0.404736,0.812281,-0.381054,0.441542,\n\t\t\t         -0.293435,-0.682302,0.669546,-0.333689,-0.689413,0.642903,-0.817682,-0.466506,0.337260,-0.775933,-0.524583,0.350261,\n\t\t\t         0.274056,-0.730125,0.625904,0.275369,-0.727287,0.628620,-0.333689,-0.689413,0.642903,-0.293435,-0.682302,0.669546,\n\t\t\t         -0.936094,-0.174718,-0.305185,-0.775933,-0.524583,0.350261,-0.817682,-0.466506,0.337260,-0.964385,-0.098392,-0.245460,\n\t\t\t         0.812281,-0.381054,0.441542,0.842799,-0.354747,0.404736,0.275369,-0.727287,0.628620,0.274056,-0.730125,0.625904,\n\t\t\t         -0.900754,-0.293588,-0.320017,-0.878933,-0.401105,-0.258003,-0.687124,-0.555071,0.468734,-0.727866,-0.553331,0.404981,\n\t\t\t         -0.667562,-0.335704,-0.664541,-0.696493,-0.151128,-0.701437,-0.372692,0.076174,-0.924802,-0.300394,-0.140110,-0.943449,\n\t\t\t         0.901517,0.259835,-0.345988,0.808313,0.439192,-0.392041,0.941740,0.089145,0.324259,0.923826,-0.011078,0.382580,\n\t\t\t         -0.224647,0.412214,-0.882931,0.382092,0.592456,-0.709189,0.346507,0.686300,-0.639424,-0.330149,0.508591,-0.795160,\n\t\t\t         -0.300394,-0.140110,-0.943449,-0.372692,0.076174,-0.924802,0.202033,0.328257,-0.922697,0.289743,0.114048,-0.950255,\n\t\t\t         0.209052,-0.894650,-0.394787,-0.143498,-0.449843,-0.881497,0.441115,-0.225074,-0.868740,0.681204,-0.672750,-0.288614,\n\t\t\t         -0.143498,-0.449843,-0.881497,-0.300394,-0.140110,-0.943449,0.289743,0.114048,-0.950255,0.441115,-0.225074,-0.868740,\n\t\t\t         -0.372692,0.076174,-0.924802,-0.395917,0.208075,-0.894375,0.193793,0.478469,-0.856441,0.202033,0.328257,-0.922697,\n\t\t\t         -0.383770,0.280618,-0.879727,-0.392132,0.341472,-0.854152,0.263619,0.569018,-0.778893,0.223853,0.527329,-0.819605,\n\t\t\t         -0.374248,0.448286,-0.811762,0.270638,0.634358,-0.724082,0.263619,0.569018,-0.778893,-0.392132,0.341472,-0.854152,\n\t\t\t         -0.330149,0.508591,-0.795160,0.346507,0.686300,-0.639424,0.266121,0.710715,-0.651143,-0.372997,0.549516,-0.747551,\n\t\t\t         -0.372997,0.549516,-0.747551,0.266121,0.710715,-0.651143,0.270638,0.634358,-0.724082,-0.374248,0.448286,-0.811762,\n\t\t\t         -0.964385,-0.098392,-0.245460,-0.753319,0.196814,-0.627461,-0.722770,0.121189,-0.680349,-0.936094,-0.174718,-0.305185,\n\t\t\t         -0.719779,-0.692709,-0.045106,-0.818812,-0.546770,-0.174780,-0.667562,-0.335704,-0.664541,-0.568224,-0.570666,-0.592822,\n\t\t\t         -0.918119,-0.110050,-0.380657,-0.755577,0.160619,-0.634999,-0.753288,0.255257,-0.606067,-0.949736,-0.090487,-0.299631,\n\t\t\t         -0.878933,-0.401105,-0.258003,-0.900754,-0.293588,-0.320017,-0.699240,-0.022645,-0.714499,-0.696493,-0.151128,-0.701437,\n\t\t\t         -0.903806,-0.153630,-0.399365,-0.662069,0.118198,-0.740043,-0.755577,0.160619,-0.634999,-0.918119,-0.110050,-0.380657,\n\t\t\t         -0.818812,-0.546770,-0.174780,-0.878933,-0.401105,-0.258003,-0.696493,-0.151128,-0.701437,-0.667562,-0.335704,-0.664541,\n\t\t\t         -0.302042,-0.909268,0.286294,-0.719779,-0.692709,-0.045106,-0.568224,-0.570666,-0.592822,-0.196844,-0.958190,-0.207617,\n\t\t\t         -0.949736,-0.090487,-0.299631,-0.753288,0.255257,-0.606067,-0.753319,0.196814,-0.627461,-0.964385,-0.098392,-0.245460,\n\t\t\t         -0.911466,-0.242439,-0.332286,-0.936094,-0.174718,-0.305185,-0.722770,0.121189,-0.680349,-0.699728,0.043062,-0.713065,\n\t\t\t         0.220374,-0.881466,0.417615,-0.196844,-0.958190,-0.207617,0.209052,-0.894650,-0.394787,0.434492,-0.818415,0.375958,\n\t\t\t         0.396374,-0.609241,0.686789,0.669637,-0.532304,0.517869,0.543046,-0.670095,0.505997,0.527146,-0.662709,0.531846,\n\t\t\t         0.681204,-0.672750,-0.288614,0.580401,-0.705771,0.406171,0.434492,-0.818415,0.375958,0.209052,-0.894650,-0.394787,\n\t\t\t         0.005829,-0.688040,0.725639,0.485122,-0.505570,0.713462,0.669637,-0.532304,0.517869,0.396374,-0.609241,0.686789,\n\t\t\t         0.620167,-0.488815,0.613483,0.919126,-0.362163,0.154942,0.762505,-0.220038,0.608356,0.542161,-0.390728,0.743889,\n\t\t\t         -0.302042,-0.909268,0.286294,0.262123,-0.692343,0.672262,0.485122,-0.505570,0.713462,0.005829,-0.688040,0.725639,\n\t\t\t         -0.196844,-0.958190,-0.207617,0.220374,-0.881466,0.417615,0.262123,-0.692343,0.672262,-0.302042,-0.909268,0.286294,\n\t\t\t         0.634449,-0.490036,0.597736,0.497909,-0.543474,0.675771,0.542161,-0.390728,0.743889,0.762505,-0.220038,0.608356,\n\t\t\t         0.580401,-0.705771,0.406171,0.681204,-0.672750,-0.288614,0.919126,-0.362163,0.154942,0.620167,-0.488815,0.613483,\n\t\t\t         0.527146,-0.662709,0.531846,0.543046,-0.670095,0.505997,0.497909,-0.543474,0.675771,0.634449,-0.490036,0.597736,\n\t\t\t         0.220374,-0.881466,0.417615,0.434492,-0.818415,0.375958,0.459761,-0.578204,0.673971,0.262123,-0.692343,0.672262,\n\t\t\t         0.580401,-0.705771,0.406171,0.620167,-0.488815,0.613483,0.459761,-0.578204,0.673971,0.434492,-0.818415,0.375958,\n\t\t\t         0.620167,-0.488815,0.613483,0.542161,-0.390728,0.743889,0.450148,-0.423658,0.786035,0.459761,-0.578204,0.673971,\n\t\t\t         0.459761,-0.578204,0.673971,0.450148,-0.423658,0.786035,0.485122,-0.505570,0.713462,0.262123,-0.692343,0.672262,\n\t\t\t         0.450148,-0.423658,0.786035,0.543046,-0.670095,0.505997,0.669637,-0.532304,0.517869,0.485122,-0.505570,0.713462,\n\t\t\t         0.543046,-0.670095,0.505997,0.450148,-0.423658,0.786035,0.542161,-0.390728,0.743889,0.497909,-0.543474,0.675771,\n\t\t\t         -0.775933,-0.524583,0.350261,-0.750542,-0.558763,0.352702,-0.232734,-0.679128,0.696097,-0.293435,-0.682302,0.669546,\n\t\t\t         0.274056,-0.730125,0.625904,0.306803,-0.665792,0.680105,0.771996,-0.348735,0.531388,0.812281,-0.381054,0.441542,\n\t\t\t         -0.699240,-0.022645,-0.714499,-0.699728,0.043062,-0.713065,-0.383770,0.280618,-0.879727,-0.395917,0.208075,-0.894375,\n\t\t\t         -0.936094,-0.174718,-0.305185,-0.911466,-0.242439,-0.332286,-0.750542,-0.558763,0.352702,-0.775933,-0.524583,0.350261,\n\t\t\t         0.193793,0.478469,-0.856441,0.223853,0.527329,-0.819605,0.803461,0.498703,-0.325114,0.786004,0.506912,-0.353832,\n\t\t\t         0.812281,-0.381054,0.441542,0.771996,-0.348735,0.531388,0.966063,0.124088,0.226539,0.975036,0.132786,0.177831,\n\t\t\t         -0.293435,-0.682302,0.669546,-0.232734,-0.679128,0.696097,0.306803,-0.665792,0.680105,0.274056,-0.730125,0.625904,\n\t\t\t         0.786004,0.506912,-0.353832,0.803461,0.498703,-0.325114,0.966063,0.124088,0.226539,0.960326,0.116703,0.253212,\n\t\t\t         -0.395917,0.208075,-0.894375,-0.383770,0.280618,-0.879727,0.223853,0.527329,-0.819605,0.193793,0.478469,-0.856441,\n\t\t\t         -0.900754,-0.293588,-0.320017,-0.911466,-0.242439,-0.332286,-0.699728,0.043062,-0.713065,-0.699240,-0.022645,-0.714499,\n\t\t\t         0.419294,-0.616627,0.666280,0.387036,-0.612079,0.689566,0.184240,-0.585528,0.789392,0.175481,-0.658254,0.732017,\n\t\t\t         -0.996979,0.007935,0.076907,-0.967437,0.092746,0.235389,-0.941923,0.324168,-0.087374,-0.926298,0.289712,-0.240883,\n\t\t\t         0.380993,-0.629627,0.677023,0.368999,-0.627003,0.686056,-0.017243,-0.653066,0.757073,-0.010041,-0.627949,0.778161,\n\t\t\t         -0.991302,0.038545,0.125645,-0.994324,-0.084017,0.064791,-0.963500,-0.153447,-0.219214,-0.964629,0.188574,-0.184027,\n\t\t\t         0.530808,-0.616932,0.581011,0.478378,-0.653157,0.586932,0.160955,-0.737968,0.655324,0.192297,-0.696860,0.690909,\n\t\t\t         -0.988433,-0.089969,0.121830,-0.990570,-0.136845,0.004059,-0.934568,0.167791,-0.313669,-0.946379,0.225013,-0.231666,\n\t\t\t         0.361522,-0.591540,0.720634,0.132450,-0.567186,0.812830,0.184240,-0.585528,0.789392,0.387036,-0.612079,0.689566,\n\t\t\t         -0.961150,0.140538,0.237526,-0.959838,0.280465,-0.001679,-0.941923,0.324168,-0.087374,-0.967437,0.092746,0.235389,\n\t\t\t         -0.686087,0.535478,-0.492416,-0.734886,0.480636,-0.478408,-0.953673,0.233039,-0.190100,-0.950743,0.218513,-0.219764,\n\t\t\t         -0.204566,-0.724631,0.658040,-0.259041,-0.731223,0.631001,0.281075,-0.709830,0.645833,0.312326,-0.678365,0.664998,\n\t\t\t         -0.341350,-0.740837,0.578417,-0.440230,-0.808252,0.390973,-0.135533,-0.829951,0.541093,0.162755,-0.743797,0.648274,\n\t\t\t         -0.821558,0.375225,-0.429151,-0.995544,-0.040162,-0.085086,-0.945433,-0.325480,0.013794,-0.992126,0.040529,-0.118229,\n\t\t\t         -0.995544,-0.040162,-0.085086,-0.703574,-0.579333,0.411451,-0.506912,-0.797418,0.327280,-0.945433,-0.325480,0.013794,\n\t\t\t         -0.440230,-0.808252,0.390973,-0.631184,-0.774560,-0.040193,-0.645772,-0.721732,0.249092,-0.135533,-0.829951,0.541093,\n\t\t\t         -0.734886,0.480636,-0.478408,-0.821558,0.375225,-0.429151,-0.992126,0.040529,-0.118229,-0.953673,0.233039,-0.190100,\n\t\t\t         -0.259041,-0.731223,0.631001,-0.341350,-0.740837,0.578417,0.162755,-0.743797,0.648274,0.281075,-0.709830,0.645833,\n\t\t\t         -0.668661,0.538896,-0.512284,-0.686087,0.535478,-0.492416,-0.950743,0.218513,-0.219764,-0.937407,0.214942,-0.273873,\n\t\t\t         0.368297,-0.638050,0.676168,0.026612,-0.633045,0.773644,0.063478,-0.605396,0.793359,0.356731,-0.611042,0.706626,\n\t\t\t         -0.984405,0.028565,0.173498,-0.978881,0.176061,-0.103580,-0.976897,0.209754,-0.040101,-0.978607,0.066347,0.194617,\n\t\t\t         -0.987182,-0.145482,-0.065493,-0.993683,-0.105502,-0.038026,-0.911466,0.208045,-0.354839,-0.914823,0.145482,-0.376659,\n\t\t\t         -0.990570,-0.136845,0.004059,-0.987182,-0.145482,-0.065493,-0.914823,0.145482,-0.376659,-0.934568,0.167791,-0.313669,\n\t\t\t         0.480422,-0.647267,0.591784,0.457656,-0.625416,0.631947,0.163457,-0.714316,0.680441,0.160527,-0.747337,0.644734,\n\t\t\t         -0.190222,-0.732170,0.653981,-0.204566,-0.724631,0.658040,0.312326,-0.678365,0.664998,0.341075,-0.682089,0.646809,\n\t\t\t         0.356731,-0.611042,0.706626,0.063478,-0.605396,0.793359,0.132450,-0.567186,0.812830,0.361522,-0.591540,0.720634,\n\t\t\t         0.478378,-0.653157,0.586932,0.480422,-0.647267,0.591784,0.160527,-0.747337,0.644734,0.160955,-0.737968,0.655324,\n\t\t\t         -0.993683,-0.105502,-0.038026,-0.996979,0.007935,0.076907,-0.926298,0.289712,-0.240883,-0.911466,0.208045,-0.354839,\n\t\t\t         -0.978607,0.066347,0.194617,-0.976897,0.209754,-0.040101,-0.959838,0.280465,-0.001679,-0.961150,0.140538,0.237526,\n\t\t\t         0.457656,-0.625416,0.631947,0.419294,-0.616627,0.666280,0.175481,-0.658254,0.732017,0.163457,-0.714316,0.680441,\n\t\t\t         0.594195,-0.562578,0.574786,0.530808,-0.616932,0.581011,0.192297,-0.696860,0.690909,0.292245,-0.654042,0.697684,\n\t\t\t         -0.979858,-0.094607,0.175695,-0.988433,-0.089969,0.121830,-0.946379,0.225013,-0.231666,-0.942900,0.227973,-0.242775,\n\t\t\t         0.631794,-0.535417,0.560472,0.594195,-0.562578,0.574786,0.292245,-0.654042,0.697684,0.320658,-0.678304,0.661092,\n\t\t\t         -0.983886,-0.148167,0.099857,-0.979858,-0.094607,0.175695,-0.942900,0.227973,-0.242775,-0.928617,0.217261,-0.300729,\n\t\t\t         -0.703574,-0.579333,0.411451,-0.660756,-0.602893,0.447096,-0.562487,-0.715506,0.414258,-0.506912,-0.797418,0.327280,\n\t\t\t         -0.631184,-0.774560,-0.040193,-0.685659,-0.725883,0.053896,-0.763207,-0.589618,0.264229,-0.645772,-0.721732,0.249092,\n\t\t\t         -0.722465,-0.570177,0.391003,-0.728294,-0.547410,0.412152,-0.562487,-0.715506,0.414258,-0.660756,-0.602893,0.447096,\n\t\t\t         -0.559984,-0.814356,-0.152379,-0.728294,-0.547410,0.412152,-0.763207,-0.589618,0.264229,-0.685659,-0.725883,0.053896,\n\t\t\t         -0.656636,0.482345,-0.579760,-0.668661,0.538896,-0.512284,-0.937407,0.214942,-0.273873,-0.928617,0.217261,-0.300729,\n\t\t\t         -0.197394,-0.700003,0.686270,-0.190222,-0.732170,0.653981,0.341075,-0.682089,0.646809,0.320658,-0.678304,0.661092,\n\t\t\t         0.249428,-0.835841,0.488968,0.310648,-0.791559,0.526231,0.061403,-0.807611,0.586444,-0.009980,-0.877560,0.479324,\n\t\t\t         -0.992706,-0.105167,0.058412,-0.977691,0.016877,0.209235,-0.928800,0.366619,-0.053957,-0.954192,0.232734,-0.187994,\n\t\t\t         0.433699,-0.849849,0.299326,-0.002472,-0.968963,-0.247169,-0.461654,-0.862300,0.207984,0.051027,-0.840449,0.539445,\n\t\t\t         -0.989105,0.107181,0.100772,-0.988861,0.144383,-0.036012,-0.934080,0.146916,-0.325388,-0.808191,0.540239,-0.234291,\n\t\t\t         0.304422,-0.798151,0.519822,0.289193,-0.810389,0.509476,0.011689,-0.800378,0.599353,0.005036,-0.790246,0.612720,\n\t\t\t         -0.979827,0.125431,0.155400,-0.991577,0.064119,0.112491,-0.917081,0.375805,-0.132939,-0.905393,0.414624,-0.091159,\n\t\t\t         0.329051,-0.761071,0.558977,0.075564,-0.730094,0.679128,0.061403,-0.807611,0.586444,0.310648,-0.791559,0.526231,\n\t\t\t         -0.952208,0.109104,0.285195,-0.884976,0.465194,-0.019929,-0.928800,0.366619,-0.053957,-0.977691,0.016877,0.209235,\n\t\t\t         -0.687918,0.633900,-0.353435,-0.736412,0.596301,-0.319498,-0.951781,0.305399,-0.028779,-0.930876,0.354564,-0.087832,\n\t\t\t         -0.501724,-0.671834,0.544847,-0.550981,-0.632771,0.544023,-0.159886,-0.764733,0.624165,-0.099399,-0.780572,0.617084,\n\t\t\t         -0.644002,-0.612354,0.458480,-0.771722,-0.615528,0.159734,-0.569689,-0.728111,0.381146,-0.296579,-0.777490,0.554552,\n\t\t\t         -0.881710,0.408948,-0.235206,-0.990051,0.139622,-0.015931,-0.986633,-0.149052,0.065493,-0.992309,0.123600,0.001648,\n\t\t\t         -0.990051,0.139622,-0.015931,-0.959471,-0.175695,0.220283,-0.841823,-0.500626,0.201636,-0.986633,-0.149052,0.065493,\n\t\t\t         -0.771722,-0.615528,0.159734,-0.858364,-0.509842,-0.056642,-0.891934,-0.393017,0.223518,-0.569689,-0.728111,0.381146,\n\t\t\t         -0.736412,0.596301,-0.319498,-0.881710,0.408948,-0.235206,-0.992309,0.123600,0.001648,-0.951781,0.305399,-0.028779,\n\t\t\t         -0.550981,-0.632771,0.544023,-0.644002,-0.612354,0.458480,-0.296579,-0.777490,0.554552,-0.159886,-0.764733,0.624165,\n\t\t\t         -0.691763,0.626606,-0.358898,-0.687918,0.633900,-0.353435,-0.930876,0.354564,-0.087832,-0.917112,0.378430,-0.125034,\n\t\t\t         0.451766,-0.784143,0.425428,0.068667,-0.791559,0.607196,0.060427,-0.750603,0.657949,0.384106,-0.766625,0.514512,\n\t\t\t         -0.969451,0.124271,0.211341,-0.839656,0.534837,-0.094211,-0.862178,0.504135,-0.049501,-0.956816,0.101810,0.272195,\n\t\t\t         -0.996857,-0.010285,0.078219,-0.996002,-0.083224,0.031953,-0.943785,0.235420,-0.231971,-0.933317,0.312296,-0.177068,\n\t\t\t         -0.991577,0.064119,0.112491,-0.996857,-0.010285,0.078219,-0.933317,0.312296,-0.177068,-0.917081,0.375805,-0.132939,\n\t\t\t         0.246681,-0.830988,0.498581,0.207495,-0.846522,0.490188,-0.046083,-0.863826,0.501633,-0.026063,-0.833461,0.551927,\n\t\t\t         -0.438398,-0.699545,0.564257,-0.501724,-0.671834,0.544847,-0.099399,-0.780572,0.617084,-0.060915,-0.801874,0.594317,\n\t\t\t         0.384106,-0.766625,0.514512,0.060427,-0.750603,0.657949,0.075564,-0.730094,0.679128,0.329051,-0.761071,0.558977,\n\t\t\t         0.289193,-0.810389,0.509476,0.246681,-0.830988,0.498581,-0.026063,-0.833461,0.551927,0.011689,-0.800378,0.599353,\n\t\t\t         -0.996002,-0.083224,0.031953,-0.992706,-0.105167,0.058412,-0.954192,0.232734,-0.187994,-0.943785,0.235420,-0.231971,\n\t\t\t         -0.956816,0.101810,0.272195,-0.862178,0.504135,-0.049501,-0.884976,0.465194,-0.019929,-0.952208,0.109104,0.285195,\n\t\t\t         0.207495,-0.846522,0.490188,0.249428,-0.835841,0.488968,-0.009980,-0.877560,0.479324,-0.046083,-0.863826,0.501633,\n\t\t\t         0.307566,-0.800623,0.514176,0.304422,-0.798151,0.519822,0.005036,-0.790246,0.612720,0.015229,-0.816980,0.576403,\n\t\t\t         -0.989532,0.100284,0.103732,-0.979827,0.125431,0.155400,-0.905393,0.414624,-0.091159,-0.900662,0.416303,-0.124302,\n\t\t\t         0.281167,-0.801111,0.528306,0.307566,-0.800623,0.514176,0.015229,-0.816980,0.576403,-0.051546,-0.816767,0.574633,\n\t\t\t         -0.997223,0.044130,0.059786,-0.989532,0.100284,0.103732,-0.900662,0.416303,-0.124302,-0.913175,0.382000,-0.141972,\n\t\t\t         -0.959471,-0.175695,0.220283,-0.862087,-0.350963,0.365490,-0.807703,-0.474654,0.349681,-0.841823,-0.500626,0.201636,\n\t\t\t         -0.858364,-0.509842,-0.056642,-0.836177,-0.522263,0.167302,-0.837581,-0.409497,0.361522,-0.891934,-0.393017,0.223518,\n\t\t\t         -0.834162,-0.366955,0.411695,-0.823634,-0.382244,0.418867,-0.807703,-0.474654,0.349681,-0.862087,-0.350963,0.365490,\n\t\t\t         -0.831446,-0.552660,0.056490,-0.823634,-0.382244,0.418867,-0.837581,-0.409497,0.361522,-0.836177,-0.522263,0.167302,\n\t\t\t         -0.693655,0.631367,-0.346690,-0.691763,0.626606,-0.358898,-0.917112,0.378430,-0.125034,-0.913175,0.382000,-0.141972,\n\t\t\t         -0.389080,-0.741417,0.546709,-0.438398,-0.699545,0.564257,-0.060915,-0.801874,0.594317,-0.051546,-0.816767,0.574633,\n\t\t\t         0.224616,-0.878903,0.420759,0.203528,-0.864834,0.458937,-0.168401,-0.774346,0.609912,-0.156102,-0.837764,0.523209,\n\t\t\t         -0.979064,0.132664,0.154210,-0.916837,0.257210,0.305307,-0.827387,0.545640,0.132969,-0.896329,0.443251,-0.010254,\n\t\t\t         0.252724,-0.925748,0.281167,-0.323099,-0.945647,-0.036439,-0.619953,-0.776055,0.115665,-0.043031,-0.857479,0.512680,\n\t\t\t         -0.980407,0.058260,0.188116,-0.989929,0.074923,0.119968,-0.895138,0.406964,-0.181921,-0.825434,0.553270,-0.111881,\n\t\t\t         0.055696,-0.886837,0.458632,0.085818,-0.907620,0.410871,-0.267983,-0.848964,0.455397,-0.273507,-0.821009,0.501083,\n\t\t\t         -0.963530,0.253029,0.087008,-0.969695,0.234230,0.069063,-0.878933,0.470595,-0.077151,-0.862117,0.504379,-0.048097,\n\t\t\t         0.136723,-0.881008,0.452834,-0.217353,-0.766656,0.604114,-0.168401,-0.774346,0.609912,0.203528,-0.864834,0.458937,\n\t\t\t         -0.911649,0.262185,0.316355,-0.822230,0.558061,0.111545,-0.827387,0.545640,0.132969,-0.916837,0.257210,0.305307,\n\t\t\t         -0.627796,0.738090,-0.247017,-0.701346,0.681845,-0.207801,-0.913724,0.406262,-0.005768,-0.873959,0.482955,-0.054079,\n\t\t\t         -0.617664,-0.635884,0.462691,-0.633839,-0.598132,0.490341,-0.297067,-0.787439,0.540056,-0.285318,-0.809473,0.513138,\n\t\t\t         -0.713340,-0.573992,0.402020,-0.841273,-0.499161,0.207495,-0.625019,-0.672048,0.397046,-0.399243,-0.770012,0.497604,\n\t\t\t         -0.736473,0.643880,-0.207282,-0.765191,0.614154,-0.193060,-0.945830,0.315073,0.078097,-0.966186,0.257576,0.010132,\n\t\t\t         -0.765191,0.614154,-0.193060,-0.967956,0.250557,-0.015503,-0.974639,0.086917,0.206122,-0.945830,0.315073,0.078097,\n\t\t\t         -0.841273,-0.499161,0.207495,-0.934812,-0.338481,-0.107456,-0.862178,-0.374004,0.341655,-0.625019,-0.672048,0.397046,\n\t\t\t         -0.701346,0.681845,-0.207801,-0.736473,0.643880,-0.207282,-0.966186,0.257576,0.010132,-0.913724,0.406262,-0.005768,\n\t\t\t         -0.633839,-0.598132,0.490341,-0.713340,-0.573992,0.402020,-0.399243,-0.770012,0.497604,-0.297067,-0.787439,0.540056,\n\t\t\t         -0.595935,0.755058,-0.273385,-0.627796,0.738090,-0.247017,-0.873959,0.482955,-0.054079,-0.847102,0.519303,-0.112674,\n\t\t\t         0.264840,-0.895718,0.357097,-0.133732,-0.810511,0.570208,-0.220069,-0.793023,0.568011,0.187109,-0.894009,0.407086,\n\t\t\t         -0.962554,0.117618,0.244240,-0.843471,0.536088,-0.033418,-0.838954,0.544023,0.012696,-0.942106,0.186987,0.278237,\n\t\t\t         -0.987365,0.154607,0.034455,-0.997711,0.063845,0.021851,-0.928709,0.335246,-0.158269,-0.909513,0.391797,-0.138676,\n\t\t\t         -0.969695,0.234230,0.069063,-0.987365,0.154607,0.034455,-0.909513,0.391797,-0.138676,-0.878933,0.470595,-0.077151,\n\t\t\t         0.155553,-0.918393,0.363750,0.190252,-0.908567,0.371838,-0.201483,-0.889401,0.410260,-0.246315,-0.881619,0.402539,\n\t\t\t         -0.601459,-0.664357,0.443648,-0.617664,-0.635884,0.462691,-0.285318,-0.809473,0.513138,-0.292032,-0.828333,0.478042,\n\t\t\t         0.187109,-0.894009,0.407086,-0.220069,-0.793023,0.568011,-0.217353,-0.766656,0.604114,0.136723,-0.881008,0.452834,\n\t\t\t         0.085818,-0.907620,0.410871,0.155553,-0.918393,0.363750,-0.246315,-0.881619,0.402539,-0.267983,-0.848964,0.455397,\n\t\t\t         -0.997711,0.063845,0.021851,-0.979064,0.132664,0.154210,-0.896329,0.443251,-0.010254,-0.928709,0.335246,-0.158269,\n\t\t\t         -0.942106,0.186987,0.278237,-0.838954,0.544023,0.012696,-0.822230,0.558061,0.111545,-0.911649,0.262185,0.316355,\n\t\t\t         0.190252,-0.908567,0.371838,0.224616,-0.878903,0.420759,-0.156102,-0.837764,0.523209,-0.201483,-0.889401,0.410260,\n\t\t\t         0.073611,-0.888943,0.451979,0.055696,-0.886837,0.458632,-0.273507,-0.821009,0.501083,-0.264321,-0.811121,0.521714,\n\t\t\t         -0.955290,0.263344,0.134342,-0.963530,0.253029,0.087008,-0.862117,0.504379,-0.048097,-0.847194,0.528581,-0.053194,\n\t\t\t         0.103549,-0.888821,0.446364,0.073611,-0.888943,0.451979,-0.264321,-0.811121,0.521714,-0.255715,-0.828455,0.498215,\n\t\t\t         -0.969512,0.210883,0.124546,-0.955290,0.263344,0.134342,-0.847194,0.528581,-0.053194,-0.835505,0.540483,-0.098758,\n\t\t\t         -0.967956,0.250557,-0.015503,-0.952849,-0.166356,0.253670,-0.881130,-0.291696,0.372143,-0.974639,0.086917,0.206122,\n\t\t\t         -0.934812,-0.338481,-0.107456,-0.957030,-0.271767,0.100925,-0.901425,-0.254524,0.350169,-0.862178,-0.374004,0.341655,\n\t\t\t         -0.875454,-0.324595,0.358043,-0.859188,-0.267983,0.435835,-0.881130,-0.291696,0.372143,-0.952849,-0.166356,0.253670,\n\t\t\t         -0.882962,-0.462142,-0.082369,-0.859188,-0.267983,0.435835,-0.901425,-0.254524,0.350169,-0.957030,-0.271767,0.100925,\n\t\t\t         -0.601947,0.750969,-0.271401,-0.595935,0.755058,-0.273385,-0.847102,0.519303,-0.112674,-0.835505,0.540483,-0.098758,\n\t\t\t         -0.578906,-0.643788,0.500351,-0.601459,-0.664357,0.443648,-0.292032,-0.828333,0.478042,-0.255715,-0.828455,0.498215,\n\t\t\t         0.007202,-0.979430,0.201544,0.032197,-0.966216,0.255684,-0.483840,-0.799676,0.355510,-0.499863,-0.835505,0.228156,\n\t\t\t         -0.971038,0.235511,-0.039796,-0.947722,0.296274,0.118442,-0.780572,0.613758,-0.118168,-0.799982,0.562395,-0.208960,\n\t\t\t         -0.232215,-0.957671,0.169958,-0.665395,-0.695212,-0.271828,-0.953307,-0.301981,-0.000031,-0.584948,-0.770623,0.252815,\n\t\t\t         -0.930906,0.330363,0.155675,-0.905240,0.392743,0.162023,-0.751518,0.659597,0.009857,-0.761650,0.647664,-0.018769,\n\t\t\t         -0.044069,-0.955657,0.291147,-0.040468,-0.942656,0.331217,-0.420972,-0.831751,0.361797,-0.422163,-0.831477,0.361095,\n\t\t\t         -0.957701,0.272866,0.091281,-0.957213,0.287179,0.034974,-0.787317,0.610797,-0.083651,-0.797418,0.603198,-0.014008,\n\t\t\t         0.023286,-0.936216,0.350627,-0.459975,-0.744682,0.483535,-0.483840,-0.799676,0.355510,0.032197,-0.966216,0.255684,\n\t\t\t         -0.885556,0.381878,0.264412,-0.727470,0.685385,0.031465,-0.780572,0.613758,-0.118168,-0.947722,0.296274,0.118442,\n\t\t\t         -0.554491,0.793420,-0.250893,-0.677755,0.676901,-0.287118,-0.891293,0.425764,-0.155828,-0.854732,0.505142,-0.119236,\n\t\t\t         -0.766656,-0.579089,0.277230,-0.769951,-0.621418,0.144932,-0.383831,-0.883328,0.269021,-0.366802,-0.857906,0.359722,\n\t\t\t         -0.812433,-0.572344,0.110965,-0.846553,-0.461501,0.265206,-0.532395,-0.727287,0.433119,-0.470717,-0.817530,0.331645,\n\t\t\t         -0.784936,0.571245,-0.239875,-0.802271,0.576983,-0.153020,-0.923460,0.381726,0.038728,-0.965606,0.239601,-0.100803,\n\t\t\t         -0.802271,0.576983,-0.153020,-0.963286,0.268349,0.001434,-0.984832,0.107212,0.136265,-0.923460,0.381726,0.038728,\n\t\t\t         -0.846553,-0.461501,0.265206,-0.911954,-0.392468,0.119480,-0.800409,-0.546525,0.246132,-0.532395,-0.727287,0.433119,\n\t\t\t         -0.677755,0.676901,-0.287118,-0.784936,0.571245,-0.239875,-0.965606,0.239601,-0.100803,-0.891293,0.425764,-0.155828,\n\t\t\t         -0.769951,-0.621418,0.144932,-0.812433,-0.572344,0.110965,-0.470717,-0.817530,0.331645,-0.383831,-0.883328,0.269021,\n\t\t\t         -0.579455,0.783135,-0.225623,-0.554491,0.793420,-0.250893,-0.854732,0.505142,-0.119236,-0.848659,0.517106,-0.110996,\n\t\t\t         -0.133549,-0.977508,0.163152,-0.552446,-0.777886,0.299387,-0.480209,-0.761193,0.435835,-0.010498,-0.955870,0.293558,\n\t\t\t         -0.938963,0.309153,0.150761,-0.765374,0.641469,-0.051698,-0.703879,0.710257,0.006592,-0.897977,0.386914,0.209510,\n\t\t\t         -0.950285,0.311258,-0.008057,-0.968474,0.243721,-0.051363,-0.785974,0.589648,-0.185705,-0.780267,0.611896,-0.129185,\n\t\t\t         -0.957213,0.287179,0.034974,-0.950285,0.311258,-0.008057,-0.780267,0.611896,-0.129185,-0.787317,0.610797,-0.083651,\n\t\t\t         -0.050050,-0.960143,0.274972,-0.021546,-0.978729,0.203986,-0.469680,-0.849696,0.239570,-0.436811,-0.845729,0.306406,\n\t\t\t         -0.745384,-0.606128,0.277474,-0.766656,-0.579089,0.277230,-0.366802,-0.857906,0.359722,-0.407910,-0.841914,0.353160,\n\t\t\t         -0.010498,-0.955870,0.293558,-0.480209,-0.761193,0.435835,-0.459975,-0.744682,0.483535,0.023286,-0.936216,0.350627,\n\t\t\t         -0.040468,-0.942656,0.331217,-0.050050,-0.960143,0.274972,-0.436811,-0.845729,0.306406,-0.420972,-0.831751,0.361797,\n\t\t\t         -0.968474,0.243721,-0.051363,-0.971038,0.235511,-0.039796,-0.799982,0.562395,-0.208960,-0.785974,0.589648,-0.185705,\n\t\t\t         -0.897977,0.386914,0.209510,-0.703879,0.710257,0.006592,-0.727470,0.685385,0.031465,-0.885556,0.381878,0.264412,\n\t\t\t         -0.021546,-0.978729,0.203986,0.007202,-0.979430,0.201544,-0.499863,-0.835505,0.228156,-0.469680,-0.849696,0.239570,\n\t\t\t         -0.021088,-0.954863,0.296213,-0.044069,-0.955657,0.291147,-0.422163,-0.831477,0.361095,-0.412976,-0.832636,0.368938,\n\t\t\t         -0.955565,0.259774,0.139073,-0.957701,0.272866,0.091281,-0.797418,0.603198,-0.014008,-0.799493,0.600604,-0.004700,\n\t\t\t         -0.011353,-0.947508,0.319468,-0.021088,-0.954863,0.296213,-0.412976,-0.832636,0.368938,-0.400067,-0.844508,0.355937,\n\t\t\t         -0.973113,0.219977,0.067873,-0.955565,0.259774,0.139073,-0.799493,0.600604,-0.004700,-0.836390,0.544694,-0.060854,\n\t\t\t         -0.963286,0.268349,0.001434,-0.977599,-0.123295,0.170446,-0.957060,-0.222510,0.185675,-0.984832,0.107212,0.136265,\n\t\t\t         -0.911954,-0.392468,0.119480,-0.937956,-0.343577,-0.046205,-0.971862,-0.221625,0.079470,-0.800409,-0.546525,0.246132,\n\t\t\t         -0.934904,-0.223975,0.275216,-0.948790,-0.245766,0.198401,-0.957060,-0.222510,0.185675,-0.977599,-0.123295,0.170446,\n\t\t\t         -0.959563,-0.281472,-0.003265,-0.948790,-0.245766,0.198401,-0.971862,-0.221625,0.079470,-0.937956,-0.343577,-0.046205,\n\t\t\t         -0.575182,0.795892,-0.188910,-0.579455,0.783135,-0.225623,-0.848659,0.517106,-0.110996,-0.836390,0.544694,-0.060854,\n\t\t\t         -0.720573,-0.610431,0.328806,-0.745384,-0.606128,0.277474,-0.407910,-0.841914,0.353160,-0.400067,-0.844508,0.355937,\n\t\t\t         0.991241,0.121982,-0.050050,0.921812,-0.278756,0.269265,0.941527,-0.289407,0.172369,0.979553,0.058351,-0.192419,\n\t\t\t         0.962249,-0.121220,-0.243660,0.904935,-0.360118,0.226630,0.914609,-0.303720,0.266823,0.987640,-0.002594,-0.156499,\n\t\t\t         0.963469,0.033723,-0.265664,0.960936,-0.256600,0.103519,0.933714,-0.335948,0.123692,0.963286,-0.033509,-0.266335,\n\t\t\t         0.827754,-0.466781,-0.311319,0.981567,-0.092959,-0.166875,0.920652,-0.346538,0.179693,0.844234,-0.522385,0.119755,\n\t\t\t         -0.120029,-0.978820,-0.165746,0.424879,-0.788965,-0.443800,0.598529,-0.800958,0.013153,0.030457,-0.992370,0.119327,\n\t\t\t         0.424879,-0.788965,-0.443800,0.827754,-0.466781,-0.311319,0.844234,-0.522385,0.119755,0.598529,-0.800958,0.013153,\n\t\t\t         0.981567,-0.092959,-0.166875,0.987091,0.063753,-0.146733,0.953856,-0.249336,0.167211,0.920652,-0.346538,0.179693,\n\t\t\t         0.963286,-0.033509,-0.266335,0.933714,-0.335948,0.123692,0.911496,-0.368999,0.181555,0.968322,-0.112094,-0.223029,\n\t\t\t         0.971892,0.193274,-0.134251,0.973174,0.214606,-0.082736,0.969481,-0.131016,0.207068,0.972015,-0.139592,0.188788,\n\t\t\t         0.989349,0.144292,-0.018525,0.916807,-0.260201,0.302835,0.911039,-0.281625,0.301065,0.985717,0.168279,-0.004578,\n\t\t\t         0.984130,0.065493,-0.164739,0.959746,-0.228217,0.163579,0.969481,-0.131016,0.207068,0.973174,0.214606,-0.082736,\n\t\t\t         0.985717,0.168279,-0.004578,0.911039,-0.281625,0.301065,0.921812,-0.278756,0.269265,0.991241,0.121982,-0.050050,\n\t\t\t         0.968322,-0.112094,-0.223029,0.911496,-0.368999,0.181555,0.904935,-0.360118,0.226630,0.962249,-0.121220,-0.243660,\n\t\t\t         0.987640,-0.002594,-0.156499,0.914609,-0.303720,0.266823,0.916807,-0.260201,0.302835,0.989349,0.144292,-0.018525,\n\t\t\t         0.979553,0.058351,-0.192419,0.941527,-0.289407,0.172369,0.937223,-0.318857,0.141179,0.959380,-0.016633,-0.281503,\n\t\t\t         0.959380,-0.016633,-0.281503,0.937223,-0.318857,0.141179,0.959746,-0.228217,0.163579,0.984130,0.065493,-0.164739,\n\t\t\t         -0.367534,0.591784,-0.717399,-0.030335,0.592761,-0.804773,0.061037,0.597797,-0.799310,-0.319407,0.633076,-0.705100,\n\t\t\t         -0.289682,0.074679,-0.954192,0.093295,0.055269,-0.994079,-0.002228,0.474807,-0.880062,-0.377422,0.445265,-0.811945,\n\t\t\t         -0.377422,0.445265,-0.811945,-0.002228,0.474807,-0.880062,-0.030335,0.592761,-0.804773,-0.367534,0.591784,-0.717399,\n\t\t\t         -0.294565,0.580889,-0.758782,0.138524,0.570482,-0.809503,0.141453,0.700888,-0.699088,-0.282174,0.639546,-0.715049,\n\t\t\t         -0.911893,0.131504,-0.388745,-0.601245,0.494491,-0.627613,-0.313150,0.423536,-0.850002,-0.611225,-0.039399,-0.790429,\n\t\t\t         -0.258156,0.599841,-0.757286,0.135594,0.551836,-0.822840,0.191626,0.641407,-0.742851,-0.227790,0.618793,-0.751793,\n\t\t\t         -0.358684,0.573809,-0.736229,0.026063,0.641255,-0.766869,0.085269,0.537645,-0.838832,-0.338328,0.580035,-0.740989,\n\t\t\t         -0.400372,0.616230,-0.678152,-0.316080,0.670858,-0.670827,0.080660,0.682028,-0.726829,-0.063570,0.624165,-0.778680,\n\t\t\t         -0.274575,0.628498,-0.727683,0.072512,0.702567,-0.707877,0.026063,0.641255,-0.766869,-0.358684,0.573809,-0.736229,\n\t\t\t         -0.319407,0.633076,-0.705100,0.061037,0.597797,-0.799310,0.135594,0.551836,-0.822840,-0.258156,0.599841,-0.757286,\n\t\t\t         -0.206183,0.657491,-0.724662,0.159948,0.723258,-0.671743,0.072512,0.702567,-0.707877,-0.274575,0.628498,-0.727683,\n\t\t\t         -0.601245,0.494491,-0.627613,-0.400372,0.616230,-0.678152,-0.063570,0.624165,-0.778680,-0.313150,0.423536,-0.850002,\n\t\t\t         -0.870968,-0.486129,0.071200,-0.911893,0.131504,-0.388745,-0.611225,-0.039399,-0.790429,-0.847499,-0.434278,-0.305155,\n\t\t\t         -0.338328,0.580035,-0.740989,0.085269,0.537645,-0.838832,0.138524,0.570482,-0.809503,-0.294565,0.580889,-0.758782,\n\t\t\t         -0.295969,0.705924,-0.643452,-0.282174,0.639546,-0.715049,0.141453,0.700888,-0.699088,0.132847,0.734397,-0.665548,\n\t\t\t         -0.227790,0.618793,-0.751793,0.191626,0.641407,-0.742851,0.159948,0.723258,-0.671743,-0.206183,0.657491,-0.724662,\n\t\t\t         -0.619129,-0.636189,-0.460311,-0.806146,-0.582629,0.103153,-0.804712,-0.585284,0.099277,-0.847499,-0.434278,-0.305155,\n\t\t\t         -0.538682,-0.808893,0.235572,-0.120029,-0.978820,-0.165746,0.030457,-0.992370,0.119327,-0.530656,-0.773675,0.346080,\n\t\t\t         -0.806146,-0.582629,0.103153,-0.632832,-0.760918,0.143071,-0.693075,-0.635395,0.340403,-0.804712,-0.585284,0.099277,\n\t\t\t         -0.538682,-0.808893,0.235572,-0.530656,-0.773675,0.346080,-0.693075,-0.635395,0.340403,-0.632832,-0.760918,0.143071,\n\t\t\t         0.987091,0.063753,-0.146733,0.971892,0.193274,-0.134251,0.972015,-0.139592,0.188788,0.953856,-0.249336,0.167211,\n\t\t\t         -0.316080,0.670858,-0.670827,-0.295969,0.705924,-0.643452,0.132847,0.734397,-0.665548,0.080660,0.682028,-0.726829,\n\t\t\t         0.980010,-0.089908,-0.177313,0.886502,-0.449171,0.110904,0.896420,-0.443129,-0.003265,0.946074,-0.107517,-0.305490,\n\t\t\t         0.917661,-0.287362,-0.274361,0.852260,-0.522843,0.016663,0.893429,-0.433821,0.116337,0.979247,-0.157537,-0.127323,\n\t\t\t         0.795282,-0.301401,-0.525956,0.780023,-0.576006,-0.244392,0.879238,-0.471206,-0.069735,0.907132,-0.249245,-0.339000,\n\t\t\t         0.570574,-0.652974,-0.498032,0.917722,-0.272317,-0.289071,0.822901,-0.552995,0.130253,0.589221,-0.807703,0.020142,\n\t\t\t         -0.616138,-0.778893,-0.116947,-0.067721,-0.890316,-0.450209,0.067385,-0.996704,-0.044832,-0.509690,-0.835932,0.203375,\n\t\t\t         -0.067721,-0.890316,-0.450209,0.570574,-0.652974,-0.498032,0.589221,-0.807703,0.020142,0.067385,-0.996704,-0.044832,\n\t\t\t         0.917722,-0.272317,-0.289071,0.974761,-0.173132,-0.140812,0.813685,-0.547472,0.195379,0.822901,-0.552995,0.130253,\n\t\t\t         0.907132,-0.249245,-0.339000,0.879238,-0.471206,-0.069735,0.876186,-0.481948,0.001282,0.929411,-0.245949,-0.275063,\n\t\t\t         0.986084,-0.129154,-0.104434,0.998413,-0.053896,-0.014801,0.854183,-0.457320,0.247353,0.823115,-0.525071,0.216193,\n\t\t\t         0.996368,-0.065859,0.053896,0.886715,-0.391247,0.246193,0.875240,-0.434462,0.212470,0.997101,-0.066286,-0.037172,\n\t\t\t         0.999542,0.022248,0.020356,0.878842,-0.419141,0.227821,0.854183,-0.457320,0.247353,0.998413,-0.053896,-0.014801,\n\t\t\t         0.997101,-0.066286,-0.037172,0.875240,-0.434462,0.212470,0.886502,-0.449171,0.110904,0.980010,-0.089908,-0.177313,\n\t\t\t         0.929411,-0.245949,-0.275063,0.876186,-0.481948,0.001282,0.852260,-0.522843,0.016663,0.917661,-0.287362,-0.274361,\n\t\t\t         0.979247,-0.157537,-0.127323,0.893429,-0.433821,0.116337,0.886715,-0.391247,0.246193,0.996368,-0.065859,0.053896,\n\t\t\t         0.946074,-0.107517,-0.305490,0.896420,-0.443129,-0.003265,0.879238,-0.466109,0.098086,0.983551,-0.089694,-0.156652,\n\t\t\t         0.983551,-0.089694,-0.156652,0.879238,-0.466109,0.098086,0.878842,-0.419141,0.227821,0.999542,0.022248,0.020356,\n\t\t\t         -0.381146,0.780847,-0.494919,0.094302,0.717154,-0.690481,0.098514,0.683340,-0.723411,-0.372814,0.766137,-0.523453,\n\t\t\t         -0.380749,0.727470,-0.570757,-0.058596,0.617603,-0.784295,0.070101,0.736686,-0.672536,-0.364177,0.794733,-0.485488,\n\t\t\t         -0.364177,0.794733,-0.485488,0.070101,0.736686,-0.672536,0.094302,0.717154,-0.690481,-0.381146,0.780847,-0.494919,\n\t\t\t         -0.290780,0.765130,-0.574419,0.244057,0.772759,-0.585864,0.185247,0.795984,-0.576250,-0.281381,0.793664,-0.539323,\n\t\t\t         -0.882290,0.340403,-0.325022,-0.644368,0.602619,-0.470748,-0.337596,0.541948,-0.769585,-0.760613,0.235298,-0.605029,\n\t\t\t         -0.360912,0.759850,-0.540696,0.136509,0.742149,-0.656148,0.166356,0.790826,-0.588977,-0.379894,0.731498,-0.566179,\n\t\t\t         -0.378399,0.735435,-0.562059,0.213294,0.659322,-0.720939,0.216102,0.665944,-0.713981,-0.346446,0.722068,-0.598804,\n\t\t\t         -0.409497,0.729118,-0.548326,-0.332194,0.752312,-0.568865,0.042512,0.750175,-0.659841,-0.033876,0.710929,-0.702445,\n\t\t\t         -0.405774,0.732109,-0.547075,0.167455,0.757927,-0.630451,0.213294,0.659322,-0.720939,-0.378399,0.735435,-0.562059,\n\t\t\t         -0.372814,0.766137,-0.523453,0.098514,0.683340,-0.723411,0.136509,0.742149,-0.656148,-0.360912,0.759850,-0.540696,\n\t\t\t         -0.427473,0.705557,-0.565172,0.123051,0.793573,-0.595874,0.167455,0.757927,-0.630451,-0.405774,0.732109,-0.547075,\n\t\t\t         -0.644368,0.602619,-0.470748,-0.409497,0.729118,-0.548326,-0.033876,0.710929,-0.702445,-0.337596,0.541948,-0.769585,\n\t\t\t         -0.987579,-0.137852,0.075045,-0.882290,0.340403,-0.325022,-0.760613,0.235298,-0.605029,-0.975921,-0.196081,-0.095401,\n\t\t\t         -0.346446,0.722068,-0.598804,0.216102,0.665944,-0.713981,0.244057,0.772759,-0.585864,-0.290780,0.765130,-0.574419,\n\t\t\t         -0.312906,0.763115,-0.565416,-0.281381,0.793664,-0.539323,0.185247,0.795984,-0.576250,0.120457,0.757927,-0.641072,\n\t\t\t         -0.379894,0.731498,-0.566179,0.166356,0.790826,-0.588977,0.123051,0.793573,-0.595874,-0.427473,0.705557,-0.565172,\n\t\t\t         -0.914609,-0.314432,-0.254158,-0.943022,-0.303232,0.136692,-0.914365,-0.326212,0.239814,-0.975921,-0.196081,-0.095401,\n\t\t\t         -0.790124,-0.581927,0.192389,-0.616138,-0.778893,-0.116947,-0.509690,-0.835932,0.203375,-0.816279,-0.474654,0.329112,\n\t\t\t         -0.943022,-0.303232,0.136692,-0.878079,-0.456984,0.141667,-0.887295,-0.387494,0.250008,-0.914365,-0.326212,0.239814,\n\t\t\t         -0.790124,-0.581927,0.192389,-0.816279,-0.474654,0.329112,-0.887295,-0.387494,0.250008,-0.878079,-0.456984,0.141667,\n\t\t\t         0.974761,-0.173132,-0.140812,0.986084,-0.129154,-0.104434,0.823115,-0.525071,0.216193,0.813685,-0.547472,0.195379,\n\t\t\t         -0.332194,0.752312,-0.568865,-0.312906,0.763115,-0.565416,0.120457,0.757927,-0.641072,0.042512,0.750175,-0.659841,\n\t\t\t         0.982757,-0.159703,-0.092868,0.863979,-0.495743,0.087863,0.847407,-0.528703,0.048494,0.968566,-0.142186,-0.203955,\n\t\t\t         0.859645,-0.348979,-0.373089,0.770623,-0.632801,-0.075106,0.793390,-0.604236,-0.073580,0.852290,-0.362926,-0.376598,\n\t\t\t         0.802484,-0.389264,-0.452132,0.703848,-0.647023,-0.293039,0.714408,-0.667196,-0.210730,0.815302,-0.371746,-0.443922,\n\t\t\t         0.694693,-0.411389,-0.590014,0.903348,-0.235755,-0.358287,0.808924,-0.584033,-0.067202,0.675008,-0.697562,-0.240211,\n\t\t\t         -0.464278,-0.727622,-0.504929,0.286294,-0.606250,-0.741935,0.296823,-0.872280,-0.388562,-0.458205,-0.848750,-0.263833,\n\t\t\t         0.286294,-0.606250,-0.741935,0.694693,-0.411389,-0.590014,0.675008,-0.697562,-0.240211,0.296823,-0.872280,-0.388562,\n\t\t\t         0.903348,-0.235755,-0.358287,0.964721,-0.116703,-0.235939,0.842860,-0.537858,0.014954,0.808924,-0.584033,-0.067202,\n\t\t\t         0.815302,-0.371746,-0.443922,0.714408,-0.667196,-0.210730,0.747948,-0.651723,-0.125614,0.853542,-0.339457,-0.395184,\n\t\t\t         0.992737,-0.020295,-0.118473,0.989746,-0.008423,-0.142521,0.912442,-0.400281,0.084597,0.887997,-0.452773,0.080050,\n\t\t\t         0.917142,-0.308817,-0.251839,0.833399,-0.552568,-0.007935,0.870205,-0.482986,0.096927,0.981201,-0.176519,-0.077548,\n\t\t\t         0.946776,-0.106418,-0.303720,0.880459,-0.473891,-0.013611,0.912442,-0.400281,0.084597,0.989746,-0.008423,-0.142521,\n\t\t\t         0.981201,-0.176519,-0.077548,0.870205,-0.482986,0.096927,0.863979,-0.495743,0.087863,0.982757,-0.159703,-0.092868,\n\t\t\t         0.853542,-0.339457,-0.395184,0.747948,-0.651723,-0.125614,0.770623,-0.632801,-0.075106,0.859645,-0.348979,-0.373089,\n\t\t\t         0.852290,-0.362926,-0.376598,0.793390,-0.604236,-0.073580,0.833399,-0.552568,-0.007935,0.917142,-0.308817,-0.251839,\n\t\t\t         0.968566,-0.142186,-0.203955,0.847407,-0.528703,0.048494,0.842616,-0.538469,-0.001740,0.940672,-0.114536,-0.319346,\n\t\t\t         0.940672,-0.114536,-0.319346,0.842616,-0.538469,-0.001740,0.880459,-0.473891,-0.013611,0.946776,-0.106418,-0.303720,\n\t\t\t         -0.403088,0.839991,-0.363140,0.004334,0.830287,-0.557268,0.017304,0.855251,-0.517869,-0.406598,0.875088,-0.262459,\n\t\t\t         -0.367901,0.752159,-0.546678,-0.057955,0.647572,-0.759758,0.022309,0.778405,-0.627308,-0.351115,0.822504,-0.447371,\n\t\t\t         -0.351115,0.822504,-0.447371,0.022309,0.778405,-0.627308,0.004334,0.830287,-0.557268,-0.403088,0.839991,-0.363140,\n\t\t\t         -0.303568,0.827052,-0.473067,0.143437,0.786584,-0.600543,0.211524,0.838984,-0.501328,-0.212134,0.871181,-0.442732,\n\t\t\t         -0.623371,0.596728,-0.505234,-0.404492,0.771874,-0.490463,-0.010193,0.629688,-0.776757,-0.462386,0.388653,-0.796930,\n\t\t\t         -0.397656,0.880306,-0.258614,0.020051,0.872036,-0.488998,0.120579,0.827418,-0.548448,-0.380566,0.842433,-0.381329,\n\t\t\t         -0.378826,0.824824,-0.419660,0.077486,0.836390,-0.542589,0.043489,0.820093,-0.570544,-0.374187,0.823908,-0.425581,\n\t\t\t         -0.311747,0.840815,-0.442518,-0.284982,0.856594,-0.430097,0.126560,0.826868,-0.547929,0.099612,0.780328,-0.617359,\n\t\t\t         -0.381481,0.818384,-0.429701,0.123417,0.842463,-0.524369,0.077486,0.836390,-0.542589,-0.378826,0.824824,-0.419660,\n\t\t\t         -0.406598,0.875088,-0.262459,0.017304,0.855251,-0.517869,0.020051,0.872036,-0.488998,-0.397656,0.880306,-0.258614,\n\t\t\t         -0.361095,0.830927,-0.423231,0.155065,0.824702,-0.543870,0.123417,0.842463,-0.524369,-0.381481,0.818384,-0.429701,\n\t\t\t         -0.404492,0.771874,-0.490463,-0.311747,0.840815,-0.442518,0.099612,0.780328,-0.617359,-0.010193,0.629688,-0.776757,\n\t\t\t         -0.972167,0.170843,-0.160283,-0.623371,0.596728,-0.505234,-0.462386,0.388653,-0.796930,-0.889126,-0.095187,-0.447645,\n\t\t\t         -0.374187,0.823908,-0.425581,0.043489,0.820093,-0.570544,0.143437,0.786584,-0.600543,-0.303568,0.827052,-0.473067,\n\t\t\t         -0.237739,0.877438,-0.416578,-0.212134,0.871181,-0.442732,0.211524,0.838984,-0.501328,0.161473,0.862758,-0.479080,\n\t\t\t         -0.380566,0.842433,-0.381329,0.120579,0.827418,-0.548448,0.155065,0.824702,-0.543870,-0.361095,0.830927,-0.423231,\n\t\t\t         -0.684500,-0.407300,-0.604572,-0.853206,-0.520280,-0.036012,-0.924009,-0.381390,0.026460,-0.889126,-0.095187,-0.447645,\n\t\t\t         -0.824244,-0.565905,-0.017304,-0.464278,-0.727622,-0.504929,-0.458205,-0.848750,-0.263833,-0.835475,-0.546892,0.053194,\n\t\t\t         -0.853206,-0.520280,-0.036012,-0.834620,-0.547655,-0.058351,-0.850581,-0.524735,-0.032960,-0.924009,-0.381390,0.026460,\n\t\t\t         -0.824244,-0.565905,-0.017304,-0.835475,-0.546892,0.053194,-0.850581,-0.524735,-0.032960,-0.834620,-0.547655,-0.058351,\n\t\t\t         0.964721,-0.116703,-0.235939,0.992737,-0.020295,-0.118473,0.887997,-0.452773,0.080050,0.842860,-0.537858,0.014954,\n\t\t\t         -0.284982,0.856594,-0.430097,-0.237739,0.877438,-0.416578,0.161473,0.862758,-0.479080,0.126560,0.826868,-0.547929,\n\t\t\t         0.972076,-0.092410,-0.215552,0.838496,-0.544816,-0.007080,0.829127,-0.555223,-0.065279,0.955077,-0.123478,-0.269326,\n\t\t\t         0.959838,-0.179754,-0.215308,0.863002,-0.496811,-0.091342,0.875240,-0.483444,0.013703,0.980804,-0.131138,-0.144292,\n\t\t\t         0.848903,-0.364544,-0.382641,0.707633,-0.641987,-0.295053,0.848140,-0.502243,-0.168340,0.914609,-0.241615,-0.324137,\n\t\t\t         0.509445,-0.664357,-0.546831,0.876553,-0.373028,-0.304117,0.693167,-0.720725,-0.006226,0.447035,-0.888821,-0.100558,\n\t\t\t         -0.439619,-0.800501,-0.407300,-0.022675,-0.801508,-0.597491,0.109500,-0.971892,-0.208258,-0.291726,-0.941191,-0.170324,\n\t\t\t         -0.022675,-0.801508,-0.597491,0.509445,-0.664357,-0.546831,0.447035,-0.888821,-0.100558,0.109500,-0.971892,-0.208258,\n\t\t\t         0.876553,-0.373028,-0.304117,0.961486,-0.227302,-0.154424,0.774407,-0.632130,0.026307,0.693167,-0.720725,-0.006226,\n\t\t\t         0.914609,-0.241615,-0.324137,0.848140,-0.502243,-0.168340,0.848476,-0.478378,-0.226264,0.921476,-0.204718,-0.330058,\n\t\t\t         0.984191,-0.170324,-0.048128,0.991394,-0.125065,0.038148,0.817286,-0.546892,0.181341,0.805963,-0.581133,0.112461,\n\t\t\t         0.970855,-0.159703,-0.178625,0.839778,-0.542894,0.000061,0.837031,-0.546800,-0.018677,0.966216,-0.144841,-0.213111,\n\t\t\t         0.993439,-0.101108,-0.052980,0.854366,-0.517441,0.048006,0.817286,-0.546892,0.181341,0.991394,-0.125065,0.038148,\n\t\t\t         0.966216,-0.144841,-0.213111,0.837031,-0.546800,-0.018677,0.838496,-0.544816,-0.007080,0.972076,-0.092410,-0.215552,\n\t\t\t         0.921476,-0.204718,-0.330058,0.848476,-0.478378,-0.226264,0.863002,-0.496811,-0.091342,0.959838,-0.179754,-0.215308,\n\t\t\t         0.980804,-0.131138,-0.144292,0.875240,-0.483444,0.013703,0.839778,-0.542894,0.000061,0.970855,-0.159703,-0.178625,\n\t\t\t         0.955077,-0.123478,-0.269326,0.829127,-0.555223,-0.065279,0.827693,-0.552202,-0.099673,0.961577,-0.122044,-0.245766,\n\t\t\t         0.961577,-0.122044,-0.245766,0.827693,-0.552202,-0.099673,0.854366,-0.517441,0.048006,0.993439,-0.101108,-0.052980,\n\t\t\t         -0.123447,0.930021,-0.346049,0.490646,0.706442,-0.510025,0.425092,0.749992,-0.506729,-0.111148,0.920499,-0.374523,\n\t\t\t         -0.118992,0.877163,-0.465194,0.423963,0.660237,-0.619922,0.470290,0.713675,-0.519089,-0.101718,0.907498,-0.407514,\n\t\t\t         -0.101718,0.907498,-0.407514,0.470290,0.713675,-0.519089,0.490646,0.706442,-0.510025,-0.123447,0.930021,-0.346049,\n\t\t\t         -0.161473,0.946593,-0.279000,0.316538,0.884823,-0.341807,0.271706,0.905545,-0.325724,-0.176305,0.938231,-0.297647,\n\t\t\t         -0.617664,0.626270,-0.475631,-0.391369,0.751823,-0.530595,-0.176794,0.704794,-0.687002,-0.508774,0.511734,-0.692282,\n\t\t\t         -0.107700,0.905454,-0.410474,0.428663,0.764244,-0.481826,0.387341,0.783441,-0.485946,-0.144536,0.901028,-0.408918,\n\t\t\t         -0.157414,0.941679,-0.297342,0.333842,0.849849,-0.407758,0.328837,0.857204,-0.396283,-0.177923,0.946471,-0.269234,\n\t\t\t         -0.238594,0.837489,-0.491592,-0.177252,0.896207,-0.406598,0.173620,0.854060,-0.490280,0.100223,0.807062,-0.581835,\n\t\t\t         -0.127110,0.921903,-0.365886,0.353771,0.831935,-0.427412,0.333842,0.849849,-0.407758,-0.157414,0.941679,-0.297342,\n\t\t\t         -0.111148,0.920499,-0.374523,0.425092,0.749992,-0.506729,0.428663,0.764244,-0.481826,-0.107700,0.905454,-0.410474,\n\t\t\t         -0.146916,0.901120,-0.407819,0.363720,0.800317,-0.476577,0.353771,0.831935,-0.427412,-0.127110,0.921903,-0.365886,\n\t\t\t         -0.391369,0.751823,-0.530595,-0.238594,0.837489,-0.491592,0.100223,0.807062,-0.581835,-0.176794,0.704794,-0.687002,\n\t\t\t         -0.901883,0.363109,-0.233833,-0.617664,0.626270,-0.475631,-0.508774,0.511734,-0.692282,-0.840297,0.319498,-0.437941,\n\t\t\t         -0.177923,0.946471,-0.269234,0.328837,0.857204,-0.396283,0.316538,0.884823,-0.341807,-0.161473,0.946593,-0.279000,\n\t\t\t         -0.209510,0.916135,-0.341716,-0.176305,0.938231,-0.297647,0.271706,0.905545,-0.325724,0.208960,0.895779,-0.392254,\n\t\t\t         -0.144536,0.901028,-0.408918,0.387341,0.783441,-0.485946,0.363720,0.800317,-0.476577,-0.146916,0.901120,-0.407819,\n\t\t\t         -0.788446,0.012726,-0.614948,-0.987213,-0.084872,-0.134861,-0.997253,0.069887,0.023255,-0.840297,0.319498,-0.437941,\n\t\t\t         -0.784143,-0.620167,-0.020936,-0.439619,-0.800501,-0.407300,-0.291726,-0.941191,-0.170324,-0.764031,-0.632801,0.125645,\n\t\t\t         -0.987213,-0.084872,-0.134861,-0.920530,-0.376293,-0.104801,-0.944334,-0.193243,0.266213,-0.997253,0.069887,0.023255,\n\t\t\t         -0.784143,-0.620167,-0.020936,-0.764031,-0.632801,0.125645,-0.944334,-0.193243,0.266213,-0.920530,-0.376293,-0.104801,\n\t\t\t         0.961486,-0.227302,-0.154424,0.984191,-0.170324,-0.048128,0.805963,-0.581133,0.112461,0.774407,-0.632130,0.026307,\n\t\t\t         -0.177252,0.896207,-0.406598,-0.209510,0.916135,-0.341716,0.208960,0.895779,-0.392254,0.173620,0.854060,-0.490280,\n\t\t\t         -0.776330,-0.467391,0.422864,-0.746239,-0.418775,0.517411,-0.957244,0.131077,0.257790,-0.989929,0.074923,0.119968,\n\t\t\t         0.267373,0.144932,-0.952605,0.550432,0.141179,-0.822810,0.681600,0.162328,-0.713462,0.602283,0.058321,-0.796136,\n\t\t\t         -0.893735,0.087710,0.439894,-0.945952,-0.003754,0.324259,-0.865444,-0.348033,0.360302,-0.857082,-0.212500,0.469253,\n\t\t\t         0.561052,0.383831,-0.733390,0.469893,0.577624,-0.667440,-0.006348,0.850093,-0.526536,0.072451,0.829951,-0.553087,\n\t\t\t         -0.017243,-0.653066,0.757073,-0.005829,-0.647175,0.762291,-0.386639,-0.594989,0.704581,-0.453627,-0.571764,0.683554,\n\t\t\t         0.914762,-0.253639,-0.314371,0.986053,-0.166295,-0.003174,0.937498,0.042024,-0.345347,0.897366,-0.089084,-0.432173,\n\t\t\t         -0.945952,-0.003754,0.324259,-0.893735,0.087710,0.439894,-0.840297,0.486068,0.240028,-0.905240,0.392743,0.162023,\n\t\t\t         -0.731651,0.681234,0.023835,-0.751518,0.659597,0.009857,-0.905240,0.392743,0.162023,-0.840297,0.486068,0.240028,\n\t\t\t         0.772698,0.139958,-0.619098,0.750664,0.068422,-0.657125,0.623707,-0.119907,-0.772393,0.795190,-0.159246,-0.585040,\n\t\t\t         0.469893,0.577624,-0.667440,0.561052,0.383831,-0.733390,0.750664,0.068422,-0.657125,0.772698,0.139958,-0.619098,\n\t\t\t         0.292398,0.134861,-0.946715,0.440992,0.066042,-0.895047,0.588885,-0.007263,-0.808161,0.614673,-0.059755,-0.786462,\n\t\t\t         -0.005829,-0.647175,0.762291,-0.017243,-0.653066,0.757073,0.368999,-0.627003,0.686056,0.355754,-0.637196,0.683645,\n\t\t\t         0.784082,-0.069826,-0.616688,0.706565,-0.281320,-0.649281,0.602283,0.058321,-0.796136,0.681600,0.162328,-0.713462,\n\t\t\t         -0.772485,-0.448744,0.449263,-0.744530,-0.489181,0.454268,-0.292673,-0.785485,0.545244,-0.373028,-0.743645,0.554796,\n\t\t\t         0.897366,-0.089084,-0.432173,0.937498,0.042024,-0.345347,0.727836,0.017823,-0.685476,0.773217,-0.124149,-0.621815,\n\t\t\t         0.474441,-0.083651,-0.876278,0.427137,-0.214026,-0.878445,0.795190,-0.159246,-0.585040,0.623707,-0.119907,-0.772393,\n\t\t\t         0.986053,-0.166295,-0.003174,0.914762,-0.253639,-0.314371,0.826716,-0.497238,0.263131,0.810663,-0.451521,0.372692,\n\t\t\t         0.581378,-0.075777,-0.810053,0.575579,-0.285073,-0.766411,0.614673,-0.059755,-0.786462,0.588885,-0.007263,-0.808161,\n\t\t\t         -0.744530,-0.489181,0.454268,-0.772485,-0.448744,0.449263,-0.990783,0.104251,0.086123,-0.988861,0.144383,-0.036012,\n\t\t\t         -0.814783,-0.384381,0.433973,-0.843867,-0.328104,0.424512,-0.453627,-0.571764,0.683554,-0.386639,-0.594989,0.704581,\n\t\t\t         0.355754,-0.637196,0.683645,0.368999,-0.627003,0.686056,0.810663,-0.451521,0.372692,0.826716,-0.497238,0.263131,\n\t\t\t         0.072451,0.829951,-0.553087,-0.006348,0.850093,-0.526536,-0.468429,0.850337,-0.239631,-0.419477,0.874966,-0.241737,\n\t\t\t         -0.751518,0.659597,0.009857,-0.731651,0.681234,0.023835,-0.419477,0.874966,-0.241737,-0.468429,0.850337,-0.239631,\n\t\t\t         0.589221,-0.202124,-0.782250,0.714866,-0.145604,-0.683889,0.773217,-0.124149,-0.621815,0.727836,0.017823,-0.685476,\n\t\t\t         -0.746239,-0.418775,0.517411,-0.776330,-0.467391,0.422864,-0.396130,-0.786584,0.473617,-0.477889,-0.697470,0.533952,\n\t\t\t         -0.843867,-0.328104,0.424512,-0.814783,-0.384381,0.433973,-0.987396,-0.147191,0.057802,-0.994324,-0.084017,0.064791,\n\t\t\t         0.723899,0.067019,-0.686636,0.581378,-0.075777,-0.810053,0.588885,-0.007263,-0.808161,0.654256,0.056856,-0.754112,\n\t\t\t         0.743309,0.160619,-0.649342,0.816309,0.209357,-0.538285,0.764794,0.255348,-0.591479,0.747948,0.223457,-0.624989,\n\t\t\t         0.477218,-0.047792,-0.877468,0.474441,-0.083651,-0.876278,0.623707,-0.119907,-0.772393,0.503067,0.198523,-0.841121,\n\t\t\t         -0.499985,0.830897,-0.244087,-0.629109,0.731529,-0.262764,-0.100223,0.701804,-0.705252,0.126621,0.670553,-0.730949,\n\t\t\t         0.781213,0.056612,-0.621632,0.784082,-0.069826,-0.616688,0.681600,0.162328,-0.713462,0.747948,0.223457,-0.624989,\n\t\t\t         0.569262,-0.013153,-0.822047,0.638752,-0.067965,-0.766350,0.744835,0.014801,-0.667043,0.654256,0.056856,-0.754112,\n\t\t\t         0.745811,-0.084384,-0.660756,0.772271,-0.006836,-0.635243,0.818781,-0.180792,-0.544877,0.783624,-0.201727,-0.587542,\n\t\t\t         0.793664,0.100742,-0.599933,0.772271,-0.006836,-0.635243,0.759301,0.160436,-0.630604,0.764855,0.279244,-0.580493,\n\t\t\t         0.638752,-0.067965,-0.766350,0.469619,0.156957,-0.868770,0.476547,0.302591,-0.825404,0.756218,0.008454,-0.654256,\n\t\t\t         -0.895138,0.406964,-0.181921,-0.989929,0.074923,0.119968,-0.957244,0.131077,0.257790,-0.930967,0.342326,0.126835,\n\t\t\t         0.793664,0.100742,-0.599933,0.830866,-0.188238,-0.523606,0.818781,-0.180792,-0.544877,0.772271,-0.006836,-0.635243,\n\t\t\t         0.793664,0.100742,-0.599933,0.680776,0.060671,-0.729942,0.799554,-0.208594,-0.563189,0.830866,-0.188238,-0.523606,\n\t\t\t         0.816309,0.209357,-0.538285,0.839045,0.255470,-0.480331,0.775780,0.331309,-0.536973,0.764794,0.255348,-0.591479,\n\t\t\t         -0.078646,-0.649770,0.756035,-0.117618,-0.607562,0.785485,0.382061,-0.679250,0.626576,0.334605,-0.740532,0.582781,\n\t\t\t         0.764855,0.279244,-0.580493,0.759301,0.160436,-0.630604,0.764794,0.255348,-0.591479,0.775780,0.331309,-0.536973,\n\t\t\t         -0.862575,-0.432173,0.262947,-0.477889,-0.697470,0.533952,-0.396130,-0.786584,0.473617,-0.619953,-0.776055,0.115665,\n\t\t\t         0.796228,0.017335,-0.604724,0.868740,-0.084750,-0.487930,0.861293,-0.008332,-0.508011,0.756218,0.008454,-0.654256,\n\t\t\t         0.647084,0.240638,-0.723411,0.764855,0.279244,-0.580493,0.775780,0.331309,-0.536973,0.674703,0.298959,-0.674795,\n\t\t\t         0.756218,0.008454,-0.654256,0.861293,-0.008332,-0.508011,0.744835,0.014801,-0.667043,0.638752,-0.067965,-0.766350,\n\t\t\t         0.839045,0.255470,-0.480331,0.777490,0.217383,-0.590075,0.674703,0.298959,-0.674795,0.775780,0.331309,-0.536973,\n\t\t\t         -0.930021,0.254006,0.265481,-0.918943,0.250038,0.304941,-0.921018,0.129307,0.367412,-0.928800,0.131077,0.346599,\n\t\t\t         -0.827052,-0.197272,0.526353,-0.831996,-0.172277,0.527299,-0.918424,-0.047731,0.392621,-0.924467,0.045991,0.378430,\n\t\t\t         -0.918943,0.250038,0.304941,-0.930021,0.254006,0.265481,-0.843226,0.537278,0.016144,-0.835078,0.547166,0.056673,\n\t\t\t         -0.924467,0.045991,0.378430,-0.918424,-0.047731,0.392621,-0.827296,-0.216041,0.518509,-0.807978,-0.244728,0.535905,\n\t\t\t         -0.883419,-0.068239,0.463546,-0.837153,-0.153905,0.524827,-0.807978,-0.244728,0.535905,-0.827296,-0.216041,0.518509,\n\t\t\t         -0.792169,0.608020,-0.052370,-0.912107,0.337962,0.231941,-0.881832,0.402722,0.245216,-0.724784,0.685659,-0.067232,\n\t\t\t         -0.936857,0.157659,0.312082,-0.929441,0.149449,0.337260,-0.837153,-0.153905,0.524827,-0.883419,-0.068239,0.463546,\n\t\t\t         -0.912107,0.337962,0.231941,-0.922849,0.207251,0.324595,-0.902768,0.284799,0.322275,-0.881832,0.402722,0.245216,\n\t\t\t         -0.831996,-0.172277,0.527299,-0.827052,-0.197272,0.526353,-0.694205,-0.425886,0.580218,-0.685110,-0.350810,0.638356,\n\t\t\t         -0.669912,-0.317881,0.670919,-0.667806,-0.300638,0.680898,-0.646168,-0.311350,0.696768,-0.614215,-0.348460,0.707999,\n\t\t\t         -0.752220,-0.235267,0.615436,-0.727744,-0.212928,0.651936,-0.814875,-0.084994,0.573351,-0.851009,-0.107547,0.513962,\n\t\t\t         -0.894986,0.029450,0.445112,-0.895871,-0.010956,0.444166,-0.847499,-0.154851,0.507675,-0.861965,-0.085726,0.499649,\n\t\t\t         -0.614215,-0.348460,0.707999,-0.646168,-0.311350,0.696768,-0.463301,-0.461074,0.756767,-0.412641,-0.455580,0.788751,\n\t\t\t         -0.694205,-0.425886,0.580218,-0.632008,-0.555650,0.540147,-0.912137,-0.275582,0.303323,-0.794946,-0.286630,0.534684,\n\t\t\t         -0.934080,0.146916,-0.325388,-0.988861,0.144383,-0.036012,-0.990783,0.104251,0.086123,-0.978179,0.204657,-0.035554,\n\t\t\t         -0.851009,-0.107547,0.513962,-0.814875,-0.084994,0.573351,-0.853969,-0.004669,0.520280,-0.861965,-0.085726,0.499649,\n\t\t\t         -0.922544,0.164922,0.348857,-0.933714,0.155065,0.322642,-0.895871,-0.010956,0.444166,-0.894986,0.029450,0.445112,\n\t\t\t         -0.752220,-0.235267,0.615436,-0.785943,-0.188421,0.588855,-0.667806,-0.300638,0.680898,-0.669912,-0.317881,0.670919,\n\t\t\t         -0.939817,0.145634,0.309061,-0.924467,0.045991,0.378430,-0.807978,-0.244728,0.535905,-0.847163,-0.219001,0.484054,\n\t\t\t         -0.794946,-0.286630,0.534684,-0.912137,-0.275582,0.303323,-0.688009,-0.359996,0.630055,-0.591815,-0.397717,0.701071,\n\t\t\t         -0.897305,0.188025,0.399335,-0.916227,0.110416,0.385113,-0.921018,0.129307,0.367412,-0.918943,0.250038,0.304941,\n\t\t\t         -0.685110,-0.350810,0.638356,-0.694205,-0.425886,0.580218,-0.794946,-0.286630,0.534684,-0.702963,-0.297403,0.646016,\n\t\t\t         -0.921018,0.129307,0.367412,-0.916227,0.110416,0.385113,-0.911557,0.199774,0.359355,-0.929441,0.149449,0.337260,\n\t\t\t         -0.802545,-0.236579,0.547624,-0.820856,-0.261788,0.507553,-0.991302,0.038545,0.125645,-0.984405,0.028565,0.173498,\n\t\t\t         0.026612,-0.633045,0.773644,-0.010041,-0.627949,0.778161,-0.417005,-0.521592,0.744316,-0.350871,-0.519608,0.779015,\n\t\t\t         -0.978881,0.176061,-0.103580,-0.964629,0.188574,-0.184027,-0.760491,0.213446,-0.613208,-0.782617,0.350566,-0.514359,\n\t\t\t         0.986053,-0.166295,-0.003174,0.810663,-0.451521,0.372692,0.742821,-0.513749,0.429243,0.960936,-0.256600,0.103519,\n\t\t\t         -0.377422,0.445265,-0.811945,-0.782617,0.350566,-0.514359,-0.760491,0.213446,-0.613208,-0.289682,0.074679,-0.954192,\n\t\t\t         0.810663,-0.451521,0.372692,0.368999,-0.627003,0.686056,0.380993,-0.629627,0.677023,0.742821,-0.513749,0.429243,\n\t\t\t         -0.350871,-0.519608,0.779015,-0.417005,-0.521592,0.744316,-0.820856,-0.261788,0.507553,-0.802545,-0.236579,0.547624,\n\t\t\t         0.589221,-0.202124,-0.782250,0.727836,0.017823,-0.685476,0.727958,0.259499,-0.634571,0.442854,0.185400,-0.877194,\n\t\t\t         0.727836,0.017823,-0.685476,0.937498,0.042024,-0.345347,0.963469,0.033723,-0.265664,0.727958,0.259499,-0.634571,\n\t\t\t         0.282205,-0.392834,-0.875210,0.589221,-0.202124,-0.782250,0.442854,0.185400,-0.877194,0.093295,0.055269,-0.994079,\n\t\t\t         0.368297,-0.638050,0.676168,0.380993,-0.629627,0.677023,-0.010041,-0.627949,0.778161,0.026612,-0.633045,0.773644,\n\t\t\t         -0.984405,0.028565,0.173498,-0.991302,0.038545,0.125645,-0.964629,0.188574,-0.184027,-0.978881,0.176061,-0.103580,\n\t\t\t         0.937498,0.042024,-0.345347,0.986053,-0.166295,-0.003174,0.960936,-0.256600,0.103519,0.963469,0.033723,-0.265664,\n\t\t\t         -0.077761,-0.461257,-0.883847,0.282205,-0.392834,-0.875210,0.093295,0.055269,-0.994079,-0.289682,0.074679,-0.954192,\n\t\t\t         -0.036012,0.135319,-0.990143,0.267373,0.144932,-0.952605,0.217780,0.462203,-0.859584,-0.058596,0.617603,-0.784295,\n\t\t\t         0.068667,-0.791559,0.607196,0.051027,-0.840449,0.539445,-0.253975,-0.747887,0.613269,-0.254036,-0.708243,0.658620,\n\t\t\t         -0.839656,0.534837,-0.094211,-0.808191,0.540239,-0.234291,-0.659719,0.672903,-0.334513,-0.657277,0.700705,-0.277352,\n\t\t\t         -0.364177,0.794733,-0.485488,-0.657277,0.700705,-0.277352,-0.659719,0.672903,-0.334513,-0.380749,0.727470,-0.570757,\n\t\t\t         -0.351115,0.822504,-0.447371,-0.645009,0.727622,-0.233467,-0.589221,0.753990,-0.290231,-0.367901,0.752159,-0.546678,\n\t\t\t         0.542192,-0.575945,-0.611774,0.341777,-0.812891,-0.471541,0.669881,-0.742241,0.017090,0.780023,-0.576006,-0.244392,\n\t\t\t         -0.073519,0.340312,-0.937407,0.292398,0.134861,-0.946715,0.308634,0.459944,-0.832545,-0.057955,0.647572,-0.759758,\n\t\t\t         0.614673,-0.059755,-0.786462,0.575579,-0.285073,-0.766411,0.802484,-0.389264,-0.452132,0.713645,0.051515,-0.698569,\n\t\t\t         0.267373,0.144932,-0.952605,0.602283,0.058321,-0.796136,0.629841,0.090518,-0.771416,0.217780,0.462203,-0.859584,\n\t\t\t         -0.458968,-0.672719,0.580309,-0.432691,-0.721763,0.540147,-0.793115,-0.423811,0.437422,-0.762017,-0.418470,0.494125,\n\t\t\t         0.706565,-0.281320,-0.649281,0.542192,-0.575945,-0.611774,0.780023,-0.576006,-0.244392,0.795282,-0.301401,-0.525956,\n\t\t\t         -0.969451,0.124271,0.211341,-0.989105,0.107181,0.100772,-0.808191,0.540239,-0.234291,-0.839656,0.534837,-0.094211,\n\t\t\t         -0.843471,0.536088,-0.033418,-0.825434,0.553270,-0.111881,-0.589221,0.753990,-0.290231,-0.645009,0.727622,-0.233467,\n\t\t\t         0.451766,-0.784143,0.425428,0.433699,-0.849849,0.299326,0.051027,-0.840449,0.539445,0.068667,-0.791559,0.607196,\n\t\t\t         -0.133732,-0.810511,0.570208,-0.043031,-0.857479,0.512680,-0.432691,-0.721763,0.540147,-0.458968,-0.672719,0.580309,\n\t\t\t         -0.384777,0.123600,-0.914670,-0.036012,0.135319,-0.990143,-0.058596,0.617603,-0.784295,-0.380749,0.727470,-0.570757,\n\t\t\t         0.602283,0.058321,-0.796136,0.706565,-0.281320,-0.649281,0.795282,-0.301401,-0.525956,0.629841,0.090518,-0.771416,\n\t\t\t         0.795190,-0.159246,-0.585040,0.427137,-0.214026,-0.878445,0.848903,-0.364544,-0.382641,0.874538,-0.117130,-0.470565,\n\t\t\t         -0.254036,-0.708243,0.658620,-0.253975,-0.747887,0.613269,-0.707419,-0.482376,0.516556,-0.679495,-0.456648,0.574206,\n\t\t\t         0.341777,-0.812891,-0.471541,-0.002472,-0.968963,-0.247169,0.433699,-0.849849,0.299326,0.669881,-0.742241,0.017090,\n\t\t\t         0.575579,-0.285073,-0.766411,0.466781,-0.524857,-0.711753,0.703848,-0.647023,-0.293039,0.802484,-0.389264,-0.452132,\n\t\t\t         -0.679495,-0.456648,0.574206,-0.707419,-0.482376,0.516556,-0.989105,0.107181,0.100772,-0.969451,0.124271,0.211341,\n\t\t\t         -0.414289,0.375652,-0.828974,-0.073519,0.340312,-0.937407,-0.057955,0.647572,-0.759758,-0.367901,0.752159,-0.546678,\n\t\t\t         0.772698,0.139958,-0.619098,0.795190,-0.159246,-0.585040,0.874538,-0.117130,-0.470565,0.784204,0.224372,-0.578478,\n\t\t\t         0.466781,-0.524857,-0.711753,0.082217,-0.813746,-0.575335,0.543321,-0.833216,-0.102420,0.703848,-0.647023,-0.293039,\n\t\t\t         -0.948485,-0.108493,0.297617,-0.964110,-0.063967,0.257546,-0.930906,0.330363,0.155675,-0.938963,0.309153,0.150761,\n\t\t\t         0.316630,-0.337504,-0.886441,-0.135655,-0.682272,-0.718345,0.301675,-0.953063,-0.024812,0.707633,-0.641987,-0.295053,\n\t\t\t         -0.552446,-0.777886,0.299387,-0.584948,-0.770623,0.252815,-0.857936,-0.419416,0.296579,-0.812677,-0.468612,0.346294,\n\t\t\t         -0.962554,0.117618,0.244240,-0.980407,0.058260,0.188116,-0.825434,0.553270,-0.111881,-0.843471,0.536088,-0.033418,\n\t\t\t         0.082217,-0.813746,-0.575335,-0.323099,-0.945647,-0.036439,0.252724,-0.925748,0.281167,0.543321,-0.833216,-0.102420,\n\t\t\t         -0.762017,-0.418470,0.494125,-0.793115,-0.423811,0.437422,-0.980407,0.058260,0.188116,-0.962554,0.117618,0.244240,\n\t\t\t         0.264840,-0.895718,0.357097,0.252724,-0.925748,0.281167,-0.043031,-0.857479,0.512680,-0.133732,-0.810511,0.570208,\n\t\t\t         0.292398,0.134861,-0.946715,0.614673,-0.059755,-0.786462,0.713645,0.051515,-0.698569,0.308634,0.459944,-0.832545,\n\t\t\t         -0.938963,0.309153,0.150761,-0.930906,0.330363,0.155675,-0.761650,0.647664,-0.018769,-0.765374,0.641469,-0.051698,\n\t\t\t         -0.812677,-0.468612,0.346294,-0.857936,-0.419416,0.296579,-0.964110,-0.063967,0.257546,-0.948485,-0.108493,0.297617,\n\t\t\t         0.427137,-0.214026,-0.878445,0.316630,-0.337504,-0.886441,0.707633,-0.641987,-0.295053,0.848903,-0.364544,-0.382641,\n\t\t\t         0.469893,0.577624,-0.667440,0.772698,0.139958,-0.619098,0.784204,0.224372,-0.578478,0.423963,0.660237,-0.619922,\n\t\t\t         -0.133549,-0.977508,0.163152,-0.232215,-0.957671,0.169958,-0.584948,-0.770623,0.252815,-0.552446,-0.777886,0.299387,\n\t\t\t         -0.006348,0.850093,-0.526536,0.469893,0.577624,-0.667440,0.423963,0.660237,-0.619922,-0.118992,0.877163,-0.465194,\n\t\t\t         -0.135655,-0.682272,-0.718345,-0.665395,-0.695212,-0.271828,-0.232215,-0.957671,0.169958,0.301675,-0.953063,-0.024812,\n\t\t\t         -0.765374,0.641469,-0.051698,-0.761650,0.647664,-0.018769,-0.513199,0.825220,-0.235786,-0.503250,0.830042,-0.240272,\n\t\t\t         -0.101718,0.907498,-0.407514,-0.503250,0.830042,-0.240272,-0.513199,0.825220,-0.235786,-0.118992,0.877163,-0.465194,\n\t\t\t         -0.616321,-0.194159,0.763146,-0.598939,-0.235752,0.765306,-0.715653,-0.154184,0.681226,-0.728660,-0.104099,0.676870,\n\t\t\t         -0.925169,0.213141,0.314005,-0.940098,0.186361,0.285458,-0.910259,0.404061,0.090350,-0.905362,0.401349,0.138554,\n\t\t\t         0.782281,-0.616138,0.091586,0.847652,-0.501297,0.173559,0.901639,-0.413282,-0.127354,0.863247,-0.472365,-0.177770,\n\t\t\t         -0.575121,0.761742,-0.298288,-0.580248,0.789850,-0.198431,-0.831111,0.547777,0.095584,-0.816309,0.577105,-0.023316,\n\t\t\t         -0.905362,0.401349,0.138554,-0.910259,0.404061,0.090350,-0.788473,0.610506,-0.074792,-0.816309,0.577105,-0.023316,\n\t\t\t         0.863247,-0.472365,-0.177770,0.901639,-0.413282,-0.127354,0.888668,-0.297555,-0.348827,0.866146,-0.333720,-0.371990,\n\t\t\t         0.285592,0.497940,-0.818812,0.316502,0.508918,-0.800518,0.641315,0.144425,-0.753563,0.629871,0.113559,-0.768334,\n\t\t\t         -0.450179,-0.319865,0.833644,-0.425931,-0.371914,0.824780,-0.598939,-0.235752,0.765306,-0.616321,-0.194159,0.763146,\n\t\t\t         -0.450179,-0.319865,0.833644,-0.480880,-0.258461,0.837794,-0.222571,-0.385418,0.895474,-0.189337,-0.474166,0.859798,\n\t\t\t         0.629871,0.113559,-0.768334,0.641315,0.144425,-0.753563,0.734290,-0.035796,-0.677892,0.735374,-0.043550,-0.676199,\n\t\t\t         -0.728660,-0.104099,0.676870,-0.715653,-0.154184,0.681226,-0.813642,-0.080259,0.575800,-0.818812,-0.026795,0.573412,\n\t\t\t         -0.189337,-0.474166,0.859798,-0.222571,-0.385418,0.895474,0.219214,-0.504288,0.835231,0.245247,-0.643971,0.724631,\n\t\t\t         0.735374,-0.043550,-0.676199,0.734290,-0.035796,-0.677892,0.810254,-0.178388,-0.558271,0.817164,-0.185217,-0.545793,\n\t\t\t         -0.818812,-0.026795,0.573412,-0.813642,-0.080259,0.575800,-0.893775,0.024919,0.447824,-0.887082,0.067751,0.456587,\n\t\t\t         0.817164,-0.185217,-0.545793,0.810254,-0.178388,-0.558271,0.865766,-0.336148,-0.370748,0.866146,-0.333720,-0.371990,\n\t\t\t         -0.887082,0.067751,0.456587,-0.893775,0.024919,0.447824,-0.940098,0.186361,0.285458,-0.925169,0.213141,0.314005,\n\t\t\t         -0.929441,0.149449,0.337260,-0.911557,0.199774,0.359355,-0.761437,-0.233467,0.604694,-0.837153,-0.153905,0.524827,\n\t\t\t         -0.827052,-0.197272,0.526353,-0.788049,-0.183081,0.587725,-0.632008,-0.555650,0.540147,-0.694205,-0.425886,0.580218,\n\t\t\t         -0.117618,-0.607562,0.785485,-0.078646,-0.649770,0.756035,-0.591815,-0.397717,0.701071,-0.688009,-0.359996,0.630055,\n\t\t\t         -0.788049,-0.183081,0.587725,-0.827052,-0.197272,0.526353,-0.924467,0.045991,0.378430,-0.939817,0.145634,0.309061,\n\t\t\t         -0.725639,-0.270425,0.632679,-0.577227,-0.518479,0.630818,-0.847163,-0.219001,0.484054,-0.761437,-0.233467,0.604694,\n\t\t\t         -0.752983,-0.297494,0.586932,-0.464095,-0.614002,0.638417,-0.632008,-0.555650,0.540147,-0.788049,-0.183081,0.587725,\n\t\t\t         -0.837153,-0.153905,0.524827,-0.761437,-0.233467,0.604694,-0.847163,-0.219001,0.484054,-0.807978,-0.244728,0.535905,\n\t\t\t         -0.865841,0.211371,0.453413,-0.816523,0.474868,0.328196,-0.840297,0.486068,0.240028,-0.893735,0.087710,0.439894,\n\t\t\t         -0.605152,-0.727866,0.322428,-0.373028,-0.743645,0.554796,-0.292673,-0.785485,0.545244,-0.461654,-0.862300,0.207984,\n\t\t\t         -0.963500,-0.153447,-0.219214,-0.994324,-0.084017,0.064791,-0.987396,-0.147191,0.057802,-0.959075,-0.281655,-0.028352,\n\t\t\t         -0.461654,-0.862300,0.207984,-0.002472,-0.968963,-0.247169,-0.564928,-0.364299,-0.740318,-0.963500,-0.153447,-0.219214,\n\t\t\t         -0.963500,-0.153447,-0.219214,-0.959075,-0.281655,-0.028352,-0.605152,-0.727866,0.322428,-0.461654,-0.862300,0.207984,\n\t\t\t         -0.893735,0.087710,0.439894,-0.857082,-0.212500,0.469253,-0.853084,-0.076998,0.516007,-0.865841,0.211371,0.453413,\n\t\t\t         -0.916227,0.110416,0.385113,-0.853084,-0.076998,0.516007,-0.857082,-0.212500,0.469253,-0.958098,0.000641,0.286416,\n\t\t\t         -0.619953,-0.776055,0.115665,-0.323099,-0.945647,-0.036439,-0.839198,0.191931,-0.508774,-0.934080,0.146916,-0.325388,\n\t\t\t         -0.761437,-0.233467,0.604694,-0.911557,0.199774,0.359355,-0.868801,0.100040,0.484909,-0.725639,-0.270425,0.632679,\n\t\t\t         -0.934080,0.146916,-0.325388,-0.978179,0.204657,-0.035554,-0.862575,-0.432173,0.262947,-0.619953,-0.776055,0.115665,\n\t\t\t         -0.911557,0.199774,0.359355,-0.916227,0.110416,0.385113,-0.958098,0.000641,0.286416,-0.930967,0.342326,0.126835,\n\t\t\t         -0.897305,0.188025,0.399335,-0.803735,0.582629,0.120396,-0.816523,0.474868,0.328196,-0.865841,0.211371,0.453413,\n\t\t\t         -0.918943,0.250038,0.304941,-0.835078,0.547166,0.056673,-0.803735,0.582629,0.120396,-0.897305,0.188025,0.399335,\n\t\t\t         -0.958098,0.000641,0.286416,-0.857082,-0.212500,0.469253,-0.865444,-0.348033,0.360302,-0.953307,-0.301981,-0.000031,\n\t\t\t         -0.895138,0.406964,-0.181921,-0.930967,0.342326,0.126835,-0.958098,0.000641,0.286416,-0.953307,-0.301981,-0.000031,\n\t\t\t         -0.953307,-0.301981,-0.000031,-0.665395,-0.695212,-0.271828,-0.807917,0.315012,-0.498001,-0.895138,0.406964,-0.181921,\n\t\t\t         -0.865841,0.211371,0.453413,-0.853084,-0.076998,0.516007,-0.916227,0.110416,0.385113,-0.897305,0.188025,0.399335,\n\t\t\t         0.888272,0.110843,-0.445692,0.861293,-0.008332,-0.508011,0.868740,-0.084750,-0.487930,0.862209,0.029481,-0.505661,\n\t\t\t         -0.303720,-0.347636,0.887051,0.070528,-0.379681,0.922391,0.219214,-0.504288,0.835231,-0.222571,-0.385418,0.895474,\n\t\t\t         -0.530747,-0.246986,0.810724,-0.303720,-0.347636,0.887051,-0.222571,-0.385418,0.895474,-0.480880,-0.258461,0.837794,\n\t\t\t         0.836329,0.474624,-0.274270,0.858028,0.435438,-0.272317,0.948332,0.252297,0.192297,0.960295,0.225532,0.164129,\n\t\t\t         -0.884396,-0.177740,-0.431532,-0.903806,-0.153630,-0.399365,-0.834712,-0.501511,0.227393,-0.844600,-0.498764,0.194555,\n\t\t\t         0.430555,0.518632,-0.738639,0.382092,0.592456,-0.709189,-0.224647,0.412214,-0.882931,-0.177465,0.383587,-0.906278,\n\t\t\t         -0.662069,0.118198,-0.740043,-0.635487,0.105472,-0.764855,-0.177465,0.383587,-0.906278,-0.224647,0.412214,-0.882931,\n\t\t\t         -0.351970,-0.597522,0.720450,-0.357646,-0.623218,0.695425,0.209723,-0.480392,0.851588,0.231910,-0.427168,0.873897,\n\t\t\t         -0.844600,-0.498764,0.194555,-0.834712,-0.501511,0.227393,-0.357646,-0.623218,0.695425,-0.351970,-0.597522,0.720450,\n\t\t\t         -0.635487,0.105472,-0.764855,-0.662069,0.118198,-0.740043,-0.903806,-0.153630,-0.399365,-0.884396,-0.177740,-0.431532,\n\t\t\t         0.231910,-0.427168,0.873897,0.209723,-0.480392,0.851588,0.792047,-0.086154,0.604327,0.762291,-0.048799,0.645375,\n\t\t\t         0.382092,0.592456,-0.709189,0.430555,0.518632,-0.738639,0.858028,0.435438,-0.272317,0.836329,0.474624,-0.274270,\n\t\t\t         0.762291,-0.048799,0.645375,0.792047,-0.086154,0.604327,0.960295,0.225532,0.164129,0.948332,0.252297,0.192297,\n\t\t\t         0.244667,-0.407849,0.879635,0.231910,-0.427168,0.873897,0.762291,-0.048799,0.645375,0.782189,-0.050600,0.620960,\n\t\t\t         0.782189,-0.050600,0.620960,0.762291,-0.048799,0.645375,0.948332,0.252297,0.192297,0.959014,0.208747,0.191534,\n\t\t\t         0.430555,0.518632,-0.738639,0.475997,0.478805,-0.737663,0.885708,0.371410,-0.278420,0.858028,0.435438,-0.272317,\n\t\t\t         -0.839534,-0.222938,-0.495437,-0.884396,-0.177740,-0.431532,-0.844600,-0.498764,0.194555,-0.846675,-0.516343,0.128452,\n\t\t\t         0.858028,0.435438,-0.272317,0.885708,0.371410,-0.278420,0.959014,0.208747,0.191534,0.948332,0.252297,0.192297,\n\t\t\t         0.475997,0.478805,-0.737663,0.430555,0.518632,-0.738639,-0.177465,0.383587,-0.906278,-0.149419,0.365642,-0.918668,\n\t\t\t         -0.635487,0.105472,-0.764855,-0.600543,0.077303,-0.795831,-0.149419,0.365642,-0.918668,-0.177465,0.383587,-0.906278,\n\t\t\t         -0.600543,0.077303,-0.795831,-0.635487,0.105472,-0.764855,-0.884396,-0.177740,-0.431532,-0.839534,-0.222938,-0.495437,\n\t\t\t         -0.398602,-0.592120,0.700308,-0.351970,-0.597522,0.720450,0.231910,-0.427168,0.873897,0.244667,-0.407849,0.879635,\n\t\t\t         -0.846675,-0.516343,0.128452,-0.844600,-0.498764,0.194555,-0.351970,-0.597522,0.720450,-0.398602,-0.592120,0.700308,\n\t\t\t         -0.372387,-0.650594,0.661794,-0.398602,-0.592120,0.700308,0.244667,-0.407849,0.879635,0.311045,-0.445967,0.839229,\n\t\t\t         -0.802820,-0.595325,0.031739,-0.846675,-0.516343,0.128452,-0.398602,-0.592120,0.700308,-0.372387,-0.650594,0.661794,\n\t\t\t         0.311045,-0.445967,0.839229,0.244667,-0.407849,0.879635,0.782189,-0.050600,0.620960,0.832392,-0.073031,0.549333,\n\t\t\t         0.832392,-0.073031,0.549333,0.782189,-0.050600,0.620960,0.959014,0.208747,0.191534,0.967650,0.175329,0.181280,\n\t\t\t         0.475997,0.478805,-0.737663,0.467055,0.485214,-0.739189,0.889584,0.375866,-0.259468,0.885708,0.371410,-0.278420,\n\t\t\t         -0.765984,-0.304300,-0.566240,-0.839534,-0.222938,-0.495437,-0.846675,-0.516343,0.128452,-0.802820,-0.595325,0.031739,\n\t\t\t         0.885708,0.371410,-0.278420,0.889584,0.375866,-0.259468,0.967650,0.175329,0.181280,0.959014,0.208747,0.191534,\n\t\t\t         0.467055,0.485214,-0.739189,0.475997,0.478805,-0.737663,-0.149419,0.365642,-0.918668,-0.132725,0.322672,-0.937132,\n\t\t\t         -0.600543,0.077303,-0.795831,-0.555498,0.005585,-0.831477,-0.132725,0.322672,-0.937132,-0.149419,0.365642,-0.918668,\n\t\t\t         -0.555498,0.005585,-0.831477,-0.600543,0.077303,-0.795831,-0.839534,-0.222938,-0.495437,-0.765984,-0.304300,-0.566240,\n\t\t\t         0.421003,0.474899,-0.772759,0.467055,0.485214,-0.739189,-0.132725,0.322672,-0.937132,-0.102603,0.286782,-0.952452,\n\t\t\t         -0.555498,0.005585,-0.831477,-0.474807,-0.046236,-0.878872,-0.102603,0.286782,-0.952452,-0.132725,0.322672,-0.937132,\n\t\t\t         -0.474807,-0.046236,-0.878872,-0.555498,0.005585,-0.831477,-0.765984,-0.304300,-0.566240,-0.669729,-0.390271,-0.631764,\n\t\t\t         -0.329051,-0.722434,0.608081,-0.372387,-0.650594,0.661794,0.311045,-0.445967,0.839229,0.367412,-0.476943,0.798425,\n\t\t\t         -0.720267,-0.690725,-0.063784,-0.802820,-0.595325,0.031739,-0.372387,-0.650594,0.661794,-0.329051,-0.722434,0.608081,\n\t\t\t         0.367412,-0.476943,0.798425,0.311045,-0.445967,0.839229,0.832392,-0.073031,0.549333,0.844508,-0.108676,0.524338,\n\t\t\t         0.844508,-0.108676,0.524338,0.832392,-0.073031,0.549333,0.967650,0.175329,0.181280,0.972320,0.185736,0.141575,\n\t\t\t         0.467055,0.485214,-0.739189,0.421003,0.474899,-0.772759,0.857204,0.412183,-0.308664,0.889584,0.375866,-0.259468,\n\t\t\t         -0.669729,-0.390271,-0.631764,-0.765984,-0.304300,-0.566240,-0.802820,-0.595325,0.031739,-0.720267,-0.690725,-0.063784,\n\t\t\t         0.889584,0.375866,-0.259468,0.857204,0.412183,-0.308664,0.972320,0.185736,0.141575,0.967650,0.175329,0.181280,\n\t\t\t         0.421003,0.474899,-0.772759,0.447798,0.418134,-0.790338,0.816950,0.399701,-0.415693,0.857204,0.412183,-0.308664,\n\t\t\t         -0.424848,-0.584185,-0.691488,-0.669729,-0.390271,-0.631764,-0.720267,-0.690725,-0.063784,-0.489608,-0.871700,-0.019318,\n\t\t\t         0.857204,0.412183,-0.308664,0.816950,0.399701,-0.415693,0.976196,0.213385,0.038545,0.972320,0.185736,0.141575,\n\t\t\t         0.447798,0.418134,-0.790338,0.421003,0.474899,-0.772759,-0.102603,0.286782,-0.952452,-0.072726,0.189734,-0.979125,\n\t\t\t         -0.474807,-0.046236,-0.878872,-0.343944,-0.158971,-0.925413,-0.072726,0.189734,-0.979125,-0.102603,0.286782,-0.952452,\n\t\t\t         -0.343944,-0.158971,-0.925413,-0.474807,-0.046236,-0.878872,-0.669729,-0.390271,-0.631764,-0.424848,-0.584185,-0.691488,\n\t\t\t         -0.259804,-0.771325,0.580981,-0.329051,-0.722434,0.608081,0.367412,-0.476943,0.798425,0.301035,-0.542070,0.784539,\n\t\t\t         -0.489608,-0.871700,-0.019318,-0.720267,-0.690725,-0.063784,-0.329051,-0.722434,0.608081,-0.259804,-0.771325,0.580981,\n\t\t\t         0.301035,-0.542070,0.784539,0.367412,-0.476943,0.798425,0.844508,-0.108676,0.524338,0.878475,-0.118656,0.462783,\n\t\t\t         0.878475,-0.118656,0.462783,0.844508,-0.108676,0.524338,0.972320,0.185736,0.141575,0.976196,0.213385,0.038545,\n\t\t\t         0.403455,-0.488754,0.773492,0.301035,-0.542070,0.784539,0.878475,-0.118656,0.462783,0.902890,-0.115360,0.414075,\n\t\t\t         0.902890,-0.115360,0.414075,0.878475,-0.118656,0.462783,0.976196,0.213385,0.038545,0.971618,0.223182,-0.077975,\n\t\t\t         0.447798,0.418134,-0.790338,0.288369,0.226722,-0.930265,0.754387,0.346080,-0.557726,0.816950,0.399701,-0.415693,\n\t\t\t         0.092380,-0.861782,-0.498733,-0.424848,-0.584185,-0.691488,-0.489608,-0.871700,-0.019318,-0.113315,-0.978179,0.173956,\n\t\t\t         0.816950,0.399701,-0.415693,0.754387,0.346080,-0.557726,0.971618,0.223182,-0.077975,0.976196,0.213385,0.038545,\n\t\t\t         0.288369,0.226722,-0.930265,0.447798,0.418134,-0.790338,-0.072726,0.189734,-0.979125,0.006012,-0.008454,-0.999939,\n\t\t\t         -0.343944,-0.158971,-0.925413,0.004791,-0.396466,-0.918027,0.006012,-0.008454,-0.999939,-0.072726,0.189734,-0.979125,\n\t\t\t         0.004791,-0.396466,-0.918027,-0.343944,-0.158971,-0.925413,-0.424848,-0.584185,-0.691488,0.092380,-0.861782,-0.498733,\n\t\t\t         -0.128086,-0.755089,0.642964,-0.259804,-0.771325,0.580981,0.301035,-0.542070,0.784539,0.403455,-0.488754,0.773492,\n\t\t\t         -0.113315,-0.978179,0.173956,-0.489608,-0.871700,-0.019318,-0.259804,-0.771325,0.580981,-0.128086,-0.755089,0.642964,\n\t\t\t         0.954741,0.237159,-0.179418,0.919370,0.007416,0.393292,0.902890,-0.115360,0.414075,0.971618,0.223182,-0.077975,\n\t\t\t         0.720389,0.255531,-0.644765,0.954741,0.237159,-0.179418,0.971618,0.223182,-0.077975,0.754387,0.346080,-0.557726,\n\t\t\t         0.440443,-0.050386,-0.896359,0.413038,0.127079,-0.901791,0.378796,0.204047,-0.902676,0.381420,0.102268,-0.918699,\n\t\t\t         0.381420,0.102268,-0.918699,0.378796,0.204047,-0.902676,0.629780,0.349834,-0.693472,0.676687,0.284005,-0.679250,\n\t\t\t         0.676687,0.284005,-0.679250,0.629780,0.349834,-0.693472,0.857570,0.386486,-0.339335,0.910215,0.324198,-0.257637,\n\t\t\t         0.413038,0.127079,-0.901791,0.437941,0.204688,-0.875362,0.382702,0.241523,-0.891720,0.378796,0.204047,-0.902676,\n\t\t\t         0.437941,0.204688,-0.875362,0.569353,0.128178,-0.812006,0.452254,0.163366,-0.876766,0.382702,0.241523,-0.891720,\n\t\t\t         0.569353,0.128178,-0.812006,0.730735,-0.086978,-0.677053,0.632954,-0.077609,-0.770257,0.452254,0.163366,-0.876766,\n\t\t\t         0.408338,-0.252052,0.877316,0.601337,-0.039094,0.797998,0.132481,-0.319956,0.938108,-0.077700,-0.507797,0.857936,\n\t\t\t         0.730735,-0.086978,-0.677053,0.787103,-0.196814,-0.584552,0.727928,-0.209693,-0.652791,0.632954,-0.077609,-0.770257,\n\t\t\t         0.787103,-0.196814,-0.584552,0.754326,-0.052248,-0.654378,0.704123,-0.036287,-0.709128,0.727928,-0.209693,-0.652791,\n\t\t\t         0.408032,0.448225,-0.795343,0.505539,0.405255,-0.761681,0.683584,0.151830,-0.713889,0.704123,-0.036287,-0.709128,\n\t\t\t         0.374889,0.462203,-0.803613,0.408032,0.448225,-0.795343,0.704123,-0.036287,-0.709128,0.754326,-0.052248,-0.654378,\n\t\t\t         -0.077761,-0.461257,-0.883847,-0.564928,-0.364299,-0.740318,-0.002472,-0.968963,-0.247169,0.341777,-0.812891,-0.471541,\n\t\t\t         -0.384777,0.123600,-0.914670,-0.839198,0.191931,-0.508774,-0.323099,-0.945647,-0.036439,0.082217,-0.813746,-0.575335,\n\t\t\t         0.282205,-0.392834,-0.875210,-0.077761,-0.461257,-0.883847,0.341777,-0.812891,-0.471541,0.542192,-0.575945,-0.611774,\n\t\t\t         0.542192,-0.575945,-0.611774,0.706565,-0.281320,-0.649281,0.589221,-0.202124,-0.782250,0.282205,-0.392834,-0.875210,\n\t\t\t         0.706565,-0.281320,-0.649281,0.784082,-0.069826,-0.616688,0.714866,-0.145604,-0.683889,0.589221,-0.202124,-0.782250,\n\t\t\t         0.745811,-0.084384,-0.660756,0.714866,-0.145604,-0.683889,0.784082,-0.069826,-0.616688,0.781213,0.056612,-0.621632,\n\t\t\t         0.799554,-0.208594,-0.563189,0.680776,0.060671,-0.729942,0.440443,-0.050386,-0.896359,0.696921,-0.318125,-0.642720,\n\t\t\t         0.764855,0.279244,-0.580493,0.647084,0.240638,-0.723411,0.680776,0.060671,-0.729942,0.793664,0.100742,-0.599933,\n\t\t\t         0.337626,0.101688,-0.935759,0.720389,0.255531,-0.644765,0.754387,0.346080,-0.557726,0.288369,0.226722,-0.930265,\n\t\t\t         -0.036012,0.135319,-0.990143,-0.384777,0.123600,-0.914670,0.082217,-0.813746,-0.575335,0.466781,-0.524857,-0.711753,\n\t\t\t         0.466781,-0.524857,-0.711753,0.575579,-0.285073,-0.766411,0.267373,0.144932,-0.952605,-0.036012,0.135319,-0.990143,\n\t\t\t         -0.414289,0.375652,-0.828974,-0.807917,0.315012,-0.498001,-0.665395,-0.695212,-0.271828,-0.135655,-0.682272,-0.718345,\n\t\t\t         -0.073519,0.340312,-0.937407,-0.414289,0.375652,-0.828974,-0.135655,-0.682272,-0.718345,0.316630,-0.337504,-0.886441,\n\t\t\t         0.316630,-0.337504,-0.886441,0.427137,-0.214026,-0.878445,0.292398,0.134861,-0.946715,-0.073519,0.340312,-0.937407,\n\t\t\t         0.427137,-0.214026,-0.878445,0.474441,-0.083651,-0.876278,0.440992,0.066042,-0.895047,0.292398,0.134861,-0.946715,\n\t\t\t         0.569262,-0.013153,-0.822047,0.440992,0.066042,-0.895047,0.474441,-0.083651,-0.876278,0.477218,-0.047792,-0.877468,\n\t\t\t         0.888272,0.110843,-0.445692,0.839045,0.255470,-0.480331,0.816309,0.209357,-0.538285,0.834101,0.110233,-0.540452,\n\t\t\t         0.862209,0.029481,-0.505661,0.777490,0.217383,-0.590075,0.839045,0.255470,-0.480331,0.888272,0.110843,-0.445692,\n\t\t\t         0.861293,-0.008332,-0.508011,0.888272,0.110843,-0.445692,0.834101,0.110233,-0.540452,0.744835,0.014801,-0.667043,\n\t\t\t         0.723899,0.067019,-0.686636,0.834101,0.110233,-0.540452,0.816309,0.209357,-0.538285,0.743309,0.160619,-0.649342,\n\t\t\t         0.550432,0.141179,-0.822810,0.267373,0.144932,-0.952605,0.575579,-0.285073,-0.766411,0.581378,-0.075777,-0.810053,\n\t\t\t         0.469619,0.156957,-0.868770,0.126621,0.670553,-0.730949,-0.100223,0.701804,-0.705252,0.476547,0.302591,-0.825404,\n\t\t\t         -0.922544,0.164922,0.348857,-0.902860,0.195288,0.382946,-0.902768,0.284799,0.322275,-0.922849,0.207251,0.324595,\n\t\t\t         -0.929441,0.149449,0.337260,-0.936857,0.157659,0.312082,-0.928800,0.131077,0.346599,-0.921018,0.129307,0.367412,\n\t\t\t         -0.688009,-0.359996,0.630055,-0.912137,-0.275582,0.303323,-0.951415,-0.173772,0.254067,-0.750298,-0.370891,0.547227,\n\t\t\t         -0.688009,-0.359996,0.630055,-0.750298,-0.370891,0.547227,-0.422101,-0.531693,0.734214,-0.117618,-0.607562,0.785485,\n\t\t\t         -0.788049,-0.183081,0.587725,-0.939817,0.145634,0.309061,-0.941679,0.035279,0.334605,-0.752983,-0.297494,0.586932,\n\t\t\t         -0.835078,0.547166,0.056673,-0.629109,0.731529,-0.262764,-0.499985,0.830897,-0.244087,-0.803735,0.582629,0.120396,\n\t\t\t         0.243873,-0.113285,-0.963134,0.337626,0.101688,-0.935759,0.288369,0.226722,-0.930265,0.006012,-0.008454,-0.999939,\n\t\t\t         -0.927122,0.291574,0.235389,-0.930509,0.154363,0.332041,-0.922849,0.207251,0.324595,-0.912107,0.337962,0.231941,\n\t\t\t         -0.645741,-0.299264,0.702445,-0.669912,-0.317881,0.670919,-0.614215,-0.348460,0.707999,-0.536546,-0.343028,0.770959,\n\t\t\t         -0.933714,0.155065,0.322642,-0.922544,0.164922,0.348857,-0.922849,0.207251,0.324595,-0.930509,0.154363,0.332041,\n\t\t\t         -0.902860,0.195288,0.382946,-0.922544,0.164922,0.348857,-0.894986,0.029450,0.445112,-0.883999,0.097232,0.457198,\n\t\t\t         -0.536546,-0.343028,0.770959,-0.614215,-0.348460,0.707999,-0.412641,-0.455580,0.788751,-0.293313,-0.387158,0.874081,\n\t\t\t         -0.785943,-0.188421,0.588855,-0.752220,-0.235267,0.615436,-0.851009,-0.107547,0.513962,-0.882931,-0.081118,0.462416,\n\t\t\t         -0.883999,0.097232,0.457198,-0.894986,0.029450,0.445112,-0.861965,-0.085726,0.499649,-0.853969,-0.004669,0.520280,\n\t\t\t         -0.727744,-0.212928,0.651936,-0.752220,-0.235267,0.615436,-0.669912,-0.317881,0.670919,-0.645741,-0.299264,0.702445,\n\t\t\t         -0.882931,-0.081118,0.462416,-0.851009,-0.107547,0.513962,-0.861965,-0.085726,0.499649,-0.847499,-0.154851,0.507675,\n\t\t\t         -0.100223,0.701804,-0.705252,-0.265358,0.729209,-0.630696,0.416425,0.423170,-0.804651,0.476547,0.302591,-0.825404,\n\t\t\t         0.727928,-0.209693,-0.652791,0.704123,-0.036287,-0.709128,0.683584,0.151830,-0.713889,0.775109,-0.029969,-0.631062,\n\t\t\t         0.756218,0.008454,-0.654256,0.476547,0.302591,-0.825404,0.416425,0.423170,-0.804651,0.796228,0.017335,-0.604724,\n\t\t\t         0.632954,-0.077609,-0.770257,0.727928,-0.209693,-0.652791,0.775109,-0.029969,-0.631062,0.723624,0.075014,-0.686087,\n\t\t\t         0.418928,-0.403485,-0.813410,0.243873,-0.113285,-0.963134,0.006012,-0.008454,-0.999939,0.004791,-0.396466,-0.918027,\n\t\t\t         0.004791,-0.396466,-0.918027,0.092380,-0.861782,-0.498733,0.570696,-0.796503,-0.199713,0.418928,-0.403485,-0.813410,\n\t\t\t         0.165319,-0.924345,0.343822,0.570696,-0.796503,-0.199713,0.092380,-0.861782,-0.498733,-0.113315,-0.978179,0.173956,\n\t\t\t         -0.040590,-0.729179,0.683065,0.165319,-0.924345,0.343822,-0.113315,-0.978179,0.173956,-0.128086,-0.755089,0.642964,\n\t\t\t         -0.128086,-0.755089,0.642964,0.403455,-0.488754,0.773492,0.380840,-0.385662,0.840358,-0.040590,-0.729179,0.683065,\n\t\t\t         -0.412641,-0.455580,0.788751,-0.077700,-0.507797,0.857936,0.132481,-0.319956,0.938108,-0.293313,-0.387158,0.874081,\n\t\t\t         -0.510330,0.792779,-0.333171,-0.123234,0.878231,-0.462020,0.107761,0.773522,-0.624531,-0.159612,0.801355,-0.576464,\n\t\t\t         -0.159612,0.801355,-0.576464,-0.285318,0.784417,-0.550676,-0.624714,0.736045,-0.260659,-0.510330,0.792779,-0.333171,\n\t\t\t         -0.843226,0.537278,0.016144,-0.663442,0.707602,-0.243080,-0.629109,0.731529,-0.262764,-0.835078,0.547166,0.056673,\n\t\t\t         0.918058,0.190649,0.347575,0.928281,0.302316,0.216529,0.601337,-0.039094,0.797998,0.408338,-0.252052,0.877316,\n\t\t\t         -0.530747,-0.246986,0.810724,-0.671987,-0.135105,0.728111,-0.702414,-0.164678,0.692404,-0.589923,-0.265175,0.762658,\n\t\t\t         -0.671987,-0.135105,0.728111,-0.763390,-0.023408,0.645466,-0.785058,-0.049135,0.617450,-0.702414,-0.164678,0.692404,\n\t\t\t         -0.763390,-0.023408,0.645466,-0.820643,0.075320,0.566424,-0.835719,0.049287,0.546892,-0.785058,-0.049135,0.617450,\n\t\t\t         -0.820643,0.075320,0.566424,-0.858364,0.163518,0.486251,-0.869259,0.145970,0.472243,-0.835719,0.049287,0.546892,\n\t\t\t         -0.858364,0.163518,0.486251,-0.880245,0.265328,0.393353,-0.884884,0.234779,0.402264,-0.869259,0.145970,0.472243,\n\t\t\t         0.602069,-0.690725,0.400433,0.782281,-0.616138,0.091586,0.768713,-0.638992,0.027743,0.584277,-0.743431,0.325470,\n\t\t\t         -0.880245,0.265328,0.393353,-0.872799,0.404523,0.273019,-0.879879,0.358592,0.311716,-0.884884,0.234779,0.402264,\n\t\t\t         -0.872799,0.404523,0.273019,-0.830805,0.527757,0.176580,-0.846339,0.480575,0.229652,-0.879879,0.358592,0.311716,\n\t\t\t         -0.645741,-0.299264,0.702445,-0.536546,-0.343028,0.770959,-0.414075,-0.329753,0.848384,-0.589923,-0.265175,0.762658,\n\t\t\t         -0.727744,-0.212928,0.651936,-0.645741,-0.299264,0.702445,-0.589923,-0.265175,0.762658,-0.702414,-0.164678,0.692404,\n\t\t\t         -0.702414,-0.164678,0.692404,-0.785058,-0.049135,0.617450,-0.814875,-0.084994,0.573351,-0.727744,-0.212928,0.651936,\n\t\t\t         -0.785058,-0.049135,0.617450,-0.835719,0.049287,0.546892,-0.853969,-0.004669,0.520280,-0.814875,-0.084994,0.573351,\n\t\t\t         -0.883999,0.097232,0.457198,-0.853969,-0.004669,0.520280,-0.835719,0.049287,0.546892,-0.869259,0.145970,0.472243,\n\t\t\t         -0.902860,0.195288,0.382946,-0.883999,0.097232,0.457198,-0.869259,0.145970,0.472243,-0.884884,0.234779,0.402264,\n\t\t\t         -0.884884,0.234779,0.402264,-0.879879,0.358592,0.311716,-0.902768,0.284799,0.322275,-0.902860,0.195288,0.382946,\n\t\t\t         -0.591754,0.797113,-0.119938,-0.830805,0.527757,0.176580,-0.831111,0.547777,0.095584,-0.580248,0.789850,-0.198431,\n\t\t\t         0.245247,-0.643971,0.724631,0.219214,-0.504288,0.835231,0.663442,-0.536180,0.521805,0.602069,-0.690725,0.400433,\n\t\t\t         -0.575121,0.761742,-0.298288,-0.525462,0.772864,-0.355768,-0.184553,0.764108,-0.618125,-0.190374,0.775811,-0.601520,\n\t\t\t         -0.002747,0.819880,-0.572497,-0.591754,0.797113,-0.119938,-0.580248,0.789850,-0.198431,-0.103977,0.811274,-0.575335,\n\t\t\t         -0.881832,0.402722,0.245216,-0.902768,0.284799,0.322275,-0.879879,0.358592,0.311716,-0.846339,0.480575,0.229652,\n\t\t\t         -0.868801,0.100040,0.484909,-0.911557,0.199774,0.359355,-0.930967,0.342326,0.126835,-0.957244,0.131077,0.257790,\n\t\t\t         0.834101,0.110233,-0.540452,0.723899,0.067019,-0.686636,0.654256,0.056856,-0.754112,0.744835,0.014801,-0.667043,\n\t\t\t         0.851375,-0.367321,-0.374401,0.914762,-0.253639,-0.314371,0.783624,-0.201727,-0.587542,0.818781,-0.180792,-0.544877,\n\t\t\t         -0.725639,-0.270425,0.632679,-0.868801,0.100040,0.484909,-0.957244,0.131077,0.257790,-0.746239,-0.418775,0.517411,\n\t\t\t         -0.746239,-0.418775,0.517411,-0.477889,-0.697470,0.533952,-0.577227,-0.518479,0.630818,-0.725639,-0.270425,0.632679,\n\t\t\t         0.550432,0.141179,-0.822810,0.743309,0.160619,-0.649342,0.747948,0.223457,-0.624989,0.681600,0.162328,-0.713462,\n\t\t\t         -0.847163,-0.219001,0.484054,-0.577227,-0.518479,0.630818,-0.477889,-0.697470,0.533952,-0.862575,-0.432173,0.262947,\n\t\t\t         0.469619,0.156957,-0.868770,0.477218,-0.047792,-0.877468,0.503067,0.198523,-0.841121,0.126621,0.670553,-0.730949,\n\t\t\t         0.914762,-0.253639,-0.314371,0.897366,-0.089084,-0.432173,0.773217,-0.124149,-0.621815,0.783624,-0.201727,-0.587542,\n\t\t\t         -0.862575,-0.432173,0.262947,-0.978179,0.204657,-0.035554,-0.939817,0.145634,0.309061,-0.847163,-0.219001,0.484054,\n\t\t\t         -0.941679,0.035279,0.334605,-0.939817,0.145634,0.309061,-0.978179,0.204657,-0.035554,-0.990783,0.104251,0.086123,\n\t\t\t         -0.752983,-0.297494,0.586932,-0.941679,0.035279,0.334605,-0.990783,0.104251,0.086123,-0.772485,-0.448744,0.449263,\n\t\t\t         -0.772485,-0.448744,0.449263,-0.373028,-0.743645,0.554796,-0.464095,-0.614002,0.638417,-0.752983,-0.297494,0.586932,\n\t\t\t         0.759301,0.160436,-0.630604,0.781213,0.056612,-0.621632,0.747948,0.223457,-0.624989,0.764794,0.255348,-0.591479,\n\t\t\t         0.440992,0.066042,-0.895047,0.569262,-0.013153,-0.822047,0.654256,0.056856,-0.754112,0.588885,-0.007263,-0.808161,\n\t\t\t         0.561052,0.383831,-0.733390,0.072451,0.829951,-0.553087,0.126621,0.670553,-0.730949,0.503067,0.198523,-0.841121,\n\t\t\t         -0.632008,-0.555650,0.540147,-0.464095,-0.614002,0.638417,-0.373028,-0.743645,0.554796,-0.605152,-0.727866,0.322428,\n\t\t\t         0.714866,-0.145604,-0.683889,0.745811,-0.084384,-0.660756,0.783624,-0.201727,-0.587542,0.773217,-0.124149,-0.621815,\n\t\t\t         -0.605152,-0.727866,0.322428,-0.959075,-0.281655,-0.028352,-0.912137,-0.275582,0.303323,-0.632008,-0.555650,0.540147,\n\t\t\t         -0.951415,-0.173772,0.254067,-0.912137,-0.275582,0.303323,-0.959075,-0.281655,-0.028352,-0.987396,-0.147191,0.057802,\n\t\t\t         -0.750298,-0.370891,0.547227,-0.951415,-0.173772,0.254067,-0.987396,-0.147191,0.057802,-0.814783,-0.384381,0.433973,\n\t\t\t         0.561052,0.383831,-0.733390,0.503067,0.198523,-0.841121,0.623707,-0.119907,-0.772393,0.750664,0.068422,-0.657125,\n\t\t\t         -0.814783,-0.384381,0.433973,-0.386639,-0.594989,0.704581,-0.422101,-0.531693,0.734214,-0.750298,-0.370891,0.547227,\n\t\t\t         -0.117618,-0.607562,0.785485,-0.422101,-0.531693,0.734214,-0.386639,-0.594989,0.704581,-0.005829,-0.647175,0.762291,\n\t\t\t         -0.005829,-0.647175,0.762291,0.355754,-0.637196,0.683645,0.382061,-0.679250,0.626576,-0.117618,-0.607562,0.785485,\n\t\t\t         0.334605,-0.740532,0.582781,0.382061,-0.679250,0.626576,0.780908,-0.611042,0.129460,0.780663,-0.624561,-0.020966,\n\t\t\t         0.851375,-0.367321,-0.374401,0.835902,-0.348094,-0.424299,0.780663,-0.624561,-0.020966,0.780908,-0.611042,0.129460,\n\t\t\t         0.072451,0.829951,-0.553087,-0.419477,0.874966,-0.241737,-0.499985,0.830897,-0.244087,0.126621,0.670553,-0.730949,\n\t\t\t         -0.803735,0.582629,0.120396,-0.499985,0.830897,-0.244087,-0.419477,0.874966,-0.241737,-0.731651,0.681234,0.023835,\n\t\t\t         -0.731651,0.681234,0.023835,-0.840297,0.486068,0.240028,-0.816523,0.474868,0.328196,-0.803735,0.582629,0.120396,\n\t\t\t         0.355754,-0.637196,0.683645,0.826716,-0.497238,0.263131,0.780908,-0.611042,0.129460,0.382061,-0.679250,0.626576,\n\t\t\t         0.772271,-0.006836,-0.635243,0.745811,-0.084384,-0.660756,0.781213,0.056612,-0.621632,0.759301,0.160436,-0.630604,\n\t\t\t         0.638752,-0.067965,-0.766350,0.569262,-0.013153,-0.822047,0.477218,-0.047792,-0.877468,0.469619,0.156957,-0.868770,\n\t\t\t         0.581378,-0.075777,-0.810053,0.723899,0.067019,-0.686636,0.743309,0.160619,-0.649342,0.550432,0.141179,-0.822810,\n\t\t\t         0.403455,-0.488754,0.773492,0.902890,-0.115360,0.414075,0.919370,0.007416,0.393292,0.380840,-0.385662,0.840358,\n\t\t\t         0.240242,-0.816980,0.524186,0.728050,-0.685476,-0.003540,0.570696,-0.796503,-0.199713,0.165319,-0.924345,0.343822,\n\t\t\t         -0.013215,-0.698813,0.715140,0.240242,-0.816980,0.524186,0.165319,-0.924345,0.343822,-0.040590,-0.729179,0.683065,\n\t\t\t         -0.591815,-0.397717,0.701071,-0.509262,-0.426679,0.747368,-0.702963,-0.297403,0.646016,-0.794946,-0.286630,0.534684,\n\t\t\t         -0.077700,-0.507797,0.857936,-0.412641,-0.455580,0.788751,-0.463301,-0.461074,0.756767,-0.186010,-0.644551,0.741539,\n\t\t\t         -0.724784,0.685659,-0.067232,-0.881832,0.402722,0.245216,-0.846339,0.480575,0.229652,-0.626576,0.772393,-0.103763,\n\t\t\t         0.408338,-0.252052,0.877316,-0.013215,-0.698813,0.715140,-0.040590,-0.729179,0.683065,0.380840,-0.385662,0.840358,\n\t\t\t         -0.724784,0.685659,-0.067232,-0.626576,0.772393,-0.103763,-0.027070,0.858119,-0.512711,-0.123234,0.878231,-0.462020,\n\t\t\t         -0.126865,-0.668142,0.733085,-0.509262,-0.426679,0.747368,-0.591815,-0.397717,0.701071,-0.078646,-0.649770,0.756035,\n\t\t\t         -0.509262,-0.426679,0.747368,-0.126865,-0.668142,0.733085,-0.186010,-0.644551,0.741539,-0.463301,-0.461074,0.756767,\n\t\t\t         -0.186010,-0.644551,0.741539,-0.126865,-0.668142,0.733085,0.240242,-0.816980,0.524186,-0.013215,-0.698813,0.715140,\n\t\t\t         -0.078646,-0.649770,0.756035,0.334605,-0.740532,0.582781,0.240242,-0.816980,0.524186,-0.126865,-0.668142,0.733085,\n\t\t\t         -0.702963,-0.297403,0.646016,-0.509262,-0.426679,0.747368,-0.463301,-0.461074,0.756767,-0.646168,-0.311350,0.696768,\n\t\t\t         -0.685110,-0.350810,0.638356,-0.702963,-0.297403,0.646016,-0.646168,-0.311350,0.696768,-0.667806,-0.300638,0.680898,\n\t\t\t         0.408032,0.448225,-0.795343,0.374889,0.462203,-0.803613,-0.285318,0.784417,-0.550676,-0.159612,0.801355,-0.576464,\n\t\t\t         -0.159612,0.801355,-0.576464,0.107761,0.773522,-0.624531,0.505539,0.405255,-0.761681,0.408032,0.448225,-0.795343,\n\t\t\t         0.563677,0.629139,-0.535173,-0.123234,0.878231,-0.462020,-0.027070,0.858119,-0.512711,0.496994,0.587359,-0.638722,\n\t\t\t         0.810175,0.344310,-0.474349,0.563677,0.629139,-0.535173,0.496994,0.587359,-0.638722,0.748802,0.312937,-0.584216,\n\t\t\t         0.862117,0.248817,-0.441359,0.810175,0.344310,-0.474349,0.748802,0.312937,-0.584216,0.846370,0.171758,-0.504105,\n\t\t\t         0.894650,0.312357,-0.319315,0.862117,0.248817,-0.441359,0.846370,0.171758,-0.504105,0.925382,0.105686,-0.363903,\n\t\t\t         0.905789,0.401959,-0.133854,0.894650,0.312357,-0.319315,0.925382,0.105686,-0.363903,0.980193,0.158818,-0.118168,\n\t\t\t         0.928281,0.302316,0.216529,0.905789,0.401959,-0.133854,0.980193,0.158818,-0.118168,0.938383,0.185949,0.291269,\n\t\t\t         0.601337,-0.039094,0.797998,0.928281,0.302316,0.216529,0.938383,0.185949,0.291269,0.762688,0.009735,0.646687,\n\t\t\t         0.132481,-0.319956,0.938108,0.601337,-0.039094,0.797998,0.762688,0.009735,0.646687,0.357341,-0.213141,0.909299,\n\t\t\t         0.563677,0.629139,-0.535173,0.615986,0.494003,-0.613575,0.107761,0.773522,-0.624531,-0.123234,0.878231,-0.462020,\n\t\t\t         0.857570,0.386486,-0.339335,0.928281,0.302316,0.216529,0.918058,0.190649,0.347575,0.910215,0.324198,-0.257637,\n\t\t\t         0.810175,0.344310,-0.474349,0.828944,0.214698,-0.516434,0.615986,0.494003,-0.613575,0.563677,0.629139,-0.535173,\n\t\t\t         0.107761,0.773522,-0.624531,0.615986,0.494003,-0.613575,0.683584,0.151830,-0.713889,0.505539,0.405255,-0.761681,\n\t\t\t         0.452254,0.163366,-0.876766,0.632954,-0.077609,-0.770257,0.723624,0.075014,-0.686087,0.593280,0.290048,-0.750877,\n\t\t\t         0.593280,0.290048,-0.750877,0.582568,0.361644,-0.727866,0.382702,0.241523,-0.891720,0.452254,0.163366,-0.876766,\n\t\t\t         0.775109,-0.029969,-0.631062,0.683584,0.151830,-0.713889,0.615986,0.494003,-0.613575,0.828944,0.214698,-0.516434,\n\t\t\t         0.828944,0.214698,-0.516434,0.830103,0.234016,-0.506088,0.723624,0.075014,-0.686087,0.775109,-0.029969,-0.631062,\n\t\t\t         0.830103,0.234016,-0.506088,0.776879,0.372570,-0.507553,0.593280,0.290048,-0.750877,0.723624,0.075014,-0.686087,\n\t\t\t         0.776879,0.372570,-0.507553,0.798547,0.422773,-0.428388,0.582568,0.361644,-0.727866,0.593280,0.290048,-0.750877,\n\t\t\t         0.862117,0.248817,-0.441359,0.830103,0.234016,-0.506088,0.828944,0.214698,-0.516434,0.810175,0.344310,-0.474349,\n\t\t\t         0.776879,0.372570,-0.507553,0.830103,0.234016,-0.506088,0.862117,0.248817,-0.441359,0.894650,0.312357,-0.319315,\n\t\t\t         0.894650,0.312357,-0.319315,0.905789,0.401959,-0.133854,0.798547,0.422773,-0.428388,0.776879,0.372570,-0.507553,\n\t\t\t         0.382702,0.241523,-0.891720,0.582568,0.361644,-0.727866,0.629780,0.349834,-0.693472,0.378796,0.204047,-0.902676,\n\t\t\t         0.582568,0.361644,-0.727866,0.798547,0.422773,-0.428388,0.857570,0.386486,-0.339335,0.629780,0.349834,-0.693472,\n\t\t\t         0.857570,0.386486,-0.339335,0.798547,0.422773,-0.428388,0.905789,0.401959,-0.133854,0.928281,0.302316,0.216529,\n\t\t\t         -0.629109,0.731529,-0.262764,-0.663442,0.707602,-0.243080,-0.265358,0.729209,-0.630696,-0.100223,0.701804,-0.705252,\n\t\t\t         -0.831996,-0.172277,0.527299,-0.685110,-0.350810,0.638356,-0.667806,-0.300638,0.680898,-0.785943,-0.188421,0.588855,\n\t\t\t         -0.785943,-0.188421,0.588855,-0.882931,-0.081118,0.462416,-0.918424,-0.047731,0.392621,-0.831996,-0.172277,0.527299,\n\t\t\t         -0.882931,-0.081118,0.462416,-0.847499,-0.154851,0.507675,-0.827296,-0.216041,0.518509,-0.918424,-0.047731,0.392621,\n\t\t\t         -0.883419,-0.068239,0.463546,-0.827296,-0.216041,0.518509,-0.847499,-0.154851,0.507675,-0.895871,-0.010956,0.444166,\n\t\t\t         -0.936857,0.157659,0.312082,-0.883419,-0.068239,0.463546,-0.895871,-0.010956,0.444166,-0.933714,0.155065,0.322642,\n\t\t\t         -0.928800,0.131077,0.346599,-0.936857,0.157659,0.312082,-0.933714,0.155065,0.322642,-0.930509,0.154363,0.332041,\n\t\t\t         -0.930021,0.254006,0.265481,-0.928800,0.131077,0.346599,-0.930509,0.154363,0.332041,-0.927122,0.291574,0.235389,\n\t\t\t         -0.265358,0.729209,-0.630696,-0.663442,0.707602,-0.243080,-0.624714,0.736045,-0.260659,-0.285318,0.784417,-0.550676,\n\t\t\t         -0.285318,0.784417,-0.550676,0.374889,0.462203,-0.803613,0.416425,0.423170,-0.804651,-0.265358,0.729209,-0.630696,\n\t\t\t         0.796228,0.017335,-0.604724,0.416425,0.423170,-0.804651,0.374889,0.462203,-0.803613,0.754326,-0.052248,-0.654378,\n\t\t\t         0.754326,-0.052248,-0.654378,0.787103,-0.196814,-0.584552,0.868740,-0.084750,-0.487930,0.796228,0.017335,-0.604724,\n\t\t\t         0.862209,0.029481,-0.505661,0.868740,-0.084750,-0.487930,0.787103,-0.196814,-0.584552,0.730735,-0.086978,-0.677053,\n\t\t\t         0.730735,-0.086978,-0.677053,0.569353,0.128178,-0.812006,0.777490,0.217383,-0.590075,0.862209,0.029481,-0.505661,\n\t\t\t         0.569353,0.128178,-0.812006,0.437941,0.204688,-0.875362,0.674703,0.298959,-0.674795,0.777490,0.217383,-0.590075,\n\t\t\t         0.647084,0.240638,-0.723411,0.674703,0.298959,-0.674795,0.437941,0.204688,-0.875362,0.413038,0.127079,-0.901791,\n\t\t\t         0.413038,0.127079,-0.901791,0.440443,-0.050386,-0.896359,0.680776,0.060671,-0.729942,0.647084,0.240638,-0.723411,\n\t\t\t         0.851375,-0.367321,-0.374401,0.780908,-0.611042,0.129460,0.826716,-0.497238,0.263131,0.914762,-0.253639,-0.314371,\n\t\t\t         0.830866,-0.188238,-0.523606,0.799554,-0.208594,-0.563189,0.780663,-0.624561,-0.020966,0.835902,-0.348094,-0.424299,\n\t\t\t         0.851375,-0.367321,-0.374401,0.818781,-0.180792,-0.544877,0.830866,-0.188238,-0.523606,0.835902,-0.348094,-0.424299,\n\t\t\t         0.334605,-0.740532,0.582781,0.780663,-0.624561,-0.020966,0.728050,-0.685476,-0.003540,0.240242,-0.816980,0.524186,\n\t\t\t         -0.510330,0.792779,-0.333171,-0.792169,0.608020,-0.052370,-0.724784,0.685659,-0.067232,-0.123234,0.878231,-0.462020,\n\t\t\t         -0.190374,0.775811,-0.601520,-0.184553,0.764108,-0.618125,0.316502,0.508918,-0.800518,0.285592,0.497940,-0.818812,\n\t\t\t         -0.293313,-0.387158,0.874081,0.132481,-0.319956,0.938108,0.357341,-0.213141,0.909299,-0.121799,-0.335582,0.934080,\n\t\t\t         -0.536546,-0.343028,0.770959,-0.293313,-0.387158,0.874081,-0.121799,-0.335582,0.934080,-0.414075,-0.329753,0.848384,\n\t\t\t         -0.663442,0.707602,-0.243080,-0.843226,0.537278,0.016144,-0.834071,0.551439,-0.014954,-0.624714,0.736045,-0.260659,\n\t\t\t         -0.510330,0.792779,-0.333171,-0.624714,0.736045,-0.260659,-0.834071,0.551439,-0.014954,-0.792169,0.608020,-0.052370,\n\t\t\t         -0.927122,0.291574,0.235389,-0.834071,0.551439,-0.014954,-0.843226,0.537278,0.016144,-0.930021,0.254006,0.265481,\n\t\t\t         -0.792169,0.608020,-0.052370,-0.834071,0.551439,-0.014954,-0.927122,0.291574,0.235389,-0.912107,0.337962,0.231941,\n\t\t\t         -0.013215,-0.698813,0.715140,0.408338,-0.252052,0.877316,-0.077700,-0.507797,0.857936,-0.186010,-0.644551,0.741539,\n\t\t\t         0.418928,-0.403485,-0.813410,0.570696,-0.796503,-0.199713,0.728050,-0.685476,-0.003540,0.696921,-0.318125,-0.642720,\n\t\t\t         0.696921,-0.318125,-0.642720,0.440443,-0.050386,-0.896359,0.243873,-0.113285,-0.963134,0.418928,-0.403485,-0.813410,\n\t\t\t         0.440443,-0.050386,-0.896359,0.381420,0.102268,-0.918699,0.337626,0.101688,-0.935759,0.243873,-0.113285,-0.963134,\n\t\t\t         0.381420,0.102268,-0.918699,0.676687,0.284005,-0.679250,0.720389,0.255531,-0.644765,0.337626,0.101688,-0.935759,\n\t\t\t         0.676687,0.284005,-0.679250,0.910215,0.324198,-0.257637,0.954741,0.237159,-0.179418,0.720389,0.255531,-0.644765,\n\t\t\t         0.910215,0.324198,-0.257637,0.918058,0.190649,0.347575,0.919370,0.007416,0.393292,0.954741,0.237159,-0.179418,\n\t\t\t         0.918058,0.190649,0.347575,0.408338,-0.252052,0.877316,0.380840,-0.385662,0.840358,0.919370,0.007416,0.393292,\n\t\t\t         0.588397,-0.297189,0.751946,0.880703,-0.202612,0.428053,0.847652,-0.501297,0.173559,0.663442,-0.536180,0.521805,\n\t\t\t         0.880703,-0.202612,0.428053,0.985595,-0.166387,0.029786,0.901639,-0.413282,-0.127354,0.847652,-0.501297,0.173559,\n\t\t\t         0.985595,-0.166387,0.029786,0.947111,-0.159246,-0.278573,0.888668,-0.297555,-0.348827,0.901639,-0.413282,-0.127354,\n\t\t\t         0.880184,-0.071841,-0.469100,0.947111,-0.159246,-0.278573,0.980193,0.158818,-0.118168,0.925382,0.105686,-0.363903,\n\t\t\t         0.796930,0.056856,-0.601337,0.880184,-0.071841,-0.469100,0.925382,0.105686,-0.363903,0.846370,0.171758,-0.504105,\n\t\t\t         0.678549,0.184179,-0.711081,0.796930,0.056856,-0.601337,0.846370,0.171758,-0.504105,0.748802,0.312937,-0.584216,\n\t\t\t         0.416791,0.505478,-0.755455,0.678549,0.184179,-0.711081,0.748802,0.312937,-0.584216,0.496994,0.587359,-0.638722,\n\t\t\t         0.416791,0.505478,-0.755455,-0.002747,0.819880,-0.572497,-0.103977,0.811274,-0.575335,0.327250,0.479049,-0.814478,\n\t\t\t         0.070528,-0.379681,0.922391,0.588397,-0.297189,0.751946,0.663442,-0.536180,0.521805,0.219214,-0.504288,0.835231,\n\t\t\t         -0.643422,-0.135228,0.753441,-0.616321,-0.194159,0.763146,-0.728660,-0.104099,0.676870,-0.745079,-0.031739,0.666189,\n\t\t\t         -0.895474,0.256783,0.363506,-0.925169,0.213141,0.314005,-0.905362,0.401349,0.138554,-0.887387,0.406629,0.217139,\n\t\t\t         0.768713,-0.638992,0.027743,0.782281,-0.616138,0.091586,0.863247,-0.472365,-0.177770,0.851433,-0.488414,-0.191088,\n\t\t\t         -0.525462,0.772864,-0.355768,-0.575121,0.761742,-0.298288,-0.816309,0.577105,-0.023316,-0.788473,0.610506,-0.074792,\n\t\t\t         -0.887387,0.406629,0.217139,-0.905362,0.401349,0.138554,-0.816309,0.577105,-0.023316,-0.831111,0.547777,0.095584,\n\t\t\t         0.851433,-0.488414,-0.191088,0.863247,-0.472365,-0.177770,0.866146,-0.333720,-0.371990,0.865766,-0.336148,-0.370748,\n\t\t\t         0.327250,0.479049,-0.814478,0.285592,0.497940,-0.818812,0.629871,0.113559,-0.768334,0.632466,0.089877,-0.769311,\n\t\t\t         -0.480880,-0.258461,0.837794,-0.450179,-0.319865,0.833644,-0.616321,-0.194159,0.763146,-0.643422,-0.135228,0.753441,\n\t\t\t         -0.425931,-0.371914,0.824780,-0.450179,-0.319865,0.833644,-0.189337,-0.474166,0.859798,-0.179861,-0.550185,0.815443,\n\t\t\t         0.632466,0.089877,-0.769311,0.629871,0.113559,-0.768334,0.735374,-0.043550,-0.676199,0.744652,-0.033509,-0.666585,\n\t\t\t         -0.745079,-0.031739,0.666189,-0.728660,-0.104099,0.676870,-0.818812,-0.026795,0.573412,-0.816950,0.057772,0.573779,\n\t\t\t         -0.179861,-0.550185,0.815443,-0.189337,-0.474166,0.859798,0.245247,-0.643971,0.724631,0.221624,-0.727702,0.649101,\n\t\t\t         0.744652,-0.033509,-0.666585,0.735374,-0.043550,-0.676199,0.817164,-0.185217,-0.545793,0.833552,-0.162420,-0.527970,\n\t\t\t         -0.816950,0.057772,0.573779,-0.818812,-0.026795,0.573412,-0.887082,0.067751,0.456587,-0.865169,0.141240,0.481155,\n\t\t\t         0.833552,-0.162420,-0.527970,0.817164,-0.185217,-0.545793,0.866146,-0.333720,-0.371990,0.888668,-0.297555,-0.348827,\n\t\t\t         -0.865169,0.141240,0.481155,-0.887082,0.067751,0.456587,-0.925169,0.213141,0.314005,-0.895474,0.256783,0.363506,\n\t\t\t         0.663442,-0.536180,0.521805,0.847652,-0.501297,0.173559,0.782281,-0.616138,0.091586,0.602069,-0.690725,0.400433,\n\t\t\t         0.221624,-0.727702,0.649101,0.245247,-0.643971,0.724631,0.602069,-0.690725,0.400433,0.584277,-0.743431,0.325470,\n\t\t\t         -0.580248,0.789850,-0.198431,-0.575121,0.761742,-0.298288,-0.190374,0.775811,-0.601520,-0.103977,0.811274,-0.575335,\n\t\t\t         -0.103977,0.811274,-0.575335,-0.190374,0.775811,-0.601520,0.285592,0.497940,-0.818812,0.327250,0.479049,-0.814478,\n\t\t\t         -0.027070,0.858119,-0.512711,-0.626576,0.772393,-0.103763,-0.591754,0.797113,-0.119938,-0.002747,0.819880,-0.572497,\n\t\t\t         -0.480880,-0.258461,0.837794,-0.643422,-0.135228,0.753441,-0.671987,-0.135105,0.728111,-0.530747,-0.246986,0.810724,\n\t\t\t         0.744652,-0.033509,-0.666585,0.833552,-0.162420,-0.527970,0.880184,-0.071841,-0.469100,0.796930,0.056856,-0.601337,\n\t\t\t         -0.589923,-0.265175,0.762658,-0.414075,-0.329753,0.848384,-0.303720,-0.347636,0.887051,-0.530747,-0.246986,0.810724,\n\t\t\t         0.938383,0.185949,0.291269,0.980193,0.158818,-0.118168,0.947111,-0.159246,-0.278573,0.985595,-0.166387,0.029786,\n\t\t\t         -0.414075,-0.329753,0.848384,-0.121799,-0.335582,0.934080,0.070528,-0.379681,0.922391,-0.303720,-0.347636,0.887051,\n\t\t\t         -0.887387,0.406629,0.217139,-0.831111,0.547777,0.095584,-0.830805,0.527757,0.176580,-0.872799,0.404523,0.273019,\n\t\t\t         -0.121799,-0.335582,0.934080,0.357341,-0.213141,0.909299,0.588397,-0.297189,0.751946,0.070528,-0.379681,0.922391,\n\t\t\t         -0.816950,0.057772,0.573779,-0.865169,0.141240,0.481155,-0.858364,0.163518,0.486251,-0.820643,0.075320,0.566424,\n\t\t\t         -0.895474,0.256783,0.363506,-0.887387,0.406629,0.217139,-0.872799,0.404523,0.273019,-0.880245,0.265328,0.393353,\n\t\t\t         0.762688,0.009735,0.646687,0.938383,0.185949,0.291269,0.985595,-0.166387,0.029786,0.880703,-0.202612,0.428053,\n\t\t\t         0.327250,0.479049,-0.814478,0.632466,0.089877,-0.769311,0.678549,0.184179,-0.711081,0.416791,0.505478,-0.755455,\n\t\t\t         -0.745079,-0.031739,0.666189,-0.816950,0.057772,0.573779,-0.820643,0.075320,0.566424,-0.763390,-0.023408,0.645466,\n\t\t\t         -0.865169,0.141240,0.481155,-0.895474,0.256783,0.363506,-0.880245,0.265328,0.393353,-0.858364,0.163518,0.486251,\n\t\t\t         0.496994,0.587359,-0.638722,-0.027070,0.858119,-0.512711,-0.002747,0.819880,-0.572497,0.416791,0.505478,-0.755455,\n\t\t\t         0.833552,-0.162420,-0.527970,0.888668,-0.297555,-0.348827,0.947111,-0.159246,-0.278573,0.880184,-0.071841,-0.469100,\n\t\t\t         -0.643422,-0.135228,0.753441,-0.745079,-0.031739,0.666189,-0.763390,-0.023408,0.645466,-0.671987,-0.135105,0.728111,\n\t\t\t         -0.626576,0.772393,-0.103763,-0.846339,0.480575,0.229652,-0.830805,0.527757,0.176580,-0.591754,0.797113,-0.119938,\n\t\t\t         0.632466,0.089877,-0.769311,0.744652,-0.033509,-0.666585,0.796930,0.056856,-0.601337,0.678549,0.184179,-0.711081,\n\t\t\t         0.357341,-0.213141,0.909299,0.762688,0.009735,0.646687,0.880703,-0.202612,0.428053,0.588397,-0.297189,0.751946,\n\t\t\t         0.780663,-0.624561,-0.020966,0.799554,-0.208594,-0.563189,0.696921,-0.318125,-0.642720,0.728050,-0.685476,-0.003540,\n\t\t\t         0.638478,-0.496048,0.588427,0.642170,-0.388409,0.660848,0.396771,-0.374035,0.838221,0.389386,-0.475570,0.788781,\n\t\t\t         0.584307,-0.663350,0.467422,0.612690,-0.593951,0.521317,0.354259,-0.600543,0.716788,0.305490,-0.689016,0.657186,\n\t\t\t         0.121830,-0.822535,0.555467,0.064425,-0.836604,0.543992,0.013184,-0.991028,0.132817,0.075350,-0.979766,0.185339,\n\t\t\t         0.315500,-0.910581,0.266915,0.197455,-0.793298,0.575884,0.143071,-0.814386,0.562365,0.211005,-0.948820,0.234901,\n\t\t\t         0.305490,-0.689016,0.657186,0.280496,-0.720328,0.634358,0.553850,-0.708182,0.437819,0.584307,-0.663350,0.467422,\n\t\t\t         0.389386,-0.475570,0.788781,0.354259,-0.600543,0.716788,0.612690,-0.593951,0.521317,0.638478,-0.496048,0.588427,\n\t\t\t         0.396771,-0.374035,0.838221,0.642170,-0.388409,0.660848,0.629017,-0.234382,0.741172,0.381787,-0.236000,0.893582,\n\t\t\t         0.381787,-0.236000,0.893582,0.629017,-0.234382,0.741172,0.600299,-0.083468,0.795373,0.357860,-0.118351,0.926237,\n\t\t\t         0.357860,-0.118351,0.926237,0.600299,-0.083468,0.795373,0.551073,0.084353,0.830134,0.326579,-0.032136,0.944609,\n\t\t\t         0.326579,-0.032136,0.944609,0.551073,0.084353,0.830134,0.474868,0.255531,0.842097,0.262978,0.098056,0.959777,\n\t\t\t         0.262978,0.098056,0.959777,0.474868,0.255531,0.842097,0.323160,0.465773,0.823756,0.140934,0.255593,0.956450,\n\t\t\t         0.140934,0.255593,0.956450,0.323160,0.465773,0.823756,0.136509,0.637715,0.758049,0.030000,0.365001,0.930509,\n\t\t\t         -0.041810,0.401959,0.914670,-0.014222,0.720298,0.693503,0.000000,0.726493,0.687124,0.000000,0.392804,0.919614,\n\t\t\t         0.064425,-0.836604,0.543992,0.000000,-0.846309,0.532640,0.000000,-0.992492,0.122135,0.013184,-0.991028,0.132817,\n\t\t\t         0.121830,-0.822535,0.555467,0.075350,-0.979766,0.185339,0.211005,-0.948820,0.234901,0.143071,-0.814386,0.562365,\n\t\t\t         0.200842,-0.789117,0.580432,0.197455,-0.793298,0.575884,0.315500,-0.910581,0.266915,0.342265,-0.898648,0.274270,\n\t\t\t         0.280496,-0.720328,0.634358,0.233283,-0.763451,0.602252,0.478439,-0.790460,0.382427,0.553850,-0.708182,0.437819,\n\t\t\t         -0.024293,0.397504,0.917264,0.033082,0.701346,0.712027,-0.014222,0.720298,0.693503,-0.041810,0.401959,0.914670,\n\t\t\t         0.030000,0.365001,0.930509,0.136509,0.637715,0.758049,0.033082,0.701346,0.712027,-0.024293,0.397504,0.917264,\n\t\t\t         -0.000397,-0.821314,0.570452,-0.007904,-0.825953,0.563616,-0.047792,-0.796472,0.602771,-0.000153,-0.779839,0.625935,\n\t\t\t         -0.007904,-0.825953,0.563616,0.051057,-0.829005,0.556871,0.040254,-0.806665,0.589587,-0.047792,-0.796472,0.602771,\n\t\t\t         -0.000763,-0.855403,0.517899,-0.000855,-0.900845,0.434065,-0.051456,-0.874927,0.481513,-0.033082,-0.848720,0.527787,\n\t\t\t         -0.000855,-0.900845,0.434065,-0.000903,-0.939453,0.342676,-0.051456,-0.874927,0.481513,-0.000641,-0.850124,0.526536,\n\t\t\t         -0.000763,-0.855403,0.517899,-0.033082,-0.848720,0.527787,-0.009949,-0.843257,0.537370,-0.000397,-0.821314,0.570452,\n\t\t\t         -0.000641,-0.850124,0.526536,-0.009949,-0.843257,0.537370,-0.007904,-0.825953,0.563616,0.500687,-0.759728,0.414777,\n\t\t\t         0.565172,-0.675222,0.473952,0.553850,-0.708182,0.437819,0.478439,-0.790460,0.382427,-0.007904,-0.825953,0.563616,\n\t\t\t         -0.009949,-0.843257,0.537370,0.051454,-0.831507,0.553087,0.051057,-0.829005,0.556871,0.153043,-0.736819,0.658540,\n\t\t\t         0.141453,-0.773949,0.617176,0.113086,-0.779923,0.615575,-0.033082,-0.848720,0.527787,-0.051456,-0.874927,0.481513,\n\t\t\t         0.002388,-0.839327,0.543622,-0.009949,-0.843257,0.537370,-0.033082,-0.848720,0.527787,0.002388,-0.839327,0.543622,\n\t\t\t         0.051454,-0.831507,0.553087,0.141453,-0.773949,0.617176,-0.009674,-0.810541,0.585559,0.040254,-0.806665,0.589587,\n\t\t\t         0.113086,-0.779923,0.615575,0.207709,-0.952605,0.222144,0.350414,-0.901730,0.253121,0.315500,-0.910581,0.266915,\n\t\t\t         0.211005,-0.948820,0.234901,-0.029298,-0.991974,0.122837,0.207709,-0.952605,0.222144,0.211005,-0.948820,0.234901,\n\t\t\t         0.075350,-0.979766,0.185339,0.350414,-0.901730,0.253121,0.350017,-0.898740,0.263985,0.342265,-0.898648,0.274270,\n\t\t\t         0.315500,-0.910581,0.266915,0.582446,-0.645955,0.493393,0.627853,-0.589570,0.508142,0.612690,-0.593951,0.521317,\n\t\t\t         0.584307,-0.663350,0.467422,0.642551,0.135633,0.754143,0.565883,0.315543,0.761715,0.474868,0.255531,0.842097,\n\t\t\t         0.551073,0.084353,0.830134,0.065376,0.810631,0.581896,0.003177,0.833399,0.552663,-0.014222,0.720298,0.693503,\n\t\t\t         0.033082,0.701346,0.712027,0.695757,-0.064374,0.715387,0.642551,0.135633,0.754143,0.551073,0.084353,0.830134,\n\t\t\t         0.600299,-0.083468,0.795373,0.003177,0.833399,0.552663,-0.000001,0.839364,0.543569,0.000000,0.726493,0.687124,\n\t\t\t         -0.014222,0.720298,0.693503,0.033082,0.701346,0.712027,0.136509,0.637715,0.758049,0.185384,0.738880,0.647835,\n\t\t\t         0.065376,0.810631,0.581896,0.721926,-0.237896,0.649791,0.695757,-0.064374,0.715387,0.600299,-0.083468,0.795373,\n\t\t\t         0.629017,-0.234382,0.741172,0.725694,-0.496555,0.476236,0.730320,-0.393808,0.558165,0.642170,-0.388409,0.660848,\n\t\t\t         0.638478,-0.496048,0.588427,0.416112,0.526954,0.741060,0.185384,0.738880,0.647835,0.136509,0.637715,0.758049,\n\t\t\t         0.323160,0.465773,0.823756,0.730320,-0.393808,0.558165,0.721926,-0.237896,0.649791,0.629017,-0.234382,0.741172,\n\t\t\t         0.642170,-0.388409,0.660848,0.565883,0.315543,0.761715,0.416112,0.526954,0.741060,0.323160,0.465773,0.823756,\n\t\t\t         0.474868,0.255531,0.842097,0.429106,-0.695836,0.575917,0.460718,-0.663041,0.590013,0.565172,-0.675222,0.473952,\n\t\t\t         0.500687,-0.759728,0.414777,0.180059,-0.853664,0.488662,0.250496,-0.818628,0.516739,0.350414,-0.901730,0.253121,\n\t\t\t         0.207709,-0.952605,0.222144,-0.067537,-0.907407,0.414716,0.180059,-0.853664,0.488662,0.207709,-0.952605,0.222144,\n\t\t\t         -0.029298,-0.991974,0.122837,0.250496,-0.818628,0.516739,0.243348,-0.808589,0.535692,0.350017,-0.898740,0.263985,\n\t\t\t         0.350414,-0.901730,0.253121,0.584307,-0.663350,0.467422,0.553850,-0.708182,0.437819,0.565172,-0.675222,0.473952,\n\t\t\t         0.582446,-0.645955,0.493393,0.466967,-0.633996,0.616433,0.468653,-0.611472,0.637547,0.627853,-0.589570,0.508142,\n\t\t\t         0.582446,-0.645955,0.493393,0.153043,-0.736819,0.658540,0.147405,-0.723643,0.674250,0.243348,-0.808589,0.535692,\n\t\t\t         0.250496,-0.818628,0.516739,0.582446,-0.645955,0.493393,0.565172,-0.675222,0.473952,0.460718,-0.663041,0.590013,\n\t\t\t         0.466967,-0.633996,0.616433,-0.009674,-0.810541,0.585559,0.141453,-0.773949,0.617176,0.180059,-0.853664,0.488662,\n\t\t\t         -0.067537,-0.907407,0.414716,0.141453,-0.773949,0.617176,0.153043,-0.736819,0.658540,0.250496,-0.818628,0.516739,\n\t\t\t         0.180059,-0.853664,0.488662,0.725694,-0.496555,0.476236,0.638478,-0.496048,0.588427,0.612690,-0.593951,0.521317,\n\t\t\t         0.627853,-0.589570,0.508142,0.013184,-0.991028,0.132817,0.000000,-0.992492,0.122135,0.000000,-0.999268,0.037477,\n\t\t\t         -0.073946,-0.995788,0.053865,-0.073946,-0.995788,0.053865,0.000000,-0.999268,0.037477,0.000000,-0.911313,0.411695,\n\t\t\t         -0.134983,-0.901822,0.410413,-0.113285,-0.790643,0.601672,-0.000031,-0.776360,0.630238,-0.000153,-0.779839,0.625935,\n\t\t\t         -0.047792,-0.796472,0.602771,0.113086,-0.779923,0.615575,0.040254,-0.806665,0.589587,0.051057,-0.829005,0.556871,\n\t\t\t         0.051454,-0.831507,0.553087,0.002388,-0.839327,0.543622,-0.029298,-0.991974,0.122837,0.075350,-0.979766,0.185339,\n\t\t\t         0.013184,-0.991028,0.132817,-0.073946,-0.995788,0.053865,-0.134983,-0.901822,0.410413,-0.067537,-0.907407,0.414716,\n\t\t\t         -0.029298,-0.991974,0.122837,-0.073946,-0.995788,0.053865,-0.067537,-0.907407,0.414716,-0.134983,-0.901822,0.410413,\n\t\t\t         -0.113285,-0.790643,0.601672,-0.009674,-0.810541,0.585559,-0.009674,-0.810541,0.585559,-0.113285,-0.790643,0.601672,\n\t\t\t         -0.047792,-0.796472,0.602771,0.040254,-0.806665,0.589587,0.418622,-0.847468,0.326365,0.500687,-0.759728,0.414777,\n\t\t\t         0.478439,-0.790460,0.382427,0.392193,-0.867183,0.306803,0.392193,-0.867183,0.306803,0.478439,-0.790460,0.382427,\n\t\t\t         0.233283,-0.763451,0.602252,0.190680,-0.797632,0.572161,0.354589,-0.802741,0.479451,0.429106,-0.695836,0.575917,\n\t\t\t         0.500687,-0.759728,0.414777,0.418622,-0.847468,0.326365,0.350017,-0.898740,0.263985,0.418622,-0.847468,0.326365,\n\t\t\t         0.392193,-0.867183,0.306803,0.342265,-0.898648,0.274270,0.342265,-0.898648,0.274270,0.392193,-0.867183,0.306803,\n\t\t\t         0.190680,-0.797632,0.572161,0.200842,-0.789117,0.580432,0.243348,-0.808589,0.535692,0.354589,-0.802741,0.479451,\n\t\t\t         0.418622,-0.847468,0.326365,0.350017,-0.898740,0.263985,-0.134983,-0.901822,0.410413,0.000000,-0.911313,0.411695,\n\t\t\t         -0.000031,-0.776360,0.630238,-0.113285,-0.790643,0.601672,-0.638478,-0.496048,0.588427,-0.389386,-0.475570,0.788781,\n\t\t\t         -0.396771,-0.374035,0.838221,-0.642170,-0.388409,0.660848,-0.584307,-0.663350,0.467422,-0.305490,-0.689016,0.657186,\n\t\t\t         -0.354259,-0.600543,0.716788,-0.612690,-0.593951,0.521317,-0.121830,-0.822535,0.555467,-0.075350,-0.979766,0.185339,\n\t\t\t         -0.013184,-0.991028,0.132817,-0.064425,-0.836604,0.543992,-0.315500,-0.910581,0.266915,-0.211005,-0.948820,0.234901,\n\t\t\t         -0.143071,-0.814386,0.562365,-0.197455,-0.793298,0.575884,-0.305490,-0.689016,0.657186,-0.584307,-0.663350,0.467422,\n\t\t\t         -0.553850,-0.708182,0.437819,-0.280496,-0.720328,0.634358,-0.389386,-0.475570,0.788781,-0.638478,-0.496048,0.588427,\n\t\t\t         -0.612690,-0.593951,0.521317,-0.354259,-0.600543,0.716788,-0.396771,-0.374035,0.838221,-0.381787,-0.236000,0.893582,\n\t\t\t         -0.629017,-0.234413,0.741172,-0.642170,-0.388409,0.660848,-0.381787,-0.236000,0.893582,-0.357860,-0.118381,0.926237,\n\t\t\t         -0.600299,-0.083468,0.795373,-0.629017,-0.234413,0.741172,-0.357860,-0.118381,0.926237,-0.326579,-0.032136,0.944609,\n\t\t\t         -0.551073,0.084353,0.830134,-0.600299,-0.083468,0.795373,-0.326579,-0.032136,0.944609,-0.262978,0.098056,0.959777,\n\t\t\t         -0.474868,0.255531,0.842097,-0.551073,0.084353,0.830134,-0.262978,0.098056,0.959777,-0.140904,0.255593,0.956450,\n\t\t\t         -0.323160,0.465773,0.823756,-0.474868,0.255531,0.842097,-0.140904,0.255593,0.956450,-0.030000,0.365001,0.930509,\n\t\t\t         -0.136509,0.637715,0.758049,-0.323160,0.465773,0.823756,0.041810,0.401959,0.914670,0.000000,0.392804,0.919614,\n\t\t\t         0.000000,0.726493,0.687124,0.014252,0.720298,0.693503,-0.064425,-0.836604,0.543992,-0.013184,-0.991028,0.132817,\n\t\t\t         0.000000,-0.992492,0.122135,0.000000,-0.846309,0.532640,-0.121830,-0.822535,0.555467,-0.143071,-0.814386,0.562365,\n\t\t\t         -0.211005,-0.948820,0.234901,-0.075350,-0.979766,0.185339,-0.200842,-0.789117,0.580432,-0.342265,-0.898648,0.274270,\n\t\t\t         -0.315500,-0.910581,0.266915,-0.197455,-0.793298,0.575884,-0.280496,-0.720328,0.634358,-0.553850,-0.708182,0.437819,\n\t\t\t         -0.478439,-0.790460,0.382427,-0.233283,-0.763451,0.602252,0.024293,0.397504,0.917264,0.041810,0.401959,0.914670,\n\t\t\t         0.014252,0.720298,0.693503,-0.033082,0.701346,0.712027,-0.030000,0.365001,0.930509,0.024293,0.397504,0.917264,\n\t\t\t         -0.033082,0.701346,0.712027,-0.136509,0.637715,0.758049,-0.104908,-0.772034,0.626864,-0.059921,-0.812850,0.579382,\n\t\t\t         -0.032441,-0.822413,0.567949,-0.036195,-0.802881,0.594989,-0.000397,-0.821314,0.570452,-0.000153,-0.779839,0.625935,\n\t\t\t         0.047487,-0.796686,0.602496,0.007324,-0.826167,0.563311,0.007324,-0.826167,0.563311,0.047487,-0.796686,0.602496,\n\t\t\t         -0.036195,-0.802881,0.594989,-0.032441,-0.822413,0.567949,-0.000763,-0.855403,0.517899,0.032136,-0.848811,0.527696,\n\t\t\t         0.050144,-0.874982,0.481551,-0.000855,-0.900845,0.434065,-0.000855,-0.900845,0.434065,0.050144,-0.874982,0.481551,\n\t\t\t         -0.000903,-0.939453,0.342676,-0.000641,-0.850124,0.526536,0.009125,-0.843410,0.537156,0.032136,-0.848811,0.527696,\n\t\t\t         -0.000763,-0.855403,0.517899,-0.000397,-0.821314,0.570452,0.007324,-0.826167,0.563311,0.009125,-0.843410,0.537156,\n\t\t\t         -0.000641,-0.850124,0.526536,-0.500687,-0.759728,0.414777,-0.478439,-0.790460,0.382427,-0.553850,-0.708182,0.437819,\n\t\t\t         -0.565172,-0.675222,0.473952,0.007324,-0.826167,0.563311,-0.032441,-0.822413,0.567949,-0.014365,-0.829932,0.557680,\n\t\t\t         0.009125,-0.843410,0.537156,-0.141804,-0.739120,0.658478,-0.113471,-0.745673,0.656579,-0.104908,-0.772034,0.626864,\n\t\t\t         -0.140629,-0.773980,0.617389,0.032136,-0.848811,0.527696,0.014856,-0.841215,0.540496,0.050144,-0.874982,0.481551,\n\t\t\t         0.009125,-0.843410,0.537156,-0.014365,-0.829932,0.557680,0.014856,-0.841215,0.540496,0.032136,-0.848811,0.527696,\n\t\t\t         -0.140629,-0.773980,0.617389,-0.104908,-0.772034,0.626864,-0.036195,-0.802881,0.594989,0.009583,-0.810663,0.585376,\n\t\t\t         -0.207709,-0.952605,0.222144,-0.211005,-0.948820,0.234901,-0.315500,-0.910581,0.266915,-0.350414,-0.901730,0.253121,\n\t\t\t         0.029298,-0.991974,0.122837,-0.075350,-0.979766,0.185339,-0.211005,-0.948820,0.234901,-0.207709,-0.952605,0.222144,\n\t\t\t         -0.350414,-0.901730,0.253121,-0.315500,-0.910581,0.266915,-0.342265,-0.898648,0.274270,-0.350017,-0.898740,0.263985,\n\t\t\t         -0.607104,-0.650966,0.455707,-0.584307,-0.663350,0.467422,-0.612690,-0.593951,0.521317,-0.712534,-0.563663,0.417827,\n\t\t\t         -0.642549,0.135634,0.754145,-0.551073,0.084353,0.830134,-0.474868,0.255531,0.842097,-0.565879,0.315544,0.761717,\n\t\t\t         -0.065373,0.810631,0.581896,-0.033082,0.701346,0.712027,0.014252,0.720298,0.693503,-0.003177,0.833399,0.552663,\n\t\t\t         -0.695757,-0.064374,0.715387,-0.600299,-0.083468,0.795373,-0.551073,0.084353,0.830134,-0.642549,0.135634,0.754145,\n\t\t\t         -0.003177,0.833399,0.552663,0.014252,0.720298,0.693503,0.000000,0.726493,0.687124,-0.000001,0.839364,0.543569,\n\t\t\t         -0.033082,0.701346,0.712027,-0.065373,0.810631,0.581896,-0.185384,0.738880,0.647835,-0.136509,0.637715,0.758049,\n\t\t\t         -0.721926,-0.237896,0.649791,-0.629017,-0.234413,0.741172,-0.600299,-0.083468,0.795373,-0.695757,-0.064374,0.715387,\n\t\t\t         -0.725693,-0.496556,0.476237,-0.638478,-0.496048,0.588427,-0.642170,-0.388409,0.660848,-0.730319,-0.393808,0.558165,\n\t\t\t         -0.416110,0.526954,0.741061,-0.323160,0.465773,0.823756,-0.136509,0.637715,0.758049,-0.185384,0.738880,0.647835,\n\t\t\t         -0.730319,-0.393808,0.558165,-0.642170,-0.388409,0.660848,-0.629017,-0.234413,0.741172,-0.721926,-0.237896,0.649791,\n\t\t\t         -0.565879,0.315544,0.761717,-0.474868,0.255531,0.842097,-0.323160,0.465773,0.823756,-0.416110,0.526954,0.741061,\n\t\t\t         -0.429106,-0.695836,0.575917,-0.500687,-0.759728,0.414777,-0.565172,-0.675222,0.473952,-0.460718,-0.663041,0.590013,\n\t\t\t         -0.180059,-0.853664,0.488662,-0.207709,-0.952605,0.222144,-0.350414,-0.901730,0.253121,-0.250496,-0.818628,0.516739,\n\t\t\t         0.067537,-0.907407,0.414716,0.029298,-0.991974,0.122837,-0.207709,-0.952605,0.222144,-0.180059,-0.853664,0.488662,\n\t\t\t         -0.250496,-0.818628,0.516739,-0.350414,-0.901730,0.253121,-0.350017,-0.898740,0.263985,-0.243349,-0.808588,0.535692,\n\t\t\t         -0.584307,-0.663350,0.467422,-0.607104,-0.650966,0.455707,-0.565172,-0.675222,0.473952,-0.553850,-0.708182,0.437819,\n\t\t\t         -0.141804,-0.739120,0.658478,-0.250496,-0.818628,0.516739,-0.243349,-0.808588,0.535692,-0.147407,-0.723643,0.674249,\n\t\t\t         -0.607104,-0.650966,0.455707,-0.462780,-0.673221,0.576722,-0.460718,-0.663041,0.590013,-0.565172,-0.675222,0.473952,\n\t\t\t         0.009583,-0.810663,0.585376,0.067537,-0.907407,0.414716,-0.180059,-0.853664,0.488662,-0.140629,-0.773980,0.617389,\n\t\t\t         -0.140629,-0.773980,0.617389,-0.180059,-0.853664,0.488662,-0.250496,-0.818628,0.516739,-0.141804,-0.739120,0.658478,\n\t\t\t         -0.725693,-0.496556,0.476237,-0.712534,-0.563663,0.417827,-0.612690,-0.593951,0.521317,-0.638478,-0.496048,0.588427,\n\t\t\t         -0.013184,-0.991028,0.132817,0.073946,-0.995788,0.053865,0.000000,-0.999268,0.037477,0.000000,-0.992492,0.122135,\n\t\t\t         0.073946,-0.995788,0.053865,0.134983,-0.901822,0.410413,0.000000,-0.911313,0.411695,0.000000,-0.999268,0.037477,\n\t\t\t         0.113224,-0.790704,0.601581,0.047487,-0.796686,0.602496,-0.000153,-0.779839,0.625935,-0.000031,-0.776360,0.630238,\n\t\t\t         -0.032441,-0.822413,0.567949,-0.059921,-0.812850,0.579382,-0.037738,-0.815893,0.576970,-0.014365,-0.829932,0.557680,\n\t\t\t         0.029298,-0.991974,0.122837,0.073946,-0.995788,0.053865,-0.013184,-0.991028,0.132817,-0.075350,-0.979766,0.185339,\n\t\t\t         0.134983,-0.901822,0.410413,0.073946,-0.995788,0.053865,0.029298,-0.991974,0.122837,0.067537,-0.907407,0.414716,\n\t\t\t         0.067537,-0.907407,0.414716,0.009583,-0.810663,0.585376,0.113224,-0.790704,0.601581,0.134983,-0.901822,0.410413,\n\t\t\t         0.009583,-0.810663,0.585376,-0.036195,-0.802881,0.594989,0.047487,-0.796686,0.602496,0.113224,-0.790704,0.601581,\n\t\t\t         -0.418622,-0.847468,0.326365,-0.392193,-0.867183,0.306803,-0.478439,-0.790460,0.382427,-0.500687,-0.759728,0.414777,\n\t\t\t         -0.392193,-0.867183,0.306803,-0.190680,-0.797632,0.572161,-0.233283,-0.763451,0.602252,-0.478439,-0.790460,0.382427,\n\t\t\t         -0.354590,-0.802741,0.479451,-0.418622,-0.847468,0.326365,-0.500687,-0.759728,0.414777,-0.429106,-0.695836,0.575917,\n\t\t\t         -0.350017,-0.898740,0.263985,-0.342265,-0.898648,0.274270,-0.392193,-0.867183,0.306803,-0.418622,-0.847468,0.326365,\n\t\t\t         -0.342265,-0.898648,0.274270,-0.200842,-0.789117,0.580432,-0.190680,-0.797632,0.572161,-0.392193,-0.867183,0.306803,\n\t\t\t         -0.243349,-0.808588,0.535692,-0.350017,-0.898740,0.263985,-0.418622,-0.847468,0.326365,-0.354590,-0.802741,0.479451,\n\t\t\t         0.041810,0.401959,0.914670,0.024293,0.397504,0.917264,0.000000,-0.323466,0.946226,-0.024293,0.397504,0.917264,\n\t\t\t         -0.041810,0.401959,0.914670,0.000000,-0.323466,0.946226,0.354259,-0.600543,0.716788,0.389386,-0.475570,0.788781,\n\t\t\t         0.000000,-0.323466,0.946226,-0.030000,0.365001,0.930509,-0.140904,0.255593,0.956450,0.000000,-0.323466,0.946226,\n\t\t\t         -0.357860,-0.118381,0.926237,-0.381787,-0.236000,0.893582,0.000000,-0.323466,0.946226,-0.190680,-0.797632,0.572161,\n\t\t\t         -0.200842,-0.789117,0.580432,0.000000,-0.323466,0.946226,-0.305490,-0.689016,0.657186,-0.280496,-0.720328,0.634358,\n\t\t\t         0.000000,-0.323466,0.946226,0.389386,-0.475570,0.788781,0.396771,-0.374035,0.838221,0.000000,-0.323466,0.946226,\n\t\t\t         0.121830,-0.822535,0.555467,0.143071,-0.814386,0.562365,0.000000,-0.323466,0.946226,-0.140904,0.255593,0.956450,\n\t\t\t         -0.262978,0.098056,0.959777,0.000000,-0.323466,0.946226,-0.354259,-0.600543,0.716788,-0.305490,-0.689016,0.657186,\n\t\t\t         0.000000,-0.323466,0.946226,0.140934,0.255593,0.956450,0.030000,0.365001,0.930509,0.000000,-0.323466,0.946226,\n\t\t\t         0.326579,-0.032136,0.944609,0.262978,0.098056,0.959777,0.000000,-0.323466,0.946226,0.357860,-0.118351,0.926237,\n\t\t\t         0.326579,-0.032136,0.944609,0.000000,-0.323466,0.946226,-0.396771,-0.374035,0.838221,-0.389386,-0.475570,0.788781,\n\t\t\t         0.000000,-0.323466,0.946226,0.143071,-0.814386,0.562365,0.197455,-0.793298,0.575884,0.000000,-0.323466,0.946226,\n\t\t\t         -0.381787,-0.236000,0.893582,-0.396771,-0.374035,0.838221,0.000000,-0.323466,0.946226,-0.041810,0.401959,0.914670,\n\t\t\t         0.000000,0.392804,0.919614,0.000000,-0.323466,0.946226,0.024293,0.397504,0.917264,-0.030000,0.365001,0.930509,\n\t\t\t         0.000000,-0.323466,0.946226,0.305490,-0.689016,0.657186,0.354259,-0.600543,0.716788,0.000000,-0.323466,0.946226,\n\t\t\t         -0.064425,-0.836604,0.543992,0.000000,-0.846309,0.532640,0.000000,-0.323466,0.946226,0.200842,-0.789117,0.580432,\n\t\t\t         0.190680,-0.797632,0.572161,0.000000,-0.323466,0.946226,-0.200842,-0.789117,0.580432,-0.197455,-0.793298,0.575884,\n\t\t\t         0.000000,-0.323466,0.946226,0.000000,-0.846309,0.532640,0.064425,-0.836604,0.543992,0.000000,-0.323466,0.946226,\n\t\t\t         0.381787,-0.236000,0.893582,0.357860,-0.118351,0.926237,0.000000,-0.323466,0.946226,-0.233283,-0.763451,0.602252,\n\t\t\t         -0.190680,-0.797632,0.572161,0.000000,-0.323466,0.946226,0.030000,0.365001,0.930509,-0.024293,0.397504,0.917264,\n\t\t\t         0.000000,-0.323466,0.946226,0.233283,-0.763451,0.602252,0.280496,-0.720328,0.634358,0.000000,-0.323466,0.946226,\n\t\t\t         -0.121830,-0.822535,0.555467,-0.064425,-0.836604,0.543992,0.000000,-0.323466,0.946226,-0.197455,-0.793298,0.575884,\n\t\t\t         -0.143071,-0.814386,0.562365,0.000000,-0.323466,0.946226,-0.389386,-0.475570,0.788781,-0.354259,-0.600543,0.716788,\n\t\t\t         0.000000,-0.323466,0.946226,-0.326579,-0.032136,0.944609,-0.357860,-0.118381,0.926237,0.000000,-0.323466,0.946226,\n\t\t\t         0.280496,-0.720328,0.634358,0.305490,-0.689016,0.657186,0.000000,-0.323466,0.946226,0.262978,0.098056,0.959777,\n\t\t\t         0.140934,0.255593,0.956450,0.000000,-0.323466,0.946226,0.396771,-0.374035,0.838221,0.381787,-0.236000,0.893582,\n\t\t\t         0.000000,-0.323466,0.946226,0.190680,-0.797632,0.572161,0.233283,-0.763451,0.602252,0.000000,-0.323466,0.946226,\n\t\t\t         0.197455,-0.793298,0.575884,0.200842,-0.789117,0.580432,0.000000,-0.323466,0.946226,0.000000,0.392804,0.919614,\n\t\t\t         0.041810,0.401959,0.914670,0.000000,-0.323466,0.946226,-0.280496,-0.720328,0.634358,-0.233283,-0.763451,0.602252,\n\t\t\t         0.000000,-0.323466,0.946226,0.064425,-0.836604,0.543992,0.121830,-0.822535,0.555467,0.000000,-0.323466,0.946226,\n\t\t\t         -0.262978,0.098056,0.959777,-0.326579,-0.032136,0.944609,0.000000,-0.323466,0.946226,-0.143071,-0.814386,0.562365,\n\t\t\t         -0.121830,-0.822535,0.555467,0.000000,-0.323466,0.946226,0.134983,-0.901822,0.410413,0.113224,-0.790704,0.601581,\n\t\t\t         -0.000031,-0.776360,0.630238,0.000000,-0.911313,0.411695,0.531266,0.760125,0.374004,0.424055,0.851161,0.309275,\n\t\t\t         0.433332,0.819819,0.374218,0.506821,0.799646,0.321970,0.506821,0.799646,0.321970,0.433332,0.819819,0.374218,\n\t\t\t         0.450667,0.886868,0.101779,0.490036,0.870205,0.050783,0.424055,0.851161,0.309275,0.230140,0.919645,0.318217,\n\t\t\t         0.201575,0.897366,0.392499,0.433332,0.819819,0.374218,0.433332,0.819819,0.374218,0.201575,0.897366,0.392499,\n\t\t\t         0.254677,0.960143,0.115055,0.450667,0.886868,0.101779,0.531266,0.760125,0.374004,0.506821,0.799646,0.321970,\n\t\t\t         0.469588,0.798242,0.377148,0.461837,0.811151,0.358715,0.461837,0.811151,0.358715,0.469588,0.798242,0.377148,\n\t\t\t         0.586749,0.749382,0.306772,0.445662,0.854976,0.265236,0.506821,0.799646,0.321970,0.490036,0.870205,0.050783,\n\t\t\t         0.544359,0.829768,0.122959,0.469588,0.798242,0.377148,0.469588,0.798242,0.377148,0.544359,0.829768,0.122959,\n\t\t\t         0.750908,0.656148,0.074709,0.586749,0.749382,0.306772,0.531266,0.760125,0.374004,0.461837,0.811151,0.358715,\n\t\t\t         0.451674,0.861141,0.233161,0.424055,0.851161,0.309275,0.424055,0.851161,0.309275,0.451674,0.861141,0.233161,\n\t\t\t         0.269723,0.939695,0.210211,0.230140,0.919645,0.318217,0.461837,0.811151,0.358715,0.445662,0.854976,0.265236,\n\t\t\t         0.468062,0.865627,0.177618,0.451674,0.861141,0.233161,0.451674,0.861141,0.233161,0.468062,0.865627,0.177618,\n\t\t\t         0.300699,0.949553,0.088626,0.269723,0.939695,0.210211,0.941038,0.206610,0.267830,0.958220,0.234077,0.164190,\n\t\t\t         0.963805,0.101962,0.246254,0.954405,0.034211,0.296487,0.954405,0.034211,0.296487,0.963805,0.101962,0.246254,\n\t\t\t         0.951659,-0.167364,0.257485,0.930296,-0.235725,0.280984,0.958220,0.234077,0.164190,0.966460,0.240333,0.090274,\n\t\t\t         0.987762,0.107425,0.112827,0.963805,0.101962,0.246254,0.963805,0.101962,0.246254,0.987762,0.107425,0.112827,\n\t\t\t         0.987274,-0.125431,0.097598,0.951659,-0.167364,0.257485,0.941038,0.206610,0.267830,0.954405,0.034211,0.296487,\n\t\t\t         0.998230,0.001099,0.059328,0.968047,0.246254,0.046999,0.968047,0.246254,0.046999,0.998230,0.001099,0.059328,\n\t\t\t         0.996338,0.080294,-0.028504,0.969420,0.245277,-0.000305,0.954405,0.034211,0.296487,0.930296,-0.235725,0.280984,\n\t\t\t         0.979888,-0.198218,0.022187,0.998230,0.001099,0.059328,0.998230,0.001099,0.059328,0.979888,-0.198218,0.022187,\n\t\t\t         0.985931,-0.164281,0.030183,0.996338,0.080294,-0.028504,0.941038,0.206610,0.267830,0.968047,0.246254,0.046999,\n\t\t\t         0.916593,0.397809,0.039583,0.878689,0.439192,0.186956,0.878689,0.439192,0.186956,0.916593,0.397809,0.039583,\n\t\t\t         0.800226,0.597430,-0.051637,0.800928,0.585284,0.126102,0.968047,0.246254,0.046999,0.969420,0.245277,-0.000305,\n\t\t\t         0.917020,0.397748,-0.028901,0.916593,0.397809,0.039583,0.916593,0.397809,0.039583,0.917020,0.397748,-0.028901,\n\t\t\t         0.830866,0.556383,0.007538,0.800226,0.597430,-0.051637,0.941038,0.206610,0.267830,0.878689,0.439192,0.186956,\n\t\t\t         0.893948,0.405499,0.190710,0.958220,0.234077,0.164190,0.958220,0.234077,0.164190,0.893948,0.405499,0.190710,\n\t\t\t         0.907712,0.413251,0.072420,0.966460,0.240333,0.090274,0.878689,0.439192,0.186956,0.800928,0.585284,0.126102,\n\t\t\t         0.826014,0.530320,0.190863,0.893948,0.405499,0.190710,0.893948,0.405499,0.190710,0.826014,0.530320,0.190863,\n\t\t\t         0.750908,0.656148,0.074709,0.907712,0.413251,0.072420,0.965300,0.240028,0.102725,0.966369,0.239509,0.093570,\n\t\t\t         0.993194,0.055452,0.102390,0.992462,0.050325,0.111515,0.992462,0.050325,0.111515,0.993194,0.055452,0.102390,\n\t\t\t         0.983734,-0.140507,0.111698,0.983886,-0.119694,0.132633,0.966369,0.239509,0.093570,0.969420,0.245277,-0.000305,\n\t\t\t         0.996338,0.080294,-0.028504,0.993194,0.055452,0.102390,0.993194,0.055452,0.102390,0.996338,0.080294,-0.028504,\n\t\t\t         0.985931,-0.164281,0.030183,0.983734,-0.140507,0.111698,0.965300,0.240028,0.102725,0.992462,0.050325,0.111515,\n\t\t\t         0.995056,0.040864,0.090274,0.967193,0.239051,0.085818,0.967193,0.239051,0.085818,0.995056,0.040864,0.090274,\n\t\t\t         0.997253,0.016511,0.071902,0.972472,0.215674,0.088076,0.992462,0.050325,0.111515,0.983886,-0.119694,0.132633,\n\t\t\t         0.990295,-0.114963,0.077944,0.995056,0.040864,0.090274,0.995056,0.040864,0.090274,0.990295,-0.114963,0.077944,\n\t\t\t         0.984130,-0.174078,0.033692,0.997253,0.016511,0.071902,0.965300,0.240028,0.102725,0.967193,0.239051,0.085818,\n\t\t\t         0.920621,0.377117,0.100925,0.911588,0.401227,0.089419,0.911588,0.401227,0.089419,0.920621,0.377117,0.100925,\n\t\t\t         0.842036,0.524766,0.124607,0.838252,0.540239,0.073519,0.967193,0.239051,0.085818,0.972472,0.215674,0.088076,\n\t\t\t         0.939238,0.318583,0.127537,0.920621,0.377117,0.100925,0.920621,0.377117,0.100925,0.939238,0.318583,0.127537,\n\t\t\t         0.850368,0.511612,0.122684,0.842036,0.524766,0.124607,0.965300,0.240028,0.102725,0.911588,0.401227,0.089419,\n\t\t\t         0.914029,0.398114,0.077670,0.966369,0.239509,0.093570,0.966369,0.239509,0.093570,0.914029,0.398114,0.077670,\n\t\t\t         0.917020,0.397748,-0.028901,0.969420,0.245277,-0.000305,0.911588,0.401227,0.089419,0.838252,0.540239,0.073519,\n\t\t\t         0.839259,0.539720,0.065432,0.914029,0.398114,0.077670,0.914029,0.398114,0.077670,0.839259,0.539720,0.065432,\n\t\t\t         0.830866,0.556383,0.007538,0.917020,0.397748,-0.028901,0.122288,0.893246,0.432569,0.071108,0.948515,0.308542,\n\t\t\t         -0.045625,0.954344,0.295175,0.127598,0.956236,0.263192,0.127598,0.956236,0.263192,-0.045625,0.954344,0.295175,\n\t\t\t         -0.027772,0.994995,0.095737,0.127598,0.991577,0.021546,0.071108,0.948515,0.308542,-0.021088,0.979369,0.200903,\n\t\t\t         -0.101260,0.951353,0.290963,-0.045625,0.954344,0.295175,-0.045625,0.954344,0.295175,-0.101260,0.951353,0.290963,\n\t\t\t         -0.025819,0.990692,0.133610,-0.027772,0.994995,0.095737,0.122288,0.893246,0.432569,0.127598,0.956236,0.263192,\n\t\t\t         0.126102,0.945311,0.300760,0.121769,0.908597,0.399457,0.121769,0.908597,0.399457,0.126102,0.945311,0.300760,\n\t\t\t         0.201575,0.897366,0.392499,0.230140,0.919645,0.318217,0.127598,0.956236,0.263192,0.127598,0.991577,0.021546,\n\t\t\t         0.161443,0.986755,-0.015137,0.126102,0.945311,0.300760,0.126102,0.945311,0.300760,0.161443,0.986755,-0.015137,\n\t\t\t         0.254677,0.960143,0.115055,0.201575,0.897366,0.392499,0.122288,0.893246,0.432569,0.121769,0.908597,0.399457,\n\t\t\t         0.128056,0.952391,0.276589,0.071108,0.948515,0.308542,0.071108,0.948515,0.308542,0.128056,0.952391,0.276589,\n\t\t\t         0.078372,0.986419,0.144200,-0.021088,0.979369,0.200903,0.121769,0.908597,0.399457,0.230140,0.919645,0.318217,\n\t\t\t         0.269723,0.939695,0.210211,0.128056,0.952391,0.276589,0.128056,0.952391,0.276589,0.269723,0.939695,0.210211,\n\t\t\t         0.300699,0.949553,0.088626,0.078372,0.986419,0.144200,0.185125,-0.982696,0.000122,0.178899,-0.979766,0.089511,\n\t\t\t         0.083621,-0.996368,-0.015625,0.055422,-0.991394,-0.118351,0.055422,-0.991394,-0.118351,0.083621,-0.996368,-0.015625,\n\t\t\t         -0.003204,-0.989380,-0.145177,-0.028504,-0.983428,-0.178991,0.178899,-0.979766,0.089511,0.209021,-0.977020,-0.041383,\n\t\t\t         0.117527,-0.990234,-0.074770,0.083621,-0.996368,-0.015625,0.083621,-0.996368,-0.015625,0.117527,-0.990234,-0.074770,\n\t\t\t         0.033082,-0.980285,-0.194647,-0.003204,-0.989380,-0.145177,0.185125,-0.982696,0.000122,0.055422,-0.991394,-0.118351,\n\t\t\t         0.026093,-0.949126,-0.313791,0.134251,-0.961699,-0.238868,0.134251,-0.961699,-0.238868,0.026093,-0.949126,-0.313791,\n\t\t\t         0.024018,-0.911649,-0.410230,0.073794,-0.935270,-0.346080,0.055422,-0.991394,-0.118351,-0.028504,-0.983428,-0.178991,\n\t\t\t         -0.023957,-0.940336,-0.339305,0.026093,-0.949126,-0.313791,0.026093,-0.949126,-0.313791,-0.023957,-0.940336,-0.339305,\n\t\t\t         -0.012574,-0.914274,-0.404859,0.024018,-0.911649,-0.410230,0.185125,-0.982696,0.000122,0.134251,-0.961699,-0.238868,\n\t\t\t         0.160497,-0.978271,-0.131016,0.186438,-0.978362,0.089511,0.186438,-0.978362,0.089511,0.160497,-0.978271,-0.131016,\n\t\t\t         0.406812,-0.909146,0.088961,0.329264,-0.926328,0.182989,0.134251,-0.961699,-0.238868,0.073794,-0.935270,-0.346080,\n\t\t\t         0.068422,-0.979644,-0.188696,0.160497,-0.978271,-0.131016,0.160497,-0.978271,-0.131016,0.068422,-0.979644,-0.188696,\n\t\t\t         0.341441,-0.939512,-0.026185,0.406812,-0.909146,0.088961,0.185125,-0.982696,0.000122,0.186438,-0.978362,0.089511,\n\t\t\t         0.236396,-0.959624,0.152379,0.178899,-0.979766,0.089511,0.178899,-0.979766,0.089511,0.236396,-0.959624,0.152379,\n\t\t\t         0.279855,-0.959258,0.038636,0.209021,-0.977020,-0.041383,0.186438,-0.978362,0.089511,0.329264,-0.926328,0.182989,\n\t\t\t         0.395428,-0.897763,0.193884,0.236396,-0.959624,0.152379,0.236396,-0.959624,0.152379,0.395428,-0.897763,0.193884,\n\t\t\t         0.476363,-0.879147,0.012513,0.279855,-0.959258,0.038636,-0.136296,0.989807,0.041139,-0.123447,0.989410,0.076174,\n\t\t\t         -0.126408,0.989502,0.070009,-0.104282,0.994263,0.023652,-0.104282,0.994263,0.023652,-0.126408,0.989502,0.070009,\n\t\t\t         0.033692,0.997345,0.064516,0.044038,0.998474,0.032472,-0.123447,0.989410,0.076174,-0.094668,0.995361,0.015381,\n\t\t\t         -0.138188,0.990387,-0.001434,-0.126408,0.989502,0.070009,-0.126408,0.989502,0.070009,-0.138188,0.990387,-0.001434,\n\t\t\t         0.020692,0.999756,-0.005737,0.033692,0.997345,0.064516,-0.136296,0.989807,0.041139,-0.104282,0.994263,0.023652,\n\t\t\t         -0.126774,0.976562,0.173864,-0.092685,0.991974,0.085726,-0.092685,0.991974,0.085726,-0.126774,0.976562,0.173864,\n\t\t\t         -0.101260,0.951353,0.290963,-0.021088,0.979369,0.200903,-0.104282,0.994263,0.023652,0.044038,0.998474,0.032472,\n\t\t\t         0.036164,0.979400,0.198553,-0.126774,0.976562,0.173864,-0.126774,0.976562,0.173864,0.036164,0.979400,0.198553,\n\t\t\t         -0.025819,0.990692,0.133610,-0.101260,0.951353,0.290963,-0.136296,0.989807,0.041139,-0.092685,0.991974,0.085726,\n\t\t\t         -0.020508,0.996063,0.086184,-0.123447,0.989410,0.076174,-0.123447,0.989410,0.076174,-0.020508,0.996063,0.086184,\n\t\t\t         0.047914,0.998077,0.039125,-0.094668,0.995361,0.015381,-0.092685,0.991974,0.085726,-0.021088,0.979369,0.200903,\n\t\t\t         0.078372,0.986419,0.144200,-0.020508,0.996063,0.086184,-0.020508,0.996063,0.086184,0.078372,0.986419,0.144200,\n\t\t\t         0.300699,0.949553,0.088626,0.047914,0.998077,0.039125,0.732292,0.679037,-0.051210,0.688620,0.722068,-0.066225,\n\t\t\t         0.535020,0.842463,0.063234,0.608966,0.786981,0.098849,0.608966,0.786981,0.098849,0.535020,0.842463,0.063234,\n\t\t\t         0.468062,0.865627,0.177618,0.445662,0.854976,0.265236,0.688620,0.722068,-0.066225,0.673605,0.738975,0.010956,\n\t\t\t         0.539415,0.840968,0.042024,0.535020,0.842463,0.063234,0.535020,0.842463,0.063234,0.539415,0.840968,0.042024,\n\t\t\t         0.300699,0.949553,0.088626,0.468062,0.865627,0.177618,0.732292,0.679037,-0.051210,0.608966,0.786981,0.098849,\n\t\t\t         0.769707,0.620106,0.151494,0.825983,0.561052,0.053957,0.825983,0.561052,0.053957,0.769707,0.620106,0.151494,\n\t\t\t         0.826014,0.530320,0.190863,0.800928,0.585284,0.126102,0.608966,0.786981,0.098849,0.445662,0.854976,0.265236,\n\t\t\t         0.586749,0.749382,0.306772,0.769707,0.620106,0.151494,0.769707,0.620106,0.151494,0.586749,0.749382,0.306772,\n\t\t\t         0.750908,0.656148,0.074709,0.826014,0.530320,0.190863,0.732292,0.679037,-0.051210,0.825983,0.561052,0.053957,\n\t\t\t         0.794366,0.605884,-0.042573,0.688620,0.722068,-0.066225,0.688620,0.722068,-0.066225,0.794366,0.605884,-0.042573,\n\t\t\t         0.777978,0.627979,0.018403,0.673605,0.738975,0.010956,0.825983,0.561052,0.053957,0.800928,0.585284,0.126102,\n\t\t\t         0.800226,0.597430,-0.051637,0.794366,0.605884,-0.042573,0.794366,0.605884,-0.042573,0.800226,0.597430,-0.051637,\n\t\t\t         0.830866,0.556383,0.007538,0.777978,0.627979,0.018403,0.637989,0.770012,-0.003632,0.659352,0.751701,0.013123,\n\t\t\t         0.759789,0.648518,0.045717,0.743828,0.667013,0.042177,0.743828,0.667013,0.042177,0.759789,0.648518,0.045717,\n\t\t\t         0.839259,0.539720,0.065432,0.838252,0.540239,0.073519,0.659352,0.751701,0.013123,0.673605,0.738975,0.010956,\n\t\t\t         0.777978,0.627979,0.018403,0.759789,0.648518,0.045717,0.759789,0.648518,0.045717,0.777978,0.627979,0.018403,\n\t\t\t         0.830866,0.556383,0.007538,0.839259,0.539720,0.065432,0.637989,0.770012,-0.003632,0.743828,0.667013,0.042177,\n\t\t\t         0.711997,0.697958,0.076510,0.604053,0.796869,-0.008637,0.604053,0.796869,-0.008637,0.711997,0.697958,0.076510,\n\t\t\t         0.674795,0.737236,0.033052,0.573931,0.817774,-0.042207,0.743828,0.667013,0.042177,0.838252,0.540239,0.073519,\n\t\t\t         0.842036,0.524766,0.124607,0.711997,0.697958,0.076510,0.711997,0.697958,0.076510,0.842036,0.524766,0.124607,\n\t\t\t         0.850368,0.511612,0.122684,0.674795,0.737236,0.033052,0.637989,0.770012,-0.003632,0.604053,0.796869,-0.008637,\n\t\t\t         0.467238,0.880306,-0.082003,0.499893,0.864650,-0.049471,0.499893,0.864650,-0.049471,0.467238,0.880306,-0.082003,\n\t\t\t         0.195868,0.964446,-0.177252,0.281472,0.953734,-0.105441,0.604053,0.796869,-0.008637,0.573931,0.817774,-0.042207,\n\t\t\t         0.439406,0.891354,-0.111057,0.467238,0.880306,-0.082003,0.467238,0.880306,-0.082003,0.439406,0.891354,-0.111057,\n\t\t\t         0.022980,0.952574,-0.303415,0.195868,0.964446,-0.177252,0.637989,0.770012,-0.003632,0.499893,0.864650,-0.049471,\n\t\t\t         0.522507,0.852473,-0.015168,0.659352,0.751701,0.013123,0.659352,0.751701,0.013123,0.522507,0.852473,-0.015168,\n\t\t\t         0.539415,0.840968,0.042024,0.673605,0.738975,0.010956,0.499893,0.864650,-0.049471,0.281472,0.953734,-0.105441,\n\t\t\t         0.311533,0.949248,-0.042879,0.522507,0.852473,-0.015168,0.522507,0.852473,-0.015168,0.311533,0.949248,-0.042879,\n\t\t\t         0.300699,0.949553,0.088626,0.539415,0.840968,0.042024,-0.108463,0.960173,-0.257424,-0.079745,0.988800,-0.125919,\n\t\t\t         0.087985,0.992920,-0.079684,0.049867,0.982086,-0.181646,0.049867,0.982086,-0.181646,0.087985,0.992920,-0.079684,\n\t\t\t         0.311533,0.949248,-0.042879,0.281472,0.953734,-0.105441,-0.079745,0.988800,-0.125919,-0.094668,0.995361,0.015381,\n\t\t\t         0.047914,0.998077,0.039125,0.087985,0.992920,-0.079684,0.087985,0.992920,-0.079684,0.047914,0.998077,0.039125,\n\t\t\t         0.300699,0.949553,0.088626,0.311533,0.949248,-0.042879,-0.108463,0.960173,-0.257424,0.049867,0.982086,-0.181646,\n\t\t\t         -0.058535,0.953551,-0.295419,-0.168859,0.901761,-0.397839,-0.168859,0.901761,-0.397839,-0.058535,0.953551,-0.295419,\n\t\t\t         -0.205298,0.869106,-0.449965,-0.233039,0.802728,-0.548906,0.049867,0.982086,-0.181646,0.281472,0.953734,-0.105441,\n\t\t\t         0.195868,0.964446,-0.177252,-0.058535,0.953551,-0.295419,-0.058535,0.953551,-0.295419,0.195868,0.964446,-0.177252,\n\t\t\t         0.022980,0.952574,-0.303415,-0.205298,0.869106,-0.449965,-0.108463,0.960173,-0.257424,-0.168859,0.901761,-0.397839,\n\t\t\t         -0.157872,0.875332,-0.456984,-0.144047,0.941130,-0.305704,-0.144047,0.941130,-0.305704,-0.157872,0.875332,-0.456984,\n\t\t\t         0.000824,0.871212,-0.490860,0.004822,0.943205,-0.332102,-0.168859,0.901761,-0.397839,-0.233039,0.802728,-0.548906,\n\t\t\t         -0.179998,0.765282,-0.618000,-0.157872,0.875332,-0.456984,-0.157872,0.875332,-0.456984,-0.179998,0.765282,-0.618000,\n\t\t\t         -0.005982,0.726646,-0.686972,0.000824,0.871212,-0.490860,-0.108463,0.960173,-0.257424,-0.144047,0.941130,-0.305704,\n\t\t\t         -0.135746,0.978027,-0.158086,-0.079745,0.988800,-0.125919,-0.079745,0.988800,-0.125919,-0.135746,0.978027,-0.158086,\n\t\t\t         -0.138188,0.990387,-0.001434,-0.094668,0.995361,0.015381,-0.144047,0.941130,-0.305704,0.004822,0.943205,-0.332102,\n\t\t\t         0.010926,0.984313,-0.176061,-0.135746,0.978027,-0.158086,-0.135746,0.978027,-0.158086,0.010926,0.984313,-0.176061,\n\t\t\t         0.020692,0.999756,-0.005737,-0.138188,0.990387,-0.001434,-0.417310,0.605914,-0.677236,-0.612995,0.521195,-0.593768,\n\t\t\t         -0.540269,0.374493,-0.753533,-0.364910,0.488937,-0.792291,-0.364910,0.488937,-0.792291,-0.540269,0.374493,-0.753533,\n\t\t\t         -0.028230,0.327952,-0.944243,-0.043825,0.445662,-0.894101,-0.612995,0.521195,-0.593768,-0.786554,0.449568,-0.423261,\n\t\t\t         -0.754601,0.279824,-0.593493,-0.540269,0.374493,-0.753533,-0.540269,0.374493,-0.753533,-0.754601,0.279824,-0.593493,\n\t\t\t         -0.001495,-0.129490,-0.991546,-0.028230,0.327952,-0.944243,-0.417310,0.605914,-0.677236,-0.364910,0.488937,-0.792291,\n\t\t\t         -0.244911,0.622669,-0.743126,-0.297586,0.695578,-0.653890,-0.297586,0.695578,-0.653890,-0.244911,0.622669,-0.743126,\n\t\t\t         -0.179998,0.765282,-0.618000,-0.233039,0.802728,-0.548906,-0.364910,0.488937,-0.792291,-0.043825,0.445662,-0.894101,\n\t\t\t         -0.036012,0.570574,-0.820429,-0.244911,0.622669,-0.743126,-0.244911,0.622669,-0.743126,-0.036012,0.570574,-0.820429,\n\t\t\t         -0.005982,0.726646,-0.686972,-0.179998,0.765282,-0.618000,-0.417310,0.605914,-0.677236,-0.297586,0.695578,-0.653890,\n\t\t\t         -0.335490,0.755150,-0.563158,-0.447829,0.704001,-0.551164,-0.447829,0.704001,-0.551164,-0.335490,0.755150,-0.563158,\n\t\t\t         -0.354350,0.814386,-0.459517,-0.483902,0.757378,-0.438337,-0.297586,0.695578,-0.653890,-0.233039,0.802728,-0.548906,\n\t\t\t         -0.205298,0.869106,-0.449965,-0.335490,0.755150,-0.563158,-0.335490,0.755150,-0.563158,-0.205298,0.869106,-0.449965,\n\t\t\t         0.022980,0.952574,-0.303415,-0.354350,0.814386,-0.459517,-0.417310,0.605914,-0.677236,-0.447829,0.704001,-0.551164,\n\t\t\t         -0.597308,0.656240,-0.461013,-0.612995,0.521195,-0.593768,-0.612995,0.521195,-0.593768,-0.597308,0.656240,-0.461013,\n\t\t\t         -0.741844,0.578722,-0.338694,-0.786554,0.449568,-0.423261,-0.447829,0.704001,-0.551164,-0.483902,0.757378,-0.438337,\n\t\t\t         -0.564104,0.739921,-0.366405,-0.597308,0.656240,-0.461013,-0.597308,0.656240,-0.461013,-0.564104,0.739921,-0.366405,\n\t\t\t         -0.651662,0.685263,-0.325114,-0.741844,0.578722,-0.338694,-0.369823,-0.641652,-0.671896,-0.523484,-0.638417,-0.564196,\n\t\t\t         -0.439924,-0.818140,-0.370190,-0.295297,-0.771722,-0.563189,-0.295297,-0.771722,-0.563189,-0.439924,-0.818140,-0.370190,\n\t\t\t         -0.364635,-0.912046,-0.187506,-0.127537,-0.910245,-0.393872,-0.523484,-0.638417,-0.564196,-0.706442,-0.638386,-0.305521,\n\t\t\t         -0.609638,-0.783380,-0.120884,-0.439924,-0.818140,-0.370190,-0.439924,-0.818140,-0.370190,-0.609638,-0.783380,-0.120884,\n\t\t\t         -0.408795,-0.910306,-0.064577,-0.364635,-0.912046,-0.187506,-0.369823,-0.641652,-0.671896,-0.295297,-0.771722,-0.563189,\n\t\t\t         -0.146855,-0.714713,-0.683798,-0.211951,-0.604968,-0.767510,-0.211951,-0.604968,-0.767510,-0.146855,-0.714713,-0.683798,\n\t\t\t         -0.000977,-0.690085,-0.723716,-0.001160,-0.577776,-0.816157,-0.295297,-0.771722,-0.563189,-0.127537,-0.910245,-0.393872,\n\t\t\t         -0.085543,-0.847011,-0.524583,-0.146855,-0.714713,-0.683798,-0.146855,-0.714713,-0.683798,-0.085543,-0.847011,-0.524583,\n\t\t\t         0.002564,-0.814478,-0.580126,-0.000977,-0.690085,-0.723716,-0.369823,-0.641652,-0.671896,-0.211951,-0.604968,-0.767510,\n\t\t\t         -0.412824,-0.535997,-0.736351,-0.523484,-0.638417,-0.564196,-0.523484,-0.638417,-0.564196,-0.412824,-0.535997,-0.736351,\n\t\t\t         -0.696646,-0.486129,-0.527543,-0.706442,-0.638386,-0.305521,-0.211951,-0.604968,-0.767510,-0.001160,-0.577776,-0.816157,\n\t\t\t         -0.001221,-0.460158,-0.887814,-0.412824,-0.535997,-0.736351,-0.412824,-0.535997,-0.736351,-0.001221,-0.460158,-0.887814,\n\t\t\t         -0.001495,-0.129490,-0.991546,-0.696646,-0.486129,-0.527543,-0.055971,-0.952940,-0.297891,0.006775,-0.960021,-0.279794,\n\t\t\t         0.007660,-0.944060,-0.329600,0.008698,-0.941893,-0.335704,0.008698,-0.941893,-0.335704,0.007660,-0.944060,-0.329600,\n\t\t\t         -0.003235,-0.946837,-0.321635,0.004486,-0.945799,-0.324656,0.006775,-0.960021,-0.279794,0.073794,-0.935270,-0.346080,\n\t\t\t         0.024018,-0.911649,-0.410230,0.007660,-0.944060,-0.329600,0.007660,-0.944060,-0.329600,0.024018,-0.911649,-0.410230,\n\t\t\t         -0.012574,-0.914274,-0.404859,-0.003235,-0.946837,-0.321635,-0.055971,-0.952940,-0.297891,0.008698,-0.941893,-0.335704,\n\t\t\t         -0.012329,-0.918210,-0.395825,-0.080660,-0.938292,-0.336253,-0.080660,-0.938292,-0.336253,-0.012329,-0.918210,-0.395825,\n\t\t\t         -0.085543,-0.847011,-0.524583,-0.127537,-0.910245,-0.393872,0.008698,-0.941893,-0.335704,0.004486,-0.945799,-0.324656,\n\t\t\t         0.006073,-0.903012,-0.429487,-0.012329,-0.918210,-0.395825,-0.012329,-0.918210,-0.395825,0.006073,-0.903012,-0.429487,\n\t\t\t         0.002564,-0.814478,-0.580126,-0.085543,-0.847011,-0.524583,-0.055971,-0.952940,-0.297891,-0.080660,-0.938292,-0.336253,\n\t\t\t         -0.339274,-0.928434,-0.151158,-0.219459,-0.970824,-0.096408,-0.219459,-0.970824,-0.096408,-0.339274,-0.928434,-0.151158,\n\t\t\t         -0.228462,-0.969634,-0.086978,-0.089053,-0.992645,-0.081912,-0.080660,-0.938292,-0.336253,-0.127537,-0.910245,-0.393872,\n\t\t\t         -0.364635,-0.912046,-0.187506,-0.339274,-0.928434,-0.151158,-0.339274,-0.928434,-0.151158,-0.364635,-0.912046,-0.187506,\n\t\t\t         -0.408795,-0.910306,-0.064577,-0.228462,-0.969634,-0.086978,-0.055971,-0.952940,-0.297891,-0.219459,-0.970824,-0.096408,\n\t\t\t         -0.068697,-0.992553,-0.100528,0.006775,-0.960021,-0.279794,0.006775,-0.960021,-0.279794,-0.068697,-0.992553,-0.100528,\n\t\t\t         0.068422,-0.979644,-0.188696,0.073794,-0.935270,-0.346080,-0.219459,-0.970824,-0.096408,-0.089053,-0.992645,-0.081912,\n\t\t\t         0.020631,-0.999603,-0.018799,-0.068697,-0.992553,-0.100528,-0.068697,-0.992553,-0.100528,0.020631,-0.999603,-0.018799,\n\t\t\t         0.341441,-0.939512,-0.026185,0.068422,-0.979644,-0.188696,0.729820,-0.639485,0.241615,0.602252,-0.742027,0.294382,\n\t\t\t         0.634693,-0.757836,0.151036,0.775445,-0.623859,0.097079,0.775445,-0.623859,0.097079,0.634693,-0.757836,0.151036,\n\t\t\t         0.648579,-0.759667,0.047182,0.794671,-0.606037,0.034303,0.602252,-0.742027,0.294382,0.329264,-0.926328,0.182989,\n\t\t\t         0.406812,-0.909146,0.088961,0.634693,-0.757836,0.151036,0.634693,-0.757836,0.151036,0.406812,-0.909146,0.088961,\n\t\t\t         0.341441,-0.939512,-0.026185,0.648579,-0.759667,0.047182,0.729820,-0.639485,0.241615,0.775445,-0.623859,0.097079,\n\t\t\t         0.897763,-0.430921,0.091006,0.862850,-0.447371,0.235176,0.862850,-0.447371,0.235176,0.897763,-0.430921,0.091006,\n\t\t\t         0.979888,-0.198218,0.022187,0.930296,-0.235725,0.280984,0.775445,-0.623859,0.097079,0.794671,-0.606037,0.034303,\n\t\t\t         0.935514,-0.352184,0.026948,0.897763,-0.430921,0.091006,0.897763,-0.430921,0.091006,0.935514,-0.352184,0.026948,\n\t\t\t         0.985931,-0.164281,0.030183,0.979888,-0.198218,0.022187,0.729820,-0.639485,0.241615,0.862850,-0.447371,0.235176,\n\t\t\t         0.890591,-0.402753,0.211249,0.764763,-0.619709,0.176183,0.764763,-0.619709,0.176183,0.890591,-0.402753,0.211249,\n\t\t\t         0.942320,-0.327616,0.068178,0.821528,-0.570025,0.010590,0.862850,-0.447371,0.235176,0.930296,-0.235725,0.280984,\n\t\t\t         0.951659,-0.167364,0.257485,0.890591,-0.402753,0.211249,0.890591,-0.402753,0.211249,0.951659,-0.167364,0.257485,\n\t\t\t         0.987274,-0.125431,0.097598,0.942320,-0.327616,0.068178,0.729820,-0.639485,0.241615,0.764763,-0.619709,0.176183,\n\t\t\t         0.629017,-0.758110,0.171911,0.602252,-0.742027,0.294382,0.602252,-0.742027,0.294382,0.629017,-0.758110,0.171911,\n\t\t\t         0.395428,-0.897763,0.193884,0.329264,-0.926328,0.182989,0.764763,-0.619709,0.176183,0.821528,-0.570025,0.010590,\n\t\t\t         0.655660,-0.752403,-0.062929,0.629017,-0.758110,0.171911,0.629017,-0.758110,0.171911,0.655660,-0.752403,-0.062929,\n\t\t\t         0.476363,-0.879147,0.012513,0.395428,-0.897763,0.193884,0.026948,-0.997070,-0.071383,0.072695,-0.988586,-0.131809,\n\t\t\t         0.004364,-0.986724,-0.162267,-0.083926,-0.995727,-0.037751,-0.083926,-0.995727,-0.037751,0.004364,-0.986724,-0.162267,\n\t\t\t         -0.118656,-0.992279,-0.035890,-0.152959,-0.984405,0.086825,0.072695,-0.988586,-0.131809,-0.089053,-0.992645,-0.081912,\n\t\t\t         -0.228462,-0.969634,-0.086978,0.004364,-0.986724,-0.162267,0.004364,-0.986724,-0.162267,-0.228462,-0.969634,-0.086978,\n\t\t\t         -0.408795,-0.910306,-0.064577,-0.118656,-0.992279,-0.035890,0.026948,-0.997070,-0.071383,-0.083926,-0.995727,-0.037751,\n\t\t\t         0.005585,-0.998505,0.053987,0.094180,-0.994934,0.035127,0.094180,-0.994934,0.035127,0.005585,-0.998505,0.053987,\n\t\t\t         0.268319,-0.956114,0.117618,0.315073,-0.933500,0.170965,-0.083926,-0.995727,-0.037751,-0.152959,-0.984405,0.086825,\n\t\t\t         -0.045625,-0.992523,0.112980,0.005585,-0.998505,0.053987,0.005585,-0.998505,0.053987,-0.045625,-0.992523,0.112980,\n\t\t\t         0.257332,-0.960723,0.103793,0.268319,-0.956114,0.117618,0.026948,-0.997070,-0.071383,0.094180,-0.994934,0.035127,\n\t\t\t         0.163915,-0.986358,-0.013062,0.072695,-0.988586,-0.131809,0.072695,-0.988586,-0.131809,0.163915,-0.986358,-0.013062,\n\t\t\t         0.020631,-0.999603,-0.018799,-0.089053,-0.992645,-0.081912,0.094180,-0.994934,0.035127,0.315073,-0.933500,0.170965,\n\t\t\t         0.351207,-0.933134,0.076479,0.163915,-0.986358,-0.013062,0.163915,-0.986358,-0.013062,0.351207,-0.933134,0.076479,\n\t\t\t         0.341441,-0.939512,-0.026185,0.020631,-0.999603,-0.018799,0.822840,-0.522721,0.222846,0.808893,-0.566881,0.155858,\n\t\t\t         0.628803,-0.755821,0.182409,0.635548,-0.730857,0.248787,0.635548,-0.730857,0.248787,0.628803,-0.755821,0.182409,\n\t\t\t         0.351207,-0.933134,0.076479,0.315073,-0.933500,0.170965,0.808893,-0.566881,0.155858,0.794671,-0.606037,0.034303,\n\t\t\t         0.648579,-0.759667,0.047182,0.628803,-0.755821,0.182409,0.628803,-0.755821,0.182409,0.648579,-0.759667,0.047182,\n\t\t\t         0.341441,-0.939512,-0.026185,0.351207,-0.933134,0.076479,0.822840,-0.522721,0.222846,0.635548,-0.730857,0.248787,\n\t\t\t         0.658803,-0.735374,0.158574,0.872524,-0.471969,0.126041,0.872524,-0.471969,0.126041,0.658803,-0.735374,0.158574,\n\t\t\t         0.666524,-0.739250,0.096072,0.911618,-0.407849,0.050508,0.635548,-0.730857,0.248787,0.315073,-0.933500,0.170965,\n\t\t\t         0.268319,-0.956114,0.117618,0.658803,-0.735374,0.158574,0.658803,-0.735374,0.158574,0.268319,-0.956114,0.117618,\n\t\t\t         0.257332,-0.960723,0.103793,0.666524,-0.739250,0.096072,0.822840,-0.522721,0.222846,0.872524,-0.471969,0.126041,\n\t\t\t         0.955199,-0.287118,0.071688,0.928373,-0.328043,0.174505,0.928373,-0.328043,0.174505,0.955199,-0.287118,0.071688,\n\t\t\t         0.990295,-0.114963,0.077944,0.983886,-0.119694,0.132633,0.872524,-0.471969,0.126041,0.911618,-0.407849,0.050508,\n\t\t\t         0.961943,-0.273080,0.007965,0.955199,-0.287118,0.071688,0.955199,-0.287118,0.071688,0.961943,-0.273080,0.007965,\n\t\t\t         0.984130,-0.174078,0.033692,0.990295,-0.114963,0.077944,0.822840,-0.522721,0.222846,0.928373,-0.328043,0.174505,\n\t\t\t         0.927641,-0.352214,0.123997,0.808893,-0.566881,0.155858,0.808893,-0.566881,0.155858,0.927641,-0.352214,0.123997,\n\t\t\t         0.935514,-0.352184,0.026948,0.794671,-0.606037,0.034303,0.928373,-0.328043,0.174505,0.983886,-0.119694,0.132633,\n\t\t\t         0.983734,-0.140507,0.111698,0.927641,-0.352214,0.123997,0.927641,-0.352214,0.123997,0.983734,-0.140507,0.111698,\n\t\t\t         0.985931,-0.164281,0.030183,0.935514,-0.352184,0.026948,0.934446,-0.350200,0.064272,0.929655,-0.363842,0.057588,\n\t\t\t         0.682180,-0.724967,0.094821,0.709769,-0.699606,0.082003,0.709769,-0.699606,0.082003,0.682180,-0.724967,0.094821,\n\t\t\t         0.285409,-0.950468,0.122837,0.330760,-0.938108,0.102603,0.929655,-0.363842,0.057588,0.911618,-0.407849,0.050508,\n\t\t\t         0.666524,-0.739250,0.096072,0.682180,-0.724967,0.094821,0.682180,-0.724967,0.094821,0.666524,-0.739250,0.096072,\n\t\t\t         0.257332,-0.960723,0.103793,0.285409,-0.950468,0.122837,0.934446,-0.350200,0.064272,0.709769,-0.699606,0.082003,\n\t\t\t         0.740776,-0.669759,0.051027,0.929655,-0.364483,0.053346,0.929655,-0.364483,0.053346,0.740776,-0.669759,0.051027,\n\t\t\t         0.770348,-0.637440,0.013886,0.918729,-0.393933,0.026917,0.709769,-0.699606,0.082003,0.330760,-0.938108,0.102603,\n\t\t\t         0.376415,-0.924497,0.060091,0.740776,-0.669759,0.051027,0.740776,-0.669759,0.051027,0.376415,-0.924497,0.060091,\n\t\t\t         0.436476,-0.899655,0.008179,0.770348,-0.637440,0.013886,0.934446,-0.350200,0.064272,0.929655,-0.364483,0.053346,\n\t\t\t         0.912625,-0.399670,0.085543,0.934233,-0.345256,0.089236,0.934233,-0.345256,0.089236,0.912625,-0.399670,0.085543,\n\t\t\t         0.955199,-0.276620,0.105075,0.955504,-0.272011,0.113926,0.929655,-0.364483,0.053346,0.918729,-0.393933,0.026917,\n\t\t\t         0.905911,-0.421552,0.039583,0.912625,-0.399670,0.085543,0.912625,-0.399670,0.085543,0.905911,-0.421552,0.039583,\n\t\t\t         0.959716,-0.276955,0.046937,0.955199,-0.276620,0.105075,0.934446,-0.350200,0.064272,0.934233,-0.345256,0.089236,\n\t\t\t         0.952696,-0.299081,0.053896,0.929655,-0.363842,0.057588,0.929655,-0.363842,0.057588,0.952696,-0.299081,0.053896,\n\t\t\t         0.961943,-0.273080,0.007965,0.911618,-0.407849,0.050508,0.934233,-0.345256,0.089236,0.955504,-0.272011,0.113926,\n\t\t\t         0.967132,-0.243538,0.072787,0.952696,-0.299081,0.053896,0.952696,-0.299081,0.053896,0.967132,-0.243538,0.072787,\n\t\t\t         0.984130,-0.174078,0.033692,0.961943,-0.273080,0.007965,-0.265572,-0.956542,0.120304,-0.216651,-0.964080,0.153478,\n\t\t\t         -0.295938,-0.954314,0.040529,-0.456343,-0.889096,0.035035,-0.456343,-0.889096,0.035035,-0.295938,-0.954314,0.040529,\n\t\t\t         -0.467910,-0.881466,-0.063601,-0.459334,-0.887661,-0.032380,-0.216651,-0.964080,0.153478,-0.152959,-0.984405,0.086825,\n\t\t\t         -0.118656,-0.992279,-0.035890,-0.295938,-0.954314,0.040529,-0.295938,-0.954314,0.040529,-0.118656,-0.992279,-0.035890,\n\t\t\t         -0.408795,-0.910306,-0.064577,-0.467910,-0.881466,-0.063601,-0.265572,-0.956542,0.120304,-0.456343,-0.889096,0.035035,\n\t\t\t         -0.538163,-0.842769,-0.008057,-0.277657,-0.959716,0.042940,-0.277657,-0.959716,0.042940,-0.538163,-0.842769,-0.008057,\n\t\t\t         -0.544694,-0.835353,-0.074007,-0.262368,-0.964080,-0.040956,-0.456343,-0.889096,0.035035,-0.459334,-0.887661,-0.032380,\n\t\t\t         -0.499954,-0.865658,-0.025330,-0.538163,-0.842769,-0.008057,-0.538163,-0.842769,-0.008057,-0.499954,-0.865658,-0.025330,\n\t\t\t         -0.504349,-0.860408,-0.072604,-0.544694,-0.835353,-0.074007,-0.265572,-0.956542,0.120304,-0.277657,-0.959716,0.042940,\n\t\t\t         0.134465,-0.988159,0.073580,0.056673,-0.989532,0.132664,0.056673,-0.989532,0.132664,0.134465,-0.988159,0.073580,\n\t\t\t         0.376415,-0.924497,0.060091,0.330760,-0.938108,0.102603,-0.277657,-0.959716,0.042940,-0.262368,-0.964080,-0.040956,\n\t\t\t         0.185095,-0.982696,0.003418,0.134465,-0.988159,0.073580,0.134465,-0.988159,0.073580,0.185095,-0.982696,0.003418,\n\t\t\t         0.436476,-0.899655,0.008179,0.376415,-0.924497,0.060091,-0.265572,-0.956542,0.120304,0.056673,-0.989532,0.132664,\n\t\t\t         -0.018464,-0.987182,0.158483,-0.216651,-0.964080,0.153478,-0.216651,-0.964080,0.153478,-0.018464,-0.987182,0.158483,\n\t\t\t         -0.045625,-0.992523,0.112980,-0.152959,-0.984405,0.086825,0.056673,-0.989532,0.132664,0.330760,-0.938108,0.102603,\n\t\t\t         0.285409,-0.950468,0.122837,-0.018464,-0.987182,0.158483,-0.018464,-0.987182,0.158483,0.285409,-0.950468,0.122837,\n\t\t\t         0.257332,-0.960723,0.103793,-0.045625,-0.992523,0.112980,0.627033,0.774194,-0.085971,0.585131,0.806085,-0.088229,\n\t\t\t         0.658498,0.747948,-0.083254,0.669942,0.735466,-0.101230,0.669942,0.735466,-0.101230,0.658498,0.747948,-0.083254,\n\t\t\t         0.839473,0.542680,0.027131,0.796258,0.603504,-0.041505,0.585131,0.806085,-0.088229,0.573931,0.817774,-0.042207,\n\t\t\t         0.674795,0.737236,0.033052,0.658498,0.747948,-0.083254,0.658498,0.747948,-0.083254,0.674795,0.737236,0.033052,\n\t\t\t         0.850368,0.511612,0.122684,0.839473,0.542680,0.027131,0.627033,0.774194,-0.085971,0.669942,0.735466,-0.101230,\n\t\t\t         0.695120,0.716361,-0.060060,0.648427,0.758263,-0.067354,0.648427,0.758263,-0.067354,0.695120,0.716361,-0.060060,\n\t\t\t         0.684866,0.728202,-0.025391,0.640736,0.766228,-0.047761,0.669942,0.735466,-0.101230,0.796258,0.603504,-0.041505,\n\t\t\t         0.763421,0.644124,-0.047334,0.695120,0.716361,-0.060060,0.695120,0.716361,-0.060060,0.763421,0.644124,-0.047334,\n\t\t\t         0.751946,0.659200,-0.003937,0.684866,0.728202,-0.025391,0.627033,0.774194,-0.085971,0.648427,0.758263,-0.067354,\n\t\t\t         0.440962,0.885311,-0.147374,0.454237,0.880093,-0.138035,0.454237,0.880093,-0.138035,0.440962,0.885311,-0.147374,\n\t\t\t         0.091403,0.964171,-0.248939,0.071596,0.961638,-0.264779,0.648427,0.758263,-0.067354,0.640736,0.766228,-0.047761,\n\t\t\t         0.435713,0.894314,-0.101627,0.440962,0.885311,-0.147374,0.440962,0.885311,-0.147374,0.435713,0.894314,-0.101627,\n\t\t\t         0.103885,0.981170,-0.162664,0.091403,0.964171,-0.248939,0.627033,0.774194,-0.085971,0.454237,0.880093,-0.138035,\n\t\t\t         0.442976,0.888119,-0.122440,0.585131,0.806085,-0.088229,0.585131,0.806085,-0.088229,0.442976,0.888119,-0.122440,\n\t\t\t         0.439406,0.891354,-0.111057,0.573931,0.817774,-0.042207,0.454237,0.880093,-0.138035,0.071596,0.961638,-0.264779,\n\t\t\t         0.041688,0.959899,-0.277169,0.442976,0.888119,-0.122440,0.442976,0.888119,-0.122440,0.041688,0.959899,-0.277169,\n\t\t\t         0.022980,0.952574,-0.303415,0.439406,0.891354,-0.111057,-0.476669,0.825861,-0.301187,-0.560381,0.778924,-0.281472,\n\t\t\t         -0.549974,0.768364,-0.327280,-0.492203,0.795038,-0.354381,-0.492203,0.795038,-0.354381,-0.549974,0.768364,-0.327280,\n\t\t\t         -0.564104,0.739921,-0.366405,-0.483902,0.757378,-0.438337,-0.560381,0.778924,-0.281472,-0.655477,0.711600,-0.252876,\n\t\t\t         -0.653890,0.690634,-0.308908,-0.549974,0.768364,-0.327280,-0.549974,0.768364,-0.327280,-0.653890,0.690634,-0.308908,\n\t\t\t         -0.651662,0.685263,-0.325114,-0.564104,0.739921,-0.366405,-0.476669,0.825861,-0.301187,-0.492203,0.795038,-0.354381,\n\t\t\t         -0.349559,0.858913,-0.374187,-0.305124,0.895688,-0.323435,-0.305124,0.895688,-0.323435,-0.349559,0.858913,-0.374187,\n\t\t\t         0.041688,0.959899,-0.277169,0.071596,0.961638,-0.264779,-0.492203,0.795038,-0.354381,-0.483902,0.757378,-0.438337,\n\t\t\t         -0.354350,0.814386,-0.459517,-0.349559,0.858913,-0.374187,-0.349559,0.858913,-0.374187,-0.354350,0.814386,-0.459517,\n\t\t\t         0.022980,0.952574,-0.303415,0.041688,0.959899,-0.277169,-0.476669,0.825861,-0.301187,-0.305124,0.895688,-0.323435,\n\t\t\t         -0.242409,0.928739,-0.280404,-0.437696,0.864040,-0.248573,-0.437696,0.864040,-0.248573,-0.242409,0.928739,-0.280404,\n\t\t\t         -0.210547,0.958556,-0.191900,-0.385144,0.905026,-0.180425,-0.305124,0.895688,-0.323435,0.071596,0.961638,-0.264779,\n\t\t\t         0.091403,0.964171,-0.248939,-0.242409,0.928739,-0.280404,-0.242409,0.928739,-0.280404,0.091403,0.964171,-0.248939,\n\t\t\t         0.103885,0.981170,-0.162664,-0.210547,0.958556,-0.191900,-0.476669,0.825861,-0.301187,-0.437696,0.864040,-0.248573,\n\t\t\t         -0.556505,0.804712,-0.206610,-0.560381,0.778924,-0.281472,-0.560381,0.778924,-0.281472,-0.556505,0.804712,-0.206610,\n\t\t\t         -0.648610,0.743278,-0.163640,-0.655477,0.711600,-0.252876,-0.437696,0.864040,-0.248573,-0.385144,0.905026,-0.180425,\n\t\t\t         -0.480026,0.865963,-0.140141,-0.556505,0.804712,-0.206610,-0.556505,0.804712,-0.206610,-0.480026,0.865963,-0.140141,\n\t\t\t         -0.612354,0.783959,-0.101901,-0.648610,0.743278,-0.163640,0.989868,0.096225,0.104373,0.982360,0.154973,0.104434,\n\t\t\t         0.996643,-0.012696,0.080691,0.994476,-0.021760,0.102481,0.994476,-0.021760,0.102481,0.996643,-0.012696,0.080691,\n\t\t\t         0.967132,-0.243538,0.072787,0.955504,-0.272011,0.113926,0.982360,0.154973,0.104434,0.972472,0.215674,0.088076,\n\t\t\t         0.997253,0.016511,0.071902,0.996643,-0.012696,0.080691,0.996643,-0.012696,0.080691,0.997253,0.016511,0.071902,\n\t\t\t         0.984130,-0.174078,0.033692,0.967132,-0.243538,0.072787,0.989868,0.096225,0.104373,0.994476,-0.021760,0.102481,\n\t\t\t         0.995666,-0.013916,0.091647,0.993683,0.075655,0.082492,0.993683,0.075655,0.082492,0.995666,-0.013916,0.091647,\n\t\t\t         0.998047,-0.037111,0.050203,0.997406,0.041078,0.058718,0.994476,-0.021760,0.102481,0.955504,-0.272011,0.113926,\n\t\t\t         0.955199,-0.276620,0.105075,0.995666,-0.013916,0.091647,0.995666,-0.013916,0.091647,0.955199,-0.276620,0.105075,\n\t\t\t         0.959716,-0.276955,0.046937,0.998047,-0.037111,0.050203,0.989868,0.096225,0.104373,0.993683,0.075655,0.082492,\n\t\t\t         0.945524,0.323740,0.033723,0.955168,0.286630,0.073763,0.955168,0.286630,0.073763,0.945524,0.323740,0.033723,\n\t\t\t         0.763421,0.644124,-0.047334,0.796258,0.603504,-0.041505,0.993683,0.075655,0.082492,0.997406,0.041078,0.058718,\n\t\t\t         0.945463,0.322947,0.042238,0.945524,0.323740,0.033723,0.945524,0.323740,0.033723,0.945463,0.322947,0.042238,\n\t\t\t         0.751946,0.659200,-0.003937,0.763421,0.644124,-0.047334,0.989868,0.096225,0.104373,0.955168,0.286630,0.073763,\n\t\t\t         0.953001,0.275826,0.125126,0.982360,0.154973,0.104434,0.982360,0.154973,0.104434,0.953001,0.275826,0.125126,\n\t\t\t         0.939238,0.318583,0.127537,0.972472,0.215674,0.088076,0.955168,0.286630,0.073763,0.796258,0.603504,-0.041505,\n\t\t\t         0.839473,0.542680,0.027131,0.953001,0.275826,0.125126,0.953001,0.275826,0.125126,0.839473,0.542680,0.027131,\n\t\t\t         0.850368,0.511612,0.122684,0.939238,0.318583,0.127537,-0.940916,0.306528,-0.143803,-0.887600,0.382336,-0.256783,\n\t\t\t         -0.797113,0.547014,-0.255684,-0.801538,0.569262,-0.182897,-0.801538,0.569262,-0.182897,-0.797113,0.547014,-0.255684,\n\t\t\t         -0.653890,0.690634,-0.308908,-0.655477,0.711600,-0.252876,-0.887600,0.382336,-0.256783,-0.786554,0.449568,-0.423261,\n\t\t\t         -0.741844,0.578722,-0.338694,-0.797113,0.547014,-0.255684,-0.797113,0.547014,-0.255684,-0.741844,0.578722,-0.338694,\n\t\t\t         -0.651662,0.685263,-0.325114,-0.653890,0.690634,-0.308908,-0.940916,0.306528,-0.143803,-0.801538,0.569262,-0.182897,\n\t\t\t         -0.797571,0.591510,-0.118015,-0.967681,0.233985,-0.093875,-0.967681,0.233985,-0.093875,-0.797571,0.591510,-0.118015,\n\t\t\t         -0.820032,0.563433,-0.100345,-0.981140,0.149510,-0.122288,-0.801538,0.569262,-0.182897,-0.655477,0.711600,-0.252876,\n\t\t\t         -0.648610,0.743278,-0.163640,-0.797571,0.591510,-0.118015,-0.797571,0.591510,-0.118015,-0.648610,0.743278,-0.163640,\n\t\t\t         -0.612354,0.783959,-0.101901,-0.820032,0.563433,-0.100345,-0.940916,0.306528,-0.143803,-0.967681,0.233985,-0.093875,\n\t\t\t         -0.982177,-0.152867,-0.109104,-0.982665,-0.015900,-0.184545,-0.982665,-0.015900,-0.184545,-0.982177,-0.152867,-0.109104,\n\t\t\t         -0.947752,-0.292154,-0.127964,-0.939787,-0.270669,-0.208563,-0.967681,0.233985,-0.093875,-0.981140,0.149510,-0.122288,\n\t\t\t         -0.963958,-0.232002,-0.130161,-0.982177,-0.152867,-0.109104,-0.982177,-0.152867,-0.109104,-0.963958,-0.232002,-0.130161,\n\t\t\t         -0.936308,-0.321207,-0.141881,-0.947752,-0.292154,-0.127964,-0.940916,0.306528,-0.143803,-0.982665,-0.015900,-0.184545,\n\t\t\t         -0.914884,0.159703,-0.370708,-0.887600,0.382336,-0.256783,-0.887600,0.382336,-0.256783,-0.914884,0.159703,-0.370708,\n\t\t\t         -0.754601,0.279824,-0.593493,-0.786554,0.449568,-0.423261,-0.982665,-0.015900,-0.184545,-0.939787,-0.270669,-0.208563,\n\t\t\t         -0.891751,-0.213355,-0.398999,-0.914884,0.159703,-0.370708,-0.914884,0.159703,-0.370708,-0.891751,-0.213355,-0.398999,\n\t\t\t         -0.001495,-0.129490,-0.991546,-0.754601,0.279824,-0.593493,-0.810755,-0.574114,-0.114109,-0.798853,-0.591632,-0.108463,\n\t\t\t         -0.857570,-0.434004,-0.275948,-0.906308,-0.378887,-0.187139,-0.906308,-0.378887,-0.187139,-0.857570,-0.434004,-0.275948,\n\t\t\t         -0.891751,-0.213355,-0.398999,-0.939787,-0.270669,-0.208563,-0.798853,-0.591632,-0.108463,-0.706442,-0.638386,-0.305521,\n\t\t\t         -0.696646,-0.486129,-0.527543,-0.857570,-0.434004,-0.275948,-0.857570,-0.434004,-0.275948,-0.696646,-0.486129,-0.527543,\n\t\t\t         -0.001495,-0.129490,-0.991546,-0.891751,-0.213355,-0.398999,-0.810755,-0.574114,-0.114109,-0.906308,-0.378887,-0.187139,\n\t\t\t         -0.918088,-0.377178,-0.121647,-0.753929,-0.650746,-0.089816,-0.753929,-0.650746,-0.089816,-0.918088,-0.377178,-0.121647,\n\t\t\t         -0.919370,-0.371227,-0.130009,-0.741905,-0.662923,-0.100375,-0.906308,-0.378887,-0.187139,-0.939787,-0.270669,-0.208563,\n\t\t\t         -0.947752,-0.292154,-0.127964,-0.918088,-0.377178,-0.121647,-0.918088,-0.377178,-0.121647,-0.947752,-0.292154,-0.127964,\n\t\t\t         -0.936308,-0.321207,-0.141881,-0.919370,-0.371227,-0.130009,-0.810755,-0.574114,-0.114109,-0.753929,-0.650746,-0.089816,\n\t\t\t         -0.556932,-0.828333,-0.060121,-0.562334,-0.826044,-0.037385,-0.562334,-0.826044,-0.037385,-0.556932,-0.828333,-0.060121,\n\t\t\t         -0.499954,-0.865658,-0.025330,-0.459334,-0.887661,-0.032380,-0.753929,-0.650746,-0.089816,-0.741905,-0.662923,-0.100375,\n\t\t\t         -0.518571,-0.851405,-0.078249,-0.556932,-0.828333,-0.060121,-0.556932,-0.828333,-0.060121,-0.518571,-0.851405,-0.078249,\n\t\t\t         -0.504349,-0.860408,-0.072604,-0.499954,-0.865658,-0.025330,-0.810755,-0.574114,-0.114109,-0.562334,-0.826044,-0.037385,\n\t\t\t         -0.597064,-0.801141,-0.040132,-0.798853,-0.591632,-0.108463,-0.798853,-0.591632,-0.108463,-0.597064,-0.801141,-0.040132,\n\t\t\t         -0.609638,-0.783380,-0.120884,-0.706442,-0.638386,-0.305521,-0.562334,-0.826044,-0.037385,-0.459334,-0.887661,-0.032380,\n\t\t\t         -0.467910,-0.881466,-0.063601,-0.597064,-0.801141,-0.040132,-0.597064,-0.801141,-0.040132,-0.467910,-0.881466,-0.063601,\n\t\t\t         -0.408795,-0.910306,-0.064577,-0.609638,-0.783380,-0.120884,-0.520920,-0.844447,-0.124454,-0.504349,-0.860408,-0.072604,\n\t\t\t         -0.518571,-0.851405,-0.078249,-0.537034,-0.827540,-0.163488,-0.748527,-0.631275,-0.202918,-0.741905,-0.662923,-0.100375,\n\t\t\t         -0.919370,-0.371227,-0.130009,-0.898831,-0.395886,-0.187902,-0.898831,-0.395886,-0.187902,-0.919370,-0.371227,-0.130009,\n\t\t\t         -0.936308,-0.321207,-0.141881,-0.911649,-0.377850,-0.161596,-0.953063,-0.252815,-0.166356,-0.963958,-0.232002,-0.130161,\n\t\t\t         -0.981140,0.149510,-0.122288,-0.981262,0.074038,-0.177740,-0.748527,-0.631275,-0.202918,-0.898831,-0.395886,-0.187902,\n\t\t\t         -0.854640,-0.488693,-0.175298,-0.738365,-0.641774,-0.207099,-0.820856,-0.542100,-0.179693,-0.854640,-0.488693,-0.175298,\n\t\t\t         -0.903073,-0.399060,-0.158635,-0.902707,-0.389691,-0.182226,-0.898831,-0.395886,-0.187902,-0.911649,-0.377850,-0.161596,\n\t\t\t         -0.903073,-0.399060,-0.158635,-0.854640,-0.488693,-0.175298,-0.893033,0.447188,-0.049959,-0.859249,0.511185,0.018403,\n\t\t\t         -0.713126,0.700888,0.013306,-0.757164,0.651997,-0.039369,-0.748527,-0.631275,-0.202918,-0.738365,-0.641774,-0.207099,\n\t\t\t         -0.607624,-0.771020,-0.190497,-0.537034,-0.827540,-0.163488,-0.537034,-0.827540,-0.163488,-0.607624,-0.771020,-0.190497,\n\t\t\t         -0.587939,-0.795038,-0.148930,-0.520920,-0.844447,-0.124454,-0.727500,-0.664907,-0.169164,-0.738365,-0.641774,-0.207099,\n\t\t\t         -0.854640,-0.488693,-0.175298,-0.820856,-0.542100,-0.179693,-0.727500,-0.664907,-0.169164,-0.657888,-0.737114,-0.154271,\n\t\t\t         -0.607624,-0.771020,-0.190497,-0.738365,-0.641774,-0.207099,-0.936308,-0.321207,-0.141881,-0.963958,-0.232002,-0.130161,\n\t\t\t         -0.953063,-0.252815,-0.166356,-0.911649,-0.377850,-0.161596,-0.981262,0.074038,-0.177740,-0.981140,0.149510,-0.122288,\n\t\t\t         -0.820032,0.563433,-0.100345,-0.854488,0.494858,-0.157903,-0.854488,0.494858,-0.157903,-0.820032,0.563433,-0.100345,\n\t\t\t         -0.612354,0.783959,-0.101901,-0.564318,0.815821,-0.126347,0.904111,-0.426313,0.027985,0.918729,-0.393933,0.026917,\n\t\t\t         0.770348,-0.637440,0.013886,0.792535,-0.609821,-0.001129,-0.981262,0.074038,-0.177740,-0.854488,0.494858,-0.157903,\n\t\t\t         -0.851863,0.477248,-0.215735,-0.975860,0.070956,-0.206458,-0.838771,0.515152,-0.176122,-0.851863,0.477248,-0.215735,\n\t\t\t         -0.542344,0.821253,-0.177068,-0.583331,0.805322,-0.105411,-0.854488,0.494858,-0.157903,-0.564318,0.815821,-0.126347,\n\t\t\t         -0.542344,0.821253,-0.177068,-0.851863,0.477248,-0.215735,-0.657888,-0.737114,-0.154271,-0.619282,-0.769921,-0.153813,\n\t\t\t         -0.587939,-0.795038,-0.148930,-0.607624,-0.771020,-0.190497,-0.981262,0.074038,-0.177740,-0.975860,0.070956,-0.206458,\n\t\t\t         -0.957762,-0.225532,-0.178198,-0.953063,-0.252815,-0.166356,-0.953063,-0.252815,-0.166356,-0.957762,-0.225532,-0.178198,\n\t\t\t         -0.903073,-0.399060,-0.158635,-0.911649,-0.377850,-0.161596,-0.971557,0.129154,-0.198401,-0.975860,0.070956,-0.206458,\n\t\t\t         -0.851863,0.477248,-0.215735,-0.838771,0.515152,-0.176122,-0.971557,0.129154,-0.198401,-0.965148,-0.180059,-0.189856,\n\t\t\t         -0.957762,-0.225532,-0.178198,-0.975860,0.070956,-0.206458,0.792535,-0.609821,-0.001129,0.770348,-0.637440,0.013886,\n\t\t\t         0.436476,-0.899655,0.008179,0.512131,-0.858486,-0.026276,0.920103,-0.390057,0.034791,0.905911,-0.421552,0.039583,\n\t\t\t         0.918729,-0.393933,0.026917,0.904111,-0.426313,0.027985,0.904111,-0.426313,0.027985,0.792535,-0.609821,-0.001129,\n\t\t\t         0.795465,-0.605853,-0.012116,0.876675,-0.480697,0.018067,0.774621,-0.629505,-0.060213,0.795465,-0.605853,-0.012116,\n\t\t\t         0.572069,-0.818781,-0.047884,0.611194,-0.783776,-0.109989,0.792535,-0.609821,-0.001129,0.512131,-0.858486,-0.026276,\n\t\t\t         0.572069,-0.818781,-0.047884,0.795465,-0.605853,-0.012116,-0.965148,-0.180059,-0.189856,-0.902707,-0.389691,-0.182226,\n\t\t\t         -0.903073,-0.399060,-0.158635,-0.957762,-0.225532,-0.178198,0.904111,-0.426313,0.027985,0.876675,-0.480697,0.018067,\n\t\t\t         0.922819,-0.382763,0.043428,0.920103,-0.390057,0.034791,0.920103,-0.390057,0.034791,0.922819,-0.382763,0.043428,\n\t\t\t         0.960936,-0.272286,0.049348,0.960295,-0.277902,0.024232,0.834162,-0.551500,-0.000183,0.876675,-0.480697,0.018067,\n\t\t\t         0.795465,-0.605853,-0.012116,0.774621,-0.629505,-0.060213,0.834162,-0.551500,-0.000183,0.900296,-0.431989,0.053346,\n\t\t\t         0.922819,-0.382763,0.043428,0.876675,-0.480697,0.018067,0.959716,-0.276955,0.046937,0.905911,-0.421552,0.039583,\n\t\t\t         0.920103,-0.390057,0.034791,0.960295,-0.277902,0.024232,-0.235664,-0.967498,-0.091464,-0.262368,-0.964080,-0.040956,\n\t\t\t         -0.544694,-0.835353,-0.074007,-0.528367,-0.842128,-0.107700,-0.528367,-0.842128,-0.107700,-0.544694,-0.835353,-0.074007,\n\t\t\t         -0.504349,-0.860408,-0.072604,-0.520920,-0.844447,-0.124454,0.199713,-0.978515,-0.050935,0.185095,-0.982696,0.003418,\n\t\t\t         -0.262368,-0.964080,-0.040956,-0.235664,-0.967498,-0.091464,-0.235664,-0.967498,-0.091464,-0.528367,-0.842128,-0.107700,\n\t\t\t         -0.510269,-0.850978,-0.124058,-0.184271,-0.976348,-0.113010,-0.125950,-0.981262,-0.145665,0.290658,-0.947813,-0.130802,\n\t\t\t         0.218482,-0.972198,-0.083895,-0.184271,-0.976348,-0.113010,-0.528367,-0.842128,-0.107700,-0.520920,-0.844447,-0.124454,\n\t\t\t         -0.587939,-0.795038,-0.148930,-0.510269,-0.850978,-0.124058,-0.125950,-0.981262,-0.145665,-0.184271,-0.976348,-0.113010,\n\t\t\t         -0.510269,-0.850978,-0.124058,-0.480941,-0.862300,-0.158422,-0.235664,-0.967498,-0.091464,-0.184271,-0.976348,-0.113010,\n\t\t\t         0.218482,-0.972198,-0.083895,0.199713,-0.978515,-0.050935,0.199713,-0.978515,-0.050935,0.218482,-0.972198,-0.083895,\n\t\t\t         0.572069,-0.818781,-0.047884,0.512131,-0.858486,-0.026276,0.290658,-0.947813,-0.130802,0.611194,-0.783776,-0.109989,\n\t\t\t         0.572069,-0.818781,-0.047884,0.218482,-0.972198,-0.083895,0.900296,-0.431989,0.053346,0.957579,-0.275643,0.083621,\n\t\t\t         0.960936,-0.272286,0.049348,0.922819,-0.382763,0.043428,0.512131,-0.858486,-0.026276,0.436476,-0.899655,0.008179,\n\t\t\t         0.185095,-0.982696,0.003418,0.199713,-0.978515,-0.050935,0.625324,0.779046,0.044618,0.640736,0.766228,-0.047761,\n\t\t\t         0.684866,0.728202,-0.025391,0.657704,0.752098,0.041505,0.657704,0.752098,0.041505,0.684866,0.728202,-0.025391,\n\t\t\t         0.751946,0.659200,-0.003937,0.763695,0.644368,0.038759,0.436262,0.899686,0.013581,0.435713,0.894314,-0.101627,\n\t\t\t         0.640736,0.766228,-0.047761,0.625324,0.779046,0.044618,0.625324,0.779046,0.044618,0.657704,0.752098,0.041505,\n\t\t\t         0.691763,0.717795,0.078677,0.629414,0.771325,0.093936,0.755089,0.650624,0.080508,0.691763,0.717795,0.078677,\n\t\t\t         0.816248,0.575549,0.049104,0.867641,0.493301,0.061739,0.657704,0.752098,0.041505,0.763695,0.644368,0.038759,\n\t\t\t         0.816248,0.575549,0.049104,0.691763,0.717795,0.078677,-0.480941,-0.862300,-0.158422,-0.510269,-0.850978,-0.124058,\n\t\t\t         -0.587939,-0.795038,-0.148930,-0.619282,-0.769921,-0.153813,0.625324,0.779046,0.044618,0.629414,0.771325,0.093936,\n\t\t\t         0.445021,0.891781,0.081454,0.436262,0.899686,0.013581,0.436262,0.899686,0.013581,0.445021,0.891781,0.081454,\n\t\t\t         0.066683,0.997131,0.035676,0.099368,0.994140,-0.042116,0.653706,0.751122,0.091800,0.629414,0.771325,0.093936,\n\t\t\t         0.691763,0.717795,0.078677,0.755089,0.650624,0.080508,0.653706,0.751122,0.091800,0.447554,0.891476,0.070223,\n\t\t\t         0.445021,0.891781,0.081454,0.629414,0.771325,0.093936,0.103885,0.981170,-0.162664,0.435713,0.894314,-0.101627,\n\t\t\t         0.436262,0.899686,0.013581,0.099368,0.994140,-0.042116,-0.367779,0.922147,-0.119877,-0.480026,0.865963,-0.140141,\n\t\t\t         -0.385144,0.905026,-0.180425,-0.363933,0.923185,-0.123478,-0.612354,0.783959,-0.101901,-0.480026,0.865963,-0.140141,\n\t\t\t         -0.367779,0.922147,-0.119877,-0.564318,0.815821,-0.126347,-0.363933,0.923185,-0.123478,-0.385144,0.905026,-0.180425,\n\t\t\t         -0.210547,0.958556,-0.191900,-0.238899,0.966277,-0.095920,-0.238899,0.966277,-0.095920,-0.210547,0.958556,-0.191900,\n\t\t\t         0.103885,0.981170,-0.162664,0.099368,0.994140,-0.042116,0.998535,-0.031159,0.043611,0.997406,0.041078,0.058718,\n\t\t\t         0.998047,-0.037111,0.050203,0.994201,-0.102786,0.030671,-0.363933,0.923185,-0.123478,-0.238899,0.966277,-0.095920,\n\t\t\t         -0.328257,0.943724,-0.040193,-0.429243,0.897946,-0.097049,-0.525773,0.850398,-0.018220,-0.474319,0.879177,-0.044984,\n\t\t\t         -0.369732,0.920286,-0.127720,-0.429243,0.897946,-0.097049,-0.238899,0.966277,-0.095920,0.099368,0.994140,-0.042116,\n\t\t\t         0.066683,0.997131,0.035676,-0.328257,0.943724,-0.040193,-0.525773,0.850398,-0.018220,-0.429243,0.897946,-0.097049,\n\t\t\t         -0.328257,0.943724,-0.040193,-0.372845,0.927885,-0.001129,-0.363933,0.923185,-0.123478,-0.429243,0.897946,-0.097049,\n\t\t\t         -0.369732,0.920286,-0.127720,-0.367779,0.922147,-0.119877,-0.367779,0.922147,-0.119877,-0.369732,0.920286,-0.127720,\n\t\t\t         -0.542344,0.821253,-0.177068,-0.564318,0.815821,-0.126347,-0.474319,0.879177,-0.044984,-0.583331,0.805322,-0.105411,\n\t\t\t         -0.542344,0.821253,-0.177068,-0.369732,0.920286,-0.127720,0.447554,0.891476,0.070223,0.050600,0.998199,0.031861,\n\t\t\t         0.066683,0.997131,0.035676,0.445021,0.891781,0.081454,0.994201,-0.102786,0.030671,0.998047,-0.037111,0.050203,\n\t\t\t         0.959716,-0.276955,0.046937,0.960295,-0.277902,0.024232,0.963775,0.262337,0.047945,0.945463,0.322947,0.042238,\n\t\t\t         0.997406,0.041078,0.058718,0.998535,-0.031159,0.043611,0.998535,-0.031159,0.043611,0.994201,-0.102786,0.030671,\n\t\t\t         0.988739,-0.140172,0.051943,0.998016,-0.040803,0.047761,0.988128,-0.124760,0.089480,0.988739,-0.140172,0.051943,\n\t\t\t         0.960936,-0.272286,0.049348,0.957579,-0.275643,0.083621,0.994201,-0.102786,0.030671,0.960295,-0.277902,0.024232,\n\t\t\t         0.960936,-0.272286,0.049348,0.988739,-0.140172,0.051943,-0.372845,0.927885,-0.001129,-0.328257,0.943724,-0.040193,\n\t\t\t         0.066683,0.997131,0.035676,0.050600,0.998199,0.031861,0.998535,-0.031159,0.043611,0.998016,-0.040803,0.047761,\n\t\t\t         0.975036,0.218268,0.040345,0.963775,0.262337,0.047945,0.963775,0.262337,0.047945,0.975036,0.218268,0.040345,\n\t\t\t         0.816248,0.575549,0.049104,0.763695,0.644368,0.038759,0.996521,0.031526,0.076815,0.998016,-0.040803,0.047761,\n\t\t\t         0.988739,-0.140172,0.051943,0.988128,-0.124760,0.089480,0.996521,0.031526,0.076815,0.968596,0.241432,0.059358,\n\t\t\t         0.975036,0.218268,0.040345,0.998016,-0.040803,0.047761,0.763695,0.644368,0.038759,0.751946,0.659200,-0.003937,\n\t\t\t         0.945463,0.322947,0.042238,0.963775,0.262337,0.047945,-0.726890,-0.651753,-0.216346,-0.657918,-0.724937,-0.203803,\n\t\t\t         -0.657888,-0.737114,-0.154271,-0.727500,-0.664907,-0.169164,-0.657918,-0.724937,-0.203803,-0.596179,-0.776757,-0.202918,\n\t\t\t         -0.619282,-0.769921,-0.153813,-0.657888,-0.737114,-0.154271,-0.726890,-0.651753,-0.216346,-0.727500,-0.664907,-0.169164,\n\t\t\t         -0.820856,-0.542100,-0.179693,-0.808191,-0.544969,-0.223090,-0.808191,-0.544969,-0.223090,-0.820856,-0.542100,-0.179693,\n\t\t\t         -0.902707,-0.389691,-0.182226,-0.896115,-0.385815,-0.219337,-0.726890,-0.651753,-0.216346,-0.808191,-0.544969,-0.223090,\n\t\t\t         -0.793146,-0.542985,-0.275735,-0.715812,-0.639821,-0.279580,-0.715812,-0.639821,-0.279580,-0.793146,-0.542985,-0.275735,\n\t\t\t         -0.774651,-0.541093,-0.327219,-0.689627,-0.634205,-0.349467,-0.808191,-0.544969,-0.223090,-0.896115,-0.385815,-0.219337,\n\t\t\t         -0.885861,-0.382031,-0.263192,-0.793146,-0.542985,-0.275735,-0.793146,-0.542985,-0.275735,-0.885861,-0.382031,-0.263192,\n\t\t\t         -0.877651,-0.372265,-0.301828,-0.774651,-0.541093,-0.327219,-0.726890,-0.651753,-0.216346,-0.715812,-0.639821,-0.279580,\n\t\t\t         -0.645222,-0.712821,-0.274819,-0.657918,-0.724937,-0.203803,-0.657918,-0.724937,-0.203803,-0.645222,-0.712821,-0.274819,\n\t\t\t         -0.571734,-0.773736,-0.272774,-0.596179,-0.776757,-0.202918,-0.715812,-0.639821,-0.279580,-0.689627,-0.634205,-0.349467,\n\t\t\t         -0.619678,-0.696341,-0.362011,-0.645222,-0.712821,-0.274819,-0.645222,-0.712821,-0.274819,-0.619678,-0.696341,-0.362011,\n\t\t\t         -0.546373,-0.755303,-0.361858,-0.571734,-0.773736,-0.272774,-0.965484,0.171209,-0.196204,-0.965423,-0.150090,-0.213019,\n\t\t\t         -0.965148,-0.180059,-0.189856,-0.971557,0.129154,-0.198401,-0.965423,-0.150090,-0.213019,-0.896115,-0.385815,-0.219337,\n\t\t\t         -0.902707,-0.389691,-0.182226,-0.965148,-0.180059,-0.189856,-0.965484,0.171209,-0.196204,-0.971557,0.129154,-0.198401,\n\t\t\t         -0.838771,0.515152,-0.176122,-0.840114,0.525010,-0.136235,-0.840114,0.525010,-0.136235,-0.838771,0.515152,-0.176122,\n\t\t\t         -0.583331,0.805322,-0.105411,-0.640675,0.767174,-0.030641,-0.965484,0.171209,-0.196204,-0.840114,0.525010,-0.136235,\n\t\t\t         -0.841823,0.521928,-0.137303,-0.958159,0.195166,-0.209265,-0.958159,0.195166,-0.209265,-0.841823,0.521928,-0.137303,\n\t\t\t         -0.835109,0.539232,-0.108371,-0.951689,0.231391,-0.201788,-0.840114,0.525010,-0.136235,-0.640675,0.767174,-0.030641,\n\t\t\t         -0.682455,0.730613,-0.020508,-0.841823,0.521928,-0.137303,-0.841823,0.521928,-0.137303,-0.682455,0.730613,-0.020508,\n\t\t\t         -0.714743,0.699362,-0.000519,-0.835109,0.539232,-0.108371,-0.965484,0.171209,-0.196204,-0.958159,0.195166,-0.209265,\n\t\t\t         -0.960509,-0.132786,-0.244484,-0.965423,-0.150090,-0.213019,-0.965423,-0.150090,-0.213019,-0.960509,-0.132786,-0.244484,\n\t\t\t         -0.885861,-0.382031,-0.263192,-0.896115,-0.385815,-0.219337,-0.958159,0.195166,-0.209265,-0.951689,0.231391,-0.201788,\n\t\t\t         -0.958190,-0.107028,-0.265328,-0.960509,-0.132786,-0.244484,-0.960509,-0.132786,-0.244484,-0.958190,-0.107028,-0.265328,\n\t\t\t         -0.877651,-0.372265,-0.301828,-0.885861,-0.382031,-0.263192,0.789941,-0.611652,0.042787,0.834162,-0.551500,-0.000183,\n\t\t\t         0.774621,-0.629505,-0.060213,0.727256,-0.684622,-0.048463,0.727256,-0.684622,-0.048463,0.774621,-0.629505,-0.060213,\n\t\t\t         0.611194,-0.783776,-0.109989,0.636708,-0.762413,-0.115238,0.789941,-0.611652,0.042787,0.727256,-0.684622,-0.048463,\n\t\t\t         0.670858,-0.741478,0.009705,0.764611,-0.639058,0.083163,0.764611,-0.639058,0.083163,0.670858,-0.741478,0.009705,\n\t\t\t         0.639546,-0.768731,0.003082,0.773431,-0.629505,0.074007,0.727256,-0.684622,-0.048463,0.636708,-0.762413,-0.115238,\n\t\t\t         0.625385,-0.777673,-0.063845,0.670858,-0.741478,0.009705,0.670858,-0.741478,0.009705,0.625385,-0.777673,-0.063845,\n\t\t\t         0.580767,-0.809809,-0.082766,0.639546,-0.768731,0.003082,0.789941,-0.611652,0.042787,0.764611,-0.639058,0.083163,\n\t\t\t         0.885403,-0.443892,0.137730,0.882839,-0.457595,0.105564,0.882839,-0.457595,0.105564,0.885403,-0.443892,0.137730,\n\t\t\t         0.949522,-0.260689,0.174474,0.952574,-0.272683,0.134831,0.764611,-0.639058,0.083163,0.773431,-0.629505,0.074007,\n\t\t\t         0.895230,-0.424879,0.134129,0.885403,-0.443892,0.137730,0.885403,-0.443892,0.137730,0.895230,-0.424879,0.134129,\n\t\t\t         0.950957,-0.251015,0.180609,0.949522,-0.260689,0.174474,0.789941,-0.611652,0.042787,0.882839,-0.457595,0.105564,\n\t\t\t         0.900296,-0.431989,0.053346,0.834162,-0.551500,-0.000183,0.882839,-0.457595,0.105564,0.952574,-0.272683,0.134831,\n\t\t\t         0.957579,-0.275643,0.083621,0.900296,-0.431989,0.053346,-0.074892,-0.980255,-0.182958,-0.125950,-0.981262,-0.145665,\n\t\t\t         -0.480941,-0.862300,-0.158422,-0.449446,-0.869472,-0.204932,-0.449446,-0.869472,-0.204932,-0.480941,-0.862300,-0.158422,\n\t\t\t         -0.619282,-0.769921,-0.153813,-0.596179,-0.776757,-0.202918,-0.074892,-0.980255,-0.182958,-0.449446,-0.869472,-0.204932,\n\t\t\t         -0.417676,-0.865993,-0.274880,-0.025941,-0.969634,-0.243171,-0.025941,-0.969634,-0.243171,-0.417676,-0.865993,-0.274880,\n\t\t\t         -0.376507,-0.853420,-0.360424,0.023225,-0.946135,-0.322825,-0.449446,-0.869472,-0.204932,-0.596179,-0.776757,-0.202918,\n\t\t\t         -0.571734,-0.773736,-0.272774,-0.417676,-0.865993,-0.274880,-0.417676,-0.865993,-0.274880,-0.571734,-0.773736,-0.272774,\n\t\t\t         -0.546373,-0.755303,-0.361858,-0.376507,-0.853420,-0.360424,-0.074892,-0.980255,-0.182958,-0.025941,-0.969634,-0.243171,\n\t\t\t         0.429029,-0.890561,-0.150975,0.380718,-0.913022,-0.146397,0.380718,-0.913022,-0.146397,0.429029,-0.890561,-0.150975,\n\t\t\t         0.625385,-0.777673,-0.063845,0.636708,-0.762413,-0.115238,-0.025941,-0.969634,-0.243171,0.023225,-0.946135,-0.322825,\n\t\t\t         0.430067,-0.879574,-0.203345,0.429029,-0.890561,-0.150975,0.429029,-0.890561,-0.150975,0.430067,-0.879574,-0.203345,\n\t\t\t         0.580767,-0.809809,-0.082766,0.625385,-0.777673,-0.063845,-0.074892,-0.980255,-0.182958,0.380718,-0.913022,-0.146397,\n\t\t\t         0.290658,-0.947813,-0.130802,-0.125950,-0.981262,-0.145665,0.380718,-0.913022,-0.146397,0.636708,-0.762413,-0.115238,\n\t\t\t         0.611194,-0.783776,-0.109989,0.290658,-0.947813,-0.130802,0.649251,0.736930,0.187964,0.653706,0.751122,0.091800,\n\t\t\t         0.755089,0.650624,0.080508,0.767571,0.610736,0.194342,0.767571,0.610736,0.194342,0.755089,0.650624,0.080508,\n\t\t\t         0.867641,0.493301,0.061739,0.869137,0.461318,0.178167,0.649251,0.736930,0.187964,0.767571,0.610736,0.194342,\n\t\t\t         0.766839,0.598041,0.232887,0.639241,0.725394,0.255196,0.639241,0.725394,0.255196,0.766839,0.598041,0.232887,\n\t\t\t         0.772729,0.615711,0.154088,0.648793,0.735313,0.195776,0.767571,0.610736,0.194342,0.869137,0.461318,0.178167,\n\t\t\t         0.851100,0.471114,0.231605,0.766839,0.598041,0.232887,0.766839,0.598041,0.232887,0.851100,0.471114,0.231605,\n\t\t\t         0.847774,0.505478,0.160405,0.772729,0.615711,0.154088,0.649251,0.736930,0.187964,0.639241,0.725394,0.255196,\n\t\t\t         0.417707,0.872494,0.253456,0.451399,0.882138,0.134312,0.451399,0.882138,0.134312,0.417707,0.872494,0.253456,\n\t\t\t         0.081545,0.984954,0.152318,0.071535,0.997192,0.022034,0.639241,0.725394,0.255196,0.648793,0.735313,0.195776,\n\t\t\t         0.423688,0.866909,0.262459,0.417707,0.872494,0.253456,0.417707,0.872494,0.253456,0.423688,0.866909,0.262459,\n\t\t\t         0.053041,0.951720,0.302255,0.081545,0.984954,0.152318,0.649251,0.736930,0.187964,0.451399,0.882138,0.134312,\n\t\t\t         0.447554,0.891476,0.070223,0.653706,0.751122,0.091800,0.451399,0.882138,0.134312,0.071535,0.997192,0.022034,\n\t\t\t         0.050600,0.998199,0.031861,0.447554,0.891476,0.070223,-0.550005,0.830866,0.084109,-0.553545,0.830897,0.056246,\n\t\t\t         -0.474319,0.879177,-0.044984,-0.525773,0.850398,-0.018220,-0.553545,0.830897,0.056246,-0.640675,0.767174,-0.030641,\n\t\t\t         -0.583331,0.805322,-0.105411,-0.474319,0.879177,-0.044984,-0.550005,0.830866,0.084109,-0.525773,0.850398,-0.018220,\n\t\t\t         -0.372845,0.927885,-0.001129,-0.355144,0.934477,0.024598,-0.355144,0.934477,0.024598,-0.372845,0.927885,-0.001129,\n\t\t\t         0.050600,0.998199,0.031861,0.071535,0.997192,0.022034,-0.550005,0.830866,0.084109,-0.355144,0.934477,0.024598,\n\t\t\t         -0.261238,0.962767,0.069491,-0.476943,0.872616,0.104923,-0.476943,0.872616,0.104923,-0.261238,0.962767,0.069491,\n\t\t\t         -0.221625,0.956481,0.189673,-0.438185,0.892300,0.108524,-0.355144,0.934477,0.024598,0.071535,0.997192,0.022034,\n\t\t\t         0.081545,0.984954,0.152318,-0.261238,0.962767,0.069491,-0.261238,0.962767,0.069491,0.081545,0.984954,0.152318,\n\t\t\t         0.053041,0.951720,0.302255,-0.221625,0.956481,0.189673,-0.550005,0.830866,0.084109,-0.476943,0.872616,0.104923,\n\t\t\t         -0.610889,0.786248,0.092654,-0.553545,0.830897,0.056246,-0.553545,0.830897,0.056246,-0.610889,0.786248,0.092654,\n\t\t\t         -0.682455,0.730613,-0.020508,-0.640675,0.767174,-0.030641,-0.476943,0.872616,0.104923,-0.438185,0.892300,0.108524,\n\t\t\t         -0.615284,0.784875,0.073183,-0.610889,0.786248,0.092654,-0.610889,0.786248,0.092654,-0.615284,0.784875,0.073183,\n\t\t\t         -0.714743,0.699362,-0.000519,-0.682455,0.730613,-0.020508,0.983581,0.098209,0.151372,0.996521,0.031526,0.076815,\n\t\t\t         0.988128,-0.124760,0.089480,0.984466,-0.092685,0.149052,0.984466,-0.092685,0.149052,0.988128,-0.124760,0.089480,\n\t\t\t         0.957579,-0.275643,0.083621,0.952574,-0.272683,0.134831,0.983581,0.098209,0.151372,0.984466,-0.092685,0.149052,\n\t\t\t         0.974792,-0.069033,0.212134,0.962127,0.135624,0.236427,0.962127,0.135624,0.236427,0.974792,-0.069033,0.212134,\n\t\t\t         0.973174,-0.049654,0.224525,0.955748,0.170019,0.240028,0.984466,-0.092685,0.149052,0.952574,-0.272683,0.134831,\n\t\t\t         0.949522,-0.260689,0.174474,0.974792,-0.069033,0.212134,0.974792,-0.069033,0.212134,0.949522,-0.260689,0.174474,\n\t\t\t         0.950957,-0.251015,0.180609,0.973174,-0.049654,0.224525,0.983581,0.098209,0.151372,0.962127,0.135624,0.236427,\n\t\t\t         0.916593,0.320780,0.238563,0.945952,0.283670,0.157109,0.945952,0.283670,0.157109,0.916593,0.320780,0.238563,\n\t\t\t         0.851100,0.471114,0.231605,0.869137,0.461318,0.178167,0.962127,0.135624,0.236427,0.955748,0.170019,0.240028,\n\t\t\t         0.907834,0.362896,0.209998,0.916593,0.320780,0.238563,0.916593,0.320780,0.238563,0.907834,0.362896,0.209998,\n\t\t\t         0.847774,0.505478,0.160405,0.851100,0.471114,0.231605,0.983581,0.098209,0.151372,0.945952,0.283670,0.157109,\n\t\t\t         0.968596,0.241432,0.059358,0.996521,0.031526,0.076815,0.945952,0.283670,0.157109,0.869137,0.461318,0.178167,\n\t\t\t         0.867641,0.493301,0.061739,0.968596,0.241432,0.059358,-0.589831,-0.674306,-0.444227,-0.610218,-0.669942,-0.422773,\n\t\t\t         -0.565264,-0.673177,-0.476699,-0.636250,-0.641591,-0.428358,-0.636250,-0.641591,-0.428358,-0.565264,-0.673177,-0.476699,\n\t\t\t         -0.619678,-0.696341,-0.362011,-0.689627,-0.634205,-0.349467,-0.610218,-0.669942,-0.422773,-0.599261,-0.687796,-0.409589,\n\t\t\t         -0.533341,-0.705924,-0.465987,-0.565264,-0.673177,-0.476699,-0.565264,-0.673177,-0.476699,-0.533341,-0.705924,-0.465987,\n\t\t\t         -0.546373,-0.755303,-0.361858,-0.619678,-0.696341,-0.362011,-0.589831,-0.674306,-0.444227,-0.636250,-0.641591,-0.428358,\n\t\t\t         -0.749077,-0.546037,-0.375072,-0.715964,-0.567492,-0.406568,-0.715964,-0.567492,-0.406568,-0.749077,-0.546037,-0.375072,\n\t\t\t         -0.874722,-0.357250,-0.327372,-0.864345,-0.356883,-0.354259,-0.636250,-0.641591,-0.428358,-0.689627,-0.634205,-0.349467,\n\t\t\t         -0.774651,-0.541093,-0.327219,-0.749077,-0.546037,-0.375072,-0.749077,-0.546037,-0.375072,-0.774651,-0.541093,-0.327219,\n\t\t\t         -0.877651,-0.372265,-0.301828,-0.874722,-0.357250,-0.327372,-0.589831,-0.674306,-0.444227,-0.715964,-0.567492,-0.406568,\n\t\t\t         -0.692770,-0.604633,-0.392987,-0.673666,-0.654683,-0.342814,-0.673666,-0.654683,-0.342814,-0.692770,-0.604633,-0.392987,\n\t\t\t         -0.789361,-0.576342,-0.211463,-0.735527,-0.641865,-0.216651,-0.715964,-0.567492,-0.406568,-0.864345,-0.356883,-0.354259,\n\t\t\t         -0.840846,-0.397534,-0.367290,-0.692770,-0.604633,-0.392987,-0.692770,-0.604633,-0.392987,-0.840846,-0.397534,-0.367290,\n\t\t\t         -0.860561,-0.456099,-0.226661,-0.789361,-0.576342,-0.211463,-0.589831,-0.674306,-0.444227,-0.673666,-0.654683,-0.342814,\n\t\t\t         -0.671377,-0.669546,-0.317667,-0.610218,-0.669942,-0.422773,-0.610218,-0.669942,-0.422773,-0.671377,-0.669546,-0.317667,\n\t\t\t         -0.656514,-0.700583,-0.279550,-0.599261,-0.687796,-0.409589,-0.673666,-0.654683,-0.342814,-0.735527,-0.641865,-0.216651,\n\t\t\t         -0.693564,-0.697165,-0.181371,-0.671377,-0.669546,-0.317667,-0.671377,-0.669546,-0.317667,-0.693564,-0.697165,-0.181371,\n\t\t\t         -0.663594,-0.725761,-0.181188,-0.656514,-0.700583,-0.279550,-0.952818,0.270150,-0.138279,-0.959288,-0.069338,-0.273751,\n\t\t\t         -0.959532,-0.076754,-0.270852,-0.948149,0.267800,-0.170934,-0.948149,0.267800,-0.170934,-0.959532,-0.076754,-0.270852,\n\t\t\t         -0.958190,-0.107028,-0.265328,-0.951689,0.231391,-0.201788,-0.959288,-0.069338,-0.273751,-0.864345,-0.356883,-0.354259,\n\t\t\t         -0.874722,-0.357250,-0.327372,-0.959532,-0.076754,-0.270852,-0.959532,-0.076754,-0.270852,-0.874722,-0.357250,-0.327372,\n\t\t\t         -0.877651,-0.372265,-0.301828,-0.958190,-0.107028,-0.265328,-0.952818,0.270150,-0.138279,-0.948149,0.267800,-0.170934,\n\t\t\t         -0.830714,0.554918,-0.043825,-0.826594,0.562792,0.000092,-0.826594,0.562792,0.000092,-0.830714,0.554918,-0.043825,\n\t\t\t         -0.721946,0.691031,0.035493,-0.689383,0.724326,0.007050,-0.948149,0.267800,-0.170934,-0.951689,0.231391,-0.201788,\n\t\t\t         -0.835109,0.539232,-0.108371,-0.830714,0.554918,-0.043825,-0.830714,0.554918,-0.043825,-0.835109,0.539232,-0.108371,\n\t\t\t         -0.714743,0.699362,-0.000519,-0.721946,0.691031,0.035493,-0.952818,0.270150,-0.138279,-0.826594,0.562792,0.000092,\n\t\t\t         -0.795740,0.597369,-0.099460,-0.948363,0.273080,-0.161260,-0.948363,0.273080,-0.161260,-0.795740,0.597369,-0.099460,\n\t\t\t         -0.800348,0.579608,-0.153111,-0.956725,0.218421,-0.192175,-0.826594,0.562792,0.000092,-0.689383,0.724326,0.007050,\n\t\t\t         -0.633869,0.765923,-0.107303,-0.795740,0.597369,-0.099460,-0.795740,0.597369,-0.099460,-0.633869,0.765923,-0.107303,\n\t\t\t         -0.610157,0.782891,-0.121372,-0.800348,0.579608,-0.153111,-0.952818,0.270150,-0.138279,-0.948363,0.273080,-0.161260,\n\t\t\t         -0.952483,-0.119510,-0.280099,-0.959288,-0.069338,-0.273751,-0.959288,-0.069338,-0.273751,-0.952483,-0.119510,-0.280099,\n\t\t\t         -0.840846,-0.397534,-0.367290,-0.864345,-0.356883,-0.354259,-0.948363,0.273080,-0.161260,-0.956725,0.218421,-0.192175,\n\t\t\t         -0.954375,-0.188330,-0.231697,-0.952483,-0.119510,-0.280099,-0.952483,-0.119510,-0.280099,-0.954375,-0.188330,-0.231697,\n\t\t\t         -0.860561,-0.456099,-0.226661,-0.840846,-0.397534,-0.367290,0.809046,-0.586963,0.029664,0.795190,-0.604083,0.052095,\n\t\t\t         0.631886,-0.774773,-0.019868,0.651418,-0.758324,-0.023316,0.651418,-0.758324,-0.023316,0.631886,-0.774773,-0.019868,\n\t\t\t         0.520554,-0.846858,-0.108554,0.479568,-0.873592,-0.082553,0.795190,-0.604083,0.052095,0.773431,-0.629505,0.074007,\n\t\t\t         0.639546,-0.768731,0.003082,0.631886,-0.774773,-0.019868,0.631886,-0.774773,-0.019868,0.639546,-0.768731,0.003082,\n\t\t\t         0.580767,-0.809809,-0.082766,0.520554,-0.846858,-0.108554,0.809046,-0.586963,0.029664,0.651418,-0.758324,-0.023316,\n\t\t\t         0.695669,-0.717124,-0.041566,0.798456,-0.601978,-0.008301,0.798456,-0.601978,-0.008301,0.695669,-0.717124,-0.041566,\n\t\t\t         0.711539,-0.702261,0.022584,0.750694,-0.659261,0.042390,0.651418,-0.758324,-0.023316,0.479568,-0.873592,-0.082553,\n\t\t\t         0.514542,-0.855159,-0.062441,0.695669,-0.717124,-0.041566,0.695669,-0.717124,-0.041566,0.514542,-0.855159,-0.062441,\n\t\t\t         0.607501,-0.794275,-0.002594,0.711539,-0.702261,0.022584,0.809046,-0.586963,0.029664,0.798456,-0.601978,-0.008301,\n\t\t\t         0.865963,-0.496506,0.059328,0.895383,-0.434462,0.097385,0.895383,-0.434462,0.097385,0.865963,-0.496506,0.059328,\n\t\t\t         0.935697,-0.316599,0.155492,0.949126,-0.257790,0.180731,0.798456,-0.601978,-0.008301,0.750694,-0.659261,0.042390,\n\t\t\t         0.827906,-0.556597,0.068636,0.865963,-0.496506,0.059328,0.865963,-0.496506,0.059328,0.827906,-0.556597,0.068636,\n\t\t\t         0.922605,-0.366955,0.118778,0.935697,-0.316599,0.155492,0.809046,-0.586963,0.029664,0.895383,-0.434462,0.097385,\n\t\t\t         0.901883,-0.416181,0.115604,0.795190,-0.604083,0.052095,0.795190,-0.604083,0.052095,0.901883,-0.416181,0.115604,\n\t\t\t         0.895230,-0.424879,0.134129,0.773431,-0.629505,0.074007,0.895383,-0.434462,0.097385,0.949126,-0.257790,0.180731,\n\t\t\t         0.954314,-0.242409,0.174566,0.901883,-0.416181,0.115604,0.901883,-0.416181,0.115604,0.954314,-0.242409,0.174566,\n\t\t\t         0.950957,-0.251015,0.180609,0.895230,-0.424879,0.134129,0.007569,-0.951903,-0.306192,0.045259,-0.927702,-0.370495,\n\t\t\t         -0.356914,-0.826014,-0.436201,-0.408582,-0.827723,-0.384564,-0.408582,-0.827723,-0.384564,-0.356914,-0.826014,-0.436201,\n\t\t\t         -0.533341,-0.705924,-0.465987,-0.599261,-0.687796,-0.409589,0.045259,-0.927702,-0.370495,0.023225,-0.946135,-0.322825,\n\t\t\t         -0.376507,-0.853420,-0.360424,-0.356914,-0.826014,-0.436201,-0.356914,-0.826014,-0.436201,-0.376507,-0.853420,-0.360424,\n\t\t\t         -0.546373,-0.755303,-0.361858,-0.533341,-0.705924,-0.465987,0.007569,-0.951903,-0.306192,-0.408582,-0.827723,-0.384564,\n\t\t\t         -0.443190,-0.852504,-0.277047,-0.048067,-0.978423,-0.200873,-0.048067,-0.978423,-0.200873,-0.443190,-0.852504,-0.277047,\n\t\t\t         -0.543962,-0.820215,-0.176916,-0.070956,-0.992889,-0.095462,-0.408582,-0.827723,-0.384564,-0.599261,-0.687796,-0.409589,\n\t\t\t         -0.656514,-0.700583,-0.279550,-0.443190,-0.852504,-0.277047,-0.443190,-0.852504,-0.277047,-0.656514,-0.700583,-0.279550,\n\t\t\t         -0.663594,-0.725761,-0.181188,-0.543962,-0.820215,-0.176916,0.007569,-0.951903,-0.306192,-0.048067,-0.978423,-0.200873,\n\t\t\t         0.293161,-0.950285,-0.104862,0.319254,-0.930815,-0.177862,0.319254,-0.930815,-0.177862,0.293161,-0.950285,-0.104862,\n\t\t\t         0.514542,-0.855159,-0.062441,0.479568,-0.873592,-0.082553,-0.048067,-0.978423,-0.200873,-0.070956,-0.992889,-0.095462,\n\t\t\t         0.381054,-0.924192,-0.024781,0.293161,-0.950285,-0.104862,0.293161,-0.950285,-0.104862,0.381054,-0.924192,-0.024781,\n\t\t\t         0.607501,-0.794275,-0.002594,0.514542,-0.855159,-0.062441,0.007569,-0.951903,-0.306192,0.319254,-0.930815,-0.177862,\n\t\t\t         0.388684,-0.890835,-0.235084,0.045259,-0.927702,-0.370495,0.045259,-0.927702,-0.370495,0.388684,-0.890835,-0.235084,\n\t\t\t         0.430067,-0.879574,-0.203345,0.023225,-0.946135,-0.322825,0.319254,-0.930815,-0.177862,0.479568,-0.873592,-0.082553,\n\t\t\t         0.520554,-0.846858,-0.108554,0.388684,-0.890835,-0.235084,0.388684,-0.890835,-0.235084,0.520554,-0.846858,-0.108554,\n\t\t\t         0.580767,-0.809809,-0.082766,0.430067,-0.879574,-0.203345,0.619465,0.770043,0.152470,0.647053,0.749657,0.138920,\n\t\t\t         0.762719,0.632557,0.134434,0.716910,0.654469,0.240120,0.716910,0.654469,0.240120,0.762719,0.632557,0.134434,\n\t\t\t         0.820338,0.539933,0.188360,0.776482,0.563891,0.281167,0.647053,0.749657,0.138920,0.648793,0.735313,0.195776,\n\t\t\t         0.772729,0.615711,0.154088,0.762719,0.632557,0.134434,0.762719,0.632557,0.134434,0.772729,0.615711,0.154088,\n\t\t\t         0.847774,0.505478,0.160405,0.820338,0.539933,0.188360,0.619465,0.770043,0.152470,0.716910,0.654469,0.240120,\n\t\t\t         0.680532,0.684652,0.260964,0.557207,0.806330,0.198248,0.557207,0.806330,0.198248,0.680532,0.684652,0.260964,\n\t\t\t         0.681539,0.710959,0.173284,0.531388,0.834437,0.145817,0.716910,0.654469,0.240120,0.776482,0.563891,0.281167,\n\t\t\t         0.756828,0.586383,0.288675,0.680532,0.684652,0.260964,0.680532,0.684652,0.260964,0.756828,0.586383,0.288675,\n\t\t\t         0.771996,0.607013,0.188452,0.681539,0.710959,0.173284,0.619465,0.770043,0.152470,0.557207,0.806330,0.198248,\n\t\t\t         0.364696,0.926939,0.088076,0.393475,0.915677,0.081790,0.393475,0.915677,0.081790,0.364696,0.926939,0.088076,\n\t\t\t         0.090487,0.994293,-0.056215,0.056551,0.996429,0.062227,0.557207,0.806330,0.198248,0.531388,0.834437,0.145817,\n\t\t\t         0.322764,0.940947,0.102054,0.364696,0.926939,0.088076,0.364696,0.926939,0.088076,0.322764,0.940947,0.102054,\n\t\t\t         0.044404,0.998444,0.033418,0.090487,0.994293,-0.056215,0.619465,0.770043,0.152470,0.393475,0.915677,0.081790,\n\t\t\t         0.404370,0.889370,0.213233,0.647053,0.749657,0.138920,0.647053,0.749657,0.138920,0.404370,0.889370,0.213233,\n\t\t\t         0.423688,0.866909,0.262459,0.648793,0.735313,0.195776,0.393475,0.915677,0.081790,0.056551,0.996429,0.062227,\n\t\t\t         0.064760,0.964751,0.254982,0.404370,0.889370,0.213233,0.404370,0.889370,0.213233,0.064760,0.964751,0.254982,\n\t\t\t         0.053041,0.951720,0.302255,0.423688,0.866909,0.262459,-0.384533,0.922544,-0.031617,-0.543382,0.839015,-0.027345,\n\t\t\t         -0.589862,0.805322,0.059084,-0.416395,0.899564,0.131809,-0.416395,0.899564,0.131809,-0.589862,0.805322,0.059084,\n\t\t\t         -0.615284,0.784875,0.073183,-0.438185,0.892300,0.108524,-0.543382,0.839015,-0.027345,-0.689383,0.724326,0.007050,\n\t\t\t         -0.721946,0.691031,0.035493,-0.589862,0.805322,0.059084,-0.589862,0.805322,0.059084,-0.721946,0.691031,0.035493,\n\t\t\t         -0.714743,0.699362,-0.000519,-0.615284,0.784875,0.073183,-0.384533,0.922544,-0.031617,-0.416395,0.899564,0.131809,\n\t\t\t         -0.245155,0.938780,0.242012,-0.213965,0.976806,0.007355,-0.213965,0.976806,0.007355,-0.245155,0.938780,0.242012,\n\t\t\t         0.064760,0.964751,0.254982,0.056551,0.996429,0.062227,-0.416395,0.899564,0.131809,-0.438185,0.892300,0.108524,\n\t\t\t         -0.221625,0.956481,0.189673,-0.245155,0.938780,0.242012,-0.245155,0.938780,0.242012,-0.221625,0.956481,0.189673,\n\t\t\t         0.053041,0.951720,0.302255,0.064760,0.964751,0.254982,-0.384533,0.922544,-0.031617,-0.213965,0.976806,0.007355,\n\t\t\t         -0.179785,0.972076,-0.150609,-0.358135,0.918699,-0.166417,-0.358135,0.918699,-0.166417,-0.179785,0.972076,-0.150609,\n\t\t\t         -0.244087,0.968627,-0.046632,-0.378246,0.921140,-0.091494,-0.213965,0.976806,0.007355,0.056551,0.996429,0.062227,\n\t\t\t         0.090487,0.994293,-0.056215,-0.179785,0.972076,-0.150609,-0.179785,0.972076,-0.150609,0.090487,0.994293,-0.056215,\n\t\t\t         0.044404,0.998444,0.033418,-0.244087,0.968627,-0.046632,-0.384533,0.922544,-0.031617,-0.358135,0.918699,-0.166417,\n\t\t\t         -0.495437,0.856533,-0.144322,-0.543382,0.839015,-0.027345,-0.543382,0.839015,-0.027345,-0.495437,0.856533,-0.144322,\n\t\t\t         -0.633869,0.765923,-0.107303,-0.689383,0.724326,0.007050,-0.358135,0.918699,-0.166417,-0.378246,0.921140,-0.091494,\n\t\t\t         -0.455641,0.883908,-0.105167,-0.495437,0.856533,-0.144322,-0.495437,0.856533,-0.144322,-0.455641,0.883908,-0.105167,\n\t\t\t         -0.610157,0.782891,-0.121372,-0.633869,0.765923,-0.107303,0.925596,0.233985,0.297433,0.946532,0.209784,0.245064,\n\t\t\t         0.974303,-0.026734,0.223487,0.966643,-0.022340,0.255074,0.966643,-0.022340,0.255074,0.974303,-0.026734,0.223487,\n\t\t\t         0.954314,-0.242409,0.174566,0.949126,-0.257790,0.180731,0.946532,0.209784,0.245064,0.955748,0.170019,0.240028,\n\t\t\t         0.973174,-0.049654,0.224525,0.974303,-0.026734,0.223487,0.974303,-0.026734,0.223487,0.973174,-0.049654,0.224525,\n\t\t\t         0.950957,-0.251015,0.180609,0.954314,-0.242409,0.174566,0.925596,0.233985,0.297433,0.966643,-0.022340,0.255074,\n\t\t\t         0.968322,-0.053163,0.243873,0.926328,0.236061,0.293466,0.926328,0.236061,0.293466,0.968322,-0.053163,0.243873,\n\t\t\t         0.981536,-0.087924,0.169774,0.952788,0.230506,0.197546,0.966643,-0.022340,0.255074,0.949126,-0.257790,0.180731,\n\t\t\t         0.935697,-0.316599,0.155492,0.968322,-0.053163,0.243873,0.968322,-0.053163,0.243873,0.935697,-0.316599,0.155492,\n\t\t\t         0.922605,-0.366955,0.118778,0.981536,-0.087924,0.169774,0.925596,0.233985,0.297433,0.926328,0.236061,0.293466,\n\t\t\t         0.835231,0.460097,0.301096,0.845119,0.440809,0.302316,0.845119,0.440809,0.302316,0.835231,0.460097,0.301096,\n\t\t\t         0.756828,0.586383,0.288675,0.776482,0.563891,0.281167,0.926328,0.236061,0.293466,0.952788,0.230506,0.197546,\n\t\t\t         0.857387,0.474929,0.198187,0.835231,0.460097,0.301096,0.835231,0.460097,0.301096,0.857387,0.474929,0.198187,\n\t\t\t         0.771996,0.607013,0.188452,0.756828,0.586383,0.288675,0.925596,0.233985,0.297433,0.845119,0.440809,0.302316,\n\t\t\t         0.882717,0.409894,0.229713,0.946532,0.209784,0.245064,0.946532,0.209784,0.245064,0.882717,0.409894,0.229713,\n\t\t\t         0.907834,0.362896,0.209998,0.955748,0.170019,0.240028,0.845119,0.440809,0.302316,0.776482,0.563891,0.281167,\n\t\t\t         0.820338,0.539933,0.188360,0.882717,0.409894,0.229713,0.882717,0.409894,0.229713,0.820338,0.539933,0.188360,\n\t\t\t         0.847774,0.505478,0.160405,0.907834,0.362896,0.209998,-0.726737,-0.682913,-0.073824,-0.663594,-0.725761,-0.181188,\n\t\t\t         -0.693564,-0.697165,-0.181371,-0.682028,-0.726646,-0.082369,-0.734977,-0.671621,-0.093387,-0.735527,-0.641865,-0.216651,\n\t\t\t         -0.789361,-0.576342,-0.211463,-0.845119,-0.522782,-0.111423,-0.845119,-0.522782,-0.111423,-0.789361,-0.576342,-0.211463,\n\t\t\t         -0.860561,-0.456099,-0.226661,-0.915647,-0.373150,-0.149266,-0.965606,-0.193182,-0.173833,-0.954375,-0.188330,-0.231697,\n\t\t\t         -0.956725,0.218421,-0.192175,-0.974883,0.147710,-0.166540,-0.734977,-0.671621,-0.093387,-0.845119,-0.522782,-0.111423,\n\t\t\t         -0.875546,-0.466842,-0.124271,-0.715903,-0.694418,-0.072329,-0.715903,-0.694418,-0.072329,-0.875546,-0.466842,-0.124271,\n\t\t\t         -0.912595,-0.406812,-0.040651,-0.774590,-0.632221,0.015473,-0.845119,-0.522782,-0.111423,-0.915647,-0.373150,-0.149266,\n\t\t\t         -0.947569,-0.274422,-0.163549,-0.875546,-0.466842,-0.124271,-0.875546,-0.466842,-0.124271,-0.947569,-0.274422,-0.163549,\n\t\t\t         -0.971129,-0.228919,-0.066775,-0.912595,-0.406812,-0.040651,-0.734977,-0.671621,-0.093387,-0.715903,-0.694418,-0.072329,\n\t\t\t         -0.745415,-0.664541,-0.051851,-0.682028,-0.726646,-0.082369,-0.682028,-0.726646,-0.082369,-0.745415,-0.664541,-0.051851,\n\t\t\t         -0.791223,-0.610096,-0.041658,-0.726737,-0.682913,-0.073824,-0.715903,-0.694418,-0.072329,-0.774590,-0.632221,0.015473,\n\t\t\t         -0.789544,-0.612995,0.028596,-0.745415,-0.664541,-0.051851,-0.745415,-0.664541,-0.051851,-0.789544,-0.612995,0.028596,\n\t\t\t         -0.787011,-0.616291,0.027772,-0.791223,-0.610096,-0.041658,-0.860561,-0.456099,-0.226661,-0.954375,-0.188330,-0.231697,\n\t\t\t         -0.965606,-0.193182,-0.173833,-0.915647,-0.373150,-0.149266,-0.974883,0.147710,-0.166540,-0.956725,0.218421,-0.192175,\n\t\t\t         -0.800348,0.579608,-0.153111,-0.852565,0.506088,-0.130161,-0.852565,0.506088,-0.130161,-0.800348,0.579608,-0.153111,\n\t\t\t         -0.610157,0.782891,-0.121372,-0.626026,0.774712,-0.088595,0.710959,-0.701132,0.053865,0.750694,-0.659261,0.042390,\n\t\t\t         0.711539,-0.702261,0.022584,0.695181,-0.716697,0.055208,-0.974883,0.147710,-0.166540,-0.852565,0.506088,-0.130161,\n\t\t\t         -0.864772,0.477309,-0.155889,-0.984619,0.054048,-0.166082,-0.984619,0.054048,-0.166082,-0.864772,0.477309,-0.155889,\n\t\t\t         -0.836390,0.524003,-0.160772,-0.986663,0.090060,-0.135441,-0.852565,0.506088,-0.130161,-0.626026,0.774712,-0.088595,\n\t\t\t         -0.592730,0.796442,-0.119602,-0.864772,0.477309,-0.155889,-0.864772,0.477309,-0.155889,-0.592730,0.796442,-0.119602,\n\t\t\t         -0.590106,0.795679,-0.136509,-0.836390,0.524003,-0.160772,-0.974883,0.147710,-0.166540,-0.984619,0.054048,-0.166082,\n\t\t\t         -0.963317,-0.206824,-0.170873,-0.965606,-0.193182,-0.173833,-0.965606,-0.193182,-0.173833,-0.963317,-0.206824,-0.170873,\n\t\t\t         -0.947569,-0.274422,-0.163549,-0.915647,-0.373150,-0.149266,-0.984619,0.054048,-0.166082,-0.986663,0.090060,-0.135441,\n\t\t\t         -0.978484,-0.186163,-0.088687,-0.963317,-0.206824,-0.170873,-0.963317,-0.206824,-0.170873,-0.978484,-0.186163,-0.088687,\n\t\t\t         -0.971129,-0.228919,-0.066775,-0.947569,-0.274422,-0.163549,0.695181,-0.716697,0.055208,0.711539,-0.702261,0.022584,\n\t\t\t         0.607501,-0.794275,-0.002594,0.656209,-0.752312,0.058260,0.806055,-0.586505,0.079104,0.827906,-0.556597,0.068636,\n\t\t\t         0.750694,-0.659261,0.042390,0.710959,-0.701132,0.053865,0.710959,-0.701132,0.053865,0.695181,-0.716697,0.055208,\n\t\t\t         0.736930,-0.673788,0.053835,0.739372,-0.672109,0.039644,0.739372,-0.672109,0.039644,0.736930,-0.673788,0.053835,\n\t\t\t         0.802698,-0.588397,0.097140,0.799738,-0.595386,0.076632,0.695181,-0.716697,0.055208,0.656209,-0.752312,0.058260,\n\t\t\t         0.700125,-0.709769,0.077273,0.736930,-0.673788,0.053835,0.736930,-0.673788,0.053835,0.700125,-0.709769,0.077273,\n\t\t\t         0.728813,-0.675680,0.110752,0.802698,-0.588397,0.097140,0.710959,-0.701132,0.053865,0.739372,-0.672109,0.039644,\n\t\t\t         0.790704,-0.610981,0.038179,0.806055,-0.586505,0.079104,0.806055,-0.586505,0.079104,0.790704,-0.610981,0.038179,\n\t\t\t         0.900601,-0.430067,0.062532,0.919950,-0.376659,0.108524,0.739372,-0.672109,0.039644,0.799738,-0.595386,0.076632,\n\t\t\t         0.813715,-0.578845,0.052370,0.790704,-0.610981,0.038179,0.790704,-0.610981,0.038179,0.813715,-0.578845,0.052370,\n\t\t\t         0.883267,-0.468001,0.027589,0.900601,-0.430067,0.062532,0.922605,-0.366955,0.118778,0.827906,-0.556597,0.068636,\n\t\t\t         0.806055,-0.586505,0.079104,0.919950,-0.376659,0.108524,-0.019227,-0.999603,0.020508,-0.070956,-0.992889,-0.095462,\n\t\t\t         -0.543962,-0.820215,-0.176916,-0.598804,-0.799707,-0.043336,-0.598804,-0.799707,-0.043336,-0.543962,-0.820215,-0.176916,\n\t\t\t         -0.663594,-0.725761,-0.181188,-0.726737,-0.682913,-0.073824,0.483261,-0.873653,0.056093,0.381054,-0.924192,-0.024781,\n\t\t\t         -0.070956,-0.992889,-0.095462,-0.019227,-0.999603,0.020508,-0.019227,-0.999603,0.020508,-0.598804,-0.799707,-0.043336,\n\t\t\t         -0.574816,-0.818171,-0.010651,0.004486,-0.998505,0.053957,0.004486,-0.998505,0.053957,-0.574816,-0.818171,-0.010651,\n\t\t\t         -0.533860,-0.844783,0.036348,-0.021516,-0.996307,0.083010,-0.598804,-0.799707,-0.043336,-0.726737,-0.682913,-0.073824,\n\t\t\t         -0.791223,-0.610096,-0.041658,-0.574816,-0.818171,-0.010651,-0.574816,-0.818171,-0.010651,-0.791223,-0.610096,-0.041658,\n\t\t\t         -0.787011,-0.616291,0.027772,-0.533860,-0.844783,0.036348,-0.019227,-0.999603,0.020508,0.004486,-0.998505,0.053957,\n\t\t\t         0.516404,-0.851894,0.086947,0.483261,-0.873653,0.056093,0.483261,-0.873653,0.056093,0.516404,-0.851894,0.086947,\n\t\t\t         0.700125,-0.709769,0.077273,0.656209,-0.752312,0.058260,0.004486,-0.998505,0.053957,-0.021516,-0.996307,0.083010,\n\t\t\t         0.491714,-0.863063,0.115238,0.516404,-0.851894,0.086947,0.516404,-0.851894,0.086947,0.491714,-0.863063,0.115238,\n\t\t\t         0.728813,-0.675680,0.110752,0.700125,-0.709769,0.077273,0.656209,-0.752312,0.058260,0.607501,-0.794275,-0.002594,\n\t\t\t         0.381054,-0.924192,-0.024781,0.483261,-0.873653,0.056093,0.568285,0.816767,0.099582,0.531388,0.834437,0.145817,\n\t\t\t         0.681539,0.710959,0.173284,0.703543,0.703574,0.099826,0.703543,0.703574,0.099826,0.681539,0.710959,0.173284,\n\t\t\t         0.771996,0.607013,0.188452,0.788446,0.606494,0.102268,0.367870,0.924619,0.098361,0.322764,0.940947,0.102054,\n\t\t\t         0.531388,0.834437,0.145817,0.568285,0.816767,0.099582,0.568285,0.816767,0.099582,0.703543,0.703574,0.099826,\n\t\t\t         0.733085,0.676412,0.070986,0.626576,0.775414,0.078158,0.626576,0.775414,0.078158,0.733085,0.676412,0.070986,\n\t\t\t         0.749016,0.661550,0.035524,0.656301,0.754112,0.023011,0.703543,0.703574,0.099826,0.788446,0.606494,0.102268,\n\t\t\t         0.798364,0.597949,0.070803,0.733085,0.676412,0.070986,0.733085,0.676412,0.070986,0.798364,0.597949,0.070803,\n\t\t\t         0.811701,0.582781,0.038789,0.749016,0.661550,0.035524,0.568285,0.816767,0.099582,0.626576,0.775414,0.078158,\n\t\t\t         0.443617,0.892239,0.084109,0.367870,0.924619,0.098361,0.367870,0.924619,0.098361,0.443617,0.892239,0.084109,\n\t\t\t         0.117374,0.990570,0.070315,0.057497,0.995117,0.080142,0.626576,0.775414,0.078158,0.656301,0.754112,0.023011,\n\t\t\t         0.487289,0.873196,0.003632,0.443617,0.892239,0.084109,0.443617,0.892239,0.084109,0.487289,0.873196,0.003632,\n\t\t\t         0.170598,0.984985,-0.025300,0.117374,0.990570,0.070315,0.044404,0.998444,0.033418,0.322764,0.940947,0.102054,\n\t\t\t         0.367870,0.924619,0.098361,0.057497,0.995117,0.080142,-0.445540,0.893582,-0.054476,-0.455641,0.883908,-0.105167,\n\t\t\t         -0.378246,0.921140,-0.091494,-0.474746,0.879452,-0.033998,-0.610157,0.782891,-0.121372,-0.455641,0.883908,-0.105167,\n\t\t\t         -0.445540,0.893582,-0.054476,-0.626026,0.774712,-0.088595,-0.474746,0.879452,-0.033998,-0.378246,0.921140,-0.091494,\n\t\t\t         -0.244087,0.968627,-0.046632,-0.337687,0.941069,0.017823,-0.337687,0.941069,0.017823,-0.244087,0.968627,-0.046632,\n\t\t\t         0.044404,0.998444,0.033418,0.057497,0.995117,0.080142,0.966155,0.228706,0.119114,0.952788,0.230506,0.197546,\n\t\t\t         0.981536,-0.087924,0.169774,0.987854,-0.095798,0.122196,-0.474746,0.879452,-0.033998,-0.337687,0.941069,0.017823,\n\t\t\t         -0.352367,0.935789,0.010437,-0.604846,0.794366,-0.055452,-0.604846,0.794366,-0.055452,-0.352367,0.935789,0.010437,\n\t\t\t         -0.314341,0.947172,-0.063478,-0.684255,0.723319,-0.092654,-0.337687,0.941069,0.017823,0.057497,0.995117,0.080142,\n\t\t\t         0.117374,0.990570,0.070315,-0.352367,0.935789,0.010437,-0.352367,0.935789,0.010437,0.117374,0.990570,0.070315,\n\t\t\t         0.170598,0.984985,-0.025300,-0.314341,0.947172,-0.063478,-0.474746,0.879452,-0.033998,-0.604846,0.794366,-0.055452,\n\t\t\t         -0.537187,0.839076,-0.085635,-0.445540,0.893582,-0.054476,-0.445540,0.893582,-0.054476,-0.537187,0.839076,-0.085635,\n\t\t\t         -0.592730,0.796442,-0.119602,-0.626026,0.774712,-0.088595,-0.604846,0.794366,-0.055452,-0.684255,0.723319,-0.092654,\n\t\t\t         -0.651082,0.750481,-0.113224,-0.537187,0.839076,-0.085635,-0.537187,0.839076,-0.085635,-0.651082,0.750481,-0.113224,\n\t\t\t         -0.590106,0.795679,-0.136509,-0.592730,0.796442,-0.119602,0.987854,-0.095798,0.122196,0.981536,-0.087924,0.169774,\n\t\t\t         0.922605,-0.366955,0.118778,0.919950,-0.376659,0.108524,0.873104,0.475143,0.108951,0.857387,0.474929,0.198187,\n\t\t\t         0.952788,0.230506,0.197546,0.966155,0.228706,0.119114,0.966155,0.228706,0.119114,0.987854,-0.095798,0.122196,\n\t\t\t         0.986847,-0.133976,0.090304,0.970122,0.222541,0.096591,0.970122,0.222541,0.096591,0.986847,-0.133976,0.090304,\n\t\t\t         0.978210,-0.206732,0.018616,0.985534,0.167577,0.023865,0.987854,-0.095798,0.122196,0.919950,-0.376659,0.108524,\n\t\t\t         0.900601,-0.430067,0.062532,0.986847,-0.133976,0.090304,0.986847,-0.133976,0.090304,0.900601,-0.430067,0.062532,\n\t\t\t         0.883267,-0.468001,0.027589,0.978210,-0.206732,0.018616,0.966155,0.228706,0.119114,0.970122,0.222541,0.096591,\n\t\t\t         0.874203,0.478561,0.081942,0.873104,0.475143,0.108951,0.873104,0.475143,0.108951,0.874203,0.478561,0.081942,\n\t\t\t         0.798364,0.597949,0.070803,0.788446,0.606494,0.102268,0.970122,0.222541,0.096591,0.985534,0.167577,0.023865,\n\t\t\t         0.891018,0.452742,0.032319,0.874203,0.478561,0.081942,0.874203,0.478561,0.081942,0.891018,0.452742,0.032319,\n\t\t\t         0.811701,0.582781,0.038789,0.798364,0.597949,0.070803,0.788446,0.606494,0.102268,0.771996,0.607013,0.188452,\n\t\t\t         0.857387,0.474929,0.198187,0.873104,0.475143,0.108951,0.775353,-0.625446,-0.087130,0.796075,-0.572558,-0.195898,\n\t\t\t         0.695364,-0.691702,-0.194922,0.687368,-0.720389,-0.092441,-0.813959,-0.573840,0.090396,-0.847530,-0.519242,0.109775,\n\t\t\t         -0.724967,-0.669668,0.161016,-0.731468,-0.674032,0.102969,-0.859615,-0.508316,0.051363,-0.813959,-0.573840,0.090396,\n\t\t\t         -0.789544,-0.612995,0.028596,-0.774590,-0.632221,0.015473,-0.799951,0.583087,-0.141514,-0.858882,0.512131,0.002838,\n\t\t\t         -0.902463,0.429945,-0.025849,-0.950438,0.287515,-0.118107,-0.813959,-0.573840,0.090396,-0.731468,-0.674032,0.102969,\n\t\t\t         -0.787011,-0.616291,0.027772,-0.789544,-0.612995,0.028596,-0.985260,-0.169805,-0.020569,-0.996185,-0.082186,-0.028504,\n\t\t\t         -0.967772,-0.251625,0.009186,-0.943999,-0.329814,0.006531,-0.859615,-0.508316,0.051363,-0.920225,-0.387127,0.057100,\n\t\t\t         -0.847530,-0.519242,0.109775,-0.813959,-0.573840,0.090396,-0.859615,-0.508316,0.051363,-0.774590,-0.632221,0.015473,\n\t\t\t         -0.912595,-0.406812,-0.040651,-0.943999,-0.329814,0.006531,-0.943999,-0.329814,0.006531,-0.912595,-0.406812,-0.040651,\n\t\t\t         -0.971129,-0.228919,-0.066775,-0.985260,-0.169805,-0.020569,-0.920225,-0.387127,0.057100,-0.967772,-0.251625,0.009186,\n\t\t\t         -0.978088,-0.206336,-0.026826,-0.940092,-0.340861,-0.002167,-0.967772,-0.251625,0.009186,-0.996185,-0.082186,-0.028504,\n\t\t\t         -0.998474,-0.045930,-0.030183,-0.978088,-0.206336,-0.026826,-0.920225,-0.387127,0.057100,-0.940092,-0.340861,-0.002167,\n\t\t\t         -0.867885,-0.495773,0.030946,-0.847530,-0.519242,0.109775,-0.847530,-0.519242,0.109775,-0.867885,-0.495773,0.030946,\n\t\t\t         -0.741234,-0.667989,0.065767,-0.724967,-0.669668,0.161016,-0.998138,0.000397,-0.060915,-0.978545,0.199713,-0.050478,\n\t\t\t         -0.996185,-0.082186,-0.028504,-0.985260,-0.169805,-0.020569,-0.950438,0.287515,-0.118107,-0.998138,0.000397,-0.060915,\n\t\t\t         -0.978484,-0.186163,-0.088687,-0.986663,0.090060,-0.135441,0.821863,-0.556261,0.122654,0.818659,-0.560808,0.123478,\n\t\t\t         0.875759,-0.473373,0.094424,0.851070,-0.514145,0.106235,-0.998138,0.000397,-0.060915,-0.985260,-0.169805,-0.020569,\n\t\t\t         -0.971129,-0.228919,-0.066775,-0.978484,-0.186163,-0.088687,-0.705954,0.699911,-0.108341,-0.817957,0.575213,-0.004303,\n\t\t\t         -0.858882,0.512131,0.002838,-0.799951,0.583087,-0.141514,-0.950438,0.287515,-0.118107,-0.902463,0.429945,-0.025849,\n\t\t\t         -0.978545,0.199713,-0.050478,-0.998138,0.000397,-0.060915,-0.950438,0.287515,-0.118107,-0.986663,0.090060,-0.135441,\n\t\t\t         -0.836390,0.524003,-0.160772,-0.799951,0.583087,-0.141514,-0.799951,0.583087,-0.141514,-0.836390,0.524003,-0.160772,\n\t\t\t         -0.590106,0.795679,-0.136509,-0.705954,0.699911,-0.108341,-0.902463,0.429945,-0.025849,-0.858882,0.512131,0.002838,\n\t\t\t         -0.897946,0.426160,0.109806,-0.923215,0.377789,0.070009,-0.858882,0.512131,0.002838,-0.817957,0.575213,-0.004303,\n\t\t\t         -0.815546,0.577258,0.039888,-0.897946,0.426160,0.109806,-0.902463,0.429945,-0.025849,-0.923215,0.377789,0.070009,\n\t\t\t         -0.980865,0.194189,0.011658,-0.978545,0.199713,-0.050478,-0.978545,0.199713,-0.050478,-0.980865,0.194189,0.011658,\n\t\t\t         -0.998474,-0.045930,-0.030183,-0.996185,-0.082186,-0.028504,0.716239,-0.678579,0.162847,0.818659,-0.560808,0.123478,\n\t\t\t         0.821863,-0.556261,0.122654,0.724509,-0.674154,0.143498,0.916562,-0.393780,0.069521,0.873928,-0.477767,0.089022,\n\t\t\t         0.851070,-0.514145,0.106235,0.875759,-0.473373,0.094424,0.851070,-0.514145,0.106235,0.799738,-0.595386,0.076632,\n\t\t\t         0.802698,-0.588397,0.097140,0.821863,-0.556261,0.122654,0.821863,-0.556261,0.122654,0.802698,-0.588397,0.097140,\n\t\t\t         0.728813,-0.675680,0.110752,0.724509,-0.674154,0.143498,0.875759,-0.473373,0.094424,0.818659,-0.560808,0.123478,\n\t\t\t         0.824000,-0.563005,0.063051,0.885159,-0.463759,0.037446,0.818659,-0.560808,0.123478,0.716239,-0.678579,0.162847,\n\t\t\t         0.719108,-0.689413,0.086917,0.824000,-0.563005,0.063051,0.919370,-0.389569,0.054231,0.873928,-0.477767,0.089022,\n\t\t\t         0.916562,-0.393780,0.069521,0.960540,-0.274819,0.042360,-0.505264,-0.853816,0.125217,-0.508835,-0.835383,0.207801,\n\t\t\t         -0.063082,-0.968017,0.242805,-0.053133,-0.985382,0.161718,0.875759,-0.473373,0.094424,0.885159,-0.463759,0.037446,\n\t\t\t         0.930326,-0.366436,0.013642,0.916562,-0.393780,0.069521,0.916562,-0.393780,0.069521,0.930326,-0.366436,0.013642,\n\t\t\t         0.970885,-0.239387,-0.005829,0.960540,-0.274819,0.042360,0.851070,-0.514145,0.106235,0.873928,-0.477767,0.089022,\n\t\t\t         0.813715,-0.578845,0.052370,0.799738,-0.595386,0.076632,0.873928,-0.477767,0.089022,0.919370,-0.389569,0.054231,\n\t\t\t         0.883267,-0.468001,0.027589,0.813715,-0.578845,0.052370,-0.724967,-0.669668,0.161016,-0.508835,-0.835383,0.207801,\n\t\t\t         -0.505264,-0.853816,0.125217,-0.731468,-0.674032,0.102969,0.458663,-0.862148,0.215125,0.462630,-0.870327,0.168706,\n\t\t\t         -0.053133,-0.985382,0.161718,-0.063082,-0.968017,0.242805,-0.053133,-0.985382,0.161718,-0.021516,-0.996307,0.083010,\n\t\t\t         -0.533860,-0.844783,0.036348,-0.505264,-0.853816,0.125217,-0.505264,-0.853816,0.125217,-0.533860,-0.844783,0.036348,\n\t\t\t         -0.787011,-0.616291,0.027772,-0.731468,-0.674032,0.102969,-0.063082,-0.968017,0.242805,-0.508835,-0.835383,0.207801,\n\t\t\t         -0.521561,-0.848231,0.091830,-0.067385,-0.991607,0.110233,-0.508835,-0.835383,0.207801,-0.724967,-0.669668,0.161016,\n\t\t\t         -0.741234,-0.667989,0.065767,-0.521561,-0.848231,0.091830,0.716239,-0.678579,0.162847,0.724509,-0.674154,0.143498,\n\t\t\t         0.462630,-0.870327,0.168706,0.458663,-0.862148,0.215125,0.750725,0.660451,0.012391,0.763237,0.645772,0.019990,\n\t\t\t         0.595050,0.803613,0.007965,0.633686,0.773492,-0.012024,-0.063082,-0.968017,0.242805,-0.067385,-0.991607,0.110233,\n\t\t\t         0.455977,-0.883602,0.106296,0.458663,-0.862148,0.215125,0.458663,-0.862148,0.215125,0.455977,-0.883602,0.106296,\n\t\t\t         0.719108,-0.689413,0.086917,0.716239,-0.678579,0.162847,-0.053133,-0.985382,0.161718,0.462630,-0.870327,0.168706,\n\t\t\t         0.491714,-0.863063,0.115238,-0.021516,-0.996307,0.083010,0.462630,-0.870327,0.168706,0.724509,-0.674154,0.143498,\n\t\t\t         0.728813,-0.675680,0.110752,0.491714,-0.863063,0.115238,0.895596,0.444502,0.016999,0.763237,0.645772,0.019990,\n\t\t\t         0.750725,0.660451,0.012391,0.850002,0.526597,0.013672,0.398114,0.917020,-0.023591,0.464522,0.883999,-0.052126,\n\t\t\t         0.633686,0.773492,-0.012024,0.595050,0.803613,0.007965,0.633686,0.773492,-0.012024,0.656301,0.754112,0.023011,\n\t\t\t         0.749016,0.661550,0.035524,0.750725,0.660451,0.012391,0.750725,0.660451,0.012391,0.749016,0.661550,0.035524,\n\t\t\t         0.811701,0.582781,0.038789,0.850002,0.526597,0.013672,0.595050,0.803613,0.007965,0.763237,0.645772,0.019990,\n\t\t\t         0.772973,0.630909,-0.066683,0.575915,0.813440,-0.081240,0.763237,0.645772,0.019990,0.895596,0.444502,0.016999,\n\t\t\t         0.912656,0.405621,-0.050203,0.772973,0.630909,-0.066683,0.198309,0.975951,-0.090243,0.464522,0.883999,-0.052126,\n\t\t\t         0.398114,0.917020,-0.023591,0.187506,0.980224,-0.063021,-0.213385,0.971740,-0.100711,-0.086947,0.992370,-0.087283,\n\t\t\t         -0.444777,0.892697,-0.072176,-0.628834,0.772790,-0.085452,0.595050,0.803613,0.007965,0.575915,0.813440,-0.081240,\n\t\t\t         0.351604,0.931120,-0.096652,0.398114,0.917020,-0.023591,0.398114,0.917020,-0.023591,0.351604,0.931120,-0.096652,\n\t\t\t         0.148595,0.981201,-0.123051,0.187506,0.980224,-0.063021,0.633686,0.773492,-0.012024,0.464522,0.883999,-0.052126,\n\t\t\t         0.487289,0.873196,0.003632,0.656301,0.754112,0.023011,0.464522,0.883999,-0.052126,0.198309,0.975951,-0.090243,\n\t\t\t         0.170598,0.984985,-0.025300,0.487289,0.873196,0.003632,-0.723746,0.685080,-0.082675,-0.734123,0.678823,-0.015442,\n\t\t\t         -0.817957,0.575213,-0.004303,-0.705954,0.699911,-0.108341,-0.628834,0.772790,-0.085452,-0.723746,0.685080,-0.082675,\n\t\t\t         -0.651082,0.750481,-0.113224,-0.684255,0.723319,-0.092654,0.979980,-0.198981,0.005036,0.993255,-0.113987,0.019959,\n\t\t\t         0.998535,0.052980,0.008362,0.995605,0.091067,-0.021271,-0.723746,0.685080,-0.082675,-0.705954,0.699911,-0.108341,\n\t\t\t         -0.590106,0.795679,-0.136509,-0.651082,0.750481,-0.113224,0.198309,0.975951,-0.090243,0.187506,0.980224,-0.063021,\n\t\t\t         -0.086947,0.992370,-0.087283,-0.213385,0.971740,-0.100711,-0.628834,0.772790,-0.085452,-0.444777,0.892697,-0.072176,\n\t\t\t         -0.734123,0.678823,-0.015442,-0.723746,0.685080,-0.082675,-0.628834,0.772790,-0.085452,-0.684255,0.723319,-0.092654,\n\t\t\t         -0.314341,0.947172,-0.063478,-0.213385,0.971740,-0.100711,-0.213385,0.971740,-0.100711,-0.314341,0.947172,-0.063478,\n\t\t\t         0.170598,0.984985,-0.025300,0.198309,0.975951,-0.090243,-0.444777,0.892697,-0.072176,-0.086947,0.992370,-0.087283,\n\t\t\t         -0.048891,0.985931,-0.159764,-0.313089,0.935820,-0.161687,-0.086947,0.992370,-0.087283,0.187506,0.980224,-0.063021,\n\t\t\t         0.148595,0.981201,-0.123051,-0.048891,0.985931,-0.159764,-0.444777,0.892697,-0.072176,-0.313089,0.935820,-0.161687,\n\t\t\t         -0.603931,0.792627,-0.083560,-0.734123,0.678823,-0.015442,-0.734123,0.678823,-0.015442,-0.603931,0.792627,-0.083560,\n\t\t\t         -0.815546,0.577258,0.039888,-0.817957,0.575213,-0.004303,0.919370,-0.389569,0.054231,0.960540,-0.274819,0.042360,\n\t\t\t         0.993255,-0.113987,0.019959,0.979980,-0.198981,0.005036,0.972686,0.231788,0.009888,0.937712,0.347301,-0.006561,\n\t\t\t         0.995605,0.091067,-0.021271,0.998535,0.052980,0.008362,0.995605,0.091067,-0.021271,0.985534,0.167577,0.023865,\n\t\t\t         0.978210,-0.206732,0.018616,0.979980,-0.198981,0.005036,0.979980,-0.198981,0.005036,0.978210,-0.206732,0.018616,\n\t\t\t         0.883267,-0.468001,0.027589,0.919370,-0.389569,0.054231,0.998535,0.052980,0.008362,0.993255,-0.113987,0.019959,\n\t\t\t         0.995361,-0.094699,-0.015290,0.999084,0.037690,-0.019868,0.993255,-0.113987,0.019959,0.960540,-0.274819,0.042360,\n\t\t\t         0.970885,-0.239387,-0.005829,0.995361,-0.094699,-0.015290,0.895596,0.444502,0.016999,0.850002,0.526597,0.013672,\n\t\t\t         0.937712,0.347301,-0.006561,0.972686,0.231788,0.009888,0.733848,-0.678213,0.038209,0.794916,-0.595721,0.114811,\n\t\t\t         0.868435,-0.493118,0.051363,0.792322,-0.610034,0.003113,0.998535,0.052980,0.008362,0.999084,0.037690,-0.019868,\n\t\t\t         0.981048,0.191015,-0.031831,0.972686,0.231788,0.009888,0.972686,0.231788,0.009888,0.981048,0.191015,-0.031831,\n\t\t\t         0.912656,0.405621,-0.050203,0.895596,0.444502,0.016999,0.995605,0.091067,-0.021271,0.937712,0.347301,-0.006561,\n\t\t\t         0.891018,0.452742,0.032319,0.985534,0.167577,0.023865,0.937712,0.347301,-0.006561,0.850002,0.526597,0.013672,\n\t\t\t         0.811701,0.582781,0.038789,0.891018,0.452742,0.032319,0.144017,0.988556,0.044435,0.164006,0.985137,0.050813,\n\t\t\t         0.120609,0.991913,-0.038820,0.089389,0.989441,-0.113895,0.089389,0.989441,-0.113895,0.120609,0.991913,-0.038820,\n\t\t\t         0.109348,0.984405,0.137761,0.029176,0.991729,0.124943,0.164006,0.985137,0.050813,0.240791,0.968261,0.066836,\n\t\t\t         0.218329,0.975799,-0.009430,0.120609,0.991913,-0.038820,0.120609,0.991913,-0.038820,0.218329,0.975799,-0.009430,\n\t\t\t         0.239296,0.963805,0.117405,0.109348,0.984405,0.137761,0.144017,0.988556,0.044435,0.089389,0.989441,-0.113895,\n\t\t\t         0.065920,0.971343,-0.228248,0.128330,0.990295,-0.052767,0.128330,0.990295,-0.052767,0.065920,0.971343,-0.228248,\n\t\t\t         0.004578,0.942930,-0.332926,0.124180,0.989257,-0.076846,0.089389,0.989441,-0.113895,0.029176,0.991729,0.124943,\n\t\t\t         -0.028840,0.995483,0.090121,0.065920,0.971343,-0.228248,0.065920,0.971343,-0.228248,-0.028840,0.995483,0.090121,\n\t\t\t         -0.044313,0.996704,0.067904,0.004578,0.942930,-0.332926,0.144017,0.988556,0.044435,0.128330,0.990295,-0.052767,\n\t\t\t         0.101047,0.977905,0.182897,0.101871,0.984161,0.145024,0.101871,0.984161,0.145024,0.101047,0.977905,0.182897,\n\t\t\t         0.065859,0.985595,-0.155614,0.087558,0.983520,-0.158116,0.128330,0.990295,-0.052767,0.124180,0.989257,-0.076846,\n\t\t\t         0.147526,0.963713,0.222419,0.101047,0.977905,0.182897,0.101047,0.977905,0.182897,0.147526,0.963713,0.222419,\n\t\t\t         0.088107,0.987030,-0.134007,0.065859,0.985595,-0.155614,0.144017,0.988556,0.044435,0.101871,0.984161,0.145024,\n\t\t\t         0.160558,0.979980,0.117466,0.164006,0.985137,0.050813,0.164006,0.985137,0.050813,0.160558,0.979980,0.117466,\n\t\t\t         0.259682,0.959288,0.110965,0.240791,0.968261,0.066836,0.101871,0.984161,0.145024,0.087558,0.983520,-0.158116,\n\t\t\t         0.168950,0.974761,-0.145878,0.160558,0.979980,0.117466,0.160558,0.979980,0.117466,0.168950,0.974761,-0.145878,\n\t\t\t         0.279794,0.951720,-0.126041,0.259682,0.959288,0.110965,0.512925,0.851680,0.107303,0.490829,0.871029,0.018220,\n\t\t\t         0.353435,0.935423,0.001587,0.371685,0.924650,0.082461,0.371685,0.924650,0.082461,0.353435,0.935423,0.001587,\n\t\t\t         0.218329,0.975799,-0.009430,0.240791,0.968261,0.066836,0.490829,0.871029,0.018220,0.490982,0.868770,0.064180,\n\t\t\t         0.369671,0.925169,0.085849,0.353435,0.935423,0.001587,0.353435,0.935423,0.001587,0.369671,0.925169,0.085849,\n\t\t\t         0.239296,0.963805,0.117405,0.218329,0.975799,-0.009430,0.512925,0.851680,0.107303,0.371685,0.924650,0.082461,\n\t\t\t         0.394879,0.910489,0.122593,0.531968,0.835139,0.139775,0.531968,0.835139,0.139775,0.394879,0.910489,0.122593,\n\t\t\t         0.407636,0.907041,-0.105228,0.529252,0.843959,-0.086978,0.371685,0.924650,0.082461,0.240791,0.968261,0.066836,\n\t\t\t         0.259682,0.959288,0.110965,0.394879,0.910489,0.122593,0.394879,0.910489,0.122593,0.259682,0.959288,0.110965,\n\t\t\t         0.279794,0.951720,-0.126041,0.407636,0.907041,-0.105228,0.512925,0.851680,0.107303,0.531968,0.835139,0.139775,\n\t\t\t         0.676717,0.716269,0.170080,0.645985,0.751732,0.132481,0.645985,0.751732,0.132481,0.676717,0.716269,0.170080,\n\t\t\t         0.834742,0.508896,0.210211,0.813440,0.557909,0.164373,0.531968,0.835139,0.139775,0.529252,0.843959,-0.086978,\n\t\t\t         0.643635,0.763970,-0.045198,0.676717,0.716269,0.170080,0.676717,0.716269,0.170080,0.643635,0.763970,-0.045198,\n\t\t\t         0.814783,0.579608,0.011383,0.834742,0.508896,0.210211,0.512925,0.851680,0.107303,0.645985,0.751732,0.132481,\n\t\t\t         0.633931,0.772729,0.031068,0.490829,0.871029,0.018220,0.490829,0.871029,0.018220,0.633931,0.772729,0.031068,\n\t\t\t         0.637806,0.767602,0.062685,0.490982,0.868770,0.064180,0.645985,0.751732,0.132481,0.813440,0.557909,0.164373,\n\t\t\t         0.806787,0.589831,0.033570,0.633931,0.772729,0.031068,0.633931,0.772729,0.031068,0.806787,0.589831,0.033570,\n\t\t\t         0.814295,0.575701,0.073855,0.637806,0.767602,0.062685,0.959075,0.213080,0.186316,0.971313,0.237587,-0.008881,\n\t\t\t         0.923856,0.382214,0.019532,0.916501,0.358135,0.178076,0.916501,0.358135,0.178076,0.923856,0.382214,0.019532,\n\t\t\t         0.806787,0.589831,0.033570,0.813440,0.557909,0.164373,0.971313,0.237587,-0.008881,0.972228,0.208411,0.106357,\n\t\t\t         0.933470,0.348643,0.083773,0.923856,0.382214,0.019532,0.923856,0.382214,0.019532,0.933470,0.348643,0.083773,\n\t\t\t         0.814295,0.575701,0.073855,0.806787,0.589831,0.033570,0.959075,0.213080,0.186316,0.916501,0.358135,0.178076,\n\t\t\t         0.921323,0.307627,0.237678,0.955504,0.194861,0.221381,0.955504,0.194861,0.221381,0.921323,0.307627,0.237678,\n\t\t\t         0.922452,0.385327,0.023408,0.974456,0.223792,0.018708,0.916501,0.358135,0.178076,0.813440,0.557909,0.164373,\n\t\t\t         0.834742,0.508896,0.210211,0.921323,0.307627,0.237678,0.921323,0.307627,0.237678,0.834742,0.508896,0.210211,\n\t\t\t         0.814783,0.579608,0.011383,0.922452,0.385327,0.023408,0.959075,0.213080,0.186316,0.955504,0.194861,0.221381,\n\t\t\t         0.985443,0.086428,0.146336,0.975646,0.066897,0.208869,0.975646,0.066897,0.208869,0.985443,0.086428,0.146336,\n\t\t\t         0.983947,-0.108982,0.141209,0.960234,-0.127720,0.248177,0.955504,0.194861,0.221381,0.974456,0.223792,0.018708,\n\t\t\t         0.993194,0.115116,-0.017487,0.985443,0.086428,0.146336,0.985443,0.086428,0.146336,0.993194,0.115116,-0.017487,\n\t\t\t         0.995300,-0.073458,-0.062990,0.983947,-0.108982,0.141209,0.959075,0.213080,0.186316,0.975646,0.066897,0.208869,\n\t\t\t         0.992340,0.120090,-0.028718,0.971313,0.237587,-0.008881,0.971313,0.237587,-0.008881,0.992340,0.120090,-0.028718,\n\t\t\t         0.983215,0.104495,0.149480,0.972228,0.208411,0.106357,0.975646,0.066897,0.208869,0.960234,-0.127720,0.248177,\n\t\t\t         0.999634,-0.011414,-0.023438,0.992340,0.120090,-0.028718,0.992340,0.120090,-0.028718,0.999634,-0.011414,-0.023438,\n\t\t\t         0.979308,0.002777,0.202338,0.983215,0.104495,0.149480,0.790918,-0.525468,0.313517,0.859249,-0.500320,0.106418,\n\t\t\t         0.983795,-0.177221,0.026917,0.902188,-0.308359,0.301523,0.902188,-0.308359,0.301523,0.983795,-0.177221,0.026917,\n\t\t\t         0.999634,-0.011414,-0.023438,0.960234,-0.127720,0.248177,0.859249,-0.500320,0.106418,0.858364,-0.471358,0.202429,\n\t\t\t         0.962493,-0.142460,0.230781,0.983795,-0.177221,0.026917,0.983795,-0.177221,0.026917,0.962493,-0.142460,0.230781,\n\t\t\t         0.979308,0.002777,0.202338,0.999634,-0.011414,-0.023438,0.790918,-0.525468,0.313517,0.902188,-0.308359,0.301523,\n\t\t\t         0.909055,-0.358989,0.211432,0.812098,-0.541429,0.217414,0.812098,-0.541429,0.217414,0.909055,-0.358989,0.211432,\n\t\t\t         0.952849,-0.296121,-0.066073,0.858974,-0.507736,-0.065493,0.902188,-0.308359,0.301523,0.960234,-0.127720,0.248177,\n\t\t\t         0.983947,-0.108982,0.141209,0.909055,-0.358989,0.211432,0.909055,-0.358989,0.211432,0.983947,-0.108982,0.141209,\n\t\t\t         0.995300,-0.073458,-0.062990,0.952849,-0.296121,-0.066073,0.790918,-0.525468,0.313517,0.812098,-0.541429,0.217414,\n\t\t\t         0.585131,-0.797876,0.144841,0.505112,-0.805994,0.308542,0.505112,-0.805994,0.308542,0.585131,-0.797876,0.144841,\n\t\t\t         0.403058,-0.905667,0.131321,0.405957,-0.865810,0.292489,0.812098,-0.541429,0.217414,0.858974,-0.507736,-0.065493,\n\t\t\t         0.681600,-0.724570,-0.101901,0.585131,-0.797876,0.144841,0.585131,-0.797876,0.144841,0.681600,-0.724570,-0.101901,\n\t\t\t         0.467360,-0.857845,-0.213569,0.403058,-0.905667,0.131321,0.790918,-0.525468,0.313517,0.505112,-0.805994,0.308542,\n\t\t\t         0.619922,-0.772118,0.139592,0.859249,-0.500320,0.106418,0.859249,-0.500320,0.106418,0.619922,-0.772118,0.139592,\n\t\t\t         0.670247,-0.729698,0.135136,0.858364,-0.471358,0.202429,0.505112,-0.805994,0.308542,0.405957,-0.865810,0.292489,\n\t\t\t         0.477950,-0.864223,0.156987,0.619922,-0.772118,0.139592,0.619922,-0.772118,0.139592,0.477950,-0.864223,0.156987,\n\t\t\t         0.544755,-0.830195,0.118351,0.670247,-0.729698,0.135136,0.162999,-0.965361,0.203619,0.129337,-0.973662,0.187689,\n\t\t\t         0.312601,-0.930815,0.189184,0.266823,-0.923704,0.274850,0.266823,-0.923704,0.274850,0.312601,-0.930815,0.189184,\n\t\t\t         0.477950,-0.864223,0.156987,0.405957,-0.865810,0.292489,0.129337,-0.973662,0.187689,0.159581,-0.973601,0.162999,\n\t\t\t         0.314310,-0.939482,0.136235,0.312601,-0.930815,0.189184,0.312601,-0.930815,0.189184,0.314310,-0.939482,0.136235,\n\t\t\t         0.544755,-0.830195,0.118351,0.477950,-0.864223,0.156987,0.162999,-0.965361,0.203619,0.266823,-0.923704,0.274850,\n\t\t\t         0.387158,-0.913480,0.125004,0.249153,-0.964324,0.089084,0.249153,-0.964324,0.089084,0.387158,-0.913480,0.125004,\n\t\t\t         0.394726,-0.891629,-0.221747,0.229987,-0.947661,-0.221320,0.266823,-0.923704,0.274850,0.405957,-0.865810,0.292489,\n\t\t\t         0.403058,-0.905667,0.131321,0.387158,-0.913480,0.125004,0.387158,-0.913480,0.125004,0.403058,-0.905667,0.131321,\n\t\t\t         0.467360,-0.857845,-0.213569,0.394726,-0.891629,-0.221747,0.162999,-0.965361,0.203619,0.249153,-0.964324,0.089084,\n\t\t\t         0.104648,-0.993255,0.049440,0.089114,-0.984924,0.148137,0.089114,-0.984924,0.148137,0.104648,-0.993255,0.049440,\n\t\t\t         0.162877,-0.985198,0.052828,0.128269,-0.987030,0.096377,0.249153,-0.964324,0.089084,0.229987,-0.947661,-0.221320,\n\t\t\t         0.064150,-0.992676,-0.102084,0.104648,-0.993255,0.049440,0.104648,-0.993255,0.049440,0.064150,-0.992676,-0.102084,\n\t\t\t         0.159276,-0.985656,-0.055544,0.162877,-0.985198,0.052828,0.162999,-0.965361,0.203619,0.089114,-0.984924,0.148137,\n\t\t\t         0.072604,-0.979095,0.189947,0.129337,-0.973662,0.187689,0.129337,-0.973662,0.187689,0.072604,-0.979095,0.189947,\n\t\t\t         0.065706,-0.981414,0.180212,0.159581,-0.973601,0.162999,0.089114,-0.984924,0.148137,0.128269,-0.987030,0.096377,\n\t\t\t         0.061403,-0.990905,0.119572,0.072604,-0.979095,0.189947,0.072604,-0.979095,0.189947,0.061403,-0.990905,0.119572,\n\t\t\t         0.013001,-0.988617,0.149724,0.065706,-0.981414,0.180212,0.103275,0.989441,-0.101413,0.188788,0.974487,-0.121342,\n\t\t\t         0.198981,0.939909,-0.277383,0.118595,0.946684,-0.299509,0.118595,0.946684,-0.299509,0.198981,0.939909,-0.277383,\n\t\t\t         0.168950,0.974761,-0.145878,0.087558,0.983520,-0.158116,0.188788,0.974487,-0.121342,0.337870,0.932646,-0.126286,\n\t\t\t         0.323038,0.914792,-0.242347,0.198981,0.939909,-0.277383,0.198981,0.939909,-0.277383,0.323038,0.914792,-0.242347,\n\t\t\t         0.279794,0.951720,-0.126041,0.168950,0.974761,-0.145878,0.103275,0.989441,-0.101413,0.118595,0.946684,-0.299509,\n\t\t\t         0.077059,0.944853,-0.318247,0.059145,0.994568,-0.085604,0.059145,0.994568,-0.085604,0.077059,0.944853,-0.318247,\n\t\t\t         0.039460,0.947111,-0.318369,0.012421,0.997406,-0.070650,0.118595,0.946684,-0.299509,0.087558,0.983520,-0.158116,\n\t\t\t         0.065859,0.985595,-0.155614,0.077059,0.944853,-0.318247,0.077059,0.944853,-0.318247,0.065859,0.985595,-0.155614,\n\t\t\t         0.088107,0.987030,-0.134007,0.039460,0.947111,-0.318369,0.103275,0.989441,-0.101413,0.059145,0.994568,-0.085604,\n\t\t\t         -0.023713,0.999664,0.009919,0.041169,0.998199,-0.042970,0.041169,0.998199,-0.042970,-0.023713,0.999664,0.009919,\n\t\t\t         -0.057680,0.990143,-0.127415,0.029939,0.990143,-0.136662,0.059145,0.994568,-0.085604,0.012421,0.997406,-0.070650,\n\t\t\t         -0.036927,0.997009,0.067537,-0.023713,0.999664,0.009919,-0.023713,0.999664,0.009919,-0.036927,0.997009,0.067537,\n\t\t\t         -0.068575,0.989776,-0.124882,-0.057680,0.990143,-0.127415,0.103275,0.989441,-0.101413,0.041169,0.998199,-0.042970,\n\t\t\t         0.146519,0.987640,-0.055605,0.188788,0.974487,-0.121342,0.188788,0.974487,-0.121342,0.146519,0.987640,-0.055605,\n\t\t\t         0.310343,0.948759,-0.058992,0.337870,0.932646,-0.126286,0.041169,0.998199,-0.042970,0.029939,0.990143,-0.136662,\n\t\t\t         0.213996,0.951048,-0.222877,0.146519,0.987640,-0.055605,0.146519,0.987640,-0.055605,0.213996,0.951048,-0.222877,\n\t\t\t         0.434706,0.875057,-0.212806,0.310343,0.948759,-0.058992,0.532060,0.838679,-0.116062,0.510697,0.832972,-0.212775,\n\t\t\t         0.438887,0.871883,-0.217139,0.476211,0.870724,-0.122562,0.476211,0.870724,-0.122562,0.438887,0.871883,-0.217139,\n\t\t\t         0.323038,0.914792,-0.242347,0.337870,0.932646,-0.126286,0.510697,0.832972,-0.212775,0.529252,0.843959,-0.086978,\n\t\t\t         0.407636,0.907041,-0.105228,0.438887,0.871883,-0.217139,0.438887,0.871883,-0.217139,0.407636,0.907041,-0.105228,\n\t\t\t         0.279794,0.951720,-0.126041,0.323038,0.914792,-0.242347,0.532060,0.838679,-0.116062,0.476211,0.870724,-0.122562,\n\t\t\t         0.481399,0.874111,-0.064364,0.547472,0.834101,-0.067019,0.547472,0.834101,-0.067019,0.481399,0.874111,-0.064364,\n\t\t\t         0.458296,0.879604,-0.127476,0.504349,0.852290,-0.138493,0.476211,0.870724,-0.122562,0.337870,0.932646,-0.126286,\n\t\t\t         0.310343,0.948759,-0.058992,0.481399,0.874111,-0.064364,0.481399,0.874111,-0.064364,0.310343,0.948759,-0.058992,\n\t\t\t         0.434706,0.875057,-0.212806,0.458296,0.879604,-0.127476,0.532060,0.838679,-0.116062,0.547472,0.834101,-0.067019,\n\t\t\t         0.626423,0.776025,-0.073122,0.629322,0.771447,-0.093600,0.629322,0.771447,-0.093600,0.626423,0.776025,-0.073122,\n\t\t\t         0.815210,0.575091,-0.067995,0.773339,0.621784,-0.123722,0.547472,0.834101,-0.067019,0.504349,0.852290,-0.138493,\n\t\t\t         0.562944,0.805170,-0.186346,0.626423,0.776025,-0.073122,0.626423,0.776025,-0.073122,0.562944,0.805170,-0.186346,\n\t\t\t         0.696310,0.642232,-0.320353,0.815210,0.575091,-0.067995,0.532060,0.838679,-0.116062,0.629322,0.771447,-0.093600,\n\t\t\t         0.577563,0.783532,-0.229041,0.510697,0.832972,-0.212775,0.510697,0.832972,-0.212775,0.577563,0.783532,-0.229041,\n\t\t\t         0.643635,0.763970,-0.045198,0.529252,0.843959,-0.086978,0.629322,0.771447,-0.093600,0.773339,0.621784,-0.123722,\n\t\t\t         0.721397,0.647603,-0.245308,0.577563,0.783532,-0.229041,0.577563,0.783532,-0.229041,0.721397,0.647603,-0.245308,\n\t\t\t         0.814783,0.579608,0.011383,0.643635,0.763970,-0.045198,0.965026,0.189795,-0.180761,0.955351,0.213569,-0.204016,\n\t\t\t         0.876431,0.410535,-0.251564,0.883572,0.432478,-0.179479,0.883572,0.432478,-0.179479,0.876431,0.410535,-0.251564,\n\t\t\t         0.721397,0.647603,-0.245308,0.773339,0.621784,-0.123722,0.955351,0.213569,-0.204016,0.974456,0.223792,0.018708,\n\t\t\t         0.922452,0.385327,0.023408,0.876431,0.410535,-0.251564,0.876431,0.410535,-0.251564,0.922452,0.385327,0.023408,\n\t\t\t         0.814783,0.579608,0.011383,0.721397,0.647603,-0.245308,0.965026,0.189795,-0.180761,0.883572,0.432478,-0.179479,\n\t\t\t         0.944121,0.326640,-0.043580,0.994751,0.100894,-0.016358,0.994751,0.100894,-0.016358,0.944121,0.326640,-0.043580,\n\t\t\t         0.898129,0.353038,-0.262062,0.981140,0.115513,-0.154759,0.883572,0.432478,-0.179479,0.773339,0.621784,-0.123722,\n\t\t\t         0.815210,0.575091,-0.067995,0.944121,0.326640,-0.043580,0.944121,0.326640,-0.043580,0.815210,0.575091,-0.067995,\n\t\t\t         0.696310,0.642232,-0.320353,0.898129,0.353038,-0.262062,0.965026,0.189795,-0.180761,0.994751,0.100894,-0.016358,\n\t\t\t         0.994629,-0.101444,-0.019349,0.993133,-0.006317,-0.116733,0.993133,-0.006317,-0.116733,0.994629,-0.101444,-0.019349,\n\t\t\t         0.971221,-0.237983,0.007996,0.983795,-0.178411,-0.016602,0.994751,0.100894,-0.016358,0.981140,0.115513,-0.154759,\n\t\t\t         0.985595,-0.118503,-0.120457,0.994629,-0.101444,-0.019349,0.994629,-0.101444,-0.019349,0.985595,-0.118503,-0.120457,\n\t\t\t         0.964507,-0.229041,-0.131230,0.971221,-0.237983,0.007996,0.965026,0.189795,-0.180761,0.993133,-0.006317,-0.116733,\n\t\t\t         0.993225,0.054506,-0.102481,0.955351,0.213569,-0.204016,0.955351,0.213569,-0.204016,0.993225,0.054506,-0.102481,\n\t\t\t         0.993194,0.115116,-0.017487,0.974456,0.223792,0.018708,0.993133,-0.006317,-0.116733,0.983795,-0.178411,-0.016602,\n\t\t\t         0.992645,-0.119266,-0.020295,0.993225,0.054506,-0.102481,0.993225,0.054506,-0.102481,0.992645,-0.119266,-0.020295,\n\t\t\t         0.995300,-0.073458,-0.062990,0.993194,0.115116,-0.017487,0.844264,-0.535417,0.022767,0.826472,-0.561754,-0.036134,\n\t\t\t         0.946959,-0.321268,0.001038,0.939421,-0.340190,0.041536,0.939421,-0.340190,0.041536,0.946959,-0.321268,0.001038,\n\t\t\t         0.992645,-0.119266,-0.020295,0.983795,-0.178411,-0.016602,0.826472,-0.561754,-0.036134,0.858974,-0.507736,-0.065493,\n\t\t\t         0.952849,-0.296121,-0.066073,0.946959,-0.321268,0.001038,0.946959,-0.321268,0.001038,0.952849,-0.296121,-0.066073,\n\t\t\t         0.995300,-0.073458,-0.062990,0.992645,-0.119266,-0.020295,0.844264,-0.535417,0.022767,0.939421,-0.340190,0.041536,\n\t\t\t         0.940275,-0.339549,0.023927,0.866237,-0.499619,0.002930,0.866237,-0.499619,0.002930,0.940275,-0.339549,0.023927,\n\t\t\t         0.949034,-0.298624,-0.100620,0.903287,-0.409925,-0.126469,0.939421,-0.340190,0.041536,0.983795,-0.178411,-0.016602,\n\t\t\t         0.971221,-0.237983,0.007996,0.940275,-0.339549,0.023927,0.940275,-0.339549,0.023927,0.971221,-0.237983,0.007996,\n\t\t\t         0.964507,-0.229041,-0.131230,0.949034,-0.298624,-0.100620,0.844264,-0.535417,0.022767,0.866237,-0.499619,0.002930,\n\t\t\t         0.725761,-0.685842,-0.053529,0.669240,-0.742821,0.016694,0.669240,-0.742821,0.016694,0.725761,-0.685842,-0.053529,\n\t\t\t         0.653310,-0.752495,-0.082980,0.626270,-0.778802,-0.034791,0.866237,-0.499619,0.002930,0.903287,-0.409925,-0.126469,\n\t\t\t         0.794855,-0.585559,-0.158940,0.725761,-0.685842,-0.053529,0.725761,-0.685842,-0.053529,0.794855,-0.585559,-0.158940,\n\t\t\t         0.645924,-0.730918,-0.220130,0.653310,-0.752495,-0.082980,0.844264,-0.535417,0.022767,0.669240,-0.742821,0.016694,\n\t\t\t         0.619800,-0.774712,-0.125004,0.826472,-0.561754,-0.036134,0.826472,-0.561754,-0.036134,0.619800,-0.774712,-0.125004,\n\t\t\t         0.681600,-0.724570,-0.101901,0.858974,-0.507736,-0.065493,0.669240,-0.742821,0.016694,0.626270,-0.778802,-0.034791,\n\t\t\t         0.534501,-0.812037,-0.234230,0.619800,-0.774712,-0.125004,0.619800,-0.774712,-0.125004,0.534501,-0.812037,-0.234230,\n\t\t\t         0.467360,-0.857845,-0.213569,0.681600,-0.724570,-0.101901,0.131748,-0.960112,-0.246529,0.097354,-0.937193,-0.334849,\n\t\t\t         0.432691,-0.844966,-0.314280,0.503342,-0.848445,-0.163457,0.503342,-0.848445,-0.163457,0.432691,-0.844966,-0.314280,\n\t\t\t         0.534501,-0.812037,-0.234230,0.626270,-0.778802,-0.034791,0.097354,-0.937193,-0.334849,0.229987,-0.947661,-0.221320,\n\t\t\t         0.394726,-0.891629,-0.221747,0.432691,-0.844966,-0.314280,0.432691,-0.844966,-0.314280,0.394726,-0.891629,-0.221747,\n\t\t\t         0.467360,-0.857845,-0.213569,0.534501,-0.812037,-0.234230,0.131748,-0.960112,-0.246529,0.503342,-0.848445,-0.163457,\n\t\t\t         0.553697,-0.822840,-0.127598,0.177190,-0.972228,-0.152684,0.177190,-0.972228,-0.152684,0.553697,-0.822840,-0.127598,\n\t\t\t         0.485824,-0.843287,-0.229713,0.146397,-0.965453,-0.215522,0.503342,-0.848445,-0.163457,0.626270,-0.778802,-0.034791,\n\t\t\t         0.653310,-0.752495,-0.082980,0.553697,-0.822840,-0.127598,0.553697,-0.822840,-0.127598,0.653310,-0.752495,-0.082980,\n\t\t\t         0.645924,-0.730918,-0.220130,0.485824,-0.843287,-0.229713,0.131748,-0.960112,-0.246529,0.177190,-0.972228,-0.152684,\n\t\t\t         -0.092013,-0.981628,-0.167058,-0.099490,-0.969604,-0.223457,-0.099490,-0.969604,-0.223457,-0.092013,-0.981628,-0.167058,\n\t\t\t         -0.020814,-0.979949,-0.198065,0.027436,-0.984161,-0.174993,0.177190,-0.972228,-0.152684,0.146397,-0.965453,-0.215522,\n\t\t\t         -0.059145,-0.972808,-0.223884,-0.092013,-0.981628,-0.167058,-0.092013,-0.981628,-0.167058,-0.059145,-0.972808,-0.223884,\n\t\t\t         -0.011750,-0.984100,-0.177160,-0.020814,-0.979949,-0.198065,0.131748,-0.960112,-0.246529,-0.099490,-0.969604,-0.223457,\n\t\t\t         -0.044771,-0.962859,-0.266243,0.097354,-0.937193,-0.334849,0.097354,-0.937193,-0.334849,-0.044771,-0.962859,-0.266243,\n\t\t\t         0.064150,-0.992676,-0.102084,0.229987,-0.947661,-0.221320,-0.099490,-0.969604,-0.223457,0.027436,-0.984161,-0.174993,\n\t\t\t         0.106082,-0.978088,-0.179113,-0.044771,-0.962859,-0.266243,-0.044771,-0.962859,-0.266243,0.106082,-0.978088,-0.179113,\n\t\t\t         0.159276,-0.985656,-0.055544,0.064150,-0.992676,-0.102084,0.247932,-0.937040,-0.245857,0.112369,-0.985961,-0.123295,\n\t\t\t         -0.028321,-0.980895,-0.192419,0.145390,-0.954894,-0.258827,0.145390,-0.954894,-0.258827,-0.028321,-0.980895,-0.192419,\n\t\t\t         -0.059145,-0.972808,-0.223884,0.146397,-0.965453,-0.215522,0.112369,-0.985961,-0.123295,0.006043,-0.999573,0.028382,\n\t\t\t         -0.033448,-0.996033,-0.082247,-0.028321,-0.980895,-0.192419,-0.028321,-0.980895,-0.192419,-0.033448,-0.996033,-0.082247,\n\t\t\t         -0.011750,-0.984100,-0.177160,-0.059145,-0.972808,-0.223884,0.247932,-0.937040,-0.245857,0.145390,-0.954894,-0.258827,\n\t\t\t         0.455824,-0.835139,-0.307779,0.419630,-0.862484,-0.282815,0.419630,-0.862484,-0.282815,0.455824,-0.835139,-0.307779,\n\t\t\t         0.617145,-0.727226,-0.300424,0.607410,-0.739616,-0.289743,0.145390,-0.954894,-0.258827,0.146397,-0.965453,-0.215522,\n\t\t\t         0.485824,-0.843287,-0.229713,0.455824,-0.835139,-0.307779,0.455824,-0.835139,-0.307779,0.485824,-0.843287,-0.229713,\n\t\t\t         0.645924,-0.730918,-0.220130,0.617145,-0.727226,-0.300424,0.247932,-0.937040,-0.245857,0.419630,-0.862484,-0.282815,\n\t\t\t         0.346141,-0.932157,-0.105930,0.112369,-0.985961,-0.123295,0.112369,-0.985961,-0.123295,0.346141,-0.932157,-0.105930,\n\t\t\t         0.206610,-0.971465,0.116214,0.006043,-0.999573,0.028382,0.419630,-0.862484,-0.282815,0.607410,-0.739616,-0.289743,\n\t\t\t         0.617756,-0.776543,-0.123600,0.346141,-0.932157,-0.105930,0.346141,-0.932157,-0.105930,0.617756,-0.776543,-0.123600,\n\t\t\t         0.517960,-0.849757,0.097995,0.206610,-0.971465,0.116214,0.844661,-0.466994,-0.261513,0.765770,-0.586718,-0.263283,\n\t\t\t         0.766015,-0.590411,-0.254189,0.878323,-0.430433,-0.207862,0.878323,-0.430433,-0.207862,0.766015,-0.590411,-0.254189,\n\t\t\t         0.794855,-0.585559,-0.158940,0.903287,-0.409925,-0.126469,0.765770,-0.586718,-0.263283,0.607410,-0.739616,-0.289743,\n\t\t\t         0.617145,-0.727226,-0.300424,0.766015,-0.590411,-0.254189,0.766015,-0.590411,-0.254189,0.617145,-0.727226,-0.300424,\n\t\t\t         0.645924,-0.730918,-0.220130,0.794855,-0.585559,-0.158940,0.844661,-0.466994,-0.261513,0.878323,-0.430433,-0.207862,\n\t\t\t         0.927580,-0.306345,-0.213752,0.899930,-0.406446,-0.157689,0.899930,-0.406446,-0.157689,0.927580,-0.306345,-0.213752,\n\t\t\t         0.927396,-0.270425,-0.258339,0.893887,-0.402112,-0.198126,0.878323,-0.430433,-0.207862,0.903287,-0.409925,-0.126469,\n\t\t\t         0.949034,-0.298624,-0.100620,0.927580,-0.306345,-0.213752,0.927580,-0.306345,-0.213752,0.949034,-0.298624,-0.100620,\n\t\t\t         0.964507,-0.229041,-0.131230,0.927396,-0.270425,-0.258339,0.844661,-0.466994,-0.261513,0.899930,-0.406446,-0.157689,\n\t\t\t         0.813654,-0.566820,-0.129032,0.765770,-0.586718,-0.263283,0.765770,-0.586718,-0.263283,0.813654,-0.566820,-0.129032,\n\t\t\t         0.617756,-0.776543,-0.123600,0.607410,-0.739616,-0.289743,0.899930,-0.406446,-0.157689,0.893887,-0.402112,-0.198126,\n\t\t\t         0.827631,-0.541246,-0.148412,0.813654,-0.566820,-0.129032,0.813654,-0.566820,-0.129032,0.827631,-0.541246,-0.148412,\n\t\t\t         0.517960,-0.849757,0.097995,0.617756,-0.776543,-0.123600,-0.100101,-0.933134,0.345225,-0.062593,-0.976836,0.204535,\n\t\t\t         0.036683,-0.951170,0.306436,-0.081484,-0.906430,0.414380,-0.081484,-0.906430,0.414380,0.036683,-0.951170,0.306436,\n\t\t\t         0.098941,-0.922819,0.372265,-0.062410,-0.880581,0.469710,-0.062593,-0.976836,0.204535,0.006043,-0.999573,0.028382,\n\t\t\t         0.206610,-0.971465,0.116214,0.036683,-0.951170,0.306436,0.036683,-0.951170,0.306436,0.206610,-0.971465,0.116214,\n\t\t\t         0.517960,-0.849757,0.097995,0.098941,-0.922819,0.372265,-0.100101,-0.933134,0.345225,-0.081484,-0.906430,0.414380,\n\t\t\t         -0.093997,-0.878384,0.468581,-0.085116,-0.930174,0.357097,-0.085116,-0.930174,0.357097,-0.093997,-0.878384,0.468581,\n\t\t\t         -0.011261,-0.878231,0.478072,-0.012879,-0.932890,0.359844,-0.081484,-0.906430,0.414380,-0.062410,-0.880581,0.469710,\n\t\t\t         -0.102542,-0.850246,0.516251,-0.093997,-0.878384,0.468581,-0.093997,-0.878384,0.468581,-0.102542,-0.850246,0.516251,\n\t\t\t         0.000117,-0.850864,0.525385,-0.011261,-0.878231,0.478072,-0.100101,-0.933134,0.345225,-0.085116,-0.930174,0.357097,\n\t\t\t         -0.056856,-0.987365,0.147740,-0.062593,-0.976836,0.204535,-0.062593,-0.976836,0.204535,-0.056856,-0.987365,0.147740,\n\t\t\t         -0.033448,-0.996033,-0.082247,0.006043,-0.999573,0.028382,-0.085116,-0.930174,0.357097,-0.012879,-0.932890,0.359844,\n\t\t\t         0.003601,-0.991638,0.128788,-0.056856,-0.987365,0.147740,-0.056856,-0.987365,0.147740,0.003601,-0.991638,0.128788,\n\t\t\t         -0.011750,-0.984100,-0.177160,-0.033448,-0.996033,-0.082247,0.880520,-0.378216,-0.285623,0.872341,-0.428907,-0.234535,\n\t\t\t         0.844874,-0.494491,-0.204047,0.871181,-0.406049,-0.275857,0.871181,-0.406049,-0.275857,0.844874,-0.494491,-0.204047,\n\t\t\t         0.827631,-0.541246,-0.148412,0.893887,-0.402112,-0.198126,0.872341,-0.428907,-0.234535,0.851680,-0.483383,-0.202246,\n\t\t\t         0.807428,-0.577654,-0.119724,0.844874,-0.494491,-0.204047,0.844874,-0.494491,-0.204047,0.807428,-0.577654,-0.119724,\n\t\t\t         0.517960,-0.849757,0.097995,0.827631,-0.541246,-0.148412,0.880520,-0.378216,-0.285623,0.871181,-0.406049,-0.275857,\n\t\t\t         0.898190,-0.288888,-0.331248,0.897641,-0.296793,-0.325755,0.897641,-0.296793,-0.325755,0.898190,-0.288888,-0.331248,\n\t\t\t         0.919980,-0.158544,-0.358440,0.917508,-0.161748,-0.363292,0.871181,-0.406049,-0.275857,0.893887,-0.402112,-0.198126,\n\t\t\t         0.927396,-0.270425,-0.258339,0.898190,-0.288888,-0.331248,0.898190,-0.288888,-0.331248,0.927396,-0.270425,-0.258339,\n\t\t\t         0.964507,-0.229041,-0.131230,0.919980,-0.158544,-0.358440,0.880520,-0.378216,-0.285623,0.897641,-0.296793,-0.325755,\n\t\t\t         0.895413,-0.330363,-0.298441,0.872341,-0.428907,-0.234535,0.872341,-0.428907,-0.234535,0.895413,-0.330363,-0.298441,\n\t\t\t         0.902921,-0.377056,-0.206122,0.851680,-0.483383,-0.202246,0.897641,-0.296793,-0.325755,0.917508,-0.161748,-0.363292,\n\t\t\t         0.921598,-0.166540,-0.350597,0.895413,-0.330363,-0.298441,0.895413,-0.330363,-0.298441,0.921598,-0.166540,-0.350597,\n\t\t\t         0.824976,-0.246986,-0.508316,0.902921,-0.377056,-0.206122,0.884243,0.199988,-0.422010,0.925840,0.005707,-0.377819,\n\t\t\t         0.930754,0.007447,-0.365520,0.882534,0.227149,-0.411664,0.882534,0.227149,-0.411664,0.930754,0.007447,-0.365520,\n\t\t\t         0.985595,-0.118503,-0.120457,0.981140,0.115513,-0.154759,0.925840,0.005707,-0.377819,0.917508,-0.161748,-0.363292,\n\t\t\t         0.919980,-0.158544,-0.358440,0.930754,0.007447,-0.365520,0.930754,0.007447,-0.365520,0.919980,-0.158544,-0.358440,\n\t\t\t         0.964507,-0.229041,-0.131230,0.985595,-0.118503,-0.120457,0.884243,0.199988,-0.422010,0.882534,0.227149,-0.411664,\n\t\t\t         0.803674,0.410840,-0.430433,0.890988,0.246467,-0.381268,0.890988,0.246467,-0.381268,0.803674,0.410840,-0.430433,\n\t\t\t         0.732505,0.514573,-0.445662,0.824732,0.291910,-0.484298,0.882534,0.227149,-0.411664,0.981140,0.115513,-0.154759,\n\t\t\t         0.898129,0.353038,-0.262062,0.803674,0.410840,-0.430433,0.803674,0.410840,-0.430433,0.898129,0.353038,-0.262062,\n\t\t\t         0.696310,0.642232,-0.320353,0.732505,0.514573,-0.445662,0.884243,0.199988,-0.422010,0.890988,0.246467,-0.381268,\n\t\t\t         0.930021,0.036988,-0.365581,0.925840,0.005707,-0.377819,0.925840,0.005707,-0.377819,0.930021,0.036988,-0.365581,\n\t\t\t         0.921598,-0.166540,-0.350597,0.917508,-0.161748,-0.363292,0.890988,0.246467,-0.381268,0.824732,0.291910,-0.484298,\n\t\t\t         0.860805,0.069552,-0.504105,0.930021,0.036988,-0.365581,0.930021,0.036988,-0.365581,0.860805,0.069552,-0.504105,\n\t\t\t         0.824976,-0.246986,-0.508316,0.921598,-0.166540,-0.350597,0.847591,-0.530503,0.009339,0.845485,-0.513108,-0.147740,\n\t\t\t         0.888607,-0.436537,-0.140629,0.882015,-0.471145,0.003235,0.882015,-0.471145,0.003235,0.888607,-0.436537,-0.140629,\n\t\t\t         0.841945,-0.480392,-0.245613,0.812769,-0.575457,-0.090670,0.845485,-0.513108,-0.147740,0.851680,-0.483383,-0.202246,\n\t\t\t         0.902921,-0.377056,-0.206122,0.888607,-0.436537,-0.140629,0.888607,-0.436537,-0.140629,0.902921,-0.377056,-0.206122,\n\t\t\t         0.824976,-0.246986,-0.508316,0.841945,-0.480392,-0.245613,0.847591,-0.530503,0.009339,0.882015,-0.471145,0.003235,\n\t\t\t         0.805506,-0.546129,0.229896,0.785363,-0.609638,0.107242,0.785363,-0.609638,0.107242,0.805506,-0.546129,0.229896,\n\t\t\t         0.612781,-0.691000,0.383374,0.637135,-0.727073,0.255745,0.882015,-0.471145,0.003235,0.812769,-0.575457,-0.090670,\n\t\t\t         0.711570,-0.694601,0.105747,0.805506,-0.546129,0.229896,0.805506,-0.546129,0.229896,0.711570,-0.694601,0.105747,\n\t\t\t         0.489608,-0.802637,0.340556,0.612781,-0.691000,0.383374,0.847591,-0.530503,0.009339,0.785363,-0.609638,0.107242,\n\t\t\t         0.774438,-0.628407,-0.072726,0.845485,-0.513108,-0.147740,0.845485,-0.513108,-0.147740,0.774438,-0.628407,-0.072726,\n\t\t\t         0.807428,-0.577654,-0.119724,0.851680,-0.483383,-0.202246,0.785363,-0.609638,0.107242,0.637135,-0.727073,0.255745,\n\t\t\t         0.575427,-0.799890,0.170354,0.774438,-0.628407,-0.072726,0.774438,-0.628407,-0.072726,0.575427,-0.799890,0.170354,\n\t\t\t         0.517960,-0.849757,0.097995,0.807428,-0.577654,-0.119724,0.238197,-0.796381,0.555864,0.391644,-0.799951,0.454573,\n\t\t\t         0.393262,-0.763573,0.512070,0.221656,-0.777123,0.589007,0.221656,-0.777123,0.589007,0.393262,-0.763573,0.512070,\n\t\t\t         0.320841,-0.797784,0.510453,0.178198,-0.788018,0.589282,0.391644,-0.799951,0.454573,0.637135,-0.727073,0.255745,\n\t\t\t         0.612781,-0.691000,0.383374,0.393262,-0.763573,0.512070,0.393262,-0.763573,0.512070,0.612781,-0.691000,0.383374,\n\t\t\t         0.489608,-0.802637,0.340556,0.320841,-0.797784,0.510453,0.238197,-0.796381,0.555864,0.221656,-0.777123,0.589007,\n\t\t\t         0.105625,-0.783319,0.612568,0.142521,-0.823481,0.549089,0.142521,-0.823481,0.549089,0.105625,-0.783319,0.612568,\n\t\t\t         0.084384,-0.793695,0.602405,0.078768,-0.829707,0.552568,0.221656,-0.777123,0.589007,0.178198,-0.788018,0.589282,\n\t\t\t         0.097903,-0.777642,0.620991,0.105625,-0.783319,0.612568,0.105625,-0.783319,0.612568,0.097903,-0.777642,0.620991,\n\t\t\t         0.242012,-0.798395,0.551317,0.084384,-0.793695,0.602405,0.238197,-0.796381,0.555864,0.142521,-0.823481,0.549089,\n\t\t\t         0.297311,-0.862026,0.410474,0.391644,-0.799951,0.454573,0.391644,-0.799951,0.454573,0.297311,-0.862026,0.410474,\n\t\t\t         0.575427,-0.799890,0.170354,0.637135,-0.727073,0.255745,0.142521,-0.823481,0.549089,0.078768,-0.829707,0.552568,\n\t\t\t         0.200201,-0.891110,0.407178,0.297311,-0.862026,0.410474,0.297311,-0.862026,0.410474,0.200201,-0.891110,0.407178,\n\t\t\t         0.517960,-0.849757,0.097995,0.575427,-0.799890,0.170354,0.497665,-0.813807,-0.299997,0.463668,-0.878567,-0.114261,\n\t\t\t         0.545152,-0.837153,-0.044008,0.612629,-0.737419,-0.284310,0.612629,-0.737419,-0.284310,0.545152,-0.837153,-0.044008,\n\t\t\t         0.711570,-0.694601,0.105747,0.812769,-0.575457,-0.090670,0.463668,-0.878567,-0.114261,0.393567,-0.909970,0.130528,\n\t\t\t         0.428358,-0.882412,0.194433,0.545152,-0.837153,-0.044008,0.545152,-0.837153,-0.044008,0.428358,-0.882412,0.194433,\n\t\t\t         0.489608,-0.802637,0.340556,0.711570,-0.694601,0.105747,0.497665,-0.813807,-0.299997,0.612629,-0.737419,-0.284310,\n\t\t\t         0.563829,-0.678762,-0.470443,0.453780,-0.788141,-0.415784,0.453780,-0.788141,-0.415784,0.563829,-0.678762,-0.470443,\n\t\t\t         0.541093,-0.601215,-0.588000,0.313578,-0.792962,-0.522324,0.612629,-0.737419,-0.284310,0.812769,-0.575457,-0.090670,\n\t\t\t         0.841945,-0.480392,-0.245613,0.563829,-0.678762,-0.470443,0.563829,-0.678762,-0.470443,0.841945,-0.480392,-0.245613,\n\t\t\t         0.824976,-0.246986,-0.508316,0.541093,-0.601215,-0.588000,0.497665,-0.813807,-0.299997,0.453780,-0.788141,-0.415784,\n\t\t\t         0.416578,-0.888974,-0.190130,0.463668,-0.878567,-0.114261,0.463668,-0.878567,-0.114261,0.416578,-0.888974,-0.190130,\n\t\t\t         0.353160,-0.930143,0.100467,0.393567,-0.909970,0.130528,0.453780,-0.788141,-0.415784,0.313578,-0.792962,-0.522324,\n\t\t\t         0.214301,-0.925504,-0.312235,0.416578,-0.888974,-0.190130,0.416578,-0.888974,-0.190130,0.214301,-0.925504,-0.312235,\n\t\t\t         0.147465,-0.983856,0.101321,0.353160,-0.930143,0.100467,0.656362,0.496048,-0.568377,0.728324,0.475051,-0.493759,\n\t\t\t         0.755974,0.205969,-0.621326,0.713645,0.356456,-0.603015,0.713645,0.356456,-0.603015,0.755974,0.205969,-0.621326,\n\t\t\t         0.860805,0.069552,-0.504105,0.824732,0.291910,-0.484298,0.728324,0.475051,-0.493759,0.666921,0.450453,-0.593524,\n\t\t\t         0.701621,0.109775,-0.704001,0.755974,0.205969,-0.621326,0.755974,0.205969,-0.621326,0.701621,0.109775,-0.704001,\n\t\t\t         0.824976,-0.246986,-0.508316,0.860805,0.069552,-0.504105,0.656362,0.496048,-0.568377,0.713645,0.356456,-0.603015,\n\t\t\t         0.607562,0.622852,-0.492843,0.543901,0.693319,-0.472671,0.543901,0.693319,-0.472671,0.607562,0.622852,-0.492843,\n\t\t\t         0.474899,0.789148,-0.389447,0.348064,0.858760,-0.375927,0.713645,0.356456,-0.603015,0.824732,0.291910,-0.484298,\n\t\t\t         0.732505,0.514573,-0.445662,0.607562,0.622852,-0.492843,0.607562,0.622852,-0.492843,0.732505,0.514573,-0.445662,\n\t\t\t         0.696310,0.642232,-0.320353,0.474899,0.789148,-0.389447,0.656362,0.496048,-0.568377,0.543901,0.693319,-0.472671,\n\t\t\t         0.594073,0.737205,-0.321787,0.728324,0.475051,-0.493759,0.728324,0.475051,-0.493759,0.594073,0.737205,-0.321787,\n\t\t\t         0.493698,0.797540,-0.346629,0.666921,0.450453,-0.593524,0.543901,0.693319,-0.472671,0.348064,0.858760,-0.375927,\n\t\t\t         0.423780,0.878018,-0.222358,0.594073,0.737205,-0.321787,0.594073,0.737205,-0.321787,0.423780,0.878018,-0.222358,\n\t\t\t         0.339366,0.939543,-0.045137,0.493698,0.797540,-0.346629,-0.019623,-0.822779,0.568011,0.041993,-0.826441,0.561418,\n\t\t\t         0.069704,-0.816279,0.573382,-0.020447,-0.840968,0.540666,-0.020447,-0.840968,0.540666,0.069704,-0.816279,0.573382,\n\t\t\t         0.174932,-0.856624,0.485336,0.002533,-0.887509,0.460768,0.041993,-0.826441,0.561418,0.078768,-0.829707,0.552568,\n\t\t\t         0.084384,-0.793695,0.602405,0.069704,-0.816279,0.573382,0.069704,-0.816279,0.573382,0.084384,-0.793695,0.602405,\n\t\t\t         0.242012,-0.798395,0.551317,0.174932,-0.856624,0.485336,-0.019623,-0.822779,0.568011,-0.020447,-0.840968,0.540666,\n\t\t\t         -0.097079,-0.847072,0.522507,-0.042177,-0.853359,0.519578,-0.042177,-0.853359,0.519578,-0.097079,-0.847072,0.522507,\n\t\t\t         -0.102542,-0.850246,0.516251,-0.062410,-0.880581,0.469710,-0.020447,-0.840968,0.540666,0.002533,-0.887509,0.460768,\n\t\t\t         -0.088137,-0.885220,0.456679,-0.097079,-0.847072,0.522507,-0.097079,-0.847072,0.522507,-0.088137,-0.885220,0.456679,\n\t\t\t         0.000117,-0.850864,0.525385,-0.102542,-0.850246,0.516251,-0.019623,-0.822779,0.568011,-0.042177,-0.853359,0.519578,\n\t\t\t         0.078280,-0.883145,0.462508,0.041993,-0.826441,0.561418,0.041993,-0.826441,0.561418,0.078280,-0.883145,0.462508,\n\t\t\t         0.200201,-0.891110,0.407178,0.078768,-0.829707,0.552568,-0.042177,-0.853359,0.519578,-0.062410,-0.880581,0.469710,\n\t\t\t         0.098941,-0.922819,0.372265,0.078280,-0.883145,0.462508,0.078280,-0.883145,0.462508,0.098941,-0.922819,0.372265,\n\t\t\t         0.517960,-0.849757,0.097995,0.200201,-0.891110,0.407178,0.210395,-0.811121,0.545701,0.230750,-0.817103,0.528245,\n\t\t\t         0.326792,-0.707724,0.626331,0.244758,-0.738975,0.627674,0.244758,-0.738975,0.627674,0.326792,-0.707724,0.626331,\n\t\t\t         0.405774,-0.507736,0.759941,0.291147,-0.584185,0.757561,0.230750,-0.817103,0.528245,0.257179,-0.807367,0.531022,\n\t\t\t         0.425733,-0.667196,0.611194,0.326792,-0.707724,0.626331,0.326792,-0.707724,0.626331,0.425733,-0.667196,0.611194,\n\t\t\t         0.571245,-0.380718,0.727103,0.405774,-0.507736,0.759941,0.210395,-0.811121,0.545701,0.244758,-0.738975,0.627674,\n\t\t\t         0.200140,-0.765496,0.611499,0.191839,-0.833918,0.517441,0.191839,-0.833918,0.517441,0.200140,-0.765496,0.611499,\n\t\t\t         0.198920,-0.784936,0.586718,0.223334,-0.838099,0.497665,0.244758,-0.738975,0.627674,0.291147,-0.584185,0.757561,\n\t\t\t         0.213233,-0.626087,0.750023,0.200140,-0.765496,0.611499,0.200140,-0.765496,0.611499,0.213233,-0.626087,0.750023,\n\t\t\t         0.145940,-0.662618,0.734550,0.198920,-0.784936,0.586718,0.210395,-0.811121,0.545701,0.191839,-0.833918,0.517441,\n\t\t\t         0.174108,-0.878567,0.444716,0.230750,-0.817103,0.528245,0.230750,-0.817103,0.528245,0.174108,-0.878567,0.444716,\n\t\t\t         0.098422,-0.918058,0.383984,0.257179,-0.807367,0.531022,0.191839,-0.833918,0.517441,0.223334,-0.838099,0.497665,\n\t\t\t         0.214545,-0.897427,0.385418,0.174108,-0.878567,0.444716,0.174108,-0.878567,0.444716,0.214545,-0.897427,0.385418,\n\t\t\t         0.147465,-0.983856,0.101321,0.098422,-0.918058,0.383984,0.099612,-0.803217,0.587268,0.045991,-0.768761,0.637867,\n\t\t\t         0.070864,-0.773797,0.629444,0.126041,-0.806665,0.577349,0.126041,-0.806665,0.577349,0.070864,-0.773797,0.629444,\n\t\t\t         0.097903,-0.777642,0.620991,0.178198,-0.788018,0.589282,0.045991,-0.768761,0.637867,0.006989,-0.721976,0.691855,\n\t\t\t         0.097507,-0.750725,0.653340,0.070864,-0.773797,0.629444,0.070864,-0.773797,0.629444,0.097507,-0.750725,0.653340,\n\t\t\t         0.242012,-0.798395,0.551317,0.097903,-0.777642,0.620991,0.099612,-0.803217,0.587268,0.126041,-0.806665,0.577349,\n\t\t\t         0.221320,-0.830348,0.511338,0.146062,-0.814783,0.561052,0.146062,-0.814783,0.561052,0.221320,-0.830348,0.511338,\n\t\t\t         0.286416,-0.851192,0.439772,0.195349,-0.827296,0.526688,0.126041,-0.806665,0.577349,0.178198,-0.788018,0.589282,\n\t\t\t         0.320841,-0.797784,0.510453,0.221320,-0.830348,0.511338,0.221320,-0.830348,0.511338,0.320841,-0.797784,0.510453,\n\t\t\t         0.489608,-0.802637,0.340556,0.286416,-0.851192,0.439772,0.099612,-0.803217,0.587268,0.146062,-0.814783,0.561052,\n\t\t\t         0.089694,-0.769768,0.631947,0.045991,-0.768761,0.637867,0.045991,-0.768761,0.637867,0.089694,-0.769768,0.631947,\n\t\t\t         0.040407,-0.706473,0.706534,0.006989,-0.721976,0.691855,0.146062,-0.814783,0.561052,0.195349,-0.827296,0.526688,\n\t\t\t         0.155217,-0.779778,0.606464,0.089694,-0.769768,0.631947,0.089694,-0.769768,0.631947,0.155217,-0.779778,0.606464,\n\t\t\t         0.145940,-0.662618,0.734550,0.040407,-0.706473,0.706534,0.280831,-0.850246,0.445143,0.265481,-0.838557,0.475723,\n\t\t\t         0.221992,-0.807092,0.547075,0.244423,-0.839686,0.484909,0.244423,-0.839686,0.484909,0.221992,-0.807092,0.547075,\n\t\t\t         0.155217,-0.779778,0.606464,0.195349,-0.827296,0.526688,0.265481,-0.838557,0.475723,0.223334,-0.838099,0.497665,\n\t\t\t         0.198920,-0.784936,0.586718,0.221992,-0.807092,0.547075,0.221992,-0.807092,0.547075,0.198920,-0.784936,0.586718,\n\t\t\t         0.145940,-0.662618,0.734550,0.155217,-0.779778,0.606464,0.280831,-0.850246,0.445143,0.244423,-0.839686,0.484909,\n\t\t\t         0.310770,-0.873135,0.375469,0.319895,-0.884457,0.339671,0.319895,-0.884457,0.339671,0.310770,-0.873135,0.375469,\n\t\t\t         0.428358,-0.882412,0.194433,0.393567,-0.909970,0.130528,0.244423,-0.839686,0.484909,0.195349,-0.827296,0.526688,\n\t\t\t         0.286416,-0.851192,0.439772,0.310770,-0.873135,0.375469,0.310770,-0.873135,0.375469,0.286416,-0.851192,0.439772,\n\t\t\t         0.489608,-0.802637,0.340556,0.428358,-0.882412,0.194433,0.280831,-0.850246,0.445143,0.319895,-0.884457,0.339671,\n\t\t\t         0.295358,-0.888272,0.351695,0.265481,-0.838557,0.475723,0.265481,-0.838557,0.475723,0.295358,-0.888272,0.351695,\n\t\t\t         0.214545,-0.897427,0.385418,0.223334,-0.838099,0.497665,0.319895,-0.884457,0.339671,0.393567,-0.909970,0.130528,\n\t\t\t         0.353160,-0.930143,0.100467,0.295358,-0.888272,0.351695,0.295358,-0.888272,0.351695,0.353160,-0.930143,0.100467,\n\t\t\t         0.147465,-0.983856,0.101321,0.214545,-0.897427,0.385418,0.377972,-0.200232,0.903867,0.449141,-0.080172,0.889828,\n\t\t\t         0.449751,0.028626,0.892666,0.359905,-0.190313,0.913358,0.359905,-0.190313,0.913358,0.449751,0.028626,0.892666,\n\t\t\t         0.497574,0.085818,0.863155,0.411725,-0.196539,0.889828,0.449141,-0.080172,0.889828,0.487625,0.016449,0.872890,\n\t\t\t         0.476852,0.180364,0.860256,0.449751,0.028626,0.892666,0.449751,0.028626,0.892666,0.476852,0.180364,0.860256,\n\t\t\t         0.466018,0.493606,0.734245,0.497574,0.085818,0.863155,0.377972,-0.200232,0.903867,0.359905,-0.190313,0.913358,\n\t\t\t         0.259163,-0.423688,0.867916,0.337748,-0.372539,0.864345,0.337748,-0.372539,0.864345,0.259163,-0.423688,0.867916,\n\t\t\t         0.213233,-0.626087,0.750023,0.291147,-0.584185,0.757561,0.359905,-0.190313,0.913358,0.411725,-0.196539,0.889828,\n\t\t\t         0.268197,-0.439222,0.857387,0.259163,-0.423688,0.867916,0.259163,-0.423688,0.867916,0.268197,-0.439222,0.857387,\n\t\t\t         0.145940,-0.662618,0.734550,0.213233,-0.626087,0.750023,0.377972,-0.200232,0.903867,0.337748,-0.372539,0.864345,\n\t\t\t         0.440809,-0.264382,0.857753,0.449141,-0.080172,0.889828,0.449141,-0.080172,0.889828,0.440809,-0.264382,0.857753,\n\t\t\t         0.522446,-0.141423,0.840846,0.487625,0.016449,0.872890,0.337748,-0.372539,0.864345,0.291147,-0.584185,0.757561,\n\t\t\t         0.405774,-0.507736,0.759941,0.440809,-0.264382,0.857753,0.440809,-0.264382,0.857753,0.405774,-0.507736,0.759941,\n\t\t\t         0.571245,-0.380718,0.727103,0.522446,-0.141423,0.840846,0.573229,0.204871,0.793329,0.652760,0.180822,0.735618,\n\t\t\t         0.640187,0.402356,0.654378,0.549608,0.379620,0.744163,0.549608,0.379620,0.744163,0.640187,0.402356,0.654378,\n\t\t\t         0.541459,0.634999,0.550951,0.470687,0.618427,0.629261,0.652760,0.180822,0.735618,0.749016,0.151799,0.644887,\n\t\t\t         0.732597,0.382275,0.563128,0.640187,0.402356,0.654378,0.640187,0.402356,0.654378,0.732597,0.382275,0.563128,\n\t\t\t         0.626881,0.629200,0.459426,0.541459,0.634999,0.550951,0.573229,0.204871,0.793329,0.549608,0.379620,0.744163,\n\t\t\t         0.490005,0.284951,0.823786,0.521653,0.103549,0.846828,0.521653,0.103549,0.846828,0.490005,0.284951,0.823786,\n\t\t\t         0.476852,0.180364,0.860256,0.487625,0.016449,0.872890,0.549608,0.379620,0.744163,0.470687,0.618427,0.629261,\n\t\t\t         0.417554,0.571154,0.706687,0.490005,0.284951,0.823786,0.490005,0.284951,0.823786,0.417554,0.571154,0.706687,\n\t\t\t         0.466018,0.493606,0.734245,0.476852,0.180364,0.860256,0.573229,0.204871,0.793329,0.521653,0.103549,0.846828,\n\t\t\t         0.595019,-0.004578,0.803674,0.652760,0.180822,0.735618,0.652760,0.180822,0.735618,0.595019,-0.004578,0.803674,\n\t\t\t         0.700552,-0.082125,0.708823,0.749016,0.151799,0.644887,0.521653,0.103549,0.846828,0.487625,0.016449,0.872890,\n\t\t\t         0.522446,-0.141423,0.840846,0.595019,-0.004578,0.803674,0.595019,-0.004578,0.803674,0.522446,-0.141423,0.840846,\n\t\t\t         0.571245,-0.380718,0.727103,0.700552,-0.082125,0.708823,0.296274,0.880337,0.370373,0.365795,0.798029,0.478866,\n\t\t\t         0.407422,0.817682,0.406629,0.310831,0.902188,0.298990,0.310831,0.902188,0.298990,0.407422,0.817682,0.406629,\n\t\t\t         0.470504,0.814112,0.340312,0.314097,0.914212,0.255959,0.365795,0.798029,0.478866,0.470687,0.618427,0.629261,\n\t\t\t         0.541459,0.634999,0.550951,0.407422,0.817682,0.406629,0.407422,0.817682,0.406629,0.541459,0.634999,0.550951,\n\t\t\t         0.626881,0.629200,0.459426,0.470504,0.814112,0.340312,0.296274,0.880337,0.370373,0.310831,0.902188,0.298990,\n\t\t\t         0.265389,0.934385,0.237617,0.275369,0.888760,0.366405,0.275369,0.888760,0.366405,0.265389,0.934385,0.237617,\n\t\t\t         0.351024,0.914304,0.201972,0.354045,0.867885,0.348369,0.310831,0.902188,0.298990,0.314097,0.914212,0.255959,\n\t\t\t         0.238136,0.961516,0.136937,0.265389,0.934385,0.237617,0.265389,0.934385,0.237617,0.238136,0.961516,0.136937,\n\t\t\t         0.339366,0.939543,-0.045137,0.351024,0.914304,0.201972,0.296274,0.880337,0.370373,0.275369,0.888760,0.366405,\n\t\t\t         0.318552,0.793115,0.519059,0.365795,0.798029,0.478866,0.365795,0.798029,0.478866,0.318552,0.793115,0.519059,\n\t\t\t         0.417554,0.571154,0.706687,0.470687,0.618427,0.629261,0.275369,0.888760,0.366405,0.354045,0.867885,0.348369,\n\t\t\t         0.372478,0.785272,0.494522,0.318552,0.793115,0.519059,0.318552,0.793115,0.519059,0.372478,0.785272,0.494522,\n\t\t\t         0.466018,0.493606,0.734245,0.417554,0.571154,0.706687,0.290048,0.923612,-0.250557,0.404401,0.885464,-0.228797,\n\t\t\t         0.430616,0.880947,-0.196112,0.373730,0.909116,-0.183905,0.373730,0.909116,-0.183905,0.430616,0.880947,-0.196112,\n\t\t\t         0.513077,0.832331,-0.209632,0.482009,0.864071,-0.144932,0.404401,0.885464,-0.228797,0.504349,0.852290,-0.138493,\n\t\t\t         0.458296,0.879604,-0.127476,0.430616,0.880947,-0.196112,0.430616,0.880947,-0.196112,0.458296,0.879604,-0.127476,\n\t\t\t         0.434706,0.875057,-0.212806,0.513077,0.832331,-0.209632,0.290048,0.923612,-0.250557,0.373730,0.909116,-0.183905,\n\t\t\t         0.342692,0.939421,-0.005188,0.304849,0.945647,-0.113010,0.304849,0.945647,-0.113010,0.342692,0.939421,-0.005188,\n\t\t\t         0.354137,0.916166,0.187567,0.391675,0.914426,0.101871,0.373730,0.909116,-0.183905,0.482009,0.864071,-0.144932,\n\t\t\t         0.471389,0.881527,0.025697,0.342692,0.939421,-0.005188,0.342692,0.939421,-0.005188,0.471389,0.881527,0.025697,\n\t\t\t         0.436476,0.858943,0.267739,0.354137,0.916166,0.187567,0.290048,0.923612,-0.250557,0.304849,0.945647,-0.113010,\n\t\t\t         0.325388,0.930387,-0.168767,0.277993,0.905972,-0.319163,0.277993,0.905972,-0.319163,0.325388,0.930387,-0.168767,\n\t\t\t         0.423780,0.878018,-0.222358,0.348064,0.858760,-0.375927,0.304849,0.945647,-0.113010,0.391675,0.914426,0.101871,\n\t\t\t         0.423322,0.904874,0.044221,0.325388,0.930387,-0.168767,0.325388,0.930387,-0.168767,0.423322,0.904874,0.044221,\n\t\t\t         0.339366,0.939543,-0.045137,0.423780,0.878018,-0.222358,0.290048,0.923612,-0.250557,0.277993,0.905972,-0.319163,\n\t\t\t         0.383435,0.866115,-0.320597,0.404401,0.885464,-0.228797,0.404401,0.885464,-0.228797,0.383435,0.866115,-0.320597,\n\t\t\t         0.562944,0.805170,-0.186346,0.504349,0.852290,-0.138493,0.277993,0.905972,-0.319163,0.348064,0.858760,-0.375927,\n\t\t\t         0.474899,0.789148,-0.389447,0.383435,0.866115,-0.320597,0.383435,0.866115,-0.320597,0.474899,0.789148,-0.389447,\n\t\t\t         0.696310,0.642232,-0.320353,0.562944,0.805170,-0.186346,0.440016,0.838099,0.322367,0.411603,0.825739,0.385571,\n\t\t\t         0.428785,0.792383,0.433882,0.437819,0.836726,0.328837,0.437819,0.836726,0.328837,0.428785,0.792383,0.433882,\n\t\t\t         0.372478,0.785272,0.494522,0.354045,0.867885,0.348369,0.411603,0.825739,0.385571,0.383618,0.802820,0.456343,\n\t\t\t         0.424512,0.730613,0.534745,0.428785,0.792383,0.433882,0.428785,0.792383,0.433882,0.424512,0.730613,0.534745,\n\t\t\t         0.466018,0.493606,0.734245,0.372478,0.785272,0.494522,0.440016,0.838099,0.322367,0.437819,0.836726,0.328837,\n\t\t\t         0.439680,0.876736,0.194891,0.417371,0.878811,0.231239,0.417371,0.878811,0.231239,0.439680,0.876736,0.194891,\n\t\t\t         0.423322,0.904874,0.044221,0.391675,0.914426,0.101871,0.437819,0.836726,0.328837,0.354045,0.867885,0.348369,\n\t\t\t         0.351024,0.914304,0.201972,0.439680,0.876736,0.194891,0.439680,0.876736,0.194891,0.351024,0.914304,0.201972,\n\t\t\t         0.339366,0.939543,-0.045137,0.423322,0.904874,0.044221,0.440016,0.838099,0.322367,0.417371,0.878811,0.231239,\n\t\t\t         0.371105,0.877163,0.304697,0.411603,0.825739,0.385571,0.411603,0.825739,0.385571,0.371105,0.877163,0.304697,\n\t\t\t         0.340648,0.854122,0.392926,0.383618,0.802820,0.456343,0.417371,0.878811,0.231239,0.391675,0.914426,0.101871,\n\t\t\t         0.354137,0.916166,0.187567,0.371105,0.877163,0.304697,0.371105,0.877163,0.304697,0.354137,0.916166,0.187567,\n\t\t\t         0.436476,0.858943,0.267739,0.340648,0.854122,0.392926,0.279977,0.689474,0.667959,0.345225,0.760186,0.550340,\n\t\t\t         0.307260,0.801538,0.512925,0.241523,0.687826,0.684500,0.241523,0.687826,0.684500,0.307260,0.801538,0.512925,\n\t\t\t         0.414777,0.792261,0.447493,0.353069,0.669210,0.653798,0.345225,0.760186,0.550340,0.383618,0.802820,0.456343,\n\t\t\t         0.340648,0.854122,0.392926,0.307260,0.801538,0.512925,0.307260,0.801538,0.512925,0.340648,0.854122,0.392926,\n\t\t\t         0.436476,0.858943,0.267739,0.414777,0.792261,0.447493,0.279977,0.689474,0.667959,0.241523,0.687826,0.684500,\n\t\t\t         0.158147,0.483352,0.860988,0.282052,0.576403,0.766930,0.282052,0.576403,0.766930,0.158147,0.483352,0.860988,\n\t\t\t         0.118992,0.216651,0.968963,0.309000,0.363323,0.878903,0.241523,0.687826,0.684500,0.353069,0.669210,0.653798,\n\t\t\t         0.234748,0.415815,0.878597,0.158147,0.483352,0.860988,0.158147,0.483352,0.860988,0.234748,0.415815,0.878597,\n\t\t\t         0.111972,-0.031098,0.993194,0.118992,0.216651,0.968963,0.279977,0.689474,0.667959,0.282052,0.576403,0.766930,\n\t\t\t         0.392254,0.661367,0.639271,0.345225,0.760186,0.550340,0.345225,0.760186,0.550340,0.392254,0.661367,0.639271,\n\t\t\t         0.424512,0.730613,0.534745,0.383618,0.802820,0.456343,0.282052,0.576403,0.766930,0.309000,0.363323,0.878903,\n\t\t\t         0.463179,0.436628,0.771233,0.392254,0.661367,0.639271,0.392254,0.661367,0.639271,0.463179,0.436628,0.771233,\n\t\t\t         0.466018,0.493606,0.734245,0.424512,0.730613,0.534745,0.361217,-0.157872,0.919004,0.439619,-0.191290,0.877560,\n\t\t\t         0.502152,0.106418,0.858180,0.346233,0.074190,0.935179,0.346233,0.074190,0.935179,0.502152,0.106418,0.858180,\n\t\t\t         0.463179,0.436628,0.771233,0.309000,0.363323,0.878903,0.439619,-0.191290,0.877560,0.411725,-0.196539,0.889828,\n\t\t\t         0.497574,0.085818,0.863155,0.502152,0.106418,0.858180,0.502152,0.106418,0.858180,0.497574,0.085818,0.863155,\n\t\t\t         0.466018,0.493606,0.734245,0.463179,0.436628,0.771233,0.361217,-0.157872,0.919004,0.346233,0.074190,0.935179,\n\t\t\t         0.131993,-0.077090,0.988220,0.202673,-0.306497,0.930021,0.202673,-0.306497,0.930021,0.131993,-0.077090,0.988220,\n\t\t\t         -0.001404,-0.283578,0.958922,0.042116,-0.449263,0.892392,0.346233,0.074190,0.935179,0.309000,0.363323,0.878903,\n\t\t\t         0.118992,0.216651,0.968963,0.131993,-0.077090,0.988220,0.131993,-0.077090,0.988220,0.118992,0.216651,0.968963,\n\t\t\t         0.111972,-0.031098,0.993194,-0.001404,-0.283578,0.958922,0.361217,-0.157872,0.919004,0.202673,-0.306497,0.930021,\n\t\t\t         0.280007,-0.414563,0.865841,0.439619,-0.191290,0.877560,0.439619,-0.191290,0.877560,0.280007,-0.414563,0.865841,\n\t\t\t         0.268197,-0.439222,0.857387,0.411725,-0.196539,0.889828,0.202673,-0.306497,0.930021,0.042116,-0.449263,0.892392,\n\t\t\t         0.111728,-0.557360,0.822687,0.280007,-0.414563,0.865841,0.280007,-0.414563,0.865841,0.111728,-0.557360,0.822687,\n\t\t\t         0.145940,-0.662618,0.734550,0.268197,-0.439222,0.857387,-0.025636,-0.603595,0.796838,-0.009857,-0.666738,0.745201,\n\t\t\t         -0.001282,-0.628407,0.777856,-0.027070,-0.541765,0.840052,-0.027070,-0.541765,0.840052,-0.001282,-0.628407,0.777856,\n\t\t\t         0.111728,-0.557360,0.822687,0.042116,-0.449263,0.892392,-0.009857,-0.666738,0.745201,0.006989,-0.721976,0.691855,\n\t\t\t         0.040407,-0.706473,0.706534,-0.001282,-0.628407,0.777856,-0.001282,-0.628407,0.777856,0.040407,-0.706473,0.706534,\n\t\t\t         0.145940,-0.662618,0.734550,0.111728,-0.557360,0.822687,-0.025636,-0.603595,0.796838,-0.027070,-0.541765,0.840052,\n\t\t\t         -0.002808,-0.456984,0.889431,0.099246,-0.602069,0.792230,0.099246,-0.602069,0.792230,-0.002808,-0.456984,0.889431,\n\t\t\t         0.152257,-0.432539,0.888638,0.333476,-0.605731,0.722373,-0.027070,-0.541765,0.840052,0.042116,-0.449263,0.892392,\n\t\t\t         -0.001404,-0.283578,0.958922,-0.002808,-0.456984,0.889431,-0.002808,-0.456984,0.889431,-0.001404,-0.283578,0.958922,\n\t\t\t         0.111972,-0.031098,0.993194,0.152257,-0.432539,0.888638,-0.025636,-0.603595,0.796838,0.099246,-0.602069,0.792230,\n\t\t\t         0.140294,-0.702048,0.698141,-0.009857,-0.666738,0.745201,-0.009857,-0.666738,0.745201,0.140294,-0.702048,0.698141,\n\t\t\t         0.097507,-0.750725,0.653340,0.006989,-0.721976,0.691855,0.099246,-0.602069,0.792230,0.333476,-0.605731,0.722373,\n\t\t\t         0.396161,-0.713095,0.578356,0.140294,-0.702048,0.698141,0.140294,-0.702048,0.698141,0.396161,-0.713095,0.578356,\n\t\t\t         0.242012,-0.798395,0.551317,0.097507,-0.750725,0.653340,0.598437,-0.550401,0.582110,0.544115,-0.679189,0.492538,\n\t\t\t         0.521958,-0.696646,0.492111,0.521500,-0.582629,0.623310,0.521500,-0.582629,0.623310,0.521958,-0.696646,0.492111,\n\t\t\t         0.396161,-0.713095,0.578356,0.333476,-0.605731,0.722373,0.544115,-0.679189,0.492538,0.403363,-0.791589,0.458968,\n\t\t\t         0.408460,-0.795953,0.446730,0.521958,-0.696646,0.492111,0.521958,-0.696646,0.492111,0.408460,-0.795953,0.446730,\n\t\t\t         0.242012,-0.798395,0.551317,0.396161,-0.713095,0.578356,0.598437,-0.550401,0.582110,0.521500,-0.582629,0.623310,\n\t\t\t         0.396100,-0.425306,0.813746,0.579272,-0.401013,0.709647,0.579272,-0.401013,0.709647,0.396100,-0.425306,0.813746,\n\t\t\t         0.400220,-0.090304,0.911924,0.626514,-0.080172,0.775262,0.521500,-0.582629,0.623310,0.333476,-0.605731,0.722373,\n\t\t\t         0.152257,-0.432539,0.888638,0.396100,-0.425306,0.813746,0.396100,-0.425306,0.813746,0.152257,-0.432539,0.888638,\n\t\t\t         0.111972,-0.031098,0.993194,0.400220,-0.090304,0.911924,0.598437,-0.550401,0.582110,0.579272,-0.401013,0.709647,\n\t\t\t         0.659780,-0.380169,0.648152,0.617939,-0.554857,0.556963,0.617939,-0.554857,0.556963,0.659780,-0.380169,0.648152,\n\t\t\t         0.704031,-0.367565,0.607624,0.598224,-0.568285,0.564928,0.579272,-0.401013,0.709647,0.626514,-0.080172,0.775262,\n\t\t\t         0.722922,-0.052461,0.688925,0.659780,-0.380169,0.648152,0.659780,-0.380169,0.648152,0.722922,-0.052461,0.688925,\n\t\t\t         0.747002,-0.024812,0.664327,0.704031,-0.367565,0.607624,0.598437,-0.550401,0.582110,0.617939,-0.554857,0.556963,\n\t\t\t         0.508652,-0.703207,0.496689,0.544115,-0.679189,0.492538,0.544115,-0.679189,0.492538,0.508652,-0.703207,0.496689,\n\t\t\t         0.345805,-0.809626,0.474227,0.403363,-0.791589,0.458968,0.617939,-0.554857,0.556963,0.598224,-0.568285,0.564928,\n\t\t\t         0.397198,-0.732963,0.552232,0.508652,-0.703207,0.496689,0.508652,-0.703207,0.496689,0.397198,-0.732963,0.552232,\n\t\t\t         0.173376,-0.810327,0.559709,0.345805,-0.809626,0.474227,0.717948,0.513230,0.470229,0.678640,0.308817,0.666341,\n\t\t\t         0.501816,0.346049,0.792688,0.590411,0.590411,0.550249,0.590411,0.590411,0.550249,0.501816,0.346049,0.792688,\n\t\t\t         0.234748,0.415815,0.878597,0.353069,0.669210,0.653798,0.678640,0.308817,0.666341,0.626514,-0.080172,0.775262,\n\t\t\t         0.400220,-0.090304,0.911924,0.501816,0.346049,0.792688,0.501816,0.346049,0.792688,0.400220,-0.090304,0.911924,\n\t\t\t         0.111972,-0.031098,0.993194,0.234748,0.415815,0.878597,0.717948,0.513230,0.470229,0.590411,0.590411,0.550249,\n\t\t\t         0.625019,0.698843,0.347697,0.740104,0.606403,0.290597,0.740104,0.606403,0.290597,0.625019,0.698843,0.347697,\n\t\t\t         0.644276,0.744621,0.174291,0.699484,0.702963,0.128452,0.590411,0.590411,0.550249,0.353069,0.669210,0.653798,\n\t\t\t         0.414777,0.792261,0.447493,0.625019,0.698843,0.347697,0.625019,0.698843,0.347697,0.414777,0.792261,0.447493,\n\t\t\t         0.436476,0.858943,0.267739,0.644276,0.744621,0.174291,0.717948,0.513230,0.470229,0.740104,0.606403,0.290597,\n\t\t\t         0.604633,0.700888,0.378307,0.637074,0.557421,0.532334,0.637074,0.557421,0.532334,0.604633,0.700888,0.378307,\n\t\t\t         0.352672,0.754875,0.552934,0.482498,0.589526,0.647755,0.740104,0.606403,0.290597,0.699484,0.702963,0.128452,\n\t\t\t         0.567431,0.795038,0.214270,0.604633,0.700888,0.378307,0.604633,0.700888,0.378307,0.567431,0.795038,0.214270,\n\t\t\t         0.291238,0.882260,0.369762,0.352672,0.754875,0.552934,0.717948,0.513230,0.470229,0.637074,0.557421,0.532334,\n\t\t\t         0.712882,0.310678,0.628651,0.678640,0.308817,0.666341,0.678640,0.308817,0.666341,0.712882,0.310678,0.628651,\n\t\t\t         0.722922,-0.052461,0.688925,0.626514,-0.080172,0.775262,0.637074,0.557421,0.532334,0.482498,0.589526,0.647755,\n\t\t\t         0.647664,0.335063,0.684255,0.712882,0.310678,0.628651,0.712882,0.310678,0.628651,0.647664,0.335063,0.684255,\n\t\t\t         0.747002,-0.024812,0.664327,0.722922,-0.052461,0.688925,0.607227,0.784082,-0.128208,0.642689,0.766045,-0.008362,\n\t\t\t         0.596149,0.802576,0.020203,0.530992,0.840724,-0.105777,0.530992,0.840724,-0.105777,0.596149,0.802576,0.020203,\n\t\t\t         0.471389,0.881527,0.025697,0.482009,0.864071,-0.144932,0.642689,0.766045,-0.008362,0.699484,0.702963,0.128452,\n\t\t\t         0.644276,0.744621,0.174291,0.596149,0.802576,0.020203,0.596149,0.802576,0.020203,0.644276,0.744621,0.174291,\n\t\t\t         0.436476,0.858943,0.267739,0.471389,0.881527,0.025697,0.607227,0.784082,-0.128208,0.530992,0.840724,-0.105777,\n\t\t\t         0.559496,0.800470,-0.214850,0.635304,0.729026,-0.254707,0.635304,0.729026,-0.254707,0.559496,0.800470,-0.214850,\n\t\t\t         0.561693,0.752342,-0.344127,0.606891,0.716117,-0.344707,0.530992,0.840724,-0.105777,0.482009,0.864071,-0.144932,\n\t\t\t         0.513077,0.832331,-0.209632,0.559496,0.800470,-0.214850,0.559496,0.800470,-0.214850,0.513077,0.832331,-0.209632,\n\t\t\t         0.434706,0.875057,-0.212806,0.561693,0.752342,-0.344127,0.607227,0.784082,-0.128208,0.635304,0.729026,-0.254707,\n\t\t\t         0.593890,0.758232,-0.268899,0.580279,0.813929,-0.027558,0.580279,0.813929,-0.027558,0.593890,0.758232,-0.268899,\n\t\t\t         0.346294,0.919828,-0.184271,0.390698,0.920347,-0.016907,0.635304,0.729026,-0.254707,0.606891,0.716117,-0.344707,\n\t\t\t         0.556749,0.751335,-0.354198,0.593890,0.758232,-0.268899,0.593890,0.758232,-0.268899,0.556749,0.751335,-0.354198,\n\t\t\t         0.475997,0.805414,-0.353099,0.346294,0.919828,-0.184271,0.607227,0.784082,-0.128208,0.580279,0.813929,-0.027558,\n\t\t\t         0.557512,0.827143,0.070620,0.642689,0.766045,-0.008362,0.642689,0.766045,-0.008362,0.557512,0.827143,0.070620,\n\t\t\t         0.567431,0.795038,0.214270,0.699484,0.702963,0.128452,0.580279,0.813929,-0.027558,0.390698,0.920347,-0.016907,\n\t\t\t         0.333659,0.924009,0.186651,0.557512,0.827143,0.070620,0.557512,0.827143,0.070620,0.333659,0.924009,0.186651,\n\t\t\t         0.291238,0.882260,0.369762,0.567431,0.795038,0.214270,0.320536,0.684255,-0.654988,0.459487,0.708975,-0.534928,\n\t\t\t         0.415387,0.764885,-0.492264,0.184606,0.871700,-0.453902,0.184606,0.871700,-0.453902,0.415387,0.764885,-0.492264,\n\t\t\t         0.213996,0.951048,-0.222877,0.029939,0.990143,-0.136662,0.459487,0.708975,-0.534928,0.606891,0.716117,-0.344707,\n\t\t\t         0.561693,0.752342,-0.344127,0.415387,0.764885,-0.492264,0.415387,0.764885,-0.492264,0.561693,0.752342,-0.344127,\n\t\t\t         0.434706,0.875057,-0.212806,0.213996,0.951048,-0.222877,0.320536,0.684255,-0.654988,0.184606,0.871700,-0.453902,\n\t\t\t         0.032960,0.937315,-0.346843,0.214698,0.759239,-0.614368,0.214698,0.759239,-0.614368,0.032960,0.937315,-0.346843,\n\t\t\t         -0.021882,0.903043,-0.428968,0.041780,0.803217,-0.594165,0.184606,0.871700,-0.453902,0.029939,0.990143,-0.136662,\n\t\t\t         -0.057680,0.990143,-0.127415,0.032960,0.937315,-0.346843,0.032960,0.937315,-0.346843,-0.057680,0.990143,-0.127415,\n\t\t\t         -0.068575,0.989776,-0.124882,-0.021882,0.903043,-0.428968,0.320536,0.684255,-0.654988,0.214698,0.759239,-0.614368,\n\t\t\t         0.260933,0.629841,-0.731559,0.362560,0.646748,-0.670980,0.362560,0.646748,-0.670980,0.260933,0.629841,-0.731559,\n\t\t\t         0.281961,0.557268,-0.780969,0.379620,0.640431,-0.667592,0.214698,0.759239,-0.614368,0.041780,0.803217,-0.594165,\n\t\t\t         0.095035,0.631001,-0.769921,0.260933,0.629841,-0.731559,0.260933,0.629841,-0.731559,0.095035,0.631001,-0.769921,\n\t\t\t         0.098544,0.533372,-0.840083,0.281961,0.557268,-0.780969,0.320536,0.684255,-0.654988,0.362560,0.646748,-0.670980,\n\t\t\t         0.445418,0.738182,-0.506607,0.459487,0.708975,-0.534928,0.459487,0.708975,-0.534928,0.445418,0.738182,-0.506607,\n\t\t\t         0.556749,0.751335,-0.354198,0.606891,0.716117,-0.344707,0.362560,0.646748,-0.670980,0.379620,0.640431,-0.667592,\n\t\t\t         0.423475,0.759728,-0.493393,0.445418,0.738182,-0.506607,0.445418,0.738182,-0.506607,0.423475,0.759728,-0.493393,\n\t\t\t         0.475997,0.805414,-0.353099,0.556749,0.751335,-0.354198,0.164586,-0.909421,0.381848,0.091311,-0.917997,0.385846,\n\t\t\t         0.278085,-0.870479,0.406018,0.263131,-0.865322,0.426527,0.263131,-0.865322,0.426527,0.278085,-0.870479,0.406018,\n\t\t\t         0.408460,-0.795953,0.446730,0.403363,-0.791589,0.458968,0.091311,-0.917997,0.385846,0.002533,-0.887509,0.460768,\n\t\t\t         0.174932,-0.856624,0.485336,0.278085,-0.870479,0.406018,0.278085,-0.870479,0.406018,0.174932,-0.856624,0.485336,\n\t\t\t         0.242012,-0.798395,0.551317,0.408460,-0.795953,0.446730,0.164586,-0.909421,0.381848,0.263131,-0.865322,0.426527,\n\t\t\t         0.194403,-0.866451,0.459792,0.050569,-0.920743,0.386853,0.050569,-0.920743,0.386853,0.194403,-0.866451,0.459792,\n\t\t\t         0.024018,-0.851436,0.523850,-0.126316,-0.880123,0.457564,0.263131,-0.865322,0.426527,0.403363,-0.791589,0.458968,\n\t\t\t         0.345805,-0.809626,0.474227,0.194403,-0.866451,0.459792,0.194403,-0.866451,0.459792,0.345805,-0.809626,0.474227,\n\t\t\t         0.173376,-0.810327,0.559709,0.024018,-0.851436,0.523850,0.164586,-0.909421,0.381848,0.050569,-0.920743,0.386853,\n\t\t\t         -0.056764,-0.923643,0.378979,0.091311,-0.917997,0.385846,0.091311,-0.917997,0.385846,-0.056764,-0.923643,0.378979,\n\t\t\t         -0.088137,-0.885220,0.456679,0.002533,-0.887509,0.460768,0.050569,-0.920743,0.386853,-0.126316,-0.880123,0.457564,\n\t\t\t         -0.422895,-0.601672,0.677572,-0.056764,-0.923643,0.378979,-0.056764,-0.923643,0.378979,-0.422895,-0.601672,0.677572,\n\t\t\t         0.000117,-0.850864,0.525385,-0.088137,-0.885220,0.456679,-0.069460,-0.574450,0.815577,-0.293313,-0.603565,0.741356,\n\t\t\t         0.123112,-0.719443,0.683523,0.354442,-0.602802,0.714805,0.354442,-0.602802,0.714805,0.123112,-0.719443,0.683523,\n\t\t\t         0.397198,-0.732963,0.552232,0.598224,-0.568285,0.564928,-0.293313,-0.603565,0.741356,-0.492203,-0.505020,0.708975,\n\t\t\t         -0.105502,-0.728965,0.676351,0.123112,-0.719443,0.683523,0.123112,-0.719443,0.683523,-0.105502,-0.728965,0.676351,\n\t\t\t         0.173376,-0.810327,0.559709,0.397198,-0.732963,0.552232,-0.069460,-0.574450,0.815577,0.354442,-0.602802,0.714805,\n\t\t\t         0.534227,-0.384381,0.752861,0.171789,-0.424574,0.888913,0.171789,-0.424574,0.888913,0.534227,-0.384381,0.752861,\n\t\t\t         0.581622,-0.049165,0.811945,0.317606,-0.112766,0.941465,0.354442,-0.602802,0.714805,0.598224,-0.568285,0.564928,\n\t\t\t         0.704031,-0.367565,0.607624,0.534227,-0.384381,0.752861,0.534227,-0.384381,0.752861,0.704031,-0.367565,0.607624,\n\t\t\t         0.747002,-0.024812,0.664327,0.581622,-0.049165,0.811945,-0.069460,-0.574450,0.815577,0.171789,-0.424574,0.888913,\n\t\t\t         -0.091433,-0.480880,0.871975,-0.369274,-0.528886,0.764092,-0.369274,-0.528886,0.764092,-0.091433,-0.480880,0.871975,\n\t\t\t         -0.228302,-0.523961,0.820575,-0.500755,-0.503431,0.704132,0.171789,-0.424574,0.888913,0.317606,-0.112766,0.941465,\n\t\t\t         0.156102,-0.237220,0.958800,-0.091433,-0.480880,0.871975,-0.091433,-0.480880,0.871975,0.156102,-0.237220,0.958800,\n\t\t\t         0.073431,-0.347984,0.934620,-0.228302,-0.523961,0.820575,-0.069460,-0.574450,0.815577,-0.369274,-0.528886,0.764092,\n\t\t\t         -0.581713,-0.460921,0.670156,-0.293313,-0.603565,0.741356,-0.293313,-0.603565,0.741356,-0.581713,-0.460921,0.670156,\n\t\t\t         -0.730644,-0.293954,0.616199,-0.492203,-0.505020,0.708975,-0.369274,-0.528886,0.764092,-0.500755,-0.503431,0.704132,\n\t\t\t         -0.682853,-0.402689,0.609551,-0.581713,-0.460921,0.670156,-0.581713,-0.460921,0.670156,-0.682853,-0.402689,0.609551,\n\t\t\t         -0.785549,-0.231874,0.573714,-0.730644,-0.293954,0.616199,-0.049745,0.819117,0.571429,0.037172,0.874905,0.482833,\n\t\t\t         -0.126072,0.839167,0.529008,-0.201666,0.757317,0.621082,-0.201666,0.757317,0.621082,-0.126072,0.839167,0.529008,\n\t\t\t         -0.015015,0.826197,0.563128,0.029664,0.778802,0.626514,0.037172,0.874905,0.482833,0.141606,0.921781,0.360881,\n\t\t\t         -0.054231,0.904599,0.422742,-0.126072,0.839167,0.529008,-0.126072,0.839167,0.529008,-0.054231,0.904599,0.422742,\n\t\t\t         0.011170,0.890439,0.454939,-0.015015,0.826197,0.563128,-0.049745,0.819117,0.571429,-0.201666,0.757317,0.621082,\n\t\t\t         -0.208838,0.699789,0.683096,-0.007874,0.774102,0.632984,-0.007874,0.774102,0.632984,-0.208838,0.699789,0.683096,\n\t\t\t         -0.151006,0.679281,0.718131,-0.005371,0.742698,0.669546,-0.201666,0.757317,0.621082,0.029664,0.778802,0.626514,\n\t\t\t         0.057588,0.726798,0.684378,-0.208838,0.699789,0.683096,-0.208838,0.699789,0.683096,0.057588,0.726798,0.684378,\n\t\t\t         0.012666,0.638650,0.769393,-0.151006,0.679281,0.718131,-0.049745,0.819117,0.571429,-0.007874,0.774102,0.632984,\n\t\t\t         0.170873,0.852412,0.494125,0.037172,0.874905,0.482833,0.037172,0.874905,0.482833,0.170873,0.852412,0.494125,\n\t\t\t         0.213996,0.914762,0.342570,0.141606,0.921781,0.360881,-0.007874,0.774102,0.632984,-0.005371,0.742698,0.669546,\n\t\t\t         0.209174,0.801233,0.560564,0.170873,0.852412,0.494125,0.170873,0.852412,0.494125,0.209174,0.801233,0.560564,\n\t\t\t         0.291238,0.882260,0.369762,0.213996,0.914762,0.342570,0.177801,0.978484,0.104556,0.172155,0.954711,0.242561,\n\t\t\t         0.245552,0.946013,0.211463,0.193457,0.978973,0.064272,0.193457,0.978973,0.064272,0.245552,0.946013,0.211463,\n\t\t\t         0.333659,0.924009,0.186651,0.390698,0.920347,-0.016907,0.172155,0.954711,0.242561,0.141606,0.921781,0.360881,\n\t\t\t         0.213996,0.914762,0.342570,0.245552,0.946013,0.211463,0.245552,0.946013,0.211463,0.213996,0.914762,0.342570,\n\t\t\t         0.291238,0.882260,0.369762,0.333659,0.924009,0.186651,0.177801,0.978484,0.104556,0.193457,0.978973,0.064272,\n\t\t\t         0.341563,0.916593,-0.207801,0.186590,0.981353,-0.045595,0.186590,0.981353,-0.045595,0.341563,0.916593,-0.207801,\n\t\t\t         0.345592,0.904782,-0.248787,0.268349,0.942717,-0.198096,0.193457,0.978973,0.064272,0.390698,0.920347,-0.016907,\n\t\t\t         0.346294,0.919828,-0.184271,0.341563,0.916593,-0.207801,0.341563,0.916593,-0.207801,0.346294,0.919828,-0.184271,\n\t\t\t         0.475997,0.805414,-0.353099,0.345592,0.904782,-0.248787,0.177801,0.978484,0.104556,0.186590,0.981353,-0.045595,\n\t\t\t         0.116153,0.993225,-0.001923,0.048494,0.992401,0.112857,0.048494,0.992401,0.112857,0.116153,0.993225,-0.001923,\n\t\t\t         0.054384,0.997436,0.046358,-0.021607,0.993164,0.114689,0.186590,0.981353,-0.045595,0.268349,0.942717,-0.198096,\n\t\t\t         0.215918,0.960753,-0.174047,0.116153,0.993225,-0.001923,0.116153,0.993225,-0.001923,0.215918,0.960753,-0.174047,\n\t\t\t         0.193518,0.965941,-0.171636,0.054384,0.997436,0.046358,0.177801,0.978484,0.104556,0.048494,0.992401,0.112857,\n\t\t\t         -0.006378,0.961516,0.274606,0.172155,0.954711,0.242561,0.172155,0.954711,0.242561,-0.006378,0.961516,0.274606,\n\t\t\t         -0.054231,0.904599,0.422742,0.141606,0.921781,0.360881,0.048494,0.992401,0.112857,-0.021607,0.993164,0.114689,\n\t\t\t         -0.038850,0.955657,0.291818,-0.006378,0.961516,0.274606,-0.006378,0.961516,0.274606,-0.038850,0.955657,0.291818,\n\t\t\t         0.011170,0.890439,0.454939,-0.054231,0.904599,0.422742,-0.680349,-0.270577,0.681082,-0.480392,-0.558763,0.675985,\n\t\t\t         -0.257515,-0.706504,0.659169,-0.630573,-0.364971,0.684927,-0.630573,-0.364971,0.684927,-0.257515,-0.706504,0.659169,\n\t\t\t         -0.105502,-0.728965,0.676351,-0.492203,-0.505020,0.708975,-0.480392,-0.558763,0.675985,-0.126316,-0.880123,0.457564,\n\t\t\t         0.024018,-0.851436,0.523850,-0.257515,-0.706504,0.659169,-0.257515,-0.706504,0.659169,0.024018,-0.851436,0.523850,\n\t\t\t         0.173376,-0.810327,0.559709,-0.105502,-0.728965,0.676351,-0.680349,-0.270577,0.681082,-0.630573,-0.364971,0.684927,\n\t\t\t         -0.788110,-0.122196,0.603259,-0.772515,-0.018708,0.634663,-0.772515,-0.018708,0.634663,-0.788110,-0.122196,0.603259,\n\t\t\t         -0.819079,-0.011504,0.573566,-0.757048,0.256127,0.601063,-0.630573,-0.364971,0.684927,-0.492203,-0.505020,0.708975,\n\t\t\t         -0.730644,-0.293954,0.616199,-0.788110,-0.122196,0.603259,-0.788110,-0.122196,0.603259,-0.730644,-0.293954,0.616199,\n\t\t\t         -0.785549,-0.231874,0.573714,-0.819079,-0.011504,0.573566,-0.680349,-0.270577,0.681082,-0.772515,-0.018708,0.634663,\n\t\t\t         -0.654775,-0.259774,0.709769,-0.480392,-0.558763,0.675985,-0.480392,-0.558763,0.675985,-0.654775,-0.259774,0.709769,\n\t\t\t         -0.422895,-0.601672,0.677572,-0.126316,-0.880123,0.457564,-0.772515,-0.018708,0.634663,-0.757048,0.256127,0.601063,\n\t\t\t         -0.672868,0.107226,0.731950,-0.654775,-0.259774,0.709769,-0.654775,-0.259774,0.709769,-0.672868,0.107226,0.731950,\n\t\t\t         0.000117,-0.850864,0.525385,-0.422895,-0.601672,0.677572,0.275002,0.814844,-0.510239,0.301065,0.869930,-0.390576,\n\t\t\t         0.389080,0.795770,-0.464003,0.355510,0.699179,-0.620258,0.355510,0.699179,-0.620258,0.389080,0.795770,-0.464003,\n\t\t\t         0.423475,0.759728,-0.493393,0.379620,0.640431,-0.667592,0.301065,0.869930,-0.390576,0.268349,0.942717,-0.198096,\n\t\t\t         0.345592,0.904782,-0.248787,0.389080,0.795770,-0.464003,0.389080,0.795770,-0.464003,0.345592,0.904782,-0.248787,\n\t\t\t         0.475997,0.805414,-0.353099,0.423475,0.759728,-0.493393,0.275002,0.814844,-0.510239,0.355510,0.699179,-0.620258,\n\t\t\t         0.275277,0.611896,-0.741447,0.262612,0.772576,-0.577990,0.262612,0.772576,-0.577990,0.275277,0.611896,-0.741447,\n\t\t\t         0.120304,0.619343,-0.775811,0.175909,0.769311,-0.614124,0.355510,0.699179,-0.620258,0.379620,0.640431,-0.667592,\n\t\t\t         0.281961,0.557268,-0.780969,0.275277,0.611896,-0.741447,0.275277,0.611896,-0.741447,0.281961,0.557268,-0.780969,\n\t\t\t         0.098544,0.533372,-0.840083,0.120304,0.619343,-0.775811,0.275002,0.814844,-0.510239,0.262612,0.772576,-0.577990,\n\t\t\t         0.259682,0.887173,-0.381390,0.301065,0.869930,-0.390576,0.301065,0.869930,-0.390576,0.259682,0.887173,-0.381390,\n\t\t\t         0.215918,0.960753,-0.174047,0.268349,0.942717,-0.198096,0.262612,0.772576,-0.577990,0.175909,0.769311,-0.614124,\n\t\t\t         0.221961,0.870540,-0.439161,0.259682,0.887173,-0.381390,0.259682,0.887173,-0.381390,0.221961,0.870540,-0.439161,\n\t\t\t         0.193518,0.965941,-0.171636,0.215918,0.960753,-0.174047,0.260720,0.551439,0.792383,0.093204,0.702017,0.705985,\n\t\t\t         0.057436,0.627857,0.776177,0.190283,0.477065,0.857997,0.190283,0.477065,0.857997,0.057436,0.627857,0.776177,\n\t\t\t         -0.089310,0.589878,0.802538,0.112110,0.402895,0.908354,0.093204,0.702017,0.705985,-0.005371,0.742698,0.669546,\n\t\t\t         -0.151006,0.679281,0.718131,0.057436,0.627857,0.776177,0.057436,0.627857,0.776177,-0.151006,0.679281,0.718131,\n\t\t\t         0.012666,0.638650,0.769393,-0.089310,0.589878,0.802538,0.260720,0.551439,0.792383,0.190283,0.477065,0.857997,\n\t\t\t         0.258644,0.148412,0.954497,0.298532,0.280801,0.912137,0.298532,0.280801,0.912137,0.258644,0.148412,0.954497,\n\t\t\t         0.156102,-0.237220,0.958800,0.317606,-0.112766,0.941465,0.190283,0.477065,0.857997,0.112110,0.402895,0.908354,\n\t\t\t         0.230819,0.076564,0.969980,0.258644,0.148412,0.954497,0.258644,0.148412,0.954497,0.230819,0.076564,0.969980,\n\t\t\t         0.073431,-0.347984,0.934620,0.156102,-0.237220,0.958800,0.260720,0.551439,0.792383,0.298532,0.280801,0.912137,\n\t\t\t         0.482406,0.311563,0.818628,0.324046,0.585467,0.743065,0.324046,0.585467,0.743065,0.482406,0.311563,0.818628,\n\t\t\t         0.647664,0.335063,0.684255,0.482498,0.589526,0.647755,0.298532,0.280801,0.912137,0.317606,-0.112766,0.941465,\n\t\t\t         0.581622,-0.049165,0.811945,0.482406,0.311563,0.818628,0.482406,0.311563,0.818628,0.581622,-0.049165,0.811945,\n\t\t\t         0.747002,-0.024812,0.664327,0.647664,0.335063,0.684255,0.260720,0.551439,0.792383,0.324046,0.585467,0.743065,\n\t\t\t         0.231025,0.730003,0.643178,0.093204,0.702017,0.705985,0.093204,0.702017,0.705985,0.231025,0.730003,0.643178,\n\t\t\t         0.209174,0.801233,0.560564,-0.005371,0.742698,0.669546,0.324046,0.585467,0.743065,0.482498,0.589526,0.647755,\n\t\t\t         0.352672,0.754875,0.552934,0.231025,0.730003,0.643178,0.231025,0.730003,0.643178,0.352672,0.754875,0.552934,\n\t\t\t         0.291238,0.882260,0.369762,0.209174,0.801233,0.560564,0.401959,0.893429,0.200446,0.179662,0.982574,0.047426,\n\t\t\t         0.201544,0.975677,0.086123,0.371471,0.902097,0.219550,0.371471,0.902097,0.219550,0.201544,0.975677,0.086123,\n\t\t\t         0.238136,0.961516,0.136937,0.314097,0.914212,0.255959,0.179662,0.982574,0.047426,-0.129856,0.968017,-0.214606,\n\t\t\t         0.061190,0.975738,-0.210089,0.201544,0.975677,0.086123,0.201544,0.975677,0.086123,0.061190,0.975738,-0.210089,\n\t\t\t         0.339366,0.939543,-0.045137,0.238136,0.961516,0.136937,0.401959,0.893429,0.200446,0.371471,0.902097,0.219550,\n\t\t\t         0.520707,0.804559,0.285440,0.538774,0.780755,0.316385,0.538774,0.780755,0.316385,0.520707,0.804559,0.285440,\n\t\t\t         0.692007,0.607013,0.390667,0.640889,0.623463,0.447798,0.371471,0.902097,0.219550,0.314097,0.914212,0.255959,\n\t\t\t         0.470504,0.814112,0.340312,0.520707,0.804559,0.285440,0.520707,0.804559,0.285440,0.470504,0.814112,0.340312,\n\t\t\t         0.626881,0.629200,0.459426,0.692007,0.607013,0.390667,0.401959,0.893429,0.200446,0.538774,0.780755,0.316385,\n\t\t\t         0.503922,0.787347,0.355144,0.386273,0.896115,0.218390,0.386273,0.896115,0.218390,0.503922,0.787347,0.355144,\n\t\t\t         0.559862,0.771233,0.302805,0.408551,0.886441,0.217444,0.538774,0.780755,0.316385,0.640889,0.623463,0.447798,\n\t\t\t         0.610584,0.637104,0.470351,0.503922,0.787347,0.355144,0.503922,0.787347,0.355144,0.610584,0.637104,0.470351,\n\t\t\t         0.670858,0.631397,0.388897,0.559862,0.771233,0.302805,0.401959,0.893429,0.200446,0.386273,0.896115,0.218390,\n\t\t\t         0.163091,0.986541,-0.011109,0.179662,0.982574,0.047426,0.179662,0.982574,0.047426,0.163091,0.986541,-0.011109,\n\t\t\t         -0.206641,0.925657,-0.316904,-0.129856,0.968017,-0.214606,0.386273,0.896115,0.218390,0.408551,0.886441,0.217444,\n\t\t\t         0.166234,0.984069,0.062624,0.163091,0.986541,-0.011109,0.163091,0.986541,-0.011109,0.166234,0.984069,0.062624,\n\t\t\t         -0.249458,0.924131,-0.289285,-0.206641,0.925657,-0.316904,0.744346,0.184759,0.641682,0.715781,0.408704,0.566210,\n\t\t\t         0.767327,0.377483,0.518326,0.785699,0.153752,0.599139,0.785699,0.153752,0.599139,0.767327,0.377483,0.518326,\n\t\t\t         0.732597,0.382275,0.563128,0.749016,0.151799,0.644887,0.715781,0.408704,0.566210,0.640889,0.623463,0.447798,\n\t\t\t         0.692007,0.607013,0.390667,0.767327,0.377483,0.518326,0.767327,0.377483,0.518326,0.692007,0.607013,0.390667,\n\t\t\t         0.626881,0.629200,0.459426,0.732597,0.382275,0.563128,0.744346,0.184759,0.641682,0.785699,0.153752,0.599139,\n\t\t\t         0.758171,-0.092288,0.645466,0.734977,-0.060884,0.675344,0.734977,-0.060884,0.675344,0.758171,-0.092288,0.645466,\n\t\t\t         0.667409,-0.370647,0.645863,0.671712,-0.332926,0.661763,0.785699,0.153752,0.599139,0.749016,0.151799,0.644887,\n\t\t\t         0.700552,-0.082125,0.708823,0.758171,-0.092288,0.645466,0.758171,-0.092288,0.645466,0.700552,-0.082125,0.708823,\n\t\t\t         0.571245,-0.380718,0.727103,0.667409,-0.370647,0.645863,0.744346,0.184759,0.641682,0.734977,-0.060884,0.675344,\n\t\t\t         0.726524,-0.060488,0.684439,0.725333,0.202643,0.657857,0.725333,0.202643,0.657857,0.726524,-0.060488,0.684439,\n\t\t\t         0.809931,-0.101596,0.577624,0.806055,0.187567,0.561296,0.734977,-0.060884,0.675344,0.671712,-0.332926,0.661763,\n\t\t\t         0.679586,-0.332804,0.653737,0.726524,-0.060488,0.684439,0.726524,-0.060488,0.684439,0.679586,-0.332804,0.653737,\n\t\t\t         0.757500,-0.363567,0.542192,0.809931,-0.101596,0.577624,0.744346,0.184759,0.641682,0.725333,0.202643,0.657857,\n\t\t\t         0.689322,0.434309,0.579791,0.715781,0.408704,0.566210,0.715781,0.408704,0.566210,0.689322,0.434309,0.579791,\n\t\t\t         0.610584,0.637104,0.470351,0.640889,0.623463,0.447798,0.725333,0.202643,0.657857,0.806055,0.187567,0.561296,\n\t\t\t         0.752983,0.442885,0.486618,0.689322,0.434309,0.579791,0.689322,0.434309,0.579791,0.752983,0.442885,0.486618,\n\t\t\t         0.670858,0.631397,0.388897,0.610584,0.637104,0.470351,0.398694,-0.832698,0.384228,0.547136,-0.590258,0.593463,\n\t\t\t         0.511521,-0.619800,0.595111,0.296396,-0.813196,0.500809,0.296396,-0.813196,0.500809,0.511521,-0.619800,0.595111,\n\t\t\t         0.425733,-0.667196,0.611194,0.257179,-0.807367,0.531022,0.547136,-0.590258,0.593463,0.671712,-0.332926,0.661763,\n\t\t\t         0.667409,-0.370647,0.645863,0.511521,-0.619800,0.595111,0.511521,-0.619800,0.595111,0.667409,-0.370647,0.645863,\n\t\t\t         0.571245,-0.380718,0.727103,0.425733,-0.667196,0.611194,0.398694,-0.832698,0.384228,0.296396,-0.813196,0.500809,\n\t\t\t         0.147465,-0.942961,0.298349,0.109043,-0.990966,0.077670,0.109043,-0.990966,0.077670,0.147465,-0.942961,0.298349,\n\t\t\t         -0.116886,-0.992553,-0.034028,-0.059053,-0.978454,-0.197760,0.296396,-0.813196,0.500809,0.257179,-0.807367,0.531022,\n\t\t\t         0.098422,-0.918058,0.383984,0.147465,-0.942961,0.298349,0.147465,-0.942961,0.298349,0.098422,-0.918058,0.383984,\n\t\t\t         0.147465,-0.983856,0.101321,-0.116886,-0.992553,-0.034028,0.398694,-0.832698,0.384228,0.109043,-0.990966,0.077670,\n\t\t\t         0.158696,-0.986389,-0.042756,0.384503,-0.850093,0.359813,0.384503,-0.850093,0.359813,0.158696,-0.986389,-0.042756,\n\t\t\t         0.044496,-0.998901,0.014649,0.393841,-0.869045,0.299356,0.109043,-0.990966,0.077670,-0.059053,-0.978454,-0.197760,\n\t\t\t         -0.138157,-0.931761,-0.335734,0.158696,-0.986389,-0.042756,0.158696,-0.986389,-0.042756,-0.138157,-0.931761,-0.335734,\n\t\t\t         -0.211982,-0.929350,-0.302194,0.044496,-0.998901,0.014649,0.398694,-0.832698,0.384228,0.384503,-0.850093,0.359813,\n\t\t\t         0.570879,-0.591845,0.568987,0.547136,-0.590258,0.593463,0.547136,-0.590258,0.593463,0.570879,-0.591845,0.568987,\n\t\t\t         0.679586,-0.332804,0.653737,0.671712,-0.332926,0.661763,0.384503,-0.850093,0.359813,0.393841,-0.869045,0.299356,\n\t\t\t         0.645100,-0.602741,0.469588,0.570879,-0.591845,0.568987,0.570879,-0.591845,0.568987,0.645100,-0.602741,0.469588,\n\t\t\t         0.757500,-0.363567,0.542192,0.679586,-0.332804,0.653737,-0.277291,0.488784,-0.827143,-0.233589,0.167486,-0.957793,\n\t\t\t         0.322336,0.146702,-0.935179,0.316843,0.525834,-0.789331,0.316843,0.525834,-0.789331,0.322336,0.146702,-0.935179,\n\t\t\t         0.701621,0.109775,-0.704001,0.666921,0.450453,-0.593524,-0.233589,0.167486,-0.957793,-0.173589,-0.209204,-0.962310,\n\t\t\t         0.377972,-0.182684,-0.907590,0.322336,0.146702,-0.935179,0.322336,0.146702,-0.935179,0.377972,-0.182684,-0.907590,\n\t\t\t         0.824976,-0.246986,-0.508316,0.701621,0.109775,-0.704001,-0.277291,0.488784,-0.827143,0.316843,0.525834,-0.789331,\n\t\t\t         0.082522,0.849208,-0.521500,-0.329630,0.762932,-0.556078,-0.329630,0.762932,-0.556078,0.082522,0.849208,-0.521500,\n\t\t\t         0.061190,0.975738,-0.210089,-0.129856,0.968017,-0.214606,0.316843,0.525834,-0.789331,0.666921,0.450453,-0.593524,\n\t\t\t         0.493698,0.797540,-0.346629,0.082522,0.849208,-0.521500,0.082522,0.849208,-0.521500,0.493698,0.797540,-0.346629,\n\t\t\t         0.339366,0.939543,-0.045137,0.061190,0.975738,-0.210089,-0.277291,0.488784,-0.827143,-0.329630,0.762932,-0.556078,\n\t\t\t         -0.473098,0.663503,-0.579547,-0.552507,0.360393,-0.751549,-0.552507,0.360393,-0.751549,-0.473098,0.663503,-0.579547,\n\t\t\t         -0.586077,0.556200,-0.589190,-0.657918,0.254860,-0.708609,-0.329630,0.762932,-0.556078,-0.129856,0.968017,-0.214606,\n\t\t\t         -0.206641,0.925657,-0.316904,-0.473098,0.663503,-0.579547,-0.473098,0.663503,-0.579547,-0.206641,0.925657,-0.316904,\n\t\t\t         -0.249458,0.924131,-0.289285,-0.586077,0.556200,-0.589190,-0.277291,0.488784,-0.827143,-0.552507,0.360393,-0.751549,\n\t\t\t         -0.479171,0.099796,-0.872005,-0.233589,0.167486,-0.957793,-0.233589,0.167486,-0.957793,-0.479171,0.099796,-0.872005,\n\t\t\t         -0.449385,-0.228248,-0.863674,-0.173589,-0.209204,-0.962310,-0.552507,0.360393,-0.751549,-0.657918,0.254860,-0.708609,\n\t\t\t         -0.614643,0.029725,-0.788232,-0.479171,0.099796,-0.872005,-0.479171,0.099796,-0.872005,-0.614643,0.029725,-0.788232,\n\t\t\t         -0.577776,-0.224281,-0.784753,-0.449385,-0.228248,-0.863674,-0.238319,-0.735496,-0.634175,-0.273507,-0.877194,-0.394604,\n\t\t\t         -0.068758,-0.914426,-0.398816,0.127812,-0.763146,-0.633442,0.127812,-0.763146,-0.633442,-0.068758,-0.914426,-0.398816,\n\t\t\t         0.214301,-0.925504,-0.312235,0.313578,-0.792962,-0.522324,-0.273507,-0.877194,-0.394604,-0.059053,-0.978454,-0.197760,\n\t\t\t         -0.116886,-0.992553,-0.034028,-0.068758,-0.914426,-0.398816,-0.068758,-0.914426,-0.398816,-0.116886,-0.992553,-0.034028,\n\t\t\t         0.147465,-0.983856,0.101321,0.214301,-0.925504,-0.312235,-0.238319,-0.735496,-0.634175,0.127812,-0.763146,-0.633442,\n\t\t\t         0.395367,-0.535173,-0.746483,-0.137730,-0.553728,-0.821192,-0.137730,-0.553728,-0.821192,0.395367,-0.535173,-0.746483,\n\t\t\t         0.377972,-0.182684,-0.907590,-0.173589,-0.209204,-0.962310,0.127812,-0.763146,-0.633442,0.313578,-0.792962,-0.522324,\n\t\t\t         0.541093,-0.601215,-0.588000,0.395367,-0.535173,-0.746483,0.395367,-0.535173,-0.746483,0.541093,-0.601215,-0.588000,\n\t\t\t         0.824976,-0.246986,-0.508316,0.377972,-0.182684,-0.907590,-0.238319,-0.735496,-0.634175,-0.137730,-0.553728,-0.821192,\n\t\t\t         -0.449385,-0.513993,-0.730613,-0.362468,-0.693960,-0.622089,-0.362468,-0.693960,-0.622089,-0.449385,-0.513993,-0.730613,\n\t\t\t         -0.527635,-0.443587,-0.724418,-0.467055,-0.607013,-0.642933,-0.137730,-0.553728,-0.821192,-0.173589,-0.209204,-0.962310,\n\t\t\t         -0.449385,-0.228248,-0.863674,-0.449385,-0.513993,-0.730613,-0.449385,-0.513993,-0.730613,-0.449385,-0.228248,-0.863674,\n\t\t\t         -0.577776,-0.224281,-0.784753,-0.527635,-0.443587,-0.724418,-0.238319,-0.735496,-0.634175,-0.362468,-0.693960,-0.622089,\n\t\t\t         -0.285409,-0.804987,-0.520096,-0.273507,-0.877194,-0.394604,-0.273507,-0.877194,-0.394604,-0.285409,-0.804987,-0.520096,\n\t\t\t         -0.138157,-0.931761,-0.335734,-0.059053,-0.978454,-0.197760,-0.362468,-0.693960,-0.622089,-0.467055,-0.607013,-0.642933,\n\t\t\t         -0.338328,-0.764306,-0.548906,-0.285409,-0.804987,-0.520096,-0.285409,-0.804987,-0.520096,-0.338328,-0.764306,-0.548906,\n\t\t\t         -0.211982,-0.929350,-0.302194,-0.138157,-0.931761,-0.335734,0.512803,-0.803339,0.302652,0.455397,-0.844935,0.280496,\n\t\t\t         0.037507,-0.997253,0.063753,0.123508,-0.990295,0.063631,0.123508,-0.990295,0.063631,0.037507,-0.997253,0.063753,\n\t\t\t         -0.339457,-0.917020,-0.209265,-0.319773,-0.915281,-0.244911,0.455397,-0.844935,0.280496,0.393841,-0.869045,0.299356,\n\t\t\t         0.044496,-0.998901,0.014649,0.037507,-0.997253,0.063753,0.037507,-0.997253,0.063753,0.044496,-0.998901,0.014649,\n\t\t\t         -0.211982,-0.929350,-0.302194,-0.339457,-0.917020,-0.209265,0.512803,-0.803339,0.302652,0.123508,-0.990295,0.063631,\n\t\t\t         0.044374,-0.993194,0.107425,0.384442,-0.795160,0.468917,0.384442,-0.795160,0.468917,0.044374,-0.993194,0.107425,\n\t\t\t         -0.045442,-0.997131,0.060121,0.343425,-0.847011,0.405652,0.123508,-0.990295,0.063631,-0.319773,-0.915281,-0.244911,\n\t\t\t         -0.341075,-0.896939,-0.281289,0.044374,-0.993194,0.107425,0.044374,-0.993194,0.107425,-0.341075,-0.896939,-0.281289,\n\t\t\t         -0.416150,-0.865322,-0.279244,-0.045442,-0.997131,0.060121,0.512803,-0.803339,0.302652,0.384442,-0.795160,0.468917,\n\t\t\t         0.565539,-0.512742,0.645894,0.723380,-0.553758,0.412336,0.723380,-0.553758,0.412336,0.565539,-0.512742,0.645894,\n\t\t\t         0.650075,-0.320505,0.688925,0.807886,-0.382122,0.448622,0.384442,-0.795160,0.468917,0.343425,-0.847011,0.405652,\n\t\t\t         0.567186,-0.561968,0.602008,0.565539,-0.512742,0.645894,0.565539,-0.512742,0.645894,0.567186,-0.561968,0.602008,\n\t\t\t         0.654622,-0.319590,0.685018,0.650075,-0.320505,0.688925,0.512803,-0.803339,0.302652,0.723380,-0.553758,0.412336,\n\t\t\t         0.708029,-0.587603,0.391644,0.455397,-0.844935,0.280496,0.455397,-0.844935,0.280496,0.708029,-0.587603,0.391644,\n\t\t\t         0.645100,-0.602741,0.469588,0.393841,-0.869045,0.299356,0.723380,-0.553758,0.412336,0.807886,-0.382122,0.448622,\n\t\t\t         0.815790,-0.381207,0.434858,0.708029,-0.587603,0.391644,0.708029,-0.587603,0.391644,0.815790,-0.381207,0.434858,\n\t\t\t         0.757500,-0.363567,0.542192,0.645100,-0.602741,0.469588,0.863308,0.096805,0.495285,0.871700,0.149754,0.466567,\n\t\t\t         0.871120,-0.150945,0.467238,0.855159,-0.195441,0.480087,0.855159,-0.195441,0.480087,0.871120,-0.150945,0.467238,\n\t\t\t         0.815790,-0.381207,0.434858,0.807886,-0.382122,0.448622,0.871700,0.149754,0.466567,0.806055,0.187567,0.561296,\n\t\t\t         0.809931,-0.101596,0.577624,0.871120,-0.150945,0.467238,0.871120,-0.150945,0.467238,0.809931,-0.101596,0.577624,\n\t\t\t         0.757500,-0.363567,0.542192,0.815790,-0.381207,0.434858,0.863308,0.096805,0.495285,0.855159,-0.195441,0.480087,\n\t\t\t         0.719901,-0.151341,0.677358,0.762383,0.098209,0.639576,0.762383,0.098209,0.639576,0.719901,-0.151341,0.677358,\n\t\t\t         0.702322,-0.111606,0.703024,0.726188,0.117374,0.677389,0.855159,-0.195441,0.480087,0.807886,-0.382122,0.448622,\n\t\t\t         0.650075,-0.320505,0.688925,0.719901,-0.151341,0.677358,0.719901,-0.151341,0.677358,0.650075,-0.320505,0.688925,\n\t\t\t         0.654622,-0.319590,0.685018,0.702322,-0.111606,0.703024,0.863308,0.096805,0.495285,0.762383,0.098209,0.639576,\n\t\t\t         0.726829,0.382702,0.570269,0.792932,0.404157,0.455947,0.792932,0.404157,0.455947,0.726829,0.382702,0.570269,\n\t\t\t         0.635456,0.600269,0.485641,0.689352,0.613269,0.385540,0.762383,0.098209,0.639576,0.726188,0.117374,0.677389,\n\t\t\t         0.697104,0.370495,0.613758,0.726829,0.382702,0.570269,0.726829,0.382702,0.570269,0.697104,0.370495,0.613758,\n\t\t\t         0.618763,0.585131,0.524125,0.635456,0.600269,0.485641,0.863308,0.096805,0.495285,0.792932,0.404157,0.455947,\n\t\t\t         0.804865,0.432295,0.406507,0.871700,0.149754,0.466567,0.871700,0.149754,0.466567,0.804865,0.432295,0.406507,\n\t\t\t         0.752983,0.442885,0.486618,0.806055,0.187567,0.561296,0.792932,0.404157,0.455947,0.689352,0.613269,0.385540,\n\t\t\t         0.715506,0.618915,0.323985,0.804865,0.432295,0.406507,0.804865,0.432295,0.406507,0.715506,0.618915,0.323985,\n\t\t\t         0.670858,0.631397,0.388897,0.752983,0.442885,0.486618,0.552080,0.813990,0.180548,0.494461,0.845973,0.199469,\n\t\t\t         0.625507,0.736625,0.257027,0.594806,0.759789,0.262459,0.594806,0.759789,0.262459,0.625507,0.736625,0.257027,\n\t\t\t         0.715506,0.618915,0.323985,0.689352,0.613269,0.385540,0.494461,0.845973,0.199469,0.408551,0.886441,0.217444,\n\t\t\t         0.559862,0.771233,0.302805,0.625507,0.736625,0.257027,0.625507,0.736625,0.257027,0.559862,0.771233,0.302805,\n\t\t\t         0.670858,0.631397,0.388897,0.715506,0.618915,0.323985,0.552080,0.813990,0.180548,0.594806,0.759789,0.262459,\n\t\t\t         0.476424,0.820185,0.316630,0.458510,0.853175,0.248665,0.458510,0.853175,0.248665,0.476424,0.820185,0.316630,\n\t\t\t         0.438429,0.821528,0.364422,0.355998,0.889065,0.287698,0.594806,0.759789,0.262459,0.689352,0.613269,0.385540,\n\t\t\t         0.635456,0.600269,0.485641,0.476424,0.820185,0.316630,0.476424,0.820185,0.316630,0.635456,0.600269,0.485641,\n\t\t\t         0.618763,0.585131,0.524125,0.438429,0.821528,0.364422,0.552080,0.813990,0.180548,0.458510,0.853175,0.248665,\n\t\t\t         0.387646,0.915433,0.107883,0.369793,0.928800,0.023377,0.369793,0.928800,0.023377,0.387646,0.915433,0.107883,\n\t\t\t         -0.102969,0.919156,-0.380139,-0.110446,0.912870,-0.393017,0.458510,0.853175,0.248665,0.355998,0.889065,0.287698,\n\t\t\t         0.302805,0.937315,0.172277,0.387646,0.915433,0.107883,0.387646,0.915433,0.107883,0.302805,0.937315,0.172277,\n\t\t\t         -0.123203,0.966948,-0.223182,-0.102969,0.919156,-0.380139,0.552080,0.813990,0.180548,0.369793,0.928800,0.023377,\n\t\t\t         0.227180,0.971404,0.068972,0.494461,0.845973,0.199469,0.494461,0.845973,0.199469,0.227180,0.971404,0.068972,\n\t\t\t         0.166234,0.984069,0.062624,0.408551,0.886441,0.217444,0.369793,0.928800,0.023377,-0.110446,0.912870,-0.393017,\n\t\t\t         -0.248512,0.939726,-0.234779,0.227180,0.971404,0.068972,0.227180,0.971404,0.068972,-0.248512,0.939726,-0.234779,\n\t\t\t         -0.249458,0.924131,-0.289285,0.166234,0.984069,0.062624,-0.669698,0.260933,-0.695242,-0.799341,0.229835,-0.555162,\n\t\t\t         -0.660848,0.567156,-0.491501,-0.502335,0.559801,-0.658956,-0.502335,0.559801,-0.658956,-0.660848,0.567156,-0.491501,\n\t\t\t         -0.248512,0.939726,-0.234779,-0.110446,0.912870,-0.393017,-0.799341,0.229835,-0.555162,-0.657918,0.254860,-0.708609,\n\t\t\t         -0.586077,0.556200,-0.589190,-0.660848,0.567156,-0.491501,-0.660848,0.567156,-0.491501,-0.586077,0.556200,-0.589190,\n\t\t\t         -0.249458,0.924131,-0.289285,-0.248512,0.939726,-0.234779,-0.669698,0.260933,-0.695242,-0.502335,0.559801,-0.658956,\n\t\t\t         -0.466842,0.560503,-0.683981,-0.585925,0.299509,-0.752953,-0.585925,0.299509,-0.752953,-0.466842,0.560503,-0.683981,\n\t\t\t         -0.564318,0.650655,-0.508103,-0.720786,0.353038,-0.596454,-0.502335,0.559801,-0.658956,-0.110446,0.912870,-0.393017,\n\t\t\t         -0.102969,0.919156,-0.380139,-0.466842,0.560503,-0.683981,-0.466842,0.560503,-0.683981,-0.102969,0.919156,-0.380139,\n\t\t\t         -0.123203,0.966948,-0.223182,-0.564318,0.650655,-0.508103,-0.669698,0.260933,-0.695242,-0.585925,0.299509,-0.752953,\n\t\t\t         -0.644490,0.079989,-0.760399,-0.747154,0.026368,-0.664083,-0.747154,0.026368,-0.664083,-0.644490,0.079989,-0.760399,\n\t\t\t         -0.670400,-0.198431,-0.714927,-0.752831,-0.243538,-0.611469,-0.585925,0.299509,-0.752953,-0.720786,0.353038,-0.596454,\n\t\t\t         -0.760460,0.146214,-0.632649,-0.644490,0.079989,-0.760399,-0.644490,0.079989,-0.760399,-0.760460,0.146214,-0.632649,\n\t\t\t         -0.771477,-0.100833,-0.628193,-0.670400,-0.198431,-0.714927,-0.669698,0.260933,-0.695242,-0.747154,0.026368,-0.664083,\n\t\t\t         -0.816706,0.022553,-0.576556,-0.799341,0.229835,-0.555162,-0.799341,0.229835,-0.555162,-0.816706,0.022553,-0.576556,\n\t\t\t         -0.614643,0.029725,-0.788232,-0.657918,0.254860,-0.708609,-0.747154,0.026368,-0.664083,-0.752831,-0.243538,-0.611469,\n\t\t\t         -0.768670,-0.220313,-0.600452,-0.816706,0.022553,-0.576556,-0.816706,0.022553,-0.576556,-0.768670,-0.220313,-0.600452,\n\t\t\t         -0.577776,-0.224281,-0.784753,-0.614643,0.029725,-0.788232,-0.637226,-0.588427,-0.497665,-0.583453,-0.596576,-0.551012,\n\t\t\t         -0.662465,-0.460280,-0.590960,-0.689688,-0.480728,-0.541490,-0.689688,-0.480728,-0.541490,-0.662465,-0.460280,-0.590960,\n\t\t\t         -0.768670,-0.220313,-0.600452,-0.752831,-0.243538,-0.611469,-0.583453,-0.596576,-0.551012,-0.467055,-0.607013,-0.642933,\n\t\t\t         -0.527635,-0.443587,-0.724418,-0.662465,-0.460280,-0.590960,-0.662465,-0.460280,-0.590960,-0.527635,-0.443587,-0.724418,\n\t\t\t         -0.577776,-0.224281,-0.784753,-0.768670,-0.220313,-0.600452,-0.637226,-0.588427,-0.497665,-0.689688,-0.480728,-0.541490,\n\t\t\t         -0.645344,-0.448378,-0.618397,-0.610736,-0.577746,-0.541429,-0.610736,-0.577746,-0.541429,-0.645344,-0.448378,-0.618397,\n\t\t\t         -0.747246,-0.355907,-0.561174,-0.694784,-0.538133,-0.477126,-0.689688,-0.480728,-0.541490,-0.752831,-0.243538,-0.611469,\n\t\t\t         -0.670400,-0.198431,-0.714927,-0.645344,-0.448378,-0.618397,-0.645344,-0.448378,-0.618397,-0.670400,-0.198431,-0.714927,\n\t\t\t         -0.771477,-0.100833,-0.628193,-0.747246,-0.355907,-0.561174,-0.637226,-0.588427,-0.497665,-0.610736,-0.577746,-0.541429,\n\t\t\t         -0.554064,-0.680380,-0.479629,-0.573443,-0.689108,-0.443037,-0.573443,-0.689108,-0.443037,-0.554064,-0.680380,-0.479629,\n\t\t\t         -0.341075,-0.896939,-0.281289,-0.319773,-0.915281,-0.244911,-0.610736,-0.577746,-0.541429,-0.694784,-0.538133,-0.477126,\n\t\t\t         -0.609333,-0.673818,-0.417890,-0.554064,-0.680380,-0.479629,-0.554064,-0.680380,-0.479629,-0.609333,-0.673818,-0.417890,\n\t\t\t         -0.416150,-0.865322,-0.279244,-0.341075,-0.896939,-0.281289,-0.637226,-0.588427,-0.497665,-0.573443,-0.689108,-0.443037,\n\t\t\t         -0.525498,-0.727775,-0.440626,-0.583453,-0.596576,-0.551012,-0.583453,-0.596576,-0.551012,-0.525498,-0.727775,-0.440626,\n\t\t\t         -0.338328,-0.764306,-0.548906,-0.467055,-0.607013,-0.642933,-0.573443,-0.689108,-0.443037,-0.319773,-0.915281,-0.244911,\n\t\t\t         -0.339457,-0.917020,-0.209265,-0.525498,-0.727775,-0.440626,-0.525498,-0.727775,-0.440626,-0.339457,-0.917020,-0.209265,\n\t\t\t         -0.211982,-0.929350,-0.302194,-0.338328,-0.764306,-0.548906,0.330485,0.869808,0.366283,0.189154,0.961791,0.197882,\n\t\t\t         0.149419,0.952300,0.266030,0.271310,0.889584,0.367443,0.271310,0.889584,0.367443,0.149419,0.952300,0.266030,\n\t\t\t         0.302805,0.937315,0.172277,0.355998,0.889065,0.287698,0.189154,0.961791,0.197882,-0.117924,0.979369,-0.163945,\n\t\t\t         -0.158849,0.986419,-0.041597,0.149419,0.952300,0.266030,0.149419,0.952300,0.266030,-0.158849,0.986419,-0.041597,\n\t\t\t         -0.123203,0.966948,-0.223182,0.302805,0.937315,0.172277,0.330485,0.869808,0.366283,0.271310,0.889584,0.367443,\n\t\t\t         0.391675,0.792413,0.467574,0.440657,0.761895,0.474654,0.440657,0.761895,0.474654,0.391675,0.792413,0.467574,\n\t\t\t         0.537858,0.567339,0.623524,0.567034,0.529344,0.631031,0.271310,0.889584,0.367443,0.355998,0.889065,0.287698,\n\t\t\t         0.438429,0.821528,0.364422,0.391675,0.792413,0.467574,0.391675,0.792413,0.467574,0.438429,0.821528,0.364422,\n\t\t\t         0.618763,0.585131,0.524125,0.537858,0.567339,0.623524,0.330485,0.869808,0.366283,0.440657,0.761895,0.474654,\n\t\t\t         0.561876,0.728080,0.392621,0.467391,0.853420,0.230628,0.467391,0.853420,0.230628,0.561876,0.728080,0.392621,\n\t\t\t         0.597003,0.708914,0.375500,0.506455,0.848415,0.153813,0.440657,0.761895,0.474654,0.567034,0.529344,0.631031,\n\t\t\t         0.647908,0.511765,0.564135,0.561876,0.728080,0.392621,0.561876,0.728080,0.392621,0.647908,0.511765,0.564135,\n\t\t\t         0.678640,0.496414,0.541246,0.597003,0.708914,0.375500,0.330485,0.869808,0.366283,0.467391,0.853420,0.230628,\n\t\t\t         0.350627,0.936247,-0.021851,0.189154,0.961791,0.197882,0.189154,0.961791,0.197882,0.350627,0.936247,-0.021851,\n\t\t\t         0.073366,0.908872,-0.410535,-0.117924,0.979369,-0.163945,0.467391,0.853420,0.230628,0.506455,0.848415,0.153813,\n\t\t\t         0.383374,0.912717,-0.141240,0.350627,0.936247,-0.021851,0.350627,0.936247,-0.021851,0.383374,0.912717,-0.141240,\n\t\t\t         0.145573,0.856655,-0.494888,0.073366,0.908872,-0.410535,0.614856,0.103397,0.781793,0.617145,0.284280,0.733665,\n\t\t\t         0.636921,0.335734,0.693960,0.685476,0.111393,0.719474,0.685476,0.111393,0.719474,0.636921,0.335734,0.693960,\n\t\t\t         0.697104,0.370495,0.613758,0.726188,0.117374,0.677389,0.617145,0.284280,0.733665,0.567034,0.529344,0.631031,\n\t\t\t         0.537858,0.567339,0.623524,0.636921,0.335734,0.693960,0.636921,0.335734,0.693960,0.537858,0.567339,0.623524,\n\t\t\t         0.618763,0.585131,0.524125,0.697104,0.370495,0.613758,0.614856,0.103397,0.781793,0.685476,0.111393,0.719474,\n\t\t\t         0.678121,-0.121128,0.724876,0.565905,-0.113529,0.816584,0.565905,-0.113529,0.816584,0.678121,-0.121128,0.724876,\n\t\t\t         0.642720,-0.385723,0.661885,0.454665,-0.403363,0.794061,0.685476,0.111393,0.719474,0.726188,0.117374,0.677389,\n\t\t\t         0.702322,-0.111606,0.703024,0.678121,-0.121128,0.724876,0.678121,-0.121128,0.724876,0.702322,-0.111606,0.703024,\n\t\t\t         0.654622,-0.319590,0.685018,0.642720,-0.385723,0.661885,0.614856,0.103397,0.781793,0.565905,-0.113529,0.816584,\n\t\t\t         0.658895,-0.184118,0.729331,0.663167,0.063021,0.745781,0.663167,0.063021,0.745781,0.658895,-0.184118,0.729331,\n\t\t\t         0.733421,-0.286935,0.616199,0.751183,-0.040620,0.658803,0.565905,-0.113529,0.816584,0.454665,-0.403363,0.794061,\n\t\t\t         0.548387,-0.495926,0.673269,0.658895,-0.184118,0.729331,0.658895,-0.184118,0.729331,0.548387,-0.495926,0.673269,\n\t\t\t         0.635456,-0.540391,0.551469,0.733421,-0.286935,0.616199,0.614856,0.103397,0.781793,0.663167,0.063021,0.745781,\n\t\t\t         0.663625,0.276437,0.695090,0.617145,0.284280,0.733665,0.617145,0.284280,0.733665,0.663625,0.276437,0.695090,\n\t\t\t         0.647908,0.511765,0.564135,0.567034,0.529344,0.631031,0.663167,0.063021,0.745781,0.751183,-0.040620,0.658803,\n\t\t\t         0.732871,0.235267,0.638356,0.663625,0.276437,0.695090,0.663625,0.276437,0.695090,0.732871,0.235267,0.638356,\n\t\t\t         0.678640,0.496414,0.541246,0.647908,0.511765,0.564135,0.244758,-0.879665,0.407727,0.377544,-0.640492,0.668722,\n\t\t\t         0.577899,-0.620228,0.530381,0.362804,-0.865535,0.345164,0.362804,-0.865535,0.345164,0.577899,-0.620228,0.530381,\n\t\t\t         0.567186,-0.561968,0.602008,0.343425,-0.847011,0.405652,0.377544,-0.640492,0.668722,0.454665,-0.403363,0.794061,\n\t\t\t         0.642720,-0.385723,0.661885,0.577899,-0.620228,0.530381,0.577899,-0.620228,0.530381,0.642720,-0.385723,0.661885,\n\t\t\t         0.654622,-0.319590,0.685018,0.567186,-0.561968,0.602008,0.244758,-0.879665,0.407727,0.362804,-0.865535,0.345164,\n\t\t\t         -0.076113,-0.997009,-0.011841,-0.125034,-0.992126,-0.003265,-0.125034,-0.992126,-0.003265,-0.076113,-0.997009,-0.011841,\n\t\t\t         -0.412976,-0.855098,-0.313395,-0.429762,-0.850398,-0.303446,0.362804,-0.865535,0.345164,0.343425,-0.847011,0.405652,\n\t\t\t         -0.045442,-0.997131,0.060121,-0.076113,-0.997009,-0.011841,-0.076113,-0.997009,-0.011841,-0.045442,-0.997131,0.060121,\n\t\t\t         -0.416150,-0.865322,-0.279244,-0.412976,-0.855098,-0.313395,0.244758,-0.879665,0.407727,-0.125034,-0.992126,-0.003265,\n\t\t\t         -0.137059,-0.987548,-0.077029,0.216529,-0.938231,0.269753,0.216529,-0.938231,0.269753,-0.137059,-0.987548,-0.077029,\n\t\t\t         -0.203131,-0.977874,0.049501,0.131169,-0.953795,0.270241,-0.125034,-0.992126,-0.003265,-0.429762,-0.850398,-0.303446,\n\t\t\t         -0.480026,-0.852931,-0.205023,-0.137059,-0.987548,-0.077029,-0.137059,-0.987548,-0.077029,-0.480026,-0.852931,-0.205023,\n\t\t\t         -0.488845,-0.868435,-0.082644,-0.203131,-0.977874,0.049501,0.244758,-0.879665,0.407727,0.216529,-0.938231,0.269753,\n\t\t\t         0.383831,-0.746849,0.543016,0.377544,-0.640492,0.668722,0.377544,-0.640492,0.668722,0.383831,-0.746849,0.543016,\n\t\t\t         0.548387,-0.495926,0.673269,0.454665,-0.403363,0.794061,0.216529,-0.938231,0.269753,0.131169,-0.953795,0.270241,\n\t\t\t         0.416547,-0.785882,0.456954,0.383831,-0.746849,0.543016,0.383831,-0.746849,0.543016,0.416547,-0.785882,0.456954,\n\t\t\t         0.635456,-0.540391,0.551469,0.548387,-0.495926,0.673269,-0.701102,-0.522080,-0.485641,-0.584857,-0.700522,-0.408856,\n\t\t\t         -0.566149,-0.698996,-0.436842,-0.668325,-0.536302,-0.515458,-0.668325,-0.536302,-0.515458,-0.566149,-0.698996,-0.436842,\n\t\t\t         -0.609333,-0.673818,-0.417890,-0.694784,-0.538133,-0.477126,-0.584857,-0.700522,-0.408856,-0.429762,-0.850398,-0.303446,\n\t\t\t         -0.412976,-0.855098,-0.313395,-0.566149,-0.698996,-0.436842,-0.566149,-0.698996,-0.436842,-0.412976,-0.855098,-0.313395,\n\t\t\t         -0.416150,-0.865322,-0.279244,-0.609333,-0.673818,-0.417890,-0.701102,-0.522080,-0.485641,-0.668325,-0.536302,-0.515458,\n\t\t\t         -0.743248,-0.325419,-0.584490,-0.771599,-0.301309,-0.560167,-0.771599,-0.301309,-0.560167,-0.743248,-0.325419,-0.584490,\n\t\t\t         -0.783380,-0.072695,-0.617267,-0.783349,-0.053926,-0.619221,-0.668325,-0.536302,-0.515458,-0.694784,-0.538133,-0.477126,\n\t\t\t         -0.747246,-0.355907,-0.561174,-0.743248,-0.325419,-0.584490,-0.743248,-0.325419,-0.584490,-0.747246,-0.355907,-0.561174,\n\t\t\t         -0.771477,-0.100833,-0.628193,-0.783380,-0.072695,-0.617267,-0.701102,-0.522080,-0.485641,-0.771599,-0.301309,-0.560167,\n\t\t\t         -0.854152,-0.229377,-0.466659,-0.817621,-0.468734,-0.334300,-0.817621,-0.468734,-0.334300,-0.854152,-0.229377,-0.466659,\n\t\t\t         -0.858150,-0.171178,-0.483963,-0.825861,-0.465407,-0.318278,-0.771599,-0.301309,-0.560167,-0.783349,-0.053926,-0.619221,\n\t\t\t         -0.793786,0.014283,-0.607990,-0.854152,-0.229377,-0.466659,-0.854152,-0.229377,-0.466659,-0.793786,0.014283,-0.607990,\n\t\t\t         -0.758873,0.096927,-0.643941,-0.858150,-0.171178,-0.483963,-0.701102,-0.522080,-0.485641,-0.817621,-0.468734,-0.334300,\n\t\t\t         -0.692831,-0.677633,-0.246437,-0.584857,-0.700522,-0.408856,-0.584857,-0.700522,-0.408856,-0.692831,-0.677633,-0.246437,\n\t\t\t         -0.480026,-0.852931,-0.205023,-0.429762,-0.850398,-0.303446,-0.817621,-0.468734,-0.334300,-0.825861,-0.465407,-0.318278,\n\t\t\t         -0.694143,-0.692831,-0.195135,-0.692831,-0.677633,-0.246437,-0.692831,-0.677633,-0.246437,-0.694143,-0.692831,-0.195135,\n\t\t\t         -0.488845,-0.868435,-0.082644,-0.480026,-0.852931,-0.205023,-0.651601,0.395459,-0.647298,-0.740654,0.166967,-0.650777,\n\t\t\t         -0.780847,0.154912,-0.605182,-0.736137,0.378063,-0.561357,-0.736137,0.378063,-0.561357,-0.780847,0.154912,-0.605182,\n\t\t\t         -0.760460,0.146214,-0.632649,-0.720786,0.353038,-0.596454,-0.740654,0.166967,-0.650777,-0.783349,-0.053926,-0.619221,\n\t\t\t         -0.783380,-0.072695,-0.617267,-0.780847,0.154912,-0.605182,-0.780847,0.154912,-0.605182,-0.783380,-0.072695,-0.617267,\n\t\t\t         -0.771477,-0.100833,-0.628193,-0.760460,0.146214,-0.632649,-0.651601,0.395459,-0.647298,-0.736137,0.378063,-0.561357,\n\t\t\t         -0.546648,0.734489,-0.402051,-0.457564,0.731162,-0.505936,-0.457564,0.731162,-0.505936,-0.546648,0.734489,-0.402051,\n\t\t\t         -0.158849,0.986419,-0.041597,-0.117924,0.979369,-0.163945,-0.736137,0.378063,-0.561357,-0.720786,0.353038,-0.596454,\n\t\t\t         -0.564318,0.650655,-0.508103,-0.546648,0.734489,-0.402051,-0.546648,0.734489,-0.402051,-0.564318,0.650655,-0.508103,\n\t\t\t         -0.123203,0.966948,-0.223182,-0.158849,0.986419,-0.041597,-0.651601,0.395459,-0.647298,-0.457564,0.731162,-0.505936,\n\t\t\t         -0.271859,0.666616,-0.694021,-0.506211,0.408948,-0.759239,-0.506211,0.408948,-0.759239,-0.271859,0.666616,-0.694021,\n\t\t\t         -0.165532,0.656362,-0.736045,-0.414624,0.450758,-0.790490,-0.457564,0.731162,-0.505936,-0.117924,0.979369,-0.163945,\n\t\t\t         0.073366,0.908872,-0.410535,-0.271859,0.666616,-0.694021,-0.271859,0.666616,-0.694021,0.073366,0.908872,-0.410535,\n\t\t\t         0.145573,0.856655,-0.494888,-0.165532,0.656362,-0.736045,-0.651601,0.395459,-0.647298,-0.506211,0.408948,-0.759239,\n\t\t\t         -0.667592,0.213569,-0.713187,-0.740654,0.166967,-0.650777,-0.740654,0.166967,-0.650777,-0.667592,0.213569,-0.713187,\n\t\t\t         -0.793786,0.014283,-0.607990,-0.783349,-0.053926,-0.619221,-0.506211,0.408948,-0.759239,-0.414624,0.450758,-0.790490,\n\t\t\t         -0.601886,0.282449,-0.746940,-0.667592,0.213569,-0.713187,-0.667592,0.213569,-0.713187,-0.601886,0.282449,-0.746940,\n\t\t\t         -0.758873,0.096927,-0.643941,-0.793786,0.014283,-0.607990,0.624165,0.769311,-0.136143,0.474807,0.745354,-0.467910,\n\t\t\t         0.429853,0.854579,-0.291299,0.573199,0.818964,0.026185,0.573199,0.818964,0.026185,0.429853,0.854579,-0.291299,\n\t\t\t         0.383374,0.912717,-0.141240,0.506455,0.848415,0.153813,0.474807,0.745354,-0.467910,0.283029,0.656270,-0.699393,\n\t\t\t         0.200598,0.784570,-0.586657,0.429853,0.854579,-0.291299,0.429853,0.854579,-0.291299,0.200598,0.784570,-0.586657,\n\t\t\t         0.145573,0.856655,-0.494888,0.383374,0.912717,-0.141240,0.624165,0.769311,-0.136143,0.573199,0.818964,0.026185,\n\t\t\t         0.675649,0.672079,0.302927,0.729667,0.644032,0.229743,0.729667,0.644032,0.229743,0.675649,0.672079,0.302927,\n\t\t\t         0.757927,0.432142,0.488632,0.777673,0.387677,0.494827,0.573199,0.818964,0.026185,0.506455,0.848415,0.153813,\n\t\t\t         0.597003,0.708914,0.375500,0.675649,0.672079,0.302927,0.675649,0.672079,0.302927,0.597003,0.708914,0.375500,\n\t\t\t         0.678640,0.496414,0.541246,0.757927,0.432142,0.488632,0.624165,0.769311,-0.136143,0.729667,0.644032,0.229743,\n\t\t\t         0.693960,0.690085,0.205359,0.565386,0.785180,-0.252541,0.565386,0.785180,-0.252541,0.693960,0.690085,0.205359,\n\t\t\t         0.756462,0.649770,0.074526,0.541002,0.784845,-0.302133,0.729667,0.644032,0.229743,0.777673,0.387677,0.494827,\n\t\t\t         0.731925,0.380535,0.565142,0.693960,0.690085,0.205359,0.693960,0.690085,0.205359,0.731925,0.380535,0.565142,\n\t\t\t         0.807245,0.372478,0.457747,0.756462,0.649770,0.074526,0.624165,0.769311,-0.136143,0.565386,0.785180,-0.252541,\n\t\t\t         0.413800,0.696066,-0.586688,0.474807,0.745354,-0.467910,0.474807,0.745354,-0.467910,0.413800,0.696066,-0.586688,\n\t\t\t         0.293130,0.588031,-0.753807,0.283029,0.656270,-0.699393,0.565386,0.785180,-0.252541,0.541002,0.784845,-0.302133,\n\t\t\t         0.283456,0.755303,-0.590869,0.413800,0.696066,-0.586688,0.413800,0.696066,-0.586688,0.283456,0.755303,-0.590869,\n\t\t\t         0.177007,0.684255,-0.707389,0.293130,0.588031,-0.753807,0.747429,-0.147893,0.647633,0.780419,0.094119,0.618122,\n\t\t\t         0.802240,0.146641,0.578661,0.790735,-0.125858,0.599048,0.790735,-0.125858,0.599048,0.802240,0.146641,0.578661,\n\t\t\t         0.732871,0.235267,0.638356,0.751183,-0.040620,0.658803,0.780419,0.094119,0.618122,0.777673,0.387677,0.494827,\n\t\t\t         0.757927,0.432142,0.488632,0.802240,0.146641,0.578661,0.802240,0.146641,0.578661,0.757927,0.432142,0.488632,\n\t\t\t         0.678640,0.496414,0.541246,0.732871,0.235267,0.638356,0.747429,-0.147893,0.647633,0.790735,-0.125858,0.599048,\n\t\t\t         0.735618,-0.319895,0.597064,0.699881,-0.299295,0.648488,0.699881,-0.299295,0.648488,0.735618,-0.319895,0.597064,\n\t\t\t         0.615131,-0.488449,0.618885,0.601733,-0.405316,0.688162,0.790735,-0.125858,0.599048,0.751183,-0.040620,0.658803,\n\t\t\t         0.733421,-0.286935,0.616199,0.735618,-0.319895,0.597064,0.735618,-0.319895,0.597064,0.733421,-0.286935,0.616199,\n\t\t\t         0.635456,-0.540391,0.551469,0.615131,-0.488449,0.618885,0.747429,-0.147893,0.647633,0.699881,-0.299295,0.648488,\n\t\t\t         0.660207,-0.291910,0.691977,0.688253,-0.171209,0.704947,0.688253,-0.171209,0.704947,0.660207,-0.291910,0.691977,\n\t\t\t         0.567675,-0.258278,0.781671,0.600360,-0.162572,0.783013,0.699881,-0.299295,0.648488,0.601733,-0.405316,0.688162,\n\t\t\t         0.616901,-0.362438,0.698569,0.660207,-0.291910,0.691977,0.660207,-0.291910,0.691977,0.616901,-0.362438,0.698569,\n\t\t\t         0.549303,-0.339457,0.763543,0.567675,-0.258278,0.781671,0.747429,-0.147893,0.647633,0.688253,-0.171209,0.704947,\n\t\t\t         0.713767,0.044618,0.698935,0.780419,0.094119,0.618122,0.780419,0.094119,0.618122,0.713767,0.044618,0.698935,\n\t\t\t         0.731925,0.380535,0.565142,0.777673,0.387677,0.494827,0.688253,-0.171209,0.704947,0.600360,-0.162572,0.783013,\n\t\t\t         0.684835,0.022645,0.728324,0.713767,0.044618,0.698935,0.713767,0.044618,0.698935,0.684835,0.022645,0.728324,\n\t\t\t         0.807245,0.372478,0.457747,0.731925,0.380535,0.565142,-0.101260,-0.715384,0.691305,0.341807,-0.544481,0.765954,\n\t\t\t         0.355358,-0.685537,0.635395,-0.036470,-0.834895,0.549181,-0.036470,-0.834895,0.549181,0.355358,-0.685537,0.635395,\n\t\t\t         0.416547,-0.785882,0.456954,0.131169,-0.953795,0.270241,0.341807,-0.544481,0.765954,0.601733,-0.405316,0.688162,\n\t\t\t         0.615131,-0.488449,0.618885,0.355358,-0.685537,0.635395,0.355358,-0.685537,0.635395,0.615131,-0.488449,0.618885,\n\t\t\t         0.635456,-0.540391,0.551469,0.416547,-0.785882,0.456954,-0.101260,-0.715384,0.691305,-0.036470,-0.834895,0.549181,\n\t\t\t         -0.385266,-0.855098,0.346904,-0.456496,-0.790033,0.409192,-0.456496,-0.790033,0.409192,-0.385266,-0.855098,0.346904,\n\t\t\t         -0.617664,-0.779565,0.103610,-0.632344,-0.773614,0.040315,-0.036470,-0.834895,0.549181,0.131169,-0.953795,0.270241,\n\t\t\t         -0.203131,-0.977874,0.049501,-0.385266,-0.855098,0.346904,-0.385266,-0.855098,0.346904,-0.203131,-0.977874,0.049501,\n\t\t\t         -0.488845,-0.868435,-0.082644,-0.617664,-0.779565,0.103610,-0.101260,-0.715384,0.691305,-0.456496,-0.790033,0.409192,\n\t\t\t         -0.331156,-0.928892,0.165654,0.002991,-0.849971,0.526780,0.002991,-0.849971,0.526780,-0.331156,-0.928892,0.165654,\n\t\t\t         -0.358531,-0.927824,0.102786,-0.043245,-0.900388,0.432905,-0.456496,-0.790033,0.409192,-0.632344,-0.773614,0.040315,\n\t\t\t         -0.492172,-0.848201,-0.195624,-0.331156,-0.928892,0.165654,-0.331156,-0.928892,0.165654,-0.492172,-0.848201,-0.195624,\n\t\t\t         -0.559923,-0.817927,-0.132054,-0.358531,-0.927824,0.102786,-0.101260,-0.715384,0.691305,0.002991,-0.849971,0.526780,\n\t\t\t         0.420362,-0.558092,0.715384,0.341807,-0.544481,0.765954,0.341807,-0.544481,0.765954,0.420362,-0.558092,0.715384,\n\t\t\t         0.616901,-0.362438,0.698569,0.601733,-0.405316,0.688162,0.002991,-0.849971,0.526780,-0.043245,-0.900388,0.432905,\n\t\t\t         0.377575,-0.599200,0.705924,0.420362,-0.558092,0.715384,0.420362,-0.558092,0.715384,0.377575,-0.599200,0.705924,\n\t\t\t         0.549303,-0.339457,0.763543,0.616901,-0.362438,0.698569,-0.585559,-0.520554,-0.621357,-0.651723,-0.678945,-0.338023,\n\t\t\t         -0.740074,-0.655049,-0.152196,-0.780419,-0.473495,-0.408277,-0.780419,-0.473495,-0.408277,-0.740074,-0.655049,-0.152196,\n\t\t\t         -0.694143,-0.692831,-0.195135,-0.825861,-0.465407,-0.318278,-0.651723,-0.678945,-0.338023,-0.632344,-0.773614,0.040315,\n\t\t\t         -0.617664,-0.779565,0.103610,-0.740074,-0.655049,-0.152196,-0.740074,-0.655049,-0.152196,-0.617664,-0.779565,0.103610,\n\t\t\t         -0.488845,-0.868435,-0.082644,-0.694143,-0.692831,-0.195135,-0.585559,-0.520554,-0.621357,-0.780419,-0.473495,-0.408277,\n\t\t\t         -0.743706,-0.186071,-0.642079,-0.556139,-0.271706,-0.785394,-0.556139,-0.271706,-0.785394,-0.743706,-0.186071,-0.642079,\n\t\t\t         -0.647816,0.096347,-0.755669,-0.530717,0.011597,-0.847438,-0.780419,-0.473495,-0.408277,-0.825861,-0.465407,-0.318278,\n\t\t\t         -0.858150,-0.171178,-0.483963,-0.743706,-0.186071,-0.642079,-0.743706,-0.186071,-0.642079,-0.858150,-0.171178,-0.483963,\n\t\t\t         -0.758873,0.096927,-0.643941,-0.647816,0.096347,-0.755669,-0.585559,-0.520554,-0.621357,-0.556139,-0.271706,-0.785394,\n\t\t\t         -0.582720,-0.319529,-0.747185,-0.553545,-0.513016,-0.656026,-0.553545,-0.513016,-0.656026,-0.582720,-0.319529,-0.747185,\n\t\t\t         -0.768975,-0.205878,-0.605182,-0.806574,-0.390240,-0.443983,-0.556139,-0.271706,-0.785394,-0.530717,0.011597,-0.847438,\n\t\t\t         -0.532243,-0.039735,-0.845637,-0.582720,-0.319529,-0.747185,-0.582720,-0.319529,-0.747185,-0.532243,-0.039735,-0.845637,\n\t\t\t         -0.624592,0.031953,-0.780267,-0.768975,-0.205878,-0.605182,-0.585559,-0.520554,-0.621357,-0.553545,-0.513016,-0.656026,\n\t\t\t         -0.543504,-0.669790,-0.505905,-0.651723,-0.678945,-0.338023,-0.651723,-0.678945,-0.338023,-0.543504,-0.669790,-0.505905,\n\t\t\t         -0.492172,-0.848201,-0.195624,-0.632344,-0.773614,0.040315,-0.553545,-0.513016,-0.656026,-0.806574,-0.390240,-0.443983,\n\t\t\t         -0.737266,-0.599475,-0.311502,-0.543504,-0.669790,-0.505905,-0.543504,-0.669790,-0.505905,-0.737266,-0.599475,-0.311502,\n\t\t\t         -0.559923,-0.817927,-0.132054,-0.492172,-0.848201,-0.195624,-0.199255,0.431440,-0.879849,-0.409131,0.257912,-0.875240,\n\t\t\t         -0.521012,0.303110,-0.797876,-0.334330,0.471023,-0.816279,-0.334330,0.471023,-0.816279,-0.521012,0.303110,-0.797876,\n\t\t\t         -0.601886,0.282449,-0.746940,-0.414624,0.450758,-0.790490,-0.409131,0.257912,-0.875240,-0.530717,0.011597,-0.847438,\n\t\t\t         -0.647816,0.096347,-0.755669,-0.521012,0.303110,-0.797876,-0.521012,0.303110,-0.797876,-0.647816,0.096347,-0.755669,\n\t\t\t         -0.758873,0.096927,-0.643941,-0.601886,0.282449,-0.746940,-0.199255,0.431440,-0.879849,-0.334330,0.471023,-0.816279,\n\t\t\t         -0.084811,0.633137,-0.769372,0.045045,0.551103,-0.833186,0.045045,0.551103,-0.833186,-0.084811,0.633137,-0.769372,\n\t\t\t         0.200598,0.784570,-0.586657,0.283029,0.656270,-0.699393,-0.334330,0.471023,-0.816279,-0.414624,0.450758,-0.790490,\n\t\t\t         -0.165532,0.656362,-0.736045,-0.084811,0.633137,-0.769372,-0.084811,0.633137,-0.769372,-0.165532,0.656362,-0.736045,\n\t\t\t         0.145573,0.856655,-0.494888,0.200598,0.784570,-0.586657,-0.199255,0.431440,-0.879849,0.045045,0.551103,-0.833186,\n\t\t\t         0.131596,0.515152,-0.846889,-0.098025,0.418897,-0.902707,-0.098025,0.418897,-0.902707,0.131596,0.515152,-0.846889,\n\t\t\t         0.067660,0.618458,-0.782891,-0.135929,0.499893,-0.855312,0.045045,0.551103,-0.833186,0.283029,0.656270,-0.699393,\n\t\t\t         0.293130,0.588031,-0.753807,0.131596,0.515152,-0.846889,0.131596,0.515152,-0.846889,0.293130,0.588031,-0.753807,\n\t\t\t         0.177007,0.684255,-0.707389,0.067660,0.618458,-0.782891,-0.199255,0.431440,-0.879849,-0.098025,0.418897,-0.902707,\n\t\t\t         -0.346355,0.237434,-0.907529,-0.409131,0.257912,-0.875240,-0.409131,0.257912,-0.875240,-0.346355,0.237434,-0.907529,\n\t\t\t         -0.532243,-0.039735,-0.845637,-0.530717,0.011597,-0.847438,-0.098025,0.418897,-0.902707,-0.135929,0.499893,-0.855312,\n\t\t\t         -0.388867,0.298349,-0.871609,-0.346355,0.237434,-0.907529,-0.346355,0.237434,-0.907529,-0.388867,0.298349,-0.871609,\n\t\t\t         -0.624592,0.031953,-0.780267,-0.532243,-0.039735,-0.845637,0.630360,0.662374,-0.404767,0.356395,0.686300,-0.633992,\n\t\t\t         0.278024,0.755547,-0.593158,0.589862,0.733848,-0.336863,0.589862,0.733848,-0.336863,0.278024,0.755547,-0.593158,\n\t\t\t         0.283456,0.755303,-0.590869,0.541002,0.784845,-0.302133,0.356395,0.686300,-0.633992,0.187353,0.669973,-0.718345,\n\t\t\t         0.123875,0.724906,-0.677572,0.278024,0.755547,-0.593158,0.278024,0.755547,-0.593158,0.123875,0.724906,-0.677572,\n\t\t\t         0.177007,0.684255,-0.707389,0.283456,0.755303,-0.590869,0.630360,0.662374,-0.404767,0.589862,0.733848,-0.336863,\n\t\t\t         0.798883,0.600543,-0.033509,0.830195,0.548753,-0.097903,0.830195,0.548753,-0.097903,0.798883,0.600543,-0.033509,\n\t\t\t         0.881436,0.344768,0.322733,0.925687,0.271310,0.263497,0.589862,0.733848,-0.336863,0.541002,0.784845,-0.302133,\n\t\t\t         0.756462,0.649770,0.074526,0.798883,0.600543,-0.033509,0.798883,0.600543,-0.033509,0.756462,0.649770,0.074526,\n\t\t\t         0.807245,0.372478,0.457747,0.881436,0.344768,0.322733,0.630360,0.662374,-0.404767,0.830195,0.548753,-0.097903,\n\t\t\t         0.860500,0.486740,-0.150334,0.651082,0.623707,-0.432478,0.651082,0.623707,-0.432478,0.860500,0.486740,-0.150334,\n\t\t\t         0.866482,0.480300,-0.136021,0.676748,0.608600,-0.414228,0.830195,0.548753,-0.097903,0.925687,0.271310,0.263497,\n\t\t\t         0.935667,0.221656,0.274545,0.860500,0.486740,-0.150334,0.860500,0.486740,-0.150334,0.935667,0.221656,0.274545,\n\t\t\t         0.946898,0.220679,0.233711,0.866482,0.480300,-0.136021,0.630360,0.662374,-0.404767,0.651082,0.623707,-0.432478,\n\t\t\t         0.406720,0.678579,-0.611591,0.356395,0.686300,-0.633992,0.356395,0.686300,-0.633992,0.406720,0.678579,-0.611591,\n\t\t\t         0.201788,0.659322,-0.724235,0.187353,0.669973,-0.718345,0.651082,0.623707,-0.432478,0.676748,0.608600,-0.414228,\n\t\t\t         0.449660,0.642811,-0.620106,0.406720,0.678579,-0.611591,0.406720,0.678579,-0.611591,0.449660,0.642811,-0.620106,\n\t\t\t         0.218787,0.606037,-0.764733,0.201788,0.659322,-0.724235,0.686636,-0.237526,0.687063,0.805139,-0.095462,0.585345,\n\t\t\t         0.761101,-0.030915,0.647847,0.629566,-0.210028,0.747978,0.629566,-0.210028,0.747978,0.761101,-0.030915,0.647847,\n\t\t\t         0.684835,0.022645,0.728324,0.600360,-0.162572,0.783013,0.805139,-0.095462,0.585345,0.925687,0.271310,0.263497,\n\t\t\t         0.881436,0.344768,0.322733,0.761101,-0.030915,0.647847,0.761101,-0.030915,0.647847,0.881436,0.344768,0.322733,\n\t\t\t         0.807245,0.372478,0.457747,0.684835,0.022645,0.728324,0.686636,-0.237526,0.687063,0.629566,-0.210028,0.747978,\n\t\t\t         0.554399,-0.297311,0.777306,0.582385,-0.336619,0.739891,0.582385,-0.336619,0.739891,0.554399,-0.297311,0.777306,\n\t\t\t         0.493484,-0.396252,0.774224,0.463607,-0.467513,0.752617,0.629566,-0.210028,0.747978,0.600360,-0.162572,0.783013,\n\t\t\t         0.567675,-0.258278,0.781671,0.554399,-0.297311,0.777306,0.554399,-0.297311,0.777306,0.567675,-0.258278,0.781671,\n\t\t\t         0.549303,-0.339457,0.763543,0.493484,-0.396252,0.774224,0.686636,-0.237526,0.687063,0.582385,-0.336619,0.739891,\n\t\t\t         0.545335,-0.313242,0.777459,0.672567,-0.175298,0.718925,0.672567,-0.175298,0.718925,0.545335,-0.313242,0.777459,\n\t\t\t         0.582842,-0.386517,0.714713,0.726096,-0.222663,0.650502,0.582385,-0.336619,0.739891,0.463607,-0.467513,0.752617,\n\t\t\t         0.374493,-0.490341,0.786950,0.545335,-0.313242,0.777459,0.545335,-0.313242,0.777459,0.374493,-0.490341,0.786950,\n\t\t\t         0.365825,-0.580798,0.727195,0.582842,-0.386517,0.714713,0.686636,-0.237526,0.687063,0.672567,-0.175298,0.718925,\n\t\t\t         0.798700,-0.044374,0.600055,0.805139,-0.095462,0.585345,0.805139,-0.095462,0.585345,0.798700,-0.044374,0.600055,\n\t\t\t         0.935667,0.221656,0.274545,0.925687,0.271310,0.263497,0.672567,-0.175298,0.718925,0.726096,-0.222663,0.650502,\n\t\t\t         0.853084,-0.047426,0.519578,0.798700,-0.044374,0.600055,0.798700,-0.044374,0.600055,0.853084,-0.047426,0.519578,\n\t\t\t         0.946898,0.220679,0.233711,0.935667,0.221656,0.274545,-0.088778,-0.793481,0.602069,0.270119,-0.645283,0.714560,\n\t\t\t         0.287881,-0.613666,0.735191,-0.155248,-0.820276,0.550462,-0.155248,-0.820276,0.550462,0.287881,-0.613666,0.735191,\n\t\t\t         0.377575,-0.599200,0.705924,-0.043245,-0.900388,0.432905,0.270119,-0.645283,0.714560,0.463607,-0.467513,0.752617,\n\t\t\t         0.493484,-0.396252,0.774224,0.287881,-0.613666,0.735191,0.287881,-0.613666,0.735191,0.493484,-0.396252,0.774224,\n\t\t\t         0.549303,-0.339457,0.763543,0.377575,-0.599200,0.705924,-0.088778,-0.793481,0.602069,-0.155248,-0.820276,0.550462,\n\t\t\t         -0.509842,-0.814844,0.275735,-0.487381,-0.785272,0.381756,-0.487381,-0.785272,0.381756,-0.509842,-0.814844,0.275735,\n\t\t\t         -0.678671,-0.730796,0.072970,-0.718284,-0.682455,0.135075,-0.155248,-0.820276,0.550462,-0.043245,-0.900388,0.432905,\n\t\t\t         -0.358531,-0.927824,0.102786,-0.509842,-0.814844,0.275735,-0.509842,-0.814844,0.275735,-0.358531,-0.927824,0.102786,\n\t\t\t         -0.559923,-0.817927,-0.132054,-0.678671,-0.730796,0.072970,-0.088778,-0.793481,0.602069,-0.487381,-0.785272,0.381756,\n\t\t\t         -0.350871,-0.879360,0.321787,-0.029603,-0.819910,0.571703,-0.029603,-0.819910,0.571703,-0.350871,-0.879360,0.321787,\n\t\t\t         -0.290963,-0.936857,0.193884,-0.093142,-0.878231,0.469039,-0.487381,-0.785272,0.381756,-0.718284,-0.682455,0.135075,\n\t\t\t         -0.613392,-0.789514,0.019379,-0.350871,-0.879360,0.321787,-0.350871,-0.879360,0.321787,-0.613392,-0.789514,0.019379,\n\t\t\t         -0.471328,-0.871639,-0.134404,-0.290963,-0.936857,0.193884,-0.088778,-0.793481,0.602069,-0.029603,-0.819910,0.571703,\n\t\t\t         0.191534,-0.666921,0.720054,0.270119,-0.645283,0.714560,0.270119,-0.645283,0.714560,0.191534,-0.666921,0.720054,\n\t\t\t         0.374493,-0.490341,0.786950,0.463607,-0.467513,0.752617,-0.029603,-0.819910,0.571703,-0.093142,-0.878231,0.469039,\n\t\t\t         0.116001,-0.753868,0.646687,0.191534,-0.666921,0.720054,0.191534,-0.666921,0.720054,0.116001,-0.753868,0.646687,\n\t\t\t         0.365825,-0.580798,0.727195,0.374493,-0.490341,0.786950,-0.819208,-0.405316,-0.405683,-0.798700,-0.594928,-0.090121,\n\t\t\t         -0.807825,-0.582720,-0.088473,-0.884915,-0.343028,-0.314920,-0.884915,-0.343028,-0.314920,-0.807825,-0.582720,-0.088473,\n\t\t\t         -0.737266,-0.599475,-0.311502,-0.806574,-0.390240,-0.443983,-0.798700,-0.594928,-0.090121,-0.718284,-0.682455,0.135075,\n\t\t\t         -0.678671,-0.730796,0.072970,-0.807825,-0.582720,-0.088473,-0.807825,-0.582720,-0.088473,-0.678671,-0.730796,0.072970,\n\t\t\t         -0.559923,-0.817927,-0.132054,-0.737266,-0.599475,-0.311502,-0.819208,-0.405316,-0.405683,-0.884915,-0.343028,-0.314920,\n\t\t\t         -0.818964,-0.086398,-0.567278,-0.731834,-0.127079,-0.669485,-0.731834,-0.127079,-0.669485,-0.818964,-0.086398,-0.567278,\n\t\t\t         -0.646413,0.126988,-0.752312,-0.582873,0.113407,-0.804590,-0.884915,-0.343028,-0.314920,-0.806574,-0.390240,-0.443983,\n\t\t\t         -0.768975,-0.205878,-0.605182,-0.818964,-0.086398,-0.567278,-0.818964,-0.086398,-0.567278,-0.768975,-0.205878,-0.605182,\n\t\t\t         -0.624592,0.031953,-0.780267,-0.646413,0.126988,-0.752312,-0.819208,-0.405316,-0.405683,-0.731834,-0.127079,-0.669485,\n\t\t\t         -0.632954,-0.217017,-0.743126,-0.702994,-0.451125,-0.549760,-0.702994,-0.451125,-0.549760,-0.632954,-0.217017,-0.743126,\n\t\t\t         -0.576525,-0.311869,-0.755181,-0.594989,-0.495285,-0.632954,-0.731834,-0.127079,-0.669485,-0.582873,0.113407,-0.804590,\n\t\t\t         -0.539293,0.018372,-0.841914,-0.632954,-0.217017,-0.743126,-0.632954,-0.217017,-0.743126,-0.539293,0.018372,-0.841914,\n\t\t\t         -0.520005,-0.113071,-0.846614,-0.576525,-0.311869,-0.755181,-0.819208,-0.405316,-0.405683,-0.702994,-0.451125,-0.549760,\n\t\t\t         -0.714621,-0.646352,-0.267342,-0.798700,-0.594928,-0.090121,-0.798700,-0.594928,-0.090121,-0.714621,-0.646352,-0.267342,\n\t\t\t         -0.613392,-0.789514,0.019379,-0.718284,-0.682455,0.135075,-0.702994,-0.451125,-0.549760,-0.594989,-0.495285,-0.632954,\n\t\t\t         -0.576342,-0.697287,-0.426099,-0.714621,-0.646352,-0.267342,-0.714621,-0.646352,-0.267342,-0.576342,-0.697287,-0.426099,\n\t\t\t         -0.471328,-0.871639,-0.134404,-0.613392,-0.789514,0.019379,-0.192450,0.484848,-0.853145,-0.390728,0.324656,-0.861324,\n\t\t\t         -0.417127,0.344554,-0.840968,-0.194983,0.529283,-0.825709,-0.194983,0.529283,-0.825709,-0.417127,0.344554,-0.840968,\n\t\t\t         -0.388867,0.298349,-0.871609,-0.135929,0.499893,-0.855312,-0.390728,0.324656,-0.861324,-0.582873,0.113407,-0.804590,\n\t\t\t         -0.646413,0.126988,-0.752312,-0.417127,0.344554,-0.840968,-0.417127,0.344554,-0.840968,-0.646413,0.126988,-0.752312,\n\t\t\t         -0.624592,0.031953,-0.780267,-0.388867,0.298349,-0.871609,-0.192450,0.484848,-0.853145,-0.194983,0.529283,-0.825709,\n\t\t\t         -0.008606,0.661153,-0.750175,0.003723,0.603565,-0.797296,0.003723,0.603565,-0.797296,-0.008606,0.661153,-0.750175,\n\t\t\t         0.123875,0.724906,-0.677572,0.187353,0.669973,-0.718345,-0.194983,0.529283,-0.825709,-0.135929,0.499893,-0.855312,\n\t\t\t         0.067660,0.618458,-0.782891,-0.008606,0.661153,-0.750175,-0.008606,0.661153,-0.750175,0.067660,0.618458,-0.782891,\n\t\t\t         0.177007,0.684255,-0.707389,0.123875,0.724906,-0.677572,-0.192450,0.484848,-0.853145,0.003723,0.603565,-0.797296,\n\t\t\t         0.002564,0.578204,-0.815851,-0.189215,0.451888,-0.871731,-0.189215,0.451888,-0.871731,0.002564,0.578204,-0.815851,\n\t\t\t         0.009186,0.504685,-0.863216,-0.173772,0.353130,-0.919279,0.003723,0.603565,-0.797296,0.187353,0.669973,-0.718345,\n\t\t\t         0.201788,0.659322,-0.724235,0.002564,0.578204,-0.815851,0.002564,0.578204,-0.815851,0.201788,0.659322,-0.724235,\n\t\t\t         0.218787,0.606037,-0.764733,0.009186,0.504685,-0.863216,-0.192450,0.484848,-0.853145,-0.189215,0.451888,-0.871731,\n\t\t\t         -0.380627,0.263283,-0.886441,-0.390728,0.324656,-0.861324,-0.390728,0.324656,-0.861324,-0.380627,0.263283,-0.886441,\n\t\t\t         -0.539293,0.018372,-0.841914,-0.582873,0.113407,-0.804590,-0.189215,0.451888,-0.871731,-0.173772,0.353130,-0.919279,\n\t\t\t         -0.368328,0.136662,-0.919584,-0.380627,0.263283,-0.886441,-0.380627,0.263283,-0.886441,-0.368328,0.136662,-0.919584,\n\t\t\t         -0.520005,-0.113071,-0.846614,-0.539293,0.018372,-0.841914,0.668142,0.521775,-0.530381,0.428236,0.541032,-0.723777,\n\t\t\t         0.429090,0.640156,-0.637196,0.664571,0.607562,-0.434950,0.664571,0.607562,-0.434950,0.429090,0.640156,-0.637196,\n\t\t\t         0.449660,0.642811,-0.620106,0.676748,0.608600,-0.414228,0.428236,0.541032,-0.723777,0.174566,0.477706,-0.860958,\n\t\t\t         0.185003,0.589068,-0.786584,0.429090,0.640156,-0.637196,0.429090,0.640156,-0.637196,0.185003,0.589068,-0.786584,\n\t\t\t         0.218787,0.606037,-0.764733,0.449660,0.642811,-0.620106,0.668142,0.521775,-0.530381,0.664571,0.607562,-0.434950,\n\t\t\t         0.869472,0.468490,-0.156499,0.880856,0.393658,-0.262825,0.880856,0.393658,-0.262825,0.869472,0.468490,-0.156499,\n\t\t\t         0.958831,0.212653,0.188055,0.986511,0.150182,0.064943,0.664571,0.607562,-0.434950,0.676748,0.608600,-0.414228,\n\t\t\t         0.866482,0.480300,-0.136021,0.869472,0.468490,-0.156499,0.869472,0.468490,-0.156499,0.866482,0.480300,-0.136021,\n\t\t\t         0.946898,0.220679,0.233711,0.958831,0.212653,0.188055,0.668142,0.521775,-0.530381,0.880856,0.393658,-0.262825,\n\t\t\t         0.883297,0.368053,-0.290262,0.675375,0.483444,-0.556841,0.675375,0.483444,-0.556841,0.883297,0.368053,-0.290262,\n\t\t\t         0.831355,0.552538,-0.059114,0.642262,0.680929,-0.351787,0.880856,0.393658,-0.262825,0.986511,0.150182,0.064943,\n\t\t\t         0.987793,0.147771,0.049074,0.883297,0.368053,-0.290262,0.883297,0.368053,-0.290262,0.987793,0.147771,0.049074,\n\t\t\t         0.904416,0.319193,0.283029,0.831355,0.552538,-0.059114,0.668142,0.521775,-0.530381,0.675375,0.483444,-0.556841,\n\t\t\t         0.438002,0.514786,-0.736961,0.428236,0.541032,-0.723777,0.428236,0.541032,-0.723777,0.438002,0.514786,-0.736961,\n\t\t\t         0.178228,0.465102,-0.867122,0.174566,0.477706,-0.860958,0.675375,0.483444,-0.556841,0.642262,0.680929,-0.351787,\n\t\t\t         0.408826,0.716849,-0.564745,0.438002,0.514786,-0.736961,0.438002,0.514786,-0.736961,0.408826,0.716849,-0.564745,\n\t\t\t         0.145360,0.671285,-0.726768,0.178228,0.465102,-0.867122,0.791772,-0.308115,0.527360,0.930235,-0.109256,0.350291,\n\t\t\t         0.883297,-0.053926,0.465621,0.753349,-0.249916,0.608264,0.753349,-0.249916,0.608264,0.883297,-0.053926,0.465621,\n\t\t\t         0.853084,-0.047426,0.519578,0.726096,-0.222663,0.650502,0.930235,-0.109256,0.350291,0.986511,0.150182,0.064943,\n\t\t\t         0.958831,0.212653,0.188055,0.883297,-0.053926,0.465621,0.883297,-0.053926,0.465621,0.958831,0.212653,0.188055,\n\t\t\t         0.946898,0.220679,0.233711,0.853084,-0.047426,0.519578,0.791772,-0.308115,0.527360,0.753349,-0.249916,0.608264,\n\t\t\t         0.601886,-0.432752,0.671102,0.617389,-0.506943,0.601520,0.617389,-0.506943,0.601520,0.601886,-0.432752,0.671102,\n\t\t\t         0.369030,-0.641163,0.672811,0.375774,-0.746330,0.549303,0.753349,-0.249916,0.608264,0.726096,-0.222663,0.650502,\n\t\t\t         0.582842,-0.386517,0.714713,0.601886,-0.432752,0.671102,0.601886,-0.432752,0.671102,0.582842,-0.386517,0.714713,\n\t\t\t         0.365825,-0.580798,0.727195,0.369030,-0.641163,0.672811,0.791772,-0.308115,0.527360,0.617389,-0.506943,0.601520,\n\t\t\t         0.601398,-0.460585,0.652791,0.785455,-0.276925,0.553484,0.785455,-0.276925,0.553484,0.601398,-0.460585,0.652791,\n\t\t\t         0.523728,-0.297311,0.798273,0.699301,-0.123295,0.704062,0.617389,-0.506943,0.601520,0.375774,-0.746330,0.549303,\n\t\t\t         0.368206,-0.685415,0.628163,0.601398,-0.460585,0.652791,0.601398,-0.460585,0.652791,0.368206,-0.685415,0.628163,\n\t\t\t         0.291696,-0.478744,0.828059,0.523728,-0.297311,0.798273,0.791772,-0.308115,0.527360,0.785455,-0.276925,0.553484,\n\t\t\t         0.930967,-0.091159,0.353465,0.930235,-0.109256,0.350291,0.930235,-0.109256,0.350291,0.930967,-0.091159,0.353465,\n\t\t\t         0.987793,0.147771,0.049074,0.986511,0.150182,0.064943,0.785455,-0.276925,0.553484,0.699301,-0.123295,0.704062,\n\t\t\t         0.834925,0.070925,0.545762,0.930967,-0.091159,0.353465,0.930967,-0.091159,0.353465,0.834925,0.070925,0.545762,\n\t\t\t         0.904416,0.319193,0.283029,0.987793,0.147771,0.049074,-0.142979,-0.973022,0.180883,0.091464,-0.915555,0.391583,\n\t\t\t         0.066622,-0.811518,0.580462,-0.205023,-0.892850,0.400952,-0.205023,-0.892850,0.400952,0.066622,-0.811518,0.580462,\n\t\t\t         0.116001,-0.753868,0.646687,-0.093142,-0.878231,0.469039,0.091464,-0.915555,0.391583,0.375774,-0.746330,0.549303,\n\t\t\t         0.369030,-0.641163,0.672811,0.066622,-0.811518,0.580462,0.066622,-0.811518,0.580462,0.369030,-0.641163,0.672811,\n\t\t\t         0.365825,-0.580798,0.727195,0.116001,-0.753868,0.646687,-0.142979,-0.973022,0.180883,-0.205023,-0.892850,0.400952,\n\t\t\t         -0.415021,-0.896603,0.154271,-0.293283,-0.953246,-0.072634,-0.293283,-0.953246,-0.072634,-0.415021,-0.896603,0.154271,\n\t\t\t         -0.558428,-0.818110,-0.137089,-0.355968,-0.868404,-0.345164,-0.205023,-0.892850,0.400952,-0.093142,-0.878231,0.469039,\n\t\t\t         -0.290963,-0.936857,0.193884,-0.415021,-0.896603,0.154271,-0.415021,-0.896603,0.154271,-0.290963,-0.936857,0.193884,\n\t\t\t         -0.471328,-0.871639,-0.134404,-0.558428,-0.818110,-0.137089,-0.142979,-0.973022,0.180883,-0.293283,-0.953246,-0.072634,\n\t\t\t         -0.369518,-0.929106,-0.014283,-0.179052,-0.951384,0.250587,-0.179052,-0.951384,0.250587,-0.369518,-0.929106,-0.014283,\n\t\t\t         -0.605731,-0.717826,0.343181,-0.317301,-0.725364,0.610828,-0.293283,-0.953246,-0.072634,-0.355968,-0.868404,-0.345164,\n\t\t\t         -0.460189,-0.835383,-0.300516,-0.369518,-0.929106,-0.014283,-0.369518,-0.929106,-0.014283,-0.460189,-0.835383,-0.300516,\n\t\t\t         -0.781365,-0.623066,0.035066,-0.605731,-0.717826,0.343181,-0.142979,-0.973022,0.180883,-0.179052,-0.951384,0.250587,\n\t\t\t         0.082949,-0.874783,0.477340,0.091464,-0.915555,0.391583,0.091464,-0.915555,0.391583,0.082949,-0.874783,0.477340,\n\t\t\t         0.368206,-0.685415,0.628163,0.375774,-0.746330,0.549303,-0.179052,-0.951384,0.250587,-0.317301,-0.725364,0.610828,\n\t\t\t         -0.000305,-0.639149,0.769066,0.082949,-0.874783,0.477340,0.082949,-0.874783,0.477340,-0.000305,-0.639149,0.769066,\n\t\t\t         0.291696,-0.478744,0.828059,0.368206,-0.685415,0.628163,-0.354808,-0.619770,-0.699973,-0.341014,-0.745170,-0.573077,\n\t\t\t         -0.622028,-0.668691,-0.407300,-0.629597,-0.503342,-0.591784,-0.629597,-0.503342,-0.591784,-0.622028,-0.668691,-0.407300,\n\t\t\t         -0.576342,-0.697287,-0.426099,-0.594989,-0.495285,-0.632954,-0.341014,-0.745170,-0.573077,-0.355968,-0.868404,-0.345164,\n\t\t\t         -0.558428,-0.818110,-0.137089,-0.622028,-0.668691,-0.407300,-0.622028,-0.668691,-0.407300,-0.558428,-0.818110,-0.137089,\n\t\t\t         -0.471328,-0.871639,-0.134404,-0.576342,-0.697287,-0.426099,-0.354808,-0.619770,-0.699973,-0.629597,-0.503342,-0.591784,\n\t\t\t         -0.621845,-0.351146,-0.699942,-0.432112,-0.486129,-0.759545,-0.432112,-0.486129,-0.759545,-0.621845,-0.351146,-0.699942,\n\t\t\t         -0.573992,-0.171850,-0.800592,-0.452986,-0.318247,-0.832759,-0.629597,-0.503342,-0.591784,-0.594989,-0.495285,-0.632954,\n\t\t\t         -0.576525,-0.311869,-0.755181,-0.621845,-0.351146,-0.699942,-0.621845,-0.351146,-0.699942,-0.576525,-0.311869,-0.755181,\n\t\t\t         -0.520005,-0.113071,-0.846614,-0.573992,-0.171850,-0.800592,-0.354808,-0.619770,-0.699973,-0.432112,-0.486129,-0.759545,\n\t\t\t         -0.486068,-0.494888,-0.720267,-0.441054,-0.617237,-0.651479,-0.441054,-0.617237,-0.651479,-0.486068,-0.494888,-0.720267,\n\t\t\t         -0.840205,-0.249031,-0.481674,-0.848506,-0.380108,-0.368145,-0.432112,-0.486129,-0.759545,-0.452986,-0.318247,-0.832759,\n\t\t\t         -0.513108,-0.324870,-0.794427,-0.486068,-0.494888,-0.720267,-0.486068,-0.494888,-0.720267,-0.513108,-0.324870,-0.794427,\n\t\t\t         -0.770928,-0.060732,-0.633992,-0.840205,-0.249031,-0.481674,-0.354808,-0.619770,-0.699973,-0.441054,-0.617237,-0.651479,\n\t\t\t         -0.454146,-0.720695,-0.523728,-0.341014,-0.745170,-0.573077,-0.341014,-0.745170,-0.573077,-0.454146,-0.720695,-0.523728,\n\t\t\t         -0.460189,-0.835383,-0.300516,-0.355968,-0.868404,-0.345164,-0.441054,-0.617237,-0.651479,-0.848506,-0.380108,-0.368145,\n\t\t\t         -0.840175,-0.497726,-0.215186,-0.454146,-0.720695,-0.523728,-0.454146,-0.720695,-0.523728,-0.840175,-0.497726,-0.215186,\n\t\t\t         -0.781365,-0.623066,0.035066,-0.460189,-0.835383,-0.300516,-0.217811,0.148686,-0.964568,-0.362316,-0.086459,-0.928007,\n\t\t\t         -0.427961,0.072787,-0.900845,-0.237495,0.300943,-0.923582,-0.237495,0.300943,-0.923582,-0.427961,0.072787,-0.900845,\n\t\t\t         -0.368328,0.136662,-0.919584,-0.173772,0.353130,-0.919279,-0.362316,-0.086459,-0.928007,-0.452986,-0.318247,-0.832759,\n\t\t\t         -0.573992,-0.171850,-0.800592,-0.427961,0.072787,-0.900845,-0.427961,0.072787,-0.900845,-0.573992,-0.171850,-0.800592,\n\t\t\t         -0.520005,-0.113071,-0.846614,-0.368328,0.136662,-0.919584,-0.217811,0.148686,-0.964568,-0.237495,0.300943,-0.923582,\n\t\t\t         -0.048921,0.468215,-0.882229,-0.056795,0.338633,-0.939177,-0.056795,0.338633,-0.939177,-0.048921,0.468215,-0.882229,\n\t\t\t         0.185003,0.589068,-0.786584,0.174566,0.477706,-0.860958,-0.237495,0.300943,-0.923582,-0.173772,0.353130,-0.919279,\n\t\t\t         0.009186,0.504685,-0.863216,-0.048921,0.468215,-0.882229,-0.048921,0.468215,-0.882229,0.009186,0.504685,-0.863216,\n\t\t\t         0.218787,0.606037,-0.764733,0.185003,0.589068,-0.786584,-0.217811,0.148686,-0.964568,-0.056795,0.338633,-0.939177,\n\t\t\t         -0.067232,0.340037,-0.937986,-0.254738,0.158422,-0.953917,-0.254738,0.158422,-0.953917,-0.067232,0.340037,-0.937986,\n\t\t\t         -0.124668,0.551317,-0.824885,-0.362011,0.395489,-0.844081,-0.056795,0.338633,-0.939177,0.174566,0.477706,-0.860958,\n\t\t\t         0.178228,0.465102,-0.867122,-0.067232,0.340037,-0.937986,-0.067232,0.340037,-0.937986,0.178228,0.465102,-0.867122,\n\t\t\t         0.145360,0.671285,-0.726768,-0.124668,0.551317,-0.824885,-0.217811,0.148686,-0.964568,-0.254738,0.158422,-0.953917,\n\t\t\t         -0.420911,-0.091006,-0.902493,-0.362316,-0.086459,-0.928007,-0.362316,-0.086459,-0.928007,-0.420911,-0.091006,-0.902493,\n\t\t\t         -0.513108,-0.324870,-0.794427,-0.452986,-0.318247,-0.832759,-0.254738,0.158422,-0.953917,-0.362011,0.395489,-0.844081,\n\t\t\t         -0.592120,0.185339,-0.784234,-0.420911,-0.091006,-0.902493,-0.420911,-0.091006,-0.902493,-0.592120,0.185339,-0.784234,\n\t\t\t         -0.770928,-0.060732,-0.633992,-0.513108,-0.324870,-0.794427,0.651570,0.733207,-0.194494,0.436415,0.792901,-0.425214,\n\t\t\t         0.410230,0.780572,-0.471541,0.628346,0.740196,-0.239265,0.628346,0.740196,-0.239265,0.410230,0.780572,-0.471541,\n\t\t\t         0.408826,0.716849,-0.564745,0.642262,0.680929,-0.351787,0.436415,0.792901,-0.425214,0.174596,0.770409,-0.613147,\n\t\t\t         0.154454,0.733390,-0.662008,0.410230,0.780572,-0.471541,0.410230,0.780572,-0.471541,0.154454,0.733390,-0.662008,\n\t\t\t         0.145360,0.671285,-0.726768,0.408826,0.716849,-0.564745,0.651570,0.733207,-0.194494,0.628346,0.740196,-0.239265,\n\t\t\t         0.796319,0.602802,0.049562,0.807550,0.583483,0.085940,0.807550,0.583483,0.085940,0.796319,0.602802,0.049562,\n\t\t\t         0.857112,0.363598,0.364818,0.857295,0.340861,0.385723,0.628346,0.740196,-0.239265,0.642262,0.680929,-0.351787,\n\t\t\t         0.831355,0.552538,-0.059114,0.796319,0.602802,0.049562,0.796319,0.602802,0.049562,0.831355,0.552538,-0.059114,\n\t\t\t         0.904416,0.319193,0.283029,0.857112,0.363598,0.364818,0.651570,0.733207,-0.194494,0.807550,0.583483,0.085940,\n\t\t\t         0.828639,0.552293,0.091006,0.680898,0.708731,-0.184423,0.680898,0.708731,-0.184423,0.828639,0.552293,0.091006,\n\t\t\t         0.862758,0.501236,0.066073,0.719230,0.662221,-0.210059,0.807550,0.583483,0.085940,0.857295,0.340861,0.385723,\n\t\t\t         0.871426,0.307871,0.381817,0.828639,0.552293,0.091006,0.828639,0.552293,0.091006,0.871426,0.307871,0.381817,\n\t\t\t         0.900266,0.255928,0.352092,0.862758,0.501236,0.066073,0.651570,0.733207,-0.194494,0.680898,0.708731,-0.184423,\n\t\t\t         0.469283,0.777154,-0.419233,0.436415,0.792901,-0.425214,0.436415,0.792901,-0.425214,0.469283,0.777154,-0.419233,\n\t\t\t         0.206214,0.760430,-0.615772,0.174596,0.770409,-0.613147,0.680898,0.708731,-0.184423,0.719230,0.662221,-0.210059,\n\t\t\t         0.506333,0.733116,-0.454024,0.469283,0.777154,-0.419233,0.469283,0.777154,-0.419233,0.506333,0.733116,-0.454024,\n\t\t\t         0.234901,0.710593,-0.663198,0.206214,0.760430,-0.615772,0.684133,-0.105411,0.721671,0.793115,0.087985,0.602649,\n\t\t\t         0.797388,0.106876,0.593890,0.684866,-0.098605,0.721946,0.684866,-0.098605,0.721946,0.797388,0.106876,0.593890,\n\t\t\t         0.834925,0.070925,0.545762,0.699301,-0.123295,0.704062,0.793115,0.087985,0.602649,0.857295,0.340861,0.385723,\n\t\t\t         0.857112,0.363598,0.364818,0.797388,0.106876,0.593890,0.797388,0.106876,0.593890,0.857112,0.363598,0.364818,\n\t\t\t         0.904416,0.319193,0.283029,0.834925,0.070925,0.545762,0.684133,-0.105411,0.721671,0.684866,-0.098605,0.721946,\n\t\t\t         0.527238,-0.277840,0.802972,0.539293,-0.269387,0.797845,0.539293,-0.269387,0.797845,0.527238,-0.277840,0.802972,\n\t\t\t         0.300974,-0.451521,0.839930,0.325846,-0.434889,0.839442,0.684866,-0.098605,0.721946,0.699301,-0.123295,0.704062,\n\t\t\t         0.523728,-0.297311,0.798273,0.527238,-0.277840,0.802972,0.527238,-0.277840,0.802972,0.523728,-0.297311,0.798273,\n\t\t\t         0.291696,-0.478744,0.828059,0.300974,-0.451521,0.839930,0.684133,-0.105411,0.721671,0.539293,-0.269387,0.797845,\n\t\t\t         0.556688,-0.273415,0.784417,0.693716,-0.121830,0.709830,0.693716,-0.121830,0.709830,0.556688,-0.273415,0.784417,\n\t\t\t         0.588916,-0.310892,0.745964,0.720878,-0.163884,0.673360,0.539293,-0.269387,0.797845,0.325846,-0.434889,0.839442,\n\t\t\t         0.353404,-0.433729,0.828822,0.556688,-0.273415,0.784417,0.556688,-0.273415,0.784417,0.353404,-0.433729,0.828822,\n\t\t\t         0.392895,-0.470260,0.790216,0.588916,-0.310892,0.745964,0.684133,-0.105411,0.721671,0.693716,-0.121830,0.709830,\n\t\t\t         0.802667,0.059877,0.593371,0.793115,0.087985,0.602649,0.793115,0.087985,0.602649,0.802667,0.059877,0.593371,\n\t\t\t         0.871426,0.307871,0.381817,0.857295,0.340861,0.385723,0.693716,-0.121830,0.709830,0.720878,-0.163884,0.673360,\n\t\t\t         0.828669,0.012177,0.559557,0.802667,0.059877,0.593371,0.802667,0.059877,0.593371,0.828669,0.012177,0.559557,\n\t\t\t         0.900266,0.255928,0.352092,0.871426,0.307871,0.381817,-0.301523,-0.707205,0.639454,0.034577,-0.594195,0.803552,\n\t\t\t         0.011689,-0.606586,0.794885,-0.308939,-0.714438,0.627766,-0.308939,-0.714438,0.627766,0.011689,-0.606586,0.794885,\n\t\t\t         -0.000305,-0.639149,0.769066,-0.317301,-0.725364,0.610828,0.034577,-0.594195,0.803552,0.325846,-0.434889,0.839442,\n\t\t\t         0.300974,-0.451521,0.839930,0.011689,-0.606586,0.794885,0.011689,-0.606586,0.794885,0.300974,-0.451521,0.839930,\n\t\t\t         0.291696,-0.478744,0.828059,-0.000305,-0.639149,0.769066,-0.301523,-0.707205,0.639454,-0.308939,-0.714438,0.627766,\n\t\t\t         -0.599200,-0.727531,0.334056,-0.600421,-0.715476,0.357097,-0.600421,-0.715476,0.357097,-0.599200,-0.727531,0.334056,\n\t\t\t         -0.772607,-0.634571,0.019837,-0.784112,-0.618061,0.056001,-0.308939,-0.714438,0.627766,-0.317301,-0.725364,0.610828,\n\t\t\t         -0.605731,-0.717826,0.343181,-0.599200,-0.727531,0.334056,-0.599200,-0.727531,0.334056,-0.605731,-0.717826,0.343181,\n\t\t\t         -0.781365,-0.623066,0.035066,-0.772607,-0.634571,0.019837,-0.301523,-0.707205,0.639454,-0.600421,-0.715476,0.357097,\n\t\t\t         -0.594226,-0.707327,0.382824,-0.285623,-0.705954,0.648061,-0.285623,-0.705954,0.648061,-0.594226,-0.707327,0.382824,\n\t\t\t         -0.558031,-0.750664,0.353679,-0.244087,-0.747673,0.617542,-0.600421,-0.715476,0.357097,-0.784112,-0.618061,0.056001,\n\t\t\t         -0.787225,-0.610920,0.083712,-0.594226,-0.707327,0.382824,-0.594226,-0.707327,0.382824,-0.787225,-0.610920,0.083712,\n\t\t\t         -0.756798,-0.651570,0.051729,-0.558031,-0.750664,0.353679,-0.301523,-0.707205,0.639454,-0.285623,-0.705954,0.648061,\n\t\t\t         0.060762,-0.596362,0.800378,0.034577,-0.594195,0.803552,0.034577,-0.594195,0.803552,0.060762,-0.596362,0.800378,\n\t\t\t         0.353404,-0.433729,0.828822,0.325846,-0.434889,0.839442,-0.285623,-0.705954,0.648061,-0.244087,-0.747673,0.617542,\n\t\t\t         0.102969,-0.635731,0.764977,0.060762,-0.596362,0.800378,0.060762,-0.596362,0.800378,0.102969,-0.635731,0.764977,\n\t\t\t         0.392895,-0.470260,0.790216,0.353404,-0.433729,0.828822,-0.870510,-0.359630,-0.335887,-0.856502,-0.487320,-0.169866,\n\t\t\t         -0.840510,-0.500717,-0.206854,-0.858608,-0.372997,-0.351573,-0.858608,-0.372997,-0.351573,-0.840510,-0.500717,-0.206854,\n\t\t\t         -0.840175,-0.497726,-0.215186,-0.848506,-0.380108,-0.368145,-0.856502,-0.487320,-0.169866,-0.784112,-0.618061,0.056001,\n\t\t\t         -0.772607,-0.634571,0.019837,-0.840510,-0.500717,-0.206854,-0.840510,-0.500717,-0.206854,-0.772607,-0.634571,0.019837,\n\t\t\t         -0.781365,-0.623066,0.035066,-0.840175,-0.497726,-0.215186,-0.870510,-0.359630,-0.335887,-0.858608,-0.372997,-0.351573,\n\t\t\t         -0.838069,-0.230293,-0.494552,-0.842250,-0.199622,-0.500748,-0.842250,-0.199622,-0.500748,-0.838069,-0.230293,-0.494552,\n\t\t\t         -0.740257,-0.020539,-0.671987,-0.746147,0.035188,-0.664815,-0.858608,-0.372997,-0.351573,-0.848506,-0.380108,-0.368145,\n\t\t\t         -0.840205,-0.249031,-0.481674,-0.838069,-0.230293,-0.494552,-0.838069,-0.230293,-0.494552,-0.840205,-0.249031,-0.481674,\n\t\t\t         -0.770928,-0.060732,-0.633992,-0.740257,-0.020539,-0.671987,-0.870510,-0.359630,-0.335887,-0.842250,-0.199622,-0.500748,\n\t\t\t         -0.843318,-0.201941,-0.498001,-0.868831,-0.359233,-0.340617,-0.868831,-0.359233,-0.340617,-0.843318,-0.201941,-0.498001,\n\t\t\t         -0.818812,-0.252846,-0.515366,-0.843226,-0.390484,-0.369427,-0.842250,-0.199622,-0.500748,-0.746147,0.035188,-0.664815,\n\t\t\t         -0.760460,0.023682,-0.648915,-0.843318,-0.201941,-0.498001,-0.843318,-0.201941,-0.498001,-0.760460,0.023682,-0.648915,\n\t\t\t         -0.728904,-0.054689,-0.682394,-0.818812,-0.252846,-0.515366,-0.870510,-0.359630,-0.335887,-0.868831,-0.359233,-0.340617,\n\t\t\t         -0.860408,-0.484024,-0.159398,-0.856502,-0.487320,-0.169866,-0.856502,-0.487320,-0.169866,-0.860408,-0.484024,-0.159398,\n\t\t\t         -0.787225,-0.610920,0.083712,-0.784112,-0.618061,0.056001,-0.868831,-0.359233,-0.340617,-0.843226,-0.390484,-0.369427,\n\t\t\t         -0.833064,-0.518204,-0.193487,-0.860408,-0.484024,-0.159398,-0.860408,-0.484024,-0.159398,-0.833064,-0.518204,-0.193487,\n\t\t\t         -0.756798,-0.651570,0.051729,-0.787225,-0.610920,0.083712,-0.358379,0.507950,-0.783258,-0.575121,0.295083,-0.762963,\n\t\t\t         -0.552904,0.224921,-0.802271,-0.343120,0.432508,-0.833735,-0.343120,0.432508,-0.833735,-0.552904,0.224921,-0.802271,\n\t\t\t         -0.592120,0.185339,-0.784234,-0.362011,0.395489,-0.844081,-0.575121,0.295083,-0.762963,-0.746147,0.035188,-0.664815,\n\t\t\t         -0.740257,-0.020539,-0.671987,-0.552904,0.224921,-0.802271,-0.552904,0.224921,-0.802271,-0.740257,-0.020539,-0.671987,\n\t\t\t         -0.770928,-0.060732,-0.633992,-0.592120,0.185339,-0.784234,-0.358379,0.507950,-0.783258,-0.343120,0.432508,-0.833735,\n\t\t\t         -0.111698,0.605335,-0.788079,-0.105045,0.667837,-0.736839,-0.105045,0.667837,-0.736839,-0.111698,0.605335,-0.788079,\n\t\t\t         0.154454,0.733390,-0.662008,0.174596,0.770409,-0.613147,-0.343120,0.432508,-0.833735,-0.362011,0.395489,-0.844081,\n\t\t\t         -0.124668,0.551317,-0.824885,-0.111698,0.605335,-0.788079,-0.111698,0.605335,-0.788079,-0.124668,0.551317,-0.824885,\n\t\t\t         0.145360,0.671285,-0.726768,0.154454,0.733390,-0.662008,-0.358379,0.507950,-0.783258,-0.105045,0.667837,-0.736839,\n\t\t\t         -0.075838,0.659413,-0.747917,-0.338145,0.498367,-0.798273,-0.338145,0.498367,-0.798273,-0.075838,0.659413,-0.747917,\n\t\t\t         -0.052126,0.594714,-0.802210,-0.306742,0.416883,-0.855617,-0.105045,0.667837,-0.736839,0.174596,0.770409,-0.613147,\n\t\t\t         0.206214,0.760430,-0.615772,-0.075838,0.659413,-0.747917,-0.075838,0.659413,-0.747917,0.206214,0.760430,-0.615772,\n\t\t\t         0.234901,0.710593,-0.663198,-0.052126,0.594714,-0.802210,-0.358379,0.507950,-0.783258,-0.338145,0.498367,-0.798273,\n\t\t\t         -0.579638,0.281838,-0.764550,-0.575121,0.295083,-0.762963,-0.575121,0.295083,-0.762963,-0.579638,0.281838,-0.764550,\n\t\t\t         -0.760460,0.023682,-0.648915,-0.746147,0.035188,-0.664815,-0.338145,0.498367,-0.798273,-0.306742,0.416883,-0.855617,\n\t\t\t         -0.537187,0.195288,-0.820521,-0.579638,0.281838,-0.764550,-0.579638,0.281838,-0.764550,-0.537187,0.195288,-0.820521,\n\t\t\t         -0.728904,-0.054689,-0.682394,-0.760460,0.023682,-0.648915,0.824641,-0.106296,-0.555528,0.665242,-0.035981,-0.745720,\n\t\t\t         0.568834,0.622333,-0.537675,0.787896,0.543992,-0.288522,0.787896,0.543992,-0.288522,0.568834,0.622333,-0.537675,\n\t\t\t         0.506333,0.733116,-0.454024,0.719230,0.662221,-0.210059,0.665242,-0.035981,-0.745720,0.430708,-0.056612,-0.900693,\n\t\t\t         0.282266,0.597003,-0.750908,0.568834,0.622333,-0.537675,0.568834,0.622333,-0.537675,0.282266,0.597003,-0.750908,\n\t\t\t         0.234901,0.710593,-0.663198,0.506333,0.733116,-0.454024,0.824641,-0.106296,-0.555528,0.787896,0.543992,-0.288522,\n\t\t\t         0.927213,0.374218,-0.013520,0.901517,-0.240547,-0.359630,0.901517,-0.240547,-0.359630,0.927213,0.374218,-0.013520,\n\t\t\t         0.955870,0.129307,0.263771,0.891934,-0.412152,-0.185827,0.787896,0.543992,-0.288522,0.719230,0.662221,-0.210059,\n\t\t\t         0.862758,0.501236,0.066073,0.927213,0.374218,-0.013520,0.927213,0.374218,-0.013520,0.862758,0.501236,0.066073,\n\t\t\t         0.900266,0.255928,0.352092,0.955870,0.129307,0.263771,0.824641,-0.106296,-0.555528,0.901517,-0.240547,-0.359630,\n\t\t\t         0.473861,-0.713034,-0.516709,0.496414,-0.667074,-0.555437,0.496414,-0.667074,-0.555437,0.473861,-0.713034,-0.516709,\n\t\t\t         0.513131,-0.697482,-0.500215,0.530130,-0.641155,-0.554871,0.901517,-0.240547,-0.359630,0.891934,-0.412152,-0.185827,\n\t\t\t         0.422651,-0.740593,-0.522324,0.473861,-0.713034,-0.516709,0.473861,-0.713034,-0.516709,0.422651,-0.740593,-0.522324,\n\t\t\t         0.459063,-0.737432,-0.495434,0.513131,-0.697482,-0.500215,0.824641,-0.106296,-0.555528,0.496414,-0.667074,-0.555437,\n\t\t\t         0.466018,-0.632771,-0.618366,0.665242,-0.035981,-0.745720,0.665242,-0.035981,-0.745720,0.466018,-0.632771,-0.618366,\n\t\t\t         0.379498,-0.639485,-0.668569,0.430708,-0.056612,-0.900693,0.496414,-0.667074,-0.555437,0.530130,-0.641155,-0.554871,\n\t\t\t         0.486957,-0.598317,-0.636309,0.466018,-0.632771,-0.618366,0.466018,-0.632771,-0.618366,0.486957,-0.598317,-0.636309,\n\t\t\t         0.377135,-0.598421,-0.706867,0.379498,-0.639485,-0.668569,0.726493,-0.682607,-0.078677,0.811212,-0.576006,-0.100528,\n\t\t\t         0.880612,-0.108066,0.461318,0.775567,-0.280435,0.565508,0.775567,-0.280435,0.565508,0.880612,-0.108066,0.461318,\n\t\t\t         0.828669,0.012177,0.559557,0.720878,-0.163884,0.673360,0.811212,-0.576006,-0.100528,0.891934,-0.412152,-0.185827,\n\t\t\t         0.955870,0.129307,0.263771,0.880612,-0.108066,0.461318,0.880612,-0.108066,0.461318,0.955870,0.129307,0.263771,\n\t\t\t         0.900266,0.255928,0.352092,0.828669,0.012177,0.559557,0.726493,-0.682607,-0.078677,0.775567,-0.280435,0.565508,\n\t\t\t         0.650288,-0.425977,0.628986,0.642476,-0.762535,-0.075686,0.642476,-0.762535,-0.075686,0.650288,-0.425977,0.628986,\n\t\t\t         0.464278,-0.584918,0.665029,0.535508,-0.841334,-0.073244,0.775567,-0.280435,0.565508,0.720878,-0.163884,0.673360,\n\t\t\t         0.588916,-0.310892,0.745964,0.650288,-0.425977,0.628986,0.650288,-0.425977,0.628986,0.588916,-0.310892,0.745964,\n\t\t\t         0.392895,-0.470260,0.790216,0.464278,-0.584918,0.665029,0.726493,-0.682607,-0.078677,0.642476,-0.762535,-0.075686,\n\t\t\t         0.288675,-0.681875,-0.672079,0.320444,-0.719291,-0.616352,0.320444,-0.719291,-0.616352,0.288675,-0.681875,-0.672079,\n\t\t\t         0.304096,-0.702024,-0.643963,0.341716,-0.732789,-0.588431,0.642476,-0.762535,-0.075686,0.535508,-0.841334,-0.073244,\n\t\t\t         0.285989,-0.632252,-0.720023,0.288675,-0.681875,-0.672079,0.288675,-0.681875,-0.672079,0.285989,-0.632252,-0.720023,\n\t\t\t         0.292303,-0.659972,-0.692095,0.304096,-0.702024,-0.643963,0.726493,-0.682607,-0.078677,0.320444,-0.719291,-0.616352,\n\t\t\t         0.368175,-0.740562,-0.562120,0.811212,-0.576006,-0.100528,0.811212,-0.576006,-0.100528,0.368175,-0.740562,-0.562120,\n\t\t\t         0.422651,-0.740593,-0.522324,0.891934,-0.412152,-0.185827,0.320444,-0.719291,-0.616352,0.341716,-0.732789,-0.588431,\n\t\t\t         0.395804,-0.747279,-0.533773,0.368175,-0.740562,-0.562120,0.368175,-0.740562,-0.562120,0.395804,-0.747279,-0.533773,\n\t\t\t         0.459063,-0.737432,-0.495434,0.422651,-0.740593,-0.522324,0.198645,-0.962737,-0.183386,0.379803,-0.919828,-0.098209,\n\t\t\t         0.183721,-0.750603,0.634663,-0.151769,-0.860866,0.485611,-0.151769,-0.860866,0.485611,0.183721,-0.750603,0.634663,\n\t\t\t         0.102969,-0.635731,0.764977,-0.244087,-0.747673,0.617542,0.379803,-0.919828,-0.098209,0.535508,-0.841334,-0.073244,\n\t\t\t         0.464278,-0.584918,0.665029,0.183721,-0.750603,0.634663,0.183721,-0.750603,0.634663,0.464278,-0.584918,0.665029,\n\t\t\t         0.392895,-0.470260,0.790216,0.102969,-0.635731,0.764977,0.198645,-0.962737,-0.183386,-0.151769,-0.860866,0.485611,\n\t\t\t         -0.454054,-0.862117,0.224799,0.048891,-0.944060,-0.326060,0.048891,-0.944060,-0.326060,-0.454054,-0.862117,0.224799,\n\t\t\t         -0.648762,-0.758202,-0.064577,-0.039613,-0.879299,-0.474563,-0.151769,-0.860866,0.485611,-0.244087,-0.747673,0.617542,\n\t\t\t         -0.558031,-0.750664,0.353679,-0.454054,-0.862117,0.224799,-0.454054,-0.862117,0.224799,-0.558031,-0.750664,0.353679,\n\t\t\t         -0.756798,-0.651570,0.051729,-0.648762,-0.758202,-0.064577,0.198645,-0.962737,-0.183386,0.048891,-0.944060,-0.326060,\n\t\t\t         0.490432,-0.536210,-0.686941,0.406293,-0.540574,-0.736656,0.406293,-0.540574,-0.736656,0.490432,-0.536210,-0.686941,\n\t\t\t         0.458837,-0.586213,-0.667700,0.388124,-0.584944,-0.712180,0.048891,-0.944060,-0.326060,-0.039613,-0.879299,-0.474563,\n\t\t\t         0.538255,-0.566881,-0.623585,0.490432,-0.536210,-0.686941,0.490432,-0.536210,-0.686941,0.538255,-0.566881,-0.623585,\n\t\t\t         0.492213,-0.615233,-0.615805,0.458837,-0.586213,-0.667700,0.198645,-0.962737,-0.183386,0.406293,-0.540574,-0.736656,\n\t\t\t         0.326334,-0.579058,-0.747093,0.379803,-0.919828,-0.098209,0.379803,-0.919828,-0.098209,0.326334,-0.579058,-0.747093,\n\t\t\t         0.285989,-0.632252,-0.720023,0.535508,-0.841334,-0.073244,0.406293,-0.540574,-0.736656,0.388124,-0.584944,-0.712180,\n\t\t\t         0.320433,-0.614975,-0.720506,0.326334,-0.579058,-0.747093,0.326334,-0.579058,-0.747093,0.320433,-0.614975,-0.720506,\n\t\t\t         0.292303,-0.659972,-0.692095,0.285989,-0.632252,-0.720023,-0.101596,-0.756249,-0.646321,-0.075594,-0.809748,-0.581866,\n\t\t\t         -0.729240,-0.619068,-0.291391,-0.747185,-0.490585,-0.448347,-0.747185,-0.490585,-0.448347,-0.729240,-0.619068,-0.291391,\n\t\t\t         -0.833064,-0.518204,-0.193487,-0.843226,-0.390484,-0.369427,-0.075594,-0.809748,-0.581866,-0.039613,-0.879299,-0.474563,\n\t\t\t         -0.648762,-0.758202,-0.064577,-0.729240,-0.619068,-0.291391,-0.729240,-0.619068,-0.291391,-0.648762,-0.758202,-0.064577,\n\t\t\t         -0.756798,-0.651570,0.051729,-0.833064,-0.518204,-0.193487,-0.101596,-0.756249,-0.646321,-0.747185,-0.490585,-0.448347,\n\t\t\t         -0.728416,-0.360210,-0.582751,-0.128605,-0.699240,-0.703207,-0.128605,-0.699240,-0.703207,-0.728416,-0.360210,-0.582751,\n\t\t\t         -0.640980,-0.170721,-0.748283,-0.132145,-0.595599,-0.792322,-0.747185,-0.490585,-0.448347,-0.843226,-0.390484,-0.369427,\n\t\t\t         -0.818812,-0.252846,-0.515366,-0.728416,-0.360210,-0.582751,-0.728416,-0.360210,-0.582751,-0.818812,-0.252846,-0.515366,\n\t\t\t         -0.728904,-0.054689,-0.682394,-0.640980,-0.170721,-0.748283,-0.101596,-0.756249,-0.646321,-0.128605,-0.699240,-0.703207,\n\t\t\t         0.447920,-0.723167,-0.525681,0.505631,-0.670461,-0.542894,0.505631,-0.670461,-0.542894,0.447920,-0.723167,-0.525681,\n\t\t\t         0.380391,-0.740250,-0.554377,0.443675,-0.700035,-0.559556,-0.128605,-0.699240,-0.703207,-0.132145,-0.595599,-0.792322,\n\t\t\t         0.373882,-0.764458,-0.525132,0.447920,-0.723167,-0.525681,0.447920,-0.723167,-0.525681,0.373882,-0.764458,-0.525132,\n\t\t\t         0.301511,-0.764302,-0.570029,0.380391,-0.740250,-0.554377,-0.101596,-0.756249,-0.646321,0.505631,-0.670461,-0.542894,\n\t\t\t         0.539384,-0.616230,-0.573809,-0.075594,-0.809748,-0.581866,-0.075594,-0.809748,-0.581866,0.539384,-0.616230,-0.573809,\n\t\t\t         0.538255,-0.566881,-0.623585,-0.039613,-0.879299,-0.474563,0.505631,-0.670461,-0.542894,0.443675,-0.700035,-0.559556,\n\t\t\t         0.483254,-0.656361,-0.579358,0.539384,-0.616230,-0.573809,0.539384,-0.616230,-0.573809,0.483254,-0.656361,-0.579358,\n\t\t\t         0.492213,-0.615233,-0.615805,0.538255,-0.566881,-0.623585,0.029542,-0.319224,-0.947203,-0.068606,-0.464614,-0.882839,\n\t\t\t         -0.471236,0.067141,-0.879421,-0.267159,0.284494,-0.920682,-0.267159,0.284494,-0.920682,-0.471236,0.067141,-0.879421,\n\t\t\t         -0.537187,0.195288,-0.820521,-0.306742,0.416883,-0.855617,-0.068606,-0.464614,-0.882839,-0.132145,-0.595599,-0.792322,\n\t\t\t         -0.640980,-0.170721,-0.748283,-0.471236,0.067141,-0.879421,-0.471236,0.067141,-0.879421,-0.640980,-0.170721,-0.748283,\n\t\t\t         -0.728904,-0.054689,-0.682394,-0.537187,0.195288,-0.820521,0.029542,-0.319224,-0.947203,-0.267159,0.284494,-0.920682,\n\t\t\t         -0.017487,0.470443,-0.882229,0.192633,-0.170171,-0.966399,0.192633,-0.170171,-0.966399,-0.017487,0.470443,-0.882229,\n\t\t\t         0.282266,0.597003,-0.750908,0.430708,-0.056612,-0.900693,-0.267159,0.284494,-0.920682,-0.306742,0.416883,-0.855617,\n\t\t\t         -0.052126,0.594714,-0.802210,-0.017487,0.470443,-0.882229,-0.017487,0.470443,-0.882229,-0.052126,0.594714,-0.802210,\n\t\t\t         0.234901,0.710593,-0.663198,0.282266,0.597003,-0.750908,0.029542,-0.319224,-0.947203,0.192633,-0.170171,-0.966399,\n\t\t\t         0.292947,-0.685080,-0.666921,0.267159,-0.740654,-0.616474,0.267159,-0.740654,-0.616474,0.292947,-0.685080,-0.666921,\n\t\t\t         0.265624,-0.643817,-0.717595,0.219136,-0.706095,-0.673356,0.192633,-0.170171,-0.966399,0.430708,-0.056612,-0.900693,\n\t\t\t         0.379498,-0.639485,-0.668569,0.292947,-0.685080,-0.666921,0.292947,-0.685080,-0.666921,0.379498,-0.639485,-0.668569,\n\t\t\t         0.377135,-0.598421,-0.706867,0.265624,-0.643817,-0.717595,0.029542,-0.319224,-0.947203,0.267159,-0.740654,-0.616474,\n\t\t\t         0.301248,-0.773247,-0.557939,-0.068606,-0.464614,-0.882839,-0.068606,-0.464614,-0.882839,0.301248,-0.773247,-0.557939,\n\t\t\t         0.373882,-0.764458,-0.525132,-0.132145,-0.595599,-0.792322,0.267159,-0.740654,-0.616474,0.219136,-0.706095,-0.673356,\n\t\t\t         0.236707,-0.753156,-0.613780,0.301248,-0.773247,-0.557939,0.301248,-0.773247,-0.557939,0.236707,-0.753156,-0.613780,\n\t\t\t         0.301511,-0.764302,-0.570029,0.373882,-0.764458,-0.525132,0.074831,0.963591,0.256661,0.176061,0.952239,0.249458,\n\t\t\t         0.186834,0.981628,0.038423,0.097781,0.994110,0.046602,0.097781,0.994110,0.046602,0.186834,0.981628,0.038423,\n\t\t\t         0.161443,0.986755,-0.015137,0.127598,0.991577,0.021546,0.176061,0.952239,0.249458,0.302835,0.918882,0.252815,\n\t\t\t         0.285867,0.956359,0.060274,0.186834,0.981628,0.038423,0.186834,0.981628,0.038423,0.285867,0.956359,0.060274,\n\t\t\t         0.254677,0.960143,0.115055,0.161443,0.986755,-0.015137,0.074831,0.963591,0.256661,0.097781,0.994110,0.046602,\n\t\t\t         -0.018281,0.998505,0.050935,-0.003693,0.957579,0.288095,-0.003693,0.957579,0.288095,-0.018281,0.998505,0.050935,\n\t\t\t         -0.054689,0.998413,0.012940,-0.037141,0.950499,0.308481,0.097781,0.994110,0.046602,0.127598,0.991577,0.021546,\n\t\t\t         -0.027772,0.994995,0.095737,-0.018281,0.998505,0.050935,-0.018281,0.998505,0.050935,-0.027772,0.994995,0.095737,\n\t\t\t         -0.025819,0.990692,0.133610,-0.054689,0.998413,0.012940,0.074831,0.963591,0.256661,-0.003693,0.957579,0.288095,\n\t\t\t         -0.024384,0.924223,0.380993,0.042756,0.937925,0.344127,0.042756,0.937925,0.344127,-0.024384,0.924223,0.380993,\n\t\t\t         -0.028840,0.995483,0.090121,0.029176,0.991729,0.124943,-0.003693,0.957579,0.288095,-0.037141,0.950499,0.308481,\n\t\t\t         -0.044404,0.917295,0.395703,-0.024384,0.924223,0.380993,-0.024384,0.924223,0.380993,-0.044404,0.917295,0.395703,\n\t\t\t         -0.044313,0.996704,0.067904,-0.028840,0.995483,0.090121,0.074831,0.963591,0.256661,0.042756,0.937925,0.344127,\n\t\t\t         0.145207,0.944731,0.293832,0.176061,0.952239,0.249458,0.176061,0.952239,0.249458,0.145207,0.944731,0.293832,\n\t\t\t         0.280862,0.928556,0.242592,0.302835,0.918882,0.252815,0.042756,0.937925,0.344127,0.029176,0.991729,0.124943,\n\t\t\t         0.109348,0.984405,0.137761,0.145207,0.944731,0.293832,0.145207,0.944731,0.293832,0.109348,0.984405,0.137761,\n\t\t\t         0.239296,0.963805,0.117405,0.280862,0.928556,0.242592,0.509445,0.835353,0.206427,0.506424,0.860653,0.052492,\n\t\t\t         0.422712,0.903012,0.076479,0.414777,0.878201,0.238105,0.414777,0.878201,0.238105,0.422712,0.903012,0.076479,\n\t\t\t         0.285867,0.956359,0.060274,0.302835,0.918882,0.252815,0.506424,0.860653,0.052492,0.490036,0.870205,0.050783,\n\t\t\t         0.450667,0.886868,0.101779,0.422712,0.903012,0.076479,0.422712,0.903012,0.076479,0.450667,0.886868,0.101779,\n\t\t\t         0.254677,0.960143,0.115055,0.285867,0.956359,0.060274,0.509445,0.835353,0.206427,0.414777,0.878201,0.238105,\n\t\t\t         0.399030,0.893643,0.205267,0.498733,0.849635,0.171270,0.498733,0.849635,0.171270,0.399030,0.893643,0.205267,\n\t\t\t         0.369671,0.925169,0.085849,0.490982,0.868770,0.064180,0.414777,0.878201,0.238105,0.302835,0.918882,0.252815,\n\t\t\t         0.280862,0.928556,0.242592,0.399030,0.893643,0.205267,0.399030,0.893643,0.205267,0.280862,0.928556,0.242592,\n\t\t\t         0.239296,0.963805,0.117405,0.369671,0.925169,0.085849,0.509445,0.835353,0.206427,0.498733,0.849635,0.171270,\n\t\t\t         0.635853,0.753197,0.168340,0.628925,0.751366,0.199683,0.628925,0.751366,0.199683,0.635853,0.753197,0.168340,\n\t\t\t         0.801721,0.560747,0.206763,0.769158,0.593249,0.237556,0.498733,0.849635,0.171270,0.490982,0.868770,0.064180,\n\t\t\t         0.637806,0.767602,0.062685,0.635853,0.753197,0.168340,0.635853,0.753197,0.168340,0.637806,0.767602,0.062685,\n\t\t\t         0.814295,0.575701,0.073855,0.801721,0.560747,0.206763,0.509445,0.835353,0.206427,0.628925,0.751366,0.199683,\n\t\t\t         0.610431,0.789056,0.068728,0.506424,0.860653,0.052492,0.506424,0.860653,0.052492,0.610431,0.789056,0.068728,\n\t\t\t         0.544359,0.829768,0.122959,0.490036,0.870205,0.050783,0.628925,0.751366,0.199683,0.769158,0.593249,0.237556,\n\t\t\t         0.762169,0.639607,0.099765,0.610431,0.789056,0.068728,0.610431,0.789056,0.068728,0.762169,0.639607,0.099765,\n\t\t\t         0.750908,0.656148,0.074709,0.544359,0.829768,0.122959,0.931150,0.231178,0.281961,0.954924,0.241554,0.172430,\n\t\t\t         0.884976,0.448866,0.123661,0.884426,0.378124,0.273446,0.884426,0.378124,0.273446,0.884976,0.448866,0.123661,\n\t\t\t         0.762169,0.639607,0.099765,0.769158,0.593249,0.237556,0.954924,0.241554,0.172430,0.966460,0.240333,0.090274,\n\t\t\t         0.907712,0.413251,0.072420,0.884976,0.448866,0.123661,0.884976,0.448866,0.123661,0.907712,0.413251,0.072420,\n\t\t\t         0.750908,0.656148,0.074709,0.762169,0.639607,0.099765,0.931150,0.231178,0.281961,0.884426,0.378124,0.273446,\n\t\t\t         0.899808,0.336070,0.278176,0.913602,0.196142,0.356090,0.913602,0.196142,0.356090,0.899808,0.336070,0.278176,\n\t\t\t         0.933470,0.348643,0.083773,0.972228,0.208411,0.106357,0.884426,0.378124,0.273446,0.769158,0.593249,0.237556,\n\t\t\t         0.801721,0.560747,0.206763,0.899808,0.336070,0.278176,0.899808,0.336070,0.278176,0.801721,0.560747,0.206763,\n\t\t\t         0.814295,0.575701,0.073855,0.933470,0.348643,0.083773,0.931150,0.231178,0.281961,0.913602,0.196142,0.356090,\n\t\t\t         0.912961,0.086093,0.398846,0.962096,0.107273,0.250649,0.962096,0.107273,0.250649,0.912961,0.086093,0.398846,\n\t\t\t         0.923887,-0.011689,0.382427,0.983825,-0.042329,0.174017,0.913602,0.196142,0.356090,0.972228,0.208411,0.106357,\n\t\t\t         0.983215,0.104495,0.149480,0.912961,0.086093,0.398846,0.912961,0.086093,0.398846,0.983215,0.104495,0.149480,\n\t\t\t         0.979308,0.002777,0.202338,0.923887,-0.011689,0.382427,0.931150,0.231178,0.281961,0.962096,0.107273,0.250649,\n\t\t\t         0.982025,0.101932,0.158788,0.954924,0.241554,0.172430,0.954924,0.241554,0.172430,0.982025,0.101932,0.158788,\n\t\t\t         0.987762,0.107425,0.112827,0.966460,0.240333,0.090274,0.962096,0.107273,0.250649,0.983825,-0.042329,0.174017,\n\t\t\t         0.988128,-0.090701,0.123905,0.982025,0.101932,0.158788,0.982025,0.101932,0.158788,0.988128,-0.090701,0.123905,\n\t\t\t         0.987274,-0.125431,0.097598,0.987762,0.107425,0.112827,0.829920,-0.557604,0.016938,0.842219,-0.538255,0.030519,\n\t\t\t         0.951415,-0.292825,0.094913,0.963866,-0.255135,0.076357,0.963866,-0.255135,0.076357,0.951415,-0.292825,0.094913,\n\t\t\t         0.988128,-0.090701,0.123905,0.983825,-0.042329,0.174017,0.842219,-0.538255,0.030519,0.821528,-0.570025,0.010590,\n\t\t\t         0.942320,-0.327616,0.068178,0.951415,-0.292825,0.094913,0.951415,-0.292825,0.094913,0.942320,-0.327616,0.068178,\n\t\t\t         0.987274,-0.125431,0.097598,0.988128,-0.090701,0.123905,0.829920,-0.557604,0.016938,0.963866,-0.255135,0.076357,\n\t\t\t         0.950591,-0.187536,0.247353,0.827631,-0.553056,0.095614,0.827631,-0.553056,0.095614,0.950591,-0.187536,0.247353,\n\t\t\t         0.962493,-0.142460,0.230781,0.858364,-0.471358,0.202429,0.963866,-0.255135,0.076357,0.983825,-0.042329,0.174017,\n\t\t\t         0.923887,-0.011689,0.382427,0.950591,-0.187536,0.247353,0.950591,-0.187536,0.247353,0.923887,-0.011689,0.382427,\n\t\t\t         0.979308,0.002777,0.202338,0.962493,-0.142460,0.230781,0.829920,-0.557604,0.016938,0.827631,-0.553056,0.095614,\n\t\t\t         0.683004,-0.727866,0.060244,0.668020,-0.742271,-0.052461,0.668020,-0.742271,-0.052461,0.683004,-0.727866,0.060244,\n\t\t\t         0.565111,-0.824915,-0.010987,0.515091,-0.855556,-0.051515,0.827631,-0.553056,0.095614,0.858364,-0.471358,0.202429,\n\t\t\t         0.670247,-0.729698,0.135136,0.683004,-0.727866,0.060244,0.683004,-0.727866,0.060244,0.670247,-0.729698,0.135136,\n\t\t\t         0.544755,-0.830195,0.118351,0.565111,-0.824915,-0.010987,0.829920,-0.557604,0.016938,0.668020,-0.742271,-0.052461,\n\t\t\t         0.669088,-0.742515,-0.031190,0.842219,-0.538255,0.030519,0.842219,-0.538255,0.030519,0.669088,-0.742515,-0.031190,\n\t\t\t         0.655660,-0.752403,-0.062929,0.821528,-0.570025,0.010590,0.668020,-0.742271,-0.052461,0.515091,-0.855556,-0.051515,\n\t\t\t         0.491287,-0.869900,-0.043031,0.669088,-0.742515,-0.031190,0.669088,-0.742515,-0.031190,0.491287,-0.869900,-0.043031,\n\t\t\t         0.476363,-0.879147,0.012513,0.655660,-0.752403,-0.062929,0.242927,-0.941832,-0.232215,0.234535,-0.948882,-0.211066,\n\t\t\t         0.307077,-0.946471,-0.099307,0.338328,-0.926298,-0.165654,0.338328,-0.926298,-0.165654,0.307077,-0.946471,-0.099307,\n\t\t\t         0.491287,-0.869900,-0.043031,0.515091,-0.855556,-0.051515,0.234535,-0.948882,-0.211066,0.209021,-0.977020,-0.041383,\n\t\t\t         0.279855,-0.959258,0.038636,0.307077,-0.946471,-0.099307,0.307077,-0.946471,-0.099307,0.279855,-0.959258,0.038636,\n\t\t\t         0.476363,-0.879147,0.012513,0.491287,-0.869900,-0.043031,0.242927,-0.941832,-0.232215,0.338328,-0.926298,-0.165654,\n\t\t\t         0.336192,-0.940672,-0.045259,0.219398,-0.973540,-0.063570,0.219398,-0.973540,-0.063570,0.336192,-0.940672,-0.045259,\n\t\t\t         0.314310,-0.939482,0.136235,0.159581,-0.973601,0.162999,0.338328,-0.926298,-0.165654,0.515091,-0.855556,-0.051515,\n\t\t\t         0.565111,-0.824915,-0.010987,0.336192,-0.940672,-0.045259,0.336192,-0.940672,-0.045259,0.565111,-0.824915,-0.010987,\n\t\t\t         0.544755,-0.830195,0.118351,0.314310,-0.939482,0.136235,0.242927,-0.941832,-0.232215,0.219398,-0.973540,-0.063570,\n\t\t\t         0.086398,-0.996124,0.015503,0.118625,-0.975036,-0.187628,0.118625,-0.975036,-0.187628,0.086398,-0.996124,0.015503,\n\t\t\t         0.008911,-0.994049,0.108280,0.048372,-0.998688,-0.016205,0.219398,-0.973540,-0.063570,0.159581,-0.973601,0.162999,\n\t\t\t         0.065706,-0.981414,0.180212,0.086398,-0.996124,0.015503,0.086398,-0.996124,0.015503,0.065706,-0.981414,0.180212,\n\t\t\t         0.013001,-0.988617,0.149724,0.008911,-0.994049,0.108280,0.242927,-0.941832,-0.232215,0.118625,-0.975036,-0.187628,\n\t\t\t         0.130161,-0.967009,-0.218818,0.234535,-0.948882,-0.211066,0.234535,-0.948882,-0.211066,0.130161,-0.967009,-0.218818,\n\t\t\t         0.117527,-0.990234,-0.074770,0.209021,-0.977020,-0.041383,0.118625,-0.975036,-0.187628,0.048372,-0.998688,-0.016205,\n\t\t\t         0.056307,-0.977203,-0.204596,0.130161,-0.967009,-0.218818,0.130161,-0.967009,-0.218818,0.056307,-0.977203,-0.204596,\n\t\t\t         0.033082,-0.980285,-0.194647,0.117527,-0.990234,-0.074770,-0.382305,-0.258156,-0.887204,-0.499405,-0.398724,-0.769127,\n\t\t\t         -0.836268,-0.509568,-0.202338,-0.919126,-0.354839,-0.171026,-0.919126,-0.354839,-0.171026,-0.836268,-0.509568,-0.202338,\n\t\t\t         -0.867885,-0.495773,0.030946,-0.940092,-0.340861,-0.002167,-0.499405,-0.398724,-0.769127,-0.460372,-0.486404,-0.742576,\n\t\t\t         -0.709067,-0.669698,-0.220557,-0.836268,-0.509568,-0.202338,-0.836268,-0.509568,-0.202338,-0.709067,-0.669698,-0.220557,\n\t\t\t         -0.741234,-0.667989,0.065767,-0.867885,-0.495773,0.030946,-0.382305,-0.258156,-0.887204,-0.919126,-0.354839,-0.171026,\n\t\t\t         -0.966155,-0.214423,-0.143284,-0.484054,-0.197882,-0.852321,-0.484054,-0.197882,-0.852321,-0.966155,-0.214423,-0.143284,\n\t\t\t         -0.990844,-0.072970,-0.113407,-0.549730,-0.094943,-0.829890,-0.919126,-0.354839,-0.171026,-0.940092,-0.340861,-0.002167,\n\t\t\t         -0.978088,-0.206336,-0.026826,-0.966155,-0.214423,-0.143284,-0.966155,-0.214423,-0.143284,-0.978088,-0.206336,-0.026826,\n\t\t\t         -0.998474,-0.045930,-0.030183,-0.990844,-0.072970,-0.113407,-0.382305,-0.258156,-0.887204,-0.484054,-0.197882,-0.852321,\n\t\t\t         0.767998,0.077334,-0.635731,0.787957,0.201575,-0.581744,0.787957,0.201575,-0.581744,0.767998,0.077334,-0.635731,\n\t\t\t         0.971252,0.168157,-0.168310,0.936888,0.311167,-0.159246,-0.484054,-0.197882,-0.852321,-0.549730,-0.094943,-0.829890,\n\t\t\t         0.717246,0.003754,-0.696799,0.767998,0.077334,-0.635731,0.767998,0.077334,-0.635731,0.717246,0.003754,-0.696799,\n\t\t\t         0.983367,0.058901,-0.171667,0.971252,0.168157,-0.168310,-0.382305,-0.258156,-0.887204,0.787957,0.201575,-0.581744,\n\t\t\t         0.744255,0.323649,-0.584185,-0.499405,-0.398724,-0.769127,-0.499405,-0.398724,-0.769127,0.744255,0.323649,-0.584185,\n\t\t\t         0.507370,0.368267,-0.779046,-0.460372,-0.486404,-0.742576,0.787957,0.201575,-0.581744,0.936888,0.311167,-0.159246,\n\t\t\t         0.866573,0.480300,-0.135380,0.744255,0.323649,-0.584185,0.744255,0.323649,-0.584185,0.866573,0.480300,-0.135380,\n\t\t\t         0.755089,0.649892,-0.086123,0.507370,0.368267,-0.779046,-0.666738,0.152135,-0.729576,-0.604175,0.030549,-0.796228,\n\t\t\t         -0.992096,0.107028,-0.065096,-0.958861,0.283456,-0.013886,-0.958861,0.283456,-0.013886,-0.992096,0.107028,-0.065096,\n\t\t\t         -0.980865,0.194189,0.011658,-0.923215,0.377789,0.070009,-0.604175,0.030549,-0.796228,-0.549730,-0.094943,-0.829890,\n\t\t\t         -0.990844,-0.072970,-0.113407,-0.992096,0.107028,-0.065096,-0.992096,0.107028,-0.065096,-0.990844,-0.072970,-0.113407,\n\t\t\t         -0.998474,-0.045930,-0.030183,-0.980865,0.194189,0.011658,-0.666738,0.152135,-0.729576,-0.958861,0.283456,-0.013886,\n\t\t\t         -0.886868,0.460768,-0.033540,-0.665792,0.346141,-0.660939,-0.665792,0.346141,-0.660939,-0.886868,0.460768,-0.033540,\n\t\t\t         -0.708060,0.694845,-0.125736,-0.498245,0.566454,-0.656362,-0.958861,0.283456,-0.013886,-0.923215,0.377789,0.070009,\n\t\t\t         -0.897946,0.426160,0.109806,-0.886868,0.460768,-0.033540,-0.886868,0.460768,-0.033540,-0.897946,0.426160,0.109806,\n\t\t\t         -0.815546,0.577258,0.039888,-0.708060,0.694845,-0.125736,-0.666738,0.152135,-0.729576,-0.665792,0.346141,-0.660939,\n\t\t\t         0.401013,-0.285623,-0.870388,0.602222,-0.195471,-0.774010,0.602222,-0.195471,-0.774010,0.401013,-0.285623,-0.870388,\n\t\t\t         0.845790,-0.494552,-0.199988,0.946196,-0.262337,-0.189306,-0.665792,0.346141,-0.660939,-0.498245,0.566454,-0.656362,\n\t\t\t         0.290536,-0.309366,-0.905454,0.401013,-0.285623,-0.870388,0.401013,-0.285623,-0.870388,0.290536,-0.309366,-0.905454,\n\t\t\t         0.652394,-0.739799,-0.164434,0.845790,-0.494552,-0.199988,-0.666738,0.152135,-0.729576,0.602222,-0.195471,-0.774010,\n\t\t\t         0.683798,-0.063875,-0.726859,-0.604175,0.030549,-0.796228,-0.604175,0.030549,-0.796228,0.683798,-0.063875,-0.726859,\n\t\t\t         0.717246,0.003754,-0.696799,-0.549730,-0.094943,-0.829890,0.602222,-0.195471,-0.774010,0.946196,-0.262337,-0.189306,\n\t\t\t         0.981445,-0.073092,-0.177190,0.683798,-0.063875,-0.726859,0.683798,-0.063875,-0.726859,0.981445,-0.073092,-0.177190,\n\t\t\t         0.983367,0.058901,-0.171667,0.717246,0.003754,-0.696799,0.522721,-0.430280,-0.735923,0.585833,-0.355266,-0.728355,\n\t\t\t         0.929441,-0.366131,-0.045442,0.883206,-0.468093,-0.028291,0.883206,-0.468093,-0.028291,0.929441,-0.366131,-0.045442,\n\t\t\t         0.930326,-0.366436,0.013642,0.885159,-0.463759,0.037446,0.585833,-0.355266,-0.728355,0.644581,-0.253548,-0.721244,\n\t\t\t         0.966582,-0.245643,-0.073153,0.929441,-0.366131,-0.045442,0.929441,-0.366131,-0.045442,0.966582,-0.245643,-0.073153,\n\t\t\t         0.970885,-0.239387,-0.005829,0.930326,-0.366436,0.013642,0.522721,-0.430280,-0.735923,0.883206,-0.468093,-0.028291,\n\t\t\t         0.814814,-0.578478,-0.037233,0.454451,-0.478469,-0.751305,0.454451,-0.478469,-0.751305,0.814814,-0.578478,-0.037233,\n\t\t\t         0.694937,-0.714621,-0.079379,0.387188,-0.496292,-0.777001,0.883206,-0.468093,-0.028291,0.885159,-0.463759,0.037446,\n\t\t\t         0.824000,-0.563005,0.063051,0.814814,-0.578478,-0.037233,0.814814,-0.578478,-0.037233,0.824000,-0.563005,0.063051,\n\t\t\t         0.719108,-0.689413,0.086917,0.694937,-0.714621,-0.079379,0.522721,-0.430280,-0.735923,0.454451,-0.478469,-0.751305,\n\t\t\t         -0.637135,0.283486,-0.716697,-0.651173,0.171484,-0.739280,-0.651173,0.171484,-0.739280,-0.637135,0.283486,-0.716697,\n\t\t\t         -0.831935,0.538835,-0.132176,-0.893613,0.421827,-0.153203,0.454451,-0.478469,-0.751305,0.387188,-0.496292,-0.777001,\n\t\t\t         -0.561449,0.461318,-0.686941,-0.637135,0.283486,-0.716697,-0.637135,0.283486,-0.716697,-0.561449,0.461318,-0.686941,\n\t\t\t         -0.721183,0.688772,-0.073794,-0.831935,0.538835,-0.132176,0.522721,-0.430280,-0.735923,-0.651173,0.171484,-0.739280,\n\t\t\t         -0.645833,0.096438,-0.757347,0.585833,-0.355266,-0.728355,0.585833,-0.355266,-0.728355,-0.645833,0.096438,-0.757347,\n\t\t\t         -0.626209,0.032258,-0.778954,0.644581,-0.253548,-0.721244,-0.651173,0.171484,-0.739280,-0.893613,0.421827,-0.153203,\n\t\t\t         -0.935179,0.320505,-0.150548,-0.645833,0.096438,-0.757347,-0.645833,0.096438,-0.757347,-0.935179,0.320505,-0.150548,\n\t\t\t         -0.967681,0.211737,-0.136876,-0.626209,0.032258,-0.778954,-0.073824,-0.600238,-0.796381,0.249489,-0.547716,-0.798578,\n\t\t\t         0.419080,-0.895138,-0.151830,-0.082186,-0.974120,-0.210456,-0.082186,-0.974120,-0.210456,0.419080,-0.895138,-0.151830,\n\t\t\t         0.455977,-0.883602,0.106296,-0.067385,-0.991607,0.110233,0.249489,-0.547716,-0.798578,0.387188,-0.496292,-0.777001,\n\t\t\t         0.694937,-0.714621,-0.079379,0.419080,-0.895138,-0.151830,0.419080,-0.895138,-0.151830,0.694937,-0.714621,-0.079379,\n\t\t\t         0.719108,-0.689413,0.086917,0.455977,-0.883602,0.106296,-0.073824,-0.600238,-0.796381,-0.082186,-0.974120,-0.210456,\n\t\t\t         -0.502701,-0.834712,-0.224708,-0.326395,-0.535600,-0.778802,-0.326395,-0.535600,-0.778802,-0.502701,-0.834712,-0.224708,\n\t\t\t         -0.709067,-0.669698,-0.220557,-0.460372,-0.486404,-0.742576,-0.082186,-0.974120,-0.210456,-0.067385,-0.991607,0.110233,\n\t\t\t         -0.521561,-0.848231,0.091830,-0.502701,-0.834712,-0.224708,-0.502701,-0.834712,-0.224708,-0.521561,-0.848231,0.091830,\n\t\t\t         -0.741234,-0.667989,0.065767,-0.709067,-0.669698,-0.220557,-0.073824,-0.600238,-0.796381,-0.326395,-0.535600,-0.778802,\n\t\t\t         0.351054,0.517319,-0.780450,0.081149,0.686911,-0.722160,0.081149,0.686911,-0.722160,0.351054,0.517319,-0.780450,\n\t\t\t         0.566485,0.824030,-0.006195,0.121891,0.991058,0.053896,-0.326395,-0.535600,-0.778802,-0.460372,-0.486404,-0.742576,\n\t\t\t         0.507370,0.368267,-0.779046,0.351054,0.517319,-0.780450,0.351054,0.517319,-0.780450,0.507370,0.368267,-0.779046,\n\t\t\t         0.755089,0.649892,-0.086123,0.566485,0.824030,-0.006195,-0.073824,-0.600238,-0.796381,0.081149,0.686911,-0.722160,\n\t\t\t         -0.318430,0.659108,-0.681265,0.249489,-0.547716,-0.798578,0.249489,-0.547716,-0.798578,-0.318430,0.659108,-0.681265,\n\t\t\t         -0.561449,0.461318,-0.686941,0.387188,-0.496292,-0.777001,0.081149,0.686911,-0.722160,0.121891,0.991058,0.053896,\n\t\t\t         -0.436811,0.899411,0.015107,-0.318430,0.659108,-0.681265,-0.318430,0.659108,-0.681265,-0.436811,0.899411,0.015107,\n\t\t\t         -0.721183,0.688772,-0.073794,-0.561449,0.461318,-0.686941,0.245369,0.473830,-0.845729,0.127079,0.490371,-0.862178,\n\t\t\t         0.313730,0.884243,-0.345927,0.526353,0.778893,-0.340892,0.526353,0.778893,-0.340892,0.313730,0.884243,-0.345927,\n\t\t\t         0.351604,0.931120,-0.096652,0.575915,0.813440,-0.081240,0.127079,0.490371,-0.862178,0.023164,0.494613,-0.868770,\n\t\t\t         0.111057,0.930601,-0.348704,0.313730,0.884243,-0.345927,0.313730,0.884243,-0.345927,0.111057,0.930601,-0.348704,\n\t\t\t         0.148595,0.981201,-0.123051,0.351604,0.931120,-0.096652,0.245369,0.473830,-0.845729,0.526353,0.778893,-0.340892,\n\t\t\t         0.723411,0.619465,-0.304788,0.409131,0.437941,-0.800501,0.409131,0.437941,-0.800501,0.723411,0.619465,-0.304788,\n\t\t\t         0.880673,0.408734,-0.239387,0.598621,0.325694,-0.731773,0.526353,0.778893,-0.340892,0.575915,0.813440,-0.081240,\n\t\t\t         0.772973,0.630909,-0.066683,0.723411,0.619465,-0.304788,0.723411,0.619465,-0.304788,0.772973,0.630909,-0.066683,\n\t\t\t         0.912656,0.405621,-0.050203,0.880673,0.408734,-0.239387,0.245369,0.473830,-0.845729,0.409131,0.437941,-0.800501,\n\t\t\t         -0.505875,-0.316904,-0.802271,-0.448225,-0.491470,-0.746666,-0.448225,-0.491470,-0.746666,-0.505875,-0.316904,-0.802271,\n\t\t\t         -0.772973,-0.632405,-0.050081,-0.586291,-0.809717,-0.024049,0.409131,0.437941,-0.800501,0.598621,0.325694,-0.731773,\n\t\t\t         -0.478835,-0.186254,-0.857875,-0.505875,-0.316904,-0.802271,-0.505875,-0.316904,-0.802271,-0.478835,-0.186254,-0.857875,\n\t\t\t         -0.905820,-0.415876,-0.080538,-0.772973,-0.632405,-0.050081,0.245369,0.473830,-0.845729,-0.448225,-0.491470,-0.746666,\n\t\t\t         -0.298990,-0.615101,-0.729514,0.127079,0.490371,-0.862178,0.127079,0.490371,-0.862178,-0.298990,-0.615101,-0.729514,\n\t\t\t         -0.133793,-0.682730,-0.718284,0.023164,0.494613,-0.868770,-0.448225,-0.491470,-0.746666,-0.586291,-0.809717,-0.024049,\n\t\t\t         -0.365551,-0.930631,-0.016633,-0.298990,-0.615101,-0.729514,-0.298990,-0.615101,-0.729514,-0.365551,-0.930631,-0.016633,\n\t\t\t         -0.146336,-0.989227,-0.001160,-0.133793,-0.682730,-0.718284,-0.094241,0.526688,-0.844783,-0.237617,0.623798,-0.744560,\n\t\t\t         -0.460341,0.850276,-0.255074,-0.242470,0.905576,-0.347972,-0.242470,0.905576,-0.347972,-0.460341,0.850276,-0.255074,\n\t\t\t         -0.603931,0.792627,-0.083560,-0.313089,0.935820,-0.161687,-0.237617,0.623798,-0.744560,-0.498245,0.566454,-0.656362,\n\t\t\t         -0.708060,0.694845,-0.125736,-0.460341,0.850276,-0.255074,-0.460341,0.850276,-0.255074,-0.708060,0.694845,-0.125736,\n\t\t\t         -0.815546,0.577258,0.039888,-0.603931,0.792627,-0.083560,-0.094241,0.526688,-0.844783,-0.242470,0.905576,-0.347972,\n\t\t\t         -0.066195,0.928678,-0.364879,-0.048616,0.483322,-0.874081,-0.048616,0.483322,-0.874081,-0.066195,0.928678,-0.364879,\n\t\t\t         0.111057,0.930601,-0.348704,0.023164,0.494613,-0.868770,-0.242470,0.905576,-0.347972,-0.313089,0.935820,-0.161687,\n\t\t\t         -0.048891,0.985931,-0.159764,-0.066195,0.928678,-0.364879,-0.066195,0.928678,-0.364879,-0.048891,0.985931,-0.159764,\n\t\t\t         0.148595,0.981201,-0.123051,0.111057,0.930601,-0.348704,-0.094241,0.526688,-0.844783,-0.048616,0.483322,-0.874081,\n\t\t\t         0.023255,-0.717307,-0.696341,0.172826,-0.682424,-0.710196,0.172826,-0.682424,-0.710196,0.023255,-0.717307,-0.696341,\n\t\t\t         0.043275,-0.998383,0.036805,0.218787,-0.975249,0.031770,-0.048616,0.483322,-0.874081,0.023164,0.494613,-0.868770,\n\t\t\t         -0.133793,-0.682730,-0.718284,0.023255,-0.717307,-0.696341,0.023255,-0.717307,-0.696341,-0.133793,-0.682730,-0.718284,\n\t\t\t         -0.146336,-0.989227,-0.001160,0.043275,-0.998383,0.036805,-0.094241,0.526688,-0.844783,0.172826,-0.682424,-0.710196,\n\t\t\t         0.279580,-0.505264,-0.816370,-0.237617,0.623798,-0.744560,-0.237617,0.623798,-0.744560,0.279580,-0.505264,-0.816370,\n\t\t\t         0.290536,-0.309366,-0.905454,-0.498245,0.566454,-0.656362,0.172826,-0.682424,-0.710196,0.218787,-0.975249,0.031770,\n\t\t\t         0.418409,-0.906003,-0.063478,0.279580,-0.505264,-0.816370,0.279580,-0.505264,-0.816370,0.418409,-0.906003,-0.063478,\n\t\t\t         0.652394,-0.739799,-0.164434,0.290536,-0.309366,-0.905454,0.733451,0.000519,-0.679708,0.716239,0.155095,-0.680380,\n\t\t\t         0.965575,0.195898,-0.170934,0.991699,0.032502,-0.124180,0.991699,0.032502,-0.124180,0.965575,0.195898,-0.170934,\n\t\t\t         0.981048,0.191015,-0.031831,0.999084,0.037690,-0.019868,0.716239,0.155095,-0.680380,0.598621,0.325694,-0.731773,\n\t\t\t         0.880673,0.408734,-0.239387,0.965575,0.195898,-0.170934,0.965575,0.195898,-0.170934,0.880673,0.408734,-0.239387,\n\t\t\t         0.912656,0.405621,-0.050203,0.981048,0.191015,-0.031831,0.733451,0.000519,-0.679708,0.991699,0.032502,-0.124180,\n\t\t\t         0.989380,-0.107761,-0.097232,0.699454,-0.131596,-0.702445,0.699454,-0.131596,-0.702445,0.989380,-0.107761,-0.097232,\n\t\t\t         0.966582,-0.245643,-0.073153,0.644581,-0.253548,-0.721244,0.991699,0.032502,-0.124180,0.999084,0.037690,-0.019868,\n\t\t\t         0.995361,-0.094699,-0.015290,0.989380,-0.107761,-0.097232,0.989380,-0.107761,-0.097232,0.995361,-0.094699,-0.015290,\n\t\t\t         0.970885,-0.239387,-0.005829,0.966582,-0.245643,-0.073153,0.733451,0.000519,-0.679708,0.699454,-0.131596,-0.702445,\n\t\t\t         -0.590625,-0.024598,-0.806543,-0.542711,-0.075594,-0.836482,-0.542711,-0.075594,-0.836482,-0.590625,-0.024598,-0.806543,\n\t\t\t         -0.988556,0.088778,-0.121921,-0.992828,-0.046632,-0.109836,0.699454,-0.131596,-0.702445,0.644581,-0.253548,-0.721244,\n\t\t\t         -0.626209,0.032258,-0.778954,-0.590625,-0.024598,-0.806543,-0.590625,-0.024598,-0.806543,-0.626209,0.032258,-0.778954,\n\t\t\t         -0.967681,0.211737,-0.136876,-0.988556,0.088778,-0.121921,0.733451,0.000519,-0.679708,-0.542711,-0.075594,-0.836482,\n\t\t\t         -0.492752,-0.123081,-0.861385,0.716239,0.155095,-0.680380,0.716239,0.155095,-0.680380,-0.492752,-0.123081,-0.861385,\n\t\t\t         -0.478835,-0.186254,-0.857875,0.598621,0.325694,-0.731773,-0.542711,-0.075594,-0.836482,-0.992828,-0.046632,-0.109836,\n\t\t\t         -0.972961,-0.208563,-0.098941,-0.492752,-0.123081,-0.861385,-0.492752,-0.123081,-0.861385,-0.972961,-0.208563,-0.098941,\n\t\t\t         -0.905820,-0.415876,-0.080538,-0.478835,-0.186254,-0.857875,0.927061,0.322062,-0.191870,0.873012,0.441481,-0.207190,\n\t\t\t         0.865596,0.446028,-0.227454,0.926298,0.300363,-0.227454,0.926298,0.300363,-0.227454,0.865596,0.446028,-0.227454,\n\t\t\t         0.866573,0.480300,-0.135380,0.936888,0.311167,-0.159246,0.873012,0.441481,-0.207190,0.792627,0.574938,-0.202734,\n\t\t\t         0.774804,0.605579,-0.181463,0.865596,0.446028,-0.227454,0.865596,0.446028,-0.227454,0.774804,0.605579,-0.181463,\n\t\t\t         0.755089,0.649892,-0.086123,0.866573,0.480300,-0.135380,0.927061,0.322062,-0.191870,0.926298,0.300363,-0.227454,\n\t\t\t         0.964415,0.180578,-0.192999,0.963012,0.215552,-0.161596,0.963012,0.215552,-0.161596,0.964415,0.180578,-0.192999,\n\t\t\t         0.985168,0.073031,-0.155065,0.986175,0.097507,-0.133824,0.926298,0.300363,-0.227454,0.936888,0.311167,-0.159246,\n\t\t\t         0.971252,0.168157,-0.168310,0.964415,0.180578,-0.192999,0.964415,0.180578,-0.192999,0.971252,0.168157,-0.168310,\n\t\t\t         0.983367,0.058901,-0.171667,0.985168,0.073031,-0.155065,0.927061,0.322062,-0.191870,0.963012,0.215552,-0.161596,\n\t\t\t         0.962157,0.242195,-0.124638,0.926572,0.348491,-0.141240,0.926572,0.348491,-0.141240,0.962157,0.242195,-0.124638,\n\t\t\t         0.960523,0.254611,-0.112106,0.923229,0.363981,-0.123148,0.963012,0.215552,-0.161596,0.986175,0.097507,-0.133824,\n\t\t\t         0.986663,0.114231,-0.115909,0.962157,0.242195,-0.124638,0.962157,0.242195,-0.124638,0.986663,0.114231,-0.115909,\n\t\t\t         0.986257,0.123086,-0.110218,0.960523,0.254611,-0.112106,0.927061,0.322062,-0.191870,0.926572,0.348491,-0.141240,\n\t\t\t         0.872433,0.459334,-0.166784,0.873012,0.441481,-0.207190,0.873012,0.441481,-0.207190,0.872433,0.459334,-0.166784,\n\t\t\t         0.791162,0.576800,-0.203253,0.792627,0.574938,-0.202734,0.926572,0.348491,-0.141240,0.923229,0.363981,-0.123148,\n\t\t\t         0.866239,0.476014,-0.151791,0.872433,0.459334,-0.166784,0.872433,0.459334,-0.166784,0.866239,0.476014,-0.151791,\n\t\t\t         0.782942,0.588525,-0.201592,0.791162,0.576800,-0.203253,0.946623,-0.291452,-0.137455,0.989746,-0.068850,-0.125126,\n\t\t\t         0.987365,-0.071627,-0.141240,0.949004,-0.274056,-0.155644,0.949004,-0.274056,-0.155644,0.987365,-0.071627,-0.141240,\n\t\t\t         0.981445,-0.073092,-0.177190,0.946196,-0.262337,-0.189306,0.989746,-0.068850,-0.125126,0.986175,0.097507,-0.133824,\n\t\t\t         0.985168,0.073031,-0.155065,0.987365,-0.071627,-0.141240,0.987365,-0.071627,-0.141240,0.985168,0.073031,-0.155065,\n\t\t\t         0.983367,0.058901,-0.171667,0.981445,-0.073092,-0.177190,0.946623,-0.291452,-0.137455,0.949004,-0.274056,-0.155644,\n\t\t\t         0.849452,-0.496200,-0.179296,0.844905,-0.510788,-0.158635,0.844905,-0.510788,-0.158635,0.849452,-0.496200,-0.179296,\n\t\t\t         0.698965,-0.697409,-0.158238,0.727226,-0.666097,-0.165563,0.949004,-0.274056,-0.155644,0.946196,-0.262337,-0.189306,\n\t\t\t         0.845790,-0.494552,-0.199988,0.849452,-0.496200,-0.179296,0.849452,-0.496200,-0.179296,0.845790,-0.494552,-0.199988,\n\t\t\t         0.652394,-0.739799,-0.164434,0.698965,-0.697409,-0.158238,0.946623,-0.291452,-0.137455,0.844905,-0.510788,-0.158635,\n\t\t\t         0.834284,-0.532548,-0.142521,0.944029,-0.304910,-0.125675,0.944029,-0.304910,-0.125675,0.834284,-0.532548,-0.142521,\n\t\t\t         0.825366,-0.547431,-0.138169,0.942257,-0.311807,-0.122184,0.844905,-0.510788,-0.158635,0.727226,-0.666097,-0.165563,\n\t\t\t         0.710868,-0.681448,-0.173925,0.834284,-0.532548,-0.142521,0.834284,-0.532548,-0.142521,0.710868,-0.681448,-0.173925,\n\t\t\t         0.691166,-0.700669,-0.177070,0.825366,-0.547431,-0.138169,0.946623,-0.291452,-0.137455,0.944029,-0.304910,-0.125675,\n\t\t\t         0.990905,-0.067202,-0.116337,0.989746,-0.068850,-0.125126,0.989746,-0.068850,-0.125126,0.990905,-0.067202,-0.116337,\n\t\t\t         0.986663,0.114231,-0.115909,0.986175,0.097507,-0.133824,0.944029,-0.304910,-0.125675,0.942257,-0.311807,-0.122184,\n\t\t\t         0.991382,-0.065039,-0.113714,0.990905,-0.067202,-0.116337,0.990905,-0.067202,-0.116337,0.991382,-0.065039,-0.113714,\n\t\t\t         0.986257,0.123086,-0.110218,0.986663,0.114231,-0.115909,-0.896573,0.426344,-0.119785,-0.935118,0.335582,-0.113742,\n\t\t\t         -0.936003,0.332682,-0.114780,-0.896664,0.425611,-0.121616,-0.896664,0.425611,-0.121616,-0.936003,0.332682,-0.114780,\n\t\t\t         -0.935179,0.320505,-0.150548,-0.893613,0.421827,-0.153203,-0.935118,0.335582,-0.113742,-0.967711,0.225379,-0.112766,\n\t\t\t         -0.968902,0.224921,-0.102847,-0.936003,0.332682,-0.114780,-0.936003,0.332682,-0.114780,-0.968902,0.224921,-0.102847,\n\t\t\t         -0.967681,0.211737,-0.136876,-0.935179,0.320505,-0.150548,-0.896573,0.426344,-0.119785,-0.896664,0.425611,-0.121616,\n\t\t\t         -0.842036,0.526536,-0.116977,-0.844569,0.519059,-0.131352,-0.844569,0.519059,-0.131352,-0.842036,0.526536,-0.116977,\n\t\t\t         -0.749107,0.655599,-0.094790,-0.758660,0.634144,-0.149113,-0.896664,0.425611,-0.121616,-0.893613,0.421827,-0.153203,\n\t\t\t         -0.831935,0.538835,-0.132176,-0.842036,0.526536,-0.116977,-0.842036,0.526536,-0.116977,-0.831935,0.538835,-0.132176,\n\t\t\t         -0.721183,0.688772,-0.073794,-0.749107,0.655599,-0.094790,-0.896573,0.426344,-0.119785,-0.844569,0.519059,-0.131352,\n\t\t\t         -0.835444,0.528825,-0.149327,-0.893918,0.430616,-0.124180,-0.893918,0.430616,-0.124180,-0.835444,0.528825,-0.149327,\n\t\t\t         -0.824562,0.543470,-0.157280,-0.889375,0.439316,-0.126546,-0.844569,0.519059,-0.131352,-0.758660,0.634144,-0.149113,\n\t\t\t         -0.739830,0.642628,-0.199133,-0.835444,0.528825,-0.149327,-0.835444,0.528825,-0.149327,-0.739830,0.642628,-0.199133,\n\t\t\t         -0.720026,0.659057,-0.217270,-0.824562,0.543470,-0.157280,-0.896573,0.426344,-0.119785,-0.893918,0.430616,-0.124180,\n\t\t\t         -0.936155,0.330821,-0.118931,-0.935118,0.335582,-0.113742,-0.935118,0.335582,-0.113742,-0.936155,0.330821,-0.118931,\n\t\t\t         -0.968963,0.211371,-0.128086,-0.967711,0.225379,-0.112766,-0.893918,0.430616,-0.124180,-0.889375,0.439316,-0.126546,\n\t\t\t         -0.935542,0.332160,-0.120131,-0.936155,0.330821,-0.118931,-0.936155,0.330821,-0.118931,-0.935542,0.332160,-0.120131,\n\t\t\t         -0.969846,0.204943,-0.131895,-0.968963,0.211371,-0.128086,0.127964,0.970092,-0.206183,-0.496902,0.848567,-0.181646,\n\t\t\t         -0.479873,0.875332,-0.058931,0.122745,0.991028,-0.052583,0.122745,0.991028,-0.052583,-0.479873,0.875332,-0.058931,\n\t\t\t         -0.436811,0.899411,0.015107,0.121891,0.991058,0.053896,-0.496902,0.848567,-0.181646,-0.758660,0.634144,-0.149113,\n\t\t\t         -0.749107,0.655599,-0.094790,-0.479873,0.875332,-0.058931,-0.479873,0.875332,-0.058931,-0.749107,0.655599,-0.094790,\n\t\t\t         -0.721183,0.688772,-0.073794,-0.436811,0.899411,0.015107,0.127964,0.970092,-0.206183,0.122745,0.991028,-0.052583,\n\t\t\t         0.604511,0.789819,-0.103427,0.631764,0.750481,-0.193823,0.631764,0.750481,-0.193823,0.604511,0.789819,-0.103427,\n\t\t\t         0.774804,0.605579,-0.181463,0.792627,0.574938,-0.202734,0.122745,0.991028,-0.052583,0.121891,0.991058,0.053896,\n\t\t\t         0.566485,0.824030,-0.006195,0.604511,0.789819,-0.103427,0.604511,0.789819,-0.103427,0.566485,0.824030,-0.006195,\n\t\t\t         0.755089,0.649892,-0.086123,0.774804,0.605579,-0.181463,0.127964,0.970092,-0.206183,0.631764,0.750481,-0.193823,\n\t\t\t         0.629933,0.732078,-0.259194,0.140721,0.934233,-0.327677,0.140721,0.934233,-0.327677,0.629933,0.732078,-0.259194,\n\t\t\t         0.624951,0.730455,-0.275450,0.162957,0.918404,-0.360526,0.631764,0.750481,-0.193823,0.792627,0.574938,-0.202734,\n\t\t\t         0.791162,0.576800,-0.203253,0.629933,0.732078,-0.259194,0.629933,0.732078,-0.259194,0.791162,0.576800,-0.203253,\n\t\t\t         0.782942,0.588525,-0.201592,0.624951,0.730455,-0.275450,0.127964,0.970092,-0.206183,0.140721,0.934233,-0.327677,\n\t\t\t         -0.473373,0.833949,-0.283547,-0.496902,0.848567,-0.181646,-0.496902,0.848567,-0.181646,-0.473373,0.833949,-0.283547,\n\t\t\t         -0.739830,0.642628,-0.199133,-0.758660,0.634144,-0.149113,0.140721,0.934233,-0.327677,0.162957,0.918404,-0.360526,\n\t\t\t         -0.446310,0.837658,-0.314860,-0.473373,0.833949,-0.283547,-0.473373,0.833949,-0.283547,-0.446310,0.837658,-0.314860,\n\t\t\t         -0.720026,0.659057,-0.217270,-0.739830,0.642628,-0.199133,-0.625446,-0.767144,-0.142369,-0.403241,-0.904996,-0.135350,\n\t\t\t         -0.380627,-0.924680,-0.006928,-0.607440,-0.793786,-0.029603,-0.607440,-0.793786,-0.029603,-0.380627,-0.924680,-0.006928,\n\t\t\t         -0.365551,-0.930631,-0.016633,-0.586291,-0.809717,-0.024049,-0.403241,-0.904996,-0.135350,-0.209754,-0.969939,-0.123264,\n\t\t\t         -0.176672,-0.984008,0.021516,-0.380627,-0.924680,-0.006928,-0.380627,-0.924680,-0.006928,-0.176672,-0.984008,0.021516,\n\t\t\t         -0.146336,-0.989227,-0.001160,-0.365551,-0.930631,-0.016633,-0.625446,-0.767144,-0.142369,-0.607440,-0.793786,-0.029603,\n\t\t\t         -0.794824,-0.603656,-0.061922,-0.804865,-0.574816,-0.147404,-0.804865,-0.574816,-0.147404,-0.794824,-0.603656,-0.061922,\n\t\t\t         -0.914060,-0.395947,-0.087558,-0.912625,-0.381848,-0.145726,-0.607440,-0.793786,-0.029603,-0.586291,-0.809717,-0.024049,\n\t\t\t         -0.772973,-0.632405,-0.050081,-0.794824,-0.603656,-0.061922,-0.794824,-0.603656,-0.061922,-0.772973,-0.632405,-0.050081,\n\t\t\t         -0.905820,-0.415876,-0.080538,-0.914060,-0.395947,-0.087558,-0.625446,-0.767144,-0.142369,-0.804865,-0.574816,-0.147404,\n\t\t\t         -0.788812,-0.572436,-0.223701,-0.615864,-0.749382,-0.243171,-0.615864,-0.749382,-0.243171,-0.788812,-0.572436,-0.223701,\n\t\t\t         -0.776100,-0.580771,-0.245713,-0.604334,-0.749206,-0.271054,-0.804865,-0.574816,-0.147404,-0.912625,-0.381848,-0.145726,\n\t\t\t         -0.900296,-0.386853,-0.199377,-0.788812,-0.572436,-0.223701,-0.788812,-0.572436,-0.223701,-0.900296,-0.386853,-0.199377,\n\t\t\t         -0.892990,-0.395112,-0.215535,-0.776100,-0.580771,-0.245713,-0.625446,-0.767144,-0.142369,-0.615864,-0.749382,-0.243171,\n\t\t\t         -0.405560,-0.879208,-0.249886,-0.403241,-0.904996,-0.135350,-0.403241,-0.904996,-0.135350,-0.405560,-0.879208,-0.249886,\n\t\t\t         -0.215247,-0.943327,-0.252510,-0.209754,-0.969939,-0.123264,-0.615864,-0.749382,-0.243171,-0.604334,-0.749206,-0.271054,\n\t\t\t         -0.399061,-0.872833,-0.280916,-0.405560,-0.879208,-0.249886,-0.405560,-0.879208,-0.249886,-0.399061,-0.872833,-0.280916,\n\t\t\t         -0.207817,-0.935009,-0.287352,-0.215247,-0.943327,-0.252510,0.294259,-0.948851,-0.114292,0.573931,-0.806085,-0.144139,\n\t\t\t         0.509262,-0.858669,-0.057375,0.261879,-0.964049,0.044374,0.261879,-0.964049,0.044374,0.509262,-0.858669,-0.057375,\n\t\t\t         0.418409,-0.906003,-0.063478,0.218787,-0.975249,0.031770,0.573931,-0.806085,-0.144139,0.727226,-0.666097,-0.165563,\n\t\t\t         0.698965,-0.697409,-0.158238,0.509262,-0.858669,-0.057375,0.509262,-0.858669,-0.057375,0.698965,-0.697409,-0.158238,\n\t\t\t         0.652394,-0.739799,-0.164434,0.418409,-0.906003,-0.063478,0.294259,-0.948851,-0.114292,0.261879,-0.964049,0.044374,\n\t\t\t         0.016114,-0.998047,0.060060,-0.007721,-0.994018,-0.108676,-0.007721,-0.994018,-0.108676,0.016114,-0.998047,0.060060,\n\t\t\t         -0.176672,-0.984008,0.021516,-0.209754,-0.969939,-0.123264,0.261879,-0.964049,0.044374,0.218787,-0.975249,0.031770,\n\t\t\t         0.043275,-0.998383,0.036805,0.016114,-0.998047,0.060060,0.016114,-0.998047,0.060060,0.043275,-0.998383,0.036805,\n\t\t\t         -0.146336,-0.989227,-0.001160,-0.176672,-0.984008,0.021516,0.294259,-0.948851,-0.114292,-0.007721,-0.994018,-0.108676,\n\t\t\t         -0.014100,-0.965300,-0.260720,0.281899,-0.923948,-0.258522,0.281899,-0.923948,-0.258522,-0.014100,-0.965300,-0.260720,\n\t\t\t         -0.009293,-0.953463,-0.301366,0.267326,-0.916551,-0.297439,-0.007721,-0.994018,-0.108676,-0.209754,-0.969939,-0.123264,\n\t\t\t         -0.215247,-0.943327,-0.252510,-0.014100,-0.965300,-0.260720,-0.014100,-0.965300,-0.260720,-0.215247,-0.943327,-0.252510,\n\t\t\t         -0.207817,-0.935009,-0.287352,-0.009293,-0.953463,-0.301366,0.294259,-0.948851,-0.114292,0.281899,-0.923948,-0.258522,\n\t\t\t         0.556597,-0.800439,-0.222327,0.573931,-0.806085,-0.144139,0.573931,-0.806085,-0.144139,0.556597,-0.800439,-0.222327,\n\t\t\t         0.710868,-0.681448,-0.173925,0.727226,-0.666097,-0.165563,0.281899,-0.923948,-0.258522,0.267326,-0.916551,-0.297439,\n\t\t\t         0.529530,-0.812651,-0.243304,0.556597,-0.800439,-0.222327,0.556597,-0.800439,-0.222327,0.529530,-0.812651,-0.243304,\n\t\t\t         0.691166,-0.700669,-0.177070,0.710868,-0.681448,-0.173925,-0.990844,-0.046968,-0.126469,-0.969024,-0.205298,-0.137089,\n\t\t\t         -0.974609,-0.203589,-0.093020,-0.995025,-0.041963,-0.090304,-0.995025,-0.041963,-0.090304,-0.974609,-0.203589,-0.093020,\n\t\t\t         -0.972961,-0.208563,-0.098941,-0.992828,-0.046632,-0.109836,-0.969024,-0.205298,-0.137089,-0.912625,-0.381848,-0.145726,\n\t\t\t         -0.914060,-0.395947,-0.087558,-0.974609,-0.203589,-0.093020,-0.974609,-0.203589,-0.093020,-0.914060,-0.395947,-0.087558,\n\t\t\t         -0.905820,-0.415876,-0.080538,-0.972961,-0.208563,-0.098941,-0.990844,-0.046968,-0.126469,-0.995025,-0.041963,-0.090304,\n\t\t\t         -0.990722,0.098758,-0.093081,-0.988403,0.095889,-0.117496,-0.988403,0.095889,-0.117496,-0.990722,0.098758,-0.093081,\n\t\t\t         -0.968902,0.224921,-0.102847,-0.967711,0.225379,-0.112766,-0.995025,-0.041963,-0.090304,-0.992828,-0.046632,-0.109836,\n\t\t\t         -0.988556,0.088778,-0.121921,-0.990722,0.098758,-0.093081,-0.990722,0.098758,-0.093081,-0.988556,0.088778,-0.121921,\n\t\t\t         -0.967681,0.211737,-0.136876,-0.968902,0.224921,-0.102847,-0.990844,-0.046968,-0.126469,-0.988403,0.095889,-0.117496,\n\t\t\t         -0.986236,0.077395,-0.145940,-0.984497,-0.060488,-0.164586,-0.984497,-0.060488,-0.164586,-0.986236,0.077395,-0.145940,\n\t\t\t         -0.985885,0.065615,-0.154033,-0.981939,-0.069471,-0.175981,-0.988403,0.095889,-0.117496,-0.967711,0.225379,-0.112766,\n\t\t\t         -0.968963,0.211371,-0.128086,-0.986236,0.077395,-0.145940,-0.986236,0.077395,-0.145940,-0.968963,0.211371,-0.128086,\n\t\t\t         -0.969846,0.204943,-0.131895,-0.985885,0.065615,-0.154033,-0.990844,-0.046968,-0.126469,-0.984497,-0.060488,-0.164586,\n\t\t\t         -0.960418,-0.212256,-0.180364,-0.969024,-0.205298,-0.137089,-0.969024,-0.205298,-0.137089,-0.960418,-0.212256,-0.180364,\n\t\t\t         -0.900296,-0.386853,-0.199377,-0.912625,-0.381848,-0.145726,-0.984497,-0.060488,-0.164586,-0.981939,-0.069471,-0.175981,\n\t\t\t         -0.956627,-0.217778,-0.193486,-0.960418,-0.212256,-0.180364,-0.960418,-0.212256,-0.180364,-0.956627,-0.217778,-0.193486,\n\t\t\t         -0.892990,-0.395112,-0.215535,-0.900296,-0.386853,-0.199377,-0.431501,0.742882,0.511734,-0.453322,0.794580,0.403851,\n\t\t\t         -0.426923,0.788232,0.443190,-0.427351,0.778436,0.459761,-0.427351,0.778436,0.459761,-0.426923,0.788232,0.443190,\n\t\t\t         -0.279519,0.814814,0.507828,-0.295236,0.846187,0.443556,-0.453322,0.794580,0.403851,-0.438581,0.897671,0.042207,\n\t\t\t         -0.392071,0.918699,0.047243,-0.426923,0.788232,0.443190,-0.426923,0.788232,0.443190,-0.392071,0.918699,0.047243,\n\t\t\t         -0.259499,0.956389,0.133976,-0.279519,0.814814,0.507828,-0.431501,0.742882,0.511734,-0.427351,0.778436,0.459761,\n\t\t\t         -0.449629,0.837794,0.309610,-0.474532,0.780633,0.406690,-0.474532,0.780633,0.406690,-0.449629,0.837794,0.309610,\n\t\t\t         -0.503616,0.849422,0.157476,-0.537767,0.793451,0.284982,-0.427351,0.778436,0.459761,-0.295236,0.846187,0.443556,\n\t\t\t         -0.316080,0.917325,0.241981,-0.449629,0.837794,0.309610,-0.449629,0.837794,0.309610,-0.316080,0.917325,0.241981,\n\t\t\t         -0.323649,0.942991,0.077303,-0.503616,0.849422,0.157476,-0.431501,0.742882,0.511734,-0.474532,0.780633,0.406690,\n\t\t\t         -0.486007,0.772423,0.408826,-0.453322,0.794580,0.403851,-0.453322,0.794580,0.403851,-0.486007,0.772423,0.408826,\n\t\t\t         -0.566240,0.790643,0.232826,-0.438581,0.897671,0.042207,-0.474532,0.780633,0.406690,-0.537767,0.793451,0.284982,\n\t\t\t         -0.626850,0.704093,0.333567,-0.486007,0.772423,0.408826,-0.486007,0.772423,0.408826,-0.626850,0.704093,0.333567,\n\t\t\t         -0.726341,0.623646,0.288827,-0.566240,0.790643,0.232826,-0.968841,0.233802,0.081515,-0.994293,0.077883,0.072787,\n\t\t\t         -0.969024,0.063753,0.238533,-0.932310,0.234291,0.275430,-0.932310,0.234291,0.275430,-0.969024,0.063753,0.238533,\n\t\t\t         -0.974487,0.067690,0.213935,-0.936796,0.249672,0.244972,-0.994293,0.077883,0.072787,-0.989196,-0.136174,0.054048,\n\t\t\t         -0.944365,-0.134281,0.300211,-0.969024,0.063753,0.238533,-0.969024,0.063753,0.238533,-0.944365,-0.134281,0.300211,\n\t\t\t         -0.957060,-0.079714,0.278634,-0.974487,0.067690,0.213935,-0.968841,0.233802,0.081515,-0.932310,0.234291,0.275430,\n\t\t\t         -0.844783,0.413648,0.339427,-0.913541,0.394513,0.098819,-0.913541,0.394513,0.098819,-0.844783,0.413648,0.339427,\n\t\t\t         -0.807550,0.492233,0.324809,-0.860256,0.492752,0.130833,-0.932310,0.234291,0.275430,-0.936796,0.249672,0.244972,\n\t\t\t         -0.864406,0.458663,0.205908,-0.844783,0.413648,0.339427,-0.844783,0.413648,0.339427,-0.864406,0.458663,0.205908,\n\t\t\t         -0.726341,0.623646,0.288827,-0.807550,0.492233,0.324809,-0.968841,0.233802,0.081515,-0.913541,0.394513,0.098819,\n\t\t\t         -0.925443,0.375103,-0.053133,-0.976104,0.215491,-0.027741,-0.976104,0.215491,-0.027741,-0.925443,0.375103,-0.053133,\n\t\t\t         -0.920865,0.385205,0.059725,-0.968932,0.231758,0.085940,-0.913541,0.394513,0.098819,-0.860256,0.492752,0.130833,\n\t\t\t         -0.861934,0.504776,-0.047426,-0.925443,0.375103,-0.053133,-0.925443,0.375103,-0.053133,-0.861934,0.504776,-0.047426,\n\t\t\t         -0.853908,0.518815,0.040712,-0.920865,0.385205,0.059725,-0.968841,0.233802,0.081515,-0.976104,0.215491,-0.027741,\n\t\t\t         -0.996979,0.076724,-0.010712,-0.994293,0.077883,0.072787,-0.994293,0.077883,0.072787,-0.996979,0.076724,-0.010712,\n\t\t\t         -0.992767,-0.107822,-0.052583,-0.989196,-0.136174,0.054048,-0.976104,0.215491,-0.027741,-0.968932,0.231758,0.085940,\n\t\t\t         -0.993011,0.066225,0.097507,-0.996979,0.076724,-0.010712,-0.996979,0.076724,-0.010712,-0.993011,0.066225,0.097507,\n\t\t\t         -0.986541,-0.139042,0.085757,-0.992767,-0.107822,-0.052583,-0.939299,0.324473,0.111301,-0.975158,0.095950,0.199591,\n\t\t\t         -0.981780,0.066225,0.178076,-0.957701,0.258644,0.125889,-0.957701,0.258644,0.125889,-0.981780,0.066225,0.178076,\n\t\t\t         -0.993011,0.066225,0.097507,-0.968932,0.231758,0.085940,-0.975158,0.095950,0.199591,-0.953093,-0.234413,0.191290,\n\t\t\t         -0.967132,-0.177190,0.182318,-0.981780,0.066225,0.178076,-0.981780,0.066225,0.178076,-0.967132,-0.177190,0.182318,\n\t\t\t         -0.986541,-0.139042,0.085757,-0.993011,0.066225,0.097507,-0.939299,0.324473,0.111301,-0.957701,0.258644,0.125889,\n\t\t\t         -0.914792,0.394024,0.088687,-0.914274,0.401440,0.053621,-0.914274,0.401440,0.053621,-0.914792,0.394024,0.088687,\n\t\t\t         -0.847743,0.525376,0.072512,-0.856594,0.512162,0.062166,-0.957701,0.258644,0.125889,-0.968932,0.231758,0.085940,\n\t\t\t         -0.920865,0.385205,0.059725,-0.914792,0.394024,0.088687,-0.914792,0.394024,0.088687,-0.920865,0.385205,0.059725,\n\t\t\t         -0.853908,0.518815,0.040712,-0.847743,0.525376,0.072512,-0.939299,0.324473,0.111301,-0.914274,0.401440,0.053621,\n\t\t\t         -0.908292,0.413434,0.063448,-0.913419,0.393109,0.105319,-0.913419,0.393109,0.105319,-0.908292,0.413434,0.063448,\n\t\t\t         -0.893521,0.441755,0.080264,-0.896847,0.428114,0.111087,-0.914274,0.401440,0.053621,-0.856594,0.512162,0.062166,\n\t\t\t         -0.875118,0.479751,0.062716,-0.908292,0.413434,0.063448,-0.908292,0.413434,0.063448,-0.875118,0.479751,0.062716,\n\t\t\t         -0.877438,0.478317,0.035127,-0.893521,0.441755,0.080264,-0.939299,0.324473,0.111301,-0.913419,0.393109,0.105319,\n\t\t\t         -0.980071,0.113590,0.162908,-0.975158,0.095950,0.199591,-0.975158,0.095950,0.199591,-0.980071,0.113590,0.162908,\n\t\t\t         -0.941374,-0.304971,0.144139,-0.953093,-0.234413,0.191290,-0.913419,0.393109,0.105319,-0.896847,0.428114,0.111087,\n\t\t\t         -0.983520,0.103305,0.148198,-0.980071,0.113590,0.162908,-0.980071,0.113590,0.162908,-0.983520,0.103305,0.148198,\n\t\t\t         -0.924253,-0.351451,0.148930,-0.941374,-0.304971,0.144139,-0.074679,0.857540,0.508927,-0.095431,0.940397,0.326395,\n\t\t\t         -0.009308,0.915403,0.402356,-0.072848,0.906827,0.415082,-0.072848,0.906827,0.415082,-0.009308,0.915403,0.402356,\n\t\t\t         0.074831,0.938871,0.336009,-0.045412,0.954680,0.294107,-0.095431,0.940397,0.326395,-0.110965,0.993774,0.008271,\n\t\t\t         -0.039399,0.998993,0.020051,-0.009308,0.915403,0.402356,-0.009308,0.915403,0.402356,-0.039399,0.998993,0.020051,\n\t\t\t         -0.025819,0.990692,0.133610,0.074831,0.938871,0.336009,-0.074679,0.857540,0.508927,-0.072848,0.906827,0.415082,\n\t\t\t         -0.125340,0.937803,0.323710,-0.135716,0.876003,0.462752,-0.135716,0.876003,0.462752,-0.125340,0.937803,0.323710,\n\t\t\t         -0.316080,0.917325,0.241981,-0.295236,0.846187,0.443556,-0.072848,0.906827,0.415082,-0.045412,0.954680,0.294107,\n\t\t\t         -0.097568,0.979644,0.175268,-0.125340,0.937803,0.323710,-0.125340,0.937803,0.323710,-0.097568,0.979644,0.175268,\n\t\t\t         -0.323649,0.942991,0.077303,-0.316080,0.917325,0.241981,-0.074679,0.857540,0.508927,-0.135716,0.876003,0.462752,\n\t\t\t         -0.103977,0.903195,0.416425,-0.095431,0.940397,0.326395,-0.095431,0.940397,0.326395,-0.103977,0.903195,0.416425,\n\t\t\t         -0.121220,0.992004,0.034913,-0.110965,0.993774,0.008271,-0.135716,0.876003,0.462752,-0.295236,0.846187,0.443556,\n\t\t\t         -0.279519,0.814814,0.507828,-0.103977,0.903195,0.416425,-0.103977,0.903195,0.416425,-0.279519,0.814814,0.507828,\n\t\t\t         -0.259499,0.956389,0.133976,-0.121220,0.992004,0.034913,-0.094058,-0.987976,-0.122623,-0.000671,-0.982299,-0.187292,\n\t\t\t         0.001343,-0.979766,-0.200018,-0.123173,-0.983703,-0.130863,-0.123173,-0.983703,-0.130863,0.001343,-0.979766,-0.200018,\n\t\t\t         -0.047609,-0.973052,-0.225501,-0.188940,-0.973662,-0.127506,-0.000671,-0.982299,-0.187292,-0.028504,-0.983428,-0.178991,\n\t\t\t         -0.003204,-0.989380,-0.145177,0.001343,-0.979766,-0.200018,0.001343,-0.979766,-0.200018,-0.003204,-0.989380,-0.145177,\n\t\t\t         0.033082,-0.980285,-0.194647,-0.047609,-0.973052,-0.225501,-0.094058,-0.987976,-0.122623,-0.123173,-0.983703,-0.130863,\n\t\t\t         -0.396588,-0.917966,-0.003174,-0.310373,-0.950316,-0.022370,-0.310373,-0.950316,-0.022370,-0.396588,-0.917966,-0.003174,\n\t\t\t         -0.501389,-0.860591,0.089267,-0.466323,-0.881191,0.077364,-0.123173,-0.983703,-0.130863,-0.188940,-0.973662,-0.127506,\n\t\t\t         -0.418928,-0.907926,0.012085,-0.396588,-0.917966,-0.003174,-0.396588,-0.917966,-0.003174,-0.418928,-0.907926,0.012085,\n\t\t\t         -0.556383,-0.825434,0.095096,-0.501389,-0.860591,0.089267,-0.094058,-0.987976,-0.122623,-0.310373,-0.950316,-0.022370,\n\t\t\t         -0.229072,-0.960418,-0.158361,-0.099246,-0.960723,-0.259102,-0.099246,-0.960723,-0.259102,-0.229072,-0.960418,-0.158361,\n\t\t\t         -0.111606,-0.973540,-0.199255,-0.025544,-0.925962,-0.376659,-0.310373,-0.950316,-0.022370,-0.466323,-0.881191,0.077364,\n\t\t\t         -0.416944,-0.907285,-0.054537,-0.229072,-0.960418,-0.158361,-0.229072,-0.960418,-0.158361,-0.416944,-0.907285,-0.054537,\n\t\t\t         -0.347880,-0.937132,-0.027039,-0.111606,-0.973540,-0.199255,-0.094058,-0.987976,-0.122623,-0.099246,-0.960723,-0.259102,\n\t\t\t         -0.003998,-0.944273,-0.329081,-0.000671,-0.982299,-0.187292,-0.000671,-0.982299,-0.187292,-0.003998,-0.944273,-0.329081,\n\t\t\t         -0.023957,-0.940336,-0.339305,-0.028504,-0.983428,-0.178991,-0.099246,-0.960723,-0.259102,-0.025544,-0.925962,-0.376659,\n\t\t\t         -0.022309,-0.908200,-0.417920,-0.003998,-0.944273,-0.329081,-0.003998,-0.944273,-0.329081,-0.022309,-0.908200,-0.417920,\n\t\t\t         -0.012574,-0.914274,-0.404859,-0.023957,-0.940336,-0.339305,0.118137,0.991150,0.060396,0.153691,0.986938,0.047945,\n\t\t\t         0.163244,0.984527,0.063173,0.107364,0.991180,0.077517,0.107364,0.991180,0.077517,0.163244,0.984527,0.063173,\n\t\t\t         0.157292,0.987365,-0.018311,0.078524,0.996887,-0.000031,0.153691,0.986938,0.047945,0.044038,0.998474,0.032472,\n\t\t\t         0.033692,0.997345,0.064516,0.163244,0.984527,0.063173,0.163244,0.984527,0.063173,0.033692,0.997345,0.064516,\n\t\t\t         0.020692,0.999756,-0.005737,0.157292,0.987365,-0.018311,0.118137,0.991150,0.060396,0.107364,0.991180,0.077517,\n\t\t\t         -0.020844,0.993896,0.108280,0.042970,0.991546,0.122410,0.042970,0.991546,0.122410,-0.020844,0.993896,0.108280,\n\t\t\t         -0.097568,0.979644,0.175268,-0.045412,0.954680,0.294107,0.107364,0.991180,0.077517,0.078524,0.996887,-0.000031,\n\t\t\t         -0.084964,0.995697,0.036714,-0.020844,0.993896,0.108280,-0.020844,0.993896,0.108280,-0.084964,0.995697,0.036714,\n\t\t\t         -0.323649,0.942991,0.077303,-0.097568,0.979644,0.175268,0.118137,0.991150,0.060396,0.042970,0.991546,0.122410,\n\t\t\t         0.129154,0.971038,0.200934,0.153691,0.986938,0.047945,0.153691,0.986938,0.047945,0.129154,0.971038,0.200934,\n\t\t\t         0.036164,0.979400,0.198553,0.044038,0.998474,0.032472,0.042970,0.991546,0.122410,-0.045412,0.954680,0.294107,\n\t\t\t         0.074831,0.938871,0.336009,0.129154,0.971038,0.200934,0.129154,0.971038,0.200934,0.074831,0.938871,0.336009,\n\t\t\t         -0.025819,0.990692,0.133610,0.036164,0.979400,0.198553,-0.688589,0.724998,0.013123,-0.623829,0.772759,0.116947,\n\t\t\t         -0.588183,0.805109,0.076052,-0.684957,0.728294,0.019471,-0.684957,0.728294,0.019471,-0.588183,0.805109,0.076052,\n\t\t\t         -0.555376,0.830470,0.042634,-0.676077,0.736045,0.033876,-0.623829,0.772759,0.116947,-0.537767,0.793451,0.284982,\n\t\t\t         -0.503616,0.849422,0.157476,-0.588183,0.805109,0.076052,-0.588183,0.805109,0.076052,-0.503616,0.849422,0.157476,\n\t\t\t         -0.323649,0.942991,0.077303,-0.555376,0.830470,0.042634,-0.688589,0.724998,0.013123,-0.684957,0.728294,0.019471,\n\t\t\t         -0.779138,0.626209,-0.027802,-0.779443,0.620655,0.084811,-0.779443,0.620655,0.084811,-0.779138,0.626209,-0.027802,\n\t\t\t         -0.861934,0.504776,-0.047426,-0.860256,0.492752,0.130833,-0.684957,0.728294,0.019471,-0.676077,0.736045,0.033876,\n\t\t\t         -0.771783,0.634999,0.033418,-0.779138,0.626209,-0.027802,-0.779138,0.626209,-0.027802,-0.771783,0.634999,0.033418,\n\t\t\t         -0.853908,0.518815,0.040712,-0.861934,0.504776,-0.047426,-0.688589,0.724998,0.013123,-0.779443,0.620655,0.084811,\n\t\t\t         -0.721183,0.655599,0.223640,-0.623829,0.772759,0.116947,-0.623829,0.772759,0.116947,-0.721183,0.655599,0.223640,\n\t\t\t         -0.626850,0.704093,0.333567,-0.537767,0.793451,0.284982,-0.779443,0.620655,0.084811,-0.860256,0.492752,0.130833,\n\t\t\t         -0.807550,0.492233,0.324809,-0.721183,0.655599,0.223640,-0.721183,0.655599,0.223640,-0.807550,0.492233,0.324809,\n\t\t\t         -0.726341,0.623646,0.288827,-0.626850,0.704093,0.333567,-0.632038,0.774865,0.009033,-0.747154,0.661946,0.059267,\n\t\t\t         -0.760063,0.648183,0.045808,-0.660878,0.750359,0.012452,-0.660878,0.750359,0.012452,-0.760063,0.648183,0.045808,\n\t\t\t         -0.771783,0.634999,0.033418,-0.676077,0.736045,0.033876,-0.747154,0.661946,0.059267,-0.856594,0.512162,0.062166,\n\t\t\t         -0.847743,0.525376,0.072512,-0.760063,0.648183,0.045808,-0.760063,0.648183,0.045808,-0.847743,0.525376,0.072512,\n\t\t\t         -0.853908,0.518815,0.040712,-0.771783,0.634999,0.033418,-0.632038,0.774865,0.009033,-0.660878,0.750359,0.012452,\n\t\t\t         -0.530961,0.847255,-0.013825,-0.503769,0.862239,-0.052339,-0.503769,0.862239,-0.052339,-0.530961,0.847255,-0.013825,\n\t\t\t         -0.335368,0.941069,-0.043092,-0.298746,0.947386,-0.114780,-0.660878,0.750359,0.012452,-0.676077,0.736045,0.033876,\n\t\t\t         -0.555376,0.830470,0.042634,-0.530961,0.847255,-0.013825,-0.530961,0.847255,-0.013825,-0.555376,0.830470,0.042634,\n\t\t\t         -0.323649,0.942991,0.077303,-0.335368,0.941069,-0.043092,-0.632038,0.774865,0.009033,-0.503769,0.862239,-0.052339,\n\t\t\t         -0.454299,0.885800,-0.094485,-0.588824,0.808252,-0.000488,-0.588824,0.808252,-0.000488,-0.454299,0.885800,-0.094485,\n\t\t\t         -0.403302,0.902737,-0.149510,-0.562395,0.824122,-0.066805,-0.503769,0.862239,-0.052339,-0.298746,0.947386,-0.114780,\n\t\t\t         -0.219001,0.957030,-0.190008,-0.454299,0.885800,-0.094485,-0.454299,0.885800,-0.094485,-0.219001,0.957030,-0.190008,\n\t\t\t         -0.076998,0.950041,-0.302377,-0.403302,0.902737,-0.149510,-0.632038,0.774865,0.009033,-0.588824,0.808252,-0.000488,\n\t\t\t         -0.749107,0.659658,0.060152,-0.747154,0.661946,0.059267,-0.747154,0.661946,0.059267,-0.749107,0.659658,0.060152,\n\t\t\t         -0.875118,0.479751,0.062716,-0.856594,0.512162,0.062166,-0.588824,0.808252,-0.000488,-0.562395,0.824122,-0.066805,\n\t\t\t         -0.771813,0.635823,-0.004181,-0.749107,0.659658,0.060152,-0.749107,0.659658,0.060152,-0.771813,0.635823,-0.004181,\n\t\t\t         -0.877438,0.478317,0.035127,-0.875118,0.479751,0.062716,0.107944,0.955931,-0.272927,-0.060884,0.979217,-0.193396,\n\t\t\t         -0.113529,0.989380,-0.090548,0.069979,0.986724,-0.146519,0.069979,0.986724,-0.146519,-0.113529,0.989380,-0.090548,\n\t\t\t         -0.084964,0.995697,0.036714,0.078524,0.996887,-0.000031,-0.060884,0.979217,-0.193396,-0.298746,0.947386,-0.114780,\n\t\t\t         -0.335368,0.941069,-0.043092,-0.113529,0.989380,-0.090548,-0.113529,0.989380,-0.090548,-0.335368,0.941069,-0.043092,\n\t\t\t         -0.323649,0.942991,0.077303,-0.084964,0.995697,0.036714,0.107944,0.955931,-0.272927,0.069979,0.986724,-0.146519,\n\t\t\t         0.145177,0.973388,-0.177129,0.149510,0.934721,-0.322367,0.149510,0.934721,-0.322367,0.145177,0.973388,-0.177129,\n\t\t\t         0.010926,0.984313,-0.176061,0.004822,0.943205,-0.332102,0.069979,0.986724,-0.146519,0.078524,0.996887,-0.000031,\n\t\t\t         0.157292,0.987365,-0.018311,0.145177,0.973388,-0.177129,0.145177,0.973388,-0.177129,0.157292,0.987365,-0.018311,\n\t\t\t         0.020692,0.999756,-0.005737,0.010926,0.984313,-0.176061,0.107944,0.955931,-0.272927,0.149510,0.934721,-0.322367,\n\t\t\t         0.168004,0.866482,-0.470046,0.183325,0.897610,-0.400800,0.183325,0.897610,-0.400800,0.168004,0.866482,-0.470046,\n\t\t\t         0.193732,0.746757,-0.636219,0.277230,0.791681,-0.544389,0.149510,0.934721,-0.322367,0.004822,0.943205,-0.332102,\n\t\t\t         0.000824,0.871212,-0.490860,0.168004,0.866482,-0.470046,0.168004,0.866482,-0.470046,0.000824,0.871212,-0.490860,\n\t\t\t         -0.005982,0.726646,-0.686972,0.193732,0.746757,-0.636219,0.107944,0.955931,-0.272927,0.183325,0.897610,-0.400800,\n\t\t\t         0.055452,0.953551,-0.295969,-0.060884,0.979217,-0.193396,-0.060884,0.979217,-0.193396,0.055452,0.953551,-0.295969,\n\t\t\t         -0.219001,0.957030,-0.190008,-0.298746,0.947386,-0.114780,0.183325,0.897610,-0.400800,0.277230,0.791681,-0.544389,\n\t\t\t         0.216224,0.879116,-0.424696,0.055452,0.953551,-0.295969,0.055452,0.953551,-0.295969,0.216224,0.879116,-0.424696,\n\t\t\t         -0.076998,0.950041,-0.302377,-0.219001,0.957030,-0.190008,0.468795,0.527177,-0.708701,0.307321,0.479232,-0.822077,\n\t\t\t         0.484512,0.412214,-0.771538,0.562944,0.514328,-0.646931,0.562944,0.514328,-0.646931,0.484512,0.412214,-0.771538,\n\t\t\t         0.713309,0.308512,-0.629261,0.686789,0.506119,-0.521622,0.307321,0.479232,-0.822077,-0.043825,0.445662,-0.894101,\n\t\t\t         -0.028230,0.327952,-0.944243,0.484512,0.412214,-0.771538,0.484512,0.412214,-0.771538,-0.028230,0.327952,-0.944243,\n\t\t\t         -0.001495,-0.129490,-0.991546,0.713309,0.308512,-0.629261,0.468795,0.527177,-0.708701,0.562944,0.514328,-0.646931,\n\t\t\t         0.662465,0.516007,-0.542955,0.585498,0.588000,-0.558031,0.585498,0.588000,-0.558031,0.662465,0.516007,-0.542955,\n\t\t\t         0.728111,0.524033,-0.441786,0.568377,0.689413,-0.449049,0.562944,0.514328,-0.646931,0.686789,0.506119,-0.521622,\n\t\t\t         0.685537,0.558611,-0.466842,0.662465,0.516007,-0.542955,0.662465,0.516007,-0.542955,0.685537,0.558611,-0.466842,\n\t\t\t         0.759911,0.497299,-0.418561,0.728111,0.524033,-0.441786,0.468795,0.527177,-0.708701,0.585498,0.588000,-0.558031,\n\t\t\t         0.411695,0.747032,-0.521897,0.377209,0.643941,-0.665578,0.377209,0.643941,-0.665578,0.411695,0.747032,-0.521897,\n\t\t\t         0.216224,0.879116,-0.424696,0.277230,0.791681,-0.544389,0.585498,0.588000,-0.558031,0.568377,0.689413,-0.449049,\n\t\t\t         0.315867,0.845607,-0.430280,0.411695,0.747032,-0.521897,0.411695,0.747032,-0.521897,0.315867,0.845607,-0.430280,\n\t\t\t         -0.076998,0.950041,-0.302377,0.216224,0.879116,-0.424696,0.468795,0.527177,-0.708701,0.377209,0.643941,-0.665578,\n\t\t\t         0.228980,0.582263,-0.780053,0.307321,0.479232,-0.822077,0.307321,0.479232,-0.822077,0.228980,0.582263,-0.780053,\n\t\t\t         -0.036012,0.570574,-0.820429,-0.043825,0.445662,-0.894101,0.377209,0.643941,-0.665578,0.277230,0.791681,-0.544389,\n\t\t\t         0.193732,0.746757,-0.636219,0.228980,0.582263,-0.780053,0.228980,0.582263,-0.780053,0.193732,0.746757,-0.636219,\n\t\t\t         -0.005982,0.726646,-0.686972,-0.036012,0.570574,-0.820429,0.313486,-0.649068,-0.693106,0.307413,-0.716514,-0.626148,\n\t\t\t         0.467940,-0.743095,-0.478347,0.473739,-0.640248,-0.604663,0.473739,-0.640248,-0.604663,0.467940,-0.743095,-0.478347,\n\t\t\t         0.675558,-0.703574,-0.220313,0.659810,-0.650441,-0.376202,0.307413,-0.716514,-0.626148,0.223395,-0.861110,-0.456679,\n\t\t\t         0.392163,-0.883938,-0.254555,0.467940,-0.743095,-0.478347,0.467940,-0.743095,-0.478347,0.392163,-0.883938,-0.254555,\n\t\t\t         0.483535,-0.874172,-0.044099,0.675558,-0.703574,-0.220313,0.313486,-0.649068,-0.693106,0.473739,-0.640248,-0.604663,\n\t\t\t         0.373394,-0.537889,-0.755791,0.178625,-0.605304,-0.775658,0.178625,-0.605304,-0.775658,0.373394,-0.537889,-0.755791,\n\t\t\t         -0.001221,-0.460158,-0.887814,-0.001160,-0.577776,-0.816157,0.473739,-0.640248,-0.604663,0.659810,-0.650441,-0.376202,\n\t\t\t         0.665822,-0.506851,-0.547472,0.373394,-0.537889,-0.755791,0.373394,-0.537889,-0.755791,0.665822,-0.506851,-0.547472,\n\t\t\t         -0.001495,-0.129490,-0.991546,-0.001221,-0.460158,-0.887814,0.313486,-0.649068,-0.693106,0.178625,-0.605304,-0.775658,\n\t\t\t         0.135777,-0.701529,-0.699576,0.307413,-0.716514,-0.626148,0.307413,-0.716514,-0.626148,0.135777,-0.701529,-0.699576,\n\t\t\t         0.136082,-0.824030,-0.549944,0.223395,-0.861110,-0.456679,0.178625,-0.605304,-0.775658,-0.001160,-0.577776,-0.816157,\n\t\t\t         -0.000977,-0.690085,-0.723716,0.135777,-0.701529,-0.699576,0.135777,-0.701529,-0.699576,-0.000977,-0.690085,-0.723716,\n\t\t\t         0.002564,-0.814478,-0.580126,0.136082,-0.824030,-0.549944,0.073092,-0.983978,-0.162542,-0.020081,-0.961638,-0.273476,\n\t\t\t         -0.050966,-0.942595,-0.329966,0.035432,-0.961760,-0.271554,0.035432,-0.961760,-0.271554,-0.050966,-0.942595,-0.329966,\n\t\t\t         -0.022309,-0.908200,-0.417920,-0.025544,-0.925962,-0.376659,-0.020081,-0.961638,-0.273476,0.004486,-0.945799,-0.324656,\n\t\t\t         -0.003235,-0.946837,-0.321635,-0.050966,-0.942595,-0.329966,-0.050966,-0.942595,-0.329966,-0.003235,-0.946837,-0.321635,\n\t\t\t         -0.012574,-0.914274,-0.404859,-0.022309,-0.908200,-0.417920,0.073092,-0.983978,-0.162542,0.035432,-0.961760,-0.271554,\n\t\t\t         0.110935,-0.991729,-0.064333,0.282723,-0.958800,-0.027375,0.282723,-0.958800,-0.027375,0.110935,-0.991729,-0.064333,\n\t\t\t         -0.141392,-0.989898,-0.010132,0.105686,-0.993988,0.027497,0.035432,-0.961760,-0.271554,-0.025544,-0.925962,-0.376659,\n\t\t\t         -0.111606,-0.973540,-0.199255,0.110935,-0.991729,-0.064333,0.110935,-0.991729,-0.064333,-0.111606,-0.973540,-0.199255,\n\t\t\t         -0.347880,-0.937132,-0.027039,-0.141392,-0.989898,-0.010132,0.073092,-0.983978,-0.162542,0.282723,-0.958800,-0.027375,\n\t\t\t         0.291482,-0.951720,-0.095889,0.113041,-0.965300,-0.235328,0.113041,-0.965300,-0.235328,0.291482,-0.951720,-0.095889,\n\t\t\t         0.392163,-0.883938,-0.254555,0.223395,-0.861110,-0.456679,0.282723,-0.958800,-0.027375,0.105686,-0.993988,0.027497,\n\t\t\t         0.328959,-0.944304,0.007569,0.291482,-0.951720,-0.095889,0.291482,-0.951720,-0.095889,0.328959,-0.944304,0.007569,\n\t\t\t         0.483535,-0.874172,-0.044099,0.392163,-0.883938,-0.254555,0.073092,-0.983978,-0.162542,0.113041,-0.965300,-0.235328,\n\t\t\t         0.073855,-0.931516,-0.356059,-0.020081,-0.961638,-0.273476,-0.020081,-0.961638,-0.273476,0.073855,-0.931516,-0.356059,\n\t\t\t         0.006073,-0.903012,-0.429487,0.004486,-0.945799,-0.324656,0.113041,-0.965300,-0.235328,0.223395,-0.861110,-0.456679,\n\t\t\t         0.136082,-0.824030,-0.549944,0.073855,-0.931516,-0.356059,0.073855,-0.931516,-0.356059,0.136082,-0.824030,-0.549944,\n\t\t\t         0.002564,-0.814478,-0.580126,0.006073,-0.903012,-0.429487,-0.781487,-0.611347,0.124363,-0.801630,-0.597766,-0.005341,\n\t\t\t         -0.613849,-0.789392,0.000458,-0.618458,-0.780084,0.094546,-0.618458,-0.780084,0.094546,-0.613849,-0.789392,0.000458,\n\t\t\t         -0.416944,-0.907285,-0.054537,-0.466323,-0.881191,0.077364,-0.801630,-0.597766,-0.005341,-0.797204,-0.598407,0.079684,\n\t\t\t         -0.617084,-0.784173,0.065004,-0.613849,-0.789392,0.000458,-0.613849,-0.789392,0.000458,-0.617084,-0.784173,0.065004,\n\t\t\t         -0.347880,-0.937132,-0.027039,-0.416944,-0.907285,-0.054537,-0.781487,-0.611347,0.124363,-0.618458,-0.780084,0.094546,\n\t\t\t         -0.629719,-0.762200,0.149846,-0.739341,-0.637806,0.215705,-0.739341,-0.637806,0.215705,-0.629719,-0.762200,0.149846,\n\t\t\t         -0.648640,-0.738823,0.182714,-0.780480,-0.577074,0.240364,-0.618458,-0.780084,0.094546,-0.466323,-0.881191,0.077364,\n\t\t\t         -0.501389,-0.860591,0.089267,-0.629719,-0.762200,0.149846,-0.629719,-0.762200,0.149846,-0.501389,-0.860591,0.089267,\n\t\t\t         -0.556383,-0.825434,0.095096,-0.648640,-0.738823,0.182714,-0.781487,-0.611347,0.124363,-0.739341,-0.637806,0.215705,\n\t\t\t         -0.898648,-0.347301,0.267922,-0.910062,-0.404462,0.090396,-0.910062,-0.404462,0.090396,-0.898648,-0.347301,0.267922,\n\t\t\t         -0.944365,-0.134281,0.300211,-0.989196,-0.136174,0.054048,-0.739341,-0.637806,0.215705,-0.780480,-0.577074,0.240364,\n\t\t\t         -0.876278,-0.384411,0.290414,-0.898648,-0.347301,0.267922,-0.898648,-0.347301,0.267922,-0.876278,-0.384411,0.290414,\n\t\t\t         -0.957060,-0.079714,0.278634,-0.944365,-0.134281,0.300211,-0.781487,-0.611347,0.124363,-0.910062,-0.404462,0.090396,\n\t\t\t         -0.914945,-0.402814,-0.023469,-0.801630,-0.597766,-0.005341,-0.801630,-0.597766,-0.005341,-0.914945,-0.402814,-0.023469,\n\t\t\t         -0.922971,-0.377483,0.074709,-0.797204,-0.598407,0.079684,-0.910062,-0.404462,0.090396,-0.989196,-0.136174,0.054048,\n\t\t\t         -0.992767,-0.107822,-0.052583,-0.914945,-0.402814,-0.023469,-0.914945,-0.402814,-0.023469,-0.992767,-0.107822,-0.052583,\n\t\t\t         -0.986541,-0.139042,0.085757,-0.922971,-0.377483,0.074709,0.064364,-0.977386,0.201300,0.077578,-0.984832,0.155065,\n\t\t\t         0.090701,-0.994446,0.053285,-0.089969,-0.993133,0.074526,-0.089969,-0.993133,0.074526,0.090701,-0.994446,0.053285,\n\t\t\t         0.328959,-0.944304,0.007569,0.105686,-0.993988,0.027497,0.077578,-0.984832,0.155065,0.169836,-0.981933,0.083132,\n\t\t\t         0.270730,-0.962523,0.015137,0.090701,-0.994446,0.053285,0.090701,-0.994446,0.053285,0.270730,-0.962523,0.015137,\n\t\t\t         0.483535,-0.874172,-0.044099,0.328959,-0.944304,0.007569,0.064364,-0.977386,0.201300,-0.089969,-0.993133,0.074526,\n\t\t\t         -0.182470,-0.980712,0.069582,-0.142186,-0.962004,0.232978,-0.142186,-0.962004,0.232978,-0.182470,-0.980712,0.069582,\n\t\t\t         -0.387921,-0.910886,0.140599,-0.453322,-0.868892,0.198675,-0.089969,-0.993133,0.074526,0.105686,-0.993988,0.027497,\n\t\t\t         -0.141392,-0.989898,-0.010132,-0.182470,-0.980712,0.069582,-0.182470,-0.980712,0.069582,-0.141392,-0.989898,-0.010132,\n\t\t\t         -0.347880,-0.937132,-0.027039,-0.387921,-0.910886,0.140599,0.064364,-0.977386,0.201300,-0.142186,-0.962004,0.232978,\n\t\t\t         -0.175451,-0.964965,0.194922,0.077578,-0.984832,0.155065,0.077578,-0.984832,0.155065,-0.175451,-0.964965,0.194922,\n\t\t\t         -0.157659,-0.974731,0.158147,0.169836,-0.981933,0.083132,-0.142186,-0.962004,0.232978,-0.453322,-0.868892,0.198675,\n\t\t\t         -0.565966,-0.812250,0.140996,-0.175451,-0.964965,0.194922,-0.175451,-0.964965,0.194922,-0.565966,-0.812250,0.140996,\n\t\t\t         -0.588855,-0.796228,0.138737,-0.157659,-0.974731,0.158147,-0.805872,-0.571947,0.152928,-0.634175,-0.757012,0.157140,\n\t\t\t         -0.611866,-0.772851,0.168065,-0.799280,-0.578173,0.163732,-0.799280,-0.578173,0.163732,-0.611866,-0.772851,0.168065,\n\t\t\t         -0.617084,-0.784173,0.065004,-0.797204,-0.598407,0.079684,-0.634175,-0.757012,0.157140,-0.453322,-0.868892,0.198675,\n\t\t\t         -0.387921,-0.910886,0.140599,-0.611866,-0.772851,0.168065,-0.611866,-0.772851,0.168065,-0.387921,-0.910886,0.140599,\n\t\t\t         -0.347880,-0.937132,-0.027039,-0.617084,-0.784173,0.065004,-0.805872,-0.571947,0.152928,-0.799280,-0.578173,0.163732,\n\t\t\t         -0.909421,-0.384869,0.157476,-0.906766,-0.396161,0.144230,-0.906766,-0.396161,0.144230,-0.909421,-0.384869,0.157476,\n\t\t\t         -0.967132,-0.177190,0.182318,-0.953093,-0.234413,0.191290,-0.799280,-0.578173,0.163732,-0.797204,-0.598407,0.079684,\n\t\t\t         -0.922971,-0.377483,0.074709,-0.909421,-0.384869,0.157476,-0.909421,-0.384869,0.157476,-0.922971,-0.377483,0.074709,\n\t\t\t         -0.986541,-0.139042,0.085757,-0.967132,-0.177190,0.182318,-0.805872,-0.571947,0.152928,-0.906766,-0.396161,0.144230,\n\t\t\t         -0.906857,-0.410352,0.095828,-0.822535,-0.563738,0.074953,-0.822535,-0.563738,0.074953,-0.906857,-0.410352,0.095828,\n\t\t\t         -0.882809,-0.456496,0.110538,-0.840846,-0.538011,0.058687,-0.906766,-0.396161,0.144230,-0.953093,-0.234413,0.191290,\n\t\t\t         -0.941374,-0.304971,0.144139,-0.906857,-0.410352,0.095828,-0.906857,-0.410352,0.095828,-0.941374,-0.304971,0.144139,\n\t\t\t         -0.924253,-0.351451,0.148930,-0.882809,-0.456496,0.110538,-0.805872,-0.571947,0.152928,-0.822535,-0.563738,0.074953,\n\t\t\t         -0.666402,-0.740410,0.087527,-0.634175,-0.757012,0.157140,-0.634175,-0.757012,0.157140,-0.666402,-0.740410,0.087527,\n\t\t\t         -0.565966,-0.812250,0.140996,-0.453322,-0.868892,0.198675,-0.822535,-0.563738,0.074953,-0.840846,-0.538011,0.058687,\n\t\t\t         -0.725150,-0.683859,0.080233,-0.666402,-0.740410,0.087527,-0.666402,-0.740410,0.087527,-0.725150,-0.683859,0.080233,\n\t\t\t         -0.588855,-0.796228,0.138737,-0.565966,-0.812250,0.140996,-0.778405,-0.621021,0.091647,-0.811243,-0.575549,0.102969,\n\t\t\t         -0.777734,-0.619861,0.104160,-0.799860,-0.593097,0.091891,-0.799860,-0.593097,0.091891,-0.777734,-0.619861,0.104160,\n\t\t\t         -0.725150,-0.683859,0.080233,-0.840846,-0.538011,0.058687,-0.811243,-0.575549,0.102969,-0.593829,-0.795312,0.121738,\n\t\t\t         -0.590533,-0.793023,0.149541,-0.777734,-0.619861,0.104160,-0.777734,-0.619861,0.104160,-0.590533,-0.793023,0.149541,\n\t\t\t         -0.588855,-0.796228,0.138737,-0.725150,-0.683859,0.080233,-0.778405,-0.621021,0.091647,-0.799860,-0.593097,0.091891,\n\t\t\t         -0.836299,-0.529832,0.140690,-0.813227,-0.571795,0.108097,-0.813227,-0.571795,0.108097,-0.836299,-0.529832,0.140690,\n\t\t\t         -0.915433,-0.365307,0.168767,-0.917020,-0.378521,0.125523,-0.799860,-0.593097,0.091891,-0.840846,-0.538011,0.058687,\n\t\t\t         -0.882809,-0.456496,0.110538,-0.836299,-0.529832,0.140690,-0.836299,-0.529832,0.140690,-0.882809,-0.456496,0.110538,\n\t\t\t         -0.924253,-0.351451,0.148930,-0.915433,-0.365307,0.168767,-0.778405,-0.621021,0.091647,-0.813227,-0.571795,0.108097,\n\t\t\t         -0.812860,-0.579455,0.058870,-0.789605,-0.610218,0.064272,-0.789605,-0.610218,0.064272,-0.812860,-0.579455,0.058870,\n\t\t\t         -0.825953,-0.563128,0.025575,-0.821009,-0.569353,0.041566,-0.813227,-0.571795,0.108097,-0.917020,-0.378521,0.125523,\n\t\t\t         -0.911466,-0.404553,0.074313,-0.812860,-0.579455,0.058870,-0.812860,-0.579455,0.058870,-0.911466,-0.404553,0.074313,\n\t\t\t         -0.898801,-0.436995,0.033570,-0.825953,-0.563128,0.025575,-0.778405,-0.621021,0.091647,-0.789605,-0.610218,0.064272,\n\t\t\t         -0.832209,-0.547716,0.085879,-0.811243,-0.575549,0.102969,-0.811243,-0.575549,0.102969,-0.832209,-0.547716,0.085879,\n\t\t\t         -0.583758,-0.808405,0.075350,-0.593829,-0.795312,0.121738,-0.789605,-0.610218,0.064272,-0.821009,-0.569353,0.041566,\n\t\t\t         -0.830958,-0.553972,0.050874,-0.832209,-0.547716,0.085879,-0.832209,-0.547716,0.085879,-0.830958,-0.553972,0.050874,\n\t\t\t         -0.547288,-0.836879,0.008271,-0.583758,-0.808405,0.075350,0.280770,-0.957976,0.058168,0.372845,-0.927610,0.021760,\n\t\t\t         0.290262,-0.955992,0.042146,0.249336,-0.965819,0.070559,0.249336,-0.965819,0.070559,0.290262,-0.955992,0.042146,\n\t\t\t         0.270730,-0.962523,0.015137,0.169836,-0.981933,0.083132,0.372845,-0.927610,0.021760,0.530656,-0.847072,0.029115,\n\t\t\t         0.541307,-0.839869,0.039674,0.290262,-0.955992,0.042146,0.290262,-0.955992,0.042146,0.541307,-0.839869,0.039674,\n\t\t\t         0.483535,-0.874172,-0.044099,0.270730,-0.962523,0.015137,0.280770,-0.957976,0.058168,0.249336,-0.965819,0.070559,\n\t\t\t         -0.132054,-0.982025,0.134831,-0.110233,-0.989593,0.092441,-0.110233,-0.989593,0.092441,-0.132054,-0.982025,0.134831,\n\t\t\t         -0.590533,-0.793023,0.149541,-0.593829,-0.795312,0.121738,0.249336,-0.965819,0.070559,0.169836,-0.981933,0.083132,\n\t\t\t         -0.157659,-0.974731,0.158147,-0.132054,-0.982025,0.134831,-0.132054,-0.982025,0.134831,-0.157659,-0.974731,0.158147,\n\t\t\t         -0.588855,-0.796228,0.138737,-0.590533,-0.793023,0.149541,0.280770,-0.957976,0.058168,-0.110233,-0.989593,0.092441,\n\t\t\t         -0.107608,-0.993530,0.035859,0.272713,-0.961913,0.017884,0.272713,-0.961913,0.017884,-0.107608,-0.993530,0.035859,\n\t\t\t         -0.132206,-0.990631,-0.033357,0.219550,-0.974029,-0.054933,-0.110233,-0.989593,0.092441,-0.593829,-0.795312,0.121738,\n\t\t\t         -0.583758,-0.808405,0.075350,-0.107608,-0.993530,0.035859,-0.107608,-0.993530,0.035859,-0.583758,-0.808405,0.075350,\n\t\t\t         -0.547288,-0.836879,0.008271,-0.132206,-0.990631,-0.033357,0.280770,-0.957976,0.058168,0.272713,-0.961913,0.017884,\n\t\t\t         0.423566,-0.905606,-0.020783,0.372845,-0.927610,0.021760,0.372845,-0.927610,0.021760,0.423566,-0.905606,-0.020783,\n\t\t\t         0.424268,-0.903317,-0.063021,0.530656,-0.847072,0.029115,0.272713,-0.961913,0.017884,0.219550,-0.974029,-0.054933,\n\t\t\t         0.443007,-0.893643,-0.071596,0.423566,-0.905606,-0.020783,0.423566,-0.905606,-0.020783,0.443007,-0.893643,-0.071596,\n\t\t\t         0.498550,-0.861293,-0.097995,0.424268,-0.903317,-0.063021,-0.625660,0.775475,-0.084536,-0.798212,0.601794,-0.025422,\n\t\t\t         -0.794580,0.605884,-0.038728,-0.579241,0.807764,-0.109378,-0.579241,0.807764,-0.109378,-0.794580,0.605884,-0.038728,\n\t\t\t         -0.771813,0.635823,-0.004181,-0.562395,0.824122,-0.066805,-0.798212,0.601794,-0.025422,-0.819208,0.573382,0.008484,\n\t\t\t         -0.853389,0.521165,0.009156,-0.794580,0.605884,-0.038728,-0.794580,0.605884,-0.038728,-0.853389,0.521165,0.009156,\n\t\t\t         -0.877438,0.478317,0.035127,-0.771813,0.635823,-0.004181,-0.625660,0.775475,-0.084536,-0.579241,0.807764,-0.109378,\n\t\t\t         -0.370586,0.911771,-0.176916,-0.354442,0.921690,-0.157476,-0.354442,0.921690,-0.157476,-0.370586,0.911771,-0.176916,\n\t\t\t         -0.142796,0.947233,-0.286935,-0.130345,0.958495,-0.253517,-0.579241,0.807764,-0.109378,-0.562395,0.824122,-0.066805,\n\t\t\t         -0.403302,0.902737,-0.149510,-0.370586,0.911771,-0.176916,-0.370586,0.911771,-0.176916,-0.403302,0.902737,-0.149510,\n\t\t\t         -0.076998,0.950041,-0.302377,-0.142796,0.947233,-0.286935,-0.625660,0.775475,-0.084536,-0.354442,0.921690,-0.157476,\n\t\t\t         -0.363109,0.920255,-0.145787,-0.664235,0.744499,-0.066866,-0.664235,0.744499,-0.066866,-0.363109,0.920255,-0.145787,\n\t\t\t         -0.373180,0.917478,-0.137547,-0.632374,0.772423,-0.058412,-0.354442,0.921690,-0.157476,-0.130345,0.958495,-0.253517,\n\t\t\t         -0.049226,0.967406,-0.248299,-0.363109,0.920255,-0.145787,-0.363109,0.920255,-0.145787,-0.049226,0.967406,-0.248299,\n\t\t\t         0.012513,0.976318,-0.215857,-0.373180,0.917478,-0.137547,-0.625660,0.775475,-0.084536,-0.664235,0.744499,-0.066866,\n\t\t\t         -0.778771,0.627094,-0.014649,-0.798212,0.601794,-0.025422,-0.798212,0.601794,-0.025422,-0.778771,0.627094,-0.014649,\n\t\t\t         -0.791192,0.611286,0.017273,-0.819208,0.573382,0.008484,-0.664235,0.744499,-0.066866,-0.632374,0.772423,-0.058412,\n\t\t\t         -0.719718,0.694235,0.000549,-0.778771,0.627094,-0.014649,-0.778771,0.627094,-0.014649,-0.719718,0.694235,0.000549,\n\t\t\t         -0.768700,0.638539,0.036592,-0.791192,0.611286,0.017273,0.471358,0.787286,-0.397443,0.505325,0.757653,-0.412976,\n\t\t\t         0.724082,0.569689,-0.388745,0.700949,0.607929,-0.372875,0.700949,0.607929,-0.372875,0.724082,0.569689,-0.388745,\n\t\t\t         0.776482,0.517808,-0.359050,0.766198,0.559313,-0.316355,0.505325,0.757653,-0.412976,0.568377,0.689413,-0.449049,\n\t\t\t         0.728111,0.524033,-0.441786,0.724082,0.569689,-0.388745,0.724082,0.569689,-0.388745,0.728111,0.524033,-0.441786,\n\t\t\t         0.759911,0.497299,-0.418561,0.776482,0.517808,-0.359050,0.471358,0.787286,-0.397443,0.700949,0.607929,-0.372875,\n\t\t\t         0.659871,0.669607,-0.340800,0.462569,0.803217,-0.375286,0.462569,0.803217,-0.375286,0.659871,0.669607,-0.340800,\n\t\t\t         0.588641,0.772149,-0.239265,0.462020,0.843379,-0.274270,0.700949,0.607929,-0.372875,0.766198,0.559313,-0.316355,\n\t\t\t         0.720481,0.642201,-0.261605,0.659871,0.669607,-0.340800,0.659871,0.669607,-0.340800,0.720481,0.642201,-0.261605,\n\t\t\t         0.656972,0.730796,-0.185217,0.588641,0.772149,-0.239265,0.471358,0.787286,-0.397443,0.462569,0.803217,-0.375286,\n\t\t\t         0.232795,0.910062,-0.342845,0.207495,0.908383,-0.362926,0.207495,0.908383,-0.362926,0.232795,0.910062,-0.342845,\n\t\t\t         -0.049226,0.967406,-0.248299,-0.130345,0.958495,-0.253517,0.462569,0.803217,-0.375286,0.462020,0.843379,-0.274270,\n\t\t\t         0.281503,0.922452,-0.264199,0.232795,0.910062,-0.342845,0.232795,0.910062,-0.342845,0.281503,0.922452,-0.264199,\n\t\t\t         0.012513,0.976318,-0.215857,-0.049226,0.967406,-0.248299,0.471358,0.787286,-0.397443,0.207495,0.908383,-0.362926,\n\t\t\t         0.230049,0.890378,-0.392743,0.505325,0.757653,-0.412976,0.505325,0.757653,-0.412976,0.230049,0.890378,-0.392743,\n\t\t\t         0.315867,0.845607,-0.430280,0.568377,0.689413,-0.449049,0.207495,0.908383,-0.362926,-0.130345,0.958495,-0.253517,\n\t\t\t         -0.142796,0.947233,-0.286935,0.230049,0.890378,-0.392743,0.230049,0.890378,-0.392743,-0.142796,0.947233,-0.286935,\n\t\t\t         -0.076998,0.950041,-0.302377,0.315867,0.845607,-0.430280,-0.885983,0.452376,0.101596,-0.990814,0.020203,0.133580,\n\t\t\t         -0.985015,0.067904,0.158361,-0.888455,0.444166,0.115452,-0.888455,0.444166,0.115452,-0.985015,0.067904,0.158361,\n\t\t\t         -0.983520,0.103305,0.148198,-0.896847,0.428114,0.111087,-0.990814,0.020203,0.133580,-0.917020,-0.378521,0.125523,\n\t\t\t         -0.915433,-0.365307,0.168767,-0.985015,0.067904,0.158361,-0.985015,0.067904,0.158361,-0.915433,-0.365307,0.168767,\n\t\t\t         -0.924253,-0.351451,0.148930,-0.983520,0.103305,0.148198,-0.885983,0.452376,0.101596,-0.888455,0.444166,0.115452,\n\t\t\t         -0.869320,0.488571,0.074374,-0.838527,0.541459,0.060701,-0.838527,0.541459,0.060701,-0.869320,0.488571,0.074374,\n\t\t\t         -0.853389,0.521165,0.009156,-0.819208,0.573382,0.008484,-0.888455,0.444166,0.115452,-0.896847,0.428114,0.111087,\n\t\t\t         -0.893521,0.441755,0.080264,-0.869320,0.488571,0.074374,-0.869320,0.488571,0.074374,-0.893521,0.441755,0.080264,\n\t\t\t         -0.877438,0.478317,0.035127,-0.853389,0.521165,0.009156,-0.885983,0.452376,0.101596,-0.838527,0.541459,0.060701,\n\t\t\t         -0.808618,0.586322,0.047884,-0.892117,0.444502,0.080630,-0.892117,0.444502,0.080630,-0.808618,0.586322,0.047884,\n\t\t\t         -0.802149,0.595141,0.048402,-0.917722,0.392956,0.057955,-0.838527,0.541459,0.060701,-0.819208,0.573382,0.008484,\n\t\t\t         -0.791192,0.611286,0.017273,-0.808618,0.586322,0.047884,-0.808618,0.586322,0.047884,-0.791192,0.611286,0.017273,\n\t\t\t         -0.768700,0.638539,0.036592,-0.802149,0.595141,0.048402,-0.885983,0.452376,0.101596,-0.892117,0.444502,0.080630,\n\t\t\t         -0.994446,-0.045412,0.094821,-0.990814,0.020203,0.133580,-0.990814,0.020203,0.133580,-0.994446,-0.045412,0.094821,\n\t\t\t         -0.911466,-0.404553,0.074313,-0.917020,-0.378521,0.125523,-0.892117,0.444502,0.080630,-0.917722,0.392956,0.057955,\n\t\t\t         -0.989624,-0.133122,0.053499,-0.994446,-0.045412,0.094821,-0.994446,-0.045412,0.094821,-0.989624,-0.133122,0.053499,\n\t\t\t         -0.898801,-0.436995,0.033570,-0.911466,-0.404553,0.074313,0.867061,0.408246,-0.285470,0.759453,0.584460,-0.285623,\n\t\t\t         0.725150,0.578265,-0.373791,0.793023,0.460860,-0.398328,0.793023,0.460860,-0.398328,0.725150,0.578265,-0.373791,\n\t\t\t         0.685537,0.558611,-0.466842,0.686789,0.506119,-0.521622,0.759453,0.584460,-0.285623,0.766198,0.559313,-0.316355,\n\t\t\t         0.776482,0.517808,-0.359050,0.725150,0.578265,-0.373791,0.725150,0.578265,-0.373791,0.776482,0.517808,-0.359050,\n\t\t\t         0.759911,0.497299,-0.418561,0.685537,0.558611,-0.466842,0.867061,0.408246,-0.285470,0.793023,0.460860,-0.398328,\n\t\t\t         0.865749,0.219214,-0.449873,0.947996,0.117100,-0.295877,0.947996,0.117100,-0.295877,0.865749,0.219214,-0.449873,\n\t\t\t         0.888241,-0.167455,-0.427686,0.942015,-0.205145,-0.265481,0.793023,0.460860,-0.398328,0.686789,0.506119,-0.521622,\n\t\t\t         0.713309,0.308512,-0.629261,0.865749,0.219214,-0.449873,0.865749,0.219214,-0.449873,0.713309,0.308512,-0.629261,\n\t\t\t         -0.001495,-0.129490,-0.991546,0.888241,-0.167455,-0.427686,0.867061,0.408246,-0.285470,0.947996,0.117100,-0.295877,\n\t\t\t         0.980712,0.036287,-0.191992,0.916959,0.351512,-0.188665,0.916959,0.351512,-0.188665,0.980712,0.036287,-0.191992,\n\t\t\t         0.987243,-0.010956,-0.158757,0.937986,0.306894,-0.161138,0.947996,0.117100,-0.295877,0.942015,-0.205145,-0.265481,\n\t\t\t         0.950285,-0.249977,-0.185553,0.980712,0.036287,-0.191992,0.980712,0.036287,-0.191992,0.950285,-0.249977,-0.185553,\n\t\t\t         0.957335,-0.251442,-0.142308,0.987243,-0.010956,-0.158757,0.867061,0.408246,-0.285470,0.916959,0.351512,-0.188665,\n\t\t\t         0.771172,0.603107,-0.203711,0.759453,0.584460,-0.285623,0.759453,0.584460,-0.285623,0.771172,0.603107,-0.203711,\n\t\t\t         0.720481,0.642201,-0.261605,0.766198,0.559313,-0.316355,0.916959,0.351512,-0.188665,0.937986,0.306894,-0.161138,\n\t\t\t         0.776055,0.609851,-0.160527,0.771172,0.603107,-0.203711,0.771172,0.603107,-0.203711,0.776055,0.609851,-0.160527,\n\t\t\t         0.656972,0.730796,-0.185217,0.720481,0.642201,-0.261605,0.876125,-0.475936,-0.076540,0.870479,-0.456618,-0.183660,\n\t\t\t         0.822626,-0.492904,-0.283395,0.789117,-0.596088,-0.148106,0.789117,-0.596088,-0.148106,0.822626,-0.492904,-0.283395,\n\t\t\t         0.665822,-0.506851,-0.547472,0.659810,-0.650441,-0.376202,0.870479,-0.456618,-0.183660,0.942015,-0.205145,-0.265481,\n\t\t\t         0.888241,-0.167455,-0.427686,0.822626,-0.492904,-0.283395,0.822626,-0.492904,-0.283395,0.888241,-0.167455,-0.427686,\n\t\t\t         -0.001495,-0.129490,-0.991546,0.665822,-0.506851,-0.547472,0.876125,-0.475936,-0.076540,0.789117,-0.596088,-0.148106,\n\t\t\t         0.797876,-0.602161,-0.028016,0.774529,-0.632496,-0.001282,0.774529,-0.632496,-0.001282,0.797876,-0.602161,-0.028016,\n\t\t\t         0.541307,-0.839869,0.039674,0.530656,-0.847072,0.029115,0.789117,-0.596088,-0.148106,0.659810,-0.650441,-0.376202,\n\t\t\t         0.675558,-0.703574,-0.220313,0.797876,-0.602161,-0.028016,0.797876,-0.602161,-0.028016,0.675558,-0.703574,-0.220313,\n\t\t\t         0.483535,-0.874172,-0.044099,0.541307,-0.839869,0.039674,0.876125,-0.475936,-0.076540,0.774529,-0.632496,-0.001282,\n\t\t\t         0.737663,-0.669698,-0.085604,0.922513,-0.374706,-0.092349,0.922513,-0.374706,-0.092349,0.737663,-0.669698,-0.085604,\n\t\t\t         0.661000,-0.736442,-0.143773,0.871609,-0.473128,-0.128086,0.774529,-0.632496,-0.001282,0.530656,-0.847072,0.029115,\n\t\t\t         0.424268,-0.903317,-0.063021,0.737663,-0.669698,-0.085604,0.737663,-0.669698,-0.085604,0.424268,-0.903317,-0.063021,\n\t\t\t         0.498550,-0.861293,-0.097995,0.661000,-0.736442,-0.143773,0.876125,-0.475936,-0.076540,0.922513,-0.374706,-0.092349,\n\t\t\t         0.903104,-0.405713,-0.140538,0.870479,-0.456618,-0.183660,0.870479,-0.456618,-0.183660,0.903104,-0.405713,-0.140538,\n\t\t\t         0.950285,-0.249977,-0.185553,0.942015,-0.205145,-0.265481,0.922513,-0.374706,-0.092349,0.871609,-0.473128,-0.128086,\n\t\t\t         0.924711,-0.364696,-0.108829,0.903104,-0.405713,-0.140538,0.903104,-0.405713,-0.140538,0.924711,-0.364696,-0.108829,\n\t\t\t         0.957335,-0.251442,-0.142308,0.950285,-0.249977,-0.185553,0.658528,-0.734214,-0.165044,0.661000,-0.736442,-0.143773,\n\t\t\t         0.498550,-0.861293,-0.097995,0.558397,-0.816340,-0.147465,0.871181,-0.468673,-0.146001,0.924711,-0.364696,-0.108829,\n\t\t\t         0.871609,-0.473128,-0.128086,0.746910,-0.641041,-0.176489,0.746910,-0.641041,-0.176489,0.658528,-0.734214,-0.165044,\n\t\t\t         0.676412,-0.718833,-0.160314,0.718284,-0.673086,-0.176092,0.736808,-0.651265,-0.181433,0.802149,-0.565966,-0.190161,\n\t\t\t         0.803095,-0.564714,-0.189886,0.718284,-0.673086,-0.176092,0.658528,-0.734214,-0.165044,0.558397,-0.816340,-0.147465,\n\t\t\t         0.581286,-0.797876,-0.159551,0.676412,-0.718833,-0.160314,0.736808,-0.651265,-0.181433,0.718284,-0.673086,-0.176092,\n\t\t\t         0.676412,-0.718833,-0.160314,0.664876,-0.724845,-0.180242,0.746910,-0.641041,-0.176489,0.718284,-0.673086,-0.176092,\n\t\t\t         0.803095,-0.564714,-0.189886,0.871181,-0.468673,-0.146001,0.871181,-0.468673,-0.146001,0.803095,-0.564714,-0.189886,\n\t\t\t         0.956175,-0.247475,-0.156285,0.970244,-0.214393,-0.112461,0.802149,-0.565966,-0.190161,0.926511,-0.317209,-0.202338,\n\t\t\t         0.956175,-0.247475,-0.156285,0.803095,-0.564714,-0.189886,0.957335,-0.251442,-0.142308,0.924711,-0.364696,-0.108829,\n\t\t\t         0.871181,-0.468673,-0.146001,0.970244,-0.214393,-0.112461,0.935911,0.309854,-0.167364,0.937986,0.306894,-0.161138,\n\t\t\t         0.987243,-0.010956,-0.158757,0.990844,0.017579,-0.133641,0.990844,0.017579,-0.133641,0.987243,-0.010956,-0.158757,\n\t\t\t         0.957335,-0.251442,-0.142308,0.970244,-0.214393,-0.112461,0.767663,0.616718,-0.174139,0.776055,0.609851,-0.160527,\n\t\t\t         0.937986,0.306894,-0.161138,0.935911,0.309854,-0.167364,0.935911,0.309854,-0.167364,0.990844,0.017579,-0.133641,\n\t\t\t         0.989135,0.058382,-0.134831,0.922056,0.360637,-0.140294,0.905423,0.391217,-0.164647,0.737968,0.665212,-0.113285,\n\t\t\t         0.748833,0.648701,-0.135716,0.922056,0.360637,-0.140294,0.990844,0.017579,-0.133641,0.970244,-0.214393,-0.112461,\n\t\t\t         0.956175,-0.247475,-0.156285,0.989135,0.058382,-0.134831,0.905423,0.391217,-0.164647,0.922056,0.360637,-0.140294,\n\t\t\t         0.989135,0.058382,-0.134831,0.980193,0.043916,-0.192999,0.935911,0.309854,-0.167364,0.922056,0.360637,-0.140294,\n\t\t\t         0.748833,0.648701,-0.135716,0.767663,0.616718,-0.174139,0.767663,0.616718,-0.174139,0.748833,0.648701,-0.135716,\n\t\t\t         0.611560,0.781457,-0.123630,0.613941,0.771203,-0.168157,0.737968,0.665212,-0.113285,0.621509,0.780572,-0.066347,\n\t\t\t         0.611560,0.781457,-0.123630,0.748833,0.648701,-0.135716,0.664876,-0.724845,-0.180242,0.676412,-0.718833,-0.160314,\n\t\t\t         0.581286,-0.797876,-0.159551,0.560747,-0.807764,-0.181768,0.656972,0.730796,-0.185217,0.776055,0.609851,-0.160527,\n\t\t\t         0.767663,0.616718,-0.174139,0.613941,0.771203,-0.168157,-0.791620,-0.610034,-0.034303,-0.830958,-0.553972,0.050874,\n\t\t\t         -0.821009,-0.569353,0.041566,-0.835963,-0.548753,0.002655,-0.526872,-0.845759,-0.083895,-0.547288,-0.836879,0.008271,\n\t\t\t         -0.830958,-0.553972,0.050874,-0.791620,-0.610034,-0.034303,-0.835963,-0.548753,0.002655,-0.821009,-0.569353,0.041566,\n\t\t\t         -0.825953,-0.563128,0.025575,-0.846797,-0.531816,0.006806,-0.846797,-0.531816,0.006806,-0.825953,-0.563128,0.025575,\n\t\t\t         -0.898801,-0.436995,0.033570,-0.885189,-0.465133,0.008484,0.438215,-0.889370,-0.130161,0.443007,-0.893643,-0.071596,\n\t\t\t         0.219550,-0.974029,-0.054933,0.143498,-0.983428,-0.110477,-0.835963,-0.548753,0.002655,-0.846797,-0.531816,0.006806,\n\t\t\t         -0.857540,-0.514145,0.016114,-0.813593,-0.581408,-0.001923,-0.792474,-0.608692,0.037721,-0.694906,-0.718955,0.012848,\n\t\t\t         -0.732658,-0.679067,-0.045473,-0.813593,-0.581408,-0.001923,-0.846797,-0.531816,0.006806,-0.885189,-0.465133,0.008484,\n\t\t\t         -0.895047,-0.445814,0.011109,-0.857540,-0.514145,0.016114,-0.792474,-0.608692,0.037721,-0.813593,-0.581408,-0.001923,\n\t\t\t         -0.857540,-0.514145,0.016114,-0.861629,-0.505264,0.047792,-0.835963,-0.548753,0.002655,-0.813593,-0.581408,-0.001923,\n\t\t\t         -0.732658,-0.679067,-0.045473,-0.791620,-0.610034,-0.034303,-0.791620,-0.610034,-0.034303,-0.732658,-0.679067,-0.045473,\n\t\t\t         -0.543809,-0.834742,-0.086245,-0.526872,-0.845759,-0.083895,-0.694906,-0.718955,0.012848,-0.537980,-0.842311,-0.032197,\n\t\t\t         -0.543809,-0.834742,-0.086245,-0.732658,-0.679067,-0.045473,0.980193,0.043916,-0.192999,0.989135,0.058382,-0.134831,\n\t\t\t         0.956175,-0.247475,-0.156285,0.926511,-0.317209,-0.202338,0.558397,-0.816340,-0.147465,0.498550,-0.861293,-0.097995,\n\t\t\t         0.443007,-0.893643,-0.071596,0.438215,-0.889370,-0.130161,0.143498,-0.983428,-0.110477,0.219550,-0.974029,-0.054933,\n\t\t\t         -0.132206,-0.990631,-0.033357,-0.206427,-0.973632,-0.096866,-0.206427,-0.973632,-0.096866,-0.132206,-0.990631,-0.033357,\n\t\t\t         -0.547288,-0.836879,0.008271,-0.526872,-0.845759,-0.083895,-0.612201,0.790460,-0.018921,-0.719718,0.694235,0.000549,\n\t\t\t         -0.632374,0.772423,-0.058412,-0.508988,0.857784,-0.071413,0.143498,-0.983428,-0.110477,-0.206427,-0.973632,-0.096866,\n\t\t\t         -0.283456,-0.953246,-0.104556,0.092502,-0.987304,-0.128910,-0.289560,-0.952300,-0.095950,-0.283456,-0.953246,-0.104556,\n\t\t\t         -0.543809,-0.834742,-0.086245,-0.537980,-0.842311,-0.032197,-0.206427,-0.973632,-0.096866,-0.526872,-0.845759,-0.083895,\n\t\t\t         -0.543809,-0.834742,-0.086245,-0.283456,-0.953246,-0.104556,-0.861629,-0.505264,0.047792,-0.857540,-0.514145,0.016114,\n\t\t\t         -0.895047,-0.445814,0.011109,-0.925016,-0.377758,0.040071,0.143498,-0.983428,-0.110477,0.092502,-0.987304,-0.128910,\n\t\t\t         0.417829,-0.895962,-0.150456,0.438215,-0.889370,-0.130161,0.438215,-0.889370,-0.130161,0.417829,-0.895962,-0.150456,\n\t\t\t         0.581286,-0.797876,-0.159551,0.558397,-0.816340,-0.147465,0.069826,-0.984985,-0.157720,0.092502,-0.987304,-0.128910,\n\t\t\t         -0.283456,-0.953246,-0.104556,-0.289560,-0.952300,-0.095950,0.069826,-0.984985,-0.157720,0.388775,-0.902982,-0.182867,\n\t\t\t         0.417829,-0.895962,-0.150456,0.092502,-0.987304,-0.128910,-0.739219,0.672994,0.023865,-0.768700,0.638539,0.036592,\n\t\t\t         -0.719718,0.694235,0.000549,-0.612201,0.790460,-0.018921,-0.508988,0.857784,-0.071413,-0.632374,0.772423,-0.058412,\n\t\t\t         -0.373180,0.917478,-0.137547,-0.338603,0.932401,-0.126316,-0.338603,0.932401,-0.126316,-0.373180,0.917478,-0.137547,\n\t\t\t         0.012513,0.976318,-0.215857,-0.007447,0.985107,-0.171667,0.418226,0.891964,-0.171697,0.462020,0.843379,-0.274270,\n\t\t\t         0.588641,0.772149,-0.239265,0.506272,0.846583,-0.164037,-0.508988,0.857784,-0.071413,-0.338603,0.932401,-0.126316,\n\t\t\t         -0.271645,0.961119,-0.049348,-0.387280,0.921354,-0.032594,-0.369396,0.927824,0.051363,-0.558153,0.829676,0.009217,\n\t\t\t         -0.519303,0.854488,-0.012238,-0.387280,0.921354,-0.032594,-0.338603,0.932401,-0.126316,-0.007447,0.985107,-0.171667,\n\t\t\t         -0.077639,0.994781,-0.065828,-0.271645,0.961119,-0.049348,-0.369396,0.927824,0.051363,-0.387280,0.921354,-0.032594,\n\t\t\t         -0.271645,0.961119,-0.049348,-0.210578,0.975860,0.057680,-0.508988,0.857784,-0.071413,-0.387280,0.921354,-0.032594,\n\t\t\t         -0.519303,0.854488,-0.012238,-0.612201,0.790460,-0.018921,-0.612201,0.790460,-0.018921,-0.519303,0.854488,-0.012238,\n\t\t\t         -0.713126,0.700888,0.013306,-0.739219,0.672994,0.023865,-0.558153,0.829676,0.009217,-0.757164,0.651997,-0.039369,\n\t\t\t         -0.713126,0.700888,0.013306,-0.519303,0.854488,-0.012238,0.388775,-0.902982,-0.182867,0.560747,-0.807764,-0.181768,\n\t\t\t         0.581286,-0.797876,-0.159551,0.417829,-0.895962,-0.150456,0.506272,0.846583,-0.164037,0.588641,0.772149,-0.239265,\n\t\t\t         0.656972,0.730796,-0.185217,0.613941,0.771203,-0.168157,0.275246,0.943846,-0.182562,0.281503,0.922452,-0.264199,\n\t\t\t         0.462020,0.843379,-0.274270,0.418226,0.891964,-0.171697,0.418226,0.891964,-0.171697,0.506272,0.846583,-0.164037,\n\t\t\t         0.496323,0.862606,-0.097781,0.359905,0.929655,-0.078463,0.502914,0.863674,-0.032685,0.496323,0.862606,-0.097781,\n\t\t\t         0.611560,0.781457,-0.123630,0.621509,0.780572,-0.066347,0.506272,0.846583,-0.164037,0.613941,0.771203,-0.168157,\n\t\t\t         0.611560,0.781457,-0.123630,0.496323,0.862606,-0.097781,-0.210578,0.975860,0.057680,-0.271645,0.961119,-0.049348,\n\t\t\t         -0.077639,0.994781,-0.065828,-0.038118,0.998108,0.047700,0.418226,0.891964,-0.171697,0.359905,0.929655,-0.078463,\n\t\t\t         0.170568,0.982238,-0.077853,0.275246,0.943846,-0.182562,0.275246,0.943846,-0.182562,0.170568,0.982238,-0.077853,\n\t\t\t         -0.077639,0.994781,-0.065828,-0.007447,0.985107,-0.171667,0.324229,0.945952,-0.002564,0.359905,0.929655,-0.078463,\n\t\t\t         0.496323,0.862606,-0.097781,0.502914,0.863674,-0.032685,0.324229,0.945952,-0.002564,0.140629,0.989654,0.028321,\n\t\t\t         0.170568,0.982238,-0.077853,0.359905,0.929655,-0.078463,0.012513,0.976318,-0.215857,0.281503,0.922452,-0.264199,\n\t\t\t         0.275246,0.943846,-0.182562,-0.007447,0.985107,-0.171667,-0.975097,-0.221076,0.016541,-0.989624,-0.133122,0.053499,\n\t\t\t         -0.917722,0.392956,0.057955,-0.954558,0.296579,0.029084,-0.898801,-0.436995,0.033570,-0.989624,-0.133122,0.053499,\n\t\t\t         -0.975097,-0.221076,0.016541,-0.885189,-0.465133,0.008484,-0.954558,0.296579,0.029084,-0.917722,0.392956,0.057955,\n\t\t\t         -0.802149,0.595141,0.048402,-0.824702,0.564379,0.036348,-0.824702,0.564379,0.036348,-0.802149,0.595141,0.048402,\n\t\t\t         -0.768700,0.638539,0.036592,-0.739219,0.672994,0.023865,-0.954558,0.296579,0.029084,-0.824702,0.564379,0.036348,\n\t\t\t         -0.859249,0.511185,0.018403,-0.977813,0.209418,0.002655,-0.980743,0.193152,-0.028199,-0.990204,-0.139256,0.009400,\n\t\t\t         -0.973174,-0.229926,-0.002228,-0.977813,0.209418,0.002655,-0.824702,0.564379,0.036348,-0.739219,0.672994,0.023865,\n\t\t\t         -0.713126,0.700888,0.013306,-0.859249,0.511185,0.018403,-0.980743,0.193152,-0.028199,-0.977813,0.209418,0.002655,\n\t\t\t         -0.859249,0.511185,0.018403,-0.893033,0.447188,-0.049959,-0.954558,0.296579,0.029084,-0.977813,0.209418,0.002655,\n\t\t\t         -0.973174,-0.229926,-0.002228,-0.975097,-0.221076,0.016541,-0.975097,-0.221076,0.016541,-0.973174,-0.229926,-0.002228,\n\t\t\t         -0.895047,-0.445814,0.011109,-0.885189,-0.465133,0.008484,-0.990204,-0.139256,0.009400,-0.925016,-0.377758,0.040071,\n\t\t\t         -0.895047,-0.445814,0.011109,-0.973174,-0.229926,-0.002228,0.140629,0.989654,0.028321,-0.038118,0.998108,0.047700,\n\t\t\t         -0.077639,0.994781,-0.065828,0.170568,0.982238,-0.077853,0.733818,-0.647511,-0.205420,0.736808,-0.651265,-0.181433,\n\t\t\t         0.664876,-0.724845,-0.180242,0.653035,-0.731254,-0.196905,0.653035,-0.731254,-0.196905,0.664876,-0.724845,-0.180242,\n\t\t\t         0.560747,-0.807764,-0.181768,0.530168,-0.823664,-0.201147,0.733818,-0.647511,-0.205420,0.653035,-0.731254,-0.196905,\n\t\t\t         0.643666,-0.733207,-0.219245,0.736595,-0.633625,-0.236396,0.736595,-0.633625,-0.236396,0.643666,-0.733207,-0.219245,\n\t\t\t         0.626667,-0.730491,-0.271310,0.741264,-0.607654,-0.285043,0.653035,-0.731254,-0.196905,0.530168,-0.823664,-0.201147,\n\t\t\t         0.493728,-0.839534,-0.226691,0.643666,-0.733207,-0.219245,0.643666,-0.733207,-0.219245,0.493728,-0.839534,-0.226691,\n\t\t\t         0.449690,-0.847377,-0.282296,0.626667,-0.730491,-0.271310,0.733818,-0.647511,-0.205420,0.736595,-0.633625,-0.236396,\n\t\t\t         0.803888,-0.532792,-0.264321,0.810877,-0.544939,-0.213233,0.810877,-0.544939,-0.213233,0.803888,-0.532792,-0.264321,\n\t\t\t         0.914914,-0.287210,-0.283517,0.921262,-0.317362,-0.224769,0.736595,-0.633625,-0.236396,0.741264,-0.607654,-0.285043,\n\t\t\t         0.803491,-0.502091,-0.319803,0.803888,-0.532792,-0.264321,0.803888,-0.532792,-0.264321,0.803491,-0.502091,-0.319803,\n\t\t\t         0.910581,-0.249886,-0.329203,0.914914,-0.287210,-0.283517,0.733818,-0.647511,-0.205420,0.810877,-0.544939,-0.213233,\n\t\t\t         0.802149,-0.565966,-0.190161,0.736808,-0.651265,-0.181433,0.810877,-0.544939,-0.213233,0.921262,-0.317362,-0.224769,\n\t\t\t         0.926511,-0.317209,-0.202338,0.802149,-0.565966,-0.190161,0.885433,0.413099,-0.212836,0.905423,0.391217,-0.164647,\n\t\t\t         0.980193,0.043916,-0.192999,0.969756,0.042207,-0.240272,0.969756,0.042207,-0.240272,0.980193,0.043916,-0.192999,\n\t\t\t         0.926511,-0.317209,-0.202338,0.921262,-0.317362,-0.224769,0.885433,0.413099,-0.212836,0.969756,0.042207,-0.240272,\n\t\t\t         0.957488,0.101993,-0.269784,0.880062,0.432478,-0.195990,0.880062,0.432478,-0.195990,0.957488,0.101993,-0.269784,\n\t\t\t         0.953978,0.143315,-0.263344,0.889950,0.431684,-0.146977,0.969756,0.042207,-0.240272,0.921262,-0.317362,-0.224769,\n\t\t\t         0.914914,-0.287210,-0.283517,0.957488,0.101993,-0.269784,0.957488,0.101993,-0.269784,0.914914,-0.287210,-0.283517,\n\t\t\t         0.910581,-0.249886,-0.329203,0.953978,0.143315,-0.263344,0.885433,0.413099,-0.212836,0.880062,0.432478,-0.195990,\n\t\t\t         0.769372,0.633961,-0.078280,0.744072,0.656789,-0.122288,0.744072,0.656789,-0.122288,0.769372,0.633961,-0.078280,\n\t\t\t         0.667776,0.744255,0.010468,0.636708,0.769829,-0.043611,0.880062,0.432478,-0.195990,0.889950,0.431684,-0.146977,\n\t\t\t         0.798547,0.601337,-0.026063,0.769372,0.633961,-0.078280,0.769372,0.633961,-0.078280,0.798547,0.601337,-0.026063,\n\t\t\t         0.703513,0.707907,0.062410,0.667776,0.744255,0.010468,0.885433,0.413099,-0.212836,0.744072,0.656789,-0.122288,\n\t\t\t         0.737968,0.665212,-0.113285,0.905423,0.391217,-0.164647,0.744072,0.656789,-0.122288,0.636708,0.769829,-0.043611,\n\t\t\t         0.621509,0.780572,-0.066347,0.737968,0.665212,-0.113285,-0.792688,-0.606189,0.064425,-0.686117,-0.726768,0.031617,\n\t\t\t         -0.694906,-0.718955,0.012848,-0.792474,-0.608692,0.037721,-0.686117,-0.726768,0.031617,-0.514512,-0.857051,-0.027100,\n\t\t\t         -0.537980,-0.842311,-0.032197,-0.694906,-0.718955,0.012848,-0.792688,-0.606189,0.064425,-0.792474,-0.608692,0.037721,\n\t\t\t         -0.861629,-0.505264,0.047792,-0.868129,-0.490127,0.078097,-0.868129,-0.490127,0.078097,-0.861629,-0.505264,0.047792,\n\t\t\t         -0.925016,-0.377758,0.040071,-0.941496,-0.325785,0.086062,-0.792688,-0.606189,0.064425,-0.868129,-0.490127,0.078097,\n\t\t\t         -0.876492,-0.472823,0.090335,-0.797815,-0.598804,0.069887,-0.797815,-0.598804,0.069887,-0.876492,-0.472823,0.090335,\n\t\t\t         -0.888882,-0.451186,0.079134,-0.807520,-0.587786,0.048738,-0.868129,-0.490127,0.078097,-0.941496,-0.325785,0.086062,\n\t\t\t         -0.944762,-0.308512,0.110569,-0.876492,-0.472823,0.090335,-0.876492,-0.472823,0.090335,-0.944762,-0.308512,0.110569,\n\t\t\t         -0.951964,-0.288858,0.101260,-0.888882,-0.451186,0.079134,-0.792688,-0.606189,0.064425,-0.797815,-0.598804,0.069887,\n\t\t\t         -0.685873,-0.727165,0.027284,-0.686117,-0.726768,0.031617,-0.686117,-0.726768,0.031617,-0.685873,-0.727165,0.027284,\n\t\t\t         -0.507431,-0.860683,-0.040986,-0.514512,-0.857051,-0.027100,-0.797815,-0.598804,0.069887,-0.807520,-0.587786,0.048738,\n\t\t\t         -0.691092,-0.722709,-0.005676,-0.685873,-0.727165,0.027284,-0.685873,-0.727165,0.027284,-0.691092,-0.722709,-0.005676,\n\t\t\t         -0.511521,-0.855159,-0.083804,-0.507431,-0.860683,-0.040986,0.062624,-0.981780,-0.179357,0.350230,-0.913144,-0.208472,\n\t\t\t         0.388775,-0.902982,-0.182867,0.069826,-0.984985,-0.157720,0.350230,-0.913144,-0.208472,0.530168,-0.823664,-0.201147,\n\t\t\t         0.560747,-0.807764,-0.181768,0.388775,-0.902982,-0.182867,0.062624,-0.981780,-0.179357,0.069826,-0.984985,-0.157720,\n\t\t\t         -0.289560,-0.952300,-0.095950,-0.262673,-0.959044,-0.105686,-0.262673,-0.959044,-0.105686,-0.289560,-0.952300,-0.095950,\n\t\t\t         -0.537980,-0.842311,-0.032197,-0.514512,-0.857051,-0.027100,0.062624,-0.981780,-0.179357,-0.262673,-0.959044,-0.105686,\n\t\t\t         -0.253487,-0.959319,-0.124119,0.054628,-0.977783,-0.202307,0.054628,-0.977783,-0.202307,-0.253487,-0.959319,-0.124119,\n\t\t\t         -0.259041,-0.950377,-0.172155,0.043184,-0.966247,-0.253914,-0.262673,-0.959044,-0.105686,-0.514512,-0.857051,-0.027100,\n\t\t\t         -0.507431,-0.860683,-0.040986,-0.253487,-0.959319,-0.124119,-0.253487,-0.959319,-0.124119,-0.507431,-0.860683,-0.040986,\n\t\t\t         -0.511521,-0.855159,-0.083804,-0.259041,-0.950377,-0.172155,0.062624,-0.981780,-0.179357,0.054628,-0.977783,-0.202307,\n\t\t\t         0.313486,-0.919858,-0.235694,0.350230,-0.913144,-0.208472,0.350230,-0.913144,-0.208472,0.313486,-0.919858,-0.235694,\n\t\t\t         0.493728,-0.839534,-0.226691,0.530168,-0.823664,-0.201147,0.054628,-0.977783,-0.202307,0.043184,-0.966247,-0.253914,\n\t\t\t         0.277963,-0.915830,-0.289773,0.313486,-0.919858,-0.235694,0.313486,-0.919858,-0.235694,0.277963,-0.915830,-0.289773,\n\t\t\t         0.449690,-0.847377,-0.282296,0.493728,-0.839534,-0.226691,-0.480392,0.875515,0.051576,-0.634724,0.771630,0.041047,\n\t\t\t         -0.558153,0.829676,0.009217,-0.369396,0.927824,0.051363,-0.634724,0.771630,0.041047,-0.743706,0.665456,0.063448,\n\t\t\t         -0.757164,0.651997,-0.039369,-0.558153,0.829676,0.009217,-0.480392,0.875515,0.051576,-0.369396,0.927824,0.051363,\n\t\t\t         -0.210578,0.975860,0.057680,-0.240608,0.966552,0.088534,-0.240608,0.966552,0.088534,-0.210578,0.975860,0.057680,\n\t\t\t         -0.038118,0.998108,0.047700,0.005249,0.997803,0.065615,-0.480392,0.875515,0.051576,-0.240608,0.966552,0.088534,\n\t\t\t         -0.311319,0.937834,0.153356,-0.445723,0.865322,0.229102,-0.445723,0.865322,0.229102,-0.311319,0.937834,0.153356,\n\t\t\t         -0.204566,0.914487,0.349040,-0.321055,0.837397,0.442335,-0.240608,0.966552,0.088534,0.005249,0.997803,0.065615,\n\t\t\t         -0.057100,0.993225,0.100925,-0.311319,0.937834,0.153356,-0.311319,0.937834,0.153356,-0.057100,0.993225,0.100925,\n\t\t\t         -0.072665,0.969939,0.232215,-0.204566,0.914487,0.349040,-0.480392,0.875515,0.051576,-0.445723,0.865322,0.229102,\n\t\t\t         -0.562609,0.785607,0.257393,-0.634724,0.771630,0.041047,-0.634724,0.771630,0.041047,-0.562609,0.785607,0.257393,\n\t\t\t         -0.658773,0.687185,0.306192,-0.743706,0.665456,0.063448,-0.445723,0.865322,0.229102,-0.321055,0.837397,0.442335,\n\t\t\t         -0.460707,0.750786,0.473312,-0.562609,0.785607,0.257393,-0.562609,0.785607,0.257393,-0.460707,0.750786,0.473312,\n\t\t\t         -0.668599,0.626057,0.401227,-0.658773,0.687185,0.306192,0.388348,0.921445,0.009003,0.324229,0.945952,-0.002564,\n\t\t\t         0.502914,0.863674,-0.032685,0.531571,0.846950,-0.008576,0.531571,0.846950,-0.008576,0.502914,0.863674,-0.032685,\n\t\t\t         0.621509,0.780572,-0.066347,0.636708,0.769829,-0.043611,0.388348,0.921445,0.009003,0.531571,0.846950,-0.008576,\n\t\t\t         0.574572,0.817133,0.045991,0.436232,0.898343,0.051210,0.436232,0.898343,0.051210,0.574572,0.817133,0.045991,\n\t\t\t         0.591113,0.801141,0.093387,0.423933,0.900540,0.096347,0.531571,0.846950,-0.008576,0.636708,0.769829,-0.043611,\n\t\t\t         0.667776,0.744255,0.010468,0.574572,0.817133,0.045991,0.574572,0.817133,0.045991,0.667776,0.744255,0.010468,\n\t\t\t         0.703513,0.707907,0.062410,0.591113,0.801141,0.093387,0.388348,0.921445,0.009003,0.436232,0.898343,0.051210,\n\t\t\t         0.239235,0.968902,0.062990,0.204077,0.978454,0.030427,0.204077,0.978454,0.030427,0.239235,0.968902,0.062990,\n\t\t\t         -0.057100,0.993225,0.100925,0.005249,0.997803,0.065615,0.436232,0.898343,0.051210,0.423933,0.900540,0.096347,\n\t\t\t         0.143010,0.981292,0.128819,0.239235,0.968902,0.062990,0.239235,0.968902,0.062990,0.143010,0.981292,0.128819,\n\t\t\t         -0.072665,0.969939,0.232215,-0.057100,0.993225,0.100925,0.388348,0.921445,0.009003,0.204077,0.978454,0.030427,\n\t\t\t         0.140629,0.989654,0.028321,0.324229,0.945952,-0.002564,0.204077,0.978454,0.030427,0.005249,0.997803,0.065615,\n\t\t\t         -0.038118,0.998108,0.047700,0.140629,0.989654,0.028321,-0.967406,0.236793,0.089480,-0.993500,-0.058962,0.097262,\n\t\t\t         -0.990204,-0.139256,0.009400,-0.980743,0.193152,-0.028199,-0.993500,-0.058962,0.097262,-0.941496,-0.325785,0.086062,\n\t\t\t         -0.925016,-0.377758,0.040071,-0.990204,-0.139256,0.009400,-0.967406,0.236793,0.089480,-0.980743,0.193152,-0.028199,\n\t\t\t         -0.893033,0.447188,-0.049959,-0.872829,0.482528,0.072573,-0.872829,0.482528,0.072573,-0.893033,0.447188,-0.049959,\n\t\t\t         -0.757164,0.651997,-0.039369,-0.743706,0.665456,0.063448,-0.967406,0.236793,0.089480,-0.872829,0.482528,0.072573,\n\t\t\t         -0.812555,0.494430,0.308664,-0.947478,0.214270,0.237312,-0.947478,0.214270,0.237312,-0.812555,0.494430,0.308664,\n\t\t\t         -0.860012,0.417768,0.292886,-0.965514,0.165471,0.200873,-0.872829,0.482528,0.072573,-0.743706,0.665456,0.063448,\n\t\t\t         -0.658773,0.687185,0.306192,-0.812555,0.494430,0.308664,-0.812555,0.494430,0.308664,-0.658773,0.687185,0.306192,\n\t\t\t         -0.668599,0.626057,0.401227,-0.860012,0.417768,0.292886,-0.967406,0.236793,0.089480,-0.947478,0.214270,0.237312,\n\t\t\t         -0.984710,-0.071322,0.158879,-0.993500,-0.058962,0.097262,-0.993500,-0.058962,0.097262,-0.984710,-0.071322,0.158879,\n\t\t\t         -0.944762,-0.308512,0.110569,-0.941496,-0.325785,0.086062,-0.947478,0.214270,0.237312,-0.965514,0.165471,0.200873,\n\t\t\t         -0.987274,-0.080966,0.136662,-0.984710,-0.071322,0.158879,-0.984710,-0.071322,0.158879,-0.987274,-0.080966,0.136662,\n\t\t\t         -0.951964,-0.288858,0.101260,-0.944762,-0.308512,0.110569,0.750359,-0.548021,-0.369518,0.744377,-0.575488,-0.338633,\n\t\t\t         0.611835,-0.719779,-0.327891,0.619465,-0.702017,-0.351238,0.619465,-0.702017,-0.351238,0.611835,-0.719779,-0.327891,\n\t\t\t         0.418592,-0.847621,-0.325999,0.440748,-0.842830,-0.308725,0.744377,-0.575488,-0.338633,0.741264,-0.607654,-0.285043,\n\t\t\t         0.626667,-0.730491,-0.271310,0.611835,-0.719779,-0.327891,0.611835,-0.719779,-0.327891,0.626667,-0.730491,-0.271310,\n\t\t\t         0.449690,-0.847377,-0.282296,0.418592,-0.847621,-0.325999,0.750359,-0.548021,-0.369518,0.619465,-0.702017,-0.351238,\n\t\t\t         0.660939,-0.685263,-0.305765,0.775262,-0.540574,-0.326640,0.775262,-0.540574,-0.326640,0.660939,-0.685263,-0.305765,\n\t\t\t         0.695364,-0.691702,-0.194922,0.796075,-0.572558,-0.195898,0.619465,-0.702017,-0.351238,0.440748,-0.842830,-0.308725,\n\t\t\t         0.514542,-0.821863,-0.244453,0.660939,-0.685263,-0.305765,0.660939,-0.685263,-0.305765,0.514542,-0.821863,-0.244453,\n\t\t\t         0.586688,-0.792932,-0.164342,0.695364,-0.691702,-0.194922,0.750359,-0.548021,-0.369518,0.775262,-0.540574,-0.326640,\n\t\t\t         0.817377,-0.479598,-0.319132,0.808710,-0.455000,-0.372723,0.808710,-0.455000,-0.372723,0.817377,-0.479598,-0.319132,\n\t\t\t         0.915372,-0.293832,-0.275124,0.914335,-0.233680,-0.330699,0.775262,-0.540574,-0.326640,0.796075,-0.572558,-0.195898,\n\t\t\t         0.823176,-0.538469,-0.179937,0.817377,-0.479598,-0.319132,0.817377,-0.479598,-0.319132,0.823176,-0.538469,-0.179937,\n\t\t\t         0.919401,-0.362468,-0.152532,0.915372,-0.293832,-0.275124,0.750359,-0.548021,-0.369518,0.808710,-0.455000,-0.372723,\n\t\t\t         0.806848,-0.468276,-0.360057,0.744377,-0.575488,-0.338633,0.744377,-0.575488,-0.338633,0.806848,-0.468276,-0.360057,\n\t\t\t         0.803491,-0.502091,-0.319803,0.741264,-0.607654,-0.285043,0.808710,-0.455000,-0.372723,0.914335,-0.233680,-0.330699,\n\t\t\t         0.913419,-0.221442,-0.341472,0.806848,-0.468276,-0.360057,0.806848,-0.468276,-0.360057,0.913419,-0.221442,-0.341472,\n\t\t\t         0.910581,-0.249886,-0.329203,0.803491,-0.502091,-0.319803,0.918607,0.378948,-0.111820,0.906857,0.410321,-0.095859,\n\t\t\t         0.960601,0.154149,-0.231117,0.968810,0.116520,-0.218574,0.968810,0.116520,-0.218574,0.960601,0.154149,-0.231117,\n\t\t\t         0.913419,-0.221442,-0.341472,0.914335,-0.233680,-0.330699,0.906857,0.410321,-0.095859,0.889950,0.431684,-0.146977,\n\t\t\t         0.953978,0.143315,-0.263344,0.960601,0.154149,-0.231117,0.960601,0.154149,-0.231117,0.953978,0.143315,-0.263344,\n\t\t\t         0.910581,-0.249886,-0.329203,0.913419,-0.221442,-0.341472,0.918607,0.378948,-0.111820,0.968810,0.116520,-0.218574,\n\t\t\t         0.979675,0.049989,-0.194189,0.928220,0.351848,-0.120731,0.928220,0.351848,-0.120731,0.979675,0.049989,-0.194189,\n\t\t\t         0.993500,0.002716,-0.113773,0.941832,0.327799,-0.073824,0.968810,0.116520,-0.218574,0.914335,-0.233680,-0.330699,\n\t\t\t         0.915372,-0.293832,-0.275124,0.979675,0.049989,-0.194189,0.979675,0.049989,-0.194189,0.915372,-0.293832,-0.275124,\n\t\t\t         0.919401,-0.362468,-0.152532,0.993500,0.002716,-0.113773,0.918607,0.378948,-0.111820,0.928220,0.351848,-0.120731,\n\t\t\t         0.815607,0.575304,-0.061159,0.826960,0.560533,-0.043336,0.826960,0.560533,-0.043336,0.815607,0.575304,-0.061159,\n\t\t\t         0.685080,0.728324,0.012879,0.691061,0.722770,-0.001129,0.928220,0.351848,-0.120731,0.941832,0.327799,-0.073824,\n\t\t\t         0.833888,0.551378,-0.023957,0.815607,0.575304,-0.061159,0.815607,0.575304,-0.061159,0.833888,0.551378,-0.023957,\n\t\t\t         0.717429,0.695639,0.036775,0.685080,0.728324,0.012879,0.918607,0.378948,-0.111820,0.826960,0.560533,-0.043336,\n\t\t\t         0.827082,0.561907,0.012421,0.906857,0.410321,-0.095859,0.906857,0.410321,-0.095859,0.827082,0.561907,0.012421,\n\t\t\t         0.798547,0.601337,-0.026063,0.889950,0.431684,-0.146977,0.826960,0.560533,-0.043336,0.691061,0.722770,-0.001129,\n\t\t\t         0.716605,0.692923,0.079440,0.827082,0.561907,0.012421,0.827082,0.561907,0.012421,0.716605,0.692923,0.079440,\n\t\t\t         0.703513,0.707907,0.062410,0.798547,0.601337,-0.026063,-0.850917,-0.520249,0.072420,-0.712424,-0.698111,0.071200,\n\t\t\t         -0.699698,-0.714377,-0.003693,-0.823511,-0.565752,0.041322,-0.823511,-0.565752,0.041322,-0.699698,-0.714377,-0.003693,\n\t\t\t         -0.691092,-0.722709,-0.005676,-0.807520,-0.587786,0.048738,-0.712424,-0.698111,0.071200,-0.488266,-0.872250,-0.027650,\n\t\t\t         -0.509201,-0.855647,-0.092563,-0.699698,-0.714377,-0.003693,-0.699698,-0.714377,-0.003693,-0.509201,-0.855647,-0.092563,\n\t\t\t         -0.511521,-0.855159,-0.083804,-0.691092,-0.722709,-0.005676,-0.850917,-0.520249,0.072420,-0.823511,-0.565752,0.041322,\n\t\t\t         -0.904447,-0.421888,0.062532,-0.923490,-0.378735,0.060732,-0.923490,-0.378735,0.060732,-0.904447,-0.421888,0.062532,\n\t\t\t         -0.963012,-0.256325,0.082766,-0.973327,-0.219764,0.065554,-0.823511,-0.565752,0.041322,-0.807520,-0.587786,0.048738,\n\t\t\t         -0.888882,-0.451186,0.079134,-0.904447,-0.421888,0.062532,-0.904447,-0.421888,0.062532,-0.888882,-0.451186,0.079134,\n\t\t\t         -0.951964,-0.288858,0.101260,-0.963012,-0.256325,0.082766,-0.850917,-0.520249,0.072420,-0.923490,-0.378735,0.060732,\n\t\t\t         -0.945250,-0.320170,0.062960,-0.889157,-0.447371,0.095950,-0.889157,-0.447371,0.095950,-0.945250,-0.320170,0.062960,\n\t\t\t         -0.946989,-0.316538,0.054506,-0.913785,-0.403546,0.045625,-0.923490,-0.378735,0.060732,-0.973327,-0.219764,0.065554,\n\t\t\t         -0.979339,-0.193609,0.057894,-0.945250,-0.320170,0.062960,-0.945250,-0.320170,0.062960,-0.979339,-0.193609,0.057894,\n\t\t\t         -0.969481,-0.232704,0.076815,-0.946989,-0.316538,0.054506,-0.850917,-0.520249,0.072420,-0.889157,-0.447371,0.095950,\n\t\t\t         -0.717582,-0.693594,0.062899,-0.712424,-0.698111,0.071200,-0.712424,-0.698111,0.071200,-0.717582,-0.693594,0.062899,\n\t\t\t         -0.480697,-0.876858,-0.002930,-0.488266,-0.872250,-0.027650,-0.889157,-0.447371,0.095950,-0.913785,-0.403546,0.045625,\n\t\t\t         -0.792230,-0.609699,0.024445,-0.717582,-0.693594,0.062899,-0.717582,-0.693594,0.062899,-0.792230,-0.609699,0.024445,\n\t\t\t         -0.520341,-0.853603,-0.024506,-0.480697,-0.876858,-0.002930,0.051057,-0.982330,-0.179876,0.308603,-0.918027,-0.248939,\n\t\t\t         0.262795,-0.911405,-0.316538,0.040956,-0.961058,-0.273171,0.040956,-0.961058,-0.273171,0.262795,-0.911405,-0.316538,\n\t\t\t         0.277963,-0.915830,-0.289773,0.043184,-0.966247,-0.253914,0.308603,-0.918027,-0.248939,0.440748,-0.842830,-0.308725,\n\t\t\t         0.418592,-0.847621,-0.325999,0.262795,-0.911405,-0.316538,0.262795,-0.911405,-0.316538,0.418592,-0.847621,-0.325999,\n\t\t\t         0.449690,-0.847377,-0.282296,0.277963,-0.915830,-0.289773,0.051057,-0.982330,-0.179876,0.040956,-0.961058,-0.273171,\n\t\t\t         -0.263100,-0.946043,-0.189062,-0.267891,-0.956084,-0.118717,-0.267891,-0.956084,-0.118717,-0.263100,-0.946043,-0.189062,\n\t\t\t         -0.509201,-0.855647,-0.092563,-0.488266,-0.872250,-0.027650,0.040956,-0.961058,-0.273171,0.043184,-0.966247,-0.253914,\n\t\t\t         -0.259041,-0.950377,-0.172155,-0.263100,-0.946043,-0.189062,-0.263100,-0.946043,-0.189062,-0.259041,-0.950377,-0.172155,\n\t\t\t         -0.511521,-0.855159,-0.083804,-0.509201,-0.855647,-0.092563,0.051057,-0.982330,-0.179876,-0.267891,-0.956084,-0.118717,\n\t\t\t         -0.282113,-0.957335,-0.062136,0.054628,-0.995422,-0.078341,0.054628,-0.995422,-0.078341,-0.282113,-0.957335,-0.062136,\n\t\t\t         -0.306558,-0.951506,-0.024964,0.058535,-0.996643,-0.056734,-0.267891,-0.956084,-0.118717,-0.488266,-0.872250,-0.027650,\n\t\t\t         -0.480697,-0.876858,-0.002930,-0.282113,-0.957335,-0.062136,-0.282113,-0.957335,-0.062136,-0.480697,-0.876858,-0.002930,\n\t\t\t         -0.520341,-0.853603,-0.024506,-0.306558,-0.951506,-0.024964,0.051057,-0.982330,-0.179876,0.054628,-0.995422,-0.078341,\n\t\t\t         0.396893,-0.905728,-0.148595,0.308603,-0.918027,-0.248939,0.308603,-0.918027,-0.248939,0.396893,-0.905728,-0.148595,\n\t\t\t         0.514542,-0.821863,-0.244453,0.440748,-0.842830,-0.308725,0.054628,-0.995422,-0.078341,0.058535,-0.996643,-0.056734,\n\t\t\t         0.443525,-0.889248,-0.111637,0.396893,-0.905728,-0.148595,0.396893,-0.905728,-0.148595,0.443525,-0.889248,-0.111637,\n\t\t\t         0.586688,-0.792932,-0.164342,0.514542,-0.821863,-0.244453,-0.474685,0.809870,0.344584,-0.676168,0.681082,0.280801,\n\t\t\t         -0.571825,0.703726,0.421613,-0.327403,0.801294,0.500687,-0.327403,0.801294,0.500687,-0.571825,0.703726,0.421613,\n\t\t\t         -0.460707,0.750786,0.473312,-0.321055,0.837397,0.442335,-0.676168,0.681082,0.280801,-0.818049,0.531541,0.219581,\n\t\t\t         -0.757561,0.563555,0.329325,-0.571825,0.703726,0.421613,-0.571825,0.703726,0.421613,-0.757561,0.563555,0.329325,\n\t\t\t         -0.668599,0.626057,0.401227,-0.460707,0.750786,0.473312,-0.474685,0.809870,0.344584,-0.327403,0.801294,0.500687,\n\t\t\t         -0.085574,0.872524,0.480941,-0.197089,0.900174,0.388348,-0.197089,0.900174,0.388348,-0.085574,0.872524,0.480941,\n\t\t\t         0.062502,0.934599,0.350139,0.131779,0.914426,0.382641,-0.327403,0.801294,0.500687,-0.321055,0.837397,0.442335,\n\t\t\t         -0.204566,0.914487,0.349040,-0.085574,0.872524,0.480941,-0.085574,0.872524,0.480941,-0.204566,0.914487,0.349040,\n\t\t\t         -0.072665,0.969939,0.232215,0.062502,0.934599,0.350139,-0.474685,0.809870,0.344584,-0.197089,0.900174,0.388348,\n\t\t\t         -0.320841,0.941649,0.101718,-0.556169,0.824335,0.105441,-0.556169,0.824335,0.105441,-0.320841,0.941649,0.101718,\n\t\t\t         -0.327280,0.944365,0.032289,-0.548418,0.833155,0.071017,-0.197089,0.900174,0.388348,0.131779,0.914426,0.382641,\n\t\t\t         -0.017548,0.991943,0.125217,-0.320841,0.941649,0.101718,-0.320841,0.941649,0.101718,-0.017548,0.991943,0.125217,\n\t\t\t         -0.085299,0.996063,0.023560,-0.327280,0.944365,0.032289,-0.474685,0.809870,0.344584,-0.556169,0.824335,0.105441,\n\t\t\t         -0.730735,0.673360,0.112125,-0.676168,0.681082,0.280801,-0.676168,0.681082,0.280801,-0.730735,0.673360,0.112125,\n\t\t\t         -0.838069,0.534623,0.108585,-0.818049,0.531541,0.219581,-0.556169,0.824335,0.105441,-0.548418,0.833155,0.071017,\n\t\t\t         -0.732505,0.673330,0.100070,-0.730735,0.673360,0.112125,-0.730735,0.673360,0.112125,-0.732505,0.673330,0.100070,\n\t\t\t         -0.825983,0.551744,0.115360,-0.838069,0.534623,0.108585,0.364696,0.920713,0.138768,0.311472,0.942595,0.120273,\n\t\t\t         0.558489,0.823054,0.103092,0.489456,0.871731,0.021485,0.489456,0.871731,0.021485,0.558489,0.823054,0.103092,\n\t\t\t         0.716605,0.692923,0.079440,0.691061,0.722770,-0.001129,0.311472,0.942595,0.120273,0.423933,0.900540,0.096347,\n\t\t\t         0.591113,0.801141,0.093387,0.558489,0.823054,0.103092,0.558489,0.823054,0.103092,0.591113,0.801141,0.093387,\n\t\t\t         0.703513,0.707907,0.062410,0.716605,0.692923,0.079440,0.364696,0.920713,0.138768,0.489456,0.871731,0.021485,\n\t\t\t         0.523972,0.847133,0.088229,0.418592,0.896542,0.144841,0.418592,0.896542,0.144841,0.523972,0.847133,0.088229,\n\t\t\t         0.552141,0.829951,0.079226,0.345561,0.936674,0.056734,0.489456,0.871731,0.021485,0.691061,0.722770,-0.001129,\n\t\t\t         0.685080,0.728324,0.012879,0.523972,0.847133,0.088229,0.523972,0.847133,0.088229,0.685080,0.728324,0.012879,\n\t\t\t         0.717429,0.695639,0.036775,0.552141,0.829951,0.079226,0.364696,0.920713,0.138768,0.418592,0.896542,0.144841,\n\t\t\t         0.280099,0.946532,0.159948,0.288675,0.920255,0.264107,0.288675,0.920255,0.264107,0.280099,0.946532,0.159948,\n\t\t\t         -0.017548,0.991943,0.125217,0.131779,0.914426,0.382641,0.418592,0.896542,0.144841,0.345561,0.936674,0.056734,\n\t\t\t         0.132939,0.990417,0.036958,0.280099,0.946532,0.159948,0.280099,0.946532,0.159948,0.132939,0.990417,0.036958,\n\t\t\t         -0.085299,0.996063,0.023560,-0.017548,0.991943,0.125217,0.364696,0.920713,0.138768,0.288675,0.920255,0.264107,\n\t\t\t         0.159886,0.963073,0.216468,0.311472,0.942595,0.120273,0.311472,0.942595,0.120273,0.159886,0.963073,0.216468,\n\t\t\t         0.143010,0.981292,0.128819,0.423933,0.900540,0.096347,0.288675,0.920255,0.264107,0.131779,0.914426,0.382641,\n\t\t\t         0.062502,0.934599,0.350139,0.159886,0.963073,0.216468,0.159886,0.963073,0.216468,0.062502,0.934599,0.350139,\n\t\t\t         -0.072665,0.969939,0.232215,0.143010,0.981292,0.128819,-0.978393,0.159154,0.131718,-0.994964,-0.044008,0.089999,\n\t\t\t         -0.991699,-0.061342,0.112857,-0.974609,0.155492,0.161077,-0.974609,0.155492,0.161077,-0.991699,-0.061342,0.112857,\n\t\t\t         -0.987274,-0.080966,0.136662,-0.965514,0.165471,0.200873,-0.994964,-0.044008,0.089999,-0.973327,-0.219764,0.065554,\n\t\t\t         -0.963012,-0.256325,0.082766,-0.991699,-0.061342,0.112857,-0.991699,-0.061342,0.112857,-0.963012,-0.256325,0.082766,\n\t\t\t         -0.951964,-0.288858,0.101260,-0.987274,-0.080966,0.136662,-0.978393,0.159154,0.131718,-0.974609,0.155492,0.161077,\n\t\t\t         -0.895932,0.376354,0.235847,-0.915738,0.361705,0.174749,-0.915738,0.361705,0.174749,-0.895932,0.376354,0.235847,\n\t\t\t         -0.757561,0.563555,0.329325,-0.818049,0.531541,0.219581,-0.974609,0.155492,0.161077,-0.965514,0.165471,0.200873,\n\t\t\t         -0.860012,0.417768,0.292886,-0.895932,0.376354,0.235847,-0.895932,0.376354,0.235847,-0.860012,0.417768,0.292886,\n\t\t\t         -0.668599,0.626057,0.401227,-0.757561,0.563555,0.329325,-0.978393,0.159154,0.131718,-0.915738,0.361705,0.174749,\n\t\t\t         -0.912717,0.391858,0.115543,-0.978027,0.176763,0.110385,-0.978027,0.176763,0.110385,-0.912717,0.391858,0.115543,\n\t\t\t         -0.892270,0.430952,0.134465,-0.972839,0.183508,0.140904,-0.915738,0.361705,0.174749,-0.818049,0.531541,0.219581,\n\t\t\t         -0.838069,0.534623,0.108585,-0.912717,0.391858,0.115543,-0.912717,0.391858,0.115543,-0.838069,0.534623,0.108585,\n\t\t\t         -0.825983,0.551744,0.115360,-0.892270,0.430952,0.134465,-0.978393,0.159154,0.131718,-0.978027,0.176763,0.110385,\n\t\t\t         -0.995697,-0.044679,0.081088,-0.994964,-0.044008,0.089999,-0.994964,-0.044008,0.089999,-0.995697,-0.044679,0.081088,\n\t\t\t         -0.979339,-0.193609,0.057894,-0.973327,-0.219764,0.065554,-0.978027,0.176763,0.110385,-0.972839,0.183508,0.140904,\n\t\t\t         -0.989715,-0.087863,0.112644,-0.995697,-0.044679,0.081088,-0.995697,-0.044679,0.081088,-0.989715,-0.087863,0.112644,\n\t\t\t         -0.969481,-0.232704,0.076815,-0.979339,-0.193609,0.057894,0.687368,-0.720389,-0.092441,0.695364,-0.691702,-0.194922,\n\t\t\t         0.586688,-0.792932,-0.164342,0.629109,-0.772423,-0.086947,0.809870,-0.581011,-0.080691,0.823176,-0.538469,-0.179937,\n\t\t\t         0.796075,-0.572558,-0.195898,0.775353,-0.625446,-0.087130,0.775353,-0.625446,-0.087130,0.687368,-0.720389,-0.092441,\n\t\t\t         0.678091,-0.733726,-0.041963,0.753655,-0.655354,-0.049776,0.753655,-0.655354,-0.049776,0.678091,-0.733726,-0.041963,\n\t\t\t         0.690573,-0.723014,-0.017182,0.751427,-0.659078,-0.030183,0.687368,-0.720389,-0.092441,0.629109,-0.772423,-0.086947,\n\t\t\t         0.659230,-0.751366,-0.028962,0.678091,-0.733726,-0.041963,0.678091,-0.733726,-0.041963,0.659230,-0.751366,-0.028962,\n\t\t\t         0.687155,-0.726493,0.001068,0.690573,-0.723014,-0.017182,0.775353,-0.625446,-0.087130,0.753655,-0.655354,-0.049776,\n\t\t\t         0.822535,-0.564806,-0.066378,0.809870,-0.581011,-0.080691,0.809870,-0.581011,-0.080691,0.822535,-0.564806,-0.066378,\n\t\t\t         0.926206,-0.363811,-0.098636,0.916471,-0.390851,-0.085116,0.753655,-0.655354,-0.049776,0.751427,-0.659078,-0.030183,\n\t\t\t         0.860134,-0.506912,-0.056093,0.822535,-0.564806,-0.066378,0.822535,-0.564806,-0.066378,0.860134,-0.506912,-0.056093,\n\t\t\t         0.951750,-0.290353,-0.099063,0.926206,-0.363811,-0.098636,0.919401,-0.362468,-0.152532,0.823176,-0.538469,-0.179937,\n\t\t\t         0.809870,-0.581011,-0.080691,0.916471,-0.390851,-0.085116,0.943999,0.322550,-0.069033,0.941832,0.327799,-0.073824,\n\t\t\t         0.993500,0.002716,-0.113773,0.996521,-0.010407,-0.082430,0.996521,-0.010407,-0.082430,0.993500,0.002716,-0.113773,\n\t\t\t         0.919401,-0.362468,-0.152532,0.916471,-0.390851,-0.085116,0.829920,0.554796,-0.058107,0.833888,0.551378,-0.023957,\n\t\t\t         0.941832,0.327799,-0.073824,0.943999,0.322550,-0.069033,0.943999,0.322550,-0.069033,0.996521,-0.010407,-0.082430,\n\t\t\t         0.993652,-0.007904,-0.112094,0.941221,0.323160,-0.098025,0.941221,0.323160,-0.098025,0.993652,-0.007904,-0.112094,\n\t\t\t         0.991913,0.008606,-0.126499,0.940947,0.314829,-0.124454,0.996521,-0.010407,-0.082430,0.916471,-0.390851,-0.085116,\n\t\t\t         0.926206,-0.363811,-0.098636,0.993652,-0.007904,-0.112094,0.993652,-0.007904,-0.112094,0.926206,-0.363811,-0.098636,\n\t\t\t         0.951750,-0.290353,-0.099063,0.991913,0.008606,-0.126499,0.943999,0.322550,-0.069033,0.941221,0.323160,-0.098025,\n\t\t\t         0.815455,0.573382,-0.079043,0.829920,0.554796,-0.058107,0.829920,0.554796,-0.058107,0.815455,0.573382,-0.079043,\n\t\t\t         0.656453,0.751305,-0.067537,0.696341,0.715567,-0.054964,0.941221,0.323160,-0.098025,0.940947,0.314829,-0.124454,\n\t\t\t         0.797754,0.591784,-0.115360,0.815455,0.573382,-0.079043,0.815455,0.573382,-0.079043,0.797754,0.591784,-0.115360,\n\t\t\t         0.592883,0.796716,-0.117008,0.656453,0.751305,-0.067537,0.717429,0.695639,0.036775,0.833888,0.551378,-0.023957,\n\t\t\t         0.829920,0.554796,-0.058107,0.696341,0.715567,-0.054964,-0.859584,-0.509445,0.038972,-0.792230,-0.609699,0.024445,\n\t\t\t         -0.913785,-0.403546,0.045625,-0.929106,-0.369457,0.014771,-0.613178,-0.789056,0.036653,-0.520341,-0.853603,-0.024506,\n\t\t\t         -0.792230,-0.609699,0.024445,-0.859584,-0.509445,0.038972,-0.929106,-0.369457,0.014771,-0.913785,-0.403546,0.045625,\n\t\t\t         -0.946989,-0.316538,0.054506,-0.932829,-0.360149,0.008789,-0.932829,-0.360149,0.008789,-0.946989,-0.316538,0.054506,\n\t\t\t         -0.969481,-0.232704,0.076815,-0.945799,-0.324168,0.019257,0.435530,-0.897336,-0.071200,0.443525,-0.889248,-0.111637,\n\t\t\t         0.058535,-0.996643,-0.056734,0.014008,-0.998962,-0.043275,-0.929106,-0.369457,0.014771,-0.932829,-0.360149,0.008789,\n\t\t\t         -0.954009,-0.299173,0.017579,-0.952361,-0.299020,0.059572,-0.952361,-0.299020,0.059572,-0.954009,-0.299173,0.017579,\n\t\t\t         -0.968230,-0.235023,0.085330,-0.954711,-0.287149,0.077883,-0.932829,-0.360149,0.008789,-0.945799,-0.324168,0.019257,\n\t\t\t         -0.940397,-0.339366,-0.020814,-0.954009,-0.299173,0.017579,-0.954009,-0.299173,0.017579,-0.940397,-0.339366,-0.020814,\n\t\t\t         -0.961150,-0.263039,0.083377,-0.968230,-0.235023,0.085330,-0.929106,-0.369457,0.014771,-0.952361,-0.299020,0.059572,\n\t\t\t         -0.900418,-0.430952,0.059175,-0.859584,-0.509445,0.038972,-0.859584,-0.509445,0.038972,-0.900418,-0.430952,0.059175,\n\t\t\t         -0.685934,-0.725578,0.054811,-0.613178,-0.789056,0.036653,-0.952361,-0.299020,0.059572,-0.954711,-0.287149,0.077883,\n\t\t\t         -0.907254,-0.415235,0.066500,-0.900418,-0.430952,0.059175,-0.900418,-0.430952,0.059175,-0.907254,-0.415235,0.066500,\n\t\t\t         -0.683493,-0.725516,0.080233,-0.685934,-0.725578,0.054811,0.629109,-0.772423,-0.086947,0.586688,-0.792932,-0.164342,\n\t\t\t         0.443525,-0.889248,-0.111637,0.435530,-0.897336,-0.071200,0.014008,-0.998962,-0.043275,0.058535,-0.996643,-0.056734,\n\t\t\t         -0.306558,-0.951506,-0.024964,-0.318674,-0.947813,-0.004730,-0.318674,-0.947813,-0.004730,-0.306558,-0.951506,-0.024964,\n\t\t\t         -0.520341,-0.853603,-0.024506,-0.613178,-0.789056,0.036653,-0.775689,0.622883,0.101444,-0.732505,0.673330,0.100070,\n\t\t\t         -0.548418,0.833155,0.071017,-0.591571,0.800134,0.098819,0.014008,-0.998962,-0.043275,-0.318674,-0.947813,-0.004730,\n\t\t\t         -0.317759,-0.948088,0.011444,-0.018799,-0.999786,-0.006897,-0.018799,-0.999786,-0.006897,-0.317759,-0.948088,0.011444,\n\t\t\t         -0.303415,-0.949248,0.082614,-0.024995,-0.997711,0.062593,-0.318674,-0.947813,-0.004730,-0.613178,-0.789056,0.036653,\n\t\t\t         -0.685934,-0.725578,0.054811,-0.317759,-0.948088,0.011444,-0.317759,-0.948088,0.011444,-0.685934,-0.725578,0.054811,\n\t\t\t         -0.683493,-0.725516,0.080233,-0.303415,-0.949248,0.082614,0.014008,-0.998962,-0.043275,-0.018799,-0.999786,-0.006897,\n\t\t\t         0.412854,-0.910581,-0.019166,0.435530,-0.897336,-0.071200,0.435530,-0.897336,-0.071200,0.412854,-0.910581,-0.019166,\n\t\t\t         0.659230,-0.751366,-0.028962,0.629109,-0.772423,-0.086947,-0.018799,-0.999786,-0.006897,-0.024995,-0.997711,0.062593,\n\t\t\t         0.409711,-0.911618,0.032624,0.412854,-0.910581,-0.019166,0.412854,-0.910581,-0.019166,0.409711,-0.911618,0.032624,\n\t\t\t         0.687155,-0.726493,0.001068,0.659230,-0.751366,-0.028962,-0.842677,0.530869,0.089694,-0.825983,0.551744,0.115360,\n\t\t\t         -0.732505,0.673330,0.100070,-0.775689,0.622883,0.101444,-0.591571,0.800134,0.098819,-0.548418,0.833155,0.071017,\n\t\t\t         -0.327280,0.944365,0.032289,-0.331431,0.940153,0.078799,-0.331431,0.940153,0.078799,-0.327280,0.944365,0.032289,\n\t\t\t         -0.085299,0.996063,0.023560,-0.083285,0.995239,0.050203,0.331919,0.942991,-0.023743,0.345561,0.936674,0.056734,\n\t\t\t         0.552141,0.829951,0.079226,0.532762,0.844844,-0.048769,-0.591571,0.800134,0.098819,-0.331431,0.940153,0.078799,\n\t\t\t         -0.359172,0.932768,-0.029939,-0.642933,0.765893,-0.002014,-0.642933,0.765893,-0.002014,-0.359172,0.932768,-0.029939,\n\t\t\t         -0.323435,0.945708,-0.031343,-0.654317,0.756188,-0.001373,-0.331431,0.940153,0.078799,-0.083285,0.995239,0.050203,\n\t\t\t         -0.109745,0.992645,-0.051027,-0.359172,0.932768,-0.029939,-0.359172,0.932768,-0.029939,-0.109745,0.992645,-0.051027,\n\t\t\t         -0.073977,0.993988,-0.080660,-0.323435,0.945708,-0.031343,-0.591571,0.800134,0.098819,-0.642933,0.765893,-0.002014,\n\t\t\t         -0.840541,0.541673,0.005554,-0.775689,0.622883,0.101444,-0.775689,0.622883,0.101444,-0.840541,0.541673,0.005554,\n\t\t\t         -0.888699,0.458174,-0.014801,-0.842677,0.530869,0.089694,-0.642933,0.765893,-0.002014,-0.654317,0.756188,-0.001373,\n\t\t\t         -0.878140,0.478195,0.013398,-0.840541,0.541673,0.005554,-0.840541,0.541673,0.005554,-0.878140,0.478195,0.013398,\n\t\t\t         -0.925138,0.379528,0.003906,-0.888699,0.458174,-0.014801,0.532762,0.844844,-0.048769,0.552141,0.829951,0.079226,\n\t\t\t         0.717429,0.695639,0.036775,0.696341,0.715567,-0.054964,0.131443,0.991211,0.014130,0.132939,0.990417,0.036958,\n\t\t\t         0.345561,0.936674,0.056734,0.331919,0.942991,-0.023743,0.331919,0.942991,-0.023743,0.532762,0.844844,-0.048769,\n\t\t\t         0.499649,0.863765,-0.064882,0.338328,0.938810,-0.064272,0.338328,0.938810,-0.064272,0.499649,0.863765,-0.064882,\n\t\t\t         0.421857,0.896695,-0.133946,0.291238,0.945585,-0.144871,0.532762,0.844844,-0.048769,0.696341,0.715567,-0.054964,\n\t\t\t         0.656453,0.751305,-0.067537,0.499649,0.863765,-0.064882,0.499649,0.863765,-0.064882,0.656453,0.751305,-0.067537,\n\t\t\t         0.592883,0.796716,-0.117008,0.421857,0.896695,-0.133946,0.331919,0.942991,-0.023743,0.338328,0.938810,-0.064272,\n\t\t\t         0.134220,0.989074,-0.060884,0.131443,0.991211,0.014130,0.131443,0.991211,0.014130,0.134220,0.989074,-0.060884,\n\t\t\t         -0.109745,0.992645,-0.051027,-0.083285,0.995239,0.050203,0.338328,0.938810,-0.064272,0.291238,0.945585,-0.144871,\n\t\t\t         0.122715,0.983978,-0.129246,0.134220,0.989074,-0.060884,0.134220,0.989074,-0.060884,0.122715,0.983978,-0.129246,\n\t\t\t         -0.073977,0.993988,-0.080660,-0.109745,0.992645,-0.051027,-0.085299,0.996063,0.023560,0.132939,0.990417,0.036958,\n\t\t\t         0.131443,0.991211,0.014130,-0.083285,0.995239,0.050203,-0.977264,-0.210181,0.027833,-0.989715,-0.087863,0.112644,\n\t\t\t         -0.972839,0.183508,0.140904,-0.993683,0.097781,0.054842,-0.969481,-0.232704,0.076815,-0.989715,-0.087863,0.112644,\n\t\t\t         -0.977264,-0.210181,0.027833,-0.945799,-0.324168,0.019257,-0.993683,0.097781,0.054842,-0.972839,0.183508,0.140904,\n\t\t\t         -0.892270,0.430952,0.134465,-0.907834,0.412030,0.077425,-0.907834,0.412030,0.077425,-0.892270,0.430952,0.134465,\n\t\t\t         -0.825983,0.551744,0.115360,-0.842677,0.530869,0.089694,-0.943999,-0.329814,0.006531,-0.967772,-0.251625,0.009186,\n\t\t\t         -0.920225,-0.387127,0.057100,-0.859615,-0.508316,0.051363,-0.993683,0.097781,0.054842,-0.907834,0.412030,0.077425,\n\t\t\t         -0.932951,0.358409,-0.033326,-0.998932,0.025483,-0.038026,-0.998932,0.025483,-0.038026,-0.932951,0.358409,-0.033326,\n\t\t\t         -0.954772,0.297220,-0.006775,-0.999664,0.022797,0.010712,-0.907834,0.412030,0.077425,-0.842677,0.530869,0.089694,\n\t\t\t         -0.888699,0.458174,-0.014801,-0.932951,0.358409,-0.033326,-0.932951,0.358409,-0.033326,-0.888699,0.458174,-0.014801,\n\t\t\t         -0.925138,0.379528,0.003906,-0.954772,0.297220,-0.006775,-0.993683,0.097781,0.054842,-0.998932,0.025483,-0.038026,\n\t\t\t         -0.956481,-0.289560,-0.035829,-0.977264,-0.210181,0.027833,-0.977264,-0.210181,0.027833,-0.956481,-0.289560,-0.035829,\n\t\t\t         -0.940397,-0.339366,-0.020814,-0.945799,-0.324168,0.019257,-0.998932,0.025483,-0.038026,-0.999664,0.022797,0.010712,\n\t\t\t         -0.971191,-0.232276,0.053163,-0.956481,-0.289560,-0.035829,-0.956481,-0.289560,-0.035829,-0.971191,-0.232276,0.053163,\n\t\t\t         -0.961150,-0.263039,0.083377,-0.940397,-0.339366,-0.020814,0.686575,-0.714103,0.136357,0.794916,-0.595721,0.114811,\n\t\t\t         0.733848,-0.678213,0.038209,0.699484,-0.711997,0.061129,0.957518,-0.287912,-0.015656,0.911252,-0.409009,-0.047670,\n\t\t\t         0.792322,-0.610034,0.003113,0.868435,-0.493118,0.051363,0.792322,-0.610034,0.003113,0.751427,-0.659078,-0.030183,\n\t\t\t         0.690573,-0.723014,-0.017182,0.733848,-0.678213,0.038209,0.733848,-0.678213,0.038209,0.690573,-0.723014,-0.017182,\n\t\t\t         0.687155,-0.726493,0.001068,0.699484,-0.711997,0.061129,0.868435,-0.493118,0.051363,0.794916,-0.595721,0.114811,\n\t\t\t         0.828303,-0.560198,-0.009033,0.906888,-0.416456,-0.063631,0.794916,-0.595721,0.114811,0.686575,-0.714103,0.136357,\n\t\t\t         0.673147,-0.738639,0.035554,0.828303,-0.560198,-0.009033,0.983581,-0.145787,-0.106265,0.911252,-0.409009,-0.047670,\n\t\t\t         0.957518,-0.287912,-0.015656,0.998260,0.014801,-0.056703,0.984893,0.084078,-0.151311,0.978423,0.188543,-0.084414,\n\t\t\t         0.963927,0.246162,-0.101108,0.946471,0.280587,-0.159429,0.868435,-0.493118,0.051363,0.906888,-0.416456,-0.063631,\n\t\t\t         0.964385,-0.244636,-0.100253,0.957518,-0.287912,-0.015656,0.957518,-0.287912,-0.015656,0.964385,-0.244636,-0.100253,\n\t\t\t         0.995300,0.013215,-0.095828,0.998260,0.014801,-0.056703,0.792322,-0.610034,0.003113,0.911252,-0.409009,-0.047670,\n\t\t\t         0.860134,-0.506912,-0.056093,0.751427,-0.659078,-0.030183,0.911252,-0.409009,-0.047670,0.983581,-0.145787,-0.106265,\n\t\t\t         0.951750,-0.290353,-0.099063,0.860134,-0.506912,-0.056093,0.983581,-0.145787,-0.106265,0.998260,0.014801,-0.056703,\n\t\t\t         0.978423,0.188543,-0.084414,0.984893,0.084078,-0.151311,0.906766,0.412610,-0.086520,0.820338,0.555254,-0.136692,\n\t\t\t         0.946471,0.280587,-0.159429,0.963927,0.246162,-0.101108,0.946471,0.280587,-0.159429,0.940947,0.314829,-0.124454,\n\t\t\t         0.991913,0.008606,-0.126499,0.984893,0.084078,-0.151311,0.984893,0.084078,-0.151311,0.991913,0.008606,-0.126499,\n\t\t\t         0.951750,-0.290353,-0.099063,0.983581,-0.145787,-0.106265,0.963927,0.246162,-0.101108,0.978423,0.188543,-0.084414,\n\t\t\t         0.972869,0.221809,-0.065310,0.959685,0.272164,-0.070009,0.978423,0.188543,-0.084414,0.998260,0.014801,-0.056703,\n\t\t\t         0.995300,0.013215,-0.095828,0.972869,0.221809,-0.065310,0.573626,0.813807,-0.092990,0.820338,0.555254,-0.136692,\n\t\t\t         0.906766,0.412610,-0.086520,0.703269,0.710074,-0.033662,-0.963866,-0.239021,0.117435,-0.967986,-0.197211,0.155187,\n\t\t\t         -0.930143,-0.325388,0.170019,-0.941588,-0.315592,0.117405,0.963927,0.246162,-0.101108,0.959685,0.272164,-0.070009,\n\t\t\t         0.920042,0.376415,-0.108585,0.906766,0.412610,-0.086520,0.906766,0.412610,-0.086520,0.920042,0.376415,-0.108585,\n\t\t\t         0.756249,0.639637,-0.137364,0.703269,0.710074,-0.033662,0.946471,0.280587,-0.159429,0.820338,0.555254,-0.136692,\n\t\t\t         0.797754,0.591784,-0.115360,0.940947,0.314829,-0.124454,0.820338,0.555254,-0.136692,0.573626,0.813807,-0.092990,\n\t\t\t         0.592883,0.796716,-0.117008,0.797754,0.591784,-0.115360,-0.879604,-0.456130,0.134861,-0.832881,-0.526231,0.171361,\n\t\t\t         -0.584765,-0.790796,0.180670,-0.652333,-0.741447,0.157079,-0.941588,-0.315592,0.117405,-0.879604,-0.456130,0.134861,\n\t\t\t         -0.907254,-0.415235,0.066500,-0.954711,-0.287149,0.077883,-0.278787,-0.946715,0.161077,-0.248573,-0.952178,0.177526,\n\t\t\t         0.060579,-0.986663,0.151067,0.013123,-0.987243,0.158635,-0.879604,-0.456130,0.134861,-0.652333,-0.741447,0.157079,\n\t\t\t         -0.683493,-0.725516,0.080233,-0.907254,-0.415235,0.066500,-0.971404,-0.204871,0.119907,-0.984344,-0.122166,0.126926,\n\t\t\t         -0.967986,-0.197211,0.155187,-0.963866,-0.239021,0.117435,-0.941588,-0.315592,0.117405,-0.930143,-0.325388,0.170019,\n\t\t\t         -0.832881,-0.526231,0.171361,-0.879604,-0.456130,0.134861,-0.941588,-0.315592,0.117405,-0.954711,-0.287149,0.077883,\n\t\t\t         -0.968230,-0.235023,0.085330,-0.963866,-0.239021,0.117435,-0.963866,-0.239021,0.117435,-0.968230,-0.235023,0.085330,\n\t\t\t         -0.961150,-0.263039,0.083377,-0.971404,-0.204871,0.119907,-0.930143,-0.325388,0.170019,-0.967986,-0.197211,0.155187,\n\t\t\t         -0.976653,-0.187933,0.104007,-0.920408,-0.381024,0.087283,-0.967986,-0.197211,0.155187,-0.984344,-0.122166,0.126926,\n\t\t\t         -0.990814,-0.079501,0.109348,-0.976653,-0.187933,0.104007,-0.930143,-0.325388,0.170019,-0.920408,-0.381024,0.087283,\n\t\t\t         -0.788629,-0.609882,0.077731,-0.832881,-0.526231,0.171361,-0.832881,-0.526231,0.171361,-0.788629,-0.609882,0.077731,\n\t\t\t         -0.550493,-0.830439,0.085330,-0.584765,-0.790796,0.180670,0.420057,-0.900571,0.111606,0.417188,-0.899167,0.131932,\n\t\t\t         0.686575,-0.714103,0.136357,0.699484,-0.711997,0.061129,0.013123,-0.987243,0.158635,0.420057,-0.900571,0.111606,\n\t\t\t         0.409711,-0.911618,0.032624,-0.024995,-0.997711,0.062593,-0.329325,0.943999,0.019593,-0.410474,0.911405,0.028871,\n\t\t\t         -0.710959,0.701956,0.041810,-0.688864,0.723869,0.037751,0.420057,-0.900571,0.111606,0.699484,-0.711997,0.061129,\n\t\t\t         0.687155,-0.726493,0.001068,0.409711,-0.911618,0.032624,-0.584765,-0.790796,0.180670,-0.248573,-0.952178,0.177526,\n\t\t\t         -0.278787,-0.946715,0.161077,-0.652333,-0.741447,0.157079,0.013123,-0.987243,0.158635,0.060579,-0.986663,0.151067,\n\t\t\t         0.417188,-0.899167,0.131932,0.420057,-0.900571,0.111606,0.013123,-0.987243,0.158635,-0.024995,-0.997711,0.062593,\n\t\t\t         -0.303415,-0.949248,0.082614,-0.278787,-0.946715,0.161077,-0.278787,-0.946715,0.161077,-0.303415,-0.949248,0.082614,\n\t\t\t         -0.683493,-0.725516,0.080233,-0.652333,-0.741447,0.157079,0.060579,-0.986663,0.151067,-0.248573,-0.952178,0.177526,\n\t\t\t         -0.244148,-0.965972,0.085269,0.078646,-0.995331,0.055910,-0.248573,-0.952178,0.177526,-0.584765,-0.790796,0.180670,\n\t\t\t         -0.550493,-0.830439,0.085330,-0.244148,-0.965972,0.085269,0.060579,-0.986663,0.151067,0.078646,-0.995331,0.055910,\n\t\t\t         0.422193,-0.905179,0.048799,0.417188,-0.899167,0.131932,0.417188,-0.899167,0.131932,0.422193,-0.905179,0.048799,\n\t\t\t         0.673147,-0.738639,0.035554,0.686575,-0.714103,0.136357,-0.889096,0.455123,0.048158,-0.880703,0.470229,0.056459,\n\t\t\t         -0.938139,0.341075,0.059175,-0.936644,0.346477,0.051027,-0.688864,0.723869,0.037751,-0.889096,0.455123,0.048158,\n\t\t\t         -0.878140,0.478195,0.013398,-0.654317,0.756188,-0.001373,0.393384,0.917814,-0.053285,0.472030,0.881375,0.018525,\n\t\t\t         0.322550,0.945830,0.036744,0.303659,0.949583,-0.077609,-0.889096,0.455123,0.048158,-0.936644,0.346477,0.051027,\n\t\t\t         -0.925138,0.379528,0.003906,-0.878140,0.478195,0.013398,-0.000397,0.999725,-0.022553,-0.084140,0.996124,0.024659,\n\t\t\t         -0.410474,0.911405,0.028871,-0.329325,0.943999,0.019593,-0.688864,0.723869,0.037751,-0.710959,0.701956,0.041810,\n\t\t\t         -0.880703,0.470229,0.056459,-0.889096,0.455123,0.048158,-0.688864,0.723869,0.037751,-0.654317,0.756188,-0.001373,\n\t\t\t         -0.323435,0.945708,-0.031343,-0.329325,0.943999,0.019593,-0.329325,0.943999,0.019593,-0.323435,0.945708,-0.031343,\n\t\t\t         -0.073977,0.993988,-0.080660,-0.000397,0.999725,-0.022553,-0.710959,0.701956,0.041810,-0.410474,0.911405,0.028871,\n\t\t\t         -0.450758,0.888333,-0.087436,-0.707694,0.703940,-0.059847,-0.410474,0.911405,0.028871,-0.084140,0.996124,0.024659,\n\t\t\t         -0.160375,0.980865,-0.110202,-0.450758,0.888333,-0.087436,-0.710959,0.701956,0.041810,-0.707694,0.703940,-0.059847,\n\t\t\t         -0.869778,0.492477,-0.030152,-0.880703,0.470229,0.056459,-0.880703,0.470229,0.056459,-0.869778,0.492477,-0.030152,\n\t\t\t         -0.940977,0.338298,-0.010163,-0.938139,0.341075,0.059175,0.573626,0.813807,-0.092990,0.703269,0.710074,-0.033662,\n\t\t\t         0.472030,0.881375,0.018525,0.393384,0.917814,-0.053285,0.158422,0.986877,0.030976,0.195593,0.977691,-0.076510,\n\t\t\t         0.303659,0.949583,-0.077609,0.322550,0.945830,0.036744,0.303659,0.949583,-0.077609,0.291238,0.945585,-0.144871,\n\t\t\t         0.421857,0.896695,-0.133946,0.393384,0.917814,-0.053285,0.393384,0.917814,-0.053285,0.421857,0.896695,-0.133946,\n\t\t\t         0.592883,0.796716,-0.117008,0.573626,0.813807,-0.092990,0.322550,0.945830,0.036744,0.472030,0.881375,0.018525,\n\t\t\t         0.509934,0.848476,-0.141453,0.298715,0.944670,-0.135411,0.472030,0.881375,0.018525,0.703269,0.710074,-0.033662,\n\t\t\t         0.756249,0.639637,-0.137364,0.509934,0.848476,-0.141453,-0.000397,0.999725,-0.022553,0.195593,0.977691,-0.076510,\n\t\t\t         0.158422,0.986877,0.030976,-0.084140,0.996124,0.024659,-0.963439,0.262520,0.053407,-0.969420,0.240028,0.050569,\n\t\t\t         -0.996307,0.057588,0.063204,-0.996368,0.047548,0.070498,0.322550,0.945830,0.036744,0.298715,0.944670,-0.135411,\n\t\t\t         0.091250,0.987823,-0.125919,0.158422,0.986877,0.030976,0.158422,0.986877,0.030976,0.091250,0.987823,-0.125919,\n\t\t\t         -0.160375,0.980865,-0.110202,-0.084140,0.996124,0.024659,0.303659,0.949583,-0.077609,0.195593,0.977691,-0.076510,\n\t\t\t         0.122715,0.983978,-0.129246,0.291238,0.945585,-0.144871,0.195593,0.977691,-0.076510,-0.000397,0.999725,-0.022553,\n\t\t\t         -0.073977,0.993988,-0.080660,0.122715,0.983978,-0.129246,-0.986633,-0.132176,0.095218,-0.992615,-0.079379,0.091678,\n\t\t\t         -0.984344,-0.122166,0.126926,-0.971404,-0.204871,0.119907,-0.996368,0.047548,0.070498,-0.986633,-0.132176,0.095218,\n\t\t\t         -0.971191,-0.232276,0.053163,-0.999664,0.022797,0.010712,-0.986633,-0.132176,0.095218,-0.971404,-0.204871,0.119907,\n\t\t\t         -0.961150,-0.263039,0.083377,-0.971191,-0.232276,0.053163,-0.938139,0.341075,0.059175,-0.969420,0.240028,0.050569,\n\t\t\t         -0.963439,0.262520,0.053407,-0.936644,0.346477,0.051027,-0.996368,0.047548,0.070498,-0.996307,0.057588,0.063204,\n\t\t\t         -0.992615,-0.079379,0.091678,-0.986633,-0.132176,0.095218,-0.996368,0.047548,0.070498,-0.999664,0.022797,0.010712,\n\t\t\t         -0.954772,0.297220,-0.006775,-0.963439,0.262520,0.053407,-0.963439,0.262520,0.053407,-0.954772,0.297220,-0.006775,\n\t\t\t         -0.925138,0.379528,0.003906,-0.936644,0.346477,0.051027,-0.996307,0.057588,0.063204,-0.969420,0.240028,0.050569,\n\t\t\t         -0.974487,0.224311,-0.003967,-0.995941,0.086612,0.023652,-0.969420,0.240028,0.050569,-0.938139,0.341075,0.059175,\n\t\t\t         -0.940977,0.338298,-0.010163,-0.974487,0.224311,-0.003967,-0.996307,0.057588,0.063204,-0.995941,0.086612,0.023652,\n\t\t\t         -0.996826,-0.015351,0.077975,-0.992615,-0.079379,0.091678,-0.992615,-0.079379,0.091678,-0.996826,-0.015351,0.077975,\n\t\t\t         -0.990814,-0.079501,0.109348,-0.984344,-0.122166,0.126926,0.057222,0.995117,-0.080386,-0.008454,0.923276,-0.383953,\n\t\t\t         -0.123722,0.913785,-0.386822,-0.100284,0.990387,-0.095157,-0.100284,0.990387,-0.095157,-0.123722,0.913785,-0.386822,\n\t\t\t         -0.233406,0.902493,-0.361950,-0.260964,0.954650,-0.143162,-0.008454,0.923276,-0.383953,-0.072665,0.997314,0.008240,\n\t\t\t         -0.165105,0.986145,-0.015473,-0.123722,0.913785,-0.386822,-0.123722,0.913785,-0.386822,-0.165105,0.986145,-0.015473,\n\t\t\t         -0.244911,0.969512,-0.006134,-0.233406,0.902493,-0.361950,0.057222,0.995117,-0.080386,-0.100284,0.990387,-0.095157,\n\t\t\t         -0.103030,0.951598,0.289468,0.074618,0.953490,0.292001,0.074618,0.953490,0.292001,-0.103030,0.951598,0.289468,\n\t\t\t         -0.175024,0.984436,-0.015564,-0.009522,0.998535,-0.053102,-0.100284,0.990387,-0.095157,-0.260964,0.954650,-0.143162,\n\t\t\t         -0.253243,0.931272,0.261788,-0.103030,0.951598,0.289468,-0.103030,0.951598,0.289468,-0.253243,0.931272,0.261788,\n\t\t\t         -0.244209,0.969695,0.002136,-0.175024,0.984436,-0.015564,0.057222,0.995117,-0.080386,0.074618,0.953490,0.292001,\n\t\t\t         0.165563,0.951567,0.258919,0.138035,0.986847,-0.083895,0.138035,0.986847,-0.083895,0.165563,0.951567,0.258919,\n\t\t\t         0.147526,0.963713,0.222419,0.124180,0.989257,-0.076846,0.074618,0.953490,0.292001,-0.009522,0.998535,-0.053102,\n\t\t\t         0.087710,0.991119,-0.099918,0.165563,0.951567,0.258919,0.165563,0.951567,0.258919,0.087710,0.991119,-0.099918,\n\t\t\t         0.088107,0.987030,-0.134007,0.147526,0.963713,0.222419,0.057222,0.995117,-0.080386,0.138035,0.986847,-0.083895,\n\t\t\t         0.035371,0.932951,-0.358196,-0.008454,0.923276,-0.383953,-0.008454,0.923276,-0.383953,0.035371,0.932951,-0.358196,\n\t\t\t         -0.023194,0.998657,0.046083,-0.072665,0.997314,0.008240,0.138035,0.986847,-0.083895,0.124180,0.989257,-0.076846,\n\t\t\t         0.004578,0.942930,-0.332926,0.035371,0.932951,-0.358196,0.035371,0.932951,-0.358196,0.004578,0.942930,-0.332926,\n\t\t\t         -0.044313,0.996704,0.067904,-0.023194,0.998657,0.046083,-0.591296,0.772576,-0.231208,-0.401868,0.893307,-0.201209,\n\t\t\t         -0.357982,0.879635,-0.313120,-0.537400,0.811274,-0.230171,-0.537400,0.811274,-0.230171,-0.357982,0.879635,-0.313120,\n\t\t\t         -0.344188,0.938322,0.032075,-0.494095,0.863704,0.099124,-0.401868,0.893307,-0.201209,-0.260964,0.954650,-0.143162,\n\t\t\t         -0.233406,0.902493,-0.361950,-0.357982,0.879635,-0.313120,-0.357982,0.879635,-0.313120,-0.233406,0.902493,-0.361950,\n\t\t\t         -0.244911,0.969512,-0.006134,-0.344188,0.938322,0.032075,-0.591296,0.772576,-0.231208,-0.537400,0.811274,-0.230171,\n\t\t\t         -0.717154,0.688437,-0.108280,-0.770257,0.605396,-0.200293,-0.770257,0.605396,-0.200293,-0.717154,0.688437,-0.108280,\n\t\t\t         -0.842128,0.538743,0.023438,-0.871303,0.469436,-0.142796,-0.537400,0.811274,-0.230171,-0.494095,0.863704,0.099124,\n\t\t\t         -0.650960,0.736076,0.185430,-0.717154,0.688437,-0.108280,-0.717154,0.688437,-0.108280,-0.650960,0.736076,0.185430,\n\t\t\t         -0.776666,0.571154,0.265572,-0.842128,0.538743,0.023438,-0.591296,0.772576,-0.231208,-0.770257,0.605396,-0.200293,\n\t\t\t         -0.793725,0.601947,0.087252,-0.589648,0.797266,0.129063,-0.589648,0.797266,0.129063,-0.793725,0.601947,0.087252,\n\t\t\t         -0.773431,0.625904,0.100131,-0.549730,0.822840,0.143742,-0.770257,0.605396,-0.200293,-0.871303,0.469436,-0.142796,\n\t\t\t         -0.897061,0.441267,-0.022736,-0.793725,0.601947,0.087252,-0.793725,0.601947,0.087252,-0.897061,0.441267,-0.022736,\n\t\t\t         -0.886685,0.453871,0.087802,-0.773431,0.625904,0.100131,-0.591296,0.772576,-0.231208,-0.589648,0.797266,0.129063,\n\t\t\t         -0.378124,0.901730,0.209387,-0.401868,0.893307,-0.201209,-0.401868,0.893307,-0.201209,-0.378124,0.901730,0.209387,\n\t\t\t         -0.253243,0.931272,0.261788,-0.260964,0.954650,-0.143162,-0.589648,0.797266,0.129063,-0.549730,0.822840,0.143742,\n\t\t\t         -0.323557,0.945463,0.037080,-0.378124,0.901730,0.209387,-0.378124,0.901730,0.209387,-0.323557,0.945463,0.037080,\n\t\t\t         -0.244209,0.969695,0.002136,-0.253243,0.931272,0.261788,-0.987640,0.156377,-0.008911,-0.939787,0.332194,-0.080050,\n\t\t\t         -0.918119,0.374310,0.130100,-0.960112,0.192846,0.202429,-0.960112,0.192846,0.202429,-0.918119,0.374310,0.130100,\n\t\t\t         -0.864101,0.389325,0.318888,-0.913999,0.201270,0.352214,-0.939787,0.332194,-0.080050,-0.871303,0.469436,-0.142796,\n\t\t\t         -0.842128,0.538743,0.023438,-0.918119,0.374310,0.130100,-0.918119,0.374310,0.130100,-0.842128,0.538743,0.023438,\n\t\t\t         -0.776666,0.571154,0.265572,-0.864101,0.389325,0.318888,-0.987640,0.156377,-0.008911,-0.960112,0.192846,0.202429,\n\t\t\t         -0.968810,0.021699,0.246742,-0.997101,-0.024628,0.071902,-0.997101,-0.024628,0.071902,-0.968810,0.021699,0.246742,\n\t\t\t         -0.957030,-0.080386,0.278542,-0.979186,-0.137700,0.148930,-0.960112,0.192846,0.202429,-0.913999,0.201270,0.352214,\n\t\t\t         -0.926359,0.029023,0.375500,-0.968810,0.021699,0.246742,-0.968810,0.021699,0.246742,-0.926359,0.029023,0.375500,\n\t\t\t         -0.916715,-0.067263,0.393811,-0.957030,-0.080386,0.278542,-0.987640,0.156377,-0.008911,-0.997101,-0.024628,0.071902,\n\t\t\t         -0.994201,-0.098239,0.043611,-0.995086,0.098575,-0.007202,-0.995086,0.098575,-0.007202,-0.994201,-0.098239,0.043611,\n\t\t\t         -0.988250,-0.126499,0.085757,-0.994842,0.058687,0.082461,-0.997101,-0.024628,0.071902,-0.979186,-0.137700,0.148930,\n\t\t\t         -0.967376,-0.231819,0.102084,-0.994201,-0.098239,0.043611,-0.994201,-0.098239,0.043611,-0.967376,-0.231819,0.102084,\n\t\t\t         -0.963378,-0.257851,0.073275,-0.988250,-0.126499,0.085757,-0.987640,0.156377,-0.008911,-0.995086,0.098575,-0.007202,\n\t\t\t         -0.954680,0.295663,-0.033235,-0.939787,0.332194,-0.080050,-0.939787,0.332194,-0.080050,-0.954680,0.295663,-0.033235,\n\t\t\t         -0.897061,0.441267,-0.022736,-0.871303,0.469436,-0.142796,-0.995086,0.098575,-0.007202,-0.994842,0.058687,0.082461,\n\t\t\t         -0.955260,0.287271,0.070162,-0.954680,0.295663,-0.033235,-0.954680,0.295663,-0.033235,-0.955260,0.287271,0.070162,\n\t\t\t         -0.886685,0.453871,0.087802,-0.897061,0.441267,-0.022736,-0.891354,-0.386395,0.236915,-0.947844,-0.228339,0.222327,\n\t\t\t         -0.934751,-0.183294,0.304300,-0.880551,-0.382824,0.279366,-0.880551,-0.382824,0.279366,-0.934751,-0.183294,0.304300,\n\t\t\t         -0.908811,-0.196722,0.367870,-0.844172,-0.466964,0.263222,-0.947844,-0.228339,0.222327,-0.979186,-0.137700,0.148930,\n\t\t\t         -0.957030,-0.080386,0.278542,-0.934751,-0.183294,0.304300,-0.934751,-0.183294,0.304300,-0.957030,-0.080386,0.278542,\n\t\t\t         -0.916715,-0.067263,0.393811,-0.908811,-0.196722,0.367870,-0.891354,-0.386395,0.236915,-0.880551,-0.382824,0.279366,\n\t\t\t         -0.754234,-0.619404,0.217811,-0.794824,-0.570055,0.207862,-0.794824,-0.570055,0.207862,-0.754234,-0.619404,0.217811,\n\t\t\t         -0.585162,-0.802149,0.118748,-0.592730,-0.781915,0.192999,-0.880551,-0.382824,0.279366,-0.844172,-0.466964,0.263222,\n\t\t\t         -0.723350,-0.681448,0.111301,-0.754234,-0.619404,0.217811,-0.754234,-0.619404,0.217811,-0.723350,-0.681448,0.111301,\n\t\t\t         -0.537767,-0.842494,-0.031312,-0.585162,-0.802149,0.118748,-0.891354,-0.386395,0.236915,-0.794824,-0.570055,0.207862,\n\t\t\t         -0.811060,-0.550096,0.198828,-0.901914,-0.377300,0.210059,-0.901914,-0.377300,0.210059,-0.811060,-0.550096,0.198828,\n\t\t\t         -0.883053,-0.464949,0.062960,-0.917600,-0.392010,0.065523,-0.794824,-0.570055,0.207862,-0.592730,-0.781915,0.192999,\n\t\t\t         -0.590381,-0.791040,0.160283,-0.811060,-0.550096,0.198828,-0.811060,-0.550096,0.198828,-0.590381,-0.791040,0.160283,\n\t\t\t         -0.680593,-0.732536,0.010620,-0.883053,-0.464949,0.062960,-0.891354,-0.386395,0.236915,-0.901914,-0.377300,0.210059,\n\t\t\t         -0.933805,-0.318491,0.162969,-0.947844,-0.228339,0.222327,-0.947844,-0.228339,0.222327,-0.933805,-0.318491,0.162969,\n\t\t\t         -0.967376,-0.231819,0.102084,-0.979186,-0.137700,0.148930,-0.901914,-0.377300,0.210059,-0.917600,-0.392010,0.065523,\n\t\t\t         -0.935240,-0.347880,0.065432,-0.933805,-0.318491,0.162969,-0.933805,-0.318491,0.162969,-0.935240,-0.347880,0.065432,\n\t\t\t         -0.963378,-0.257851,0.073275,-0.967376,-0.231819,0.102084,-0.162297,-0.985107,0.056398,-0.399670,-0.901975,0.163213,\n\t\t\t         -0.372936,-0.927793,0.009735,-0.163518,-0.986236,-0.023469,-0.163518,-0.986236,-0.023469,-0.372936,-0.927793,0.009735,\n\t\t\t         -0.355968,-0.928922,-0.101657,-0.224982,-0.972259,-0.063784,-0.399670,-0.901975,0.163213,-0.592730,-0.781915,0.192999,\n\t\t\t         -0.585162,-0.802149,0.118748,-0.372936,-0.927793,0.009735,-0.372936,-0.927793,0.009735,-0.585162,-0.802149,0.118748,\n\t\t\t         -0.537767,-0.842494,-0.031312,-0.355968,-0.928922,-0.101657,-0.162297,-0.985107,0.056398,-0.163518,-0.986236,-0.023469,\n\t\t\t         0.039460,-0.998932,0.023041,0.076357,-0.996460,0.034700,0.076357,-0.996460,0.034700,0.039460,-0.998932,0.023041,\n\t\t\t         0.061403,-0.990905,0.119572,0.128269,-0.987030,0.096377,-0.163518,-0.986236,-0.023469,-0.224982,-0.972259,-0.063784,\n\t\t\t         -0.042543,-0.996704,0.068880,0.039460,-0.998932,0.023041,0.039460,-0.998932,0.023041,-0.042543,-0.996704,0.068880,\n\t\t\t         0.013001,-0.988617,0.149724,0.061403,-0.990905,0.119572,-0.162297,-0.985107,0.056398,0.076357,-0.996460,0.034700,\n\t\t\t         0.082949,-0.993347,0.079745,-0.244728,-0.961241,0.126743,-0.244728,-0.961241,0.126743,0.082949,-0.993347,0.079745,\n\t\t\t         0.085788,-0.996277,-0.005890,-0.287057,-0.957366,0.032350,0.076357,-0.996460,0.034700,0.128269,-0.987030,0.096377,\n\t\t\t         0.162877,-0.985198,0.052828,0.082949,-0.993347,0.079745,0.082949,-0.993347,0.079745,0.162877,-0.985198,0.052828,\n\t\t\t         0.159276,-0.985656,-0.055544,0.085788,-0.996277,-0.005890,-0.162297,-0.985107,0.056398,-0.244728,-0.961241,0.126743,\n\t\t\t         -0.426374,-0.891812,0.151189,-0.399670,-0.901975,0.163213,-0.399670,-0.901975,0.163213,-0.426374,-0.891812,0.151189,\n\t\t\t         -0.590381,-0.791040,0.160283,-0.592730,-0.781915,0.192999,-0.244728,-0.961241,0.126743,-0.287057,-0.957366,0.032350,\n\t\t\t         -0.430219,-0.902676,-0.006226,-0.426374,-0.891812,0.151189,-0.426374,-0.891812,0.151189,-0.430219,-0.902676,-0.006226,\n\t\t\t         -0.680593,-0.732536,0.010620,-0.590381,-0.791040,0.160283,-0.070559,0.996612,-0.041719,-0.087619,0.963500,-0.252937,\n\t\t\t         -0.183477,0.952910,-0.241310,-0.124760,0.989715,-0.069674,-0.124760,0.989715,-0.069674,-0.183477,0.952910,-0.241310,\n\t\t\t         -0.214118,0.946684,-0.240669,-0.191382,0.976012,-0.103641,-0.087619,0.963500,-0.252937,-0.009522,0.998535,-0.053102,\n\t\t\t         -0.175024,0.984436,-0.015564,-0.183477,0.952910,-0.241310,-0.183477,0.952910,-0.241310,-0.175024,0.984436,-0.015564,\n\t\t\t         -0.244209,0.969695,0.002136,-0.214118,0.946684,-0.240669,-0.070559,0.996612,-0.041719,-0.124760,0.989715,-0.069674,\n\t\t\t         -0.012696,0.997162,-0.073977,0.018097,0.999390,0.029206,0.018097,0.999390,0.029206,-0.012696,0.997162,-0.073977,\n\t\t\t         -0.026002,0.955809,-0.292764,0.007782,0.976836,-0.213721,-0.124760,0.989715,-0.069674,-0.191382,0.976012,-0.103641,\n\t\t\t         -0.114811,0.978790,-0.169530,-0.012696,0.997162,-0.073977,-0.012696,0.997162,-0.073977,-0.114811,0.978790,-0.169530,\n\t\t\t         -0.177007,0.943968,-0.278481,-0.026002,0.955809,-0.292764,-0.070559,0.996612,-0.041719,0.018097,0.999390,0.029206,\n\t\t\t         -0.012757,0.996551,0.081881,-0.031648,0.998474,-0.044832,-0.031648,0.998474,-0.044832,-0.012757,0.996551,0.081881,\n\t\t\t         -0.036927,0.997009,0.067537,0.012421,0.997406,-0.070650,0.018097,0.999390,0.029206,0.007782,0.976836,-0.213721,\n\t\t\t         -0.029084,0.989380,-0.142216,-0.012757,0.996551,0.081881,-0.012757,0.996551,0.081881,-0.029084,0.989380,-0.142216,\n\t\t\t         -0.068575,0.989776,-0.124882,-0.036927,0.997009,0.067537,-0.070559,0.996612,-0.041719,-0.031648,0.998474,-0.044832,\n\t\t\t         -0.008942,0.957945,-0.286721,-0.087619,0.963500,-0.252937,-0.087619,0.963500,-0.252937,-0.008942,0.957945,-0.286721,\n\t\t\t         0.087710,0.991119,-0.099918,-0.009522,0.998535,-0.053102,-0.031648,0.998474,-0.044832,0.012421,0.997406,-0.070650,\n\t\t\t         0.039460,0.947111,-0.318369,-0.008942,0.957945,-0.286721,-0.008942,0.957945,-0.286721,0.039460,0.947111,-0.318369,\n\t\t\t         0.088107,0.987030,-0.134007,0.087710,0.991119,-0.099918,-0.655873,0.744255,-0.126011,-0.391644,0.912046,-0.121494,\n\t\t\t         -0.326518,0.916471,-0.231147,-0.606067,0.771050,-0.195288,-0.606067,0.771050,-0.195288,-0.326518,0.916471,-0.231147,\n\t\t\t         -0.323557,0.945463,0.037080,-0.549730,0.822840,0.143742,-0.391644,0.912046,-0.121494,-0.191382,0.976012,-0.103641,\n\t\t\t         -0.214118,0.946684,-0.240669,-0.326518,0.916471,-0.231147,-0.326518,0.916471,-0.231147,-0.214118,0.946684,-0.240669,\n\t\t\t         -0.244209,0.969695,0.002136,-0.323557,0.945463,0.037080,-0.655873,0.744255,-0.126011,-0.606067,0.771050,-0.195288,\n\t\t\t         -0.785424,0.598651,-0.157018,-0.804254,0.578021,-0.137944,-0.804254,0.578021,-0.137944,-0.785424,0.598651,-0.157018,\n\t\t\t         -0.872982,0.478652,-0.093539,-0.857143,0.487747,-0.165410,-0.606067,0.771050,-0.195288,-0.549730,0.822840,0.143742,\n\t\t\t         -0.773431,0.625904,0.100131,-0.785424,0.598651,-0.157018,-0.785424,0.598651,-0.157018,-0.773431,0.625904,0.100131,\n\t\t\t         -0.886685,0.453871,0.087802,-0.872982,0.478652,-0.093539,-0.655873,0.744255,-0.126011,-0.804254,0.578021,-0.137944,\n\t\t\t         -0.705832,0.629353,-0.325053,-0.541490,0.777703,-0.319224,-0.541490,0.777703,-0.319224,-0.705832,0.629353,-0.325053,\n\t\t\t         -0.697928,0.666677,-0.261544,-0.545610,0.822016,-0.162969,-0.804254,0.578021,-0.137944,-0.857143,0.487747,-0.165410,\n\t\t\t         -0.774560,0.538041,-0.332469,-0.705832,0.629353,-0.325053,-0.705832,0.629353,-0.325053,-0.774560,0.538041,-0.332469,\n\t\t\t         -0.808740,0.492416,-0.321543,-0.697928,0.666677,-0.261544,-0.655873,0.744255,-0.126011,-0.541490,0.777703,-0.319224,\n\t\t\t         -0.326670,0.915983,-0.232795,-0.391644,0.912046,-0.121494,-0.391644,0.912046,-0.121494,-0.326670,0.915983,-0.232795,\n\t\t\t         -0.114811,0.978790,-0.169530,-0.191382,0.976012,-0.103641,-0.541490,0.777703,-0.319224,-0.545610,0.822016,-0.162969,\n\t\t\t         -0.312967,0.928190,-0.201178,-0.326670,0.915983,-0.232795,-0.326670,0.915983,-0.232795,-0.312967,0.928190,-0.201178,\n\t\t\t         -0.177007,0.943968,-0.278481,-0.114811,0.978790,-0.169530,-0.957762,0.221473,-0.183264,-0.904111,0.389447,-0.175695,\n\t\t\t         -0.946348,0.320475,-0.041169,-0.988739,0.137394,-0.058779,-0.988739,0.137394,-0.058779,-0.946348,0.320475,-0.041169,\n\t\t\t         -0.955260,0.287271,0.070162,-0.994842,0.058687,0.082461,-0.904111,0.389447,-0.175695,-0.857143,0.487747,-0.165410,\n\t\t\t         -0.872982,0.478652,-0.093539,-0.946348,0.320475,-0.041169,-0.946348,0.320475,-0.041169,-0.872982,0.478652,-0.093539,\n\t\t\t         -0.886685,0.453871,0.087802,-0.955260,0.287271,0.070162,-0.957762,0.221473,-0.183264,-0.988739,0.137394,-0.058779,\n\t\t\t         -0.995422,-0.015931,-0.094028,-0.976714,0.056948,-0.206702,-0.976714,0.056948,-0.206702,-0.995422,-0.015931,-0.094028,\n\t\t\t         -0.982238,-0.128666,-0.136357,-0.976897,-0.056612,-0.205969,-0.988739,0.137394,-0.058779,-0.994842,0.058687,0.082461,\n\t\t\t         -0.988250,-0.126499,0.085757,-0.995422,-0.015931,-0.094028,-0.995422,-0.015931,-0.094028,-0.988250,-0.126499,0.085757,\n\t\t\t         -0.963378,-0.257851,0.073275,-0.982238,-0.128666,-0.136357,-0.957762,0.221473,-0.183264,-0.976714,0.056948,-0.206702,\n\t\t\t         -0.984649,-0.024171,-0.172765,-0.950224,0.189367,-0.247322,-0.950224,0.189367,-0.247322,-0.984649,-0.024171,-0.172765,\n\t\t\t         -0.937254,-0.058931,-0.343547,-0.895077,0.145726,-0.421339,-0.976714,0.056948,-0.206702,-0.976897,-0.056612,-0.205969,\n\t\t\t         -0.976470,-0.190374,-0.100986,-0.984649,-0.024171,-0.172765,-0.984649,-0.024171,-0.172765,-0.976470,-0.190374,-0.100986,\n\t\t\t         -0.925687,-0.295480,-0.236152,-0.937254,-0.058931,-0.343547,-0.957762,0.221473,-0.183264,-0.950224,0.189367,-0.247322,\n\t\t\t         -0.854793,0.409192,-0.319102,-0.904111,0.389447,-0.175695,-0.904111,0.389447,-0.175695,-0.854793,0.409192,-0.319102,\n\t\t\t         -0.774560,0.538041,-0.332469,-0.857143,0.487747,-0.165410,-0.950224,0.189367,-0.247322,-0.895077,0.145726,-0.421339,\n\t\t\t         -0.867061,0.355815,-0.348613,-0.854793,0.409192,-0.319102,-0.854793,0.409192,-0.319102,-0.867061,0.355815,-0.348613,\n\t\t\t         -0.808740,0.492416,-0.321543,-0.774560,0.538041,-0.332469,-0.887295,-0.420270,-0.189795,-0.950194,-0.227790,-0.212592,\n\t\t\t         -0.946471,-0.244942,-0.210181,-0.907254,-0.353496,-0.227760,-0.907254,-0.353496,-0.227760,-0.946471,-0.244942,-0.210181,\n\t\t\t         -0.935240,-0.347880,0.065432,-0.917600,-0.392010,0.065523,-0.950194,-0.227790,-0.212592,-0.976897,-0.056612,-0.205969,\n\t\t\t         -0.982238,-0.128666,-0.136357,-0.946471,-0.244942,-0.210181,-0.946471,-0.244942,-0.210181,-0.982238,-0.128666,-0.136357,\n\t\t\t         -0.963378,-0.257851,0.073275,-0.935240,-0.347880,0.065432,-0.887295,-0.420270,-0.189795,-0.907254,-0.353496,-0.227760,\n\t\t\t         -0.883419,-0.433271,-0.178411,-0.840175,-0.531449,-0.107700,-0.840175,-0.531449,-0.107700,-0.883419,-0.433271,-0.178411,\n\t\t\t         -0.692526,-0.702231,-0.164953,-0.671133,-0.737419,-0.075686,-0.907254,-0.353496,-0.227760,-0.917600,-0.392010,0.065523,\n\t\t\t         -0.883053,-0.464949,0.062960,-0.883419,-0.433271,-0.178411,-0.883419,-0.433271,-0.178411,-0.883053,-0.464949,0.062960,\n\t\t\t         -0.680593,-0.732536,0.010620,-0.692526,-0.702231,-0.164953,-0.887295,-0.420270,-0.189795,-0.840175,-0.531449,-0.107700,\n\t\t\t         -0.797296,-0.596240,0.093661,-0.851680,-0.520035,0.064486,-0.851680,-0.520035,0.064486,-0.797296,-0.596240,0.093661,\n\t\t\t         -0.799371,-0.594378,-0.087588,-0.844203,-0.530259,-0.078158,-0.840175,-0.531449,-0.107700,-0.671133,-0.737419,-0.075686,\n\t\t\t         -0.666707,-0.740593,0.083590,-0.797296,-0.596240,0.093661,-0.797296,-0.596240,0.093661,-0.666707,-0.740593,0.083590,\n\t\t\t         -0.665059,-0.730552,-0.154668,-0.799371,-0.594378,-0.087588,-0.887295,-0.420270,-0.189795,-0.851680,-0.520035,0.064486,\n\t\t\t         -0.930692,-0.365490,-0.013886,-0.950194,-0.227790,-0.212592,-0.950194,-0.227790,-0.212592,-0.930692,-0.365490,-0.013886,\n\t\t\t         -0.976470,-0.190374,-0.100986,-0.976897,-0.056612,-0.205969,-0.851680,-0.520035,0.064486,-0.844203,-0.530259,-0.078158,\n\t\t\t         -0.882321,-0.454421,-0.122318,-0.930692,-0.365490,-0.013886,-0.930692,-0.365490,-0.013886,-0.882321,-0.454421,-0.122318,\n\t\t\t         -0.925687,-0.295480,-0.236152,-0.976470,-0.190374,-0.100986,-0.249611,-0.960326,-0.124271,-0.432417,-0.897946,-0.081545,\n\t\t\t         -0.408216,-0.895718,-0.176153,-0.270608,-0.949736,-0.157262,-0.270608,-0.949736,-0.157262,-0.408216,-0.895718,-0.176153,\n\t\t\t         -0.430219,-0.902676,-0.006226,-0.287057,-0.957366,0.032350,-0.432417,-0.897946,-0.081545,-0.671133,-0.737419,-0.075686,\n\t\t\t         -0.692526,-0.702231,-0.164953,-0.408216,-0.895718,-0.176153,-0.408216,-0.895718,-0.176153,-0.692526,-0.702231,-0.164953,\n\t\t\t         -0.680593,-0.732536,0.010620,-0.430219,-0.902676,-0.006226,-0.249611,-0.960326,-0.124271,-0.270608,-0.949736,-0.157262,\n\t\t\t         0.065615,-0.988647,-0.135105,-0.014374,-0.990143,-0.139225,-0.014374,-0.990143,-0.139225,0.065615,-0.988647,-0.135105,\n\t\t\t         0.106082,-0.978088,-0.179113,0.027436,-0.984161,-0.174993,-0.270608,-0.949736,-0.157262,-0.287057,-0.957366,0.032350,\n\t\t\t         0.085788,-0.996277,-0.005890,0.065615,-0.988647,-0.135105,0.065615,-0.988647,-0.135105,0.085788,-0.996277,-0.005890,\n\t\t\t         0.159276,-0.985656,-0.055544,0.106082,-0.978088,-0.179113,-0.249611,-0.960326,-0.124271,-0.014374,-0.990143,-0.139225,\n\t\t\t         -0.066042,-0.986206,-0.151646,-0.302652,-0.951537,-0.054384,-0.302652,-0.951537,-0.054384,-0.066042,-0.986206,-0.151646,\n\t\t\t         -0.089480,-0.954558,-0.284219,-0.280618,-0.920591,-0.271523,-0.014374,-0.990143,-0.139225,0.027436,-0.984161,-0.174993,\n\t\t\t         -0.020814,-0.979949,-0.198065,-0.066042,-0.986206,-0.151646,-0.066042,-0.986206,-0.151646,-0.020814,-0.979949,-0.198065,\n\t\t\t         -0.011750,-0.984100,-0.177160,-0.089480,-0.954558,-0.284219,-0.249611,-0.960326,-0.124271,-0.302652,-0.951537,-0.054384,\n\t\t\t         -0.469466,-0.882504,0.027650,-0.432417,-0.897946,-0.081545,-0.432417,-0.897946,-0.081545,-0.469466,-0.882504,0.027650,\n\t\t\t         -0.666707,-0.740593,0.083590,-0.671133,-0.737419,-0.075686,-0.302652,-0.951537,-0.054384,-0.280618,-0.920591,-0.271523,\n\t\t\t         -0.475234,-0.848781,-0.231635,-0.469466,-0.882504,0.027650,-0.469466,-0.882504,0.027650,-0.475234,-0.848781,-0.231635,\n\t\t\t         -0.665059,-0.730552,-0.154668,-0.666707,-0.740593,0.083590,-0.224067,-0.856960,-0.464064,-0.200293,-0.852351,-0.483047,\n\t\t\t         -0.035768,-0.933958,-0.355480,-0.111270,-0.956145,-0.270852,-0.111270,-0.956145,-0.270852,-0.035768,-0.933958,-0.355480,\n\t\t\t         0.041078,-0.989929,-0.135411,0.022950,-0.999695,-0.007324,-0.200293,-0.852351,-0.483047,-0.280618,-0.920591,-0.271523,\n\t\t\t         -0.089480,-0.954558,-0.284219,-0.035768,-0.933958,-0.355480,-0.035768,-0.933958,-0.355480,-0.089480,-0.954558,-0.284219,\n\t\t\t         -0.011750,-0.984100,-0.177160,0.041078,-0.989929,-0.135411,-0.224067,-0.856960,-0.464064,-0.111270,-0.956145,-0.270852,\n\t\t\t         -0.362957,-0.910276,-0.199011,-0.419568,-0.790490,-0.446150,-0.419568,-0.790490,-0.446150,-0.362957,-0.910276,-0.199011,\n\t\t\t         -0.633686,-0.743614,-0.213141,-0.607868,-0.663717,-0.435804,-0.111270,-0.956145,-0.270852,0.022950,-0.999695,-0.007324,\n\t\t\t         -0.188238,-0.975951,0.109714,-0.362957,-0.910276,-0.199011,-0.362957,-0.910276,-0.199011,-0.188238,-0.975951,0.109714,\n\t\t\t         -0.524674,-0.846339,0.091556,-0.633686,-0.743614,-0.213141,-0.224067,-0.856960,-0.464064,-0.419568,-0.790490,-0.446150,\n\t\t\t         -0.421094,-0.754997,-0.502609,-0.200293,-0.852351,-0.483047,-0.200293,-0.852351,-0.483047,-0.421094,-0.754997,-0.502609,\n\t\t\t         -0.475234,-0.848781,-0.231635,-0.280618,-0.920591,-0.271523,-0.419568,-0.790490,-0.446150,-0.607868,-0.663717,-0.435804,\n\t\t\t         -0.605701,-0.647206,-0.462813,-0.421094,-0.754997,-0.502609,-0.421094,-0.754997,-0.502609,-0.605701,-0.647206,-0.462813,\n\t\t\t         -0.665059,-0.730552,-0.154668,-0.475234,-0.848781,-0.231635,-0.795007,-0.431562,-0.426221,-0.819849,-0.465438,-0.333445,\n\t\t\t         -0.752007,-0.533097,-0.387616,-0.735191,-0.522965,-0.431227,-0.735191,-0.522965,-0.431227,-0.752007,-0.533097,-0.387616,\n\t\t\t         -0.605701,-0.647206,-0.462813,-0.607868,-0.663717,-0.435804,-0.819849,-0.465438,-0.333445,-0.844203,-0.530259,-0.078158,\n\t\t\t         -0.799371,-0.594378,-0.087588,-0.752007,-0.533097,-0.387616,-0.752007,-0.533097,-0.387616,-0.799371,-0.594378,-0.087588,\n\t\t\t         -0.665059,-0.730552,-0.154668,-0.605701,-0.647206,-0.462813,-0.795007,-0.431562,-0.426221,-0.735191,-0.522965,-0.431227,\n\t\t\t         -0.799707,-0.539781,-0.262825,-0.845058,-0.426221,-0.322794,-0.845058,-0.426221,-0.322794,-0.799707,-0.539781,-0.262825,\n\t\t\t         -0.851192,-0.501724,-0.153966,-0.889126,-0.403790,-0.215278,-0.735191,-0.522965,-0.431227,-0.607868,-0.663717,-0.435804,\n\t\t\t         -0.633686,-0.743614,-0.213141,-0.799707,-0.539781,-0.262825,-0.799707,-0.539781,-0.262825,-0.633686,-0.743614,-0.213141,\n\t\t\t         -0.524674,-0.846339,0.091556,-0.851192,-0.501724,-0.153966,-0.795007,-0.431562,-0.426221,-0.845058,-0.426221,-0.322794,\n\t\t\t         -0.845302,-0.423231,-0.326060,-0.819849,-0.465438,-0.333445,-0.819849,-0.465438,-0.333445,-0.845302,-0.423231,-0.326060,\n\t\t\t         -0.882321,-0.454421,-0.122318,-0.844203,-0.530259,-0.078158,-0.845058,-0.426221,-0.322794,-0.889126,-0.403790,-0.215278,\n\t\t\t         -0.884060,-0.392682,-0.253395,-0.845302,-0.423231,-0.326060,-0.845302,-0.423231,-0.326060,-0.884060,-0.392682,-0.253395,\n\t\t\t         -0.925687,-0.295480,-0.236152,-0.882321,-0.454421,-0.122318,0.144505,-0.921751,0.359813,0.119114,-0.896146,0.427442,\n\t\t\t         0.005249,-0.943693,0.330760,0.109958,-0.969665,0.218207,0.109958,-0.969665,0.218207,0.005249,-0.943693,0.330760,\n\t\t\t         -0.188238,-0.975951,0.109714,0.022950,-0.999695,-0.007324,0.119114,-0.896146,0.427442,0.089785,-0.872890,0.479507,\n\t\t\t         -0.062716,-0.916593,0.394848,0.005249,-0.943693,0.330760,0.005249,-0.943693,0.330760,-0.062716,-0.916593,0.394848,\n\t\t\t         -0.524674,-0.846339,0.091556,-0.188238,-0.975951,0.109714,0.144505,-0.921751,0.359813,0.109958,-0.969665,0.218207,\n\t\t\t         0.084170,-0.984649,0.152837,0.088809,-0.927488,0.363048,0.088809,-0.927488,0.363048,0.084170,-0.984649,0.152837,\n\t\t\t         0.003601,-0.991638,0.128788,-0.012879,-0.932890,0.359844,0.109958,-0.969665,0.218207,0.022950,-0.999695,-0.007324,\n\t\t\t         0.041078,-0.989929,-0.135411,0.084170,-0.984649,0.152837,0.084170,-0.984649,0.152837,0.041078,-0.989929,-0.135411,\n\t\t\t         -0.011750,-0.984100,-0.177160,0.003601,-0.991638,0.128788,0.144505,-0.921751,0.359813,0.088809,-0.927488,0.363048,\n\t\t\t         0.097842,-0.878231,0.468062,0.119114,-0.896146,0.427442,0.119114,-0.896146,0.427442,0.097842,-0.878231,0.468062,\n\t\t\t         0.108646,-0.848964,0.517106,0.089785,-0.872890,0.479507,0.088809,-0.927488,0.363048,-0.012879,-0.932890,0.359844,\n\t\t\t         -0.011261,-0.878231,0.478072,0.097842,-0.878231,0.468062,0.097842,-0.878231,0.468062,-0.011261,-0.878231,0.478072,\n\t\t\t         0.000117,-0.850864,0.525385,0.108646,-0.848964,0.517106,-0.889584,-0.406507,-0.208228,-0.903104,-0.397778,-0.161687,\n\t\t\t         -0.882015,-0.433088,-0.185583,-0.881619,-0.407483,-0.238075,-0.881619,-0.407483,-0.238075,-0.882015,-0.433088,-0.185583,\n\t\t\t         -0.843318,-0.516068,-0.149815,-0.876431,-0.427992,-0.220527,-0.903104,-0.397778,-0.161687,-0.889126,-0.403790,-0.215278,\n\t\t\t         -0.851192,-0.501724,-0.153966,-0.882015,-0.433088,-0.185583,-0.882015,-0.433088,-0.185583,-0.851192,-0.501724,-0.153966,\n\t\t\t         -0.524674,-0.846339,0.091556,-0.843318,-0.516068,-0.149815,-0.889584,-0.406507,-0.208228,-0.881619,-0.407483,-0.238075,\n\t\t\t         -0.870449,-0.394696,-0.294015,-0.902615,-0.383404,-0.195502,-0.902615,-0.383404,-0.195502,-0.870449,-0.394696,-0.294015,\n\t\t\t         -0.902676,-0.255776,-0.345958,-0.941404,-0.277291,-0.191870,-0.881619,-0.407483,-0.238075,-0.876431,-0.427992,-0.220527,\n\t\t\t         -0.850826,-0.434736,-0.295053,-0.870449,-0.394696,-0.294015,-0.870449,-0.394696,-0.294015,-0.850826,-0.434736,-0.295053,\n\t\t\t         -0.643483,-0.354564,-0.678365,-0.902676,-0.255776,-0.345958,-0.889584,-0.406507,-0.208228,-0.902615,-0.383404,-0.195502,\n\t\t\t         -0.900998,-0.387860,-0.194250,-0.903104,-0.397778,-0.161687,-0.903104,-0.397778,-0.161687,-0.900998,-0.387860,-0.194250,\n\t\t\t         -0.884060,-0.392682,-0.253395,-0.889126,-0.403790,-0.215278,-0.902615,-0.383404,-0.195502,-0.941404,-0.277291,-0.191870,\n\t\t\t         -0.926450,-0.254494,-0.277261,-0.900998,-0.387860,-0.194250,-0.900998,-0.387860,-0.194250,-0.926450,-0.254494,-0.277261,\n\t\t\t         -0.925687,-0.295480,-0.236152,-0.884060,-0.392682,-0.253395,-0.998169,0.048799,-0.035340,-0.954405,0.105472,-0.279214,\n\t\t\t         -0.945921,-0.059084,-0.318949,-0.988037,-0.079501,-0.132084,-0.988037,-0.079501,-0.132084,-0.945921,-0.059084,-0.318949,\n\t\t\t         -0.926450,-0.254494,-0.277261,-0.941404,-0.277291,-0.191870,-0.954405,0.105472,-0.279214,-0.895077,0.145726,-0.421339,\n\t\t\t         -0.937254,-0.058931,-0.343547,-0.945921,-0.059084,-0.318949,-0.945921,-0.059084,-0.318949,-0.937254,-0.058931,-0.343547,\n\t\t\t         -0.925687,-0.295480,-0.236152,-0.926450,-0.254494,-0.277261,-0.998169,0.048799,-0.035340,-0.988037,-0.079501,-0.132084,\n\t\t\t         -0.931333,-0.019745,-0.363598,-0.956725,0.164556,-0.239967,-0.956725,0.164556,-0.239967,-0.931333,-0.019745,-0.363598,\n\t\t\t         -0.853572,0.049989,-0.518540,-0.871517,0.189245,-0.452345,-0.988037,-0.079501,-0.132084,-0.941404,-0.277291,-0.191870,\n\t\t\t         -0.902676,-0.255776,-0.345958,-0.931333,-0.019745,-0.363598,-0.931333,-0.019745,-0.363598,-0.902676,-0.255776,-0.345958,\n\t\t\t         -0.643483,-0.354564,-0.678365,-0.853572,0.049989,-0.518540,-0.998169,0.048799,-0.035340,-0.956725,0.164556,-0.239967,\n\t\t\t         -0.955870,0.235786,-0.175115,-0.954405,0.105472,-0.279214,-0.954405,0.105472,-0.279214,-0.955870,0.235786,-0.175115,\n\t\t\t         -0.867061,0.355815,-0.348613,-0.895077,0.145726,-0.421339,-0.956725,0.164556,-0.239967,-0.871517,0.189245,-0.452345,\n\t\t\t         -0.912290,0.307108,-0.270913,-0.955870,0.235786,-0.175115,-0.955870,0.235786,-0.175115,-0.912290,0.307108,-0.270913,\n\t\t\t         -0.808740,0.492416,-0.321543,-0.867061,0.355815,-0.348613,-0.841060,-0.525864,-0.126591,-0.861599,-0.504746,-0.053499,\n\t\t\t         -0.839137,-0.482131,-0.251625,-0.867458,-0.469771,-0.163610,-0.867458,-0.469771,-0.163610,-0.839137,-0.482131,-0.251625,\n\t\t\t         -0.850826,-0.434736,-0.295053,-0.876431,-0.427992,-0.220527,-0.861599,-0.504746,-0.053499,-0.845729,-0.521439,-0.113224,\n\t\t\t         -0.769158,-0.539994,-0.341685,-0.839137,-0.482131,-0.251625,-0.839137,-0.482131,-0.251625,-0.769158,-0.539994,-0.341685,\n\t\t\t         -0.643483,-0.354564,-0.678365,-0.850826,-0.434736,-0.295053,-0.841060,-0.525864,-0.126591,-0.867458,-0.469771,-0.163610,\n\t\t\t         -0.824946,-0.563158,-0.047365,-0.798273,-0.602252,0.004181,-0.798273,-0.602252,0.004181,-0.824946,-0.563158,-0.047365,\n\t\t\t         -0.598956,-0.778619,0.186895,-0.605121,-0.756920,0.246712,-0.867458,-0.469771,-0.163610,-0.876431,-0.427992,-0.220527,\n\t\t\t         -0.843318,-0.516068,-0.149815,-0.824946,-0.563158,-0.047365,-0.824946,-0.563158,-0.047365,-0.843318,-0.516068,-0.149815,\n\t\t\t         -0.524674,-0.846339,0.091556,-0.598956,-0.778619,0.186895,-0.841060,-0.525864,-0.126591,-0.798273,-0.602252,0.004181,\n\t\t\t         -0.811121,-0.572924,0.117496,-0.861599,-0.504746,-0.053499,-0.861599,-0.504746,-0.053499,-0.811121,-0.572924,0.117496,\n\t\t\t         -0.832942,-0.531419,0.154149,-0.845729,-0.521439,-0.113224,-0.798273,-0.602252,0.004181,-0.605121,-0.756920,0.246712,\n\t\t\t         -0.637074,-0.696982,0.329112,-0.811121,-0.572924,0.117496,-0.811121,-0.572924,0.117496,-0.637074,-0.696982,0.329112,\n\t\t\t         -0.560381,-0.726676,0.397320,-0.832942,-0.531419,0.154149,-0.185858,-0.795465,0.576769,-0.176458,-0.775933,0.605579,\n\t\t\t         -0.357891,-0.770989,0.526719,-0.322794,-0.818751,0.474776,-0.322794,-0.818751,0.474776,-0.357891,-0.770989,0.526719,\n\t\t\t         -0.637074,-0.696982,0.329112,-0.605121,-0.756920,0.246712,-0.176458,-0.775933,0.605579,-0.145787,-0.784112,0.603229,\n\t\t\t         -0.272164,-0.784478,0.557176,-0.357891,-0.770989,0.526719,-0.357891,-0.770989,0.526719,-0.272164,-0.784478,0.557176,\n\t\t\t         -0.560381,-0.726676,0.397320,-0.637074,-0.696982,0.329112,-0.185858,-0.795465,0.576769,-0.322794,-0.818751,0.474776,\n\t\t\t         -0.280740,-0.850734,0.444288,-0.121067,-0.811518,0.571612,-0.121067,-0.811518,0.571612,-0.280740,-0.850734,0.444288,\n\t\t\t         -0.172613,-0.884091,0.434217,-0.063051,-0.817896,0.571886,-0.322794,-0.818751,0.474776,-0.605121,-0.756920,0.246712,\n\t\t\t         -0.598956,-0.778619,0.186895,-0.280740,-0.850734,0.444288,-0.280740,-0.850734,0.444288,-0.598956,-0.778619,0.186895,\n\t\t\t         -0.524674,-0.846339,0.091556,-0.172613,-0.884091,0.434217,-0.185858,-0.795465,0.576769,-0.121067,-0.811518,0.571612,\n\t\t\t         -0.083987,-0.776299,0.624714,-0.176458,-0.775933,0.605579,-0.176458,-0.775933,0.605579,-0.083987,-0.776299,0.624714,\n\t\t\t         -0.063875,-0.773278,0.630818,-0.145787,-0.784112,0.603229,-0.121067,-0.811518,0.571612,-0.063051,-0.817896,0.571886,\n\t\t\t         -0.046724,-0.779260,0.624897,-0.083987,-0.776299,0.624714,-0.083987,-0.776299,0.624714,-0.046724,-0.779260,0.624897,\n\t\t\t         -0.165960,-0.784448,0.597552,-0.063875,-0.773278,0.630818,-0.630787,-0.750816,-0.195837,-0.783380,-0.613910,-0.096957,\n\t\t\t         -0.701010,-0.712821,0.020753,-0.586505,-0.802637,-0.108432,-0.586505,-0.802637,-0.108432,-0.701010,-0.712821,0.020753,\n\t\t\t         -0.570757,-0.796014,0.201361,-0.526963,-0.844844,0.092288,-0.783380,-0.613910,-0.096957,-0.845729,-0.521439,-0.113224,\n\t\t\t         -0.832942,-0.531419,0.154149,-0.701010,-0.712821,0.020753,-0.701010,-0.712821,0.020753,-0.832942,-0.531419,0.154149,\n\t\t\t         -0.560381,-0.726676,0.397320,-0.570757,-0.796014,0.201361,-0.630787,-0.750816,-0.195837,-0.586505,-0.802637,-0.108432,\n\t\t\t         -0.454207,-0.872158,-0.181677,-0.524064,-0.802362,-0.285562,-0.524064,-0.802362,-0.285562,-0.454207,-0.872158,-0.181677,\n\t\t\t         -0.134312,-0.960234,-0.244667,-0.254921,-0.880764,-0.399030,-0.586505,-0.802637,-0.108432,-0.526963,-0.844844,0.092288,\n\t\t\t         -0.452101,-0.889279,0.069094,-0.454207,-0.872158,-0.181677,-0.454207,-0.872158,-0.181677,-0.452101,-0.889279,0.069094,\n\t\t\t         -0.258858,-0.959807,0.108402,-0.134312,-0.960234,-0.244667,-0.630787,-0.750816,-0.195837,-0.524064,-0.802362,-0.285562,\n\t\t\t         -0.653829,-0.670553,-0.350444,-0.783380,-0.613910,-0.096957,-0.783380,-0.613910,-0.096957,-0.653829,-0.670553,-0.350444,\n\t\t\t         -0.769158,-0.539994,-0.341685,-0.845729,-0.521439,-0.113224,-0.524064,-0.802362,-0.285562,-0.254921,-0.880764,-0.399030,\n\t\t\t         -0.414624,-0.719596,-0.556993,-0.653829,-0.670553,-0.350444,-0.653829,-0.670553,-0.350444,-0.414624,-0.719596,-0.556993,\n\t\t\t         -0.643483,-0.354564,-0.678365,-0.769158,-0.539994,-0.341685,-0.748131,0.384411,-0.540849,-0.824305,0.246345,-0.509659,\n\t\t\t         -0.763878,0.175726,-0.620930,-0.658223,0.356945,-0.662770,-0.658223,0.356945,-0.662770,-0.763878,0.175726,-0.620930,\n\t\t\t         -0.545366,0.131169,-0.827845,-0.400525,0.390515,-0.828883,-0.824305,0.246345,-0.509659,-0.871517,0.189245,-0.452345,\n\t\t\t         -0.853572,0.049989,-0.518540,-0.763878,0.175726,-0.620930,-0.763878,0.175726,-0.620930,-0.853572,0.049989,-0.518540,\n\t\t\t         -0.643483,-0.354564,-0.678365,-0.545366,0.131169,-0.827845,-0.748131,0.384411,-0.540849,-0.658223,0.356945,-0.662770,\n\t\t\t         -0.529466,0.733360,-0.426374,-0.611042,0.542558,-0.576373,-0.611042,0.542558,-0.576373,-0.529466,0.733360,-0.426374,\n\t\t\t         -0.395032,0.917386,-0.047914,-0.521653,0.781701,-0.341685,-0.658223,0.356945,-0.662770,-0.400525,0.390515,-0.828883,\n\t\t\t         -0.309976,0.826685,-0.469497,-0.529466,0.733360,-0.426374,-0.529466,0.733360,-0.426374,-0.309976,0.826685,-0.469497,\n\t\t\t         -0.184576,0.980956,0.059938,-0.395032,0.917386,-0.047914,-0.748131,0.384411,-0.540849,-0.611042,0.542558,-0.576373,\n\t\t\t         -0.778710,0.411389,-0.473647,-0.824305,0.246345,-0.509659,-0.824305,0.246345,-0.509659,-0.778710,0.411389,-0.473647,\n\t\t\t         -0.912290,0.307108,-0.270913,-0.871517,0.189245,-0.452345,-0.611042,0.542558,-0.576373,-0.521653,0.781701,-0.341685,\n\t\t\t         -0.723502,0.615925,-0.311624,-0.778710,0.411389,-0.473647,-0.778710,0.411389,-0.473647,-0.723502,0.615925,-0.311624,\n\t\t\t         -0.808740,0.492416,-0.321543,-0.912290,0.307108,-0.270913,0.033387,-0.814081,0.579760,0.029359,-0.815638,0.577776,\n\t\t\t         -0.032014,-0.792932,0.608448,-0.023652,-0.816401,0.576983,-0.023652,-0.816401,0.576983,-0.032014,-0.792932,0.608448,\n\t\t\t         -0.046724,-0.779260,0.624897,-0.063051,-0.817896,0.571886,0.029359,-0.815638,0.577776,-0.063631,-0.883602,0.463851,\n\t\t\t         -0.149846,-0.835841,0.528092,-0.032014,-0.792932,0.608448,-0.032014,-0.792932,0.608448,-0.149846,-0.835841,0.528092,\n\t\t\t         -0.165960,-0.784448,0.597552,-0.046724,-0.779260,0.624897,0.033387,-0.814081,0.579760,-0.023652,-0.816401,0.576983,\n\t\t\t         -0.048738,-0.874508,0.482528,0.061830,-0.845149,0.530931,0.061830,-0.845149,0.530931,-0.048738,-0.874508,0.482528,\n\t\t\t         -0.062716,-0.916593,0.394848,0.089785,-0.872890,0.479507,-0.023652,-0.816401,0.576983,-0.063051,-0.817896,0.571886,\n\t\t\t         -0.172613,-0.884091,0.434217,-0.048738,-0.874508,0.482528,-0.048738,-0.874508,0.482528,-0.172613,-0.884091,0.434217,\n\t\t\t         -0.524674,-0.846339,0.091556,-0.062716,-0.916593,0.394848,0.033387,-0.814081,0.579760,0.061830,-0.845149,0.530931,\n\t\t\t         0.097781,-0.836909,0.538499,0.029359,-0.815638,0.577776,0.029359,-0.815638,0.577776,0.097781,-0.836909,0.538499,\n\t\t\t         0.066866,-0.887997,0.454878,-0.063631,-0.883602,0.463851,0.061830,-0.845149,0.530931,0.089785,-0.872890,0.479507,\n\t\t\t         0.108646,-0.848964,0.517106,0.097781,-0.836909,0.538499,0.097781,-0.836909,0.538499,0.108646,-0.848964,0.517106,\n\t\t\t         0.000117,-0.850864,0.525385,0.066866,-0.887997,0.454878,-0.289926,-0.833155,0.470901,-0.309488,-0.751335,0.582812,\n\t\t\t         -0.407208,-0.721946,0.559404,-0.310160,-0.844905,0.435774,-0.310160,-0.844905,0.435774,-0.407208,-0.721946,0.559404,\n\t\t\t         -0.458937,-0.706687,0.538469,-0.318827,-0.847713,0.423902,-0.309488,-0.751335,0.582812,-0.335032,-0.597461,0.728507,\n\t\t\t         -0.470077,-0.536699,0.700674,-0.407208,-0.721946,0.559404,-0.407208,-0.721946,0.559404,-0.470077,-0.536699,0.700674,\n\t\t\t         -0.588275,-0.437361,0.680135,-0.458937,-0.706687,0.538469,-0.289926,-0.833155,0.470901,-0.310160,-0.844905,0.435774,\n\t\t\t         -0.262581,-0.901395,0.344249,-0.248329,-0.858669,0.448286,-0.248329,-0.858669,0.448286,-0.262581,-0.901395,0.344249,\n\t\t\t         -0.322214,-0.894650,0.309427,-0.286752,-0.850826,0.440260,-0.310160,-0.844905,0.435774,-0.318827,-0.847713,0.423902,\n\t\t\t         -0.218451,-0.929624,0.296701,-0.262581,-0.901395,0.344249,-0.262581,-0.901395,0.344249,-0.218451,-0.929624,0.296701,\n\t\t\t         -0.258858,-0.959807,0.108402,-0.322214,-0.894650,0.309427,-0.289926,-0.833155,0.470901,-0.248329,-0.858669,0.448286,\n\t\t\t         -0.222297,-0.780084,0.584796,-0.309488,-0.751335,0.582812,-0.309488,-0.751335,0.582812,-0.222297,-0.780084,0.584796,\n\t\t\t         -0.223609,-0.632984,0.741142,-0.335032,-0.597461,0.728507,-0.248329,-0.858669,0.448286,-0.286752,-0.850826,0.440260,\n\t\t\t         -0.220161,-0.794763,0.565508,-0.222297,-0.780084,0.584796,-0.222297,-0.780084,0.584796,-0.220161,-0.794763,0.565508,\n\t\t\t         -0.153569,-0.665059,0.730796,-0.223609,-0.632984,0.741142,-0.089419,-0.800104,0.593127,-0.106876,-0.801904,0.587756,\n\t\t\t         -0.039003,-0.774346,0.631519,-0.036470,-0.769829,0.637196,-0.036470,-0.769829,0.637196,-0.039003,-0.774346,0.631519,\n\t\t\t         0.012513,-0.732963,0.680135,0.018860,-0.720695,0.692984,-0.106876,-0.801904,0.587756,-0.145787,-0.784112,0.603229,\n\t\t\t         -0.063875,-0.773278,0.630818,-0.039003,-0.774346,0.631519,-0.039003,-0.774346,0.631519,-0.063875,-0.773278,0.630818,\n\t\t\t         -0.165960,-0.784448,0.597552,0.012513,-0.732963,0.680135,-0.089419,-0.800104,0.593127,-0.036470,-0.769829,0.637196,\n\t\t\t         -0.094699,-0.770409,0.630451,-0.143223,-0.808618,0.570605,-0.143223,-0.808618,0.570605,-0.094699,-0.770409,0.630451,\n\t\t\t         -0.173376,-0.779412,0.601978,-0.219703,-0.817469,0.532365,-0.036470,-0.769829,0.637196,0.018860,-0.720695,0.692984,\n\t\t\t         -0.046144,-0.709494,0.703177,-0.094699,-0.770409,0.630451,-0.094699,-0.770409,0.630451,-0.046144,-0.709494,0.703177,\n\t\t\t         -0.153569,-0.665059,0.730796,-0.173376,-0.779412,0.601978,-0.089419,-0.800104,0.593127,-0.143223,-0.808618,0.570605,\n\t\t\t         -0.199927,-0.819147,0.537584,-0.106876,-0.801904,0.587756,-0.106876,-0.801904,0.587756,-0.199927,-0.819147,0.537584,\n\t\t\t         -0.272164,-0.784478,0.557176,-0.145787,-0.784112,0.603229,-0.143223,-0.808618,0.570605,-0.219703,-0.817469,0.532365,\n\t\t\t         -0.325083,-0.825434,0.461409,-0.199927,-0.819147,0.537584,-0.199927,-0.819147,0.537584,-0.325083,-0.825434,0.461409,\n\t\t\t         -0.560381,-0.726676,0.397320,-0.272164,-0.784478,0.557176,-0.381054,-0.828181,0.410932,-0.310129,-0.823939,0.474227,\n\t\t\t         -0.263710,-0.805261,0.531022,-0.351329,-0.830714,0.431745,-0.351329,-0.830714,0.431745,-0.263710,-0.805261,0.531022,\n\t\t\t         -0.220161,-0.794763,0.565508,-0.286752,-0.850826,0.440260,-0.310129,-0.823939,0.474227,-0.219703,-0.817469,0.532365,\n\t\t\t         -0.173376,-0.779412,0.601978,-0.263710,-0.805261,0.531022,-0.263710,-0.805261,0.531022,-0.173376,-0.779412,0.601978,\n\t\t\t         -0.153569,-0.665059,0.730796,-0.220161,-0.794763,0.565508,-0.381054,-0.828181,0.410932,-0.351329,-0.830714,0.431745,\n\t\t\t         -0.412244,-0.862728,0.292734,-0.445387,-0.843135,0.301126,-0.445387,-0.843135,0.301126,-0.412244,-0.862728,0.292734,\n\t\t\t         -0.452101,-0.889279,0.069094,-0.526963,-0.844844,0.092288,-0.351329,-0.830714,0.431745,-0.286752,-0.850826,0.440260,\n\t\t\t         -0.322214,-0.894650,0.309427,-0.412244,-0.862728,0.292734,-0.412244,-0.862728,0.292734,-0.322214,-0.894650,0.309427,\n\t\t\t         -0.258858,-0.959807,0.108402,-0.452101,-0.889279,0.069094,-0.381054,-0.828181,0.410932,-0.445387,-0.843135,0.301126,\n\t\t\t         -0.418470,-0.830836,0.366832,-0.310129,-0.823939,0.474227,-0.310129,-0.823939,0.474227,-0.418470,-0.830836,0.366832,\n\t\t\t         -0.325083,-0.825434,0.461409,-0.219703,-0.817469,0.532365,-0.445387,-0.843135,0.301126,-0.526963,-0.844844,0.092288,\n\t\t\t         -0.570757,-0.796014,0.201361,-0.418470,-0.830836,0.366832,-0.418470,-0.830836,0.366832,-0.570757,-0.796014,0.201361,\n\t\t\t         -0.560381,-0.726676,0.397320,-0.325083,-0.825434,0.461409,-0.371075,-0.233833,0.898648,-0.340983,-0.205420,0.917325,\n\t\t\t         -0.422132,0.020783,0.906278,-0.452437,-0.120762,0.883541,-0.452437,-0.120762,0.883541,-0.422132,0.020783,0.906278,\n\t\t\t         -0.465621,0.195105,0.863186,-0.518387,-0.011658,0.855037,-0.340983,-0.205420,0.917325,-0.396374,-0.200995,0.895779,\n\t\t\t         -0.475326,0.090030,0.875149,-0.422132,0.020783,0.906278,-0.422132,0.020783,0.906278,-0.475326,0.090030,0.875149,\n\t\t\t         -0.447981,0.507492,0.735984,-0.465621,0.195105,0.863186,-0.371075,-0.233833,0.898648,-0.452437,-0.120762,0.883541,\n\t\t\t         -0.483291,-0.316904,0.816065,-0.356182,-0.401593,0.843684,-0.356182,-0.401593,0.843684,-0.483291,-0.316904,0.816065,\n\t\t\t         -0.470077,-0.536699,0.700674,-0.335032,-0.597461,0.728507,-0.452437,-0.120762,0.883541,-0.518387,-0.011658,0.855037,\n\t\t\t         -0.576525,-0.201025,0.791925,-0.483291,-0.316904,0.816065,-0.483291,-0.316904,0.816065,-0.576525,-0.201025,0.791925,\n\t\t\t         -0.588275,-0.437361,0.680135,-0.470077,-0.536699,0.700674,-0.371075,-0.233833,0.898648,-0.356182,-0.401593,0.843684,\n\t\t\t         -0.259255,-0.432325,0.863613,-0.340983,-0.205420,0.917325,-0.340983,-0.205420,0.917325,-0.259255,-0.432325,0.863613,\n\t\t\t         -0.265969,-0.440230,0.857540,-0.396374,-0.200995,0.895779,-0.356182,-0.401593,0.843684,-0.335032,-0.597461,0.728507,\n\t\t\t         -0.223609,-0.632984,0.741142,-0.259255,-0.432325,0.863613,-0.259255,-0.432325,0.863613,-0.223609,-0.632984,0.741142,\n\t\t\t         -0.153569,-0.665059,0.730796,-0.265969,-0.440230,0.857540,-0.627155,0.184820,0.756615,-0.576983,0.366802,0.729728,\n\t\t\t         -0.656301,0.358837,0.663686,-0.682699,0.138707,0.717399,-0.682699,0.138707,0.717399,-0.656301,0.358837,0.663686,\n\t\t\t         -0.686178,0.335215,0.645558,-0.709311,0.106204,0.696799,-0.576983,0.366802,0.729728,-0.472335,0.593951,0.651204,\n\t\t\t         -0.559648,0.563433,0.607654,-0.656301,0.358837,0.663686,-0.656301,0.358837,0.663686,-0.559648,0.563433,0.607654,\n\t\t\t         -0.610492,0.527940,0.590381,-0.686178,0.335215,0.645558,-0.627155,0.184820,0.756615,-0.682699,0.138707,0.717399,\n\t\t\t         -0.646199,-0.052522,0.761345,-0.575274,0.090091,0.812952,-0.575274,0.090091,0.812952,-0.646199,-0.052522,0.761345,\n\t\t\t         -0.576525,-0.201025,0.791925,-0.518387,-0.011658,0.855037,-0.682699,0.138707,0.717399,-0.709311,0.106204,0.696799,\n\t\t\t         -0.684683,-0.135868,0.716025,-0.646199,-0.052522,0.761345,-0.646199,-0.052522,0.761345,-0.684683,-0.135868,0.716025,\n\t\t\t         -0.588275,-0.437361,0.680135,-0.576525,-0.201025,0.791925,-0.627155,0.184820,0.756615,-0.575274,0.090091,0.812952,\n\t\t\t         -0.503464,0.304422,0.808588,-0.576983,0.366802,0.729728,-0.576983,0.366802,0.729728,-0.503464,0.304422,0.808588,\n\t\t\t         -0.411573,0.580309,0.702689,-0.472335,0.593951,0.651204,-0.575274,0.090091,0.812952,-0.518387,-0.011658,0.855037,\n\t\t\t         -0.465621,0.195105,0.863186,-0.503464,0.304422,0.808588,-0.503464,0.304422,0.808588,-0.465621,0.195105,0.863186,\n\t\t\t         -0.447981,0.507492,0.735984,-0.411573,0.580309,0.702689,-0.233741,0.826807,0.511551,-0.213874,0.815149,0.538285,\n\t\t\t         -0.419141,0.700949,0.577013,-0.343883,0.752434,0.561693,-0.343883,0.752434,0.561693,-0.419141,0.700949,0.577013,\n\t\t\t         -0.559648,0.563433,0.607654,-0.472335,0.593951,0.651204,-0.213874,0.815149,0.538285,-0.329905,0.791101,0.515030,\n\t\t\t         -0.491531,0.659078,0.569170,-0.419141,0.700949,0.577013,-0.419141,0.700949,0.577013,-0.491531,0.659078,0.569170,\n\t\t\t         -0.610492,0.527940,0.590381,-0.559648,0.563433,0.607654,-0.233741,0.826807,0.511551,-0.343883,0.752434,0.561693,\n\t\t\t         -0.304910,0.778069,0.549181,-0.222602,0.855831,0.466872,-0.222602,0.855831,0.466872,-0.304910,0.778069,0.549181,\n\t\t\t         -0.351756,0.781915,0.514634,-0.300882,0.856594,0.419141,-0.343883,0.752434,0.561693,-0.472335,0.593951,0.651204,\n\t\t\t         -0.411573,0.580309,0.702689,-0.304910,0.778069,0.549181,-0.304910,0.778069,0.549181,-0.411573,0.580309,0.702689,\n\t\t\t         -0.447981,0.507492,0.735984,-0.351756,0.781915,0.514634,-0.233741,0.826807,0.511551,-0.222602,0.855831,0.466872,\n\t\t\t         -0.099673,0.909085,0.404462,-0.213874,0.815149,0.538285,-0.213874,0.815149,0.538285,-0.099673,0.909085,0.404462,\n\t\t\t         0.019868,0.960997,0.275735,-0.329905,0.791101,0.515030,-0.222602,0.855831,0.466872,-0.300882,0.856594,0.419141,\n\t\t\t         -0.210700,0.926756,0.310953,-0.099673,0.909085,0.404462,-0.099673,0.909085,0.404462,-0.210700,0.926756,0.310953,\n\t\t\t         -0.184576,0.980956,0.059938,0.019868,0.960997,0.275735,-0.382122,0.923032,-0.044160,-0.437574,0.899136,0.004608,\n\t\t\t         -0.381268,0.924345,-0.013581,-0.497818,0.867122,0.014710,-0.497818,0.867122,0.014710,-0.381268,0.924345,-0.013581,\n\t\t\t         -0.312967,0.928190,-0.201178,-0.545610,0.822016,-0.162969,-0.437574,0.899136,0.004608,-0.494339,0.869015,0.020356,\n\t\t\t         -0.401837,0.911771,-0.084811,-0.381268,0.924345,-0.013581,-0.381268,0.924345,-0.013581,-0.401837,0.911771,-0.084811,\n\t\t\t         -0.177007,0.943968,-0.278481,-0.312967,0.928190,-0.201178,-0.382122,0.923032,-0.044160,-0.497818,0.867122,0.014710,\n\t\t\t         -0.616321,0.782281,-0.090213,-0.385449,0.912076,-0.139683,-0.385449,0.912076,-0.139683,-0.616321,0.782281,-0.090213,\n\t\t\t         -0.723502,0.615925,-0.311624,-0.521653,0.781701,-0.341685,-0.497818,0.867122,0.014710,-0.545610,0.822016,-0.162969,\n\t\t\t         -0.697928,0.666677,-0.261544,-0.616321,0.782281,-0.090213,-0.616321,0.782281,-0.090213,-0.697928,0.666677,-0.261544,\n\t\t\t         -0.808740,0.492416,-0.321543,-0.723502,0.615925,-0.311624,-0.382122,0.923032,-0.044160,-0.385449,0.912076,-0.139683,\n\t\t\t         -0.321299,0.946654,0.023713,-0.373089,0.927152,0.033753,-0.373089,0.927152,0.033753,-0.321299,0.946654,0.023713,\n\t\t\t         -0.351909,0.922941,0.155919,-0.439283,0.878658,0.186834,-0.385449,0.912076,-0.139683,-0.521653,0.781701,-0.341685,\n\t\t\t         -0.395032,0.917386,-0.047914,-0.321299,0.946654,0.023713,-0.321299,0.946654,0.023713,-0.395032,0.917386,-0.047914,\n\t\t\t         -0.184576,0.980956,0.059938,-0.351909,0.922941,0.155919,-0.382122,0.923032,-0.044160,-0.373089,0.927152,0.033753,\n\t\t\t         -0.407849,0.908383,0.091891,-0.437574,0.899136,0.004608,-0.437574,0.899136,0.004608,-0.407849,0.908383,0.091891,\n\t\t\t         -0.430036,0.895749,0.112400,-0.494339,0.869015,0.020356,-0.373089,0.927152,0.033753,-0.439283,0.878658,0.186834,\n\t\t\t         -0.381054,0.896756,0.224921,-0.407849,0.908383,0.091891,-0.407849,0.908383,0.091891,-0.381054,0.896756,0.224921,\n\t\t\t         -0.433576,0.852504,0.291879,-0.430036,0.895749,0.112400,-0.386181,0.856838,0.341563,-0.371380,0.849483,0.374706,\n\t\t\t         -0.396222,0.797784,0.454390,-0.391583,0.833735,0.389203,-0.391583,0.833735,0.389203,-0.396222,0.797784,0.454390,\n\t\t\t         -0.409619,0.739525,0.534104,-0.389813,0.804529,0.448012,-0.371380,0.849483,0.374706,-0.300882,0.856594,0.419141,\n\t\t\t         -0.351756,0.781915,0.514634,-0.396222,0.797784,0.454390,-0.396222,0.797784,0.454390,-0.351756,0.781915,0.514634,\n\t\t\t         -0.447981,0.507492,0.735984,-0.409619,0.739525,0.534104,-0.386181,0.856838,0.341563,-0.391583,0.833735,0.389203,\n\t\t\t         -0.416486,0.849727,0.323191,-0.400525,0.875851,0.269112,-0.400525,0.875851,0.269112,-0.416486,0.849727,0.323191,\n\t\t\t         -0.381054,0.896756,0.224921,-0.439283,0.878658,0.186834,-0.391583,0.833735,0.389203,-0.389813,0.804529,0.448012,\n\t\t\t         -0.388440,0.832484,0.395062,-0.416486,0.849727,0.323191,-0.416486,0.849727,0.323191,-0.388440,0.832484,0.395062,\n\t\t\t         -0.433576,0.852504,0.291879,-0.381054,0.896756,0.224921,-0.386181,0.856838,0.341563,-0.400525,0.875851,0.269112,\n\t\t\t         -0.342631,0.900845,0.266488,-0.371380,0.849483,0.374706,-0.371380,0.849483,0.374706,-0.342631,0.900845,0.266488,\n\t\t\t         -0.210700,0.926756,0.310953,-0.300882,0.856594,0.419141,-0.400525,0.875851,0.269112,-0.439283,0.878658,0.186834,\n\t\t\t         -0.351909,0.922941,0.155919,-0.342631,0.900845,0.266488,-0.342631,0.900845,0.266488,-0.351909,0.922941,0.155919,\n\t\t\t         -0.184576,0.980956,0.059938,-0.210700,0.926756,0.310953,-0.311106,0.701926,0.640675,-0.275521,0.698050,0.660909,\n\t\t\t         -0.352733,0.796411,0.491165,-0.368389,0.765221,0.527879,-0.368389,0.765221,0.527879,-0.352733,0.796411,0.491165,\n\t\t\t         -0.388440,0.832484,0.395062,-0.389813,0.804529,0.448012,-0.275521,0.698050,0.660909,-0.356304,0.673818,0.647298,\n\t\t\t         -0.443007,0.777337,0.446608,-0.352733,0.796411,0.491165,-0.352733,0.796411,0.491165,-0.443007,0.777337,0.446608,\n\t\t\t         -0.433576,0.852504,0.291879,-0.388440,0.832484,0.395062,-0.311106,0.701926,0.640675,-0.368389,0.765221,0.527879,\n\t\t\t         -0.398022,0.674001,0.622303,-0.308573,0.591845,0.744621,-0.308573,0.591845,0.744621,-0.398022,0.674001,0.622303,\n\t\t\t         -0.463149,0.448561,0.764367,-0.334758,0.373272,0.865200,-0.368389,0.765221,0.527879,-0.389813,0.804529,0.448012,\n\t\t\t         -0.409619,0.739525,0.534104,-0.398022,0.674001,0.622303,-0.398022,0.674001,0.622303,-0.409619,0.739525,0.534104,\n\t\t\t         -0.447981,0.507492,0.735984,-0.463149,0.448561,0.764367,-0.311106,0.701926,0.640675,-0.308573,0.591845,0.744621,\n\t\t\t         -0.177496,0.500595,0.847255,-0.275521,0.698050,0.660909,-0.275521,0.698050,0.660909,-0.177496,0.500595,0.847255,\n\t\t\t         -0.199957,0.441267,0.874783,-0.356304,0.673818,0.647298,-0.308573,0.591845,0.744621,-0.334758,0.373272,0.865200,\n\t\t\t         -0.141392,0.232795,0.962188,-0.177496,0.500595,0.847255,-0.177496,0.500595,0.847255,-0.141392,0.232795,0.962188,\n\t\t\t         -0.072207,-0.006073,0.997345,-0.199957,0.441267,0.874783,-0.372906,-0.163762,0.913266,-0.367229,0.072756,0.927274,\n\t\t\t         -0.500198,0.108829,0.859035,-0.435774,-0.193732,0.878933,-0.435774,-0.193732,0.878933,-0.500198,0.108829,0.859035,\n\t\t\t         -0.475326,0.090030,0.875149,-0.396374,-0.200995,0.895779,-0.367229,0.072756,0.927274,-0.334758,0.373272,0.865200,\n\t\t\t         -0.463149,0.448561,0.764367,-0.500198,0.108829,0.859035,-0.500198,0.108829,0.859035,-0.463149,0.448561,0.764367,\n\t\t\t         -0.447981,0.507492,0.735984,-0.475326,0.090030,0.875149,-0.372906,-0.163762,0.913266,-0.435774,-0.193732,0.878933,\n\t\t\t         -0.281716,-0.414655,0.865261,-0.216376,-0.311106,0.925382,-0.216376,-0.311106,0.925382,-0.281716,-0.414655,0.865261,\n\t\t\t         -0.119572,-0.556078,0.822443,-0.053255,-0.453291,0.889737,-0.435774,-0.193732,0.878933,-0.396374,-0.200995,0.895779,\n\t\t\t         -0.265969,-0.440230,0.857540,-0.281716,-0.414655,0.865261,-0.281716,-0.414655,0.865261,-0.265969,-0.440230,0.857540,\n\t\t\t         -0.153569,-0.665059,0.730796,-0.119572,-0.556078,0.822443,-0.372906,-0.163762,0.913266,-0.216376,-0.311106,0.925382,\n\t\t\t         -0.158452,-0.079348,0.984161,-0.367229,0.072756,0.927274,-0.367229,0.072756,0.927274,-0.158452,-0.079348,0.984161,\n\t\t\t         -0.141392,0.232795,0.962188,-0.334758,0.373272,0.865200,-0.216376,-0.311106,0.925382,-0.053255,-0.453291,0.889737,\n\t\t\t         -0.004852,-0.286142,0.958159,-0.158452,-0.079348,0.984161,-0.158452,-0.079348,0.984161,-0.004852,-0.286142,0.958159,\n\t\t\t         -0.072207,-0.006073,0.997345,-0.141392,0.232795,0.962188,0.079745,-0.600482,0.795618,0.041932,-0.545732,0.836879,\n\t\t\t         -0.002869,-0.630329,0.776299,0.058473,-0.661000,0.748070,0.058473,-0.661000,0.748070,-0.002869,-0.630329,0.776299,\n\t\t\t         -0.046144,-0.709494,0.703177,0.018860,-0.720695,0.692984,0.041932,-0.545732,0.836879,-0.053255,-0.453291,0.889737,\n\t\t\t         -0.119572,-0.556078,0.822443,-0.002869,-0.630329,0.776299,-0.002869,-0.630329,0.776299,-0.119572,-0.556078,0.822443,\n\t\t\t         -0.153569,-0.665059,0.730796,-0.046144,-0.709494,0.703177,0.079745,-0.600482,0.795618,0.058473,-0.661000,0.748070,\n\t\t\t         0.028718,-0.687338,0.725730,0.031068,-0.605060,0.795556,0.031068,-0.605060,0.795556,0.028718,-0.687338,0.725730,\n\t\t\t         -0.215369,-0.715720,0.664327,-0.210334,-0.620014,0.755852,0.058473,-0.661000,0.748070,0.018860,-0.720695,0.692984,\n\t\t\t         0.012513,-0.732963,0.680135,0.028718,-0.687338,0.725730,0.028718,-0.687338,0.725730,0.012513,-0.732963,0.680135,\n\t\t\t         -0.165960,-0.784448,0.597552,-0.215369,-0.715720,0.664327,0.079745,-0.600482,0.795618,0.031068,-0.605060,0.795556,\n\t\t\t         0.036500,-0.461654,0.886288,0.041932,-0.545732,0.836879,0.041932,-0.545732,0.836879,0.036500,-0.461654,0.886288,\n\t\t\t         -0.004852,-0.286142,0.958159,-0.053255,-0.453291,0.889737,0.031068,-0.605060,0.795556,-0.210334,-0.620014,0.755852,\n\t\t\t         -0.094089,-0.412305,0.906156,0.036500,-0.461654,0.886288,0.036500,-0.461654,0.886288,-0.094089,-0.412305,0.906156,\n\t\t\t         -0.072207,-0.006073,0.997345,-0.004852,-0.286142,0.958159,-0.519242,-0.558336,0.646992,-0.434584,-0.589099,0.681204,\n\t\t\t         -0.498215,-0.684896,0.531663,-0.575762,-0.655721,0.488296,-0.575762,-0.655721,0.488296,-0.498215,-0.684896,0.531663,\n\t\t\t         -0.423353,-0.772485,0.473251,-0.496261,-0.751946,0.433882,-0.434584,-0.589099,0.681204,-0.210334,-0.620014,0.755852,\n\t\t\t         -0.215369,-0.715720,0.664327,-0.498215,-0.684896,0.531663,-0.498215,-0.684896,0.531663,-0.215369,-0.715720,0.664327,\n\t\t\t         -0.165960,-0.784448,0.597552,-0.423353,-0.772485,0.473251,-0.519242,-0.558336,0.646992,-0.575762,-0.655721,0.488296,\n\t\t\t         -0.598285,-0.654256,0.462508,-0.587329,-0.553056,0.590869,-0.587329,-0.553056,0.590869,-0.598285,-0.654256,0.462508,\n\t\t\t         -0.505081,-0.684988,0.525010,-0.607685,-0.563616,0.559465,-0.575762,-0.655721,0.488296,-0.496261,-0.751946,0.433882,\n\t\t\t         -0.511460,-0.758507,0.403790,-0.598285,-0.654256,0.462508,-0.598285,-0.654256,0.462508,-0.511460,-0.758507,0.403790,\n\t\t\t         -0.307321,-0.791467,0.528275,-0.505081,-0.684988,0.525010,-0.519242,-0.558336,0.646992,-0.587329,-0.553056,0.590869,\n\t\t\t         -0.596423,-0.362407,0.716178,-0.460891,-0.368877,0.807123,-0.460891,-0.368877,0.807123,-0.596423,-0.362407,0.716178,\n\t\t\t         -0.717338,-0.038636,0.695608,-0.550340,-0.007630,0.834895,-0.587329,-0.553056,0.590869,-0.607685,-0.563616,0.559465,\n\t\t\t         -0.666799,-0.377392,0.642598,-0.596423,-0.362407,0.716178,-0.596423,-0.362407,0.716178,-0.666799,-0.377392,0.642598,\n\t\t\t         -0.727531,-0.074923,0.681936,-0.717338,-0.038636,0.695608,-0.519242,-0.558336,0.646992,-0.460891,-0.368877,0.807123,\n\t\t\t         -0.285043,-0.381085,0.879482,-0.434584,-0.589099,0.681204,-0.434584,-0.589099,0.681204,-0.285043,-0.381085,0.879482,\n\t\t\t         -0.094089,-0.412305,0.906156,-0.210334,-0.620014,0.755852,-0.460891,-0.368877,0.807123,-0.550340,-0.007630,0.834895,\n\t\t\t         -0.264199,0.002991,0.964446,-0.285043,-0.381085,0.879482,-0.285043,-0.381085,0.879482,-0.264199,0.002991,0.964446,\n\t\t\t         -0.072207,-0.006073,0.997345,-0.094089,-0.412305,0.906156,-0.818628,0.445845,0.362011,-0.610736,0.580187,0.538835,\n\t\t\t         -0.414838,0.399823,0.817316,-0.696127,0.318400,0.643422,-0.696127,0.318400,0.643422,-0.414838,0.399823,0.817316,\n\t\t\t         -0.264199,0.002991,0.964446,-0.550340,-0.007630,0.834895,-0.610736,0.580187,0.538835,-0.356304,0.673818,0.647298,\n\t\t\t         -0.199957,0.441267,0.874783,-0.414838,0.399823,0.817316,-0.414838,0.399823,0.817316,-0.199957,0.441267,0.874783,\n\t\t\t         -0.072207,-0.006073,0.997345,-0.264199,0.002991,0.964446,-0.818628,0.445845,0.362011,-0.696127,0.318400,0.643422,\n\t\t\t         -0.805170,0.249611,0.537919,-0.788537,0.459822,0.408307,-0.788537,0.459822,0.408307,-0.805170,0.249611,0.537919,\n\t\t\t         -0.735984,0.231697,0.636067,-0.672262,0.493423,0.551866,-0.696127,0.318400,0.643422,-0.550340,-0.007630,0.834895,\n\t\t\t         -0.717338,-0.038636,0.695608,-0.805170,0.249611,0.537919,-0.805170,0.249611,0.537919,-0.717338,-0.038636,0.695608,\n\t\t\t         -0.727531,-0.074923,0.681936,-0.735984,0.231697,0.636067,-0.818628,0.445845,0.362011,-0.788537,0.459822,0.408307,\n\t\t\t         -0.709311,0.632710,0.310678,-0.844752,0.498215,0.195288,-0.844752,0.498215,0.195288,-0.709311,0.632710,0.310678,\n\t\t\t         -0.658223,0.720420,0.218299,-0.848262,0.522629,0.085147,-0.788537,0.459822,0.408307,-0.672262,0.493423,0.551866,\n\t\t\t         -0.512803,0.714591,0.475723,-0.709311,0.632710,0.310678,-0.709311,0.632710,0.310678,-0.512803,0.714591,0.475723,\n\t\t\t         -0.283151,0.890927,0.354961,-0.658223,0.720420,0.218299,-0.818628,0.445845,0.362011,-0.844752,0.498215,0.195288,\n\t\t\t         -0.693411,0.647572,0.315897,-0.610736,0.580187,0.538835,-0.610736,0.580187,0.538835,-0.693411,0.647572,0.315897,\n\t\t\t         -0.443007,0.777337,0.446608,-0.356304,0.673818,0.647298,-0.844752,0.498215,0.195288,-0.848262,0.522629,0.085147,\n\t\t\t         -0.688742,0.701987,0.181097,-0.693411,0.647572,0.315897,-0.693411,0.647572,0.315897,-0.688742,0.701987,0.181097,\n\t\t\t         -0.433576,0.852504,0.291879,-0.443007,0.777337,0.446608,-0.753258,0.644185,-0.132664,-0.634449,0.771203,-0.051820,\n\t\t\t         -0.684378,0.726676,0.059358,-0.826624,0.562212,-0.023316,-0.826624,0.562212,-0.023316,-0.684378,0.726676,0.059358,\n\t\t\t         -0.688742,0.701987,0.181097,-0.848262,0.522629,0.085147,-0.634449,0.771203,-0.051820,-0.494339,0.869015,0.020356,\n\t\t\t         -0.430036,0.895749,0.112400,-0.684378,0.726676,0.059358,-0.684378,0.726676,0.059358,-0.430036,0.895749,0.112400,\n\t\t\t         -0.433576,0.852504,0.291879,-0.688742,0.701987,0.181097,-0.753258,0.644185,-0.132664,-0.826624,0.562212,-0.023316,\n\t\t\t         -0.652577,0.751518,0.096469,-0.625599,0.778161,-0.054964,-0.625599,0.778161,-0.054964,-0.652577,0.751518,0.096469,\n\t\t\t         -0.257942,0.939207,0.226539,-0.302042,0.951170,0.063143,-0.826624,0.562212,-0.023316,-0.848262,0.522629,0.085147,\n\t\t\t         -0.658223,0.720420,0.218299,-0.652577,0.751518,0.096469,-0.652577,0.751518,0.096469,-0.658223,0.720420,0.218299,\n\t\t\t         -0.283151,0.890927,0.354961,-0.257942,0.939207,0.226539,-0.753258,0.644185,-0.132664,-0.625599,0.778161,-0.054964,\n\t\t\t         -0.631855,0.735191,-0.245338,-0.644398,0.721030,-0.254646,-0.644398,0.721030,-0.254646,-0.631855,0.735191,-0.245338,\n\t\t\t         -0.547685,0.722007,-0.422712,-0.489822,0.745872,-0.451338,-0.625599,0.778161,-0.054964,-0.302042,0.951170,0.063143,\n\t\t\t         -0.369091,0.925871,-0.080660,-0.631855,0.735191,-0.245338,-0.631855,0.735191,-0.245338,-0.369091,0.925871,-0.080660,\n\t\t\t         -0.405744,0.825312,-0.392651,-0.547685,0.722007,-0.422712,-0.753258,0.644185,-0.132664,-0.644398,0.721030,-0.254646,\n\t\t\t         -0.519150,0.835475,-0.180059,-0.634449,0.771203,-0.051820,-0.634449,0.771203,-0.051820,-0.519150,0.835475,-0.180059,\n\t\t\t         -0.401837,0.911771,-0.084811,-0.494339,0.869015,0.020356,-0.644398,0.721030,-0.254646,-0.489822,0.745872,-0.451338,\n\t\t\t         -0.328318,0.861934,-0.386273,-0.519150,0.835475,-0.180059,-0.519150,0.835475,-0.180059,-0.328318,0.861934,-0.386273,\n\t\t\t         -0.177007,0.943968,-0.278481,-0.401837,0.911771,-0.084811,-0.240699,0.676534,-0.695944,-0.149144,0.797845,-0.584094,\n\t\t\t         -0.202002,0.805658,-0.556810,-0.329203,0.710013,-0.622456,-0.329203,0.710013,-0.622456,-0.202002,0.805658,-0.556810,\n\t\t\t         -0.328318,0.861934,-0.386273,-0.489822,0.745872,-0.451338,-0.149144,0.797845,-0.584094,0.007782,0.976836,-0.213721,\n\t\t\t         -0.026002,0.955809,-0.292764,-0.202002,0.805658,-0.556810,-0.202002,0.805658,-0.556810,-0.026002,0.955809,-0.292764,\n\t\t\t         -0.177007,0.943968,-0.278481,-0.328318,0.861934,-0.386273,-0.240699,0.676534,-0.695944,-0.329203,0.710013,-0.622456,\n\t\t\t         -0.385876,0.650044,-0.654592,-0.233894,0.656972,-0.716697,-0.233894,0.656972,-0.716697,-0.385876,0.650044,-0.654592,\n\t\t\t         -0.313150,0.705374,-0.635853,-0.205329,0.638356,-0.741813,-0.329203,0.710013,-0.622456,-0.489822,0.745872,-0.451338,\n\t\t\t         -0.547685,0.722007,-0.422712,-0.385876,0.650044,-0.654592,-0.385876,0.650044,-0.654592,-0.547685,0.722007,-0.422712,\n\t\t\t         -0.405744,0.825312,-0.392651,-0.313150,0.705374,-0.635853,-0.240699,0.676534,-0.695944,-0.233894,0.656972,-0.716697,\n\t\t\t         -0.068392,0.654439,-0.752983,-0.090640,0.733573,-0.673482,-0.090640,0.733573,-0.673482,-0.068392,0.654439,-0.752983,\n\t\t\t         0.095035,0.631001,-0.769921,0.041780,0.803217,-0.594165,-0.233894,0.656972,-0.716697,-0.205329,0.638356,-0.741813,\n\t\t\t         -0.058931,0.580340,-0.812220,-0.068392,0.654439,-0.752983,-0.068392,0.654439,-0.752983,-0.058931,0.580340,-0.812220,\n\t\t\t         0.098544,0.533372,-0.840083,0.095035,0.631001,-0.769921,-0.240699,0.676534,-0.695944,-0.090640,0.733573,-0.673482,\n\t\t\t         -0.080294,0.849330,-0.521653,-0.149144,0.797845,-0.584094,-0.149144,0.797845,-0.584094,-0.080294,0.849330,-0.521653,\n\t\t\t         -0.029084,0.989380,-0.142216,0.007782,0.976836,-0.213721,-0.090640,0.733573,-0.673482,0.041780,0.803217,-0.594165,\n\t\t\t         -0.021882,0.903043,-0.428968,-0.080294,0.849330,-0.521653,-0.080294,0.849330,-0.521653,-0.021882,0.903043,-0.428968,\n\t\t\t         -0.068575,0.989776,-0.124882,-0.029084,0.989380,-0.142216,-0.228584,-0.893185,0.387219,-0.345439,-0.843165,0.411908,\n\t\t\t         -0.309244,-0.862392,0.400800,-0.149144,-0.917753,0.367992,-0.149144,-0.917753,0.367992,-0.309244,-0.862392,0.400800,\n\t\t\t         -0.149846,-0.835841,0.528092,-0.063631,-0.883602,0.463851,-0.345439,-0.843165,0.411908,-0.496261,-0.751946,0.433882,\n\t\t\t         -0.423353,-0.772485,0.473251,-0.309244,-0.862392,0.400800,-0.309244,-0.862392,0.400800,-0.423353,-0.772485,0.473251,\n\t\t\t         -0.165960,-0.784448,0.597552,-0.149846,-0.835841,0.528092,-0.228584,-0.893185,0.387219,-0.149144,-0.917753,0.367992,\n\t\t\t         0.019715,-0.928434,0.370891,-0.099094,-0.914304,0.392682,-0.099094,-0.914304,0.392682,0.019715,-0.928434,0.370891,\n\t\t\t         0.288919,-0.795404,0.532762,0.122837,-0.877529,0.463515,-0.149144,-0.917753,0.367992,-0.063631,-0.883602,0.463851,\n\t\t\t         0.066866,-0.887997,0.454878,0.019715,-0.928434,0.370891,0.019715,-0.928434,0.370891,0.066866,-0.887997,0.454878,\n\t\t\t         0.000117,-0.850864,0.525385,0.288919,-0.795404,0.532762,-0.228584,-0.893185,0.387219,-0.099094,-0.914304,0.392682,\n\t\t\t         -0.318613,-0.859676,0.399213,-0.345439,-0.843165,0.411908,-0.345439,-0.843165,0.411908,-0.318613,-0.859676,0.399213,\n\t\t\t         -0.511460,-0.758507,0.403790,-0.496261,-0.751946,0.433882,-0.099094,-0.914304,0.392682,0.122837,-0.877529,0.463515,\n\t\t\t         -0.079226,-0.857601,0.508133,-0.318613,-0.859676,0.399213,-0.318613,-0.859676,0.399213,-0.079226,-0.857601,0.508133,\n\t\t\t         -0.307321,-0.791467,0.528275,-0.511460,-0.758507,0.403790,-0.084078,-0.630360,0.771722,-0.437513,-0.603992,0.666128,\n\t\t\t         -0.186193,-0.678579,0.710501,0.145390,-0.631062,0.761956,0.145390,-0.631062,0.761956,-0.186193,-0.678579,0.710501,\n\t\t\t         0.094485,-0.682577,0.724662,0.384930,-0.542528,0.746605,-0.437513,-0.603992,0.666128,-0.607685,-0.563616,0.559465,\n\t\t\t         -0.505081,-0.684988,0.525010,-0.186193,-0.678579,0.710501,-0.186193,-0.678579,0.710501,-0.505081,-0.684988,0.525010,\n\t\t\t         -0.307321,-0.791467,0.528275,0.094485,-0.682577,0.724662,-0.084078,-0.630360,0.771722,0.145390,-0.631062,0.761956,\n\t\t\t         0.407331,-0.561052,0.720603,0.231239,-0.601184,0.764885,0.231239,-0.601184,0.764885,0.407331,-0.561052,0.720603,\n\t\t\t         0.510162,-0.521037,0.684291,0.358736,-0.579524,0.731752,0.145390,-0.631062,0.761956,0.384930,-0.542528,0.746605,\n\t\t\t         0.552171,-0.461654,0.694205,0.407331,-0.561052,0.720603,0.407331,-0.561052,0.720603,0.552171,-0.461654,0.694205,\n\t\t\t         0.619416,-0.421210,0.662500,0.510162,-0.521037,0.684291,-0.084078,-0.630360,0.771722,0.231239,-0.601184,0.764885,\n\t\t\t         0.022889,-0.538041,0.842586,-0.274575,-0.499496,0.821619,-0.274575,-0.499496,0.821619,0.022889,-0.538041,0.842586,\n\t\t\t         -0.116489,-0.296426,0.947905,-0.374767,-0.189520,0.907529,0.231239,-0.601184,0.764885,0.358736,-0.579524,0.731752,\n\t\t\t         0.158162,-0.562114,0.811796,0.022889,-0.538041,0.842586,0.022889,-0.538041,0.842586,0.158162,-0.562114,0.811796,\n\t\t\t         -0.012534,-0.373649,0.927486,-0.116489,-0.296426,0.947905,-0.084078,-0.630360,0.771722,-0.274575,-0.499496,0.821619,\n\t\t\t         -0.574999,-0.423536,0.699942,-0.437513,-0.603992,0.666128,-0.437513,-0.603992,0.666128,-0.574999,-0.423536,0.699942,\n\t\t\t         -0.666799,-0.377392,0.642598,-0.607685,-0.563616,0.559465,-0.274575,-0.499496,0.821619,-0.374767,-0.189520,0.907529,\n\t\t\t         -0.628498,-0.094485,0.772027,-0.574999,-0.423536,0.699942,-0.574999,-0.423536,0.699942,-0.628498,-0.094485,0.772027,\n\t\t\t         -0.727531,-0.074923,0.681936,-0.666799,-0.377392,0.642598,0.205023,0.832423,0.514756,0.322672,0.762535,0.560686,\n\t\t\t         0.142369,0.855129,0.498428,0.088412,0.886807,0.453536,0.088412,0.886807,0.453536,0.142369,0.855129,0.498428,\n\t\t\t         0.074923,0.903958,0.420942,-0.011414,0.941252,0.337474,0.322672,0.762535,0.560686,0.029664,0.778802,0.626514,\n\t\t\t         -0.015015,0.826197,0.563128,0.142369,0.855129,0.498428,0.142369,0.855129,0.498428,-0.015015,0.826197,0.563128,\n\t\t\t         0.011170,0.890439,0.454939,0.074923,0.903958,0.420942,0.205023,0.832423,0.514756,0.088412,0.886807,0.453536,\n\t\t\t         0.040040,0.910062,0.412488,0.328043,0.774163,0.541307,0.328043,0.774163,0.541307,0.040040,0.910062,0.412488,\n\t\t\t         -0.087252,0.851527,0.516953,0.220313,0.720878,0.657063,0.088412,0.886807,0.453536,-0.011414,0.941252,0.337474,\n\t\t\t         -0.041566,0.951567,0.304544,0.040040,0.910062,0.412488,0.040040,0.910062,0.412488,-0.041566,0.951567,0.304544,\n\t\t\t         -0.283151,0.890927,0.354961,-0.087252,0.851527,0.516953,0.205023,0.832423,0.514756,0.328043,0.774163,0.541307,\n\t\t\t         0.348338,0.697714,0.625965,0.322672,0.762535,0.560686,0.322672,0.762535,0.560686,0.348338,0.697714,0.625965,\n\t\t\t         0.057588,0.726798,0.684378,0.029664,0.778802,0.626514,0.328043,0.774163,0.541307,0.220313,0.720878,0.657063,\n\t\t\t         0.173803,0.623676,0.762078,0.348338,0.697714,0.625965,0.348338,0.697714,0.625965,0.173803,0.623676,0.762078,\n\t\t\t         0.012666,0.638650,0.769393,0.057588,0.726798,0.684378,-0.025208,0.979278,0.200781,-0.058809,0.978759,0.196234,\n\t\t\t         -0.040773,0.966124,0.254799,-0.077883,0.964599,0.251900,-0.077883,0.964599,0.251900,-0.040773,0.966124,0.254799,\n\t\t\t         -0.041566,0.951567,0.304544,-0.011414,0.941252,0.337474,-0.058809,0.978759,0.196234,-0.302042,0.951170,0.063143,\n\t\t\t         -0.257942,0.939207,0.226539,-0.040773,0.966124,0.254799,-0.040773,0.966124,0.254799,-0.257942,0.939207,0.226539,\n\t\t\t         -0.283151,0.890927,0.354961,-0.041566,0.951567,0.304544,-0.025208,0.979278,0.200781,-0.077883,0.964599,0.251900,\n\t\t\t         -0.030183,0.953734,0.299020,-0.044771,0.987152,0.153356,-0.044771,0.987152,0.153356,-0.030183,0.953734,0.299020,\n\t\t\t         -0.038850,0.955657,0.291818,-0.021607,0.993164,0.114689,-0.077883,0.964599,0.251900,-0.011414,0.941252,0.337474,\n\t\t\t         0.074923,0.903958,0.420942,-0.030183,0.953734,0.299020,-0.030183,0.953734,0.299020,0.074923,0.903958,0.420942,\n\t\t\t         0.011170,0.890439,0.454939,-0.038850,0.955657,0.291818,-0.025208,0.979278,0.200781,-0.044771,0.987152,0.153356,\n\t\t\t         0.073122,0.988006,0.135807,0.027284,0.991729,0.125309,0.027284,0.991729,0.125309,0.073122,0.988006,0.135807,\n\t\t\t         0.100742,0.986785,-0.126774,0.001190,0.996094,-0.088260,-0.044771,0.987152,0.153356,-0.021607,0.993164,0.114689,\n\t\t\t         0.054384,0.997436,0.046358,0.073122,0.988006,0.135807,0.073122,0.988006,0.135807,0.054384,0.997436,0.046358,\n\t\t\t         0.193518,0.965941,-0.171636,0.100742,0.986785,-0.126774,-0.025208,0.979278,0.200781,0.027284,0.991729,0.125309,\n\t\t\t         -0.140110,0.989227,0.041902,-0.058809,0.978759,0.196234,-0.058809,0.978759,0.196234,-0.140110,0.989227,0.041902,\n\t\t\t         -0.369091,0.925871,-0.080660,-0.302042,0.951170,0.063143,0.027284,0.991729,0.125309,0.001190,0.996094,-0.088260,\n\t\t\t         -0.195868,0.947813,-0.251473,-0.140110,0.989227,0.041902,-0.140110,0.989227,0.041902,-0.195868,0.947813,-0.251473,\n\t\t\t         -0.405744,0.825312,-0.392651,-0.369091,0.925871,-0.080660,0.601733,-0.404889,0.688406,0.535936,-0.456191,0.710349,\n\t\t\t         0.272134,-0.679220,0.681570,0.421247,-0.641163,0.641407,0.421247,-0.641163,0.641407,0.272134,-0.679220,0.681570,\n\t\t\t         -0.079226,-0.857601,0.508133,0.122837,-0.877529,0.463515,0.535936,-0.456191,0.710349,0.384930,-0.542528,0.746605,\n\t\t\t         0.094485,-0.682577,0.724662,0.272134,-0.679220,0.681570,0.272134,-0.679220,0.681570,0.094485,-0.682577,0.724662,\n\t\t\t         -0.307321,-0.791467,0.528275,-0.079226,-0.857601,0.508133,0.601733,-0.404889,0.688406,0.421247,-0.641163,0.641407,\n\t\t\t         0.583026,-0.467208,0.664663,0.683218,-0.298441,0.666402,0.683218,-0.298441,0.666402,0.583026,-0.467208,0.664663,\n\t\t\t         0.556987,-0.456808,0.693608,0.738925,-0.114092,0.664057,0.421247,-0.641163,0.641407,0.122837,-0.877529,0.463515,\n\t\t\t         0.288919,-0.795404,0.532762,0.583026,-0.467208,0.664663,0.583026,-0.467208,0.664663,0.288919,-0.795404,0.532762,\n\t\t\t         0.000117,-0.850864,0.525385,0.556987,-0.456808,0.693608,0.601733,-0.404889,0.688406,0.683218,-0.298441,0.666402,\n\t\t\t         0.648274,-0.362255,0.669668,0.535936,-0.456191,0.710349,0.535936,-0.456191,0.710349,0.648274,-0.362255,0.669668,\n\t\t\t         0.552171,-0.461654,0.694205,0.384930,-0.542528,0.746605,0.683218,-0.298441,0.666402,0.738925,-0.114092,0.664057,\n\t\t\t         0.693166,-0.318496,0.646592,0.648274,-0.362255,0.669668,0.648274,-0.362255,0.669668,0.693166,-0.318496,0.646592,\n\t\t\t         0.619416,-0.421210,0.662500,0.552171,-0.461654,0.694205,-0.068056,0.781274,-0.620441,-0.150578,0.697562,-0.700491,\n\t\t\t         -0.179693,0.823756,-0.537675,-0.047609,0.884182,-0.464644,-0.047609,0.884182,-0.464644,-0.179693,0.823756,-0.537675,\n\t\t\t         -0.195868,0.947813,-0.251473,0.001190,0.996094,-0.088260,-0.150578,0.697562,-0.700491,-0.205329,0.638356,-0.741813,\n\t\t\t         -0.313150,0.705374,-0.635853,-0.179693,0.823756,-0.537675,-0.179693,0.823756,-0.537675,-0.313150,0.705374,-0.635853,\n\t\t\t         -0.405744,0.825312,-0.392651,-0.195868,0.947813,-0.251473,-0.068056,0.781274,-0.620441,-0.047609,0.884182,-0.464644,\n\t\t\t         0.123203,0.879910,-0.458815,0.028260,0.773949,-0.632557,0.028260,0.773949,-0.632557,0.123203,0.879910,-0.458815,\n\t\t\t         0.221961,0.870540,-0.439161,0.175909,0.769311,-0.614124,-0.047609,0.884182,-0.464644,0.001190,0.996094,-0.088260,\n\t\t\t         0.100742,0.986785,-0.126774,0.123203,0.879910,-0.458815,0.123203,0.879910,-0.458815,0.100742,0.986785,-0.126774,\n\t\t\t         0.193518,0.965941,-0.171636,0.221961,0.870540,-0.439161,-0.068056,0.781274,-0.620441,0.028260,0.773949,-0.632557,\n\t\t\t         -0.043275,0.649007,-0.759514,-0.150578,0.697562,-0.700491,-0.150578,0.697562,-0.700491,-0.043275,0.649007,-0.759514,\n\t\t\t         -0.058931,0.580340,-0.812220,-0.205329,0.638356,-0.741813,0.028260,0.773949,-0.632557,0.175909,0.769311,-0.614124,\n\t\t\t         0.120304,0.619343,-0.775811,-0.043275,0.649007,-0.759514,-0.043275,0.649007,-0.759514,0.120304,0.619343,-0.775811,\n\t\t\t         0.098544,0.533372,-0.840083,-0.058931,0.580340,-0.812220,-0.188482,0.471236,0.861599,-0.014191,0.334635,0.942228,\n\t\t\t         0.071078,0.500015,0.863063,-0.047121,0.634358,0.771569,-0.047121,0.634358,0.771569,0.071078,0.500015,0.863063,\n\t\t\t         0.173803,0.623676,0.762078,0.220313,0.720878,0.657063,-0.014191,0.334635,0.942228,0.041646,0.285014,0.957618,\n\t\t\t         0.088550,0.467387,0.879607,0.071078,0.500015,0.863063,0.071078,0.500015,0.863063,0.088550,0.467387,0.879607,\n\t\t\t         0.012666,0.638650,0.769393,0.173803,0.623676,0.762078,-0.188482,0.471236,0.861599,-0.047121,0.634358,0.771569,\n\t\t\t         -0.273873,0.732963,0.622639,-0.438948,0.550737,0.709891,-0.438948,0.550737,0.709891,-0.273873,0.732963,0.622639,\n\t\t\t         -0.512803,0.714591,0.475723,-0.672262,0.493423,0.551866,-0.047121,0.634358,0.771569,0.220313,0.720878,0.657063,\n\t\t\t         -0.087252,0.851527,0.516953,-0.273873,0.732963,0.622639,-0.273873,0.732963,0.622639,-0.087252,0.851527,0.516953,\n\t\t\t         -0.283151,0.890927,0.354961,-0.512803,0.714591,0.475723,-0.188482,0.471236,0.861599,-0.438948,0.550737,0.709891,\n\t\t\t         -0.561235,0.270882,0.782037,-0.335734,0.189947,0.922575,-0.335734,0.189947,0.922575,-0.561235,0.270882,0.782037,\n\t\t\t         -0.628498,-0.094485,0.772027,-0.374767,-0.189520,0.907529,-0.438948,0.550737,0.709891,-0.672262,0.493423,0.551866,\n\t\t\t         -0.735984,0.231697,0.636067,-0.561235,0.270882,0.782037,-0.561235,0.270882,0.782037,-0.735984,0.231697,0.636067,\n\t\t\t         -0.727531,-0.074923,0.681936,-0.628498,-0.094485,0.772027,-0.188482,0.471236,0.861599,-0.335734,0.189947,0.922575,\n\t\t\t         -0.110904,0.048097,0.992645,-0.014191,0.334635,0.942228,-0.014191,0.334635,0.942228,-0.110904,0.048097,0.992645,\n\t\t\t         -0.039405,-0.034608,0.998624,0.041646,0.285014,0.957618,-0.335734,0.189947,0.922575,-0.374767,-0.189520,0.907529,\n\t\t\t         -0.116489,-0.296426,0.947905,-0.110904,0.048097,0.992645,-0.110904,0.048097,0.992645,-0.116489,-0.296426,0.947905,\n\t\t\t         -0.012534,-0.373649,0.927486,-0.039405,-0.034608,0.998624,-0.461531,0.882046,0.094485,-0.304849,0.906491,0.292062,\n\t\t\t         -0.127781,0.991424,-0.026948,-0.168004,0.945219,-0.279794,-0.168004,0.945219,-0.279794,-0.127781,0.991424,-0.026948,\n\t\t\t         -0.048097,0.971160,-0.233406,-0.146397,0.878933,-0.453902,-0.304849,0.906491,0.292062,-0.329905,0.791101,0.515030,\n\t\t\t         0.019868,0.960997,0.275735,-0.127781,0.991424,-0.026948,-0.127781,0.991424,-0.026948,0.019868,0.960997,0.275735,\n\t\t\t         -0.184576,0.980956,0.059938,-0.048097,0.971160,-0.233406,-0.461531,0.882046,0.094485,-0.168004,0.945219,-0.279794,\n\t\t\t         -0.022797,0.986908,-0.159459,-0.370556,0.912839,0.171331,-0.370556,0.912839,0.171331,-0.022797,0.986908,-0.159459,\n\t\t\t         -0.015564,0.987671,-0.155583,-0.447401,0.884518,0.132084,-0.168004,0.945219,-0.279794,-0.146397,0.878933,-0.453902,\n\t\t\t         0.156987,0.869076,-0.469069,-0.022797,0.986908,-0.159459,-0.022797,0.986908,-0.159459,0.156987,0.869076,-0.469069,\n\t\t\t         0.370281,0.836787,-0.403272,-0.015564,0.987671,-0.155583,-0.461531,0.882046,0.094485,-0.370556,0.912839,0.171331,\n\t\t\t         -0.614246,0.692740,0.377819,-0.609363,0.691519,0.387829,-0.609363,0.691519,0.387829,-0.614246,0.692740,0.377819,\n\t\t\t         -0.715567,0.513565,0.473464,-0.678945,0.515030,0.523179,-0.370556,0.912839,0.171331,-0.447401,0.884518,0.132084,\n\t\t\t         -0.674978,0.665242,0.319071,-0.614246,0.692740,0.377819,-0.614246,0.692740,0.377819,-0.674978,0.665242,0.319071,\n\t\t\t         -0.752922,0.511124,0.414502,-0.715567,0.513565,0.473464,-0.461531,0.882046,0.094485,-0.609363,0.691519,0.387829,\n\t\t\t         -0.604694,0.650075,0.460097,-0.304849,0.906491,0.292062,-0.304849,0.906491,0.292062,-0.604694,0.650075,0.460097,\n\t\t\t         -0.491531,0.659078,0.569170,-0.329905,0.791101,0.515030,-0.609363,0.691519,0.387829,-0.678945,0.515030,0.523179,\n\t\t\t         -0.644826,0.514634,0.565081,-0.604694,0.650075,0.460097,-0.604694,0.650075,0.460097,-0.644826,0.514634,0.565081,\n\t\t\t         -0.610492,0.527940,0.590381,-0.491531,0.659078,0.569170,-0.737999,0.110508,0.665670,-0.722526,0.089724,0.685446,\n\t\t\t         -0.700644,0.325083,0.635121,-0.731834,0.316904,0.603259,-0.731834,0.316904,0.603259,-0.700644,0.325083,0.635121,\n\t\t\t         -0.644826,0.514634,0.565081,-0.678945,0.515030,0.523179,-0.722526,0.089724,0.685446,-0.709311,0.106204,0.696799,\n\t\t\t         -0.686178,0.335215,0.645558,-0.700644,0.325083,0.635121,-0.700644,0.325083,0.635121,-0.686178,0.335215,0.645558,\n\t\t\t         -0.610492,0.527940,0.590381,-0.644826,0.514634,0.565081,-0.737999,0.110508,0.665670,-0.731834,0.316904,0.603259,\n\t\t\t         -0.772118,0.305795,0.557024,-0.787835,0.132145,0.601489,-0.787835,0.132145,0.601489,-0.772118,0.305795,0.557024,\n\t\t\t         -0.811457,0.299478,0.501816,-0.836482,0.111820,0.536424,-0.731834,0.316904,0.603259,-0.678945,0.515030,0.523179,\n\t\t\t         -0.715567,0.513565,0.473464,-0.772118,0.305795,0.557024,-0.772118,0.305795,0.557024,-0.715567,0.513565,0.473464,\n\t\t\t         -0.752922,0.511124,0.414502,-0.811457,0.299478,0.501816,-0.737999,0.110508,0.665670,-0.787835,0.132145,0.601489,\n\t\t\t         -0.749107,-0.110050,0.653218,-0.685965,-0.174688,0.706320,-0.685965,-0.174688,0.706320,-0.749107,-0.110050,0.653218,\n\t\t\t         -0.554369,-0.569445,0.606922,-0.571612,-0.558794,0.600787,-0.787835,0.132145,0.601489,-0.836482,0.111820,0.536424,\n\t\t\t         -0.833338,-0.044069,0.550951,-0.749107,-0.110050,0.653218,-0.749107,-0.110050,0.653218,-0.833338,-0.044069,0.550951,\n\t\t\t         -0.675619,-0.444105,0.588427,-0.554369,-0.569445,0.606922,-0.737999,0.110508,0.665670,-0.685965,-0.174688,0.706320,\n\t\t\t         -0.701743,-0.184393,0.688101,-0.722526,0.089724,0.685446,-0.722526,0.089724,0.685446,-0.701743,-0.184393,0.688101,\n\t\t\t         -0.684683,-0.135868,0.716025,-0.709311,0.106204,0.696799,-0.685965,-0.174688,0.706320,-0.571612,-0.558794,0.600787,\n\t\t\t         -0.623188,-0.491958,0.607929,-0.701743,-0.184393,0.688101,-0.701743,-0.184393,0.688101,-0.623188,-0.491958,0.607929,\n\t\t\t         -0.588275,-0.437361,0.680135,-0.684683,-0.135868,0.716025,-0.439558,-0.866939,0.234901,-0.370190,-0.877560,0.304666,\n\t\t\t         -0.503433,-0.734886,0.454360,-0.478286,-0.781304,0.400922,-0.478286,-0.781304,0.400922,-0.503433,-0.734886,0.454360,\n\t\t\t         -0.623188,-0.491958,0.607929,-0.571612,-0.558794,0.600787,-0.370190,-0.877560,0.304666,-0.318827,-0.847713,0.423902,\n\t\t\t         -0.458937,-0.706687,0.538469,-0.503433,-0.734886,0.454360,-0.503433,-0.734886,0.454360,-0.458937,-0.706687,0.538469,\n\t\t\t         -0.588275,-0.437361,0.680135,-0.623188,-0.491958,0.607929,-0.439558,-0.866939,0.234901,-0.478286,-0.781304,0.400922,\n\t\t\t         -0.345195,-0.836665,0.425153,-0.298837,-0.905667,0.300699,-0.298837,-0.905667,0.300699,-0.345195,-0.836665,0.425153,\n\t\t\t         -0.308206,-0.839961,0.446547,-0.171270,-0.943175,0.284677,-0.478286,-0.781304,0.400922,-0.571612,-0.558794,0.600787,\n\t\t\t         -0.554369,-0.569445,0.606922,-0.345195,-0.836665,0.425153,-0.345195,-0.836665,0.425153,-0.554369,-0.569445,0.606922,\n\t\t\t         -0.675619,-0.444105,0.588427,-0.308206,-0.839961,0.446547,-0.439558,-0.866939,0.234901,-0.298837,-0.905667,0.300699,\n\t\t\t         -0.290597,-0.937803,0.189856,-0.412488,-0.900571,0.137059,-0.412488,-0.900571,0.137059,-0.290597,-0.937803,0.189856,\n\t\t\t         -0.134220,-0.989502,-0.052980,-0.121189,-0.989105,-0.083438,-0.298837,-0.905667,0.300699,-0.171270,-0.943175,0.284677,\n\t\t\t         -0.164586,-0.970031,0.178655,-0.290597,-0.937803,0.189856,-0.290597,-0.937803,0.189856,-0.164586,-0.970031,0.178655,\n\t\t\t         -0.048555,-0.998810,-0.000549,-0.134220,-0.989502,-0.052980,-0.439558,-0.866939,0.234901,-0.412488,-0.900571,0.137059,\n\t\t\t         -0.322459,-0.925108,0.200385,-0.370190,-0.877560,0.304666,-0.370190,-0.877560,0.304666,-0.322459,-0.925108,0.200385,\n\t\t\t         -0.218451,-0.929624,0.296701,-0.318827,-0.847713,0.423902,-0.412488,-0.900571,0.137059,-0.121189,-0.989105,-0.083438,\n\t\t\t         -0.179022,-0.982391,0.052950,-0.322459,-0.925108,0.200385,-0.322459,-0.925108,0.200385,-0.179022,-0.982391,0.052950,\n\t\t\t         -0.258858,-0.959807,0.108402,-0.218451,-0.929624,0.296701,0.086642,0.389416,-0.916959,-0.052004,0.417463,-0.907193,\n\t\t\t         -0.103336,0.165288,-0.980804,0.198767,0.188360,-0.961760,0.198767,0.188360,-0.961760,-0.103336,0.165288,-0.980804,\n\t\t\t         -0.117588,-0.331309,-0.936155,0.076449,-0.258095,-0.963073,-0.052004,0.417463,-0.907193,-0.400525,0.390515,-0.828883,\n\t\t\t         -0.545366,0.131169,-0.827845,-0.103336,0.165288,-0.980804,-0.103336,0.165288,-0.980804,-0.545366,0.131169,-0.827845,\n\t\t\t         -0.643483,-0.354564,-0.678365,-0.117588,-0.331309,-0.936155,0.086642,0.389416,-0.916959,0.198767,0.188360,-0.961760,\n\t\t\t         0.415967,0.159429,-0.895260,0.361034,0.388134,-0.847896,0.361034,0.388134,-0.847896,0.415967,0.159429,-0.895260,\n\t\t\t         0.664571,0.125065,-0.736656,0.652699,0.394726,-0.646626,0.198767,0.188360,-0.961760,0.076449,-0.258095,-0.963073,\n\t\t\t         0.332377,-0.180609,-0.925687,0.415967,0.159429,-0.895260,0.415967,0.159429,-0.895260,0.332377,-0.180609,-0.925687,\n\t\t\t         0.588641,-0.208228,-0.781091,0.664571,0.125065,-0.736656,0.086642,0.389416,-0.916959,0.361034,0.388134,-0.847896,\n\t\t\t         0.253304,0.629017,-0.734916,-0.021027,0.650136,-0.759514,-0.021027,0.650136,-0.759514,0.253304,0.629017,-0.734916,\n\t\t\t         0.156987,0.869076,-0.469069,-0.146397,0.878933,-0.453902,0.361034,0.388134,-0.847896,0.652699,0.394726,-0.646626,\n\t\t\t         0.568407,0.607624,-0.554674,0.253304,0.629017,-0.734916,0.253304,0.629017,-0.734916,0.568407,0.607624,-0.554674,\n\t\t\t         0.370281,0.836787,-0.403272,0.156987,0.869076,-0.469069,0.086642,0.389416,-0.916959,-0.021027,0.650136,-0.759514,\n\t\t\t         -0.152196,0.791650,-0.591662,-0.052004,0.417463,-0.907193,-0.052004,0.417463,-0.907193,-0.152196,0.791650,-0.591662,\n\t\t\t         -0.309976,0.826685,-0.469497,-0.400525,0.390515,-0.828883,-0.021027,0.650136,-0.759514,-0.146397,0.878933,-0.453902,\n\t\t\t         -0.048097,0.971160,-0.233406,-0.152196,0.791650,-0.591662,-0.152196,0.791650,-0.591662,-0.048097,0.971160,-0.233406,\n\t\t\t         -0.184576,0.980956,0.059938,-0.309976,0.826685,-0.469497,0.028016,-0.818567,-0.573687,-0.091983,-0.861324,-0.499649,\n\t\t\t         0.086734,-0.954680,-0.284646,0.096408,-0.905850,-0.412427,0.096408,-0.905850,-0.412427,0.086734,-0.954680,-0.284646,\n\t\t\t         -0.179022,-0.982391,0.052950,-0.121189,-0.989105,-0.083438,-0.091983,-0.861324,-0.499649,-0.254921,-0.880764,-0.399030,\n\t\t\t         -0.134312,-0.960234,-0.244667,0.086734,-0.954680,-0.284646,0.086734,-0.954680,-0.284646,-0.134312,-0.960234,-0.244667,\n\t\t\t         -0.258858,-0.959807,0.108402,-0.179022,-0.982391,0.052950,0.028016,-0.818567,-0.573687,0.096408,-0.905850,-0.412427,\n\t\t\t         0.206580,-0.887600,-0.411634,0.255806,-0.755821,-0.602710,0.255806,-0.755821,-0.602710,0.206580,-0.887600,-0.411634,\n\t\t\t         0.295144,-0.894192,-0.336558,0.497330,-0.676565,-0.543016,0.096408,-0.905850,-0.412427,-0.121189,-0.989105,-0.083438,\n\t\t\t         -0.134220,-0.989502,-0.052980,0.206580,-0.887600,-0.411634,0.206580,-0.887600,-0.411634,-0.134220,-0.989502,-0.052980,\n\t\t\t         -0.048555,-0.998810,-0.000549,0.295144,-0.894192,-0.336558,0.028016,-0.818567,-0.573687,0.255806,-0.755821,-0.602710,\n\t\t\t         0.153722,-0.620502,-0.768975,-0.076815,-0.652882,-0.753533,-0.076815,-0.652882,-0.753533,0.153722,-0.620502,-0.768975,\n\t\t\t         0.332377,-0.180609,-0.925687,0.076449,-0.258095,-0.963073,0.255806,-0.755821,-0.602710,0.497330,-0.676565,-0.543016,\n\t\t\t         0.523362,-0.534349,-0.663686,0.153722,-0.620502,-0.768975,0.153722,-0.620502,-0.768975,0.523362,-0.534349,-0.663686,\n\t\t\t         0.588641,-0.208228,-0.781091,0.332377,-0.180609,-0.925687,0.028016,-0.818567,-0.573687,-0.076815,-0.652882,-0.753533,\n\t\t\t         -0.230598,-0.702170,-0.673605,-0.091983,-0.861324,-0.499649,-0.091983,-0.861324,-0.499649,-0.230598,-0.702170,-0.673605,\n\t\t\t         -0.414624,-0.719596,-0.556993,-0.254921,-0.880764,-0.399030,-0.076815,-0.652882,-0.753533,0.076449,-0.258095,-0.963073,\n\t\t\t         -0.117588,-0.331309,-0.936155,-0.230598,-0.702170,-0.673605,-0.230598,-0.702170,-0.673605,-0.117588,-0.331309,-0.936155,\n\t\t\t         -0.643483,-0.354564,-0.678365,-0.414624,-0.719596,-0.556993,-0.162328,-0.964751,0.207038,-0.008820,-0.998596,0.051729,\n\t\t\t         -0.025483,-0.976684,0.213019,-0.086428,-0.951720,0.294504,-0.086428,-0.951720,0.294504,-0.025483,-0.976684,0.213019,\n\t\t\t         -0.164586,-0.970031,0.178655,-0.171270,-0.943175,0.284677,-0.008820,-0.998596,0.051729,0.167974,-0.970916,-0.170385,\n\t\t\t         0.121464,-0.992553,-0.006928,-0.025483,-0.976684,0.213019,-0.025483,-0.976684,0.213019,0.121464,-0.992553,-0.006928,\n\t\t\t         -0.048555,-0.998810,-0.000549,-0.164586,-0.970031,0.178655,-0.162328,-0.964751,0.207038,-0.086428,-0.951720,0.294504,\n\t\t\t         -0.435377,-0.767022,0.471206,-0.565905,-0.704550,0.428144,-0.565905,-0.704550,0.428144,-0.435377,-0.767022,0.471206,\n\t\t\t         -0.776849,-0.281594,0.563158,-0.797845,-0.267922,0.540025,-0.086428,-0.951720,0.294504,-0.171270,-0.943175,0.284677,\n\t\t\t         -0.308206,-0.839961,0.446547,-0.435377,-0.767022,0.471206,-0.435377,-0.767022,0.471206,-0.308206,-0.839961,0.446547,\n\t\t\t         -0.675619,-0.444105,0.588427,-0.776849,-0.281594,0.563158,-0.162328,-0.964751,0.207038,-0.565905,-0.704550,0.428144,\n\t\t\t         -0.577441,-0.706320,0.409406,-0.179907,-0.977172,0.112918,-0.179907,-0.977172,0.112918,-0.577441,-0.706320,0.409406,\n\t\t\t         -0.573870,-0.711142,0.406049,-0.155644,-0.973998,0.164495,-0.565905,-0.704550,0.428144,-0.797845,-0.267922,0.540025,\n\t\t\t         -0.769768,-0.333506,0.544237,-0.577441,-0.706320,0.409406,-0.577441,-0.706320,0.409406,-0.769768,-0.333506,0.544237,\n\t\t\t         -0.735832,-0.412152,0.537248,-0.573870,-0.711142,0.406049,-0.162328,-0.964751,0.207038,-0.179907,-0.977172,0.112918,\n\t\t\t         0.023652,-0.990051,-0.138524,-0.008820,-0.998596,0.051729,-0.008820,-0.998596,0.051729,0.023652,-0.990051,-0.138524,\n\t\t\t         0.140629,-0.936460,-0.321268,0.167974,-0.970916,-0.170385,-0.179907,-0.977172,0.112918,-0.155644,-0.973998,0.164495,\n\t\t\t         0.197241,-0.977996,-0.067751,0.023652,-0.990051,-0.138524,0.023652,-0.990051,-0.138524,0.197241,-0.977996,-0.067751,\n\t\t\t         0.327616,-0.918882,-0.219733,0.140629,-0.936460,-0.321268,-0.822443,0.095309,0.560747,-0.815912,-0.102176,0.569018,\n\t\t\t         -0.824244,-0.052705,0.563738,-0.819117,0.096896,0.565355,-0.819117,0.096896,0.565355,-0.824244,-0.052705,0.563738,\n\t\t\t         -0.833338,-0.044069,0.550951,-0.836482,0.111820,0.536424,-0.815912,-0.102176,0.569018,-0.797845,-0.267922,0.540025,\n\t\t\t         -0.776849,-0.281594,0.563158,-0.824244,-0.052705,0.563738,-0.824244,-0.052705,0.563738,-0.776849,-0.281594,0.563158,\n\t\t\t         -0.675619,-0.444105,0.588427,-0.833338,-0.044069,0.550951,-0.822443,0.095309,0.560747,-0.819117,0.096896,0.565355,\n\t\t\t         -0.795495,0.309305,0.521012,-0.798761,0.310251,0.515427,-0.798761,0.310251,0.515427,-0.795495,0.309305,0.521012,\n\t\t\t         -0.731284,0.528520,0.431074,-0.723594,0.499832,0.475967,-0.819117,0.096896,0.565355,-0.836482,0.111820,0.536424,\n\t\t\t         -0.811457,0.299478,0.501816,-0.795495,0.309305,0.521012,-0.795495,0.309305,0.521012,-0.811457,0.299478,0.501816,\n\t\t\t         -0.752922,0.511124,0.414502,-0.731284,0.528520,0.431074,-0.822443,0.095309,0.560747,-0.798761,0.310251,0.515427,\n\t\t\t         -0.789178,0.303323,0.533982,-0.816065,0.091037,0.570696,-0.816065,0.091037,0.570696,-0.789178,0.303323,0.533982,\n\t\t\t         -0.724387,0.283364,0.628407,-0.765831,0.058168,0.640370,-0.798761,0.310251,0.515427,-0.723594,0.499832,0.475967,\n\t\t\t         -0.746178,0.447920,0.492477,-0.789178,0.303323,0.533982,-0.789178,0.303323,0.533982,-0.746178,0.447920,0.492477,\n\t\t\t         -0.679006,0.477554,0.557512,-0.724387,0.283364,0.628407,-0.822443,0.095309,0.560747,-0.816065,0.091037,0.570696,\n\t\t\t         -0.805109,-0.129765,0.578753,-0.815912,-0.102176,0.569018,-0.815912,-0.102176,0.569018,-0.805109,-0.129765,0.578753,\n\t\t\t         -0.769768,-0.333506,0.544237,-0.797845,-0.267922,0.540025,-0.816065,0.091037,0.570696,-0.765831,0.058168,0.640370,\n\t\t\t         -0.773400,-0.169317,0.610859,-0.805109,-0.129765,0.578753,-0.805109,-0.129765,0.578753,-0.773400,-0.169317,0.610859,\n\t\t\t         -0.735832,-0.412152,0.537248,-0.769768,-0.333506,0.544237,-0.331370,0.925687,0.182409,-0.559954,0.730399,0.391034,\n\t\t\t         -0.650655,0.703330,0.286233,-0.505539,0.861019,0.055330,-0.505539,0.861019,0.055330,-0.650655,0.703330,0.286233,\n\t\t\t         -0.674978,0.665242,0.319071,-0.447401,0.884518,0.132084,-0.559954,0.730399,0.391034,-0.723594,0.499832,0.475967,\n\t\t\t         -0.731284,0.528520,0.431074,-0.650655,0.703330,0.286233,-0.650655,0.703330,0.286233,-0.731284,0.528520,0.431074,\n\t\t\t         -0.752922,0.511124,0.414502,-0.674978,0.665242,0.319071,-0.331370,0.925687,0.182409,-0.505539,0.861019,0.055330,\n\t\t\t         -0.169164,0.952116,-0.254646,-0.052767,0.993225,-0.103305,-0.052767,0.993225,-0.103305,-0.169164,0.952116,-0.254646,\n\t\t\t         0.235511,0.832240,-0.501846,0.287423,0.863124,-0.415204,-0.505539,0.861019,0.055330,-0.447401,0.884518,0.132084,\n\t\t\t         -0.015564,0.987671,-0.155583,-0.169164,0.952116,-0.254646,-0.169164,0.952116,-0.254646,-0.015564,0.987671,-0.155583,\n\t\t\t         0.370281,0.836787,-0.403272,0.235511,0.832240,-0.501846,-0.331370,0.925687,0.182409,-0.052767,0.993225,-0.103305,\n\t\t\t         -0.037782,0.997559,-0.058260,-0.351848,0.921415,0.164800,-0.351848,0.921415,0.164800,-0.037782,0.997559,-0.058260,\n\t\t\t         -0.091891,0.995727,0.008576,-0.393994,0.895108,0.208563,-0.052767,0.993225,-0.103305,0.287423,0.863124,-0.415204,\n\t\t\t         0.347301,0.877163,-0.331584,-0.037782,0.997559,-0.058260,-0.037782,0.997559,-0.058260,0.347301,0.877163,-0.331584,\n\t\t\t         0.310282,0.915372,-0.256478,-0.091891,0.995727,0.008576,-0.331370,0.925687,0.182409,-0.351848,0.921415,0.164800,\n\t\t\t         -0.622639,0.684683,0.378735,-0.559954,0.730399,0.391034,-0.559954,0.730399,0.391034,-0.622639,0.684683,0.378735,\n\t\t\t         -0.746178,0.447920,0.492477,-0.723594,0.499832,0.475967,-0.351848,0.921415,0.164800,-0.393994,0.895108,0.208563,\n\t\t\t         -0.601550,0.686941,0.407697,-0.622639,0.684683,0.378735,-0.622639,0.684683,0.378735,-0.601550,0.686941,0.407697,\n\t\t\t         -0.679006,0.477554,0.557512,-0.746178,0.447920,0.492477,0.585040,0.340587,-0.735984,0.489059,0.610126,-0.623310,\n\t\t\t         0.498581,0.614307,-0.611560,0.642537,0.362346,-0.675130,0.642537,0.362346,-0.675130,0.498581,0.614307,-0.611560,\n\t\t\t         0.568407,0.607624,-0.554674,0.652699,0.394726,-0.646626,0.489059,0.610126,-0.623310,0.287423,0.863124,-0.415204,\n\t\t\t         0.235511,0.832240,-0.501846,0.498581,0.614307,-0.611560,0.498581,0.614307,-0.611560,0.235511,0.832240,-0.501846,\n\t\t\t         0.370281,0.836787,-0.403272,0.568407,0.607624,-0.554674,0.585040,0.340587,-0.735984,0.642537,0.362346,-0.675130,\n\t\t\t         0.701407,0.073366,-0.708945,0.643025,0.075167,-0.762139,0.643025,0.075167,-0.762139,0.701407,0.073366,-0.708945,\n\t\t\t         0.699881,-0.201147,-0.685293,0.667013,-0.157659,-0.728141,0.642537,0.362346,-0.675130,0.652699,0.394726,-0.646626,\n\t\t\t         0.664571,0.125065,-0.736656,0.701407,0.073366,-0.708945,0.701407,0.073366,-0.708945,0.664571,0.125065,-0.736656,\n\t\t\t         0.588641,-0.208228,-0.781091,0.699881,-0.201147,-0.685293,0.585040,0.340587,-0.735984,0.643025,0.075167,-0.762139,\n\t\t\t         0.722587,0.095920,-0.684561,0.702292,0.338389,-0.626270,0.702292,0.338389,-0.626270,0.722587,0.095920,-0.684561,\n\t\t\t         0.778649,0.070894,-0.623402,0.756188,0.336955,-0.560869,0.643025,0.075167,-0.762139,0.667013,-0.157659,-0.728141,\n\t\t\t         0.690085,-0.140080,-0.710013,0.722587,0.095920,-0.684561,0.722587,0.095920,-0.684561,0.690085,-0.140080,-0.710013,\n\t\t\t         0.742851,-0.166997,-0.648244,0.778649,0.070894,-0.623402,0.585040,0.340587,-0.735984,0.702292,0.338389,-0.626270,\n\t\t\t         0.608844,0.592364,-0.527604,0.489059,0.610126,-0.623310,0.489059,0.610126,-0.623310,0.608844,0.592364,-0.527604,\n\t\t\t         0.347301,0.877163,-0.331584,0.287423,0.863124,-0.415204,0.702292,0.338389,-0.626270,0.756188,0.336955,-0.560869,\n\t\t\t         0.625416,0.631397,-0.458388,0.608844,0.592364,-0.527604,0.608844,0.592364,-0.527604,0.625416,0.631397,-0.458388,\n\t\t\t         0.310282,0.915372,-0.256478,0.347301,0.877163,-0.331584,0.529008,-0.652089,-0.543016,0.640522,-0.392346,-0.660115,\n\t\t\t         0.672994,-0.441694,-0.593249,0.586718,-0.652455,-0.479598,0.586718,-0.652455,-0.479598,0.672994,-0.441694,-0.593249,\n\t\t\t         0.523362,-0.534349,-0.663686,0.497330,-0.676565,-0.543016,0.640522,-0.392346,-0.660115,0.667013,-0.157659,-0.728141,\n\t\t\t         0.699881,-0.201147,-0.685293,0.672994,-0.441694,-0.593249,0.672994,-0.441694,-0.593249,0.699881,-0.201147,-0.685293,\n\t\t\t         0.588641,-0.208228,-0.781091,0.523362,-0.534349,-0.663686,0.529008,-0.652089,-0.543016,0.586718,-0.652455,-0.479598,\n\t\t\t         0.369671,-0.881985,-0.292215,0.349376,-0.860836,-0.369915,0.349376,-0.860836,-0.369915,0.369671,-0.881985,-0.292215,\n\t\t\t         0.121464,-0.992553,-0.006928,0.167974,-0.970916,-0.170385,0.586718,-0.652455,-0.479598,0.497330,-0.676565,-0.543016,\n\t\t\t         0.295144,-0.894192,-0.336558,0.369671,-0.881985,-0.292215,0.369671,-0.881985,-0.292215,0.295144,-0.894192,-0.336558,\n\t\t\t         -0.048555,-0.998810,-0.000549,0.121464,-0.992553,-0.006928,0.529008,-0.652089,-0.543016,0.349376,-0.860836,-0.369915,\n\t\t\t         0.282968,-0.834712,-0.472335,0.459731,-0.642781,-0.612720,0.459731,-0.642781,-0.612720,0.282968,-0.834712,-0.472335,\n\t\t\t         0.438826,-0.810266,-0.388379,0.561083,-0.626453,-0.541032,0.349376,-0.860836,-0.369915,0.167974,-0.970916,-0.170385,\n\t\t\t         0.140629,-0.936460,-0.321268,0.282968,-0.834712,-0.472335,0.282968,-0.834712,-0.472335,0.140629,-0.936460,-0.321268,\n\t\t\t         0.327616,-0.918882,-0.219733,0.438826,-0.810266,-0.388379,0.529008,-0.652089,-0.543016,0.459731,-0.642781,-0.612720,\n\t\t\t         0.605823,-0.387860,-0.694601,0.640522,-0.392346,-0.660115,0.640522,-0.392346,-0.660115,0.605823,-0.387860,-0.694601,\n\t\t\t         0.690085,-0.140080,-0.710013,0.667013,-0.157659,-0.728141,0.459731,-0.642781,-0.612720,0.561083,-0.626453,-0.541032,\n\t\t\t         0.668966,-0.398358,-0.627491,0.605823,-0.387860,-0.694601,0.605823,-0.387860,-0.694601,0.668966,-0.398358,-0.627491,\n\t\t\t         0.742851,-0.166997,-0.648244,0.690085,-0.140080,-0.710013,-0.421216,0.864742,0.273415,-0.317331,0.876431,0.362133,\n\t\t\t         -0.057253,0.986053,0.156224,-0.202033,0.978637,0.037935,-0.202033,0.978637,0.037935,-0.057253,0.986053,0.156224,\n\t\t\t         0.289865,0.949065,-0.123386,0.123905,0.957945,-0.258705,-0.317331,0.876431,0.362133,-0.393994,0.895108,0.208563,\n\t\t\t         -0.091891,0.995727,0.008576,-0.057253,0.986053,0.156224,-0.057253,0.986053,0.156224,-0.091891,0.995727,0.008576,\n\t\t\t         0.310282,0.915372,-0.256478,0.289865,0.949065,-0.123386,-0.421216,0.864742,0.273415,-0.202033,0.978637,0.037935,\n\t\t\t         -0.396558,0.905606,-0.150243,-0.557817,0.821741,0.116428,-0.557817,0.821741,0.116428,-0.396558,0.905606,-0.150243,\n\t\t\t         -0.491226,0.828516,-0.268715,-0.613819,0.789392,0.005432,-0.202033,0.978637,0.037935,0.123905,0.957945,-0.258705,\n\t\t\t         -0.108432,0.879116,-0.464095,-0.396558,0.905606,-0.150243,-0.396558,0.905606,-0.150243,-0.108432,0.879116,-0.464095,\n\t\t\t         -0.247658,0.777123,-0.578539,-0.491226,0.828516,-0.268715,-0.421216,0.864742,0.273415,-0.557817,0.821741,0.116428,\n\t\t\t         -0.632405,0.692007,0.348094,-0.549394,0.700095,0.456008,-0.549394,0.700095,0.456008,-0.632405,0.692007,0.348094,\n\t\t\t         -0.662740,0.498001,0.559221,-0.624928,0.491592,0.606433,-0.557817,0.821741,0.116428,-0.613819,0.789392,0.005432,\n\t\t\t         -0.676168,0.691336,0.254585,-0.632405,0.692007,0.348094,-0.632405,0.692007,0.348094,-0.676168,0.691336,0.254585,\n\t\t\t         -0.714896,0.499344,0.489425,-0.662740,0.498001,0.559221,-0.421216,0.864742,0.273415,-0.549394,0.700095,0.456008,\n\t\t\t         -0.494003,0.708518,0.503891,-0.317331,0.876431,0.362133,-0.317331,0.876431,0.362133,-0.494003,0.708518,0.503891,\n\t\t\t         -0.601550,0.686941,0.407697,-0.393994,0.895108,0.208563,-0.549394,0.700095,0.456008,-0.624928,0.491592,0.606433,\n\t\t\t         -0.615162,0.500595,0.609027,-0.494003,0.708518,0.503891,-0.494003,0.708518,0.503891,-0.615162,0.500595,0.609027,\n\t\t\t         -0.679006,0.477554,0.557512,-0.601550,0.686941,0.407697,-0.640889,0.022736,0.767266,-0.717460,0.015595,0.696402,\n\t\t\t         -0.691946,0.247566,0.678121,-0.655416,0.239448,0.716269,-0.655416,0.239448,0.716269,-0.691946,0.247566,0.678121,\n\t\t\t         -0.615162,0.500595,0.609027,-0.624928,0.491592,0.606433,-0.717460,0.015595,0.696402,-0.765831,0.058168,0.640370,\n\t\t\t         -0.724387,0.283364,0.628407,-0.691946,0.247566,0.678121,-0.691946,0.247566,0.678121,-0.724387,0.283364,0.628407,\n\t\t\t         -0.679006,0.477554,0.557512,-0.615162,0.500595,0.609027,-0.640889,0.022736,0.767266,-0.655416,0.239448,0.716269,\n\t\t\t         -0.651204,0.250862,0.716208,-0.616962,0.024018,0.786584,-0.616962,0.024018,0.786584,-0.651204,0.250862,0.716208,\n\t\t\t         -0.718436,0.231178,0.656026,-0.694723,-0.047853,0.717643,-0.655416,0.239448,0.716269,-0.624928,0.491592,0.606433,\n\t\t\t         -0.662740,0.498001,0.559221,-0.651204,0.250862,0.716208,-0.651204,0.250862,0.716208,-0.662740,0.498001,0.559221,\n\t\t\t         -0.714896,0.499344,0.489425,-0.718436,0.231178,0.656026,-0.640889,0.022736,0.767266,-0.616962,0.024018,0.786584,\n\t\t\t         -0.569628,-0.181951,0.801477,-0.587420,-0.184210,0.788018,-0.587420,-0.184210,0.788018,-0.569628,-0.181951,0.801477,\n\t\t\t         -0.441328,-0.399121,0.803674,-0.473769,-0.432478,0.767113,-0.616962,0.024018,0.786584,-0.694723,-0.047853,0.717643,\n\t\t\t         -0.673269,-0.293466,0.678640,-0.569628,-0.181951,0.801477,-0.569628,-0.181951,0.801477,-0.673269,-0.293466,0.678640,\n\t\t\t         -0.617176,-0.498489,0.608692,-0.441328,-0.399121,0.803674,-0.640889,0.022736,0.767266,-0.587420,-0.184210,0.788018,\n\t\t\t         -0.706198,-0.212287,0.675405,-0.717460,0.015595,0.696402,-0.717460,0.015595,0.696402,-0.706198,-0.212287,0.675405,\n\t\t\t         -0.773400,-0.169317,0.610859,-0.765831,0.058168,0.640370,-0.587420,-0.184210,0.788018,-0.473769,-0.432478,0.767113,\n\t\t\t         -0.652486,-0.475387,0.590075,-0.706198,-0.212287,0.675405,-0.706198,-0.212287,0.675405,-0.652486,-0.475387,0.590075,\n\t\t\t         -0.735832,-0.412152,0.537248,-0.773400,-0.169317,0.610859,-0.064943,-0.868618,0.491134,-0.207129,-0.954588,0.214118,\n\t\t\t         -0.531541,-0.729850,0.429823,-0.306101,-0.681753,0.664449,-0.306101,-0.681753,0.664449,-0.531541,-0.729850,0.429823,\n\t\t\t         -0.652486,-0.475387,0.590075,-0.473769,-0.432478,0.767113,-0.207129,-0.954588,0.214118,-0.155644,-0.973998,0.164495,\n\t\t\t         -0.573870,-0.711142,0.406049,-0.531541,-0.729850,0.429823,-0.531541,-0.729850,0.429823,-0.573870,-0.711142,0.406049,\n\t\t\t         -0.735832,-0.412152,0.537248,-0.652486,-0.475387,0.590075,-0.064943,-0.868618,0.491134,-0.306101,-0.681753,0.664449,\n\t\t\t         -0.204382,-0.610614,0.765069,0.060610,-0.765191,0.640919,0.060610,-0.765191,0.640919,-0.204382,-0.610614,0.765069,\n\t\t\t         -0.414747,-0.707236,0.572497,-0.088076,-0.869594,0.485824,-0.306101,-0.681753,0.664449,-0.473769,-0.432478,0.767113,\n\t\t\t         -0.441328,-0.399121,0.803674,-0.204382,-0.610614,0.765069,-0.204382,-0.610614,0.765069,-0.441328,-0.399121,0.803674,\n\t\t\t         -0.617176,-0.498489,0.608692,-0.414747,-0.707236,0.572497,-0.064943,-0.868618,0.491134,0.060610,-0.765191,0.640919,\n\t\t\t         0.312967,-0.850093,0.423505,0.253212,-0.913907,0.317148,0.253212,-0.913907,0.317148,0.312967,-0.850093,0.423505,\n\t\t\t         0.572008,-0.815088,0.091678,0.571978,-0.810266,0.127506,0.060610,-0.765191,0.640919,-0.088076,-0.869594,0.485824,\n\t\t\t         0.221076,-0.945128,0.240455,0.312967,-0.850093,0.423505,0.312967,-0.850093,0.423505,0.221076,-0.945128,0.240455,\n\t\t\t         0.435163,-0.881619,-0.182623,0.572008,-0.815088,0.091678,-0.064943,-0.868618,0.491134,0.253212,-0.913907,0.317148,\n\t\t\t         0.208502,-0.976714,0.050172,-0.207129,-0.954588,0.214118,-0.207129,-0.954588,0.214118,0.208502,-0.976714,0.050172,\n\t\t\t         0.197241,-0.977996,-0.067751,-0.155644,-0.973998,0.164495,0.253212,-0.913907,0.317148,0.571978,-0.810266,0.127506,\n\t\t\t         0.482864,-0.873592,-0.060488,0.208502,-0.976714,0.050172,0.208502,-0.976714,0.050172,0.482864,-0.873592,-0.060488,\n\t\t\t         0.327616,-0.918882,-0.219733,0.197241,-0.977996,-0.067751,0.855281,-0.429762,-0.289376,0.756798,-0.536851,-0.372784,\n\t\t\t         0.657643,-0.720908,-0.218482,0.778130,-0.621052,-0.093539,0.778130,-0.621052,-0.093539,0.657643,-0.720908,-0.218482,\n\t\t\t         0.482864,-0.873592,-0.060488,0.571978,-0.810266,0.127506,0.756798,-0.536851,-0.372784,0.561083,-0.626453,-0.541032,\n\t\t\t         0.438826,-0.810266,-0.388379,0.657643,-0.720908,-0.218482,0.657643,-0.720908,-0.218482,0.438826,-0.810266,-0.388379,\n\t\t\t         0.327616,-0.918882,-0.219733,0.482864,-0.873592,-0.060488,0.855281,-0.429762,-0.289376,0.778130,-0.621052,-0.093539,\n\t\t\t         0.731712,-0.636494,-0.243812,0.773949,-0.432905,-0.462142,0.773949,-0.432905,-0.462142,0.731712,-0.636494,-0.243812,\n\t\t\t         0.519120,-0.673605,-0.526048,0.575365,-0.490555,-0.654439,0.778130,-0.621052,-0.093539,0.571978,-0.810266,0.127506,\n\t\t\t         0.572008,-0.815088,0.091678,0.731712,-0.636494,-0.243812,0.731712,-0.636494,-0.243812,0.572008,-0.815088,0.091678,\n\t\t\t         0.435163,-0.881619,-0.182623,0.519120,-0.673605,-0.526048,0.855281,-0.429762,-0.289376,0.773949,-0.432905,-0.462142,\n\t\t\t         0.778314,-0.246590,-0.577349,0.861721,-0.248665,-0.442213,0.861721,-0.248665,-0.442213,0.778314,-0.246590,-0.577349,\n\t\t\t         0.752861,-0.046327,-0.656514,0.832423,-0.069796,-0.549699,0.773949,-0.432905,-0.462142,0.575365,-0.490555,-0.654439,\n\t\t\t         0.651143,-0.304483,-0.695151,0.778314,-0.246590,-0.577349,0.778314,-0.246590,-0.577349,0.651143,-0.304483,-0.695151,\n\t\t\t         0.645070,-0.060488,-0.761681,0.752861,-0.046327,-0.656514,0.855281,-0.429762,-0.289376,0.861721,-0.248665,-0.442213,\n\t\t\t         0.807703,-0.335398,-0.484817,0.756798,-0.536851,-0.372784,0.756798,-0.536851,-0.372784,0.807703,-0.335398,-0.484817,\n\t\t\t         0.668966,-0.398358,-0.627491,0.561083,-0.626453,-0.541032,0.861721,-0.248665,-0.442213,0.832423,-0.069796,-0.549699,\n\t\t\t         0.825129,-0.132450,-0.549181,0.807703,-0.335398,-0.484817,0.807703,-0.335398,-0.484817,0.825129,-0.132450,-0.549181,\n\t\t\t         0.742851,-0.166997,-0.648244,0.668966,-0.398358,-0.627491,0.666860,0.404157,-0.626026,0.769372,0.370952,-0.520005,\n\t\t\t         0.819758,0.085147,-0.566301,0.775475,0.124668,-0.618915,0.775475,0.124668,-0.618915,0.819758,0.085147,-0.566301,\n\t\t\t         0.825129,-0.132450,-0.549181,0.832423,-0.069796,-0.549699,0.769372,0.370952,-0.520005,0.756188,0.336955,-0.560869,\n\t\t\t         0.778649,0.070894,-0.623402,0.819758,0.085147,-0.566301,0.819758,0.085147,-0.566301,0.778649,0.070894,-0.623402,\n\t\t\t         0.742851,-0.166997,-0.648244,0.825129,-0.132450,-0.549181,0.666860,0.404157,-0.626026,0.775475,0.124668,-0.618915,\n\t\t\t         0.653035,0.158971,-0.740440,0.475326,0.397137,-0.785058,0.475326,0.397137,-0.785058,0.653035,0.158971,-0.740440,\n\t\t\t         0.516068,0.178961,-0.837611,0.312204,0.382580,-0.869533,0.775475,0.124668,-0.618915,0.832423,-0.069796,-0.549699,\n\t\t\t         0.752861,-0.046327,-0.656514,0.653035,0.158971,-0.740440,0.653035,0.158971,-0.740440,0.752861,-0.046327,-0.656514,\n\t\t\t         0.645070,-0.060488,-0.761681,0.516068,0.178961,-0.837611,0.666860,0.404157,-0.626026,0.475326,0.397137,-0.785058,\n\t\t\t         0.219764,0.672903,-0.706320,0.451308,0.730522,-0.512436,0.451308,0.730522,-0.512436,0.219764,0.672903,-0.706320,\n\t\t\t         -0.108432,0.879116,-0.464095,0.123905,0.957945,-0.258705,0.475326,0.397137,-0.785058,0.312204,0.382580,-0.869533,\n\t\t\t         0.057039,0.595141,-0.801569,0.219764,0.672903,-0.706320,0.219764,0.672903,-0.706320,0.057039,0.595141,-0.801569,\n\t\t\t         -0.247658,0.777123,-0.578539,-0.108432,0.879116,-0.464095,0.666860,0.404157,-0.626026,0.451308,0.730522,-0.512436,\n\t\t\t         0.602741,0.702231,-0.378826,0.769372,0.370952,-0.520005,0.769372,0.370952,-0.520005,0.602741,0.702231,-0.378826,\n\t\t\t         0.625416,0.631397,-0.458388,0.756188,0.336955,-0.560869,0.451308,0.730522,-0.512436,0.123905,0.957945,-0.258705,\n\t\t\t         0.289865,0.949065,-0.123386,0.602741,0.702231,-0.378826,0.602741,0.702231,-0.378826,0.289865,0.949065,-0.123386,\n\t\t\t         0.310282,0.915372,-0.256478,0.625416,0.631397,-0.458388,-0.564562,0.821833,-0.076296,-0.607166,0.792383,-0.058473,\n\t\t\t         -0.491562,0.803858,-0.334849,-0.425306,0.831294,-0.357799,-0.425306,0.831294,-0.357799,-0.491562,0.803858,-0.334849,\n\t\t\t         -0.278939,0.724143,-0.630665,-0.217505,0.738273,-0.638417,-0.607166,0.792383,-0.058473,-0.613819,0.789392,0.005432,\n\t\t\t         -0.491226,0.828516,-0.268715,-0.491562,0.803858,-0.334849,-0.491562,0.803858,-0.334849,-0.491226,0.828516,-0.268715,\n\t\t\t         -0.247658,0.777123,-0.578539,-0.278939,0.724143,-0.630665,-0.564562,0.821833,-0.076296,-0.425306,0.831294,-0.357799,\n\t\t\t         -0.388867,0.829737,-0.400311,-0.571673,0.809809,-0.131748,-0.571673,0.809809,-0.131748,-0.388867,0.829737,-0.400311,\n\t\t\t         -0.464675,0.700766,-0.541246,-0.656056,0.690786,-0.303873,-0.425306,0.831294,-0.357799,-0.217505,0.738273,-0.638417,\n\t\t\t         -0.151708,0.746178,-0.648183,-0.388867,0.829737,-0.400311,-0.388867,0.829737,-0.400311,-0.151708,0.746178,-0.648183,\n\t\t\t         -0.211371,0.647328,-0.732292,-0.464675,0.700766,-0.541246,-0.564562,0.821833,-0.076296,-0.571673,0.809809,-0.131748,\n\t\t\t         -0.709555,0.688345,0.150639,-0.675192,0.712699,0.190039,-0.675192,0.712699,0.190039,-0.709555,0.688345,0.150639,\n\t\t\t         -0.786187,0.423444,0.450056,-0.760094,0.468764,0.449934,-0.571673,0.809809,-0.131748,-0.656056,0.690786,-0.303873,\n\t\t\t         -0.802393,0.596728,0.001526,-0.709555,0.688345,0.150639,-0.709555,0.688345,0.150639,-0.802393,0.596728,0.001526,\n\t\t\t         -0.864498,0.339885,0.370220,-0.786187,0.423444,0.450056,-0.564562,0.821833,-0.076296,-0.675192,0.712699,0.190039,\n\t\t\t         -0.687796,0.699088,0.195410,-0.607166,0.792383,-0.058473,-0.607166,0.792383,-0.058473,-0.687796,0.699088,0.195410,\n\t\t\t         -0.676168,0.691336,0.254585,-0.613819,0.789392,0.005432,-0.675192,0.712699,0.190039,-0.760094,0.468764,0.449934,\n\t\t\t         -0.757347,0.485580,0.436567,-0.687796,0.699088,0.195410,-0.687796,0.699088,0.195410,-0.757347,0.485580,0.436567,\n\t\t\t         -0.714896,0.499344,0.489425,-0.676168,0.691336,0.254585,-0.713431,-0.130711,0.688375,-0.755821,-0.129398,0.641835,\n\t\t\t         -0.783135,0.181524,0.594714,-0.770653,0.148595,0.619617,-0.770653,0.148595,0.619617,-0.783135,0.181524,0.594714,\n\t\t\t         -0.757347,0.485580,0.436567,-0.760094,0.468764,0.449934,-0.755821,-0.129398,0.641835,-0.694723,-0.047853,0.717643,\n\t\t\t         -0.718436,0.231178,0.656026,-0.783135,0.181524,0.594714,-0.783135,0.181524,0.594714,-0.718436,0.231178,0.656026,\n\t\t\t         -0.714896,0.499344,0.489425,-0.757347,0.485580,0.436567,-0.713431,-0.130711,0.688375,-0.770653,0.148595,0.619617,\n\t\t\t         -0.757408,0.101199,0.645009,-0.679464,-0.128849,0.722282,-0.679464,-0.128849,0.722282,-0.757408,0.101199,0.645009,\n\t\t\t         -0.786950,0.022767,0.616565,-0.701834,-0.141972,0.698019,-0.770653,0.148595,0.619617,-0.760094,0.468764,0.449934,\n\t\t\t         -0.786187,0.423444,0.450056,-0.757408,0.101199,0.645009,-0.757408,0.101199,0.645009,-0.786187,0.423444,0.450056,\n\t\t\t         -0.864498,0.339885,0.370220,-0.786950,0.022767,0.616565,-0.713431,-0.130711,0.688375,-0.679464,-0.128849,0.722282,\n\t\t\t         -0.552049,-0.301370,0.777398,-0.603961,-0.364635,0.708670,-0.603961,-0.364635,0.708670,-0.552049,-0.301370,0.777398,\n\t\t\t         -0.394177,-0.423841,0.815424,-0.512955,-0.535661,0.670705,-0.679464,-0.128849,0.722282,-0.701834,-0.141972,0.698019,\n\t\t\t         -0.589923,-0.229713,0.774071,-0.552049,-0.301370,0.777398,-0.552049,-0.301370,0.777398,-0.589923,-0.229713,0.774071,\n\t\t\t         -0.392895,-0.354961,0.848292,-0.394177,-0.423841,0.815424,-0.713431,-0.130711,0.688375,-0.603961,-0.364635,0.708670,\n\t\t\t         -0.699667,-0.397046,0.593951,-0.755821,-0.129398,0.641835,-0.755821,-0.129398,0.641835,-0.699667,-0.397046,0.593951,\n\t\t\t         -0.673269,-0.293466,0.678640,-0.694723,-0.047853,0.717643,-0.603961,-0.364635,0.708670,-0.512955,-0.535661,0.670705,\n\t\t\t         -0.662282,-0.576159,0.478896,-0.699667,-0.397046,0.593951,-0.699667,-0.397046,0.593951,-0.662282,-0.576159,0.478896,\n\t\t\t         -0.617176,-0.498489,0.608692,-0.673269,-0.293466,0.678640,-0.232704,-0.880184,0.413617,-0.284280,-0.922483,0.261116,\n\t\t\t         -0.561144,-0.740532,0.369732,-0.440596,-0.688925,0.575518,-0.440596,-0.688925,0.575518,-0.561144,-0.740532,0.369732,\n\t\t\t         -0.662282,-0.576159,0.478896,-0.512955,-0.535661,0.670705,-0.284280,-0.922483,0.261116,-0.088076,-0.869594,0.485824,\n\t\t\t         -0.414747,-0.707236,0.572497,-0.561144,-0.740532,0.369732,-0.561144,-0.740532,0.369732,-0.414747,-0.707236,0.572497,\n\t\t\t         -0.617176,-0.498489,0.608692,-0.662282,-0.576159,0.478896,-0.232704,-0.880184,0.413617,-0.440596,-0.688925,0.575518,\n\t\t\t         -0.233345,-0.523881,0.819178,0.009766,-0.657308,0.753533,0.009766,-0.657308,0.753533,-0.233345,-0.523881,0.819178,\n\t\t\t         -0.185980,-0.531663,0.826258,0.019501,-0.699545,0.714316,-0.440596,-0.688925,0.575518,-0.512955,-0.535661,0.670705,\n\t\t\t         -0.394177,-0.423841,0.815424,-0.233345,-0.523881,0.819178,-0.233345,-0.523881,0.819178,-0.394177,-0.423841,0.815424,\n\t\t\t         -0.392895,-0.354961,0.848292,-0.185980,-0.531663,0.826258,-0.232704,-0.880184,0.413617,0.009766,-0.657308,0.753533,\n\t\t\t         0.408918,-0.731925,0.545000,0.163915,-0.976440,0.140172,0.163915,-0.976440,0.140172,0.408918,-0.731925,0.545000,\n\t\t\t         0.791833,-0.592578,0.147557,0.548387,-0.807550,-0.216926,0.009766,-0.657308,0.753533,0.019501,-0.699545,0.714316,\n\t\t\t         0.338084,-0.791009,0.509873,0.408918,-0.731925,0.545000,0.408918,-0.731925,0.545000,0.338084,-0.791009,0.509873,\n\t\t\t         0.715293,-0.681753,0.153325,0.791833,-0.592578,0.147557,-0.232704,-0.880184,0.413617,0.163915,-0.976440,0.140172,\n\t\t\t         0.075503,-0.997040,0.014283,-0.284280,-0.922483,0.261116,-0.284280,-0.922483,0.261116,0.075503,-0.997040,0.014283,\n\t\t\t         0.221076,-0.945128,0.240455,-0.088076,-0.869594,0.485824,0.163915,-0.976440,0.140172,0.548387,-0.807550,-0.216926,\n\t\t\t         0.347392,-0.867458,-0.356090,0.075503,-0.997040,0.014283,0.075503,-0.997040,0.014283,0.347392,-0.867458,-0.356090,\n\t\t\t         0.435163,-0.881619,-0.182623,0.221076,-0.945128,0.240455,0.693075,-0.469405,-0.547014,0.550859,-0.522813,-0.650502,\n\t\t\t         0.471297,-0.656423,-0.589038,0.685110,-0.583789,-0.435591,0.685110,-0.583789,-0.435591,0.471297,-0.656423,-0.589038,\n\t\t\t         0.347392,-0.867458,-0.356090,0.548387,-0.807550,-0.216926,0.550859,-0.522813,-0.650502,0.575365,-0.490555,-0.654439,\n\t\t\t         0.519120,-0.673605,-0.526048,0.471297,-0.656423,-0.589038,0.471297,-0.656423,-0.589038,0.519120,-0.673605,-0.526048,\n\t\t\t         0.435163,-0.881619,-0.182623,0.347392,-0.867458,-0.356090,0.693075,-0.469405,-0.547014,0.685110,-0.583789,-0.435591,\n\t\t\t         0.894528,-0.394574,-0.209998,0.859523,-0.299844,-0.413862,0.859523,-0.299844,-0.413862,0.894528,-0.394574,-0.209998,\n\t\t\t         0.896786,-0.406201,-0.175237,0.911252,-0.204108,-0.357616,0.685110,-0.583789,-0.435591,0.548387,-0.807550,-0.216926,\n\t\t\t         0.791833,-0.592578,0.147557,0.894528,-0.394574,-0.209998,0.894528,-0.394574,-0.209998,0.791833,-0.592578,0.147557,\n\t\t\t         0.715293,-0.681753,0.153325,0.896786,-0.406201,-0.175237,0.693075,-0.469405,-0.547014,0.859523,-0.299844,-0.413862,\n\t\t\t         0.788476,-0.186804,-0.585955,0.670888,-0.315806,-0.670888,0.670888,-0.315806,-0.670888,0.788476,-0.186804,-0.585955,\n\t\t\t         0.650899,0.033235,-0.758415,0.584674,-0.050996,-0.809626,0.859523,-0.299844,-0.413862,0.911252,-0.204108,-0.357616,\n\t\t\t         0.840938,-0.045442,-0.539201,0.788476,-0.186804,-0.585955,0.788476,-0.186804,-0.585955,0.840938,-0.045442,-0.539201,\n\t\t\t         0.670034,0.152593,-0.726432,0.650899,0.033235,-0.758415,0.693075,-0.469405,-0.547014,0.670888,-0.315806,-0.670888,\n\t\t\t         0.607654,-0.345286,-0.715171,0.550859,-0.522813,-0.650502,0.550859,-0.522813,-0.650502,0.607654,-0.345286,-0.715171,\n\t\t\t         0.651143,-0.304483,-0.695151,0.575365,-0.490555,-0.654439,0.670888,-0.315806,-0.670888,0.584674,-0.050996,-0.809626,\n\t\t\t         0.569201,-0.075594,-0.818690,0.607654,-0.345286,-0.715171,0.607654,-0.345286,-0.715171,0.569201,-0.075594,-0.818690,\n\t\t\t         0.645070,-0.060488,-0.761681,0.651143,-0.304483,-0.695151,0.223914,0.407849,-0.885128,0.223182,0.381024,-0.897183,\n\t\t\t         0.419477,0.189184,-0.887814,0.412915,0.219214,-0.883969,0.412915,0.219214,-0.883969,0.419477,0.189184,-0.887814,\n\t\t\t         0.569201,-0.075594,-0.818690,0.584674,-0.050996,-0.809626,0.223182,0.381024,-0.897183,0.312204,0.382580,-0.869533,\n\t\t\t         0.516068,0.178961,-0.837611,0.419477,0.189184,-0.887814,0.419477,0.189184,-0.887814,0.516068,0.178961,-0.837611,\n\t\t\t         0.645070,-0.060488,-0.761681,0.569201,-0.075594,-0.818690,0.223914,0.407849,-0.885128,0.412915,0.219214,-0.883969,\n\t\t\t         0.445540,0.273537,-0.852412,0.259407,0.440474,-0.859432,0.259407,0.440474,-0.859432,0.445540,0.273537,-0.852412,\n\t\t\t         0.429640,0.345439,-0.834284,0.227393,0.458724,-0.858943,0.412915,0.219214,-0.883969,0.584674,-0.050996,-0.809626,\n\t\t\t         0.650899,0.033235,-0.758415,0.445540,0.273537,-0.852412,0.445540,0.273537,-0.852412,0.650899,0.033235,-0.758415,\n\t\t\t         0.670034,0.152593,-0.726432,0.429640,0.345439,-0.834284,0.223914,0.407849,-0.885128,0.259407,0.440474,-0.859432,\n\t\t\t         0.081545,0.588916,-0.804041,0.022004,0.572405,-0.819666,0.022004,0.572405,-0.819666,0.081545,0.588916,-0.804041,\n\t\t\t         -0.151708,0.746178,-0.648183,-0.217505,0.738273,-0.638417,0.259407,0.440474,-0.859432,0.227393,0.458724,-0.858943,\n\t\t\t         0.041444,0.545824,-0.836848,0.081545,0.588916,-0.804041,0.081545,0.588916,-0.804041,0.041444,0.545824,-0.836848,\n\t\t\t         -0.211371,0.647328,-0.732292,-0.151708,0.746178,-0.648183,0.223914,0.407849,-0.885128,0.022004,0.572405,-0.819666,\n\t\t\t         -0.007904,0.556505,-0.830775,0.223182,0.381024,-0.897183,0.223182,0.381024,-0.897183,-0.007904,0.556505,-0.830775,\n\t\t\t         0.057039,0.595141,-0.801569,0.312204,0.382580,-0.869533,0.022004,0.572405,-0.819666,-0.217505,0.738273,-0.638417,\n\t\t\t         -0.278939,0.724143,-0.630665,-0.007904,0.556505,-0.830775,-0.007904,0.556505,-0.830775,-0.278939,0.724143,-0.630665,\n\t\t\t         -0.247658,0.777123,-0.578539,0.057039,0.595141,-0.801569,-0.596423,0.729392,-0.334971,-0.655934,0.649861,-0.383892,\n\t\t\t         -0.470199,0.655995,-0.590381,-0.410901,0.753624,-0.512986,-0.410901,0.753624,-0.512986,-0.470199,0.655995,-0.590381,\n\t\t\t         -0.245308,0.612842,-0.751122,-0.192450,0.731498,-0.654073,-0.655934,0.649861,-0.383892,-0.656056,0.690786,-0.303873,\n\t\t\t         -0.464675,0.700766,-0.541246,-0.470199,0.655995,-0.590381,-0.470199,0.655995,-0.590381,-0.464675,0.700766,-0.541246,\n\t\t\t         -0.211371,0.647328,-0.732292,-0.245308,0.612842,-0.751122,-0.596423,0.729392,-0.334971,-0.410901,0.753624,-0.512986,\n\t\t\t         -0.450789,0.737693,-0.502548,-0.628712,0.696707,-0.345317,-0.628712,0.696707,-0.345317,-0.450789,0.737693,-0.502548,\n\t\t\t         -0.559465,0.599567,-0.572253,-0.735618,0.534928,-0.415540,-0.410901,0.753624,-0.512986,-0.192450,0.731498,-0.654073,\n\t\t\t         -0.240974,0.740623,-0.627155,-0.450789,0.737693,-0.502548,-0.450789,0.737693,-0.502548,-0.240974,0.740623,-0.627155,\n\t\t\t         -0.378491,0.605182,-0.700308,-0.559465,0.599567,-0.572253,-0.596423,0.729392,-0.334971,-0.628712,0.696707,-0.345317,\n\t\t\t         -0.819575,0.565813,-0.090060,-0.773614,0.631306,-0.053987,-0.773614,0.631306,-0.053987,-0.819575,0.565813,-0.090060,\n\t\t\t         -0.927274,0.292795,0.233192,-0.857082,0.415174,0.304971,-0.628712,0.696707,-0.345317,-0.735618,0.534928,-0.415540,\n\t\t\t         -0.908872,0.375744,-0.180883,-0.819575,0.565813,-0.090060,-0.819575,0.565813,-0.090060,-0.908872,0.375744,-0.180883,\n\t\t\t         -0.983154,0.122898,0.135136,-0.927274,0.292795,0.233192,-0.596423,0.729392,-0.334971,-0.773614,0.631306,-0.053987,\n\t\t\t         -0.826594,0.555864,-0.087863,-0.655934,0.649861,-0.383892,-0.655934,0.649861,-0.383892,-0.826594,0.555864,-0.087863,\n\t\t\t         -0.802393,0.596728,0.001526,-0.656056,0.690786,-0.303873,-0.773614,0.631306,-0.053987,-0.857082,0.415174,0.304971,\n\t\t\t         -0.897763,0.326670,0.295389,-0.826594,0.555864,-0.087863,-0.826594,0.555864,-0.087863,-0.897763,0.326670,0.295389,\n\t\t\t         -0.864498,0.339885,0.370220,-0.802393,0.596728,0.001526,-0.695517,-0.143773,0.703940,-0.664235,-0.049928,0.745811,\n\t\t\t         -0.791528,0.074587,0.606525,-0.795007,0.109470,0.596606,-0.795007,0.109470,0.596606,-0.791528,0.074587,0.606525,\n\t\t\t         -0.897763,0.326670,0.295389,-0.857082,0.415174,0.304971,-0.664235,-0.049928,0.745811,-0.701834,-0.141972,0.698019,\n\t\t\t         -0.786950,0.022767,0.616565,-0.791528,0.074587,0.606525,-0.791528,0.074587,0.606525,-0.786950,0.022767,0.616565,\n\t\t\t         -0.864498,0.339885,0.370220,-0.897763,0.326670,0.295389,-0.695517,-0.143773,0.703940,-0.795007,0.109470,0.596606,\n\t\t\t         -0.866451,-0.056642,0.495987,-0.731498,-0.277291,0.622883,-0.731498,-0.277291,0.622883,-0.866451,-0.056642,0.495987,\n\t\t\t         -0.891598,-0.104526,0.440535,-0.755486,-0.207617,0.621387,-0.795007,0.109470,0.596606,-0.857082,0.415174,0.304971,\n\t\t\t         -0.927274,0.292795,0.233192,-0.866451,-0.056642,0.495987,-0.866451,-0.056642,0.495987,-0.927274,0.292795,0.233192,\n\t\t\t         -0.983154,0.122898,0.135136,-0.891598,-0.104526,0.440535,-0.695517,-0.143773,0.703940,-0.731498,-0.277291,0.622883,\n\t\t\t         -0.587878,-0.385510,0.711142,-0.577441,-0.364238,0.730644,-0.577441,-0.364238,0.730644,-0.587878,-0.385510,0.711142,\n\t\t\t         -0.328410,-0.527421,0.783532,-0.345195,-0.600360,0.721335,-0.731498,-0.277291,0.622883,-0.755486,-0.207617,0.621387,\n\t\t\t         -0.623890,-0.307443,0.718467,-0.587878,-0.385510,0.711142,-0.587878,-0.385510,0.711142,-0.623890,-0.307443,0.718467,\n\t\t\t         -0.385205,-0.515732,0.765252,-0.328410,-0.527421,0.783532,-0.695517,-0.143773,0.703940,-0.577441,-0.364238,0.730644,\n\t\t\t         -0.559130,-0.188391,0.807367,-0.664235,-0.049928,0.745811,-0.664235,-0.049928,0.745811,-0.559130,-0.188391,0.807367,\n\t\t\t         -0.589923,-0.229713,0.774071,-0.701834,-0.141972,0.698019,-0.577441,-0.364238,0.730644,-0.345195,-0.600360,0.721335,\n\t\t\t         -0.375378,-0.463729,0.802484,-0.559130,-0.188391,0.807367,-0.559130,-0.188391,0.807367,-0.375378,-0.463729,0.802484,\n\t\t\t         -0.392895,-0.354961,0.848292,-0.589923,-0.229713,0.774071,0.119388,-0.828791,0.546648,-0.019410,-0.856929,0.515030,\n\t\t\t         -0.165685,-0.709830,0.684561,-0.087069,-0.749138,0.656636,-0.087069,-0.749138,0.656636,-0.165685,-0.709830,0.684561,\n\t\t\t         -0.375378,-0.463729,0.802484,-0.345195,-0.600360,0.721335,-0.019410,-0.856929,0.515030,0.019501,-0.699545,0.714316,\n\t\t\t         -0.185980,-0.531663,0.826258,-0.165685,-0.709830,0.684561,-0.165685,-0.709830,0.684561,-0.185980,-0.531663,0.826258,\n\t\t\t         -0.392895,-0.354961,0.848292,-0.375378,-0.463729,0.802484,0.119388,-0.828791,0.546648,-0.087069,-0.749138,0.656636,\n\t\t\t         -0.032350,-0.663961,0.747032,0.228614,-0.766137,0.600604,0.228614,-0.766137,0.600604,-0.032350,-0.663961,0.747032,\n\t\t\t         -0.049287,-0.724082,0.687918,0.247505,-0.832179,0.496139,-0.087069,-0.749138,0.656636,-0.345195,-0.600360,0.721335,\n\t\t\t         -0.328410,-0.527421,0.783532,-0.032350,-0.663961,0.747032,-0.032350,-0.663961,0.747032,-0.328410,-0.527421,0.783532,\n\t\t\t         -0.385205,-0.515732,0.765252,-0.049287,-0.724082,0.687918,0.119388,-0.828791,0.546648,0.228614,-0.766137,0.600604,\n\t\t\t         0.457930,-0.807611,0.371502,0.314127,-0.883938,0.346294,0.314127,-0.883938,0.346294,0.457930,-0.807611,0.371502,\n\t\t\t         0.650502,-0.753502,0.095004,0.528916,-0.848262,0.025788,0.228614,-0.766137,0.600604,0.247505,-0.832179,0.496139,\n\t\t\t         0.465377,-0.848292,0.252541,0.457930,-0.807611,0.371502,0.457930,-0.807611,0.371502,0.465377,-0.848292,0.252541,\n\t\t\t         0.617420,-0.786584,-0.006226,0.650502,-0.753502,0.095004,0.119388,-0.828791,0.546648,0.314127,-0.883938,0.346294,\n\t\t\t         0.166692,-0.941465,0.292917,-0.019410,-0.856929,0.515030,-0.019410,-0.856929,0.515030,0.166692,-0.941465,0.292917,\n\t\t\t         0.338084,-0.791009,0.509873,0.019501,-0.699545,0.714316,0.314127,-0.883938,0.346294,0.528916,-0.848262,0.025788,\n\t\t\t         0.480331,-0.876064,-0.041414,0.166692,-0.941465,0.292917,0.166692,-0.941465,0.292917,0.480331,-0.876064,-0.041414,\n\t\t\t         0.715293,-0.681753,0.153325,0.338084,-0.791009,0.509873,0.726829,-0.478927,-0.492264,0.772240,-0.389782,-0.501633,\n\t\t\t         0.699454,-0.639180,-0.319651,0.672201,-0.689322,-0.270028,0.672201,-0.689322,-0.270028,0.699454,-0.639180,-0.319651,\n\t\t\t         0.480331,-0.876064,-0.041414,0.528916,-0.848262,0.025788,0.772240,-0.389782,-0.501633,0.911252,-0.204108,-0.357616,\n\t\t\t         0.896786,-0.406201,-0.175237,0.699454,-0.639180,-0.319651,0.699454,-0.639180,-0.319651,0.896786,-0.406201,-0.175237,\n\t\t\t         0.715293,-0.681753,0.153325,0.480331,-0.876064,-0.041414,0.726829,-0.478927,-0.492264,0.672201,-0.689322,-0.270028,\n\t\t\t         0.769372,-0.617969,-0.161657,0.821436,-0.442213,-0.360027,0.821436,-0.442213,-0.360027,0.769372,-0.617969,-0.161657,\n\t\t\t         0.702750,-0.667989,-0.244758,0.730491,-0.540300,-0.417615,0.672201,-0.689322,-0.270028,0.528916,-0.848262,0.025788,\n\t\t\t         0.650502,-0.753502,0.095004,0.769372,-0.617969,-0.161657,0.769372,-0.617969,-0.161657,0.650502,-0.753502,0.095004,\n\t\t\t         0.617420,-0.786584,-0.006226,0.702750,-0.667989,-0.244758,0.726829,-0.478927,-0.492264,0.821436,-0.442213,-0.360027,\n\t\t\t         0.833155,-0.220740,-0.507035,0.711112,-0.218665,-0.668172,0.711112,-0.218665,-0.668172,0.833155,-0.220740,-0.507035,\n\t\t\t         0.752281,0.096835,-0.651631,0.604724,0.096866,-0.790490,0.821436,-0.442213,-0.360027,0.730491,-0.540300,-0.417615,\n\t\t\t         0.728843,-0.395184,-0.559099,0.833155,-0.220740,-0.507035,0.833155,-0.220740,-0.507035,0.728843,-0.395184,-0.559099,\n\t\t\t         0.633076,-0.118778,-0.764885,0.752281,0.096835,-0.651631,0.726829,-0.478927,-0.492264,0.711112,-0.218665,-0.668172,\n\t\t\t         0.728263,-0.136906,-0.671438,0.772240,-0.389782,-0.501633,0.772240,-0.389782,-0.501633,0.728263,-0.136906,-0.671438,\n\t\t\t         0.840938,-0.045442,-0.539201,0.911252,-0.204108,-0.357616,0.711112,-0.218665,-0.668172,0.604724,0.096866,-0.790490,\n\t\t\t         0.568957,0.122227,-0.813196,0.728263,-0.136906,-0.671438,0.728263,-0.136906,-0.671438,0.568957,0.122227,-0.813196,\n\t\t\t         0.670034,0.152593,-0.726432,0.840938,-0.045442,-0.539201,0.211524,0.563372,-0.798639,0.154515,0.464888,-0.871761,\n\t\t\t         0.344371,0.342112,-0.874264,0.404553,0.391644,-0.826380,0.404553,0.391644,-0.826380,0.344371,0.342112,-0.874264,\n\t\t\t         0.568957,0.122227,-0.813196,0.604724,0.096866,-0.790490,0.154515,0.464888,-0.871761,0.227393,0.458724,-0.858943,\n\t\t\t         0.429640,0.345439,-0.834284,0.344371,0.342112,-0.874264,0.344371,0.342112,-0.874264,0.429640,0.345439,-0.834284,\n\t\t\t         0.670034,0.152593,-0.726432,0.568957,0.122227,-0.813196,0.211524,0.563372,-0.798639,0.404553,0.391644,-0.826380,\n\t\t\t         0.515976,0.427259,-0.742393,0.241005,0.623493,-0.743736,0.241005,0.623493,-0.743736,0.515976,0.427259,-0.742393,\n\t\t\t         0.373852,0.220862,-0.900784,0.068789,0.451888,-0.889401,0.404553,0.391644,-0.826380,0.604724,0.096866,-0.790490,\n\t\t\t         0.752281,0.096835,-0.651631,0.515976,0.427259,-0.742393,0.515976,0.427259,-0.742393,0.752281,0.096835,-0.651631,\n\t\t\t         0.633076,-0.118778,-0.764885,0.373852,0.220862,-0.900784,0.211524,0.563372,-0.798639,0.241005,0.623493,-0.743736,\n\t\t\t         -0.001862,0.706595,-0.707572,0.033601,0.660360,-0.750175,0.033601,0.660360,-0.750175,-0.001862,0.706595,-0.707572,\n\t\t\t         -0.240974,0.740623,-0.627155,-0.192450,0.731498,-0.654073,0.241005,0.623493,-0.743736,0.068789,0.451888,-0.889401,\n\t\t\t         -0.180731,0.565416,-0.804743,-0.001862,0.706595,-0.707572,-0.001862,0.706595,-0.707572,-0.180731,0.565416,-0.804743,\n\t\t\t         -0.378491,0.605182,-0.700308,-0.240974,0.740623,-0.627155,0.211524,0.563372,-0.798639,0.033601,0.660360,-0.750175,\n\t\t\t         -0.016755,0.538896,-0.842189,0.154515,0.464888,-0.871761,0.154515,0.464888,-0.871761,-0.016755,0.538896,-0.842189,\n\t\t\t         0.041444,0.545824,-0.836848,0.227393,0.458724,-0.858943,0.033601,0.660360,-0.750175,-0.192450,0.731498,-0.654073,\n\t\t\t         -0.245308,0.612842,-0.751122,-0.016755,0.538896,-0.842189,-0.016755,0.538896,-0.842189,-0.245308,0.612842,-0.751122,\n\t\t\t         -0.211371,0.647328,-0.732292,0.041444,0.545824,-0.836848,-0.773766,0.513596,-0.370769,-0.781365,0.476272,-0.403241,\n\t\t\t         -0.611621,0.520524,-0.595752,-0.610920,0.534623,-0.583850,-0.610920,0.534623,-0.583850,-0.611621,0.520524,-0.595752,\n\t\t\t         -0.435316,0.502274,-0.747124,-0.424421,0.480697,-0.767296,-0.781365,0.476272,-0.403241,-0.735618,0.534928,-0.415540,\n\t\t\t         -0.559465,0.599567,-0.572253,-0.611621,0.520524,-0.595752,-0.611621,0.520524,-0.595752,-0.559465,0.599567,-0.572253,\n\t\t\t         -0.378491,0.605182,-0.700308,-0.435316,0.502274,-0.747124,-0.773766,0.513596,-0.370769,-0.610920,0.534623,-0.583850,\n\t\t\t         -0.550462,0.635487,-0.541398,-0.723106,0.607562,-0.328501,-0.723106,0.607562,-0.328501,-0.550462,0.635487,-0.541398,\n\t\t\t         -0.454207,0.775262,-0.438887,-0.639302,0.731773,-0.236122,-0.610920,0.534623,-0.583850,-0.424421,0.480697,-0.767296,\n\t\t\t         -0.341288,0.588000,-0.733299,-0.550462,0.635487,-0.541398,-0.550462,0.635487,-0.541398,-0.341288,0.588000,-0.733299,\n\t\t\t         -0.230934,0.748466,-0.621601,-0.454207,0.775262,-0.438887,-0.773766,0.513596,-0.370769,-0.723106,0.607562,-0.328501,\n\t\t\t         -0.877651,0.475051,-0.063234,-0.910703,0.400159,-0.102359,-0.910703,0.400159,-0.102359,-0.877651,0.475051,-0.063234,\n\t\t\t         -0.944578,0.255837,0.205664,-0.961547,0.210059,0.176763,-0.723106,0.607562,-0.328501,-0.639302,0.731773,-0.236122,\n\t\t\t         -0.805567,0.591754,0.029603,-0.877651,0.475051,-0.063234,-0.877651,0.475051,-0.063234,-0.805567,0.591754,0.029603,\n\t\t\t         -0.881130,0.351543,0.316172,-0.944578,0.255837,0.205664,-0.773766,0.513596,-0.370769,-0.910703,0.400159,-0.102359,\n\t\t\t         -0.922269,0.364818,-0.127567,-0.781365,0.476272,-0.403241,-0.781365,0.476272,-0.403241,-0.922269,0.364818,-0.127567,\n\t\t\t         -0.908872,0.375744,-0.180883,-0.735618,0.534928,-0.415540,-0.910703,0.400159,-0.102359,-0.961547,0.210059,0.176763,\n\t\t\t         -0.963561,0.189093,0.189093,-0.922269,0.364818,-0.127567,-0.922269,0.364818,-0.127567,-0.963561,0.189093,0.189093,\n\t\t\t         -0.983154,0.122898,0.135136,-0.908872,0.375744,-0.180883,-0.823786,-0.186651,0.535234,-0.796777,-0.159581,0.582781,\n\t\t\t         -0.898953,0.006134,0.437941,-0.917081,0.009827,0.398511,-0.917081,0.009827,0.398511,-0.898953,0.006134,0.437941,\n\t\t\t         -0.963561,0.189093,0.189093,-0.961547,0.210059,0.176763,-0.796777,-0.159581,0.582781,-0.755486,-0.207617,0.621387,\n\t\t\t         -0.891598,-0.104526,0.440535,-0.898953,0.006134,0.437941,-0.898953,0.006134,0.437941,-0.891598,-0.104526,0.440535,\n\t\t\t         -0.983154,0.122898,0.135136,-0.963561,0.189093,0.189093,-0.823786,-0.186651,0.535234,-0.917081,0.009827,0.398511,\n\t\t\t         -0.910428,0.026612,0.412763,-0.814753,-0.198523,0.544725,-0.814753,-0.198523,0.544725,-0.910428,0.026612,0.412763,\n\t\t\t         -0.843501,0.094668,0.528672,-0.736747,-0.137059,0.662069,-0.917081,0.009827,0.398511,-0.961547,0.210059,0.176763,\n\t\t\t         -0.944578,0.255837,0.205664,-0.910428,0.026612,0.412763,-0.910428,0.026612,0.412763,-0.944578,0.255837,0.205664,\n\t\t\t         -0.881130,0.351543,0.316172,-0.843501,0.094668,0.528672,-0.823786,-0.186651,0.535234,-0.814753,-0.198523,0.544725,\n\t\t\t         -0.681692,-0.433271,0.589526,-0.704276,-0.408612,0.580523,-0.704276,-0.408612,0.580523,-0.681692,-0.433271,0.589526,\n\t\t\t         -0.443342,-0.704794,0.553789,-0.466964,-0.694388,0.547472,-0.814753,-0.198523,0.544725,-0.736747,-0.137059,0.662069,\n\t\t\t         -0.583941,-0.350291,0.732292,-0.681692,-0.433271,0.589526,-0.681692,-0.433271,0.589526,-0.583941,-0.350291,0.732292,\n\t\t\t         -0.345195,-0.571612,0.744346,-0.443342,-0.704794,0.553789,-0.823786,-0.186651,0.535234,-0.704276,-0.408612,0.580523,\n\t\t\t         -0.670400,-0.344371,0.657216,-0.796777,-0.159581,0.582781,-0.796777,-0.159581,0.582781,-0.670400,-0.344371,0.657216,\n\t\t\t         -0.623890,-0.307443,0.718467,-0.755486,-0.207617,0.621387,-0.704276,-0.408612,0.580523,-0.466964,-0.694388,0.547472,\n\t\t\t         -0.425581,-0.602527,0.675130,-0.670400,-0.344371,0.657216,-0.670400,-0.344371,0.657216,-0.425581,-0.602527,0.675130,\n\t\t\t         -0.385205,-0.515732,0.765252,-0.623890,-0.307443,0.718467,0.231422,-0.952055,0.199927,0.253487,-0.898587,0.358074,\n\t\t\t         -0.061495,-0.821253,0.567186,-0.091800,-0.907682,0.409467,-0.091800,-0.907682,0.409467,-0.061495,-0.821253,0.567186,\n\t\t\t         -0.425581,-0.602527,0.675130,-0.466964,-0.694388,0.547472,0.253487,-0.898587,0.358074,0.247505,-0.832179,0.496139,\n\t\t\t         -0.049287,-0.724082,0.687918,-0.061495,-0.821253,0.567186,-0.061495,-0.821253,0.567186,-0.049287,-0.724082,0.687918,\n\t\t\t         -0.385205,-0.515732,0.765252,-0.425581,-0.602527,0.675130,0.231422,-0.952055,0.199927,-0.091800,-0.907682,0.409467,\n\t\t\t         -0.069552,-0.902493,0.425001,0.266549,-0.935636,0.231239,0.266549,-0.935636,0.231239,-0.069552,-0.902493,0.425001,\n\t\t\t         0.005127,-0.747917,0.663717,0.345592,-0.798914,0.492203,-0.091800,-0.907682,0.409467,-0.466964,-0.694388,0.547472,\n\t\t\t         -0.443342,-0.704794,0.553789,-0.069552,-0.902493,0.425001,-0.069552,-0.902493,0.425001,-0.443342,-0.704794,0.553789,\n\t\t\t         -0.345195,-0.571612,0.744346,0.005127,-0.747917,0.663717,0.231422,-0.952055,0.199927,0.266549,-0.935636,0.231239,\n\t\t\t         0.496536,-0.867702,0.022034,0.436933,-0.899167,-0.023225,0.436933,-0.899167,-0.023225,0.496536,-0.867702,0.022034,\n\t\t\t         0.636738,-0.742546,-0.207739,0.551317,-0.796625,-0.247810,0.266549,-0.935636,0.231239,0.345592,-0.798914,0.492203,\n\t\t\t         0.598498,-0.753227,0.272744,0.496536,-0.867702,0.022034,0.496536,-0.867702,0.022034,0.598498,-0.753227,0.272744,\n\t\t\t         0.766259,-0.642354,0.013642,0.636738,-0.742546,-0.207739,0.231422,-0.952055,0.199927,0.436933,-0.899167,-0.023225,\n\t\t\t         0.463759,-0.878140,0.117344,0.253487,-0.898587,0.358074,0.253487,-0.898587,0.358074,0.463759,-0.878140,0.117344,\n\t\t\t         0.465377,-0.848292,0.252541,0.247505,-0.832179,0.496139,0.436933,-0.899167,-0.023225,0.551317,-0.796625,-0.247810,\n\t\t\t         0.588092,-0.798395,-0.129063,0.463759,-0.878140,0.117344,0.463759,-0.878140,0.117344,0.588092,-0.798395,-0.129063,\n\t\t\t         0.617420,-0.786584,-0.006226,0.465377,-0.848292,0.252541,0.514908,-0.593493,-0.618549,0.612262,-0.593616,-0.522172,\n\t\t\t         0.635701,-0.685598,-0.354686,0.574908,-0.678793,-0.456832,0.574908,-0.678793,-0.456832,0.635701,-0.685598,-0.354686,\n\t\t\t         0.588092,-0.798395,-0.129063,0.551317,-0.796625,-0.247810,0.612262,-0.593616,-0.522172,0.730491,-0.540300,-0.417615,\n\t\t\t         0.702750,-0.667989,-0.244758,0.635701,-0.685598,-0.354686,0.635701,-0.685598,-0.354686,0.702750,-0.667989,-0.244758,\n\t\t\t         0.617420,-0.786584,-0.006226,0.588092,-0.798395,-0.129063,0.514908,-0.593493,-0.618549,0.574908,-0.678793,-0.456832,\n\t\t\t         0.680715,-0.600146,-0.419965,0.647816,-0.484695,-0.587664,0.647816,-0.484695,-0.587664,0.680715,-0.600146,-0.419965,\n\t\t\t         0.839320,-0.490188,-0.235023,0.842463,-0.337504,-0.419904,0.574908,-0.678793,-0.456832,0.551317,-0.796625,-0.247810,\n\t\t\t         0.636738,-0.742546,-0.207739,0.680715,-0.600146,-0.419965,0.680715,-0.600146,-0.419965,0.636738,-0.742546,-0.207739,\n\t\t\t         0.766259,-0.642354,0.013642,0.839320,-0.490188,-0.235023,0.514908,-0.593493,-0.618549,0.647816,-0.484695,-0.587664,\n\t\t\t         0.560686,-0.375195,-0.738121,0.395795,-0.526688,-0.752251,0.395795,-0.526688,-0.752251,0.560686,-0.375195,-0.738121,\n\t\t\t         0.427320,-0.218146,-0.877377,0.233650,-0.397565,-0.887295,0.647816,-0.484695,-0.587664,0.842463,-0.337504,-0.419904,\n\t\t\t         0.796442,-0.167913,-0.580920,0.560686,-0.375195,-0.738121,0.560686,-0.375195,-0.738121,0.796442,-0.167913,-0.580920,\n\t\t\t         0.678213,0.049318,-0.733177,0.427320,-0.218146,-0.877377,0.514908,-0.593493,-0.618549,0.395795,-0.526688,-0.752251,\n\t\t\t         0.536271,-0.515336,-0.668416,0.612262,-0.593616,-0.522172,0.612262,-0.593616,-0.522172,0.536271,-0.515336,-0.668416,\n\t\t\t         0.728843,-0.395184,-0.559099,0.730491,-0.540300,-0.417615,0.395795,-0.526688,-0.752251,0.233650,-0.397565,-0.887295,\n\t\t\t         0.384838,-0.329936,-0.861965,0.536271,-0.515336,-0.668416,0.536271,-0.515336,-0.668416,0.384838,-0.329936,-0.861965,\n\t\t\t         0.633076,-0.118778,-0.764885,0.728843,-0.395184,-0.559099,-0.099429,0.108127,-0.989135,-0.091647,0.221992,-0.970702,\n\t\t\t         0.147557,-0.039521,-0.988250,0.057985,-0.165899,-0.984405,0.057985,-0.165899,-0.984405,0.147557,-0.039521,-0.988250,\n\t\t\t         0.384838,-0.329936,-0.861965,0.233650,-0.397565,-0.887295,-0.091647,0.221992,-0.970702,0.068789,0.451888,-0.889401,\n\t\t\t         0.373852,0.220862,-0.900784,0.147557,-0.039521,-0.988250,0.147557,-0.039521,-0.988250,0.373852,0.220862,-0.900784,\n\t\t\t         0.633076,-0.118778,-0.764885,0.384838,-0.329936,-0.861965,-0.099429,0.108127,-0.989135,0.057985,-0.165899,-0.984405,\n\t\t\t         0.265023,0.012665,-0.964141,0.087802,0.264840,-0.960265,0.087802,0.264840,-0.960265,0.265023,0.012665,-0.964141,\n\t\t\t         0.488662,0.285440,-0.824427,0.267434,0.491165,-0.828974,0.057985,-0.165899,-0.984405,0.233650,-0.397565,-0.887295,\n\t\t\t         0.427320,-0.218146,-0.877377,0.265023,0.012665,-0.964141,0.265023,0.012665,-0.964141,0.427320,-0.218146,-0.877377,\n\t\t\t         0.678213,0.049318,-0.733177,0.488662,0.285440,-0.824427,-0.099429,0.108127,-0.989135,0.087802,0.264840,-0.960265,\n\t\t\t         -0.110508,0.463271,-0.879269,-0.245735,0.338115,-0.908444,-0.245735,0.338115,-0.908444,-0.110508,0.463271,-0.879269,\n\t\t\t         -0.341288,0.588000,-0.733299,-0.424421,0.480697,-0.767296,0.087802,0.264840,-0.960265,0.267434,0.491165,-0.828974,\n\t\t\t         0.026582,0.648152,-0.761010,-0.110508,0.463271,-0.879269,-0.110508,0.463271,-0.879269,0.026582,0.648152,-0.761010,\n\t\t\t         -0.230934,0.748466,-0.621601,-0.341288,0.588000,-0.733299,-0.099429,0.108127,-0.989135,-0.245735,0.338115,-0.908444,\n\t\t\t         -0.273049,0.406384,-0.871914,-0.091647,0.221992,-0.970702,-0.091647,0.221992,-0.970702,-0.273049,0.406384,-0.871914,\n\t\t\t         -0.180731,0.565416,-0.804743,0.068789,0.451888,-0.889401,-0.245735,0.338115,-0.908444,-0.424421,0.480697,-0.767296,\n\t\t\t         -0.435316,0.502274,-0.747124,-0.273049,0.406384,-0.871914,-0.273049,0.406384,-0.871914,-0.435316,0.502274,-0.747124,\n\t\t\t         -0.378491,0.605182,-0.700308,-0.180731,0.565416,-0.804743,-0.654408,0.734031,-0.181371,-0.632221,0.749046,-0.197913,\n\t\t\t         -0.435804,0.803705,-0.405072,-0.452284,0.795343,-0.403516,-0.452284,0.795343,-0.403516,-0.435804,0.803705,-0.405072,\n\t\t\t         -0.206153,0.782495,-0.587512,-0.209540,0.775323,-0.595752,-0.632221,0.749046,-0.197913,-0.639302,0.731773,-0.236122,\n\t\t\t         -0.454207,0.775262,-0.438887,-0.435804,0.803705,-0.405072,-0.435804,0.803705,-0.405072,-0.454207,0.775262,-0.438887,\n\t\t\t         -0.230934,0.748466,-0.621601,-0.206153,0.782495,-0.587512,-0.654408,0.734031,-0.181371,-0.452284,0.795343,-0.403516,\n\t\t\t         -0.474929,0.773919,-0.418836,-0.681234,0.708701,-0.183355,-0.681234,0.708701,-0.183355,-0.474929,0.773919,-0.418836,\n\t\t\t         -0.505722,0.733451,-0.454176,-0.718101,0.663472,-0.209998,-0.452284,0.795343,-0.403516,-0.209540,0.775323,-0.595752,\n\t\t\t         -0.217658,0.752892,-0.621052,-0.474929,0.773919,-0.418836,-0.474929,0.773919,-0.418836,-0.217658,0.752892,-0.621052,\n\t\t\t         -0.234138,0.709983,-0.664113,-0.505722,0.733451,-0.454176,-0.654408,0.734031,-0.181371,-0.681234,0.708701,-0.183355,\n\t\t\t         -0.827296,0.554369,0.090609,-0.807489,0.582965,0.089724,-0.807489,0.582965,0.089724,-0.827296,0.554369,0.090609,\n\t\t\t         -0.870937,0.309732,0.381451,-0.858516,0.339091,0.384625,-0.681234,0.708701,-0.183355,-0.718101,0.663472,-0.209998,\n\t\t\t         -0.861538,0.503281,0.066408,-0.827296,0.554369,0.090609,-0.827296,0.554369,0.090609,-0.861538,0.503281,0.066408,\n\t\t\t         -0.899289,0.257759,0.353252,-0.870937,0.309732,0.381451,-0.654408,0.734031,-0.181371,-0.807489,0.582965,0.089724,\n\t\t\t         -0.795007,0.602405,0.070925,-0.632221,0.749046,-0.197913,-0.632221,0.749046,-0.197913,-0.795007,0.602405,0.070925,\n\t\t\t         -0.805567,0.591754,0.029603,-0.639302,0.731773,-0.236122,-0.807489,0.582965,0.089724,-0.858516,0.339091,0.384625,\n\t\t\t         -0.857234,0.360118,0.367992,-0.795007,0.602405,0.070925,-0.795007,0.602405,0.070925,-0.857234,0.360118,0.367992,\n\t\t\t         -0.881130,0.351543,0.316172,-0.805567,0.591754,0.029603,-0.687521,-0.108188,0.718009,-0.695151,-0.107761,0.710685,\n\t\t\t         -0.804773,0.104556,0.584277,-0.796228,0.086276,0.598804,-0.796228,0.086276,0.598804,-0.804773,0.104556,0.584277,\n\t\t\t         -0.857234,0.360118,0.367992,-0.858516,0.339091,0.384625,-0.695151,-0.107761,0.710685,-0.736747,-0.137059,0.662069,\n\t\t\t         -0.843501,0.094668,0.528672,-0.804773,0.104556,0.584277,-0.804773,0.104556,0.584277,-0.843501,0.094668,0.528672,\n\t\t\t         -0.881130,0.351543,0.316172,-0.857234,0.360118,0.367992,-0.687521,-0.108188,0.718009,-0.796228,0.086276,0.598804,\n\t\t\t         -0.802850,0.060945,0.593005,-0.694662,-0.121097,0.709037,-0.694662,-0.121097,0.709037,-0.802850,0.060945,0.593005,\n\t\t\t         -0.827693,0.013550,0.560961,-0.720420,-0.162358,0.674215,-0.796228,0.086276,0.598804,-0.858516,0.339091,0.384625,\n\t\t\t         -0.870937,0.309732,0.381451,-0.802850,0.060945,0.593005,-0.802850,0.060945,0.593005,-0.870937,0.309732,0.381451,\n\t\t\t         -0.899289,0.257759,0.353252,-0.827693,0.013550,0.560961,-0.687521,-0.108188,0.718009,-0.694662,-0.121097,0.709037,\n\t\t\t         -0.558824,-0.273049,0.783013,-0.545061,-0.272195,0.792962,-0.545061,-0.272195,0.792962,-0.558824,-0.273049,0.783013,\n\t\t\t         -0.357311,-0.434217,0.826868,-0.334452,-0.442152,0.832240,-0.694662,-0.121097,0.709037,-0.720420,-0.162358,0.674215,\n\t\t\t         -0.588946,-0.309519,0.746513,-0.558824,-0.273049,0.783013,-0.558824,-0.273049,0.783013,-0.588946,-0.309519,0.746513,\n\t\t\t         -0.393658,-0.468673,0.790765,-0.357311,-0.434217,0.826868,-0.687521,-0.108188,0.718009,-0.545061,-0.272195,0.792962,\n\t\t\t         -0.543016,-0.291330,0.787530,-0.695151,-0.107761,0.710685,-0.695151,-0.107761,0.710685,-0.543016,-0.291330,0.787530,\n\t\t\t         -0.583941,-0.350291,0.732292,-0.736747,-0.137059,0.662069,-0.545061,-0.272195,0.792962,-0.334452,-0.442152,0.832240,\n\t\t\t         -0.316904,-0.477554,0.819422,-0.543016,-0.291330,0.787530,-0.543016,-0.291330,0.787530,-0.316904,-0.477554,0.819422,\n\t\t\t         -0.345195,-0.571612,0.744346,-0.583941,-0.350291,0.732292,0.289834,-0.700339,0.652303,0.332987,-0.721122,0.607501,\n\t\t\t         0.002350,-0.643422,0.765496,-0.037629,-0.603534,0.796442,-0.037629,-0.603534,0.796442,0.002350,-0.643422,0.765496,\n\t\t\t         -0.316904,-0.477554,0.819422,-0.334452,-0.442152,0.832240,0.332987,-0.721122,0.607501,0.345592,-0.798914,0.492203,\n\t\t\t         0.005127,-0.747917,0.663717,0.002350,-0.643422,0.765496,0.002350,-0.643422,0.765496,0.005127,-0.747917,0.663717,\n\t\t\t         -0.345195,-0.571612,0.744346,-0.316904,-0.477554,0.819422,0.289834,-0.700339,0.652303,-0.037629,-0.603534,0.796442,\n\t\t\t         -0.070437,-0.594440,0.801019,0.259377,-0.704276,0.660787,0.259377,-0.704276,0.660787,-0.070437,-0.594440,0.801019,\n\t\t\t         -0.109836,-0.632435,0.766747,0.225654,-0.749443,0.622395,-0.037629,-0.603534,0.796442,-0.334452,-0.442152,0.832240,\n\t\t\t         -0.357311,-0.434217,0.826868,-0.070437,-0.594440,0.801019,-0.070437,-0.594440,0.801019,-0.357311,-0.434217,0.826868,\n\t\t\t         -0.393658,-0.468673,0.790765,-0.109836,-0.632435,0.766747,0.289834,-0.700339,0.652303,0.259377,-0.704276,0.660787,\n\t\t\t         0.559221,-0.723869,0.404004,0.575427,-0.709647,0.406476,0.575427,-0.709647,0.406476,0.559221,-0.723869,0.404004,\n\t\t\t         0.757836,-0.645833,0.092471,0.766656,-0.633900,0.101779,0.259377,-0.704276,0.660787,0.225654,-0.749443,0.622395,\n\t\t\t         0.531816,-0.768578,0.355541,0.559221,-0.723869,0.404004,0.559221,-0.723869,0.404004,0.531816,-0.768578,0.355541,\n\t\t\t         0.728416,-0.683737,0.043306,0.757836,-0.645833,0.092471,0.289834,-0.700339,0.652303,0.575427,-0.709647,0.406476,\n\t\t\t         0.598041,-0.710288,0.371166,0.332987,-0.721122,0.607501,0.332987,-0.721122,0.607501,0.598041,-0.710288,0.371166,\n\t\t\t         0.598498,-0.753227,0.272744,0.345592,-0.798914,0.492203,0.575427,-0.709647,0.406476,0.766656,-0.633900,0.101779,\n\t\t\t         0.773919,-0.628315,0.078951,0.598041,-0.710288,0.371166,0.598041,-0.710288,0.371166,0.773919,-0.628315,0.078951,\n\t\t\t         0.766259,-0.642354,0.013642,0.598498,-0.753227,0.272744,0.855739,-0.363048,-0.368633,0.852504,-0.347789,-0.390149,\n\t\t\t         0.847560,-0.494247,-0.193243,0.846309,-0.504624,-0.170598,0.846309,-0.504624,-0.170598,0.847560,-0.494247,-0.193243,\n\t\t\t         0.773919,-0.628315,0.078951,0.766656,-0.633900,0.101779,0.852504,-0.347789,-0.390149,0.842463,-0.337504,-0.419904,\n\t\t\t         0.839320,-0.490188,-0.235023,0.847560,-0.494247,-0.193243,0.847560,-0.494247,-0.193243,0.839320,-0.490188,-0.235023,\n\t\t\t         0.766259,-0.642354,0.013642,0.773919,-0.628315,0.078951,0.855739,-0.363048,-0.368633,0.846309,-0.504624,-0.170598,\n\t\t\t         0.838649,-0.516373,-0.173162,0.849757,-0.378887,-0.366497,0.849757,-0.378887,-0.366497,0.838649,-0.516373,-0.173162,\n\t\t\t         0.806055,-0.552538,-0.211982,0.817408,-0.418287,-0.396039,0.846309,-0.504624,-0.170598,0.766656,-0.633900,0.101779,\n\t\t\t         0.757836,-0.645833,0.092471,0.838649,-0.516373,-0.173162,0.838649,-0.516373,-0.173162,0.757836,-0.645833,0.092471,\n\t\t\t         0.728416,-0.683737,0.043306,0.806055,-0.552538,-0.211982,0.855739,-0.363048,-0.368633,0.849757,-0.378887,-0.366497,\n\t\t\t         0.817011,-0.215461,-0.534837,0.820368,-0.193091,-0.538224,0.820368,-0.193091,-0.538224,0.817011,-0.215461,-0.534837,\n\t\t\t         0.716117,0.008240,-0.697897,0.715293,0.038972,-0.697714,0.849757,-0.378887,-0.366497,0.817408,-0.418287,-0.396039,\n\t\t\t         0.787835,-0.260872,-0.557878,0.817011,-0.215461,-0.534837,0.817011,-0.215461,-0.534837,0.787835,-0.260872,-0.557878,\n\t\t\t         0.694113,-0.046113,-0.718345,0.716117,0.008240,-0.697897,0.855739,-0.363048,-0.368633,0.820368,-0.193091,-0.538224,\n\t\t\t         0.812525,-0.173772,-0.556383,0.852504,-0.347789,-0.390149,0.852504,-0.347789,-0.390149,0.812525,-0.173772,-0.556383,\n\t\t\t         0.796442,-0.167913,-0.580920,0.842463,-0.337504,-0.419904,0.820368,-0.193091,-0.538224,0.715293,0.038972,-0.697714,\n\t\t\t         0.702811,0.059877,-0.708823,0.812525,-0.173772,-0.556383,0.812525,-0.173772,-0.556383,0.702811,0.059877,-0.708823,\n\t\t\t         0.678213,0.049318,-0.733177,0.796442,-0.167913,-0.580920,0.303629,0.508774,-0.805567,0.294320,0.522874,-0.799951,\n\t\t\t         0.517014,0.312021,-0.797052,0.529496,0.293832,-0.795770,0.529496,0.293832,-0.795770,0.517014,0.312021,-0.797052,\n\t\t\t         0.702811,0.059877,-0.708823,0.715293,0.038972,-0.697714,0.294320,0.522874,-0.799951,0.267434,0.491165,-0.828974,\n\t\t\t         0.488662,0.285440,-0.824427,0.517014,0.312021,-0.797052,0.517014,0.312021,-0.797052,0.488662,0.285440,-0.824427,\n\t\t\t         0.678213,0.049318,-0.733177,0.702811,0.059877,-0.708823,0.303629,0.508774,-0.805567,0.529496,0.293832,-0.795770,\n\t\t\t         0.534410,0.259011,-0.804529,0.310526,0.475539,-0.823023,0.310526,0.475539,-0.823023,0.534410,0.259011,-0.804529,\n\t\t\t         0.523026,0.197943,-0.828974,0.307016,0.415784,-0.856044,0.529496,0.293832,-0.795770,0.715293,0.038972,-0.697714,\n\t\t\t         0.716117,0.008240,-0.697897,0.534410,0.259011,-0.804529,0.534410,0.259011,-0.804529,0.716117,0.008240,-0.697897,\n\t\t\t         0.694113,-0.046113,-0.718345,0.523026,0.197943,-0.828974,0.303629,0.508774,-0.805567,0.310526,0.475539,-0.823023,\n\t\t\t         0.058260,0.645070,-0.761895,0.054598,0.673025,-0.737571,0.054598,0.673025,-0.737571,0.058260,0.645070,-0.761895,\n\t\t\t         -0.217658,0.752892,-0.621052,-0.209540,0.775323,-0.595752,0.310526,0.475539,-0.823023,0.307016,0.415784,-0.856044,\n\t\t\t         0.053865,0.593219,-0.803186,0.058260,0.645070,-0.761895,0.058260,0.645070,-0.761895,0.053865,0.593219,-0.803186,\n\t\t\t         -0.234138,0.709983,-0.664113,-0.217658,0.752892,-0.621052,0.303629,0.508774,-0.805567,0.054598,0.673025,-0.737571,\n\t\t\t         0.049989,0.682821,-0.728843,0.294320,0.522874,-0.799951,0.294320,0.522874,-0.799951,0.049989,0.682821,-0.728843,\n\t\t\t         0.026582,0.648152,-0.761010,0.267434,0.491165,-0.828974,0.054598,0.673025,-0.737571,-0.209540,0.775323,-0.595752,\n\t\t\t         -0.206153,0.782495,-0.587512,0.049989,0.682821,-0.728843,0.049989,0.682821,-0.728843,-0.206153,0.782495,-0.587512,\n\t\t\t         -0.230934,0.748466,-0.621601,0.026582,0.648152,-0.761010,-0.846980,-0.012635,-0.531449,-0.786370,0.547288,-0.286477,\n\t\t\t         -0.567400,0.625446,-0.535539,-0.672445,0.063875,-0.737358,-0.672445,0.063875,-0.737358,-0.567400,0.625446,-0.535539,\n\t\t\t         -0.280679,0.599841,-0.749260,-0.419263,0.043031,-0.906827,-0.786370,0.547288,-0.286477,-0.718101,0.663472,-0.209998,\n\t\t\t         -0.505722,0.733451,-0.454176,-0.567400,0.625446,-0.535539,-0.567400,0.625446,-0.535539,-0.505722,0.733451,-0.454176,\n\t\t\t         -0.234138,0.709983,-0.664113,-0.280679,0.599841,-0.749260,-0.846980,-0.012635,-0.531449,-0.672445,0.063875,-0.737358,\n\t\t\t         -0.521165,-0.536180,-0.663961,-0.577837,-0.582751,-0.571368,-0.577837,-0.582751,-0.571368,-0.521165,-0.536180,-0.663961,\n\t\t\t         -0.486943,-0.598345,-0.636293,-0.530117,-0.641174,-0.554862,-0.672445,0.063875,-0.737358,-0.419263,0.043031,-0.906827,\n\t\t\t         -0.398907,-0.541887,-0.739708,-0.521165,-0.536180,-0.663961,-0.521165,-0.536180,-0.663961,-0.398907,-0.541887,-0.739708,\n\t\t\t         -0.377146,-0.598414,-0.706868,-0.486943,-0.598345,-0.636293,-0.846980,-0.012635,-0.531449,-0.577837,-0.582751,-0.571368,\n\t\t\t         -0.571429,-0.650472,-0.500290,-0.934599,-0.159154,-0.318033,-0.934599,-0.159154,-0.318033,-0.571429,-0.650472,-0.500290,\n\t\t\t         -0.523331,-0.708243,-0.473769,-0.929044,-0.348186,-0.124821,-0.577837,-0.582751,-0.571368,-0.530117,-0.641174,-0.554862,\n\t\t\t         -0.513145,-0.697474,-0.500213,-0.571429,-0.650472,-0.500290,-0.571429,-0.650472,-0.500290,-0.513145,-0.697474,-0.500213,\n\t\t\t         -0.459033,-0.737445,-0.495444,-0.523331,-0.708243,-0.473769,-0.846980,-0.012635,-0.531449,-0.934599,-0.159154,-0.318033,\n\t\t\t         -0.925871,0.377636,-0.011414,-0.786370,0.547288,-0.286477,-0.786370,0.547288,-0.286477,-0.925871,0.377636,-0.011414,\n\t\t\t         -0.861538,0.503281,0.066408,-0.718101,0.663472,-0.209998,-0.934599,-0.159154,-0.318033,-0.929044,-0.348186,-0.124821,\n\t\t\t         -0.954680,0.132267,0.266579,-0.925871,0.377636,-0.011414,-0.925871,0.377636,-0.011414,-0.954680,0.132267,0.266579,\n\t\t\t         -0.899289,0.257759,0.353252,-0.861538,0.503281,0.066408,-0.759209,-0.650746,0.010498,-0.774285,-0.276955,0.568987,\n\t\t\t         -0.879238,-0.105197,0.464583,-0.848384,-0.528916,-0.020875,-0.848384,-0.528916,-0.020875,-0.879238,-0.105197,0.464583,\n\t\t\t         -0.954680,0.132267,0.266579,-0.929044,-0.348186,-0.124821,-0.774285,-0.276955,0.568987,-0.720420,-0.162358,0.674215,\n\t\t\t         -0.827693,0.013550,0.560961,-0.879238,-0.105197,0.464583,-0.879238,-0.105197,0.464583,-0.827693,0.013550,0.560961,\n\t\t\t         -0.899289,0.257759,0.353252,-0.954680,0.132267,0.266579,-0.759209,-0.650746,0.010498,-0.848384,-0.528916,-0.020875,\n\t\t\t         -0.458022,-0.738060,-0.495376,-0.398572,-0.738670,-0.543565,-0.398572,-0.738670,-0.543565,-0.458022,-0.738060,-0.495376,\n\t\t\t         -0.395773,-0.747289,-0.533781,-0.341712,-0.732787,-0.588435,-0.848384,-0.528916,-0.020875,-0.929044,-0.348186,-0.124821,\n\t\t\t         -0.523331,-0.708243,-0.473769,-0.458022,-0.738060,-0.495376,-0.458022,-0.738060,-0.495376,-0.523331,-0.708243,-0.473769,\n\t\t\t         -0.459033,-0.737445,-0.495444,-0.395773,-0.747289,-0.533781,-0.759209,-0.650746,0.010498,-0.398572,-0.738670,-0.543565,\n\t\t\t         -0.354350,-0.719443,-0.597308,-0.667104,-0.744743,0.017487,-0.667104,-0.744743,0.017487,-0.354350,-0.719443,-0.597308,\n\t\t\t         -0.334727,-0.688253,-0.643605,-0.546861,-0.836970,0.019379,-0.398572,-0.738670,-0.543565,-0.341712,-0.732787,-0.588435,\n\t\t\t         -0.304172,-0.702010,-0.643942,-0.354350,-0.719443,-0.597308,-0.354350,-0.719443,-0.597308,-0.304172,-0.702010,-0.643942,\n\t\t\t         -0.293285,-0.659758,-0.691884,-0.334727,-0.688253,-0.643605,-0.759209,-0.650746,0.010498,-0.667104,-0.744743,0.017487,\n\t\t\t         -0.648946,-0.422132,0.632923,-0.774285,-0.276955,0.568987,-0.774285,-0.276955,0.568987,-0.648946,-0.422132,0.632923,\n\t\t\t         -0.588946,-0.309519,0.746513,-0.720420,-0.162358,0.674215,-0.667104,-0.744743,0.017487,-0.546861,-0.836970,0.019379,\n\t\t\t         -0.463301,-0.580828,0.669301,-0.648946,-0.422132,0.632923,-0.648946,-0.422132,0.632923,-0.463301,-0.580828,0.669301,\n\t\t\t         -0.393658,-0.468673,0.790765,-0.588946,-0.309519,0.746513,-0.172399,-0.979278,-0.106021,0.141911,-0.860561,0.489120,\n\t\t\t         -0.188391,-0.745842,0.638905,-0.375408,-0.926756,-0.010956,-0.375408,-0.926756,-0.010956,-0.188391,-0.745842,0.638905,\n\t\t\t         -0.463301,-0.580828,0.669301,-0.546861,-0.836970,0.019379,0.141911,-0.860561,0.489120,0.225654,-0.749443,0.622395,\n\t\t\t         -0.109836,-0.632435,0.766747,-0.188391,-0.745842,0.638905,-0.188391,-0.745842,0.638905,-0.109836,-0.632435,0.766747,\n\t\t\t         -0.393658,-0.468673,0.790765,-0.463301,-0.580828,0.669301,-0.172399,-0.979278,-0.106021,-0.375408,-0.926756,-0.010956,\n\t\t\t         -0.347240,-0.653035,-0.672994,-0.387890,-0.626423,-0.676077,-0.387890,-0.626423,-0.676077,-0.347240,-0.653035,-0.672994,\n\t\t\t         -0.323113,-0.614515,-0.719701,-0.390259,-0.584550,-0.711337,-0.375408,-0.926756,-0.010956,-0.546861,-0.836970,0.019379,\n\t\t\t         -0.334727,-0.688253,-0.643605,-0.347240,-0.653035,-0.672994,-0.347240,-0.653035,-0.672994,-0.334727,-0.688253,-0.643605,\n\t\t\t         -0.293285,-0.659758,-0.691884,-0.323113,-0.614515,-0.719701,-0.172399,-0.979278,-0.106021,-0.387890,-0.626423,-0.676077,\n\t\t\t         -0.434126,-0.620716,-0.652852,0.004944,-0.963561,-0.267434,0.004944,-0.963561,-0.267434,-0.434126,-0.620716,-0.652852,\n\t\t\t         -0.459304,-0.637745,-0.618275,0.107517,-0.892697,-0.437605,-0.387890,-0.626423,-0.676077,-0.390259,-0.584550,-0.711337,\n\t\t\t         -0.459471,-0.586108,-0.667356,-0.434126,-0.620716,-0.652852,-0.434126,-0.620716,-0.652852,-0.459471,-0.586108,-0.667356,\n\t\t\t         -0.492916,-0.615381,-0.615094,-0.459304,-0.637745,-0.618275,-0.172399,-0.979278,-0.106021,0.004944,-0.963561,-0.267434,\n\t\t\t         0.440931,-0.869137,0.223945,0.141911,-0.860561,0.489120,0.141911,-0.860561,0.489120,0.440931,-0.869137,0.223945,\n\t\t\t         0.531816,-0.768578,0.355541,0.225654,-0.749443,0.622395,0.004944,-0.963561,-0.267434,0.107517,-0.892697,-0.437605,\n\t\t\t         0.628407,-0.774529,-0.072085,0.440931,-0.869137,0.223945,0.440931,-0.869137,0.223945,0.628407,-0.774529,-0.072085,\n\t\t\t         0.728416,-0.683737,0.043306,0.531816,-0.768578,0.355541,0.174780,-0.745842,-0.642720,0.718223,-0.512680,-0.470382,\n\t\t\t         0.703085,-0.642262,-0.305155,0.147221,-0.814325,-0.561388,0.147221,-0.814325,-0.561388,0.703085,-0.642262,-0.305155,\n\t\t\t         0.628407,-0.774529,-0.072085,0.107517,-0.892697,-0.437605,0.718223,-0.512680,-0.470382,0.817408,-0.418287,-0.396039,\n\t\t\t         0.806055,-0.552538,-0.211982,0.703085,-0.642262,-0.305155,0.703085,-0.642262,-0.305155,0.806055,-0.552538,-0.211982,\n\t\t\t         0.728416,-0.683737,0.043306,0.628407,-0.774529,-0.072085,0.174780,-0.745842,-0.642720,0.147221,-0.814325,-0.561388,\n\t\t\t         -0.452010,-0.668905,-0.590075,-0.414991,-0.704856,-0.575243,-0.414991,-0.704856,-0.575243,-0.452010,-0.668905,-0.590075,\n\t\t\t         -0.484457,-0.656304,-0.578418,-0.445638,-0.698734,-0.559623,0.147221,-0.814325,-0.561388,0.107517,-0.892697,-0.437605,\n\t\t\t         -0.459304,-0.637745,-0.618275,-0.452010,-0.668905,-0.590075,-0.452010,-0.668905,-0.590075,-0.459304,-0.637745,-0.618275,\n\t\t\t         -0.492916,-0.615381,-0.615094,-0.484457,-0.656304,-0.578418,0.174780,-0.745842,-0.642720,-0.414991,-0.704856,-0.575243,\n\t\t\t         -0.355052,-0.736625,-0.575549,0.198950,-0.664479,-0.720298,0.198950,-0.664479,-0.720298,-0.355052,-0.736625,-0.575549,\n\t\t\t         -0.282266,-0.752251,-0.595325,0.199042,-0.542558,-0.816065,-0.414991,-0.704856,-0.575243,-0.445638,-0.698734,-0.559623,\n\t\t\t         -0.383394,-0.737146,-0.556440,-0.355052,-0.736625,-0.575549,-0.355052,-0.736625,-0.575549,-0.383394,-0.737146,-0.556440,\n\t\t\t         -0.304028,-0.761778,-0.572067,-0.282266,-0.752251,-0.595325,0.174780,-0.745842,-0.642720,0.198950,-0.664479,-0.720298,\n\t\t\t         0.697470,-0.363659,-0.617450,0.718223,-0.512680,-0.470382,0.718223,-0.512680,-0.470382,0.697470,-0.363659,-0.617450,\n\t\t\t         0.787835,-0.260872,-0.557878,0.817408,-0.418287,-0.396039,0.198950,-0.664479,-0.720298,0.199042,-0.542558,-0.816065,\n\t\t\t         0.618824,-0.162084,-0.768578,0.697470,-0.363659,-0.617450,0.697470,-0.363659,-0.617450,0.618824,-0.162084,-0.768578,\n\t\t\t         0.694113,-0.046113,-0.718345,0.787835,-0.260872,-0.557878,0.021943,-0.233924,-0.971984,0.268502,0.286660,-0.919614,\n\t\t\t         0.468123,0.069887,-0.880856,0.136143,-0.394971,-0.908505,0.136143,-0.394971,-0.908505,0.468123,0.069887,-0.880856,\n\t\t\t         0.618824,-0.162084,-0.768578,0.199042,-0.542558,-0.816065,0.268502,0.286660,-0.919614,0.307016,0.415784,-0.856044,\n\t\t\t         0.523026,0.197943,-0.828974,0.468123,0.069887,-0.880856,0.468123,0.069887,-0.880856,0.523026,0.197943,-0.828974,\n\t\t\t         0.694113,-0.046113,-0.718345,0.618824,-0.162084,-0.768578,0.021943,-0.233924,-0.971984,0.136143,-0.394971,-0.908505,\n\t\t\t         -0.225806,-0.733329,-0.641255,-0.216712,-0.675954,-0.704337,-0.216712,-0.675954,-0.704337,-0.225806,-0.733329,-0.641255,\n\t\t\t         -0.237053,-0.752814,-0.614066,-0.219149,-0.706098,-0.673349,0.136143,-0.394971,-0.908505,0.199042,-0.542558,-0.816065,\n\t\t\t         -0.282266,-0.752251,-0.595325,-0.225806,-0.733329,-0.641255,-0.225806,-0.733329,-0.641255,-0.282266,-0.752251,-0.595325,\n\t\t\t         -0.304028,-0.761778,-0.572067,-0.237053,-0.752814,-0.614066,0.021943,-0.233924,-0.971984,-0.216712,-0.675954,-0.704337,\n\t\t\t         -0.273965,-0.600299,-0.751366,-0.160710,-0.074740,-0.984161,-0.160710,-0.074740,-0.984161,-0.273965,-0.600299,-0.751366,\n\t\t\t         -0.398907,-0.541887,-0.739708,-0.419263,0.043031,-0.906827,-0.216712,-0.675954,-0.704337,-0.219149,-0.706098,-0.673349,\n\t\t\t         -0.265651,-0.643801,-0.717600,-0.273965,-0.600299,-0.751366,-0.273965,-0.600299,-0.751366,-0.265651,-0.643801,-0.717600,\n\t\t\t         -0.377146,-0.598414,-0.706868,-0.398907,-0.541887,-0.739708,0.021943,-0.233924,-0.971984,-0.160710,-0.074740,-0.984161,\n\t\t\t         0.019196,0.472732,-0.880978,0.268502,0.286660,-0.919614,0.268502,0.286660,-0.919614,0.019196,0.472732,-0.880978,\n\t\t\t         0.053865,0.593219,-0.803186,0.307016,0.415784,-0.856044,-0.160710,-0.074740,-0.984161,-0.419263,0.043031,-0.906827,\n\t\t\t         -0.280679,0.599841,-0.749260,0.019196,0.472732,-0.880978,0.019196,0.472732,-0.880978,-0.280679,0.599841,-0.749260,\n\t\t\t         -0.234138,0.709983,-0.664113,0.053865,0.593219,-0.803186,-0.118656,0.936613,0.329569,-0.111972,0.993378,0.024689,\n\t\t\t         -0.168187,0.984527,0.048616,-0.189459,0.919828,0.343455,-0.189459,0.919828,0.343455,-0.168187,0.984527,0.048616,\n\t\t\t         -0.246132,0.968169,0.045289,-0.258583,0.898251,0.355327,-0.111972,0.993378,0.024689,-0.110965,0.993774,0.008271,\n\t\t\t         -0.121220,0.992004,0.034913,-0.168187,0.984527,0.048616,-0.168187,0.984527,0.048616,-0.121220,0.992004,0.034913,\n\t\t\t         -0.259499,0.956389,0.133976,-0.246132,0.968169,0.045289,-0.118656,0.936613,0.329569,-0.189459,0.919828,0.343455,\n\t\t\t         -0.194281,0.905820,0.376385,-0.121128,0.917570,0.378643,-0.121128,0.917570,0.378643,-0.194281,0.905820,0.376385,\n\t\t\t         -0.165105,0.986145,-0.015473,-0.072665,0.997314,0.008240,-0.189459,0.919828,0.343455,-0.258583,0.898251,0.355327,\n\t\t\t         -0.252876,0.887478,0.385205,-0.194281,0.905820,0.376385,-0.194281,0.905820,0.376385,-0.252876,0.887478,0.385205,\n\t\t\t         -0.244911,0.969512,-0.006134,-0.165105,0.986145,-0.015473,-0.118656,0.936613,0.329569,-0.121128,0.917570,0.378643,\n\t\t\t         -0.061830,0.918760,0.389874,-0.065706,0.944426,0.322031,-0.065706,0.944426,0.322031,-0.061830,0.918760,0.389874,\n\t\t\t         -0.044404,0.917295,0.395703,-0.037141,0.950499,0.308481,-0.121128,0.917570,0.378643,-0.072665,0.997314,0.008240,\n\t\t\t         -0.023194,0.998657,0.046083,-0.061830,0.918760,0.389874,-0.061830,0.918760,0.389874,-0.023194,0.998657,0.046083,\n\t\t\t         -0.044313,0.996704,0.067904,-0.044404,0.917295,0.395703,-0.118656,0.936613,0.329569,-0.065706,0.944426,0.322031,\n\t\t\t         -0.066500,0.997772,0.004639,-0.111972,0.993378,0.024689,-0.111972,0.993378,0.024689,-0.066500,0.997772,0.004639,\n\t\t\t         -0.039399,0.998993,0.020051,-0.110965,0.993774,0.008271,-0.065706,0.944426,0.322031,-0.037141,0.950499,0.308481,\n\t\t\t         -0.054689,0.998413,0.012940,-0.066500,0.997772,0.004639,-0.066500,0.997772,0.004639,-0.054689,0.998413,0.012940,\n\t\t\t         -0.025819,0.990692,0.133610,-0.039399,0.998993,0.020051,-0.476180,0.824915,0.304453,-0.336924,0.878079,0.339763,\n\t\t\t         -0.341075,0.939970,-0.007813,-0.447279,0.894162,0.018983,-0.447279,0.894162,0.018983,-0.341075,0.939970,-0.007813,\n\t\t\t         -0.392071,0.918699,0.047243,-0.438581,0.897671,0.042207,-0.336924,0.878079,0.339763,-0.258583,0.898251,0.355327,\n\t\t\t         -0.246132,0.968169,0.045289,-0.341075,0.939970,-0.007813,-0.341075,0.939970,-0.007813,-0.246132,0.968169,0.045289,\n\t\t\t         -0.259499,0.956389,0.133976,-0.392071,0.918699,0.047243,-0.476180,0.824915,0.304453,-0.447279,0.894162,0.018983,\n\t\t\t         -0.602893,0.790094,0.110569,-0.640675,0.725608,0.250984,-0.640675,0.725608,0.250984,-0.602893,0.790094,0.110569,\n\t\t\t         -0.789361,0.599780,0.130741,-0.781671,0.588275,0.207038,-0.447279,0.894162,0.018983,-0.438581,0.897671,0.042207,\n\t\t\t         -0.566240,0.790643,0.232826,-0.602893,0.790094,0.110569,-0.602893,0.790094,0.110569,-0.566240,0.790643,0.232826,\n\t\t\t         -0.726341,0.623646,0.288827,-0.789361,0.599780,0.130741,-0.476180,0.824915,0.304453,-0.640675,0.725608,0.250984,\n\t\t\t         -0.611408,0.702780,0.363628,-0.456893,0.799310,0.390240,-0.456893,0.799310,0.390240,-0.611408,0.702780,0.363628,\n\t\t\t         -0.650960,0.736076,0.185430,-0.494095,0.863704,0.099124,-0.640675,0.725608,0.250984,-0.781671,0.588275,0.207038,\n\t\t\t         -0.750328,0.570879,0.333232,-0.611408,0.702780,0.363628,-0.611408,0.702780,0.363628,-0.750328,0.570879,0.333232,\n\t\t\t         -0.776666,0.571154,0.265572,-0.650960,0.736076,0.185430,-0.476180,0.824915,0.304453,-0.456893,0.799310,0.390240,\n\t\t\t         -0.326640,0.859462,0.393200,-0.336924,0.878079,0.339763,-0.336924,0.878079,0.339763,-0.326640,0.859462,0.393200,\n\t\t\t         -0.252876,0.887478,0.385205,-0.258583,0.898251,0.355327,-0.456893,0.799310,0.390240,-0.494095,0.863704,0.099124,\n\t\t\t         -0.344188,0.938322,0.032075,-0.326640,0.859462,0.393200,-0.326640,0.859462,0.393200,-0.344188,0.938322,0.032075,\n\t\t\t         -0.244911,0.969512,-0.006134,-0.252876,0.887478,0.385205,-0.949278,0.250496,0.189917,-0.881832,0.433515,0.185461,\n\t\t\t         -0.880520,0.460311,0.112918,-0.950804,0.271187,0.149724,-0.950804,0.271187,0.149724,-0.880520,0.460311,0.112918,\n\t\t\t         -0.864406,0.458663,0.205908,-0.936796,0.249672,0.244972,-0.881832,0.433515,0.185461,-0.781671,0.588275,0.207038,\n\t\t\t         -0.789361,0.599780,0.130741,-0.880520,0.460311,0.112918,-0.880520,0.460311,0.112918,-0.789361,0.599780,0.130741,\n\t\t\t         -0.726341,0.623646,0.288827,-0.864406,0.458663,0.205908,-0.949278,0.250496,0.189917,-0.950804,0.271187,0.149724,\n\t\t\t         -0.980926,0.061342,0.184332,-0.978545,0.066195,0.195013,-0.978545,0.066195,0.195013,-0.980926,0.061342,0.184332,\n\t\t\t         -0.971343,-0.110599,0.210273,-0.983978,-0.089999,0.153813,-0.950804,0.271187,0.149724,-0.936796,0.249672,0.244972,\n\t\t\t         -0.974487,0.067690,0.213935,-0.980926,0.061342,0.184332,-0.980926,0.061342,0.184332,-0.974487,0.067690,0.213935,\n\t\t\t         -0.957060,-0.079714,0.278634,-0.971343,-0.110599,0.210273,-0.949278,0.250496,0.189917,-0.978545,0.066195,0.195013,\n\t\t\t         -0.945097,0.050905,0.322703,-0.919919,0.221015,0.323801,-0.919919,0.221015,0.323801,-0.945097,0.050905,0.322703,\n\t\t\t         -0.926359,0.029023,0.375500,-0.913999,0.201270,0.352214,-0.978545,0.066195,0.195013,-0.983978,-0.089999,0.153813,\n\t\t\t         -0.955168,-0.063295,0.289193,-0.945097,0.050905,0.322703,-0.945097,0.050905,0.322703,-0.955168,-0.063295,0.289193,\n\t\t\t         -0.916715,-0.067263,0.393811,-0.926359,0.029023,0.375500,-0.949278,0.250496,0.189917,-0.919919,0.221015,0.323801,\n\t\t\t         -0.856258,0.405835,0.319468,-0.881832,0.433515,0.185461,-0.881832,0.433515,0.185461,-0.856258,0.405835,0.319468,\n\t\t\t         -0.750328,0.570879,0.333232,-0.781671,0.588275,0.207038,-0.919919,0.221015,0.323801,-0.913999,0.201270,0.352214,\n\t\t\t         -0.864101,0.389325,0.318888,-0.856258,0.405835,0.319468,-0.856258,0.405835,0.319468,-0.864101,0.389325,0.318888,\n\t\t\t         -0.776666,0.571154,0.265572,-0.750328,0.570879,0.333232,-0.835109,-0.549944,-0.011963,-0.950743,-0.304727,0.056581,\n\t\t\t         -0.908475,-0.377728,0.178808,-0.812708,-0.567186,0.133152,-0.812708,-0.567186,0.133152,-0.908475,-0.377728,0.178808,\n\t\t\t         -0.876278,-0.384411,0.290414,-0.780480,-0.577074,0.240364,-0.950743,-0.304727,0.056581,-0.983978,-0.089999,0.153813,\n\t\t\t         -0.971343,-0.110599,0.210273,-0.908475,-0.377728,0.178808,-0.908475,-0.377728,0.178808,-0.971343,-0.110599,0.210273,\n\t\t\t         -0.957060,-0.079714,0.278634,-0.876278,-0.384411,0.290414,-0.835109,-0.549944,-0.011963,-0.812708,-0.567186,0.133152,\n\t\t\t         -0.673666,-0.733146,0.092837,-0.683676,-0.729759,0.002991,-0.683676,-0.729759,0.002991,-0.673666,-0.733146,0.092837,\n\t\t\t         -0.553392,-0.828547,0.085116,-0.528764,-0.845820,0.070498,-0.812708,-0.567186,0.133152,-0.780480,-0.577074,0.240364,\n\t\t\t         -0.648640,-0.738823,0.182714,-0.673666,-0.733146,0.092837,-0.673666,-0.733146,0.092837,-0.648640,-0.738823,0.182714,\n\t\t\t         -0.556383,-0.825434,0.095096,-0.553392,-0.828547,0.085116,-0.835109,-0.549944,-0.011963,-0.683676,-0.729759,0.002991,\n\t\t\t         -0.683279,-0.730064,0.008118,-0.844295,-0.529160,0.084292,-0.844295,-0.529160,0.084292,-0.683279,-0.730064,0.008118,\n\t\t\t         -0.723350,-0.681448,0.111301,-0.844172,-0.466964,0.263222,-0.683676,-0.729759,0.002991,-0.528764,-0.845820,0.070498,\n\t\t\t         -0.503861,-0.863735,-0.005463,-0.683279,-0.730064,0.008118,-0.683279,-0.730064,0.008118,-0.503861,-0.863735,-0.005463,\n\t\t\t         -0.537767,-0.842494,-0.031312,-0.723350,-0.681448,0.111301,-0.835109,-0.549944,-0.011963,-0.844295,-0.529160,0.084292,\n\t\t\t         -0.946257,-0.253395,0.200903,-0.950743,-0.304727,0.056581,-0.950743,-0.304727,0.056581,-0.946257,-0.253395,0.200903,\n\t\t\t         -0.955168,-0.063295,0.289193,-0.983978,-0.089999,0.153813,-0.844295,-0.529160,0.084292,-0.844172,-0.466964,0.263222,\n\t\t\t         -0.908811,-0.196722,0.367870,-0.946257,-0.253395,0.200903,-0.946257,-0.253395,0.200903,-0.908811,-0.196722,0.367870,\n\t\t\t         -0.916715,-0.067263,0.393811,-0.955168,-0.063295,0.289193,-0.290078,-0.951567,0.101627,-0.362072,-0.925993,0.106906,\n\t\t\t         -0.395367,-0.915250,0.077273,-0.269051,-0.962432,0.035798,-0.269051,-0.962432,0.035798,-0.395367,-0.915250,0.077273,\n\t\t\t         -0.418928,-0.907926,0.012085,-0.188940,-0.973662,-0.127506,-0.362072,-0.925993,0.106906,-0.528764,-0.845820,0.070498,\n\t\t\t         -0.553392,-0.828547,0.085116,-0.395367,-0.915250,0.077273,-0.395367,-0.915250,0.077273,-0.553392,-0.828547,0.085116,\n\t\t\t         -0.556383,-0.825434,0.095096,-0.418928,-0.907926,0.012085,-0.290078,-0.951567,0.101627,-0.269051,-0.962432,0.035798,\n\t\t\t         -0.116276,-0.990875,-0.067965,-0.067598,-0.995239,0.070101,-0.067598,-0.995239,0.070101,-0.116276,-0.990875,-0.067965,\n\t\t\t         0.056307,-0.977203,-0.204596,0.048372,-0.998688,-0.016205,-0.269051,-0.962432,0.035798,-0.188940,-0.973662,-0.127506,\n\t\t\t         -0.047609,-0.973052,-0.225501,-0.116276,-0.990875,-0.067965,-0.116276,-0.990875,-0.067965,-0.047609,-0.973052,-0.225501,\n\t\t\t         0.033082,-0.980285,-0.194647,0.056307,-0.977203,-0.204596,-0.290078,-0.951567,0.101627,-0.067598,-0.995239,0.070101,\n\t\t\t         -0.116520,-0.988464,0.096438,-0.277535,-0.960479,0.019807,-0.277535,-0.960479,0.019807,-0.116520,-0.988464,0.096438,\n\t\t\t         -0.042543,-0.996704,0.068880,-0.224982,-0.972259,-0.063784,-0.067598,-0.995239,0.070101,0.048372,-0.998688,-0.016205,\n\t\t\t         0.008911,-0.994049,0.108280,-0.116520,-0.988464,0.096438,-0.116520,-0.988464,0.096438,0.008911,-0.994049,0.108280,\n\t\t\t         0.013001,-0.988617,0.149724,-0.042543,-0.996704,0.068880,-0.290078,-0.951567,0.101627,-0.277535,-0.960479,0.019807,\n\t\t\t         -0.357921,-0.933714,-0.002625,-0.362072,-0.925993,0.106906,-0.362072,-0.925993,0.106906,-0.357921,-0.933714,-0.002625,\n\t\t\t         -0.503861,-0.863735,-0.005463,-0.528764,-0.845820,0.070498,-0.277535,-0.960479,0.019807,-0.224982,-0.972259,-0.063784,\n\t\t\t         -0.355968,-0.928922,-0.101657,-0.357921,-0.933714,-0.002625,-0.357921,-0.933714,-0.002625,-0.355968,-0.928922,-0.101657,\n\t\t\t         -0.537767,-0.842494,-0.031312,-0.503861,-0.863735,-0.005463,0.291726,-0.249184,-0.923460,0.818232,-0.394848,-0.417768,\n\t\t\t         0.743309,-0.538499,-0.396832,0.266854,-0.319437,-0.909238,0.266854,-0.319437,-0.909238,0.743309,-0.538499,-0.396832,\n\t\t\t         0.602222,-0.728996,-0.325388,0.246590,-0.438795,-0.864071,0.818232,-0.394848,-0.417768,0.906888,-0.416456,-0.063631,\n\t\t\t         0.828303,-0.560198,-0.009033,0.743309,-0.538499,-0.396832,0.743309,-0.538499,-0.396832,0.828303,-0.560198,-0.009033,\n\t\t\t         0.673147,-0.738639,0.035554,0.602222,-0.728996,-0.325388,0.291726,-0.249184,-0.923460,0.266854,-0.319437,-0.909238,\n\t\t\t         -0.741142,0.324137,-0.587878,-0.789117,0.213752,-0.575793,-0.789117,0.213752,-0.575793,-0.741142,0.324137,-0.587878,\n\t\t\t         -0.804102,0.528916,0.271310,-0.896420,0.366192,0.249580,0.266854,-0.319437,-0.909238,0.246590,-0.438795,-0.864071,\n\t\t\t         -0.594409,0.440626,-0.672658,-0.741142,0.324137,-0.587878,-0.741142,0.324137,-0.587878,-0.594409,0.440626,-0.672658,\n\t\t\t         -0.651143,0.735923,0.185369,-0.804102,0.528916,0.271310,0.291726,-0.249184,-0.923460,-0.789117,0.213752,-0.575793,\n\t\t\t         -0.757866,0.097812,-0.645009,0.388256,-0.193365,-0.900998,0.388256,-0.193365,-0.900998,-0.757866,0.097812,-0.645009,\n\t\t\t         -0.691336,-0.000916,-0.722495,0.511673,-0.080630,-0.855373,-0.789117,0.213752,-0.575793,-0.896420,0.366192,0.249580,\n\t\t\t         -0.966826,0.215278,0.137364,-0.757866,0.097812,-0.645009,-0.757866,0.097812,-0.645009,-0.966826,0.215278,0.137364,\n\t\t\t         -0.998566,0.053346,-0.004303,-0.691336,-0.000916,-0.722495,0.291726,-0.249184,-0.923460,0.388256,-0.193365,-0.900998,\n\t\t\t         0.884884,-0.251747,-0.391888,0.818232,-0.394848,-0.417768,0.818232,-0.394848,-0.417768,0.884884,-0.251747,-0.391888,\n\t\t\t         0.964385,-0.244636,-0.100253,0.906888,-0.416456,-0.063631,0.388256,-0.193365,-0.900998,0.511673,-0.080630,-0.855373,\n\t\t\t         0.947630,-0.047395,-0.315775,0.884884,-0.251747,-0.391888,0.884884,-0.251747,-0.391888,0.947630,-0.047395,-0.315775,\n\t\t\t         0.995300,0.013215,-0.095828,0.964385,-0.244636,-0.100253,0.505600,0.184729,-0.842738,0.938139,0.309885,-0.154393,\n\t\t\t         0.963408,0.174413,-0.203467,0.568896,0.079867,-0.818506,0.568896,0.079867,-0.818506,0.963408,0.174413,-0.203467,\n\t\t\t         0.947630,-0.047395,-0.315775,0.511673,-0.080630,-0.855373,0.938139,0.309885,-0.154393,0.959685,0.272164,-0.070009,\n\t\t\t         0.972869,0.221809,-0.065310,0.963408,0.174413,-0.203467,0.963408,0.174413,-0.203467,0.972869,0.221809,-0.065310,\n\t\t\t         0.995300,0.013215,-0.095828,0.947630,-0.047395,-0.315775,0.505600,0.184729,-0.842738,0.568896,0.079867,-0.818506,\n\t\t\t         -0.670827,-0.090182,-0.736076,-0.699881,-0.218848,-0.679861,-0.699881,-0.218848,-0.679861,-0.670827,-0.090182,-0.736076,\n\t\t\t         -0.985717,-0.124790,-0.113041,-0.939543,-0.305185,-0.155156,0.568896,0.079867,-0.818506,0.511673,-0.080630,-0.855373,\n\t\t\t         -0.691336,-0.000916,-0.722495,-0.670827,-0.090182,-0.736076,-0.670827,-0.090182,-0.736076,-0.691336,-0.000916,-0.722495,\n\t\t\t         -0.998566,0.053346,-0.004303,-0.985717,-0.124790,-0.113041,0.505600,0.184729,-0.842738,-0.699881,-0.218848,-0.679861,\n\t\t\t         -0.685324,-0.405042,-0.605152,0.374981,0.225379,-0.899197,0.374981,0.225379,-0.899197,-0.685324,-0.405042,-0.605152,\n\t\t\t         -0.561571,-0.599231,-0.570513,0.229347,0.263985,-0.936827,-0.699881,-0.218848,-0.679861,-0.939543,-0.305185,-0.155156,\n\t\t\t         -0.847407,-0.515488,-0.126896,-0.685324,-0.405042,-0.605152,-0.685324,-0.405042,-0.605152,-0.847407,-0.515488,-0.126896,\n\t\t\t         -0.675527,-0.734825,-0.060305,-0.561571,-0.599231,-0.570513,0.505600,0.184729,-0.842738,0.374981,0.225379,-0.899197,\n\t\t\t         0.860897,0.447127,-0.242592,0.938139,0.309885,-0.154393,0.938139,0.309885,-0.154393,0.860897,0.447127,-0.242592,\n\t\t\t         0.920042,0.376415,-0.108585,0.959685,0.272164,-0.070009,0.374981,0.225379,-0.899197,0.229347,0.263985,-0.936827,\n\t\t\t         0.674459,0.645497,-0.358348,0.860897,0.447127,-0.242592,0.860897,0.447127,-0.242592,0.674459,0.645497,-0.358348,\n\t\t\t         0.756249,0.639637,-0.137364,0.920042,0.376415,-0.108585,-0.479476,-0.424665,-0.767907,-0.883602,-0.455275,-0.109226,\n\t\t\t         -0.964080,-0.260353,-0.051912,-0.693075,-0.315348,-0.648183,-0.693075,-0.315348,-0.648183,-0.964080,-0.260353,-0.051912,\n\t\t\t         -0.995239,-0.097201,-0.002716,-0.840419,-0.133030,-0.525285,-0.883602,-0.455275,-0.109226,-0.920408,-0.381024,0.087283,\n\t\t\t         -0.976653,-0.187933,0.104007,-0.964080,-0.260353,-0.051912,-0.964080,-0.260353,-0.051912,-0.976653,-0.187933,0.104007,\n\t\t\t         -0.990814,-0.079501,0.109348,-0.995239,-0.097201,-0.002716,-0.479476,-0.424665,-0.767907,-0.693075,-0.315348,-0.648183,\n\t\t\t         0.535264,0.020112,-0.844417,0.653676,0.160161,-0.739586,0.653676,0.160161,-0.739586,0.535264,0.020112,-0.844417,\n\t\t\t         0.947386,0.260262,-0.186316,0.891842,0.422407,-0.161718,-0.693075,-0.315348,-0.648183,-0.840419,-0.133030,-0.525285,\n\t\t\t         0.363414,-0.057009,-0.929868,0.535264,0.020112,-0.844417,0.535264,0.020112,-0.844417,0.363414,-0.057009,-0.929868,\n\t\t\t         0.973876,0.084628,-0.210608,0.947386,0.260262,-0.186316,-0.479476,-0.424665,-0.767907,0.653676,0.160161,-0.739586,\n\t\t\t         0.598346,0.266213,-0.755699,-0.387005,-0.537461,-0.749199,-0.387005,-0.537461,-0.749199,0.598346,0.266213,-0.755699,\n\t\t\t         0.428999,0.369823,-0.824091,-0.289193,-0.655690,-0.697409,0.653676,0.160161,-0.739586,0.891842,0.422407,-0.161718,\n\t\t\t         0.787133,0.600299,-0.141423,0.598346,0.266213,-0.755699,0.598346,0.266213,-0.755699,0.787133,0.600299,-0.141423,\n\t\t\t         0.566820,0.811884,-0.139683,0.428999,0.369823,-0.824091,-0.479476,-0.424665,-0.767907,-0.387005,-0.537461,-0.749199,\n\t\t\t         -0.742302,-0.656667,-0.133152,-0.883602,-0.455275,-0.109226,-0.883602,-0.455275,-0.109226,-0.742302,-0.656667,-0.133152,\n\t\t\t         -0.788629,-0.609882,0.077731,-0.920408,-0.381024,0.087283,-0.387005,-0.537461,-0.749199,-0.289193,-0.655690,-0.697409,\n\t\t\t         -0.518937,-0.845363,-0.126713,-0.742302,-0.656667,-0.133152,-0.742302,-0.656667,-0.133152,-0.518937,-0.845363,-0.126713,\n\t\t\t         -0.550493,-0.830439,0.085330,-0.788629,-0.609882,0.077731,0.044557,-0.643880,-0.763787,0.091556,-0.985198,-0.144749,\n\t\t\t         -0.216407,-0.969024,-0.118717,-0.114231,-0.693625,-0.711173,-0.114231,-0.693625,-0.711173,-0.216407,-0.969024,-0.118717,\n\t\t\t         -0.518937,-0.845363,-0.126713,-0.289193,-0.655690,-0.697409,0.091556,-0.985198,-0.144749,0.078646,-0.995331,0.055910,\n\t\t\t         -0.244148,-0.965972,0.085269,-0.216407,-0.969024,-0.118717,-0.216407,-0.969024,-0.118717,-0.244148,-0.965972,0.085269,\n\t\t\t         -0.550493,-0.830439,0.085330,-0.518937,-0.845363,-0.126713,0.044557,-0.643880,-0.763787,-0.114231,-0.693625,-0.711173,\n\t\t\t         0.185430,0.524216,-0.831141,-0.096561,0.612323,-0.784661,-0.096561,0.612323,-0.784661,0.185430,0.524216,-0.831141,\n\t\t\t         0.229835,0.962004,-0.147313,-0.101535,0.989044,-0.106998,-0.114231,-0.693625,-0.711173,-0.289193,-0.655690,-0.697409,\n\t\t\t         0.428999,0.369823,-0.824091,0.185430,0.524216,-0.831141,0.185430,0.524216,-0.831141,0.428999,0.369823,-0.824091,\n\t\t\t         0.566820,0.811884,-0.139683,0.229835,0.962004,-0.147313,0.044557,-0.643880,-0.763787,-0.096561,0.612323,-0.784661,\n\t\t\t         -0.368389,0.562517,-0.740135,0.160253,-0.558611,-0.813776,0.160253,-0.558611,-0.813776,-0.368389,0.562517,-0.740135,\n\t\t\t         -0.594409,0.440626,-0.672658,0.246590,-0.438795,-0.864071,-0.096561,0.612323,-0.784661,-0.101535,0.989044,-0.106998,\n\t\t\t         -0.397259,0.917356,0.024110,-0.368389,0.562517,-0.740135,-0.368389,0.562517,-0.740135,-0.397259,0.917356,0.024110,\n\t\t\t         -0.651143,0.735923,0.185369,-0.594409,0.440626,-0.672658,0.044557,-0.643880,-0.763787,0.160253,-0.558611,-0.813776,\n\t\t\t         0.369884,-0.901730,-0.223640,0.091556,-0.985198,-0.144749,0.091556,-0.985198,-0.144749,0.369884,-0.901730,-0.223640,\n\t\t\t         0.422193,-0.905179,0.048799,0.078646,-0.995331,0.055910,0.160253,-0.558611,-0.813776,0.246590,-0.438795,-0.864071,\n\t\t\t         0.602222,-0.728996,-0.325388,0.369884,-0.901730,-0.223640,0.369884,-0.901730,-0.223640,0.602222,-0.728996,-0.325388,\n\t\t\t         0.673147,-0.738639,0.035554,0.422193,-0.905179,0.048799,-0.353801,0.377209,-0.855861,-0.663411,0.680166,-0.311777,\n\t\t\t         -0.416517,0.834346,-0.361003,-0.208258,0.439894,-0.873531,-0.208258,0.439894,-0.873531,-0.416517,0.834346,-0.361003,\n\t\t\t         -0.142705,0.907620,-0.394726,-0.060244,0.449141,-0.891415,-0.663411,0.680166,-0.311777,-0.707694,0.703940,-0.059847,\n\t\t\t         -0.450758,0.888333,-0.087436,-0.416517,0.834346,-0.361003,-0.416517,0.834346,-0.361003,-0.450758,0.888333,-0.087436,\n\t\t\t         -0.160375,0.980865,-0.110202,-0.142705,0.907620,-0.394726,-0.353801,0.377209,-0.855861,-0.208258,0.439894,-0.873531,\n\t\t\t         0.331553,-0.609729,-0.719901,0.483596,-0.466720,-0.740440,0.483596,-0.466720,-0.740440,0.331553,-0.609729,-0.719901,\n\t\t\t         0.471999,-0.878445,0.074252,0.722129,-0.691702,-0.005554,-0.208258,0.439894,-0.873531,-0.060244,0.449141,-0.891415,\n\t\t\t         0.121281,-0.711600,-0.692007,0.331553,-0.609729,-0.719901,0.331553,-0.609729,-0.719901,0.121281,-0.711600,-0.692007,\n\t\t\t         0.152593,-0.981719,0.113529,0.471999,-0.878445,0.074252,-0.353801,0.377209,-0.855861,0.483596,-0.466720,-0.740440,\n\t\t\t         0.566912,-0.328471,-0.755425,-0.462691,0.298105,-0.834864,-0.462691,0.298105,-0.834864,0.566912,-0.328471,-0.755425,\n\t\t\t         0.603992,-0.218574,-0.766411,-0.534165,0.236122,-0.811701,0.483596,-0.466720,-0.740440,0.722129,-0.691702,-0.005554,\n\t\t\t         0.861721,-0.498703,-0.093295,0.566912,-0.328471,-0.755425,0.566912,-0.328471,-0.755425,0.861721,-0.498703,-0.093295,\n\t\t\t         0.920499,-0.354076,-0.165166,0.603992,-0.218574,-0.766411,-0.353801,0.377209,-0.855861,-0.462691,0.298105,-0.834864,\n\t\t\t         -0.829981,0.499619,-0.247902,-0.663411,0.680166,-0.311777,-0.663411,0.680166,-0.311777,-0.829981,0.499619,-0.247902,\n\t\t\t         -0.869778,0.492477,-0.030152,-0.707694,0.703940,-0.059847,-0.462691,0.298105,-0.834864,-0.534165,0.236122,-0.811701,\n\t\t\t         -0.918729,0.351207,-0.180486,-0.829981,0.499619,-0.247902,-0.829981,0.499619,-0.247902,-0.918729,0.351207,-0.180486,\n\t\t\t         -0.940977,0.338298,-0.010163,-0.869778,0.492477,-0.030152,0.096286,0.347209,-0.932798,0.265725,0.863582,-0.428449,\n\t\t\t         0.448378,0.790643,-0.416883,0.139897,0.297555,-0.944365,0.139897,0.297555,-0.944365,0.448378,0.790643,-0.416883,\n\t\t\t         0.674459,0.645497,-0.358348,0.229347,0.263985,-0.936827,0.265725,0.863582,-0.428449,0.298715,0.944670,-0.135411,\n\t\t\t         0.509934,0.848476,-0.141453,0.448378,0.790643,-0.416883,0.448378,0.790643,-0.416883,0.509934,0.848476,-0.141453,\n\t\t\t         0.756249,0.639637,-0.137364,0.674459,0.645497,-0.358348,0.096286,0.347209,-0.932798,0.139897,0.297555,-0.944365,\n\t\t\t         -0.389538,-0.711844,-0.584399,-0.232978,-0.750450,-0.618458,-0.232978,-0.750450,-0.618458,-0.389538,-0.711844,-0.584399,\n\t\t\t         -0.476852,-0.878933,0.008667,-0.302561,-0.950896,0.064730,0.139897,0.297555,-0.944365,0.229347,0.263985,-0.936827,\n\t\t\t         -0.561571,-0.599231,-0.570513,-0.389538,-0.711844,-0.584399,-0.389538,-0.711844,-0.584399,-0.561571,-0.599231,-0.570513,\n\t\t\t         -0.675527,-0.734825,-0.060305,-0.476852,-0.878933,0.008667,0.096286,0.347209,-0.932798,-0.232978,-0.750450,-0.618458,\n\t\t\t         -0.075320,-0.753105,-0.653523,0.042512,0.402753,-0.914304,0.042512,0.402753,-0.914304,-0.075320,-0.753105,-0.653523,\n\t\t\t         0.121281,-0.711600,-0.692007,-0.060244,0.449141,-0.891415,-0.232978,-0.750450,-0.618458,-0.302561,-0.950896,0.064730,\n\t\t\t         -0.115268,-0.987915,0.103488,-0.075320,-0.753105,-0.653523,-0.075320,-0.753105,-0.653523,-0.115268,-0.987915,0.103488,\n\t\t\t         0.152593,-0.981719,0.113529,0.121281,-0.711600,-0.692007,0.096286,0.347209,-0.932798,0.042512,0.402753,-0.914304,\n\t\t\t         0.086550,0.904416,-0.417737,0.265725,0.863582,-0.428449,0.265725,0.863582,-0.428449,0.086550,0.904416,-0.417737,\n\t\t\t         0.091250,0.987823,-0.125919,0.298715,0.944670,-0.135411,0.042512,0.402753,-0.914304,-0.060244,0.449141,-0.891415,\n\t\t\t         -0.142705,0.907620,-0.394726,0.086550,0.904416,-0.417737,0.086550,0.904416,-0.417737,-0.142705,0.907620,-0.394726,\n\t\t\t         -0.160375,0.980865,-0.110202,0.091250,0.987823,-0.125919,-0.678213,0.139744,-0.721427,-0.988830,0.139195,-0.053194,\n\t\t\t         -0.964812,0.236274,-0.115207,-0.595569,0.187323,-0.781121,-0.595569,0.187323,-0.781121,-0.964812,0.236274,-0.115207,\n\t\t\t         -0.918729,0.351207,-0.180486,-0.534165,0.236122,-0.811701,-0.988830,0.139195,-0.053194,-0.995941,0.086612,0.023652,\n\t\t\t         -0.974487,0.224311,-0.003967,-0.964812,0.236274,-0.115207,-0.964812,0.236274,-0.115207,-0.974487,0.224311,-0.003967,\n\t\t\t         -0.940977,0.338298,-0.010163,-0.918729,0.351207,-0.180486,-0.678213,0.139744,-0.721427,-0.595569,0.187323,-0.781121,\n\t\t\t         0.608356,-0.135197,-0.782037,0.566057,-0.068178,-0.821528,0.566057,-0.068178,-0.821528,0.608356,-0.135197,-0.782037,\n\t\t\t         0.944456,-0.251595,-0.211280,0.957762,-0.171026,-0.231147,-0.595569,0.187323,-0.781121,-0.534165,0.236122,-0.811701,\n\t\t\t         0.603992,-0.218574,-0.766411,0.608356,-0.135197,-0.782037,0.608356,-0.135197,-0.782037,0.603992,-0.218574,-0.766411,\n\t\t\t         0.920499,-0.354076,-0.165166,0.944456,-0.251595,-0.211280,-0.678213,0.139744,-0.721427,0.566057,-0.068178,-0.821528,\n\t\t\t         0.418134,-0.038209,-0.907559,-0.796777,0.046205,-0.602466,-0.796777,0.046205,-0.602466,0.418134,-0.038209,-0.907559,\n\t\t\t         0.363414,-0.057009,-0.929868,-0.840419,-0.133030,-0.525285,0.566057,-0.068178,-0.821528,0.957762,-0.171026,-0.231147,\n\t\t\t         0.970672,-0.072298,-0.229133,0.418134,-0.038209,-0.907559,0.418134,-0.038209,-0.907559,0.970672,-0.072298,-0.229133,\n\t\t\t         0.973876,0.084628,-0.210608,0.363414,-0.057009,-0.929868,-0.678213,0.139744,-0.721427,-0.796777,0.046205,-0.602466,\n\t\t\t         -0.999329,0.036012,-0.006623,-0.988830,0.139195,-0.053194,-0.988830,0.139195,-0.053194,-0.999329,0.036012,-0.006623,\n\t\t\t         -0.996826,-0.015351,0.077975,-0.995941,0.086612,0.023652,-0.796777,0.046205,-0.602466,-0.840419,-0.133030,-0.525285,\n\t\t\t         -0.995239,-0.097201,-0.002716,-0.999329,0.036012,-0.006623,-0.999329,0.036012,-0.006623,-0.995239,-0.097201,-0.002716,\n\t\t\t         -0.990814,-0.079501,0.109348,-0.996826,-0.015351,0.077975,-0.938322,0.333964,-0.089145,-0.913450,0.351726,0.204596,\n\t\t\t         -0.808374,0.551347,0.206153,-0.835170,0.539506,-0.106784,-0.835170,0.539506,-0.106784,-0.808374,0.551347,0.206153,\n\t\t\t         -0.615986,0.777642,0.125584,-0.623920,0.769250,-0.137638,-0.913450,0.351726,0.204596,-0.896420,0.366192,0.249580,\n\t\t\t         -0.804102,0.528916,0.271310,-0.808374,0.551347,0.206153,-0.808374,0.551347,0.206153,-0.804102,0.528916,0.271310,\n\t\t\t         -0.651143,0.735923,0.185369,-0.615986,0.777642,0.125584,-0.938322,0.333964,-0.089145,-0.835170,0.539506,-0.106784,\n\t\t\t         -0.814234,0.477584,-0.329966,-0.896878,0.319071,-0.306223,-0.896878,0.319071,-0.306223,-0.814234,0.477584,-0.329966,\n\t\t\t         -0.808441,0.453172,-0.375577,-0.876509,0.325705,-0.354467,-0.835170,0.539506,-0.106784,-0.623920,0.769250,-0.137638,\n\t\t\t         -0.645070,0.691000,-0.326090,-0.814234,0.477584,-0.329966,-0.814234,0.477584,-0.329966,-0.645070,0.691000,-0.326090,\n\t\t\t         -0.666292,0.650133,-0.365214,-0.808441,0.453172,-0.375577,-0.938322,0.333964,-0.089145,-0.896878,0.319071,-0.306223,\n\t\t\t         -0.951659,0.181616,-0.247658,-0.985717,0.148045,-0.080233,-0.985717,0.148045,-0.080233,-0.951659,0.181616,-0.247658,\n\t\t\t         -0.985260,0.007477,-0.170873,-0.996704,-0.030793,-0.074648,-0.896878,0.319071,-0.306223,-0.876509,0.325705,-0.354467,\n\t\t\t         -0.930517,0.217133,-0.294944,-0.951659,0.181616,-0.247658,-0.951659,0.181616,-0.247658,-0.930517,0.217133,-0.294944,\n\t\t\t         -0.976940,0.044835,-0.208754,-0.985260,0.007477,-0.170873,-0.938322,0.333964,-0.089145,-0.985717,0.148045,-0.080233,\n\t\t\t         -0.976836,0.169469,0.130528,-0.913450,0.351726,0.204596,-0.913450,0.351726,0.204596,-0.976836,0.169469,0.130528,\n\t\t\t         -0.966826,0.215278,0.137364,-0.896420,0.366192,0.249580,-0.985717,0.148045,-0.080233,-0.996704,-0.030793,-0.074648,\n\t\t\t         -0.999664,-0.003388,0.024781,-0.976836,0.169469,0.130528,-0.976836,0.169469,0.130528,-0.999664,-0.003388,0.024781,\n\t\t\t         -0.998566,0.053346,-0.004303,-0.966826,0.215278,0.137364,-0.937956,-0.332804,-0.097110,-0.941710,-0.315012,-0.118015,\n\t\t\t         -0.982452,-0.173681,-0.067782,-0.974883,-0.207251,-0.081454,-0.974883,-0.207251,-0.081454,-0.982452,-0.173681,-0.067782,\n\t\t\t         -0.999664,-0.003388,0.024781,-0.996704,-0.030793,-0.074648,-0.941710,-0.315012,-0.118015,-0.939543,-0.305185,-0.155156,\n\t\t\t         -0.985717,-0.124790,-0.113041,-0.982452,-0.173681,-0.067782,-0.982452,-0.173681,-0.067782,-0.985717,-0.124790,-0.113041,\n\t\t\t         -0.998566,0.053346,-0.004303,-0.999664,-0.003388,0.024781,-0.937956,-0.332804,-0.097110,-0.974883,-0.207251,-0.081454,\n\t\t\t         -0.975768,-0.188696,-0.110477,-0.934843,-0.343730,-0.088656,-0.934843,-0.343730,-0.088656,-0.975768,-0.188696,-0.110477,\n\t\t\t         -0.977585,-0.166873,-0.128377,-0.932370,-0.349937,-0.090724,-0.974883,-0.207251,-0.081454,-0.996704,-0.030793,-0.074648,\n\t\t\t         -0.985260,0.007477,-0.170873,-0.975768,-0.188696,-0.110477,-0.975768,-0.188696,-0.110477,-0.985260,0.007477,-0.170873,\n\t\t\t         -0.976940,0.044835,-0.208754,-0.977585,-0.166873,-0.128377,-0.937956,-0.332804,-0.097110,-0.934843,-0.343730,-0.088656,\n\t\t\t         -0.852626,-0.509995,-0.113498,-0.872524,-0.475265,-0.113071,-0.872524,-0.475265,-0.113071,-0.852626,-0.509995,-0.113498,\n\t\t\t         -0.694632,-0.699210,-0.168981,-0.729637,-0.672292,-0.124882,-0.934843,-0.343730,-0.088656,-0.932370,-0.349937,-0.090724,\n\t\t\t         -0.833155,-0.540787,-0.115765,-0.852626,-0.509995,-0.113498,-0.852626,-0.509995,-0.113498,-0.833155,-0.540787,-0.115765,\n\t\t\t         -0.662341,-0.726660,-0.182397,-0.694632,-0.699210,-0.168981,-0.937956,-0.332804,-0.097110,-0.872524,-0.475265,-0.113071,\n\t\t\t         -0.867946,-0.482650,-0.116916,-0.941710,-0.315012,-0.118015,-0.941710,-0.315012,-0.118015,-0.867946,-0.482650,-0.116916,\n\t\t\t         -0.847407,-0.515488,-0.126896,-0.939543,-0.305185,-0.155156,-0.872524,-0.475265,-0.113071,-0.729637,-0.672292,-0.124882,\n\t\t\t         -0.714927,-0.695181,-0.074740,-0.867946,-0.482650,-0.116916,-0.867946,-0.482650,-0.116916,-0.714927,-0.695181,-0.074740,\n\t\t\t         -0.675527,-0.734825,-0.060305,-0.847407,-0.515488,-0.126896,0.922147,0.343547,-0.177709,0.903378,0.391614,-0.174657,\n\t\t\t         0.951231,0.229286,-0.206214,0.958068,0.180059,-0.222816,0.958068,0.180059,-0.222816,0.951231,0.229286,-0.206214,\n\t\t\t         0.972106,0.068392,-0.224311,0.967681,0.054445,-0.246101,0.903378,0.391614,-0.174657,0.891842,0.422407,-0.161718,\n\t\t\t         0.947386,0.260262,-0.186316,0.951231,0.229286,-0.206214,0.951231,0.229286,-0.206214,0.947386,0.260262,-0.186316,\n\t\t\t         0.973876,0.084628,-0.210608,0.972106,0.068392,-0.224311,0.922147,0.343547,-0.177709,0.958068,0.180059,-0.222816,\n\t\t\t         0.966613,0.106998,-0.232795,0.945677,0.273019,-0.176366,0.945677,0.273019,-0.176366,0.966613,0.106998,-0.232795,\n\t\t\t         0.970511,0.066104,-0.231815,0.954596,0.243473,-0.171659,0.958068,0.180059,-0.222816,0.967681,0.054445,-0.246101,\n\t\t\t         0.963408,0.043062,-0.264443,0.966613,0.106998,-0.232795,0.966613,0.106998,-0.232795,0.963408,0.043062,-0.264443,\n\t\t\t         0.962351,0.036171,-0.269392,0.970511,0.066104,-0.231815,0.922147,0.343547,-0.177709,0.945677,0.273019,-0.176366,\n\t\t\t         0.849605,0.510269,-0.133244,0.823176,0.549821,-0.141514,0.823176,0.549821,-0.141514,0.849605,0.510269,-0.133244,\n\t\t\t         0.585589,0.800867,-0.125095,0.579638,0.803766,-0.133885,0.945677,0.273019,-0.176366,0.954596,0.243473,-0.171659,\n\t\t\t         0.854588,0.503169,-0.128454,0.849605,0.510269,-0.133244,0.849605,0.510269,-0.133244,0.854588,0.503169,-0.128454,\n\t\t\t         0.567272,0.814250,-0.123289,0.585589,0.800867,-0.125095,0.922147,0.343547,-0.177709,0.823176,0.549821,-0.141514,\n\t\t\t         0.801874,0.578784,-0.148259,0.903378,0.391614,-0.174657,0.903378,0.391614,-0.174657,0.801874,0.578784,-0.148259,\n\t\t\t         0.787133,0.600299,-0.141423,0.891842,0.422407,-0.161718,0.823176,0.549821,-0.141514,0.579638,0.803766,-0.133885,\n\t\t\t         0.572558,0.807215,-0.143223,0.801874,0.578784,-0.148259,0.801874,0.578784,-0.148259,0.572558,0.807215,-0.143223,\n\t\t\t         0.566820,0.811884,-0.139683,0.787133,0.600299,-0.141423,-0.054201,0.984283,-0.167974,-0.057924,0.991882,-0.113102,\n\t\t\t         0.231574,0.961760,-0.146031,0.220618,0.963988,-0.148412,0.220618,0.963988,-0.148412,0.231574,0.961760,-0.146031,\n\t\t\t         0.572558,0.807215,-0.143223,0.579638,0.803766,-0.133885,-0.057924,0.991882,-0.113102,-0.101535,0.989044,-0.106998,\n\t\t\t         0.229835,0.962004,-0.147313,0.231574,0.961760,-0.146031,0.231574,0.961760,-0.146031,0.229835,0.962004,-0.147313,\n\t\t\t         0.566820,0.811884,-0.139683,0.572558,0.807215,-0.143223,-0.054201,0.984283,-0.167974,0.220618,0.963988,-0.148412,\n\t\t\t         0.181219,0.971648,-0.151738,-0.123783,0.969573,-0.211097,-0.123783,0.969573,-0.211097,0.181219,0.971648,-0.151738,\n\t\t\t         0.147241,0.977014,-0.154156,-0.173311,0.959490,-0.222132,0.220618,0.963988,-0.148412,0.579638,0.803766,-0.133885,\n\t\t\t         0.585589,0.800867,-0.125095,0.181219,0.971648,-0.151738,0.181219,0.971648,-0.151738,0.585589,0.800867,-0.125095,\n\t\t\t         0.567272,0.814250,-0.123289,0.147241,0.977014,-0.154156,-0.054201,0.984283,-0.167974,-0.123783,0.969573,-0.211097,\n\t\t\t         -0.379711,0.880428,-0.283944,-0.316324,0.933409,-0.169195,-0.316324,0.933409,-0.169195,-0.379711,0.880428,-0.283944,\n\t\t\t         -0.645070,0.691000,-0.326090,-0.623920,0.769250,-0.137638,-0.123783,0.969573,-0.211097,-0.173311,0.959490,-0.222132,\n\t\t\t         -0.428952,0.848718,-0.309317,-0.379711,0.880428,-0.283944,-0.379711,0.880428,-0.283944,-0.428952,0.848718,-0.309317,\n\t\t\t         -0.666292,0.650133,-0.365214,-0.645070,0.691000,-0.326090,-0.054201,0.984283,-0.167974,-0.316324,0.933409,-0.169195,\n\t\t\t         -0.328104,0.944578,-0.009125,-0.057924,0.991882,-0.113102,-0.057924,0.991882,-0.113102,-0.328104,0.944578,-0.009125,\n\t\t\t         -0.397259,0.917356,0.024110,-0.101535,0.989044,-0.106998,-0.316324,0.933409,-0.169195,-0.623920,0.769250,-0.137638,\n\t\t\t         -0.615986,0.777642,0.125584,-0.328104,0.944578,-0.009125,-0.328104,0.944578,-0.009125,-0.615986,0.777642,0.125584,\n\t\t\t         -0.651143,0.735923,0.185369,-0.397259,0.917356,0.024110,0.796167,-0.589465,-0.136296,0.769066,-0.638081,0.036988,\n\t\t\t         0.513993,-0.850887,0.108463,0.546342,-0.828089,-0.125370,0.546342,-0.828089,-0.125370,0.513993,-0.850887,0.108463,\n\t\t\t         0.165197,-0.976562,0.137852,0.183874,-0.975921,-0.117191,0.769066,-0.638081,0.036988,0.722129,-0.691702,-0.005554,\n\t\t\t         0.471999,-0.878445,0.074252,0.513993,-0.850887,0.108463,0.513993,-0.850887,0.108463,0.471999,-0.878445,0.074252,\n\t\t\t         0.152593,-0.981719,0.113529,0.165197,-0.976562,0.137852,0.796167,-0.589465,-0.136296,0.546342,-0.828089,-0.125370,\n\t\t\t         0.526597,-0.781976,-0.333445,0.770806,-0.565539,-0.293191,0.770806,-0.565539,-0.293191,0.526597,-0.781976,-0.333445,\n\t\t\t         0.510615,-0.767745,-0.387092,0.754667,-0.564648,-0.334140,0.546342,-0.828089,-0.125370,0.183874,-0.975921,-0.117191,\n\t\t\t         0.189917,-0.919858,-0.343181,0.526597,-0.781976,-0.333445,0.526597,-0.781976,-0.333445,0.189917,-0.919858,-0.343181,\n\t\t\t         0.187889,-0.896791,-0.400580,0.510615,-0.767745,-0.387092,0.796167,-0.589465,-0.136296,0.770806,-0.565539,-0.293191,\n\t\t\t         0.894284,-0.372631,-0.247688,0.912748,-0.380078,-0.149510,0.912748,-0.380078,-0.149510,0.894284,-0.372631,-0.247688,\n\t\t\t         0.940733,-0.262581,-0.214484,0.950652,-0.262764,-0.164800,0.770806,-0.565539,-0.293191,0.754667,-0.564648,-0.334140,\n\t\t\t         0.882514,-0.382127,-0.274130,0.894284,-0.372631,-0.247688,0.894284,-0.372631,-0.247688,0.882514,-0.382127,-0.274130,\n\t\t\t         0.933927,-0.274688,-0.228752,0.940733,-0.262581,-0.214484,0.796167,-0.589465,-0.136296,0.912748,-0.380078,-0.149510,\n\t\t\t         0.898312,-0.436811,-0.046876,0.769066,-0.638081,0.036988,0.769066,-0.638081,0.036988,0.898312,-0.436811,-0.046876,\n\t\t\t         0.861721,-0.498703,-0.093295,0.722129,-0.691702,-0.005554,0.912748,-0.380078,-0.149510,0.950652,-0.262764,-0.164800,\n\t\t\t         0.944334,-0.306589,-0.119022,0.898312,-0.436811,-0.046876,0.898312,-0.436811,-0.046876,0.944334,-0.306589,-0.119022,\n\t\t\t         0.920499,-0.354076,-0.165166,0.861721,-0.498703,-0.093295,-0.356731,-0.926633,-0.118442,-0.340648,-0.938017,0.063814,\n\t\t\t         -0.522660,-0.852504,-0.006623,-0.544389,-0.829463,-0.124851,-0.544389,-0.829463,-0.124851,-0.522660,-0.852504,-0.006623,\n\t\t\t         -0.714927,-0.695181,-0.074740,-0.729637,-0.672292,-0.124882,-0.340648,-0.938017,0.063814,-0.302561,-0.950896,0.064730,\n\t\t\t         -0.476852,-0.878933,0.008667,-0.522660,-0.852504,-0.006623,-0.522660,-0.852504,-0.006623,-0.476852,-0.878933,0.008667,\n\t\t\t         -0.675527,-0.734825,-0.060305,-0.714927,-0.695181,-0.074740,-0.356731,-0.926633,-0.118442,-0.544389,-0.829463,-0.124851,\n\t\t\t         -0.504074,-0.833064,-0.227760,-0.315592,-0.907102,-0.278390,-0.315592,-0.907102,-0.278390,-0.504074,-0.833064,-0.227760,\n\t\t\t         -0.469574,-0.845075,-0.255634,-0.285073,-0.903547,-0.319901,-0.544389,-0.829463,-0.124851,-0.729637,-0.672292,-0.124882,\n\t\t\t         -0.694632,-0.699210,-0.168981,-0.504074,-0.833064,-0.227760,-0.504074,-0.833064,-0.227760,-0.694632,-0.699210,-0.168981,\n\t\t\t         -0.662341,-0.726660,-0.182397,-0.469574,-0.845075,-0.255634,-0.356731,-0.926633,-0.118442,-0.315592,-0.907102,-0.278390,\n\t\t\t         -0.105045,-0.941984,-0.318766,-0.137883,-0.983734,-0.114994,-0.137883,-0.983734,-0.114994,-0.105045,-0.941984,-0.318766,\n\t\t\t         0.189917,-0.919858,-0.343181,0.183874,-0.975921,-0.117191,-0.315592,-0.907102,-0.278390,-0.285073,-0.903547,-0.319901,\n\t\t\t         -0.085755,-0.924985,-0.370202,-0.105045,-0.941984,-0.318766,-0.105045,-0.941984,-0.318766,-0.085755,-0.924985,-0.370202,\n\t\t\t         0.187889,-0.896791,-0.400580,0.189917,-0.919858,-0.343181,-0.356731,-0.926633,-0.118442,-0.137883,-0.983734,-0.114994,\n\t\t\t         -0.135655,-0.983795,0.116977,-0.340648,-0.938017,0.063814,-0.340648,-0.938017,0.063814,-0.135655,-0.983795,0.116977,\n\t\t\t         -0.115268,-0.987915,0.103488,-0.302561,-0.950896,0.064730,-0.137883,-0.983734,-0.114994,0.183874,-0.975921,-0.117191,\n\t\t\t         0.165197,-0.976562,0.137852,-0.135655,-0.983795,0.116977,-0.135655,-0.983795,0.116977,0.165197,-0.976562,0.137852,\n\t\t\t         0.152593,-0.981719,0.113529,-0.115268,-0.987915,0.103488,0.971282,-0.125401,-0.202063,0.966918,-0.157292,-0.200751,\n\t\t\t         0.959655,-0.224860,-0.168676,0.964202,-0.194739,-0.179815,0.964202,-0.194739,-0.179815,0.959655,-0.224860,-0.168676,\n\t\t\t         0.944334,-0.306589,-0.119022,0.950652,-0.262764,-0.164800,0.966918,-0.157292,-0.200751,0.957762,-0.171026,-0.231147,\n\t\t\t         0.944456,-0.251595,-0.211280,0.959655,-0.224860,-0.168676,0.959655,-0.224860,-0.168676,0.944456,-0.251595,-0.211280,\n\t\t\t         0.920499,-0.354076,-0.165166,0.944334,-0.306589,-0.119022,0.971282,-0.125401,-0.202063,0.964202,-0.194739,-0.179815,\n\t\t\t         0.962493,-0.185492,-0.197943,0.974487,-0.082278,-0.208716,0.974487,-0.082278,-0.208716,0.962493,-0.185492,-0.197943,\n\t\t\t         0.961015,-0.187280,-0.203414,0.975880,-0.057505,-0.210597,0.964202,-0.194739,-0.179815,0.950652,-0.262764,-0.164800,\n\t\t\t         0.940733,-0.262581,-0.214484,0.962493,-0.185492,-0.197943,0.962493,-0.185492,-0.197943,0.940733,-0.262581,-0.214484,\n\t\t\t         0.933927,-0.274688,-0.228752,0.961015,-0.187280,-0.203414,0.971282,-0.125401,-0.202063,0.974487,-0.082278,-0.208716,\n\t\t\t         0.969298,0.006684,-0.245674,0.971465,-0.045106,-0.232734,0.971465,-0.045106,-0.232734,0.969298,0.006684,-0.245674,\n\t\t\t         0.963408,0.043062,-0.264443,0.967681,0.054445,-0.246101,0.974487,-0.082278,-0.208716,0.975880,-0.057505,-0.210597,\n\t\t\t         0.967408,0.040900,-0.249899,0.969298,0.006684,-0.245674,0.969298,0.006684,-0.245674,0.967408,0.040900,-0.249899,\n\t\t\t         0.962351,0.036171,-0.269392,0.963408,0.043062,-0.264443,0.971282,-0.125401,-0.202063,0.971465,-0.045106,-0.232734,\n\t\t\t         0.972686,-0.070315,-0.221076,0.966918,-0.157292,-0.200751,0.966918,-0.157292,-0.200751,0.972686,-0.070315,-0.221076,\n\t\t\t         0.970672,-0.072298,-0.229133,0.957762,-0.171026,-0.231147,0.971465,-0.045106,-0.232734,0.967681,0.054445,-0.246101,\n\t\t\t         0.972106,0.068392,-0.224311,0.972686,-0.070315,-0.221076,0.972686,-0.070315,-0.221076,0.972106,0.068392,-0.224311,\n\t\t\t         0.973876,0.084628,-0.210608,0.970672,-0.072298,-0.229133,0.971587,-0.219153,-0.089145,0.955657,-0.138371,-0.259835,\n\t\t\t         0.687765,-0.201422,-0.697378,0.956023,-0.233039,-0.177984,0.971587,-0.219153,-0.089145,0.956023,-0.233039,-0.177984,\n\t\t\t         0.984313,-0.175665,-0.015625,0.968902,-0.244209,0.039796,0.971587,-0.219153,-0.089145,0.968902,-0.244209,0.039796,\n\t\t\t         0.986633,-0.013794,-0.162175,0.955657,-0.138371,-0.259835,0.735557,-0.551256,-0.393719,0.805414,-0.413282,-0.424787,\n\t\t\t         0.978210,-0.180609,-0.102268,0.864406,-0.500961,-0.042634,0.735557,-0.551256,-0.393719,0.864406,-0.500961,-0.042634,\n\t\t\t         0.666738,-0.742302,0.066408,0.562304,-0.749596,-0.349071,0.735557,-0.551256,-0.393719,0.562304,-0.749596,-0.349071,\n\t\t\t         0.426862,-0.688711,-0.586016,0.472335,-0.553697,-0.685781,0.735557,-0.551256,-0.393719,0.472335,-0.553697,-0.685781,\n\t\t\t         0.478622,-0.428938,-0.766076,0.805414,-0.413282,-0.424787,0.799951,-0.271615,-0.535020,0.875790,-0.102023,-0.471725,\n\t\t\t         0.978210,-0.180609,-0.102268,0.805414,-0.413282,-0.424787,0.799951,-0.271615,-0.535020,0.805414,-0.413282,-0.424787,\n\t\t\t         0.478622,-0.428938,-0.766076,0.462691,-0.262368,-0.846797,0.799951,-0.271615,-0.535020,0.462691,-0.262368,-0.846797,\n\t\t\t         0.473037,-0.120243,-0.872768,0.875790,-0.102023,-0.471725,0.927091,0.301859,-0.222144,0.951048,0.302713,-0.062044,\n\t\t\t         0.975280,0.177007,-0.132176,0.912412,0.236732,-0.333781,0.927091,0.301859,-0.222144,0.912412,0.236732,-0.333781,\n\t\t\t         0.627918,0.278664,-0.726646,0.889523,0.372173,-0.264931,0.927091,0.301859,-0.222144,0.889523,0.372173,-0.264931,\n\t\t\t         0.883175,0.466720,0.046022,0.951048,0.302713,-0.062044,0.679098,0.130924,-0.722251,0.733726,0.054231,-0.677236,\n\t\t\t         0.986633,-0.013794,-0.162175,0.915342,0.129398,-0.381298,0.679098,0.130924,-0.722251,0.915342,0.129398,-0.381298,\n\t\t\t         0.929167,0.143040,-0.340800,0.897916,0.141057,-0.416883,0.679098,0.130924,-0.722251,0.897916,0.141057,-0.416883,\n\t\t\t         0.905240,0.141331,-0.400616,0.588946,0.156041,-0.792932,0.679098,0.130924,-0.722251,0.588946,0.156041,-0.792932,\n\t\t\t         0.374035,0.083621,-0.923612,0.733726,0.054231,-0.677236,0.888424,0.166875,-0.427595,0.566698,0.095370,-0.818354,\n\t\t\t         0.627918,0.278664,-0.726646,0.912412,0.236732,-0.333781,0.888424,0.166875,-0.427595,0.912412,0.236732,-0.333781,\n\t\t\t         0.975280,0.177007,-0.132176,0.933500,0.100833,-0.344035,0.888424,0.166875,-0.427595,0.933500,0.100833,-0.344035,\n\t\t\t         0.638844,-0.061251,-0.766869,0.566698,0.095370,-0.818354,0.719138,0.679861,-0.143529,0.562273,0.779229,-0.276772,\n\t\t\t         0.595874,0.797327,-0.095798,0.746147,0.664846,-0.034547,0.719138,0.679861,-0.143529,0.746147,0.664846,-0.034547,\n\t\t\t         0.883175,0.466720,0.046022,0.777276,0.598132,-0.195044,0.719138,0.679861,-0.143529,0.777276,0.598132,-0.195044,\n\t\t\t         0.525254,0.733421,-0.431440,0.562273,0.779229,-0.276772,0.176855,0.506668,-0.843776,-0.002991,0.489242,-0.872127,\n\t\t\t         -0.002228,0.740104,-0.672445,0.239174,0.747948,-0.619129,0.176855,0.506668,-0.843776,0.239174,0.747948,-0.619129,\n\t\t\t         0.525254,0.733421,-0.431440,0.528794,0.536027,-0.658010,0.176855,0.506668,-0.843776,0.528794,0.536027,-0.658010,\n\t\t\t         0.627918,0.278664,-0.726646,0.150822,0.197546,-0.968596,0.176855,0.506668,-0.843776,0.150822,0.197546,-0.968596,\n\t\t\t         -0.001190,0.178961,-0.983825,-0.002991,0.489242,-0.872127,0.894375,-0.044527,-0.445051,0.733726,0.054231,-0.677236,\n\t\t\t         0.374035,0.083621,-0.923612,0.491256,-0.044588,-0.869839,0.894375,-0.044527,-0.445051,0.491256,-0.044588,-0.869839,\n\t\t\t         0.687765,-0.201422,-0.697378,0.955657,-0.138371,-0.259835,0.894375,-0.044527,-0.445051,0.955657,-0.138371,-0.259835,\n\t\t\t         0.986633,-0.013794,-0.162175,0.733726,0.054231,-0.677236,0.975372,0.021943,-0.219428,0.933500,0.100833,-0.344035,\n\t\t\t         0.975280,0.177007,-0.132176,0.996277,0.023133,-0.082980,0.975372,0.021943,-0.219428,0.996277,0.023133,-0.082980,\n\t\t\t         0.984313,-0.175665,-0.015625,0.951506,-0.069033,-0.299722,0.975372,0.021943,-0.219428,0.951506,-0.069033,-0.299722,\n\t\t\t         0.638844,-0.061251,-0.766869,0.933500,0.100833,-0.344035,0.791711,0.516343,-0.326426,0.777276,0.598132,-0.195044,\n\t\t\t         0.883175,0.466720,0.046022,0.889523,0.372173,-0.264931,0.791711,0.516343,-0.326426,0.889523,0.372173,-0.264931,\n\t\t\t         0.627918,0.278664,-0.726646,0.528794,0.536027,-0.658010,0.791711,0.516343,-0.326426,0.528794,0.536027,-0.658010,\n\t\t\t         0.525254,0.733421,-0.431440,0.777276,0.598132,-0.195044,0.323588,0.846919,-0.421857,0.000671,0.874386,-0.485153,\n\t\t\t         0.002655,0.957488,-0.288369,0.370312,0.898373,-0.236122,0.323588,0.846919,-0.421857,0.370312,0.898373,-0.236122,\n\t\t\t         0.595874,0.797327,-0.095798,0.562273,0.779229,-0.276772,0.323588,0.846919,-0.421857,0.562273,0.779229,-0.276772,\n\t\t\t         0.525254,0.733421,-0.431440,0.239174,0.747948,-0.619129,0.323588,0.846919,-0.421857,0.239174,0.747948,-0.619129,\n\t\t\t         -0.002228,0.740104,-0.672445,0.000671,0.874386,-0.485153,0.909635,-0.169347,-0.379284,0.951506,-0.069033,-0.299722,\n\t\t\t         0.984313,-0.175665,-0.015625,0.956023,-0.233039,-0.177984,0.909635,-0.169347,-0.379284,0.956023,-0.233039,-0.177984,\n\t\t\t         0.687765,-0.201422,-0.697378,0.603992,-0.226478,-0.764092,0.909635,-0.169347,-0.379284,0.603992,-0.226478,-0.764092,\n\t\t\t         0.638844,-0.061251,-0.766869,0.951506,-0.069033,-0.299722,0.138981,0.012879,-0.990204,-0.000427,-0.005615,-0.999969,\n\t\t\t         -0.001190,0.178961,-0.983825,0.150822,0.197546,-0.968596,0.138981,0.012879,-0.990204,0.150822,0.197546,-0.968596,\n\t\t\t         0.627918,0.278664,-0.726646,0.566698,0.095370,-0.818354,0.138981,0.012879,-0.990204,0.566698,0.095370,-0.818354,\n\t\t\t         0.638844,-0.061251,-0.766869,0.148228,-0.123203,-0.981231,0.138981,0.012879,-0.990204,0.148228,-0.123203,-0.981231,\n\t\t\t         -0.000305,-0.126011,-0.992004,-0.000427,-0.005615,-0.999969,0.206824,-0.222205,-0.952788,0.000031,-0.200446,-0.979675,\n\t\t\t         -0.000305,-0.126011,-0.992004,0.148228,-0.123203,-0.981231,0.206824,-0.222205,-0.952788,0.148228,-0.123203,-0.981231,\n\t\t\t         0.638844,-0.061251,-0.766869,0.603992,-0.226478,-0.764092,0.206824,-0.222205,-0.952788,0.603992,-0.226478,-0.764092,\n\t\t\t         0.687765,-0.201422,-0.697378,0.211158,-0.163915,-0.963591,0.206824,-0.222205,-0.952788,0.211158,-0.163915,-0.963591,\n\t\t\t         0.003479,-0.153630,-0.988098,0.000031,-0.200446,-0.979675,0.165441,-0.052705,-0.984802,0.001831,-0.041597,-0.999115,\n\t\t\t         0.003479,-0.153630,-0.988098,0.211158,-0.163915,-0.963591,0.165441,-0.052705,-0.984802,0.211158,-0.163915,-0.963591,\n\t\t\t         0.687765,-0.201422,-0.697378,0.491256,-0.044588,-0.869839,0.165441,-0.052705,-0.984802,0.491256,-0.044588,-0.869839,\n\t\t\t         0.374035,0.083621,-0.923612,0.137944,0.058351,-0.988708,0.165441,-0.052705,-0.984802,0.137944,0.058351,-0.988708,\n\t\t\t         -0.000977,0.068484,-0.997650,0.001831,-0.041597,-0.999115,0.148015,-0.051302,-0.987640,-0.002136,-0.068575,-0.997620,\n\t\t\t         -0.004028,0.038209,-0.999237,0.140294,0.044069,-0.989105,0.148015,-0.051302,-0.987640,0.140294,0.044069,-0.989105,\n\t\t\t         0.477187,0.025452,-0.878414,0.506882,-0.019898,-0.861751,0.148015,-0.051302,-0.987640,0.506882,-0.019898,-0.861751,\n\t\t\t         0.473037,-0.120243,-0.872768,0.151585,-0.135716,-0.979064,0.148015,-0.051302,-0.987640,0.151585,-0.135716,-0.979064,\n\t\t\t         0.000610,-0.152898,-0.988220,-0.002136,-0.068575,-0.997620,0.156041,-0.245338,-0.956786,0.001801,-0.246651,-0.969085,\n\t\t\t         0.000610,-0.152898,-0.988220,0.151585,-0.135716,-0.979064,0.156041,-0.245338,-0.956786,0.151585,-0.135716,-0.979064,\n\t\t\t         0.473037,-0.120243,-0.872768,0.462691,-0.262368,-0.846797,0.156041,-0.245338,-0.956786,0.462691,-0.262368,-0.846797,\n\t\t\t         0.478622,-0.428938,-0.766076,0.167333,-0.370434,-0.913633,0.156041,-0.245338,-0.956786,0.167333,-0.370434,-0.913633,\n\t\t\t         0.001099,-0.356945,-0.934111,0.001801,-0.246651,-0.969085,0.180639,-0.519028,-0.835414,0.000183,-0.511765,-0.859096,\n\t\t\t         0.001099,-0.356945,-0.934111,0.167333,-0.370434,-0.913633,0.180639,-0.519028,-0.835414,0.167333,-0.370434,-0.913633,\n\t\t\t         0.478622,-0.428938,-0.766076,0.472335,-0.553697,-0.685781,0.180639,-0.519028,-0.835414,0.472335,-0.553697,-0.685781,\n\t\t\t         0.426862,-0.688711,-0.586016,0.215949,-0.742851,-0.633625,0.180639,-0.519028,-0.835414,0.215949,-0.742851,-0.633625,\n\t\t\t         -0.000214,-0.765862,-0.642964,0.000183,-0.511765,-0.859096,0.285867,-0.904691,-0.315897,0.000061,-0.953551,-0.301187,\n\t\t\t         -0.000214,-0.765862,-0.642964,0.215949,-0.742851,-0.633625,0.285867,-0.904691,-0.315897,0.215949,-0.742851,-0.633625,\n\t\t\t         0.426862,-0.688711,-0.586016,0.562304,-0.749596,-0.349071,0.285867,-0.904691,-0.315897,0.562304,-0.749596,-0.349071,\n\t\t\t         0.666738,-0.742302,0.066408,0.354442,-0.916776,0.183935,0.285867,-0.904691,-0.315897,0.354442,-0.916776,0.183935,\n\t\t\t         0.001526,-0.972259,0.233863,0.000061,-0.953551,-0.301187,0.133244,0.105533,-0.985443,-0.003113,0.110263,-0.993866,\n\t\t\t         -0.000977,0.068484,-0.997650,0.137944,0.058351,-0.988708,0.133244,0.105533,-0.985443,0.137944,0.058351,-0.988708,\n\t\t\t         0.374035,0.083621,-0.923612,0.308939,0.123173,-0.943052,0.133244,0.105533,-0.985443,0.308939,0.123173,-0.943052,\n\t\t\t         0.477187,0.025452,-0.878414,0.140294,0.044069,-0.989105,0.133244,0.105533,-0.985443,0.140294,0.044069,-0.989105,\n\t\t\t         -0.004028,0.038209,-0.999237,-0.003113,0.110263,-0.993866,0.905515,-0.000214,-0.424268,0.991943,0.028474,-0.123356,\n\t\t\t         0.978210,-0.180609,-0.102268,0.899686,0.006256,-0.436445,0.905515,-0.000214,-0.424268,0.899686,0.006256,-0.436445,\n\t\t\t         0.477187,0.025452,-0.878414,0.756493,0.051027,-0.651967,0.905515,-0.000214,-0.424268,0.756493,0.051027,-0.651967,\n\t\t\t         0.905240,0.141331,-0.400616,0.971923,0.085696,-0.219092,0.905515,-0.000214,-0.424268,0.971923,0.085696,-0.219092,\n\t\t\t         0.991974,0.071322,-0.104221,0.991943,0.028474,-0.123356,0.602496,0.138829,-0.785943,0.756493,0.051027,-0.651967,\n\t\t\t         0.477187,0.025452,-0.878414,0.308939,0.123173,-0.943052,0.602496,0.138829,-0.785943,0.308939,0.123173,-0.943052,\n\t\t\t         0.374035,0.083621,-0.923612,0.588946,0.156041,-0.792932,0.602496,0.138829,-0.785943,0.588946,0.156041,-0.792932,\n\t\t\t         0.905240,0.141331,-0.400616,0.756493,0.051027,-0.651967,0.854854,-0.023743,-0.518296,0.899686,0.006256,-0.436445,\n\t\t\t         0.978210,-0.180609,-0.102268,0.875790,-0.102023,-0.471725,0.854854,-0.023743,-0.518296,0.875790,-0.102023,-0.471725,\n\t\t\t         0.473037,-0.120243,-0.872768,0.506882,-0.019898,-0.861751,0.854854,-0.023743,-0.518296,0.506882,-0.019898,-0.861751,\n\t\t\t         0.477187,0.025452,-0.878414,0.899686,0.006256,-0.436445,0.368694,0.926176,-0.078982,0.470229,0.879574,0.072207,\n\t\t\t         0.595874,0.797327,-0.095798,0.370312,0.898373,-0.236122,0.368694,0.926176,-0.078982,0.370312,0.898373,-0.236122,\n\t\t\t         0.002655,0.957488,-0.288369,0.004089,0.999603,-0.027192,0.368694,0.926176,-0.078982,0.004089,0.999603,-0.027192,\n\t\t\t         0.005951,0.979522,0.201117,0.470229,0.879574,0.072207,0.730338,0.678030,0.082553,0.682485,0.721610,0.116031,\n\t\t\t         0.765435,0.514145,0.386944,0.797662,0.530534,0.286721,0.730338,0.678030,0.082553,0.797662,0.530534,0.286721,\n\t\t\t         0.883175,0.466720,0.046022,0.746147,0.664846,-0.034547,0.730338,0.678030,0.082553,0.746147,0.664846,-0.034547,\n\t\t\t         0.595874,0.797327,-0.095798,0.682485,0.721610,0.116031,0.357585,-0.864620,0.352855,0.001709,-0.932249,0.361736,\n\t\t\t         0.002869,-0.975494,0.219977,0.357707,-0.911466,0.203009,0.357585,-0.864620,0.352855,0.357707,-0.911466,0.203009,\n\t\t\t         0.690115,-0.703726,0.168767,0.682394,-0.653218,0.328013,0.357585,-0.864620,0.352855,0.682394,-0.653218,0.328013,\n\t\t\t         0.651173,-0.574114,0.496323,0.341685,-0.771416,0.536790,0.357585,-0.864620,0.352855,0.341685,-0.771416,0.536790,\n\t\t\t         0.000061,-0.829218,0.558885,0.001709,-0.932249,0.361736,0.282601,-0.596851,0.750908,0.193762,-0.363201,0.911313,\n\t\t\t         0.000458,-0.370739,0.928709,-0.000824,-0.624928,0.780633,0.282601,-0.596851,0.750908,-0.000824,-0.624928,0.780633,\n\t\t\t         0.000061,-0.829218,0.558885,0.341685,-0.771416,0.536790,0.282601,-0.596851,0.750908,0.341685,-0.771416,0.536790,\n\t\t\t         0.651173,-0.574114,0.496323,0.566881,-0.455550,0.686361,0.282601,-0.596851,0.750908,0.566881,-0.455550,0.686361,\n\t\t\t         0.425581,-0.295206,0.855373,0.193762,-0.363201,0.911313,-0.862209,-0.107883,-0.494858,-0.851558,-0.115665,-0.511277,\n\t\t\t         -0.846034,-0.157933,-0.509171,-0.844752,-0.175787,-0.505448,-0.865139,0.383038,-0.323710,-0.875973,0.362651,-0.318003,\n\t\t\t         -0.914579,0.202063,-0.350261,-0.907834,0.223090,-0.355022,0.132817,-0.208869,0.968871,0.004273,-0.217627,0.976012,\n\t\t\t         0.000458,-0.370739,0.928709,0.193762,-0.363201,0.911313,0.132817,-0.208869,0.968871,0.193762,-0.363201,0.911313,\n\t\t\t         0.425581,-0.295206,0.855373,0.293832,-0.176458,0.939390,0.132817,-0.208869,0.968871,0.293832,-0.176458,0.939390,\n\t\t\t         0.248146,-0.157048,0.955901,0.105930,-0.127934,0.986084,0.132817,-0.208869,0.968871,0.105930,-0.127934,0.986084,\n\t\t\t         0.011353,-0.134404,0.990844,0.004273,-0.217627,0.976012,0.875851,-0.383435,0.292947,0.682394,-0.653218,0.328013,\n\t\t\t         0.690115,-0.703726,0.168767,0.896146,-0.420850,0.140568,0.875851,-0.383435,0.292947,0.896146,-0.420850,0.140568,\n\t\t\t         0.977325,-0.177252,0.115665,0.951323,-0.169805,0.257118,0.875851,-0.383435,0.292947,0.951323,-0.169805,0.257118,\n\t\t\t         0.891171,-0.162389,0.423566,0.826533,-0.330119,0.455855,0.875851,-0.383435,0.292947,0.826533,-0.330119,0.455855,\n\t\t\t         0.651173,-0.574114,0.496323,0.682394,-0.653218,0.328013,0.737632,-0.261513,0.622456,0.584948,-0.188299,0.788873,\n\t\t\t         0.425581,-0.295206,0.855373,0.566881,-0.455550,0.686361,0.737632,-0.261513,0.622456,0.566881,-0.455550,0.686361,\n\t\t\t         0.651173,-0.574114,0.496323,0.826533,-0.330119,0.455855,0.737632,-0.261513,0.622456,0.826533,-0.330119,0.455855,\n\t\t\t         0.891171,-0.162389,0.423566,0.790307,-0.156224,0.592425,0.737632,-0.261513,0.622456,0.790307,-0.156224,0.592425,\n\t\t\t         0.645955,-0.187658,0.739921,0.584948,-0.188299,0.788873,0.887692,-0.456984,-0.055849,0.671072,-0.739860,-0.047243,\n\t\t\t         0.533738,-0.668264,-0.518174,0.720603,-0.432539,-0.541826,0.887692,-0.456984,-0.055849,0.720603,-0.432539,-0.541826,\n\t\t\t         0.816095,-0.211097,-0.537950,0.979858,-0.194464,-0.044801,0.887692,-0.456984,-0.055849,0.979858,-0.194464,-0.044801,\n\t\t\t         0.977325,-0.177252,0.115665,0.896146,-0.420850,0.140568,0.887692,-0.456984,-0.055849,0.896146,-0.420850,0.140568,\n\t\t\t         0.690115,-0.703726,0.168767,0.671072,-0.739860,-0.047243,-0.018189,-0.280526,0.959655,0.590197,-0.227973,0.774377,\n\t\t\t         0.608753,-0.276040,0.743736,-0.011292,-0.366863,0.930204,0.423963,-0.261727,0.867000,0.445906,-0.192846,0.874020,\n\t\t\t         0.645955,-0.187658,0.739921,0.533738,-0.239235,0.811090,0.894375,-0.293008,0.337931,0.955168,-0.078921,0.285257,\n\t\t\t         0.986633,-0.013794,-0.162175,0.968902,-0.244209,0.039796,0.894375,-0.293008,0.337931,0.968902,-0.244209,0.039796,\n\t\t\t         0.984313,-0.175665,-0.015625,0.879849,-0.204413,0.428968,0.894375,-0.293008,0.337931,0.879849,-0.204413,0.428968,\n\t\t\t         0.947142,-0.225288,0.228339,0.963958,-0.214118,0.157750,0.894375,-0.293008,0.337931,0.963958,-0.214118,0.157750,\n\t\t\t         0.987548,-0.016694,0.156255,0.955168,-0.078921,0.285257,0.976165,-0.034577,0.214240,0.921140,-0.069247,0.382946,\n\t\t\t         0.891171,-0.162389,0.423566,0.951323,-0.169805,0.257118,0.976165,-0.034577,0.214240,0.951323,-0.169805,0.257118,\n\t\t\t         0.977325,-0.177252,0.115665,0.996826,-0.016724,0.077609,0.976165,-0.034577,0.214240,0.996826,-0.016724,0.077609,\n\t\t\t         0.997681,0.057405,0.036256,0.986541,0.022645,0.161901,0.976165,-0.034577,0.214240,0.986541,0.022645,0.161901,\n\t\t\t         0.946440,-0.041444,0.320170,0.921140,-0.069247,0.382946,0.989776,0.101566,-0.099796,0.864437,0.006623,-0.502640,\n\t\t\t         0.862087,0.068270,-0.502091,0.987823,0.097751,-0.120884,0.989776,0.101566,-0.099796,0.987823,0.097751,-0.120884,\n\t\t\t         0.996796,0.063784,-0.048097,0.996429,0.083987,-0.006195,0.989776,0.101566,-0.099796,0.996429,0.083987,-0.006195,\n\t\t\t         0.997681,0.057405,0.036256,0.994446,0.066683,-0.081149,0.989776,0.101566,-0.099796,0.994446,0.066683,-0.081149,\n\t\t\t         0.866543,-0.001740,-0.499039,0.864437,0.006623,-0.502640,0.994751,0.029878,0.097690,0.969573,-0.054720,0.238502,\n\t\t\t         0.946440,-0.041444,0.320170,0.986541,0.022645,0.161901,0.994751,0.029878,0.097690,0.986541,0.022645,0.161901,\n\t\t\t         0.997681,0.057405,0.036256,0.996429,0.083987,-0.006195,0.994751,0.029878,0.097690,0.996429,0.083987,-0.006195,\n\t\t\t         0.996796,0.063784,-0.048097,0.999268,0.005737,0.037538,0.994751,0.029878,0.097690,0.999268,0.005737,0.037538,\n\t\t\t         0.984008,-0.069521,0.163945,0.969573,-0.054720,0.238502,0.983917,0.072329,-0.163274,0.866970,0.109531,-0.486160,\n\t\t\t         0.859859,0.105319,-0.499496,0.970428,0.069124,-0.231239,0.983917,0.072329,-0.163274,0.970428,0.069124,-0.231239,\n\t\t\t         0.988372,0.028413,-0.149174,0.995086,0.030335,-0.094211,0.983917,0.072329,-0.163274,0.995086,0.030335,-0.094211,\n\t\t\t         0.996796,0.063784,-0.048097,0.987823,0.097751,-0.120884,0.983917,0.072329,-0.163274,0.987823,0.097751,-0.120884,\n\t\t\t         0.862087,0.068270,-0.502091,0.866970,0.109531,-0.486160,0.999756,-0.017518,-0.011353,0.998230,-0.015656,-0.056887,\n\t\t\t         0.995941,-0.070986,0.055177,0.991241,-0.076724,0.107395,0.999756,-0.017518,-0.011353,0.991241,-0.076724,0.107395,\n\t\t\t         0.984008,-0.069521,0.163945,0.999268,0.005737,0.037538,0.999756,-0.017518,-0.011353,0.999268,0.005737,0.037538,\n\t\t\t         0.996796,0.063784,-0.048097,0.995086,0.030335,-0.094211,0.999756,-0.017518,-0.011353,0.995086,0.030335,-0.094211,\n\t\t\t         0.988372,0.028413,-0.149174,0.998230,-0.015656,-0.056887,0.953520,0.078585,-0.290841,0.850795,0.097201,-0.516373,\n\t\t\t         0.854915,0.059725,-0.515305,0.949980,0.054231,-0.307535,0.953520,0.078585,-0.290841,0.949980,0.054231,-0.307535,\n\t\t\t         0.975585,0.058351,-0.211615,0.979461,0.049409,-0.195379,0.953520,0.078585,-0.290841,0.979461,0.049409,-0.195379,\n\t\t\t         0.988372,0.028413,-0.149174,0.970428,0.069124,-0.231239,0.953520,0.078585,-0.290841,0.970428,0.069124,-0.231239,\n\t\t\t         0.859859,0.105319,-0.499496,0.850795,0.097201,-0.516373,0.995544,0.015564,-0.092715,0.992981,0.048250,-0.107944,\n\t\t\t         0.986541,0.094699,0.133244,0.999512,-0.027039,0.015351,0.995544,0.015564,-0.092715,0.999512,-0.027039,0.015351,\n\t\t\t         0.995941,-0.070986,0.055177,0.998230,-0.015656,-0.056887,0.995544,0.015564,-0.092715,0.998230,-0.015656,-0.056887,\n\t\t\t         0.988372,0.028413,-0.149174,0.979461,0.049409,-0.195379,0.995544,0.015564,-0.092715,0.979461,0.049409,-0.195379,\n\t\t\t         0.975585,0.058351,-0.211615,0.992981,0.048250,-0.107944,0.166082,-0.332286,0.928404,0.182714,-0.429304,0.884457,\n\t\t\t         0.822108,-0.323191,0.468642,0.845943,-0.300272,0.440626,0.188513,-0.436659,0.879635,0.152776,-0.430921,0.889340,\n\t\t\t         0.764092,-0.306162,0.567766,0.803156,-0.295846,0.517045,0.845943,-0.300272,0.440626,0.822108,-0.323191,0.468642,\n\t\t\t         0.922605,-0.228065,0.311014,0.947874,-0.191443,0.254677,0.845943,-0.300272,0.440626,0.947874,-0.191443,0.254677,\n\t\t\t         0.912534,0.049074,0.405988,0.714591,0.073397,0.695669,0.072848,-0.427900,0.900876,-0.011292,-0.366863,0.930204,\n\t\t\t         0.608753,-0.276040,0.743736,0.679983,-0.323649,0.657888,0.188513,-0.436659,0.879635,0.803156,-0.295846,0.517045,\n\t\t\t         0.822108,-0.323191,0.468642,0.182714,-0.429304,0.884457,0.803156,-0.295846,0.517045,0.764092,-0.306162,0.567766,\n\t\t\t         0.870663,-0.227668,0.435926,0.898862,-0.220405,0.378704,0.803156,-0.295846,0.517045,0.898862,-0.220405,0.378704,\n\t\t\t         0.922605,-0.228065,0.311014,0.822108,-0.323191,0.468642,0.072848,-0.427900,0.900876,0.679983,-0.323649,0.657888,\n\t\t\t         0.764092,-0.306162,0.567766,0.152776,-0.430921,0.889340,0.679983,-0.323649,0.657888,0.608753,-0.276040,0.743736,\n\t\t\t         0.796014,-0.186865,0.575640,0.836360,-0.224860,0.499863,0.679983,-0.323649,0.657888,0.836360,-0.224860,0.499863,\n\t\t\t         0.870663,-0.227668,0.435926,0.764092,-0.306162,0.567766,-0.018189,-0.280526,0.959655,-0.043794,-0.223395,0.973724,\n\t\t\t         0.533738,-0.239235,0.811090,0.590197,-0.227973,0.774377,0.166082,-0.332286,0.928404,0.845943,-0.300272,0.440626,\n\t\t\t         0.714591,0.073397,0.695669,0.160436,-0.040498,0.986206,0.590197,-0.227973,0.774377,0.533738,-0.239235,0.811090,\n\t\t\t         0.645955,-0.187658,0.739921,0.740165,-0.167333,0.651234,0.590197,-0.227973,0.774377,0.740165,-0.167333,0.651234,\n\t\t\t         0.796014,-0.186865,0.575640,0.608753,-0.276040,0.743736,0.823939,-0.117954,0.554216,0.790307,-0.156224,0.592425,\n\t\t\t         0.891171,-0.162389,0.423566,0.921140,-0.069247,0.382946,0.823939,-0.117954,0.554216,0.921140,-0.069247,0.382946,\n\t\t\t         0.946440,-0.041444,0.320170,0.867519,-0.120182,0.482650,0.823939,-0.117954,0.554216,0.867519,-0.120182,0.482650,\n\t\t\t         0.796014,-0.186865,0.575640,0.740165,-0.167333,0.651234,0.823939,-0.117954,0.554216,0.740165,-0.167333,0.651234,\n\t\t\t         0.645955,-0.187658,0.739921,0.790307,-0.156224,0.592425,0.906735,-0.148656,0.394574,0.969573,-0.054720,0.238502,\n\t\t\t         0.984008,-0.069521,0.163945,0.936338,-0.153111,0.315928,0.906735,-0.148656,0.394574,0.936338,-0.153111,0.315928,\n\t\t\t         0.870663,-0.227668,0.435926,0.836360,-0.224860,0.499863,0.906735,-0.148656,0.394574,0.836360,-0.224860,0.499863,\n\t\t\t         0.796014,-0.186865,0.575640,0.867519,-0.120182,0.482650,0.906735,-0.148656,0.394574,0.867519,-0.120182,0.482650,\n\t\t\t         0.946440,-0.041444,0.320170,0.969573,-0.054720,0.238502,0.955565,-0.148442,0.254616,0.991241,-0.076724,0.107395,\n\t\t\t         0.995941,-0.070986,0.055177,0.971007,-0.145146,0.189825,0.955565,-0.148442,0.254616,0.971007,-0.145146,0.189825,\n\t\t\t         0.922605,-0.228065,0.311014,0.898862,-0.220405,0.378704,0.955565,-0.148442,0.254616,0.898862,-0.220405,0.378704,\n\t\t\t         0.870663,-0.227668,0.435926,0.936338,-0.153111,0.315928,0.955565,-0.148442,0.254616,0.936338,-0.153111,0.315928,\n\t\t\t         0.984008,-0.069521,0.163945,0.991241,-0.076724,0.107395,0.986236,-0.095523,0.134922,0.999512,-0.027039,0.015351,\n\t\t\t         0.986541,0.094699,0.133244,0.958861,0.091159,0.268777,0.986236,-0.095523,0.134922,0.958861,0.091159,0.268777,\n\t\t\t         0.912534,0.049074,0.405988,0.947874,-0.191443,0.254677,0.986236,-0.095523,0.134922,0.947874,-0.191443,0.254677,\n\t\t\t         0.922605,-0.228065,0.311014,0.971007,-0.145146,0.189825,0.986236,-0.095523,0.134922,0.971007,-0.145146,0.189825,\n\t\t\t         0.995941,-0.070986,0.055177,0.999512,-0.027039,0.015351,-0.868404,-0.273690,0.413434,-0.842250,-0.195807,0.502213,\n\t\t\t         -0.973876,-0.197699,0.111454,-0.966887,-0.235908,0.097110,-0.868404,-0.273690,0.413434,-0.966887,-0.235908,0.097110,\n\t\t\t         -0.985351,0.077670,-0.151799,-0.932188,-0.012848,0.361675,-0.868404,-0.273690,0.413434,-0.932188,-0.012848,0.361675,\n\t\t\t         -0.967528,0.047090,0.248299,-0.950957,-0.188025,0.245552,-0.868404,-0.273690,0.413434,-0.950957,-0.188025,0.245552,\n\t\t\t         -0.923978,-0.215125,0.316172,-0.842250,-0.195807,0.502213,0.545122,0.783105,0.299264,0.562944,0.497055,0.660298,\n\t\t\t         0.765435,0.514145,0.386944,0.682485,0.721610,0.116031,0.545122,0.783105,0.299264,0.682485,0.721610,0.116031,\n\t\t\t         0.595874,0.797327,-0.095798,0.470229,0.879574,0.072207,0.545122,0.783105,0.299264,0.470229,0.879574,0.072207,\n\t\t\t         0.005951,0.979522,0.201117,0.010559,0.885281,0.464888,0.545122,0.783105,0.299264,0.010559,0.885281,0.464888,\n\t\t\t         0.015442,0.547288,0.836787,0.562944,0.497055,0.660298,0.728294,0.679647,-0.087313,0.860225,0.492691,-0.131321,\n\t\t\t         0.776971,0.520280,-0.354350,0.623646,0.722922,-0.297281,0.728294,0.679647,-0.087313,0.623646,0.722922,-0.297281,\n\t\t\t         0.418928,0.876553,-0.236854,0.534806,0.844234,-0.034852,0.728294,0.679647,-0.087313,0.534806,0.844234,-0.034852,\n\t\t\t         0.545793,0.837886,-0.003327,0.775689,0.626728,-0.074007,0.728294,0.679647,-0.087313,0.775689,0.626728,-0.074007,\n\t\t\t         0.882565,0.456923,-0.110660,0.860225,0.492691,-0.131321,0.933409,0.315867,-0.170049,0.855678,0.326701,-0.401288,\n\t\t\t         0.776971,0.520280,-0.354350,0.860225,0.492691,-0.131321,0.933409,0.315867,-0.170049,0.860225,0.492691,-0.131321,\n\t\t\t         0.882565,0.456923,-0.110660,0.943266,0.295907,-0.150609,0.933409,0.315867,-0.170049,0.943266,0.295907,-0.150609,\n\t\t\t         0.973388,0.150304,-0.172796,0.967315,0.164586,-0.192877,0.933409,0.315867,-0.170049,0.967315,0.164586,-0.192877,\n\t\t\t         0.887020,0.169073,-0.429609,0.855678,0.326701,-0.401288,-0.873836,0.117405,-0.471786,-0.884426,0.106296,-0.454390,\n\t\t\t         -0.857662,0.220069,-0.464705,-0.852168,0.213355,-0.477767,-0.844752,-0.175787,-0.505448,-0.846034,-0.157933,-0.509171,\n\t\t\t         -0.804346,-0.307718,-0.508255,-0.792016,-0.322031,-0.518632,0.962249,0.239326,-0.129490,0.920042,0.375286,-0.112369,\n\t\t\t         0.994812,0.100497,0.015259,0.997497,0.064943,0.027711,0.962249,0.239326,-0.129490,0.997497,0.064943,0.027711,\n\t\t\t         0.998901,0.018342,0.043001,0.983856,0.110019,-0.141057,0.962249,0.239326,-0.129490,0.983856,0.110019,-0.141057,\n\t\t\t         0.973388,0.150304,-0.172796,0.943266,0.295907,-0.150609,0.962249,0.239326,-0.129490,0.943266,0.295907,-0.150609,\n\t\t\t         0.882565,0.456923,-0.110660,0.920042,0.375286,-0.112369,0.846004,0.523881,-0.098849,0.775689,0.626728,-0.074007,\n\t\t\t         0.545793,0.837886,-0.003327,0.724418,0.687948,-0.043580,0.846004,0.523881,-0.098849,0.724418,0.687948,-0.043580,\n\t\t\t         0.788263,0.613910,0.041231,0.904569,0.418714,-0.079806,0.846004,0.523881,-0.098849,0.904569,0.418714,-0.079806,\n\t\t\t         0.994812,0.100497,0.015259,0.920042,0.375286,-0.112369,0.846004,0.523881,-0.098849,0.920042,0.375286,-0.112369,\n\t\t\t         0.882565,0.456923,-0.110660,0.775689,0.626728,-0.074007,0.579882,0.812159,0.063997,0.578478,0.797082,0.173162,\n\t\t\t         0.788263,0.613910,0.041231,0.724418,0.687948,-0.043580,0.579882,0.812159,0.063997,0.724418,0.687948,-0.043580,\n\t\t\t         0.545793,0.837886,-0.003327,0.391125,0.915525,0.093661,0.579882,0.812159,0.063997,0.391125,0.915525,0.093661,\n\t\t\t         0.329325,0.913877,0.237373,0.578478,0.797082,0.173162,-0.000275,0.979156,0.202948,-0.043794,0.978179,0.203040,\n\t\t\t         -0.038078,0.876797,0.479351,0.000109,0.982495,0.186288,-0.000275,0.979156,0.202948,0.000109,0.982495,0.186288,\n\t\t\t         0.029992,0.876364,0.480714,0.045198,0.978210,0.202490,-0.000275,0.979156,0.202948,0.045198,0.978210,0.202490,\n\t\t\t         0.002228,0.985076,0.172063,-0.043794,0.978179,0.203040,0.764946,0.518143,0.382550,0.887020,0.420118,0.191473,\n\t\t\t         0.788263,0.613910,0.041231,0.652028,0.661550,0.370373,0.764946,0.518143,0.382550,0.652028,0.661550,0.370373,\n\t\t\t         0.269539,0.373089,0.887753,0.474563,0.173498,0.862911,0.764946,0.518143,0.382550,0.474563,0.173498,0.862911,\n\t\t\t         0.727531,-0.014283,0.685903,0.887020,0.420118,0.191473,0.946226,0.315867,0.069643,0.945189,-0.085452,0.315073,\n\t\t\t         0.994812,0.100497,0.015259,0.904569,0.418714,-0.079806,0.946226,0.315867,0.069643,0.904569,0.418714,-0.079806,\n\t\t\t         0.788263,0.613910,0.041231,0.887020,0.420118,0.191473,0.946226,0.315867,0.069643,0.887020,0.420118,0.191473,\n\t\t\t         0.727531,-0.014283,0.685903,0.945189,-0.085452,0.315073,0.488388,0.758538,0.431318,0.652028,0.661550,0.370373,\n\t\t\t         0.788263,0.613910,0.041231,0.578478,0.797082,0.173162,0.488388,0.758538,0.431318,0.578478,0.797082,0.173162,\n\t\t\t         0.329325,0.913877,0.237373,0.294687,0.817408,0.494949,0.488388,0.758538,0.431318,0.294687,0.817408,0.494949,\n\t\t\t         0.082186,0.383923,0.919675,0.144047,0.423811,0.894192,0.488388,0.758538,0.431318,0.144047,0.423811,0.894192,\n\t\t\t         0.269539,0.373089,0.887753,0.652028,0.661550,0.370373,0.181249,0.970946,0.156194,0.239143,0.965423,0.103671,\n\t\t\t         0.002228,0.985076,0.172063,0.045198,0.978210,0.202490,0.181249,0.970946,0.156194,0.045198,0.978210,0.202490,\n\t\t\t         0.029992,0.876364,0.480714,0.177831,0.950346,0.255318,0.181249,0.970946,0.156194,0.177831,0.950346,0.255318,\n\t\t\t         0.329325,0.913877,0.237373,0.391125,0.915525,0.093661,0.181249,0.970946,0.156194,0.391125,0.915525,0.093661,\n\t\t\t         0.545793,0.837886,-0.003327,0.239143,0.965423,0.103671,-0.978423,-0.197180,-0.061373,-0.956053,-0.282571,-0.077975,\n\t\t\t         -0.698202,-0.193487,-0.689230,-0.963744,-0.080599,-0.254280,-0.978423,-0.197180,-0.061373,-0.963744,-0.080599,-0.254280,\n\t\t\t         -0.985351,0.077670,-0.151799,-0.966887,-0.235908,0.097110,-0.978423,-0.197180,-0.061373,-0.966887,-0.235908,0.097110,\n\t\t\t         -0.973876,-0.197699,0.111454,-0.956053,-0.282571,-0.077975,-0.725700,-0.617786,-0.302713,-0.826899,-0.556841,0.078310,\n\t\t\t         -0.956908,-0.290323,-0.003235,-0.801080,-0.485977,-0.349315,-0.725700,-0.617786,-0.302713,-0.801080,-0.485977,-0.349315,\n\t\t\t         -0.475570,-0.469558,-0.743828,-0.466231,-0.600421,-0.649678,-0.725700,-0.617786,-0.302713,-0.466231,-0.600421,-0.649678,\n\t\t\t         -0.419263,-0.724052,-0.547655,-0.550890,-0.783715,-0.286782,-0.725700,-0.617786,-0.302713,-0.550890,-0.783715,-0.286782,\n\t\t\t         -0.639882,-0.756127,0.137150,-0.826899,-0.556841,0.078310,-0.796411,-0.321146,-0.512375,-0.801080,-0.485977,-0.349315,\n\t\t\t         -0.956908,-0.290323,-0.003235,-0.846919,-0.225440,-0.481521,-0.796411,-0.321146,-0.512375,-0.846919,-0.225440,-0.481521,\n\t\t\t         -0.449049,-0.190771,-0.872860,-0.449568,-0.291818,-0.844203,-0.796411,-0.321146,-0.512375,-0.449568,-0.291818,-0.844203,\n\t\t\t         -0.475570,-0.469558,-0.743828,-0.801080,-0.485977,-0.349315,-0.895840,0.376324,-0.236213,-0.884732,0.344676,-0.313669,\n\t\t\t         -0.962767,0.263833,-0.058443,-0.927061,0.371563,-0.049532,-0.895840,0.376324,-0.236213,-0.927061,0.371563,-0.049532,\n\t\t\t         -0.851192,0.522538,0.048952,-0.853542,0.439314,-0.280038,-0.895840,0.376324,-0.236213,-0.853542,0.439314,-0.280038,\n\t\t\t         -0.615680,0.345531,-0.708182,-0.884732,0.344676,-0.313669,-0.663747,0.250313,-0.704794,-0.878170,0.263192,-0.399396,\n\t\t\t         -0.985351,0.077670,-0.151799,-0.720237,0.162999,-0.674276,-0.663747,0.250313,-0.704794,-0.720237,0.162999,-0.674276,\n\t\t\t         -0.382305,0.162755,-0.909574,-0.603290,0.252937,-0.756310,-0.663747,0.250313,-0.704794,-0.603290,0.252937,-0.756310,\n\t\t\t         -0.927244,0.196142,-0.318918,-0.875851,0.282785,-0.391003,-0.663747,0.250313,-0.704794,-0.875851,0.282785,-0.391003,\n\t\t\t         -0.881405,0.300729,-0.364177,-0.878170,0.263192,-0.399396,-0.873653,0.296457,-0.385723,-0.884732,0.344676,-0.313669,\n\t\t\t         -0.615680,0.345531,-0.708182,-0.572954,0.176214,-0.800409,-0.873653,0.296457,-0.385723,-0.572954,0.176214,-0.800409,\n\t\t\t         -0.672964,-0.035676,-0.738792,-0.941862,0.197790,-0.271523,-0.873653,0.296457,-0.385723,-0.941862,0.197790,-0.271523,\n\t\t\t         -0.962767,0.263833,-0.058443,-0.884732,0.344676,-0.313669,-0.676199,0.719382,-0.158727,-0.705008,0.708396,-0.032929,\n\t\t\t         -0.561785,0.822810,-0.085513,-0.534837,0.799310,-0.273812,-0.676199,0.719382,-0.158727,-0.534837,0.799310,-0.273812,\n\t\t\t         -0.509751,0.749901,-0.421613,-0.738365,0.639454,-0.214209,-0.676199,0.719382,-0.158727,-0.738365,0.639454,-0.214209,\n\t\t\t         -0.851192,0.522538,0.048952,-0.705008,0.708396,-0.032929,-0.190497,0.524766,-0.829646,-0.242775,0.758232,-0.605060,\n\t\t\t         -0.002228,0.740104,-0.672445,-0.002991,0.489242,-0.872127,-0.190497,0.524766,-0.829646,-0.002991,0.489242,-0.872127,\n\t\t\t         -0.001190,0.178961,-0.983825,-0.166814,0.218970,-0.961333,-0.190497,0.524766,-0.829646,-0.166814,0.218970,-0.961333,\n\t\t\t         -0.615680,0.345531,-0.708182,-0.520951,0.569475,-0.635823,-0.190497,0.524766,-0.829646,-0.520951,0.569475,-0.635823,\n\t\t\t         -0.509751,0.749901,-0.421613,-0.242775,0.758232,-0.605060,-0.884091,0.051180,-0.464431,-0.472823,0.030183,-0.880612,\n\t\t\t         -0.382305,0.162755,-0.909574,-0.720237,0.162999,-0.674276,-0.884091,0.051180,-0.464431,-0.720237,0.162999,-0.674276,\n\t\t\t         -0.985351,0.077670,-0.151799,-0.963744,-0.080599,-0.254280,-0.884091,0.051180,-0.464431,-0.963744,-0.080599,-0.254280,\n\t\t\t         -0.698202,-0.193487,-0.689230,-0.472823,0.030183,-0.880612,-0.994537,0.056948,-0.087466,-0.996521,0.059999,0.057466,\n\t\t\t         -0.962767,0.263833,-0.058443,-0.941862,0.197790,-0.271523,-0.994537,0.056948,-0.087466,-0.941862,0.197790,-0.271523,\n\t\t\t         -0.672964,-0.035676,-0.738792,-0.976867,-0.096194,-0.190802,-0.994537,0.056948,-0.087466,-0.976867,-0.096194,-0.190802,\n\t\t\t         -0.973876,-0.197699,0.111454,-0.996521,0.059999,0.057466,-0.755425,0.563005,-0.335124,-0.853542,0.439314,-0.280038,\n\t\t\t         -0.851192,0.522538,0.048952,-0.738365,0.639454,-0.214209,-0.755425,0.563005,-0.335124,-0.738365,0.639454,-0.214209,\n\t\t\t         -0.509751,0.749901,-0.421613,-0.520951,0.569475,-0.635823,-0.755425,0.563005,-0.335124,-0.520951,0.569475,-0.635823,\n\t\t\t         -0.615680,0.345531,-0.708182,-0.853542,0.439314,-0.280038,-0.316507,0.855098,-0.410596,-0.356395,0.906888,-0.224708,\n\t\t\t         0.002655,0.957488,-0.288369,0.000671,0.874386,-0.485153,-0.316507,0.855098,-0.410596,0.000671,0.874386,-0.485153,\n\t\t\t         -0.002228,0.740104,-0.672445,-0.242775,0.758232,-0.605060,-0.316507,0.855098,-0.410596,-0.242775,0.758232,-0.605060,\n\t\t\t         -0.509751,0.749901,-0.421613,-0.534837,0.799310,-0.273812,-0.316507,0.855098,-0.410596,-0.534837,0.799310,-0.273812,\n\t\t\t         -0.561785,0.822810,-0.085513,-0.356395,0.906888,-0.224708,-0.930967,-0.235145,-0.279183,-0.956053,-0.282571,-0.077975,\n\t\t\t         -0.973876,-0.197699,0.111454,-0.976867,-0.096194,-0.190802,-0.930967,-0.235145,-0.279183,-0.976867,-0.096194,-0.190802,\n\t\t\t         -0.672964,-0.035676,-0.738792,-0.630238,-0.267891,-0.728690,-0.930967,-0.235145,-0.279183,-0.630238,-0.267891,-0.728690,\n\t\t\t         -0.698202,-0.193487,-0.689230,-0.956053,-0.282571,-0.077975,-0.147526,0.031800,-0.988525,-0.166814,0.218970,-0.961333,\n\t\t\t         -0.001190,0.178961,-0.983825,-0.000427,-0.005615,-0.999969,-0.147526,0.031800,-0.988525,-0.000427,-0.005615,-0.999969,\n\t\t\t         -0.000305,-0.126011,-0.992004,-0.151128,-0.120487,-0.981140,-0.147526,0.031800,-0.988525,-0.151128,-0.120487,-0.981140,\n\t\t\t         -0.672964,-0.035676,-0.738792,-0.572954,0.176214,-0.800409,-0.147526,0.031800,-0.988525,-0.572954,0.176214,-0.800409,\n\t\t\t         -0.615680,0.345531,-0.708182,-0.166814,0.218970,-0.961333,-0.210211,-0.233467,-0.949339,-0.151128,-0.120487,-0.981140,\n\t\t\t         -0.000305,-0.126011,-0.992004,0.000031,-0.200446,-0.979675,-0.210211,-0.233467,-0.949339,0.000031,-0.200446,-0.979675,\n\t\t\t         0.003479,-0.153630,-0.988098,-0.203223,-0.155065,-0.966765,-0.210211,-0.233467,-0.949339,-0.203223,-0.155065,-0.966765,\n\t\t\t         -0.698202,-0.193487,-0.689230,-0.630238,-0.267891,-0.728690,-0.210211,-0.233467,-0.949339,-0.630238,-0.267891,-0.728690,\n\t\t\t         -0.672964,-0.035676,-0.738792,-0.151128,-0.120487,-0.981140,-0.159307,-0.021790,-0.986969,-0.203223,-0.155065,-0.966765,\n\t\t\t         0.003479,-0.153630,-0.988098,0.001831,-0.041597,-0.999115,-0.159307,-0.021790,-0.986969,0.001831,-0.041597,-0.999115,\n\t\t\t         -0.000977,0.068484,-0.997650,-0.141301,0.090152,-0.985839,-0.159307,-0.021790,-0.986969,-0.141301,0.090152,-0.985839,\n\t\t\t         -0.382305,0.162755,-0.909574,-0.472823,0.030183,-0.880612,-0.159307,-0.021790,-0.986969,-0.472823,0.030183,-0.880612,\n\t\t\t         -0.698202,-0.193487,-0.689230,-0.203223,-0.155065,-0.966765,-0.155950,-0.082675,-0.984283,-0.154973,0.037385,-0.987182,\n\t\t\t         -0.004028,0.038209,-0.999237,-0.002136,-0.068575,-0.997620,-0.155950,-0.082675,-0.984283,-0.002136,-0.068575,-0.997620,\n\t\t\t         0.000610,-0.152898,-0.988220,-0.147526,-0.161687,-0.975738,-0.155950,-0.082675,-0.984283,-0.147526,-0.161687,-0.975738,\n\t\t\t         -0.449049,-0.190771,-0.872860,-0.497665,-0.113224,-0.859920,-0.155950,-0.082675,-0.984283,-0.497665,-0.113224,-0.859920,\n\t\t\t         -0.506699,-0.017884,-0.861904,-0.154973,0.037385,-0.987182,-0.145512,-0.255501,-0.955779,-0.147526,-0.161687,-0.975738,\n\t\t\t         0.000610,-0.152898,-0.988220,0.001801,-0.246651,-0.969085,-0.145512,-0.255501,-0.955779,0.001801,-0.246651,-0.969085,\n\t\t\t         0.001099,-0.356945,-0.934111,-0.159551,-0.379284,-0.911405,-0.145512,-0.255501,-0.955779,-0.159551,-0.379284,-0.911405,\n\t\t\t         -0.475570,-0.469558,-0.743828,-0.449568,-0.291818,-0.844203,-0.145512,-0.255501,-0.955779,-0.449568,-0.291818,-0.844203,\n\t\t\t         -0.449049,-0.190771,-0.872860,-0.147526,-0.161687,-0.975738,-0.177007,-0.534898,-0.826136,-0.159551,-0.379284,-0.911405,\n\t\t\t         0.001099,-0.356945,-0.934111,0.000183,-0.511765,-0.859096,-0.177007,-0.534898,-0.826136,0.000183,-0.511765,-0.859096,\n\t\t\t         -0.000214,-0.765862,-0.642964,-0.212256,-0.757469,-0.617359,-0.177007,-0.534898,-0.826136,-0.212256,-0.757469,-0.617359,\n\t\t\t         -0.419263,-0.724052,-0.547655,-0.466231,-0.600421,-0.649678,-0.177007,-0.534898,-0.826136,-0.466231,-0.600421,-0.649678,\n\t\t\t         -0.475570,-0.469558,-0.743828,-0.159551,-0.379284,-0.911405,-0.279580,-0.915220,-0.290139,-0.212256,-0.757469,-0.617359,\n\t\t\t         -0.000214,-0.765862,-0.642964,0.000061,-0.953551,-0.301187,-0.279580,-0.915220,-0.290139,0.000061,-0.953551,-0.301187,\n\t\t\t         0.001526,-0.972259,0.233863,-0.342448,-0.915159,0.212470,-0.279580,-0.915220,-0.290139,-0.342448,-0.915159,0.212470,\n\t\t\t         -0.639882,-0.756127,0.137150,-0.550890,-0.783715,-0.286782,-0.279580,-0.915220,-0.290139,-0.550890,-0.783715,-0.286782,\n\t\t\t         -0.419263,-0.724052,-0.547655,-0.212256,-0.757469,-0.617359,-0.143498,0.126591,-0.981506,-0.141301,0.090152,-0.985839,\n\t\t\t         -0.000977,0.068484,-0.997650,-0.003113,0.110263,-0.993866,-0.143498,0.126591,-0.981506,-0.003113,0.110263,-0.993866,\n\t\t\t         -0.004028,0.038209,-0.999237,-0.154973,0.037385,-0.987182,-0.143498,0.126591,-0.981506,-0.154973,0.037385,-0.987182,\n\t\t\t         -0.506699,-0.017884,-0.861904,-0.324625,0.167028,-0.930967,-0.143498,0.126591,-0.981506,-0.324625,0.167028,-0.930967,\n\t\t\t         -0.382305,0.162755,-0.909574,-0.141301,0.090152,-0.985839,-0.944884,-0.083193,-0.316599,-0.906247,-0.137638,-0.399670,\n\t\t\t         -0.956908,-0.290323,-0.003235,-0.995483,-0.090213,0.029511,-0.944884,-0.083193,-0.316599,-0.995483,-0.090213,0.029511,\n\t\t\t         -0.996948,-0.009949,0.077334,-0.996185,0.044099,-0.075167,-0.944884,-0.083193,-0.316599,-0.996185,0.044099,-0.075167,\n\t\t\t         -0.927244,0.196142,-0.318918,-0.804682,0.036653,-0.592517,-0.944884,-0.083193,-0.316599,-0.804682,0.036653,-0.592517,\n\t\t\t         -0.506699,-0.017884,-0.861904,-0.906247,-0.137638,-0.399670,-0.641469,0.193365,-0.742332,-0.324625,0.167028,-0.930967,\n\t\t\t         -0.506699,-0.017884,-0.861904,-0.804682,0.036653,-0.592517,-0.641469,0.193365,-0.742332,-0.804682,0.036653,-0.592517,\n\t\t\t         -0.927244,0.196142,-0.318918,-0.603290,0.252937,-0.756310,-0.641469,0.193365,-0.742332,-0.603290,0.252937,-0.756310,\n\t\t\t         -0.382305,0.162755,-0.909574,-0.324625,0.167028,-0.930967,-0.823359,-0.185980,-0.536119,-0.846919,-0.225440,-0.481521,\n\t\t\t         -0.956908,-0.290323,-0.003235,-0.906247,-0.137638,-0.399670,-0.823359,-0.185980,-0.536119,-0.906247,-0.137638,-0.399670,\n\t\t\t         -0.506699,-0.017884,-0.861904,-0.497665,-0.113224,-0.859920,-0.823359,-0.185980,-0.536119,-0.497665,-0.113224,-0.859920,\n\t\t\t         -0.449049,-0.190771,-0.872860,-0.846919,-0.225440,-0.481521,-0.351054,0.934019,-0.065828,-0.356395,0.906888,-0.224708,\n\t\t\t         -0.561785,0.822810,-0.085513,-0.445479,0.890652,0.090854,-0.351054,0.934019,-0.065828,-0.445479,0.890652,0.090854,\n\t\t\t         0.005951,0.979522,0.201117,0.004089,0.999603,-0.027192,-0.351054,0.934019,-0.065828,0.004089,0.999603,-0.027192,\n\t\t\t         0.002655,0.957488,-0.288369,-0.356395,0.906888,-0.224708,-0.685476,0.720206,0.106784,-0.753899,0.571947,0.323222,\n\t\t\t         -0.718436,0.540086,0.438337,-0.640797,0.753624,0.146275,-0.685476,0.720206,0.106784,-0.640797,0.753624,0.146275,\n\t\t\t         -0.561785,0.822810,-0.085513,-0.705008,0.708396,-0.032929,-0.685476,0.720206,0.106784,-0.705008,0.708396,-0.032929,\n\t\t\t         -0.851192,0.522538,0.048952,-0.753899,0.571947,0.323222,-0.344951,-0.866329,0.361187,-0.341594,-0.915891,0.210669,\n\t\t\t         0.002869,-0.975494,0.219977,0.001709,-0.932249,0.361736,-0.344951,-0.866329,0.361187,0.001709,-0.932249,0.361736,\n\t\t\t         0.000061,-0.829218,0.558885,-0.331523,-0.757653,0.562151,-0.344951,-0.866329,0.361187,-0.331523,-0.757653,0.562151,\n\t\t\t         -0.606311,-0.563341,0.561235,-0.651845,-0.671957,0.351451,-0.344951,-0.866329,0.361187,-0.651845,-0.671957,0.351451,\n\t\t\t         -0.658925,-0.729240,0.184423,-0.341594,-0.915891,0.210669,-0.272073,-0.571520,0.774132,-0.000824,-0.624928,0.780633,\n\t\t\t         0.000458,-0.370739,0.928709,-0.192328,-0.347056,0.917875,-0.272073,-0.571520,0.774132,-0.192328,-0.347056,0.917875,\n\t\t\t         -0.385235,-0.270638,0.882229,-0.506363,-0.419965,0.753105,-0.272073,-0.571520,0.774132,-0.506363,-0.419965,0.753105,\n\t\t\t         -0.606311,-0.563341,0.561235,-0.331523,-0.757653,0.562151,-0.272073,-0.571520,0.774132,-0.331523,-0.757653,0.562151,\n\t\t\t         0.000061,-0.829218,0.558885,-0.000824,-0.624928,0.780633,0.741172,0.293008,0.603961,0.806269,0.296060,0.512070,\n\t\t\t         0.883175,0.466720,0.046022,0.797662,0.530534,0.286721,0.741172,0.293008,0.603961,0.797662,0.530534,0.286721,\n\t\t\t         0.765435,0.514145,0.386944,0.727195,0.165471,0.666158,0.741172,0.293008,0.603961,0.727195,0.165471,0.666158,\n\t\t\t         0.761071,0.424635,0.490341,0.774895,0.416791,0.475143,0.741172,0.293008,0.603961,0.774895,0.416791,0.475143,\n\t\t\t         0.820032,0.348064,0.454237,0.806269,0.296060,0.512070,-0.138615,-0.200995,0.969726,-0.192328,-0.347056,0.917875,\n\t\t\t         0.000458,-0.370739,0.928709,0.004273,-0.217627,0.976012,-0.138615,-0.200995,0.969726,0.004273,-0.217627,0.976012,\n\t\t\t         0.011353,-0.134404,0.990844,-0.117313,-0.144871,0.982452,-0.138615,-0.200995,0.969726,-0.117313,-0.144871,0.982452,\n\t\t\t         -0.283303,-0.160253,0.945524,-0.291238,-0.163793,0.942503,-0.138615,-0.200995,0.969726,-0.291238,-0.163793,0.942503,\n\t\t\t         -0.385235,-0.270638,0.882229,-0.192328,-0.347056,0.917875,-0.829981,-0.443831,0.337809,-0.853633,-0.491653,0.171911,\n\t\t\t         -0.658925,-0.729240,0.184423,-0.651845,-0.671957,0.351451,-0.829981,-0.443831,0.337809,-0.651845,-0.671957,0.351451,\n\t\t\t         -0.606311,-0.563341,0.561235,-0.753380,-0.362987,0.548296,-0.829981,-0.443831,0.337809,-0.753380,-0.362987,0.548296,\n\t\t\t         -0.815851,-0.237678,0.527116,-0.900540,-0.277627,0.334513,-0.829981,-0.443831,0.337809,-0.900540,-0.277627,0.334513,\n\t\t\t         -0.937712,-0.302286,0.171178,-0.853633,-0.491653,0.171911,-0.631764,-0.268868,0.726981,-0.506363,-0.419965,0.753105,\n\t\t\t         -0.385235,-0.270638,0.882229,-0.505142,-0.192022,0.841365,-0.631764,-0.268868,0.726981,-0.505142,-0.192022,0.841365,\n\t\t\t         -0.552049,-0.174505,0.815332,-0.691519,-0.195257,0.695425,-0.631764,-0.268868,0.726981,-0.691519,-0.195257,0.695425,\n\t\t\t         -0.815851,-0.237678,0.527116,-0.753380,-0.362987,0.548296,-0.631764,-0.268868,0.726981,-0.753380,-0.362987,0.548296,\n\t\t\t         -0.606311,-0.563341,0.561235,-0.506363,-0.419965,0.753105,-0.848628,-0.528611,-0.019532,-0.690603,-0.495071,-0.527146,\n\t\t\t         -0.518113,-0.691153,-0.503800,-0.644795,-0.764061,-0.020173,-0.848628,-0.528611,-0.019532,-0.644795,-0.764061,-0.020173,\n\t\t\t         -0.658925,-0.729240,0.184423,-0.853633,-0.491653,0.171911,-0.848628,-0.528611,-0.019532,-0.853633,-0.491653,0.171911,\n\t\t\t         -0.937712,-0.302286,0.171178,-0.946074,-0.323893,0.000305,-0.848628,-0.528611,-0.019532,-0.946074,-0.323893,0.000305,\n\t\t\t         -0.792016,-0.322031,-0.518632,-0.690603,-0.495071,-0.527146,-0.393536,-0.134220,0.909452,-0.505142,-0.192022,0.841365,\n\t\t\t         -0.385235,-0.270638,0.882229,-0.291238,-0.163793,0.942503,-0.393536,-0.134220,0.909452,-0.291238,-0.163793,0.942503,\n\t\t\t         -0.283303,-0.160253,0.945524,-0.399701,-0.151677,0.903989,-0.393536,-0.134220,0.909452,-0.399701,-0.151677,0.903989,\n\t\t\t         -0.552049,-0.174505,0.815332,-0.505142,-0.192022,0.841365,-0.697623,0.337504,0.631947,-0.680593,0.202765,0.704031,\n\t\t\t         -0.718436,0.540086,0.438337,-0.753899,0.571947,0.323222,-0.697623,0.337504,0.631947,-0.753899,0.571947,0.323222,\n\t\t\t         -0.851192,0.522538,0.048952,-0.772210,0.345439,0.533219,-0.697623,0.337504,0.631947,-0.772210,0.345439,0.533219,\n\t\t\t         -0.777093,0.387951,0.495560,-0.728324,0.460036,0.507767,-0.697623,0.337504,0.631947,-0.728324,0.460036,0.507767,\n\t\t\t         -0.709433,0.472915,0.522507,-0.680593,0.202765,0.704031,-0.930662,-0.154180,0.331767,-0.900540,-0.277627,0.334513,\n\t\t\t         -0.815851,-0.237678,0.527116,-0.850642,-0.145573,0.505173,-0.930662,-0.154180,0.331767,-0.850642,-0.145573,0.505173,\n\t\t\t         -0.878903,-0.080905,0.470016,-0.947600,-0.057680,0.314127,-0.930662,-0.154180,0.331767,-0.947600,-0.057680,0.314127,\n\t\t\t         -0.991943,-0.048402,0.117038,-0.975982,-0.158208,0.149724,-0.930662,-0.154180,0.331767,-0.975982,-0.158208,0.149724,\n\t\t\t         -0.937712,-0.302286,0.171178,-0.900540,-0.277627,0.334513,-0.995605,0.059969,-0.071535,-0.982818,0.163396,-0.085635,\n\t\t\t         -0.867946,0.107120,-0.484909,-0.867641,-0.045045,-0.495132,-0.995605,0.059969,-0.071535,-0.867641,-0.045045,-0.495132,\n\t\t\t         -0.862209,-0.107883,-0.494858,-0.997375,-0.048830,-0.053072,-0.995605,0.059969,-0.071535,-0.997375,-0.048830,-0.053072,\n\t\t\t         -0.991943,-0.048402,0.117038,-0.994995,0.064211,0.076327,-0.995605,0.059969,-0.071535,-0.994995,0.064211,0.076327,\n\t\t\t         -0.987182,0.155766,0.033876,-0.982818,0.163396,-0.085635,-0.963958,0.039216,0.263070,-0.947600,-0.057680,0.314127,\n\t\t\t         -0.878903,-0.080905,0.470016,-0.914274,-0.011414,0.404920,-0.963958,0.039216,0.263070,-0.914274,-0.011414,0.404920,\n\t\t\t         -0.940519,0.066469,0.333079,-0.971923,0.121525,0.201361,-0.963958,0.039216,0.263070,-0.971923,0.121525,0.201361,\n\t\t\t         -0.987182,0.155766,0.033876,-0.994995,0.064211,0.076327,-0.963958,0.039216,0.263070,-0.994995,0.064211,0.076327,\n\t\t\t         -0.991943,-0.048402,0.117038,-0.947600,-0.057680,0.314127,-0.967284,0.227607,-0.112003,-0.954924,0.254311,-0.153050,\n\t\t\t         -0.847224,0.262368,-0.461867,-0.858821,0.234657,-0.455306,-0.967284,0.227607,-0.112003,-0.858821,0.234657,-0.455306,\n\t\t\t         -0.867946,0.107120,-0.484909,-0.982818,0.163396,-0.085635,-0.967284,0.227607,-0.112003,-0.982818,0.163396,-0.085635,\n\t\t\t         -0.987182,0.155766,0.033876,-0.978362,0.206854,0.001007,-0.967284,0.227607,-0.112003,-0.978362,0.206854,0.001007,\n\t\t\t         -0.973144,0.227058,-0.037294,-0.954924,0.254311,-0.153050,-0.973785,0.171026,0.149876,-0.956633,0.113590,0.268166,\n\t\t\t         -0.974212,0.112888,0.195318,-0.979186,0.180425,0.092624,-0.973785,0.171026,0.149876,-0.979186,0.180425,0.092624,\n\t\t\t         -0.973144,0.227058,-0.037294,-0.978362,0.206854,0.001007,-0.973785,0.171026,0.149876,-0.978362,0.206854,0.001007,\n\t\t\t         -0.987182,0.155766,0.033876,-0.971923,0.121525,0.201361,-0.973785,0.171026,0.149876,-0.971923,0.121525,0.201361,\n\t\t\t         -0.940519,0.066469,0.333079,-0.956633,0.113590,0.268166,-0.957579,0.214026,-0.192816,-0.971770,0.113681,-0.206580,\n\t\t\t         -0.873836,0.117405,-0.471786,-0.852168,0.213355,-0.477767,-0.957579,0.214026,-0.192816,-0.852168,0.213355,-0.477767,\n\t\t\t         -0.847224,0.262368,-0.461867,-0.954924,0.254311,-0.153050,-0.957579,0.214026,-0.192816,-0.954924,0.254311,-0.153050,\n\t\t\t         -0.973144,0.227058,-0.037294,-0.978698,0.186773,-0.084964,-0.957579,0.214026,-0.192816,-0.978698,0.186773,-0.084964,\n\t\t\t         -0.987396,0.106876,-0.116581,-0.971770,0.113681,-0.206580,-0.990539,0.135136,0.023408,-0.991272,0.070223,0.111454,\n\t\t\t         -0.978149,0.096438,0.184149,-0.996796,0.074923,-0.026826,-0.990539,0.135136,0.023408,-0.996796,0.074923,-0.026826,\n\t\t\t         -0.987396,0.106876,-0.116581,-0.978698,0.186773,-0.084964,-0.990539,0.135136,0.023408,-0.978698,0.186773,-0.084964,\n\t\t\t         -0.973144,0.227058,-0.037294,-0.979186,0.180425,0.092624,-0.990539,0.135136,0.023408,-0.979186,0.180425,0.092624,\n\t\t\t         -0.974212,0.112888,0.195318,-0.991272,0.070223,0.111454,-0.149144,-0.357250,0.921995,-0.710532,-0.320048,0.626637,\n\t\t\t         -0.691397,-0.290201,0.661580,-0.164251,-0.413862,0.895383,-0.710532,-0.320048,0.626637,-0.592639,-0.032502,0.804773,\n\t\t\t         -0.855190,0.009369,0.518204,-0.898495,-0.165380,0.406568,-0.710532,-0.320048,0.626637,-0.898495,-0.165380,0.406568,\n\t\t\t         -0.859066,-0.136082,0.493393,-0.691397,-0.290201,0.661580,-0.176183,-0.404096,0.897549,-0.672933,-0.215308,0.707633,\n\t\t\t         -0.645741,-0.227088,0.728965,-0.157689,-0.394513,0.905240,-0.097232,-0.386822,0.916990,-0.600360,-0.260933,0.755913,\n\t\t\t         -0.551256,-0.232917,0.801141,-0.042787,-0.296335,0.954100,-0.672933,-0.215308,0.707633,-0.691397,-0.290201,0.661580,\n\t\t\t         -0.859066,-0.136082,0.493393,-0.818537,-0.099490,0.565722,-0.672933,-0.215308,0.707633,-0.818537,-0.099490,0.565722,\n\t\t\t         -0.778283,-0.128147,0.614643,-0.645741,-0.227088,0.728965,-0.176183,-0.404096,0.897549,-0.164251,-0.413862,0.895383,\n\t\t\t         -0.691397,-0.290201,0.661580,-0.672933,-0.215308,0.707633,-0.600360,-0.260933,0.755913,-0.645741,-0.227088,0.728965,\n\t\t\t         -0.778283,-0.128147,0.614643,-0.732688,-0.173254,0.658101,-0.600360,-0.260933,0.755913,-0.732688,-0.173254,0.658101,\n\t\t\t         -0.682089,-0.174902,0.710013,-0.551256,-0.232917,0.801141,-0.097232,-0.386822,0.916990,-0.157689,-0.394513,0.905240,\n\t\t\t         -0.645741,-0.227088,0.728965,-0.600360,-0.260933,0.755913,-0.744102,-0.147130,0.651631,-0.850642,-0.145573,0.505173,\n\t\t\t         -0.815851,-0.237678,0.527116,-0.691519,-0.195257,0.695425,-0.744102,-0.147130,0.651631,-0.691519,-0.195257,0.695425,\n\t\t\t         -0.552049,-0.174505,0.815332,-0.626087,-0.162847,0.762535,-0.744102,-0.147130,0.651631,-0.626087,-0.162847,0.762535,\n\t\t\t         -0.682089,-0.174902,0.710013,-0.798059,-0.121433,0.590167,-0.744102,-0.147130,0.651631,-0.798059,-0.121433,0.590167,\n\t\t\t         -0.878903,-0.080905,0.470016,-0.850642,-0.145573,0.505173,-0.847987,-0.083895,0.523301,-0.886532,-0.017640,0.462294,\n\t\t\t         -0.940519,0.066469,0.333079,-0.914274,-0.011414,0.404920,-0.847987,-0.083895,0.523301,-0.914274,-0.011414,0.404920,\n\t\t\t         -0.878903,-0.080905,0.470016,-0.798059,-0.121433,0.590167,-0.847987,-0.083895,0.523301,-0.798059,-0.121433,0.590167,\n\t\t\t         -0.682089,-0.174902,0.710013,-0.732688,-0.173254,0.658101,-0.847987,-0.083895,0.523301,-0.732688,-0.173254,0.658101,\n\t\t\t         -0.778283,-0.128147,0.614643,-0.886532,-0.017640,0.462294,-0.915799,0.023316,0.400922,-0.946898,0.011780,0.321238,\n\t\t\t         -0.974212,0.112888,0.195318,-0.956633,0.113590,0.268166,-0.915799,0.023316,0.400922,-0.956633,0.113590,0.268166,\n\t\t\t         -0.940519,0.066469,0.333079,-0.886532,-0.017640,0.462294,-0.915799,0.023316,0.400922,-0.886532,-0.017640,0.462294,\n\t\t\t         -0.778283,-0.128147,0.614643,-0.818537,-0.099490,0.565722,-0.915799,0.023316,0.400922,-0.818537,-0.099490,0.565722,\n\t\t\t         -0.859066,-0.136082,0.493393,-0.946898,0.011780,0.321238,-0.974517,-0.014161,0.223823,-0.948271,0.091128,0.303995,\n\t\t\t         -0.978149,0.096438,0.184149,-0.991272,0.070223,0.111454,-0.974517,-0.014161,0.223823,-0.991272,0.070223,0.111454,\n\t\t\t         -0.974212,0.112888,0.195318,-0.946898,0.011780,0.321238,-0.974517,-0.014161,0.223823,-0.946898,0.011780,0.321238,\n\t\t\t         -0.859066,-0.136082,0.493393,-0.898495,-0.165380,0.406568,-0.974517,-0.014161,0.223823,-0.898495,-0.165380,0.406568,\n\t\t\t         -0.855190,0.009369,0.518204,-0.948271,0.091128,0.303995,-0.983947,0.000610,-0.178289,-0.991028,-0.014252,-0.132847,\n\t\t\t         -0.929746,-0.028382,-0.367016,-0.905209,-0.005097,-0.424879,-0.983947,0.000610,-0.178289,-0.905209,-0.005097,-0.424879,\n\t\t\t         -0.873836,0.117405,-0.471786,-0.971770,0.113681,-0.206580,-0.983947,0.000610,-0.178289,-0.971770,0.113681,-0.206580,\n\t\t\t         -0.987396,0.106876,-0.116581,-0.992523,0.036927,-0.116245,-0.983947,0.000610,-0.178289,-0.992523,0.036927,-0.116245,\n\t\t\t         -0.994690,0.023164,-0.100101,-0.991028,-0.014252,-0.132847,-0.893674,0.213965,0.394330,-0.932401,0.195898,0.303598,\n\t\t\t         -0.927244,0.196142,-0.318918,-0.996185,0.044099,-0.075167,-0.893674,0.213965,0.394330,-0.996185,0.044099,-0.075167,\n\t\t\t         -0.996948,-0.009949,0.077334,-0.788018,0.158513,0.594867,-0.893674,0.213965,0.394330,-0.788018,0.158513,0.594867,\n\t\t\t         -0.892788,0.121677,0.433699,-0.907315,0.191992,0.373974,-0.893674,0.213965,0.394330,-0.907315,0.191992,0.373974,\n\t\t\t         -0.905576,0.174352,0.386608,-0.932401,0.195898,0.303598,-0.998016,0.039064,-0.049318,-0.992523,0.036927,-0.116245,\n\t\t\t         -0.987396,0.106876,-0.116581,-0.996796,0.074923,-0.026826,-0.998016,0.039064,-0.049318,-0.996796,0.074923,-0.026826,\n\t\t\t         -0.978149,0.096438,0.184149,-0.980224,0.073946,0.183447,-0.998016,0.039064,-0.049318,-0.980224,0.073946,0.183447,\n\t\t\t         -0.997040,0.058443,0.049562,-0.997345,0.042421,-0.058718,-0.998016,0.039064,-0.049318,-0.997345,0.042421,-0.058718,\n\t\t\t         -0.994690,0.023164,-0.100101,-0.992523,0.036927,-0.116245,-0.513443,0.794397,0.324412,-0.640797,0.753624,0.146275,\n\t\t\t         -0.718436,0.540086,0.438337,-0.522965,0.501328,0.689291,-0.513443,0.794397,0.324412,-0.522965,0.501328,0.689291,\n\t\t\t         0.015442,0.547288,0.836787,0.010559,0.885281,0.464888,-0.513443,0.794397,0.324412,0.010559,0.885281,0.464888,\n\t\t\t         0.005951,0.979522,0.201117,-0.445479,0.890652,0.090854,-0.513443,0.794397,0.324412,-0.445479,0.890652,0.090854,\n\t\t\t         -0.561785,0.822810,-0.085513,-0.640797,0.753624,0.146275,-0.708243,0.705893,-0.007599,-0.609638,0.756890,-0.235420,\n\t\t\t         -0.773217,0.569018,-0.279824,-0.845149,0.533555,-0.031037,-0.708243,0.705893,-0.007599,-0.845149,0.533555,-0.031037,\n\t\t\t         -0.867183,0.497604,-0.018067,-0.757561,0.652699,-0.004822,-0.708243,0.705893,-0.007599,-0.757561,0.652699,-0.004822,\n\t\t\t         -0.529069,0.847957,0.032350,-0.517441,0.855525,0.017365,-0.708243,0.705893,-0.007599,-0.517441,0.855525,0.017365,\n\t\t\t         -0.404065,0.893429,-0.196142,-0.609638,0.756890,-0.235420,-0.927641,0.368572,-0.060183,-0.845149,0.533555,-0.031037,\n\t\t\t         -0.773217,0.569018,-0.279824,-0.865139,0.383038,-0.323710,-0.927641,0.368572,-0.060183,-0.865139,0.383038,-0.323710,\n\t\t\t         -0.907834,0.223090,-0.355022,-0.972015,0.219611,-0.083102,-0.927641,0.368572,-0.060183,-0.972015,0.219611,-0.083102,\n\t\t\t         -0.974822,0.211554,-0.069979,-0.935118,0.351177,-0.046907,-0.927641,0.368572,-0.060183,-0.935118,0.351177,-0.046907,\n\t\t\t         -0.867183,0.497604,-0.018067,-0.845149,0.533555,-0.031037,0.512436,0.067598,0.856044,0.727195,0.165471,0.666158,\n\t\t\t         0.765435,0.514145,0.386944,0.562944,0.497055,0.660298,0.512436,0.067598,0.856044,0.562944,0.497055,0.660298,\n\t\t\t         0.015442,0.547288,0.836787,0.016175,0.059206,0.998108,0.512436,0.067598,0.856044,0.016175,0.059206,0.998108,\n\t\t\t         0.002411,0.596057,0.802911,0.588122,0.540819,0.601306,0.512436,0.067598,0.856044,0.588122,0.540819,0.601306,\n\t\t\t         0.761071,0.424635,0.490341,0.727195,0.165471,0.666158,-0.952910,0.298776,-0.051607,-0.984252,0.132420,0.116947,\n\t\t\t         -0.988647,0.139866,0.054659,-0.904935,0.422193,-0.052736,-0.952910,0.298776,-0.051607,-0.904935,0.422193,-0.052736,\n\t\t\t         -0.867183,0.497604,-0.018067,-0.935118,0.351177,-0.046907,-0.952910,0.298776,-0.051607,-0.935118,0.351177,-0.046907,\n\t\t\t         -0.974822,0.211554,-0.069979,-0.981994,0.180914,-0.053926,-0.952910,0.298776,-0.051607,-0.981994,0.180914,-0.053926,\n\t\t\t         -0.981414,0.110782,0.156468,-0.984252,0.132420,0.116947,-0.829218,0.555681,-0.059572,-0.710654,0.703085,-0.024171,\n\t\t\t         -0.529069,0.847957,0.032350,-0.757561,0.652699,-0.004822,-0.829218,0.555681,-0.059572,-0.757561,0.652699,-0.004822,\n\t\t\t         -0.867183,0.497604,-0.018067,-0.904935,0.422193,-0.052736,-0.829218,0.555681,-0.059572,-0.904935,0.422193,-0.052736,\n\t\t\t         -0.988647,0.139866,0.054659,-0.894009,0.443556,-0.062960,-0.829218,0.555681,-0.059572,-0.894009,0.443556,-0.062960,\n\t\t\t         -0.781335,0.620838,0.063540,-0.710654,0.703085,-0.024171,-0.566820,0.820582,0.072939,-0.710654,0.703085,-0.024171,\n\t\t\t         -0.781335,0.620838,0.063540,-0.566668,0.801843,0.189398,-0.566820,0.820582,0.072939,-0.566668,0.801843,0.189398,\n\t\t\t         -0.322092,0.914518,0.244636,-0.378765,0.919767,0.102603,-0.566820,0.820582,0.072939,-0.378765,0.919767,0.102603,\n\t\t\t         -0.529069,0.847957,0.032350,-0.710654,0.703085,-0.024171,-0.239570,0.835139,0.495071,-0.087741,0.897580,0.431989,\n\t\t\t         -0.038078,0.876797,0.479351,-0.177068,0.950255,0.256142,-0.239570,0.835139,0.495071,-0.177068,0.950255,0.256142,\n\t\t\t         -0.322092,0.914518,0.244636,-0.287667,0.811274,0.508957,-0.239570,0.835139,0.495071,-0.287667,0.811274,0.508957,\n\t\t\t         -0.074068,0.379742,0.922117,-0.212317,0.328715,0.920225,-0.239570,0.835139,0.495071,-0.212317,0.328715,0.920225,\n\t\t\t         -0.104429,0.370518,0.922936,-0.087741,0.897580,0.431989,-0.776879,0.460646,0.429212,-0.647359,0.636128,0.419782,\n\t\t\t         -0.781335,0.620838,0.063540,-0.897549,0.379955,0.223579,-0.776879,0.460646,0.429212,-0.897549,0.379955,0.223579,\n\t\t\t         -0.781793,-0.113804,0.613025,-0.530168,0.061983,0.845607,-0.776879,0.460646,0.429212,-0.530168,0.061983,0.845607,\n\t\t\t         -0.298715,0.306528,0.903745,-0.647359,0.636128,0.419782,-0.947996,0.307840,0.080691,-0.894009,0.443556,-0.062960,\n\t\t\t         -0.988647,0.139866,0.054659,-0.958953,-0.103061,0.264077,-0.947996,0.307840,0.080691,-0.958953,-0.103061,0.264077,\n\t\t\t         -0.781793,-0.113804,0.613025,-0.897549,0.379955,0.223579,-0.947996,0.307840,0.080691,-0.897549,0.379955,0.223579,\n\t\t\t         -0.781335,0.620838,0.063540,-0.894009,0.443556,-0.062960,-0.475814,0.748802,0.461348,-0.566668,0.801843,0.189398,\n\t\t\t         -0.781335,0.620838,0.063540,-0.647359,0.636128,0.419782,-0.475814,0.748802,0.461348,-0.647359,0.636128,0.419782,\n\t\t\t         -0.298715,0.306528,0.903745,-0.144810,0.404187,0.903134,-0.475814,0.748802,0.461348,-0.144810,0.404187,0.903134,\n\t\t\t         -0.074068,0.379742,0.922117,-0.287667,0.811274,0.508957,-0.475814,0.748802,0.461348,-0.287667,0.811274,0.508957,\n\t\t\t         -0.322092,0.914518,0.244636,-0.566668,0.801843,0.189398,-0.018281,-0.169195,0.985412,-0.042787,-0.296335,0.954100,\n\t\t\t         -0.551256,-0.232917,0.801141,-0.506272,-0.189062,0.841365,-0.400464,-0.191504,0.896054,-0.460646,-0.182684,0.868557,\n\t\t\t         -0.552049,-0.174505,0.815332,-0.399701,-0.151677,0.903989,0.422651,-0.134861,0.896176,0.445906,-0.192846,0.874020,\n\t\t\t         0.248146,-0.157048,0.955901,0.293832,-0.176458,0.939390,0.422651,-0.134861,0.896176,0.293832,-0.176458,0.939390,\n\t\t\t         0.425581,-0.295206,0.855373,0.584948,-0.188299,0.788873,0.422651,-0.134861,0.896176,0.584948,-0.188299,0.788873,\n\t\t\t         0.645955,-0.187658,0.739921,0.445906,-0.192846,0.874020,-0.018281,-0.169195,0.985412,-0.506272,-0.189062,0.841365,\n\t\t\t         -0.460646,-0.182684,0.868557,0.052095,-0.076022,0.995727,-0.506272,-0.189062,0.841365,-0.551256,-0.232917,0.801141,\n\t\t\t         -0.682089,-0.174902,0.710013,-0.626087,-0.162847,0.762535,-0.506272,-0.189062,0.841365,-0.626087,-0.162847,0.762535,\n\t\t\t         -0.552049,-0.174505,0.815332,-0.460646,-0.182684,0.868557,-0.149144,-0.357250,0.921995,-0.052309,-0.087741,0.994751,\n\t\t\t         -0.592639,-0.032502,0.804773,-0.710532,-0.320048,0.626637,-0.001312,-0.529252,0.848445,0.008703,-0.541538,0.840632,\n\t\t\t         0.102850,0.372242,0.922419,0.008979,-0.587725,0.809011,-0.001312,-0.529252,0.848445,0.008979,-0.587725,0.809011,\n\t\t\t         -0.104429,0.370518,0.922936,0.001190,-0.507584,0.861568,-0.001312,-0.529252,0.848445,0.001190,-0.507584,0.861568,\n\t\t\t         -0.000551,-0.433598,0.901106,0.008703,-0.541538,0.840632,-0.097232,-0.386822,0.916990,-0.042787,-0.296335,0.954100,\n\t\t\t         0.095920,-0.311533,0.945372,0.061098,-0.410260,0.909879,-0.097232,-0.386822,0.916990,0.061098,-0.410260,0.909879,\n\t\t\t         0.005860,-0.447676,0.894162,-0.157689,-0.394513,0.905240,-0.176183,-0.404096,0.897549,-0.157689,-0.394513,0.905240,\n\t\t\t         0.005860,-0.447676,0.894162,-0.066073,-0.454176,0.888424,-0.176183,-0.404096,0.897549,-0.066073,-0.454176,0.888424,\n\t\t\t         -0.124668,-0.440443,0.889035,-0.164251,-0.413862,0.895383,-0.149144,-0.357250,0.921995,-0.164251,-0.413862,0.895383,\n\t\t\t         -0.124668,-0.440443,0.889035,0.021210,-0.340434,0.940001,-0.149144,-0.357250,0.921995,0.021210,-0.340434,0.940001,\n\t\t\t         0.018860,-0.032441,0.999268,-0.052309,-0.087741,0.994751,-0.018281,-0.169195,0.985412,0.052095,-0.076022,0.995727,\n\t\t\t         0.195410,-0.058107,0.978973,0.115085,-0.179418,0.976989,-0.018281,-0.169195,0.985412,0.115085,-0.179418,0.976989,\n\t\t\t         0.095920,-0.311533,0.945372,-0.042787,-0.296335,0.954100,-0.278451,0.308878,0.909391,-0.592639,-0.032502,0.804773,\n\t\t\t         -0.052309,-0.087741,0.994751,0.127354,0.295816,0.946684,0.113359,0.451281,0.885153,-0.089105,0.310276,0.946462,\n\t\t\t         -0.010714,0.446333,0.894803,0.143742,0.030580,0.989135,0.047639,0.138096,0.989257,0.467483,0.386761,0.794885,\n\t\t\t         0.442335,0.199164,0.874416,0.143742,0.030580,0.989135,0.442335,0.199164,0.874416,0.195410,-0.058107,0.978973,\n\t\t\t         0.052095,-0.076022,0.995727,-0.027223,0.143498,0.989257,0.047639,0.138096,0.989257,-0.283303,-0.160253,0.945524,\n\t\t\t         -0.117313,-0.144871,0.982452,-0.027223,0.143498,0.989257,-0.117313,-0.144871,0.982452,0.011353,-0.134404,0.990844,\n\t\t\t         0.019196,0.177770,0.983856,-0.027223,0.143498,0.989257,0.019196,0.177770,0.983856,0.002441,0.142644,0.989746,\n\t\t\t         0.155217,0.351665,0.923154,-0.027223,0.143498,0.989257,0.155217,0.351665,0.923154,0.467483,0.386761,0.794885,\n\t\t\t         0.047639,0.138096,0.989257,0.072848,-0.427900,0.900876,0.152776,-0.430921,0.889340,-0.161504,-0.436933,0.884854,\n\t\t\t         -0.161931,-0.418439,0.893674,0.072848,-0.427900,0.900876,-0.161931,-0.418439,0.893674,-0.153325,-0.357677,0.921140,\n\t\t\t         -0.011292,-0.366863,0.930204,0.188513,-0.436659,0.879635,0.182714,-0.429304,0.884457,-0.078677,-0.433058,0.897916,\n\t\t\t         -0.120426,-0.453780,0.882900,0.188513,-0.436659,0.879635,-0.120426,-0.453780,0.882900,-0.161504,-0.436933,0.884854,\n\t\t\t         0.152776,-0.430921,0.889340,0.166082,-0.332286,0.928404,0.160436,-0.040498,0.986206,-0.112918,0.064943,0.991455,\n\t\t\t         -0.153142,-0.279092,0.947966,0.166082,-0.332286,0.928404,-0.153142,-0.279092,0.947966,-0.078677,-0.433058,0.897916,\n\t\t\t         0.182714,-0.429304,0.884457,-0.018189,-0.280526,0.959655,-0.011292,-0.366863,0.930204,-0.153325,-0.357677,0.921140,\n\t\t\t         -0.173711,-0.278207,0.944670,-0.018189,-0.280526,0.959655,-0.173711,-0.278207,0.944670,-0.217353,-0.203589,0.954588,\n\t\t\t         -0.043794,-0.223395,0.973724,-0.460646,-0.182684,0.868557,-0.400464,-0.191504,0.896054,0.143742,0.030580,0.989135,\n\t\t\t         0.052095,-0.076022,0.995727,-0.130467,-0.109592,0.985351,-0.043794,-0.223395,0.973724,-0.217353,-0.203589,0.954588,\n\t\t\t         -0.329691,-0.024201,0.943754,-0.130467,-0.109592,0.985351,-0.329691,-0.024201,0.943754,-0.368053,0.242531,0.897580,\n\t\t\t         -0.079012,0.079897,0.993652,0.010071,0.170385,0.985321,0.019196,0.177770,0.983856,0.011353,-0.134404,0.990844,\n\t\t\t         0.105930,-0.127934,0.986084,0.010071,0.170385,0.985321,0.105930,-0.127934,0.986084,0.248146,-0.157048,0.955901,\n\t\t\t         -0.079012,0.079897,0.993652,0.010071,0.170385,0.985321,-0.079012,0.079897,0.993652,-0.368053,0.242531,0.897580,\n\t\t\t         -0.095462,0.256630,0.961760,0.010071,0.170385,0.985321,-0.095462,0.256630,0.961760,0.002441,0.142644,0.989746,\n\t\t\t         0.019196,0.177770,0.983856,0.124210,-0.498672,0.857814,-0.098086,-0.490616,0.865810,-0.102481,-0.461806,0.881008,\n\t\t\t         0.099796,-0.474288,0.874660,0.124210,-0.498672,0.857814,0.099796,-0.474288,0.874660,-0.161504,-0.436933,0.884854,\n\t\t\t         -0.120426,-0.453780,0.882900,0.124210,-0.498672,0.857814,-0.120426,-0.453780,0.882900,-0.078677,-0.433058,0.897916,\n\t\t\t         0.149632,-0.530045,0.834651,0.124210,-0.498672,0.857814,0.149632,-0.530045,0.834651,-0.091311,-0.542894,0.834803,\n\t\t\t         -0.098086,-0.490616,0.865810,0.083956,-0.441694,0.893216,-0.105441,-0.428694,0.897244,-0.102664,-0.356120,0.928770,\n\t\t\t         0.082492,-0.367504,0.926328,0.083956,-0.441694,0.893216,0.082492,-0.367504,0.926328,-0.153325,-0.357677,0.921140,\n\t\t\t         -0.161931,-0.418439,0.893674,0.083956,-0.441694,0.893216,-0.161931,-0.418439,0.893674,-0.161504,-0.436933,0.884854,\n\t\t\t         0.099796,-0.474288,0.874660,0.083956,-0.441694,0.893216,0.099796,-0.474288,0.874660,-0.102481,-0.461806,0.881008,\n\t\t\t         -0.105441,-0.428694,0.897244,-0.406812,-0.383251,0.829218,0.021210,-0.340434,0.940001,-0.124668,-0.440443,0.889035,\n\t\t\t         -0.420728,-0.447920,0.788873,-0.406812,-0.383251,0.829218,-0.420728,-0.447920,0.788873,-0.504227,-0.088260,0.859004,\n\t\t\t         -0.499557,0.005219,0.866237,-0.406812,-0.383251,0.829218,-0.499557,0.005219,0.866237,0.018860,-0.032441,0.999268,\n\t\t\t         0.021210,-0.340434,0.940001,-0.248085,-0.253517,0.934965,-0.234443,-0.234840,0.943327,-0.069216,-0.236335,0.969176,\n\t\t\t         -0.087100,-0.271828,0.958373,-0.248085,-0.253517,0.934965,-0.087100,-0.271828,0.958373,-0.102664,-0.356120,0.928770,\n\t\t\t         -0.260475,-0.331187,0.906888,-0.248085,-0.253517,0.934965,-0.260475,-0.331187,0.906888,0.095920,-0.311533,0.945372,\n\t\t\t         0.115085,-0.179418,0.976989,-0.248085,-0.253517,0.934965,0.115085,-0.179418,0.976989,0.195410,-0.058107,0.978973,\n\t\t\t         -0.234443,-0.234840,0.943327,-0.004547,-0.075564,0.997101,-0.095462,0.256630,0.961760,-0.368053,0.242531,0.897580,\n\t\t\t         -0.329691,-0.024201,0.943754,-0.004547,-0.075564,0.997101,-0.329691,-0.024201,0.943754,-0.217353,-0.203589,0.954588,\n\t\t\t         0.128208,-0.231758,0.964263,-0.004547,-0.075564,0.997101,0.128208,-0.231758,0.964263,0.002441,0.142644,0.989746,\n\t\t\t         -0.095462,0.256630,0.961760,0.128117,0.104923,0.986175,0.442335,0.199164,0.874416,0.467483,0.386761,0.794885,\n\t\t\t         0.155217,0.351665,0.923154,0.128117,0.104923,0.986175,0.155217,0.351665,0.923154,0.002441,0.142644,0.989746,\n\t\t\t         -0.103488,-0.131993,0.985809,0.128117,0.104923,0.986175,-0.103488,-0.131993,0.985809,0.195410,-0.058107,0.978973,\n\t\t\t         0.442335,0.199164,0.874416,0.134037,-0.256355,0.957213,0.123142,-0.255837,0.958831,-0.069216,-0.236335,0.969176,\n\t\t\t         -0.053774,-0.252602,0.966063,0.134037,-0.256355,0.957213,-0.053774,-0.252602,0.966063,0.002441,0.142644,0.989746,\n\t\t\t         0.128208,-0.231758,0.964263,0.134037,-0.256355,0.957213,0.128208,-0.231758,0.964263,-0.217353,-0.203589,0.954588,\n\t\t\t         0.123142,-0.255837,0.958831,-0.310465,-0.438459,0.843379,-0.066073,-0.454176,0.888424,0.005860,-0.447676,0.894162,\n\t\t\t         -0.289773,-0.416730,0.861568,-0.310465,-0.438459,0.843379,-0.289773,-0.416730,0.861568,-0.102481,-0.461806,0.881008,\n\t\t\t         -0.098086,-0.490616,0.865810,-0.310465,-0.438459,0.843379,-0.098086,-0.490616,0.865810,-0.091311,-0.542894,0.834803,\n\t\t\t         -0.328196,-0.490249,0.807398,-0.310465,-0.438459,0.843379,-0.328196,-0.490249,0.807398,-0.124668,-0.440443,0.889035,\n\t\t\t         -0.066073,-0.454176,0.888424,-0.272896,-0.394452,0.877438,0.061098,-0.410260,0.909879,0.095920,-0.311533,0.945372,\n\t\t\t         -0.260475,-0.331187,0.906888,-0.272896,-0.394452,0.877438,-0.260475,-0.331187,0.906888,-0.102664,-0.356120,0.928770,\n\t\t\t         -0.105441,-0.428694,0.897244,-0.272896,-0.394452,0.877438,-0.105441,-0.428694,0.897244,-0.102481,-0.461806,0.881008,\n\t\t\t         -0.289773,-0.416730,0.861568,-0.272896,-0.394452,0.877438,-0.289773,-0.416730,0.861568,0.005860,-0.447676,0.894162,\n\t\t\t         0.061098,-0.410260,0.909879,0.098514,-0.286905,0.952849,0.123142,-0.255837,0.958831,-0.217353,-0.203589,0.954588,\n\t\t\t         -0.173711,-0.278207,0.944670,0.098514,-0.286905,0.952849,-0.173711,-0.278207,0.944670,-0.153325,-0.357677,0.921140,\n\t\t\t         0.082492,-0.367504,0.926328,0.098514,-0.286905,0.952849,0.082492,-0.367504,0.926328,-0.102664,-0.356120,0.928770,\n\t\t\t         -0.087100,-0.271828,0.958373,0.098514,-0.286905,0.952849,-0.087100,-0.271828,0.958373,-0.069216,-0.236335,0.969176,\n\t\t\t         0.123142,-0.255837,0.958831,-0.225990,-0.251228,0.941160,-0.234443,-0.234840,0.943327,0.195410,-0.058107,0.978973,\n\t\t\t         -0.103488,-0.131993,0.985809,-0.225990,-0.251228,0.941160,-0.103488,-0.131993,0.985809,0.002441,0.142644,0.989746,\n\t\t\t         -0.053774,-0.252602,0.966063,-0.225990,-0.251228,0.941160,-0.053774,-0.252602,0.966063,-0.069216,-0.236335,0.969176,\n\t\t\t         -0.234443,-0.234840,0.943327,0.173864,-0.508591,0.843257,-0.089389,-0.538316,0.837977,-0.091311,-0.542894,0.834803,\n\t\t\t         0.149632,-0.530045,0.834651,0.173864,-0.508591,0.843257,0.149632,-0.530045,0.834651,-0.078677,-0.433058,0.897916,\n\t\t\t         0.274667,-0.439314,0.855281,0.173864,-0.508591,0.843257,0.274667,-0.439314,0.855281,0.357830,-0.054506,0.932157,\n\t\t\t         0.194800,-0.141087,0.970611,0.173864,-0.508591,0.843257,0.194800,-0.141087,0.970611,-0.099094,-0.173315,0.979858,\n\t\t\t         -0.089389,-0.538316,0.837977,0.302438,-0.333537,0.892880,0.393658,0.063082,0.917081,0.357830,-0.054506,0.932157,\n\t\t\t         0.274667,-0.439314,0.855281,0.302438,-0.333537,0.892880,0.274667,-0.439314,0.855281,-0.078677,-0.433058,0.897916,\n\t\t\t         -0.153142,-0.279092,0.947966,0.302438,-0.333537,0.892880,-0.153142,-0.279092,0.947966,-0.112918,0.064943,0.991455,\n\t\t\t         0.393658,0.063082,0.917081,-0.339915,-0.503830,0.794061,-0.420728,-0.447920,0.788873,-0.124668,-0.440443,0.889035,\n\t\t\t         -0.328196,-0.490249,0.807398,-0.339915,-0.503830,0.794061,-0.328196,-0.490249,0.807398,-0.091311,-0.542894,0.834803,\n\t\t\t         -0.089389,-0.538316,0.837977,-0.339915,-0.503830,0.794061,-0.089389,-0.538316,0.837977,-0.099094,-0.173315,0.979858,\n\t\t\t         -0.374706,-0.156560,0.913785,-0.339915,-0.503830,0.794061,-0.374706,-0.156560,0.913785,-0.504227,-0.088260,0.859004,\n\t\t\t         -0.420728,-0.447920,0.788873,-0.455428,0.525834,0.718345,-0.034272,0.483322,0.874752,0.018860,-0.032441,0.999268,\n\t\t\t         -0.499557,0.005219,0.866237,-0.455428,0.525834,0.718345,-0.499557,0.005219,0.866237,-0.504227,-0.088260,0.859004,\n\t\t\t         -0.456374,0.473983,0.752983,-0.455428,0.525834,0.718345,-0.456374,0.473983,0.752983,-0.395573,0.677325,0.620284,\n\t\t\t         -0.396294,0.694607,0.600393,-0.455428,0.525834,0.718345,-0.396294,0.694607,0.600393,-0.165106,0.686859,0.707789,\n\t\t\t         -0.034272,0.483322,0.874752,0.621204,-0.599902,0.504135,0.736991,-0.548601,0.394757,0.994812,0.100497,0.015259,\n\t\t\t         0.945189,-0.085452,0.315073,0.621204,-0.599902,0.504135,0.945189,-0.085452,0.315073,0.727531,-0.014283,0.685903,\n\t\t\t         0.255287,-0.492721,0.831874,0.621204,-0.599902,0.504135,0.255287,-0.492721,0.831874,0.009446,-0.663125,0.748449,\n\t\t\t         0.259836,-0.800343,0.540311,0.621204,-0.599902,0.504135,0.259836,-0.800343,0.540311,0.234857,-0.775122,0.586539,\n\t\t\t         0.736991,-0.548601,0.394757,-0.278451,0.308878,0.909391,-0.461989,0.399976,0.791559,-0.855190,0.009369,0.518204,\n\t\t\t         -0.592639,-0.032502,0.804773,-0.130467,-0.109592,0.985351,-0.079012,0.079897,0.993652,0.248146,-0.157048,0.955901,\n\t\t\t         0.423963,-0.261727,0.867000,0.423963,-0.261727,0.867000,0.248146,-0.157048,0.955901,0.445906,-0.192846,0.874020,\n\t\t\t         -0.278451,0.308878,0.909391,-0.010714,0.446333,0.894803,0.024192,0.561487,0.827132,-0.461989,0.399976,0.791559,\n\t\t\t         0.569597,0.181829,0.801538,0.529466,0.377117,0.759850,0.986541,0.094699,0.133244,0.989349,0.083010,0.119297,\n\t\t\t         0.569597,0.181829,0.801538,0.989349,0.083010,0.119297,0.999329,0.031312,-0.018006,0.995849,0.013947,0.089633,\n\t\t\t         0.569597,0.181829,0.801538,0.995849,0.013947,0.089633,0.998901,0.018342,0.043001,0.624012,-0.171575,0.762291,\n\t\t\t         0.569597,0.181829,0.801538,0.624012,-0.171575,0.762291,-0.131925,-0.149977,0.979848,-0.184858,0.185632,0.965074,\n\t\t\t         0.569597,0.181829,0.801538,-0.184858,0.185632,0.965074,-0.146702,0.402113,0.903761,0.529466,0.377117,0.759850,\n\t\t\t         -0.331828,0.443464,0.832575,-0.456374,0.473983,0.752983,-0.504227,-0.088260,0.859004,-0.374706,-0.156560,0.913785,\n\t\t\t         -0.331828,0.443464,0.832575,-0.374706,-0.156560,0.913785,-0.099094,-0.173315,0.979858,-0.088626,0.440535,0.893307,\n\t\t\t         -0.331828,0.443464,0.832575,-0.088626,0.440535,0.893307,-0.073252,0.696244,0.714058,-0.281126,0.683167,0.673981,\n\t\t\t         -0.331828,0.443464,0.832575,-0.281126,0.683167,0.673981,-0.395573,0.677325,0.620284,-0.456374,0.473983,0.752983,\n\t\t\t         0.367626,0.546983,0.752068,0.328745,0.497604,0.802667,0.357830,-0.054506,0.932157,0.393658,0.063082,0.917081,\n\t\t\t         0.367626,0.546983,0.752068,0.393658,0.063082,0.917081,-0.112918,0.064943,0.991455,-0.032929,0.519700,0.853694,\n\t\t\t         0.367626,0.546983,0.752068,-0.032929,0.519700,0.853694,0.091570,0.688482,0.719450,0.324917,0.698814,0.637250,\n\t\t\t         0.367626,0.546983,0.752068,0.324917,0.698814,0.637250,0.291287,0.691039,0.661526,0.328745,0.497604,0.802667,\n\t\t\t         0.047639,0.138096,0.989257,0.143742,0.030580,0.989135,-0.400464,-0.191504,0.896054,-0.283303,-0.160253,0.945524,\n\t\t\t         0.399152,0.409803,0.820185,0.714591,0.073397,0.695669,0.912534,0.049074,0.405988,0.480758,0.478378,0.734825,\n\t\t\t         0.399152,0.409803,0.820185,0.480758,0.478378,0.734825,-0.037590,0.609889,0.791595,0.036049,0.567330,0.822701,\n\t\t\t         0.533738,-0.239235,0.811090,-0.043794,-0.223395,0.973724,-0.130467,-0.109592,0.985351,0.423963,-0.261727,0.867000,\n\t\t\t         -0.176397,0.971343,0.159215,-0.378765,0.919767,0.102603,-0.322092,0.914518,0.244636,-0.177068,0.950255,0.256142,\n\t\t\t         -0.176397,0.971343,0.159215,-0.177068,0.950255,0.256142,-0.038078,0.876797,0.479351,-0.043794,0.978179,0.203040,\n\t\t\t         -0.176397,0.971343,0.159215,-0.043794,0.978179,0.203040,0.002228,0.985076,0.172063,-0.230506,0.965941,0.117496,\n\t\t\t         -0.176397,0.971343,0.159215,-0.230506,0.965941,0.117496,-0.529069,0.847957,0.032350,-0.378765,0.919767,0.102603,\n\t\t\t         -0.055086,-0.370403,0.927213,0.158116,-0.197058,0.967528,-0.298715,0.306528,0.903745,-0.530168,0.061983,0.845607,\n\t\t\t         -0.055086,-0.370403,0.927213,-0.530168,0.061983,0.845607,-0.781793,-0.113804,0.613025,-0.383251,-0.573016,0.724387,\n\t\t\t         -0.055086,-0.370403,0.927213,-0.383251,-0.573016,0.724387,-0.179169,-0.726085,0.663852,0.134610,-0.503231,0.853603,\n\t\t\t         -0.055086,-0.370403,0.927213,0.134610,-0.503231,0.853603,0.308381,-0.367131,0.877563,0.158116,-0.197058,0.967528,\n\t\t\t         0.523148,0.469436,0.711264,0.480758,0.478378,0.734825,0.912534,0.049074,0.405988,0.958861,0.091159,0.268777,\n\t\t\t         0.523148,0.469436,0.711264,0.958861,0.091159,0.268777,0.986541,0.094699,0.133244,0.529466,0.377117,0.759850,\n\t\t\t         0.523148,0.469436,0.711264,0.529466,0.377117,0.759850,-0.146702,0.402113,0.903761,-0.087233,0.546721,0.832759,\n\t\t\t         0.523148,0.469436,0.711264,-0.087233,0.546721,0.832759,-0.037590,0.609889,0.791595,0.480758,0.478378,0.734825,\n\t\t\t         -0.679556,-0.282388,0.677053,-0.747093,-0.497177,0.441145,-0.988647,0.139866,0.054659,-0.984252,0.132420,0.116947,\n\t\t\t         -0.679556,-0.282388,0.677053,-0.984252,0.132420,0.116947,-0.981414,0.110782,0.156468,-0.562304,0.010254,0.826838,\n\t\t\t         -0.679556,-0.282388,0.677053,-0.562304,0.010254,0.826838,0.061658,-0.042886,0.997176,-0.081465,-0.414076,0.906590,\n\t\t\t         -0.679556,-0.282388,0.677053,-0.081465,-0.414076,0.906590,-0.277094,-0.725593,0.629867,-0.747093,-0.497177,0.441145,\n\t\t\t         0.127354,0.295816,0.946684,-0.052309,-0.087741,0.994751,0.018860,-0.032441,0.999268,-0.034272,0.483322,0.874752,\n\t\t\t         0.127354,0.295816,0.946684,-0.034272,0.483322,0.874752,-0.165106,0.686859,0.707789,0.113359,0.451281,0.885153,\n\t\t\t         -0.140812,0.388623,0.910550,0.160436,-0.040498,0.986206,0.714591,0.073397,0.695669,0.399152,0.409803,0.820185,\n\t\t\t         0.036049,0.567330,0.822701,0.150102,0.433360,0.888633,-0.114919,0.520321,0.846203,-0.061281,-0.263192,0.962767,\n\t\t\t         0.255287,-0.492721,0.831874,0.727531,-0.014283,0.685903,0.474563,0.173498,0.862911,-0.061281,-0.263192,0.962767,\n\t\t\t         0.474563,0.173498,0.862911,0.269539,0.373089,0.887753,-0.221381,-0.121586,0.967559,-0.061281,-0.263192,0.962767,\n\t\t\t         -0.221381,-0.121586,0.967559,-0.362722,-0.257095,0.895732,-0.272108,-0.397122,0.876499,-0.061281,-0.263192,0.962767,\n\t\t\t         -0.272108,-0.397122,0.876499,0.009446,-0.663125,0.748449,0.255287,-0.492721,0.831874,0.711081,-0.442274,0.546556,\n\t\t\t         0.624012,-0.171575,0.762291,0.998901,0.018342,0.043001,0.997497,0.064943,0.027711,0.711081,-0.442274,0.546556,\n\t\t\t         0.997497,0.064943,0.027711,0.994812,0.100497,0.015259,0.736991,-0.548601,0.394757,0.711081,-0.442274,0.546556,\n\t\t\t         0.736991,-0.548601,0.394757,0.234857,-0.775122,0.586539,0.051533,-0.568378,0.821152,0.711081,-0.442274,0.546556,\n\t\t\t         0.051533,-0.568378,0.821152,-0.131925,-0.149977,0.979848,0.624012,-0.171575,0.762291,-0.140812,0.388623,0.910550,\n\t\t\t         -0.032929,0.519700,0.853694,-0.112918,0.064943,0.991455,0.160436,-0.040498,0.986206,-0.399701,-0.151677,0.903989,\n\t\t\t         -0.283303,-0.160253,0.945524,-0.400464,-0.191504,0.896054,-0.140812,0.388623,0.910550,-0.114919,0.520321,0.846203,\n\t\t\t         0.091570,0.688482,0.719450,-0.032929,0.519700,0.853694,0.170904,0.458296,0.872189,-0.088626,0.440535,0.893307,\n\t\t\t         -0.099094,-0.173315,0.979858,0.194800,-0.141087,0.970611,0.170904,0.458296,0.872189,0.194800,-0.141087,0.970611,\n\t\t\t         0.357830,-0.054506,0.932157,0.328745,0.497604,0.802667,0.170904,0.458296,0.872189,0.328745,0.497604,0.802667,\n\t\t\t         0.291287,0.691039,0.661526,0.149100,0.694035,0.704333,0.170904,0.458296,0.872189,0.149100,0.694035,0.704333,\n\t\t\t         -0.073252,0.696244,0.714058,-0.088626,0.440535,0.893307,0.237190,0.847743,0.474380,0.214972,0.334971,0.917356,\n\t\t\t         0.082186,0.383923,0.919675,0.294687,0.817408,0.494949,0.237190,0.847743,0.474380,0.294687,0.817408,0.494949,\n\t\t\t         0.329325,0.913877,0.237373,0.177831,0.950346,0.255318,0.237190,0.847743,0.474380,0.177831,0.950346,0.255318,\n\t\t\t         0.029992,0.876364,0.480714,0.081668,0.903043,0.421644,0.237190,0.847743,0.474380,0.081668,0.903043,0.421644,\n\t\t\t         0.102850,0.372242,0.922419,0.214972,0.334971,0.917356,0.244148,-0.137944,0.959868,0.179571,-0.192236,0.964751,\n\t\t\t         -0.074068,0.379742,0.922117,-0.144810,0.404187,0.903134,0.244148,-0.137944,0.959868,-0.144810,0.404187,0.903134,\n\t\t\t         -0.298715,0.306528,0.903745,0.158116,-0.197058,0.967528,0.244148,-0.137944,0.959868,0.158116,-0.197058,0.967528,\n\t\t\t         0.308381,-0.367131,0.877563,0.355187,-0.320596,0.878100,0.244148,-0.137944,0.959868,0.355187,-0.320596,0.878100,\n\t\t\t         0.231688,-0.356085,0.905276,0.179571,-0.192236,0.964751,-0.665487,-0.613758,0.424696,-0.383251,-0.573016,0.724387,\n\t\t\t         -0.781793,-0.113804,0.613025,-0.958953,-0.103061,0.264077,-0.665487,-0.613758,0.424696,-0.958953,-0.103061,0.264077,\n\t\t\t         -0.988647,0.139866,0.054659,-0.747093,-0.497177,0.441145,-0.665487,-0.613758,0.424696,-0.747093,-0.497177,0.441145,\n\t\t\t         -0.277094,-0.725593,0.629867,-0.351062,-0.808872,0.471680,-0.665487,-0.613758,0.424696,-0.351062,-0.808872,0.471680,\n\t\t\t         -0.179169,-0.726085,0.663852,-0.383251,-0.573016,0.724387,-0.267861,-0.111667,0.956938,-0.221381,-0.121586,0.967559,\n\t\t\t         0.269539,0.373089,0.887753,0.144047,0.423811,0.894192,-0.267861,-0.111667,0.956938,0.144047,0.423811,0.894192,\n\t\t\t         0.082186,0.383923,0.919675,-0.165865,-0.103594,0.980692,-0.267861,-0.111667,0.956938,-0.165865,-0.103594,0.980692,\n\t\t\t         -0.331875,-0.320981,0.887034,-0.377463,-0.261401,0.888364,-0.267861,-0.111667,0.956938,-0.377463,-0.261401,0.888364,\n\t\t\t         -0.362722,-0.257095,0.895732,-0.221381,-0.121586,0.967559,-0.576037,0.204749,0.791345,-0.562304,0.010254,0.826838,\n\t\t\t         -0.981414,0.110782,0.156468,-0.977142,0.104007,0.185247,-0.576037,0.204749,0.791345,-0.977142,0.104007,0.185247,\n\t\t\t         -0.997040,0.058443,0.049562,-0.980224,0.073946,0.183447,-0.576037,0.204749,0.791345,-0.980224,0.073946,0.183447,\n\t\t\t         -0.978149,0.096438,0.184149,-0.534867,0.350200,0.768914,-0.576037,0.204749,0.791345,-0.534867,0.350200,0.768914,\n\t\t\t         0.084596,0.412832,0.906870,0.106173,0.222087,0.969229,-0.576037,0.204749,0.791345,0.106173,0.222087,0.969229,\n\t\t\t         0.061658,-0.042886,0.997176,-0.562304,0.010254,0.826838,-0.538499,0.437544,0.720084,-0.534867,0.350200,0.768914,\n\t\t\t         -0.978149,0.096438,0.184149,-0.948271,0.091128,0.303995,-0.538499,0.437544,0.720084,-0.948271,0.091128,0.303995,\n\t\t\t         -0.855190,0.009369,0.518204,-0.461989,0.399976,0.791559,-0.538499,0.437544,0.720084,-0.461989,0.399976,0.791559,\n\t\t\t         0.024192,0.561487,0.827132,0.036822,0.539644,0.841087,-0.538499,0.437544,0.720084,0.036822,0.539644,0.841087,\n\t\t\t         0.084596,0.412832,0.906870,-0.534867,0.350200,0.768914,0.000824,0.899747,0.436354,0.081668,0.903043,0.421644,\n\t\t\t         0.029992,0.876364,0.480714,0.000117,0.675253,0.737586,0.000824,0.899747,0.436354,0.000117,0.675253,0.737586,\n\t\t\t         -0.038078,0.876797,0.479351,-0.087741,0.897580,0.431989,0.000824,0.899747,0.436354,-0.087741,0.897580,0.431989,\n\t\t\t         -0.104429,0.370518,0.922936,-0.003217,0.995772,0.091803,0.000824,0.899747,0.436354,-0.003217,0.995772,0.091803,\n\t\t\t         0.102850,0.372242,0.922419,0.081668,0.903043,0.421644,0.000305,0.882260,-0.470748,0.021908,0.880853,-0.472883,\n\t\t\t         0.043706,0.949020,-0.312172,-0.000140,0.950147,-0.311803,0.000305,0.882260,-0.470748,-0.000140,0.950147,-0.311803,\n\t\t\t         -0.043007,0.949482,-0.310862,-0.022137,0.883349,-0.468193,0.000305,0.882260,-0.470748,-0.022137,0.883349,-0.468193,\n\t\t\t         -0.000000,0.601100,-0.799174,0.000000,0.599994,-0.799982,0.000305,0.882260,-0.470748,0.000000,0.599994,-0.799982,\n\t\t\t         0.000000,0.599670,-0.800247,0.021908,0.880853,-0.472883,0.000000,0.334727,-0.942289,0.000000,0.334989,-0.942222,\n\t\t\t         0.000000,0.599670,-0.800247,0.000000,0.599994,-0.799982,0.000000,0.334727,-0.942289,0.000000,0.599994,-0.799982,\n\t\t\t         -0.000000,0.601100,-0.799174,0.000000,0.334703,-0.942324,0.000000,0.334727,-0.942289,0.000000,0.334703,-0.942324,\n\t\t\t         0.000001,0.718575,-0.695449,0.000000,0.720695,-0.693197,0.000000,0.334727,-0.942289,0.000000,0.720695,-0.693197,\n\t\t\t         -0.000001,0.720831,-0.693110,0.000000,0.334989,-0.942222,0.000000,0.912534,0.408948,-0.000002,0.907539,0.419967,\n\t\t\t         -0.000001,0.720831,-0.693110,0.000000,0.720695,-0.693197,0.000000,0.912534,0.408948,0.000000,0.720695,-0.693197,\n\t\t\t         0.000001,0.718575,-0.695449,0.000002,0.917140,0.398566,0.000000,0.912534,0.408948,0.000002,0.917140,0.398566,\n\t\t\t         0.000002,0.216153,0.976359,0.000000,0.212989,0.977020,0.000000,0.912534,0.408948,0.000000,0.212989,0.977020,\n\t\t\t         -0.000002,0.208340,0.978056,-0.000002,0.907539,0.419967,0.000000,-0.187231,0.982299,-0.000002,-0.189297,0.981920,\n\t\t\t         -0.000002,0.208340,0.978056,0.000000,0.212989,0.977020,0.000000,-0.187231,0.982299,0.000000,0.212989,0.977020,\n\t\t\t         0.000002,0.216153,0.976359,0.000002,-0.186241,0.982504,0.000000,-0.187231,0.982299,0.000002,-0.186241,0.982504,\n\t\t\t         0.000001,-0.592591,0.805503,0.000000,-0.591571,0.806207,0.000000,-0.187231,0.982299,0.000000,-0.591571,0.806207,\n\t\t\t         -0.000001,-0.591589,0.806240,-0.000002,-0.189297,0.981920,0.000000,-0.882382,0.470473,0.001356,-0.881264,0.472622,\n\t\t\t         -0.000001,-0.591589,0.806240,0.000000,-0.591571,0.806207,0.000000,-0.882382,0.470473,0.000000,-0.591571,0.806207,\n\t\t\t         0.000001,-0.592591,0.805503,-0.001386,-0.883593,0.468253,0.000000,-0.882382,0.470473,-0.001386,-0.883593,0.468253,\n\t\t\t         -0.002695,-0.945184,0.326527,-0.000031,-0.945208,0.326468,0.000000,-0.882382,0.470473,-0.000031,-0.945208,0.326468,\n\t\t\t         0.002723,-0.945226,0.326405,0.001356,-0.881264,0.472622,0.090801,-0.375722,0.922273,-0.165865,-0.103594,0.980692,\n\t\t\t         0.082186,0.383923,0.919675,0.214972,0.334971,0.917356,0.090801,-0.375722,0.922273,0.214972,0.334971,0.917356,\n\t\t\t         0.102850,0.372242,0.922419,0.008703,-0.541538,0.840632,-0.010895,-0.405774,0.913877,0.050572,-0.415350,0.908255,\n\t\t\t         -0.000551,-0.433598,0.901106,0.001190,-0.507584,0.861568,-0.010895,-0.405774,0.913877,0.001190,-0.507584,0.861568,\n\t\t\t         -0.104429,0.370518,0.922936,-0.212317,0.328715,0.920225,-0.010895,-0.405774,0.913877,-0.212317,0.328715,0.920225,\n\t\t\t         -0.074068,0.379742,0.922117,0.179571,-0.192236,0.964751,-0.010895,-0.405774,0.913877,0.179571,-0.192236,0.964751,\n\t\t\t         0.231688,-0.356085,0.905276,0.050572,-0.415350,0.908255,0.344066,-0.938932,-0.000458,0.357707,-0.911466,0.203009,\n\t\t\t         0.002869,-0.975494,0.219977,0.001923,-0.999420,0.033174,0.344066,-0.938932,-0.000458,0.001923,-0.999420,0.033174,\n\t\t\t         -0.000275,-0.902341,-0.431013,0.269448,-0.842952,-0.465590,0.344066,-0.938932,-0.000458,0.269448,-0.842952,-0.465590,\n\t\t\t         0.533738,-0.668264,-0.518174,0.671072,-0.739860,-0.047243,0.344066,-0.938932,-0.000458,0.671072,-0.739860,-0.047243,\n\t\t\t         0.690115,-0.703726,0.168767,0.357707,-0.911466,0.203009,-0.994385,0.088900,-0.057253,-0.977142,0.104007,0.185247,\n\t\t\t         -0.981414,0.110782,0.156468,-0.981994,0.180914,-0.053926,-0.994385,0.088900,-0.057253,-0.981994,0.180914,-0.053926,\n\t\t\t         -0.974822,0.211554,-0.069979,-0.992279,0.089541,-0.085513,-0.994385,0.088900,-0.057253,-0.992279,0.089541,-0.085513,\n\t\t\t         -0.994690,0.023164,-0.100101,-0.997345,0.042421,-0.058718,-0.994385,0.088900,-0.057253,-0.997345,0.042421,-0.058718,\n\t\t\t         -0.997040,0.058443,0.049562,-0.977142,0.104007,0.185247,0.244819,-0.435530,0.866207,0.461623,-0.348094,0.815912,\n\t\t\t         0.560198,-0.657186,-0.504196,0.297037,-0.850368,-0.434278,0.560198,-0.657186,-0.504196,0.461623,-0.348094,0.815912,\n\t\t\t         0.618885,-0.200049,0.759545,0.734642,-0.417554,-0.534715,-0.464187,0.083926,0.881741,0.016175,0.059206,0.998108,\n\t\t\t         0.015442,0.547288,0.836787,-0.522965,0.501328,0.689291,-0.464187,0.083926,0.881741,-0.522965,0.501328,0.689291,\n\t\t\t         -0.718436,0.540086,0.438337,-0.680593,0.202765,0.704031,-0.464187,0.083926,0.881741,-0.680593,0.202765,0.704031,\n\t\t\t         -0.709433,0.472915,0.522507,-0.552171,0.563860,0.614063,-0.464187,0.083926,0.881741,-0.552171,0.563860,0.614063,\n\t\t\t         0.002411,0.596057,0.802911,0.016175,0.059206,0.998108,0.998230,-0.013153,-0.057772,0.996826,-0.016724,0.077609,\n\t\t\t         0.977325,-0.177252,0.115665,0.979858,-0.194464,-0.044801,0.998230,-0.013153,-0.057772,0.979858,-0.194464,-0.044801,\n\t\t\t         0.816095,-0.211097,-0.537950,0.852473,-0.052187,-0.520127,0.998230,-0.013153,-0.057772,0.852473,-0.052187,-0.520127,\n\t\t\t         0.866543,-0.001740,-0.499039,0.994446,0.066683,-0.081149,0.998230,-0.013153,-0.057772,0.994446,0.066683,-0.081149,\n\t\t\t         0.997681,0.057405,0.036256,0.996826,-0.016724,0.077609,0.911405,0.263222,0.316263,0.829188,0.229804,0.509476,\n\t\t\t         0.991974,0.071322,-0.104221,0.971923,0.085696,-0.219092,0.911405,0.263222,0.316263,0.971923,0.085696,-0.219092,\n\t\t\t         0.905240,0.141331,-0.400616,0.951201,0.180334,0.250313,0.911405,0.263222,0.316263,0.951201,0.180334,0.250313,\n\t\t\t         0.934080,0.148015,0.324900,0.916990,0.245613,0.314219,0.911405,0.263222,0.316263,0.916990,0.245613,0.314219,\n\t\t\t         0.898801,0.222816,0.377453,0.829188,0.229804,0.509476,0.802484,0.493149,-0.335826,0.658345,0.701743,-0.272195,\n\t\t\t         0.623646,0.722922,-0.297281,0.776971,0.520280,-0.354350,-0.852168,0.213355,-0.477767,-0.857662,0.220069,-0.464705,\n\t\t\t         -0.848354,0.271615,-0.454390,-0.847224,0.262368,-0.461867,0.894742,0.151463,-0.420057,0.868892,0.304483,-0.390240,\n\t\t\t         0.855678,0.326701,-0.401288,0.887020,0.169073,-0.429609,0.623646,0.722922,-0.297281,0.658345,0.701743,-0.272195,\n\t\t\t         0.477554,0.853359,-0.208960,0.418928,0.876553,-0.236854,-0.404065,0.893429,-0.196142,-0.455184,0.874355,-0.168187,\n\t\t\t         -0.637257,0.740013,-0.215094,-0.609638,0.756890,-0.235420,0.855678,0.326701,-0.401288,0.868892,0.304483,-0.390240,\n\t\t\t         0.802484,0.493149,-0.335826,0.776971,0.520280,-0.354350,-0.792016,-0.322031,-0.518632,-0.804346,-0.307718,-0.508255,\n\t\t\t         -0.708731,-0.493332,-0.504257,-0.690603,-0.495071,-0.527146,-0.609638,0.756890,-0.235420,-0.637257,0.740013,-0.215094,\n\t\t\t         -0.794183,0.546037,-0.266610,-0.773217,0.569018,-0.279824,0.952422,0.087313,0.291940,0.951201,0.180334,0.250313,\n\t\t\t         0.905240,0.141331,-0.400616,0.897916,0.141057,-0.416883,0.952422,0.087313,0.291940,0.897916,0.141057,-0.416883,\n\t\t\t         0.929167,0.143040,-0.340800,0.942869,0.094119,0.319529,0.952422,0.087313,0.291940,0.942869,0.094119,0.319529,\n\t\t\t         0.970824,0.096927,0.219184,0.956145,0.076632,0.282632,0.952422,0.087313,0.291940,0.956145,0.076632,0.282632,\n\t\t\t         0.934080,0.148015,0.324900,0.951201,0.180334,0.250313,0.278451,0.959502,0.042024,0.002045,0.995636,0.093112,\n\t\t\t         0.002228,0.985076,0.172063,0.239143,0.965423,0.103671,0.278451,0.959502,0.042024,0.239143,0.965423,0.103671,\n\t\t\t         0.545793,0.837886,-0.003327,0.534806,0.844234,-0.034852,0.278451,0.959502,0.042024,0.534806,0.844234,-0.034852,\n\t\t\t         0.418928,0.876553,-0.236854,0.223884,0.962432,-0.153569,0.278451,0.959502,0.042024,0.223884,0.962432,-0.153569,\n\t\t\t         0.000336,0.996246,-0.086245,0.002045,0.995636,0.093112,-0.331492,-0.943327,0.015076,0.001923,-0.999420,0.033174,\n\t\t\t         0.002869,-0.975494,0.219977,-0.341594,-0.915891,0.210669,-0.331492,-0.943327,0.015076,-0.341594,-0.915891,0.210669,\n\t\t\t         -0.658925,-0.729240,0.184423,-0.644795,-0.764061,-0.020173,-0.331492,-0.943327,0.015076,-0.644795,-0.764061,-0.020173,\n\t\t\t         -0.518113,-0.691153,-0.503800,-0.264046,-0.849300,-0.457045,-0.331492,-0.943327,0.015076,-0.264046,-0.849300,-0.457045,\n\t\t\t         -0.000275,-0.902341,-0.431013,0.001923,-0.999420,0.033174,-0.925230,0.189398,0.328715,-0.902219,0.249153,0.352000,\n\t\t\t         -0.881405,0.300729,-0.364177,-0.875851,0.282785,-0.391003,-0.925230,0.189398,0.328715,-0.875851,0.282785,-0.391003,\n\t\t\t         -0.927244,0.196142,-0.318918,-0.932401,0.195898,0.303598,-0.925230,0.189398,0.328715,-0.932401,0.195898,0.303598,\n\t\t\t         -0.905576,0.174352,0.386608,-0.912015,0.192816,0.361950,-0.925230,0.189398,0.328715,-0.912015,0.192816,0.361950,\n\t\t\t         -0.914548,0.253273,0.315287,-0.902219,0.249153,0.352000,-0.987243,-0.158147,-0.017853,-0.946074,-0.323893,0.000305,\n\t\t\t         -0.937712,-0.302286,0.171178,-0.975982,-0.158208,0.149724,-0.987243,-0.158147,-0.017853,-0.975982,-0.158208,0.149724,\n\t\t\t         -0.991943,-0.048402,0.117038,-0.997375,-0.048830,-0.053072,-0.987243,-0.158147,-0.017853,-0.997375,-0.048830,-0.053072,\n\t\t\t         -0.862209,-0.107883,-0.494858,-0.844752,-0.175787,-0.505448,-0.987243,-0.158147,-0.017853,-0.844752,-0.175787,-0.505448,\n\t\t\t         -0.792016,-0.322031,-0.518632,-0.946074,-0.323893,0.000305,0.854915,0.059725,-0.515305,0.866146,0.044374,-0.497787,\n\t\t\t         0.877834,-0.060335,-0.475143,0.874416,-0.019257,-0.484756,-0.690603,-0.495071,-0.527146,-0.708731,-0.493332,-0.504257,\n\t\t\t         -0.543321,-0.689474,-0.478896,-0.518113,-0.691153,-0.503800,-0.847224,0.262368,-0.461867,-0.848354,0.271615,-0.454390,\n\t\t\t         -0.861721,0.247810,-0.442671,-0.858821,0.234657,-0.455306,0.874416,-0.019257,-0.484756,0.877834,-0.060335,-0.475143,\n\t\t\t         0.885433,-0.067660,-0.459761,0.896512,-0.039460,-0.441206,0.477554,0.853359,-0.208960,0.237373,0.957671,-0.162664,\n\t\t\t         0.223884,0.962432,-0.153569,0.418928,0.876553,-0.236854,-0.858821,0.234657,-0.455306,-0.861721,0.247810,-0.442671,\n\t\t\t         -0.887478,0.128025,-0.442640,-0.867946,0.107120,-0.484909,0.883663,-0.005860,0.468032,0.879849,-0.204413,0.428968,\n\t\t\t         0.984313,-0.175665,-0.015625,0.996277,0.023133,-0.082980,0.883663,-0.005860,0.468032,0.996277,0.023133,-0.082980,\n\t\t\t         0.975280,0.177007,-0.132176,0.874722,0.131596,0.466353,0.883663,-0.005860,0.468032,0.874722,0.131596,0.466353,\n\t\t\t         0.894864,0.128147,0.427473,0.926359,-0.022065,0.375927,0.883663,-0.005860,0.468032,0.926359,-0.022065,0.375927,\n\t\t\t         0.947142,-0.225288,0.228339,0.879849,-0.204413,0.428968,-0.991333,0.081698,-0.102756,-0.991028,-0.014252,-0.132847,\n\t\t\t         -0.994690,0.023164,-0.100101,-0.992279,0.089541,-0.085513,-0.991333,0.081698,-0.102756,-0.992279,0.089541,-0.085513,\n\t\t\t         -0.974822,0.211554,-0.069979,-0.972015,0.219611,-0.083102,-0.991333,0.081698,-0.102756,-0.972015,0.219611,-0.083102,\n\t\t\t         -0.907834,0.223090,-0.355022,-0.929197,0.076510,-0.361553,-0.991333,0.081698,-0.102756,-0.929197,0.076510,-0.361553,\n\t\t\t         -0.929746,-0.028382,-0.367016,-0.991028,-0.014252,-0.132847,-0.843867,0.021302,0.536119,-0.837397,0.174749,0.517869,\n\t\t\t         -0.962767,0.263833,-0.058443,-0.996521,0.059999,0.057466,-0.843867,0.021302,0.536119,-0.996521,0.059999,0.057466,\n\t\t\t         -0.973876,-0.197699,0.111454,-0.842250,-0.195807,0.502213,-0.843867,0.021302,0.536119,-0.842250,-0.195807,0.502213,\n\t\t\t         -0.923978,-0.215125,0.316172,-0.895993,0.006592,0.443983,-0.843867,0.021302,0.536119,-0.895993,0.006592,0.443983,\n\t\t\t         -0.858119,0.166631,0.485611,-0.837397,0.174749,0.517869,-0.269265,0.960845,0.065157,-0.230506,0.965941,0.117496,\n\t\t\t         0.002228,0.985076,0.172063,0.002045,0.995636,0.093112,-0.269265,0.960845,0.065157,0.002045,0.995636,0.093112,\n\t\t\t         0.000336,0.996246,-0.086245,-0.215827,0.966979,-0.135441,-0.269265,0.960845,0.065157,-0.215827,0.966979,-0.135441,\n\t\t\t         -0.404065,0.893429,-0.196142,-0.517441,0.855525,0.017365,-0.269265,0.960845,0.065157,-0.517441,0.855525,0.017365,\n\t\t\t         -0.529069,0.847957,0.032350,-0.230506,0.965941,0.117496,0.821253,0.116459,0.558519,0.898801,0.222816,0.377453,\n\t\t\t         0.852504,-0.015748,-0.522446,0.853847,-0.038118,-0.519059,0.870785,0.018769,-0.491256,0.852504,-0.015748,-0.522446,\n\t\t\t         0.898801,0.222816,0.377453,0.916990,0.245613,0.314219,-0.552171,0.563860,0.614063,-0.226234,0.963652,-0.141942,\n\t\t\t         0.003174,0.989898,-0.141545,0.002411,0.596057,0.802911,0.003174,0.989898,-0.141545,0.237373,0.957671,-0.162664,\n\t\t\t         0.588122,0.540819,0.601306,0.002411,0.596057,0.802911,0.244819,-0.435530,0.866207,0.297037,-0.850368,-0.434278,\n\t\t\t         0.003265,-0.920316,-0.391095,-0.002411,-0.457137,0.889370,0.003265,-0.920316,-0.391095,-0.286843,-0.862087,-0.417707,\n\t\t\t         -0.240211,-0.430036,0.870235,-0.002411,-0.457137,0.889370,-0.708731,-0.493332,-0.504257,-0.804346,-0.307718,-0.508255,\n\t\t\t         -0.684439,-0.128330,0.717643,-0.583667,-0.254402,0.771081,-0.804346,-0.307718,-0.508255,-0.846034,-0.157933,-0.509171,\n\t\t\t         -0.800317,0.003998,0.599536,-0.684439,-0.128330,0.717643,-0.919034,-0.061037,-0.389325,-0.923978,-0.215125,0.316172,\n\t\t\t         -0.950957,-0.188025,0.245552,-0.907315,-0.040895,-0.418409,-0.919034,-0.061037,-0.389325,-0.929624,0.054170,-0.364483,\n\t\t\t         -0.895993,0.006592,0.443983,-0.923978,-0.215125,0.316172,-0.552171,0.563860,0.614063,-0.709433,0.472915,0.522507,\n\t\t\t         -0.455184,0.874355,-0.168187,-0.226234,0.963652,-0.141942,-0.637257,0.740013,-0.215094,-0.455184,0.874355,-0.168187,\n\t\t\t         -0.709433,0.472915,0.522507,-0.728324,0.460036,0.507767,0.618885,-0.200049,0.759545,0.719108,-0.029267,0.694266,\n\t\t\t         0.827509,-0.186499,-0.529527,0.734642,-0.417554,-0.534715,0.821253,0.116459,0.558519,0.853847,-0.038118,-0.519059,\n\t\t\t         0.827509,-0.186499,-0.529527,0.719108,-0.029267,0.694266,0.867580,0.121006,-0.482315,0.882382,0.085879,-0.462600,\n\t\t\t         0.934080,0.148015,0.324900,0.956145,0.076632,0.282632,0.870785,0.018769,-0.491256,0.916990,0.245613,0.314219,\n\t\t\t         0.934080,0.148015,0.324900,0.882382,0.085879,-0.462600,0.853023,0.105380,-0.511063,0.855129,0.119938,-0.504318,\n\t\t\t         0.970824,0.096927,0.219184,0.980071,0.104404,0.168859,0.867580,0.121006,-0.482315,0.956145,0.076632,0.282632,\n\t\t\t         0.970824,0.096927,0.219184,0.855129,0.119938,-0.504318,0.877834,-0.060335,-0.475143,0.866146,0.044374,-0.497787,\n\t\t\t         0.987548,-0.016694,0.156255,0.963958,-0.214118,0.157750,0.853023,0.105380,-0.511063,0.980071,0.104404,0.168859,\n\t\t\t         0.987548,-0.016694,0.156255,0.866146,0.044374,-0.497787,0.926359,-0.022065,0.375927,0.900296,0.023774,-0.434553,\n\t\t\t         0.885433,-0.067660,-0.459761,0.947142,-0.225288,0.228339,0.877834,-0.060335,-0.475143,0.963958,-0.214118,0.157750,\n\t\t\t         0.947142,-0.225288,0.228339,0.885433,-0.067660,-0.459761,0.774895,0.416791,0.475143,0.761071,0.424635,0.490341,\n\t\t\t         0.477554,0.853359,-0.208960,0.658345,0.701743,-0.272195,0.237373,0.957671,-0.162664,0.477554,0.853359,-0.208960,\n\t\t\t         0.761071,0.424635,0.490341,0.588122,0.540819,0.601306,0.802484,0.493149,-0.335826,0.820032,0.348064,0.454237,\n\t\t\t         0.774895,0.416791,0.475143,0.658345,0.701743,-0.272195,0.868892,0.304483,-0.390240,0.865169,0.246986,0.436354,\n\t\t\t         0.820032,0.348064,0.454237,0.802484,0.493149,-0.335826,-0.286843,-0.862087,-0.417707,-0.543321,-0.689474,-0.478896,\n\t\t\t         -0.438276,-0.355235,0.825617,-0.240211,-0.430036,0.870235,-0.708731,-0.493332,-0.504257,-0.583667,-0.254402,0.771081,\n\t\t\t         -0.438276,-0.355235,0.825617,-0.543321,-0.689474,-0.478896,-0.907315,0.191992,0.373974,-0.892788,0.121677,0.433699,\n\t\t\t         -0.851558,-0.115665,-0.511277,-0.876370,-0.036744,-0.480178,-0.846034,-0.157933,-0.509171,-0.851558,-0.115665,-0.511277,\n\t\t\t         -0.892788,0.121677,0.433699,-0.800317,0.003998,0.599536,-0.912015,0.192816,0.361950,-0.905576,0.174352,0.386608,\n\t\t\t         -0.887478,0.128025,-0.442640,-0.861721,0.247810,-0.442671,-0.887478,0.128025,-0.442640,-0.905576,0.174352,0.386608,\n\t\t\t         -0.907315,0.191992,0.373974,-0.876370,-0.036744,-0.480178,-0.848354,0.271615,-0.454390,-0.914548,0.253273,0.315287,\n\t\t\t         -0.912015,0.192816,0.361950,-0.861721,0.247810,-0.442671,-0.950957,-0.188025,0.245552,-0.967528,0.047090,0.248299,\n\t\t\t         -0.884426,0.106296,-0.454390,-0.907315,-0.040895,-0.418409,-0.884426,0.106296,-0.454390,-0.967528,0.047090,0.248299,\n\t\t\t         -0.938017,0.223121,0.265084,-0.857662,0.220069,-0.464705,-0.794183,0.546037,-0.266610,-0.777093,0.387951,0.495560,\n\t\t\t         -0.824366,0.287942,0.487259,-0.875973,0.362651,-0.318003,-0.824366,0.287942,0.487259,-0.858119,0.166631,0.485611,\n\t\t\t         -0.914579,0.202063,-0.350261,-0.875973,0.362651,-0.318003,-0.929624,0.054170,-0.364483,-0.914579,0.202063,-0.350261,\n\t\t\t         -0.858119,0.166631,0.485611,-0.895993,0.006592,0.443983,-0.929746,-0.028382,-0.367016,-0.919034,-0.061037,-0.389325,\n\t\t\t         -0.907315,-0.040895,-0.418409,-0.905209,-0.005097,-0.424879,0.223884,0.962432,-0.153569,0.237373,0.957671,-0.162664,\n\t\t\t         0.003174,0.989898,-0.141545,0.000336,0.996246,-0.086245,0.866543,-0.001740,-0.499039,0.852504,-0.015748,-0.522446,\n\t\t\t         0.870785,0.018769,-0.491256,0.864437,0.006623,-0.502640,-0.905209,-0.005097,-0.424879,-0.907315,-0.040895,-0.418409,\n\t\t\t         -0.884426,0.106296,-0.454390,-0.873836,0.117405,-0.471786,-0.000275,-0.902341,-0.431013,0.003265,-0.920316,-0.391095,\n\t\t\t         0.297037,-0.850368,-0.434278,0.269448,-0.842952,-0.465590,0.864437,0.006623,-0.502640,0.870785,0.018769,-0.491256,\n\t\t\t         0.882382,0.085879,-0.462600,0.862087,0.068270,-0.502091,-0.564379,-0.214637,0.797082,-0.645802,-0.134373,0.751549,\n\t\t\t         -0.956908,-0.290323,-0.003235,-0.826899,-0.556841,0.078310,-0.564379,-0.214637,0.797082,-0.826899,-0.556841,0.078310,\n\t\t\t         -0.639882,-0.756127,0.137150,-0.436537,-0.297464,0.849055,-0.564379,-0.214637,0.797082,-0.436537,-0.297464,0.849055,\n\t\t\t         -0.438276,-0.355235,0.825617,-0.583667,-0.254402,0.771081,-0.564379,-0.214637,0.797082,-0.583667,-0.254402,0.771081,\n\t\t\t         -0.684439,-0.128330,0.717643,-0.645802,-0.134373,0.751549,0.645924,-0.180059,0.741844,0.488235,-0.303934,0.818049,\n\t\t\t         0.666738,-0.742302,0.066408,0.864406,-0.500961,-0.042634,0.645924,-0.180059,0.741844,0.864406,-0.500961,-0.042634,\n\t\t\t         0.978210,-0.180609,-0.102268,0.719596,-0.058443,0.691885,0.645924,-0.180059,0.741844,0.719596,-0.058443,0.691885,\n\t\t\t         0.719108,-0.029267,0.694266,0.618885,-0.200049,0.759545,0.645924,-0.180059,0.741844,0.618885,-0.200049,0.759545,\n\t\t\t         0.461623,-0.348094,0.815912,0.488235,-0.303934,0.818049,-0.914365,0.211249,0.345347,-0.932188,-0.012848,0.361675,\n\t\t\t         -0.985351,0.077670,-0.151799,-0.878170,0.263192,-0.399396,-0.914365,0.211249,0.345347,-0.878170,0.263192,-0.399396,\n\t\t\t         -0.881405,0.300729,-0.364177,-0.902219,0.249153,0.352000,-0.914365,0.211249,0.345347,-0.902219,0.249153,0.352000,\n\t\t\t         -0.914548,0.253273,0.315287,-0.938017,0.223121,0.265084,-0.914365,0.211249,0.345347,-0.938017,0.223121,0.265084,\n\t\t\t         -0.967528,0.047090,0.248299,-0.932188,-0.012848,0.361675,-0.887478,0.128025,-0.442640,-0.876370,-0.036744,-0.480178,\n\t\t\t         -0.867641,-0.045045,-0.495132,-0.867946,0.107120,-0.484909,0.269448,-0.842952,-0.465590,0.297037,-0.850368,-0.434278,\n\t\t\t         0.560198,-0.657186,-0.504196,0.533738,-0.668264,-0.518174,0.958281,0.103885,0.266243,0.942869,0.094119,0.319529,\n\t\t\t         0.929167,0.143040,-0.340800,0.915342,0.129398,-0.381298,0.958281,0.103885,0.266243,0.915342,0.129398,-0.381298,\n\t\t\t         0.986633,-0.013794,-0.162175,0.955168,-0.078921,0.285257,0.958281,0.103885,0.266243,0.955168,-0.078921,0.285257,\n\t\t\t         0.987548,-0.016694,0.156255,0.980071,0.104404,0.168859,0.958281,0.103885,0.266243,0.980071,0.104404,0.168859,\n\t\t\t         0.970824,0.096927,0.219184,0.942869,0.094119,0.319529,0.859859,0.105319,-0.499496,0.855129,0.119938,-0.504318,\n\t\t\t         0.853023,0.105380,-0.511063,0.850795,0.097201,-0.516373,-0.867641,-0.045045,-0.495132,-0.876370,-0.036744,-0.480178,\n\t\t\t         -0.851558,-0.115665,-0.511277,-0.862209,-0.107883,-0.494858,0.882382,0.085879,-0.462600,0.867580,0.121006,-0.482315,\n\t\t\t         0.866970,0.109531,-0.486160,0.862087,0.068270,-0.502091,0.850795,0.097201,-0.516373,0.853023,0.105380,-0.511063,\n\t\t\t         0.866146,0.044374,-0.497787,0.854915,0.059725,-0.515305,0.003174,0.989898,-0.141545,-0.226234,0.963652,-0.141942,\n\t\t\t         -0.215827,0.966979,-0.135441,0.000336,0.996246,-0.086245,0.866970,0.109531,-0.486160,0.867580,0.121006,-0.482315,\n\t\t\t         0.855129,0.119938,-0.504318,0.859859,0.105319,-0.499496,0.816095,-0.211097,-0.537950,0.827509,-0.186499,-0.529527,\n\t\t\t         0.853847,-0.038118,-0.519059,0.852473,-0.052187,-0.520127,-0.215827,0.966979,-0.135441,-0.226234,0.963652,-0.141942,\n\t\t\t         -0.455184,0.874355,-0.168187,-0.404065,0.893429,-0.196142,-0.543321,-0.689474,-0.478896,-0.286843,-0.862087,-0.417707,\n\t\t\t         -0.264046,-0.849300,-0.457045,-0.518113,-0.691153,-0.503800,0.852473,-0.052187,-0.520127,0.853847,-0.038118,-0.519059,\n\t\t\t         0.852504,-0.015748,-0.522446,0.866543,-0.001740,-0.499039,-0.819117,0.277810,0.501785,-0.772210,0.345439,0.533219,\n\t\t\t         -0.851192,0.522538,0.048952,-0.927061,0.371563,-0.049532,-0.819117,0.277810,0.501785,-0.927061,0.371563,-0.049532,\n\t\t\t         -0.962767,0.263833,-0.058443,-0.837397,0.174749,0.517869,-0.819117,0.277810,0.501785,-0.837397,0.174749,0.517869,\n\t\t\t         -0.858119,0.166631,0.485611,-0.824366,0.287942,0.487259,-0.819117,0.277810,0.501785,-0.824366,0.287942,0.487259,\n\t\t\t         -0.777093,0.387951,0.495560,-0.772210,0.345439,0.533219,0.852290,0.228370,0.470565,0.874722,0.131596,0.466353,\n\t\t\t         0.975280,0.177007,-0.132176,0.951048,0.302713,-0.062044,0.852290,0.228370,0.470565,0.951048,0.302713,-0.062044,\n\t\t\t         0.883175,0.466720,0.046022,0.806269,0.296060,0.512070,0.852290,0.228370,0.470565,0.806269,0.296060,0.512070,\n\t\t\t         0.820032,0.348064,0.454237,0.865169,0.246986,0.436354,0.852290,0.228370,0.470565,0.865169,0.246986,0.436354,\n\t\t\t         0.894864,0.128147,0.427473,0.874722,0.131596,0.466353,0.560198,-0.657186,-0.504196,0.734642,-0.417554,-0.534715,\n\t\t\t         0.720603,-0.432539,-0.541826,0.533738,-0.668264,-0.518174,-0.264046,-0.849300,-0.457045,-0.286843,-0.862087,-0.417707,\n\t\t\t         0.003265,-0.920316,-0.391095,-0.000275,-0.902341,-0.431013,-0.914579,0.202063,-0.350261,-0.929624,0.054170,-0.364483,\n\t\t\t         -0.929197,0.076510,-0.361553,-0.907834,0.223090,-0.355022,0.720603,-0.432539,-0.541826,0.734642,-0.417554,-0.534715,\n\t\t\t         0.827509,-0.186499,-0.529527,0.816095,-0.211097,-0.537950,0.885433,-0.067660,-0.459761,0.900296,0.023774,-0.434553,\n\t\t\t         0.899625,0.038575,-0.434889,0.896512,-0.039460,-0.441206,-0.929197,0.076510,-0.361553,-0.929624,0.054170,-0.364483,\n\t\t\t         -0.919034,-0.061037,-0.389325,-0.929746,-0.028382,-0.367016,-0.224616,-0.335032,0.915036,-0.436537,-0.297464,0.849055,\n\t\t\t         -0.639882,-0.756127,0.137150,-0.342448,-0.915159,0.212470,-0.224616,-0.335032,0.915036,-0.342448,-0.915159,0.212470,\n\t\t\t         0.001526,-0.972259,0.233863,0.004425,-0.349406,0.936949,-0.224616,-0.335032,0.915036,0.004425,-0.349406,0.936949,\n\t\t\t         -0.002411,-0.457137,0.889370,-0.240211,-0.430036,0.870235,-0.224616,-0.335032,0.915036,-0.240211,-0.430036,0.870235,\n\t\t\t         -0.438276,-0.355235,0.825617,-0.436537,-0.297464,0.849055,0.245766,-0.348033,0.904660,0.004425,-0.349406,0.936949,\n\t\t\t         0.001526,-0.972259,0.233863,0.354442,-0.916776,0.183935,0.245766,-0.348033,0.904660,0.354442,-0.916776,0.183935,\n\t\t\t         0.666738,-0.742302,0.066408,0.488235,-0.303934,0.818049,0.245766,-0.348033,0.904660,0.488235,-0.303934,0.818049,\n\t\t\t         0.461623,-0.348094,0.815912,0.244819,-0.435530,0.866207,0.245766,-0.348033,0.904660,0.244819,-0.435530,0.866207,\n\t\t\t         -0.002411,-0.457137,0.889370,0.004425,-0.349406,0.936949,-0.713004,-0.001373,0.701132,-0.788018,0.158513,0.594867,\n\t\t\t         -0.996948,-0.009949,0.077334,-0.995483,-0.090213,0.029511,-0.713004,-0.001373,0.701132,-0.995483,-0.090213,0.029511,\n\t\t\t         -0.956908,-0.290323,-0.003235,-0.645802,-0.134373,0.751549,-0.713004,-0.001373,0.701132,-0.645802,-0.134373,0.751549,\n\t\t\t         -0.684439,-0.128330,0.717643,-0.800317,0.003998,0.599536,-0.713004,-0.001373,0.701132,-0.800317,0.003998,0.599536,\n\t\t\t         -0.892788,0.121677,0.433699,-0.788018,0.158513,0.594867,0.762688,0.096927,0.639424,0.719596,-0.058443,0.691885,\n\t\t\t         0.978210,-0.180609,-0.102268,0.991943,0.028474,-0.123356,0.762688,0.096927,0.639424,0.991943,0.028474,-0.123356,\n\t\t\t         0.991974,0.071322,-0.104221,0.829188,0.229804,0.509476,0.762688,0.096927,0.639424,0.829188,0.229804,0.509476,\n\t\t\t         0.898801,0.222816,0.377453,0.821253,0.116459,0.558519,0.762688,0.096927,0.639424,0.821253,0.116459,0.558519,\n\t\t\t         0.719108,-0.029267,0.694266,0.719596,-0.058443,0.691885,0.977660,0.040681,-0.206091,0.983367,0.038026,-0.177404,\n\t\t\t         0.983215,0.011658,-0.182012,0.972900,-0.023347,-0.230018,0.977660,0.040681,-0.206091,0.972900,-0.023347,-0.230018,\n\t\t\t         0.896512,-0.039460,-0.441206,0.899625,0.038575,-0.434889,0.977660,0.040681,-0.206091,0.899625,0.038575,-0.434889,\n\t\t\t         0.887020,0.169073,-0.429609,0.967315,0.164586,-0.192877,0.977660,0.040681,-0.206091,0.967315,0.164586,-0.192877,\n\t\t\t         0.973388,0.150304,-0.172796,0.983367,0.038026,-0.177404,0.926359,-0.022065,0.375927,0.894864,0.128147,0.427473,\n\t\t\t         0.894742,0.151463,-0.420057,0.900296,0.023774,-0.434553,0.868892,0.304483,-0.390240,0.894742,0.151463,-0.420057,\n\t\t\t         0.894864,0.128147,0.427473,0.865169,0.246986,0.436354,0.899625,0.038575,-0.434889,0.900296,0.023774,-0.434553,\n\t\t\t         0.894742,0.151463,-0.420057,0.887020,0.169073,-0.429609,0.961364,-0.007782,-0.275124,0.874416,-0.019257,-0.484756,\n\t\t\t         0.896512,-0.039460,-0.441206,0.972900,-0.023347,-0.230018,0.961364,-0.007782,-0.275124,0.972900,-0.023347,-0.230018,\n\t\t\t         0.983215,0.011658,-0.182012,0.979217,0.040773,-0.198553,0.961364,-0.007782,-0.275124,0.979217,0.040773,-0.198553,\n\t\t\t         0.975585,0.058351,-0.211615,0.949980,0.054231,-0.307535,0.961364,-0.007782,-0.275124,0.949980,0.054231,-0.307535,\n\t\t\t         0.854915,0.059725,-0.515305,0.874416,-0.019257,-0.484756,0.991913,0.056032,-0.113742,0.992981,0.048250,-0.107944,\n\t\t\t         0.975585,0.058351,-0.211615,0.979217,0.040773,-0.198553,0.991913,0.056032,-0.113742,0.979217,0.040773,-0.198553,\n\t\t\t         0.983215,0.011658,-0.182012,0.991974,0.024537,-0.123997,0.991913,0.056032,-0.113742,0.991974,0.024537,-0.123997,\n\t\t\t         0.999329,0.031312,-0.018006,0.989349,0.083010,0.119297,0.991913,0.056032,-0.113742,0.989349,0.083010,0.119297,\n\t\t\t         0.986541,0.094699,0.133244,0.992981,0.048250,-0.107944,0.990631,0.019684,-0.135014,0.995849,0.013947,0.089633,\n\t\t\t         0.999329,0.031312,-0.018006,0.991974,0.024537,-0.123997,0.990631,0.019684,-0.135014,0.991974,0.024537,-0.123997,\n\t\t\t         0.983215,0.011658,-0.182012,0.983367,0.038026,-0.177404,0.990631,0.019684,-0.135014,0.983367,0.038026,-0.177404,\n\t\t\t         0.973388,0.150304,-0.172796,0.983856,0.110019,-0.141057,0.990631,0.019684,-0.135014,0.983856,0.110019,-0.141057,\n\t\t\t         0.998901,0.018342,0.043001,0.995849,0.013947,0.089633,-0.938017,0.223121,0.265084,-0.914548,0.253273,0.315287,\n\t\t\t         -0.848354,0.271615,-0.454390,-0.857662,0.220069,-0.464705,-0.637257,0.740013,-0.215094,-0.728324,0.460036,0.507767,\n\t\t\t         -0.777093,0.387951,0.495560,-0.794183,0.546037,-0.266610,-0.794183,0.546037,-0.266610,-0.875973,0.362651,-0.318003,\n\t\t\t         -0.865139,0.383038,-0.323710,-0.773217,0.569018,-0.279824,-0.971587,-0.219153,-0.089145,-0.956023,-0.233039,-0.177984,\n\t\t\t         -0.687765,-0.201422,-0.697378,-0.955657,-0.138371,-0.259835,-0.971587,-0.219153,-0.089145,-0.968902,-0.244209,0.039796,\n\t\t\t         -0.984313,-0.175665,-0.015625,-0.956023,-0.233039,-0.177984,-0.971587,-0.219153,-0.089145,-0.955657,-0.138371,-0.259835,\n\t\t\t         -0.986633,-0.013794,-0.162175,-0.968902,-0.244209,0.039796,-0.735557,-0.551256,-0.393719,-0.864406,-0.500961,-0.042634,\n\t\t\t         -0.978210,-0.180609,-0.102268,-0.805414,-0.413282,-0.424787,-0.735557,-0.551256,-0.393719,-0.562304,-0.749596,-0.349071,\n\t\t\t         -0.666738,-0.742302,0.066408,-0.864406,-0.500961,-0.042634,-0.735557,-0.551256,-0.393719,-0.472335,-0.553697,-0.685781,\n\t\t\t         -0.426862,-0.688711,-0.586016,-0.562304,-0.749596,-0.349071,-0.735557,-0.551256,-0.393719,-0.805414,-0.413282,-0.424787,\n\t\t\t         -0.478622,-0.428938,-0.766076,-0.472335,-0.553697,-0.685781,-0.799951,-0.271615,-0.535020,-0.805414,-0.413282,-0.424787,\n\t\t\t         -0.978210,-0.180609,-0.102268,-0.875790,-0.102023,-0.471725,-0.799951,-0.271615,-0.535020,-0.462691,-0.262368,-0.846797,\n\t\t\t         -0.478622,-0.428938,-0.766076,-0.805414,-0.413282,-0.424787,-0.799951,-0.271615,-0.535020,-0.875790,-0.102023,-0.471725,\n\t\t\t         -0.473037,-0.120243,-0.872768,-0.462691,-0.262368,-0.846797,-0.927091,0.301859,-0.222144,-0.912412,0.236732,-0.333781,\n\t\t\t         -0.975280,0.177007,-0.132176,-0.951048,0.302713,-0.062044,-0.927091,0.301859,-0.222144,-0.889523,0.372173,-0.264931,\n\t\t\t         -0.627918,0.278664,-0.726646,-0.912412,0.236732,-0.333781,-0.927091,0.301859,-0.222144,-0.951048,0.302713,-0.062044,\n\t\t\t         -0.883175,0.466720,0.046022,-0.889523,0.372173,-0.264931,-0.679098,0.130924,-0.722251,-0.915342,0.129398,-0.381298,\n\t\t\t         -0.986633,-0.013794,-0.162175,-0.733726,0.054231,-0.677236,-0.679098,0.130924,-0.722251,-0.897916,0.141057,-0.416883,\n\t\t\t         -0.929167,0.143040,-0.340800,-0.915342,0.129398,-0.381298,-0.679098,0.130924,-0.722251,-0.588946,0.156041,-0.792932,\n\t\t\t         -0.905240,0.141331,-0.400616,-0.897916,0.141057,-0.416883,-0.679098,0.130924,-0.722251,-0.733726,0.054231,-0.677236,\n\t\t\t         -0.374035,0.083621,-0.923612,-0.588946,0.156041,-0.792932,-0.888424,0.166875,-0.427595,-0.912412,0.236732,-0.333781,\n\t\t\t         -0.627918,0.278664,-0.726646,-0.566698,0.095370,-0.818354,-0.888424,0.166875,-0.427595,-0.933500,0.100833,-0.344035,\n\t\t\t         -0.975280,0.177007,-0.132176,-0.912412,0.236732,-0.333781,-0.888424,0.166875,-0.427595,-0.566698,0.095370,-0.818354,\n\t\t\t         -0.638844,-0.061251,-0.766869,-0.933500,0.100833,-0.344035,-0.719138,0.679861,-0.143529,-0.746147,0.664846,-0.034547,\n\t\t\t         -0.595874,0.797327,-0.095798,-0.562273,0.779229,-0.276772,-0.719138,0.679861,-0.143529,-0.777276,0.598132,-0.195044,\n\t\t\t         -0.883175,0.466720,0.046022,-0.746147,0.664846,-0.034547,-0.719138,0.679861,-0.143529,-0.562273,0.779229,-0.276772,\n\t\t\t         -0.525254,0.733421,-0.431440,-0.777276,0.598132,-0.195044,-0.176855,0.506668,-0.843776,-0.239174,0.747948,-0.619129,\n\t\t\t         0.002228,0.740104,-0.672445,0.002991,0.489242,-0.872127,-0.176855,0.506668,-0.843776,-0.528794,0.536027,-0.658010,\n\t\t\t         -0.525254,0.733421,-0.431440,-0.239174,0.747948,-0.619129,-0.176855,0.506668,-0.843776,-0.150822,0.197546,-0.968596,\n\t\t\t         -0.627918,0.278664,-0.726646,-0.528794,0.536027,-0.658010,-0.176855,0.506668,-0.843776,0.002991,0.489242,-0.872127,\n\t\t\t         0.001190,0.178961,-0.983825,-0.150822,0.197546,-0.968596,-0.894375,-0.044527,-0.445051,-0.491256,-0.044588,-0.869839,\n\t\t\t         -0.374035,0.083621,-0.923612,-0.733726,0.054231,-0.677236,-0.894375,-0.044527,-0.445051,-0.955657,-0.138371,-0.259835,\n\t\t\t         -0.687765,-0.201422,-0.697378,-0.491256,-0.044588,-0.869839,-0.894375,-0.044527,-0.445051,-0.733726,0.054231,-0.677236,\n\t\t\t         -0.986633,-0.013794,-0.162175,-0.955657,-0.138371,-0.259835,-0.975372,0.021943,-0.219428,-0.996277,0.023133,-0.082980,\n\t\t\t         -0.975280,0.177007,-0.132176,-0.933500,0.100833,-0.344035,-0.975372,0.021943,-0.219428,-0.951506,-0.069033,-0.299722,\n\t\t\t         -0.984313,-0.175665,-0.015625,-0.996277,0.023133,-0.082980,-0.975372,0.021943,-0.219428,-0.933500,0.100833,-0.344035,\n\t\t\t         -0.638844,-0.061251,-0.766869,-0.951506,-0.069033,-0.299722,-0.791711,0.516343,-0.326426,-0.889523,0.372173,-0.264931,\n\t\t\t         -0.883175,0.466720,0.046022,-0.777276,0.598132,-0.195044,-0.791711,0.516343,-0.326426,-0.528794,0.536027,-0.658010,\n\t\t\t         -0.627918,0.278664,-0.726646,-0.889523,0.372173,-0.264931,-0.791711,0.516343,-0.326426,-0.777276,0.598132,-0.195044,\n\t\t\t         -0.525254,0.733421,-0.431440,-0.528794,0.536027,-0.658010,-0.323588,0.846919,-0.421857,-0.370312,0.898373,-0.236122,\n\t\t\t         -0.002655,0.957488,-0.288369,-0.000671,0.874386,-0.485153,-0.323588,0.846919,-0.421857,-0.562273,0.779229,-0.276772,\n\t\t\t         -0.595874,0.797327,-0.095798,-0.370312,0.898373,-0.236122,-0.323588,0.846919,-0.421857,-0.239174,0.747948,-0.619129,\n\t\t\t         -0.525254,0.733421,-0.431440,-0.562273,0.779229,-0.276772,-0.323588,0.846919,-0.421857,-0.000671,0.874386,-0.485153,\n\t\t\t         0.002228,0.740104,-0.672445,-0.239174,0.747948,-0.619129,-0.909635,-0.169347,-0.379284,-0.956023,-0.233039,-0.177984,\n\t\t\t         -0.984313,-0.175665,-0.015625,-0.951506,-0.069033,-0.299722,-0.909635,-0.169347,-0.379284,-0.603992,-0.226478,-0.764092,\n\t\t\t         -0.687765,-0.201422,-0.697378,-0.956023,-0.233039,-0.177984,-0.909635,-0.169347,-0.379284,-0.951506,-0.069033,-0.299722,\n\t\t\t         -0.638844,-0.061251,-0.766869,-0.603992,-0.226478,-0.764092,-0.138981,0.012879,-0.990204,-0.150822,0.197546,-0.968596,\n\t\t\t         0.001190,0.178961,-0.983825,0.000427,-0.005615,-0.999969,-0.138981,0.012879,-0.990204,-0.566698,0.095370,-0.818354,\n\t\t\t         -0.627918,0.278664,-0.726646,-0.150822,0.197546,-0.968596,-0.138981,0.012879,-0.990204,-0.148228,-0.123203,-0.981231,\n\t\t\t         -0.638844,-0.061251,-0.766869,-0.566698,0.095370,-0.818354,-0.138981,0.012879,-0.990204,0.000427,-0.005615,-0.999969,\n\t\t\t         0.000305,-0.126011,-0.992004,-0.148228,-0.123203,-0.981231,-0.206824,-0.222205,-0.952788,-0.148228,-0.123203,-0.981231,\n\t\t\t         0.000305,-0.126011,-0.992004,-0.000031,-0.200446,-0.979675,-0.206824,-0.222205,-0.952788,-0.603992,-0.226478,-0.764092,\n\t\t\t         -0.638844,-0.061251,-0.766869,-0.148228,-0.123203,-0.981231,-0.206824,-0.222205,-0.952788,-0.211158,-0.163915,-0.963591,\n\t\t\t         -0.687765,-0.201422,-0.697378,-0.603992,-0.226478,-0.764092,-0.206824,-0.222205,-0.952788,-0.000031,-0.200446,-0.979675,\n\t\t\t         -0.003479,-0.153630,-0.988098,-0.211158,-0.163915,-0.963591,-0.165441,-0.052705,-0.984802,-0.211158,-0.163915,-0.963591,\n\t\t\t         -0.003479,-0.153630,-0.988098,-0.001831,-0.041597,-0.999115,-0.165441,-0.052705,-0.984802,-0.491256,-0.044588,-0.869839,\n\t\t\t         -0.687765,-0.201422,-0.697378,-0.211158,-0.163915,-0.963591,-0.165441,-0.052705,-0.984802,-0.137944,0.058351,-0.988708,\n\t\t\t         -0.374035,0.083621,-0.923612,-0.491256,-0.044588,-0.869839,-0.165441,-0.052705,-0.984802,-0.001831,-0.041597,-0.999115,\n\t\t\t         0.000977,0.068484,-0.997650,-0.137944,0.058351,-0.988708,-0.148015,-0.051302,-0.987640,-0.140294,0.044069,-0.989105,\n\t\t\t         0.004028,0.038209,-0.999237,0.002136,-0.068575,-0.997620,-0.148015,-0.051302,-0.987640,-0.506882,-0.019898,-0.861751,\n\t\t\t         -0.477187,0.025452,-0.878414,-0.140294,0.044069,-0.989105,-0.148015,-0.051302,-0.987640,-0.151585,-0.135716,-0.979064,\n\t\t\t         -0.473037,-0.120243,-0.872768,-0.506882,-0.019898,-0.861751,-0.148015,-0.051302,-0.987640,0.002136,-0.068575,-0.997620,\n\t\t\t         -0.000610,-0.152898,-0.988220,-0.151585,-0.135716,-0.979064,-0.156041,-0.245338,-0.956786,-0.151585,-0.135716,-0.979064,\n\t\t\t         -0.000610,-0.152898,-0.988220,-0.001801,-0.246651,-0.969085,-0.156041,-0.245338,-0.956786,-0.462691,-0.262368,-0.846797,\n\t\t\t         -0.473037,-0.120243,-0.872768,-0.151585,-0.135716,-0.979064,-0.156041,-0.245338,-0.956786,-0.167333,-0.370434,-0.913633,\n\t\t\t         -0.478622,-0.428938,-0.766076,-0.462691,-0.262368,-0.846797,-0.156041,-0.245338,-0.956786,-0.001801,-0.246651,-0.969085,\n\t\t\t         -0.001099,-0.356945,-0.934111,-0.167333,-0.370434,-0.913633,-0.180639,-0.519028,-0.835414,-0.167333,-0.370434,-0.913633,\n\t\t\t         -0.001099,-0.356945,-0.934111,-0.000183,-0.511765,-0.859096,-0.180639,-0.519028,-0.835414,-0.472335,-0.553697,-0.685781,\n\t\t\t         -0.478622,-0.428938,-0.766076,-0.167333,-0.370434,-0.913633,-0.180639,-0.519028,-0.835414,-0.215949,-0.742851,-0.633625,\n\t\t\t         -0.426862,-0.688711,-0.586016,-0.472335,-0.553697,-0.685781,-0.180639,-0.519028,-0.835414,-0.000183,-0.511765,-0.859096,\n\t\t\t         0.000214,-0.765862,-0.642964,-0.215949,-0.742851,-0.633625,-0.285867,-0.904691,-0.315897,-0.215949,-0.742851,-0.633625,\n\t\t\t         0.000214,-0.765862,-0.642964,-0.000061,-0.953551,-0.301187,-0.285867,-0.904691,-0.315897,-0.562304,-0.749596,-0.349071,\n\t\t\t         -0.426862,-0.688711,-0.586016,-0.215949,-0.742851,-0.633625,-0.285867,-0.904691,-0.315897,-0.354442,-0.916776,0.183905,\n\t\t\t         -0.666738,-0.742302,0.066408,-0.562304,-0.749596,-0.349071,-0.285867,-0.904691,-0.315897,-0.000061,-0.953551,-0.301187,\n\t\t\t         -0.001526,-0.972259,0.233863,-0.354442,-0.916776,0.183905,-0.133244,0.105533,-0.985443,-0.137944,0.058351,-0.988708,\n\t\t\t         0.000977,0.068484,-0.997650,0.003113,0.110263,-0.993866,-0.133244,0.105533,-0.985443,-0.308939,0.123173,-0.943052,\n\t\t\t         -0.374035,0.083621,-0.923612,-0.137944,0.058351,-0.988708,-0.133244,0.105533,-0.985443,-0.140294,0.044069,-0.989105,\n\t\t\t         -0.477187,0.025452,-0.878414,-0.308939,0.123173,-0.943052,-0.133244,0.105533,-0.985443,0.003113,0.110263,-0.993866,\n\t\t\t         0.004028,0.038209,-0.999237,-0.140294,0.044069,-0.989105,-0.905515,-0.000214,-0.424268,-0.899686,0.006256,-0.436445,\n\t\t\t         -0.978210,-0.180609,-0.102268,-0.991943,0.028474,-0.123356,-0.905515,-0.000214,-0.424268,-0.756493,0.051027,-0.651967,\n\t\t\t         -0.477187,0.025452,-0.878414,-0.899686,0.006256,-0.436445,-0.905515,-0.000214,-0.424268,-0.971923,0.085696,-0.219092,\n\t\t\t         -0.905240,0.141331,-0.400616,-0.756493,0.051027,-0.651967,-0.905515,-0.000214,-0.424268,-0.991943,0.028474,-0.123356,\n\t\t\t         -0.991974,0.071322,-0.104221,-0.971923,0.085696,-0.219092,-0.602496,0.138829,-0.785943,-0.308939,0.123173,-0.943052,\n\t\t\t         -0.477187,0.025452,-0.878414,-0.756493,0.051027,-0.651967,-0.602496,0.138829,-0.785943,-0.588946,0.156041,-0.792932,\n\t\t\t         -0.374035,0.083621,-0.923612,-0.308939,0.123173,-0.943052,-0.602496,0.138829,-0.785943,-0.756493,0.051027,-0.651967,\n\t\t\t         -0.905240,0.141331,-0.400616,-0.588946,0.156041,-0.792932,-0.854854,-0.023743,-0.518296,-0.875790,-0.102023,-0.471725,\n\t\t\t         -0.978210,-0.180609,-0.102268,-0.899686,0.006256,-0.436445,-0.854854,-0.023743,-0.518296,-0.506882,-0.019898,-0.861751,\n\t\t\t         -0.473037,-0.120243,-0.872768,-0.875790,-0.102023,-0.471725,-0.854854,-0.023743,-0.518296,-0.899686,0.006256,-0.436445,\n\t\t\t         -0.477187,0.025452,-0.878414,-0.506882,-0.019898,-0.861751,-0.368694,0.926176,-0.078982,-0.370312,0.898373,-0.236122,\n\t\t\t         -0.595874,0.797327,-0.095798,-0.470229,0.879574,0.072207,-0.368694,0.926176,-0.078982,-0.004089,0.999603,-0.027192,\n\t\t\t         -0.002655,0.957488,-0.288369,-0.370312,0.898373,-0.236122,-0.368694,0.926176,-0.078982,-0.470229,0.879574,0.072207,\n\t\t\t         -0.005951,0.979522,0.201117,-0.004089,0.999603,-0.027192,-0.730338,0.678030,0.082553,-0.797662,0.530534,0.286721,\n\t\t\t         -0.765435,0.514145,0.386944,-0.682485,0.721610,0.116031,-0.730338,0.678030,0.082553,-0.746147,0.664846,-0.034547,\n\t\t\t         -0.883175,0.466720,0.046022,-0.797662,0.530534,0.286721,-0.730338,0.678030,0.082553,-0.682485,0.721610,0.116031,\n\t\t\t         -0.595874,0.797327,-0.095798,-0.746147,0.664846,-0.034547,-0.357585,-0.864620,0.352855,-0.357707,-0.911466,0.203009,\n\t\t\t         -0.002869,-0.975494,0.219977,-0.001709,-0.932249,0.361736,-0.357585,-0.864620,0.352855,-0.682394,-0.653218,0.328013,\n\t\t\t         -0.690115,-0.703726,0.168767,-0.357707,-0.911466,0.203009,-0.357585,-0.864620,0.352855,-0.341685,-0.771416,0.536790,\n\t\t\t         -0.651173,-0.574114,0.496323,-0.682394,-0.653218,0.328013,-0.357585,-0.864620,0.352855,-0.001709,-0.932249,0.361736,\n\t\t\t         -0.000061,-0.829218,0.558885,-0.341685,-0.771416,0.536790,-0.282601,-0.596851,0.750908,0.000824,-0.624928,0.780633,\n\t\t\t         -0.000458,-0.370739,0.928709,-0.193762,-0.363201,0.911313,-0.282601,-0.596851,0.750908,-0.341685,-0.771416,0.536790,\n\t\t\t         -0.000061,-0.829218,0.558885,0.000824,-0.624928,0.780633,-0.282601,-0.596851,0.750908,-0.566881,-0.455550,0.686361,\n\t\t\t         -0.651173,-0.574114,0.496323,-0.341685,-0.771416,0.536790,-0.282601,-0.596851,0.750908,-0.193762,-0.363201,0.911313,\n\t\t\t         -0.425581,-0.295206,0.855373,-0.566881,-0.455550,0.686361,0.862209,-0.107883,-0.494858,0.844752,-0.175787,-0.505448,\n\t\t\t         0.846034,-0.157933,-0.509171,0.851558,-0.115665,-0.511277,0.865139,0.383038,-0.323710,0.907834,0.223090,-0.355022,\n\t\t\t         0.914579,0.202063,-0.350261,0.875973,0.362651,-0.318003,-0.132817,-0.208869,0.968871,-0.193762,-0.363201,0.911313,\n\t\t\t         -0.000458,-0.370739,0.928709,-0.004273,-0.217627,0.976012,-0.132817,-0.208869,0.968871,-0.293832,-0.176458,0.939390,\n\t\t\t         -0.425581,-0.295206,0.855373,-0.193762,-0.363201,0.911313,-0.132817,-0.208869,0.968871,-0.105930,-0.127934,0.986084,\n\t\t\t         -0.248146,-0.157048,0.955901,-0.293832,-0.176458,0.939390,-0.132817,-0.208869,0.968871,-0.004273,-0.217627,0.976012,\n\t\t\t         -0.011353,-0.134404,0.990844,-0.105930,-0.127934,0.986084,-0.875851,-0.383435,0.292947,-0.896146,-0.420850,0.140568,\n\t\t\t         -0.690115,-0.703726,0.168767,-0.682394,-0.653218,0.328013,-0.875851,-0.383435,0.292947,-0.951323,-0.169805,0.257118,\n\t\t\t         -0.977325,-0.177252,0.115665,-0.896146,-0.420850,0.140568,-0.875851,-0.383435,0.292947,-0.826533,-0.330119,0.455855,\n\t\t\t         -0.891171,-0.162389,0.423566,-0.951323,-0.169805,0.257118,-0.875851,-0.383435,0.292947,-0.682394,-0.653218,0.328013,\n\t\t\t         -0.651173,-0.574114,0.496323,-0.826533,-0.330119,0.455855,-0.737632,-0.261513,0.622456,-0.566881,-0.455550,0.686361,\n\t\t\t         -0.425581,-0.295206,0.855373,-0.584948,-0.188299,0.788873,-0.737632,-0.261513,0.622456,-0.826533,-0.330119,0.455855,\n\t\t\t         -0.651173,-0.574114,0.496323,-0.566881,-0.455550,0.686361,-0.737632,-0.261513,0.622456,-0.790307,-0.156224,0.592425,\n\t\t\t         -0.891171,-0.162389,0.423566,-0.826533,-0.330119,0.455855,-0.737632,-0.261513,0.622456,-0.584948,-0.188299,0.788873,\n\t\t\t         -0.645955,-0.187658,0.739921,-0.790307,-0.156224,0.592425,-0.887692,-0.456984,-0.055849,-0.720603,-0.432539,-0.541826,\n\t\t\t         -0.533738,-0.668264,-0.518174,-0.671072,-0.739860,-0.047243,-0.887692,-0.456984,-0.055849,-0.979858,-0.194464,-0.044801,\n\t\t\t         -0.816095,-0.211097,-0.537950,-0.720603,-0.432539,-0.541826,-0.887692,-0.456984,-0.055849,-0.896146,-0.420850,0.140568,\n\t\t\t         -0.977325,-0.177252,0.115665,-0.979858,-0.194464,-0.044801,-0.887692,-0.456984,-0.055849,-0.671072,-0.739860,-0.047243,\n\t\t\t         -0.690115,-0.703726,0.168767,-0.896146,-0.420850,0.140568,0.018189,-0.280526,0.959655,0.011292,-0.366863,0.930204,\n\t\t\t         -0.608753,-0.276040,0.743736,-0.590197,-0.227973,0.774377,-0.423963,-0.261727,0.867000,-0.533738,-0.239235,0.811090,\n\t\t\t         -0.645955,-0.187658,0.739921,-0.445906,-0.192846,0.874020,-0.894375,-0.293008,0.337931,-0.968902,-0.244209,0.039796,\n\t\t\t         -0.986633,-0.013794,-0.162175,-0.955168,-0.078921,0.285257,-0.894375,-0.293008,0.337931,-0.879849,-0.204413,0.428968,\n\t\t\t         -0.984313,-0.175665,-0.015625,-0.968902,-0.244209,0.039796,-0.894375,-0.293008,0.337931,-0.963958,-0.214118,0.157750,\n\t\t\t         -0.947142,-0.225288,0.228339,-0.879849,-0.204413,0.428968,-0.894375,-0.293008,0.337931,-0.955168,-0.078921,0.285257,\n\t\t\t         -0.987548,-0.016694,0.156255,-0.963958,-0.214118,0.157750,-0.976165,-0.034577,0.214240,-0.951323,-0.169805,0.257118,\n\t\t\t         -0.891171,-0.162389,0.423566,-0.921140,-0.069247,0.382946,-0.976165,-0.034577,0.214240,-0.996826,-0.016724,0.077609,\n\t\t\t         -0.977325,-0.177252,0.115665,-0.951323,-0.169805,0.257118,-0.976165,-0.034577,0.214240,-0.986541,0.022645,0.161901,\n\t\t\t         -0.997681,0.057405,0.036256,-0.996826,-0.016724,0.077609,-0.976165,-0.034577,0.214240,-0.921140,-0.069247,0.382946,\n\t\t\t         -0.946440,-0.041444,0.320170,-0.986541,0.022645,0.161901,-0.989776,0.101566,-0.099796,-0.987823,0.097751,-0.120884,\n\t\t\t         -0.862087,0.068270,-0.502091,-0.864437,0.006623,-0.502640,-0.989776,0.101566,-0.099796,-0.996429,0.083987,-0.006195,\n\t\t\t         -0.996796,0.063784,-0.048097,-0.987823,0.097751,-0.120884,-0.989776,0.101566,-0.099796,-0.994446,0.066683,-0.081149,\n\t\t\t         -0.997681,0.057405,0.036256,-0.996429,0.083987,-0.006195,-0.989776,0.101566,-0.099796,-0.864437,0.006623,-0.502640,\n\t\t\t         -0.866543,-0.001740,-0.499039,-0.994446,0.066683,-0.081149,-0.994751,0.029878,0.097690,-0.986541,0.022645,0.161901,\n\t\t\t         -0.946440,-0.041444,0.320170,-0.969573,-0.054720,0.238502,-0.994751,0.029878,0.097690,-0.996429,0.083987,-0.006195,\n\t\t\t         -0.997681,0.057405,0.036256,-0.986541,0.022645,0.161901,-0.994751,0.029878,0.097690,-0.999268,0.005737,0.037538,\n\t\t\t         -0.996796,0.063784,-0.048097,-0.996429,0.083987,-0.006195,-0.994751,0.029878,0.097690,-0.969573,-0.054720,0.238502,\n\t\t\t         -0.984008,-0.069521,0.163945,-0.999268,0.005737,0.037538,-0.983917,0.072329,-0.163274,-0.970428,0.069124,-0.231239,\n\t\t\t         -0.859859,0.105319,-0.499496,-0.866970,0.109531,-0.486160,-0.983917,0.072329,-0.163274,-0.995086,0.030335,-0.094211,\n\t\t\t         -0.988372,0.028413,-0.149174,-0.970428,0.069124,-0.231239,-0.983917,0.072329,-0.163274,-0.987823,0.097751,-0.120884,\n\t\t\t         -0.996796,0.063784,-0.048097,-0.995086,0.030335,-0.094211,-0.983917,0.072329,-0.163274,-0.866970,0.109531,-0.486160,\n\t\t\t         -0.862087,0.068270,-0.502091,-0.987823,0.097751,-0.120884,-0.999756,-0.017518,-0.011353,-0.991241,-0.076724,0.107395,\n\t\t\t         -0.995941,-0.070986,0.055177,-0.998230,-0.015656,-0.056887,-0.999756,-0.017518,-0.011353,-0.999268,0.005737,0.037538,\n\t\t\t         -0.984008,-0.069521,0.163945,-0.991241,-0.076724,0.107395,-0.999756,-0.017518,-0.011353,-0.995086,0.030335,-0.094211,\n\t\t\t         -0.996796,0.063784,-0.048097,-0.999268,0.005737,0.037538,-0.999756,-0.017518,-0.011353,-0.998230,-0.015656,-0.056887,\n\t\t\t         -0.988372,0.028413,-0.149174,-0.995086,0.030335,-0.094211,-0.953520,0.078585,-0.290841,-0.949980,0.054231,-0.307535,\n\t\t\t         -0.854915,0.059725,-0.515305,-0.850795,0.097201,-0.516373,-0.953520,0.078585,-0.290841,-0.979461,0.049409,-0.195379,\n\t\t\t         -0.975585,0.058351,-0.211615,-0.949980,0.054231,-0.307535,-0.953520,0.078585,-0.290841,-0.970428,0.069124,-0.231239,\n\t\t\t         -0.988372,0.028413,-0.149174,-0.979461,0.049409,-0.195379,-0.953520,0.078585,-0.290841,-0.850795,0.097201,-0.516373,\n\t\t\t         -0.859859,0.105319,-0.499496,-0.970428,0.069124,-0.231239,-0.995544,0.015564,-0.092715,-0.999512,-0.027039,0.015351,\n\t\t\t         -0.986541,0.094699,0.133244,-0.992981,0.048250,-0.107944,-0.995544,0.015564,-0.092715,-0.998230,-0.015656,-0.056887,\n\t\t\t         -0.995941,-0.070986,0.055177,-0.999512,-0.027039,0.015351,-0.995544,0.015564,-0.092715,-0.979461,0.049409,-0.195379,\n\t\t\t         -0.988372,0.028413,-0.149174,-0.998230,-0.015656,-0.056887,-0.995544,0.015564,-0.092715,-0.992981,0.048250,-0.107944,\n\t\t\t         -0.975585,0.058351,-0.211615,-0.979461,0.049409,-0.195379,-0.166082,-0.332286,0.928404,-0.845943,-0.300272,0.440626,\n\t\t\t         -0.822108,-0.323191,0.468642,-0.182714,-0.429304,0.884457,-0.188513,-0.436659,0.879635,-0.803156,-0.295846,0.517045,\n\t\t\t         -0.764092,-0.306162,0.567766,-0.152776,-0.430921,0.889340,-0.845943,-0.300272,0.440626,-0.947874,-0.191443,0.254677,\n\t\t\t         -0.922605,-0.228065,0.311014,-0.822108,-0.323191,0.468642,-0.845943,-0.300272,0.440626,-0.714591,0.073397,0.695669,\n\t\t\t         -0.912534,0.049074,0.405988,-0.947874,-0.191443,0.254677,-0.072848,-0.427900,0.900876,-0.679983,-0.323649,0.657918,\n\t\t\t         -0.608753,-0.276040,0.743736,0.011292,-0.366863,0.930204,-0.188513,-0.436659,0.879635,-0.182714,-0.429304,0.884457,\n\t\t\t         -0.822108,-0.323191,0.468642,-0.803156,-0.295846,0.517045,-0.803156,-0.295846,0.517045,-0.898862,-0.220405,0.378704,\n\t\t\t         -0.870663,-0.227668,0.435926,-0.764092,-0.306162,0.567766,-0.803156,-0.295846,0.517045,-0.822108,-0.323191,0.468642,\n\t\t\t         -0.922605,-0.228065,0.311014,-0.898862,-0.220405,0.378704,-0.072848,-0.427900,0.900876,-0.152776,-0.430921,0.889340,\n\t\t\t         -0.764092,-0.306162,0.567766,-0.679983,-0.323649,0.657918,-0.679983,-0.323649,0.657918,-0.836360,-0.224860,0.499863,\n\t\t\t         -0.796014,-0.186865,0.575640,-0.608753,-0.276040,0.743736,-0.679983,-0.323649,0.657918,-0.764092,-0.306162,0.567766,\n\t\t\t         -0.870663,-0.227668,0.435926,-0.836360,-0.224860,0.499863,0.018189,-0.280526,0.959655,-0.590197,-0.227973,0.774377,\n\t\t\t         -0.533738,-0.239235,0.811090,0.043794,-0.223395,0.973724,-0.166082,-0.332286,0.928404,-0.160436,-0.040498,0.986206,\n\t\t\t         -0.714591,0.073397,0.695669,-0.845943,-0.300272,0.440626,-0.590197,-0.227973,0.774377,-0.740165,-0.167333,0.651234,\n\t\t\t         -0.645955,-0.187658,0.739921,-0.533738,-0.239235,0.811090,-0.590197,-0.227973,0.774377,-0.608753,-0.276040,0.743736,\n\t\t\t         -0.796014,-0.186865,0.575640,-0.740165,-0.167333,0.651234,-0.823939,-0.117954,0.554216,-0.921140,-0.069247,0.382946,\n\t\t\t         -0.891171,-0.162389,0.423566,-0.790307,-0.156224,0.592425,-0.823939,-0.117954,0.554216,-0.867519,-0.120182,0.482650,\n\t\t\t         -0.946440,-0.041444,0.320170,-0.921140,-0.069247,0.382946,-0.823939,-0.117954,0.554216,-0.740165,-0.167333,0.651234,\n\t\t\t         -0.796014,-0.186865,0.575640,-0.867519,-0.120182,0.482650,-0.823939,-0.117954,0.554216,-0.790307,-0.156224,0.592425,\n\t\t\t         -0.645955,-0.187658,0.739921,-0.740165,-0.167333,0.651234,-0.906735,-0.148656,0.394574,-0.936338,-0.153111,0.315928,\n\t\t\t         -0.984008,-0.069521,0.163945,-0.969573,-0.054720,0.238502,-0.906735,-0.148656,0.394574,-0.836360,-0.224860,0.499863,\n\t\t\t         -0.870663,-0.227668,0.435926,-0.936338,-0.153111,0.315928,-0.906735,-0.148656,0.394574,-0.867519,-0.120182,0.482650,\n\t\t\t         -0.796014,-0.186865,0.575640,-0.836360,-0.224860,0.499863,-0.906735,-0.148656,0.394574,-0.969573,-0.054720,0.238502,\n\t\t\t         -0.946440,-0.041444,0.320170,-0.867519,-0.120182,0.482650,-0.955565,-0.148442,0.254616,-0.971007,-0.145146,0.189825,\n\t\t\t         -0.995941,-0.070986,0.055177,-0.991241,-0.076724,0.107395,-0.955565,-0.148442,0.254616,-0.898862,-0.220405,0.378704,\n\t\t\t         -0.922605,-0.228065,0.311014,-0.971007,-0.145146,0.189825,-0.955565,-0.148442,0.254616,-0.936338,-0.153111,0.315928,\n\t\t\t         -0.870663,-0.227668,0.435926,-0.898862,-0.220405,0.378704,-0.955565,-0.148442,0.254616,-0.991241,-0.076724,0.107395,\n\t\t\t         -0.984008,-0.069521,0.163945,-0.936338,-0.153111,0.315928,-0.986236,-0.095523,0.134922,-0.958861,0.091159,0.268777,\n\t\t\t         -0.986541,0.094699,0.133244,-0.999512,-0.027039,0.015351,-0.986236,-0.095523,0.134922,-0.947874,-0.191443,0.254677,\n\t\t\t         -0.912534,0.049074,0.405988,-0.958861,0.091159,0.268777,-0.986236,-0.095523,0.134922,-0.971007,-0.145146,0.189825,\n\t\t\t         -0.922605,-0.228065,0.311014,-0.947874,-0.191443,0.254677,-0.986236,-0.095523,0.134922,-0.999512,-0.027039,0.015351,\n\t\t\t         -0.995941,-0.070986,0.055177,-0.971007,-0.145146,0.189825,0.868404,-0.273690,0.413434,0.966887,-0.235908,0.097110,\n\t\t\t         0.973876,-0.197699,0.111454,0.842250,-0.195807,0.502213,0.868404,-0.273690,0.413434,0.932188,-0.012848,0.361675,\n\t\t\t         0.985351,0.077670,-0.151799,0.966887,-0.235908,0.097110,0.868404,-0.273690,0.413434,0.950957,-0.188025,0.245552,\n\t\t\t         0.967528,0.047090,0.248299,0.932188,-0.012848,0.361675,0.868404,-0.273690,0.413434,0.842250,-0.195807,0.502213,\n\t\t\t         0.923978,-0.215125,0.316172,0.950957,-0.188025,0.245552,-0.545122,0.783105,0.299264,-0.682485,0.721610,0.116031,\n\t\t\t         -0.765435,0.514145,0.386944,-0.562944,0.497055,0.660298,-0.545122,0.783105,0.299264,-0.470229,0.879574,0.072207,\n\t\t\t         -0.595874,0.797327,-0.095798,-0.682485,0.721610,0.116031,-0.545122,0.783105,0.299264,-0.010559,0.885281,0.464888,\n\t\t\t         -0.005951,0.979522,0.201117,-0.470229,0.879574,0.072207,-0.545122,0.783105,0.299264,-0.562944,0.497055,0.660298,\n\t\t\t         -0.015442,0.547288,0.836787,-0.010559,0.885281,0.464888,-0.728294,0.679647,-0.087313,-0.623646,0.722922,-0.297281,\n\t\t\t         -0.776971,0.520280,-0.354350,-0.860225,0.492691,-0.131321,-0.728294,0.679647,-0.087313,-0.534806,0.844234,-0.034852,\n\t\t\t         -0.418928,0.876553,-0.236854,-0.623646,0.722922,-0.297281,-0.728294,0.679647,-0.087313,-0.775689,0.626728,-0.074007,\n\t\t\t         -0.545793,0.837886,-0.003327,-0.534806,0.844234,-0.034852,-0.728294,0.679647,-0.087313,-0.860225,0.492691,-0.131321,\n\t\t\t         -0.882565,0.456923,-0.110660,-0.775689,0.626728,-0.074007,-0.933409,0.315867,-0.170049,-0.860225,0.492691,-0.131321,\n\t\t\t         -0.776971,0.520280,-0.354350,-0.855678,0.326701,-0.401288,-0.933409,0.315867,-0.170049,-0.943266,0.295907,-0.150609,\n\t\t\t         -0.882565,0.456923,-0.110660,-0.860225,0.492691,-0.131321,-0.933409,0.315867,-0.170049,-0.967315,0.164586,-0.192877,\n\t\t\t         -0.973388,0.150304,-0.172796,-0.943266,0.295907,-0.150609,-0.933409,0.315867,-0.170049,-0.855678,0.326701,-0.401288,\n\t\t\t         -0.887020,0.169073,-0.429609,-0.967315,0.164586,-0.192877,0.873836,0.117405,-0.471786,0.852168,0.213355,-0.477767,\n\t\t\t         0.857662,0.220069,-0.464705,0.884426,0.106296,-0.454390,0.844752,-0.175787,-0.505448,0.792016,-0.322031,-0.518632,\n\t\t\t         0.804346,-0.307718,-0.508255,0.846034,-0.157933,-0.509171,-0.962249,0.239326,-0.129490,-0.997497,0.064943,0.027711,\n\t\t\t         -0.994812,0.100497,0.015259,-0.920042,0.375286,-0.112369,-0.962249,0.239326,-0.129490,-0.983856,0.110019,-0.141057,\n\t\t\t         -0.998901,0.018342,0.043001,-0.997497,0.064943,0.027711,-0.962249,0.239326,-0.129490,-0.943266,0.295907,-0.150609,\n\t\t\t         -0.973388,0.150304,-0.172796,-0.983856,0.110019,-0.141057,-0.962249,0.239326,-0.129490,-0.920042,0.375286,-0.112369,\n\t\t\t         -0.882565,0.456923,-0.110660,-0.943266,0.295907,-0.150609,-0.846004,0.523881,-0.098849,-0.724418,0.687948,-0.043580,\n\t\t\t         -0.545793,0.837886,-0.003327,-0.775689,0.626728,-0.074007,-0.846004,0.523881,-0.098849,-0.904569,0.418714,-0.079806,\n\t\t\t         -0.788263,0.613910,0.041231,-0.724418,0.687948,-0.043580,-0.846004,0.523881,-0.098849,-0.920042,0.375286,-0.112369,\n\t\t\t         -0.994812,0.100497,0.015259,-0.904569,0.418714,-0.079806,-0.846004,0.523881,-0.098849,-0.775689,0.626728,-0.074007,\n\t\t\t         -0.882565,0.456923,-0.110660,-0.920042,0.375286,-0.112369,-0.579882,0.812159,0.063997,-0.724418,0.687948,-0.043580,\n\t\t\t         -0.788263,0.613910,0.041231,-0.578478,0.797082,0.173162,-0.579882,0.812159,0.063997,-0.391125,0.915525,0.093661,\n\t\t\t         -0.545793,0.837886,-0.003327,-0.724418,0.687948,-0.043580,-0.579882,0.812159,0.063997,-0.578478,0.797082,0.173162,\n\t\t\t         -0.329325,0.913877,0.237373,-0.391125,0.915525,0.093661,0.000275,0.979156,0.202948,-0.000109,0.982495,0.186289,\n\t\t\t         0.038078,0.876796,0.479352,0.043794,0.978179,0.203040,0.000275,0.979156,0.202948,-0.045198,0.978210,0.202490,\n\t\t\t         -0.029992,0.876364,0.480715,-0.000109,0.982495,0.186289,0.000275,0.979156,0.202948,0.043794,0.978179,0.203040,\n\t\t\t         -0.002228,0.985076,0.172063,-0.045198,0.978210,0.202490,-0.764946,0.518143,0.382550,-0.652028,0.661550,0.370373,\n\t\t\t         -0.788263,0.613910,0.041231,-0.887020,0.420118,0.191473,-0.764946,0.518143,0.382550,-0.474563,0.173498,0.862911,\n\t\t\t         -0.269539,0.373089,0.887753,-0.652028,0.661550,0.370373,-0.764946,0.518143,0.382550,-0.887020,0.420118,0.191473,\n\t\t\t         -0.727531,-0.014283,0.685903,-0.474563,0.173498,0.862911,-0.946226,0.315867,0.069643,-0.904569,0.418714,-0.079806,\n\t\t\t         -0.994812,0.100497,0.015259,-0.945189,-0.085452,0.315073,-0.946226,0.315867,0.069643,-0.887020,0.420118,0.191473,\n\t\t\t         -0.788263,0.613910,0.041231,-0.904569,0.418714,-0.079806,-0.946226,0.315867,0.069643,-0.945189,-0.085452,0.315073,\n\t\t\t         -0.727531,-0.014283,0.685903,-0.887020,0.420118,0.191473,-0.488388,0.758538,0.431318,-0.578478,0.797082,0.173162,\n\t\t\t         -0.788263,0.613910,0.041231,-0.652028,0.661550,0.370373,-0.488388,0.758538,0.431318,-0.294687,0.817408,0.494949,\n\t\t\t         -0.329325,0.913877,0.237373,-0.578478,0.797082,0.173162,-0.488388,0.758538,0.431318,-0.144047,0.423811,0.894192,\n\t\t\t         -0.082186,0.383923,0.919675,-0.294687,0.817408,0.494949,-0.488388,0.758538,0.431318,-0.652028,0.661550,0.370373,\n\t\t\t         -0.269539,0.373089,0.887753,-0.144047,0.423811,0.894192,-0.181249,0.970946,0.156194,-0.045198,0.978210,0.202490,\n\t\t\t         -0.002228,0.985076,0.172063,-0.239143,0.965423,0.103671,-0.181249,0.970946,0.156194,-0.177801,0.950346,0.255318,\n\t\t\t         -0.029992,0.876364,0.480715,-0.045198,0.978210,0.202490,-0.181249,0.970946,0.156194,-0.391125,0.915525,0.093661,\n\t\t\t         -0.329325,0.913877,0.237373,-0.177801,0.950346,0.255318,-0.181249,0.970946,0.156194,-0.239143,0.965423,0.103671,\n\t\t\t         -0.545793,0.837886,-0.003327,-0.391125,0.915525,0.093661,0.978423,-0.197180,-0.061373,0.963744,-0.080599,-0.254280,\n\t\t\t         0.698202,-0.193487,-0.689230,0.956053,-0.282571,-0.077975,0.978423,-0.197180,-0.061373,0.966887,-0.235908,0.097110,\n\t\t\t         0.985351,0.077670,-0.151799,0.963744,-0.080599,-0.254280,0.978423,-0.197180,-0.061373,0.956053,-0.282571,-0.077975,\n\t\t\t         0.973876,-0.197699,0.111454,0.966887,-0.235908,0.097110,0.725700,-0.617786,-0.302713,0.801080,-0.485977,-0.349315,\n\t\t\t         0.956908,-0.290323,-0.003235,0.826899,-0.556841,0.078310,0.725700,-0.617786,-0.302713,0.466231,-0.600421,-0.649678,\n\t\t\t         0.475570,-0.469558,-0.743828,0.801080,-0.485977,-0.349315,0.725700,-0.617786,-0.302713,0.550890,-0.783715,-0.286782,\n\t\t\t         0.419263,-0.724052,-0.547655,0.466231,-0.600421,-0.649678,0.725700,-0.617786,-0.302713,0.826899,-0.556841,0.078310,\n\t\t\t         0.639882,-0.756127,0.137150,0.550890,-0.783715,-0.286782,0.796411,-0.321146,-0.512375,0.846919,-0.225440,-0.481521,\n\t\t\t         0.956908,-0.290323,-0.003235,0.801080,-0.485977,-0.349315,0.796411,-0.321146,-0.512375,0.449568,-0.291818,-0.844203,\n\t\t\t         0.449049,-0.190771,-0.872860,0.846919,-0.225440,-0.481521,0.796411,-0.321146,-0.512375,0.801080,-0.485977,-0.349315,\n\t\t\t         0.475570,-0.469558,-0.743828,0.449568,-0.291818,-0.844203,0.895840,0.376324,-0.236213,0.927061,0.371563,-0.049532,\n\t\t\t         0.962767,0.263833,-0.058443,0.884732,0.344676,-0.313669,0.895840,0.376324,-0.236213,0.853542,0.439314,-0.280038,\n\t\t\t         0.851192,0.522538,0.048952,0.927061,0.371563,-0.049532,0.895840,0.376324,-0.236213,0.884732,0.344676,-0.313669,\n\t\t\t         0.615680,0.345531,-0.708182,0.853542,0.439314,-0.280038,0.663747,0.250313,-0.704794,0.720237,0.162999,-0.674276,\n\t\t\t         0.985351,0.077670,-0.151799,0.878170,0.263192,-0.399396,0.663747,0.250313,-0.704794,0.603290,0.252937,-0.756310,\n\t\t\t         0.382305,0.162755,-0.909574,0.720237,0.162999,-0.674276,0.663747,0.250313,-0.704794,0.875851,0.282785,-0.391003,\n\t\t\t         0.927244,0.196142,-0.318918,0.603290,0.252937,-0.756310,0.663747,0.250313,-0.704794,0.878170,0.263192,-0.399396,\n\t\t\t         0.881405,0.300729,-0.364177,0.875851,0.282785,-0.391003,0.873653,0.296457,-0.385723,0.572954,0.176214,-0.800409,\n\t\t\t         0.615680,0.345531,-0.708182,0.884732,0.344676,-0.313669,0.873653,0.296457,-0.385723,0.941862,0.197790,-0.271523,\n\t\t\t         0.672964,-0.035676,-0.738792,0.572954,0.176214,-0.800409,0.873653,0.296457,-0.385723,0.884732,0.344676,-0.313669,\n\t\t\t         0.962767,0.263833,-0.058443,0.941862,0.197790,-0.271523,0.676199,0.719382,-0.158727,0.534837,0.799310,-0.273812,\n\t\t\t         0.561815,0.822810,-0.085513,0.705008,0.708396,-0.032929,0.676199,0.719382,-0.158727,0.738365,0.639454,-0.214209,\n\t\t\t         0.509751,0.749901,-0.421613,0.534837,0.799310,-0.273812,0.676199,0.719382,-0.158727,0.705008,0.708396,-0.032929,\n\t\t\t         0.851192,0.522538,0.048952,0.738365,0.639454,-0.214209,0.190497,0.524766,-0.829646,0.002991,0.489242,-0.872127,\n\t\t\t         0.002228,0.740104,-0.672445,0.242775,0.758232,-0.605060,0.190497,0.524766,-0.829646,0.166814,0.218970,-0.961333,\n\t\t\t         0.001190,0.178961,-0.983825,0.002991,0.489242,-0.872127,0.190497,0.524766,-0.829646,0.520951,0.569475,-0.635823,\n\t\t\t         0.615680,0.345531,-0.708182,0.166814,0.218970,-0.961333,0.190497,0.524766,-0.829646,0.242775,0.758232,-0.605060,\n\t\t\t         0.509751,0.749901,-0.421613,0.520951,0.569475,-0.635823,0.884091,0.051180,-0.464431,0.720237,0.162999,-0.674276,\n\t\t\t         0.382305,0.162755,-0.909574,0.472823,0.030183,-0.880612,0.884091,0.051180,-0.464431,0.963744,-0.080599,-0.254280,\n\t\t\t         0.985351,0.077670,-0.151799,0.720237,0.162999,-0.674276,0.884091,0.051180,-0.464431,0.472823,0.030183,-0.880612,\n\t\t\t         0.698202,-0.193487,-0.689230,0.963744,-0.080599,-0.254280,0.994537,0.056948,-0.087466,0.941862,0.197790,-0.271523,\n\t\t\t         0.962767,0.263833,-0.058443,0.996521,0.059999,0.057466,0.994537,0.056948,-0.087466,0.976867,-0.096194,-0.190802,\n\t\t\t         0.672964,-0.035676,-0.738792,0.941862,0.197790,-0.271523,0.994537,0.056948,-0.087466,0.996521,0.059999,0.057466,\n\t\t\t         0.973876,-0.197699,0.111454,0.976867,-0.096194,-0.190802,0.755425,0.563005,-0.335124,0.738365,0.639454,-0.214209,\n\t\t\t         0.851192,0.522538,0.048952,0.853542,0.439314,-0.280038,0.755425,0.563005,-0.335124,0.520951,0.569475,-0.635823,\n\t\t\t         0.509751,0.749901,-0.421613,0.738365,0.639454,-0.214209,0.755425,0.563005,-0.335124,0.853542,0.439314,-0.280038,\n\t\t\t         0.615680,0.345531,-0.708182,0.520951,0.569475,-0.635823,0.316507,0.855098,-0.410596,-0.000671,0.874386,-0.485153,\n\t\t\t         -0.002655,0.957488,-0.288369,0.356395,0.906888,-0.224708,0.316507,0.855098,-0.410596,0.242775,0.758232,-0.605060,\n\t\t\t         0.002228,0.740104,-0.672445,-0.000671,0.874386,-0.485153,0.316507,0.855098,-0.410596,0.534837,0.799310,-0.273812,\n\t\t\t         0.509751,0.749901,-0.421613,0.242775,0.758232,-0.605060,0.316507,0.855098,-0.410596,0.356395,0.906888,-0.224708,\n\t\t\t         0.561815,0.822810,-0.085513,0.534837,0.799310,-0.273812,0.930967,-0.235145,-0.279183,0.976867,-0.096194,-0.190802,\n\t\t\t         0.973876,-0.197699,0.111454,0.956053,-0.282571,-0.077975,0.930967,-0.235145,-0.279183,0.630238,-0.267891,-0.728690,\n\t\t\t         0.672964,-0.035676,-0.738792,0.976867,-0.096194,-0.190802,0.930967,-0.235145,-0.279183,0.956053,-0.282571,-0.077975,\n\t\t\t         0.698202,-0.193487,-0.689230,0.630238,-0.267891,-0.728690,0.147526,0.031800,-0.988525,0.000427,-0.005615,-0.999969,\n\t\t\t         0.001190,0.178961,-0.983825,0.166814,0.218970,-0.961333,0.147526,0.031800,-0.988525,0.151128,-0.120487,-0.981140,\n\t\t\t         0.000305,-0.126011,-0.992004,0.000427,-0.005615,-0.999969,0.147526,0.031800,-0.988525,0.572954,0.176214,-0.800409,\n\t\t\t         0.672964,-0.035676,-0.738792,0.151128,-0.120487,-0.981140,0.147526,0.031800,-0.988525,0.166814,0.218970,-0.961333,\n\t\t\t         0.615680,0.345531,-0.708182,0.572954,0.176214,-0.800409,0.210211,-0.233467,-0.949339,-0.000031,-0.200446,-0.979675,\n\t\t\t         0.000305,-0.126011,-0.992004,0.151128,-0.120487,-0.981140,0.210211,-0.233467,-0.949339,0.203223,-0.155065,-0.966765,\n\t\t\t         -0.003479,-0.153630,-0.988098,-0.000031,-0.200446,-0.979675,0.210211,-0.233467,-0.949339,0.630238,-0.267891,-0.728690,\n\t\t\t         0.698202,-0.193487,-0.689230,0.203223,-0.155065,-0.966765,0.210211,-0.233467,-0.949339,0.151128,-0.120487,-0.981140,\n\t\t\t         0.672964,-0.035676,-0.738792,0.630238,-0.267891,-0.728690,0.159307,-0.021790,-0.986969,-0.001831,-0.041597,-0.999115,\n\t\t\t         -0.003479,-0.153630,-0.988098,0.203223,-0.155065,-0.966765,0.159307,-0.021790,-0.986969,0.141301,0.090152,-0.985839,\n\t\t\t         0.000977,0.068484,-0.997650,-0.001831,-0.041597,-0.999115,0.159307,-0.021790,-0.986969,0.472823,0.030183,-0.880612,\n\t\t\t         0.382305,0.162755,-0.909574,0.141301,0.090152,-0.985839,0.159307,-0.021790,-0.986969,0.203223,-0.155065,-0.966765,\n\t\t\t         0.698202,-0.193487,-0.689230,0.472823,0.030183,-0.880612,0.155950,-0.082675,-0.984283,0.002136,-0.068575,-0.997620,\n\t\t\t         0.004028,0.038209,-0.999237,0.154973,0.037385,-0.987182,0.155950,-0.082675,-0.984283,0.147526,-0.161687,-0.975738,\n\t\t\t         -0.000610,-0.152898,-0.988220,0.002136,-0.068575,-0.997620,0.155950,-0.082675,-0.984283,0.497665,-0.113224,-0.859920,\n\t\t\t         0.449049,-0.190771,-0.872860,0.147526,-0.161687,-0.975738,0.155950,-0.082675,-0.984283,0.154973,0.037385,-0.987182,\n\t\t\t         0.506699,-0.017884,-0.861904,0.497665,-0.113224,-0.859920,0.145512,-0.255501,-0.955779,-0.001801,-0.246651,-0.969085,\n\t\t\t         -0.000610,-0.152898,-0.988220,0.147526,-0.161687,-0.975738,0.145512,-0.255501,-0.955779,0.159551,-0.379284,-0.911405,\n\t\t\t         -0.001099,-0.356945,-0.934111,-0.001801,-0.246651,-0.969085,0.145512,-0.255501,-0.955779,0.449568,-0.291818,-0.844203,\n\t\t\t         0.475570,-0.469558,-0.743828,0.159551,-0.379284,-0.911405,0.145512,-0.255501,-0.955779,0.147526,-0.161687,-0.975738,\n\t\t\t         0.449049,-0.190771,-0.872860,0.449568,-0.291818,-0.844203,0.177007,-0.534898,-0.826136,-0.000183,-0.511765,-0.859096,\n\t\t\t         -0.001099,-0.356945,-0.934111,0.159551,-0.379284,-0.911405,0.177007,-0.534898,-0.826136,0.212256,-0.757469,-0.617359,\n\t\t\t         0.000214,-0.765862,-0.642964,-0.000183,-0.511765,-0.859096,0.177007,-0.534898,-0.826136,0.466231,-0.600421,-0.649678,\n\t\t\t         0.419263,-0.724052,-0.547655,0.212256,-0.757469,-0.617359,0.177007,-0.534898,-0.826136,0.159551,-0.379284,-0.911405,\n\t\t\t         0.475570,-0.469558,-0.743828,0.466231,-0.600421,-0.649678,0.279580,-0.915220,-0.290139,-0.000061,-0.953551,-0.301187,\n\t\t\t         0.000214,-0.765862,-0.642964,0.212256,-0.757469,-0.617359,0.279580,-0.915220,-0.290139,0.342448,-0.915159,0.212470,\n\t\t\t         -0.001526,-0.972259,0.233863,-0.000061,-0.953551,-0.301187,0.279580,-0.915220,-0.290139,0.550890,-0.783715,-0.286782,\n\t\t\t         0.639882,-0.756127,0.137150,0.342448,-0.915159,0.212470,0.279580,-0.915220,-0.290139,0.212256,-0.757469,-0.617359,\n\t\t\t         0.419263,-0.724052,-0.547655,0.550890,-0.783715,-0.286782,0.143498,0.126591,-0.981506,0.003113,0.110263,-0.993866,\n\t\t\t         0.000977,0.068484,-0.997650,0.141301,0.090152,-0.985839,0.143498,0.126591,-0.981506,0.154973,0.037385,-0.987182,\n\t\t\t         0.004028,0.038209,-0.999237,0.003113,0.110263,-0.993866,0.143498,0.126591,-0.981506,0.324625,0.167028,-0.930967,\n\t\t\t         0.506699,-0.017884,-0.861904,0.154973,0.037385,-0.987182,0.143498,0.126591,-0.981506,0.141301,0.090152,-0.985839,\n\t\t\t         0.382305,0.162755,-0.909574,0.324625,0.167028,-0.930967,0.944884,-0.083193,-0.316599,0.995483,-0.090213,0.029511,\n\t\t\t         0.956908,-0.290323,-0.003235,0.906247,-0.137638,-0.399670,0.944884,-0.083193,-0.316599,0.996185,0.044099,-0.075167,\n\t\t\t         0.996948,-0.009949,0.077334,0.995483,-0.090213,0.029511,0.944884,-0.083193,-0.316599,0.804682,0.036653,-0.592517,\n\t\t\t         0.927244,0.196142,-0.318918,0.996185,0.044099,-0.075167,0.944884,-0.083193,-0.316599,0.906247,-0.137638,-0.399670,\n\t\t\t         0.506699,-0.017884,-0.861904,0.804682,0.036653,-0.592517,0.641469,0.193365,-0.742332,0.804682,0.036653,-0.592517,\n\t\t\t         0.506699,-0.017884,-0.861904,0.324625,0.167028,-0.930967,0.641469,0.193365,-0.742332,0.603290,0.252937,-0.756310,\n\t\t\t         0.927244,0.196142,-0.318918,0.804682,0.036653,-0.592517,0.641469,0.193365,-0.742332,0.324625,0.167028,-0.930967,\n\t\t\t         0.382305,0.162755,-0.909574,0.603290,0.252937,-0.756310,0.823359,-0.185980,-0.536119,0.906247,-0.137638,-0.399670,\n\t\t\t         0.956908,-0.290323,-0.003235,0.846919,-0.225440,-0.481521,0.823359,-0.185980,-0.536119,0.497665,-0.113224,-0.859920,\n\t\t\t         0.506699,-0.017884,-0.861904,0.906247,-0.137638,-0.399670,0.823359,-0.185980,-0.536119,0.846919,-0.225440,-0.481521,\n\t\t\t         0.449049,-0.190771,-0.872860,0.497665,-0.113224,-0.859920,0.351054,0.934019,-0.065828,0.445479,0.890652,0.090854,\n\t\t\t         0.561815,0.822810,-0.085513,0.356395,0.906888,-0.224708,0.351054,0.934019,-0.065828,-0.004089,0.999603,-0.027192,\n\t\t\t         -0.005951,0.979522,0.201117,0.445479,0.890652,0.090854,0.351054,0.934019,-0.065828,0.356395,0.906888,-0.224708,\n\t\t\t         -0.002655,0.957488,-0.288369,-0.004089,0.999603,-0.027192,0.685476,0.720206,0.106784,0.640797,0.753624,0.146275,\n\t\t\t         0.718436,0.540086,0.438337,0.753899,0.571947,0.323222,0.685476,0.720206,0.106784,0.705008,0.708396,-0.032929,\n\t\t\t         0.561815,0.822810,-0.085513,0.640797,0.753624,0.146275,0.685476,0.720206,0.106784,0.753899,0.571947,0.323222,\n\t\t\t         0.851192,0.522538,0.048952,0.705008,0.708396,-0.032929,0.344951,-0.866329,0.361187,-0.001709,-0.932249,0.361736,\n\t\t\t         -0.002869,-0.975494,0.219977,0.341594,-0.915891,0.210669,0.344951,-0.866329,0.361187,0.331523,-0.757653,0.562151,\n\t\t\t         -0.000061,-0.829218,0.558885,-0.001709,-0.932249,0.361736,0.344951,-0.866329,0.361187,0.651845,-0.671957,0.351451,\n\t\t\t         0.606311,-0.563341,0.561235,0.331523,-0.757653,0.562151,0.344951,-0.866329,0.361187,0.341594,-0.915891,0.210669,\n\t\t\t         0.658925,-0.729240,0.184423,0.651845,-0.671957,0.351451,0.272073,-0.571520,0.774132,0.192328,-0.347056,0.917875,\n\t\t\t         -0.000458,-0.370739,0.928709,0.000824,-0.624928,0.780633,0.272073,-0.571520,0.774132,0.506363,-0.419965,0.753105,\n\t\t\t         0.385235,-0.270638,0.882229,0.192328,-0.347056,0.917875,0.272073,-0.571520,0.774132,0.331523,-0.757653,0.562151,\n\t\t\t         0.606311,-0.563341,0.561235,0.506363,-0.419965,0.753105,0.272073,-0.571520,0.774132,0.000824,-0.624928,0.780633,\n\t\t\t         -0.000061,-0.829218,0.558885,0.331523,-0.757653,0.562151,-0.741172,0.293008,0.603961,-0.797662,0.530534,0.286721,\n\t\t\t         -0.883175,0.466720,0.046022,-0.806269,0.296060,0.512070,-0.741172,0.293008,0.603961,-0.727195,0.165471,0.666158,\n\t\t\t         -0.765435,0.514145,0.386944,-0.797662,0.530534,0.286721,-0.741172,0.293008,0.603961,-0.774895,0.416791,0.475143,\n\t\t\t         -0.761071,0.424635,0.490341,-0.727195,0.165471,0.666158,-0.741172,0.293008,0.603961,-0.806269,0.296060,0.512070,\n\t\t\t         -0.820032,0.348064,0.454237,-0.774895,0.416791,0.475143,0.138615,-0.200995,0.969726,-0.004273,-0.217627,0.976012,\n\t\t\t         -0.000458,-0.370739,0.928709,0.192328,-0.347056,0.917875,0.138615,-0.200995,0.969726,0.117313,-0.144871,0.982452,\n\t\t\t         -0.011353,-0.134404,0.990844,-0.004273,-0.217627,0.976012,0.138615,-0.200995,0.969726,0.291238,-0.163793,0.942503,\n\t\t\t         0.283303,-0.160253,0.945524,0.117313,-0.144871,0.982452,0.138615,-0.200995,0.969726,0.192328,-0.347056,0.917875,\n\t\t\t         0.385235,-0.270638,0.882229,0.291238,-0.163793,0.942503,0.829981,-0.443831,0.337809,0.651845,-0.671957,0.351451,\n\t\t\t         0.658925,-0.729240,0.184423,0.853633,-0.491653,0.171911,0.829981,-0.443831,0.337809,0.753380,-0.362987,0.548296,\n\t\t\t         0.606311,-0.563341,0.561235,0.651845,-0.671957,0.351451,0.829981,-0.443831,0.337809,0.900540,-0.277627,0.334513,\n\t\t\t         0.815851,-0.237678,0.527116,0.753380,-0.362987,0.548296,0.829981,-0.443831,0.337809,0.853633,-0.491653,0.171911,\n\t\t\t         0.937712,-0.302286,0.171178,0.900540,-0.277627,0.334513,0.631764,-0.268868,0.726981,0.505142,-0.192022,0.841365,\n\t\t\t         0.385235,-0.270638,0.882229,0.506363,-0.419965,0.753105,0.631764,-0.268868,0.726981,0.691519,-0.195257,0.695425,\n\t\t\t         0.552049,-0.174505,0.815332,0.505142,-0.192022,0.841365,0.631764,-0.268868,0.726981,0.753380,-0.362987,0.548296,\n\t\t\t         0.815851,-0.237678,0.527116,0.691519,-0.195257,0.695425,0.631764,-0.268868,0.726981,0.506363,-0.419965,0.753105,\n\t\t\t         0.606311,-0.563341,0.561235,0.753380,-0.362987,0.548296,0.848628,-0.528611,-0.019532,0.644795,-0.764061,-0.020173,\n\t\t\t         0.518113,-0.691153,-0.503800,0.690603,-0.495071,-0.527146,0.848628,-0.528611,-0.019532,0.853633,-0.491653,0.171911,\n\t\t\t         0.658925,-0.729240,0.184423,0.644795,-0.764061,-0.020173,0.848628,-0.528611,-0.019532,0.946074,-0.323893,0.000305,\n\t\t\t         0.937712,-0.302286,0.171178,0.853633,-0.491653,0.171911,0.848628,-0.528611,-0.019532,0.690603,-0.495071,-0.527146,\n\t\t\t         0.792016,-0.322031,-0.518632,0.946074,-0.323893,0.000305,0.393536,-0.134220,0.909452,0.291238,-0.163793,0.942503,\n\t\t\t         0.385235,-0.270638,0.882229,0.505142,-0.192022,0.841365,0.393536,-0.134220,0.909452,0.399701,-0.151677,0.903989,\n\t\t\t         0.283303,-0.160253,0.945524,0.291238,-0.163793,0.942503,0.393536,-0.134220,0.909452,0.505142,-0.192022,0.841365,\n\t\t\t         0.552049,-0.174505,0.815332,0.399701,-0.151677,0.903989,0.697623,0.337504,0.631947,0.753899,0.571947,0.323222,\n\t\t\t         0.718436,0.540086,0.438337,0.680593,0.202765,0.704031,0.697623,0.337504,0.631947,0.772179,0.345439,0.533219,\n\t\t\t         0.851192,0.522538,0.048952,0.753899,0.571947,0.323222,0.697623,0.337504,0.631947,0.728324,0.460036,0.507767,\n\t\t\t         0.777093,0.387951,0.495560,0.772179,0.345439,0.533219,0.697623,0.337504,0.631947,0.680593,0.202765,0.704031,\n\t\t\t         0.709433,0.472915,0.522507,0.728324,0.460036,0.507767,0.930662,-0.154180,0.331767,0.850642,-0.145573,0.505173,\n\t\t\t         0.815851,-0.237678,0.527116,0.900540,-0.277627,0.334513,0.930662,-0.154180,0.331767,0.947600,-0.057680,0.314127,\n\t\t\t         0.878903,-0.080905,0.470016,0.850642,-0.145573,0.505173,0.930662,-0.154180,0.331767,0.975982,-0.158208,0.149724,\n\t\t\t         0.991943,-0.048402,0.117038,0.947600,-0.057680,0.314127,0.930662,-0.154180,0.331767,0.900540,-0.277627,0.334513,\n\t\t\t         0.937712,-0.302286,0.171178,0.975982,-0.158208,0.149724,0.995605,0.059969,-0.071535,0.867641,-0.045045,-0.495132,\n\t\t\t         0.867946,0.107120,-0.484909,0.982818,0.163396,-0.085635,0.995605,0.059969,-0.071535,0.997375,-0.048830,-0.053072,\n\t\t\t         0.862209,-0.107883,-0.494858,0.867641,-0.045045,-0.495132,0.995605,0.059969,-0.071535,0.994995,0.064211,0.076327,\n\t\t\t         0.991943,-0.048402,0.117038,0.997375,-0.048830,-0.053072,0.995605,0.059969,-0.071535,0.982818,0.163396,-0.085635,\n\t\t\t         0.987182,0.155766,0.033876,0.994995,0.064211,0.076327,0.963958,0.039216,0.263070,0.914274,-0.011414,0.404920,\n\t\t\t         0.878903,-0.080905,0.470016,0.947600,-0.057680,0.314127,0.963958,0.039216,0.263070,0.971923,0.121525,0.201361,\n\t\t\t         0.940519,0.066469,0.333079,0.914274,-0.011414,0.404920,0.963958,0.039216,0.263070,0.994995,0.064211,0.076327,\n\t\t\t         0.987182,0.155766,0.033876,0.971923,0.121525,0.201361,0.963958,0.039216,0.263070,0.947600,-0.057680,0.314127,\n\t\t\t         0.991943,-0.048402,0.117038,0.994995,0.064211,0.076327,0.967284,0.227607,-0.112003,0.858821,0.234657,-0.455306,\n\t\t\t         0.847224,0.262368,-0.461867,0.954924,0.254311,-0.153050,0.967284,0.227607,-0.112003,0.982818,0.163396,-0.085635,\n\t\t\t         0.867946,0.107120,-0.484909,0.858821,0.234657,-0.455306,0.967284,0.227607,-0.112003,0.978362,0.206854,0.001007,\n\t\t\t         0.987182,0.155766,0.033876,0.982818,0.163396,-0.085635,0.967284,0.227607,-0.112003,0.954924,0.254311,-0.153050,\n\t\t\t         0.973144,0.227058,-0.037294,0.978362,0.206854,0.001007,0.973785,0.171026,0.149876,0.979186,0.180425,0.092624,\n\t\t\t         0.974212,0.112888,0.195318,0.956633,0.113590,0.268166,0.973785,0.171026,0.149876,0.978362,0.206854,0.001007,\n\t\t\t         0.973144,0.227058,-0.037294,0.979186,0.180425,0.092624,0.973785,0.171026,0.149876,0.971923,0.121525,0.201361,\n\t\t\t         0.987182,0.155766,0.033876,0.978362,0.206854,0.001007,0.973785,0.171026,0.149876,0.956633,0.113590,0.268166,\n\t\t\t         0.940519,0.066469,0.333079,0.971923,0.121525,0.201361,0.957579,0.214026,-0.192816,0.852168,0.213355,-0.477767,\n\t\t\t         0.873836,0.117405,-0.471786,0.971770,0.113681,-0.206580,0.957579,0.214026,-0.192816,0.954924,0.254311,-0.153050,\n\t\t\t         0.847224,0.262368,-0.461867,0.852168,0.213355,-0.477767,0.957579,0.214026,-0.192816,0.978698,0.186773,-0.084964,\n\t\t\t         0.973144,0.227058,-0.037294,0.954924,0.254311,-0.153050,0.957579,0.214026,-0.192816,0.971770,0.113681,-0.206580,\n\t\t\t         0.987396,0.106876,-0.116581,0.978698,0.186773,-0.084964,0.990539,0.135136,0.023408,0.996796,0.074923,-0.026826,\n\t\t\t         0.978149,0.096438,0.184149,0.991272,0.070223,0.111454,0.990539,0.135136,0.023408,0.978698,0.186773,-0.084964,\n\t\t\t         0.987396,0.106876,-0.116581,0.996796,0.074923,-0.026826,0.990539,0.135136,0.023408,0.979186,0.180425,0.092624,\n\t\t\t         0.973144,0.227058,-0.037294,0.978698,0.186773,-0.084964,0.990539,0.135136,0.023408,0.991272,0.070223,0.111454,\n\t\t\t         0.974212,0.112888,0.195318,0.979186,0.180425,0.092624,0.149144,-0.357250,0.921995,0.164251,-0.413862,0.895383,\n\t\t\t         0.691397,-0.290201,0.661580,0.710532,-0.320048,0.626637,0.710532,-0.320048,0.626637,0.898495,-0.165380,0.406568,\n\t\t\t         0.855190,0.009369,0.518204,0.592639,-0.032502,0.804773,0.710532,-0.320048,0.626637,0.691397,-0.290201,0.661580,\n\t\t\t         0.859066,-0.136082,0.493393,0.898495,-0.165380,0.406568,0.176183,-0.404096,0.897549,0.157689,-0.394513,0.905240,\n\t\t\t         0.645741,-0.227088,0.728965,0.672933,-0.215308,0.707633,0.097232,-0.386822,0.916990,0.042787,-0.296335,0.954100,\n\t\t\t         0.551256,-0.232917,0.801141,0.600360,-0.260933,0.755913,0.672933,-0.215308,0.707633,0.818537,-0.099490,0.565722,\n\t\t\t         0.859066,-0.136082,0.493393,0.691397,-0.290201,0.661580,0.672933,-0.215308,0.707633,0.645741,-0.227088,0.728965,\n\t\t\t         0.778283,-0.128147,0.614643,0.818537,-0.099490,0.565722,0.176183,-0.404096,0.897549,0.672933,-0.215308,0.707633,\n\t\t\t         0.691397,-0.290201,0.661580,0.164251,-0.413862,0.895383,0.600360,-0.260933,0.755913,0.732688,-0.173254,0.658101,\n\t\t\t         0.778283,-0.128147,0.614643,0.645741,-0.227088,0.728965,0.600360,-0.260933,0.755913,0.551256,-0.232917,0.801141,\n\t\t\t         0.682089,-0.174902,0.710013,0.732688,-0.173254,0.658101,0.097232,-0.386822,0.916990,0.600360,-0.260933,0.755913,\n\t\t\t         0.645741,-0.227088,0.728965,0.157689,-0.394513,0.905240,0.744102,-0.147130,0.651631,0.691519,-0.195257,0.695425,\n\t\t\t         0.815851,-0.237678,0.527116,0.850642,-0.145573,0.505173,0.744102,-0.147130,0.651631,0.626087,-0.162847,0.762535,\n\t\t\t         0.552049,-0.174505,0.815332,0.691519,-0.195257,0.695425,0.744102,-0.147130,0.651631,0.798059,-0.121433,0.590167,\n\t\t\t         0.682089,-0.174902,0.710013,0.626087,-0.162847,0.762535,0.744102,-0.147130,0.651631,0.850642,-0.145573,0.505173,\n\t\t\t         0.878903,-0.080905,0.470016,0.798059,-0.121433,0.590167,0.847987,-0.083895,0.523301,0.914274,-0.011414,0.404920,\n\t\t\t         0.940519,0.066469,0.333079,0.886532,-0.017640,0.462294,0.847987,-0.083895,0.523301,0.798059,-0.121433,0.590167,\n\t\t\t         0.878903,-0.080905,0.470016,0.914274,-0.011414,0.404920,0.847987,-0.083895,0.523301,0.732688,-0.173254,0.658101,\n\t\t\t         0.682089,-0.174902,0.710013,0.798059,-0.121433,0.590167,0.847987,-0.083895,0.523301,0.886532,-0.017640,0.462294,\n\t\t\t         0.778283,-0.128147,0.614643,0.732688,-0.173254,0.658101,0.915799,0.023316,0.400922,0.956633,0.113590,0.268166,\n\t\t\t         0.974212,0.112888,0.195318,0.946898,0.011780,0.321238,0.915799,0.023316,0.400922,0.886532,-0.017640,0.462294,\n\t\t\t         0.940519,0.066469,0.333079,0.956633,0.113590,0.268166,0.915799,0.023316,0.400922,0.818537,-0.099490,0.565722,\n\t\t\t         0.778283,-0.128147,0.614643,0.886532,-0.017640,0.462294,0.915799,0.023316,0.400922,0.946898,0.011780,0.321238,\n\t\t\t         0.859066,-0.136082,0.493393,0.818537,-0.099490,0.565722,0.974517,-0.014161,0.223823,0.991272,0.070223,0.111454,\n\t\t\t         0.978149,0.096438,0.184149,0.948271,0.091128,0.303995,0.974517,-0.014161,0.223823,0.946898,0.011780,0.321238,\n\t\t\t         0.974212,0.112888,0.195318,0.991272,0.070223,0.111454,0.974517,-0.014161,0.223823,0.898495,-0.165380,0.406568,\n\t\t\t         0.859066,-0.136082,0.493393,0.946898,0.011780,0.321238,0.974517,-0.014161,0.223823,0.948271,0.091128,0.303995,\n\t\t\t         0.855190,0.009369,0.518204,0.898495,-0.165380,0.406568,0.983947,0.000610,-0.178289,0.905209,-0.005097,-0.424879,\n\t\t\t         0.929746,-0.028382,-0.367016,0.991028,-0.014252,-0.132847,0.983947,0.000610,-0.178289,0.971770,0.113681,-0.206580,\n\t\t\t         0.873836,0.117405,-0.471786,0.905209,-0.005097,-0.424879,0.983947,0.000610,-0.178289,0.992523,0.036927,-0.116245,\n\t\t\t         0.987396,0.106876,-0.116581,0.971770,0.113681,-0.206580,0.983947,0.000610,-0.178289,0.991028,-0.014252,-0.132847,\n\t\t\t         0.994690,0.023164,-0.100101,0.992523,0.036927,-0.116245,0.893674,0.213965,0.394330,0.996185,0.044099,-0.075167,\n\t\t\t         0.927244,0.196142,-0.318918,0.932401,0.195898,0.303598,0.893674,0.213965,0.394330,0.788018,0.158513,0.594867,\n\t\t\t         0.996948,-0.009949,0.077334,0.996185,0.044099,-0.075167,0.893674,0.213965,0.394330,0.907315,0.191992,0.373974,\n\t\t\t         0.892788,0.121677,0.433699,0.788018,0.158513,0.594867,0.893674,0.213965,0.394330,0.932401,0.195898,0.303598,\n\t\t\t         0.905576,0.174352,0.386608,0.907315,0.191992,0.373974,0.998016,0.039064,-0.049318,0.996796,0.074923,-0.026826,\n\t\t\t         0.987396,0.106876,-0.116581,0.992523,0.036927,-0.116245,0.998016,0.039064,-0.049318,0.980224,0.073946,0.183447,\n\t\t\t         0.978149,0.096438,0.184149,0.996796,0.074923,-0.026826,0.998016,0.039064,-0.049318,0.997345,0.042421,-0.058718,\n\t\t\t         0.997040,0.058443,0.049562,0.980224,0.073946,0.183447,0.998016,0.039064,-0.049318,0.992523,0.036927,-0.116245,\n\t\t\t         0.994690,0.023164,-0.100101,0.997345,0.042421,-0.058718,0.513443,0.794397,0.324412,0.522965,0.501328,0.689291,\n\t\t\t         0.718436,0.540086,0.438337,0.640797,0.753624,0.146275,0.513443,0.794397,0.324412,-0.010559,0.885281,0.464888,\n\t\t\t         -0.015442,0.547288,0.836787,0.522965,0.501328,0.689291,0.513443,0.794397,0.324412,0.445479,0.890652,0.090854,\n\t\t\t         -0.005951,0.979522,0.201117,-0.010559,0.885281,0.464888,0.513443,0.794397,0.324412,0.640797,0.753624,0.146275,\n\t\t\t         0.561815,0.822810,-0.085513,0.445479,0.890652,0.090854,0.708243,0.705893,-0.007599,0.845149,0.533586,-0.031037,\n\t\t\t         0.773217,0.569018,-0.279824,0.609638,0.756890,-0.235420,0.708243,0.705893,-0.007599,0.757561,0.652699,-0.004822,\n\t\t\t         0.867183,0.497604,-0.018067,0.845149,0.533586,-0.031037,0.708243,0.705893,-0.007599,0.517441,0.855525,0.017365,\n\t\t\t         0.529069,0.847957,0.032350,0.757561,0.652699,-0.004822,0.708243,0.705893,-0.007599,0.609638,0.756890,-0.235420,\n\t\t\t         0.404065,0.893429,-0.196142,0.517441,0.855525,0.017365,0.927641,0.368572,-0.060183,0.865139,0.383038,-0.323710,\n\t\t\t         0.773217,0.569018,-0.279824,0.845149,0.533586,-0.031037,0.927641,0.368572,-0.060183,0.972015,0.219611,-0.083102,\n\t\t\t         0.907834,0.223090,-0.355022,0.865139,0.383038,-0.323710,0.927641,0.368572,-0.060183,0.935118,0.351177,-0.046907,\n\t\t\t         0.974822,0.211554,-0.069979,0.972015,0.219611,-0.083102,0.927641,0.368572,-0.060183,0.845149,0.533586,-0.031037,\n\t\t\t         0.867183,0.497604,-0.018067,0.935118,0.351177,-0.046907,-0.512436,0.067598,0.856044,-0.562944,0.497055,0.660298,\n\t\t\t         -0.765435,0.514145,0.386944,-0.727195,0.165471,0.666158,-0.512436,0.067598,0.856044,-0.016175,0.059206,0.998108,\n\t\t\t         -0.015442,0.547288,0.836787,-0.562944,0.497055,0.660298,-0.512436,0.067598,0.856044,-0.588122,0.540819,0.601306,\n\t\t\t         -0.002411,0.596057,0.802911,-0.016175,0.059206,0.998108,-0.512436,0.067598,0.856044,-0.727195,0.165471,0.666158,\n\t\t\t         -0.761071,0.424635,0.490341,-0.588122,0.540819,0.601306,0.952910,0.298776,-0.051607,0.904935,0.422193,-0.052736,\n\t\t\t         0.988647,0.139866,0.054659,0.984252,0.132420,0.116947,0.952910,0.298776,-0.051607,0.935118,0.351177,-0.046907,\n\t\t\t         0.867183,0.497604,-0.018067,0.904935,0.422193,-0.052736,0.952910,0.298776,-0.051607,0.981994,0.180914,-0.053926,\n\t\t\t         0.974822,0.211554,-0.069979,0.935118,0.351177,-0.046907,0.952910,0.298776,-0.051607,0.984252,0.132420,0.116947,\n\t\t\t         0.981414,0.110782,0.156468,0.981994,0.180914,-0.053926,0.829218,0.555681,-0.059572,0.757561,0.652699,-0.004822,\n\t\t\t         0.529069,0.847957,0.032350,0.710654,0.703085,-0.024171,0.829218,0.555681,-0.059572,0.904935,0.422193,-0.052736,\n\t\t\t         0.867183,0.497604,-0.018067,0.757561,0.652699,-0.004822,0.829218,0.555681,-0.059572,0.894009,0.443556,-0.062960,\n\t\t\t         0.988647,0.139866,0.054659,0.904935,0.422193,-0.052736,0.829218,0.555681,-0.059572,0.710654,0.703085,-0.024171,\n\t\t\t         0.781335,0.620838,0.063540,0.894009,0.443556,-0.062960,0.566820,0.820582,0.072939,0.566668,0.801843,0.189398,\n\t\t\t         0.781335,0.620838,0.063540,0.710654,0.703085,-0.024171,0.566820,0.820582,0.072939,0.378765,0.919767,0.102603,\n\t\t\t         0.322092,0.914518,0.244636,0.566668,0.801843,0.189398,0.566820,0.820582,0.072939,0.710654,0.703085,-0.024171,\n\t\t\t         0.529069,0.847957,0.032350,0.378765,0.919767,0.102603,0.239570,0.835139,0.495071,0.177068,0.950255,0.256142,\n\t\t\t         0.038078,0.876796,0.479352,0.087741,0.897580,0.431989,0.239570,0.835139,0.495071,0.287667,0.811274,0.508957,\n\t\t\t         0.322092,0.914518,0.244636,0.177068,0.950255,0.256142,0.239570,0.835139,0.495071,0.212317,0.328715,0.920225,\n\t\t\t         0.074068,0.379742,0.922117,0.287667,0.811274,0.508957,0.239570,0.835139,0.495071,0.087741,0.897580,0.431989,\n\t\t\t         0.104429,0.370518,0.922936,0.212317,0.328715,0.920225,0.776879,0.460646,0.429212,0.897549,0.379955,0.223579,\n\t\t\t         0.781335,0.620838,0.063540,0.647359,0.636128,0.419782,0.776879,0.460646,0.429212,0.530168,0.061983,0.845607,\n\t\t\t         0.781793,-0.113804,0.613025,0.897549,0.379955,0.223579,0.776879,0.460646,0.429212,0.647359,0.636128,0.419782,\n\t\t\t         0.298715,0.306528,0.903745,0.530168,0.061983,0.845607,0.947996,0.307840,0.080691,0.958953,-0.103061,0.264077,\n\t\t\t         0.988647,0.139866,0.054659,0.894009,0.443556,-0.062960,0.947996,0.307840,0.080691,0.897549,0.379955,0.223579,\n\t\t\t         0.781793,-0.113804,0.613025,0.958953,-0.103061,0.264077,0.947996,0.307840,0.080691,0.894009,0.443556,-0.062960,\n\t\t\t         0.781335,0.620838,0.063540,0.897549,0.379955,0.223579,0.475814,0.748802,0.461348,0.647359,0.636128,0.419782,\n\t\t\t         0.781335,0.620838,0.063540,0.566668,0.801843,0.189398,0.475814,0.748802,0.461348,0.144810,0.404187,0.903134,\n\t\t\t         0.298715,0.306528,0.903745,0.647359,0.636128,0.419782,0.475814,0.748802,0.461348,0.287667,0.811274,0.508957,\n\t\t\t         0.074068,0.379742,0.922117,0.144810,0.404187,0.903134,0.475814,0.748802,0.461348,0.566668,0.801843,0.189398,\n\t\t\t         0.322092,0.914518,0.244636,0.287667,0.811274,0.508957,0.018281,-0.169195,0.985412,0.506272,-0.189062,0.841365,\n\t\t\t         0.551256,-0.232917,0.801141,0.042787,-0.296335,0.954100,0.400464,-0.191504,0.896054,0.399701,-0.151677,0.903989,\n\t\t\t         0.552049,-0.174505,0.815332,0.460646,-0.182684,0.868557,-0.422651,-0.134861,0.896176,-0.293832,-0.176458,0.939390,\n\t\t\t         -0.248146,-0.157048,0.955901,-0.445906,-0.192846,0.874020,-0.422651,-0.134861,0.896176,-0.584948,-0.188299,0.788873,\n\t\t\t         -0.425581,-0.295206,0.855373,-0.293832,-0.176458,0.939390,-0.422651,-0.134861,0.896176,-0.445906,-0.192846,0.874020,\n\t\t\t         -0.645955,-0.187658,0.739921,-0.584948,-0.188299,0.788873,0.018281,-0.169195,0.985412,-0.052095,-0.076022,0.995727,\n\t\t\t         0.460646,-0.182684,0.868557,0.506272,-0.189062,0.841365,0.506272,-0.189062,0.841365,0.626087,-0.162847,0.762535,\n\t\t\t         0.682089,-0.174902,0.710013,0.551256,-0.232917,0.801141,0.506272,-0.189062,0.841365,0.460646,-0.182684,0.868557,\n\t\t\t         0.552049,-0.174505,0.815332,0.626087,-0.162847,0.762535,0.149144,-0.357250,0.921995,0.710532,-0.320048,0.626637,\n\t\t\t         0.592639,-0.032502,0.804773,0.052309,-0.087741,0.994751,0.001312,-0.529252,0.848445,-0.008979,-0.587725,0.809011,\n\t\t\t         -0.102850,0.372242,0.922419,-0.008703,-0.541538,0.840632,0.001312,-0.529252,0.848445,-0.001190,-0.507584,0.861568,\n\t\t\t         0.104429,0.370518,0.922936,-0.008979,-0.587725,0.809011,0.001312,-0.529252,0.848445,-0.008703,-0.541538,0.840632,\n\t\t\t         0.000551,-0.433598,0.901106,-0.001190,-0.507584,0.861568,0.097232,-0.386822,0.916990,-0.061098,-0.410260,0.909879,\n\t\t\t         -0.095920,-0.311533,0.945372,0.042787,-0.296335,0.954100,0.097232,-0.386822,0.916990,0.157689,-0.394513,0.905240,\n\t\t\t         -0.005860,-0.447676,0.894162,-0.061098,-0.410260,0.909879,0.176183,-0.404096,0.897549,0.066073,-0.454176,0.888424,\n\t\t\t         -0.005860,-0.447676,0.894162,0.157689,-0.394513,0.905240,0.176183,-0.404096,0.897549,0.164251,-0.413862,0.895383,\n\t\t\t         0.124668,-0.440443,0.889035,0.066073,-0.454176,0.888424,0.149144,-0.357250,0.921995,-0.021210,-0.340434,0.940001,\n\t\t\t         0.124668,-0.440443,0.889035,0.164251,-0.413862,0.895383,0.149144,-0.357250,0.921995,0.052309,-0.087741,0.994751,\n\t\t\t         -0.018860,-0.032441,0.999268,-0.021210,-0.340434,0.940001,0.018281,-0.169195,0.985412,-0.115085,-0.179418,0.976989,\n\t\t\t         -0.195410,-0.058107,0.978973,-0.052095,-0.076022,0.995727,0.018281,-0.169195,0.985412,0.042787,-0.296335,0.954100,\n\t\t\t         -0.095920,-0.311533,0.945372,-0.115085,-0.179418,0.976989,0.278451,0.308878,0.909391,0.010713,0.446334,0.894802,\n\t\t\t         0.089105,0.310275,0.946462,-0.113359,0.451280,0.885153,-0.127354,0.295816,0.946684,0.052309,-0.087741,0.994751,\n\t\t\t         0.592639,-0.032502,0.804773,-0.143742,0.030580,0.989135,-0.442335,0.199164,0.874416,-0.467483,0.386761,0.794885,\n\t\t\t         -0.047639,0.138096,0.989257,-0.143742,0.030580,0.989135,-0.052095,-0.076022,0.995727,-0.195410,-0.058107,0.978973,\n\t\t\t         -0.442335,0.199164,0.874416,0.027223,0.143498,0.989257,0.117313,-0.144871,0.982452,0.283303,-0.160253,0.945524,\n\t\t\t         -0.047639,0.138096,0.989257,0.027223,0.143498,0.989257,-0.019196,0.177770,0.983856,-0.011353,-0.134404,0.990844,\n\t\t\t         0.117313,-0.144871,0.982452,0.027223,0.143498,0.989257,-0.155217,0.351665,0.923154,-0.002441,0.142644,0.989746,\n\t\t\t         -0.019196,0.177770,0.983856,0.027223,0.143498,0.989257,-0.047639,0.138096,0.989257,-0.467483,0.386761,0.794885,\n\t\t\t         -0.155217,0.351665,0.923154,-0.072848,-0.427900,0.900876,0.161931,-0.418439,0.893674,0.161504,-0.436933,0.884854,\n\t\t\t         -0.152776,-0.430921,0.889340,-0.072848,-0.427900,0.900876,0.011292,-0.366863,0.930204,0.153325,-0.357677,0.921140,\n\t\t\t         0.161931,-0.418439,0.893674,-0.188513,-0.436659,0.879635,0.120426,-0.453780,0.882900,0.078677,-0.433027,0.897916,\n\t\t\t         -0.182714,-0.429304,0.884457,-0.188513,-0.436659,0.879635,-0.152776,-0.430921,0.889340,0.161504,-0.436933,0.884854,\n\t\t\t         0.120426,-0.453780,0.882900,-0.166082,-0.332286,0.928404,0.153142,-0.279092,0.947966,0.112918,0.064943,0.991455,\n\t\t\t         -0.160436,-0.040498,0.986206,-0.166082,-0.332286,0.928404,-0.182714,-0.429304,0.884457,0.078677,-0.433027,0.897916,\n\t\t\t         0.153142,-0.279092,0.947966,0.018189,-0.280526,0.959655,0.173711,-0.278207,0.944670,0.153325,-0.357677,0.921140,\n\t\t\t         0.011292,-0.366863,0.930204,0.018189,-0.280526,0.959655,0.043794,-0.223395,0.973724,0.217353,-0.203589,0.954588,\n\t\t\t         0.173711,-0.278207,0.944670,0.460646,-0.182684,0.868557,-0.052095,-0.076022,0.995727,-0.143742,0.030580,0.989135,\n\t\t\t         0.400464,-0.191504,0.896054,0.130467,-0.109592,0.985351,0.329691,-0.024201,0.943754,0.217353,-0.203589,0.954588,\n\t\t\t         0.043794,-0.223395,0.973724,0.130467,-0.109592,0.985351,0.079012,0.079897,0.993652,0.368053,0.242531,0.897580,\n\t\t\t         0.329691,-0.024201,0.943754,-0.010071,0.170385,0.985321,-0.105930,-0.127934,0.986084,-0.011353,-0.134404,0.990844,\n\t\t\t         -0.019196,0.177770,0.983856,-0.010071,0.170385,0.985321,0.079012,0.079897,0.993652,-0.248146,-0.157048,0.955901,\n\t\t\t         -0.105930,-0.127934,0.986084,-0.010071,0.170385,0.985321,0.095462,0.256630,0.961760,0.368053,0.242531,0.897580,\n\t\t\t         0.079012,0.079897,0.993652,-0.010071,0.170385,0.985321,-0.019196,0.177770,0.983856,-0.002441,0.142644,0.989746,\n\t\t\t         0.095462,0.256630,0.961760,-0.124210,-0.498672,0.857814,-0.099796,-0.474288,0.874660,0.102481,-0.461806,0.881008,\n\t\t\t         0.098086,-0.490616,0.865810,-0.124210,-0.498672,0.857814,0.120426,-0.453780,0.882900,0.161504,-0.436933,0.884854,\n\t\t\t         -0.099796,-0.474288,0.874660,-0.124210,-0.498672,0.857814,-0.149632,-0.530045,0.834651,0.078677,-0.433027,0.897916,\n\t\t\t         0.120426,-0.453780,0.882900,-0.124210,-0.498672,0.857814,0.098086,-0.490616,0.865810,0.091311,-0.542894,0.834803,\n\t\t\t         -0.149632,-0.530045,0.834651,-0.083956,-0.441694,0.893216,-0.082492,-0.367504,0.926328,0.102664,-0.356120,0.928770,\n\t\t\t         0.105441,-0.428694,0.897244,-0.083956,-0.441694,0.893216,0.161931,-0.418439,0.893674,0.153325,-0.357677,0.921140,\n\t\t\t         -0.082492,-0.367504,0.926328,-0.083956,-0.441694,0.893216,-0.099796,-0.474288,0.874660,0.161504,-0.436933,0.884854,\n\t\t\t         0.161931,-0.418439,0.893674,-0.083956,-0.441694,0.893216,0.105441,-0.428694,0.897244,0.102481,-0.461806,0.881008,\n\t\t\t         -0.099796,-0.474288,0.874660,0.406812,-0.383251,0.829218,0.420728,-0.447920,0.788873,0.124668,-0.440443,0.889035,\n\t\t\t         -0.021210,-0.340434,0.940001,0.406812,-0.383251,0.829218,0.499557,0.005219,0.866237,0.504227,-0.088260,0.859004,\n\t\t\t         0.420728,-0.447920,0.788873,0.406812,-0.383251,0.829218,-0.021210,-0.340434,0.940001,-0.018860,-0.032441,0.999268,\n\t\t\t         0.499557,0.005219,0.866237,0.248085,-0.253517,0.934965,0.087100,-0.271828,0.958373,0.069216,-0.236335,0.969176,\n\t\t\t         0.234443,-0.234840,0.943327,0.248085,-0.253517,0.934965,0.260475,-0.331187,0.906888,0.102664,-0.356120,0.928770,\n\t\t\t         0.087100,-0.271828,0.958373,0.248085,-0.253517,0.934965,-0.115085,-0.179418,0.976989,-0.095920,-0.311533,0.945372,\n\t\t\t         0.260475,-0.331187,0.906888,0.248085,-0.253517,0.934965,0.234443,-0.234840,0.943327,-0.195410,-0.058107,0.978973,\n\t\t\t         -0.115085,-0.179418,0.976989,0.004547,-0.075564,0.997101,0.329691,-0.024201,0.943754,0.368053,0.242531,0.897580,\n\t\t\t         0.095462,0.256630,0.961760,0.004547,-0.075564,0.997101,-0.128208,-0.231758,0.964263,0.217353,-0.203589,0.954588,\n\t\t\t         0.329691,-0.024201,0.943754,0.004547,-0.075564,0.997101,0.095462,0.256630,0.961760,-0.002441,0.142644,0.989746,\n\t\t\t         -0.128208,-0.231758,0.964263,-0.128117,0.104923,0.986175,-0.155217,0.351665,0.923154,-0.467483,0.386761,0.794885,\n\t\t\t         -0.442335,0.199164,0.874416,-0.128117,0.104923,0.986175,0.103488,-0.131993,0.985809,-0.002441,0.142644,0.989746,\n\t\t\t         -0.155217,0.351665,0.923154,-0.128117,0.104923,0.986175,-0.442335,0.199164,0.874416,-0.195410,-0.058107,0.978973,\n\t\t\t         0.103488,-0.131993,0.985809,-0.134037,-0.256355,0.957213,0.053774,-0.252602,0.966063,0.069216,-0.236335,0.969176,\n\t\t\t         -0.123142,-0.255837,0.958831,-0.134037,-0.256355,0.957213,-0.128208,-0.231758,0.964263,-0.002441,0.142644,0.989746,\n\t\t\t         0.053774,-0.252602,0.966063,-0.134037,-0.256355,0.957213,-0.123142,-0.255837,0.958831,0.217353,-0.203589,0.954588,\n\t\t\t         -0.128208,-0.231758,0.964263,0.310465,-0.438459,0.843379,0.289773,-0.416730,0.861568,-0.005860,-0.447676,0.894162,\n\t\t\t         0.066073,-0.454176,0.888424,0.310465,-0.438459,0.843379,0.098086,-0.490616,0.865810,0.102481,-0.461806,0.881008,\n\t\t\t         0.289773,-0.416730,0.861568,0.310465,-0.438459,0.843379,0.328196,-0.490249,0.807398,0.091311,-0.542894,0.834803,\n\t\t\t         0.098086,-0.490616,0.865810,0.310465,-0.438459,0.843379,0.066073,-0.454176,0.888424,0.124668,-0.440443,0.889035,\n\t\t\t         0.328196,-0.490249,0.807398,0.272896,-0.394452,0.877438,0.260475,-0.331187,0.906888,-0.095920,-0.311533,0.945372,\n\t\t\t         -0.061098,-0.410260,0.909879,0.272896,-0.394452,0.877438,0.105441,-0.428694,0.897244,0.102664,-0.356120,0.928770,\n\t\t\t         0.260475,-0.331187,0.906888,0.272896,-0.394452,0.877438,0.289773,-0.416730,0.861568,0.102481,-0.461806,0.881008,\n\t\t\t         0.105441,-0.428694,0.897244,0.272896,-0.394452,0.877438,-0.061098,-0.410260,0.909879,-0.005860,-0.447676,0.894162,\n\t\t\t         0.289773,-0.416730,0.861568,-0.098514,-0.286905,0.952849,0.173711,-0.278207,0.944670,0.217353,-0.203589,0.954588,\n\t\t\t         -0.123142,-0.255837,0.958831,-0.098514,-0.286905,0.952849,-0.082492,-0.367504,0.926328,0.153325,-0.357677,0.921140,\n\t\t\t         0.173711,-0.278207,0.944670,-0.098514,-0.286905,0.952849,0.087100,-0.271828,0.958373,0.102664,-0.356120,0.928770,\n\t\t\t         -0.082492,-0.367504,0.926328,-0.098514,-0.286905,0.952849,-0.123142,-0.255837,0.958831,0.069216,-0.236335,0.969176,\n\t\t\t         0.087100,-0.271828,0.958373,0.225990,-0.251228,0.941160,0.103488,-0.131993,0.985809,-0.195410,-0.058107,0.978973,\n\t\t\t         0.234443,-0.234840,0.943327,0.225990,-0.251228,0.941160,0.053774,-0.252602,0.966063,-0.002441,0.142644,0.989746,\n\t\t\t         0.103488,-0.131993,0.985809,0.225990,-0.251228,0.941160,0.234443,-0.234840,0.943327,0.069216,-0.236335,0.969176,\n\t\t\t         0.053774,-0.252602,0.966063,-0.173864,-0.508591,0.843257,-0.149632,-0.530045,0.834651,0.091311,-0.542894,0.834803,\n\t\t\t         0.089389,-0.538316,0.837977,-0.173864,-0.508591,0.843257,-0.274667,-0.439314,0.855281,0.078677,-0.433027,0.897916,\n\t\t\t         -0.149632,-0.530045,0.834651,-0.173864,-0.508591,0.843257,-0.194800,-0.141087,0.970611,-0.357830,-0.054506,0.932157,\n\t\t\t         -0.274667,-0.439314,0.855281,-0.173864,-0.508591,0.843257,0.089389,-0.538316,0.837977,0.099094,-0.173315,0.979858,\n\t\t\t         -0.194800,-0.141087,0.970611,-0.302438,-0.333537,0.892880,-0.274667,-0.439314,0.855281,-0.357830,-0.054506,0.932157,\n\t\t\t         -0.393658,0.063082,0.917081,-0.302438,-0.333537,0.892880,0.153142,-0.279092,0.947966,0.078677,-0.433027,0.897916,\n\t\t\t         -0.274667,-0.439314,0.855281,-0.302438,-0.333537,0.892880,-0.393658,0.063082,0.917081,0.112918,0.064943,0.991455,\n\t\t\t         0.153142,-0.279092,0.947966,0.339915,-0.503830,0.794061,0.328196,-0.490249,0.807398,0.124668,-0.440443,0.889035,\n\t\t\t         0.420728,-0.447920,0.788873,0.339915,-0.503830,0.794061,0.089389,-0.538316,0.837977,0.091311,-0.542894,0.834803,\n\t\t\t         0.328196,-0.490249,0.807398,0.339915,-0.503830,0.794061,0.374706,-0.156560,0.913785,0.099094,-0.173315,0.979858,\n\t\t\t         0.089389,-0.538316,0.837977,0.339915,-0.503830,0.794061,0.420728,-0.447920,0.788873,0.504227,-0.088260,0.859004,\n\t\t\t         0.374706,-0.156560,0.913785,0.455428,0.525834,0.718345,0.499557,0.005219,0.866237,-0.018860,-0.032441,0.999268,\n\t\t\t         0.034272,0.483322,0.874752,0.455428,0.525834,0.718345,0.456374,0.473983,0.753014,0.504227,-0.088260,0.859004,\n\t\t\t         0.499557,0.005219,0.866237,0.455428,0.525834,0.718345,0.396294,0.694607,0.600394,0.395573,0.677325,0.620285,\n\t\t\t         0.456374,0.473983,0.753014,0.455428,0.525834,0.718345,0.034272,0.483322,0.874752,0.165106,0.686859,0.707789,\n\t\t\t         0.396294,0.694607,0.600394,-0.621204,-0.599902,0.504135,-0.945189,-0.085452,0.315073,-0.994812,0.100497,0.015259,\n\t\t\t         -0.736991,-0.548601,0.394757,-0.621204,-0.599902,0.504135,-0.255287,-0.492721,0.831874,-0.727531,-0.014283,0.685903,\n\t\t\t         -0.945189,-0.085452,0.315073,-0.621204,-0.599902,0.504135,-0.259836,-0.800343,0.540311,-0.009446,-0.663125,0.748450,\n\t\t\t         -0.255287,-0.492721,0.831874,-0.621204,-0.599902,0.504135,-0.736991,-0.548601,0.394757,-0.234857,-0.775122,0.586539,\n\t\t\t         -0.259836,-0.800343,0.540311,0.278451,0.308878,0.909391,0.592639,-0.032502,0.804773,0.855190,0.009369,0.518204,\n\t\t\t         0.461989,0.399976,0.791559,0.130467,-0.109592,0.985351,-0.423963,-0.261727,0.867000,-0.248146,-0.157048,0.955901,\n\t\t\t         0.079012,0.079897,0.993652,-0.423963,-0.261727,0.867000,-0.445906,-0.192846,0.874020,-0.248146,-0.157048,0.955901,\n\t\t\t         0.278451,0.308878,0.909391,0.461989,0.399976,0.791559,-0.024191,0.561487,0.827132,0.010713,0.446334,0.894802,\n\t\t\t         -0.569597,0.181829,0.801538,-0.989349,0.083010,0.119297,-0.986541,0.094699,0.133244,-0.529466,0.377117,0.759850,\n\t\t\t         -0.569597,0.181829,0.801538,-0.995849,0.013947,0.089633,-0.999329,0.031312,-0.018006,-0.989349,0.083010,0.119297,\n\t\t\t         -0.569597,0.181829,0.801538,-0.624012,-0.171575,0.762291,-0.998901,0.018342,0.043001,-0.995849,0.013947,0.089633,\n\t\t\t         -0.569597,0.181829,0.801538,0.184858,0.185631,0.965074,0.131925,-0.149977,0.979848,-0.624012,-0.171575,0.762291,\n\t\t\t         -0.569597,0.181829,0.801538,-0.529466,0.377117,0.759850,0.146702,0.402113,0.903761,0.184858,0.185631,0.965074,\n\t\t\t         0.331828,0.443464,0.832575,0.374706,-0.156560,0.913785,0.504227,-0.088260,0.859004,0.456374,0.473983,0.753014,\n\t\t\t         0.331828,0.443464,0.832575,0.088626,0.440535,0.893307,0.099094,-0.173315,0.979858,0.374706,-0.156560,0.913785,\n\t\t\t         0.331828,0.443464,0.832575,0.281126,0.683167,0.673981,0.073252,0.696244,0.714058,0.088626,0.440535,0.893307,\n\t\t\t         0.331828,0.443464,0.832575,0.456374,0.473983,0.753014,0.395573,0.677325,0.620285,0.281126,0.683167,0.673981,\n\t\t\t         -0.367626,0.546983,0.752068,-0.393658,0.063082,0.917081,-0.357830,-0.054506,0.932157,-0.328745,0.497604,0.802667,\n\t\t\t         -0.367626,0.546983,0.752068,0.032929,0.519700,0.853694,0.112918,0.064943,0.991455,-0.393658,0.063082,0.917081,\n\t\t\t         -0.367626,0.546983,0.752068,-0.324917,0.698814,0.637250,-0.091570,0.688482,0.719450,0.032929,0.519700,0.853694,\n\t\t\t         -0.367626,0.546983,0.752068,-0.328745,0.497604,0.802667,-0.291287,0.691039,0.661526,-0.324917,0.698814,0.637250,\n\t\t\t         -0.047639,0.138096,0.989257,0.283303,-0.160253,0.945524,0.400464,-0.191504,0.896054,-0.143742,0.030580,0.989135,\n\t\t\t         -0.399152,0.409803,0.820185,-0.480758,0.478378,0.734825,-0.912534,0.049074,0.405988,-0.714591,0.073397,0.695669,\n\t\t\t         -0.399152,0.409803,0.820185,-0.036049,0.567330,0.822701,0.037591,0.609890,0.791594,-0.480758,0.478378,0.734825,\n\t\t\t         -0.533738,-0.239235,0.811090,-0.423963,-0.261727,0.867000,0.130467,-0.109592,0.985351,0.043794,-0.223395,0.973724,\n\t\t\t         0.176397,0.971343,0.159215,0.177068,0.950255,0.256142,0.322092,0.914518,0.244636,0.378765,0.919767,0.102603,\n\t\t\t         0.176397,0.971343,0.159215,0.043794,0.978179,0.203040,0.038078,0.876796,0.479352,0.177068,0.950255,0.256142,\n\t\t\t         0.176397,0.971343,0.159215,0.230506,0.965941,0.117496,-0.002228,0.985076,0.172063,0.043794,0.978179,0.203040,\n\t\t\t         0.176397,0.971343,0.159215,0.378765,0.919767,0.102603,0.529069,0.847957,0.032350,0.230506,0.965941,0.117496,\n\t\t\t         0.055086,-0.370403,0.927213,0.530168,0.061983,0.845607,0.298715,0.306528,0.903745,-0.158116,-0.197058,0.967528,\n\t\t\t         0.055086,-0.370403,0.927213,0.383251,-0.573016,0.724387,0.781793,-0.113804,0.613025,0.530168,0.061983,0.845607,\n\t\t\t         0.055086,-0.370403,0.927213,-0.134610,-0.503230,0.853604,0.179169,-0.726085,0.663852,0.383251,-0.573016,0.724387,\n\t\t\t         0.055086,-0.370403,0.927213,-0.158116,-0.197058,0.967528,-0.308381,-0.367131,0.877563,-0.134610,-0.503230,0.853604,\n\t\t\t         -0.523148,0.469436,0.711264,-0.958861,0.091159,0.268777,-0.912534,0.049074,0.405988,-0.480758,0.478378,0.734825,\n\t\t\t         -0.523148,0.469436,0.711264,-0.529466,0.377117,0.759850,-0.986541,0.094699,0.133244,-0.958861,0.091159,0.268777,\n\t\t\t         -0.523148,0.469436,0.711264,0.087233,0.546721,0.832758,0.146702,0.402113,0.903761,-0.529466,0.377117,0.759850,\n\t\t\t         -0.523148,0.469436,0.711264,-0.480758,0.478378,0.734825,0.037591,0.609890,0.791594,0.087233,0.546721,0.832758,\n\t\t\t         0.679556,-0.282418,0.677053,0.984252,0.132420,0.116947,0.988647,0.139866,0.054659,0.747093,-0.497177,0.441145,\n\t\t\t         0.679556,-0.282418,0.677053,0.562304,0.010254,0.826838,0.981414,0.110782,0.156468,0.984252,0.132420,0.116947,\n\t\t\t         0.679556,-0.282418,0.677053,0.081465,-0.414077,0.906589,-0.061658,-0.042886,0.997176,0.562304,0.010254,0.826838,\n\t\t\t         0.679556,-0.282418,0.677053,0.747093,-0.497177,0.441145,0.277094,-0.725594,0.629867,0.081465,-0.414077,0.906589,\n\t\t\t         -0.127354,0.295816,0.946684,0.034272,0.483322,0.874752,-0.018860,-0.032441,0.999268,0.052309,-0.087741,0.994751,\n\t\t\t         -0.127354,0.295816,0.946684,-0.113359,0.451280,0.885153,0.165106,0.686859,0.707789,0.034272,0.483322,0.874752,\n\t\t\t         0.140812,0.388623,0.910550,0.114918,0.520323,0.846202,-0.150103,0.433360,0.888633,-0.036049,0.567330,0.822701,\n\t\t\t         -0.399152,0.409803,0.820185,-0.714591,0.073397,0.695669,-0.160436,-0.040498,0.986206,0.061281,-0.263192,0.962767,\n\t\t\t         -0.474563,0.173498,0.862911,-0.727531,-0.014283,0.685903,-0.255287,-0.492721,0.831874,0.061281,-0.263192,0.962767,\n\t\t\t         0.221381,-0.121586,0.967559,-0.269539,0.373089,0.887753,-0.474563,0.173498,0.862911,0.061281,-0.263192,0.962767,\n\t\t\t         0.272108,-0.397122,0.876499,0.362722,-0.257095,0.895732,0.221381,-0.121586,0.967559,0.061281,-0.263192,0.962767,\n\t\t\t         -0.255287,-0.492721,0.831874,-0.009446,-0.663125,0.748450,0.272108,-0.397122,0.876499,-0.711081,-0.442274,0.546556,\n\t\t\t         -0.997497,0.064943,0.027711,-0.998901,0.018342,0.043001,-0.624012,-0.171575,0.762291,-0.711081,-0.442274,0.546556,\n\t\t\t         -0.736991,-0.548601,0.394757,-0.994812,0.100497,0.015259,-0.997497,0.064943,0.027711,-0.711081,-0.442274,0.546556,\n\t\t\t         -0.051533,-0.568378,0.821152,-0.234857,-0.775122,0.586539,-0.736991,-0.548601,0.394757,-0.711081,-0.442274,0.546556,\n\t\t\t         -0.624012,-0.171575,0.762291,0.131925,-0.149977,0.979848,-0.051533,-0.568378,0.821152,0.140812,0.388623,0.910550,\n\t\t\t         -0.160436,-0.040498,0.986206,0.112918,0.064943,0.991455,0.032929,0.519700,0.853694,0.399701,-0.151677,0.903989,\n\t\t\t         0.400464,-0.191504,0.896054,0.283303,-0.160253,0.945524,0.140812,0.388623,0.910550,0.032929,0.519700,0.853694,\n\t\t\t         -0.091570,0.688482,0.719450,0.114918,0.520323,0.846202,-0.170904,0.458296,0.872189,-0.194800,-0.141087,0.970611,\n\t\t\t         0.099094,-0.173315,0.979858,0.088626,0.440535,0.893307,-0.170904,0.458296,0.872189,-0.328745,0.497604,0.802667,\n\t\t\t         -0.357830,-0.054506,0.932157,-0.194800,-0.141087,0.970611,-0.170904,0.458296,0.872189,-0.149100,0.694035,0.704333,\n\t\t\t         -0.291287,0.691039,0.661526,-0.328745,0.497604,0.802667,-0.170904,0.458296,0.872189,0.088626,0.440535,0.893307,\n\t\t\t         0.073252,0.696244,0.714058,-0.149100,0.694035,0.704333,-0.237190,0.847743,0.474380,-0.294687,0.817408,0.494949,\n\t\t\t         -0.082186,0.383923,0.919675,-0.214972,0.334971,0.917356,-0.237190,0.847743,0.474380,-0.177801,0.950346,0.255318,\n\t\t\t         -0.329325,0.913877,0.237373,-0.294687,0.817408,0.494949,-0.237190,0.847743,0.474380,-0.081668,0.903043,0.421644,\n\t\t\t         -0.029992,0.876364,0.480715,-0.177801,0.950346,0.255318,-0.237190,0.847743,0.474380,-0.214972,0.334971,0.917356,\n\t\t\t         -0.102850,0.372242,0.922419,-0.081668,0.903043,0.421644,-0.244148,-0.137944,0.959868,0.144810,0.404187,0.903134,\n\t\t\t         0.074068,0.379742,0.922117,-0.179571,-0.192236,0.964751,-0.244148,-0.137944,0.959868,-0.158116,-0.197058,0.967528,\n\t\t\t         0.298715,0.306528,0.903745,0.144810,0.404187,0.903134,-0.244148,-0.137944,0.959868,-0.355187,-0.320596,0.878100,\n\t\t\t         -0.308381,-0.367131,0.877563,-0.158116,-0.197058,0.967528,-0.244148,-0.137944,0.959868,-0.179571,-0.192236,0.964751,\n\t\t\t         -0.231688,-0.356085,0.905276,-0.355187,-0.320596,0.878100,0.665487,-0.613758,0.424696,0.958953,-0.103061,0.264077,\n\t\t\t         0.781793,-0.113804,0.613025,0.383251,-0.573016,0.724387,0.665487,-0.613758,0.424696,0.747093,-0.497177,0.441145,\n\t\t\t         0.988647,0.139866,0.054659,0.958953,-0.103061,0.264077,0.665487,-0.613758,0.424696,0.351062,-0.808872,0.471680,\n\t\t\t         0.277094,-0.725594,0.629867,0.747093,-0.497177,0.441145,0.665487,-0.613758,0.424696,0.383251,-0.573016,0.724387,\n\t\t\t         0.179169,-0.726085,0.663852,0.351062,-0.808872,0.471680,0.267861,-0.111667,0.956938,-0.144047,0.423811,0.894192,\n\t\t\t         -0.269539,0.373089,0.887753,0.221381,-0.121586,0.967559,0.267861,-0.111667,0.956938,0.165865,-0.103594,0.980692,\n\t\t\t         -0.082186,0.383923,0.919675,-0.144047,0.423811,0.894192,0.267861,-0.111667,0.956938,0.377462,-0.261401,0.888365,\n\t\t\t         0.331875,-0.320981,0.887034,0.165865,-0.103594,0.980692,0.267861,-0.111667,0.956938,0.221381,-0.121586,0.967559,\n\t\t\t         0.362722,-0.257095,0.895732,0.377462,-0.261401,0.888365,0.576037,0.204749,0.791345,0.977142,0.104007,0.185247,\n\t\t\t         0.981414,0.110782,0.156468,0.562304,0.010254,0.826838,0.576037,0.204749,0.791345,0.980224,0.073946,0.183447,\n\t\t\t         0.997040,0.058443,0.049562,0.977142,0.104007,0.185247,0.576037,0.204749,0.791345,0.534867,0.350200,0.768914,\n\t\t\t         0.978149,0.096438,0.184149,0.980224,0.073946,0.183447,0.576037,0.204749,0.791345,-0.106174,0.222087,0.969229,\n\t\t\t         -0.084596,0.412832,0.906870,0.534867,0.350200,0.768914,0.576037,0.204749,0.791345,0.562304,0.010254,0.826838,\n\t\t\t         -0.061658,-0.042886,0.997176,-0.106174,0.222087,0.969229,0.538499,0.437544,0.720084,0.948271,0.091128,0.303995,\n\t\t\t         0.978149,0.096438,0.184149,0.534867,0.350200,0.768914,0.538499,0.437544,0.720084,0.461989,0.399976,0.791559,\n\t\t\t         0.855190,0.009369,0.518204,0.948271,0.091128,0.303995,0.538499,0.437544,0.720084,-0.036822,0.539644,0.841088,\n\t\t\t         -0.024191,0.561487,0.827132,0.461989,0.399976,0.791559,0.538499,0.437544,0.720084,0.534867,0.350200,0.768914,\n\t\t\t         -0.084596,0.412832,0.906870,-0.036822,0.539644,0.841088,-0.000824,0.899747,0.436354,-0.000117,0.675252,0.737587,\n\t\t\t         -0.029992,0.876364,0.480715,-0.081668,0.903043,0.421644,-0.000824,0.899747,0.436354,0.087741,0.897580,0.431989,\n\t\t\t         0.038078,0.876796,0.479352,-0.000117,0.675252,0.737587,-0.000824,0.899747,0.436354,0.003217,0.995772,0.091803,\n\t\t\t         0.104429,0.370518,0.922936,0.087741,0.897580,0.431989,-0.000824,0.899747,0.436354,-0.081668,0.903043,0.421644,\n\t\t\t         -0.102850,0.372242,0.922419,0.003217,0.995772,0.091803,-0.000305,0.882260,-0.470748,0.000140,0.950147,-0.311803,\n\t\t\t         -0.043706,0.949020,-0.312173,-0.021908,0.880853,-0.472883,-0.000305,0.882260,-0.470748,0.022137,0.883349,-0.468193,\n\t\t\t         0.043007,0.949482,-0.310862,0.000140,0.950147,-0.311803,-0.000305,0.882260,-0.470748,0.000000,0.599994,-0.799982,\n\t\t\t         0.000000,0.601100,-0.799174,0.022137,0.883349,-0.468193,-0.000305,0.882260,-0.470748,-0.021908,0.880853,-0.472883,\n\t\t\t         -0.000000,0.599670,-0.800247,0.000000,0.599994,-0.799982,0.000000,0.334727,-0.942289,0.000000,0.599994,-0.799982,\n\t\t\t         -0.000000,0.599670,-0.800247,0.000000,0.334989,-0.942222,0.000000,0.334727,-0.942289,0.000000,0.334703,-0.942324,\n\t\t\t         0.000000,0.601100,-0.799174,0.000000,0.599994,-0.799982,0.000000,0.334727,-0.942289,0.000000,0.720695,-0.693197,\n\t\t\t         -0.000001,0.718576,-0.695449,0.000000,0.334703,-0.942324,0.000000,0.334727,-0.942289,0.000000,0.334989,-0.942222,\n\t\t\t         0.000001,0.720831,-0.693110,0.000000,0.720695,-0.693197,0.000000,0.912534,0.408948,0.000000,0.720695,-0.693197,\n\t\t\t         0.000001,0.720831,-0.693110,0.000002,0.907539,0.419967,0.000000,0.912534,0.408948,-0.000002,0.917140,0.398565,\n\t\t\t         -0.000001,0.718576,-0.695449,0.000000,0.720695,-0.693197,0.000000,0.912534,0.408948,0.000000,0.212989,0.977020,\n\t\t\t         -0.000002,0.216153,0.976359,-0.000002,0.917140,0.398565,0.000000,0.912534,0.408948,0.000002,0.907539,0.419967,\n\t\t\t         0.000002,0.208340,0.978056,0.000000,0.212989,0.977020,0.000000,-0.187231,0.982299,0.000000,0.212989,0.977020,\n\t\t\t         0.000002,0.208340,0.978056,0.000002,-0.189297,0.981920,0.000000,-0.187231,0.982299,-0.000002,-0.186241,0.982504,\n\t\t\t         -0.000002,0.216153,0.976359,0.000000,0.212989,0.977020,0.000000,-0.187231,0.982299,0.000000,-0.591571,0.806207,\n\t\t\t         -0.000001,-0.592591,0.805503,-0.000002,-0.186241,0.982504,0.000000,-0.187231,0.982299,0.000002,-0.189297,0.981920,\n\t\t\t         0.000001,-0.591589,0.806240,0.000000,-0.591571,0.806207,0.000000,-0.882382,0.470473,0.000000,-0.591571,0.806207,\n\t\t\t         0.000001,-0.591589,0.806240,-0.001356,-0.881264,0.472622,0.000000,-0.882382,0.470473,0.001386,-0.883593,0.468253,\n\t\t\t         -0.000001,-0.592591,0.805503,0.000000,-0.591571,0.806207,0.000000,-0.882382,0.470473,0.000031,-0.945208,0.326468,\n\t\t\t         0.002695,-0.945184,0.326527,0.001386,-0.883593,0.468253,0.000000,-0.882382,0.470473,-0.001356,-0.881264,0.472622,\n\t\t\t         -0.002723,-0.945226,0.326405,0.000031,-0.945208,0.326468,-0.090801,-0.375722,0.922273,-0.214972,0.334971,0.917356,\n\t\t\t         -0.082186,0.383923,0.919675,0.165865,-0.103594,0.980692,-0.090801,-0.375722,0.922273,-0.008703,-0.541538,0.840632,\n\t\t\t         -0.102850,0.372242,0.922419,-0.214972,0.334971,0.917356,0.010895,-0.405774,0.913877,-0.001190,-0.507584,0.861568,\n\t\t\t         0.000551,-0.433598,0.901106,-0.050572,-0.415350,0.908255,0.010895,-0.405774,0.913877,0.212317,0.328715,0.920225,\n\t\t\t         0.104429,0.370518,0.922936,-0.001190,-0.507584,0.861568,0.010895,-0.405774,0.913877,-0.179571,-0.192236,0.964751,\n\t\t\t         0.074068,0.379742,0.922117,0.212317,0.328715,0.920225,0.010895,-0.405774,0.913877,-0.050572,-0.415350,0.908255,\n\t\t\t         -0.231688,-0.356085,0.905276,-0.179571,-0.192236,0.964751,-0.344066,-0.938932,-0.000458,-0.001923,-0.999420,0.033174,\n\t\t\t         -0.002869,-0.975494,0.219977,-0.357707,-0.911466,0.203009,-0.344066,-0.938932,-0.000458,-0.269448,-0.842952,-0.465590,\n\t\t\t         0.000275,-0.902341,-0.431013,-0.001923,-0.999420,0.033174,-0.344066,-0.938932,-0.000458,-0.671072,-0.739860,-0.047243,\n\t\t\t         -0.533738,-0.668264,-0.518174,-0.269448,-0.842952,-0.465590,-0.344066,-0.938932,-0.000458,-0.357707,-0.911466,0.203009,\n\t\t\t         -0.690115,-0.703726,0.168767,-0.671072,-0.739860,-0.047243,0.994385,0.088900,-0.057253,0.981994,0.180914,-0.053926,\n\t\t\t         0.981414,0.110782,0.156468,0.977142,0.104007,0.185247,0.994385,0.088900,-0.057253,0.992279,0.089541,-0.085513,\n\t\t\t         0.974822,0.211554,-0.069979,0.981994,0.180914,-0.053926,0.994385,0.088900,-0.057253,0.997345,0.042421,-0.058718,\n\t\t\t         0.994690,0.023164,-0.100101,0.992279,0.089541,-0.085513,0.994385,0.088900,-0.057253,0.977142,0.104007,0.185247,\n\t\t\t         0.997040,0.058443,0.049562,0.997345,0.042421,-0.058718,-0.244819,-0.435530,0.866207,-0.297037,-0.850368,-0.434278,\n\t\t\t         -0.560198,-0.657186,-0.504196,-0.461623,-0.348094,0.815912,-0.560198,-0.657186,-0.504196,-0.734642,-0.417554,-0.534715,\n\t\t\t         -0.618885,-0.200049,0.759545,-0.461623,-0.348094,0.815912,0.464187,0.083926,0.881741,0.522965,0.501328,0.689291,\n\t\t\t         -0.015442,0.547288,0.836787,-0.016175,0.059206,0.998108,0.464187,0.083926,0.881741,0.680593,0.202765,0.704031,\n\t\t\t         0.718436,0.540086,0.438337,0.522965,0.501328,0.689291,0.464187,0.083926,0.881741,0.552171,0.563860,0.614063,\n\t\t\t         0.709433,0.472915,0.522507,0.680593,0.202765,0.704031,0.464187,0.083926,0.881741,-0.016175,0.059206,0.998108,\n\t\t\t         -0.002411,0.596057,0.802911,0.552171,0.563860,0.614063,-0.998230,-0.013153,-0.057772,-0.979858,-0.194464,-0.044801,\n\t\t\t         -0.977325,-0.177252,0.115665,-0.996826,-0.016724,0.077609,-0.998230,-0.013153,-0.057772,-0.852473,-0.052187,-0.520127,\n\t\t\t         -0.816095,-0.211097,-0.537950,-0.979858,-0.194464,-0.044801,-0.998230,-0.013153,-0.057772,-0.994446,0.066683,-0.081149,\n\t\t\t         -0.866543,-0.001740,-0.499039,-0.852473,-0.052187,-0.520127,-0.998230,-0.013153,-0.057772,-0.996826,-0.016724,0.077609,\n\t\t\t         -0.997681,0.057405,0.036256,-0.994446,0.066683,-0.081149,-0.911405,0.263222,0.316263,-0.971923,0.085696,-0.219092,\n\t\t\t         -0.991974,0.071322,-0.104221,-0.829188,0.229804,0.509476,-0.911405,0.263222,0.316263,-0.951201,0.180334,0.250313,\n\t\t\t         -0.905240,0.141331,-0.400616,-0.971923,0.085696,-0.219092,-0.911405,0.263222,0.316263,-0.916990,0.245613,0.314219,\n\t\t\t         -0.934080,0.148015,0.324900,-0.951201,0.180334,0.250313,-0.911405,0.263222,0.316263,-0.829188,0.229804,0.509476,\n\t\t\t         -0.898801,0.222816,0.377453,-0.916990,0.245613,0.314219,-0.802484,0.493149,-0.335826,-0.776971,0.520280,-0.354350,\n\t\t\t         -0.623646,0.722922,-0.297281,-0.658345,0.701743,-0.272195,0.852168,0.213355,-0.477767,0.847224,0.262368,-0.461867,\n\t\t\t         0.848354,0.271615,-0.454390,0.857662,0.220069,-0.464705,-0.894742,0.151463,-0.420057,-0.887020,0.169073,-0.429609,\n\t\t\t         -0.855678,0.326701,-0.401288,-0.868892,0.304483,-0.390240,-0.623646,0.722922,-0.297281,-0.418928,0.876553,-0.236854,\n\t\t\t         -0.477554,0.853359,-0.208960,-0.658345,0.701743,-0.272195,0.404065,0.893429,-0.196142,0.609638,0.756890,-0.235420,\n\t\t\t         0.637257,0.740013,-0.215094,0.455184,0.874355,-0.168187,-0.855678,0.326701,-0.401288,-0.776971,0.520280,-0.354350,\n\t\t\t         -0.802484,0.493149,-0.335826,-0.868892,0.304483,-0.390240,0.792016,-0.322031,-0.518632,0.690603,-0.495071,-0.527146,\n\t\t\t         0.708731,-0.493332,-0.504257,0.804346,-0.307718,-0.508255,0.609638,0.756890,-0.235420,0.773217,0.569018,-0.279824,\n\t\t\t         0.794183,0.546037,-0.266610,0.637257,0.740013,-0.215094,-0.952422,0.087313,0.291940,-0.897916,0.141057,-0.416883,\n\t\t\t         -0.905240,0.141331,-0.400616,-0.951201,0.180334,0.250313,-0.952422,0.087313,0.291940,-0.942869,0.094119,0.319529,\n\t\t\t         -0.929167,0.143040,-0.340800,-0.897916,0.141057,-0.416883,-0.952422,0.087313,0.291940,-0.956145,0.076632,0.282632,\n\t\t\t         -0.970824,0.096927,0.219184,-0.942869,0.094119,0.319529,-0.952422,0.087313,0.291940,-0.951201,0.180334,0.250313,\n\t\t\t         -0.934080,0.148015,0.324900,-0.956145,0.076632,0.282632,-0.278451,0.959502,0.042024,-0.239143,0.965423,0.103671,\n\t\t\t         -0.002228,0.985076,0.172063,-0.002045,0.995636,0.093112,-0.278451,0.959502,0.042024,-0.534806,0.844234,-0.034852,\n\t\t\t         -0.545793,0.837886,-0.003327,-0.239143,0.965423,0.103671,-0.278451,0.959502,0.042024,-0.223884,0.962432,-0.153569,\n\t\t\t         -0.418928,0.876553,-0.236854,-0.534806,0.844234,-0.034852,-0.278451,0.959502,0.042024,-0.002045,0.995636,0.093112,\n\t\t\t         -0.000336,0.996246,-0.086245,-0.223884,0.962432,-0.153569,0.331492,-0.943327,0.015076,0.341594,-0.915891,0.210669,\n\t\t\t         -0.002869,-0.975494,0.219977,-0.001923,-0.999420,0.033174,0.331492,-0.943327,0.015076,0.644795,-0.764061,-0.020173,\n\t\t\t         0.658925,-0.729240,0.184423,0.341594,-0.915891,0.210669,0.331492,-0.943327,0.015076,0.264046,-0.849300,-0.457045,\n\t\t\t         0.518113,-0.691153,-0.503800,0.644795,-0.764061,-0.020173,0.331492,-0.943327,0.015076,-0.001923,-0.999420,0.033174,\n\t\t\t         0.000275,-0.902341,-0.431013,0.264046,-0.849300,-0.457045,0.925230,0.189398,0.328715,0.875851,0.282785,-0.391003,\n\t\t\t         0.881405,0.300729,-0.364177,0.902219,0.249153,0.352000,0.925230,0.189398,0.328715,0.932401,0.195898,0.303598,\n\t\t\t         0.927244,0.196142,-0.318918,0.875851,0.282785,-0.391003,0.925230,0.189398,0.328715,0.912015,0.192816,0.361950,\n\t\t\t         0.905576,0.174352,0.386608,0.932401,0.195898,0.303598,0.925230,0.189398,0.328715,0.902219,0.249153,0.352000,\n\t\t\t         0.914548,0.253273,0.315287,0.912015,0.192816,0.361950,0.987243,-0.158147,-0.017853,0.975982,-0.158208,0.149724,\n\t\t\t         0.937712,-0.302286,0.171178,0.946074,-0.323893,0.000305,0.987243,-0.158147,-0.017853,0.997375,-0.048830,-0.053072,\n\t\t\t         0.991943,-0.048402,0.117038,0.975982,-0.158208,0.149724,0.987243,-0.158147,-0.017853,0.844752,-0.175787,-0.505448,\n\t\t\t         0.862209,-0.107883,-0.494858,0.997375,-0.048830,-0.053072,0.987243,-0.158147,-0.017853,0.946074,-0.323893,0.000305,\n\t\t\t         0.792016,-0.322031,-0.518632,0.844752,-0.175787,-0.505448,-0.854915,0.059725,-0.515305,-0.874416,-0.019257,-0.484756,\n\t\t\t         -0.877834,-0.060335,-0.475143,-0.866146,0.044374,-0.497787,0.690603,-0.495071,-0.527146,0.518113,-0.691153,-0.503800,\n\t\t\t         0.543321,-0.689474,-0.478896,0.708731,-0.493332,-0.504257,0.847224,0.262368,-0.461867,0.858821,0.234657,-0.455306,\n\t\t\t         0.861721,0.247810,-0.442671,0.848354,0.271615,-0.454390,-0.874416,-0.019257,-0.484756,-0.896512,-0.039460,-0.441206,\n\t\t\t         -0.885433,-0.067660,-0.459761,-0.877834,-0.060335,-0.475143,-0.477554,0.853359,-0.208960,-0.418928,0.876553,-0.236854,\n\t\t\t         -0.223884,0.962432,-0.153569,-0.237373,0.957671,-0.162664,0.858821,0.234657,-0.455306,0.867946,0.107120,-0.484909,\n\t\t\t         0.887478,0.128025,-0.442640,0.861721,0.247810,-0.442671,-0.883663,-0.005860,0.468032,-0.996277,0.023133,-0.082980,\n\t\t\t         -0.984313,-0.175665,-0.015625,-0.879849,-0.204413,0.428968,-0.883663,-0.005860,0.468032,-0.874722,0.131596,0.466353,\n\t\t\t         -0.975280,0.177007,-0.132176,-0.996277,0.023133,-0.082980,-0.883663,-0.005860,0.468032,-0.926359,-0.022065,0.375927,\n\t\t\t         -0.894864,0.128147,0.427473,-0.874722,0.131596,0.466353,-0.883663,-0.005860,0.468032,-0.879849,-0.204413,0.428968,\n\t\t\t         -0.947142,-0.225288,0.228339,-0.926359,-0.022065,0.375927,0.991333,0.081698,-0.102756,0.992279,0.089541,-0.085513,\n\t\t\t         0.994690,0.023164,-0.100101,0.991028,-0.014252,-0.132847,0.991333,0.081698,-0.102756,0.972015,0.219611,-0.083102,\n\t\t\t         0.974822,0.211554,-0.069979,0.992279,0.089541,-0.085513,0.991333,0.081698,-0.102756,0.929197,0.076510,-0.361553,\n\t\t\t         0.907834,0.223090,-0.355022,0.972015,0.219611,-0.083102,0.991333,0.081698,-0.102756,0.991028,-0.014252,-0.132847,\n\t\t\t         0.929746,-0.028382,-0.367016,0.929197,0.076510,-0.361553,0.843867,0.021302,0.536119,0.996521,0.059999,0.057466,\n\t\t\t         0.962767,0.263833,-0.058443,0.837397,0.174749,0.517869,0.843867,0.021302,0.536119,0.842250,-0.195807,0.502213,\n\t\t\t         0.973876,-0.197699,0.111454,0.996521,0.059999,0.057466,0.843867,0.021302,0.536119,0.895993,0.006592,0.443983,\n\t\t\t         0.923978,-0.215125,0.316172,0.842250,-0.195807,0.502213,0.843867,0.021302,0.536119,0.837397,0.174749,0.517869,\n\t\t\t         0.858119,0.166631,0.485611,0.895993,0.006592,0.443983,0.269265,0.960845,0.065157,-0.002045,0.995636,0.093112,\n\t\t\t         -0.002228,0.985076,0.172063,0.230506,0.965941,0.117496,0.269265,0.960845,0.065157,0.215827,0.966979,-0.135441,\n\t\t\t         -0.000336,0.996246,-0.086245,-0.002045,0.995636,0.093112,0.269265,0.960845,0.065157,0.517441,0.855525,0.017365,\n\t\t\t         0.404065,0.893429,-0.196142,0.215827,0.966979,-0.135441,0.269265,0.960845,0.065157,0.230506,0.965941,0.117496,\n\t\t\t         0.529069,0.847957,0.032350,0.517441,0.855525,0.017365,-0.821253,0.116459,0.558519,-0.853847,-0.038118,-0.519059,\n\t\t\t         -0.852504,-0.015748,-0.522446,-0.898801,0.222816,0.377453,-0.870785,0.018769,-0.491256,-0.916990,0.245613,0.314219,\n\t\t\t         -0.898801,0.222816,0.377453,-0.852504,-0.015748,-0.522446,0.552171,0.563860,0.614063,-0.002411,0.596057,0.802911,\n\t\t\t         -0.003174,0.989898,-0.141545,0.226234,0.963652,-0.141942,-0.003174,0.989898,-0.141545,-0.002411,0.596057,0.802911,\n\t\t\t         -0.588122,0.540819,0.601306,-0.237373,0.957671,-0.162664,-0.244819,-0.435530,0.866207,0.002411,-0.457137,0.889370,\n\t\t\t         -0.003265,-0.920316,-0.391095,-0.297037,-0.850368,-0.434278,-0.003265,-0.920316,-0.391095,0.002411,-0.457137,0.889370,\n\t\t\t         0.240211,-0.430036,0.870235,0.286843,-0.862087,-0.417707,0.708731,-0.493332,-0.504257,0.583667,-0.254402,0.771081,\n\t\t\t         0.684439,-0.128330,0.717643,0.804346,-0.307718,-0.508255,0.804346,-0.307718,-0.508255,0.684439,-0.128330,0.717643,\n\t\t\t         0.800317,0.003998,0.599536,0.846034,-0.157933,-0.509171,0.919034,-0.061037,-0.389325,0.907315,-0.040895,-0.418409,\n\t\t\t         0.950957,-0.188025,0.245552,0.923978,-0.215125,0.316172,0.919034,-0.061037,-0.389325,0.923978,-0.215125,0.316172,\n\t\t\t         0.895993,0.006592,0.443983,0.929624,0.054170,-0.364483,0.552171,0.563860,0.614063,0.226234,0.963652,-0.141942,\n\t\t\t         0.455184,0.874355,-0.168187,0.709433,0.472915,0.522507,0.637257,0.740013,-0.215094,0.728324,0.460036,0.507767,\n\t\t\t         0.709433,0.472915,0.522507,0.455184,0.874355,-0.168187,-0.618885,-0.200049,0.759545,-0.734642,-0.417554,-0.534715,\n\t\t\t         -0.827509,-0.186499,-0.529527,-0.719108,-0.029267,0.694266,-0.821253,0.116459,0.558519,-0.719108,-0.029267,0.694266,\n\t\t\t         -0.827509,-0.186499,-0.529527,-0.853847,-0.038118,-0.519059,-0.867580,0.121006,-0.482315,-0.956145,0.076632,0.282632,\n\t\t\t         -0.934080,0.148015,0.324900,-0.882382,0.085879,-0.462600,-0.870785,0.018769,-0.491256,-0.882382,0.085879,-0.462600,\n\t\t\t         -0.934080,0.148015,0.324900,-0.916990,0.245613,0.314219,-0.853023,0.105380,-0.511063,-0.980071,0.104404,0.168859,\n\t\t\t         -0.970824,0.096927,0.219184,-0.855129,0.119938,-0.504318,-0.867580,0.121006,-0.482315,-0.855129,0.119938,-0.504318,\n\t\t\t         -0.970824,0.096927,0.219184,-0.956145,0.076632,0.282632,-0.877834,-0.060335,-0.475143,-0.963958,-0.214118,0.157750,\n\t\t\t         -0.987548,-0.016694,0.156255,-0.866146,0.044374,-0.497787,-0.853023,0.105380,-0.511063,-0.866146,0.044374,-0.497787,\n\t\t\t         -0.987548,-0.016694,0.156255,-0.980071,0.104404,0.168859,-0.926359,-0.022065,0.375927,-0.947142,-0.225288,0.228339,\n\t\t\t         -0.885433,-0.067660,-0.459761,-0.900296,0.023774,-0.434553,-0.877834,-0.060335,-0.475143,-0.885433,-0.067660,-0.459761,\n\t\t\t         -0.947142,-0.225288,0.228339,-0.963958,-0.214118,0.157750,-0.774895,0.416791,0.475143,-0.658345,0.701743,-0.272195,\n\t\t\t         -0.477554,0.853359,-0.208960,-0.761071,0.424635,0.490341,-0.237373,0.957671,-0.162664,-0.588122,0.540819,0.601306,\n\t\t\t         -0.761071,0.424635,0.490341,-0.477554,0.853359,-0.208960,-0.802484,0.493149,-0.335826,-0.658345,0.701743,-0.272195,\n\t\t\t         -0.774895,0.416791,0.475143,-0.820032,0.348064,0.454237,-0.868892,0.304483,-0.390240,-0.802484,0.493149,-0.335826,\n\t\t\t         -0.820032,0.348064,0.454237,-0.865169,0.246986,0.436354,0.286843,-0.862087,-0.417707,0.240211,-0.430036,0.870235,\n\t\t\t         0.438276,-0.355235,0.825617,0.543321,-0.689474,-0.478896,0.708731,-0.493332,-0.504257,0.543321,-0.689474,-0.478896,\n\t\t\t         0.438276,-0.355235,0.825617,0.583667,-0.254402,0.771081,0.907315,0.191992,0.373974,0.876370,-0.036744,-0.480178,\n\t\t\t         0.851558,-0.115665,-0.511277,0.892788,0.121677,0.433699,0.846034,-0.157933,-0.509171,0.800317,0.003998,0.599536,\n\t\t\t         0.892788,0.121677,0.433699,0.851558,-0.115665,-0.511277,0.912015,0.192816,0.361950,0.861721,0.247810,-0.442671,\n\t\t\t         0.887478,0.128025,-0.442640,0.905576,0.174352,0.386608,0.887478,0.128025,-0.442640,0.876370,-0.036744,-0.480178,\n\t\t\t         0.907315,0.191992,0.373974,0.905576,0.174352,0.386608,0.848354,0.271615,-0.454390,0.861721,0.247810,-0.442671,\n\t\t\t         0.912015,0.192816,0.361950,0.914548,0.253273,0.315287,0.950957,-0.188025,0.245552,0.907315,-0.040895,-0.418409,\n\t\t\t         0.884426,0.106296,-0.454390,0.967528,0.047090,0.248299,0.884426,0.106296,-0.454390,0.857662,0.220069,-0.464705,\n\t\t\t         0.938017,0.223121,0.265084,0.967528,0.047090,0.248299,0.794183,0.546037,-0.266610,0.875973,0.362651,-0.318003,\n\t\t\t         0.824366,0.287942,0.487259,0.777093,0.387951,0.495560,0.824366,0.287942,0.487259,0.875973,0.362651,-0.318003,\n\t\t\t         0.914579,0.202063,-0.350261,0.858119,0.166631,0.485611,0.929624,0.054170,-0.364483,0.895993,0.006592,0.443983,\n\t\t\t         0.858119,0.166631,0.485611,0.914579,0.202063,-0.350261,0.929746,-0.028382,-0.367016,0.905209,-0.005097,-0.424879,\n\t\t\t         0.907315,-0.040895,-0.418409,0.919034,-0.061037,-0.389325,-0.223884,0.962432,-0.153569,-0.000336,0.996246,-0.086245,\n\t\t\t         -0.003174,0.989898,-0.141545,-0.237373,0.957671,-0.162664,-0.866543,-0.001740,-0.499039,-0.864437,0.006623,-0.502640,\n\t\t\t         -0.870785,0.018769,-0.491256,-0.852504,-0.015748,-0.522446,0.905209,-0.005097,-0.424879,0.873836,0.117405,-0.471786,\n\t\t\t         0.884426,0.106296,-0.454390,0.907315,-0.040895,-0.418409,0.000275,-0.902341,-0.431013,-0.269448,-0.842952,-0.465590,\n\t\t\t         -0.297037,-0.850368,-0.434278,-0.003265,-0.920316,-0.391095,-0.864437,0.006623,-0.502640,-0.862087,0.068270,-0.502091,\n\t\t\t         -0.882382,0.085879,-0.462600,-0.870785,0.018769,-0.491256,0.564379,-0.214637,0.797082,0.826899,-0.556841,0.078310,\n\t\t\t         0.956908,-0.290323,-0.003235,0.645802,-0.134373,0.751549,0.564379,-0.214637,0.797082,0.436537,-0.297464,0.849055,\n\t\t\t         0.639882,-0.756127,0.137150,0.826899,-0.556841,0.078310,0.564379,-0.214637,0.797082,0.583667,-0.254402,0.771081,\n\t\t\t         0.438276,-0.355235,0.825617,0.436537,-0.297464,0.849055,0.564379,-0.214637,0.797082,0.645802,-0.134373,0.751549,\n\t\t\t         0.684439,-0.128330,0.717643,0.583667,-0.254402,0.771081,-0.645924,-0.180059,0.741844,-0.864406,-0.500961,-0.042634,\n\t\t\t         -0.666738,-0.742302,0.066408,-0.488235,-0.303934,0.818049,-0.645924,-0.180059,0.741844,-0.719596,-0.058443,0.691885,\n\t\t\t         -0.978210,-0.180609,-0.102268,-0.864406,-0.500961,-0.042634,-0.645924,-0.180059,0.741844,-0.618885,-0.200049,0.759545,\n\t\t\t         -0.719108,-0.029267,0.694266,-0.719596,-0.058443,0.691885,-0.645924,-0.180059,0.741844,-0.488235,-0.303934,0.818049,\n\t\t\t         -0.461623,-0.348094,0.815912,-0.618885,-0.200049,0.759545,0.914365,0.211249,0.345347,0.878170,0.263192,-0.399396,\n\t\t\t         0.985351,0.077670,-0.151799,0.932188,-0.012848,0.361675,0.914365,0.211249,0.345347,0.902219,0.249153,0.352000,\n\t\t\t         0.881405,0.300729,-0.364177,0.878170,0.263192,-0.399396,0.914365,0.211249,0.345347,0.938017,0.223121,0.265084,\n\t\t\t         0.914548,0.253273,0.315287,0.902219,0.249153,0.352000,0.914365,0.211249,0.345347,0.932188,-0.012848,0.361675,\n\t\t\t         0.967528,0.047090,0.248299,0.938017,0.223121,0.265084,0.887478,0.128025,-0.442640,0.867946,0.107120,-0.484909,\n\t\t\t         0.867641,-0.045045,-0.495132,0.876370,-0.036744,-0.480178,-0.269448,-0.842952,-0.465590,-0.533738,-0.668264,-0.518174,\n\t\t\t         -0.560198,-0.657186,-0.504196,-0.297037,-0.850368,-0.434278,-0.958281,0.103885,0.266243,-0.915342,0.129398,-0.381298,\n\t\t\t         -0.929167,0.143040,-0.340800,-0.942869,0.094119,0.319529,-0.958281,0.103885,0.266243,-0.955168,-0.078921,0.285257,\n\t\t\t         -0.986633,-0.013794,-0.162175,-0.915342,0.129398,-0.381298,-0.958281,0.103885,0.266243,-0.980071,0.104404,0.168859,\n\t\t\t         -0.987548,-0.016694,0.156255,-0.955168,-0.078921,0.285257,-0.958281,0.103885,0.266243,-0.942869,0.094119,0.319529,\n\t\t\t         -0.970824,0.096927,0.219184,-0.980071,0.104404,0.168859,-0.859859,0.105319,-0.499496,-0.850795,0.097201,-0.516373,\n\t\t\t         -0.853023,0.105380,-0.511063,-0.855129,0.119938,-0.504318,0.867641,-0.045045,-0.495132,0.862209,-0.107883,-0.494858,\n\t\t\t         0.851558,-0.115665,-0.511277,0.876370,-0.036744,-0.480178,-0.882382,0.085879,-0.462600,-0.862087,0.068270,-0.502091,\n\t\t\t         -0.866970,0.109531,-0.486160,-0.867580,0.121006,-0.482315,-0.850795,0.097201,-0.516373,-0.854915,0.059725,-0.515305,\n\t\t\t         -0.866146,0.044374,-0.497787,-0.853023,0.105380,-0.511063,-0.003174,0.989898,-0.141545,-0.000336,0.996246,-0.086245,\n\t\t\t         0.215827,0.966979,-0.135441,0.226234,0.963652,-0.141942,-0.866970,0.109531,-0.486160,-0.859859,0.105319,-0.499496,\n\t\t\t         -0.855129,0.119938,-0.504318,-0.867580,0.121006,-0.482315,-0.816095,-0.211097,-0.537950,-0.852473,-0.052187,-0.520127,\n\t\t\t         -0.853847,-0.038118,-0.519059,-0.827509,-0.186499,-0.529527,0.215827,0.966979,-0.135441,0.404065,0.893429,-0.196142,\n\t\t\t         0.455184,0.874355,-0.168187,0.226234,0.963652,-0.141942,0.543321,-0.689474,-0.478896,0.518113,-0.691153,-0.503800,\n\t\t\t         0.264046,-0.849300,-0.457045,0.286843,-0.862087,-0.417707,-0.852473,-0.052187,-0.520127,-0.866543,-0.001740,-0.499039,\n\t\t\t         -0.852504,-0.015748,-0.522446,-0.853847,-0.038118,-0.519059,0.819117,0.277810,0.501785,0.927061,0.371563,-0.049532,\n\t\t\t         0.851192,0.522538,0.048952,0.772179,0.345439,0.533219,0.819117,0.277810,0.501785,0.837397,0.174749,0.517869,\n\t\t\t         0.962767,0.263833,-0.058443,0.927061,0.371563,-0.049532,0.819117,0.277810,0.501785,0.824366,0.287942,0.487259,\n\t\t\t         0.858119,0.166631,0.485611,0.837397,0.174749,0.517869,0.819117,0.277810,0.501785,0.772179,0.345439,0.533219,\n\t\t\t         0.777093,0.387951,0.495560,0.824366,0.287942,0.487259,-0.852290,0.228370,0.470565,-0.951048,0.302713,-0.062044,\n\t\t\t         -0.975280,0.177007,-0.132176,-0.874722,0.131596,0.466353,-0.852290,0.228370,0.470565,-0.806269,0.296060,0.512070,\n\t\t\t         -0.883175,0.466720,0.046022,-0.951048,0.302713,-0.062044,-0.852290,0.228370,0.470565,-0.865169,0.246986,0.436354,\n\t\t\t         -0.820032,0.348064,0.454237,-0.806269,0.296060,0.512070,-0.852290,0.228370,0.470565,-0.874722,0.131596,0.466353,\n\t\t\t         -0.894864,0.128147,0.427473,-0.865169,0.246986,0.436354,-0.560198,-0.657186,-0.504196,-0.533738,-0.668264,-0.518174,\n\t\t\t         -0.720603,-0.432539,-0.541826,-0.734642,-0.417554,-0.534715,0.264046,-0.849300,-0.457045,0.000275,-0.902341,-0.431013,\n\t\t\t         -0.003265,-0.920316,-0.391095,0.286843,-0.862087,-0.417707,0.914579,0.202063,-0.350261,0.907834,0.223090,-0.355022,\n\t\t\t         0.929197,0.076510,-0.361553,0.929624,0.054170,-0.364483,-0.720603,-0.432539,-0.541826,-0.816095,-0.211097,-0.537950,\n\t\t\t         -0.827509,-0.186499,-0.529527,-0.734642,-0.417554,-0.534715,-0.885433,-0.067660,-0.459761,-0.896512,-0.039460,-0.441206,\n\t\t\t         -0.899625,0.038575,-0.434889,-0.900296,0.023774,-0.434553,0.929197,0.076510,-0.361553,0.929746,-0.028382,-0.367016,\n\t\t\t         0.919034,-0.061037,-0.389325,0.929624,0.054170,-0.364483,0.224616,-0.335032,0.915036,0.342448,-0.915159,0.212470,\n\t\t\t         0.639882,-0.756127,0.137150,0.436537,-0.297464,0.849055,0.224616,-0.335032,0.915036,-0.004425,-0.349406,0.936949,\n\t\t\t         -0.001526,-0.972259,0.233863,0.342448,-0.915159,0.212470,0.224616,-0.335032,0.915036,0.240211,-0.430036,0.870235,\n\t\t\t         0.002411,-0.457137,0.889370,-0.004425,-0.349406,0.936949,0.224616,-0.335032,0.915036,0.436537,-0.297464,0.849055,\n\t\t\t         0.438276,-0.355235,0.825617,0.240211,-0.430036,0.870235,-0.245766,-0.348033,0.904660,-0.354442,-0.916776,0.183905,\n\t\t\t         -0.001526,-0.972259,0.233863,-0.004425,-0.349406,0.936949,-0.245766,-0.348033,0.904660,-0.488235,-0.303934,0.818049,\n\t\t\t         -0.666738,-0.742302,0.066408,-0.354442,-0.916776,0.183905,-0.245766,-0.348033,0.904660,-0.244819,-0.435530,0.866207,\n\t\t\t         -0.461623,-0.348094,0.815912,-0.488235,-0.303934,0.818049,-0.245766,-0.348033,0.904660,-0.004425,-0.349406,0.936949,\n\t\t\t         0.002411,-0.457137,0.889370,-0.244819,-0.435530,0.866207,0.713004,-0.001373,0.701132,0.995483,-0.090213,0.029511,\n\t\t\t         0.996948,-0.009949,0.077334,0.788018,0.158513,0.594867,0.713004,-0.001373,0.701132,0.645802,-0.134373,0.751549,\n\t\t\t         0.956908,-0.290323,-0.003235,0.995483,-0.090213,0.029511,0.713004,-0.001373,0.701132,0.800317,0.003998,0.599536,\n\t\t\t         0.684439,-0.128330,0.717643,0.645802,-0.134373,0.751549,0.713004,-0.001373,0.701132,0.788018,0.158513,0.594867,\n\t\t\t         0.892788,0.121677,0.433699,0.800317,0.003998,0.599536,-0.762688,0.096927,0.639424,-0.991943,0.028474,-0.123356,\n\t\t\t         -0.978210,-0.180609,-0.102268,-0.719596,-0.058443,0.691885,-0.762688,0.096927,0.639424,-0.829188,0.229804,0.509476,\n\t\t\t         -0.991974,0.071322,-0.104221,-0.991943,0.028474,-0.123356,-0.762688,0.096927,0.639424,-0.821253,0.116459,0.558519,\n\t\t\t         -0.898801,0.222816,0.377453,-0.829188,0.229804,0.509476,-0.762688,0.096927,0.639424,-0.719596,-0.058443,0.691885,\n\t\t\t         -0.719108,-0.029267,0.694266,-0.821253,0.116459,0.558519,-0.977660,0.040681,-0.206091,-0.972900,-0.023347,-0.230018,\n\t\t\t         -0.983215,0.011658,-0.182012,-0.983367,0.038026,-0.177404,-0.977660,0.040681,-0.206091,-0.899625,0.038575,-0.434889,\n\t\t\t         -0.896512,-0.039460,-0.441206,-0.972900,-0.023347,-0.230018,-0.977660,0.040681,-0.206091,-0.967315,0.164586,-0.192877,\n\t\t\t         -0.887020,0.169073,-0.429609,-0.899625,0.038575,-0.434889,-0.977660,0.040681,-0.206091,-0.983367,0.038026,-0.177404,\n\t\t\t         -0.973388,0.150304,-0.172796,-0.967315,0.164586,-0.192877,-0.926359,-0.022065,0.375927,-0.900296,0.023774,-0.434553,\n\t\t\t         -0.894742,0.151463,-0.420057,-0.894864,0.128147,0.427473,-0.868892,0.304483,-0.390240,-0.865169,0.246986,0.436354,\n\t\t\t         -0.894864,0.128147,0.427473,-0.894742,0.151463,-0.420057,-0.899625,0.038575,-0.434889,-0.887020,0.169073,-0.429609,\n\t\t\t         -0.894742,0.151463,-0.420057,-0.900296,0.023774,-0.434553,-0.961364,-0.007782,-0.275124,-0.972900,-0.023347,-0.230018,\n\t\t\t         -0.896512,-0.039460,-0.441206,-0.874416,-0.019257,-0.484756,-0.961364,-0.007782,-0.275124,-0.979217,0.040773,-0.198553,\n\t\t\t         -0.983215,0.011658,-0.182012,-0.972900,-0.023347,-0.230018,-0.961364,-0.007782,-0.275124,-0.949980,0.054231,-0.307535,\n\t\t\t         -0.975585,0.058351,-0.211615,-0.979217,0.040773,-0.198553,-0.961364,-0.007782,-0.275124,-0.874416,-0.019257,-0.484756,\n\t\t\t         -0.854915,0.059725,-0.515305,-0.949980,0.054231,-0.307535,-0.991913,0.056032,-0.113742,-0.979217,0.040773,-0.198553,\n\t\t\t         -0.975585,0.058351,-0.211615,-0.992981,0.048250,-0.107944,-0.991913,0.056032,-0.113742,-0.991974,0.024537,-0.123997,\n\t\t\t         -0.983215,0.011658,-0.182012,-0.979217,0.040773,-0.198553,-0.991913,0.056032,-0.113742,-0.989349,0.083010,0.119297,\n\t\t\t         -0.999329,0.031312,-0.018006,-0.991974,0.024537,-0.123997,-0.991913,0.056032,-0.113742,-0.992981,0.048250,-0.107944,\n\t\t\t         -0.986541,0.094699,0.133244,-0.989349,0.083010,0.119297,-0.990631,0.019684,-0.135014,-0.991974,0.024537,-0.123997,\n\t\t\t         -0.999329,0.031312,-0.018006,-0.995849,0.013947,0.089633,-0.990631,0.019684,-0.135014,-0.983367,0.038026,-0.177404,\n\t\t\t         -0.983215,0.011658,-0.182012,-0.991974,0.024537,-0.123997,-0.990631,0.019684,-0.135014,-0.983856,0.110019,-0.141057,\n\t\t\t         -0.973388,0.150304,-0.172796,-0.983367,0.038026,-0.177404,-0.990631,0.019684,-0.135014,-0.995849,0.013947,0.089633,\n\t\t\t         -0.998901,0.018342,0.043001,-0.983856,0.110019,-0.141057,0.938017,0.223121,0.265084,0.857662,0.220069,-0.464705,\n\t\t\t         0.848354,0.271615,-0.454390,0.914548,0.253273,0.315287,0.637257,0.740013,-0.215094,0.794183,0.546037,-0.266610,\n\t\t\t         0.777093,0.387951,0.495560,0.728324,0.460036,0.507767,0.794183,0.546037,-0.266610,0.773217,0.569018,-0.279824,\n\t\t\t         0.865139,0.383038,-0.323710,0.875973,0.362651,-0.318003,-0.537034,-0.827540,-0.163488,-0.518571,-0.851405,-0.078249,\n\t\t\t         -0.741905,-0.662923,-0.100375,-0.748527,-0.631275,-0.202918,0.746910,-0.641041,-0.176489,0.871609,-0.473128,-0.128086,\n\t\t\t         0.661000,-0.736442,-0.143773,0.658528,-0.734214,-0.165044,0.968596,0.241432,0.059358,0.867641,0.493301,0.061739,\n\t\t\t         0.816248,0.575549,0.049104,0.975036,0.218268,0.040345,-0.682028,-0.726646,-0.082369,-0.693564,-0.697165,-0.181371,\n\t\t\t         -0.735527,-0.641865,-0.216651,-0.734977,-0.671621,-0.093387\n\t\t}\n\t\tLayerElementSmoothing: 0 {\n\t\t\tVersion: 102\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygon\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tSmoothing: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.128971,0.499229,0.834119,0.304291,0.923136,0.117578,0.568733,0.453008,0.155845,0.514009,0.428829,0.170477,\n\t\t\t    0.746316,0.089471,0.768679,0.311828,0.026749,0.220699,0.226165,0.939346,0.578193,0.609988,0.797394,0.072543,\n\t\t\t    0.924374,0.984425,0.801112,0.223613,0.489179,0.876054,0.668074,0.781916,0.128608,0.394136,0.663045,0.082122,\n\t\t\t    0.909319,0.070673,0.625777,0.043905,0.770322,0.293421,0.441896,0.033576,0.335826,0.080500,0.026337,0.369903,\n\t\t\t    0.797579,0.301925,0.884119,0.764387,0.400917,0.379763,0.274450,0.065422,0.568143,0.829643,0.223088,0.387392,\n\t\t\t    0.312958,0.031435,0.726848,0.835971,0.486336,0.121358,0.927741,0.225400,0.155608,0.914723,0.057087,0.120059,\n\t\t\t    0.542448,0.035586,0.796879,0.224710,0.711534,0.325092,0.297863,0.105179,0.373345,0.312193,0.961514,0.184510,\n\t\t\t    0.277879,0.100135,0.477169,0.920436,0.242312,0.176691,0.796975,0.041184,0.697603,0.337533,0.394835,0.034690,\n\t\t\t    0.173257,0.516759,0.790976,0.318591,0.861451,0.157296,0.348581,0.356685,0.252131,0.328386,0.501271,0.137424,\n\t\t\t    0.538072,0.491236,0.910575,0.141708,0.175782,0.217508,0.703779,0.917076,0.971841,0.228192,0.787757,0.251239,\n\t\t\t    0.797115,0.050451,0.673480,0.259640,0.675104,0.846952,0.261096,0.165359,0.868327,0.816257,0.513973,0.066112,\n\t\t\t    0.807861,0.036356,0.506524,0.792744,0.804093,0.041617,0.337044,0.072622,0.229451,0.463064,0.500294,0.067983,\n\t\t\t    0.784265,0.867409,0.388206,0.074831,0.088771,0.717845,0.423302,0.096651,0.447051,0.731294,0.282630,0.416934,\n\t\t\t    0.898886,0.898384,0.856985,0.076353,0.693154,0.323886,0.519696,0.089562,0.326468,0.058288,0.586038,0.787284,\n\t\t\t    0.311171,0.086837,0.531421,0.249479,0.680926,0.208523,0.271645,0.637068,0.049263,0.317333,0.062178,0.286680,\n\t\t\t    0.554445,0.725956,0.803631,0.189993,0.137161,0.192264,0.161605,0.794980,0.728994,0.890366,0.464003,0.141765,\n\t\t\t    0.345251,0.698945,0.406808,0.142846,0.696897,0.304661,0.115250,0.520713,0.809383,0.267361,0.567142,0.817735,\n\t\t\t    0.061961,0.122175,0.935556,0.227913,0.332223,0.039812,0.787206,0.039859,0.593814,0.094643,0.950551,0.925543,\n\t\t\t    0.262481,0.332495,0.849170,0.047841,0.263051,0.158824,0.772889,0.308600,0.354967,0.025162,0.609307,0.068583,\n\t\t\t    0.194234,0.500453,0.480839,0.577901,0.676650,0.258227,0.499254,0.827450,0.642892,0.214664,0.907924,0.144457,\n\t\t\t    0.281041,0.038191,0.866396,0.581853,0.738222,0.089457,0.714493,0.809330,0.512855,0.581662,0.124654,0.363493,\n\t\t\t    0.533096,0.084676,0.463379,0.422915,0.844952,0.753064,0.358846,0.470048,0.854054,0.057122,0.957829,0.877838,\n\t\t\t    0.563224,0.590298,0.617821,0.054611,0.490185,0.931429,0.820349,0.244593,0.438600,0.230078,0.809125,0.303981,\n\t\t\t    0.507599,0.887770,0.573983,0.419501,0.027739,0.214383,0.924531,0.126803,0.374350,0.076303,0.913925,0.168321,\n\t\t\t    0.768368,0.308270,0.551241,0.033157,0.112851,0.863355,0.476882,0.924771,0.696093,0.788369,0.143554,0.182781,\n\t\t\t    0.765390,0.273450,0.080053,0.136281,0.716494,0.767157,0.256351,0.510409,0.911481,0.921541,0.528489,0.111951,\n\t\t\t    0.328628,0.961351,0.759341,0.914717,0.324075,0.035437,0.251453,0.145118,0.276392,0.381198,0.112963,0.980363,\n\t\t\t    0.762898,0.303468,0.385074,0.701320,0.800702,0.208422,0.922577,0.137605,0.795168,0.688365,0.950349,0.180463,\n\t\t\t    0.536027,0.134688,0.671433,0.269193,0.128590,0.340928,0.068159,0.342152,0.340978,0.413917,0.263801,0.345090,\n\t\t\t    0.358944,0.104888,0.522544,0.916820,0.752317,0.080163,0.110994,0.267109,0.121394,0.831589,0.178025,0.409213,\n\t\t\t    0.045645,0.887145,0.814856,0.211701,0.180248,0.248917,0.618659,0.149400,0.283847,0.737959,0.465881,0.597085,\n\t\t\t    0.270388,0.089330,0.518902,0.641138,0.187032,0.116832,0.706615,0.932079,0.528655,0.306238,0.261778,0.165401,\n\t\t\t    0.465678,0.219470,0.333019,0.084861,0.579783,0.620013,0.518836,0.887007,0.059538,0.359337,0.805252,0.200457,\n\t\t\t    0.835524,0.719875,0.282562,0.125065,0.318780,0.483157,0.552637,0.167964,0.956317,0.955148,0.542168,0.040988,\n\t\t\t    0.482447,0.792117,0.175265,0.124950,0.422274,0.725654,0.160047,0.145227,0.562841,0.790958,0.898713,0.128952,\n\t\t\t    0.835493,0.086778,0.326452,0.064421,0.792789,0.038128,0.905487,0.493177,0.305032,0.092836,0.439394,0.024165,\n\t\t\t    0.513694,0.257296,0.656206,0.178154,0.263312,0.177094,0.797115,0.083052,0.493915,0.876158,0.266145,0.591097,\n\t\t\t    0.877361,0.098947,0.521092,0.129370,0.618380,0.075743,0.571406,0.717528,0.287804,0.406039,0.340697,0.099187,\n\t\t\t    0.043968,0.869291,0.367825,0.692973,0.069864,0.383611,0.363696,0.730698,0.452977,0.226030,0.067618,0.367252,\n\t\t\t    0.911413,0.112261,0.582015,0.937687,0.474765,0.794703,0.238165,0.454508,0.680032,0.241493,0.790613,0.264832,\n\t\t\t    0.761969,0.253298,0.765296,0.169019,0.911134,0.126998,0.295208,0.100604,0.892750,0.987504,0.512159,0.123703,\n\t\t\t    0.907086,0.081070,0.808838,0.060457,0.209708,0.673350,0.501411,0.112174,0.273751,0.591374,0.709427,0.330454,\n\t\t\t    0.482000,0.498392,0.913506,0.147527,0.206262,0.896577,0.169745,0.116185,0.555987,0.041937,0.335944,0.082367,\n\t\t\t    0.522488,0.115984,0.807108,0.732150,0.874151,0.022986,0.266685,0.187114,0.763114,0.283860,0.883222,0.098989,\n\t\t\t    0.487174,0.116961,0.034550,0.364158,0.936254,0.225121,0.468400,0.889175,0.412840,0.141642,0.577419,0.621240,\n\t\t\t    0.389520,0.034117,0.779836,0.305687,0.972313,0.948381,0.481172,0.195322,0.378204,0.644679,0.679320,0.747763,\n\t\t\t    0.301112,0.109324,0.314550,0.085190,0.360205,0.099673,0.912961,0.582836,0.269089,0.939065,0.386387,0.053443,\n\t\t\t    0.265170,0.179928,0.209303,0.700263,0.980616,0.527062,0.277672,0.349740,0.299851,0.058533,0.474178,0.934521,\n\t\t\t    0.663765,0.730156,0.880710,0.101766,0.615588,0.027253,0.894024,0.801697,0.723621,0.216710,0.799908,0.252811,\n\t\t\t    0.122041,0.241178,0.126874,0.791443,0.798772,0.216030,0.893457,0.770023,0.828064,0.240635,0.185155,0.122337,\n\t\t\t    0.693001,0.738563,0.798687,0.298303,0.255216,0.153002,0.530862,0.152471,0.058304,0.259391,0.519538,0.737348,\n\t\t\t    0.399240,0.742073,0.778061,0.196985,0.911413,0.114103,0.605130,0.922958,0.743600,0.225455,0.674773,0.300850,\n\t\t\t    0.318925,0.148186,0.608245,0.256567,0.734733,0.085438,0.810549,0.193246,0.178026,0.229761,0.152018,0.325290,\n\t\t\t    0.867173,0.029322,0.603414,0.754060,0.756626,0.226572,0.494292,0.063390,0.764393,0.291520,0.498081,0.888507,\n\t\t\t    0.595628,0.055448,0.330854,0.127327,0.327609,0.047785,0.837220,0.793482,0.088888,0.679042,0.243152,0.423147,\n\t\t\t    0.130389,0.423080,0.683082,0.329791,0.394271,0.409820,0.952963,0.972293,0.484428,0.785454,0.357744,0.062338,\n\t\t\t    0.147215,0.772433,0.556266,0.204534,0.772692,0.112233,0.599676,0.055225,0.678122,0.306863,0.836611,0.287548,\n\t\t\t    0.899690,0.248567,0.332796,0.080263,0.033894,0.356125,0.202181,0.151732,0.692912,0.932078,0.793347,0.061616,\n\t\t\t    0.925926,0.213119,0.447849,0.666418,0.785347,0.890466,0.791672,0.034039,0.159741,0.945730,0.038673,0.340592,\n\t\t\t    0.751480,0.083024,0.937831,0.885563,0.022639,0.209971,0.280609,0.066667,0.119281,0.218631,0.050908,0.346223,\n\t\t\t    0.891875,0.244520,0.262301,0.162175,0.936550,0.835245,0.705304,0.200360,0.494153,0.141570,0.945186,0.141624,\n\t\t\t    0.113005,0.186863,0.397578,0.039365,0.248239,0.433531,0.543425,0.080363,0.240456,0.510245,0.903318,0.079423,\n\t\t\t    0.536617,0.499615,0.040348,0.241500,0.333225,0.120556,0.553924,0.637941,0.229799,0.144008,0.773921,0.262203,\n\t\t\t    0.920378,0.824680,0.873034,0.032853,0.526535,0.159589,0.544681,0.144236,0.790974,0.056285,0.618659,0.033995,\n\t\t\t    0.099573,0.860586,0.950907,0.148504,0.325437,0.578767,0.882066,0.394891,0.158297,0.497122,0.378646,0.747686,\n\t\t\t    0.449906,0.218353,0.262400,0.873637,0.799627,0.040082,0.435603,0.121187,0.035639,0.349398,0.513834,0.146469,\n\t\t\t    0.909319,0.259732,0.420555,0.715973,0.762505,0.088201,0.681806,0.218159,0.424579,0.015297,0.553287,0.349248,\n\t\t\t    0.925647,0.117048,0.883083,0.981137,0.799147,0.270541,0.544144,0.544111,0.972679,0.218702,0.271733,0.337199,\n\t\t\t    0.759016,0.108116,0.499317,0.154844,0.918390,0.066221,0.750520,0.766535,0.863265,0.021507,0.543825,0.540325,\n\t\t\t    0.275537,0.356323,0.505599,0.126132,0.428345,0.012259,0.269943,0.148617,0.068272,0.387895,0.805805,0.293201,\n\t\t\t    0.245267,0.415827,0.583117,0.421237,0.102149,0.681202,0.402392,0.609599,0.869266,0.087699,0.896201,0.122770,\n\t\t\t    0.284711,0.136538,0.346854,0.032547,0.279871,0.503853,0.118968,0.704033,0.907784,0.068635,0.888106,0.139754,\n\t\t\t    0.903876,0.083331,0.238232,0.840079,0.637004,0.230364,0.342939,0.077669,0.039086,0.347386,0.841961,0.740640,\n\t\t\t    0.797115,0.070185,0.551997,0.647233,0.309110,0.121483,0.442944,0.033911,0.928047,0.557693,0.316460,0.155930,\n\t\t\t    0.557426,0.621289,0.356571,0.048492,0.596365,0.263834,0.233333,0.161790,0.295750,0.063380,0.756986,0.272861,\n\t\t\t    0.878251,0.548232,0.547333,0.221842,0.145880,0.341895,0.909180,0.142964,0.250164,0.179567,0.691372,0.314116,\n\t\t\t    0.335119,0.082348,0.962206,0.753577,0.152139,0.221370,0.484843,0.894514,0.439767,0.111424,0.198245,0.211040,\n\t\t\t    0.274425,0.413572,0.947279,0.227633,0.905551,0.082089,0.277522,0.090482,0.246063,0.909711,0.376357,0.715097,\n\t\t\t    0.911552,0.137507,0.783997,0.096086,0.687411,0.779936,0.899690,0.141191,0.139343,0.511242,0.214802,0.509251,\n\t\t\t    0.224891,0.189025,0.547473,0.041058,0.400594,0.127052,0.328346,0.448972,0.451101,0.351569,0.902202,0.118206,\n\t\t\t    0.206856,0.494930,0.415767,0.695073,0.870801,0.029769,0.230772,0.157145,0.543235,0.550296,0.141736,0.579770,\n\t\t\t    0.262621,0.690502,0.144512,0.488521,0.303400,0.019410,0.038270,0.330843,0.176372,0.195295,0.479357,0.179131,\n\t\t\t    0.202951,0.423205,0.078483,0.217874,0.049884,0.148145,0.658439,0.186389,0.107814,0.489198,0.418164,0.131839,\n\t\t\t    0.897457,0.067268,0.967515,0.180323,0.249144,0.858314,0.540633,0.026597,0.569101,0.833835,0.793557,0.265886,\n\t\t\t    0.127353,0.193488,0.658858,0.129496,0.392377,0.036693,0.113559,0.408643,0.517463,0.165731,0.542319,0.452202,\n\t\t\t    0.699897,0.719234,0.679883,0.221245,0.516067,0.084244,0.323133,0.483122,0.272026,0.104831,0.468470,0.144515,\n\t\t\t    0.540254,0.680049,0.261775,0.174725,0.870776,0.643552,0.314183,0.050036,0.182032,0.583566,0.784271,0.339836,\n\t\t\t    0.481854,0.723504,0.750503,0.111703,0.977702,0.173485,0.859637,0.029392,0.815476,0.199333,0.133501,0.140122,\n\t\t\t    0.257827,0.161247,0.672292,0.313170,0.552079,0.034023,0.415120,0.136248,0.487313,0.128058,0.703872,0.902090,\n\t\t\t    0.792789,0.029531,0.082871,0.239100,0.702958,0.331012,0.331681,0.119971,0.728146,0.861671,0.518440,0.145631,\n\t\t\t    0.402851,0.050920,0.450743,0.230776,0.640088,0.213542,0.183560,0.493569,0.817297,0.231860,0.230477,0.168541,\n\t\t\t    0.928578,0.150039,0.899690,0.071203,0.533920,0.636083,0.313543,0.085465,0.059488,0.330843,0.766893,0.745300,\n\t\t\t    0.507413,0.073943,0.439630,0.371624,0.779584,0.244821,0.339460,0.105275,0.672031,0.743437,0.513880,0.487301,\n\t\t\t    0.753573,0.123286,0.937370,0.165809,0.398552,0.025775,0.927322,0.222330,0.379269,0.101782,0.918251,0.132162,\n\t\t\t    0.918670,0.141652,0.496128,0.910961,0.326972,0.029788,0.360751,0.046248,0.656904,0.086128,0.600278,0.221065,\n\t\t\t    0.949372,0.173904,0.799448,0.200046,0.261160,0.373403,0.086527,0.277897,0.325782,0.014053,0.307806,0.114982,\n\t\t\t    0.708803,0.211071,0.645179,0.092661,0.234678,0.186576,0.108985,0.152144,0.449555,0.773593,0.924252,0.118597,\n\t\t\t    0.889410,0.374811,0.339443,0.021298,0.606987,0.281446,0.862567,0.054289,0.073069,0.368707,0.606110,0.400920,\n\t\t\t    0.866475,0.030787,0.877489,0.596715,0.074860,0.357727,0.623005,0.885019,0.605678,0.080950,0.864242,0.051205,\n\t\t\t    0.538818,0.024503,0.278241,0.126211,0.253281,0.191600,0.158931,0.383574,0.660114,0.118008,0.610982,0.030980,\n\t\t\t    0.568878,0.567044,0.833958,0.176137,0.699654,0.320400,0.806467,0.198641,0.095521,0.356821,0.062398,0.360112,\n\t\t\t    0.078515,0.154575,0.891037,0.113615,0.488292,0.565989,0.316387,0.167930,0.416039,0.608344,0.912389,0.133711,\n\t\t\t    0.509447,0.309748,0.501235,0.774633,0.285504,0.532578,0.490524,0.119976,0.266719,0.088905,0.458141,0.176618,\n\t\t\t    0.826422,0.061420,0.013494,0.861197,0.912948,0.073241,0.049215,0.116705,0.286080,0.033387,0.251701,0.209210,\n\t\t\t    0.968910,0.225261,0.826084,0.227950,0.791767,0.302431,0.685988,0.203141,0.017914,0.160911,0.695325,0.337130,\n\t\t\t    0.569601,0.321477,0.852380,0.071510,0.812271,0.300063,0.579205,0.750681,0.344746,0.527287,0.552368,0.391958,\n\t\t\t    0.859358,0.033676,0.357312,0.320521,0.325936,0.909973,0.966817,0.177393,0.494087,0.590454,0.737524,0.087727,\n\t\t\t    0.403471,0.412788,0.604980,0.036256,0.796413,0.211395,0.701840,0.879536,0.259481,0.154160,0.803711,0.202378,\n\t\t\t    0.919507,0.120048,0.801058,0.298482,0.502954,0.614407,0.162002,0.249301,0.063272,0.779072,0.318036,0.085294,\n\t\t\t    0.725653,0.247307,0.173313,0.675315,0.408405,0.708661,0.168660,0.212029,0.342674,0.960226,0.749637,0.220819,\n\t\t\t    0.541750,0.031720,0.221603,0.512574,0.561682,0.783417,0.718216,0.878126,0.845960,0.096910,0.751619,0.088857,\n\t\t\t    0.547333,0.083727,0.514413,0.638483,0.497782,0.141235,0.018046,0.191398,0.900108,0.258615,0.496257,0.317567,\n\t\t\t    0.318831,0.123338,0.056732,0.381679,0.770117,0.215896,0.869406,0.025010,0.797207,0.314514,0.793905,0.057652,\n\t\t\t    0.293556,0.139172,0.474293,0.480959,0.389429,0.053396,0.366188,0.717663,0.633175,0.148562,0.137454,0.673532,\n\t\t\t    0.237117,0.197498,0.545295,0.395235,0.972260,0.185208,0.333346,0.030429,0.245179,0.302276,0.846086,0.696530,\n\t\t\t    0.487313,0.119111,0.958862,0.174043,0.933323,0.155622,0.209451,0.213186,0.553001,0.606772,0.349090,0.145836,\n\t\t\t    0.773501,0.299609,0.676510,0.296161,0.166696,0.399950,0.074426,0.305544,0.216793,0.564602,0.237769,0.191571,\n\t\t\t    0.545618,0.580387,0.168603,0.913209,0.326775,0.466555,0.037194,0.384967,0.421765,0.132796,0.369491,0.418536,\n\t\t\t    0.124146,0.902780,0.475309,0.217097,0.774507,0.096226,0.151796,0.489742,0.693229,0.755430,0.224080,0.949215,\n\t\t\t    0.674693,0.247374,0.625219,0.030798,0.809143,0.741556,0.776510,0.258895,0.873293,0.876093,0.929489,0.762522,\n\t\t\t    0.661091,0.154285,0.507046,0.881212,0.524302,0.113626,0.829992,0.920160,0.497224,0.062693,0.139690,0.696681,\n\t\t\t    0.086625,0.345091,0.515648,0.226030,0.596954,0.377901,0.395543,0.131745,0.683580,0.316207,0.201529,0.164736,\n\t\t\t    0.328429,0.043274,0.467493,0.209559,0.478245,0.336155,0.539227,0.579448,0.475935,0.678915,0.402037,0.751663,\n\t\t\t    0.206128,0.479414,0.882682,0.405056,0.054213,0.358051,0.265723,0.205497,0.676822,0.871294,0.610842,0.091390,\n\t\t\t    0.902202,0.072376,0.275592,0.202577,0.509609,0.388849,0.210429,0.688812,0.538679,0.022884,0.299108,0.093309,\n\t\t\t    0.259654,0.168127,0.934021,0.205165,0.332694,0.964010,0.502807,0.124945,0.408604,0.026949,0.545100,0.129747,\n\t\t\t    0.473687,0.388901,0.479639,0.851753,0.540832,0.442617,0.494842,0.882622,0.320873,0.084678,0.342474,0.123108,\n\t\t\t    0.549165,0.623473,0.609080,0.650485,0.074258,0.104454,0.926066,0.154784,0.511879,0.275860,0.921600,0.181021,\n\t\t\t    0.504342,0.112802,0.508530,0.149958,0.174328,0.251024,0.463445,0.173827,0.583903,0.064800,0.692356,0.771416,\n\t\t\t    0.727640,0.852978,0.365678,0.335117,0.088178,0.597944,0.918530,0.151714,0.787205,0.306428,0.912531,0.845916,\n\t\t\t    0.824572,0.280777,0.658998,0.110289,0.633219,0.262466,0.847077,0.154366,0.823188,0.817671,0.673365,0.238616,\n\t\t\t    0.558425,0.913572,0.426269,0.013687,0.774325,0.264834,0.540354,0.097057,0.072263,0.681173,0.198382,0.248649,\n\t\t\t    0.367564,0.132952,0.773251,0.150598,0.639668,0.258961,0.907366,0.078670,0.229839,0.634722,0.316523,0.595406,\n\t\t\t    0.520394,0.175222,0.874011,0.024605,0.565581,0.571062,0.404628,0.085566,0.892978,0.968557,0.129390,0.429218,\n\t\t\t    0.156234,0.129426,0.436850,0.115322,0.443346,0.222261,0.041172,0.857596,0.587756,0.586712,0.880348,0.535437,\n\t\t\t    0.787288,0.223769,0.891037,0.242706,0.584043,0.180526,0.613215,0.039983,0.762629,0.245804,0.746521,0.329454,\n\t\t\t    0.077747,0.595246,0.265843,0.494238,0.586416,0.061325,0.341021,0.066278,0.491082,0.113723,0.086504,0.263404,\n\t\t\t    0.021967,0.241196,0.249181,0.738623,0.557433,0.356990,0.867650,0.807012,0.847008,0.767611,0.479331,0.444281,\n\t\t\t    0.971004,0.187999,0.122652,0.371258,0.038052,0.349936,0.710867,0.893802,0.502528,0.065917,0.470703,0.227146,\n\t\t\t    0.511321,0.064591,0.515254,0.310979,0.925926,0.165949,0.095801,0.245024,0.021691,0.373646,0.861730,0.069459,\n\t\t\t    0.653833,0.108028,0.272880,0.197218,0.806598,0.294347,0.633219,0.247887,0.498201,0.127179,0.540082,0.640483,\n\t\t\t    0.513415,0.126593,0.816095,0.148225,0.111645,0.627122,0.806884,0.034402,0.947558,0.215352,0.271881,0.421639,\n\t\t\t    0.333216,0.503540,0.405712,0.462287,0.920902,0.115122,0.470145,0.210955,0.639668,0.274241,0.687210,0.861501,\n\t\t\t    0.761413,0.850368,0.884199,0.085480,0.269526,0.195889,0.951209,0.828653,0.717689,0.870776,0.558167,0.762887,\n\t\t\t    0.923136,0.115541,0.944767,0.174183,0.466237,0.189878,0.097053,0.253799,0.038172,0.334430,0.336694,0.958662,\n\t\t\t    0.407615,0.556372,0.871360,0.081503,0.351182,0.696814,0.752736,0.118095,0.913925,0.072166,0.503981,0.922163,\n\t\t\t    0.326558,0.070543,0.666395,0.143817,0.105349,0.496252,0.332536,0.116665,0.286109,0.351878,0.129011,0.202066,\n\t\t\t    0.794463,0.073241,0.826214,0.309924,0.174322,0.855738,0.254032,0.886882,0.465259,0.215282,0.927601,0.131995,\n\t\t\t    0.891735,0.143075,0.140846,0.501531,0.597502,0.676955,0.409120,0.628934,0.623823,0.037959,0.889921,0.167484,\n\t\t\t    0.860753,0.096980,0.260876,0.151038,0.574429,0.599066,0.842052,0.104809,0.562161,0.431863,0.437141,0.552241,\n\t\t\t    0.942813,0.153947,0.557734,0.907539,0.032721,0.355557,0.332052,0.121023,0.231953,0.153492,0.179273,0.155745,\n\t\t\t    0.188686,0.723531,0.491998,0.856678,0.191323,0.300619,0.111487,0.917996,0.330970,0.412886,0.222129,0.160115,\n\t\t\t    0.260837,0.168246,0.577221,0.459745,0.647831,0.119851,0.348564,0.041883,0.800325,0.049460,0.786105,0.916422,\n\t\t\t    0.488011,0.632142,0.096263,0.695975,0.258741,0.569195,0.383818,0.735695,0.127710,0.556100,0.952443,0.227633,\n\t\t\t    0.624441,0.623511,0.534352,0.223797,0.944364,0.905167,0.901644,0.089136,0.667791,0.087929,0.794262,0.264425,\n\t\t\t    0.273510,0.508073,0.527329,0.312477,0.245557,0.189283,0.494914,0.404075,0.900667,0.128296,0.458733,0.332639,\n\t\t\t    0.542029,0.029668,0.706637,0.208036,0.942370,0.885895,0.234149,0.726887,0.778554,0.163716,0.071617,0.401812,\n\t\t\t    0.405980,0.296936,0.522068,0.641085,0.392996,0.572536,0.874503,0.886040,0.526256,0.116264,0.116499,0.507530,\n\t\t\t    0.858520,0.210328,0.965561,0.216887,0.285941,0.412014,0.352366,0.427667,0.507832,0.257994,0.738640,0.097510,\n\t\t\t    0.159539,0.197684,0.115159,0.907071,0.272432,0.703097,0.341059,0.651177,0.826422,0.166786,0.681705,0.932044,\n\t\t\t    0.898992,0.146550,0.422993,0.478325,0.839540,0.162600,0.281842,0.511583,0.487313,0.134339,0.024765,0.372282,\n\t\t\t    0.194641,0.907239,0.497298,0.731103,0.108303,0.900404,0.659277,0.174524,0.284602,0.141226,0.497224,0.220865,\n\t\t\t    0.523820,0.468866,0.060806,0.379022,0.380472,0.291147,0.509646,0.145911,0.889781,0.123691,0.576063,0.632662,\n\t\t\t    0.611680,0.042998,0.754507,0.317898,0.190185,0.356465,0.011706,0.193760,0.932780,0.963938,0.689615,0.205844,\n\t\t\t    0.136138,0.266225,0.497084,0.130934,0.463070,0.853994,0.499317,0.125783,0.239948,0.858081,0.958289,0.516112,\n\t\t\t    0.832075,0.710514,0.327596,0.970302,0.169687,0.384747,0.869824,0.037486,0.505040,0.131673,0.150807,0.214076,\n\t\t\t    0.504482,0.272789,0.817069,0.279987,0.538701,0.361640,0.627452,0.155960,0.512577,0.121442,0.885176,0.130934,\n\t\t\t    0.479497,0.155542,0.172850,0.447873,0.528057,0.461198,0.915041,0.141317,0.523357,0.927957,0.393956,0.125095,\n\t\t\t    0.087560,0.825702,0.862846,0.111856,0.356227,0.708210,0.938766,0.209491,0.595070,0.178572,0.732206,0.919821,\n\t\t\t    0.922159,0.134590,0.796554,0.214693,0.814560,0.176276,0.118199,0.354237,0.794603,0.022875,0.106601,0.359548,\n\t\t\t    0.033621,0.360049,0.152032,0.299016,0.081533,0.371255,0.491640,0.121944,0.338120,0.066774,0.975470,0.228750,\n\t\t\t    0.450883,0.131213,0.925229,0.123496,0.512840,0.470352,0.191322,0.709745,0.445439,0.186668,0.321394,0.166497,\n\t\t\t    0.131967,0.510768,0.869757,0.412692,0.923554,0.212980,0.658225,0.812235,0.558590,0.592676,0.466157,0.792070,\n\t\t\t    0.260098,0.172699,0.716778,0.892017,0.212727,0.857063,0.557298,0.612775,0.792928,0.023195,0.712647,0.210457,\n\t\t\t    0.881438,0.507660,0.553754,0.037177,0.842948,0.245366,0.387343,0.047012,0.363263,0.681998,0.098630,0.493354,\n\t\t\t    0.031270,0.381580,0.837041,0.270762,0.192893,0.340752,0.914622,0.198885,0.076261,0.310770,0.504203,0.071179,\n\t\t\t    0.103606,0.699033,0.838337,0.282009,0.510205,0.120800,0.662347,0.095285,0.333721,0.038052,0.642806,0.108684,\n\t\t\t    0.257618,0.369762,0.676306,0.093596,0.983983,0.170554,0.897457,0.070366,0.441810,0.187924,0.036101,0.253124,\n\t\t\t    0.130215,0.387431,0.483684,0.171593,0.100433,0.489073,0.577579,0.742699,0.981408,0.974881,0.326595,0.075740,\n\t\t\t    0.102670,0.576049,0.894911,0.866005,0.701967,0.872602,0.462747,0.176758,0.279561,0.957661,0.863963,0.058643,\n\t\t\t    0.511740,0.213607,0.238646,0.139742,0.887130,0.127138,0.184060,0.379519,0.514184,0.359044,0.203370,0.609035,\n\t\t\t    0.763370,0.223061,0.816095,0.080875,0.548310,0.183039,0.456759,0.450821,0.332539,0.053356,0.245716,0.507484,\n\t\t\t    0.929695,0.146550,0.364133,0.067523,0.598601,0.216312,0.454652,0.137368,0.837017,0.684923,0.417531,0.008304,\n\t\t\t    0.525453,0.305650,0.771204,0.295879,0.621341,0.855551,0.052944,0.835405,0.232097,0.396668,0.805299,0.723324,\n\t\t\t    0.901085,0.213678,0.975051,0.181579,0.970585,0.185627,0.826841,0.191767,0.557662,0.032962,0.281947,0.405258,\n\t\t\t    0.717214,0.862638,0.283767,0.519561,0.015379,0.213530,0.251406,0.873725,0.502946,0.226867,0.685445,0.771642,\n\t\t\t    0.269170,0.189435,0.748130,0.123105,0.232781,0.438977,0.836136,0.695805,0.545937,0.021000,0.239970,0.502529,\n\t\t\t    0.540354,0.035963,0.984820,0.172089,0.640154,0.112146,0.094075,0.299896,0.067495,0.850720,0.714689,0.225827,\n\t\t\t    0.907784,0.083903,0.439382,0.092610,0.899709,0.430660,0.160583,0.724078,0.549546,0.327803,0.299147,0.043516,\n\t\t\t    0.925508,0.128143,0.752483,0.698512,0.909180,0.068049,0.173587,0.441082,0.204533,0.188462,0.500434,0.123815,\n\t\t\t    0.121006,0.888075,0.335930,0.366086,0.043643,0.853317,0.910994,0.262662,0.480021,0.380598,0.898294,0.072236,\n\t\t\t    0.335908,0.130008,0.541052,0.038168,0.695210,0.859246,0.876565,0.907425,0.730376,0.899149,0.440973,0.228124,\n\t\t\t    0.341311,0.059842,0.920409,0.744632,0.276682,0.951699,0.932625,0.226796,0.687662,0.288842,0.395848,0.588113,\n\t\t\t    0.230378,0.164736,0.468283,0.797050,0.213990,0.227096,0.058512,0.091430,0.508390,0.080754,0.701743,0.314095,\n\t\t\t    0.963468,0.216329,0.433575,0.185272,0.231303,0.164807,0.439298,0.175781,0.285827,0.728886,0.262991,0.432121,\n\t\t\t    0.475449,0.165731,0.529606,0.236359,0.516207,0.073398,0.888525,0.093086,0.942953,0.174462,0.161449,0.483593,\n\t\t\t    0.505877,0.112830,0.378863,0.587530,0.623823,0.163358,0.809712,0.292995,0.240180,0.158603,0.543564,0.087608,\n\t\t\t    0.372229,0.704068,0.606427,0.654701,0.821061,0.219605,0.314932,0.075047,0.417794,0.134045,0.724455,0.284566,\n\t\t\t    0.815847,0.288296,0.376752,0.076413,0.299265,0.104905,0.664162,0.118050,0.537841,0.025355,0.680533,0.324909,\n\t\t\t    0.515369,0.067173,0.335181,0.084873,0.480830,0.787066,0.947139,0.177114,0.171817,0.527104,0.985099,0.175858,\n\t\t\t    0.505164,0.854841,0.563053,0.449817,0.661789,0.103715,0.204248,0.632404,0.561152,0.052489,0.339348,0.086838,\n\t\t\t    0.745060,0.093979,0.597092,0.853988,0.529885,0.171035,0.315085,0.020313,0.915320,0.121598,0.924391,0.216469,\n\t\t\t    0.193167,0.871705,0.447254,0.216817,0.741571,0.088899,0.125527,0.296510,0.243560,0.612619,0.204296,0.856589,\n\t\t\t    0.895084,0.094914,0.781279,0.203677,0.906110,0.085033,0.498201,0.146050,0.448844,0.466943,0.796452,0.188383,\n\t\t\t    0.659556,0.137689,0.325650,0.930205,0.176396,0.966248,0.729405,0.270075,0.025208,0.201485,0.110499,0.693312,\n\t\t\t    0.816932,0.076576,0.580587,0.408801,0.902747,0.550008,0.749805,0.082214,0.094242,0.362664,0.802352,0.234098,\n\t\t\t    0.552916,0.035516,0.447673,0.177456,0.940215,0.924218,0.666954,0.150796,0.665418,0.112704,0.438105,0.402094,\n\t\t\t    0.206013,0.715127,0.610982,0.161125,0.812048,0.052224,0.304198,0.945959,0.669466,0.091669,0.483807,0.930662,\n\t\t\t    0.238536,0.227468,0.798232,0.077651,0.248702,0.301052,0.032913,0.322812,0.497447,0.578653,0.061437,0.365519,\n\t\t\t    0.508045,0.594406,0.835773,0.058741,0.387157,0.745246,0.784274,0.334884,0.797534,0.060750,0.146635,0.366311,\n\t\t\t    0.693141,0.337396,0.470418,0.770759,0.520966,0.716550,0.318331,0.010627,0.797534,0.030508,0.940720,0.151156,\n\t\t\t    0.264311,0.191608,0.406481,0.523696,0.920902,0.120188,0.914944,0.547726,0.136672,0.493214,0.552432,0.870841,\n\t\t\t    0.518440,0.122866,0.392740,0.022779,0.773447,0.229272,0.899690,0.078753,0.045686,0.325477,0.482560,0.541146,\n\t\t\t    0.924112,0.117327,0.836702,0.237128,0.601490,0.059091,0.166315,0.498232,0.947418,0.138624,0.521790,0.097979,\n\t\t\t    0.794524,0.317090,0.740267,0.234391,0.109662,0.319150,0.868708,0.151016,0.556628,0.755352,0.520186,0.464829,\n\t\t\t    0.962770,0.189534,0.278459,0.693840,0.314363,0.069379,0.488151,0.118720,0.622148,0.023387,0.786408,0.311533,\n\t\t\t    0.182354,0.674890,0.147966,0.506112,0.246741,0.358825,0.673991,0.295113,0.863405,0.128408,0.269578,0.112040,\n\t\t\t    0.511879,0.073008,0.017372,0.237557,0.882943,0.171113,0.844923,0.874611,0.915739,0.075599,0.388156,0.109700,\n\t\t\t    0.767808,0.125449,0.119211,0.347239,0.458366,0.489927,0.435250,0.230217,0.455210,0.230776,0.452558,0.230776,\n\t\t\t    0.884045,0.439100,0.252907,0.212938,0.555149,0.143105,0.495270,0.135414,0.289640,0.035477,0.265509,0.417283,\n\t\t\t    0.248320,0.170167,0.559877,0.626210,0.176672,0.118904,0.698970,0.225844,0.134331,0.349092,0.431769,0.454249,\n\t\t\t    0.258570,0.175157,0.776463,0.194612,0.569743,0.640444,0.500832,0.449893,0.537298,0.535168,0.489686,0.119725,\n\t\t\t    0.471902,0.357533,0.343431,0.025636,0.812759,0.688887,0.516207,0.125085,0.232248,0.566887,0.965421,0.172787,\n\t\t\t    0.502743,0.452003,0.685732,0.822737,0.708139,0.206341,0.797952,0.075209,0.546077,0.052168,0.560998,0.606827,\n\t\t\t    0.108877,0.313171,0.805488,0.076911,0.496805,0.119167,0.172905,0.732134,0.225640,0.380304,0.532258,0.081773,\n\t\t\t    0.208393,0.392521,0.608190,0.059566,0.063711,0.397238,0.567125,0.401713,0.900590,0.440599,0.116603,0.203727,\n\t\t\t    0.426177,0.181783,0.849030,0.143159,0.694788,0.887988,0.778973,0.156878,0.490085,0.828188,0.375268,0.484262,\n\t\t\t    0.953140,0.153528,0.810147,0.285084,0.163258,0.674046,0.641350,0.284755,0.215900,0.707956,0.773645,0.255154,\n\t\t\t    0.485250,0.803673,0.180097,0.731993,0.459402,0.775483,0.471541,0.229519,0.884478,0.114815,0.458839,0.174385,\n\t\t\t    0.349826,0.156017,0.068968,0.333144,0.902620,0.069249,0.839753,0.808035,0.906110,0.253870,0.743385,0.091760,\n\t\t\t    0.884757,0.089234,0.303202,0.112292,0.290946,0.100450,0.272241,0.197612,0.343460,0.343013,0.034159,0.858676,\n\t\t\t    0.152003,0.291226,0.889949,0.468324,0.172975,0.137829,0.618380,0.073147,0.457862,0.213049,0.762944,0.287987,\n\t\t\t    0.529606,0.106967,0.509872,0.407465,0.535469,0.098858,0.700298,0.729301,0.400229,0.122705,0.809296,0.314410,\n\t\t\t    0.867883,0.575402,0.514671,0.113807,0.267857,0.186440,0.026647,0.366765,0.357238,0.695385,0.861451,0.071859,\n\t\t\t    0.803536,0.317986,0.319676,0.040649,0.500434,0.079303,0.109647,0.484398,0.904156,0.113280,0.552642,0.655212,\n\t\t\t    0.462194,0.521386,0.539237,0.110848,0.267869,0.150756,0.559901,0.925940,0.879175,0.137158,0.919174,0.468570,\n\t\t\t    0.527428,0.649907,0.487592,0.123410,0.484276,0.431323,0.921600,0.129413,0.482204,0.712169,0.064729,0.681167,\n\t\t\t    0.269356,0.192769,0.018249,0.840520,0.701578,0.826242,0.164573,0.415984,0.017615,0.250212,0.909459,0.200559,\n\t\t\t    0.814281,0.048469,0.320183,0.127428,0.616286,0.039941,0.841925,0.835940,0.905412,0.062495,0.494432,0.120423,\n\t\t\t    0.292774,0.382955,0.276293,0.483380,0.689113,0.321607,0.954536,0.152412,0.842052,0.120746,0.683891,0.747341,\n\t\t\t    0.529606,0.098900,0.601630,0.145631,0.244422,0.184845,0.036893,0.349646,0.318867,0.011745,0.347151,0.576046,\n\t\t\t    0.910545,0.825711,0.727784,0.241855,0.848891,0.043027,0.786369,0.042315,0.030883,0.320633,0.548310,0.028635,\n\t\t\t    0.050567,0.393278,0.321432,0.153279,0.479776,0.215701,0.765513,0.307040,0.014333,0.851671,0.767287,0.199131,\n\t\t\t    0.715851,0.822925,0.970166,0.176834,0.208501,0.124548,0.044699,0.384977,0.859916,0.044548,0.815118,0.050465,\n\t\t\t    0.505319,0.117017,0.238668,0.185995,0.365223,0.032756,0.787067,0.044004,0.206275,0.309473,0.149420,0.137860,\n\t\t\t    0.774604,0.298985,0.790408,0.206029,0.482568,0.226169,0.501550,0.124429,0.664762,0.900458,0.046477,0.329198,\n\t\t\t    0.781883,0.215163,0.604915,0.761548,0.795167,0.199107,0.452279,0.217655,0.135776,0.728593,0.055517,0.397926,\n\t\t\t    0.508669,0.156658,0.965701,0.135525,0.524302,0.092995,0.436578,0.103718,0.369363,0.760437,0.909040,0.118932,\n\t\t\t    0.865917,0.020949,0.722545,0.216909,0.871778,0.020753,0.682028,0.174664,0.857125,0.071971,0.494917,0.673596,\n\t\t\t    0.891897,0.538561,0.790416,0.022637,0.926206,0.150598,0.805607,0.331130,0.770181,0.298477,0.545658,0.029221,\n\t\t\t    0.055051,0.391309,0.882664,0.086122,0.394430,0.642795,0.082620,0.365362,0.802749,0.191843,0.501690,0.063307,\n\t\t\t    0.443485,0.230496,0.052322,0.175199,0.803828,0.240151,0.842912,0.257565,0.898852,0.172927,0.558239,0.560084,\n\t\t\t    0.545798,0.029765,0.549175,0.722709,0.558220,0.046390,0.676690,0.229306,0.893145,0.513395,0.821800,0.322175,\n\t\t\t    0.784303,0.336429,0.617402,0.061073,0.169887,0.948087,0.560753,0.463337,0.533654,0.137075,0.668908,0.098746,\n\t\t\t    0.273487,0.393645,0.340046,0.029416,0.719389,0.242071,0.677730,0.917720,0.046840,0.240038,0.411181,0.008120,\n\t\t\t    0.552540,0.420729,0.558140,0.439197,0.284131,0.704141,0.934858,0.164414,0.533375,0.161404,0.315625,0.056463,\n\t\t\t    0.527652,0.204674,0.800269,0.218875,0.826612,0.270264,0.911971,0.063500,0.464455,0.663750,0.593534,0.063977,\n\t\t\t    0.908352,0.798701,0.885176,0.092709,0.469726,0.208443,0.674776,0.831322,0.312292,0.122969,0.865498,0.027745,\n\t\t\t    0.882008,0.496556,0.175734,0.895551,0.195387,0.795779,0.928159,0.179346,0.549815,0.851036,0.918949,0.069584,\n\t\t\t    0.076824,0.348917,0.190735,0.293219,0.670210,0.307258,0.062466,0.709202,0.278278,0.491665,0.640433,0.141290,\n\t\t\t    0.962909,0.218423,0.063747,0.243056,0.504063,0.116752,0.887699,0.897850,0.900248,0.121528,0.649361,0.768194,\n\t\t\t    0.259569,0.387255,0.542229,0.591085,0.363441,0.059657,0.484243,0.168243,0.678716,0.303523,0.211861,0.796142,\n\t\t\t    0.518440,0.259110,0.794771,0.201747,0.154601,0.172844,0.037308,0.151631,0.433435,0.227146,0.503282,0.633268,\n\t\t\t    0.065180,0.325605,0.033063,0.366948,0.604515,0.432166,0.478799,0.205093,0.742548,0.078502,0.444881,0.227286,\n\t\t\t    0.145814,0.405275,0.979098,0.177532,0.591692,0.825404,0.872197,0.125854,0.269625,0.920950,0.920484,0.139587,\n\t\t\t    0.348913,0.453531,0.667652,0.107540,0.885053,0.563746,0.485220,0.204116,0.434273,0.229101,0.470005,0.153867,\n\t\t\t    0.275520,0.955916,0.420827,0.140482,0.554451,0.055979,0.461640,0.842815,0.118872,0.310331,0.567801,0.588530,\n\t\t\t    0.305449,0.113994,0.320495,0.888966,0.150521,0.740560,0.187777,0.632015,0.620752,0.027476,0.032356,0.359523,\n\t\t\t    0.502946,0.146190,0.443951,0.043225,0.141561,0.499066,0.783408,0.308526,0.795508,0.302708,0.021184,0.214812,\n\t\t\t    0.116902,0.735537,0.839959,0.135009,0.156227,0.939778,0.639668,0.251952,0.472797,0.163218,0.693729,0.331431,\n\t\t\t    0.316137,0.050593,0.078192,0.318832,0.316512,0.075676,0.204190,0.414370,0.511182,0.089045,0.510623,0.147865,\n\t\t\t    0.829125,0.215846,0.261185,0.172655,0.358542,0.526744,0.645040,0.125364,0.526954,0.084467,0.884618,0.254429,\n\t\t\t    0.808421,0.258653,0.873174,0.081698,0.406669,0.674071,0.598280,0.176200,0.624252,0.895954,0.071760,0.193491,\n\t\t\t    0.362552,0.089251,0.795440,0.023851,0.728452,0.869687,0.507692,0.252271,0.438321,0.178572,0.502875,0.448578,\n\t\t\t    0.348788,0.051575,0.715866,0.311149,0.874988,0.217725,0.468051,0.156658,0.446835,0.174664,0.923415,0.963660,\n\t\t\t    0.150301,0.604139,0.539098,0.022647,0.338153,0.137821,0.202856,0.944346,0.789160,0.040166,0.423710,0.592960,\n\t\t\t    0.502388,0.159450,0.759151,0.236315,0.160189,0.172394,0.792649,0.055489,0.850845,0.054861,0.500573,0.273068,\n\t\t\t    0.543983,0.020051,0.786957,0.214712,0.772157,0.236434,0.488955,0.803320,0.888665,0.146271,0.443118,0.295895,\n\t\t\t    0.802976,0.028527,0.057278,0.369194,0.222576,0.174282,0.927322,0.150458,0.192916,0.136727,0.206584,0.585604,\n\t\t\t    0.701399,0.335926,0.718745,0.281161,0.260868,0.170592,0.665976,0.084593,0.500434,0.265252,0.817364,0.239160,\n\t\t\t    0.497744,0.938750,0.901839,0.835092,0.473216,0.193508,0.213180,0.609108,0.130779,0.603103,0.477263,0.227844,\n\t\t\t    0.121097,0.232602,0.703087,0.327545,0.494990,0.116599,0.608245,0.260340,0.620334,0.059719,0.215306,0.185903,\n\t\t\t    0.343363,0.938944,0.777340,0.304236,0.300332,0.072462,0.623125,0.139336,0.755429,0.794485,0.553474,0.033576,\n\t\t\t    0.557755,0.659237,0.571203,0.610771,0.673374,0.098593,0.706462,0.220131,0.915599,0.062788,0.127005,0.727151,\n\t\t\t    0.524442,0.095927,0.552588,0.472233,0.173366,0.506759,0.148496,0.358549,0.910017,0.114396,0.522906,0.091823,\n\t\t\t    0.607546,0.287176,0.797982,0.217550,0.677837,0.251548,0.499574,0.868711,0.469028,0.227426,0.892572,0.079019,\n\t\t\t    0.828653,0.290875,0.486862,0.490049,0.614750,0.044226,0.349808,0.888710,0.917972,0.125407,0.109178,0.949879,\n\t\t\t    0.570783,0.149400,0.239360,0.567867,0.494100,0.554558,0.509294,0.816807,0.352595,0.058194,0.072793,0.687300,\n\t\t\t    0.191042,0.149668,0.515895,0.302396,0.515518,0.578786,0.906528,0.151993,0.857683,0.179626,0.878251,0.797414,\n\t\t\t    0.034745,0.231826,0.559337,0.049404,0.373085,0.055422,0.827355,0.234696,0.320760,0.083163,0.671493,0.247396,\n\t\t\t    0.529746,0.090176,0.928299,0.122602,0.062138,0.236115,0.859079,0.037277,0.805452,0.252518,0.960676,0.134535,\n\t\t\t    0.509769,0.573022,0.351947,0.017174,0.494627,0.938356,0.797952,0.062579,0.003755,0.185924,0.324922,0.124582,\n\t\t\t    0.906807,0.156180,0.408155,0.570277,0.508251,0.133250,0.968426,0.537862,0.898155,0.233774,0.481591,0.203139,\n\t\t\t    0.343980,0.071929,0.038707,0.327127,0.803535,0.033355,0.745241,0.217993,0.486895,0.174664,0.547612,0.069686,\n\t\t\t    0.234565,0.172825,0.509088,0.171454,0.914952,0.575790,0.440545,0.047363,0.554172,0.132762,0.796975,0.058629,\n\t\t\t    0.782270,0.255877,0.145914,0.523458,0.037869,0.342816,0.120717,0.768718,0.504482,0.162660,0.456745,0.183039,\n\t\t\t    0.916855,0.130264,0.796417,0.024228,0.377267,0.269763,0.458699,0.217515,0.485784,0.791092,0.233171,0.181253,\n\t\t\t    0.114811,0.195142,0.080427,0.783274,0.920719,0.835811,0.196433,0.722656,0.836889,0.066417,0.099970,0.422068,\n\t\t\t    0.676245,0.855136,0.358747,0.671082,0.543704,0.114979,0.821714,0.206528,0.105329,0.220397,0.464971,0.716585,\n\t\t\t    0.916437,0.127975,0.964724,0.133600,0.281877,0.429624,0.890200,0.158273,0.484661,0.158473,0.380713,0.690643,\n\t\t\t    0.193756,0.397018,0.782043,0.117802,0.380345,0.598439,0.334393,0.629568,0.061347,0.155801,0.408302,0.355017,\n\t\t\t    0.165692,0.353073,0.635412,0.724430,0.936812,0.182417,0.923136,0.119811,0.674809,0.269599,0.475158,0.816231,\n\t\t\t    0.482380,0.757453,0.910296,0.066012,0.839327,0.229816,0.250926,0.502483,0.671848,0.283858,0.355610,0.332335,\n\t\t\t    0.662347,0.111616,0.277647,0.728259,0.764085,0.278952,0.581391,0.188343,0.966104,0.954502,0.162691,0.368070,\n\t\t\t    0.860753,0.034123,0.982727,0.170554,0.923415,0.120258,0.469088,0.747416,0.899881,0.910010,0.945046,0.185487,\n\t\t\t    0.571450,0.600387,0.887548,0.112861,0.501969,0.072561,0.968270,0.525911,0.691471,0.332009,0.280039,0.964192,\n\t\t\t    0.800604,0.060527,0.685835,0.845146,0.639948,0.268353,0.456885,0.151075,0.341798,0.039972,0.744223,0.092960,\n\t\t\t    0.648250,0.094810,0.480195,0.161683,0.510763,0.195880,0.265484,0.421374,0.214651,0.586049,0.404092,0.131770,\n\t\t\t    0.887409,0.179765,0.767486,0.282238,0.135279,0.388055,0.475864,0.346501,0.159553,0.731508,0.568689,0.052573,\n\t\t\t    0.286653,0.145099,0.313030,0.983521,0.553118,0.889409,0.573710,0.408763,0.749665,0.101501,0.345377,0.052308,\n\t\t\t    0.878491,0.954332,0.059813,0.106153,0.864521,0.034988,0.887688,0.133893,0.597203,0.275855,0.412967,0.136172,\n\t\t\t    0.339736,0.048223,0.052248,0.328152,0.251685,0.299534,0.982587,0.176695,0.112261,0.970452,0.813429,0.239508,\n\t\t\t    0.301597,0.968205,0.374299,0.064715,0.308350,0.135230,0.793626,0.051135,0.790052,0.210600,0.501989,0.482046,\n\t\t\t    0.692989,0.201797,0.498480,0.270975,0.389812,0.523912,0.451302,0.184435,0.906947,0.112917,0.505877,0.194205,\n\t\t\t    0.159172,0.300071,0.797139,0.268677,0.526363,0.726835,0.906110,0.139349,0.167678,0.491825,0.179250,0.690995,\n\t\t\t    0.943232,0.229587,0.508227,0.893871,0.634481,0.279989,0.171402,0.109750,0.146610,0.481320,0.477768,0.303290,\n\t\t\t    0.171729,0.225201,0.941484,0.831522,0.801860,0.161204,0.092511,0.411946,0.244467,0.439693,0.794603,0.034960,\n\t\t\t    0.645836,0.210318,0.950628,0.191628,0.230871,0.611744,0.440275,0.173547,0.205538,0.907195,0.497546,0.882625,\n\t\t\t    0.462520,0.495692,0.912669,0.148923,0.527370,0.670982,0.909877,0.070059,0.263013,0.174606,0.557243,0.163498,\n\t\t\t    0.186422,0.371543,0.255407,0.396001,0.435529,0.224076,0.450464,0.146329,0.843029,0.082912,0.314979,0.081649,\n\t\t\t    0.388081,0.114247,0.502667,0.135637,0.266006,0.569502,0.129242,0.833586,0.958944,0.770674,0.153327,0.699951,\n\t\t\t    0.353442,0.415799,0.920902,0.120425,0.848891,0.053549,0.348896,0.673169,0.219035,0.739705,0.427424,0.735515,\n\t\t\t    0.608245,0.249438,0.237891,0.947565,0.657881,0.101566,0.549297,0.717844,0.498556,0.894000,0.423997,0.628553,\n\t\t\t    0.963747,0.132371,0.232454,0.480244,0.877221,0.186324,0.535808,0.734032,0.451162,0.144096,0.507971,0.266927,\n\t\t\t    0.042990,0.355095,0.504901,0.119125,0.573295,0.162521,0.339037,0.009055,0.117016,0.298999,0.380248,0.076074,\n\t\t\t    0.256431,0.182189,0.521929,0.186808,0.256113,0.509825,0.764180,0.176695,0.433714,0.177456,0.301768,0.965655,\n\t\t\t    0.469835,0.489284,0.095857,0.679994,0.050182,0.349330,0.317529,0.609149,0.663185,0.169500,0.317878,0.502148,\n\t\t\t    0.452139,0.134451,0.525419,0.179689,0.448370,0.174804,0.497547,0.849584,0.611540,0.035684,0.280246,0.506816,\n\t\t\t    0.025931,0.373330,0.621590,0.025117,0.868847,0.032337,0.605119,0.058198,0.772787,0.300307,0.392873,0.108619,\n\t\t\t    0.245766,0.509970,0.602934,0.209743,0.578555,0.429558,0.060621,0.370346,0.945604,0.219399,0.318922,0.155917,\n\t\t\t    0.562599,0.575465,0.228715,0.177559,0.309812,0.125148,0.042752,0.833304,0.262639,0.676173,0.278643,0.702203,\n\t\t\t    0.881268,0.083791,0.833121,0.158134,0.506017,0.069211,0.851403,0.048372,0.872197,0.211724,0.676166,0.082429,\n\t\t\t    0.744445,0.743893,0.122930,0.257464,0.497363,0.115077,0.269597,0.148038,0.254899,0.689744,0.745167,0.320450,\n\t\t\t    0.338406,0.023736,0.078623,0.696312,0.936533,0.166507,0.508809,0.152052,0.919926,0.119825,0.663079,0.880511,\n\t\t\t    0.435669,0.221982,0.854008,0.666300,0.653135,0.085416,0.136445,0.425946,0.037638,0.863852,0.107978,0.307748,\n\t\t\t    0.493304,0.869399,0.136044,0.628237,0.863135,0.616913,0.391664,0.125770,0.735151,0.178788,0.508111,0.274604,\n\t\t\t    0.309614,0.048075,0.503365,0.155402,0.688416,0.297583,0.637223,0.101119,0.617123,0.031943,0.807288,0.246201,\n\t\t\t    0.272131,0.427851,0.447812,0.219051,0.593727,0.625748,0.941557,0.223028,0.492618,0.117883,0.321770,0.075289,\n\t\t\t    0.578015,0.596745,0.492338,0.120786,0.934343,0.865134,0.574735,0.869457,0.246266,0.700142,0.798092,0.044325,\n\t\t\t    0.550125,0.025034,0.550896,0.610506,0.900108,0.118723,0.909040,0.083122,0.318020,0.127375,0.332817,0.130584,\n\t\t\t    0.111409,0.709152,0.447673,0.231334,0.564511,0.649545,0.175414,0.362655,0.388065,0.040013,0.806806,0.287109,\n\t\t\t    0.506296,0.151912,0.523362,0.643933,0.869964,0.205862,0.174315,0.582840,0.499212,0.921343,0.613773,0.038741,\n\t\t\t    0.481730,0.162381,0.270844,0.095123,0.072841,0.329029,0.854473,0.034360,0.454508,0.784947,0.551102,0.069364,\n\t\t\t    0.664581,0.179968,0.668070,0.087384,0.478485,0.325428,0.173530,0.925418,0.554011,0.885419,0.336687,0.447859,\n\t\t\t    0.507971,0.127109,0.935835,0.193860,0.623544,0.036033,0.064814,0.137041,0.101231,0.732395,0.943947,0.877833,\n\t\t\t    0.716198,0.829978,0.304544,0.959415,0.274213,0.399794,0.441330,0.306171,0.515369,0.137815,0.856791,0.835644,\n\t\t\t    0.355303,0.721558,0.610212,0.630854,0.147269,0.512569,0.430694,0.090824,0.559422,0.769713,0.890200,0.094565,\n\t\t\t    0.266092,0.153243,0.775448,0.263525,0.368803,0.110534,0.869127,0.031346,0.516765,0.127793,0.958025,0.229029,\n\t\t\t    0.872476,0.090923,0.349232,0.318464,0.621032,0.058142,0.585299,0.141067,0.434142,0.110339,0.295179,0.977214,\n\t\t\t    0.497224,0.144794,0.875932,0.609625,0.212520,0.164878,0.564453,0.375427,0.465579,0.869650,0.771372,0.202217,\n\t\t\t    0.627592,0.036423,0.418565,0.426298,0.749665,0.094147,0.452837,0.219609,0.518579,0.119893,0.534186,0.581110,\n\t\t\t    0.447812,0.221144,0.280074,0.939729,0.254858,0.175607,0.900108,0.068245,0.891177,0.263500,0.765467,0.737435,\n\t\t\t    0.756504,0.157575,0.264633,0.155998,0.677701,0.178712,0.569806,0.082820,0.452237,0.597231,0.514811,0.119237,\n\t\t\t    0.286002,0.949153,0.299776,0.065013,0.459106,0.581156,0.563586,0.573490,0.881687,0.081112,0.285217,0.382708,\n\t\t\t    0.916855,0.116811,0.614551,0.809559,0.930253,0.226238,0.498872,0.939036,0.772654,0.218390,0.600234,0.053801,\n\t\t\t    0.314410,0.129622,0.883501,0.127989,0.436105,0.066743,0.154177,0.154842,0.189556,0.584349,0.603444,0.045273,\n\t\t\t    0.758178,0.088522,0.876451,0.775127,0.263424,0.476930,0.918530,0.063486,0.486895,0.165871,0.263483,0.151915,\n\t\t\t    0.531002,0.077991,0.891595,0.088006,0.439488,0.316569,0.325734,0.039039,0.445858,0.172431,0.523845,0.569536,\n\t\t\t    0.515229,0.127207,0.785633,0.907792,0.464980,0.150098,0.916576,0.152970,0.753154,0.099171,0.622846,0.087342,\n\t\t\t    0.714190,0.325889,0.795161,0.036160,0.202128,0.671708,0.702828,0.325504,0.041300,0.326473,0.563381,0.465582,\n\t\t\t    0.044190,0.368271,0.490803,0.114463,0.491625,0.836217,0.741850,0.089583,0.325208,0.138104,0.776884,0.230730,\n\t\t\t    0.344425,0.143044,0.560341,0.677606,0.774852,0.193521,0.547891,0.072268,0.902481,0.253731,0.892991,0.092402,\n\t\t\t    0.903179,0.277874,0.442886,0.049885,0.226260,0.419212,0.082743,0.841250,0.922856,0.130836,0.551381,0.076344,\n\t\t\t    0.489313,0.937705,0.444881,0.231613,0.916716,0.062914,0.586136,0.097323,0.318902,0.133803,0.753852,0.110377,\n\t\t\t    0.189982,0.164154,0.892496,0.599440,0.596745,0.080782,0.498622,0.741345,0.543564,0.167406,0.914064,0.062969,\n\t\t\t    0.538818,0.147306,0.566455,0.126565,0.734872,0.088327,0.375294,0.055204,0.871639,0.122072,0.511480,0.941198,\n\t\t\t    0.859847,0.641163,0.737711,0.280931,0.796585,0.264638,0.560035,0.059412,0.433344,0.016897,0.247908,0.674905,\n\t\t\t    0.173678,0.506977,0.729054,0.706850,0.862707,0.025135,0.918809,0.197489,0.832842,0.060443,0.059056,0.820823,\n\t\t\t    0.263934,0.176993,0.372535,0.117844,0.331524,0.071271,0.566874,0.096820,0.822865,0.726149,0.634341,0.216486,\n\t\t\t    0.546202,0.482260,0.927043,0.182556,0.347148,0.685609,0.551700,0.614181,0.873872,0.084378,0.800000,0.246144,\n\t\t\t    0.511461,0.080950,0.910017,0.125031,0.932799,0.973902,0.306102,0.080194,0.607632,0.031385,0.493176,0.121456,\n\t\t\t    0.709613,0.878500,0.618519,0.070732,0.484505,0.830272,0.238752,0.699863,0.322619,0.630436,0.413934,0.684670,\n\t\t\t    0.485220,0.126034,0.804512,0.071036,0.365841,0.428837,0.010944,0.209864,0.870137,0.844649,0.613871,0.423264,\n\t\t\t    0.165415,0.741827,0.902831,0.740311,0.036231,0.137155,0.326508,0.079422,0.499876,0.139071,0.826003,0.176695,\n\t\t\t    0.069098,0.660792,0.553344,0.441005,0.502667,0.081899,0.637100,0.407784,0.286999,0.421733,0.487545,0.625934,\n\t\t\t    0.772787,0.267471,0.616984,0.062776,0.500253,0.926750,0.575947,0.066322,0.066494,0.313868,0.731156,0.926350,\n\t\t\t    0.800325,0.033383,0.168543,0.253093,0.498226,0.893913,0.490245,0.117562,0.605949,0.937662,0.818541,0.221175,\n\t\t\t    0.764703,0.318846,0.799906,0.025749,0.738819,0.294491,0.489614,0.836784,0.330362,0.889325,0.813164,0.055322,\n\t\t\t    0.262693,0.177170,0.746735,0.081810,0.297729,0.960021,0.522906,0.261623,0.865219,0.076604,0.159275,0.561225,\n\t\t\t    0.141298,0.365690,0.872790,0.725432,0.777234,0.195542,0.169120,0.484516,0.083908,0.401748,0.644621,0.163637,\n\t\t\t    0.435315,0.060006,0.820560,0.150737,0.704013,0.305964,0.861311,0.027257,0.441712,0.778901,0.627482,0.921912,\n\t\t\t    0.042847,0.198335,0.471125,0.536980,0.913506,0.125868,0.559651,0.675388,0.601909,0.173966,0.194237,0.505349,\n\t\t\t    0.780984,0.314589,0.955931,0.151156,0.575801,0.610853,0.246757,0.270530,0.305319,0.133082,0.189883,0.487057,\n\t\t\t    0.769112,0.199726,0.106043,0.475807,0.485778,0.172291,0.120013,0.341182,0.791991,0.224225,0.483265,0.152331,\n\t\t\t    0.423111,0.075541,0.540214,0.135958,0.392768,0.763809,0.565339,0.047046,0.523046,0.123605,0.959420,0.176137,\n\t\t\t    0.794753,0.324842,0.791104,0.680053,0.004418,0.218310,0.952605,0.751027,0.881950,0.747600,0.582970,0.355010,\n\t\t\t    0.296898,0.109634,0.928299,0.147109,0.496665,0.113444,0.059161,0.382722,0.930672,0.127878,0.544541,0.027044,\n\t\t\t    0.291627,0.045615,0.676463,0.281101,0.547402,0.837069,0.505738,0.149400,0.183670,0.871320,0.556515,0.608269,\n\t\t\t    0.372259,0.100826,0.184230,0.227362,0.181061,0.724168,0.944906,0.211863,0.783541,0.304414,0.520811,0.665162,\n\t\t\t    0.274806,0.112009,0.949545,0.950501,0.464143,0.184854,0.783340,0.310437,0.580693,0.144096,0.939292,0.831345,\n\t\t\t    0.180177,0.527804,0.867312,0.036467,0.472855,0.863528,0.018045,0.230149,0.600094,0.067145,0.441950,0.179410,\n\t\t\t    0.448654,0.741634,0.615727,0.070090,0.196169,0.632119,0.204143,0.953277,0.196853,0.455573,0.340953,0.617286,\n\t\t\t    0.494153,0.134563,0.476007,0.221842,0.851124,0.091607,0.677812,0.325538,0.807442,0.056201,0.772692,0.099520,\n\t\t\t    0.236544,0.714633,0.172062,0.935533,0.498405,0.855848,0.726890,0.257108,0.604840,0.067857,0.573011,0.397487,\n\t\t\t    0.494572,0.132078,0.838145,0.060723,0.965142,0.231402,0.674212,0.097420,0.481032,0.773816,0.108523,0.875174,\n\t\t\t    0.832929,0.687584,0.339301,0.109461,0.618100,0.059119,0.859213,0.944682,0.933044,0.215771,0.100773,0.385230,\n\t\t\t    0.857125,0.030522,0.501550,0.144933,0.337222,0.013581,0.555568,0.104302,0.802512,0.302455,0.057616,0.222574,\n\t\t\t    0.789579,0.042161,0.256473,0.149741,0.539399,0.779759,0.839473,0.270975,0.117682,0.500167,0.324003,0.543046,\n\t\t\t    0.865079,0.055838,0.154710,0.406323,0.240682,0.520350,0.643733,0.241298,0.516091,0.461387,0.659556,0.084048,\n\t\t\t    0.196174,0.936942,0.696759,0.333923,0.894622,0.585384,0.048772,0.196044,0.056378,0.373523,0.915599,0.214375,\n\t\t\t    0.079914,0.704633,0.236353,0.186341,0.326674,0.630481,0.293309,0.408377,0.511740,0.180108,0.052268,0.855603,\n\t\t\t    0.825455,0.316993,0.708128,0.824566,0.607267,0.276693,0.263988,0.702526,0.403685,0.074296,0.920763,0.123496,\n\t\t\t    0.899858,0.750774,0.913087,0.061197,0.334360,0.081027,0.058405,0.159885,0.447524,0.564131,0.895224,0.231262,\n\t\t\t    0.882943,0.199024,0.432319,0.227146,0.900806,0.243822,0.651600,0.128086,0.941737,0.974205,0.614471,0.053718,\n\t\t\t    0.518300,0.069560,0.900806,0.259732,0.119165,0.520162,0.243507,0.886627,0.279670,0.343558,0.488151,0.205930,\n\t\t\t    0.526396,0.257156,0.554312,0.027951,0.597303,0.051847,0.698642,0.199153,0.544821,0.108782,0.586416,0.166708,\n\t\t\t    0.781862,0.325915,0.530117,0.311963,0.944348,0.139907,0.333079,0.048324,0.097946,0.345944,0.494292,0.151633,\n\t\t\t    0.200800,0.221234,0.436506,0.226867,0.189788,0.420984,0.559058,0.113570,0.811210,0.050214,0.495198,0.856376,\n\t\t\t    0.519975,0.149819,0.485246,0.394867,0.102642,0.416415,0.268196,0.513285,0.413148,0.111896,0.897457,0.137898,\n\t\t\t    0.443346,0.139266,0.501082,0.888250,0.498899,0.168243,0.495549,0.111923,0.457185,0.468691,0.565060,0.055337,\n\t\t\t    0.863514,0.609348,0.642108,0.169360,0.842052,0.149481,0.488709,0.132232,0.079252,0.165172,0.586198,0.618250,\n\t\t\t    0.518440,0.116668,0.770281,0.227799,0.725765,0.226345,0.296438,0.143239,0.153591,0.414737,0.543324,0.469716,\n\t\t\t    0.077841,0.386949,0.676462,0.898268,0.431475,0.476900,0.367055,0.267803,0.050310,0.251608,0.529751,0.718223,\n\t\t\t    0.427154,0.179410,0.489826,0.168941,0.299564,0.112655,0.865219,0.027940,0.193452,0.190799,0.753573,0.174601,\n\t\t\t    0.745709,0.226158,0.207629,0.708380,0.077695,0.344273,0.969469,0.222330,0.858022,0.647726,0.920065,0.136642,\n\t\t\t    0.102133,0.765742,0.601211,0.087175,0.510362,0.319507,0.859358,0.109484,0.131866,0.409128,0.807475,0.196969,\n\t\t\t    0.565215,0.450802,0.549566,0.147865,0.498619,0.111853,0.881408,0.249544,0.589626,0.163637,0.171197,0.606598,\n\t\t\t    0.960676,0.181859,0.254279,0.156620,0.708829,0.908126,0.125571,0.737052,0.279975,0.118508,0.615588,0.034330,\n\t\t\t    0.715692,0.209488,0.852846,0.704643,0.753992,0.129580,0.718701,0.301598,0.250595,0.424508,0.601816,0.275715,\n\t\t\t    0.110336,0.326079,0.814978,0.105339,0.710784,0.244400,0.547612,0.076511,0.789183,0.187433,0.959420,0.139726,\n\t\t\t    0.907924,0.257080,0.361835,0.346746,0.657323,0.094112,0.393346,0.102806,0.073946,0.396999,0.405996,0.132355,\n\t\t\t    0.070765,0.271572,0.974213,0.230145,0.264060,0.184087,0.143091,0.357923,0.027912,0.866336,0.876887,0.930210,\n\t\t\t    0.817351,0.135470,0.628147,0.929163,0.918670,0.118457,0.146020,0.715702,0.153759,0.794347,0.146278,0.315050,\n\t\t\t    0.546813,0.436618,0.556406,0.061045,0.685076,0.815259,0.822593,0.316207,0.490200,0.882547,0.962072,0.223586,\n\t\t\t    0.917772,0.480598,0.895364,0.135023,0.168070,0.904818,0.842004,0.282408,0.761807,0.092388,0.262402,0.165391,\n\t\t\t    0.512298,0.231055,0.562587,0.940774,0.321869,0.019379,0.708708,0.916230,0.275951,0.956742,0.485689,0.837866,\n\t\t\t    0.458992,0.828295,0.337292,0.085700,0.591677,0.685234,0.477507,0.824034,0.795719,0.032043,0.908482,0.079898,\n\t\t\t    0.480753,0.207186,0.700534,0.326492,0.106097,0.626325,0.013621,0.188186,0.791533,0.051428,0.267988,0.190174,\n\t\t\t    0.829278,0.758832,0.353613,0.134750,0.949332,0.933656,0.872337,0.104167,0.529370,0.502977,0.085356,0.891747,\n\t\t\t    0.037919,0.257506,0.692111,0.200202,0.825567,0.216769,0.345247,0.485514,0.499317,0.115622,0.336149,0.114307,\n\t\t\t    0.547752,0.055741,0.558414,0.645798,0.377032,0.107814,0.068259,0.321146,0.342736,0.948080,0.901923,0.113447,\n\t\t\t    0.122951,0.501702,0.476338,0.401505,0.158118,0.580975,0.544199,0.811489,0.233382,0.739074,0.466795,0.158612,\n\t\t\t    0.549566,0.021405,0.931002,0.797911,0.754184,0.232433,0.947279,0.142782,0.329887,0.079686,0.185817,0.239533,\n\t\t\t    0.136142,0.792425,0.246983,0.328180,0.793486,0.040919,0.106237,0.405488,0.220232,0.488448,0.616704,0.038727,\n\t\t\t    0.461491,0.194345,0.258418,0.205331,0.792662,0.303774,0.726059,0.821191,0.246708,0.532203,0.585997,0.191693,\n\t\t\t    0.767013,0.225886,0.896843,0.809693,0.336839,0.390571,0.944627,0.224005,0.608245,0.253072,0.238163,0.589509,\n\t\t\t    0.454517,0.807319,0.176687,0.485377,0.410504,0.144674,0.596784,0.253911,0.585865,0.371640,0.815397,0.072404,\n\t\t\t    0.374259,0.634199,0.488430,0.216399,0.201965,0.774598,0.945883,0.147527,0.491640,0.206209,0.483091,0.779908,\n\t\t\t    0.636163,0.212140,0.600138,0.235741,0.456440,0.434782,0.544123,0.033157,0.226302,0.137696,0.650623,0.101496,\n\t\t\t    0.570783,0.120660,0.376257,0.397697,0.109767,0.135369,0.789718,0.139419,0.451302,0.226169,0.341243,0.105047,\n\t\t\t    0.781789,0.346865,0.195583,0.730763,0.539516,0.021698,0.871818,0.563864,0.146461,0.628927,0.233332,0.146004,\n\t\t\t    0.551521,0.216120,0.119329,0.711110,0.938626,0.161344,0.513554,0.132581,0.529885,0.251713,0.632477,0.140034,\n\t\t\t    0.920763,0.133153,0.712916,0.313209,0.406275,0.128306,0.903039,0.272431,0.061251,0.859525,0.254447,0.342424,\n\t\t\t    0.162115,0.710376,0.564042,0.328579,0.373752,0.089481,0.063338,0.318442,0.925229,0.171113,0.363953,0.033627,\n\t\t\t    0.618240,0.022772,0.396119,0.329005,0.752594,0.223165,0.780404,0.238623,0.167466,0.129825,0.241803,0.873304,\n\t\t\t    0.371432,0.110912,0.758963,0.816860,0.038380,0.236376,0.252169,0.970124,0.610563,0.037373,0.450045,0.220447,\n\t\t\t    0.766813,0.247512,0.653135,0.122419,0.930811,0.210189,0.419916,0.138597,0.227941,0.502370,0.530552,0.584179,\n\t\t\t    0.368953,0.042973,0.339266,0.127067,0.276688,0.065578,0.297773,0.883540,0.874569,0.095263,0.746309,0.752416,\n\t\t\t    0.403004,0.016926,0.222179,0.345473,0.389103,0.712050,0.012938,0.219962,0.049590,0.183652,0.140250,0.504817,\n\t\t\t    0.855331,0.816015,0.418518,0.705923,0.439577,0.221005,0.512717,0.145352,0.663185,0.101412,0.064936,0.259342,\n\t\t\t    0.919862,0.451601,0.316066,0.541432,0.415744,0.033097,0.467624,0.369193,0.555941,0.610539,0.743943,0.079409,\n\t\t\t    0.700910,0.778659,0.528690,0.520455,0.245565,0.502544,0.554451,0.031259,0.911691,0.116322,0.480743,0.863175,\n\t\t\t    0.145655,0.246578,0.409773,0.145746,0.089387,0.708893,0.336599,0.015310,0.541068,0.407945,0.787346,0.026615,\n\t\t\t    0.122089,0.399116,0.538855,0.503365,0.789991,0.305539,0.288071,0.569673,0.284441,0.080472,0.872337,0.020069,\n\t\t\t    0.283381,0.104970,0.532398,0.078940,0.430204,0.017686,0.219587,0.674584,0.690303,0.335137,0.969050,0.179905,\n\t\t\t    0.553660,0.407363,0.147499,0.198984,0.869545,0.099171,0.783521,0.216761,0.965003,0.141038,0.895084,0.268384,\n\t\t\t    0.328781,0.120064,0.083142,0.302480,0.121077,0.489085,0.794742,0.059215,0.239593,0.496063,0.375349,0.047576,\n\t\t\t    0.899829,0.115959,0.813976,0.762008,0.172223,0.742182,0.307707,0.087656,0.497084,0.160008,0.460405,0.553285,\n\t\t\t    0.439524,0.104997,0.888246,0.115932,0.875965,0.031667,0.109624,0.251703,0.327270,0.978193,0.788323,0.025303,\n\t\t\t    0.927043,0.169577,0.148540,0.174068,0.228545,0.509770,0.783577,0.221819,0.785739,0.233147,0.259680,0.405961,\n\t\t\t    0.495967,0.064633,0.236065,0.192181,0.899411,0.126677,0.215895,0.138427,0.451022,0.217934,0.461910,0.148423,\n\t\t\t    0.038526,0.342948,0.482009,0.170616,0.329945,0.641295,0.262843,0.199249,0.118809,0.685221,0.672511,0.233025,\n\t\t\t    0.767624,0.276035,0.539633,0.728715,0.464841,0.195322,0.903139,0.542109,0.481719,0.869381,0.298176,0.375588,\n\t\t\t    0.778281,0.263770,0.901504,0.064686,0.496556,0.876229,0.784690,0.874713,0.484522,0.122517,0.736547,0.093686,\n\t\t\t    0.894945,0.125449,0.290460,0.108340,0.816234,0.053382,0.924670,0.151714,0.867033,0.029866,0.542866,0.227705,\n\t\t\t    0.789718,0.034151,0.031524,0.369643,0.040168,0.879870,0.128971,0.332114,0.217463,0.133990,0.304445,0.909695,\n\t\t\t    0.598803,0.730622,0.412908,0.131066,0.690954,0.326494,0.212005,0.729231,0.700105,0.328953,0.408512,0.135960,\n\t\t\t    0.554895,0.747451,0.558779,0.057026,0.908901,0.136991,0.590458,0.437043,0.087703,0.328554,0.557050,0.479320,\n\t\t\t    0.946721,0.210189,0.871360,0.030453,0.260129,0.193170,0.390830,0.631353,0.865917,0.062955,0.886711,0.120258,\n\t\t\t    0.677125,0.310677,0.326443,0.082765,0.223362,0.178931,0.871778,0.038268,0.923554,0.121053,0.443575,0.635920,\n\t\t\t    0.242307,0.399502,0.548373,0.630617,0.882957,0.413374,0.786307,0.924838,0.795301,0.026671,0.316423,0.166522,\n\t\t\t    0.476250,0.649166,0.744506,0.301197,0.874430,0.087001,0.232637,0.465741,0.552271,0.591240,0.879454,0.079605,\n\t\t\t    0.589198,0.805076,0.310358,0.083280,0.673035,0.306682,0.315179,0.931776,0.542029,0.029095,0.265387,0.390812,\n\t\t\t    0.041642,0.358873,0.552145,0.711123,0.575669,0.362974,0.530165,0.086030,0.544658,0.556438,0.301677,0.018725,\n\t\t\t    0.165674,0.949705,0.541615,0.534009,0.866336,0.079046,0.496157,0.412915,0.547612,0.027839,0.543338,0.498130,\n\t\t\t    0.749324,0.228757,0.241133,0.205939,0.151927,0.375080,0.167946,0.630667,0.866196,0.039440,0.803960,0.294704,\n\t\t\t    0.687988,0.278837,0.253911,0.170373,0.131260,0.288361,0.477191,0.905557,0.050931,0.752091,0.555784,0.896151,\n\t\t\t    0.222864,0.610856,0.809273,0.233093,0.028769,0.364729,0.817947,0.197885,0.356460,0.404711,0.501271,0.071333,\n\t\t\t    0.109681,0.468418,0.857354,0.845127,0.520534,0.152331,0.317244,0.008957,0.337605,0.560588,0.519556,0.266089,\n\t\t\t    0.557243,0.196718,0.240524,0.375381,0.555064,0.415571,0.047457,0.189475,0.318900,0.169111,0.695646,0.328902,\n\t\t\t    0.508669,0.074906,0.770673,0.260219,0.414341,0.041577,0.787989,0.217954,0.957467,0.188976,0.178584,0.291581,\n\t\t\t    0.395488,0.110468,0.689170,0.746993,0.184083,0.486309,0.084052,0.620529,0.326803,0.121531,0.516625,0.261623,\n\t\t\t    0.224777,0.699731,0.126502,0.407168,0.450604,0.215701,0.440854,0.602851,0.879733,0.084768,0.355891,0.297272,\n\t\t\t    0.528199,0.449875,0.968631,0.172229,0.662980,0.873461,0.578459,0.062748,0.334017,0.025897,0.852136,0.792447,\n\t\t\t    0.094129,0.730693,0.950489,0.144597,0.329266,0.125224,0.736268,0.080372,0.552120,0.716828,0.194103,0.131229,\n\t\t\t    0.208671,0.244174,0.468191,0.223936,0.200188,0.487261,0.206179,0.238239,0.452179,0.779288,0.406423,0.284450,\n\t\t\t    0.558876,0.635997,0.094859,0.905737,0.203795,0.140133,0.265946,0.839982,0.023706,0.876499,0.809594,0.322536,\n\t\t\t    0.718515,0.222816,0.561565,0.392052,0.140993,0.331757,0.309529,0.012618,0.767429,0.213215,0.500077,0.916424,\n\t\t\t    0.367407,0.123760,0.980075,0.221353,0.548074,0.386231,0.324084,0.435754,0.966956,0.172508,0.514531,0.256040,\n\t\t\t    0.626295,0.908432,0.787381,0.216329,0.516346,0.242082,0.949665,0.805193,0.416807,0.017354,0.027230,0.367141,\n\t\t\t    0.910017,0.267686,0.176720,0.795711,0.512555,0.667081,0.408058,0.141195,0.851473,0.676565,0.335948,0.066100,\n\t\t\t    0.213029,0.721164,0.880588,0.477304,0.350136,0.017878,0.943810,0.806282,0.270990,0.198425,0.050547,0.320760,\n\t\t\t    0.468470,0.139825,0.312059,0.502626,0.837194,0.677847,0.448727,0.793728,0.223301,0.707747,0.539656,0.043319,\n\t\t\t    0.985378,0.173345,0.728507,0.235459,0.421687,0.581751,0.913925,0.117606,0.201916,0.170852,0.771564,0.301200,\n\t\t\t    0.855892,0.693456,0.163595,0.690895,0.496126,0.351844,0.060348,0.311719,0.731523,0.189534,0.739478,0.098682,\n\t\t\t    0.541331,0.021349,0.704823,0.333196,0.581391,0.171175,0.192026,0.308651,0.839666,0.246255,0.808343,0.195602,\n\t\t\t    0.028307,0.375249,0.222570,0.872692,0.300909,0.096021,0.469024,0.568662,0.110421,0.260294,0.127857,0.719516,\n\t\t\t    0.695252,0.338390,0.170657,0.163964,0.475801,0.493689,0.552079,0.096890,0.135447,0.254834,0.157843,0.213217,\n\t\t\t    0.519417,0.136098,0.336127,0.077437,0.031240,0.320062,0.281437,0.921260,0.454063,0.538830,0.443904,0.225192,\n\t\t\t    0.339305,0.053984,0.936851,0.803685,0.555676,0.424851,0.404361,0.010089,0.167861,0.328443,0.473914,0.190995,\n\t\t\t    0.919228,0.120132,0.692363,0.214562,0.551799,0.049642,0.512924,0.448732,0.524721,0.139671,0.969329,0.230564,\n\t\t\t    0.420197,0.113399,0.257494,0.164765,0.805907,0.154087,0.580728,0.758459,0.511042,0.251015,0.365842,0.611395,\n\t\t\t    0.524023,0.129915,0.701986,0.857154,0.126577,0.302486,0.123985,0.290451,0.337556,0.089688,0.690289,0.225661,\n\t\t\t    0.312188,0.127163,0.857264,0.104390,0.644294,0.274381,0.309785,0.129439,0.413140,0.596652,0.543006,0.037387,\n\t\t\t    0.653275,0.089827,0.423944,0.027196,0.483756,0.439767,0.292297,0.343577,0.943092,0.223726,0.609352,0.783265,\n\t\t\t    0.340431,0.115029,0.758545,0.321788,0.506017,0.261064,0.355041,0.088852,0.905970,0.076939,0.046007,0.860603,\n\t\t\t    0.511321,0.125825,0.601956,0.249997,0.142025,0.175535,0.495130,0.155821,0.202224,0.795925,0.385161,0.422562,\n\t\t\t    0.410012,0.451734,0.924112,0.115694,0.276071,0.119281,0.503365,0.169779,0.792509,0.059815,0.557802,0.054583,\n\t\t\t    0.938635,0.811162,0.497503,0.121512,0.277806,0.772953,0.958723,0.149481,0.481202,0.626705,0.411533,0.017571,\n\t\t\t    0.273907,0.133371,0.051752,0.384274,0.229140,0.714152,0.110644,0.340569,0.853636,0.067673,0.761249,0.128171,\n\t\t\t    0.490487,0.843824,0.247609,0.217061,0.042906,0.337275,0.094685,0.406721,0.783336,0.849113,0.692803,0.337957,\n\t\t\t    0.142323,0.434445,0.500992,0.216817,0.783741,0.208120,0.321414,0.163829,0.556127,0.050968,0.481873,0.734476,\n\t\t\t    0.794648,0.305994,0.946578,0.877728,0.878058,0.080470,0.903467,0.976387,0.892433,0.096631,0.893968,0.140480,\n\t\t\t    0.871499,0.021451,0.376468,0.089765,0.682308,0.301293,0.830395,0.215032,0.400054,0.032147,0.142963,0.381629,\n\t\t\t    0.335326,0.439598,0.518440,0.235103,0.741625,0.277115,0.153980,0.198023,0.055913,0.252387,0.591161,0.070034,\n\t\t\t    0.605573,0.930192,0.367242,0.658104,0.867731,0.021004,0.178926,0.314452,0.029944,0.372384,0.397861,0.597255,\n\t\t\t    0.602235,0.280747,0.679761,0.295104,0.084209,0.664901,0.145615,0.689891,0.694870,0.171873,0.231688,0.699731,\n\t\t\t    0.184707,0.795912,0.182305,0.255097,0.126476,0.474686,0.510359,0.728432,0.789021,0.163437,0.122459,0.150222,\n\t\t\t    0.758597,0.084531,0.829454,0.900873,0.454791,0.228961,0.407753,0.121028,0.761710,0.721633,0.101570,0.903051,\n\t\t\t    0.159738,0.490850,0.756228,0.285276,0.603210,0.897861,0.671371,0.302968,0.424975,0.356907,0.510753,0.917277,\n\t\t\t    0.404759,0.041256,0.893410,0.136181,0.731679,0.280993,0.816513,0.061392,0.288865,0.639009,0.798092,0.035756,\n\t\t\t    0.228504,0.151906,0.702306,0.329213,0.288790,0.615073,0.533777,0.464788,0.441065,0.035588,0.768717,0.291759,\n\t\t\t    0.493176,0.173966,0.410933,0.007282,0.363106,0.647557,0.739842,0.246269,0.292840,0.953002,0.600932,0.044100,\n\t\t\t    0.918759,0.897976,0.893168,0.978366,0.490663,0.134507,0.789219,0.245291,0.296257,0.056824,0.901783,0.251079,\n\t\t\t    0.224505,0.222713,0.962909,0.137535,0.109514,0.829974,0.545755,0.627578,0.349123,0.139390,0.502248,0.077907,\n\t\t\t    0.838808,0.237088,0.478808,0.292440,0.270330,0.119960,0.505459,0.134632,0.041931,0.345401,0.609028,0.057584,\n\t\t\t    0.279017,0.411336,0.493348,0.484429,0.901365,0.135330,0.898155,0.122198,0.570783,0.104720,0.229025,0.209791,\n\t\t\t    0.308999,0.011826,0.900527,0.231122,0.523325,0.238452,0.590603,0.172850,0.726496,0.241418,0.206485,0.518904,\n\t\t\t    0.283583,0.978509,0.903179,0.255126,0.065916,0.176319,0.249111,0.151860,0.590290,0.601547,0.785094,0.882659,\n\t\t\t    0.447798,0.575710,0.893723,0.488061,0.924670,0.120495,0.051569,0.343148,0.539390,0.535666,0.516957,0.866589,\n\t\t\t    0.668908,0.079317,0.547142,0.587824,0.961653,0.144178,0.959281,0.229169,0.960537,0.142085,0.822940,0.289723,\n\t\t\t    0.477281,0.900114,0.312778,0.016178,0.863265,0.147946,0.453395,0.139643,0.514811,0.085584,0.489686,0.174385,\n\t\t\t    0.928025,0.514772,0.178815,0.338496,0.483126,0.157914,0.602049,0.076762,0.538958,0.021642,0.756958,0.309497,\n\t\t\t    0.523186,0.085863,0.952498,0.816430,0.764598,0.094900,0.889642,0.120356,0.492338,0.139504,0.523465,0.113500,\n\t\t\t    0.514671,0.122112,0.651460,0.172989,0.034639,0.247823,0.439996,0.187785,0.680096,0.312964,0.333617,0.353827,\n\t\t\t    0.840703,0.689569,0.298176,0.353025,0.525140,0.133809,0.584214,0.590665,0.040263,0.350549,0.345034,0.330178,\n\t\t\t    0.036279,0.317142,0.828803,0.891606,0.788462,0.043724,0.951523,0.480108,0.823296,0.682717,0.264573,0.180100,\n\t\t\t    0.759492,0.921125,0.963886,0.172927,0.937449,0.848752,0.916297,0.069319,0.612796,0.116947,0.330880,0.076281,\n\t\t\t    0.231506,0.168548,0.467142,0.555240,0.126451,0.954039,0.454372,0.225611,0.548386,0.408780,0.031732,0.359174,\n\t\t\t    0.144763,0.413602,0.758423,0.205776,0.511381,0.927954,0.119194,0.462829,0.326868,0.020807,0.244985,0.140683,\n\t\t\t    0.133286,0.578992,0.235164,0.138737,0.072461,0.338476,0.881086,0.518321,0.933828,0.854944,0.921208,0.920689,\n\t\t\t    0.878909,0.807580,0.712856,0.753052,0.258020,0.172791,0.879733,0.144318,0.672633,0.269465,0.552079,0.057458,\n\t\t\t    0.190047,0.478807,0.191614,0.224379,0.274154,0.078640,0.146209,0.253112,0.339752,0.341568,0.782165,0.190078,\n\t\t\t    0.480760,0.814070,0.554506,0.454136,0.498021,0.719845,0.058366,0.378144,0.664302,0.086128,0.902550,0.955561,\n\t\t\t    0.099038,0.334018,0.560010,0.486119,0.625359,0.024838,0.870507,0.948753,0.063201,0.204454,0.145457,0.191323,\n\t\t\t    0.304350,0.091436,0.644294,0.245083,0.762225,0.101585,0.812233,0.245881,0.421232,0.014237,0.183699,0.127803,\n\t\t\t    0.784994,0.306558,0.857683,0.036579,0.698017,0.918113,0.464143,0.145631,0.335625,0.577654,0.121466,0.432114,\n\t\t\t    0.774294,0.302831,0.300000,0.125267,0.603576,0.605516,0.125089,0.386519,0.866196,0.061225,0.495967,0.116724,\n\t\t\t    0.288099,0.377706,0.140812,0.314351,0.761917,0.281183,0.161680,0.911250,0.040309,0.343023,0.312311,0.562425,\n\t\t\t    0.505599,0.114658,0.427912,0.109396,0.433296,0.182062,0.794094,0.206068,0.014316,0.232501,0.914343,0.271036,\n\t\t\t    0.389389,0.304543,0.935137,0.191628,0.534199,0.330241,0.512717,0.118636,0.602467,0.056788,0.462189,0.191553,\n\t\t\t    0.344142,0.013531,0.521340,0.399281,0.971701,0.182417,0.263944,0.180247,0.479191,0.831913,0.895782,0.183254,\n\t\t\t    0.604173,0.909708,0.380211,0.725752,0.337722,0.012075,0.897598,0.887422,0.691283,0.328910,0.929974,0.223307,\n\t\t\t    0.845541,0.177532,0.438879,0.223517,0.802302,0.246592,0.735622,0.310961,0.234565,0.520019,0.871639,0.087476,\n\t\t\t    0.619915,0.023093,0.270500,0.706944,0.537423,0.035963,0.544992,0.666500,0.076542,0.210514,0.755946,0.086220,\n\t\t\t    0.108217,0.425884,0.067351,0.346619,0.273718,0.200018,0.118873,0.417563,0.735059,0.280724,0.508948,0.083239,\n\t\t\t    0.748270,0.081712,0.233307,0.176719,0.565757,0.154285,0.396414,0.028914,0.933606,0.812813,0.078747,0.334320,\n\t\t\t    0.941138,0.495134,0.420828,0.312230,0.460374,0.227565,0.387422,0.062084,0.479207,0.636193,0.826073,0.857017,\n\t\t\t    0.440503,0.024193,0.027886,0.242717,0.363301,0.115486,0.463654,0.859044,0.023600,0.371421,0.886780,0.557660,\n\t\t\t    0.983006,0.183254,0.927705,0.544096,0.335836,0.085250,0.561109,0.419066,0.303593,0.110924,0.944348,0.181300,\n\t\t\t    0.277723,0.132219,0.210518,0.217624,0.822577,0.308320,0.554660,0.623636,0.572876,0.134925,0.265320,0.183691,\n\t\t\t    0.217479,0.699903,0.106612,0.910066,0.042653,0.252565,0.681370,0.254344,0.952534,0.946767,0.517602,0.231194,\n\t\t\t    0.071072,0.379189,0.890339,0.075250,0.071914,0.112698,0.462608,0.211653,0.125770,0.185292,0.221640,0.506599,\n\t\t\t    0.975330,0.184231,0.671767,0.225043,0.322779,0.983739,0.825027,0.153249,0.916140,0.514275,0.814059,0.324886,\n\t\t\t    0.764738,0.090476,0.623265,0.042062,0.519138,0.095773,0.437839,0.626127,0.250190,0.148397,0.442648,0.176758,\n\t\t\t    0.139071,0.603920,0.808052,0.291378,0.138508,0.487101,0.474193,0.161264,0.434374,0.754870,0.917414,0.118848,\n\t\t\t    0.916157,0.061741,0.531663,0.705996,0.679098,0.780558,0.416546,0.366924,0.904156,0.187441,0.645275,0.265410,\n\t\t\t    0.052760,0.389879,0.513834,0.189599,0.716733,0.233179,0.907784,0.071971,0.775171,0.301947,0.930532,0.214934,\n\t\t\t    0.433994,0.230496,0.577568,0.442389,0.492059,0.133069,0.171999,0.145626,0.777823,0.259733,0.815942,0.285093,\n\t\t\t    0.790166,0.266285,0.905412,0.074036,0.801083,0.196310,0.520254,0.078926,0.259426,0.343503,0.412802,0.145026,\n\t\t\t    0.554487,0.475750,0.098471,0.262439,0.512400,0.475338,0.738114,0.287146,0.919150,0.810606,0.156858,0.121054,\n\t\t\t    0.303230,0.034394,0.588783,0.398649,0.484534,0.925945,0.290361,0.104184,0.844844,0.077246,0.360240,0.719544,\n\t\t\t    0.386032,0.047371,0.120821,0.378356,0.094550,0.236780,0.108749,0.733981,0.493176,0.213468,0.787904,0.046362,\n\t\t\t    0.612378,0.151494,0.485220,0.218213,0.532677,0.247246,0.695274,0.339079,0.486062,0.844545,0.043519,0.210054,\n\t\t\t    0.854613,0.040780,0.953420,0.139907,0.191877,0.142842,0.126053,0.511402,0.388559,0.045314,0.913785,0.113699,\n\t\t\t    0.160457,0.227383,0.405896,0.011413,0.118610,0.496723,0.654391,0.169081,0.632059,0.102934,0.322785,0.079223,\n\t\t\t    0.943506,0.911637,0.489550,0.396637,0.699040,0.770746,0.617402,0.023749,0.193647,0.512009,0.458813,0.562545,\n\t\t\t    0.602328,0.063781,0.109244,0.162236,0.034526,0.852525,0.511129,0.922609,0.936812,0.143480,0.186858,0.947235,\n\t\t\t    0.881990,0.837055,0.764893,0.210643,0.612517,0.049363,0.561710,0.075897,0.243601,0.204528,0.032951,0.830803,\n\t\t\t    0.906668,0.072892,0.614624,0.362005,0.946302,0.212561,0.932077,0.746470,0.530512,0.332162,0.515927,0.253527,\n\t\t\t    0.523661,0.580563,0.844138,0.865793,0.739059,0.077595,0.578850,0.894771,0.376561,0.064643,0.179165,0.330609,\n\t\t\t    0.193234,0.839013,0.509627,0.905799,0.329447,0.389756,0.087730,0.334349,0.514531,0.072142,0.502667,0.154425,\n\t\t\t    0.476984,0.193787,0.135352,0.497781,0.565284,0.710216,0.187010,0.690223,0.549146,0.553473,0.917553,0.135497,\n\t\t\t    0.858290,0.856208,0.789300,0.051693,0.405618,0.134378,0.881128,0.230704,0.786137,0.200332,0.245286,0.392746,\n\t\t\t    0.955916,0.941350,0.498759,0.070788,0.488151,0.120409,0.499089,0.926581,0.467772,0.185412,0.776538,0.320890,\n\t\t\t    0.691908,0.728162,0.053507,0.134071,0.446695,0.132748,0.725383,0.239651,0.731019,0.258279,0.219628,0.796154,\n\t\t\t    0.618798,0.023331,0.610710,0.642674,0.902900,0.075962,0.979517,0.182138,0.207581,0.343020,0.232106,0.172443,\n\t\t\t    0.240964,0.445477,0.618798,0.165173,0.913506,0.115708,0.898992,0.189674,0.227350,0.164913,0.722963,0.297279,\n\t\t\t    0.905351,0.485325,0.683082,0.763512,0.947558,0.146411,0.532309,0.324073,0.735849,0.082968,0.378241,0.385204,\n\t\t\t    0.910398,0.909884,0.641210,0.219430,0.320431,0.057292,0.954815,0.133809,0.499736,0.075073,0.556012,0.594500,\n\t\t\t    0.806058,0.208993,0.543983,0.032236,0.779681,0.218030,0.910156,0.123021,0.528350,0.114728,0.493556,0.540384,\n\t\t\t    0.133051,0.148611,0.519138,0.192810,0.315186,0.909983,0.476929,0.546649,0.476221,0.775748,0.468890,0.576867,\n\t\t\t    0.803395,0.040166,0.243366,0.180614,0.336217,0.033886,0.492757,0.114086,0.859916,0.035616,0.446557,0.788852,\n\t\t\t    0.633920,0.285736,0.154071,0.163949,0.240261,0.166256,0.264167,0.636543,0.065534,0.355389,0.037560,0.334510,\n\t\t\t    0.827539,0.141150,0.258347,0.320589,0.139755,0.396325,0.899411,0.074064,0.722808,0.308285,0.338166,0.010894,\n\t\t\t    0.417322,0.136437,0.655648,0.731822,0.320592,0.035977,0.226196,0.688824,0.486197,0.147446,0.672723,0.302580,\n\t\t\t    0.618938,0.041965,0.880208,0.376633,0.128633,0.483933,0.829632,0.087476,0.883222,0.236426,0.320878,0.051580,\n\t\t\t    0.310924,0.583686,0.934665,0.827110,0.349947,0.380982,0.085862,0.396748,0.762777,0.868068,0.016513,0.181145,\n\t\t\t    0.620334,0.036577,0.612936,0.028663,0.321911,0.594678,0.514113,0.128868,0.863823,0.026405,0.800728,0.267253,\n\t\t\t    0.318978,0.150503,0.465953,0.726988,0.563943,0.053452,0.660833,0.832635,0.233080,0.218816,0.904853,0.202932,\n\t\t\t    0.844644,0.671377,0.794184,0.034095,0.884042,0.866056,0.870157,0.395043,0.914762,0.125268,0.573574,0.091502,\n\t\t\t    0.948616,0.524882,0.789858,0.032574,0.755883,0.706063,0.493315,0.119962,0.864661,0.025917,0.134001,0.131987,\n\t\t\t    0.597839,0.635762,0.333771,0.542082,0.901365,0.077204,0.785253,0.036523,0.778457,0.212681,0.485768,0.421049,\n\t\t\t    0.394282,0.094113,0.036950,0.331262,0.491151,0.921527,0.917832,0.116685,0.671002,0.089492,0.489547,0.148981,\n\t\t\t    0.780240,0.261300,0.468750,0.894803,0.601816,0.260480,0.742677,0.293960,0.323530,0.607906,0.265595,0.399987,\n\t\t\t    0.852798,0.039901,0.626475,0.042216,0.472834,0.627514,0.804775,0.276538,0.604680,0.916129,0.621450,0.156937,\n\t\t\t    0.155144,0.263142,0.503365,0.060934,0.393210,0.293886,0.926624,0.147527,0.076684,0.663084,0.409879,0.021967,\n\t\t\t    0.633360,0.265550,0.242887,0.796016,0.482765,0.822136,0.316118,0.122775,0.458703,0.794957,0.066571,0.321563,\n\t\t\t    0.387885,0.032051,0.504203,0.264414,0.510763,0.066796,0.786739,0.345497,0.497503,0.073161,0.517602,0.250596,\n\t\t\t    0.337381,0.048428,0.847914,0.050605,0.503784,0.133530,0.906249,0.142629,0.193613,0.884884,0.317353,0.131178,\n\t\t\t    0.874569,0.234053,0.769801,0.295646,0.923415,0.125463,0.300538,0.110617,0.827265,0.215936,0.423623,0.301989,\n\t\t\t    0.316311,0.069317,0.163372,0.475819,0.212728,0.159571,0.606794,0.038699,0.475980,0.558844,0.248331,0.155622,\n\t\t\t    0.890339,0.116071,0.808703,0.239757,0.601871,0.746256,0.786735,0.334906,0.553910,0.690295,0.128179,0.712875,\n\t\t\t    0.857683,0.032602,0.091978,0.222516,0.598559,0.048372,0.164465,0.360656,0.689235,0.788960,0.133283,0.167467,\n\t\t\t    0.339626,0.987296,0.701855,0.336411,0.348444,0.150688,0.163446,0.424343,0.173625,0.244722,0.136286,0.365438,\n\t\t\t    0.441828,0.065880,0.902900,0.138023,0.442229,0.185551,0.520597,0.304084,0.035190,0.221354,0.244621,0.488026,\n\t\t\t    0.606096,0.171593,0.805839,0.671731,0.639808,0.262466,0.670975,0.296215,0.500793,0.695381,0.960132,0.888792,\n\t\t\t    0.666116,0.166010,0.360264,0.034499,0.772167,0.266180,0.151452,0.105823,0.929591,0.918958,0.797459,0.264786,\n\t\t\t    0.958164,0.137451,0.409968,0.476802,0.520394,0.096541,0.345274,0.919751,0.167280,0.724506,0.542669,0.547070,\n\t\t\t    0.845681,0.062928,0.783782,0.192816,0.889203,0.920801,0.577343,0.086686,0.894168,0.590138,0.076040,0.391990,\n\t\t\t    0.467267,0.818174,0.598699,0.057556,0.215468,0.918190,0.850426,0.132469,0.317593,0.527241,0.559608,0.422944,\n\t\t\t    0.497084,0.075506,0.124476,0.110428,0.036040,0.360982,0.866201,0.744669,0.246642,0.520385,0.805768,0.051819,\n\t\t\t    0.804735,0.298302,0.784234,0.342811,0.189870,0.716716,0.938208,0.212840,0.396209,0.732465,0.824691,0.836659,\n\t\t\t    0.486197,0.124499,0.858102,0.048316,0.962026,0.900259,0.640228,0.224056,0.191065,0.673244,0.875267,0.155482,\n\t\t\t    0.464025,0.787147,0.677190,0.772099,0.907226,0.114745,0.886432,0.107823,0.800093,0.269071,0.224125,0.183724,\n\t\t\t    0.545518,0.036368,0.671699,0.195043,0.929695,0.157994,0.503365,0.200487,0.674814,0.319335,0.887827,0.102269,\n\t\t\t    0.390153,0.555818,0.541507,0.339716,0.490245,0.122224,0.931230,0.203211,0.940241,0.806124,0.669187,0.174804,\n\t\t\t    0.781856,0.336408,0.521691,0.347771,0.894526,0.091453,0.123536,0.498093,0.556932,0.427922,0.706604,0.329350,\n\t\t\t    0.077492,0.314899,0.549427,0.060529,0.502946,0.153587,0.690939,0.334077,0.213093,0.872285,0.207613,0.508639,\n\t\t\t    0.508111,0.140509,0.810792,0.076855,0.494432,0.066126,0.250165,0.951748,0.516765,0.158333,0.937531,0.905650,\n\t\t\t    0.443485,0.220307,0.502807,0.114309,0.474418,0.768984,0.421727,0.140804,0.172290,0.203994,0.441630,0.049300,\n\t\t\t    0.779859,0.226539,0.497782,0.224913,0.441870,0.078299,0.961793,0.218004,0.865139,0.588639,0.507413,0.120046,\n\t\t\t    0.506715,0.253806,0.501132,0.140481,0.440554,0.185133,0.094065,0.153552,0.511740,0.131743,0.390802,0.119134,\n\t\t\t    0.790488,0.197053,0.886850,0.091537,0.407612,0.389786,0.111878,0.498450,0.101574,0.486496,0.325565,0.012193,\n\t\t\t    0.220749,0.453125,0.922577,0.219539,0.064810,0.337882,0.622427,0.022535,0.432179,0.223238,0.751764,0.239959,\n\t\t\t    0.493315,0.122936,0.510405,0.585232,0.447393,0.172710,0.346650,0.021459,0.910715,0.157017,0.084055,0.247099,\n\t\t\t    0.601396,0.229451,0.361249,0.286730,0.758457,0.169159,0.280439,0.569834,0.498719,0.905250,0.271523,0.493038,\n\t\t\t    0.616000,0.820104,0.088386,0.784624,0.661231,0.114379,0.890898,0.132790,0.869875,0.420806,0.322152,0.125427,\n\t\t\t    0.916157,0.123063,0.029174,0.187195,0.164720,0.870325,0.288231,0.367891,0.494153,0.159171,0.486800,0.857030,\n\t\t\t    0.166000,0.954161,0.895364,0.165809,0.670353,0.302618,0.698690,0.219518,0.522022,0.911034,0.338875,0.060483,\n\t\t\t    0.512717,0.068150,0.860893,0.031011,0.893431,0.501783,0.783754,0.244937,0.781347,0.821815,0.923275,0.149062,\n\t\t\t    0.717143,0.209360,0.700895,0.324195,0.216688,0.233113,0.118119,0.211534,0.863265,0.030606,0.559750,0.402133,\n\t\t\t    0.840503,0.704041,0.944906,0.229727,0.304136,0.053405,0.423682,0.505332,0.445300,0.180247,0.749945,0.160785,\n\t\t\t    0.504122,0.927332,0.448929,0.226169,0.154474,0.524780,0.495828,0.124234,0.312418,0.972043,0.390388,0.075094,\n\t\t\t    0.206798,0.200454,0.555831,0.563417,0.870801,0.029196,0.598559,0.069169,0.567730,0.386598,0.021694,0.165372,\n\t\t\t    0.434838,0.442004,0.883545,0.427137,0.476566,0.158891,0.273708,0.474351,0.783468,0.307058,0.670304,0.078409,\n\t\t\t    0.558992,0.919531,0.607074,0.051721,0.499144,0.916173,0.533375,0.079512,0.759714,0.122505,0.623125,0.034051,\n\t\t\t    0.698269,0.338645,0.594445,0.341365,0.619357,0.040820,0.213387,0.885545,0.477922,0.314327,0.672431,0.824384,\n\t\t\t    0.103372,0.891419,0.870662,0.041087,0.446975,0.180666,0.307563,0.118983,0.150508,0.442701,0.444741,0.136265,\n\t\t\t    0.497224,0.126537,0.158397,0.741313,0.913479,0.964530,0.487879,0.412313,0.323796,0.082895,0.240314,0.509802,\n\t\t\t    0.741975,0.315567,0.506157,0.072798,0.504342,0.079805,0.417069,0.013668,0.407073,0.033125,0.179865,0.607309,\n\t\t\t    0.344615,0.065941,0.894387,0.145713,0.675890,0.215524,0.753154,0.090853,0.329139,0.038645,0.263373,0.155343,\n\t\t\t    0.222297,0.218016,0.747580,0.220125,0.920065,0.114173,0.492212,0.432179,0.925229,0.225121,0.338339,0.037882,\n\t\t\t    0.574333,0.344758,0.522316,0.393513,0.303302,0.130033,0.154050,0.691157,0.537562,0.155402,0.426236,0.291918,\n\t\t\t    0.124203,0.177788,0.547605,0.483924,0.275388,0.839532,0.487593,0.548911,0.498619,0.071360,0.772621,0.771871,\n\t\t\t    0.822463,0.809378,0.482288,0.214863,0.671979,0.185133,0.277974,0.739672,0.572332,0.630449,0.165226,0.145097,\n\t\t\t    0.334227,0.117869,0.110295,0.388807,0.801182,0.295716,0.464695,0.486486,0.490245,0.219470,0.301123,0.032303,\n\t\t\t    0.389409,0.538167,0.539237,0.024084,0.495967,0.139336,0.380051,0.063570,0.906516,0.876603,0.875207,0.940294,\n\t\t\t    0.098580,0.668032,0.769076,0.267888,0.452139,0.223099,0.568591,0.627824,0.811071,0.132525,0.188360,0.508186,\n\t\t\t    0.823212,0.163716,0.511740,0.070300,0.225052,0.908703,0.146990,0.883300,0.234575,0.509604,0.489267,0.136363,\n\t\t\t    0.845960,0.049795,0.437269,0.078202,0.560441,0.427949,0.549008,0.036228,0.936812,0.221912,0.789021,0.038058,\n\t\t\t    0.464003,0.191972,0.102784,0.895977,0.711394,0.301834,0.613634,0.066712,0.368989,0.057152,0.449068,0.132287,\n\t\t\t    0.466879,0.479288,0.887393,0.457079,0.259412,0.858265,0.494778,0.856471,0.403904,0.022186,0.910575,0.120760,\n\t\t\t    0.583205,0.087384,0.829911,0.669651,0.619775,0.039452,0.264488,0.383387,0.672120,0.296413,0.151393,0.430142,\n\t\t\t    0.041742,0.246944,0.694057,0.203846,0.276947,0.138140,0.919870,0.909256,0.469332,0.825986,0.785836,0.259910,\n\t\t\t    0.896759,0.084336,0.870383,0.035686,0.311038,0.462964,0.937996,0.781250,0.702711,0.787350,0.342495,0.964933,\n\t\t\t    0.979935,0.223447,0.165357,0.920563,0.504621,0.121316,0.985657,0.178230,0.255012,0.487379,0.951047,0.184510,\n\t\t\t    0.680778,0.754912,0.430819,0.103369,0.404905,0.010867,0.478776,0.781765,0.947139,0.229727,0.607994,0.377562,\n\t\t\t    0.161481,0.438669,0.915460,0.115164,0.441345,0.429708,0.144283,0.229990,0.437343,0.228682,0.311150,0.124061,\n\t\t\t    0.969029,0.507186,0.880921,0.529377,0.841171,0.826207,0.913467,0.954258,0.060568,0.402069,0.450324,0.229240,\n\t\t\t    0.370870,0.288899,0.008828,0.186422,0.233259,0.886354,0.265322,0.613757,0.315795,0.085672,0.565124,0.419569,\n\t\t\t    0.264290,0.202312,0.603317,0.620648,0.578079,0.643265,0.916855,0.143243,0.309023,0.067863,0.052553,0.332196,\n\t\t\t    0.483824,0.176758,0.077396,0.854071,0.462476,0.848695,0.502807,0.267625,0.919646,0.213538,0.961095,0.215492,\n\t\t\t    0.256588,0.840142,0.784917,0.264357,0.693315,0.336582,0.191794,0.348455,0.165004,0.855219,0.957606,0.230843,\n\t\t\t    0.627528,0.652942,0.524382,0.941287,0.464604,0.289106,0.526396,0.107735,0.858381,0.056075,0.913506,0.154924,\n\t\t\t    0.898155,0.236146,0.570001,0.839050,0.930333,0.485404,0.035153,0.324952,0.498061,0.125183,0.460818,0.590180,\n\t\t\t    0.100882,0.553324,0.517463,0.134939,0.945144,0.887551,0.929555,0.152412,0.638406,0.218168,0.128790,0.499704,\n\t\t\t    0.928488,0.506727,0.456649,0.790266,0.868010,0.041966,0.093101,0.368788,0.829617,0.929334,0.847495,0.047144,\n\t\t\t    0.449347,0.216259,0.935835,0.205723,0.798304,0.311075,0.810512,0.063877,0.936533,0.178788,0.869944,0.434659,\n\t\t\t    0.123962,0.850861,0.523355,0.402373,0.045248,0.218063,0.878846,0.585417,0.872197,0.026698,0.601676,0.263974,\n\t\t\t    0.334675,0.036604,0.216142,0.416695,0.156835,0.672481,0.345611,0.154176,0.908482,0.063514,0.782474,0.206144,\n\t\t\t    0.354802,0.038002,0.326086,0.016014,0.439298,0.226309,0.790699,0.201718,0.085640,0.350055,0.286717,0.720270,\n\t\t\t    0.616704,0.029430,0.489407,0.120172,0.658813,0.822044,0.912389,0.063988,0.276632,0.886708,0.918530,0.113517,\n\t\t\t    0.212721,0.169818,0.384505,0.766090,0.876790,0.602749,0.787904,0.042343,0.281079,0.591594,0.219503,0.480159,\n\t\t\t    0.670583,0.076874,0.413274,0.074840,0.218140,0.203382,0.136180,0.868674,0.543564,0.038685,0.903850,0.519675,\n\t\t\t    0.740969,0.321729,0.601536,0.269845,0.678744,0.325259,0.139748,0.686614,0.240320,0.969016,0.316925,0.125097,\n\t\t\t    0.617821,0.045175,0.258589,0.590770,0.494572,0.118525,0.574203,0.440973,0.759434,0.099296,0.532258,0.193228,\n\t\t\t    0.231291,0.161252,0.703415,0.923965,0.453395,0.222680,0.747293,0.078363,0.558360,0.034260,0.770199,0.254558,\n\t\t\t    0.750503,0.095375,0.905970,0.079688,0.608469,0.083490,0.165120,0.883489,0.682282,0.330215,0.819305,0.064072,\n\t\t\t    0.783668,0.858470,0.491257,0.911213,0.231848,0.364375,0.952163,0.230145,0.055438,0.170746,0.455908,0.186249,\n\t\t\t    0.942394,0.218283,0.758310,0.294530,0.493455,0.065037,0.840796,0.070157,0.700316,0.812421,0.159066,0.309010,\n\t\t\t    0.503644,0.120981,0.346700,0.078043,0.902900,0.134423,0.199888,0.512036,0.187593,0.437068,0.974382,0.956398,\n\t\t\t    0.369572,0.323505,0.165216,0.503049,0.128157,0.697522,0.789089,0.303860,0.795022,0.045274,0.503505,0.259669,\n\t\t\t    0.514775,0.704259,0.186686,0.741946,0.576366,0.115524,0.264614,0.532545,0.498480,0.061925,0.843122,0.681191,\n\t\t\t    0.740455,0.080777,0.486923,0.616414,0.971980,0.232099,0.347884,0.330733,0.476007,0.143398,0.364775,0.123511,\n\t\t\t    0.748645,0.292468,0.251780,0.402428,0.279588,0.363884,0.118380,0.725561,0.568964,0.587035,0.796952,0.262184,\n\t\t\t    0.823631,0.123984,0.191052,0.177511,0.242441,0.200363,0.705485,0.215081,0.329101,0.967704,0.421081,0.439494,\n\t\t\t    0.290887,0.070039,0.954955,0.213119,0.645040,0.172850,0.556825,0.031720,0.724036,0.247668,0.467493,0.227565,\n\t\t\t    0.717707,0.177532,0.533198,0.752924,0.603214,0.286757,0.464701,0.223936,0.509598,0.636286,0.908342,0.162739,\n\t\t\t    0.795022,0.054708,0.494432,0.065191,0.868150,0.144318,0.727195,0.844175,0.881600,0.484322,0.326419,0.083962,\n\t\t\t    0.776053,0.261928,0.612965,0.800995,0.022189,0.183826,0.720003,0.307514,0.548868,0.058547,0.676445,0.191972,\n\t\t\t    0.828802,0.701363,0.081100,0.277219,0.463166,0.149260,0.133998,0.373203,0.507553,0.065219,0.080155,0.224708,\n\t\t\t    0.510780,0.535008,0.333112,0.043874,0.186348,0.444081,0.578432,0.407577,0.893131,0.246892,0.642806,0.098216,\n\t\t\t    0.325279,0.377442,0.497616,0.436071,0.040238,0.334101,0.736466,0.270685,0.225418,0.462674,0.251298,0.968019,\n\t\t\t    0.068744,0.337596,0.686635,0.169639,0.374410,0.279281,0.629965,0.130571,0.200398,0.632458,0.161735,0.242232,\n\t\t\t    0.089067,0.700806,0.623265,0.046096,0.786482,0.213334,0.970895,0.930302,0.553360,0.435438,0.759434,0.181579,\n\t\t\t    0.253716,0.160418,0.122800,0.602329,0.078128,0.823911,0.790277,0.117369,0.147814,0.971576,0.334192,0.141860,\n\t\t\t    0.795859,0.062872,0.064082,0.366364,0.527652,0.092619,0.038673,0.365915,0.492897,0.119739,0.517323,0.260646,\n\t\t\t    0.923415,0.114927,0.657364,0.744135,0.751619,0.114466,0.323065,0.031198,0.816466,0.245460,0.085270,0.255247,\n\t\t\t    0.497569,0.466618,0.063943,0.096626,0.544123,0.133697,0.440472,0.065400,0.737524,0.080749,0.913685,0.975061,\n\t\t\t    0.621869,0.056188,0.834656,0.100720,0.152389,0.422938,0.967654,0.174462,0.110694,0.333693,0.110232,0.683293,\n\t\t\t    0.258184,0.330496,0.159505,0.154439,0.231931,0.193127,0.435966,0.647687,0.472685,0.789661,0.238362,0.479868,\n\t\t\t    0.623038,0.890447,0.537761,0.344567,0.361182,0.277888,0.484445,0.797327,0.403081,0.307804,0.311733,0.041561,\n\t\t\t    0.785555,0.308488,0.545493,0.644834,0.330208,0.985836,0.245205,0.495825,0.664441,0.092018,0.051596,0.324306,\n\t\t\t    0.542448,0.020051,0.868010,0.199861,0.753585,0.304416,0.463026,0.213468,0.725088,0.228417,0.198252,0.942576,\n\t\t\t    0.130543,0.209900,0.923466,0.794966,0.424420,0.033428,0.779518,0.259335,0.903039,0.263639,0.303717,0.088602,\n\t\t\t    0.567028,0.439309,0.141043,0.322587,0.966119,0.132832,0.909877,0.153668,0.939224,0.853903,0.027572,0.370767,\n\t\t\t    0.964299,0.909678,0.904133,0.462512,0.836076,0.297513,0.577949,0.889407,0.510205,0.247246,0.933184,0.183115,\n\t\t\t    0.898155,0.113894,0.490105,0.162381,0.461092,0.310277,0.601630,0.050116,0.618380,0.067480,0.787764,0.092290,\n\t\t\t    0.463305,0.194764,0.818151,0.707705,0.073208,0.695482,0.738222,0.085787,0.890898,0.137409,0.569666,0.166150,\n\t\t\t    0.234546,0.142688,0.784236,0.329471,0.780453,0.814025,0.534207,0.646971,0.806744,0.054121,0.556505,0.421691,\n\t\t\t    0.254063,0.216447,0.946023,0.143759,0.613478,0.614633,0.945325,0.227633,0.665847,0.913251,0.232912,0.136647,\n\t\t\t    0.604561,0.037387,0.239958,0.190786,0.308382,0.118295,0.671281,0.088808,0.429946,0.180666,0.695545,0.331490,\n\t\t\t    0.203212,0.740738,0.426177,0.179549,0.793155,0.261577,0.932502,0.845835,0.496107,0.069839,0.308688,0.054699,\n\t\t\t    0.197256,0.382610,0.638898,0.166289,0.904435,0.080847,0.579556,0.631387,0.317734,0.040265,0.877086,0.466223,\n\t\t\t    0.577622,0.130794,0.240195,0.507283,0.523186,0.227984,0.517044,0.199230,0.904305,0.507913,0.064777,0.360721,\n\t\t\t    0.792832,0.214591,0.060936,0.354523,0.697407,0.331466,0.816977,0.209865,0.804651,0.059662,0.112519,0.111165,\n\t\t\t    0.924670,0.118806,0.883082,0.243403,0.171016,0.154936,0.496956,0.876156,0.981750,0.174741,0.464421,0.863886,\n\t\t\t    0.049929,0.388135,0.412788,0.374703,0.489267,0.114030,0.405854,0.536377,0.344227,0.085349,0.352709,0.319579,\n\t\t\t    0.207140,0.501204,0.692310,0.805843,0.507692,0.147725,0.445718,0.134423,0.441893,0.056237,0.756643,0.178230,\n\t\t\t    0.093281,0.229376,0.432531,0.119070,0.438701,0.056026,0.069089,0.822562,0.896061,0.119630,0.566193,0.600706,\n\t\t\t    0.458001,0.149400,0.291129,0.941590,0.889921,0.091914,0.813304,0.062886,0.223141,0.150229,0.861451,0.076437,\n\t\t\t    0.327451,0.899548,0.730263,0.276466,0.835214,0.130878,0.185076,0.200715,0.493424,0.828078,0.457746,0.479179,\n\t\t\t    0.828655,0.061002,0.422391,0.122949,0.954257,0.193581,0.810610,0.252208,0.185388,0.774466,0.468665,0.560994,\n\t\t\t    0.465259,0.146329,0.598321,0.280887,0.866336,0.046934,0.495517,0.931993,0.122762,0.141770,0.409884,0.276676,\n\t\t\t    0.486615,0.150517,0.928578,0.168321,0.890339,0.126468,0.329721,0.120922,0.180192,0.147110,0.163023,0.581391,\n\t\t\t    0.484243,0.149958,0.965840,0.180742,0.550664,0.857420,0.919646,0.115694,0.922298,0.120467,0.662208,0.087901,\n\t\t\t    0.585283,0.411188,0.067757,0.220170,0.470362,0.763392,0.492757,0.136559,0.099767,0.515270,0.717031,0.907437,\n\t\t\t    0.784248,0.345481,0.744641,0.188557,0.950070,0.189115,0.316496,0.022824,0.909180,0.121067,0.453395,0.176060,\n\t\t\t    0.785441,0.899075,0.166776,0.344999,0.340610,0.110241,0.877361,0.093756,0.962491,0.229308,0.665418,0.129035,\n\t\t\t    0.405722,0.491822,0.972539,0.173625,0.148972,0.473478,0.485160,0.598302,0.978166,0.957001,0.277054,0.043326,\n\t\t\t    0.482847,0.223238,0.933044,0.220237,0.745199,0.107628,0.517882,0.125364,0.633219,0.255036,0.736192,0.294164,\n\t\t\t    0.496944,0.065400,0.432024,0.127039,0.454177,0.503379,0.741850,0.083456,0.044677,0.192344,0.924810,0.121165,\n\t\t\t    0.435694,0.035518,0.852519,0.177672,0.249614,0.950480,0.862986,0.045902,0.912110,0.175997,0.820979,0.181859,\n\t\t\t    0.331541,0.012436,0.881128,0.132260,0.896265,0.762953,0.464701,0.210955,0.919367,0.066514,0.904156,0.156738,\n\t\t\t    0.348602,0.898171,0.528787,0.704422,0.905970,0.132553,0.952969,0.928310,0.825354,0.846803,0.895782,0.139252,\n\t\t\t    0.572895,0.855181,0.403550,0.139918,0.746735,0.166088,0.494013,0.116543,0.831423,0.303238,0.494990,0.072826,\n\t\t\t    0.505743,0.658774,0.242591,0.635371,0.237985,0.202316,0.495967,0.143161,0.561710,0.091516,0.139264,0.373297,\n\t\t\t    0.269159,0.104979,0.875407,0.036063,0.834377,0.062844,0.346617,0.909543,0.399728,0.114661,0.527086,0.395913,\n\t\t\t    0.823404,0.218108,0.359681,0.393741,0.450291,0.751635,0.053551,0.380414,0.466795,0.214724,0.260989,0.158208,\n\t\t\t    0.159348,0.220272,0.429388,0.172152,0.236605,0.212218,0.722424,0.243859,0.051714,0.876241,0.143232,0.472010,\n\t\t\t    0.693492,0.328851,0.702789,0.321446,0.240798,0.738873,0.027881,0.367534,0.311964,0.886030,0.856846,0.042036,\n\t\t\t    0.499971,0.707456,0.915041,0.184231,0.888386,0.090253,0.675329,0.080657,0.472099,0.226728,0.769972,0.294580,\n\t\t\t    0.221209,0.519324,0.407405,0.142250,0.115447,0.292917,0.397635,0.652994,0.776791,0.260854,0.884478,0.078977,\n\t\t\t    0.692441,0.723783,0.515381,0.401665,0.309375,0.117326,0.797482,0.206917,0.915739,0.131018,0.547752,0.025732,\n\t\t\t    0.057240,0.387055,0.324582,0.006296,0.417808,0.322533,0.111560,0.966130,0.968073,0.136349,0.914545,0.985359,\n\t\t\t    0.639668,0.255316,0.540493,0.019967,0.621171,0.045594,0.326835,0.031326,0.262152,0.170466,0.183343,0.221818,\n\t\t\t    0.811908,0.044199,0.200810,0.439783,0.850007,0.051512,0.093615,0.764425,0.252549,0.532289,0.808838,0.051079,\n\t\t\t    0.337536,0.663028,0.640509,0.231065,0.601257,0.225677,0.695149,0.177456,0.323557,0.042659,0.801709,0.194544,\n\t\t\t    0.120222,0.935082,0.787911,0.318411,0.888553,0.809326,0.405688,0.619543,0.974609,0.964920,0.856056,0.826100,\n\t\t\t    0.246192,0.212956,0.967375,0.186743,0.143089,0.907126,0.979517,0.179905,0.202160,0.366728,0.546635,0.039341,\n\t\t\t    0.735566,0.286843,0.214284,0.501662,0.174086,0.131123,0.255857,0.353485,0.745618,0.088718,0.769370,0.297250,\n\t\t\t    0.949072,0.908923,0.949512,0.194837,0.492433,0.789362,0.791920,0.308232,0.437343,0.186808,0.141265,0.835405,\n\t\t\t    0.865777,0.192465,0.153726,0.482529,0.659837,0.750629,0.647552,0.168941,0.500898,0.545061,0.951745,0.151714,\n\t\t\t    0.143379,0.222678,0.472105,0.858295,0.626475,0.027351,0.749945,0.079074,0.810373,0.165670,0.879035,0.082815,\n\t\t\t    0.251143,0.510510,0.928003,0.569313,0.832445,0.291531,0.898155,0.205862,0.498592,0.329432,0.441729,0.041834,\n\t\t\t    0.933767,0.983335,0.206543,0.129927,0.952582,0.224284,0.254535,0.195310,0.908621,0.264477,0.040164,0.362565,\n\t\t\t    0.977702,0.231820,0.954675,0.176695,0.135099,0.248513,0.176108,0.711014,0.796557,0.040040,0.469726,0.223657,\n\t\t\t    0.283996,0.096703,0.645275,0.268213,0.525247,0.481779,0.440135,0.218632,0.385689,0.040944,0.300376,0.052191,\n\t\t\t    0.875657,0.896504,0.908203,0.121402,0.148300,0.155606,0.245159,0.708583,0.839689,0.257820,0.863823,0.172089,\n\t\t\t    0.503226,0.185551,0.256136,0.507275,0.052375,0.394847,0.923554,0.114117,0.923363,0.866079,0.563943,0.042928,\n\t\t\t    0.150136,0.382707,0.912250,0.120272,0.492216,0.836186,0.956607,0.867664,0.689102,0.267779,0.366877,0.043053,\n\t\t\t    0.666256,0.102934,0.411057,0.138628,0.672167,0.240486,0.601816,0.256846,0.479436,0.460748,0.835485,0.224011,\n\t\t\t    0.339271,0.099894,0.804791,0.035965,0.217684,0.299023,0.576784,0.080028,0.551381,0.157217,0.947837,0.150179,\n\t\t\t    0.624521,0.025201,0.342593,0.015855,0.986634,0.179626,0.465539,0.192391,0.476726,0.800216,0.795440,0.061169,\n\t\t\t    0.251297,0.590397,0.763224,0.875306,0.610005,0.038768,0.688851,0.325514,0.018659,0.225904,0.515161,0.846457,\n\t\t\t    0.239032,0.206727,0.597762,0.242869,0.808461,0.286950,0.177918,0.631581,0.181918,0.215890,0.318110,0.025301,\n\t\t\t    0.123614,0.482188,0.458001,0.142240,0.502248,0.141625,0.615309,0.030408,0.830952,0.296838,0.564696,0.625346,\n\t\t\t    0.408635,0.139122,0.701099,0.819403,0.549284,0.334493,0.570735,0.385791,0.275846,0.717975,0.505040,0.068541,\n\t\t\t    0.963188,0.130473,0.087241,0.322667,0.294099,0.026843,0.902717,0.780580,0.800185,0.041394,0.496247,0.071053,\n\t\t\t    0.200228,0.494519,0.255530,0.178629,0.704095,0.210595,0.871080,0.031820,0.881184,0.523824,0.192872,0.528851,\n\t\t\t    0.240749,0.674630,0.824072,0.236724,0.743664,0.104809,0.517044,0.239848,0.541889,0.033241,0.914579,0.866027,\n\t\t\t    0.977982,0.175160,0.891595,0.093491,0.565897,0.052252,0.546609,0.310382,0.859637,0.061965,0.789703,0.190463,\n\t\t\t    0.252222,0.795794,0.905970,0.163297,0.923833,0.122602,0.889921,0.261685,0.422781,0.568401,0.034207,0.374972,\n\t\t\t    0.822235,0.172927,0.553917,0.473854,0.801302,0.035784,0.804235,0.296094,0.531840,0.086924,0.782006,0.306271,\n\t\t\t    0.933463,0.165391,0.133659,0.300785,0.806744,0.171671,0.741990,0.096156,0.951466,0.155063,0.363513,0.445867,\n\t\t\t    0.901365,0.081042,0.539652,0.547409,0.506715,0.084942,0.255265,0.675382,0.563695,0.664391,0.397328,0.131430,\n\t\t\t    0.267413,0.150285,0.467912,0.229659,0.465120,0.180666,0.107671,0.399926,0.445160,0.174385,0.427154,0.178154,\n\t\t\t    0.496247,0.152889,0.742827,0.097273,0.142524,0.739597,0.913506,0.130097,0.562051,0.614036,0.620054,0.038029,\n\t\t\t    0.446217,0.417291,0.981331,0.172787,0.701757,0.754969,0.072542,0.781612,0.406324,0.143304,0.522627,0.094475,\n\t\t\t    0.267353,0.508851,0.247497,0.940942,0.675261,0.763821,0.633079,0.244242,0.424830,0.463459,0.162312,0.431909,\n\t\t\t    0.086777,0.199295,0.192805,0.701376,0.322328,0.502438,0.717874,0.885182,0.560581,0.447142,0.889781,0.233495,\n\t\t\t    0.262900,0.162282,0.461950,0.694995,0.284996,0.700995,0.304061,0.066414,0.705398,0.297810,0.588521,0.452126,\n\t\t\t    0.747293,0.097356,0.625638,0.039759,0.181346,0.139666,0.493595,0.131296,0.759730,0.824368,0.855729,0.125687,\n\t\t\t    0.530474,0.453621,0.506017,0.270416,0.831134,0.281550,0.535608,0.186249,0.114637,0.554833,0.765994,0.156319,\n\t\t\t    0.507672,0.490111,0.468051,0.174106,0.960258,0.230843,0.280836,0.137102,0.797394,0.042399,0.723335,0.800004,\n\t\t\t    0.786238,0.212149,0.617888,0.832825,0.677003,0.082876,0.568204,0.619247,0.382516,0.655250,0.235668,0.146296,\n\t\t\t    0.535343,0.345039,0.156321,0.854487,0.815099,0.251793,0.562827,0.051414,0.514671,0.236080,0.776871,0.263689,\n\t\t\t    0.303599,0.140531,0.943092,0.142224,0.527652,0.130850,0.700236,0.256073,0.657881,0.081578,0.774678,0.206811,\n\t\t\t    0.385689,0.075051,0.868708,0.040305,0.927601,0.204188,0.445998,0.137354,0.244375,0.589960,0.666535,0.089380,\n\t\t\t    0.572039,0.070062,0.128014,0.705964,0.417646,0.649315,0.439186,0.068341,0.261510,0.170559,0.917787,0.490009,\n\t\t\t    0.899411,0.087099,0.296093,0.102906,0.106759,0.302214,0.965003,0.219120,0.257553,0.186016,0.660393,0.089771,\n\t\t\t    0.062899,0.872256,0.556997,0.629236,0.859776,0.052726,0.350389,0.103315,0.075406,0.266800,0.345131,0.105473,\n\t\t\t    0.960537,0.229169,0.888246,0.259592,0.335935,0.017136,0.500434,0.063893,0.476286,0.166429,0.549985,0.111769,\n\t\t\t    0.530444,0.082778,0.908245,0.815839,0.901293,0.827293,0.031059,0.265471,0.185729,0.936665,0.311819,0.483206,\n\t\t\t    0.773701,0.259435,0.545100,0.020902,0.349164,0.030155,0.789135,0.309656,0.662906,0.078982,0.286727,0.773045,\n\t\t\t    0.889363,0.113587,0.402062,0.026827,0.274030,0.099937,0.771297,0.132232,0.483545,0.129594,0.034491,0.204339,\n\t\t\t    0.259918,0.486971,0.515788,0.153308,0.958433,0.507008,0.038725,0.345088,0.119500,0.848497,0.525279,0.112774,\n\t\t\t    0.485359,0.188064,0.203525,0.293277,0.095376,0.305046,0.284658,0.711355,0.561814,0.464500,0.429170,0.428112,\n\t\t\t    0.115501,0.486942,0.249451,0.176142,0.766448,0.254089,0.960754,0.480763,0.024718,0.852191,0.234247,0.774257,\n\t\t\t    0.796025,0.191838,0.475155,0.876146,0.524581,0.115845,0.799208,0.066807,0.869928,0.427712,0.336162,0.947342,\n\t\t\t    0.035732,0.371926,0.890190,0.817793,0.939321,0.781546,0.867731,0.129831,0.915756,0.538475,0.865219,0.069780,\n\t\t\t    0.710166,0.900969,0.550304,0.405901,0.072848,0.324306,0.476705,0.176060,0.668349,0.078339,0.740324,0.302215,\n\t\t\t    0.677422,0.091139,0.263214,0.708976,0.150947,0.906670,0.912389,0.265314,0.484661,0.179270,0.883105,0.972294,\n\t\t\t    0.388573,0.064980,0.854613,0.046488,0.218950,0.689041,0.914622,0.066472,0.919646,0.174043,0.508842,0.464902,\n\t\t\t    0.055489,0.353714,0.710087,0.204783,0.232943,0.688744,0.944348,0.144597,0.437264,0.326889,0.374273,0.348854,\n\t\t\t    0.724541,0.807521,0.704220,0.909865,0.708785,0.855494,0.609446,0.040067,0.777687,0.308608,0.878058,0.118960,\n\t\t\t    0.410591,0.133444,0.818665,0.784586,0.430225,0.176618,0.098508,0.188602,0.484103,0.192530,0.624940,0.042244,\n\t\t\t    0.901085,0.131827,0.706855,0.810949,0.244837,0.208666,0.320017,0.015123,0.922019,0.124221,0.292763,0.964052,\n\t\t\t    0.564781,0.087049,0.801720,0.074232,0.862605,0.698033,0.899411,0.240891,0.789021,0.044841,0.698657,0.200988,\n\t\t\t    0.535236,0.728769,0.412739,0.146355,0.305723,0.117762,0.542566,0.446580,0.906389,0.124417,0.886948,0.365217,\n\t\t\t    0.359198,0.297423,0.443764,0.179829,0.193000,0.856584,0.042210,0.330001,0.128327,0.957202,0.087890,0.683558,\n\t\t\t    0.100047,0.489937,0.780116,0.311044,0.310574,0.085194,0.789997,0.032113,0.551939,0.030910,0.248039,0.409018,\n\t\t\t    0.773017,0.296605,0.574276,0.693018,0.707625,0.226387,0.662579,0.757569,0.595907,0.120814,0.467086,0.471517,\n\t\t\t    0.662449,0.845133,0.430970,0.133864,0.258222,0.738471,0.433296,0.179829,0.597095,0.427653,0.918809,0.220795,\n\t\t\t    0.259725,0.208770,0.557325,0.409695,0.214406,0.512318,0.331704,0.010825,0.333636,0.484492,0.226833,0.727841,\n\t\t\t    0.273464,0.119141,0.828633,0.938123,0.152088,0.316339,0.509925,0.134339,0.836470,0.115611,0.886850,0.094649,\n\t\t\t    0.488290,0.126718,0.834890,0.291306,0.757430,0.243109,0.121031,0.405180,0.492855,0.843393,0.485080,0.225332,\n\t\t\t    0.688567,0.330913,0.518161,0.081969,0.819386,0.251096,0.073730,0.883500,0.080800,0.174812,0.551362,0.566139,\n\t\t\t    0.364322,0.044293,0.512019,0.259669,0.952144,0.907031,0.509646,0.277814,0.499850,0.509765,0.449169,0.586687,\n\t\t\t    0.162145,0.255452,0.537423,0.028300,0.672397,0.080684,0.500276,0.921573,0.870104,0.042664,0.188221,0.511838,\n\t\t\t    0.531698,0.546840,0.348315,0.065503,0.525029,0.715633,0.761170,0.928784,0.919926,0.154505,0.423406,0.137135,\n\t\t\t    0.352627,0.345106,0.034397,0.238628,0.039822,0.345186,0.976028,0.170833,0.260729,0.712605,0.770689,0.762955,\n\t\t\t    0.315938,0.126848,0.512019,0.243757,0.918251,0.122491,0.589207,0.123899,0.244523,0.285683,0.470957,0.833771,\n\t\t\t    0.879926,0.579422,0.706670,0.769391,0.726220,0.169717,0.971562,0.171671,0.556365,0.700928,0.690714,0.324271,\n\t\t\t    0.821257,0.798717,0.057503,0.319517,0.479218,0.211653,0.849449,0.056843,0.759714,0.085508,0.663743,0.092926,\n\t\t\t    0.916157,0.133697,0.039344,0.340635,0.796675,0.239676,0.525000,0.102180,0.876427,0.553372,0.397722,0.014943,\n\t\t\t    0.400578,0.399511,0.875407,0.089792,0.931648,0.195396,0.606096,0.054025,0.491920,0.120339,0.431481,0.172710,\n\t\t\t    0.804381,0.233989,0.533479,0.747089,0.098792,0.340354,0.345722,0.119311,0.618519,0.078339,0.801259,0.218852,\n\t\t\t    0.918251,0.068384,0.529475,0.367614,0.754410,0.186464,0.485638,0.199370,0.241607,0.774104,0.035149,0.356587,\n\t\t\t    0.602152,0.668740,0.597203,0.246643,0.166214,0.894939,0.868987,0.083387,0.979377,0.227215,0.452894,0.445148,\n\t\t\t    0.303555,0.120284,0.329108,0.081717,0.637425,0.223075,0.505609,0.576121,0.580195,0.924883,0.599718,0.873477,\n\t\t\t    0.794324,0.043431,0.788741,0.029224,0.031849,0.319472,0.793435,0.304806,0.325597,0.122179,0.881342,0.512996,\n\t\t\t    0.205847,0.927410,0.483879,0.797449,0.980633,0.223307,0.787485,0.024940,0.860907,0.762135,0.591580,0.064828,\n\t\t\t    0.652559,0.723759,0.648110,0.090385,0.262976,0.188392,0.961514,0.226238,0.938339,0.747503,0.562268,0.043821,\n\t\t\t    0.639808,0.271437,0.385542,0.315020,0.192595,0.229525,0.869943,0.835971,0.798996,0.301350,0.064588,0.250820,\n\t\t\t    0.283414,0.339160,0.167829,0.294990,0.984262,0.173904,0.160687,0.375835,0.586834,0.176618,0.781860,0.189152,\n\t\t\t    0.907505,0.117104,0.855590,0.196791,0.942888,0.766860,0.515090,0.148423,0.777976,0.238692,0.801162,0.043096,\n\t\t\t    0.811350,0.059187,0.059261,0.326824,0.555130,0.696070,0.161548,0.181057,0.486779,0.811295,0.689237,0.329146,\n\t\t\t    0.445206,0.720996,0.625482,0.902036,0.481697,0.402070,0.466935,0.139406,0.131326,0.670068,0.866336,0.093156,\n\t\t\t    0.291656,0.144448,0.538121,0.100938,0.927601,0.218283,0.378215,0.465771,0.896201,0.068328,0.026606,0.378437,\n\t\t\t    0.886292,0.159669,0.433351,0.096203,0.332058,0.007366,0.267311,0.356188,0.168780,0.795402,0.175636,0.492692,\n\t\t\t    0.787206,0.148365,0.669761,0.723884,0.150905,0.342379,0.571609,0.440267,0.482149,0.127793,0.153262,0.228695,\n\t\t\t    0.449627,0.130389,0.122706,0.249586,0.864156,0.601732,0.655787,0.104609,0.231283,0.455203,0.352255,0.070813,\n\t\t\t    0.488709,0.117241,0.615448,0.042300,0.826755,0.866250,0.822654,0.138400,0.549687,0.488080,0.498201,0.066377,\n\t\t\t    0.762565,0.263067,0.119655,0.316615,0.227484,0.496208,0.580751,0.463885,0.602375,0.242589,0.163716,0.114224,\n\t\t\t    0.781772,0.332239,0.437153,0.490270,0.308635,0.061295,0.823871,0.826622,0.976307,0.226936,0.874709,0.038882,\n\t\t\t    0.553808,0.610496,0.137367,0.714457,0.197421,0.120537,0.486476,0.176479,0.277898,0.105410,0.829730,0.287156,\n\t\t\t    0.491640,0.135693,0.748361,0.281111,0.281326,0.354788,0.624382,0.043626,0.500155,0.148842,0.869127,0.030327,\n\t\t\t    0.924252,0.167484,0.168195,0.246916,0.724204,0.259282,0.682131,0.232026,0.919228,0.115415,0.178574,0.112984,\n\t\t\t    0.930253,0.126077,0.251737,0.513586,0.179152,0.322594,0.721415,0.218171,0.686932,0.740266,0.179211,0.742295,\n\t\t\t    0.912250,0.191628,0.222740,0.337317,0.900745,0.921710,0.898294,0.256103,0.128743,0.372589,0.495549,0.114993,\n\t\t\t    0.124760,0.420357,0.251424,0.378371,0.725447,0.814430,0.569841,0.600641,0.174326,0.870822,0.551655,0.618708,\n\t\t\t    0.237380,0.708003,0.138374,0.357487,0.770750,0.314874,0.120264,0.324373,0.929276,0.129678,0.701900,0.840884,\n\t\t\t    0.017402,0.869169,0.565544,0.413285,0.494423,0.850008,0.872476,0.036063,0.146384,0.264082,0.188744,0.505105,\n\t\t\t    0.624102,0.029123,0.065385,0.329481,0.723987,0.269138,0.502667,0.073273,0.655787,0.087049,0.287889,0.399563,\n\t\t\t    0.584182,0.060906,0.964305,0.224144,0.027285,0.207713,0.194230,0.896572,0.685169,0.329249,0.492780,0.862828,\n\t\t\t    0.451162,0.135623,0.333729,0.082376,0.924785,0.876292,0.537841,0.217655,0.188728,0.608296,0.871918,0.140522,\n\t\t\t    0.915599,0.220935,0.573962,0.582206,0.976586,0.220097,0.829772,0.127222,0.235823,0.177000,0.502946,0.069965,\n\t\t\t    0.336899,0.675797,0.818886,0.059187,0.658579,0.092200,0.227961,0.411379,0.908901,0.065914,0.496386,0.127891,\n\t\t\t    0.525977,0.091446,0.846937,0.052349,0.596326,0.061297,0.886432,0.124054,0.321371,0.160856,0.153046,0.579805,\n\t\t\t    0.744781,0.087476,0.099649,0.390775,0.297215,0.098579,0.353922,0.369498,0.287600,0.058634,0.905590,0.477306,\n\t\t\t    0.685172,0.219230,0.914204,0.111940,0.140741,0.479882,0.477787,0.787955,0.496665,0.133613,0.571923,0.562822,\n\t\t\t    0.936112,0.875880,0.107613,0.234443,0.688847,0.332451,0.932207,0.156319,0.812606,0.053898,0.904016,0.152133,\n\t\t\t    0.722083,0.230820,0.856706,0.034151,0.490663,0.121009,0.756880,0.802622,0.080420,0.571717,0.893985,0.856077,\n\t\t\t    0.913366,0.127961,0.776400,0.209659,0.438644,0.116330,0.747991,0.105758,0.552916,0.044449,0.495130,0.067592,\n\t\t\t    0.929798,0.824203,0.395381,0.060191,0.677980,0.088236,0.156599,0.504244,0.323556,0.081589,0.846297,0.660934,\n\t\t\t    0.878896,0.244380,0.484812,0.911240,0.396651,0.119484,0.438308,0.088952,0.038109,0.345023,0.477222,0.894670,\n\t\t\t    0.909040,0.139921,0.735430,0.091230,0.910296,0.138735,0.418964,0.143845,0.540423,0.649263,0.555289,0.152192,\n\t\t\t    0.911420,0.588669,0.536959,0.540772,0.745897,0.150877,0.361994,0.033596,0.487872,0.115049,0.689290,0.210374,\n\t\t\t    0.694610,0.206691,0.672537,0.171035,0.425371,0.128473,0.661370,0.082932,0.691938,0.183597,0.182203,0.386898,\n\t\t\t    0.134388,0.123666,0.442869,0.042735,0.691206,0.207551,0.904574,0.136823,0.491920,0.157914,0.534771,0.080377,\n\t\t\t    0.304304,0.921456,0.249047,0.478832,0.136787,0.721023,0.063005,0.310950,0.116641,0.361507,0.618519,0.043333,\n\t\t\t    0.801255,0.705582,0.459676,0.153448,0.840020,0.288061,0.767668,0.092751,0.184142,0.561968,0.264087,0.155663,\n\t\t\t    0.147048,0.706992,0.689924,0.234089,0.694776,0.828064,0.499038,0.113612,0.939158,0.765505,0.886488,0.887088,\n\t\t\t    0.944767,0.156738,0.895503,0.260709,0.734132,0.244739,0.600331,0.738398,0.493176,0.115608,0.131184,0.416264,\n\t\t\t    0.547333,0.027644,0.234525,0.898215,0.706959,0.278881,0.192070,0.183767,0.721507,0.257885,0.088901,0.207993,\n\t\t\t    0.224432,0.897784,0.552777,0.032180,0.918251,0.118611,0.301271,0.867314,0.893270,0.132106,0.233715,0.496225,\n\t\t\t    0.121918,0.510511,0.871369,0.856060,0.950349,0.136488,0.949426,0.506534,0.595907,0.076483,0.801787,0.263588,\n\t\t\t    0.970864,0.179486,0.986634,0.177811,0.748116,0.286345,0.637284,0.233588,0.264735,0.426670,0.546635,0.023317,\n\t\t\t    0.061999,0.350408,0.686459,0.830093,0.334212,0.115576,0.842890,0.061044,0.479969,0.845569,0.873034,0.030550,\n\t\t\t    0.916157,0.113531,0.208220,0.962940,0.149516,0.853781,0.937231,0.162600,0.752456,0.089862,0.878084,0.591359,\n\t\t\t    0.231157,0.153002,0.497224,0.214305,0.221822,0.509140,0.793355,0.210489,0.597987,0.865171,0.549985,0.062469,\n\t\t\t    0.060527,0.275468,0.321325,0.158444,0.025179,0.151640,0.451720,0.215422,0.927462,0.188139,0.816501,0.331131,\n\t\t\t    0.233532,0.157985,0.331111,0.016155,0.557502,0.444387,0.794463,0.067575,0.484820,0.905745,0.495459,0.862813,\n\t\t\t    0.257089,0.201976,0.507059,0.367655,0.527792,0.246967,0.607798,0.647687,0.723076,0.303712,0.828540,0.659835,\n\t\t\t    0.549706,0.038001,0.223440,0.436647,0.490013,0.777462,0.329429,0.652408,0.602934,0.383564,0.390175,0.040978,\n\t\t\t    0.298623,0.108393,0.894387,0.235169,0.335285,0.072004,0.786331,0.228118,0.580777,0.911563,0.554327,0.565813,\n\t\t\t    0.316432,0.157475,0.536820,0.708520,0.807112,0.281770,0.701928,0.848871,0.906389,0.177532,0.275272,0.126358,\n\t\t\t    0.499457,0.268044,0.781321,0.232581,0.901923,0.115694,0.558841,0.615827,0.577203,0.184574,0.887277,0.734168,\n\t\t\t    0.068773,0.308197,0.506576,0.129454,0.444602,0.177037,0.206566,0.487554,0.204678,0.721860,0.412801,0.145669,\n\t\t\t    0.131334,0.491827,0.902760,0.130948,0.064391,0.314463,0.260894,0.212243,0.560068,0.378972,0.922086,0.856078,\n\t\t\t    0.756094,0.251628,0.316902,0.008020,0.187843,0.518025,0.576542,0.407741,0.945048,0.930281,0.486706,0.404350,\n\t\t\t    0.304226,0.932899,0.242769,0.272548,0.425761,0.124210,0.534771,0.118874,0.543332,0.495027,0.545798,0.037680,\n\t\t\t    0.939603,0.193581,0.578180,0.100631,0.416399,0.026798,0.937181,0.915768,0.230849,0.187462,0.607966,0.269984,\n\t\t\t    0.569982,0.419678,0.267734,0.726816,0.310627,0.028578,0.727070,0.247894,0.778921,0.250728,0.505459,0.078577,\n\t\t\t    0.405828,0.139421,0.624953,0.414915,0.095904,0.500660,0.893232,0.845762,0.190265,0.156913,0.307303,0.085405,\n\t\t\t    0.750642,0.087992,0.809675,0.053089,0.058910,0.338988,0.542048,0.494742,0.109298,0.600797,0.119145,0.384944,\n\t\t\t    0.889336,0.933051,0.502667,0.116543,0.796138,0.029531,0.575205,0.674513,0.560525,0.619780,0.973516,0.226377,\n\t\t\t    0.864521,0.183115,0.809954,0.073143,0.339347,0.008059,0.159250,0.292135,0.907086,0.149481,0.774350,0.192718,\n\t\t\t    0.138392,0.470407,0.891813,0.474456,0.030177,0.812423,0.624292,0.879240,0.127567,0.435094,0.882943,0.251777,\n\t\t\t    0.210279,0.585962,0.207547,0.508976,0.149302,0.952909,0.918949,0.137549,0.494153,0.118371,0.481981,0.555384,\n\t\t\t    0.864382,0.135693,0.966817,0.137437,0.681330,0.189460,0.798023,0.252318,0.421953,0.011430,0.666535,0.095941,\n\t\t\t    0.176819,0.354687,0.875110,0.460873,0.527222,0.716340,0.267553,0.509722,0.604192,0.235182,0.172660,0.231673,\n\t\t\t    0.778140,0.261190,0.426324,0.018229,0.276195,0.201928,0.458868,0.571811,0.907505,0.075851,0.123446,0.393030,\n\t\t\t    0.913408,0.855909,0.311888,0.014721,0.335937,0.149547,0.270586,0.192035,0.831657,0.311836,0.522906,0.167406,\n\t\t\t    0.820232,0.793623,0.065593,0.318031,0.098832,0.327342,0.672928,0.808742,0.063665,0.684249,0.344201,0.929535,\n\t\t\t    0.918390,0.120509,0.660254,0.145911,0.231134,0.140486,0.041217,0.347810,0.135402,0.322278,0.891037,0.098068,\n\t\t\t    0.967343,0.931355,0.465150,0.931652,0.819025,0.094733,0.720917,0.183673,0.180104,0.209371,0.721394,0.313864,\n\t\t\t    0.788881,0.024577,0.063955,0.342198,0.828105,0.882871,0.524861,0.086994,0.473396,0.769424,0.756387,0.327547,\n\t\t\t    0.900543,0.435544,0.321552,0.036219,0.248038,0.319893,0.270128,0.677416,0.348502,0.115308,0.862707,0.080777,\n\t\t\t    0.506017,0.156100,0.187411,0.246171,0.742129,0.102436,0.881465,0.573250,0.495577,0.888532,0.130794,0.364976,\n\t\t\t    0.781808,0.339815,0.495828,0.120953,0.244232,0.317944,0.247211,0.689203,0.366763,0.750528,0.291608,0.127335,\n\t\t\t    0.391678,0.022517,0.914622,0.146132,0.698709,0.203306,0.555728,0.617286,0.285832,0.130559,0.374895,0.769215,\n\t\t\t    0.414968,0.144800,0.243597,0.224570,0.546496,0.093065,0.621394,0.664943,0.149920,0.350317,0.929987,0.497462,\n\t\t\t    0.373306,0.106997,0.304765,0.073186,0.474816,0.589869,0.271362,0.064456,0.526815,0.248642,0.478660,0.806521,\n\t\t\t    0.369604,0.116762,0.474612,0.212770,0.024005,0.376150,0.161813,0.129405,0.847774,0.069557,0.801196,0.328951,\n\t\t\t    0.896759,0.270896,0.134278,0.438088,0.370018,0.065852,0.885739,0.451946,0.321815,0.951647,0.508043,0.631473,\n\t\t\t    0.607353,0.037414,0.331804,0.618729,0.554990,0.427949,0.734085,0.276486,0.370915,0.041773,0.290254,0.389580,\n\t\t\t    0.249589,0.635736,0.914080,0.772486,0.237290,0.181393,0.040550,0.340575,0.094011,0.872641,0.665139,0.091125,\n\t\t\t    0.046926,0.360669,0.234385,0.390200,0.354852,0.625051,0.292941,0.366027,0.670722,0.102347,0.857683,0.143187,\n\t\t\t    0.790248,0.195123,0.061845,0.315023,0.496369,0.869404,0.962211,0.187022,0.142690,0.130402,0.710129,0.308213,\n\t\t\t    0.850735,0.722852,0.151898,0.190496,0.945683,0.459888,0.503631,0.916978,0.161536,0.717667,0.504063,0.074250,\n\t\t\t    0.141499,0.166239,0.961653,0.135707,0.205011,0.134976,0.743936,0.247603,0.170704,0.476741,0.959002,0.230843,\n\t\t\t    0.431473,0.745089,0.548589,0.051107,0.065635,0.376874,0.326101,0.032971,0.497281,0.882677,0.397179,0.088885,\n\t\t\t    0.430106,0.463715,0.959420,0.222749,0.781768,0.345456,0.414357,0.093596,0.442684,0.710484,0.571712,0.654826,\n\t\t\t    0.777577,0.115918,0.653283,0.784241,0.549846,0.027574,0.799069,0.214981,0.761249,0.146550,0.186799,0.207086,\n\t\t\t    0.202819,0.145877,0.335294,0.019040,0.801426,0.273521,0.104009,0.714090,0.489185,0.666510,0.322851,0.022120,\n\t\t\t    0.861311,0.216190,0.780154,0.201118,0.022198,0.374124,0.551498,0.863734,0.823212,0.062314,0.467912,0.211793,\n\t\t\t    0.721780,0.308488,0.873453,0.177393,0.362361,0.053406,0.497094,0.601968,0.049684,0.160289,0.798650,0.031597,\n\t\t\t    0.695784,0.326410,0.461351,0.154983,0.173797,0.961415,0.569945,0.060948,0.279157,0.054408,0.459956,0.221005,\n\t\t\t    0.788069,0.308192,0.167849,0.311416,0.682701,0.736927,0.855869,0.035463,0.488717,0.520408,0.924949,0.115136,\n\t\t\t    0.597722,0.050368,0.775742,0.237526,0.370285,0.125032,0.431624,0.062588,0.429946,0.178852,0.173618,0.369502,\n\t\t\t    0.235345,0.909233,0.605398,0.056104,0.528769,0.244873,0.669187,0.104720,0.482568,0.125992,0.456466,0.144794,\n\t\t\t    0.517794,0.498243,0.042813,0.371521,0.865079,0.025833,0.060552,0.165523,0.099410,0.269248,0.889437,0.611164,\n\t\t\t    0.410255,0.130940,0.183634,0.710508,0.802254,0.193023,0.070160,0.351970,0.498899,0.072072,0.891316,0.077288,\n\t\t\t    0.639247,0.279288,0.711109,0.204297,0.248701,0.340690,0.835747,0.282033,0.225126,0.949311,0.794184,0.149481,\n\t\t\t    0.237584,0.382739,0.796333,0.307959,0.589446,0.345969,0.038475,0.381464,0.503584,0.596968,0.936254,0.158971,\n\t\t\t    0.348499,0.087654,0.234803,0.181307,0.831446,0.188418,0.332151,0.006296,0.103805,0.929833,0.677040,0.216657,\n\t\t\t    0.417655,0.006473,0.807066,0.220703,0.540354,0.090832,0.713940,0.295494,0.405541,0.137848,0.617123,0.037345,\n\t\t\t    0.352315,0.125006,0.797509,0.234006,0.110548,0.956009,0.132874,0.223926,0.828040,0.258069,0.123711,0.125793,\n\t\t\t    0.514113,0.238313,0.918670,0.134646,0.484576,0.888751,0.742460,0.234963,0.488162,0.828881,0.514252,0.273627,\n\t\t\t    0.907226,0.126217,0.823768,0.249794,0.168526,0.122950,0.775207,0.220904,0.516346,0.143398,0.206816,0.399514,\n\t\t\t    0.496240,0.916282,0.678399,0.166289,0.220892,0.394865,0.910854,0.072655,0.510883,0.457891,0.737803,0.086513,\n\t\t\t    0.954815,0.149481,0.240602,0.513471,0.494262,0.616170,0.326928,0.025188,0.672940,0.246889,0.387269,0.665967,\n\t\t\t    0.750694,0.313347,0.545259,0.493750,0.909738,0.065677,0.544681,0.019423,0.124559,0.269503,0.315754,0.062859,\n\t\t\t    0.908626,0.755191,0.433296,0.170058,0.958913,0.965953,0.969329,0.220376,0.482986,0.149260,0.155444,0.359376,\n\t\t\t    0.270019,0.192407,0.441252,0.171593,0.595488,0.135386,0.980633,0.224842,0.261835,0.510132,0.862723,0.625835,\n\t\t\t    0.171352,0.171693,0.833319,0.296737,0.676643,0.243307,0.496649,0.810173,0.853915,0.137912,0.508251,0.136740,\n\t\t\t    0.561196,0.600494,0.914483,0.129357,0.501411,0.071835,0.321459,0.150490,0.500992,0.118148,0.801518,0.310554,\n\t\t\t    0.767246,0.298899,0.270315,0.795219,0.220937,0.839705,0.370731,0.728367,0.790859,0.306865,0.137149,0.380904,\n\t\t\t    0.481363,0.688055,0.696210,0.909892,0.444602,0.188622,0.332556,0.663712,0.289091,0.968201,0.190829,0.562646,\n\t\t\t    0.274899,0.199206,0.813166,0.329482,0.958259,0.935453,0.048653,0.246512,0.671600,0.799898,0.030125,0.883881,\n\t\t\t    0.213857,0.495422,0.554108,0.431286,0.563153,0.424675,0.922717,0.162460,0.096751,0.180932,0.243902,0.214702,\n\t\t\t    0.808655,0.226270,0.611680,0.062204,0.257960,0.146520,0.973237,0.221074,0.869115,0.826310,0.034231,0.352320,\n\t\t\t    0.948256,0.140298,0.475619,0.472702,0.493734,0.118329,0.317533,0.449505,0.481973,0.700695,0.692431,0.338489,\n\t\t\t    0.323455,0.025937,0.161220,0.234801,0.352239,0.307745,0.173748,0.724515,0.547868,0.485635,0.780420,0.262519,\n\t\t\t    0.568331,0.587982,0.912529,0.068077,0.578863,0.418941,0.099945,0.275834,0.401210,0.388969,0.889223,0.073004,\n\t\t\t    0.959839,0.178928,0.267316,0.186797,0.617682,0.036061,0.602467,0.165591,0.283381,0.040091,0.060723,0.196069,\n\t\t\t    0.572553,0.600121,0.181802,0.185453,0.120228,0.225347,0.132691,0.294397,0.208227,0.564467,0.321030,0.069803,\n\t\t\t    0.794324,0.078432,0.791812,0.058238,0.193330,0.333308,0.664581,0.081620,0.485778,0.169500,0.012745,0.226466,\n\t\t\t    0.922577,0.122309,0.567852,0.051205,0.694263,0.821003,0.790974,0.098933,0.280983,0.142127,0.178498,0.298516,\n\t\t\t    0.531754,0.382262,0.381437,0.433020,0.904295,0.150039,0.452681,0.405648,0.231862,0.176666,0.616146,0.033436,\n\t\t\t    0.094415,0.144242,0.019786,0.220466,0.258814,0.189765,0.248335,0.283654,0.954368,0.857623,0.794045,0.165251,\n\t\t\t    0.461791,0.781526,0.230824,0.214254,0.346886,0.639104,0.612657,0.041295,0.063234,0.371189,0.265676,0.194434,\n\t\t\t    0.814004,0.269368,0.453954,0.173966,0.685449,0.209601,0.422393,0.414914,0.346434,0.392171,0.827377,0.874280,\n\t\t\t    0.623544,0.051596,0.335223,0.938650,0.770014,0.270510,0.203724,0.729959,0.901504,0.125910,0.784239,0.332260,\n\t\t\t    0.086322,0.317290,0.475581,0.782861,0.934300,0.208235,0.191075,0.412039,0.904270,0.986326,0.618240,0.034860,\n\t\t\t    0.402945,0.140421,0.498899,0.117520,0.771164,0.242743,0.261539,0.177391,0.910296,0.151854,0.533055,0.656668,\n\t\t\t    0.524861,0.211374,0.785671,0.032267,0.823349,0.229576,0.046887,0.333088,0.331379,0.119154,0.203827,0.231613,\n\t\t\t    0.619077,0.063111,0.471891,0.840944,0.904853,0.117578,0.219371,0.129171,0.296813,0.121804,0.612517,0.033283,\n\t\t\t    0.637144,0.227000,0.671699,0.094782,0.083576,0.359874,0.695289,0.337749,0.443904,0.186110,0.240638,0.276403,\n\t\t\t    0.329191,0.144851,0.486895,0.213049,0.428718,0.281907,0.098342,0.395912,0.680627,0.282589,0.909877,0.112638,\n\t\t\t    0.678910,0.227078,0.165304,0.219474,0.541052,0.020651,0.531142,0.081019,0.540124,0.388307,0.511461,0.143677,\n\t\t\t    0.784860,0.314712,0.450045,0.189460,0.504901,0.144375,0.038532,0.337700,0.691599,0.732803,0.249085,0.220662,\n\t\t\t    0.180584,0.394548,0.917553,0.206700,0.071094,0.347684,0.229654,0.182182,0.221852,0.509520,0.474641,0.576050,\n\t\t\t    0.633500,0.268494,0.295818,0.071563,0.085979,0.763111,0.609865,0.055323,0.869964,0.227773,0.364713,0.109747,\n\t\t\t    0.887827,0.250800,0.188705,0.429582,0.466656,0.223936,0.092399,0.513133,0.481360,0.798359,0.698658,0.924983,\n\t\t\t    0.274342,0.199542,0.677910,0.724926,0.755917,0.262790,0.159531,0.163579,0.847206,0.932457,0.221429,0.955158,\n\t\t\t    0.404965,0.095672,0.474990,0.760773,0.502567,0.411729,0.400022,0.015777,0.602328,0.156379,0.431762,0.115203,\n\t\t\t    0.512996,0.113639,0.700249,0.334205,0.150231,0.495887,0.500434,0.128393,0.609167,0.047716,0.502287,0.625794,\n\t\t\t    0.262380,0.174683,0.696772,0.286321,0.466795,0.143677,0.348053,0.019834,0.185477,0.925750,0.530583,0.124848,\n\t\t\t    0.067632,0.266690,0.256030,0.431860,0.892433,0.175299,0.770905,0.271747,0.493740,0.447457,0.344635,0.504391,\n\t\t\t    0.276712,0.201472,0.267690,0.376282,0.603863,0.038392,0.673802,0.319429,0.091048,0.574354,0.580934,0.419639,\n\t\t\t    0.580573,0.594353,0.755527,0.094202,0.794897,0.268379,0.438730,0.111713,0.823352,0.185347,0.432185,0.040266,\n\t\t\t    0.797107,0.300880,0.060847,0.389316,0.066680,0.372384,0.768296,0.756155,0.081779,0.406616,0.900348,0.791086,\n\t\t\t    0.111260,0.961152,0.132620,0.402019,0.135614,0.432015,0.598280,0.167825,0.734795,0.258950,0.219552,0.238788,\n\t\t\t    0.535099,0.320770,0.533138,0.391823,0.122751,0.877911,0.165093,0.505806,0.134673,0.556740,0.065058,0.310027,\n\t\t\t    0.179251,0.401840,0.716413,0.837477,0.618938,0.129245,0.956908,0.186324,0.938905,0.191069,0.334692,0.021633,\n\t\t\t    0.477156,0.775391,0.069541,0.723223,0.230485,0.161019,0.318298,0.125932,0.325462,0.641349,0.578878,0.176060,\n\t\t\t    0.192701,0.317160,0.094484,0.164144,0.052497,0.336200,0.521371,0.090609,0.307453,0.126979,0.067184,0.325118,\n\t\t\t    0.345519,0.043765,0.220684,0.353253,0.133774,0.503832,0.265337,0.149130,0.862288,0.039747,0.962770,0.220516,\n\t\t\t    0.180451,0.178568,0.029424,0.365121,0.596745,0.148144,0.250959,0.507559,0.480781,0.484107,0.157224,0.604915,\n\t\t\t    0.806021,0.273914,0.748409,0.092109,0.677161,0.318663,0.583624,0.077823,0.789512,0.260541,0.320573,0.129457,\n\t\t\t    0.951326,0.194419,0.460793,0.188064,0.904714,0.228610,0.048230,0.356581,0.782499,0.839418,0.623684,0.040067,\n\t\t\t    0.274340,0.203869,0.495968,0.869480,0.556685,0.187924,0.673544,0.226829,0.818542,0.321072,0.516625,0.122684,\n\t\t\t    0.886850,0.104334,0.177185,0.915058,0.354410,0.660293,0.477822,0.160008,0.796278,0.026866,0.731914,0.910144,\n\t\t\t    0.319822,0.027320,0.314094,0.081599,0.896201,0.116546,0.965003,0.221214,0.153897,0.236389,0.257311,0.910091,\n\t\t\t    0.873592,0.024186,0.605101,0.660032,0.566323,0.451606,0.358067,0.024317,0.260280,0.161762,0.972818,0.187859,\n\t\t\t    0.790566,0.239307,0.576087,0.096764,0.318913,0.166514,0.913250,0.944008,0.489965,0.189180,0.189721,0.252259,\n\t\t\t    0.538400,0.086910,0.505877,0.255202,0.597443,0.072310,0.932067,0.207258,0.227714,0.205346,0.693772,0.210227,\n\t\t\t    0.123610,0.914117,0.392712,0.676728,0.156035,0.205754,0.551587,0.370873,0.795626,0.195283,0.577064,0.058645,\n\t\t\t    0.355853,0.308132,0.874848,0.130627,0.255423,0.411779,0.195286,0.917067,0.648250,0.103855,0.607838,0.775983,\n\t\t\t    0.340369,0.888985,0.330699,0.437483,0.519368,0.727670,0.364493,0.131245,0.027351,0.248788,0.491008,0.888624,\n\t\t\t    0.320796,0.017164,0.864521,0.028736,0.864661,0.023656,0.514811,0.116180,0.981251,0.517054,0.709452,0.234641,\n\t\t\t    0.468430,0.914947,0.431062,0.174664,0.062809,0.384878,0.037283,0.324072,0.300810,0.117186,0.137945,0.522248,\n\t\t\t    0.313559,0.125985,0.495835,0.862714,0.913087,0.122212,0.887409,0.083233,0.374664,0.111911,0.541470,0.039494,\n\t\t\t    0.087371,0.339904,0.149974,0.129626,0.935277,0.167763,0.500294,0.143956,0.412689,0.063196,0.943092,0.208514,\n\t\t\t    0.470472,0.504945,0.494944,0.295883,0.019582,0.207247,0.348642,0.059187,0.961932,0.131297,0.721973,0.303946,\n\t\t\t    0.067122,0.337374,0.615867,0.058533,0.392689,0.475035,0.114825,0.402822,0.189198,0.500163,0.119162,0.717853,\n\t\t\t    0.466804,0.615947,0.882245,0.124933,0.782752,0.250847,0.720635,0.918405,0.566874,0.049698,0.492897,0.154425,\n\t\t\t    0.597741,0.359679,0.490792,0.926349,0.814247,0.318809,0.381751,0.326160,0.103538,0.372486,0.521884,0.899673,\n\t\t\t    0.917693,0.067686,0.507971,0.117492,0.605718,0.684896,0.555449,0.564840,0.138850,0.853077,0.583400,0.772682,\n\t\t\t    0.602746,0.092744,0.419950,0.133190,0.040524,0.337552,0.892942,0.519071,0.851403,0.103246,0.426797,0.403475,\n\t\t\t    0.156700,0.351463,0.868708,0.133781,0.622707,0.043137,0.439822,0.506996,0.599536,0.062790,0.314852,0.128613,\n\t\t\t    0.950070,0.176834,0.941389,0.851240,0.601396,0.215194,0.519556,0.132022,0.708533,0.320530,0.619496,0.082946,\n\t\t\t    0.504203,0.114491,0.569739,0.410716,0.454512,0.132385,0.424879,0.452545,0.343409,0.014502,0.507954,0.392811,\n\t\t\t    0.240644,0.154529,0.424112,0.007907,0.452279,0.229101,0.799208,0.056229,0.820491,0.230977,0.337161,0.042798,\n\t\t\t    0.257450,0.167870,0.905412,0.120132,0.889921,0.089109,0.315823,0.957408,0.691134,0.219468,0.962351,0.146411,\n\t\t\t    0.842069,0.235708,0.766378,0.290493,0.897038,0.153389,0.784276,0.194318,0.058194,0.364381,0.615867,0.041085,\n\t\t\t    0.767122,0.294730,0.799906,0.069584,0.708678,0.329968,0.230918,0.172436,0.538858,0.343434,0.798371,0.140787,\n\t\t\t    0.199435,0.518728,0.503505,0.070579,0.039951,0.323248,0.167943,0.240221,0.357917,0.069338,0.484853,0.900138,\n\t\t\t    0.065198,0.700880,0.562146,0.682695,0.509646,0.255063,0.632799,0.236953,0.860055,0.059829,0.892263,0.394750,\n\t\t\t    0.254378,0.700715,0.436762,0.381254,0.760331,0.832375,0.173580,0.504078,0.316216,0.412196,0.549008,0.172012,\n\t\t\t    0.888863,0.790987,0.505319,0.075757,0.695450,0.334369,0.141668,0.440598,0.920902,0.163856,0.423141,0.009447,\n\t\t\t    0.665251,0.906851,0.568968,0.066224,0.030679,0.365766,0.078356,0.272356,0.787485,0.045106,0.922856,0.189255,\n\t\t\t    0.765272,0.286821,0.050544,0.259743,0.686649,0.755219,0.500713,0.175920,0.932179,0.929686,0.489075,0.819589,\n\t\t\t    0.777226,0.301750,0.904853,0.266989,0.361125,0.122158,0.713000,0.220397,0.796138,0.032420,0.718774,0.313206,\n\t\t\t    0.267557,0.146484,0.832668,0.270531,0.510205,0.127849,0.516346,0.113947,0.726509,0.828367,0.809115,0.194632,\n\t\t\t    0.459194,0.631089,0.505659,0.787581,0.534176,0.456784,0.315165,0.079175,0.896201,0.261685,0.392817,0.722563,\n\t\t\t    0.790954,0.312449,0.336718,0.032786,0.542168,0.022479,0.515762,0.402797,0.696278,0.320109,0.503873,0.581332,\n\t\t\t    0.906807,0.153947,0.479776,0.220167,0.663324,0.086938,0.508937,0.899799,0.489407,0.114840,0.488988,0.122517,\n\t\t\t    0.423764,0.052078,0.542860,0.544441,0.947977,0.195396,0.318669,0.400715,0.901225,0.157855,0.434939,0.089586,\n\t\t\t    0.072075,0.316398,0.315116,0.083696,0.333169,0.378454,0.306989,0.116037,0.679210,0.924206,0.260791,0.495099,\n\t\t\t    0.888386,0.096017,0.438179,0.025227,0.551684,0.541672,0.478520,0.208163,0.887967,0.110991,0.252088,0.187548,\n\t\t\t    0.544462,0.635273,0.503086,0.065582,0.579577,0.444020,0.102908,0.690099,0.772283,0.297525,0.927183,0.153947,\n\t\t\t    0.750861,0.213313,0.695098,0.874421,0.578983,0.397168,0.740175,0.093267,0.791787,0.228808,0.908621,0.128338,\n\t\t\t    0.054767,0.312770,0.939764,0.865485,0.597303,0.066168,0.623823,0.044742,0.534865,0.721871,0.154651,0.883020,\n\t\t\t    0.482847,0.219330,0.922996,0.169019,0.734052,0.303121,0.166824,0.204924,0.414842,0.143978,0.110404,0.723888,\n\t\t\t    0.548254,0.685399,0.336326,0.115608,0.265411,0.187579,0.432012,0.076577,0.270903,0.532761,0.063472,0.354947,\n\t\t\t    0.488709,0.115608,0.245462,0.568405,0.187138,0.528257,0.257797,0.613425,0.470285,0.214165,0.801162,0.062300,\n\t\t\t    0.589778,0.423694,0.888525,0.113713,0.069322,0.185560,0.176687,0.561218,0.563803,0.143077,0.659696,0.099081,\n\t\t\t    0.548171,0.023554,0.036014,0.328147,0.747712,0.091216,0.805349,0.073743,0.608385,0.222882,0.726842,0.226452,\n\t\t\t    0.546008,0.318569,0.310092,0.120653,0.909877,0.146271,0.938493,0.550426,0.305574,0.036537,0.345006,0.661975,\n\t\t\t    0.908482,0.112889,0.933053,0.459855,0.910854,0.074943,0.194678,0.479015,0.386021,0.062651,0.433720,0.049840,\n\t\t\t    0.227492,0.169065,0.565706,0.808632,0.802279,0.037472,0.513136,0.141109,0.787067,0.034109,0.239472,0.406493,\n\t\t\t    0.916995,0.121039,0.666256,0.084481,0.783191,0.312381,0.621784,0.372508,0.324789,0.561891,0.548934,0.670228,\n\t\t\t    0.592278,0.150656,0.473495,0.207047,0.491920,0.120102,0.246869,0.840181,0.162703,0.121671,0.814485,0.200063,\n\t\t\t    0.306414,0.116850,0.485976,0.803526,0.506855,0.076846,0.638126,0.237513,0.291766,0.061136,0.572641,0.429547,\n\t\t\t    0.916576,0.071148,0.537966,0.483300,0.921182,0.122030,0.225924,0.928170,0.363070,0.382531,0.366782,0.371173,\n\t\t\t    0.913087,0.075167,0.058553,0.717705,0.575807,0.146888,0.373756,0.525266,0.444200,0.783780,0.214828,0.508901,\n\t\t\t    0.809396,0.045371,0.493595,0.120046,0.908621,0.068189,0.297362,0.028535,0.491222,0.138485,0.787625,0.030899,\n\t\t\t    0.532677,0.096443,0.844983,0.051302,0.537685,0.584793,0.468094,0.778937,0.786308,0.304482,0.923473,0.974230,\n\t\t\t    0.880431,0.079032,0.241375,0.173019,0.288188,0.122188,0.651739,0.111685,0.493411,0.843332,0.148512,0.390204,\n\t\t\t    0.779068,0.198884,0.937649,0.145434,0.328776,0.084068,0.154516,0.244264,0.926213,0.886731,0.272528,0.201016,\n\t\t\t    0.042458,0.343043,0.510550,0.402119,0.201734,0.157950,0.318013,0.127434,0.868708,0.033258,0.849202,0.686985,\n\t\t\t    0.139955,0.349652,0.560314,0.045119,0.818628,0.314153,0.808000,0.067952,0.123222,0.133873,0.323904,0.972579,\n\t\t\t    0.524581,0.259529,0.857264,0.058783,0.500573,0.120186,0.747432,0.129120,0.973390,0.939949,0.858660,0.084391,\n\t\t\t    0.316434,0.148199,0.211887,0.442507,0.278378,0.111651,0.810373,0.056885,0.267927,0.444706,0.521650,0.263437,\n\t\t\t    0.149067,0.500444,0.551054,0.550978,0.906110,0.219679,0.339448,0.077487,0.915041,0.224982,0.288912,0.591759,\n\t\t\t    0.790690,0.199054,0.526117,0.120172,0.279272,0.857308,0.145999,0.306930,0.911623,0.835929,0.497893,0.818790,\n\t\t\t    0.475589,0.162521,0.601852,0.887313,0.190308,0.170749,0.169240,0.711249,0.051543,0.231473,0.509088,0.071472,\n\t\t\t    0.656345,0.157496,0.513136,0.248502,0.527373,0.080726,0.880806,0.826582,0.951572,0.837863,0.849728,0.065705,\n\t\t\t    0.206983,0.608706,0.794045,0.023433,0.082083,0.126303,0.341084,0.090916,0.928247,0.908174,0.950309,0.494695,\n\t\t\t    0.959151,0.977987,0.544960,0.056774,0.165083,0.967243,0.522488,0.075157,0.323033,0.527445,0.886432,0.150598,\n\t\t\t    0.737511,0.259273,0.718519,0.319992,0.435543,0.579263,0.858520,0.034904,0.117848,0.480335,0.343507,0.102817,\n\t\t\t    0.676840,0.885119,0.503950,0.456144,0.326542,0.018056,0.634200,0.275222,0.117113,0.789663,0.790835,0.044422,\n\t\t\t    0.142801,0.494594,0.249922,0.487642,0.315565,0.044860,0.235879,0.919445,0.737803,0.095975,0.466097,0.210118,\n\t\t\t    0.742269,0.076967,0.215759,0.927608,0.753294,0.137772,0.513973,0.069155,0.342582,0.674227,0.749665,0.169577,\n\t\t\t    0.907924,0.119211,0.658579,0.163916,0.194055,0.236088,0.331656,0.082019,0.556127,0.034051,0.150813,0.112850,\n\t\t\t    0.541191,0.121986,0.290405,0.415357,0.562408,0.132385,0.842948,0.271144,0.898573,0.273687,0.303675,0.981598,\n\t\t\t    0.892293,0.257080,0.275721,0.708978,0.886562,0.618732,0.561431,0.048274,0.404971,0.398885,0.269417,0.520436,\n\t\t\t    0.907927,0.887304,0.900946,0.073101,0.482401,0.936587,0.389189,0.119699,0.648669,0.176618,0.185372,0.906491,\n\t\t\t    0.497198,0.389345,0.035170,0.162971,0.871094,0.732911,0.628848,0.095996,0.235315,0.317663,0.179176,0.242389,\n\t\t\t    0.471311,0.762783,0.555568,0.058687,0.414640,0.142697,0.535469,0.239430,0.236288,0.928922,0.676591,0.891792,\n\t\t\t    0.103038,0.503330,0.158509,0.923204,0.531561,0.083699,0.598649,0.373802,0.266748,0.149827,0.566628,0.589075,\n\t\t\t    0.258153,0.939035,0.500853,0.063404,0.498340,0.571869,0.746388,0.237024,0.621171,0.033939,0.195559,0.125977,\n\t\t\t    0.761109,0.111773,0.003412,0.205748,0.265520,0.410471,0.924543,0.943057,0.499317,0.147446,0.903902,0.526960,\n\t\t\t    0.277650,0.096266,0.748270,0.180044,0.106538,0.492752,0.503360,0.781012,0.938990,0.515254,0.879148,0.645877,\n\t\t\t    0.462468,0.180387,0.873872,0.021744,0.705721,0.803561,0.785811,0.102101,0.509174,0.299716,0.859070,0.865710,\n\t\t\t    0.066106,0.109317,0.454093,0.149400,0.747299,0.307868,0.223539,0.885964,0.496107,0.062818,0.230742,0.857811,\n\t\t\t    0.330922,0.018095,0.163204,0.189270,0.808184,0.206937,0.182207,0.717468,0.533294,0.573525,0.894387,0.122951,\n\t\t\t    0.883501,0.135023,0.728493,0.883353,0.112205,0.414412,0.510902,0.113360,0.902620,0.127933,0.145293,0.291626,\n\t\t\t    0.453027,0.381040,0.671264,0.313041,0.737860,0.316967,0.424938,0.523819,0.933463,0.176555,0.342175,0.045830,\n\t\t\t    0.476013,0.929233,0.954815,0.142322,0.720257,0.783810,0.542308,0.052838,0.538339,0.773353,0.904892,0.468702,\n\t\t\t    0.904714,0.077958,0.292999,0.910012,0.279017,0.794935,0.466811,0.876246,0.560419,0.556018,0.553256,0.350069,\n\t\t\t    0.898852,0.066207,0.957639,0.967511,0.954117,0.217585,0.199204,0.447587,0.538539,0.040374,0.765096,0.233413,\n\t\t\t    0.111781,0.382512,0.770455,0.248727,0.282450,0.145830,0.178239,0.202597,0.120928,0.472913,0.555708,0.030422,\n\t\t\t    0.702573,0.893821,0.789198,0.213873,0.639387,0.244803,0.134422,0.239923,0.868847,0.047660,0.879733,0.129022,\n\t\t\t    0.851124,0.075990,0.096773,0.351326,0.884059,0.244939,0.656222,0.737406,0.547753,0.841507,0.622567,0.117283,\n\t\t\t    0.631958,0.233028,0.825633,0.301985,0.134623,0.500367,0.574691,0.060627,0.560454,0.071416,0.799906,0.028764,\n\t\t\t    0.644994,0.258961,0.167811,0.302812,0.883221,0.627659,0.927601,0.126119,0.464143,0.219749,0.673793,0.091321,\n\t\t\t    0.780307,0.263777,0.341719,0.027773,0.752736,0.107028,0.827472,0.296009,0.664720,0.190855,0.289576,0.135196,\n\t\t\t    0.035864,0.324589,0.389512,0.109300,0.268313,0.475852,0.631817,0.229523,0.501411,0.122615,0.929555,0.124361,\n\t\t\t    0.334412,0.085095,0.593023,0.831511,0.575537,0.396536,0.873732,0.022749,0.311085,0.013789,0.568098,0.471662,\n\t\t\t    0.592836,0.084202,0.294095,0.980396,0.496665,0.061646,0.881237,0.384542,0.217562,0.409008,0.761807,0.135916,\n\t\t\t    0.915320,0.073255,0.619217,0.051038,0.433333,0.026444,0.785767,0.933025,0.331042,0.084419,0.865498,0.221912,\n\t\t\t    0.686009,0.333523,0.892851,0.149900,0.641350,0.234149,0.502619,0.905734,0.630802,0.117715,0.072754,0.333772,\n\t\t\t    0.920623,0.224982,0.780368,0.140117,0.513136,0.151494,0.894526,0.069654,0.909598,0.275223,0.907784,0.131757,\n\t\t\t    0.485638,0.153867,0.358380,0.108381,0.699868,0.234393,0.793905,0.129329,0.332150,0.059157,0.409467,0.127446,\n\t\t\t    0.587028,0.629569,0.174884,0.838271,0.792928,0.022302,0.639317,0.159310,0.747712,0.085536,0.809166,0.327867,\n\t\t\t    0.772413,0.141373,0.944980,0.957421,0.903834,0.804790,0.505738,0.080978,0.837869,0.657875,0.197431,0.671698,\n\t\t\t    0.894656,0.737460,0.240702,0.169630,0.686897,0.896442,0.810233,0.055154,0.290002,0.373453,0.543844,0.029849,\n\t\t\t    0.781755,0.342789,0.419481,0.618078,0.166298,0.137038,0.900667,0.123789,0.894666,0.082061,0.662879,0.865910,\n\t\t\t    0.909040,0.076953,0.604934,0.391475,0.521460,0.549194,0.699255,0.723907,0.510065,0.122936,0.579099,0.382110,\n\t\t\t    0.213560,0.530485,0.911565,0.742685,0.883733,0.432816,0.489465,0.642194,0.123430,0.263354,0.003412,0.195814,\n\t\t\t    0.937510,0.186883,0.526396,0.150517,0.978540,0.229169,0.968213,0.177114,0.979237,0.185347,0.516765,0.150377,\n\t\t\t    0.933463,0.179207,0.285249,0.680243,0.506715,0.219609,0.546496,0.046836,0.160880,0.137126,0.782595,0.263938,\n\t\t\t    0.616984,0.089283,0.074209,0.677001,0.682604,0.214312,0.483798,0.882560,0.892997,0.594672,0.922298,0.120062,\n\t\t\t    0.609065,0.398490,0.265944,0.183454,0.538953,0.661395,0.227183,0.227864,0.767242,0.261763,0.229649,0.839920,\n\t\t\t    0.518021,0.114198,0.778258,0.262411,0.746316,0.096031,0.942242,0.877766,0.919228,0.131381,0.359906,0.543221,\n\t\t\t    0.122503,0.159715,0.345206,0.541602,0.503515,0.469733,0.183599,0.838770,0.233827,0.168999,0.340291,0.036690,\n\t\t\t    0.487592,0.225053,0.721793,0.269270,0.550195,0.704242,0.009736,0.235637,0.221944,0.169650,0.532345,0.735084,\n\t\t\t    0.781863,0.337403,0.152019,0.307582,0.449360,0.551805,0.918809,0.116629,0.532335,0.306812,0.024523,0.258814,\n\t\t\t    0.863695,0.714469,0.567014,0.074278,0.901085,0.180184,0.073985,0.362951,0.705007,0.201181,0.754689,0.085201,\n\t\t\t    0.942813,0.982108,0.127374,0.400643,0.436995,0.051851,0.580119,0.700121,0.796138,0.056871,0.724027,0.235227,\n\t\t\t    0.521929,0.132706,0.594232,0.170198,0.340330,0.072261,0.228146,0.519605,0.257368,0.948881,0.817769,0.178649,\n\t\t\t    0.794324,0.070827,0.824424,0.205619,0.918059,0.444161,0.946023,0.214794,0.348458,0.590271,0.981414,0.507027,\n\t\t\t    0.742696,0.309346,0.621730,0.024280,0.869347,0.385458,0.324661,0.037029,0.904435,0.130194,0.541191,0.087384,\n\t\t\t    0.281972,0.045905,0.319815,0.562040,0.847532,0.902767,0.499317,0.142728,0.861590,0.119295,0.221731,0.165003,\n\t\t\t    0.523755,0.637158,0.910994,0.270617,0.127325,0.308487,0.930672,0.157436,0.116079,0.926500,0.412915,0.138762,\n\t\t\t    0.809470,0.279526,0.135772,0.478265,0.317594,0.033913,0.255781,0.198669,0.872197,0.865838,0.820034,0.270122,\n\t\t\t    0.336494,0.909511,0.715274,0.318969,0.584074,0.433112,0.897405,0.412887,0.750655,0.298646,0.329751,0.033699,\n\t\t\t    0.508809,0.256319,0.525977,0.104246,0.682584,0.798452,0.502807,0.130054,0.614750,0.035656,0.153047,0.723292,\n\t\t\t    0.901384,0.558399,0.146765,0.949363,0.502693,0.842408,0.118545,0.497121,0.751970,0.777496,0.583228,0.607807,\n\t\t\t    0.898015,0.119323,0.432877,0.223378,0.789808,0.212158,0.834244,0.768415,0.472081,0.602077,0.707635,0.817810,\n\t\t\t    0.177766,0.477531,0.607492,0.061422,0.515648,0.129482,0.789060,0.220004,0.235686,0.223317,0.147172,0.697786,\n\t\t\t    0.436366,0.231473,0.259589,0.143220,0.950070,0.153110,0.633036,0.097769,0.326465,0.081605,0.600977,0.232666,\n\t\t\t    0.479688,0.792973,0.104622,0.410965,0.289614,0.051248,0.164958,0.197271,0.059544,0.266910,0.394761,0.113651,\n\t\t\t    0.422316,0.141353,0.071295,0.701382,0.501830,0.262600,0.890901,0.545126,0.642527,0.094308,0.858520,0.028052,\n\t\t\t    0.257590,0.361726,0.622346,0.862904,0.515812,0.332659,0.259752,0.170545,0.696853,0.295563,0.431365,0.111834,\n\t\t\t    0.037306,0.327536,0.492478,0.127765,0.607800,0.349751,0.352542,0.064489,0.174108,0.210941,0.202089,0.688422,\n\t\t\t    0.304430,0.020301,0.593674,0.161125,0.612936,0.069490,0.259833,0.165166,0.435742,0.016458,0.231515,0.157550,\n\t\t\t    0.867871,0.056871,0.793068,0.039552,0.607826,0.273339,0.331326,0.014268,0.533253,0.330949,0.787405,0.265208,\n\t\t\t    0.697715,0.796853,0.791377,0.263547,0.871874,0.448680,0.065274,0.333641,0.484657,0.812215,0.292941,0.932289,\n\t\t\t    0.487343,0.796952,0.262619,0.148021,0.460653,0.230078,0.238800,0.292929,0.664441,0.098997,0.919786,0.134018,\n\t\t\t    0.580946,0.918172,0.062957,0.346436,0.250737,0.718032,0.069721,0.226984,0.912948,0.139154,0.078520,0.726200,\n\t\t\t    0.168175,0.288084,0.499751,0.911033,0.075789,0.353261,0.555683,0.673629,0.260816,0.771786,0.645458,0.096722,\n\t\t\t    0.552777,0.059733,0.956071,0.183115,0.503784,0.118846,0.795719,0.037444,0.249253,0.201685,0.522627,0.158194,\n\t\t\t    0.922019,0.114550,0.493131,0.498440,0.508111,0.077865,0.695369,0.336306,0.236778,0.938726,0.345592,0.012195,\n\t\t\t    0.768259,0.292985,0.040379,0.149652,0.323643,0.033780,0.242304,0.147308,0.100454,0.599535,0.546584,0.650313,\n\t\t\t    0.609503,0.234622,0.920205,0.117969,0.829353,0.155622,0.419919,0.129274,0.797255,0.027354,0.931090,0.151993,\n\t\t\t    0.491820,0.605352,0.073072,0.838955,0.897596,0.127291,0.556665,0.562244,0.927373,0.897401,0.290891,0.081793,\n\t\t\t    0.642208,0.739234,0.198187,0.608840,0.550962,0.139266,0.553196,0.029291,0.393075,0.340096,0.494292,0.113430,\n\t\t\t    0.786787,0.327175,0.322740,0.127226,0.313595,0.434911,0.519867,0.893527,0.359513,0.731980,0.434481,0.337051,\n\t\t\t    0.157988,0.837144,0.896061,0.158413,0.505040,0.083811,0.331766,0.956391,0.371648,0.668888,0.540075,0.028495,\n\t\t\t    0.500434,0.133627,0.883082,0.090267,0.176930,0.905798,0.546775,0.031594,0.484243,0.127723,0.272043,0.194496,\n\t\t\t    0.975470,0.186883,0.683447,0.224479,0.465539,0.142700,0.353931,0.616439,0.803674,0.047813,0.285455,0.116394,\n\t\t\t    0.979935,0.224563,0.044507,0.322046,0.957559,0.925349,0.614192,0.031496,0.845837,0.883611,0.979806,0.966026,\n\t\t\t    0.226897,0.488750,0.827993,0.746123,0.917274,0.115080,0.078860,0.329081,0.797056,0.218972,0.148829,0.146352,\n\t\t\t    0.502248,0.120674,0.549326,0.606514,0.845820,0.053982,0.921182,0.135777,0.466476,0.640531,0.284489,0.838674,\n\t\t\t    0.833561,0.225079,0.513136,0.078661,0.680934,0.789643,0.796611,0.303746,0.476913,0.888944,0.553474,0.109396,\n\t\t\t    0.860030,0.875289,0.866196,0.023419,0.436227,0.220028,0.267995,0.947868,0.154459,0.708415,0.194137,0.508521,\n\t\t\t    0.372309,0.759889,0.361677,0.706715,0.903884,0.534375,0.546635,0.061129,0.954309,0.770214,0.686596,0.203846,\n\t\t\t    0.526396,0.088096,0.013498,0.198018,0.851682,0.052586,0.906807,0.261127,0.820871,0.238371,0.627173,0.039187,\n\t\t\t    0.896061,0.150458,0.904993,0.258057,0.894247,0.119979,0.918949,0.165112,0.857683,0.068775,0.782483,0.259418,\n\t\t\t    0.740734,0.162041,0.447812,0.131687,0.269678,0.954818,0.633640,0.271858,0.046939,0.336866,0.313862,0.018101,\n\t\t\t    0.874011,0.147388,0.439449,0.078198,0.880989,0.087015,0.500294,0.207884,0.930804,0.836026,0.365823,0.105959,\n\t\t\t    0.227418,0.674594,0.022784,0.374801,0.890339,0.254149,0.908621,0.071273,0.770882,0.296790,0.300641,0.965728,\n\t\t\t    0.500581,0.882043,0.220816,0.495884,0.039661,0.330524,0.078513,0.761428,0.418106,0.121662,0.158847,0.904204,\n\t\t\t    0.466871,0.927039,0.155548,0.137481,0.173216,0.238208,0.128758,0.958480,0.555149,0.068680,0.200310,0.500756,\n\t\t\t    0.439636,0.116064,0.194540,0.689011,0.500503,0.423455,0.134292,0.738436,0.548813,0.555250,0.084718,0.549771,\n\t\t\t    0.510205,0.082122,0.165906,0.837767,0.547473,0.161823,0.205469,0.406676,0.506576,0.142547,0.439362,0.042604,\n\t\t\t    0.316418,0.158470,0.473101,0.777020,0.791114,0.024382,0.945883,0.139489,0.869751,0.568868,0.958025,0.191488,\n\t\t\t    0.913645,0.123551,0.491920,0.115035,0.517742,0.094824,0.672258,0.100254,0.506587,0.874501,0.800348,0.198156,\n\t\t\t    0.453535,0.229101,0.463965,0.705747,0.547333,0.103031,0.570696,0.475539,0.130447,0.685390,0.475589,0.196299,\n\t\t\t    0.247770,0.163294,0.339609,0.379187,0.397276,0.461461,0.092909,0.889702,0.184503,0.478229,0.268974,0.910350,\n\t\t\t    0.325155,0.009331,0.508390,0.130110,0.758052,0.809917,0.437483,0.184156,0.479576,0.781466,0.430085,0.170477,\n\t\t\t    0.866056,0.031695,0.801860,0.052865,0.898992,0.266151,0.775623,0.101208,0.332802,0.117785,0.883222,0.076995,\n\t\t\t    0.462867,0.804921,0.640433,0.095466,0.688554,0.327498,0.095305,0.135821,0.461770,0.184435,0.434328,0.127849,\n\t\t\t    0.550264,0.054192,0.242657,0.719276,0.243527,0.143942,0.709480,0.745174,0.606096,0.064968,0.304345,0.896348,\n\t\t\t    0.860753,0.057555,0.216110,0.368895,0.765017,0.119937,0.276161,0.405615,0.494432,0.116571,0.503226,0.275162,\n\t\t\t    0.140670,0.208205,0.778101,0.256276,0.358420,0.504982,0.614750,0.100784,0.462328,0.144515,0.506855,0.277116,\n\t\t\t    0.808008,0.295941,0.847956,0.913293,0.767651,0.241495,0.065587,0.212935,0.400834,0.130445,0.953978,0.174462,\n\t\t\t    0.460763,0.799679,0.095554,0.686182,0.934160,0.198047,0.532495,0.758944,0.862986,0.027675,0.431067,0.347068,\n\t\t\t    0.525514,0.564422,0.927788,0.522822,0.872276,0.636316,0.554731,0.048218,0.316437,0.160882,0.718037,0.208792,\n\t\t\t    0.614332,0.167266,0.261607,0.509393,0.935613,0.764767,0.939313,0.535472,0.796975,0.158971,0.383492,0.281218,\n\t\t\t    0.816932,0.120900,0.942394,0.140536,0.257055,0.513566,0.378660,0.053564,0.876802,0.134772,0.806605,0.046376,\n\t\t\t    0.392728,0.087145,0.267221,0.716063,0.446137,0.184016,0.148349,0.502917,0.431760,0.222122,0.770320,0.094398,\n\t\t\t    0.533524,0.322832,0.098219,0.913070,0.737472,0.245845,0.556719,0.599360,0.490426,0.810993,0.785159,0.263184,\n\t\t\t    0.325596,0.125944,0.986215,0.175439,0.299649,0.107452,0.570821,0.585301,0.525979,0.474264,0.614890,0.062483,\n\t\t\t    0.087787,0.692335,0.495828,0.190297,0.272938,0.614061,0.071873,0.343177,0.915460,0.117048,0.710356,0.785868,\n\t\t\t    0.229023,0.964875,0.503161,0.911490,0.513415,0.087007,0.794861,0.301853,0.976121,0.948725,0.227965,0.173214,\n\t\t\t    0.897875,0.245078,0.300961,0.017920,0.909040,0.133613,0.493874,0.137466,0.344155,0.148716,0.178678,0.306209,\n\t\t\t    0.921327,0.846115,0.600469,0.667096,0.761389,0.207314,0.579715,0.158054,0.886432,0.088187,0.589736,0.683334,\n\t\t\t    0.502528,0.151773,0.857543,0.152272,0.274045,0.052549,0.125561,0.578255,0.432877,0.224494,0.380292,0.089943,\n\t\t\t    0.815489,0.698154,0.325302,0.131725,0.791455,0.233685,0.895782,0.071720,0.704763,0.325032,0.252640,0.714297,\n\t\t\t    0.223489,0.565260,0.891961,0.957918,0.606236,0.102752,0.635269,0.115831,0.399767,0.434829,0.432198,0.392616,\n\t\t\t    0.512159,0.128212,0.870383,0.020153,0.651041,0.135833,0.470424,0.218213,0.698772,0.214525,0.884681,0.740892,\n\t\t\t    0.277048,0.054146,0.768857,0.277039,0.493874,0.069490,0.435333,0.128002,0.809715,0.216123,0.415442,0.133740,\n\t\t\t    0.467392,0.737184,0.964026,0.139447,0.675049,0.086421,0.037467,0.344898,0.188894,0.962200,0.486415,0.820508,\n\t\t\t    0.318909,0.160869,0.837028,0.146969,0.745758,0.094998,0.151876,0.730758,0.500098,0.875484,0.241937,0.432124,\n\t\t\t    0.715835,0.898838,0.482149,0.157356,0.468713,0.905264,0.106142,0.938553,0.200754,0.964705,0.021266,0.232065,\n\t\t\t    0.898573,0.124542,0.716625,0.845561,0.328799,0.363999,0.949233,0.215771,0.520117,0.321899,0.193189,0.325491,\n\t\t\t    0.498061,0.131757,0.470689,0.671295,0.306261,0.119745,0.372599,0.049133,0.721902,0.792090,0.619496,0.061520,\n\t\t\t    0.504901,0.257017,0.355622,0.119405,0.901434,0.451097,0.803235,0.270003,0.540214,0.027379,0.351390,0.028111,\n\t\t\t    0.664581,0.115049,0.644574,0.248868,0.814284,0.334427,0.325984,0.963822,0.224721,0.428083,0.879709,0.541414,\n\t\t\t    0.233458,0.165338,0.520534,0.257017,0.748986,0.324526,0.885221,0.876754,0.868987,0.029950,0.954573,0.979117,\n\t\t\t    0.242132,0.215519,0.836287,0.779344,0.610982,0.052768,0.206234,0.529977,0.462877,0.766529,0.233775,0.203393,\n\t\t\t    0.509786,0.272371,0.821398,0.061825,0.946023,0.158692,0.718390,0.775248,0.562547,0.158612,0.870941,0.033341,\n\t\t\t    0.574929,0.429505,0.609865,0.028425,0.053218,0.102021,0.459676,0.150517,0.115308,0.471011,0.507971,0.202859,\n\t\t\t    0.900827,0.445990,0.602903,0.368250,0.170117,0.702543,0.867033,0.037779,0.708568,0.267686,0.331211,0.083167,\n\t\t\t    0.610144,0.169360,0.669925,0.791043,0.031201,0.358790,0.506715,0.139266,0.839261,0.091593,0.909877,0.226936,\n\t\t\t    0.740315,0.171113,0.465399,0.138541,0.029862,0.254949,0.700608,0.244679,0.438954,0.700203,0.783403,0.308584,\n\t\t\t    0.339505,0.043032,0.904853,0.127194,0.842598,0.845796,0.320647,0.130575,0.525977,0.094559,0.557797,0.358242,\n\t\t\t    0.037900,0.337660,0.608330,0.070942,0.907644,0.138149,0.910156,0.073366,0.036268,0.349535,0.431320,0.032654,\n\t\t\t    0.885036,0.247032,0.063990,0.691648,0.480613,0.156239,0.314520,0.036489,0.549534,0.416122,0.067552,0.317559,\n\t\t\t    0.608749,0.041518,0.492059,0.123410,0.233515,0.142238,0.624661,0.023903,0.065404,0.346292,0.549427,0.128323,\n\t\t\t    0.664895,0.931556,0.117522,0.391320,0.668908,0.156937,0.916716,0.069933,0.025784,0.175364,0.748549,0.086220,\n\t\t\t    0.313919,0.524103,0.321412,0.148172,0.909598,0.185627,0.950091,0.909522,0.163194,0.526051,0.358928,0.023660,\n\t\t\t    0.606934,0.154006,0.411899,0.719435,0.874709,0.101027,0.435110,0.231753,0.440560,0.092726,0.452139,0.181783,\n\t\t\t    0.492757,0.112467,0.323587,0.032692,0.607353,0.076818,0.815779,0.222742,0.042894,0.258817,0.403774,0.698378,\n\t\t\t    0.150696,0.436542,0.488011,0.121079,0.898747,0.419351,0.181647,0.507534,0.373875,0.541679,0.877880,0.753456,\n\t\t\t    0.516625,0.116459,0.903737,0.171531,0.858660,0.132846,0.548310,0.034888,0.214645,0.506301,0.770980,0.305560,\n\t\t\t    0.054947,0.245368,0.488011,0.117157,0.644802,0.746428,0.791672,0.045692,0.709154,0.316213,0.802000,0.091481,\n\t\t\t    0.447114,0.135442,0.228070,0.720102,0.324709,0.007333,0.213381,0.434387,0.667547,0.737055,0.537981,0.130543,\n\t\t\t    0.796600,0.187319,0.312582,0.964455,0.544123,0.040206,0.082598,0.182985,0.477961,0.164335,0.496526,0.069225,\n\t\t\t    0.450736,0.798119,0.360900,0.145645,0.921600,0.138568,0.516357,0.860015,0.614471,0.140704,0.488151,0.151633,\n\t\t\t    0.748689,0.118137,0.902620,0.247311,0.860997,0.671384,0.222557,0.328445,0.829772,0.070422,0.157209,0.501779,\n\t\t\t    0.674631,0.089366,0.802155,0.229010,0.522488,0.254086,0.449906,0.137452,0.526310,0.387562,0.516530,0.633633,\n\t\t\t    0.922577,0.117648,0.066192,0.392488,0.801260,0.297140,0.448929,0.172850,0.800464,0.151575,0.172937,0.179479,\n\t\t\t    0.188924,0.213986,0.687132,0.853486,0.840434,0.816478,0.080474,0.377496,0.846379,0.126650,0.271732,0.078306,\n\t\t\t    0.115209,0.429113,0.502109,0.156937,0.699796,0.332102,0.243241,0.288339,0.311268,0.135897,0.504203,0.068094,\n\t\t\t    0.279367,0.637737,0.502933,0.436010,0.269125,0.739310,0.801546,0.239936,0.734454,0.166368,0.322694,0.964911,\n\t\t\t    0.601490,0.082192,0.293560,0.374657,0.861338,0.634661,0.535080,0.557444,0.491026,0.362339,0.904714,0.274664,\n\t\t\t    0.897736,0.148504,0.745897,0.082061,0.543983,0.047562,0.968352,0.140536,0.497363,0.128547,0.505040,0.071877,\n\t\t\t    0.756788,0.281019,0.726487,0.269506,0.792091,0.035239,0.782792,0.261571,0.665139,0.085444,0.763751,0.239568,\n\t\t\t    0.412944,0.638764,0.168783,0.188325,0.491920,0.163777,0.650343,0.088110,0.495864,0.899761,0.490524,0.115119,\n\t\t\t    0.294369,0.039320,0.883306,0.420725,0.465678,0.177037,0.561753,0.623674,0.911831,0.118234,0.784312,0.337424,\n\t\t\t    0.802418,0.066249,0.458560,0.215142,0.514671,0.233707,0.916018,0.119253,0.367043,0.050982,0.165889,0.171837,\n\t\t\t    0.741153,0.195116,0.477543,0.167685,0.494572,0.122405,0.498480,0.119614,0.523604,0.072910,0.505053,0.460019,\n\t\t\t    0.596605,0.053285,0.280589,0.507802,0.125686,0.413829,0.072120,0.374221,0.828795,0.180602,0.814141,0.057652,\n\t\t\t    0.746595,0.136795,0.474053,0.147725,0.044177,0.772507,0.498061,0.156937,0.607127,0.218129,0.036679,0.353084,\n\t\t\t    0.920902,0.157994,0.639527,0.248448,0.508948,0.250317,0.967933,0.231681,0.521790,0.242640,0.148382,0.928372,\n\t\t\t    0.773530,0.159390,0.069634,0.758671,0.485220,0.131911,0.798095,0.258211,0.515298,0.675345,0.601676,0.272920,\n\t\t\t    0.504747,0.848717,0.410652,0.143826,0.538301,0.319687,0.041416,0.315417,0.521231,0.093400,0.771809,0.298251,\n\t\t\t    0.228108,0.156389,0.866798,0.371109,0.761388,0.173066,0.598741,0.211141,0.105011,0.365764,0.233147,0.488697,\n\t\t\t    0.672676,0.093177,0.394399,0.048085,0.134027,0.468674,0.565224,0.665392,0.892154,0.264616,0.914064,0.070882,\n\t\t\t    0.706025,0.288949,0.561849,0.118650,0.926729,0.778650,0.493455,0.066419,0.503784,0.123368,0.786648,0.037291,\n\t\t\t    0.821258,0.064923,0.888646,0.461990,0.579995,0.060348,0.453814,0.230776,0.674781,0.215486,0.676725,0.904862,\n\t\t\t    0.946581,0.189953,0.505932,0.454054,0.214695,0.142868,0.098056,0.117321,0.213360,0.487997,0.762086,0.163995,\n\t\t\t    0.813704,0.232491,0.778999,0.232256,0.520952,0.244454,0.852519,0.045218,0.531700,0.230636,0.701837,0.833353,\n\t\t\t    0.762070,0.859532,0.587811,0.153169,0.488570,0.119683,0.251803,0.568835,0.103461,0.481920,0.153815,0.367195,\n\t\t\t    0.331859,0.065288,0.686826,0.731028,0.550303,0.495119,0.508669,0.113193,0.562344,0.551271,0.046230,0.381348,\n\t\t\t    0.915322,0.529005,0.139080,0.292720,0.625079,0.092200,0.546077,0.059524,0.305702,0.021788,0.260401,0.181178,\n\t\t\t    0.427015,0.182062,0.200786,0.947519,0.741373,0.271390,0.463585,0.215701,0.708527,0.777318,0.107372,0.787654,\n\t\t\t    0.882943,0.080191,0.589626,0.062218,0.489267,0.120967,0.273018,0.873331,0.548868,0.029779,0.548450,0.135609,\n\t\t\t    0.693591,0.335317,0.507553,0.070300,0.800046,0.117034,0.514671,0.205791,0.283737,0.110454,0.353031,0.147505,\n\t\t\t    0.616146,0.067033,0.687628,0.204295,0.030529,0.236880,0.294041,0.117218,0.840657,0.063011,0.968631,0.137437,\n\t\t\t    0.389385,0.351369,0.428290,0.133076,0.411106,0.343525,0.804184,0.228634,0.135723,0.260462,0.736967,0.276696,\n\t\t\t    0.563716,0.406919,0.751480,0.183533,0.900195,0.564412,0.155621,0.629202,0.387836,0.052940,0.112030,0.273831,\n\t\t\t    0.134103,0.895497,0.747014,0.090267,0.494575,0.422473,0.283602,0.872396,0.106455,0.227140,0.175884,0.257105,\n\t\t\t    0.328835,0.082876,0.499951,0.530313,0.101176,0.921189,0.508150,0.548876,0.905046,0.866031,0.694289,0.779478,\n\t\t\t    0.319408,0.013270,0.267055,0.208913,0.491222,0.180945,0.907366,0.066668,0.843169,0.166228,0.366407,0.741036,\n\t\t\t    0.441112,0.182341,0.157369,0.391222,0.067462,0.333035,0.915878,0.065495,0.671420,0.088487,0.655648,0.096331,\n\t\t\t    0.257699,0.425635,0.008079,0.194965,0.833411,0.257664,0.503644,0.142882,0.633873,0.156798,0.533096,0.144236,\n\t\t\t    0.664437,0.765487,0.303161,0.115555,0.373089,0.408299,0.774596,0.243869,0.037360,0.347110,0.264635,0.145019,\n\t\t\t    0.556942,0.901904,0.655508,0.117492,0.357928,0.358152,0.477352,0.617647,0.308286,0.089238,0.043387,0.388471,\n\t\t\t    0.547054,0.192391,0.460235,0.147306,0.478939,0.187087,0.429401,0.011873,0.523595,0.457419,0.543704,0.030226,\n\t\t\t    0.406805,0.017767,0.806465,0.040194,0.648948,0.115063,0.943511,0.177393,0.863405,0.060625,0.513891,0.466917,\n\t\t\t    0.361937,0.483692,0.443206,0.188203,0.467493,0.177037,0.758987,0.713750,0.261792,0.172618,0.450353,0.490553,\n\t\t\t    0.079478,0.411434,0.911552,0.071427,0.760939,0.230273,0.467633,0.141542,0.318865,0.145795,0.495409,0.118762,\n\t\t\t    0.096393,0.575020,0.488270,0.527901,0.939259,0.506455,0.211926,0.222110,0.831446,0.171252,0.979517,0.170136,\n\t\t\t    0.034828,0.352524,0.357797,0.137178,0.665558,0.097267,0.840517,0.059062,0.183485,0.856255,0.121479,0.555652,\n\t\t\t    0.073182,0.279360,0.352013,0.152582,0.906807,0.270478,0.126511,0.355898,0.603074,0.219807,0.757341,0.117578,\n\t\t\t    0.633219,0.240737,0.503784,0.076860,0.268303,0.077698,0.607492,0.073650,0.576499,0.655570,0.918390,0.116657,\n\t\t\t    0.375215,0.101230,0.617542,0.026569,0.553196,0.061869,0.464618,0.456299,0.028243,0.166624,0.885176,0.204746,\n\t\t\t    0.025706,0.369483,0.351589,0.040017,0.883447,0.989756,0.596328,0.857330,0.810094,0.092835,0.440479,0.055645,\n\t\t\t    0.803092,0.223670,0.228279,0.506872,0.193181,0.518400,0.534860,0.512265,0.627173,0.032166,0.615309,0.060655,\n\t\t\t    0.942674,0.211026,0.814281,0.069263,0.323804,0.084240,0.915430,0.568193,0.476566,0.225053,0.967933,0.227354,\n\t\t\t    0.118546,0.626957,0.403596,0.121811,0.499149,0.587813,0.873345,0.455581,0.068436,0.361533,0.771216,0.299190,\n\t\t\t    0.495401,0.802293,0.469866,0.174385,0.123553,0.426416,0.675329,0.087636,0.314802,0.124466,0.803937,0.210581,\n\t\t\t    0.917274,0.112010,0.690873,0.797608,0.549846,0.045803,0.485778,0.182481,0.349179,0.018613,0.802342,0.272107,\n\t\t\t    0.113177,0.494686,0.926485,0.121444,0.870522,0.052935,0.888361,0.946014,0.671002,0.083364,0.423009,0.022227,\n\t\t\t    0.528508,0.644222,0.194931,0.197645,0.065979,0.282293,0.891735,0.129455,0.832144,0.144178,0.316487,0.150516,\n\t\t\t    0.261650,0.184813,0.698963,0.267662,0.558446,0.482316,0.302849,0.977950,0.596225,0.269705,0.219213,0.964112,\n\t\t\t    0.693465,0.813787,0.357335,0.077933,0.510623,0.072282,0.903257,0.845784,0.948674,0.145713,0.577107,0.578749,\n\t\t\t    0.788183,0.024005,0.181741,0.511187,0.779453,0.806870,0.264883,0.152463,0.774787,0.782605,0.285437,0.048192,\n\t\t\t    0.194216,0.508323,0.444183,0.172152,0.743664,0.174881,0.582103,0.765710,0.488988,0.119251,0.212826,0.564811,\n\t\t\t    0.802976,0.055419,0.045568,0.364651,0.071422,0.233940,0.711698,0.203553,0.543280,0.696188,0.272912,0.089929,\n\t\t\t    0.665268,0.925534,0.744502,0.078432,0.488360,0.869319,0.868248,0.378338,0.929136,0.171671,0.269000,0.147437,\n\t\t\t    0.091673,0.374783,0.670665,0.283903,0.957187,0.135902,0.454042,0.673808,0.911691,0.140563,0.166358,0.731953,\n\t\t\t    0.043044,0.318731,0.933602,0.211724,0.386843,0.040718,0.563385,0.056746,0.757062,0.104697,0.820995,0.673869,\n\t\t\t    0.678825,0.742551,0.710317,0.885975,0.868150,0.019525,0.716907,0.854155,0.661231,0.088766,0.247453,0.222470,\n\t\t\t    0.448091,0.133516,0.923136,0.197908,0.506436,0.124331,0.114921,0.369107,0.192375,0.404323,0.525419,0.083141,\n\t\t\t    0.627034,0.102012,0.520783,0.688796,0.039178,0.343012,0.914343,0.062020,0.543285,0.099081,0.129791,0.770241,\n\t\t\t    0.809256,0.118388,0.703051,0.206966,0.601536,0.267049,0.621032,0.033269,0.604003,0.070258,0.888804,0.129999,\n\t\t\t    0.467297,0.584324,0.660114,0.106940,0.471262,0.222959,0.960676,0.223168,0.931982,0.471679,0.493898,0.850088,\n\t\t\t    0.643172,0.279428,0.898015,0.085675,0.540633,0.125769,0.467804,0.923016,0.252817,0.141809,0.550074,0.491111,\n\t\t\t    0.137945,0.707021,0.067072,0.675535,0.547752,0.033785,0.428465,0.022675,0.555847,0.076260,0.297906,0.385621,\n\t\t\t    0.388114,0.089966,0.366354,0.602535,0.044329,0.233741,0.487476,0.811154,0.912529,0.144038,0.793905,0.042064,\n\t\t\t    0.479637,0.183039,0.550588,0.372034,0.177001,0.418463,0.689694,0.335724,0.049974,0.268009,0.912250,0.273129,\n\t\t\t    0.871360,0.084252,0.792796,0.267514,0.602703,0.892854,0.008646,0.203212,0.351408,0.442276,0.225501,0.918801,\n\t\t\t    0.739617,0.079353,0.149458,0.951725,0.356158,0.024491,0.822654,0.108102,0.903216,0.966087,0.055119,0.377017,\n\t\t\t    0.780787,0.103022,0.803535,0.068677,0.890906,0.384134,0.941278,0.229587,0.212445,0.839447,0.258482,0.157574,\n\t\t\t    0.711979,0.925466,0.110601,0.126956,0.853496,0.049502,0.516625,0.093903,0.533933,0.244315,0.520673,0.264554,\n\t\t\t    0.110029,0.171549,0.265582,0.152842,0.540535,0.376566,0.212659,0.378147,0.550234,0.471933,0.969004,0.516558,\n\t\t\t    0.222563,0.634316,0.559529,0.577031,0.947279,0.192465,0.284098,0.091182,0.901196,0.933746,0.742548,0.090630,\n\t\t\t    0.296673,0.041515,0.200819,0.700703,0.837474,0.257474,0.011062,0.178460,0.034836,0.260767,0.647760,0.760363,\n\t\t\t    0.490524,0.120381,0.473076,0.229240,0.240667,0.531994,0.501969,0.074850,0.335600,0.083559,0.489686,0.117492,\n\t\t\t    0.569981,0.653585,0.812903,0.258932,0.393828,0.117253,0.917538,0.759023,0.482769,0.876058,0.499903,0.932420,\n\t\t\t    0.896201,0.093993,0.319510,0.619364,0.551943,0.412608,0.458281,0.152331,0.538260,0.233986,0.511461,0.149400,\n\t\t\t    0.550543,0.039648,0.515369,0.070272,0.560545,0.776344,0.507273,0.081997,0.870783,0.441855,0.480599,0.594241,\n\t\t\t    0.057660,0.848090,0.700838,0.335296,0.251025,0.183445,0.891875,0.219539,0.499663,0.393901,0.271708,0.206019,\n\t\t\t    0.188346,0.363962,0.245594,0.218919,0.776740,0.096673,0.345095,0.023394,0.036575,0.327832,0.320721,0.423953,\n\t\t\t    0.590184,0.108014,0.123026,0.169299,0.503945,0.933047,0.167502,0.336819,0.119340,0.494273,0.546914,0.062860,\n\t\t\t    0.071141,0.864795,0.208005,0.327573,0.306039,0.112724,0.550685,0.320380,0.531386,0.691458,0.171537,0.377092,\n\t\t\t    0.218521,0.361068,0.284362,0.976041,0.501124,0.642247,0.770738,0.169438,0.476743,0.605981,0.042723,0.333701,\n\t\t\t    0.834539,0.231344,0.651324,0.775881,0.861590,0.033258,0.919946,0.459556,0.506855,0.163218,0.171686,0.691069,\n\t\t\t    0.500574,0.475015,0.475170,0.145352,0.387000,0.074568,0.519609,0.452564,0.808280,0.037486,0.302997,0.126477,\n\t\t\t    0.213205,0.153816,0.387562,0.102985,0.811350,0.082284,0.364523,0.277665,0.258952,0.716484,0.674828,0.233935,\n\t\t\t    0.715315,0.816176,0.159382,0.629797,0.184156,0.884447,0.904993,0.067868,0.208099,0.335611,0.867731,0.035016,\n\t\t\t    0.576903,0.418991,0.190739,0.219904,0.873592,0.110935,0.770125,0.200645,0.348199,0.130021,0.513415,0.073971,\n\t\t\t    0.330866,0.118091,0.113276,0.376020,0.099746,0.108725,0.029137,0.368261,0.103082,0.722120,0.799911,0.213641,\n\t\t\t    0.427992,0.172012,0.552866,0.585215,0.080476,0.715168,0.234968,0.207812,0.558918,0.137829,0.671184,0.307581,\n\t\t\t    0.412790,0.014010,0.277656,0.678863,0.569181,0.439693,0.914762,0.157017,0.565478,0.111336,0.412803,0.144406,\n\t\t\t    0.069632,0.710123,0.155953,0.398680,0.944679,0.783435,0.448278,0.480251,0.201380,0.953661,0.948116,0.224005,\n\t\t\t    0.497817,0.888482,0.763865,0.729690,0.288861,0.140498,0.902620,0.120886,0.048283,0.391577,0.328955,0.424809,\n\t\t\t    0.498340,0.129272,0.037976,0.347189,0.126225,0.490580,0.087584,0.106821,0.445050,0.612898,0.905132,0.147806,\n\t\t\t    0.817909,0.067407,0.261278,0.501716,0.476630,0.520688,0.552218,0.024643,0.510902,0.115608,0.909459,0.169857,\n\t\t\t    0.291836,0.112710,0.220828,0.530865,0.559197,0.067578,0.885176,0.100357,0.162736,0.261376,0.965980,0.174741,\n\t\t\t    0.337353,0.027330,0.666256,0.136712,0.272275,0.347940,0.527652,0.100268,0.748492,0.272212,0.865498,0.103120,\n\t\t\t    0.600138,0.286198,0.131255,0.476526,0.475309,0.186808,0.616426,0.024126,0.561431,0.103157,0.879847,0.816930,\n\t\t\t    0.321364,0.146956,0.504342,0.063418,0.287717,0.034856,0.757267,0.277923,0.143577,0.106393,0.928997,0.176834,\n\t\t\t    0.333507,0.124243,0.742744,0.736632,0.768227,0.163716,0.046248,0.343134,0.736407,0.192046,0.594784,0.596928,\n\t\t\t    0.529885,0.080098,0.124415,0.495570,0.466097,0.141123,0.897038,0.263081,0.863126,0.087308,0.261608,0.162039,\n\t\t\t    0.528266,0.587841,0.935835,0.163716,0.872615,0.027480,0.515782,0.383843,0.252341,0.520297,0.494953,0.836042,\n\t\t\t    0.919088,0.118416,0.548171,0.025815,0.786770,0.346906,0.096083,0.720162,0.194521,0.487215,0.628988,0.162381,\n\t\t\t    0.778011,0.223663,0.210193,0.450538,0.115804,0.601615,0.893689,0.192884,0.755527,0.113615,0.241268,0.725871,\n\t\t\t    0.232882,0.198554,0.620194,0.055392,0.887967,0.087085,0.281148,0.131845,0.511502,0.933893,0.969887,0.182975,\n\t\t\t    0.786839,0.325959,0.274675,0.438062,0.338445,0.094276,0.503924,0.136908,0.090305,0.380859,0.786758,0.336450,\n\t\t\t    0.326850,0.052611,0.498759,0.062874,0.923154,0.932134,0.318887,0.157461,0.113032,0.495269,0.147061,0.397624,\n\t\t\t    0.714692,0.759886,0.227263,0.956876,0.677030,0.911347,0.402742,0.062206,0.682361,0.208628,0.230084,0.232714,\n\t\t\t    0.495984,0.905431,0.621311,0.051331,0.549169,0.728875,0.614611,0.077558,0.928578,0.127808,0.227858,0.531098,\n\t\t\t    0.118923,0.577713,0.734304,0.714032,0.409147,0.014865,0.860055,0.032281,0.922298,0.115206,0.212713,0.479789,\n\t\t\t    0.539098,0.041811,0.506855,0.079596,0.199624,0.216682,0.611223,0.387626,0.234028,0.153821,0.243884,0.479372,\n\t\t\t    0.264132,0.439957,0.138976,0.200473,0.236073,0.635037,0.517997,0.398393,0.863264,0.926414,0.296465,0.398203,\n\t\t\t    0.599020,0.239235,0.557441,0.430037,0.641550,0.132148,0.916855,0.064728,0.760830,0.086694,0.896772,0.575549,\n\t\t\t    0.405067,0.104555,0.221594,0.318405,0.250984,0.321177,0.108969,0.394485,0.304474,0.116889,0.498956,0.910820,\n\t\t\t    0.811656,0.287503,0.918670,0.159250,0.159004,0.317952,0.410187,0.145257,0.338448,0.088566,0.213908,0.519084,\n\t\t\t    0.973516,0.175858,0.037212,0.368934,0.049573,0.279334,0.556888,0.604485,0.470424,0.140453,0.793046,0.212237,\n\t\t\t    0.745097,0.325633,0.673163,0.748882,0.207380,0.318689,0.508390,0.115147,0.783282,0.191705,0.260675,0.174859,\n\t\t\t    0.221673,0.857457,0.868289,0.027145,0.500778,0.835392,0.953140,0.150598,0.846733,0.893009,0.487926,0.537316,\n\t\t\t    0.479972,0.857591,0.455551,0.342310,0.111397,0.767200,0.167925,0.319955,0.497100,0.623505,0.969608,0.188278,\n\t\t\t    0.537054,0.504937,0.155294,0.257445,0.610005,0.076972,0.793766,0.063207,0.189583,0.965988,0.415272,0.145380,\n\t\t\t    0.810119,0.204803,0.020135,0.174274,0.894805,0.114285,0.131098,0.975076,0.781755,0.329449,0.482883,0.791961,\n\t\t\t    0.339589,0.093266,0.908761,0.116839,0.239003,0.196719,0.786607,0.202943,0.838450,0.795944,0.435459,0.109398,\n\t\t\t    0.214371,0.714566,0.269526,0.415693,0.200466,0.505615,0.911007,0.789638,0.155655,0.894788,0.962072,0.230843,\n\t\t\t    0.473959,0.869517,0.538260,0.095173,0.796557,0.029727,0.127975,0.348417,0.349904,0.466041,0.550404,0.032082,\n\t\t\t    0.877585,0.742231,0.417342,0.010614,0.033309,0.318550,0.066423,0.350961,0.468133,0.453682,0.109801,0.505268,\n\t\t\t    0.512226,0.649554,0.541353,0.794035,0.477447,0.566664,0.179457,0.171016,0.660533,0.080070,0.477110,0.910872,\n\t\t\t    0.512832,0.563241,0.540493,0.104078,0.952582,0.147388,0.246306,0.513582,0.219104,0.401916,0.654252,0.084439,\n\t\t\t    0.593970,0.835373,0.528210,0.254365,0.540534,0.594808,0.550125,0.080684,0.424354,0.539173,0.158452,0.335496,\n\t\t\t    0.785486,0.198157,0.982866,0.178928,0.421999,0.552810,0.232545,0.149507,0.336007,0.121622,0.126836,0.379777,\n\t\t\t    0.934998,0.160088,0.297928,0.365523,0.233517,0.430132,0.784831,0.238892,0.436946,0.590654,0.044983,0.348530,\n\t\t\t    0.067769,0.124851,0.471524,0.586412,0.494013,0.197416,0.970118,0.495293,0.704075,0.736275,0.182516,0.133391,\n\t\t\t    0.898015,0.116266,0.060126,0.755446,0.541819,0.503444,0.432764,0.022557,0.756476,0.290026,0.850984,0.038435,\n\t\t\t    0.493874,0.126299,0.614890,0.075115,0.232346,0.306565,0.399390,0.284325,0.759469,0.206908,0.537797,0.453027,\n\t\t\t    0.161131,0.605411,0.336583,0.038020,0.916545,0.499487,0.145031,0.238280,0.257907,0.520287,0.726190,0.234389,\n\t\t\t    0.814560,0.167903,0.797030,0.266527,0.941874,0.835368,0.207805,0.458786,0.277881,0.420350,0.670210,0.234283,\n\t\t\t    0.902620,0.082214,0.177108,0.223825,0.769094,0.301990,0.293128,0.921486,0.096931,0.704082,0.485499,0.150377,\n\t\t\t    0.338717,0.113586,0.293042,0.025766,0.181505,0.507288,0.544977,0.683233,0.151609,0.334150,0.090703,0.898687,\n\t\t\t    0.359342,0.637069,0.749370,0.319646,0.678120,0.085346,0.496304,0.843025,0.507739,0.590818,0.977284,0.224144,\n\t\t\t    0.204931,0.300738,0.039898,0.378046,0.664860,0.105669,0.670304,0.090539,0.364041,0.077299,0.534895,0.766146,\n\t\t\t    0.011040,0.167427,0.798453,0.696724,0.360729,0.574081,0.934186,0.954142,0.705397,0.333734,0.670862,0.096066,\n\t\t\t    0.826701,0.097412,0.246403,0.223249,0.814578,0.296100,0.408004,0.131163,0.430055,0.133531,0.982866,0.180742,\n\t\t\t    0.413730,0.102817,0.322522,0.980245,0.862167,0.894780,0.320300,0.081740,0.081610,0.231669,0.288402,0.856068,\n\t\t\t    0.438369,0.105126,0.467774,0.882829,0.170353,0.218721,0.784253,0.348079,0.447114,0.143384,0.058528,0.393754,\n\t\t\t    0.943314,0.896185,0.908621,0.114578,0.465020,0.810929,0.710225,0.255674,0.554621,0.613924,0.489049,0.594384,\n\t\t\t    0.456366,0.459536,0.502455,0.402771,0.283752,0.371146,0.797666,0.262201,0.256236,0.898670,0.478796,0.531613,\n\t\t\t    0.226684,0.200332,0.542308,0.092060,0.958273,0.952110,0.335415,0.919707,0.223702,0.145593,0.123145,0.519875,\n\t\t\t    0.484825,0.921360,0.559474,0.610628,0.973934,0.223586,0.148216,0.503172,0.778284,0.796074,0.954818,0.943574,\n\t\t\t    0.340494,0.033310,0.157755,0.343593,0.491213,0.905674,0.820511,0.207167,0.317292,0.081957,0.267109,0.197162,\n\t\t\t    0.570375,0.439963,0.267085,0.505966,0.571917,0.848815,0.490697,0.828143,0.646854,0.156239,0.290815,0.358133,\n\t\t\t    0.100615,0.196944,0.748499,0.261521,0.478601,0.509804,0.804761,0.214363,0.697505,0.336677,0.899271,0.132664,\n\t\t\t    0.713357,0.801978,0.228907,0.372274,0.369407,0.750564,0.037542,0.331053,0.502079,0.899856,0.105613,0.553417,\n\t\t\t    0.962211,0.215771,0.917454,0.887013,0.899829,0.113726,0.869964,0.019344,0.853825,0.795898,0.721096,0.251411,\n\t\t\t    0.571582,0.454301,0.132042,0.380508,0.506813,0.798585,0.776706,0.262253,0.237119,0.413667,0.623963,0.024475,\n\t\t\t    0.931090,0.200838,0.539377,0.177316,0.343998,0.367903,0.886663,0.799233,0.940022,0.163297,0.271691,0.099176,\n\t\t\t    0.577627,0.632552,0.967096,0.134507,0.496290,0.631802,0.532119,0.101677,0.825270,0.324118,0.789997,0.087434,\n\t\t\t    0.811805,0.202919,0.555149,0.179549,0.566043,0.667154,0.158829,0.326816,0.604052,0.224699,0.089991,0.416984,\n\t\t\t    0.884338,0.112038,0.538121,0.038782,0.753294,0.084140,0.330263,0.121766,0.485529,0.764530,0.880570,0.081866,\n\t\t\t    0.665999,0.919701,0.300243,0.968082,0.606655,0.163358,0.483066,0.658005,0.485564,0.606520,0.142947,0.557650,\n\t\t\t    0.603353,0.239095,0.300023,0.101294,0.878025,0.736369,0.224776,0.141624,0.880089,0.730269,0.759574,0.089918,\n\t\t\t    0.785204,0.217286,0.134359,0.307350,0.625359,0.045008,0.793766,0.033453,0.305594,0.123895,0.341383,0.977335,\n\t\t\t    0.620752,0.035139,0.880152,0.096533,0.220281,0.946028,0.222715,0.155151,0.311263,0.119547,0.406299,0.136090,\n\t\t\t    0.338163,0.899170,0.120348,0.333502,0.524442,0.090162,0.815592,0.292068,0.797255,0.034430,0.501004,0.376766,\n\t\t\t    0.310738,0.138972,0.875407,0.028401,0.698178,0.326320,0.240372,0.211112,0.519836,0.092312,0.143845,0.421539,\n\t\t\t    0.855171,0.033062,0.786726,0.329492,0.835633,0.184650,0.272445,0.111603,0.491288,0.916539,0.546914,0.020846,\n\t\t\t    0.864905,0.686002,0.465958,0.185133,0.189600,0.494154,0.772413,0.095556,0.235561,0.283298,0.298445,0.100772,\n\t\t\t    0.048271,0.224914,0.484090,0.453519,0.593064,0.673572,0.313410,0.062784,0.965142,0.177532,0.583913,0.329662,\n\t\t\t    0.583205,0.111713,0.512717,0.258552,0.910156,0.154505,0.717522,0.319778,0.542719,0.802489,0.494851,0.125322,\n\t\t\t    0.105218,0.296563,0.059662,0.374594,0.733101,0.294783,0.499373,0.905399,0.174583,0.186911,0.334995,0.929429,\n\t\t\t    0.611121,0.074138,0.789263,0.188474,0.912389,0.126440,0.786569,0.256300,0.256824,0.636117,0.064399,0.380862,\n\t\t\t    0.196045,0.242765,0.074222,0.201921,0.202065,0.225942,0.333500,0.527661,0.214379,0.180680,0.381784,0.756928,\n\t\t\t    0.745060,0.088020,0.698843,0.210066,0.450604,0.186947,0.459676,0.190716,0.508002,0.443380,0.946034,0.915580,\n\t\t\t    0.162071,0.701944,0.454791,0.191414,0.235139,0.421463,0.532139,0.674405,0.288241,0.042831,0.905691,0.122281,\n\t\t\t    0.505543,0.861141,0.446556,0.229938,0.281247,0.931130,0.714785,0.934045,0.545669,0.713673,0.291562,0.097304,\n\t\t\t    0.398182,0.687568,0.940121,0.854048,0.181847,0.504651,0.159340,0.285111,0.540493,0.048413,0.717986,0.171950,\n\t\t\t    0.319776,0.579720,0.514671,0.142184,0.868010,0.108870,0.954150,0.963235,0.686195,0.838254,0.445998,0.177316,\n\t\t\t    0.529746,0.243338,0.554471,0.580243,0.135496,0.184092,0.146553,0.258569,0.219263,0.208841,0.564251,0.450557,\n\t\t\t    0.410794,0.136024,0.485840,0.633843,0.038030,0.340477,0.715147,0.307498,0.258498,0.532395,0.337457,0.640364,\n\t\t\t    0.634292,0.163637,0.521511,0.077195,0.370844,0.623790,0.854695,0.807267,0.798516,0.202656,0.238857,0.950956,\n\t\t\t    0.895782,0.239914,0.845504,0.941234,0.331262,0.122915,0.552473,0.311973,0.231641,0.148998,0.492199,0.114700,\n\t\t\t    0.780446,0.309970,0.538958,0.084286,0.767259,0.289410,0.924810,0.117243,0.540138,0.732622,0.400291,0.276057,\n\t\t\t    0.608004,0.404660,0.515586,0.657045,0.510623,0.118120,0.911273,0.145015,0.494804,0.753554,0.316452,0.163856,\n\t\t\t    0.461650,0.443044,0.622846,0.032013,0.597878,0.698746,0.771672,0.264296,0.390156,0.754586,0.407748,0.013084,\n\t\t\t    0.390709,0.101739,0.692402,0.201017,0.938477,0.895826,0.508809,0.125294,0.775333,0.311041,0.619915,0.022200,\n\t\t\t    0.493036,0.133934,0.760642,0.298928,0.806745,0.290800,0.971508,0.976558,0.910156,0.116629,0.528650,0.537352,\n\t\t\t    0.569988,0.398845,0.964444,0.174881,0.969022,0.940265,0.537423,0.089701,0.545644,0.820601,0.447812,0.140955,\n\t\t\t    0.633079,0.221252,0.548854,0.637572,0.076735,0.619539,0.343453,0.403100,0.609446,0.130264,0.639107,0.241018,\n\t\t\t    0.687021,0.883208,0.944348,0.218841,0.426231,0.138270,0.924670,0.206002,0.862149,0.029127,0.231913,0.588939,\n\t\t\t    0.723183,0.284250,0.464562,0.140216,0.166644,0.226257,0.412854,0.127356,0.574238,0.610987,0.887967,0.211445,\n\t\t\t    0.948674,0.184929,0.260906,0.436716,0.245938,0.510422,0.033667,0.872755,0.165144,0.509068,0.708414,0.831592,\n\t\t\t    0.861870,0.139349,0.338095,0.112333,0.133380,0.485551,0.615727,0.050354,0.112451,0.577109,0.231904,0.873079,\n\t\t\t    0.771710,0.294850,0.047894,0.313922,0.253517,0.164100,0.773943,0.249860,0.959839,0.226098,0.151306,0.915680,\n\t\t\t    0.546356,0.030687,0.491235,0.783272,0.789579,0.046195,0.367325,0.100435,0.416952,0.139520,0.708921,0.863746,\n\t\t\t    0.407198,0.761469,0.502528,0.138652,0.819165,0.161204,0.830972,0.678718,0.525260,0.703996,0.701722,0.886357,\n\t\t\t    0.624940,0.046264,0.590615,0.387517,0.968213,0.188697,0.567154,0.062832,0.522488,0.240825,0.502692,0.556748,\n\t\t\t    0.325373,0.010591,0.200564,0.508391,0.510344,0.253667,0.883461,0.568431,0.149881,0.182304,0.800883,0.072069,\n\t\t\t    0.414793,0.440034,0.828385,0.248281,0.948407,0.536791,0.399891,0.136467,0.686948,0.903269,0.948351,0.921484,\n\t\t\t    0.384993,0.611262,0.007191,0.228569,0.424960,0.131794,0.936114,0.176137,0.429646,0.637284,0.423774,0.008703,\n\t\t\t    0.215060,0.908180,0.536890,0.307777,0.253980,0.478310,0.150383,0.121012,0.314985,0.920981,0.797547,0.229086,\n\t\t\t    0.929834,0.149342,0.960449,0.963966,0.606236,0.046278,0.823451,0.286180,0.740677,0.223106,0.248819,0.458996,\n\t\t\t    0.901085,0.269501,0.953376,0.937428,0.837553,0.246040,0.477167,0.915868,0.882386,0.845675,0.503644,0.067955,\n\t\t\t    0.423569,0.086644,0.670210,0.269423,0.756737,0.217239,0.134949,0.314325,0.584130,0.447759,0.628335,0.385096,\n\t\t\t    0.473874,0.420024,0.863543,0.731414,0.633219,0.258821,0.066340,0.341854,0.730825,0.174741,0.869266,0.038784,\n\t\t\t    0.476286,0.178712,0.628852,0.936649,0.915041,0.137591,0.525379,0.312880,0.111342,0.179171,0.884674,0.445434,\n\t\t\t    0.900108,0.145434,0.910575,0.078000,0.779670,0.148644,0.443904,0.217655,0.615867,0.158891,0.195969,0.774293,\n\t\t\t    0.672834,0.224771,0.496002,0.926500,0.612936,0.025648,0.985657,0.179486,0.336524,0.059877,0.470402,0.802553,\n\t\t\t    0.920484,0.120872,0.147364,0.964589,0.873313,0.021800,0.498848,0.650604,0.543704,0.031245,0.580166,0.905257,\n\t\t\t    0.663965,0.724999,0.766594,0.198298,0.911413,0.071929,0.720643,0.303466,0.505040,0.209978,0.241232,0.195699,\n\t\t\t    0.319903,0.125499,0.784365,0.324763,0.844564,0.091230,0.705847,0.315122,0.476984,0.205651,0.514950,0.245013,\n\t\t\t    0.259208,0.419970,0.357179,0.143408,0.422033,0.105332,0.575206,0.621266,0.897070,0.798041,0.500434,0.126355,\n\t\t\t    0.324728,0.619363,0.551713,0.626732,0.796696,0.033537,0.698661,0.323840,0.138633,0.403711,0.472099,0.151075,\n\t\t\t    0.666206,0.773482,0.614192,0.037359,0.096656,0.401294,0.234132,0.502497,0.448760,0.646041,0.207438,0.505961,\n\t\t\t    0.202936,0.948349,0.915599,0.126622,0.795825,0.193447,0.945883,0.180742,0.677657,0.287801,0.508290,0.410356,\n\t\t\t    0.991944,0.517486,0.500068,0.442142,0.047806,0.377772,0.501252,0.563697,0.745199,0.100776,0.600792,0.052126,\n\t\t\t    0.220531,0.213393,0.714199,0.282635,0.699164,0.804826,0.506855,0.132469,0.106777,0.491886,0.458560,0.193508,\n\t\t\t    0.167291,0.180242,0.655648,0.083197,0.794463,0.075837,0.548823,0.486707,0.015433,0.171604,0.158685,0.106247,\n\t\t\t    0.676784,0.863699,0.273252,0.569739,0.702579,0.332566,0.713297,0.325512,0.279927,0.045397,0.318875,0.158457,\n\t\t\t    0.919646,0.121542,0.824089,0.242804,0.682770,0.741536,0.808977,0.038491,0.135543,0.331454,0.143044,0.121782,\n\t\t\t    0.883158,0.856082,0.098273,0.827842,0.211842,0.633085,0.564224,0.799563,0.899535,0.817800,0.393538,0.486132,\n\t\t\t    0.686889,0.214686,0.317460,0.045678,0.343449,0.097158,0.893202,0.481356,0.937231,0.196373,0.179022,0.163929,\n\t\t\t    0.968910,0.217725,0.765799,0.281624,0.597861,0.105251,0.640154,0.099430,0.030909,0.362556,0.256112,0.502241,\n\t\t\t    0.799139,0.304878,0.234416,0.507094,0.226181,0.480380,0.247888,0.159444,0.694647,0.894800,0.892596,0.524970,\n\t\t\t    0.856706,0.051065,0.776804,0.793190,0.466516,0.212490,0.983424,0.172229,0.502667,0.122936,0.788183,0.029922,\n\t\t\t    0.863126,0.038100,0.250464,0.205396,0.281089,0.399809,0.845820,0.074371,0.479357,0.165312,0.524861,0.110904,\n\t\t\t    0.721694,0.297314,0.698800,0.206370,0.608105,0.267049,0.040322,0.159853,0.559477,0.147585,0.909249,0.898370,\n\t\t\t    0.593953,0.059091,0.442927,0.182899,0.776896,0.255841,0.203121,0.839077,0.127274,0.627264,0.740650,0.728946,\n\t\t\t    0.251000,0.960007,0.683519,0.307837,0.812636,0.224413,0.548655,0.401456,0.188414,0.507989,0.777057,0.259015,\n\t\t\t    0.513415,0.240825,0.742041,0.260230,0.602607,0.055057,0.155090,0.251501,0.870522,0.092151,0.533396,0.492860,\n\t\t\t    0.227628,0.160702,0.130347,0.520821,0.503784,0.083029,0.226288,0.739312,0.415509,0.748159,0.316537,0.464829,\n\t\t\t    0.131847,0.217137,0.940720,0.226796,0.321334,0.157448,0.328283,0.129883,0.853775,0.113657,0.698632,0.200036,\n\t\t\t    0.091536,0.666463,0.782437,0.211820,0.565955,0.636329,0.412992,0.051801,0.112055,0.478280,0.258388,0.725945,\n\t\t\t    0.909809,0.593659,0.187688,0.731505,0.042800,0.340433,0.747432,0.112791,0.140922,0.341512,0.540633,0.211653,\n\t\t\t    0.520952,0.219470,0.896061,0.127878,0.385933,0.271527,0.768997,0.322732,0.004382,0.174607,0.149230,0.206562,\n\t\t\t    0.903737,0.071566,0.506082,0.867695,0.367055,0.116502,0.652018,0.086603,0.870662,0.022581,0.748270,0.115136,\n\t\t\t    0.215817,0.936785,0.795998,0.266604,0.554627,0.880215,0.598001,0.158752,0.185891,0.942260,0.562301,0.415154,\n\t\t\t    0.120003,0.411411,0.811210,0.145713,0.491222,0.129328,0.786833,0.206684,0.562102,0.576213,0.813758,0.310120,\n\t\t\t    0.219653,0.966328,0.321934,0.046776,0.426315,0.115858,0.481400,0.786833,0.307666,0.122365,0.954257,0.215213,\n\t\t\t    0.800576,0.300338,0.455350,0.188901,0.535469,0.093665,0.543425,0.024908,0.589512,0.616004,0.793813,0.310565,\n\t\t\t    0.796218,0.268186,0.787711,0.263898,0.471880,0.551473,0.568270,0.091139,0.904714,0.140591,0.270123,0.202818,\n\t\t\t    0.105152,0.884597,0.187932,0.953077,0.605957,0.034302,0.241991,0.441744,0.242385,0.210277,0.096812,0.896431,\n\t\t\t    0.904435,0.115234,0.505180,0.141207,0.617036,0.828914,0.039007,0.353840,0.869406,0.080456,0.912389,0.123900,\n\t\t\t    0.833501,0.246944,0.053654,0.865471,0.932625,0.161762,0.682086,0.732285,0.144302,0.284959,0.792091,0.027578,\n\t\t\t    0.587564,0.795865,0.278630,0.389512,0.050574,0.371065,0.889642,0.085955,0.667233,0.088627,0.134678,0.115611,\n\t\t\t    0.980494,0.227215,0.883222,0.107056,0.288873,0.961328,0.663185,0.094056,0.484801,0.153308,0.389284,0.086133,\n\t\t\t    0.804642,0.217507,0.605063,0.415987,0.413742,0.728904,0.893131,0.089653,0.867033,0.080623,0.794463,0.024075,\n\t\t\t    0.456385,0.655982,0.064435,0.350558,0.965003,0.131771,0.754271,0.163995,0.465530,0.772774,0.099324,0.624225,\n\t\t\t    0.205633,0.194365,0.792328,0.219552,0.799580,0.321932,0.495130,0.063991,0.274522,0.512753,0.414732,0.138810,\n\t\t\t    0.510646,0.825570,0.434831,0.175083,0.469726,0.142142,0.898242,0.570687,0.803395,0.130348,0.279757,0.375673,\n\t\t\t    0.553523,0.631683,0.313549,0.121540,0.661449,0.856187,0.344179,0.035033,0.533333,0.403811,0.966259,0.230006,\n\t\t\t    0.767389,0.096812,0.905132,0.252335,0.489267,0.212909,0.155912,0.474729,0.490803,0.124136,0.038684,0.271915,\n\t\t\t    0.420130,0.135189,0.638278,0.731604,0.249429,0.725470,0.798510,0.167345,0.563664,0.047743,0.805829,0.282548,\n\t\t\t    0.262349,0.158582,0.644854,0.255597,0.621869,0.098844,0.239042,0.488418,0.210484,0.385043,0.711965,0.794146,\n\t\t\t    0.432179,0.224774,0.296446,0.132050,0.763167,0.891873,0.108782,0.242873,0.694217,0.333890,0.449899,0.455989,\n\t\t\t    0.558198,0.425856,0.698589,0.930751,0.686373,0.725902,0.456258,0.813111,0.262132,0.168156,0.928020,0.153389,\n\t\t\t    0.548031,0.443498,0.749526,0.087029,0.438243,0.121775,0.770041,0.098305,0.436785,0.170756,0.264787,0.486114,\n\t\t\t    0.235924,0.348316,0.482009,0.210118,0.554172,0.084300,0.916995,0.190372,0.515561,0.404129,0.364358,0.140262,\n\t\t\t    0.568270,0.139015,0.068923,0.328832,0.604471,0.231967,0.495270,0.206628,0.044730,0.186865,0.810512,0.156459,\n\t\t\t    0.847875,0.922984,0.330417,0.025115,0.209516,0.965506,0.096948,0.711729,0.455070,0.147306,0.460374,0.138317,\n\t\t\t    0.491124,0.850434,0.940441,0.195954,0.751759,0.154366,0.184747,0.896067,0.238653,0.216642,0.716781,0.288024,\n\t\t\t    0.969469,0.139349,0.178031,0.346529,0.254359,0.438081,0.502528,0.118539,0.301988,0.097064,0.921600,0.117732,\n\t\t\t    0.899132,0.257359,0.035459,0.352705,0.653414,0.181504,0.651600,0.146469,0.283711,0.100274,0.161575,0.205431,\n\t\t\t    0.828934,0.064895,0.902607,0.456050,0.156582,0.504385,0.785671,0.039287,0.575927,0.734906,0.893351,0.507715,\n\t\t\t    0.152060,0.559551,0.527845,0.324129,0.332915,0.118747,0.273449,0.196893,0.528350,0.078884,0.829076,0.226360,\n\t\t\t    0.356862,0.149636,0.616286,0.029626,0.295892,0.027344,0.074685,0.257351,0.928159,0.158552,0.959979,0.219679,\n\t\t\t    0.274316,0.105452,0.519217,0.584779,0.049271,0.374459,0.742004,0.286971,0.891456,0.090700,0.498002,0.684843,\n\t\t\t    0.318966,0.153293,0.489961,0.459027,0.411684,0.008958,0.140540,0.919815,0.053113,0.088547,0.489686,0.115454,\n\t\t\t    0.675049,0.095885,0.182697,0.499814,0.885455,0.080819,0.768733,0.235260,0.334856,0.077595,0.096539,0.126812,\n\t\t\t    0.836623,0.231147,0.369129,0.089416,0.521092,0.142993,0.329571,0.947838,0.872337,0.048511,0.104121,0.213409,\n\t\t\t    0.799766,0.058504,0.547316,0.594328,0.046691,0.340255,0.817254,0.198539,0.494003,0.795666,0.491222,0.117645,\n\t\t\t    0.559224,0.379880,0.404283,0.366427,0.084557,0.190830,0.512996,0.115873,0.488501,0.512236,0.239860,0.688870,\n\t\t\t    0.496665,0.122977,0.516067,0.270835,0.084930,0.115968,0.318138,0.966253,0.341241,0.688507,0.811092,0.192408,\n\t\t\t    0.616704,0.056774,0.608245,0.263974,0.869127,0.115066,0.898713,0.238379,0.508234,0.627253,0.234418,0.531529,\n\t\t\t    0.687190,0.910108,0.268592,0.099122,0.244934,0.898601,0.603165,0.052992,0.606379,0.768773,0.572079,0.620304,\n\t\t\t    0.812745,0.067240,0.703917,0.332881,0.466935,0.180666,0.541470,0.081410,0.872755,0.028596,0.258752,0.477699,\n\t\t\t    0.389642,0.502261,0.288097,0.885748,0.357842,0.036060,0.807163,0.081042,0.920065,0.112554,0.673137,0.280269,\n\t\t\t    0.904016,0.125380,0.353168,0.684337,0.897178,0.129566,0.892159,0.835093,0.784297,0.327154,0.868475,0.651400,\n\t\t\t    0.333342,0.083541,0.246805,0.193771,0.805563,0.265189,0.199156,0.708964,0.146467,0.896253,0.261217,0.365307,\n\t\t\t    0.591440,0.061729,0.086306,0.271371,0.125279,0.948737,0.919367,0.065133,0.513393,0.568060,0.866754,0.052265,\n\t\t\t    0.579353,0.337793,0.376184,0.679808,0.923136,0.174462,0.757062,0.087141,0.038251,0.320179,0.104934,0.669060,\n\t\t\t    0.902760,0.123021,0.133733,0.395042,0.535173,0.329006,0.910156,0.135721,0.260041,0.451385,0.913506,0.135637,\n\t\t\t    0.040549,0.227793,0.419351,0.136793,0.557804,0.353780,0.416474,0.127917,0.544186,0.404192,0.805349,0.143006,\n\t\t\t    0.896480,0.114034,0.562559,0.438632,0.316978,0.941683,0.440735,0.522260,0.499736,0.061101,0.146483,0.323736,\n\t\t\t    0.615727,0.082960,0.714610,0.304279,0.461072,0.151633,0.096461,0.310095,0.622009,0.044324,0.525698,0.127053,\n\t\t\t    0.350770,0.603507,0.263524,0.520347,0.339050,0.354481,0.576966,0.883182,0.144634,0.349926,0.664720,0.123019,\n\t\t\t    0.542866,0.205791,0.697824,0.328883,0.461233,0.375356,0.457489,0.606529,0.873769,0.626788,0.740594,0.100343,\n\t\t\t    0.822646,0.258667,0.434002,0.104616,0.202443,0.176284,0.872476,0.097147,0.704456,0.201988,0.790025,0.193297,\n\t\t\t    0.551381,0.071765,0.861113,0.884773,0.370068,0.076698,0.551925,0.345259,0.435110,0.173408,0.376713,0.572954,\n\t\t\t    0.796696,0.067128,0.371891,0.770223,0.561989,0.054764,0.435684,0.566163,0.810345,0.332821,0.412553,0.011084,\n\t\t\t    0.483052,0.745056,0.687547,0.332741,0.468470,0.181224,0.926345,0.176555,0.673854,0.731193,0.818607,0.170275,\n\t\t\t    0.513129,0.557135,0.802837,0.038868,0.878477,0.223865,0.533794,0.082722,0.877361,0.239496,0.303102,0.113643,\n\t\t\t    0.874290,0.040473,0.529262,0.735847,0.773948,0.166368,0.760842,0.841031,0.259343,0.177865,0.781952,0.829801,\n\t\t\t    0.056450,0.349979,0.185150,0.702066,0.484522,0.147027,0.170311,0.774169,0.914343,0.119700,0.427433,0.173268,\n\t\t\t    0.949324,0.515719,0.866894,0.021102,0.932625,0.223865,0.399808,0.318329,0.541649,0.492289,0.227618,0.796177,\n\t\t\t    0.702015,0.865222,0.831549,0.225256,0.862093,0.935975,0.979517,0.229587,0.205628,0.937327,0.229689,0.967462,\n\t\t\t    0.488570,0.118511,0.337618,0.084299,0.234754,0.149800,0.816968,0.772281,0.666954,0.081969,0.068999,0.406620,\n\t\t\t    0.745729,0.315022,0.499317,0.130012,0.539656,0.081606,0.113928,0.492042,0.370454,0.106571,0.343372,0.107824,\n\t\t\t    0.683973,0.806958,0.308266,0.038865,0.316704,0.080056,0.953057,0.847834,0.555987,0.094978,0.335266,0.080496,\n\t\t\t    0.661370,0.183458,0.345255,0.557999,0.609643,0.231128,0.562771,0.631437,0.939327,0.834138,0.749386,0.108828,\n\t\t\t    0.551546,0.546980,0.828642,0.318861,0.836051,0.080121,0.514005,0.551681,0.805209,0.031485,0.034189,0.242649,\n\t\t\t    0.922159,0.121095,0.608665,0.238536,0.151522,0.284311,0.915460,0.128631,0.068679,0.324851,0.562128,0.081075,\n\t\t\t    0.275477,0.959059,0.784856,0.196136,0.523145,0.726603,0.451441,0.220028,0.278473,0.079386,0.551521,0.027155,\n\t\t\t    0.491256,0.894318,0.874988,0.025456,0.316490,0.153306,0.865359,0.041157,0.911134,0.063402,0.267385,0.898976,\n\t\t\t    0.234494,0.447726,0.703462,0.204059,0.029745,0.361760,0.047645,0.846002,0.896480,0.143480,0.687128,0.876424,\n\t\t\t    0.194891,0.741357,0.603584,0.118301,0.148832,0.673539,0.741879,0.281058,0.639948,0.265550,0.909040,0.123454,\n\t\t\t    0.035498,0.891346,0.389912,0.113379,0.262724,0.180558,0.261622,0.972624,0.953140,0.190790,0.957659,0.525213,\n\t\t\t    0.475353,0.408725,0.654670,0.088431,0.860195,0.168042,0.850286,0.158692,0.387069,0.109402,0.241356,0.150782,\n\t\t\t    0.425458,0.137799,0.580425,0.574929,0.518300,0.091362,0.533285,0.525966,0.916995,0.124319,0.070750,0.312577,\n\t\t\t    0.427196,0.604998,0.501690,0.126914,0.261464,0.196228,0.891720,0.745937,0.053939,0.238017,0.625777,0.034009,\n\t\t\t    0.262447,0.172530,0.412976,0.133676,0.850705,0.081168,0.548003,0.450396,0.656814,0.802129,0.805488,0.037514,\n\t\t\t    0.234000,0.674534,0.244068,0.714924,0.412906,0.120746,0.112091,0.669666,0.535981,0.312233,0.495853,0.894087,\n\t\t\t    0.863963,0.029880,0.948814,0.192046,0.316510,0.899223,0.273299,0.095886,0.499048,0.862065,0.604331,0.228612,\n\t\t\t    0.423179,0.063627,0.522200,0.490194,0.033274,0.355856,0.540912,0.140439,0.462760,0.299690,0.919507,0.123021,\n\t\t\t    0.927043,0.172369,0.676033,0.301866,0.805349,0.061518,0.882385,0.082870,0.325432,0.920288,0.810931,0.174043,\n\t\t\t    0.410917,0.142541,0.323574,0.128776,0.948438,0.867812,0.803986,0.189010,0.200485,0.508683,0.808838,0.070352,\n\t\t\t    0.426596,0.175362,0.510623,0.222540,0.667791,0.093889,0.222250,0.444538,0.676139,0.842566,0.444412,0.390971,\n\t\t\t    0.444462,0.183318,0.807721,0.058294,0.555708,0.071877,0.737097,0.232569,0.550353,0.633273,0.697885,0.338133,\n\t\t\t    0.267400,0.094868,0.715760,0.215582,0.890339,0.240891,0.452116,0.621984,0.097426,0.315225,0.618938,0.057556,\n\t\t\t    0.552440,0.427900,0.667652,0.100686,0.882173,0.962714,0.798092,0.100873,0.551241,0.119209,0.247057,0.929639,\n\t\t\t    0.489965,0.130752,0.510252,0.911659,0.321375,0.155904,0.234286,0.356553,0.512578,0.834732,0.226590,0.287866,\n\t\t\t    0.480195,0.223797,0.338717,0.605350,0.894945,0.237961,0.410665,0.584590,0.912520,0.933085,0.611959,0.071975,\n\t\t\t    0.137841,0.411506,0.102157,0.379104,0.546715,0.458146,0.347800,0.071552,0.434568,0.414732,0.479218,0.161264,\n\t\t\t    0.234688,0.510029,0.876206,0.654559,0.829036,0.303117,0.902202,0.147946,0.852798,0.059508,0.536653,0.587676,\n\t\t\t    0.589486,0.185272,0.217043,0.197328,0.886432,0.257220,0.534857,0.590942,0.478659,0.197974,0.060133,0.148695,\n\t\t\t    0.736687,0.082521,0.224933,0.948176,0.638340,0.096136,0.401999,0.135972,0.946162,0.224005,0.910156,0.081991,\n\t\t\t    0.334448,0.401639,0.866754,0.059620,0.466376,0.173827,0.618829,0.847381,0.948256,0.189534,0.213849,0.148071,\n\t\t\t    0.895038,0.404586,0.043991,0.133635,0.414829,0.738359,0.901628,0.945047,0.694799,0.902025,0.550683,0.029026,\n\t\t\t    0.546896,0.832631,0.821677,0.076493,0.950210,0.211724,0.912529,0.207956,0.041370,0.374725,0.469061,0.410164,\n\t\t\t    0.035112,0.212678,0.790137,0.043236,0.636106,0.096583,0.798800,0.299487,0.901365,0.143759,0.638546,0.208075,\n\t\t\t    0.537228,0.326420,0.534492,0.104497,0.311968,0.450042,0.905272,0.070394,0.164627,0.515520,0.554312,0.034804,\n\t\t\t    0.896619,0.125170,0.687200,0.869254,0.603647,0.903444,0.299466,0.136713,0.261494,0.168236,0.165553,0.407514,\n\t\t\t    0.811629,0.087266,0.947837,0.212980,0.676585,0.080280,0.748902,0.759560,0.058161,0.342801,0.968352,0.183394,\n\t\t\t    0.052874,0.362620,0.428550,0.173827,0.954598,0.786770,0.499736,0.122126,0.721817,0.927450,0.468525,0.910325,\n\t\t\t    0.690783,0.925173,0.024399,0.859846,0.925089,0.147946,0.529327,0.134939,0.523795,0.934110,0.476984,0.163637,\n\t\t\t    0.817503,0.259057,0.618380,0.023973,0.622986,0.032473,0.452977,0.178852,0.796196,0.190548,0.250765,0.773695,\n\t\t\t    0.969329,0.174183,0.670024,0.097183,0.686932,0.889815,0.615469,0.675398,0.561849,0.038336,0.294377,0.048323,\n\t\t\t    0.277775,0.532840,0.863475,0.915888,0.772984,0.303881,0.479357,0.176479,0.612238,0.060431,0.924194,0.953376,\n\t\t\t    0.824887,0.064826,0.905970,0.277176,0.673235,0.079261,0.851382,0.774805,0.602886,0.073049,0.033378,0.322351,\n\t\t\t    0.314465,0.079032,0.154047,0.716695,0.240052,0.201551,0.709117,0.871343,0.546116,0.600694,0.668629,0.092870,\n\t\t\t    0.626880,0.914982,0.264996,0.887090,0.424284,0.041863,0.668210,0.188483,0.062893,0.147176,0.692632,0.320456,\n\t\t\t    0.893689,0.095863,0.746874,0.084685,0.258197,0.930186,0.892293,0.152412,0.553742,0.447505,0.527931,0.142072,\n\t\t\t    0.378996,0.460076,0.064540,0.321961,0.503197,0.940067,0.305428,0.046503,0.174804,0.717966,0.337118,0.592359,\n\t\t\t    0.516625,0.068234,0.722242,0.280354,0.228171,0.133367,0.958304,0.132469,0.956350,0.144876,0.803799,0.277751,\n\t\t\t    0.504250,0.587085,0.328827,0.606784,0.874095,0.558809,0.659696,0.090762,0.515010,0.843117,0.550734,0.431267,\n\t\t\t    0.467601,0.436480,0.143331,0.113615,0.363846,0.267210,0.789300,0.036132,0.228949,0.147627,0.795414,0.197172,\n\t\t\t    0.163569,0.212648,0.169628,0.259052,0.638266,0.285316,0.431853,0.615735,0.910017,0.130139,0.032161,0.363131,\n\t\t\t    0.790695,0.023489,0.465539,0.227565,0.496221,0.921393,0.241018,0.304578,0.116084,0.397130,0.864940,0.072362,\n\t\t\t    0.877025,0.918605,0.786209,0.310452,0.743943,0.157017,0.473787,0.449582,0.509925,0.137940,0.776377,0.305403,\n\t\t\t    0.503256,0.520192,0.326492,0.127393,0.163069,0.773790,0.357340,0.056056,0.863823,0.036328,0.396676,0.101738,\n\t\t\t    0.295888,0.106387,0.862846,0.062565,0.270617,0.407251,0.392142,0.057307,0.270795,0.195213,0.533096,0.128937,\n\t\t\t    0.157646,0.189899,0.330719,0.020755,0.552154,0.597169,0.573552,0.643383,0.746595,0.103022,0.898155,0.142266,\n\t\t\t    0.544123,0.150935,0.195378,0.389657,0.786369,0.027452,0.751061,0.103804,0.961447,0.946065,0.499500,0.768097,\n\t\t\t    0.511461,0.077111,0.878477,0.125407,0.574525,0.863560,0.412807,0.143580,0.361640,0.130722,0.639596,0.150517,\n\t\t\t    0.948116,0.211026,0.815536,0.051944,0.054826,0.385804,0.812624,0.213856,0.229850,0.404183,0.141718,0.147205,\n\t\t\t    0.331825,0.009531,0.418507,0.143333,0.575460,0.644502,0.501411,0.114016,0.881190,0.637377,0.838843,0.729629,\n\t\t\t    0.201948,0.431705,0.711436,0.215655,0.733489,0.270429,0.491881,0.819480,0.351083,0.710751,0.754969,0.101655,\n\t\t\t    0.496890,0.459408,0.584363,0.707340,0.778854,0.307299,0.923694,0.116057,0.491205,0.579121,0.762876,0.208581,\n\t\t\t    0.941809,0.480078,0.012817,0.242140,0.205234,0.916666,0.529187,0.081857,0.228414,0.512856,0.142163,0.215601,\n\t\t\t    0.741431,0.088578,0.086859,0.728681,0.279307,0.498599,0.478297,0.767320,0.536834,0.693325,0.929704,0.811949,\n\t\t\t    0.497782,0.137508,0.873732,0.041910,0.644714,0.252373,0.865917,0.032295,0.789873,0.191716,0.084582,0.354892,\n\t\t\t    0.865498,0.083819,0.946185,0.898730,0.235796,0.719804,0.817980,0.664987,0.458001,0.133725,0.274159,0.387282,\n\t\t\t    0.261176,0.959182,0.608050,0.035865,0.498201,0.198812,0.905530,0.768706,0.601762,0.379295,0.333238,0.032001,\n\t\t\t    0.326855,0.593568,0.314007,0.422007,0.746455,0.143899,0.895309,0.580325,0.486336,0.129649,0.117407,0.423483,\n\t\t\t    0.522488,0.126383,0.753592,0.323490,0.165085,0.107530,0.386826,0.090206,0.507413,0.062399,0.541400,0.569541,\n\t\t\t    0.377966,0.337478,0.865359,0.161902,0.609084,0.227354,0.541470,0.030352,0.270116,0.484892,0.102627,0.205608,\n\t\t\t    0.134432,0.931751,0.717329,0.302588,0.111261,0.716078,0.633219,0.251532,0.985797,0.182138,0.844564,0.139098,\n\t\t\t    0.822226,0.294374,0.917693,0.155901,0.911831,0.216887,0.094205,0.552469,0.938766,0.164553,0.542727,0.042565,\n\t\t\t    0.123459,0.498514,0.340583,0.152107,0.474053,0.164475,0.662906,0.160706,0.896899,0.253591,0.536735,0.450018,\n\t\t\t    0.748409,0.099087,0.901085,0.070394,0.809721,0.680246,0.937510,0.217167,0.452279,0.142002,0.708534,0.839064,\n\t\t\t    0.285369,0.040747,0.063384,0.837261,0.680154,0.268287,0.504203,0.128254,0.238825,0.960366,0.659541,0.825459,\n\t\t\t    0.199951,0.563767,0.353626,0.142080,0.868847,0.020153,0.331707,0.134041,0.961374,0.220097,0.346095,0.011362,\n\t\t\t    0.110513,0.420166,0.516765,0.119544,0.943790,0.227494,0.222690,0.587531,0.791254,0.025219,0.943033,0.855930,\n\t\t\t    0.796726,0.299957,0.883641,0.081949,0.716997,0.268012,0.946860,0.185208,0.591859,0.181783,0.955495,0.960050,\n\t\t\t    0.481730,0.200766,0.177561,0.702454,0.507893,0.807623,0.704772,0.762350,0.313353,0.056165,0.782112,0.227263,\n\t\t\t    0.314126,0.083393,0.615448,0.072449,0.942632,0.866741,0.517742,0.268323,0.785395,0.262048,0.505459,0.066573,\n\t\t\t    0.725525,0.256460,0.211516,0.774298,0.663464,0.108740,0.545100,0.034916,0.530101,0.727735,0.530025,0.119865,\n\t\t\t    0.664188,0.894243,0.907784,0.210049,0.200046,0.479137,0.291805,0.037104,0.382148,0.373297,0.296940,0.082396,\n\t\t\t    0.362943,0.588721,0.052829,0.179081,0.908342,0.272850,0.362029,0.309346,0.257946,0.920575,0.221863,0.714194,\n\t\t\t    0.869266,0.167484,0.891200,0.605214,0.079281,0.382332,0.336971,0.053785,0.462747,0.153029,0.262432,0.970168,\n\t\t\t    0.915739,0.160088,0.200948,0.961946,0.334296,0.116787,0.285759,0.068257,0.564144,0.619130,0.148424,0.869187,\n\t\t\t    0.539796,0.030449,0.689208,0.336207,0.143027,0.428390,0.894387,0.116755,0.504153,0.568835,0.328954,0.136621,\n\t\t\t    0.450743,0.223517,0.899690,0.151575,0.057297,0.346461,0.172142,0.944294,0.549706,0.087217,0.370584,0.360032,\n\t\t\t    0.059893,0.136062,0.174555,0.434360,0.366714,0.298786,0.134188,0.176377,0.543492,0.357283,0.473318,0.463722,\n\t\t\t    0.616565,0.026764,0.246689,0.920060,0.512725,0.481571,0.704315,0.795718,0.399115,0.136908,0.869919,0.404615,\n\t\t\t    0.557876,0.433744,0.547612,0.023345,0.272516,0.367232,0.896480,0.242147,0.499269,0.341002,0.517882,0.237894,\n\t\t\t    0.556964,0.035363,0.388827,0.103095,0.872977,0.742916,0.572178,0.062916,0.596776,0.611110,0.802837,0.077065,\n\t\t\t    0.072730,0.320091,0.913506,0.142810,0.131823,0.883098,0.053014,0.207176,0.059372,0.334982,0.089019,0.386629,\n\t\t\t    0.240068,0.162573,0.104915,0.846603,0.459154,0.683441,0.141440,0.156641,0.928718,0.192604,0.285676,0.393110,\n\t\t\t    0.457659,0.820361,0.804372,0.083582,0.895782,0.199303,0.689738,0.255882,0.820671,0.299642,0.494013,0.220726,\n\t\t\t    0.967375,0.138665,0.520536,0.573487,0.565171,0.388439,0.273146,0.335229,0.855031,0.054680,0.387066,0.113983,\n\t\t\t    0.437209,0.121843,0.860614,0.024745,0.595198,0.413650,0.408228,0.133477,0.487802,0.443622,0.908761,0.074343,\n\t\t\t    0.292797,0.870708,0.616704,0.032320,0.521859,0.312766,0.856008,0.031820,0.488570,0.167406,0.108164,0.353302,\n\t\t\t    0.330066,0.031358,0.937703,0.942083,0.667093,0.094908,0.889042,0.551797,0.372956,0.555233,0.543844,0.083295,\n\t\t\t    0.717691,0.254099,0.407380,0.504674,0.175802,0.426627,0.588647,0.640607,0.352615,0.016504,0.469307,0.177316,\n\t\t\t    0.879088,0.471948,0.889502,0.238519,0.596504,0.260480,0.388967,0.032008,0.752596,0.145992,0.471917,0.847069,\n\t\t\t    0.878897,0.785544,0.501550,0.131799,0.269629,0.930549,0.952424,0.888968,0.608385,0.245804,0.948674,0.219818,\n\t\t\t    0.753763,0.786074,0.322341,0.412011,0.645737,0.106172,0.524163,0.146190,0.930811,0.170694,0.775982,0.260690,\n\t\t\t    0.315124,0.133072,0.141226,0.389053,0.555149,0.032501,0.129587,0.965277,0.782801,0.262762,0.611128,0.791746,\n\t\t\t    0.739059,0.091411,0.721090,0.933193,0.673934,0.312609,0.419546,0.140116,0.531700,0.132176,0.918390,0.065286,\n\t\t\t    0.357699,0.286126,0.642752,0.209477,0.468260,0.919115,0.696616,0.313509,0.751619,0.097133,0.429909,0.027313,\n\t\t\t    0.491195,0.900013,0.916566,0.438027,0.495967,0.130180,0.823546,0.206244,0.199263,0.529511,0.185808,0.916136,\n\t\t\t    0.351240,0.078263,0.285342,0.361042,0.853357,0.147667,0.124161,0.117801,0.625638,0.148283,0.798392,0.296932,\n\t\t\t    0.170393,0.196412,0.252583,0.417921,0.273105,0.975702,0.260927,0.355935,0.495688,0.062009,0.511740,0.269439,\n\t\t\t    0.457583,0.179689,0.695060,0.835392,0.766718,0.286349,0.584716,0.779858,0.901085,0.165112,0.916514,0.507821,\n\t\t\t    0.850984,0.118737,0.881839,0.490411,0.687924,0.916992,0.343797,0.134279,0.606376,0.040094,0.954150,0.941564,\n\t\t\t    0.661231,0.097043,0.843867,0.066319,0.558086,0.461824,0.856427,0.061141,0.806605,0.102841,0.155136,0.869586,\n\t\t\t    0.470469,0.784659,0.090569,0.215607,0.199732,0.375008,0.689848,0.763766,0.866807,0.796418,0.216138,0.191427,\n\t\t\t    0.170121,0.950665,0.748130,0.190930,0.640088,0.227841,0.898852,0.069249,0.375153,0.738211,0.391348,0.063745,\n\t\t\t    0.303885,0.059884,0.880570,0.193302,0.510725,0.505053,0.506017,0.153867,0.230272,0.707703,0.472636,0.808827,\n\t\t\t    0.902202,0.222609,0.955234,0.179765,0.049325,0.352709,0.552383,0.602420,0.517044,0.139169,0.763387,0.883317,\n\t\t\t    0.767808,0.172927,0.909459,0.155482,0.796415,0.258474,0.243265,0.367740,0.250932,0.510026,0.055155,0.215457,\n\t\t\t    0.506436,0.177456,0.430049,0.011205,0.773932,0.317021,0.157626,0.113083,0.613075,0.058407,0.795256,0.262702,\n\t\t\t    0.041634,0.265467,0.906807,0.069305,0.507134,0.122196,0.518176,0.880321,0.946721,0.141205,0.921182,0.206281,\n\t\t\t    0.534352,0.125322,0.545323,0.698768,0.696723,0.763508,0.489128,0.115970,0.024151,0.371780,0.796205,0.212925,\n\t\t\t    0.500573,0.191553,0.330153,0.029587,0.666256,0.110317,0.886013,0.248707,0.943416,0.748678,0.513973,0.172850,\n\t\t\t    0.820002,0.084294,0.145142,0.722277,0.517044,0.183178,0.528908,0.102976,0.858381,0.031360,0.132822,0.356985,\n\t\t\t    0.719896,0.295848,0.081581,0.869727,0.155896,0.181664,0.825282,0.735761,0.977563,0.230285,0.239671,0.966277,\n\t\t\t    0.034053,0.321907,0.881901,0.502151,0.515116,0.637134,0.528629,0.085388,0.350424,0.649677,0.401836,0.663690,\n\t\t\t    0.896277,0.876834,0.027907,0.842685,0.893270,0.266151,0.602095,0.246363,0.515788,0.263019,0.395251,0.074122,\n\t\t\t    0.553056,0.052629,0.494572,0.068290,0.214142,0.897338,0.297132,0.050641,0.817718,0.326265,0.806744,0.065063,\n\t\t\t    0.507832,0.067773,0.456746,0.769252,0.271453,0.194847,0.884897,0.142154,0.802142,0.204833,0.199670,0.585145,\n\t\t\t    0.483265,0.124275,0.501575,0.894058,0.941757,0.965804,0.506069,0.601932,0.280515,0.614432,0.696006,0.323809,\n\t\t\t    0.374713,0.502013,0.821677,0.070129,0.618857,0.841650,0.746595,0.084573,0.437762,0.181504,0.240995,0.220876,\n\t\t\t    0.873174,0.043417,0.837919,0.291938,0.952443,0.138400,0.748576,0.277579,0.529885,0.198951,0.803500,0.258430,\n\t\t\t    0.882803,0.119951,0.562796,0.574592,0.426147,0.670353,0.258334,0.953567,0.817693,0.305060,0.526396,0.123968,\n\t\t\t    0.486755,0.154704,0.978819,0.230564,0.926485,0.129734,0.557104,0.125601,0.522906,0.089017,0.534950,0.446659,\n\t\t\t    0.902062,0.195954,0.272474,0.499810,0.802697,0.169438,0.883920,0.103064,0.301893,0.081464,0.754518,0.215461,\n\t\t\t    0.888633,0.909330,0.499457,0.127877,0.942115,0.227215,0.960537,0.217725,0.047784,0.114138,0.670987,0.257027,\n\t\t\t    0.558220,0.040681,0.525000,0.250736,0.092420,0.598334,0.528209,0.576845,0.738107,0.721497,0.595666,0.211979,\n\t\t\t    0.636420,0.630493,0.903179,0.145992,0.529606,0.076902,0.269394,0.434043,0.605683,0.659958,0.350175,0.106442,\n\t\t\t    0.539796,0.032752,0.349787,0.110722,0.255778,0.495448,0.124445,0.464911,0.039353,0.815725,0.244398,0.445489,\n\t\t\t    0.248066,0.197951,0.777316,0.244997,0.910436,0.159529,0.740873,0.185208,0.938766,0.147806,0.580797,0.430749,\n\t\t\t    0.752509,0.214921,0.572318,0.058966,0.786770,0.337446,0.785392,0.156040,0.485567,0.584703,0.977144,0.222051,\n\t\t\t    0.485499,0.222261,0.492199,0.224913,0.624661,0.026248,0.596225,0.266909,0.856148,0.187999,0.302065,0.045088,\n\t\t\t    0.917832,0.072920,0.583485,0.155542,0.341705,0.052966,0.813291,0.201285,0.317656,0.083538,0.862428,0.032183,\n\t\t\t    0.540306,0.786560,0.229384,0.296301,0.417361,0.141616,0.545910,0.412047,0.781239,0.221526,0.836749,0.096854,\n\t\t\t    0.891475,0.826745,0.286016,0.695032,0.958444,0.225680,0.493595,0.115328,0.049063,0.818556,0.338451,0.425150,\n\t\t\t    0.924112,0.132316,0.834051,0.287747,0.625498,0.026513,0.904016,0.256382,0.463520,0.396428,0.164813,0.154516,\n\t\t\t    0.950341,0.941335,0.757201,0.083289,0.900946,0.275920,0.511439,0.588010,0.138575,0.771430,0.445087,0.285768,\n\t\t\t    0.837451,0.668461,0.248791,0.350602,0.517542,0.873478,0.844146,0.052670,0.546496,0.078954,0.205967,0.884694,\n\t\t\t    0.168253,0.718102,0.949791,0.213538,0.795562,0.220694,0.025144,0.369136,0.814839,0.158832,0.872615,0.136042,\n\t\t\t    0.214724,0.425476,0.078369,0.339373,0.487732,0.147865,0.548764,0.372399,0.865219,0.023447,0.886571,0.116350,\n\t\t\t    0.228465,0.509368,0.689772,0.305745,0.549566,0.030505,0.853920,0.734793,0.434783,0.016878,0.574830,0.074361,\n\t\t\t    0.521231,0.087915,0.132977,0.158075,0.481730,0.151912,0.464788,0.544323,0.460418,0.835905,0.032696,0.378157,\n\t\t\t    0.788235,0.262677,0.087950,0.857548,0.288038,0.794644,0.580193,0.930738,0.894387,0.259173,0.508111,0.228542,\n\t\t\t    0.513834,0.266089,0.023676,0.827791,0.486137,0.373287,0.596644,0.257126,0.137792,0.286412,0.676837,0.878388,\n\t\t\t    0.914762,0.131841,0.078713,0.323595,0.604003,0.050982,0.600788,0.880748,0.104133,0.706862,0.128079,0.315067,\n\t\t\t    0.767110,0.106260,0.671318,0.233857,0.226704,0.774246,0.299172,0.030322,0.896619,0.073492,0.871360,0.039594,\n\t\t\t    0.861032,0.049739,0.129809,0.496574,0.944627,0.214515,0.949651,0.149342,0.509786,0.263577,0.905272,0.065314,\n\t\t\t    0.417613,0.007355,0.109202,0.143407,0.560297,0.412678,0.440833,0.232032,0.796164,0.298743,0.398843,0.108217,\n\t\t\t    0.779810,0.097859,0.261501,0.506698,0.619077,0.033353,0.914204,0.071455,0.415751,0.131311,0.683933,0.323825,\n\t\t\t    0.305077,0.115120,0.211401,0.740201,0.477682,0.191553,0.917134,0.062104,0.476007,0.182341,0.626196,0.037191,\n\t\t\t    0.959544,0.495027,0.866802,0.785197,0.658160,0.085109,0.335448,0.035123,0.488421,0.819690,0.524487,0.557273,\n\t\t\t    0.981052,0.222191,0.798650,0.037458,0.037554,0.357441,0.440663,0.077997,0.781821,0.334863,0.269329,0.858009,\n\t\t\t    0.093442,0.843917,0.381180,0.444372,0.565060,0.069462,0.672118,0.161962,0.672369,0.256628,0.426177,0.177735,\n\t\t\t    0.888983,0.754719,0.931090,0.162460,0.952024,0.188139,0.045679,0.345796,0.856566,0.204606,0.665837,0.090176,\n\t\t\t    0.221284,0.502059,0.416613,0.021809,0.467698,0.764678,0.546190,0.545094,0.281721,0.386849,0.662155,0.850778,\n\t\t\t    0.445819,0.361383,0.968910,0.186185,0.687063,0.325014,0.236508,0.338641,0.829632,0.111801,0.934138,0.781472,\n\t\t\t    0.644994,0.271437,0.909459,0.061030,0.506855,0.135595,0.920344,0.127850,0.925508,0.119197,0.487611,0.862911,\n\t\t\t    0.683719,0.320486,0.174494,0.499131,0.342627,0.111895,0.573643,0.455814,0.957745,0.147388,0.775182,0.306602,\n\t\t\t    0.279442,0.898871,0.483126,0.146469,0.856980,0.748074,0.801860,0.031081,0.901365,0.149481,0.203330,0.182053,\n\t\t\t    0.411560,0.141120,0.917832,0.129636,0.129537,0.466828,0.276049,0.520281,0.786715,0.332282,0.912389,0.079395,\n\t\t\t    0.144821,0.373965,0.476188,0.882669,0.593093,0.659420,0.890898,0.186883,0.694947,0.881279,0.904574,0.133334,\n\t\t\t    0.517044,0.071626,0.522963,0.922340,0.497294,0.760954,0.488131,0.771272,0.080089,0.682264,0.319003,0.079425,\n\t\t\t    0.025758,0.234506,0.567293,0.177456,0.131640,0.910711,0.777024,0.317649,0.585694,0.605791,0.832815,0.238585,\n\t\t\t    0.695190,0.867156,0.511600,0.157775,0.437403,0.111246,0.663387,0.887427,0.139862,0.299644,0.781292,0.308082,\n\t\t\t    0.388148,0.119637,0.708093,0.323902,0.279897,0.394221,0.110962,0.701730,0.422227,0.490141,0.523186,0.120270,\n\t\t\t    0.542094,0.322613,0.945325,0.209630,0.254295,0.709388,0.945325,0.177114,0.590184,0.138317,0.197608,0.715829,\n\t\t\t    0.541470,0.084160,0.030279,0.362176,0.181339,0.517529,0.161074,0.444973,0.810964,0.754093,0.946442,0.173904,\n\t\t\t    0.918530,0.115206,0.318178,0.030823,0.235995,0.328537,0.417934,0.142712,0.236264,0.139373,0.422655,0.660155,\n\t\t\t    0.204366,0.358570,0.123289,0.866063,0.587951,0.064730,0.911273,0.124514,0.316387,0.146982,0.338445,0.081649,\n\t\t\t    0.464562,0.189460,0.321610,0.389412,0.142186,0.138629,0.508669,0.187366,0.764598,0.103944,0.448789,0.139364,\n\t\t\t    0.054777,0.186663,0.632378,0.225738,0.321368,0.167905,0.689838,0.244317,0.793347,0.083038,0.427712,0.175781,\n\t\t\t    0.939682,0.852108,0.337052,0.117567,0.174827,0.883976,0.032892,0.196521,0.917693,0.064086,0.052132,0.339886,\n\t\t\t    0.863049,0.905051,0.336641,0.086775,0.503784,0.139839,0.489686,0.197834,0.544821,0.041867,0.521840,0.375259,\n\t\t\t    0.653414,0.099207,0.543347,0.481948,0.266724,0.190692,0.986634,0.181859,0.915981,0.520732,0.467214,0.219330,\n\t\t\t    0.487592,0.171035,0.268626,0.189825,0.912389,0.128478,0.444462,0.140453,0.257645,0.170450,0.904016,0.855985,\n\t\t\t    0.495688,0.132748,0.297345,0.853786,0.263624,0.159062,0.754969,0.081670,0.556888,0.335929,0.448510,0.224076,\n\t\t\t    0.556240,0.460019,0.673793,0.077502,0.195810,0.926830,0.952861,0.221074,0.679993,0.208047,0.729375,0.930706,\n\t\t\t    0.554312,0.210257,0.686629,0.333010,0.134766,0.108328,0.414510,0.332952,0.511461,0.135247,0.487620,0.502276,\n\t\t\t    0.567014,0.053885,0.081500,0.678074,0.039234,0.337688,0.118611,0.695734,0.499178,0.123466,0.357474,0.113542,\n\t\t\t    0.078828,0.145249,0.773929,0.263641,0.554211,0.400480,0.459397,0.139825,0.893815,0.495127,0.911273,0.131883,\n\t\t\t    0.950412,0.966807,0.725207,0.268946,0.122397,0.668345,0.604003,0.060362,0.793313,0.251745,0.818940,0.208334,\n\t\t\t    0.895224,0.250660,0.879454,0.161483,0.486169,0.850973,0.166259,0.960791,0.432737,0.221284,0.911413,0.122700,\n\t\t\t    0.855590,0.163576,0.282908,0.056191,0.825790,0.692050,0.843399,0.856476,0.085362,0.312625,0.518858,0.140397,\n\t\t\t    0.791393,0.157017,0.591161,0.076399,0.512581,0.738366,0.277015,0.705003,0.250470,0.613046,0.536864,0.031566,\n\t\t\t    0.261529,0.414837,0.693319,0.326329,0.944516,0.814364,0.505180,0.138066,0.847356,0.111424,0.312094,0.543759,\n\t\t\t    0.128747,0.322806,0.737423,0.302112,0.044112,0.351566,0.772960,0.204320,0.462747,0.189041,0.666116,0.081717,\n\t\t\t    0.148122,0.164706,0.806186,0.163437,0.881966,0.152551,0.440763,0.656822,0.856846,0.095068,0.466007,0.462861,\n\t\t\t    0.915281,0.559544,0.051711,0.367050,0.563106,0.065610,0.828784,0.310356,0.728378,0.876778,0.144000,0.729789,\n\t\t\t    0.565395,0.467980,0.799069,0.038840,0.491128,0.640310,0.796138,0.038826,0.464980,0.212909,0.415907,0.758143,\n\t\t\t    0.613634,0.056132,0.498954,0.899651,0.443485,0.174106,0.308932,0.025980,0.305880,0.878443,0.502946,0.112551,\n\t\t\t    0.455629,0.135819,0.610423,0.066154,0.583066,0.070328,0.487182,0.472823,0.880152,0.247311,0.237192,0.612184,\n\t\t\t    0.798371,0.053814,0.039727,0.173906,0.749688,0.249524,0.659277,0.123201,0.208177,0.207132,0.399592,0.021857,\n\t\t\t    0.583066,0.127137,0.906249,0.129538,0.515458,0.852322,0.555149,0.036479,0.956492,0.910596,0.910296,0.118625,\n\t\t\t    0.291594,0.092075,0.282325,0.409529,0.964721,0.922334,0.500373,0.494012,0.957717,0.537383,0.645135,0.262326,\n\t\t\t    0.948239,0.750171,0.472378,0.195880,0.845899,0.713109,0.590680,0.813691,0.788183,0.026349,0.087585,0.391657,\n\t\t\t    0.904922,0.500624,0.468470,0.218772,0.021943,0.195923,0.056133,0.316118,0.488290,0.178014,0.253617,0.167476,\n\t\t\t    0.521915,0.904064,0.732464,0.287262,0.317650,0.129252,0.029768,0.158414,0.804860,0.325579,0.036720,0.346990,\n\t\t\t    0.185053,0.450883,0.501830,0.270556,0.746595,0.110405,0.620054,0.029430,0.310139,0.079471,0.353404,0.026415,\n\t\t\t    0.517420,0.541536,0.716567,0.219555,0.717201,0.296758,0.939743,0.229308,0.134419,0.500843,0.905970,0.135679,\n\t\t\t    0.904156,0.074999,0.897178,0.226098,0.339653,0.146022,0.546914,0.032194,0.863651,0.775598,0.309613,0.074061,\n\t\t\t    0.509507,0.079331,0.889601,0.784081,0.156446,0.507481,0.414118,0.084619,0.541219,0.631914,0.521790,0.113528,\n\t\t\t    0.915599,0.144876,0.135297,0.340862,0.968428,0.920401,0.165138,0.163546,0.542866,0.019241,0.595988,0.845315,\n\t\t\t    0.318936,0.163843,0.917134,0.132832,0.817211,0.055545,0.430644,0.680994,0.923833,0.119337,0.687018,0.315148,\n\t\t\t    0.421859,0.017816,0.511740,0.165033,0.541105,0.723825,0.885873,0.084559,0.489407,0.125378,0.268588,0.199931,\n\t\t\t    0.776171,0.263302,0.398581,0.015563,0.145728,0.299073,0.878338,0.104585,0.870581,0.759811,0.234684,0.513190,\n\t\t\t    0.947139,0.219539,0.757201,0.096421,0.697033,0.746406,0.897596,0.075209,0.697541,0.277374,0.236946,0.142980,\n\t\t\t    0.219848,0.308192,0.266581,0.500884,0.391562,0.107550,0.670878,0.240995,0.579538,0.899753,0.761460,0.325991,\n\t\t\t    0.781810,0.327132,0.023320,0.168802,0.321977,0.137784,0.965701,0.143466,0.821285,0.328109,0.754271,0.092290,\n\t\t\t    0.608245,0.242310,0.333451,0.033808,0.140375,0.306856,0.079214,0.690344,0.499876,0.073147,0.903994,0.513794,\n\t\t\t    0.858099,0.681835,0.864663,0.595220,0.720351,0.313864,0.016219,0.203035,0.719748,0.228675,0.183430,0.193525,\n\t\t\t    0.168066,0.392532,0.791812,0.033369,0.261209,0.795534,0.939324,0.207118,0.050629,0.100054,0.609307,0.033255,\n\t\t\t    0.351778,0.098438,0.567732,0.428545,0.084347,0.307759,0.906947,0.194279,0.907644,0.141289,0.576699,0.429406,\n\t\t\t    0.398250,0.442233,0.498669,0.932278,0.072824,0.241186,0.343939,0.628198,0.024471,0.226423,0.727368,0.235166,\n\t\t\t    0.677940,0.737808,0.848053,0.087141,0.468809,0.900036,0.906947,0.255266,0.674631,0.085695,0.293771,0.837161,\n\t\t\t    0.549008,0.026304,0.069261,0.356302,0.942534,0.214236,0.850565,0.043920,0.511393,0.717245,0.480090,0.839221,\n\t\t\t    0.250587,0.495595,0.933881,0.187162,0.219144,0.774243,0.686571,0.735246,0.838424,0.057178,0.261219,0.380509,\n\t\t\t    0.963886,0.226238,0.776199,0.300850,0.650762,0.163916,0.333410,0.652027,0.357377,0.554527,0.332882,0.466434,\n\t\t\t    0.865079,0.033886,0.137166,0.419104,0.352396,0.050436,0.749107,0.093016,0.254334,0.172960,0.925926,0.174741,\n\t\t\t    0.695180,0.851083,0.924252,0.119769,0.140745,0.942991,0.929974,0.219399,0.550038,0.552588,0.095421,0.173458,\n\t\t\t    0.444183,0.137354,0.514252,0.124457,0.552091,0.739669,0.439307,0.537211,0.167460,0.233270,0.673905,0.755618,\n\t\t\t    0.553074,0.424748,0.390656,0.125925,0.914622,0.127264,0.810283,0.289553,0.206331,0.350681,0.601816,0.253492,\n\t\t\t    0.498459,0.899549,0.268089,0.193361,0.038886,0.334324,0.097461,0.786055,0.363580,0.741483,0.838005,0.074455,\n\t\t\t    0.494625,0.306435,0.155599,0.773513,0.783857,0.162460,0.058620,0.323047,0.415613,0.145933,0.777068,0.250940,\n\t\t\t    0.541944,0.585719,0.360951,0.138121,0.913366,0.268105,0.391264,0.049690,0.313679,0.961206,0.062153,0.375367,\n\t\t\t    0.088839,0.621461,0.743943,0.098836,0.574412,0.057081,0.357482,0.455823,0.665558,0.078270,0.111559,0.118666,\n\t\t\t    0.325811,0.400903,0.326876,0.939437,0.328220,0.123899,0.829213,0.077916,0.471760,0.852825,0.177650,0.774402,\n\t\t\t    0.878362,0.367991,0.334891,0.083731,0.792509,0.036677,0.925508,0.134423,0.274426,0.957835,0.938475,0.524045,\n\t\t\t    0.560314,0.177595,0.672653,0.818554,0.529327,0.127905,0.657323,0.113528,0.927183,0.199443,0.393793,0.024106,\n\t\t\t    0.974493,0.178649,0.146438,0.332959,0.460235,0.224215,0.232354,0.145558,0.889642,0.228052,0.560035,0.039801,\n\t\t\t    0.273143,0.505027,0.497782,0.184156,0.510205,0.069155,0.256904,0.444932,0.480195,0.226728,0.591039,0.365648,\n\t\t\t    0.271747,0.127491,0.831276,0.232736,0.947697,0.180742,0.875071,0.617378,0.651041,0.092298,0.274872,0.973569,\n\t\t\t    0.791374,0.256930,0.899598,0.425582,0.053410,0.775873,0.029912,0.228281,0.953411,0.916676,0.966677,0.184091,\n\t\t\t    0.514498,0.571435,0.386457,0.362477,0.293008,0.054248,0.206998,0.512120,0.404474,0.139657,0.118098,0.304708,\n\t\t\t    0.782880,0.130655,0.751033,0.328530,0.394629,0.132068,0.587623,0.665678,0.128238,0.922448,0.145541,0.793522,\n\t\t\t    0.377025,0.301466,0.539742,0.458706,0.244157,0.219717,0.452639,0.802477,0.503924,0.065819,0.476526,0.432939,\n\t\t\t    0.565702,0.610695,0.034631,0.325339,0.196494,0.204201,0.433183,0.690673,0.607492,0.142923,0.468191,0.214445,\n\t\t\t    0.624659,0.872284,0.976446,0.231541,0.916855,0.139419,0.459748,0.319459,0.262491,0.513495,0.521929,0.137326,\n\t\t\t    0.474053,0.209420,0.067472,0.328883,0.567409,0.370543,0.387744,0.621532,0.655153,0.793365,0.920623,0.114787,\n\t\t\t    0.266502,0.183186,0.739412,0.309594,0.327561,0.122835,0.892498,0.531591,0.178582,0.235938,0.708635,0.847075,\n\t\t\t    0.037741,0.844386,0.556840,0.380870,0.150699,0.836337,0.541906,0.488668,0.073923,0.248920,0.524337,0.736580,\n\t\t\t    0.248838,0.173070,0.903876,0.250381,0.133711,0.231352,0.465678,0.229659,0.795859,0.089374,0.247940,0.166973,\n\t\t\t    0.523046,0.233428,0.215682,0.290876,0.494292,0.115119,0.510065,0.130864,0.194285,0.494357,0.060086,0.229307,\n\t\t\t    0.806047,0.038798,0.820543,0.716897,0.291611,0.898072,0.405968,0.112777,0.642471,0.237653,0.741153,0.094872,\n\t\t\t    0.923554,0.136446,0.414100,0.141236,0.697317,0.335379,0.114080,0.460384,0.497363,0.116961,0.510572,0.642050,\n\t\t\t    0.429430,0.121177,0.794107,0.300684,0.320578,0.063521,0.921740,0.113810,0.760292,0.908676,0.114006,0.896138,\n\t\t\t    0.695145,0.843075,0.273708,0.509045,0.948814,0.141847,0.805405,0.307858,0.528071,0.089143,0.490245,0.137522,\n\t\t\t    0.545798,0.080531,0.544821,0.199789,0.881826,0.078084,0.435069,0.029638,0.437778,0.037873,0.164740,0.505610,\n\t\t\t    0.493874,0.165033,0.519696,0.246827,0.370442,0.049353,0.334292,0.119534,0.795148,0.245719,0.213433,0.175151,\n\t\t\t    0.268368,0.710067,0.469587,0.229519,0.098215,0.321025,0.070810,0.100434,0.357776,0.128829,0.466935,0.147446,\n\t\t\t    0.547613,0.556661,0.933602,0.161344,0.267666,0.771246,0.557899,0.417731,0.217438,0.461334,0.928461,0.532150,\n\t\t\t    0.509925,0.075869,0.311964,0.980688,0.345046,0.059573,0.341224,0.083084,0.541080,0.359547,0.868314,0.675521,\n\t\t\t    0.567991,0.077153,0.594930,0.067313,0.433296,0.229519,0.803814,0.057680,0.829896,0.910661,0.482955,0.804606,\n\t\t\t    0.559629,0.462204,0.090954,0.882338,0.109598,0.346841,0.513136,0.071109,0.501132,0.116236,0.445439,0.138583,\n\t\t\t    0.167493,0.560837,0.574052,0.874240,0.803475,0.714646,0.759789,0.219941,0.462468,0.136405,0.561966,0.933587,\n\t\t\t    0.235341,0.796147,0.902062,0.066891,0.032077,0.175034,0.225719,0.194706,0.128142,0.503118,0.028210,0.364332,\n\t\t\t    0.262002,0.154896,0.401906,0.423584,0.847774,0.055433,0.499317,0.135554,0.057290,0.883453,0.907366,0.134716,\n\t\t\t    0.926624,0.124584,0.220573,0.720562,0.205126,0.871596,0.154735,0.145793,0.035479,0.321238,0.595761,0.441478,\n\t\t\t    0.770041,0.108772,0.646653,0.753174,0.761690,0.314124,0.340561,0.019325,0.763900,0.115150,0.494990,0.129552,\n\t\t\t    0.248118,0.385907,0.918949,0.126384,0.184877,0.233146,0.786718,0.342831,0.219588,0.728521,0.786742,0.339858,\n\t\t\t    0.140668,0.501932,0.596504,0.272920,0.280933,0.910438,0.270380,0.691634,0.601769,0.132441,0.307274,0.023718,\n\t\t\t    0.173770,0.510422,0.762037,0.901119,0.916012,0.876384,0.815536,0.066263,0.591366,0.650640,0.624661,0.029821,\n\t\t\t    0.555734,0.477444,0.341624,0.017496,0.515229,0.075115,0.539348,0.399049,0.605310,0.213796,0.924531,0.178090,\n\t\t\t    0.596924,0.250416,0.564920,0.050507,0.429806,0.183178,0.107623,0.517650,0.484875,0.916509\n\t\t\tUVIndex: 1769,9012,1836,1258,6675,5242,2267,6411,10719,2356,9295,4360,9287,7675,2621,5455,8579,2233,6315,4915,7974,7494,9420,9931,7347,4156,60,1875,68,7615,6366,7127,2033,5087,6946,916,463,923,4137,4006,9278,4360,9295,247,8779,9962,7827,10401,3317,9158,1155,2126,5215,7255,4133,3123,8709,4542,6366,7615,5632,618,9420,7494,\n\t\t\t         9517,2786,2267,5242,382,3499,2566,1659,882,6762,438,11,9126,438,6762,5367,1749,1258,1836,6305,5088,6411,2267,7451,4706,10117,3125,2256,10341,6859,212,6891,2527,4166,7461,3005,1654,105,7493,3965,10117,10341,6891,3125,9465,6334,6371,2790,2717,8741,6371,9506,2263,6605,6910,1777,9949,4602,10627,9898,5639,8380,8666,1264,\n\t\t\t         5745,8862,5044,6948,2155,10568,7418,1901,8380,2155,1901,8666,8666,1901,3601,6226,1901,7418,351,3601,9012,10719,4360,1836,2233,9287,5455,6315,4156,2033,916,60,7221,6578,10269,9773,6305,1836,4360,9278,10496,10088,8527,4140,2678,7753,2374,3407,6948,5044,5140,8237,1264,8666,6226,8150,9898,10627,4166,2527,1777,6910,6040,1639,\n\t\t\t         9506,6371,6334,5875,2790,6371,8741,3607,8288,5453,624,2487,3615,7493,105,8973,2256,3125,8380,5639,3005,7461,2366,8897,3125,6891,2155,8380,1668,10161,6605,2263,6891,212,10568,2155,3965,7493,6334,9465,6332,10339,10117,4706,4606,2600,6859,10341,6045,5197,2543,6011,6399,9917,4071,9042,9158,266,103,1155,10424,5215,3123,7451,\n\t\t\t         4242,9126,5367,8127,6181,4863,7434,7825,10773,4389,3123,4133,7825,7434,9917,6399,7753,3735,9609,2374,7069,3731,4324,7734,849,4639,1760,9196,4547,2446,1244,5443,4438,8147,4772,4818,6214,1467,3218,4918,9626,4329,3853,1890,6765,850,10440,1978,7127,6366,2446,4547,10356,7069,7734,6165,4194,10356,6165,6754,7434,6305,9278,9917,\n\t\t\t         1428,1463,1244,2446,850,7221,9773,10440,3046,5821,677,2739,2382,4101,105,1654,4863,1749,6305,7434,10339,4606,10341,10117,7734,4324,2356,10719,9622,6011,2543,7785,1875,60,10356,4194,916,6946,3731,7069,4542,1428,2446,6366,3183,4818,4772,5603,1449,4101,3218,1467,5443,1244,5242,6675,5821,382,1659,677,4329,463,4006,3853,\n\t\t\t         60,916,7069,10356,2786,10424,7451,2267,266,8779,10401,103,9917,9278,247,4071,10088,6765,1978,8527,347,3046,2739,4649,4389,5088,7451,3123,4649,4242,8127,347,3735,10496,4140,9609,9962,9626,1890,7827,6754,6165,9012,1769,6165,7734,10719,9012,1463,9517,5242,1244,6461,5052,4156,7347,3552,10662,7615,68,4774,4678,5087,2033,\n\t\t\t         7918,8709,7615,10662,5052,4774,2033,4156,3499,3437,8558,2566,6578,8987,5611,10269,923,2087,4043,4137,3437,6214,4918,8558,8987,9622,7785,5611,2087,3183,5603,4043,9367,7805,5052,6461,9139,9257,10662,3552,45,392,4678,4774,66,7918,10662,9257,7805,45,4774,5052,9196,1760,10161,1668,8237,5140,5453,8288,5875,6334,7493,3615,\n\t\t\t         9773,10269,4598,7961,4140,8527,3028,2025,3407,2374,4447,10521,5140,1025,58,5453,8862,9165,6698,5044,5044,6698,1025,5140,5453,58,7679,624,2374,9609,3964,4447,5197,10506,5067,2543,1978,10440,9346,2613,7785,2543,5067,8554,10440,9773,7961,9346,9609,4140,2025,3964,8527,1978,2613,3028,10269,5611,10016,4598,5611,7785,8554,10016,\n\t\t\t         1011,7674,10496,3735,6063,5864,7753,2678,5864,1011,3735,7753,3789,1560,6011,9622,3996,6948,8237,9995,2331,3476,6765,10088,8825,9963,8987,6578,5787,8288,2487,5739,10039,8825,6578,7221,7674,2331,10088,10496,9385,10039,7221,850,9995,8237,8288,5787,5060,5745,6948,3996,9963,3789,9622,8987,4809,6045,6011,1560,3476,9385,850,6765,\n\t\t\t         1042,9474,1495,6662,6226,3601,8367,2560,7722,1495,9474,5514,8150,6226,2560,5450,10378,5053,8741,2717,1639,6040,2824,8873,1018,1639,8873,6439,3607,8741,5053,4935,2753,10378,2717,5061,3601,351,10471,8367,6439,8873,9628,7040,2753,7040,9628,10378,10378,9628,8855,5053,9628,8873,2824,8855,534,5450,2560,8367,534,4935,5053,8855,\n\t\t\t         9139,392,10339,6332,45,7805,2600,4606,2487,624,5197,6045,66,9257,4639,849,8897,2366,8147,4438,9367,3218,4101,2382,392,45,4606,10339,8973,105,4101,1449,624,7679,10506,5197,5739,2487,6045,4809,4544,6986,1660,1928,7086,1079,7618,6196,9736,4048,6403,130,8745,6594,9254,3430,1786,4143,10541,7372,79,4391,5525,6407,\n\t\t\t         3277,1743,4511,3444,4064,4984,6592,4406,6010,9213,4461,1462,2884,5589,1290,7043,9334,130,6403,9831,7844,9265,4573,6254,5024,2065,8722,7106,4871,9479,1403,839,9936,9010,6592,4984,2272,2846,5525,4391,9349,3286,7618,1079,1448,8201,3630,10497,2206,1255,2365,4490,7641,2365,1255,10504,10742,1928,1660,5013,4696,6196,7618,9493,\n\t\t\t         3991,7931,6394,7259,10512,10007,3850,9555,8255,3354,6700,3519,3841,525,2283,8530,7931,10512,9555,6394,7108,2204,6086,3592,9157,10048,6086,1488,8383,5345,9046,9211,4646,10251,9592,8637,4683,1970,2085,2809,2958,7141,1199,5078,7068,9264,6085,588,1970,7068,588,2085,2085,588,2788,5153,588,6085,2481,2788,6986,9736,130,1660,\n\t\t\t         4143,8745,3430,10541,1743,6010,1462,4511,9853,5808,2502,6889,5013,1660,130,9334,3359,8679,9633,1829,2215,4307,10501,5362,5078,1199,1869,4366,2809,2085,5153,482,8637,9592,3354,8255,9211,9046,8018,799,1488,6086,2204,412,3592,6086,10048,3610,4692,1585,10578,8100,9739,2283,525,6839,7259,6394,1970,4683,3519,6700,6942,3378,\n\t\t\t         6394,9555,7068,1970,2750,379,5345,8383,9555,3850,9264,7068,8530,2283,2204,7108,993,2341,7931,3991,1862,7910,10007,10512,1459,5334,2729,6699,5560,6437,3058,631,2065,5424,8953,8722,2812,4871,839,9493,6962,7641,10504,10035,7552,5343,3714,9829,1492,6994,839,1403,9829,3714,6437,5560,4307,1808,6696,10501,3739,10086,4814,8736,\n\t\t\t         5141,2817,5187,4489,593,9071,2388,585,686,6053,828,1106,8388,9747,3678,5245,1903,9232,4400,6024,10592,167,4001,8538,4406,6592,9071,593,4885,3739,8736,7832,7509,4885,7832,1989,3714,5013,9334,6437,7700,6858,2388,9071,167,9853,6889,4001,3960,4067,109,3655,8067,9892,525,3841,5343,10742,5013,3714,2341,1862,10512,7931,\n\t\t\t         8736,4814,4048,9736,639,6699,2729,499,3444,4511,4885,7509,1462,4461,10086,3739,9010,7700,9071,6592,10141,1106,828,8123,2376,9892,3678,9747,585,2388,1079,7086,4067,1448,10497,109,9232,2884,7043,4400,4511,1462,3739,4885,3286,2812,9493,7618,5424,7844,6254,8953,6437,9334,9831,3058,8679,10592,8538,9633,6373,3960,3655,5221,\n\t\t\t         6994,4696,9493,839,5221,6962,10035,6373,1808,3359,1829,6696,9265,1903,6024,4573,1989,7832,6986,4544,7832,8736,9736,6986,6858,9349,1079,2388,6453,3556,1743,3277,4795,3889,4984,4064,8742,2854,9213,6010,9553,9936,4984,3889,3556,8742,6010,1743,8201,2055,5649,3630,5808,8404,4417,2502,5589,4561,8570,1290,2055,8388,5245,5649,\n\t\t\t         8404,639,499,4417,4561,10141,8123,8570,636,1824,3556,6453,8621,10085,3889,4795,9490,7269,2854,8742,9144,9553,3889,10085,1824,9490,8742,3556,4489,5187,379,2750,4366,1869,1585,4692,412,2204,2283,9739,6889,2502,41,5991,1829,9633,9352,7500,5362,10501,3301,9724,1869,8179,4563,1585,7141,5335,3999,1199,1199,3999,8179,1869,\n\t\t\t         1585,4563,1105,10578,10501,6696,5992,3301,5334,3308,8039,2729,8538,4001,10130,4430,499,2729,8039,9389,4001,6889,5991,10130,6696,1829,7500,5992,9633,8538,4430,9352,2502,4417,10601,41,4417,499,9389,10601,4072,7617,3359,1808,1551,6702,4307,2215,6702,4072,1808,4307,7985,4263,6699,639,8739,5078,4366,4735,10203,1197,10592,8679,\n\t\t\t         2309,8515,8404,5808,524,4692,8100,4441,4603,2309,5808,9853,7617,10203,8679,3359,6150,4603,9853,167,4735,4366,4692,524,1123,2958,5078,8739,8515,7985,639,8404,9408,1459,6699,4263,1197,6150,167,10592,8642,1490,2723,6535,5153,2788,318,7246,8319,2723,1490,7189,482,5153,7246,3866,3092,6973,10048,9157,799,8018,4078,6048,\n\t\t\t         260,799,6048,6627,3610,10048,6973,5666,9620,3092,9157,7760,2788,2481,1547,318,6627,6048,8806,3078,9620,3078,8806,3092,3092,8806,675,6973,8806,6048,4078,675,8113,3866,7246,318,8113,5666,6973,675,8621,7269,2341,993,9490,1824,7910,1862,8100,10578,5334,1459,9144,10085,2817,5141,3378,6942,6053,686,636,3678,9892,8067,\n\t\t\t         7269,9490,1862,2341,6839,525,9892,2376,10578,1105,3308,5334,4441,8100,1459,9408,9279,859,1501,1986,4388,4693,2081,1173,7168,4514,3799,1380,9117,7322,2571,2732,424,8770,5099,8014,10437,8863,8346,7934,10084,10443,1715,5675,8220,432,4806,7789,1275,4716,3990,6682,2648,5310,7256,8332,6937,1380,3799,1543,4710,1533,2000,6104,\n\t\t\t         2662,2754,7744,9276,3755,6036,9957,7983,1220,927,4806,432,3747,6268,8346,8863,9438,3076,2081,4693,7073,5807,3373,4523,8848,871,7812,5043,2218,7812,871,1633,2896,1986,1501,7004,4961,1173,2081,6264,6684,5488,9743,6326,3415,8802,9375,3474,2734,10455,6173,3182,1376,10735,10091,7929,5488,3415,3474,9743,7581,4084,9214,5218,\n\t\t\t         7773,1539,9214,2413,10002,6636,6354,1553,7553,8958,7413,9732,620,7293,5721,874,4298,8335,1483,1795,3405,9871,430,7011,7293,3405,7011,5721,5721,7011,18,8648,7011,430,6368,18,859,7168,1380,1501,8770,9117,2732,5099,10443,1275,6682,1715,6911,9988,1265,692,7004,1501,1380,6937,765,6275,3752,8986,9672,8095,6208,6993,\n\t\t\t         1795,1483,3145,5599,874,5721,8648,10101,9732,7413,10455,2734,1553,6354,7311,5034,2413,9214,4084,10147,5218,9214,1539,5732,3708,2519,6565,3445,1432,10091,10735,2779,6326,9743,7293,620,3182,6173,3051,10156,9743,3474,3405,7293,1306,6360,6636,10002,3474,9375,9871,3405,7929,10091,4084,7581,795,3034,5488,6684,10404,744,8802,3415,\n\t\t\t         10682,2905,7720,2595,2686,4437,8371,222,2754,4411,9778,7744,5507,3755,7983,6264,4589,2218,1633,3074,3323,2828,5023,2088,289,263,7983,9957,2088,5023,4437,2686,8095,7458,5781,6208,8859,2143,6170,8036,9347,2561,8629,10169,8871,3764,2171,8992,5724,2293,1437,8115,5104,498,9843,1065,8017,5349,9598,559,8927,4059,5241,6783,\n\t\t\t         7789,4806,3764,8871,6099,8859,8036,10431,9002,6099,10431,9631,5023,7004,6937,4437,7866,1218,2171,3764,4059,6911,692,5241,6378,10688,7536,2122,9607,2109,10735,1376,2828,2896,7004,5023,3034,10404,3415,5488,8036,6170,4514,7168,4327,2595,7720,3530,5675,1715,6099,9002,6682,3990,2143,8859,927,7866,3764,4806,4583,8115,1437,1362,\n\t\t\t         6576,2109,9843,498,8992,2171,4693,4388,10688,7073,4523,7536,5349,2648,8332,9598,1715,6682,8859,6099,3076,5507,6264,2081,4411,4710,6104,9778,4437,6937,1543,8371,6275,8927,6783,3752,2831,6378,2122,8351,263,4961,6264,7983,8351,4589,3074,2831,7458,765,8986,5781,1533,8017,559,2000,9631,10431,859,9279,10431,8036,7168,859,\n\t\t\t         1218,9438,4693,2171,1145,3567,10443,10084,4346,464,432,8220,3614,371,4716,1275,1128,1220,432,464,3567,3614,1275,10443,5807,6651,7179,3373,9988,4893,2625,1265,5310,6824,4714,7256,6651,5104,1065,7179,4893,4327,3530,2625,6824,4583,1362,4714,547,6493,3567,1145,4129,246,464,4346,3518,6570,371,3614,2037,1128,464,246,\n\t\t\t         6493,3518,3614,3567,10169,8629,6360,1306,5599,3145,2519,3708,10147,4084,10091,1432,692,1265,900,5687,8986,3752,8852,10129,6993,6208,5154,6289,3145,7201,3184,2519,8335,4534,5473,1483,1483,5473,7201,3145,2519,3184,9454,6565,6208,5781,836,5154,2905,8168,385,7720,6783,5241,8184,10705,3530,7720,385,10089,5241,692,5687,8184,\n\t\t\t         5781,8986,10129,836,3752,6783,10705,8852,1265,2625,4643,900,2625,3530,10089,4643,4990,2787,765,7458,7953,9595,8095,9672,9595,4990,7458,8095,365,9874,2595,4327,1938,1795,5599,1745,1496,1671,8927,6275,6385,4789,4893,9988,7748,3708,3445,9938,8598,6385,9988,6911,2787,1496,6275,765,546,8598,6911,4059,1745,5599,3708,7748,\n\t\t\t         8876,4298,1795,1938,4789,365,4327,4893,5790,10682,2595,9874,1671,546,4059,8927,9791,10240,2139,9069,8648,18,1911,7627,10107,2139,10240,2180,10101,8648,7627,7487,2189,4095,1539,7773,5034,7311,3225,6132,4468,5034,6132,410,5732,1539,4095,1813,1702,2189,7773,3396,18,6368,1136,1911,410,6132,7587,8085,1702,8085,7587,2189,\n\t\t\t         2189,7587,4887,4095,7587,6132,3225,4887,5803,7487,7627,1911,5803,1813,4095,4887,4129,6570,3034,795,3518,6493,744,10404,3445,6565,2905,10682,2037,246,2561,9347,10156,3051,2293,5724,547,9843,2109,9607,6570,3518,10404,3034,2779,10735,2109,6576,6565,9454,8168,2905,9938,3445,10682,5790,6810,3159,425,4384,934,5407,4908,209,\n\t\t\t         7218,2762,6914,9378,2131,1001,4465,6593,9942,6121,9511,4901,1863,4318,431,6552,5082,6474,6169,5882,2221,242,6281,5712,4615,9227,4924,8441,1005,10628,564,4029,2784,9378,6914,8797,6320,8493,253,1909,6246,1731,4299,8408,2453,4475,3121,2545,10256,9472,6281,242,3077,888,431,4318,10175,4148,4908,5407,2585,1408,8844,5396,\n\t\t\t         6307,4836,2749,10049,3672,2749,4836,607,6992,4384,425,6551,9056,209,4908,8309,3828,1210,6336,5000,9154,2961,7150,7437,8062,5182,887,9950,3524,3449,5346,4009,1210,9154,7437,6336,6956,4097,3914,10212,6894,10637,3914,10677,5826,6356,9198,2818,4248,6894,10677,4623,8706,5502,3000,8640,4362,8487,402,10150,3395,2124,3621,5324,\n\t\t\t         5502,3395,5324,3000,3000,5324,2534,648,5324,3621,7655,2534,3159,7218,9378,425,6121,2131,6593,9511,6474,4615,8441,6169,9081,611,9083,468,6551,425,9378,2784,8836,1887,10480,3657,960,8628,9333,10162,7699,1741,10746,1027,8640,3000,648,1927,5160,2320,5182,8062,2818,9198,4420,1826,10677,3914,4097,9052,10212,3914,10637,5158,\n\t\t\t         3662,141,1419,10149,7692,5346,3449,5233,5000,6336,5502,8706,9950,887,10569,10020,6336,7437,3395,5502,2411,9275,6356,5826,7437,7150,2124,3395,4009,5346,4097,6956,7044,6098,1210,3828,4627,7432,2961,9154,10165,6724,563,1776,1082,4412,7707,7781,1731,5458,5872,4299,3158,2453,2545,8309,9681,3672,607,8132,2813,3201,976,5223,\n\t\t\t         3825,5326,2545,3121,5223,976,4412,1082,8628,9370,9973,9333,9078,9054,5860,6681,8677,3604,9244,1720,7285,10363,6772,6556,1014,10668,165,6963,6324,5897,1708,8269,7804,9715,10416,5539,7292,2804,5270,5268,5712,6281,10363,7285,7965,9078,6681,1564,479,7965,1564,2036,976,6551,2784,4412,6653,4472,6772,10363,2804,9081,468,5270,\n\t\t\t         4308,8318,2742,8196,2710,308,3449,3524,3201,6992,6551,976,6098,4627,9154,1210,6681,5860,2762,7218,4528,1776,563,10423,5882,6169,7965,479,8441,4924,9054,9078,9472,6653,10363,6281,2489,6963,165,7364,234,308,1708,5897,6556,6772,5407,934,8318,2585,5396,2742,9715,1005,4029,10416,6169,8441,9078,7965,4148,3158,8309,4908,\n\t\t\t         5458,6320,1909,5872,4412,2784,8797,7707,1887,7292,5268,10480,9090,4308,8196,6044,5326,9056,8309,2545,6044,9681,8132,9090,9370,8836,3657,9973,8493,7804,5539,253,2036,1564,3159,6810,1564,6681,7218,3159,4472,10175,5407,6772,8137,1487,6474,5082,10221,8420,242,2221,4432,3543,9227,4615,5250,10256,242,8420,1487,4432,4615,6474,\n\t\t\t         1408,1882,3746,8844,611,10074,5016,9083,10628,5469,1589,564,1882,6324,8269,3746,10074,4528,10423,5016,5469,2489,7364,1589,8512,10367,1487,8137,8849,2288,8420,10221,3977,10301,3543,4432,10532,5250,8420,2288,10367,3977,4432,1487,1720,9244,9275,2411,1027,10746,141,3662,9052,4097,5346,7692,468,9083,8624,6880,3657,10480,453,119,\n\t\t\t         10162,9333,5834,5243,10746,6609,1134,141,8487,3043,5651,402,1741,6623,6609,10746,141,1134,2176,1419,9333,9973,7973,5834,6724,2652,6875,563,5268,5270,7750,55,10423,563,6875,5707,5270,468,6880,7750,9973,3657,119,7973,10480,5268,55,453,9083,5016,3497,8624,5016,10423,5707,3497,471,3691,8836,9370,9220,9503,8628,960,\n\t\t\t         9503,471,9370,8628,5755,9201,1776,4528,4457,7699,1027,4700,5289,10403,7292,1887,10289,4731,10074,611,4912,3662,10149,10759,7160,10289,611,9081,3691,5289,1887,8836,10745,7160,9081,2804,4700,1027,3662,4912,10519,4362,10150,3176,4731,5755,4528,10074,1794,10165,1776,9201,10403,10745,2804,7292,581,1278,8487,4362,648,2534,8022,2002,\n\t\t\t         3043,8487,1278,9537,1927,648,2002,1268,8068,854,10637,6894,1826,4420,6713,1809,10519,1826,1809,10426,5158,10637,854,4419,864,8068,6894,4248,2534,7655,6741,8022,10426,1809,7380,2,864,2,7380,8068,8068,7380,8963,854,7380,1809,6713,8963,6907,1268,2002,8022,6907,4419,854,8963,8849,10301,6098,7044,3977,10367,7432,4627,\n\t\t\t         10149,1419,6724,10165,10532,2288,3604,8677,10020,10569,10668,1014,8512,1708,308,2710,10301,3977,4627,6098,5233,3449,308,234,1419,2176,2652,6724,10759,10149,10165,1794,10555,4758,9606,8686,10457,2136,8363,5965,4128,10457,5965,9796,7010,6486,4819,9338,8086,398,8363,2136,4688,5528,8686,9502,8348,5442,8929,354,6314,1841,1379,7567,\n\t\t\t         2655,6484,5562,8604,1841,6279,9786,1379,5442,6314,7567,8929,7847,122,641,2163,3532,5723,641,314,4587,1233,3336,4125,9421,2172,10028,7409,1233,7313,6664,3336,7811,6652,9662,6781,6,7847,2163,4570,7313,6,4570,6664,6664,4570,8430,9439,4570,2163,1214,8430,4758,4128,9796,9606,342,3143,9604,10296,6781,9662,7646,2940,\n\t\t\t         3336,6664,9439,2269,7409,10028,6484,2655,4125,3336,2269,7741,314,641,122,2192,2163,641,5723,1214,4600,6223,4294,6987,5269,9786,6279,2783,354,8929,7313,1233,8604,5562,2735,7070,8929,7567,6,7313,176,354,1233,4587,7567,1379,7847,6,1379,9786,122,7847,6749,665,5442,8348,6019,1206,1841,6314,6991,2425,670,10023,\n\t\t\t         10027,6749,8348,10263,8013,9908,7486,6238,2969,953,4713,4729,5965,8363,2548,10441,1206,10667,6279,1841,665,6019,6314,5442,3169,10023,670,8964,8686,9606,1858,9502,9796,5965,10441,2152,398,3384,2548,8363,5311,6238,7486,2110,6466,10667,4713,953,9606,9796,2152,1858,4729,6722,4758,10555,3909,9075,2136,10457,2102,3909,10457,4128,\n\t\t\t         5014,8086,2136,9075,6722,2102,4128,4758,5528,9113,10555,8686,3143,2170,5169,9604,6486,10066,4701,4819,9113,2969,4729,10555,2170,3169,8964,5169,10066,5311,2110,4701,4713,7208,6722,4729,5350,3329,9075,3909,10515,5350,3909,2102,3108,5014,9075,3329,7208,10515,2102,6722,10263,8348,354,176,2940,7646,6223,4600,2192,122,9786,5269,\n\t\t\t         10296,9604,6486,7010,7646,2655,8604,6223,6652,9421,7409,9662,9662,7409,2655,7646,6223,8604,7070,4294,2425,8013,6238,670,8964,670,6238,5311,9604,5169,10066,6486,5169,8964,5311,10066,1378,10491,10023,3169,10550,6781,2940,4881,10651,8899,2170,3143,1143,4600,6987,396,7369,10651,3143,342,4881,2940,4600,1143,3299,7811,6781,10550,\n\t\t\t         8899,1378,3169,2170,2520,6991,10023,10491,1582,7818,3482,6468,9439,8430,5226,9933,2907,3482,7818,4258,2269,9439,9933,7411,9342,4317,5723,3532,7741,2269,7411,2705,6468,7741,2705,1582,1214,5723,4317,9546,4258,9342,3532,2907,8430,1214,9546,5226,1582,2705,4164,7818,4258,7818,4164,9342,9342,4164,4455,4317,4164,2705,7411,4455,\n\t\t\t         4455,7411,9933,5226,5226,9546,4317,4455,3329,5350,665,6749,10515,7208,1206,6019,6987,4294,2425,6991,3108,3329,6749,10027,7070,2735,9908,8013,7208,4713,10667,1206,5350,10515,6019,665,2783,6279,10667,6466,4294,7070,8013,2425,396,6987,6991,2520,2739,1769,1258,4649,2356,6675,6411,9295,11,8579,4915,1341,7675,7974,9931,2621,\n\t\t\t         8558,7347,1875,2566,5087,68,7127,6946,4242,4649,1258,1749,247,9295,6411,5088,1760,4706,2256,10161,6859,1654,3965,212,10568,9465,2790,7418,6605,5639,1264,6910,6910,1264,8150,6040,7418,2790,3607,351,10161,2256,5639,6605,212,3965,9465,10568,4639,6332,4706,1760,438,9126,4863,6181,9042,4071,4389,10773,3731,4547,5443,4324,\n\t\t\t         6946,7127,4547,3731,1659,4194,6754,677,2600,2382,1654,6859,9126,4242,1749,4863,2566,1875,4194,1659,4324,5443,6675,2356,4071,247,5088,4389,677,6754,1769,2739,4918,6461,7347,8558,4678,3552,68,5087,3218,9367,6461,4918,392,9139,3552,4678,6040,8150,5450,2824,351,3607,4935,10471,8855,2824,5450,534,8367,10471,4935,534,\n\t\t\t         9257,9139,6332,4639,7805,9367,2382,2600,3655,4544,1928,5221,4048,7086,6196,6403,4490,1786,7372,8970,6594,79,6407,9254,5649,3277,3444,3630,9213,4064,4406,4461,6962,5221,1928,10742,9831,6403,6196,4696,5187,3991,7259,379,10007,3841,8530,3850,9264,7108,3592,6085,5345,4683,2809,9046,9046,2809,482,8018,6085,3592,3610,2481,\n\t\t\t         379,7259,4683,5345,3850,8530,7108,9264,2817,993,3991,5187,2365,7641,5343,7552,631,3058,6994,1492,10086,593,585,4814,4461,4406,593,10086,10497,7509,1989,109,7910,8067,3841,10007,7641,6962,10742,5343,3630,3444,7509,10497,4814,585,7086,4048,3058,9831,4696,6994,109,1989,4544,3655,5245,6453,3277,5649,2854,4795,4064,9213,\n\t\t\t         3678,636,6453,5245,7269,8621,4795,2854,8018,482,3866,4078,2481,3610,5666,1547,675,4078,3866,8113,318,1547,5666,8113,10085,8621,993,2817,1824,636,8067,7910,2122,9279,1986,8351,4514,4388,1173,3799,5043,424,8014,9558,7322,10437,7934,2571,7179,10084,5675,3373,4716,8220,7789,3990,4589,8351,1986,2896,1543,3799,1173,4961,\n\t\t\t         8629,6684,6326,6360,8802,1376,7929,9375,9871,7581,5218,430,6636,620,874,6354,6354,874,10101,7311,430,5218,5732,6368,6360,6326,620,6636,9375,7929,7581,9871,2561,795,6684,8629,7812,2218,2828,3323,222,8371,263,289,2143,8871,8992,6170,3990,7789,8871,2143,4523,9002,9631,7536,744,9607,1376,8802,2218,4589,2896,2828,\n\t\t\t         3373,5675,9002,4523,6170,8992,4388,4514,8371,1543,4961,263,7536,9631,9279,2122,1065,1145,10084,7179,371,4346,8220,4716,9843,547,1145,1065,6570,4129,4346,371,7311,10101,7487,3225,6368,5732,1813,1136,4887,3225,7487,5803,1911,1136,1813,5803,246,4129,795,2561,6493,547,9607,744,8196,6810,4384,6044,2762,934,209,6914,\n\t\t\t         10049,9942,4901,1372,1001,1863,6552,4465,3746,5082,5882,8844,9227,2221,5712,4924,9681,6044,4384,6992,8797,6914,209,9056,9244,3828,5000,9275,2961,3524,4009,7150,2124,6956,10212,3621,6356,8706,8640,9198,9198,8640,1927,4420,3621,10212,5158,7655,9275,5000,8706,6356,7150,4009,6956,2124,3604,7044,3828,9244,2749,3672,3201,2813,\n\t\t\t         7781,7707,5326,3825,9054,7285,6556,5860,4924,5712,7285,9054,5396,479,2036,2742,7432,2710,3524,2961,3672,9681,6992,3201,8844,5882,479,5396,5860,6556,934,2762,7707,8797,9056,5326,2742,2036,6810,8196,8269,8137,5082,3746,3543,10221,2221,9227,1708,8512,8137,8269,10301,8849,10221,3543,4420,1927,1268,6713,7655,5158,4419,6741,\n\t\t\t         8963,6713,1268,6907,8022,6741,4419,6907,2288,8849,7044,3604,10367,8512,2710,7432,7961,4598,923,463,2025,3028,9962,8779,10521,4447,9158,3317,1025,2527,3005,58,9165,9949,9898,6698,6698,9898,2527,1025,58,3005,8897,7679,4447,3964,266,9158,10506,4438,4818,5067,2613,9346,4329,9626,8554,5067,4818,3183,9346,7961,463,4329,\n\t\t\t         3964,2025,8779,266,3028,2613,9626,9962,4598,10016,2087,923,10016,8554,3183,2087,10473,6107,7674,1011,751,4069,5864,6063,4069,10473,1011,5864,8316,1164,1560,3789,2929,3996,9995,5210,10201,2808,3476,2331,4183,4037,9963,8825,406,5787,5739,8724,9362,4183,8825,10039,6107,10201,2331,7674,9516,9362,10039,9385,5210,9995,5787,406,\n\t\t\t         10116,5060,3996,2929,4037,8316,3789,9963,949,4809,1560,1164,2808,9516,9385,3476,6662,1018,6439,1042,5514,2753,5061,7722,1042,6439,7040,9474,5514,9474,7040,2753,7679,8897,4438,10506,8724,5739,4809,949,5991,41,5589,2884,7500,9352,9265,7844,9724,3301,2065,5024,8179,8255,3519,4563,5335,4646,8637,3999,3999,8637,8255,8179,\n\t\t\t         4563,3519,3378,1105,3301,5992,5424,2065,3308,686,1106,8039,4430,10130,9232,1903,9389,8039,1106,10141,10130,5991,2884,9232,5992,7500,7844,5424,9352,4430,1903,9265,41,10601,4561,5589,10601,9389,10141,4561,8589,1174,7617,4072,8003,6562,6702,1551,6562,8589,4072,6702,1337,2932,4263,7985,1825,8739,4735,7637,865,10211,1197,10203,\n\t\t\t         691,3223,8515,2309,4995,524,4441,5007,7103,691,2309,4603,1174,865,10203,7617,570,7103,4603,6150,7637,4735,524,4995,1064,1123,8739,1825,3223,1337,7985,8515,2899,9408,4263,2932,10211,570,6150,1197,6535,260,6627,8642,7189,9620,7760,8319,8642,6627,3078,1490,7189,1490,3078,9620,1105,3378,686,3308,5007,4441,9408,2899,\n\t\t\t         5687,900,5310,2648,10129,8852,1533,4710,6289,5154,2754,2662,7201,2734,3182,3184,4534,7553,9732,5473,5473,9732,2734,7201,3184,3182,10156,9454,5154,836,4411,2754,8168,5724,8115,385,10705,8184,5349,8017,10089,385,8115,4583,8184,5687,2648,5349,836,10129,4710,4411,8852,10705,8017,1533,900,4643,6824,5310,4643,10089,4583,6824,\n\t\t\t         777,3845,2787,4990,4049,2151,9595,7953,2151,777,4990,9595,2438,7041,9874,365,6112,1938,1745,9453,9398,3639,1671,1496,3466,7123,4789,6385,3537,7748,9938,5330,1092,3466,6385,8598,3845,9398,1496,2787,2317,1092,8598,546,9453,1745,7748,3537,4674,8876,1938,6112,7123,2438,365,4789,1282,5790,9874,7041,3639,2317,546,1671,\n\t\t\t         9069,4468,410,9791,2180,1702,3396,10107,9791,410,8085,10240,2180,10240,8085,1702,9454,10156,5724,8168,5330,9938,5790,1282,6880,8624,10628,1005,119,453,8493,6320,5243,5834,1731,6246,6609,8062,9950,1134,3043,4248,4623,5651,6623,5160,8062,6609,1134,9950,10020,2176,5834,7973,5458,1731,2652,1014,6963,6875,55,7750,9715,7804,\n\t\t\t         5707,6875,6963,2489,7750,6880,1005,9715,7973,119,6320,5458,453,55,7804,8493,8624,3497,5469,10628,3497,5707,2489,5469,2453,3158,3691,471,3077,4475,9503,9220,4475,2453,471,9503,5250,10532,9201,5755,2818,4457,4700,5826,4148,10175,10403,5289,9472,10256,4731,10289,2411,4912,10759,1720,6653,9472,10289,7160,3158,4148,5289,3691,\n\t\t\t         4472,6653,7160,10745,5826,4700,4912,2411,1826,10519,3176,2818,10256,5250,5755,4731,8677,1794,9201,10532,10175,4472,10745,10403,4362,10519,10426,581,9537,864,4248,3043,581,10426,2,1278,9537,1278,2,864,2176,10020,1014,2652,1720,10759,1794,8677,2732,2571,8456,7991,767,6215,8937,4513,6073,1587,9511,6593,6643,1666,888,3907,\n\t\t\t         4915,6315,1345,9713,3805,1211,5102,561,6593,4465,7126,6073,1414,7126,4465,6552,7410,9685,6176,6990,3907,7410,6990,6643,4193,143,7979,4699,9713,1249,1341,4915,2205,8937,6215,7765,1918,9194,10541,3430,1211,1034,348,5102,6256,6176,9685,4469,561,33,3916,3805,4462,7979,143,4888,3430,9254,10489,1918,3775,1345,6315,5455,\n\t\t\t         1249,5820,8696,1341,1666,9921,431,888,6552,431,9921,1414,8529,348,1034,9875,7991,894,5099,2732,5455,2621,1230,3775,5392,7339,7979,4462,7316,5166,10479,3400,6931,9441,6176,6256,3249,6449,10328,7002,1053,5166,8937,2205,9820,7339,1510,3835,5911,4036,2399,9363,9655,3599,1427,9363,3835,893,5106,1797,7934,9032,8456,2571,\n\t\t\t         9655,9363,2399,9596,9655,9596,6416,1104,3400,10479,9954,3525,7349,10654,219,9727,3599,9954,10479,1427,10330,8014,5099,894,1304,893,5954,1848,4593,9728,9954,3599,893,3835,1510,5954,3525,9954,9728,8031,5585,5752,7340,8544,4261,897,4960,10144,8544,4196,3188,5585,897,10318,1438,4960,7390,1438,10318,9822,9237,7582,962,783,\n\t\t\t         3723,7390,9822,4763,783,962,1987,2462,10144,7821,8250,4261,3952,8890,7776,7122,2532,5127,847,8815,7708,3564,4394,1615,8890,6657,7544,7776,8250,5510,9888,3579,6407,2354,10489,9254,5127,3564,2281,847,7207,7708,1615,9593,2532,3952,7122,4176,664,6142,10318,897,5510,7666,9384,9888,5472,8544,7340,1300,7821,2515,5510,8250,\n\t\t\t         7340,4763,6778,1300,6399,9042,7675,9287,6181,7825,2233,8579,10773,4133,7494,7974,561,3317,2126,33,7255,5632,7494,4133,8696,882,11,1341,7825,6399,9287,2233,8529,2678,3407,348,348,3407,10521,5102,4796,6063,2678,8529,438,6181,8579,11,9042,10773,7974,7675,5102,10521,3317,561,3759,751,6063,4796,10781,1551,2215,767,\n\t\t\t         7552,9829,4143,1786,1492,1403,4391,79,9479,2272,4391,1403,6036,3747,8863,9957,10576,5024,7106,8328,9986,7953,9672,4193,143,6993,6289,4888,767,2215,5362,6215,2088,2686,9117,8770,7765,9724,5024,10576,631,1492,79,6594,289,9957,8863,10437,2365,7552,1786,4490,3323,2088,8770,424,9135,8003,1551,10781,6215,5362,9724,7765,\n\t\t\t         9685,10162,5243,4469,9829,5560,8745,4143,4398,2206,4490,8970,4888,6289,2662,9074,5560,631,6594,8745,3814,4049,7953,9986,7410,960,10162,9685,9074,2662,9276,10517,1082,7781,1001,2131,1752,6246,8408,9859,2813,5223,6121,9942,222,289,10437,7322,8872,8848,5043,9558,2686,222,7322,9117,7812,3323,424,5043,4193,9672,6993,143,\n\t\t\t         7781,3825,1863,1001,5223,1082,2131,6121,4469,5243,6246,1752,3907,9220,960,7410,2749,2813,9942,10049,888,3077,9220,3907,1831,6307,10049,1372,3825,3121,4318,1863,4475,3077,4318,3121,1617,4536,4450,9591,9226,1838,5916,3642,5337,434,4549,6644,856,5070,10146,3020,1838,5070,6999,5916,434,5886,9842,4549,9793,542,2628,9371,\n\t\t\t         7459,1617,9591,843,7459,6590,3271,7237,542,4060,2213,2628,4536,794,8618,4450,6590,8525,2391,3271,4060,5048,8520,2213,794,3698,782,8618,5048,5886,10231,8520,3698,9226,3642,782,4763,9822,8782,6778,4261,8250,3579,10013,9727,9384,7666,7349,10013,664,897,4261,2493,8782,6142,3019,7276,10013,3579,210,9822,10318,6142,8782,\n\t\t\t         6145,6073,7126,10043,10563,7372,10541,9194,9931,9361,1230,2621,7372,9931,9420,8970,9931,7372,10563,9361,6073,6145,4869,1587,1300,2194,1587,4869,8014,6407,5525,9558,8782,2493,1009,6778,6407,8014,10330,2354,6778,9032,2194,1300,5472,6145,10043,5207,8544,5472,5207,4196,2194,4901,9511,1587,7934,4901,2194,9032,4901,7934,8346,1372,\n\t\t\t         6145,5472,1300,4869,3311,10173,1848,5954,10308,3106,10544,9993,7120,5843,3106,10308,4688,9502,5253,4448,5301,3200,2548,3384,5922,4216,10296,7010,342,10296,4216,7158,4120,9533,2152,10441,3200,4120,10441,2548,7158,2420,7369,342,9533,9507,1858,2152,7010,9338,1631,5922,9507,5253,9502,1858,7756,6614,9507,9533,6614,9191,5253,9507,\n\t\t\t         5922,1631,5465,9885,7133,8898,3200,5301,4448,5253,9191,10394,9885,360,4216,5922,7158,4216,360,9705,9705,4917,2420,7158,3272,7756,9533,4120,8898,3272,4120,3200,10228,408,7756,3272,8931,10228,3272,8898,408,2183,6614,7756,2183,523,9191,6614,9885,5465,2499,7296,8397,8931,8898,7133,10394,9191,523,8793,7296,811,360,9885,\n\t\t\t         9705,360,811,8478,8478,9033,4917,9705,6596,9302,811,7296,8478,811,9302,9320,9320,4050,9033,8478,10080,6522,408,10228,2357,10080,10228,8931,6522,8032,2183,408,8032,4250,523,2183,7296,2499,10354,6596,710,2357,8931,8397,8793,523,4250,8807,6596,10354,5262,4363,7886,7071,2357,710,8807,4250,873,7368,4363,9763,9302,6596,\n\t\t\t         9320,9302,9763,5383,5383,1756,4050,9320,10752,10756,6522,10080,7071,10752,10080,2357,10756,7649,8032,6522,7649,873,4250,8032,7088,3880,7649,10756,3880,558,873,7649,4363,5262,9142,3580,10098,7824,7071,7886,7368,873,558,1117,3580,4751,9763,4363,5383,9763,4751,2417,2417,3163,1756,5383,338,7088,10756,10752,7824,338,10752,7071,\n\t\t\t         2510,558,3880,3059,6405,1117,558,2510,7881,9140,1646,8537,9140,5920,6641,1646,7452,6470,9766,9572,8537,1646,1990,7661,7661,1990,2048,2418,2418,2048,4285,9847,4839,10608,6649,6666,9847,4285,4578,1940,1940,4578,5454,5635,4619,5454,10000,1732,9666,5635,5454,4619,618,4398,8970,9420,2846,8872,9558,5525,4796,10576,8328,3759,\n\t\t\t         10576,4796,8529,7765,7765,8529,9875,2205,5911,1053,2205,9875,6416,9852,7881,1104,3599,9655,1104,4593,3501,3580,9142,3660,10781,9074,10517,9135,9074,10781,767,4888,6268,1831,1372,8346,9986,1752,9859,3814,1752,9986,4193,4469,4469,4193,4699,6256,9820,6931,6256,4699,3311,6746,3400,3525,10173,3311,3525,8031,5954,1510,6746,3311,\n\t\t\t         5392,7316,3400,6746,4513,4462,4888,767,1797,5106,10328,6449,7207,2462,1987,6908,4763,7340,5752,3723,9384,7922,1087,9888,9384,9727,9051,7922,10013,7276,8654,664,4196,5207,3249,7002,10582,4751,3580,3501,9806,783,2462,1357,9089,6185,8890,3952,9593,1357,2462,7207,6908,3381,7708,7207,6185,2637,6657,8890,4176,5211,5127,2532,\n\t\t\t         3381,2281,3564,7708,8815,9089,3952,2532,5211,4394,3564,5127,10328,5106,10297,3743,4578,5083,10000,5454,893,1304,10297,5106,4285,10132,5083,4578,10405,2417,4751,10582,2417,10405,6026,3163,6537,7824,10098,469,5616,338,7824,6537,338,5616,1308,7088,6657,2637,6649,10608,10302,9236,4459,3318,9236,10302,50,9583,3188,4196,7002,1287,\n\t\t\t         6635,4839,6666,5620,7120,7384,3008,1898,1898,3008,8945,10327,10327,8945,10042,4588,4588,10042,8564,8214,8214,8564,3954,9137,6351,6195,6600,5337,9137,3954,958,4704,4704,958,7636,2243,9089,7384,5681,6185,8815,3008,7384,9089,3008,8815,847,8945,8945,847,2281,10042,3381,8564,10042,2281,6908,3954,8564,3381,3954,6908,1987,958,\n\t\t\t         7450,5968,4463,2243,8525,6351,10666,2391,856,5676,1892,6459,5690,1107,5968,7450,962,7636,958,1987,1009,8456,9032,6778,6746,1510,7339,5392,4949,2399,4036,3805,2493,7991,8456,1009,7991,2493,3019,894,4513,8937,5166,7316,6142,10330,894,3019,1797,6449,9441,6931,3805,4036,1034,1211,10330,6142,664,2354,8654,10489,2354,664,\n\t\t\t         7276,1918,10489,8654,1918,7276,210,9194,1427,10479,5166,1053,4699,7979,7339,9820,6643,9441,6449,1666,3579,10563,9194,210,9875,1034,4036,5911,10563,3579,9888,9361,1087,1230,9361,9888,7922,3775,1230,1087,6643,6990,6176,9441,3775,7922,9051,1345,9727,9713,1345,9051,9713,9727,219,1249,10654,8339,10234,219,4949,6648,6418,5208,\n\t\t\t         1666,6449,3249,9921,5207,1414,9921,3249,1414,5207,10043,7126,1249,219,10234,5820,9363,1427,1053,5911,3835,1797,6931,9820,4462,4513,7316,5392,7088,1308,3059,3880,5829,6537,469,4313,1801,5616,6537,5829,7666,5510,2515,9832,10608,4239,7544,6657,7582,601,7636,962,4839,1308,5616,1801,7582,3318,8390,601,9309,7349,7666,9832,\n\t\t\t         9832,7544,4239,9309,4239,1801,5829,9309,7349,9309,5829,10654,2515,7776,7544,9832,7821,7122,7776,2515,4619,9236,9583,9666,9236,4619,1732,4459,2014,9987,2968,5511,7730,6529,9987,2014,6473,2483,6529,7730,8877,3818,2483,6473,2112,7505,3818,8877,5620,4769,7505,2112,6666,793,4769,5620,6649,8630,793,6666,2014,5511,4188,8620,\n\t\t\t         9766,6470,6635,5620,7730,2014,8620,7278,4188,8453,5006,8620,2048,948,10132,4285,948,2048,1990,5628,7402,7278,8620,5006,7278,7402,6996,4478,4478,6996,9482,3857,3857,9482,5276,8954,6473,7730,7278,4478,3857,8877,6473,4478,8877,3857,8954,2112,1990,1646,6641,5628,5276,9572,9766,8954,9766,5620,2112,8954,7002,10328,3743,1287,\n\t\t\t         10144,4176,7122,7821,4176,10144,4960,5211,5211,4960,1438,4394,7390,1615,4394,1438,3723,9593,1615,7390,5752,1357,9593,3723,5585,9806,1357,5752,3743,9583,50,1287,9583,3743,10297,9666,1304,5635,9666,10297,5635,1304,1848,1940,10173,9847,1940,1848,9847,10173,8031,2418,2418,8031,9728,7661,4593,8537,7661,9728,8537,4593,1104,7881,\n\t\t\t         4949,3805,3916,6648,9596,5208,6418,6416,4949,5208,9596,2399,10654,5829,4313,8339,10302,3318,7582,9237,5676,9470,3558,1892,2637,5112,8630,6649,6185,5681,5112,2637,1287,50,7171,3188,10302,9237,7171,50,9806,5585,3188,7171,9237,783,9806,7171,1801,4239,10608,4839,10405,9852,7277,6026,9852,10405,10582,7881,7881,10582,3501,9140,\n\t\t\t         9140,3501,3660,5920,7452,6405,2510,6470,6470,2510,3059,6635,6635,3059,1308,4839,1359,940,9146,7464,7464,9146,7905,8006,8006,7905,9858,241,7478,3818,7505,241,4379,2483,3818,7478,7561,6529,2483,4379,4429,9987,6529,7561,4429,9841,7440,8008,9993,10544,940,1359,9554,8911,4536,1617,3401,4609,1838,9226,6600,6621,434,5337,\n\t\t\t         6459,6999,5070,856,4609,10146,5070,1838,6621,10231,5886,434,1902,118,542,9793,7237,9554,1617,7459,843,4743,6590,7459,118,3535,4060,542,8911,6606,794,4536,4743,7650,8525,6590,3535,3741,5048,4060,6606,10373,3698,794,3741,9842,5886,5048,10373,3401,9226,3698,10666,6351,5337,6644,7650,6195,6351,8525,3020,7788,5676,856,\n\t\t\t         7788,1365,9470,5676,8390,5690,7450,601,5843,7120,1898,8907,4235,4379,7478,1953,7384,7120,10308,5681,4769,8006,241,7505,5681,10308,9993,5112,6761,4704,2243,4463,5112,9993,1359,8630,4712,4588,8214,9281,1016,9137,4704,6761,793,7464,8006,4769,9841,4429,7561,5036,9956,10327,4588,4712,9281,8214,9137,1016,9987,4429,8008,2968,\n\t\t\t         1953,7478,241,9858,8907,1898,10327,9956,601,7450,2243,7636,5036,7561,4379,4235,8630,1359,7464,793,6418,7277,9852,6416,6115,7673,9418,9868,8768,3304,339,2129,3155,1351,1971,5659,7780,9424,6062,3867,9323,8418,7653,7291,10717,3089,10220,5063,4538,6637,8547,4116,7302,8600,2135,9826,1718,3470,5944,978,9475,10653,6872,3344,\n\t\t\t         6817,10293,1971,1351,4516,7855,1371,833,4446,1472,10588,9318,8754,5222,1541,9066,5960,9826,2135,3137,7537,5063,10220,818,2432,2129,339,7446,4260,8035,8059,5856,1389,9643,2347,2227,7548,4312,2227,2347,7145,5785,9418,7673,1280,3721,339,3304,1966,5885,6802,8671,2603,5699,4733,3980,136,1506,2179,10095,6029,892,10109,4759,\n\t\t\t         8671,6802,5699,2603,2066,3881,715,9251,10022,4586,715,10775,8636,7995,290,3589,3408,1311,6822,7323,6951,4665,5837,2507,8916,7174,1576,2419,5810,5867,8370,3588,2507,5837,5867,5810,5837,9745,383,5867,5867,383,6520,8370,9868,9418,1351,3155,7291,7653,9424,7780,4116,8547,3470,1718,7533,6610,5645,1779,5785,6817,1351,9418,\n\t\t\t         6304,7191,10381,10625,8935,3931,1454,5012,7174,1916,2443,1576,4665,8983,9745,5837,1311,136,10095,6822,7995,3459,9696,290,4586,7672,9251,715,3881,9404,10775,715,3319,806,2993,4088,2100,6989,4759,10109,5885,6951,2507,6802,1506,8443,2041,2179,6802,2507,5810,5699,7261,8636,3589,599,5699,5810,3588,4733,892,2066,9251,10109,\n\t\t\t         2674,1966,8671,2051,1430,2603,3980,3884,2106,2675,9684,10265,2362,2344,3462,7084,9318,10588,1685,7678,324,3721,5222,8754,2251,5880,4312,7548,6854,113,10351,3969,6284,1541,5222,6148,113,2362,7084,10351,5012,1454,709,5557,7250,5919,5025,3877,8840,2224,10475,9565,10076,9039,8687,4311,4019,6164,1313,541,8366,6285,5151,19,\n\t\t\t         1714,10699,4723,4187,4498,10253,192,886,8600,10076,4311,2135,2423,10344,5919,7250,133,9030,10344,2423,10351,7084,6817,5785,3680,4311,8687,5652,886,192,6610,7533,1690,2372,9305,2090,3385,6029,4759,4907,3969,10351,5785,7145,2051,8671,2603,1430,5919,3155,5659,5025,9207,3950,9684,2675,6637,133,2423,8547,3470,7250,3877,5944,\n\t\t\t         3137,2135,4311,3680,7050,7497,1313,6164,3631,19,5151,4907,9039,8768,2129,8687,2090,9305,8035,4260,4187,4723,10653,9475,8547,2423,7250,3470,7446,339,3721,324,7678,1685,7855,4516,7084,3462,10293,6817,10625,10381,10253,4498,7229,1519,2372,1690,6148,5222,3721,1280,1519,7229,5880,2251,5557,709,7191,6304,833,1371,10699,1714,\n\t\t\t         9030,6115,9868,10344,10344,9868,3155,5919,5652,8687,2129,2432,9100,4538,4116,5297,4899,7302,9826,3669,5125,1718,978,5847,4332,3669,9826,5960,5297,4116,1718,5125,5856,8059,4231,8568,1779,5645,4124,2103,3344,6872,1312,3110,8568,4231,6285,8366,2103,4124,3950,9207,3110,1312,7497,7050,6146,9100,5297,3576,4652,4899,3669,5568,\n\t\t\t         6179,5125,5847,813,643,5568,3669,4332,3576,5297,5125,6179,2224,7261,599,10475,1916,3319,4088,2443,7672,2100,10109,9251,6610,4191,10580,5645,7191,7784,4607,10381,3931,6288,6247,1454,2443,4088,1151,4012,2419,1576,1594,10718,1576,2443,4012,1594,4088,2993,1583,1151,1454,6247,2353,709,10265,9684,2638,3859,10253,2911,5924,192,\n\t\t\t         3950,232,2638,9684,192,5924,4191,6610,709,2353,7784,7191,10381,4607,2911,10253,5645,10580,3231,4124,4124,3231,232,3950,10632,5557,6304,855,2562,8935,5012,6267,6267,5012,5557,10632,2764,9207,2675,390,6811,2004,1916,7174,5633,10625,4498,8738,7435,1779,2103,1479,2696,3780,806,3319,4287,7533,1779,7435,855,6304,10625,5633,\n\t\t\t         10342,886,7533,4287,2004,2696,3319,1916,3808,6811,7174,8916,1479,2103,9207,2764,2023,390,2675,2106,8738,4498,886,10342,3324,8507,3807,1294,9745,2020,10100,383,7305,8327,1294,3807,8983,4092,2020,9745,9998,10022,10775,5190,3459,9403,7657,9696,2664,3516,9403,3459,9404,8497,5190,10775,4644,3266,10022,9998,383,10100,7779,6520,\n\t\t\t         3516,6769,1969,9403,4644,9998,1969,6769,9998,5190,1606,1969,1969,1606,7657,9403,10395,10100,2020,4092,10395,1606,5190,8497,4652,2674,2051,813,6179,1430,3884,3576,806,2106,10265,2993,643,8840,9565,5568,8443,4019,541,2041,6146,3385,4907,5151,813,2051,1430,6179,6989,3631,4907,4759,2993,10265,3859,1583,3780,2023,2106,806,\n\t\t\t         4785,3596,9128,1204,3251,6888,3769,4204,3047,2803,6505,1598,6745,10716,9203,3471,2253,10352,10055,4800,7798,8936,8175,2177,10365,9966,256,1045,10246,6705,7412,9599,7872,5254,7694,475,8827,8437,5905,8432,2199,2539,6505,2803,4647,2774,4314,3966,273,9340,7055,3492,1763,2057,9120,2169,2957,9599,7412,8452,2517,2177,8175,10036,\n\t\t\t         7527,4204,3769,6981,4625,5069,10583,9412,7496,2901,6603,6071,9991,10556,6071,6603,2459,7755,9128,3596,7658,5357,3769,6888,36,4690,2631,9651,7796,10407,10052,8153,4336,3296,1165,10784,4936,9359,9209,6921,9651,2631,10407,7796,5618,10494,6312,2034,1120,8393,6312,9703,4981,1192,6935,9678,4339,2478,7530,1356,660,9585,8644,3541,\n\t\t\t         9155,9391,10235,9288,6939,8556,1451,7540,3541,8644,8556,6939,8644,7613,1512,8556,8556,1512,2848,1451,1204,9128,2803,3047,4800,10055,10716,6745,1045,256,5254,7872,9816,1775,7325,9405,7755,2199,2803,9128,9134,3508,8395,9044,7695,4848,7610,7806,9391,6091,4904,10235,9585,936,7613,8644,2478,4336,10784,7530,1192,594,7234,6935,\n\t\t\t         8393,2592,2034,6312,10494,8023,9703,6312,8887,1167,1642,1954,7977,2431,6921,9209,4690,660,3541,2631,3296,7065,4576,1165,2631,3541,6939,10407,10313,4981,9678,9978,10407,6939,7540,10052,9359,5618,2034,9209,3023,36,9651,3750,7341,7796,8153,145,3389,5402,4927,2345,10124,6604,7982,10334,3492,7055,10375,1682,7895,5357,2057,1763,\n\t\t\t         10278,1853,10556,9991,9711,6211,8571,5643,9296,9120,2057,7024,6211,10124,10334,8571,7806,7610,7994,10108,7113,3070,9912,3002,8347,3326,1122,1147,5605,7080,2580,1342,3794,3692,1066,3207,1108,6478,9782,4185,3305,2604,8693,8433,4724,2336,7078,6534,6705,5605,1342,7412,1514,1735,3070,7113,6397,6489,1735,1514,8571,10334,2199,7755,\n\t\t\t         6567,1342,2580,6445,6534,7078,1775,9816,6124,10783,8908,2307,5323,4936,6921,2709,5643,8571,7755,2459,3750,9651,7796,7341,3070,3047,1598,9912,8459,3856,4927,5402,9966,6397,1514,256,5254,7113,3002,7694,8452,7412,1342,6567,5890,7621,1066,3692,6587,4185,9782,2709,7080,3251,4204,2580,2307,8908,5069,4625,8433,8693,8437,8827,\n\t\t\t         256,1514,7113,5254,6981,3769,5357,7895,1682,10375,2774,4647,10334,7982,2539,2199,9044,8395,2336,4724,5827,4694,10783,6124,7024,2057,5357,7658,4694,5827,1853,10278,10108,7994,3508,9134,3966,4314,2604,3305,6489,4785,1204,1735,1735,1204,3047,3070,6445,2580,4204,7527,9377,10365,1045,1236,7358,10246,9599,203,5376,7872,475,4565,\n\t\t\t         8070,203,9599,2957,1236,1045,7872,5376,9412,10583,9708,4126,9405,7325,3890,1237,8432,5905,5768,1030,4126,9708,6478,1108,1237,3890,3856,8459,1030,5768,7621,5890,1697,9377,1236,530,4108,7358,203,6101,3963,5376,4565,5423,6580,6101,203,8070,530,1236,5376,3963,3326,10313,9978,1122,6091,8887,1954,4904,2592,7977,9209,2034,\n\t\t\t         1775,4139,1881,7325,3508,866,10224,8395,4848,4906,10106,7610,4904,1954,4947,5656,9288,10235,4727,10127,10235,4904,5656,4727,1954,1642,9934,4947,7610,10106,2999,7994,2345,4927,8755,7584,2336,10324,6025,7078,3856,9294,8755,4927,7078,6025,4139,1775,7994,2999,866,3508,8395,10224,10324,2336,7325,1881,7130,3890,3890,7130,9294,3856,\n\t\t\t         8622,10108,9134,9761,4882,7695,7806,491,491,7806,10108,8622,1648,8459,5402,4726,4501,5027,6091,9391,7622,9044,4724,7430,4433,9405,1237,1964,9124,1905,1167,8887,617,9816,9405,4433,9761,9134,9044,7622,1077,6534,9816,617,5027,9124,8887,6091,7944,4501,9391,9155,1964,1237,8459,1648,10346,4726,5402,3389,7430,4724,6534,1077,\n\t\t\t         2642,3196,4537,5900,7613,6677,1499,1512,10420,4284,5900,4537,936,2836,6677,7613,4831,1120,9703,5339,594,3943,501,7234,748,1651,3943,594,8023,4529,5339,9703,1662,5733,1120,4831,1512,1499,5316,2848,1651,2970,6242,3943,1662,4831,6242,2970,4831,5339,8829,6242,6242,8829,501,3943,2321,1499,6677,2836,2321,8829,5339,4529,\n\t\t\t         4108,3023,3750,5423,3963,7341,145,530,1167,3389,2345,1642,6580,8347,1147,6101,7065,3794,3207,4576,1697,5323,2709,9782,5423,3750,7341,3963,2431,6587,2709,6921,1642,2345,7584,9934,1905,10346,3389,1167,4824,6512,2841,9903,1709,1484,4739,7474,6984,10684,5220,8378,789,7774,8167,5101,1181,9688,5546,8281,9373,1411,155,1392,\n\t\t\t         1172,8473,3417,10778,7032,3190,7154,3335,6967,4969,512,2220,3393,1618,2591,1647,1740,4244,5220,10684,8746,7441,4822,7360,10254,2300,1069,5824,5019,7989,9891,6799,4718,3335,7154,1624,4047,1392,155,8747,3386,7474,4739,3710,9974,8980,6447,7444,369,9755,10206,9045,8485,9176,9045,10206,126,4708,2841,6512,7288,1704,4739,1484,\n\t\t\t         7651,7857,5597,6205,552,3901,7543,6431,8519,1942,1917,8266,10586,9918,4210,3650,6205,5597,3901,552,9647,10618,1505,7999,4162,9094,1505,6517,4481,7196,4679,3652,10524,10727,10257,2454,10462,5674,1832,5193,3512,7764,7350,4377,7415,1055,4673,1988,5193,1832,1055,7415,1832,5756,6187,1055,1055,6187,7397,4673,9903,2841,10684,6984,\n\t\t\t         8281,5546,7774,789,10778,3417,4969,6967,10058,1002,8669,7453,4708,1740,10684,2841,9948,1798,3194,6654,2746,10692,7424,3832,7764,5202,7377,7350,5674,3928,5756,1832,10727,8519,8266,10257,7196,9913,4342,4679,9094,3637,7999,1505,10618,6271,6517,1505,1095,10287,4663,3189,9580,834,3650,4210,7857,10462,5193,5597,1942,8950,6541,1917,\n\t\t\t         5597,5193,7415,3901,3726,4481,3652,3538,3901,7415,1988,7543,9918,9647,7999,4210,5435,7651,6205,6350,2880,552,6431,7718,95,6944,3279,7096,8149,1394,6372,8828,5824,1069,2767,1569,1283,1704,7989,5019,9141,5291,9176,8485,6773,5696,8517,6060,8337,9891,7989,1440,5696,8149,8828,8517,3832,7424,4309,5290,3198,5517,9952,10056,\n\t\t\t         2246,1406,3149,3902,81,6003,8386,9242,4386,7263,7869,1839,9450,7873,6471,1194,9401,1170,9602,6426,8866,7213,7298,2303,3190,81,9242,7154,7769,1630,5517,3198,6434,9543,1630,7769,8517,8828,1740,4708,7833,9242,8386,7046,2303,7298,1002,10058,2725,5901,8010,2142,3955,10586,3650,3840,6060,8517,4708,126,6350,6205,552,2880,\n\t\t\t         5517,6984,8378,9952,5948,4404,3279,6944,8473,6434,7769,3417,4969,3198,10056,512,1624,7154,9242,7833,9098,5299,7869,7263,65,1194,6471,3840,6003,1709,7474,8386,2142,8010,8980,9974,6426,9602,1618,3393,3417,7769,3198,4969,3710,4739,1704,1283,1569,2767,7441,8746,8828,6372,4244,1740,6654,3194,7213,8866,3879,1349,5901,2725,\n\t\t\t         1440,7989,1704,7288,1349,3879,5291,9141,5290,4309,1798,9948,7360,4822,1170,9401,9543,4824,9903,1630,1630,9903,6984,5517,7046,8386,7474,3386,3490,1172,10778,7937,1162,7032,3335,7875,9510,6967,2220,10410,6932,7875,3335,4718,7937,10778,6967,9510,7444,6447,10176,2424,7453,8669,10703,515,1647,2591,5641,9670,2424,10176,7873,9450,\n\t\t\t         515,10703,4404,5948,9670,5641,5299,9098,10725,3490,7937,1302,8071,1162,7875,6669,10710,9510,10410,6896,8774,6669,7875,6932,1302,7937,9510,10710,1406,3726,3538,3149,5202,1095,3189,7377,3637,9580,4210,7999,1002,3872,1595,8669,1798,2052,1843,3194,10692,2479,9748,7424,7377,3189,9610,10229,4377,7350,4797,3893,7350,7377,10229,4797,\n\t\t\t         3189,4663,5663,9610,7424,9748,2140,4309,7096,3279,2765,7609,7213,9329,6039,7298,4404,4208,2765,3279,7298,6039,3872,1002,4309,2140,2052,1798,3194,1843,9329,7213,8669,1595,2150,10703,10703,2150,4208,4404,6125,5290,9948,7367,7455,2746,3832,3039,3039,3832,5290,6125,7629,5948,6944,8012,3971,1962,5202,7764,4410,6654,8866,8225,\n\t\t\t         7915,7453,515,8888,10350,8951,10287,1095,5740,10058,7453,7915,7367,9948,6654,4410,4416,2303,10058,5740,1962,10350,1095,5202,6997,3971,7764,3512,8888,515,5948,7629,8533,8012,6944,95,8225,8866,2303,4416,4195,4142,321,8883,5756,2867,5213,6187,9814,6544,8883,321,3928,3505,2867,5756,8047,4162,6517,4821,9913,5255,7361,4342,\n\t\t\t         7491,3776,5255,9913,6271,832,4821,6517,724,6632,4162,8047,6187,5213,8609,7397,3776,2760,4452,5255,724,8047,4452,2760,8047,4821,5129,4452,4452,5129,7361,5255,71,5213,2867,3505,71,5129,4821,832,8071,5435,6350,6896,10710,2880,7718,1302,10287,95,7096,4663,8774,2246,3902,6669,8950,4386,1839,6541,10725,3955,3840,6471,\n\t\t\t         6896,6350,2880,10710,834,65,3840,3650,4663,7096,7609,5663,8951,8533,95,10287,2117,9625,6035,3204,7188,3591,3796,10659,10525,1335,2148,846,10574,9497,9790,4790,9653,5421,9876,5951,3212,9399,3004,10631,1464,6133,3791,1945,753,415,9615,9247,3998,9872,7766,7492,668,4485,364,3944,4449,2086,2148,1335,1608,5152,6526,2377,\n\t\t\t         9849,3491,3770,2046,2074,4057,2988,9856,5943,9247,9615,6801,10307,10631,3004,9008,1754,10659,3796,4959,6555,7978,8109,7521,722,946,4862,3203,258,10415,3203,4862,2104,1272,6035,9625,6818,2649,3796,3591,9024,7442,5533,3049,7443,1346,10672,5869,6940,9574,7466,4840,2578,1994,2318,5307,3049,5533,1346,7443,5171,10658,3555,6923,\n\t\t\t         2161,820,3555,8483,3758,7538,5246,1023,6250,4370,820,2161,2225,2029,6367,1433,1293,690,264,7345,7631,4118,1688,3287,1433,6367,4118,7631,6367,3609,5470,4118,4118,5470,7090,1688,3204,6035,1335,10525,5951,9876,9497,10574,1945,3791,9872,3998,1921,53,10743,6936,1272,4449,1335,6035,3774,7036,8845,7275,395,7871,1625,2697,\n\t\t\t         32,1417,3738,2782,2029,5026,3609,6367,5662,6940,4840,5116,7538,4093,7854,5246,820,7326,6923,3555,10658,10017,8483,3555,10432,6847,8816,4962,2457,2498,5307,2318,7442,2225,1433,5533,9574,2463,964,7466,5533,1433,7631,1346,7303,3758,1023,3810,1346,7631,3287,10672,1994,5171,6923,2318,10282,9024,3049,9393,6404,7443,5869,5758,\n\t\t\t         10757,9800,2364,4761,9101,3012,223,9576,2046,3770,7170,2325,10276,2649,4057,2074,2466,6720,10415,258,6421,9947,2308,10199,6756,2988,4057,6153,9947,9101,9576,2308,2697,1625,975,5903,6688,245,3036,8505,3894,8411,3861,4054,2064,6230,7063,5401,3140,5148,10685,3959,768,6156,3781,10349,6105,1221,2094,6777,10317,10244,8563,8043,\n\t\t\t         415,2064,5401,9615,1058,1000,245,6688,8492,3303,1000,1058,2308,9576,4449,1272,994,5401,7063,8691,8043,8563,53,1921,1399,6087,9021,5940,10726,2578,5307,9525,10199,2308,1272,2104,9393,3049,7443,6404,245,10525,846,3036,985,10260,2364,9800,6133,8492,1058,3791,9872,6688,8505,7766,6801,9615,5401,994,4425,6370,10685,5148,\n\t\t\t         249,10349,3781,9525,6230,7188,10659,7063,5940,9021,7978,6555,6777,2094,4485,668,3791,1058,6688,9872,4959,3796,2649,10276,2325,7170,5152,1608,9576,223,2086,4449,7275,8845,10244,10317,6231,7338,6087,1399,6153,4057,2649,6818,7338,6231,6720,2466,5903,975,7036,3774,2377,6526,1221,6105,3303,2117,3204,1000,1000,3204,10525,245,\n\t\t\t         8691,7063,10659,1754,1562,1464,1945,6890,1473,753,9247,8663,4146,3998,7492,8740,9961,8663,9247,5943,6890,1945,3998,4146,7521,8109,3294,1176,6936,10743,5236,7224,3944,364,3202,7161,1176,3294,6156,768,7224,5236,10260,985,7161,3202,6370,4425,5449,1562,6890,8961,1139,1473,8663,987,6960,4146,8740,6622,844,987,8663,9961,\n\t\t\t         8961,6890,4146,6960,8411,7303,3810,3861,1417,10432,4962,3738,7326,2457,2318,6923,53,2242,9552,10743,7036,5906,7593,8845,7871,2001,769,1625,3738,4962,532,2232,7345,264,5278,6300,2782,3738,2232,9924,4962,8816,9312,532,1625,769,4376,975,4761,2364,8508,3410,10244,4664,3793,8563,10260,2352,8508,2364,8563,3793,2242,53,\n\t\t\t         975,4376,5906,7036,8845,7593,4664,10244,10743,9552,1317,5236,5236,1317,2352,10260,6333,5903,3774,9484,5716,395,2697,8455,8455,2697,5903,6333,7968,985,9800,7414,7333,6251,1417,32,5753,7275,10317,10148,9769,6936,7224,9175,8902,8202,6847,10432,3656,1921,6936,9769,9484,3774,7275,5753,3153,8043,1921,3656,6251,8902,10432,1417,\n\t\t\t         7514,3506,690,1293,9175,7224,985,7968,5219,7414,9800,10757,10148,10317,8043,3153,9168,1293,7345,5124,3609,4246,5792,5470,6300,9879,5124,7345,5026,6344,4246,3609,7427,2161,8483,7045,4093,1331,615,7854,7514,7732,1331,4093,10017,5314,7045,8483,8999,6250,2161,7427,5470,5792,4479,7090,7732,7859,2259,1331,8999,7427,2259,7859,\n\t\t\t         7427,7045,9017,2259,2259,9017,615,1331,2026,5792,4246,6344,2026,9017,7045,5314,1139,10282,9393,6622,6960,6404,5758,8961,6847,10757,4761,8816,844,3894,4054,987,2463,3140,3959,964,5449,10726,9525,3781,6622,9393,6404,6960,2498,249,9525,5307,8816,4761,3410,9312,8202,5219,10757,6847,1523,9307,6874,7640,5216,2522,3024,9235,\n\t\t\t         1059,9828,2522,5216,7376,2430,6402,7243,8805,9235,3024,7425,5661,4632,9307,5584,2393,5283,6248,4421,5579,10133,1246,9431,7254,9815,9025,5711,9431,1246,6611,7482,4421,6248,10133,5579,8241,3622,7689,7374,4778,8234,7689,7202,4834,10558,5823,17,7097,2015,766,4977,17,5823,7420,3262,1661,10393,996,7091,4799,8860,3622,8241,\n\t\t\t         3262,7420,8860,4799,7420,1677,928,8860,8860,928,4335,3622,7640,6874,9828,1059,6433,3653,3479,3010,10393,4035,4765,996,5823,10325,1677,7420,2015,7254,5711,766,10558,4876,10325,5823,8234,5258,7374,7689,3622,4335,7202,7689,3649,3032,10090,1943,4878,1063,7482,6611,5283,17,3262,6248,9815,10068,9645,9025,6248,3262,4799,10133,\n\t\t\t         8164,4834,17,5283,10133,4799,8241,1246,1246,8241,7374,6611,10112,2393,4421,7762,4282,5579,9431,9290,952,6798,8407,4975,8695,4792,2393,10112,9910,2891,7835,2873,1700,9409,8249,2367,2522,7589,10594,3024,9290,9431,7482,5887,7762,4421,5579,4282,6194,216,8407,6798,9307,4632,2698,6874,9828,6311,7589,2522,7425,3024,10594,5065,\n\t\t\t         4247,6413,7835,2891,9000,2367,8249,5887,6874,2698,6311,9828,9409,1523,7640,5477,9459,5216,9235,5194,8865,1059,5216,9459,2006,5194,9235,8805,5477,7640,1059,8865,5584,9307,1523,7047,3010,3479,2933,8576,7243,6402,2271,1572,7047,1523,9409,1700,8576,2933,216,6194,1572,2271,6413,4247,8249,9409,5477,9752,4811,9459,5194,568,\n\t\t\t         5015,8865,9459,4811,8171,568,5194,2006,9752,5477,8865,5015,4792,8164,5283,2393,4035,3649,1943,4765,5258,4878,6611,7374,3653,7376,7243,3479,4765,1943,9815,7254,7091,996,2015,7097,996,4765,7254,2015,1943,10090,10068,9815,4975,8407,2891,9910,216,4247,2891,8407,3479,7243,1572,2933,2933,1572,4247,216,3792,6194,6798,6061,\n\t\t\t         5394,1678,4035,10393,7460,3010,8576,1641,6836,4157,3032,3649,4306,6433,3010,7460,1678,6836,3649,4035,1879,5394,10393,1661,1641,8576,6194,3792,7230,6061,6798,952,3875,4104,10267,9422,1677,6337,2059,928,9386,4515,9422,10267,10325,9172,6337,1677,1991,4778,7202,10492,4876,3180,9172,10325,4104,3875,3180,4876,4335,7588,10492,7202,\n\t\t\t         4515,9386,4778,1991,928,2059,7588,4335,3875,9422,4982,3180,4515,1991,4982,9422,1991,10492,7702,4982,4982,7702,9172,3180,7702,2059,6337,9172,2059,7702,10492,7588,568,10112,7762,4811,5015,4282,9290,9752,3032,952,4975,10090,8171,8695,10112,568,10068,9910,2873,9645,9752,9290,5887,8249,4811,7762,4282,5015,1063,9000,5887,7482,\n\t\t\t         10090,4975,9910,10068,4157,7230,952,3032,2372,1519,7673,6115,5659,1971,3304,8768,9643,8203,8418,9323,3867,6062,3089,10717,4231,8059,6637,4538,978,5944,8600,7302,2251,7145,7673,1519,10293,1280,3304,1971,10475,599,5885,1966,3980,4733,892,6029,3588,8370,3881,2066,3589,290,4665,6951,290,9696,8983,4665,8370,6520,9404,3881,\n\t\t\t         599,3589,6951,5885,4733,3588,2066,892,9565,10475,1966,2674,2347,6854,3969,7548,2344,6284,6148,3462,3877,5025,9039,10076,5944,3877,10076,8600,8035,9305,9030,133,3884,3980,6029,3385,7548,3969,7145,2251,8059,8035,133,6637,5025,5659,8768,9039,3462,6148,1280,10293,9305,2372,6115,9030,6285,4231,4538,9100,5847,978,7302,4899,\n\t\t\t         5151,6285,9100,6146,813,5847,4899,4652,9696,7657,4092,8983,6520,7779,8497,9404,1606,10395,4092,7657,10100,10395,8497,7779,5568,9565,2674,4652,3576,3884,3385,6146,10783,4694,3596,4785,1598,6505,6888,3251,2901,772,10352,2253,3471,9203,8936,7798,9708,10583,9966,10365,475,7694,6705,10246,10278,2459,3596,4694,2539,7658,6888,6505,\n\t\t\t         1122,9978,4690,36,8153,10052,9359,4936,7540,1451,10494,5618,9678,6935,9585,660,6935,7234,936,9585,1451,2848,8023,10494,9978,9678,660,4690,10052,7540,5618,9359,1147,1122,36,3023,6603,9711,5643,9991,6604,9296,7024,7982,3002,9912,7080,5605,7694,3002,5605,6705,5069,8908,6489,6397,145,8153,4936,5323,9991,5643,2459,10278,\n\t\t\t         10583,5069,6397,9966,9912,1598,3251,7080,7982,7024,7658,2539,8908,10783,4785,6489,6478,9708,10365,9377,4565,475,10246,7358,9782,6478,9377,1697,5423,4565,7358,4108,7234,501,2836,936,2848,5316,4529,8023,8829,2321,2836,501,1499,2321,4529,5316,6101,1147,3023,4108,530,145,5323,1697,5901,1349,6512,4824,8378,5220,1484,1709,\n\t\t\t         9755,666,9688,1181,5101,8167,1411,9373,10176,6447,8473,1172,2220,512,3190,7032,9141,126,6512,1349,4244,7288,1484,5220,3149,3538,7857,7651,6431,7543,9918,10586,1988,4673,10618,9647,3652,4679,5674,10462,4679,4342,3928,5674,4673,7397,6271,10618,3538,3652,10462,7857,7543,1988,9647,9918,3902,3149,7651,5435,10206,6773,6060,8485,\n\t\t\t         1394,8337,1440,6372,10056,9952,6003,81,512,10056,81,3190,8980,8010,9543,6434,7718,6431,10586,3955,8485,6060,126,9141,6447,8980,6434,8473,9952,8378,1709,6003,6372,1440,7288,4244,8010,5901,4824,9543,7873,10176,1172,3490,10410,2220,7032,1162,6471,7873,3490,10725,6896,10410,1162,8071,4342,7361,3505,3928,7397,8609,832,6271,\n\t\t\t         5129,71,3505,7361,5213,71,832,8609,6669,3902,5435,8071,1302,7718,3955,10725,6087,7338,9625,2117,846,2148,3591,7188,946,3544,5421,9653,4790,9790,9399,3212,3294,8109,6133,1464,7492,7766,415,753,2466,2104,9625,7338,2086,6818,3591,2148,3861,3810,7442,9024,5869,10672,1994,2578,3287,1688,10658,5171,1023,5246,2029,2225,\n\t\t\t         5246,7854,5026,2029,1688,7090,10017,10658,3810,1023,2225,7442,10672,3287,5171,1994,4054,3861,9024,10282,4862,6421,10199,258,3012,6756,6153,223,8505,3036,6230,2064,7766,8505,2064,415,7978,9021,3303,8492,5758,5869,2578,10726,258,10199,2104,2466,8109,7978,8492,6133,3036,846,7188,6230,223,6153,6818,2086,9021,6087,2117,3303,\n\t\t\t         6156,3294,1464,1562,8740,7492,753,1473,3781,6156,1562,5449,6622,8740,1473,1139,7854,615,6344,5026,7090,4479,5314,10017,9017,2026,6344,615,5792,2026,5314,4479,987,4054,10282,1139,8961,5758,10726,5449,4191,9475,3344,10580,7784,4516,833,4607,6288,4446,9318,6247,4012,1151,1506,136,10718,1594,1311,3408,1594,4012,136,1311,\n\t\t\t         1151,1583,8443,1506,6247,9318,7678,2353,3859,2638,6164,4019,2911,1714,4187,5924,232,7050,6164,2638,5924,4187,9475,4191,2353,7678,4516,7784,4607,833,1714,2911,10580,3344,3110,3231,3231,3110,7050,232,6343,10632,855,1544,1581,2562,6267,8656,8656,6267,10632,6343,2894,2764,390,4068,10300,6974,2004,6811,733,5633,8738,6467,\n\t\t\t         1390,7435,1479,5361,4611,8631,3780,2696,3375,4287,7435,1390,1544,855,5633,733,4467,10342,4287,3375,6974,4611,2696,2004,7132,10300,6811,3808,5361,1479,2764,2894,1213,4068,390,2023,6467,8738,10342,4467,8507,3324,3516,2664,8327,7305,3266,4644,3324,1294,6769,3516,8327,4644,6769,1294,1583,3859,4019,8443,8631,1213,2023,3780,\n\t\t\t         4139,8827,8432,1881,866,4647,3966,10224,4906,273,3492,10106,5656,4947,3296,4336,10127,4727,2478,4339,4727,5656,4336,2478,4947,9934,7065,3296,10106,3492,1682,2999,7584,8755,3692,3794,10324,3305,8433,6025,9294,5890,3692,8755,6025,8433,8827,4139,2999,1682,4647,866,10224,3966,3305,10324,1881,8432,1030,7130,7130,1030,5890,9294,\n\t\t\t         4875,8622,9761,7687,4032,4882,491,9417,9417,491,8622,4875,3812,1648,4726,2146,7067,5737,5027,4501,4771,7622,7430,9350,5851,4433,1964,7383,8932,5743,1905,9124,1373,617,4433,5851,7687,9761,7622,4771,771,1077,617,1373,5737,8932,9124,5027,5,7067,4501,7944,7383,1964,1648,3812,7729,2146,4726,10346,9350,7430,1077,771,\n\t\t\t         3196,2642,1651,748,4284,10420,5733,1662,2642,5900,2970,1651,4284,1662,2970,5900,9934,7584,3794,7065,5743,7729,10346,1905,3872,3393,1647,1595,2052,8746,7360,1843,2479,10254,5824,9748,10229,9610,1942,8519,3893,4797,10727,10524,4797,10229,8519,10727,9610,5663,8950,1942,9748,5824,1569,2140,7609,2765,7263,4386,9329,9401,6426,6039,\n\t\t\t         4208,9098,7263,2765,6039,6426,3393,3872,2140,1569,8746,2052,1843,7360,9401,9329,1595,1647,9670,2150,2150,9670,9098,4208,2441,6125,7367,3623,409,7455,3039,4728,4728,3039,6125,2441,2952,7629,8012,5097,1026,6158,1962,3971,10046,4410,8225,3574,4168,7915,8888,8104,9562,10732,8951,10350,10159,5740,7915,4168,3623,7367,4410,10046,\n\t\t\t         9152,4416,5740,10159,6158,9562,10350,1962,5118,1026,3971,6997,8104,8888,7629,2952,7279,5097,8012,8533,3574,8225,4416,9152,4142,4195,3776,7491,6544,9814,6632,724,4195,8883,2760,3776,6544,724,2760,8883,5663,7609,4386,8950,10732,7279,8533,8951,2242,668,3944,9552,5906,1608,2377,7593,2001,9849,2046,769,2232,532,9574,6940,\n\t\t\t         6300,5278,4370,6250,9924,2232,6940,5662,532,9312,2463,9574,769,2046,2325,4376,3410,8508,5148,3140,4664,6105,6777,3793,2352,4425,5148,8508,3793,6777,668,2242,4376,2325,1608,5906,7593,2377,6105,4664,9552,3944,7161,1317,1317,7161,4425,2352,2074,6333,9484,10276,10307,5716,8455,9856,9856,8455,6333,2074,9961,7968,7414,844,\n\t\t\t         7538,3758,6251,7333,4959,5753,10148,1754,6801,9769,9175,5943,7303,8411,8202,8902,994,3656,9769,6801,10276,9484,5753,4959,8691,3153,3656,994,3758,7303,8902,6251,4093,7538,3506,7514,5943,9175,7968,9961,3894,844,7414,5219,1754,10148,3153,8691,1293,9168,7732,7514,9879,6300,6250,8999,9168,5124,7859,7732,9879,8999,7859,5124,\n\t\t\t         9312,3410,3140,2463,8411,3894,5219,8202,7774,7052,2434,8167,7580,10585,7147,6058,7355,9497,9876,7790,2448,539,9008,9777,8418,8126,7328,7653,3940,9996,3439,2623,9497,7355,168,9790,1522,9399,9790,168,5085,6701,4843,6650,539,2448,6701,5085,1774,7912,3045,2456,8126,8418,8203,8061,8192,10245,6058,7147,2115,10716,10055,4641,\n\t\t\t         2623,3439,5893,8900,10189,1482,6650,4843,9996,3940,6732,4967,6219,3132,2456,3045,10716,2115,4914,9203,3195,9424,7653,7328,8061,8203,224,5032,9777,9008,3004,9443,9399,1522,9443,3004,2429,2626,8900,5893,7052,7774,5546,2985,9424,3195,5332,6062,9864,6219,3045,1765,4620,10227,1883,9882,3778,10189,4843,2870,7595,2190,303,6697,\n\t\t\t         9566,8192,7147,9882,10429,508,9887,1765,8943,7005,5353,3436,8650,7005,3753,7265,508,6893,380,5495,1411,8167,2434,1790,8650,3067,5353,7005,8650,1080,6704,3067,10227,3403,1844,1883,743,4130,9096,6708,7265,3753,1883,1844,9184,2985,5546,9688,1208,1963,798,5495,7545,7265,1844,4353,5495,798,9887,508,3403,3547,4353,1844,\n\t\t\t         1316,6920,1768,7948,5425,8406,4160,3160,6920,1316,2497,381,3160,4160,2634,7954,2191,7489,7954,2634,7258,3338,1946,4319,6482,9951,7489,2191,3338,1722,7167,1946,8406,5425,2181,7890,10768,4942,9223,8524,5744,1441,6014,10204,2338,3364,4350,2091,8524,9223,3226,5990,2181,3978,6630,106,8936,9203,4914,4486,10204,6014,6342,2091,\n\t\t\t         6362,8940,3364,2338,5744,5001,4942,10768,2211,3160,7954,7996,106,6630,2491,6138,7541,7307,1768,6920,7890,2181,106,8726,1768,7307,9310,9951,2362,7780,3867,2344,6854,9323,7291,113,6284,10717,5063,1541,9996,4967,1472,4446,9066,1541,5063,7537,224,8203,9643,1389,113,7291,7780,2362,2429,5893,3931,8935,5893,3439,6288,3931,\n\t\t\t         1593,2429,8935,2562,2347,9643,9323,6854,2344,3867,10717,6284,3439,9996,4446,6288,1757,1593,2562,1581,10384,7580,7695,4882,9711,2253,4800,6211,9296,7798,2177,9120,2169,9120,2177,2517,6799,9891,1392,4047,5037,9636,9340,273,1656,1774,2746,7455,2456,3132,2479,10692,7580,6058,4848,7695,5696,8281,789,8149,10245,5037,273,4906,\n\t\t\t         6604,3471,7798,9296,8337,9373,1392,9891,6603,2901,2253,9711,6773,1181,8281,5696,5145,10384,4882,4032,6058,10245,4906,4848,6650,1482,2001,7871,6211,4800,6745,10124,5196,772,2901,7496,3132,3191,10254,2479,10124,6745,3471,6604,7393,1656,7455,409,5085,6650,7871,395,3191,1762,2300,10254,9101,10574,4790,3012,5526,2017,3491,9849,\n\t\t\t         6421,9653,5951,9947,1394,5101,9373,8337,10686,666,9755,369,8149,789,5101,1394,10206,9755,1181,6773,1774,2456,10692,2746,3012,4790,3212,6756,9947,5951,10574,9101,1482,5526,9849,2001,539,5085,395,5716,4862,946,9653,6421,9008,539,5716,10307,4847,3544,946,722,6756,3212,10631,2988,9856,2988,10631,10307,10535,2614,313,4635,\n\t\t\t         7778,8750,5429,4111,5482,2629,6827,8942,2513,1864,10765,7469,4111,5429,6860,7469,8942,6827,3816,9269,7479,1975,10780,6152,3037,1932,2614,10535,3037,10782,5041,9909,6152,10780,7456,7648,4635,313,1689,3626,9909,5041,4657,5134,7648,7456,6316,8344,3626,1689,9031,4079,8344,6316,9584,9269,4079,9031,8750,7778,9951,9310,2445,7489,\n\t\t\t         5425,6055,3978,2181,4130,743,6138,2491,6055,5425,3160,2211,6971,2379,7996,2445,3605,3717,3978,6055,7489,2445,7996,7954,4256,2305,168,7355,6021,4641,10055,10352,3089,6062,5332,10309,10352,772,10220,3089,3089,10309,6021,10352,7355,7790,755,4256,7307,755,7790,6480,9688,666,8175,8936,2445,9310,4823,6971,8936,4486,9184,9688,\n\t\t\t         9310,7307,6480,1790,7541,9273,2305,4256,6920,381,9273,7541,6480,7790,9876,5421,1411,1790,6480,5421,5421,3544,155,1411,4256,755,7307,7541,9890,798,1963,1951,3635,999,8027,1178,8632,3635,1178,3523,5661,1591,8240,4632,577,5065,10594,1842,9967,7376,3653,10693,6433,8657,10693,3653,10248,7589,6311,1934,1842,10594,7589,10248,\n\t\t\t         8657,6433,4306,4999,1934,6311,2698,1202,7376,9967,8173,2430,1202,2698,4632,8240,5121,1934,1202,7783,7783,1202,8240,9650,9967,5554,2650,8173,6838,577,1842,6887,1591,9884,9650,8240,5554,9967,10693,7508,8657,2936,7508,10693,2936,8657,4999,8766,2633,10248,1934,5121,6887,1842,10248,2633,6076,2633,5121,840,4217,6887,2633,6076,\n\t\t\t         840,5121,7783,781,781,7783,9650,1818,5554,5372,85,2650,7075,6838,6887,4217,9884,1240,1818,9650,5372,5554,7508,7462,2936,4689,7462,7508,4689,2936,8766,5706,5660,5372,7462,8572,4689,9707,8572,7462,9707,4689,5706,4786,9776,6076,840,6381,8727,4217,6076,9776,6381,840,781,10575,10575,781,1818,3824,5372,5660,3440,85,\n\t\t\t         9344,7075,4217,8727,1240,7236,3824,1818,5660,8460,7834,3440,9368,9344,8727,2019,7236,1191,598,3824,8460,5660,8572,3164,9707,3085,3164,8572,3085,9707,4786,7436,1061,9776,6381,7616,2019,8727,9776,1061,7616,6381,10575,7603,7603,10575,3824,598,914,7616,7603,2677,2677,7603,598,10359,8460,1171,6507,7834,6825,9368,2019,3454,\n\t\t\t         1191,9107,10359,598,1171,8460,3164,10656,3085,3371,10656,3164,3371,3085,7436,2550,1124,1061,7616,914,3454,2019,1061,1124,505,2421,2677,10359,4439,505,10359,9107,8796,5874,5205,925,925,5205,451,2789,7987,877,5503,1224,5874,1536,8795,5205,1536,9940,9108,8795,9940,4121,10687,9108,8084,1559,2651,4227,4121,4767,7608,10687,\n\t\t\t         4767,8329,1088,7608,6203,8341,6032,1088,2188,6203,1088,8329,818,10220,772,5196,10036,8175,666,10686,1593,1757,9636,5037,5037,10245,2429,1593,10245,8192,2626,2429,8943,2626,8192,9566,6704,1080,8796,9289,7265,7545,1080,8650,7510,7870,6507,1171,10384,5145,1762,3191,3191,3132,7580,10384,8747,155,3544,4847,1656,7393,2017,5526,\n\t\t\t         5526,1482,1774,1656,1482,10189,7912,1774,10429,7912,10189,3778,9890,3403,10227,2404,1951,3547,3403,9890,798,9890,2404,9887,9864,2404,10227,4620,10585,7580,3132,6219,6893,6697,303,380,6362,10003,7167,1722,9951,6482,7948,1768,2491,6630,2186,7404,2491,7404,592,4130,6055,2211,8835,3605,381,2190,7595,9273,4352,7510,1171,10656,\n\t\t\t         8752,6310,1722,3338,10624,10768,8524,7366,8940,6362,1722,6310,10003,6362,2338,7513,7366,8524,5990,1695,5001,5744,10204,10362,7513,2338,2091,6342,1441,5744,10768,10624,10362,10204,2091,4350,303,3922,1534,380,7608,1088,6032,2874,5495,380,1534,1208,10687,7608,2874,337,727,4352,10656,3371,3371,2550,10067,727,7770,6501,6825,3454,\n\t\t\t         7185,7770,3454,1124,1124,914,1629,7185,5990,4227,2651,1695,1913,10183,10572,201,201,7034,4642,1913,2497,9504,2190,381,7190,8967,1559,8084,8632,1243,7320,3438,1243,8354,5938,7320,8354,5811,8811,5938,5811,5979,6853,8811,5979,6757,2500,6853,8358,5482,6906,9199,6757,3165,2435,2500,3165,5080,2972,2435,10624,7366,183,3438,\n\t\t\t         1441,10624,3438,7320,7320,5938,6014,1441,5938,8811,6342,6014,7513,6342,8811,6853,10003,7513,6853,2500,2500,2435,7167,10003,812,5080,9634,9336,5134,4657,8082,8358,2513,2408,584,3096,1821,812,9336,2609,1946,7167,2435,2972,4823,9310,1790,2434,2404,9864,1765,9887,9731,3940,3436,5353,6971,4823,2434,7052,7052,2985,2379,6971,\n\t\t\t         10585,4620,9882,7147,7996,2379,2985,9184,6893,3778,2870,6697,3940,2623,8900,3436,9184,4486,2211,7996,8835,2211,4486,4914,3605,8835,4914,2115,2115,4641,3717,3605,3753,9566,9882,1883,7912,10429,1765,3045,2448,9777,6697,2870,3978,3717,4641,6021,2626,8943,3436,8900,6021,10309,6630,3978,2186,6630,10309,5332,7404,2186,5332,3195,\n\t\t\t         2448,2870,4843,6701,3195,7328,592,7404,4130,592,7328,8126,8126,8061,9096,4130,6708,9096,6155,2153,9731,971,3787,9997,9777,9443,7595,6697,9273,7595,9443,1522,1522,168,2305,9273,8061,5032,6155,9096,7005,8943,9566,3753,508,10429,3778,6893,6219,9864,4620,10585,914,2677,2421,1629,8912,7526,6501,7770,6646,8912,7770,7185,\n\t\t\t         6138,7184,8726,106,4227,5990,3226,6599,4319,1946,2972,5999,8084,6646,7185,1629,4319,5999,5398,10183,7095,7184,6138,743,7184,7095,6599,3226,6599,7095,8912,6646,743,6708,8912,7095,8726,7184,3226,9223,7890,8726,9223,4942,6203,2188,7034,201,201,10572,8341,6203,2114,5284,5474,3932,3761,2114,3932,2058,1960,3761,2058,969,\n\t\t\t         6475,1960,969,3453,6432,6475,3453,10508,8967,6432,10508,8302,1559,8967,8302,9515,2651,1559,9515,682,2114,1491,4551,5284,5503,8967,7190,1224,3761,5281,1491,2114,4551,1491,4225,3100,9108,10687,337,10272,10272,2646,8795,9108,5719,4225,1491,5281,5281,3702,10125,5719,3702,9603,7310,10125,9603,720,1239,7310,1960,3702,5281,3761,\n\t\t\t         9603,3702,1960,6475,6475,6432,720,9603,8795,2646,451,5205,1239,720,5503,877,5503,720,6432,8967,2190,9504,3922,303,8406,7890,4942,5001,5001,10362,4160,8406,10362,4350,2634,4160,2191,2634,4350,3364,6482,2191,3364,8940,7948,6482,8940,6310,1316,7948,6310,8752,3922,9504,4642,7034,7034,2188,1534,3922,1208,1534,2188,8329,\n\t\t\t         8329,4767,1963,1208,1951,1963,4767,4121,4121,9940,3547,1951,9940,1536,4353,3547,7545,4353,1536,5874,5874,8796,1080,7545,9731,9997,6732,3940,3067,6704,3787,971,9731,5353,3067,971,6708,2153,7526,8912,1913,7258,4319,10183,3096,584,1710,4190,1695,2651,682,9808,7366,1695,9808,183,9504,2497,5273,4642,1913,4642,5273,7258,\n\t\t\t         8752,5273,2497,1316,7258,5273,8752,3338,6646,8084,4227,6599,727,10067,1114,9289,9289,8796,4352,727,8796,925,7510,4352,925,2789,7870,7510,7987,1224,505,4439,1224,7190,2421,505,7190,8084,1629,2421,7594,6663,4345,8472,6663,2279,2461,4345,2279,4581,4184,2461,3205,4581,10508,3453,217,3205,3453,969,9186,217,969,2058,\n\t\t\t         9435,9186,2058,3932,9435,4205,3751,6616,999,7594,8472,8027,2619,10535,4635,10071,9999,7778,4111,7714,6906,5482,8942,9188,2408,2513,7469,6860,7714,4111,7469,10765,9188,8942,9269,9584,9971,7479,6152,1094,10782,3037,10535,2619,1932,3037,9909,9772,1094,6152,7648,569,10071,4635,3626,9764,9772,9909,5134,10458,569,7648,8344,4550,\n\t\t\t         9764,3626,4079,446,4550,8344,9269,3816,446,4079,7778,9999,8082,2629,5482,8358,10458,5134,8358,9199,1864,2513,3096,4405,4405,3096,4190,7992,5398,5999,812,1821,3523,7116,1243,8632,8966,6496,3205,217,3438,183,3635,8632,8302,10508,4581,2279,183,9808,999,3635,1012,9634,5080,3165,9808,682,7594,999,3696,2290,5979,5811,\n\t\t\t         1635,1012,3165,6757,9515,8302,2279,6663,6616,495,9186,9435,7272,3696,5811,8354,2290,1635,6757,5979,3932,5474,4205,9435,6496,4184,4581,3205,7116,7272,8354,1243,5999,2972,5080,812,495,8966,217,9186,682,9515,6663,7594,3787,6704,9289,1114,5004,4077,121,1398,8577,5529,7042,2643,4684,3243,6141,8735,1494,809,4015,10641,\n\t\t\t         2643,9458,1592,8577,1398,7042,5529,5004,121,4077,5351,3790,3790,5351,589,10465,10465,589,4100,5120,5120,4100,2095,2460,2460,2095,10593,2012,2012,10593,9112,5747,2196,518,9059,2488,3243,5057,1516,6141,4684,8735,10641,4015,7241,809,1494,6837,9458,5020,3353,1592,7406,7112,518,2196,5747,9112,7112,7406,9156,3606,10571,6532,\n\t\t\t         3606,8582,7119,10571,7841,6088,284,1833,6088,8682,284,989,7841,1833,9233,9156,989,9233,3606,7562,8889,1592,3353,3606,9233,10372,8582,442,3355,6321,1833,284,1755,9233,1833,1755,10372,3355,10709,7119,6321,6980,2775,1494,10641,6527,6980,10641,8735,2775,1232,6837,1494,8087,9573,5529,8577,9667,5669,2095,4100,9526,6533,518,\n\t\t\t         7112,2185,9667,4100,589,6533,9331,9059,518,7112,9112,6608,9526,6712,2185,589,5351,2396,3718,4077,5004,6488,6608,9112,10593,3718,6712,5351,4077,5669,6488,10593,2095,1766,279,8889,7562,4870,1269,2775,6980,7524,4870,6980,6527,1269,10332,1232,2775,8577,1592,8889,8087,5274,8790,9573,8087,442,4591,10332,1269,8087,8889,279,\n\t\t\t         5274,10709,3355,4870,7524,3355,442,1269,4870,2396,5004,5529,9573,6141,1516,10463,4109,4109,10463,3382,10252,7111,3192,6532,10571,6321,7119,8582,10372,1755,6527,8735,6141,4109,10252,7524,6527,4109,7524,10252,7111,10709,10709,7111,10571,7119,6804,7562,3353,9753,9753,3353,5020,450,7677,1766,7562,6804,1232,6804,9753,6837,6837,9753,\n\t\t\t         450,7241,10332,7677,6804,1232,10252,3382,3192,7111,8627,6866,7876,1314,3973,5479,7683,5565,9901,3842,8975,1044,3175,10288,1548,9823,5479,3973,7495,4349,6866,8627,5565,7683,7876,4073,6692,1314,4073,4864,3871,6692,4864,3826,7429,3871,3826,1033,2822,7429,1033,9701,739,2822,9701,3603,387,739,7743,7477,10566,3577,1044,8975,\n\t\t\t         1516,5057,9901,1548,10288,3842,4198,8721,3175,9823,4349,7495,1387,9762,6770,7743,3577,6633,3603,6770,6633,387,9540,3219,6443,3342,9156,6532,7634,5331,5331,7634,3342,6443,7841,4014,6767,6088,6088,6767,8682,989,4844,4014,7841,9156,5331,4844,989,4303,1387,7495,8971,5331,6443,10110,4844,7786,5594,9540,4052,4014,8193,6767,\n\t\t\t         4844,10110,8193,4014,4052,9540,3342,5549,213,10288,3175,3528,10380,3842,10288,213,3528,3175,8721,5231,7232,3973,5565,7266,7334,7429,2822,6795,7826,6633,3577,582,10597,3871,7429,7334,582,3577,10566,4925,6633,7826,6197,387,1130,6692,3871,10597,1354,8627,1314,5520,9354,739,387,6197,5520,1314,6692,1130,6795,2822,739,9354,\n\t\t\t         2700,4303,8971,6764,4805,213,3528,2544,8210,10380,213,4805,2544,3528,5231,1415,3973,7232,8971,7495,7786,2544,1415,6325,7232,9799,6764,8971,5549,8210,4805,4052,4052,4805,2544,7786,1354,7266,5565,8627,8975,4354,10463,1516,4354,9821,3382,10463,4062,7634,6532,3192,6443,3219,4857,10110,10380,4354,8975,3842,9821,4354,10380,8210,\n\t\t\t         8210,5549,4062,9821,5549,3342,7634,4062,6569,5461,1387,4303,5461,2947,9762,1387,7911,6569,4303,2700,5231,8721,5461,6569,8721,4198,2947,5461,1415,5231,6569,7911,7743,6770,7743,7406,2196,7406,7042,1398,7042,3603,9701,3603,4864,4073,4864,2947,4198,2947,5479,4349,5479,1398,121,1398,4684,4015,4684,9701,1033,9701,7683,5479,\n\t\t\t         7683,2012,5747,2012,5120,2460,5120,10465,5120,10465,7876,6866,7876,4015,809,4015,4073,7876,4073,2196,2488,2196,6770,3603,6770,2643,7042,2643,1044,5057,1044,7241,450,7241,4198,9823,4198,5057,3243,5057,3790,10465,3790,9762,2947,9762,5747,7406,5747,5020,9458,5020,9901,1044,9901,9823,1548,9823,6866,7683,6866,3826,4864,3826,\n\t\t\t         9458,2643,9458,2460,2012,2460,121,3790,121,450,5020,450,809,7241,809,7477,7743,7477,4349,9762,4349,3243,4684,3243,1033,3826,1033,1548,9901,1548,9821,4062,3192,3382,4913,7013,8353,5770,5770,8353,2093,7903,7013,1955,1872,8353,8353,1872,7713,2093,4913,5770,1835,8864,8864,1835,9204,1078,5770,7903,10595,1835,1835,10595,\n\t\t\t         9671,9204,4913,8864,2270,7013,7013,2270,2071,1955,8864,1078,3136,2270,2270,3136,1245,2071,8477,9616,8053,5680,5680,8053,5933,713,9616,9899,7152,8053,8053,7152,7715,5933,8477,5680,9343,1933,1933,9343,9,6898,5680,713,8372,9343,9343,8372,8808,9,8477,1933,4460,3777,3777,4460,6760,9945,1933,6898,4741,4460,4460,4741,\n\t\t\t         6516,6760,8477,3777,8760,9616,9616,8760,4223,9899,3777,9945,9564,8760,8760,9564,9671,4223,6465,6508,6357,7817,7817,6357,6469,3722,6508,6898,9,6357,6357,9,8808,6469,6465,7817,3956,5658,5658,3956,5322,5317,7817,3722,8592,3956,3956,8592,9914,5322,6465,5658,466,9697,9697,466,6047,9664,5658,5317,9038,466,466,9038,\n\t\t\t         8278,6047,6465,9697,9311,6508,6508,9311,4741,6898,9697,9664,9440,9311,9311,9440,6516,4741,9027,7403,991,6401,6401,991,2752,8257,7403,7239,4180,991,991,4180,8369,2752,9027,6401,3862,7357,7357,3862,1872,1955,6401,8257,10711,3862,3862,10711,7713,1872,9027,7357,10552,7403,7403,10552,6171,7239,7357,1955,2071,10552,10552,2071,\n\t\t\t         1245,6171,7819,5468,7023,4930,4930,7023,4533,5976,5468,8641,9783,7023,7023,9783,1870,4533,7819,4930,3230,6805,6805,3230,9068,10520,4930,5976,5702,3230,3230,5702,1721,9068,7819,6805,352,2844,2844,352,9687,1520,6805,10520,1616,352,352,1616,2359,9687,7819,2844,3834,5468,5468,3834,10299,8641,2844,1520,9840,3834,3834,9840,\n\t\t\t         5642,10299,6933,9009,4865,869,869,4865,2584,658,9009,10561,5857,4865,4865,5857,1692,2584,6933,869,752,156,156,752,4180,7239,869,658,3995,752,752,3995,8369,4180,6933,156,5566,9009,9009,5566,9092,10561,156,7239,6171,5566,5566,6171,1245,9092,1596,1154,2118,2554,2554,2118,3136,1078,1154,2107,4387,2118,2118,4387,\n\t\t\t         1245,3136,1596,2554,10570,6998,6998,10570,9564,9945,2554,1078,9204,10570,10570,9204,9671,9564,1596,6998,6975,1154,1154,6975,280,2107,6998,9945,6760,6975,6975,6760,6516,280,2991,8444,9770,1588,1588,9770,9440,9664,8444,2107,280,9770,9770,280,6516,9440,2991,1588,7061,10766,10766,7061,9215,10158,1588,9664,6047,7061,7061,6047,\n\t\t\t         8278,9215,2991,10766,6571,8223,8223,6571,2795,5292,10766,10158,10664,6571,6571,10664,7085,2795,2991,8223,6869,8444,8444,6869,4387,2107,8223,5292,5418,6869,6869,5418,1245,4387,9280,1225,2835,8596,8596,2835,5418,5292,1225,10561,9092,2835,2835,9092,1245,5418,9280,8596,3548,638,638,3548,9266,4392,8596,5292,2795,3548,3548,2795,\n\t\t\t         7085,9266,9280,638,6792,8283,8283,6792,4491,3711,638,4392,8376,6792,6792,8376,4470,4491,9280,8283,8417,1225,1225,8417,5857,10561,8283,3711,5501,8417,8417,5501,1692,5857,8541,228,4504,2792,2792,4504,10744,180,228,8851,4812,4504,4504,4812,4971,10744,8541,2792,5777,2920,2266,6078,8376,4392,2792,180,9228,5777,6078,1719,\n\t\t\t         4470,8376,8541,2920,5184,2530,2530,5184,619,9397,2266,4392,9266,1603,1603,9266,7085,4510,8541,2530,2008,228,228,2008,3035,8851,2530,9397,1385,2008,2008,1385,807,3035,3967,3888,10679,968,968,10679,708,955,3888,8838,1140,10679,10679,1140,7566,708,3967,968,3113,8843,8843,3113,2917,8231,968,955,3367,3113,3113,3367,\n\t\t\t         7135,2917,3967,8843,7059,3888,3888,7059,10723,8838,8843,8231,2573,7059,7059,2573,4971,10723,10612,9588,4554,6784,6784,4554,7215,5692,9588,10520,9068,4554,4554,9068,1721,7215,10612,6784,909,6066,6066,909,3367,955,6784,5692,7574,909,909,7574,7135,3367,10612,6066,10184,8997,8997,10184,4562,8555,6066,955,708,10184,10184,708,\n\t\t\t         7566,4562,10612,8997,7463,9588,9588,7463,1616,10520,8997,8555,6511,7463,7463,6511,2359,1616,7531,3467,8812,4289,4289,8812,4828,2394,3467,1520,9687,8812,8812,9687,2359,4828,7531,4289,1653,8676,8676,1653,8372,713,4289,2394,9166,1653,1653,9166,8808,8372,7531,8676,2349,7960,7960,2349,5347,9673,8676,713,5933,2349,2349,5933,\n\t\t\t         7715,5347,7531,7960,8839,3467,3467,8839,9840,1520,7960,9673,7204,8839,8839,7204,5642,9840,3291,34,4880,7019,7019,4880,9064,8146,34,8555,4562,4880,4880,4562,7566,9064,3291,7019,2546,703,703,2546,6938,6037,7019,8146,5042,2546,2546,5042,1549,6938,3291,703,3997,34,34,3997,6511,8555,703,6037,2061,3997,3997,2061,\n\t\t\t         2359,6511,6075,10268,5950,9803,9803,5950,2061,6037,10268,2394,4828,5950,5950,4828,2359,2061,6075,9803,6497,966,966,6497,8955,5199,9803,6037,6938,6497,6497,6938,1549,8955,6075,966,1906,9542,9542,1906,8592,3722,966,5199,254,1906,1906,254,9914,8592,6075,9542,5058,10268,10268,5058,9166,2394,9542,3722,6469,5058,5058,6469,\n\t\t\t         8808,9166,1212,3658,7928,2326,2326,7928,10238,5176,3658,5199,8955,7928,7928,8955,1549,10238,1212,2326,7642,4928,4928,7642,6729,3486,2326,5176,884,7642,7642,884,6661,6729,1212,4928,1217,10748,10748,1217,1040,3772,4928,3486,8757,1217,1217,8757,7828,1040,1212,10748,10037,3658,3658,10037,254,5199,10748,3772,3885,10037,10037,3885,\n\t\t\t         9914,254,9833,6287,3957,9677,9677,3957,9716,4107,6287,8146,9064,3957,3957,9064,7566,9716,9833,9677,5348,4783,4783,5348,10646,6930,9677,4107,6136,5348,5348,6136,4577,10646,9833,4783,4042,3830,3830,4042,884,5176,4783,6930,7033,4042,4042,7033,6661,884,9833,3830,4131,6287,6287,4131,5042,8146,3830,5176,10238,4131,4131,10238,\n\t\t\t         1549,5042,7539,4096,9433,391,391,9433,885,1113,4096,10158,9215,9433,9433,9215,8278,885,7539,391,3974,10121,10121,3974,4038,2919,391,1113,500,3974,3974,500,6345,4038,7539,10121,6422,7569,7569,6422,8261,9744,10121,2919,3926,6422,6422,3926,6965,8261,7539,7569,9049,4096,4096,9049,10664,10158,7569,9744,2685,9049,9049,2685,\n\t\t\t         7085,10664,9907,10644,3464,4858,4858,3464,1385,9397,10644,9219,1142,3464,3464,1142,807,1385,9907,4858,1456,1423,5325,10348,2685,9744,4858,9397,619,1456,10348,4510,7085,2685,9907,1423,10069,3473,3473,10069,5462,9982,5325,9744,8261,10261,10261,8261,6965,10493,9907,3473,1983,10644,10644,1983,1101,9219,3473,9982,10018,1983,1983,10018,\n\t\t\t         2207,1101,8549,4022,6543,2977,2977,6543,3885,3772,4022,5317,5322,6543,6543,5322,9914,3885,8549,2977,8112,6545,6545,8112,5762,6719,2977,3772,1040,8112,8112,1040,7828,5762,8549,6545,988,2669,2669,988,500,1113,6545,6719,433,988,988,433,6345,500,8549,2669,2427,4022,4022,2427,9038,5317,2669,1113,885,2427,2427,885,\n\t\t\t         8278,9038,1126,2656,2405,7878,7878,2405,1142,9219,2656,8851,3035,2405,2405,3035,807,1142,1126,7878,9613,6913,6913,9613,4383,4238,7878,9219,1101,9613,9613,1101,2207,4383,1126,6913,2175,4033,4033,2175,10122,10063,6913,4238,1008,2175,2175,1008,8713,10122,1126,4033,7896,2656,2656,7896,4812,8851,4033,10063,9895,7896,7896,9895,\n\t\t\t         4971,4812,146,2369,5578,384,384,5578,9895,10063,2369,8838,10723,5578,5578,10723,4971,9895,146,384,9721,4846,4846,9721,3146,178,384,10063,10122,9721,9721,10122,8713,3146,146,4846,4074,10219,10219,4074,6136,4107,4846,178,1923,4074,4074,1923,4577,6136,146,10219,5984,2369,2369,5984,1140,8838,10219,4107,9716,5984,5984,9716,\n\t\t\t         7566,1140,10613,4577,1923,2598,295,178,3146,6460,6460,3146,8713,7535,10539,1008,4238,3823,295,6460,1773,7775,2505,1773,8120,1614,6460,7535,8120,1773,6553,9857,8918,94,295,7775,10030,2598,2598,10030,336,10613,7029,7775,1773,2505,7029,4730,10030,7775,8713,1008,10539,7535,3823,4238,4383,1783,1783,4383,2207,4737,1550,3486,\n\t\t\t         6729,3102,3823,1783,5918,4545,2904,5918,7017,9547,1783,4737,7017,5918,4730,1604,336,10030,3823,4545,2490,10539,10539,2490,8120,7535,2068,4545,5918,2904,2068,3435,2490,4545,3102,6729,6661,2941,3040,8757,3486,1550,1550,3102,4402,8633,4159,4402,10565,5165,3102,2941,10565,4402,3435,1614,8120,2490,1550,8633,2624,3040,3040,2624,\n\t\t\t         9649,1571,9222,8633,4402,4159,9222,4338,2624,8633,7828,8757,3040,1571,93,6930,10646,2536,2536,10646,4577,10613,5110,7033,6930,93,93,2536,10543,9488,2238,2744,9153,9488,2536,10613,336,10543,2238,9488,10543,3895,93,9488,9153,5110,5110,9153,10565,2941,2744,5165,10565,9153,4338,10105,9649,2624,2941,6661,7033,5110,10472,2919,\n\t\t\t         4038,4698,4698,4038,6345,3643,5761,3926,2919,10472,10472,4698,9407,6886,823,9407,5038,4508,4698,3643,5038,9407,3895,10543,336,1604,10472,6886,10706,5761,5761,10706,3050,6572,4946,6886,9407,823,4946,7400,10706,6886,6965,3926,5761,6572,652,10018,9982,10598,2207,10018,652,4737,10598,9982,5462,7454,10064,10493,6965,6572,9161,6719,\n\t\t\t         5762,3515,10598,7454,2860,8197,5995,6881,7465,8197,10064,6572,3050,4835,5995,8197,2860,6361,10598,8197,7465,652,652,7465,7017,4737,6881,9547,7017,7465,7400,3933,3050,10706,3515,5762,7828,1571,10734,433,6719,9161,9161,3515,10502,10082,1930,10502,9649,10105,3515,1571,9649,10502,184,4835,3050,3933,9161,10082,4859,10734,10734,4859,\n\t\t\t         5038,3643,8775,10082,10502,1930,8775,2590,4859,10082,3643,6345,433,10734,1480,10337,4730,7029,10337,7209,1604,4730,1480,7029,2505,1703,1703,2505,1614,4173,1480,1703,2981,5294,5294,2981,3677,5143,1703,4173,6119,2981,2981,6119,2647,3677,1480,5294,9889,10337,10337,9889,6803,7209,5294,5143,2535,9889,9889,2535,9427,6803,7942,6293,\n\t\t\t         3435,2068,6293,4173,1614,3435,7942,2068,2904,8025,8025,2904,9547,74,7942,8025,8949,5625,5625,8949,8224,10078,8025,74,2714,8949,8949,2714,4230,8224,7942,5625,9590,6293,6293,9590,6119,4173,5625,10078,2040,9590,9590,2040,2647,6119,2641,9222,4159,8791,8791,4159,5165,1369,2641,8791,906,1785,1785,906,3734,10205,8791,1369,\n\t\t\t         2330,906,906,2330,6549,3734,2641,1785,5404,5859,5859,5404,2946,2799,1785,10205,1242,5404,5404,1242,8142,2946,2641,5859,4338,9222,5859,2799,10105,4338,7751,2238,3895,1852,1852,3895,1604,7209,7751,1852,1131,3712,3712,1131,5596,10038,1852,7209,6803,1131,1131,6803,9427,5596,7751,3712,5799,1347,1347,5799,2330,1369,3712,10038,\n\t\t\t         9448,5799,5799,9448,6549,2330,7751,1347,2744,2238,1347,1369,5165,2744,8789,4946,823,8906,8906,823,4508,8033,8789,8906,6878,7924,7924,6878,7181,4996,8906,8033,7081,6878,6878,7081,9259,7181,8789,7924,7129,5431,5431,7129,4672,1819,7924,4996,10698,7129,7129,10698,6487,4672,8789,5431,7400,4946,5431,1819,3933,7400,7956,7946,\n\t\t\t         6881,5995,7946,74,9547,6881,7956,5995,6361,1557,1168,184,3933,1819,7956,1557,6192,6835,6835,6192,7297,4316,1168,1819,4672,4091,4091,4672,6487,4851,7956,6835,2400,7946,7946,2400,2714,74,6835,4316,1999,2400,2400,1999,4230,2714,4955,8775,1930,10762,10762,1930,10105,2799,4955,10762,10747,7351,7351,10747,9665,3056,10762,2799,\n\t\t\t         2946,10747,10747,2946,8142,9665,4955,7351,9560,939,939,9560,7081,8033,7351,3056,2358,9560,9560,2358,9259,7081,4955,939,2590,8775,939,8033,4508,2590,725,6821,5304,7794,7794,5304,2535,5143,6821,1925,6976,5304,5304,6976,9427,2535,725,7794,4801,4154,4154,4801,429,10281,7794,5143,3677,4801,4801,3677,2647,429,725,4154,\n\t\t\t         7054,4113,4113,7054,5098,683,4154,10281,2770,7054,7054,2770,10292,5098,725,4113,3099,6821,6821,3099,3921,1925,4113,683,9224,3099,3099,9224,4082,3921,6273,1229,10197,1056,1056,10197,2040,10078,1229,10281,429,10197,10197,429,2647,2040,6273,1056,919,7105,7105,919,7146,4931,1056,10078,8224,919,919,8224,4230,7146,6273,7105,\n\t\t\t         1957,422,422,1957,3948,9077,7105,4931,328,1957,1957,328,8784,3948,6273,422,4265,1229,1229,4265,2770,10281,422,9077,9261,4265,4265,9261,10292,2770,7849,9063,1029,4747,4747,1029,5671,9151,9063,10205,3734,1029,1029,3734,6549,5671,7849,4747,7027,6851,6851,7027,6671,2156,4747,9151,3495,7027,7027,3495,3742,6671,7849,6851,\n\t\t\t         747,283,283,747,4886,3366,6851,2156,248,747,747,248,2727,4886,7849,283,2485,9063,9063,2485,1242,10205,283,3366,1366,2485,2485,1366,8142,1242,7268,6429,2658,8436,8436,2658,6976,1925,6429,10038,5596,2658,2658,5596,9427,6976,7268,8436,2965,7913,7913,2965,1364,655,8436,1925,3921,2965,2965,3921,4082,1364,7268,7913,\n\t\t\t         1889,9637,9637,1889,3495,9151,7913,655,1296,1889,1889,1296,3742,3495,7268,9637,4605,6429,6429,4605,9448,10038,9637,9151,5671,4605,4605,5671,6549,9448,2409,4879,10202,6198,6198,10202,4617,2032,4879,4996,7181,10202,10202,7181,9259,4617,2409,6198,1996,486,486,1996,4719,1984,6198,2032,5535,1996,1996,5535,2201,4719,2409,486,\n\t\t\t         10767,956,956,10767,1291,1985,486,1984,5523,10767,10767,5523,7951,1291,2409,956,3325,4879,4879,3325,10698,4996,956,1985,10311,3325,3325,10311,6487,10698,790,10180,10461,1727,1727,10461,1999,4316,10180,4931,7146,10461,10461,7146,4230,1999,790,1727,5500,1421,4754,1532,10311,1985,1727,4316,7297,5500,1532,4851,6487,10311,790,1421,\n\t\t\t         7795,6709,6709,7795,2244,3640,4754,1985,1291,10015,10015,1291,7951,6703,790,6709,10279,10180,10180,10279,328,4931,6709,3640,3098,10279,10279,3098,8784,328,3101,9850,2956,2892,2892,2956,1366,3366,9850,3056,9665,2956,2956,9665,8142,1366,3101,2892,3573,4892,4892,3573,7008,9258,2892,3366,4886,3573,3573,4886,2727,7008,3101,4892,\n\t\t\t         9023,2229,2229,9023,5535,2032,4892,9258,4686,9023,9023,4686,2201,5535,3101,2229,5178,9850,9850,5178,2358,3056,2229,2032,4617,5178,5178,4617,9259,2358,7927,4082,9224,7563,2644,683,5098,2011,2011,5098,10292,8758,7680,9261,9077,848,2644,2011,3390,1650,1650,3390,485,5225,2011,8758,1684,3390,3390,1684,3240,485,2644,1650,\n\t\t\t         6017,7563,7563,6017,8208,7927,1650,5225,2588,6017,6017,2588,4415,8208,10292,9261,7680,8758,848,9077,3948,2564,2564,3948,8784,8879,1203,2156,6671,4228,848,2564,5446,8030,8030,5446,8548,8064,2564,8879,6904,5446,5446,6904,1074,8548,848,8030,4237,7680,7680,4237,1684,8758,8030,8064,7173,4237,4237,7173,3240,1684,4228,6671,\n\t\t\t         3742,2348,8714,248,2156,1203,1203,4228,1085,6438,6438,1085,1673,5466,4228,2348,6919,1085,1085,6919,9923,1673,1203,6438,1683,8714,8714,1683,2862,7842,6438,5466,1846,1683,1683,1846,9627,2862,2727,248,8714,7842,4659,655,1364,2853,2853,1364,4082,7927,1605,1296,655,4659,4659,2853,2501,3905,3905,2501,2049,520,2853,7927,\n\t\t\t         8208,2501,2501,8208,4415,2049,4659,3905,5206,1605,1605,5206,6919,2348,3905,520,2134,5206,5206,2134,9923,6919,2348,3742,1296,1605,3561,1984,4719,8422,8422,4719,2201,5574,87,5523,1984,3561,3561,8422,6303,4023,4023,6303,4117,221,8422,5574,10312,6303,6303,10312,4650,4117,3561,4023,7148,87,87,7148,9928,7398,4023,221,\n\t\t\t         250,7148,7148,250,4102,9928,7951,5523,87,7398,10554,3098,3640,2889,8784,3098,10554,8879,2889,3640,2244,8522,3124,6703,7951,7398,8078,9258,7008,796,2889,8522,816,776,776,816,5248,5962,3124,7398,9928,3128,3128,9928,4102,6419,2889,776,9968,10554,10554,9968,6904,8879,776,5962,7632,9968,9968,7632,1074,6904,796,7008,\n\t\t\t         2727,7842,4483,4686,9258,8078,8078,796,1904,10355,10355,1904,8531,2615,796,7842,2862,1904,1904,2862,9627,8531,8078,10355,1216,4483,4483,1216,10312,5574,10355,2615,4798,1216,1216,4798,4650,10312,5574,2201,4686,4483,4201,10636,9256,2125,2273,7318,1198,10728,8976,2273,2588,5225,4768,2426,8285,7643,2273,10728,4415,2588,5986,6095,\n\t\t\t         1771,8357,8976,3860,7318,2273,8976,5225,485,8357,8357,485,3240,5986,3860,1771,2078,4,1771,6095,472,2078,3860,4,9376,7318,7318,9376,48,1198,922,8773,6095,5986,7643,922,7173,8064,5818,7251,6690,7733,922,5986,3240,7173,8315,99,2426,4768,7643,8285,8773,922,7643,8064,8548,4768,4768,8548,1074,8315,8285,2426,\n\t\t\t         5328,3447,2426,99,947,5328,8285,3447,1032,8773,8773,1032,472,6095,9802,7251,5818,9618,7981,700,7733,6690,7733,5466,1673,5818,5818,1673,9923,9618,6690,7251,3167,8099,7251,9802,6186,3167,7182,700,7981,8063,6309,2340,6302,5302,6690,8099,4518,7981,7981,4518,6759,8063,7733,700,1846,5466,700,7182,9627,1846,1198,2340,\n\t\t\t         6309,10728,4685,5771,5302,6302,5302,520,2049,6309,6309,2049,4415,10728,6302,2340,10208,5414,2340,1198,48,10208,9802,9618,5771,4685,920,8470,4161,1922,6302,5414,7670,4685,4685,7670,6186,9802,5302,5771,2134,520,5771,9618,9923,2134,4546,8470,920,7515,6298,8701,1922,4161,1922,221,4117,920,920,4117,4650,7515,4161,8470,\n\t\t\t         8212,9103,8470,4546,8020,8212,3819,8701,6298,9414,7031,5925,4426,9597,4161,9103,6491,6298,6298,6491,10167,9414,1922,8701,250,221,8701,3819,4102,250,4056,10785,99,8315,9597,4056,7632,5962,1336,9035,7856,1723,4056,8315,1074,7632,3819,9414,614,2721,9597,4426,10785,4056,9597,5962,5248,7031,2721,6419,4102,3819,4426,5925,\n\t\t\t         5438,6510,614,9414,10167,1111,4426,6510,8159,10785,10785,8159,947,99,7182,8063,9035,1336,2608,6301,1723,7856,1723,2615,8531,1336,1336,8531,9627,7182,7856,9035,3322,2390,9035,8063,6759,3322,4546,7515,6301,2608,8518,8886,1725,2589,7856,2390,3730,2608,2608,3730,8020,4546,1723,6301,4798,2615,6301,7515,4650,4798,942,4276,\n\t\t\t         3300,3638,3638,3300,10614,974,4276,9159,5071,3300,3300,5071,40,10614,942,3638,8205,2915,2915,8205,8489,4409,3638,974,7121,8205,8205,7121,8798,8489,942,2915,3923,3665,3665,3923,1667,2073,2915,4409,5894,3923,3923,5894,10031,1667,942,3665,3343,4276,4276,3343,4532,9159,3665,2073,2144,3343,3343,2144,4894,4532,6922,9582,\n\t\t\t         6129,2665,2665,6129,5071,9159,9582,775,4152,6129,6129,4152,40,5071,6922,2665,10275,7556,7556,10275,6929,7109,2665,9159,4532,10275,10275,4532,4894,6929,6922,7556,1805,7554,7554,1805,9019,10603,7556,7109,3118,1805,1805,3118,3399,9019,6922,7554,4895,9582,9582,4895,2521,775,7554,10603,9689,4895,4895,9689,7604,2521,3533,6358,\n\t\t\t         6359,9658,9658,6359,9689,10603,6358,3584,5229,6359,6359,5229,7604,9689,3533,9658,26,5806,5806,26,4369,3800,9658,10603,9019,26,26,9019,3399,4369,3533,5806,5022,2635,2635,5022,332,7598,5806,3800,6490,5022,5022,6490,642,332,3533,2635,4495,6358,6358,4495,5854,3584,2635,7598,2866,4495,4495,2866,8523,5854,2234,951,\n\t\t\t         1926,707,707,1926,2866,7598,951,10019,172,1926,1926,172,8523,2866,2234,707,3041,5833,5833,3041,10741,7186,707,7598,332,3041,3041,332,642,10741,2234,5833,10123,4715,4715,10123,9444,10557,5833,7186,10482,10123,10123,10482,7058,9444,2234,4715,7816,951,951,7816,3084,10019,4715,10557,1590,7816,7816,1590,2063,3084,7620,2577,\n\t\t\t         8152,129,129,8152,1590,10557,2577,4954,10511,8152,8152,10511,2063,1590,7620,129,5103,1361,1361,5103,6116,8717,129,10557,9444,5103,5103,9444,7058,6116,7620,1361,9930,7094,7094,9930,6363,1628,1361,8717,9048,9930,9930,9048,1880,6363,7620,7094,5957,2577,2577,5957,852,4954,7094,1628,634,5957,5957,634,8427,852,3886,2060,\n\t\t\t         10629,4310,4310,10629,2144,2073,2060,734,935,10629,10629,935,4894,2144,3886,4310,9274,1895,1895,9274,4046,3151,4310,2073,1667,9274,9274,1667,10031,4046,3886,1895,10542,671,671,10542,612,2492,1895,3151,6109,10542,10542,6109,6538,612,3886,671,4594,2060,2060,4594,9706,734,671,2492,6842,4594,4594,6842,3763,9706,1332,478,\n\t\t\t         8119,1851,1851,8119,935,734,478,7109,6929,8119,8119,6929,4894,935,1332,1851,2966,7408,7408,2966,1084,5371,1851,734,9706,2966,2966,9706,3763,1084,1332,7408,10070,2703,2703,10070,1144,9110,7408,5371,8381,10070,10070,8381,6498,1144,1332,2703,10140,478,478,10140,3118,7109,2703,9110,553,10140,10140,553,3399,3118,9293,7187,\n\t\t\t         6199,6558,6558,6199,553,9110,7187,3800,4369,6199,6199,4369,3399,553,9293,6558,756,10024,10024,756,2449,2587,6558,9110,1144,756,756,1144,6498,2449,9293,10024,5835,1241,1241,5835,4734,9328,10024,2587,9365,5835,5835,9365,127,4734,9293,1241,6143,7187,7187,6143,6490,3800,1241,9328,5853,6143,6143,5853,642,6490,4181,8580,\n\t\t\t         2101,4853,4853,2101,5853,9328,8580,7186,10741,2101,2101,10741,642,5853,4181,4853,4010,3870,3870,4010,2630,5045,4853,9328,4734,4010,4010,4734,127,2630,4181,3870,1325,6159,6159,1325,5610,4744,3870,5045,8921,1325,1325,8921,1222,5610,4181,6159,3042,8580,8580,3042,10482,7186,6159,4744,853,3042,3042,853,7058,10482,10198,4440,\n\t\t\t         3709,961,961,3709,853,4744,4440,8717,6116,3709,3709,6116,7058,853,10198,961,2474,5137,5137,2474,7959,7625,961,4744,5610,2474,2474,5610,1222,7959,10198,5137,6147,3855,3855,6147,9093,6561,5137,7625,4454,6147,6147,4454,1410,9093,10198,3855,9757,4440,4440,9757,9048,8717,3855,6561,1267,9757,9757,1267,1880,9048,3939,1956,\n\t\t\t         1908,1310,1310,1908,4454,7625,1956,2984,6108,1908,1908,6108,1410,4454,3939,1310,4397,3972,3972,4397,2458,4943,1310,7625,7959,4397,4397,7959,1222,2458,3939,3972,679,1956,1956,679,6016,2984,3972,4943,5791,679,679,5791,10353,6016,7659,10331,8274,1089,1089,8274,8921,5045,10331,4943,2458,8274,8274,2458,1222,8921,7659,1089,\n\t\t\t         8496,8158,8158,8496,9462,9483,1089,5045,2630,8496,8496,2630,127,9462,7659,8158,9695,10331,10331,9695,5791,4943,8158,9483,4636,9695,9695,4636,10353,5791,10277,252,1717,6895,6895,1717,3157,10371,252,2984,6016,1717,1717,6016,10353,3157,10277,6895,4978,9022,9022,4978,9486,5650,6895,10371,9848,4978,4978,9848,2707,9486,10277,9022,\n\t\t\t         8306,252,252,8306,6108,2984,9022,5650,7976,8306,8306,7976,1410,6108,3026,9742,8401,827,827,8401,4636,9483,9742,5956,8995,8401,8401,8995,10353,4636,3026,827,10619,1418,1418,10619,8616,3617,827,9483,9462,10619,10619,9462,127,8616,3026,1418,3915,9742,9742,3915,4219,5956,1418,3617,7568,3915,3915,7568,7028,4219,5417,3897,\n\t\t\t         9234,5096,5096,9234,9365,2587,3897,3617,8616,9234,9234,8616,127,9365,5417,5096,3457,933,933,3457,7882,8275,5096,2587,2449,3457,3457,2449,6498,7882,5417,933,2847,3897,3897,2847,7568,3617,933,8275,5936,2847,2847,5936,7028,7568,1338,1329,8683,1643,1643,8683,7399,8434,1329,5956,4219,8683,8683,4219,7028,7399,1338,1643,\n\t\t\t         7501,6457,6457,7501,5722,7445,1643,8434,3003,7501,7501,3003,7917,5722,1338,6457,9534,1329,1329,9534,8995,5956,6457,7445,4254,9534,9534,4254,10353,8995,7619,4889,2392,1289,1289,2392,7612,1004,4889,7445,5722,2392,2392,5722,7917,7612,7619,1289,972,1028,1028,972,7144,3422,1289,1004,3129,972,972,3129,2471,7144,7619,1028,\n\t\t\t         6728,4889,4889,6728,4254,7445,1028,3422,7914,6728,6728,7914,10353,4254,10453,8131,8698,3869,3869,8698,8244,628,8131,3587,7851,8698,8698,7851,8800,8244,10453,3869,10389,7660,7660,10389,1575,6499,3869,628,5360,10389,10389,5360,2240,1575,10453,7660,7312,8131,8131,7312,4202,3587,7660,6499,10736,7312,7312,10736,3829,4202,4525,6243,\n\t\t\t         1393,6391,6391,1393,5936,8275,6243,8938,8681,1393,1393,8681,7028,5936,4525,6391,6161,8079,8079,6161,746,3919,6391,8275,7882,6161,6161,7882,6498,746,4525,8079,3307,6243,6243,3307,4075,8938,8079,3919,4493,3307,3307,4493,8896,4075,557,9698,4610,9271,9271,4610,6355,8771,9698,3422,7144,4610,4610,7144,2471,6355,557,9271,\n\t\t\t         5664,4770,4770,5664,9848,10371,9271,8771,2572,5664,5664,2572,2707,9848,557,4770,1877,9698,9698,1877,7914,3422,4770,10371,3157,1877,1877,3157,10353,7914,356,5198,140,1613,1613,140,8,5839,5198,4841,9366,140,140,9366,3694,8,356,1613,1112,6110,6110,1112,2235,10467,1613,5839,2691,1112,1112,2691,2312,2235,356,6110,\n\t\t\t         1228,5198,5198,1228,10239,4841,6110,10467,10382,1228,1228,10382,3829,10239,8207,509,10615,6236,6236,10615,3129,1004,509,9255,9326,10615,10615,9326,2471,3129,8207,6236,4764,9605,9605,4764,2898,9953,6236,1004,7612,4764,4764,7612,7917,2898,8207,9605,4923,509,509,4923,8928,9255,9605,9953,758,4923,4923,758,2538,8928,981,6985,\n\t\t\t         7815,7591,7591,7815,6523,6695,6985,10467,2235,7815,7815,2235,2312,6523,981,7591,4021,2565,2565,4021,7851,3587,7591,6695,1750,4021,4021,1750,8800,7851,981,2565,669,6985,6985,669,10382,10467,2565,3587,4202,669,669,4202,3829,10382,2343,7217,1303,3298,3298,1303,9541,6735,7217,10182,822,1303,1303,822,1426,9541,2343,3298,\n\t\t\t         5825,4654,4654,5825,2691,5839,3298,6735,8587,5825,5825,8587,2312,2691,2343,4654,10486,7217,7217,10486,10599,10182,4654,5839,8,10486,10486,8,3694,10599,4993,2672,373,9197,9197,373,3984,3206,2672,7802,1528,373,373,1528,5775,3984,4993,9197,3349,7550,7550,3349,822,10182,9197,3206,6082,3349,3349,6082,1426,822,4993,7550,\n\t\t\t         1734,2672,2672,1734,9084,7802,7550,10182,10599,1734,1734,10599,3694,9084,2574,1067,3368,7330,7330,3368,2476,6217,1067,3206,3984,3368,3368,3984,5775,2476,2574,7330,9870,7852,7852,9870,8903,4827,7330,6217,7810,9870,9870,7810,8102,8903,2574,7852,7280,1067,1067,7280,6082,3206,7852,4827,6743,7280,7280,6743,1426,6082,5832,10247,\n\t\t\t         5035,7838,7838,5035,998,10047,10247,5371,1084,5035,5035,1084,3763,998,5832,7838,2930,5902,5902,2930,635,685,7838,10047,10645,2930,2930,10645,2923,635,5832,5902,5983,7378,7378,5983,4493,3919,5902,685,10779,5983,5983,10779,8896,4493,5832,7378,8019,10247,10247,8019,8381,5371,7378,3919,746,8019,8019,746,6498,8381,4873,2730,\n\t\t\t         7868,3232,3232,7868,7300,10011,2730,4951,2876,7868,7868,2876,1530,7300,4873,3232,9088,8763,8763,9088,10779,685,3232,10011,2716,9088,9088,2716,8896,10779,4873,8763,10286,2730,2730,10286,3851,4951,8763,685,635,10286,10286,635,2923,3851,8813,10094,7560,5185,5185,7560,1353,6157,10094,4951,3851,7560,7560,3851,2923,1353,8813,5185,\n\t\t\t         4025,3357,3357,4025,5780,3725,5185,6157,5430,4025,4025,5430,10477,5780,8813,3357,10707,10094,10094,10707,2876,4951,3357,3725,4325,10707,10707,4325,1530,2876,3766,5570,2996,8922,8922,2996,4325,3725,5570,9306,10530,2996,2996,10530,1530,4325,3766,8922,3962,8083,8083,3962,898,9702,8922,3725,5780,3962,3962,5780,10477,898,3766,8083,\n\t\t\t         5779,5570,5570,5779,9461,9306,8083,9702,4234,5779,5779,4234,2538,9461,5366,9442,2245,1531,1531,2245,4234,9702,9442,9255,8928,2245,2245,8928,2538,4234,5366,1531,9091,4750,4750,9091,4296,1201,1531,9702,898,9091,9091,898,10477,4296,5366,4750,3259,9442,9442,3259,9326,9255,4750,1201,10266,3259,3259,10266,2471,9326,2496,10722,\n\t\t\t         9830,8465,8465,9830,10266,1201,10722,1705,7840,9830,9830,7840,2471,10266,2496,8465,7952,8298,8298,7952,6353,7260,8465,1201,4296,7952,7952,4296,10477,6353,2496,8298,5115,6050,6050,5115,4119,3,8298,7260,10481,5115,5115,10481,1976,4119,2496,6050,1521,10722,10722,1521,4705,1705,6050,3,4852,1521,1521,4852,3420,4705,5415,7932,\n\t\t\t         139,1857,1857,139,5430,6157,7932,7260,6353,139,139,6353,10477,5430,5415,1857,8514,2363,2363,8514,9734,3868,1857,6157,1353,8514,8514,1353,2923,9734,5415,2363,6626,4215,4215,6626,6278,1231,2363,3868,4671,6626,6626,4671,6689,6278,5415,4215,5804,7932,7932,5804,10481,7260,4215,1231,5963,5804,5804,5963,1976,10481,6069,5410,\n\t\t\t         9018,7807,7807,9018,10645,10047,5410,3868,9734,9018,9018,9734,2923,10645,6069,7807,10714,9694,9694,10714,4782,4273,7807,10047,998,10714,10714,998,3763,4782,6069,9694,6575,7289,7289,6575,401,824,9694,4273,6184,6575,6575,6184,3757,401,6069,7289,2097,5410,5410,2097,4671,3868,7289,824,10634,2097,2097,10634,6689,4671,8977,6862,\n\t\t\t         3478,7222,7222,3478,6842,2492,6862,4273,4782,3478,3478,4782,3763,6842,8977,7222,835,9746,9746,835,1729,3693,7222,2492,612,835,835,612,6538,1729,8977,9746,8625,3531,3531,8625,931,7134,9746,3693,1098,8625,8625,1098,190,931,8977,3531,3302,6862,6862,3302,6184,4273,3531,7134,9080,3302,3302,9080,3757,6184,10647,54,\n\t\t\t         10249,2214,2214,10249,7840,1705,54,8771,6355,10249,10249,6355,2471,7840,10647,2214,3925,9160,9160,3925,5800,5445,2214,1705,4705,3925,3925,4705,3420,5800,10647,9160,372,54,54,372,2572,8771,9160,5445,8124,372,372,8124,2707,2572,10155,10338,2159,8322,8322,2159,4852,3,10338,2807,10776,2159,2159,10776,3420,4852,10155,8322,\n\t\t\t         3409,6272,6272,3409,9989,6794,8322,3,4119,3409,3409,4119,1976,9989,10155,6272,8614,913,913,8614,4757,5133,6272,6794,2805,8614,8614,2805,10751,4757,10155,913,6629,10338,10338,6629,7712,2807,913,5133,7053,6629,6629,7053,3265,7712,9568,6513,7267,4007,4007,7267,3475,6339,6513,10589,6126,7267,7267,6126,6848,3475,9568,4007,\n\t\t\t         8073,5380,5380,8073,6714,6685,4007,6339,8615,8073,8073,8615,2247,6714,9568,5380,728,6513,6513,728,2620,10589,5380,6685,8569,728,728,8569,6689,2620,3918,2315,2840,9086,9086,2840,10634,824,2315,10589,2620,2840,2840,2620,6689,10634,3918,9086,9123,10264,10264,9123,4670,1132,9086,824,401,9123,9123,401,3757,4670,3918,10264,\n\t\t\t         2659,9072,9072,2659,630,8405,10264,1132,7899,2659,2659,7899,8481,630,3918,9072,5684,2315,2315,5684,6126,10589,9072,8405,3883,5684,5684,3883,6848,6126,5731,5422,8697,5128,5128,8697,10776,2807,5422,5445,5800,8697,8697,5800,3420,10776,5731,5128,7793,2849,2849,7793,7520,8198,5128,2807,7712,7793,7793,7712,3265,7520,5731,2849,\n\t\t\t         2719,5422,5422,2719,8124,5445,2849,8198,7671,2719,2719,7671,2707,8124,7472,10200,9372,5982,5982,9372,9080,7134,10200,1132,4670,9372,9372,4670,3757,9080,7472,5982,2437,9262,9262,2437,6742,8593,5982,7134,931,2437,2437,931,190,6742,7472,9262,6318,10200,10200,6318,7899,1132,9262,8593,4695,6318,6318,4695,8481,7899,9740,587,\n\t\t\t         8490,8869,8869,8490,5437,2237,587,6685,6714,8490,8490,6714,2247,5437,9740,8869,4948,6306,6306,4948,2805,6794,8869,2237,1580,4948,4948,1580,10751,2805,9740,6306,421,4422,4422,421,5963,1231,6306,6794,9989,421,421,9989,1976,5963,9740,4422,3427,587,587,3427,8569,6685,4422,1231,6278,3427,3427,6278,6689,8569,2699,5952,\n\t\t\t         6832,304,304,6832,7810,6217,5952,2526,5358,6832,6832,5358,8102,7810,2699,304,3088,5075,5075,3088,7344,1561,304,6217,2476,3088,3088,2476,5775,7344,2699,5075,10648,8985,8985,10648,3815,4253,5075,1561,10484,10648,10648,10484,535,3815,2699,8985,4816,5952,5952,4816,6213,2526,8985,4253,821,4816,4816,821,9067,6213,10661,1742,\n\t\t\t         9250,6430,6430,9250,1528,7802,1742,1561,7344,9250,9250,7344,5775,1528,10661,6430,8400,2381,2381,8400,4076,9863,6430,7802,9084,8400,8400,9084,3694,4076,10661,2381,4423,6879,6879,4423,493,4211,2381,9863,7101,4423,4423,7101,3328,493,10661,6879,7736,1742,1742,7736,10484,1561,6879,4211,8260,7736,7736,8260,535,10484,2397,9717,\n\t\t\t         3443,2286,2286,3443,9366,4841,9717,9863,4076,3443,3443,4076,3694,9366,2397,2286,4456,2877,2877,4456,8944,2692,2286,4841,10239,4456,4456,10239,3829,8944,2397,2877,10230,5813,5813,10230,6308,1637,2877,2692,9661,10230,10230,9661,3170,6308,2397,5813,3268,9717,9717,3268,7101,9863,5813,1637,8425,3268,3268,8425,3328,7101,1861,35,\n\t\t\t         621,7262,7262,621,9964,10474,35,3511,9355,621,621,9355,2240,9964,1861,7262,1161,4255,7644,7706,5358,2526,7262,10474,8998,1161,7706,89,8102,5358,1861,4255,10701,6540,6540,10701,764,3374,7644,2526,6213,4207,4207,6213,9067,573,1861,6540,102,35,35,102,9690,3511,6540,3374,8190,102,102,8190,2067,9690,5638,1507,\n\t\t\t         10357,8751,8751,10357,10736,6499,1507,2692,8944,10357,10357,8944,3829,10736,5638,8751,6901,494,494,6901,9355,3511,8751,6499,1575,6901,6901,1575,2240,9355,5638,494,9341,2415,2415,9341,9436,1804,494,3511,9690,9341,9341,9690,2067,9436,5638,2415,4138,1507,1507,4138,9661,2692,2415,1804,5667,4138,4138,5667,3170,9661,4905,9020,\n\t\t\t         7359,5782,5782,7359,4972,10523,9020,1637,6308,7359,7359,6308,3170,4972,4905,5782,8626,366,366,8626,3924,3376,5782,10523,7836,8626,8626,7836,7891,3924,4905,366,1782,8304,8304,1782,1355,9587,366,3376,504,1782,1782,504,881,1355,4905,8304,4746,9020,9020,4746,8425,1637,8304,9587,5321,4746,4746,5321,3328,8425,1792,3679,\n\t\t\t         9835,9011,9011,9835,5321,9587,3679,4211,493,9835,9835,493,3328,5321,1792,9011,3849,358,358,3849,4290,8778,9011,9587,1355,3849,3849,1355,881,4290,1792,358,5816,7570,7570,5816,1686,5239,358,8778,5703,5816,5816,5703,10652,1686,1792,7570,4380,3679,3679,4380,8260,4211,7570,5239,3434,4380,4380,3434,535,8260,2751,867,\n\t\t\t         837,8919,8919,837,3434,5239,867,4253,3815,837,837,3815,535,3434,2751,8919,294,5119,5119,294,6591,4604,8919,5239,1686,294,294,1686,10652,6591,2751,5119,1993,2980,2980,1993,6694,177,5119,4604,2986,1993,1993,2986,7558,6694,2751,2980,3421,867,867,3421,821,4253,2980,177,5668,3421,3421,5668,9067,821,7503,9026,\n\t\t\t         7971,7940,7565,5805,5668,177,9026,3374,764,7971,5805,573,9067,5668,7503,7940,4361,10559,10559,4361,3727,9807,7565,177,6694,5734,5734,6694,7558,984,7503,10559,7831,9005,9005,7831,2636,7077,10559,9807,5705,7831,7831,5705,6400,2636,7503,9005,6440,9026,9026,6440,8190,3374,9005,7077,151,6440,6440,151,2067,8190,3795,606,\n\t\t\t         10284,5838,5838,10284,151,7077,606,1804,9436,10284,10284,9436,2067,151,3795,5838,10093,579,579,10093,4408,3107,5838,7077,2636,10093,10093,2636,6400,4408,3795,579,3463,6001,6001,3463,7836,10523,579,3107,6726,3463,3463,6726,7891,7836,3795,6001,2464,606,606,2464,5667,1804,6001,10523,4972,2464,2464,4972,3170,5667,6387,8769,\n\t\t\t         3255,2712,2712,3255,2986,4604,8769,8125,8463,3255,3255,8463,7558,2986,6387,2712,8211,6046,6046,8211,4011,5117,2712,4604,6591,8211,8211,6591,10652,4011,6387,6046,5797,4229,4229,5797,10528,6189,6046,5117,3450,5797,5797,3450,8534,10528,6387,4229,651,8769,8769,651,4980,8125,4229,6189,5155,651,651,5155,2257,4980,995,458,\n\t\t\t         4584,9545,9545,4584,5703,8778,458,5117,4011,4584,4584,4011,10652,5703,995,9545,7092,8801,8801,7092,8077,2731,9545,8778,4290,7092,7092,4290,881,8077,995,8801,6068,2987,2987,6068,8969,9468,8801,2731,3087,6068,6068,3087,954,8969,995,2987,4500,458,458,4500,3450,5117,2987,9468,5899,4500,4500,5899,8534,3450,149,3269,\n\t\t\t         92,8462,8462,92,504,3376,3269,2731,8077,92,92,8077,881,504,149,8462,9693,3038,3038,9693,3683,5598,8462,3376,3924,9693,9693,3924,7891,3683,149,3038,2755,8578,8578,2755,1574,9896,3038,5598,10326,2755,2755,10326,3559,1574,149,8578,5593,3269,3269,5593,3087,2731,8578,9896,9498,5593,5593,9498,954,3087,9521,9723,\n\t\t\t         10057,3546,3546,10057,6726,3107,9723,5598,3683,10057,10057,3683,7891,6726,9521,3546,527,10226,10226,527,3611,5590,3546,3107,4408,527,527,4408,6400,3611,9521,10226,1469,6959,6959,1469,7021,10749,10226,5590,6103,1469,1469,6103,804,7021,9521,6959,4616,9723,9723,4616,10326,5598,6959,10749,2133,4616,4616,2133,3559,10326,9463,8711,\n\t\t\t         5286,8861,8861,5286,5705,9807,8711,5590,3611,5286,5286,3611,6400,5705,9463,8861,10274,8002,3636,5188,8463,8125,8861,9807,3727,10274,5188,984,7558,8463,9463,8002,3705,6479,6479,3705,8699,9867,3636,8125,4980,7984,7984,4980,2257,9469,9463,6479,8595,8711,8711,8595,6103,5590,6479,9867,3425,8595,8595,3425,804,6103,10642,6503,\n\t\t\t         3688,7022,7022,3688,5155,6189,6503,182,770,3688,3688,770,2257,5155,10642,7022,5483,316,316,5483,1896,8221,7022,6189,10528,5483,5483,10528,8534,1896,10642,316,2329,10760,10760,2329,3253,5072,316,8221,4541,2329,2329,4541,7933,3253,10642,10760,2597,6503,6503,2597,5527,182,10760,5072,6476,2597,2597,6476,8424,5527,6850,56,\n\t\t\t         8264,657,657,8264,5899,9468,56,8221,1896,8264,8264,1896,8534,5899,6850,657,6291,3784,3784,6291,6831,9810,657,9468,8969,6291,6291,8969,954,6831,6850,3784,6585,5512,5512,6585,4395,5621,3784,9810,490,6585,6585,490,10469,4395,6850,5512,4660,56,56,4660,4541,8221,5512,5621,7386,4660,4660,7386,7933,4541,8694,7423,\n\t\t\t         6547,5091,5091,6547,9498,9896,7423,9810,6831,6547,6547,6831,954,9498,8694,5091,1658,7439,7439,1658,5931,10419,5091,9896,1574,1658,1658,1574,3559,5931,8694,7439,5748,7385,7385,5748,8163,6012,7439,10419,2983,5748,5748,2983,8723,8163,8694,7385,8416,7423,7423,8416,490,9810,7385,6012,5815,8416,8416,5815,10469,490,3935,10025,\n\t\t\t         4267,207,207,4267,2133,10749,10025,10419,5931,4267,4267,5931,3559,2133,3935,207,6706,6680,6680,6706,5559,2668,207,10749,7021,6706,6706,7021,804,5559,3935,6680,1388,3411,3411,1388,4760,4414,6680,2668,4568,1388,1388,4568,8195,4760,3935,3411,4364,10025,10025,4364,2983,10419,3411,4414,905,4364,4364,905,8723,2983,255,5714,\n\t\t\t         6346,5135,5135,6346,3425,9867,5714,2668,5559,6346,6346,5559,804,3425,255,5135,9578,1893,3103,7571,770,182,5135,9867,8699,9578,7571,9469,2257,770,255,1893,5159,1322,1322,5159,188,299,3103,182,5527,6059,6059,5527,8424,791,255,1322,205,5714,5714,205,4568,2668,1322,299,3275,205,205,3275,8195,4568,7635,1160,\n\t\t\t         5879,8426,8426,5879,6476,5072,1160,3848,2913,5879,5879,2913,8424,6476,7635,8426,2442,3361,3361,2442,8072,693,8426,5072,3253,2442,2442,3253,7933,8072,7635,3361,8688,3912,3912,8688,3161,5845,3361,693,8464,8688,8688,8464,6064,3161,7635,3912,3144,1160,1160,3144,6717,3848,3912,5845,3598,3144,3144,3598,6820,6717,3864,10360,\n\t\t\t         461,10622,10622,461,7386,5621,10360,693,8072,461,461,8072,7933,7386,3864,10622,7705,8880,8880,7705,2482,1138,10622,5621,4395,7705,7705,4395,10469,2482,3864,8880,9839,9337,9337,9839,474,10737,8880,1138,1691,9839,9839,1691,3749,474,3864,9337,4106,10360,10360,4106,8464,693,9337,10737,8280,4106,4106,8280,6064,8464,9116,10163,\n\t\t\t         5319,4177,4177,5319,5815,6012,10163,1138,2482,5319,5319,2482,10469,5815,9116,4177,6428,2962,2962,6428,2184,731,4177,6012,8163,6428,6428,8163,8723,2184,9116,2962,4098,10697,10697,4098,6736,1670,2962,731,2096,4098,4098,2096,6779,6736,9116,10697,8428,10163,10163,8428,1691,1138,10697,1670,2816,8428,8428,2816,3749,1691,345,6392,\n\t\t\t         5440,1728,1728,5440,905,4414,6392,731,2184,5440,5440,2184,8723,905,345,1728,3446,5622,5622,3446,1672,2918,1728,4414,4760,3446,3446,4760,8195,1672,345,5622,9353,7920,7920,9353,4390,8373,5622,2918,7502,9353,9353,7502,8284,4390,345,7920,3668,6392,6392,3668,2096,731,7920,8373,911,3668,3668,911,6779,2096,4597,5600,\n\t\t\t         2909,6521,6521,2909,3275,299,5600,2918,1672,2909,2909,1672,8195,3275,4597,6521,5144,1460,5981,2910,2913,3848,6521,299,188,5144,2910,791,8424,2913,4597,1460,5883,2794,2794,5883,9452,2632,5981,3848,6717,8057,8057,6717,6820,1248,4597,2794,2763,5600,5600,2763,7502,2918,2794,2632,8361,2763,2763,8361,8284,7502,8385,7248,\n\t\t\t         8956,4502,4502,8956,3598,5845,7248,10616,9935,8956,8956,9935,6820,3598,8385,4502,7947,4656,4656,7947,7253,4484,4502,5845,3161,7947,7947,3161,6064,7253,8385,4656,2851,8842,8842,2851,3472,4910,4656,4484,9428,2851,2851,9428,4178,3472,8385,8842,5783,7248,7248,5783,7885,10616,8842,4910,4560,5783,5783,4560,3061,7885,2761,684,\n\t\t\t         8034,4268,4268,8034,8280,10737,684,4484,7253,8034,8034,7253,6064,8280,2761,4268,5428,578,578,5428,5913,1781,4268,10737,474,5428,5428,474,3749,5913,2761,578,2401,701,701,2401,1465,4333,578,1781,5689,2401,2401,5689,5576,1465,2761,701,8138,684,684,8138,9428,4484,701,4333,8651,8138,8138,8651,4178,9428,6183,5836,\n\t\t\t         1981,7157,7157,1981,2816,1670,5836,1781,5913,1981,1981,5913,3749,2816,6183,7157,6330,545,545,6330,3526,1158,7157,1670,6736,6330,6330,6736,6779,3526,6183,545,3228,3521,3521,3228,6730,1764,545,1158,1166,3228,3228,1166,7242,6730,6183,3521,3337,5836,5836,3337,5689,1781,3521,1764,5212,3337,3337,5212,5576,5689,483,5996,\n\t\t\t         8772,7476,7476,8772,911,8373,5996,1158,3526,8772,8772,3526,6779,911,483,7476,3126,5352,5352,3126,9466,8482,7476,8373,4390,3126,3126,4390,8284,9466,483,5352,904,6857,6857,904,8074,5364,5352,8482,8181,904,904,8181,9170,8074,483,6857,4122,5996,5996,4122,1166,1158,6857,5364,447,4122,4122,447,7242,1166,7304,10581,\n\t\t\t         376,5504,5504,376,8361,2632,10581,8482,9466,376,376,9466,8284,8361,7304,5504,4331,3241,8251,5545,9935,10616,5504,2632,9452,4331,5545,1248,6820,9935,7304,3241,10216,4320,4320,10216,1081,10445,8251,10616,7885,7763,7763,7885,3061,5909,7304,4320,2645,10581,10581,2645,8181,8482,4320,10445,4781,2645,2645,4781,9170,8181,5370,2605,\n\t\t\t         623,8743,8743,623,4560,4910,2605,4950,1315,623,623,1315,3061,4560,5370,8743,6892,6789,6789,6892,9984,4599,8743,4910,3472,6892,6892,3472,4178,9984,5370,6789,9248,2769,2769,9248,5849,8297,6789,4599,2810,9248,9248,2810,1266,5849,5370,2769,4026,2605,2605,4026,741,4950,2769,8297,10433,4026,4026,10433,8837,741,6269,596,\n\t\t\t         9061,932,932,9061,8651,4333,596,4599,9984,9061,9061,9984,4178,8651,6269,932,1442,7880,7880,1442,3553,454,932,4333,1465,1442,1442,1465,5576,3553,6269,7880,1950,4810,4810,1950,7529,7710,7880,454,4681,1950,1950,4681,9148,7529,6269,4810,5840,596,596,5840,2810,4599,4810,7710,5066,5840,5840,5066,1266,2810,10650,4855,\n\t\t\t         44,6379,6379,44,5212,1764,4855,454,3553,44,44,3553,5576,5212,10650,6379,6673,1320,1320,6673,3560,10655,6379,1764,6730,6673,6673,6730,7242,3560,10650,1320,2857,10516,10516,2857,10258,3248,1320,10655,10385,2857,2857,10385,6168,10258,10650,10516,2108,4855,4855,2108,4681,454,10516,3248,1326,2108,2108,1326,9148,4681,8733,7056,\n\t\t\t         9720,1180,1180,9720,447,5364,7056,10655,3560,9720,9720,3560,7242,447,8733,1180,6162,3671,3671,6162,9239,3171,1180,5364,8074,6162,6162,8074,9170,9239,8733,3671,2503,4236,4236,2503,7829,528,3671,3171,302,2503,2503,302,646,7829,8733,4236,8552,7056,7056,8552,10385,10655,4236,528,3007,8552,8552,3007,6168,10385,159,3388,\n\t\t\t         6903,7082,7082,6903,4781,10445,3388,3171,9239,6903,6903,9239,9170,4781,159,7082,3239,7792,5409,4326,1315,4950,7082,10445,1081,3239,4326,5909,3061,1315,159,7792,6823,5786,5786,6823,7601,6871,5409,4950,741,7579,7579,741,8837,7883,159,5786,2383,3388,3388,2383,302,3171,5786,6871,895,2383,2383,895,646,302,9496,1383,\n\t\t\t         2950,860,860,2950,10433,8297,1383,3332,6389,2950,2950,6389,8837,10433,9496,860,10537,1422,1422,10537,10250,2567,860,8297,5849,10537,10537,5849,1266,10250,9496,1422,5742,9920,9920,5742,5493,6941,1422,2567,10255,5742,5742,10255,1116,5493,9496,9920,841,1383,1383,841,5928,3332,9920,6941,8979,841,841,8979,5772,5928,3365,261,\n\t\t\t         6296,2528,2528,6296,5066,7710,261,2567,10250,6296,6296,10250,1266,5066,3365,2528,9230,3309,3309,9230,5871,2268,2528,7710,7529,9230,9230,7529,9148,5871,3365,3309,3221,6715,6715,3221,282,10638,3309,2268,218,3221,3221,218,2208,282,3365,6715,5809,261,261,5809,10255,2567,6715,10638,1400,5809,5809,1400,1116,10255,1627,517,\n\t\t\t         8111,1038,1038,8111,1326,3248,517,2268,5871,8111,8111,5871,9148,1326,1627,1038,6843,1676,1676,6843,750,912,1038,3248,10258,6843,6843,10258,6168,750,1627,1676,4804,7624,7624,4804,4540,9252,1676,912,9382,4804,4804,9382,8926,4540,1627,7624,5946,517,517,5946,218,2268,7624,9252,1912,5946,5946,1912,2208,218,8015,63,\n\t\t\t         6855,6052,6052,6855,3007,528,63,912,750,6855,6855,750,6168,3007,8015,6052,4499,8910,8910,4499,10740,3911,6052,528,7829,4499,4499,7829,646,10740,8015,8910,110,361,361,110,10262,4752,8910,3911,5303,110,110,5303,2113,10262,8015,361,191,63,63,191,9382,912,361,4752,2549,191,191,2549,8926,9382,6514,7725,\n\t\t\t         2141,6009,6009,2141,895,6871,7725,3911,10740,2141,2141,10740,646,895,6514,6009,6228,7745,745,6030,6389,3332,6009,6871,7601,6228,6030,7883,8837,6389,6514,7745,1995,4722,4722,1995,417,1412,745,3332,5928,5486,5486,5928,5772,5958,6514,4722,7837,7725,7725,7837,5303,3911,4722,1412,2082,7837,7837,2082,2113,5303,3817,4926,\n\t\t\t         2897,9792,3380,1855,10711,8257,4926,6072,5798,2897,1855,6485,7713,10711,3817,9792,4274,7923,7923,4274,9464,2475,3380,8257,2752,4280,4280,2752,8369,3684,3817,7923,4226,4020,4020,4226,7121,974,7923,2475,1778,4226,4226,1778,8798,7121,3817,4020,9692,4926,4926,9692,9663,6072,4020,974,10614,9692,9692,10614,40,9663,4167,3215,\n\t\t\t         2089,4373,4373,2089,5798,6072,3168,7903,2093,6631,6631,2093,7713,6485,4167,4373,637,1817,1817,637,4152,775,4373,6072,9663,637,637,9663,40,4152,4167,1817,4992,1384,1384,4992,51,9104,1817,775,2521,4992,4992,2521,7604,51,4167,1384,3256,3215,3168,9812,10595,7903,1384,9104,3209,3256,9812,9231,9671,10595,6260,4218,\n\t\t\t         7220,1141,1141,7220,3209,9104,4114,9899,4223,2673,2673,4223,9671,9231,6260,1141,8330,7057,7057,8330,5229,3584,1141,9104,51,8330,8330,51,7604,5229,6260,7057,2612,3488,3488,2612,9348,10560,7057,3584,5854,2612,2612,5854,8523,9348,6260,3488,10225,4218,4114,9167,7152,9899,3488,10560,6255,10225,9167,8820,7715,7152,7889,9571,\n\t\t\t         6202,9775,9775,6202,6255,10560,7216,9673,5347,8948,8948,5347,7715,8820,7889,9775,910,7967,7967,910,172,10019,9775,10560,9348,910,910,9348,8523,172,7889,7967,6079,2931,2931,6079,477,5793,7967,10019,3084,6079,6079,3084,2063,477,7889,2931,6926,9571,7216,8128,7204,9673,2931,5793,9374,6926,8128,1226,5642,7204,200,4829,\n\t\t\t         3992,8777,8777,3992,9374,5793,4240,8641,10299,6446,6446,10299,5642,1226,200,8777,704,513,513,704,10511,4954,8777,5793,477,704,704,477,2063,10511,200,513,4748,1961,1961,4748,6448,3724,513,4954,852,4748,4748,852,8427,6448,200,1961,2953,4829,4240,8133,9783,8641,1961,3724,7314,2953,8133,161,1870,9783,8972,5985,\n\t\t\t         8542,10412,10412,8542,9376,4,5985,2202,10770,8542,8542,10770,48,9376,8972,10412,1297,8289,8289,1297,2693,10764,10412,4,2078,1297,1297,2078,472,2693,8972,8289,7131,5259,5259,7131,6414,7373,8289,10764,889,7131,7131,889,1610,6414,8972,5259,10691,5985,5985,10691,1706,2202,5259,7373,4153,10691,10691,4153,6201,1706,4061,10402,\n\t\t\t         6008,10738,10738,6008,1032,3447,10402,10764,2693,6008,6008,2693,472,1032,4061,10738,2586,9600,9600,2586,2386,6807,10738,3447,5328,2586,2586,5328,947,2386,4061,9600,3765,0,0,3765,8011,10087,9600,6807,3452,3765,3765,3452,7894,8011,4061,0,6602,10402,10402,6602,889,10764,0,10087,3493,6602,6602,3493,1610,889,473,5914,\n\t\t\t         661,4952,4952,661,4518,8099,5914,2756,9544,661,661,9544,6759,4518,473,4952,10605,5467,5467,10605,4149,9286,4952,8099,3167,10605,10605,3167,6186,4149,473,5467,3773,6365,6365,3773,8675,7342,5467,9286,8575,3773,3773,8575,8144,8675,473,6365,5354,5914,5914,5354,10050,2756,6365,7342,3377,5354,5354,3377,7669,10050,3953,6977,\n\t\t\t         3460,4985,4985,3460,7670,5414,6977,9286,4149,3460,3460,4149,6186,7670,3953,4985,7723,7335,7335,7723,10770,2202,4985,5414,10208,7723,7723,10208,48,10770,3953,7335,8228,8764,8764,8228,8450,5189,7335,2202,1706,8228,8228,1706,6201,8450,3953,8764,7728,6977,6977,7728,8575,9286,8764,5189,2291,7728,7728,2291,8144,8575,5746,5481,\n\t\t\t         2451,10630,10630,2451,6491,9103,5481,10681,8884,2451,2451,8884,10167,6491,5746,10630,7124,153,153,7124,5161,4590,10630,9103,8212,7124,7124,8212,8020,5161,5746,153,1952,7117,7117,1952,4621,10099,153,4590,9862,1952,1952,9862,6015,4621,5746,7117,4740,5481,5481,4740,930,10681,7117,10099,8299,4740,4740,8299,10584,930,6530,8050,\n\t\t\t         3801,878,878,3801,8159,6510,8050,6807,2386,3801,3801,2386,947,8159,6530,878,1049,4932,7447,963,8884,10681,878,6510,5438,1049,963,1111,10167,8884,6530,4932,1070,8692,8692,1070,3802,496,7447,10681,930,1967,1967,930,10584,428,6530,8692,7698,8050,8050,7698,3452,6807,8692,496,9177,7698,7698,9177,7894,3452,370,8540,\n\t\t\t         8169,5725,5725,8169,3730,2390,8540,4590,5161,8169,8169,5161,8020,3730,370,5725,10439,9330,9330,10439,9544,2756,5725,2390,3322,10439,10439,3322,6759,9544,370,9330,3958,3899,3899,3958,8731,4351,9330,2756,10050,3958,3958,10050,7669,8731,370,3899,1974,8540,8540,1974,9862,4590,3899,4351,1091,1974,1974,1091,6015,9862,3114,1888,\n\t\t\t         1281,388,388,1281,4153,7373,1888,5111,10153,1281,1281,10153,6201,4153,3114,388,5942,711,711,5942,6462,487,388,7373,6414,5942,5942,6414,1610,6462,3114,711,4579,1175,1175,4579,8901,3667,711,487,1894,4579,4579,1894,4442,8901,3114,1175,2277,1888,1888,2277,2617,5111,1175,3667,5602,2277,2277,5602,6816,2617,8546,3392,\n\t\t\t         1270,5406,5406,1270,3493,10087,3392,487,6462,1270,1270,6462,1610,3493,8546,5406,7970,3578,3578,7970,2738,4662,5406,10087,8011,7970,7970,8011,7894,2738,8546,3578,7993,6787,6787,7993,7484,5460,3578,4662,3104,7993,7993,3104,10166,7484,8546,6787,5234,3392,3392,5234,1894,487,6787,5460,4505,5234,5234,4505,4442,1894,5778,7015,\n\t\t\t         10134,4567,4567,10134,3377,7342,7015,5132,2680,10134,10134,2680,7669,3377,5778,4567,4374,480,480,4374,7025,4680,4567,7342,8675,4374,4374,8675,8144,7025,5778,480,5403,7504,7504,5403,738,8069,480,4680,2912,5403,5403,2912,9656,738,5778,7504,2602,7015,7015,2602,6954,5132,7504,8069,4103,2602,2602,4103,8732,6954,8396,10660,\n\t\t\t         114,6118,6118,114,2291,5189,10660,4680,7025,114,114,7025,8144,2291,8396,6118,9001,543,543,9001,10153,5111,6118,5189,8450,9001,9001,8450,6201,10153,8396,543,2888,2297,2297,2888,7060,3252,543,5111,2617,2888,2888,2617,6816,7060,8396,2297,8026,10660,10660,8026,2912,4680,2297,3252,6327,8026,8026,6327,9656,2912,6263,817,\n\t\t\t         10447,7975,7975,10447,8299,10099,817,3821,9955,10447,10447,9955,10584,8299,6263,7975,8729,9980,9980,8729,1815,10500,7975,10099,4621,8729,8729,4621,6015,1815,6263,9980,4000,4842,4842,4000,8594,9047,9980,10500,6463,4000,4000,6463,5293,8594,6263,4842,8933,817,817,8933,9586,3821,4842,9047,2138,8933,8933,2138,6620,9586,8788,6454,\n\t\t\t         4854,1407,1407,4854,9177,496,6454,4662,2738,4854,4854,2738,7894,9177,8788,1407,7516,2299,1558,9548,9955,3821,1407,496,3802,7516,9548,428,10584,9955,8788,2299,2868,7264,7264,2868,10671,3237,1558,3821,9586,1435,1435,9586,6620,3873,8788,7264,6586,6454,6454,6586,3104,4662,7264,3237,9981,6586,6586,9981,10166,3104,2740,4281,\n\t\t\t         2708,1121,1121,2708,1091,4351,4281,10500,1815,2708,2708,1815,6015,1091,2740,1121,8673,5327,5327,8673,2680,5132,1121,4351,8731,8673,8673,8731,7669,2680,2740,5327,7481,8913,8913,7481,1939,4271,5327,5132,6954,7481,7481,6954,8732,1939,2740,8913,3695,4281,4281,3695,6463,10500,8913,4271,8075,3695,3695,8075,5293,6463,4473,6950,\n\t\t\t         5774,8605,8605,5774,3504,9827,6950,10370,5508,5774,5774,5508,8516,3504,4473,8605,2570,107,107,2570,5416,8585,8605,9827,10026,2570,2570,10026,9751,5416,4473,107,10600,6950,6950,10600,10366,10370,107,8585,7317,10600,10600,7317,4976,10366,6723,6283,9644,2069,2069,9644,9284,3073,6283,4300,8449,9644,9644,8449,9629,9284,6723,2069,\n\t\t\t         4058,938,938,4058,9559,8268,2069,3073,9771,4058,4058,9771,4976,9559,6723,938,355,5238,5238,355,6388,5204,938,8268,8504,355,355,8504,6916,6388,6723,5238,2030,6283,6283,2030,3244,4300,5238,5204,4624,2030,2030,4624,5411,3244,3946,7576,4691,10772,10772,4691,4624,5204,7576,10259,5490,4691,4691,5490,5411,4624,3946,10772,\n\t\t\t         8317,6492,6492,8317,3138,8753,10772,5204,6388,8317,8317,6388,6916,3138,3946,6492,3315,9906,9906,3315,5309,7245,6492,8753,78,3315,3315,78,1563,5309,3946,9906,1075,7576,7576,1075,5249,10259,9906,7245,3602,1075,1075,3602,8712,5249,8282,1822,8599,202,202,8599,5738,9635,1822,4151,4558,8599,8599,4558,8511,5738,8282,202,\n\t\t\t         3370,8291,8291,3370,10026,9827,202,9635,2335,3370,3370,2335,9751,10026,8282,8291,9508,1822,1822,9508,272,4151,8291,9827,3504,9508,9508,3504,8516,272,3993,5308,5084,4868,4868,5084,6982,7958,5308,9886,10374,5084,5084,10374,2313,6982,3993,4868,3760,2995,2995,3760,3048,3340,4868,7958,2949,3760,3760,2949,10316,3048,3993,2995,\n\t\t\t         2593,10145,10145,2593,4291,7490,2995,3340,9551,2593,2593,9551,3424,4291,3993,10145,7118,5308,5308,7118,5068,9886,10145,7490,719,7118,7118,719,3477,5068,10290,333,2422,9926,9926,2422,2222,982,333,7247,6750,2422,2422,6750,4596,2222,10290,9926,6667,8457,8457,6667,2335,9635,9926,982,8247,6667,6667,8247,9751,2335,10290,8457,\n\t\t\t         6577,333,333,6577,6444,7247,8457,9635,5738,6577,6577,5738,8511,6444,3456,8435,1238,5427,5427,1238,6220,3706,8435,8585,5416,1238,1238,5416,9751,6220,3456,5427,3779,926,926,3779,8504,8268,5427,3706,6442,3779,3779,6442,6916,8504,3456,926,4572,8435,8435,4572,7317,8585,926,8268,9559,4572,4572,9559,4976,7317,154,3534,\n\t\t\t         3987,3245,3245,3987,6442,3706,3534,8753,3138,3987,3987,3138,6916,6442,154,3245,8048,9322,9322,8048,6525,6057,3245,3706,6220,8048,8048,6220,9751,6525,154,9322,7846,5168,5168,7846,5448,3716,9322,6057,9357,7846,7846,9357,7701,5448,154,5168,1828,3534,3534,1828,78,8753,5168,3716,9960,1828,1828,9960,1563,78,3896,4017,\n\t\t\t         9419,1649,1649,9419,8247,982,4017,6057,6525,9419,9419,6525,9751,8247,3896,1649,6377,4259,4259,6377,12,4535,1649,982,2222,6377,6377,2222,4596,12,3896,4259,3075,7822,7822,3075,3139,802,4259,4535,5866,3075,3075,5866,244,3139,3896,7822,3263,4017,4017,3263,9357,6057,7822,802,7183,3263,3263,7183,7701,9357,2944,10464,\n\t\t\t         2964,6395,6395,2964,2509,689,10464,8394,4916,2964,2964,4916,6744,2509,2944,6395,4163,3600,3600,4163,2954,10032,6395,689,3210,4163,4163,3210,1096,2954,2944,3600,5261,2005,4883,9308,7183,802,3600,10032,6670,5261,9308,1860,7701,7183,2944,2005,7370,10464,10464,7370,10715,8394,4883,802,3139,403,403,3139,244,7664,8154,2314,\n\t\t\t         7337,9710,9710,7337,10438,3729,2314,10128,25,7337,7337,25,2137,10438,8154,9710,6500,8360,8360,6500,2275,8362,9710,3729,8617,6500,6500,8617,6744,2275,8154,8360,7193,2314,2314,7193,9249,10128,8360,8362,5399,7193,7193,5399,6672,9249,9567,5736,7863,5575,5575,7863,719,7490,5736,6691,1153,7863,7863,1153,3477,719,9567,5575,\n\t\t\t         8145,4677,4677,8145,1542,5975,5575,7490,4291,8145,8145,4291,3424,1542,9567,4677,297,4466,4466,297,25,10128,4677,5975,10411,297,297,10411,2137,25,9567,4466,2412,5736,5736,2412,2239,6691,4466,10128,9249,2412,2412,9249,6672,2239,362,7006,5256,3583,3583,5256,9551,3340,7006,1784,378,5256,5256,378,3424,9551,362,3583,\n\t\t\t         2339,9190,9190,2339,1897,8216,3583,3340,3048,2339,2339,3048,10316,1897,362,9190,10236,3224,3224,10236,8449,4300,9190,8216,6151,10236,10236,6151,9629,8449,362,3224,4341,7006,7006,4341,7164,1784,3224,4300,3244,4341,4341,3244,5411,7164,291,8331,6204,8662,8662,6204,10411,5975,8331,1733,9768,6204,6204,9768,2137,10411,291,8662,\n\t\t\t         6668,2611,2611,6668,4825,8716,8662,5975,1542,6668,6668,1542,3424,4825,291,2611,4556,8331,8331,4556,3246,1733,2611,8716,4867,4556,4556,4867,7997,3246,1681,4826,1446,6424,6424,1446,378,1784,4826,8716,4825,1446,1446,4825,3424,378,1681,6424,779,7719,7719,779,5490,10259,6424,1784,7164,779,779,7164,5411,5490,1681,7719,\n\t\t\t         5439,9057,9057,5439,8608,3468,7719,10259,5249,5439,5439,5249,8712,8608,1681,9057,10014,4826,4826,10014,4867,8716,9057,3468,6435,10014,10014,6435,7997,4867,2075,4559,5788,5073,5073,5788,6435,3468,4559,2694,64,5788,5788,64,7997,6435,2075,5073,2236,2869,2869,2236,5329,3498,5073,3468,8608,2236,2236,8608,8712,5329,2075,2869,\n\t\t\t         7286,1431,1431,7286,4474,3737,2869,3498,10305,7286,7286,10305,3347,4474,2075,1431,4016,4559,4559,4016,7388,2694,1431,3737,5139,4016,4016,5139,784,7388,8320,2903,10111,9838,9838,10111,9768,1733,2903,9423,10408,10111,10111,10408,2137,9768,8320,9838,825,8475,8475,825,64,2694,9838,1733,3246,825,825,3246,7997,64,8320,8475,\n\t\t\t         1377,8140,8140,1377,3930,5010,8475,2694,7388,1377,1377,7388,784,3930,8320,8140,327,2903,2903,327,7249,9423,8140,5010,5496,327,327,5496,4903,7249,9415,10242,1149,9480,9480,1149,9960,3716,10242,8258,4614,1149,1149,4614,1563,9960,9415,9480,2531,8080,8080,2531,3947,9164,9480,3716,5448,2531,2531,5448,7701,3947,9415,8080,\n\t\t\t         8946,7099,7099,8946,723,10720,8080,9164,5932,8946,8946,5932,4066,723,9415,7099,6776,10242,10242,6776,8116,8258,7099,10720,3109,6776,6776,3109,3217,8116,7757,3979,8565,3220,3220,8565,2370,10304,3979,10032,2954,8565,8565,2954,1096,2370,7757,3220,1334,9608,9608,1334,8245,166,3220,10304,7176,1334,1334,7176,5298,8245,7757,9608,\n\t\t\t         3697,9561,2373,8479,5932,9164,9608,166,2311,3697,8479,4957,4066,5932,7757,9561,5375,3979,3979,5375,6670,10032,2373,9164,3947,3267,3267,3947,7701,1860,6972,6539,6790,718,718,6790,3602,7245,6539,3498,5329,6790,6790,5329,8712,3602,6972,718,945,9121,9121,945,4614,8258,718,7245,5309,945,945,5309,1563,4614,6972,9121,\n\t\t\t         6952,1305,1305,6952,5516,5855,9121,8258,8116,6952,6952,8116,3217,5516,6972,1305,3481,6539,6539,3481,10305,3498,1305,5855,5126,3481,3481,5126,3347,10305,990,4206,1119,3852,3852,1119,3210,689,4206,10304,2370,1119,1119,2370,1096,3210,990,3852,10376,198,198,10376,5592,9527,3852,689,2509,10376,10376,2509,6744,5592,990,198,\n\t\t\t         2212,10663,10663,2212,259,1103,198,9527,9897,2212,2212,9897,716,259,990,10663,4315,4206,4206,4315,7176,10304,10663,1103,10730,4315,4315,10730,5298,7176,128,437,10053,10160,10160,10053,8617,3729,437,9527,5592,10053,10053,5592,6744,8617,128,10160,5062,826,826,5062,10408,9423,10160,3729,10438,5062,5062,10438,2137,10408,128,826,\n\t\t\t         6813,2568,2568,6813,9171,2743,826,9423,7249,6813,6813,7249,4903,9171,128,2568,6955,437,437,6955,9897,9527,2568,2743,10210,6955,6955,10210,716,9897,7726,9171,4903,8737,4997,10210,2743,3929,3929,7726,9774,6808,6566,7257,411,6808,7726,8737,1696,9774,6566,6808,9774,7228,3929,6808,411,4997,4997,411,9387,5973,7257,152,\n\t\t\t         9387,411,716,10210,4997,5973,2111,1103,259,551,551,259,716,5973,7963,10730,1103,2111,2111,551,2687,1992,3247,7083,8005,1992,551,5973,9387,2687,3247,1992,2687,8052,2111,1992,8005,7963,7963,8005,8759,3112,7083,8194,8759,8005,7228,9774,1696,4775,5298,10730,7963,3112,9149,5139,3737,6028,3844,784,5139,9149,6028,3737,\n\t\t\t         4474,3064,3064,4474,3347,4134,8290,5496,5010,7724,6028,3064,858,9147,4197,31,6200,9147,3064,4134,7512,858,4197,9147,858,774,6028,9147,6200,9149,9149,6200,4762,3844,31,6232,4762,6200,8052,2687,9387,152,8737,4903,5496,8290,7724,5010,3930,4322,4322,3930,784,3844,4434,3109,10720,2149,7724,4322,2671,7064,2607,2671,\n\t\t\t         4762,6232,4322,3844,4762,2671,774,858,7512,538,7724,7064,5247,8290,8290,5247,1696,8737,5174,7064,2671,2607,5174,4896,5247,7064,350,3217,3109,4434,2149,10720,723,917,917,723,4066,2823,3608,166,8245,7623,2149,917,157,10678,6041,1150,10771,10678,917,2823,3222,157,6041,10678,157,1013,2149,10678,10771,4434,4434,10771,\n\t\t\t         8918,350,1150,94,8918,10771,4896,4775,1696,5247,7623,8245,5298,3112,1135,2311,166,3608,3608,7623,9970,8065,1395,9970,8759,8194,7623,3112,8759,9970,1013,157,3222,2255,3608,8065,2203,1135,6639,4989,3222,2823,6687,8065,9970,1395,6687,510,2203,8065,4066,4957,6639,2823,72,5126,5855,2781,3347,5126,72,4134,2781,5855,\n\t\t\t         5516,3173,3173,5516,3217,350,2781,3173,9857,4651,10336,1640,3586,4651,3173,350,8918,9857,10336,4651,9857,6553,2781,4651,3586,72,72,3586,7512,4134,1640,538,7512,3586,10271,2255,3222,4989,7151,6566,7228,8915,8915,7228,4775,8310,7151,8915,9699,3994,3994,9699,6864,148,8915,8310,6536,9699,9699,6536,8690,6864,7151,3994,\n\t\t\t         2706,7534,7534,2706,3458,5005,3994,148,7577,2706,2706,7577,773,3458,7151,7534,7257,6566,7534,5005,152,7257,4736,3247,8052,9639,9639,8052,152,5005,4736,9639,9878,712,712,9878,9837,6218,9639,5005,3458,9878,9878,3458,773,9837,4736,712,2887,10442,10442,2887,5164,300,712,6218,1439,2887,2887,1439,8708,5164,4736,10442,\n\t\t\t         7083,3247,10442,300,8194,7083,7219,5989,31,4197,5989,2070,6232,31,7219,4197,774,7761,7761,774,538,1110,7219,7761,4898,10643,10643,4898,3013,5391,7761,1110,8561,4898,4898,8561,9162,3013,7219,10643,9611,5989,5989,9611,8543,2070,10643,5391,5183,9611,9611,5183,7511,8543,7926,123,4896,5174,123,8310,4775,4896,7926,5174,\n\t\t\t         2607,1458,1458,2607,6232,2070,7926,1458,2407,6815,6815,2407,1424,4669,1458,2070,8543,2407,2407,8543,7511,1424,7926,6815,4909,123,123,4909,6536,8310,6815,4669,4144,4909,4909,4144,8690,6536,4427,7212,1150,6041,7212,1039,94,1150,4427,6041,1013,6123,6123,1013,2255,9394,4427,6123,2553,2504,2504,2553,57,4897,6123,9394,\n\t\t\t         7830,2553,2553,7830,4123,57,4427,2504,4872,7212,7212,4872,831,1039,2504,4897,533,4872,4872,533,6588,831,3510,6687,1395,5908,5908,1395,8194,300,3510,5908,10503,7519,7519,10503,5648,8853,5908,300,5164,10503,10503,5164,8708,5648,3510,7519,8924,4524,9787,8445,7830,9394,7519,8853,5929,8924,8445,189,4123,7830,3510,4524,\n\t\t\t         510,6687,9787,9394,2255,10271,663,862,1640,10336,862,1110,538,1640,663,10336,6553,4749,4749,6553,94,1039,663,4749,7759,2226,2226,7759,8567,645,4749,1039,831,7759,7759,831,6588,8567,663,2226,9429,862,862,9429,8561,1110,2226,645,1076,9429,9429,1076,9162,8561,6968,3682,7693,6800,6800,7693,4375,9180,3682,148,\n\t\t\t         6864,7693,7693,6864,8690,4375,6968,6800,5776,7273,7273,5776,9256,10636,6800,9180,5499,5776,5776,5499,1035,9256,6968,7273,15,3398,3398,15,8670,3745,7273,10636,5617,15,15,5617,7909,8670,6968,3398,470,3682,3682,470,7577,148,3398,3745,1115,470,470,1115,773,7577,10529,4002,3529,4742,4742,3529,1115,3745,4002,6218,\n\t\t\t         9837,3529,3529,9837,773,1115,10529,4742,7596,4941,4941,7596,1565,7853,4742,3745,8670,7596,7596,8670,7909,1565,10529,4941,4580,8107,8107,4580,4249,556,4941,7853,10753,4580,4580,10753,7346,4249,10529,8107,275,4002,4002,275,1439,6218,8107,556,7758,275,275,7758,8708,1439,7387,1837,10680,10518,10518,10680,5183,5391,1837,8458,\n\t\t\t         9817,10680,10680,9817,7511,5183,7387,10518,1148,857,857,1148,10188,9379,10518,5391,3013,1148,1148,3013,9162,10188,7387,857,8700,1788,1788,8700,6683,8894,857,9379,742,8700,8700,742,2900,6683,7387,1788,62,1837,1837,62,9292,8458,1788,8894,10139,62,62,10139,4944,9292,1339,2540,7716,5828,5828,7716,4144,4669,2540,9180,\n\t\t\t         4375,7716,7716,4375,8690,4144,1339,5828,5306,5341,5341,5306,9817,8458,5828,4669,1424,5306,5306,1424,7511,9817,1339,5341,1545,3887,3887,1545,3597,9617,5341,8458,9292,1545,1545,9292,4944,3597,1339,3887,10573,2540,2540,10573,5499,9180,3887,9617,4094,10573,10573,4094,1035,5499,9036,8584,9358,5767,5767,9358,533,4897,8584,6674,\n\t\t\t         8734,9358,9358,8734,6588,533,9036,5767,3278,9824,9824,3278,5927,9396,5767,4897,57,3278,3278,57,4123,5927,9036,9824,1527,8054,8054,1527,8352,4330,9824,9396,6262,1527,1527,6262,7740,8352,9036,8054,7499,8584,8584,7499,2473,6674,8054,4330,6210,7499,7499,6210,1474,2473,288,9136,10488,7354,7354,10488,7758,556,9136,8853,\n\t\t\t         5648,10488,10488,5648,8708,7758,288,7354,6597,3571,3571,6597,6918,8905,7354,556,4249,6597,6597,4249,7346,6918,288,3571,5064,8646,346,959,6262,9396,3571,8905,1807,5064,959,7308,7740,6262,288,8646,5113,9136,9136,5113,5929,8853,346,9396,5927,8923,8923,5927,4123,189,8526,9221,6277,10174,10174,6277,1076,645,9221,9379,\n\t\t\t         10188,6277,6277,10188,9162,1076,8526,10174,1358,9410,9410,1358,8734,6674,10174,645,8567,1358,1358,8567,6588,8734,8526,9410,6509,6456,6456,6509,9654,10191,9410,6674,2473,6509,6509,2473,1474,9654,8526,6456,10073,9221,9221,10073,742,9379,6456,10191,2003,10073,10073,2003,2900,742,2125,9256,1035,3822,9785,5617,10636,4201,4201,2125,\n\t\t\t         10377,2832,2832,10377,101,6331,2125,3822,1586,10377,10377,1586,28,101,4201,2832,8856,9785,9785,8856,83,3029,2832,6331,8715,8856,8856,8715,208,83,7909,5617,9785,3029,9040,7853,1565,6077,6077,1565,7909,3029,1477,10753,7853,9040,9040,6077,9819,6137,6137,9819,662,7874,6077,3029,83,9819,9819,83,208,662,9040,6137,\n\t\t\t         7731,1477,1477,7731,3009,319,6137,7874,2080,7731,7731,2080,863,3009,7346,10753,1477,319,1100,10139,8894,6841,9351,4944,10139,1100,6841,8894,6683,10626,10626,6683,2900,5463,8846,4094,9617,4777,6841,10626,5051,5356,5356,5051,10729,2031,10626,5463,10077,5051,5051,10077,9105,10729,6841,5356,7665,1100,1100,7665,1207,9351,5356,2031,\n\t\t\t         9512,7665,7665,9512,4476,1207,3822,1035,4094,8846,4777,9617,3597,9932,9932,3597,4944,9351,2934,6210,4330,9432,4777,9932,10421,8172,8172,10421,8300,4051,9932,9351,1207,10421,10421,1207,4476,8300,4777,8172,6625,8846,8846,6625,1586,3822,8172,4051,502,6625,6625,502,28,1586,5095,1474,6210,2934,9432,4330,8352,2285,2285,8352,\n\t\t\t         7740,2533,5313,8905,6918,3674,9432,2285,309,3634,3634,309,5050,6876,2285,2533,3090,309,309,3090,10065,5050,9432,3634,3312,2934,2934,3312,9380,5095,3634,6876,5386,3312,3312,5386,8645,9380,3674,6918,7346,319,2796,1807,8905,5313,5313,3674,633,1071,1071,633,1288,2802,3674,319,3009,633,633,3009,863,1288,5313,1071,\n\t\t\t         8974,2796,8623,2260,3090,2533,1071,2802,10526,8974,2260,235,10065,3090,7740,7308,8623,2533,591,2003,10191,4272,2900,2003,591,5463,4272,10191,9654,1636,1636,9654,1474,5095,8357,1771,3860,8976,4272,1636,3116,7814,7814,3116,10450,3483,1636,5095,9380,3116,3116,9380,8645,10450,4272,7814,6427,591,591,6427,10077,5463,7814,3483,\n\t\t\t         4305,6427,6427,4305,9105,10077,9316,8886,8518,9360,9638,8410,2589,1725,2589,6331,101,8518,8518,101,28,9360,1725,8886,117,6425,8886,9316,8114,117,8161,8410,9638,8324,10008,67,6235,2384,1725,6425,5751,9638,9638,5751,7686,8324,2589,8410,8715,6331,8410,8161,208,8715,8161,8324,67,10008,6531,6568,2384,6235,2384,7874,\n\t\t\t         662,10008,10008,662,208,8161,6235,67,9016,4574,67,8324,7686,9016,8243,6568,6531,613,8810,9873,10034,1271,6235,4574,8557,6531,6531,8557,5378,613,2384,6568,2080,7874,6568,8243,863,2080,5631,3179,7365,4418,1271,5631,9512,2031,1552,10364,4655,6598,5631,4418,4476,9512,2062,195,9873,8810,1271,10034,3179,5631,1271,2031,\n\t\t\t         10729,8810,8810,10729,9105,2062,10034,9873,721,7048,9873,195,138,721,10034,7048,8803,3179,3179,8803,8442,7365,2324,9460,9316,9360,6598,2324,502,4051,1413,1006,10177,3876,2324,9360,28,502,7365,10364,1552,4418,6598,4655,9460,2324,6598,4051,8300,1552,1552,8300,4476,4418,4655,10364,1200,7470,10364,7365,8442,1200,4655,7470,\n\t\t\t         6806,9460,9460,6806,8114,9316,786,175,3838,901,3876,786,5386,6876,7107,9509,10178,4189,786,901,8645,5386,10733,9400,1006,1413,3876,10177,175,786,3876,6876,5050,1413,1413,5050,10065,10733,10177,1006,3236,3465,1006,9400,8038,3236,10177,3465,3119,175,175,3119,9313,3838,8243,613,9509,7107,8494,5029,4189,10178,4189,2802,\n\t\t\t         1288,7107,7107,1288,863,8243,10178,9509,10179,8350,9509,613,5378,10179,10733,2551,4045,9400,7602,10386,6131,2861,10178,8350,1812,8494,4045,2195,8038,9400,4189,5029,10526,2802,2551,10733,10065,235,1856,6927,195,2062,2861,1856,4305,3483,1856,2062,9105,4305,3838,10386,7602,901,2861,6131,6927,1856,2861,3483,10450,7602,7602,10450,\n\t\t\t         8645,901,6131,10386,3487,6249,10386,3838,9313,3487,6131,6249,1891,6927,6927,1891,138,195,9356,306,3736,8870,8870,3736,6239,7321,306,1256,921,3736,3736,921,3313,6239,9356,8870,206,1931,1931,206,5094,76,8870,7321,397,206,206,397,5614,5094,9356,1931,5604,8776,8776,5604,3394,10343,1931,76,2346,5604,5604,2346,\n\t\t\t         4496,3394,9356,8776,737,306,306,737,8500,1256,8776,10343,8562,737,737,8562,2306,8500,7331,656,2690,163,163,2690,467,1182,656,7321,6239,2690,2690,6239,3313,467,7331,163,1799,8448,8448,1799,9073,6067,163,1182,229,1799,1799,229,1048,9073,7331,8448,2231,481,481,2231,10425,10623,8448,6067,1634,2231,2231,1634,\n\t\t\t         9944,10425,7331,481,2695,656,656,2695,397,7321,481,10623,7282,2695,2695,7282,5614,397,4780,5729,6934,3091,3091,6934,1789,6038,5729,6067,9073,6934,6934,9073,1048,1789,4780,3091,3134,274,274,3134,8232,2622,3091,6038,9904,3134,3134,9904,5846,8232,4780,274,1502,4521,4521,1502,7422,4802,274,2622,2811,1502,1502,2811,\n\t\t\t         891,7422,4780,4521,9905,5729,5729,9905,1634,6067,4521,4802,10217,9905,9905,10217,9944,1634,3011,8474,5582,6945,6945,5582,10485,2351,8474,2622,8232,5582,5582,8232,5846,10485,3011,6945,9102,7801,7801,9102,6766,9660,6945,2351,9319,9102,9102,9319,9449,6766,3011,7801,1802,8586,8586,1802,3095,423,7801,9660,1177,1802,1802,1177,\n\t\t\t         1157,3095,3011,8586,10635,8474,8474,10635,2811,2622,8586,423,4557,10635,10635,4557,891,2811,10510,8246,1445,9187,9187,1445,3280,2872,8246,9660,6766,1445,1445,6766,9449,3280,10510,9187,6727,6725,6725,6727,634,1628,9187,2872,3613,6727,6727,3613,8427,634,10510,6725,7336,9754,9754,7336,3942,3756,6725,1628,6363,7336,7336,6363,\n\t\t\t         1880,3942,10510,9754,9125,8246,8246,9125,1177,9660,9754,3756,944,9125,9125,944,1157,1177,522,3595,1793,1420,1420,1793,7051,5794,3595,76,5094,1793,1793,5094,5614,7051,522,1420,4512,3260,3260,4512,4158,10498,1420,5794,3700,4512,4512,3700,7771,4158,522,3260,967,3071,3071,967,2187,9132,3260,10498,3105,967,967,3105,\n\t\t\t         10310,2187,522,3071,7200,3595,3595,7200,2346,76,3071,9132,1827,7200,7200,1827,4496,2346,736,5766,4753,9722,9722,4753,7282,10623,5766,5794,7051,4753,4753,7051,5614,7282,736,9722,7749,7225,7225,7749,349,1540,9722,10623,10425,7749,7749,10425,9944,349,736,7225,5626,1493,1493,5626,4482,2942,7225,1540,8355,5626,5626,8355,\n\t\t\t         8643,4482,736,1493,8993,5766,5766,8993,3700,5794,1493,2942,7468,8993,8993,7468,7771,3700,8674,8874,10329,4269,4269,10329,10217,4802,8874,1540,349,10329,10329,349,9944,10217,8674,4269,8590,2819,2819,8590,1937,3387,4269,4802,7422,8590,8590,7422,891,1937,8674,2819,6234,6964,6964,6234,3632,3346,2819,3387,9303,6234,6234,9303,\n\t\t\t         6120,3632,8674,6964,2826,8874,8874,2826,8355,1540,6964,3346,6693,2826,2826,6693,8643,8355,9246,9471,6679,610,610,6679,4557,423,9471,3387,1937,6679,6679,1937,891,4557,9246,610,3022,1655,1655,3022,9321,2960,610,423,3095,3022,3022,3095,1157,9321,9246,1655,8188,2895,2895,8188,4979,2116,1655,2960,6452,8188,8188,6452,\n\t\t\t         3174,4979,9246,2895,7972,9471,9471,7972,9303,3387,2895,2116,9111,7972,7972,9111,6120,9303,8180,4702,1753,870,870,1753,944,3756,4702,2960,9321,1753,1753,9321,1157,944,8180,870,4371,8176,8176,4371,1267,6561,870,3756,3942,4371,4371,3942,1880,1267,8180,8176,10527,899,899,10527,2992,6740,8176,6561,9093,10527,10527,9093,\n\t\t\t         1410,2992,8180,899,9129,4702,4702,9129,6452,2960,899,6740,2416,9129,9129,2416,3174,6452,3229,2747,10059,8834,8834,10059,2287,3549,2747,6740,2992,10059,10059,2992,1410,2287,3229,8834,3670,4403,4403,3670,8162,2979,8834,3549,5471,3670,3670,5471,608,8162,3229,4403,3461,2747,2747,3461,2416,6740,4403,2979,5487,3461,3461,5487,\n\t\t\t         3174,2416,7782,4055,2120,3551,3551,2120,5487,2979,4055,2116,4979,2120,2120,4979,3174,5487,7782,3551,5915,8191,8191,5915,115,5552,3551,2979,8162,5915,5915,8162,608,115,7782,8191,185,4055,4055,185,9111,2116,8191,5552,6814,185,185,6814,6120,9111,8117,3545,3927,1277,1277,3927,5471,3549,3545,4582,1724,3927,3927,1724,\n\t\t\t         608,5471,8117,1277,8279,7633,7633,8279,7976,5650,1277,3549,2287,8279,8279,2287,1410,7976,8117,7633,7573,3545,3545,7573,4212,4582,7633,5650,9486,7573,7573,9486,2707,4212,4443,7877,9994,8273,8273,9994,9538,640,7877,5552,115,9994,9994,115,608,9538,4443,8273,6912,8356,8356,6912,5726,4165,8273,640,5637,6912,6912,5637,\n\t\t\t         650,5726,4443,8356,7906,7877,7877,7906,6814,5552,8356,4165,7605,7906,7906,7605,6120,6814,918,8467,3052,2249,2249,3052,7605,4165,8467,3346,3632,3052,3052,3632,6120,7605,918,2249,8122,8336,8336,8122,5945,1577,2249,4165,5726,8122,8122,5726,650,5945,918,8336,10340,8467,8467,10340,6693,3346,8336,1577,7904,10340,10340,7904,\n\t\t\t         8643,6693,9456,8236,5686,7682,7682,5686,5637,640,8236,1254,9927,5686,5686,9927,650,5637,9456,7682,1252,6245,6245,1252,6518,5049,7682,640,9538,1252,1252,9538,608,6518,9456,6245,3811,8236,8236,3811,10029,1254,6245,5049,124,3811,3811,124,8989,10029,10602,9733,1730,1746,1746,1730,124,5049,9733,9969,3480,1730,1730,3480,\n\t\t\t         8989,124,10602,1746,9682,9070,9070,9682,8685,8166,1746,5049,6518,9682,9682,6518,608,8685,10602,9070,2147,9733,9733,2147,6550,9969,9070,8166,7110,2147,2147,7110,9581,6550,285,2428,880,5150,5150,880,8303,9805,2428,5076,3027,880,880,3027,3211,8303,285,5150,414,7988,7988,414,5109,173,5150,9805,4172,414,414,4172,\n\t\t\t         9704,5109,285,7988,407,2428,2428,407,9735,5076,7988,173,108,407,407,108,3565,9735,667,4192,5567,9902,9902,5567,9034,7379,4192,1577,5945,5567,5567,5945,650,9034,667,9902,943,187,187,943,7704,2047,9902,7379,6780,943,943,6780,548,7704,667,187,10673,4192,4192,10673,7904,1577,187,2047,8160,10673,10673,8160,\n\t\t\t         8643,7904,9195,6686,10115,9138,9138,10115,7110,8166,6686,4986,7407,10115,10115,7407,9581,7110,9195,9138,8573,7575,7575,8573,1724,4582,9138,8166,8685,8573,8573,8685,608,1724,9195,7575,10398,6686,6686,10398,8513,4986,7575,4582,4212,10398,10398,4212,2707,8513,8857,10196,1524,9563,9563,1524,2837,3981,10196,8744,2072,1524,1524,2072,\n\t\t\t         3629,2837,8857,9563,160,10138,10138,160,8891,2123,9563,3981,5959,160,160,5959,9704,8891,8857,10138,9725,10196,10196,9725,5195,8744,10138,2123,5573,9725,9725,5573,8081,5195,6374,2105,735,10548,10548,735,702,3181,2105,9969,6550,735,735,6550,9581,702,6374,10548,1567,9335,9335,1567,8174,9339,10548,3181,9013,1567,1567,9013,\n\t\t\t         9430,8174,6374,9335,2681,2105,2105,2681,3480,9969,9335,9339,8016,2681,2681,8016,8989,3480,6676,7405,1434,3288,3288,1434,5573,2123,7405,2777,7799,1434,1434,7799,8081,5573,6676,3288,8276,3831,3831,8276,4172,9805,3288,2123,8891,8276,8276,8891,9704,4172,6676,3831,5583,7405,7405,5583,8185,2777,3831,9805,8303,5583,5583,8303,\n\t\t\t         3211,8185,10369,950,77,3156,3156,77,8218,462,950,6481,2248,77,77,2248,1796,8218,10369,3156,7089,1109,1109,7089,2072,8744,3156,462,9494,7089,7089,9494,3629,2072,10369,1109,226,950,950,226,2403,6481,1109,8744,5195,226,226,5195,8081,2403,1319,1845,8658,10314,10314,8658,9811,6074,1845,5338,7590,8658,8658,7590,\n\t\t\t         2512,9811,1319,10314,6524,8143,8143,6524,9494,462,10314,6074,2759,6524,6524,2759,3629,9494,1319,8143,851,1845,1845,851,2022,5338,8143,462,8218,851,851,8218,1796,2022,8539,8960,5953,1169,1169,5953,7590,5338,8960,1900,368,5953,5953,368,2512,7590,8539,1169,9975,8076,8076,9975,8041,6412,1169,5338,2022,9975,9975,2022,\n\t\t\t         1796,8041,8539,8076,10587,8960,8960,10587,9983,1900,8076,6412,9082,10587,10587,9082,8603,9983,5873,6716,1910,2333,2333,1910,7468,2942,6716,3327,8439,1910,1910,8439,7771,7468,5873,2333,8491,1416,1416,8491,8160,2047,2333,2942,4482,8491,8491,4482,8643,8160,5873,1416,4323,5272,5272,4323,845,4279,1416,2047,7704,4323,4323,7704,\n\t\t\t         548,845,5873,5272,6905,6716,6716,6905,1409,3327,5272,4279,439,6905,6905,439,2581,1409,9298,2821,8665,8892,8892,8665,3363,4813,2821,3147,762,8665,8665,762,5177,3363,9298,8892,375,8521,8521,375,439,4279,8892,4813,2916,375,375,2916,2581,439,9298,8521,6270,2821,2821,6270,10414,3147,8521,4279,845,6270,6270,845,\n\t\t\t         548,10414,7431,4667,9189,1321,1321,9189,2916,4813,4667,3951,8786,9189,9189,8786,2581,2916,7431,1321,444,5452,5452,444,5541,5397,1321,4813,3363,444,444,3363,5177,5541,7431,5452,9676,4667,4667,9676,4779,3951,5452,5397,4732,9676,9676,4732,10620,4779,2704,1041,8272,5142,5142,8272,2217,2035,1041,5397,5541,8272,8272,5541,\n\t\t\t         5177,2217,2704,5142,694,2327,2327,694,9855,8103,5142,2035,6961,694,694,6961,9430,9855,2704,2327,8287,1041,1041,8287,4732,5397,2327,8103,1343,8287,8287,1343,10620,4732,3539,7137,9500,2830,2830,9500,9013,3181,7137,8103,9855,9500,9500,9855,9430,9013,3539,2830,7945,1036,1036,7945,8461,132,2830,3181,702,7945,7945,702,\n\t\t\t         9581,8461,3539,1036,5754,7137,7137,5754,1343,8103,1036,132,4385,5754,5754,4385,10620,1343,1601,6515,7843,8818,8818,7843,4973,5387,6515,132,8461,7843,7843,8461,9581,4973,1601,8818,1980,5802,5802,1980,9943,4174,8818,5387,6135,1980,1980,6135,3865,9943,1601,5802,5814,1830,1830,5814,2294,8536,5802,4174,896,5814,5814,896,\n\t\t\t         10,2294,1601,1830,5175,6515,6515,5175,4385,132,1830,8536,1699,5175,5175,1699,10620,4385,977,3934,9041,8661,8661,9041,1699,8536,3934,3951,4779,9041,9041,4779,10620,1699,977,8661,269,8334,8334,269,194,4347,8661,8536,2294,269,269,2294,10,194,977,8334,9524,9501,9501,9524,5615,7860,8334,4347,4028,9524,9524,4028,\n\t\t\t         7654,5615,977,9501,1328,3934,3934,1328,8786,3951,9501,7860,2042,1328,1328,2042,2581,8786,6885,6341,1698,4720,4720,1698,2042,7860,6341,3327,1409,1698,1698,1409,2581,2042,6885,4720,7485,2289,2289,7485,8342,2167,4720,7860,5615,7485,7485,5615,7654,8342,6885,2289,6294,8229,8229,6294,7738,9550,2289,2167,3676,6294,6294,3676,\n\t\t\t         9877,7738,6885,8229,516,6341,6341,516,8439,3327,8229,9550,7900,516,516,7900,7771,8439,4988,1262,8566,4471,4471,8566,7900,9550,1262,10498,4158,8566,8566,4158,7771,7900,4988,4471,3397,5480,5480,3397,5389,2477,4471,9550,7738,3397,3397,7738,9877,5389,4988,5480,1886,9206,9206,1886,9145,10649,5480,2477,9652,1886,1886,9652,\n\t\t\t         6737,9145,4988,9206,6080,1262,1262,6080,3105,10498,9206,10649,305,6080,6080,305,10310,3105,484,10704,2842,4717,4717,2842,7407,4986,10704,5387,4973,2842,2842,4973,9581,7407,484,4717,5275,3713,3713,5275,1330,6253,4717,4986,8513,5275,5275,8513,2707,1330,484,3713,7030,10704,10704,7030,6135,5387,3713,6253,3496,7030,7030,3496,\n\t\t\t         3865,6135,5209,7143,2121,800,800,2121,6915,1511,7143,4174,9943,2121,2121,9943,3865,6915,5209,800,600,7721,7721,600,5237,9241,800,1511,6574,600,600,6574,7522,5237,5209,7721,3213,5964,5964,3213,3172,10186,7721,9241,808,3213,3213,808,8009,3172,5209,5964,2028,7143,7143,2028,896,4174,5964,10186,6809,2028,2028,6809,\n\t\t\t         10,896,6049,9976,5040,7165,7165,5040,890,8402,9976,5547,9411,5040,5040,9411,6134,890,6049,7165,10172,1183,1183,10172,10774,5373,7165,8402,10611,10172,10172,10611,7654,10774,6049,1183,763,9976,9976,763,4044,5547,1183,5373,3517,763,763,3517,9972,4044,4939,6193,5451,7169,7169,5451,10611,8402,6193,2167,8342,5451,5451,8342,\n\t\t\t         7654,10611,4939,7169,2558,6753,6753,2558,8498,9535,7169,8402,890,2558,2558,890,6134,8498,4939,6753,3494,5008,5008,3494,2908,2839,6753,9535,225,3494,3494,225,90,2908,4939,5008,5090,6193,6193,5090,3676,2167,5008,2839,6734,5090,5090,6734,9877,3676,10137,6415,10522,405,405,10522,3496,6253,6415,1511,6915,10522,10522,6915,\n\t\t\t         3865,3496,10137,405,3178,413,413,3178,9243,2845,405,6253,1330,3178,3178,1330,2707,9243,10137,413,9192,6415,6415,9192,6574,1511,413,2845,6266,9192,9192,6266,7522,6574,10430,6286,8446,1935,1935,8446,6734,2839,6286,2477,5389,8446,8446,5389,9877,6734,10430,1935,1513,2773,2773,1513,8060,8488,1935,2839,2908,1513,1513,2908,\n\t\t\t         90,8060,10430,2773,4920,6286,6286,4920,9652,2477,2773,8488,1941,4920,4920,1941,6737,9652,2024,4027,2077,3612,3612,2077,3517,5373,4027,4328,924,2077,2077,924,9972,3517,2024,3612,9759,6660,6660,9759,4028,4347,3612,5373,10774,9759,9759,10774,7654,4028,2024,6660,2465,8830,8830,2465,6809,10186,6660,4347,194,2465,2465,194,\n\t\t\t         10,6809,2024,8830,9712,4027,4027,9712,3284,4328,8830,10186,3172,9712,9712,3172,8009,3284,1118,8841,3522,9216,9216,3522,237,5122,8841,1900,9983,3522,3522,9983,8603,237,1118,9216,9291,5377,5377,9291,6409,7353,9216,5122,3804,9291,9291,3804,8029,6409,1118,5377,7240,8186,8186,7240,2174,8438,5377,7353,10044,7240,7240,10044,\n\t\t\t         4081,2174,1118,8186,7211,8841,8841,7211,368,1900,8186,8438,329,7211,7211,329,2512,368,6335,4937,420,8326,8326,420,329,8438,4937,6074,9811,420,420,9811,2512,329,6335,8326,5217,9520,9520,5217,6634,8170,8326,8438,2174,5217,5217,2174,4081,6634,6335,9520,1102,2820,2820,1102,5581,3503,9520,8170,5720,1102,1102,5720,\n\t\t\t         29,5581,6335,2820,4171,4937,4937,4171,2759,6074,2820,3503,1915,4171,4171,1915,3629,2759,5173,10505,1566,10758,10758,1566,1915,3503,10505,3981,2837,1566,1566,2837,3629,1915,5173,10758,5682,2875,2875,5682,1348,8311,10758,3503,5581,5682,5682,5581,29,1348,5173,2875,9861,1062,1062,9861,1298,6840,2875,8311,4136,9861,9861,4136,\n\t\t\t         9315,1298,5173,1062,572,10505,10505,572,5959,3981,1062,6840,9065,572,572,9065,9704,5959,7395,5002,1250,688,688,1250,8090,5522,5002,5841,1868,1250,1250,1868,3565,8090,7395,688,9477,6873,6873,9477,8204,10009,688,5522,5534,9477,9477,5534,6502,8204,7395,6873,8398,5891,4222,10708,3804,5122,6873,10009,9317,8398,10708,8217,\n\t\t\t         8029,3804,7395,5891,5419,5002,5002,5419,2295,5841,4222,5122,237,70,70,237,8603,2829,2657,3418,9813,4569,4569,9813,9065,6840,3418,173,5109,9813,9813,5109,9704,9065,2657,4569,10033,5678,5678,10033,8934,10143,4569,6840,1298,10033,10033,1298,9315,8934,2657,5678,2599,52,52,2599,5534,5522,5678,10143,10214,2599,2599,10214,\n\t\t\t         6502,5534,2657,52,4266,3418,3418,4266,108,173,52,5522,8090,4266,4266,8090,3565,108,4564,10218,7902,7087,7087,7902,4136,8311,10218,10534,6007,7902,7902,6007,9315,4136,4564,7087,7839,9836,9836,7839,8914,4344,7087,8311,1348,7839,7839,1348,29,8914,4564,9836,1914,7884,7884,1914,5657,2043,9836,4344,1083,1914,1914,1083,\n\t\t\t         7901,5657,4564,7884,980,10218,10218,980,4041,10534,7884,2043,5478,980,980,5478,8959,4041,1800,9505,1350,5717,5717,1350,5720,8170,9505,4344,8914,1350,1350,8914,29,5720,1800,5717,7035,7768,7768,7035,1623,5865,5717,8170,6634,7035,7035,6634,4081,1623,1800,7768,5988,5910,5910,5988,698,10470,7768,5865,179,5988,5988,179,\n\t\t\t         9383,698,1800,5910,5285,9505,9505,5285,1083,4344,5910,10470,992,5285,5285,992,7901,1083,5923,2444,492,9528,9528,492,10044,7353,2444,5865,1623,492,492,1623,4081,10044,5923,9528,4543,4150,4150,4543,6579,4214,9528,7353,6409,4543,4543,6409,8029,6579,5923,4150,9691,9758,9758,9691,4745,3687,4150,4214,1137,9691,9691,1137,\n\t\t\t         4008,4745,5923,9758,7808,2444,2444,7808,179,5865,9758,3687,1425,7808,7808,1425,9383,179,8238,4849,10657,4640,4640,10657,9317,10009,10392,4214,6579,2350,2350,6579,8029,8217,8238,4640,10446,1468,1468,10446,8089,8108,4640,10009,8204,10446,10446,8204,6502,8089,8238,1468,2973,908,908,2973,7163,5831,1468,8108,6000,2973,2973,6000,\n\t\t\t         3093,7163,8238,908,1555,4849,10392,1003,1137,4214,908,5831,2885,1555,1003,10209,4008,1137,7930,7897,7371,5167,5167,7371,10214,10143,7897,8108,8089,7371,7371,8089,6502,10214,7930,5167,2689,3520,3520,2689,6007,10534,5167,10143,8934,2689,2689,8934,9315,6007,7930,3520,1052,5822,5822,1052,3193,3485,3520,10534,4041,1052,1052,4041,\n\t\t\t         8959,3193,7930,5822,7223,7897,7897,7223,6000,8108,5822,3485,5162,7223,7223,5162,3093,6000,8387,4262,3983,9680,9680,3983,7332,3066,4262,3687,4745,3983,3983,4745,4008,7332,8387,9680,2007,10513,10513,2007,330,5315,9680,3066,5978,2007,2007,5978,803,330,8387,10513,9324,3234,3234,9324,8668,1584,10513,5315,2494,9324,9324,2494,\n\t\t\t         5977,8668,8387,3234,2470,4262,4262,2470,1425,3687,3234,1584,2389,2470,2470,2389,9383,1425,6383,7585,7957,8051,8051,7957,2389,1584,7585,10470,698,7957,7957,698,9383,2389,6383,8051,3566,9781,9781,3566,9079,1850,8051,1584,8668,3566,3566,8668,5977,9079,6383,9781,3083,4626,4626,3083,10170,2852,9781,1850,5765,3083,3083,5765,\n\t\t\t         4487,10170,6383,4626,597,7585,7585,597,992,10470,4626,2852,5079,597,597,5079,7901,992,5741,3681,1823,7517,7517,1823,5079,2852,3681,2043,5657,1823,1823,5657,7901,5079,5741,7517,1259,1707,1707,1259,2274,2529,7517,2852,10170,1259,1259,10170,4487,2274,5741,1707,5548,6144,6144,5548,5114,8293,1707,2529,9106,5548,5548,9106,\n\t\t\t         452,5114,5741,6144,1806,3681,3681,1806,5478,2043,6144,8293,4435,1806,1806,4435,8959,5478,8343,2998,7893,8177,8177,7893,4435,8293,2998,3485,3193,7893,7893,3193,8959,4435,8343,8177,8230,317,317,8230,10579,9095,8177,8293,5114,8230,8230,5114,452,10579,8343,317,4958,8096,8096,4958,6739,4145,317,9095,2537,4958,4958,2537,\n\t\t\t         6423,6739,8343,8096,8121,2998,2998,8121,5162,3485,8096,4145,5647,8121,8121,5647,3093,5162,5457,5077,6607,1884,1884,6607,5647,4145,5077,5831,7163,6607,6607,7163,3093,5647,5457,1884,1021,1386,1386,1021,10436,6557,1884,4145,6739,1021,1021,6739,6423,10436,5457,1386,9200,8451,6207,5563,5978,3066,1386,6557,8854,9200,5563,5464,\n\t\t\t         803,5978,5457,8451,6882,5077,5077,6882,2885,5831,6207,3066,7332,3892,3892,7332,4008,10209,8814,7448,5172,3333,3333,5172,7688,9575,7448,5315,330,5172,5172,330,803,7688,8814,3333,6554,507,507,6554,6829,2601,3333,9575,9624,6554,6554,9624,2450,6829,8814,507,6117,4965,4965,6117,9478,2718,507,2601,4725,6117,6117,4725,\n\t\t\t         8091,9478,8814,4965,2893,7448,7448,2893,2494,5315,4965,2718,6751,2893,2893,6751,5977,2494,3285,1068,16,5489,5489,16,6751,2718,1068,1850,9079,16,16,9079,5977,6751,3285,5489,7309,5447,5447,7309,3937,6582,5489,2718,9478,7309,7309,9478,8091,3937,3285,5447,3433,8183,8183,3433,829,5170,5447,6582,7939,3433,3433,7939,\n\t\t\t         7767,829,3285,8183,8323,1068,1068,8323,5765,1850,8183,5170,4209,8323,8323,4209,4487,5765,9893,5179,3689,5531,5531,3689,4209,5170,5179,2529,2274,3689,3689,2274,4487,4209,9893,5531,125,7647,7647,125,5296,1017,5531,5170,829,125,125,829,7767,5296,9893,7647,8151,1324,1324,8151,170,10417,7647,1017,1309,8151,8151,1309,\n\t\t\t         2301,170,9893,1324,6396,5179,5179,6396,9106,2529,1324,10417,8794,6396,6396,8794,452,9106,5506,4297,2924,8710,8710,2924,8794,10417,4297,9095,10579,2924,2924,10579,452,8794,5506,8710,2793,10320,10320,2793,8377,5181,8710,10417,170,2793,2793,170,2301,8377,5506,10320,10079,8613,8613,10079,6782,8365,10320,5181,5131,10079,10079,5131,\n\t\t\t         1600,6782,5506,8613,3289,4297,4297,3289,2537,9095,8613,8365,10460,3289,3289,10460,6423,2537,5817,7525,10192,4711,4711,10192,10460,8365,7525,6557,10436,10192,10192,10436,6423,10460,5817,4711,3014,1215,1215,3014,10607,1948,4711,8365,6782,3014,3014,6782,1600,10607,5817,1215,3015,2858,7392,3330,9624,9575,1215,1948,4520,3015,3330,1787,\n\t\t\t         2450,9624,5817,2858,10072,7525,7525,10072,8854,6557,7392,9575,7688,3281,3281,7688,803,5464,3585,8672,3063,2278,2278,3063,1899,5974,8672,2601,6829,3063,3063,6829,2450,1899,3585,2278,2524,3719,3719,2524,7381,418,2278,5974,941,2524,2524,941,1352,7381,3585,3719,2472,10379,10379,2472,9668,9719,3719,418,230,2472,2472,230,\n\t\t\t         3372,9668,3585,10379,5895,8672,8672,5895,4725,2601,10379,9719,5227,5895,5895,5227,8091,4725,7746,9325,2375,8044,8044,2375,5227,9719,9325,6582,3937,2375,2375,3937,8091,5227,7746,8044,7389,1022,1022,7389,7449,586,8044,9719,9668,7389,7389,9668,3372,7449,7746,1022,1503,4065,4065,1503,5888,1234,1022,586,6747,1503,1503,6747,\n\t\t\t         590,5888,7746,4065,6130,9325,9325,6130,7939,6582,4065,1234,7480,6130,6130,7480,7767,7939,6595,9749,1019,604,604,1019,7480,1234,9749,1017,5296,1019,1019,5296,7767,7480,6595,604,9557,4090,4090,9557,6884,1554,604,1234,5888,9557,9557,5888,590,6884,6595,4090,726,2440,2440,726,6102,5030,4090,1554,2486,726,726,2486,\n\t\t\t         10045,6102,6595,2440,10724,9749,9749,10724,1309,1017,2440,5030,3057,10724,10724,3057,2301,1309,5498,2514,4264,3264,3264,4264,3057,5030,2514,5181,8377,4264,4264,8377,2301,3057,5498,3264,3489,2806,2806,3489,3341,6957,3264,5030,6102,3489,3489,6102,10045,3341,5498,2806,4675,10700,10700,4675,5862,9304,2806,6957,10075,4675,4675,10075,\n\t\t\t         1621,5862,5498,10700,1286,2514,2514,1286,5131,5181,10700,9304,1344,1286,1286,1344,1600,5131,4850,4808,2009,9099,9099,2009,1344,9304,4808,1948,10607,2009,2009,10607,1600,1344,4850,9099,10306,10478,10478,10306,3768,1054,9099,9304,5862,10306,10306,5862,1621,3768,4850,10478,2737,1125,7626,9173,941,5974,10478,1054,699,2737,9173,4018,\n\t\t\t         1352,941,4850,1125,8412,4808,4808,8412,4520,1948,7626,5974,1899,8345,8345,1899,2450,1787,2319,6092,5971,4530,4530,5971,8267,1500,6092,418,7381,5971,5971,7381,1352,8267,2319,4530,9518,673,673,9518,3055,4497,4530,1500,3402,9518,9518,3402,4368,3055,2319,673,3261,973,973,3261,8413,10553,673,4497,7823,3261,3261,7823,\n\t\t\t         2398,8413,2319,973,8423,6092,6092,8423,230,418,973,10553,5606,8423,8423,5606,3372,230,4243,233,5972,5848,5848,5972,5606,10553,233,586,7449,5972,5972,7449,3372,5606,4243,5848,1977,1253,1253,1977,1669,6178,5848,10553,8413,1977,1977,8413,2398,1669,4243,1253,605,4355,4355,605,6299,3562,1253,6178,196,605,605,196,\n\t\t\t         4357,6299,4243,4355,7684,233,233,7684,6747,586,4355,3562,10495,7684,7684,10495,590,6747,3331,5912,5673,8157,8157,5673,10495,3562,5912,1554,6884,5673,5673,6884,590,10495,3331,8157,8875,7306,7306,8875,5340,6877,8157,3562,6299,8875,8875,6299,4357,5340,3331,7306,8619,171,171,8619,6114,4224,7306,6877,5515,8619,8619,5515,\n\t\t\t         3806,6114,3331,171,7149,5912,5912,7149,2486,1554,171,4224,3242,7149,7149,3242,10045,2486,8941,2054,6647,1375,1375,6647,3242,4224,2054,6957,3341,6647,6647,3341,10045,3242,8941,1375,7586,10633,10633,7586,6867,5191,1375,4224,6114,7586,7586,6114,3806,6867,8941,10633,6005,9202,9202,6005,3647,2583,10633,5191,1578,6005,6005,1578,\n\t\t\t         9445,3647,8941,9202,4874,2054,2054,4874,10075,6957,9202,2583,9714,4874,4874,9714,1621,10075,2254,9245,6258,7301,7301,6258,9714,2583,9245,1054,3768,6258,6258,3768,1621,9714,2254,7301,5497,5408,5408,5497,2661,5587,7301,2583,3647,5497,5497,3647,9445,2661,2254,5408,5295,5987,4622,1452,3402,1500,5408,5587,2967,5295,1452,7966,\n\t\t\t         4368,3402,2254,5987,5400,9245,9245,5400,699,1054,4622,1500,8267,1481,1481,8267,1352,4018,9364,8684,7523,8239,8239,7523,1461,5685,8684,4497,3055,7523,7523,3055,4368,1461,9364,8239,4703,4866,4866,4703,3094,2791,8239,5685,10061,4703,4703,10061,2976,3094,9364,4866,8101,5665,5665,8101,4245,2160,4866,2791,1579,8101,8101,1579,\n\t\t\t         265,4245,9364,5665,8990,8684,8684,8990,7823,4497,5665,2160,8858,8990,8990,8858,2398,7823,5580,9390,10333,7735,7735,10333,8858,2160,9390,6178,1669,10333,10333,1669,2398,8858,5580,7735,4601,2838,2838,4601,3728,10118,7735,2160,4245,4601,4601,4245,265,3728,5580,2838,1944,6027,6027,1944,10322,9854,2838,10118,8847,1944,1944,8847,\n\t\t\t         3214,10322,5580,6027,740,9390,9390,740,196,6178,6027,9854,4890,740,740,4890,4357,196,359,9686,9150,1958,1958,9150,4890,9854,9686,6877,5340,9150,9150,5340,4357,4890,359,1958,8189,10131,10131,8189,5505,3154,1958,9854,10322,8189,8189,10322,3214,5505,359,10131,8007,3177,3177,8007,9014,10241,10131,3154,6390,8007,8007,6390,\n\t\t\t         8792,9014,359,3177,9388,9686,9686,9388,5515,6877,3177,10241,5444,9388,9388,5444,3806,5515,4031,550,9718,6002,6002,9718,5444,10241,550,5191,6867,9718,9718,6867,3806,5444,4031,6002,7000,5877,5877,7000,3062,7907,6002,10241,9014,7000,7000,9014,8792,3062,4031,5877,1475,1867,1867,1475,1276,4283,5877,7907,4929,1475,1475,4929,\n\t\t\t         2158,1276,4031,1867,5089,550,550,5089,1578,5191,1867,4283,10545,5089,5089,10545,9445,1578,88,10383,5011,2951,2951,5011,10545,4283,10383,5587,2661,5011,5011,2661,9445,10545,88,2951,6949,7752,7752,6949,6188,9076,2951,4283,1276,6949,6949,1276,2158,6188,88,7752,7473,8551,705,1050,10061,5685,7752,9076,3216,7473,1050,5105,\n\t\t\t         2976,10061,88,8551,6282,10383,10383,6282,2967,5587,705,5685,1461,7607,7607,1461,4368,7966,4509,7941,4301,23,23,4301,1968,965,7941,2791,3094,4301,4301,3094,2976,1968,4509,23,7662,2939,2939,7662,10041,1401,23,965,9880,7662,7662,9880,3352,10041,4509,2939,2864,6013,6013,2864,10207,8728,2939,1401,10739,2864,2864,10739,\n\t\t\t         9218,10207,4509,6013,6212,7941,7941,6212,1579,2791,6013,8728,9473,6212,6212,9473,265,1579,344,5039,1020,1607,1607,1020,9473,8728,5039,10118,3728,1020,1020,3728,265,9473,344,1607,3233,9272,9272,3233,7274,902,1607,8728,10207,3233,3233,10207,9218,7274,344,9272,7638,8965,8965,7638,7294,1443,9272,902,5789,7638,7638,5789,\n\t\t\t         394,7294,344,8965,7457,5039,5039,7457,8847,10118,8965,1443,830,7457,7457,830,3214,8847,4845,4994,436,7969,7969,436,830,1443,4994,3154,5505,436,436,5505,3214,830,4845,7969,7600,5266,5266,7600,10391,7203,7969,1443,7294,7600,7600,7294,394,10391,4845,5266,2766,7772,7772,2766,353,5017,5266,7203,1772,2766,2766,1772,\n\t\t\t         8468,353,4845,7772,3292,4994,4994,3292,6390,3154,7772,5017,5577,3292,3292,5577,8792,6390,10538,4220,6140,10280,10280,6140,5577,5017,4220,7907,3062,6140,6140,3062,8792,5577,10538,10280,5907,868,868,5907,7290,3563,10280,5017,353,5907,5907,353,8468,7290,10538,868,8313,489,489,8313,7888,6846,868,3563,3619,8313,8313,3619,\n\t\t\t         6313,7888,10538,489,7016,4220,4220,7016,4929,7907,489,6846,1759,7016,7016,1759,2158,4929,9900,10750,6093,6618,6618,6093,1759,6846,10750,9076,6188,6093,6093,6188,2158,1759,9900,6618,4053,9425,9425,4053,10621,1251,6618,6846,7888,4053,4053,7888,6313,10621,9900,9425,2990,5054,7009,5630,9880,965,9425,1251,1450,2990,5630,838,\n\t\t\t         3352,9880,9900,5054,8156,10750,10750,8156,3216,9076,7009,965,1968,5558,5558,1968,2976,5105,8312,5536,10540,7583,7583,10540,6928,231,4444,4151,272,7156,7156,272,8516,6406,8312,7583,9844,389,389,9844,921,1256,7583,231,5763,9844,9844,5763,3313,921,8312,389,8429,6978,6978,8429,4099,5543,389,1256,8500,8429,8429,8500,\n\t\t\t         2306,4099,8312,6978,1486,5536,4444,6953,4558,4151,6978,5543,9127,1486,6953,1072,8511,4558,1010,3431,2076,9532,10418,4233,5508,10370,3431,231,6928,2076,4233,6406,8516,5508,1010,9532,96,872,872,96,9028,2216,10418,10370,10366,4302,4302,10366,4976,3740,1010,872,1402,6979,6979,1402,229,1182,872,2216,9055,1402,1402,9055,\n\t\t\t         1048,229,1010,6979,681,3431,3431,681,5763,231,6979,1182,467,681,681,467,3313,5763,4548,6472,5214,5769,131,3701,9771,3073,6472,2216,9028,5214,3701,3740,4976,9771,4548,5769,5379,10509,10509,5379,5998,2768,131,3073,9284,4629,4629,9284,9629,5842,4548,10509,957,6323,6323,957,9904,6038,10509,2768,8471,957,957,8471,\n\t\t\t         5846,9904,4548,6323,1929,6472,6472,1929,9055,2216,6323,6038,1789,1929,1929,1789,1048,9055,8664,2402,2230,7867,6436,9183,6151,8216,2402,2768,5998,2230,9183,5842,9629,6151,8664,7867,1959,3628,3628,1959,797,3590,6436,8216,1897,861,861,1897,10316,3199,8664,3628,9457,5569,5569,9457,9319,2351,3628,3590,9570,9457,9457,9570,\n\t\t\t         9449,9319,8664,5569,1803,2402,2402,1803,8471,2768,5569,2351,10485,1803,1803,10485,5846,8471,6775,8454,3582,3293,9392,2937,2949,7958,8454,3590,797,3582,2937,3199,10316,2949,6775,3293,10319,2701,2701,10319,7314,3724,9392,7958,6982,1924,1924,6982,2313,457,6775,2701,2387,6340,6340,2387,3613,2872,2701,3724,6448,2387,2387,6448,\n\t\t\t         8427,3613,6775,6340,386,8454,8454,386,9570,3590,6340,2872,3280,386,386,3280,9449,9570,6221,9531,4396,8301,8301,4396,8021,4628,9531,6425,117,4396,4396,117,8114,8021,6221,8301,1360,10114,10114,1360,5710,7205,8301,4628,2162,1360,1360,2162,2265,5710,6221,10114,5092,7803,7803,5092,1368,6349,10114,7205,6868,5092,5092,6868,\n\t\t\t         10721,1368,6221,7803,7138,9531,9531,7138,5751,6425,7803,6349,1665,7138,7138,1665,7686,5751,8135,1780,6870,4275,4275,6870,1665,6349,1780,4574,9016,6870,6870,9016,7686,1665,8135,4275,5059,204,204,5059,5926,6828,4275,6349,1368,5059,5059,1368,10721,5926,8135,204,1196,8823,8823,1196,4005,7066,204,6828,5235,1196,1196,5235,\n\t\t\t         5863,4005,8135,8823,334,1780,1780,334,8557,4574,8823,7066,2627,334,334,2627,5378,8557,4365,7210,7014,1907,1907,7014,2455,323,7210,7048,721,7014,7014,721,138,2455,4365,1907,5608,2780,2780,5608,759,220,1907,323,7962,5608,5608,7962,5530,759,4365,2780,6031,5588,5588,6031,5369,6097,2780,220,2010,6031,6031,2010,\n\t\t\t         5201,5369,4365,5588,1713,7210,7210,1713,8803,7048,5588,6097,9268,1713,1713,9268,8442,8803,5186,1965,2360,2447,2447,2360,9268,6097,1965,7470,1200,2360,2360,1200,8442,9268,5186,2447,3975,7787,7787,3975,907,8952,2447,6097,5369,3975,3975,5369,5201,907,5186,7787,4966,6382,6382,4966,2162,4628,7787,8952,3060,4966,4966,3060,\n\t\t\t         2265,2162,5186,6382,8235,1965,1965,8235,6806,7470,6382,4628,8021,8235,8235,8021,8114,6806,4983,875,3858,2252,2252,3858,7892,7865,875,3465,3236,3858,3858,3236,8038,7892,4983,2252,3507,2050,2050,3507,8635,9476,2252,7865,10483,3507,3507,10483,4407,8635,4983,2050,3878,2927,2927,3878,8093,6883,2050,9476,5718,3878,3878,5718,\n\t\t\t         565,8093,4983,2927,5595,875,875,5595,3119,3465,2927,6883,7153,5595,5595,7153,9313,3119,3782,9549,2368,5994,5994,2368,2627,7066,9549,8350,10179,2368,2368,10179,5378,2627,3782,5994,3550,5518,5518,3550,7039,1261,5994,7066,4005,3550,3550,4005,5863,7039,3782,5518,4424,6504,2127,1680,10483,7865,5518,1261,10136,4424,1680,1748,\n\t\t\t         4407,10483,3782,6504,5935,9549,9549,5935,1812,8350,2127,7865,7892,9446,9446,7892,8038,2195,10345,8314,6645,8415,8415,6645,7153,6883,8314,6249,3487,6645,6645,3487,9313,7153,10345,8415,3820,10536,10536,3820,8058,7426,8415,6883,8093,3820,3820,8093,565,8058,10345,10536,2258,1936,1936,2258,7962,323,10536,7426,9263,2258,2258,9263,\n\t\t\t         5530,7962,10345,1936,9925,8314,8314,9925,1891,6249,1936,323,2455,9925,9925,2455,138,1891,2559,3644,2228,3310,3310,2228,2555,10499,3644,7205,5710,2228,2228,5710,2265,2555,2559,3310,5003,3988,3988,5003,10060,2556,3310,10499,5881,5003,5003,5881,1599,10060,2559,3988,3720,1811,1811,3720,8270,9851,3988,2556,9726,3720,3720,9726,\n\t\t\t         8925,8270,2559,1811,3258,3644,3644,3258,6868,7205,1811,9851,5555,3258,3258,5555,10721,6868,1159,236,4648,8639,8639,4648,5555,9851,236,6828,5926,4648,4648,5926,10721,5555,1159,8639,7074,7104,7104,7074,2616,10617,8639,9851,8270,7074,7074,8270,8925,2616,1159,7104,3646,1037,1037,3646,4063,3744,7104,10617,7362,3646,3646,7362,\n\t\t\t         2955,4063,1159,1037,4270,236,236,4270,5235,6828,1037,3744,9834,4270,4270,9834,5863,5235,7864,14,2542,6711,6711,2542,6083,5708,14,220,759,2542,2542,759,5530,6083,7864,6711,10171,4861,4861,10171,8263,6573,6711,5708,6970,10171,10171,6970,267,8263,7864,4861,8148,2776,2776,8148,2342,2711,4861,6573,2098,8148,8148,2098,\n\t\t\t         4367,2342,7864,2776,7742,14,14,7742,2010,220,2776,2711,10151,7742,7742,10151,5201,2010,757,10298,3833,8118,8118,3833,10151,2711,10298,8952,907,3833,3833,907,5201,10151,757,8118,4585,10564,10564,4585,3351,986,8118,2711,2342,4585,4585,2342,4367,3351,757,10564,9767,5344,5344,9767,5881,10499,10564,986,4034,9767,9767,4034,\n\t\t\t         1599,5881,757,5344,3442,10298,10298,3442,3060,8952,5344,10499,2555,3442,3442,2555,2265,3060,8286,3620,6127,3428,3428,6127,134,1247,3620,9476,8635,6127,6127,8635,4407,134,8286,3428,147,43,43,147,7791,9794,3428,1247,6564,147,147,6564,7020,7791,8286,43,8607,10786,10786,8607,8165,5263,43,9794,6090,8607,8607,6090,\n\t\t\t         9395,8165,8286,10786,8392,3620,3620,8392,5718,9476,10786,5263,4135,8392,8392,4135,565,5718,1370,8878,6375,5844,5844,6375,9834,3744,8878,1261,7039,6375,6375,7039,5863,9834,1370,5844,2056,2914,2914,2056,3557,6364,5844,3744,4063,2056,2056,4063,2955,3557,1370,2914,580,9919,6494,287,6564,1247,2914,6364,2284,580,287,5509,\n\t\t\t         7020,6564,1370,9919,7252,8878,8878,7252,10136,1261,6494,1247,134,2178,2178,134,4407,1748,6191,9798,8294,5368,5368,8294,4135,5263,9798,7426,8058,8294,8294,8058,565,4135,6191,5368,2859,3186,3186,2859,7214,10490,5368,5263,8165,2859,2859,8165,9395,7214,6191,3186,5267,459,459,5267,6970,5708,3186,10490,3625,5267,5267,3625,\n\t\t\t         267,6970,6191,459,9210,9798,9798,9210,9263,7426,459,5708,6083,9210,9210,6083,5530,9263,311,697,3097,9277,311,9277,2834,3575,311,3575,1299,697,5852,6710,5693,8056,5852,8056,7549,983,5852,983,5288,5279,5852,5279,8718,6710,399,511,5693,6710,399,6710,8718,5232,399,5232,6943,511,10103,1193,6020,10152,10103,10152,\n\t\t\t         1436,10142,10103,10142,5200,1193,1810,2323,1299,9053,1810,9053,3250,61,1810,61,714,116,1810,116,9614,2323,730,10427,1436,10152,730,10152,6020,3208,730,3208,8761,10427,5093,3316,1834,4968,5093,4968,5200,7076,5093,7076,2798,3316,80,9929,5640,10315,80,10315,2798,5009,80,5009,1436,9437,80,9437,6244,9929,8680,2323,\n\t\t\t         9614,5896,8680,5896,3097,697,8680,697,1299,2323,2814,3208,6020,9788,2814,9788,2834,340,2814,340,8761,3208,4653,7076,5200,10142,4653,10142,1436,5009,4653,5009,2798,7076,4506,2879,4337,1619,4506,1619,1834,3316,4506,3316,2798,10315,4506,10315,5640,2879,1570,340,2834,9277,1570,9277,3097,3080,1570,3080,8761,340,455,9795,\n\t\t\t         6244,9437,455,9437,1436,10427,455,10427,8761,10051,455,10051,98,9795,2018,6844,98,10051,2018,10051,8761,3080,2018,3080,3097,1156,2018,1156,5947,6844,2856,10444,5947,1156,2856,1156,3097,5896,2856,5896,9614,4630,2856,4630,7711,10444,5305,6656,7281,10233,5305,10233,238,5157,5305,5157,6943,3017,5305,3017,1323,6656,6172,3837,\n\t\t\t         1323,3017,6172,3017,6943,5232,6172,5232,8718,3001,6172,3001,7192,3837,6065,8431,7192,3001,6065,3001,8718,5279,6065,5279,5288,5280,6065,5280,8749,8431,3985,5540,8749,5280,3985,5280,5288,983,3985,983,7549,1878,3985,1878,4919,5540,9729,4791,7711,4630,9729,4630,9614,3369,9729,3369,238,10233,9729,10233,7281,4791,7925,6033,\n\t\t\t         5693,1515,7925,1515,238,5750,7925,5750,714,785,7925,785,2771,6033,1712,5750,238,3369,1712,3369,9614,116,1712,116,714,5750,5898,1515,5693,511,5898,511,6943,5157,5898,5157,238,1515,8920,7542,1834,1619,8920,1619,4337,6206,8920,6206,6897,7542,5240,3771,2728,9133,5240,9133,5200,4968,5240,4968,1834,3771,2715,6861,\n\t\t\t         4464,2378,2715,2378,4645,10777,2715,10777,10755,4820,2715,4820,5365,6861,5623,5993,9499,6546,5623,6546,5365,4820,5623,4820,10755,583,5623,583,1998,5993,1318,8000,4676,8984,3044,4956,8391,2334,2902,8947,9499,5993,2902,5993,1998,7986,2902,7986,6241,687,2902,687,9883,8947,3813,10777,4645,5949,3813,5949,10397,7235,3813,7235,\n\t\t\t         4832,7887,3813,7887,10755,10777,1333,6613,1998,583,1333,583,10755,7887,1333,7887,4832,427,1333,427,8895,6613,7696,6160,3306,2948,7696,2948,7820,112,7696,112,10397,5949,7696,5949,4645,6160,1866,6563,10004,2994,6731,8292,8895,1840,3117,3982,1299,3575,3117,3575,2834,7949,3117,7949,1556,3836,3117,3836,3699,3982,4086,7663,\n\t\t\t         4832,7235,4086,7235,10397,9050,4086,9050,567,445,4086,445,10514,7663,7438,10694,1736,3970,7438,3970,1568,5636,7438,5636,567,4974,7438,4974,4631,10694,9489,1726,10514,445,9489,445,567,5636,9489,5636,1568,335,9489,335,6849,1726,5564,1873,142,9122,5564,9122,8242,1093,5564,1093,1568,3970,5564,3970,1736,1873,6190,7717,\n\t\t\t         9804,5123,6190,5123,6849,335,6190,335,1568,1093,6190,1093,8242,7717,9007,2660,2328,8559,9007,8559,278,1638,9007,1638,8242,9122,9007,9122,142,2660,3033,10476,8720,5688,3033,5688,9804,7717,3033,7717,8242,1638,3033,1638,278,10476,22,2989,6417,10223,69,1024,819,6758,10223,6417,435,10713,10223,10713,1205,9169,3839,2994,\n\t\t\t         10004,1152,69,6758,6417,2989,6758,819,3906,1758,6758,1758,435,6417,3839,1152,819,1024,1152,10004,1859,10712,1152,10712,3906,819,1866,7284,1840,6563,22,10223,9169,257,6563,1840,8895,6006,6563,6006,1859,10004,915,427,4832,7663,915,7663,10514,1644,915,1644,1859,6006,915,6006,8895,427,6111,1726,6849,4987,6111,4987,\n\t\t\t         3906,10712,6111,10712,1859,1644,6111,1644,10514,1726,9327,5123,9804,4147,9327,4147,435,1758,9327,1758,3906,4987,9327,4987,6849,5123,4372,5688,8720,6441,4372,6441,1205,10713,4372,10713,435,4147,4372,4147,9804,5688,6113,5634,4203,8649,6113,8649,9894,8748,6113,8748,3527,5374,6113,5374,3568,5634,4040,1260,2728,3771,4040,3771,\n\t\t\t         1834,7542,4040,7542,6897,629,4040,629,5889,1260,3148,2569,7639,9619,3148,9619,695,2166,3148,2166,1652,9825,3148,9825,7936,2569,10702,9514,7639,2569,10702,2569,7936,5700,10702,5700,7231,6224,10702,6224,4169,9514,7739,186,7391,3254,8984,4676,2843,488,5031,761,10237,3030,5031,3030,10154,5524,5031,5524,7231,5700,5031,5700,\n\t\t\t         7936,761,2683,9825,1652,1146,2683,1146,8004,8182,2683,8182,10237,761,2683,761,7936,9825,2039,325,8004,1146,2039,1146,1652,9621,2039,9621,8781,325,7396,1874,2130,9780,10454,2182,7287,2164,7396,8382,4788,1874,903,374,8004,8480,903,8480,8349,537,903,537,8978,374,10695,3936,10237,8182,10695,8182,8004,374,10695,374,\n\t\t\t         8978,3936,2906,8480,8004,325,2906,325,8781,9487,2906,9487,7140,10562,2906,10562,8349,8480,9683,4241,5892,2164,9683,2164,7287,7177,9683,7177,8781,9621,9683,9621,1652,4241,2511,9589,5697,10400,2511,10400,9894,8649,2511,8649,4203,9589,1043,2508,5163,9301,1043,9301,9529,576,1043,576,937,1340,1043,1340,4891,2508,10399,9301,\n\t\t\t         5163,2922,10399,2922,1127,6225,10399,6225,9529,9301,10195,6154,6793,38,10195,38,3767,7180,10195,7180,4507,6154,6733,9451,9894,1675,6733,1675,9632,5320,6733,5320,4186,5156,6733,5156,5192,9451,7348,6154,4507,8655,7348,8655,5591,2653,7348,2653,6793,6154,3127,536,7394,2800,3127,2800,2563,1687,3127,1687,3767,536,8667,8384,\n\t\t\t         5640,9929,8667,9929,6244,602,8667,602,4507,3847,8667,3847,2563,8384,8957,8689,9632,1675,8957,1675,9894,10400,8957,10400,5697,8689,1645,6227,6793,2653,1645,2653,5591,8469,1645,8469,4203,6227,2157,7180,3767,1687,2157,1687,2563,3847,2157,3847,4507,7180,9109,4358,4337,2879,9109,2879,5640,8384,9109,8384,2563,2800,9109,2800,\n\t\t\t         7394,4358,9097,9589,4203,8469,9097,8469,5591,3968,9097,3968,5697,9589,1163,602,6244,9795,1163,9795,98,2282,1163,2282,5591,8655,1163,8655,4507,602,4756,2282,98,6844,4756,6844,5947,7488,4756,7488,5697,3968,4756,3968,5591,2282,5318,7488,5947,10444,5318,10444,7711,7270,5318,7270,9632,8689,5318,8689,5697,7488,6089,2516,\n\t\t\t         7281,6656,6089,6656,1323,4940,6089,4940,1127,3404,6089,3404,1526,2516,1701,4940,1323,3837,1701,3837,7192,4179,1701,4179,9529,6225,1701,6225,1127,4940,4682,4179,7192,8431,4682,8431,8749,7777,4682,7777,937,576,4682,576,9529,4179,9217,7777,8749,5540,9217,5540,4919,9118,9217,9118,4891,1340,9217,1340,937,7777,8271,7270,\n\t\t\t         7711,4791,8271,4791,7281,2516,8271,2516,1526,9756,8271,9756,9632,7270,6755,5244,5163,4288,6755,4288,8213,3513,6755,3513,4186,4503,6755,4503,1526,5244,8321,9756,1526,4503,8321,4503,4186,5320,8321,5320,9632,9756,10468,2922,5163,5244,10468,5244,1526,3404,10468,3404,1127,2922,2395,4358,7394,10670,2395,10670,6897,6206,2395,6206,\n\t\t\t         4337,4358,8702,9043,7879,5941,8702,5941,7394,536,8702,536,3767,9043,574,3803,4464,6861,574,6861,5365,4087,574,4087,6084,4911,574,4911,7578,3803,6458,6546,9499,3238,6458,3238,5627,2552,6458,2552,6084,4087,6458,4087,5365,6546,10273,331,5200,9133,10273,9133,2728,7809,10273,7809,9679,6642,10273,6642,4132,331,5727,3238,\n\t\t\t         9499,8947,5727,8947,9883,566,5727,566,4251,5796,5727,5796,5627,3238,7001,3187,7578,4911,7001,4911,6084,1209,7001,1209,10347,10769,7001,10769,7528,3187,4431,2552,5627,4661,4431,4661,30,5432,4431,5432,10347,1209,4431,1209,6084,2552,5491,6628,1263,1444,5491,1444,7578,3187,5491,3187,7528,6852,5491,6852,488,6628,6042,4661,\n\t\t\t         5627,5796,6042,5796,4251,10213,6042,10213,30,4661,2971,1674,7879,9043,2971,9043,3767,6182,2971,6182,251,8248,2971,8248,3685,1674,3941,10769,10347,3426,3941,3426,1133,7848,3941,7848,7428,10083,3941,10083,7528,10769,8440,7727,6774,9612,8440,9612,1318,9657,8440,9657,7428,2322,8440,2322,6830,7727,9413,7848,1133,9915,9413,9915,\n\t\t\t         3142,10604,9413,10604,6830,2322,9413,2322,7428,7848,10303,357,2684,5644,10303,5644,6774,7727,10303,7727,6830,5230,10303,5230,9675,357,6352,448,5917,4182,6352,4182,9675,5230,6352,5230,6830,10604,6352,10604,3142,448,9208,465,7739,3254,9208,3254,2684,357,9208,357,9675,2722,9208,2722,7845,465,6917,9659,749,10368,6917,10368,\n\t\t\t         7845,2722,6917,2722,9675,4182,6917,4182,5917,9659,9426,10396,10409,1185,10396,2833,5441,2223,10396,2223,5551,10409,1292,4030,5138,8403,9640,4343,2016,519,4030,10409,5551,4755,4030,4755,9846,5138,1292,1185,10409,4030,4343,5138,9846,3854,4343,3854,9447,2016,9640,8403,5138,4343,6322,3426,10347,5432,6322,5432,30,9181,6322,9181,\n\t\t\t         9447,10001,6322,10001,1133,3426,4613,286,3142,9915,4613,9915,1133,10001,4613,10001,9447,3854,4613,3854,9846,286,2119,1694,5917,448,2119,448,3142,286,2119,286,9846,4755,2119,4755,5551,1694,9958,4295,749,9659,9958,9659,5917,1694,9958,1694,5551,2223,9958,2223,5441,4295,6528,42,4838,9267,6528,9267,7739,465,6528,465,\n\t\t\t         7845,4608,6528,4608,8968,42,3166,654,4186,3513,3166,3513,8213,10487,3166,10487,2959,1447,3166,1447,5433,654,8447,4608,7845,10368,8447,10368,749,5228,8447,5228,243,1382,8447,1382,8968,4608,8308,5941,7879,46,8308,46,5889,629,8308,629,6897,10670,8308,10670,7394,5941,5542,8037,595,199,5542,199,6380,5537,5542,5537,\n\t\t\t         8917,6617,5542,6617,426,8037,2506,199,595,3044,2506,3044,2334,6410,2506,6410,7546,6947,2506,6947,6380,199,3065,7809,2728,1260,3065,1260,5889,2982,3065,2982,3441,5795,3065,5795,9679,7809,7980,2316,2480,7551,7980,7551,6380,6947,7980,6947,7546,2785,7980,2785,9492,2316,5884,3283,8917,5537,5884,5537,6380,7551,5884,7551,\n\t\t\t         2480,6094,5884,6094,5046,3283,7919,3283,5046,8368,7919,8368,6004,3920,7919,3920,8917,3283,3018,6149,2130,3021,3018,3021,6004,1982,3018,1982,4013,6096,3018,6096,4998,6149,4922,7226,5046,8092,4922,8092,10104,6348,4922,6348,3891,7226,7597,6094,2480,9143,7597,9143,10104,8092,7597,8092,5046,6094,8824,8368,5046,7226,8824,7226,\n\t\t\t         3891,440,8824,440,4013,1982,8824,1982,6004,8368,6464,519,2016,4277,6788,7299,30,10213,1525,8292,6241,7986,1525,7986,1998,6613,1525,6613,8895,8292,6464,4277,7299,4348,4277,2016,9447,9181,4277,9181,30,7299,9426,6043,2833,10396,5997,8652,1429,2038,5997,2038,4998,4115,5997,4115,672,8652,9640,519,1620,1535,9640,1535,\n\t\t\t         5735,8403,1292,8403,5735,3666,1292,3666,1622,1185,9426,1185,1622,6237,9426,6237,1919,6043,6464,4348,1405,8719,6464,8719,1620,519,4934,2833,6043,9642,277,549,84,3572,7327,6902,5521,3572,5521,1405,4348,4539,7327,4251,566,4539,566,9883,9750,4539,9750,6797,5607,4539,5607,6902,7327,3839,1024,2945,8638,3839,8638,9669,\n\t\t\t         2994,69,2989,9004,5384,69,5384,2945,1024,22,257,456,9185,22,9185,9004,2989,1866,2994,9669,3654,1866,3654,6167,7284,7299,6788,3572,4348,3917,7284,6167,8209,3917,8209,10113,3554,9569,9750,9883,687,9569,687,6241,3554,9569,3554,10113,10459,9569,10459,6797,9750,2210,876,211,7518,2210,7518,2945,5384,2210,5384,9004,\n\t\t\t         3227,2210,3227,1073,876,6658,82,8046,1090,6658,1090,9669,8638,6658,8638,2945,7518,6658,7518,211,82,9182,6237,1622,10181,9182,10181,8259,8296,9182,8296,1919,6237,8821,4552,732,326,8821,326,8046,3581,8821,3581,1620,8719,8821,8719,1405,4552,4080,10459,10113,8209,4080,8209,6167,1060,4080,1060,6797,10459,158,5521,6902,\n\t\t\t         5607,158,5607,6797,6771,158,6771,1405,5521,104,4213,732,3910,104,3910,6797,1060,104,1060,6167,4213,5819,3666,5735,10676,5819,10676,211,876,5819,876,1073,2027,5819,2027,1622,3666,3536,1535,1620,3581,3536,3581,8046,82,3536,82,211,10676,3536,10676,5735,1535,2439,4213,6167,3654,2439,3654,9669,1090,2439,1090,8046,\n\t\t\t         326,2439,326,732,4213,2145,4552,1405,6771,2145,6771,6797,3910,2145,3910,732,4552,2596,2241,1073,3227,2596,3227,9004,343,2596,343,6477,5047,2596,5047,6826,2241,2414,5203,6477,343,2414,343,9004,9185,2414,9185,456,5203,3455,10181,1622,2027,3455,2027,1073,2241,3455,2241,6826,5260,3455,5260,8259,10181,10006,6259,1919,\n\t\t\t         8296,10006,8296,8259,1738,10006,1738,760,653,10006,653,4024,6259,9674,6295,10237,3936,9674,3936,8978,7072,9674,7072,879,5342,9674,5342,2579,6295,4934,2745,5441,2833,3917,3554,6241,6731,6731,6241,8292,4934,84,7606,2745,2639,227,8720,6455,2639,6455,4817,9179,2639,9179,10154,4436,2639,4436,2371,555,2639,555,4638,227,\n\t\t\t         3898,1738,8259,5260,3898,5260,6826,2815,3898,2815,4199,7676,3898,7676,760,1738,9060,7271,6477,5203,9060,5203,456,10567,9060,10567,6624,193,9060,193,6640,7271,7327,3572,6788,4251,2557,9169,1205,8098,2557,8098,3016,10243,1840,7284,3917,6731,2296,3920,6004,3021,2296,3021,2130,1874,2296,1874,4788,9381,2296,9381,8917,3920,\n\t\t\t         6261,4334,3891,6348,6261,6348,10104,1602,6261,1602,7898,575,6261,575,4526,4334,8136,8098,1205,6441,8136,6441,8720,227,8136,227,4638,8042,8136,8042,3016,8098,5382,3663,2480,2316,5382,2316,9492,39,5382,39,1190,7142,5382,7142,276,3663,9642,6043,1919,6259,9642,6259,4024,277,7858,257,9169,2557,10243,3356,1195,5878,\n\t\t\t         7072,8978,537,5878,537,8349,4413,5878,4413,2736,7938,5878,7938,879,7072,8226,4436,10154,3030,8226,3030,10237,6295,8226,6295,2579,8545,8226,8545,2371,4436,7858,10567,456,257,10213,4251,6788,7858,1195,6624,10567,7572,2815,6826,5047,7572,5047,6477,7271,7572,7271,6640,6386,7572,6386,4199,2815,9283,6925,7140,9487,9283,9487,\n\t\t\t         8781,7177,9283,7177,7287,6023,9283,6023,1429,6925,6319,1546,4013,440,6319,440,3891,4334,6319,4334,4526,8374,6319,8374,8893,1546,1381,1602,10104,9143,1381,9143,2480,3663,1381,3663,276,3358,1381,3358,7898,1602,10640,4413,8349,10562,10640,10562,7140,1751,10640,1751,5056,2890,10640,2890,2736,4413,8399,39,9492,4807,8399,4807,\n\t\t\t         243,5228,8399,5228,749,2978,8399,2978,8962,8359,8399,8359,1190,39,3270,2978,749,4295,3270,4295,5441,2745,3270,2745,7606,214,3270,214,8962,2978,10388,6023,7287,3659,10388,3659,2130,6149,10388,6149,4998,6393,10388,6393,1429,6023,6056,1031,10232,2878,6056,2878,609,2825,6056,2825,8495,10422,6056,10422,3069,1031,7206,5224,\n\t\t\t         3069,10422,7206,10422,8495,7114,7206,7114,7038,8705,7206,8705,5359,5224,8049,8780,5359,8705,8049,8705,7038,5388,8049,5388,443,1979,8049,1979,9314,8780,8994,1453,9314,1979,8994,1979,443,9212,8994,9212,7709,3594,8994,3594,5757,1453,312,7315,5757,3594,312,3594,7709,6408,312,6408,10222,7630,312,7630,7998,7315,3827,1751,\n\t\t\t         7140,6925,3827,6925,1429,8652,7690,3645,672,4115,7690,4115,4998,6096,7690,6096,4013,1546,7690,1546,8893,3645,3314,2378,4464,4953,3314,4953,9522,3569,3314,3569,3306,6160,3314,6160,4645,2378,3429,4807,9492,2785,3429,2785,7546,2724,3429,2724,8968,1382,3429,1382,243,4807,5456,9623,6899,1947,6899,9623,9760,1747,9299,2982,\n\t\t\t         5889,46,9299,46,7879,1674,9299,1674,3685,3882,9299,3882,3441,2982,3703,9050,10397,112,3703,112,7820,5277,3703,5277,4631,4974,3703,4974,567,9050,4634,10081,2771,785,4634,785,714,5728,4634,5728,1739,10449,4634,10449,8219,10081,10549,8659,9619,7639,3254,7391,27,2684,2928,6081,9514,4169,9619,8659,7547,695,426,4773,\n\t\t\t         3360,8037,9514,6081,10549,7639,488,2843,2925,6628,8037,3360,5393,595,10126,5728,714,61,10126,61,3250,169,10126,169,8611,9965,10126,9965,1739,5728,10406,5492,5892,4241,10406,4241,1652,2166,10406,2166,695,7162,10406,7162,9601,5492,8574,4953,4464,3803,8574,3803,7578,1444,8574,1444,1263,7062,8574,7062,9522,4953,9648,10291,\n\t\t\t         5192,5156,9648,5156,4186,654,9648,654,5433,2361,9648,2361,7417,10291,6369,6852,7528,10083,6369,10083,7428,9657,6369,9657,1318,8984,6369,8984,488,6852,2328,7656,5550,9178,6628,2925,2871,1263,2684,27,7194,5644,9178,5550,2670,2084,7547,3686,7162,695,5644,7194,8704,6774,529,7949,2834,9788,529,9788,6020,3754,529,3754,\n\t\t\t         5961,6559,529,6559,1556,7949,5146,42,8968,2724,5146,2724,7546,6410,5146,6410,2334,8988,5146,8988,4838,42,10466,8409,6793,6227,10466,6227,4203,5634,10466,5634,3568,5513,10466,5513,6451,8409,678,9381,4788,2469,678,2469,5100,7964,678,7964,426,6617,678,6617,8917,9381,1466,5572,2682,2663,7227,2682,5572,2741,5830,970,\n\t\t\t         1854,6584,4083,3686,7645,1374,5456,1947,5108,5691,5108,7352,4531,5691,2925,2843,7159,3162,2843,4676,8227,7159,8333,9037,9300,2053,8333,514,4488,9037,5830,3986,4773,970,3360,4773,3986,3054,9760,7319,6051,1747,1466,2663,6051,7319,3484,2193,7125,3945,7227,2741,7125,2193,3079,1189,1949,7175,3484,3945,1949,1189,5550,7656,\n\t\t\t         562,2582,3079,7175,562,7656,2209,5556,2670,6100,5550,2582,6100,2670,7363,8982,7547,8659,3686,7547,8982,7645,10549,8939,7363,8659,6081,792,8939,10549,7352,2871,5413,4531,2925,3162,5413,2871,120,622,8000,5812,4676,8000,622,8227,7172,4445,8704,7194,8704,4445,120,5812,27,5553,7172,7194,9300,616,186,2053,186,616,\n\t\t\t         7652,7391,5393,10590,3152,4956,3152,1301,8391,4956,514,8391,1301,4488,4838,8333,2053,9267,7162,3686,4083,9601,4631,2682,7227,10694,9267,2053,186,7739,9522,5108,1947,3569,10694,7227,2193,1736,3846,1489,5163,2508,3846,2508,4891,5677,3846,5677,7737,7115,3846,7115,292,1489,86,6983,7549,8056,86,8056,5693,3908,86,3908,\n\t\t\t         7498,10270,86,10270,627,6983,8532,8748,9894,9451,8532,9451,5192,10291,8532,10291,7417,1187,8532,1187,3527,8748,8704,5812,9612,6774,3569,1947,6899,3306,1816,169,3250,9053,1816,9053,1299,3982,1816,3982,3699,7747,1816,7747,8611,169,142,1189,3079,2660,9612,5812,8000,1318,2193,3484,1873,1736,2660,3079,7656,2328,1854,970,\n\t\t\t         7964,5100,1873,3484,1189,142,7820,6051,2663,5277,7964,970,4773,426,2871,7352,7062,1263,5277,2663,2682,4631,8703,6182,3767,38,8703,38,6793,8409,8703,8409,6451,2154,8703,2154,251,6182,4112,3754,6020,1193,4112,1193,5200,331,4112,331,4132,2355,4112,2355,5961,3754,6899,1747,2948,3306,7062,7352,5108,9522,8391,514,\n\t\t\t         8988,2334,2948,1747,6051,7820,2670,5556,8804,2084,8988,514,8333,4838,6748,5677,4891,9118,6748,9118,4919,8783,6748,8783,2433,363,6748,363,7737,5677,8503,8783,4919,1878,8503,1878,7549,6983,8503,6983,627,2575,8503,2575,2433,8783,2468,10487,8213,4288,2468,4288,5163,1489,2468,1489,292,6317,2468,6317,2959,10487,8634,3908,\n\t\t\t         5693,6033,8634,6033,2771,10081,8634,10081,8219,3379,8634,3379,7498,3908,3350,10283,6655,5921,3350,5921,2084,8804,3350,8804,4169,6224,3350,6224,7231,10283,2209,5654,2928,5556,6081,2928,5654,792,8804,5556,2928,4169,7007,9178,2084,5921,7007,5921,6655,174,7007,174,278,8559,7007,8559,2328,9178,4815,10476,278,174,4815,174,\n\t\t\t         6655,9977,4815,9977,4817,6455,4815,6455,8720,10476,9979,9179,4817,9977,9979,9977,6655,10283,9979,10283,7231,5524,9979,5524,10154,9179,7652,5553,27,7391,3360,3054,10590,5393,5393,4956,3044,595,8141,2092,4003,9115,8141,10190,805,2092,8141,9115,1485,10190,2726,2200,6265,8199,2726,787,416,2200,2726,5485,400,787,2726,8199,\n\t\t\t         7797,5485,6638,8199,6265,10689,6638,9797,7797,8199,6638,10689,7295,9797,8588,5282,4453,7555,8588,706,6909,5282,8588,7555,4991,706,3961,5265,1485,6257,3961,4803,7003,5265,3961,2132,4382,4803,3961,6257,6297,2132,5420,5282,6909,4399,5420,10674,4453,5282,5420,4399,8822,10674,9085,2679,8560,3570,9085,8904,4991,2679,9085,3570,\n\t\t\t         1186,8904,10102,7199,9253,2797,10102,497,1186,7199,10102,9087,6909,497,10102,2797,8535,9087,5107,2079,6297,6257,5107,9115,4003,2079,5107,6257,1485,9115,4381,393,4453,10674,4381,5939,805,393,4381,10674,8822,5939,6139,706,4991,8904,6139,497,6909,706,6139,8904,1186,497,531,8885,6785,1865,531,3570,8560,8885,531,7199,\n\t\t\t         1186,3570,531,1865,9253,7199,6845,2092,805,5939,6845,3295,4003,2092,6845,5939,8822,3295,7018,9087,8535,9260,7018,4399,6909,9087,7018,3006,8822,4399,7018,9260,2452,3006,8660,3006,2452,8256,8660,3295,8822,3006,8660,75,4003,3295,8660,8256,5613,75,8610,75,5613,10413,8610,2079,4003,75,8610,2304,6297,2079,8610,10413,\n\t\t\t         4105,2304,9434,6252,8787,2882,9434,5969,6329,6252,9434,4292,7295,5969,9434,2882,2702,4292,3025,4292,2702,5426,3025,9797,7295,4292,3025,7703,7797,9797,3025,5426,10135,7703,10428,7703,10135,2938,10428,5485,7797,7703,10428,3274,400,5485,10428,2938,3903,3274,5476,3274,3903,8155,5476,787,400,3274,5476,6209,416,787,5476,8155,\n\t\t\t         1097,6209,9270,2304,4105,6106,9270,5655,6297,2304,9270,6252,6329,5655,9270,6106,8787,6252,7037,10690,6265,3130,7037,6752,6329,10690,7037,1767,4382,6752,7037,3130,4595,1767,2280,5655,6329,6752,2280,2132,6297,5655,2280,6752,4382,2132,4458,10689,6265,10690,4458,5969,7295,10689,4458,10690,6329,5969,10669,8885,8560,6506,10669,268,\n\t\t\t         6785,8885,10669,6506,9513,268,9789,1597,10215,10010,9789,2679,4991,1597,9789,10010,8560,2679,5586,9119,8678,6070,5586,9205,6177,9119,5586,3798,8178,9205,5586,6070,9467,3798,6420,1478,1573,4089,6420,3798,9467,1478,6420,3502,8178,3798,6420,4089,8139,3502,9163,3664,1626,6966,883,9332,4480,10335,1471,4089,1573,3297,1471,8817,\n\t\t\t         8139,4089,1471,1876,4776,8817,1471,3297,5355,1876,6384,307,6177,9205,6384,10323,2099,307,6384,5629,4793,10323,6384,9205,8178,5629,1219,3502,8139,4085,1219,5629,8178,3502,1219,5251,4793,5629,1219,4085,3616,5251,2276,1327,8110,3715,2276,7935,2298,1327,2276,307,2099,7935,2276,3715,6177,307,3786,7507,2165,8028,1476,3542,\n\t\t\t         3616,8785,5967,10190,1485,8262,5967,5252,805,10190,5967,460,7026,5252,5967,8262,2748,460,2926,10323,4793,674,2926,3469,2099,10323,2926,1086,10731,3469,2926,674,2610,1086,2666,2850,2484,659,2666,320,2594,2850,2666,8612,10731,320,2666,659,9959,8612,7628,1086,2610,6581,7628,320,10731,1086,7628,1657,2594,320,7628,6581,\n\t\t\t         7421,1657,6519,5601,3135,5709,6519,3809,10358,5601,6519,2850,2594,3809,6519,5709,2484,2850,4964,814,240,5412,4964,1657,7421,814,4964,3809,2594,1657,4964,5412,10358,3809,8767,7532,4221,6450,8767,8305,7990,7532,8767,5601,10358,8305,8767,6450,3135,5601,5930,5130,150,449,5930,5412,240,5130,5930,8305,10358,5412,5930,449,\n\t\t\t         7990,8305,717,4830,1367,8756,10547,8553,7599,9985,4830,2881,4127,1367,4830,377,8499,2881,5086,5653,2165,7507,10547,8756,1367,8553,8553,6583,5870,7599,8553,1367,4127,6583,5086,9985,7599,5653,5653,1664,1274,2165,5653,7599,5870,1664,3786,8028,3542,10012,717,9779,377,4830,8028,5715,3616,3542,8028,2165,1274,5715,2128,674,\n\t\t\t         4793,5251,2128,2467,2610,674,2128,5715,1274,2467,2128,5251,3616,5715,9003,7100,7421,6581,9003,1664,5870,7100,9003,2467,1274,1664,9003,6581,2610,2467,2676,4856,240,814,2676,6583,4127,4856,2676,7100,5870,6583,2676,814,7421,7100,6718,3949,150,5130,6718,2881,8499,3949,6718,4856,4127,2881,6718,5130,240,4856,1307,6619,\n\t\t\t         9229,1920,1307,9709,8502,6619,1307,9238,7921,9709,1307,1920,9737,9238,6292,10010,10215,5544,6292,6506,8560,10010,6292,7955,9513,6506,6292,5544,3419,7955,5730,9174,6768,6542,5730,979,8233,9174,5730,3197,10754,979,5730,6542,4286,3197,2827,6542,6768,4877,2827,6796,4286,6542,2827,3627,4170,6796,2827,4877,2264,3627,5679,1051,\n\t\t\t         2385,1057,3664,1791,9801,1626,4141,322,6180,8509,4141,8200,1391,322,4141,6796,4170,8200,4141,8509,4286,6796,162,1455,10754,3197,162,5760,8222,1455,162,8509,6180,5760,162,3197,4286,8509,144,1455,8222,7343,144,7,10754,1455,144,7343,111,7,4555,5904,1295,49,10185,9866,4933,2292,10185,3509,8799,9866,7685,2963,\n\t\t\t         8222,1498,7685,7475,1972,2963,7685,1498,7012,7475,4571,5760,6180,3661,4571,1498,8222,5760,4571,3661,7012,1498,9416,7343,8222,2963,9416,10157,111,7343,9416,3282,9485,10157,9416,2963,1972,3282,5180,9866,8799,2262,5180,8506,4933,9866,5180,7,111,8506,5180,2262,10754,7,10448,2523,9491,1973,10448,6619,8502,2523,10448,1973,\n\t\t\t         9229,6619,2688,10361,10577,5937,2688,7614,3976,10361,2688,8501,8066,7614,2688,5937,3451,8501,560,3339,10577,10361,560,4837,3082,3339,560,10361,3976,4837,7102,4721,1007,476,7102,1847,9345,4721,7102,476,2654,1847,3863,7128,8502,8867,3863,9845,9911,7128,3863,4884,680,9845,3863,8867,73,4884,1396,7681,2654,476,1396,5264,\n\t\t\t         4492,7681,1396,476,1007,5264,8375,2801,4668,5698,8375,3500,9741,2801,8375,5698,9345,3500,5670,2797,9253,4902,5670,6659,8535,2797,5670,8253,2654,6659,5670,4902,9741,8253,3618,7128,9911,5609,3618,2523,8502,7128,3618,5609,9491,2523,7862,5264,1007,3797,7862,6833,4492,5264,7862,3797,9229,6833,2525,3500,9345,1847,2525,8253,\n\t\t\t         9741,3500,2525,1847,2654,8253,8466,1865,6785,4633,8466,4902,9253,1865,8466,2801,9741,4902,8466,4633,4668,2801,2886,6833,9229,1973,2886,10097,4492,6833,2886,1973,9491,10097,3111,9260,8535,6659,3111,10665,2452,9260,3111,7681,4492,10665,3111,6659,2654,7681,8088,8256,2452,10665,8088,5934,5613,8256,8088,10097,9491,5934,8088,10665,\n\t\t\t         4492,10097,801,10413,5613,5934,801,2410,4105,10413,801,5609,9911,2410,801,5934,9491,5609,3120,2882,8787,540,3120,3904,2702,2882,3120,367,3082,3904,3120,540,7483,367,754,5426,2702,3904,754,3641,10135,5426,754,4837,3976,3641,754,3904,3082,4837,3053,2938,10135,3641,3053,7950,3903,2938,3053,7614,8066,7950,3053,3641,\n\t\t\t         3976,7614,9131,8155,3903,7950,9131,8996,1097,8155,9131,8501,3451,8996,9131,7950,8066,8501,8055,6106,4105,2410,8055,540,8787,6106,8055,5257,7483,540,8055,2410,9911,5257,5381,270,10577,506,5381,3448,2044,270,5381,10551,680,3448,5381,506,7483,10551,9495,10551,7483,5257,9495,9845,680,10551,9495,5257,9911,9845,47,506,\n\t\t\t         10577,3339,47,367,7483,506,47,3339,3082,367,10164,9282,4668,4633,10164,268,9513,9282,10164,4633,6785,268,5436,2943,4519,10606,5436,5698,4668,2943,5436,10606,9345,5698,3416,6070,8678,4553,3416,7049,9467,6070,3416,603,197,7049,3416,4553,2495,603,571,8476,1573,1478,571,647,9922,8476,571,7049,197,647,571,1478,\n\t\t\t         9467,7049,3783,1597,4991,9240,3783,9523,10215,1597,3783,6834,5271,9523,3783,9240,8528,6834,4527,3297,1573,8476,4527,644,5355,3297,4527,164,7943,644,4527,8476,9922,164,8340,603,2495,10005,8340,8130,197,603,8340,4359,181,8130,8340,10005,10295,4359,6548,3540,9922,647,6548,9519,7198,3540,6548,8130,181,9519,6548,647,\n\t\t\t         197,8130,6347,2975,6233,526,6347,10005,2495,2975,6347,8295,10295,10005,6347,526,1791,8295,7691,164,9922,3540,7691,8307,7943,164,7691,3540,7198,8307,4477,10606,4519,97,4477,8583,9345,10606,4477,5868,9700,8583,4477,97,4738,5868,1184,2261,181,4359,1184,5876,6166,2261,1184,4494,625,5876,1184,4359,10295,4494,10591,7908,\n\t\t\t         1279,10187,10591,8981,9163,7908,10591,1737,625,8981,10591,10187,298,1737,4687,6988,6166,5876,4687,8707,135,6988,4687,1737,298,8707,4687,5876,625,1737,8850,8606,7850,7592,8850,10187,1279,8606,8850,8581,298,10187,8850,7592,5704,8581,5713,9114,9402,4970,5713,8581,5704,9114,5713,8707,298,8581,5713,4970,135,8707,6229,1051,\n\t\t\t         5679,4766,6229,7592,7850,1051,6229,1538,5704,7592,6229,4766,780,1538,6791,997,6786,5850,6791,1538,780,997,6791,9114,5704,1538,6791,5850,9402,9114,8277,7467,9941,5333,5333,9062,7233,3593,5333,9941,1632,9062,293,3320,2021,1744,1508,5028,2863,3673,1744,4401,1632,9941,1744,2021,3273,4401,293,1744,9941,7467,3673,1871,\n\t\t\t         3273,2021,3673,2863,7506,1871,1508,3673,2021,3320,7329,9519,181,2261,7329,8762,7198,9519,7329,544,7506,8762,7329,2261,6166,544,1679,6988,135,4252,1679,544,6166,6988,1679,1871,7506,544,1679,4252,3273,1871,4784,4970,9402,7861,4784,4252,135,4970,4784,4401,3273,4252,4784,7861,1632,4401,100,5850,6786,6018,100,7861,\n\t\t\t         9402,5850,100,9062,1632,7861,100,6018,7233,9062,5147,10021,4592,1716,5147,4766,5679,10021,5147,8601,780,4766,5147,1716,3185,8601,1047,3448,680,7564,1047,7754,2044,3448,1047,3432,4612,7754,1047,7564,281,3432,3413,997,780,8601,3413,1363,6786,997,3413,1188,8094,1363,3413,8601,3185,1188,7471,2618,4519,2943,7471,7955,\n\t\t\t         3419,2618,7471,9282,9513,7955,7471,2943,4668,9282,6128,6398,2541,6034,6128,1397,8819,6398,6128,2921,1404,1397,6128,6034,3383,2921,3362,883,2541,6398,3362,6601,9332,883,3362,9946,9730,6601,3362,6398,8819,9946,8129,5544,10215,9523,8129,5405,3419,5544,8129,10546,4921,5405,8129,9523,5271,10546,632,137,3732,7098,632,9946,\n\t\t\t         8819,137,632,8252,9730,9946,632,7098,1179,8252,10683,1397,1404,5759,10683,137,8819,1397,10683,2380,3732,137,10683,5759,8730,2380,4070,5683,8730,5759,4070,676,8831,5683,4070,5759,1404,676,4833,6240,1295,9481,4833,4575,8831,6240,4833,5646,5764,4575,4833,9481,4278,5646,24,5074,8730,6969,24,5970,9369,5074,24,6969,\n\t\t\t         1612,5970,8826,649,3732,2380,8826,5074,9369,649,8826,2380,8730,5074,3072,6969,8730,5683,3072,5055,1612,6969,3072,4575,5764,5055,3072,5683,8831,4575,7557,5784,2863,5028,8868,8307,7198,5695,3068,8817,4776,8785,3068,4085,8139,8817,3068,8785,3616,4085,7557,7668,5695,5784,5784,8762,7506,2863,5784,5695,7198,8762,8277,5333,\n\t\t\t         3593,3707,3874,1611,10193,4709,3874,3276,4278,1611,3874,4709,2332,3276,1508,7401,1235,5028,1508,3320,2219,7401,293,5475,2219,3320,293,7467,9860,5475,8277,4175,9860,7467,8277,3707,2198,4175,7557,7375,13,7668,7557,5028,1235,7375,3748,404,1885,8832,8215,3707,3593,5033,1537,296,5619,5033,7668,13,1537,9881,644,7943,\n\t\t\t         5619,9881,8105,5355,644,9881,1015,4356,8105,9881,5619,296,1015,5086,2667,554,9985,5086,7507,5395,2667,10547,5434,7093,8756,10547,9985,554,5434,717,8765,4522,9779,717,8756,7093,8765,3786,9641,5395,7507,3786,10012,2757,9641,5695,7668,5033,8868,2733,8364,2757,10012,2733,4232,1663,8364,6812,1876,5355,8105,6812,4232,4776,\n\t\t\t         1876,6812,6589,1663,4232,6812,8105,4356,6589,6122,3843,3141,59,6122,5434,554,3843,6122,1770,7093,5434,6122,59,8421,1770,8187,2758,7178,6054,8187,2667,5395,2758,8187,3843,554,2667,8187,6054,3141,3843,9869,4340,9860,4175,9869,929,6865,4340,9869,4175,2198,929,8597,6280,2302,37,8597,5701,7178,6280,8597,7375,1235,\n\t\t\t         5701,8597,37,13,7375,2935,8364,1663,6589,2935,2883,2757,8364,2935,6589,4356,2883,1711,1015,296,1537,1711,6958,4356,1015,1711,1537,13,6958,6819,8881,2302,810,6819,2883,4356,8881,6819,810,2757,2883,10294,10696,2219,5475,10294,59,3141,10696,10294,10596,8421,59,10294,5475,9860,10596,5018,5701,1235,7401,5018,6054,7178,\n\t\t\t         5701,5018,10696,3141,6054,5018,7401,2219,10696,5385,9641,2757,810,5385,2758,5395,9641,5385,6280,7178,2758,5385,810,2302,6280,10040,6958,13,37,10040,8881,4356,6958,10040,37,2302,8881,6995,1770,8421,3989,6995,4293,7093,1770,6995,7419,3624,4293,6995,3989,9646,7419,3412,4293,3624,5484,3412,8765,7093,4293,3412,5484,4522,\n\t\t\t         8765,6022,10596,9860,4340,6022,3989,8421,10596,6022,10062,9646,3989,6022,4340,6865,10062,503,929,2198,8809,503,239,6865,929,503,7813,3414,239,503,8809,5966,7813,4517,3661,6180,6900,4517,1099,7012,3661,4517,20,8550,1099,4517,6900,3131,20,3748,3593,7233,7697,2733,1476,4776,4232,1476,8785,4776,3748,7697,5624,404,\n\t\t\t         8725,1820,150,2772,8725,262,3290,1820,8725,6216,1391,262,8725,1849,9818,6216,8725,2772,7195,1849,8833,10062,6865,239,8833,7139,9646,10062,8833,6863,4039,7139,8833,239,3414,6863,6721,5484,3624,5801,6721,8325,4522,5484,6721,2778,4787,8325,6721,5801,6612,2778,5619,7943,8868,5033,10285,3704,8499,377,10285,788,2250,3704,\n\t\t\t         3542,1476,2733,10012,1284,6240,8831,676,1284,49,1295,6240,1284,8882,2310,49,1284,676,1404,8882,9630,5970,1612,7155,9630,301,9369,5970,9630,10096,9809,301,9630,7155,10675,10096,5858,3949,8499,3704,5858,2772,150,3949,5858,5955,7195,2772,5858,3704,2250,5955,842,7098,3732,4707,842,3391,1179,7098,842,419,8510,3391,\n\t\t\t         842,4707,2855,419,8215,8809,2198,3707,8215,8832,5966,8809,4200,10434,2083,788,10285,377,9779,6274,7475,7012,1099,6274,696,1972,7475,6274,4938,1470,696,6274,1099,8550,4938,6175,322,1391,6216,6175,6900,6180,322,6175,8486,3131,6900,6175,6216,9818,8486,4200,9779,4522,8325,8307,8868,7943,4200,8325,4787,10434,9784,7419,\n\t\t\t         9646,7139,9784,5801,3624,7419,9784,6707,6612,5801,9784,7139,4039,6707,4900,10157,9485,9536,4900,8506,111,10157,4900,8484,4933,8506,4900,9536,10193,8484,2606,5055,5764,2720,2606,7155,1612,5055,2606,626,10675,7155,2606,2720,4155,626,7382,649,9369,301,7382,4707,3732,649,7382,3938,2855,4707,7382,301,9809,3938,3406,3282,\n\t\t\t         1972,696,3406,1693,9485,3282,3406,10507,6222,1693,3406,696,1470,10507,4658,10533,1179,3391,4658,1363,8094,10533,4658,5390,6786,1363,4658,2045,8909,5390,4658,3391,8510,2045,3633,6018,6786,5390,3633,7697,7233,6018,3633,9455,5624,7697,3633,5390,8909,9455,2337,6338,4933,8484,2337,9481,1295,6338,2337,7283,4278,9481,2337,8484,\n\t\t\t         10193,7283,4428,8265,2640,5612,4428,3651,8024,8265,4428,3733,10761,3651,4428,5612,6678,3733,521,3733,6678,5532,521,10763,10761,3733,521,7433,9992,10763,521,5532,6738,7433,1518,7433,6738,3762,1518,8045,9992,7433,1518,1257,3675,8045,1518,3762,10120,1257,5861,1257,10120,5136,5861,10168,3675,1257,5861,4321,8389,10168,5861,5136,\n\t\t\t         8134,4321,9058,4321,8134,10452,9058,6924,8389,4321,9058,8653,8040,6924,9058,10452,2436,8653,271,9536,9485,1693,271,4709,10193,9536,778,3276,2332,6376,778,5646,4278,3276,778,2720,5764,5646,778,6376,4155,2720,9556,4860,8678,9119,9556,4697,9406,4860,9556,3715,8110,4697,9556,9119,6177,3715,8379,8252,1179,10533,8379,9594,\n\t\t\t         9730,8252,8379,1188,3185,9594,8379,10533,8094,1188,2518,8419,3257,5081,3257,2168,5459,5081,8097,2618,3419,5405,8097,97,4519,2618,8097,2713,4738,97,8097,5405,4921,2713,9539,7935,2099,3469,9539,7166,2298,7935,9539,8612,9959,7166,9539,3469,10731,8612,3785,1767,4595,5287,3785,7667,4382,1767,3785,2173,4378,7667,3785,5287,\n\t\t\t         1609,2173,10639,6768,9174,3900,1051,7850,4618,2385,4451,2264,4877,10321,9174,8233,1997,3900,3383,6034,1517,9916,4877,6768,10639,10321,1791,526,9015,9801,6034,2541,2406,1517,4257,4803,4382,7667,4257,10119,7003,4803,4257,3690,3788,10119,4257,7667,4378,3690,3031,2262,8799,10451,3031,979,10754,2262,3031,9577,8233,979,3031,10451,\n\t\t\t         5519,9577,5672,4553,8678,4860,5672,2975,2495,4553,5672,1504,6233,2975,5672,4860,9406,1504,3345,4884,73,7916,3345,7564,680,4884,3345,6328,281,7564,3345,7916,4794,6328,2576,4494,10295,8295,2576,8981,625,4494,2576,3664,9163,8981,2576,8295,1791,3664,4221,7559,5571,9530,526,6233,315,9015,7850,8606,2974,4618,7559,2197,\n\t\t\t         3334,5571,1997,8233,9577,7244,8606,1279,3150,2974,9738,393,805,5252,9738,7079,4453,393,9738,8930,7197,7079,9738,5252,7026,8930,6615,9594,3185,1716,6615,6601,9730,9594,6615,4666,9332,6601,6615,1716,4592,4666,6495,3797,1007,2013,6495,1920,9229,3797,6495,10194,9737,1920,6495,2013,10531,10194,10390,5561,2310,8882,10390,6665,\n\t\t\t         1497,5561,10390,2921,3383,6665,10390,8882,1404,2921,3235,8206,9990,6276,3913,1761,6276,9990,5363,7238,9130,5773,10609,815,8106,7244,2518,7356,1223,8419,1223,7356,9285,91,9015,2865,6763,9801,9801,6763,3081,1626,4963,341,5300,9937,4963,9937,4304,5749,5363,5773,9916,10456,1517,8338,10456,9916,5459,2168,1457,8647,3235,8647,\n\t\t\t         1457,8206,1285,9297,8602,310,3913,310,8602,1761,5980,3514,5312,7136,1285,7136,5312,9297,5571,4393,1227,9530,5980,9530,1227,3514,10387,3122,3334,4566,5571,3334,3122,4393,6560,3900,1997,4110,7244,8106,4110,1997,10639,3900,6560,3321,10321,10639,3321,6290,91,9285,9029,315,9015,315,9029,2865,1814,9006,6966,4637,1626,3081,\n\t\t\t         4637,6966,1046,2974,3150,6174,3150,9006,1814,6174,4618,2974,1046,1509,5300,341,1057,2547,1057,2385,6483,2547,2406,10335,5494,9193,5494,10335,4480,1,5749,4304,1,4480,4592,10021,341,4963,9577,5519,10609,7244,9959,659,3913,9990,10021,5679,1057,341,9406,4697,8419,1223,659,2484,310,3913,10435,5937,10577,1273,10435,4004,\n\t\t\t         3451,5937,10435,5021,2997,4004,10435,1273,5538,5021,10054,2200,416,7611,10054,215,6265,2200,10054,6856,3348,215,10054,7611,9865,6856,7800,8867,8502,9709,7800,7916,73,8867,7800,9579,4794,7916,7800,9709,7921,9579,3150,1279,7908,9006,4697,8110,3257,8419,1129,5265,7003,10119,1129,8262,1485,5265,1129,7324,2748,8262,1129,10119,\n\t\t\t         3788,7324,3135,6450,5980,7136,7908,9163,6966,9006,310,2484,5709,1285,6450,4221,9530,5980,9130,1497,6665,5773,5709,3135,7136,1285,2298,7166,8206,1457,6665,3383,9916,5773,315,6233,1504,91,7166,9959,9990,8206,729,4721,9345,8583,729,2013,1007,4721,729,10610,10531,2013,729,8583,9700,10610,8254,7555,4453,7079,8254,9240,\n\t\t\t         4991,7555,8254,4945,8528,9240,8254,7079,7197,4945,3257,8110,1327,2168,1504,9406,1223,91,4480,9332,4666,5749,1327,2298,1457,2168,3334,2197,3423,4566,4666,4592,4963,5749,1529,8996,3451,4004,1529,10092,1097,8996,1529,3133,5694,10092,1529,4004,2997,3133,8591,6209,1097,10092,8591,7611,416,6209,8591,6163,9865,7611,8591,10092,\n\t\t\t         5694,6163,9765,270,2044,7754,9765,1273,10577,270,9765,3648,5538,1273,9765,7754,4612,3648,21,3130,6265,215,21,5287,4595,3130,21,441,1609,5287,21,215,3348,441,8991,9225,5149,5336,8991,3423,2197,9225,8991,3627,2264,3423,8991,5336,4170,3627,10387,4566,4451,8414,10321,6290,8414,4451,3423,2264,4451,4566,3086,9225,\n\t\t\t         2197,7559,3086,9939,5149,9225,3086,7532,7990,9939,3086,7559,4221,7532,8001,9939,7990,449,8001,7416,5149,9939,8001,1820,3290,7416,8001,449,150,1820,3115,7416,3290,262,3115,5336,5149,7416,3115,8200,4170,5336,3115,262,1391,8200,6483,2385,4618,1509,1517,2406,9193,8338,2406,2541,883,10335,2598,1923,178,295,3929,2743,\n\t\t\t         9171,7726,2590,4508,5038,4859,7563,9224,683,2644\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygon\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygon\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n\t\t\t           0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n\t\t\t           1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementSmoothing\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementTexture\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tModel: \"Model::root\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",1.000000\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-hips\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.037349402904510,2.029618740081787\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",102.333179465974780,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999940395355,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.357541\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-spine\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.357541233301163,0.000000003725290\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-6.267595452693081,0.000009041428847,-0.000000993007542\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,0.999999940395355,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.319526\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-chest\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000000000001,0.319526076316833,0.000000007450581\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-14.623918248860067,-0.000009095793635,-0.000000000000043\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.643036\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-neck\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000014842,0.625992655754089,0.042615927755833\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",24.902507713804699,0.000016966134310,0.000007876320321\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.257815\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-head\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000000000052,0.257815361022949,0.000000007450581\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-16.344188476237225,-0.000018705242475,0.000000000000864\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.455465\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-shoulder_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.036777932196856,0.505429148674011,0.197284713387489\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-70.740255573342083,-63.227375335419012,-17.357214813175379\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999940395355,0.999999880790710,1.000000119209290\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.336342\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-upper_arm_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.016936644911766,0.404676526784897,-0.041652347892523\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-82.795573609343109,44.357820036221582,-109.982485902379480\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999761581421,0.999999523162842,0.999999761581421\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.583867\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-forearm_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000166241080,0.583867132663727,-0.000000027008355\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",34.598032957610151,0.045159419868434,-4.341787757717610\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000119209290,0.999999880790710,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.504448\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-hand_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000074505806,0.504448294639587,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-30.401551071182009,94.642284007713926,-43.920158589680717\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999940395355,0.999999880790710,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.180353\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-palm_01_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.041293114423752,0.092578530311584,-0.014163933694363\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-1.770208194998282,17.076145698640588,14.684385913582103\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,0.999999701976776,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.162043\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_index_01_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000089406967,0.162042945623398,0.000000208616257\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",12.225176302922545,0.892304397544793,-1.057648816559431\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000119209290\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.073523\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_index_02_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000089406967,0.073522962629795,-0.000000208616257\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",3.352896534541895,2.828606944984238,0.612596678449802\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999880790710,0.999999940395355,1.000000119209290\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.049196\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_index_03_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000059604645,0.049195542931557,0.000000029802322\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-1.213033379021176,1.712886579440972,1.245459915549177\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999940395355,1.000000119209290,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.058859\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-thumb_01_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.024272873997688,0.001478835940361,0.018343985080719\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-28.717270818088888,-127.045124901936390,56.836538083776510\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000119209290,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.092907\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-thumb_02_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000149011612,0.092906951904297,-0.000000014901161\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",9.608557298877454,178.292881187925502,1.452446770633706\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,0.999999821186066,0.999999880790710\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.075248\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-thumb_03_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.075247794389725,-0.000000298023224\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",3.981853863931380,2.733130078454294,-0.148828554694108\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000119209290,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.046777\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-palm_02_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.010863214731216,0.094435125589371,-0.019265286624432\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-1.456200386469446,1.606856323591434,5.136035024690933\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.167144\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_middle_01_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000089406967,0.167143672704697,-0.000000007450581\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",5.892986043701454,2.616157112502470,-7.094038096979681\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999821186066,1.000000000000000,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.077500\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_middle_02_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000059604645,0.077500194311142,-0.000000193715096\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",8.147040250469395,-1.834917087029772,2.451975159668055\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999761581421,0.999999940395355,0.999999880790710\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.066029\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_middle_03_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000059604645,0.066028937697411,-0.000000059604645\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-0.008523326530933,4.523534395776334,-1.939202549711493\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999940395355,0.999999761581421,0.999999821186066\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.051631\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-palm_03_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.010406494140625,0.089742094278336,-0.015159860253334\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-1.175965302065336,7.837196402735028,-4.745787897594584\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999880790710,1.000000119209290,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.166175\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_ring_01_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000029802322,0.166174799203873,0.000000059604645\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-2.663208791590739,1.396186502440392,-5.798075015655562\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999821186066,0.999999880790710,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.067564\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_ring_02_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000059604645,0.067564159631729,0.000000104308128\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",21.230669732997406,1.403027470502679,2.558178838289488\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.057940\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_ring_03_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.057939529418945,-0.000000178813934\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-11.183568185628866,-0.207385247212211,-0.202320795344786\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000238418579,1.000000119209290\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.057383\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-palm_04_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.033531010150909,0.093020260334015,-0.010971110314131\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-1.562487841629918,7.477300928762880,-12.804890316273836\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999880790710,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.142671\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_pinky_01_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000089406967,0.142670959234238,0.000000029802322\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",7.824675812212766,-2.428720713421722,-7.134250835718074\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999940395355,0.999999940395355,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.049655\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_pinky_02_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000059604645,0.049654543399811,-0.000000052154064\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",5.981206474568504,3.722683616536088,4.868972066822879\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999821186066,1.000000000000000,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.036095\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_pinky_03_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000089406967,0.036095291376114,-0.000000089406967\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",3.743181868008914,6.517809187652383,0.917307105414382\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000119209290,0.999999880790710,0.999999880790710\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.047888\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-shoulder_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.036777932196856,0.505429148674011,0.197284713387489\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-70.740255573342083,63.227375335419012,17.357214813175379\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999940395355,0.999999880790710,1.000000119209290\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.336342\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-upper_arm_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.016936644911766,0.404676526784897,-0.041652347892523\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-82.795573609343109,-44.357820036221582,109.982485902379480\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999761581421,0.999999523162842,0.999999761581421\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.583867\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-forearm_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000166241080,0.583867132663727,-0.000000027008355\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",34.598032957610151,-0.045159419868434,4.341787757717610\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000119209290,0.999999880790710,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.504448\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-hand_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000074505806,0.504448294639587,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-30.401551071182009,-94.642284007713926,43.920158589680717\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999940395355,0.999999880790710,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.180353\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-palm_01_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.041293114423752,0.092578530311584,-0.014163933694363\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-1.770208194998282,-17.076145698640588,-14.684385913582103\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,0.999999701976776,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.162043\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_index_01_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000089406967,0.162042945623398,0.000000208616257\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",12.225176302922545,-0.892304397544793,1.057648816559431\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000119209290\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.073523\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_index_02_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000089406967,0.073522962629795,-0.000000208616257\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",3.352896534541895,-2.828606944984238,-0.612596678449802\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999880790710,0.999999940395355,1.000000119209290\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.049196\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_index_03_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000059604645,0.049195542931557,0.000000029802322\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-1.213033379021176,-1.712886579440972,-1.245459915549177\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999940395355,1.000000119209290,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.058859\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-thumb_01_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.024272873997688,0.001478835940361,0.018343985080719\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-28.717270818088888,127.045124901936390,-56.836538083776510\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000119209290,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.092907\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-thumb_02_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000149011612,0.092906951904297,-0.000000014901161\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",9.608557298877454,-178.292881187925502,-1.452446770633706\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,0.999999821186066,0.999999880790710\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.075248\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-thumb_03_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.075247794389725,-0.000000298023224\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",3.981853863931380,-2.733130078454294,0.148828554694108\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000119209290,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.046777\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-palm_02_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.010863214731216,0.094435125589371,-0.019265286624432\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-1.456200386469446,-1.606856323591434,-5.136035024690933\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.167144\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_middle_01_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000089406967,0.167143672704697,-0.000000007450581\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",5.892986043701454,-2.616157112502470,7.094038096979681\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999821186066,1.000000000000000,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.077500\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_middle_02_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000059604645,0.077500194311142,-0.000000193715096\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",8.147040250469395,1.834917087029772,-2.451975159668055\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999761581421,0.999999940395355,0.999999880790710\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.066029\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_middle_03_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000059604645,0.066028937697411,-0.000000059604645\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-0.008523326530933,-4.523534395776334,1.939202549711493\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999940395355,0.999999761581421,0.999999821186066\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.051631\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-palm_03_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.010406494140625,0.089742094278336,-0.015159860253334\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-1.175965302065336,-7.837196402735028,4.745787897594584\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999880790710,1.000000119209290,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.166175\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_ring_01_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000029802322,0.166174799203873,0.000000059604645\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-2.663208791590739,-1.396186502440392,5.798075015655562\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999821186066,0.999999880790710,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.067564\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_ring_02_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000059604645,0.067564159631729,0.000000104308128\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",21.230669732997406,-1.403027470502679,-2.558178838289488\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.057940\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_ring_03_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.057939529418945,-0.000000178813934\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-11.183568185628866,0.207385247212211,0.202320795344786\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000238418579,1.000000119209290\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.057383\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-palm_04_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.033531010150909,0.093020260334015,-0.010971110314131\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-1.562487841629918,-7.477300928762880,12.804890316273836\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999880790710,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.142671\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_pinky_01_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000089406967,0.142670959234238,0.000000029802322\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",7.824675812212766,2.428720713421722,7.134250835718074\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999940395355,0.999999940395355,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.049655\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_pinky_02_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000059604645,0.049654543399811,-0.000000052154064\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",5.981206474568504,-3.722683616536088,-4.868972066822879\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999821186066,1.000000000000000,0.999999940395355\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.036095\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-f_pinky_03_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000089406967,0.036095291376114,-0.000000089406967\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",3.743181868008914,-6.517809187652383,-0.917307105414382\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000119209290,0.999999880790710,0.999999880790710\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.047888\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::Phone\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.002104133367538,0.384920716285706,0.050483442842960\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-0.877479045064479,-89.995426277604949,0.877497507919579\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000119209290,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.180353\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-thigh_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.196952864527702,0.141250923275948,0.061738912016153\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",164.137300472716078,2.222520077143684,7.405334640573144\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000238418579,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",1.113023\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-shin_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000022002496,1.113023281097412,-0.000000002561137\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",7.364927241443406,0.909159009899686,2.663525968500321\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,0.999999880790710,1.000000119209290\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.839906\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-foot_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000034517143,0.839906513690948,0.000000009080395\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-58.798680677589104,-2.490586432489493,4.146532286141090\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999880790710,0.999999880790710,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.356173\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-toe_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000003463356,0.356172651052475,0.000000017927960\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-43.670074628315646,0.373415993516728,2.510612333692530\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000119209290,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.159733\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-heel_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000034517143,0.839906513690948,0.000000009080395\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-27.883839182734082,-177.378236895792071,1.185612517381142\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,0.999999880790710\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.232895\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-heel_02_L\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.073903091251850,0.212868750095367,0.054026253521442\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-4.707401380685520,121.735199237392706,-95.751643332705797\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999880790710,1.000000000000000,0.999999880790710\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.084036\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-thigh_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.196952864527702,0.141250923275948,0.061738912016153\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",164.137300472716078,-2.222520077143684,-7.405334640573144\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000238418579,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",1.113023\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-shin_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000022002496,1.113023281097412,-0.000000002561137\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",7.364927241443406,-0.909159009899686,-2.663525968500321\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,0.999999880790710,1.000000119209290\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.839906\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-foot_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000034517143,0.839906513690948,0.000000009080395\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-58.798680677589104,2.490586432489493,-4.146532286141090\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999880790710,0.999999880790710,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.356173\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-toe_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000003463356,0.356172651052475,0.000000017927960\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-43.670074628315646,-0.373415993516728,-2.510612333692530\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000119209290,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.159733\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-heel_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.000000034517143,0.839906513690948,0.000000009080395\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-27.883839182734082,177.378236895792071,-1.185612517381142\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,0.999999880790710\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.232895\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::ORG-heel_02_R\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-0.073903091251850,0.212868750095367,0.054026253521442\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-4.707401380685520,-121.735199237392706,95.751643332705797\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",0.999999880790710,1.000000000000000,0.999999880790710\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.084036\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tModel: \"Model::Camera\", \"Limb\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000014842,-0.104612059891224,3.764149427413940\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-0.000000000000007,-0.000472336773244,-180.000005008697713\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Size\", \"double\", \"\",1\n\t\t\tProperty: \"LimbLength\", \"double\", \"\",0.260424\n\t\t\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Skeleton\"\n\t}\n\tMaterial: \"Material::testSkin\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.7179,0.5471,0.4285\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.7179,0.5471,0.4285\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",0.3000,0.3000,0.3000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",123.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.7,0.5,0.4\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"Shininess\", \"double\", \"\",123.0\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tMaterial: \"Material::testSkin__joan_png\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.7179,0.5471,0.4285\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.7179,0.5471,0.4285\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",0.3000,0.3000,0.3000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",123.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.7,0.5,0.4\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"Shininess\", \"double\", \"\",123.0\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tVideo: \"Video::joan_png\", \"Clip\" {\n\t\tType: \"Clip\"\n\t\tProperties60:  {\n\t\t\tProperty: \"FrameRate\", \"double\", \"\",0\n\t\t\tProperty: \"LastFrame\", \"int\", \"\",0\n\t\t\tProperty: \"Width\", \"int\", \"\",0\n\t\t\tProperty: \"Height\", \"int\", \"\",0\n\t\t\tProperty: \"Path\", \"charptr\", \"\", \"joan.png\"\n\t\t\tProperty: \"StartFrame\", \"int\", \"\",0\n\t\t\tProperty: \"StopFrame\", \"int\", \"\",0\n\t\t\tProperty: \"PlaySpeed\", \"double\", \"\",1\n\t\t\tProperty: \"Offset\", \"KTime\", \"\",0\n\t\t\tProperty: \"InterlaceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"FreeRunning\", \"bool\", \"\",0\n\t\t\tProperty: \"Loop\", \"bool\", \"\",0\n\t\t\tProperty: \"AccessMode\", \"enum\", \"\",0\n\t\t}\n\t\tUseMipMap: 0\n\t\tFilename: \"joan.png\"\n\t\tRelativeFilename: \"joan.png\"\n\t}\n\tTexture: \"Texture::joan_png\", \"TextureVideoClip\" {\n\t\tType: \"TextureVideoClip\"\n\t\tVersion: 202\n\t\tTextureName: \"Texture::joan_png\"\n\t\tProperties60:  {\n\t\t\tProperty: \"Translation\", \"Vector\", \"A+\",0,0,0\n\t\t\tProperty: \"Rotation\", \"Vector\", \"A+\",0,0,0\n\t\t\tProperty: \"Scaling\", \"Vector\", \"A+\",1,1,1\n\t\t\tProperty: \"Texture alpha\", \"Number\", \"A+\",0\n\t\t\tProperty: \"TextureTypeUse\", \"enum\", \"\",0\n\t\t\tProperty: \"CurrentTextureBlendMode\", \"enum\", \"\",1\n\t\t\tProperty: \"UseMaterial\", \"bool\", \"\",0\n\t\t\tProperty: \"UseMipMap\", \"bool\", \"\",0\n\t\t\tProperty: \"CurrentMappingType\", \"enum\", \"\",0\n\t\t\tProperty: \"UVSwap\", \"bool\", \"\",0\n\t\t\tProperty: \"WrapModeU\", \"enum\", \"\",0\n\t\t\tProperty: \"WrapModeV\", \"enum\", \"\",0\n\t\t\tProperty: \"TextureRotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TextureScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"VideoProperty\", \"object\", \"\"\n\t\t}\n\t\tMedia: \"Video::joan_png\"\n\t\tFileName: \"joan.png\"\n\t\tRelativeFilename: \"joan.png\"\n\t\tModelUVTranslation: 0,0\n\t\tModelUVScaling: 1,1\n\t\tTexture_Alpha_Source: \"None\"\n\t\tCropping: 0,0,0,0\n\t}\n\tDeformer: \"Deformer::Skin testBody_000\", \"Skin\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Skin\"\n\t\tProperties60:  {\n\t\t}\n\t\tLink_DeformAcuracy: 50\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-hips\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3485,3486,3487,3488,3489,3490,3491,3492,3493,3494,3495,3496,3497,3498,3499,3500,3501,3503,3504,3505,3506,3507,3508\n\t\t,3509,3510,3511,3512,3513,3514,3515,3516,3517,3518,3519,3520,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531\n\t\t,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554\n\t\t,3555,3556,3557,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3575,3578,3579,3580\n\t\t,3583,3584,3585,3586,3587,3588,3589,3590,3591,3601,3605,3618,3619,3626,3627,3629,3630,3631,3632,3634,3635,3636,3637\n\t\t,3638,3639,3640,3641,3642,3643,3648,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667\n\t\t,3668,3669,3923,3924,3925,3926,3927,3928,3929,3930,3931,3932,3933,3934,3935,3936,3937,3938,3939,3940,3941,3942,3943\n\t\t,3944,3945,3946,3947,3948,3949,3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,3966\n\t\t,3967,3969,3973,3974,3981,3982,3985,3999,4000,4003,4004,4007,4008,4009,4012,4613,4614,4615,4616,4617,4618,4619,4620\n\t\t,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643\n\t\t,4644,4645,4646,4647,4648,4649,4650,4651,4652,4653,4654,4655,4656,4657,4784,4785,4786,4787,4788,4789,4790,4791,4792\n\t\t,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,4807,4808,4809,4810,4811,4812,4813,4814,4815\n\t\t,4816,4817,4818,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,4833,4834,4835,4836,4837,4838\n\t\t,4839,4840,4841,4842,4843,4844,4845,4846,4847,4848,4849,4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861\n\t\t,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4882,4883,4884\n\t\t,4885,4886,4887,4888,4889,4890,4901,4903,4923,4925,4926,4927,4929,4930,4931,4934,4935,4936,4937,4938,4939,4940,4942\n\t\t,4949,4952,4953,4954,4956,4957,4958,4962,4966,4970,4971,4973,4976,4977,4978,4979,4980,5000,5001,5003,5172,5204,5222\n\t\t,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245\n\t\t,5246,5247,5248,5249,5250,5251,5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5271,5272\n\t\t,5275,5281,5282,5286,5290,5291,5294,5295,5296,5298,5299,5300,5303,5304,5305,5307,5308,5309,5912,5913,5914,5915,5916\n\t\t,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939\n\t\t,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,6083,6084,6085,6086,6087,6088\n\t\t,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111\n\t\t,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132,6133,6134\n\t\t,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157\n\t\t,6158,6159,6160,6163,6164,6165,6166,6170,6171,6172,6173,6176,6177,6178,6179,6180,6181,6189,6190,6208,6212,6214,6215\n\t\t,6216,6217,6218,6219,6220,6221,6222,6223,6224,6225,6226,6227,6230,6231,6232,6365,6401,6402,6403,6404,6405,6406,6407\n\t\t,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428,6429,6430\n\t\t,6431,6432,6433,6451,6452,6455,6461,6464,6465,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888\n\t\t,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,6903,6904,6905,6906,6907,6992,6993,6994,6995\n\t\t,6996,6997,6998,6999,7000,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018\n\t\t,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041\n\t\t,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7062,7065,7066,7067\n\t\t,7068,7069,7070,7071,7072,7082,7098,7107,7108,7109,7110,7112,7113,7117,7118,7125,7128,7248,7292,7293,7294,7295,7296\n\t\t,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,7317,7318,7336\n\t\t,7337,7340,7343,7344,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7754,7755,7756,7757\n\t\t,7758,7759,7760,7761,7762,7763,7764,7765,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7862,7863,7870,7899,7900\n\t\t,7901,7902,7965,7966,7967,7968,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999\n\t\t,8000,8002,8006,8039,8040,8041,8042,8043,8044,8114,8115,8116,8117,8118,8119\n\t\tWeights: 1.00000000,0.99392909,1.00000000,1.00000000,1.00000000,0.98996788,1.00000000,0.60195172,0.34381905,0.56472069,0.74474783,0.70166444,0.56514312,0.31243444,0.73169201,0.81254148,0.30892517,0.14683336,0.39783548,0.32295525,0.06539726,0.00565946,0.32704496,0.62748045,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.43178655,0.49986510,0.50296044,0.28498961,0.30484918,0.38145553,0.45286816\n\t\t,0.36590929,0.29126531,1.00000000,1.00000000,1.00000000,0.99139595,1.00000000,1.00000000,0.97066015,0.88213682,0.88304055,0.86487513,0.89393044,0.94986385,0.87893325,0.85509753,0.87488151,0.79448259,0.86109298,0.90118033,0.91694748,0.83827299,0.78145921,0.85626864,0.94444919,1.00000000,0.98347467,1.00000000,1.00000000,0.99673343,0.99080771,0.99133706,1.00000000,1.00000000,0.70518964,0.71247743,0.94210648,0.71366721\n\t\t,0.60153431,0.65550458,0.93738717,0.94674135,0.60748298,0.12142334,0.07771186,0.14605879,0.11295767,0.05863915,0.13762363,0.18652749,0.10289961,0.10724764,0.20487508,0.06767262,0.21109592,0.07351334,0.22885738,0.30243399,0.15737542,0.13663109,0.14967705,0.32159047,0.17772550,0.00777030,0.00108498,0.00439191,0.00141919,0.23175048,0.08177454,0.66967773,0.71535170,0.25043321,0.00049293,0.71335185,0.59231891,0.60346550\n\t\t,0.62136447,0.44346833,0.56283662,0.57805574,0.76416010,0.14275056,0.36451268,0.00359082,0.00744468,0.43050994,0.50905003,0.00061385,0.36672211,0.52327049,0.55738974,0.28468317,0.03335220,0.49254513,0.07373070,0.08878308,0.02032937,0.01120147,0.06240848,0.11751820,0.04234677,0.01422641,0.62326551,0.73394750,0.66097288,0.49175956,0.59439444,0.75707757,0.70475682,0.49455881,0.48800826,0.51798220,0.54366038,0.46884574\n\t\t,0.49125469,0.82825678,0.85852927,0.47733914,0.45692902,0.72112155,0.58775325,0.52757387,0.42021001,0.43917010,0.72590018,0.72745860,0.43869796,0.37984120,0.69049310,0.44061605,0.41007984,0.26383526,0.64777928,0.59456326,0.57964253,0.28810507,0.31778320,0.64660251,0.64852376,0.64690959,0.46464705,0.61174971,0.64138110,0.64790560,0.45406760,0.34677599,0.64641284,0.39758859,0.39585614,0.39894342,0.39152624,0.39055031\n\t\t,0.39198870,0.00292840,0.00069118,0.00926283,0.00250513,0.00232407,0.03563351,0.02018954,0.03531697,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.97245252,0.98456389,0.95909440,0.95016825,0.97792482,0.99555224,0.96900499,0.94233322,0.95157576,0.73964005,0.79211223,0.73445780,0.67623865,0.71494688,0.80002385,0.77987713,0.70996737,0.65009325,0.50159188,0.54013093\n\t\t,0.51443856,0.45395587,0.44509706,0.50835174,0.54804812,0.58113695,0.36690085,0.52541804,0.47857367,0.57626091,0.55967225,0.50737622,0.39672344,0.57734717,0.57869667,0.55301804,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.64295685,0.65334064,0.72374953,0.48059532,0.44632733,0.47686208,0.76807106,0.73202307,0.31806415,0.45764829,0.49770714,0.60117310,0.40038967,0.27413297,0.32275617\n\t\t,0.69211030,0.50901991,0.19946958,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.43424506,0.44572545,0.37790035,0.35670233,0.40379331,0.46645338,0.40583864,0.24462259,0.38747696,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.96507233,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.95172662,0.95307839\n\t\t,0.97670585,1.00000000,0.95735431,0.91360879,1.00000000,1.00000000,1.00000000,0.97211534,1.00000000,1.00000000,1.00000000,0.98253477,0.96751231,0.72799748,0.69226622,0.71096134,0.90611106,0.74060160,0.69726335,0.68638737,0.84612047,0.94717371,0.17435796,0.14927006,0.18722218,0.16984310,0.13648192,0.47402728,0.19484723,0.20045218,0.25309473,0.02951776,0.16307111,0.22063932,0.29899099,0.09110182,0.12913029,0.19759886\n\t\t,0.53703398,0.47547865,0.56789421,0.35163303,0.45422711,0.51566760,0.44254429,0.37369647,0.31259656,0.00031877,0.00207430,0.00060153,0.26752879,0.66429174,0.59103912,0.15615827,0.45934057,0.68450004,0.42448971,0.38177361,0.34278421,0.51784696,0.68215876,0.57864481,0.34384237,0.71315902,0.00007385,0.36615748,0.41135932,0.32774614,0.37265442,0.43502808,0.45545639,0.06817704,0.01685367,0.00228188,0.01716965,0.00013351\n\t\t,0.02009066,0.04123681,0.00125465,0.00471588,0.00611956,0.01544619,0.02174991,0.00208992,0.01086548,0.01459438,0.58410513,0.55296606,0.50206727,0.61122650,0.78694058,0.81608123,0.50681914,0.49846436,0.77595498,0.56283212,0.79698604,0.61219769,0.47548546,0.52579028,0.82353568,0.84323275,0.46356427,0.48716826,0.72861152,0.79906483,0.71783346,0.54241014,0.67349077,0.82164670,0.80016381,0.62618923,0.51929217,0.69972443\n\t\t,0.74744022,0.70365298,0.51423620,0.69556712,0.75768275,0.69137412,0.57285649,0.50114948,0.51735622,0.56905421,0.50037138,0.34588283,0.66081347,0.67718124,0.52235467,0.35506451,0.46033063,0.39959329,0.39713502,0.40023373,0.39170772,0.39053106,0.39704942,0.39618296,0.40136031,0.01141700,0.03591240,0.01856612,0.00419362,0.02692386,0.04468330,0.01782915,0.05402234,0.00950574,0.01941829,0.05511287,0.05235750,1.00000000\n\t\t,0.99669129,0.96299213,1.00000000,1.00000000,0.99892092,0.96985835,1.00000000,1.00000000,1.00000000,1.00000000,0.93091923,1.00000000,1.00000000,1.00000000,0.95281202,0.94092423,1.00000000,0.73694813,0.75275744,0.69063550,0.73166204,0.80234015,0.82270562,0.67990918,0.71319891,0.79554063,0.51868532,0.61656207,0.60866309,0.69664162,0.67268986,0.64535865,0.52481097,0.65531242,0.67618287,0.59252209,0.49833501,0.53722525\n\t\t,0.61908665,0.60353882,0.51598523,0.56433267,0.50220544,0.63269342,0.32130897,0.48135548,0.48087558,0.46058609,0.37452330,0.31133186,0.80433192,0.70626326,0.63426388,0.99793446,0.98314148,0.97724265,1.00000000,1.00000000,1.00000000,0.54186469,0.41627997,0.39769159,0.17504551,0.17515899,0.50309467,0.68261720,0.72031230,0.94057494,1.00000000,1.00000000,1.00000000,0.05348733,0.00319021,0.10275234,0.70667547,0.42379989\n\t\t,0.17084837,0.94769746,0.93257034,0.85176229,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.81271357,0.80889499,0.83576607,0.16530810,0.32234359,0.42844505,0.24013954,0.28064383,0.28197533,0.99063933,0.99640834,1.00000000,0.16815369,0.26792789,0.34203706,1.00000000,0.93086565,0.88768685,0.09117800,0.03438318,0.00170618,0.96659940,0.91228217,0.92773861,0.98804557,1.00000000,1.00000000,0.98241407\n\t\t,1.00000000,0.97841126,0.89346969,0.71096939,0.58009846,0.52307796,0.51944173,0.55962958,0.08760617,0.20527370,0.09327186,0.02874018,0.25423216,0.18345850,0.17900704,0.01206249,0.80497985,0.78478980,0.58444102,0.83714503,0.75034683,0.71142948,0.03309691,0.03423280,0.01667082,0.00019139,0.00290698,0.00986075,0.05853081,0.13026297,0.75964826,0.67526639,0.02551490,0.54653622,0.54042250,0.28475223,0.09987406,0.26754046\n\t\t,0.47837757,0.00170344,0.00015700,0.00237423,0.00492108,0.00116533,0.05900949,0.06105400,0.07512196,0.11966780,0.12645682,0.12725414,0.42343919,0.40842097,0.39054419,0.43568386,0.43087624,0.42988385,0.44345783,0.44550945,0.44619504,0.98173940,0.98885435,1.00000000,0.73123044,0.65192540,0.49532666,0.67622460,0.47876187,0.44737195,0.59982103,0.38460386,0.23177725,0.64844013,0.64842813,0.43887102,0.58813382,0.54328570\n\t\t,0.36138048,0.39095717,0.40011909,0.39215340,0.01974102,0.04433498,0.00336412,0.81916141,0.56663053,0.48384698,1.00000000,1.00000000,1.00000000,0.83314664,0.84263068,0.84062135,0.65829660,0.63736832,0.59331588,0.47258382,0.35282659,0.31577349,0.56514089,0.56594718,0.54453814,0.94262111,0.89235866,0.95678967,0.93605417,0.92938239,0.90073181,0.75385785,0.73323428,0.68101974,0.56323004,0.51553649,0.63843047,0.64854986\n\t\t,0.64402086,0.64497186,0.44352217,0.48289287,0.56220780,0.40955829,0.57555859,0.45154137,0.84007377,0.67668278,0.66983163,1.00000000,1.00000000,0.96375054,0.97021318,1.00000000,1.00000000,0.17840931,0.24169012,0.21707775,0.75298107,0.50114286,0.33625539,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.81492281,0.83403255,0.90802735,0.32771062,0.38983893,0.40659235\n\t\t,0.49461672,0.38249129,0.42538319,1.00000000,1.00000000,1.00000000,0.21922302,0.31871212,0.37650961,1.00000000,1.00000000,1.00000000,0.42007464,0.15417135,0.07182437,1.00000000,1.00000000,1.00000000,0.96795893,0.95648015,0.91513860,0.83258629,0.69199762,0.67345261,0.61347740,0.68105991,0.66384743,0.10619714,0.16185951,0.19634198,0.43481600,0.09847971,0.05249691,0.01156398,0.08506906,0.17223561,0.83909237,0.84858817\n\t\t,0.59186858,0.91348499,0.80736698,0.83640635,0.00209492,0.00128889,0.03823417,0.22454058,0.73756659,0.51620418,0.51099638,0.37584433,0.37704328,0.00009462,0.02119118,0.01027143,0.00436036,0.09455001,0.10203537,0.09470989,0.12439866,0.16541913,0.16040204,0.42440211,0.42356863,0.42744666,0.44134354,0.44306124,0.43558757,0.44498341,0.44694733,0.44717366,0.97607506,1.00000000,1.00000000,0.83709979,0.62058855,0.49154067\n\t\t,0.79992133,0.70097590,0.48854749,0.69008869,0.69972968,0.59223347,0.39368958,0.39355559,0.01832945,0.05165317,0.02333586,0.80046249,0.53745646,0.49747883,0.86118406,0.84256785,0.86777962,0.71556169,0.66095353,0.62239308,0.63836415,0.62930948,0.60766715,1.00000000,1.00000000,0.92093623,0.94354642,0.94731182,0.91129970,0.82082517,0.77758961,0.77598621,0.75977205,0.76582420,0.67642248,0.63725578,0.62730618,0.51132190\n\t\t,0.30745796,0.56925725,0.85007017,1.00000000,0.07185764,0.04837776,0.79578359,1.00000000,0.87085140,0.55974257,0.22738962,0.02830893,0.00318533,0.04515606,0.10284385,0.42963606,0.43996958,0.95554215,0.81358069,0.66239422,0.60959059,1.00000000,0.53544844,0.46964738,0.47437358,0.95208245,0.99950492,0.37908990,0.17842923,0.55644774,0.96570248,1.00000000,0.14966299,0.20954889,0.82584846,1.00000000,0.83258533,0.63857645\n\t\t,0.01160036,0.49279930,0.01571429,0.44687467,0.08130344,0.09591272,0.04971741,0.43053407,0.44222826,0.92690563,1.00000000,0.86254514,0.76487023,0.66456801,0.61743491\n\t\tTransform: 1.000000119209290,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-0.213596269488335,-0.976922035217285,0.000000000000000,0.000000000000000,0.976922035217285,-0.213596269488335,0.000000000000000,0.000000000000000,-1.974801540374756,0.470006465911865,1.000000000000000\n\t\tTransformLink: 0.999999940395355,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.976922035217285,0.213596269488335,0.000000000000000,0.000000000000000,-0.213596269488335,0.976922035217285,0.000000000000000,0.000000000000000,2.029618740081787,-0.037349402904510,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-spine\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3486,3490,3492,3493,3494,3495,3496,3497,3498,3499,3500,3517,3518,3519,3520,3521,3522,3523,3524,3525,3529,3532,3533\n\t\t,3534,3535,3536,3537,3538,3539,3575,3578,3579,3583,3584,3585,3586,3587,3588,3589,3590,3591,3923,3924,3925,3926,3927\n\t\t,3928,3929,3930,3931,3932,3933,3934,3935,3936,3937,3938,3939,3940,3941,3942,3943,3944,3945,3946,3947,3948,3949,3950\n\t\t,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,3966,3967,3968,3969,3970,3971,3972,3973\n\t\t,3974,3975,3976,3977,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,3992,3993,3994,3995,3996\n\t\t,3997,3998,3999,4000,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019\n\t\t,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,4041,4042\n\t\t,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4061,4063,4067,4069,4070,4073\n\t\t,4074,4076,4077,4078,4079,4080,4081,4082,4129,4130,4133,4189,4190,4191,4192,4193,4194,4195,4196,4197,4204,4236,4237\n\t\t,4238,4239,4240,4241,4242,4243,4285,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637\n\t\t,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,4650,4651,4652,4653,4654,4655,4656,4657,4791,4792,4793\n\t\t,4794,4795,4796,4797,4798,4799,4816,4817,4818,4819,4820,4821,4822,4823,4824,4834,4874,4877,4878,4879,4882,4883,4884\n\t\t,4885,4886,4887,4888,4889,4890,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238\n\t\t,5239,5240,5241,5242,5243,5244,5245,5246,5247,5248,5249,5250,5251,5252,5253,5254,5255,5256,5257,5258,5259,5260,5261\n\t\t,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,5284\n\t\t,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,5301,5302,5303,5304,5305,5306,5307\n\t\t,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330\n\t\t,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353\n\t\t,5354,5355,5356,5358,5359,5364,5367,5368,5369,5370,5371,5372,5374,5375,5376,5377,5378,5379,5380,5381,5425,5429,5430\n\t\t,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5534,5536,5537,5538,5539,5540,5541,5542,5584,5913,5914,5917,5918\n\t\t,5923,5927,5928,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949\n\t\t,5950,5951,5952,5953,5954,5955,5956,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6098,6099,6100,6110\n\t\t,6111,6112,6116,6125,6126,6127,6128,6129,6130,6131,6132,6133,6137,6138,6139,6141,6142,6170,6171,6401,6402,6403,6404\n\t\t,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428\n\t\t,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451\n\t\t,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474\n\t\t,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6494,6495,6496,6497,6498,6499\n\t\t,6503,6506,6512,6513,6516,6517,6575,6576,6577,6596,6597,6598,6599,6600,6601,6602,6611,6612,6627,6628,6632,6633,6634\n\t\t,6664,6875,6876,6877,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899\n\t\t,6900,6901,6902,6903,6904,6905,6906,6907,6992,6993,6994,6995,6996,6997,6998,6999,7000,7003,7004,7008,7009,7022,7023\n\t\t,7024,7025,7026,7027,7028,7029,7030,7034,7035,7036,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304\n\t\t,7305,7306,7307,7310,7311,7312,7313,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329\n\t\t,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352\n\t\t,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7370,7371,7372,7373,7374,7375,7379,7382\n\t\t,7388,7392,7393,7427,7448,7449,7450,7469,7470,7471,7472,7478,7479,7493,7494,7495,7739,7740,7741,7742,7743,7744,7745\n\t\t,7746,7747,7748,7749,7750,7753,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764,7765,7850,7851,7852,7854,7899\n\t\t,7900,7901,7902,7903,7904,7905,7906,7907,7908,7919,7965,7966,7967,7968,7984,7985,7986,7987,7988,7989,7994,8039,8040\n\t\t,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8065,8066,8070,8114,8116,8117,8118,8119\n\t\tWeights: 0.00071199,0.00087699,0.00932580,0.00791075,0.00600644,0.00696092,0.01777814,0.01292374,0.00637179,0.00603743,0.01119613,0.00339012,0.01577503,0.00496448,0.00162597,0.00224884,0.01281347,0.01344588,0.00264161,0.00223789,0.00007873,0.00197516,0.00617760,0.00667280,0.00608179,0.00352192,0.00142292,0.00722775,0.00234823,0.00027864,0.00035441,0.00122120,0.00220780,0.00038670,0.00286187,0.00389969,0.00083791,0.00049608\n\t\t,0.00200234,0.00402137,0.00189495,0.30305383,0.21022819,0.28590226,0.39100381,0.31247088,0.17938097,0.24436446,0.40224269,0.37790313,0.31194327,0.31379260,0.35092219,0.30816894,0.09491073,0.08675368,0.35879772,0.34524559,0.13953172,0.21051191,0.25642901,0.34736193,0.27364240,0.10449640,0.11499978,0.33791378,0.37100180,0.06241512,0.21645853,0.24318055,0.39607676,0.14268771,0.09635422,0.09181690,0.38735831,0.38349473\n\t\t,0.07919268,0.19658120,0.15200062,0.35708931,0.23348465,0.08821886,0.07953583,0.33775993,0.45410309,0.11085849,0.20673468,0.21105216,0.22282937,0.12124413,0.19245906,0.20855023,0.21362377,0.13482208,0.10467746,0.19500682,0.18446539,0.10850260,0.20740158,0.20717923,0.19960578,0.09797434,0.12042145,0.21717480,0.35114252,0.28712210,0.22047264,0.43027365,0.46644633,0.40578586,0.16605580,0.29086413,0.52135044,0.59510505\n\t\t,0.52189694,0.49372092,0.58868770,0.61621590,0.58591482,0.41405115,0.53643528,0.63676175,0.64132592,0.63079955,0.50340900,0.64459173,0.68707509,0.66764950,0.56024699,0.49116492,0.69063281,0.23010901,0.28214074,0.21018909,0.19801568,0.25104954,0.27720212,0.16728373,0.21798563,0.27112258,0.19491491,0.21041610,0.27574826,0.23395416,0.16734464,0.11745851,0.09846947,0.11419782,0.13775673,0.11567118,0.08043253,0.15506694\n\t\t,0.11335099,0.13336044,0.11062346,0.09757460,0.11466059,0.14633008,0.07898653,0.10764207,0.12940863,0.07802825,0.09965900,0.15617472,0.09968430,0.06871949,0.05308138,0.05106110,0.05186120,0.05716121,0.05578707,0.04161453,0.07241687,0.02316782,0.00105443,0.03078934,0.04009889,0.01042883,0.06023238,0.00088307,0.00541312,0.00113623,0.02032896,0.01174133,0.04672443,0.04389893,0.02437760,0.06187669,0.04267893,0.00382076\n\t\t,0.04222053,0.07008902,0.02074883,0.00870093,0.02960877,0.04483715,0.06185037,0.06348298,0.03420397,0.02635724,0.03140124,0.07531012,0.05803069,0.02492438,0.00403688,0.00872670,0.02515210,0.03086485,0.03581920,0.01597867,0.02178673,0.04959497,0.01243538,0.00499516,0.00575822,0.00406534,0.01152463,0.00868820,0.00409583,0.00101816,0.00968314,0.01444137,0.00717276,0.03294985,0.02837770,0.04387246,0.01673127,0.02615775\n\t\t,0.02005850,0.04198793,0.04421565,0.01021723,0.01583213,0.01596257,0.02477889,0.01345665,0.00942608,0.01165045,0.02489899,0.01940586,0.00623628,0.02161273,0.01552455,0.02959372,0.03288471,0.01556160,0.00985420,0.02857360,0.03706474,0.03100084,0.01039868,0.01227036,0.00842567,0.00345632,0.00485790,0.00733546,0.00988760,0.00389003,0.00264615,0.01907901,0.02030638,0.00536317,0.01362892,0.02910564,0.03155753,0.00487989\n\t\t,0.00397979,0.02518916,0.00154376,0.00532598,0.00245193,0.01088565,0.00025935,0.00172767,0.00234723,0.00238513,0.00124395,0.00054579,0.00091464,0.00340316,0.00155931,0.00051932,0.33033809,0.34414554,0.38287410,0.32128221,0.16695413,0.13553038,0.36995203,0.39681448,0.18320227,0.29272160,0.11323032,0.23978266,0.35428753,0.33443028,0.10950892,0.07378800,0.34957184,0.35975514,0.12752308,0.05412592,0.12077731,0.26665557\n\t\t,0.16774903,0.05656293,0.04816156,0.21293548,0.28963971,0.08310125,0.03436907,0.09595076,0.26286637,0.09124771,0.03030381,0.04623975,0.23438609,0.26708612,0.24621652,0.16563364,0.28722095,0.43601482,0.14401928,0.09250984,0.22292251,0.44134468,0.34359625,0.21485034,0.20377718,0.13117671,0.22697605,0.21426077,0.21109861,0.11669879,0.14037235,0.21532536,0.20613479,0.33431801,0.23149361,0.11235329,0.18596992,0.20280619\n\t\t,0.22276121,0.12850893,0.10961562,0.34674355,0.29329267,0.36840788,0.21878445,0.30879266,0.28239909,0.30772127,0.25138439,0.17586825,0.52118864,0.57747010,0.55556732,0.40233386,0.45476424,0.55665377,0.58894282,0.44381754,0.35935302,0.61766322,0.65211725,0.63078546,0.48640300,0.58736406,0.62916638,0.67253744,0.48743138,0.48091121,0.20985972,0.18414367,0.19627362,0.25689227,0.23279559,0.15453766,0.25943451,0.19332877\n\t\t,0.18621790,0.16909081,0.23256391,0.24575958,0.15596896,0.20057753,0.11354916,0.13296716,0.11415032,0.09420299,0.11025321,0.15174175,0.08073227,0.10516114,0.09078188,0.10425988,0.12416234,0.10587543,0.08014789,0.14257145,0.10747162,0.10492121,0.07646473,0.11825102,0.13274473,0.06718931,0.10222759,0.04423227,0.06043789,0.05098119,0.02484263,0.03850785,0.06886285,0.01929577,0.01799346,0.03365504,0.02472517,0.00786801\n\t\t,0.05536339,0.00333713,0.01043552,0.01432251,0.00785967,0.00377600,0.03107744,0.02720431,0.03998808,0.03661646,0.03531017,0.05647244,0.01740613,0.00132074,0.06450149,0.03506866,0.03802163,0.02587531,0.04428530,0.00357081,0.05955311,0.04585420,0.05646059,0.06715263,0.06702694,0.05411178,0.03960973,0.06200614,0.07436445,0.00160064,0.02998306,0.01078023,0.03584841,0.04240047,0.01467802,0.01388908,0.04596631,0.00136380\n\t\t,0.00140234,0.02356073,0.00041220,0.01623667,0.01179254,0.00629538,0.01294680,0.02275213,0.01804632,0.02412620,0.02905878,0.02144854,0.01549853,0.02160587,0.02826177,0.02640408,0.01018895,0.00553239,0.01097327,0.01041887,0.00561418,0.00446309,0.00882251,0.01379912,0.00998020,0.04312279,0.02729117,0.08016460,0.05623267,0.02348023,0.01117307,0.06167156,0.11782906,0.03283738,0.00473884,0.01138329,0.02234158,0.00855070\n\t\t,0.00717871,0.00462124,0.01760262,0.02363781,0.01208630,0.00041007,0.00278974,0.00306287,0.02589434,0.03074163,0.02677127,0.00004020,0.00000305,0.00016861,0.00010525,0.00335552,0.00708873,0.00979744,0.00270845,0.00743092,0.01027821,0.00103678,0.00141282,0.00154940,0.00124400,0.00381703,0.00968279,0.00430068,0.00720202,0.01111306,0.00292385,0.65305002,0.67130192,0.67244068,0.53546800,0.53772397,0.54374484,0.34330766\n\t\t,0.35326504,0.36721281,0.32855050,0.32237832,0.32714181,0.34832598,0.36230700,0.37069175,0.00759941,0.00376843,0.22446582,0.29480863,0.40515482,0.14867103,0.29933921,0.34060963,0.08861257,0.27931422,0.44686379,0.06433145,0.11843724,0.33730194,0.20718871,0.27628629,0.44955756,0.36228091,0.35528630,0.31685373,0.27027990,0.30108508,0.32820120,0.11616802,0.15548457,0.18747544,0.05356898,0.06488675,0.07405405,0.06291550\n\t\t,0.08245097,0.08808701,0.09514960,0.18233055,0.19853720,0.21597223,0.23212028,0.14286606,0.23536108,0.24126442,0.14036705,0.55696361,0.46640089,0.34947272,0.65348047,0.60645546,0.56414723,0.68597479,0.64904669,0.48577039,0.27301098,0.20640661,0.15834292,0.19712506,0.16498032,0.13745692,0.19456627,0.16119637,0.13650909,0.09306898,0.07886306,0.06596915,0.15916662,0.10394635,0.06946895,0.16079192,0.10548199,0.07006867\n\t\t,0.09390281,0.07743493,0.06070827,0.06835347,0.05551357,0.04619323,0.04554053,0.03761562,0.01999511,0.00675319,0.07380131,0.05130907,0.02572751,0.00360927,0.01151304,0.01956923,0.00080230,0.03800263,0.07039598,0.02389707,0.03251914,0.05551808,0.01185744,0.00779052,0.00660076,0.07786037,0.06875273,0.06053478,0.01187714,0.02643003,0.01078689,0.00111961,0.00412919,0.01745227,0.03700603,0.04764017,0.01372378,0.12262353\n\t\t,0.31631999,0.36801050,0.03675966,0.02359899,0.01877554,0.01857120,0.01441205,0.01355109,0.01756819,0.00912997,0.00547360,0.08695642,0.06685279,0.05298321,0.04291680,0.07673711,0.02751642,0.02999605,0.02840664,0.03429188,0.06766456,0.06529617,0.01823328,0.03154542,0.03617945,0.02491308,0.03862436,0.05278636,0.06661835,0.00640634,0.02634819,0.04883345,0.00208475,0.00285013,0.00410018,0.01004251,0.01505243,0.01684251\n\t\t,0.00327844,0.00950432,0.00000140,0.00002785,0.00309414,0.00607217,0.00464270,0.00355407,0.00510278,0.00575502,0.00202280,0.00414439,0.00510923,0.00285970,0.01577903,0.01948714,0.61707246,0.63488078,0.65055218,0.53261081,0.51475953,0.53035013,0.34326999,0.34187069,0.34355822,0.34022086,0.34229464,0.34012945,0.35218979,0.36084744,0.36812609,0.01029467,0.06519849,0.21410388,0.31851679,0.02776760,0.09774196,0.27716302\n\t\t,0.05876353,0.10767567,0.24038246,0.35099024,0.34743521,0.31254970,0.25584065,0.29301741,0.31689215,0.11019620,0.15164333,0.17412463,0.06033607,0.06126371,0.07111345,0.07447183,0.08834997,0.09455053,0.10732245,0.19523125,0.20589823,0.25484983,0.26808519,0.14822772,0.53379658,0.40166208,0.29445903,0.60420295,0.57615565,0.46726410,0.25093967,0.18939260,0.14690615,0.19165295,0.15722182,0.12720878,0.16532708,0.15110639\n\t\t,0.12705529,0.08719878,0.07376693,0.05970904,0.14465087,0.10178745,0.07289107,0.08740414,0.07468087,0.06191412,0.07001316,0.05514106,0.05096715,0.04470353,0.01943540,0.01913842,0.01259067,0.06901116,0.04805001,0.01388294,0.00328983,0.01358000,0.01155921,0.03151834,0.06368954,0.01639892,0.02941350,0.05311532,0.05682663,0.03151250,0.02039210,0.00878289,0.00293472,0.01758395,0.00578562,0.00165981,0.00267311,0.00561478\n\t\t,0.13625257,0.34257391,0.36516161,0.02357161,0.02121580,0.01372160,0.01410674,0.01534986,0.01603250,0.01999406,0.01493304,0.01074542,0.04992572,0.02625966,0.02084515,0.02791846,0.03335028,0.03545568,0.03195912,0.01445851,0.01494020,0.02440722,0.05647672,0.10393813,0.16506953,0.00343880,0.01326493,0.01561572,0.00021036,0.63566142,0.54306495,0.34066266,0.33695204,0.34291881,0.21805087,0.07689765,0.03883575,0.10693478\n\t\t,0.04239005,0.00484765,0.02458876,0.05720936,0.02338493,0.02798125,0.02830004,0.00533527,0.00811565,0.00387715,0.00011549,0.02041910,0.00013338,0.37320607,0.66890249,0.58561456,0.57439429,0.34507215,0.34542763,0.09393930,0.26225492,0.33570579,0.19744684,0.08219710,0.05491940,0.10067525,0.02803090,0.02817119,0.05589153,0.00663352,0.00714937,0.04021171,0.03139791,0.01417950,0.03428188,0.12764650\n\t\tTransform: 1.000000119209290,0.000000000000000,0.000000158751590,0.000000000000000,0.000000157862814,-0.105666898190975,-0.994401574134827,0.000000000000000,0.000000016774786,0.994401574134827,-0.105666898190975,0.000000000000000,-0.000000033745867,-2.369713783264160,0.212570279836655,1.000000000000000\n\t\tTransformLink: 0.999999940395355,0.000000016774788,-0.000000157862829,0.000000000000000,0.000000000000000,0.994401574134827,0.105666898190975,0.000000000000000,0.000000158751561,-0.105666898190975,0.994401574134827,0.000000000000000,0.000000000000000,2.378908634185791,0.039020061492920,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-chest\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330\n\t\t,3331,3332,3333,3334,3335,3336,3341,3342,3343,3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3356,3357,3358,3359\n\t\t,3360,3361,3362,3366,3371,3372,3373,3374,3377,3378,3379,3380,3381,3383,3386,3387,3388,3389,3390,3391,3392,3393,3395\n\t\t,3396,3397,3398,3399,3402,3403,3406,3418,3420,3422,3424,3426,3428,3432,3433,3434,3435,3445,3446,3447,3448,3449,3450\n\t\t,3456,3460,3461,3462,3463,3468,3470,3475,3476,3477,3478,3479,3484,3923,3924,3925,3926,3927,3928,3929,3930,3931,3932\n\t\t,3933,3934,3935,3936,3937,3938,3939,3940,3941,3942,3943,3944,3945,3946,3947,3948,3949,3950,3951,3952,3953,3954,3955\n\t\t,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,3978\n\t\t,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,3992,3993,3994,3995,3996,3997,3998,3999,4000,4001\n\t\t,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024\n\t\t,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,4041,4042,4043,4044,4045,4046,4047\n\t\t,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,4061,4062,4063,4064,4065,4066,4067,4068,4069,4070\n\t\t,4071,4072,4073,4074,4075,4076,4077,4078,4079,4080,4081,4082,4090,4091,4092,4094,4095,4097,4098,4099,4102,4103,4118\n\t\t,4119,4120,4123,4124,4125,4126,4127,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143\n\t\t,4144,4145,4146,4147,4148,4149,4150,4151,4152,4153,4156,4157,4160,4162,4163,4164,4165,4168,4169,4171,4172,4173,4174\n\t\t,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197\n\t\t,4198,4199,4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,4220\n\t\t,4221,4222,4223,4224,4225,4226,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243\n\t\t,4244,4245,4246,4247,4248,4249,4250,4251,4252,4257,4258,4280,4281,4282,4283,4284,4285,4286,4287,4288,4289,4290,4291\n\t\t,4292,4294,4295,4296,4623,4624,4628,4629,4633,4637,4638,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233\n\t\t,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,5248,5249,5250,5251,5252,5253,5254,5255,5256\n\t\t,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279\n\t\t,5280,5281,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,5301,5302\n\t\t,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324,5325\n\t\t,5326,5327,5328,5329,5330,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347,5348\n\t\t,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371\n\t\t,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5389,5391,5392,5393,5395,5396,5398,5399,5401,5402,5417,5418,5419\n\t\t,5420,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443\n\t\t,5444,5445,5446,5447,5448,5449,5450,5451,5453,5456,5457,5460,5461,5462,5463,5464,5465,5467,5468,5469,5470,5471,5472\n\t\t,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495\n\t\t,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518\n\t\t,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541\n\t\t,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5553,5556,5557,5558,5579,5580,5581,5582,5583,5584,5585,5586,5587\n\t\t,5588,5589,5590,5591,5592,5593,5594,5595,5596,5914,5918,5928,5933,5938,6401,6402,6403,6404,6405,6406,6407,6408,6409\n\t\t,6410,6411,6412,6413,6414,6415,6416,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434\n\t\t,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457\n\t\t,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480\n\t\t,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503\n\t\t,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6524,6525,6527,6528,6544,6548,6549,6550,6551\n\t\t,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6570,6571,6573,6574,6575,6576\n\t\t,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599\n\t\t,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622\n\t\t,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6638,6639,6640,6650,6651,6652,6662,6663,6664\n\t\t,6875,6876,6877,6881,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,6903,6904,6905,6906,6907,7292,7293,7294,7295\n\t\t,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7310,7311,7312,7313,7314,7315,7316,7317,7318,7319,7320\n\t\t,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343\n\t\t,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366\n\t\t,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389\n\t\t,7390,7391,7392,7393,7400,7401,7403,7404,7420,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437\n\t\t,7438,7439,7440,7441,7443,7444,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462\n\t\t,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485\n\t\t,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7502,7503,7504,7514,7515,7516,7524,7526\n\t\t,7527,7528,7739,7740,7741,7742,7753,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764,7765,7899,7900,7901,7902\n\t\t,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7916,7917,7918,7919,7920,7921,7922,7923,7924,7925,7965,7966,7967\n\t\t,7968,8039,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8061,8062,8063\n\t\t,8064,8065,8066,8067,8068,8069,8070,8072,8073,8074,8114,8116,8117,8118,8119\n\t\tWeights: 0.04048474,0.04932000,0.03803318,0.04887535,0.06292036,0.01981951,0.03022111,0.02114402,0.02730816,0.01009847,0.01871938,0.06105371,0.05954635,0.07558197,0.05097709,0.09411934,0.04031856,0.12094944,0.06052675,0.14866001,0.08560591,0.18384107,0.20503380,0.00080372,0.01147034,0.42059039,0.28571165,0.27218128,0.37846485,0.00643346,0.01365537,0.02077884,0.10263306,0.63017088,0.14502349,0.61348253,0.44677981,0.41557731\n\t\t,0.47651299,0.23242851,0.06427486,0.02190092,0.43428816,0.00589570,0.03481413,0.04090719,0.22550107,0.35436392,0.12946486,0.03118732,0.01037402,0.00182224,0.00306157,0.00537472,0.23556840,0.34962347,0.37079644,0.00168315,0.00243546,0.00828656,0.28577159,0.43432045,0.40245596,0.39711807,0.51653685,0.56102691,0.62244771,0.49789714,0.00348529,0.23385176,0.31520092,0.03677831,0.04667446,0.01134463,0.02243504,0.00339918\n\t\t,0.05488042,0.06098359,0.06163892,0.06292036,0.07021931,0.08640763,0.38371297,0.21324528,0.14674462,0.11197820,0.43504995,0.29369924,0.48718894,0.46225281,0.23628813,0.41295593,0.50987005,0.26445504,0.19877903,0.28264926,0.13006930,0.07243079,0.07987019,0.04297242,0.28037739,0.30261646,0.30868389,0.12883988,0.00266752,0.04610396,0.02502129,0.03892256,0.10010340,0.05113091,0.02287503,0.02898983,0.09881414,0.10244375\n\t\t,0.06193825,0.05859161,0.10915873,0.06320056,0.01496385,0.01285087,0.10787894,0.11125394,0.02291573,0.04193415,0.05220177,0.10624959,0.05483411,0.01797834,0.01938105,0.10188562,0.11088709,0.01152818,0.04241075,0.04885422,0.08279406,0.02568010,0.01724918,0.01704074,0.08859003,0.07539077,0.01306571,0.02381417,0.02138827,0.05186933,0.02442832,0.00617836,0.01000718,0.05597283,0.06192607,0.00660598,0.79326532,0.39135925\n\t\t,0.77717063,0.87206978,0.79570133,0.39559364,0.38743281,0.86517792,0.85750281,0.71368373,0.75242173,0.71832968,0.66522202,0.35887848,0.38520646,0.77181595,0.66963890,0.33132527,0.50376134,0.56795311,0.57440154,0.41577121,0.39352932,0.46598282,0.61694385,0.51863329,0.33147689,0.27196818,0.33019993,0.36094225,0.29498648,0.23956433,0.26542772,0.42351846,0.34119590,0.21184460,0.29765861,0.29453332,0.45196610,0.32100438\n\t\t,0.19276802,0.21119156,0.36150307,0.49984199,0.20424918,0.64359675,0.62920107,0.62464398,0.66171262,0.66131495,0.60429249,0.63455310,0.57480035,0.54353716,0.57165347,0.58867314,0.55529357,0.55185369,0.58477538,0.71170153,0.67822820,0.72920243,0.70095848,0.64991476,0.68097625,0.73881600,0.47325128,0.51497606,0.46261386,0.43643779,0.50049300,0.52063523,0.36735248,0.50396739,0.54238364,0.42897984,0.45913419,0.54994460\n\t\t,0.52456644,0.36019186,0.27538914,0.26006633,0.28339168,0.28811451,0.27129462,0.25251657,0.38702290,0.26210574,0.18735471,0.30288264,0.29413239,0.20210482,0.18456255,0.39312499,0.10916101,0.13563074,0.10263615,0.09107504,0.11808610,0.14111396,0.07257168,0.21539879,0.25731031,0.23412828,0.19651123,0.20777000,0.38593166,0.20007964,0.46639763,0.41609456,0.53897748,0.42196890,0.28740680,0.54170742,0.51894346,0.01716426\n\t\t,0.05673749,0.01271355,0.02739355,0.06489443,0.01527906,0.01224194,0.04384743,0.05724845,0.01981295,0.01035893,0.00884095,0.03301302,0.04883481,0.01431908,0.43227871,0.56518481,0.33966258,0.34964888,0.57016633,0.67384913,0.41159077,0.27333421,0.44834116,0.13823066,0.09990039,0.18160245,0.14362586,0.08413988,0.12933101,0.23321058,0.14879233,0.20844783,0.10691589,0.14871180,0.25617552,0.14914584,0.08645356,0.02562343\n\t\t,0.05049964,0.02364854,0.00627330,0.02657311,0.06052425,0.00632815,0.00343055,0.05111650,0.03305256,0.02556252,0.10674844,0.04046321,0.09772601,0.11658257,0.46170754,0.39518486,0.53622487,0.49446967,0.33597589,0.28008446,0.47265069,0.58061389,0.37205950,0.69051530,0.67306926,0.78954091,0.81208658,0.63447805,0.61633243,0.76849375,0.85135122,0.70200355,0.91681025,0.91310433,0.93254411,0.92657169,0.89923245,0.88769164\n\t\t,0.92468988,0.93754648,0.90481735,0.25441196,0.11164533,0.28156316,0.29926196,0.11906806,0.11805705,0.43014422,0.06984240,0.06409580,0.16637622,0.07600474,0.02656680,0.01264924,0.15823181,0.18276083,0.04937619,0.89262388,0.90410605,0.88446574,0.89522202,0.91442529,0.88893649,0.87308210,0.91345620,0.83938644,0.91834239,0.95002109,0.89817601,0.83649135,0.87032946,0.96329423,0.93617779,0.22438993,0.13258971,0.31915981\n\t\t,0.27715292,0.12947087,0.14552601,0.48051532,0.95395444,0.94374881,0.96203508,0.95253558,0.92799798,0.94793929,0.97252154,0.66202960,0.73692233,0.48992512,0.55614632,0.83560872,0.82201479,0.53392150,0.40944806,0.70009491,0.01166890,0.02743771,0.09140448,0.15208034,0.06533361,0.05647243,0.09599746,0.17121478,0.10442065,0.02445949,0.06586320,0.04987746,0.08377667,0.07615885,0.00994784,0.03937927,0.12489322,0.02762443\n\t\t,0.00002847,0.00087537,0.00050463,0.00122284,0.00092288,0.00214940,0.00028689,0.05508842,0.06246978,0.09460913,0.04930888,0.01993943,0.01722985,0.08781396,0.09907245,0.02080776,0.05977672,0.01733061,0.04896114,0.09925706,0.06787895,0.01582528,0.01174580,0.10322977,0.09636069,0.02555166,0.01046598,0.02436048,0.06827732,0.03392889,0.01045437,0.00954003,0.05388718,0.07596388,0.01757232,0.00688382,0.01986399,0.06169168\n\t\t,0.01964544,0.00601521,0.00842674,0.05131973,0.06451629,0.03007200,0.01455587,0.03397156,0.06749353,0.02311609,0.01092394,0.01676802,0.06487632,0.06290305,0.78514966,0.78123422,0.86077584,0.77302395,0.38614594,0.39176637,0.84094768,0.85962765,0.38444091,0.69508656,0.58745032,0.65313641,0.70062583,0.73389153,0.37913180,0.32420397,0.66881090,0.75415241,0.50779664,0.22916032,0.48233771,0.57923448,0.54837080,0.24439747\n\t\t,0.20879500,0.55683436,0.60908540,0.36017660,0.26664613,0.33631387,0.46712101,0.41538544,0.28945802,0.25186381,0.45431311,0.49133957,0.31881288,0.21859950,0.33906871,0.48434100,0.33023386,0.22399649,0.20025085,0.49860737,0.46740066,0.65547039,0.66969953,0.64148849,0.64527089,0.67599241,0.63609258,0.62509243,0.60056228,0.61107575,0.59160079,0.59149530,0.59869279,0.60289976,0.58653934,0.70288230,0.69892991,0.72724074\n\t\t,0.66828438,0.64966046,0.72821404,0.68797209,0.49378841,0.45937323,0.48216494,0.53638609,0.51749558,0.40742475,0.54803150,0.50489415,0.48693848,0.42010835,0.52635140,0.53402133,0.36557422,0.52357308,0.27562528,0.33939877,0.30734872,0.21895728,0.24304697,0.40403291,0.21611568,0.25676292,0.29551804,0.28949430,0.18708406,0.20274196,0.38636311,0.17894816,0.10920815,0.09195797,0.10273721,0.15579960,0.11889532,0.07235366\n\t\t,0.16851366,0.25692966,0.23089443,0.25539217,0.28236647,0.24894001,0.22037263,0.34596183,0.42788567,0.39294604,0.50888741,0.35374104,0.25015418,0.50226821,0.47687944,0.01770457,0.01385541,0.05676955,0.02825273,0.06617529,0.01734122,0.04729223,0.01428522,0.02218963,0.05943702,0.01838019,0.00128943,0.04153802,0.01751614,0.02000892,0.05660635,0.45286583,0.60983459,0.34406761,0.32636608,0.55513960,0.67497293,0.51941739\n\t\t,0.28029598,0.36986811,0.14519169,0.15058589,0.18838826,0.10602039,0.09006255,0.23281373,0.13754179,0.16085163,0.15912214,0.11830025,0.21809001,0.25531635,0.09537023,0.16042838,0.03635893,0.01409114,0.03471075,0.05728411,0.03604455,0.06825171,0.00562644,0.01135241,0.05745400,0.06698316,0.00266391,0.06876099,0.15390272,0.06123662,0.00578582,0.16575126,0.13675699,0.51126039,0.37386962,0.53637796,0.59245124,0.40835082\n\t\t,0.30099116,0.42128795,0.62720206,0.50193983,0.76072985,0.71364220,0.78615264,0.80862281,0.70670595,0.61070592,0.73173525,0.82659964,0.77677884,0.91301549,0.87036479,0.91808924,0.93207624,0.90957813,0.86263771,0.88238662,0.93740362,0.92563555,0.15472977,0.20521544,0.18697050,0.07440592,0.08435325,0.27881227,0.08130065,0.08227509,0.02621925,0.08497190,0.21552266,0.07549763,0.01194656,0.03527099,0.22560978,0.20583923\n\t\t,0.90706735,0.91094793,0.89991579,0.90695237,0.91517504,0.85860599,0.89164706,0.90947329,0.92011175,0.94883154,0.90792303,0.83767349,0.83440322,0.92654646,0.96661882,0.88432225,0.18506384,0.20653921,0.25113572,0.09710637,0.09310336,0.29089117,0.11648626,0.96631065,0.97214480,0.96415159,0.94789239,0.94853353,0.98365500,0.95403369,0.69294889,0.78808083,0.64089664,0.56245330,0.74074574,0.82468590,0.73271205,0.54084979\n\t\t,0.58633175,0.04437895,0.02142287,0.03850284,0.00399232,0.11936413,0.12593348,0.08343945,0.10170025,0.13183295,0.16291789,0.09021860,0.06728606,0.11783557,0.06497104,0.02771901,0.05078374,0.10722051,0.07765687,0.03630191,0.01454010,0.07912315,0.13445649,0.00062945,0.00063952,0.00068303,0.00049602,0.00081661,0.13465132,0.14024881,0.12585270,0.16012688,0.14978283,0.14342434,0.14364153,0.12928062,0.12174155,0.20046415\n\t\t,0.20136353,0.18435022,0.19617251,0.19053092,0.18311322,0.00035765,0.02609439,0.04215085,0.09951853,0.02488046,0.06286915,0.10698269,0.01683174,0.05604698,0.11781078,0.00887640,0.01912189,0.05805751,0.01303246,0.02935482,0.06077357,0.54772359,0.58275019,0.62488960,0.53056238,0.51735888,0.51072632,0.55889905,0.56189136,0.55955496,0.73685911,0.67750627,0.61335902,0.86386084,0.89986261,0.91191299,0.81984669,0.77841787\n\t\t,0.40356200,0.38390868,0.76787972,0.85713394,0.30265479,0.61676963,0.64372728,0.29348602,0.37490278,0.47158217,0.18843554,0.29826251,0.33542654,0.20033625,0.34334125,0.51422961,0.57524546,0.60705597,0.60518871,0.71135759,0.68349289,0.63723781,0.55234588,0.55270303,0.55475436,0.59349617,0.61583306,0.64333308,0.71767091,0.67017542,0.62218096,0.53782038,0.45211874,0.32667069,0.46759031,0.36678806,0.28787800,0.46312703\n\t\t,0.34352756,0.26990977,0.41971834,0.27526335,0.22274979,0.21525567,0.18235259,0.16009665,0.43030085,0.29638179,0.22802547,0.09036526,0.06892404,0.05095717,0.13499087,0.09278108,0.05924547,0.19419898,0.18141510,0.15234378,0.12054538,0.10788401,0.08550765,0.49397496,0.36447006,0.19848005,0.21048039,0.35584698,0.47124604,0.05156227,0.00430963,0.06366600,0.01039274,0.00119077,0.08325386,0.06447522,0.05013685,0.74748196\n\t\t,0.66116223,0.58318148,0.17673272,0.25009921,0.34607340,0.91346830,0.90143651,0.88477973,0.07990653,0.14930558,0.26658994,0.37826453,0.30317301,0.21429649,0.05435829,0.07196236,0.09536930,0.01887617,0.06405032,0.01744097,0.08126694,0.91246085,0.93330643,0.94089869,0.85524750,0.81903871,0.75680595,0.61255249,0.51372539,0.39768305,0.00521010,0.05405151,0.13662660,0.06082546,0.05619812,0.05682903,0.18385183,0.21707073\n\t\t,0.24310809,0.54737175,0.60131443,0.64103032,0.84733059,0.85375231,0.86046698,0.92213963,0.93124727,0.93946522,0.49723708,0.30029479,0.12755290,0.85085885,0.86525106,0.78519559,0.98582610,0.96319572,0.94346282,0.59716641,0.44559960,0.16235010,0.05659866,0.07708710,0.18857152,0.07899380,0.07442826,0.07094413,0.28434888,0.30257064,0.34635106,0.83791798,0.88847763,0.92290642,0.91452568,0.94633028,0.97611071,0.76880035\n\t\t,0.70488891,0.58469146,0.98254773,0.96299397,0.95235983,0.01615165,0.00537497,0.02917838,0.01711652,0.00448808,0.01259157,0.03027583,0.07158255,0.05793766,0.09385886,0.16448561,0.01685635,0.05577720,0.10558341,0.00274737,0.00353365,0.00708940,0.00292985,0.00411404,0.00422007,0.00524420,0.00947876,0.00835426,0.00207775,0.00271289,0.00259736,0.00118023,0.00113391,0.00139611,0.00150677,0.15141019,0.13772431,0.12880680\n\t\t,0.18379322,0.16651019,0.15483690,0.15292259,0.14450028,0.13407285,0.18330225,0.16800252,0.16795359,0.19195405,0.19112529,0.18470025,0.00049587,0.01086898,0.04394131,0.08617354,0.00561332,0.02003348,0.06857951,0.00918242,0.02021113,0.04951185,0.57511606,0.59331365,0.62777963,0.56335102,0.55273431,0.54902000,0.54521912,0.55929516,0.56811255,0.70451368,0.64469795,0.58641806,0.85156330,0.89153507,0.90544947,0.80143359\n\t\t,0.75730470,0.39374441,0.28074808,0.59786285,0.63587917,0.31398948,0.45168393,0.52986738,0.23900163,0.32215913,0.45765461,0.60866058,0.62531122,0.61786263,0.70675487,0.68537829,0.62865001,0.57094540,0.57561673,0.57169193,0.58567297,0.59575302,0.58650926,0.54301126,0.47134059,0.37878532,0.48106382,0.40702599,0.32225599,0.45058781,0.33464795,0.28949721,0.42476984,0.27927768,0.24430641,0.19168813,0.19984005,0.19265970\n\t\t,0.43554623,0.31900012,0.21083558,0.09380645,0.07136565,0.05250095,0.14744010,0.08630096,0.05499144,0.19990822,0.17076042,0.14909939,0.12440863,0.10801708,0.08570629,0.35746097,0.27483935,0.15106217,0.19363226,0.33842635,0.45310462,0.04676443,0.01536227,0.06613463,0.01222049,0.00723675,0.09114366,0.06941808,0.05392852,0.71332641,0.64807621,0.49344590,0.18875444,0.27631756,0.35848665,0.08673465,0.15692097,0.26014733\n\t\t,0.36905559,0.31040099,0.22326173,0.06055948,0.08043662,0.10397330,0.02850353,0.07090684,0.04084605,0.09838830,0.90669772,0.92775189,0.94317337,0.85953897,0.80194698,0.75066800,0.64571140,0.55598441,0.45521251,0.00703806,0.06986946,0.18152815,0.02881932,0.03024090,0.03728992,0.21436928,0.27015398,0.29848719,0.55198783,0.65662443,0.68428662,0.82171488,0.84194529,0.86721345,0.29755832,0.21024299,0.09120909,0.86471223\n\t\t,0.87933959,0.80834855,0.38459800,0.31126445,0.14920322,0.03110945,0.08204997,0.21937829,0.00695395,0.02520817,0.03003234,0.39817423,0.40429442,0.41477609,0.85059368,0.90358656,0.92018324,0.91601714,0.94990342,0.97440561,0.78350340,0.73857276,0.60820400,0.02581746,0.00261995,0.04181144,0.02993285,0.01550594,0.04151781,0.06997008,0.07833706,0.00188576,0.09000057,0.11215258,0.13305386,0.01842176,0.06646635,0.09206926\n\t\t,0.00107114,0.00499820,0.00334593,0.00285872,0.00392223,0.00452983,0.00451954,0.00365981,0.00142075,0.00133292,0.00201456,0.00331709,0.00627402,0.00583500,0.15014577,0.17033963,0.15320520,0.19882784,0.52364567,0.55064841,0.52711390,0.81159936,0.55649774,0.22277587,0.11091405,0.12473845,0.01702559,0.04611503,0.02111126,0.43884010,0.12766157,0.87865614,0.06692636,0.73992511,0.26954219,0.08100815,0.38017523,0.02654595\n\t\t,0.00300239,0.00853498,0.00228220,0.00169481,0.17991926,0.12648224,0.16125332,0.20946866,0.15607552,0.18916845,0.90606070,0.73724465,0.56024319,0.57526609,0.54317395,0.78954111,0.56547095,0.49467761,0.20884287,0.12147640,0.13803689,0.01851690,0.04528568,0.02781154,0.39876522,0.79550357,0.13252269,0.94410847,0.88079299,0.03054130,0.72721290,0.33948118,0.99285063,0.92699972,0.42446035,0.04513244,0.00457020,0.00437263\n\t\t,0.00145963,0.00260412,0.00341121\n\t\tTransform: 1.000000119209290,-0.000000000000008,0.000000000000028,0.000000000000000,0.000000000000015,0.148816168308258,-0.988864898681641,0.000000000000000,0.000000000000001,0.988864898681641,0.148816168308258,0.000000000000000,-0.000000000000003,-2.655787229537964,-0.473277449607849,1.000000000000000\n\t\tTransformLink: 0.999999940395355,0.000000000000004,-0.000000000000028,0.000000000000000,-0.000000000000004,0.988864898681641,-0.148816168308258,0.000000000000000,0.000000000000014,0.148816168308258,0.988864898681641,0.000000000000000,0.000000000000000,2.696645975112915,0.072783403098583,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-neck\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320\n\t\t,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343\n\t\t,3346,3349,3350,3351,3352,3353,3357,3358,3359,3363,3364,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376\n\t\t,3377,3378,3380,3381,3382,3383,3384,3385,3386,3387,3393,3394,3395,3396,3397,3398,3399,3402,3403,3406,3408,3409,3410\n\t\t,3411,3412,3413,3414,3415,3416,3417,3418,3420,3422,3424,3426,3428,3430,3432,3433,3434,3435,3439,3440,3449,3450,3464\n\t\t,3465,3468,3474,3475,3482,3483\n\t\tWeights: 0.57314842,0.56151085,0.29641573,0.30460494,0.28560666,0.59896958,0.58920777,0.26177796,0.27753067,0.60164345,0.28921515,0.59538718,0.82234536,0.85833801,0.79478610,0.84662896,0.69177628,0.63438432,0.55768282,0.61848284,0.47270399,0.55509744,0.30123124,0.54578072,0.21388477,0.54277125,0.13602862,0.53880205,0.15357885,0.51086457,0.14114189,0.49153060,0.23935089,0.60293859,0.37328022,0.29437473,0.63577778,0.63347032\n\t\t,0.32323074,0.05880154,0.03836632,0.25638849,0.30347344,0.07002553,0.10395455,0.11699653,0.02329723,0.29256722,0.25851456,0.23171177,0.08652755,0.03713257,0.01501600,0.09936660,0.13527489,0.12451804,0.43340024,0.14592056,0.12695524,0.04255613,0.23608101,0.06233364,0.15398729,0.07661723,0.01179206,0.01878783,0.03421820,0.44786757,0.31652673,0.10875801,0.01485716,0.03658652,0.42872637,0.63541176,0.08915841,0.86667032\n\t\t,0.63627323,0.63131120,0.27304628,0.23964640,0.47022686,0.24478425,0.02472334,0.00961456,0.56803866,0.56898342,0.50133066,0.55595859,0.47225362,0.63141933,0.82731925,0.87191528,0.78007965,0.85863426,0.70051593,0.64673126,0.54791726,0.65264244,0.49256128,0.52493270,0.45741436,0.36548949,0.28560666,0.24431911,0.23272950,0.44305019,0.26926251,0.47535835,0.34282285,0.09614790,0.42659916,0.46957290,0.16759872,0.22480234\n\t\t,0.49205425,0.21115599,0.23065731,0.47166196,0.23372932,0.29525318,0.53174233\n\t\tTransform: 1.000000119209290,0.000000000000007,0.000000326468182,0.000000000000000,0.000000313275052,-0.281406760215759,-0.959588587284088,0.000000000000000,0.000000091870326,0.959588587284088,-0.281406760215759,0.000000000000000,-0.000000298389978,-3.193888425827026,0.913948774337769,1.000000000000000\n\t\tTransformLink: 0.999999940395355,0.000000091870334,-0.000000313275109,0.000000000000000,0.000000000000003,0.959588587284088,0.281406760215759,0.000000000000000,0.000000326468069,-0.281406760215759,0.959588587284088,0.000000000000000,0.000000000014840,3.322010040283203,0.021766960620880,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-head\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3298,3299,3301,3302,3303,3304,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3333,3334,3335,3336,3349\n\t\t,3350,3351,3352,3353,3386,3387,3418,3420,3422,3424,3426,3428,3432,3433,3434,3435,3449\n\t\tWeights: 0.01548329,0.02331250,0.00207889,0.01652798,0.00023381,0.00734089,0.03112987,0.00460019,0.03568769,0.00475917,0.03874509,0.00403507,0.04219602,0.00572495,0.04255875,0.00641221,0.04203901,0.01158861,0.00867831,0.05339951,0.05413269,0.01318690,0.00574299,0.00074439,0.00671326,0.00216403,0.00063606,0.05182704,0.00513778,0.00618533,0.01225660,0.01514733,0.01652798,0.01711650,0.01771852,0.00581622,0.03856998,0.02735295\n\t\t,0.00254907,0.00062157\n\t\tTransform: 1.000000119209290,-0.000000000000028,0.000000000000057,0.000000000000000,0.000000000000000,0.000000089406967,-1.000000000000000,0.000000000000000,0.000000000000014,1.000000000000000,0.000000089406967,0.000000000000000,-0.000000000014892,-3.569406747817993,-0.094318285584450,1.000000000000000\n\t\tTransformLink: 0.999999940395355,0.000000000000028,-0.000000000000057,0.000000000000000,-0.000000000000014,1.000000000000000,-0.000000089406967,0.000000000000000,0.000000000000000,0.000000089406967,1.000000000000000,0.000000000000000,0.000000000014841,3.569406747817993,0.094317965209484,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-shoulder_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3298,3299,3300,3301,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321\n\t\t,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344\n\t\t,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,3360,3361,3362,3363,3364,3365,3366,3367\n\t\t,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,3388,3389,3390\n\t\t,3391,3392,3393,3394,3395,3396,3397,3408,3409,3410,3412,3414,3416,3432,3435,3449,3450,3464,3474,3475,3977,3978,3979\n\t\t,3980,3983,3984,3986,3987,3988,3989,3992,3993,3995,3996,3997,3998,4001,4002,4005,4006,4010,4011,4013,4014,4015,4016\n\t\t,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039\n\t\t,4040,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,4061,4062\n\t\t,4063,4064,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,4077,4078,4079,4080,4081,4082,4083,4084,4085\n\t\t,4086,4087,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108\n\t\t,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,4125,4126,4127,4128,4129,4130,4131\n\t\t,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143,4144,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154\n\t\t,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177\n\t\t,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4192,4193,4194,4197,4198,4199,4200,4201,4202,4203\n\t\t,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,4220,4221,4222,4223,4224,4225,4226\n\t\t,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4240,4241,4243,4244,4245,4246,4247,4248,4249,4250,4251\n\t\t,4252,4254,4257,4258,4259,4263,4267,4268,4271,4272,4273,4274,4275,4276,4277,4278,4280,4281,4282,4283,4284,4285,4286\n\t\t,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297,5317,5328,5354,5355,5356,5359,5360,5513,5514,5515,5516,5517,5519\n\t\t,5521,5522,5526,5531,5534,5547,5548,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6449,6456,6457\n\t\t,6459,6460,6462,6463,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485\n\t\t,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508\n\t\t,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531\n\t\t,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554\n\t\t,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6578\n\t\t,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6602,6603,6604\n\t\t,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627\n\t\t,6628,6629,6630,6631,6635,6636,6637,6638,6651,6652,6653,6656,6657,6659,6660,6661,6662,6663,6664,7351,7373,7388,7393\n\t\t,7472,7475,7476,7478,7479,7491,7492,7496,7497,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916\n\t\t,7917,7918,7919,7920,7921,7922,7923,7924,7925,8051,8052,8063,8072\n\t\tWeights: 0.37088355,0.36585664,0.66555109,0.64444082,0.38097710,0.37323022,0.71707801,0.69516117,0.38825808,0.69206547,0.34448353,0.16051936,0.09224687,0.20264608,0.12049350,0.30822372,0.20809483,0.42761213,0.25702307,0.52687227,0.35271897,0.63462222,0.34294963,0.73037897,0.32436432,0.81961776,0.29805250,0.78016945,0.29791666,0.76683999,0.28258932,0.54402670,0.39625770,0.61524944,0.26244300,0.02511106,0.04021571,0.28511750\n\t\t,0.94119846,0.96163368,0.70504630,0.60501342,0.91680753,0.88239008,0.86222463,0.89736694,0.36982912,0.83167928,0.38651747,0.44597878,0.28611248,0.26422806,0.52914645,0.84703357,0.94033045,1.00000000,1.00000000,0.50244721,0.97908831,0.86581927,0.82381792,0.77449893,0.64563608,0.87053514,0.87548196,0.39074721,0.82716870,0.84185743,0.90493673,0.70981912,0.92315173,0.84601271,0.90846938,0.98638570,0.97815061,0.96040708\n\t\t,0.31849759,0.46278392,0.55843200,0.63551938,0.62920356,0.95229852,0.56883817,0.36458824,0.89838392,0.07187249,0.16755251,0.00728369,0.20001768,0.25282520,0.22150839,0.22772787,0.30030434,0.37755229,0.24134213,0.25269933,0.28979046,0.17516298,0.25504428,0.05466790,0.01789400,0.05225643,0.03399209,0.12727103,0.09109373,0.06857355,0.00537814,0.05564321,0.21073905,0.10076466,0.19169735,0.10285699,0.01326675,0.00191496\n\t\t,0.05216637,0.02427337,0.03705033,0.05964289,0.01379053,0.01655970,0.05510691,0.01421862,0.06093443,0.04583032,0.00514099,0.01532310,0.03287649,0.01411175,0.03994881,0.02891534,0.00448462,0.02298561,0.02198387,0.00899309,0.09933781,0.07894302,0.11407019,0.11273978,0.08364165,0.08575733,0.14144011,0.11436832,0.08582349,0.12793265,0.12033958,0.08676950,0.09664620,0.15368481,0.15890472,0.19839793,0.13451297,0.14354675\n\t\t,0.18738196,0.19347731,0.10611706,0.19256687,0.17582285,0.16637872,0.23521963,0.22456894,0.13846682,0.20929123,0.10328171,0.09037076,0.11907434,0.12126192,0.08889145,0.09638930,0.13775507,0.41787124,0.39487535,0.44908151,0.38708620,0.32350751,0.46210742,0.36743080,0.58190210,0.68172077,0.54966270,0.51636697,0.62095875,0.71763152,0.42409109,0.31659689,0.34902251,0.24767680,0.36391986,0.45145692,0.23335529,0.27412095\n\t\t,0.10369963,0.12517663,0.11091553,0.09554830,0.10202178,0.13540143,0.10686060,0.42806791,0.51439078,0.34244462,0.45909610,0.64566023,0.39351714,0.33455982,0.30504098,0.34889771,0.38341926,0.21583462,0.20471357,0.58316572,0.25876621,0.88241137,0.83883053,0.85109752,0.93208075,0.91386891,0.77336257,0.90039182,0.60864677,0.69944375,0.53160802,0.57745451,0.72936505,0.62446135,0.41939435,0.45691341,0.63092089,0.41997087\n\t\t,0.35968186,0.55470542,0.67249572,0.26359604,0.12949616,0.14032516,0.17361984,0.09190499,0.08467288,0.23631440,0.11810872,0.13583189,0.09894792,0.17965248,0.14329832,0.08735753,0.12748334,0.23607664,0.21714192,0.20330991,0.29541275,0.17236740,0.14035642,0.12589653,0.32940365,0.20060878,0.15419650,0.44330804,0.35930023,0.41336728,0.52663869,0.49926987,0.27638115,0.48417742,0.69684017,0.66151815,0.74248165,0.66137941\n\t\t,0.58366133,0.74004502,0.70396702,0.83471639,0.80875039,0.86458964,0.81932211,0.77160668,0.83835214,0.86259586,0.99269670,0.95112490,0.99656945,0.99546027,0.94652212,0.91819221,1.00000000,0.96694744,0.97443748,0.88029169,0.95953679,1.00000000,1.00000000,0.88736666,0.87249166,1.00000000,0.45652521,0.51280334,0.36214553,0.43025663,0.59909321,0.64770698,0.40966270,0.32909762,0.56782997,0.16792764,0.17563002,0.10051452\n\t\t,0.10497174,0.22697415,0.23743958,0.10747760,0.07731049,0.18856159,0.00879252,0.00055782,0.01094272,0.02643041,0.02768951,0.02517104,0.74042707,0.85740668,0.69022005,0.67886120,0.85557466,0.84392571,0.56581890,0.93015760,0.93590420,0.83362378,0.92399526,0.97343320,0.98735076,0.84014803,0.81723917,0.95062381,0.10481184,0.08552843,0.11391797,0.09769312,0.07665608,0.10060230,0.11349333,0.05999274,0.08790198,0.04480074\n\t\t,0.04069890,0.07547588,0.10569916,0.06631742,0.02443627,0.05305169,0.68967658,0.81447369,0.60077137,0.65848939,0.81946098,0.79775339,0.51075797,0.00525320,0.00607304,0.01158734,0.01788234,0.00530123,0.31807568,0.26240671,0.48525334,0.39039617,0.16397053,0.17232719,0.45586203,0.54396880,0.25048701,0.02506166,0.01013467,0.04367644,0.01858533,0.01384094,0.00661759,0.03138511,0.05808644,0.08386669,0.06929068,0.00470261\n\t\t,0.02346454,0.06733175,0.07949195,0.03912673,0.04867442,0.07782979,0.03055291,0.01315569,0.05668135,0.09505692,0.06534041,0.02960482,0.07592011,0.13469276,0.07950949,0.03634422,0.05962809,0.12624781,0.13973624,0.03033316,0.04850175,0.01119203,0.00590099,0.00563664,0.00177764,0.01640991,0.01312309,0.00012845,0.00907718,0.00651082,0.00779787,0.01026033,0.01104422,0.01196243,0.00228001,0.00408230,0.00708313,0.01421036\n\t\t,0.09483366,0.00203523,0.02097070,0.06249423,0.06124450,0.05825668,0.07550091,0.07313341,0.06951012,0.08596977,0.08051394,0.07803004,0.07314572,0.08157630,0.08859336,0.01789542,0.01765856,0.02318223,0.06011191,0.01774908,0.04354770,0.01276557,0.02387696,0.08834523,0.12145837,0.16113305,0.09151735,0.12720590,0.16806281,0.11059869,0.15121037,0.19107161,0.24749868,0.26287696,0.28164515,0.05298952,0.10855554,0.16379756\n\t\t,0.10420962,0.13999306,0.17524221,0.28311934,0.31058886,0.26683639,0.11464456,0.13575878,0.14075646,0.13366831,0.13631206,0.13887491,0.27568111,0.38158296,0.49481977,0.36269631,0.46828858,0.54170507,0.54255625,0.43336478,0.32441474,0.16410769,0.18017952,0.19531821,0.10359907,0.08993886,0.09271698,0.70501440,0.77578344,0.84411705,0.48597444,0.62205003,0.79561113,0.71345638,0.50946559,0.35971398,0.16074059,0.13401077\n\t\t,0.11877651,0.07404358,0.05708773,0.05026762,0.08294088,0.06208502,0.04874808,0.70359987,0.78769326,0.83480878,0.21896338,0.38571340,0.66501325,0.99496746,0.97062987,0.93024290,0.69775021,0.47935464,0.33187169,0.08384158,0.14849280,0.27493012,0.80423458,0.75626171,0.69881249,0.38590334,0.25415164,0.17156316,0.18445749,0.25614763,0.36890603,0.11397897,0.17771568,0.25309172,0.22700690,0.35996288,0.39633049,0.04856449\n\t\t,0.05329743,0.06048772,0.62318875,0.60487450,0.52765584,0.48649944,0.58874161,0.69974416,0.72841514,0.78198539,0.80312287,0.90603381,0.90329308,0.86693013,1.00000000,0.98255903,0.89973165,0.02280928,0.00926242,0.07518171,0.10027544,0.15423238,0.30994235,0.41861033,0.54783082,0.99478990,0.94594849,0.85641802,0.93917454,0.94380188,0.94317097,0.76380224,0.73573643,0.71420204,0.31504989,0.27875158,0.25495273,0.06247632\n\t\t,0.06273806,0.06077238,0.49088579,0.65652348,0.82431084,0.14161897,0.13452891,0.17468032,0.00916466,0.01848539,0.03391976,0.37640356,0.47675531,0.78032009,0.94340134,0.92291290,0.81142848,0.91856116,0.92557174,0.92905587,0.68623179,0.67884511,0.64732755,0.11937217,0.09151524,0.06854668,0.04159000,0.02555271,0.00949752,0.16388952,0.26559283,0.41439354,0.01563217,0.02092087,0.02101722,0.00054209,0.01397843,0.06362804\n\t\t,0.01035041,0.05410751,0.00498682,0.08579361,0.06499812,0.05514598,0.03815347,0.07000774,0.12123831,0.01845926,0.00274630,0.02285444,0.02563014,0.09563119,0.02075315,0.01173197,0.18039041,0.12359903,0.00018695,0.00997286,0.07248528,0.03743491,0.06725501,0.08133524,0.09911316,0.05759181,0.23641426,0.16979411,0.12150000,0.61476547,0.21544706,0.95350820,0.11005805,0.04792634,0.85096645,0.58713586,0.38969541,0.80700436\n\t\t,0.05432777,0.93307364,0.18977677,0.69297982,0.91469753,0.61898470,0.00966905,0.00942048,0.28655640,0.10826946,0.03435859\n\t\tTransform: 0.429939121007919,0.902857720851898,0.000549820833839,0.000000000000000,-0.902857780456543,0.429938942193985,0.000236753272475,0.000000000000000,-0.000022639136660,-0.000598199840169,0.999999582767487,0.000000000000000,-0.189679577946663,0.051554445177317,-3.225779294967651,1.000000000000000\n\t\tTransformLink: 0.429939031600952,-0.000022634863853,0.902857959270477,0.000000000000000,0.902857661247253,-0.000598199665546,-0.429939061403275,0.000000000000000,0.000549822987523,1.000000000000000,-0.000236749649048,0.000000000000000,0.036777928471565,3.225806236267090,0.192655280232430,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-upper_arm_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3971,3972,3976,3977,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,3992,3993,3994,3995,3996\n\t\t,3997,3998,3999,4000,4001,4002,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4030\n\t\t,4031,4034,4035,4036,4037,4038,4039,4040,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055\n\t\t,4056,4057,4058,4059,4060,4061,4062,4063,4064,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,4077,4078\n\t\t,4079,4080,4081,4082,4083,4084,4085,4086,4087,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,4100,4101\n\t\t,4102,4103,4104,4105,4106,4107,4108,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124\n\t\t,4125,4126,4127,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143,4144,4145,4146,4147\n\t\t,4148,4149,4150,4151,4152,4153,4154,4155,4156,4158,4159,4160,4164,4168,4169,4171,4172,4173,4174,4175,4176,4177,4178\n\t\t,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4196,4197,4201,4211,4214,4216,4217\n\t\t,4220,4221,4222,4223,4224,4225,4226,4227,4228,4229,4237,4238,4239,4240,4241,4242,4243,4244,4246,4247,4250,4251,4252\n\t\t,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4269,4270,4271,4272,4273,4274,4275\n\t\t,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297,4298\n\t\t,4299,4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4320,4321\n\t\t,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,4332,4333,4334,4335,4336,4337,4338,4339,4340,4341,4342,4343,4344\n\t\t,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,4361,4362,4363,4364,4365,4366,4367\n\t\t,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390\n\t\t,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413\n\t\t,4414,4415,4416,4417,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,6434,6437,6438,6439\n\t\t,6440,6441,6442,6443,6444,6445,6446,6447,6449,6450,6451,6455,6456,6457,6458,6459,6460,6463,6467,6468,6469,6471,6472\n\t\t,6473,6474,6475,6476,6477,6478,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498\n\t\t,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521\n\t\t,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544\n\t\t,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554,6555,6556,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570\n\t\t,6571,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6586,6590,6591,6592,6593,6594,6595,6596,6597,6598,6607,6620\n\t\t,6621,6622,6623,6624,6625,6626,6627,6628,6631,6635,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648\n\t\t,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,6664,6665,6666,6667,6668,6669,6670,6671\n\t\t,6672,6673,6674,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694\n\t\t,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717\n\t\t,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6737,6738,6739,6740,6741,6742,6743\n\t\t,6744,6745,6746,6747,6748,6749,6750,6751,6752,6753,6754,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914\n\t\t,7915,7916,7917,7918,7919,7921,7922,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939\n\t\t,7940,7941,7942,7943,7944\n\t\tWeights: 0.00668608,0.01183961,0.03781973,0.07804270,0.06119792,0.12100135,0.09326411,0.02029670,0.01348849,0.09315937,0.15029675,0.02509271,0.06652352,0.07770999,0.12557271,0.06077651,0.04591673,0.04732094,0.15372444,0.09464862,0.03704241,0.01297502,0.03783264,0.04021100,0.00935761,0.00336389,0.01594975,0.06045067,0.02101271,0.02695643,0.00971517,0.05109674,0.02753192,0.00399385,0.03274805,0.05672306,0.09054004,0.07934518\n\t\t,0.10549898,0.08057119,0.06646615,0.10445283,0.09419518,0.01193525,0.02490439,0.01773804,0.04703209,0.22083086,0.17584066,0.26038396,0.23076798,0.16027746,0.19456787,0.34436976,0.28510883,0.23783697,0.37391757,0.31994489,0.20498923,0.27935995,0.43333359,0.25365824,0.29399723,0.21566561,0.26763808,0.34941080,0.24376148,0.17312943,0.13282434,0.12987008,0.11666532,0.14940176,0.16650760,0.09780593,0.12255154,0.57424210\n\t\t,0.51446367,0.64968705,0.54500510,0.43045698,0.62011763,0.65330737,0.67976535,0.59718409,0.65495620,0.70794048,0.67846689,0.43194248,0.69305976,0.06163554,0.04513706,0.05670121,0.07625607,0.06311221,0.02255491,0.07640771,0.69495902,0.65110229,0.61658074,0.78416538,0.79528643,0.41683428,0.74123379,0.10042437,0.10443198,0.13618892,0.06791925,0.05873754,0.16174300,0.09960818,0.37607418,0.28831431,0.42454455,0.42254549\n\t\t,0.27063495,0.31829020,0.56079270,0.54308659,0.36907911,0.58002913,0.64031814,0.44529458,0.32750428,0.73640396,0.87050384,0.85967484,0.82638016,0.90809501,0.91532712,0.76368560,0.88189128,0.85380917,0.89221112,0.78733450,0.85670168,0.91264247,0.82368185,0.74960428,0.35057937,0.23150528,0.36492467,0.47798371,0.26872842,0.19155341,0.25900558,0.52605701,0.36785357,0.41846130,0.54079938,0.40503026,0.32973546,0.41659024\n\t\t,0.59428784,0.28261200,0.15436751,0.13003403,0.15060246,0.18990879,0.16016315,0.11080914,0.20957942,0.13966018,0.14074998,0.11176182,0.17440459,0.20182021,0.10112361,0.13740414,0.00730330,0.04254694,0.00453973,0.05347788,0.03069129,0.01295987,0.01490733,0.01092577,0.08176725,0.09201181,0.10162960,0.07527371,0.06493089,0.07220857,0.11768661,0.09028850,0.06011053,0.14155706,0.15130072,0.10994458,0.08294167,0.13854780\n\t\t,0.14622799,0.12402866,0.07133829,0.10943486,0.02956008,0.02448748,0.00397291,0.02828162,0.04797990,0.05321762,0.00442283,0.04508723,0.00437214,0.00162016,0.00256429,0.00161629,0.00708486,0.01342457,0.02655106,0.07271158,0.03685687,0.00719984,0.02634811,0.05780949,0.06335313,0.01226950,0.00214753,0.01564025,0.01931331,0.00214572,0.01989840,0.03233295,0.00246574,0.00974186,0.01989472,0.02482153,0.05345751,0.01021646\n\t\t,0.04658314,0.04941808,1.00000000,0.97493834,1.00000000,1.00000000,0.97819643,0.92888585,0.98141467,1.00000000,1.00000000,1.00000000,0.98615906,1.00000000,1.00000000,1.00000000,0.99338241,0.96861489,1.00000000,1.00000000,0.94191356,0.91613331,0.93070932,0.99529739,0.97653546,0.93266825,0.92050805,0.96087327,1.00000000,0.85992111,0.77008987,0.90411348,0.93037188,0.84732120,0.72873314,0.83023894,0.97554051,0.90453198\n\t\t,0.87420243,0.78153057,0.84433166,0.95370795,0.94037191,0.83437292,0.73537054,0.94204240,0.95149825,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.77209933,0.89254555,0.78445743,0.55459201,0.75782658,0.87985478,0.91009706,0.54140031,0.56951328,0.81871209,0.92967931,0.80243663,0.61064540,0.80664529,0.93059764,0.91781110,0.61550415,0.52467972,0.78357214,0.88029502,0.78698101,0.66406359\n\t\t,0.78141086,0.88773388,0.87767802,0.66901729,0.63480031,0.77976029,0.88312548,0.77956451,0.62346409,0.77672214,0.87893007,0.88349099,0.62373447,0.62881265,0.78322031,0.88049150,0.76875304,0.64416613,0.78582761,0.88319088,0.87639074,0.60278561,0.65036702,0.14130491,0.24473709,0.12279440,0.07578981,0.16154438,0.26732415,0.21547240,0.06516904,0.08657115,0.08783501,0.16822804,0.09878027,0.03754687,0.09035057,0.16012990\n\t\t,0.19051301,0.04411173,0.04616308,0.19610918,0.31865633,0.21486115,0.11913056,0.16410738,0.26978022,0.33634722,0.13571364,0.09441102,0.20090626,0.29139531,0.19325978,0.11978399,0.20581387,0.30103528,0.28479075,0.11631329,0.12839484,0.18814640,0.29885983,0.18470358,0.10805804,0.18989265,0.29746896,0.29368001,0.10308088,0.11141557,0.01338470,0.09597262,0.07622910,0.05877655,0.23896316,0.20211013,0.16509629,0.13642619\n\t\t,0.17603068,0.22399357,0.05532825,0.01768643,0.06734515,0.03925158,0.00461555,0.02592246,0.09003194,0.15579376,0.02698936,0.05598072,0.07716740,0.00680973,0.05527220,0.06507906,0.07533531,0.02432089,0.05724247,0.13837181,0.13489023,0.11766494,0.06593617,0.04177293,0.00905262,0.19717808,0.30240621,0.42801844,0.15538754,0.24518815,0.38457733,0.35387493,0.46520009,0.54314054,0.40107282,0.58842459,0.63837530,0.47144760\n\t\t,0.41606934,0.33833039,0.13320153,0.18402056,0.20454195,0.36707850,0.49771118,0.62462809,0.69729218,0.72703940,0.74543632,0.69068891,0.72864604,0.75493925,0.17444022,0.11633255,0.07037530,0.00048138,0.01267761,0.00590882,0.07606324,0.09668480,0.09864400,0.83925941,0.86598923,0.88122349,0.92595642,0.94291227,0.94973238,0.86549685,0.93360535,0.95125192,0.23273413,0.20191400,0.16519122,0.78103662,0.61428660,0.33498675\n\t\t,0.00503254,0.02937013,0.06975710,0.30224979,0.52064536,0.66812831,0.91615842,0.85150720,0.72506988,0.19576542,0.24373829,0.29999674,0.61409666,0.74584836,0.82843684,0.73228865,0.67937715,0.58095713,0.13853907,0.16112209,0.16372680,0.59626038,0.38993791,0.25759611,0.29690472,0.24581992,0.20575422,0.13523603,0.10808538,0.08595935,0.21722657,0.14605225,0.10150783,0.09396619,0.07783075,0.06901955,0.01900141,0.04083280\n\t\t,0.02491202,0.00358323,0.06957079,0.08068585,0.08896167,0.07750516,0.06766429,0.05448613,0.00695538,0.05234594,0.04719285,0.04268987,0.13757836,0.11993399,0.10401695,0.07833565,0.07571911,0.07215988,0.04012409,0.02941933,0.01858424,0.00632140,0.04270985,0.02000713,0.00046085,0.04388432,0.02699740,0.01026258,0.00091501,0.96821617,0.97370415,0.97898278,0.97027953,0.98288348,0.99551192,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.98740843,0.95574574,0.86478941,0.98964959,1.00000000,1.00000000,0.94589249,0.99501318,1.00000000,0.91420639,0.93500188,0.94485402,0.90390887,0.83613339,0.70055230,0.94659154,0.94433200,0.94368583,0.94408588,0.94676251,0.94785145,0.94771437,0.94069892,0.93926775,1.00000000,0.99930004,0.98647886,0.94747190,0.95860383,0.98076169,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.46383639,0.46867609,0.45840927,0.43219471,0.42263657,0.41157871,0.42761095,0.50453901,0.51448475,0.27364707,0.31277364,0.34542161,0.43059921,0.40978318,0.38552177,0.58629400,0.75773262,0.87490310,0.92416773,0.79182313,0.51643473,0.90163375,0.78368448,0.61572140,0.87571526\n\t\t,0.77734693,0.64420545,0.88307057,0.78105277,0.63154757,0.05525839,0.05241567,0.04643452,0.06354022,0.06055051,0.05872816,0.03811795,0.05688030,0.06431150,0.02912366,0.02121001,0.01127791,0.09600478,0.17758185,0.28529072,0.17518355,0.10394841,0.05527759,0.22708660,0.12893945,0.06493396,0.31618971,0.21197940,0.13774276,0.28476304,0.18925816,0.11357421,0.04016900,0.13287203,0.29687529,0.09197308,0.09046260,0.56503998\n\t\t,0.76758594,0.26049608,0.76752735,0.00037678,0.88994195,0.95207366,0.14903355,0.39175288,0.17146449,0.06533407,0.06216844,0.07029812,0.03747799,0.00084006,0.96378499,1.00000000,1.00000000,1.00000000,1.00000000,0.94494527,0.94788771,0.94064794,0.96652091,0.99728310,0.44862139,0.41729001,0.45556615,0.38252151,0.28829789,0.03696954,0.05692714,0.06645250,0.00570893,0.00364125\n\t\tTransform: -0.712102890014648,0.702035307884216,0.007536621764302,0.000000000000000,-0.068460643291473,-0.058750815689564,-0.995922684669495,0.000000000000000,-0.698729634284973,-0.709715068340302,0.089898280799389,0.000000000000000,2.513904094696045,1.970259428024292,-0.323145449161530,1.000000000000000\n\t\tTransformLink: -0.712102353572845,-0.698729574680328,0.068460568785667,0.000000000000000,0.702034652233124,-0.709714829921722,0.058750718832016,0.000000000000000,0.007536598015577,0.089898340404034,0.995922267436981,0.000000000000000,0.409402072429657,3.183911323547363,0.033970266580582,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-forearm_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1333,1335,1336,1337,1342,1413,1414,1415,1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429,1430\n\t\t,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1450,1451,1452,1453,1454\n\t\t,1455,1456,1463,1532,1535,1538,1557,1559,1561,1562,1563,1564,1565,1566,1568,1569,1570,1571,1572,1573,1598,1603,1604\n\t\t,1605,1607,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1625,1626,1627,1628,1629\n\t\t,1630,1631,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,1642,1643,1644,1645,1646,1647,1648,4343,4344,4345,4346\n\t\t,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,4361,4362,4363,4364,4365,4366,4367,4368,4369\n\t\t,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,4392\n\t\t,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415\n\t\t,4416,4417,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4434,4435,4436,4437,4438\n\t\t,4439,4440,4441,4442,4443,4444,4445,4446,4447,4448,4449,4450,4451,4452,4453,4454,4455,4456,4457,4458,4459,4460,4461\n\t\t,4462,4463,4464,4465,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484\n\t\t,4485,4486,4487,4488,4489,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507\n\t\t,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530\n\t\t,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553\n\t\t,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4570,4571,4572,4573,4574,4575,4576\n\t\t,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,4596,4597,4598,4599\n\t\t,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,6665,6666,6667,6668,6669,6670,6671,6672,6673,6675\n\t\t,6676,6677,6678,6679,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713\n\t\t,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736\n\t\t,6737,6738,6739,6740,6741,6742,6743,6744,6745,6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,6758,6759\n\t\t,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,6782\n\t\t,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805\n\t\t,6806,6807,6808,6809,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828\n\t\t,6829,6830,6831,6832,6833,6834,6835,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851\n\t\t,6852,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874\n\t\t,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952\n\t\t,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964\n\t\tWeights: 0.00280518,0.07097800,0.00000295,0.01830505,0.08747950,0.46369733,0.61657105,0.60660088,0.69984737,0.69831956,0.68239151,0.52724242,0.44391626,0.44391628,0.44391629,0.44391626,0.44391627,0.43068113,0.55751856,0.62838299,0.66239084,0.40278868,0.42483556,0.47094920,0.50165876,0.52235443,0.53156064,0.52091865,0.43576351,0.28414957,0.32323720,0.36299622,0.41781015,0.35588084,0.29372180,0.52582859,0.53068268,0.51630380\n\t\t,0.28524859,0.05523395,0.11841125,0.27933228,0.07543414,0.06779956,0.05905748,0.03236969,0.09352597,0.12124737,0.11531197,0.02898623,0.02879688,0.14548459,0.00105116,0.18621960,0.35440444,0.41601574,0.18158434,0.40303430,0.38646552,0.40031914,0.66942846,0.51238102,0.24045230,0.40872549,0.40539555,0.12124737,0.05478410,0.02603194,0.46224534,0.48878179,0.13720958,0.53285329,0.54411604,0.53209509,0.54268602,0.59210930\n\t\t,0.58824016,0.52701147,0.55444608,0.58920980,0.60121297,0.54719479,0.56161367,0.60701467,0.53579482,0.56539163,0.59471300,0.53205685,0.57737184,0.55593710,0.58617024,0.25487111,0.18904971,0.17592223,0.15584490,0.17672831,0.20343947,0.25663477,0.27554494,0.30358368,0.34143417,0.33757260,0.34642600,0.45092083,0.46637048,0.45866488,0.44954366,0.43906482,0.41397928,0.43144923,0.34029667,0.22790067,0.10745445,0.21554257\n\t\t,0.44540799,0.24217342,0.12014522,0.08990294,0.45859969,0.43048672,0.18128791,0.07032069,0.19756337,0.38935460,0.19335471,0.06940236,0.08218890,0.38449585,0.47532028,0.21642786,0.11970498,0.21301899,0.33593641,0.21858914,0.11226612,0.12232198,0.33098271,0.36519969,0.22023971,0.11687452,0.22043549,0.37653591,0.22327786,0.12106993,0.11650901,0.37626553,0.37118735,0.21677969,0.11950850,0.23124696,0.35583387,0.21417239\n\t\t,0.11680912,0.12360926,0.39721439,0.34963298,0.85869509,0.75526291,0.87720560,0.92421019,0.83845562,0.73267585,0.78452760,0.93483096,0.91342885,0.91216499,0.83177196,0.90121973,0.96245313,0.90964943,0.83987010,0.80948699,0.95588827,0.95383692,0.80389082,0.68134367,0.78513885,0.88086944,0.83589262,0.73021978,0.66365278,0.86428636,0.90558898,0.79909374,0.70860469,0.80674022,0.88021601,0.79418613,0.69896472,0.71520925\n\t\t,0.88368671,0.87160516,0.81185360,0.70114017,0.81529642,0.89194196,0.81010735,0.70253104,0.70631999,0.89691912,0.88858443,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99924815,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99993527,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.87917953,0.99657744,0.92960544,0.81019999,0.84882212,0.99279356,0.97825664,0.85205664,0.78977428,0.92508590,1.00000000,0.93071786,0.73785158\n\t\t,0.94908458,1.00000000,1.00000000,0.74314469,0.72857701,1.00000000,1.00000000,1.00000000,0.70415639,0.99778651,1.00000000,1.00000000,0.69055992,0.70870222,0.84614027,1.00000000,0.80520479,0.76523413,0.91154045,1.00000000,0.99669737,0.78784761,0.64992852,0.83166211,0.90515542,0.83090413,0.78347982,0.81099902,1.00000000,0.93481159,0.78943395,0.78693697,0.43026828,0.57470801,0.49881657,0.41871743,0.43892097,0.62232635\n\t\t,0.58658255,0.47896939,0.42131994,0.58685861,0.57518463,0.58407236,0.60280758,0.56734483,0.60058062,0.60658687,0.59576014,0.59229041,0.60069264,0.62613336,0.60383426,0.59902105,0.58630492,0.59197675,0.60192007,0.59778958,0.57998163,0.58995372,0.61908053,0.63740363,0.57986615,0.60346791,0.60855043,0.65686173,0.61197555,0.59250830,0.61613890,0.61849625,0.59959753,0.60088738,0.63443120,0.64498840,0.62636838,0.58299601\n\t\t,0.62330952,0.05340846,0.05566800,0.05631417,0.05591412,0.05323749,0.05214855,0.05228563,0.05930108,0.06073225,0.00069996,0.01352114,0.05252810,0.04139617,0.01923831,0.53616361,0.53132391,0.54159073,0.56780529,0.57736343,0.58842129,0.57238905,0.49546099,0.48551525,0.72635293,0.68722636,0.65457839,0.56940079,0.59021682,0.61447823,0.41370600,0.24226738,0.12509690,0.07583227,0.20817687,0.48356527,0.09836625,0.21631552\n\t\t,0.38427860,0.12428474,0.22265307,0.35579455,0.11692943,0.21894723,0.36845243,0.94474161,0.94758433,0.95356548,0.93645978,0.93944949,0.94127184,0.96188205,0.94311970,0.93568850,1.00000000,1.00000000,1.00000000,0.97087634,0.97878999,0.98872209,0.90399522,0.82241815,0.71470928,0.82481645,0.89605159,0.94472241,0.77291340,0.87106055,0.93506604,0.68381029,0.78802060,0.86225724,0.71523696,0.81074184,0.88642579,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.72384562,0.67851233,0.65241815,0.60267362,0.64583829,0.72426903,0.60684862,0.63202160,0.62034180,0.68077876,0.67649974,0.65318768,0.64060776,0.65496303,0.69513152,0.77209404,0.82193145\n\t\t,0.92388391,0.97647798,0.89842629,0.77762371,1.00000000,0.96955446,0.72746241,1.00000000,0.99774551,0.67716148,0.99954593,0.81546749,0.79266417,0.60293408,0.58221636,0.58742454,0.58881127,0.58936750,0.58978444,0.51834219,0.57232635,0.59315858,0.56694395,0.55089758,0.54808123,0.55925219,0.56303608,0.56559913,0.54272024,0.56205849,0.61859486,0.61712859,0.59164926,0.56869422,0.59347760,0.58937058,0.57922229,0.60360722\n\t\t,0.60380414,0.59414858,0.67335357,0.64621079,0.63732487,0.05505473,0.05211229,0.05935206,0.03347909,0.00271690,0.55137861,0.58270999,0.54443385,0.61747849,0.71170211,0.96303046,0.94307286,0.93354750,0.99429107,0.99635875,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99990612,0.63674839,0.73562693,0.62314020,0.62625651,0.68955758,0.55217265,0.62173437,0.58677857\n\t\t,0.29888582,0.55354857\n\t\tTransform: -0.763213157653809,0.535787284374237,-0.361162692308426,0.000000000000000,-0.063031375408173,-0.618017315864563,-0.783633887767792,0.000000000000000,-0.643065273761749,-0.575314998626709,0.505450129508972,0.000000000000000,2.401984930038452,1.112190842628479,-1.157461762428284,1.000000000000000\n\t\tTransformLink: -0.763212740421295,-0.643065392971039,0.063031345605850,0.000000000000000,0.535786628723145,-0.575314760208130,0.618016958236694,0.000000000000000,-0.361162334680557,0.505450010299683,0.783633649349213,0.000000000000000,0.819296956062317,2.769532203674316,0.068272873759270,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-hand_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1244,1245,1246,1251,1266,1268,1269,1270,1271,1280,1282,1283,1284,1285,1286,1287,1288,1295,1303,1304,1305,1306,1312\n\t\t,1322,1335,1336,1342,1413,1414,1415,1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429,1430,1431\n\t\t,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454\n\t\t,1455,1456,1463,1524,1525,1526,1527,1528,1529,1530,1531,1532,1533,1534,1535,1536,1537,1538,1539,1540,1541,1550,1551\n\t\t,1557,1560,1561,1562,1563,1564,1565,1566,1567,1568,1569,1570,1571,1572,1573,1593,1594,1595,1596,1597,1598,1599,1600\n\t\t,1601,1604,1605,1607,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1625,1626,1627\n\t\t,1628,1629,1630,1631,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,1642,1643,1644,1645,1646,1647,1648,3687,3749\n\t\t,3750,3751,3752,3753,3754,3755,3756,3767,3768,3769,3770,3771,3772,3773,3774,3775,3796,3797,3801,3802,3815,3816,3817\n\t\t,3820,3830,3831,3832,3833,3834,3835,3838,3851,3852,3853,3854,3856,3917,3919,3920,4479,4488,4523,4524,4525,4526,4527\n\t\t,4528,4529,4530,4531,4532,4534,4535,4536,4539,4540,4544,4545,4548,4549,4550,4552,4553,4554,4556,4557,4558,4559,4560\n\t\t,4561,4562,4563,4565,4566,4567,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584\n\t\t,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4606,4607\n\t\t,4608,4609,4610,4611,4612,4713,6239,6247,6248,6249,6253,6254,6255,6281,6282,6283,6284,6285,6288,6301,6302,6322,6323\n\t\t,6326,6327,6328,6333,6343,6367,6395,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830\n\t\t,6831,6832,6833,6834,6835,6837,6838,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855\n\t\t,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,7871,7874,7875,7888\n\t\t,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964\n\t\tWeights: 0.01773957,0.00295506,0.02698426,0.01206976,0.00142288,0.06390730,0.03872785,0.07892257,0.06822590,0.02005036,0.03883821,0.13451326,0.09145661,0.16189484,0.09340879,0.14720032,0.03405674,0.01706400,0.04884906,0.06949750,0.08695399,0.07056209,0.01674175,0.03396125,0.10027644,0.15830267,0.09733358,0.53630267,0.34855448,0.34875324,0.26081167,0.26524669,0.28519177,0.45400414,0.52406555,0.54410524,0.55608371,0.55608374\n\t\t,0.51226718,0.51214992,0.40714659,0.34436656,0.31190071,0.52652488,0.49772837,0.34941046,0.29850958,0.33749427,0.37285607,0.41156320,0.42322932,0.51389090,0.53678422,0.56420680,0.53833357,0.43212552,0.46085233,0.42549476,0.42488846,0.43796034,0.46935527,0.02580728,0.04682557,0.08380102,0.03262581,0.07088159,0.07617915,0.07641037,0.05025710,0.04205951,0.01056608,0.01169752,0.13722106,0.15540528,0.18427573,0.17680101\n\t\t,0.37352521,0.37378000,0.66874855,0.71866707,0.66361856,0.79731673,0.77443765,0.76916816,0.63769467,0.33378561,0.64309766,0.22821528,0.12229319,0.40303940,0.71154646,0.07136679,0.03441623,0.39969901,0.42407087,0.48268745,0.19776724,0.50515096,0.37838764,0.47576332,0.09745162,0.28584942,0.30662160,0.21220747,0.51825848,0.42164569,0.05326737,0.34515407,0.31030114,0.66587358,0.75509045,0.73848054,0.59895705,0.61770476\n\t\t,0.35568297,0.33995220,0.48446866,0.42330765,0.10631393,0.46714671,0.44822514,0.40659380,0.41431658,0.35384890,0.34602020,0.39664359,0.36607734,0.36686224,0.36640503,0.40388928,0.36574353,0.36452324,0.46420518,0.34612094,0.37405962,0.44252433,0.34437097,0.36728849,0.36386834,0.33356658,0.22665954,0.19051145,0.17512966,0.20340307,0.27301256,0.44330044,0.47209481,0.41442407,0.23767847,0.18066167,0.16408729,0.42029799\n\t\t,0.46287771,0.47406352,0.47401680,0.42687667,0.34304611,0.21375468,0.18215202,0.00167394,0.00069838,0.00134170,0.00110325,0.00008214,0.00003542,0.00006183,0.00238273,0.00030560,0.00181765,0.00075319,0.00350985,0.00199518,0.00077395,0.00023170,0.00156129,0.00393100,0.00118758,0.00009378,0.00064463,0.00119257,0.00023399,0.00004844,0.00051383,0.00176298,0.00015995,0.00345658,0.00166980,0.00127729,0.00238026,0.00627679\n\t\t,0.00382308,0.00577990,0.00027239,0.00001782,0.00021970,0.00128728,0.00074315,0.00067123,0.00189459,0.00008581,0.00075185,0.00006473,0.12082047,0.00342256,0.07039456,0.18980001,0.15117788,0.00720644,0.02174336,0.14794336,0.21022572,0.07491410,0.06928214,0.26214842,0.05091542,0.25685531,0.27142299,0.29584361,0.00221349,0.30944008,0.29129778,0.15385973,0.19479521,0.23476587,0.08845955,0.00330263,0.21215239,0.35007148\n\t\t,0.16833789,0.09484458,0.16909587,0.21652018,0.18900098,0.06518841,0.21056605,0.21306303,0.56973172,0.42529199,0.50118343,0.58128257,0.56107903,0.37767365,0.41341745,0.52103061,0.57868006,0.41314139,0.42481537,0.41592764,0.39719242,0.43265517,0.39941938,0.39341313,0.40423986,0.40770959,0.39930736,0.37386664,0.39616574,0.40097895,0.41369508,0.40802325,0.39807993,0.40221042,0.42001837,0.41004628,0.38091947,0.36259637\n\t\t,0.42013385,0.39653209,0.39144957,0.34313827,0.38802445,0.40749170,0.38386110,0.38150375,0.40040247,0.39911262,0.36556880,0.35501160,0.37363162,0.41700399,0.37669048,0.00007785,0.00026834,0.00550476,0.00529619,0.00268540,0.00029527,0.00096634,0.00228555,0.00004964,0.00038500,0.00342231,0.00141752,0.00005122,0.00001905,0.00153475,0.00029050,0.00150251,0.00143992,0.00016505,0.00320599,0.00020638,0.00654227,0.00026107\n\t\t,0.00025787,0.00029302,0.27615438,0.32148767,0.34758185,0.39732638,0.35416171,0.27573097,0.39315138,0.36797840,0.37965820,0.31922124,0.32350026,0.34681232,0.35939224,0.34503697,0.30486848,0.22790596,0.17806855,0.07611609,0.02352202,0.10157371,0.22237629,0.03044554,0.27253759,0.00225449,0.32283852,0.00045407,0.18453251,0.20733583,0.39706592,0.41778364,0.41257546,0.41118873,0.41063250,0.41021556,0.48165781,0.42767365\n\t\t,0.40684142,0.43305605,0.44910242,0.45191877,0.44074781,0.43696392,0.43440087,0.45727976,0.43794151,0.38140514,0.38287141,0.40835074,0.43130578,0.40652240,0.41062942,0.42077771,0.39639278,0.39619586,0.40585142,0.32664643,0.35378921,0.36267513,0.00019470,0.00085440,0.00411348,0.00118482,0.00009388,0.36325161,0.26437307,0.37685980,0.37374349,0.31044242,0.44782735,0.37826563,0.41322143,0.70111418,0.44645143\n\t\tTransform: 0.434550851583481,0.326211035251617,-0.839495539665222,0.000000000000000,0.750041782855988,-0.647088289260864,0.136801347136497,0.000000000000000,-0.498601317405701,-0.689103662967682,-0.525864005088806,0.000000000000000,1.047753572463989,1.107161402702332,2.270463943481445,1.000000000000000\n\t\tTransformLink: 0.434550464153290,-0.498601257801056,-0.750041544437408,0.000000000000000,0.326210469007492,-0.689103364944458,0.647087752819061,0.000000000000000,-0.839495003223419,-0.525864303112030,-0.136801257729530,0.000000000000000,1.089573621749878,2.479315757751465,0.380030453205109,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_01_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 12,13,14,18,19,22,46,47,138,139,161,166,206,214,238,330,894,934,1048,1049,1054,1055,1087\n\t\t,1203,1204,1205,1206,1207,1208,1209,1213,1214,1215,1232,1234,1235,1236,1237,1238,1239,1240,1244,1245,1246,1259,1262\n\t\t,1263,1264,1265,1266,1268,1269,1270,1276,1277,1278,1279,1281,1282,1283,1284,1285,1295,1297,1299,1300,1304,1305,1306\n\t\t,1307,1312,1313,1316,1319,1324,1329,1330,1333,1338,1340,1344,1348,1350,1351,1352,1354,1355,1360,1361,1362,1364,1365\n\t\t,1366,1369,1370,1378,1414,1415,1430,1431,1432,1436,1440,1447,1448,1450,1452,1453,1454,1457,1458,1481,1483,1488,1491\n\t\t,1493,1494,1498,1501,1503,1504,1508,1509,1511,1513,1514,1518,1519,1521,1522,1523,1525,1526,1527,1528,1529,1530,1531\n\t\t,1547,1548,1553,1556,1559,1569,1574,1577,1578,1579,1582,1583,1585,1586,1587,1588,1589,1590,1591,1602,1610,1619,1620\n\t\t,1623,1626,1635,1636,1637,1638,1639,1640,1647,1648\n\t\tWeights: 0.02726343,0.02778926,0.01053879,0.06221711,0.00475349,0.06152965,0.17301274,0.04240091,0.12137421,0.01994380,0.03702735,0.20864866,0.01457872,0.04202384,0.01267228,0.08409342,0.04661890,0.00839468,0.09432615,0.00067780,0.12371998,0.02678711,0.07262511,0.09319829,0.05668205,0.11554774,0.02930763,0.24469122,0.21490430,0.23695753,0.04659873,0.10238218,0.00143156,0.28280180,0.01508068,0.20057832,0.23331399,0.20015637\n\t\t,0.58167424,0.52320886,0.45524532,0.09796373,0.19542437,0.03097182,0.06342484,0.80839673,0.77196550,0.65879185,0.69593216,0.56604506,0.10874286,0.24909181,0.04135971,0.43802166,0.05377126,0.91873573,0.68509270,0.61443123,0.59034347,0.13038551,0.28368218,0.05567461,0.07013927,1.00000000,0.04596374,0.79835607,0.01379572,0.10493461,0.47847211,1.00000000,0.24180366,0.47064867,0.21559455,0.23987246,0.92632241,0.04190917\n\t\t,0.77191472,0.32830660,0.11887714,0.16729808,0.16567527,0.25233670,0.65054145,0.01666271,0.98247317,0.88713498,0.07922618,0.00839693,0.02951207,0.00896422,0.07821157,0.06958081,0.07697228,0.04635052,0.06165095,0.00412405,0.00274308,0.00098198,0.05102400,0.09491998,0.05352498,0.09378424,0.01692864,0.78267875,0.04597471,0.15771727,0.04956470,0.18276870,0.76042588,0.05464251,0.11233905,0.01147093,0.00077171,0.04375938\n\t\t,0.06258821,0.03949095,0.01416116,0.08963681,0.10801271,0.07045210,0.04785189,0.16778370,0.00595345,0.19356796,0.12289804,0.12188250,0.34734933,0.04619811,0.37305538,0.02667517,0.25083122,0.00056633,0.08774128,0.40002470,0.06049763,0.16895390,0.01412969,0.05470108,0.30139025,0.07015952,0.78405874,0.93693276,0.03297174,0.01948561,0.14479843,0.43440129,0.06615466,0.01678554,0.34488197,0.29934878,0.62488968,0.83342346\n\t\t,0.75849713,0.64725505,0.69847458,1.00000000,0.16882283,0.75983879,0.00765882,0.02525805,0.02823408,0.01980935,0.00363219,0.00589865,0.05429077,0.13731071,0.31592754,0.33201720,0.12836839,0.00929649,0.04851092\n\t\tTransform: 0.727384328842163,0.225528329610825,-0.648112475872040,0.000000000000000,0.496585249900818,-0.824827432632446,0.270302772521973,0.000000000000000,-0.473619788885117,-0.518457174301147,-0.711959838867188,0.000000000000000,0.582022249698639,0.625687658786774,2.589341878890991,1.000000000000000\n\t\tTransformLink: 0.727383732795715,-0.473619580268860,-0.496585220098495,0.000000000000000,0.225527822971344,-0.518456637859344,0.824826598167419,0.000000000000000,-0.648112177848816,-0.711959958076477,-0.270302712917328,0.000000000000000,1.113720536231995,2.443556785583496,0.472845971584320,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_01_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23\n\t\t,40,41,42,44,45,46,47,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79\n\t\t,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110\n\t\t,111,136,137,138,139,144,145,146,148,149,155,156,158,161,163,165,166,167,168,200,206,214,215\n\t\t,238,330,331,891,892,893,894,895,896,897,904,905,906,907,911,912,914,915,916,917,934,1046,1047\n\t\t,1048,1049,1052,1053,1054,1055,1058,1059,1060,1062,1063,1070,1071,1073,1078,1079,1087,1088,1202,1203,1204,1205,1206\n\t\t,1207,1208,1209,1210,1213,1214,1230,1232,1234,1235,1236,1237,1238,1239,1240,1244,1245,1259,1262,1263,1264,1265,1266\n\t\t,1269,1276,1278,1279,1282,1350,1352,1355,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1367,1368,1369,1370,1371\n\t\t,1373,1376,1378,1382,1408,1457,1458,1574,1577,1578,1582,1583,1585,1586,1587,1588,1602\n\t\tWeights: 0.00161756,0.05874012,0.00408890,0.82837241,0.82133845,0.70951891,0.68147232,1.00000000,0.83775740,1.00000000,1.00000000,0.89347348,0.54829217,0.98946121,1.00000000,0.65999053,0.01735746,0.40136815,0.80020586,0.63889748,0.06793428,0.93847035,0.98937281,0.86072119,1.00000000,1.00000000,0.07287831,0.56543341,0.65984146,0.89836054,0.91348255,0.98438016,1.00000000,0.88098087,0.93567294,0.96186026,1.00000000,0.88341581\n\t\t,0.68557378,0.47344232,0.64554340,0.57518131,0.29045211,0.26473036,0.22536117,0.34077215,0.20456503,0.12376892,0.05440247,0.09214514,0.31586975,0.17157073,0.37353734,0.18770163,0.21084800,0.13527506,0.08178689,0.20601332,0.80307614,0.84255127,0.93490974,0.70521456,0.40617309,0.36348853,0.34713244,0.50133981,0.83711482,0.91336156,0.93079049,0.78669797,0.06140964,0.59186584,0.84055618,0.93148905,0.89420774,0.28054442\n\t\t,0.16924601,0.72197366,0.40113053,0.43380849,0.73395237,0.88328411,0.81119915,0.30449144,0.20736692,0.35600074,0.58971800,0.06865982,0.00501832,0.26682607,0.23574657,0.02387590,0.02802344,0.13119597,0.00268076,0.03404539,0.76762209,0.72878695,0.65768767,1.00000000,1.00000000,0.94695370,1.00000000,0.95581004,0.34581663,0.15388181,0.18496735,0.06378964,0.62666444,0.33371369,0.88463824,0.87858745,0.22206912,0.04435044\n\t\t,0.61414918,0.90567385,0.97280692,0.07342644,0.60594050,0.36119799,0.78243716,0.91196968,0.25678281,0.15153599,0.75273242,0.39428595,0.44687773,0.76025757,0.87674020,0.20581947,0.32266992,0.18977876,0.02024007,1.00000000,0.76864197,0.94331795,0.88445226,0.97069237,0.57048618,0.68911017,0.28212913,0.00682293,0.02873641,0.09861835,1.00000000,0.66692594,0.98491932,0.69375372,0.76668601,0.79984363,0.25114391,0.42446876\n\t\t,0.14178603,0.01051255,0.06549044,0.93657516,0.19160327,0.21792705,0.27741549,0.16589345,0.09490989,0.04393735,0.28480097,0.08126427,0.07916435,0.03764587,0.05988630,0.01705151,0.05204884,1.00000000,1.00000000,0.98471693,0.75003126,0.69485309,0.99103578,1.00000000,0.84960680,0.92585756,0.73112070,1.00000000,0.86287382,0.95364948,0.67879957,0.01218608,0.09356288,0.04256357,0.06125557,0.08112022,0.08644373,0.16777021\n\t\t,0.56188270,0.08619556,0.38032089,0.01940046,0.65511803,0.21377146,0.04872224,0.02124752,0.10268734,0.03628609,0.22415089\n\t\tTransform: 0.733102858066559,0.098658926784992,-0.672924399375916,0.000000000000000,0.507454216480255,-0.738108813762665,0.444619417190552,0.000000000000000,-0.452825546264648,-0.667429924011230,-0.591173768043518,0.000000000000000,0.532971501350403,1.013681411743164,2.438605785369873,1.000000000000000\n\t\tTransformLink: 0.733102321624756,-0.452825397253036,-0.507454097270966,0.000000000000000,0.098658517003059,-0.667429566383362,0.738107979297638,0.000000000000000,-0.672924160957336,-0.591174125671387,-0.444619208574295,0.000000000000000,1.150265693664551,2.359544515609741,0.606503248214722,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_02_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 0,1,2,3,4,5,6,7,9,16,17,19,20,21,23,39,40,44,45,47,56,57,58\n\t\t,59,60,61,62,63,64,65,67,68,69,71,72,73,74,75,76,77,78,79,80,81,82,83\n\t\t,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106\n\t\t,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,129,130\n\t\t,131,132,135,136,137,139,143,144,145,146,147,148,149,150,151,153,154,155,156,158,161,162,163\n\t\t,164,165,167,168,182,183,184,185,186,187,188,189,190,191,890,891,892,893,902,903,905,906,907\n\t\t,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,927,928,1046,1047,1049,1052,1053\n\t\t,1055,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1068,1069,1070,1071,1072,1073,1076,1077,1078,1079,1083,1084\n\t\t,1361,1364,1365,1366,1370\n\t\tWeights: 0.94145609,0.87977473,0.98021522,1.00000000,0.17162759,0.17866155,0.29048109,0.31852768,0.01173391,0.34000947,0.90706144,0.02737055,0.36110252,0.86100003,0.01062719,1.00000000,0.13927881,0.84567455,0.43456659,0.04908856,0.05956870,0.02785245,0.09248107,0.09594239,0.06192800,0.10625137,0.10685442,0.03559844,0.06476960,0.01561984,0.08753392,0.06432706,0.03813974,0.11658419,0.31442622,0.52655768,0.35445660,0.42481869\n\t\t,0.70954789,0.73526964,0.77463883,0.65922785,0.15740309,0.35175989,0.38967512,0.23051642,0.39674206,0.36729217,0.14977232,0.36101886,0.78204488,0.87623108,0.94559753,0.90785486,0.68413025,0.82842927,0.62646266,0.81229837,0.78915200,0.86472494,0.91821311,0.79393512,0.19692386,0.15744873,0.06509026,0.29478544,0.59382691,0.63651147,0.65286756,0.49866019,0.16288518,0.08663844,0.06920951,0.21330203,0.80953997,0.74605437\n\t\t,0.69032743,0.83316281,0.67120282,0.73502787,0.81629990,0.70574766,0.31204224,0.59084913,0.55242018,0.29556024,0.52451068,0.55493733,0.48826013,0.51743990,0.03864877,0.01503487,0.02654085,0.04517929,0.05104064,0.85474446,0.40813416,0.04856715,0.06519521,0.10579226,0.71945558,0.81704404,0.34918646,0.27802634,0.59886947,0.68765275,0.52048202,0.55043002,0.68194717,0.56619151,0.26604763,0.11671589,0.04501017,0.37801687\n\t\t,0.69550856,0.06569249,0.78259191,0.41028200,0.84383607,0.22263696,0.23700140,0.20217202,0.08472221,0.12303221,0.07736837,0.21137253,0.22110138,0.19065769,0.20690712,0.96970803,0.91450786,0.23237791,0.27121305,0.00027794,0.00677991,0.04418996,0.65418337,0.84611819,0.10514310,0.36915811,0.31579038,0.81503265,0.93621036,0.10608028,0.37333556,0.66628631,0.11536176,0.12141255,0.74885374,0.78658370,0.50044519,0.60529466\n\t\t,0.04961298,0.05352344,0.21135862,0.21150583,0.87374078,0.38585082,0.02651528,0.85129040,0.39405950,0.03172407,0.07928682,0.08803032,0.74321719,0.84846401,0.36506696,0.24726758,0.60571405,0.68983116,0.51623692,0.00883740,0.02406510,0.54531483,0.55312227,0.23974243,0.67789630,0.10084687,0.39652582,0.07601802,0.78945897,0.67733008,0.21740915,0.23023467,0.00006944,0.00987436,0.00456162,0.00404704,0.00054279\n\t\tTransform: 0.766429185867310,0.053470060229301,-0.640099942684174,0.000000000000000,0.476983666419983,-0.714805543422699,0.511410176753998,0.000000000000000,-0.430201739072800,-0.697276830673218,-0.573351383209229,0.000000000000000,0.421990036964417,1.076823949813843,2.403566122055054,1.000000000000000\n\t\tTransformLink: 0.766428530216217,-0.430201500654221,-0.476983606815338,0.000000000000000,0.053469650447369,-0.697276353836060,0.714804708957672,0.000000000000000,-0.640099704265594,-0.573351681232452,-0.511409938335419,0.000000000000000,1.157519340515137,2.310473203659058,0.660771012306213,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_03_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 0,1,2,17,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,43,44,48\n\t\t,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,80,81,82,83,84,85,86,87\n\t\t,88,99,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132\n\t\t,133,134,135,136,140,141,142,143,146,147,150,151,152,153,154,157,159,160,162,164,165,168,169\n\t\t,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,890\n\t\t,891,898,899,900,901,902,903,908,909,910,913,918,919,920,921,922,923,924,925,926,927,928,1046\n\t\t,1050,1051,1052,1056,1057,1061,1064,1065,1066,1067,1068,1069,1072,1074,1075,1076,1077,1078,1080,1081,1082,1083,1084\n\t\tWeights: 0.05692634,0.06148516,0.01569588,0.07558110,0.07106568,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.08144714,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.94043130,0.97214755,0.90751893,0.90405761,0.93807200,0.89374863,0.89314558,0.96440156\n\t\t,0.84259691,0.64824011,0.61032488,0.76948358,0.60325794,0.63270783,0.85022768,0.63898114,0.01339009,0.00005156,0.19046003,0.25394563,0.30967257,0.16683719,0.32879718,0.26497213,0.18370010,0.29425234,0.68795776,0.40915087,0.44757982,0.70443976,0.47548932,0.44506267,0.51173987,0.48256010,1.00000000,0.96135123,0.98496513,0.97345915,0.95482071,1.00000000,1.00000000,0.94895936,0.08384590,1.00000000,1.00000000,1.00000000\n\t\t,0.93480479,0.01370995,0.65081354,0.31234725,0.47951798,1.00000000,0.44956998,0.31805283,1.00000000,1.00000000,1.00000000,0.62198313,0.93430751,0.01004117,0.08750411,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.77736304,0.76299860,0.79782798,0.91527779,0.87696779,0.92263163,0.78862747,0.77889862,0.80934231,0.79309288\n\t\t,0.03029197,0.05144676,1.00000000,1.00000000,1.00000000,1.00000000,0.99972206,0.99322009,0.89485690,0.63084189,0.68420962,0.89391972,0.25114626,0.21341630,0.49955481,0.39470534,0.95038702,0.94647656,1.00000000,1.00000000,1.00000000,0.78864138,0.78849417,0.08190877,1.00000000,1.00000000,0.07528316,1.00000000,0.92071318,0.63493304,0.31016884,0.48376308,0.99116260,1.00000000,0.97593490,0.45468517,0.32210370,1.00000000\n\t\t,1.00000000,0.60347418,0.92398198,0.00472156,1.00000000,1.00000000,1.00000000,0.78259085,0.76976533\n\t\tTransform: 0.786200642585754,0.049849487841129,-0.615957915782928,0.000000000000000,0.445841491222382,-0.735955297946930,0.509505510330200,0.000000000000000,-0.427918821573257,-0.675193071365356,-0.600832700729370,0.000000000000000,0.372182756662369,0.966843545436859,2.436784267425537,1.000000000000000\n\t\tTransformLink: 0.786200046539307,-0.427918612957001,-0.445841401815414,0.000000000000000,0.049849070608616,-0.675192713737488,0.735954523086548,0.000000000000000,-0.615957736968994,-0.600833058357239,-0.509505331516266,0.000000000000000,1.160149812698364,2.276170253753662,0.695936262607574,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_01_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1265,1266,1273,1274,1279,1281,1282,1283,1284,1294,1295,1302,1303,1304,1305,1306,1312,1313,1318,1319,1324,1333,1338\n\t\t,1414,1415,1416,1417,1418,1419,1427,1428,1430,1431,1432,1433,1434,1435,1436,1443,1444,1445,1447,1448,1449,1450,1454\n\t\t,1474,1481,1482,1483,1484,1485,1487,1488,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505\n\t\t,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1517,1518,1519,1520,1521,1522,1523,1524,1525,1526,1527,1528\n\t\t,1529,1530,1531,1532,1533,1535,1536,1538,1550,1553,1555,1559,1560,1562,1564,1565,1566,1567,1568,1569,1570,1585,1586\n\t\t,1587,1588,1589,1591,1592,1595,1596,1597,1598,1599,1600,1601,1613,1614,1617,1618,1619,1620,1621,1623,1624,1626,1637\n\t\t,1638,1639,1640,1642,1643,1644,1645,1646,1647,1648\n\t\tWeights: 0.00634374,0.01626396,0.89042846,0.79778804,0.06462632,0.20451916,0.07436021,0.01428294,0.05699810,0.71922962,0.59751596,0.97764789,0.88228129,0.81135105,0.65681982,0.21291110,0.37644499,0.22525015,1.00000000,0.63072743,0.06299900,0.66888822,0.63925273,0.03213138,0.04366390,0.03934097,0.03643375,0.03241672,0.01875345,0.01129712,0.02570845,0.00460424,0.08472037,0.14630668,0.14015130,0.09558329,0.06751815,0.04166463\n\t\t,0.00330120,0.02402000,0.04573586,0.13380947,0.78878847,0.91619898,0.53032464,0.01356214,0.01898809,0.01766159,0.00147880,0.01946608,0.05320175,0.01372269,0.00354604,0.04159124,0.06369984,0.02748962,0.05950392,0.07733743,0.05556545,0.06411819,0.05438218,0.08323220,0.01838361,0.05295715,0.10209084,0.06344183,0.09043153,0.11944237,0.10773702,0.20346520,0.12662954,0.14768009,0.08899853,0.17288579,0.16252905,0.09306144\n\t\t,0.14950240,0.23722564,0.27378504,0.69842446,0.35091943,0.29501633,0.22254300,0.73566687,0.23009501,0.25957978,0.25257937,0.85993597,0.80215084,0.61817287,0.17262444,0.49230747,0.11072555,0.23962417,0.03690297,0.28105584,0.09825565,0.12387621,0.02929742,0.04782753,0.06545550,0.21594126,0.92743700,0.78080866,0.60030099,0.01800752,0.05211038,0.23514684,0.11497794,0.90254838,0.04472212,0.16151177,0.54734023,0.14373179\n\t\t,0.06123405,0.05661876,0.11475301,0.26253527,0.83117717,1.00000000,0.06306361,0.15744407,0.15441444,0.30721188,0.32676575,0.64431703,0.65856994,0.05404180,0.06573964,0.04392796,0.00011791,0.02365788,0.04440871,0.01388980,0.06867808,0.03122738,0.07462501,0.00850720,0.05455794,0.14555002,0.36111832,0.00942649,0.03708564,0.07341377,0.13405851,0.24297462,0.34549960,0.42904039\n\t\tTransform: -0.870748043060303,-0.388418734073639,-0.301544696092606,0.000000000000000,0.468064934015274,-0.842654526233673,-0.266175031661987,0.000000000000000,-0.150710031390190,-0.372913986444473,0.915544569492340,0.000000000000000,1.537466287612915,0.926158785820007,-2.036096096038818,1.000000000000000\n\t\tTransformLink: -0.870747566223145,-0.150710523128510,-0.468064606189728,0.000000000000000,-0.388418793678284,-0.372913658618927,0.842653930187225,0.000000000000000,-0.301544249057770,0.915544331073761,0.266175329685211,0.000000000000000,1.084509491920471,2.441226005554199,0.481160879135132,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_02_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 768,769,770,771,772,773,789,791,792,800,801,802,803,804,805,806,807,808,809,810,811,812,813\n\t\t,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836\n\t\t,837,838,839,846,847,848,852,853,854,855,856,858,859,863,864,865,866,880,881,882,883,884,885\n\t\t,886,887,888,889,1265,1273,1274,1279,1281,1282,1294,1295,1302,1303,1304,1305,1306,1312,1313,1319,1338,1464,1465\n\t\t,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477,1478,1479,1480,1481,1482,1483,1484,1485,1486,1487,1488\n\t\t,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511\n\t\t,1512,1513,1514,1515,1516,1517,1518,1519,1520,1521,1522,1523,1524,1525,1526,1527,1528,1555,1585,1586,1587,1588,1589\n\t\tWeights: 0.65945069,0.61694024,0.73841649,0.67713996,0.64938770,0.65790659,0.70279332,0.67333961,0.00025453,0.03264053,0.01733417,0.04386812,0.04600513,0.00431579,0.04624756,0.05235329,0.05606800,0.13152168,0.13639977,0.14132576,0.08111216,0.17005057,0.14722046,0.09431190,0.17378731,0.84357383,0.82495235,0.86900585,0.83805498,0.84400269,0.92245426,0.89068337,0.84889188,0.34289924,0.33992602,0.38382900,0.31637607,0.35976487\n\t\t,0.34830421,0.27799338,0.34766006,0.20334884,0.20952232,0.25042403,0.17047480,0.26135615,0.20340595,0.12934108,0.21179634,0.02253572,0.00970722,0.64478435,0.04249270,0.83567254,0.16736133,0.33997653,0.22580491,0.26235992,0.38285273,0.18411080,0.04138101,0.84169498,0.66028533,0.10520420,0.08505110,0.12808884,0.08610094,0.04197962,0.05653649,0.09206788,0.08885957,0.11227760,0.11434247,0.01104415,0.10957154,0.20221196\n\t\t,0.07405551,0.18104961,0.05320896,0.28077038,0.31528077,0.02235211,0.06886964,0.10535574,0.13788989,0.13741942,0.33474846,0.25502120,0.12940011,0.24187014,0.93268214,0.92180728,0.94314713,0.92741907,0.93799442,1.00000000,0.97579933,0.93778750,0.92880573,0.93222808,0.95530496,0.97510816,1.00000000,0.98735235,0.99247220,1.00000000,1.00000000,0.96265097,0.97032486,0.95897639,0.94575807,0.98627731,1.00000000,0.99645396\n\t\t,0.91464938,1.00000000,1.00000000,0.87371195,0.97022165,0.90100513,0.90850141,0.94443455,0.93588181,0.94561782,0.82713099,0.98161639,0.94704285,0.78989645,0.93655817,0.83911637,0.83270574,0.89226298,0.79653480,0.87337046,0.68453621,0.90504802,0.82711421,0.64390300,0.90693856,0.72759956,0.64089186,0.72621496,0.30157554,0.64908057,0.35763435,0.73125890,0.26433313,0.39684961,0.71374505,0.49658941,0.00284297,0.04187755\n\t\t,0.06747017,0.05738766,0.01654992,0.07256300,0.17965469,0.08409496,0.07234334,0.13034130,0.03899014\n\t\tTransform: 0.888905286788940,-0.315152317285538,0.332456171512604,0.000000000000000,-0.438429296016693,-0.795633137226105,0.418029308319092,0.000000000000000,0.132769703865051,-0.517347037792206,-0.845413982868195,0.000000000000000,-1.496748208999634,1.130333423614502,1.919867515563965,1.000000000000000\n\t\tTransformLink: 0.888904690742493,0.132770121097565,0.438428938388824,0.000000000000000,-0.315152287483215,-0.517346441745758,0.795632183551788,0.000000000000000,0.332455724477768,-0.845413625240326,-0.418029427528381,0.000000000000000,1.048422694206238,2.406579732894897,0.559449195861816,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_03_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790\n\t\t,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813\n\t\t,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836\n\t\t,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859\n\t\t,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882\n\t\t,883,884,885,886,887,888,889,1464,1465,1466,1467,1468,1470,1471,1472,1473,1474,1475,1477,1478,1481,1482,1483\n\t\t,1484,1492\n\t\tWeights: 0.34054931,0.38305976,0.26158351,0.32286004,0.35061230,0.34209341,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.29720668,1.00000000,0.32666039,0.99974547,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.96735947,0.98266583,0.95613188,0.95399487,0.99568421,0.95375244\n\t\t,0.94764671,0.94393200,0.86847832,0.86360023,0.85867424,0.91888784,0.82994943,0.85277954,0.90568810,0.82621269,0.15642617,0.17504765,0.13099415,0.16194502,0.15599731,0.07754574,0.10931663,0.15110812,0.65710076,0.66007398,0.61617100,0.68362393,0.64023513,0.65169579,0.72200662,0.65233994,0.79665116,0.79047768,0.74957597,0.82952520,0.73864385,0.79659405,0.87065892,0.78820366,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,0.97746428,0.99029278,0.35521565,1.00000000,1.00000000,1.00000000,0.95750730,0.16432746,0.83263867,0.66002347,0.77419509,1.00000000,0.73764008,0.61714727,1.00000000,1.00000000,1.00000000,0.81588920,0.95861899,0.15830502,0.33971467,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.89479580,0.91494890\n\t\t,0.87191116,0.91389906,0.95802038,0.94346351,0.90793212,0.91114043,0.88772240,0.88565753,0.06731786,0.07819272,0.05685287,0.07258093,0.06200558,0.02420067,0.06221250,0.07119427,0.06777192,0.02570695,0.02489184,0.01264765,0.00752780,0.00821651,0.02819634,0.02078583,0.00104018,0.00228873\n\t\tTransform: 0.872855961322784,-0.286081403493881,0.395323365926743,0.000000000000000,-0.455798059701920,-0.767295718193054,0.451116681098938,0.000000000000000,0.174273252487183,-0.573947608470917,-0.800133466720581,0.000000000000000,-1.589325189590454,1.176856517791748,1.768730401992798,1.000000000000000\n\t\tTransformLink: 0.872855424880981,0.174273669719696,0.455797731876373,0.000000000000000,-0.286081403493881,-0.573946952819824,0.767294764518738,0.000000000000000,0.395322918891907,-0.800133168697357,-0.451116770505905,0.000000000000000,1.024708151817322,2.367650508880615,0.619318783283234,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_02_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 9,12,13,18,19,46,47,67,138,161,166,200,203,204,205,206,210,214,215,233,238,239,263\n\t\t,330,331,353,358,398,406,430,522,894,897,933,934,973,1054,1055,1073,1087,1088,1093,1126,1203,1207,1208\n\t\t,1209,1210,1211,1212,1213,1214,1215,1216,1219,1220,1232,1235,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1249\n\t\t,1250,1251,1263,1264,1265,1266,1267,1268,1269,1270,1271,1275,1276,1277,1279,1282,1283,1284,1285,1286,1287,1296,1299\n\t\t,1300,1305,1306,1312,1313,1315,1316,1317,1322,1323,1324,1325,1326,1327,1328,1329,1330,1331,1332,1339,1340,1341,1344\n\t\t,1345,1347,1348,1349,1350,1351,1352,1353,1354,1355,1360,1361,1364,1366,1368,1370,1371,1373,1374,1376,1377,1378,1381\n\t\t,1382,1406,1408,1430,1436,1439,1440,1447,1451,1452,1453,1454,1455,1457,1458,1459,1526,1527,1528,1529,1530,1531,1534\n\t\t,1537,1543,1544,1547,1548,1549,1552,1556,1574,1575,1576,1577,1578,1579,1583,1585,1587,1588,1602,1634,1635,1636,1637\n\t\t,1638,1639\n\t\tWeights: 0.05543605,0.03532327,0.14155649,0.21906759,0.06639138,0.10963704,0.01014999,0.00328252,0.03806961,0.05397654,0.27321003,0.00368191,0.05179180,0.08284853,0.02499093,0.20597624,0.03751639,0.21558067,0.03308870,0.03159851,0.24829934,0.05135961,0.00041936,0.45183463,0.05663866,0.02457596,0.14622008,0.00748465,0.01367746,0.00900644,0.04947731,0.10674036,0.00878193,0.07297462,0.18603301,0.03310855,0.27957897,0.07173845\n\t\t,0.00335980,0.35053197,0.05453910,0.07284664,0.02990207,0.08162642,0.12957026,0.07900047,0.35301675,0.19673595,0.26160096,0.17613478,0.45601616,0.51924291,0.35449663,0.07432701,0.03634398,0.11091423,0.05027226,0.08649339,0.15249180,0.05232238,0.32349042,0.78603718,0.66317942,0.85917843,0.59843750,0.57414915,0.34620016,0.08567946,0.03418030,0.05686069,0.14630621,0.01010745,0.06379266,0.12078650,0.29162995,0.94031168\n\t\t,0.62221229,0.55960330,0.46611393,0.17118494,0.23395752,0.22321257,0.89412039,0.09706111,0.20560329,0.59643116,0.50539741,0.48418277,0.06574677,0.17966674,0.16474930,0.91041179,0.20164393,0.01340168,0.10063528,0.03026114,0.04907998,0.79136227,0.78440545,0.06674075,0.05837368,0.70552675,0.01067859,0.23139191,0.24648163,0.07420139,0.00736484,0.75728449,0.22808528,0.08197988,0.25593450,0.45650827,0.78023353,0.23779706\n\t\t,0.83432473,0.81446515,0.07405345,0.74766330,0.78127315,0.28957225,0.96121548,0.00047532,0.00135051,0.11286502,0.78440472,0.08571409,0.10778905,0.04328718,0.10045480,0.05159758,0.12184639,0.14258123,0.09491005,0.01691191,0.03414353,0.08773668,0.17259276,0.05446599,0.13646695,0.00025533,0.07559617,0.02180784,0.00555830,0.00142565,0.01810658,0.00247056,0.19357100,0.64907464,0.64141327,0.14338520,0.05796677,0.46184128\n\t\t,0.18497618,0.07365859,0.04233995,0.19316220,0.05467113,0.31565009,0.02915055,0.13092181,0.04917707,0.00686329,0.01095669,0.26181342,0.69860975,0.87474058,0.08688264,0.77967196,0.06306724,0.55993831,0.05386246,0.11833594,0.14788705,0.52630833,0.32765591,0.38189136,0.00300159,0.00985343,0.07136454,0.01601032,0.02237722,0.06376775,0.11450163,0.11575670,0.05040188,0.00419851\n\t\tTransform: 0.485367596149445,0.306903839111328,-0.818675279617310,0.000000000000000,0.684995472431183,-0.715370893478394,0.137935832142830,0.000000000000000,-0.543323040008545,-0.627738296985626,-0.557444989681244,0.000000000000000,1.080369114875793,0.854615509510040,2.343411684036255,1.000000000000000\n\t\tTransformLink: 0.485367119312286,-0.543322980403900,-0.684995293617249,0.000000000000000,0.306903332471848,-0.627737939357758,0.715370297431946,0.000000000000000,-0.818674743175507,-0.557445168495178,-0.137935787439346,0.000000000000000,1.131832003593445,2.429787635803223,0.451921582221985,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_01_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 9,12,13,18,19,46,64,67,161,166,196,197,198,199,200,201,202,203,204,205,206,207,208\n\t\t,210,211,212,214,215,232,233,234,237,238,239,256,257,258,259,260,261,262,263,264,265,266,267\n\t\t,268,270,271,280,281,283,284,285,286,287,288,291,292,293,294,295,296,297,298,299,300,301,302\n\t\t,303,329,330,331,336,337,338,340,341,347,348,350,353,355,357,358,359,392,395,398,406,407,430\n\t\t,452,522,523,528,894,897,931,932,933,934,935,936,943,944,945,946,950,953,954,955,956,973,974\n\t\t,1054,1055,1073,1086,1087,1088,1092,1093,1094,1097,1098,1099,1101,1102,1109,1110,1112,1117,1118,1126,1127,1136,1203\n\t\t,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1219,1220,1235,1238,1240,1241,1242,1243,1244,1245,1246,1251,1266\n\t\t,1267,1268,1269,1270,1275,1276,1296,1323,1339,1355,1359,1360,1361,1364,1366,1368,1370,1371,1372,1373,1374,1375,1376\n\t\t,1377,1378,1381,1382,1383,1386,1387,1389,1391,1396,1405,1406,1407,1408,1457,1458,1574,1576,1577,1578,1579,1583\n\t\tWeights: 0.09507264,0.04393982,0.28236208,0.31734715,0.10127873,0.05750876,0.02174785,0.02820268,0.05278678,0.16214057,0.29646993,0.48476735,0.43236731,0.37443072,0.97398660,0.92435260,1.00000000,0.94820820,0.86347065,0.64164546,0.51261897,1.00000000,0.41910865,0.54296718,0.88121995,0.42497966,0.50664892,0.90943431,0.29141160,0.96840149,1.00000000,0.44247613,0.56368318,0.87501341,0.92096368,0.99286402,1.00000000,0.88757888\n\t\t,0.91355734,0.93490071,1.00000000,0.88300704,0.09559362,0.29116527,0.14882410,0.25787803,0.18602321,0.10708243,0.15189769,0.06125359,0.02885524,0.00891758,0.03061469,0.00053438,0.12047902,0.08066924,0.04539852,0.05921332,0.66117454,0.69926653,0.82522031,0.61029516,0.30347502,0.25025424,0.19650062,0.10704576,0.69152621,0.81951736,0.78495184,0.63585369,0.41995619,0.30677209,0.88330519,0.88956514,0.17178712,0.05487601\n\t\t,0.61773962,0.27475971,0.30936843,0.60159463,0.87672242,0.85869261,0.17764585,0.06475378,0.49657170,0.43709448,0.05897444,0.04689052,0.27497185,0.31858762,0.06692545,0.03901748,0.01377797,0.16656661,0.04489005,0.00591389,0.18895307,0.04426438,0.50311281,0.32816146,0.62194130,0.58350319,1.00000000,1.00000000,0.96465415,0.95268295,0.07708826,0.04423025,0.00962342,0.23221405,0.13997014,0.74582018,0.76104358,0.23888499\n\t\t,0.01608883,0.23550305,0.08731321,0.01905313,0.41320769,0.38706416,0.87879427,0.41958228,0.52530097,0.87403655,0.89980734,0.14188639,0.04618923,0.63154596,0.26794593,0.29687244,0.62138721,0.87371223,0.06188576,0.15855254,0.23681216,0.06300818,0.01696733,0.05653332,0.05525235,0.01698506,0.12789659,0.79644113,0.63252280,0.82386522,0.26780421,0.21276917,0.24451969,0.06167050,0.02229457,0.09344066,0.01917458,0.01469005\n\t\t,0.05737808,0.21396282,0.25121904,0.13679224,0.07878626,0.07339214,0.06352037,0.01208995,0.01126267,0.03769170,0.02873193,0.02814819,0.01091356,0.02478558,0.05396479,0.12724522,0.09345265,0.27029604,0.08432027,0.01528307,0.15585772,0.16777635,0.01902009,0.08740517,0.08552860,0.13716030,0.75376941,1.00000000,0.81152707,0.79996401,0.93038545,0.92329289,0.73361845,0.74649335,0.75015713,0.78241282,0.11412329,0.13854458\n\t\t,0.13180007,0.07226109,0.06460730,0.01256806,0.87151413,0.99974467,1.00000000,0.83796011,0.31574601,0.14080206,0.13086814,0.05445643,0.03739078,0.15178776,0.12626493,0.09420941\n\t\tTransform: 0.480655610561371,0.280683368444443,-0.830775499343872,0.000000000000000,0.761002123355865,-0.604247510433197,0.236138150095940,0.000000000000000,-0.435713678598404,-0.745722711086273,-0.504034996032715,0.000000000000000,0.879204034805298,1.056297898292542,2.289678812026978,1.000000000000000\n\t\tTransformLink: 0.480655163526535,-0.435713648796082,-0.761001825332642,0.000000000000000,0.280682921409607,-0.745722472667694,0.604247033596039,0.000000000000000,-0.830774903297424,-0.504035234451294,-0.236138045787811,0.000000000000000,1.183128952980042,2.324865102767944,0.571491241455078,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_02_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 192,193,194,195,196,197,198,199,200,201,208,209,211,212,213,215,231,232,236,237,239,243,248\n\t\t,249,250,251,252,253,254,255,256,257,259,260,261,263,264,265,266,267,268,269,270,271,272,273\n\t\t,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296\n\t\t,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319\n\t\t,322,323,324,327,328,329,331,335,336,337,338,339,340,341,342,343,345,346,347,348,350,353,354\n\t\t,355,356,357,359,360,374,375,376,377,378,379,380,381,382,383,929,930,931,932,941,943,944,945\n\t\t,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,966,967,1085,1086,1088,1091\n\t\t,1092,1094,1096,1097,1098,1099,1100,1101,1102,1103,1104,1108,1109,1110,1111,1112,1115,1116,1117,1118,1122,1123\n\t\tWeights: 0.94874555,0.93624057,1.00000000,1.00000000,0.70353007,0.51523265,0.56763269,0.62556928,0.01731317,0.03950278,0.58089135,0.92561906,0.05888090,0.57502034,0.91179972,0.03360109,1.00000000,0.70858840,0.89174255,0.55752387,0.06342888,0.00938075,0.06752584,0.03126823,0.06971123,0.11700655,0.08576452,0.13023014,0.06699836,0.04878864,0.07903632,0.00713598,0.10546885,0.08644266,0.06509929,0.11657360,0.90440638,0.70883473\n\t\t,0.85117590,0.74212197,0.81397679,1.00000000,0.89291757,0.84810231,0.19991603,0.29408675,0.40352396,0.31381941,0.39408239,0.31696735,0.23595807,0.30322309,0.91318152,0.97114476,1.00000000,0.99108242,0.96938531,0.99946562,0.87952098,0.91933076,0.95460148,1.00000000,1.00000000,0.92872957,0.33882546,0.30073347,0.17477969,0.38970484,0.69652498,0.74974576,0.80349938,0.89295424,0.30847379,0.18048264,0.21504816,0.36414631\n\t\t,0.84859787,0.78143628,0.73189984,0.93016179,0.65202453,0.78442221,0.89083985,0.72403747,0.51458836,0.62525445,0.59229621,0.75489021,0.43993503,0.59709595,0.71077631,0.52835836,0.03469645,0.01985454,0.04679365,0.00131438,0.88776761,0.58004381,0.05737539,0.06531842,0.11043486,0.82821288,0.92681182,0.29532401,0.38226038,0.72524029,0.66761740,0.44252874,0.46683389,0.66153344,0.69063157,0.39840537,0.12218010,0.06264691\n\t\t,0.32446621,0.82235415,0.08058228,0.90954785,0.56290552,0.89383338,0.25642174,0.25969736,0.18544033,0.10435513,0.17683847,0.09420923,0.17767137,0.16244678,0.17725214,0.20292373,0.97564801,0.96680719,0.49688719,0.67183854,0.01451821,0.03534585,0.04731705,0.92291174,0.95576975,0.06393426,0.37220194,0.26389039,0.99037658,1.00000000,0.11917062,0.76778595,0.86002986,0.25417982,0.23895642,0.82475823,0.82712021,0.52035342\n\t\t,0.65135678,0.05358960,0.00515429,0.23152128,0.12808721,0.90301542,0.58679231,0.04642655,0.89740250,0.58041772,0.06535003,0.06828878,0.10019266,0.85811361,0.94847389,0.30347302,0.36845404,0.73205407,0.70093302,0.50719769,0.56378400,0.70312756,0.37861279,0.70727217,0.11906863,0.36890030,0.09631332,0.91642272,0.84144746,0.18270814,0.23370347\n\t\tTransform: 0.465369999408722,0.137334629893303,-0.874397277832031,0.000000000000000,0.741639018058777,-0.599716007709503,0.300521045923233,0.000000000000000,-0.483117848634720,-0.788340270519257,-0.380942046642303,0.000000000000000,0.993117451667786,1.250935077667236,2.102986335754395,1.000000000000000\n\t\tTransformLink: 0.465369552373886,-0.483117789030075,-0.741638600826263,0.000000000000000,0.137334287166595,-0.788340091705322,0.599715530872345,0.000000000000000,-0.874396800994873,-0.380942285060883,-0.300520896911621,0.000000000000000,1.204881906509399,2.267071485519409,0.618320465087891,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_03_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 192,193,209,213,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,235,236,240,241\n\t\t,242,243,244,245,246,247,248,249,250,251,252,253,254,255,272,273,274,275,276,277,278,279,280\n\t\t,291,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325\n\t\t,326,327,328,332,333,334,335,338,339,342,343,344,345,346,349,351,352,354,356,357,360,361,362\n\t\t,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,929,930\n\t\t,937,938,939,940,941,942,947,948,949,952,957,958,959,960,961,962,963,964,965,966,967,1085,1089\n\t\t,1090,1091,1095,1096,1099,1100,1103,1104,1105,1106,1107,1108,1111,1113,1114,1115,1116,1117,1119,1120,1121,1122,1123\n\t\tWeights: 0.05125445,0.06375943,0.07438094,0.08820028,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.10825745,1.00000000,1.00000000,1.00000000,0.99061925,1.00000000,1.00000000,1.00000000,1.00000000,0.93247416,0.96873177,0.93028877,0.88299345,0.91423548,0.86976986,0.93300164,0.95121136,0.80008397\n\t\t,0.70591325,0.59647604,0.68618059,0.60591761,0.68303265,0.76404193,0.69677691,0.02556488,0.01205711,0.15140213,0.21856372,0.26810016,0.06983821,0.34797547,0.21557779,0.10916015,0.27596253,0.48541164,0.37474555,0.40770379,0.24510979,0.56006497,0.40290405,0.28922369,0.47164164,1.00000000,1.00000000,0.96530355,0.98014546,0.95320635,1.00000000,1.00000000,0.99868562,0.11223239,1.00000000,1.00000000,1.00000000,0.93468158\n\t\t,0.01831217,0.70467599,0.33238260,0.55747126,1.00000000,0.53316611,0.33846656,1.00000000,1.00000000,1.00000000,0.67553379,0.91941772,0.02569837,0.10616662,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.74357826,0.74030264,0.81455967,0.89564487,0.82316153,0.90579077,0.82232863,0.83755322,0.82274786,0.79707627,0.02435199\n\t\t,0.03319281,1.00000000,1.00000000,1.00000000,1.00000000,0.98548179,1.00000000,0.93606574,0.62779806,0.73610961,0.88082938,0.17524177,0.17287979,0.47964658,0.34864322,0.94641040,0.99484571,1.00000000,1.00000000,1.00000000,0.76847872,0.87191279,0.09698458,1.00000000,1.00000000,0.10259750,1.00000000,0.93171122,0.00533689,0.69652698,0.29906698,0.49280231,1.00000000,1.00000000,1.00000000,0.43621600,0.29272783,1.00000000\n\t\t,1.00000000,0.63109970,0.90368668,0.02169152,1.00000000,1.00000000,1.00000000,0.81729186,0.76629653\n\t\tTransform: 0.527984440326691,0.153127893805504,-0.835335314273834,0.000000000000000,0.735434353351593,-0.574329674243927,0.359558552503586,0.000000000000000,-0.424699217081070,-0.804175198078156,-0.415852129459381,0.000000000000000,0.783626139163971,1.217510700225830,2.171735763549805,1.000000000000000\n\t\tTransformLink: 0.527983903884888,-0.424699127674103,-0.735433936119080,0.000000000000000,0.153127565979958,-0.804174959659576,0.574329257011414,0.000000000000000,-0.835334777832031,-0.415852338075638,-0.359558373689651,0.000000000000000,1.213949918746948,2.215018272399902,0.657918989658356,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_03_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 205,210,238,330,358,395,396,397,398,402,406,425,430,431,455,522,523,542,545,550,590,598,599\n\t\t,622,714,933,972,973,1012,1093,1126,1132,1133,1165,1166,1211,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222\n\t\t,1227,1228,1229,1233,1240,1242,1243,1244,1245,1246,1247,1248,1249,1250,1251,1252,1253,1256,1258,1261,1266,1267,1268\n\t\t,1269,1270,1271,1275,1277,1280,1283,1284,1285,1286,1287,1288,1289,1291,1292,1293,1296,1299,1301,1308,1311,1314,1315\n\t\t,1317,1320,1321,1322,1323,1325,1326,1327,1328,1329,1331,1332,1334,1336,1339,1340,1341,1345,1346,1347,1349,1351,1353\n\t\t,1356,1371,1374,1377,1378,1381,1383,1384,1385,1386,1389,1390,1392,1395,1396,1397,1398,1400,1410,1412,1437,1438,1439\n\t\t,1440,1441,1451,1452,1453,1455,1456,1459,1460,1461,1462,1463,1529,1531,1533,1534,1536,1537,1539,1540,1542,1543,1544\n\t\t,1546,1548,1549,1551,1552,1554,1558,1574,1575,1576,1578,1579,1580,1581,1583,1584,1594,1631,1632,1633,1634,1635,1636\n\t\t,1637\n\t\tWeights: 0.01687538,0.03746376,0.07136806,0.02610389,0.11408500,0.06059916,0.09126372,0.06129028,0.02987957,0.15300728,0.03985985,0.06536964,0.25166453,0.06036258,0.01838583,0.14727040,0.02552218,0.00762623,0.05028604,0.35254360,0.03449258,0.08301903,0.02029312,0.02321775,0.10756048,0.05241472,0.14583884,0.06368667,0.06268742,0.06730866,0.08234364,0.19656413,0.02508006,0.09261356,0.01097182,0.05228166,0.13643286,0.06391114\n\t\t,0.25932518,0.24240393,0.26999307,0.21456399,0.48687191,0.49598847,0.36606275,0.06189024,0.05179863,0.12265389,0.01252890,0.00270142,0.02210016,0.06270182,0.00402933,0.19190287,0.08858884,0.46118277,0.69777468,0.68073517,0.78642192,0.57827052,0.66335430,0.24534747,0.07959339,0.00395668,0.08328303,0.22569356,0.01846559,0.02199663,0.17640562,0.08049149,0.36241801,0.65356673,0.65487823,0.05210835,0.05480040,0.12438713\n\t\t,0.06246569,0.26679262,0.58622754,0.58143837,0.19525035,0.20742112,0.00049770,0.00178898,0.00925438,0.37050677,0.04362447,0.70646771,0.18376769,0.01001013,0.71038466,0.20863773,0.84727518,0.15657794,0.01106905,0.57284712,0.16044810,0.76749158,0.75306665,0.86817028,0.26364085,0.20080634,0.67814765,0.66340313,0.07634400,0.00001314,0.14333135,0.05246839,0.74385010,0.18553485,0.75313169,0.82062520,0.21872685,0.02212182\n\t\t,0.67048427,0.45500896,0.02450128,0.00059372,0.04057019,0.00024186,0.02003160,0.02403792,0.07248489,0.05853288,0.00525310,0.05746978,0.09340139,0.02677917,0.00334051,0.09667774,0.02263097,0.02392551,0.04870244,0.04203742,0.02767097,0.04623255,0.06043476,0.03901940,0.00882106,0.02067667,0.59043105,0.15738195,0.04035017,0.59373107,0.04605849,0.84903562,0.16883889,0.20830537,0.02824484,0.17765594,0.03089046,0.05820368\n\t\t,0.00789588,0.11615681,0.06701496,0.40879386,0.06955225,0.14480502,0.07872101,0.63159039,0.69247416,0.01695000,0.05509990,0.78539654,0.02762619,0.22032804,0.15319910,0.06375255,0.07819957,0.57200632,0.60506554,0.18767885,0.43156594,0.10731727,0.02867144,0.01077900,0.30668976,0.00600786,0.00689206,0.05747473,0.13927954,0.31610402,0.16243504,0.06777470,0.02041764\n\t\tTransform: 0.516751706600189,0.376900762319565,-0.768709421157837,0.000000000000000,0.774871289730072,-0.587715268135071,0.232735171914101,0.000000000000000,-0.364064127206802,-0.715916991233826,-0.595751821994781,0.000000000000000,0.629079878330231,1.050397038459778,2.415829420089722,1.000000000000000\n\t\tTransformLink: 0.516751170158386,-0.364064037799835,-0.774870991706848,0.000000000000000,0.376900196075439,-0.715916752815247,0.587714910507202,0.000000000000000,-0.768709123134613,-0.595752060413361,-0.232735112309456,0.000000000000000,1.136097431182861,2.420257568359375,0.432370036840439,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_01_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 201,204,205,210,211,238,239,259,350,353,358,385,388,389,390,391,392,393,394,395,396,397,398\n\t\t,399,400,401,402,403,404,405,406,407,424,425,426,428,429,430,431,448,449,450,451,452,453,454\n\t\t,455,456,457,458,459,460,461,462,463,472,473,474,475,476,477,478,479,480,481,482,483,484,485\n\t\t,486,487,488,489,490,491,492,493,494,495,520,521,522,523,528,529,530,532,533,539,540,542,545\n\t\t,547,549,550,551,552,584,587,590,598,599,622,644,645,714,715,933,970,971,972,973,974,975,982\n\t\t,983,984,985,989,990,992,993,994,995,1012,1013,1093,1094,1112,1124,1125,1126,1127,1130,1131,1132,1133,1136\n\t\t,1137,1138,1140,1141,1148,1149,1151,1156,1157,1165,1166,1175,1211,1213,1214,1215,1216,1217,1218,1219,1220,1221,1227\n\t\t,1228,1242,1244,1246,1247,1248,1249,1250,1251,1252,1271,1275,1296,1314,1322,1323,1326,1339,1356,1371,1374,1375,1377\n\t\t,1378,1381,1383,1384,1385,1386,1387,1388,1389,1390,1391,1392,1394,1395,1396,1397,1398,1400,1404,1405,1410,1412,1459\n\t\t,1460,1575,1576,1578,1579,1580,1584\n\t\tWeights: 0.03614462,0.05368082,0.31648822,0.38205266,0.05989915,0.07595369,0.01019810,0.00695227,0.00109748,0.05408452,0.24312322,0.00248992,0.80554917,0.75219133,0.63888049,0.74494059,0.94102556,0.95894711,1.00000000,0.89251032,0.86874943,0.55347141,0.68766393,1.00000000,0.72479341,0.00431006,0.45561456,0.91334736,0.60128697,0.02128394,0.62787507,0.92620007,0.80572895,0.93463036,1.00000000,0.05134795,0.66758223,0.60641082\n\t\t,0.89887895,0.95072304,1.00000000,1.00000000,0.92402345,0.94747373,0.98537189,1.00000000,0.90776519,0.49657050,0.43036733,0.46877255,0.39636807,0.38720993,0.17434018,0.34116344,0.28694288,0.28569448,0.18494238,0.04299247,0.15307906,0.20227544,0.17492840,0.24063076,0.32970361,0.14090396,0.07735427,0.04903726,0.20054226,0.84356915,0.87821847,0.93541647,0.75925530,0.58139398,0.60444276,0.59610651,0.51697424,0.82523975\n\t\t,0.89625688,0.93567348,0.76400491,0.03587582,0.68034259,0.63668568,0.89606101,0.92224832,0.38168434,0.24987968,0.78328164,0.58330886,0.58310881,0.75040449,0.89732000,0.84999870,0.41125272,0.28160763,0.33406923,0.66736080,0.04940720,0.09484002,0.01684258,0.28687144,0.24874543,0.10758113,0.00391586,0.04523428,0.03795677,0.11414175,0.00796427,0.25266935,0.68490533,0.79286046,0.67728154,0.66431979,0.98391117,0.99994729\n\t\t,1.00000000,0.97865336,0.21409456,0.33185210,0.10251885,0.11599437,0.41569785,0.63487440,0.91131055,0.86804267,0.17034469,0.02267780,0.33454373,0.06061343,0.00721914,0.01565341,0.70017942,0.65094214,0.91038366,0.03518223,0.62359977,0.47355103,0.86962252,0.92043663,0.35668460,0.20744938,0.80848075,0.59085527,0.53119035,0.74496456,0.90253953,0.26423607,0.38377343,0.17088566,0.05445640,0.00342372,0.05359457,0.06441164\n\t\t,0.00307625,0.14022694,0.62159856,0.64920957,0.78543601,0.29725066,0.26264795,0.23290100,0.00372270,0.08290731,0.02289973,0.00465752,0.04149831,0.21654586,0.22977220,0.17273722,0.07145797,0.06397253,0.05291199,0.00228211,0.08637867,0.33749870,0.07193170,0.00812332,0.04057250,0.00045172,0.12986434,0.27815023,0.06696200,0.18253036,0.06961455,0.13807468,0.01529241,0.17534528,0.86183879,0.79710750,0.78987358,0.85620232\n\t\t,0.86819993,1.00000000,0.86760573,0.80284059,0.93539270,0.92219629,0.12899728,0.99665949,0.86633132,0.97736903,0.84531267,0.09213591,0.08312205,0.12848587,0.14752166,0.04671105,0.05488066,0.07328411,0.13865674,0.13027466,0.04866994,0.08828888,0.03185602,0.11596411\n\t\tTransform: 0.494621217250824,0.461883515119553,-0.736216068267822,0.000000000000000,0.824362516403198,-0.517632782459259,0.229091972112656,0.000000000000000,-0.275275677442551,-0.720222651958466,-0.636790871620178,0.000000000000000,0.477512180805206,0.829405605792999,2.469390392303467,1.000000000000000\n\t\tTransformLink: 0.494620800018311,-0.275275617837906,-0.824362277984619,0.000000000000000,0.461882859468460,-0.720222294330597,0.517632365226746,0.000000000000000,-0.736215829849243,-0.636791229248047,-0.229091987013817,0.000000000000000,1.198728680610657,2.301290273666382,0.530033409595490,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_02_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 384,385,386,387,388,389,390,391,400,401,403,404,405,407,423,424,428,429,431,440,441,442,443\n\t\t,444,445,446,447,448,451,452,453,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469\n\t\t,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492\n\t\t,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,514,520,521,523\n\t\t,527,528,529,530,531,532,533,534,535,537,538,539,540,542,545,546,547,548,549,551,552,566,567\n\t\t,568,569,570,571,572,573,574,575,968,969,970,971,983,984,985,986,987,988,989,990,991,992,993\n\t\t,994,995,996,997,998,999,1000,1005,1006,1124,1125,1127,1130,1131,1133,1135,1136,1137,1138,1139,1140,1141,1142\n\t\t,1143,1147,1148,1149,1150,1151,1154,1155,1156,1157,1161,1162,1389,1390,1396\n\t\tWeights: 1.00000000,0.98618748,1.00000000,1.00000000,0.19445083,0.24780867,0.36111951,0.25505941,0.27520659,0.97837101,0.03097913,0.39871303,0.93084852,0.00687448,1.00000000,0.19427105,0.89787644,0.33241777,0.03985555,0.06668096,0.05463153,0.06261275,0.07586154,0.07117190,0.07607099,0.06398856,0.03640543,0.04927696,0.07246222,0.03874831,0.01462811,0.07384899,0.50342950,0.56963267,0.53122745,0.60363193,0.61279007,0.82565982\n\t\t,0.65883656,0.71305712,0.28367903,0.30527095,0.34985775,0.31318633,0.34524222,0.29790888,0.28949781,0.47196338,0.71430552,0.81505762,0.95700753,0.84692094,0.79772456,0.82507160,0.75936924,0.67029639,0.85909604,0.92264573,0.95096274,0.79945774,0.15643085,0.12178153,0.06458353,0.24074470,0.41860602,0.39555724,0.40389349,0.48302576,0.17476025,0.10374312,0.06432652,0.23599509,0.93087974,0.83268831,0.76469942,0.92877401\n\t\t,0.78308777,0.85848951,0.90496623,0.80364225,0.73574263,0.64077731,0.53528087,0.73839527,0.61871223,0.62244914,0.68774178,0.52471709,0.00990516,0.91368959,0.31965741,0.03352675,0.06300897,0.07183779,0.61831566,0.75012032,0.36336190,0.21671836,0.41669114,0.76123385,0.53088427,0.60572060,0.76548764,0.41689119,0.24959551,0.08403344,0.04618199,0.39527897,0.58874728,0.06638280,0.71839237,0.33263920,0.89863249,0.20921588\n\t\t,0.18970417,0.24628856,0.11731437,0.15341388,0.12665986,0.16740230,0.15554252,0.20969717,0.23938398,1.00000000,1.00000000,0.31509467,0.20713954,0.02134664,0.78590544,0.66814790,0.05800975,0.32602050,0.31422861,0.89748115,0.88400563,0.07536548,0.58430215,0.36512560,0.08868945,0.13195733,0.90138442,0.86914824,0.69438316,0.68148907,0.00927420,0.17827030,0.14233670,0.94562140,0.29982058,0.02660815,0.91303140,0.37640023\n\t\t,0.04358862,0.06071296,0.06259605,0.64331540,0.79255062,0.31010912,0.19151925,0.40914473,0.76699737,0.52346107,0.53603807,0.46880965,0.25503544,0.76329829,0.08701244,0.35917046,0.06690372,0.73576393,0.61622657,0.17126492,0.22031875,0.00266340,0.00148590,0.00507764\n\t\tTransform: 0.532615840435028,0.147570744156837,-0.833393096923828,0.000000000000000,0.794587731361389,-0.426285594701767,0.432332456111908,0.000000000000000,-0.291463732719421,-0.892470717430115,-0.344303756952286,0.000000000000000,0.450424075126648,1.588048577308655,2.044878959655762,1.000000000000000\n\t\tTransformLink: 0.532615423202515,-0.291463643312454,-0.794587552547455,0.000000000000000,0.147570252418518,-0.892470479011536,0.426285207271576,0.000000000000000,-0.833392560482025,-0.344304144382477,-0.432332217693329,0.000000000000000,1.229935407638550,2.252629041671753,0.565006792545319,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_03_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 385,401,405,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,427,428,432,433,434\n\t\t,435,436,437,438,439,440,441,442,443,444,445,446,447,464,465,466,467,468,469,470,471,496,497\n\t\t,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520\n\t\t,524,525,526,527,531,534,535,536,537,538,541,543,544,546,548,552,553,554,555,556,557,558,559\n\t\t,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,976,977,978,979,980,981,986\n\t\t,987,988,991,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1124,1128,1129,1130,1134,1135,1139,1142,1143\n\t\t,1144,1145,1146,1147,1150,1152,1153,1154,1155,1158,1159,1160,1161,1162\n\t\tWeights: 0.01132260,0.01731892,0.04786753,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.05077561,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.93331904,0.94536847,0.93738725,0.92413846,0.92882810,0.92392901,0.93601144,0.96359457,0.71632097,0.69472905\n\t\t,0.65014225,0.68681367,0.65475778,0.70209112,0.71050219,0.52803662,0.06912026,0.16731169,0.23530058,0.07122599,0.21691223,0.14151049,0.09503377,0.19635775,0.26425737,0.35922269,0.46471913,0.26160473,0.38128777,0.37755086,0.31225822,0.47528291,1.00000000,1.00000000,0.99009484,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.05043459,1.00000000,1.00000000,1.00000000,0.93699103,0.63663810,0.23876615,0.46911573\n\t\t,1.00000000,0.39427940,0.23451236,1.00000000,1.00000000,1.00000000,0.60472103,0.93361720,0.05196030,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.79078412,0.81029583,0.75371144,0.88268563,0.84658612,0.87334014,0.83259770,0.84445748,0.79030283,0.76061602,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,0.94199025,0.67397950,0.68577139,0.92463452,0.09861558,0.13085176,0.30561684,0.31851093,0.99072580,1.00000000,1.00000000,1.00000000,1.00000000,0.82172970,0.85766330,0.03872520,1.00000000,1.00000000,0.05178637,1.00000000,0.93928704,0.68989088,0.23300263,0.47653893,1.00000000,1.00000000,1.00000000,0.46396193,0.23670171,1.00000000,1.00000000,0.64082954,0.93309628,1.00000000,1.00000000,1.00000000,0.82873508,0.77968125\n\t\tTransform: 0.529071390628815,0.308624148368835,-0.790465235710144,0.000000000000000,0.797647714614868,-0.498728394508362,0.339158624410629,0.000000000000000,-0.289554774761200,-0.809951663017273,-0.510035634040833,0.000000000000000,0.452416837215424,1.106309056282043,2.301531076431274,1.000000000000000\n\t\tTransformLink: 0.529071033000946,-0.289554744958878,-0.797647476196289,0.000000000000000,0.308623582124710,-0.809951424598694,0.498727977275848,0.000000000000000,-0.790464818477631,-0.510035991668701,-0.339158475399017,0.000000000000000,1.238485574722290,2.200919628143311,0.589705586433411,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_04_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 397,402,430,550,587,588,589,590,594,595,598,617,622,623,647,714,715,734,737,742,972,1011,1012\n\t\t,1132,1165,1166,1171,1172,1217,1219,1220,1221,1222,1223,1224,1225,1226,1227,1228,1229,1231,1233,1246,1248,1249,1250\n\t\t,1251,1252,1253,1254,1255,1256,1257,1258,1260,1261,1270,1271,1272,1280,1285,1286,1287,1288,1289,1290,1291,1292,1293\n\t\t,1298,1301,1308,1309,1310,1311,1314,1317,1320,1321,1322,1325,1327,1328,1331,1332,1334,1335,1336,1337,1341,1342,1343\n\t\t,1346,1347,1353,1356,1379,1380,1393,1399,1400,1401,1402,1403,1404,1409,1411,1412,1420,1421,1424,1425,1426,1427,1429\n\t\t,1437,1438,1439,1441,1442,1443,1444,1446,1451,1455,1456,1459,1460,1461,1462,1463,1528,1530,1531,1532,1533,1534,1535\n\t\t,1536,1537,1538,1539,1540,1541,1542,1543,1544,1545,1546,1549,1550,1551,1554,1557,1558,1561,1562,1563,1564,1566,1571\n\t\t,1572,1573,1575,1576,1579,1580,1581,1584,1593,1594,1595,1596,1597,1598,1599,1601,1603,1604,1605,1606,1607,1608,1611\n\t\t,1612,1615,1616,1618,1621,1625,1627,1628,1629,1630,1631,1632,1633,1634,1635,1636,1641,1642,1643,1644\n\t\tWeights: 0.00235983,0.02205185,0.02950411,0.09774881,0.10521982,0.08595565,0.10661135,0.01964309,0.10191913,0.01274181,0.02137607,0.08186937,0.11442043,0.03801645,0.00514620,0.11418710,0.02738894,0.00488513,0.03710416,0.09495757,0.01822922,0.08098466,0.10072303,0.05594558,0.06719732,0.01754701,0.10571016,0.02587312,0.02324112,0.07553125,0.02547583,0.15708683,0.46876310,0.28617984,0.23806261,0.21686565,0.23712472,0.20532163\n\t\t,0.20584138,0.16073116,0.22804768,0.21164098,0.02964232,0.05791324,0.00666057,0.21499529,0.09381932,0.52544818,0.74954858,0.74632183,0.64967136,0.87370539,0.42234443,0.60628709,0.86590673,0.66184792,0.04027221,0.10474031,1.00000000,0.92514923,0.03145515,0.25461689,0.09169457,0.73056002,0.79257888,0.95792530,0.89966971,0.71035879,0.99074562,0.94834529,0.29353229,0.81623231,1.00000000,0.86599240,0.98998987,0.16158080\n\t\t,0.08598407,0.84342206,0.98893095,0.28028169,0.00111651,0.05762833,0.72899431,0.23987248,0.08066237,0.92365600,0.82874556,0.84168124,0.98169495,0.01835284,0.81518692,1.00000000,0.24686831,0.10532135,0.32816522,0.13500840,0.04209869,0.01092262,0.02685870,0.05870253,0.03598969,0.06616124,0.01289233,0.01656923,0.02922610,0.05211945,0.06280344,0.05876435,0.03201819,0.01197847,0.04381655,0.05716894,0.03533485,0.01595333\n\t\t,0.07068644,0.15572699,0.07954382,0.03235193,0.19131697,0.24542587,0.04537546,0.02040887,0.24539614,0.06968222,0.21271668,0.82212806,0.02242512,0.42356745,0.71825165,0.95282212,0.69533457,0.00244863,0.04834705,0.00060338,0.02633937,0.09653174,0.06022847,0.07815875,0.26599295,0.25055724,0.16359022,0.70223247,0.73290179,0.59696060,0.72134057,0.35745291,0.04571242,1.00000000,0.98305000,0.12772082,0.22299803,0.90100702\n\t\t,0.84680090,0.96453261,0.84373545,0.22152469,0.08328929,0.62064841,0.03970436,0.00893959,0.07301603,0.17295876,0.82548526,0.14886857,0.06975403,0.00943879,0.45655515,0.29523923,0.35702976,0.65484593,0.68369100,0.27106282,0.08746548,0.10710502,0.03904696,0.05552949,0.00147786,0.97396806,0.05328600,0.08791056,1.00000000,0.75647649,1.00000000,0.06131111,0.04299740,0.07634494,0.07947658,0.03226409,0.01457229,0.02541881\n\t\t,0.07677440,0.04996142,0.41156231,0.58429076,0.62667426,0.61155071,0.48058908,0.18506673,0.06796335,0.01579314,0.12878118,0.06132533,0.03018596,0.00302577\n\t\tTransform: 0.457702964544296,0.435703396797180,-0.775029838085175,0.000000000000000,0.849562525749207,-0.471392184495926,0.236713707447052,0.000000000000000,-0.262205898761749,-0.766780674457550,-0.585914254188538,0.000000000000000,0.460843771696091,1.148861289024353,2.393703222274780,1.000000000000000\n\t\tTransformLink: 0.457702606916428,-0.262205868959427,-0.849562168121338,0.000000000000000,0.435702770948410,-0.766780376434326,0.471391767263412,0.000000000000000,-0.775029420852661,-0.585914492607117,-0.236713618040085,0.000000000000000,1.143699049949646,2.404265880584717,0.416573852300644,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_01_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 393,396,397,402,403,430,431,451,542,545,550,580,581,582,583,584,585,586,587,588,589,590,591\n\t\t,592,594,595,596,598,599,616,617,618,620,621,622,623,640,641,642,643,644,645,646,647,648,649\n\t\t,650,651,652,653,654,655,664,665,667,668,669,670,671,672,675,676,677,678,679,680,681,682,683\n\t\t,684,685,686,687,713,714,715,720,721,722,724,725,731,732,734,737,739,741,742,743,972,975,1009\n\t\t,1010,1011,1012,1013,1014,1021,1022,1023,1024,1031,1032,1033,1034,1132,1133,1151,1164,1165,1166,1170,1171,1172,1175\n\t\t,1176,1177,1179,1180,1187,1188,1190,1195,1196,1217,1219,1220,1221,1222,1223,1224,1225,1226,1227,1228,1229,1231,1233\n\t\t,1248,1250,1251,1252,1253,1254,1255,1256,1257,1258,1260,1261,1288,1290,1291,1292,1298,1310,1314,1322,1356,1379,1380\n\t\t,1384,1385,1390,1392,1393,1394,1396,1398,1399,1400,1401,1402,1403,1404,1409,1410,1411,1412,1460,1461,1462,1542,1558\n\t\t,1575,1576,1580,1581,1584\n\t\tWeights: 0.04105289,0.03998685,0.38287849,0.36932631,0.05567351,0.06439662,0.00090292,0.00351433,0.01102033,0.05353326,0.21563836,0.31850916,0.32692182,0.17028035,0.33621591,0.85247168,0.86956847,0.98301606,0.87793760,0.91404435,0.87779902,0.65899290,1.00000000,0.31205771,0.83780857,0.80807552,0.17351247,0.62467283,0.79453197,0.34331014,0.91813063,1.00000000,0.00051284,0.19788099,0.78793682,0.78886803,0.76842038,0.91160646\n\t\t,0.95670705,0.72320630,0.81283457,0.85693950,0.94439995,0.72535756,0.13773019,0.10286130,0.14373714,0.10119113,0.08087221,0.04201172,0.08919798,0.06655177,0.05051443,0.03427147,0.01992161,0.05210889,0.02448130,0.05775607,0.08407080,0.01382883,0.03036870,0.57181873,0.65600280,0.71893696,0.30232382,0.12118638,0.16384584,0.16934093,0.11798655,0.30137887,0.62900491,0.74692430,0.27417701,0.19774574,0.64186183,0.80920339\n\t\t,0.74146632,0.08118436,0.04816374,0.30956683,0.12340541,0.12077834,0.29793356,0.70857595,0.77356624,0.07969240,0.05090826,0.81400279,0.19385774,0.15865041,0.00005271,0.26324743,0.32223020,0.91901534,0.66624485,0.97732220,0.93161393,0.93863677,0.85902667,0.05937826,0.05284565,0.11648211,0.14255333,0.71444490,0.48419222,0.27393926,0.06170880,0.01044803,0.21797792,0.64246882,0.79994302,0.18423113,0.81831148,0.77359488\n\t\t,0.76181295,0.08858552,0.04464772,0.33626048,0.13964333,0.11593758,0.28814574,0.69961637,0.03873479,0.07363035,0.05755624,0.08170764,0.01153287,0.24394941,0.46934666,0.71382016,0.76193739,0.77608109,0.76287528,0.70894869,0.58510789,0.76983258,0.77195232,0.75544643,0.03157939,0.07841554,0.00838793,0.17629235,0.17085803,0.25367817,0.35032864,0.12233792,0.57765557,0.31042988,0.13409327,0.11245852,0.04013288,0.04207470\n\t\t,0.09983259,0.28785223,0.05165471,0.13400760,0.05610284,0.04641295,0.13183241,0.89283259,0.98907738,0.13040761,0.15159354,0.10227212,0.05102455,0.97314130,0.85407059,0.01934524,0.13076182,0.80889339,0.75361151,0.81357719,0.98710767,0.97853193,0.88765185,0.84011877,0.75237776,0.80176399,0.77990675,0.33430956,0.07344298,0.01893304,0.19993842,0.09251200,0.08660590,0.02211340,0.40427156,0.67007723,0.22031637\n\t\tTransform: 0.366844952106476,0.376892417669296,-0.850516140460968,0.000000000000000,0.910750806331635,-0.331862211227417,0.245766147971153,0.000000000000000,-0.189626634120941,-0.864766061306000,-0.464996397495270,0.000000000000000,0.433450609445572,1.369480133056641,2.211618661880493,1.000000000000000\n\t\tTransformLink: 0.366844683885574,-0.189626619219780,-0.910750389099121,0.000000000000000,0.376891732215881,-0.864765644073486,0.331861823797226,0.000000000000000,-0.850515604019165,-0.464996665716171,-0.245766013860703,0.000000000000000,1.205861210823059,2.294868469238281,0.483827829360962,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_02_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 576,577,578,579,580,581,582,583,584,585,586,589,592,593,594,595,596,597,598,599,615,616,620\n\t\t,621,622,623,632,633,634,635,636,637,638,640,641,642,643,644,645,646,647,648,649,650,651,652\n\t\t,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675\n\t\t,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698\n\t\t,699,700,701,702,703,706,712,713,714,715,719,720,721,722,723,724,725,726,727,729,730,731,732\n\t\t,734,737,738,739,740,741,742,743,744,758,759,760,762,763,764,765,766,767,1007,1008,1009,1010,1014\n\t\t,1021,1022,1023,1024,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1044,1045,1163,1164,1165,1166\n\t\t,1169,1170,1171,1172,1174,1175,1176,1177,1178,1179,1180,1181,1182,1186,1187,1188,1189,1190,1193,1194,1195,1196,1200\n\t\t,1201,1225,1227,1228,1229,1233,1379,1394,1399,1400,1401,1403,1409,1410,1411,1412,1581\n\t\tWeights: 0.80405830,0.74261725,0.90194243,0.96190834,0.68149084,0.67307818,0.82971965,0.66378409,0.05268830,0.13043153,0.01698394,0.01558963,0.68794229,0.79253360,0.06027229,0.17918267,0.81782084,0.69771576,0.02218664,0.07759378,0.94910843,0.65668986,0.71248001,0.78540204,0.07050914,0.17311553,0.02943572,0.02255028,0.02125015,0.03435579,0.04374910,0.03528282,0.00916035,0.23157962,0.08839354,0.04329295,0.27679370,0.14193115\n\t\t,0.10510373,0.05560005,0.26949624,0.86226981,0.84777697,0.85626286,0.88971883,0.83231238,0.95798828,0.86826751,0.85487132,0.05630502,0.12825465,0.14516964,0.14375018,0.14782111,0.16430270,0.09790208,0.16284343,0.80916785,0.87020749,1.00000000,0.90960766,0.94789111,0.97551870,0.88960985,0.90431298,0.87852248,0.98179160,1.00000000,0.83415186,0.42818127,0.34399720,0.28106304,0.69767618,0.82222554,0.83280737,0.83065907\n\t\t,0.88201345,0.69862113,0.37099509,0.25307570,0.72582299,0.73877051,0.33257337,0.31855202,0.76121552,0.32867175,0.37086093,0.63160497,0.51253225,0.19626671,0.22623184,0.22350193,0.28212283,0.22944591,0.21504014,0.29917645,0.28060222,0.00193600,0.72496319,0.78996075,0.02224883,0.15544340,0.02830353,0.25853368,0.83883835,0.81704525,0.17093484,0.69043317,0.82552021,0.36678848,0.25199904,0.22334932,0.31989876,0.82090033\n\t\t,0.70206644,0.28653892,0.18932961,0.14925815,0.83052830,0.02857478,0.80913978,0.09103964,0.78548901,0.68997278,0.09643030,0.09098030,0.10851942,0.08765550,0.06406466,0.09284880,0.07173698,0.11066080,0.10645676,0.85765458,0.83628010,0.73675257,0.67776980,0.06838607,0.06136323,0.14097333,0.94062174,0.94715435,0.13865680,0.07788532,0.93916814,0.97425619,0.03362786,0.88351789,0.85744667,0.28555510,0.51580778,0.34054951\n\t\t,0.37835381,0.16812643,0.21496340,0.08519789,0.01777920,0.75792694,0.78202208,0.02683464,0.11708175,0.67447911,0.79585516,0.07597837,0.20053200,0.03022455,0.23476333,0.85059260,0.84269673,0.18142084,0.66373952,0.83347661,0.50530229,0.30181199,0.22563958,0.82795496,0.71185426,0.31566366,0.30038363,0.15223153,0.03214301,0.81167099,0.83698606,0.10668449,0.10422499,0.00705326,0.03020835,0.00348954,0.05690736,0.03021117\n\t\t,0.06506872,0.01693213,0.13240408,0.06956044,0.12026157,0.00489883,0.10776178,0.05806315,0.13543256,0.08694688,0.00601210\n\t\tTransform: 0.451893806457520,0.256771385669708,-0.854319155216217,0.000000000000000,0.861484467983246,-0.374241530895233,0.343203216791153,0.000000000000000,-0.231596872210503,-0.891073703765869,-0.390321344137192,0.000000000000000,0.399167567491531,1.504963278770447,2.096861124038696,1.000000000000000\n\t\tTransformLink: 0.451893448829651,-0.231596767902374,-0.861483991146088,0.000000000000000,0.256770789623260,-0.891073346138000,0.374241113662720,0.000000000000000,-0.854318618774414,-0.390321671962738,-0.343202948570251,0.000000000000000,1.224575638771057,2.251928806304932,0.500306308269501,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_03_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 576,577,578,579,593,596,597,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615\n\t\t,619,620,621,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,649,651,652,654\n\t\t,655,656,657,658,659,660,661,662,663,664,665,667,670,671,672,673,675,680,681,688,689,690,691\n\t\t,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,716\n\t\t,717,718,719,721,722,723,725,726,727,728,729,730,731,733,735,736,738,739,740,741,743,744,745\n\t\t,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,1007\n\t\t,1008,1015,1016,1017,1018,1019,1020,1025,1026,1027,1028,1029,1030,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044\n\t\t,1045,1163,1167,1168,1169,1170,1173,1174,1176,1177,1178,1180,1181,1182,1183,1184,1185,1186,1187,1189,1191,1192,1193\n\t\t,1194,1195,1196,1197,1198,1199,1200,1201\n\t\tWeights: 0.19594170,0.25738275,0.09805757,0.03809166,0.20746640,0.00866669,0.30228424,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.05089157,1.00000000,0.28700715,0.01671697,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.97056428,0.97744972,0.97874985,0.96564421\n\t\t,0.95625090,0.96471718,0.99083965,1.00000000,0.04936172,0.00909003,0.08681541,0.04253451,0.07857691,0.94369498,0.87174535,0.85483036,0.85624982,0.85217889,0.83569730,0.90209792,0.83715657,0.14031772,0.09552105,0.07047073,0.05263408,0.01161622,0.10764870,0.01820840,0.13547944,0.05658808,0.00334679,0.26122949,0.66742663,0.68144798,0.23878448,0.67132825,0.62913907,0.36839503,0.48746775,0.80373329,0.77376816,0.77649807\n\t\t,0.71787717,0.77055409,0.78495986,0.70082355,0.71939778,1.00000000,1.00000000,0.99806400,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.27503681,0.01229351,1.00000000,1.00000000,1.00000000,0.97169647,0.07997730,0.13479101,0.82906516,0.05107438,0.63321152,0.74800096,1.00000000,0.77665068,0.68010124,0.05832133,1.00000000,1.00000000,1.00000000,0.85074185,0.08977930,0.97142522,0.13995196,0.02065325,0.31002722\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.90356970,0.90901970,0.89148058,1.00000000,0.91234450,0.93593534,0.90715120,0.92826302,0.88933920,0.89354324,0.14234542,0.16371990,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.86134320,0.92211468,0.06083186,0.02574381,0.96637214,0.65945049\n\t\t,0.62164619,0.83187357,0.78503660,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.91480211,0.98222080,0.24207306,1.00000000,1.00000000,0.32552089,0.01991371,1.00000000,0.96977545,0.06082188,0.11265555,0.81857916,0.02688006,0.49469771,0.69818801,1.00000000,1.00000000,1.00000000,0.77436042,0.05610746,0.68433634,1.00000000,1.00000000,0.84776847,0.96785699,0.14959421,0.08938359,1.00000000,1.00000000,1.00000000\n\t\t,0.89331551,0.89577501\n\t\tTransform: 0.549975216388702,0.196937307715416,-0.811630368232727,0.000000000000000,0.810896337032318,-0.358557850122452,0.462476074695587,0.000000000000000,-0.199937611818314,-0.912498056888580,-0.356893032789230,0.000000000000000,0.181881487369537,1.598309516906738,2.031270980834961,1.000000000000000\n\t\tTransformLink: 0.549974799156189,-0.199937462806702,-0.810895860195160,0.000000000000000,0.196936726570129,-0.912497580051422,0.358557403087616,0.000000000000000,-0.811629772186279,-0.356893330812454,-0.462475657463074,0.000000000000000,1.233843803405762,2.219765424728394,0.513814568519592,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-shoulder_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3302,3309,3310,3311,3312,3313,3315,3316,3317,3318,3333,3339,3340,3341,3348,3356,3364,3365,3367,3368,3369,3371,3375\n\t\t,3376,3377,3380,3383,3384,3385,3386,3387,3388,3389,3390,3391,3393,3394,3395,3396,3397,3398,3399,3400,3401,3402,3403\n\t\t,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,3415,3416,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426\n\t\t,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3439,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449\n\t\t,3450,3451,3452,3453,3454,3455,3456,3457,3458,3459,3460,3461,3462,3463,3464,3465,3466,3467,3468,3469,3470,3471,3472\n\t\t,3473,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,4029,4032,4198,4199,4200,4201,4202,4203,4215,4218,4219\n\t\t,4224,4229,4230,4231,4232,4233,4234,4235,4245,4248,4249,5276,5278,5279,5280,5283,5284,5285,5287,5288,5289,5292,5293\n\t\t,5294,5296,5297,5298,5301,5302,5306,5307,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324\n\t\t,5325,5326,5327,5328,5329,5330,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347\n\t\t,5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370\n\t\t,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393\n\t\t,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,5413,5414,5415,5416\n\t\t,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439\n\t\t,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462\n\t\t,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485\n\t\t,5486,5487,5488,5489,5490,5493,5494,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512\n\t\t,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535\n\t\t,5537,5540,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552,5553,5556,5557,5560,5565,5566,5569,5570,5571,5573,5574\n\t\t,5575,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,6477,6479\n\t\t,6480,6481,6557,6558,6559,6603,6604,6605,6606,6608,6609,6610,6612,6613,6617,6625,6629,6630,7319,7320,7321,7322,7323\n\t\t,7324,7325,7326,7327,7328,7329,7330,7331,7334,7338,7339,7341,7342,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353\n\t\t,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376\n\t\t,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399\n\t\t,7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422\n\t\t,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445\n\t\t,7446,7447,7448,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470\n\t\t,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493\n\t\t,7494,7495,7496,7497,7498,7499,7500,7501,7502,7514,7515,7516,7517,7520,7521,7523,7524,7525,7526,7527,7528,7907,7923\n\t\t,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8066,8067,8068,8069\n\t\t,8071,8072,8073,8074\n\t\tWeights: 0.63494500,0.06012929,0.01713528,0.04941512,0.00256782,0.03287754,0.15752086,0.01470505,0.12449409,0.00042374,0.01391357,0.03856522,0.09151314,0.00673348,0.10724141,0.06326463,0.17585255,0.02691074,0.05250714,0.05409987,0.01451462,0.00453937,0.23363484,0.22068935,0.09724160,0.00943180,0.00417111,0.06145719,0.19617427,0.02380648,0.08747781,0.34471884,0.38137354,0.25573529,0.13866874,0.02111433,0.27707381,0.46193999\n\t\t,0.56626192,0.42014023,0.39518304,0.38434212,1.00000000,1.00000000,0.48732471,0.42160637,1.00000000,1.00000000,0.52434719,1.00000000,0.31391277,0.15478675,0.07582829,0.21992035,0.10737365,0.29948407,0.22599772,0.45208274,0.25626383,0.50743872,0.41400155,1.00000000,0.46934545,1.00000000,0.55772425,1.00000000,0.63494500,1.00000000,0.66834507,1.00000000,0.66314435,1.00000000,0.55694981,1.00000000,0.27263476,0.27282639\n\t\t,0.48307958,0.78394670,1.00000000,1.00000000,1.00000000,0.57340084,0.53042710,1.00000000,1.00000000,1.00000000,1.00000000,0.56495005,0.70630076,0.51281106,0.53774719,0.53984837,0.15150268,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.49012995,1.00000000,1.00000000,1.00000000,0.73554496,0.80122097,0.71735074,0.86993070,0.40718109,0.78884401,1.00000000,1.00000000,0.69691190,1.00000000,0.92012981,1.00000000\n\t\t,1.00000000,1.00000000,0.33664069,0.62044127,0.71962261,0.69738354,0.69131611,0.87116012,1.00000000,1.00000000,0.70474682,0.46825767,0.99733248,0.02208679,0.04511391,0.00516096,0.03094799,0.02821680,0.01750470,0.02535728,0.03801724,0.01036552,0.00891863,0.01046122,0.00208017,0.00862299,0.08593349,0.05293659,0.08006882,0.06435769,0.05106815,0.05672060,0.00067096,0.00042075,0.00565803,0.01508347,0.01862205,0.05437202\n\t\t,0.00865810,0.05617946,0.03748628,0.01607855,0.01743921,0.05505817,0.01773994,0.05353489,0.05889506,0.00704664,0.00418708,0.03438280,0.01048361,0.02948252,0.03815328,0.02136030,0.00096299,0.01396125,0.02500080,0.10750001,0.12114461,0.11683395,0.08564334,0.09045468,0.14541910,0.08672774,0.11743945,0.12505391,0.13391616,0.09272515,0.09050188,0.15219662,0.10373306,0.17766630,0.15684585,0.15270795,0.22141922,0.20276214\n\t\t,0.12004421,0.23129563,0.18969449,0.23112297,0.16382447,0.17284410,0.22587535,0.20280831,0.12892677,0.10039277,0.11045661,0.11790065,0.09351362,0.09628662,0.13395742,0.09309790,0.43425288,0.36819598,0.45124571,0.44383238,0.34113076,0.37034669,0.52207436,0.60031115,0.53590304,0.56719791,0.69369655,0.61725693,0.43563234,0.73291800,0.36453796,0.42565430,0.27406151,0.38562442,0.49597742,0.30867293,0.26981358,0.11947526\n\t\t,0.10884139,0.11643082,0.12809631,0.11994726,0.10873800,0.13696955,0.48454349,0.50625659,0.38997746,0.59828608,0.69838950,0.36550623,0.47448086,0.30469646,0.21402710,0.38462196,0.34891595,0.20314187,0.26052632,0.58416136,0.88713277,0.93325412,0.85712247,0.84595657,0.91375220,0.90244853,0.78382041,0.62617613,0.59085281,0.56247866,0.71176081,0.73626709,0.44176373,0.64853472,0.45691800,0.36032230,0.42089687,0.62965739\n\t\t,0.55242922,0.26433649,0.67245686,0.13020938,0.09197246,0.17474979,0.14090428,0.08512641,0.11807441,0.23652048,0.13545096,0.14343743,0.17868418,0.09346295,0.08859478,0.23421706,0.12800860,0.20272424,0.11338724,0.15703954,0.28435931,0.19186208,0.11061548,0.11983969,0.19632325,0.32805423,0.43643059,0.51800992,0.40569271,0.35464646,0.49527586,0.47417567,0.27298154,0.68289559,0.64948088,0.73027926,0.64740079,0.57625622\n\t\t,0.69672554,0.72473682,0.82466114,0.81224763,0.85404194,0.80128920,0.76299389,0.86311859,0.82805133,0.98458254,0.98746604,0.99437356,0.93728464,0.94226384,1.00000000,0.90236343,0.93301684,0.99733609,0.93123901,0.82514748,0.93876338,1.00000000,0.99421418,0.81519770,0.83975085,0.40431708,0.55436225,0.38523954,0.30985214,0.49326037,0.61860218,0.51334089,0.28366603,0.37994396,0.12957050,0.17641399,0.11980076,0.09002513\n\t\t,0.14820879,0.23493207,0.16645734,0.08429755,0.09806962,0.00144083,0.02719338,0.00147373,0.02534060,0.02504510,0.84527023,0.79478456,0.81302950,0.92559408,0.91564675,0.72118773,0.91869935,0.91772491,0.97378075,0.91502810,0.78265064,0.92450237,0.98805344,0.96472901,0.77439022,0.78739240,0.08385546,0.08020406,0.09228634,0.08278729,0.07378073,0.11658105,0.09639051,0.05944855,0.06443959,0.03798387,0.04765609,0.09041458\n\t\t,0.10484751,0.05925310,0.02127322,0.05875027,0.81493616,0.79346079,0.73465391,0.90289363,0.90689664,0.61267453,0.88351374,0.00592424,0.01386566,0.28386394,0.19561574,0.30996085,0.41053628,0.25527946,0.15434340,0.21906540,0.42103137,0.40132116,0.00835920,0.03866375,0.05268194,0.05544982,0.02501486,0.01248753,0.00764283,0.02753791,0.03947346,0.01426036,0.08129838,0.08768614,0.07262942,0.01112744,0.09748475,0.06111827\n\t\t,0.07027535,0.03889854,0.05633018,0.06691220,0.08862865,0.05286924,0.02368539,0.06650914,0.10178143,0.09672790,0.07106740,0.10589235,0.13787545,0.12917559,0.06341670,0.07588572,0.14702166,0.00065399,0.07017295,0.11732269,0.14455252,0.03796721,0.04526606,0.05473255,0.04318173,0.04813627,0.00752217,0.00022003,0.00500924,0.01831889,0.02261742,0.06685820,0.05732981,0.00244504,0.00808606,0.06731013,0.02951825,0.06064617\n\t\t,0.05925114,0.05967067,0.07202524,0.06631076,0.06345095,0.08727527,0.07934811,0.07931573,0.07734331,0.08960639,0.09237481,0.01618641,0.01902247,0.02006615,0.05830632,0.01566693,0.04957444,0.00130732,0.02720895,0.08949621,0.12353760,0.16457979,0.10159218,0.13739688,0.17367937,0.11899554,0.14641487,0.19140556,0.26771051,0.29854364,0.35049735,0.10457540,0.13177163,0.14877517,0.28713026,0.29352903,0.26415955,0.11098120\n\t\t,0.13561235,0.13973018,0.13738198,0.13374794,0.14042030,0.28669900,0.40062743,0.51152294,0.37090224,0.48007350,0.57373879,0.58120703,0.49697306,0.36131663,0.18119914,0.17808310,0.19195404,0.10559861,0.08424542,0.08392484,0.71685142,0.78582436,0.84705978,0.60812538,0.72100863,0.84082400,0.74050106,0.54547346,0.37093247,0.14952073,0.10898306,0.11058860,0.07246113,0.05632876,0.05047079,0.06727733,0.05685551,0.05769338\n\t\t,0.71787441,0.79538834,0.83843482,0.21911620,0.38670319,0.66552418,0.98926634,0.96490341,0.92824078,0.70102543,0.48577119,0.34265131,0.08622511,0.14887470,0.27441341,0.80445344,0.75537072,0.69288611,0.38514960,0.25562587,0.17194332,0.18426448,0.25394938,0.36554566,0.10839786,0.17008730,0.29809919,0.22449552,0.34110259,0.37606204,0.61867911,0.59532554,0.52278250,0.48763990,0.57628500,0.68341656,0.72295989,0.77245879\n\t\t,0.79028028,0.90496671,0.89203471,0.85582704,1.00000000,0.95915395,0.87237734,0.02179927,0.07138969,0.11093017,0.15412619,0.27490379,0.37294852,0.48693669,0.99296194,0.93013054,0.80402369,0.97118068,0.96975910,0.96271008,0.72633350,0.67570394,0.65011925,0.30503067,0.23727369,0.21875440,0.06077071,0.06016253,0.05724818,0.60387578,0.78975701,0.90879091,0.11453462,0.10892844,0.15561372,0.41742764,0.55935090,0.85079678\n\t\t,0.96889055,0.91795003,0.78062171,0.99304605,0.97479183,0.96996766,0.57395632,0.57382496,0.57267929,0.11070830,0.08089891,0.06691828,0.03836482,0.02228271,0.00841741,0.14401132,0.22399233,0.38792133,0.01992143,0.01457765,0.00464958,0.00656321,0.00854737,0.05156083,0.06762960,0.01030889,0.05116831,0.00036893,0.11556771,0.09430801,0.04704106,0.06784523,0.08831751,0.10608655,0.00969062,0.00429432,0.00050043,0.06236911\n\t\t,0.08321978,0.09388682,0.05701632,0.24049997,0.19073509,0.16084101,0.12168420,0.63321042,0.23153621,0.94780338,0.10800374,0.05127359,0.85098177,0.58239419,0.39917363,0.09622696,0.79460251,0.05274821,0.96945870,0.19383549,0.61772860,1.00000000,0.03864169,0.56836462,0.01985892\n\t\tTransform: 0.429939121007919,-0.902857720851898,-0.000549820833839,0.000000000000000,0.902857780456543,0.429938942193985,0.000236753272475,0.000000000000000,0.000022639136660,-0.000598199840169,0.999999582767487,0.000000000000000,0.189679577946663,0.051554445177317,-3.225779294967651,1.000000000000000\n\t\tTransformLink: 0.429939031600952,0.000022634863853,-0.902857959270477,0.000000000000000,-0.902857661247253,-0.000598199665546,-0.429939061403275,0.000000000000000,-0.000549822987523,1.000000000000000,-0.000236749649048,0.000000000000000,-0.036777928471565,3.225806236267090,0.192655280232430,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-upper_arm_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 5268,5269,5273,5276,5277,5278,5279,5280,5281,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5296\n\t\t,5297,5298,5299,5301,5302,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5329,5330\n\t\t,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,5354,5355\n\t\t,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378\n\t\t,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,5399,5400,5401\n\t\t,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424\n\t\t,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443,5444,5445,5446,5447\n\t\t,5448,5449,5450,5451,5452,5453,5454,5455,5457,5458,5460,5464,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478\n\t\t,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5507,5512,5514,5518,5520,5521\n\t\t,5522,5523,5524,5525,5526,5527,5528,5536,5537,5539,5540,5541,5543,5544,5545,5546,5547,5549,5550,5551,5552,5553,5554\n\t\t,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577\n\t\t,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600\n\t\t,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616,5617,5618,5619,5620,5621,5622,5623\n\t\t,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646\n\t\t,5647,5648,5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669\n\t\t,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692\n\t\t,5693,5694,5695,5696,5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715\n\t\t,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5763,5764,5767,5772,5773,7298,7299\n\t\t,7300,7303,7319,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7334,7335,7336,7337,7338,7339,7340,7341,7342\n\t\t,7345,7346,7347,7348,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368\n\t\t,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7389,7390,7391,7392\n\t\t,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415\n\t\t,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438\n\t\t,7439,7440,7441,7442,7443,7444,7447,7448,7449,7451,7452,7453,7454,7455,7456,7459,7463,7464,7465,7466,7467,7468,7469\n\t\t,7470,7471,7477,7487,7488,7489,7490,7491,7492,7493,7494,7495,7498,7499,7500,7501,7502,7503,7504,7505,7506,7507,7508\n\t\t,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531\n\t\t,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7552,7553,7554\n\t\t,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577\n\t\t,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7601,7602,7603\n\t\t,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7643,7646,8043,8047,8048,8049,8050,8051\n\t\t,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8064,8066,8068,8069,8073,8074,8075,8076,8077,8078,8079,8080,8081\n\t\t,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8093\n\t\tWeights: 0.01498860,0.00804744,0.04235353,0.08369518,0.05153006,0.08967516,0.13264885,0.07148045,0.01867331,0.03468940,0.14650071,0.09874569,0.07248824,0.02845395,0.06669375,0.13077378,0.08305300,0.03152723,0.02109029,0.10944774,0.15615130,0.01636119,0.00247704,0.04485481,0.03447199,0.00807668,0.02144917,0.06131913,0.02716987,0.02501219,0.04540394,0.01219351,0.00075732,0.05275863,0.02874532,0.08866950,0.07765243,0.10539225\n\t\t,0.08183099,0.06504574,0.08893466,0.10915007,0.00590224,0.01125707,0.01609342,0.03732418,0.21135596,0.21872192,0.24975071,0.16660747,0.15075363,0.30961904,0.18047029,0.28724146,0.29768370,0.38552627,0.26188395,0.23694731,0.43327904,0.28110143,0.24588957,0.23196736,0.19042438,0.31236771,0.37731442,0.15675755,0.24251419,0.11929584,0.13314624,0.10217271,0.11921938,0.17213310,0.10951806,0.08800540,0.52625389,0.48238773\n\t\t,0.62320127,0.45523885,0.38512726,0.61897342,0.55123725,0.60927258,0.65240451,0.62440100,0.55845979,0.60390843,0.67088937,0.47708054,0.05095437,0.06548719,0.04466270,0.03056675,0.05013558,0.06772407,0.01357104,0.69530354,0.78597290,0.61537804,0.65108405,0.79685813,0.73947368,0.41583864,0.09516267,0.06674588,0.12902212,0.09727389,0.05799507,0.09755147,0.15000430,0.35648266,0.40914719,0.39022911,0.27395397,0.26373291\n\t\t,0.53604663,0.29202825,0.54308200,0.63967770,0.57910313,0.37034261,0.44757078,0.73566351,0.32754314,0.86979062,0.90802754,0.82525021,0.85909572,0.91487359,0.88192559,0.76347952,0.84616884,0.85527314,0.77977780,0.88902092,0.91140522,0.74577402,0.81538504,0.34440993,0.23875654,0.49889285,0.38927461,0.25299832,0.18853628,0.31645762,0.52338078,0.30207766,0.41837771,0.33140419,0.40591903,0.53933314,0.41466159,0.29301060\n\t\t,0.58947667,0.15625278,0.19139698,0.15142049,0.13450920,0.16842742,0.20790423,0.11483480,0.13897993,0.17366123,0.11124731,0.14142668,0.20096156,0.13688141,0.10369696,0.01541746,0.01253396,0.05136294,0.05773616,0.04018257,0.02094980,0.01905104,0.02349217,0.08442252,0.07176813,0.07838251,0.09769662,0.09838881,0.08040667,0.06537116,0.08913191,0.11811621,0.10969964,0.10994382,0.09404660,0.10135206,0.14508526,0.15436201\n\t\t,0.10180741,0.08910281,0.12158073,0.02599057,0.05658763,0.02397643,0.00077113,0.02339493,0.05790991,0.05295855,0.00059024,0.00182671,0.00676837,0.00233720,0.02481296,0.03107816,0.01316865,0.00910229,0.04442088,0.07191193,0.06074927,0.00711732,0.01210796,0.05692748,0.00370628,0.01115073,0.00970714,0.02292279,0.00245593,0.02318718,0.01630343,0.04914251,0.02701041,0.00193957,0.04822255,0.03811884,0.01234709,0.99164080\n\t\t,0.91695730,1.00000000,1.00000000,0.92589518,0.90604733,0.99600768,1.00000000,0.97498514,1.00000000,1.00000000,1.00000000,1.00000000,0.98751247,0.99235717,1.00000000,1.00000000,0.97246209,0.96052654,0.98573964,1.00000000,0.91870162,0.91231386,0.92737058,1.00000000,0.98887256,0.90251525,0.81951761,0.80379117,0.87766201,0.84196957,0.80125484,0.74708966,0.85691216,0.90902855,0.81565529,0.83324753,0.87555308,0.87814886\n\t\t,0.78688714,0.78446768,0.83452250,0.92204321,0.84499113,0.71852185,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.77102424,0.77124493,0.57746139,0.77482917,0.88706252,0.88084811,0.60200654,0.55362059,0.89968077,0.81793069,0.80266882,0.60742726,0.78604938,0.92554832,0.92477677,0.52396935,0.57885655,0.90720862,0.71836916,0.70905431,0.49171312,0.75020891,0.86805350,0.86691595,0.45014249\n\t\t,0.59134974,0.87563076,0.82059927,0.80373560,0.71121921,0.82913452,0.90778506,0.89962153,0.68874661,0.72202388,0.91073944,0.80919867,0.82025768,0.69411272,0.79014924,0.89391031,0.90211991,0.70864795,0.64678262,0.88599541,0.15338345,0.19095638,0.08432743,0.12782263,0.26767620,0.32611100,0.10259904,0.06962470,0.22182940,0.08709068,0.09235432,0.03772005,0.08863730,0.16102971,0.15897983,0.04951404,0.03505863,0.16840989\n\t\t,0.16257782,0.12402426,0.09329429,0.20506306,0.25386995,0.20815257,0.06708313,0.11788395,0.31044942,0.24246583,0.24444884,0.13873137,0.24402586,0.38169894,0.37937186,0.14039091,0.13947754,0.38558880,0.26339376,0.24892768,0.14209107,0.26157596,0.45815219,0.38888800,0.14102785,0.13689361,0.46314947,0.00937645,0.00859290,0.00928496,0.00375377,0.00683026,0.00499081,0.00347773,0.00014709,0.00218081,0.00977715,0.09203882\n\t\t,0.06774973,0.05224821,0.25730941,0.20971341,0.17797981,0.15780694,0.20443195,0.25009368,0.05777846,0.02011496,0.07222150,0.04746405,0.00614202,0.03388232,0.09033929,0.15758679,0.02088265,0.05701863,0.08527497,0.00571312,0.05090354,0.06175859,0.07065143,0.02000301,0.05200258,0.14473199,0.12686201,0.10984722,0.05941774,0.03193642,0.00328435,0.20776247,0.29510034,0.39954844,0.14440178,0.22476411,0.35167034,0.36841783\n\t\t,0.47459864,0.51980546,0.39314466,0.58697438,0.61527329,0.50217747,0.38039410,0.28322669,0.12179408,0.15287637,0.20154268,0.32498652,0.43166130,0.58618242,0.66807093,0.73561594,0.75305453,0.68091317,0.74499416,0.76697576,0.15873994,0.10615856,0.06723393,0.00415202,0.00811384,0.06586668,0.08458185,0.08664323,0.85047927,0.89101694,0.88941140,0.92753887,0.94367124,0.94952921,0.88595824,0.92778222,0.94230662,0.21599096\n\t\t,0.19239117,0.16156518,0.78088380,0.61329681,0.33447582,0.01073366,0.03509659,0.07175922,0.29897457,0.51422881,0.65734869,0.91377489,0.85112530,0.72558659,0.19554656,0.24462928,0.29987714,0.61485040,0.74437413,0.82805668,0.72459186,0.67663254,0.58052582,0.16187682,0.18183649,0.20845492,0.58675004,0.38257985,0.26545131,0.29458624,0.24775349,0.21707017,0.14330451,0.11331401,0.09332171,0.21648063,0.14710459,0.10574642\n\t\t,0.09503329,0.07946176,0.07326612,0.02923436,0.04208952,0.01913279,0.06907133,0.08712285,0.09520581,0.07938481,0.07106707,0.05785080,0.01444816,0.05929722,0.05414208,0.05139356,0.14298150,0.10610188,0.09695898,0.08600191,0.07750008,0.06675549,0.03603772,0.02786945,0.02188062,0.01254462,0.03869802,0.01532759,0.00292563,0.04395823,0.02514076,0.01156220,0.00387466,0.95426110,0.98280240,0.99535042,0.95162535,0.97006715\n\t\t,0.98449406,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.94993482,0.87846909,0.85403334,0.98969111,1.00000000,1.00000000,0.94883169,0.99963107,1.00000000,0.88443229,0.90380623,0.95295894,0.84215420,0.79952991,0.76085959,0.96249421,0.95239739,0.94831209,0.96655427,0.97063628,0.97201720,0.94775136,0.94642839,0.94935138,0.99684182,0.99451238,0.97822327,0.94851424\n\t\t,0.95712200,0.97344116,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.54858352,0.55566682,0.54276851,0.56513294,0.57579392,0.58203914,0.30805168,0.35173804,0.42590906,0.27379159,0.29657924,0.30317243,0.47853617,0.43709771,0.39952415,0.62438452,0.77718078,0.88094232,0.91395707,0.78438227,0.51955324\n\t\t,0.88012589,0.73000983,0.45582263,0.88787443,0.77997080,0.65068440,0.90844459,0.82833175,0.72232902,0.06870188,0.06769349,0.06412045,0.06859953,0.06923962,0.06924384,0.01078021,0.03969409,0.05701066,0.04977493,0.03458617,0.01883902,0.12284399,0.23948114,0.42754087,0.17711998,0.10605490,0.05823358,0.17543298,0.09799262,0.04669517,0.36833147,0.23784724,0.13456134,0.38552378,0.24504347,0.14003136,0.00394760,0.00854372\n\t\t,0.00388901,0.02954800,0.13850071,0.28074213,0.09852317,0.08393335,0.60214493,0.75683940,0.22875269,0.74994689,0.00691094,0.89199626,0.94872641,0.14901823,0.38979427,0.20206115,0.07287480,0.05982527,0.07895161,0.04279023,0.00717503,0.93500864,1.00000000,1.00000000,1.00000000,1.00000000,0.94725906,0.97044701,0.95884054,0.95707387,0.98898429,0.52303471,0.57992774,0.52417067,0.29001906,0.29594541,0.05783166,0.06862620\n\t\t,0.06423179,0.00601595\n\t\tTransform: -0.712102890014648,-0.702035307884216,-0.007536621764302,0.000000000000000,0.068460643291473,-0.058750815689564,-0.995922684669495,0.000000000000000,0.698729634284973,-0.709715068340302,0.089898280799389,0.000000000000000,-2.513904094696045,1.970259428024292,-0.323145449161530,1.000000000000000\n\t\tTransformLink: -0.712102353572845,0.698729574680328,-0.068460568785667,0.000000000000000,-0.702034652233124,-0.709714829921722,0.058750718832016,0.000000000000000,-0.007536598015577,0.089898340404034,0.995922267436981,0.000000000000000,-0.409402072429657,3.183911323547363,0.033970266580582,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-forearm_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3062,3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084\n\t\t,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3210,3211,3212,3213,3214,3215,3217,3218,3220,3221,3253,3254\n\t\t,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,3278,3279,3280\n\t\t,3281,3282,3285,3289,3290,3291,3292,3293,3294,3295,3296,3297,5642,5643,5644,5645,5646,5647,5648,5649,5650,5651,5652\n\t\t,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675\n\t\t,5676,5677,5678,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698\n\t\t,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721\n\t\t,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744\n\t\t,5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767\n\t\t,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790\n\t\t,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813\n\t\t,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836\n\t\t,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859\n\t\t,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882\n\t\t,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905\n\t\t,5906,5907,5908,5909,5910,5911,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7559,7560\n\t\t,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583\n\t\t,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606\n\t\t,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629\n\t\t,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652\n\t\t,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675\n\t\t,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,7698\n\t\t,7699,7700,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,7714,7715,7716,7717,7718,7719,7720,7721\n\t\t,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,8079,8080,8081,8082,8083,8084\n\t\t,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107\n\t\t,8108,8109,8110,8111,8112,8113\n\t\tWeights: 0.35562827,0.45839166,0.45239524,0.48540232,0.49864266,0.50479488,0.39662587,0.33525227,0.33880951,0.33833037,0.33819509,0.33660008,0.34003162,0.42560791,0.48709618,0.51122921,0.35635049,0.28197074,0.23179806,0.22265906,0.25064202,0.31854910,0.37176789,0.29523257,0.33184919,0.34711757,0.33499600,0.33017881,0.33252510,0.34880582,0.36573829,0.38492622,0.38319246,0.35080881,0.06504439,0.11000741,0.00824526,0.14470434\n\t\t,0.06491010,0.13828587,0.50924565,0.23993956,0.28622157,0.35062421,0.34484832,0.36296723,0.40478610,0.39694704,0.40093978,0.40112505,0.43052933,0.42269908,0.40210544,0.40030114,0.42145448,0.30736712,0.37381526,0.39388967,0.42419538,0.39653206,0.41613966,0.42804294,0.39733489,0.43973633,0.38356573,0.28520519,0.25639187,0.16339096,0.06505075,0.05138635,0.00449422,0.00867978,0.00018708,0.32350313,0.33894176,0.29742525\n\t\t,0.23246730,0.18083452,0.10597462,0.05009991,0.02906560,0.22897576,0.22875507,0.42253861,0.22517083,0.11293748,0.11915189,0.39799346,0.44637941,0.10031923,0.18206931,0.19733118,0.39257274,0.21395062,0.07445168,0.07522323,0.47603065,0.42114345,0.09279138,0.28163084,0.29094569,0.50828688,0.24979109,0.13194650,0.13308405,0.54985751,0.40865026,0.12436924,0.17940073,0.19626440,0.28878079,0.17086548,0.09221494,0.10037847\n\t\t,0.31125339,0.27797612,0.08926056,0.19080133,0.17974232,0.30588728,0.20985076,0.10608969,0.09788009,0.29135205,0.35321738,0.11400459,0.84661655,0.80904362,0.91567257,0.87217737,0.73232380,0.67388900,0.89740096,0.93037530,0.77817060,0.91290932,0.90764568,0.96227995,0.91136270,0.83897029,0.84102017,0.95048596,0.96494137,0.83159011,0.83742218,0.87597574,0.90670571,0.79493694,0.74613005,0.79184743,0.93291687,0.88211605\n\t\t,0.68955058,0.75753417,0.75555116,0.86126863,0.75597414,0.61830106,0.62062814,0.85960909,0.86052246,0.61441120,0.73660624,0.75107232,0.85790893,0.73842404,0.54184781,0.61111200,0.85897215,0.86310639,0.53685053,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99062355,0.99140710,1.00000000,1.00000000,0.99071504,1.00000000,1.00000000,1.00000000,1.00000000,0.99624623,0.99316974,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99904544,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.85220766,0.80467071,0.72481840,0.91095364,1.00000000\n\t\t,1.00000000,0.74983623,0.69611301,1.00000000,0.90382496,0.89006598,0.74543156,0.93645321,1.00000000,1.00000000,0.74054826,0.74397389,1.00000000,0.98714760,0.99976246,0.67303487,0.85058219,1.00000000,1.00000000,0.73383739,0.63840970,0.97799756,0.92843913,0.90712853,0.75446794,0.96170699,0.99931024,0.99841096,0.70198527,0.80662210,0.99873391,0.92845182,0.93885601,0.75826605,0.90982393,0.99679016,0.99450800,0.78548321\n\t\t,0.74531533,0.99860787,0.41023285,0.39986700,0.40162867,0.41188509,0.44526480,0.41848507,0.39172291,0.40484658,0.42916193,0.43313576,0.41790169,0.41167133,0.40042548,0.46172524,0.45365124,0.40438845,0.38096545,0.43103183,0.39147111,0.38359450,0.38520439,0.36627391,0.41153166,0.41793722,0.37635431,0.39107955,0.38595487,0.40843760,0.39070516,0.40343801,0.40576566,0.43270413,0.42156541,0.41106159,0.40886903,0.43139185\n\t\t,0.39092420,0.40509746,0.38462608,0.39254555,0.42237724,0.43725118,0.39628039,0.38576850,0.41209063,0.03750579,0.04760261,0.05168791,0.03344573,0.02936372,0.02798280,0.05224864,0.05357161,0.05064862,0.00315818,0.00548762,0.02177673,0.05148576,0.04287800,0.02655884,0.45141648,0.44433318,0.45723149,0.43486706,0.42420608,0.41796086,0.69194832,0.64826196,0.57409094,0.72620841,0.70342076,0.69682757,0.52146383,0.56290229\n\t\t,0.60047585,0.37561548,0.22281922,0.11905768,0.08604293,0.21561773,0.48044676,0.11987411,0.26999017,0.54417737,0.11212557,0.22002920,0.34931560,0.09155541,0.17166825,0.27767098,0.93129812,0.93230651,0.93587955,0.93140047,0.93076038,0.93075616,0.98921979,0.96030591,0.94298934,1.00000000,1.00000000,1.00000000,0.95022507,0.96541383,0.98116098,0.87715601,0.76051886,0.57245913,0.82288002,0.89394510,0.94176642,0.82456702\n\t\t,0.90200738,0.95330483,0.63166853,0.76215276,0.86543866,0.61447622,0.75495653,0.85996864,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99605240,1.00000000,1.00000000,0.99145628,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99632727,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.53971208,0.55904458,0.48050721,0.51537575,0.58707525,0.57081212,0.45525904,0.45635032\n\t\t,0.42003543,0.53893884,0.52200407,0.49181486,0.47844459,0.53307625,0.54631783,0.72968776,0.83328952,0.99913914,1.00000000,0.85412263,0.72116472,1.00000000,0.97584313,0.73883616,0.99714623,0.86816722,0.63994402,0.99530281,0.95842981,0.80137787,0.40069889,0.39415208,0.38907581,0.42169950,0.40294547,0.41400282,0.42787275,0.46394870,0.46902167,0.43537200,0.44198501,0.46586157,0.41982299,0.43005241,0.44585337,0.37762256\n\t\t,0.38373228,0.40232413,0.42181697,0.39113748,0.40566322,0.40994310,0.37594344,0.37666461,0.38832013,0.36392216,0.36192749,0.43346365,0.41192375,0.39434362,0.05274094,0.02955299,0.04115946,0.04292613,0.01101571,0.47696529,0.42007226,0.47582933,0.70998094,0.70405459,0.94216834,0.93137380,0.93576821,1.00000000,0.99398405,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,0.45330390,0.50466672,0.42644152,0.47501032,0.54588529,0.41641965,0.41635144,0.43317330,0.44486197,0.45010963\n\t\tTransform: -0.763213157653809,-0.535787284374237,0.361162692308426,0.000000000000000,0.063031375408173,-0.618017315864563,-0.783633887767792,0.000000000000000,0.643065273761749,-0.575314998626709,0.505450129508972,0.000000000000000,-2.401984930038452,1.112190842628479,-1.157461762428284,1.000000000000000\n\t\tTransformLink: -0.763212740421295,0.643065392971039,-0.063031345605850,0.000000000000000,-0.535786628723145,-0.575314760208130,0.618016958236694,0.000000000000000,0.361162334680557,0.505450010299683,0.783633649349213,0.000000000000000,-0.819296956062317,2.769532203674316,0.068272873759270,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-hand_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 2893,2895,2900,2917,2918,2919,2920,2929,2931,2932,2933,2934,2935,2936,2937,2954,2955,2971,2984,2985,2991,3062,3063\n\t\t,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086\n\t\t,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3099,3100,3101,3102,3103,3104,3105,3112,3174,3175,3176,3177\n\t\t,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,3190,3199,3200,3206,3209,3210,3211,3212,3213,3214,3215\n\t\t,3216,3217,3218,3219,3220,3221,3222,3242,3243,3244,3245,3246,3247,3248,3249,3250,3253,3254,3256,3258,3259,3260,3261\n\t\t,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,3278,3279,3280,3281,3282,3283,3284\n\t\t,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,3296,3297,5801,5822,5823,5824,5825,5828,5829,5831,5832,5833\n\t\t,5834,5837,5838,5840,5841,5842,5843,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861\n\t\t,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884\n\t\t,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907\n\t\t,5908,5909,5910,5911,7655,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696\n\t\t,7698,7699,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,7714,7715,7716,7717,7718,7719,7720,7721\n\t\t,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,8104,8105,8106,8107,8108,8109\n\t\t,8110,8111,8112,8113\n\t\tWeights: 0.01113399,0.02138712,0.00769915,0.05848624,0.02733521,0.07425906,0.06440524,0.00908602,0.02251168,0.12507287,0.08113199,0.15377786,0.08667850,0.14084559,0.02340840,0.02654728,0.05484073,0.02720593,0.07093086,0.09120202,0.06126906,0.64437173,0.49420609,0.48802767,0.45160002,0.44628764,0.45153846,0.58228564,0.62644819,0.64715878,0.66166963,0.66180491,0.61093649,0.59313993,0.52642881,0.49342103,0.47017526,0.56628289\n\t\t,0.62194538,0.50675293,0.46323221,0.52726505,0.54804958,0.55354845,0.52872238,0.47900415,0.51763229,0.58899725,0.61932419,0.44634953,0.42195691,0.56795303,0.59333336,0.57452493,0.42127558,0.02570638,0.04004726,0.03998628,0.07653803,0.08161900,0.08104690,0.05162788,0.04593823,0.00939110,0.01220791,0.03825400,0.09868389,0.15030116,0.29383104,0.35511452,0.69388189,0.73774974,0.59845176,0.85447265,0.77076852,1.00000000\n\t\t,0.60483868,0.31484895,0.56884426,0.17211037,0.10408511,0.25339218,0.42923129,0.05516952,0.00802038,0.39433507,0.56290166,0.71999584,0.19806049,0.78262046,0.50142933,0.67333295,0.06902430,0.42739831,0.47413941,0.20460165,0.62315984,0.45126133,0.05453802,0.18247250,0.18051179,0.38448588,1.00000000,1.00000000,0.37238646,0.31162119,0.28285156,0.20777880,0.58761313,0.51914909,0.10619374,0.59521390,0.59290982,0.52013734\n\t\t,0.54243759,0.50084583,0.48930788,0.50038318,0.49091432,0.52629595,0.63370533,0.56015134,0.50650091,0.55839882,0.60346794,0.46596059,0.54555589,0.56992510,0.45856315,0.50630314,0.62404859,0.30805633,0.22052120,0.20849734,0.19360051,0.24438739,0.34205668,0.59610996,0.64582633,0.59511112,0.35982516,0.26970969,0.24361539,0.50088733,0.57187369,0.66545963,0.68497729,0.63123065,0.50200264,0.35911243,0.25124501,0.00095456\n\t\t,0.14779234,0.19532929,0.27518160,0.08904636,0.25016377,0.30388699,0.09617504,0.10993402,0.25456844,0.06354679,0.25945174,0.25602611,0.01285240,0.00023754,0.32696513,0.14941781,0.26616261,0.36159030,0.02200244,0.07156087,0.09287147,0.24553206,0.03829301,0.00068976,0.00158904,0.29801473,0.19337790,0.00126609,0.07154818,0.06114399,0.24173395,0.09017607,0.00320984,0.00549200,0.21451679,0.25468467,0.00139213,0.58976715\n\t\t,0.60013300,0.59837133,0.58811491,0.55473520,0.58151493,0.60827709,0.59515342,0.57083807,0.56686424,0.58209831,0.58832867,0.59957452,0.53827476,0.54634876,0.59561155,0.61903455,0.56896817,0.60852889,0.61640550,0.61479561,0.63372609,0.58846834,0.58206278,0.62364569,0.60892045,0.61404513,0.59156240,0.60929484,0.59656199,0.59423434,0.56729587,0.57843459,0.58893841,0.59113097,0.56860815,0.60907580,0.59490254,0.61537392\n\t\t,0.60745445,0.57762276,0.56274882,0.60371961,0.61423150,0.58790937,0.00367273,0.46028792,0.44095542,0.51949279,0.48462425,0.41292475,0.42918788,0.54474096,0.54364968,0.57996457,0.46106116,0.47799593,0.50818514,0.52155541,0.46692375,0.45368217,0.27031224,0.16671048,0.00086086,0.14587737,0.27883528,0.02415687,0.26116384,0.00285377,0.13183278,0.36005598,0.00469719,0.04157019,0.19862213,0.59930111,0.60584792,0.61092419\n\t\t,0.57830050,0.59705453,0.58599718,0.57212725,0.53605130,0.53097833,0.56462800,0.55801499,0.53413843,0.58017701,0.56994759,0.55414663,0.62237744,0.61626772,0.59767587,0.57818303,0.60886252,0.59433678,0.59005690,0.62405656,0.62333539,0.61167987,0.63607784,0.63807251,0.56653635,0.58807625,0.60565638,0.54669610,0.49533328,0.57355848,0.52498968,0.45411471,0.58358035,0.58364856,0.56682670,0.55513803,0.54989037\n\t\tTransform: 0.434550851583481,-0.326211035251617,0.839495539665222,0.000000000000000,-0.750041782855988,-0.647088289260864,0.136801347136497,0.000000000000000,0.498601317405701,-0.689103662967682,-0.525864005088806,0.000000000000000,-1.047753572463989,1.107161402702332,2.270463943481445,1.000000000000000\n\t\tTransformLink: 0.434550464153290,0.498601257801056,0.750041544437408,0.000000000000000,-0.326210469007492,-0.689103364944458,0.647087752819061,0.000000000000000,0.839495003223419,-0.525864303112030,-0.136801257729530,0.000000000000000,-1.089573621749878,2.479315757751465,0.380030453205109,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_01_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1661,1662,1663,1667,1668,1671,1695,1696,1787,1788,1810,1815,1855,1863,1887,1979,2543,2583,2697,2698,2703,2704,2736\n\t\t,2852,2853,2854,2855,2856,2857,2858,2862,2863,2864,2881,2883,2884,2885,2886,2887,2888,2889,2893,2894,2895,2908,2911\n\t\t,2912,2913,2914,2915,2917,2918,2919,2925,2926,2927,2928,2930,2931,2932,2933,2934,2944,2946,2948,2949,2953,2954,2955\n\t\t,2956,2961,2962,2965,2968,2973,2978,2979,2982,2987,2989,2993,2997,2999,3000,3001,3003,3004,3009,3010,3011,3013,3014\n\t\t,3015,3018,3019,3027,3063,3064,3079,3080,3081,3085,3089,3096,3097,3099,3101,3102,3103,3106,3107,3130,3132,3137,3140\n\t\t,3142,3143,3147,3150,3152,3153,3157,3158,3160,3162,3163,3167,3168,3170,3171,3172,3175,3176,3177,3178,3180,3196,3197\n\t\t,3202,3205,3208,3218,3223,3226,3227,3228,3231,3232,3234,3235,3236,3237,3238,3239,3240,3251,3259,3268,3269,3272,3275\n\t\t,3284,3285,3286,3287,3288,3289,3296,3297\n\t\tWeights: 0.02726322,0.02778560,0.01053769,0.06221302,0.00475059,0.06152828,0.17300706,0.04239708,0.12137129,0.01994121,0.03702287,0.20864073,0.01457468,0.04201571,0.01265157,0.08408250,0.04661769,0.00839330,0.09432359,0.00067620,0.12371304,0.02678271,0.07261761,0.09319797,0.05668129,0.11554562,0.02930763,0.24468502,0.21489954,0.23694628,0.04656004,0.10236415,0.00139541,0.28280096,0.01508063,0.20057781,0.23331188,0.20015628\n\t\t,0.58168272,0.52321766,0.45526948,0.09856753,0.19596429,0.03105430,0.06342472,0.80839580,0.77196525,0.65880103,0.69862683,0.57126599,0.10928191,0.25199741,0.04141298,0.43802040,0.05377123,0.91873567,0.68746796,0.61496894,0.60526328,0.13383303,0.29271337,0.05612336,0.07249144,1.00000000,0.04596367,0.79835609,0.01329927,0.11812469,0.49575551,1.00000000,0.24895715,0.47410658,0.21559446,0.23992223,0.92636513,0.04190897\n\t\t,0.77191468,0.32935860,0.11889925,0.16729796,0.16567524,0.25233664,0.65054079,0.01666274,0.98247299,0.88713500,0.07922608,0.00839465,0.02950762,0.00896275,0.07820902,0.06957856,0.07696857,0.04634780,0.06164755,0.00411257,0.00388170,0.00128745,0.06388143,0.13941874,0.08546888,0.11775571,0.01949121,0.83013116,0.05306890,0.22036427,0.05317497,0.19427317,0.78634568,0.05464225,0.11233841,0.01145626,0.00073551,0.04378007\n\t\t,0.06262964,0.03948203,0.01409040,0.08968773,0.10815249,0.07054844,0.04785975,0.16792636,0.00594827,0.19399941,0.12323696,0.12257201,0.34768423,0.04619954,0.37403384,0.02651403,0.25198400,0.11156749,0.43101112,0.10950826,0.18479151,0.05849624,0.30139011,0.07015947,0.78411745,0.93693279,0.04054331,0.03169207,0.14477217,0.43439967,0.06612419,0.01672560,0.34487788,0.29934559,0.62662803,0.83395660,0.75962449,0.65079807\n\t\t,0.69857526,1.00000000,0.16889144,0.75985933,0.01014314,0.03521578,0.03957909,0.02728144,0.00487273,0.00793592,0.07433703,0.19751851,0.48116411,0.50467268,0.19952791,0.01554761,0.07416843\n\t\tTransform: 0.727384328842163,-0.225528329610825,0.648112475872040,0.000000000000000,-0.496585249900818,-0.824827432632446,0.270302772521973,0.000000000000000,0.473619788885117,-0.518457174301147,-0.711959838867188,0.000000000000000,-0.582022249698639,0.625687658786774,2.589341878890991,1.000000000000000\n\t\tTransformLink: 0.727383732795715,0.473619580268860,0.496585220098495,0.000000000000000,-0.225527822971344,-0.518456637859344,0.824826598167419,0.000000000000000,0.648112177848816,-0.711959958076477,-0.270302712917328,0.000000000000000,-1.113720536231995,2.443556785583496,0.472845971584320,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_01_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1649,1650,1651,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672\n\t\t,1689,1690,1691,1693,1694,1695,1696,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728\n\t\t,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,1750,1751,1752,1753,1754,1755,1756,1757,1758,1759\n\t\t,1760,1785,1786,1787,1788,1793,1794,1795,1797,1798,1804,1805,1807,1810,1812,1814,1815,1816,1817,1849,1855,1863,1864\n\t\t,1887,1979,1980,2540,2541,2542,2543,2544,2545,2546,2553,2554,2555,2556,2560,2561,2563,2564,2565,2566,2583,2695,2696\n\t\t,2697,2698,2701,2702,2703,2704,2707,2708,2709,2711,2712,2719,2720,2722,2727,2728,2736,2737,2851,2852,2853,2854,2855\n\t\t,2856,2857,2858,2859,2862,2863,2879,2881,2883,2884,2885,2886,2887,2888,2889,2893,2894,2908,2911,2912,2913,2914,2915\n\t\t,2918,2925,2927,2928,2931,2999,3001,3004,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020\n\t\t,3022,3025,3027,3031,3057,3106,3107,3223,3226,3227,3231,3232,3234,3235,3236,3237,3251\n\t\tWeights: 0.00161729,0.05873968,0.00408875,0.82837242,0.82133865,0.70951994,0.68147218,1.00000000,0.83775859,1.00000000,1.00000000,0.89347282,0.54829701,0.98946231,1.00000000,0.65999029,0.01735703,0.40137337,0.80021060,0.63889899,0.06793362,0.93847172,0.98937318,0.86072134,1.00000000,1.00000000,0.07287740,0.56543402,0.65985388,0.89837140,0.91348251,0.98438034,1.00000000,0.88098267,0.93567309,0.96186042,1.00000000,0.88341786\n\t\t,0.68557392,0.47344345,0.64554368,0.57518220,0.29045143,0.26473042,0.22536067,0.34077271,0.20456426,0.12376852,0.05440239,0.09214485,0.31587007,0.17157060,0.37353792,0.18770126,0.21084812,0.13527517,0.08178688,0.20601324,0.80307603,0.84255124,0.93490980,0.70521609,0.40617285,0.36348800,0.34713207,0.50133973,0.83711587,0.91336173,0.93079050,0.78669964,0.06140900,0.59186532,0.84056886,0.93149303,0.89420834,0.28054368\n\t\t,0.16924534,0.72197334,0.40112982,0.43380908,0.73395474,0.88328650,0.81120751,0.30449118,0.20736623,0.35601132,0.58971961,0.06865885,0.00501944,0.26683009,0.23575141,0.02387724,0.02802494,0.13120214,0.00268165,0.03404493,0.76762264,0.72878680,0.65768984,1.00000000,1.00000000,0.94695275,1.00000000,0.95581060,0.34581695,0.15388160,0.18496751,0.06378946,0.62666496,0.33371343,0.88463821,0.87858788,0.22207242,0.04434967\n\t\t,0.61414864,0.90567641,0.97280924,0.07342561,0.60594203,0.36120557,0.78244440,0.91196995,0.25678211,0.15153540,0.75273211,0.39428518,0.44687857,0.76025964,0.87674320,0.20581908,0.32267012,0.18978315,0.02024123,1.00000000,0.76864214,0.94331871,0.88445438,0.97069237,0.57050149,0.68912310,0.28214207,0.00682392,0.02873819,0.09862436,1.00000000,0.66694418,0.98491937,0.69375371,0.76668812,0.79984372,0.25116222,0.42448617\n\t\t,0.14181164,0.01058128,0.06569569,0.93657528,0.19160420,0.21792721,0.27742861,0.16654709,0.09580104,0.04446689,0.28480225,0.08126433,0.07944689,0.03859863,0.05988690,0.01705170,0.05204945,1.00000000,1.00000000,0.98471598,0.75003418,0.69485932,0.99103725,1.00000000,0.84961853,0.92586113,0.73112919,1.00000000,0.86287392,0.95365220,0.67880646,0.01218698,0.09356430,0.04256551,0.06125760,0.08112145,0.08644509,0.16777212\n\t\t,0.56188409,0.08620390,0.38033808,0.01940078,0.65512212,0.21379328,0.04885903,0.02126050,0.10284383,0.03648452,0.22416075\n\t\tTransform: 0.733102858066559,-0.098658926784992,0.672924399375916,0.000000000000000,-0.507454216480255,-0.738108813762665,0.444619417190552,0.000000000000000,0.452825546264648,-0.667429924011230,-0.591173768043518,0.000000000000000,-0.532971501350403,1.013681411743164,2.438605785369873,1.000000000000000\n\t\tTransformLink: 0.733102321624756,0.452825397253036,0.507454097270966,0.000000000000000,-0.098658517003059,-0.667429566383362,0.738107979297638,0.000000000000000,0.672924160957336,-0.591174125671387,-0.444619208574295,0.000000000000000,-1.150265693664551,2.359544515609741,0.606503248214722,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_02_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1649,1650,1651,1652,1653,1654,1655,1656,1658,1665,1666,1668,1669,1670,1672,1688,1689,1693,1694,1696,1705,1706,1707\n\t\t,1708,1709,1710,1711,1712,1713,1714,1716,1717,1718,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732\n\t\t,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,1750,1751,1752,1753,1754,1755\n\t\t,1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,1776,1778,1779\n\t\t,1780,1781,1784,1785,1786,1788,1792,1793,1794,1795,1796,1797,1798,1799,1800,1802,1803,1804,1805,1807,1810,1811,1812\n\t\t,1813,1814,1816,1817,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840,2539,2540,2541,2542,2551,2552,2554,2555,2556\n\t\t,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2576,2577,2695,2696,2698,2701,2702\n\t\t,2704,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2717,2718,2719,2720,2721,2722,2725,2726,2727,2728,2732,2733\n\t\t,3010,3013,3014,3015,3019\n\t\tWeights: 0.94145594,0.87977467,0.98021473,1.00000000,0.17162758,0.17866135,0.29048006,0.31852782,0.01173308,0.34000971,0.90706134,0.02736912,0.36110101,0.86100033,0.01062682,1.00000000,0.13927866,0.84567566,0.43456598,0.04908618,0.05956580,0.02785237,0.09247883,0.09594000,0.06192768,0.10624933,0.10685239,0.03559822,0.06476877,0.01561966,0.08753267,0.06432691,0.03813958,0.11658214,0.31442608,0.52655655,0.35445632,0.42481780\n\t\t,0.70954857,0.73526958,0.77463933,0.65922729,0.15740263,0.35175737,0.38967277,0.23051586,0.39673914,0.36728948,0.14977215,0.36101490,0.78204632,0.87623148,0.94559761,0.90785515,0.68412993,0.82842940,0.62646208,0.81229874,0.78915188,0.86472483,0.91821312,0.79393552,0.19692397,0.15744876,0.06509020,0.29478391,0.59382715,0.63651200,0.65286793,0.49866027,0.16288413,0.08663827,0.06920950,0.21330036,0.80953938,0.74605266\n\t\t,0.69032540,0.83316232,0.67120091,0.73502608,0.81629907,0.70574562,0.31204166,0.59084697,0.55241770,0.29555996,0.52450764,0.55493502,0.48825952,0.51743743,0.03864751,0.01503480,0.02653950,0.04517766,0.05103924,0.85474503,0.40813468,0.04856576,0.06519230,0.10579166,0.71945632,0.81704489,0.34918247,0.27802666,0.59887018,0.68765074,0.52047914,0.55042688,0.68194520,0.56619092,0.26604526,0.11671350,0.04500772,0.37801305\n\t\t,0.69550882,0.06568978,0.78259325,0.41028039,0.84383707,0.22263394,0.23699905,0.20216755,0.08472186,0.12303182,0.07736823,0.21136955,0.22109889,0.19065314,0.20690316,0.96970747,0.91450778,0.23237736,0.27121320,0.00027838,0.00678002,0.04418940,0.65418305,0.84611840,0.10514151,0.36915658,0.31578827,0.81503249,0.93621054,0.10607900,0.37333504,0.66628657,0.11536179,0.12141212,0.74885235,0.78658235,0.50044331,0.60529312\n\t\t,0.04961176,0.05352229,0.21135724,0.21150382,0.87374113,0.38585136,0.02651457,0.85129112,0.39405797,0.03172214,0.07928432,0.08803005,0.74321789,0.84846460,0.36506379,0.24726789,0.60571482,0.68982911,0.51623425,0.00883665,0.02406402,0.54531213,0.55312143,0.23974036,0.67789431,0.10084523,0.39652250,0.07601544,0.78945986,0.67732988,0.21740557,0.23023107,0.00006825,0.00987236,0.00456031,0.00404505,0.00054114\n\t\tTransform: 0.766429185867310,-0.053470060229301,0.640099942684174,0.000000000000000,-0.476983666419983,-0.714805543422699,0.511410176753998,0.000000000000000,0.430201739072800,-0.697276830673218,-0.573351383209229,0.000000000000000,-0.421990036964417,1.076823949813843,2.403566122055054,1.000000000000000\n\t\tTransformLink: 0.766428530216217,0.430201500654221,0.476983606815338,0.000000000000000,-0.053469650447369,-0.697276353836060,0.714804708957672,0.000000000000000,0.640099704265594,-0.573351681232452,-0.511409938335419,0.000000000000000,-1.157519340515137,2.310473203659058,0.660771012306213,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_03_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1649,1650,1651,1666,1670,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1692,1693,1697\n\t\t,1698,1699,1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1729,1730,1731,1732,1733,1734,1735,1736\n\t\t,1737,1748,1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,1776,1777,1778,1779,1780,1781\n\t\t,1782,1783,1784,1785,1789,1790,1791,1792,1795,1796,1799,1800,1801,1802,1803,1806,1808,1809,1811,1813,1814,1817,1818\n\t\t,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840,2539\n\t\t,2540,2547,2548,2549,2550,2551,2552,2557,2558,2559,2562,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2695\n\t\t,2699,2700,2701,2705,2706,2710,2713,2714,2715,2716,2717,2718,2721,2723,2724,2725,2726,2727,2729,2730,2731,2732,2733\n\t\tWeights: 0.05692678,0.06148564,0.01569651,0.07558163,0.07106604,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.08144694,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.94043420,0.97214763,0.90752117,0.90406000,0.93807232,0.89375067,0.89314761,0.96440178\n\t\t,0.84259737,0.64824263,0.61032723,0.76948414,0.60326086,0.63271052,0.85022785,0.63898510,0.01338943,0.00005123,0.19046062,0.25394734,0.30967460,0.16683768,0.32879909,0.26497392,0.18370093,0.29425438,0.68795834,0.40915303,0.44758230,0.70444004,0.47549236,0.44506498,0.51174048,0.48256257,1.00000000,0.96135249,0.98496520,0.97346050,0.95482234,1.00000000,1.00000000,0.94896076,0.08384597,1.00000000,1.00000000,1.00000000\n\t\t,0.93480770,0.01370977,0.65081753,0.31234926,0.47952086,1.00000000,0.44957312,0.31805480,1.00000000,1.00000000,1.00000000,0.62198695,0.93431022,0.01004052,0.08750408,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.77736606,0.76300095,0.79783245,0.91527814,0.87696818,0.92263177,0.78863045,0.77890111,0.80934686,0.79309684\n\t\t,0.03029253,0.05144730,1.00000000,1.00000000,1.00000000,1.00000000,0.99972162,0.99321998,0.89485849,0.63084342,0.68421173,0.89392100,0.25114765,0.21341765,0.49955669,0.39470688,0.95038824,0.94647771,1.00000000,1.00000000,1.00000000,0.78864276,0.78849618,0.08190920,1.00000000,1.00000000,0.07528328,1.00000000,0.92071568,0.63493621,0.31017089,0.48376575,0.99116335,1.00000000,0.97593598,0.45468787,0.32210569,1.00000000\n\t\t,1.00000000,0.60347750,0.92398456,0.00472106,1.00000000,1.00000000,1.00000000,0.78259443,0.76976893\n\t\tTransform: 0.786200642585754,-0.049849487841129,0.615957915782928,0.000000000000000,-0.445841491222382,-0.735955297946930,0.509505510330200,0.000000000000000,0.427918821573257,-0.675193071365356,-0.600832700729370,0.000000000000000,-0.372182756662369,0.966843545436859,2.436784267425537,1.000000000000000\n\t\tTransformLink: 0.786200046539307,0.427918612957001,0.445841401815414,0.000000000000000,-0.049849070608616,-0.675192713737488,0.735954523086548,0.000000000000000,0.615957736968994,-0.600833058357239,-0.509505331516266,0.000000000000000,-1.160149812698364,2.276170253753662,0.695936262607574,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_01_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 2914,2915,2922,2923,2928,2930,2931,2933,2943,2944,2951,2952,2953,2954,2955,2961,2962,2967,2968,2973,2982,2987,3063\n\t\t,3064,3065,3066,3067,3068,3077,3079,3080,3081,3082,3083,3084,3085,3094,3096,3097,3098,3099,3103,3123,3130,3131,3132\n\t\t,3133,3134,3136,3137,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,3157,3158\n\t\t,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,3175,3176,3177,3178,3179,3181,3182\n\t\t,3202,3204,3208,3209,3214,3215,3216,3217,3218,3219,3234,3235,3236,3237,3238,3240,3241,3247,3248,3249,3250,3262,3263\n\t\t,3266,3268,3269,3272,3273,3275,3286,3287,3288,3289,3292,3293,3294,3295,3296,3297\n\t\tWeights: 0.00259421,0.00877402,0.88997740,0.79497873,0.06150484,0.20382676,0.06864066,0.04004687,0.71335850,0.59953660,0.97762040,0.92431932,0.86602982,0.68688757,0.20330193,0.37559780,0.21992986,1.00000000,0.63064993,0.06295649,0.67064140,0.63917937,0.04352055,0.05828964,0.06299767,0.05506969,0.04366665,0.02108849,0.01859553,0.00490362,0.12203027,0.22863985,0.22209293,0.13340132,0.07468366,0.05132456,0.04228261,0.14154738\n\t\t,0.90688384,1.00000000,0.73964945,0.01375436,0.01715645,0.01649266,0.00011314,0.01794824,0.05082380,0.01233862,0.00266735,0.04066958,0.06274387,0.02547437,0.05830587,0.07537972,0.05443065,0.06374546,0.05362186,0.08255866,0.01819216,0.05285993,0.10066172,0.06185106,0.08862966,0.11645739,0.10560475,0.20280422,0.12511926,0.14687429,0.08886824,0.17274769,0.16049279,0.09075999,0.14671759,0.23212375,0.26883183,0.69787709\n\t\t,0.34795638,0.29432338,0.22243264,0.73555624,0.22804197,0.25341347,0.24897327,1.00000000,0.90921803,0.65583814,0.14981456,0.49452300,0.08098299,0.24301289,0.40154824,0.01824940,0.21588255,0.92738224,0.95945669,0.60566493,0.43366057,0.18838119,0.93097570,0.06335604,0.25422896,0.79539835,0.14151053,0.06063956,0.05530926,0.11009891,0.26243001,0.83110856,1.00000000,0.62761354,0.68837881,0.71714844,0.79222120,0.06862484\n\t\t,0.08799304,0.05224957,0.03081761,0.06003033,0.09061832,0.02640117,0.09682778,0.01148921,0.08225202,0.21926408,0.55666962,0.00205220,0.08255541,0.18793483,0.39202274,0.57524005,0.64552096\n\t\tTransform: -0.870748043060303,0.388418734073639,0.301544696092606,0.000000000000000,-0.468064934015274,-0.842654526233673,-0.266175031661987,0.000000000000000,0.150710031390190,-0.372913986444473,0.915544569492340,0.000000000000000,-1.537466287612915,0.926158785820007,-2.036096096038818,1.000000000000000\n\t\tTransformLink: -0.870747566223145,0.150710523128510,0.468064606189728,0.000000000000000,0.388418793678284,-0.372913658618927,0.842653930187225,0.000000000000000,0.301544249057770,0.915544331073761,0.266175329685211,0.000000000000000,-1.084509491920471,2.441226005554199,0.481160879135132,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_02_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 2417,2418,2419,2420,2421,2422,2438,2440,2441,2449,2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2461,2462\n\t\t,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485\n\t\t,2486,2487,2488,2495,2496,2497,2501,2502,2503,2504,2505,2507,2508,2512,2513,2514,2515,2529,2530,2531,2532,2533,2534\n\t\t,2535,2536,2537,2538,2914,2922,2923,2928,2930,2931,2943,2944,2951,2952,2953,2954,2955,2961,2962,2968,2987,3113,3114\n\t\t,3115,3116,3117,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137\n\t\t,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160\n\t\t,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3174,3175,3176,3177,3204,3234,3235,3236,3237,3238\n\t\tWeights: 0.65945127,0.61694189,0.73841693,0.67714014,0.64938875,0.65790830,0.70279372,0.67334173,0.00026207,0.03264082,0.01733538,0.04387265,0.04600502,0.00431617,0.04624742,0.05235626,0.05607054,0.13152324,0.13640160,0.14132612,0.08111236,0.17005117,0.14722192,0.09431236,0.17378805,0.84357527,0.82495298,0.86900587,0.83805531,0.84400401,0.92245456,0.89068353,0.84889311,0.34289992,0.33992720,0.38383064,0.31637655,0.35976666\n\t\t,0.34830517,0.27799368,0.34766140,0.20335003,0.20952303,0.25042509,0.17047528,0.26135758,0.20340736,0.12934132,0.21179782,0.02254193,0.00971445,0.64478574,0.04249477,0.83567344,0.16736211,0.33997768,0.22580586,0.26236119,0.38285432,0.18411158,0.04138089,0.84169635,0.66028710,0.10520452,0.08505120,0.12808921,0.08610298,0.04197988,0.05653701,0.09206966,0.08886190,0.11227835,0.11434289,0.01102491,0.11002260,0.20502127\n\t\t,0.07426731,0.18120430,0.05433695,0.28664150,0.32797197,0.02237960,0.07568068,0.12067090,0.15628495,0.14222230,0.34489396,0.25688139,0.12942784,0.24192138,0.93268268,0.92180757,0.94314714,0.92741926,0.93799506,1.00000000,0.97579948,0.93778803,0.92880606,0.93222865,0.95708940,0.97510869,1.00000000,0.98735273,0.99247282,1.00000000,1.00000000,0.96382516,0.97165261,0.96049816,0.94813429,0.98766138,1.00000000,0.99733265\n\t\t,0.91555035,1.00000000,1.00000000,0.87462649,0.97223291,0.90221209,0.91052988,0.94556935,0.93625454,0.94637814,0.82775362,0.98180784,0.94714007,0.79118578,0.93814894,0.84082190,0.83568286,0.89439525,0.79719578,0.87488074,0.68519935,0.90518349,0.82725231,0.64550780,0.90924001,0.73004546,0.64530423,0.73116817,0.30212291,0.65204362,0.35799238,0.73136782,0.26444376,0.39792419,0.72007250,0.49904273,0.05252798,0.08634036\n\t\t,0.06132235,0.01599558,0.07261776,0.18013468,0.08414333,0.07243380,0.13099719,0.03899473\n\t\tTransform: 0.888905286788940,0.315152317285538,-0.332456171512604,0.000000000000000,0.438429296016693,-0.795633137226105,0.418029308319092,0.000000000000000,-0.132769703865051,-0.517347037792206,-0.845413982868195,0.000000000000000,1.496748208999634,1.130333423614502,1.919867515563965,1.000000000000000\n\t\tTransformLink: 0.888904690742493,-0.132770121097565,-0.438428938388824,0.000000000000000,0.315152287483215,-0.517346441745758,0.795632183551788,0.000000000000000,-0.332455724477768,-0.845413625240326,-0.418029427528381,0.000000000000000,-1.048422694206238,2.406579732894897,0.559449195861816,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_03_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 2417,2418,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2433,2434,2435,2436,2437,2438,2439\n\t\t,2440,2441,2442,2443,2444,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2461,2462\n\t\t,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485\n\t\t,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,2500,2501,2502,2503,2504,2505,2506,2507,2508\n\t\t,2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531\n\t\t,2532,2533,2534,2535,2536,2537,2538,3113,3114,3115,3116,3117,3119,3120,3121,3122,3123,3124,3126,3127,3130,3131,3132\n\t\t,3133,3141\n\t\tWeights: 0.34054873,0.38305811,0.26158307,0.32285986,0.35061125,0.34209170,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.29720628,1.00000000,0.32665827,0.99973793,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.96735918,0.98266462,0.95612735,0.95399498,0.99568383,0.95375258\n\t\t,0.94764374,0.94392946,0.86847676,0.86359840,0.85867388,0.91888764,0.82994883,0.85277808,0.90568764,0.82621195,0.15642473,0.17504702,0.13099413,0.16194469,0.15599599,0.07754544,0.10931647,0.15110689,0.65710008,0.66007280,0.61616936,0.68362345,0.64023334,0.65169483,0.72200632,0.65233860,0.79664997,0.79047697,0.74957491,0.82952472,0.73864242,0.79659264,0.87065868,0.78820218,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,0.97745807,0.99028555,0.35521426,1.00000000,1.00000000,1.00000000,0.95750523,0.16432656,0.83263789,0.66002232,0.77419414,1.00000000,0.73763881,0.61714568,1.00000000,1.00000000,1.00000000,0.81588842,0.95861911,0.15830365,0.33971290,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.89479548,0.91494880\n\t\t,0.87191079,0.91389702,0.95802012,0.94346299,0.90793034,0.91113810,0.88772165,0.88565711,0.06731732,0.07819243,0.05685286,0.07258074,0.06200494,0.02420052,0.06221197,0.07119394,0.06777135,0.02575415,0.02489131,0.01264727,0.00752718,0.00822591,0.02823426,0.02081809,0.00104191,0.00229271\n\t\tTransform: 0.872855961322784,0.286081403493881,-0.395323365926743,0.000000000000000,0.455798059701920,-0.767295718193054,0.451116681098938,0.000000000000000,-0.174273252487183,-0.573947608470917,-0.800133466720581,0.000000000000000,1.589325189590454,1.176856517791748,1.768730401992798,1.000000000000000\n\t\tTransformLink: 0.872855424880981,-0.174273669719696,-0.455797731876373,0.000000000000000,0.286081403493881,-0.573946952819824,0.767294764518738,0.000000000000000,-0.395322918891907,-0.800133168697357,-0.451116770505905,0.000000000000000,-1.024708151817322,2.367650508880615,0.619318783283234,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_02_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1658,1661,1662,1667,1668,1695,1696,1716,1787,1810,1815,1849,1852,1853,1854,1855,1859,1863,1864,1882,1887,1888,1912\n\t\t,1979,1980,2002,2007,2047,2055,2079,2171,2543,2546,2582,2583,2622,2703,2704,2722,2736,2737,2742,2775,2852,2856,2857\n\t\t,2858,2859,2860,2861,2862,2863,2864,2865,2868,2869,2881,2884,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2898\n\t\t,2899,2900,2912,2913,2914,2915,2916,2917,2918,2919,2920,2924,2925,2926,2928,2931,2932,2933,2934,2935,2936,2945,2948\n\t\t,2949,2954,2955,2961,2962,2964,2965,2966,2971,2972,2973,2974,2975,2976,2977,2978,2979,2980,2981,2988,2989,2990,2993\n\t\t,2994,2996,2997,2998,2999,3000,3001,3002,3003,3004,3009,3010,3013,3015,3017,3019,3020,3022,3023,3025,3026,3027,3030\n\t\t,3031,3055,3057,3079,3085,3088,3089,3096,3100,3101,3102,3103,3104,3106,3107,3108,3175,3176,3177,3178,3179,3180,3183\n\t\t,3186,3192,3193,3196,3197,3198,3201,3205,3223,3224,3225,3226,3227,3228,3232,3234,3236,3237,3251,3283,3284,3285,3286\n\t\t,3287,3288\n\t\tWeights: 0.05543525,0.03532331,0.14155470,0.21906427,0.06639016,0.10962948,0.01014534,0.00328126,0.03805985,0.05397452,0.27320318,0.00368091,0.05179178,0.08284860,0.02498980,0.20597466,0.03751292,0.21557843,0.03308680,0.03159857,0.24829727,0.05135588,0.00041744,0.45183885,0.05663690,0.02457293,0.14621400,0.00748375,0.01367476,0.00899872,0.04947014,0.10673951,0.00878185,0.07297453,0.18603201,0.03310826,0.27957430,0.07173662\n\t\t,0.00335795,0.35052867,0.05453762,0.07284338,0.02989730,0.08162631,0.12955999,0.07899243,0.35300970,0.19673581,0.26160115,0.17613491,0.45602809,0.51924952,0.35450021,0.07432703,0.03633119,0.11091296,0.05025486,0.08649339,0.15246544,0.05229617,0.32348623,0.78603716,0.66317946,0.85917827,0.60250296,0.57588486,0.34831858,0.08567948,0.03418033,0.05684580,0.14694413,0.01010753,0.06377036,0.12120695,0.29426029,0.94031133\n\t\t,0.62590139,0.56630378,0.46883923,0.17188322,0.23395750,0.22321237,0.89412039,0.09731300,0.21064879,0.61327627,0.52173477,0.48958801,0.06618868,0.18101544,0.16474938,0.91041169,0.20164391,0.01215552,0.10387952,0.03055109,0.04908217,0.79136207,0.78440554,0.06674075,0.05875531,0.70552680,0.01067839,0.23139190,0.24648155,0.07420138,0.00736365,0.75728470,0.22808532,0.08198003,0.25593495,0.45650840,0.78023372,0.23779712\n\t\t,0.83432476,0.81446493,0.07405343,0.74766336,0.78127309,0.28957231,0.96121530,0.00047531,0.00135022,0.11286500,0.78440418,0.08571294,0.10778724,0.04327985,0.10045105,0.05159710,0.12184329,0.14257682,0.09490812,0.01690936,0.03414286,0.08773336,0.17259049,0.05446383,0.13646352,0.00025534,0.07559506,0.02729883,0.00696478,0.00148648,0.02084993,0.00261508,0.20939446,0.69635915,0.68179047,0.14827208,0.06397885,0.46184008\n\t\t,0.18497543,0.07365860,0.04757012,0.20755081,0.08614211,0.34637824,0.03240247,0.14108409,0.04971611,0.00641968,0.01095606,0.26181360,0.69860989,0.87474063,0.08688262,0.77967190,0.06306721,0.55995432,0.05385310,0.11832801,0.14787080,0.52632007,0.32771970,0.38189504,0.00286772,0.00978862,0.07162131,0.01597992,0.02811892,0.08583923,0.15678400,0.16651493,0.07675871,0.00635355\n\t\tTransform: 0.485367596149445,-0.306903839111328,0.818675279617310,0.000000000000000,-0.684995472431183,-0.715370893478394,0.137935832142830,0.000000000000000,0.543323040008545,-0.627738296985626,-0.557444989681244,0.000000000000000,-1.080369114875793,0.854615509510040,2.343411684036255,1.000000000000000\n\t\tTransformLink: 0.485367119312286,0.543322980403900,0.684995293617249,0.000000000000000,-0.306903332471848,-0.627737939357758,0.715370297431946,0.000000000000000,0.818674743175507,-0.557445168495178,-0.137935787439346,0.000000000000000,-1.131832003593445,2.429787635803223,0.451921582221985,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_01_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1658,1661,1662,1667,1668,1695,1713,1716,1810,1815,1845,1846,1847,1848,1849,1850,1851,1852,1853,1854,1855,1856,1857\n\t\t,1859,1860,1861,1863,1864,1881,1882,1883,1886,1887,1888,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916\n\t\t,1917,1919,1920,1929,1930,1932,1933,1934,1935,1936,1937,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951\n\t\t,1952,1978,1979,1980,1985,1986,1987,1989,1990,1996,1997,1999,2002,2004,2006,2007,2008,2041,2044,2047,2055,2056,2079\n\t\t,2101,2171,2172,2177,2543,2546,2580,2581,2582,2583,2584,2585,2592,2593,2594,2595,2599,2602,2603,2604,2605,2622,2623\n\t\t,2703,2704,2722,2735,2736,2737,2741,2742,2743,2746,2747,2748,2750,2751,2758,2759,2761,2766,2767,2775,2776,2785,2852\n\t\t,2856,2857,2858,2859,2860,2861,2862,2863,2864,2865,2868,2869,2884,2887,2889,2890,2891,2892,2893,2894,2895,2900,2915\n\t\t,2916,2917,2918,2919,2924,2925,2945,2972,2988,3004,3008,3009,3010,3013,3015,3017,3019,3020,3021,3022,3023,3024,3025\n\t\t,3026,3027,3030,3031,3032,3035,3036,3038,3040,3045,3054,3055,3056,3057,3106,3107,3223,3225,3226,3227,3228,3232\n\t\tWeights: 0.09507307,0.04394065,0.28236268,0.31734933,0.10127953,0.05750958,0.02174872,0.02820341,0.05278738,0.16214477,0.29646983,0.48476723,0.43236728,0.37443050,0.97398671,0.92435194,1.00000000,0.94820822,0.86347064,0.64164673,0.51262058,1.00000000,0.41910835,0.54297047,0.88121946,0.42497963,0.50665445,0.90943501,0.29141154,0.96840143,1.00000000,0.44247572,0.56370399,0.87501621,0.92096337,0.99286394,1.00000000,0.88757810\n\t\t,0.91355752,0.93490092,1.00000000,0.88300836,0.09559359,0.29116553,0.14882411,0.25787821,0.18602313,0.10708218,0.15189827,0.06125369,0.02885505,0.00891738,0.03061484,0.00053426,0.12047937,0.08066905,0.04539919,0.05921372,0.66117465,0.69926683,0.82522027,0.61029456,0.30347472,0.25025386,0.19650030,0.10704562,0.69152594,0.81951719,0.78495207,0.63585319,0.41995579,0.30678518,0.88330595,0.88956504,0.17178693,0.05487596\n\t\t,0.61773930,0.27475934,0.30936845,0.60159382,0.87672146,0.85869476,0.17764625,0.06475410,0.49657782,0.43709415,0.05897467,0.04689064,0.27497256,0.31858960,0.06692572,0.03901964,0.01377827,0.16656903,0.04489061,0.00591419,0.18895296,0.04426540,0.50311272,0.32816126,0.62194165,0.58350228,1.00000000,1.00000000,0.96465446,0.95268269,0.07708844,0.04422996,0.00962382,0.23221416,0.13996990,0.74582050,0.76104335,0.23888541\n\t\t,0.01608899,0.23550708,0.08731413,0.01905363,0.41320722,0.38707058,0.87879461,0.41958217,0.52530415,0.87403599,0.89980736,0.14188615,0.04618907,0.63154570,0.26794553,0.29687278,0.62138655,0.87371133,0.06188619,0.15855318,0.23681435,0.06300843,0.01696767,0.05653357,0.05525350,0.01698493,0.12790194,0.79644028,0.63252277,0.82386509,0.26782449,0.21278210,0.24453612,0.06167057,0.02229608,0.09344933,0.01917509,0.01468961\n\t\t,0.05738783,0.21396284,0.25121919,0.13679232,0.07933071,0.07362322,0.06391929,0.01214520,0.01136438,0.03769192,0.02890412,0.02848758,0.01097665,0.02478573,0.05396499,0.12724540,0.09345281,0.27029626,0.08432029,0.01528402,0.15585824,0.16777758,0.01902024,0.08740613,0.08552898,0.13716156,0.75377702,1.00000000,0.81152757,0.79996697,0.93038542,0.92329162,0.73362383,0.74650979,0.75016042,0.78241503,0.11412385,0.13854519\n\t\t,0.13180049,0.07226153,0.06460746,0.01256844,0.87151406,0.99974466,1.00000000,0.83795985,0.31574555,0.14080207,0.13088153,0.05446192,0.03739146,0.15180219,0.12630281,0.09421852\n\t\tTransform: 0.480655610561371,-0.280683368444443,0.830775499343872,0.000000000000000,-0.761002123355865,-0.604247510433197,0.236138150095940,0.000000000000000,0.435713678598404,-0.745722711086273,-0.504034996032715,0.000000000000000,-0.879204034805298,1.056297898292542,2.289678812026978,1.000000000000000\n\t\tTransformLink: 0.480655163526535,0.435713648796082,0.761001825332642,0.000000000000000,-0.280682921409607,-0.745722472667694,0.604247033596039,0.000000000000000,0.830774903297424,-0.504035234451294,-0.236138045787811,0.000000000000000,-1.183128952980042,2.324865102767944,0.571491241455078,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_02_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1841,1842,1843,1844,1845,1846,1847,1848,1849,1850,1857,1858,1860,1861,1862,1864,1880,1881,1885,1886,1888,1892,1897\n\t\t,1898,1899,1900,1901,1902,1903,1904,1905,1906,1908,1909,1910,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922\n\t\t,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945\n\t\t,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968\n\t\t,1971,1972,1973,1976,1977,1978,1980,1984,1985,1986,1987,1988,1989,1990,1991,1992,1994,1995,1996,1997,1999,2002,2003\n\t\t,2004,2005,2006,2008,2009,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2578,2579,2580,2581,2590,2592,2593,2594\n\t\t,2595,2596,2597,2598,2599,2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2615,2616,2734,2735,2737,2740\n\t\t,2741,2743,2745,2746,2747,2748,2749,2750,2751,2752,2753,2757,2758,2759,2760,2761,2764,2765,2766,2767,2771,2772\n\t\tWeights: 0.94874502,0.93624034,1.00000000,1.00000000,0.70353017,0.51523277,0.56763272,0.62556950,0.01731293,0.03950324,0.58089165,0.92561830,0.05888124,0.57502037,0.91179913,0.03360095,1.00000000,0.70858846,0.89174128,0.55752428,0.06342933,0.00938097,0.06752571,0.03126830,0.06970957,0.11700759,0.08576455,0.13023081,0.06699705,0.04878846,0.07903663,0.00713606,0.10546936,0.08644248,0.06509908,0.11657420,0.90440641,0.70883447\n\t\t,0.85117589,0.74212179,0.81397687,1.00000000,0.89291782,0.84810173,0.19991568,0.29408503,0.40352456,0.31381957,0.39408322,0.31696512,0.23595797,0.30322212,0.91318003,0.97114495,1.00000000,0.99108262,0.96938516,0.99946574,0.87952063,0.91933095,0.95460081,1.00000000,1.00000000,0.92872835,0.33882535,0.30073317,0.17477973,0.38970544,0.69652528,0.74974614,0.80349970,0.89295438,0.30847406,0.18048281,0.21504793,0.36414681\n\t\t,0.84859749,0.78143636,0.73189966,0.93016148,0.65202282,0.78442092,0.89083984,0.72403570,0.51458804,0.62525485,0.59229652,0.75488982,0.43993382,0.59709434,0.71077641,0.52835628,0.03469660,0.01985538,0.04679436,0.00131496,0.88776639,0.58004421,0.05737550,0.06531726,0.11043496,0.82821307,0.92681073,0.29532188,0.38226070,0.72524066,0.66761541,0.44252667,0.46683353,0.66153248,0.69063155,0.39840618,0.12218069,0.06264740\n\t\t,0.32446619,0.82235375,0.08058293,0.90954627,0.56290585,0.89383231,0.25642278,0.25969807,0.18543969,0.10435481,0.17683852,0.09420921,0.17766924,0.16244517,0.17725020,0.20292405,0.97564732,0.96680699,0.49688728,0.67183874,0.01451857,0.03534554,0.04731731,0.92291156,0.95577004,0.06393353,0.37220236,0.26388957,0.99037618,1.00000000,0.11917091,0.76778584,0.86003010,0.25417950,0.23895665,0.82475756,0.82712035,0.52035263\n\t\t,0.65135702,0.05358981,0.00515452,0.23152164,0.12808636,0.90301441,0.58679278,0.04642654,0.89740169,0.58041783,0.06535039,0.06828705,0.10019264,0.85811385,0.94847316,0.30347045,0.36845430,0.73205447,0.70093109,0.50719541,0.56378397,0.70312722,0.37861345,0.70727170,0.11906921,0.36890085,0.09631430,0.91642128,0.84144682,0.18270559,0.23370433\n\t\tTransform: 0.465369999408722,-0.137334629893303,0.874397277832031,0.000000000000000,-0.741639018058777,-0.599716007709503,0.300521045923233,0.000000000000000,0.483117848634720,-0.788340270519257,-0.380942046642303,0.000000000000000,-0.993117451667786,1.250935077667236,2.102986335754395,1.000000000000000\n\t\tTransformLink: 0.465369552373886,0.483117789030075,0.741638600826263,0.000000000000000,-0.137334287166595,-0.788340091705322,0.599715530872345,0.000000000000000,0.874396800994873,-0.380942285060883,-0.300520896911621,0.000000000000000,-1.204881906509399,2.267071485519409,0.618320465087891,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_03_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1841,1842,1858,1862,1865,1866,1867,1868,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,1884,1885,1889,1890\n\t\t,1891,1892,1893,1894,1895,1896,1897,1898,1899,1900,1901,1902,1903,1904,1921,1922,1923,1924,1925,1926,1927,1928,1929\n\t\t,1940,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974\n\t\t,1975,1976,1977,1981,1982,1983,1984,1987,1988,1991,1992,1993,1994,1995,1998,2000,2001,2003,2005,2006,2009,2010,2011\n\t\t,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2578,2579\n\t\t,2586,2587,2588,2589,2590,2591,2596,2597,2598,2601,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2734,2738\n\t\t,2739,2740,2744,2745,2748,2749,2752,2753,2754,2755,2756,2757,2760,2762,2763,2764,2765,2766,2768,2769,2770,2771,2772\n\t\tWeights: 0.05125498,0.06375966,0.07438170,0.08820087,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.10825872,1.00000000,1.00000000,1.00000000,0.99061903,1.00000000,1.00000000,1.00000000,1.00000000,0.93247429,0.96873170,0.93029043,0.88299241,0.91423545,0.86976919,0.93300295,0.95121154,0.80008432\n\t\t,0.70591497,0.59647544,0.68618043,0.60591678,0.68303488,0.76404203,0.69677788,0.02556628,0.01205792,0.15140251,0.21856364,0.26810034,0.06983852,0.34797718,0.21557908,0.10916016,0.27596430,0.48541196,0.37474515,0.40770348,0.24511018,0.56006618,0.40290566,0.28922359,0.47164372,1.00000000,1.00000000,0.96530340,0.98014462,0.95320564,1.00000000,1.00000000,0.99868504,0.11223361,1.00000000,1.00000000,1.00000000,0.93468274\n\t\t,0.01831331,0.70467812,0.33238459,0.55747333,1.00000000,0.53316647,0.33846752,1.00000000,1.00000000,1.00000000,0.67553381,0.91941707,0.02569963,0.10616769,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.74357722,0.74030193,0.81456031,0.89564519,0.82316148,0.90579079,0.82233076,0.83755483,0.82274980,0.79707595,0.02435268\n\t\t,0.03319301,1.00000000,1.00000000,1.00000000,1.00000000,0.98548143,1.00000000,0.93606647,0.62779764,0.73611043,0.88082909,0.17524244,0.17287965,0.47964737,0.34864298,0.94641019,0.99484548,1.00000000,1.00000000,1.00000000,0.76847836,0.87191364,0.09698559,1.00000000,1.00000000,0.10259831,1.00000000,0.93171295,0.00533778,0.69652955,0.29906891,0.49280459,1.00000000,1.00000000,1.00000000,0.43621603,0.29272830,1.00000000\n\t\t,1.00000000,0.63109915,0.90368570,0.02169253,1.00000000,1.00000000,1.00000000,0.81729441,0.76629567\n\t\tTransform: 0.527984440326691,-0.153127893805504,0.835335314273834,0.000000000000000,-0.735434353351593,-0.574329674243927,0.359558552503586,0.000000000000000,0.424699217081070,-0.804175198078156,-0.415852129459381,0.000000000000000,-0.783626139163971,1.217510700225830,2.171735763549805,1.000000000000000\n\t\tTransformLink: 0.527983903884888,0.424699127674103,0.735433936119080,0.000000000000000,-0.153127565979958,-0.804174959659576,0.574329257011414,0.000000000000000,0.835334777832031,-0.415852338075638,-0.359558373689651,0.000000000000000,-1.213949918746948,2.215018272399902,0.657918989658356,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_03_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1854,1859,1887,1979,2007,2044,2045,2046,2047,2051,2055,2074,2079,2080,2104,2171,2172,2191,2194,2199,2239,2247,2248\n\t\t,2271,2363,2582,2621,2622,2661,2742,2775,2781,2782,2814,2815,2860,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871\n\t\t,2876,2877,2878,2882,2889,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2905,2907,2910,2915,2916,2917\n\t\t,2918,2919,2920,2924,2926,2929,2932,2933,2934,2935,2936,2937,2938,2940,2941,2942,2945,2948,2950,2957,2960,2963,2964\n\t\t,2966,2969,2970,2971,2972,2974,2975,2976,2977,2978,2980,2981,2983,2988,2989,2990,2994,2995,2996,2998,3000,3002,3005\n\t\t,3020,3023,3026,3027,3030,3032,3033,3034,3035,3038,3039,3041,3044,3045,3046,3047,3049,3059,3061,3086,3087,3088,3089\n\t\t,3090,3100,3101,3102,3104,3105,3108,3109,3110,3111,3112,3178,3180,3182,3183,3185,3186,3188,3189,3191,3192,3193,3195\n\t\t,3197,3198,3200,3201,3203,3207,3223,3224,3225,3227,3228,3229,3230,3232,3233,3243,3280,3281,3282,3283,3284,3285,3286\n\t\tWeights: 0.01687479,0.03746211,0.07136555,0.02609133,0.11408239,0.06059914,0.09126375,0.06129041,0.02987906,0.15300847,0.03985851,0.06536966,0.25167245,0.06036186,0.01838408,0.14726960,0.02552068,0.00762508,0.05028487,0.35254850,0.03449262,0.08301941,0.02029273,0.02321612,0.10756074,0.05241462,0.14583890,0.06368659,0.06268742,0.06730718,0.08234272,0.19656521,0.02507926,0.09261363,0.01097125,0.05228161,0.13643272,0.06390353\n\t\t,0.25933239,0.24240394,0.26999323,0.21456404,0.48689076,0.49602556,0.36606998,0.06189027,0.05179644,0.12265463,0.01252667,0.00269847,0.02204482,0.06270181,0.00402940,0.19319508,0.08883194,0.46405386,0.69777493,0.68073563,0.78642233,0.57833745,0.66639631,0.24536041,0.07959342,0.00395655,0.08328230,0.22571450,0.01853427,0.02199675,0.17742635,0.08140913,0.36456547,0.65645492,0.65487832,0.05210837,0.05539704,0.12781783\n\t\t,0.06437299,0.26978109,0.59092312,0.58613924,0.19744422,0.20742131,0.00048094,0.00178033,0.00925398,0.37050679,0.04362463,0.70646832,0.18376787,0.01000940,0.71038497,0.20863793,0.84727550,0.15657822,0.01106718,0.57699940,0.16044817,0.76749182,0.75306689,0.86817047,0.26364365,0.20080633,0.67815085,0.66340458,0.07634433,0.14333125,0.05246832,0.74385053,0.18553507,0.75313212,0.82062583,0.21872691,0.02212197,0.67048562\n\t\t,0.45500922,0.02449619,0.00059248,0.04056679,0.00023642,0.02002945,0.02403652,0.07248446,0.05853262,0.00525209,0.05746883,0.09340088,0.02677901,0.00334041,0.09667681,0.02263083,0.02392519,0.04870205,0.04203703,0.02767012,0.04332869,0.05842344,0.04078057,0.01015587,0.02156662,0.63869657,0.16884687,0.04288946,0.65531619,0.05255293,0.84903598,0.16883900,0.20830549,0.02824472,0.20102344,0.03273273,0.06266992,0.00520271\n\t\t,0.11913429,0.08079337,0.42191174,0.07461905,0.14791585,0.07871949,0.63159350,0.69247529,0.01694354,0.05509991,0.78539793,0.02791573,0.22032810,0.15319989,0.06374754,0.07818809,0.57204344,0.60511366,0.18767861,0.43167788,0.10731776,0.02866771,0.01074757,0.30670027,0.00511904,0.00783849,0.06487012,0.16879332,0.39728795,0.21866000,0.09280155,0.02936623\n\t\tTransform: 0.516751706600189,-0.376900762319565,0.768709421157837,0.000000000000000,-0.774871289730072,-0.587715268135071,0.232735171914101,0.000000000000000,0.364064127206802,-0.715916991233826,-0.595751821994781,0.000000000000000,-0.629079878330231,1.050397038459778,2.415829420089722,1.000000000000000\n\t\tTransformLink: 0.516751170158386,0.364064037799835,0.774870991706848,0.000000000000000,-0.376900196075439,-0.715916752815247,0.587714910507202,0.000000000000000,0.768709123134613,-0.595752060413361,-0.232735112309456,0.000000000000000,-1.136097431182861,2.420257568359375,0.432370036840439,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_01_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 1850,1853,1854,1859,1860,1887,1888,1908,1999,2002,2007,2034,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047\n\t\t,2048,2049,2050,2051,2052,2053,2054,2055,2056,2073,2074,2075,2077,2078,2079,2080,2097,2098,2099,2100,2101,2102,2103\n\t\t,2104,2105,2106,2107,2108,2109,2110,2111,2112,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134\n\t\t,2135,2136,2137,2138,2139,2140,2141,2142,2143,2144,2169,2170,2171,2172,2177,2178,2179,2181,2182,2188,2189,2191,2194\n\t\t,2196,2198,2199,2200,2201,2233,2236,2239,2247,2248,2271,2293,2294,2363,2364,2582,2619,2620,2621,2622,2623,2624,2631\n\t\t,2632,2633,2634,2638,2639,2641,2642,2643,2644,2661,2662,2742,2743,2761,2773,2774,2775,2776,2779,2780,2781,2782,2785\n\t\t,2786,2787,2789,2790,2797,2798,2800,2805,2806,2814,2815,2824,2860,2862,2863,2864,2865,2866,2867,2868,2869,2870,2876\n\t\t,2877,2891,2893,2895,2896,2897,2898,2899,2900,2901,2920,2924,2945,2963,2971,2972,2975,2988,3005,3020,3023,3024,3026\n\t\t,3027,3030,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3043,3044,3045,3046,3047,3049,3053,3054,3059,3061,3108\n\t\t,3109,3224,3225,3227,3228,3229,3233\n\t\tWeights: 0.03614483,0.05368076,0.31648868,0.38205450,0.05989930,0.07595668,0.01019858,0.00695255,0.00109785,0.05408491,0.24312579,0.00248914,0.80554913,0.75219155,0.63888107,0.74494020,0.94102533,0.95894774,1.00000000,0.89251023,0.86874948,0.55347365,0.68766463,1.00000000,0.72479303,0.00431100,0.45561986,0.91334894,0.60128787,0.02128276,0.62787712,0.92619953,0.80572896,0.93463034,1.00000000,0.05134804,0.66758356,0.60643459\n\t\t,0.89888197,0.95072390,1.00000000,1.00000000,0.92402478,0.94747300,0.98537159,1.00000000,0.90776749,0.49657044,0.43036787,0.46877257,0.39636831,0.38721076,0.17434013,0.34116389,0.28694290,0.28569522,0.18494341,0.04299256,0.15307954,0.20227531,0.17492843,0.24063070,0.32970365,0.14090352,0.07735407,0.04903715,0.20054175,0.84356864,0.87821813,0.93541650,0.75925672,0.58139521,0.60444261,0.59610621,0.51697415,0.82524031\n\t\t,0.89625713,0.93567345,0.76400591,0.03587718,0.68034311,0.63669123,0.89606194,0.92224802,0.38168605,0.24988200,0.78328180,0.58330975,0.58311027,0.75040681,0.89732338,0.85000200,0.41125305,0.28160683,0.33407544,0.66736275,0.04940582,0.09484014,0.01684237,0.28687210,0.24874782,0.10758151,0.00391621,0.04523483,0.03795712,0.11414354,0.00796461,0.25266920,0.68490567,0.79286028,0.67728181,0.66431974,0.98391101,0.99994766\n\t\t,1.00000000,0.97865395,0.21409445,0.33185198,0.10251854,0.11599454,0.41569799,0.63487424,0.91131035,0.86804306,0.17034440,0.02267775,0.33454529,0.06061362,0.00721946,0.01565461,0.70017934,0.65094562,0.91038312,0.03518087,0.62360126,0.47355607,0.86962538,0.92043603,0.35668576,0.20745109,0.80848038,0.59085562,0.53119154,0.74496629,0.90254152,0.26423552,0.38377380,0.17088730,0.05445706,0.00342405,0.05359446,0.06441647\n\t\t,0.00307634,0.14023587,0.62159845,0.64920963,0.78543596,0.29726402,0.26267021,0.23290713,0.00372312,0.08290946,0.02289954,0.00468844,0.04175832,0.21654559,0.22977186,0.17273690,0.07146779,0.06426748,0.05291693,0.00229105,0.08637844,0.33749843,0.07193152,0.00818197,0.04057222,0.00045156,0.12986409,0.27814999,0.06696299,0.18253119,0.06961458,0.13807602,0.01529312,0.17534629,0.86183962,0.79710863,0.78987454,0.85620273\n\t\t,0.86819951,1.00000000,0.86760627,0.80284299,0.93539254,0.92219680,0.12899720,0.99665959,0.86633431,0.97736917,0.84531344,0.09213705,0.08312179,0.12848594,0.14752213,0.04671178,0.05488047,0.07328390,0.13866738,0.13028694,0.04867416,0.08831495,0.03185772,0.11597026\n\t\tTransform: 0.494621217250824,-0.461883515119553,0.736216068267822,0.000000000000000,-0.824362516403198,-0.517632782459259,0.229091972112656,0.000000000000000,0.275275677442551,-0.720222651958466,-0.636790871620178,0.000000000000000,-0.477512180805206,0.829405605792999,2.469390392303467,1.000000000000000\n\t\tTransformLink: 0.494620800018311,0.275275617837906,0.824362277984619,0.000000000000000,-0.461882859468460,-0.720222294330597,0.517632365226746,0.000000000000000,0.736215829849243,-0.636791229248047,-0.229091987013817,0.000000000000000,-1.198728680610657,2.301290273666382,0.530033409595490,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_02_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 2033,2034,2035,2036,2037,2038,2039,2040,2049,2050,2052,2053,2054,2056,2072,2073,2077,2078,2080,2089,2090,2091,2092\n\t\t,2093,2094,2095,2096,2097,2100,2101,2102,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118\n\t\t,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2139,2140,2141\n\t\t,2142,2143,2144,2145,2146,2147,2148,2149,2150,2151,2152,2153,2154,2155,2156,2157,2158,2159,2160,2163,2169,2170,2172\n\t\t,2176,2177,2178,2179,2180,2181,2182,2183,2184,2186,2187,2188,2189,2191,2194,2195,2196,2197,2198,2200,2201,2215,2216\n\t\t,2217,2218,2219,2220,2221,2222,2223,2224,2617,2618,2619,2620,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642\n\t\t,2643,2644,2645,2646,2647,2648,2649,2654,2655,2773,2774,2776,2779,2780,2782,2784,2785,2786,2787,2788,2789,2790,2791\n\t\t,2792,2796,2797,2798,2799,2800,2803,2804,2805,2806,2810,2811,3038,3039,3045\n\t\tWeights: 1.00000000,0.98618880,1.00000000,1.00000000,0.19445087,0.24780845,0.36111893,0.25505980,0.27520697,0.97837057,0.03097788,0.39871213,0.93085037,0.00687475,1.00000000,0.19427104,0.89787646,0.33241644,0.03985460,0.06668003,0.05463137,0.06261208,0.07586075,0.07117159,0.07607040,0.06398800,0.03640527,0.04927610,0.07246150,0.03874872,0.01462841,0.07384843,0.50342956,0.56963213,0.53122743,0.60363169,0.61278924,0.82565987\n\t\t,0.65883611,0.71305710,0.28367883,0.30527036,0.34985735,0.31318603,0.34524174,0.29790831,0.28949761,0.47196279,0.71430478,0.81505659,0.95700744,0.84692046,0.79772469,0.82507157,0.75936930,0.67029635,0.85909648,0.92264593,0.95096285,0.79945825,0.15643136,0.12178187,0.06458350,0.24074328,0.41860479,0.39555739,0.40389379,0.48302585,0.17475969,0.10374287,0.06432655,0.23599409,0.93087989,0.83268866,0.76469972,0.92877418\n\t\t,0.78308743,0.85848984,0.90496649,0.80364244,0.73574269,0.64077749,0.53528073,0.73839533,0.61871169,0.62244894,0.68774194,0.52471682,0.00990499,0.91368845,0.31965689,0.03352676,0.06300814,0.07183779,0.61831395,0.75011800,0.36336134,0.21671820,0.41669025,0.76123366,0.53088388,0.60572044,0.76548775,0.41688973,0.24959319,0.08403231,0.04618034,0.39527843,0.58874695,0.06638182,0.71839317,0.33263725,0.89863404,0.20921513\n\t\t,0.18970356,0.24628771,0.11731419,0.15341349,0.12665963,0.16740164,0.15554189,0.20969647,0.23938299,1.00000000,1.00000000,0.31509433,0.20713972,0.02134605,0.78590555,0.66814802,0.05800943,0.32602012,0.31422816,0.89748146,0.88400546,0.07536503,0.58430201,0.36512576,0.08868965,0.13195694,0.90138461,0.86914855,0.69438306,0.68148921,0.00927396,0.17826984,0.14233631,0.94562070,0.29982066,0.02660845,0.91303297,0.37639874\n\t\t,0.04358700,0.06071223,0.06259630,0.64331424,0.79254891,0.31010856,0.19151962,0.40914438,0.76699735,0.52346070,0.53603774,0.46880846,0.25503371,0.76329852,0.08701129,0.35916980,0.06690279,0.73576448,0.61622620,0.17126415,0.22031783,0.00266337,0.00148462,0.00507680\n\t\tTransform: 0.532615840435028,-0.147570744156837,0.833393096923828,0.000000000000000,-0.794587731361389,-0.426285594701767,0.432332456111908,0.000000000000000,0.291463732719421,-0.892470717430115,-0.344303756952286,0.000000000000000,-0.450424075126648,1.588048577308655,2.044878959655762,1.000000000000000\n\t\tTransformLink: 0.532615423202515,0.291463643312454,0.794587552547455,0.000000000000000,-0.147570252418518,-0.892470479011536,0.426285207271576,0.000000000000000,0.833392560482025,-0.344304144382477,-0.432332217693329,0.000000000000000,-1.229935407638550,2.252629041671753,0.565006792545319,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_03_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 2034,2050,2054,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2076,2077,2081,2082,2083\n\t\t,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2113,2114,2115,2116,2117,2118,2119,2120,2145,2146\n\t\t,2147,2148,2149,2150,2151,2152,2153,2154,2155,2156,2157,2158,2159,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169\n\t\t,2173,2174,2175,2176,2180,2183,2184,2185,2186,2187,2190,2192,2193,2195,2197,2201,2202,2203,2204,2205,2206,2207,2208\n\t\t,2209,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,2221,2222,2223,2224,2625,2626,2627,2628,2629,2630,2635\n\t\t,2636,2637,2640,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2773,2777,2778,2779,2783,2784,2788,2791,2792\n\t\t,2793,2794,2795,2796,2799,2801,2802,2803,2804,2807,2808,2809,2810,2811\n\t\tWeights: 0.01132206,0.01731843,0.04786687,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.05077550,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.93331997,0.94536863,0.93738792,0.92413925,0.92882841,0.92392960,0.93601200,0.96359473,0.71632117,0.69472964\n\t\t,0.65014265,0.68681397,0.65475826,0.70209169,0.71050239,0.52803721,0.06912011,0.16731134,0.23530028,0.07122582,0.21691257,0.14151016,0.09503351,0.19635756,0.26425731,0.35922251,0.46471927,0.26160467,0.38128831,0.37755106,0.31225806,0.47528318,1.00000000,1.00000000,0.99009501,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.05043437,1.00000000,1.00000000,1.00000000,0.93699186,0.63663866,0.23876634,0.46911612\n\t\t,1.00000000,0.39427956,0.23451225,1.00000000,1.00000000,1.00000000,0.60472157,0.93361818,0.05196015,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.79078487,0.81029644,0.75371229,0.88268581,0.84658651,0.87334037,0.83259836,0.84445811,0.79030353,0.76061701,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,0.94199057,0.67397988,0.68577184,0.92463497,0.09861539,0.13085145,0.30561694,0.31851079,0.99072604,1.00000000,1.00000000,1.00000000,1.00000000,0.82173016,0.85766369,0.03872469,1.00000000,1.00000000,0.05178615,1.00000000,0.93928777,0.68989144,0.23300265,0.47653930,1.00000000,1.00000000,1.00000000,0.46396226,0.23670148,1.00000000,1.00000000,0.64083020,0.93309721,1.00000000,1.00000000,1.00000000,0.82873585,0.77968217\n\t\tTransform: 0.529071390628815,-0.308624148368835,0.790465235710144,0.000000000000000,-0.797647714614868,-0.498728394508362,0.339158624410629,0.000000000000000,0.289554774761200,-0.809951663017273,-0.510035634040833,0.000000000000000,-0.452416837215424,1.106309056282043,2.301531076431274,1.000000000000000\n\t\tTransformLink: 0.529071033000946,0.289554744958878,0.797647476196289,0.000000000000000,-0.308623582124710,-0.809951424598694,0.498727977275848,0.000000000000000,0.790464818477631,-0.510035991668701,-0.339158475399017,0.000000000000000,-1.238485574722290,2.200919628143311,0.589705586433411,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_04_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 2046,2051,2079,2199,2236,2237,2238,2239,2243,2244,2247,2266,2271,2272,2296,2363,2364,2383,2386,2391,2621,2660,2661\n\t\t,2781,2814,2815,2820,2821,2866,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2880,2882,2895,2897,2898,2899\n\t\t,2900,2901,2902,2903,2904,2905,2906,2907,2909,2910,2919,2920,2921,2929,2934,2935,2936,2937,2938,2939,2940,2941,2942\n\t\t,2947,2950,2957,2958,2959,2960,2963,2966,2969,2970,2971,2974,2976,2977,2980,2981,2983,2984,2985,2986,2990,2991,2992\n\t\t,2995,2996,3002,3005,3028,3029,3042,3048,3049,3050,3051,3052,3053,3058,3060,3061,3069,3070,3073,3074,3075,3076,3078\n\t\t,3086,3087,3088,3090,3091,3092,3093,3095,3100,3104,3105,3108,3109,3110,3111,3112,3179,3182,3183,3185,3186,3187,3188\n\t\t,3189,3190,3191,3192,3193,3194,3195,3198,3199,3200,3203,3206,3207,3210,3211,3212,3213,3220,3221,3222,3224,3225,3228\n\t\t,3229,3230,3233,3242,3243,3244,3252,3253,3254,3255,3256,3257,3260,3261,3264,3265,3267,3270,3274,3276,3277,3278,3279\n\t\t,3280,3281,3282,3283,3284,3285,3290,3291,3292\n\t\tWeights: 0.00235675,0.02204264,0.02947619,0.09773467,0.10521962,0.08595506,0.10660822,0.01964088,0.10191452,0.01273819,0.02136900,0.08186906,0.11441296,0.03800961,0.00514157,0.11417727,0.02738223,0.00488075,0.03709786,0.09495163,0.01822874,0.08098351,0.10072275,0.05593782,0.06719097,0.01754070,0.10570434,0.02586811,0.02324088,0.07550729,0.02540939,0.15706799,0.46876298,0.28617898,0.23805735,0.21685687,0.23712423,0.20531054\n\t\t,0.20582696,0.16072221,0.22804605,0.21163067,0.02950853,0.05791316,0.00666045,0.21492347,0.09412286,0.52541560,0.74954852,0.74632152,0.64966768,0.87370548,0.42233018,0.60627033,0.86590621,0.66180929,0.03994660,0.10496557,1.00000000,0.93551694,0.03072968,0.25620970,0.09199972,0.73855873,0.79257869,0.95792521,0.89967724,0.71035324,0.99074602,0.94834323,0.29353168,0.81623213,1.00000000,0.86598972,0.98999060,0.16158065\n\t\t,0.08598375,0.84342178,0.98893282,0.28210827,0.00111627,0.05762815,0.72899270,0.23986912,0.08066046,0.92365567,0.92906914,0.90879798,1.00000000,0.01835235,0.93873094,1.00000000,0.24686788,0.10532074,0.32816416,0.13500834,0.04209540,0.01092183,0.02685838,0.05869913,0.03598159,0.06615651,0.01289193,0.01656766,0.02922548,0.05211694,0.06279933,0.05875956,0.03829954,0.01403172,0.05246344,0.06682845,0.04796328,0.01948279\n\t\t,0.07736662,0.14581796,0.07682670,0.03373970,0.19955876,0.22923726,0.06630869,0.02174042,0.22791562,0.07537095,0.23476673,0.93805596,0.02242495,0.42356739,0.71825147,0.95282239,0.78676865,0.03070275,0.12207525,0.06038108,0.31436795,0.25681963,0.43115574,0.75327058,0.74799904,0.74660782,0.72132536,0.35745044,0.04571111,1.00000000,0.98305646,0.12771945,0.57076871,0.91691476,0.84680011,0.99197962,0.84372707,0.37205396\n\t\t,0.16999675,0.79369425,0.07267520,0.09061860,0.19811446,0.94546198,0.14882422,0.06969539,0.00925906,0.45653878,0.29522590,0.35700283,0.81752750,0.81436916,0.61551412,1.00000000,0.06753855,0.11788369,1.00000000,0.89380626,1.00000000,0.07892288,0.05643735,0.09751139,0.10878455,0.05892755,0.01740580,0.03274002,0.11013113,0.09074622,0.43555180,0.61608785,0.71861342,0.69014303,0.58232507,0.23253645,0.09145488,0.02157131\n\t\t,0.17560954,0.08918454,0.03506292\n\t\tTransform: 0.457702964544296,-0.435703396797180,0.775029838085175,0.000000000000000,-0.849562525749207,-0.471392184495926,0.236713707447052,0.000000000000000,0.262205898761749,-0.766780674457550,-0.585914254188538,0.000000000000000,-0.460843771696091,1.148861289024353,2.393703222274780,1.000000000000000\n\t\tTransformLink: 0.457702606916428,0.262205868959427,0.849562168121338,0.000000000000000,-0.435702770948410,-0.766780376434326,0.471391767263412,0.000000000000000,0.775029420852661,-0.585914492607117,-0.236713618040085,0.000000000000000,-1.143699049949646,2.404265880584717,0.416573852300644,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_01_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 2042,2045,2046,2051,2052,2079,2080,2100,2191,2194,2199,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240\n\t\t,2241,2243,2244,2245,2247,2248,2265,2266,2267,2269,2270,2271,2272,2289,2290,2291,2292,2293,2294,2295,2296,2297,2298\n\t\t,2299,2300,2301,2302,2303,2304,2313,2314,2316,2317,2318,2319,2320,2321,2324,2325,2326,2327,2328,2329,2330,2331,2332\n\t\t,2333,2334,2335,2336,2362,2363,2364,2369,2370,2371,2373,2374,2380,2381,2383,2386,2388,2390,2391,2392,2621,2624,2658\n\t\t,2659,2660,2661,2662,2663,2670,2671,2672,2673,2680,2681,2682,2683,2781,2782,2800,2813,2814,2815,2819,2820,2821,2824\n\t\t,2825,2826,2828,2829,2836,2837,2839,2844,2845,2866,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2880,2882\n\t\t,2897,2899,2900,2901,2902,2903,2904,2905,2906,2907,2909,2910,2937,2939,2940,2941,2947,2959,2963,2971,3005,3028,3029\n\t\t,3033,3034,3039,3041,3042,3043,3045,3047,3048,3049,3050,3051,3052,3053,3058,3059,3060,3061,3109,3110,3111,3191,3207\n\t\t,3224,3225,3229,3230,3233\n\t\tWeights: 0.04105226,0.03998678,0.38287919,0.36932903,0.05567318,0.06439840,0.00090157,0.00351372,0.01101924,0.05353278,0.21564139,0.31850914,0.32692160,0.17027961,0.33621583,0.85247154,0.86956842,0.98301606,0.87793801,0.91404494,0.87780253,0.65899440,1.00000000,0.31205752,0.83781311,0.80807819,0.17351145,0.62467724,0.79453197,0.34331002,0.91813094,1.00000000,0.00051257,0.19787971,0.78794516,0.78887356,0.76842008,0.91160642\n\t\t,0.95670694,0.72320564,0.81283398,0.85693906,0.94439996,0.72536054,0.13773013,0.10286065,0.14373695,0.10119070,0.08087157,0.04201165,0.08919781,0.06655129,0.05051404,0.03427121,0.01992153,0.05210880,0.02448132,0.05775578,0.08407074,0.01382852,0.03036819,0.57181851,0.65600258,0.71893694,0.30232241,0.12118547,0.16384563,0.16934090,0.11798655,0.30137805,0.62900478,0.74692414,0.27417574,0.19774475,0.64186980,0.80920876\n\t\t,0.74146620,0.08118379,0.04816308,0.30956582,0.12340467,0.12077737,0.29793195,0.70857841,0.77357106,0.07969173,0.05090786,0.81400843,0.19385635,0.15865055,0.00005234,0.26324718,0.32223022,0.91901649,0.66624543,0.97732225,0.93161395,0.93863668,0.85902662,0.05937811,0.05284572,0.11648188,0.14255345,0.71444468,0.48419197,0.27394090,0.06170836,0.01044719,0.21797733,0.64247355,0.79994845,0.18422988,0.81831712,0.77359853\n\t\t,0.76181257,0.08858513,0.04464718,0.33625984,0.13964282,0.11593668,0.28814411,0.69961552,0.03873419,0.07362976,0.05755626,0.08171065,0.01153256,0.24395490,0.46934675,0.71382102,0.76194265,0.77609064,0.76287577,0.70896208,0.58512014,0.76984340,0.77195395,0.75546026,0.03157934,0.07842548,0.00842485,0.17630707,0.17085806,0.25367848,0.35033232,0.12233797,0.57766982,0.31044737,0.13409379,0.11247621,0.04058865,0.04207479\n\t\t,0.09984181,0.28786644,0.05165677,0.13401028,0.05610286,0.04674913,0.13183245,0.89283576,0.98907817,0.13040690,0.15159284,0.10227150,0.05102419,0.97314162,0.85407070,0.01934364,0.13076137,0.80889630,0.75361830,0.81358138,0.98710807,0.97853364,0.88765273,0.84012099,0.75237772,0.80176756,0.77991128,0.33430970,0.07344303,0.01893289,0.19995514,0.09252539,0.08661186,0.02211408,0.40428574,0.67009535,0.22032663\n\t\tTransform: 0.366844952106476,-0.376892417669296,0.850516140460968,0.000000000000000,-0.910750806331635,-0.331862211227417,0.245766147971153,0.000000000000000,0.189626634120941,-0.864766061306000,-0.464996397495270,0.000000000000000,-0.433450609445572,1.369480133056641,2.211618661880493,1.000000000000000\n\t\tTransformLink: 0.366844683885574,0.189626619219780,0.910750389099121,0.000000000000000,-0.376891732215881,-0.864765644073486,0.331861823797226,0.000000000000000,0.850515604019165,-0.464996665716171,-0.245766013860703,0.000000000000000,-1.205861210823059,2.294868469238281,0.483827829360962,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_02_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2238,2241,2242,2243,2244,2245,2246,2247,2248,2264,2265,2269\n\t\t,2270,2271,2272,2281,2282,2283,2284,2285,2286,2287,2289,2290,2291,2292,2293,2294,2295,2296,2297,2298,2299,2300,2301\n\t\t,2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2324\n\t\t,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2343,2344,2345,2346,2347\n\t\t,2348,2349,2350,2351,2352,2355,2361,2362,2363,2364,2368,2369,2370,2371,2372,2373,2374,2375,2376,2378,2379,2380,2381\n\t\t,2383,2386,2387,2388,2389,2390,2391,2392,2393,2407,2408,2409,2411,2412,2413,2414,2415,2416,2656,2657,2658,2659,2663\n\t\t,2670,2671,2672,2673,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2693,2694,2812,2813,2814,2815\n\t\t,2818,2819,2820,2821,2823,2824,2825,2826,2827,2828,2829,2830,2831,2835,2836,2837,2838,2839,2842,2843,2844,2845,2849\n\t\t,2850,2874,2876,2877,2878,2882,3028,3043,3048,3049,3050,3052,3058,3059,3060,3061,3230\n\t\tWeights: 0.80405834,0.74262011,0.90194332,0.96190850,0.68149086,0.67307840,0.82972039,0.66378417,0.05268832,0.13043158,0.01698394,0.01558925,0.68794248,0.79253378,0.06027236,0.17918362,0.81782223,0.69771914,0.02218653,0.07759379,0.94910873,0.65668998,0.71248229,0.78540329,0.07050956,0.17311683,0.02943923,0.02255072,0.02125189,0.03435799,0.04375094,0.03528469,0.00916132,0.23157992,0.08839358,0.04329306,0.27679436,0.14193118\n\t\t,0.10510381,0.05560004,0.26949789,0.86226987,0.84777847,0.85626305,0.88971982,0.83231337,0.95798835,0.86826750,0.85487261,0.05630510,0.12825567,0.14517262,0.14375175,0.14782459,0.16430449,0.09790249,0.16284734,0.80916908,0.87020763,1.00000000,0.90960767,0.94789120,0.97551868,0.88961075,0.90431292,0.87852409,0.98179237,1.00000000,0.83415392,0.42818149,0.34399742,0.28106306,0.69767759,0.82222654,0.83280743,0.83065910\n\t\t,0.88201345,0.69862195,0.37099522,0.25307586,0.72582426,0.73877078,0.33257673,0.31855585,0.76121619,0.32867527,0.37086167,0.63160680,0.51253343,0.19626688,0.22623505,0.22350563,0.28212329,0.22944977,0.21504108,0.29917812,0.28060389,0.00193554,0.72496452,0.78996166,0.02224865,0.15544440,0.02830676,0.25853380,0.83883900,0.81704630,0.17093825,0.69043418,0.82552093,0.36679135,0.25200226,0.22335338,0.31990270,0.82090147\n\t\t,0.70206805,0.28654084,0.18933108,0.14926213,0.83052952,0.02857790,0.80914133,0.09103994,0.78549041,0.68997562,0.09643346,0.09098307,0.10852328,0.08765780,0.06406561,0.09285064,0.07173805,0.11066424,0.10646061,0.85765467,0.83628169,0.73675282,0.67776978,0.06838605,0.06136332,0.14097338,0.94062189,0.94715428,0.13865897,0.07788567,0.93916884,0.97425619,0.03362934,0.88351812,0.85744655,0.28555532,0.51580803,0.34054991\n\t\t,0.37835620,0.16812682,0.21496572,0.08520004,0.01777965,0.75792762,0.78202267,0.02683454,0.11708255,0.67448252,0.79585665,0.07597855,0.20053335,0.03022740,0.23476338,0.85059290,0.84269726,0.18142368,0.66374016,0.83347697,0.50530440,0.30181473,0.22564355,0.82795623,0.71185589,0.31566773,0.30038448,0.15223534,0.03214559,0.81167316,0.83698746,0.10668733,0.10422854,0.00705249,0.03020782,0.00348880,0.05690773,0.03021059\n\t\t,0.06506885,0.01693210,0.13240457,0.06956100,0.12026211,0.00489870,0.10776207,0.05806312,0.13543311,0.08694725,0.00601103\n\t\tTransform: 0.451893806457520,-0.256771385669708,0.854319155216217,0.000000000000000,-0.861484467983246,-0.374241530895233,0.343203216791153,0.000000000000000,0.231596872210503,-0.891073703765869,-0.390321344137192,0.000000000000000,-0.399167567491531,1.504963278770447,2.096861124038696,1.000000000000000\n\t\tTransformLink: 0.451893448829651,0.231596767902374,0.861483991146088,0.000000000000000,-0.256770789623260,-0.891073346138000,0.374241113662720,0.000000000000000,0.854318618774414,-0.390321671962738,-0.343202948570251,0.000000000000000,-1.224575638771057,2.251928806304932,0.500306308269501,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_03_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 2225,2226,2227,2228,2242,2245,2246,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264\n\t\t,2268,2269,2270,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2298,2300,2301,2303\n\t\t,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2316,2319,2320,2321,2322,2324,2329,2330,2337,2338,2339,2340\n\t\t,2341,2342,2343,2344,2345,2346,2347,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2360,2361,2362,2365\n\t\t,2366,2367,2368,2370,2371,2372,2374,2375,2376,2377,2378,2379,2380,2382,2384,2385,2387,2388,2389,2390,2392,2393,2394\n\t\t,2395,2396,2397,2398,2399,2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2656\n\t\t,2657,2664,2665,2666,2667,2668,2669,2674,2675,2676,2677,2678,2679,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693\n\t\t,2694,2812,2816,2817,2818,2819,2822,2823,2825,2826,2827,2829,2830,2831,2832,2833,2834,2835,2836,2838,2840,2841,2842\n\t\t,2843,2844,2845,2846,2847,2848,2849,2850\n\t\tWeights: 0.19594166,0.25737989,0.09805668,0.03809150,0.20746622,0.00866632,0.30228086,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.05089127,1.00000000,0.28700513,0.01671699,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.97056077,0.97744928,0.97874811,0.96564201\n\t\t,0.95624906,0.96471531,0.99083868,1.00000000,0.04936088,0.00908948,0.08681506,0.04253470,0.07857610,0.94369490,0.87174433,0.85482738,0.85624825,0.85217541,0.83569551,0.90209751,0.83715266,0.14031688,0.09552116,0.07047079,0.05263346,0.01161634,0.10764739,0.01820763,0.13547790,0.05658799,0.00334693,0.26122922,0.66742327,0.68144415,0.23878381,0.67132473,0.62913833,0.36839320,0.48746657,0.80373312,0.77376495,0.77649437\n\t\t,0.71787671,0.77055023,0.78495892,0.70082188,0.71939611,1.00000000,1.00000000,0.99806446,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.27503548,0.01229359,1.00000000,1.00000000,1.00000000,0.97169324,0.07997721,0.13479062,0.82906175,0.05107441,0.63320865,0.74799774,1.00000000,0.77664662,0.68009730,0.05832115,1.00000000,1.00000000,1.00000000,0.85073787,0.08977875,0.97142210,0.13995081,0.02065324,0.31002438\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.90356654,0.90901693,0.89147672,1.00000000,0.91234220,0.93593439,0.90714936,0.92826195,0.88933576,0.89353939,0.14234533,0.16371831,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.86134103,0.92211433,0.06083116,0.02574381,0.96637066,0.65945009\n\t\t,0.62164380,0.83187318,0.78503428,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.91479996,0.98222035,0.24207238,1.00000000,1.00000000,0.32551748,0.01991347,1.00000000,0.96977260,0.06082197,0.11265556,0.81857632,0.02688021,0.49469560,0.69818527,1.00000000,1.00000000,1.00000000,0.77435645,0.05610709,0.68433227,1.00000000,1.00000000,0.84776466,0.96785441,0.14959265,0.08938279,1.00000000,1.00000000,1.00000000\n\t\t,0.89331267,0.89577146\n\t\tTransform: 0.549975216388702,-0.196937307715416,0.811630368232727,0.000000000000000,-0.810896337032318,-0.358557850122452,0.462476074695587,0.000000000000000,0.199937611818314,-0.912498056888580,-0.356893032789230,0.000000000000000,-0.181881487369537,1.598309516906738,2.031270980834961,1.000000000000000\n\t\tTransformLink: 0.549974799156189,0.199937462806702,0.810895860195160,0.000000000000000,-0.196936726570129,-0.912497580051422,0.358557403087616,0.000000000000000,0.811629772186279,-0.356893330812454,-0.462475657463074,0.000000000000000,-1.233843803405762,2.219765424728394,0.513814568519592,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 Phone\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: \n\t\tWeights: \n\t\tTransform: 0.839529752731323,-0.326212137937546,-0.434483736753464,0.000000000000000,0.136740669608116,-0.647088170051575,0.750052928924561,0.000000000000000,-0.525825023651123,-0.689103186130524,-0.498643040657043,0.000000000000000,2.219897747039795,0.722238361835480,1.045826196670532,1.000000000000000\n\t\tTransformLink: 0.839529335498810,-0.525825321674347,-0.136740639805794,0.000000000000000,-0.326211601495743,-0.689102947711945,0.647087693214417,0.000000000000000,-0.434483319520950,-0.498643010854721,-0.750052690505981,0.000000000000000,-1.173672676086426,2.186469078063965,0.620623469352722,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thigh_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3486,3490,3492,3493,3494,3495,3496,3497,3498,3499,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3517,3518,3519\n\t\t,3520,3521,3522,3523,3524,3525,3529,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547\n\t\t,3548,3550,3553,3554,3555,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3574,3575\n\t\t,3576,3577,3578,3579,3580,3581,3582,3583,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598\n\t\t,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621\n\t\t,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644\n\t\t,3645,3646,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667\n\t\t,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690\n\t\t,3691,3692,3693,3694,3695,3696,3697,3698,3699,3700,3701,3702,3703,3704,3705,3706,3707,3708,3709,3710,3711,3712,3713\n\t\t,3714,3715,3716,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736\n\t\t,3737,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,3750,3751,3752,3753,3754,3755,3756,3757,3758,3759\n\t\t,3760,3761,3762,3763,3764,3765,3766,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,3779,3780,3781,3782\n\t\t,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,3796,3797,3798,3799,3800,3801,3802,3803,3804,3805\n\t\t,3806,3807,3808,3809,3810,3811,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,3822,3823,3824,3825,3826,3827,3828\n\t\t,3829,3830,3831,3832,3833,3834,3835,3837,3838,3923,3924,3925,3926,3927,3928,3929,3930,3931,3932,3933,3934,3935,3936\n\t\t,3937,3938,3939,3940,3941,3942,3943,3944,3945,3946,3947,3948,3949,3950,3951,3952,3953,3954,3955,3956,3957,3958,3959\n\t\t,3960,3961,3962,3963,3964,3965,3966,3967,3980,3981,3982,3985,3986,3987,3988,3989,3990,3991,3992,3993,3994,3995,3996\n\t\t,3997,3998,3999,4000,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4012,4020,4021,4024,4025,4622,4623,4624,4625\n\t\t,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648\n\t\t,4649,4650,4651,4652,4653,4654,4655,4656,4657,4816,4817,4818,4819,4820,4821,4822,4823,4824,4851,4855,4857,4858,4859\n\t\t,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4935\n\t\t,4938,4939,4952,4953,4954,4956,4957,4958,4962,4965,4966,5230,5258,5259,5260,5261,5262,5263,5264,5265,5266,5309,5948\n\t\t,5949,5950,5951,5952,5953,5954,5955,5956,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6098,6099,6100\n\t\t,6101,6102,6103,6104,6105,6106,6110,6111,6112,6113,6114,6115,6116,6117,6118,6125,6126,6127,6128,6129,6130,6131,6132\n\t\t,6133,6134,6135,6137,6138,6139,6141,6142,6143,6144,6145,6146,6147,6148,6149,6152,6154,6155,6156,6157,6158,6159,6160\n\t\t,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183\n\t\t,6184,6185,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206\n\t\t,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229\n\t\t,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252\n\t\t,6253,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275\n\t\t,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6293,6294,6298,6299,6300,6301,6302,6303,6304,6305\n\t\t,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6325,6326,6327,6328,6329\n\t\t,6330,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6416,6417,6419,6420,6422,6423,6424,6425\n\t\t,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6437,6438,6439,6442,6451,6455,6456,6458,6459,6460,6461,6462,6463\n\t\t,6464,6465,6467,6473,6875,6876,6877,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896\n\t\t,6897,6898,6899,6900,6901,6902,6903,6904,6905,6906,6907,6992,6993,6994,7028,7029,7030,7034,7035,7036,7046,7047,7048\n\t\t,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7062,7112,7113,7116,7117,7293,7294,7316,7748,7749,7750\n\t\t,7763,7764,7765,7850,7851,7852,7854,7855,7856,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871\n\t\t,7872,7873,7874,7875,7876,7877,7879,7880,7883,7884,7899,7900,7901,7902,7903,7904,7965,7966,7967,7968,7984,7985,7989\n\t\t,7990,7991,7992,7994,7999,8000,8040,8118,8119\n\t\tWeights: 0.00535892,0.00915513,0.38872248,0.64827019,0.42927286,0.24829126,0.28055742,0.42193315,0.68119377,0.26227057,0.17626239,0.69107483,1.00000000,0.85316664,0.60216452,0.67704475,0.93460274,0.99434054,0.67295504,0.37251955,0.55829461,0.43339347,0.48035502,0.71181264,0.68872142,0.56680345,0.48202080,0.62690105,0.70466453,0.00711619,0.02635200,0.11168557,0.11028665,0.12904307,0.10254765,0.04871323,0.11383900,0.14255424\n\t\t,0.12511849,0.20551741,0.13890702,0.09881967,0.08305252,0.16172701,0.21854079,0.14373136,0.05555081,0.01652533,0.00302644,0.00919229,0.00865640,0.25559315,0.20748807,0.05112377,0.26316690,0.33235446,0.24513704,0.04687757,0.05049715,0.35284624,0.72172208,0.83099436,0.62638798,0.75127321,0.88119696,0.66253735,0.64297409,1.00000000,0.87390744,1.00000000,1.00000000,0.88792306,0.77848212,0.88181746,1.00000000,1.00000000\n\t\t,0.78669628,0.92609995,0.76828075,0.69366632,0.84178667,0.86287283,0.84832060,0.67438815,0.82037954,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99222970,1.00000000,1.00000000,1.00000000,0.99891502,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99560809,0.99858081,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.76824952,0.91822546,1.00000000,0.33032227,0.28464830,0.74956679,0.99950707,1.00000000,0.28664815,0.40768109,0.38781553,0.37863553,0.55653167,0.42689873,0.39875609,0.23583990,0.85724944,0.63548732,1.00000000,1.00000000,1.00000000,1.00000000,0.99640918,1.00000000,1.00000000,1.00000000,0.99255532,0.52290038,0.45807694,0.96256715,0.57497823,0.41755569,0.40124351\n\t\t,0.69628090,0.92427075,0.42839235,0.86566859,0.82447910,0.97044915,0.97144979,0.88215220,0.74985892,0.92762864,0.97886741,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99832606,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.89331490,0.93828064,0.88184625,0.83526009,0.89844184,0.94187319,0.93120217,0.81892264,0.84220392,0.84126431,0.90686452,0.82400280,0.74683994,0.85362983,0.91390914,0.90117681,0.69809085,0.78006852,0.87886947,0.88151366,0.79024363,0.86880279\n\t\t,0.93718463,0.93704408,0.80202007,0.77343774,0.93477148,0.88798642,0.89255095,0.81986405,0.88419723,0.93785089,0.93974727,0.82996613,0.81164790,0.93686146,0.85086757,0.86820441,0.74714541,0.86870247,0.97158611,0.99191374,0.74773615,0.72949897,0.87728680,0.75915958,0.83527178,0.82104230,0.70252049,0.72130424,0.88292419,0.81137390,0.79427899,0.66097981,0.82949585,0.84336955,0.68406588,0.87197989,0.91580236,0.92343837\n\t\t,0.73050630,0.74622691,0.91176230,0.29275745,0.62461472,0.37077409,0.13661438,0.28334498,0.60280895,0.61079820,0.16786420,0.14932853,0.37925965,0.48466013,0.36071930,0.28112266,0.36012805,0.54650460,0.46235031,0.28579694,0.21605920,0.25762302,0.27054709,0.11454747,0.25354600,0.47547811,0.49590565,0.11419863,0.11787564,0.42290319,0.30507916,0.32493061,0.13022685,0.28972650,0.55166674,0.59679705,0.13456714,0.12688190\n\t\t,0.52501804,0.35832570,0.41661789,0.17126415,0.42559428,0.52752469,0.60082692,0.13302875,0.18611991,0.50116910,0.36593394,0.47675349,0.40808181,0.29557514,0.35276391,0.46347553,0.49596125,0.28338752,0.29710764,0.15027714,0.04792061,0.03943942,0.31505467,0.32120526,0.30560625,0.03197908,0.49364264,0.02757671,0.03080302,0.01420230,0.01713323,0.04200377,0.04066643,0.02063530,0.00438436,0.03164486,0.10813628,0.08395541\n\t\t,0.07107334,0.13737581,0.06186864,0.04186617,0.05598420,0.08657145,0.11643100,0.15980070,0.16379535,0.12617848,0.23235339,0.15162508,0.13816057,0.12150264,0.13826990,0.23556360,0.30051467,0.29788539,0.25729392,0.18385291,0.29183335,0.31149983,0.23594658,0.22333130,0.26113909,0.11154797,0.17096428,0.11360754,0.08011765,0.24251749,0.25570453,0.15219964,0.09732785,0.19769241,0.00983892,0.02211934,0.01114897,0.03441852\n\t\t,0.06478210,0.05065509,0.02444620,0.07896002,0.09410763,0.08091038,0.00234149,0.05002364,0.11013026,0.11481075,0.09474739,0.07224935,0.09285646,0.13792748,0.13201653,0.06203090,0.07244077,0.14213083,0.05851034,0.07018251,0.02163929,0.03207981,0.08452337,0.10096940,0.05626607,0.06383438,0.00230566,0.02017159,0.01572252,0.01309312,0.02178926,0.01134231,0.02850559,0.04114355,0.01797934,0.00342960,0.02080724,0.04200258\n\t\t,0.04125148,0.22741010,0.17951007,0.22074686,0.30703008,0.25889537,0.17991765,0.17598554,0.24553010,0.33968952,0.48257600,0.44390650,0.46078255,0.53258748,0.54547686,0.47999781,0.42705290,0.39945719,0.62686287,0.43713528,0.49817790,0.37604870,0.37150122,0.46188679,0.58776876,0.38430122,0.35072756,0.37161837,0.02550733,0.02569492,0.00347560,0.02081023,0.19677375,0.15432124,0.00212262,0.00420523,0.21160482,0.00238231\n\t\t,0.00435572,0.04199974,0.05456163,0.02543032,0.01343940,0.07349382,0.10795841,0.03293299,0.00882970,0.01441592,0.19497084,0.14736503,0.29830766,0.16165100,0.10672256,0.12667125,0.28583578,0.07142493,0.06153417,0.00407857,0.09313392,0.27970383,0.25949039,0.00432068,0.05114044,0.25161396,0.00739497,0.00427820,0.01651303,0.04787400,0.07217410,0.05894707,0.03705824,0.04952133,0.09022066,0.01534881,0.00175627,0.05252974\n\t\t,0.00046964,0.02929910,0.02778665,0.03937633,0.02986427,0.00633940,0.00741416,0.05167361,0.04306739,0.00388684,0.01964460,0.01991260,0.01684621,0.07137848,0.02120005,0.00698884,0.00390527,0.05652602,0.06743562,0.00785837,0.67087263,0.49245321,0.44530311,0.53086321,0.61829798,0.68404690,0.17806547,0.27009893,0.35364983,0.00165547,0.01406878,0.01969448,0.29028517,0.37445367,0.40380456,0.49030057,0.46801889,0.32001501\n\t\t,0.16249709,0.14454824,0.03119511,0.94647247,0.99680674,0.89707905,0.29332453,0.57620011,0.82915163,0.05219728,0.06742966,0.14823771,0.18393092,0.18401627,0.15443648,0.83198345,0.67022550,0.56127674,0.75826561,0.71707013,0.71560073,0.00936067,0.00323250,0.82683290,0.71419692,0.60173793,0.06483367,0.10511114,0.90882200,0.96561682,0.99829382,0.03340060,0.08771783,0.07226139,0.00580627,0.01251982,0.02109942,0.10517570\n\t\t,0.27282795,0.38707269,0.38054698,0.40549788,0.39182325,1.00000000,1.00000000,0.79497437,0.64223999,0.80770015,0.94021422,1.00000000,1.00000000,1.00000000,0.54091530,0.58060824,0.53361952,0.98793751,1.00000000,1.00000000,0.19502015,0.21521020,0.41555898,0.16285497,0.24965317,0.28857052,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.96690309,0.96576720,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.98332918,1.00000000,1.00000000,1.00000000,0.99980861,1.00000000,0.99709302,0.99013925,0.94146919,0.86973703,0.24035174,0.32473361,0.97448510,0.41968907,0.43673733,0.70725431,0.86185879,0.65298230,0.41405498,0.99829656,1.00000000,1.00000000,0.99984300,0.99762577\n\t\t,0.99507892,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99973166,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.62955743,0.53527211,0.55597834,0.68445694,0.59975314,0.53355394,0.57031511,0.64657778,0.68834954,0.74424469,0.72235650,0.70751452,0.64102310,0.66467130,0.68656993,0.68695798,0.61471528,0.58164765,0.76603794,0.75758712,0.73649478,0.83935595,0.89734060\n\t\t,0.94188166,0.92235953,0.86724305,0.79957741,0.89610619,0.77698559,0.64331901,0.80679256,0.88197392,0.93679392,0.93007845,0.85603601,0.75518578,0.78222578,0.91019523,0.99556160,0.88111829,0.87728679,0.83709413,0.03225318,0.06548303,0.02250874,0.03449649,0.03373528,0.04976816,0.03009094,0.02427012,0.10590887,0.11795809,0.08037283,0.03227234,0.06104004,0.06127387,0.14615631,0.31445223,0.60076380,0.58331467,0.38068306\n\t\t,0.21308029,0.45265585,0.35002971,0.29815147,0.12197256,0.28289139,0.51040815,0.37532860,0.11599041,0.11982564,0.41594064,0.58354697,0.55041904,0.48210169,0.26974505,0.15328917,0.12478657,0.09682858,0.18473732,0.18603638,0.18557668,0.08961162,0.10903336,0.12050145,0.03530150,0.04538192,0.05862412,0.01204368,0.00165262,0.01030353,0.00737722,0.00914799,0.00479290,0.15022391,0.15902977,0.10503573,0.29473466,0.28003493\n\t\t,0.20354817,0.27835202,0.21401274,0.16576953,0.06943789,0.05495078,0.06051537,0.01411657,0.00071900,0.02768419,0.03219353,0.03278581,0.00984328,0.00232808,0.04390827,0.02875178,0.12256100,0.08496654,0.05823001,0.13834298,0.08251646,0.06973954,0.03615199,0.00356538,0.00812613,0.00411734,0.04135871,0.06127228,0.04255911,0.12734632,0.13377033,0.14060311,0.32313220,0.34821963,0.39313303,0.50971370,0.63736926,0.67808700\n\t\t,0.20350742,0.22557950,0.26915521,0.00889315,0.02381484,0.01276406,0.02983574,0.03799091,0.05973212,0.16899884,0.19311529,0.29866923,0.40251166,0.44568670,0.33547622,0.30204174,0.28060839,0.24847627,0.00242913,0.02587340,0.06520757,0.00064507,0.00096970,0.00129732,0.00517006,0.03471033,0.24136436,0.00825668,0.00542211,0.00152321,0.00127799,0.01342783,0.02214925,0.11969508,0.05209047,0.03624251,0.06920509,0.13922143\n\t\t,0.23444165,0.11816561,0.03696308,0.03135514,0.00068394,0.03144431,0.02121565,0.04498735,0.08775717,0.01632270,0.04376572,0.00020500,0.00079245,0.00065964,0.00062515,0.00853940,0.02324949,0.06344096,0.68826141,0.41747781,0.13431410,0.92770339,0.95162224,0.20421641,0.12914860,0.40050671,1.00000000,1.00000000,0.77261038,0.97169107,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99681467,0.63222510\n\t\t,0.58583051,0.75873214,0.62069869,0.70029784,0.69939369,0.71365619,0.07583142,0.01094323,0.02563471,0.07706952,0.16903675,0.18375157,0.07649607,0.02425054,0.02601152,0.01709346,0.01686670,0.12067497,0.31193864,0.36073336,0.29333577,0.00067045,0.43051595,0.49502409,0.21437211,0.01585304,0.00013649,0.02846505,0.00453604,0.06215194,0.00065621,0.12008543\n\t\tTransform: 0.990913391113281,0.134491294622421,-0.001763284322806,0.000000000000000,0.010376323014498,-0.063367821276188,0.997936308383942,0.000000000000000,0.134102001786232,-0.988886535167694,-0.064187563955784,0.000000000000000,-0.483524262905121,2.100624084472656,0.191660150885582,1.000000000000000\n\t\tTransformLink: 0.990913093090057,0.134101986885071,-0.010376354679465,0.000000000000000,0.134491264820099,-0.988886654376984,0.063367843627930,0.000000000000000,-0.001763254287653,-0.064187541604042,-0.997936308383942,0.000000000000000,0.196952834725380,2.154422760009766,0.053135380148888,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-shin_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3713,3714,3715,3716,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735\n\t\t,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,3750,3751,3752,3753,3754,3755,3756,3757,3758\n\t\t,3759,3760,3761,3762,3763,3764,3765,3766,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,3779,3780,3781\n\t\t,3782,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,3796,3797,3798,3799,3800,3801,3802,3803,3804\n\t\t,3805,3806,3807,3808,3809,3810,3811,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,3822,3823,3824,3825,3826,3827\n\t\t,3828,3829,3830,3831,3832,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,3845,3846,3847,3848,3849,3850\n\t\t,3851,3852,3853,3854,3855,3856,3857,3858,3859,3860,3861,3862,3863,3864,3865,3866,3867,3868,3869,3870,3871,3872,3873\n\t\t,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3886,3887,3888,3889,3890,3891,3892,3893,3894,3895,3896\n\t\t,3897,3898,3899,3900,3901,3902,3903,3904,3905,3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919\n\t\t,3920,3921,3922,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677\n\t\t,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,4700\n\t\t,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723\n\t\t,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746\n\t\t,4747,4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769\n\t\t,4770,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,6247,6248,6249,6250,6251,6252,6253,6254,6255\n\t\t,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278\n\t\t,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301\n\t\t,6302,6303,6304,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324\n\t\t,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347\n\t\t,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370\n\t\t,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393\n\t\t,6394,6395,6396,6397,6398,6399,6400,6908,6909,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923\n\t\t,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946\n\t\t,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969\n\t\t,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,7871\n\t\t,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,7892,7893,7894\n\t\t,7895,7896,7897,7898,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,9212,9213,9214,9215,9216\n\t\t,9262,9263,9264,9265,9266,9578,9579,9580,9581,9582,9586,9587,9588,9589,9763,9764,9765,9766,9767,9860,9861,9862,9863\n\t\tWeights: 0.10668510,0.06171936,0.11815375,0.16473991,0.10155816,0.05812681,0.06879783,0.18107736,0.15779608,0.15873569,0.09313548,0.17599720,0.25316006,0.14637017,0.08609086,0.09882319,0.30190915,0.21993148,0.12113053,0.11848634,0.20975637,0.13119721,0.06281537,0.06295592,0.19797993,0.22656226,0.06522852,0.11201358,0.10744905,0.18013595,0.11580277,0.06214911,0.06025273,0.17003387,0.18835210,0.06313854,0.14843404,0.13045388\n\t\t,0.25175133,0.13121539,0.02837847,0.00802443,0.24988112,0.27019542,0.12271320,0.24084042,0.16472822,0.17895770,0.29747951,0.27869576,0.11707581,0.18862610,0.20572101,0.33902019,0.16868650,0.15587726,0.31242427,0.12602493,0.08342369,0.07632993,0.26793241,0.24984209,0.08705013,0.70724255,0.37538528,0.62922591,0.86338562,0.71665502,0.39719105,0.38920180,0.83213580,0.85067147,0.62074035,0.51533987,0.63928070,0.71887734\n\t\t,0.63987195,0.45349540,0.53764969,0.71420306,0.78394080,0.74237698,0.72945291,0.88535875,0.74580937,0.52452189,0.50409435,0.88580137,0.88093179,0.57686282,0.69492084,0.67506939,0.86977315,0.71027350,0.44833326,0.40320295,0.86543286,0.87311810,0.47498196,0.64167430,0.58338211,0.82873585,0.57435728,0.47196148,0.39741010,0.86697125,0.81388009,0.49867095,0.63406606,0.52324651,0.59191819,0.70442486,0.64723609,0.53652447\n\t\t,0.50403875,0.71661248,0.70289236,0.84626628,0.95040959,0.95928329,0.68256507,0.67251795,0.69057067,1.00000000,0.96802092,0.50057746,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99972761,0.99998218,0.99978030,0.99871272,1.00000000,0.99925685,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.74254673,1.00000000,1.00000000,0.76661001,0.65871632,1.00000000,0.79159885,1.00000000,1.00000000,0.81419875,0.78088354,0.65371053,1.00000000,0.99976575,0.70114541,0.72468793,1.00000000,0.74742914,0.99270415,0.99502391,0.74392664\n\t\t,0.74398910,0.99256790,0.86678738,1.00000000,1.00000000,0.85301136,0.87608231,1.00000000,1.00000000,0.87035752,1.00000000,1.00000000,0.88154400,0.85307300,0.79273779,1.00000000,0.99810541,0.77300877,0.81303781,1.00000000,0.49888565,0.50013025,0.44878141,0.49892308,0.55472054,0.56646425,0.43339906,0.45025005,0.55326129,0.49880183,0.49920454,0.52588738,0.49832355,0.47323538,0.45244550,0.52826483,0.52548152,0.47394412\n\t\t,0.54815013,0.55108405,0.58365275,0.54807096,0.50682747,0.49751263,0.59320403,0.58271473,0.50829560,0.62384141,0.63864161,0.61916377,0.62308902,0.61998589,0.63434928,0.63396248,0.61800295,0.61910690,0.64930510,0.67385187,0.62432115,0.64405621,0.66363524,0.69025469,0.64268274,0.62036268,0.65745658,0.62843229,0.65435488,0.65532303,0.62352914,0.59174157,0.60885152,0.68333482,0.64834486,0.58921899,0.48069851,0.46354972\n\t\t,0.46107246,0.48402812,0.53844469,0.53733607,0.43910099,0.46530181,0.53776038,0.51260740,0.50549173,0.49156082,0.51792294,0.53667227,0.54202802,0.47759776,0.50382780,0.53353844,0.49827880,0.49509345,0.51182640,0.50443060,0.48844111,0.48055746,0.51392932,0.51453771,0.49762048,0.55788517,0.55339088,0.57116342,0.56086682,0.54361775,0.53082751,0.57466664,0.56792479,0.55294328,0.58314850,0.59824651,0.57681353,0.57131705\n\t\t,0.58399916,0.59772521,0.59166666,0.56515560,0.57306462,0.58821827,0.60855793,0.57997537,0.57191571,0.59110890,0.61501330,0.59475577,0.56832332,0.57218658,0.56965806,0.58792884,0.58320272,0.55697907,0.54932845,0.56186751,0.60472150,0.56692184,0.54317682,0.54272848,0.52571305,0.53491379,0.55045073,0.55499738,0.55110281,0.51245547,0.54698599,0.55634464,0.36493781,0.45943170,0.44133626,0.31554306,0.40024686,0.46644606\n\t\t,0.42938962,0.35245589,0.30936491,0.25575531,0.27764350,0.29248548,0.35897690,0.33532870,0.31343007,0.31304202,0.38528472,0.41835235,0.23396206,0.24241288,0.26350522,0.16064405,0.10265940,0.05811834,0.07764047,0.13275695,0.20042259,0.10389381,0.22301441,0.35668099,0.19320744,0.11802608,0.06320608,0.06992155,0.14391436,0.24442922,0.21435191,0.08838725,0.00438718,0.11888171,0.12271321,0.16288681,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,0.96774682,0.93451697,1.00000000,1.00000000,1.00000000,0.97749126,0.96550351,0.96626472,0.94869709,0.96961856,0.97572988,0.89409113,0.88204191,0.91962717,0.96772766,0.93895996,0.93872613,0.85384369,0.68554777,0.39923620,0.41668533,0.61931694,0.78691971,0.54734415,0.64997029,0.70184853,0.87802744,0.71710861,0.48959185,0.62316889,0.88256967,1.00000000,0.88017436,0.58389431,0.41324703,0.44937459\n\t\t,0.51789831,0.73025495,1.00000000,1.00000000,0.99345773,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99973893,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99883467,0.54474756\n\t\t,0.49120211,0.46412259,0.75114846,0.72028857,0.66199137,0.75157804,0.72892672,0.69409102,0.66648870,0.67105592,0.66705728,0.47984928,0.56572468,0.62020779,0.49230926,0.53982239,0.55168955,0.58842481,0.49625688,0.46537207,0.71964818,1.00000000,1.00000000,0.77867014,1.00000000,0.84740168,0.73036026,0.99573928,0.99970698,0.75143326,0.83450382,1.00000000,1.00000000,0.88332349,0.54195701,0.50272925,0.48561437,0.62896825\n\t\t,0.60867600,0.57772357,0.63997238,0.62949112,0.61013693,0.60720773,0.61329918,0.60982569,0.51743598,0.54948066,0.57908414,0.47575172,0.49602593,0.52013606,0.54821439,0.50135993,0.46210278,0.59395357,0.59604609,0.61290067,0.43550342,0.45653348,0.45778405,0.55894648,0.55369700,0.55321920,0.47494305,0.47121733,0.44281592,0.62058438,0.60764295,0.60647352,0.65969373,0.66647692,0.69450350,0.59809738,0.58620173,0.58360809\n\t\t,0.55652569,0.55359869,0.55188011,0.55785353,0.55002273,0.53974736,0.56277443,0.56208885,0.56140582,0.55841859,0.56412684,0.56671202,0.55620235,0.56119293,0.56525911,0.50542992,0.51058787,0.51840037,0.53346935,0.52165734,0.51063979,0.55188911,0.56040617,0.57212823,0.47265692,0.48469336,0.49613750,0.53621305,0.52891165,0.52817105,0.54782016,0.53448269,0.51458550,0.58966261,0.58078379,0.57208461,0.57181832,0.58900213\n\t\t,0.61361312,0.57483483,0.56828468,0.56242776,0.36758021,0.41416949,0.24126786,0.37844691,0.29558868,0.30060631,0.28634381,1.00000000,0.92416858,0.98905677,1.00000000,1.00000000,0.97436529,0.92293048,1.00000000,1.00000000,1.00000000,0.99881518,1.00000000,1.00000000,1.00000000,0.76196355,0.55980110,0.64209187,0.45567381,0.63865781,0.65232700,0.46715451,0.64050438,0.54697315,0.58470263,0.49210637,0.58087660,0.59934753\n\t\t,0.46265817,0.56208039,0.52858158,0.54754523,0.55261584,0.55927283,0.56721993,0.50500792,0.03308649,0.07481705,0.06629972,0.04589407,0.00896304,0.00819940,0.04568825,0.06530654,0.07252201,0.02966299,0.00774697,0.04646434,0.06568076,0.07247345,0.02830560,0.06759884,0.07139665,0.05891372,0.02532550,0.02520835,0.05862906,0.06950931,0.06452347,0.00063203,0.02528936,0.05914405,0.06967001,0.06422776\n\t\tTransform: 0.995995342731476,0.089369267225266,0.002607485512272,0.000000000000000,-0.008414970710874,0.064667634665966,0.997871339321136,0.000000000000000,0.089010417461395,-0.993896961212158,0.065160654485226,0.000000000000000,-0.440093576908112,1.024355530738831,0.053833886981010,1.000000000000000\n\t\tTransformLink: 0.995994985103607,0.089010402560234,0.008414930664003,0.000000000000000,0.089369259774685,-0.993897020816803,-0.064667604863644,0.000000000000000,0.002607521135360,0.065160691738129,-0.997871398925781,0.000000000000000,0.346644759178162,1.053768873214722,0.123665265738964,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-foot_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3882,3885,3886,3888,3891,3892,3893,3895,3896,3897,3899,3900,3901,3902,3903,3904,3905,3908,3909,3912,3915,3916,3917\n\t\t,3920,3921,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678\n\t\t,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,4700,4701\n\t\t,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724\n\t\t,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747\n\t\t,4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770\n\t\t,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375\n\t\t,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6390,6392,6393,6394,6396,6397,6400,6908,6909,6910,6911\n\t\t,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934\n\t\t,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957\n\t\t,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980\n\t\t,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,7892,7893,7894,7895,7896,7897,7898,7969,7970,7971,7972,7973\n\t\t,7974,7975,7976,7977,7978,7979,7980,7981,7982,9035,9036,9037,9038,9039,9040,9042,9043,9044,9047,9048,9049,9050,9051\n\t\t,9052,9055,9056,9057,9058,9062,9063,9064,9065,9066,9067,9068,9069,9070,9071,9072,9073,9074,9075,9076,9077,9078,9079\n\t\t,9080,9081,9082,9083,9084,9087,9088,9089,9092,9093,9094,9096,9097,9098,9099,9100,9101,9103,9104,9105,9106,9108,9109\n\t\t,9110,9111,9112,9113,9116,9117,9118,9119,9123,9125,9126,9127,9128,9129,9131,9132,9133,9134,9135,9136,9137,9138,9139\n\t\t,9140,9141,9142,9143,9144,9145,9146,9147,9150,9152,9153,9156,9157,9159,9160,9161,9162,9163,9164,9165,9166,9167,9168\n\t\t,9169,9170,9171,9172,9173,9174,9175,9176,9177,9178,9179,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191\n\t\t,9192,9193,9194,9195,9197,9198,9199,9200,9201,9202,9203,9204,9205,9207,9208,9209,9210,9211,9212,9213,9214,9215,9216\n\t\t,9217,9218,9220,9222,9223,9224,9227,9228,9229,9230,9231,9233,9234,9235,9236,9237,9238,9241,9242,9243,9244,9245,9246\n\t\t,9248,9249,9250,9252,9253,9254,9255,9256,9257,9258,9259,9260,9261,9262,9263,9264,9265,9266,9273,9274,9275,9276,9277\n\t\t,9278,9280,9282,9283,9284,9286,9287,9289,9290,9291,9294,9295,9296,9297,9299,9300,9302,9304,9305,9306,9308,9309,9310\n\t\t,9311,9312,9313,9314,9316,9317,9318,9322,9323,9325,9326,9327,9328,9329,9330,9331,9332,9333,9334,9335,9336,9337,9338\n\t\t,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361\n\t\t,9362,9364,9366,9368,9369,9375,9376,9378,9379,9380,9381,9382,9383,9384,9385,9387,9388,9390,9392,9393,9394,9395,9396\n\t\t,9397,9399,9400,9401,9404,9405,9406,9407,9408,9409,9410,9412,9413,9414,9415,9416,9418,9419,9420,9421,9422,9423,9424\n\t\t,9426,9427,9428,9432,9433,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9450,9451,9452\n\t\t,9453,9454,9455,9456,9457,9458,9459,9460,9461,9462,9463,9464,9465,9466,9467,9468,9469,9470,9471,9472,9473,9474,9475\n\t\t,9478,9480,9481,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505\n\t\t,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528\n\t\t,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9548,9549,9550,9551\n\t\t,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9571,9572,9573,9574,9575\n\t\t,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9588,9589,9590,9591,9593,9594,9596,9597,9598,9599,9600\n\t\t,9601,9602,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9616,9617,9618,9619,9621,9624,9625,9626,9627\n\t\t,9628,9629,9630,9632,9634,9635,9636,9637,9638,9640,9643,9644,9645,9646,9647,9648,9649,9651,9654,9655,9656,9658,9659\n\t\t,9660,9661,9662,9664,9667,9668,9669,9670,9671,9672,9673,9675,9677,9681,9682,9684,9685,9686,9687,9688,9689,9691,9692\n\t\t,9693,9694,9695,9696,9697,9698,9699,9700,9701,9702,9703,9704,9705,9706,9707,9709,9710,9711,9713,9714,9715,9716,9718\n\t\t,9720,9721,9723,9724,9725,9726,9727,9728,9729,9730,9731,9732,9733,9734,9735,9736,9737,9738,9739,9740,9741,9743,9745\n\t\t,9746,9747,9748,9752,9753,9754,9755,9756,9757,9758,9759,9760,9761,9763,9764,9765,9766,9767,9775,9776,9777,9778,9779\n\t\t,9780,9782,9783,9784,9785,9786,9787,9788,9789,9791,9793,9794,9796,9797,9798,9799,9800,9801,9802,9803,9804,9805,9806\n\t\t,9807,9808,9809,9810,9811,9812,9813,9814,9816,9818,9819,9820,9821,9822,9823,9824,9825,9826,9827,9828,9829,9830,9831\n\t\t,9832,9833,9834,9835,9836,9837,9838,9839,9840,9841,9842,9843,9844,9845,9846,9847,9848,9849,9850,9851,9853,9854,9855\n\t\t,9856,9857,9858,9859,9860,9861,9862,9863,9864,9865,9866,9867,9868,9870,9871,9872,9874,9875,9876,9878,9880,9881,9882\n\t\t,9883,9884,9885,9886,9887,9888,9889,9891,9892,9893,9894,9895,9896,9897,9898,9899,9901,9904,9905,9906,9907,9908,9909\n\t\t,9910,9912,9913,9914,9915,9917,9919,9920,9921,9922,9923,9924,9925,9926,9928,9929,9930,9931,9932,9933,9934\n\t\tWeights: 0.21972175,0.17385609,0.31043193,0.06193633,0.05110742,0.08963097,0.31047463,0.00023425,0.25774112,0.23349839,0.20913245,0.00729585,0.00497609,0.21451926,0.21263514,0.00743210,0.05747252,0.06512091,0.05139970,0.03587873,0.03787733,0.03491168,0.11394575,0.15279192,0.08989089,0.35068976,0.37386648,0.34774318,0.34973060,0.32373960,0.33073449,0.39692269,0.34443019,0.32415870,0.16507067,0.15426749,0.14378675,0.16695000\n\t\t,0.19371220,0.18689638,0.13284493,0.14505400,0.19599062,0.34820107,0.35346684,0.32016585,0.34739017,0.37715002,0.39645177,0.31782818,0.32033315,0.37469608,0.28591916,0.27815828,0.28855012,0.28630209,0.28975469,0.28221461,0.28137402,0.28911436,0.29022003,0.16011540,0.14743559,0.17792594,0.16308528,0.14633698,0.13412718,0.16366776,0.18074011,0.14932607,0.12396548,0.11263154,0.12808411,0.12688556,0.12507843,0.11347414\n\t\t,0.11636206,0.13110517,0.12700980,0.27100744,0.25989713,0.36134114,0.27414804,0.22763139,0.21288339,0.38543076,0.35774836,0.23027057,0.28418711,0.30472183,0.26721055,0.27209255,0.28966855,0.30300680,0.28881877,0.25594747,0.28036817,0.19396332,0.18448233,0.18096471,0.20105660,0.21243161,0.20875874,0.16732143,0.19111576,0.21507899,0.31642082,0.32854937,0.31060624,0.30785039,0.31953092,0.33860868,0.31526927,0.30550325\n\t\t,0.30623847,0.29596175,0.29478180,0.29322246,0.29517092,0.29916829,0.29836455,0.29325591,0.29160108,0.29810738,0.19415738,0.18255987,0.20895414,0.20325595,0.18251922,0.16994515,0.19886073,0.21598915,0.19279110,0.16370676,0.14917401,0.16638412,0.17686805,0.16511904,0.14951594,0.15230255,0.17912652,0.17864971,0.27382100,0.27917347,0.29769505,0.26701003,0.24896350,0.24671846,0.31531793,0.28496966,0.24835764,0.16677443\n\t\t,0.22857053,0.37423130,0.09088038,0.08781609,0.08737899,0.10595507,0.11743698,0.13087288,0.26316869,0.25891110,0.26287988,0.44203210,0.35868687,0.30704030,0.17139786,0.11363165,0.09201684,0.33718533,0.42554396,0.42298703,0.24234854,0.13237999,0.03578908,0.22713481,0.00426072,0.19176187,0.07535432,0.04315601,0.23813823,0.27902965,0.33821407,0.13926143,0.13553108,0.13517241,0.15755147,0.17085014,0.18788241,0.29144905\n\t\t,0.29081094,0.29422240,0.35961414,0.34045263,0.31875153,0.20267063,0.17407719,0.15347056,0.31636895,0.33116489,0.31826736,0.29959405,0.29894045,0.29781913,0.26724058,0.25421413,0.25462984,0.11971688,0.13134209,0.13259819,0.38727222,0.39179200,0.43227004,0.29428349,0.30035880,0.30089630,0.13876553,0.13579409,0.12376358,0.18437386,0.19914165,0.20185232,0.24731553,0.26317623,0.27842518,0.18717312,0.18515062,0.18644390\n\t\t,0.19907436,0.20787701,0.21929556,0.28987552,0.29372698,0.29668710,0.29912075,0.30240321,0.30183718,0.21780443,0.20566134,0.19698374,0.27668576,0.26764005,0.25224889,0.28691258,0.29170073,0.29638448,0.24528280,0.23777324,0.23395425,0.15574055,0.17150417,0.18398375,0.29890085,0.31399657,0.33677382,0.30463421,0.30455649,0.30176592,0.18498350,0.17297813,0.15967762,0.21986217,0.22719465,0.23100649,0.09701388,0.08447177\n\t\t,0.28605523,0.44093138,0.14717241,0.27690047,0.33794889,0.14710521,0.14069925,0.29920466,0.36465102,0.20957987,0.30284089,0.25257641,0.19223577,0.19071140,0.28420611,0.29073743,0.23243684,0.29957498,0.23361018,0.38649827,0.04119776,0.12398829,0.00949851,0.86114075,0.08752916,0.00148268,0.61501751,0.19814176,0.30704146,0.09558571,0.37281717,0.74468439,0.49016763,0.07545233,0.90408982,0.57302245,0.87656808,0.33243557\n\t\t,0.02639096,0.10096276,0.08281909,0.11859660,0.07016468,0.38374952,0.36959160,0.44601188,0.81628734,0.88656506,0.93659629,0.97866578,0.77264875,0.84660091,0.99143139,1.00000000,0.93529479,0.72660025,0.60843424,0.92230129,1.00000000,0.93784535,0.39290784,0.06789974,0.11868676,0.02278545,0.03512247,0.05873994,0.00267814,0.41118912,0.05280134,0.15057970,0.06689126,0.84835998,0.13662723,0.01417314,0.62984216,0.23774336\n\t\t,0.02103652,0.33439736,0.12378660,0.39203038,0.74087914,0.49210680,0.08388545,0.88761797,0.57019080,0.84293200,0.37084973,0.02019709,0.09561439,0.08615301,0.11501708,0.07599473,0.16218707,0.45532845,0.78328733,0.84794107,0.89554577,0.92536229,0.76730814,0.84300160,0.96982610,1.00000000,0.91017683,0.58372589,0.88536338,0.96564310,0.91427592,0.42631973,0.70533703,0.51823239,0.07957013,0.12216173,0.01240761,0.02048826\n\t\t,0.05241835,0.34345482,0.17930286,0.68476925,0.00826990,0.92609910,1.00000000,1.00000000,0.76252559,0.39829860,0.21124194,0.94346726,1.00000000,1.00000000,0.79080864,0.42405335,0.22129087,1.00000000,0.94776132,1.00000000,0.80496889,0.37062246,0.35526558,0.52923288,1.00000000,0.94381823,0.81187319,0.52250220,1.00000000,1.00000000,1.00000000,1.00000000,0.08058520,0.92925359,0.44944818,1.00000000,1.00000000,0.94817116\n\t\t,0.03040795,0.81128901,0.18380541,0.97091941,0.04858537,0.17108336,0.98820692,1.00000000,0.00203756,0.07826962,0.00893536,0.46060093,0.79661094,0.01052474,0.04779016,0.08165092,0.07327431,0.05547266,0.02597854,0.00395839,0.00183913,0.29167258,0.36176968,0.72762593,0.89226332,0.86073671,0.38430659,0.19719914,0.24165363,0.23326253,0.07603085,0.06740089,0.70057099,0.69453318,0.08269510,0.02228271,0.36832064,0.34812089\n\t\t,0.23602301,0.44022314,0.53588943,0.29684554,0.48374763,0.00643046,0.75556690,0.01026884,0.09016660,0.06279214,0.18546563,0.96503988,0.35818083,0.15079275,0.07151232,0.04258674,0.00615633,0.02565751,0.05542524,0.07230741,0.07941059,0.04496726,0.05191371,0.90137760,0.11352991,0.41584318,0.87634843,0.19241990,0.11361467,0.87346136,0.36692311,0.32423749,0.68505124,0.05961231,0.46868751,0.68946474,0.02118955,0.08724610\n\t\t,0.89376976,0.01663597,0.08534513,0.71034781,0.05147322,0.14602358,0.25410656,0.47074500,0.35623638,0.03702825,0.21583594,0.57273794,0.83740574,0.80093719,0.17436339,0.02531627,0.18906802,0.78457723,0.42220304,0.39786999,0.03463615,0.00861197,0.05633833,0.01813513,0.13398167,0.27510943,0.18470137,0.07473250,0.09814010,0.15344398,0.15057843,0.52646711,0.86267927,0.53851102,0.90250522,0.99518953,0.77359445,0.39307687\n\t\t,0.73413647,0.90857531,0.93205223,0.84892596,0.96044297,0.95100075,0.67814646,0.80549394,0.86862827,0.83801208,0.98722416,0.96691674,0.99012098,1.00000000,0.96592085,1.00000000,0.92869539,0.66271273,0.13607491,0.26184177,0.19335540,0.85776751,0.08549453,0.06856023,0.05443654,0.01767880,0.04717740,0.05725267,0.17646736,0.94179840,0.34083362,0.36044775,0.16144563,0.06774292,0.02552289,0.85307206,0.23073301,0.13492352\n\t\t,0.85419872,0.39148151,0.35260862,0.02196982,0.66769721,0.06774231,0.47879682,0.69418055,0.07718796,0.13093701,0.86437372,0.02964442,0.10607641,0.00349652,0.70837366,0.09511510,0.19342389,0.04041333,0.28455552,0.49065839,0.38202542,0.05673375,0.24545315,0.58286556,0.82889219,0.77055381,0.19285862,0.03662402,0.22186299,0.75235659,0.45629950,0.41310596,0.03198571,0.00357373,0.05218872,0.01756464,0.12126778,0.26210085\n\t\t,0.19478115,0.07942883,0.09814121,0.14004161,0.16947892,0.46430025,0.83782311,0.52505194,0.87784049,0.94057416,0.74199219,0.84629706,0.41317745,0.72988277,0.86954218,0.89923392,0.80515156,0.81435754,0.84536587,0.92417260,0.90964313,0.66873214,0.79980777,0.83268393,0.79586242,0.95635637,0.93107919,0.95717015,0.99803896,0.94093790,0.98527608,0.89641878,0.63286982,0.15142618,0.74849145,0.19966543,0.09098854,0.06676772\n\t\t,0.04800731,0.00601890,0.03294160,0.25022230,0.27566429,0.00695528,0.27285979,0.42859386,0.79868350,1.00000000,1.00000000,0.94314258,0.26042926,0.40319926,0.77953261,1.00000000,1.00000000,0.93060946,0.97644477,0.85914525,1.00000000,0.98219648,0.60616597,0.26452565,0.20463437,0.88362991,0.99564152,1.00000000,0.99685996,0.63597175,0.27948576,1.00000000,1.00000000,0.99700421,0.88810599,0.68419844,0.42161183,0.43514287\n\t\t,1.00000000,1.00000000,1.00000000,0.89486547,0.69045522,1.00000000,0.94916970,1.00000000,0.81568322,0.47223643,1.00000000,1.00000000,1.00000000,1.00000000,0.93460601,0.43457072,0.20225635,0.09296453,0.05407092,0.01173654,0.77471790,0.92346768,0.45948520,0.20909553,0.09026445,0.03774757,0.00166064,0.76829209,0.00192721,0.96766097,0.98452036,1.00000000,1.00000000,1.00000000,1.00000000,0.98085833,1.00000000,0.10775636\n\t\t,0.06303372,0.88988696,0.67001751,0.27122958,1.00000000,1.00000000,0.99511379,0.91430092,0.00124875,0.01025250,0.05360019,0.11732301,0.29007083,0.02430039,0.00338666,0.66757592,0.02470952,0.05576546,0.07268411,0.07933726,0.04313844,0.01137530,0.00984059,0.01240230,0.07452894,0.07829110,0.06599437,0.04124231,0.00600187,0.01303394,0.00412356,0.53886561,0.06924976,0.53153009,0.40389483,0.25675288,0.41904635,0.45276283\n\t\t,0.78841497,0.10565800,0.69132570,0.88414894,0.89399595,0.58241729,0.29233781,0.01405791,0.92315618,0.32032548,0.15078239,0.67177721,0.84938806,0.88019113,0.35331629,0.57331525,0.01931701,0.05899881,0.07597158,0.37470211,0.75697083,0.88233110,0.74575807,0.41335873,0.23761911,0.07980075,0.20746458,0.89805877,0.38447127,0.75156115,0.07132984,0.03344499,0.36260559,0.70238478,0.24055986,0.86588916,0.40572718,0.72429637\n\t\t,0.07876205,0.08484022,0.37892739,0.70724492,0.72920523,0.07281673,0.40579762,0.78314589,0.91432253,0.36942385,0.05617922,0.07936061,0.38553689,0.75070351,0.87646182,0.73114576,0.41690063,0.24538425,0.08575436,0.60292425,0.59543570,0.02847944,0.51760792,0.50070874,0.16138809,0.01200822,0.00995578,0.13455649,0.35094868,0.22379880,0.22220974,0.49093383,0.42433936,0.02422919,0.24439115,0.93572756,0.73613198,0.22924514\n\t\t,0.09132928,0.05702968,0.02084641,0.00065894,0.21193910,0.20038409,0.46383967,0.06183294,0.85243431,0.02212122,0.85478749,0.12806633,0.00190036,0.75765740,0.29183114,0.51649189,0.09505589,0.57522188,0.08359873,0.05008574,0.16203276,0.33459691,0.21440629,0.15626956,0.97412564,0.82019509,0.73356410,0.85621786,0.95183905,0.91104456,0.92897420,0.62690693,0.85514605,0.97832102,1.00000000,0.03538593,0.01913997,0.01682058\n\t\t,0.13414625,0.05083376,0.83225210,0.04314588,0.16475429,0.02263884,0.22292219,0.91207433,0.72559895,0.24176913,0.09347232,0.04563375,0.00769541,0.04130037,0.06574156,0.07644200,0.07156934,0.01722872,0.80436660,0.24037560,0.62458969,0.24038929,0.24196481,0.48300922,0.07572887,0.83934809,0.05928028,0.01392099,0.81543005,0.16108104,0.00406695,0.72669494,0.32078801,0.53491493,0.14455364,0.57073190,0.07606931,0.04504535\n\t\t,0.17795606,0.30530457,0.21788768,0.16227466,0.94213860,0.77691318,0.70857135,0.84292544,0.91983862,0.87760484,0.90795260,0.60951107,0.81364422,0.94225399,0.97742470,0.03191471,0.00881801,0.31762499,0.63787089,1.00000000,1.00000000,0.99603238,0.88687793,0.26848225,0.29892979,0.61814074,1.00000000,0.98951170,0.98279687,0.86912231,1.00000000,1.00000000,1.00000000,0.89771757,0.68897559,1.00000000,1.00000000,0.90713325\n\t\t,0.65644256,0.28379296,0.11700824,0.06653050,0.02472228,0.00694607,0.97106692,0.88388613,0.65688811,0.30031101,0.12731424,0.05692107,0.01289430,0.94868679,0.99238848,0.98008044,1.00000000,1.00000000,1.00000000,0.01570936,0.04117847,0.06627489,0.07659901,0.07118893,0.01550773,0.00452422,0.43997821,0.38470344,0.33383035,0.85238123,0.43114997,0.33302098,0.11228183,0.35905910,0.50953700,0.15025054,0.14850589,0.01554866\n\t\t,0.14648832,0.66268069,0.86711297,0.87611694,0.55717461,0.12605885,0.00585523,0.01316355,0.01578003,0.16721295,0.64646431,0.82979226,0.86222793,0.62380268,0.55185308,0.02146392,0.30570751,0.85856254,0.03053043,0.80774733,0.17044865,0.01459675,0.33134128,0.52382398,0.15433500,0.61144151,0.84303654,0.32550375,0.33977257,0.15658401,0.01510756,0.15436789,0.66053251,0.86476396,0.86709327,0.53732433,0.12534601,0.00392183\n\t\t,0.01607161,0.17414290,0.64047571,0.82631102,0.85221960,0.54466794,0.02890455\n\t\tTransform: 0.999019145965576,0.043803390115499,-0.006517543923110,0.000000000000000,0.039649270474911,-0.819135010242462,0.572228610515594,0.000000000000000,0.019726831465960,-0.571925640106201,-0.820068240165710,0.000000000000000,-0.422863155603409,0.049965478479862,0.222018301486969,1.000000000000000\n\t\tTransformLink: 0.999018669128418,0.019726801663637,-0.039649311453104,0.000000000000000,0.043803356587887,-0.571925640106201,0.819135129451752,0.000000000000000,-0.006517496425658,-0.820068180561066,-0.572228670120239,0.000000000000000,0.421706557273865,0.218988418579102,0.069350525736809,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-toe_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 9036,9037,9039,9050,9051,9052,9053,9054,9055,9056,9057,9058,9061,9062,9063,9064,9065,9066,9067,9069,9070,9071,9072\n\t\t,9073,9078,9079,9080,9081,9097,9098,9100,9111,9112,9113,9114,9115,9116,9117,9118,9119,9122,9123,9125,9126,9127,9128\n\t\t,9129,9131,9132,9133,9134,9135,9140,9141,9142,9143,9146,9159,9160,9161,9163,9166,9167,9168,9169,9172,9173,9174,9176\n\t\t,9178,9179,9180,9181,9183,9184,9185,9219,9222,9223,9224,9226,9227,9228,9233,9234,9235,9239,9240,9241,9242,9247,9248\n\t\t,9250,9251,9252,9253,9254,9255,9271,9272,9273,9274,9277,9280,9281,9282,9286,9287,9288,9289,9295,9296,9297,9299,9311\n\t\t,9312,9313,9314,9315,9316,9317,9318,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,9333,9334,9335,9337,9339\n\t\t,9340,9341,9343,9344,9345,9347,9350,9351,9352,9353,9358,9359,9364,9378,9379,9387,9390,9391,9392,9396,9397,9398,9399\n\t\t,9400,9405,9406,9407,9409,9421,9422,9423,9424,9425,9426,9427,9428,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441\n\t\t,9442,9443,9444,9445,9447,9449,9450,9451,9452,9453,9454,9455,9456,9457,9458,9459,9460,9463,9464,9465,9466,9470,9471\n\t\t,9472,9488,9489,9491,9492,9493,9496,9497,9498,9499,9502,9503,9504,9507,9508,9509,9510,9511,9514,9515,9518,9519,9520\n\t\t,9521,9522,9526,9527,9529,9531,9532,9596,9602,9605,9606,9607,9611,9614,9615,9616,9617,9620,9623,9624,9625,9626,9627\n\t\t,9635,9637,9638,9639,9643,9646,9648,9649,9650,9654,9655,9658,9660,9661,9662,9663,9666,9667,9668,9669,9670,9677,9681\n\t\t,9686,9687,9688,9689,9690,9696,9697,9705,9708,9709,9710,9713,9714,9715,9716,9723,9724,9725,9726,9727,9728,9731,9732\n\t\t,9733,9734,9735,9738,9739,9746,9748,9750,9751,9752,9753,9754,9755,9772,9773,9774,9775,9778,9781,9782,9783,9786,9787\n\t\t,9788,9789,9796,9797,9798,9799,9800,9801,9804,9805,9806,9807,9808,9809,9811,9812,9818,9819,9822,9823,9824,9825,9826\n\t\t,9829,9830,9834,9835,9870,9877,9880,9881,9882,9883,9884,9885,9889,9891,9892,9893,9894,9895,9896,9901,9903,9905,9906\n\t\t,9907,9912,9913,9916,9919,9920,9921,9922,9923,9928,9929,9930,9931,9932\n\t\tWeights: 0.95880224,0.87601171,0.02233292,0.00787353,0.50983237,0.92454767,1.00000000,1.00000000,0.09235848,0.42697755,0.12343192,0.66756443,1.00000000,0.97360904,0.89903724,0.91718091,0.88140340,0.92983532,0.61625048,0.55398812,0.18371266,0.11343494,0.06340371,0.02133422,0.06470521,0.27339975,0.39156576,0.07769871,0.94719866,0.84942030,0.04696042,0.01619329,0.50789320,0.91611455,1.00000000,1.00000000,0.11121099,0.42980920\n\t\t,0.15706800,0.62915027,1.00000000,0.97980291,0.90438561,0.91384699,0.88498292,0.92400527,0.83781293,0.54467155,0.21671267,0.15205893,0.08844612,0.05890260,0.08982317,0.41627411,0.11463662,0.02793366,0.29466297,0.65654518,0.82069714,0.31523075,0.07390090,0.23747441,0.60170140,0.78875806,0.05653274,0.20919136,0.57594665,0.77870913,0.05223868,0.19503111,0.62937754,0.64473442,0.47076712,0.05618177,0.18812681,0.47749780\n\t\t,1.00000000,0.63823032,0.27237407,0.09458551,1.00000000,0.12277663,0.61569341,0.92396915,0.93259911,0.00505093,1.00000000,1.00000000,0.63167936,0.65187911,1.00000000,0.51625237,0.01595508,1.00000000,0.98973116,0.90983340,0.93720786,0.81453437,1.00000000,1.00000000,0.94808629,0.09646283,0.09037568,0.88638533,1.00000000,0.08181663,0.31494876,0.94038769,1.00000000,0.53131249,0.10623024,0.98336403,0.91465487,0.00038871\n\t\t,0.04452751,0.19906281,0.82563661,0.97468373,1.00000000,0.81093198,0.21542277,0.57779696,0.60213001,0.96536385,1.00000000,0.99138803,0.94366167,0.98186487,0.86601833,0.72489057,0.81529863,0.92526750,0.90185990,0.84655602,0.84942157,0.47353289,0.46148898,0.00481047,0.22640555,0.60692313,0.09142469,0.06794777,0.15107404,0.04899925,0.13137173,0.16198792,0.01277584,0.03308326,0.07130461,0.33728727,0.02635982,0.94274733\n\t\t,0.82353264,0.11664190,0.86507648,1.00000000,0.10687878,0.33230279,0.93225769,1.00000000,0.52120318,0.00919847,0.13464360,0.97035558,0.89392359,0.01562734,0.05479536,0.22944619,0.80714138,0.96337598,1.00000000,0.77813701,0.24764341,0.54370050,0.58689404,0.96801429,1.00000000,0.99642627,0.94781128,0.98243536,0.87873222,0.73789915,0.80521885,0.92057117,0.90185879,0.85995839,0.83052108,0.53569975,0.47494806,0.04610874\n\t\t,0.25800781,0.15370294,0.58682255,0.01687719,0.13045782,0.10076608,0.19484844,0.18564246,0.05222436,0.01101918,0.07423074,0.16731607,0.20413758,0.04364363,0.06892081,0.01472392,0.10358122,0.36713018,0.74977770,0.72433571,0.72714021,0.57140614,0.20131650,0.05685742,0.73957074,0.59680074,0.22046739,0.06939054,0.02355523,0.14085475,0.39383403,0.73547435,0.79536563,0.11637009,0.00435848,0.36402825,0.72051424,0.00299579\n\t\t,0.11189401,0.31580156,0.57838817,0.56485713,0.10513453,0.30954478,0.05083030,0.18431678,0.52776357,0.93075024,0.21158503,0.30867430,0.11585106,0.00952480,0.07481453,0.32822279,0.15061194,0.03689868,0.64668371,1.00000000,1.00000000,0.92402842,0.62529789,0.24302917,0.10135795,0.08941647,0.24843885,0.92867016,1.00000000,0.63739441,0.11553456,0.27570363,0.92123795,1.00000000,0.62107261,0.00324189,0.92718327,0.21685411\n\t\t,0.07810021,0.63057615,1.00000000,1.00000000,0.92063939,0.61446311,0.24929649,0.10374775,0.39707575,0.40456430,0.83861191,0.98799178,0.99004422,0.86544351,1.00000000,0.97577081,0.75560885,0.78806090,1.00000000,0.93816706,0.03660202,0.14521251,0.87193367,0.99809964,0.24234260,0.42477812,0.91640127,0.94991426,0.83796724,0.66540309,0.78559371,0.17980491,0.26643590,0.02513066,0.04816095,0.08895544,0.14485395,0.02167898\n\t\t,0.86585375,0.05011389,1.00000000,1.00000000,0.95685412,0.83524571,0.97736116,0.77707781,1.00000000,1.00000000,1.00000000,0.19563340,0.75961071,1.00000000,0.92427113,0.05457130,0.18456995,0.83891896,0.99593305,0.27330506,0.42926810,0.92393069,0.95495465,0.82204394,0.69469543,0.78211232,0.22308682,0.29142865,0.05112517,0.08016138,0.12239516,0.02355546,0.18635578,0.05774601,0.68237501,0.36212911,0.00396762,0.11312207\n\t\t,0.73151775,0.70107021,0.38185926,0.01720313,0.13087769,0.10228243,0.31102441,0.14761877,1.00000000,0.85149411,0.98445134,0.85351168,0.33731931,0.13288703,0.01691594,0.98683645,0.98421997,0.83278705,0.35353569,0.17020774,0.04434982,0.37619732,0.02438248,1.00000000,0.19225267,0.82955135,0.98540325,0.38855849,0.05042248,1.00000000,0.98489244,0.84563211,0.33946749,0.13523604,0.01951160,0.98392839,0.82585710,0.35952429\n\t\t,0.17368898,0.04508223\n\t\tTransform: 1.000000238418579,0.000000082392496,-0.000000262457320,0.000000000000000,0.000000004599308,-0.988325715065002,-0.152355253696442,0.000000000000000,-0.000000245242035,0.152355313301086,-0.988325893878937,0.000000000000000,-0.437308192253113,-0.359217107295990,-0.039910282939672,1.000000000000000\n\t\tTransformLink: 0.999999761581421,-0.000000271946192,-0.000000041443855,0.000000000000000,0.000000041909516,0.152355253696442,0.988325893878937,0.000000000000000,-0.000000241678208,-0.988325715065002,0.152355313301086,0.000000000000000,0.437308102846146,0.015284135937691,0.361104071140289,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-heel_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3882,3885,3886,3888,3891,3892,3893,3896,3897,3899,3902,3903,3905,3908,3909,3912,3915,3916,3917,3920,3921,4658,4659\n\t\t,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682\n\t\t,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705\n\t\t,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728\n\t\t,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4748,4749,4750,4751\n\t\t,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774\n\t\t,4775,4776,4777,4778,4779,4780,4781,4782,4783,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379\n\t\t,6380,6381,6382,6383,6384,6385,6386,6387,6390,6392,6393,6396,6397,6400,6908,6909,6910,6911,6912,6913,6914,6915,6916\n\t\t,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939\n\t\t,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962\n\t\t,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985\n\t\t,6986,6987,6988,6989,6990,6991,7892,7893,7894,7895,7896,7897,7898,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978\n\t\t,7979,7980,7981,7982,9035,9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,9050,9059,9060,9068,9074,9075\n\t\t,9076,9083,9084,9085,9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9099,9100,9101,9102,9103,9104,9105,9106\n\t\t,9107,9108,9109,9110,9111,9116,9120,9121,9124,9130,9134,9135,9136,9137,9138,9143,9144,9145,9147,9148,9149,9150,9151\n\t\t,9152,9153,9154,9155,9156,9157,9158,9162,9190,9191,9192,9195,9196,9197,9198,9199,9200,9201,9202,9203,9205,9206,9207\n\t\t,9208,9209,9210,9211,9212,9213,9214,9215,9216,9217,9218,9220,9221,9224,9225,9227,9229,9230,9231,9232,9235,9236,9237\n\t\t,9238,9243,9244,9245,9246,9249,9250,9256,9257,9258,9259,9260,9261,9262,9263,9264,9265,9266,9267,9268,9269,9270,9275\n\t\t,9276,9277,9278,9279,9282,9283,9284,9285,9290,9291,9292,9293,9294,9298,9299,9300,9301,9302,9303,9304,9305,9306,9307\n\t\t,9308,9309,9310,9311,9319,9320,9321,9336,9338,9342,9346,9348,9349,9354,9356,9360,9361,9362,9363,9364,9365,9366,9367\n\t\t,9368,9369,9370,9371,9372,9373,9374,9375,9376,9377,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9392,9393,9394\n\t\t,9395,9400,9401,9402,9403,9404,9405,9408,9409,9410,9411,9412,9413,9414,9415,9416,9417,9418,9419,9420,9421,9429,9430\n\t\t,9431,9446,9448,9449,9453,9458,9459,9460,9461,9462,9467,9468,9469,9473,9474,9475,9476,9477,9478,9479,9480,9481,9482\n\t\t,9483,9484,9485,9486,9487,9490,9506,9513,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9548,9549,9550,9551\n\t\t,9552,9553,9558,9560,9561,9562,9563,9564,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581\n\t\t,9582,9583,9584,9585,9586,9587,9588,9589,9590,9591,9592,9593,9594,9595,9597,9598,9599,9600,9601,9603,9604,9607,9608\n\t\t,9609,9610,9612,9613,9616,9618,9619,9621,9622,9627,9628,9629,9630,9631,9632,9633,9634,9635,9636,9640,9641,9642,9644\n\t\t,9645,9646,9647,9651,9652,9653,9655,9656,9657,9659,9664,9665,9670,9671,9672,9673,9674,9675,9676,9678,9679,9680,9682\n\t\t,9683,9684,9685,9691,9692,9693,9694,9695,9698,9699,9700,9701,9702,9703,9704,9706,9707,9710,9711,9712,9717,9718,9719\n\t\t,9720,9721,9722,9729,9730,9733,9736,9737,9741,9742,9743,9744,9745,9747,9748,9749,9756,9757,9758,9759,9760,9761,9762\n\t\t,9763,9764,9765,9766,9767,9768,9769,9770,9771,9776,9777,9779,9780,9783,9784,9785,9790,9791,9792,9793,9794,9795,9802\n\t\t,9803,9806,9809,9810,9813,9814,9815,9816,9817,9828,9838,9839,9840,9841,9842,9843,9844,9845,9846,9847,9848,9849,9850\n\t\t,9851,9852,9853,9854,9855,9859,9860,9861,9862,9863,9864,9865,9866,9867,9868,9869,9871,9872,9873,9874,9875,9876,9878\n\t\t,9879,9885,9886,9887,9888,9890,9895,9897,9898,9899,9900,9901,9902,9904,9908,9909,9910,9911,9913,9914,9915,9917,9918\n\t\t,9923,9924,9925,9926,9927,9932,9933,9934,9935\n\t\tWeights: 0.03773152,0.05953389,0.03085175,0.14646482,0.13469383,0.12948549,0.03581484,0.04111347,0.04181368,0.04343842,0.04155409,0.04337576,0.07574011,0.08186772,0.07251798,0.09376375,0.08057868,0.11201531,0.09264523,0.07411350,0.09707130,0.12062601,0.10957568,0.15593241,0.12101030,0.10474803,0.09548850,0.14409392,0.15595599,0.10525923,0.26902819,0.29372400,0.26247612,0.26539432,0.27082722,0.31494068,0.28370238,0.25992873\n\t\t,0.26532107,0.10364880,0.09544911,0.09618140,0.10453887,0.11602251,0.10603560,0.08896779,0.09695212,0.11700832,0.09023942,0.08320011,0.09228611,0.09060888,0.09025942,0.08343612,0.08466351,0.09288269,0.09067308,0.18347551,0.17720348,0.19775290,0.18465738,0.17493270,0.16719678,0.19364950,0.19834591,0.17655627,0.19545986,0.19340311,0.17922342,0.19577207,0.22206015,0.22644679,0.17289685,0.18056613,0.22082468,0.24829405\n\t\t,0.27647530,0.17758640,0.24182384,0.23392392,0.24978054,0.17546824,0.17694983,0.23196905,0.14050389,0.13450561,0.16034086,0.14386402,0.12663839,0.11926475,0.16106177,0.15912005,0.13163661,0.20158863,0.22248810,0.20324728,0.18874768,0.19549376,0.21603993,0.22250162,0.19169518,0.18314601,0.12569401,0.11805976,0.11823034,0.13128279,0.13685133,0.13056381,0.11006410,0.12440143,0.14081825,0.11123241,0.10359271,0.11282178\n\t\t,0.11775842,0.11162763,0.10391024,0.10507343,0.11934071,0.11809090,0.18613745,0.18731822,0.18774983,0.18371648,0.18504040,0.18383880,0.19297480,0.18298927,0.18413526,0.19375946,0.19594419,0.18881607,0.19104658,0.19827521,0.20643655,0.18729626,0.18836961,0.19291882,0.18068302,0.19511348,0.16739117,0.17234833,0.18711589,0.20217873,0.17222660,0.16327588,0.17820181,0.28847800,0.27996948,0.16164611,0.15153976,0.17923081\n\t\t,0.23411845,0.14246689,0.15363631,0.17503610,0.07034261,0.07003298,0.07006285,0.07811862,0.07558845,0.07275191,0.33342200,0.34654596,0.35490357,0.07438986,0.07819916,0.11164090,0.03800328,0.08894987,0.11680923,0.04250493,0.05680487,0.09014185,0.07352050,0.21990476,0.21824110,0.17617156,0.18379489,0.19668915,0.21525394,0.18026233,0.18655294,0.19694687,0.09769028,0.09588989,0.09595191,0.12294989,0.11006670,0.10216433\n\t\t,0.24274327,0.24723794,0.24498475,0.11104369,0.12702739,0.15920281,0.09914647,0.09841751,0.08928020,0.25963092,0.23237220,0.22875519,0.26680743,0.24925470,0.24704945,0.13778473,0.13699067,0.12491405,0.08513213,0.09199825,0.09263018,0.17478687,0.17304719,0.16503254,0.21752876,0.21465662,0.21453959,0.17404139,0.16849617,0.16082823,0.18727766,0.18888271,0.18957564,0.18327788,0.18152630,0.17996730,0.12321865,0.12181560\n\t\t,0.12197072,0.14176525,0.13308396,0.12726148,0.17790224,0.18332622,0.18670800,0.13396526,0.14434245,0.15758829,0.12400163,0.11803937,0.11052551,0.19586453,0.18218009,0.17336468,0.21710490,0.20198523,0.19329744,0.15215826,0.15152074,0.14864068,0.10570318,0.11389954,0.12016487,0.18585833,0.18537104,0.18326217,0.19907874,0.18857075,0.18131307,0.14102258,0.34556356,0.07185290,0.10339481,0.21416979,0.07077253,0.19476552\n\t\t,0.17905894,0.23491215,0.10345772,0.14324261,0.20954353,0.09781159,0.21320415,0.18526541,0.18889133,0.12716232,0.15173369,0.17762992,0.12364772,0.16978866,0.21430513,0.27280769,0.05040709,0.21282737,0.67733230,0.63550591,0.13933964,0.24585240,0.45186663,0.84483098,0.20999373,0.27882006,0.19217575,0.09729358,0.99129186,0.81518021,0.24868402,0.12130923,0.11283095,0.00856861,0.06215465,0.38878353,1.00000000,0.93516988\n\t\t,0.70920411,0.81718556,0.97149721,1.00000000,1.00000000,0.96487753,0.94126006,0.99732186,1.00000000,0.35131799,0.80889899,0.06354918,0.60174264,0.94552978,0.81172782,0.20838128,0.49335274,0.87249623,0.93102188,0.38813419,0.54828810,0.31760839,0.12059697,0.00117104,1.00000000,1.00000000,0.76100663,0.99673147,0.01600810,0.01573511,0.16699470,0.14850187,0.03017390,0.00642324,0.08572408,0.46832291,0.45530220,1.00000000\n\t\t,1.00000000,0.87323690,0.99947643,0.87783827,0.98759239,1.00000000,1.00000000,0.97951174,0.94758165,1.00000000,0.99173010,0.91299356,0.07074641,0.49014021,0.05182884,1.00000000,0.96959205,0.17561254,0.81619459,0.02908059,0.95141463,0.78150897,0.01179308,0.99796244,1.00000000,0.92173038,0.99106464,0.53389762,0.20338906,0.98947526,0.91912335,0.84353203,0.86042597,0.89863327,0.96505842,0.99604161,0.99816087,0.68201082\n\t\t,1.00000000,0.00018242,1.00000000,0.01648666,0.32257892,0.65886221,0.55672864,1.00000000,0.17848709,0.12291707,0.81259288,0.28897578,0.51854867,0.35720180,0.38949247,0.61640486,0.75463012,0.09889257,0.03496012,0.57990248,0.80275910,0.92666494,0.95741326,0.99384367,0.96614310,0.89888651,0.86238604,0.84806740,0.92536974,1.00000000,1.00000000,1.00000000,0.90293026,0.39799773,0.22555428,0.00784850,0.29316737,0.73665629\n\t\t,0.01339344,0.23726470,0.19297908,0.49329145,0.11482236,0.30761616,0.75562294,0.77723828,0.22607733,0.53929929,0.10904955,0.23352386,0.92758403,0.22443722,0.37325575,0.22817403,0.18299778,0.21408822,0.73734113,0.43659218,0.22427849,0.14764784,0.04990409,0.99279582,1.00000000,0.90975191,0.13587602,0.09336650,0.10600872,0.03955703,0.25648107,0.12122027,0.00987902,0.03407915,0.60674373,0.58166838,0.72335449,0.96975924\n\t\t,0.05087197,0.99015123,0.79226305,1.00000000,0.89558033,0.94556346,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.98232120,0.95282260,1.00000000,0.05820160,0.55451546,0.63408313,0.83855437,0.93225708,0.97447711,1.00000000,0.02507357,0.54023641,0.97773860,0.03218016,0.38007261,0.36957890,0.83861072,0.16193515,0.81357504,0.94174478,0.99893086,0.59287949,0.00098268,0.91889905,0.15767421,0.72546943,1.00000000\n\t\t,0.53125841,0.84976873,0.43286985,0.28944292,0.36511829,0.87652083,0.70822140,0.41539256,0.20817255,0.05852853,1.00000000,1.00000000,1.00000000,0.16217689,0.12215951,0.01331710,0.15128416,0.06599818,0.06480822,0.01612613,0.30818649,0.16027113,0.04282985,0.00196104,0.05906210,0.76787365,0.12041174,0.78495355,1.00000000,1.00000000,0.89287638,1.00000000,0.93323228,0.95199269,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,0.99398110,0.96705840,0.99304472,0.01780352,0.00314004,0.06539399,0.50312410,0.74358813,0.89487893,0.94592908,0.98826346,0.20418177,0.07653232,0.53477699,0.79090447,0.90973555,0.96225243,0.99833936,0.23170791,0.99807279,0.03233903,0.01547964,0.01914167,0.87294869,0.93696628,0.11011304,0.28707142,0.66888931,0.00488621,0.08569908,0.99875125,1.00000000,0.98974750,0.94639981,0.88267699,0.70992917,0.97569961,0.99661334\n\t\t,0.33242408,0.96754351,0.89777020,0.86163513,0.84818929,0.92855595,0.98862470,0.99015941,0.98759770,0.85787222,0.85031225,0.87509192,0.93343218,0.99399813,0.98696606,1.00000000,0.99587644,0.40467821,0.88877888,0.46273334,0.56737446,0.67883104,0.32037736,0.48083867,1.00000000,0.32575494,0.05042062,0.24733033,0.28814963,0.84217113,0.46231480,0.67938452,0.07009920,0.32950040,0.98068299,0.60088438,1.00000000,0.01631095\n\t\t,0.17113948,0.44466682,0.63027308,1.00000000,0.85442774,1.00000000,0.33877511,0.00035674,0.25379612,0.32531961,0.76573380,0.99230119,0.12261135,0.56052711,0.01857628,0.38763589,0.81434577,0.99856011,1.00000000,0.17841890,0.12158283,0.82724273,0.29205715,0.49025272,1.00000000,0.01979043,0.17437883,0.41720220,0.59503359,1.00000000,0.83113321,1.00000000,1.00000000,1.00000000,0.91064335,0.91274549,0.48659465,0.29461529\n\t\t,0.19567991,0.42922987,0.45528062,0.40371886,0.37772417,0.49382654,0.06427244,0.22926943,0.71100764,0.89511415,0.94297032,0.97915359,0.99934106,0.20582946,0.17256097,0.04616864,0.33280457,0.49073038,0.88518129,0.26127446,0.59476044,0.18056628,0.27316693,0.91507491,0.68978338,0.02587436,0.05152653,0.04678474,0.25945389,0.88811411,1.00000000,0.98086003,1.00000000,0.98317942,0.61409897,0.05373163,0.83261604,0.08792567\n\t\t,0.27440105,0.75823087,0.90652768,0.95436625,0.99230459,1.00000000,0.93349128,0.87562938,0.85404869,0.86390719,0.98213925,1.00000000,1.00000000,1.00000000,0.97130819,0.29503379,0.15357824,0.44277123,0.27929069,0.05962164,0.76569203,0.92613103,1.00000000,0.43927143,0.90012513,0.27464528,0.67242029,1.00000000,0.78465373,0.05786140,0.06618535,0.06849194,0.32794258,0.02257530,0.96808529,1.00000000,0.99118199,1.00000000\n\t\t,0.01048830,0.09286675,0.29713159,0.65352966,0.85980947,0.93233649,0.97527772,0.99305393,0.02893308,0.11611387,0.34311189,0.69968899,0.87268576,0.94307893,0.98710570,1.00000000,0.05131321,0.00761152,0.01991956,0.98429064,0.93353217,0.87458106,0.85373098,0.86458331,0.98449227,0.99547578,0.49612468,0.47232365,0.38307374,0.50485474,0.55782232,0.52750223,0.90825654,0.35182606,0.57378174,0.19828656,0.74219211,1.00000000\n\t\t,0.05091167,0.22572525,0.52186284,0.76127367,0.96192379,0.06994491,0.31875933,0.96315098,0.29679649,1.00000000,0.05181902,1.00000000,0.91324653,0.46285917,0.29622173,0.68220662,1.00000000,0.06926595,0.34599836,0.49510414,0.71172125,1.00000000,0.05223702,0.21467419,0.44767640,0.66342525,0.93629414,0.07162542,0.30658152,0.93475583,1.00000000\n\t\tTransform: -0.996467709541321,0.083321250975132,-0.010489988140762,0.000000000000000,0.052713703364134,0.523346126079559,-0.850488066673279,0.000000000000000,-0.065373860299587,-0.848036587238312,-0.525889575481415,0.000000000000000,0.438188761472702,0.186867430806160,0.060605630278587,1.000000000000000\n\t\tTransformLink: -0.996467411518097,-0.065373837947845,-0.052713669836521,0.000000000000000,0.083321280777454,-0.848036944866180,-0.523346245288849,0.000000000000000,-0.010489998385310,-0.525889694690704,0.850488185882568,0.000000000000000,0.421706557273865,0.218988418579102,0.069350525736809,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-heel_02_L\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4694,4695,4697,4698,4699\n\t\t,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732\n\t\t,4733,4734,4735,4736,4737,4738,4746,4748,4749,4750,4751,4752,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764\n\t\t,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4778,4779,4782,4783,6369,6370,6371,6381,6383,6911,6912,6913\n\t\t,6914,6915,6916,6917,6923,6924,6925,6926,6927,6928,6929,6930,6932,6933,6934,6935,6936,6937,6944,6945,6946,6950,6951\n\t\t,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974\n\t\t,6975,6976,6977,6978,6979,6980,6984,6985,6986,6987,6988,6989,6990,6991,7893,7898,7969,7970,7971,7975,7976,7977,7978\n\t\t,7979,7980,7981,7982,9035,9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,9050,9055,9059,9060,9068,9074\n\t\t,9075,9084,9086,9087,9088,9089,9096,9099,9100,9101,9102,9103,9104,9105,9106,9107,9108,9109,9110,9111,9124,9130,9136\n\t\t,9137,9145,9147,9150,9151,9190,9192,9198,9202,9209,9220,9224,9229,9230,9231,9235,9236,9237,9238,9243,9244,9245,9246\n\t\t,9249,9250,9257,9258,9259,9270,9274,9275,9276,9277,9278,9279,9282,9283,9284,9285,9290,9291,9292,9293,9294,9298,9299\n\t\t,9300,9301,9302,9303,9304,9305,9306,9307,9308,9309,9310,9311,9319,9321,9336,9338,9342,9348,9349,9360,9361,9362,9363\n\t\t,9364,9365,9366,9368,9381,9382,9387,9388,9389,9392,9393,9394,9395,9400,9401,9402,9403,9404,9408,9409,9410,9412,9413\n\t\t,9414,9415,9416,9417,9418,9419,9420,9421,9453,9458,9461,9462,9473,9474,9475,9478,9538,9539,9540,9543,9545,9560,9563\n\t\t,9564,9594,9595,9597,9598,9599,9600,9601,9604,9607,9608,9609,9610,9611,9612,9613,9616,9618,9621,9628,9629,9630,9632\n\t\t,9634,9635,9636,9640,9641,9642,9644,9645,9647,9651,9652,9655,9656,9657,9659,9661,9664,9671,9672,9673,9675,9680,9682\n\t\t,9683,9684,9685,9691,9692,9693,9694,9695,9699,9700,9701,9706,9707,9710,9711,9712,9717,9718,9719,9720,9721,9722,9729\n\t\t,9733,9736,9737,9741,9747,9748,9749,9771,9776,9777,9779,9780,9783,9784,9785,9791,9792,9793,9794,9802,9806,9810,9839\n\t\t,9840,9841,9842,9866,9867,9868,9869,9871,9872,9873,9874,9875,9876,9878,9885,9886,9887,9888,9890,9895,9897,9898,9899\n\t\t,9901,9904,9908,9909,9910,9913,9914,9915,9917,9923,9924,9925,9926,9927,9932,9933,9934\n\t\tWeights: 0.02979858,0.01642760,0.04754300,0.03033601,0.01679183,0.00731276,0.02558434,0.04936377,0.01732077,0.06709932,0.05280398,0.06784976,0.06933213,0.06222520,0.04571745,0.05518786,0.06953575,0.06474418,0.00710399,0.00150906,0.00820112,0.01509508,0.00842135,0.00055130,0.01666108,0.05214236,0.03961047,0.03736945,0.05381323,0.06111986,0.05122755,0.02740627,0.03998384,0.06294654,0.06270160,0.05528083,0.08088777,0.06612048\n\t\t,0.04702079,0.03570043,0.07252170,0.08110468,0.05445677,0.10616925,0.09793612,0.10396162,0.10576511,0.10363353,0.09464387,0.09624763,0.10265135,0.10415452,0.00217053,0.00965734,0.00337898,0.01714223,0.01575361,0.00520493,0.01000400,0.02390261,0.01073710,0.03148690,0.02156398,0.02332065,0.04111186,0.04133148,0.03120275,0.01340870,0.03269826,0.05088706,0.07287572,0.06695297,0.06159710,0.07510629,0.08727730,0.08218000\n\t\t,0.05567969,0.06558203,0.08525465,0.00276750,0.01019090,0.00892323,0.00476846,0.01709590,0.00643140,0.01266453,0.01651119,0.00287089,0.00139005,0.04797544,0.05910377,0.07185008,0.02221382,0.01310581,0.00503379,0.00365295,0.07883438,0.08265893,0.08140863,0.02437297,0.04044780,0.06042705,0.00730592,0.00659594,0.03762508,0.05688018,0.05883092,0.05452921,0.06570621,0.06713316,0.02675387,0.02468180,0.01670038,0.02211739\n\t\t,0.01472890,0.00886648,0.06769569,0.07594394,0.08423310,0.05487333,0.04850784,0.03933132,0.02848724,0.02033058,0.01463016,0.00291164,0.00331990,0.00564223,0.09886341,0.10042457,0.09790788,0.05587963,0.06636017,0.07952303,0.03719668,0.02985372,0.02096177,0.08619575,0.09535331,0.09654357,0.09094150,0.09759895,0.09454775,0.00112073,0.00076019,0.00598460,0.05733985,0.05264870,0.04344709,0.00622426,0.01594992,0.02525268\n\t\t,0.01016356,0.00013108,0.03333147,0.07741546,0.01263499,0.07156127,0.06041844,0.09181569,0.04108634,0.00491305,0.03066041,0.00955737,0.09159325,0.39919659,0.71769381,0.06611924,0.69964346,0.32266770,0.36301141,0.24564285,0.55600584,0.54813337,0.15516902,0.48296481,0.62559424,0.43500708,0.15014851,0.00355170,0.00870814,0.18481979,0.38172439,0.10604203,0.04056813,0.21830863,0.06483012,0.22289614,0.06412768,0.00571734\n\t\t,0.23749289,0.12420975,0.04113043,0.26163013,0.05447022,0.17409904,0.16177656,0.26890390,0.10646725,0.06897812,0.27746845,0.32792529,0.29036123,0.12233061,0.23899337,0.00326853,0.06569717,0.00849653,0.10535736,0.02646541,0.04719297,0.00052357,0.00642124,0.06041161,0.01309846,0.04740767,0.00550145,0.02631660,0.01296874,0.48022194,0.09948416,0.21000884,0.11589099,0.18254975,0.10471202,0.68874151,0.24542832,0.20257506\n\t\t,0.07461811,0.08674960,0.23893942,0.12958545,0.06191669,0.04644815,0.00182274,0.09706974,0.00215957,0.48847236,0.35860254,0.02542739,0.51441273,0.26334371,0.03132857,0.39581220,0.48278343,0.50670855,0.19571289,0.67119429,0.24437706,0.22276172,0.68667657,0.46070071,0.18021392,0.71500292,0.07241597,0.62953920,0.62674425,0.51771941,0.34625722,0.42967540,0.26265887,0.52637957,0.55988558,0.27961421,0.06816266,0.00720418\n\t\t,0.09024809,0.00144471,0.00412828,0.15985482,0.06537247,0.07328579,0.25718136,0.15648985,0.08329011,0.03024076,0.06500070,0.00984877,0.12224242,0.03585944,0.10465091,0.00546912,0.00521247,0.22903058,0.02226140,0.00674233,0.22844588,0.27781248,0.13941947,0.13468583,0.10923700,0.05825522,0.00106914,0.27618349,0.07760444,0.11832479,0.17941547,0.27531770,0.10981793,0.28257462,0.21989869,0.25285629,0.12347917,0.23504485\n\t\t,0.33915429,0.20896189,0.05778392,0.10195589,0.03641159,0.02308137,0.03992110,0.08070017,0.13109681,0.01538101,0.01613509,0.06230518,0.05415552,0.01215654,0.02110033,0.00573781,0.01929495,0.04291107,0.05988110,0.05645618,0.11122112,0.00573657,0.02873071,0.06441608,0.26057629,0.06639850,0.56858706,0.04605863,0.17025238,0.41951257,0.14377096,0.00202929,0.21735972,0.16983309,0.01281099,0.09718436,0.34011680,0.08310245\n\t\t,0.14197445,0.13210781,0.06577152,0.45376031,0.01216802,0.36173261,0.64123540,0.23426620,0.00769881,0.17500387,0.19891303,0.20663692,0.10081401,0.00143989,0.11109429,0.14921194,0.17275727,0.30214523,0.00757726,0.45356806,0.09447541,0.16589718,0.15958217,0.08311242,0.08935665,0.05877508,0.51340535,0.18777679,0.30361135,0.21982145,0.32092058,0.37407140,0.13134201,0.08183410,0.03459859,0.05974722,0.01355657,0.59378645\n\t\t,0.36359935,0.06479503,0.64507421,0.50926962,0.11481871,0.44689441,0.40523956,0.30294183,0.63177718,0.08492509,0.15394705,0.06712495,0.02424107,0.11363918,0.07649996,0.33506727,0.06390238,0.16738396,0.02869181,0.46459062,0.22183207,0.31526396,0.23770009,0.04645896,0.17502769,0.05994798,0.23994056,0.09987487,0.19043979,0.18302607,0.05307161,0.03976404,0.06254635,0.04642585,0.06267738,0.02318228,0.00113301,0.06389712\n\t\t,0.14297291,0.28309592,0.49514526,0.01102772,0.13947679,0.09174346,0.53589211,0.06715916,0.29217643,0.10755735,0.05605545,0.21710014,0.35207831,0.23287111,0.03807621,0.02347734,0.12938759,0.01538510,0.39749600,0.06523596,0.05622304,0.20579954,0.17995429,0.16345837,0.03727503,0.32849790,0.16512329,0.13169474,0.06115811,0.24800148,0.42697759,0.33265292,0.06370586,0.03107275,0.14875054,0.03633962\n\t\tTransform: 0.000000102253374,-0.998065412044525,-0.062175400555134,0.000000000000000,1.000000000000000,0.000000148729413,0.000000039125329,0.000000000000000,0.000000036230063,-0.062175419181585,0.998065233230591,0.000000000000000,-0.000000573977502,0.364852517843246,0.017493989318609,1.000000000000000\n\t\tTransformLink: 0.000000150874257,-0.000000029802322,-1.000000000000000,0.000000000000000,-0.998065054416656,-0.062175389379263,-0.000000104308128,0.000000000000000,-0.062175408005714,0.998065233230591,0.000000029802322,0.000000000000000,0.365234255790710,0.005224704742432,-0.000000536441803,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thigh_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 3517,3518,3519,3520,3521,3522,3523,3524,3525,3529,3532,3553,3555,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567\n\t\t,3568,3569,3570,3571,3572,3573,3575,3578,3579,3580,3636,3639,3640,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662\n\t\t,3663,3664,3665,3666,3667,3668,3669,3929,3959,3960,3961,3962,3963,3964,3966,3967,4012,4649,4650,4651,4652,4653,4654\n\t\t,4655,4656,4657,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,4807,4808,4816,4817\n\t\t,4818,4819,4820,4821,4822,4823,4824,4834,4842,4843,4844,4846,4847,4851,4855,4856,4857,4858,4859,4860,4861,4862,4863\n\t\t,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4882,4883,4884,4885,4886\n\t\t,4887,4888,4889,4890,4891,4892,4893,4894,4895,4896,4897,4898,4899,4900,4901,4902,4903,4904,4905,4906,4907,4908,4909\n\t\t,4910,4911,4912,4913,4914,4915,4916,4917,4918,4919,4920,4921,4922,4923,4924,4925,4926,4927,4928,4929,4930,4931,4932\n\t\t,4933,4934,4935,4936,4937,4938,4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,4950,4951,4952,4953,4954,4955\n\t\t,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,4971,4972,4973,4974,4975,4976,4977,4978\n\t\t,4979,4980,4981,4982,4983,4984,4985,4986,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,5000,5001\n\t\t,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011,5012,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024\n\t\t,5025,5026,5027,5028,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,5040,5041,5042,5043,5044,5045,5046,5047\n\t\t,5048,5049,5050,5051,5052,5053,5054,5055,5056,5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070\n\t\t,5071,5072,5073,5074,5075,5076,5077,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093\n\t\t,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116\n\t\t,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5222,5223\n\t\t,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246\n\t\t,5247,5248,5249,5250,5251,5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5277,5278,5281\n\t\t,5282,5285,5286,5287,5288,5289,5290,5291,5292,5294,5295,5296,5297,5298,5299,5300,5301,5302,5303,5304,5305,5306,5307\n\t\t,5308,5309,5311,5322,5913,5914,5917,5918,5923,5927,5928,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941\n\t\t,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,6083,6084,6085,6098,6099,6100,6101,6102\n\t\t,6103,6104,6105,6106,6131,6132,6133,6135,6137,6138,6139,6149,6152,6154,6155,6156,6157,6158,6159,6160,6163,6164,6165\n\t\t,6166,6170,6171,6172,6221,6222,6223,6224,6225,6226,6402,6403,6419,6420,6431,6432,6433,6464,6465,6887,6888,6889,6890\n\t\t,6891,6892,6893,6905,6906,6907,6992,6993,6994,6995,6996,6997,6998,6999,7000,7003,7004,7007,7008,7009,7010,7011,7012\n\t\t,7022,7023,7024,7025,7026,7027,7028,7029,7030,7034,7035,7036,7040,7041,7042,7046,7047,7048,7049,7050,7051,7052,7053\n\t\t,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076\n\t\t,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099\n\t\t,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122\n\t\t,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145\n\t\t,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168\n\t\t,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,7189,7190,7191\n\t\t,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214\n\t\t,7215,7216,7217,7218,7219,7220,7221,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7307,7310\n\t\t,7311,7312,7313,7314,7315,7316,7317,7318,7319,7322,7323,7324,7327,7336,7337,7338,7340,7341,7342,7343,7344,7345,7739\n\t\t,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,7753,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764\n\t\t,7765,7850,7854,7859,7984,7985,7986,7987,7988,7989,7990,7991,7992,7994,7995,7996,7998,7999,8000,8001,8002,8003,8004\n\t\t,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8040,8041,8042\n\t\t,8043,8044,8047,8048,8114,8116,8117,8118,8119\n\t\tWeights: 0.00652873,0.05096641,0.01172005,0.00157177,0.00418056,0.03892755,0.05166516,0.00454806,0.00183226,0.00140912,0.00101269,0.00024013,0.00000654,0.03921721,0.08003449,0.00676974,0.02316589,0.06611124,0.09935838,0.01573526,0.00276150,0.03967078,0.15685459,0.09129377,0.22755323,0.13576912,0.06016389,0.19983903,0.17049842,0.02291431,0.00447490,0.01542160,0.05050992,0.00871897,0.01026465,0.02318817,0.04658968,0.03287304\n\t\t,0.03681901,0.05829966,0.05917382,0.04136675,0.01903593,0.04237705,0.07906252,0.06060071,0.08673782,0.00922148,0.01734874,0.05543932,0.13262288,0.03002460,0.00690618,0.00125359,0.01953290,0.00873724,0.01278678,0.05021967,0.02170419,0.00684686,0.03986700,0.03843028,0.00596666,0.01583395,0.00772388,0.01809667,0.03594182,0.01517539,0.00565360,0.00977801,0.03351103,0.04436274,0.34664446,0.33438900,0.26782480,0.51594836\n\t\t,0.54881477,0.51580246,0.22204134,0.26408690,0.67928970,0.54235171,0.50229286,0.39882690,0.59961033,0.72586703,0.67724383,0.30788970,0.49098009,0.80053042,0.52116860,0.50827325,0.61326089,0.60885852,0.37032730,0.34766785,0.58715885,0.74719238,0.37572906,0.03338391,0.04827338,0.04692161,0.02329415,0.04264569,0.08639121,0.02550235,0.01310951,0.03248769,0.23000278,0.25317216,0.26360834,0.08044954,0.18590458,0.19477823\n\t\t,0.28067965,0.14504982,0.03841037,0.63067119,0.70336491,0.51447016,0.66850590,0.75679552,0.39930148,0.51931699,0.72812289,0.68004512,0.96640366,0.74379497,0.49720493,0.43063297,0.90431815,0.81972927,0.55078718,0.46123836,0.52217412,0.42972066,0.64712302,0.54522710,0.48341776,0.55405255,0.62474422,0.68688411,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,0.99968123,1.00000000,0.99792570,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99939847,1.00000000,0.73247121,0.33570826,0.40896088,1.00000000,0.84384173,0.54065943,0.31549996,1.00000000,1.00000000,0.57551029,0.61083142,0.65721579,0.48215304,0.31356304\n\t\t,0.40484217,0.65615763,1.00000000,0.28684098,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99992615,1.00000000,1.00000000,0.58596851,0.51646659,0.61330679,1.00000000,0.59028734,0.51545060,0.45432295,1.00000000,1.00000000,1.00000000,0.91647415,1.00000000,1.00000000,0.99824373,0.93061660,1.00000000,1.00000000,1.00000000,0.99771812,0.98283035,1.00000000,0.99986649,1.00000000,1.00000000,0.97990934\n\t\t,0.95876319,0.99874535,0.99528412,0.99388044,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.98455381,0.97825009,1.00000000,0.99791008,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.88592707,0.88877975,0.82154198\n\t\t,0.87860578,0.93511581,0.93732363,0.82422030,0.81250353,0.93042052,0.84652734,0.86134177,0.75211407,0.81046617,0.91615677,0.92049497,0.78470845,0.70688796,0.90637600,0.87217021,0.93307275,0.86449224,0.78445172,0.87436461,0.93352139,0.93039906,0.77036047,0.79216765,0.88087035,0.93490106,0.87768883,0.80505294,0.88403058,0.93608701,0.93392116,0.79997301,0.81234825,0.77361166,0.90893245,0.80421340,0.61441203,0.76979214\n\t\t,0.90462345,0.90847647,0.60381770,0.65789115,0.79594637,0.77769388,0.71108830,0.81087066,0.87593967,0.87443340,0.69194782,0.72106576,0.88824254,0.83684766,0.91170603,0.81906492,0.72606939,0.84413868,0.91881543,0.90614159,0.71332896,0.73771155,0.34240144,0.33183491,0.15831964,0.35759137,0.60286480,0.60171312,0.14618757,0.17620437,0.59697950,0.35855025,0.36236010,0.19348805,0.35457981,0.53332913,0.56328422,0.19481230\n\t\t,0.17740964,0.48801766,0.25733135,0.47353031,0.24511437,0.12227450,0.25229681,0.49509467,0.41625082,0.12311741,0.11916300,0.28402638,0.51751395,0.28366818,0.11259776,0.29542532,0.53371753,0.51021005,0.12598978,0.12067108,0.20330338,0.32263972,0.20664060,0.12035556,0.20556505,0.30885295,0.34240967,0.12280928,0.12008673,0.23791075,0.28626019,0.15603607,0.24670212,0.41221833,0.47633326,0.15725338,0.14371340,0.34143776\n\t\t,0.22536647,0.36944113,0.21884005,0.12448614,0.23394082,0.38526148,0.34803615,0.12215592,0.12416740,0.03046836,0.04041863,0.02044950,0.01818241,0.02616585,0.03115853,0.03541486,0.00564872,0.01956535,0.08466955,0.07245303,0.09905852,0.07096995,0.07190049,0.05113012,0.07123344,0.08363411,0.05671591,0.11831374,0.13634327,0.13702875,0.12265697,0.12483131,0.11133601,0.14213461,0.10698811,0.11510423,0.19960201,0.21130690\n\t\t,0.18053228,0.16120575,0.19353972,0.20599823,0.25395939,0.14143770,0.16724811,0.17705616,0.22296963,0.13905978,0.12074455,0.16571177,0.21197082,0.18628119,0.09564710,0.12928324,0.02670162,0.00707278,0.00768099,0.02781435,0.05689302,0.05204364,0.06512146,0.01614911,0.04204359,0.04549325,0.06103314,0.02879862,0.08380992,0.11997137,0.08288857,0.05130753,0.08070110,0.11888768,0.11451007,0.05093766,0.04983500,0.04569475\n\t\t,0.07526091,0.02064009,0.00789570,0.06202080,0.09172426,0.05520961,0.02668733,0.00138465,0.00190637,0.01281769,0.00066688,0.01326546,0.05728822,0.04089261,0.04544594,0.24029975,0.22919624,0.28523830,0.23878317,0.17621131,0.16179585,0.29848496,0.25853932,0.17723869,0.47112573,0.37790555,0.38036365,0.29293951,0.32169596,0.35017826,0.46636653,0.33088845,0.31383693,0.34444252,0.45752761,0.31123167,0.30348064,0.36599210\n\t\t,0.46893643,0.31746975,0.31252987,0.32661084,0.00307955,0.01480802,0.05147973,0.14195581,0.17852473,0.17173258,0.33465392,0.35682212,0.17689031,0.15488571,0.13513947,0.02822994,0.00055806,0.00087322,0.00087454,0.00035916,0.00376941,0.01405816,0.04654221,0.00614816,0.00506611,0.00048932,0.00135461,0.01620265,0.03282886,0.09637506,0.07506039,0.04854717,0.11741946,0.15248631,0.09902799,0.03104560,0.19373948,0.23300941\n\t\t,0.28737345,0.03377472,0.02284018,0.00799346,0.03826715,0.07947724,0.10756745,0.00260869,0.02975609,0.00906136,0.00632222,0.12220712,0.09612240,0.06777302,0.03320198,0.00068256,0.00013429,0.00067418,0.00066591,0.14439527,0.14162053,0.13332345,0.00203528,0.00965013,0.02118828,0.03842675,0.54764236,0.46488553,0.32375117,0.58835696,0.42159127,0.54435846,0.14988372,0.30826480,0.31332585,0.03297102,0.02028251,0.82159069\n\t\t,0.75830848,0.78289439,0.24701893,0.49885714,0.66374461,0.18198305,0.15989529,0.08732995,0.66873531,0.60505830,0.58765264,0.50271541,0.61239462,0.56821026,0.77274721,0.63079852,0.36263889,0.57992536,0.84582865,0.92817563,0.02378439,0.03809775,0.08333819,0.16613571,0.29457455,0.30439815,0.26682752,0.26684961,0.29991006,0.82459777,0.69891906,0.56921637,0.44701838,0.86455721,0.91614795,1.00000000,0.98775208,1.00000000\n\t\t,1.00000000,0.91493094,0.82776439,0.16090763,0.15141183,0.40813142,0.08651501,0.19263302,0.16359365,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99790508,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99871111,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.96176583,0.77545942,0.26243341,0.48379582,1.00000000,0.45755930,0.60294002,1.00000000,1.00000000,0.95501265,0.53519955,0.99990538,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.97880882,1.00000000,1.00000000,0.98972857,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.53605120,0.56879826\n\t\t,0.59353691,0.54111596,0.61194450,0.60602796,0.46319164,0.48071776,0.48124433,0.71029985,0.69747722,0.69124842,0.63785118,0.66111600,0.67835563,0.69016314,0.64823741,0.60743815,0.73774940,0.73554033,0.72661787,0.82076174,0.88742072,0.93726033,0.92505485,0.86991513,0.80137599,0.88625932,0.77983655,0.68439883,0.79656953,0.87538439,0.93349916,0.92533445,0.85359472,0.75323331,0.69316638,0.79023553,0.90215456,0.89966923\n\t\t,0.81598890,0.66050524,0.06067482,0.05728540,0.05454006,0.06158429,0.06868850,0.07857920,0.06696426,0.06694944,0.06487420,0.03679204,0.03948371,0.04287885,0.05035631,0.04265565,0.04703577,0.08081022,0.08416976,0.08626287,0.04542248,0.05467315,0.06663751,0.13810549,0.31650865,0.58664538,0.58545119,0.36638176,0.18927568,0.48321019,0.34726566,0.16165807,0.13139930,0.27321317,0.50534719,0.39818239,0.24072681,0.12331904\n\t\t,0.11983622,0.21214840,0.32112739,0.34583682,0.23381644,0.13028279,0.13696735,0.10903684,0.08216540,0.15919731,0.15331116,0.15441092,0.07441450,0.08658267,0.09477518,0.03513335,0.04664159,0.05414857,0.01087275,0.00107994,0.01313440,0.08683273,0.12136626,0.10376900,0.16669775,0.18124867,0.16570998,0.24176036,0.17238352,0.11787221,0.00347038,0.01674428,0.02018779,0.01838870,0.00046728,0.00052577,0.03696418,0.02364652\n\t\t,0.11300184,0.07396842,0.04082418,0.10514224,0.07704204,0.04215923,0.04486318,0.05350328,0.04529030,0.11417319,0.13621634,0.11849879,0.27033156,0.32369662,0.36157442,0.34084934,0.35509783,0.38096228,0.02413985,0.02684800,0.02898431,0.05685961,0.14129472,0.18243517,0.18839486,0.22434869,0.21790268,0.29715574,0.29441100,0.23923217,0.25433260,0.00084183,0.00022862,0.03975072,0.14291574,0.52434689,0.51751077,0.04404040\n\t\t,0.00037959,0.16997506,0.32654667,0.22918015,0.01844448,0.85006714,0.79045111,0.17415154,0.16741467,0.33295849,0.98386359,1.00000000,0.50720070,1.00000000,1.00000000,1.00000000,0.98428571,1.00000000,1.00000000,1.00000000,1.00000000,0.44615378,0.59345198,0.73011726,0.61537631,0.48026007,0.68773031,0.71442688,0.06345915,0.08355486,0.03785806,0.05179931,0.06279433,0.04920356,0.07615123,0.06115989,0.15721940,0.16641964\n\t\t,0.06442924,0.02317565,0.01213390,0.00556658,0.02831246,0.10168432,0.21949065,0.29788977,0.13142195\n\t\tTransform: 0.990913391113281,-0.134491294622421,0.001763284322806,0.000000000000000,-0.010376323014498,-0.063367821276188,0.997936308383942,0.000000000000000,-0.134102001786232,-0.988886535167694,-0.064187563955784,0.000000000000000,0.483524262905121,2.100624084472656,0.191660150885582,1.000000000000000\n\t\tTransformLink: 0.990913093090057,-0.134101986885071,0.010376354679465,0.000000000000000,-0.134491264820099,-0.988886654376984,0.063367843627930,0.000000000000000,0.001763254287653,-0.064187541604042,-0.997936308383942,0.000000000000000,-0.196952834725380,2.154422760009766,0.053135380148888,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-shin_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 5012,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,5029,5030,5031,5032,5033,5034\n\t\t,5035,5036,5037,5038,5039,5040,5041,5042,5043,5044,5045,5046,5047,5048,5049,5050,5051,5052,5053,5054,5055,5056,5057\n\t\t,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072,5073,5074,5075,5076,5077,5078,5079,5080\n\t\t,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103\n\t\t,5104,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126\n\t\t,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149\n\t\t,5150,5151,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172\n\t\t,5173,5174,5175,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,5193,5194,5195\n\t\t,5196,5197,5198,5199,5200,5201,5202,5203,5204,5205,5206,5207,5208,5209,5210,5211,5212,5213,5214,5215,5216,5217,5218\n\t\t,5219,5220,5221,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976\n\t\t,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999\n\t\t,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022\n\t\t,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045\n\t\t,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068\n\t\t,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,7138,7139,7140,7141,7142,7143,7144,7145,7146\n\t\t,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169\n\t\t,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,7189,7190,7191,7192\n\t\t,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214,7215\n\t\t,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238\n\t\t,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261\n\t\t,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284\n\t\t,7285,7286,7287,7288,7289,7290,7291,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781\n\t\t,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804\n\t\t,7805,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827\n\t\t,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,8011\n\t\t,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034\n\t\t,8035,8036,8037,8038,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8311,8312,8313,8314,8315\n\t\t,8361,8362,8363,8364,8365,8677,8678,8679,8680,8681,8685,8686,8687,8688,8862,8863,8864,8865,8866,8959,8960,8961,8962\n\t\tWeights: 0.11407293,0.11122025,0.17845802,0.12139422,0.06488419,0.06267637,0.17577970,0.18749647,0.06957948,0.15347266,0.13865823,0.24788593,0.18953383,0.08384323,0.07950503,0.21529155,0.29311204,0.09362400,0.12782979,0.06692725,0.13550776,0.21554828,0.12563539,0.06647861,0.06960094,0.22963953,0.20783235,0.11912965,0.06509894,0.12231117,0.19494706,0.11596942,0.06391299,0.06607884,0.20002699,0.18765175,0.22638834,0.09106755\n\t\t,0.19578660,0.38558797,0.23020786,0.09537655,0.09152353,0.39618230,0.34210885,0.20405363,0.22230612,0.28891170,0.18912934,0.12406033,0.12556660,0.30805218,0.27893424,0.11175746,0.16315234,0.08829397,0.18093508,0.27393061,0.15586132,0.08118457,0.09385841,0.28667104,0.26228845,0.65759856,0.66816509,0.84168036,0.64240863,0.39713520,0.39828688,0.85381243,0.82379563,0.40302050,0.64144975,0.63763990,0.80651195,0.64542019\n\t\t,0.46667087,0.43671578,0.80518770,0.82259036,0.51198234,0.74266865,0.52646969,0.75488563,0.87772550,0.74770319,0.50490533,0.58374918,0.87688259,0.88083700,0.71597362,0.48248605,0.71633182,0.88740224,0.70457468,0.46628247,0.48978995,0.87401022,0.87932892,0.79669662,0.67736028,0.79335940,0.87964444,0.79443495,0.69114705,0.65759033,0.87719072,0.87991327,0.76208925,0.71373981,0.84396393,0.75329788,0.58778167,0.52366674\n\t\t,0.84274662,0.85628660,0.65856224,0.77463353,0.63055887,0.78115995,0.87551386,0.76605918,0.61473852,0.65196385,0.87784408,0.87583260,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.98913452,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.75105846,1.00000000,1.00000000,0.64519504,0.77575828,1.00000000,0.82577609,1.00000000,1.00000000,0.81588815,0.82970392,1.00000000,0.99384776,0.55744025,0.98759491,1.00000000,0.55410215,0.63412196,0.98381474,0.72337732,0.98707728,0.98461737\n\t\t,0.70869313,0.72790644,0.98540562,0.84463279,1.00000000,1.00000000,0.85734155,0.82777401,0.87152268,1.00000000,1.00000000,0.86057804,0.87279697,1.00000000,1.00000000,0.78338770,1.00000000,1.00000000,0.79157801,0.73062029,0.52031750,0.54962575,0.51841767,0.46676803,0.53213574,0.56190520,0.54747330,0.46936228,0.45474516,0.49699179,0.47431605,0.49671514,0.52665410,0.49654801,0.45398389,0.47540954,0.52497782,0.53607773\n\t\t,0.48804418,0.44505949,0.48836617,0.52821747,0.48778627,0.43224660,0.44619495,0.52721641,0.53638792,0.58226238,0.57420349,0.57985597,0.58038701,0.59763142,0.58922984,0.57226055,0.57769919,0.59486823,0.58679103,0.61010812,0.58005658,0.55387060,0.61289400,0.63983961,0.60203003,0.54921143,0.57232719,0.61705377,0.59405818,0.60963485,0.62551743,0.64730072,0.62262040,0.58771837,0.61768865,0.65793027,0.41396576,0.46787693\n\t\t,0.41864729,0.39759460,0.39399357,0.46054736,0.46910600,0.40149751,0.37249260,0.51084215,0.52774539,0.50956784,0.48972040,0.51173579,0.53537734,0.52042261,0.49709613,0.48234076,0.48996484,0.48155606,0.49323326,0.50175016,0.49026451,0.47702109,0.48839812,0.50119339,0.50747838,0.50314972,0.48838204,0.50576071,0.51689376,0.49817440,0.47507322,0.49716023,0.51447717,0.52048021,0.53684900,0.53348170,0.52584506,0.53826262\n\t\t,0.55227701,0.54712918,0.52386760,0.52758044,0.55279249,0.53525536,0.54516234,0.52469891,0.52357995,0.55041456,0.56229218,0.53106604,0.51615888,0.53304857,0.54527849,0.53053618,0.53054180,0.55222593,0.56618745,0.54652357,0.52173152,0.53515804,0.57417561,0.48332815,0.49550219,0.49377877,0.47681283,0.46578410,0.48736140,0.50008934,0.49047285,0.45462526,0.46394880,0.43120174,0.40646309,0.45888404,0.38805550,0.39397204\n\t\t,0.53680836,0.51928224,0.51875567,0.28970015,0.30252278,0.30875158,0.36214882,0.33888400,0.32164437,0.30983686,0.35176259,0.39256185,0.26225060,0.26445967,0.27338213,0.17923826,0.11257928,0.06273967,0.07494515,0.13008487,0.19862401,0.11374068,0.22016345,0.31560117,0.20343047,0.12461561,0.06650084,0.07466555,0.14640528,0.24676669,0.30683362,0.20976447,0.09784544,0.10033077,0.18401110,0.33949476,0.93932518,0.94271460\n\t\t,0.94545994,0.93841571,0.93131150,0.92142080,0.93303574,0.93305056,0.93512580,0.96320796,0.96051629,0.95712115,0.94964369,0.95734435,0.95296423,0.91918978,0.91583024,0.91373713,0.95457752,0.94532685,0.93336249,0.86189451,0.68349135,0.41335462,0.41454881,0.63361824,0.81072432,0.51678981,0.65273434,0.83834193,0.86860070,0.72678683,0.49465281,0.60181761,0.75927319,0.87668096,0.88016378,0.78785160,0.67887261,0.65416318\n\t\t,0.76618356,0.86971721,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.99563964,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.45094266\n\t\t,0.41113563,0.38876867,0.73345914,0.72325555,0.69416357,0.71088804,0.67709392,0.61842536,0.63402313,0.64244540,0.62840968,0.40272728,0.49428856,0.55848206,0.48042088,0.50268002,0.55330441,0.59417683,0.57825225,0.49546295,0.70241232,0.99085347,1.00000000,0.79445099,1.00000000,0.84387606,0.67960242,0.98489854,1.00000000,0.67603227,0.80566537,1.00000000,1.00000000,0.86671249,0.47754873,0.44162473,0.42461414,0.59897247\n\t\t,0.59039095,0.56792315,0.58474610,0.56700802,0.54215609,0.56769804,0.56843811,0.56199273,0.45852241,0.49279090,0.52439407,0.47579159,0.49379226,0.51702069,0.54255899,0.51507549,0.47544430,0.56280518,0.56488131,0.58069752,0.44401756,0.46450610,0.46624231,0.58362231,0.56183081,0.55762987,0.41457613,0.41171625,0.37831092,0.57010223,0.55672719,0.55516062,0.61433942,0.62309361,0.65517046,0.51672537,0.51303289,0.51102851\n\t\t,0.50220129,0.49858398,0.49678470,0.52547915,0.52260932,0.51703245,0.52268306,0.51857845,0.51325108,0.52198579,0.52115334,0.51913387,0.50141391,0.50760014,0.51348953,0.49483115,0.49784410,0.50307171,0.51726471,0.50976245,0.50152612,0.52639180,0.53635864,0.54677094,0.47251317,0.48014303,0.48875441,0.52616295,0.51527352,0.51142282,0.49144367,0.47837778,0.45813271,0.53718081,0.52711305,0.52056649,0.53491174,0.55119317\n\t\t,0.57152598,0.51096825,0.50986394,0.50739639,0.55384622,0.40654802,0.26988274,0.38462369,0.51973993,0.31226969,0.28557312,0.93654085,0.91644514,0.96214194,0.94820069,0.93720567,0.95079644,0.92384877,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.72833131,0.64156389,0.61604065,0.38009675,0.51222316,0.60079397,0.47788982,0.59492465,0.54245966,0.55666201,0.43199484,0.51118247,0.54813764\n\t\t,0.46763689,0.52518554,0.51001006,0.52084124,0.49751419,0.50687368,0.51732963,0.49596790,0.03306825,0.07482552,0.06630531,0.04587242,0.00893328,0.00816997,0.04566719,0.06531169,0.07252952,0.02964384,0.00771810,0.04644362,0.06568610,0.07248096,0.02828691,0.06760429,0.07140412,0.05891648,0.02529789,0.02518134,0.05863170,0.06951597,0.06452785,0.00060712,0.02526267,0.05914693,0.06967677,0.06423210\n\t\tTransform: 0.995995342731476,-0.089369267225266,-0.002607485512272,0.000000000000000,0.008414970710874,0.064667634665966,0.997871339321136,0.000000000000000,-0.089010417461395,-0.993896961212158,0.065160654485226,0.000000000000000,0.440093576908112,1.024355530738831,0.053833886981010,1.000000000000000\n\t\tTransformLink: 0.995994985103607,-0.089010402560234,-0.008414930664003,0.000000000000000,-0.089369259774685,-0.993897020816803,-0.064667604863644,0.000000000000000,-0.002607521135360,0.065160691738129,-0.997871398925781,0.000000000000000,-0.346644759178162,1.053768873214722,0.123665265738964,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-foot_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 5180,5183,5184,5186,5189,5190,5192,5193,5194,5196,5197,5198,5199,5200,5201,5202,5203,5205,5208,5209,5210,5213,5214\n\t\t,5217,5220,5221,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976\n\t\t,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999\n\t\t,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022\n\t\t,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045\n\t\t,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068\n\t\t,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,7257,7258,7259,7260,7261,7262,7263,7264,7265\n\t\t,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7281,7283,7284,7285,7287,7288,7291,7766,7767\n\t\t,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790\n\t\t,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,7808,7809,7810,7811,7812,7813\n\t\t,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836\n\t\t,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,8032,8033,8034,8035,8036,8037,8038,8120,8121,8122\n\t\t,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8141,8142,8143,8146,8147,8148\n\t\t,8149,8150,8151,8154,8155,8156,8157,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176\n\t\t,8177,8178,8179,8180,8181,8182,8183,8186,8187,8188,8191,8192,8193,8195,8196,8197,8198,8199,8200,8202,8203,8204,8205\n\t\t,8207,8208,8209,8210,8211,8212,8215,8216,8217,8218,8222,8224,8225,8226,8227,8228,8230,8231,8232,8233,8234,8235,8236\n\t\t,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8249,8251,8252,8255,8256,8258,8259,8260,8261,8262,8263,8264,8265\n\t\t,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288\n\t\t,8289,8290,8291,8292,8293,8294,8296,8297,8298,8299,8300,8301,8302,8303,8304,8306,8307,8308,8309,8310,8311,8312,8313\n\t\t,8314,8315,8316,8317,8319,8321,8322,8323,8326,8327,8328,8329,8330,8332,8333,8334,8335,8336,8337,8340,8341,8342,8343\n\t\t,8344,8345,8347,8348,8349,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8372,8373,8374\n\t\t,8375,8376,8377,8379,8381,8382,8383,8385,8386,8388,8389,8390,8393,8394,8395,8396,8398,8399,8401,8403,8404,8405,8407\n\t\t,8408,8409,8410,8411,8412,8413,8415,8416,8417,8421,8422,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435\n\t\t,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458\n\t\t,8459,8460,8461,8463,8465,8467,8468,8474,8475,8477,8478,8479,8480,8481,8482,8483,8484,8486,8487,8489,8491,8492,8493\n\t\t,8494,8495,8496,8498,8499,8500,8503,8504,8505,8506,8507,8508,8509,8511,8512,8513,8514,8515,8517,8518,8519,8520,8521\n\t\t,8522,8523,8525,8526,8527,8531,8532,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549\n\t\t,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572\n\t\t,8573,8574,8577,8579,8580,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602\n\t\t,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625\n\t\t,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648\n\t\t,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8670,8671,8672\n\t\t,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8692,8693,8695,8696,8697\n\t\t,8698,8699,8700,8701,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8720,8723,8724\n\t\t,8725,8726,8727,8728,8729,8731,8733,8734,8735,8736,8737,8739,8742,8743,8744,8745,8746,8747,8748,8750,8753,8754,8755\n\t\t,8757,8758,8759,8760,8761,8763,8766,8767,8768,8769,8770,8771,8772,8774,8776,8780,8781,8783,8784,8785,8786,8787,8788\n\t\t,8790,8791,8792,8793,8794,8795,8796,8797,8798,8799,8800,8801,8802,8803,8804,8805,8806,8808,8809,8810,8812,8813,8814\n\t\t,8815,8817,8819,8820,8822,8823,8824,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,8836,8837,8838,8839,8840\n\t\t,8842,8844,8845,8846,8847,8851,8852,8853,8854,8855,8856,8857,8858,8859,8860,8862,8863,8864,8865,8866,8874,8875,8876\n\t\t,8877,8878,8879,8881,8882,8883,8884,8885,8886,8887,8888,8890,8892,8893,8895,8896,8897,8898,8899,8900,8901,8902,8903\n\t\t,8904,8905,8906,8907,8908,8909,8910,8911,8912,8913,8915,8917,8918,8919,8920,8921,8922,8923,8924,8925,8926,8927,8928\n\t\t,8929,8930,8931,8932,8933,8934,8935,8936,8937,8938,8939,8940,8941,8942,8943,8944,8945,8946,8947,8948,8949,8950,8952\n\t\t,8953,8954,8955,8956,8957,8958,8959,8960,8961,8962,8963,8964,8965,8966,8967,8969,8970,8971,8973,8974,8975,8977,8979\n\t\t,8980,8981,8982,8983,8984,8985,8986,8987,8988,8990,8991,8992,8993,8994,8995,8996,8997,8998,9000,9003,9004,9005,9006\n\t\t,9007,9008,9009,9011,9012,9013,9014,9016,9018,9019,9020,9021,9022,9023,9024,9025,9027,9028,9029,9030,9031,9032,9033\n\t\tWeights: 0.20739850,0.31849493,0.16701342,0.07105546,0.08878449,0.05964139,0.00615224,0.39623370,0.01240509,0.39468054,0.31506107,0.01618526,0.22902789,0.01292272,0.01538263,0.24053987,0.22707749,0.05789978,0.05442169,0.06293687,0.04792165,0.05066856,0.04895640,0.11272737,0.09111841,0.18454505,0.31280268,0.30333605,0.31134422,0.33943093,0.31549288,0.30447188,0.30307128,0.33165001,0.37637292,0.19581296,0.21981845,0.19639415\n\t\t,0.16737598,0.17977927,0.21690319,0.22131348,0.16970767,0.15224965,0.39605276,0.42367290,0.39453201,0.36415319,0.40618739,0.44861639,0.42154557,0.36364378,0.36593863,0.30584394,0.31796273,0.30647587,0.30071909,0.30128891,0.31378047,0.31847089,0.30125916,0.29710635,0.16712977,0.15580336,0.17188094,0.18353548,0.15094246,0.14085506,0.16013107,0.18843620,0.16533810,0.14065511,0.14361038,0.14431942,0.14197020,0.12638393\n\t\t,0.12937815,0.14679246,0.14590645,0.12810730,0.29935163,0.24490106,0.30264626,0.40302017,0.28403462,0.22499332,0.24893210,0.39977854,0.42816429,0.28770253,0.29438047,0.27966671,0.27512215,0.29599422,0.29842357,0.28923379,0.26562681,0.29086074,0.21138663,0.22922210,0.21714558,0.19894056,0.20518798,0.22893144,0.23007651,0.20811319,0.18827223,0.34259244,0.34629007,0.32837276,0.33448634,0.36255861,0.37388497,0.32730948\n\t\t,0.32441591,0.34654703,0.30906387,0.31674235,0.30671963,0.30274374,0.31007274,0.31949178,0.31274920,0.30155250,0.30342975,0.20849028,0.19835702,0.22075361,0.22303246,0.19541727,0.18391607,0.21157143,0.23253940,0.21153621,0.18337138,0.18468989,0.19696324,0.18559375,0.16844097,0.17006798,0.19803547,0.19932055,0.17055707,0.29390865,0.26675499,0.28688768,0.32079401,0.30191992,0.26393660,0.26698750,0.30512920,0.34513203\n\t\t,0.16584129,0.24801212,0.41902783,0.10066436,0.09901713,0.10058323,0.11042330,0.11688194,0.12387425,0.28329912,0.28324777,0.29736408,0.50985048,0.42182518,0.36150327,0.19787799,0.13821897,0.11149619,0.30581182,0.30999130,0.38543637,0.25224701,0.00914653,0.12647019,0.05456083,0.26915174,0.01510146,0.26089929,0.07172191,0.05176159,0.25715252,0.30625494,0.37414755,0.15584297,0.15421506,0.15637807,0.16994720,0.18196818\n\t\t,0.19870503,0.30275680,0.30874213,0.31971539,0.40276662,0.38287856,0.35732084,0.22604735,0.19919197,0.17765178,0.30145629,0.30601498,0.31207358,0.30458054,0.30553013,0.30158254,0.33044881,0.29360034,0.28789416,0.13753816,0.15225553,0.15502757,0.43042378,0.43391960,0.48128303,0.33479334,0.33699543,0.33723177,0.15139921,0.14742816,0.13338958,0.18736835,0.20813717,0.21284308,0.26654656,0.28276445,0.29738014,0.20828315\n\t\t,0.20543496,0.20576342,0.22040140,0.22872098,0.23859490,0.29973463,0.30504060,0.30961326,0.31794331,0.32072720,0.31859486,0.23182239,0.22119957,0.21390492,0.28513830,0.27523970,0.26174966,0.29613733,0.29896986,0.30054605,0.26203497,0.25203068,0.24671724,0.17720470,0.19043346,0.20220031,0.31935069,0.33956611,0.37104109,0.33143095,0.32519884,0.31857322,0.20451970,0.19094839,0.17614384,0.23403277,0.24266637,0.24802270\n\t\t,0.10481795,0.10500026,0.29316762,0.50173084,0.13024438,0.32228083,0.33811386,0.16109738,0.16435975,0.30256604,0.40587358,0.22270962,0.33548976,0.27654201,0.21372410,0.20887708,0.29327545,0.30943398,0.25079415,0.31440538,0.24604365,0.38684734,0.04138280,0.12410623,0.00966638,0.86098859,0.08771867,0.00161875,0.61520272,0.19846824,0.30738412,0.09578275,0.37312037,0.74468485,0.49015629,0.07550995,0.90401276,0.57296732\n\t\t,0.87655412,0.33244183,0.02643404,0.10098328,0.08290855,0.11866524,0.07026342,0.38378034,0.36997731,0.44600010,0.81621823,0.88651433,0.93657551,0.97859100,0.77281503,0.84680565,0.98988009,1.00000000,0.93528400,0.72658936,0.60839832,0.92227677,1.00000000,0.93816897,0.39301900,0.06813997,0.11917452,0.02315810,0.03550424,0.05901076,0.00287306,0.41132059,0.05279829,0.15056834,0.06697866,0.84818333,0.13679255,0.01431727\n\t\t,0.62983521,0.23790212,0.02116564,0.33457823,0.12399631,0.39226717,0.74082733,0.49205738,0.08387787,0.88751262,0.57010366,0.84297213,0.37078605,0.02020401,0.09562155,0.08615422,0.11501979,0.07599486,0.16219265,0.45530571,0.78328149,0.84795754,0.89549150,0.92533096,0.76721904,0.84291461,0.96978153,1.00000000,0.91019350,0.58372331,0.88538367,0.96565417,0.91428722,0.42635137,0.70528827,0.51818354,0.07959743,0.12214487\n\t\t,0.01238316,0.02045699,0.05240261,0.34346453,0.17934685,0.68478131,0.00829720,0.92611305,1.00000000,1.00000000,0.76254236,0.39831368,0.21125555,0.94346000,1.00000000,1.00000000,0.79080523,0.42408310,0.22131487,1.00000000,0.94776180,1.00000000,0.80498846,0.37065262,0.35528330,0.52926205,1.00000000,0.94382785,0.81188706,0.52252658,1.00000000,1.00000000,1.00000000,1.00000000,0.08094143,0.92924211,0.45055599,1.00000000\n\t\t,1.00000000,0.94785597,0.03037589,0.81336474,0.18377574,0.97081275,0.04902260,0.17172380,0.97986280,1.00000000,0.00210261,0.07825122,0.00914490,0.46055013,0.79663649,0.01054538,0.04781483,0.08167915,0.07330011,0.05549393,0.02599884,0.00402646,0.00184662,0.29163486,0.36178619,0.72757566,0.89209552,0.86065118,0.38426965,0.19756124,0.24169981,0.23337787,0.07603028,0.06751118,0.70053969,0.69468816,0.08277005,0.02249592\n\t\t,0.36826730,0.34813197,0.23653881,0.44076053,0.53674666,0.29765266,0.48373669,0.00656946,0.75552657,0.01028670,0.09017825,0.06283367,0.18548809,0.96439831,0.35916113,0.15137962,0.07183378,0.04299908,0.00635756,0.02568466,0.05544705,0.07233298,0.07943837,0.04499846,0.05192811,0.90131077,0.11374499,0.41609889,0.87617569,0.19276454,0.11371124,0.87329803,0.36729635,0.32456313,0.68499778,0.05971547,0.46865472,0.68957503\n\t\t,0.02139455,0.08743180,0.89377009,0.01677143,0.08547204,0.71042826,0.05159848,0.14629477,0.25445070,0.47104127,0.35658639,0.03724075,0.21614411,0.57290620,0.83723239,0.80091966,0.17440050,0.02542199,0.18915356,0.78453006,0.42217894,0.39785643,0.03473848,0.00865625,0.05635890,0.01824415,0.13401525,0.27515922,0.18479900,0.07482747,0.09821949,0.15349767,0.15070540,0.52647744,0.86410982,0.53847474,0.90279432,0.99512047\n\t\t,0.77351809,0.39308234,0.73425052,0.90853936,0.93202148,0.84886125,0.96035263,0.95092354,0.67888319,0.80569402,0.86861529,0.83797053,0.98718552,0.96686119,0.98990983,1.00000000,0.96583941,1.00000000,0.92867786,0.66268659,0.13646400,0.26247632,0.19400916,0.85769869,0.08582763,0.06888275,0.05469418,0.01797337,0.04761805,0.05725411,0.17647908,0.94178146,0.34087437,0.36039704,0.16141782,0.06772558,0.02549131,0.85283632\n\t\t,0.23086177,0.13490560,0.85396423,0.39160331,0.35281719,0.02211510,0.66763316,0.06774098,0.47870798,0.69415732,0.07726626,0.13112353,0.86428949,0.02963977,0.10607500,0.00359176,0.70833941,0.09523706,0.19359561,0.04056013,0.28473246,0.49076728,0.38217437,0.05684719,0.24573356,0.58293955,0.82877214,0.77054007,0.19282522,0.03662298,0.22183545,0.75231512,0.45622261,0.41304131,0.03198459,0.00357912,0.05219340,0.01756257\n\t\t,0.12127333,0.26210195,0.19478136,0.07942939,0.09814300,0.14004546,0.16948029,0.46430987,0.83785020,0.52504055,0.87785455,0.94058658,0.74198514,0.84626051,0.41314731,0.72983851,0.86956186,0.89926470,0.80515337,0.81436446,0.84516302,0.92420150,0.90960244,0.66868359,0.79967624,0.83269875,0.79587045,0.95638755,0.93110399,0.95714376,0.99799298,0.94093584,0.98531339,0.89643757,0.63287519,0.15146930,0.74864415,0.19963767\n\t\t,0.09099398,0.06675378,0.04796978,0.00599156,0.03290755,0.25022908,0.27570437,0.00699707,0.27288644,0.42862445,0.79868735,1.00000000,1.00000000,0.94313828,0.26044468,0.40321539,0.77955048,1.00000000,1.00000000,0.93062212,0.97646617,0.85916079,1.00000000,0.98209101,0.60618369,0.26453885,0.20465171,0.88362274,0.99560809,1.00000000,0.99084544,0.63598017,0.27951739,1.00000000,1.00000000,0.99701286,0.88812060,0.68422176\n\t\t,0.42163237,0.43517296,1.00000000,1.00000000,1.00000000,0.89487146,0.69047765,1.00000000,0.94917556,1.00000000,0.81570272,0.47226383,1.00000000,1.00000000,1.00000000,1.00000000,0.94122427,0.43567401,0.20297515,0.09336508,0.05431301,0.01195621,0.77651803,0.92345575,0.45943540,0.20906421,0.09024504,0.03771513,0.00164413,0.76831429,0.00194282,0.96754369,0.97239489,1.00000000,1.00000000,1.00000000,1.00000000,0.98072543\n\t\t,1.00000000,0.10821157,0.06331769,0.88989852,0.67136872,0.27209318,1.00000000,1.00000000,0.98706314,0.91676086,0.00125206,0.01022680,0.05358543,0.11729981,0.29003428,0.02461386,0.00351366,0.66757846,0.02472501,0.05578659,0.07270959,0.07936427,0.04315707,0.01138560,0.00985944,0.01242499,0.07455446,0.07831851,0.06601767,0.04126150,0.00602161,0.01306925,0.00418973,0.53998576,0.06935201,0.53148357,0.40384914,0.25676156\n\t\t,0.41950957,0.45275757,0.78835008,0.10590967,0.69123999,0.88410574,0.89379480,0.58283403,0.29273994,0.01432518,0.92307459,0.32044124,0.15088505,0.67174566,0.84941289,0.88008273,0.35333383,0.57331363,0.01934754,0.05919180,0.07597154,0.37466037,0.75695233,0.88226665,0.74566712,0.41341940,0.23769002,0.07984593,0.20784287,0.89789045,0.38486211,0.75150857,0.07144050,0.03369096,0.36261288,0.70253905,0.24066806,0.86580600\n\t\t,0.40582809,0.72425826,0.07876168,0.08491186,0.37887537,0.70720987,0.72935748,0.07292609,0.40622414,0.78308700,0.91424431,0.36943110,0.05635031,0.07936043,0.38548859,0.75068080,0.87638811,0.73105796,0.41697618,0.24547193,0.08581270,0.60286524,0.59536729,0.02856862,0.51768058,0.50101614,0.16139357,0.01200525,0.01007531,0.13470536,0.35151031,0.22425152,0.22263037,0.49158286,0.42522219,0.02433571,0.24442318,0.93689320\n\t\t,0.73734593,0.23001380,0.09173655,0.05728908,0.02114746,0.00077891,0.21199607,0.20069080,0.46412273,0.06192752,0.85227484,0.02230937,0.85475316,0.12822543,0.00200855,0.75760256,0.29221498,0.51677177,0.09527839,0.57516402,0.08363681,0.05013114,0.16214969,0.33463214,0.21448457,0.15676323,0.97400139,0.82013664,0.73347521,0.85615030,0.95177298,0.91100355,0.92882486,0.62743610,0.85512103,0.97827483,1.00000000,0.03577352\n\t\t,0.01946264,0.01685316,0.13415222,0.05094582,0.83215637,0.04316546,0.16476943,0.02263711,0.22293308,0.91208135,0.72561481,0.24173535,0.09345008,0.04559844,0.00766929,0.04132275,0.06576500,0.07646890,0.07159516,0.01726302,0.80437161,0.24068357,0.62466664,0.24034202,0.24219085,0.48314063,0.07572452,0.83910834,0.05938546,0.01400899,0.81543654,0.16108895,0.00406447,0.72662205,0.32091934,0.53498671,0.14467196,0.57065821\n\t\t,0.07607218,0.04504527,0.17795684,0.30530814,0.21788789,0.16228684,0.94211925,0.77691548,0.70855270,0.84271594,0.91986789,0.87763559,0.90797811,0.60948905,0.81365640,0.94227434,0.97739902,0.03191871,0.00878682,0.31765578,0.63788786,1.00000000,0.99648991,0.99600552,0.88687591,0.26850291,0.29894459,0.61816089,1.00000000,0.98938677,0.98281409,0.86913775,1.00000000,1.00000000,1.00000000,0.89772972,0.68900168,1.00000000\n\t\t,1.00000000,0.91125025,0.65780791,0.28468264,0.11749183,0.06682803,0.02503148,0.00711975,0.95451802,0.88389771,0.65688880,0.30027459,0.12729050,0.05690606,0.01286907,0.94864736,0.98197198,0.97993177,1.00000000,1.00000000,1.00000000,0.01572232,0.04119633,0.06629827,0.07662565,0.07121241,0.01551830,0.00455853,0.44100123,0.38538713,0.33432286,0.85234548,0.43109871,0.33308856,0.11255001,0.35906134,0.50984833,0.15031502\n\t\t,0.14864272,0.01566102,0.14662107,0.66260195,0.86707186,0.87604014,0.55752901,0.12639309,0.00607116,0.01328539,0.01577766,0.16721462,0.64642151,0.82981048,0.86210399,0.62374129,0.55187304,0.02151421,0.30612073,0.85849461,0.03061646,0.80775374,0.17045048,0.01459376,0.33144892,0.52388639,0.15443215,0.61137873,0.84285848,0.32595837,0.33985629,0.15666342,0.01522881,0.15449876,0.66045950,0.86472677,0.86702236,0.53765553\n\t\t,0.12565791,0.00411744,0.01606871,0.17414336,0.64042534,0.82632882,0.85208477,0.54470089,0.02897157\n\t\tTransform: 0.999019145965576,-0.043803390115499,0.006517543923110,0.000000000000000,-0.039649270474911,-0.819135010242462,0.572228610515594,0.000000000000000,-0.019726831465960,-0.571925640106201,-0.820068240165710,0.000000000000000,0.422863155603409,0.049965478479862,0.222018301486969,1.000000000000000\n\t\tTransformLink: 0.999018669128418,-0.019726801663637,0.039649311453104,0.000000000000000,-0.043803356587887,-0.571925640106201,0.819135129451752,0.000000000000000,0.006517496425658,-0.820068180561066,-0.572228670120239,0.000000000000000,-0.421706557273865,0.218988418579102,0.069350525736809,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-toe_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 8135,8136,8138,8149,8150,8151,8152,8153,8154,8155,8156,8157,8160,8161,8162,8163,8164,8165,8166,8168,8169,8170,8171\n\t\t,8172,8177,8178,8179,8180,8196,8197,8199,8210,8211,8212,8213,8214,8215,8216,8217,8218,8221,8222,8224,8225,8226,8227\n\t\t,8228,8230,8231,8232,8233,8234,8239,8240,8241,8242,8245,8258,8259,8260,8262,8265,8266,8267,8268,8271,8272,8273,8275\n\t\t,8277,8278,8279,8280,8282,8283,8284,8318,8321,8322,8323,8325,8326,8327,8332,8333,8334,8338,8339,8340,8341,8346,8347\n\t\t,8349,8350,8351,8352,8353,8354,8370,8371,8372,8373,8376,8379,8380,8381,8385,8386,8387,8388,8394,8395,8396,8398,8410\n\t\t,8411,8412,8413,8414,8415,8416,8417,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8436,8438\n\t\t,8439,8440,8442,8443,8444,8446,8449,8450,8451,8452,8457,8458,8463,8477,8478,8486,8489,8490,8491,8495,8496,8497,8498\n\t\t,8499,8504,8505,8506,8508,8520,8521,8522,8523,8524,8525,8526,8527,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540\n\t\t,8541,8542,8543,8544,8546,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8562,8563,8564,8565,8569,8570\n\t\t,8571,8587,8588,8590,8591,8592,8595,8596,8597,8598,8601,8602,8603,8606,8607,8608,8609,8610,8613,8614,8617,8618,8619\n\t\t,8620,8621,8625,8626,8628,8630,8631,8695,8701,8704,8705,8706,8710,8713,8714,8715,8716,8719,8722,8723,8724,8725,8726\n\t\t,8734,8736,8737,8738,8742,8745,8747,8748,8749,8753,8754,8757,8759,8760,8761,8762,8765,8766,8767,8768,8769,8776,8780\n\t\t,8785,8786,8787,8788,8789,8795,8796,8804,8807,8808,8809,8812,8813,8814,8815,8822,8823,8824,8825,8826,8827,8830,8831\n\t\t,8832,8833,8834,8837,8838,8845,8847,8849,8850,8851,8852,8853,8854,8871,8872,8873,8874,8877,8880,8881,8882,8885,8886\n\t\t,8887,8888,8895,8896,8897,8898,8899,8900,8903,8904,8905,8906,8907,8908,8910,8911,8917,8918,8921,8922,8923,8924,8925\n\t\t,8928,8929,8933,8934,8969,8976,8979,8980,8981,8982,8983,8984,8988,8990,8991,8992,8993,8994,8995,9000,9002,9004,9005\n\t\t,9006,9011,9012,9015,9018,9019,9020,9021,9022,9027,9028,9029,9030,9031\n\t\tWeights: 0.95861720,0.87589377,0.02238460,0.00789259,0.50984371,0.92449005,1.00000000,1.00000000,0.09232713,0.42703268,0.12344588,0.66755817,1.00000000,0.97356596,0.89901672,0.91709145,0.88133476,0.92973658,0.61621966,0.55399990,0.18378177,0.11348567,0.06342449,0.02140900,0.06471600,0.27341064,0.39160168,0.07772323,0.94720171,0.84943166,0.04680799,0.01612515,0.50794262,0.91612213,1.00000000,1.00000000,0.11110832,0.42989634\n\t\t,0.15702787,0.62921395,1.00000000,0.97979599,0.90437845,0.91384578,0.88498021,0.92400514,0.83780735,0.54469429,0.21671851,0.15204246,0.08838015,0.05885909,0.08980650,0.41627669,0.11461633,0.02788273,0.29471173,0.65653547,0.82065315,0.31521869,0.07388695,0.23745764,0.60168632,0.78874445,0.05654000,0.20919477,0.57591690,0.77868513,0.05223820,0.19501154,0.62934738,0.64471670,0.47073795,0.05617215,0.18811294,0.47747342\n\t\t,1.00000000,0.63821381,0.27242434,0.09457418,1.00000000,0.12269431,0.61573035,0.92396972,0.93248882,0.00498451,1.00000000,1.00000000,0.63173270,0.65186803,1.00000000,0.51626331,0.01592250,1.00000000,0.98971330,0.90982175,0.93716633,0.81451191,1.00000000,1.00000000,0.94807189,0.09639823,0.09035344,0.88628876,1.00000000,0.08179951,0.31500222,0.94028453,1.00000000,0.53134528,0.10622991,0.98322857,0.91452796,0.00044022\n\t\t,0.04450694,0.19908034,0.82559950,0.97457801,1.00000000,0.81084644,0.21546994,0.57782106,0.60214357,0.96526152,1.00000000,0.99134375,0.94364110,0.98175585,0.86598475,0.72484078,0.81520100,0.92517253,0.90178051,0.84650233,0.84929460,0.47352256,0.46152526,0.00487953,0.22648191,0.60691766,0.09146064,0.06797852,0.15113875,0.04907646,0.13138471,0.16202947,0.01281448,0.03313881,0.07132214,0.33731341,0.02641719,0.94274589\n\t\t,0.82352092,0.11652734,0.86509440,1.00000000,0.10676956,0.33236684,0.93225902,1.00000000,0.52129202,0.00913380,0.13455473,0.97036023,0.89392500,0.01554280,0.05470666,0.22945993,0.80717478,0.96337702,1.00000000,0.77816455,0.24768488,0.54377739,0.58695869,0.96801541,1.00000000,0.99642088,0.94780660,0.98243743,0.87872667,0.73789805,0.80521864,0.92057061,0.90185700,0.85995454,0.83051971,0.53569013,0.47495945,0.04604258\n\t\t,0.25801486,0.15373949,0.58685269,0.01678790,0.13043814,0.10073530,0.19484663,0.18563554,0.05213586,0.01095036,0.07417682,0.16730125,0.20412955,0.04361245,0.06889601,0.01468661,0.10356243,0.36712481,0.74977092,0.72429563,0.72711356,0.57137555,0.20131265,0.05686172,0.73955532,0.59678461,0.22044952,0.06937788,0.02353383,0.14083921,0.39381631,0.73546115,0.79534829,0.11637726,0.00439191,0.36401983,0.72048261,0.00298714\n\t\t,0.11187940,0.31577824,0.57836763,0.56482704,0.10512854,0.30952235,0.05082444,0.18429728,0.52773617,0.93064799,0.21164992,0.30876001,0.11589426,0.00960218,0.07482570,0.32825434,0.15058711,0.03678517,0.64666617,1.00000000,1.00000000,0.92402846,0.62533963,0.24304767,0.10128616,0.08940802,0.24849143,0.92855950,1.00000000,0.63738712,0.11545301,0.27574174,0.92123832,1.00000000,0.62112463,0.00317865,0.92707391,0.21691300\n\t\t,0.07810758,0.63056890,1.00000000,1.00000000,0.92063957,0.61451141,0.24931920,0.10367116,0.39713476,0.40463271,0.83860643,0.98799475,0.98992469,0.86529464,1.00000000,0.97566429,0.75557682,0.78800393,1.00000000,0.93807248,0.03663043,0.14524684,0.87177457,0.99799145,0.24239744,0.42483598,0.91636319,0.94986886,0.83785031,0.66536786,0.78551543,0.17986336,0.26652479,0.02518659,0.04822702,0.08899645,0.14487897,0.02172517\n\t\t,0.86584778,0.05005465,1.00000000,1.00000000,0.95683454,0.83523057,0.97736289,0.77706692,1.00000000,1.00000000,1.00000000,0.19562839,0.75965798,1.00000000,0.92427548,0.05446665,0.18456346,0.83891105,0.99593553,0.27337795,0.42934179,0.92392782,0.95495473,0.82204316,0.69469186,0.78211211,0.22308452,0.29144730,0.05103528,0.08013211,0.12236441,0.02346569,0.18634360,0.05772566,0.68234422,0.36211214,0.00399448,0.11312409\n\t\t,0.73149709,0.70105541,0.38183911,0.01718591,0.13086225,0.10227028,0.31099832,0.14765452,1.00000000,0.85135728,0.98433898,0.85337893,0.33739805,0.13292814,0.01698764,0.98671461,0.98422234,0.83278538,0.35357849,0.17018952,0.04422364,0.37625871,0.02444325,1.00000000,0.19224626,0.82954952,0.98540624,0.38862127,0.05031668,1.00000000,0.98477119,0.84550124,0.33954050,0.13527323,0.01957922,0.98393129,0.82585664,0.35957466\n\t\t,0.17367118,0.04495134\n\t\tTransform: 1.000000238418579,-0.000000082392496,0.000000262457320,0.000000000000000,-0.000000004599308,-0.988325715065002,-0.152355253696442,0.000000000000000,0.000000245242035,0.152355313301086,-0.988325893878937,0.000000000000000,0.437308192253113,-0.359217107295990,-0.039910282939672,1.000000000000000\n\t\tTransformLink: 0.999999761581421,0.000000271946192,0.000000041443855,0.000000000000000,-0.000000041909516,0.152355253696442,0.988325893878937,0.000000000000000,0.000000241678208,-0.988325715065002,0.152355313301086,0.000000000000000,-0.437308102846146,0.015284135937691,0.361104071140289,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-heel_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 5180,5183,5184,5186,5189,5190,5193,5196,5197,5199,5202,5203,5205,5208,5209,5210,5213,5214,5217,5220,5221,5957,5958\n\t\t,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981\n\t\t,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000,6001,6002,6003,6004\n\t\t,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027\n\t\t,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050\n\t\t,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073\n\t\t,6074,6075,6076,6077,6078,6079,6080,6081,6082,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270\n\t\t,7271,7272,7273,7274,7275,7276,7277,7278,7281,7283,7284,7287,7288,7291,7766,7767,7768,7769,7770,7771,7772,7773,7774\n\t\t,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797\n\t\t,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820\n\t\t,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843\n\t\t,7844,7845,7846,7847,7848,7849,8032,8033,8034,8035,8036,8037,8038,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129\n\t\t,8130,8131,8132,8133,8134,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8158,8159,8167,8173,8174\n\t\t,8175,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8198,8199,8200,8201,8202,8203,8204,8205\n\t\t,8206,8207,8208,8209,8210,8215,8219,8220,8223,8229,8233,8234,8235,8236,8237,8242,8243,8244,8246,8247,8248,8249,8250\n\t\t,8251,8252,8253,8254,8255,8256,8257,8261,8289,8290,8291,8294,8295,8296,8297,8298,8299,8300,8301,8302,8304,8305,8306\n\t\t,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8319,8320,8323,8324,8326,8328,8329,8330,8331,8334,8335,8336\n\t\t,8337,8342,8343,8344,8345,8348,8349,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8374\n\t\t,8375,8376,8377,8378,8381,8382,8383,8384,8389,8390,8391,8392,8393,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406\n\t\t,8407,8408,8409,8410,8418,8419,8420,8435,8437,8441,8445,8447,8448,8453,8455,8459,8460,8461,8462,8463,8464,8465,8466\n\t\t,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8491,8492,8493\n\t\t,8494,8499,8500,8501,8502,8503,8504,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8528,8529\n\t\t,8530,8545,8547,8548,8552,8557,8558,8559,8560,8561,8566,8567,8568,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581\n\t\t,8582,8583,8584,8585,8586,8589,8605,8612,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650\n\t\t,8651,8652,8657,8659,8660,8661,8662,8663,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680\n\t\t,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8696,8697,8698,8699,8700,8702,8703,8706,8707\n\t\t,8708,8709,8711,8712,8715,8717,8718,8720,8721,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8739,8740,8741,8743\n\t\t,8744,8745,8746,8750,8751,8752,8754,8755,8756,8758,8763,8764,8769,8770,8771,8772,8773,8774,8775,8777,8778,8779,8781\n\t\t,8782,8783,8784,8790,8791,8792,8793,8794,8797,8798,8799,8800,8801,8802,8803,8805,8806,8809,8810,8811,8816,8817,8818\n\t\t,8819,8820,8821,8828,8829,8832,8835,8836,8840,8841,8842,8843,8844,8846,8847,8848,8855,8856,8857,8858,8859,8860,8861\n\t\t,8862,8863,8864,8865,8866,8867,8868,8869,8870,8875,8876,8878,8879,8882,8883,8884,8889,8890,8891,8892,8893,8894,8901\n\t\t,8902,8905,8908,8909,8912,8913,8914,8915,8916,8920,8927,8937,8938,8939,8940,8941,8942,8943,8944,8945,8946,8947,8948\n\t\t,8949,8950,8951,8952,8953,8954,8958,8959,8960,8961,8962,8963,8964,8965,8966,8967,8968,8970,8971,8972,8973,8974,8975\n\t\t,8977,8978,8984,8985,8986,8987,8989,8994,8996,8997,8998,8999,9000,9001,9003,9007,9008,9009,9010,9012,9013,9014,9016\n\t\t,9017,9022,9023,9024,9025,9026,9031,9032,9033,9034\n\t\tWeights: 0.04154303,0.03631003,0.05722830,0.10316845,0.09532735,0.11065470,0.04632604,0.05121731,0.05081697,0.04759479,0.05076700,0.04501607,0.09746743,0.08823676,0.10928912,0.08055567,0.08875340,0.07824663,0.10388493,0.11730358,0.08483467,0.10565593,0.09540849,0.10704742,0.12470293,0.09906008,0.08993804,0.09664886,0.12632404,0.11406228,0.22954341,0.23001942,0.22656057,0.22672418,0.25912381,0.26876671,0.22398022,0.22325702\n\t\t,0.24648396,0.11590305,0.13126760,0.11710181,0.10566908,0.10602634,0.11913701,0.13225948,0.10660681,0.09767345,0.09119077,0.09388836,0.09207202,0.09021510,0.08578940,0.08795639,0.09469007,0.09117390,0.08526695,0.22544507,0.20445221,0.22538031,0.25042282,0.22337191,0.19844285,0.20558911,0.24846148,0.25742274,0.18058905,0.19062263,0.18199409,0.18003628,0.17345561,0.18859155,0.19052410,0.18203670,0.17174629,0.28668261\n\t\t,0.28722201,0.27870644,0.19938523,0.32197181,0.31445932,0.28196190,0.19872395,0.19934311,0.11995001,0.11188641,0.12616506,0.13285947,0.11437318,0.10536187,0.11927268,0.13638117,0.13051142,0.17257687,0.16387108,0.16491110,0.17734190,0.18812934,0.17838243,0.15747888,0.17060793,0.19010049,0.13701848,0.15135063,0.14101178,0.12628256,0.13056888,0.14650808,0.15337859,0.13124920,0.11902221,0.11090411,0.11442770,0.11739012\n\t\t,0.10846713,0.10344951,0.10671612,0.12044102,0.11585222,0.10121494,0.20505335,0.20005861,0.19797613,0.21000600,0.21336551,0.20335827,0.19568007,0.19920130,0.22400162,0.18599331,0.18257656,0.18446745,0.19007190,0.18622640,0.18582381,0.18018185,0.18870483,0.18930710,0.20337981,0.21164415,0.19009669,0.18746532,0.22435863,0.23417609,0.19656798,0.17989681,0.19667151,0.38321605,0.34085225,0.19220350,0.14794665,0.15233303\n\t\t,0.17439483,0.17563126,0.20602414,0.25770038,0.07322940,0.07200507,0.07422624,0.08742224,0.08388626,0.08001467,0.30033630,0.33412294,0.30807318,0.07703843,0.08438947,0.09897919,0.04534067,0.07907882,0.10156311,0.05124584,0.06306843,0.12261272,0.08152591,0.26118099,0.25212033,0.20123831,0.18595098,0.18465883,0.18891884,0.20563070,0.22134745,0.23853273,0.09501722,0.09651149,0.09929252,0.13871098,0.12300916,0.11154350\n\t\t,0.20222854,0.20974629,0.20774737,0.09997920,0.11025897,0.12881088,0.09275991,0.09143170,0.08641868,0.16786500,0.16848674,0.16820624,0.21545736,0.20845530,0.20659502,0.15500009,0.15436415,0.14040605,0.09178921,0.09846755,0.09927152,0.19058363,0.18896693,0.18123122,0.29590628,0.27484514,0.27063708,0.18906840,0.18356552,0.17562836,0.18678670,0.18279748,0.17841279,0.19194464,0.19312646,0.19329396,0.12038808,0.12128753\n\t\t,0.12352067,0.15351727,0.14182428,0.13312667,0.15588117,0.16270341,0.16824458,0.12388153,0.12971197,0.13816774,0.11607222,0.10841190,0.10135354,0.15570010,0.14979987,0.14781822,0.18826168,0.18020034,0.17567081,0.16714259,0.16904302,0.16848048,0.11139791,0.11908116,0.12469917,0.19260878,0.19510729,0.19554178,0.23241045,0.21305146,0.19902791,0.15665982,0.22172290,0.07462870,0.11817240,0.35753246,0.07692520,0.16437555\n\t\t,0.19323388,0.19814515,0.09580015,0.16213157,0.25404697,0.10386343,0.16304088,0.18991071,0.17349681,0.12108728,0.16558959,0.19194496,0.12734316,0.14762974,0.21422755,0.27278704,0.05052461,0.21282898,0.67734472,0.63543528,0.13932171,0.24579276,0.45189122,0.84483328,0.20994798,0.27882477,0.19217448,0.09733852,0.99128959,0.81518519,0.24856043,0.12122582,0.11263032,0.01011991,0.06183103,0.38870931,1.00000000,0.93516961\n\t\t,0.70902069,0.81672044,0.97112231,1.00000000,1.00000000,0.96449576,0.94098924,0.99712694,1.00000000,0.35124897,0.80880982,0.06367095,0.60163658,0.94552377,0.81160887,0.20839797,0.49326051,0.87237323,0.93101939,0.38805009,0.54818341,0.31752897,0.12069150,0.00137907,1.00000000,1.00000000,0.76101480,0.99671779,0.01612835,0.01580995,0.16702183,0.14848924,0.03021847,0.00646310,0.08571278,0.46826017,0.45528660,1.00000000\n\t\t,1.00000000,0.87317244,0.99947441,0.87785513,0.98761684,1.00000000,1.00000000,0.97954301,0.94759739,1.00000000,0.99170280,0.91263428,0.07075789,0.48914365,0.05214403,1.00000000,0.96962411,0.17397964,0.81622426,0.02918725,0.95097740,0.78089168,0.02013720,0.99789739,1.00000000,0.92174878,0.99085510,0.53390601,0.20336351,0.98945462,0.91911692,0.84349534,0.86039458,0.89863365,0.96506787,0.99597354,0.99815338,0.68199707\n\t\t,1.00000000,0.00028967,1.00000000,0.01665450,0.32245032,0.65879227,0.55663570,1.00000000,0.17854067,0.12288621,0.81250843,0.28892615,0.51818281,0.35684077,0.38874601,0.61567609,0.75453072,0.09897337,0.03560169,0.57900463,0.80218836,0.92634009,0.95700092,0.99364244,0.96614537,0.89888577,0.86235533,0.84803211,0.92535770,1.00000000,1.00000000,1.00000000,0.90292958,0.39795955,0.22554080,0.00796841,0.29306657,0.73666569\n\t\t,0.01350685,0.23715926,0.19296042,0.49331586,0.11483078,0.30756923,0.75563039,0.77724561,0.22608742,0.53931895,0.10903956,0.23352618,0.92758351,0.22441211,0.37328321,0.22811989,0.18294855,0.21402045,0.73734925,0.43653114,0.22428060,0.14766442,0.05008668,0.99279362,1.00000000,0.90975241,0.13471404,0.09306294,0.10599470,0.03964737,0.25586194,0.12108778,0.01009017,0.03416059,0.60646228,0.58114575,0.72275142,0.96975629\n\t\t,0.05089595,0.99014979,0.79196656,1.00000000,0.89525733,0.94530582,1.00000000,1.00000000,1.00000000,1.00000000,1.00000000,0.98202663,0.95238195,1.00000000,0.05821854,0.55444723,0.63409262,0.83858218,0.93227442,0.97450869,1.00000000,0.02527567,0.54014250,0.97772544,0.03237676,0.37999829,0.36948691,0.83848154,0.16200059,0.81348923,0.94174052,0.99891848,0.59276556,0.00115578,0.91880344,0.15774890,0.72536345,1.00000000\n\t\t,0.53115830,0.84962856,0.43278128,0.28939624,0.36504406,0.87651870,0.70814124,0.41528255,0.20817842,0.05865684,1.00000000,1.00000000,1.00000000,0.16214980,0.12214545,0.01337084,0.15136088,0.06610303,0.06484814,0.01622073,0.30815864,0.16027290,0.04285624,0.00200702,0.05906416,0.76780960,0.12035315,0.78493942,1.00000000,1.00000000,0.89283616,1.00000000,0.93324622,0.95203022,1.00000000,1.00000000,1.00000000,1.00000000\n\t\t,0.99400844,0.96709245,0.99300293,0.01790899,0.00915456,0.05877573,0.50213196,0.74290727,0.89447672,0.94568699,0.98804379,0.20274370,0.07654425,0.53478539,0.79093579,0.90975496,0.96228487,0.99835587,0.23168571,0.99805718,0.03245631,0.02760511,0.01927457,0.87249392,0.93668231,0.11010148,0.28594500,0.66808582,0.01293686,0.08323914,0.99874794,1.00000000,0.98977320,0.94641457,0.88270019,0.70996572,0.97538614,0.99648634\n\t\t,0.33242154,0.96755689,0.89776979,0.86160432,0.84815477,0.92855602,0.98861440,0.99014056,0.98757501,0.85784125,0.85027737,0.87506585,0.93344061,0.99397839,0.98693075,1.00000000,0.99581027,0.40368225,0.88878091,0.46273409,0.56736155,0.67879335,0.32011754,0.48080471,1.00000000,0.32567838,0.05050005,0.24707147,0.28800703,0.84194402,0.46222904,0.67928761,0.07017343,0.32946207,0.98065246,0.60076502,1.00000000,0.01644720\n\t\t,0.17117383,0.44459150,0.63018825,1.00000000,0.85436683,1.00000000,0.33862648,0.00046245,0.25365943,0.32524835,0.76574174,0.99229929,0.12257677,0.56043495,0.01874099,0.38756302,0.81426345,0.99854604,1.00000000,0.17847022,0.12153484,0.82724757,0.29185463,0.49017060,1.00000000,0.01994073,0.17441588,0.41712605,0.59494271,1.00000000,0.83106065,1.00000000,1.00000000,1.00000000,0.91064421,0.91264958,0.48661260,0.29456880\n\t\t,0.19559541,0.42883961,0.45500796,0.40350129,0.37721349,0.49304494,0.06310680,0.22825204,0.71028567,0.89470352,0.94271092,0.97885254,0.99922109,0.20582174,0.17253638,0.04630873,0.33277829,0.49075197,0.88518227,0.26116379,0.59477729,0.18050537,0.27312263,0.91507541,0.68936481,0.02599861,0.05155197,0.04687100,0.25905916,0.88775281,1.00000000,0.98053736,1.00000000,0.98314684,0.61404452,0.05383411,0.83261775,0.08791865\n\t\t,0.27438519,0.75826465,0.90654992,0.95440156,0.99233071,1.00000000,0.93349591,0.87560330,0.85401512,0.86387699,0.98212986,1.00000000,1.00000000,1.00000000,0.97130509,0.29500051,0.15361533,0.44267214,0.27924787,0.05975139,0.76560248,0.92603793,1.00000000,0.43918800,0.90011993,0.27460723,0.67231569,1.00000000,0.78461828,0.05788075,0.06629371,0.06855620,0.32791774,0.02260098,0.96808129,1.00000000,0.99121318,1.00000000\n\t\t,0.00351009,0.01061323,0.08874975,0.29599721,0.65270687,0.85932869,0.93203632,0.97496852,0.99288025,0.04548198,0.11610229,0.34311120,0.69972541,0.87270950,0.94309394,0.98713093,1.00000000,0.05135264,0.01802802,0.02006823,0.98427768,0.93354100,0.87455480,0.85369758,0.86455549,0.98448170,0.99544147,0.49520284,0.47177114,0.38278290,0.50487122,0.55782599,0.52742020,0.90825760,0.35173200,0.57374502,0.19819245,0.74211207\n\t\t,1.00000000,0.05092648,0.22554866,0.52166127,0.76111421,0.96192236,0.07003210,0.31871597,0.96307813,0.29663722,1.00000000,0.05184022,1.00000000,0.91315312,0.46277390,0.29617674,0.68211193,1.00000000,0.06936748,0.34576723,0.49501848,0.71163261,1.00000000,0.05225314,0.21453544,0.44752022,0.66330504,0.93629451,0.07171909,0.30653857,0.93466530,1.00000000\n\t\tTransform: -0.996467709541321,-0.083321250975132,0.010489988140762,0.000000000000000,-0.052713703364134,0.523346126079559,-0.850488066673279,0.000000000000000,0.065373860299587,-0.848036587238312,-0.525889575481415,0.000000000000000,-0.438188761472702,0.186867430806160,0.060605630278587,1.000000000000000\n\t\tTransformLink: -0.996467411518097,0.065373837947845,0.052713669836521,0.000000000000000,-0.083321280777454,-0.848036944866180,-0.523346245288849,0.000000000000000,0.010489998385310,-0.525889694690704,0.850488185882568,0.000000000000000,-0.421706557273865,0.218988418579102,0.069350525736809,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-heel_02_R\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: 5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5978,5982,5984,5985,5986\n\t\t,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009\n\t\t,6010,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041\n\t\t,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064\n\t\t,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,7260,7261,7262,7263,7266\n\t\t,7267,7272,7273,7274,7275,7276,7277,7766,7769,7770,7771,7772,7773,7774,7775,7776,7777,7779,7780,7781,7782,7783,7784\n\t\t,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7799,7800,7801,7802,7803,7804,7806,7807,7808,7809,7810,7811\n\t\t,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834\n\t\t,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,8032,8033,8034,8038,8120,8121,8122,8124\n\t\t,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149\n\t\t,8154,8158,8159,8167,8173,8174,8183,8185,8186,8187,8188,8195,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208\n\t\t,8209,8210,8223,8229,8235,8236,8244,8246,8249,8250,8289,8291,8297,8301,8308,8319,8323,8328,8329,8330,8334,8335,8336\n\t\t,8337,8342,8343,8344,8345,8348,8349,8356,8357,8358,8369,8373,8374,8375,8376,8377,8378,8381,8382,8383,8384,8389,8390\n\t\t,8391,8392,8393,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8418,8420,8435,8437,8441,8447\n\t\t,8448,8459,8460,8461,8462,8463,8464,8465,8467,8480,8481,8486,8487,8488,8491,8492,8493,8494,8499,8500,8501,8502,8503\n\t\t,8507,8508,8509,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8552,8557,8560,8561,8572,8573,8574,8577,8637,8638\n\t\t,8639,8642,8644,8659,8662,8663,8693,8694,8696,8697,8698,8699,8700,8703,8706,8707,8708,8709,8710,8711,8712,8715,8717\n\t\t,8720,8727,8728,8729,8731,8733,8734,8735,8739,8740,8741,8743,8744,8746,8750,8751,8754,8755,8756,8758,8760,8763,8770\n\t\t,8771,8772,8774,8779,8781,8782,8783,8784,8790,8791,8792,8793,8794,8798,8799,8800,8805,8806,8809,8810,8811,8816,8817\n\t\t,8818,8819,8820,8821,8828,8832,8835,8836,8840,8846,8847,8848,8870,8875,8876,8878,8879,8882,8883,8884,8890,8891,8892\n\t\t,8893,8901,8905,8909,8938,8939,8940,8941,8965,8966,8967,8968,8970,8971,8972,8973,8974,8975,8977,8984,8985,8986,8987\n\t\t,8989,8994,8996,8997,8998,9000,9003,9007,9008,9009,9012,9013,9014,9016,9022,9023,9024,9025,9026,9031,9032,9033\n\t\tWeights: 0.06122389,0.05162971,0.06319069,0.06909811,0.05331130,0.04368488,0.05280656,0.07266366,0.05481964,0.07765183,0.07584608,0.08033015,0.07924574,0.06454891,0.06034621,0.07929677,0.08205749,0.06518867,0.00196026,0.00253299,0.02070291,0.01394541,0.02159614,0.02867880,0.01529027,0.00903329,0.01457849,0.02986775,0.02275847,0.02063413,0.02963631,0.02268216,0.01217110,0.01279164,0.02086247,0.03224979,0.01389089,0.00491196\n\t\t,0.06170207,0.07170880,0.06405163,0.05247608,0.05285975,0.05940989,0.07496507,0.05436821,0.04221614,0.08150531,0.06598772,0.08460039,0.10229798,0.07789682,0.06083722,0.07107092,0.10089589,0.09628708,0.12607166,0.12535076,0.12471006,0.12196738,0.11641817,0.11566505,0.12404649,0.12008549,0.11414890,0.01723936,0.01397726,0.02485475,0.02233733,0.00869810,0.00453374,0.02215170,0.02985773,0.01395055,0.04318303,0.03534826\n\t\t,0.05004519,0.05052652,0.03420074,0.02666291,0.04294218,0.05501484,0.04256282,0.05120101,0.05642204,0.05657135,0.04338159,0.04080267,0.05043348,0.06168247,0.05210041,0.03141360,0.08535682,0.10219737,0.08802751,0.07210842,0.07914518,0.09758464,0.10005115,0.07681657,0.06596022,0.01938339,0.02609867,0.02923686,0.01492784,0.00793734,0.01452591,0.03635518,0.02450114,0.00357120,0.01792986,0.02539430,0.03085837,0.00305741\n\t\t,0.00944835,0.00230176,0.02136483,0.02497807,0.02712622,0.02297292,0.02736698,0.02012149,0.00411776,0.05923358,0.07073515,0.08677994,0.03967601,0.02967635,0.02060614,0.03452794,0.02630827,0.01899936,0.00132138,0.00674159,0.09593251,0.09726948,0.09758015,0.05600552,0.06865056,0.08367125,0.03985438,0.03815686,0.03130126,0.05766863,0.07340682,0.07765730,0.06338217,0.07745836,0.08074754,0.00331522,0.00780983,0.00833609\n\t\t,0.04367773,0.04051130,0.03020874,0.00398480,0.00549133,0.04218374,0.03508605,0.03020681,0.07945100,0.08915824,0.09879133,0.06497091,0.05957411,0.05486006,0.05789150,0.05251853,0.04773220,0.02712551,0.02984838,0.03478894,0.11746528,0.11825291,0.11477879,0.07371546,0.08528589,0.09855648,0.06139865,0.05625960,0.05132946,0.10975177,0.11802642,0.11671013,0.10837068,0.11409269,0.11070606,0.02206305,0.01301309,0.00234572\n\t\t,0.01999033,0.02860695,0.03616112,0.06795978,0.06275115,0.05678841,0.02258852,0.03441823,0.04555301,0.01019092,0.03171295,0.01616303,0.01962076,0.05074408,0.09503544,0.04497180,0.01206094,0.01250917,0.09278022,0.07117965,0.10761605,0.06479604,0.02746224,0.05038721,0.04092182,0.11035871,0.39892511,0.71754658,0.06610220,0.69945235,0.32265528,0.36294597,0.24547557,0.55573900,0.54810878,0.15516672,0.48266790,0.62539248\n\t\t,0.43470514,0.15008403,0.00366012,0.00871041,0.18481481,0.38146226,0.10595916,0.04056403,0.21827169,0.06483039,0.22283934,0.06410504,0.00571958,0.23743045,0.12421152,0.04133773,0.26157087,0.05447623,0.17407386,0.16176682,0.26883737,0.10646113,0.06898061,0.27737168,0.32782029,0.29020385,0.12235602,0.23898520,0.00328221,0.06575913,0.00859615,0.10538846,0.02652987,0.04723012,0.00052559,0.00642429,0.06030036,0.01265562\n\t\t,0.04738452,0.00554386,0.02636807,0.01304064,0.47998844,0.09950791,0.20998643,0.11593512,0.18242562,0.10472153,0.68857793,0.24527838,0.20239869,0.07450733,0.08667125,0.23889982,0.12957757,0.06183424,0.04643202,0.00182613,0.09707042,0.00229100,0.48829545,0.35836031,0.02550247,0.51416889,0.26333431,0.03139561,0.39554439,0.48247645,0.50668414,0.19559419,0.67103622,0.24436961,0.22275439,0.68648077,0.46068105,0.18009195\n\t\t,0.71487533,0.07241649,0.62929312,0.62671679,0.51742940,0.34601018,0.42939316,0.26265075,0.52622811,0.55957529,0.27942938,0.06817399,0.00720638,0.09024759,0.00117615,0.00414274,0.15975478,0.06525487,0.07321820,0.25707372,0.15637794,0.08323942,0.03024371,0.06498817,0.00985021,0.12220580,0.03585992,0.10467839,0.00551034,0.00536067,0.22899573,0.02227456,0.00688945,0.22839841,0.27769590,0.13940336,0.13470829,0.10924451\n\t\t,0.05825948,0.00108152,0.27611091,0.07760480,0.11836890,0.17939948,0.27524610,0.10981131,0.28248626,0.21983648,0.25278157,0.12348130,0.23501157,0.33898390,0.20888203,0.05786436,0.10201272,0.03659810,0.02315777,0.04005086,0.08072110,0.13100270,0.01542291,0.01616986,0.06219402,0.05411758,0.01215821,0.02073827,0.00577921,0.01929451,0.04268628,0.05982100,0.05633199,0.11121909,0.00578234,0.02878932,0.06444509,0.26037288\n\t\t,0.06643772,0.56841195,0.04610297,0.17009450,0.41925303,0.14373080,0.00209972,0.21732972,0.16982734,0.01295868,0.09722430,0.34004317,0.08315905,0.14198910,0.13212173,0.06578724,0.45353064,0.01223908,0.36147846,0.64106069,0.23425826,0.00770071,0.17488418,0.19889699,0.20660889,0.10082470,0.00145396,0.11114127,0.14910768,0.17275243,0.30192123,0.00764811,0.45347909,0.09452617,0.16589777,0.15958536,0.08312664,0.08935579\n\t\t,0.05878181,0.51338740,0.18775062,0.30338845,0.21965008,0.32074052,0.37386834,0.13120364,0.08173287,0.03440204,0.05970053,0.01355993,0.59348746,0.36334090,0.06478600,0.64491234,0.50924803,0.11481773,0.44662124,0.40522271,0.30272286,0.63159898,0.08492459,0.15387196,0.06711114,0.02430414,0.11350474,0.07647367,0.33500965,0.06395487,0.16738225,0.02869491,0.46431592,0.22171803,0.31513701,0.23761151,0.04667362,0.17501206\n\t\t,0.05995308,0.23989266,0.09988007,0.19040607,0.18301236,0.05309488,0.03995507,0.06259322,0.04619488,0.06261049,0.02317947,0.00113566,0.06379593,0.14284173,0.28289424,0.49512878,0.01107530,0.13949124,0.09174240,0.53571800,0.06719364,0.29195921,0.10757291,0.05604574,0.21692233,0.35194563,0.23281463,0.03807764,0.02364027,0.12941099,0.01540767,0.39724205,0.06522193,0.05623043,0.20577719,0.17993687,0.16345592,0.03745735\n\t\t,0.32827440,0.16512523,0.13170397,0.06114527,0.24780902,0.42682188,0.33257752,0.06370549,0.03124480,0.14876054,0.03636313\n\t\tTransform: 0.000000102253374,0.998065412044525,0.062175400555134,0.000000000000000,-1.000000000000000,0.000000148729413,0.000000039125329,0.000000000000000,-0.000000036230063,-0.062175419181585,0.998065233230591,0.000000000000000,0.000000573977502,0.364852517843246,0.017493989318609,1.000000000000000\n\t\tTransformLink: 0.000000150874257,0.000000029802322,1.000000000000000,0.000000000000000,0.998065054416656,-0.062175389379263,-0.000000104308128,0.000000000000000,0.062175408005714,0.998065233230591,0.000000029802322,0.000000000000000,-0.365234255790710,0.005224704742432,-0.000000536441803,1.000000000000000\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 Camera\", \"Cluster\" {\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"\n\t\tIndexes: \n\t\tWeights: \n\t\tTransform: -1.000000000000000,0.000000000030189,0.000008243831871,0.000000000000000,-0.000000000030189,-1.000000000000000,0.000000000000000,0.000000000000000,0.000008243831871,-0.000000000000000,1.000000000000000,0.000000000000000,-0.000031031002436,-0.104612059891224,-3.764149427413940,1.000000000000000\n\t\tTransformLink: -1.000000000000000,0.000008243831871,0.000000000030189,0.000000000000000,0.000000000030189,0.000000000000000,1.000000000000000,0.000000000000000,0.000008243831871,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000014842,3.764149427413940,0.104612059891224,1.000000000000000\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 68\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::rig\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::testBody_000\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::root\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-hips\"\n\t\t\tMatrix: 0.999999940395355,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.976922035217285,0.213596269488335,0.000000000000000,0.000000000000000,-0.213596269488335,0.976922035217285,0.000000000000000,0.000000000000000,2.029618740081787,-0.037349402904510,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-spine\"\n\t\t\tMatrix: 0.999999940395355,0.000000016774788,-0.000000157862829,0.000000000000000,0.000000000000000,0.994401574134827,0.105666898190975,0.000000000000000,0.000000158751561,-0.105666898190975,0.994401574134827,0.000000000000000,0.000000000000000,2.378908634185791,0.039020061492920,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-chest\"\n\t\t\tMatrix: 0.999999940395355,0.000000000000004,-0.000000000000028,0.000000000000000,-0.000000000000004,0.988864898681641,-0.148816168308258,0.000000000000000,0.000000000000014,0.148816168308258,0.988864898681641,0.000000000000000,0.000000000000000,2.696645975112915,0.072783403098583,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-neck\"\n\t\t\tMatrix: 0.999999940395355,0.000000091870334,-0.000000313275109,0.000000000000000,0.000000000000003,0.959588587284088,0.281406760215759,0.000000000000000,0.000000326468069,-0.281406760215759,0.959588587284088,0.000000000000000,0.000000000014840,3.322010040283203,0.021766960620880,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-head\"\n\t\t\tMatrix: 0.999999940395355,0.000000000000028,-0.000000000000057,0.000000000000000,-0.000000000000014,1.000000000000000,-0.000000089406967,0.000000000000000,0.000000000000000,0.000000089406967,1.000000000000000,0.000000000000000,0.000000000014841,3.569406747817993,0.094317965209484,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-shoulder_L\"\n\t\t\tMatrix: 0.429939031600952,-0.000022634863853,0.902857959270477,0.000000000000000,0.902857661247253,-0.000598199665546,-0.429939061403275,0.000000000000000,0.000549822987523,1.000000000000000,-0.000236749649048,0.000000000000000,0.036777928471565,3.225806236267090,0.192655280232430,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-upper_arm_L\"\n\t\t\tMatrix: -0.712102353572845,-0.698729574680328,0.068460568785667,0.000000000000000,0.702034652233124,-0.709714829921722,0.058750718832016,0.000000000000000,0.007536598015577,0.089898340404034,0.995922267436981,0.000000000000000,0.409402072429657,3.183911323547363,0.033970266580582,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-forearm_L\"\n\t\t\tMatrix: -0.763212740421295,-0.643065392971039,0.063031345605850,0.000000000000000,0.535786628723145,-0.575314760208130,0.618016958236694,0.000000000000000,-0.361162334680557,0.505450010299683,0.783633649349213,0.000000000000000,0.819296956062317,2.769532203674316,0.068272873759270,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-hand_L\"\n\t\t\tMatrix: 0.434550464153290,-0.498601257801056,-0.750041544437408,0.000000000000000,0.326210469007492,-0.689103364944458,0.647087752819061,0.000000000000000,-0.839495003223419,-0.525864303112030,-0.136801257729530,0.000000000000000,1.089573621749878,2.479315757751465,0.380030453205109,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-palm_01_L\"\n\t\t\tMatrix: 0.727383732795715,-0.473619580268860,-0.496585220098495,0.000000000000000,0.225527822971344,-0.518456637859344,0.824826598167419,0.000000000000000,-0.648112177848816,-0.711959958076477,-0.270302712917328,0.000000000000000,1.113720536231995,2.443556785583496,0.472845971584320,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_index_01_L\"\n\t\t\tMatrix: 0.733102321624756,-0.452825397253036,-0.507454097270966,0.000000000000000,0.098658517003059,-0.667429566383362,0.738107979297638,0.000000000000000,-0.672924160957336,-0.591174125671387,-0.444619208574295,0.000000000000000,1.150265693664551,2.359544515609741,0.606503248214722,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_index_02_L\"\n\t\t\tMatrix: 0.766428530216217,-0.430201500654221,-0.476983606815338,0.000000000000000,0.053469650447369,-0.697276353836060,0.714804708957672,0.000000000000000,-0.640099704265594,-0.573351681232452,-0.511409938335419,0.000000000000000,1.157519340515137,2.310473203659058,0.660771012306213,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_index_03_L\"\n\t\t\tMatrix: 0.786200046539307,-0.427918612957001,-0.445841401815414,0.000000000000000,0.049849070608616,-0.675192713737488,0.735954523086548,0.000000000000000,-0.615957736968994,-0.600833058357239,-0.509505331516266,0.000000000000000,1.160149812698364,2.276170253753662,0.695936262607574,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-thumb_01_L\"\n\t\t\tMatrix: -0.870747566223145,-0.150710523128510,-0.468064606189728,0.000000000000000,-0.388418793678284,-0.372913658618927,0.842653930187225,0.000000000000000,-0.301544249057770,0.915544331073761,0.266175329685211,0.000000000000000,1.084509491920471,2.441226005554199,0.481160879135132,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-thumb_02_L\"\n\t\t\tMatrix: 0.888904690742493,0.132770121097565,0.438428938388824,0.000000000000000,-0.315152287483215,-0.517346441745758,0.795632183551788,0.000000000000000,0.332455724477768,-0.845413625240326,-0.418029427528381,0.000000000000000,1.048422694206238,2.406579732894897,0.559449195861816,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-thumb_03_L\"\n\t\t\tMatrix: 0.872855424880981,0.174273669719696,0.455797731876373,0.000000000000000,-0.286081403493881,-0.573946952819824,0.767294764518738,0.000000000000000,0.395322918891907,-0.800133168697357,-0.451116770505905,0.000000000000000,1.024708151817322,2.367650508880615,0.619318783283234,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-palm_02_L\"\n\t\t\tMatrix: 0.485367119312286,-0.543322980403900,-0.684995293617249,0.000000000000000,0.306903332471848,-0.627737939357758,0.715370297431946,0.000000000000000,-0.818674743175507,-0.557445168495178,-0.137935787439346,0.000000000000000,1.131832003593445,2.429787635803223,0.451921582221985,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_middle_01_L\"\n\t\t\tMatrix: 0.480655163526535,-0.435713648796082,-0.761001825332642,0.000000000000000,0.280682921409607,-0.745722472667694,0.604247033596039,0.000000000000000,-0.830774903297424,-0.504035234451294,-0.236138045787811,0.000000000000000,1.183128952980042,2.324865102767944,0.571491241455078,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_middle_02_L\"\n\t\t\tMatrix: 0.465369552373886,-0.483117789030075,-0.741638600826263,0.000000000000000,0.137334287166595,-0.788340091705322,0.599715530872345,0.000000000000000,-0.874396800994873,-0.380942285060883,-0.300520896911621,0.000000000000000,1.204881906509399,2.267071485519409,0.618320465087891,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_middle_03_L\"\n\t\t\tMatrix: 0.527983903884888,-0.424699127674103,-0.735433936119080,0.000000000000000,0.153127565979958,-0.804174959659576,0.574329257011414,0.000000000000000,-0.835334777832031,-0.415852338075638,-0.359558373689651,0.000000000000000,1.213949918746948,2.215018272399902,0.657918989658356,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-palm_03_L\"\n\t\t\tMatrix: 0.516751170158386,-0.364064037799835,-0.774870991706848,0.000000000000000,0.376900196075439,-0.715916752815247,0.587714910507202,0.000000000000000,-0.768709123134613,-0.595752060413361,-0.232735112309456,0.000000000000000,1.136097431182861,2.420257568359375,0.432370036840439,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_ring_01_L\"\n\t\t\tMatrix: 0.494620800018311,-0.275275617837906,-0.824362277984619,0.000000000000000,0.461882859468460,-0.720222294330597,0.517632365226746,0.000000000000000,-0.736215829849243,-0.636791229248047,-0.229091987013817,0.000000000000000,1.198728680610657,2.301290273666382,0.530033409595490,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_ring_02_L\"\n\t\t\tMatrix: 0.532615423202515,-0.291463643312454,-0.794587552547455,0.000000000000000,0.147570252418518,-0.892470479011536,0.426285207271576,0.000000000000000,-0.833392560482025,-0.344304144382477,-0.432332217693329,0.000000000000000,1.229935407638550,2.252629041671753,0.565006792545319,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_ring_03_L\"\n\t\t\tMatrix: 0.529071033000946,-0.289554744958878,-0.797647476196289,0.000000000000000,0.308623582124710,-0.809951424598694,0.498727977275848,0.000000000000000,-0.790464818477631,-0.510035991668701,-0.339158475399017,0.000000000000000,1.238485574722290,2.200919628143311,0.589705586433411,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-palm_04_L\"\n\t\t\tMatrix: 0.457702606916428,-0.262205868959427,-0.849562168121338,0.000000000000000,0.435702770948410,-0.766780376434326,0.471391767263412,0.000000000000000,-0.775029420852661,-0.585914492607117,-0.236713618040085,0.000000000000000,1.143699049949646,2.404265880584717,0.416573852300644,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_pinky_01_L\"\n\t\t\tMatrix: 0.366844683885574,-0.189626619219780,-0.910750389099121,0.000000000000000,0.376891732215881,-0.864765644073486,0.331861823797226,0.000000000000000,-0.850515604019165,-0.464996665716171,-0.245766013860703,0.000000000000000,1.205861210823059,2.294868469238281,0.483827829360962,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_pinky_02_L\"\n\t\t\tMatrix: 0.451893448829651,-0.231596767902374,-0.861483991146088,0.000000000000000,0.256770789623260,-0.891073346138000,0.374241113662720,0.000000000000000,-0.854318618774414,-0.390321671962738,-0.343202948570251,0.000000000000000,1.224575638771057,2.251928806304932,0.500306308269501,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_pinky_03_L\"\n\t\t\tMatrix: 0.549974799156189,-0.199937462806702,-0.810895860195160,0.000000000000000,0.196936726570129,-0.912497580051422,0.358557403087616,0.000000000000000,-0.811629772186279,-0.356893330812454,-0.462475657463074,0.000000000000000,1.233843803405762,2.219765424728394,0.513814568519592,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-shoulder_R\"\n\t\t\tMatrix: 0.429939031600952,0.000022634863853,-0.902857959270477,0.000000000000000,-0.902857661247253,-0.000598199665546,-0.429939061403275,0.000000000000000,-0.000549822987523,1.000000000000000,-0.000236749649048,0.000000000000000,-0.036777928471565,3.225806236267090,0.192655280232430,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-upper_arm_R\"\n\t\t\tMatrix: -0.712102353572845,0.698729574680328,-0.068460568785667,0.000000000000000,-0.702034652233124,-0.709714829921722,0.058750718832016,0.000000000000000,-0.007536598015577,0.089898340404034,0.995922267436981,0.000000000000000,-0.409402072429657,3.183911323547363,0.033970266580582,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-forearm_R\"\n\t\t\tMatrix: -0.763212740421295,0.643065392971039,-0.063031345605850,0.000000000000000,-0.535786628723145,-0.575314760208130,0.618016958236694,0.000000000000000,0.361162334680557,0.505450010299683,0.783633649349213,0.000000000000000,-0.819296956062317,2.769532203674316,0.068272873759270,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-hand_R\"\n\t\t\tMatrix: 0.434550464153290,0.498601257801056,0.750041544437408,0.000000000000000,-0.326210469007492,-0.689103364944458,0.647087752819061,0.000000000000000,0.839495003223419,-0.525864303112030,-0.136801257729530,0.000000000000000,-1.089573621749878,2.479315757751465,0.380030453205109,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-palm_01_R\"\n\t\t\tMatrix: 0.727383732795715,0.473619580268860,0.496585220098495,0.000000000000000,-0.225527822971344,-0.518456637859344,0.824826598167419,0.000000000000000,0.648112177848816,-0.711959958076477,-0.270302712917328,0.000000000000000,-1.113720536231995,2.443556785583496,0.472845971584320,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_index_01_R\"\n\t\t\tMatrix: 0.733102321624756,0.452825397253036,0.507454097270966,0.000000000000000,-0.098658517003059,-0.667429566383362,0.738107979297638,0.000000000000000,0.672924160957336,-0.591174125671387,-0.444619208574295,0.000000000000000,-1.150265693664551,2.359544515609741,0.606503248214722,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_index_02_R\"\n\t\t\tMatrix: 0.766428530216217,0.430201500654221,0.476983606815338,0.000000000000000,-0.053469650447369,-0.697276353836060,0.714804708957672,0.000000000000000,0.640099704265594,-0.573351681232452,-0.511409938335419,0.000000000000000,-1.157519340515137,2.310473203659058,0.660771012306213,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_index_03_R\"\n\t\t\tMatrix: 0.786200046539307,0.427918612957001,0.445841401815414,0.000000000000000,-0.049849070608616,-0.675192713737488,0.735954523086548,0.000000000000000,0.615957736968994,-0.600833058357239,-0.509505331516266,0.000000000000000,-1.160149812698364,2.276170253753662,0.695936262607574,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-thumb_01_R\"\n\t\t\tMatrix: -0.870747566223145,0.150710523128510,0.468064606189728,0.000000000000000,0.388418793678284,-0.372913658618927,0.842653930187225,0.000000000000000,0.301544249057770,0.915544331073761,0.266175329685211,0.000000000000000,-1.084509491920471,2.441226005554199,0.481160879135132,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-thumb_02_R\"\n\t\t\tMatrix: 0.888904690742493,-0.132770121097565,-0.438428938388824,0.000000000000000,0.315152287483215,-0.517346441745758,0.795632183551788,0.000000000000000,-0.332455724477768,-0.845413625240326,-0.418029427528381,0.000000000000000,-1.048422694206238,2.406579732894897,0.559449195861816,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-thumb_03_R\"\n\t\t\tMatrix: 0.872855424880981,-0.174273669719696,-0.455797731876373,0.000000000000000,0.286081403493881,-0.573946952819824,0.767294764518738,0.000000000000000,-0.395322918891907,-0.800133168697357,-0.451116770505905,0.000000000000000,-1.024708151817322,2.367650508880615,0.619318783283234,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-palm_02_R\"\n\t\t\tMatrix: 0.485367119312286,0.543322980403900,0.684995293617249,0.000000000000000,-0.306903332471848,-0.627737939357758,0.715370297431946,0.000000000000000,0.818674743175507,-0.557445168495178,-0.137935787439346,0.000000000000000,-1.131832003593445,2.429787635803223,0.451921582221985,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_middle_01_R\"\n\t\t\tMatrix: 0.480655163526535,0.435713648796082,0.761001825332642,0.000000000000000,-0.280682921409607,-0.745722472667694,0.604247033596039,0.000000000000000,0.830774903297424,-0.504035234451294,-0.236138045787811,0.000000000000000,-1.183128952980042,2.324865102767944,0.571491241455078,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_middle_02_R\"\n\t\t\tMatrix: 0.465369552373886,0.483117789030075,0.741638600826263,0.000000000000000,-0.137334287166595,-0.788340091705322,0.599715530872345,0.000000000000000,0.874396800994873,-0.380942285060883,-0.300520896911621,0.000000000000000,-1.204881906509399,2.267071485519409,0.618320465087891,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_middle_03_R\"\n\t\t\tMatrix: 0.527983903884888,0.424699127674103,0.735433936119080,0.000000000000000,-0.153127565979958,-0.804174959659576,0.574329257011414,0.000000000000000,0.835334777832031,-0.415852338075638,-0.359558373689651,0.000000000000000,-1.213949918746948,2.215018272399902,0.657918989658356,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-palm_03_R\"\n\t\t\tMatrix: 0.516751170158386,0.364064037799835,0.774870991706848,0.000000000000000,-0.376900196075439,-0.715916752815247,0.587714910507202,0.000000000000000,0.768709123134613,-0.595752060413361,-0.232735112309456,0.000000000000000,-1.136097431182861,2.420257568359375,0.432370036840439,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_ring_01_R\"\n\t\t\tMatrix: 0.494620800018311,0.275275617837906,0.824362277984619,0.000000000000000,-0.461882859468460,-0.720222294330597,0.517632365226746,0.000000000000000,0.736215829849243,-0.636791229248047,-0.229091987013817,0.000000000000000,-1.198728680610657,2.301290273666382,0.530033409595490,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_ring_02_R\"\n\t\t\tMatrix: 0.532615423202515,0.291463643312454,0.794587552547455,0.000000000000000,-0.147570252418518,-0.892470479011536,0.426285207271576,0.000000000000000,0.833392560482025,-0.344304144382477,-0.432332217693329,0.000000000000000,-1.229935407638550,2.252629041671753,0.565006792545319,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_ring_03_R\"\n\t\t\tMatrix: 0.529071033000946,0.289554744958878,0.797647476196289,0.000000000000000,-0.308623582124710,-0.809951424598694,0.498727977275848,0.000000000000000,0.790464818477631,-0.510035991668701,-0.339158475399017,0.000000000000000,-1.238485574722290,2.200919628143311,0.589705586433411,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-palm_04_R\"\n\t\t\tMatrix: 0.457702606916428,0.262205868959427,0.849562168121338,0.000000000000000,-0.435702770948410,-0.766780376434326,0.471391767263412,0.000000000000000,0.775029420852661,-0.585914492607117,-0.236713618040085,0.000000000000000,-1.143699049949646,2.404265880584717,0.416573852300644,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_pinky_01_R\"\n\t\t\tMatrix: 0.366844683885574,0.189626619219780,0.910750389099121,0.000000000000000,-0.376891732215881,-0.864765644073486,0.331861823797226,0.000000000000000,0.850515604019165,-0.464996665716171,-0.245766013860703,0.000000000000000,-1.205861210823059,2.294868469238281,0.483827829360962,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_pinky_02_R\"\n\t\t\tMatrix: 0.451893448829651,0.231596767902374,0.861483991146088,0.000000000000000,-0.256770789623260,-0.891073346138000,0.374241113662720,0.000000000000000,0.854318618774414,-0.390321671962738,-0.343202948570251,0.000000000000000,-1.224575638771057,2.251928806304932,0.500306308269501,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-f_pinky_03_R\"\n\t\t\tMatrix: 0.549974799156189,0.199937462806702,0.810895860195160,0.000000000000000,-0.196936726570129,-0.912497580051422,0.358557403087616,0.000000000000000,0.811629772186279,-0.356893330812454,-0.462475657463074,0.000000000000000,-1.233843803405762,2.219765424728394,0.513814568519592,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Phone\"\n\t\t\tMatrix: 0.839529335498810,-0.525825321674347,-0.136740639805794,0.000000000000000,-0.326211601495743,-0.689102947711945,0.647087693214417,0.000000000000000,-0.434483319520950,-0.498643010854721,-0.750052690505981,0.000000000000000,-1.173672676086426,2.186469078063965,0.620623469352722,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-thigh_L\"\n\t\t\tMatrix: 0.990913093090057,0.134101986885071,-0.010376354679465,0.000000000000000,0.134491264820099,-0.988886654376984,0.063367843627930,0.000000000000000,-0.001763254287653,-0.064187541604042,-0.997936308383942,0.000000000000000,0.196952834725380,2.154422760009766,0.053135380148888,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-shin_L\"\n\t\t\tMatrix: 0.995994985103607,0.089010402560234,0.008414930664003,0.000000000000000,0.089369259774685,-0.993897020816803,-0.064667604863644,0.000000000000000,0.002607521135360,0.065160691738129,-0.997871398925781,0.000000000000000,0.346644759178162,1.053768873214722,0.123665265738964,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-foot_L\"\n\t\t\tMatrix: 0.999018669128418,0.019726801663637,-0.039649311453104,0.000000000000000,0.043803356587887,-0.571925640106201,0.819135129451752,0.000000000000000,-0.006517496425658,-0.820068180561066,-0.572228670120239,0.000000000000000,0.421706557273865,0.218988418579102,0.069350525736809,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-toe_L\"\n\t\t\tMatrix: 0.999999761581421,-0.000000271946192,-0.000000041443855,0.000000000000000,0.000000041909516,0.152355253696442,0.988325893878937,0.000000000000000,-0.000000241678208,-0.988325715065002,0.152355313301086,0.000000000000000,0.437308102846146,0.015284135937691,0.361104071140289,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-heel_L\"\n\t\t\tMatrix: -0.996467411518097,-0.065373837947845,-0.052713669836521,0.000000000000000,0.083321280777454,-0.848036944866180,-0.523346245288849,0.000000000000000,-0.010489998385310,-0.525889694690704,0.850488185882568,0.000000000000000,0.421706557273865,0.218988418579102,0.069350525736809,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-heel_02_L\"\n\t\t\tMatrix: 0.000000150874257,-0.000000029802322,-1.000000000000000,0.000000000000000,-0.998065054416656,-0.062175389379263,-0.000000104308128,0.000000000000000,-0.062175408005714,0.998065233230591,0.000000029802322,0.000000000000000,0.365234255790710,0.005224704742432,-0.000000536441803,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-thigh_R\"\n\t\t\tMatrix: 0.990913093090057,-0.134101986885071,0.010376354679465,0.000000000000000,-0.134491264820099,-0.988886654376984,0.063367843627930,0.000000000000000,0.001763254287653,-0.064187541604042,-0.997936308383942,0.000000000000000,-0.196952834725380,2.154422760009766,0.053135380148888,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-shin_R\"\n\t\t\tMatrix: 0.995994985103607,-0.089010402560234,-0.008414930664003,0.000000000000000,-0.089369259774685,-0.993897020816803,-0.064667604863644,0.000000000000000,-0.002607521135360,0.065160691738129,-0.997871398925781,0.000000000000000,-0.346644759178162,1.053768873214722,0.123665265738964,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-foot_R\"\n\t\t\tMatrix: 0.999018669128418,-0.019726801663637,0.039649311453104,0.000000000000000,-0.043803356587887,-0.571925640106201,0.819135129451752,0.000000000000000,0.006517496425658,-0.820068180561066,-0.572228670120239,0.000000000000000,-0.421706557273865,0.218988418579102,0.069350525736809,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-toe_R\"\n\t\t\tMatrix: 0.999999761581421,0.000000271946192,0.000000041443855,0.000000000000000,-0.000000041909516,0.152355253696442,0.988325893878937,0.000000000000000,0.000000241678208,-0.988325715065002,0.152355313301086,0.000000000000000,-0.437308102846146,0.015284135937691,0.361104071140289,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-heel_R\"\n\t\t\tMatrix: -0.996467411518097,0.065373837947845,0.052713669836521,0.000000000000000,-0.083321280777454,-0.848036944866180,-0.523346245288849,0.000000000000000,0.010489998385310,-0.525889694690704,0.850488185882568,0.000000000000000,-0.421706557273865,0.218988418579102,0.069350525736809,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::ORG-heel_02_R\"\n\t\t\tMatrix: 0.000000150874257,0.000000029802322,1.000000000000000,0.000000000000000,0.998065054416656,-0.062175389379263,-0.000000104308128,0.000000000000000,0.062175408005714,0.998065233230591,0.000000029802322,0.000000000000000,-0.365234255790710,0.005224704742432,-0.000000536441803,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Camera\"\n\t\t\tMatrix: -1.000000000000000,0.000008243831871,0.000000000030189,0.000000000000000,0.000000000030189,0.000000000000000,1.000000000000000,0.000000000000000,0.000008243831871,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000014842,3.764149427413940,0.104612059891224,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::rig\", \"Limb\" {\n\t}\n\tModel: \"Model::testBody_000\", \"Mesh\" {\n\t}\n\tModel: \"Model::root\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-hips\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-spine\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-chest\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-neck\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-head\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-shoulder_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-upper_arm_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-forearm_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-hand_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-palm_01_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_index_01_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_index_02_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_index_03_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-thumb_01_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-thumb_02_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-thumb_03_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-palm_02_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_middle_01_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_middle_02_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_middle_03_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-palm_03_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_ring_01_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_ring_02_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_ring_03_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-palm_04_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_pinky_01_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_pinky_02_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_pinky_03_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-shoulder_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-upper_arm_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-forearm_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-hand_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-palm_01_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_index_01_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_index_02_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_index_03_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-thumb_01_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-thumb_02_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-thumb_03_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-palm_02_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_middle_01_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_middle_02_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_middle_03_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-palm_03_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_ring_01_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_ring_02_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_ring_03_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-palm_04_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_pinky_01_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_pinky_02_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-f_pinky_03_R\", \"Limb\" {\n\t}\n\tModel: \"Model::Phone\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-thigh_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-shin_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-foot_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-toe_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-heel_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-heel_02_L\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-thigh_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-shin_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-foot_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-toe_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-heel_R\", \"Limb\" {\n\t}\n\tModel: \"Model::ORG-heel_02_R\", \"Limb\" {\n\t}\n\tModel: \"Model::Camera\", \"Limb\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::testSkin\", \"\" {\n\t}\n\tMaterial: \"Material::testSkin__joan_png\", \"\" {\n\t}\n\tTexture: \"Texture::joan_png\", \"TextureVideoClip\" {\n\t}\n\tVideo: \"Video::joan_png\", \"Clip\" {\n\t}\n\tDeformer: \"Deformer::Skin testBody_000\", \"Skin\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-hips\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-spine\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-chest\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-neck\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-head\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-shoulder_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-upper_arm_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-forearm_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-hand_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_01_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_01_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_02_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_03_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_01_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_02_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_03_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_02_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_01_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_02_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_03_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_03_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_01_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_02_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_03_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_04_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_01_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_02_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_03_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-shoulder_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-upper_arm_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-forearm_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-hand_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_01_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_01_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_02_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_index_03_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_01_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_02_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thumb_03_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_02_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_01_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_02_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_middle_03_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_03_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_01_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_02_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_ring_03_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-palm_04_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_01_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_02_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-f_pinky_03_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 Phone\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thigh_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-shin_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-foot_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-toe_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-heel_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-heel_02_L\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-thigh_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-shin_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-foot_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-toe_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-heel_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 ORG-heel_02_R\", \"Cluster\" {\n\t}\n\tDeformer: \"SubDeformer::Cluster testBody_000 Camera\", \"Cluster\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::testBody_000\", \"Model::Scene\"\n\tConnect: \"OO\", \"Model::rig\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::testSkin\", \"Model::testBody_000\"\n\tConnect: \"OO\", \"Material::testSkin__joan_png\", \"Model::testBody_000\"\n\tConnect: \"OO\", \"Texture::joan_png\", \"Model::testBody_000\"\n\tConnect: \"OO\", \"Video::joan_png\", \"Texture::joan_png\"\n\tConnect: \"OO\", \"Deformer::Skin testBody_000\", \"Model::testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-hips\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-spine\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-chest\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-neck\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-head\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-shoulder_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-upper_arm_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-forearm_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-hand_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-palm_01_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_index_01_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_index_02_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_index_03_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-thumb_01_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-thumb_02_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-thumb_03_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-palm_02_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_01_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_02_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_03_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-palm_03_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_01_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_02_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_03_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-palm_04_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_01_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_02_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_03_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-shoulder_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-upper_arm_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-forearm_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-hand_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-palm_01_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_index_01_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_index_02_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_index_03_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-thumb_01_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-thumb_02_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-thumb_03_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-palm_02_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_01_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_02_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_03_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-palm_03_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_01_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_02_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_03_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-palm_04_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_01_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_02_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_03_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 Phone\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-thigh_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-shin_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-foot_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-toe_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-heel_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-heel_02_L\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-thigh_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-shin_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-foot_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-toe_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-heel_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 ORG-heel_02_R\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"SubDeformer::Cluster testBody_000 Camera\", \"Deformer::Skin testBody_000\"\n\tConnect: \"OO\", \"Model::ORG-hips\", \"SubDeformer::Cluster testBody_000 ORG-hips\"\n\tConnect: \"OO\", \"Model::ORG-spine\", \"SubDeformer::Cluster testBody_000 ORG-spine\"\n\tConnect: \"OO\", \"Model::ORG-chest\", \"SubDeformer::Cluster testBody_000 ORG-chest\"\n\tConnect: \"OO\", \"Model::ORG-neck\", \"SubDeformer::Cluster testBody_000 ORG-neck\"\n\tConnect: \"OO\", \"Model::ORG-head\", \"SubDeformer::Cluster testBody_000 ORG-head\"\n\tConnect: \"OO\", \"Model::ORG-shoulder_L\", \"SubDeformer::Cluster testBody_000 ORG-shoulder_L\"\n\tConnect: \"OO\", \"Model::ORG-upper_arm_L\", \"SubDeformer::Cluster testBody_000 ORG-upper_arm_L\"\n\tConnect: \"OO\", \"Model::ORG-forearm_L\", \"SubDeformer::Cluster testBody_000 ORG-forearm_L\"\n\tConnect: \"OO\", \"Model::ORG-hand_L\", \"SubDeformer::Cluster testBody_000 ORG-hand_L\"\n\tConnect: \"OO\", \"Model::ORG-palm_01_L\", \"SubDeformer::Cluster testBody_000 ORG-palm_01_L\"\n\tConnect: \"OO\", \"Model::ORG-f_index_01_L\", \"SubDeformer::Cluster testBody_000 ORG-f_index_01_L\"\n\tConnect: \"OO\", \"Model::ORG-f_index_02_L\", \"SubDeformer::Cluster testBody_000 ORG-f_index_02_L\"\n\tConnect: \"OO\", \"Model::ORG-f_index_03_L\", \"SubDeformer::Cluster testBody_000 ORG-f_index_03_L\"\n\tConnect: \"OO\", \"Model::ORG-thumb_01_L\", \"SubDeformer::Cluster testBody_000 ORG-thumb_01_L\"\n\tConnect: \"OO\", \"Model::ORG-thumb_02_L\", \"SubDeformer::Cluster testBody_000 ORG-thumb_02_L\"\n\tConnect: \"OO\", \"Model::ORG-thumb_03_L\", \"SubDeformer::Cluster testBody_000 ORG-thumb_03_L\"\n\tConnect: \"OO\", \"Model::ORG-palm_02_L\", \"SubDeformer::Cluster testBody_000 ORG-palm_02_L\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_01_L\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_01_L\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_02_L\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_02_L\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_03_L\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_03_L\"\n\tConnect: \"OO\", \"Model::ORG-palm_03_L\", \"SubDeformer::Cluster testBody_000 ORG-palm_03_L\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_01_L\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_01_L\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_02_L\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_02_L\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_03_L\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_03_L\"\n\tConnect: \"OO\", \"Model::ORG-palm_04_L\", \"SubDeformer::Cluster testBody_000 ORG-palm_04_L\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_01_L\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_01_L\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_02_L\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_02_L\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_03_L\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_03_L\"\n\tConnect: \"OO\", \"Model::ORG-shoulder_R\", \"SubDeformer::Cluster testBody_000 ORG-shoulder_R\"\n\tConnect: \"OO\", \"Model::ORG-upper_arm_R\", \"SubDeformer::Cluster testBody_000 ORG-upper_arm_R\"\n\tConnect: \"OO\", \"Model::ORG-forearm_R\", \"SubDeformer::Cluster testBody_000 ORG-forearm_R\"\n\tConnect: \"OO\", \"Model::ORG-hand_R\", \"SubDeformer::Cluster testBody_000 ORG-hand_R\"\n\tConnect: \"OO\", \"Model::ORG-palm_01_R\", \"SubDeformer::Cluster testBody_000 ORG-palm_01_R\"\n\tConnect: \"OO\", \"Model::ORG-f_index_01_R\", \"SubDeformer::Cluster testBody_000 ORG-f_index_01_R\"\n\tConnect: \"OO\", \"Model::ORG-f_index_02_R\", \"SubDeformer::Cluster testBody_000 ORG-f_index_02_R\"\n\tConnect: \"OO\", \"Model::ORG-f_index_03_R\", \"SubDeformer::Cluster testBody_000 ORG-f_index_03_R\"\n\tConnect: \"OO\", \"Model::ORG-thumb_01_R\", \"SubDeformer::Cluster testBody_000 ORG-thumb_01_R\"\n\tConnect: \"OO\", \"Model::ORG-thumb_02_R\", \"SubDeformer::Cluster testBody_000 ORG-thumb_02_R\"\n\tConnect: \"OO\", \"Model::ORG-thumb_03_R\", \"SubDeformer::Cluster testBody_000 ORG-thumb_03_R\"\n\tConnect: \"OO\", \"Model::ORG-palm_02_R\", \"SubDeformer::Cluster testBody_000 ORG-palm_02_R\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_01_R\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_01_R\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_02_R\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_02_R\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_03_R\", \"SubDeformer::Cluster testBody_000 ORG-f_middle_03_R\"\n\tConnect: \"OO\", \"Model::ORG-palm_03_R\", \"SubDeformer::Cluster testBody_000 ORG-palm_03_R\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_01_R\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_01_R\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_02_R\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_02_R\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_03_R\", \"SubDeformer::Cluster testBody_000 ORG-f_ring_03_R\"\n\tConnect: \"OO\", \"Model::ORG-palm_04_R\", \"SubDeformer::Cluster testBody_000 ORG-palm_04_R\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_01_R\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_01_R\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_02_R\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_02_R\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_03_R\", \"SubDeformer::Cluster testBody_000 ORG-f_pinky_03_R\"\n\tConnect: \"OO\", \"Model::Phone\", \"SubDeformer::Cluster testBody_000 Phone\"\n\tConnect: \"OO\", \"Model::ORG-thigh_L\", \"SubDeformer::Cluster testBody_000 ORG-thigh_L\"\n\tConnect: \"OO\", \"Model::ORG-shin_L\", \"SubDeformer::Cluster testBody_000 ORG-shin_L\"\n\tConnect: \"OO\", \"Model::ORG-foot_L\", \"SubDeformer::Cluster testBody_000 ORG-foot_L\"\n\tConnect: \"OO\", \"Model::ORG-toe_L\", \"SubDeformer::Cluster testBody_000 ORG-toe_L\"\n\tConnect: \"OO\", \"Model::ORG-heel_L\", \"SubDeformer::Cluster testBody_000 ORG-heel_L\"\n\tConnect: \"OO\", \"Model::ORG-heel_02_L\", \"SubDeformer::Cluster testBody_000 ORG-heel_02_L\"\n\tConnect: \"OO\", \"Model::ORG-thigh_R\", \"SubDeformer::Cluster testBody_000 ORG-thigh_R\"\n\tConnect: \"OO\", \"Model::ORG-shin_R\", \"SubDeformer::Cluster testBody_000 ORG-shin_R\"\n\tConnect: \"OO\", \"Model::ORG-foot_R\", \"SubDeformer::Cluster testBody_000 ORG-foot_R\"\n\tConnect: \"OO\", \"Model::ORG-toe_R\", \"SubDeformer::Cluster testBody_000 ORG-toe_R\"\n\tConnect: \"OO\", \"Model::ORG-heel_R\", \"SubDeformer::Cluster testBody_000 ORG-heel_R\"\n\tConnect: \"OO\", \"Model::ORG-heel_02_R\", \"SubDeformer::Cluster testBody_000 ORG-heel_02_R\"\n\tConnect: \"OO\", \"Model::Camera\", \"SubDeformer::Cluster testBody_000 Camera\"\n\tConnect: \"OO\", \"Model::root\", \"Model::rig\"\n\tConnect: \"OO\", \"Model::ORG-hips\", \"Model::root\"\n\tConnect: \"OO\", \"Model::ORG-spine\", \"Model::ORG-hips\"\n\tConnect: \"OO\", \"Model::ORG-chest\", \"Model::ORG-spine\"\n\tConnect: \"OO\", \"Model::ORG-neck\", \"Model::ORG-chest\"\n\tConnect: \"OO\", \"Model::ORG-head\", \"Model::ORG-neck\"\n\tConnect: \"OO\", \"Model::ORG-shoulder_L\", \"Model::ORG-chest\"\n\tConnect: \"OO\", \"Model::ORG-upper_arm_L\", \"Model::ORG-shoulder_L\"\n\tConnect: \"OO\", \"Model::ORG-forearm_L\", \"Model::ORG-upper_arm_L\"\n\tConnect: \"OO\", \"Model::ORG-hand_L\", \"Model::ORG-forearm_L\"\n\tConnect: \"OO\", \"Model::ORG-palm_01_L\", \"Model::ORG-hand_L\"\n\tConnect: \"OO\", \"Model::ORG-f_index_01_L\", \"Model::ORG-palm_01_L\"\n\tConnect: \"OO\", \"Model::ORG-f_index_02_L\", \"Model::ORG-f_index_01_L\"\n\tConnect: \"OO\", \"Model::ORG-f_index_03_L\", \"Model::ORG-f_index_02_L\"\n\tConnect: \"OO\", \"Model::ORG-thumb_01_L\", \"Model::ORG-palm_01_L\"\n\tConnect: \"OO\", \"Model::ORG-thumb_02_L\", \"Model::ORG-thumb_01_L\"\n\tConnect: \"OO\", \"Model::ORG-thumb_03_L\", \"Model::ORG-thumb_02_L\"\n\tConnect: \"OO\", \"Model::ORG-palm_02_L\", \"Model::ORG-hand_L\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_01_L\", \"Model::ORG-palm_02_L\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_02_L\", \"Model::ORG-f_middle_01_L\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_03_L\", \"Model::ORG-f_middle_02_L\"\n\tConnect: \"OO\", \"Model::ORG-palm_03_L\", \"Model::ORG-hand_L\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_01_L\", \"Model::ORG-palm_03_L\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_02_L\", \"Model::ORG-f_ring_01_L\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_03_L\", \"Model::ORG-f_ring_02_L\"\n\tConnect: \"OO\", \"Model::ORG-palm_04_L\", \"Model::ORG-hand_L\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_01_L\", \"Model::ORG-palm_04_L\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_02_L\", \"Model::ORG-f_pinky_01_L\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_03_L\", \"Model::ORG-f_pinky_02_L\"\n\tConnect: \"OO\", \"Model::ORG-shoulder_R\", \"Model::ORG-chest\"\n\tConnect: \"OO\", \"Model::ORG-upper_arm_R\", \"Model::ORG-shoulder_R\"\n\tConnect: \"OO\", \"Model::ORG-forearm_R\", \"Model::ORG-upper_arm_R\"\n\tConnect: \"OO\", \"Model::ORG-hand_R\", \"Model::ORG-forearm_R\"\n\tConnect: \"OO\", \"Model::ORG-palm_01_R\", \"Model::ORG-hand_R\"\n\tConnect: \"OO\", \"Model::ORG-f_index_01_R\", \"Model::ORG-palm_01_R\"\n\tConnect: \"OO\", \"Model::ORG-f_index_02_R\", \"Model::ORG-f_index_01_R\"\n\tConnect: \"OO\", \"Model::ORG-f_index_03_R\", \"Model::ORG-f_index_02_R\"\n\tConnect: \"OO\", \"Model::ORG-thumb_01_R\", \"Model::ORG-palm_01_R\"\n\tConnect: \"OO\", \"Model::ORG-thumb_02_R\", \"Model::ORG-thumb_01_R\"\n\tConnect: \"OO\", \"Model::ORG-thumb_03_R\", \"Model::ORG-thumb_02_R\"\n\tConnect: \"OO\", \"Model::ORG-palm_02_R\", \"Model::ORG-hand_R\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_01_R\", \"Model::ORG-palm_02_R\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_02_R\", \"Model::ORG-f_middle_01_R\"\n\tConnect: \"OO\", \"Model::ORG-f_middle_03_R\", \"Model::ORG-f_middle_02_R\"\n\tConnect: \"OO\", \"Model::ORG-palm_03_R\", \"Model::ORG-hand_R\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_01_R\", \"Model::ORG-palm_03_R\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_02_R\", \"Model::ORG-f_ring_01_R\"\n\tConnect: \"OO\", \"Model::ORG-f_ring_03_R\", \"Model::ORG-f_ring_02_R\"\n\tConnect: \"OO\", \"Model::ORG-palm_04_R\", \"Model::ORG-hand_R\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_01_R\", \"Model::ORG-palm_04_R\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_02_R\", \"Model::ORG-f_pinky_01_R\"\n\tConnect: \"OO\", \"Model::ORG-f_pinky_03_R\", \"Model::ORG-f_pinky_02_R\"\n\tConnect: \"OO\", \"Model::Phone\", \"Model::ORG-hand_R\"\n\tConnect: \"OO\", \"Model::ORG-thigh_L\", \"Model::ORG-hips\"\n\tConnect: \"OO\", \"Model::ORG-shin_L\", \"Model::ORG-thigh_L\"\n\tConnect: \"OO\", \"Model::ORG-foot_L\", \"Model::ORG-shin_L\"\n\tConnect: \"OO\", \"Model::ORG-toe_L\", \"Model::ORG-foot_L\"\n\tConnect: \"OO\", \"Model::ORG-heel_L\", \"Model::ORG-shin_L\"\n\tConnect: \"OO\", \"Model::ORG-heel_02_L\", \"Model::ORG-heel_L\"\n\tConnect: \"OO\", \"Model::ORG-thigh_R\", \"Model::ORG-hips\"\n\tConnect: \"OO\", \"Model::ORG-shin_R\", \"Model::ORG-thigh_R\"\n\tConnect: \"OO\", \"Model::ORG-foot_R\", \"Model::ORG-shin_R\"\n\tConnect: \"OO\", \"Model::ORG-toe_R\", \"Model::ORG-foot_R\"\n\tConnect: \"OO\", \"Model::ORG-heel_R\", \"Model::ORG-shin_R\"\n\tConnect: \"OO\", \"Model::ORG-heel_02_R\", \"Model::ORG-heel_R\"\n\tConnect: \"OO\", \"Model::Camera\", \"Model::rig\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Models/note.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2014\n\t\tMonth: 06\n\t\tDay: 05\n\t\tHour: 19\n\t\tMinute: 20\n\t\tSecond: 05\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2014-06-05 19:20:05:000\"\nCreator: \"Blender version 2.70 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-90.000009334538021,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.062940,-0.159689,-0.232200,0.048314,-0.180000,0.232200,0.062940,0.159689,-0.232200,0.048314,0.180000,0.232200,\n\t\t          0.021662,-0.106460,-0.232200,-0.001937,-0.053230,-0.232200,-0.019131,0.000000,-0.232200,-0.001937,0.053230,-0.232200,\n\t\t          0.021662,0.106460,-0.232200,0.024367,0.120000,0.232200,0.014428,0.060000,0.232200,0.006805,0.000000,0.232200,\n\t\t          0.014428,-0.060000,0.232200,0.024367,-0.120000,0.232200\n\t\tPolygonVertexIndex: 9,8,2,-4,1,0,4,-14,13,4,5,-13,12,5,6,-12,11,6,7,-11,10,7,8,-10\n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.918091,-0.396282,0.008373,0.919791,-0.392336,0.007588,0.866146,-0.498932,0.029300,0.866146,-0.498932,0.029300,\n\t\t\t         0.866146,0.498932,0.029300,0.866146,0.498932,0.029300,0.919791,0.392336,0.007588,0.918091,0.396282,0.008373,\n\t\t\t         0.918091,0.396282,0.008373,0.919791,0.392336,0.007588,0.968203,0.248544,-0.028448,0.967953,0.249563,-0.028020,\n\t\t\t         0.967953,0.249563,-0.028020,0.968203,0.248544,-0.028448,0.999036,0.000000,-0.043904,0.999036,0.000000,-0.043904,\n\t\t\t         0.999036,0.000000,-0.043904,0.999036,0.000000,-0.043904,0.968203,-0.248544,-0.028448,0.967953,-0.249563,-0.028020,\n\t\t\t         0.967953,-0.249563,-0.028020,0.968203,-0.248544,-0.028448,0.919791,-0.392336,0.007588,0.918091,-0.396282,0.008373\n\t\t}\n\t\tLayerElementSmoothing: 0 {\n\t\t\tVersion: 102\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByPolygon\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tSmoothing: 1,1,1,1,1,1\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.666633,0.000100,0.999900,0.999900,0.166733,0.000100,0.333367,0.999900,0.000100,0.999900,0.833267,0.000100,\n\t\t\t    0.500000,0.000100,0.833267,0.999900,0.999900,0.000100,0.333367,0.000100,0.166733,0.999900,0.000100,0.000100,\n\t\t\t    0.500000,0.999900,0.666633,0.999900\n\t\t\tUVIndex: 7,5,8,1,4,11,2,10,10,2,9,3,3,9,6,12,12,6,0,13,13,0,5,7\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementSmoothing\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementTexture\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.5000\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",12.3\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",12.3\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Models/papers.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2014\n\t\tMonth: 02\n\t\tDay: 19\n\t\tHour: 17\n\t\tMinute: 07\n\t\tSecond: 02\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2014-02-19 17:07:02:000\"\nCreator: \"Blender version 2.66 (sub 1)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 5\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Texture\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Video\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.274524,-0.024908,0.668870,-0.362976,-0.024908,0.668870,0.274524,-0.024908,-0.156130,-0.362976,-0.024908,-0.156130,0.386614,-0.018911,0.638641,-0.248321,-0.018911,0.695779,0.312670,-0.018911,-0.183039\n\t\t,-0.322264,-0.018911,-0.125900,0.228475,-0.017095,0.569769,-0.405352,-0.017095,0.501440,0.316901,-0.017095,-0.250479,-0.316927,-0.017095,-0.318808,0.032020,-0.013460,0.281725,-0.585027,-0.013460,0.121540\n\t\t,0.239319,-0.013460,-0.516806,-0.377728,-0.013460,-0.676992,0.163874,-0.005804,0.156580,-0.145456,-0.005804,-0.400844,0.885246,-0.005804,-0.243729,0.575916,-0.005804,-0.801153\n\t\tPolygonVertexIndex: 1,0,2,-4,5,4,6,-8,9,8,10,-12,13,12,14,-16,17,16,18,-20\n\t\tEdges: \n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByVertice\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.303775,0.696093,0.303775,0.392836,0.696225,0.392836,0.696225,0.696093,0.303775,0.000173,0.607032,0.000172,0.607032,0.392623\n\t\t\t ,0.303775,0.392623,0.303430,0.785419,0.000173,0.785419,0.000172,0.392968,0.303430,0.392968,0.303430,0.392623,0.000173,0.392623\n\t\t\t ,0.000172,0.000172,0.303430,0.000172,0.303775,0.696225,0.303775,0.392968,0.696225,0.392968,0.696225,0.696225\n\t\t\tUVIndex: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: 0\n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementTexture\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tMaterial: \"Material::Material__untitled\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2500\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",9.6\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tVideo: \"Video::untitled\", \"Clip\" {\n\t\tType: \"Clip\"\n\t\tProperties60:  {\n\t\t\tProperty: \"FrameRate\", \"double\", \"\",0\n\t\t\tProperty: \"LastFrame\", \"int\", \"\",0\n\t\t\tProperty: \"Width\", \"int\", \"\",0\n\t\t\tProperty: \"Height\", \"int\", \"\",0\n\t\t\tProperty: \"Path\", \"charptr\", \"\", \"papers.jpg\"\n\t\t\tProperty: \"StartFrame\", \"int\", \"\",0\n\t\t\tProperty: \"StopFrame\", \"int\", \"\",0\n\t\t\tProperty: \"PlaySpeed\", \"double\", \"\",1\n\t\t\tProperty: \"Offset\", \"KTime\", \"\",0\n\t\t\tProperty: \"InterlaceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"FreeRunning\", \"bool\", \"\",0\n\t\t\tProperty: \"Loop\", \"bool\", \"\",0\n\t\t\tProperty: \"AccessMode\", \"enum\", \"\",0\n\t\t}\n\t\tUseMipMap: 0\n\t\tFilename: \"papers.jpg\"\n\t\tRelativeFilename: \"papers.jpg\"\n\t}\n\tTexture: \"Texture::untitled\", \"TextureVideoClip\" {\n\t\tType: \"TextureVideoClip\"\n\t\tVersion: 202\n\t\tTextureName: \"Texture::untitled\"\n\t\tProperties60:  {\n\t\t\tProperty: \"Translation\", \"Vector\", \"A+\",0,0,0\n\t\t\tProperty: \"Rotation\", \"Vector\", \"A+\",0,0,0\n\t\t\tProperty: \"Scaling\", \"Vector\", \"A+\",1,1,1\n\t\t\tProperty: \"Texture alpha\", \"Number\", \"A+\",0\n\t\t\tProperty: \"TextureTypeUse\", \"enum\", \"\",0\n\t\t\tProperty: \"CurrentTextureBlendMode\", \"enum\", \"\",1\n\t\t\tProperty: \"UseMaterial\", \"bool\", \"\",0\n\t\t\tProperty: \"UseMipMap\", \"bool\", \"\",0\n\t\t\tProperty: \"CurrentMappingType\", \"enum\", \"\",0\n\t\t\tProperty: \"UVSwap\", \"bool\", \"\",0\n\t\t\tProperty: \"WrapModeU\", \"enum\", \"\",0\n\t\t\tProperty: \"WrapModeV\", \"enum\", \"\",0\n\t\t\tProperty: \"TextureRotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TextureScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"VideoProperty\", \"object\", \"\"\n\t\t}\n\t\tMedia: \"Video::untitled\"\n\t\tFileName: \"papers.jpg\"\n\t\tRelativeFilename: \"papers.jpg\"\n\t\tModelUVTranslation: 0,0\n\t\tModelUVScaling: 1,1\n\t\tTexture_Alpha_Source: \"None\"\n\t\tCropping: 0,0,0,0\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material__untitled\", \"\" {\n\t}\n\tTexture: \"Texture::untitled\", \"TextureVideoClip\" {\n\t}\n\tVideo: \"Video::untitled\", \"Clip\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material__untitled\", \"Model::Cube\"\n\tConnect: \"OO\", \"Texture::untitled\", \"Model::Cube\"\n\tConnect: \"OO\", \"Video::untitled\", \"Texture::untitled\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Models/phone.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2014\n\t\tMonth: 02\n\t\tDay: 05\n\t\tHour: 13\n\t\tMinute: 17\n\t\tSecond: 46\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2014-02-05 13:17:46:000\"\nCreator: \"Blender version 2.66 (sub 1)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: -0.012133,0.182942,-0.072498,-0.012133,0.172515,-0.082925,-0.012133,0.179888,-0.079871,-0.012133,-0.172464,-0.082925,-0.012133,-0.182891,-0.072498,-0.012133,-0.179837,-0.079871,-0.012134,-0.182891,0.072498\n\t\t,-0.012134,-0.172464,0.082925,-0.012134,-0.179837,0.079871,-0.012134,0.172515,0.082925,-0.012134,0.182942,0.072498,-0.012134,0.179888,0.079871,0.012133,0.172514,-0.082925,0.012133,0.182942,-0.072498\n\t\t,0.012133,0.179888,-0.079871,0.012133,-0.182891,-0.072498,0.012133,-0.172464,-0.082925,0.012133,-0.179837,-0.079871,0.012133,-0.172464,0.082925,0.012133,-0.182891,0.072498,0.012133,-0.179837,0.079871\n\t\t,0.012133,0.182942,0.072498,0.012133,0.172515,0.082925,0.012133,0.179888,0.079871\n\t\tPolygonVertexIndex: 13,0,10,-22,4,15,19,-7,7,18,22,-10,22,18,-21,23,22,-21,23,20,-20,21,23,-20,21,19,-16,13,21,-16,13,15,-18,14,13,-18,14,17,-17,12,14,-17\n\t\t,1,12,16,-4,0,13,14,-3,2,14,12,-2,3,16,17,-6,5,17,15,-5,6,19,20,-9,8,20,18,-8,9,22,23,-12,11,23,21,-11,8,7,-10,8,9,-12,6,8,-12,6,11,-11\n\t\t,4,6,-11,0,4,-11,0,5,-5,0,2,-6,2,3,-6,2,1,-4\n\t\tEdges: \n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByVertice\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: -0.665700256824493,0.731864392757416,-0.145573288202286,-0.665700256824493,0.145573288202286,-0.731864392757416\n\t\t\t ,-0.630237758159637,0.548966944217682,-0.548966944217682,-0.665700256824493,-0.145573288202286,-0.731864392757416\n\t\t\t ,-0.665700256824493,-0.731833875179291,-0.145573288202286,-0.630237758159637,-0.548966944217682,-0.548966944217682\n\t\t\t ,-0.665700256824493,-0.731833875179291,0.145573288202286,-0.665700256824493,-0.145573288202286,0.731864392757416\n\t\t\t ,-0.630237758159637,-0.548966944217682,0.548966944217682,-0.665700256824493,0.145573288202286,0.731864392757416\n\t\t\t ,-0.665700256824493,0.731864392757416,0.145573288202286,-0.630237758159637,0.548966944217682,0.548966944217682\n\t\t\t ,0.665700256824493,0.145573288202286,-0.731833875179291,0.665700256824493,0.731833875179291,-0.145573288202286\n\t\t\t ,0.630237758159637,0.548966944217682,-0.548966944217682,0.665700256824493,-0.731864392757416,-0.145573288202286\n\t\t\t ,0.665700256824493,-0.145573288202286,-0.731833875179291,0.630237758159637,-0.548966944217682,-0.548966944217682\n\t\t\t ,0.665700256824493,-0.145573288202286,0.731864392757416,0.665700256824493,-0.731864392757416,0.145573288202286\n\t\t\t ,0.630237758159637,-0.548966944217682,0.548966944217682,0.665700256824493,0.731833875179291,0.145573288202286\n\t\t\t ,0.665700256824493,0.145573288202286,0.731864392757416,0.630237758159637,0.548966944217682,0.548966944217682\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.750000,0.066987,0.500000,0.000000\n\t\t\t ,0.250000,0.066987,0.933013,0.250000,0.750000,0.066987,0.250000,0.066987,0.933013,0.250000,0.250000,0.066987,0.066987,0.250000\n\t\t\t ,1.000000,0.500000,0.933013,0.250000,0.066987,0.250000,1.000000,0.500000,0.066987,0.250000,0.000000,0.500000,0.933013,0.750000\n\t\t\t ,1.000000,0.500000,0.000000,0.500000,0.933013,0.750000,0.000000,0.500000,0.066987,0.750000,0.750000,0.933013,0.933013,0.750000\n\t\t\t ,0.066987,0.750000,0.750000,0.933013,0.066987,0.750000,0.250000,0.933013,0.500000,1.000000,0.750000,0.933013,0.250000,0.933013\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,1.000000,0.250000,0.066987,0.066987,0.250000,0.000000,0.500000,0.250000,0.066987,0.000000,0.500000,0.066987,0.750000\n\t\t\t ,0.500000,0.000000,0.250000,0.066987,0.066987,0.750000,0.500000,0.000000,0.066987,0.750000,0.250000,0.933013,0.750000,0.066987\n\t\t\t ,0.500000,0.000000,0.250000,0.933013,0.500000,1.000000,0.750000,0.066987,0.250000,0.933013,0.500000,1.000000,0.933013,0.250000\n\t\t\t ,0.750000,0.066987,0.500000,1.000000,0.750000,0.933013,0.933013,0.250000,0.750000,0.933013,1.000000,0.500000,0.933013,0.250000\n\t\t\t ,0.750000,0.933013,0.933013,0.750000,1.000000,0.500000\n\t\t\tUVIndex: 0,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\n\t\t\t\t,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2500\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",9.6\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Models/plane.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: 2014\n\t\tMonth: 02\n\t\tDay: 05\n\t\tHour: 09\n\t\tMinute: 56\n\t\tSecond: 04\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}\nCreationTime: \"2014-02-05 09:56:04:000\"\nCreator: \"Blender version 2.66 (sub 1)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: 3\n\tObjectType: \"Model\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Geometry\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Material\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t\tVersion: 232\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n\t\t\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TranslationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"TranslationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationOrder\", \"enum\", \"\",0\n\t\t\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n\t\t\tProperty: \"AxisLen\", \"double\", \"\",10\n\t\t\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationActive\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"RotationMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"RotationStiffnessX\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessY\", \"double\", \"\",0\n\t\t\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0\n\t\t\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleX\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleY\", \"double\", \"\",0\n\t\t\tProperty: \"PreferedAngleZ\", \"double\", \"\",0\n\t\t\tProperty: \"InheritType\", \"enum\", \"\",0\n\t\t\tProperty: \"ScalingActive\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"ScalingMinX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMinZ\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxX\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxY\", \"bool\", \"\",0\n\t\t\tProperty: \"ScalingMaxZ\", \"bool\", \"\",0\n\t\t\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n\t\t\tProperty: \"LookAtProperty\", \"object\", \"\"\n\t\t\tProperty: \"UpVectorProperty\", \"object\", \"\"\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n\t\t\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.000000,-0.500000,-0.500000,-0.000000,-0.500000,0.500000,0.000000,0.500000,-0.500000,-0.000000,0.500000,0.500000\n\t\tPolygonVertexIndex: 1,0,2,-4\n\t\tEdges: \n\t\tGeometryVersion: 124\n\t\tLayerElementNormal: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"ByVertice\"\n\t\t\tReferenceInformationType: \"Direct\"\n\t\t\tNormals: 1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000\n\t\t\t ,1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVMap\"\n\t\t\tMappingInformationType: \"ByPolygonVertex\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tUV: 0.000100,0.000100,0.999900,0.000100,0.999900,0.999900,0.000100,0.999900\n\t\t\tUVIndex: 0,1,2,3\n\t\t}\n\t\tLayerElementTexture: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"NoMappingInformation\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tBlendMode: \"Translucent\"\n\t\t\tTextureAlpha: 1\n\t\t\tTextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n\t\tLayer: 0 {\n\t\t\tVersion: 100\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementNormal\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementMaterial\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t\tLayerElement:  {\n\t\t\t\tType: \"LayerElementUV\"\n\t\t\t\tTypedIndex: 0\n\t\t\t}\n\t\t}\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"lambert\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Lambert\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",0.8000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",1.0000,1.0000,1.0000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2500\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",1.0,1.0,1.0\n\t\t\tProperty: \"Shininess\", \"double\", \"\",9.6\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: 1\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Cube\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::Cube\", \"Mesh\" {\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}\n\tMaterial: \"Material::Material\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::Cube\", \"Model::Scene\"\n\tConnect: \"OO\", \"Material::Material\", \"Model::Cube\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Content/Models/sphere.fbx",
    "content": "; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\nFBXHeaderExtension:  {\n    FBXHeaderVersion: 1003\n    FBXVersion: 6100\n    CreationTimeStamp:  {\n        Version: 1000\n        Year: 2010\n        Month: 12\n        Day: 27\n        Hour: 13\n        Minute: 18\n        Second: 59\n        Millisecond: 0\n    }\n    Creator: \"FBX SDK/FBX Plugins build 20070228\"\n    OtherFlags:  {\n        FlagPLE: 0\n    }\n}\nCreationTime: \"2010-12-27 13:18:59:000\"\nCreator: \"Blender version 2.55 (sub 0)\"\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n    Version: 100\n    Count: 12\n    ObjectType: \"Model\" {\n        Count: 10\n    }\n    ObjectType: \"Geometry\" {\n        Count: 1\n    }\n    ObjectType: \"Material\" {\n        Count: 1\n    }\n    ObjectType: \"Pose\" {\n        Count: 1\n    }\n    ObjectType: \"GlobalSettings\" {\n        Count: 1\n    }\n}\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {\n    Model: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n        Version: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n            Property: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n            Property: \"Camera Index\", \"Integer\", \"A+\",100\n        }\n        MultiLayer: 0\n        MultiTake: 1\n        Hidden: \"True\"\n        Shading: W\n        Culling: \"CullingOff\"\n        Version: 101\n        Name: \"Model::Camera Switcher\"\n        CameraId: 0\n        CameraName: 100\n        CameraIndexName:\n    }\n\tModel: \"Model::blend_root\", \"Null\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n        }\n        MultiLayer: 0\n        MultiTake: 1\n        Shading: Y\n        Culling: \"CullingOff\"\n        TypeFlags: \"Null\"\n    }\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",-90.000000000000000,-0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Size\", \"double\", \"\",100\n\t\t\tProperty: \"Look\", \"enum\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tVertices: 0.000000,0.000000,-1.000000,0.723600,-0.525720,-0.447215,-0.276385,-0.850640,-0.447215,-0.894425,0.000000,-0.447215,-0.276385,0.850640,-0.447215,0.723600,0.525720,-0.447215,0.276385,-0.850640,0.447215\n\t\t,-0.723600,-0.525720,0.447215,-0.723600,0.525720,0.447215,0.276385,0.850640,0.447215,0.894425,0.000000,0.447215,0.000000,0.000000,1.000000,0.425323,-0.309011,-0.850654,-0.162456,-0.499995,-0.850654\n\t\t,0.262869,-0.809012,-0.525738,0.425323,0.309011,-0.850654,0.850648,0.000000,-0.525736,-0.525730,0.000000,-0.850652,-0.688189,-0.499997,-0.525736,-0.162456,0.499995,-0.850654,-0.688189,0.499997,-0.525736\n\t\t,0.262869,0.809012,-0.525738,0.951058,0.309013,0.000000,0.951058,-0.309013,0.000000,0.587786,-0.809017,0.000000,0.000000,-1.000000,0.000000,-0.587786,-0.809017,0.000000,-0.951058,-0.309013,0.000000\n\t\t,-0.951058,0.309013,0.000000,-0.587786,0.809017,0.000000,0.000000,1.000000,0.000000,0.587786,0.809017,0.000000,0.688189,-0.499997,0.525736,-0.262869,-0.809012,0.525738,-0.850648,0.000000,0.525736\n\t\t,-0.262869,0.809012,0.525738,0.688189,0.499997,0.525736,0.525730,0.000000,0.850652,0.162456,-0.499995,0.850654,-0.425323,-0.309011,0.850654,-0.425323,0.309011,0.850654,0.162456,0.499995,0.850654\n\t\t,0.221076,-0.160619,-0.961939,0.597194,-0.433882,-0.674615,-0.084442,-0.259889,-0.961939,-0.228103,-0.702042,-0.674615,0.512753,-0.693775,-0.505727,-0.007026,-0.862665,-0.505728,0.221076,0.160619,-0.961939\n\t\t,0.597194,0.433882,-0.674615,0.818272,-0.273262,-0.505726,0.818272,0.273262,-0.505726,-0.273266,0.000000,-0.961939,-0.738174,0.000000,-0.674610,-0.822618,-0.259890,-0.505724,-0.501373,-0.702043,-0.505727\n\t\t,-0.084442,0.259889,-0.961939,-0.228103,0.702042,-0.674615,-0.501373,0.702043,-0.505727,-0.822618,0.259890,-0.505724,-0.007026,0.862665,-0.505728,0.512753,0.693775,-0.505727,0.959253,0.160620,0.232455\n\t\t,0.870465,0.433883,-0.232456,0.870465,-0.433883,-0.232456,0.959253,-0.160620,0.232455,0.681641,-0.693779,-0.232457,0.449185,-0.862668,0.232457,-0.143661,-0.961938,-0.232456,0.143661,-0.961938,0.232456\n\t\t,-0.681641,-0.693779,0.232457,-0.449185,-0.862668,-0.232457,-0.870465,-0.433883,0.232456,-0.959253,-0.160620,-0.232455,-0.870465,0.433883,0.232456,-0.959253,0.160620,-0.232455,-0.681641,0.693779,0.232457\n\t\t,-0.449185,0.862668,-0.232457,0.143661,0.961938,0.232456,-0.143661,0.961938,-0.232456,0.449185,0.862668,0.232457,0.681641,0.693779,-0.232457,0.822618,-0.259890,0.505724,0.501373,-0.702043,0.505727\n\t\t,-0.512753,-0.693775,0.505727,0.007026,-0.862665,0.505728,-0.818272,0.273262,0.505726,-0.818272,-0.273262,0.505726,0.007026,0.862665,0.505728,-0.512753,0.693775,0.505727,0.501373,0.702043,0.505727\n\t\t,0.822618,0.259890,0.505724,0.738174,0.000000,0.674610,0.273266,0.000000,0.961939,0.084442,-0.259889,0.961939,0.228103,-0.702042,0.674615,-0.221076,-0.160619,0.961939,-0.597194,-0.433882,0.674615\n\t\t,-0.221076,0.160619,0.961939,-0.597194,0.433882,0.674615,0.228103,0.702042,0.674615,0.084442,0.259889,0.961939,0.361804,-0.587779,-0.723612,0.138197,-0.425320,-0.894430,0.052790,-0.688185,-0.723612\n\t\t,0.670817,-0.162457,-0.723611,0.447210,0.000000,-0.894429,0.670817,0.162457,-0.723611,-0.447211,-0.525727,-0.723611,-0.361800,-0.262863,-0.894429,-0.638195,-0.262864,-0.723609,-0.638195,0.262864,-0.723609\n\t\t,-0.361800,0.262863,-0.894429,-0.447211,0.525727,-0.723611,0.052790,0.688185,-0.723612,0.138197,0.425320,-0.894430,0.361804,0.587779,-0.723612,0.947213,-0.162458,-0.276396,0.947213,0.162458,-0.276396\n\t\t,1.000000,0.000000,0.000000,0.138199,-0.951055,-0.276397,0.447216,-0.850648,-0.276397,0.309017,-0.951056,0.000000,-0.861804,-0.425322,-0.276396,-0.670820,-0.688190,-0.276396,-0.809018,-0.587783,0.000000\n\t\t,-0.670820,0.688190,-0.276396,-0.861804,0.425322,-0.276396,-0.809018,0.587783,0.000000,0.447216,0.850648,-0.276397,0.138199,0.951055,-0.276397,0.309017,0.951056,0.000000,0.861804,-0.425322,0.276396\n\t\t,0.809018,-0.587783,0.000000,0.670820,-0.688190,0.276396,-0.138199,-0.951055,0.276397,-0.309017,-0.951056,0.000000,-0.447216,-0.850648,0.276397,-0.947213,-0.162458,0.276396,-1.000000,0.000000,0.000000\n\t\t,-0.947213,0.162458,0.276396,-0.447216,0.850648,0.276397,-0.309017,0.951056,0.000000,-0.138199,0.951055,0.276397,0.670820,0.688190,0.276396,0.809018,0.587783,0.000000,0.861804,0.425322,0.276396\n\t\t,0.447211,-0.525727,0.723611,0.638195,-0.262864,0.723609,0.361800,-0.262863,0.894429,-0.361804,-0.587779,0.723612,-0.052790,-0.688185,0.723612,-0.138197,-0.425320,0.894430,-0.670817,0.162457,0.723611\n\t\t,-0.670817,-0.162457,0.723611,-0.447210,0.000000,0.894429,-0.052790,0.688185,0.723612,-0.361804,0.587779,0.723612,-0.138197,0.425320,0.894430,0.638195,0.262864,0.723609,0.447211,0.525727,0.723612\n\t\t,0.361800,0.262863,0.894429\n\t\tPolygonVertexIndex: 102,46,-15,46,102,-44,12,43,-103,43,1,-47,102,103,-13,103,102,-105,14,104,-103,104,13,-104,45,47,-3,47,45,-105,13,104,-46,104,14,-48,44,103,-14\n\t\t,103,44,-43,0,42,-45,42,12,-104,105,16,-51,50,43,-106,12,105,-44,43,50,-2,105,12,-107,106,107,-106,16,105,-108,107,106,-16,49,5,-52,51,107,-50\n\t\t,15,49,-108,107,51,-17,48,15,-107,106,42,-49,0,48,-43,42,106,-13,108,55,-19,55,108,-46,13,45,-109,45,2,-56,108,109,-14,109,108,-111,18,110,-109\n\t\t,110,17,-110,53,54,-4,54,53,-111,17,110,-54,110,18,-55,52,109,-18,109,52,-45,0,44,-53,44,13,-110,111,59,-21,59,111,-54,17,53,-112,53,3,-60\n\t\t,111,112,-18,112,111,-114,20,113,-112,113,19,-113,57,58,-5,58,57,-114,19,113,-58,113,20,-59,56,112,-20,112,56,-53,0,52,-57,52,17,-113,114,60,-22\n\t\t,60,114,-58,19,57,-115,57,4,-61,114,115,-20,115,114,-117,21,116,-115,116,15,-116,49,61,-6,61,49,-117,15,116,-50,116,21,-62,48,115,-16,115,48,-57\n\t\t,0,56,-49,56,19,-116,117,23,-65,64,50,-118,16,117,-51,50,64,-2,117,16,-119,118,119,-118,23,117,-120,119,118,-23,62,10,-66,65,119,-63,22,62,-120\n\t\t,119,65,-24,63,22,-119,118,51,-64,5,63,-52,51,118,-17,120,25,-69,68,47,-121,14,120,-48,47,68,-3,120,14,-122,121,122,-121,25,120,-123,122,121,-25\n\t\t,67,6,-70,69,122,-68,24,67,-123,122,69,-26,66,24,-122,121,46,-67,1,66,-47,46,121,-15,123,27,-74,73,54,-124,18,123,-55,54,73,-4,123,18,-125\n\t\t,124,125,-124,27,123,-126,125,124,-27,70,7,-73,72,125,-71,26,70,-126,125,72,-28,71,26,-125,124,55,-72,2,71,-56,55,124,-19,126,29,-78,77,58,-127\n\t\t,20,126,-59,58,77,-5,126,20,-128,127,128,-127,29,126,-129,128,127,-29,74,8,-77,76,128,-75,28,74,-129,128,76,-30,75,28,-128,127,59,-76,3,75,-60\n\t\t,59,127,-21,129,31,-82,81,61,-130,21,129,-62,61,81,-6,129,21,-131,130,131,-130,31,129,-132,131,130,-31,78,9,-81,80,131,-79,30,78,-132,131,80,-32\n\t\t,79,30,-131,130,60,-80,4,79,-61,60,130,-22,132,82,-33,82,132,-66,23,65,-133,65,10,-83,132,133,-24,133,132,-135,32,134,-133,134,24,-134,67,83,-7\n\t\t,83,67,-135,24,134,-68,134,32,-84,66,133,-25,133,66,-65,1,64,-67,64,23,-134,135,85,-34,85,135,-70,25,69,-136,69,6,-86,135,136,-26,136,135,-138\n\t\t,33,137,-136,137,26,-137,70,84,-8,84,70,-138,26,137,-71,137,33,-85,71,136,-27,136,71,-69,2,68,-72,68,25,-137,138,87,-35,87,138,-73,27,72,-139\n\t\t,72,7,-88,138,139,-28,139,138,-141,34,140,-139,140,28,-140,74,86,-9,86,74,-141,28,140,-75,140,34,-87,75,139,-29,139,75,-74,3,73,-76,73,27,-140\n\t\t,141,89,-36,89,141,-77,29,76,-142,76,8,-90,141,142,-30,142,141,-144,35,143,-142,143,30,-143,78,88,-10,88,78,-144,30,143,-79,143,35,-89,79,142,-31\n\t\t,142,79,-78,4,77,-80,77,29,-143,144,90,-37,90,144,-81,31,80,-145,80,9,-91,144,145,-32,145,144,-147,36,146,-145,146,22,-146,62,91,-11,91,62,-147\n\t\t,22,146,-63,146,36,-92,63,145,-23,145,63,-82,5,81,-64,81,31,-146,147,38,-96,95,83,-148,32,147,-84,83,95,-7,147,32,-149,148,149,-148,38,147,-150\n\t\t,149,148,-38,93,11,-95,94,149,-94,37,93,-150,149,94,-39,92,37,-149,148,82,-93,10,92,-83,82,148,-33,150,39,-98,97,84,-151,33,150,-85,84,97,-8\n\t\t,150,33,-152,151,152,-151,39,150,-153,152,151,-39,94,11,-97,96,152,-95,38,94,-153,152,96,-40,95,38,-152,151,85,-96,6,95,-86,85,151,-34,153,40,-100\n\t\t,99,86,-154,34,153,-87,86,99,-9,153,34,-155,154,155,-154,40,153,-156,155,154,-40,96,11,-99,98,155,-97,39,96,-156,155,98,-41,97,39,-155,154,87,-98\n\t\t,7,97,-88,87,154,-35,156,41,-101,100,88,-157,35,156,-89,88,100,-10,156,35,-158,157,158,-157,41,156,-159,158,157,-41,98,11,-102,101,158,-99,40,98,-159\n\t\t,158,101,-42,99,40,-158,157,89,-100,8,99,-90,89,157,-36,159,37,-93,92,91,-160,36,159,-92,91,92,-11,159,36,-161,160,161,-160,37,159,-162,161,160,-42\n\t\t,101,11,-94,93,161,-102,41,101,-162,161,93,-38,100,41,-161,160,90,-101,9,100,-91,90,160,-37\n\t\tEdges: 0,42,12,42,1,43,12,43,0,44,13,44,2,45,45,13,1,46,14,46,2,47,14,47,0,48\n\t\t,15,48,5,49,15,49,1,50,50,16,5,51,51,16,0,52,52,17,3,53,53,17,3,54,54,18\n\t\t,2,55,18,55,0,56,19,56,4,57,19,57,4,58,20,58,3,59,20,59,4,60,21,60,5,61\n\t\t,21,61,10,62,22,62,5,63,22,63,1,64,23,64,10,65,23,65,1,66,24,66,6,67,24,67\n\t\t,2,68,25,68,6,69,25,69,7,70,26,70,2,71,26,71,7,72,27,72,3,73,27,73,8,74\n\t\t,28,74,3,75,28,75,8,76,29,76,4,77,29,77,9,78,30,78,4,79,30,79,9,80,31,80\n\t\t,5,81,31,81,10,82,32,82,6,83,32,83,7,84,33,84,6,85,33,85,8,86,34,86,7,87\n\t\t,34,87,9,88,35,88,8,89,35,89,9,90,36,90,10,91,36,91,10,92,37,92,11,93,37,93\n\t\t,11,94,38,94,6,95,38,95,11,96,39,96,7,97,39,97,11,98,40,98,8,99,40,99,9,100\n\t\t,41,100,11,101,41,101,12,102,14,102,12,103,13,103,13,104,14,104,12,105,16,105,12,106,15,106\n\t\t,15,107,16,107,13,108,18,108,13,109,17,109,17,110,18,110,17,111,20,111,17,112,19,112,19,113\n\t\t,20,113,19,114,21,114,15,115,19,115,15,116,21,116,16,117,23,117,16,118,22,118,22,119,23,119\n\t\t,14,120,25,120,14,121,24,121,24,122,25,122,18,123,27,123,18,124,26,124,26,125,27,125,20,126\n\t\t,29,126,20,127,28,127,28,128,29,128,21,129,31,129,21,130,30,130,30,131,31,131,23,132,32,132\n\t\t,23,133,24,133,24,134,32,134,25,135,33,135,25,136,26,136,26,137,33,137,27,138,34,138,27,139\n\t\t,28,139,28,140,34,140,29,141,35,141,29,142,30,142,30,143,35,143,31,144,36,144,22,145,31,145\n\t\t,22,146,36,146,32,147,38,147,32,148,37,148,37,149,38,149,33,150,39,150,33,151,38,151,38,152\n\t\t,39,152,34,153,40,153,34,154,39,154,39,155,40,155,35,156,41,156,35,157,40,157,40,158,41,158\n\t\t,36,159,37,159,36,160,41,160,37,161,41,161,46,102,43,46,43,102,102,103,103,104,102,104,45,47\n\t\t,47,104,45,104,44,103,42,103,44,42,50,105,50,43,43,105,105,106,106,107,105,107,51,49,51,107\n\t\t,49,107,48,106,42,106,48,42,55,108,45,55,45,108,108,109,109,110,108,110,54,53,54,110,53,110\n\t\t,52,109,44,109,52,44,59,111,53,59,53,111,111,112,112,113,111,113,57,58,58,113,57,113,56,112\n\t\t,52,112,52,56,60,114,57,60,57,114,114,115,115,116,114,116,49,61,61,116,49,116,48,115,56,115\n\t\t,48,56,64,117,50,64,50,117,117,118,118,119,117,119,62,65,65,119,62,119,63,118,51,118,51,63\n\t\t,68,120,47,68,47,120,120,121,121,122,120,122,67,69,69,122,67,122,66,121,46,121,46,66,73,123\n\t\t,54,73,54,123,123,124,124,125,123,125,70,72,72,125,70,125,71,124,55,124,55,71,77,126,58,77\n\t\t,58,126,126,127,127,128,126,128,74,76,76,128,74,128,75,127,59,127,59,75,81,129,61,81,61,129\n\t\t,129,130,130,131,129,131,78,80,80,131,78,131,79,130,60,130,60,79,82,132,65,82,65,132,132,133\n\t\t,133,134,132,134,67,83,83,134,67,134,66,133,64,133,64,66,85,135,69,85,69,135,135,136,136,137\n\t\t,135,137,70,84,84,137,70,137,71,136,68,136,68,71,87,138,72,87,72,138,138,139,139,140,138,140\n\t\t,74,86,86,140,74,140,75,139,73,139,73,75,89,141,76,89,76,141,141,142,142,143,141,143,78,88\n\t\t,88,143,78,143,79,142,77,142,77,79,90,144,80,90,80,144,144,145,145,146,144,146,62,91,91,146\n\t\t,62,146,63,145,81,145,63,81,95,147,83,95,83,147,147,148,148,149,147,149,93,94,94,149,93,149\n\t\t,92,148,82,148,82,92,97,150,84,97,84,150,150,151,151,152,150,152,94,96,96,152,94,152,95,151\n\t\t,85,151,85,95,99,153,86,99,86,153,153,154,154,155,153,155,96,98,98,155,96,155,97,154,87,154\n\t\t,87,97,100,156,88,100,88,156,156,157,157,158,156,158,98,101,101,158,98,158,99,157,89,157,89,99\n\t\t,92,159,91,92,91,159,159,160,160,161,159,161,93,101,93,161,101,161,100,160,90,160,90,100\n\t\tGeometryVersion: 124\n        LayerElementNormal: 0 {\n            Version: 101\n            Name: \"\"\n            MappingInformationType: \"ByVertice\"\n            ReferenceInformationType: \"Direct\"\n            Normals: 0.000000000000000,0.000000000000000,-0.999969482421875,0.723593831062317,-0.525711834430695,-0.447218239307404\n\t\t\t ,-0.276375621557236,-0.850642442703247,-0.447218239307404,-0.894405961036682,0.000000000000000,-0.447187721729279\n\t\t\t ,-0.276375621557236,0.850642442703247,-0.447218239307404,0.723593831062317,0.525711834430695,-0.447218239307404\n\t\t\t ,0.276375621557236,-0.850642442703247,0.447218239307404,-0.723593831062317,-0.525711834430695,0.447218239307404\n\t\t\t ,-0.723593831062317,0.525711834430695,0.447218239307404,0.276375621557236,0.850642442703247,0.447218239307404\n\t\t\t ,0.894405961036682,0.000000000000000,0.447187721729279,0.000000000000000,0.000000000000000,0.999969482421875\n\t\t\t ,0.425305962562561,-0.308999896049500,-0.850642442703247,-0.162450030446053,-0.499984741210938,-0.850642442703247\n\t\t\t ,0.262855917215347,-0.808984637260437,-0.525711834430695,0.425305962562561,0.308999896049500,-0.850642442703247\n\t\t\t ,0.850642442703247,0.000000000000000,-0.525711834430695,-0.525711834430695,0.000000000000000,-0.850642442703247\n\t\t\t ,-0.688161849975586,-0.499984741210938,-0.525711834430695,-0.162450030446053,0.499984741210938,-0.850642442703247\n\t\t\t ,-0.688161849975586,0.499984741210938,-0.525711834430695,0.262855917215347,0.808984637260437,-0.525711834430695\n\t\t\t ,0.951048314571381,0.308999896049500,0.000000000000000,0.951048314571381,-0.308999896049500,0.000000000000000\n\t\t\t ,0.587755978107452,-0.809015154838562,0.000000000000000,0.000000000000000,-1.000000000000000,0.000000000000000\n\t\t\t ,-0.587755978107452,-0.809015154838562,0.000000000000000,-0.951048314571381,-0.308999896049500,0.000000000000000\n\t\t\t ,-0.951048314571381,0.308999896049500,0.000000000000000,-0.587755978107452,0.809015154838562,0.000000000000000\n\t\t\t ,0.000000000000000,1.000000000000000,0.000000000000000,0.587755978107452,0.809015154838562,0.000000000000000\n\t\t\t ,0.688161849975586,-0.499984741210938,0.525711834430695,-0.262855917215347,-0.808984637260437,0.525711834430695\n\t\t\t ,-0.850642442703247,0.000000000000000,0.525711834430695,-0.262855917215347,0.808984637260437,0.525711834430695\n\t\t\t ,0.688161849975586,0.499984741210938,0.525711834430695,0.525711834430695,0.000000000000000,0.850642442703247\n\t\t\t ,0.162450030446053,-0.499984741210938,0.850642442703247,-0.425305962562561,-0.308999896049500,0.850642442703247\n\t\t\t ,-0.425305962562561,0.308999896049500,0.850642442703247,0.162450030446053,0.499984741210938,0.850642442703247\n\t\t\t ,0.210730314254761,-0.153080850839615,-0.965453028678894,0.604358017444611,-0.439100325107574,-0.664754152297974\n\t\t\t ,-0.080477312207222,-0.247718736529350,-0.965453028678894,-0.230842009186745,-0.710470914840698,-0.664754152297974\n\t\t\t ,0.523880720138550,-0.686819076538086,-0.503769040107727,-0.020111698657274,-0.863582253456116,-0.503769040107727\n\t\t\t ,0.210730314254761,0.153080850839615,-0.965453028678894,0.604358017444611,0.439100325107574,-0.664754152297974\n\t\t\t ,0.815088331699371,-0.285988956689835,-0.503769040107727,0.815088331699371,0.285988956689835,-0.503769040107727\n\t\t\t ,-0.260475486516953,0.000000000000000,-0.965453028678894,-0.747032046318054,0.000000000000000,-0.664754152297974\n\t\t\t ,-0.827539920806885,-0.247718736529350,-0.503769040107727,-0.491317480802536,-0.710470914840698,-0.503769040107727\n\t\t\t ,-0.080477312207222,0.247718736529350,-0.965453028678894,-0.230842009186745,0.710470914840698,-0.664754152297974\n\t\t\t ,-0.491317480802536,0.710470914840698,-0.503769040107727,-0.827539920806885,0.247718736529350,-0.503769040107727\n\t\t\t ,-0.020111698657274,0.863582253456116,-0.503769040107727,0.523880720138550,0.686819076538086,-0.503769040107727\n\t\t\t ,0.957792878150940,0.153080850839615,0.243263036012650,0.864833533763885,0.439100325107574,-0.243293553590775\n\t\t\t ,0.864833533763885,-0.439100325107574,-0.243293553590775,0.957792878150940,-0.153080850839615,0.243263036012650\n\t\t\t ,0.684865891933441,-0.686819076538086,-0.243293553590775,0.441572308540344,-0.863582253456116,0.243293553590775\n\t\t\t ,-0.150334179401398,-0.958220183849335,-0.243293553590775,0.150334179401398,-0.958220183849335,0.243293553590775\n\t\t\t ,-0.684865891933441,-0.686819076538086,0.243293553590775,-0.441572308540344,-0.863582253456116,-0.243293553590775\n\t\t\t ,-0.864833533763885,-0.439100325107574,0.243293553590775,-0.957792878150940,-0.153080850839615,-0.243263036012650\n\t\t\t ,-0.864833533763885,0.439100325107574,0.243293553590775,-0.957792878150940,0.153080850839615,-0.243263036012650\n\t\t\t ,-0.684865891933441,0.686819076538086,0.243293553590775,-0.441572308540344,0.863582253456116,-0.243293553590775\n\t\t\t ,0.150334179401398,0.958220183849335,0.243293553590775,-0.150334179401398,0.958220183849335,-0.243293553590775\n\t\t\t ,0.441572308540344,0.863582253456116,0.243293553590775,0.684865891933441,0.686819076538086,-0.243293553590775\n\t\t\t ,0.827539920806885,-0.247718736529350,0.503769040107727,0.491317480802536,-0.710470914840698,0.503769040107727\n\t\t\t ,-0.523880720138550,-0.686819076538086,0.503769040107727,0.020111698657274,-0.863582253456116,0.503769040107727\n\t\t\t ,-0.815088331699371,0.285988956689835,0.503769040107727,-0.815088331699371,-0.285988956689835,0.503769040107727\n\t\t\t ,0.020111698657274,0.863582253456116,0.503769040107727,-0.523880720138550,0.686819076538086,0.503769040107727\n\t\t\t ,0.491317480802536,0.710470914840698,0.503769040107727,0.827539920806885,0.247718736529350,0.503769040107727\n\t\t\t ,0.747032046318054,0.000000000000000,0.664754152297974,0.260475486516953,0.000000000000000,0.965453028678894\n\t\t\t ,0.080477312207222,-0.247718736529350,0.965453028678894,0.230842009186745,-0.710470914840698,0.664754152297974\n\t\t\t ,-0.210730314254761,-0.153080850839615,0.965453028678894,-0.604358017444611,-0.439100325107574,0.664754152297974\n\t\t\t ,-0.210730314254761,0.153080850839615,0.965453028678894,-0.604358017444611,0.439100325107574,0.664754152297974\n\t\t\t ,0.230842009186745,0.710470914840698,0.664754152297974,0.080477312207222,0.247718736529350,0.965453028678894\n\t\t\t ,0.350016772747040,-0.587725460529327,-0.729422867298126,0.141788989305496,-0.436445206403732,-0.888454854488373\n\t\t\t ,0.062288276851177,-0.681203663349152,-0.729422867298126,0.667104125022888,-0.151249736547470,-0.729422867298126\n\t\t\t ,0.458906829357147,0.000000000000000,-0.888454854488373,0.667104125022888,0.151249736547470,-0.729422867298126\n\t\t\t ,-0.450788915157318,-0.514481008052826,-0.729422867298126,-0.371257662773132,-0.269722580909729,-0.888454854488373\n\t\t\t ,-0.628620266914368,-0.269722580909729,-0.729422867298126,-0.628620266914368,0.269722580909729,-0.729422867298126\n\t\t\t ,-0.371257662773132,0.269722580909729,-0.888454854488373,-0.450788915157318,0.514481008052826,-0.729422867298126\n\t\t\t ,0.062288276851177,0.681203663349152,-0.729422867298126,0.141788989305496,0.436445206403732,-0.888454854488373\n\t\t\t ,0.350016772747040,0.587725460529327,-0.729422867298126,0.950743138790131,-0.151249736547470,-0.270485550165176\n\t\t\t ,0.950743138790131,0.151249736547470,-0.270485550165176,0.999908447265625,0.000000000000000,-0.013122959062457\n\t\t\t ,0.149937435984612,-0.950956761837006,-0.270485550165176,0.437665939331055,-0.857478559017181,-0.270485550165176\n\t\t\t ,0.308969378471375,-0.950956761837006,-0.013122959062457,-0.858088910579681,-0.436445206403732,-0.270485550165176\n\t\t\t ,-0.680257558822632,-0.681203663349152,-0.270485550165176,-0.808923602104187,-0.587725460529327,-0.013122959062457\n\t\t\t ,-0.680257558822632,0.681203663349152,-0.270485550165176,-0.858088910579681,0.436445206403732,-0.270485550165176\n\t\t\t ,-0.808923602104187,0.587725460529327,-0.013122959062457,0.437665939331055,0.857478559017181,-0.270485550165176\n\t\t\t ,0.149937435984612,0.950956761837006,-0.270485550165176,0.308969378471375,0.950956761837006,-0.013122959062457\n\t\t\t ,0.858088910579681,-0.436445206403732,0.270485550165176,0.808923602104187,-0.587725460529327,0.013122959062457\n\t\t\t ,0.680257558822632,-0.681203663349152,0.270485550165176,-0.149937435984612,-0.950956761837006,0.270485550165176\n\t\t\t ,-0.308969378471375,-0.950956761837006,0.013122959062457,-0.437665939331055,-0.857478559017181,0.270485550165176\n\t\t\t ,-0.950743138790131,-0.151249736547470,0.270485550165176,-0.999908447265625,0.000000000000000,0.013122959062457\n\t\t\t ,-0.950743138790131,0.151249736547470,0.270485550165176,-0.437665939331055,0.857478559017181,0.270485550165176\n\t\t\t ,-0.308969378471375,0.950956761837006,0.013122959062457,-0.149937435984612,0.950956761837006,0.270485550165176\n\t\t\t ,0.680257558822632,0.681203663349152,0.270485550165176,0.808923602104187,0.587725460529327,0.013122959062457\n\t\t\t ,0.858088910579681,0.436445206403732,0.270485550165176,0.450788915157318,-0.514481008052826,0.729422867298126\n\t\t\t ,0.628620266914368,-0.269722580909729,0.729422867298126,0.371257662773132,-0.269722580909729,0.888454854488373\n\t\t\t ,-0.350016772747040,-0.587725460529327,0.729422867298126,-0.062288276851177,-0.681203663349152,0.729422867298126\n\t\t\t ,-0.141788989305496,-0.436445206403732,0.888454854488373,-0.667104125022888,0.151249736547470,0.729422867298126\n\t\t\t ,-0.667104125022888,-0.151249736547470,0.729422867298126,-0.458906829357147,0.000000000000000,0.888454854488373\n\t\t\t ,-0.062288276851177,0.681203663349152,0.729422867298126,-0.350016772747040,0.587725460529327,0.729422867298126\n\t\t\t ,-0.141788989305496,0.436445206403732,0.888454854488373,0.628620266914368,0.269722580909729,0.729422867298126\n\t\t\t ,0.450788915157318,0.514481008052826,0.729422867298126,0.371257662773132,0.269722580909729,0.888454854488373\n\t\t}\n        LayerElementSmoothing: 0 {\n            Version: 102\n            Name: \"\"\n            MappingInformationType: \"ByPolygon\"\n            ReferenceInformationType: \"Direct\"\n            Smoothing: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t}\n        LayerElementSmoothing: 0 {\n            Version: 101\n            Name: \"\"\n            MappingInformationType: \"ByEdge\"\n            ReferenceInformationType: \"Direct\"\n            Smoothing: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t}\n\t\tLayerElementUV: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"UVTex\"\n            MappingInformationType: \"ByPolygonVertex\"\n            ReferenceInformationType: \"IndexToDirect\"\n            UV: 0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000\n\t\t\t ,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000\n\t\t\t ,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000,1.000000,1.000000,0.000000,0.000000,1.000000,0.000000\n\t\t\t ,1.000000,1.000000\n\t\t\tUVIndex: 0,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\n\t\t\t\t,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109\n\t\t\t\t,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164\n\t\t\t\t,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219\n\t\t\t\t,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274\n\t\t\t\t,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329\n\t\t\t\t,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384\n\t\t\t\t,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439\n\t\t\t\t,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494\n\t\t\t\t,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549\n\t\t\t\t,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604\n\t\t\t\t,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659\n\t\t\t\t,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714\n\t\t\t\t,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769\n\t\t\t\t,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824\n\t\t\t\t,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879\n\t\t\t\t,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934\n\t\t\t\t,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959\n\t\t}\n        LayerElementTexture: 0 {\n            Version: 101\n            Name: \"\"\n            MappingInformationType: \"NoMappingInformation\"\n            ReferenceInformationType: \"IndexToDirect\"\n            BlendMode: \"Translucent\"\n            TextureAlpha: 1\n            TextureId: \n\t\t}\n\t\tLayerElementMaterial: 0 {\n\t\t\tVersion: 101\n\t\t\tName: \"\"\n\t\t\tMappingInformationType: \"AllSame\"\n\t\t\tReferenceInformationType: \"IndexToDirect\"\n\t\t\tMaterials: 0\n\t\t}\n        Layer: 0 {\n            Version: 100\n            LayerElement:  {\n                Type: \"LayerElementNormal\"\n                TypedIndex: 0\n            }\n            LayerElement:  {\n                Type: \"LayerElementMaterial\"\n                TypedIndex: 0\n            }\n            LayerElement:  {\n                Type: \"LayerElementUV\"\n                TypedIndex: 0\n            }\n\t\t}\n\t}\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,71.299999999999997,287.500000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",10.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",4000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",0\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,71.300000,287.500000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,-4000.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,-4000.000000,0.000000\n\t\tUp: 0,0,-1\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",0.000000000000000,0.000000000000000,-4000.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 0.000000,0.000000,-4000.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: 4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t\tVersion: 232\n        Properties60:  {\n            Property: \"QuaternionInterpolate\", \"bool\", \"\",0\n            Property: \"Visibility\", \"Visibility\", \"A+\",1\n\t\t\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",-4000.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",0.000000000000000,0.000000000000000,0.000000000000000\n\t\t\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",1.000000000000000,1.000000000000000,1.000000000000000\n            Property: \"RotationOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0\n            Property: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationActive\", \"bool\", \"\",0\n            Property: \"TranslationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"TranslationMinX\", \"bool\", \"\",0\n            Property: \"TranslationMinY\", \"bool\", \"\",0\n            Property: \"TranslationMinZ\", \"bool\", \"\",0\n            Property: \"TranslationMaxX\", \"bool\", \"\",0\n            Property: \"TranslationMaxY\", \"bool\", \"\",0\n            Property: \"TranslationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationOrder\", \"enum\", \"\",0\n            Property: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0\n            Property: \"AxisLen\", \"double\", \"\",10\n            Property: \"PreRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"PostRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationActive\", \"bool\", \"\",0\n            Property: \"RotationMin\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMax\", \"Vector3D\", \"\",0,0,0\n            Property: \"RotationMinX\", \"bool\", \"\",0\n            Property: \"RotationMinY\", \"bool\", \"\",0\n            Property: \"RotationMinZ\", \"bool\", \"\",0\n            Property: \"RotationMaxX\", \"bool\", \"\",0\n            Property: \"RotationMaxY\", \"bool\", \"\",0\n            Property: \"RotationMaxZ\", \"bool\", \"\",0\n            Property: \"RotationStiffnessX\", \"double\", \"\",0\n            Property: \"RotationStiffnessY\", \"double\", \"\",0\n            Property: \"RotationStiffnessZ\", \"double\", \"\",0\n            Property: \"MinDampRangeX\", \"double\", \"\",0\n            Property: \"MinDampRangeY\", \"double\", \"\",0\n            Property: \"MinDampRangeZ\", \"double\", \"\",0\n            Property: \"MaxDampRangeX\", \"double\", \"\",0\n            Property: \"MaxDampRangeY\", \"double\", \"\",0\n            Property: \"MaxDampRangeZ\", \"double\", \"\",0\n            Property: \"MinDampStrengthX\", \"double\", \"\",0\n            Property: \"MinDampStrengthY\", \"double\", \"\",0\n            Property: \"MinDampStrengthZ\", \"double\", \"\",0\n            Property: \"MaxDampStrengthX\", \"double\", \"\",0\n            Property: \"MaxDampStrengthY\", \"double\", \"\",0\n            Property: \"MaxDampStrengthZ\", \"double\", \"\",0\n            Property: \"PreferedAngleX\", \"double\", \"\",0\n            Property: \"PreferedAngleY\", \"double\", \"\",0\n            Property: \"PreferedAngleZ\", \"double\", \"\",0\n            Property: \"InheritType\", \"enum\", \"\",0\n            Property: \"ScalingActive\", \"bool\", \"\",0\n            Property: \"ScalingMin\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMax\", \"Vector3D\", \"\",1,1,1\n            Property: \"ScalingMinX\", \"bool\", \"\",0\n            Property: \"ScalingMinY\", \"bool\", \"\",0\n            Property: \"ScalingMinZ\", \"bool\", \"\",0\n            Property: \"ScalingMaxX\", \"bool\", \"\",0\n            Property: \"ScalingMaxY\", \"bool\", \"\",0\n            Property: \"ScalingMaxZ\", \"bool\", \"\",0\n            Property: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0\n            Property: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1\n            Property: \"LookAtProperty\", \"object\", \"\"\n            Property: \"UpVectorProperty\", \"object\", \"\"\n            Property: \"Show\", \"bool\", \"\",1\n            Property: \"NegativePercentShapeSupport\", \"bool\", \"\",1\n            Property: \"DefaultAttributeIndex\", \"int\", \"\",0\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Roll\", \"Roll\", \"A+\",0\n\t\t\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40\n\t\t\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1\n\t\t\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0\n\t\t\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0\n\t\t\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63\n\t\t\tProperty: \"TurnTable\", \"Real\", \"A+\",0\n\t\t\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1\n\t\t\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1\n\t\t\tProperty: \"UseMotionBlur\", \"bool\", \"\",0\n\t\t\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1\n\t\t\tProperty: \"ResolutionMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ApertureMode\", \"enum\", \"\",2\n\t\t\tProperty: \"GateFit\", \"enum\", \"\",0\n\t\t\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486\n\t\t\tProperty: \"CameraFormat\", \"enum\", \"\",0\n\t\t\tProperty: \"AspectW\", \"double\", \"\",320\n\t\t\tProperty: \"AspectH\", \"double\", \"\",200\n\t\t\tProperty: \"PixelAspectRatio\", \"double\", \"\",1\n\t\t\tProperty: \"UseFrameColor\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3\n\t\t\tProperty: \"ShowName\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowGrid\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0\n\t\t\tProperty: \"ShowAzimut\", \"bool\", \"\",1\n\t\t\tProperty: \"ShowTimeCode\", \"bool\", \"\",0\n\t\t\tProperty: \"NearPlane\", \"double\", \"\",1.000000\n\t\t\tProperty: \"FarPlane\", \"double\", \"\",30000.000000\n\t\t\tProperty: \"FilmWidth\", \"double\", \"\",0.816\n\t\t\tProperty: \"FilmHeight\", \"double\", \"\",0.612\n\t\t\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1\n\t\t\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4\n\t\t\tProperty: \"ViewFrustum\", \"bool\", \"\",1\n\t\t\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0\n\t\t\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2\n\t\t\tProperty: \"BackPlaneDistance\", \"double\", \"\",100\n\t\t\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1\n\t\t\tProperty: \"LockMode\", \"bool\", \"\",0\n\t\t\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0\n\t\t\tProperty: \"FitImage\", \"bool\", \"\",0\n\t\t\tProperty: \"Crop\", \"bool\", \"\",0\n\t\t\tProperty: \"Center\", \"bool\", \"\",1\n\t\t\tProperty: \"KeepRatio\", \"bool\", \"\",1\n\t\t\tProperty: \"BackgroundMode\", \"enum\", \"\",0\n\t\t\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5\n\t\t\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1\n\t\t\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0\n\t\t\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1\n\t\t\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333\n\t\t\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0\n\t\t\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100\n\t\t\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50\n\t\t\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50\n\t\t\tProperty: \"CameraProjectionType\", \"enum\", \"\",1\n\t\t\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0\n\t\t\tProperty: \"UseDepthOfField\", \"bool\", \"\",0\n\t\t\tProperty: \"FocusSource\", \"enum\", \"\",0\n\t\t\tProperty: \"FocusAngle\", \"double\", \"\",3.5\n\t\t\tProperty: \"FocusDistance\", \"double\", \"\",200\n\t\t\tProperty: \"UseAntialiasing\", \"bool\", \"\",0\n\t\t\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777\n\t\t\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0\n\t\t\tProperty: \"FrameSamplingCount\", \"int\", \"\",7\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 0\n\t\tHidden: \"True\"\n\t\tShading: Y\n\t\tCulling: \"CullingOff\"\n\t\tTypeFlags: \"Camera\"\n\t\tGeometryVersion: 124\n\t\tPosition: -4000.000000,0.000000,0.000000\n\t\tUp: 0,1,0\n\t\tLookAt: 0,0,0\n\t\tShowInfoOnMoving: 1\n\t\tShowAudio: 0\n\t\tAudioColor: 0,1,0\n\t\tCameraOrthoZoom: 1\n\t}\n\tMaterial: \"Material::unnamed\", \"\" {\n\t\tVersion: 102\n\t\tShadingModel: \"phong\"\n\t\tMultiLayer: 0\n\t\tProperties60:  {\n\t\t\tProperty: \"ShadingModel\", \"KString\", \"\", \"Phong\"\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"EmissiveFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",0.0000,0.0000,0.0000\n\t\t\tProperty: \"AmbientFactor\", \"double\", \"\",0.5000\n\t\t\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"DiffuseFactor\", \"double\", \"\",1.0000\n\t\t\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1\n\t\t\tProperty: \"TransparencyFactor\", \"double\", \"\",0.0000\n\t\t\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",0.8000,0.8000,0.8000\n\t\t\tProperty: \"SpecularFactor\", \"double\", \"\",0.2000\n\t\t\tProperty: \"ShininessExponent\", \"double\", \"\",80.0\n\t\t\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"ReflectionFactor\", \"double\", \"\",1\n\t\t\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0\n\t\t\tProperty: \"Ambient\", \"ColorRGB\", \"\",0.0,0.0,0.0\n\t\t\tProperty: \"Diffuse\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Specular\", \"ColorRGB\", \"\",0.8,0.8,0.8\n\t\t\tProperty: \"Shininess\", \"double\", \"\",20.0\n\t\t\tProperty: \"Opacity\", \"double\", \"\",1.0\n\t\t\tProperty: \"Reflectivity\", \"double\", \"\",0\n\t\t}\n\t}\n    Pose: \"Pose::BIND_POSES\", \"BindPose\" {\n        Type: \"BindPose\"\n        Version: 100\n        Properties60:  {\n        }\n        NbPoseNodes: 2\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::blend_root\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t\tPoseNode:  {\n\t\t\tNode: \"Model::Icosphere\"\n\t\t\tMatrix: 1.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-0.000000043711388,-1.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000,-0.000000043711388,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,1.000000000000000\n\t\t}\n\t}\n    GlobalSettings:  {\n        Version: 1000\n        Properties60:  {\n            Property: \"UpAxis\", \"int\", \"\",1\n            Property: \"UpAxisSign\", \"int\", \"\",1\n            Property: \"FrontAxis\", \"int\", \"\",2\n            Property: \"FrontAxisSign\", \"int\", \"\",1\n            Property: \"CoordAxis\", \"int\", \"\",0\n            Property: \"CoordAxisSign\", \"int\", \"\",1\n            Property: \"UnitScaleFactor\", \"double\", \"\",100\n        }\n    }\n}\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {\n\tModel: \"Model::blend_root\", \"Null\" {\n\t}\n\tModel: \"Model::Icosphere\", \"Mesh\" {\n\t}\n    Model: \"Model::Producer Perspective\", \"Camera\" {\n    }\n    Model: \"Model::Producer Top\", \"Camera\" {\n    }\n    Model: \"Model::Producer Bottom\", \"Camera\" {\n    }\n    Model: \"Model::Producer Front\", \"Camera\" {\n    }\n    Model: \"Model::Producer Back\", \"Camera\" {\n    }\n    Model: \"Model::Producer Right\", \"Camera\" {\n    }\n    Model: \"Model::Producer Left\", \"Camera\" {\n    }\n    Model: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n    }\n\tMaterial: \"Material::unnamed\", \"\" {\n\t}\n}\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {\n\tConnect: \"OO\", \"Model::blend_root\", \"Model::Scene\"\n\tConnect: \"OO\", \"Model::Icosphere\", \"Model::blend_root\"\n\tConnect: \"OO\", \"Material::unnamed\", \"Model::Icosphere\"\n}\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {\n\tCurrent: \"Default Take\"\n\tTake: \"Default Take\" {\n\t\tFileName: \"Default_Take.tak\"\n\t\tLocalTime: 0,479181389250\n\t\tReferenceTime: 0,479181389250\n\n        ;Models animation\n        ;----------------------------------------------------\n\t\tModel: \"Model::Icosphere\" {\n\t\t\tVersion: 1.1\n\t\t\tChannel: \"Transform\" {\n\t\t\t\tChannel: \"T\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 1\n\t\t\t\t}\n\t\t\t\tChannel: \"R\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: -90.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-90.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: -0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,-0.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 0.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,0.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 2\n\t\t\t\t}\n\t\t\t\tChannel: \"S\" {\n\t\t\t\t\tChannel: \"X\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 1,0,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Y\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,1,0\n\t\t\t\t\t}\n\t\t\t\t\tChannel: \"Z\" {\n\t\t\t\t\t\tDefault: 1.000000000000000\n\t\t\t\t\t\tKeyVer: 4005\n\t\t\t\t\t\tKeyCount: 1\n\t\t\t\t\t\tKey: \n\t\t\t\t\t\t\t1924423250,1.000000000000000,L\n\t\t\t\t\t\tColor: 0,0,1\n\t\t\t\t\t}\n\t\t\t\t\tLayerType: 3\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n;Version 5 settings\n;------------------------------------------------------------------\n\nVersion5:  {\n\tAmbientRenderSettings:  {\n\t\tVersion: 101\n\t\tAmbientLightColor: 0.0,0.0,0.0,0\n\t}\n\tFogOptions:  {\n\t\tFlogEnable: 0\n\t\tFogMode: 0\n\t\tFogDensity: 0.000\n\t\tFogStart: 5.000\n\t\tFogEnd: 25.000\n\t\tFogColor: 0.1,0.1,0.1,1\n\t}\n\tSettings:  {\n\t\tFrameRate: \"24\"\n\t\tTimeFormat: 1\n\t\tSnapOnFrames: 0\n\t\tReferenceTimeIndex: -1\n\t\tTimeLineStartTime: 0\n\t\tTimeLineStopTime: 479181389250\n\t}\n\tRendererSetting:  {\n\t\tDefaultCamera: \"Producer Perspective\"\n\t\tDefaultViewingMode: 0\n\t}\n}\n"
  },
  {
    "path": "Lemma/Editor/AnalyticsViewer.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Input;\n\nnamespace Lemma.Factories\n{\n\tpublic class AnalyticsViewer\n\t{\n\t\tprivate class EventEntry\n\t\t{\n\t\t\tpublic string Name;\n\t\t\tpublic Property<bool> Active = new Property<bool>();\n\t\t}\n\n\t\tprivate class SessionEntry\n\t\t{\n\t\t\tpublic Session Session;\n\t\t\tpublic Property<bool> Active = new Property<bool>();\n\t\t}\n\n\t\tprivate class PropertyEntry\n\t\t{\n\t\t\tpublic string Name;\n\t\t\tpublic Property<bool> Active = new Property<bool>();\n\t\t}\n\n\t\tprivate static Vector4 colorHash(string eventName)\n\t\t{\n\t\t\tbyte[] hash = System.Security.Cryptography.MD5.Create().ComputeHash(ASCIIEncoding.UTF8.GetBytes(eventName));\n\t\t\tVector3 color = new Vector3(hash[0] / 255.0f, hash[1] / 255.0f, hash[2] / 255.0f);\n\t\t\tcolor.Normalize();\n\t\t\treturn new Vector4(color, 1.0f);\n\t\t}\n\n\t\tpublic static void Bind(Entity entity, Main main, ListContainer commandQueueContainer)\n\t\t{\n\t\t\tPCInput input = entity.Get<PCInput>();\n\t\t\tEditor editor = entity.Get<Editor>();\n\t\t\tEditorGeeUI gui = entity.Get<EditorGeeUI>();\n\t\t\tProperty<bool> analyticsEnable = new Property<bool>();\n\t\t\tListProperty<SessionEntry> analyticsSessions = new ListProperty<SessionEntry>();\n\t\t\tListProperty<SessionEntry> analyticsActiveSessions = new ListProperty<SessionEntry>();\n\t\t\tListProperty<EventEntry> analyticsEvents = new ListProperty<EventEntry>();\n\t\t\tListProperty<EventEntry> analyticsActiveEvents = new ListProperty<EventEntry>();\n\t\t\tListProperty<PropertyEntry> analyticsProperties = new ListProperty<PropertyEntry>();\n\t\t\tListProperty<PropertyEntry> analyticsActiveProperties = new ListProperty<PropertyEntry>();\n\t\t\tDictionary<Session, ModelInstance> sessionPositionModels = new Dictionary<Session, ModelInstance>();\n\t\t\tDictionary<Session.EventList, List<ModelInstance>> eventPositionModels = new Dictionary<Session.EventList, List<ModelInstance>>();\n\t\t\tProperty<bool> analyticsPlaying = new Property<bool>();\n\t\t\tProperty<float> playbackSpeed = new Property<float> { Value = 1.0f };\n\t\t\tProperty<float> playbackLocation = new Property<float>();\n\n\t\t\tconst float timelineHeight = 32.0f;\n\n\t\t\tScroller timelineScroller = new Scroller();\n\t\t\ttimelineScroller.ScrollAmount.Value = 60.0f;\n\t\t\ttimelineScroller.EnableScissor.Value = false;\n\t\t\ttimelineScroller.DefaultScrollHorizontal.Value = true;\n\t\t\ttimelineScroller.AnchorPoint.Value = new Vector2(0, 1);\n\t\t\ttimelineScroller.ResizeVertical.Value = true;\n\t\t\ttimelineScroller.Add(new Binding<Vector2, Point>(timelineScroller.Position, x => new Vector2(0, x.Y), main.ScreenSize));\n\t\t\ttimelineScroller.Add(new Binding<Vector2, Point>(timelineScroller.Size, x => new Vector2(x.X, timelineHeight), main.ScreenSize));\n\t\t\ttimelineScroller.Add(new Binding<bool>(timelineScroller.Visible, () => analyticsEnable && Editor.EditorModelsVisible, analyticsEnable, Editor.EditorModelsVisible));\n\t\t\ttimelineScroller.Add(new Binding<bool>(timelineScroller.EnableScroll, x => !x, input.GetKey(Keys.LeftAlt)));\n\t\t\tentity.Add(new CommandBinding(entity.Delete, timelineScroller.Delete));\n\t\t\tmain.UI.Root.Children.Add(timelineScroller);\n\n\t\t\ttimelineScroller.Add(new Binding<bool>(editor.EnableCameraDistanceScroll, () => !timelineScroller.Highlighted || editor.VoxelEditMode, timelineScroller.Highlighted, editor.VoxelEditMode));\n\t\t\ttimelineScroller.Add(new CommandBinding(timelineScroller.Delete, delegate()\n\t\t\t{\n\t\t\t\teditor.EnableCameraDistanceScroll.Value = true;\n\t\t\t}));\n\n\t\t\tListContainer timelines = new ListContainer();\n\t\t\ttimelines.Alignment.Value = ListContainer.ListAlignment.Min;\n\t\t\ttimelines.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\ttimelines.Reversed.Value = true;\n\t\t\ttimelineScroller.Children.Add(timelines);\n\n\t\t\tinput.Add(new CommandBinding<int>(input.MouseScrolled, () => input.GetKey(Keys.LeftAlt) && timelineScroller.Highlighted && !editor.VoxelEditMode, delegate(int delta)\n\t\t\t{\n\t\t\t\tfloat newScale = Math.Max(timelines.Scale.Value.X + delta * 6.0f, timelineScroller.Size.Value.X / timelines.Size.Value.X);\n\t\t\t\tMatrix absoluteTransform = timelines.GetAbsoluteTransform();\n\t\t\t\tfloat x = input.Mouse.Value.X + ((absoluteTransform.Translation.X - input.Mouse.Value.X) * (newScale / timelines.Scale.Value.X));\n\t\t\t\ttimelines.Position.Value = new Vector2(x, 0.0f);\n\t\t\t\ttimelines.Scale.Value = new Vector2(newScale, 1.0f);\n\t\t\t}));\n\n\t\t\tContainer timeline = new Container();\n\t\t\ttimeline.Size.Value = new Vector2(0, timelineHeight);\n\t\t\ttimeline.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\ttimeline.ResizeHorizontal.Value = false;\n\t\t\ttimeline.ResizeVertical.Value = false;\n\t\t\ttimelines.Children.Add(timeline);\n\n\t\t\tEditorFactory.AddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Load analytics data\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (main.MapFile.Value != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tList<Session> sessions = main.LoadAnalytics(main.MapFile);\n\t\t\t\t\t\t\tif (sessions.Count > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tanalyticsEnable.Value = true;\n\t\t\t\t\t\t\t\tDictionary<string, bool> distinctEventNames = new Dictionary<string, bool>();\n\t\t\t\t\t\t\t\tDictionary<string, bool> distinctPropertyNames = new Dictionary<string, bool>();\n\t\t\t\t\t\t\t\tforeach (Session s in sessions)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach (Session.EventList el in s.Events)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdistinctEventNames[el.Name] = true;\n\t\t\t\t\t\t\t\t\t\ts.TotalTime = Math.Max(s.TotalTime, el.Events[el.Events.Count - 1].Time);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tforeach (Session.ContinuousProperty p in s.ContinuousProperties)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (p.Independent)\n\t\t\t\t\t\t\t\t\t\t\tdistinctPropertyNames[p.Name] = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tanalyticsSessions.Add(new SessionEntry { Session = s });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tanalyticsEvents.AddAll(distinctEventNames.Keys.Select(x => new EventEntry { Name = x }));\n\t\t\t\t\t\t\t\tanalyticsProperties.AddAll(distinctPropertyNames.Keys.Select(x => new PropertyEntry { Name = x }));\n\t\t\t\t\t\t\t\ttimeline.Size.Value = new Vector2(analyticsSessions.Max(x => x.Session.TotalTime), timelineScroller.Size.Value.Y);\n\t\t\t\t\t\t\t\ttimelines.Scale.Value = new Vector2(timelineScroller.Size.Value.X / timeline.Size.Value.X, 1.0f);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.MapCommands,\n\t\t\t\t() => !analyticsEnable && !string.IsNullOrEmpty(main.MapFile) && !gui.PickNextEntity,\n\t\t\t\tanalyticsEnable, main.MapFile, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tListContainer sessionsSidebar = new ListContainer();\n\t\t\tsessionsSidebar.AnchorPoint.Value = new Vector2(1, 1);\n\t\t\tsessionsSidebar.Add(new Binding<Vector2>(sessionsSidebar.Position, () => new Vector2(main.ScreenSize.Value.X - 10, main.ScreenSize.Value.Y - timelineScroller.ScaledSize.Value.Y - 10), main.ScreenSize, timelineScroller.ScaledSize));\n\t\t\tsessionsSidebar.Add(new Binding<bool>(sessionsSidebar.Visible, () => analyticsEnable && Editor.EditorModelsVisible, analyticsEnable, Editor.EditorModelsVisible));\n\t\t\tsessionsSidebar.Alignment.Value = ListContainer.ListAlignment.Max;\n\t\t\tsessionsSidebar.Reversed.Value = true;\n\t\t\tmain.UI.Root.Children.Add(sessionsSidebar);\n\t\t\tentity.Add(new CommandBinding(entity.Delete, sessionsSidebar.Delete));\n\n\t\t\tFunc<string, ListContainer> createCheckboxListItem = delegate(string text)\n\t\t\t{\n\t\t\t\tListContainer layout = new ListContainer();\n\t\t\t\tlayout.Orientation.Value = ListContainer.ListOrientation.Horizontal;\n\n\t\t\t\tTextElement label = new TextElement();\n\t\t\t\tlabel.FontFile.Value = main.Font;\n\t\t\t\tlabel.Text.Value = text;\n\t\t\t\tlabel.Name.Value = \"Label\";\n\t\t\t\tlayout.Children.Add(label);\n\n\t\t\t\tContainer checkboxContainer = new Container();\n\t\t\t\tcheckboxContainer.PaddingBottom.Value = checkboxContainer.PaddingLeft.Value = checkboxContainer.PaddingRight.Value = checkboxContainer.PaddingTop.Value = 1.0f;\n\t\t\t\tlayout.Children.Add(checkboxContainer);\n\n\t\t\t\tContainer checkbox = new Container();\n\t\t\t\tcheckbox.Name.Value = \"Checkbox\";\n\t\t\t\tcheckbox.ResizeHorizontal.Value = checkbox.ResizeVertical.Value = false;\n\t\t\t\tcheckbox.Size.Value = new Vector2(16.0f, 16.0f);\n\t\t\t\tcheckboxContainer.Children.Add(checkbox);\n\t\t\t\treturn layout;\n\t\t\t};\n\n\t\t\tContainer sessionsContainer = new Container();\n\t\t\tsessionsContainer.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\tsessionsContainer.Opacity.Value = UIFactory.Opacity;\n\t\t\tsessionsContainer.AnchorPoint.Value = new Vector2(1, 1);\n\t\t\tsessionsSidebar.Children.Add(sessionsContainer);\n\n\t\t\tScroller sessionsScroller = new Scroller();\n\t\t\tsessionsScroller.ResizeHorizontal.Value = true;\n\t\t\tsessionsScroller.ResizeVertical.Value = true;\n\t\t\tsessionsScroller.MaxVerticalSize.Value = 256;\n\t\t\tsessionsContainer.Children.Add(sessionsScroller);\n\n\t\t\tListContainer sessionList = new ListContainer();\n\t\t\tsessionList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tsessionList.Alignment.Value = ListContainer.ListAlignment.Max;\n\t\t\tsessionsScroller.Children.Add(sessionList);\n\n\t\t\tProperty<bool> allSessions = new Property<bool>();\n\n\t\t\tsessionList.Add(new ListBinding<UIComponent, SessionEntry>(sessionList.Children, analyticsSessions, delegate(SessionEntry entry)\n\t\t\t{\n\t\t\t\tListContainer item = createCheckboxListItem(string.Format(\"{0} {1:d} ({2})\", entry.Session.UUID.Substring(0, 8), entry.Session.Date, new TimeSpan(0, 0, (int)entry.Session.TotalTime)));\n\n\t\t\t\tContainer checkbox = (Container)item.GetChildByName(\"Checkbox\");\n\t\t\t\tcheckbox.Add(new Binding<Microsoft.Xna.Framework.Color, bool>(checkbox.Tint, x => x ? Microsoft.Xna.Framework.Color.White : Microsoft.Xna.Framework.Color.Black, entry.Active));\n\n\t\t\t\titem.Add(new CommandBinding(item.MouseLeftDown, delegate()\n\t\t\t\t{\n\t\t\t\t\tif (entry.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tallSessions.Value = false;\n\t\t\t\t\t\tanalyticsActiveSessions.Remove(entry);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tanalyticsActiveSessions.Add(entry);\n\t\t\t\t}));\n\n\t\t\t\treturn item;\n\t\t\t}));\n\n\t\t\tListContainer allSessionsButton = createCheckboxListItem(\"[All]\");\n\t\t\tallSessionsButton.Add(new CommandBinding(allSessionsButton.MouseLeftDown, delegate()\n\t\t\t{\n\t\t\t\tif (allSessions)\n\t\t\t\t{\n\t\t\t\t\tallSessions.Value = false;\n\t\t\t\t\tforeach (SessionEntry s in analyticsActiveSessions.ToList())\n\t\t\t\t\t\tanalyticsActiveSessions.Remove(s);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tallSessions.Value = true;\n\t\t\t\t\tforeach (SessionEntry s in analyticsSessions)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!s.Active)\n\t\t\t\t\t\t\tanalyticsActiveSessions.Add(s);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tContainer allSessionsCheckbox = (Container)allSessionsButton.GetChildByName(\"Checkbox\");\n\t\t\tallSessionsCheckbox.Add(new Binding<Microsoft.Xna.Framework.Color, bool>(allSessionsCheckbox.Tint, x => x ? Microsoft.Xna.Framework.Color.White : Microsoft.Xna.Framework.Color.Black, allSessions));\n\t\t\tsessionList.Children.Add(allSessionsButton);\n\n\t\t\tContainer eventsContainer = new Container();\n\t\t\teventsContainer.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\teventsContainer.Opacity.Value = UIFactory.Opacity;\n\t\t\teventsContainer.AnchorPoint.Value = new Vector2(1, 1);\n\t\t\tsessionsSidebar.Children.Add(eventsContainer);\n\n\t\t\tScroller eventsScroller = new Scroller();\n\t\t\teventsScroller.ResizeHorizontal.Value = true;\n\t\t\teventsScroller.ResizeVertical.Value = true;\n\t\t\teventsScroller.MaxVerticalSize.Value = 256;\n\t\t\teventsContainer.Children.Add(eventsScroller);\n\n\t\t\tListContainer eventList = new ListContainer();\n\t\t\teventList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\teventList.Alignment.Value = ListContainer.ListAlignment.Max;\n\t\t\teventsScroller.Children.Add(eventList);\n\n\t\t\tProperty<bool> allEvents = new Property<bool>();\n\n\t\t\teventList.Add(new ListBinding<UIComponent, EventEntry>(eventList.Children, analyticsEvents, delegate(EventEntry e)\n\t\t\t{\n\t\t\t\tListContainer item = createCheckboxListItem(e.Name);\n\n\t\t\t\tContainer checkbox = (Container)item.GetChildByName(\"Checkbox\");\n\t\t\t\tcheckbox.Add(new Binding<Microsoft.Xna.Framework.Color, bool>(checkbox.Tint, x => x ? Microsoft.Xna.Framework.Color.White : Microsoft.Xna.Framework.Color.Black, e.Active));\n\n\t\t\t\tTextElement label = (TextElement)item.GetChildByName(\"Label\");\n\t\t\t\tlabel.Tint.Value = new Microsoft.Xna.Framework.Color(colorHash(e.Name));\n\n\t\t\t\titem.Add(new CommandBinding(item.MouseLeftDown, delegate()\n\t\t\t\t{\n\t\t\t\t\tif (e.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tallEvents.Value = false;\n\t\t\t\t\t\tanalyticsActiveEvents.Remove(e);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tanalyticsActiveEvents.Add(e);\n\t\t\t\t}));\n\n\t\t\t\treturn item;\n\t\t\t}));\n\n\t\t\tListContainer allEventsButton = createCheckboxListItem(\"[All]\");\n\t\t\tallEventsButton.Add(new CommandBinding(allEventsButton.MouseLeftDown, delegate()\n\t\t\t{\n\t\t\t\tif (allEvents)\n\t\t\t\t{\n\t\t\t\t\tallEvents.Value = false;\n\t\t\t\t\tforeach (EventEntry e in analyticsActiveEvents.ToList())\n\t\t\t\t\t\tanalyticsActiveEvents.Remove(e);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tallEvents.Value = true;\n\t\t\t\t\tforeach (EventEntry e in analyticsEvents)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!e.Active)\n\t\t\t\t\t\t\tanalyticsActiveEvents.Add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\t\t\tContainer allEventsCheckbox = (Container)allEventsButton.GetChildByName(\"Checkbox\");\n\t\t\tallEventsCheckbox.Add(new Binding<Microsoft.Xna.Framework.Color, bool>(allEventsCheckbox.Tint, x => x ? Microsoft.Xna.Framework.Color.White : Microsoft.Xna.Framework.Color.Black, allEvents));\n\t\t\teventList.Children.Add(allEventsButton);\n\n\t\t\tContainer propertiesContainer = new Container();\n\t\t\tpropertiesContainer.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\tpropertiesContainer.Opacity.Value = UIFactory.Opacity;\n\t\t\tpropertiesContainer.AnchorPoint.Value = new Vector2(1, 1);\n\t\t\tsessionsSidebar.Children.Add(propertiesContainer);\n\n\t\t\tScroller propertiesScroller = new Scroller();\n\t\t\tpropertiesScroller.ResizeHorizontal.Value = true;\n\t\t\tpropertiesScroller.ResizeVertical.Value = true;\n\t\t\tpropertiesScroller.MaxVerticalSize.Value = 256;\n\t\t\tpropertiesContainer.Children.Add(propertiesScroller);\n\n\t\t\tListContainer propertiesList = new ListContainer();\n\t\t\tpropertiesList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tpropertiesList.Alignment.Value = ListContainer.ListAlignment.Max;\n\t\t\tpropertiesScroller.Children.Add(propertiesList);\n\n\t\t\tProperty<bool> allProperties = new Property<bool>();\n\n\t\t\tpropertiesList.Add(new ListBinding<UIComponent, PropertyEntry>(propertiesList.Children, analyticsProperties, delegate(PropertyEntry e)\n\t\t\t{\n\t\t\t\tListContainer item = createCheckboxListItem(e.Name);\n\n\t\t\t\tContainer checkbox = (Container)item.GetChildByName(\"Checkbox\");\n\t\t\t\tcheckbox.Add(new Binding<Microsoft.Xna.Framework.Color, bool>(checkbox.Tint, x => x ? Microsoft.Xna.Framework.Color.White : Microsoft.Xna.Framework.Color.Black, e.Active));\n\n\t\t\t\tTextElement label = (TextElement)item.GetChildByName(\"Label\");\n\t\t\t\tlabel.Tint.Value = new Microsoft.Xna.Framework.Color(colorHash(e.Name));\n\n\t\t\t\titem.Add(new CommandBinding(item.MouseLeftDown, delegate()\n\t\t\t\t{\n\t\t\t\t\tif (e.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tallProperties.Value = false;\n\t\t\t\t\t\tanalyticsActiveProperties.Remove(e);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tanalyticsActiveProperties.Add(e);\n\t\t\t\t}));\n\n\t\t\t\treturn item;\n\t\t\t}));\n\n\t\t\tListContainer allPropertiesButton = createCheckboxListItem(\"[All]\");\n\t\t\tallPropertiesButton.Add(new CommandBinding(allPropertiesButton.MouseLeftDown, delegate()\n\t\t\t{\n\t\t\t\tif (allProperties)\n\t\t\t\t{\n\t\t\t\t\tallProperties.Value = false;\n\t\t\t\t\tforeach (PropertyEntry e in analyticsActiveProperties.ToList())\n\t\t\t\t\t\tanalyticsActiveProperties.Remove(e);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tallProperties.Value = true;\n\t\t\t\t\tforeach (PropertyEntry e in analyticsProperties)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!e.Active)\n\t\t\t\t\t\t\tanalyticsActiveProperties.Add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\t\t\tContainer allPropertiesCheckbox = (Container)allPropertiesButton.GetChildByName(\"Checkbox\");\n\t\t\tallPropertiesCheckbox.Add(new Binding<Microsoft.Xna.Framework.Color, bool>(allPropertiesCheckbox.Tint, x => x ? Microsoft.Xna.Framework.Color.White : Microsoft.Xna.Framework.Color.Black, allProperties));\n\t\t\tpropertiesList.Children.Add(allPropertiesButton);\n\n\t\t\tFunc<Session.EventList, LineDrawer2D> createEventLines = delegate(Session.EventList el)\n\t\t\t{\n\t\t\t\tLineDrawer2D line = new LineDrawer2D();\n\t\t\t\tline.Color.Value = colorHash(el.Name);\n\t\t\t\tline.UserData.Value = el;\n\n\t\t\t\tforeach (Session.Event e in el.Events)\n\t\t\t\t{\n\t\t\t\t\tline.Lines.Add(new LineDrawer2D.Line\n\t\t\t\t\t{\n\t\t\t\t\t\tA = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(new Vector3(e.Time, 0.0f, 0.0f), Microsoft.Xna.Framework.Color.White),\n\t\t\t\t\t\tB = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(new Vector3(e.Time, timeline.Size.Value.Y, 0.0f), Microsoft.Xna.Framework.Color.White),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn line;\n\t\t\t};\n\n\t\t\tanalyticsActiveEvents.ItemAdded += delegate(int index, EventEntry ee)\n\t\t\t{\n\t\t\t\tee.Active.Value = true;\n\t\t\t\tforeach (SessionEntry s in analyticsActiveSessions)\n\t\t\t\t{\n\t\t\t\t\tSession.PositionProperty positionProperty = s.Session.PositionProperties[0];\n\t\t\t\t\tforeach (Session.EventList el in s.Session.Events)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (el.Name == ee.Name)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tList<ModelInstance> models = new List<ModelInstance>();\n\t\t\t\t\t\t\tVector4 color = colorHash(el.Name);\n\t\t\t\t\t\t\tint hash = (int)(new Color(color).PackedValue);\n\t\t\t\t\t\t\tforeach (Session.Event e in el.Events)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tModelInstance i = new ModelInstance();\n\t\t\t\t\t\t\t\ti.Serialize = false;\n\t\t\t\t\t\t\t\ti.Setup(\"InstancedModels\\\\position-model\", hash);\n\t\t\t\t\t\t\t\tif (i.IsFirstInstance)\n\t\t\t\t\t\t\t\t\ti.Model.Color.Value = new Vector3(color.X, color.Y, color.Z);\n\t\t\t\t\t\t\t\ti.Transform.Value = Matrix.CreateTranslation(positionProperty.GetLastRecordedPosition(e.Time));\n\t\t\t\t\t\t\t\tmodels.Add(i);\n\t\t\t\t\t\t\t\tentity.Add(i);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\teventPositionModels[el] = models;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttimeline.Children.AddAll(s.Session.Events.Where(x => x.Name == ee.Name).Select(createEventLines));\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tanalyticsActiveEvents.ItemRemoved += delegate(int index, EventEntry e)\n\t\t\t{\n\t\t\t\te.Active.Value = false;\n\t\t\t\tforeach (KeyValuePair<Session.EventList, List<ModelInstance>> pair in eventPositionModels.ToList())\n\t\t\t\t{\n\t\t\t\t\tif (pair.Key.Name == e.Name)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (ModelInstance instance in pair.Value)\n\t\t\t\t\t\t\tinstance.Delete.Execute();\n\t\t\t\t\t\teventPositionModels.Remove(pair.Key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttimeline.Children.RemoveAll(timeline.Children.Where(x => x.UserData.Value != null && ((Session.EventList)x.UserData.Value).Name == e.Name).ToList());\n\t\t\t};\n\n\t\t\tanalyticsActiveProperties.ItemAdded += delegate(int index, PropertyEntry e)\n\t\t\t{\n\t\t\t\te.Active.Value = true;\n\t\t\t};\n\n\t\t\tanalyticsActiveProperties.ItemRemoved += delegate(int index, PropertyEntry e)\n\t\t\t{\n\t\t\t\te.Active.Value = false;\n\t\t\t};\n\n\t\t\tListContainer propertyTimelines = new ListContainer();\n\t\t\tpropertyTimelines.Alignment.Value = ListContainer.ListAlignment.Min;\n\t\t\tpropertyTimelines.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\ttimelines.Children.Add(propertyTimelines);\n\n\t\t\tAction<Container> refreshPropertyGraph = delegate(Container container)\n\t\t\t{\n\t\t\t\tTextElement label = (TextElement)container.GetChildByName(\"Label\");\n\t\t\t\tLineDrawer2D lines = (LineDrawer2D)container.GetChildByName(\"Graph\");\n\t\t\t\tstring propertyName = ((PropertyEntry)lines.UserData.Value).Name;\n\t\t\t\tlines.Lines.Clear();\n\t\t\t\tfloat time = 0.0f, lastTime = 0.0f;\n\t\t\t\tfloat lastValue = 0.0f;\n\t\t\t\tbool firstLine = true;\n\t\t\t\tfloat max = float.MinValue, min = float.MaxValue;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tbool stop = true;\n\n\t\t\t\t\t// Calculate average\n\t\t\t\t\tint count = 0;\n\t\t\t\t\tfloat sum = 0.0f;\n\t\t\t\t\tforeach (SessionEntry s in analyticsActiveSessions)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (time < s.Session.TotalTime)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSession.ContinuousProperty prop = s.Session.GetContinuousProperty(propertyName);\n\t\t\t\t\t\t\tif (prop != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstop = false;\n\t\t\t\t\t\t\t\tsum += prop[time];\n\t\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (stop)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat value = sum / (float)count;\n\t\t\t\t\t\tif (firstLine)\n\t\t\t\t\t\t\tfirstLine = false;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlines.Lines.Add(new LineDrawer2D.Line\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tA = new Microsoft.Xna.Framework.Graphics.VertexPositionColor\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tColor = Microsoft.Xna.Framework.Color.White,\n\t\t\t\t\t\t\t\t\tPosition = new Vector3(lastTime, lastValue, 0.0f),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tB = new Microsoft.Xna.Framework.Graphics.VertexPositionColor\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tColor = Microsoft.Xna.Framework.Color.White,\n\t\t\t\t\t\t\t\t\tPosition = new Vector3(time, value, 0.0f),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmin = Math.Min(min, value);\n\t\t\t\t\t\tmax = Math.Max(max, value);\n\t\t\t\t\t\tlastValue = value;\n\t\t\t\t\t\tlastTime = time;\n\t\t\t\t\t\ttime += Session.Recorder.Interval;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (min < max)\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat scale = -timelineHeight / (max - min);\n\t\t\t\t\t\tlines.Scale.Value = new Vector2(1, scale);\n\t\t\t\t\t\tlines.Position.Value = new Vector2(0, max * -scale);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlines.AnchorPoint.Value = Vector2.Zero;\n\t\t\t\t\t\tif (min <= 0.0f)\n\t\t\t\t\t\t\tlines.Position.Value = new Vector2(0, timelineHeight);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tlines.Position.Value = new Vector2(0, timelineHeight * 0.5f);\n\t\t\t\t\t}\n\t\t\t\t\tlabel.Text.Value = max.ToString(\"F\");\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tAction refreshPropertyGraphs = delegate()\n\t\t\t{\n\t\t\t\tforeach (Container propertyTimeline in propertyTimelines.Children)\n\t\t\t\t\trefreshPropertyGraph(propertyTimeline);\n\t\t\t};\n\n\t\t\tpropertyTimelines.Add(new ListBinding<UIComponent, PropertyEntry>(propertyTimelines.Children, analyticsActiveProperties, delegate(PropertyEntry e)\n\t\t\t{\n\t\t\t\tContainer propertyTimeline = new Container();\n\t\t\t\tpropertyTimeline.Add(new Binding<Vector2>(propertyTimeline.Size, timeline.Size));\n\t\t\t\tpropertyTimeline.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\t\tpropertyTimeline.Opacity.Value = UIFactory.Opacity;\n\t\t\t\tpropertyTimeline.ResizeHorizontal.Value = false;\n\t\t\t\tpropertyTimeline.ResizeVertical.Value = false;\n\n\t\t\t\tLineDrawer2D line = new LineDrawer2D();\n\t\t\t\tline.Name.Value = \"Graph\";\n\t\t\t\tline.Color.Value = colorHash(e.Name);\n\t\t\t\tline.UserData.Value = e;\n\t\t\t\tpropertyTimeline.Children.Add(line);\n\n\t\t\t\tTextElement label = new TextElement();\n\t\t\t\tlabel.FontFile.Value = main.Font;\n\t\t\t\tlabel.Name.Value = \"Label\";\n\t\t\t\tlabel.Add(new Binding<Vector2>(label.Scale, x => new Vector2(1.0f / x.X, 1.0f / x.Y), timelines.Scale));\n\t\t\t\tlabel.AnchorPoint.Value = new Vector2(0, 0);\n\t\t\t\tlabel.Position.Value = new Vector2(0, 0);\n\t\t\t\tpropertyTimeline.Children.Add(label);\n\n\t\t\t\trefreshPropertyGraph(propertyTimeline);\n\n\t\t\t\treturn propertyTimeline;\n\t\t\t}));\n\n\t\t\tanalyticsActiveSessions.ItemAdded += delegate(int index, SessionEntry s)\n\t\t\t{\n\t\t\t\tSession.PositionProperty positionProperty = s.Session.PositionProperties[0];\n\t\t\t\tforeach (Session.EventList el in s.Session.Events)\n\t\t\t\t{\n\t\t\t\t\tif (analyticsActiveEvents.FirstOrDefault(x => x.Name == el.Name) != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tList<ModelInstance> models = new List<ModelInstance>();\n\t\t\t\t\t\tVector4 color = colorHash(el.Name);\n\t\t\t\t\t\tint hash = (int)(new Color(color).PackedValue);\n\t\t\t\t\t\tforeach (Session.Event e in el.Events)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tModelInstance i = new ModelInstance();\n\t\t\t\t\t\t\ti.Serialize = false;\n\t\t\t\t\t\t\ti.Setup(\"InstancedModels\\\\position-model\", hash);\n\t\t\t\t\t\t\tif (i.IsFirstInstance)\n\t\t\t\t\t\t\t\ti.Model.Color.Value = new Vector3(color.X, color.Y, color.Z);\n\t\t\t\t\t\t\ti.Transform.Value = Matrix.CreateTranslation(positionProperty.GetLastRecordedPosition(e.Time));\n\t\t\t\t\t\t\tentity.Add(i);\n\t\t\t\t\t\t\tmodels.Add(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t\teventPositionModels[el] = models;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tModelInstance instance = new ModelInstance();\n\t\t\t\tinstance.Setup(\"InstancedModels\\\\position-model\", 0);\n\t\t\t\tinstance.Serialize = false;\n\t\t\t\tentity.Add(instance);\n\t\t\t\tsessionPositionModels.Add(s.Session, instance);\n\t\t\t\ts.Active.Value = true;\n\t\t\t\ttimeline.Children.AddAll(s.Session.Events.Where(x => analyticsActiveEvents.FirstOrDefault(y => y.Name == x.Name) != null).Select(createEventLines));\n\t\t\t\tplaybackLocation.Reset();\n\n\t\t\t\trefreshPropertyGraphs();\n\t\t\t};\n\n\t\t\tanalyticsActiveSessions.ItemRemoved += delegate(int index, SessionEntry s)\n\t\t\t{\n\t\t\t\tModelInstance instance = sessionPositionModels[s.Session];\n\t\t\t\tinstance.Delete.Execute();\n\n\t\t\t\tforeach (KeyValuePair<Session.EventList, List<ModelInstance>> pair in eventPositionModels.ToList())\n\t\t\t\t{\n\t\t\t\t\tif (pair.Key.Session == s.Session)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (ModelInstance i in pair.Value)\n\t\t\t\t\t\t\ti.Delete.Execute();\n\t\t\t\t\t\teventPositionModels.Remove(pair.Key);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsessionPositionModels.Remove(s.Session);\n\t\t\t\ts.Active.Value = false;\n\t\t\t\ttimeline.Children.RemoveAll(timeline.Children.Where(x => x.UserData.Value != null && ((Session.EventList)x.UserData.Value).Session == s.Session).ToList());\n\n\t\t\t\trefreshPropertyGraphs();\n\t\t\t};\n\n\t\t\tentity.Add(new SetBinding<float>(playbackLocation, delegate(float value)\n\t\t\t{\n\t\t\t\tif (analyticsActiveSessions.Length == 0)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (value < 0.0f)\n\t\t\t\t\tplaybackLocation.Value = 0.0f;\n\t\t\t\tfloat end = analyticsActiveSessions.Max(x => x.Session.TotalTime);\n\t\t\t\tif (value > end)\n\t\t\t\t{\n\t\t\t\t\tplaybackLocation.Value = end;\n\t\t\t\t\tanalyticsPlaying.Value = false;\n\t\t\t\t}\n\n\t\t\t\tforeach (KeyValuePair<Session, ModelInstance> pair in sessionPositionModels)\n\t\t\t\t\tpair.Value.Transform.Value = Matrix.CreateTranslation(pair.Key.PositionProperties[0][playbackLocation]);\n\t\t\t}));\n\n\t\t\tLineDrawer2D playbackLine = new LineDrawer2D();\n\t\t\tplaybackLine.Color.Value = Vector4.One;\n\t\t\tplaybackLine.Lines.Add(new LineDrawer2D.Line\n\t\t\t{\n\t\t\t\tA = new Microsoft.Xna.Framework.Graphics.VertexPositionColor\n\t\t\t\t{\n\t\t\t\t\tColor = Microsoft.Xna.Framework.Color.White,\n\t\t\t\t\tPosition = new Vector3(0.0f, -10.0f, 0.0f),\n\t\t\t\t},\n\t\t\t\tB = new Microsoft.Xna.Framework.Graphics.VertexPositionColor\n\t\t\t\t{\n\t\t\t\t\tColor = Microsoft.Xna.Framework.Color.White,\n\t\t\t\t\tPosition = new Vector3(0.0f, timeline.Size.Value.Y, 0.0f),\n\t\t\t\t},\n\t\t\t});\n\t\t\tplaybackLine.Add(new Binding<Vector2, float>(playbackLine.Position, x => new Vector2(x, 0.0f), playbackLocation));\n\t\t\ttimeline.Children.Add(playbackLine);\n\n\t\t\tentity.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tallEventsButton.Detach();\n\t\t\t\tallSessionsButton.Detach();\n\t\t\t\tallPropertiesButton.Detach();\n\t\t\t\tanalyticsSessions.Clear();\n\t\t\t\tanalyticsEvents.Clear();\n\t\t\t\tanalyticsProperties.Clear();\n\t\t\t\teventList.Children.Add(allEventsButton);\n\t\t\t\tsessionList.Children.Add(allSessionsButton);\n\t\t\t\tpropertiesList.Children.Add(allPropertiesButton);\n\n\t\t\t\tforeach (ModelInstance instance in sessionPositionModels.Values)\n\t\t\t\t\tinstance.Delete.Execute();\n\t\t\t\tsessionPositionModels.Clear();\n\n\t\t\t\tforeach (ModelInstance instance in eventPositionModels.Values.SelectMany(x => x))\n\t\t\t\t\tinstance.Delete.Execute();\n\t\t\t\teventPositionModels.Clear();\n\n\t\t\t\tallEvents.Value = false;\n\t\t\t\tallSessions.Value = false;\n\t\t\t\tallProperties.Value = false;\n\t\t\t\tanalyticsEnable.Value = false;\n\n\t\t\t\tanalyticsActiveEvents.Clear();\n\t\t\t\tanalyticsActiveSessions.Clear();\n\t\t\t\tanalyticsActiveProperties.Clear();\n\n\t\t\t\tpropertyTimelines.Children.Clear();\n\n\t\t\t\tplaybackLine.Detach();\n\t\t\t\ttimeline.Children.Clear();\n\t\t\t\ttimeline.Children.Add(playbackLine);\n\n\t\t\t\tanalyticsPlaying.Value = false;\n\t\t\t\tplaybackLocation.Value = 0.0f;\n\t\t\t}, main.MapFile));\n\n\t\t\tEditorFactory.AddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Toggle analytics playback\", new PCInput.Chord { Modifier = Keys.LeftAlt, Key = Keys.A },  new Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tanalyticsPlaying.Value = !analyticsPlaying;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.MapCommands,\n\t\t\t\t() => analyticsEnable && !editor.MovementEnabled && analyticsActiveSessions.Length > 0,\n\t\t\t\tanalyticsEnable, editor.MovementEnabled, analyticsActiveSessions.Length\n\t\t\t);\n\n\t\t\tEditorFactory.AddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Stop analytics playback\", new PCInput.Chord { Key = Keys.Escape }, new Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tanalyticsPlaying.Value = false;\n\t\t\t\t\t}\n\t\t\t\t}, gui.MapCommands, () => analyticsPlaying, analyticsPlaying\n\t\t\t);\n\n\t\t\tContainer playbackContainer = new Container();\n\t\t\tplaybackContainer.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\tplaybackContainer.Opacity.Value = UIFactory.Opacity;\n\t\t\tsessionsSidebar.Children.Add(playbackContainer);\n\t\t\tplaybackContainer.Add(new CommandBinding<int>(playbackContainer.MouseScrolled, delegate(int delta)\n\t\t\t{\n\t\t\t\tplaybackSpeed.Value = Math.Max(1.0f, Math.Min(10.0f, playbackSpeed.Value + delta));\n\t\t\t}));\n\n\t\t\tTextElement playbackLabel = new TextElement();\n\t\t\tplaybackLabel.FontFile.Value = main.Font;\n\t\t\tplaybackLabel.Add(new Binding<string>(playbackLabel.Text, delegate()\n\t\t\t{\n\t\t\t\treturn string.Format(\"{0} {1} {2:F}x\", TimeTrialUI.SecondsToTimeString(playbackLocation), (analyticsPlaying ? \"Playing\" : \"Stopped\"), playbackSpeed);\n\t\t\t}, playbackLocation, playbackSpeed, analyticsPlaying));\n\t\t\tplaybackContainer.Children.Add(playbackLabel);\n\n\t\t\tContainer descriptionContainer = null;\n\n\t\t\tUpdater timelineUpdate = new Updater\n\t\t\t(\n\t\t\t\tdelegate(float dt)\n\t\t\t\t{\n\t\t\t\t\tbool setTimelinePosition = false;\n\n\t\t\t\t\tif (timelines.Highlighted || descriptionContainer != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (input.LeftMouseButton)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsetTimelinePosition = true;\n\t\t\t\t\t\t\tplaybackLocation.Value = Vector3.Transform(new Vector3(input.Mouse.Value.X, 0.0f, 0.0f), Matrix.Invert(timeline.GetAbsoluteTransform())).X;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfloat threshold = 3.0f / timelines.Scale.Value.X;\n\t\t\t\t\t\tfloat mouseRelative = Vector3.Transform(new Vector3(input.Mouse, 0.0f), Matrix.Invert(timelines.GetAbsoluteTransform())).X;\n\n\t\t\t\t\t\tif (descriptionContainer != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!timelines.Highlighted || (float)Math.Abs(descriptionContainer.Position.Value.X - mouseRelative) > threshold)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdescriptionContainer.Delete.Execute();\n\t\t\t\t\t\t\t\tdescriptionContainer = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (descriptionContainer == null && timeline.Highlighted)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach (UIComponent component in timeline.Children)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tLineDrawer2D lines = component as LineDrawer2D;\n\n\t\t\t\t\t\t\t\tif (lines == null)\n\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\tSession.EventList el = lines.UserData.Value as Session.EventList;\n\t\t\t\t\t\t\t\tif (el != null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbool stop = false;\n\t\t\t\t\t\t\t\t\tforeach (Session.Event e in el.Events)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (el != null && (float)Math.Abs(e.Time - mouseRelative) < threshold)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdescriptionContainer = new Container();\n\t\t\t\t\t\t\t\t\t\t\tdescriptionContainer.AnchorPoint.Value = new Vector2(0.5f, 1.0f);\n\t\t\t\t\t\t\t\t\t\t\tdescriptionContainer.Position.Value = new Vector2(e.Time, 0.0f);\n\t\t\t\t\t\t\t\t\t\t\tdescriptionContainer.Opacity.Value = 1.0f;\n\t\t\t\t\t\t\t\t\t\t\tdescriptionContainer.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\t\t\t\t\t\t\t\t\tdescriptionContainer.Add(new Binding<Vector2>(descriptionContainer.Scale, x => new Vector2(1.0f / x.X, 1.0f / x.Y), timelines.Scale));\n\t\t\t\t\t\t\t\t\t\t\ttimeline.Children.Add(descriptionContainer);\n\t\t\t\t\t\t\t\t\t\t\tTextElement description = new TextElement();\n\t\t\t\t\t\t\t\t\t\t\tdescription.WrapWidth.Value = 256;\n\n\t\t\t\t\t\t\t\t\t\t\tif (string.IsNullOrEmpty(e.Data))\n\t\t\t\t\t\t\t\t\t\t\t\tdescription.Text.Value = el.Name;\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\tdescription.Text.Value = string.Format(\"{0}\\n{1}\", el.Name, e.Data);\n\n\t\t\t\t\t\t\t\t\t\t\tdescription.FontFile.Value = main.Font;\n\t\t\t\t\t\t\t\t\t\t\tdescriptionContainer.Children.Add(description);\n\t\t\t\t\t\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (stop)\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (analyticsPlaying && !setTimelinePosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (analyticsActiveSessions.Length == 0)\n\t\t\t\t\t\t\tanalyticsPlaying.Value = false;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tplaybackLocation.Value += dt * playbackSpeed;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\tentity.Add(timelineUpdate);\n\t\t\ttimelineUpdate.EnabledInEditMode = true;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Editor/Editor.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Input;\n\nusing Lemma.Util;\nusing Lemma.Factories;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Editor : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic static Property<bool> EditorModelsVisible = new Property<bool> { Value = true };\n\t\tpublic static void SetupDefaultEditorComponents()\n\t\t{\n\t\t\tFactory<Main>.DefaultEditorComponents = delegate(Factory<Main> factory, Entity entity, Main main)\n\t\t\t{\n\t\t\t\tTransform transform = entity.Get<Transform>(\"Transform\");\n\t\t\t\tif (transform == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\t\tmodel.Filename.Value = \"AlphaModels\\\\sphere\";\n\t\t\t\tmodel.Color.Value = new Vector3(factory.Color.X, factory.Color.Y, factory.Color.Z);\n\t\t\t\tmodel.IsInstanced.Value = false;\n\t\t\t\tmodel.Scale.Value = new Vector3(0.5f);\n\t\t\t\tmodel.Serialize = false;\n\n\t\t\t\tentity.Add(\"EditorModel\", model);\n\n\t\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\t\t\t\tmodel.Add(new Binding<Matrix, Vector3>(model.Transform, x => Matrix.CreateTranslation(x), transform.Position));\n\t\t\t};\n\n\t\t\tFactory<Main>.GlobalEditorComponents = delegate(Entity entity, Main main)\n\t\t\t{\n\t\t\t\tTransform transform = entity.Get<Transform>(\"Transform\");\n\t\t\t\tif (transform != null)\n\t\t\t\t{\n\t\t\t\t\tLineDrawer connectionLines = new LineDrawer { Serialize = false };\n\t\t\t\t\tconnectionLines.Add(new Binding<bool>(connectionLines.Enabled, entity.EditorSelected));\n\n\t\t\t\t\tColor connectionLineColor = new Color(1.0f, 1.0f, 1.0f, 0.5f);\n\t\t\t\t\tListBinding<LineDrawer.Line, Entity.CommandLink> connectionBinding = new ListBinding<LineDrawer.Line, Entity.CommandLink>(connectionLines.Lines, entity.LinkedCommands, delegate(Entity.CommandLink link)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn new LineDrawer.Line\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tA = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(transform.Position, connectionLineColor),\n\t\t\t\t\t\t\tB = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(link.TargetEntity.Target.Get<Transform>(\"Transform\").Position, connectionLineColor)\n\t\t\t\t\t\t};\n\t\t\t\t\t}, x => x.TargetEntity.Target != null && x.TargetEntity.Target.Active);\n\t\t\t\t\tentity.Add(new NotifyBinding(delegate() { connectionBinding.OnChanged(null); }, entity.EditorSelected));\n\t\t\t\t\tentity.Add(new NotifyBinding(delegate() { connectionBinding.OnChanged(null); }, transform.Position));\n\t\t\t\t\tconnectionLines.Add(connectionBinding);\n\t\t\t\t\tentity.Add(connectionLines);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<Quaternion> Orientation = new Property<Quaternion>();\n\t\tpublic Property<bool> MovementEnabled = new Property<bool>();\n\t\tpublic ListProperty<Entity> SelectedEntities = new ListProperty<Entity>();\n\t\tpublic Property<Transform> SelectedTransform = new Property<Transform>();\n\t\tpublic Property<Voxel.t> Brush = new Property<Voxel.t>();\n\t\tpublic Property<Voxel.Coord> Jitter = new Property<Voxel.Coord>();\n\t\tpublic Property<float> JitterOctave = new Property<float> { Value = 10.0f };\n\t\tpublic Property<int> BrushSize = new Property<int>();\n\t\tpublic Property<bool> NeedsSave = new Property<bool>();\n\n\t\tpublic Func<bool> EnableCommands = () => true;\n\n\t\t// Input properties\n\t\tpublic Property<bool> VoxelEditMode = new Property<bool>();\n\t\tpublic Property<Vector2> Movement = new Property<Vector2>();\n\t\tpublic Property<Vector2> Mouse = new Property<Vector2>();\n\t\tpublic Property<bool> Up = new Property<bool>();\n\t\tpublic Property<bool> Down = new Property<bool>();\n\t\tpublic Property<bool> SpeedMode = new Property<bool>();\n\t\tpublic Property<bool> Extend = new Property<bool>();\n\t\tpublic Command StartFill = new Command();\n\t\tpublic Command StartEmpty = new Command();\n\t\tpublic Command StopFill = new Command();\n\t\tpublic Command StopEmpty = new Command();\n\t\tpublic Property<bool> EditSelection = new Property<bool>();\n\t\tpublic Property<Voxel.Coord> VoxelSelectionStart = new Property<Voxel.Coord>();\n\t\tpublic Property<Voxel.Coord> VoxelSelectionEnd = new Property<Voxel.Coord>();\n\t\tpublic Property<bool> VoxelSelectionActive = new Property<bool>();\n\t\tpublic Command VoxelRotateX = new Command();\n\t\tpublic Command VoxelRotateY = new Command();\n\t\tpublic Command VoxelRotateZ = new Command();\n\t\tpublic Command SelectContiguous = new Command();\n\t\tpublic Command SelectAllContiguous = new Command();\n\n\t\tpublic Property<bool> EnableCameraDistanceScroll = new Property<bool> { Value = true };\n\t\tpublic Property<float> CameraDistance = new Property<float> { Value = 10.0f };\n\n\t\tpublic Command<string> Spawn = new Command<string>();\n\t\tpublic Command Save = new Command();\n\t\tpublic Command DeleteSelected = new Command();\n\t\tpublic Command FocusView = new Command();\n\n\t\tpublic enum TransformModes { None, Translate, Rotate };\n\t\tpublic Property<TransformModes> TransformMode = new Property<TransformModes> { Value = TransformModes.None };\n\t\tpublic enum TransformAxes { All, X, Y, Z, LocalX, LocalY, LocalZ };\n\t\tpublic Property<TransformAxes> TransformAxis = new Property<TransformAxes> { Value = TransformAxes.All };\n\t\tpublic enum BrushShapes { Sphere, Cube }\n\t\tpublic Property<BrushShapes> BrushShape = new Property<BrushShapes> { Value = BrushShapes.Sphere };\n\t\tprotected Vector3 transformCenter;\n\t\tprotected Vector2 originalTransformMouse;\n\t\tprotected List<Matrix> offsetTransforms = new List<Matrix>();\n\n\t\tpublic Command VoxelDuplicate = new Command();\n\t\tpublic Command VoxelCopy = new Command();\n\t\tpublic Command VoxelPaste = new Command();\n\t\tpublic Command StartVoxelTranslation = new Command();\n\t\tpublic Command StartTranslation = new Command();\n\t\tpublic Command StartRotation = new Command();\n\t\tpublic Command CommitTransform = new Command();\n\t\tpublic Command RevertTransform = new Command();\n\t\tpublic Command PropagateMaterial = new Command();\n\t\tpublic Command IntersectMaterial = new Command();\n\t\tpublic Command PropagateMaterialAll = new Command();\n\t\tpublic Command PropagateMaterialBox = new Command();\n\t\tpublic Command SampleMaterial = new Command();\n\t\tpublic Command DeleteMaterial = new Command();\n\t\tpublic Command DeleteMaterialAll = new Command();\n\n\t\tpublic enum FillMode { None, Fill, Empty, ForceFill }\n\t\tpublic Property<FillMode> Fill = new Property<FillMode>();\n\n\t\tprivate Voxel.Coord originalSelectionStart;\n\t\tprivate Voxel.Coord originalSelectionEnd;\n\t\tprivate Voxel.Coord originalSelectionCoord;\n\t\tprivate bool voxelDuplicate;\n\n\t\tprivate Voxel.Snapshot mapState;\n\t\tprivate Voxel.Coord selectionStart;\n\t\tprivate Voxel.Coord lastCoord;\n\t\tprivate Voxel.Coord coord;\n\t\tprivate Noise3D generator;\n\t\tprivate float movementInterval;\n\t\tprivate int movementStreak;\n\t\t\n\t\tpublic void SaveWithCallback(Action callback = null)\n\t\t{\n\t\t\tif (!this.EnableCommands())\n\t\t\t\treturn;\n\n\t\t\tif (this.main.IsChallengeMap(this.main.MapFile))\n\t\t\t{\n\t\t\t\tbool editorUIVisible = Editor.EditorModelsVisible;\n\t\t\t\tfloat motionBlurAmount = this.main.Renderer.MotionBlurAmount;\n\t\t\t\tthis.main.Renderer.MotionBlurAmount.Value = 0;\n\t\t\t\tEditor.EditorModelsVisible.Value = false;\n\t\t\t\tEntity thumbnailCamera = WorldFactory.Instance.Get<World>().ThumbnailCamera.Value.Target;\n\t\t\t\tVector3 cameraPos = this.main.Camera.Position;\n\t\t\t\tMatrix cameraRotation = this.main.Camera.RotationMatrix;\n\t\t\t\tif (thumbnailCamera != null)\n\t\t\t\t{\n\t\t\t\t\tTransform thumbnailTransform = thumbnailCamera.Get<Transform>();\n\t\t\t\t\tthis.main.Camera.RotationMatrix.Value = Matrix.CreateFromQuaternion(thumbnailTransform.Quaternion);\n\t\t\t\t\tthis.main.Camera.Position.Value = thumbnailTransform.Position;\n\t\t\t\t}\n\n\t\t\t\tPoint size;\n#if VR\n\t\t\t\tif (this.main.VR)\n\t\t\t\t\tsize = this.main.VRActualScreenSize;\n\t\t\t\telse\n#endif\n\t\t\t\t\tsize = this.main.ScreenSize;\n\t\t\t\tthis.main.Screenshot.Take(size, delegate()\n\t\t\t\t{\n\t\t\t\t\tIO.MapLoader.Save(this.main, null, this.main.MapFile);\n\t\t\t\t\tstring mapDirectory = System.IO.Path.GetDirectoryName(this.main.GetFullMapPath());\n\t\t\t\t\tstring screenshotPath = System.IO.Path.Combine(mapDirectory, string.Format(\"{0}.png\", System.IO.Path.GetFileNameWithoutExtension(this.main.MapFile)));\n\t\t\t\t\tScreenshot.SavePng(this.main.Screenshot.Buffer, screenshotPath, size.X, size.Y);\n\t\t\t\t\tthis.NeedsSave.Value = false;\n\t\t\t\t\tif (thumbnailCamera != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.main.Camera.RotationMatrix.Value = cameraRotation;\n\t\t\t\t\t\tthis.main.Camera.Position.Value = cameraPos;\n\t\t\t\t\t}\n\t\t\t\t\tthis.main.Renderer.MotionBlurAmount.Value = motionBlurAmount;\n\t\t\t\t\tEditor.EditorModelsVisible.Value = true;\n\t\t\t\t\tif (callback != null)\n\t\t\t\t\t\tcallback();\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tIO.MapLoader.Save(this.main, null, this.main.MapFile);\n\t\t\t\tthis.NeedsSave.Value = false;\n\t\t\t\tif (callback != null)\n\t\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<Voxel.Coord> Coordinate = new Property<Voxel.Coord>(); // Readonly, for displaying to the UI\n\t\tpublic Property<Voxel.Coord> VoxelSelectionSize = new Property<Voxel.Coord>(); // Readonly, for displaying to the UI\n\n\t\tprivate bool justCommitedOrRevertedVoxelOperation;\n\n\t\tpublic Editor()\n\t\t{\n\t\t\tthis.BrushSize.Value = 1;\n\t\t\tthis.MovementEnabled.Value = true;\n\t\t\tthis.Orientation.Value = Quaternion.Identity;\n\t\t}\n\n\t\tprivate void restoreVoxel(Voxel.Coord start, Voxel.Coord end, bool eraseOriginal, int offsetX = 0, int offsetY = 0, int offsetZ = 0)\n\t\t{\n\t\t\tVoxel map = this.SelectedEntities[0].Get<Voxel>();\n\t\t\tList<Voxel.Coord> removals = new List<Voxel.Coord>();\n\t\t\tfor (int x = start.X; x < end.X; x++)\n\t\t\t{\n\t\t\t\tfor (int y = start.Y; y < end.Y; y++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = start.Z; z < end.Z; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.State desiredState;\n\t\t\t\t\t\tif (eraseOriginal && x >= this.originalSelectionStart.X && x < this.originalSelectionEnd.X\n\t\t\t\t\t\t\t&& y >= this.originalSelectionStart.Y && y < this.originalSelectionEnd.Y\n\t\t\t\t\t\t\t&& z >= this.originalSelectionStart.Z && z < this.originalSelectionEnd.Z)\n\t\t\t\t\t\t\tdesiredState = null;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdesiredState = this.mapState[new Voxel.Coord { X = x + offsetX, Y = y + offsetY, Z = z + offsetZ }];\n\t\t\t\t\t\tif (map[x, y, z] != desiredState)\n\t\t\t\t\t\t\tremovals.Add(new Voxel.Coord { X = x, Y = y, Z = z });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tmap.Empty(removals, true);\n\n\t\t\tfor (int x = start.X; x < end.X; x++)\n\t\t\t{\n\t\t\t\tfor (int y = start.Y; y < end.Y; y++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = start.Z; z < end.Z; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.State desiredState;\n\t\t\t\t\t\tif (eraseOriginal && x >= this.originalSelectionStart.X && x < this.originalSelectionEnd.X\n\t\t\t\t\t\t\t&& y >= this.originalSelectionStart.Y && y < this.originalSelectionEnd.Y\n\t\t\t\t\t\t\t&& z >= this.originalSelectionStart.Z && z < this.originalSelectionEnd.Z)\n\t\t\t\t\t\t\tdesiredState = null;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdesiredState = this.mapState[new Voxel.Coord { X = x + offsetX, Y = y + offsetY, Z = z + offsetZ }];\n\t\t\t\t\t\tif (desiredState != null && map[x, y, z] != desiredState)\n\t\t\t\t\t\t\tmap.Fill(x, y, z, desiredState);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tmap.Regenerate();\n\t\t}\n\n\t\tprivate void restoreVoxel(Voxel.Coord start, Voxel.Coord end, Direction dx, Direction dy, Direction dz)\n\t\t{\n\t\t\tVoxel map = this.SelectedEntities[0].Get<Voxel>();\n\t\t\tList<Voxel.Coord> removals = new List<Voxel.Coord>();\n\n\t\t\tfor (int x = start.X; x < end.X; x++)\n\t\t\t{\n\t\t\t\tfor (int y = start.Y; y < end.Y; y++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = start.Z; z < end.Z; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord c = new Voxel.Coord { X = x, Y = y, Z = z };\n\t\t\t\t\t\tVoxel.State desiredState = this.mapState[c];\n\t\t\t\t\t\tif (desiredState != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tc = c.Minus(this.coord).Reorient(dx, dy, dz).Plus(this.coord);\n\t\t\t\t\t\t\tmap.Fill(c.X, c.Y, c.Z, desiredState);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tmap.Regenerate();\n\t\t}\n\n\t\tprivate Voxel.State getBrush()\n\t\t{\n\t\t\treturn Voxel.States.All[this.Brush];\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.generator = new Noise3D();\n\n\t\t\tthis.Spawn.Action = delegate(string type)\n\t\t\t{\n\t\t\t\tif (Factory<Main>.Get(type) != null)\n\t\t\t\t{\n\t\t\t\t\tEntity entity = Factory<Main>.Get(type).CreateAndBind(this.main);\n\t\t\t\t\tTransform position = entity.Get<Transform>(\"Transform\");\n\t\t\t\t\tif (position != null)\n\t\t\t\t\t\tposition.Position.Value = this.Position;\n\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\tthis.main.Add(entity);\n\t\t\t\t\tthis.SelectedEntities.Clear();\n\t\t\t\t\tthis.SelectedEntities.Add(entity);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.Save.Action = delegate()\n\t\t\t{\n\t\t\t\tthis.SaveWithCallback(null);\n\t\t\t};\n\n\t\t\tthis.Add(new ChangeBinding<bool>(this.VoxelEditMode, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (value && !old)\n\t\t\t\t{\n\t\t\t\t\tthis.Orientation.Value = Quaternion.Normalize(Quaternion.CreateFromRotationMatrix(this.SelectedEntities[0].Get<Voxel>().Transform));\n\t\t\t\t\tthis.lastCoord = this.coord = this.SelectedEntities[0].Get<Voxel>().GetCoordinate(this.Position);\n\t\t\t\t\tthis.Coordinate.Value = this.coord;\n\t\t\t\t}\n\t\t\t\telse if (!value && old)\n\t\t\t\t{\n\t\t\t\t\tthis.Orientation.Value = Quaternion.Identity;\n\t\t\t\t\tthis.StopFill.Execute();\n\t\t\t\t\tthis.StopEmpty.Execute();\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis.SelectedEntities.ItemAdded += delegate(int index, Entity t)\n\t\t\t{\n\t\t\t\tt.EditorSelected.Value = true;\n\t\t\t\tthis.VoxelSelectionEnd.Value = this.VoxelSelectionStart.Value;\n\t\t\t\tthis.SelectedTransform.Value = null;\n\t\t\t};\n\n\t\t\tthis.SelectedEntities.ItemRemoved += delegate(int index, Entity t)\n\t\t\t{\n\t\t\t\tt.EditorSelected.Value = false;\n\t\t\t\tthis.VoxelSelectionEnd.Value = this.VoxelSelectionStart.Value;\n\t\t\t\tthis.SelectedTransform.Value = null;\n\t\t\t};\n\n\t\t\tthis.SelectedEntities.Clearing += delegate()\n\t\t\t{\n\t\t\t\tforeach (Entity e in this.SelectedEntities)\n\t\t\t\t\te.EditorSelected.Value = false;\n\t\t\t\tthis.VoxelSelectionEnd.Value = this.VoxelSelectionStart.Value;\n\t\t\t\tthis.SelectedTransform.Value = null;\n\t\t\t};\n\n\t\t\tthis.Add(new ChangeBinding<bool>(this.EditSelection, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (value && !old)\n\t\t\t\t{\n\t\t\t\t\tthis.selectionStart = this.coord;\n\t\t\t\t\tthis.VoxelSelectionStart.Value = this.coord;\n\t\t\t\t\tthis.VoxelSelectionEnd.Value = this.coord.Move(1, 1, 1);\n\t\t\t\t}\n\t\t\t\telse if (!value && old)\n\t\t\t\t{\n\t\t\t\t\tif (this.VoxelSelectionEnd.Value.Equivalent(this.VoxelSelectionStart.Value.Move(1, 1, 1)))\n\t\t\t\t\t\tthis.VoxelSelectionEnd.Value = this.VoxelSelectionStart.Value;\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis.VoxelCopy.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tif (this.VoxelEditMode && this.VoxelSelectionActive && this.TransformMode.Value == Editor.TransformModes.None)\n\t\t\t\t{\n\t\t\t\t\tVoxel m = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\t\tthis.originalSelectionStart = this.VoxelSelectionStart;\n\t\t\t\t\tthis.originalSelectionEnd = this.VoxelSelectionEnd;\n\t\t\t\t\tthis.originalSelectionCoord = this.coord;\n\t\t\t\t\tif (this.mapState != null)\n\t\t\t\t\t\tthis.mapState.Free();\n\t\t\t\t\tthis.mapState = new Voxel.Snapshot(m, this.originalSelectionStart, this.originalSelectionEnd);\n\t\t\t\t\tthis.voxelDuplicate = false;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.VoxelPaste.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tif (this.VoxelEditMode && this.mapState != null)\n\t\t\t\t{\n\t\t\t\t\tVoxel m = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\t\tVoxel.Coord newSelectionStart = this.coord.Plus(this.originalSelectionStart.Minus(this.originalSelectionCoord));\n\t\t\t\t\tthis.VoxelSelectionStart.Value = newSelectionStart;\n\t\t\t\t\tthis.VoxelSelectionEnd.Value = this.coord.Plus(this.originalSelectionEnd.Minus(this.originalSelectionCoord));\n\n\t\t\t\t\tVoxel.Coord offset = this.originalSelectionStart.Minus(newSelectionStart);\n\t\t\t\t\tthis.restoreVoxel(newSelectionStart, this.VoxelSelectionEnd, false, offset.X, offset.Y, offset.Z);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.SelectContiguous.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\n\t\t\t\tif (this.VoxelEditMode)\n\t\t\t\t{\n\t\t\t\t\tVoxel m = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\t\tVoxel.Box selectedBox = m.GetBox(this.coord);\n\t\t\t\t\tif (selectedBox != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord a = this.coord.Clone();\n\t\t\t\t\t\tVoxel.Coord b = this.coord.Clone();\n\t\t\t\t\t\tforeach (Voxel.Box box in m.GetContiguousByType(new[] { m.GetBox(this.coord) }))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta = new Voxel.Coord { X = Math.Min(a.X, box.X), Y = Math.Min(a.Y, box.Y), Z = Math.Min(a.Z, box.Z) };\n\t\t\t\t\t\t\tb = new Voxel.Coord { X = Math.Max(b.X, box.X + box.Width), Y = Math.Max(b.Y, box.Y + box.Height), Z = Math.Max(b.Z, box.Z + box.Depth) };\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.VoxelSelectionActive.Value = true;\n\t\t\t\t\t\tthis.VoxelSelectionStart.Value = a;\n\t\t\t\t\t\tthis.VoxelSelectionEnd.Value = b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.SelectAllContiguous.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\n\t\t\t\tif (this.VoxelEditMode)\n\t\t\t\t{\n\t\t\t\t\tVoxel m = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\t\tVoxel.Box selectedBox = m.GetBox(this.coord);\n\t\t\t\t\tif (selectedBox != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord a = this.coord.Clone();\n\t\t\t\t\t\tVoxel.Coord b = this.coord.Clone();\n\t\t\t\t\t\tforeach (Voxel.Box box in m.GetContiguous(new[] { selectedBox }, x => true))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta = new Voxel.Coord { X = Math.Min(a.X, box.X), Y = Math.Min(a.Y, box.Y), Z = Math.Min(a.Z, box.Z) };\n\t\t\t\t\t\t\tb = new Voxel.Coord { X = Math.Max(b.X, box.X + box.Width), Y = Math.Max(b.Y, box.Y + box.Height), Z = Math.Max(b.Z, box.Z + box.Depth) };\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.VoxelSelectionActive.Value = true;\n\t\t\t\t\t\tthis.VoxelSelectionStart.Value = a;\n\t\t\t\t\t\tthis.VoxelSelectionEnd.Value = b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.FocusView.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tVector3 pos = Vector3.Zero;\n\t\t\t\tforeach (Entity e in this.SelectedEntities)\n\t\t\t\t\tpos += e.Get<Transform>(\"Transform\").Position;\n\t\t\t\tpos /= this.SelectedEntities.Count;\n\t\t\t\tthis.Position.Value = pos;\n\t\t\t};\n\n\t\t\tthis.StartVoxelTranslation.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tif (this.VoxelEditMode && this.VoxelSelectionActive)\n\t\t\t\t{\n\t\t\t\t\tthis.VoxelCopy.Execute();\n\t\t\t\t\tthis.TransformMode.Value = TransformModes.Translate;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.VoxelDuplicate.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tif (this.VoxelEditMode && this.VoxelSelectionActive)\n\t\t\t\t{\n\t\t\t\t\tthis.StartVoxelTranslation.Execute();\n\t\t\t\t\tthis.voxelDuplicate = true;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.PropagateMaterial.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tif (!this.VoxelEditMode)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel m = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\tVoxel.Box selectedBox = m.GetBox(this.coord);\n\t\t\t\tif (selectedBox == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel.Coord startSelection = this.VoxelSelectionStart;\n\t\t\t\tVoxel.Coord endSelection = this.VoxelSelectionEnd;\n\t\t\t\tbool selectionActive = this.VoxelSelectionActive;\n\n\t\t\t\tVoxel.State material = this.getBrush();\n\t\t\t\tif (material != Voxel.States.Empty)\n\t\t\t\t{\n\t\t\t\t\tif (material == selectedBox.Type)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tIEnumerable<Voxel.Coord> coordEnumerable;\n\t\t\t\t\tif (selectionActive)\n\t\t\t\t\t\tcoordEnumerable = m.GetContiguousByType(new Voxel.Box[] { selectedBox }).SelectMany(x => x.GetCoords().Where(y => y.Between(startSelection, endSelection)));\n\t\t\t\t\telse\n\t\t\t\t\t\tcoordEnumerable = m.GetContiguousByType(new Voxel.Box[] { selectedBox }).SelectMany(x => x.GetCoords());\n\n\t\t\t\t\tList<Voxel.Coord> coords = coordEnumerable.ToList();\n\t\t\t\t\tm.Empty(coords, true);\n\t\t\t\t\tforeach (Voxel.Coord c in coords)\n\t\t\t\t\t\tm.Fill(c, material);\n\t\t\t\t\tm.Regenerate();\n\t\t\t\t}\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t};\n\n\t\t\tthis.IntersectMaterial.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tif (!this.VoxelEditMode)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel m = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\tVoxel.Box selectedBox = m.GetBox(this.coord);\n\t\t\t\tif (selectedBox == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel.Coord startSelection = this.VoxelSelectionStart;\n\t\t\t\tVoxel.Coord endSelection = this.VoxelSelectionEnd;\n\t\t\t\tbool selectionActive = this.VoxelSelectionActive;\n\n\t\t\t\tIEnumerable<Voxel.Coord> coordEnumerable;\n\t\t\t\tif (selectionActive)\n\t\t\t\t\tcoordEnumerable = m.GetContiguousByType(new Voxel.Box[] { selectedBox }).SelectMany(x => x.GetCoords().Where(y => !y.Between(startSelection, endSelection)));\n\t\t\t\telse\n\t\t\t\t\tcoordEnumerable = m.GetContiguousByType(new Voxel.Box[] { selectedBox }).SelectMany(x => x.GetCoords().Where(y => (m.GetRelativePosition(this.coord) - m.GetRelativePosition(y)).Length() > this.BrushSize));\n\n\t\t\t\tList<Voxel.Coord> coords = coordEnumerable.ToList();\n\t\t\t\tm.Empty(coords, true);\n\t\t\t\tm.Regenerate();\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t};\n\n\t\t\t// Propagate to all cells of a certain type, including non-contiguous ones\n\t\t\tthis.PropagateMaterialAll.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tif (!this.VoxelEditMode)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel m = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\tVoxel.Box selectedBox = m.GetBox(this.coord);\n\t\t\t\tif (selectedBox == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel.Coord startSelection = this.VoxelSelectionStart;\n\t\t\t\tVoxel.Coord endSelection = this.VoxelSelectionEnd;\n\t\t\t\tbool selectionActive = this.VoxelSelectionActive;\n\n\t\t\t\tVoxel.State oldMaterial = selectedBox.Type;\n\n\t\t\t\tVoxel.State material = this.getBrush();\n\t\t\t\tif (material != Voxel.States.Empty)\n\t\t\t\t{\n\t\t\t\t\tif (material == oldMaterial)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tIEnumerable<Voxel.Coord> coordsEnumerable = m.Chunks.SelectMany(x => x.Boxes).Where(x => x.Type == oldMaterial).SelectMany(x => x.GetCoords());\n\t\t\t\t\tif (selectionActive)\n\t\t\t\t\t\tcoordsEnumerable = coordsEnumerable.Where(x => x.Between(startSelection, endSelection));\n\t\t\t\t\tList<Voxel.Coord> coords = coordsEnumerable.ToList();\n\n\t\t\t\t\tm.Empty(coords, true);\n\t\t\t\t\tforeach (Voxel.Coord c in coords)\n\t\t\t\t\t\tm.Fill(c, material);\n\t\t\t\t\tm.Regenerate();\n\t\t\t\t}\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t};\n\n\t\t\tthis.PropagateMaterialBox.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tif (!this.VoxelEditMode)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel m = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\tVoxel.Box selectedBox = m.GetBox(this.coord);\n\t\t\t\tif (selectedBox == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel.Coord startSelection = this.VoxelSelectionStart;\n\t\t\t\tVoxel.Coord endSelection = this.VoxelSelectionEnd;\n\t\t\t\tbool selectionActive = this.VoxelSelectionActive;\n\n\t\t\t\tVoxel.State material = this.getBrush();\n\t\t\t\tif (material != Voxel.States.Empty)\n\t\t\t\t{\n\t\t\t\t\tif (material == selectedBox.Type)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tIEnumerable<Voxel.Coord> coordEnumerable;\n\t\t\t\t\tif (selectionActive)\n\t\t\t\t\t\tcoordEnumerable = selectedBox.GetCoords().Where(y => y.Between(startSelection, endSelection));\n\t\t\t\t\telse\n\t\t\t\t\t\tcoordEnumerable = selectedBox.GetCoords();\n\n\t\t\t\t\tList<Voxel.Coord> coords = coordEnumerable.ToList();\n\t\t\t\t\tm.Empty(coords, true);\n\t\t\t\t\tforeach (Voxel.Coord c in coords)\n\t\t\t\t\t\tm.Fill(c, material);\n\t\t\t\t\tm.Regenerate();\n\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.StartFill.Action = delegate()\n\t\t\t{\n\t\t\t\tthis.Fill.Value = this.Fill == FillMode.Empty ? FillMode.ForceFill : FillMode.Fill;\n\t\t\t};\n\n\t\t\tthis.StopFill.Action = delegate()\n\t\t\t{\n\t\t\t\tthis.Fill.Value = FillMode.None;\n\t\t\t};\n\n\t\t\tthis.StartEmpty.Action = delegate()\n\t\t\t{\n\t\t\t\tthis.Fill.Value = this.Fill == FillMode.Fill ? FillMode.ForceFill : FillMode.Empty;\n\t\t\t};\n\n\t\t\tthis.StopEmpty.Action = delegate()\n\t\t\t{\n\t\t\t\tthis.Fill.Value = this.Fill == FillMode.ForceFill ? FillMode.Fill : FillMode.None;\n\t\t\t};\n\n\t\t\tAction<Direction, Direction, Direction, Voxel.Coord> rotate = delegate(Direction x, Direction y, Direction z, Voxel.Coord selectionOffset)\n\t\t\t{\n\t\t\t\tthis.VoxelCopy.Execute();\n\t\t\t\tthis.NeedsSave.Value = true;\n\n\t\t\t\tVoxel.Coord oldSelectionStart = this.VoxelSelectionStart;\n\t\t\t\tVoxel.Coord oldSelectionEnd = this.VoxelSelectionEnd;\n\t\t\t\tVoxel.Coord newSelectionStart = this.VoxelSelectionStart.Value.Minus(this.coord).Reorient(x, y, z).Plus(this.coord).Plus(selectionOffset);\n\t\t\t\tVoxel.Coord newSelectionEnd = this.VoxelSelectionEnd.Value.Minus(this.coord).Reorient(x, y, z).Plus(this.coord).Plus(selectionOffset);\n\t\t\t\tthis.VoxelSelectionStart.Value = new Voxel.Coord\n\t\t\t\t{\n\t\t\t\t\tX = Math.Min(newSelectionStart.X, newSelectionEnd.X),\n\t\t\t\t\tY = Math.Min(newSelectionStart.Y, newSelectionEnd.Y),\n\t\t\t\t\tZ = Math.Min(newSelectionStart.Z, newSelectionEnd.Z),\n\t\t\t\t};\n\t\t\t\tthis.VoxelSelectionEnd.Value = new Voxel.Coord\n\t\t\t\t{\n\t\t\t\t\tX = Math.Max(newSelectionStart.X, newSelectionEnd.X),\n\t\t\t\t\tY = Math.Max(newSelectionStart.Y, newSelectionEnd.Y),\n\t\t\t\t\tZ = Math.Max(newSelectionStart.Z, newSelectionEnd.Z),\n\t\t\t\t};\n\n\t\t\t\tVoxel map = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\tforeach (Voxel.Coord c in oldSelectionStart.CoordinatesBetween(oldSelectionEnd))\n\t\t\t\t\tVoxel.CoordSetCache.Add(c);\n\t\t\t\tforeach (Voxel.Coord c in this.VoxelSelectionStart.Value.CoordinatesBetween(this.VoxelSelectionEnd))\n\t\t\t\t\tVoxel.CoordSetCache.Add(c);\n\t\t\t\tmap.Empty(Voxel.CoordSetCache, true);\n\t\t\t\tVoxel.CoordSetCache.Clear();\n\n\t\t\t\tthis.restoreVoxel(oldSelectionStart, oldSelectionEnd, x, y, z);\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t};\n\n\t\t\tthis.VoxelRotateX.Action = delegate()\n\t\t\t{\n\t\t\t\trotate(Direction.PositiveX, Direction.PositiveZ, Direction.NegativeY, new Voxel.Coord { X = 0, Y = 1, Z = 0 });\n\t\t\t};\n\n\t\t\tthis.VoxelRotateY.Action = delegate()\n\t\t\t{\n\t\t\t\trotate(Direction.NegativeZ, Direction.PositiveY, Direction.PositiveX, new Voxel.Coord { X = 0, Y = 0, Z = 1 });\n\t\t\t};\n\n\t\t\tthis.VoxelRotateZ.Action = delegate()\n\t\t\t{\n\t\t\t\trotate(Direction.NegativeY, Direction.PositiveX, Direction.PositiveZ, new Voxel.Coord { X = 0, Y = 1, Z = 0 });\n\t\t\t};\n\n\t\t\tthis.SampleMaterial.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tif (!this.VoxelEditMode)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel m = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\tVoxel.Box selectedBox = m.GetBox(this.coord);\n\t\t\t\tif (selectedBox == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tthis.Brush.Value = selectedBox.Type.ID;\n\t\t\t};\n\n\t\t\tthis.DeleteMaterial.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tif (!this.VoxelEditMode)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel m = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\tVoxel.Box selectedBox = m.GetBox(this.coord);\n\t\t\t\tif (selectedBox == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel.Coord startSelection = this.VoxelSelectionStart;\n\t\t\t\tVoxel.Coord endSelection = this.VoxelSelectionEnd;\n\t\t\t\tbool selectionActive = this.VoxelSelectionActive;\n\n\t\t\t\tIEnumerable<Voxel.Coord> coordEnumerable;\n\t\t\t\tif (selectionActive)\n\t\t\t\t\tcoordEnumerable = m.GetContiguousByType(new Voxel.Box[] { selectedBox }).SelectMany(x => x.GetCoords().Where(y => y.Between(startSelection, endSelection)));\n\t\t\t\telse\n\t\t\t\t\tcoordEnumerable = m.GetContiguousByType(new Voxel.Box[] { selectedBox }).SelectMany(x => x.GetCoords());\n\n\t\t\t\tList<Voxel.Coord> coords = coordEnumerable.ToList();\n\t\t\t\tm.Empty(coords, true);\n\t\t\t\tm.Regenerate();\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t};\n\n\t\t\t// Delete all cells of a certain type in the current map, including non-contiguous ones\n\t\t\tthis.DeleteMaterialAll.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tif (!this.VoxelEditMode)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel m = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\tVoxel.Box selectedBox = m.GetBox(this.coord);\n\t\t\t\tif (selectedBox == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tVoxel.State material = selectedBox.Type;\n\n\t\t\t\tIEnumerable<Voxel.Box> boxes = m.Chunks.SelectMany(x => x.Boxes).Where(x => x.Type == material);\n\t\t\t\tif (this.VoxelSelectionActive)\n\t\t\t\t\tboxes = boxes.Where(x => x.Between(this.VoxelSelectionStart, this.VoxelSelectionEnd));\n\n\t\t\t\tIEnumerable<Voxel.Coord> coords = boxes.SelectMany(x => x.GetCoords());\n\n\t\t\t\tif (this.VoxelSelectionActive)\n\t\t\t\t\tcoords = coords.Where(x => x.Between(this.VoxelSelectionStart, this.VoxelSelectionEnd));\n\n\t\t\t\tm.Empty(coords.ToList(), true);\n\t\t\t\tm.Regenerate();\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t};\n\n\t\t\tAction<TransformModes> startTransform = delegate(TransformModes mode)\n\t\t\t{\n\t\t\t\tif (this.SelectedEntities.Length == 0)\n\t\t\t\t\treturn;\n\n\t\t\t\tthis.TransformMode.Value = mode;\n\t\t\t\tthis.TransformAxis.Value = TransformAxes.All;\n\t\t\t\tthis.originalTransformMouse = this.Mouse;\n\t\t\t\tthis.offsetTransforms.Clear();\n\t\t\t\tthis.transformCenter = Vector3.Zero;\n\t\t\t\tif (this.SelectedTransform.Value != null)\n\t\t\t\t{\n\t\t\t\t\tthis.offsetTransforms.Add(this.SelectedTransform.Value.Matrix);\n\t\t\t\t\tthis.transformCenter = this.SelectedTransform.Value.Position;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tint entityCount = 0;\n\t\t\t\t\tforeach (Entity entity in this.SelectedEntities)\n\t\t\t\t\t{\n\t\t\t\t\t\tTransform transform = entity.Get<Transform>(\"Transform\");\n\t\t\t\t\t\tif (transform != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.offsetTransforms.Add(transform.Matrix);\n\t\t\t\t\t\t\tthis.transformCenter += transform.Position;\n\t\t\t\t\t\t\tentityCount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.transformCenter /= (float)entityCount;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.StartTranslation.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tstartTransform(TransformModes.Translate);\n\t\t\t};\n\n\t\t\tthis.StartRotation.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tstartTransform(TransformModes.Rotate);\n\t\t\t};\n\n\t\t\tthis.CommitTransform.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\tthis.TransformMode.Value = TransformModes.None;\n\t\t\t\tthis.TransformAxis.Value = TransformAxes.All;\n\t\t\t\tif (this.VoxelEditMode)\n\t\t\t\t\tthis.justCommitedOrRevertedVoxelOperation = true;\n\t\t\t\tthis.offsetTransforms.Clear();\n\t\t\t};\n\n\t\t\tthis.RevertTransform.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tthis.TransformMode.Value = TransformModes.None;\n\t\t\t\tif (this.VoxelEditMode)\n\t\t\t\t{\n\t\t\t\t\tthis.restoreVoxel(this.VoxelSelectionStart, this.VoxelSelectionEnd, false);\n\t\t\t\t\tthis.VoxelSelectionStart.Value = this.originalSelectionStart;\n\t\t\t\t\tthis.VoxelSelectionEnd.Value = this.originalSelectionEnd;\n\t\t\t\t\tthis.restoreVoxel(this.VoxelSelectionStart, this.VoxelSelectionEnd, false);\n\t\t\t\t\tthis.justCommitedOrRevertedVoxelOperation = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.TransformAxis.Value = TransformAxes.All;\n\t\t\t\t\tif (this.SelectedTransform.Value != null)\n\t\t\t\t\t\tthis.SelectedTransform.Value.Matrix.Value = this.offsetTransforms[0];\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tint i = 0;\n\t\t\t\t\t\tforeach (Entity entity in this.SelectedEntities)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tTransform transform = entity.Get<Transform>(\"Transform\");\n\t\t\t\t\t\t\tif (transform != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttransform.Matrix.Value = this.offsetTransforms[i];\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.offsetTransforms.Clear();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.DeleteSelected.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.EnableCommands())\n\t\t\t\t\treturn;\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\tthis.TransformMode.Value = TransformModes.None;\n\t\t\t\tthis.TransformAxis.Value = TransformAxes.All;\n\t\t\t\tthis.offsetTransforms.Clear();\n\t\t\t\tforeach (Entity entity in this.SelectedEntities)\n\t\t\t\t{\n\t\t\t\t\tif (entity.EditorCanDelete)\n\t\t\t\t\t\tentity.Delete.Execute();\n\t\t\t\t}\n\t\t\t\tthis.SelectedEntities.Clear();\n\t\t\t};\n\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tbool active;\n\t\t\t\tif (!this.VoxelEditMode)\n\t\t\t\t\tactive = false;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tVoxel.Coord start = this.VoxelSelectionStart, end = this.VoxelSelectionEnd;\n\t\t\t\t\tactive = start.X != end.X && start.Y != end.Y && start.Z != end.Z;\n\t\t\t\t}\n\t\t\t\tif (this.VoxelSelectionActive != active)\n\t\t\t\t\tthis.VoxelSelectionActive.Value = active;\n\t\t\t}, this.VoxelEditMode, this.VoxelSelectionStart, this.VoxelSelectionEnd));\n\n\t\t\tthis.Add(new Binding<Voxel.Coord>(this.VoxelSelectionSize, delegate()\n\t\t\t{\n\t\t\t\tVoxel.Coord a = this.VoxelSelectionStart, b = this.VoxelSelectionEnd;\n\t\t\t\treturn new Voxel.Coord { X = b.X - a.X, Y = b.Y - a.Y, Z = b.Z - a.Z };\n\t\t\t}, this.VoxelSelectionStart, this.VoxelSelectionEnd));\n\t\t}\n\n\t\tpublic void Update(float elapsedTime)\n\t\t{\n\t\t\tVector3 movementDir = new Vector3();\n\t\t\tthis.movementInterval += elapsedTime;\n\n\t\t\tif (this.MovementEnabled)\n\t\t\t{\n\t\t\t\tVector2 controller = this.main.Camera.GetWorldSpaceControllerCoordinates(this.Movement);\n\t\t\t\tmovementDir = new Vector3(controller.X, 0, controller.Y);\n\t\t\t\tif (this.Up)\n\t\t\t\t\tmovementDir = movementDir.SetComponent(Direction.PositiveY, 1.0f);\n\t\t\t\telse if (this.Down)\n\t\t\t\t\tmovementDir = movementDir.SetComponent(Direction.NegativeY, 1.0f);\n\t\t\t\t\t\n\t\t\t\tif (this.VoxelEditMode)\n\t\t\t\t{\n\t\t\t\t\tVoxel map = this.SelectedEntities[0].Get<Voxel>();\n\n\t\t\t\t\t// When the user lets go of the key, reset the timer\n\t\t\t\t\t// That way they can hit the key faster than the 0.1 sec interval\n\t\t\t\t\tif (movementDir.LengthSquared() > 0.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat movementIntervalThreshold;\n\t\t\t\t\t\tif (this.movementStreak == 0)\n\t\t\t\t\t\t\tmovementIntervalThreshold = 0;\n\t\t\t\t\t\telse if (this.movementStreak == 1)\n\t\t\t\t\t\t\tmovementIntervalThreshold = this.SpeedMode ? 0.1f : 0.15f;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmovementIntervalThreshold = (this.SpeedMode ? 0.35f : 0.75f) * Math.Min(0.15f, map.Scale / this.CameraDistance);\n\t\t\t\t\t\tif (this.movementInterval >  movementIntervalThreshold)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.movementStreak++;\n\t\t\t\t\t\t\tthis.movementInterval = 0.0f;\n\t\t\t\t\t\t\tDirection relativeDir = map.GetRelativeDirection(movementDir);\n\t\t\t\t\t\t\tthis.coord = this.coord.Move(relativeDir);\n\t\t\t\t\t\t\tthis.Coordinate.Value = this.coord;\n\t\t\t\t\t\t\tif (this.EditSelection)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.VoxelSelectionStart.Value = new Voxel.Coord\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tX = Math.Min(this.selectionStart.X, this.coord.X),\n\t\t\t\t\t\t\t\t\tY = Math.Min(this.selectionStart.Y, this.coord.Y),\n\t\t\t\t\t\t\t\t\tZ = Math.Min(this.selectionStart.Z, this.coord.Z),\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tthis.VoxelSelectionEnd.Value = new Voxel.Coord\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tX = Math.Max(this.selectionStart.X, this.coord.X) + 1,\n\t\t\t\t\t\t\t\t\tY = Math.Max(this.selectionStart.Y, this.coord.Y) + 1,\n\t\t\t\t\t\t\t\t\tZ = Math.Max(this.selectionStart.Z, this.coord.Z) + 1,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (this.TransformMode.Value == TransformModes.Translate)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\n\t\t\t\t\t\t\t\tthis.restoreVoxel(this.VoxelSelectionStart, this.VoxelSelectionEnd, !this.voxelDuplicate);\n\n\t\t\t\t\t\t\t\tVoxel.Coord newSelectionStart = this.VoxelSelectionStart.Value.Move(relativeDir);\n\t\t\t\t\t\t\t\tthis.VoxelSelectionStart.Value = newSelectionStart;\n\t\t\t\t\t\t\t\tthis.VoxelSelectionEnd.Value = this.VoxelSelectionEnd.Value.Move(relativeDir);\n\n\t\t\t\t\t\t\t\tthis.mapState.Add(this.VoxelSelectionStart, this.VoxelSelectionEnd);\n\n\t\t\t\t\t\t\t\tVoxel.Coord offset = this.originalSelectionStart.Minus(newSelectionStart);\n\t\t\t\t\t\t\t\tthis.restoreVoxel(newSelectionStart, this.VoxelSelectionEnd, false, offset.X, offset.Y, offset.Z);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.movementStreak = 0;\n\n\t\t\t\t\tthis.Position.Value = map.GetAbsolutePosition(this.coord);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.Position.Value = this.Position.Value + movementDir * (this.SpeedMode ? 5.0f : 2.5f) * this.CameraDistance * elapsedTime;\n\t\t\t}\n\n\t\t\tif (this.VoxelEditMode)\n\t\t\t{\n\t\t\t\tif (this.Fill == FillMode.None)\n\t\t\t\t\tthis.justCommitedOrRevertedVoxelOperation = false;\n\n\t\t\t\tVoxel map = this.SelectedEntities[0].Get<Voxel>();\n\t\t\t\tVoxel.Coord coord = map.GetCoordinate(this.Position);\n\t\t\t\tif (this.TransformMode.Value == TransformModes.None && (this.Fill != FillMode.None || this.Extend) && !this.justCommitedOrRevertedVoxelOperation)\n\t\t\t\t{\n\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\tif (this.Fill != FillMode.None)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.VoxelSelectionActive)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.Jitter.Value.Equivalent(new Voxel.Coord { X = 0, Y = 0, Z = 0 }) || this.BrushSize <= 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tswitch (this.Fill.Value)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcase FillMode.Fill:\n\t\t\t\t\t\t\t\t\t\tmap.Fill(this.VoxelSelectionStart, this.VoxelSelectionEnd, this.getBrush());\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase FillMode.Empty:\n\t\t\t\t\t\t\t\t\t\tmap.Empty(this.VoxelSelectionStart, this.VoxelSelectionEnd, true);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tVoxel.Coord start = this.VoxelSelectionStart;\n\t\t\t\t\t\t\t\tVoxel.Coord end = this.VoxelSelectionEnd;\n\t\t\t\t\t\t\t\tint size = this.BrushSize;\n\t\t\t\t\t\t\t\tint halfSize = size / 2;\n\t\t\t\t\t\t\t\tfor (int x = start.X + size - 1; x < end.X - size + 1; x += halfSize)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfor (int y = start.Y + size - 1; y < end.Y - size + 1; y += halfSize)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tfor (int z = start.Z + size - 1; z < end.Z - size + 1; z += halfSize)\n\t\t\t\t\t\t\t\t\t\t\tthis.brushStroke(map, new Voxel.Coord { X = x, Y = y, Z = z });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthis.brushStroke(map, coord);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.Extend && !this.coord.Equivalent(this.lastCoord))\n\t\t\t\t\t{\n\t\t\t\t\t\tDirection dir = DirectionExtensions.GetDirectionFromVector(Vector3.TransformNormal(movementDir, Matrix.Invert(map.Transform)));\n\t\t\t\t\t\tVoxel.Box box = map.GetBox(this.lastCoord);\n\t\t\t\t\t\tbool grow = map.GetBox(this.coord) != box;\n\t\t\t\t\t\tif (box != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tList<Voxel.Coord> removals = new List<Voxel.Coord>();\n\t\t\t\t\t\t\tif (dir.IsParallel(Direction.PositiveX))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (int y = box.Y; y < box.Y + box.Height; y++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfor (int z = box.Z; z < box.Z + box.Depth; z++)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (grow)\n\t\t\t\t\t\t\t\t\t\t\tmap.Fill(this.coord.X, y, z, box.Type);\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tremovals.Add(map.GetCoordinate(this.lastCoord.X, y, z));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (dir.IsParallel(Direction.PositiveY))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (int x = box.X; x < box.X + box.Width; x++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfor (int z = box.Z; z < box.Z + box.Depth; z++)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (grow)\n\t\t\t\t\t\t\t\t\t\t\tmap.Fill(x, this.coord.Y, z, box.Type);\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tremovals.Add(map.GetCoordinate(x, this.lastCoord.Y, z));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (dir.IsParallel(Direction.PositiveZ))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (int x = box.X; x < box.X + box.Width; x++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfor (int y = box.Y; y < box.Y + box.Height; y++)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (grow)\n\t\t\t\t\t\t\t\t\t\t\tmap.Fill(x, y, this.coord.Z, box.Type);\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tremovals.Add(map.GetCoordinate(x, y, this.lastCoord.Z));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmap.Empty(removals, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmap.Regenerate();\n\t\t\t\t}\n\t\t\t\tthis.lastCoord = this.coord;\n\t\t\t}\n\t\t\telse if (this.TransformMode.Value == TransformModes.Translate)\n\t\t\t{\n\t\t\t\t// Translate entities\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\tfloat rayLength = (this.transformCenter - this.main.Camera.Position.Value).Length();\n\t\t\t\tVector2 mouseOffset = this.Mouse - this.originalTransformMouse;\n\t\t\t\tVector3 offset = ((this.main.Camera.Right.Value * mouseOffset.X * rayLength) + (this.main.Camera.Up.Value * -mouseOffset.Y * rayLength)) * 0.0025f;\n\t\t\t\tMatrix localRotation = this.offsetTransforms.Count == 1 ? this.offsetTransforms[0] : Matrix.Identity;\n\t\t\t\tswitch (this.TransformAxis.Value)\n\t\t\t\t{\n\t\t\t\t\tcase TransformAxes.X:\n\t\t\t\t\t\toffset.Y = offset.Z = 0.0f;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TransformAxes.Y:\n\t\t\t\t\t\toffset.X = offset.Z = 0.0f;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TransformAxes.Z:\n\t\t\t\t\t\toffset.X = offset.Y = 0.0f;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TransformAxes.LocalX:\n\t\t\t\t\t\toffset = localRotation.Right * Vector3.Dot(offset, localRotation.Right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TransformAxes.LocalY:\n\t\t\t\t\t\toffset = localRotation.Up * Vector3.Dot(offset, localRotation.Up);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TransformAxes.LocalZ:\n\t\t\t\t\t\toffset = localRotation.Forward * Vector3.Dot(offset, localRotation.Forward);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (this.SelectedTransform.Value != null)\n\t\t\t\t\tthis.SelectedTransform.Value.Position.Value = this.offsetTransforms[0].Translation + offset;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tforeach (Entity entity in this.SelectedEntities)\n\t\t\t\t\t{\n\t\t\t\t\t\tTransform transform = entity.Get<Transform>(\"Transform\");\n\t\t\t\t\t\tif (transform != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tMatrix originalTransform = this.offsetTransforms[i];\n\t\t\t\t\t\t\ttransform.Position.Value = originalTransform.Translation + offset;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (this.TransformMode.Value == TransformModes.Rotate)\n\t\t\t{\n\t\t\t\t// Rotate entities\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\tVector3 screenSpaceCenter = this.main.GraphicsDevice.Viewport.Project(this.transformCenter, this.main.Camera.Projection, this.main.Camera.View, Matrix.Identity);\n\t\t\t\tVector2 originalOffset = new Vector2(this.originalTransformMouse.X - screenSpaceCenter.X, this.originalTransformMouse.Y - screenSpaceCenter.Y);\n\t\t\t\tfloat originalAngle = (float)Math.Atan2(originalOffset.Y, originalOffset.X);\n\t\t\t\tVector2 newOffset = new Vector2(this.Mouse.Value.X - screenSpaceCenter.X, this.Mouse.Value.Y - screenSpaceCenter.Y);\n\t\t\t\tfloat newAngle = (float)Math.Atan2(newOffset.Y, newOffset.X);\n\t\t\t\tVector3 axis = this.main.Camera.Forward;\n\t\t\t\tMatrix localRotation = this.offsetTransforms.Count == 1 ? this.offsetTransforms[0] : Matrix.Identity;\n\t\t\t\tswitch (this.TransformAxis.Value)\n\t\t\t\t{\n\t\t\t\t\tcase TransformAxes.X:\n\t\t\t\t\t\taxis = Vector3.Right;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TransformAxes.Y:\n\t\t\t\t\t\taxis = Vector3.Up;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TransformAxes.Z:\n\t\t\t\t\t\taxis = Vector3.Forward;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TransformAxes.LocalX:\n\t\t\t\t\t\taxis = Vector3.Normalize(localRotation.Right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TransformAxes.LocalY:\n\t\t\t\t\t\taxis = Vector3.Normalize(localRotation.Up);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TransformAxes.LocalZ:\n\t\t\t\t\t\taxis = Vector3.Normalize(localRotation.Forward);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (this.SelectedTransform.Value != null)\n\t\t\t\t{\n\t\t\t\t\tMatrix originalTransform = this.offsetTransforms[0];\n\t\t\t\t\toriginalTransform.Translation -= this.transformCenter;\n\t\t\t\t\toriginalTransform *= Matrix.CreateFromAxisAngle(axis, newAngle - originalAngle);\n\t\t\t\t\toriginalTransform.Translation += this.transformCenter;\n\t\t\t\t\tthis.SelectedTransform.Value.Matrix.Value = originalTransform;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tforeach (Entity entity in this.SelectedEntities)\n\t\t\t\t\t{\n\t\t\t\t\t\tTransform transform = entity.Get<Transform>(\"Transform\");\n\t\t\t\t\t\tif (transform != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tMatrix originalTransform = this.offsetTransforms[i];\n\t\t\t\t\t\t\toriginalTransform.Translation -= this.transformCenter;\n\t\t\t\t\t\t\toriginalTransform *= Matrix.CreateFromAxisAngle(axis, newAngle - originalAngle);\n\t\t\t\t\t\t\toriginalTransform.Translation += this.transformCenter;\n\t\t\t\t\t\t\ttransform.Matrix.Value = originalTransform;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected Voxel.Coord jitter(Voxel map, Voxel.Coord coord)\n\t\t{\n\t\t\tVoxel.Coord jitter = this.Jitter;\n\t\t\tVoxel.Coord sample = coord.Clone();\n\t\t\tcoord.X += (int)Math.Round(this.generator.Sample(map, sample.Move(0, 0, map.ChunkSize * 2), this.JitterOctave) * jitter.X);\n\t\t\tcoord.Y += (int)Math.Round(this.generator.Sample(map, sample.Move(map.ChunkSize * 2, 0, 0), this.JitterOctave) * jitter.Y);\n\t\t\tcoord.Z += (int)Math.Round(this.generator.Sample(map, sample.Move(0, map.ChunkSize * 2, 0), this.JitterOctave) * jitter.Z);\n\t\t\treturn coord;\n\t\t}\n\n\t\tprotected void brushStroke(Voxel map, Voxel.Coord center)\n\t\t{\n\t\t\tint size = this.BrushSize;\n\t\t\tcenter = this.jitter(map, center);\n\n\t\t\tVoxel.State state = this.getBrush();\n\t\t\tif (this.Fill == FillMode.Empty)\n\t\t\t\tstate = Voxel.States.Empty;\n\n\t\t\tBrushShapes shape = this.BrushShape;\n\t\t\tVector3 pos = map.GetRelativePosition(center);\n\t\t\tList<Voxel.Coord> coords = new List<Voxel.Coord>();\n\t\t\tfor (Voxel.Coord x = center.Move(Direction.NegativeX, size - 1); x.X < center.X + size; x.X++)\n\t\t\t{\n\t\t\t\tfor (Voxel.Coord y = x.Move(Direction.NegativeY, size - 1); y.Y < center.Y + size; y.Y++)\n\t\t\t\t{\n\t\t\t\t\tfor (Voxel.Coord z = y.Move(Direction.NegativeZ, size - 1); z.Z < center.Z + size; z.Z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((shape == BrushShapes.Cube || (pos - map.GetRelativePosition(z)).Length() <= size)\n\t\t\t\t\t\t\t&& map[z] != state)\n\t\t\t\t\t\t\tcoords.Add(z);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch (this.Fill.Value)\n\t\t\t{\n\t\t\t\tcase FillMode.Empty:\n\t\t\t\t\tmap.Empty(coords, true);\n\t\t\t\t\tbreak;\n\t\t\t\tcase FillMode.Fill:\n\t\t\t\t\tforeach (Voxel.Coord coord in coords)\n\t\t\t\t\t\tmap.Fill(coord, state);\n\t\t\t\t\tbreak;\n\t\t\t\tcase FillMode.ForceFill:\n\t\t\t\t\tmap.Empty(coords, true);\n\t\t\t\t\tforeach (Voxel.Coord coord in coords)\n\t\t\t\t\t\tmap.Fill(coord, state);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Editor/EditorGeeUI.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.Remoting.Messaging;\nusing System.Text;\nusing System.Windows.Forms;\nusing GeeUI.Managers;\nusing GeeUI.ViewLayouts;\nusing GeeUI.Views;\nusing Lemma.GInterfaces;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing System.Reflection;\nusing System.Collections;\nusing Microsoft.Xna.Framework.Input;\nusing System.Xml.Serialization;\nusing Lemma.Util;\nusing ComponentBind;\nusing Keys = Microsoft.Xna.Framework.Input.Keys;\nusing ListView = GeeUI.Views.ListView;\nusing View = GeeUI.Views.View;\nusing System.IO;\nusing Lemma.Console;\n\nnamespace Lemma.Components\n{\n\tpublic class EditorGeeUI : Component<Main>\n\t{\n\t\tprivate const float TextFieldHeight = 19;\n\t\tprivate const string decimalRegex = \"^-?\\\\d+[,\\\\.]?\\\\d*$\";\n\t\tprivate const string integerRegex = \"^-?\\\\d+$\";\n\t\tpublic struct EditorCommand\n\t\t{\n\t\t\tpublic string Description;\n\t\t\tpublic PCInput.Chord Chord;\n\t\t\tpublic Command Action;\n\t\t\tpublic Property<bool> Enabled;\n\t\t}\n\n\t\tprivate View RootEditorView;\n\n\t\tprivate TabHost TabViews;\n\n\t\tpublic PanelView MapPanelView;\n\n\t\tprivate PanelView EntityPanelView;\n\n\t\tprivate PanelView VoxelPanelView;\n\n\t\tprivate DropDownView CreateDropDownView;\n\n\t\tprivate DropDownView SelectDropDownView;\n\n\t\tprivate DropDownView OpenDropDownView;\n\n\t\tprivate PanelView PropertiesView;\n\n\t\tprivate PanelView LinkerView;\n\n\t\tprivate PanelView EntityListView;\n\n\t\tpublic ListProperty<Entity> SelectedEntities = new ListProperty<Entity>();\n\n\t\tpublic Command<Entity> SelectEntity = new Command<Entity>();\n\n\t\tpublic Property<bool> VoxelEditMode = new Property<bool>();\n\n\t\tpublic Property<Editor.TransformModes> TransformMode = new Property<Editor.TransformModes>();\n\n\t\tpublic Property<bool> VoxelSelectionActive = new Property<bool>();\n\n\t\tpublic ListProperty<EditorCommand> EntityCommands = new ListProperty<EditorCommand>();\n\n\t\tpublic ListProperty<EditorCommand> MapCommands = new ListProperty<EditorCommand>();\n\n\t\tpublic ListProperty<EditorCommand> VoxelCommands = new ListProperty<EditorCommand>();\n\n\t\tpublic ListProperty<EditorCommand> AddEntityCommands = new ListProperty<EditorCommand>();\n\n\t\tpublic Property<bool> NeedsSave = new Property<bool>();\n\n\t\tpublic Property<bool> Visible = new Property<bool> { Value = true };\n\n\t\tpublic Command ShowContextMenu = new Command();\n\n\t\tpublic Command ShowOpenMenu = new Command();\n\n\t\tpublic Command ShowSelectMenu = new Command();\n\n\t\tpublic Property<bool> PickNextEntity = new Property<bool>();\n\n\t\tpublic Property<bool> MovementEnabled = new Property<bool>();\n\n\t\tpublic Command<Entity> EntityPicked = new Command<Entity>();\n\n\t\tprivate DropDownView entityPickerDropDown;\n\t\tprivate View reactivateViewAfterPickingEntity;\n\t\tprivate ButtonView resetSelectButtonAfterPickingEntity;\n\n\t\tprivate TextView selectPrompt;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tLemma.Console.Console.AddConVar(new ConVar(\"editor_ui\", \"Editor UI visibility\", delegate(string value)\n\t\t\t{\n\t\t\t\tthis.Visible.Value = (bool)Console.Console.GetConVar(\"editor_ui\").GetCastedValue();\n\t\t\t}, \"true\") { TypeConstraint = typeof(bool) });\n\t\t\tthis.Add(new TwoWayBinding<bool>(Editor.EditorModelsVisible, this.Visible));\n\n\t\t\tthis.RootEditorView = new View(this.main.GeeUI, this.main.GeeUI.RootView);\n\t\t\tthis.Add(new Binding<bool>(this.RootEditorView.Active, () => this.Visible && !ConsoleUI.Showing && !this.main.Menu.Showing, this.Visible, ConsoleUI.Showing, this.main.Menu.Showing));\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (!this.RootEditorView.Active)\n\t\t\t\t{\n\t\t\t\t\tthis.PropertiesView.Active.Value = false;\n\t\t\t\t\tthis.EntityListView.Active.Value = false;\n\t\t\t\t\tthis.LinkerView.Active.Value = false;\n\t\t\t\t}\n\t\t\t}, this.RootEditorView.Active));\n\n\t\t\tthis.selectPrompt = new TextView(this.main.GeeUI, this.main.GeeUI.RootView, \"Select an entity\", Vector2.Zero);\n\t\t\tthis.selectPrompt.Add(new Binding<Vector2, MouseState>(this.selectPrompt.Position, x => new Vector2(x.X + 16, x.Y + 16), this.main.MouseState));\n\t\t\tthis.selectPrompt.Add(new Binding<bool>(this.selectPrompt.Active, () => this.PickNextEntity && !this.MovementEnabled, this.PickNextEntity, this.MovementEnabled));\n\n\t\t\tthis.TabViews = new TabHost(this.main.GeeUI, this.RootEditorView, Vector2.Zero);\n\t\t\tthis.MapPanelView = new PanelView(this.main.GeeUI, null, Vector2.Zero);\n\t\t\tthis.MapPanelView.ChildrenLayouts.Add(new VerticalViewLayout(4, true, 4));\n\n\t\t\tthis.EntityPanelView = new PanelView(this.main.GeeUI, null, Vector2.Zero);\n\t\t\tthis.EntityPanelView.ChildrenLayouts.Add(new VerticalViewLayout(4, true, 4));\n\n\t\t\tthis.VoxelPanelView = new PanelView(this.main.GeeUI, null, Vector2.Zero);\n\t\t\tthis.VoxelPanelView.ChildrenLayouts.Add(new VerticalViewLayout(4, true, 4));\n\n\t\t\tTabViews.AddTab(\"Map\", this.MapPanelView);\n\t\t\tTabViews.AddTab(\"Entity\", this.EntityPanelView);\n\t\t\tTabViews.AddTab(\"Voxel\", this.VoxelPanelView);\n\t\t\tTabViews.SetActiveTab(TabViews.TabIndex(\"Map\"));\n\n\t\t\tthis.CreateDropDownView = new DropDownView(main.GeeUI, null, Vector2.Zero);\n\t\t\tthis.CreateDropDownView.Label.Value = \"Add [Space]\";\n\t\t\tthis.CreateDropDownView.FilterThreshhold.Value = 0;\n\t\t\tthis.CreateDropDownView.AllowRightClickExecute.Value = true;\n\t\t\tthis.SelectDropDownView = new DropDownView(main.GeeUI, null, Vector2.Zero);\n\t\t\tthis.SelectDropDownView.FilterThreshhold.Value = 0;\n\t\t\tthis.SelectDropDownView.Label.Value = \"Select [Shift+Space]\";\n\n\t\t\tthis.OpenDropDownView = new DropDownView(main.GeeUI, null, Vector2.Zero);\n\t\t\tthis.OpenDropDownView.FilterThreshhold.Value = 0;\n\t\t\tthis.OpenDropDownView.Label.Value = \"Open [Ctrl+O]\";\n\n\t\t\tthis.CreateDropDownView.Add(new Binding<bool>(this.CreateDropDownView.Active, () => this.main.GeeUI.KeyboardEnabled && !string.IsNullOrEmpty(this.main.MapFile), this.main.GeeUI.KeyboardEnabled, this.main.MapFile));\n\t\t\tthis.SelectDropDownView.Add(new Binding<bool>(this.SelectDropDownView.Active, this.main.GeeUI.KeyboardEnabled));\n\t\t\tthis.OpenDropDownView.Add(new Binding<bool>(this.OpenDropDownView.Active, this.main.GeeUI.KeyboardEnabled));\n\n\t\t\tthis.ShowContextMenu.Action = delegate()\n\t\t\t{\n\t\t\t\tif (this.Visible)\n\t\t\t\t{\n\t\t\t\t\tif (this.TabViews.GetActiveTab() == \"Voxel\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.voxelMaterialDropDown != null && this.voxelMaterialDropDown.Active && !this.voxelMaterialDropDown.DropDownShowing)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.OpenDropDownView.HideDropDown();\n\t\t\t\t\t\t\tthis.SelectDropDownView.HideDropDown();\n\t\t\t\t\t\t\tthis.CreateDropDownView.HideDropDown();\n\t\t\t\t\t\t\tthis.voxelMaterialDropDown.ShowDropDown();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (this.CreateDropDownView.Active && !this.CreateDropDownView.DropDownShowing)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.TabViews.SetActiveTab(this.TabViews.TabIndex(\"Entity\"));\n\t\t\t\t\t\tthis.OpenDropDownView.HideDropDown();\n\t\t\t\t\t\tthis.SelectDropDownView.HideDropDown();\n\t\t\t\t\t\tthis.CreateDropDownView.ShowDropDown();\n\t\t\t\t\t\tif (this.voxelMaterialDropDown != null)\n\t\t\t\t\t\t\tthis.voxelMaterialDropDown.HideDropDown();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.ShowOpenMenu.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.VoxelEditMode && this.Visible)\n\t\t\t\t{\n\t\t\t\t\tthis.TabViews.SetActiveTab(this.TabViews.TabIndex(\"Map\"));\n\t\t\t\t\tthis.OpenDropDownView.ShowDropDown();\n\t\t\t\t\tthis.SelectDropDownView.HideDropDown();\n\t\t\t\t\tthis.CreateDropDownView.HideDropDown();\n\t\t\t\t\tif (this.voxelMaterialDropDown != null)\n\t\t\t\t\t\tthis.voxelMaterialDropDown.HideDropDown();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.ShowSelectMenu.Action = delegate()\n\t\t\t{\n\t\t\t\tif (!this.VoxelEditMode && this.Visible)\n\t\t\t\t{\n\t\t\t\t\tthis.TabViews.SetActiveTab(this.TabViews.TabIndex(\"Entity\"));\n\t\t\t\t\tthis.OpenDropDownView.HideDropDown();\n\t\t\t\t\tthis.SelectDropDownView.ShowDropDown();\n\t\t\t\t\tthis.CreateDropDownView.HideDropDown();\n\t\t\t\t\tif (this.voxelMaterialDropDown != null)\n\t\t\t\t\t\tthis.voxelMaterialDropDown.HideDropDown();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.PropertiesView = new PanelView(main.GeeUI, main.GeeUI.RootView, new Vector2(5, 5));\n\t\t\tvar ListPropertiesView = new ListView(main.GeeUI, PropertiesView) { Name = \"PropertiesList\" };\n\t\t\tListPropertiesView.Position.Value = new Vector2(5, 5);\n\t\t\tListPropertiesView.ChildrenLayouts.Add(new VerticalViewLayout(4, false));\n\t\t\tListPropertiesView.ChildrenLayouts.Add(new ExpandToFitLayout(false, true) { ExtraWidth = 5 });\n\n\t\t\tListPropertiesView.Add(new Binding<int>(ListPropertiesView.Height, PropertiesView.Height));\n\n\t\t\tPropertiesView.ChildrenLayouts.Add(new ExpandToFitLayout(false, true));\n\n\t\t\tRootEditorView.Add(new Binding<int, Point>(RootEditorView.Width, point => point.X, main.ScreenSize));\n\t\t\tTabViews.Add(new Binding<int, int>(TabViews.Width, i => i, RootEditorView.Width));\n\n\t\t\t// Linker view\n\t\t\t{\n\t\t\t\tLinkerView = new PanelView(main.GeeUI, main.GeeUI.RootView, Vector2.Zero);\n\t\t\t\tLinkerView.Width.Value = 400;\n\t\t\t\tLinkerView.Height.Value = 300;\n\t\t\t\tLinkerView.Active.Value = false;\n\n\t\t\t\tvar DestLayout = new View(main.GeeUI, LinkerView) { Name = \"DestLayout\" };\n\t\t\t\tDestLayout.ChildrenLayouts.Add(new VerticalViewLayout(2, false));\n\t\t\t\tDestLayout.ChildrenLayouts.Add(new ExpandToFitLayout());\n\t\t\t\tnew TextView(main.GeeUI, DestLayout, \"Target:\", Vector2.Zero);\n\t\t\t\tvar entityDropDownLayout = new View(main.GeeUI, DestLayout);\n\t\t\t\tentityDropDownLayout.ChildrenLayouts.Add(new HorizontalViewLayout());\n\t\t\t\tentityDropDownLayout.ChildrenLayouts.Add(new ExpandToFitLayout());\n\t\t\t\tvar destEntityDropDown = new DropDownView(main.GeeUI, entityDropDownLayout, new Vector2())\n\t\t\t\t{\n\t\t\t\t\tName = \"DestEntityDropDown\"\n\t\t\t\t};\n\t\t\t\tdestEntityDropDown.FilterThreshhold.Value = 0;\n\n\t\t\t\tvar selectButton = new ButtonView(main.GeeUI, entityDropDownLayout, \"Select\", Vector2.Zero);\n\t\t\t\tselectButton.OnMouseClick += delegate(object sender, EventArgs e)\n\t\t\t\t{\n\t\t\t\t\tthis.LinkerView.Active.Value = false;\n\t\t\t\t\tthis.PickNextEntity.Value = true;\n\t\t\t\t\tthis.entityPickerDropDown = destEntityDropDown;\n\t\t\t\t\tthis.reactivateViewAfterPickingEntity = this.LinkerView;\n\t\t\t\t\tselectButton.Text = \"Select ->\";\n\t\t\t\t\tthis.resetSelectButtonAfterPickingEntity = selectButton;\n\t\t\t\t};\n\n\t\t\t\t//Padding\n\t\t\t\tnew View(main.GeeUI, DestLayout).Height.Value = 5;\n\t\t\t\tnew TextView(main.GeeUI, DestLayout, \"Command:\", Vector2.Zero);\n\t\t\t\tnew DropDownView(main.GeeUI, DestLayout, new Vector2())\n\t\t\t\t{\n\t\t\t\t\tName = \"DestCommandDropDown\"\n\t\t\t\t};\n\n\t\t\t\tvar container = new PanelView(main.GeeUI, LinkerView, Vector2.Zero);\n\t\t\t\tvar list = new ListView(main.GeeUI, container) { Name = \"CurLinksList\" };\n\t\t\t\tlist.Position.Value = new Vector2(5);\n\n\t\t\t\tlist.ChildrenLayouts.Add(new VerticalViewLayout(1, false));\n\t\t\t\tcontainer.Add(new Binding<int>(container.Width, (i) => i - 10, LinkerView.Width));\n\t\t\t\tlist.Add(new Binding<int>(list.Width, container.Width));\n\n\t\t\t\tcontainer.Position.Value = new Vector2(5, 120);\n\n\t\t\t\tcontainer.Height.Value = list.Height.Value = (LinkerView.Height.Value - container.Y) - 15;\n\t\t\t\tDestLayout.Position.Value = new Vector2(10, 10);\n\n\t\t\t\tvar addButton = new ButtonView(main.GeeUI, LinkerView, \"Link\", Vector2.Zero) { Name = \"AddButton\" };\n\t\t\t\taddButton.AnchorPoint.Value = new Vector2(1, 1);\n\t\t\t\taddButton.Position.Value = new Vector2(LinkerView.Width - 10, container.Y - 10);\n\t\t\t\taddButton.Active.Value = false;\n\n\t\t\t\tHideLinkerView();\n\t\t\t}\n\n\t\t\tthis.EntityPicked.Action = delegate(Entity e)\n\t\t\t{\n\t\t\t\tif (e != null)\n\t\t\t\t\tthis.entityPickerDropDown.SetSelectedOption(this.entityString(e));\n\t\t\t\tthis.PickNextEntity.Value = false;\n\t\t\t\tif (this.reactivateViewAfterPickingEntity != null)\n\t\t\t\t{\n\t\t\t\t\tthis.reactivateViewAfterPickingEntity.Active.Value = true;\n\t\t\t\t\tthis.reactivateViewAfterPickingEntity = null;\n\t\t\t\t}\n\t\t\t\tif (this.resetSelectButtonAfterPickingEntity != null)\n\t\t\t\t{\n\t\t\t\t\tthis.resetSelectButtonAfterPickingEntity.Text = \"Select\";\n\t\t\t\t\tthis.resetSelectButtonAfterPickingEntity = null;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Entity list view\n\t\t\t{\n\t\t\t\tEntityListView = new PanelView(main.GeeUI, main.GeeUI.RootView, Vector2.Zero);\n\t\t\t\tEntityListView.Width.Value = 400;\n\t\t\t\tEntityListView.Height.Value = 300;\n\t\t\t\tEntityListView.Active.Value = false;\n\n\t\t\t\tvar entityDropDownLayout = new View(main.GeeUI, EntityListView);\n\t\t\t\tentityDropDownLayout.ChildrenLayouts.Add(new HorizontalViewLayout());\n\t\t\t\tentityDropDownLayout.ChildrenLayouts.Add(new ExpandToFitLayout());\n\t\t\t\tvar entityDropDown = new DropDownView(main.GeeUI, entityDropDownLayout, new Vector2())\n\t\t\t\t{\n\t\t\t\t\tName = \"EntityDropDown\"\n\t\t\t\t};\n\n\t\t\t\tentityDropDown.FilterThreshhold.Value = 0;\n\n\t\t\t\tvar selectButton = new ButtonView(main.GeeUI, entityDropDownLayout, \"Select\", Vector2.Zero);\n\t\t\t\tselectButton.OnMouseClick += delegate(object sender, EventArgs e)\n\t\t\t\t{\n\t\t\t\t\tthis.EntityListView.Active.Value = false;\n\t\t\t\t\tthis.PickNextEntity.Value = true;\n\t\t\t\t\tthis.entityPickerDropDown = entityDropDown;\n\t\t\t\t\tthis.reactivateViewAfterPickingEntity = this.EntityListView;\n\t\t\t\t\tselectButton.Text = \"Select ->\";\n\t\t\t\t\tthis.resetSelectButtonAfterPickingEntity = selectButton;\n\t\t\t\t};\n\n\t\t\t\tvar container = new PanelView(main.GeeUI, EntityListView, Vector2.Zero);\n\t\t\t\tvar list = new ListView(main.GeeUI, container) { Name = \"EntityList\" };\n\t\t\t\tlist.Position.Value = new Vector2(5);\n\n\t\t\t\tlist.ChildrenLayouts.Add(new VerticalViewLayout(1, false));\n\t\t\t\tcontainer.Add(new Binding<int>(container.Width, (i) => i - 10, EntityListView.Width));\n\t\t\t\tlist.Add(new Binding<int>(list.Width, container.Width));\n\n\t\t\t\tcontainer.Position.Value = new Vector2(5, 110);\n\n\t\t\t\tcontainer.Height.Value = list.Height.Value = (EntityListView.Height.Value - container.Y) - 5;\n\t\t\t\tentityDropDownLayout.Position.Value = new Vector2(10, 10);\n\n\t\t\t\tvar addButton = new ButtonView(main.GeeUI, EntityListView, \"[+]\", Vector2.Zero) { Name = \"AddButton\" };\n\t\t\t\taddButton.AnchorPoint.Value = new Vector2(1, 1);\n\t\t\t\taddButton.Position.Value = new Vector2(EntityListView.Width - 10, container.Y - 10);\n\n\t\t\t\tthis.EntityListView.Active.Value = false;\n\t\t\t}\n\n#if VR\n\t\t\tif (this.main.VR)\n\t\t\t\tRootEditorView.Position.Value = new Vector2(0, 160);\n#endif\n\t\t\tRootEditorView.Height.Value = TabViews.Height.Value = 160;\n\n\t\t\tPropertiesView.Add(new Binding<Vector2>(PropertiesView.Position, () => new Vector2(0, RootEditorView.Height + RootEditorView.Position.Value.Y), RootEditorView.Height, RootEditorView.Position));\n\t\t\tPropertiesView.Add(new Binding<int, Point>(PropertiesView.Height, point => point.Y - PropertiesView.AbsoluteBoundBox.Top - 15, main.ScreenSize));\n\n\t\t\tthis.Add(new ListNotifyBinding<Entity>(this.refresh, this.SelectedEntities));\n\n\t\t\tthis.Add(new Binding<bool>(this.PropertiesView.Active, () => this.SelectedEntities.Length > 0 && !this.VoxelEditMode && this.Visible && !ConsoleUI.Showing, this.VoxelEditMode, this.SelectedEntities.Length, this.Visible, ConsoleUI.Showing));\n\n\t\t\tthis.Add(new ListBinding<View, EditorCommand>(this.EntityPanelView.Children, this.EntityCommands, this.buildCommandButton));\n\t\t\tthis.Add(new ListBinding<View, EditorCommand>(this.MapPanelView.Children, this.MapCommands, this.buildCommandButton));\n\t\t\tthis.MapPanelView.Children.Add(this.OpenDropDownView);\n\t\t\tthis.EntityPanelView.Children.Add(this.CreateDropDownView);\n\t\t\tthis.EntityPanelView.Children.Add(this.SelectDropDownView);\n\n\t\t\tthis.Add(new ListBinding<View, EditorCommand>(this.VoxelPanelView.Children, this.VoxelCommands, this.buildCommandButton));\n\n\t\t\t// We only ever add commands to this list. I don't feel like doing an actual binding right now.\n\t\t\tthis.AddEntityCommands.ItemAdded += delegate(int index, EditorCommand cmd)\n\t\t\t{\n\t\t\t\tstring text = cmd.Description;\n\t\t\t\tif (cmd.Chord.Exists)\n\t\t\t\t\ttext += \" [\" + cmd.Chord.ToString() + \"]\";\n\t\t\t\tButtonView option = CreateDropDownView.AddOption(text, cmd.Action.Execute);\n\t\t\t\toption.Add(new Binding<bool>(option.Active, cmd.Enabled));\n\t\t\t};\n\n\t\t\tthis.SelectDropDownView.Add(new CommandBinding(this.SelectDropDownView.OnShowing, (Action)this.RebuildSelectDropDown));\n\t\t\tthis.OpenDropDownView.Add(new CommandBinding(this.OpenDropDownView.OnShowing, (Action)this.RebuildOpenDropDown));\n\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (this.VoxelEditMode)\n\t\t\t\t\tthis.TabViews.SetActiveTab(this.TabViews.TabIndex(\"Voxel\"));\n\t\t\t}, this.VoxelEditMode));\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tLemma.Console.Console.RemoveConVar(\"editor_ui\");\n\t\t\tthis.RootEditorView.RemoveFromParent();\n\t\t\tthis.selectPrompt.RemoveFromParent();\n\t\t\tthis.PropertiesView.RemoveFromParent();\n\t\t\tthis.LinkerView.RemoveFromParent();\n\t\t\tthis.EntityListView.RemoveFromParent();\n\t\t}\n\n\t\tprivate DropDownView voxelMaterialDropDown;\n\n\t\tpublic void SetVoxelProperties(Dictionary<string, PropertyEntry> props)\n\t\t{\n\t\t\tforeach (KeyValuePair<string, PropertyEntry> prop in props)\n\t\t\t{\n\t\t\t\tView view = this.buildProperty(prop.Key, prop.Value);\n\t\t\t\tif (prop.Value.Property is Property<Voxel.t>)\n\t\t\t\t\tthis.voxelMaterialDropDown = (DropDownView)view.FindFirstChildByName(\"Dropdown\");\n\t\t\t\tthis.VoxelPanelView.Children.Add(view);\n\t\t\t}\n\t\t}\n\n\t\tprivate View buildProperty(string name, PropertyEntry entry)\n\t\t{\n\t\t\tbool sameLine;\n\t\t\tvar child = BuildValueView(entry, out sameLine);\n\t\t\tView containerLabel = BuildContainerLabel(name, sameLine);\n\t\t\tcontainerLabel.Children.Add(child);\n\t\t\tif (entry.Data.Visible != null)\n\t\t\t\tcontainerLabel.Add(new Binding<bool>(containerLabel.Active, entry.Data.Visible));\n\t\t\tcontainerLabel.SetToolTipText(entry.Data.Description);\n\t\t\treturn containerLabel;\n\t\t}\n\n\t\tprivate View buildCommandButton(EditorCommand cmd)\n\t\t{\n\t\t\tstring text;\n\t\t\tif (cmd.Chord.Exists)\n\t\t\t\ttext = string.Format(\"{0} [{1}]\", cmd.Description, cmd.Chord);\n\t\t\telse\n\t\t\t\ttext = cmd.Description;\n\t\t\tvar button = new ButtonView(main.GeeUI, null, text, Vector2.Zero);\n\t\t\tbutton.OnMouseClick += (sender, args) => cmd.Action.Execute();\n\t\t\tbutton.Add(new Binding<bool>(button.Active, cmd.Enabled));\n\t\t\treturn button;\n\t\t}\n\n\t\tprivate string entityString(Entity e)\n\t\t{\n\t\t\treturn e == null ? \"[null]\" : e.ToString();\n\t\t}\n\n\t\tpublic void RebuildSelectDropDown()\n\t\t{\n\t\t\tthis.SelectDropDownView.RemoveAllOptions();\n\t\t\tforeach (var ent in main.Entities)\n\t\t\t{\n\t\t\t\tif (ent != this.Entity)\n\t\t\t\t{\n\t\t\t\t\tEntity ent1 = ent;\n\t\t\t\t\tthis.SelectDropDownView.AddOption(this.entityString(ent), () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.SelectEntity.Execute(ent1);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void RebuildOpenDropDown()\n\t\t{\n\t\t\tthis.OpenDropDownView.RemoveAllOptions();\n\t\t\tIEnumerable<string> maps;\n\t\t\tif (this.main.Settings.GodModeProperty)\n\t\t\t{\n\t\t\t\tmaps = Directory.GetFiles(this.main.MapDirectory, \"*\" + IO.MapLoader.MapExtension)\n\t\t\t\t\t.Concat(Directory.GetFiles(Path.Combine(this.main.MapDirectory, \"Challenge\"), \"*\" + IO.MapLoader.MapExtension))\n\t\t\t\t\t.Concat(Directory.GetFiles(this.main.Content.RootDirectory, \"*\" + IO.MapLoader.MapExtension))\n\t\t\t\t\t.Concat(Directory.GetFiles(this.main.CustomMapDirectory, \"*\" + IO.MapLoader.MapExtension));\n\t\t\t}\n\t\t\telse\n\t\t\t\tmaps = Directory.GetFiles(this.main.CustomMapDirectory, \"*\" + IO.MapLoader.MapExtension);\n\n\t\t\tforeach (string m in maps)\n\t\t\t{\n\t\t\t\tthis.OpenDropDownView.AddOption(Path.GetFileNameWithoutExtension(m), () =>\n\t\t\t\t{\n\t\t\t\t\tIO.MapLoader.LoadKeepEditor(this.main, Path.GetFullPath(m));\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tpublic void HideLinkerView()\n\t\t{\n\t\t\tLinkerView.Active.Value = false;\n\t\t}\n\n\t\tpublic void ShowLinkerView(ButtonView button, Command.Entry select)\n\t\t{\n\t\t\tLinkerView.Active.Value = true;\n\t\t\tLinkerView.Position.Value = new Vector2(PropertiesView.AbsoluteBoundBox.Right, InputManager.GetMousePosV().Y);\n\t\t\tLinkerView.BringToFront();\n\t\t\tBindLinker(button, SelectedEntities[0], select);\n\t\t\tif (LinkerView.AbsoluteBoundBox.Bottom > main.GeeUI.RootView.AbsoluteBoundBox.Bottom)\n\t\t\t{\n\t\t\t\tLinkerView.Y -= (LinkerView.AbsoluteBoundBox.Bottom - main.GeeUI.RootView.AbsoluteBoundBox.Bottom);\n\t\t\t}\n\t\t}\n\n\t\tprivate View.MouseClickEventHandler currentLinkerViewClickAwayHandler;\n\t\tpublic void BindLinker(ButtonView button, Entity e, Command.Entry selectedCommand)\n\t\t{\n\t\t\tvar destEntityDrop = ((DropDownView)LinkerView.FindFirstChildByName(\"DestEntityDropDown\"));\n\t\t\tvar destCommDrop = ((DropDownView)LinkerView.FindFirstChildByName(\"DestCommandDropDown\"));\n\t\t\tvar addButton = ((ButtonView)LinkerView.FindFirstChildByName(\"AddButton\"));\n\t\t\tvar listView = ((ListView)LinkerView.FindFirstChildByName(\"CurLinksList\"));\n\n\t\t\tLinkerView.OnMouseClickAway -= this.currentLinkerViewClickAwayHandler;\n\n\t\t\tthis.currentLinkerViewClickAwayHandler = (sender, args) =>\n\t\t\t{\n\t\t\t\tif (LinkerView.Active && !LinkerView.AbsoluteBoundBox.Contains(InputManager.GetMousePos()))\n\t\t\t\t{\n\t\t\t\t\tint links = (from l in e.LinkedCommands where l.SourceCommand == selectedCommand.Key select l).Count();\n\t\t\t\t\tbutton.Text = string.Format(\"Link [{0}]\", links);\n\t\t\t\t\tHideLinkerView();\n\t\t\t\t}\n\t\t\t};\n\t\t\tLinkerView.OnMouseClickAway += this.currentLinkerViewClickAwayHandler;\n\n\t\t\taddButton.ResetOnMouseClick();\n\n\t\t\tdestEntityDrop.RemoveAllOptions();\n\t\t\tdestCommDrop.RemoveAllOptions();\n\n\t\t\tAction<bool, bool> recompute = (destEntityChanged, destCommChanged) =>\n\t\t\t{\n\t\t\t\tif (destEntityChanged)\n\t\t\t\t{\n\t\t\t\t\tdestCommDrop.RemoveAllOptions();\n\t\t\t\t\tvar selected = destEntityDrop.GetSelectedOption();\n\t\t\t\t\tif (selected != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEntity destEntity = selected.Related as Entity;\n\t\t\t\t\t\tforeach (var comm in destEntity.Commands)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar c = (Command.Entry)comm.Value;\n\t\t\t\t\t\t\tif (c.Permissions == Command.Perms.Linkable || c.Permissions == Command.Perms.LinkableAndExecutable)\n\t\t\t\t\t\t\t\tdestCommDrop.AddOption(comm.Key.ToString(), () => { }, c);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdestCommDrop.Active.Value = destEntityDrop.LastItemSelected.Value != -1;\n\t\t\t\taddButton.Active.Value = destEntityDrop.LastItemSelected.Value != -1 && destCommDrop.LastItemSelected.Value != -1;\n\t\t\t};\n\n\t\t\tAction populateList = null;\n\t\t\tpopulateList = () =>\n\t\t\t{\n\t\t\t\tlistView.Children.Clear();\n\t\t\t\tlistView.ContentOffset.Value = Vector2.Zero;\n\t\t\t\tint count = 0;\n\t\t\t\tList<Entity.CommandLink> toRemove = new List<Entity.CommandLink>();\n\t\t\t\tforeach (var link in e.LinkedCommands)\n\t\t\t\t{\n\t\t\t\t\tif (link.SourceCommand != selectedCommand.Key) continue;\n\t\t\t\t\tEntity target = link.TargetEntity.Target;\n\t\t\t\t\tif (target == null || !target.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\ttoRemove.Add(link);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tView container = new View(main.GeeUI, listView);\n\t\t\t\t\tcontainer.ChildrenLayouts.Add(new HorizontalViewLayout(4));\n\t\t\t\t\tcontainer.ChildrenLayouts.Add(new ExpandToFitLayout());\n\t\t\t\t\tvar entView = new TextView(main.GeeUI, container, this.entityString(target), Vector2.Zero);\n\t\t\t\t\tvar destView = new TextView(main.GeeUI, container, link.TargetCommand, Vector2.Zero);\n\n\t\t\t\t\tentView.AutoSize.Value = false;\n\t\t\t\t\tdestView.AutoSize.Value = false;\n\n\t\t\t\t\tentView.Width.Value = 240;\n\t\t\t\t\tdestView.Width.Value = 100;\n\t\t\t\t\tentView.TextJustification = TextJustification.Left;\n\t\t\t\t\tdestView.TextJustification = TextJustification.Right;\n\n\t\t\t\t\tvar removeButton = new ButtonView(main.GeeUI, container, \"-\", Vector2.Zero);\n\t\t\t\t\tremoveButton.OnMouseClick += (sender, args) =>\n\t\t\t\t\t{\n\t\t\t\t\t\te.LinkedCommands.Remove(link);\n\t\t\t\t\t\tpopulateList();\n\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t};\n\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tforeach (var remove in toRemove)\n\t\t\t\t\te.LinkedCommands.Remove(remove);\n\t\t\t\t\n\t\t\t\tbutton.Text = string.Format(\"Link [{0}] ->\", count);\n\t\t\t};\n\n\t\t\tAction addItem = () =>\n\t\t\t{\n\t\t\t\tif (!addButton.Active) return;\n\t\t\t\tEntity.CommandLink link = new Entity.CommandLink();\n\t\t\t\tvar entity = ((Entity)destEntityDrop.GetSelectedOption().Related);\n\t\t\t\tlink.TargetEntity = new Entity.Handle() { Target = entity };\n\t\t\t\tlink.TargetCommand = destCommDrop.GetSelectedOption().Text;\n\t\t\t\tlink.SourceCommand = selectedCommand.Key;\n\t\t\t\te.LinkedCommands.Add(link);\n\t\t\t\tpopulateList();\n\t\t\t\taddButton.Active.Value = false;\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t};\n\n\t\t\tdestEntityDrop.Add(new NotifyBinding(() => recompute(true, false), destEntityDrop.LastItemSelected));\n\t\t\tdestCommDrop.Add(new NotifyBinding(() => recompute(false, true), destCommDrop.LastItemSelected));\n\n\t\t\taddButton.OnMouseClick += (sender, args) => addItem();\n\n\t\t\tforeach (var ent in main.Entities)\n\t\t\t{\n\t\t\t\tif (ent != this.Entity)\n\t\t\t\t\tdestEntityDrop.AddOption(this.entityString(ent), () => { }, ent);\n\t\t\t}\n\n\t\t\tpopulateList();\n\n\t\t}\n\n\t\tpublic void ShowEntityListView(ButtonView button, PropertyEntry entry)\n\t\t{\n\t\t\tEntityListView.Active.Value = true;\n\t\t\tEntityListView.Position.Value = new Vector2(PropertiesView.AbsoluteBoundBox.Right, InputManager.GetMousePosV().Y);\n\t\t\tEntityListView.BringToFront();\n\t\t\tBindEntityListView(button, SelectedEntities[0], entry);\n\t\t\tif (EntityListView.AbsoluteBoundBox.Bottom > main.GeeUI.RootView.AbsoluteBoundBox.Bottom)\n\t\t\t\tEntityListView.Y -= (EntityListView.AbsoluteBoundBox.Bottom - main.GeeUI.RootView.AbsoluteBoundBox.Bottom);\n\t\t}\n\n\t\tprivate View.MouseClickEventHandler currentEntityListViewClickAwayHandler;\n\t\tpublic void BindEntityListView(ButtonView button, Entity e, PropertyEntry entry)\n\t\t{\n\t\t\tListProperty<Entity.Handle> property = (ListProperty<Entity.Handle>)entry.Property;\n\t\t\tvar entityDrop = ((DropDownView)EntityListView.FindFirstChildByName(\"EntityDropDown\"));\n\t\t\tvar addButton = ((ButtonView)EntityListView.FindFirstChildByName(\"AddButton\"));\n\t\t\tvar listView = ((ListView)EntityListView.FindFirstChildByName(\"EntityList\"));\n\n\t\t\tEntityListView.OnMouseClickAway -= this.currentEntityListViewClickAwayHandler;\n\n\t\t\tthis.currentEntityListViewClickAwayHandler = (sender, args) =>\n\t\t\t{\n\t\t\t\tif (EntityListView.Active && !EntityListView.AbsoluteBoundBox.Contains(InputManager.GetMousePos()))\n\t\t\t\t{\n\t\t\t\t\tbutton.Text = string.Format(\"Edit [{0}]\", property.Length);\n\t\t\t\t\tthis.EntityListView.Active.Value = false;\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis.EntityListView.OnMouseClickAway += this.currentEntityListViewClickAwayHandler;\n\n\t\t\taddButton.ResetOnMouseClick();\n\n\t\t\t#region Actions\n\t\t\tAction fillDestEntity = () =>\n\t\t\t{\n\t\t\t\tentityDrop.RemoveAllOptions();\n\t\t\t\tforeach (var ent in main.Entities)\n\t\t\t\t{\n\t\t\t\t\tif (ent != e && !property.Contains(ent) && ent != this.Entity)\n\t\t\t\t\t\tentityDrop.AddOption(this.entityString(ent), () => { }, ent);\n\t\t\t\t}\n\t\t\t\taddButton.Active.Value = entityDrop.DropDownOptions.Count > 0;\n\t\t\t};\n\n\t\t\tAction populateList = null;\n\t\t\tpopulateList = () =>\n\t\t\t{\n\t\t\t\tlistView.Children.Clear();\n\t\t\t\tlistView.ContentOffset.Value = Vector2.Zero;\n\t\t\t\tint count = 0;\n\t\t\t\tList<Entity.Handle> toRemove = new List<Entity.Handle>();\n\t\t\t\tforeach (var handle in property)\n\t\t\t\t{\n\t\t\t\t\tEntity target = handle.Target;\n\t\t\t\t\tif (target == null || !target.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\ttoRemove.Add(handle);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tView container = new View(main.GeeUI, listView);\n\t\t\t\t\tcontainer.ChildrenLayouts.Add(new HorizontalViewLayout(4));\n\t\t\t\t\tcontainer.ChildrenLayouts.Add(new ExpandToFitLayout());\n\t\t\t\t\tvar entView = new TextView(main.GeeUI, container, this.entityString(target), Vector2.Zero);\n\n\t\t\t\t\tentView.AutoSize.Value = false;\n\n\t\t\t\t\tentView.Width.Value = 340;\n\t\t\t\t\tentView.TextJustification = TextJustification.Left;\n\n\t\t\t\t\tvar removeButton = new ButtonView(main.GeeUI, container, \"[-]\", Vector2.Zero);\n\t\t\t\t\tremoveButton.OnMouseClick += (sender, args) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tproperty.Remove(handle);\n\t\t\t\t\t\tpopulateList();\n\t\t\t\t\t\tfillDestEntity();\n\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t};\n\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tforeach (var remove in toRemove)\n\t\t\t\t\tproperty.Remove(remove);\n\t\t\t\t\n\t\t\t\tbutton.Text = string.Format(\"Edit [{0}] ->\", count);\n\t\t\t};\n\n\t\t\tAction addItem = () =>\n\t\t\t{\n\t\t\t\tEntity.Handle handle = (Entity)entityDrop.GetSelectedOption().Related;\n\t\t\t\tproperty.Add(handle);\n\t\t\t\tpopulateList();\n\t\t\t\tfillDestEntity();\n\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t};\n\t\t\t#endregion\n\n\t\t\taddButton.OnMouseClick += (sender, args) => addItem();\n\n\t\t\tfillDestEntity();\n\t\t\tpopulateList();\n\t\t}\n\n\t\tprivate void show(IEnumerable<Entity> entities)\n\t\t{\n\t\t\tListView rootEntityView = (ListView)PropertiesView.FindFirstChildByName(\"PropertiesList\");\n\t\t\trootEntityView.ContentOffset.Value = new Vector2(0);\n\t\t\trootEntityView.Children.Clear();\n\n\t\t\tint count = entities != null ? entities.Count() : 0;\n\t\t\tif (count > 1)\n\t\t\t{\n\t\t\t\tforeach (Entity e in entities)\n\t\t\t\t{\n\t\t\t\t\tTextView categoryView = new TextView(main.GeeUI, rootEntityView, \"\", new Vector2(0, 0));\n\t\t\t\t\tcategoryView.Add(new Binding<string>(categoryView.Text, () => this.entityString(e), e.ID));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (count == 1)\n\t\t\t{\n\t\t\t\tEntity entity = entities.First();\n\t\t\t\tTextView categoryView = new TextView(main.GeeUI, rootEntityView, \"\", new Vector2(0, 0));\n\t\t\t\tcategoryView.Add(new Binding<string>(categoryView.Text, () => this.entityString(entity), entity.ID));\n\t\t\t\tcategoryView.AutoSize.Value = false;\n\t\t\t\tcategoryView.TextJustification = TextJustification.Center;\n\t\t\t\tcategoryView.Add(new Binding<int>(categoryView.Width, i => { return (int)Math.Max(i, categoryView.TextWidth); }, rootEntityView.Width));\n\n\t\t\t\t// ID property\n\t\t\t\t{\n\t\t\t\t\tbool sameLine;\n\t\t\t\t\tvar child = this.BuildValueView(new PropertyEntry(entity.ID, new PropertyEntry.EditorData()), out sameLine);\n\t\t\t\t\tTextFieldView textField = (TextFieldView)child.FindFirstChildByName(\"TextField\");\n\t\t\t\t\ttextField.Validator = delegate(string x)\n\t\t\t\t\t{\n\t\t\t\t\t\tEntity e = Entity.GetByID(x);\n\t\t\t\t\t\treturn e == null || e == entity;\n\t\t\t\t\t};\n\t\t\t\t\tView containerLabel = BuildContainerLabel(\"ID\", sameLine);\n\t\t\t\t\tcontainerLabel.Children.Add(child);\n\t\t\t\t\trootEntityView.Children.Add(containerLabel);\n\t\t\t\t}\n\n\t\t\t\tforeach (KeyValuePair<string, PropertyEntry> prop in entity.Properties)\n\t\t\t\t\trootEntityView.Children.Add(this.buildProperty(prop.Key, prop.Value));\n\n\t\t\t\tforeach (KeyValuePair<string, Command.Entry> cmd in entity.Commands)\n\t\t\t\t{\n\t\t\t\t\tView containerLabel = BuildContainerLabel(cmd.Key, false);\n\t\t\t\t\tcontainerLabel.Children.Add(BuildButton(entity, cmd.Value, \"Execute\"));\n\t\t\t\t\trootEntityView.Children.Add(containerLabel);\n\n\t\t\t\t\tcontainerLabel.SetToolTipText(cmd.Value.Description);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tEntityListView.BringToFront();\n\t\t\tLinkerView.BringToFront();\n\t\t}\n\n\t\tpublic bool AnyTextFieldViewsSelected()\n\t\t{\n\t\t\tvar views = main.GeeUI.GetAllViews(main.GeeUI.RootView);\n\t\t\tforeach (var view in views)\n\t\t\t{\n\t\t\t\tif (view is TextFieldView && view.Selected)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic View BuildContainerLabel(string label, bool horizontal)\n\t\t{\n\t\t\tvar ret = new View(main.GeeUI, null);\n\t\t\tif (horizontal)\n\t\t\t\tret.ChildrenLayouts.Add(new HorizontalViewLayout(6, false));\n\t\t\telse\n\t\t\t\tret.ChildrenLayouts.Add(new VerticalViewLayout(2, false));\n\t\t\tret.ChildrenLayouts.Add(new ExpandToFitLayout());\n\n\t\t\tnew TextView(main.GeeUI, ret, label, Vector2.Zero);\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic View BuildButton(Entity ent, Command.Entry entry, string label, Color color = default(Color))\n\t\t{\n\t\t\tvar container = new View(main.GeeUI, null);\n\t\t\tcontainer.ChildrenLayouts.Add(new HorizontalViewLayout());\n\t\t\tcontainer.ChildrenLayouts.Add(new ExpandToFitLayout());\n\n\t\t\tif (entry.Permissions == Command.Perms.Executable\n\t\t\t\t|| entry.Permissions == Command.Perms.LinkableAndExecutable)\n\t\t\t{\n\t\t\t\tvar b = new ButtonView(main.GeeUI, container, label, Vector2.Zero);\n\t\t\t\tb.OnMouseClick += (sender, args) =>\n\t\t\t\t{\n\t\t\t\t\tif (entry != null)\n\t\t\t\t\t\tentry.Command.Execute();\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (entry.Permissions == Command.Perms.Linkable\n\t\t\t\t|| entry.Permissions == Command.Perms.LinkableAndExecutable)\n\t\t\t{\n\t\t\t\tint links = (from l in ent.LinkedCommands where l.SourceCommand == entry.Key select l).Count();\n\n\t\t\t\tvar link = new ButtonView(main.GeeUI, container, string.Format(\"Link [{0}]\", links), Vector2.Zero);\n\t\t\t\tlink.OnMouseClick += (sender, args) =>\n\t\t\t\t{\n\t\t\t\t\tShowLinkerView(link, entry);\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn container;\n\t\t}\n\n\t\tprivate void refresh()\n\t\t{\n\t\t\tHideLinkerView();\n\n\t\t\tif (this.SelectedEntities.Length == 0)\n\t\t\t{\n\t\t\t\tthis.TabViews.SetActiveTab(TabViews.TabIndex(\"Entity\"));\n\t\t\t\tthis.show(null);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (this.SelectedEntities.Length == 1)\n\t\t\t\t{\n\t\t\t\t\tif (this.SelectedEntities[0].Get<Voxel>() != null)\n\t\t\t\t\t\tthis.TabViews.SetActiveTab(TabViews.TabIndex(\"Voxel\"));\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.TabViews.SetActiveTab(TabViews.TabIndex(\"Entity\"));\n\n\t\t\t\t\tif (this.VoxelEditMode)\n\t\t\t\t\t\tthis.show(null);\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.TabViews.SetActiveTab(TabViews.TabIndex(\"Entity\"));\n\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void BuildValueFieldView(View parent, Type type, IProperty property, VectorElement element, PropertyEntry entry, int width = 30)\n\t\t{\n\t\t\tTextFieldView textField = new TextFieldView(main.GeeUI, parent, Vector2.Zero);\n\t\t\ttextField.Height.Value = (int)(TextFieldHeight * main.FontMultiplier);\n\t\t\ttextField.Width.Value = width;\n\t\t\ttextField.MultiLine = false;\n\n\t\t\tif (type.Equals(typeof(Vector2)))\n\t\t\t{\n\t\t\t\tProperty<Vector2> socket = (Property<Vector2>)property;\n\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\tsocket.AddBinding(new NotifyBinding(() =>\n\t\t\t\t{\n\t\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\t}, socket));\n\n\t\t\t\ttextField.Width.Value = (int)(textField.Width.Value * 2);\n\n\t\t\t\tAction onChanged = () =>\n\t\t\t\t{\n\t\t\t\t\tfloat value;\n\t\t\t\t\tif (float.TryParse(textField.Text, out value))\n\t\t\t\t\t{\n\t\t\t\t\t\tsocket.Value = socket.Value.SetElement(element, value);\n\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t}\n\t\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\t\ttextField.Selected.Value = false;\n\t\t\t\t};\n\t\t\t\ttextField.ValidationRegex = decimalRegex;\n\t\t\t\ttextField.OnTextSubmitted = onChanged;\n\t\t\t\tBindScrollWheel(socket, element, entry, textField);\n\t\t\t}\n\t\t\telse if (type.Equals(typeof(Vector3)))\n\t\t\t{\n\t\t\t\tProperty<Vector3> socket = (Property<Vector3>)property;\n\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\tsocket.AddBinding(new NotifyBinding(() =>\n\t\t\t\t{\n\t\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\t}, socket));\n\n\t\t\t\ttextField.Width.Value = (int)(textField.Width.Value * 1.25);\n\n\t\t\t\tAction onChanged = () =>\n\t\t\t\t{\n\t\t\t\t\tfloat value;\n\t\t\t\t\tif (float.TryParse(textField.Text, out value))\n\t\t\t\t\t{\n\t\t\t\t\t\tsocket.Value = socket.Value.SetElement(element, value);\n\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t}\n\t\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\t\ttextField.Selected.Value = false;\n\t\t\t\t};\n\t\t\t\ttextField.ValidationRegex = decimalRegex;\n\t\t\t\ttextField.OnTextSubmitted = onChanged;\n\t\t\t\tBindScrollWheel(socket, element, entry, textField);\n\t\t\t}\n\t\t\telse if (type.Equals(typeof(Voxel.Coord)))\n\t\t\t{\n\t\t\t\tProperty<Voxel.Coord> socket = (Property<Voxel.Coord>)property;\n\n\t\t\t\tDirection dir;\n\t\t\t\tswitch (element)\n\t\t\t\t{\n\t\t\t\t\tcase VectorElement.X:\n\t\t\t\t\t\tdir = Direction.PositiveX;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase VectorElement.Y:\n\t\t\t\t\t\tdir = Direction.PositiveY;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdir = Direction.PositiveZ;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\ttextField.Width.Value = (int)(textField.Width.Value * 1.25);\n\n\t\t\t\ttextField.Text = socket.Value.GetComponent(dir).ToString();\n\t\t\t\tsocket.AddBinding(new NotifyBinding(() =>\n\t\t\t\t{\n\t\t\t\t\ttextField.Text = socket.Value.GetComponent(dir).ToString();\n\t\t\t\t}, socket));\n\n\n\t\t\t\tAction onChanged = () =>\n\t\t\t\t{\n\t\t\t\t\tint value;\n\t\t\t\t\tif (int.TryParse(textField.Text, out value))\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord c = socket.Value;\n\t\t\t\t\t\tc.SetComponent(dir, value);\n\t\t\t\t\t\tsocket.Value = c;\n\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t}\n\t\t\t\t\ttextField.Text = socket.Value.GetComponent(dir).ToString();\n\t\t\t\t\ttextField.Selected.Value = false;\n\t\t\t\t};\n\t\t\t\ttextField.ValidationRegex = integerRegex;\n\t\t\t\ttextField.OnTextSubmitted = onChanged;\n\t\t\t}\n\t\t\telse if (type.Equals(typeof(Vector4)))\n\t\t\t{\n\t\t\t\tProperty<Vector4> socket = (Property<Vector4>)property;\n\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\tsocket.AddBinding(new NotifyBinding(() =>\n\t\t\t\t{\n\t\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\t}, socket));\n\n\t\t\t\tAction onChanged = () =>\n\t\t\t\t{\n\t\t\t\t\tfloat value;\n\t\t\t\t\tif (float.TryParse(textField.Text, out value))\n\t\t\t\t\t{\n\t\t\t\t\t\tsocket.Value = socket.Value.SetElement(element, value);\n\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t}\n\t\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\t\ttextField.Selected.Value = false;\n\t\t\t\t};\n\t\t\t\ttextField.ValidationRegex = decimalRegex;\n\t\t\t\ttextField.OnTextSubmitted = onChanged;\n\t\t\t\tBindScrollWheel(socket, element, entry, textField);\n\t\t\t}\n\t\t\telse if (type.Equals(typeof(Quaternion)))\n\t\t\t{\n\t\t\t\tProperty<Quaternion> socket = (Property<Quaternion>)property;\n\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\tsocket.AddBinding(new NotifyBinding(() =>\n\t\t\t\t{\n\t\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\t}, socket));\n\n\t\t\t\tAction onChanged = () =>\n\t\t\t\t{\n\t\t\t\t\tfloat value;\n\t\t\t\t\tif (float.TryParse(textField.Text, out value))\n\t\t\t\t\t{\n\t\t\t\t\t\tsocket.Value = socket.Value.SetElement(element, value);\n\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t}\n\t\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString(\"F\");\n\t\t\t\t\ttextField.Selected.Value = false;\n\t\t\t\t};\n\t\t\t\ttextField.ValidationRegex = decimalRegex;\n\t\t\t\ttextField.OnTextSubmitted = onChanged;\n\t\t\t\tBindScrollWheel(socket, element, entry, textField);\n\t\t\t}\n\t\t\telse if (type.Equals(typeof(Color)))\n\t\t\t{\n\t\t\t\tProperty<Color> socket = (Property<Color>)property;\n\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString();\n\t\t\t\tsocket.AddBinding(new NotifyBinding(() =>\n\t\t\t\t{\n\t\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString();\n\t\t\t\t}, socket));\n\n\t\t\t\ttextField.Width.Value = (int)(textField.Width.Value * 1.25);\n\n\t\t\t\tAction onChanged = () =>\n\t\t\t\t{\n\t\t\t\t\tbyte value;\n\t\t\t\t\tif (byte.TryParse(textField.Text, out value))\n\t\t\t\t\t{\n\t\t\t\t\t\tsocket.Value = socket.Value.SetElement(element, value);\n\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t}\n\t\t\t\t\ttextField.Text = socket.Value.GetElement(element).ToString();\n\t\t\t\t\ttextField.Selected.Value = false;\n\t\t\t\t};\n\t\t\t\ttextField.ValidationRegex = integerRegex;\n\t\t\t\ttextField.OnTextSubmitted = onChanged;\n\t\t\t\tBindScrollWheel(socket, element, entry, textField);\n\t\t\t}\n\t\t}\n\n\t\tpublic View BuildValueView(PropertyEntry entry, out bool shouldSameLine)\n\t\t{\n\t\t\tIProperty property = entry.Property;\n\t\t\tshouldSameLine = false;\n\t\t\tView ret = new View(main.GeeUI, null);\n\t\t\tret.ChildrenLayouts.Add(new HorizontalViewLayout(4));\n\t\t\tret.ChildrenLayouts.Add(new ExpandToFitLayout());\n\n\t\t\tif (entry.Data.Readonly)\n\t\t\t{\n\t\t\t\tPropertyInfo propertyInfo = property.GetType().GetProperty(\"Value\");\n\t\t\t\tFunc<string> getStringValue = delegate()\n\t\t\t\t{\n\t\t\t\t\tobject value = propertyInfo.GetValue(property, null);\n\t\t\t\t\treturn value == null ? \"[null]\" : value.ToString();\n\t\t\t\t};\n\t\t\t\tTextView label = new TextView(main.GeeUI, ret, getStringValue(), Vector2.Zero);\n\t\t\t\tlabel.Add(new Binding<string>(label.Text, getStringValue, property));\n\t\t\t}\n\t\t\telse if (typeof(IListProperty).IsAssignableFrom(property.GetType()))\n\t\t\t{\n\t\t\t\tif (property.GetType().GetGenericArguments().First().Equals(typeof(Entity.Handle)))\n\t\t\t\t{\n\t\t\t\t\tListProperty<Entity.Handle> socket = (ListProperty<Entity.Handle>)property;\n\t\t\t\t\tvar edit = new ButtonView(main.GeeUI, ret, string.Format(\"Edit [{0}]\", socket.Length), Vector2.Zero);\n\t\t\t\t\tedit.OnMouseClick += (sender, args) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tShowEntityListView(edit, entry);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tPropertyInfo propertyInfo = property.GetType().GetProperty(\"Value\");\n\t\t\t\tif (propertyInfo.PropertyType.Equals(typeof(Vector2)))\n\t\t\t\t{\n\t\t\t\t\tforeach (VectorElement field in new[] { VectorElement.X, VectorElement.Y })\n\t\t\t\t\t\tthis.BuildValueFieldView(ret, propertyInfo.PropertyType, property, field, entry);\n\t\t\t\t}\n\t\t\t\telse if (propertyInfo.PropertyType.Equals(typeof(Vector3)) || propertyInfo.PropertyType.Equals(typeof(Voxel.Coord)))\n\t\t\t\t{\n\t\t\t\t\tforeach (VectorElement field in new[] { VectorElement.X, VectorElement.Y, VectorElement.Z })\n\t\t\t\t\t\tthis.BuildValueFieldView(ret, propertyInfo.PropertyType, property, field, entry);\n\t\t\t\t}\n\t\t\t\telse if (propertyInfo.PropertyType.Equals(typeof(Vector4)) || propertyInfo.PropertyType.Equals(typeof(Quaternion)) ||\n\t\t\t\t\t\t propertyInfo.PropertyType.Equals(typeof(Color)))\n\t\t\t\t{\n\t\t\t\t\tforeach (VectorElement field in new[] { VectorElement.X, VectorElement.Y, VectorElement.Z, VectorElement.W })\n\t\t\t\t\t\tthis.BuildValueFieldView(ret, propertyInfo.PropertyType, property, field, entry);\n\t\t\t\t}\n\t\t\t\telse if (typeof(Enum).IsAssignableFrom(propertyInfo.PropertyType))\n\t\t\t\t{\n\t\t\t\t\tvar drop = new DropDownView(main.GeeUI, ret, Vector2.Zero) { Name = \"Dropdown\" };\n\t\t\t\t\tforeach (object o in Enum.GetValues(propertyInfo.PropertyType))\n\t\t\t\t\t{\n\t\t\t\t\t\tAction onClick = () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpropertyInfo.SetValue(property, o, null);\n\t\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t\t};\n\t\t\t\t\t\tdrop.AddOption(o.ToString(), onClick);\n\t\t\t\t\t}\n\t\t\t\t\tdrop.SetSelectedOption(propertyInfo.GetValue(property, null).ToString(), false);\n\t\t\t\t\tdrop.Add(new NotifyBinding(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tdrop.SetSelectedOption(propertyInfo.GetValue(property, null).ToString(), false);\n\t\t\t\t\t}, (IProperty)property));\n\t\t\t\t}\n\t\t\t\telse if (propertyInfo.PropertyType.Equals(typeof(Entity.Handle)))\n\t\t\t\t{\n\t\t\t\t\tProperty<Entity.Handle> socket = (Property<Entity.Handle>)property;\n\t\t\t\t\tvar entityDropDownLayout = new View(main.GeeUI, ret);\n\t\t\t\t\tentityDropDownLayout.ChildrenLayouts.Add(new HorizontalViewLayout());\n\t\t\t\t\tentityDropDownLayout.ChildrenLayouts.Add(new ExpandToFitLayout());\n\t\t\t\t\tvar entityDropDown = new DropDownView(main.GeeUI, entityDropDownLayout, new Vector2())\n\t\t\t\t\t{\n\t\t\t\t\t\tName = \"DropDown\"\n\t\t\t\t\t};\n\t\t\t\t\tentityDropDown.FilterThreshhold.Value = 0;\n\t\t\t\t\tentityDropDown.AddOption(\"[null]\", delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tsocket.Value = null;\n\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t});\n\t\t\t\t\tforeach (Entity e in main.Entities)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (e != this.Entity)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tentityDropDown.AddOption(this.entityString(e), delegate()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsocket.Value = e;\n\t\t\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tentityDropDown.SetSelectedOption(this.entityString(socket.Value.Target), false);\n\t\t\t\t\tentityDropDown.Add(new NotifyBinding(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tentityDropDown.SetSelectedOption(this.entityString(socket.Value.Target), false);\n\t\t\t\t\t}, (IProperty)property));\n\n\t\t\t\t\tvar selectButton = new ButtonView(main.GeeUI, entityDropDownLayout, \"Select\", Vector2.Zero);\n\t\t\t\t\tselectButton.OnMouseClick += delegate(object sender, EventArgs e)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.PickNextEntity.Value = true;\n\t\t\t\t\t\tthis.entityPickerDropDown = entityDropDown;\n\t\t\t\t\t\tthis.reactivateViewAfterPickingEntity = null;\n\t\t\t\t\t\tselectButton.Text = \"Select ->\";\n\t\t\t\t\t\tthis.resetSelectButtonAfterPickingEntity = selectButton;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\telse if (entry.Data.Options != null && propertyInfo.PropertyType.Equals(typeof(string)))\n\t\t\t\t{\n\t\t\t\t\tListProperty<string> options = (ListProperty<string>)entry.Data.Options;\n\t\t\t\t\tvar drop = new DropDownView(main.GeeUI, ret, Vector2.Zero) { Name = \"Dropdown\" };\n\t\t\t\t\tAction populate = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tdrop.RemoveAllOptions();\n\t\t\t\t\t\tforeach (string o in options)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAction onClick = () =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpropertyInfo.SetValue(property, o, null);\n\t\t\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tdrop.AddOption(o ?? \"[null]\", onClick, o);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdrop.SetSelectedOption((string)propertyInfo.GetValue(property, null), false);\n\t\t\t\t\t\tif (drop.DropDownOptions.Count == 0)\n\t\t\t\t\t\t\tpropertyInfo.SetValue(property, null, null);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tpropertyInfo.SetValue(property, drop.GetSelectedOption().Related, null);\n\t\t\t\t\t};\n\t\t\t\t\tpopulate();\n\t\t\t\t\tdrop.Add(new ListNotifyBinding<string>(populate, options));\n\t\t\t\t}\n\t\t\t\telse if (entry.Data.Options != null && propertyInfo.PropertyType.Equals(typeof(uint)))\n\t\t\t\t{\n\t\t\t\t\t// Wwise sound picker\n\t\t\t\t\tListProperty<KeyValuePair<uint, string>> options = (ListProperty<KeyValuePair<uint, string>>)entry.Data.Options;\n\t\t\t\t\tvar drop = new DropDownView(main.GeeUI, ret, Vector2.Zero) { Name = \"Dropdown\" };\n\t\t\t\t\tAction populate = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tdrop.RemoveAllOptions();\n\t\t\t\t\t\tforeach (KeyValuePair<uint, string> o in options)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAction onClick = () =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpropertyInfo.SetValue(property, o.Key, null);\n\t\t\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tdrop.AddOption(o.Value, onClick, o.Key);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdrop.SetSelectedOptionByRelated(propertyInfo.GetValue(property, null), false);\n\t\t\t\t\t\tif (drop.DropDownOptions.Count == 0)\n\t\t\t\t\t\t\tpropertyInfo.SetValue(property, 0, null);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tpropertyInfo.SetValue(property, drop.GetSelectedOption().Related, null);\n\t\t\t\t\t};\n\t\t\t\t\tpopulate();\n\t\t\t\t\tdrop.Add(new ListNotifyBinding<KeyValuePair<uint, string>>(populate, options));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tTextFieldView view = new TextFieldView(main.GeeUI, ret, Vector2.Zero);\n\t\t\t\t\tview.Width.Value = 130;\n\t\t\t\t\tview.Height.Value = (int)(TextFieldHeight * main.FontMultiplier);\n\t\t\t\t\tview.Name = \"TextField\";\n\t\t\t\t\tview.MultiLine = false;\n\n\t\t\t\t\tif (propertyInfo.PropertyType.Equals(typeof(int)))\n\t\t\t\t\t{\n\t\t\t\t\t\tProperty<int> socket = (Property<int>)property;\n\t\t\t\t\t\tview.Text = socket.Value.ToString();\n\t\t\t\t\t\tsocket.AddBinding(new NotifyBinding(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tview.Text = socket.Value.ToString();\n\t\t\t\t\t\t}, socket));\n\t\t\t\t\t\tAction onChanged = () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint value;\n\t\t\t\t\t\t\tif (int.TryParse(view.Text, out value))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsocket.Value = value;\n\t\t\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tview.Text = socket.Value.ToString();\n\t\t\t\t\t\t\tview.Selected.Value = false;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tview.ValidationRegex = integerRegex;\n\t\t\t\t\t\tview.OnTextSubmitted = onChanged;\n\t\t\t\t\t\tBindScrollWheel(socket, entry, view);\n\t\t\t\t\t}\n\t\t\t\t\telse if (propertyInfo.PropertyType.Equals(typeof(float)))\n\t\t\t\t\t{\n\t\t\t\t\t\tProperty<float> socket = (Property<float>)property;\n\t\t\t\t\t\tview.Text = socket.Value.ToString(\"F\");\n\t\t\t\t\t\tsocket.AddBinding(new NotifyBinding(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tview.Text = socket.Value.ToString(\"F\");\n\t\t\t\t\t\t}, socket));\n\t\t\t\t\t\tAction onChanged = () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat value;\n\t\t\t\t\t\t\tif (float.TryParse(view.Text, out value))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsocket.Value = value;\n\t\t\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tview.Text = socket.Value.ToString(\"F\");\n\t\t\t\t\t\t\tview.Selected.Value = false;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tview.ValidationRegex = decimalRegex;\n\t\t\t\t\t\tview.OnTextSubmitted = onChanged;\n\t\t\t\t\t\tBindScrollWheel(socket, entry, view);\n\t\t\t\t\t}\n\t\t\t\t\telse if (propertyInfo.PropertyType.Equals(typeof(bool)))\n\t\t\t\t\t{\n\t\t\t\t\t\tshouldSameLine = true;\n\t\t\t\t\t\t//No need for a textfield!\n\t\t\t\t\t\tret.Children.Remove(view);\n\t\t\t\t\t\tCheckBoxView checkBox = new CheckBoxView(main.GeeUI, ret, Vector2.Zero, \"\");\n\t\t\t\t\t\tProperty<bool> socket = (Property<bool>)property;\n\t\t\t\t\t\tcheckBox.IsChecked.Value = socket.Value;\n\t\t\t\t\t\tcheckBox.Add(new NotifyBinding(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\t\tsocket.Value = checkBox.IsChecked.Value;\n\t\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t\t}, checkBox.IsChecked));\n\t\t\t\t\t}\n\t\t\t\t\telse if (propertyInfo.PropertyType.Equals(typeof(string)))\n\t\t\t\t\t{\n\t\t\t\t\t\tProperty<string> socket = (Property<string>)property;\n\n\t\t\t\t\t\tif (socket.Value == null) view.Text = \"\";\n\t\t\t\t\t\telse view.Text = socket.Value;\n\n\t\t\t\t\t\tsocket.AddBinding(new NotifyBinding(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar text = socket.Value;\n\t\t\t\t\t\t\tif (text == null) text = \"\";\n\t\t\t\t\t\t\tview.Text = text;\n\t\t\t\t\t\t}, socket));\n\n\t\t\t\t\t\t//Vast majority of strings won't be multiline.\n\t\t\t\t\t\tif (socket.Value != null)\n\t\t\t\t\t\t\tview.MultiLine = socket.Value.Contains(\"\\n\");\n\t\t\t\t\t\tif (view.MultiLine)\n\t\t\t\t\t\t\tview.Height.Value = 100;\n\t\t\t\t\t\tAction onChanged = () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (socket.Value != view.Text)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsocket.Value = view.Text;\n\t\t\t\t\t\t\t\tthis.NeedsSave.Value = true;\n\t\t\t\t\t\t\t\tif (entry.Data.RefreshOnChange)\n\t\t\t\t\t\t\t\t\tthis.show(this.SelectedEntities);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tview.Selected.Value = false;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tview.OnTextSubmitted = onChanged;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\t#region Scrollwheel binding\n\t\tpublic void BindScrollWheel(Property<Color> property, VectorElement element, PropertyEntry entry, TextFieldView view)\n\t\t{\n\t\t\tview.ResetOnMouseScroll();\n\t\t\tview.OnMouseScroll += delta =>\n\t\t\t{\n\t\t\t\tif (property == null || !view.Active || !view.Selected) return;\n\t\t\t\tint val = property.Value.GetElement(element);\n\t\t\t\tval += ((sbyte)entry.Data.BChangeBy * (sbyte)delta);\n\t\t\t\tproperty.Value = property.Value.SetElement(element, (byte)val);\n\t\t\t};\n\t\t}\n\n\t\tpublic void BindScrollWheel(Property<Quaternion> property, VectorElement element, PropertyEntry entry, TextFieldView view)\n\t\t{\n\t\t\tview.ResetOnMouseScroll();\n\t\t\tview.OnMouseScroll += delta =>\n\t\t\t{\n\t\t\t\tif (property == null || !view.Active || !view.Selected) return;\n\t\t\t\tfloat val = property.Value.GetElement(element);\n\t\t\t\tval += (entry.Data.FChangeBy * delta);\n\t\t\t\tproperty.Value = property.Value.SetElement(element, val);\n\t\t\t};\n\t\t}\n\n\t\tpublic void BindScrollWheel(Property<Vector4> property, VectorElement element, PropertyEntry entry, TextFieldView view)\n\t\t{\n\t\t\tview.ResetOnMouseScroll();\n\t\t\tview.OnMouseScroll += delta =>\n\t\t\t{\n\t\t\t\tif (property == null || !view.Active || !view.Selected) return;\n\t\t\t\tfloat val = property.Value.GetElement(element);\n\t\t\t\tval += (entry.Data.FChangeBy * delta);\n\t\t\t\tproperty.Value = property.Value.SetElement(element, val);\n\t\t\t};\n\t\t}\n\n\t\tpublic void BindScrollWheel(Property<Vector3> property, VectorElement element, PropertyEntry entry, TextFieldView view)\n\t\t{\n\t\t\tview.ResetOnMouseScroll();\n\t\t\tview.OnMouseScroll += delta =>\n\t\t\t{\n\t\t\t\tif (property == null || !view.Active || !view.Selected) return;\n\t\t\t\tfloat val = property.Value.GetElement(element);\n\t\t\t\tval += (entry.Data.FChangeBy * delta);\n\t\t\t\tproperty.Value = property.Value.SetElement(element, val);\n\t\t\t};\n\t\t}\n\n\t\tpublic void BindScrollWheel(Property<Vector2> property, VectorElement element, PropertyEntry entry, TextFieldView view)\n\t\t{\n\t\t\tview.ResetOnMouseScroll();\n\t\t\tview.OnMouseScroll += delta =>\n\t\t\t{\n\t\t\t\tif (property == null || !view.Active || !view.Selected) return;\n\t\t\t\tfloat val = property.Value.GetElement(element);\n\t\t\t\tval += (entry.Data.FChangeBy*delta);\n\t\t\t\tproperty.Value = property.Value.SetElement(element, val);\n\t\t\t};\n\t\t}\n\n\t\tpublic void BindScrollWheel(Property<float> property, PropertyEntry entry, TextFieldView view)\n\t\t{\n\t\t\tview.ResetOnMouseScroll();\n\t\t\tview.OnMouseScroll += delta =>\n\t\t\t{\n\t\t\t\tif (property == null || !view.Active || !view.Selected) return;\n\t\t\t\tproperty.Value += (entry.Data.FChangeBy * delta);\n\t\t\t};\n\t\t}\n\t\t\n\t\tpublic void BindScrollWheel(Property<int> property, PropertyEntry entry, TextFieldView view)\n\t\t{\n\t\t\tview.ResetOnMouseScroll();\n\t\t\tview.OnMouseScroll += delta =>\n\t\t\t{\n\t\t\t\tif (property == null || !view.Active || !view.Selected) return;\n\t\t\t\tproperty.Value += (entry.Data.IChangeBy * delta);\n\t\t\t};\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "Lemma/ErrorForm.Designer.cs",
    "content": "﻿namespace Lemma\n{\n\tpartial class ErrorForm\n\t{\n\t\t/// <summary>\n\t\t/// Required designer variable.\n\t\t/// </summary>\n\t\tprivate System.ComponentModel.IContainer components = null;\n\n\t\t/// <summary>\n\t\t/// Clean up any resources being used.\n\t\t/// </summary>\n\t\t/// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n\t\tprotected override void Dispose(bool disposing)\n\t\t{\n\t\t\tif (disposing && (components != null))\n\t\t\t{\n\t\t\t\tcomponents.Dispose();\n\t\t\t}\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\n\t\t#region Windows Form Designer generated code\n\n\t\t/// <summary>\n\t\t/// Required method for Designer support - do not modify\n\t\t/// the contents of this method with the code editor.\n\t\t/// </summary>\n\t\tprivate void InitializeComponent()\n\t\t{\n\t\t\tthis.components = new System.ComponentModel.Container();\n\t\t\tSystem.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ErrorForm));\n\t\t\tthis.label1 = new System.Windows.Forms.Label();\n\t\t\tthis.textBox1 = new System.Windows.Forms.TextBox();\n\t\t\tthis.button1 = new System.Windows.Forms.Button();\n\t\t\tthis.label2 = new System.Windows.Forms.Label();\n\t\t\tthis.label3 = new System.Windows.Forms.Label();\n\t\t\tthis.linkLabel1 = new System.Windows.Forms.LinkLabel();\n\t\t\tthis.label4 = new System.Windows.Forms.Label();\n\t\t\tthis.label5 = new System.Windows.Forms.Label();\n\t\t\tthis.anonymousIdLabel = new System.Windows.Forms.Label();\n\t\t\tthis.timer1 = new System.Windows.Forms.Timer(this.components);\n\t\t\tthis.SuspendLayout();\n\t\t\t// \n\t\t\t// label1\n\t\t\t// \n\t\t\tthis.label1.AutoSize = true;\n\t\t\tthis.label1.Location = new System.Drawing.Point(12, 28);\n\t\t\tthis.label1.Name = \"label1\";\n\t\t\tthis.label1.Size = new System.Drawing.Size(59, 13);\n\t\t\tthis.label1.TabIndex = 0;\n\t\t\tthis.label1.Text = \"Error trace:\";\n\t\t\t// \n\t\t\t// textBox1\n\t\t\t// \n\t\t\tthis.textBox1.HideSelection = false;\n\t\t\tthis.textBox1.Location = new System.Drawing.Point(13, 44);\n\t\t\tthis.textBox1.Multiline = true;\n\t\t\tthis.textBox1.Name = \"textBox1\";\n\t\t\tthis.textBox1.ReadOnly = true;\n\t\t\tthis.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;\n\t\t\tthis.textBox1.Size = new System.Drawing.Size(259, 139);\n\t\t\tthis.textBox1.TabIndex = 1;\n\t\t\tthis.textBox1.WordWrap = false;\n\t\t\t// \n\t\t\t// button1\n\t\t\t// \n\t\t\tthis.button1.Location = new System.Drawing.Point(197, 253);\n\t\t\tthis.button1.Name = \"button1\";\n\t\t\tthis.button1.Size = new System.Drawing.Size(75, 23);\n\t\t\tthis.button1.TabIndex = 2;\n\t\t\tthis.button1.Text = \"Close\";\n\t\t\tthis.button1.UseVisualStyleBackColor = true;\n\t\t\tthis.button1.Click += new System.EventHandler(this.button1_Click);\n\t\t\t// \n\t\t\t// label2\n\t\t\t// \n\t\t\tthis.label2.AutoSize = true;\n\t\t\tthis.label2.Font = new System.Drawing.Font(\"Verdana\", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n\t\t\tthis.label2.Location = new System.Drawing.Point(12, 9);\n\t\t\tthis.label2.Name = \"label2\";\n\t\t\tthis.label2.Size = new System.Drawing.Size(130, 16);\n\t\t\tthis.label2.TabIndex = 3;\n\t\t\tthis.label2.Text = \"You found a bug.\";\n\t\t\t// \n\t\t\t// label3\n\t\t\t// \n\t\t\tthis.label3.AutoSize = true;\n\t\t\tthis.label3.Location = new System.Drawing.Point(12, 186);\n\t\t\tthis.label3.MaximumSize = new System.Drawing.Size(260, 0);\n\t\t\tthis.label3.Name = \"label3\";\n\t\t\tthis.label3.Size = new System.Drawing.Size(210, 13);\n\t\t\tthis.label3.TabIndex = 5;\n\t\t\tthis.label3.Text = \"Please restart the game or contact support:\";\n\t\t\t// \n\t\t\t// linkLabel1\n\t\t\t// \n\t\t\tthis.linkLabel1.AutoSize = true;\n\t\t\tthis.linkLabel1.Cursor = System.Windows.Forms.Cursors.Hand;\n\t\t\tthis.linkLabel1.Location = new System.Drawing.Point(12, 199);\n\t\t\tthis.linkLabel1.Name = \"linkLabel1\";\n\t\t\tthis.linkLabel1.Size = new System.Drawing.Size(132, 13);\n\t\t\tthis.linkLabel1.TabIndex = 6;\n\t\t\tthis.linkLabel1.TabStop = true;\n\t\t\tthis.linkLabel1.Text = \"evan@etodd.io\";\n\t\t\tthis.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);\n\t\t\t// \n\t\t\t// label4\n\t\t\t// \n\t\t\tthis.label4.AutoSize = true;\n\t\t\tthis.label4.Location = new System.Drawing.Point(130, 258);\n\t\t\tthis.label4.Name = \"label4\";\n\t\t\tthis.label4.Size = new System.Drawing.Size(61, 13);\n\t\t\tthis.label4.TabIndex = 7;\n\t\t\tthis.label4.Text = \"Thank you!\";\n\t\t\t// \n\t\t\t// label5\n\t\t\t// \n\t\t\tthis.label5.AutoSize = true;\n\t\t\tthis.label5.Location = new System.Drawing.Point(12, 222);\n\t\t\tthis.label5.MaximumSize = new System.Drawing.Size(260, 0);\n\t\t\tthis.label5.Name = \"label5\";\n\t\t\tthis.label5.Size = new System.Drawing.Size(103, 13);\n\t\t\tthis.label5.TabIndex = 8;\n\t\t\tthis.label5.Text = \"Your anonymous ID:\";\n\t\t\t// \n\t\t\t// anonymousIdLabel\n\t\t\t// \n\t\t\tthis.anonymousIdLabel.AutoSize = true;\n\t\t\tthis.anonymousIdLabel.Location = new System.Drawing.Point(12, 235);\n\t\t\tthis.anonymousIdLabel.MaximumSize = new System.Drawing.Size(260, 0);\n\t\t\tthis.anonymousIdLabel.Name = \"anonymousIdLabel\";\n\t\t\tthis.anonymousIdLabel.Size = new System.Drawing.Size(24, 13);\n\t\t\tthis.anonymousIdLabel.TabIndex = 9;\n\t\t\tthis.anonymousIdLabel.Text = \"(ID)\";\n\t\t\t// \n\t\t\t// timer1\n\t\t\t// \n\t\t\tthis.timer1.Tick += new System.EventHandler(this.timer1_Tick);\n\t\t\t// \n\t\t\t// ErrorForm\n\t\t\t// \n\t\t\tthis.AcceptButton = this.button1;\n\t\t\tthis.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n\t\t\tthis.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n\t\t\tthis.ClientSize = new System.Drawing.Size(284, 288);\n\t\t\tthis.Controls.Add(this.anonymousIdLabel);\n\t\t\tthis.Controls.Add(this.label5);\n\t\t\tthis.Controls.Add(this.label4);\n\t\t\tthis.Controls.Add(this.linkLabel1);\n\t\t\tthis.Controls.Add(this.label3);\n\t\t\tthis.Controls.Add(this.label2);\n\t\t\tthis.Controls.Add(this.button1);\n\t\t\tthis.Controls.Add(this.textBox1);\n\t\t\tthis.Controls.Add(this.label1);\n\t\t\tthis.Cursor = System.Windows.Forms.Cursors.Arrow;\n\t\t\tthis.Icon = ((System.Drawing.Icon)(resources.GetObject(\"$this.Icon\")));\n\t\t\tthis.MaximizeBox = false;\n\t\t\tthis.MaximumSize = new System.Drawing.Size(300, 327);\n\t\t\tthis.MinimizeBox = false;\n\t\t\tthis.MinimumSize = new System.Drawing.Size(300, 327);\n\t\t\tthis.Name = \"ErrorForm\";\n\t\t\tthis.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;\n\t\t\tthis.Text = \"Lemma - Error\";\n\t\t\tthis.Load += new System.EventHandler(this.ErrorForm_Load);\n\t\t\tthis.ResumeLayout(false);\n\t\t\tthis.PerformLayout();\n\n\t\t}\n\n\t\t#endregion\n\n\t\tprivate System.Windows.Forms.Label label1;\n\t\tprivate System.Windows.Forms.TextBox textBox1;\n\t\tprivate System.Windows.Forms.Button button1;\n\t\tprivate System.Windows.Forms.Label label2;\n\t\tprivate System.Windows.Forms.Label label3;\n\t\tprivate System.Windows.Forms.LinkLabel linkLabel1;\n\t\tprivate System.Windows.Forms.Label label4;\n\t\tprivate System.Windows.Forms.Label label5;\n\t\tprivate System.Windows.Forms.Label anonymousIdLabel;\n\t\tprivate System.Windows.Forms.Timer timer1;\n\t}\n}"
  },
  {
    "path": "Lemma/ErrorForm.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\nusing System.Windows.Forms;\nusing System.Diagnostics;\nusing Lemma.Components;\n\nnamespace Lemma\n{\n\tpublic partial class ErrorForm : Form\n\t{\n\t\tprivate string error;\n\t\tprivate string anonymousId;\n\n#if ANALYTICS\n\t\tpublic Session.Recorder Session;\n\t\tprivate bool enableUpload;\n#endif\n\t\tpublic ErrorForm(string error, string anonymousId, bool upload)\n\t\t{\n\t\t\tthis.error = error;\n\t\t\tthis.anonymousId = anonymousId;\n#if ANALYTICS\n\t\t\tthis.enableUpload = upload;\n#endif\n\t\t\tInitializeComponent();\n\t\t}\n\n\t\tprivate void ErrorForm_Load(object sender, EventArgs e)\n\t\t{\n\t\t\tthis.textBox1.Text = this.error;\n\t\t\tthis.anonymousIdLabel.Text = this.anonymousId;\n#if ANALYTICS\n\t\t\tif (this.Session != null && this.Session.Uploading)\n\t\t\t\tthis.timer1.Start();\n#endif\n\t\t\tthis.updateUploadStatus();\n\t\t\tCursor.Show();\n\t\t}\n\n\t\tprivate void updateUploadStatus()\n\t\t{\n#if ANALYTICS\n\t\t\tif (this.Session != null && this.Session.Uploading)\n\t\t\t\tthis.label1.Text = \"Uploading crash report... please wait.\";\n\t\t\telse if (this.enableUpload && this.Session != null)\n\t\t\t\tthis.label1.Text = \"Crash report uploaded. Thank you!\";\n\t\t\telse\n\t\t\t\tthis.label1.Text = \"Error trace:\";\n#endif\n\t\t}\n\n\t\tprivate void button1_Click(object sender, EventArgs e)\n\t\t{\n\t\t\tthis.Close();\n\t\t}\n\n\t\tprivate void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)\n\t\t{\n\t\t\tProcessStartInfo sInfo = new ProcessStartInfo(\"mailto:evan@etodd.io\");\n\t\t\tProcess.Start(sInfo);\n\t\t}\n\n\t\tprivate void timer1_Tick(object sender, EventArgs e)\n\t\t{\n\t\t\tthis.updateUploadStatus();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/ErrorForm.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"timer1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <metadata name=\"$this.Locked\" type=\"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\n    <value>True</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"$this.Icon\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        AAABAAEAgIAAAAEAGAAoyAAAFgAAACgAAACAAAAAAAEAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP\n        DQcPDQcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS9oVS9oVQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1u+olQIBwQA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAIBwS+olTNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vMrVfKq1LTuG7Zw4XGr28IBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLq1Pcx4zx6dH////////////+/v7CqWII\n        BwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNrlrMrVfi0J/7\n        +fL////////////////////////axYm+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vMrlnn2bH///3////////////////////////////////StmnNr1u+olQIBwQAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFXi0J7+/fv/////////////////////////////\n        ///////y69XLrVbNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFTcyI77+fL/////\n        ///////////////////////////////////////Qs2PNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vQtGX1797////////////////////////////////////////////////ey5PNr1vNr1vN\n        r1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+\n        olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLq1Pfy5X/////////////////////////////////////\n        ///////////////r3rzLrFXNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vKq1Pcx4v38+f/////////\n        ///////////////////////////////////////////eypPMrVbNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vN\n        r1vMrlneypL69u3////////////////////////////////////////////////////8+/bTuW7Nr1rN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI\n        BwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vYwYD/////////////////////////////////////////\n        ///////////////////t4cLMrljNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+\n        olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vj0aL/////////\n        ///////////////////////////////////////////////////Vu3TNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vLq1P28OD////////////////////////////////////////////////////1\n        7t3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVbn2bD/////////////////////////\n        ///////////////////////////////q3bjNrlrNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFbaw4T8\n        +vT////////////////////////////////////////////////////////////UunLNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vLrFXw587/////////////////////////////////////////////////////\n        ///////////+/fvTuXDNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrlnl1ar/////////////////////////\n        ///////////////////////////////////////////////gzprNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCAS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vU\n        u3P////////////////////////////////////////////////////////////////////////////h\n        z53Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1u+olQJCAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABdUCnTtF7Nr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vMrlju5Mj/////////////////////////////////////////////\n        ///////////////////////////////l1qrNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF5dUCkAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVbz69f/////////////\n        ///////////////////////////////////////////////////////////////r373MrlnNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0A\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vN\n        r1vNr1vNr1vNr1rfzJf/////////////////////////////////////////////////////////////\n        ///////////////38uPLrFXNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vMrlnXv337+PD/////////////////////\n        ///////////////////////////////////////////////////Ps2PNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAMCgUsJhMAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vLrFXq3bn/////////////////////////////////////////////////////////////////\n        ///o2rLNrlrNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5k\n        Vi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAsJhMMCgUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS9olTQsVwmIREAAAAAAAAAAAAAAAAAAAAA\n        AAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFbj06T/////////////////////////////\n        ///////////////////////////////////////PsmHNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQsVy9olQIBwQAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTN\n        r1vNr1vQslwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        rlrOsF3j06X////////////////////////////////////////////////////////////u5MfMrVbN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAmIRHQslzNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABk\n        Vi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1veypP/////////////////////////////////////\n        ///////////////////////////Zw4TNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vU\n        tV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vQ\n        slwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFTx6dH/\n        ///////////////////////////////////////////////////////////9+/fMrlnNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzNr1vNr1vN\n        r1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+\n        olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7N\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1r8+vT/////////////////////////////////////////////\n        ///////////////t4sPMrVbNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vQslwmIREA\n        AAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vVu3P/////////////\n        ///////////////////////////////////////////////////dyI7Nr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vN\n        r1vNr1vNr1vNr1vNrlri0J//////////////////////////////////////////////////////////\n        ///////RtWjNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI\n        BwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAA\n        AAAAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1rLq1Px6ND/////////////////////\n        ///////////////////////////////////////49OnLrFTNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+\n        olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAAAAAAAAAAAAAAAAAAAABjVSvSs1vKq1LTuW/hz5zn167o\n        27Xq3rrq3bn////////////////////////////////////////////////////////////////69/DW\n        vXfMrljUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vQslwmIREAAAAAAAAAAAAhISFS\n        UlJycnKEhYjb1L39/Pj/////////////////////////////////////////////////////////////\n        ///////////////////////////////////s3rdeUCYAAAAAAAAAAAAAAAAAAAAAAAAAAAAmIRHQslzN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vLrFXTt2h8e3jDw8P/////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////////l5eYsLCwA\n        AAAAAAAAAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFTcxor1797/////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////+Ojo4AAAAAAAAAAAAmIRHQslzNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrljWvXj49On/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////o6OgvLy8kHgzQ\n        slzNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vLrFTn2bH/////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////t48TOsF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFXw6ND/////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        /////////////////////////////////////////////////////////////////v7gzZnLrFTNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrlno2rP/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////8+/bj06PMrlnNr1rNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vRtWf/////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////l1anMrFbNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1rn2bD/////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////38uXQs2TNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVjv5sz/\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////8+/bNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQI\n        BwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vMrVfy6tT/////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////n2LDNr1rNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVbz69b/////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////1793LrFbNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vLrFb1793/////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////////////////1\n        797LrFbNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrVb07dr/////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////t4sTMrlnNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrlju48b/\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////WvnrNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBwS+\n        olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vgzpr/////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////8+vXfy5TMrljNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAIBwS+olTNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vRtGb/////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////9+/fXv3zPs2PKq1LNr1rNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1u+olQIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALCgW9olTNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vLrFb07dr/////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////Ps2PNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1u9olQLCgUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAA1LRfStF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vdyY//////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////TuW/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vStF01\n        LRcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vL\n        q1T8+/b/////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////OsF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXT\n        tF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vi0aD/////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////////////v5crM\n        rVfNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFb49On/////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////m2K7MrVfNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vT\n        tF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vRtWf+/fz/////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////29vbGxsbn5+f+/v7/\n        ///////////////////////////////49Ojy6dPv5svq3rzfzJbNr1zNrlrNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTuW/9/Pn/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////+5ubkPDw8AAAAAAAALDAxvZEbfx4TdyY/fzJjVvXfLrFbLrFTMrVfMrVjNrlnN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vPsmL18OD/////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////Ozs6Pj485OTkAAABkVi3U\n        tV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFXXv3v+/fv/////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////Ozs4FBghlVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vPsmH28eP/////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////6+voFBgllVi3UtV7Nr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vfzZj/////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////c3NwAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFT6\n        9+//////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////////////////////////+VlZUAAABkVi3UtV7Nr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAw\n        KRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vMrVbz7Nf/////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////8dHR0AAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFbTuG7j0aHy5sXR\n        0M7/////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////////////+8vLwAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3N\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vUtV5kVSoAAAANDQ16enro6Oj/////////////////////////////////\n        //////////////////////////////////////////////////////////////////////////8YGBgA\n        AAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAABA\n        QEDb29v/////////////////////////////////////////////////////////////////////////\n        //////////////////////////+Xl5cAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vU\n        tV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAmHwru4bz/////////////////////////////////////\n        //////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAABk\n        Vi3UtV7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3LrVb7+PH/\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////9WVlYAAAAAAAAAAAAAAABkVi3UtV7Nr1vNr1vNr1vNr1vNr1rNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAwKRXTtF3Nr1vNr1vXv3v/////////////////////////////////////////////////\n        ///////////////////////////////////////////////FxcUAAAAAAAAAAAAAAAAAAABkVi3UtV7N\n        r1vMrFbbxoro2rPaxYfLrFTMrlnNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vTtF0wKRUA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vLrFby6tP/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //8aGhoAAAAAAAAAAAAAAAAAAABkVi3Sslnq3rz////////////y69Xp3LbSuG3MrlnKqlLNrlrNr1vN\n        r1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vN\n        r1vNr1vNr1vNr1vUu3T/////////////////////////////////////////////////////////////\n        //////////////////////////////////+Xl5cAAAAAAAAAAAAAAAAAAAAAAACPhmz/////////////\n        ///////////////o2rT////bxYjNr1vNr1vNr1vNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vMrVby6dL/////////////////////////\n        //////////////////////////////////////////////////////////////////////8FBQUAAAAA\n        AAAAAAAAAAAUFBT////////////////////////////////////////z7NjLrVbNr1vNr1vNr1vTtF0w\n        KRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vUunH/////////////////////////////////////////////////////////////////////////\n        //////////////////////+FhIMAAAAAAAAAAAAAAADi4uL/////////////////////////////////\n        ///////////Qs2PNr1vNr1vTtF0wKRUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXT\n        tF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3N\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVjt4sP/////////////////////////////////////\n        ///////////////////////////////////////////////////////////////b29vLy8v39/f/////\n        ///////////////////////////////////////////v5MjLrFTTtF4wKRUAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vUtV5kVi0AAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vPsmD/////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////////////////z\n        6c5NRTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vN\n        r1vNr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1rhzpv/////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////////////96enoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3Nr1vNr1vUtV5kVi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXT\n        tF3Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vLrFTz7Nj/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////////////////////////////////////////////////9ubm4A\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwKRXTtF3UtV5kVi0AAAAA\n        AAB+fn7Ly8uZmZmJiYlFRkYsJA3TtF7Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vPsmH/////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////8fHx8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAzLBdnWC4AAAAAAAAAAAAkJCTY2Nj////+/v7////99+fStmrNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vMrlnMrljMrlnMrlnNr1vNr1vNr1vLrFXm2K7/////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////Hx8cAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnJyf/\n        ///////////+/frPsmHMrVfMrVfLrFXKqlLPsWDXv3zfzZjl1qvr3rzu5Mft4sPs4L/k1KfaxIbbxovz\n        7Nj/////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////8uLi4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAC9vb3////////////u7u7n5+f////////////////////x6NDw58318OD+/v3/////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //////////////////////////////////////////////////9oaGgAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABNTU2YmJjT09P+/v7/////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        //+GhoYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACFhYX/////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////69+/cyI759ev/////////////////////////////////////////////\n        //////////////////////////////////+GhoYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAACSkpL/////////////////////////////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////l1ajLrFXNr1vLrFX59er/////////\n        //////////////////////////////////////////////////////////////////95eXkAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATExP/////////////////////////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////////////x6dHQ\n        tGbNrlrNr1vNr1vNr1vZwoL/////////////////////////////////////////////////////////\n        //////////////////9UVFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AADp6en////////////////////////////49Ojx6NDq3bnn2bHl1qvk06Xi0Z/q3rr179//////////\n        ////////////////////////////////////////////////////////////////////////////////\n        ///////////////////48+fYwX/LrFbNr1vNr1vNr1vNr1vNr1vLq1P48+f/////////////////////\n        //////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEAAAAAAAAKCgoVFRUhISESEhIAAAA5LhLTs1jMrVfNrlrN\n        r1vNr1vNr1vNr1vNrlrLrFXKq1LSt2vVu3TWvnnTuG/t48X/////////////////////////////////\n        ///////////////////////////////z7Njq3bnl1argzprXwH3Lq1PNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vgzZj///////////////////////////////////////////////////////////////////+f\n        n58AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrVbZwoL8+vX/////\n        ///////////////////////////////////////////////////////+/fvj0aLLrFTNrlrNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1r/////////////////////////////////////\n        //////////////////////////////8JCQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vOsF3u5Mj////////////////////////////////////////////////////////////6\n        9+7gzZnLrFXNr1rNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vRsVna187/\n        //////////////////////////////////////////////////////////9paWkAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vMrVfaxYj+/vz/////////////////////////////////\n        ///////////////////////w5szZwoLLq1PNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vVtl88MxtNTU7/////////////////////////////////////////////////\n        //////+7u7sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vMrVjs4L//////////\n        ///////////////////////////////////7+fLu5Mj////u5MfRtWfMrVfNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vVtl88MxsAAAAAAACpqan/////////////\n        ///////////////////////////////////KysoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAA7MhrPr1XZw4P7+fL////////////////////////////////////////z69fZwoLKq1PMrVfTuW/M\n        rVjNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vVtl88\n        MxsAAAAAAAAAAAAAAADJycn///////////////////////////////////////91dXUAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBwd3eHju7u7/////////////////////////////////////\n        ///48+fYwH/LrFXNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vVtl88MxsAAAAAAAAAAAAAAAAAAAAwMDD/////////////////////////\n        //////+6uroWFhYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Nzeurq7/////////////////\n        ///////////////////////////8+vTdypHLq1TNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vVtl88MxsAAAAAAAAAAAAAAAAAAABf\n        X1/////////////////////////8/Pybm5stLS0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABY\n        WFjk5OT//////////////////////////////////////////////v3i0qLLrFXNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vV\n        tl88MxsAAAAAAAAAAAB4eHjg4OD///////////////////////////+pqakAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAABTU1Pm5ub////////////////////////////////////////////////p\n        3LfNr1rNr1rNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vVtl88MxsAAAAAAAAbGxu7u7v/////////////////////////////\n        //////8ICAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAuLi7Z2dn/////////////////////////\n        ///////////////////////GxsXZvG7MrlnNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vVtl88MxsAAAAdHR2urq7/////\n        //////////////////////////////////90dHQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALCwusrKz/\n        ///////////////////////////////////////////////u7u5ISEgAAAA8MxvVtl/Nr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vQsFg/Nh5dXV7FxcX////////////////////////////////5+fnc3NywsLBdXV0AAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAABTU1P////////////////////////////////////////////////8/PxwcHAA\n        AAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vMrlnKq1PRtGbgz5vm4NH///////////////////////////////////+enp4x\n        MTEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwsLD/////////////////////////////\n        //////////////////+CgoIAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vNr1vNr1vNr1vNr1vNr1vNrlrMrVjLrFbKqlLQs2PdyZDs4MD7+PD/////////////////////\n        ///////////////w8PBoaGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6Ojr09PT/\n        //////////////////////////////////////////+VlZUGBgYAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vMrljk1Kfv5sv07tz+/vz/////\n        ///////////////////////////////////////l5eVbW1sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAANDQ2ysrL///////////////////////////////////////////+MjIwLCwsAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vN\n        r1vNr1vLrFT49er////////////////////////////////////////////////Z2dlNTU0AAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB7e3v/////////////////////////////////\n        ///////39/d3d3cAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8\n        MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vNr1vNr1vKq1P07tz/////////////////////////////////\n        ///////Jyck/Pz8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcHBxqamq1tbXPz8/CwsJfX182NjaPj4//////////\n        ///////////////////////////////MzMxgYGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vNr1vNr1vLrFXq3rr/////\n        //////////////////////////////+rq6smJiYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDAysrKz/////////\n        ///////////////////////////////////////////////////h4eF4eHgREREAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/N\n        r1vNr1vNr1vNr1vNrlnn2K/r3rvfy5XdyY/y6dP///////////////+Ojo4ODg4AAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAMDAyJiYn///////////////////////////////////////////////////////////+0tLQ1\n        NTUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vLrFXNrlrNr1vNr1vTsliVkYjDw8Nf\n        X18AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB5eXn////////u7u6AgIDQ0ND/////////////////////\n        ///////////////+/v6MjIwQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vN\n        r1vNr1vNr1vNr1vVtl88MxsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXFxdtbW05OTkA\n        AAAgICD////////////////////////////////y8vJkZGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vNr1vNr1vVtl88MxsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABqamr///////////////////////////////+AgIAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8MxvVtl/Nr1vNr1vVtl88MxsA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABhYWHs7Oz/////////////////\n        //////////+tra0ODg4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAA8MxvVtl/Vtl88MxsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB2\n        dnb39/f///////////////////////////+mpqYcHBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBOB1BOB0AAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAHBwft7e3///////////////////////////+WlpYQEBAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcHBz////////////////////t\n        7e13d3cFBQUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAD////////////5+fmwsLBCQkIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVFRViYmIfHx8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\n</value>\n  </data>\n</root>"
  },
  {
    "path": "Lemma/Factories/AmbientLightFactory.cs",
    "content": "﻿using System;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class AmbientLightFactory : Factory<Main>\n\t{\n\t\tpublic AmbientLightFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"AmbientLight\");\n\n\t\t\tentity.Add(\"Transform\", new Transform());\n\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tAmbientLight ambientLight = entity.GetOrCreate<AmbientLight>(\"AmbientLight\");\n\t\t\tentity.CannotSuspendByDistance = true;\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"Enable\", ambientLight.Enable);\n\t\t\tentity.Add(\"Disable\", ambientLight.Disable);\n\t\t\tentity.Add(\"Color\", ambientLight.Color, new PropertyEntry.EditorData() { FChangeBy = 0.1f });\n\t\t\tentity.Add(\"Enabled\", ambientLight.Enabled);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\sphere\";\n\t\t\tmodel.Add(new Binding<Vector3>(model.Color, entity.Get<AmbientLight>().Color));\n\t\t\tmodel.Scale.Value = new Vector3(0.5f);\n\t\t\tmodel.Serialize = false;\n\n\t\t\tentity.Add(\"EditorModel\", model);\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, entity.Get<Transform>().Matrix));\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/AmbientSoundFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class AmbientSoundFactory : Factory<Main>\n\t{\n\t\tpublic AmbientSoundFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"AmbientSound\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tAmbientSound ambientSound = entity.GetOrCreate<AmbientSound>(\"AmbientSound\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main).EditorProperties();\n\t\t\tVoxelAttachable.BindTarget(entity, ambientSound.Position);\n\n\t\t\tentity.Add(\"PlayCue\", ambientSound.PlayCue, new PropertyEntry.EditorData { Options = WwisePicker.Get(main) });\n\t\t\tentity.Add(\"StopCue\", ambientSound.StopCue, new PropertyEntry.EditorData { Options = WwisePicker.Get(main) });\n\n\t\t\tentity.Add(\"Play\", ambientSound.Enable);\n\t\t\tentity.Add(\"Stop\", ambientSound.Disable);\n\t\t\tentity.Add(\"Enabled\", ambientSound.Enabled);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/AnimatedPropFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing Lemma.IO;\n\nnamespace Lemma.Factories\n{\n\tpublic class AnimatedPropFactory : Factory<Main>\n\t{\n\t\tpublic AnimatedPropFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"AnimatedProp\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tAnimatedModel model = entity.GetOrCreate<AnimatedModel>(\"Model\");\n\n\t\t\tAnimatedProp prop = entity.GetOrCreate<AnimatedProp>(\"AnimatedProp\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main).EditorProperties();\n\n\t\t\tmodel.EditorProperties();\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, transform.Matrix));\n\n\t\t\tentity.Add(\"Visible\", model.Enabled);\n\t\t\tListProperty<string> clips = null;\n\t\t\tif (main.EditorEnabled)\n\t\t\t{\n\t\t\t\tclips = new ListProperty<string>();\n\t\t\t\tmodel.Add(new ChangeBinding<string>(model.Filename, delegate(string old, string value)\n\t\t\t\t{\n\t\t\t\t\tclips.Clear();\n\t\t\t\t\tif (model.IsValid)\n\t\t\t\t\t\tclips.AddAll(model.Clips.Keys);\n\t\t\t\t}));\n\t\t\t}\n\t\t\tentity.Add(\"Clip\", prop.Clip, new PropertyEntry.EditorData { Options = clips, });\n\t\t\tentity.Add(\"Loop\", prop.Loop);\n\t\t\tentity.Add(\"Enabled\", prop.Enabled);\n\t\t\tentity.Add(\"Enable\", prop.Enable);\n\t\t\tentity.Add(\"Disable\", prop.Disable);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tModel model = entity.Get<Model>(\"Model\");\n\t\t\tModel editorModel = entity.Get<Model>(\"EditorModel\");\n\t\t\teditorModel.Add(new Binding<bool>(editorModel.Enabled, () => Editor.EditorModelsVisible && (!entity.EditorSelected || !model.IsValid), entity.EditorSelected, model.IsValid, Editor.EditorModelsVisible));\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, editorModel.Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/BinderFactory.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class BinderFactory : Factory<Main>\n\t{\n\t\tpublic BinderFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.0f, 1f, 0.0f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Binder\");\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tScriptlike.AttachEditorComponents(entity, main, this.Color);\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"InTarget\", entity.Get<Binder>().InTarget);\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"OutTarget\", entity.Get<Binder>().OutTarget);\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tBinder binder = entity.GetOrCreate<Binder>(\"Binder\");\n\n\t\t\tbase.Bind(entity, main, creating);\n\n\t\t\tentity.Add(\"Bind immediately\", binder.BindImmediately, description: \"Bind the properties on load\");\n\t\t\tentity.Add(\"Bind\", binder.Bind, description: \"Link values together\");\n\t\t\tentity.Add(\"Unbind\", binder.UnBind, description: \"Unlink values\");\n\t\t\tentity.Add(\"Set\", binder.Set, description: \"Transfer value without binding\");\n\t\t\tentity.Add(\"Two-way\", binder.TwoWay, \"Out property will also affect in property.\");\n\t\t\tentity.Add(\"Type\", binder.PropertyType);\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t{\n\t\t\t\tFunc<Setter.PropType, Property<bool>> visible = delegate(Setter.PropType t)\n\t\t\t\t{\n\t\t\t\t\tProperty<bool> result = new Property<bool>();\n\t\t\t\t\tentity.Add(new Binding<bool, Setter.PropType>(result, x => x == t, binder.PropertyType));\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\tListProperty<string> inTargetOptions = new ListProperty<string>();\n\t\t\t\tListProperty<string> outTargetOptions = new ListProperty<string>();\n\t\t\t\tAction populateInOptions = delegate()\n\t\t\t\t{\n\t\t\t\t\tinTargetOptions.Clear();\n\t\t\t\t\tEntity e = binder.InTarget.Value.Target;\n\t\t\t\t\tif (e != null && e.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tType t = Setter.TypeMapping[binder.PropertyType];\n\t\t\t\t\t\tforeach (KeyValuePair<string, PropertyEntry> p in e.Properties)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (p.Value.Property.GetType().GetGenericArguments().First() == t)\n\t\t\t\t\t\t\t\tinTargetOptions.Add(p.Key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tAction populateOutOptions = delegate()\n\t\t\t\t{\n\t\t\t\t\toutTargetOptions.Clear();\n\t\t\t\t\tEntity e = binder.OutTarget.Value.Target;\n\t\t\t\t\tif (e != null && e.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tType t = Setter.TypeMapping[binder.PropertyType];\n\t\t\t\t\t\tforeach (KeyValuePair<string, PropertyEntry> p in e.Properties)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (p.Value.Property.GetType().GetGenericArguments().First() == t)\n\t\t\t\t\t\t\t\toutTargetOptions.Add(p.Key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tAction populateOptions = delegate()\n\t\t\t\t{\n\t\t\t\t\tpopulateInOptions();\n\t\t\t\t\tpopulateOutOptions();\n\t\t\t\t};\n\n\t\t\t\tentity.Add(new NotifyBinding(populateOptions, binder.InTarget, binder.OutTarget, binder.PropertyType));\n\t\t\t\tentity.Add(new PostInitialization(populateOptions));\n\t\t\t\tentity.Add(\"TargetInProperty\", binder.TargetInProperty, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tOptions = inTargetOptions,\n\t\t\t\t});\n\t\t\t\tentity.Add(\"TargetOutProperty\", binder.TargetOutProperty, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tOptions = outTargetOptions,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/BlockFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Lemma.Components;\nusing Lemma.Util;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\n\nnamespace Lemma.Factories\n{\n\tpublic class BlockFactory : Factory<Main>\n\t{\n\t\tpublic BlockFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 0.25f, 0.25f);\n\t\t\tthis.EditorCanSpawn = false;\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Block\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tPhysicsBlock physics = entity.GetOrCreate<PhysicsBlock>(\"Physics\");\n\t\t\tModelInstance model = entity.GetOrCreate<ModelInstance>(\"Model\");\n\t\t\tBlock block = entity.GetOrCreate<Block>(\"Block\");\n\n\t\t\tphysics.Add(new TwoWayBinding<Matrix>(transform.Matrix, physics.Transform));\n\n\t\t\tProperty<Vector3> scale = new Property<Vector3> { Value = new Vector3(0.5f) };\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, () => Matrix.CreateScale(scale) * transform.Matrix, scale, transform.Matrix));\n\n\t\t\tentity.Add(\"Fade\", new Animation\n\t\t\t(\n\t\t\t\tnew Animation.Delay(5.0f),\n\t\t\t\tnew Animation.Vector3MoveTo(scale, Vector3.Zero, 1.0f),\n\t\t\t\tnew Animation.Execute(entity.Delete)\n\t\t\t));\n\n\t\t\tthis.SetMain(entity, main);\n\t\t\tPhysicsBlock.CancelPlayerCollisions(physics);\n\t\t\tif (block.StateId != Voxel.t.Empty)\n\t\t\t\tVoxel.States.All[block.StateId].ApplyToBlock(entity);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/BouncerFactory.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Paths.PathFollowing;\nusing Lemma.Util;\nusing BEPUphysics;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.SolverGroups;\nusing ComponentBind;\n\nnamespace Lemma.Factories\n{\n\tpublic class BouncerFactory : Factory<Main>\n\t{\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Bouncer\");\n\t\t\tentity.Add(\"MapTransform\", new Transform());\n\t\t\tentity.Add(\"Transform\", new Transform());\n\t\t\tentity.Add(\"Voxel\", new DynamicVoxel(0, 0, 0));\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tBouncer bouncer = entity.GetOrCreate<Bouncer>(\"Bouncer\");\n\t\t\tJointFactory.Bind(entity, main, bouncer.CreateJoint, false, creating, false);\n\n\t\t\tComponents.Joint joint = entity.GetOrCreate<Components.Joint>(\"Joint\");\n\n\t\t\tbouncer.Add(new Binding<Entity.Handle>(bouncer.Parent, joint.Parent));\n\t\t\tbouncer.Add(new Binding<Voxel.Coord>(bouncer.Coord, joint.Coord));\n\n\t\t\tDynamicVoxel voxel = entity.Get<DynamicVoxel>();\n\t\t\tvoxel.KineticFriction.Value = voxel.StaticFriction.Value = 0;\n\n\t\t\tbouncer.Add(new CommandBinding(voxel.PhysicsUpdated, delegate()\n\t\t\t{\n\t\t\t\tbouncer.PhysicsUpdated.Execute(voxel.PhysicsEntity.Mass, voxel.PhysicsEntity.Volume);\n\t\t\t}));\n\n\t\t\tentity.Add(\"UVRotation\", voxel.UVRotation);\n\t\t\tentity.Add(\"UVOffset\", voxel.UVOffset);\n\t\t\tentity.Add(\"CannotSuspendByDistance\", voxel.CannotSuspendByDistance);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/CameraStopFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class CameraStopFactory : Factory<Main>\n\t{\n\t\tpublic CameraStopFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 1.5f, 0.8f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"CameraStop\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tCameraStop cameraStop = entity.GetOrCreate<CameraStop>(\"CameraStop\");\n\n\t\t\tentity.CannotSuspendByDistance = true;\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main).EditorProperties();\n\t\t\t\n\t\t\tif (main.EditorEnabled)\n\t\t\t{\n\t\t\t\tentity.Add(\"Preview\", new Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tulong id = entity.GUID;\n\n\t\t\t\t\t\tAction go = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmain.EditorEnabled.Value = false;\n\t\t\t\t\t\t\tIO.MapLoader.Load(main, main.MapFile);\n\n\t\t\t\t\t\t\tmain.Spawner.CanSpawn = false;\n\t\t\t\t\t\t\tmain.Renderer.Brightness.Value = 0.0f;\n\t\t\t\t\t\t\tmain.Renderer.InternalGamma.Value = 0.0f;\n\t\t\t\t\t\t\tmain.UI.IsMouseVisible.Value = false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tmain.AddComponent(new PostInitialization(delegate()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// We have to squirrel away the ID and get a new entity\n\t\t\t\t\t\t\t\t// because OUR entity got wiped out by the MapLoader.\n\t\t\t\t\t\t\t\tmain.GetByGUID(id).Get<CameraStop>().Go.Execute();\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tEditor editor = main.Get(\"Editor\").First().Get<Editor>();\n\t\t\t\t\t\tif (editor.NeedsSave)\n\t\t\t\t\t\t\teditor.SaveWithCallback(go);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tgo();\n\t\t\t\t\t},\n\t\t\t\t}, Command.Perms.Executable);\n\t\t\t}\n\n\t\t\tentity.Add(\"Go\", cameraStop.Go);\n\t\t\tentity.Add(\"OnDone\", cameraStop.OnDone);\n\t\t\tentity.Add(\"Offset\", cameraStop.Offset);\n\t\t\tentity.Add(\"Blend\", cameraStop.Blend);\n\t\t\tentity.Add(\"Duration\", cameraStop.Duration);\n\t\t\tentity.Add(\"FieldOfView\", cameraStop.FieldOfView);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\light\";\n\t\t\tmodel.Color.Value = this.Color;\n\t\t\tmodel.Serialize = false;\n\t\t\tmodel.Scale.Value = new Vector3(1, 1, -1);\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, entity.Get<Transform>().Matrix));\n\t\t\tentity.Add(\"EditorModel\", model);\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main);\n\n\t\t\tModelAlpha offsetModel = new ModelAlpha();\n\t\t\toffsetModel.Filename.Value = \"AlphaModels\\\\cone\";\n\t\t\toffsetModel.Add(new Binding<Vector3>(offsetModel.Color, model.Color));\n\n\t\t\tCameraStop cameraStop = entity.Get<CameraStop>();\n\n\t\t\toffsetModel.Add(new Binding<bool>(offsetModel.Enabled, () => entity.EditorSelected && cameraStop.Offset != 0 && Editor.EditorModelsVisible, entity.EditorSelected, cameraStop.Offset, Editor.EditorModelsVisible));\n\t\t\toffsetModel.Add(new Binding<Vector3, float>(offsetModel.Scale, x => new Vector3(1, 1, x), cameraStop.Offset));\n\t\t\toffsetModel.Add(new Binding<Matrix>(offsetModel.Transform, model.Transform));\n\t\t\toffsetModel.Serialize = false;\n\t\t\tentity.Add(\"EditorModel3\", offsetModel);\n\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"Next\", cameraStop.Next);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/CloudFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class CloudFactory : Factory<Main>\n\t{\n\t\tpublic CloudFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.9f, 0.7f, 0.5f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Cloud\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tentity.CannotSuspendByDistance = true;\n\n\t\t\tCloud settings = entity.GetOrCreate<Cloud>(\"Settings\");\n\n\t\t\tModelAlpha clouds = entity.GetOrCreate<ModelAlpha>(\"Clouds\");\n\t\t\tclouds.Filename.Value = \"AlphaModels\\\\clouds\";\n\t\t\tclouds.DrawOrder.Value = -8;\n\t\t\tclouds.CullBoundingBox.Value = false;\n\t\t\tclouds.DisableCulling.Value = true;\n\n\t\t\tbase.Bind(entity, main, creating);\n\n\t\t\tclouds.Add(new Binding<Matrix>(clouds.Transform, transform.Matrix));\n\n\t\t\tclouds.Add(new Binding<string, bool>(clouds.TechniquePostfix, x => x ? \"Infinite\" : \"\", settings.Infinite));\n\n\t\t\tclouds.Add(new Binding<float>(clouds.GetFloatParameter(\"Height\"), settings.Height));\n\n\t\t\tclouds.Add(new Binding<Vector3>(clouds.GetVector3Parameter(\"CameraPosition\"), main.Camera.Position));\n\n\t\t\tclouds.Add(new Binding<Vector2>(clouds.GetVector2Parameter(\"Velocity\"), x => x * (1.0f / 60.0f), settings.Velocity));\n\n\t\t\tclouds.Add(new Binding<float>(clouds.GetFloatParameter(\"StartDistance\"), settings.StartDistance));\n\n\t\t\tentity.Add(\"Height\", settings.Height);\n\t\t\tentity.Add(\"Velocity\", settings.Velocity);\n\t\t\tentity.Add(\"StartDistance\", settings.StartDistance);\n\t\t\tentity.Add(\"Color\", clouds.Color);\n\t\t\tentity.Add(\"Alpha\", clouds.Alpha);\n\t\t\tentity.Add(\"Infinite\", settings.Infinite);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/CollectibleFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class CollectibleFactory : Factory<Main>\n\t{\n\t\tprivate Random random = new Random();\n\n\t\tpublic CollectibleFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.5f, 0.5f, 0.5f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Collectible\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tPlayerTrigger trigger = entity.GetOrCreate<PlayerTrigger>(\"PlayerTrigger\");\n\t\t\ttrigger.Serialize = false;\n\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\t\t\tCollectible collectible = entity.GetOrCreate<Collectible>(\"Collectible\");\n\t\t\t\n\t\t\ttrigger.Radius.Value = 3;\n\t\t\ttrigger.Add(new Binding<Vector3>(trigger.Position, transform.Position));\n\t\t\ttrigger.Add(new Binding<bool>(trigger.Enabled, x => !x, collectible.PickedUp));\n\n\t\t\tcollectible.Add(new CommandBinding(trigger.PlayerEntered, collectible.PlayerTouched));\n\n\t\t\tSound.AttachTracker(entity, trigger.Position);\n\n\t\t\tPointLight light = entity.Create<PointLight>();\n\t\t\tlight.Serialize = false;\n\t\t\tlight.Attenuation.Value = 10.0f;\n\t\t\tlight.Color.Value = new Vector3(1.25f, 1.75f, 2.0f);\n\t\t\tlight.Add(new Binding<Vector3>(light.Position, transform.Position));\n\t\t\tlight.Add(new Binding<bool>(light.Enabled, x => !x, collectible.PickedUp));\n\n\t\t\tParticleEmitter distortionEmitter = entity.GetOrCreate<ParticleEmitter>(\"DistortionEmitter\");\n\t\t\tdistortionEmitter.Serialize = false;\n\t\t\tdistortionEmitter.Add(new Binding<Vector3>(distortionEmitter.Position, trigger.Position));\n\t\t\tdistortionEmitter.ParticleType.Value = \"Distortion\";\n\t\t\tdistortionEmitter.ParticlesPerSecond.Value = 4;\n\t\t\tdistortionEmitter.Jitter.Value = new Vector3(0.5f);\n\t\t\tdistortionEmitter.Add(new Binding<bool>(distortionEmitter.Enabled, x => !x, collectible.PickedUp));\n\n\t\t\tModel model = entity.GetOrCreate<Model>(\"Model\");\n\t\t\tmodel.Filename.Value = \"Models\\\\sphere\";\n\t\t\tmodel.Serialize = false;\n\t\t\tmodel.Scale.Value = new Vector3(0.5f);\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, transform.Matrix));\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, x => !x, collectible.PickedUp));\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tattachable.EditorProperties();\n\t\t\tentity.Add(\"Collected\", collectible.PlayerTouched);\n\t\t}\n\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t\tPlayerTrigger.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/ConsoleCommandFactory.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class ConsoleCommandFactory : Factory<Main>\n\t{\n\t\tpublic ConsoleCommandFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.0f, 1f, 0.0f);\n\t\t\tthis.AvailableInRelease = false;\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"ConsoleCommand\");\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tScriptlike.AttachEditorComponents(entity, main, this.Color);\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tConsoleCommand cmd = entity.GetOrCreate<ConsoleCommand>(\"ConsoleCommand\");\n\n\t\t\tbase.Bind(entity, main, creating);\n\n\t\t\tentity.Add(\"Execute\", cmd.Execute, description: \"Execute console command\");\n\t\t\tentity.Add(\"Name\", cmd.Name, description: \"Name of the console command\");\n\t\t\tentity.Add(\"Description\", cmd.Description, description: \"Description to display in console help\");\n#if DEVELOPMENT\n\t\t\tentity.Add(\"EnabledInRelease\", cmd.EnabledInRelease);\n#endif\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/ConstantFactory.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class ConstantFactory : Factory<Main>\n\t{\n\t\tpublic ConstantFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.55f, 0.34f, 0.57f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Constant\");\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tScriptlike.AttachEditorComponents(entity, main, this.Color);\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tConstant constant = entity.GetOrCreate<Constant>(\"Constant\");\n\n\t\t\tbase.Bind(entity, main, creating);\n\n\t\t\tentity.Add(\"Integer\", constant.IntProperty, \"Integer (whole-number) constant value\");\n\t\t\tentity.Add(\"Float\", constant.FloatProperty, \"Float (decimal number) constant value\");\n\t\t\tentity.Add(\"Boolean\", constant.BoolProperty, \"Boolean (true/false) constant value\");\n\t\t\tentity.Add(\"String\", constant.StringProperty, \"String constant value\");\n\t\t\tentity.Add(\"Vector3\", constant.Vector3Property, \"Vector3 (X,Y,Z) constant value\");\n\t\t\tentity.Add(\"Vector4\", constant.Vector4Property, \"Vector4 (X,Y,Z,W) constant value\");\n\t\t\tentity.Add(\"Direction\", constant.DirectionProperty, \"Integer (whole-number) constant value\");\n\t\t\t\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/CounterFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class CounterFactory : Factory<Main>\n\t{\n\t\tpublic CounterFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.0f, 0.4f, 1.0f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Counter\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\t\t\tentity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tCounter c = entity.GetOrCreate<Counter>(\"Counter\");\n\t\t\tbase.Bind(entity, main, creating);\n\t\t\tentity.Add(\"StartingValue\", c.StartingValue);\n\t\t\tentity.Add(\"Target\", c.Target);\n\t\t\tentity.Add(\"IncrementBy\", c.IncrementBy);\n\t\t\tentity.Add(\"OnlyTriggerOnce\", c.OnlyOnce);\n\t\t\tentity.Add(\"OnTargetHit\", c.OnTargetHit);\n\t\t\tentity.Add(\"Increment\", c.Increment);\n\t\t\tentity.Add(\"Reset\", c.Reset);\n\t\t\tentity.Add(\"Value\", c.Count, readOnly: true);\n\t\t\tentity.Add(\"HasHitTarget\", c.HasHitTarget, readOnly: true);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tScriptlike.AttachEditorComponents(entity, main, this.Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/DialogueFileFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class DialogueFileFactory : Factory<Main>\n\t{\n\t\tpublic DialogueFileFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t\tthis.AvailableInRelease = false;\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"DialogueFile\");\n\n\t\t\tentity.Add(\"Transform\", new Transform());\n\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tthis.SetMain(entity, main);\n\t\t\tentity.CannotSuspend = true;\n\n\t\t\tDialogueFile file = entity.GetOrCreate<DialogueFile>(\"DialogueFile\");\n\t\t\tfile.EditorProperties();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/DirectionalLightFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class DirectionalLightFactory : Factory<Main>\n\t{\n\t\tpublic DirectionalLightFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.8f, 0.8f, 0.8f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"DirectionalLight\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspendByDistance = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tDirectionalLight directionalLight = entity.GetOrCreate<DirectionalLight>(\"DirectionalLight\");\n\t\t\tdirectionalLight.Add(new Binding<Quaternion>(directionalLight.Quaternion, transform.Quaternion));\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"Enable\", directionalLight.Enable);\n\t\t\tentity.Add(\"Disable\", directionalLight.Disable);\n\t\t\tentity.Add(\"Enabled\", directionalLight.Enabled);\n\t\t\tentity.Add(\"Color\", directionalLight.Color);\n\t\t\tentity.Add(\"Shadowed\", directionalLight.Shadowed);\n\t\t\tentity.Add(\"Clouds\", directionalLight.CloudShadow);\n\t\t\tentity.Add(\"CloudVelocity\", directionalLight.CloudVelocity);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\t\t\t\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\light\";\n\t\t\tmodel.Add(new Binding<Vector3>(model.Color, entity.Get<DirectionalLight>().Color));\n\t\t\tmodel.Serialize = false;\n\n\t\t\tentity.Add(\"EditorModel\", model);\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, entity.Get<Transform>().Matrix));\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/DustFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing System.Xml.Serialization;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma.Factories\n{\n\tpublic class DustFactory : Factory<Main>\n\t{\n\t\tpublic DustFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 1.0f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Dust\");\n\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tif (ParticleSystem.Get(main, \"Dust\") == null)\n\t\t\t{\n\t\t\t\tParticleSystem.Add(main, \"Dust\",\n\t\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t\t{\n\t\t\t\t\tTextureName = \"Particles\\\\default\",\n\t\t\t\t\tEffectFile = \"Effects\\\\ParticleSnow\",\n\t\t\t\t\tMaxParticles = 20000,\n\t\t\t\t\tDuration = TimeSpan.FromSeconds(3.0f),\n\t\t\t\t\tMinHorizontalVelocity = -0.25f,\n\t\t\t\t\tMaxHorizontalVelocity = 0.25f,\n\t\t\t\t\tMinVerticalVelocity = -0.25f,\n\t\t\t\t\tMaxVerticalVelocity = 0.25f,\n\t\t\t\t\tGravity = new Vector3(0.0f, 0.0f, 0.0f),\n\t\t\t\t\tMinRotateSpeed = 0.0f,\n\t\t\t\t\tMaxRotateSpeed = 0.0f,\n\t\t\t\t\tMinStartSize = 0.02f,\n\t\t\t\t\tMaxStartSize = 0.08f,\n\t\t\t\t\tMinEndSize = 0.0f,\n\t\t\t\t\tMaxEndSize = 0.0f,\n\t\t\t\t\tMinColor = new Vector4(1.0f, 1.0f, 1.0f, 1.0f),\n\t\t\t\t\tMaxColor = new Vector4(1.0f, 1.0f, 1.0f, 1.0f),\n\t\t\t\t\tEmitterVelocitySensitivity = 1.0f,\n\t\t\t\t\tBlendState = BlendState.Opaque,\n\t\t\t\t\tMaterial = new Components.Model.Material { SpecularIntensity = 0.0f, SpecularPower = 1.0f },\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tentity.CannotSuspendByDistance = true;\n\t\t\tentity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tParticleEmitter emitter = entity.GetOrCreate<ParticleEmitter>(\"Emitter\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\temitter.CalculateVelocity = false;\n\t\t\temitter.ParticleType.Value = \"Dust\";\n\t\t\temitter.Jitter.Value = new Vector3(10, 10, 10);\n\t\t\temitter.ParticlesPerSecond.Value = 300;\n\t\t\temitter.Add(new Binding<Vector3>(emitter.Position, main.Camera.Position));\n\n\t\t\tentity.Add(\"Velocity\", emitter.VelocityOffset);\n\n\t\t\tentity.Add(new PostInitialization(delegate()\n\t\t\t{\n\t\t\t\temitter.Prime(Vector3.Zero);\n\t\t\t}));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/EditorFactory.cs",
    "content": "﻿using System;\nusing System.Windows.Forms;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.GInterfaces;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing BEPUphysics;\nusing System.Xml.Serialization;\nusing System.IO;\nusing Keys = Microsoft.Xna.Framework.Input.Keys;\nusing GeeUI.Managers;\nusing System.Text.RegularExpressions;\n\nnamespace Lemma.Factories\n{\n\tpublic class EditorFactory : Factory<Main>\n\t{\n\t\tpublic EditorFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t\tthis.EditorCanSpawn = false;\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Editor\");\n\t\t\tentity.Serialize = false;\n\t\t\treturn entity;\n\t\t}\n\n\t\tprivate void raycast(Main main, Vector3 rayStart, Vector3 ray, out Entity closestEntity, out Transform closestTransform)\n\t\t{\n\t\t\tclosestEntity = null;\n\t\t\tfloat closestEntityDistance = main.Camera.FarPlaneDistance;\n\t\t\tclosestTransform = null;\n\t\t\tforeach (Entity entity in main.Entities)\n\t\t\t{\n\t\t\t\tforeach (Transform transform in entity.GetAll<Transform>())\n\t\t\t\t{\n\t\t\t\t\tif (transform.Selectable)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 entityPos = transform.Position;\n\t\t\t\t\t\tfloat distance = (entityPos - rayStart).Length();\n\t\t\t\t\t\tVector3 closestToEntity = rayStart + ray * distance;\n\t\t\t\t\t\tif ((distance < closestEntityDistance) && (closestToEntity - entityPos).Length() < 0.5f)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclosestEntityDistance = distance;\n\t\t\t\t\t\t\tclosestEntity = entity;\n\t\t\t\t\t\t\tclosestTransform = transform;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tVoxel.GlobalRaycastResult hit = Voxel.GlobalRaycast(rayStart, ray, closestEntityDistance, null, true);\n\t\t\tif (hit.Coordinate != null)\n\t\t\t{\n\t\t\t\tclosestEntity = hit.Voxel.Entity;\n\t\t\t\tclosestTransform = null;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void AddCommand(Entity entity, Main main, ListContainer commandQueueContainer, string description, PCInput.Chord chord, Command action, ListProperty<Lemma.Components.EditorGeeUI.EditorCommand> list, Func<bool> enabled = null, params IProperty[] dependencies)\n\t\t{\n\t\t\tEditorGeeUI.EditorCommand cmd = new EditorGeeUI.EditorCommand { Description = description, Chord = chord, Action = action, Enabled = new Property<bool> { Value = true } };\n\t\t\t\n\t\t\tif (enabled != null)\n\t\t\t\tentity.Add(new Binding<bool>(cmd.Enabled, enabled, dependencies));\n\t\t\telse\n\t\t\t\tenabled = () => true;\n\n\t\t\tlist.Add(cmd);\n\n\t\t\tPCInput input = entity.Get<PCInput>();\n\t\t\tif (chord.Modifier != Keys.None)\n\t\t\t\tinput.Add(new CommandBinding(input.GetChord(chord), enabled, action));\n\t\t\telse if (chord.Mouse == PCInput.MouseButton.LeftMouseButton)\n\t\t\t\tinput.Add(new CommandBinding(input.LeftMouseButtonUp, enabled, action));\n\t\t\telse if (chord.Mouse == PCInput.MouseButton.RightMouseButton)\n\t\t\t\tinput.Add(new CommandBinding(input.RightMouseButtonUp, enabled, action));\n\t\t\telse if (chord.Mouse == PCInput.MouseButton.MiddleMouseButton)\n\t\t\t\tinput.Add(new CommandBinding(input.MiddleMouseButtonUp, enabled, action));\n\t\t\telse\n\t\t\t\tinput.Add(new CommandBinding(input.GetKeyDown(chord.Key), enabled, action));\n\n\t\t\tentity.Add(new CommandBinding(action, entity.Get<Editor>().EnableCommands, delegate()\n\t\t\t{\n\t\t\t\tContainer container = new Container();\n\t\t\t\tcontainer.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\t\tcontainer.Opacity.Value = 0.2f;\n\t\t\t\tcontainer.Add(new Binding<Vector2, Point>(container.Position, x => new Vector2(x.X - 10.0f, 10.0f), main.ScreenSize));\n\t\t\t\tTextElement display = new TextElement();\n\t\t\t\tdisplay.FontFile.Value = main.Font;\n\t\t\t\tdisplay.Text.Value = description;\n\t\t\t\tcontainer.Children.Add(display);\n\n\t\t\t\tcommandQueueContainer.Children.Add(container);\n\t\t\t\tAnimation anim = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Delay(0.5f),\n\t\t\t\t\tnew Animation.Parallel\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.FloatMoveTo(container.Opacity, 0.0f, 0.5f),\n\t\t\t\t\t\tnew Animation.FloatMoveTo(display.Opacity, 0.0f, 0.5f)\n\t\t\t\t\t),\n\t\t\t\t\tnew Animation.Execute(container.Delete)\n\t\t\t\t);\n\t\t\t\tanim.EnabledWhenPaused = false;\n\t\t\t\tentity.Add(anim);\n\t\t\t}));\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tEditor editor = entity.GetOrCreate<Editor>();\n\t\t\tEditorGeeUI gui = entity.Create<EditorGeeUI>();\n\n\t\t\tListContainer commandQueueContainer = new ListContainer();\n\t\t\tcommandQueueContainer.Reversed.Value = true;\n\t\t\tcommandQueueContainer.AnchorPoint.Value = new Vector2(1.0f, 0.0f);\n\t\t\tcommandQueueContainer.Add(new Binding<bool>(commandQueueContainer.Visible, gui.Visible));\n\t\t\tcommandQueueContainer.Add(new Binding<Vector2, Point>(commandQueueContainer.Position, x => new Vector2(x.X - 10.0f, 10.0f), main.ScreenSize));\n\t\t\tmain.UI.Root.Children.Add(commandQueueContainer);\n\t\t\tentity.Add(new CommandBinding(entity.Delete, commandQueueContainer.Delete));\n\n\t\t\tgui.Add(new Binding<bool>(gui.MovementEnabled, editor.MovementEnabled));\n\n\t\t\tProperty<bool> coordinateVisible = new Property<bool>();\n\t\t\tgui.Add(new Binding<bool>(coordinateVisible, () => editor.VoxelEditMode && !editor.VoxelSelectionActive, editor.VoxelEditMode, editor.VoxelSelectionActive));\n\t\t\tgui.SetVoxelProperties(new Dictionary<string, PropertyEntry>\n\t\t\t{\n\t\t\t\t{ \"Brush [Space]\", new PropertyEntry(editor.Brush, new PropertyEntry.EditorData()) },\n\t\t\t\t{ \"BrushSize\", new PropertyEntry(editor.BrushSize, \"[Scrollwheel]\") },\n\t\t\t\t{ \"BrushShape\", new PropertyEntry(editor.BrushShape, new PropertyEntry.EditorData()) },\n\t\t\t\t{ \"Jitter\", new PropertyEntry(editor.Jitter, \"[Shift+Scrollwheel]\") },\n\t\t\t\t{ \"JitterOctave\", new PropertyEntry(editor.JitterOctave, new PropertyEntry.EditorData()) },\n\t\t\t\t{\n\t\t\t\t\t\"Coordinate\",\n\t\t\t\t\tnew PropertyEntry\n\t\t\t\t\t(\n\t\t\t\t\t\teditor.Coordinate, new PropertyEntry.EditorData\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tReadonly = true,\n\t\t\t\t\t\t\tVisible = coordinateVisible,\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"Selection\",\n\t\t\t\t\tnew PropertyEntry\n\t\t\t\t\t(\n\t\t\t\t\t\teditor.VoxelSelectionSize, new PropertyEntry.EditorData\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tReadonly = true,\n\t\t\t\t\t\t\tVisible = editor.VoxelSelectionActive,\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tFPSInput input = entity.Create<FPSInput>();\n\t\t\tinput.Add(new Binding<PCInput.PCInputBinding>(input.LeftKey, main.Settings.Left));\n\t\t\tinput.Add(new Binding<PCInput.PCInputBinding>(input.RightKey, main.Settings.Right));\n\t\t\tinput.Add(new Binding<PCInput.PCInputBinding>(input.ForwardKey, main.Settings.Forward));\n\t\t\tinput.Add(new Binding<PCInput.PCInputBinding>(input.BackwardKey, main.Settings.Backward));\n\t\t\tinput.EnabledWhenPaused = true;\n\t\t\tProperty<bool> capslockKey = input.GetKey(Keys.CapsLock);\n\t\t\tProperty<bool> shiftKey = input.GetKey(Keys.LeftShift);\n\n\t\t\tbool disableEditorMouseCommands = false;\n\t\t\tinput.Add(new CommandBinding(input.LeftMouseButtonDown, delegate()\n\t\t\t{\n\t\t\t\tif (main.GeeUI.LastClickCaptured)\n\t\t\t\t\tdisableEditorMouseCommands = true;\n\t\t\t}));\n\t\t\tinput.Add(new CommandBinding(input.LeftMouseButtonUp, delegate()\n\t\t\t{\n\t\t\t\tdisableEditorMouseCommands = false;\n\t\t\t}));\n\n\t\t\teditor.EnableCommands = () => !gui.AnyTextFieldViewsSelected() && !ConsoleUI.Showing && !gui.PickNextEntity && !main.GeeUI.LastClickCaptured && !disableEditorMouseCommands;\n\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.MapContent = false;\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\selector\";\n\t\t\tmodel.Scale.Value = new Vector3(0.5f);\n\t\t\tmodel.Serialize = false;\n\t\t\tentity.Add(model);\n\n\t\t\tModelAlpha brushVisual = new ModelAlpha();\n\t\t\tbrushVisual.MapContent = false;\n\t\t\tbrushVisual.Add(new Binding<string, Editor.BrushShapes>(brushVisual.Filename, x => x == Editor.BrushShapes.Cube ? \"AlphaModels\\\\box\" : \"AlphaModels\\\\sphere\", editor.BrushShape));\n\t\t\tbrushVisual.Color.Value = new Vector3(1.0f);\n\t\t\tbrushVisual.Alpha.Value = 0.1f;\n\t\t\tbrushVisual.Serialize = false;\n\t\t\tbrushVisual.DrawOrder.Value = 11; // In front of water\n\t\t\tbrushVisual.DisableCulling.Value = true;\n\t\t\tentity.Add(brushVisual);\n\t\t\tbrushVisual.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tfloat s = 1.0f;\n\t\t\t\tif (editor.VoxelEditMode)\n\t\t\t\t\ts = editor.SelectedEntities[0].Get<Voxel>().Scale;\n\t\t\t\tif (editor.BrushShape == Editor.BrushShapes.Sphere)\n\t\t\t\t\tbrushVisual.Scale.Value = new Vector3(s * editor.BrushSize);\n\t\t\t\telse\n\t\t\t\t\tbrushVisual.Scale.Value = new Vector3(s * (editor.BrushSize - 0.4f) * 2.0f);\n\t\t\t}, editor.BrushSize, editor.BrushShape, editor.VoxelEditMode));\n\t\t\tbrushVisual.Add(new Binding<bool>(brushVisual.Enabled, () => editor.BrushSize > 1 && editor.VoxelEditMode, editor.BrushSize, editor.VoxelEditMode));\n\t\t\tbrushVisual.CullBoundingBox.Value = false;\n\n\t\t\tModelAlpha selection = new ModelAlpha();\n\t\t\tselection.MapContent = false;\n\t\t\tselection.Filename.Value = \"AlphaModels\\\\box\";\n\t\t\tselection.Color.Value = new Vector3(1.0f, 0.7f, 0.4f);\n\t\t\tselection.Alpha.Value = 0.25f;\n\t\t\tselection.Serialize = false;\n\t\t\tselection.DrawOrder.Value = 12; // In front of water and radius visualizer\n\t\t\tselection.DisableCulling.Value = true;\n\t\t\tentity.Add(selection);\n\t\t\tselection.Add(new Binding<bool>(selection.Enabled, () => editor.VoxelSelectionActive, editor.VoxelSelectionActive));\n\t\t\tselection.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (editor.VoxelSelectionActive)\n\t\t\t\t{\n\t\t\t\t\tconst float padding = 0.1f;\n\t\t\t\t\tVoxel map = editor.SelectedEntities[0].Get<Voxel>();\n\t\t\t\t\tVector3 start = map.GetRelativePosition(editor.VoxelSelectionStart) - new Vector3(0.5f), end = map.GetRelativePosition(editor.VoxelSelectionEnd) - new Vector3(0.5f);\n\t\t\t\t\tselection.Transform.Value = Matrix.CreateScale((end - start) + new Vector3(padding)) * Matrix.CreateTranslation((start + end) * 0.5f) * map.Transform;\n\t\t\t\t}\n\t\t\t}, editor.VoxelSelectionActive, editor.VoxelSelectionStart, editor.VoxelSelectionEnd));\n\t\t\tselection.CullBoundingBox.Value = false;\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Menu\", new PCInput.Chord(Keys.F1),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = main.Menu.Toggle,\n\t\t\t\t},\n\t\t\t\tgui.MapCommands,\n\t\t\t\t() => !gui.PickNextEntity,\n\t\t\t\tgui.PickNextEntity\n\t\t\t);\n\n\t\t\tinput.Add(new CommandBinding(input.GetChord(new PCInput.Chord(Keys.O, Keys.LeftControl)), gui.ShowOpenMenu));\n\n#if DEVELOPMENT\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Generate new UUID\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tWorldFactory.Instance.Get<World>().NewUUID();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.MapCommands,\n\t\t\t\t() => !string.IsNullOrEmpty(main.MapFile) && !input.EnableLook && !editor.VoxelEditMode && editor.TransformMode.Value == Editor.TransformModes.None && !gui.PickNextEntity,\n\t\t\t\tinput.EnableLook, editor.VoxelEditMode, editor.TransformMode, main.MapFile, gui.PickNextEntity\n\t\t\t);\n#endif\n\t\t\tRegex pathRegex = new Regex(string.Format(\"[{0}]\", Regex.Escape(string.Format(\"{0}{1}\", Path.GetInvalidFileNameChars(), Path.GetInvalidPathChars()))));\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"New map\", new PCInput.Chord(Keys.N, Keys.LeftControl),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tmain.AddComponent(new TextPrompt(delegate(string name)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname = pathRegex.Replace(name, \"\");\n\t\t\t\t\t\t\tIO.MapLoader.New(main, Path.Combine(main.CustomMapDirectory, name), Path.Combine(main.MapDirectory, Main.TemplateMap));\n\t\t\t\t\t\t\teditor.NeedsSave.Value = true;\n\t\t\t\t\t\t}, \"\", \"Map name:\", \"New map\"));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.MapCommands,\n\t\t\t\t() => !input.EnableLook && !editor.VoxelEditMode && editor.TransformMode.Value == Editor.TransformModes.None && !gui.PickNextEntity,\n\t\t\t\tinput.EnableLook, editor.VoxelEditMode, editor.TransformMode, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Clone map\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tmain.AddComponent(new TextPrompt(delegate(string name)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname = pathRegex.Replace(name, \"\");\n\t\t\t\t\t\t\tIO.MapLoader.New(main, Path.Combine(main.CustomMapDirectory, name), Path.Combine(main.MapDirectory, main.MapFile));\n\t\t\t\t\t\t\teditor.NeedsSave.Value = true;\n\t\t\t\t\t\t}, \"\", \"Map name:\", \"Clone map\"));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.MapCommands,\n\t\t\t\t() => !string.IsNullOrEmpty(main.MapFile) && !input.EnableLook && !editor.VoxelEditMode && editor.TransformMode.Value == Editor.TransformModes.None && !gui.PickNextEntity,\n\t\t\t\tinput.EnableLook, editor.VoxelEditMode, editor.TransformMode, gui.PickNextEntity, main.MapFile\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Workshop publish\",\n\t\t\t\tnew PCInput.Chord(Keys.W, Keys.LeftControl),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tmain.AddComponent(new WorkShopInterface(editor));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.MapCommands,\n\t\t\t\t() => !input.EnableLook && !editor.VoxelEditMode && editor.TransformMode.Value == Editor.TransformModes.None && !string.IsNullOrEmpty(main.MapFile) && main.IsChallengeMap(main.MapFile) && Lemma.Util.SteamWorker.SteamInitialized && !gui.PickNextEntity,\n\t\t\t\tinput.EnableLook, editor.VoxelEditMode, editor.TransformMode, main.MapFile, Lemma.Util.SteamWorker.SteamInitialized, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tforeach (string key in Factory.factories.Keys)\n\t\t\t{\n\t\t\t\tstring entityType = key;\n\t\t\t\tFactory factory = Factory.Get(entityType);\n\t\t\t\tif (factory.EditorCanSpawn && (factory.AvailableInRelease || main.Settings.GodModeProperty))\n\t\t\t\t{\n\t\t\t\t\tgui.AddEntityCommands.Add(new EditorGeeUI.EditorCommand\n\t\t\t\t\t{\n\t\t\t\t\t\tDescription = string.Format(\"Add {0}\", entityType),\n\t\t\t\t\t\tEnabled = new Property<bool> { Value = true },\n\t\t\t\t\t\tAction = new Command { Action = () => editor.Spawn.Execute(entityType) },\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tinput.Add(new CommandBinding(input.GetKeyUp(Keys.Space), () => !editor.MovementEnabled && !gui.AnyTextFieldViewsSelected() && editor.TransformMode == Editor.TransformModes.None && !shiftKey, gui.ShowContextMenu));\n\t\t\tinput.Add(new CommandBinding(input.GetChord(new PCInput.Chord { Modifier = Keys.LeftShift, Key = Keys.Space }), () => !editor.MovementEnabled && !gui.AnyTextFieldViewsSelected() && editor.TransformMode == Editor.TransformModes.None, gui.ShowSelectMenu));\n\t\t\teditor.Add(new Binding<bool>(main.GeeUI.KeyboardEnabled, () => !editor.VoxelEditMode && !editor.MovementEnabled && !gui.PickNextEntity, editor.VoxelEditMode, editor.MovementEnabled, gui.PickNextEntity));\n\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, () => editor.VoxelEditMode, editor.VoxelEditMode, Editor.EditorModelsVisible));\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, () => Matrix.CreateFromQuaternion(editor.Orientation) * Matrix.CreateTranslation(editor.Position), editor.Position, editor.Orientation));\n\t\t\tbrushVisual.Add(new Binding<Matrix>(brushVisual.Transform, model.Transform));\n\n\t\t\t// When transferring between maps we need to clear our GUID to make way for the entities on the new map,\n\t\t\t// then assign ourselves a new GUID.\n\t\t\tentity.Add(new CommandBinding<string>(main.LoadingMap, delegate(string map)\n\t\t\t{\n\t\t\t\teditor.SelectedEntities.Clear();\n\t\t\t\tif (editor.VoxelEditMode)\n\t\t\t\t\teditor.VoxelEditMode.Value = false;\n\t\t\t\teditor.TransformMode.Value = Editor.TransformModes.None;\n\t\t\t\tinput.ResetLook(Vector2.Zero);\n\t\t\t\tentity.ClearGUID();\n\t\t\t}));\n\t\t\tentity.Add(new CommandBinding(main.MapLoaded, (Action)entity.NewGUID));\n\n\t\t\tgui.Add(new ListBinding<Entity>(gui.SelectedEntities, editor.SelectedEntities));\n\t\t\tgui.Add(new CommandBinding<Entity>(gui.SelectEntity, delegate(Entity e)\n\t\t\t{\n\t\t\t\teditor.SelectedEntities.Clear();\n\t\t\t\teditor.SelectedEntities.Add(e);\n\t\t\t}));\n\t\t\tgui.Add(new Binding<bool>(gui.VoxelEditMode, editor.VoxelEditMode));\n\t\t\tgui.Add(new TwoWayBinding<bool>(editor.NeedsSave, gui.NeedsSave));\n\t\t\tgui.Add(new Binding<Editor.TransformModes>(gui.TransformMode, editor.TransformMode));\n\t\t\tgui.Add(new Binding<bool>(gui.VoxelSelectionActive, editor.VoxelSelectionActive));\n\n\t\t\tProperty<bool> movementEnabled = new Property<bool>();\n\t\t\tentity.Add(new Binding<bool>(movementEnabled, () => input.MiddleMouseButton || capslockKey, input.MiddleMouseButton, capslockKey));\n\n\t\t\teditor.Add(new Binding<bool>(editor.MovementEnabled, () => movementEnabled || editor.VoxelEditMode, movementEnabled, editor.VoxelEditMode));\n\n\t\t\teditor.Add(new Binding<Vector2>(editor.Movement, input.Movement));\n\t\t\teditor.Add(new Binding<bool>(editor.Up, input.GetKey(Keys.Space)));\n\t\t\teditor.Add(new Binding<bool>(editor.Down, input.GetKey(Keys.LeftControl)));\n\t\t\teditor.Add(new Binding<bool>(editor.SpeedMode, shiftKey));\n\t\t\teditor.Add(new Binding<bool>(editor.Extend, input.GetKey(Keys.F)));\n\t\t\teditor.Add(new CommandBinding(input.LeftMouseButtonDown, () => editor.VoxelEditMode, editor.StartFill));\n\t\t\teditor.Add(new CommandBinding(input.LeftMouseButtonUp, editor.StopFill));\n\t\t\teditor.Add(new CommandBinding(input.RightMouseButtonDown, () => editor.VoxelEditMode, editor.StartEmpty));\n\t\t\teditor.Add(new CommandBinding(input.RightMouseButtonUp, editor.StopEmpty));\n\t\t\teditor.Add(new Binding<bool>(editor.EditSelection, () => movementEnabled && editor.VoxelEditMode && editor.TransformMode.Value == Editor.TransformModes.None, movementEnabled, editor.VoxelEditMode, editor.TransformMode));\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Delete\", new PCInput.Chord { Key = Keys.X }, editor.DeleteSelected, gui.EntityCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.TransformMode.Value == Editor.TransformModes.None && editor.SelectedEntities.Length > 0 && !editor.MovementEnabled && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode, editor.SelectedEntities.Length, editor.MovementEnabled, gui.PickNextEntity\n\t\t\t);\n\n\t\t\t// Start playing\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Run\", new PCInput.Chord { Modifier = Keys.LeftControl, Key = Keys.R },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tAction go = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmain.EditorEnabled.Value = false;\n\t\t\t\t\t\t\tIO.MapLoader.Load(main, main.MapFile);\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (editor.NeedsSave)\n\t\t\t\t\t\t\teditor.SaveWithCallback(go);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tgo();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.MapCommands,\n\t\t\t\t() => !editor.MovementEnabled && !string.IsNullOrEmpty(main.MapFile) && !gui.PickNextEntity,\n\t\t\t\teditor.MovementEnabled, main.MapFile, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Join voxels\", new PCInput.Chord { Modifier = Keys.LeftControl, Key = Keys.J },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tEntity entity1 = editor.SelectedEntities[0];\n\t\t\t\t\t\tEntity entity2 = editor.SelectedEntities[1];\n\n\t\t\t\t\t\tVoxel map1 = entity1.Get<Voxel>();\n\t\t\t\t\t\tVoxel map2 = entity2.Get<Voxel>();\n\n\t\t\t\t\t\tforeach (Voxel.Chunk chunk in map1.Chunks)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach (Voxel.Box box in chunk.Boxes)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach (Voxel.Coord coord in box.GetCoords())\n\t\t\t\t\t\t\t\t\tmap2.Fill(map1.GetAbsolutePosition(coord), box.Type, false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmap2.Regenerate();\n\t\t\t\t\t\tentity1.Delete.Execute();\n\t\t\t\t\t\teditor.NeedsSave.Value = true;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.SelectedEntities.Length == 2 && editor.SelectedEntities[0].Get<Voxel>() != null && editor.SelectedEntities[1].Get<Voxel>() != null && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, editor.SelectedEntities.Length, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAction<Factory<Main>> convertVoxel = delegate(Factory<Main> voxelFactory)\n\t\t\t{\n\t\t\t\tEntity currentVoxel = editor.SelectedEntities[0];\n\t\t\t\tVoxel map1 = currentVoxel.Get<Voxel>();\n\n\t\t\t\tEntity voxelFill = voxelFactory.CreateAndBind(main);\n\t\t\t\tTransform oldPosition = currentVoxel.Get<Transform>(\"Transform\");\n\t\t\t\tTransform position = voxelFill.Get<Transform>(\"Transform\");\n\t\t\t\tposition.Position.Value = oldPosition.Position.Value;\n\t\t\t\tposition.Quaternion.Value = oldPosition.Quaternion.Value;\n\t\t\t\tmain.Add(voxelFill);\n\t\t\t\tVoxel.Coord offset = new Voxel.Coord\n\t\t\t\t{\n\t\t\t\t\tX = -(int)map1.Offset.Value.X,\n\t\t\t\t\tY = -(int)map1.Offset.Value.Y,\n\t\t\t\t\tZ = -(int)map1.Offset.Value.Z,\n\t\t\t\t};\n\n\t\t\t\tVoxel map2 = voxelFill.Get<Voxel>();\n\n\t\t\t\tforeach (Voxel.Chunk chunk in map1.Chunks)\n\t\t\t\t{\n\t\t\t\t\tforeach (Voxel.Box box in chunk.Boxes)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (Voxel.Coord coord in box.GetCoords())\n\t\t\t\t\t\t\tmap2.Fill(coord.Plus(offset), box.Type, notify: false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmap2.Regenerate();\n\n\t\t\t\teditor.NeedsSave.Value = true;\n\t\t\t\teditor.SelectedEntities.Clear();\n\t\t\t\teditor.SelectedEntities.Add(voxelFill);\n\n\t\t\t\tcurrentVoxel.Delete.Execute();\n\t\t\t};\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Convert to DynamicVoxel\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tconvertVoxel(Factory<Main>.Get<DynamicVoxelFactory>());\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.SelectedEntities.Length == 1 && editor.SelectedEntities[0].Get<Voxel>() != null && editor.SelectedEntities[0].Type != \"DynamicVoxel\" && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, editor.SelectedEntities.Length, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Convert to Voxel\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tconvertVoxel(Factory<Main>.Get<VoxelFactory>());\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.SelectedEntities.Length == 1 && editor.SelectedEntities[0].Get<Voxel>() != null && editor.SelectedEntities[0].Type != \"Voxel\" && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, editor.SelectedEntities.Length, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Convert to StaticSlider\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tconvertVoxel(Factory<Main>.Get<StaticSliderFactory>());\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.SelectedEntities.Length == 1 && editor.SelectedEntities[0].Get<Voxel>() != null && editor.SelectedEntities[0].Type != \"StaticSlider\" && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, editor.SelectedEntities.Length, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Convert to Slider\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tconvertVoxel(Factory<Main>.Get<SliderFactory>());\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.SelectedEntities.Length == 1 && editor.SelectedEntities[0].Get<Voxel>() != null && editor.SelectedEntities[0].Type != \"Slider\" && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, editor.SelectedEntities.Length, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Convert to Spinner\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tconvertVoxel(Factory<Main>.Get<SpinnerFactory>());\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.SelectedEntities.Length == 1 && editor.SelectedEntities[0].Get<Voxel>() != null && editor.SelectedEntities[0].Type != \"Spinner\" && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, editor.SelectedEntities.Length, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Convert to VoxelFill\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tconvertVoxel(Factory<Main>.Get<VoxelFillFactory>());\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.SelectedEntities.Length == 1 && editor.SelectedEntities[0].Get<Voxel>() != null && editor.SelectedEntities[0].Type != \"VoxelFill\" && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, editor.SelectedEntities.Length, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tentity.Add(new CommandBinding(main.MapLoaded, delegate()\n\t\t\t{\n\t\t\t\teditor.Position.Value = Vector3.Zero;\n\t\t\t\teditor.NeedsSave.Value = false;\n\t\t\t}));\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Quit\", new PCInput.Chord { Modifier = Keys.LeftControl, Key = Keys.Q },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Main.ExitException();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.MapCommands,\n\t\t\t\t() => !editor.MovementEnabled && !gui.PickNextEntity,\n\t\t\t\teditor.MovementEnabled, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Help\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tUIFactory.OpenURL(\"http://steamcommunity.com/sharedfiles/filedetails/?id=273022369\");\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.MapCommands, () => !gui.PickNextEntity, gui.PickNextEntity\n\t\t\t);\n\n\t\t\t// Save\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Save\", new PCInput.Chord { Modifier = Keys.LeftControl, Key = Keys.S }, editor.Save, gui.MapCommands,\n\t\t\t\t() => !editor.MovementEnabled && !string.IsNullOrEmpty(main.MapFile) && !gui.PickNextEntity,\n\t\t\t\teditor.MovementEnabled, main.MapFile, gui.PickNextEntity\n\t\t\t);\n\n\t\t\t// Deselect all entities\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Deselect all\", new PCInput.Chord { Modifier = Keys.LeftControl, Key = Keys.D },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!gui.AnyTextFieldViewsSelected())\n\t\t\t\t\t\t\teditor.SelectedEntities.Clear();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => !editor.MovementEnabled && editor.SelectedEntities.Length > 0 && !gui.PickNextEntity,\n\t\t\t\teditor.MovementEnabled, editor.SelectedEntities.Length, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tentity.Add(new CommandBinding<int>(input.MouseScrolled, () => editor.VoxelEditMode && !input.GetKey(Keys.LeftAlt) && !shiftKey, delegate(int delta)\n\t\t\t{\n\t\t\t\teditor.BrushSize.Value = Math.Max(1, editor.BrushSize.Value + delta);\n\t\t\t}));\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Voxel edit mode\", new PCInput.Chord { Key = Keys.Tab },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\teditor.VoxelEditMode.Value = !editor.VoxelEditMode;\n\t\t\t\t\t\tmodel.Scale.Value = new Vector3(editor.SelectedEntities[0].Get<Voxel>().Scale * 0.5f);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\tdelegate()\n\t\t\t\t{\n\t\t\t\t\tif (editor.TransformMode.Value != Editor.TransformModes.None)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tif (shiftKey || input.GetKey(Keys.LeftControl))\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tif (gui.PickNextEntity)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tif (editor.VoxelEditMode)\n\t\t\t\t\t\treturn true;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn editor.SelectedEntities.Length == 1 && editor.SelectedEntities[0].Get<Voxel>() != null;\n\t\t\t\t},\n\t\t\t\teditor.TransformMode, shiftKey, input.GetKey(Keys.LeftControl), editor.VoxelEditMode, editor.SelectedEntities.Length, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tint brush = 0;\n\t\t\tAction<int> changeBrush = delegate(int delta)\n\t\t\t{\n\t\t\t\tint foundIndex = Voxel.States.List.FindIndex(x => x.ID == editor.Brush);\n\t\t\t\tif (foundIndex != -1)\n\t\t\t\t\tbrush = foundIndex;\n\t\t\t\tint stateCount = Voxel.States.List.Count;\n\t\t\t\tbrush = 1 + ((brush - 1 + delta) % (stateCount - 1));\n\t\t\t\tif (brush < 1)\n\t\t\t\t\tbrush = stateCount + ((brush - 1) % stateCount);\n\t\t\t\teditor.Brush.Value = Voxel.States.List[brush].ID;\n\t\t\t};\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Previous brush\", new PCInput.Chord { Key = Keys.Q },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tchangeBrush(-1);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, shiftKey\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Next brush\", new PCInput.Chord { Key = Keys.E },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tchangeBrush(1);\n\t\t\t\t\t}\n\t\t\t\t}, gui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, shiftKey\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Sample\", new PCInput.Chord { Modifier = Keys.LeftShift, Key = Keys.Q }, editor.SampleMaterial, gui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.TransformMode == Editor.TransformModes.None,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Propagate\", new PCInput.Chord { Modifier = Keys.LeftShift, Key = Keys.E }, editor.PropagateMaterial, gui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.TransformMode == Editor.TransformModes.None,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Propagate box\", new PCInput.Chord { Key = Keys.R }, editor.PropagateMaterialBox, gui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.TransformMode == Editor.TransformModes.None && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode, shiftKey\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Propagate non-contiguous\", new PCInput.Chord { Key = Keys.T }, editor.PropagateMaterialAll, gui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.TransformMode == Editor.TransformModes.None && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode, shiftKey\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Delete\", new PCInput.Chord { Key = Keys.OemComma }, editor.DeleteMaterial, gui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.TransformMode == Editor.TransformModes.None && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode, shiftKey\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Delete non-contiguous\", new PCInput.Chord { Key = Keys.OemPeriod }, editor.DeleteMaterialAll, gui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.TransformMode == Editor.TransformModes.None && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode, shiftKey\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Intersect\", new PCInput.Chord { Key = Keys.I }, editor.IntersectMaterial, gui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.TransformMode == Editor.TransformModes.None && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode, shiftKey\n\t\t\t);\n\n\t\t\teditor.Add(new Binding<Vector2>(editor.Mouse, main.UI.Mouse));\n\n\t\t\tinput.Add(new CommandBinding(main.UI.SwallowMouseEvents, (Action)input.SwallowEvents));\n\n\t\t\tCamera camera = main.Camera;\n\n\t\t\tinput.Add(new CommandBinding<int>(input.MouseScrolled, () => input.GetKey(Keys.LeftAlt) && editor.EnableCameraDistanceScroll, delegate(int delta)\n\t\t\t{\n\t\t\t\teditor.CameraDistance.Value = Math.Max(1, editor.CameraDistance.Value + delta * -2.0f);\n\t\t\t}));\n\n\t\t\tinput.Add(new CommandBinding<int>(input.MouseScrolled, () => shiftKey && editor.EnableCameraDistanceScroll, delegate(int delta)\n\t\t\t{\n\t\t\t\tVoxel.Coord j = editor.Jitter;\n\t\t\t\tj.X = Math.Max(j.X + delta, 0);\n\t\t\t\tj.Y = Math.Max(j.Y + delta, 0);\n\t\t\t\tj.Z = Math.Max(j.Z + delta, 0);\n\t\t\t\teditor.Jitter.Value = j;\n\t\t\t}));\n\n\t\t\tinput.Add(new Binding<bool>(input.EnableLook, () => editor.VoxelEditMode || (movementEnabled && editor.TransformMode.Value == Editor.TransformModes.None), movementEnabled, editor.VoxelEditMode, editor.TransformMode));\n\n\t\t\tinput.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (input.EnableLook)\n\t\t\t\t{\n\t\t\t\t\tVector2 x = input.Mouse;\n\t\t\t\t\tcamera.Angles.Value = new Vector3(-x.Y, x.X, 0.0f);\n\t\t\t\t}\n\t\t\t}, input.Mouse));\n\n\t\t\tinput.Add(new Binding<bool>(main.UI.IsMouseVisible, x => !x, input.EnableLook));\n\t\t\tProperty<Vector3> cameraPosition = new Property<Vector3>();\n\t\t\teditor.Add(new Binding<Vector3>(cameraPosition, () => editor.Position.Value - (camera.Forward.Value * editor.CameraDistance), editor.Position, camera.Forward, editor.CameraDistance));\n\t\t\teditor.Add(new Binding<Vector3>(camera.Position, cameraPosition));\n\n\t\t\tPointLight editorLight = entity.Create<PointLight>();\n\t\t\teditorLight.Add(new Binding<float>(editorLight.Attenuation, camera.FarPlaneDistance));\n\t\t\teditorLight.Color.Value = new Vector3(1.5f, 1.5f, 1.5f);\n\t\t\teditorLight.Add(new Binding<Vector3>(editorLight.Position, cameraPosition));\n\t\t\teditorLight.Enabled.Value = false;\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Toggle editor light\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = () => editorLight.Enabled.Value = !editorLight.Enabled\n\t\t\t\t},\n\t\t\t\tgui.MapCommands,\n\t\t\t\t() => !string.IsNullOrEmpty(main.MapFile) && !gui.PickNextEntity,\n\t\t\t\tmain.MapFile, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Add CameraStop from view\", new PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tEntity cameraStop = Factory<Main>.Get<CameraStopFactory>().CreateAndBind(main);\n\t\t\t\t\t\tTransform position = cameraStop.Get<Transform>(\"Transform\");\n\t\t\t\t\t\tposition.Position.Value = main.Camera.Position.Value;\n\t\t\t\t\t\tposition.Quaternion.Value = Quaternion.CreateFromRotationMatrix(main.Camera.RotationMatrix);\n\t\t\t\t\t\teditor.NeedsSave.Value = true;\n\t\t\t\t\t\tmain.Add(cameraStop);\n\t\t\t\t\t\teditor.SelectedEntities.Clear();\n\t\t\t\t\t\teditor.SelectedEntities.Add(cameraStop);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => !string.IsNullOrEmpty(main.MapFile) && !editor.VoxelEditMode && !input.EnableLook && editor.TransformMode.Value == Editor.TransformModes.None && !gui.PickNextEntity,\n\t\t\t\tmain.MapFile, editor.VoxelEditMode, input.EnableLook, editor.TransformMode, gui.PickNextEntity\n\t\t\t);\n\n\n\t\t\teditor.Add(new CommandBinding(input.RightMouseButtonDown, () => !editor.VoxelEditMode && !input.EnableLook && editor.TransformMode.Value == Editor.TransformModes.None && !main.GeeUI.LastClickCaptured, delegate()\n\t\t\t{\n\t\t\t\t// We're not editing a voxel\n\t\t\t\t// And we're not transforming entities\n\t\t\t\t// So we must be selecting / deselecting entities\n\t\t\t\tbool multiselect = shiftKey;\n\n\t\t\t\tVector2 mouse = input.Mouse;\n\t\t\t\tVector3 rayStart;\n\t\t\t\tVector3 ray;\n#if VR\n\t\t\t\tif (main.VR)\n\t\t\t\t{\n\t\t\t\t\tVector2 size = main.UI.Root.Size;\n\t\t\t\t\tmouse = main.UI.Mouse;\n\t\t\t\t\tmouse.X /= size.X;\n\t\t\t\t\tmouse.Y /= size.Y;\n\t\t\t\t\tmouse *= 2.0f;\n\t\t\t\t\tmouse -= new Vector2(1.0f);\n\t\t\t\t\tmouse.Y *= -1.0f;\n\t\t\t\t\tmouse *= 0.5f;\n\t\t\t\t\trayStart = main.Camera.Position;\n\t\t\t\t\tray = Vector3.Normalize(Vector3.Transform(new Vector3(0, mouse.Y, -mouse.X), main.VRUI.Transform) - camera.Position);\n\t\t\t\t}\n\t\t\t\telse\n#endif\n\t\t\t\t{\n\t\t\t\t\tMicrosoft.Xna.Framework.Graphics.Viewport viewport = main.GraphicsDevice.Viewport;\n\t\t\t\t\trayStart = main.Camera.Position;\n\t\t\t\t\tray = Vector3.Normalize(viewport.Unproject(new Vector3(mouse.X, mouse.Y, 1), camera.Projection, camera.View, Matrix.Identity) - viewport.Unproject(new Vector3(mouse.X, mouse.Y, 0), camera.Projection, camera.View, Matrix.Identity));\n\t\t\t\t}\n\n\t\t\t\tEntity closestEntity;\n\t\t\t\tTransform closestTransform;\n\t\t\t\tthis.raycast(main, rayStart, ray, out closestEntity, out closestTransform);\n\n\t\t\t\tif (gui.PickNextEntity)\n\t\t\t\t\tgui.EntityPicked.Execute(closestEntity);\n\t\t\t\telse if (closestEntity != null)\n\t\t\t\t{\n\t\t\t\t\tif (multiselect)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (editor.SelectedEntities.Contains(closestEntity))\n\t\t\t\t\t\t\teditor.SelectedEntities.Remove(closestEntity);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\teditor.SelectedEntities.Add(closestEntity);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\teditor.SelectedEntities.Clear();\n\t\t\t\t\t\teditor.SelectedEntities.Add(closestEntity);\n\t\t\t\t\t\teditor.SelectedTransform.Value = closestTransform;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\teditor.SelectedEntities.Clear();\n\t\t\t\t\teditor.SelectedTransform.Value = null;\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\teditor.Add(new CommandBinding(input.GetKeyDown(Keys.Escape), delegate()\n\t\t\t{\n\t\t\t\tif (editor.TransformMode.Value != Editor.TransformModes.None)\n\t\t\t\t\teditor.RevertTransform.Execute();\n\t\t\t\telse if (editor.VoxelEditMode)\n\t\t\t\t\teditor.VoxelEditMode.Value = false;\n\t\t\t\telse if (gui.PickNextEntity)\n\t\t\t\t\tgui.EntityPicked.Execute(null);\n\t\t\t}));\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Grab\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.G },\n\t\t\t\teditor.StartTranslation,\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => editor.SelectedEntities.Length > 0 && !input.EnableLook && !editor.VoxelEditMode && editor.TransformMode.Value == Editor.TransformModes.None && !gui.PickNextEntity,\n\t\t\t\teditor.SelectedEntities.Length, input.EnableLook, editor.VoxelEditMode, editor.TransformMode, gui.PickNextEntity\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Grab\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.G },\n\t\t\t\teditor.StartVoxelTranslation,\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.VoxelSelectionActive && editor.TransformMode.Value == Editor.TransformModes.None && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, editor.VoxelSelectionActive, editor.TransformMode, shiftKey\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Select contiguous\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.B },\n\t\t\t\teditor.SelectContiguous,\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.TransformMode.Value == Editor.TransformModes.None && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode, shiftKey\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Select all contiguous\",\n\t\t\t\tnew PCInput.Chord { Modifier = Keys.LeftShift, Key = Keys.B },\n\t\t\t\teditor.SelectAllContiguous,\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.TransformMode.Value == Editor.TransformModes.None,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Duplicate\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.V },\n\t\t\t\teditor.VoxelDuplicate,\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.VoxelSelectionActive && editor.TransformMode.Value == Editor.TransformModes.None && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, editor.VoxelSelectionActive, editor.TransformMode, shiftKey\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Copy\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.C },\n\t\t\t\teditor.VoxelCopy,\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.VoxelSelectionActive && editor.TransformMode == Editor.TransformModes.None && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, editor.VoxelSelectionActive, editor.TransformMode, shiftKey\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Paste\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.P },\n\t\t\t\teditor.VoxelPaste,\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.TransformMode == Editor.TransformModes.None && !shiftKey,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode, shiftKey\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Rotate\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.R },\n\t\t\t\teditor.StartRotation,\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => editor.SelectedEntities.Length > 0 && !editor.VoxelEditMode && !input.EnableLook && editor.TransformMode.Value == Editor.TransformModes.None && !shiftKey && !gui.PickNextEntity,\n\t\t\t\teditor.SelectedEntities.Length, editor.VoxelEditMode, input.EnableLook, editor.TransformMode, shiftKey, gui.PickNextEntity\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Focus view\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.F },\n\t\t\t\teditor.FocusView,\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => editor.SelectedEntities.Length > 0 && !input.EnableLook && !editor.VoxelEditMode && editor.TransformMode.Value == Editor.TransformModes.None && !shiftKey && !gui.PickNextEntity,\n\t\t\t\teditor.SelectedEntities.Length, input.EnableLook, editor.VoxelEditMode, editor.TransformMode, shiftKey, gui.PickNextEntity\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Lock X axis\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.X },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (editor.TransformAxis.Value == Editor.TransformAxes.X)\n\t\t\t\t\t\t\teditor.TransformAxis.Value = Editor.TransformAxes.LocalX;\n\t\t\t\t\t\telse if (editor.TransformAxis.Value == Editor.TransformAxes.LocalX)\n\t\t\t\t\t\t\teditor.TransformAxis.Value = Editor.TransformAxes.All;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\teditor.TransformAxis.Value = Editor.TransformAxes.X;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.TransformMode.Value != Editor.TransformModes.None,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Lock Y axis\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.Y },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (editor.TransformAxis.Value == Editor.TransformAxes.Y)\n\t\t\t\t\t\t\teditor.TransformAxis.Value = Editor.TransformAxes.LocalY;\n\t\t\t\t\t\telse if (editor.TransformAxis.Value == Editor.TransformAxes.LocalY)\n\t\t\t\t\t\t\teditor.TransformAxis.Value = Editor.TransformAxes.All;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\teditor.TransformAxis.Value = Editor.TransformAxes.Y;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.TransformMode.Value != Editor.TransformModes.None,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode\n\t\t\t);\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Lock Z axis\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.Z },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (editor.TransformAxis.Value == Editor.TransformAxes.Z)\n\t\t\t\t\t\t\teditor.TransformAxis.Value = Editor.TransformAxes.LocalZ;\n\t\t\t\t\t\telse if (editor.TransformAxis.Value == Editor.TransformAxes.LocalZ)\n\t\t\t\t\t\t\teditor.TransformAxis.Value = Editor.TransformAxes.All;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\teditor.TransformAxis.Value = Editor.TransformAxes.Z;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.TransformMode.Value != Editor.TransformModes.None,\n\t\t\t\teditor.VoxelEditMode, editor.TransformMode\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Clear rotation\",\n\t\t\t\tnew PCInput.Chord { },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (Entity e in editor.SelectedEntities)\n\t\t\t\t\t\t\te.Get<Transform>().Quaternion.Value = Quaternion.Identity;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.SelectedEntities.Length > 0 && editor.TransformMode.Value == Editor.TransformModes.None && !editor.MovementEnabled && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, editor.SelectedEntities.Length, editor.TransformMode, editor.MovementEnabled, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Clear translation\",\n\t\t\t\tnew PCInput.Chord { },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (Entity e in editor.SelectedEntities)\n\t\t\t\t\t\t\te.Get<Transform>().Position.Value = Vector3.Zero;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => !editor.VoxelEditMode && editor.SelectedEntities.Length > 0 && editor.TransformMode.Value == Editor.TransformModes.None && !editor.MovementEnabled && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, editor.SelectedEntities.Length, editor.TransformMode, editor.MovementEnabled, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tMemoryStream yankBuffer = null;\n\t\t\tFunc<MemoryStream> copy = delegate()\n\t\t\t{\n\t\t\t\tMemoryStream stream = new MemoryStream();\n\t\t\t\tIO.MapLoader.Serializer.Serialize(stream, editor.SelectedEntities.Where(x => Factory<Main>.Get(x.Type).EditorCanSpawn).ToList());\n\t\t\t\treturn stream;\n\t\t\t};\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Copy\",\n\t\t\t\tnew PCInput.Chord { Modifier = Keys.LeftControl, Key = Keys.C },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (yankBuffer != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyankBuffer.Dispose();\n\t\t\t\t\t\t\tyankBuffer = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tyankBuffer = copy();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => !editor.VoxelEditMode && !input.EnableLook && editor.SelectedEntities.Length > 0 && editor.TransformMode.Value == Editor.TransformModes.None && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, input.EnableLook, editor.SelectedEntities.Length, editor.TransformMode, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAction<MemoryStream, bool> paste = delegate(MemoryStream buffer, bool recenter)\n\t\t\t{\n\t\t\t\tbuffer.Seek(0, SeekOrigin.Begin);\n\t\t\t\tList<Entity> entities = (List<Entity>)IO.MapLoader.Serializer.Deserialize(buffer);\n\t\t\t\tDictionary<ulong, ulong> mapping = new Dictionary<ulong, ulong>();\n\n\t\t\t\tVector3 center = Vector3.Zero;\n\t\t\t\tint entitiesWithTransforms = 0;\n\t\t\t\tforeach (Entity e in entities)\n\t\t\t\t{\n\t\t\t\t\tulong originalGUID = e.GUID;\n\t\t\t\t\te.GUID = 0;\n\t\t\t\t\te.ID.Value = \"\";\n\t\t\t\t\tFactory<Main> factory = Factory<Main>.Get(e.Type);\n\t\t\t\t\tfactory.Bind(e, main);\n\t\t\t\t\tTransform t = e.Get<Transform>();\n\t\t\t\t\tif (t != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcenter += t.Position;\n\t\t\t\t\t\tentitiesWithTransforms++;\n\t\t\t\t\t}\n\t\t\t\t\tmain.Add(e);\n\t\t\t\t\tmapping.Add(originalGUID, e.GUID);\n\t\t\t\t}\n\t\t\t\tcenter /= entitiesWithTransforms;\n\n\t\t\t\t// Recenter entities around the editor and fix entity links\n\t\t\t\tforeach (Entity e in entities)\n\t\t\t\t{\n\t\t\t\t\tif (recenter)\n\t\t\t\t\t{\n\t\t\t\t\t\tTransform t = e.Get<Transform>();\n\t\t\t\t\t\tif (t != null)\n\t\t\t\t\t\t\tt.Position.Value += editor.Position - center;\n\t\t\t\t\t}\n\t\t\t\t\tforeach (KeyValuePair<string, PropertyEntry> p in e.Properties)\n\t\t\t\t\t{\n\t\t\t\t\t\tProperty<Entity.Handle> entityProp = p.Value.Property as Property<Entity.Handle>;\n\t\t\t\t\t\tif (entityProp != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tulong guid;\n\t\t\t\t\t\t\tif (mapping.TryGetValue(entityProp.Value.GUID, out guid))\n\t\t\t\t\t\t\t\tentityProp.Value = new Entity.Handle { GUID = guid };\n\t\t\t\t\t\t\telse if (entityProp.Value.Target == null)\n\t\t\t\t\t\t\t\tentityProp.Value = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tListProperty<Entity.Handle> listEntityProp = p.Value.Property as ListProperty<Entity.Handle>;\n\t\t\t\t\t\t\tif (listEntityProp != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (int i = 0; i < listEntityProp.Count; i++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tulong guid;\n\t\t\t\t\t\t\t\t\tEntity.Handle handle = listEntityProp[i];\n\t\t\t\t\t\t\t\t\tif (mapping.TryGetValue(handle.GUID, out guid))\n\t\t\t\t\t\t\t\t\t\tlistEntityProp[i] = new Entity.Handle { GUID = guid };\n\t\t\t\t\t\t\t\t\telse if (handle.Target == null)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlistEntityProp.RemoveAt(i);\n\t\t\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (int i = 0; i < e.LinkedCommands.Count; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tEntity.CommandLink link = e.LinkedCommands[i];\n\t\t\t\t\t\tulong guid;\n\t\t\t\t\t\tif (mapping.TryGetValue(link.TargetEntity.GUID, out guid))\n\t\t\t\t\t\t\tlink.TargetEntity.GUID = guid;\n\t\t\t\t\t\telse if (link.TargetEntity.Target == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\te.LinkedCommands.RemoveAt(i);\n\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\teditor.NeedsSave.Value = true;\n\t\t\t\teditor.SelectedEntities.Clear();\n\t\t\t\teditor.SelectedEntities.AddAll(entities);\n\t\t\t\teditor.StartTranslation.Execute();\n\t\t\t};\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Paste\",\n\t\t\t\tnew PCInput.Chord { Modifier = Keys.LeftControl, Key = Keys.V },\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (yankBuffer != null)\n\t\t\t\t\t\t\tpaste(yankBuffer, true);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => !editor.VoxelEditMode && !input.EnableLook && editor.TransformMode == Editor.TransformModes.None && !string.IsNullOrEmpty(main.MapFile) && !gui.PickNextEntity,\n\t\t\t\teditor.VoxelEditMode, input.EnableLook, editor.TransformMode, main.MapFile, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Duplicate\", new PCInput.Chord { Modifier = Keys.LeftShift, Key = Keys.D }, new Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tusing (MemoryStream buffer = copy())\n\t\t\t\t\t\t\tpaste(buffer, false);\n\t\t\t\t\t}\n\t\t\t\t}, gui.EntityCommands,\n\t\t\t\t() => !editor.MovementEnabled && editor.SelectedEntities.Length > 0 && editor.TransformMode.Value == Editor.TransformModes.None && !gui.PickNextEntity,\n\t\t\t\teditor.MovementEnabled, editor.SelectedEntities.Length, editor.TransformMode, gui.PickNextEntity\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Commit transform\",\n\t\t\t\tnew PCInput.Chord { Mouse = PCInput.MouseButton.LeftMouseButton },\n\t\t\t\teditor.CommitTransform,\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => editor.TransformMode.Value != Editor.TransformModes.None,\n\t\t\t\teditor.TransformMode\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Cancel transform\",\n\t\t\t\tnew PCInput.Chord { Mouse = PCInput.MouseButton.RightMouseButton },\n\t\t\t\teditor.RevertTransform,\n\t\t\t\tgui.EntityCommands,\n\t\t\t\t() => editor.TransformMode.Value != Editor.TransformModes.None,\n\t\t\t\teditor.TransformMode\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Rotate X\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.X },\n\t\t\t\teditor.VoxelRotateX,\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.VoxelSelectionActive && editor.TransformMode.Value == Editor.TransformModes.None,\n\t\t\t\teditor.VoxelEditMode, editor.VoxelSelectionActive, editor.TransformMode\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Rotate Y\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.Y },\n\t\t\t\teditor.VoxelRotateY,\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.VoxelSelectionActive && editor.TransformMode.Value == Editor.TransformModes.None,\n\t\t\t\teditor.VoxelEditMode, editor.VoxelSelectionActive, editor.TransformMode\n\t\t\t);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity,\n\t\t\t\tmain,\n\t\t\t\tcommandQueueContainer,\n\t\t\t\t\"Rotate Z\",\n\t\t\t\tnew PCInput.Chord { Key = Keys.Z },\n\t\t\t\teditor.VoxelRotateZ,\n\t\t\t\tgui.VoxelCommands,\n\t\t\t\t() => editor.VoxelEditMode && editor.VoxelSelectionActive && editor.TransformMode.Value == Editor.TransformModes.None,\n\t\t\t\teditor.VoxelEditMode, editor.VoxelSelectionActive, editor.TransformMode\n\t\t\t);\n\n#if DEVELOPMENT\n\t\t\tAnalyticsViewer.Bind(entity, main, commandQueueContainer);\n\n\t\t\tAddCommand\n\t\t\t(\n\t\t\t\tentity, main, commandQueueContainer, \"Rebuild voxel adjacency\",\n\t\t\t\tnew PCInput.Chord(),\n\t\t\t\tnew Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (Voxel v in Voxel.Voxels)\n\t\t\t\t\t\t\tv.RebuildAdjacency();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgui.MapCommands,\n\t\t\t\t() => !string.IsNullOrEmpty(main.MapFile) && !gui.PickNextEntity,\n\t\t\t\tmain.MapFile, gui.PickNextEntity\n\t\t\t);\n#endif\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\t// Cancel editor components\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/EffectBlockFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Lemma.Components;\nusing Lemma.Util;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.CollisionTests;\n\nnamespace Lemma.Factories\n{\n\tpublic class EffectBlockFactory : Factory<Main>\n\t{\n\t\tpublic struct BlockBuildOrder\n\t\t{\n\t\t\tpublic Voxel Voxel;\n\t\t\tpublic Voxel.Coord Coordinate;\n\t\t\tpublic Voxel.State State;\n\t\t}\n\n\t\tprivate Random random = new Random();\n\n\t\tpublic EffectBlockFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 0.25f, 0.25f);\n\t\t\tthis.EditorCanSpawn = false;\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"EffectBlock\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\t\t\tModelInstance model = entity.GetOrCreate<ModelInstance>(\"Model\");\n\n\t\t\tEffectBlock effectBlock = entity.GetOrCreate<EffectBlock>(\"EffectBlock\");\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, effectBlock.Transform));\n\n\t\t\tentity.Add(new CommandBinding(effectBlock.Delete, entity.Delete));\n\n\t\t\tthis.SetMain(entity, main);\n\t\t\tIBinding offsetBinding = null;\n\t\t\tmodel.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (offsetBinding != null)\n\t\t\t\t\tmodel.Remove(offsetBinding);\n\t\t\t\toffsetBinding = new Binding<Vector3>(model.Param, effectBlock.Offset);\n\t\t\t\tmodel.Add(offsetBinding);\n\t\t\t}, model.FullInstanceKey));\n\t\t\tif (effectBlock.StateId != Voxel.t.Empty)\n\t\t\t\tVoxel.States.All[effectBlock.StateId].ApplyToEffectBlock(model);\n\t\t}\n\n\t\tpublic void Build(Main main, IEnumerable<BlockBuildOrder> blocks, Vector3 center, float delayMultiplier = 0.05f)\n\t\t{\n\t\t\tint index = 0;\n\t\t\tforeach (BlockBuildOrder entry in blocks)\n\t\t\t{\n\t\t\t\tif (EffectBlock.IsAnimating(new EffectBlock.Entry { Voxel = entry.Voxel, Coordinate = entry.Coordinate }))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tEntity entity = this.CreateAndBind(main);\n\t\t\t\tEffectBlock effectBlock = entity.Get<EffectBlock>();\n\t\t\t\tentry.State.ApplyToEffectBlock(entity.Get<ModelInstance>());\n\t\t\t\teffectBlock.Offset.Value = entry.Voxel.GetRelativePosition(entry.Coordinate);\n\n\t\t\t\tVector3 absolutePos = entry.Voxel.GetAbsolutePosition(entry.Coordinate);\n\n\t\t\t\tfloat distance = (absolutePos - center).Length();\n\t\t\t\teffectBlock.StartPosition = absolutePos + new Vector3(0.05f, 0.1f, 0.05f) * distance;\n\t\t\t\teffectBlock.StartOrientation = Quaternion.CreateFromYawPitchRoll(0.15f * (distance + index), 0.15f * (distance + index), 0);\n\t\t\t\teffectBlock.TotalLifetime = Math.Max(delayMultiplier, distance * delayMultiplier);\n\t\t\t\teffectBlock.CheckAdjacent = true;\n\t\t\t\teffectBlock.Setup(entry.Voxel.Entity, entry.Coordinate, entry.State.ID);\n\t\t\t\tmain.Add(entity);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/EmptyFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class EmptyFactory : Factory<Main>\n\t{\n\t\tpublic EmptyFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Empty\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main, true, false).EditorProperties();\n\t\t\ttransform.EditorProperties();\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/EntityConnectable.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Factories\n{\n\tpublic class EntityConnectable\n\t{\n\t\tprivate static Color connectionLineColor = new Color(1.0f, 1.0f, 0.0f, 0.5f);\n\n\t\tpublic static void AttachEditorComponents(Entity entity, string name, Property<Entity.Handle> target)\n\t\t{\n\t\t\tentity.Add(name, target);\n\t\t\tif (entity.EditorSelected != null)\n\t\t\t{\n\t\t\t\tTransform transform = entity.Get<Transform>(\"Transform\");\n\n\t\t\t\tLineDrawer connectionLines = new LineDrawer { Serialize = false };\n\t\t\t\tconnectionLines.Add(new Binding<bool>(connectionLines.Enabled, entity.EditorSelected));\n\n\t\t\t\tconnectionLines.Add(new NotifyBinding(delegate()\n\t\t\t\t{\n\t\t\t\t\tconnectionLines.Lines.Clear();\n\t\t\t\t\tEntity targetEntity = target.Value.Target;\n\t\t\t\t\tif (targetEntity != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tTransform targetTransform = targetEntity.Get<Transform>(\"Transform\");\n\t\t\t\t\t\tif (targetTransform != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconnectionLines.Lines.Add\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tnew LineDrawer.Line\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tA = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(transform.Position, connectionLineColor),\n\t\t\t\t\t\t\t\t\tB = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(targetTransform.Position, connectionLineColor)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, transform.Position, target, entity.EditorSelected));\n\n\t\t\t\tentity.Add(connectionLines);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void AttachEditorComponents(Entity entity, string name, ListProperty<Entity.Handle> target)\n\t\t{\n\t\t\tentity.Add(name, target);\n\t\t\tif (entity.EditorSelected != null)\n\t\t\t{\n\t\t\t\tTransform transform = entity.Get<Transform>(\"Transform\");\n\n\t\t\t\tLineDrawer connectionLines = new LineDrawer { Serialize = false };\n\t\t\t\tconnectionLines.Add(new Binding<bool>(connectionLines.Enabled, entity.EditorSelected));\n\n\t\t\t\tListBinding<LineDrawer.Line, Entity.Handle> connectionBinding = new ListBinding<LineDrawer.Line, Entity.Handle>(connectionLines.Lines, target, delegate(Entity.Handle other)\n\t\t\t\t{\n\t\t\t\t\treturn new LineDrawer.Line\n\t\t\t\t\t{\n\t\t\t\t\t\tA = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(transform.Position, connectionLineColor),\n\t\t\t\t\t\tB = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(other.Target.Get<Transform>(\"Transform\").Position, connectionLineColor)\n\t\t\t\t\t};\n\t\t\t\t}, x => x.Target != null && x.Target.Active);\n\t\t\t\tentity.Add(new NotifyBinding(delegate() { connectionBinding.OnChanged(null); }, entity.EditorSelected));\n\t\t\t\tentity.Add(new NotifyBinding(delegate() { connectionBinding.OnChanged(null); }, transform.Position));\n\t\t\t\tconnectionLines.Add(connectionBinding);\n\t\t\t\tentity.Add(connectionLines);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/EvilBlocksFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework.Audio;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\n\nnamespace Lemma.Factories\n{\n\tpublic class EvilBlocksFactory : Factory<Main>\n\t{\n\t\tprivate Random random = new Random();\n\n\t\tpublic EvilBlocksFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"EvilBlocks\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tBlockCloud blockCloud = entity.GetOrCreate<BlockCloud>(\"BlockCloud\");\n\t\t\tblockCloud.Add(new CommandBinding(blockCloud.Delete, entity.Delete));\n\t\t\tblockCloud.Add(new CommandBinding<Collidable, ContactCollection>(blockCloud.Collided, delegate(Collidable other, ContactCollection contacts)\n\t\t\t{\n\t\t\t\tif (other.Tag != null && other.Tag.GetType() == typeof(Character))\n\t\t\t\t{\n\t\t\t\t\t// Damage the player\n\t\t\t\t\tEntity p = PlayerFactory.Instance;\n\t\t\t\t\tif (p != null && p.Active)\n\t\t\t\t\t\tp.Get<Agent>().Damage.Execute(0.1f);\n\t\t\t\t}\n\t\t\t}));\n\t\t\tblockCloud.Type.Value = Voxel.t.Black;\n\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tSound.AttachTracker(entity);\n\n\t\t\tAI ai = entity.GetOrCreate<AI>(\"AI\");\n\n\t\t\tif (!main.EditorEnabled)\n\t\t\t{\n\t\t\t\tentity.Add(new PostInitialization(delegate()\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_EVIL_CUBES, entity);\n\t\t\t\t\tAkSoundEngine.PostEvent(ai.CurrentState == \"Chase\" ? AK.EVENTS.EVIL_CUBES_CHASE : AK.EVENTS.EVIL_CUBES_IDLE, entity);\n\t\t\t\t}));\n\n\t\t\t\tSoundKiller.Add(entity, AK.EVENTS.STOP_EVIL_CUBES);\n\t\t\t}\n\n\t\t\tAgent agent = entity.GetOrCreate<Agent>();\n\t\t\tagent.Add(new Binding<Vector3>(agent.Position, transform.Position));\n\n\t\t\tRaycastAI raycastAI = entity.GetOrCreate<RaycastAI>(\"RaycastAI\");\n\t\t\traycastAI.BlendTime.Value = 1.0f;\n\t\t\traycastAI.Add(new TwoWayBinding<Vector3>(transform.Position, raycastAI.Position));\n\t\t\traycastAI.Add(new Binding<Quaternion>(transform.Quaternion, raycastAI.Orientation));\n\n\t\t\tRaycastAIMovement movement = entity.GetOrCreate<RaycastAIMovement>(\"Movement\");\n\n\t\t\tblockCloud.Add(new Binding<Vector3>(blockCloud.Position, transform.Position));\n\n\t\t\tAI.Task checkOperationalRadius = new AI.Task\n\t\t\t{\n\t\t\t\tInterval = 2.0f,\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tbool shouldBeActive = (transform.Position.Value - main.Camera.Position).Length() < movement.OperationalRadius;\n\t\t\t\t\tif (shouldBeActive && ai.CurrentState == \"Suspended\")\n\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\telse if (!shouldBeActive && ai.CurrentState != \"Suspended\")\n\t\t\t\t\t\tai.CurrentState.Value = \"Suspended\";\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tAI.Task updatePosition = new AI.Task\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\traycastAI.Update();\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Suspended\",\n\t\t\t\tTasks = new[] { checkOperationalRadius, },\n\t\t\t});\n\n\t\t\tconst float sightDistance = 25.0f;\n\t\t\tconst float hearingDistance = 0.0f;\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Idle\",\n\t\t\t\tTasks = new[]\n\t\t\t\t{ \n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tupdatePosition,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 1.0f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\traycastAI.Move(new Vector3(((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 1.0f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAgent a = Agent.Query(transform.Position, sightDistance, hearingDistance, x => x.Entity.Type == \"Player\");\n\t\t\t\t\t\t\tif (a != null)\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Alert\",\n\t\t\t\tTasks = new[]\n\t\t\t\t{ \n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tupdatePosition,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 1.0f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (ai.TimeInCurrentState > 3.0f)\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tAgent a = Agent.Query(transform.Position, sightDistance, hearingDistance, x => x.Entity.Type == \"Player\");\n\t\t\t\t\t\t\t\tif (a != null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tai.TargetAgent.Value = a.Entity;\n\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Chase\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tAI.Task checkTargetAgent = new AI.Task\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tEntity target = ai.TargetAgent.Value.Target;\n\t\t\t\t\tif (target == null || !target.Active || (target.Get<Transform>().Position.Value - transform.Position.Value).Length() > sightDistance * 1.25f)\n\t\t\t\t\t{\n\t\t\t\t\t\tai.TargetAgent.Value = null;\n\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tAction findNextPosition = delegate()\n\t\t\t{\n\t\t\t\tmovement.LastPosition.Value = transform.Position.Value;\n\t\t\t\tfloat radius = 5.0f;\n\t\t\t\tVector3 center = ai.TargetAgent.Value.Target.Get<Transform>().Position;\n\t\t\t\tVector3 candidate;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tcandidate = center + new Vector3((float)this.random.NextDouble() - 0.5f, (float)this.random.NextDouble(), (float)this.random.NextDouble() - 0.5f) * radius;\n\t\t\t\t\tradius += 1.0f;\n\t\t\t\t}\n\t\t\t\twhile (!RaycastAI.DefaultPositionFilter(candidate));\n\n\t\t\t\tVector3 toCandidate = candidate - movement.LastPosition;\n\t\t\t\tfloat distance = toCandidate.Length();\n\t\t\t\tconst float maxMovementDistance = 9.0f;\n\t\t\t\tif (distance > maxMovementDistance)\n\t\t\t\t\ttoCandidate *= maxMovementDistance / distance;\n\n\t\t\t\tmovement.NextPosition.Value = movement.LastPosition.Value + toCandidate;\n\t\t\t\tmovement.PositionBlend.Value = 0.0f;\n\t\t\t};\n\n\t\t\t// Chase AI state\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Chase\",\n\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.EVIL_CUBES_CHASE, entity);\n\t\t\t\t\tfindNextPosition();\n\t\t\t\t},\n\t\t\t\tExit = delegate(AI.AIState next)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.EVIL_CUBES_IDLE, entity);\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{\n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tcheckTargetAgent,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (ai.TimeInCurrentState.Value > 15.0f)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tEntity voxel = raycastAI.Voxel.Value.Target;\n\t\t\t\t\t\t\t\tif (voxel != null && voxel.Active)\n\t\t\t\t\t\t\t\t\traycastAI.Coord.Value = raycastAI.LastCoord.Value = voxel.Get<Voxel>().GetCoordinate(transform.Position);\n\t\t\t\t\t\t\t\traycastAI.Move(new Vector3(((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f));\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmovement.PositionBlend.Value += (main.ElapsedTime.Value / 1.0f);\n\t\t\t\t\t\t\t\tif (movement.PositionBlend > 1.0f)\n\t\t\t\t\t\t\t\t\tfindNextPosition();\n\t\t\t\t\t\t\t\ttransform.Position.Value = Vector3.Lerp(movement.LastPosition, movement.NextPosition, movement.PositionBlend);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tthis.SetMain(entity, main);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/ExploderFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework.Audio;\n\nnamespace Lemma.Factories\n{\n\tpublic class ExploderFactory : Factory<Main>\n\t{\n\t\tprivate Random random = new Random();\n\n\t\tpublic ExploderFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Exploder\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tPointLight light = entity.GetOrCreate<PointLight>(\"PointLight\");\n\t\t\tlight.Serialize = false;\n\n\t\t\tconst float defaultLightAttenuation = 15.0f;\n\t\t\tlight.Attenuation.Value = defaultLightAttenuation;\n\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tlight.Add(new Binding<Vector3>(light.Position, transform.Position));\n\n\t\t\tif (!main.EditorEnabled)\n\t\t\t{\n\t\t\t\tSound.AttachTracker(entity);\n\t\t\t\tSoundKiller.Add(entity, AK.EVENTS.STOP_GLOWSQUARE);\n\t\t\t\tentity.Add(new PostInitialization(delegate()\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_GLOWSQUARE, entity);\n\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_GLOWSQUARE_PITCH, -1.0f, entity);\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\tAI ai = entity.GetOrCreate<AI>(\"AI\");\n\n\t\t\tModelAlpha model = entity.GetOrCreate<ModelAlpha>();\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, transform.Matrix));\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\box\";\n\t\t\tmodel.Serialize = false;\n\t\t\tmodel.DrawOrder.Value = 15;\n\n\t\t\tconst float defaultModelScale = 1.0f;\n\t\t\tmodel.Scale.Value = new Vector3(defaultModelScale);\n\n\t\t\tmodel.Add(new Binding<Vector3, string>(model.Color, delegate(string state)\n\t\t\t{\n\t\t\t\tswitch (state)\n\t\t\t\t{\n\t\t\t\t\tcase \"Alert\":\n\t\t\t\t\t\treturn new Vector3(1.5f, 1.5f, 0.5f);\n\t\t\t\t\tcase \"Chase\":\n\t\t\t\t\t\treturn new Vector3(1.5f, 0.5f, 0.5f);\n\t\t\t\t\tcase \"Explode\":\n\t\t\t\t\t\treturn new Vector3(2.0f, 1.0f, 0.5f);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn new Vector3(1.0f, 1.0f, 1.0f);\n\t\t\t\t}\n\t\t\t}, ai.CurrentState));\n\n\t\t\tentity.Add(new Updater\n\t\t\t(\n\t\t\t\tdelegate(float dt)\n\t\t\t\t{\n\t\t\t\t\tfloat source = 1.0f + ((float)this.random.NextDouble() - 0.5f) * 2.0f * 0.05f;\n\t\t\t\t\tmodel.Scale.Value = new Vector3(defaultModelScale * source);\n\t\t\t\t\tlight.Attenuation.Value = defaultLightAttenuation * source;\n\t\t\t\t}\n\t\t\t));\n\n\t\t\tmodel.Add(new Binding<bool, string>(model.Enabled, x => x != \"Exploding\", ai.CurrentState));\n\n\t\t\tlight.Add(new Binding<Vector3>(light.Color, model.Color));\n\n\t\t\tAgent agent = entity.GetOrCreate<Agent>();\n\t\t\tagent.Add(new Binding<Vector3>(agent.Position, transform.Position));\n\n\t\t\tRaycastAIMovement movement = entity.GetOrCreate<RaycastAIMovement>(\"Movement\");\n\t\t\tExploder exploder = entity.GetOrCreate<Exploder>(\"Exploder\");\n\n\t\t\tAI.Task checkOperationalRadius = new AI.Task\n\t\t\t{\n\t\t\t\tInterval = 2.0f,\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tbool shouldBeActive = (transform.Position.Value - main.Camera.Position).Length() < movement.OperationalRadius;\n\t\t\t\t\tif (shouldBeActive && ai.CurrentState == \"Suspended\")\n\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\telse if (!shouldBeActive && ai.CurrentState != \"Suspended\")\n\t\t\t\t\t\tai.CurrentState.Value = \"Suspended\";\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tRaycastAI raycastAI = entity.GetOrCreate<RaycastAI>(\"RaycastAI\");\n\t\t\traycastAI.Add(new TwoWayBinding<Vector3>(transform.Position, raycastAI.Position));\n\t\t\traycastAI.Add(new Binding<Quaternion>(transform.Quaternion, raycastAI.Orientation));\n\n\t\t\tAI.Task updatePosition = new AI.Task\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\traycastAI.Update();\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Suspended\",\n\t\t\t\tTasks = new[] { checkOperationalRadius, },\n\t\t\t});\n\n\t\t\tconst float sightDistance = 40.0f;\n\t\t\tconst float hearingDistance = 0.0f;\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Idle\",\n\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_GLOWSQUARE_PITCH, -1.0f, entity);\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{ \n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tupdatePosition,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 1.0f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\traycastAI.Move(new Vector3(((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 0.5f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAgent a = Agent.Query(transform.Position, sightDistance, hearingDistance, x => x.Entity.Type == \"Player\");\n\t\t\t\t\t\t\tif (a != null)\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Alert\",\n\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_GLOWSQUARE, entity);\n\t\t\t\t},\n\t\t\t\tExit = delegate(AI.AIState next)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_GLOWSQUARE, entity);\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{ \n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tupdatePosition,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 1.0f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (ai.TimeInCurrentState > 3.0f)\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tAgent a = Agent.Query(transform.Position, sightDistance, hearingDistance, x => x.Entity.Type == \"Player\");\n\t\t\t\t\t\t\t\tif (a != null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tai.TargetAgent.Value = a.Entity;\n\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Chase\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tAI.Task checkTargetAgent = new AI.Task\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tEntity target = ai.TargetAgent.Value.Target;\n\t\t\t\t\tif (target == null || !target.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tai.TargetAgent.Value = null;\n\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Chase\",\n\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_GLOWSQUARE_PITCH, 0.0f, entity);\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{\n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tcheckTargetAgent,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 0.35f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\traycastAI.Move(ai.TargetAgent.Value.Target.Get<Transform>().Position.Value - transform.Position);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((ai.TargetAgent.Value.Target.Get<Transform>().Position.Value - transform.Position).Length() < 10.0f)\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Explode\";\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tupdatePosition,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tEffectBlockFactory factory = Factory.Get<EffectBlockFactory>();\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Explode\",\n\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t{\n\t\t\t\t\texploder.CoordQueue.Clear();\n\t\t\t\t\t\n\t\t\t\t\tEntity voxelEntity = raycastAI.Voxel.Value.Target;\n\t\t\t\t\tif (voxelEntity == null || !voxelEntity.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tVoxel m = voxelEntity.Get<Voxel>();\n\n\t\t\t\t\tVoxel.Coord c = raycastAI.Coord.Value;\n\n\t\t\t\t\tDirection toSupport = Direction.None;\n\n\t\t\t\t\tforeach (Direction dir in DirectionExtensions.Directions)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (m[raycastAI.Coord.Value.Move(dir)].ID != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttoSupport = dir;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (toSupport == Direction.None)\n\t\t\t\t\t{\n\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tDirection up = toSupport.GetReverse();\n\n\t\t\t\t\texploder.ExplosionOriginalCoord.Value = raycastAI.Coord;\n\n\t\t\t\t\tDirection right;\n\t\t\t\t\tif (up.IsParallel(Direction.PositiveX))\n\t\t\t\t\t\tright = Direction.PositiveZ;\n\t\t\t\t\telse\n\t\t\t\t\t\tright = Direction.PositiveX;\n\t\t\t\t\tDirection forward = up.Cross(right);\n\n\t\t\t\t\tfor (Voxel.Coord y = c.Clone(); y.GetComponent(up) < c.GetComponent(up) + 3; y = y.Move(up))\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (Voxel.Coord x = y.Clone(); x.GetComponent(right) < c.GetComponent(right) + 2; x = x.Move(right))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (Voxel.Coord z = x.Clone(); z.GetComponent(forward) < c.GetComponent(forward) + 2; z = z.Move(forward))\n\t\t\t\t\t\t\t\texploder.CoordQueue.Add(z);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tExit = delegate(AI.AIState next)\n\t\t\t\t{\n\t\t\t\t\texploder.CoordQueue.Clear();\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{ \n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 0.15f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (exploder.CoordQueue.Length > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\traycastAI.MoveTo(exploder.CoordQueue[0]);\n\n\t\t\t\t\t\t\t\texploder.CoordQueue.RemoveAt(0);\n\n\t\t\t\t\t\t\t\tEntity blockEntity = factory.CreateAndBind(main);\n\t\t\t\t\t\t\t\tVoxel.States.Infected.ApplyToEffectBlock(blockEntity.Get<ModelInstance>());\n\n\t\t\t\t\t\t\t\tEntity mapEntity = raycastAI.Voxel.Value.Target;\n\t\t\t\t\t\t\t\tif (mapEntity != null && mapEntity.Active)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tEffectBlock effectBlock = blockEntity.Get<EffectBlock>();\n\t\t\t\t\t\t\t\t\tVoxel m = mapEntity.Get<Voxel>();\n\n\t\t\t\t\t\t\t\t\teffectBlock.Offset.Value = m.GetRelativePosition(raycastAI.Coord);\n\n\t\t\t\t\t\t\t\t\tVector3 absolutePos = m.GetAbsolutePosition(raycastAI.Coord);\n\n\t\t\t\t\t\t\t\t\teffectBlock.StartPosition = absolutePos + new Vector3(0.05f, 0.1f, 0.05f);\n\t\t\t\t\t\t\t\t\teffectBlock.StartOrientation = Quaternion.CreateFromYawPitchRoll(0.15f, 0.15f, 0);\n\t\t\t\t\t\t\t\t\teffectBlock.TotalLifetime = 0.05f;\n\t\t\t\t\t\t\t\t\teffectBlock.Setup(raycastAI.Voxel.Value.Target, raycastAI.Coord, Voxel.t.Infected);\n\t\t\t\t\t\t\t\t\tmain.Add(blockEntity);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_GLOWSQUARE_PITCH, MathHelper.Lerp(0.0f, 1.0f, ai.TimeInCurrentState.Value / 2.0f), entity);\n\t\t\t\t\t\t\tif (exploder.CoordQueue.Length == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Explode\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Exploding\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tupdatePosition,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Exploding\",\n\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t{\n\t\t\t\t\texploder.Exploded.Value = false;\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_GLOWSQUARE, entity);\n\t\t\t\t},\n\t\t\t\tExit = delegate(AI.AIState next)\n\t\t\t\t{\n\t\t\t\t\texploder.Exploded.Value = false;\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_GLOWSQUARE, entity);\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 0.1f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconst int radius = 9;\n\n\t\t\t\t\t\t\tfloat timeInCurrentState = ai.TimeInCurrentState;\n\t\t\t\t\t\t\tif (timeInCurrentState > 1.0f && !exploder.Exploded)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tEntity mapEntity = raycastAI.Voxel.Value.Target;\n\t\t\t\t\t\t\t\tif (mapEntity != null && mapEntity.Active)\n\t\t\t\t\t\t\t\t\tExplosion.Explode(main, mapEntity.Get<Voxel>(), raycastAI.Coord, radius, 18.0f);\n\n\t\t\t\t\t\t\t\texploder.Exploded.Value = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (timeInCurrentState > 2.0f)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\traycastAI.Move(new Vector3(((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f));\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tupdatePosition,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"OperationalRadius\", movement.OperationalRadius);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/ExplosionFactory.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Factories\n{\n\tpublic class ExplosionFactory : Factory<Main>\n\t{\n\t\tpublic ExplosionFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Explosion\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main, true, false).EditorProperties();\n\n\t\t\tExplosion explosion = entity.GetOrCreate<Explosion>(\"Explosion\");\n\t\t\tentity.Add(new CommandBinding(explosion.Delete, entity.Delete));\n\n\t\t\texplosion.Add(new Binding<Vector3>(explosion.Position, transform.Position));\n\n\t\t\tentity.Add(\"Explode\", explosion.Go);\n\t\t\tentity.Add(\"DeleteAfter\", explosion.DeleteAfter);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/FallingTowerFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.CollisionTests;\n\nnamespace Lemma.Factories\n{\n\tpublic class FallingTowerFactory : Factory<Main>\n\t{\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"FallingTower\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tEnemyBase enemy = entity.GetOrCreate<EnemyBase>(\"Base\");\n\t\t\tPlayerCylinderTrigger trigger = entity.GetOrCreate<PlayerCylinderTrigger>(\"Trigger\");\n\n\t\t\tPointLight light = entity.GetOrCreate<PointLight>();\n\t\t\tlight.Color.Value = new Vector3(1.3f, 0.5f, 0.5f);\n\t\t\tlight.Attenuation.Value = 15.0f;\n\t\t\tlight.Serialize = false;\n\n\t\t\tFallingTower fallingTower = entity.GetOrCreate<FallingTower>(\"FallingTower\");\n\t\t\tfallingTower.Add(new CommandBinding(fallingTower.Delete, entity.Delete));\n\t\t\tfallingTower.Add(new Binding<Entity.Handle>(fallingTower.TargetVoxel, enemy.Voxel));\n\t\t\tfallingTower.Add(new Binding<bool>(fallingTower.IsTriggered, trigger.IsTriggered));\n\t\t\tfallingTower.Base = enemy;\n\n\t\t\tenemy.Add(new CommandBinding(enemy.Delete, entity.Delete));\n\t\t\tenemy.Add(new Binding<Matrix>(enemy.Transform, transform.Matrix));\n\t\t\tlight.Add(new Binding<Vector3>(light.Position, enemy.Position));\n\n\t\t\ttrigger.Add(new Binding<Matrix>(trigger.Transform, () => Matrix.CreateTranslation(0.0f, 0.0f, enemy.Offset) * transform.Matrix, transform.Matrix, enemy.Offset));\n\n\t\t\tentity.Add(new CommandBinding(trigger.PlayerEntered, fallingTower.Fall));\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"Fall\", fallingTower.Fall);\n\t\t\ttrigger.EditorProperties();\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tEnemyBase.AttachEditorComponents(entity, main, this.Color);\n\n\t\t\tPlayerCylinderTrigger.AttachEditorComponents(entity, main, this.Color);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/FileFilter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\n\nnamespace Lemma.Factories\n{\n\tpublic class FileFilter\n\t{\n\t\tprivate struct Entry\n\t\t{\n\t\t\tpublic string Root;\n\t\t\tpublic string[] Directories;\n\t\t\tpublic string Extension;\n\t\t}\n\n\t\tprivate static Dictionary<Entry, ListProperty<string>> cache = new Dictionary<Entry, ListProperty<string>>();\n\n\t\tprivate static bool setupBinding = false;\n\n\t\tpublic static ListProperty<string> Get(Main main, string root, string[] directories, string extension = null, Func<IEnumerable<string>> extras = null)\n\t\t{\n\t\t\tif (main.EditorEnabled)\n\t\t\t{\n\t\t\t\tif (!setupBinding)\n\t\t\t\t{\n\t\t\t\t\tnew CommandBinding(main.MapLoaded, (Action)cache.Clear);\n\t\t\t\t\tsetupBinding = true;\n\t\t\t\t}\n\n\t\t\t\tEntry entry = new Entry { Root = root, Directories = directories, Extension = extension };\n\t\t\t\tListProperty<string> result;\n\t\t\t\tif (!cache.TryGetValue(entry, out result))\n\t\t\t\t{\n\t\t\t\t\tresult = cache[entry] = new ListProperty<string>();\n\t\t\t\t\tresult.Add(null);\n\t\t\t\t\tint contentRootDirectoryIndex = root.Length + (root[root.Length - 1] == Path.DirectorySeparatorChar ? 0 : 1);\n\t\t\t\t\tif (directories == null)\n\t\t\t\t\t\tdirectories = new[] { \"\" };\n\t\t\t\t\tforeach (string dir in directories)\n\t\t\t\t\t{\n\t\t\t\t\t\tstring fullDir = Path.Combine(root ?? \"\", dir);\n\t\t\t\t\t\tif (Directory.Exists(fullDir))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach (string f in Directory.GetFiles(fullDir))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tint extensionIndex = f.LastIndexOf('.');\n\t\t\t\t\t\t\t\tstring ext = f.Substring(extensionIndex);\n\t\t\t\t\t\t\t\tif (extension == null || ext == extension)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Remove content root directory and extension\n\t\t\t\t\t\t\t\t\tstring stripped = f.Substring(contentRootDirectoryIndex, extensionIndex - contentRootDirectoryIndex);\n\t\t\t\t\t\t\t\t\tif (ext != \".xnb\" || !stripped.EndsWith(\"_0\")) // Exclude subordinate xnb files\n\t\t\t\t\t\t\t\t\t\tresult.Add(stripped);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (extras != null)\n\t\t\t\t\t\tresult.AddAll(extras());\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/ImplodeBlockFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Lemma.Components;\nusing Lemma.Util;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.CollisionTests;\n\nnamespace Lemma.Factories\n{\n\tpublic class ImplodeBlockFactory : Factory<Main>\n\t{\n\t\tprivate Random random = new Random();\n\n\t\tpublic ImplodeBlockFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 0.25f, 0.25f);\n\t\t\tthis.EditorCanSpawn = false;\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"ImplodeBlock\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\t\t\tModelInstance model = entity.GetOrCreate<ModelInstance>(\"Model\");\n\t\t\tImplodeBlock implodeBlock = entity.GetOrCreate<ImplodeBlock>(\"ImplodeBlock\");\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, implodeBlock.Transform));\n\n\t\t\timplodeBlock.Add(new CommandBinding(implodeBlock.Delete, entity.Delete));\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tIBinding offsetBinding = null;\n\t\t\tmodel.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (offsetBinding != null)\n\t\t\t\t\tmodel.Remove(offsetBinding);\n\t\t\t\toffsetBinding = new Binding<Vector3>(model.Param, implodeBlock.Offset);\n\t\t\t\tmodel.Add(offsetBinding);\n\t\t\t}, model.FullInstanceKey));\n\t\t\tif (implodeBlock.StateId != Voxel.t.Empty)\n\t\t\t\tVoxel.States.All[implodeBlock.StateId].ApplyToEffectBlock(model);\n\t\t}\n\n\t\tpublic void Implode(Main main, Voxel v, Voxel.Coord coord, Voxel.State state, Vector3 target)\n\t\t{\n\t\t\tEntity block = this.CreateAndBind(main);\n\t\t\tImplodeBlock implodeBlock = block.Get<ImplodeBlock>();\n\t\t\tstate.ApplyToEffectBlock(block.Get<ModelInstance>());\n\t\t\timplodeBlock.Offset.Value = v.GetRelativePosition(coord);\n\n\t\t\timplodeBlock.StateId = state.ID;\n\t\t\timplodeBlock.StartPosition = v.GetAbsolutePosition(coord);\n\t\t\timplodeBlock.Type = Rift.Style.In;\n\t\t\timplodeBlock.StartOrientation = Quaternion.CreateFromRotationMatrix(v.Transform);\n\t\t\timplodeBlock.EndOrientation = Quaternion.CreateFromYawPitchRoll((float)this.random.NextDouble() * (float)Math.PI * 2.0f, (float)this.random.NextDouble() * (float)Math.PI * 2.0f, 0.0f);\n\t\t\timplodeBlock.EndPosition = target;\n\t\t\tmain.Add(block);\n\t\t}\n\n\t\tpublic void BlowAway(Main main, Voxel v, Voxel.Coord coord, Voxel.State state)\n\t\t{\n\t\t\tEntity block = this.CreateAndBind(main);\n\t\t\tImplodeBlock implodeBlock = block.Get<ImplodeBlock>();\n\t\t\tstate.ApplyToEffectBlock(block.Get<ModelInstance>());\n\t\t\timplodeBlock.Offset.Value = v.GetRelativePosition(coord);\n\n\t\t\tVector3 start = v.GetAbsolutePosition(coord);\n\t\t\timplodeBlock.StateId = state.ID;\n\t\t\timplodeBlock.StartPosition = start;\n\t\t\timplodeBlock.Type = Rift.Style.Up;\n\t\t\timplodeBlock.StartOrientation = Quaternion.CreateFromRotationMatrix(v.Transform);\n\t\t\timplodeBlock.EndOrientation = Quaternion.CreateFromYawPitchRoll((float)this.random.NextDouble() * (float)Math.PI * 2.0f, (float)this.random.NextDouble() * (float)Math.PI * 2.0f, 0.0f);\n\t\t\timplodeBlock.EndPosition = start + new Vector3(10, 20, 10);\n\t\t\tmain.Add(block);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/JointFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Paths.PathFollowing;\nusing Lemma.Util;\nusing BEPUphysics;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.SolverGroups;\nusing BEPUphysics.Constraints.TwoEntity;\n\nnamespace Lemma.Factories\n{\n\tpublic class JointFactory\n\t{\n\t\tpublic static void Bind(Entity entity, Main main, Func<BEPUphysics.Entities.Entity, BEPUphysics.Entities.Entity, Vector3, Vector3, Vector3, ISpaceObject> createJoint, bool allowRotation, bool creating = false, bool directional = true)\n\t\t{\n\t\t\tTransform mapTransform = entity.GetOrCreate<Transform>(\"MapTransform\");\n\t\t\tmapTransform.Selectable.Value = false;\n\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tFactory.Get<DynamicVoxelFactory>().InternalBind(entity, main, creating, mapTransform);\n\n\t\t\tDynamicVoxel map = entity.Get<DynamicVoxel>();\n\n\t\t\tComponents.Joint jointData = entity.GetOrCreate<Components.Joint>(\"Joint\");\n\n\t\t\tAction refreshMapTransform = delegate()\n\t\t\t{\n\t\t\t\tEntity parent = jointData.Parent.Value.Target;\n\t\t\t\tif (parent != null && parent.Active)\n\t\t\t\t{\n\t\t\t\t\tVoxel staticMap = parent.Get<Voxel>();\n\t\t\t\t\tjointData.Coord.Value = staticMap.GetCoordinate(transform.Matrix.Value.Translation);\n\t\t\t\t\tmapTransform.Position.Value = staticMap.GetAbsolutePosition(staticMap.GetRelativePosition(jointData.Coord) - new Vector3(0.5f) + staticMap.Offset + map.Offset.Value);\n\t\t\t\t\tif (allowRotation)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (main.EditorEnabled)\n\t\t\t\t\t\t\tmapTransform.Quaternion.Value = transform.Quaternion;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tMatrix parentOrientation = staticMap.Transform;\n\t\t\t\t\t\tparentOrientation.Translation = Vector3.Zero;\n\t\t\t\t\t\tmapTransform.Quaternion.Value = Quaternion.CreateFromRotationMatrix(parentOrientation);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tmapTransform.Matrix.Value = transform.Matrix;\n\t\t\t};\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t\tentity.Add(new NotifyBinding(refreshMapTransform, transform.Matrix, transform.Quaternion, map.Offset, jointData.Parent));\n\n\t\t\tISpaceObject joint = null;\n\t\t\tCommandBinding jointDeleteBinding = null, parentPhysicsUpdateBinding = null;\n\t\t\tNotifyBinding parentStaticMoveBinding = null;\n\n\t\t\tAction updateJoint = null;\n\n\t\t\tAction rebuildJoint = null;\n\t\t\trebuildJoint = delegate()\n\t\t\t{\n\t\t\t\tif (jointDeleteBinding != null)\n\t\t\t\t\tentity.Remove(jointDeleteBinding);\n\t\t\t\tjointDeleteBinding = null;\n\n\t\t\t\tif (parentPhysicsUpdateBinding != null)\n\t\t\t\t\tentity.Remove(parentPhysicsUpdateBinding);\n\t\t\t\tparentPhysicsUpdateBinding = null;\n\n\t\t\t\tupdateJoint();\n\t\t\t};\n\n\t\t\tupdateJoint = delegate()\n\t\t\t{\n\t\t\t\tif (joint != null)\n\t\t\t\t{\n\t\t\t\t\tif (joint.Space != null)\n\t\t\t\t\t\tmain.Space.Remove(joint);\n\t\t\t\t\tjoint = null;\n\t\t\t\t}\n\t\t\t\tif (parentStaticMoveBinding != null)\n\t\t\t\t{\n\t\t\t\t\tentity.Remove(parentStaticMoveBinding);\n\t\t\t\t\tparentStaticMoveBinding = null;\n\t\t\t\t}\n\n\t\t\t\tEntity parent = jointData.Parent.Value.Target;\n\n\t\t\t\tif (main.EditorEnabled)\n\t\t\t\t\trefreshMapTransform();\n\t\t\t\telse if (parent != null && parent.Active)\n\t\t\t\t{\n\t\t\t\t\tVoxel parentStaticMap = parent.Get<Voxel>();\n\n\t\t\t\t\t//map.PhysicsEntity.Position = mapTransform.Position;\n\t\t\t\t\tif (!allowRotation)\n\t\t\t\t\t\tmap.PhysicsEntity.Orientation = mapTransform.Quaternion;\n\n\t\t\t\t\tif (jointData.Direction != Direction.None)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 relativeLineAnchor = parentStaticMap.GetRelativePosition(jointData.Coord) - new Vector3(0.5f) + parentStaticMap.Offset + map.Offset;\n\t\t\t\t\t\tVector3 lineAnchor = parentStaticMap.GetAbsolutePosition(relativeLineAnchor);\n\t\t\t\t\t\tDynamicVoxel parentDynamicMap = parent.Get<DynamicVoxel>();\n\t\t\t\t\t\tjoint = createJoint(map.PhysicsEntity, parentDynamicMap == null ? null : parentDynamicMap.PhysicsEntity, lineAnchor, parentStaticMap.GetAbsoluteVector(jointData.Direction.Value.GetVector()), parentStaticMap.GetAbsolutePosition(jointData.Coord));\n\t\t\t\t\t\tmain.Space.Add(joint);\n\t\t\t\t\t\tmap.PhysicsEntity.ActivityInformation.Activate();\n\n\t\t\t\t\t\tif (parentDynamicMap != null && parentPhysicsUpdateBinding == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparentPhysicsUpdateBinding = new CommandBinding(parentDynamicMap.PhysicsUpdated, updateJoint);\n\t\t\t\t\t\t\tentity.Add(parentPhysicsUpdateBinding);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (parentDynamicMap == null && joint is PrismaticJoint)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparentStaticMoveBinding = new NotifyBinding(delegate()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tPrismaticJoint prismaticJoint = (PrismaticJoint)joint;\n\t\t\t\t\t\t\t\tVector3 a = parentStaticMap.GetAbsolutePosition(relativeLineAnchor);\n\t\t\t\t\t\t\t\tprismaticJoint.PointOnLineJoint.LineAnchor = a;\n\t\t\t\t\t\t\t\tprismaticJoint.Limit.OffsetA = a;\n\t\t\t\t\t\t\t\tprismaticJoint.Motor.OffsetA = a;\n\t\t\t\t\t\t\t}, parentStaticMap.Transform);\n\t\t\t\t\t\t\tentity.Add(parentStaticMoveBinding);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (jointDeleteBinding == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tjointDeleteBinding = new CommandBinding(parent.Delete, delegate()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tjointData.Parent.Value = null;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tentity.Add(jointDeleteBinding);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tentity.Add(new CommandBinding(map.PhysicsUpdated, updateJoint));\n\t\t\tentity.Add(new NotifyBinding(rebuildJoint, jointData.Parent));\n\t\t\tentity.Add(new CommandBinding(entity.Delete, delegate()\n\t\t\t{\n\t\t\t\tif (joint != null && joint.Space != null)\n\t\t\t\t{\n\t\t\t\t\tmain.Space.Remove(joint);\n\t\t\t\t\tjoint = null;\n\t\t\t\t}\n\t\t\t}));\n\t\t\t\n\t\t\tentity.Add(new CommandBinding(map.OnSuspended, delegate()\n\t\t\t{\n\t\t\t\tif (joint != null && joint.Space != null)\n\t\t\t\t\tmain.Space.Remove(joint);\n\t\t\t}));\n\t\t\tentity.Add(new CommandBinding(map.OnResumed, delegate()\n\t\t\t{\n\t\t\t\tif (joint != null && joint.Space == null)\n\t\t\t\t\tmain.Space.Add(joint);\n\t\t\t}));\n\t\t\t\n\t\t\tentity.Add(new PostInitialization(rebuildJoint));\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t\tJointFactory.attachEditorComponents(entity, main, directional);\n\t\t}\n\n\t\tprivate static void attachEditorComponents(Entity entity, Main main, bool directional)\n\t\t{\n\t\t\tTransform transform = entity.Get<Transform>();\n\n\t\t\tComponents.Joint joint = entity.Get<Components.Joint>();\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"Parent\", joint.Parent);\n\n\t\t\tif (directional)\n\t\t\t{\n\t\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\t\tmodel.Filename.Value = \"AlphaModels\\\\cone\";\n\t\t\t\tmodel.Serialize = false;\n\t\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\t\t\t\tentity.Add(\"DirectionModel\", model);\n\n\t\t\t\tTransform mapTransform = entity.Get<Transform>(\"MapTransform\");\n\t\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, delegate()\n\t\t\t\t{\n\t\t\t\t\tMatrix m = Matrix.Identity;\n\t\t\t\t\tm.Translation = transform.Position;\n\n\t\t\t\t\tif (joint.Direction == Direction.None)\n\t\t\t\t\t\tm.Forward = m.Right = m.Up = Vector3.Zero;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 normal = Vector3.TransformNormal(joint.Direction.Value.GetVector(), mapTransform.Matrix);\n\n\t\t\t\t\t\tm.Forward = -normal;\n\t\t\t\t\t\tif (normal.Equals(Vector3.Up))\n\t\t\t\t\t\t\tm.Right = Vector3.Left;\n\t\t\t\t\t\telse if (normal.Equals(Vector3.Down))\n\t\t\t\t\t\t\tm.Right = Vector3.Right;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tm.Right = Vector3.Normalize(Vector3.Cross(normal, Vector3.Down));\n\t\t\t\t\t\tm.Up = -Vector3.Cross(normal, m.Left);\n\t\t\t\t\t}\n\t\t\t\t\treturn m;\n\t\t\t\t}, transform.Matrix, mapTransform.Matrix, joint.Direction));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/LevitatorFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework.Audio;\n\nnamespace Lemma.Factories\n{\n\tpublic class LevitatorFactory : Factory<Main>\n\t{\n\t\tprivate Random random = new Random();\n\n\t\tpublic LevitatorFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Levitator\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tPointLight light = entity.GetOrCreate<PointLight>(\"PointLight\");\n\t\t\tlight.Serialize = false;\n\n\t\t\tconst float defaultLightAttenuation = 15.0f;\n\t\t\tlight.Attenuation.Value = defaultLightAttenuation;\n\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tlight.Add(new Binding<Vector3>(light.Position, transform.Position));\n\n\t\t\tif (!main.EditorEnabled)\n\t\t\t{\n\t\t\t\tSound.AttachTracker(entity);\n\t\t\t\tSoundKiller.Add(entity, AK.EVENTS.STOP_GLOWSQUARE);\n\t\t\t\tentity.Add(new PostInitialization(delegate()\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_GLOWSQUARE, entity);\n\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_GLOWSQUARE_PITCH, -1.0f, entity);\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\tAI ai = entity.GetOrCreate<AI>(\"AI\");\n\n\t\t\tModelAlpha model = entity.GetOrCreate<ModelAlpha>();\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, transform.Matrix));\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\box\";\n\t\t\tmodel.Serialize = false;\n\t\t\tmodel.DrawOrder.Value = 15;\n\n\t\t\tRaycastAIMovement movement = entity.GetOrCreate<RaycastAIMovement>(\"Movement\");\n\t\t\tLevitator levitator = entity.GetOrCreate<Levitator>(\"Levitator\");\n\n\t\t\tconst float defaultModelScale = 1.0f;\n\t\t\tmodel.Scale.Value = new Vector3(defaultModelScale);\n\n\t\t\tmodel.Add(new Binding<Vector3, string>(model.Color, delegate(string state)\n\t\t\t{\n\t\t\t\tswitch (state)\n\t\t\t\t{\n\t\t\t\t\tcase \"Alert\":\n\t\t\t\t\t\treturn new Vector3(1.5f, 1.5f, 0.5f);\n\t\t\t\t\tcase \"Chase\":\n\t\t\t\t\t\treturn new Vector3(1.5f, 0.5f, 0.5f);\n\t\t\t\t\tcase \"Levitating\":\n\t\t\t\t\t\treturn new Vector3(2.0f, 1.0f, 0.5f);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn new Vector3(1.0f, 1.0f, 1.0f);\n\t\t\t\t}\n\t\t\t}, ai.CurrentState));\n\n\t\t\tentity.Add(new Updater\n\t\t\t(\n\t\t\t\tdelegate(float dt)\n\t\t\t\t{\n\t\t\t\t\tfloat source = 1.0f + ((float)this.random.NextDouble() - 0.5f) * 2.0f * 0.05f;\n\t\t\t\t\tmodel.Scale.Value = new Vector3(defaultModelScale * source);\n\t\t\t\t\tlight.Attenuation.Value = defaultLightAttenuation * source;\n\t\t\t\t}\n\t\t\t));\n\n\t\t\tlight.Add(new Binding<Vector3>(light.Color, model.Color));\n\n\t\t\tAgent agent = entity.GetOrCreate<Agent>();\n\t\t\tagent.Add(new Binding<Vector3>(agent.Position, transform.Position));\n\n\t\t\tRaycastAI raycastAI = entity.GetOrCreate<RaycastAI>(\"RaycastAI\");\n\t\t\traycastAI.Add(new TwoWayBinding<Vector3>(transform.Position, raycastAI.Position));\n\t\t\traycastAI.Add(new Binding<Quaternion>(transform.Quaternion, raycastAI.Orientation));\n\n\t\t\tAI.Task checkOperationalRadius = new AI.Task\n\t\t\t{\n\t\t\t\tInterval = 2.0f,\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tbool shouldBeActive = (transform.Position.Value - main.Camera.Position).Length() < movement.OperationalRadius;\n\t\t\t\t\tif (shouldBeActive && ai.CurrentState == \"Suspended\")\n\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\telse if (!shouldBeActive && ai.CurrentState != \"Suspended\")\n\t\t\t\t\t\tai.CurrentState.Value = \"Suspended\";\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tAI.Task updatePosition = new AI.Task\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\traycastAI.Update();\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Suspended\",\n\t\t\t\tTasks = new[] { checkOperationalRadius, },\n\t\t\t});\n\n\t\t\tconst float sightDistance = 30.0f;\n\t\t\tconst float hearingDistance = 0.0f;\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Idle\",\n\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_GLOWSQUARE_PITCH, -1.0f, entity);\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{ \n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tupdatePosition,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 1.0f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\traycastAI.Move(new Vector3(((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 1.0f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAgent a = Agent.Query(transform.Position, sightDistance, hearingDistance, x => x.Entity.Type == \"Player\");\n\t\t\t\t\t\t\tif (a != null)\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Alert\",\n\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_GLOWSQUARE, entity);\n\t\t\t\t},\n\t\t\t\tExit = delegate(AI.AIState next)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_GLOWSQUARE, entity);\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{ \n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tupdatePosition,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 1.0f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (ai.TimeInCurrentState > 3.0f)\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tAgent a = Agent.Query(transform.Position, sightDistance, hearingDistance, x => x.Entity.Type == \"Player\");\n\t\t\t\t\t\t\t\tif (a != null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tai.TargetAgent.Value = a.Entity;\n\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Chase\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tAI.Task checkTargetAgent = new AI.Task\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tEntity target = ai.TargetAgent.Value.Target;\n\t\t\t\t\tif (target == null || !target.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tai.TargetAgent.Value = null;\n\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\n\t\t\t// Levitate\n\n\t\t\tconst int levitateRipRadius = 4;\n\n\t\t\tFunc<bool> tryLevitate = delegate()\n\t\t\t{\n\t\t\t\tEntity voxelEntity = raycastAI.Voxel.Value.Target;\n\t\t\t\tif (voxelEntity == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tVoxel map = voxelEntity.Get<Voxel>();\n\t\t\t\tVoxel.Coord? candidate = map.FindClosestFilledCell(raycastAI.Coord, 3);\n\n\t\t\t\tif (!candidate.HasValue)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (VoxelRip.Go(map, candidate.Value, levitateRipRadius, delegate(List<DynamicVoxel> spawnedMaps)\n\t\t\t\t{\n\t\t\t\t\tforeach (DynamicVoxel spawnedMap in spawnedMaps)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (spawnedMap[candidate.Value] != Voxel.States.Empty)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tspawnedMap.Dangerous.Value = true;\n\t\t\t\t\t\t\tlevitator.LevitatingVoxel.Value = spawnedMap.Entity;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t\t\t{\n\t\t\t\t\tlevitator.GrabCoord.Value = candidate.Value;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tAction delevitateMap = delegate()\n\t\t\t{\n\t\t\t\tEntity levitatingMapEntity = levitator.LevitatingVoxel.Value.Target;\n\t\t\t\tif (levitatingMapEntity == null || !levitatingMapEntity.Active)\n\t\t\t\t\treturn;\n\n\t\t\t\tDynamicVoxel dynamicMap = levitatingMapEntity.Get<DynamicVoxel>();\n\t\t\t\tVoxelRip.Consolidate(main, dynamicMap);\n\t\t\t};\n\n\t\t\t// Chase AI state\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Chase\",\n\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_GLOWSQUARE_PITCH, 0.0f, entity);\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{\n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tcheckTargetAgent,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 0.35f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\traycastAI.Move(ai.TargetAgent.Value.Target.Get<Transform>().Position.Value - transform.Position);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tupdatePosition,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 0.1f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tEntity target = ai.TargetAgent.Value.Target;\n\t\t\t\t\t\t\tVector3 targetPosition = target.Get<Transform>().Position;\n\t\t\t\t\t\t\tif ((targetPosition - transform.Position).Length() < 15.0f)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (tryLevitate())\n\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Levitating\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tAction findNextPosition = delegate()\n\t\t\t{\n\t\t\t\tmovement.LastPosition.Value = transform.Position.Value;\n\t\t\t\tfloat radius = 5.0f;\n\t\t\t\tVector3 center = ai.TargetAgent.Value.Target.Get<Transform>().Position;\n\t\t\t\tVector3 candidate;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tcandidate = center + new Vector3((float)this.random.NextDouble() - 0.5f, (float)this.random.NextDouble(), (float)this.random.NextDouble() - 0.5f) * radius;\n\t\t\t\t\tradius += 1.0f;\n\t\t\t\t}\n\t\t\t\twhile (!RaycastAI.DefaultPositionFilter(candidate));\n\n\t\t\t\tmovement.NextPosition.Value = candidate;\n\t\t\t\tmovement.PositionBlend.Value = 0.0f;\n\t\t\t};\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Levitating\",\n\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t{\n\t\t\t\t\tfindNextPosition();\n\t\t\t\t},\n\t\t\t\tExit = delegate(AI.AIState next)\n\t\t\t\t{\n\t\t\t\t\tdelevitateMap();\n\t\t\t\t\tlevitator.LevitatingVoxel.Value = null;\n\n\t\t\t\t\t//volume.Value = defaultVolume;\n\t\t\t\t\t//pitch.Value = 0.0f;\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{ \n\t\t\t\t\tcheckTargetAgent,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//volume.Value = 1.0f;\n\t\t\t\t\t\t\t//pitch.Value = 1.0f;\n\t\t\t\t\t\t\tEntity levitatingMapEntity = levitator.LevitatingVoxel.Value.Target;\n\t\t\t\t\t\t\tif (levitatingMapEntity == null || !levitatingMapEntity.Active || ai.TimeInCurrentState.Value > 8.0f)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tEntity voxel = raycastAI.Voxel.Value.Target;\n\t\t\t\t\t\t\t\tif (voxel != null && voxel.Active)\n\t\t\t\t\t\t\t\t\traycastAI.Coord.Value = raycastAI.LastCoord.Value = voxel.Get<Voxel>().GetCoordinate(transform.Position);\n\t\t\t\t\t\t\t\traycastAI.Move(new Vector3(((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f, ((float)this.random.NextDouble() * 2.0f) - 1.0f));\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tDynamicVoxel dynamicMap = levitatingMapEntity.Get<DynamicVoxel>();\n\n\t\t\t\t\t\t\tmovement.PositionBlend.Value += (main.ElapsedTime.Value / 1.0f);\n\t\t\t\t\t\t\tif (movement.PositionBlend > 1.0f)\n\t\t\t\t\t\t\t\tfindNextPosition();\n\n\t\t\t\t\t\t\ttransform.Position.Value = Vector3.Lerp(movement.LastPosition, movement.NextPosition, movement.PositionBlend);\n\n\t\t\t\t\t\t\tVector3 grabPoint = dynamicMap.GetAbsolutePosition(levitator.GrabCoord);\n\t\t\t\t\t\t\tVector3 diff = transform.Position.Value - grabPoint;\n\t\t\t\t\t\t\tif (diff.Length() > 15.0f)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Chase\";\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tdiff *= (float)Math.Sqrt(dynamicMap.PhysicsEntity.Mass) * 0.5f;\n\t\t\t\t\t\t\tdynamicMap.PhysicsEntity.ApplyImpulse(ref grabPoint, ref diff);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tthis.SetMain(entity, main);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/LogicGateFactory.cs",
    "content": "﻿using System;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class LogicGateFactory : Factory<Main>\n\t{\n\t\tpublic LogicGateFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.0f, 1f, 0.0f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"LogicGate\");\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tScriptlike.AttachEditorComponents(entity, main, this.Color);\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"Input1Target\", entity.Get<LogicGate>().Input1Target);\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"Input2Target\", entity.Get<LogicGate>().Input2Target);\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tLogicGate gate = entity.GetOrCreate<LogicGate>(\"LogicGate\");\n\n\t\t\tbase.Bind(entity, main, creating);\n\n\t\t\tentity.Add(\"Input1\", gate.Input1, new PropertyEntry.EditorData { Readonly = true });\n\t\t\tentity.Add(\"Input1On\", gate.Input1On);\n\t\t\tentity.Add(\"Input1Off\", gate.Input1Off);\n\n\t\t\tentity.Add(\"Input2\", gate.Input2, new PropertyEntry.EditorData { Readonly = true });\n\t\t\tentity.Add(\"Input2On\", gate.Input2On);\n\t\t\tentity.Add(\"Input2Off\", gate.Input2Off);\n\n\t\t\tentity.Add(\"Output\", gate.Output, new PropertyEntry.EditorData { Readonly = true });\n\t\t\tentity.Add(\"OutputOn\", gate.OutputOn);\n\t\t\tentity.Add(\"OutputOff\", gate.OutputOff);\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t{\n\t\t\t\tAction<ListProperty<string>, Entity.Handle> populateOptions = delegate(ListProperty<string> options, Entity.Handle target)\n\t\t\t\t{\n\t\t\t\t\toptions.Clear();\n\t\t\t\t\tEntity e = target.Target;\n\t\t\t\t\tif (e != null && e.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (KeyValuePair<string, PropertyEntry> p in e.Properties)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (p.Value.Property.GetType().GetGenericArguments().First() == typeof(bool))\n\t\t\t\t\t\t\t\toptions.Add(p.Key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tListProperty<string> input1Options = new ListProperty<string>();\n\t\t\t\tentity.Add(\"Input1TargetProperty\", gate.Input1TargetProperty, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tOptions = input1Options,\n\t\t\t\t});\n\n\t\t\t\tentity.Add(new NotifyBinding(delegate()\n\t\t\t\t{\n\t\t\t\t\tpopulateOptions(input1Options, gate.Input1Target);\n\t\t\t\t}, gate.Input1Target));\n\n\t\t\t\tListProperty<string> input2Options = new ListProperty<string>();\n\t\t\t\tentity.Add(\"Input2TargetProperty\", gate.Input2TargetProperty, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tOptions = input2Options,\n\t\t\t\t});\n\n\t\t\t\tentity.Add(new NotifyBinding(delegate()\n\t\t\t\t{\n\t\t\t\t\tpopulateOptions(input2Options, gate.Input2Target);\n\t\t\t\t}, gate.Input2Target));\n\n\n\t\t\t\tentity.Add(new PostInitialization(delegate()\n\t\t\t\t{\n\t\t\t\t\tpopulateOptions(input1Options, gate.Input1Target);\n\t\t\t\t\tpopulateOptions(input2Options, gate.Input2Target);\n\t\t\t\t}));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tentity.Add(\"Input1TargetProperty\", gate.Input1TargetProperty);\n\t\t\t\tentity.Add(\"Input2TargetProperty\", gate.Input2TargetProperty);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/LowerLimitFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class LowerLimitFactory : Factory<Main>\n\t{\n\t\tprivate List<Property<Vector3>> positions = new List<Property<Vector3>>();\n\n\t\tpublic LowerLimitFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"LowerLimit\");\n\t\t}\n\n\t\tconst float absoluteLimit = -20.0f;\n\t\tconst float velocityThreshold = -40.0f;\n\n\t\tpublic float GetLowerLimit()\n\t\t{\n\t\t\tfloat limit = float.MinValue;\n\t\t\tforeach (Property<Vector3> pos in this.positions)\n\t\t\t\tlimit = Math.Max(limit, pos.Value.Y);\n\t\t\treturn limit;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tthis.positions.Add(transform.Position);\n\t\t\ttransform.Add(new CommandBinding(transform.Delete, delegate()\n\t\t\t{\n\t\t\t\tthis.positions.Remove(transform.Position);\n\t\t\t}));\n\n\t\t\tentity.CannotSuspendByDistance = true;\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\n\t\t\tthis.SetMain(entity, main);\n\t\t\t\n\t\t\ttransform.EditorProperties();\n\t\t\tattachable.EditorProperties();\n\n\t\t\tentity.Add(new Updater\n\t\t\t(\n\t\t\t\tdelegate(float dt)\n\t\t\t\t{\n\t\t\t\t\tEntity player = PlayerFactory.Instance;\n\t\t\t\t\tif (player != null && player.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tPlayer p = player.Get<Player>();\n\t\t\t\t\t\tfloat y = p.Character.Transform.Value.Translation.Y;\n\t\t\t\t\t\tfloat limit = transform.Position.Value.Y;\n\t\t\t\t\t\tif (y < limit + absoluteLimit || (y < limit && p.Character.LinearVelocity.Value.Y < velocityThreshold))\n\t\t\t\t\t\t\tp.Die.Execute();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tplayer = null;\n\t\t\t\t}\n\t\t\t));\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/MapExitFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing System.Xml.Serialization;\nusing Lemma.IO;\n\nnamespace Lemma.Factories\n{\n\tpublic class MapExitFactory : Factory<Main>\n\t{\n\t\tpublic MapExitFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"MapExit\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tPlayerTrigger trigger = entity.GetOrCreate<PlayerTrigger>(\"PlayerTrigger\");\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main).EditorProperties();\n\n\t\t\tMapExit mapExit = entity.GetOrCreate<MapExit>(\"MapExit\");\n\n\t\t\tAmbientSound sound = entity.GetOrCreate<AmbientSound>();\n\t\t\tsound.Add(new Binding<Vector3>(sound.Position, transform.Position));\n\t\t\tsound.PlayCue.Value = AK.EVENTS.PLAY_DOOR_AMBIENCE;\n\t\t\tsound.StopCue.Value = AK.EVENTS.STOP_DOOR_AMBIENCE;\n\t\t\tsound.Add(new Binding<bool>(sound.Enabled, trigger.Enabled));\n\n\t\t\ttrigger.Add(new TwoWayBinding<Vector3>(transform.Position, trigger.Position));\n\t\t\ttrigger.Add(new CommandBinding(trigger.PlayerEntered, (Action)mapExit.Go));\n\n\t\t\ttrigger.EditorProperties();\n\n\t\t\tentity.Add(\"Enable\", trigger.Enable);\n\t\t\tentity.Add(\"Disable\", trigger.Disable);\n\t\t\tentity.Add(\"OnEnter\", trigger.PlayerEntered);\n\n\t\t\tentity.Add(\"Enabled\", trigger.Enabled);\n\t\t\tentity.Add(\"NextMap\", mapExit.NextMap, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.MapDirectory, null, MapLoader.MapExtension, delegate()\n\t\t\t\t{\n\t\t\t\t\treturn new[] { Main.MenuMap };\n\t\t\t\t}),\n\t\t\t});\n\t\t\tentity.Add(\"StartSpawnPoint\", mapExit.StartSpawnPoint);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tPlayerTrigger.AttachEditorComponents(entity, main, this.Color);\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>(\"EditorModel\").Color);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/MessageDisplayerFactory.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class MessageDisplayerFactory : Factory<Main>\n\t{\n\t\tpublic MessageDisplayerFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.57f, 0.87f, 0.75f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"MessageDisplayer\");\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tScriptlike.AttachEditorComponents(entity, main, this.Color);\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tMessageDisplayer message = entity.GetOrCreate<MessageDisplayer>(\"MessageDisplayer\");\n\n\t\t\tbase.Bind(entity, main, creating);\n\n\t\t\tentity.Add(\"Message\", message.Message, \"The message to display\");\n\t\t\tentity.Add(\"Display Time\", message.DisplayLength, \"The time to display the message. If 0, the message will stay until Hide is called.\");\n\t\t\tentity.Add(\"Display\", message.Display);\n\t\t\tentity.Add(\"One Time Only\", message.OneTimeOnly, \"If true, the message will only display once (resets on map reload)\");\n\t\t\tentity.Add(\"Hide\", message.Hide);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/NoteFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing Lemma.IO;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class NoteFactory : Factory<Main>\n\t{\n\t\tpublic NoteFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Note\");\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\t\t\tattachable.Vector.Value = Direction.NegativeY;\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tPlayerTrigger trigger = entity.GetOrCreate<PlayerTrigger>();\n\t\t\tModel model = entity.GetOrCreate<Model>(\"Model\");\n\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\n\t\t\tthis.SetMain(entity, main);\n\t\t\tmodel.Serialize = false;\n\t\t\tmodel.Filename.Value = \"Models\\\\papers\";\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, transform.Matrix));\n\n\t\t\tNote note = entity.GetOrCreate<Note>(\"Note\");\n\n\t\t\ttrigger.Serialize = false;\n\t\t\ttrigger.Add(new Binding<Vector3>(trigger.Position, transform.Position));\n\t\t\ttrigger.Radius.Value = 3.5f;\n\n\t\t\ttrigger.Add(new CommandBinding(trigger.PlayerEntered, delegate()\n\t\t\t{\n\t\t\t\tPlayerFactory.Instance.Get<Player>().Note.Value = entity;\n\t\t\t}));\n\n\t\t\ttrigger.Add(new CommandBinding(trigger.PlayerExited, delegate()\n\t\t\t{\n\t\t\t\tif (PlayerFactory.Instance != null)\n\t\t\t\t\tPlayerFactory.Instance.Get<Player>().Note.Value = null;\n\t\t\t}));\n\n\t\t\tentity.Add(\"Collected\", note.Collected);\n\t\t\tentity.Add(\"Text\", note.Text);\n\t\t\tentity.Add(\"Image\", note.Image, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.Content.RootDirectory, new[] { \"Images\", Path.Combine(MapLoader.MapDirectory, \"Images\") }),\n\t\t\t});\n\t\t\tattachable.EditorProperties();\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tModel editorModel = entity.Get<Model>(\"EditorModel\");\n\t\t\teditorModel.Add(new Binding<bool>(editorModel.Enabled, () => Editor.EditorModelsVisible && !entity.EditorSelected, entity.EditorSelected, Editor.EditorModelsVisible));\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, editorModel.Color);\n\t\t\tPlayerTrigger.AttachEditorComponents(entity, main, editorModel.Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/ParticleEmitterFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Factories\n{\n\tpublic class ParticleEmitterFactory : Factory<Main>\n\t{\n\t\tpublic ParticleEmitterFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 1.0f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"ParticleEmitter\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tParticleEmitter emitter = entity.GetOrCreate<ParticleEmitter>(\"ParticleEmitter\");\n\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tattachable.EditorProperties();\n\n\t\t\temitter.Add(new Binding<Vector3>(emitter.Position, transform.Position));\n\t\t\temitter.EditorProperties();\n\n\t\t\tentity.Add(\"Enabled\", emitter.Enabled);\n\t\t\tentity.Add(\"Enable\", emitter.Enable);\n\t\t\tentity.Add(\"Disable\", emitter.Disable);\n\t\t\tentity.Add(\"Burst\", new Command\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tentity.Add(new Animation\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Execute(emitter.Enable),\n\t\t\t\t\t\tnew Animation.Delay(0.3f),\n\t\t\t\t\t\tnew Animation.Execute(emitter.Disable)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tModel editorModel = entity.Get<Model>(\"EditorModel\");\n\t\t\tParticleEmitter emitter = entity.Get<ParticleEmitter>();\n\t\t\teditorModel.Add(new Binding<bool>(editorModel.Enabled, () => Editor.EditorModelsVisible && (!entity.EditorSelected || emitter.ParticleType.Value == null), entity.EditorSelected, emitter.ParticleType, Editor.EditorModelsVisible));\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, editorModel.Color);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/PlayerDataFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing System.Xml.Serialization;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class PlayerDataFactory : Factory<Main>\n\t{\n\t\tprivate static Entity instance;\n\n\t\tpublic PlayerDataFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 0.4f, 0.4f);\n\t\t\tthis.EditorCanSpawn = false;\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"PlayerData\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tbase.Bind(entity, main, creating);\n\n\t\t\tentity.Serialize = false; // PlayerData serialization is handled by new SaveInfo system\n\n\t\t\tPlayerData playerData = entity.GetOrCreate<PlayerData>(\"Data\");\n\t\t\tentity.GetOrCreate<Data>(\"OpaqueData\");\n\t\t\tPhone phone = entity.GetOrCreate<Phone>(\"Phone\");\n\t\t\tplayerData.Add(new SetBinding<int>(playerData.CollapseLevel, delegate(int value)\n\t\t\t{\n\t\t\t\tphone.Set(\"collapse level\", value.ToString());\n\t\t\t}));\n\t\t\tplayerData.Add(new SetBinding<int>(playerData.VictimsHandled, delegate(int value)\n\t\t\t{\n\t\t\t\tphone.Set(\"victims handled\", value.ToString());\n\t\t\t}));\n\n\t\t\tif (PlayerDataFactory.instance != null)\n\t\t\t\tPlayerDataFactory.instance.Delete.Execute();\n\n\t\t\tPlayerDataFactory.instance = entity;\n\t\t\tentity.Add(new CommandBinding(entity.Delete, delegate()\n\t\t\t{\n\t\t\t\tPlayerDataFactory.instance = null;\n\t\t\t}));\n\n\t\t\tentity.CannotSuspend = true;\n\t\t}\n\n\t\tpublic static Entity Instance\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (PlayerDataFactory.instance != null && !PlayerDataFactory.instance.Active)\n\t\t\t\t\tPlayerDataFactory.instance = null;\n\t\t\t\treturn PlayerDataFactory.instance;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tentity.Delete.Execute();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/PlayerSpawnFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class PlayerSpawnFactory : Factory<Main>\n\t{\n\t\tpublic PlayerSpawnFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.8f, 0.4f, 1.5f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"PlayerSpawn\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tentity.CannotSuspendByDistance = true;\n\n\t\t\tPlayerTrigger trigger = entity.GetOrCreate<PlayerTrigger>(\"Trigger\");\n\t\t\tPlayerSpawn spawn = entity.GetOrCreate<PlayerSpawn>(\"PlayerSpawn\");\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tattachable.EditorProperties();\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t{\n\t\t\t\tentity.Add(\"Spawn Here\", new Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tmain.Spawner.StartSpawnPointGUID.Value = entity.GUID;\n\t\t\t\t\t\tAction go = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmain.EditorEnabled.Value = false;\n\t\t\t\t\t\t\tIO.MapLoader.Load(main, main.MapFile);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tEditor editor = main.Get(\"Editor\").First().Get<Editor>();\n\t\t\t\t\t\tif (editor.NeedsSave)\n\t\t\t\t\t\t\teditor.SaveWithCallback(go);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tgo();\n\t\t\t\t\t},\n\t\t\t\t}, Command.Perms.Executable);\n\t\t\t}\n\n\t\t\tspawn.Add(new TwoWayBinding<Vector3>(transform.Position, spawn.Position));\n\t\t\tspawn.Add(new Binding<float, Quaternion>(spawn.Rotation, delegate(Quaternion value)\n\t\t\t{\n\t\t\t\tVector3 x = Vector3.Transform(Vector3.Forward, value);\n\t\t\t\treturn ((float)Math.PI * -0.5f) - (float)Math.Atan2(x.Z, x.X);\n\t\t\t}, transform.Quaternion));\n\t\t\tspawn.EditorProperties();\n\n\t\t\ttrigger.Enabled.Value = true;\n\t\t\ttrigger.Add(new TwoWayBinding<Vector3>(transform.Position, trigger.Position));\n\t\t\ttrigger.Add(new CommandBinding(trigger.PlayerEntered, spawn.Activate));\n\n\t\t\ttrigger.EditorProperties();\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\light\";\n\t\t\tmodel.Color.Value = this.Color;\n\t\t\tmodel.Serialize = false;\n\n\t\t\tentity.Add(\"EditorModel\", model);\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, entity.Get<Transform>().Matrix));\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\n\t\t\tPlayerTrigger.AttachEditorComponents(entity, main, this.Color);\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/PlayerTriggerFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class PlayerTriggerFactory : Factory<Main>\n\t{\n\t\tpublic PlayerTriggerFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 1.0f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"PlayerTrigger\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tPlayerTrigger trigger = entity.GetOrCreate<PlayerTrigger>(\"PlayerTrigger\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main).EditorProperties();\n\n\t\t\ttrigger.Add(new TwoWayBinding<Vector3>(transform.Position, trigger.Position));\n\n\t\t\tentity.Add(\"Enable\", trigger.Enable);\n\t\t\tentity.Add(\"Disable\", trigger.Disable);\n\t\t\tentity.Add(\"Enabled\", trigger.Enabled);\n\t\t\tentity.Add(\"PlayerEntered\", trigger.PlayerEntered);\n\t\t\tentity.Add(\"PlayerExited\", trigger.PlayerExited);\n\t\t\tentity.Add(\"Radius\", trigger.Radius, \"Radius of the trigger\");\n\t\t\tentity.Add(\"DeleteOnTrigger\", trigger.DeleteOnTrigger);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tPlayerTrigger.AttachEditorComponents(entity, main, this.Color);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/PointLightFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class PointLightFactory : Factory<Main>\n\t{\n\t\tpublic PointLightFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"PointLight\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspendByDistance = true;\n\n\t\t\tPointLight light = entity.GetOrCreate<PointLight>(\"PointLight\");\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tlight.Add(new TwoWayBinding<Vector3>(light.Position, transform.Position));\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main).EditorProperties();\n\n\t\t\tentity.Add(\"Enable\", light.Enable);\n\t\t\tentity.Add(\"Disable\", light.Disable);\n\t\t\tentity.Add(\"Enabled\", light.Enabled);\n\t\t\tentity.Add(\"Color\", light.Color);\n\t\t\tentity.Add(\"Attenuation\", light.Attenuation);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tModel model = entity.Get<Model>(\"EditorModel\");\n\n\t\t\tProperty<Vector3> color = entity.Get<PointLight>().Color;\n\t\t\tmodel.Add(new Binding<Vector3>(model.Color, color));\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/PowerBlockSocketFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class PowerBlockSocketFactory : Factory<Main>\n\t{\n\t\tpublic PowerBlockSocketFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"PowerBlockSocket\");\n\t\t}\n\n\t\tprivate Random random = new Random();\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tSound.AttachTracker(entity);\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main, true, false);\n\t\t\tattachable.Offset.Value = 1;\n\t\t\tattachable.Enabled.Value = true;\n\n\t\t\tPowerBlockSocket socket = entity.GetOrCreate<PowerBlockSocket>(\"PowerBlockSocket\");\n\t\t\tsocket.Add(new Binding<Voxel.Coord>(socket.Coord, attachable.Coord));\n\t\t\tsocket.Add(new Binding<Entity.Handle>(socket.AttachedVoxel, attachable.AttachedVoxel));\n\n\t\t\tconst float maxLightAttenuation = 15.0f;\n\t\t\tPointLight light = entity.Create<PointLight>();\n\t\t\tlight.Attenuation.Value = maxLightAttenuation;\n\t\t\tlight.Add(new Binding<Vector3>(light.Position, transform.Position));\n\t\t\tlight.Add(new Binding<Vector3, Voxel.t>(light.Color, delegate(Voxel.t t)\n\t\t\t{\n\t\t\t\tswitch (t)\n\t\t\t\t{\n\t\t\t\t\tcase Voxel.t.GlowBlue:\n\t\t\t\t\t\treturn new Vector3(0.8f, 0.9f, 1.2f);\n\t\t\t\t\tcase Voxel.t.GlowYellow:\n\t\t\t\t\t\treturn new Vector3(1.2f, 1.2f, 0.8f);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn Vector3.One;\n\t\t\t\t}\n\t\t\t}, socket.Type));\n\t\t\tlight.Add(new Binding<bool>(light.Enabled, socket.Powered));\n\n\t\t\tPointLight animationLight = entity.Create<PointLight>();\n\t\t\tanimationLight.Add(new Binding<Vector3>(animationLight.Position, light.Position));\n\t\t\tanimationLight.Add(new Binding<Vector3>(animationLight.Color, light.Color));\n\t\t\tanimationLight.Enabled.Value = false;\n\n\t\t\tPlayerTrigger trigger = entity.GetOrCreate<PlayerTrigger>(\"PlayerTrigger\");\n\t\t\ttrigger.Radius.Value = 7;\n\t\t\ttrigger.Add(new Binding<Vector3>(trigger.Position, transform.Position));\n\t\t\tconst float minimumChangeTime = 1.5f;\n\t\t\tfloat lastChange = -minimumChangeTime;\n\t\t\ttrigger.Add(new CommandBinding(trigger.PlayerEntered, delegate()\n\t\t\t{\n\t\t\t\tif (main.TotalTime - lastChange > minimumChangeTime)\n\t\t\t\t{\n\t\t\t\t\tBlockCloud cloud = PlayerFactory.Instance.Get<BlockCloud>();\n\n\t\t\t\t\tbool changed = false;\n\t\t\t\t\tVoxel sockVoxel = attachable.AttachedVoxel.Value.Target.Get<Voxel>();\n\t\t\t\t\tif (!socket.Powered && cloud.Type.Value == socket.Type.Value && !socket.PowerOffOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Plug in to the socket\n\t\t\t\t\t\tList<Voxel.Coord> coords = new List<Voxel.Coord>();\n\t\t\t\t\t\tQueue<Voxel.Coord> queue = new Queue<Voxel.Coord>();\n\t\t\t\t\t\tqueue.Enqueue(sockVoxel.GetCoordinate(transform.Position));\n\t\t\t\t\t\twhile (queue.Count > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord c = queue.Dequeue();\n\t\t\t\t\t\t\tcoords.Add(c);\n\t\t\t\t\t\t\tif (coords.Count >= cloud.Blocks.Length)\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tVoxel.CoordSetCache.Add(c);\n\t\t\t\t\t\t\tforeach (Direction adjacentDirection in DirectionExtensions.Directions)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tVoxel.Coord adjacentCoord = c.Move(adjacentDirection);\n\t\t\t\t\t\t\t\tif (!Voxel.CoordSetCache.Contains(adjacentCoord))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tVoxel.t adjacentID = sockVoxel[adjacentCoord].ID;\n\t\t\t\t\t\t\t\t\tif (adjacentID == Voxel.t.Empty)\n\t\t\t\t\t\t\t\t\t\tqueue.Enqueue(adjacentCoord);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tVoxel.CoordSetCache.Clear();\n\n\t\t\t\t\t\tEffectBlockFactory factory = Factory.Get<EffectBlockFactory>();\n\t\t\t\t\t\tint i = 0;\n\t\t\t\t\t\tforeach (Entity block in cloud.Blocks)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tEntity effectBlockEntity = factory.CreateAndBind(main);\n\t\t\t\t\t\t\tVoxel.States.All[cloud.Type].ApplyToEffectBlock(effectBlockEntity.Get<ModelInstance>());\n\t\t\t\t\t\t\tEffectBlock effectBlock = effectBlockEntity.Get<EffectBlock>();\n\t\t\t\t\t\t\teffectBlock.DoScale = false;\n\t\t\t\t\t\t\tTransform blockTransform = block.Get<Transform>();\n\t\t\t\t\t\t\teffectBlock.StartPosition = blockTransform.Position;\n\t\t\t\t\t\t\teffectBlock.StartOrientation = blockTransform.Quaternion;\n\t\t\t\t\t\t\teffectBlock.TotalLifetime = (i + 1) * 0.04f;\n\t\t\t\t\t\t\teffectBlock.Setup(sockVoxel.Entity, coords[i], cloud.Type);\n\t\t\t\t\t\t\tmain.Add(effectBlockEntity);\n\t\t\t\t\t\t\tblock.Delete.Execute();\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcloud.Blocks.Clear();\n\t\t\t\t\t\tcloud.Type.Value = Voxel.t.Empty;\n\t\t\t\t\t\tsocket.Powered.Value = true;\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (socket.Powered && cloud.Type.Value == Voxel.t.Empty && !socket.PowerOnOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Pull blocks out of the socket\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_MAGIC_CUBES, entity);\n\t\t\t\t\t\tSceneryBlockFactory factory = Factory.Get<SceneryBlockFactory>();\n\t\t\t\t\t\tQuaternion quat = Quaternion.CreateFromRotationMatrix(sockVoxel.Transform);\n\t\t\t\t\t\tcloud.Type.Value = socket.Type;\n\t\t\t\t\t\tList<Voxel.Coord> coords = sockVoxel.GetContiguousByType(new[] { sockVoxel.GetBox(transform.Position) }).SelectMany(x => x.GetCoords()).ToList();\n\t\t\t\t\t\tsockVoxel.Empty(coords, true);\n\t\t\t\t\t\tsockVoxel.Regenerate();\n\t\t\t\t\t\tParticleSystem particles = ParticleSystem.Get(main, \"WhiteShatter\");\n\t\t\t\t\t\tint count = 0;\n\t\t\t\t\t\tforeach (Voxel.Coord c in coords)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVector3 pos = sockVoxel.GetAbsolutePosition(c);\n\t\t\t\t\t\t\tfor (int j = 0; j < 20; j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tVector3 offset = new Vector3((float)this.random.NextDouble() - 0.5f, (float)this.random.NextDouble() - 0.5f, (float)this.random.NextDouble() - 0.5f);\n\t\t\t\t\t\t\t\tparticles.AddParticle(pos + offset, offset);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (count < BlockCloud.TotalBlocks)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tEntity block = factory.CreateAndBind(main);\n\t\t\t\t\t\t\t\tTransform blockTransform = block.Get<Transform>();\n\t\t\t\t\t\t\t\tblockTransform.Position.Value = pos;\n\t\t\t\t\t\t\t\tblockTransform.Quaternion.Value = quat;\n\t\t\t\t\t\t\t\tSceneryBlock sceneryBlock = block.Get<SceneryBlock>();\n\t\t\t\t\t\t\t\tsceneryBlock.Type.Value = socket.Type;\n\t\t\t\t\t\t\t\tsceneryBlock.Scale.Value = 0.5f;\n\t\t\t\t\t\t\t\tcloud.Blocks.Add(block);\n\t\t\t\t\t\t\t\tmain.Add(block);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsocket.Powered.Value = false;\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (changed)\n\t\t\t\t\t{\n\t\t\t\t\t\tlastChange = main.TotalTime;\n\t\t\t\t\t\tanimationLight.Enabled.Value = true;\n\t\t\t\t\t\tanimationLight.Attenuation.Value = 0.0f;\n\t\t\t\t\t\tentity.Add(new Animation\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew Animation.FloatMoveTo(animationLight.Attenuation, maxLightAttenuation, 0.25f),\n\t\t\t\t\t\t\tnew Animation.FloatMoveTo(animationLight.Attenuation, 0.0f, 2.0f),\n\t\t\t\t\t\t\tnew Animation.Set<bool>(animationLight.Enabled, false)\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tentity.Add(\"Type\", socket.Type);\n\t\t\tentity.Add(\"Powered\", socket.Powered, new PropertyEntry.EditorData { Readonly = true });\n\t\t\tentity.Add(\"PowerOnOnly\", socket.PowerOnOnly);\n\t\t\tentity.Add(\"PowerOffOnly\", socket.PowerOffOnly);\n\t\t\tentity.Add(\"OnPowerOn\", socket.OnPowerOn);\n\t\t\tentity.Add(\"OnPowerOff\", socket.OnPowerOff);\n\t\t\tentity.Add(\"Enabled\", trigger.Enabled);\n\t\t\tentity.Add(\"Enable\", trigger.Enable);\n\t\t\tentity.Add(\"Disable\", trigger.Disable);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/PowerSoundFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class PowerSoundFactory : Factory<Main>\n\t{\n\t\tpublic PowerSoundFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"PowerSound\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\t\t\tattachable.Enabled.Value = true;\n\n\t\t\tentity.Add(\"AttachOffset\", attachable.Offset);\n\n\t\t\tif (!main.EditorEnabled)\n\t\t\t{\n\t\t\t\tProperty<Vector3> soundPosition = new Property<Vector3>();\n\t\t\t\tVoxelAttachable.BindTarget(entity, soundPosition);\n\t\t\t\tSound.AttachTracker(entity, soundPosition);\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_WHITE_LIGHT, entity);\n\t\t\t\tSoundKiller.Add(entity, AK.EVENTS.STOP_WHITE_LIGHT);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/PropFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing Lemma.IO;\n\nnamespace Lemma.Factories\n{\n\tpublic class PropFactory : Factory<Main>\n\t{\n\t\tpublic PropFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Prop\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tModel model = entity.GetOrCreate<Model>(\"Model\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main).EditorProperties();\n\n\t\t\tmodel.EditorProperties();\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, transform.Matrix));\n\n\t\t\tentity.Add(\"Enabled\", model.Enabled);\n\t\t\tentity.Add(\"Enable\", model.Enable);\n\t\t\tentity.Add(\"Disable\", model.Disable);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tModel model = entity.Get<Model>(\"Model\");\n\t\t\tModel editorModel = entity.Get<Model>(\"EditorModel\");\n\t\t\teditorModel.Add(new Binding<bool>(editorModel.Enabled, () => Editor.EditorModelsVisible && (!entity.EditorSelected || !model.IsValid), entity.EditorSelected, model.IsValid, Editor.EditorModelsVisible));\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, editorModel.Color);\n\t\t}\n\t}\n\n\tpublic class PropAlphaFactory : PropFactory\n\t{\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"PropAlpha\");\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.DrawOrder.Value = 11;\n\t\t\tentity.Add(\"Model\", model);\n\n\t\t\treturn entity;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/RainFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing System.Xml.Serialization;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma.Factories\n{\n\tpublic class RainFactory : Factory<Main>\n\t{\n\t\tpublic RainFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 1.0f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Rain\");\n\n\t\t\tParticleEmitter emitter = new ParticleEmitter();\n\t\t\temitter.ParticleType.Value = \"Rain\";\n\t\t\temitter.ParticlesPerSecond.Value = 12000;\n\t\t\tentity.Add(\"Emitter\", emitter);\n\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspendByDistance = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tRain rain = entity.GetOrCreate<Rain>(\"Rain\");\n\n\t\t\tParticleEmitter emitter = entity.GetOrCreate<ParticleEmitter>(\"Emitter\");\n\t\t\temitter.Add(new Binding<Vector3>(emitter.Jitter, rain.Jitter));\n\t\t\train.Add(new Binding<int>(rain.ParticlesPerSecond, emitter.ParticlesPerSecond));\n\n\t\t\tComponents.DirectionalLight lightning = entity.GetOrCreate<Components.DirectionalLight>(\"Lightning\");\n\t\t\tlightning.Serialize = false;\n\t\t\tlightning.Add(new Binding<Quaternion>(lightning.Quaternion, transform.Quaternion));\n\t\t\tlightning.Add(new Binding<bool>(lightning.Shadowed, rain.LightningShadowed));\n\t\t\tlightning.Enabled.Value = false;\n\n\t\t\tlightning.Add(new TwoWayBinding<Vector3>(rain.CurrentLightningColor, lightning.Color));\n\n\t\t\tif (!main.EditorEnabled)\n\t\t\t\tlightning.Add(new Binding<bool>(lightning.Enabled, rain.LightningEnabled));\n\n\t\t\temitter.AddParticle = delegate(Vector3 position, Vector3 velocity, float prime) \n\t\t\t{\n\t\t\t\tVector3 kernelCoord = (position - rain.KernelOffset) / Rain.KernelSpacing;\n\t\t\t\tfloat height = rain.RaycastHeights[Math.Max(0, Math.Min(Rain.KernelSize - 1, (int)kernelCoord.X)), Math.Max(0, Math.Min(Rain.KernelSize - 1, (int)kernelCoord.Z))];\n\t\t\t\tif (height < position.Y)\n\t\t\t\t\temitter.ParticleSystem.AddParticle(position, Vector3.Zero, Math.Min((position.Y - height) / Rain.VerticalSpeed, Rain.MaxLifetime), -1.0f, prime);\n\t\t\t};\n\n\t\t\temitter.Add(new Binding<Vector3>(emitter.Position, x => x + new Vector3(0.0f, Rain.StartHeight, 0.0f), main.Camera.Position));\n\n\t\t\tthis.SetMain(entity, main);\n\t\t\temitter.ParticleType.Value = \"Rain\";\n\n\t\t\tentity.Add(\"ThunderIntervalMin\", rain.ThunderIntervalMin);\n\t\t\tentity.Add(\"ThunderIntervalMax\", rain.ThunderIntervalMax);\n\t\t\tentity.Add(\"ThunderMaxDelay\", rain.ThunderMaxDelay);\n\t\t\tentity.Add(\"ParticlesPerSecond\", emitter.ParticlesPerSecond);\n\t\t\tentity.Add(\"LightningShadowed\", rain.LightningShadowed);\n\t\t\tentity.Add(\"LightningColor\", rain.LightningColor);\n\n\t\t\tentity.Add(new PostInitialization(delegate()\n\t\t\t{\n\t\t\t\train.Update();\n\t\t\t\temitter.Prime(Vector3.Zero);\n\t\t\t}));\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\light\";\n\t\t\tmodel.Color.Value = this.Color;\n\t\t\tmodel.Serialize = false;\n\n\t\t\tentity.Add(\"EditorModel\", model);\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, entity.Get<Transform>().Matrix));\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\n\t\t\tComponents.DirectionalLight lightning = entity.Get<Components.DirectionalLight>();\n\t\t\tlightning.Add(new Binding<bool>(lightning.Enabled, entity.EditorSelected));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/RandomTickerFactory.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Factories\n{\n\tpublic class RandomTickerFactory : Factory<Main>\n\t{\n\t\tpublic RandomTickerFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 1.0f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"RandomTicker\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspendByDistance = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tRandomTicker ticker = entity.GetOrCreate<RandomTicker>(\"Ticker\");\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"MaxInterval\", ticker.MaxInterval);\n\t\t\tentity.Add(\"MinInterval\", ticker.MinInterval);\n\t\t\tentity.Add(\"NumToFire\", ticker.NumToFire);\n\t\t\tentity.Add(\"Enabled\", ticker.Enabled);\n\n\t\t\tentity.Add(\"Disable\", ticker.Disable);\n\t\t\tentity.Add(\"Enable\", ticker.Enable);\n\t\t\tentity.Add(\"OnFire\", ticker.OnFire);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tScriptlike.AttachEditorComponents(entity, main, this.Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/RiftFactory.cs",
    "content": "﻿using System;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class RiftFactory : Factory<Main>\n\t{\n\t\tpublic RiftFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 1.0f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Rift\");\n\t\t\tRift rift = new Rift();\n\t\t\trift.Enabled.Value = false;\n\t\t\tentity.Add(\"Rift\", rift);\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tRift rift = entity.GetOrCreate<Rift>(\"Rift\");\n\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main, false, false, null);\n\t\t\tattachable.Enabled.Value = true;\n\t\t\tVoxelAttachable.BindTarget(entity, rift.Position);\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tPointLight light = entity.GetOrCreate<PointLight>();\n\t\t\tlight.Color.Value = new Vector3(1.2f, 1.4f, 1.6f);\n\t\t\tlight.Add(new Binding<Vector3>(light.Position, rift.Position));\n\t\t\tlight.Add(new Binding<bool>(light.Enabled, () => rift.Type == Rift.Style.In && rift.Enabled, rift.Type, rift.Enabled));\n\t\t\tlight.Add(new Binding<float>(light.Attenuation, x => x * 2.0f, rift.CurrentRadius));\n\n\t\t\trift.Add(new Binding<Entity.Handle>(rift.Voxel, attachable.AttachedVoxel));\n\t\t\trift.Add(new Binding<Voxel.Coord>(rift.Coordinate, attachable.Coord));\n\n\t\t\tentity.Add(\"Enable\", rift.Enable);\n\t\t\tentity.Add(\"Disable\", rift.Disable);\n\t\t\tentity.Add(\"AttachOffset\", attachable.Offset);\n\t\t\tentity.Add(\"Enabled\", rift.Enabled);\n\t\t\tentity.Add(\"Radius\", rift.Radius);\n\t\t\tentity.Add(\"Style\", rift.Type);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tRift.AttachEditorComponents(entity, main, this.Color);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/RotatorFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class RotatorFactory : Factory<Main>\n\t{\n\t\tpublic RotatorFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Rotator\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tRotator rotator = entity.GetOrCreate<Rotator>(\"Rotator\");\n\t\t\trotator.Add(new CommandBinding(rotator.Delete, entity.Delete));\n\t\t\tthis.SetMain(entity, main);\n\t\t\trotator.EditorProperties();\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"Targets\", entity.Get<Rotator>().Targets);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/SceneryBlockFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\n\nnamespace Lemma.Factories\n{\n\tpublic class SceneryBlockFactory : Factory<Main>\n\t{\n\t\tpublic SceneryBlockFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 0.25f, 0.25f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"SceneryBlock\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tPhysicsBlock physics = entity.GetOrCreate<PhysicsBlock>(\"Physics\");\n\t\t\tModelInstance model = entity.GetOrCreate<ModelInstance>(\"Model\");\n\n\t\t\tphysics.Add(new TwoWayBinding<Matrix>(transform.Matrix, physics.Transform));\n\n\t\t\tSceneryBlock sceneryBlock = entity.GetOrCreate<SceneryBlock>(\"SceneryBlock\");\n\t\t\tphysics.Add(new Binding<Vector3, float>(physics.Size, x => new Vector3(x), sceneryBlock.Scale));\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, () => Matrix.CreateScale(sceneryBlock.Scale) * transform.Matrix, transform.Matrix, sceneryBlock.Scale));\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"IsAffectedByGravity\", physics.IsAffectedByGravity);\n\t\t\tsceneryBlock.EditorProperties();\n\n\t\t\tif (!main.EditorEnabled && !physics.IsAffectedByGravity && sceneryBlock.Type.Value == Voxel.t.WhitePermanent)\n\t\t\t{\n\t\t\t\tSound.AttachTracker(entity);\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_WHITE_LIGHT, entity);\n\t\t\t\tSoundKiller.Add(entity, AK.EVENTS.STOP_WHITE_LIGHT);\n\t\t\t\tphysics.Add(new CommandBinding<Collidable, ContactCollection>(physics.Collided, delegate(Collidable other, ContactCollection contacts)\n\t\t\t\t{\n\t\t\t\t\tfloat impulse = contacts.Max(x => x.NormalImpulse);\n\t\t\t\t\tif (impulse > 0.2f)\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_WHITE_LIGHT_HIT, entity);\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tProperty<bool> valid = entity.Get<SceneryBlock>().Valid;\n\t\t\tentity.Add(new Binding<bool>(entity.Get<Model>(\"EditorModel\").Enabled, () => Editor.EditorModelsVisible && !valid, valid, Editor.EditorModelsVisible));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/ScriptFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing System.Reflection;\n\nnamespace Lemma.Factories\n{\n\tpublic class ScriptFactory : Factory<Main>\n\t{\n\t\tpublic ScriptFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Script\");\n\t\t\tentity.Add(\"Transform\", new Transform());\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\n\t\t\tScript script = entity.GetOrCreate<Script>(\"Script\");\n\t\t\tscript.Add(new CommandBinding(script.Delete, entity.Delete));\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"Execute\", script.Execute, Command.Perms.LinkableAndExecutable);\n\t\t\tentity.Add(\"ExecuteOnLoad\", script.ExecuteOnLoad);\n\t\t\tentity.Add(\"DeleteOnExecute\", script.DeleteOnExecute);\n\t\t\tentity.Add(\"Script\", script.Name, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.MapDirectory, null, \".cs\", delegate()\n\t\t\t\t{\n\t\t\t\t\tList<string> scripts = new List<string>();\n\t\t\t\t\tAssembly assembly = Assembly.GetExecutingAssembly();\n\t\t\t\t\tforeach (Type type in assembly.GetTypes())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (type.Namespace == Script.ScriptNamespace && type.IsClass && type.BaseType == typeof(GameScripts.ScriptBase))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbool available = false;\n\t\t\t\t\t\t\tif (main.Settings.GodModeProperty)\n\t\t\t\t\t\t\t\tavailable = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tFieldInfo prop = type.GetField(\"AvailableInReleaseEditor\", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);\n\t\t\t\t\t\t\t\tif ((bool)prop.GetValue(type) == true)\n\t\t\t\t\t\t\t\t\tavailable = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (available)\n\t\t\t\t\t\t\t\tscripts.Add(type.Name);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn scripts;\n\t\t\t\t}),\n\t\t\t\tRefreshOnChange = true,\n\t\t\t});\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tModel model = entity.Get<Model>(\"EditorModel\");\n\t\t\tmodel.Color.Value = Vector3.One;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/SequenceFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class SequenceFactory : Factory<Main>\n\t{\n\t\tpublic SequenceFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 1.0f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Sequence\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspendByDistance = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tTicker ticker = entity.GetOrCreate<Ticker>(\"Ticker\");\n\t\t\tSequence sequence = entity.GetOrCreate<Sequence>(\"Sequence\");\n\t\t\tticker.Add(new CommandBinding(ticker.OnFire, sequence.Advance));\n\t\t\tticker.Add(new CommandBinding(sequence.Done, ticker.Disable));\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"Commands\", sequence.Commands);\n\t\t\tentity.Add(\"Advance\", sequence.Advance);\n\t\t\tentity.Add(\"Done\", sequence.Done);\n\t\t\tentity.Add(\"Index\", sequence.Index);\n\t\t\tentity.Add(\"Reset\", sequence.Reset);\n\t\t\tentity.Add(\"Disable\", ticker.Disable);\n\t\t\tentity.Add(\"Enable\", ticker.Enable);\n\t\t\tentity.Add(\"Enabled\", ticker.Enabled);\n\t\t\tentity.Add(\"Interval\", ticker.Interval);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tScriptlike.AttachEditorComponents(entity, main, this.Color);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/SetterFactory.cs",
    "content": "﻿using System;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class SetterFactory : Factory<Main>\n\t{\n\t\tpublic SetterFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.0f, 1f, 0.0f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Setter\");\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tScriptlike.AttachEditorComponents(entity, main, this.Color);\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"Target\", entity.Get<Setter>().Target);\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tSetter setter = entity.GetOrCreate<Setter>(\"Setter\");\n\n\t\t\tbase.Bind(entity, main, creating);\n\n\t\t\tentity.Add(\"Set\", setter.Set);\n\t\t\tentity.Add(\"Type\", setter.PropertyType);\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t{\n\t\t\t\tListProperty<string> targetOptions = new ListProperty<string>();\n\t\t\t\tAction populateOptions = delegate()\n\t\t\t\t{\n\t\t\t\t\ttargetOptions.Clear();\n\t\t\t\t\tEntity e = setter.Target.Value.Target;\n\t\t\t\t\tif (e != null && e.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tType t = Setter.TypeMapping[setter.PropertyType];\n\t\t\t\t\t\tforeach (KeyValuePair<string, PropertyEntry> p in e.Properties)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (p.Value.Property.GetType().GetGenericArguments().First() == t)\n\t\t\t\t\t\t\t\ttargetOptions.Add(p.Key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tentity.Add(new NotifyBinding(populateOptions, setter.Target, setter.PropertyType));\n\t\t\t\tentity.Add(new PostInitialization(populateOptions));\n\t\t\t\tentity.Add(\"TargetProperty\", setter.TargetProperty, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tOptions = targetOptions,\n\t\t\t\t});\n\n\t\t\t\tFunc<Setter.PropType, Property<bool>> visible = delegate(Setter.PropType t)\n\t\t\t\t{\n\t\t\t\t\tProperty<bool> result = new Property<bool>();\n\t\t\t\t\tentity.Add(new Binding<bool, Setter.PropType>(result, x => x == t, setter.PropertyType));\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\tentity.Add(\"Bool\", setter.Bool, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tVisible = visible(Setter.PropType.Bool),\n\t\t\t\t});\n\t\t\t\tentity.Add(\"Int\", setter.Int, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tVisible = visible(Setter.PropType.Int),\n\t\t\t\t});\n\t\t\t\tentity.Add(\"Float\", setter.Float, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tVisible = visible(Setter.PropType.Float),\n\t\t\t\t});\n\t\t\t\tentity.Add(\"Direction\", setter.Direction, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tVisible = visible(Setter.PropType.Direction),\n\t\t\t\t});\n\t\t\t\tentity.Add(\"String\", setter.String, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tVisible = visible(Setter.PropType.String),\n\t\t\t\t});\n\t\t\t\tentity.Add(\"Vector2\", setter.Vector2, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tVisible = visible(Setter.PropType.Vector2),\n\t\t\t\t});\n\t\t\t\tentity.Add(\"Vector3\", setter.Vector3, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tVisible = visible(Setter.PropType.Vector3),\n\t\t\t\t});\n\t\t\t\tentity.Add(\"Vector4\", setter.Vector4, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tVisible = visible(Setter.PropType.Vector4),\n\t\t\t\t});\n\t\t\t\tentity.Add(\"Coord\", setter.Coord, new PropertyEntry.EditorData\n\t\t\t\t{\n\t\t\t\t\tVisible = visible(Setter.PropType.Coord),\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tentity.Add(\"Bool\", setter.Bool);\n\t\t\t\tentity.Add(\"Int\", setter.Int);\n\t\t\t\tentity.Add(\"Float\", setter.Float);\n\t\t\t\tentity.Add(\"Direction\", setter.Direction);\n\t\t\t\tentity.Add(\"String\", setter.String);\n\t\t\t\tentity.Add(\"Vector2\", setter.Vector2);\n\t\t\t\tentity.Add(\"Vector3\", setter.Vector3);\n\t\t\t\tentity.Add(\"Vector4\", setter.Vector4);\n\t\t\t\tentity.Add(\"Coord\", setter.Coord);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic class AnimatedSetterFactory : SetterFactory\n\t{\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tAnimatedSetter setter = entity.GetOrCreate<AnimatedSetter>(\"Setter\");\n\t\t\tbase.Bind(entity, main, creating);\n\t\t\tentity.Type = \"AnimatedSetter\";\n\t\t\tentity.Add(\"Blend\", setter.Blend);\n\t\t\tentity.Add(\"Duration\", setter.Duration);\n\t\t\tentity.Add(\"OnDone\", setter.OnDone);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/SignalTowerFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class SignalTowerFactory : Factory<Main>\n\t{\n\t\tprivate Random random = new Random();\n\n\t\tpublic SignalTowerFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"SignalTower\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tPlayerTrigger trigger = entity.GetOrCreate<PlayerTrigger>(\"PlayerTrigger\");\n\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\t\t\tattachable.Enabled.Value = true;\n\t\t\t\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.BindTarget(entity, trigger.Position);\n\n\t\t\tPointLight light = entity.GetOrCreate<PointLight>();\n\t\t\tlight.Add(new Binding<Vector3>(light.Position, trigger.Position));\n\t\t\tlight.Color.Value = new Vector3(1.0f, 0.5f, 1.7f);\n\n\t\t\tProperty<float> lightBaseRadius = new Property<float> { Value = 10.0f };\n\n\t\t\tUpdater updater = new Updater\n\t\t\t(\n\t\t\t\tdelegate(float dt)\n\t\t\t\t{\n\t\t\t\t\tlight.Attenuation.Value = lightBaseRadius.Value * (1.0f + (((float)this.random.NextDouble() - 0.5f) * 0.1f));\n\t\t\t\t}\n\t\t\t);\n\t\t\tupdater.EnabledInEditMode = true;\n\t\t\tentity.Add(updater);\n\n\t\t\tSignalTower tower = entity.GetOrCreate<SignalTower>(\"SignalTower\");\n\n\t\t\tAnimation enterAnimation = null;\n\t\t\ttrigger.Add(new CommandBinding(trigger.PlayerEntered, delegate()\n\t\t\t{\n\t\t\t\tif (!string.IsNullOrEmpty(tower.Initial) && (enterAnimation == null || !enterAnimation.Active))\n\t\t\t\t{\n\t\t\t\t\tenterAnimation = new Animation\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.FloatMoveTo(lightBaseRadius, 20.0f, 0.25f),\n\t\t\t\t\t\tnew Animation.FloatMoveTo(lightBaseRadius, 10.0f, 0.5f)\n\t\t\t\t\t);\n\t\t\t\t\tentity.Add(enterAnimation);\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\ttower.Add(new CommandBinding(trigger.PlayerEntered, tower.PlayerEnteredRange));\n\t\t\ttower.Add(new CommandBinding(trigger.PlayerExited, tower.PlayerExitedRange));\n\t\t\ttower.Add(new Binding<Entity.Handle>(tower.Player, trigger.Player));\n\n\t\t\tSound.AttachTracker(entity, trigger.Position);\n\n\t\t\tParticleEmitter distortionEmitter = entity.GetOrCreate<ParticleEmitter>(\"DistortionEmitter\");\n\t\t\tdistortionEmitter.Serialize = false;\n\t\t\tdistortionEmitter.Add(new Binding<Vector3>(distortionEmitter.Position, trigger.Position));\n\t\t\tdistortionEmitter.ParticleType.Value = \"Distortion\";\n\t\t\tdistortionEmitter.ParticlesPerSecond.Value = 4;\n\t\t\tdistortionEmitter.Jitter.Value = new Vector3(0.5f);\n\n\t\t\tParticleEmitter purpleEmitter = entity.GetOrCreate<ParticleEmitter>(\"PurpleEmitter\");\n\t\t\tpurpleEmitter.Serialize = false;\n\t\t\tpurpleEmitter.Add(new Binding<Vector3>(purpleEmitter.Position, trigger.Position));\n\t\t\tpurpleEmitter.ParticleType.Value = \"Purple\";\n\t\t\tpurpleEmitter.ParticlesPerSecond.Value = 30;\n\t\t\tpurpleEmitter.Jitter.Value = new Vector3(0.5f);\n\n\t\t\tentity.Add(\"AttachOffset\", attachable.Offset);\n\t\t\ttrigger.EditorProperties();\n\t\t\tentity.Add(\"Initial\", tower.Initial);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t\tPlayerTrigger.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/SkyDecalFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework.Graphics;\nusing System.IO;\n\nnamespace Lemma.Factories\n{\n\tpublic class SkyDecalFactory : Factory<Main>\n\t{\n\t\tpublic SkyDecalFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.8f, 0.6f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"SkyDecal\");\n\n\t\t\tModelAlpha skybox = new ModelAlpha();\n\t\t\tskybox.DiffuseTexture.Value = \"Images\\\\circle\";\n\t\t\tentity.Add(\"Model\", skybox);\n\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tModelAlpha model = entity.Get<ModelAlpha>(\"Model\");\n\t\t\tmodel.Filename.Value = \"Models\\\\plane\";\n\t\t\tmodel.EffectFile.Value = \"Effects\\\\SkyDecal\";\n\t\t\tbase.Bind(entity, main, creating);\n\t\t\tentity.CannotSuspendByDistance = true;\n\n\t\t\tmodel.DisableCulling.Value = true;\n\t\t\tmodel.CullBoundingBox.Value = false;\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, transform.Matrix));\n\t\t\tmodel.DrawOrder.Value = -9;\n\n\t\t\tmodel.Add(new Binding<Vector3>(model.GetVector3Parameter(\"CameraPosition\"), main.Camera.Position));\n\n\t\t\tentity.Add(\"Scale\", model.Scale);\n\t\t\tentity.Add(\"Alpha\", model.Alpha);\n\t\t\tentity.Add(\"Color\", model.Color, new PropertyEntry.EditorData { FChangeBy = 0.1f });\n\t\t\tentity.Add(\"Image\", model.DiffuseTexture, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.Content.RootDirectory, new[] { \"Images\", \"Game\\\\Images\" }),\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/SkyboxFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework.Graphics;\nusing System.IO;\n\nnamespace Lemma.Factories\n{\n\tpublic class SkyboxFactory : Factory<Main>\n\t{\n\t\tpublic SkyboxFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.8f, 0.6f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Skybox\");\n\n\t\t\tModelAlpha skybox = new ModelAlpha();\n\t\t\tskybox.DiffuseTexture.Value = \"Skyboxes\\\\skybox-sun\";\n\t\t\tentity.Add(\"Skybox\", skybox);\n\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tSkybox skybox = entity.GetOrCreate<Skybox>(\"Settings\");\n\n\t\t\tModelAlpha model = entity.Get<ModelAlpha>(\"Skybox\");\n\t\t\tmodel.Filename.Value = \"InternalModels\\\\skybox\";\n\t\t\tbase.Bind(entity, main, creating);\n\t\t\tentity.CannotSuspendByDistance = true;\n\n\t\t\tmodel.DisableCulling.Value = true;\n\t\t\tmodel.CullBoundingBox.Value = false;\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, transform.Matrix));\n\t\t\tmodel.DrawOrder.Value = -10;\n\n\t\t\tmodel.Add\n\t\t\t(\n\t\t\t\tnew Binding<string>\n\t\t\t\t(\n\t\t\t\t\tmodel.TechniquePostfix,\n\t\t\t\t\tdelegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tstring prefix = \"\";\n\t\t\t\t\t\tif (Water.BigWaterShader)\n\t\t\t\t\t\t\tprefix += \"Water\";\n\t\t\t\t\t\telse if (skybox.Vertical)\n\t\t\t\t\t\t\tprefix += \"Vertical\";\n\n\t\t\t\t\t\tif (main.LightingManager.HasGlobalShadowLight\n\t\t\t\t\t\t\t&& main.LightingManager.DynamicShadows != LightingManager.DynamicShadowSetting.Off\n\t\t\t\t\t\t\t&& skybox.GodRays > 0.0f\n\t\t\t\t\t\t\t&& main.Settings.VolumetricLighting)\n\t\t\t\t\t\t\tprefix += \"GodRays\";\n\t\t\t\t\t\treturn prefix;\n\t\t\t\t\t},\n\t\t\t\t\tskybox.Vertical, main.LightingManager.HasGlobalShadowLight, main.LightingManager.DynamicShadows, skybox.GodRays, main.Settings.VolumetricLighting, Water.BigWaterShader\n\t\t\t\t)\n\t\t\t);\n\t\t\tmodel.Add(new Binding<float>(model.GetFloatParameter(\"WaterHeight\"), Water.BigWaterHeight));\n\t\t\tmodel.Add(new Binding<float>(model.GetFloatParameter(\"VerticalSize\"), skybox.VerticalSize));\n\t\t\tmodel.Add(new Binding<float>(model.GetFloatParameter(\"VerticalCenter\"), skybox.VerticalCenter));\n\t\t\tmodel.Add(new Binding<float>(model.GetFloatParameter(\"GodRayStrength\"), skybox.GodRays));\n\t\t\tmodel.Add(new Binding<float>(model.GetFloatParameter(\"GodRayExtinction\"), skybox.GodRayExtinction));\n\t\t\tmodel.Add(new Binding<Vector3>(model.GetVector3Parameter(\"CameraPosition\"), main.Camera.Position));\n\t\t\tmodel.Add(new Binding<RenderTarget2D>(model.GetRenderTarget2DParameter(\"ShadowMap\" + Components.Model.SamplerPostfix), () => main.LightingManager.GlobalShadowMap, main.LightingManager.GlobalShadowMap, main.ScreenSize));\n\t\t\tmodel.Add(new Binding<Matrix>(model.GetMatrixParameter(\"ShadowViewProjectionMatrix\"), main.LightingManager.GlobalShadowViewProjection));\n\t\t\tmodel.GetTexture2DParameter(\"Random\" + Lemma.Components.Model.SamplerPostfix).Value = main.Content.Load<Texture2D>(\"Textures\\\\random\");\n\n\t\t\tmodel.Add(new Binding<float>(model.GetFloatParameter(\"StartDistance\"), skybox.StartDistance));\n\n\t\t\tentity.Add(\"Color\", model.Color, new PropertyEntry.EditorData(){FChangeBy = 0.1f});\n\t\t\tentity.Add(\"Vertical\", skybox.Vertical);\n\t\t\tentity.Add(\"VerticalSize\", skybox.VerticalSize);\n\t\t\tentity.Add(\"VerticalCenter\", skybox.VerticalCenter);\n\t\t\tentity.Add(\"GodRays\", skybox.GodRays);\n\t\t\tentity.Add(\"GodRayExtinction\", skybox.GodRayExtinction);\n\t\t\tentity.Add(\"StartDistance\", skybox.StartDistance);\n\t\t\tentity.Add(\"Image\", model.DiffuseTexture, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.Content.RootDirectory, new[] { \"Skyboxes\" }),\n\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/SliderFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Paths.PathFollowing;\nusing Lemma.Util;\nusing BEPUphysics;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.SolverGroups;\n\nnamespace Lemma.Factories\n{\n\tpublic class SliderFactory : Factory<Main>\n\t{\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Slider\");\n\t\t\tentity.Add(\"MapTransform\", new Transform());\n\t\t\tentity.Add(\"Transform\", new Transform());\n\t\t\tentity.Add(\"Voxel\", new DynamicVoxel(0, 0, 0));\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tSlider slider = entity.GetOrCreate<Slider>(\"Slider\");\n\n\t\t\tJointFactory.Bind(entity, main, slider.CreateJoint, false, creating);\n\n\t\t\tComponents.Joint joint = entity.GetOrCreate<Components.Joint>(\"Joint\");\n\t\t\tslider.Add(new Binding<Direction>(slider.Direction, joint.Direction));\n\n\t\t\tDynamicVoxel voxel = entity.Get<DynamicVoxel>();\n\t\t\tvoxel.KineticFriction.Value = voxel.StaticFriction.Value = 0;\n\t\t\tSound.AttachTracker(entity, voxel.Transform);\n\t\t\tSoundKiller.Add(entity, AK.EVENTS.STOP_ALL_OBJECT);\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t\tentity.Add(new Binding<Matrix>(entity.GetOrCreate<SliderCommon>(\"SliderCommon\").OriginalTransform, voxel.Transform));\n\n\t\t\tentity.Add(\"Forward\", slider.Forward);\n\t\t\tentity.Add(\"Backward\", slider.Backward);\n\t\t\tentity.Add(\"OnHitMax\", slider.OnHitMax);\n\t\t\tentity.Add(\"OnHitMin\", slider.OnHitMin);\n\n\t\t\tentity.Add(\"MovementLoop\", slider.MovementLoop, new PropertyEntry.EditorData { Options = WwisePicker.Get(main) });\n\t\t\tentity.Add(\"MovementStop\", slider.MovementStop, new PropertyEntry.EditorData { Options = WwisePicker.Get(main) });\n\t\t\tentity.Add(\"Direction\", joint.Direction);\n\t\t\tentity.Add(\"Minimum\", slider.Minimum);\n\t\t\tentity.Add(\"Maximum\", slider.Maximum);\n\t\t\tentity.Add(\"Locked\", slider.Locked);\n\t\t\tentity.Add(\"Speed\", slider.Speed);\n\t\t\tentity.Add(\"Goal\", slider.Goal);\n\t\t\tentity.Add(\"Servo\", slider.Servo);\n\t\t\tentity.Add(\"StartAtMinimum\", slider.StartAtMinimum);\n\t\t\tentity.Add(\"MaxForce\", slider.MaxForce);\n\n\t\t\tentity.Add(\"UVRotation\", voxel.UVRotation);\n\t\t\tentity.Add(\"UVOffset\", voxel.UVOffset);\n\t\t\tentity.Add(\"CannotSuspendByDistance\", voxel.CannotSuspendByDistance);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/SmokeFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class SmokeFactory : Factory<Main>\n\t{\n\t\tprivate static Random random = new Random();\n\n\t\tpublic SmokeFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.8f, 0.8f, 0.8f);\n\t\t\tthis.EditorCanSpawn = false;\n\t\t}\n\n\t\tconst float speed = 20.0f;\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Smoke\");\n\t\t\tSmoke smoke = new Smoke();\n\t\t\tsmoke.Velocity.Value = speed * Vector3.Normalize(new Vector3(((float)random.NextDouble() - 0.5f) * 2.0f, (float)random.NextDouble(), ((float)random.NextDouble() - 0.5f) * 2.0f));\n\t\t\tentity.Add(\"Smoke\", smoke);\n\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.Serialize = false;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tSmoke smoke = entity.GetOrCreate<Smoke>(\"Smoke\");\n\t\t\tsmoke.Add(new TwoWayBinding<Vector3>(transform.Position, smoke.Position));\n\t\t\tsmoke.Add(new CommandBinding(smoke.Delete, entity.Delete));\n\n\t\t\tParticleEmitter emitter = entity.GetOrCreate<ParticleEmitter>(\"Emitter\");\n\t\t\temitter.Add(new Binding<Vector3>(emitter.Position, transform.Position));\n\t\t\temitter.ParticlesPerSecond.Value = 35;\n\t\t\temitter.ParticleType.Value = \"Smoke\";\n\n\t\t\tthis.SetMain(entity, main);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/SnakeFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.CollisionTests;\nusing System.Threading;\n\nnamespace Lemma.Factories\n{\n\tpublic class SnakeFactory : Factory<Main>\n\t{\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Snake\");\n\t\t}\n\n\t\tprivate Random random = new Random();\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tif (ParticleSystem.Get(main, \"SnakeSparks\") == null)\n\t\t\t{\n\t\t\t\tParticleSystem.Add(main, \"SnakeSparks\",\n\t\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t\t{\n\t\t\t\t\tTextureName = \"Particles\\\\splash\",\n\t\t\t\t\tMaxParticles = 1000,\n\t\t\t\t\tDuration = TimeSpan.FromSeconds(1.0f),\n\t\t\t\t\tMinHorizontalVelocity = -7.0f,\n\t\t\t\t\tMaxHorizontalVelocity = 7.0f,\n\t\t\t\t\tMinVerticalVelocity = 0.0f,\n\t\t\t\t\tMaxVerticalVelocity = 7.0f,\n\t\t\t\t\tGravity = new Vector3(0.0f, -10.0f, 0.0f),\n\t\t\t\t\tMinRotateSpeed = -2.0f,\n\t\t\t\t\tMaxRotateSpeed = 2.0f,\n\t\t\t\t\tMinStartSize = 0.3f,\n\t\t\t\t\tMaxStartSize = 0.7f,\n\t\t\t\t\tMinEndSize = 0.0f,\n\t\t\t\t\tMaxEndSize = 0.0f,\n\t\t\t\t\tBlendState = Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend,\n\t\t\t\t\tMinColor = new Vector4(2.0f, 2.0f, 2.0f, 1.0f),\n\t\t\t\t\tMaxColor = new Vector4(2.0f, 2.0f, 2.0f, 1.0f),\n\t\t\t\t});\n\t\t\t\tParticleSystem.Add(main, \"SnakeSparksRed\",\n\t\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t\t{\n\t\t\t\t\tTextureName = \"Particles\\\\splash\",\n\t\t\t\t\tMaxParticles = 1000,\n\t\t\t\t\tDuration = TimeSpan.FromSeconds(1.0f),\n\t\t\t\t\tMinHorizontalVelocity = -7.0f,\n\t\t\t\t\tMaxHorizontalVelocity = 7.0f,\n\t\t\t\t\tMinVerticalVelocity = 0.0f,\n\t\t\t\t\tMaxVerticalVelocity = 7.0f,\n\t\t\t\t\tGravity = new Vector3(0.0f, -10.0f, 0.0f),\n\t\t\t\t\tMinRotateSpeed = -2.0f,\n\t\t\t\t\tMaxRotateSpeed = 2.0f,\n\t\t\t\t\tMinStartSize = 0.3f,\n\t\t\t\t\tMaxStartSize = 0.7f,\n\t\t\t\t\tMinEndSize = 0.0f,\n\t\t\t\t\tMaxEndSize = 0.0f,\n\t\t\t\t\tBlendState = Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend,\n\t\t\t\t\tMinColor = new Vector4(1.4f, 0.8f, 0.7f, 1.0f),\n\t\t\t\t\tMaxColor = new Vector4(1.4f, 0.8f, 0.7f, 1.0f),\n\t\t\t\t});\n\t\t\t\tParticleSystem.Add(main, \"SnakeSparksYellow\",\n\t\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t\t{\n\t\t\t\t\tTextureName = \"Particles\\\\splash\",\n\t\t\t\t\tMaxParticles = 1000,\n\t\t\t\t\tDuration = TimeSpan.FromSeconds(1.0f),\n\t\t\t\t\tMinHorizontalVelocity = -7.0f,\n\t\t\t\t\tMaxHorizontalVelocity = 7.0f,\n\t\t\t\t\tMinVerticalVelocity = 0.0f,\n\t\t\t\t\tMaxVerticalVelocity = 7.0f,\n\t\t\t\t\tGravity = new Vector3(0.0f, -10.0f, 0.0f),\n\t\t\t\t\tMinRotateSpeed = -2.0f,\n\t\t\t\t\tMaxRotateSpeed = 2.0f,\n\t\t\t\t\tMinStartSize = 0.3f,\n\t\t\t\t\tMaxStartSize = 0.7f,\n\t\t\t\t\tMinEndSize = 0.0f,\n\t\t\t\t\tMaxEndSize = 0.0f,\n\t\t\t\t\tBlendState = Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend,\n\t\t\t\t\tMinColor = new Vector4(1.4f, 1.4f, 0.7f, 1.0f),\n\t\t\t\t\tMaxColor = new Vector4(1.4f, 1.4f, 0.7f, 1.0f),\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tSnake snake = entity.GetOrCreate<Snake>(\"Snake\");\n\n\t\t\tentity.CannotSuspendByDistance = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tAI ai = entity.GetOrCreate<AI>(\"AI\");\n\n\t\t\tAgent agent = entity.GetOrCreate<Agent>(\"Agent\");\n\n\t\t\tconst float defaultSpeed = 5.0f;\n\t\t\tconst float chaseSpeed = 18.0f;\n\t\t\tconst float closeChaseSpeed = 12.0f;\n\t\t\tconst float crushSpeed = 125.0f;\n\n\t\t\tVoxelChaseAI chase = entity.GetOrCreate<VoxelChaseAI>(\"VoxelChaseAI\");\n\t\t\tchase.Add(new TwoWayBinding<Vector3>(transform.Position, chase.Position));\n\t\t\tchase.Speed.Value = defaultSpeed;\n\t\t\tchase.EnablePathfinding.Value = ai.CurrentState.Value == \"Chase\";\n\t\t\tchase.Filter = delegate(Voxel.State state)\n\t\t\t{\n\t\t\t\tif (state == Voxel.States.Infected || state == Voxel.States.Neutral || state == Voxel.States.Hard || state == Voxel.States.HardInfected)\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t};\n\t\t\tentity.Add(new CommandBinding(chase.Delete, entity.Delete));\n\n\t\t\tPointLight positionLight = null;\n\t\t\tif (!main.EditorEnabled)\n\t\t\t{\n\t\t\t\tpositionLight = new PointLight();\n\t\t\t\tpositionLight.Serialize = false;\n\t\t\t\tpositionLight.Color.Value = new Vector3(1.5f, 0.5f, 0.5f);\n\t\t\t\tpositionLight.Attenuation.Value = 20.0f;\n\t\t\t\tpositionLight.Add(new Binding<bool, string>(positionLight.Enabled, x => x != \"Suspended\", ai.CurrentState));\n\t\t\t\tpositionLight.Add(new Binding<Vector3, string>(positionLight.Color, delegate(string state)\n\t\t\t\t{\n\t\t\t\t\tswitch (state)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"Chase\":\n\t\t\t\t\t\tcase \"Crush\":\n\t\t\t\t\t\t\treturn new Vector3(1.5f, 0.5f, 0.5f);\n\t\t\t\t\t\tcase \"Alert\":\n\t\t\t\t\t\t\treturn new Vector3(1.5f, 1.5f, 0.5f);\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn new Vector3(1.0f, 1.0f, 1.0f);\n\t\t\t\t\t}\n\t\t\t\t}, ai.CurrentState));\n\t\t\t\tentity.Add(\"PositionLight\", positionLight);\n\t\t\t\tParticleEmitter emitter = entity.GetOrCreate<ParticleEmitter>(\"Particles\");\n\t\t\t\temitter.Serialize = false;\n\t\t\t\temitter.ParticlesPerSecond.Value = 100;\n\t\t\t\temitter.Add(new Binding<string>(emitter.ParticleType, delegate(string state)\n\t\t\t\t{\n\t\t\t\t\tswitch (state)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"Chase\":\n\t\t\t\t\t\tcase \"Crush\":\n\t\t\t\t\t\t\treturn \"SnakeSparksRed\";\n\t\t\t\t\t\tcase \"Alert\":\n\t\t\t\t\t\t\treturn \"SnakeSparksYellow\";\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn \"SnakeSparks\";\n\t\t\t\t\t}\n\t\t\t\t}, ai.CurrentState));\n\t\t\t\temitter.Add(new Binding<Vector3>(emitter.Position, transform.Position));\n\t\t\t\temitter.Add(new Binding<bool, string>(emitter.Enabled, x => x != \"Suspended\", ai.CurrentState));\n\n\t\t\t\tpositionLight.Add(new Binding<Vector3>(positionLight.Position, transform.Position));\n\t\t\t\temitter.Add(new Binding<Vector3>(emitter.Position, transform.Position));\n\t\t\t\tagent.Add(new Binding<Vector3>(agent.Position, transform.Position));\n\t\t\t\tSound.AttachTracker(entity);\n\t\t\t}\n\n\t\t\tAI.Task checkMap = new AI.Task\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tif (chase.Voxel.Value.Target == null || !chase.Voxel.Value.Target.Active)\n\t\t\t\t\t\tentity.Delete.Execute();\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tAI.Task checkOperationalRadius = new AI.Task\n\t\t\t{\n\t\t\t\tInterval = 2.0f,\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tbool shouldBeActive = (transform.Position.Value - main.Camera.Position).Length() < snake.OperationalRadius;\n\t\t\t\t\tif (shouldBeActive && ai.CurrentState == \"Suspended\")\n\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\telse if (!shouldBeActive && ai.CurrentState != \"Suspended\")\n\t\t\t\t\t\tai.CurrentState.Value = \"Suspended\";\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tAI.Task checkTargetAgent = new AI.Task\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tEntity target = ai.TargetAgent.Value.Target;\n\t\t\t\t\tif (target == null || !target.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tai.TargetAgent.Value = null;\n\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tFunc<Voxel, Direction> randomValidDirection = delegate(Voxel m)\n\t\t\t{\n\t\t\t\tVoxel.Coord c = chase.Coord;\n\t\t\t\tDirection[] dirs = new Direction[6];\n\t\t\t\tArray.Copy(DirectionExtensions.Directions, dirs, 6);\n\n\t\t\t\t// Shuffle directions\n\t\t\t\tint i = 5;\n\t\t\t\twhile (i > 0)\n\t\t\t\t{\n\t\t\t\t\tint k = this.random.Next(i);\n\t\t\t\t\tDirection temp = dirs[i];\n\t\t\t\t\tdirs[i] = dirs[k];\n\t\t\t\t\tdirs[k] = temp;\n\t\t\t\t\ti--;\n\t\t\t\t}\n\n\t\t\t\tforeach (Direction dir in dirs)\n\t\t\t\t{\n\t\t\t\t\tif (chase.Filter(m[c.Move(dir)]))\n\t\t\t\t\t\treturn dir;\n\t\t\t\t}\n\t\t\t\treturn Direction.None;\n\t\t\t};\n\n\t\t\tDirection currentDir = Direction.None;\n\n\t\t\tchase.Add(new CommandBinding<Voxel, Voxel.Coord>(chase.Moved, delegate(Voxel m, Voxel.Coord c)\n\t\t\t{\n\t\t\t\tif (chase.Active)\n\t\t\t\t{\n\t\t\t\t\tstring currentState = ai.CurrentState.Value;\n\t\t\t\t\tVoxel.t id = m[c].ID;\n\t\t\t\t\tif (id == Voxel.t.Hard)\n\t\t\t\t\t{\n\t\t\t\t\t\tm.Empty(c);\n\t\t\t\t\t\tm.Fill(c, Voxel.States.HardInfected);\n\t\t\t\t\t\tm.Regenerate();\n\t\t\t\t\t}\n\t\t\t\t\telse if (id == Voxel.t.Neutral)\n\t\t\t\t\t{\n\t\t\t\t\t\tm.Empty(c);\n\t\t\t\t\t\tm.Fill(c, Voxel.States.Infected);\n\t\t\t\t\t\tm.Regenerate();\n\t\t\t\t\t}\n\t\t\t\t\telse if (id == Voxel.t.Empty)\n\t\t\t\t\t{\n\t\t\t\t\t\tm.Fill(c, Voxel.States.Infected);\n\t\t\t\t\t\tm.Regenerate();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (currentState == \"Idle\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif (currentDir == Direction.None || !chase.Filter(m[chase.Coord.Value.Move(currentDir)]) || this.random.Next(8) == 0)\n\t\t\t\t\t\t\tcurrentDir = randomValidDirection(m);\n\t\t\t\t\t\tchase.Coord.Value = chase.Coord.Value.Move(currentDir);\n\t\t\t\t\t}\n\t\t\t\t\telse if (snake.Path.Length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tchase.Coord.Value = snake.Path[0];\n\t\t\t\t\t\tsnake.Path.RemoveAt(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tSound.AttachTracker(entity);\n\t\t\tSoundKiller.Add(entity, AK.EVENTS.STOP_SNAKE);\n\t\t\tai.Add(new ChangeBinding<string>(ai.CurrentState, delegate(string old, string value)\n\t\t\t{\n\t\t\t\tif (value == \"Suspended\" || value == \"Alert\")\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_SNAKE, entity);\n\t\t\t\telse if (old != \"Idle\" && old != \"Chase\" && old != \"Crush\")\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_SNAKE, entity);\n\t\t\t}));\n\t\t\t\n\t\t\tconst float sightDistance = 50.0f;\n\t\t\tconst float hearingDistance = 0.0f;\n\n\t\t\tai.Setup\n\t\t\t(\n\t\t\t\tnew AI.AIState\n\t\t\t\t{\n\t\t\t\t\tName = \"Suspended\",\n\t\t\t\t\tTasks = new[] { checkOperationalRadius },\n\t\t\t\t},\n\t\t\t\tnew AI.AIState\n\t\t\t\t{\n\t\t\t\t\tName = \"Idle\",\n\t\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t\t{\n\t\t\t\t\t\tEntity voxelEntity = chase.Voxel.Value.Target;\n\t\t\t\t\t\tif (voxelEntity != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel m = voxelEntity.Get<Voxel>();\n\t\t\t\t\t\t\tif (currentDir == Direction.None || !chase.Filter(m[chase.Coord.Value.Move(currentDir)]))\n\t\t\t\t\t\t\t\tcurrentDir = randomValidDirection(m);\n\t\t\t\t\t\t\tchase.Coord.Value = chase.Coord.Value.Move(currentDir);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tTasks = new[]\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckMap,\n\t\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\t\tnew AI.Task\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tInterval = 1.0f,\n\t\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tAgent a = Agent.Query(transform.Position, sightDistance, hearingDistance, x => x.Entity.Type == \"Player\");\n\t\t\t\t\t\t\t\tif (a != null)\n\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tnew AI.AIState\n\t\t\t\t{\n\t\t\t\t\tName = \"Alert\",\n\t\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t\t{\n\t\t\t\t\t\tchase.EnableMovement.Value = false;\n\t\t\t\t\t},\n\t\t\t\t\tExit = delegate(AI.AIState next)\n\t\t\t\t\t{\n\t\t\t\t\t\tchase.EnableMovement.Value = true;\n\t\t\t\t\t},\n\t\t\t\t\tTasks = new[]\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckMap,\n\t\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\t\tnew AI.Task\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tInterval = 0.4f,\n\t\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (ai.TimeInCurrentState > 3.0f)\n\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tAgent a = Agent.Query(transform.Position, sightDistance, hearingDistance, x => x.Entity.Type == \"Player\");\n\t\t\t\t\t\t\t\t\tif (a != null)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tai.TargetAgent.Value = a.Entity;\n\t\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Chase\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tnew AI.AIState\n\t\t\t\t{\n\t\t\t\t\tName = \"Chase\",\n\t\t\t\t\tEnter = delegate(AI.AIState previousState)\n\t\t\t\t\t{\n\t\t\t\t\t\tchase.EnablePathfinding.Value = true;\n\t\t\t\t\t\tchase.Speed.Value = chaseSpeed;\n\t\t\t\t\t},\n\t\t\t\t\tExit = delegate(AI.AIState nextState)\n\t\t\t\t\t{\n\t\t\t\t\t\tchase.EnablePathfinding.Value = false;\n\t\t\t\t\t\tchase.Speed.Value = defaultSpeed;\n\t\t\t\t\t},\n\t\t\t\t\tTasks = new[]\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckMap,\n\t\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\t\tcheckTargetAgent,\n\t\t\t\t\t\tnew AI.Task\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tInterval = 0.07f,\n\t\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tVector3 targetPosition = ai.TargetAgent.Value.Target.Get<Agent>().Position;\n\n\t\t\t\t\t\t\t\tfloat targetDistance = (targetPosition - transform.Position).Length();\n\n\t\t\t\t\t\t\t\tchase.Speed.Value = targetDistance < 15.0f ? closeChaseSpeed : chaseSpeed;\n\n\t\t\t\t\t\t\t\tif (targetDistance > 50.0f || ai.TimeInCurrentState > 30.0f) // He got away\n\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\t\t\telse if (targetDistance < 4.0f) // We got 'im\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// First, make sure we're not near a reset block\n\t\t\t\t\t\t\t\t\tVoxel v = chase.Voxel.Value.Target.Get<Voxel>();\n\t\t\t\t\t\t\t\t\tif (VoxelAStar.BroadphaseSearch(v, chase.Coord, 6, x => x.Type == Lemma.Components.Voxel.States.Reset) == null)\n\t\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Crush\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tchase.Target.Value = targetPosition;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tnew AI.AIState\n\t\t\t\t{\n\t\t\t\t\tName = \"Crush\",\n\t\t\t\t\tEnter = delegate(AI.AIState lastState)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Set up cage\n\t\t\t\t\t\tVoxel.Coord center = chase.Voxel.Value.Target.Get<Voxel>().GetCoordinate(ai.TargetAgent.Value.Target.Get<Agent>().Position);\n\n\t\t\t\t\t\tint radius = 1;\n\n\t\t\t\t\t\t// Bottom\n\t\t\t\t\t\tfor (int x = center.X - radius; x <= center.X + radius; x++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int z = center.Z - radius; z <= center.Z + radius; z++)\n\t\t\t\t\t\t\t\tsnake.Path.Add(new Voxel.Coord { X = x, Y = center.Y - 4, Z = z });\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Outer shell\n\t\t\t\t\t\tradius = 2;\n\t\t\t\t\t\tfor (int y = center.Y - 3; y <= center.Y + 3; y++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Left\n\t\t\t\t\t\t\tfor (int z = center.Z - radius; z <= center.Z + radius; z++)\n\t\t\t\t\t\t\t\tsnake.Path.Add(new Voxel.Coord { X = center.X - radius, Y = y, Z = z });\n\n\t\t\t\t\t\t\t// Right\n\t\t\t\t\t\t\tfor (int z = center.Z - radius; z <= center.Z + radius; z++)\n\t\t\t\t\t\t\t\tsnake.Path.Add(new Voxel.Coord { X = center.X + radius, Y = y, Z = z });\n\n\t\t\t\t\t\t\t// Backward\n\t\t\t\t\t\t\tfor (int x = center.X - radius; x <= center.X + radius; x++)\n\t\t\t\t\t\t\t\tsnake.Path.Add(new Voxel.Coord { X = x, Y = y, Z = center.Z - radius });\n\n\t\t\t\t\t\t\t// Forward\n\t\t\t\t\t\t\tfor (int x = center.X - radius; x <= center.X + radius; x++)\n\t\t\t\t\t\t\t\tsnake.Path.Add(new Voxel.Coord { X = x, Y = y, Z = center.Z + radius });\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Top\n\t\t\t\t\t\tfor (int x = center.X - radius; x <= center.X + radius; x++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int z = center.Z - radius; z <= center.Z + radius; z++)\n\t\t\t\t\t\t\t\tsnake.Path.Add(new Voxel.Coord { X = x, Y = center.Y + 3, Z = z });\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tchase.EnablePathfinding.Value = false;\n\t\t\t\t\t\tchase.Speed.Value = crushSpeed;\n\n\t\t\t\t\t\tsnake.CrushCoordinate.Value = chase.Coord;\n\t\t\t\t\t},\n\t\t\t\t\tExit = delegate(AI.AIState nextState)\n\t\t\t\t\t{\n\t\t\t\t\t\tchase.Speed.Value = defaultSpeed;\n\t\t\t\t\t\tchase.Coord.Value = chase.LastCoord.Value = snake.CrushCoordinate;\n\t\t\t\t\t\tsnake.Path.Clear();\n\t\t\t\t\t},\n\t\t\t\t\tTasks = new[]\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckMap,\n\t\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\t\tcheckTargetAgent,\n\t\t\t\t\t\tnew AI.Task\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tInterval = 0.01f,\n\t\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tAgent a = ai.TargetAgent.Value.Target.Get<Agent>();\n\t\t\t\t\t\t\t\ta.Damage.Execute(0.01f / 1.5f); // seconds to kill\n\t\t\t\t\t\t\t\tif (!a.Active)\n\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ((a.Position - transform.Position.Value).Length() > 5.0f) // They're getting away\n\t\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Chase\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"OperationalRadius\", snake.OperationalRadius);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/SnowFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing System.Xml.Serialization;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma.Factories\n{\n\tpublic class SnowFactory : Factory<Main>\n\t{\n\t\tpublic SnowFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 1.0f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Snow\");\n\n\t\t\tParticleEmitter emitter = new ParticleEmitter();\n\t\t\temitter.ParticlesPerSecond.Value = 8000;\n\t\t\tentity.Add(\"Emitter\", emitter);\n\n\t\t\tParticleEmitter windEmitter = new ParticleEmitter();\n\t\t\twindEmitter.ParticlesPerSecond.Value = 200;\n\t\t\tentity.Add(\"WindEmitter\", windEmitter);\n\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic const float MaxLifetime = 6.0f;\n\t\tpublic const float MaxWindLifetime = 9.0f;\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tif (ParticleSystem.Get(main, \"Snow\") == null)\n\t\t\t{\n\t\t\t\tParticleSystem.Add(main, \"Snow\",\n\t\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t\t{\n\t\t\t\t\tTextureName = \"Particles\\\\default\",\n\t\t\t\t\tEffectFile = \"Effects\\\\ParticleSnow\",\n\t\t\t\t\tMaxParticles = 50000,\n\t\t\t\t\tDuration = TimeSpan.FromSeconds(SnowFactory.MaxLifetime),\n\t\t\t\t\tMinHorizontalVelocity = -1.0f,\n\t\t\t\t\tMaxHorizontalVelocity = 1.0f,\n\t\t\t\t\tMinVerticalVelocity = -1.0f,\n\t\t\t\t\tMaxVerticalVelocity = 1.0f,\n\t\t\t\t\tGravity = new Vector3(0.0f, 0.0f, 0.0f),\n\t\t\t\t\tMinRotateSpeed = 0.0f,\n\t\t\t\t\tMaxRotateSpeed = 0.0f,\n\t\t\t\t\tMinStartSize = 0.05f,\n\t\t\t\t\tMaxStartSize = 0.15f,\n\t\t\t\t\tMinEndSize = 0.05f,\n\t\t\t\t\tMaxEndSize = 0.15f,\n\t\t\t\t\tMinColor = new Vector4(0.5f, 0.5f, 0.5f, 1.0f),\n\t\t\t\t\tMaxColor = new Vector4(0.5f, 0.5f, 0.5f, 1.0f),\n\t\t\t\t\tEmitterVelocitySensitivity = 1.0f,\n\t\t\t\t\tBlendState = BlendState.Opaque,\n\t\t\t\t\tMaterial = new Components.Model.Material { SpecularIntensity = 0.0f, SpecularPower = 1.0f },\n\t\t\t\t});\n\t\t\t\tParticleSystem.Add(main, \"Wind\",\n\t\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t\t{\n\t\t\t\t\tTextureName = \"Particles\\\\wind\",\n\t\t\t\t\tEffectFile = \"Effects\\\\ParticleVolume\",\n\t\t\t\t\tMaxParticles = 10000,\n\t\t\t\t\tDuration = TimeSpan.FromSeconds(SnowFactory.MaxWindLifetime),\n\t\t\t\t\tMinHorizontalVelocity = -1.0f,\n\t\t\t\t\tMaxHorizontalVelocity = 1.0f,\n\t\t\t\t\tMinVerticalVelocity = -1.0f,\n\t\t\t\t\tMaxVerticalVelocity = 1.0f,\n\t\t\t\t\tGravity = new Vector3(0.0f, 0.0f, 0.0f),\n\t\t\t\t\tMinRotateSpeed = -1.0f,\n\t\t\t\t\tMaxRotateSpeed = 1.0f,\n\t\t\t\t\tMinStartSize = 20.0f,\n\t\t\t\t\tMaxStartSize = 30.0f,\n\t\t\t\t\tMinEndSize = 30.0f,\n\t\t\t\t\tMaxEndSize = 45.0f,\n\t\t\t\t\tMinColor = new Vector4(1.0f, 1.0f, 1.0f, 0.2f),\n\t\t\t\t\tMaxColor = new Vector4(1.0f, 1.0f, 1.0f, 0.2f),\n\t\t\t\t\tEmitterVelocitySensitivity = 1.0f,\n\t\t\t\t\tBlendState = BlendState.AlphaBlend,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tentity.CannotSuspendByDistance = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tParticleWind wind = entity.GetOrCreate<ParticleWind>(\"Wind\");\n\n\t\t\tParticleEmitter emitter = entity.GetOrCreate<ParticleEmitter>(\"Emitter\");\n\t\t\temitter.Add(new Binding<Vector3>(emitter.Jitter, wind.Jitter));\n\n\t\t\tParticleEmitter windEmitter = entity.GetOrCreate<ParticleEmitter>(\"WindEmitter\");\n\t\t\twindEmitter.Add(new Binding<Vector3>(windEmitter.Jitter, wind.Jitter));\n\n\t\t\tProperty<Vector3> dir = new Property<Vector3>();\n\t\t\ttransform.Add(new Binding<Vector3, Quaternion>(dir, x => Vector3.Transform(Vector3.Down, x), transform.Quaternion));\n\t\t\twind.Add(new Binding<Quaternion>(wind.Orientation, transform.Quaternion));\n\n\t\t\temitter.Add(new Binding<Vector3, float>(emitter.Position, x => new Vector3(0, x * ParticleWind.StartHeightMultiplier, 0), wind.Speed));\n\t\t\twindEmitter.Add(new Binding<Vector3, float>(windEmitter.Position, x => new Vector3(0, x * ParticleWind.StartHeightMultiplier * 2, 0), wind.Speed));\n\n\t\t\temitter.AddParticle = delegate(Vector3 position, Vector3 velocity, float prime)\n\t\t\t{\n\t\t\t\tVector3 kernelCoord = (position + wind.Jitter) / wind.KernelSpacing;\n\t\t\t\tfloat distance = wind.RaycastDistances[Math.Max(0, Math.Min(ParticleWind.KernelSize - 1, (int)kernelCoord.X)), Math.Max(0, Math.Min(ParticleWind.KernelSize - 1, (int)kernelCoord.Z))];\n\t\t\t\tif (distance > 0)\n\t\t\t\t{\n\t\t\t\t\tfloat lifetime = Math.Min(distance / wind.Speed, SnowFactory.MaxLifetime);\n\t\t\t\t\tif (lifetime > prime)\n\t\t\t\t\t\temitter.ParticleSystem.AddParticle(main.Camera.Position + Vector3.Transform(position, transform.Quaternion), dir.Value * wind.Speed.Value, lifetime, -1.0f, prime);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\twindEmitter.AddParticle = delegate(Vector3 position, Vector3 velocity, float prime)\n\t\t\t{\n\t\t\t\tVector3 kernelCoord = (position + wind.Jitter) / wind.KernelSpacing;\n\t\t\t\tfloat distance = wind.RaycastDistances[Math.Max(0, Math.Min(ParticleWind.KernelSize - 1, (int)kernelCoord.X)), Math.Max(0, Math.Min(ParticleWind.KernelSize - 1, (int)kernelCoord.Z))];\n\t\t\t\tif (distance > 0)\n\t\t\t\t{\n\t\t\t\t\tfloat lifetime = Math.Min((distance + ParticleWind.StartHeightMultiplier) / wind.Speed, SnowFactory.MaxWindLifetime);\n\t\t\t\t\tif (lifetime > prime)\n\t\t\t\t\t\twindEmitter.ParticleSystem.AddParticle(main.Camera.Position + Vector3.Transform(position, transform.Quaternion), dir.Value * wind.Speed.Value, lifetime, -1.0f, prime);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.SetMain(entity, main);\n\t\t\temitter.ParticleType.Value = \"Snow\";\n\t\t\twindEmitter.ParticleType.Value = \"Wind\";\n\n\t\t\tentity.Add(\"KernelSpacing\", wind.KernelSpacing);\n\t\t\tentity.Add(\"ParticlesPerSecond\", emitter.ParticlesPerSecond);\n\t\t\tentity.Add(\"WindParticlesPerSecond\", windEmitter.ParticlesPerSecond);\n\t\t\tentity.Add(\"Wind\", wind.Speed);\n\n\t\t\tentity.Add(new PostInitialization(delegate()\n\t\t\t{\n\t\t\t\twind.Update();\n\t\t\t\temitter.Prime(Vector3.Zero);\n\t\t\t\twindEmitter.Prime(Vector3.Zero);\n\t\t\t}));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/SoundBankFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\n\nnamespace Lemma.Factories\n{\n\tpublic class SoundBankFactory : Factory<Main>\n\t{\n\t\tpublic SoundBankFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"SoundBank\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tSoundBank bank = entity.GetOrCreate<SoundBank>(\"SoundBank\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"Name\", bank.Name, new PropertyEntry.EditorData { Options = FileFilter.Get(main, AkBankPath.GetPlatformBasePath(), null, SoundBank.Extension) });\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/SoundFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class SoundFactory : Factory<Main>\n\t{\n\t\tpublic SoundFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Sound\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tSound sound = entity.GetOrCreate<Sound>(\"Sound\");\n\t\t\tsound.Add(new Binding<Vector3>(sound.Position, transform.Position));\n\t\t\tsound.EditorProperties();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/SpinnerFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Paths.PathFollowing;\nusing Lemma.Util;\nusing BEPUphysics;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.SolverGroups;\n\nnamespace Lemma.Factories\n{\n\tpublic class SpinnerFactory : Factory<Main>\n\t{\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Spinner\");\n\n\t\t\tentity.Add(\"MapTransform\", new Transform());\n\t\t\tentity.Add(\"Transform\", new Transform());\n\t\t\tentity.Add(\"Voxel\", new DynamicVoxel(0, 0, 0));\n\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tComponents.Joint joint = entity.GetOrCreate<Components.Joint>(\"Joint\");\n\t\t\tSpinner spinner = entity.GetOrCreate<Spinner>(\"Spinner\");\n\n\t\t\tspinner.Add(new Binding<Direction>(spinner.Direction, joint.Direction));\n\n\t\t\tJointFactory.Bind(entity, main, spinner.CreateJoint, true, creating);\n\t\t\tDynamicVoxel voxel = entity.Get<DynamicVoxel>();\n\t\t\tvoxel.KineticFriction.Value = voxel.StaticFriction.Value = 0;\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t\tspinner.Add(new Binding<Quaternion, Matrix>(spinner.OriginalRotation, x => Quaternion.CreateFromRotationMatrix(x), voxel.Transform));\n\n\t\t\tentity.Add(\"Forward\", spinner.Forward);\n\t\t\tentity.Add(\"Backward\", spinner.Backward);\n\t\t\tentity.Add(\"HitMax\", spinner.HitMax);\n\t\t\tentity.Add(\"HitMin\", spinner.HitMin);\n\t\t\tentity.Add(\"MovementLoop\", spinner.MovementLoop, new PropertyEntry.EditorData { Options = WwisePicker.Get(main) });\n\t\t\tentity.Add(\"MovementStop\", spinner.MovementStop, new PropertyEntry.EditorData { Options = WwisePicker.Get(main) });\n\n\t\t\tentity.Add(\"Direction\", joint.Direction);\n\t\t\tentity.Add(\"Minimum\", spinner.Minimum);\n\t\t\tentity.Add(\"Maximum\", spinner.Maximum);\n\t\t\tentity.Add(\"Locked\", spinner.Locked);\n\t\t\tentity.Add(\"Speed\", spinner.Speed);\n\t\t\tentity.Add(\"Goal\", spinner.Goal);\n\t\t\tentity.Add(\"Servo\", spinner.Servo);\n\t\t\tentity.Add(\"CannotSuspendByDistance\", entity.Get<DynamicVoxel>().CannotSuspendByDistance);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/SplashOutTriggerFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class SplashOutTriggerFactory : Factory<Main>\n\t{\n\t\tpublic SplashOutTriggerFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 1.0f, 0.4f);\n\t\t\tthis.AvailableInRelease = false;\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"SplashOutTrigger\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main, true, false);\n\t\t\tattachable.Enabled.Value = true;\n\n\t\t\tif (!main.EditorEnabled)\n\t\t\t{\n\t\t\t\t// -1 means we're currently submerged, anything above 0 is the timestamp of the last time we were submerged\n\t\t\t\tfloat submerged = -1.0f;\n\t\t\t\tfloat lastEmit = 0.0f;\n\t\t\t\tWater submergedWater = null;\n\t\t\t\tProperty<Vector3> coordinatePos = new Property<Vector3>();\n\t\t\t\tVoxelAttachable.BindTarget(entity, coordinatePos);\n\t\t\t\tAction check = delegate()\n\t\t\t\t{\n\t\t\t\t\tWater nowSubmerged = Water.Get(coordinatePos);\n\t\t\t\t\tif (nowSubmerged == null && main.TotalTime - submerged < 1.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\tEntity ve = attachable.AttachedVoxel.Value.Target;\n\t\t\t\t\t\tif (ve != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel v = ve.Get<Voxel>();\n\t\t\t\t\t\t\tVoxel.Box b = v.GetBox(attachable.Coord);\n\t\t\t\t\t\t\tif (b != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBoundingBox box = new BoundingBox(v.GetRelativePosition(b.X, b.Y, b.Z), v.GetRelativePosition(b.X + b.Width, b.Y + b.Height, b.Z + b.Depth));\n\t\t\t\t\t\t\t\tif (submergedWater != null && main.TotalTime - lastEmit > 0.1f)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tWater.SplashParticles(main, box.Transform(v.Transform), v, submergedWater.Position.Value.Y);\n\t\t\t\t\t\t\t\t\tlastEmit = main.TotalTime;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (nowSubmerged != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tsubmerged = -1.0f;\n\t\t\t\t\t\tsubmergedWater = nowSubmerged;\n\t\t\t\t\t}\n\t\t\t\t\telse if (submerged == -1.0f && nowSubmerged == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tSound.PostEvent(AK.EVENTS.PLAY_WATER_SPLASH_OUT_BIG, transform.Position);\n\t\t\t\t\t\tsubmerged = main.TotalTime;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\ttransform.Add(new NotifyBinding(check, coordinatePos));\n\t\t\t\tentity.Add(new PostInitialization(delegate()\n\t\t\t\t{\n\t\t\t\t\tsubmerged = Water.Get(coordinatePos) != null ? -1.0f : -2.0f;\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\tentity.Add(\"AttachOffset\", attachable.Offset);\n\t\t\tentity.Add(\"AttachVector\", attachable.Vector);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/SpotLightFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class SpotLightFactory : Factory<Main>\n\t{\n\t\tpublic SpotLightFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.8f, 0.8f, 0.8f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"SpotLight\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tSpotLight spotLight = entity.GetOrCreate<SpotLight>(\"SpotLight\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main).EditorProperties();\n\n\t\t\tspotLight.Add(new TwoWayBinding<Vector3>(spotLight.Position, transform.Position));\n\t\t\tspotLight.Add(new TwoWayBinding<Quaternion>(spotLight.Orientation, transform.Quaternion));\n\n\t\t\tentity.Add(\"Cookie\", spotLight.CookieTextureFile, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.Content.RootDirectory, new[] { \"Cookies\" }),\n\t\t\t});\n\t\t\tentity.Add(\"Enable\", spotLight.Enable);\n\t\t\tentity.Add(\"Disable\", spotLight.Disable);\n\t\t\tentity.Add(\"Enabled\", spotLight.Enabled);\n\t\t\tentity.Add(\"Color\", spotLight.Color);\n\t\t\tentity.Add(\"FieldOfView\", spotLight.FieldOfView);\n\t\t\tentity.Add(\"Attenuation\", spotLight.Attenuation);\n\t\t\tentity.Add(\"Shadowed\", spotLight.Shadowed);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\light\";\n\t\t\tProperty<Vector3> color = entity.Get<SpotLight>().Color;\n\t\t\tmodel.Add(new Binding<Vector3>(model.Color, color));\n\t\t\tmodel.Serialize = false;\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\n\t\t\tentity.Add(\"EditorModel\", model);\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, delegate(Matrix x)\n\t\t\t{\n\t\t\t\tx.Forward *= -1;\n\t\t\t\treturn x;\n\t\t\t}, entity.Get<Transform>().Matrix));\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/StarterFactory.cs",
    "content": "﻿using System;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class StarterFactory : Factory<Main>\n\t{\n\t\tpublic StarterFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Starter\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tthis.SetMain(entity, main);\n\t\t\tStarter starter = entity.GetOrCreate<Starter>(\"Starter\");\n\t\t\tentity.CannotSuspendByDistance = true;\n\n\t\t\tentity.Add(\"Command\", starter.Command);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tScriptlike.AttachEditorComponents(entity, main, this.Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/StaticSliderFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Paths.PathFollowing;\nusing Lemma.Util;\nusing BEPUphysics;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.SolverGroups;\n\nnamespace Lemma.Factories\n{\n\tpublic class StaticSliderFactory : VoxelFactory\n\t{\n\t\tpublic override Entity Create(Main main, int offsetX, int offsetY, int offsetZ)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"StaticSlider\");\n\n\t\t\t// The transform has to come before the map component\n\t\t\t// So that its properties get bound correctly\n\t\t\tentity.Add(\"MapTransform\", new Transform());\n\t\t\tentity.Add(\"Transform\", new Transform());\n\t\t\t\n\t\t\tVoxel map = this.newVoxelComponent(offsetX, offsetY, offsetZ);\n\t\t\tentity.Add(\"Voxel\", map);\n\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspendByDistance = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tTransform mapTransform = entity.GetOrCreate<Transform>(\"MapTransform\");\n\t\t\tmapTransform.Selectable.Value = false;\n\t\t\tStaticSlider slider = entity.GetOrCreate<StaticSlider>(\"StaticSlider\");\n\t\t\tFactory.Get<VoxelFactory>().InternalBind(entity, main, creating, mapTransform);\n\t\t\tslider.Add(new TwoWayBinding<Matrix>(mapTransform.Matrix, slider.Transform));\n\t\t\tslider.Add(new Binding<Matrix>(slider.EditorTransform, transform.Matrix));\n\n\t\t\tVoxel voxel = entity.Get<Voxel>();\n\t\t\tslider.Add(new Binding<Vector3>(voxel.LinearVelocity, slider.LinearVelocity));\n\n\t\t\tSound.AttachTracker(entity, voxel.Transform);\n\t\t\tSoundKiller.Add(entity, AK.EVENTS.STOP_ALL_OBJECT);\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t\tentity.Add(new Binding<Matrix>(entity.GetOrCreate<SliderCommon>(\"SliderCommon\").OriginalTransform, voxel.Transform));\n\n\t\t\tentity.Add(\"Forward\", slider.Forward);\n\t\t\tentity.Add(\"Backward\", slider.Backward);\n\t\t\tentity.Add(\"OnHitMax\", slider.OnHitMax);\n\t\t\tentity.Add(\"OnHitMin\", slider.OnHitMin);\n\n\t\t\tentity.Add(\"Direction\", slider.Direction);\n\t\t\tentity.Add(\"Minimum\", slider.Minimum);\n\t\t\tentity.Add(\"Maximum\", slider.Maximum);\n\t\t\tentity.Add(\"Speed\", slider.Speed);\n\t\t\tentity.Add(\"Goal\", slider.Goal);\n\t\t\tentity.Add(\"StartAtMinimum\", slider.StartAtMinimum);\n\t\t\tentity.Add(\"EnablePhysics\", voxel.EnablePhysics);\n\t\t\tentity.Add(\"Position\", slider.Position, new PropertyEntry.EditorData { Readonly = true });\n\t\t\tentity.Add(\"MovementLoop\", slider.MovementLoop, new PropertyEntry.EditorData { Options = WwisePicker.Get(main) });\n\t\t\tentity.Add(\"MovementStop\", slider.MovementStop, new PropertyEntry.EditorData { Options = WwisePicker.Get(main) });\n\n\t\t\tentity.Add(\"UVRotation\", voxel.UVRotation);\n\t\t\tentity.Add(\"UVOffset\", voxel.UVOffset);\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t\tthis.attachEditorComponents(entity, main);\n\t\t}\n\n\t\tprivate void attachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tStaticSlider slider = entity.Get<StaticSlider>();\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"Parent\", slider.Parent);\n\n\t\t\tTransform transform = entity.Get<Transform>(\"Transform\");\n\t\t\tTransform mapTransform = entity.Get<Transform>(\"MapTransform\");\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\cone\";\n\t\t\tmodel.Serialize = false;\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\t\t\tentity.Add(\"DirectionModel\", model);\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, delegate()\n\t\t\t{\n\t\t\t\tMatrix m = Matrix.Identity;\n\t\t\t\tm.Translation = transform.Position;\n\n\t\t\t\tif (slider.Direction == Direction.None)\n\t\t\t\t\tm.Forward = m.Right = m.Up = Vector3.Zero;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tVector3 normal = Vector3.TransformNormal(slider.Direction.Value.GetVector(), mapTransform.Matrix);\n\n\t\t\t\t\tm.Forward = -normal;\n\t\t\t\t\tif (normal.Equals(Vector3.Up))\n\t\t\t\t\t\tm.Right = Vector3.Left;\n\t\t\t\t\telse if (normal.Equals(Vector3.Down))\n\t\t\t\t\t\tm.Right = Vector3.Right;\n\t\t\t\t\telse\n\t\t\t\t\t\tm.Right = Vector3.Normalize(Vector3.Cross(normal, Vector3.Down));\n\t\t\t\t\tm.Up = -Vector3.Cross(normal, m.Left);\n\t\t\t\t}\n\t\t\t\treturn m;\n\t\t\t}, transform.Position, mapTransform.Matrix, slider.Direction));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/SwitchFactory.cs",
    "content": "﻿using System;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class SwitchFactory : Factory<Main>\n\t{\n\t\tpublic SwitchFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Switch\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspendByDistance = true;\n\n\t\t\tPointLight light = entity.GetOrCreate<PointLight>(\"PointLight\");\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\t\t\tattachable.Enabled.Value = true;\n\n\t\t\tlight.Add(new Binding<Vector3>(light.Position, () => Vector3.Transform(new Vector3(0, 0, attachable.Offset), transform.Matrix), attachable.Offset, transform.Matrix));\n\n\t\t\tSwitch sw = entity.GetOrCreate<Switch>(\"Switch\");\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t\tlight.Enabled.Value = true;\n\t\t\telse\n\t\t\t{\n\t\t\t\tlight.Add(new Binding<bool>(light.Enabled, sw.On));\n\t\t\t\tCommandBinding<IEnumerable<Voxel.Coord>, Voxel> cellFilledBinding = null;\n\n\t\t\t\tentity.Add(new NotifyBinding(delegate()\n\t\t\t\t{\n\t\t\t\t\tVoxel m = attachable.AttachedVoxel.Value.Target.Get<Voxel>();\n\t\t\t\t\tif (cellFilledBinding != null)\n\t\t\t\t\t\tentity.Remove(cellFilledBinding);\n\n\t\t\t\t\tcellFilledBinding = new CommandBinding<IEnumerable<Voxel.Coord>, Voxel>(m.CellsFilled, delegate(IEnumerable<Voxel.Coord> coords, Voxel newMap)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (Voxel.Coord c in coords)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (c.Equivalent(attachable.Coord))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsw.On.Value = c.Data == Voxel.States.PoweredSwitch;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tentity.Add(cellFilledBinding);\n\n\t\t\t\t\tsw.On.Value = m[attachable.Coord] == Voxel.States.PoweredSwitch;\n\t\t\t\t}, attachable.AttachedVoxel));\n\t\t\t}\n\n\t\t\tsw.Add(new Binding<Entity.Handle>(sw.AttachedVoxel, attachable.AttachedVoxel));\n\t\t\tsw.Add(new Binding<Voxel.Coord>(sw.Coord, attachable.Coord));\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"AttachOffset\", attachable.Offset);\n\t\t\tentity.Add(\"OnPowerOn\", sw.OnPowerOn);\n\t\t\tentity.Add(\"OnPowerOff\", sw.OnPowerOff);\n\t\t\tentity.Add(\"On\", sw.On, null, true);\n\t\t\tentity.Add(\"PowerOnCue\", sw.PowerOnCue, new PropertyEntry.EditorData { Options = WwisePicker.Get(main) });\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/TargetFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Factories\n{\n\tpublic class TargetFactory : Factory<Main>\n\t{\n\t\tpublic static ListProperty<Transform> Positions = new ListProperty<Transform>();\n\n\t\tpublic TargetFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Target\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tPlayerTrigger trigger = entity.GetOrCreate<PlayerTrigger>(\"Trigger\");\n\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\n\t\t\tbase.Bind(entity, main, creating);\n\n\t\t\tTargetFactory.Positions.Add(transform);\n\t\t\tentity.Add(new CommandBinding(entity.Delete, delegate()\n\t\t\t{\n\t\t\t\tTargetFactory.Positions.Remove(transform);\n\t\t\t}));\n\n\t\t\ttrigger.Add(new Binding<Vector3>(trigger.Position, transform.Position));\n\n\t\t\ttrigger.Add(new CommandBinding(trigger.PlayerEntered, delegate()\n\t\t\t{\n\t\t\t\tentity.Add(new Animation(new Animation.Execute(entity.Delete)));\n\t\t\t}));\n\t\t\ttrigger.Add(new Binding<bool>(trigger.Enabled, transform.Enabled));\n\t\t\ttrigger.EditorProperties();\n\t\t\tattachable.EditorProperties();\n\n\t\t\tentity.Add(\"Enabled\", transform.Enabled);\n\n\t\t\tentity.Add(\"Enable\", transform.Enable);\n\t\t\tentity.Add(\"Disable\", transform.Disable);\n\t\t\tentity.Add(\"Reached\", trigger.PlayerEntered);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tPlayerTrigger.AttachEditorComponents(entity, main, this.Color);\n\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\sphere\";\n\t\t\tmodel.Color.Value = this.Color;\n\t\t\tmodel.Scale.Value = new Vector3(0.5f);\n\t\t\tmodel.Serialize = false;\n\n\t\t\tentity.Add(\"EditorModel3\", model);\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, entity.Get<Transform>().Matrix));\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/TickerFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class TickerFactory : Factory<Main>\n\t{\n\t\tpublic TickerFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 1.0f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Ticker\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspendByDistance = true;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tTicker ticker = entity.GetOrCreate<Ticker>(\"Ticker\");\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"OnFire\", ticker.OnFire);\n\t\t\tentity.Add(\"Disable\", ticker.Disable);\n\t\t\tentity.Add(\"Enable\", ticker.Enable);\n\t\t\tentity.Add(\"Enabled\", ticker.Enabled);\n\t\t\tentity.Add(\"Interval\", ticker.Interval);\n\t\t\tentity.Add(\"NumToFire\", ticker.NumToFire);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tScriptlike.AttachEditorComponents(entity, main, this.Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/TimeTrialFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing Steamworks;\n\nnamespace Lemma.Factories\n{\n\tpublic class TimeTrialFactory : Factory<Main>\n\t{\n\t\tpublic TimeTrialFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"TimeTrial\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tTimeTrial trial = entity.GetOrCreate<TimeTrial>(\"TimeTrial\");\n\t\t\tTimeTrialUI ui = entity.GetOrCreate<TimeTrialUI>(\"UI\");\n\t\t\tthis.SetMain(entity, main);\n\t\t\tentity.Add(\"EndTimeTrial\", trial.Disable);\n\t\t\tentity.Add(\"StartTimeTrial\", trial.Enable);\n\t\t\tui.Add(new Binding<float>(ui.ElapsedTime, trial.ElapsedTime));\n\t\t\tui.Add(new Binding<float>(ui.BestTime, trial.BestTime));\n\t\t\tui.Add(new Binding<string>(ui.NextMap, trial.NextMap));\n\t\t\tui.Add(new CommandBinding(trial.Enable, ui.Show));\n\t\t\tui.Add(new CommandBinding(trial.ShowUI, ui.ShowEnd));\n\n#if STEAMWORKS\n\t\t\tui.Add(new CommandBinding(trial.Proxy.OnLeaderboardError, ui.OnLeaderboardError));\n\t\t\tui.Add(new Binding<bool>(trial.Proxy.PersonaNotification, ui.PersonaNotification));\n\t\t\tui.Add(new CommandBinding<LeaderboardScoresDownloaded_t, LeaderboardScoresDownloaded_t>(trial.Proxy.OnLeaderboardSync, ui.OnLeaderboardSync));\n#endif\n\n\t\t\tui.Add(new CommandBinding(ui.Retry, trial.Retry));\n\n\t\t\tui.Add(new CommandBinding(ui.MainMenu, delegate()\n\t\t\t{\n\t\t\t\tmain.CurrentSave.Value = null;\n\t\t\t\tmain.EditorEnabled.Value = false;\n\t\t\t\tIO.MapLoader.Load(main, Main.MenuMap);\n\t\t\t\tmain.Menu.Show();\n\t\t\t}));\n\n\t\t\tui.Add(new CommandBinding(ui.LoadNextMap, delegate()\n\t\t\t{\n\t\t\t\tstring filenameWithExtension = trial.NextMap;\n\t\t\t\tif (!filenameWithExtension.EndsWith(IO.MapLoader.MapExtension))\n\t\t\t\t\tfilenameWithExtension += IO.MapLoader.MapExtension;\n\n\t\t\t\tstring fullFilename = Path.IsPathRooted(filenameWithExtension) ? filenameWithExtension : Path.GetFullPath(Path.Combine(main.MapDirectory, filenameWithExtension));\n\n\t\t\t\tmain.CurrentSave.Value = null;\n\t\t\t\tmain.EditorEnabled.Value = false;\n\t\t\t\tif (File.Exists(fullFilename))\n\t\t\t\t\tIO.MapLoader.Load(main, fullFilename);\n\t\t\t\telse\n\t\t\t\t{\n#if DEMO\n\t\t\t\t\tmain.Spawner.StartSpawnPoint.Value = \"demo\";\n#endif\n\t\t\t\t\tIO.MapLoader.Load(main, Main.MenuMap);\n\t\t\t\t\tmain.Menu.Show();\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tui.Add(new CommandBinding(ui.Edit, delegate()\n\t\t\t{\n\t\t\t\tmain.CurrentSave.Value = null;\n\t\t\t\tmain.EditorEnabled.Value = true;\n\t\t\t\tIO.MapLoader.Load(main, main.MapFile);\n\t\t\t}));\n\n\t\t\tentity.Add(\"NextMap\", trial.NextMap, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.MapDirectory, new string[] { \"\", \"Challenge\" }, IO.MapLoader.MapExtension),\n\t\t\t});\n\t\t\tentity.Add(\"AllowRespawn\", trial.AllowRespawn);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/TriggerFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class TriggerFactory : Factory<Main>\n\t{\n\t\tpublic TriggerFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 1.0f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Trigger\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tTrigger trigger = entity.GetOrCreate<Trigger>(\"Trigger\");\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main);\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\ttrigger.EditorProperties();\n\t\t\tentity.Add(\"Enable\", trigger.Enable);\n\t\t\tentity.Add(\"Disable\", trigger.Disable);\n\t\t\tentity.Add(\"Entered\", trigger.Entered);\n\t\t\tentity.Add(\"Exited\", trigger.Exited);\n\n\t\t\ttrigger.Add(new TwoWayBinding<Vector3>(transform.Position, trigger.Position));\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tTrigger.AttachEditorComponents(entity, main, this.Color);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"Target\", entity.Get<Trigger>().Target);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/TurretFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Paths.PathFollowing;\nusing Lemma.Util;\nusing BEPUphysics;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\n\nnamespace Lemma.Factories\n{\n\tpublic class TurretFactory : Factory<Main>\n\t{\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Turret\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tSpotLight light = entity.Create<SpotLight>();\n\t\t\tlight.Enabled.Value = !main.EditorEnabled;\n\n\t\t\tlight.FieldOfView.Value = 1.0f;\n\t\t\tlight.Attenuation.Value = 75.0f;\n\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tlight.Add(new Binding<Vector3>(light.Position, transform.Position));\n\n\t\t\tTurret turret = entity.GetOrCreate<Turret>(\"Turret\");\n\n\t\t\tif (!main.EditorEnabled)\n\t\t\t{\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_TURRET_LOOP, entity);\n\t\t\t\tSoundKiller.Add(entity, AK.EVENTS.STOP_TURRET_LOOP);\n\t\t\t}\n\n\t\t\tCommand die = new Command\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_TURRET_DEATH, entity);\n\t\t\t\t\tParticleSystem shatter = ParticleSystem.Get(main, \"InfectedShatter\");\n\t\t\t\t\tRandom random = new Random();\n\t\t\t\t\tfor (int i = 0; i < 50; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 offset = new Vector3((float)random.NextDouble() - 0.5f, (float)random.NextDouble() - 0.5f, (float)random.NextDouble() - 0.5f);\n\t\t\t\t\t\tshatter.AddParticle(transform.Position + offset, offset);\n\t\t\t\t\t}\n\t\t\t\t\tentity.Delete.Execute();\n\t\t\t\t}\n\t\t\t};\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main, true, true, die);\n\t\t\tattachable.Enabled.Value = true;\n\t\t\tattachable.Offset.Value = 2;\n\n\t\t\tPointLight pointLight = entity.GetOrCreate<PointLight>();\n\t\t\tpointLight.Serialize = false;\n\t\t\tpointLight.Add(new Binding<Vector3>(pointLight.Position, transform.Position));\n\n\t\t\tLineDrawer laser = new LineDrawer { Serialize = false };\n\t\t\tentity.Add(laser);\n\t\t\tlaser.DrawOrder.Value = 0;\n\n\t\t\tAI ai = entity.GetOrCreate<AI>(\"AI\");\n\n\t\t\tModelAlpha model = entity.Create<ModelAlpha>();\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, transform.Matrix));\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\pyramid\";\n\n\t\t\tconst float defaultModelScale = 0.75f;\n\t\t\tmodel.Scale.Value = new Vector3(defaultModelScale);\n\n\t\t\tconst float sightDistance = 80.0f;\n\t\t\tconst float hearingDistance = 0.0f;\n\t\t\tconst float operationalRadius = 100.0f;\n\n\t\t\tmodel.Add(new Binding<Vector3, string>(model.Color, delegate(string state)\n\t\t\t{\n\t\t\t\tswitch (state)\n\t\t\t\t{\n\t\t\t\t\tcase \"Alert\":\n\t\t\t\t\t\treturn new Vector3(1.0f, 1.0f, 0.25f);\n\t\t\t\t\tcase \"Aggressive\":\n\t\t\t\t\t\treturn new Vector3(1.0f, 0.5f, 0.25f);\n\t\t\t\t\tcase \"Firing\":\n\t\t\t\t\t\treturn new Vector3(1.0f, 0.0f, 0.0f);\n\t\t\t\t\tcase \"Disabled\":\n\t\t\t\t\t\treturn new Vector3(0.0f, 0.0f, 0.0f);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn new Vector3(1.0f, 1.0f, 1.0f);\n\t\t\t\t}\n\t\t\t}, ai.CurrentState));\n\t\t\tlaser.Add(new Binding<bool, string>(laser.Enabled, x => x != \"Disabled\" && x != \"Suspended\", ai.CurrentState));\n\n\t\t\tlight.Add(new Binding<Vector3>(light.Color, model.Color));\n\t\t\tpointLight.Add(new Binding<Vector3>(pointLight.Color, model.Color));\n\n\t\t\tVoxel.GlobalRaycastResult rayHit = new Voxel.GlobalRaycastResult();\n\t\t\tVector3 toReticle = Vector3.Zero;\n\t\t\tAI.Task checkOperationalRadius = new AI.Task\n\t\t\t{\n\t\t\t\tInterval = 2.0f,\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tbool shouldBeActive = (transform.Position.Value - main.Camera.Position).Length() < operationalRadius && Water.Get(transform.Position) == null;\n\t\t\t\t\tif (shouldBeActive && ai.CurrentState == \"Suspended\")\n\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\telse if (!shouldBeActive && ai.CurrentState != \"Suspended\")\n\t\t\t\t\t\tai.CurrentState.Value = \"Suspended\";\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tturret.Add(new CommandBinding(turret.PowerOn, delegate()\n\t\t\t{\n\t\t\t\tif (ai.CurrentState == \"Disabled\")\n\t\t\t\t{\n\t\t\t\t\tai.CurrentState.Value = \"Suspended\";\n\t\t\t\t\tcheckOperationalRadius.Action();\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tturret.Add(new CommandBinding(turret.PowerOff, delegate()\n\t\t\t{\n\t\t\t\tai.CurrentState.Value = \"Disabled\";\n\t\t\t}));\n\n\t\t\tlight.Add(new Binding<Quaternion>(light.Orientation, delegate()\n\t\t\t{\n\t\t\t\treturn Quaternion.CreateFromYawPitchRoll(-(float)Math.Atan2(toReticle.Z, toReticle.X) - (float)Math.PI * 0.5f, (float)Math.Asin(toReticle.Y), 0);\n\t\t\t}, transform.Position, turret.Reticle));\n\n\t\t\tAI.Task updateRay = new AI.Task\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\ttoReticle = Vector3.Normalize(turret.Reticle.Value - transform.Position.Value);\n\t\t\t\t\trayHit = Voxel.GlobalRaycast(transform.Position, toReticle, operationalRadius);\n\t\t\t\t\tlaser.Lines.Clear();\n\n\t\t\t\t\tMicrosoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(model.Color);\n\t\t\t\t\tlaser.Lines.Add(new LineDrawer.Line\n\t\t\t\t\t{\n\t\t\t\t\t\tA = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(transform.Position, color),\n\t\t\t\t\t\tB = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(rayHit.Position, color),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Disabled\",\n\t\t\t\tTasks = new AI.Task[] { },\n\t\t\t});\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Suspended\",\n\t\t\t\tTasks = new[] { checkOperationalRadius, },\n\t\t\t});\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Idle\",\n\t\t\t\tTasks = new[]\n\t\t\t\t{ \n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tupdateRay,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 1.0f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAgent a = Agent.Query(transform.Position, sightDistance, hearingDistance, x => x.Entity.Type == \"Player\");\n\t\t\t\t\t\t\tif (a != null)\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Alert\",\n\t\t\t\tEnter = delegate(AI.AIState previous)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_TURRET_LOOP, entity);\n\t\t\t\t},\n\t\t\t\tExit = delegate(AI.AIState next)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_TURRET_LOOP, entity);\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{ \n\t\t\t\t\tcheckOperationalRadius,\n\t\t\t\t\tupdateRay,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 1.0f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (ai.TimeInCurrentState > 3.0f)\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tAgent a = Agent.Query(transform.Position, sightDistance, hearingDistance, x => x.Entity.Type == \"Player\");\n\t\t\t\t\t\t\t\tif (a != null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tai.TargetAgent.Value = a.Entity;\n\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Aggressive\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tAI.Task checkTargetAgent = new AI.Task\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tEntity target = ai.TargetAgent.Value.Target;\n\t\t\t\t\tif (target == null || !target.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tai.TargetAgent.Value = null;\n\t\t\t\t\t\tai.CurrentState.Value = \"Idle\";\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tfloat lastSpotted = 0.0f;\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Aggressive\",\n\t\t\t\tExit = delegate(AI.AIState next)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_TURRET_PITCH, 0.0f, entity);\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{\n\t\t\t\t\tcheckTargetAgent,\n\t\t\t\t\tupdateRay,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tEntity target = ai.TargetAgent.Value.Target;\n\t\t\t\t\t\t\tturret.Reticle.Value += (target.Get<Transform>().Position - turret.Reticle.Value) * Math.Min(3.0f * main.ElapsedTime, 1.0f);\n\n\t\t\t\t\t\t\tVector3 targetPos = ai.TargetAgent.Value.Target.Get<Transform>().Position.Value;\n\t\t\t\t\t\t\tVector3 toTarget = Vector3.Normalize(targetPos - transform.Position.Value);\n\n\t\t\t\t\t\t\tfloat angle = (float)Math.Acos(Vector3.Dot(toReticle, toTarget));\n\t\t\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_TURRET_PITCH, ((1.0f - (angle / ((float)Math.PI * 0.5f))) - 0.8f) * (1.0f / 0.2f), entity);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tInterval = 0.1f,\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (Agent.Query(transform.Position, sightDistance, hearingDistance, ai.TargetAgent.Value.Target.Get<Agent>()))\n\t\t\t\t\t\t\t\tlastSpotted = main.TotalTime;\n\n\t\t\t\t\t\t\tif (ai.TimeInCurrentState.Value > 1.5f)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (lastSpotted < main.TotalTime - 2.0f)\n\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Alert\";\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tVector3 targetPos = ai.TargetAgent.Value.Target.Get<Transform>().Position.Value;\n\t\t\t\t\t\t\t\t\tVector3 toTarget = Vector3.Normalize(targetPos - transform.Position.Value);\n\t\t\t\t\t\t\t\t\tif (Vector3.Dot(toReticle, toTarget) > 0.95f)\n\t\t\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Firing\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tai.Add(new AI.AIState\n\t\t\t{\n\t\t\t\tName = \"Firing\",\n\t\t\t\tEnter = delegate(AI.AIState last)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_TURRET_LOOP, entity);\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_TURRET_CHARGE, entity);\n\t\t\t\t},\n\t\t\t\tExit = delegate(AI.AIState next)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_TURRET_LOOP, entity);\n\n\t\t\t\t\tVoxel.State attachedState = attachable.AttachedVoxel.Value.Target.Get<Voxel>()[attachable.Coord];\n\t\t\t\t\tif (!attachedState.Permanent && rayHit.Voxel != null && (rayHit.Position - transform.Position).Length() < 8.0f)\n\t\t\t\t\t\treturn; // Danger close, cease fire!\n\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_TURRET_FIRE, entity);\n\n\t\t\t\t\tbool hitVoxel = true;\n\n\t\t\t\t\tVector3 splashPos;\n\t\t\t\t\tWater w = Water.Raycast(transform.Position, toReticle, rayHit.Distance, out splashPos);\n\t\t\t\t\tif (w != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tSound.PostEvent(AK.EVENTS.PLAY_WATER_SPLASH, splashPos);\n\t\t\t\t\t\tWater.SplashParticles(main, splashPos, 3.0f);\n\t\t\t\t\t}\n\n\t\t\t\t\tEntity target = ai.TargetAgent.Value.Target;\n\t\t\t\t\tif (target != null && target.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 targetPos = target.Get<Transform>().Position;\n\t\t\t\t\t\tVector3 toTarget = targetPos - transform.Position.Value;\n\t\t\t\t\t\tif (Vector3.Dot(toReticle, Vector3.Normalize(toTarget)) > 0.2f)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat distance = toTarget.Length();\n\t\t\t\t\t\t\tif (distance < rayHit.Distance)\n\t\t\t\t\t\t\t\tSound.PostEvent(AK.EVENTS.PLAY_TURRET_MISS, transform.Position + toReticle * distance);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tBEPUutilities.RayHit physicsHit;\n\t\t\t\t\t\tif (target.Get<Player>().Character.Body.CollisionInformation.RayCast(new Ray(transform.Position, toReticle), rayHit.Voxel == null ? float.MaxValue : rayHit.Distance, out physicsHit))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((physicsHit.Location - transform.Position).Length() < 8.0f)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Danger close! Kill the player but don't spawn an explosion\n\t\t\t\t\t\t\t\ttarget.Get<Agent>().Damage.Execute(2.0f);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (w == null || (physicsHit.Location - splashPos).Length() < 8.0f) // Disable explosion if it's in deep water\n\t\t\t\t\t\t\t\tExplosion.Explode(main, targetPos, 6, 8.0f);\n\t\t\t\t\t\t\thitVoxel = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (hitVoxel && rayHit.Voxel != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (w == null || (rayHit.Position - splashPos).Length() < 8.0f) // Disable explosion if it's in deep water\n\t\t\t\t\t\t\tExplosion.Explode(main, rayHit.Position + rayHit.Voxel.GetAbsoluteVector(rayHit.Normal.GetVector()) * 0.5f, 6, 8.0f);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTasks = new[]\n\t\t\t\t{\n\t\t\t\t\tcheckTargetAgent,\n\t\t\t\t\tupdateRay,\n\t\t\t\t\tnew AI.Task\n\t\t\t\t\t{\n\t\t\t\t\t\tAction = delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (ai.TimeInCurrentState.Value > 0.75f)\n\t\t\t\t\t\t\t\tai.CurrentState.Value = \"Aggressive\"; // This actually fires (in the Exit function)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"On\", turret.On);\n\t\t\tentity.Add(\"PowerOn\", turret.PowerOn);\n\t\t\tentity.Add(\"PowerOff\", turret.PowerOff);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/VoxelAttachable.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class VoxelAttachable : Component<Main>\n\t{\n\t\tpublic Property<float> Offset = new Property<float>();\n\t\tpublic Property<Entity.Handle> AttachedVoxel = new Property<Entity.Handle>();\n\t\tpublic Property<Voxel.Coord> Coord = new Property<Voxel.Coord>();\n\t\tpublic Property<Direction> Vector = new Property<Direction> { Value = Direction.PositiveZ };\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> Transform = new Property<Matrix>();\n\n\t\tprivate bool detachIfRemoved;\n\t\tprivate bool detachIfMoved;\n\n\t\t[XmlIgnore]\n\t\tpublic Command Detach = new Command();\n\n\t\tpublic VoxelAttachable()\n\t\t{\n\t\t\tthis.Enabled.Value = false;\n\t\t}\n\n\t\tpublic static VoxelAttachable MakeAttachable(Entity entity, Main main, bool detachIfRemoved = true, bool detachIfMoved = false, Command detachCommand = null)\n\t\t{\n\t\t\tVoxelAttachable attachable = entity.GetOrCreate<VoxelAttachable>(\"VoxelAttachable\");\n\t\t\tattachable.detachIfRemoved = detachIfRemoved;\n\t\t\tattachable.detachIfMoved = detachIfMoved;\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t\treturn attachable;\n\n\t\t\tTransform transform = entity.Get<Transform>();\n\n\t\t\tif (detachCommand == null)\n\t\t\t{\n\t\t\t\tdetachCommand = new Command\n\t\t\t\t{\n\t\t\t\t\tAction = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tentity.Add(new Animation(new Animation.Execute(entity.Delete)));\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\t\n\t\t\tattachable.Add(new CommandBinding(attachable.Detach, detachCommand));\n\t\t\tattachable.Add(new TwoWayBinding<Matrix>(transform.Matrix, attachable.Transform));\n\n\t\t\treturn attachable;\n\t\t}\n\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"AttachOffset\", this.Offset);\n\t\t\tthis.Entity.Add(\"Attach\", this.Enabled);\n\t\t\tthis.Entity.Add(\"AttachVector\", this.Vector);\n\t\t}\n\n\t\tprivate bool isInitialAttachment;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tBinding<Matrix> attachmentBinding = null;\n\t\t\tCommandBinding<IEnumerable<Voxel.Coord>, Voxel> cellEmptiedBinding = null;\n\n\t\t\tthis.isInitialAttachment = this.AttachedVoxel.Value.GUID != 0;\n\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (attachmentBinding != null)\n\t\t\t\t\tthis.Remove(attachmentBinding);\n\n\t\t\t\tif (cellEmptiedBinding != null)\n\t\t\t\t{\n\t\t\t\t\tthis.Remove(cellEmptiedBinding);\n\t\t\t\t\tcellEmptiedBinding = null;\n\t\t\t\t}\n\n\t\t\t\tEntity attachedVoxel = this.AttachedVoxel.Value.Target;\n\t\t\t\tif (attachedVoxel != null && attachedVoxel.Active)\n\t\t\t\t{\n\t\t\t\t\tVoxel m = this.AttachedVoxel.Value.Target.Get<Voxel>();\n\t\t\t\t\tif (m == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t// We're attached to a scenery block\n\t\t\t\t\t\tProperty<Matrix> other = this.AttachedVoxel.Value.Target.Get<Transform>().Matrix;\n\t\t\t\t\t\tMatrix offset = this.Transform * Matrix.Invert(other);\n\t\t\t\t\t\tattachmentBinding = new Binding<Matrix>(this.Transform, x => offset * x, other);\n\t\t\t\t\t\tthis.Add(attachmentBinding);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSliderCommon s = m.Entity.Get<SliderCommon>();\n\t\t\t\t\t\tVector3 pos = Vector3.Transform(this.Vector.Value.GetVector() * this.Offset, this.Transform);\n\t\t\t\t\t\tMatrix voxelTransform;\n\t\t\t\t\t\tif (this.isInitialAttachment)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvoxelTransform = m.Transform;\n\t\t\t\t\t\t\tthis.isInitialAttachment = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (s == null)\n\t\t\t\t\t\t\tvoxelTransform = m.Transform;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tvoxelTransform = s.OriginalTransform;\n\n\t\t\t\t\t\tVector3 relativePos = Vector3.Transform(pos, Matrix.Invert(voxelTransform)) + m.Offset;\n\t\t\t\t\t\tthis.Coord.Value = m.GetCoordinateFromRelative(relativePos);\n\n\t\t\t\t\t\tMatrix offset = this.Transform * Matrix.Invert(Matrix.CreateTranslation(m.Offset) * voxelTransform);\n\n\t\t\t\t\t\tattachmentBinding = new Binding<Matrix>(this.Transform, () => offset * Matrix.CreateTranslation(m.Offset) * m.Transform, m.Transform, m.Offset);\n\t\t\t\t\t\tthis.Add(attachmentBinding);\n\n\t\t\t\t\t\tcellEmptiedBinding = new CommandBinding<IEnumerable<Voxel.Coord>, Voxel>(m.CellsEmptied, delegate(IEnumerable<Voxel.Coord> coords, Voxel newMap)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach (Voxel.Coord c in coords)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (c.Equivalent(this.Coord))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (newMap == null)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (this.detachIfRemoved)\n\t\t\t\t\t\t\t\t\t\t\tthis.Detach.Execute();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if (newMap != m)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (this.detachIfMoved)\n\t\t\t\t\t\t\t\t\t\t\tthis.Detach.Execute();\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tthis.AttachedVoxel.Value = newMap.Entity;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.Add(cellEmptiedBinding);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, this.AttachedVoxel));\n\t\t}\n\n\t\tpublic override void Start()\n\t\t{\n\t\t\tif (this.Enabled && !this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tif (this.AttachedVoxel.Value.Target == null)\n\t\t\t\t{\n\t\t\t\t\tVector3 target = Vector3.Transform(new Vector3(0, 0, this.Offset), this.Transform);\n\n\t\t\t\t\tEntity closestMap = null;\n\t\t\t\t\tfloat closestFloatDistance = 3.0f;\n\n\t\t\t\t\tforeach (SceneryBlock block in SceneryBlock.All)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 pos = block.Entity.Get<Transform>().Position;\n\t\t\t\t\t\tfloat distance = (pos - target).Length();\n\t\t\t\t\t\tif (distance < closestFloatDistance)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclosestFloatDistance = distance;\n\t\t\t\t\t\t\tclosestMap = block.Entity;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tint closestDistance = (int)Math.Floor(closestFloatDistance);\n\t\t\t\t\tforeach (Voxel m in Voxel.Voxels)\n\t\t\t\t\t{\n\t\t\t\t\t\tSliderCommon s = m.Entity.Get<SliderCommon>();\n\t\t\t\t\t\tVector3 relativeTarget = Vector3.Transform(target, Matrix.Invert(s != null ? s.OriginalTransform : m.Transform)) + m.Offset;\n\t\t\t\t\t\tVoxel.Coord targetCoord = m.GetCoordinateFromRelative(relativeTarget);\n\t\t\t\t\t\tVoxel.Coord? c = m.FindClosestFilledCell(targetCoord, closestDistance);\n\t\t\t\t\t\tif (c.HasValue)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat distance = (m.GetRelativePosition(c.Value) - m.GetRelativePosition(targetCoord)).Length();\n\t\t\t\t\t\t\tif (distance < closestFloatDistance)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclosestFloatDistance = distance;\n\t\t\t\t\t\t\t\tclosestDistance = (int)Math.Floor(distance);\n\t\t\t\t\t\t\t\tclosestMap = m.Entity;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (closestMap == null)\n\t\t\t\t\t\tthis.Detach.Execute();\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.AttachedVoxel.Value = closestMap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.AttachedVoxel.Reset();\n\t\t\t}\n\t\t}\n\n\t\tpublic static void BindTarget(Entity entity, Property<Vector3> target)\n\t\t{\n\t\t\tVoxelAttachable attachable = entity.Get<VoxelAttachable>();\n\t\t\tTransform transform = entity.Get<Transform>();\n\t\t\tentity.Add(new Binding<Vector3>(target, () => Vector3.Transform(new Vector3(0, 0, attachable.Offset), transform.Matrix), attachable.Offset, transform.Matrix));\n\t\t}\n\n\t\tpublic static void BindTarget(Entity entity, Property<Matrix> target)\n\t\t{\n\t\t\tVoxelAttachable attachable = entity.Get<VoxelAttachable>();\n\t\t\tTransform transform = entity.Get<Transform>();\n\t\t\tentity.Add(new Binding<Matrix>(target, () => Matrix.CreateTranslation(0, 0, attachable.Offset) * transform.Matrix, attachable.Offset, transform.Matrix));\n\t\t}\n\n\t\tpublic static void AttachEditorComponents(Entity entity, Main main, Property<Vector3> color = null)\n\t\t{\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\cone\";\n\t\t\tif (color != null)\n\t\t\t\tmodel.Add(new Binding<Vector3>(model.Color, color));\n\n\t\t\tVoxelAttachable attachable = entity.GetOrCreate<VoxelAttachable>(\"VoxelAttachable\");\n\n\t\t\tModel editorModel = entity.Get<Model>(\"EditorModel\");\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, () => Editor.EditorModelsVisible && (entity.EditorSelected && attachable.Offset != 0), entity.EditorSelected, attachable.Offset, Editor.EditorModelsVisible));\n\t\t\tmodel.Add(new Binding<Vector3, float>(model.Scale, x => new Vector3(1.0f, 1.0f, x), attachable.Offset));\n\t\t\tmodel.Serialize = false;\n\t\t\tentity.Add(\"EditorModel2\", model);\n\n\t\t\tProperty<Matrix> transform = entity.Get<Transform>().Matrix;\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, delegate()\n\t\t\t{\n\t\t\t\tDirection dir = attachable.Vector;\n\t\t\t\tMatrix m = Matrix.Identity;\n\t\t\t\tm.Translation = transform.Value.Translation;\n\t\t\t\tif (dir == Direction.None)\n\t\t\t\t\tm.Forward = m.Right = m.Up = Vector3.Zero;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tVector3 normal = Vector3.TransformNormal(dir.GetVector(), transform);\n\n\t\t\t\t\tm.Forward = -normal;\n\t\t\t\t\tif (normal.Equals(Vector3.Up))\n\t\t\t\t\t\tm.Right = Vector3.Left;\n\t\t\t\t\telse if (normal.Equals(Vector3.Down))\n\t\t\t\t\t\tm.Right = Vector3.Right;\n\t\t\t\t\telse\n\t\t\t\t\t\tm.Right = Vector3.Normalize(Vector3.Cross(normal, Vector3.Down));\n\t\t\t\t\tm.Up = -Vector3.Cross(normal, m.Left);\n\t\t\t\t}\n\t\t\t\treturn m;\n\t\t\t}, transform, attachable.Vector));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/VoxelFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Lemma.Util;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\n\nnamespace Lemma.Factories\n{\n\tpublic class VoxelFactory : Factory<Main>\n\t{\n\t\tpublic VoxelFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn this.Create(main, 0, 0, 0);\n\t\t}\n\n\t\tpublic virtual Entity Create(Main main, int offsetX, int offsetY, int offsetZ)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"Voxel\");\n\n\t\t\t// The transform has to come before the map component\n\t\t\t// So that its properties get bound correctly\n\t\t\tentity.Add(\"Transform\", new Transform());\n\t\t\t\n\t\t\tVoxel map = this.newVoxelComponent(offsetX, offsetY, offsetZ);\n\t\t\tentity.Add(\"Voxel\", map);\n\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic Entity CreateAndBind(Main main, int offsetX, int offsetY, int offsetZ)\n\t\t{\n\t\t\tEntity entity = this.Create(main, offsetX, offsetY, offsetZ);\n\t\t\tthis.Bind(entity, main, true);\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tthis.InternalBind(entity, main, creating);\n\t\t\tVoxel voxel = entity.Get<Voxel>();\n\t\t\tentity.Add(\"Scale\", voxel.Scale);\n\t\t\tentity.Add(\"EnablePhysics\", voxel.EnablePhysics);\n\t\t\tentity.Add(\"Mutable\", voxel.Mutable);\n\t\t\tentity.Add(\"UVRotation\", voxel.UVRotation);\n\t\t\tentity.Add(\"UVOffset\", voxel.UVOffset);\n\t\t}\n\n\t\tpublic void InternalBind(Entity entity, Main main, bool creating = false, Transform transform = null, bool dataOnly = false)\n\t\t{\n\t\t\tif (transform == null)\n\t\t\t\ttransform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tentity.CannotSuspend = false;\n\n\t\t\tVoxel map = entity.Get<Voxel>();\n\n\t\t\t// Apply the position and orientation components to the map\n\t\t\tif (main.EditorEnabled || map.Scale.Value != 1.0f)\n\t\t\t{\n\t\t\t\tmap.Add(new TwoWayBinding<Matrix, Matrix>\n\t\t\t\t(\n\t\t\t\t\ttransform.Matrix,\n\t\t\t\t\tx => x * Matrix.CreateScale(1.0f / map.Scale),\n\t\t\t\t\tnew IProperty[] { map.Scale },\n\t\t\t\t\tmap.Transform,\n\t\t\t\t\tx => Matrix.CreateScale(map.Scale) * x,\n\t\t\t\t\tnew IProperty[] { map.Scale }\n\t\t\t\t));\n\t\t\t}\n\t\t\telse\n\t\t\t\tmap.Add(new TwoWayBinding<Matrix>(transform.Matrix, map.Transform));\n\n\t\t\tmap.Add(new CommandBinding(map.CompletelyEmptied, delegate()\n\t\t\t{\n\t\t\t\tif (!main.EditorEnabled)\n\t\t\t\t\tentity.Delete.Execute();\n\t\t\t}));\n\n\t\t\tEntity world = main.Get(\"World\").FirstOrDefault();\n\n\t\t\tif (dataOnly && !main.EditorEnabled)\n\t\t\t\tmap.EnablePhysics.Value = false;\n\t\t\telse\n\t\t\t{\n\t\t\t\tmap.CreateModel = delegate(Vector3 min, Vector3 max, Voxel.State state)\n\t\t\t\t{\n\t\t\t\t\tif (state.Invisible && !main.EditorEnabled)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tDynamicModel<Voxel.Vertex> model = new DynamicModel<Voxel.Vertex>(Voxel.Vertex.VertexDeclaration);\n\t\t\t\t\tmodel.MapContent = true;\n\t\t\t\t\tmodel.EffectFile.Value = \"Effects\\\\Environment\";\n\t\t\t\t\tmodel.Lock = new object();\n\t\t\t\t\tstate.ApplyTo(model);\n\n\t\t\t\t\tif (state.Invisible)\n\t\t\t\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\n\t\t\t\t\t/*\n\t\t\t\t\tModelAlpha debug = new ModelAlpha { Serialize = false };\n\t\t\t\t\tdebug.Alpha.Value = 0.01f;\n\t\t\t\t\tdebug.DrawOrder.Value = 11; // In front of water\n\t\t\t\t\tdebug.Color.Value = new Vector3(1.0f, 0.8f, 0.6f);\n\t\t\t\t\tdebug.Filename.Value = \"AlphaModels\\\\box\";\n\t\t\t\t\tdebug.CullBoundingBox.Value = false;\n\t\t\t\t\tdebug.DisableCulling.Value = true;\n\t\t\t\t\tdebug.Add(new Binding<Matrix>(debug.Transform, delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tBoundingBox box = model.BoundingBox;\n\t\t\t\t\t\treturn Matrix.CreateScale(box.Max - box.Min) * Matrix.CreateTranslation((box.Max + box.Min) * 0.5f) * transform.Matrix;\n\t\t\t\t\t}, transform.Matrix, model.BoundingBox));\n\t\t\t\t\tresult.Add(debug);\n\t\t\t\t\t*/\n\n\t\t\t\t\tif (main.EditorEnabled || map.Scale.Value != 1.0f)\n\t\t\t\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, () => Matrix.CreateScale(map.Scale) * transform.Matrix, transform.Matrix, map.Scale));\n\t\t\t\t\telse\n\t\t\t\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, transform.Matrix));\n\n\t\t\t\t\tmodel.Add(new Binding<Vector3>(model.GetVector3Parameter(\"Offset\"), map.Offset));\n\n\t\t\t\t\tVoxel.State s = state;\n\n\t\t\t\t\tmodel.Add(new Binding<Matrix>(model.GetMatrixParameter(\"UVScaleRotation\"), delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tMatrix m = Matrix.CreateRotationZ(map.UVRotation * (float)Math.PI / 180.0f);\n\t\t\t\t\t\tfloat scale = 0.075f * s.Tiling;\n\t\t\t\t\t\tm.M11 *= scale;\n\t\t\t\t\t\tm.M12 *= scale;\n\t\t\t\t\t\tm.M21 *= scale;\n\t\t\t\t\t\tm.M22 *= scale;\n\t\t\t\t\t\treturn m;\n\t\t\t\t\t}, map.UVRotation));\n\n\t\t\t\t\tmodel.Add(new Binding<Vector2>(model.GetVector2Parameter(\"UVOffset\"), x => x * 0.075f * s.Tiling, map.UVOffset));\n\n\t\t\t\t\tif (!s.ShadowCast)\n\t\t\t\t\t\tmodel.UnsupportedTechniques.Add(Technique.Shadow);\n\n\t\t\t\t\tentity.Add(model);\n\n\t\t\t\t\t// We have to create this binding after adding the model to the entity\n\t\t\t\t\t// Because when the model loads, it automatically calculates a bounding box for it.\n\t\t\t\t\tmodel.Add(new Binding<BoundingBox, Vector3>(model.BoundingBox, x => new BoundingBox(min - x, max - x), map.Offset));\n\t\t\t\t\tmodel.CullBoundingBox.Value = true;\n\n\t\t\t\t\treturn model;\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tthis.SetMain(entity, main);\n\t\t\tmap.Offset.Changed();\n\t\t}\n\n\t\tprotected virtual Voxel newVoxelComponent(int offsetX, int offsetY, int offsetZ)\n\t\t{\n\t\t\treturn new Voxel(offsetX, offsetY, offsetZ);\n\t\t}\n\t}\n\n\tpublic class DynamicVoxelFactory : VoxelFactory\n\t{\n\t\tpublic override Entity Create(Main main, int offsetX, int offsetY, int offsetZ)\n\t\t{\n\t\t\tEntity entity = base.Create(main, offsetX, offsetY, offsetZ);\n\t\t\tentity.Type = \"DynamicVoxel\";\n\t\t\treturn entity;\n\t\t}\n\n\t\tprotected override Voxel newVoxelComponent(int offsetX, int offsetY, int offsetZ)\n\t\t{\n\t\t\treturn new DynamicVoxel(offsetX, offsetY, offsetZ);\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tbase.Bind(entity, main, creating);\n\t\t\tDynamicVoxel map = entity.Get<DynamicVoxel>();\n\n\t\t\tentity.Add(\"IsAffectedByGravity\", map.IsAffectedByGravity);\n\t\t\tentity.Add(\"IsAlwaysActive\", map.IsAlwaysActive);\n\t\t\tentity.Add(\"CannotSuspendByDistance\", map.CannotSuspendByDistance);\n\n\t\t\tconst float volumeMultiplier = 0.05f;\n\n\t\t\tfloat lastCollision = 0.0f;\n\t\t\tmap.Add(new CommandBinding<Collidable, ContactCollection>(map.Collided, delegate(Collidable collidable, ContactCollection contacts)\n\t\t\t{\n\t\t\t\tif (map.PhysicsEntity.LinearVelocity.Length() > 3.0f\n\t\t\t\t\t|| map.PhysicsEntity.AngularVelocity.Length() > 1.0f)\n\t\t\t\t{\n\t\t\t\t\tContactInformation contact = contacts[contacts.Count - 1];\n\t\t\t\t\tfloat volume = contact.RelativeVelocity.Length() * volumeMultiplier;\n\t\t\t\t\tfloat now = main.TotalTime;\n\t\t\t\t\tif (volume > 0.2f && now > lastCollision + 0.1f)\n\t\t\t\t\t{\n\t\t\t\t\t\tuint id = Sound.RegisterTemp(contact.Contact.Position);\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PHYSICS_SLAM, id);\n\t\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.PHYSICS_SLAM_SIZE, Math.Min(volume * 100.0f, 100.0f), id);\n\t\t\t\t\t\tAkSoundEngine.UnregisterTemp(id);\n\t\t\t\t\t\tlastCollision = now;\n\t\t\t\t\t\tif (PlayerFactory.Instance != null)\n\t\t\t\t\t\t\tPlayerFactory.Instance.Get<CameraController>().Shake.Execute(contact.Contact.Position, volume);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/VoxelFillFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Paths.PathFollowing;\nusing Lemma.Util;\nusing BEPUphysics;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Constraints.TwoEntity.Motors;\nusing BEPUphysics.Constraints.TwoEntity.Joints;\nusing BEPUphysics.Constraints.SolverGroups;\n\nnamespace Lemma.Factories\n{\n\tpublic class VoxelFillFactory : VoxelFactory\n\t{\n\t\tpublic override Entity Create(Main main, int offsetX, int offsetY, int offsetZ)\n\t\t{\n\t\t\tEntity entity = base.Create(main, offsetX, offsetY, offsetZ);\n\t\t\tentity.Type = \"VoxelFill\";\n\t\t\tentity.Create<VoxelFill>(\"VoxelFill\").Enabled.Value = false;\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform mapTransform = entity.GetOrCreate<Transform>(\"MapTransform\");\n\t\t\tmapTransform.Selectable.Value = false;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tVoxelFill voxelFill = entity.GetOrCreate<VoxelFill>(\"VoxelFill\");\n\t\t\tvoxelFill.Add(new CommandBinding(voxelFill.Delete, entity.Delete));\n\n\t\t\tSound.AttachTracker(entity, voxelFill.RumblePosition);\n\n\t\t\tthis.InternalBind(entity, main, creating, mapTransform, true);\n\n\t\t\tif (main.EditorEnabled)\n\t\t\t{\n\t\t\t\tVoxel voxel = entity.Get<Voxel>();\n\n\t\t\t\tAction refreshMapTransform = delegate()\n\t\t\t\t{\n\t\t\t\t\tEntity parent = voxelFill.Target.Value.Target;\n\t\t\t\t\tif (parent != null && parent.Active)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel staticMap = parent.Get<Voxel>();\n\t\t\t\t\t\tif (staticMap == null)\n\t\t\t\t\t\t\tmapTransform.Matrix.Value = transform.Matrix;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmapTransform.Position.Value = staticMap.GetAbsolutePosition(staticMap.GetRelativePosition(staticMap.GetCoordinate(transform.Matrix.Value.Translation)) - new Vector3(0.5f) + staticMap.Offset + voxel.Offset.Value);\n\t\t\t\t\t\t\tMatrix parentOrientation = staticMap.Transform;\n\t\t\t\t\t\t\tparentOrientation.Translation = Vector3.Zero;\n\t\t\t\t\t\t\tmapTransform.Quaternion.Value = Quaternion.CreateFromRotationMatrix(parentOrientation);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tmapTransform.Matrix.Value = transform.Matrix;\n\t\t\t\t};\n\n\t\t\t\tentity.Add(new NotifyBinding(refreshMapTransform, transform.Matrix, voxel.Offset, voxelFill.Target));\n\t\t\t\trefreshMapTransform();\n\t\t\t}\n\n\t\t\tentity.Add(\"Enabled\", voxelFill.Enabled);\n\t\t\tentity.Add(\"Enable\", voxelFill.Enable);\n\t\t\tentity.Add(\"Disable\", voxelFill.Disable);\n\t\t\tentity.Add(\"IntervalMultiplier\", voxelFill.IntervalMultiplier);\n\t\t\tentity.Add(\"BlockLifetime\", voxelFill.BlockLifetime);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"Target\", entity.Get<VoxelFill>().Target);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/VoxelSetterFactory.cs",
    "content": "﻿using System;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class VoxelSetterFactory : Factory<Main>\n\t{\n\t\tpublic VoxelSetterFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"VoxelSetter\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\t\t\tattachable.Enabled.Value = true;\n\n\t\t\tVoxelSetter voxelSetter = entity.GetOrCreate<VoxelSetter>(\"VoxelSetter\");\n\n\t\t\tvoxelSetter.Add(new Binding<Entity.Handle>(voxelSetter.AttachedVoxel, attachable.AttachedVoxel));\n\t\t\tvoxelSetter.Add(new Binding<Voxel.Coord>(voxelSetter.Coord, attachable.Coord));\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"AttachOffset\", attachable.Offset);\n\t\t\tentity.Add(\"State\", voxelSetter.State);\n\t\t\tentity.Add(\"Contiguous\", voxelSetter.Contiguous);\n\t\t\tentity.Add(\"Set\", voxelSetter.Set);\n\t\t\tentity.Add(\"OnSet\", voxelSetter.OnSet);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/VoxelTriggerFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class VoxelTriggerFactory : Factory<Main>\n\t{\n\t\tpublic VoxelTriggerFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"VoxelTrigger\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspendByDistance = true;\n\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tVoxelAttachable attachable = VoxelAttachable.MakeAttachable(entity, main);\n\t\t\tattachable.Enabled.Value = true;\n\n\t\t\tVoxelTrigger trigger = entity.GetOrCreate<VoxelTrigger>(\"VoxelTrigger\");\n\t\t\ttrigger.Add(new Binding<Voxel.Coord>(trigger.Coord, attachable.Coord));\n\t\t\ttrigger.Add(new Binding<Entity.Handle>(trigger.AttachedVoxel, attachable.AttachedVoxel));\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\ttrigger.EditorProperties();\n\t\t\tentity.Add(\"AttachOffset\", attachable.Offset);\n\t\t\tentity.Add(\"AttachVector\", attachable.Vector);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, entity.Get<Model>().Color);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Factories/WaterFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class WaterFactory : Factory<Main>\n\t{\n\t\tpublic WaterFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.8f, 0.8f, 0.8f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Water\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tWater water = entity.GetOrCreate<Water>(\"Water\");\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\twater.Add(new TwoWayBinding<Vector3>(water.Position, transform.Position));\n\t\t\tentity.Add(\"Color\", water.Color);\n\t\t\tentity.Add(\"UnderwaterColor\", water.UnderwaterColor);\n\t\t\tentity.Add(\"Fresnel\", water.Fresnel);\n\t\t\tentity.Add(\"Speed\", water.Speed);\n\t\t\tentity.Add(\"RippleDensity\", water.RippleDensity);\n\t\t\tentity.Add(\"EnableReflection\", water.EnableReflection);\n\t\t\tentity.Add(\"Distortion\", water.Distortion);\n\t\t\tentity.Add(\"Brightness\", water.Brightness);\n\t\t\tentity.Add(\"Clearness\", water.Clearness);\n\t\t\tentity.Add(\"Depth\", water.Depth);\n\t\t\tentity.Add(\"Refraction\", water.Refraction);\n\t\t\tentity.Add(\"Scale\", water.Scale);\n\t\t\tentity.Add(\"Big\", water.CannotSuspendByDistance);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/WaterfallFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing System.IO;\nusing Lemma.IO;\n\nnamespace Lemma.Factories\n{\n\tpublic class WaterfallFactory : Factory<Main>\n\t{\n\t\tpublic WaterfallFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 1.0f, 0.7f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Waterfall\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tModelAlpha model = entity.GetOrCreate<ModelAlpha>(\"Model\");\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\waterfall\";\n\t\t\tmodel.Distortion.Value = true;\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tVoxelAttachable.MakeAttachable(entity, main).EditorProperties();\n\n\t\t\tentity.Add(\"Scale\", model.Scale);\n\t\t\tentity.Add(\"Color\", model.Color);\n\t\t\tentity.Add(\"Alpha\", model.Alpha);\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, transform.Matrix));\n\n\t\t\tProperty<Vector2> uvScale = model.GetVector2Parameter(\"UVScale\");\n\t\t\tmodel.Add(new Binding<Vector2, Vector3>(uvScale, x => new Vector2(x.X, x.Y), model.Scale));\n\n\t\t\tProperty<Vector3> soundPosition = new Property<Vector3>();\n\t\t\tSound.AttachTracker(entity, soundPosition);\n\n\t\t\tif (!main.EditorEnabled && !model.Suspended)\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_WATERFALL_LOOP, entity);\n\n\t\t\tAction stopSound = delegate()\n\t\t\t{\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_WATERFALL_LOOP, entity);\n\t\t\t};\n\t\t\tmodel.Add(new CommandBinding(model.OnSuspended, stopSound));\n\t\t\tmodel.Add(new CommandBinding(model.Delete, stopSound));\n\t\t\tmodel.Add(new CommandBinding(model.OnResumed, delegate()\n\t\t\t{\n\t\t\t\tif (!main.EditorEnabled)\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_WATERFALL_LOOP, entity);\n\t\t\t}));\n\t\t\t\n\t\t\tProperty<Vector2> offset = model.GetVector2Parameter(\"Offset\");\n\t\t\tUpdater updater = new Updater\n\t\t\t(\n\t\t\t\tdelegate(float dt)\n\t\t\t\t{\n\t\t\t\t\toffset.Value = new Vector2(0, main.TotalTime * -0.6f);\n\t\t\t\t\tVector3 relativeCamera = Vector3.Transform(main.Camera.Position, Matrix.Invert(transform.Matrix));\n\t\t\t\t\tVector3 bounds = model.Scale.Value * 0.5f;\n\t\t\t\t\trelativeCamera.X = MathHelper.Clamp(relativeCamera.X, -bounds.X, bounds.X);\n\t\t\t\t\trelativeCamera.Y = Math.Min(0, relativeCamera.Y);\n\t\t\t\t\trelativeCamera.Z = MathHelper.Clamp(relativeCamera.Z, -bounds.Z, bounds.Z);\n\t\t\t\t\tsoundPosition.Value = Vector3.Transform(relativeCamera, transform.Matrix);\n\t\t\t\t}\n\t\t\t);\n\t\t\tupdater.EnabledInEditMode = true;\n\t\t\tentity.Add(updater);\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tbase.AttachEditorComponents(entity, main);\n\t\t\tModel editorModel = entity.Get<Model>(\"EditorModel\");\n\t\t\teditorModel.Add(new Binding<bool>(editorModel.Enabled, () => Editor.EditorModelsVisible && !entity.EditorSelected, Editor.EditorModelsVisible, entity.EditorSelected));\n\t\t\tVoxelAttachable.AttachEditorComponents(entity, main, editorModel.Color);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/WorldFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing Lemma.Util;\n\nnamespace Lemma.Factories\n{\n\tpublic class WorldFactory : Factory<Main>\n\t{\n\t\tprivate Random random = new Random();\n\n\t\tprivate static Entity instance;\n\n\t\tpublic WorldFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.1f, 0.1f, 0.1f);\n\t\t\tthis.EditorCanSpawn = false;\n\t\t}\n\n\t\tpublic static Entity Instance\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (WorldFactory.instance == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tif (!WorldFactory.instance.Active)\n\t\t\t\t\tWorldFactory.instance = null;\n\n\t\t\t\treturn WorldFactory.instance;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\tEntity entity = new Entity(main, \"World\");\n\t\t\tentity.Add(\"Transform\", new Transform());\n\t\t\treturn entity;\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\t\t\tentity.EditorCanDelete = false;\n\n\t\t\tWorld world = entity.GetOrCreate<World>(\"World\");\n\n\t\t\t// Zone management\n\t\t\tentity.GetOrCreate<Propagator>(\"Propagator\");\n\n\t\t\tthis.SetMain(entity, main);\n\t\t\tWorldFactory.instance = entity;\n\t\t\tAkSoundEngine.DefaultGameObject = entity;\n\n\t\t\tentity.Add(\"OverlayTexture\", world.OverlayTexture, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.Content.RootDirectory, new[] { \"Textures\" }),\n\t\t\t});\n\t\t\tentity.Add(\"OverlayTiling\", world.OverlayTiling);\n\t\t\tentity.Add(\"LightRampTexture\", world.LightRampTexture, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.Content.RootDirectory, new[] { \"LightRamps\" }),\n\t\t\t});\n\t\t\tentity.Add(\"EnvironmentMap\", world.EnvironmentMap, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.Content.RootDirectory, new[] { \"EnvironmentMaps\" }),\n\t\t\t});\n\t\t\tentity.Add(\"EnvironmentColor\", world.EnvironmentColor);\n\t\t\tentity.Add(\"BackgroundColor\", world.BackgroundColor);\n\t\t\tentity.Add(\"FarPlaneDistance\", world.FarPlaneDistance);\n\t\t\tentity.Add(\"Gravity\", world.Gravity);\n\t\t\tentity.Add(\"ThumbnailCamera\", world.ThumbnailCamera);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Factories/ZoneFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Factories\n{\n\tpublic class ZoneFactory : Factory<Main>\n\t{\n\t\tpublic ZoneFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(1.0f, 0.7f, 0.4f);\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Zone\");\n\t\t}\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tentity.CannotSuspend = true;\n\t\t\tentity.CannotSuspendByDistance = true;\n\t\t\tZone zone = entity.GetOrCreate<Zone>(\"Zone\");\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\t\t\tzone.Add(new Binding<Matrix>(zone.Transform, transform.Matrix));\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tentity.Add(\"Exclusive\", zone.Exclusive);\n\t\t\tentity.Add(\"Priority\", zone.Priority);\n\t\t\tentity.Add(\"Build\", zone.Build);\n\t\t\tentity.Add(\"DetailedShadows\", zone.DetailedShadows);\n\t\t\tentity.Add(\"RiftProof\", zone.RiftProof);\n\t\t\tentity.Add(\"Reverb\", zone.Reverb);\n\t\t\tentity.Add(\"CanSpawn\", zone.CanSpawn);\n\t\t}\n\n\t\tprivate Transform addCornerModel(Entity entity, Property<bool> selected)\n\t\t{\n\t\t\tTransform transform = new Transform { Serialize = false };\n\t\t\tentity.AddWithoutOverwriting(transform);\n\n\t\t\tModelAlpha cornerModel1 = new ModelAlpha();\n\t\t\tcornerModel1.Filename.Value = \"AlphaModels\\\\sphere\";\n\t\t\tcornerModel1.Color.Value = this.Color;\n\t\t\tcornerModel1.Scale.Value = new Vector3(0.5f);\n\t\t\tcornerModel1.Serialize = false;\n\t\t\tentity.Add(cornerModel1);\n\n\t\t\tcornerModel1.Add(new Binding<Matrix, Vector3>(cornerModel1.Transform, x => Matrix.CreateTranslation(x), transform.Position));\n\t\t\tcornerModel1.Add(new Binding<bool>(cornerModel1.Enabled, selected));\n\n\t\t\treturn transform;\n\t\t}\n\n\t\tpublic override void AttachEditorComponents(Entity entity, Main main)\n\t\t{\n\t\t\tTransform transform = entity.Get<Transform>();\n\n\t\t\tZone zone = entity.Get<Zone>();\n\n\t\t\tEntityConnectable.AttachEditorComponents(entity, \"ConnectedEntities\", zone.ConnectedEntities);\n\n\t\t\tModelAlpha model = new ModelAlpha();\n\t\t\tmodel.Filename.Value = \"AlphaModels\\\\sphere\";\n\t\t\tmodel.Color.Value = this.Color;\n\t\t\tmodel.Scale.Value = new Vector3(0.5f);\n\t\t\tmodel.Serialize = false;\n\t\t\tentity.Add(\"EditorModel\", model);\n\t\t\tmodel.Add(new Binding<bool>(model.Enabled, Editor.EditorModelsVisible));\n\t\t\tmodel.Add(new Binding<Matrix, Vector3>(model.Transform, x => Matrix.CreateTranslation(x), transform.Position));\n\n\t\t\tProperty<Vector3> corner1 = new Property<Vector3> { Value = zone.BoundingBox.Value.Min };\n\t\t\tProperty<Vector3> corner2 = new Property<Vector3> { Value = zone.BoundingBox.Value.Max };\n\n\t\t\tentity.Add(new Binding<BoundingBox>(zone.BoundingBox, delegate()\n\t\t\t{\n\t\t\t\tVector3 a = corner1, b = corner2;\n\t\t\t\treturn new BoundingBox(new Vector3(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y), Math.Min(a.Z, b.Z)), new Vector3(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y), Math.Max(a.Z, b.Z)));\n\t\t\t}, corner1, corner2));\n\n\t\t\tTransform cornerTransform1 = this.addCornerModel(entity, entity.EditorSelected);\n\t\t\tcornerTransform1.Add(new TwoWayBinding<Vector3, Vector3>\n\t\t\t(\n\t\t\t\tcorner1,\n\t\t\t\tx => Vector3.Transform(x, Matrix.Invert(transform.Matrix)),\n\t\t\t\tnew[] { transform.Matrix },\n\t\t\t\tcornerTransform1.Position,\n\t\t\t\tx => Vector3.Transform(x, transform.Matrix),\n\t\t\t\tnew[] { transform.Matrix }\n\t\t\t));\n\n\t\t\tTransform cornerTransform2 = this.addCornerModel(entity, entity.EditorSelected);\n\t\t\tcornerTransform2.Add(new TwoWayBinding<Vector3, Vector3>\n\t\t\t(\n\t\t\t\tcorner2,\n\t\t\t\tx => Vector3.Transform(x, Matrix.Invert(transform.Matrix)),\n\t\t\t\tnew[] { transform.Matrix },\n\t\t\t\tcornerTransform2.Position,\n\t\t\t\tx => Vector3.Transform(x, transform.Matrix),\n\t\t\t\tnew[] { transform.Matrix }\n\t\t\t));\n\n\t\t\tModelAlpha box = new ModelAlpha();\n\t\t\tbox.Filename.Value = \"AlphaModels\\\\box\";\n\t\t\tbox.Color.Value = new Vector3(this.Color.X, this.Color.Y, this.Color.Z);\n\t\t\tbox.Alpha.Value = 0.125f;\n\t\t\tbox.Serialize = false;\n\t\t\tbox.DrawOrder.Value = 11; // In front of water\n\t\t\tbox.DisableCulling.Value = true;\n\t\t\tentity.Add(box);\n\t\t\tbox.Add(new Binding<Matrix>(box.Transform, delegate()\n\t\t\t{\n\t\t\t\tBoundingBox b = zone.BoundingBox;\n\t\t\t\treturn Matrix.CreateScale(b.Max - b.Min) * Matrix.CreateTranslation((b.Min + b.Max) * 0.5f) * transform.Matrix;\n\t\t\t}, zone.BoundingBox, transform.Matrix));\n\t\t\tbox.Add(new Binding<bool>(box.Enabled, entity.EditorSelected));\n\t\t\tbox.Add(new Binding<BoundingBox>(box.BoundingBox, zone.BoundingBox));\n\t\t\tbox.CullBoundingBox.Value = false;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/GInterfaces/ConsoleUI.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Mime;\nusing System.Text;\nusing GeeUI.ViewLayouts;\nusing GeeUI.Views;\nusing Lemma;\nusing ComponentBind;\nusing Lemma.Components;\nusing Lemma.Console;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Input;\n\nnamespace Lemma.GInterfaces\n{\n\tpublic class ConsoleUI : Component<Main>\n\t{\n\t\tpublic View RootConsoleView;\n\t\tpublic TextFieldView ConsoleLogView;\n\t\tpublic TextFieldView ConsoleInputView;\n\n\t\tpublic static Property<bool> Showing = new Property<bool>();\n\n\t\tprivate Property<bool> _animating = new Property<bool>() { Value = false };\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tif (RootConsoleView == null)\n\t\t\t{\n\t\t\t\tint width = main.ScreenSize.Value.X - 6;\n\t\t\t\tint textBoxWidth = width - 0;\n\t\t\t\tRootConsoleView = new View(main.GeeUI, main.GeeUI.RootView).SetWidth(width + 6).SetHeight(210);\n\t\t\t\tConsoleLogView =\n\t\t\t\t\t(TextFieldView)new TextFieldView(main.GeeUI, RootConsoleView, new Vector2(0, 0)).SetWidth(textBoxWidth)\n\t\t\t\t\t\t.SetHeight(175);\n\t\t\t\tConsoleInputView =\n\t\t\t\t\t(TextFieldView)new TextFieldView(main.GeeUI, RootConsoleView, new Vector2(0, 0)).SetWidth(textBoxWidth).SetHeight((int)(20.0f * this.main.FontMultiplier));\n\t\t\t\tConsoleInputView.Filter = x => x != main.Settings.ToggleConsole.Value.Key;\n\n\t\t\t\tConsoleLogView.Editable = false;\n\t\t\t\tConsoleInputView.OnTextSubmitted = OnTextSubmitted;\n\t\t\t\tConsoleInputView.SubmitOnClickAway = false;\n\t\t\t\tConsoleInputView.MultiLine = false;\n\n\t\t\t\tRootConsoleView.ChildrenLayouts.Add(new VerticalViewLayout(0, false));\n\n\t\t\t\tthis.Add(new NotifyBinding(HandleResize, main.ScreenSize)); //Supercool~\n\t\t\t\tthis.Add(new NotifyBinding(HandleToggle, Showing));\n\n\t\t\t\tthis.main.GeeUI.OnKeyPressedHandler += this.keyPressedHandler;\n\t\t\t}\n\t\t\tShowing.Value = false;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tthis.main.GeeUI.OnKeyPressedHandler -= this.keyPressedHandler;\n\t\t}\n\n\t\tprivate int historyIndex = -1;\n\t\tprivate void keyPressedHandler(string keyPressed, Keys key)\n\t\t{\n\t\t\tif (Showing)\n\t\t\t{\n\t\t\t\tConsole.Console console = Console.Console.Instance;\n\t\t\t\tif (console.History.Count > 0)\n\t\t\t\t{\n\t\t\t\t\tbool doHistory = false;\n\t\t\t\t\tif (key == Keys.Down)\n\t\t\t\t\t{\n\t\t\t\t\t\tdoHistory = true;\n\t\t\t\t\t\tif (this.historyIndex == -1)\n\t\t\t\t\t\t\tthis.historyIndex = 0;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthis.historyIndex++;\n\t\t\t\t\t}\n\t\t\t\t\telse if (key == Keys.Up)\n\t\t\t\t\t{\n\t\t\t\t\t\tdoHistory = true;\n\t\t\t\t\t\tif (this.historyIndex == -1)\n\t\t\t\t\t\t\tthis.historyIndex = console.History.Count - 1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthis.historyIndex--;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (doHistory)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.historyIndex >= console.History.Count)\n\t\t\t\t\t\t\tthis.historyIndex = 0;\n\t\t\t\t\t\telse if (this.historyIndex < 0)\n\t\t\t\t\t\t\tthis.historyIndex = console.History.Count - 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\tConsoleInputView.Text = console.History[this.historyIndex];\n\t\t\t\t\t\tConsoleInputView.SetCursorPos(ConsoleInputView.Text.Length, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void OnTextSubmitted()\n\t\t{\n\t\t\tthis.historyIndex = -1;\n\t\t\tmain.Console.ConsoleUserInput(ConsoleInputView.Text);\n\t\t\tConsoleInputView.ClearText();\n\t\t}\n\n\t\tpublic void LogText(string text)\n\t\t{\n\t\t\tif (ConsoleLogView.Text.Length != 0)\n\t\t\t\tConsoleLogView.AppendText(\"\\n\");\n\t\t\tConsoleLogView.AppendText(text);\n\t\t\tint newY = ConsoleLogView.TextLines.Length - 1;\n\t\t\tConsoleLogView.SetCursorPos(0, newY);\n\t\t}\n\n\t\tpublic void HandleToggle()\n\t\t{\n\t\t\tif (_animating.Value)\n\t\t\t\treturn;\n\n\t\t\tfloat scrollTime = 0.15f;\n\t\t\tfloat fadeTime = 0.1f;\n\t\t\t_animating.Value = true;\n\t\t\t//RootConsoleView.Active.Value = ConsoleLogView.Active.Value = ConsoleInputView.Active.Value = ConsoleInputView.Selected.Value = Showing.Value;\n\t\t\tif (Showing.Value)\n\t\t\t{\n\t\t\t\tmain.AddComponent(new Animation(\n\t\t\t\t\tnew Animation.Set<bool>(RootConsoleView.Active, true),\n\t\t\t\t\tnew Animation.Set<bool>(ConsoleLogView.Active, true),\n\t\t\t\t\tnew Animation.Set<bool>(ConsoleInputView.Active, true),\n\t\t\t\t\tnew Animation.Set<bool>(ConsoleInputView.Selected, true),\n\t\t\t\t\tnew Animation.Parallel(\n\t\t\t\t\t\t\tnew Animation.FloatMoveTo(RootConsoleView.MyOpacity, 1.0f, fadeTime),\n\t\t\t\t\t\t\tnew Animation.Vector2MoveTo(RootConsoleView.Position, new Vector2(0, 0), scrollTime)\n\t\t\t\t\t),\n\t\t\t\t\tnew Animation.Set<bool>(_animating, false)\n\t\t\t\t\t));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmain.AddComponent(new Animation(\n\t\t\t\t\t\tnew Animation.Parallel(\n\t\t\t\t\t\t\tnew Animation.FloatMoveTo(RootConsoleView.MyOpacity, 0.0f, fadeTime),\n\t\t\t\t\t\t\tnew Animation.Vector2MoveTo(RootConsoleView.Position, new Vector2(0, -RootConsoleView.Height), scrollTime)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnew Animation.Set<bool>(RootConsoleView.Active, false),\n\t\t\t\t\t\tnew Animation.Set<bool>(ConsoleLogView.Active, false),\n\t\t\t\t\t\tnew Animation.Set<bool>(ConsoleInputView.Active, false),\n\t\t\t\t\t\tnew Animation.Set<bool>(ConsoleInputView.Selected, false),\n\t\t\t\t\t\tnew Animation.Set<bool>(_animating, false)\n\t\t\t\t\t));\n\n\t\t\t}\n\t\t}\n\n\t\tpublic void HandleResize()\n\t\t{\n\t\t\tint width = main.ScreenSize.Value.X - 6;\n\t\t\tint textBoxWidth = width - 0;\n\n\t\t\tRootConsoleView.Width.Value = width;\n\t\t\tConsoleLogView.Width.Value = ConsoleInputView.Width.Value = textBoxWidth;\n\n\t\t\tint newY = ConsoleLogView.TextLines.Length - 1;\n\t\t\tConsoleLogView.SetCursorPos(0, newY);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GInterfaces/TextPrompt.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Security.Cryptography;\nusing System.Text;\nusing ComponentBind;\nusing GeeUI.Views;\nusing ICSharpCode.SharpZipLib.Tar;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Input;\nusing Point = Microsoft.Xna.Framework.Point;\nusing View = GeeUI.Views.View;\n\nnamespace Lemma.GInterfaces\n{\n\tpublic class TextPrompt : Component<Main>\n\t{\n\t\tprivate View EncompassingView;\n\t\tprivate PanelView MainView;\n\t\tprivate TextFieldView Text;\n\n\t\tprivate ButtonView Okay;\n\t\tprivate ButtonView Cancel;\n\n\t\tprivate string label;\n\t\tprivate string defaultText;\n\t\tprivate string action;\n\t\tprivate Action<string> callback;\n\n\t\tpublic TextPrompt(Action<string> callback, string defaultText = \"\", string label = \"\", string action = \"Okay\")\n\t\t{\n\t\t\tthis.defaultText = defaultText;\n\t\t\tthis.label = label;\n\t\t\tthis.callback = callback;\n\t\t\tthis.action = action;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\t// This is to make it so nothing else can be interacted with.\n\t\t\tthis.EncompassingView = new View(this.main.GeeUI, this.main.GeeUI.RootView);\n\t\t\tthis.MainView = new PanelView(this.main.GeeUI, this.EncompassingView, Vector2.Zero);\n\t\t\tMainView.Resizeable = false;\n\t\t\tMainView.AnchorPoint.Value = new Vector2(0.5f, 0.5f);\n\t\t\tMainView.Width.Value = 400;\n\t\t\tMainView.Height.Value = 100;\n\n\t\t\tthis.EncompassingView.Add(new Binding<int, Point>(EncompassingView.Height, (p) => p.Y, main.ScreenSize));\n\t\t\tthis.EncompassingView.Add(new Binding<int, Point>(EncompassingView.Width, (p) => p.X, main.ScreenSize));\n\t\t\tthis.MainView.Add(new Binding<Vector2, int>(MainView.Position, i => new Vector2(i / 2f, MainView.Y), EncompassingView.Width));\n\t\t\tthis.MainView.Add(new Binding<Vector2, int>(MainView.Position, i => new Vector2(MainView.X, i / 2f), EncompassingView.Height));\n\n\t\t\tnew TextView(this.main.GeeUI, this.MainView, this.label, new Vector2(10, 8));\n\t\t\tthis.Text = new TextFieldView(this.main.GeeUI, this.MainView, new Vector2(10, 25)) { MultiLine = false, };\n\t\t\tthis.Text.Height.Value = 20;\n\t\t\tthis.Text.Width.Value = 340;\n\t\t\tthis.Text.Text = this.defaultText;\n\t\t\tthis.Text.Selected.Value = true;\n\n\t\t\tthis.Okay = new ButtonView(main.GeeUI, MainView, this.action, new Vector2(50, 60));\n\t\t\tthis.Cancel = new ButtonView(main.GeeUI, MainView, \"Cancel\", new Vector2(300, 60));\n\n\t\t\tthis.Okay.OnMouseClick += (sender, args) =>\n\t\t\t{\n\t\t\t\tthis.Go();\n\t\t\t};\n\n\t\t\tthis.Cancel.OnMouseClick += (sender, args) =>\n\t\t\t{\n\t\t\t\tthis.Delete.Execute();\n\t\t\t};\n\n\t\t\tbase.Awake();\n\n\t\t\tthis.Text.ParentGeeUI.OnKeyPressedHandler += this.keyHandler;\n\t\t}\n\n\t\tprivate void keyHandler(string keyPressed, Keys key)\n\t\t{\n\t\t\tif (this.Text.Selected && key == Keys.Enter)\n\t\t\t\tthis.Go();\n\t\t}\n\n\t\tpublic void Go()\n\t\t{\n\t\t\tif (this.callback != null)\n\t\t\t\tthis.callback(this.Text.Text);\n\t\t\tthis.Delete.Execute();\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tthis.Text.ParentGeeUI.OnKeyPressedHandler -= this.keyHandler;\n\t\t\tthis.EncompassingView.RemoveFromParent();\n\t\t\tbase.delete();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GInterfaces/WorkShopInterface.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.IO;\nusing System.Security.Cryptography;\nusing System.Text;\nusing System.Windows.Forms;\nusing ComponentBind;\nusing GeeUI.Views;\nusing ICSharpCode.SharpZipLib.Tar;\nusing Lemma.Components;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Steamworks;\nusing Point = Microsoft.Xna.Framework.Point;\nusing View = GeeUI.Views.View;\n\nnamespace Lemma.GInterfaces\n{\n\tpublic class WorkShopInterface : Component<Main>\n\t{\n\t\tprivate View EncompassingView;\n\t\tprivate PanelView MainView;\n\t\tprivate TextFieldView NameView;\n\t\tprivate TextFieldView DescriptionView;\n\t\t\n\t\tprivate DropDownView SelectFile;\n\n\t\tprivate SteamUGCDetails_t currentPublishedFile;\n\n\t\tprivate ButtonView UploadButton;\n\t\tprivate ButtonView CloseButton;\n\n\t\tprivate Property<string> StatusString = new Property<string>() { Value = \"\" };\n\n\t\tprivate CallResult<RemoteStorageFileShareResult_t> fileShareResult;\n\t\tprivate CallResult<RemoteStoragePublishFileResult_t> filePublishResult;\n\t\tprivate CallResult<RemoteStorageUpdatePublishedFileResult_t> fileUpdateResult;\n\t\tprivate CallResult<SteamUGCQueryCompleted_t> queryResult;\n\n\t\tprivate Editor editor;\n\t\tpublic WorkShopInterface(Editor e)\n\t\t{\n\t\t\tthis.editor = e;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\t// This is to make it so nothing else can be interacted with.\n\t\t\tthis.EncompassingView = new View(main.GeeUI, main.GeeUI.RootView);\n\t\t\tthis.MainView = new PanelView(main.GeeUI, EncompassingView, Vector2.Zero);\n\t\t\tthis.MainView.Resizeable = false;\n\t\t\tthis.MainView.AnchorPoint.Value = new Vector2(0.5f, 0.5f);\n\t\t\tthis.MainView.Width.Value = 400;\n\t\t\tthis.MainView.Height.Value = 400;\n\t\t\tthis.MainView.Add(new Binding<bool>(this.MainView.Active, Editor.EditorModelsVisible));\n\n\t\t\tthis.EncompassingView.Add(new Binding<int, Point>(EncompassingView.Height, (p) => p.Y, main.ScreenSize));\n\t\t\tthis.EncompassingView.Add(new Binding<int, Point>(EncompassingView.Width, (p) => p.X, main.ScreenSize));\n\t\t\tthis.MainView.Add(new Binding<Vector2, int>(MainView.Position, i => new Vector2(i / 2f, MainView.Y), EncompassingView.Width));\n\t\t\tthis.MainView.Add(new Binding<Vector2, int>(MainView.Position, i => new Vector2(MainView.X, i / 2f), EncompassingView.Height));\n\n\t\t\tnew TextView(main.GeeUI, MainView, \"Workshop entry:\", new Vector2(10, 8));\n\t\t\tthis.SelectFile = new DropDownView(main.GeeUI, MainView, new Vector2(10, 35));\n\t\t\tSelectFile.AddOption(\"[Fetching...]\", null);\n\t\t\tthis.SelectFile.Position.Value = new Vector2(10, 30);\n\n\t\t\tthis.queryResult = SteamWorker.GetCreatedWorkShopEntries((entries) =>\n\t\t\t{\n\t\t\t\tSelectFile.RemoveAllOptions();\n\t\t\t\tSelectFile.AddOption(\"[new]\", delegate()\n\t\t\t\t{\n\t\t\t\t\tthis.currentPublishedFile = default(SteamUGCDetails_t);\n\t\t\t\t\tthis.UploadButton.Text = \"Publish\";\n\t\t\t\t\tthis.UploadButton.AllowMouseEvents.Value = true;\n\t\t\t\t\tthis.CloseButton.AllowMouseEvents.Value = true;\n\t\t\t\t});\n\t\t\t\tvar listEntries = entries as List<SteamUGCDetails_t>;\n\t\t\t\tif (listEntries == null)\n\t\t\t\t{\n\t\t\t\t\tSelectFile.AddOption(\"[Error fetching entries]\", null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tforeach (var entry in listEntries)\n\t\t\t\t{\n\t\t\t\t\tSteamUGCDetails_t entry1 = entry;\n\t\t\t\t\tSelectFile.AddOption(entry.m_rgchTitle, () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.currentPublishedFile = entry1;\n\t\t\t\t\t\tthis.NameView.Text = entry1.m_rgchTitle;\n\t\t\t\t\t\tthis.DescriptionView.Text = entry1.m_rgchDescription;\n\t\t\t\t\t\tthis.UploadButton.Text = \"Update\";\n\t\t\t\t\t\tthis.UploadButton.AllowMouseEvents.Value = true;\n\t\t\t\t\t\tthis.CloseButton.AllowMouseEvents.Value = true;\n\t\t\t\t\t}, related:entry);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tnew TextView(main.GeeUI, MainView, \"Name:\", new Vector2(10, 68));\n\t\t\tthis.NameView = new TextFieldView(main.GeeUI, MainView, new Vector2(10, 85)) { MultiLine = false };\n\t\t\tnew TextView(main.GeeUI, MainView, \"Description:\", new Vector2(10, 118));\n\t\t\tthis.DescriptionView = new TextFieldView(main.GeeUI, MainView, new Vector2(10, 135));\n\n\t\t\tthis.UploadButton = new ButtonView(main.GeeUI, MainView, \"Publish\", new Vector2(50, 360));\n\t\t\tthis.CloseButton = new ButtonView(main.GeeUI, MainView, \"Close\", new Vector2(300, 360));\n\n\t\t\tvar statusString = new TextView(main.GeeUI, MainView, \"Waiting\", new Vector2(110, 345))\n\t\t\t{\n\t\t\t\tTextJustification = TextJustification.Center,\n\t\t\t};\n\n\t\t\tstatusString.AutoSize.Value = false;\n\t\t\tstatusString.Width.Value = 190;\n\n\t\t\tConfigureTextField(NameView);\n\t\t\tConfigureTextField(DescriptionView);\n\n\t\t\tUploadButton.OnMouseClick += (sender, args) =>\n\t\t\t{\n\t\t\t\tLog.d(\"ok\");\n\t\t\t\tWorldFactory.Instance.Get<World>().NewUUID();\n\t\t\t\tthis.editor.SaveWithCallback(this.upload);\n\t\t\t};\n\n\t\t\tCloseButton.OnMouseClick += (sender, args) =>\n\t\t\t{\n\t\t\t\tthis.Delete.Execute();\n\t\t\t};\n\n\t\t\tthis.Add(new Binding<string>(statusString.Text, StatusString));\n\n\t\t\tbase.Awake();\n\t\t}\n\n\t\tprivate void upload()\n\t\t{\n\t\t\tif (NameView.Text.Trim().Length == 0 || DescriptionView.Text.Trim().Length == 0)\n\t\t\t\treturn;\n\n\t\t\tCloseButton.AllowMouseEvents.Value = UploadButton.AllowMouseEvents.Value = false;\n\n\t\t\tstring filePath = this.main.GetFullMapPath();\n\t\t\tstring imagePath = string.Format(\"{0}.png\", filePath.Substring(0, filePath.LastIndexOf('.')));\n\t\t\tstring description = DescriptionView.Text;\n\t\t\tstring name = NameView.Text;\n\n\t\t\tstring steamFilePath = string.Format(\"workshop/maps/{0}.map\", MD5(filePath));\n\t\t\tstring steamImagePath = string.Format(\"workshop/maps/{0}.png\", MD5(imagePath));\n\n\t\t\tStatusString.Value = \"Storing map...\";\n\t\t\tif (SteamWorker.WriteFileUGC(filePath, steamFilePath))\n\t\t\t{\n\t\t\t\tStatusString.Value = \"Storing image...\";\n\t\t\t\tif (!SteamWorker.WriteFileUGC(imagePath, steamImagePath))\n\t\t\t\t{\n\t\t\t\t\tStatusString.Value = \"Failed to store image.\";\n\t\t\t\t\tCloseButton.AllowMouseEvents.Value = UploadButton.AllowMouseEvents.Value = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tCloseButton.AllowMouseEvents.Value = UploadButton.AllowMouseEvents.Value = true;\n\t\t\t\tStatusString.Value = \"Failed to store map.\";\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tStatusString.Value = \"Uploading map...\";\n\t\t\tthis.fileShareResult = SteamWorker.ShareFileUGC(steamFilePath, (b, t) =>\n\t\t\t{\n\t\t\t\tif (b)\n\t\t\t\t{\n\t\t\t\t\tStatusString.Value = \"Uploading image...\";\n\t\t\t\t\tthis.fileShareResult = SteamWorker.ShareFileUGC(steamImagePath, (b1, handleT) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (b1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tStatusString.Value = \"Finalizing Entry...\";\n\t\t\t\t\t\t\tif (string.IsNullOrEmpty(this.currentPublishedFile.m_pchFileName))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Upload new\n\t\t\t\t\t\t\t\tthis.filePublishResult = SteamWorker.UploadWorkShop(steamFilePath, steamImagePath, name, description, (publishSuccess, needsAcceptEULA, publishedFile) =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (publishSuccess)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStatusString.Value = \"Entry created!\";\n\t\t\t\t\t\t\t\t\t\tDescriptionView.ClearText();\n\t\t\t\t\t\t\t\t\t\tNameView.ClearText();\n\t\t\t\t\t\t\t\t\t\tCloseButton.AllowMouseEvents.Value = UploadButton.AllowMouseEvents.Value = true;\n\t\t\t\t\t\t\t\t\t\tSteamWorker.SetAchievement(\"cheevo_level_editor\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStatusString.Value = \"Publish failed.\";\n\t\t\t\t\t\t\t\t\t\tCloseButton.AllowMouseEvents.Value = UploadButton.AllowMouseEvents.Value = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Update existing\n\t\t\t\t\t\t\t\tthis.fileUpdateResult = SteamWorker.UpdateWorkshopMap(currentPublishedFile.m_nPublishedFileId, steamFilePath, steamImagePath, name, description, publishSuccess =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (publishSuccess)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStatusString.Value = \"Entry updated!\";\n\t\t\t\t\t\t\t\t\t\tCloseButton.AllowMouseEvents.Value = UploadButton.AllowMouseEvents.Value = true;\n\t\t\t\t\t\t\t\t\t\tSteamRemoteStorage.FileDelete(this.currentPublishedFile.m_pchFileName);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStatusString.Value = \"Update failed.\";\n\t\t\t\t\t\t\t\t\t\tCloseButton.AllowMouseEvents.Value = UploadButton.AllowMouseEvents.Value = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tStatusString.Value = \"Failed to upload image.\";\n\t\t\t\t\t\t\tCloseButton.AllowMouseEvents.Value = UploadButton.AllowMouseEvents.Value = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tStatusString.Value = \"Failed to upload map.\";\n\t\t\t\t\tCloseButton.AllowMouseEvents.Value = UploadButton.AllowMouseEvents.Value = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tprivate void ConfigureTextField(TextFieldView view)\n\t\t{\n\t\t\tbool multiLine = view.MultiLine;\n\t\t\tview.Width.Value = multiLine ? 380 : 340;\n\t\t\tview.Height.Value = multiLine ? 180 : 20;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tEncompassingView.RemoveFromParent();\n\t\t\tbase.delete();\n\t\t}\n\n\t\tpublic string MD5(string filePath)\n\t\t{\n\t\t\t// step 1, calculate MD5 hash from input\n\t\t\tMD5 md5 = System.Security.Cryptography.MD5.Create();\n\t\t\tbyte[] inputBytes = File.ReadAllBytes(filePath);\n\t\t\tbyte[] hash = md5.ComputeHash(inputBytes);\n\n\t\t\t// step 2, convert byte array to hex string\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int i = 0; i < hash.Length; i++)\n\t\t\t\tsb.Append(hash[i].ToString(\"X2\"));\n\t\t\treturn sb.ToString();\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/GeeUI/Composites/ToolTip.cs",
    "content": "﻿\nusing ComponentBind;\nusing GeeUI;\nusing GeeUI.Managers;\nusing GeeUI.Structs;\nusing GeeUI.ViewLayouts;\nusing GeeUI.Views;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma.GeeUI.Composites\n{\n\tpublic class ToolTip : View\n\t{\n\t\tprivate NinePatch Patch;\n\t\tprivate TextView TextView;\n\t\tprivate View realParent;\n\n\t\tpublic Property<string> ToolTipText = new Property<string>();\n\n\t\tprivate const int ChildrenPadding = 4;\n\n\t\tpublic override Rectangle BoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Rectangle((int)RealPosition.X, (int)RealPosition.Y, Width + (ChildrenPadding * 2) + Patch.LeftWidth + Patch.RightWidth, Height + (ChildrenPadding * 2) + Patch.TopHeight + Patch.BottomHeight);\n\t\t\t}\n\t\t}\n\n\t\tpublic override Rectangle ContentBoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Rectangle((int)RealPosition.X + Patch.LeftWidth + ChildrenPadding, (int)RealPosition.Y + Patch.TopHeight + ChildrenPadding, Width, Height);\n\t\t\t}\n\t\t}\n\n\n\n\t\tpublic ToolTip(GeeUIMain theGeeUI, View parentView, View linkedTo, string text)\n\t\t\t: base(theGeeUI, parentView)\n\t\t{\n\t\t\tthis.Patch = GeeUIMain.NinePatchPanelUnselected;\n\n\t\t\tToolTipText.Value = text;\n\t\t\tTextView = new TextView(theGeeUI, this, text, Vector2.Zero);\n\t\t\tthis.ChildrenLayouts.Add(new ExpandToFitLayout());\n\t\t\tthis.ChildrenLayouts.Add(new VerticalViewLayout(0, false));\n\n\t\t\tthis.realParent = linkedTo;\n\n\t\t\tif (this.realParent != null)\n\t\t\t\tthis.Add(new NotifyBinding(this.CheckActive, this.realParent.Active, this.realParent.Attached));\n\t\t\t\n\t\t\tthis.Add(new NotifyBinding(this.CheckActive, this.Active));\n\n\t\t\tthis.AnchorPoint.Value = new Vector2(0f, 1f);\n\t\t\tthis.Position.Value = InputManager.GetMousePosV();\n\n\t\t\tthis.Add(new NotifyBinding(CheckActive, this.Active, realParent.Active));\n\t\t\tthis.AnimateIn();\n\t\t}\n\n\t\tprivate void CheckActive()\n\t\t{\n\t\t\tif (realParent == null || !realParent.Active || !realParent.Attached || !this.Active)\n\t\t\t{\n\t\t\t\tif (this.Active)\n\t\t\t\t\tthis.Active.Value = false;\n\t\t\t\tthis.RemoveFromParent();\n\t\t\t}\n\t\t}\n\n\t\tprivate void AnimateIn()\n\t\t{\n\t\t\tthis.Active.Value = true;\n\t\t}\n\n\t\tpublic override void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\tPatch.Draw(spriteBatch, AbsolutePosition, Width, Height, 0f, EffectiveOpacity);\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/GeeUIMain.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing ComponentBind;\nusing Lemma;\nusing Lemma.Components;\nusing Lemma.GeeUI;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Input;\nusing GeeUI.Views;\nusing GeeUI.Structs;\nusing GeeUI.Managers;\nusing System.Linq;\n\nnamespace GeeUI\n{\n\tpublic delegate void OnKeyPressed(string keyPressed, Keys key);\n\tpublic delegate void OnKeyReleased(string keyReleased, Keys key);\n\tpublic delegate void OnKeyContinuallyPressed(string keyContinuallyPressed, Keys key);\n\n\tpublic class GeeUIMain : Component<Main>, IGraphicsComponent\n\t{\n\t\t// HACK\n\t\tpublic Main Main\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.main;\n\t\t\t}\n\t\t}\n\n\t\tpublic event OnKeyPressed OnKeyPressedHandler;\n\t\tpublic event OnKeyReleased OnKeyReleasedHandler;\n\t\tpublic event OnKeyContinuallyPressed OnKeyContinuallyPressedHandler;\n\n\t\tpublic static Texture2D White;\n\t\tpublic static Effect CircleShader;\n\n\t\tpublic View RootView;\n\n\t\tpublic Color TextColorDefault = Color.Black;\n\n\t\tpublic static NinePatch NinePatchTextFieldDefault = new NinePatch();\n\t\tpublic static NinePatch NinePatchTextFieldSelected = new NinePatch();\n\t\tpublic static NinePatch NinePatchTextFieldRight = new NinePatch();\n\t\tpublic static NinePatch NinePatchTextFieldWrong = new NinePatch();\n\n\t\tpublic static NinePatch NinePatchBtnDefault = new NinePatch();\n\t\tpublic static NinePatch NinePatchBtnHover = new NinePatch();\n\t\tpublic static NinePatch NinePatchBtnClicked = new NinePatch();\n\n\t\tpublic static NinePatch NinePatchWindowSelected = new NinePatch();\n\t\tpublic static NinePatch NinePatchWindowUnselected = new NinePatch();\n\n\t\tpublic static NinePatch NinePatchPanelSelected = new NinePatch();\n\t\tpublic static NinePatch NinePatchPanelUnselected = new NinePatch();\n\n\t\tpublic static NinePatch NinePatchDropDown = new NinePatch();\n\n\t\tpublic static Texture2D TextureCheckBoxDefault;\n\t\tpublic static Texture2D TextureCheckBoxSelected;\n\t\tpublic static Texture2D TextureCheckBoxDefaultChecked;\n\t\tpublic static Texture2D TextureCheckBoxSelectedChecked;\n\n\t\tpublic static NinePatch NinePatchTabDefault = new NinePatch();\n\t\tpublic static NinePatch NinePatchTabSelected = new NinePatch();\n\n\t\tpublic static Texture2D TextureSliderSelected;\n\t\tpublic static Texture2D TextureSliderDefault;\n\t\tpublic static NinePatch NinePatchSliderRange = new NinePatch();\n\n\t\tpublic static SpriteFont Font;\n\n\t\tprivate InputManager _inputManager = new InputManager();\n\n\t\tpublic RasterizerState RasterizerState;\n\n\t\tprivate int LastScrollValue = 0;\n\t\tprivate const int OneScrollValue = 120;\n\n\t\tpublic Property<int> DrawOrder { get; private set; }\n\n\t\tprivate List<View> potentiallyDetachedViews = new List<View>();\n\n\t\tpublic void PotentiallyDetached(View v)\n\t\t{\n\t\t\tthis.potentiallyDetachedViews.Add(v);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Will be true if the latest click within the game bounds resided within an active direct child of the root view.\n\t\t/// </summary>\n\t\tpublic Property<bool> LastClickCaptured = new Property<bool>();\n\n\t\tpublic Property<bool> KeyboardEnabled = new Property<bool> { Value = true };\n\n\t\tinternal void InitializeKeybindings()\n\t\t{\n\t\t\tstring[] toBindUpper = \"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ) ! @ # $ % ^ & * ( ? > < \\\" : } { _ + 0 1 2 3 4 5 6 7 8 9 | ~          \".Split(' ');\n\t\t\tstring[] toBindLower = \"a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 / . , ' ; ] [ - = 0 1 2 3 4 5 6 7 8 9 \\\\ `          \".Split(' ');\n\t\t\tKeys[] toBind = {Keys.A, Keys.B, Keys.C, Keys.D, Keys.E, Keys.F, Keys.G, Keys.H, Keys.I, Keys.J, Keys.K, Keys.L, Keys.M, Keys.N, Keys.O, Keys.P, Keys.Q, Keys.R, Keys.S, Keys.T, Keys.U, Keys.V, Keys.W, Keys.X, Keys.Y, Keys.Z,\n\t\t\t\t\t\t\tKeys.D0, Keys.D1, Keys.D2, Keys.D3, Keys.D4, Keys.D5, Keys.D6, Keys.D7, Keys.D8, Keys.D9, Keys.OemQuestion, Keys.OemPeriod, Keys.OemComma, Keys.OemQuotes,\n\t\t\t\t\t\t\tKeys.OemSemicolon, Keys.OemCloseBrackets, Keys.OemOpenBrackets, Keys.OemMinus, Keys.OemPlus, Keys.NumPad0, Keys.NumPad1, Keys.NumPad2, Keys.NumPad3, Keys.NumPad4, Keys.NumPad5, Keys.NumPad6, Keys.NumPad7, Keys.NumPad8, Keys.NumPad9, Keys.OemPipe, Keys.OemTilde,\n\t\t\t\t\t\t\tKeys.Space, Keys.Left, Keys.Right, Keys.Up, Keys.Down, Keys.Enter, Keys.Back, Keys.Delete, Keys.Escape, Keys.Tab};\n\n\t\t\tfor (int i = 0; i < toBindUpper.Length; i++)\n\t\t\t{\n\t\t\t\tString upper = toBindUpper[i];\n\t\t\t\tString lower = toBindLower[i];\n\t\t\t\tKeys bind = toBind[i];\n\n\t\t\t\tInputManager.BindKey(() =>\n\t\t\t\t{\n\t\t\t\t\tif (this.KeyboardEnabled)\n\t\t\t\t\t{\n\t\t\t\t\t\tbool shiftHeld = InputManager.IsKeyPressed(Keys.LeftShift) || InputManager.IsKeyPressed(Keys.RightShift);\n\t\t\t\t\t\tif (OnKeyPressedHandler != null)\n\t\t\t\t\t\t\tOnKeyPressedHandler(shiftHeld ? upper : lower, bind);\n\t\t\t\t\t}\n\t\t\t\t}, bind);\n\t\t\t\tInputManager.BindKey(() =>\n\t\t\t\t{\n\t\t\t\t\tif (this.KeyboardEnabled)\n\t\t\t\t\t{\n\t\t\t\t\t\tbool shiftHeld = InputManager.IsKeyPressed(Keys.LeftShift) || InputManager.IsKeyPressed(Keys.RightShift);\n\t\t\t\t\t\tif (OnKeyReleasedHandler != null)\n\t\t\t\t\t\t\tOnKeyReleasedHandler(shiftHeld ? upper : lower, bind);\n\t\t\t\t\t}\n\t\t\t\t}, bind, false, false);\n\t\t\t\tInputManager.BindKey(() =>\n\t\t\t\t{\n\t\t\t\t\tif (this.KeyboardEnabled)\n\t\t\t\t\t{\n\t\t\t\t\t\tbool shiftHeld = InputManager.IsKeyPressed(Keys.LeftShift) || InputManager.IsKeyPressed(Keys.RightShift);\n\t\t\t\t\t\tif (OnKeyContinuallyPressedHandler != null)\n\t\t\t\t\t\t\tOnKeyContinuallyPressedHandler(shiftHeld ? upper : lower, bind);\n\t\t\t\t\t}\n\t\t\t\t}, bind, true);\n\t\t\t}\n\t\t}\n\n\t\tinternal void HandleScroll(View view, Point mousePos, int scrollDelta)\n\t\t{\n\t\t\tbool didLower = false;\n\t\t\tfor (int i = view.Children.Length - 1; i >= 0 && i < view.Children.Length; i--)\n\t\t\t{\n\t\t\t\tView child = view.Children[i];\n\t\t\t\tif (child.Active && child.AllowMouseEvents && child.AbsoluteBoundBox.Contains(mousePos))\n\t\t\t\t{\n\t\t\t\t\tHandleScroll(child, mousePos, scrollDelta);\n\t\t\t\t\tdidLower = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!didLower)\n\t\t\t\tview.OnMScroll(ConversionManager.PtoV(mousePos), scrollDelta, false);\n\t\t}\n\n\t\tinternal bool HandleClick(View view, Point mousePos, bool rightClick, bool shouldFireClick)\n\t\t{\n\t\t\tbool originalShouldFireClick = shouldFireClick;\n\t\t\tbool didFireClick = false;\n\n\t\t\tif (view.Active && view.AllowMouseEvents)\n\t\t\t{\n\t\t\t\tfor (int i = view.Children.Length - 1; i >= 0 && i < view.Children.Length; i--)\n\t\t\t\t{\n\t\t\t\t\tView child = view.Children[i];\n\t\t\t\t\tbool childFiredClick = HandleClick(child, mousePos, rightClick, shouldFireClick);\n\t\t\t\t\tdidFireClick |= childFiredClick;\n\t\t\t\t\tshouldFireClick &= !childFiredClick;\n\t\t\t\t}\n\n\t\t\t\tif (originalShouldFireClick && view.AbsoluteBoundBox.Contains(mousePos))\n\t\t\t\t{\n\t\t\t\t\tif (!didFireClick)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (rightClick)\n\t\t\t\t\t\t\tview.OnMRightClick(ConversionManager.PtoV(mousePos), false);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tview.OnMClick(ConversionManager.PtoV(mousePos), false);\n\n\t\t\t\t\t\tif (view != RootView)\n\t\t\t\t\t\t\tLastClickCaptured.Value = true;\n\n\t\t\t\t\t\tdidFireClick = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (!rightClick)\n\t\t\t\t\tview.OnMClickAway();\n\t\t\t}\n\n\t\t\treturn didFireClick;\n\t\t}\n\n\t\tinternal void HandleMouseMovement(View view, Point mousePos)\n\t\t{\n\t\t\tbool didLower = false;\n\t\t\tfor (int i = view.Children.Length - 1; i >= 0 && i < view.Children.Length; i--)\n\t\t\t{\n\t\t\t\tView child = view.Children[i];\n\t\t\t\tif (child.Active && child.AllowMouseEvents && child.AbsoluteBoundBox.Contains(mousePos))\n\t\t\t\t{\n\t\t\t\t\tHandleMouseMovement(child, mousePos);\n\t\t\t\t\tdidLower = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tchild.MouseOver = false;\n\t\t\t}\n\t\t\tif (!didLower) // If it was lowered, OnMOver already bubbled it up\n\t\t\t\tview.MouseOver = true;\n\t\t}\n\n\t\tpublic void Update(float dt, KeyboardState kb, MouseState mouse)\n\t\t{\n\t\t\tif (LastClickCaptured)\n\t\t\t\tLastClickCaptured.Value = false;\n\t\t\t_inputManager.Update(kb, mouse);\n\t\t\tUpdateView(RootView, dt);\n\t\t\tfor (int i = 0; i < this.potentiallyDetachedViews.Count; i++)\n\t\t\t{\n\t\t\t\tView v = this.potentiallyDetachedViews[i];\n\t\t\t\tif (v.ParentView.Value == null)\n\t\t\t\t\tv.OnDelete();\n\t\t\t}\n\t\t\tthis.potentiallyDetachedViews.Clear();\n\t\t}\n\n\t\tpublic void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\tViewport vp = this.main.GraphicsDevice.Viewport;\n\t\t\tDrawChildren(RootView, spriteBatch, new Rectangle(vp.X, vp.Y, vp.Width, vp.Height));\n\t\t}\n\n\t\tinternal void UpdateView(View toUpdate, float dt)\n\t\t{\n\t\t\ttoUpdate.Update(dt);\n\t\t\tfor (int i = 0; i < toUpdate.Children.Length; i++)\n\t\t\t{\n\t\t\t\tView updating = toUpdate.Children[i];\n\t\t\t\tif (!updating.Active)\n\t\t\t\t\tcontinue;\n\t\t\t\tUpdateView(updating, dt);\n\t\t\t}\n\t\t\ttoUpdate.PostUpdate(dt);\n\t\t}\n\n\t\tinternal Rectangle CorrectScissor(Rectangle scissor, Point screenSize)\n\t\t{\n\t\t\tif (scissor.Right > screenSize.X)\n\t\t\t\tscissor.Width -= (scissor.Right - screenSize.X);\n\t\t\tif (scissor.Bottom > screenSize.Y)\n\t\t\t\tscissor.Height -= (scissor.Bottom - screenSize.Y);\n\t\t\tif (scissor.Top < 0)\n\t\t\t{\n\t\t\t\tint diff = scissor.Top;\n\t\t\t\tscissor.Y -= diff;\n\t\t\t\tscissor.Height += diff;\n\t\t\t}\n\t\t\tif (scissor.Left < 0)\n\t\t\t{\n\t\t\t\tint diff = scissor.Left;\n\t\t\t\tscissor.X -= diff;\n\t\t\t\tscissor.Width += diff;\n\t\t\t}\n\t\t\treturn scissor;\n\t\t}\n\n\t\tinternal void DrawChildren(View toDrawParent, SpriteBatch spriteBatch, Rectangle origParentScissor)\n\t\t{\n\t\t\t//Intersect the parent scissor with the current scissor.\n\t\t\t//This will ensure that we can ONLY constrict the scissor...\n\t\t\t//This solves the problem where a parent can be outside of the bounds of HIS parent, etc. etc., but his children only adhere to HIS boundbox, so they still get drawn.\n\t\t\tvar parentScissor = origParentScissor.Intersect(toDrawParent.AbsoluteContentBoundBox);\n\t\t\tparentScissor = CorrectScissor(parentScissor, main.ScreenSize);\n\t\t\tif (parentScissor.Height > 0 && parentScissor.Width > 0)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < toDrawParent.Children.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tView drawing = toDrawParent.Children[i];\n\t\t\t\t\tif (!drawing.Active || parentScissor.Height <= 0 || parentScissor.Width <= 0) continue;\n\n\t\t\t\t\tif (drawing.EnabledScissor)\n\t\t\t\t\t{\n\t\t\t\t\t\tspriteBatch.End();\n\t\t\t\t\t\tspriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None,\n\t\t\t\t\t\t\tthis.RasterizerState, null, Matrix.Identity);\n\t\t\t\t\t\tthis.main.GraphicsDevice.ScissorRectangle = parentScissor;\n\t\t\t\t\t}\n\n\t\t\t\t\tdrawing.Draw(spriteBatch);\n\t\t\t\t\tif (drawing.ContentMustBeScissored)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar newScissor = CorrectScissor(parentScissor.Intersect(drawing.AbsoluteContentBoundBox), main.ScreenSize);\n\t\t\t\t\t\tif (newScissor.Width <= 0 || newScissor.Height <= 0)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tspriteBatch.End();\n\t\t\t\t\t\tspriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, this.RasterizerState, null, Matrix.Identity);\n\t\t\t\t\t\tthis.main.GraphicsDevice.ScissorRectangle = newScissor;\n\t\t\t\t\t}\n\t\t\t\t\tdrawing.DrawContent(spriteBatch);\n\t\t\t\t\tDrawChildren(drawing, spriteBatch, parentScissor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tinternal IEnumerable<View> GetAllViews(View rootView)\n\t\t{\n\t\t\tif (rootView.Active)\n\t\t\t{\n\t\t\t\tyield return rootView;\n\t\t\t\tforeach (View child in rootView.Children)\n\t\t\t\t{\n\t\t\t\t\tforeach (View v in this.GetAllViews(child))\n\t\t\t\t\t\tyield return v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic View FindViewByName(string name)\n\t\t{\n\t\t\tif (RootView == null)\n\t\t\t\treturn null;\n\t\t\treturn RootView.FindFirstChildByName(name);\n\t\t}\n\n\t\tpublic List<View> FindViewsByName(string name)\n\t\t{\n\t\t\tif (RootView == null)\n\t\t\t\treturn new List<View>();\n\t\t\treturn RootView.FindChildrenByName(name);\n\t\t}\n\n\t\tpublic void LoadContent(bool reload)\n\t\t{\n\t\t\tTexture2D textFieldDefault = ConversionManager.BitmapToTexture(Resource1.textfield_default_9, this.main.GraphicsDevice);\n\t\t\tTexture2D textFieldSelected = ConversionManager.BitmapToTexture(Resource1.textfield_selected_9, this.main.GraphicsDevice);\n\t\t\tTexture2D textFieldRight = ConversionManager.BitmapToTexture(Resource1.textfield_selected_right_9, this.main.GraphicsDevice);\n\t\t\tTexture2D textFieldWrong = ConversionManager.BitmapToTexture(Resource1.textfield_selected_wrong_9, this.main.GraphicsDevice);\n\n\t\t\tTexture2D windowSelected = ConversionManager.BitmapToTexture(Resource1.window_selected_9, this.main.GraphicsDevice);\n\t\t\tTexture2D windowUnselected = ConversionManager.BitmapToTexture(Resource1.window_unselected_9, this.main.GraphicsDevice);\n\n\t\t\tTexture2D panelSelected = ConversionManager.BitmapToTexture(Resource1.panel_selected_9, this.main.GraphicsDevice);\n\t\t\tTexture2D panelUnselected = ConversionManager.BitmapToTexture(Resource1.panel_unselected_9, this.main.GraphicsDevice);\n\n\t\t\tTexture2D dropdown = ConversionManager.BitmapToTexture(Resource1.dropdown, this.main.GraphicsDevice);\n\n\t\t\tTexture2D btnDefault = ConversionManager.BitmapToTexture(Resource1.btn_default_9, this.main.GraphicsDevice);\n\t\t\tTexture2D btnClicked = ConversionManager.BitmapToTexture(Resource1.btn_clicked_9, this.main.GraphicsDevice);\n\t\t\tTexture2D btnHover = ConversionManager.BitmapToTexture(Resource1.btn_hover_9, this.main.GraphicsDevice);\n\n\t\t\tTexture2D sliderRange = ConversionManager.BitmapToTexture(Resource1.sliderRange_9, this.main.GraphicsDevice);\n\t\t\tTextureSliderDefault = ConversionManager.BitmapToTexture(Resource1.slider, this.main.GraphicsDevice);\n\t\t\tTextureSliderSelected = ConversionManager.BitmapToTexture(Resource1.sliderSelected, this.main.GraphicsDevice);\n\n\t\t\tNinePatchSliderRange.LoadFromTexture(sliderRange);\n\n\t\t\tTextureCheckBoxDefault = ConversionManager.BitmapToTexture(Resource1.checkbox_default, this.main.GraphicsDevice);\n\t\t\tTextureCheckBoxSelected = ConversionManager.BitmapToTexture(Resource1.checkbox_default_selected, this.main.GraphicsDevice);\n\t\t\tTextureCheckBoxDefaultChecked = ConversionManager.BitmapToTexture(Resource1.checkbox_checked, this.main.GraphicsDevice);\n\t\t\tTextureCheckBoxSelectedChecked = ConversionManager.BitmapToTexture(Resource1.checkbox_checked_selected, this.main.GraphicsDevice);\n\n\t\t\tNinePatchTextFieldDefault.LoadFromTexture(textFieldDefault);\n\t\t\tNinePatchTextFieldSelected.LoadFromTexture(textFieldSelected);\n\t\t\tNinePatchTextFieldRight.LoadFromTexture(textFieldRight);\n\t\t\tNinePatchTextFieldWrong.LoadFromTexture(textFieldWrong);\n\n\t\t\tNinePatchWindowSelected.LoadFromTexture(windowSelected);\n\t\t\tNinePatchWindowUnselected.LoadFromTexture(windowUnselected);\n\n\t\t\tNinePatchPanelUnselected.LoadFromTexture(panelUnselected);\n\t\t\tNinePatchPanelSelected.LoadFromTexture(panelSelected);\n\n\t\t\tNinePatchDropDown.LoadFromTexture(dropdown);\n\n\t\t\tNinePatchBtnDefault.LoadFromTexture(btnDefault);\n\t\t\tNinePatchBtnClicked.LoadFromTexture(btnClicked);\n\t\t\tNinePatchBtnHover.LoadFromTexture(btnHover);\n\n\t\t\tNinePatchTabDefault.LoadFromTexture(btnDefault);\n\t\t\tNinePatchTabSelected.LoadFromTexture(btnHover);\n\n\t\t\tforeach (View v in this.GetAllViews(this.RootView))\n\t\t\t\tv.LoadContent(reload);\n\n\t\t\tWhite = new Texture2D(this.main.GraphicsDevice, 1, 1);\n\t\t\tWhite.SetData(new Color[] { Color.White });\n\t\t}\n\n\t\tpublic GeeUIMain()\n\t\t{\n\t\t\tRootView = new View(this);\n\t\t\tRootView.Attached.Value = true;\n\t\t\tthis.DrawOrder = new Property<int>() { Value = 0 };\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tRootView.Width.Value = this.main.Window.ClientBounds.Width;\n\t\t\tRootView.Height.Value = this.main.Window.ClientBounds.Height;\n\n\t\t\tTextColorDefault = Color.White;\n\n\t\t\tInitializeKeybindings();\n\n\t\t\tInputManager.BindMouse(() =>\n\t\t\t{\n\t\t\t\tHandleClick(RootView, InputManager.GetMousePos(), false, true);\n\t\t\t\t//When we click, we want to re-evaluate what control the mouse is over.\n\t\t\t\tHandleMouseMovement(RootView, InputManager.GetMousePos());\n\t\t\t}, MouseButton.Left);\n\n\t\t\tInputManager.BindMouse(() =>\n\t\t\t{\n\t\t\t\tHandleClick(RootView, InputManager.GetMousePos(), true, true);\n\t\t\t\t//When we click, we want to re-evaluate what control the mouse is over.\n\t\t\t\tHandleMouseMovement(RootView, InputManager.GetMousePos());\n\t\t\t}, MouseButton.Right);\n\n\t\t\tInputManager.BindMouse(() => HandleMouseMovement(RootView, InputManager.GetMousePos()), MouseButton.Movement);\n\n\t\t\tInputManager.BindMouse(() =>\n\t\t\t{\n\t\t\t\tint newScroll = _inputManager.GetScrollValue();\n\t\t\t\tint delta = newScroll - LastScrollValue;\n\t\t\t\tint numTimes = (delta / OneScrollValue);\n\t\t\t\tHandleScroll(RootView, InputManager.GetMousePos(), numTimes);\n\t\t\t\tLastScrollValue = newScroll;\n\t\t\t}, MouseButton.Scroll);\n\n\t\t\tthis.RasterizerState = new RasterizerState() { ScissorTestEnable = true };\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Managers/ConversionManager.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Text.RegularExpressions;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing System.Drawing;\n\nnamespace GeeUI.Managers\n{\n    public static class ConversionManager\n    {\n        public static Texture2D BitmapToTexture(Bitmap bmp, GraphicsDevice gd)\n        {\n            using (var s = new MemoryStream())\n            {\n                bmp.Save(s, System.Drawing.Imaging.ImageFormat.Png);\n                s.Seek(0, SeekOrigin.Begin);\n                Texture2D tx = Texture2D.FromStream(gd, s);\n                return tx;\n            }\n        }\n\n        public static Vector2 MidPoint(Vector2 point1, Vector2 point2)\n        {\n            return new Vector2((point1.X + point2.X) / 2, (point1.Y + point2.Y) / 2);\n        }\n\n        public static string GetSafeName(string path)\n        {\n            var r = new Regex(\"(.+?\\\\\\\\)+(.+?)\\\\.(?=.+)\");\n            Match mc = r.Match(path);\n            return mc.Groups[2].Value;\n        }\n\n        public static TimeSpan FloatToTime(float minutes)\n        {\n            double seconds = minutes * 60;\n            return TimeSpan.FromSeconds(seconds);\n        }\n\n        public static double DegreeToRadians(double degree)\n        {\n            return degree * (Math.PI / 180);\n        }\n\n\n        public static double RadianToDegrees(double radian)\n        {\n            return radian * (180 / Math.PI);\n        }\n\n        public static Vector2 PtoV(Microsoft.Xna.Framework.Point p)\n        {\n            return new Vector2(p.X, p.Y);\n        }\n\n        public static Microsoft.Xna.Framework.Point VtoP(Vector2 v)\n        {\n            return new Microsoft.Xna.Framework.Point((int)v.X, (int)v.Y);\n        }\n    }\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Managers/DrawManager.cs",
    "content": "﻿using System;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nnamespace GeeUI.Managers\n{\n    public static class DrawManager\n    {\n        public static void DrawBezier(Vector2 point1, Vector2 point2, Color c, SpriteBatch b, byte alpha = 255)\n        {\n            Vector2 midpoint = ConversionManager.MidPoint(point1, point2);\n\n\n            var c1 = new Vector2(midpoint.X, point1.Y);\n            var c2 = new Vector2(midpoint.X, point2.Y);\n\n            Vector2 lastPoint = point1;\n            for (double t1 = 0; t1 <= 1; t1 += (double)1 / (double)30)\n            {\n                var t = (float)t1;\n\n                Vector2 point = ((1 - t) * (1 - t) * (1 - t)) * point1 + 3 * ((1 - t) * (1 - t)) * t * c1 + 3 * (1 - t) * (t * t) * c2 + (t * t * t) * point2;\n\n                DrawLine(point, lastPoint, c, b, alpha);\n\n                lastPoint = point;\n            }\n        }\n\n        public static void DrawLine(Vector2 point1, Vector2 point2, Color c, SpriteBatch b, byte alpha = 255)\n        {\n            Vector2 midpoint = ConversionManager.MidPoint(point1, point2);\n            float xd = midpoint.X - point2.X;\n            float yd = midpoint.Y - point2.Y;\n            double rotation = Math.Atan2(yd, xd);\n            float dist = Vector2.Distance(midpoint, point2) * 2;\n            Texture2D t = GeeUIMain.White;\n            c.A = alpha;\n            b.Draw(t, point2, null, c, (float)rotation, Vector2.Zero, new Vector2(dist, 1), SpriteEffects.None, 0);\n        }\n\n        public static void DrawBox(Vector2 position, float width, float height, Color c, SpriteBatch b, float rotation = 0, byte alpha = 255, Effect e = null, bool wrong = false)\n        {\n            var topLeft = new Vector2(position.X - (width / 2), position.Y - (height / 2));\n            var bottomRight = new Vector2(position.X + (width / 2), position.Y + (height / 2));\n\n            DrawBox(topLeft, bottomRight, c, b, rotation, alpha, e, wrong);\n        }\n\n        public static void DrawBox(Rectangle box, Color c, SpriteBatch b, float rotation = 0, byte alpha = 255, Effect e = null, bool wrong = false)\n        {\n            var topLeft = new Vector2(box.Left, box.Top);\n            var bottomRight = new Vector2(box.Right, box.Bottom);\n\n            DrawBox(topLeft, bottomRight, c, b, rotation, alpha, e, wrong);\n        }\n\n        public static void DrawBox(Vector2 topLeft, Vector2 bottomRight, Color c, SpriteBatch b, float rotation = 0, byte alpha = 255, Effect e = null, bool wrong = false)\n        {\n            if (e != null)\n            {\n                b.End();\n                b.Begin(0, BlendState.NonPremultiplied, null, null, null, e);\n            }\n            float height = topLeft.Y - bottomRight.Y;\n            float width = topLeft.X - bottomRight.X;\n            Texture2D t = GeeUIMain.White;\n            c.A = alpha;\n            Vector2 pos = bottomRight;\n            b.Draw(t, pos, null, c, rotation, Vector2.Zero, new Vector2(width, height), SpriteEffects.None, 0);\n\n            if (e == null) return;\n            b.End();\n            b.Begin();\n        }\n\n        public static void DrawCircle(Vector2 position, float radius, Color c, Color cOutline, SpriteBatch b, byte alpha = 255, byte cutoff = 0)\n        {\n            Effect circleShader = GeeUIMain.CircleShader;\n\n            b.End();\n            b.Begin(0, BlendState.NonPremultiplied, null, null, null, circleShader);\n            float diameter = radius * 2;\n            position.X -= radius;\n            position.Y -= radius;\n            circleShader.Parameters[\"aspect\"].SetValue(diameter / diameter);\n            circleShader.Parameters[\"cutoff\"].SetValue(cutoff);\n            circleShader.Parameters[\"outlineColor\"].SetValue(new float[] { (float)cOutline.R / 255, (float)cOutline.G / 255, (float)cOutline.B / 255, (float)cOutline.A / 255 });\n            Texture2D t = GeeUIMain.White;\n            c.A = alpha;\n            b.Draw(t, position, null, c, 0f, Vector2.Zero, diameter, SpriteEffects.None, 0);\n            b.End();\n            b.Begin();\n        }\n\n\t\tpublic static void DrawOutline(Rectangle box, Color c, SpriteBatch b, byte alpha = 255)\n\t\t{\n\t\t\tvar topLeft = new Vector2(box.Left, box.Top);\n\t\t\tvar bottomRight = new Vector2(box.Right, box.Bottom);\n\n\t\t\tDrawOutline(topLeft, bottomRight, c, b, alpha);\n\t\t}\n\n        public static void DrawOutline(Vector2 position, float width, float height, Color c, SpriteBatch b, byte alpha = 255, bool up = true, bool down = true, bool left = true, bool right = true)\n        {\n            var topLeft = new Vector2(position.X - (width / 2), position.Y - (height / 2));\n            var bottomRight = new Vector2(position.X + (width / 2), position.Y + (height / 2));\n\n            DrawOutline(topLeft, bottomRight, c, b, alpha, up, down, left, right);\n        }\n\n        public static void DrawOutline(Vector2 topLeft, Vector2 bottomRight, Color c, SpriteBatch b, byte alpha = 255, bool up = true, bool down = true, bool left = true, bool right = true)\n        {\n            var topRight = new Vector2(bottomRight.X, topLeft.Y);\n            var bottomLeft = new Vector2(topLeft.X, bottomRight.Y);\n            c.A = alpha;\n            if (up)\n                DrawLine(topLeft, new Vector2(topRight.X + 1, topRight.Y), c, b, alpha);\n            if (left)\n                DrawLine(topLeft, bottomLeft, c, b, alpha);\n            if (right)\n                DrawLine(topRight, bottomRight, c, b, alpha);\n            if (down)\n                DrawLine(bottomLeft, bottomRight, c, b, alpha);\n        }\n\n        public static bool PointInCircle(Vector2 origin, float radius, Vector2 point)\n        {\n\n            return ((point.X - origin.X) * (point.X - origin.X)) + ((point.Y - origin.Y) * (point.Y - origin.Y)) <= (radius * radius);\n        }\n\n        public static bool PointOnLine(Vector2 linePoint1, Vector2 linePoint2, Vector2 point)\n        {\n            float y1 = linePoint1.Y;\n            float y2 = linePoint2.Y;\n            float x1 = linePoint1.X;\n            float x2 = linePoint2.X;\n            float slope = (y1 - y2) / (x1 - x2);\n            float intersect = -slope * x1 / y2;\n            if (x1 - x2 == 0)\n            {\n                return point.Y == x1 || point.Y == x2;\n            }\n            return point.Y == (slope * point.X + intersect);\n        }\n    }\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Managers/InputManager.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Input;\nusing GeeUI.Structs;\nnamespace GeeUI.Managers\n{\n\tpublic class InputManager\n\t{\n\t\tprivate static KeyboardState _keyboardState;\n\t\tprivate static KeyboardState _oldKeyboardState;\n\t\tprivate static MouseState _mouseState;\n\t\tprivate static MouseState _oldMouseState;\n\t\tprivate int _scrollValue;\n\n\t\tprivate static List<CodeBoundMouse> _boundMouse = new List<CodeBoundMouse>();\n\t\tprivate static List<CodeBoundKey> _boundKey = new List<CodeBoundKey>();\n\n\t\tprivate static List<CodeBoundMouse> _toBindMouse = new List<CodeBoundMouse>();\n\t\tprivate static List<CodeBoundKey> _toBindKey = new List<CodeBoundKey>();\n\n\t\tpublic static void BindKey(Action lambda, Keys key, bool constant = false, bool press = true)\n\t\t{\n\t\t\t_toBindKey.Add(new CodeBoundKey(lambda, key, constant, press));\n\t\t}\n\n\t\tpublic static void BindMouse(Action a, MouseButton button, bool press = true, bool constant = false)\n\t\t{\n\t\t\t_toBindMouse.Add(new CodeBoundMouse(a, button, press, constant));\n\t\t}\n\n\t\tpublic int GetScrollValue()\n\t\t{\n\t\t\treturn _scrollValue;\n\t\t}\n\n\t\tpublic static Point GetMousePos()\n\t\t{\n\t\t\treturn new Point(_mouseState.X, _mouseState.Y);\n\t\t}\n\n\t\tpublic static Vector2 GetMousePosV()\n\t\t{\n\t\t\treturn new Vector2(GetMousePos().X, GetMousePos().Y);\n\t\t}\n\n\t\tpublic void Update(KeyboardState kb, MouseState mouse)\n\t\t{\n\t\t\t_keyboardState = kb;\n\t\t\t_mouseState = mouse;\n\t\t\tint scroll = _mouseState.ScrollWheelValue - _scrollValue;\n\t\t\t_scrollValue = _mouseState.ScrollWheelValue;\n\t\t\tforeach (CodeBoundMouse b in _boundMouse)\n\t\t\t{\n\t\t\t\tswitch (b.BoundMouseButton)\n\t\t\t\t{\n\t\t\t\t\tcase MouseButton.Left:\n\t\t\t\t\t\tif (_mouseState.LeftButton != _oldMouseState.LeftButton || b.Constant)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((b.Press && _mouseState.LeftButton == ButtonState.Pressed) ||\n\t\t\t\t\t\t\t\t(!b.Press && _mouseState.LeftButton == ButtonState.Released))\n\t\t\t\t\t\t\t\tb.Lambda();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MouseButton.Middle:\n\t\t\t\t\t\tif (_mouseState.MiddleButton != _oldMouseState.MiddleButton || b.Constant)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((b.Press && _mouseState.MiddleButton == ButtonState.Pressed) ||\n\t\t\t\t\t\t\t\t(!b.Press && _mouseState.MiddleButton == ButtonState.Released))\n\t\t\t\t\t\t\t\tb.Lambda();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase MouseButton.Right:\n\t\t\t\t\t\tif (_mouseState.RightButton != _oldMouseState.RightButton || b.Constant)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((b.Press && _mouseState.RightButton == ButtonState.Pressed) ||\n\t\t\t\t\t\t\t\t(!b.Press && _mouseState.RightButton == ButtonState.Released))\n\t\t\t\t\t\t\t\tb.Lambda();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase MouseButton.Scroll:\n\t\t\t\t\t\tif (scroll != 0)\n\t\t\t\t\t\t\tb.Lambda();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase MouseButton.Scrolldown:\n\t\t\t\t\t\tif (scroll < 0)\n\t\t\t\t\t\t\tb.Lambda();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MouseButton.Scrollup:\n\t\t\t\t\t\tif (scroll > 0)\n\t\t\t\t\t\t\tb.Lambda();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase MouseButton.Movement:\n\t\t\t\t\t\tif (_mouseState.Y != _oldMouseState.Y || _mouseState.X != _oldMouseState.X)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tb.Lambda();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach (CodeBoundKey b in _boundKey)\n\t\t\t{\n\t\t\t\tKeys k = b.BoundKey;\n\t\t\t\tbool newP = _keyboardState.IsKeyDown(k);\n\t\t\t\tbool oldP = _oldKeyboardState.IsKeyDown(k);\n\n\t\t\t\tif ((newP != oldP || b.Constant) && b.Press == newP)\n\t\t\t\t{\n\t\t\t\t\tb.Lambda();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach (CodeBoundMouse cbm in _toBindMouse)\n\t\t\t{\n\t\t\t\t_boundMouse.Add(cbm);\n\t\t\t}\n\t\t\tforeach (CodeBoundKey cbk in _toBindKey)\n\t\t\t{\n\t\t\t\t_boundKey.Add(cbk);\n\t\t\t}\n\n\t\t\t_toBindKey.Clear();\n\t\t\t_toBindMouse.Clear();\n\n\t\t\t_oldMouseState = _mouseState;\n\t\t\t_oldKeyboardState = _keyboardState;\n\t\t}\n\n\t\tpublic static bool IsKeyPressed(Keys k)\n\t\t{\n\t\t\treturn _keyboardState.IsKeyDown(k);\n\t\t}\n\n\t\tpublic static bool IsMousePressed(MouseButton button)\n\t\t{\n\t\t\tswitch(button)\n\t\t\t{\n\t\t\t\tcase MouseButton.Left:\n\t\t\t\t\treturn _mouseState.LeftButton == ButtonState.Pressed;\n\t\t\t\tcase MouseButton.Middle:\n\t\t\t\t\treturn _mouseState.MiddleButton == ButtonState.Pressed;\n\t\t\t\tcase MouseButton.Right:\n\t\t\t\t\treturn _mouseState.RightButton == ButtonState.Pressed;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\tpublic enum MouseButton\n\t{\n\t\tLeft,\n\t\tMiddle,\n\t\tRight,\n\t\tScrollup,\n\t\tScrolldown,\n\t\tScroll,\n\t\tMovement\n\t}\n\tpublic enum TextAlign\n\t{\n\t\tLeft,\n\t\tCenter,\n\t\tRight\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Resource1.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34014\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Lemma.GeeUI {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    public class Resource1 {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resource1() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        public static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Lemma.GeeUI.Resource1\", typeof(Resource1).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        public static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap btn_clicked_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"btn_clicked_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap btn_default_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"btn_default_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap btn_hover_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"btn_hover_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap checkbox_checked {\n            get {\n                object obj = ResourceManager.GetObject(\"checkbox_checked\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap checkbox_checked_selected {\n            get {\n                object obj = ResourceManager.GetObject(\"checkbox_checked_selected\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap checkbox_default {\n            get {\n                object obj = ResourceManager.GetObject(\"checkbox_default\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap checkbox_default_selected {\n            get {\n                object obj = ResourceManager.GetObject(\"checkbox_default_selected\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap dropdown {\n            get {\n                object obj = ResourceManager.GetObject(\"dropdown\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap panel_selected_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"panel_selected_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap panel_unselected_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"panel_unselected_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap slider {\n            get {\n                object obj = ResourceManager.GetObject(\"slider\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap sliderRange_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"sliderRange_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap sliderSelected {\n            get {\n                object obj = ResourceManager.GetObject(\"sliderSelected\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap textfield_default_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"textfield_default_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap textfield_selected_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"textfield_selected_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap textfield_selected_right_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"textfield_selected_right_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap textfield_selected_wrong_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"textfield_selected_wrong_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap window_selected_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"window_selected_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        public static System.Drawing.Bitmap window_unselected_9 {\n            get {\n                object obj = ResourceManager.GetObject(\"window_unselected_9\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Resource1.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"btn_clicked_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\btn_clicked.9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"btn_default_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\btn_default.9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"btn_hover_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\btn_hover.9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"checkbox_checked\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\checkbox_checked.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"checkbox_checked_selected\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\checkbox_checked_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"checkbox_default\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\checkbox_default.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"checkbox_default_selected\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\checkbox_default_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"dropdown\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\dropdown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"panel_selected_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\panel_selected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"panel_unselected_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\panel_unselected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"slider\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\slider.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"sliderRange_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\sliderRange.9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"sliderSelected\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\sliderSelected.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"textfield_default_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\textfield_default.9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"textfield_selected_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\textfield_selected.9 .png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"textfield_selected_right_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\textfield_selected_right.9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"textfield_selected_wrong_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\textfield_selected_wrong.9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"window_selected_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\window_selected.9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"window_unselected_9\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\window_unselected.9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n</root>"
  },
  {
    "path": "Lemma/GeeUI/Structs/BoundKey.cs",
    "content": "﻿using System;\nusing Microsoft.Xna.Framework.Input;\nnamespace GeeUI.Structs\n{\n    public class CodeBoundKey\n    {\n        public Action Lambda;\n        public Keys BoundKey;\n        public bool Constant;\n        public bool Press;\n\n        public CodeBoundKey(Action a, Keys key, bool constant = false, bool pressing = true)\n        {\n            Lambda = a;\n            BoundKey = key;\n            Press = pressing;\n            Constant = pressing && constant;\n        }\n    }\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Structs/BoundMouse.cs",
    "content": "﻿using System;\nusing GeeUI.Managers;\nnamespace GeeUI.Structs\n{\n    public class CodeBoundMouse\n    {\n        public Action Lambda;\n        public MouseButton BoundMouseButton;\n        public bool Press;\n        public bool Constant;\n\n\n        public CodeBoundMouse(Action a, MouseButton button, bool pressing = true, bool constant = false)\n        {\n            Lambda = a;\n            BoundMouseButton = button;\n            Press = pressing;\n            Constant = (pressing) && constant;\n        }\n    }\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Structs/DropDownItem.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace GeeUI.Structs\n{\n    public class DropDownItem\n    {\n        public List<DropDownItem> Children = new List<DropDownItem>();\n        public bool HasChildren;\n        public Action OnClick;\n        public string Text = \"\";\n\n        public DropDownItem(string text, Action onClick = null)\n        {\n            Text = text;\n            OnClick = onClick;\n        }\n\n        public void AddChild(DropDownItem d)\n        {\n            Children.Add(d);\n            HasChildren = true;\n        }\n\n    }\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Structs/NinePatch.cs",
    "content": "﻿using System;\n\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework;\nusing GeeUI.Managers;\n\nnamespace GeeUI.Structs\n{\n\tpublic class NinePatch\n\t{\n\t\tpublic int LeftMostPatch;\n\t\tpublic int RightMostPatch;\n\t\tpublic int TopMostPatch;\n\t\tpublic int BottomMostPatch;\n\n\t\tpublic int LeftWidth\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn LeftMostPatch - 1;\n\t\t\t}\n\t\t}\n\t\tpublic int RightWidth\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (Texture != null)\n\t\t\t\t\treturn Texture.Width - (RightMostPatch + 1);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\tpublic int TopHeight\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn TopMostPatch - 1;\n\t\t\t}\n\t\t}\n\t\tpublic int BottomHeight\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (Texture != null)\n\t\t\t\t\treturn Texture.Height - (BottomMostPatch + 1);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic Texture2D Texture;\n\n\t\tpublic NinePatch()\n\t\t{\n\t\t\tLeftMostPatch = -1;\n\t\t\tRightMostPatch = -1;\n\t\t\tTopMostPatch = -1;\n\t\t\tBottomMostPatch = -1;\n\t\t\tTexture = null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Method to determine if a texture has ninepatch data inside of it\n\t\t/// </summary>\n\t\t/// <param name=\"texture\">The texture to test against</param>\n\t\t/// <returns>True if the texture is compatible with ninepatches, false otherwise</returns>\n\t\tpublic static bool IsAlreadyNinepatch(Texture2D texture)\n\t\t{\n\t\t\tvar data = new Color[texture.Width * texture.Height];\n\t\t\ttexture.GetData(data);\n\n\t\t\tfor (int i = 0; i < texture.Width; i++)\n\t\t\t{\n\t\t\t\tColor curPixel = data[i];\n\t\t\t\tint a = curPixel.A;\n\t\t\t\tint r = curPixel.R;\n\t\t\t\tint g = curPixel.G;\n\t\t\t\tint b = curPixel.B;\n\n\t\t\t\tif (a != 0 && (r != 0 || g != 0 || b != 0))\n\t\t\t\t{\n\t\t\t\t\t//Is not black and is not transparent.\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = data.Length - (texture.Width + 1); i < data.Length; i++)\n\t\t\t{\n\t\t\t\tColor curPixel = data[i];\n\t\t\t\tint a = curPixel.A;\n\t\t\t\tint r = curPixel.R;\n\t\t\t\tint g = curPixel.G;\n\t\t\t\tint b = curPixel.B;\n\t\t\t\tif (a != 0 && (r != 0 || g != 0 || b != 0))\n\t\t\t\t{\n\t\t\t\t\t//Is not black and is not transparent.\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < data.Length; i += texture.Width)\n\t\t\t{\n\t\t\t\tColor curPixel = data[i];\n\t\t\t\tint a = curPixel.A;\n\t\t\t\tint r = curPixel.R;\n\t\t\t\tint g = curPixel.G;\n\t\t\t\tint b = curPixel.B;\n\t\t\t\tif (a != 0 && (r != 0 || g != 0 || b != 0))\n\t\t\t\t{\n\t\t\t\t\t//Is not black and is not transparent.\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = texture.Width - 1; i < data.Length; i += texture.Width)\n\t\t\t{\n\t\t\t\tColor curPixel = data[i];\n\t\t\t\tint a = curPixel.A;\n\t\t\t\tint r = curPixel.R;\n\t\t\t\tint g = curPixel.G;\n\t\t\t\tint b = curPixel.B;\n\t\t\t\tif (a != 0 && (r != 0 || g != 0 || b != 0))\n\t\t\t\t{\n\t\t\t\t\t//Is not black and is not transparent.\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Load the NinePatch data from a texture.\n\t\t/// </summary>\n\t\t/// <param name=\"texture\">The NinePatch-compatible texture to load from.</param>\n\t\tpublic void LoadFromTexture(Texture2D texture)\n\t\t{\n\t\t\tLeftMostPatch = -1;\n\t\t\tRightMostPatch = -1;\n\t\t\tTopMostPatch = -1;\n\t\t\tBottomMostPatch = -1;\n\t\t\tTexture = texture;\n\t\t\tvar data = new Color[texture.Width * texture.Height];\n\t\t\ttexture.GetData(data);\n\t\t\tfor (int i = 0; i < texture.Width; i++)\n\t\t\t{\n\t\t\t\tColor curPixel = data[i];\n\t\t\t\tif (curPixel.A != 0)\n\t\t\t\t{\n\t\t\t\t\tif (LeftMostPatch == -1) LeftMostPatch = i;\n\t\t\t\t}\n\t\t\t\tif (curPixel.A != 0 && LeftMostPatch != -1)\n\t\t\t\t{\n\t\t\t\t\tRightMostPatch = i;\n\t\t\t\t}\n\t\t\t\tif (curPixel.A == 0 && LeftMostPatch != -1 && RightMostPatch != -1)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor (int i = 0; i < data.Length; i += texture.Width)\n\t\t\t{\n\t\t\t\tColor curPixel = data[i];\n\t\t\t\tif (curPixel.A != 0)\n\t\t\t\t{\n\t\t\t\t\tif (TopMostPatch == -1) TopMostPatch = i / texture.Width;\n\t\t\t\t}\n\t\t\t\tif (curPixel.A != 0 && TopMostPatch != -1)\n\t\t\t\t{\n\t\t\t\t\tBottomMostPatch = (i / texture.Width);\n\t\t\t\t}\n\t\t\t\tif (curPixel.A == 0 && TopMostPatch != -1 && BottomMostPatch != -1)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Draws the ninepatch at the specified point\n\t\t/// </summary>\n\t\t/// <param name=\"sb\">The spritebatch to use for drawing</param>\n\t\t/// <param name=\"position\">The position to draw it at (top left)</param>\n\t\t/// <param name=\"contentWidth\">The width of the content inside the Ninepatch</param>\n\t\t/// <param name=\"contentHeight\">The height of the content inside the Ninepatch</param>\n\t\t/// <param name=\"angle\">The angle in degrees to rotate the ninepatch.</param>\n\t\tpublic void Draw(SpriteBatch sb, Vector2 position, int contentWidth, int contentHeight, float angle = 0, float alpha = 1)\n\t\t{\n\t\t\tvar topLeft = new Rectangle(1, 1, LeftMostPatch - 1, TopMostPatch - 1);\n\t\t\tvar topMiddle = new Rectangle(LeftMostPatch, 1, (RightMostPatch - LeftMostPatch), TopMostPatch - 1);\n\t\t\tvar topRight = new Rectangle(RightMostPatch + 1, 1, (Texture.Width - 1) - RightMostPatch, TopMostPatch - 1);\n\n\t\t\tvar left = new Rectangle(1, TopMostPatch, LeftMostPatch - 1, (BottomMostPatch - TopMostPatch));\n\t\t\tvar middle = new Rectangle(LeftMostPatch, TopMostPatch, (RightMostPatch - LeftMostPatch), (BottomMostPatch - TopMostPatch));\n\t\t\tvar right = new Rectangle(RightMostPatch + 1, TopMostPatch, (Texture.Width - 1) - RightMostPatch, (BottomMostPatch - TopMostPatch));\n\n\t\t\tvar bottomLeft = new Rectangle(1, BottomMostPatch, LeftMostPatch - 1, (Texture.Height - 1) - BottomMostPatch);\n\t\t\tvar bottomMiddle = new Rectangle(LeftMostPatch, BottomMostPatch, (RightMostPatch - LeftMostPatch), (Texture.Height - 1) - BottomMostPatch);\n\t\t\tvar bottomRight = new Rectangle(RightMostPatch + 1, BottomMostPatch, (Texture.Width - 1) - RightMostPatch, (Texture.Height - 1) - BottomMostPatch);\n\n\t\t\tint topMiddleWidth = topMiddle.Width;\n\t\t\tint leftMiddleHeight = left.Height;\n\t\t\tfloat scaleMiddleByHorizontally = (contentWidth / (float)topMiddleWidth);\n\t\t\tfloat scaleMiddleByVertically = (contentHeight / (float)leftMiddleHeight);\n\n\t\t\tVector2 drawTl = position;\n\t\t\tVector2 drawT = drawTl + new Vector2(topLeft.Width, 0);\n\t\t\tVector2 drawTr = drawT + new Vector2(topMiddle.Width * scaleMiddleByHorizontally, 0);\n\n\t\t\tVector2 drawL = drawTl + new Vector2(0, topLeft.Height);\n\t\t\tVector2 drawM = drawT + new Vector2(0, topMiddle.Height);\n\t\t\tVector2 drawR = drawTr + new Vector2(0, topRight.Height);\n\n\t\t\tVector2 drawBl = drawL + new Vector2(0, leftMiddleHeight * scaleMiddleByVertically);\n\t\t\tVector2 drawBm = drawM + new Vector2(0, leftMiddleHeight * scaleMiddleByVertically);\n\t\t\tVector2 drawBr = drawR + new Vector2(0, leftMiddleHeight * scaleMiddleByVertically);\n\n\t\t\tdrawTl = RotateAroundOrigin(drawTl, position, angle);\n\t\t\tdrawT = RotateAroundOrigin(drawT, position, angle);\n\t\t\tdrawTr = RotateAroundOrigin(drawTr, position, angle);\n\n\t\t\tdrawL = RotateAroundOrigin(drawL, position, angle);\n\t\t\tdrawM = RotateAroundOrigin(drawM, position, angle);\n\t\t\tdrawR = RotateAroundOrigin(drawR, position, angle);\n\n\t\t\tdrawBl = RotateAroundOrigin(drawBl, position, angle);\n\t\t\tdrawBm = RotateAroundOrigin(drawBm, position, angle);\n\t\t\tdrawBr = RotateAroundOrigin(drawBr, position, angle);\n\n\t\t\tvar angR = (float)ConversionManager.DegreeToRadians(angle);\n\n\t\t\tsb.Draw(Texture, drawTl, topLeft, Color.White * alpha, angR, Vector2.Zero, Vector2.One, SpriteEffects.None, 0f);\n\t\t\tsb.Draw(Texture, drawT, topMiddle, Color.White * alpha, angR, Vector2.Zero, new Vector2(scaleMiddleByHorizontally, 1), SpriteEffects.None, 0f);\n\t\t\tsb.Draw(Texture, drawTr, topRight, Color.White * alpha, angR, Vector2.Zero, Vector2.One, SpriteEffects.None, 0f);\n\n\t\t\tsb.Draw(Texture, drawL, left, Color.White * alpha, angR, Vector2.Zero, new Vector2(1, scaleMiddleByVertically), SpriteEffects.None, 0f);\n\t\t\tsb.Draw(Texture, drawM, middle, Color.White * alpha, angR, Vector2.Zero, new Vector2(scaleMiddleByHorizontally, scaleMiddleByVertically), SpriteEffects.None, 0f);\n\t\t\tsb.Draw(Texture, drawR, right, Color.White * alpha, angR, Vector2.Zero, new Vector2(1, scaleMiddleByVertically), SpriteEffects.None, 0f);\n\n\t\t\tsb.Draw(Texture, drawBl, bottomLeft, Color.White * alpha, angR, Vector2.Zero, Vector2.One, SpriteEffects.None, 0f);\n\t\t\tsb.Draw(Texture, drawBm, bottomMiddle, Color.White * alpha, angR, Vector2.Zero, new Vector2(scaleMiddleByHorizontally, 1), SpriteEffects.None, 0f);\n\t\t\tsb.Draw(Texture, drawBr, bottomRight, Color.White * alpha, angR, Vector2.Zero, Vector2.One, SpriteEffects.None, 0f);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Draws a box where the content of a NinePatch will be placed.\n\t\t/// Does not draw the NinePatch.\n\t\t/// </summary>\n\t\t/// <param name=\"sb\">The drawing SpriteBatch</param>\n\t\t/// <param name=\"position\">The position to draw (top left)</param>\n\t\t/// <param name=\"contentWidth\">The width of the content inside the Ninepatch</param>\n\t\t/// <param name=\"contentHeight\">The height of the content inside the Ninepatch</param>\n\t\t/// <param name=\"drawColor\">The color to draw </param>\n\t\tpublic void DrawContent(SpriteBatch sb, Vector2 position, int contentWidth, int contentHeight, Color drawColor, float alpha)\n\t\t{\n\t\t\t//Multiplying by alpha\n\t\t\tdrawColor.A = 255;\n\t\t\tvar topLeft = new Rectangle(1, 1, LeftMostPatch - 1, TopMostPatch - 1);\n\t\t\tvar topMiddle = new Rectangle(LeftMostPatch, 1, (RightMostPatch - LeftMostPatch), TopMostPatch - 1);\n\n\t\t\tvar left = new Rectangle(1, TopMostPatch, LeftMostPatch - 1, (BottomMostPatch - TopMostPatch));\n\t\t\tvar middle = new Rectangle(LeftMostPatch, TopMostPatch, (RightMostPatch - LeftMostPatch), (BottomMostPatch - TopMostPatch));\n\n\t\t\tint topMiddleWidth = topMiddle.Width;\n\t\t\tint leftMiddleHeight = left.Height;\n\t\t\tfloat scaleMiddleByHorizontally = (contentWidth / (float)topMiddleWidth);\n\t\t\tfloat scaleMiddleByVertically = (contentHeight / (float)leftMiddleHeight);\n\n\n\t\t\tVector2 drawTL = position;\n\t\t\tVector2 drawT = drawTL + new Vector2(topLeft.Width, 0);\n\n\t\t\tVector2 drawM = drawT + new Vector2(0, topMiddle.Height);\n\n\t\t\tvar bottomRight = new Vector2(drawM.X + (middle.Width * scaleMiddleByHorizontally), drawM.Y + (middle.Height * scaleMiddleByVertically));\n\t\t\tDrawManager.DrawBox(drawM, bottomRight, drawColor * alpha, sb, 0f, 150);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the center of a NinePatch with the defined width and height\n\t\t/// </summary>\n\t\t/// <param name=\"contentWidth\">The width of the NinePatch content</param>\n\t\t/// <param name=\"contentHeight\">The height of the NinePatch content</param>\n\t\t/// <returns></returns>\n\t\tpublic Vector2 GetCenter(int contentWidth, int contentHeight)\n\t\t{\n\t\t\tvar topLeft = new Rectangle(1, 1, LeftMostPatch - 1, TopMostPatch - 1);\n\t\t\tvar topMiddle = new Rectangle(LeftMostPatch, 1, (RightMostPatch - LeftMostPatch), TopMostPatch - 1);\n\t\t\tvar left = new Rectangle(1, TopMostPatch, LeftMostPatch - 1, (BottomMostPatch - TopMostPatch));\n\n\n\t\t\tint topMiddleWidth = topMiddle.Width;\n\t\t\tint leftMiddleHeight = left.Height;\n\t\t\tfloat scaleMiddleByHorizontally = (contentWidth / (float)topMiddleWidth);\n\t\t\tfloat scaleMiddleByVertically = (contentHeight / (float)leftMiddleHeight);\n\t\t\tif (scaleMiddleByVertically < 1) scaleMiddleByVertically = 1;\n\t\t\tif (scaleMiddleByHorizontally < 1) scaleMiddleByHorizontally = 1;\n\n\t\t\tvar drawMMiddle = new Vector2(topLeft.Width, topLeft.Height);\n\t\t\tdrawMMiddle += new Vector2(topMiddleWidth * (scaleMiddleByHorizontally / 2), leftMiddleHeight * (scaleMiddleByVertically / 2));\n\t\t\treturn drawMMiddle;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Rotates a point around a specified origin with the specified angle\n\t\t/// </summary>\n\t\t/// <param name=\"point\">The point to rotate</param>\n\t\t/// <param name=\"origin\">The rotation point of the point</param>\n\t\t/// <param name=\"angle\">The angle in degrees of the angle to rotate the point by.</param>\n\t\t/// <returns></returns>\n\t\tpublic static Vector2 RotateAroundOrigin(Vector2 point, Vector2 origin, double angle)\n\t\t{\n\t\t\tVector2 real = point - origin;\n\t\t\tVector2 ret = Vector2.Zero;\n\n\t\t\t//We need to use radians for Math.* functions\n\t\t\tangle = ConversionManager.DegreeToRadians(angle);\n\t\t\tret.X = (float)((real.X * Math.Cos(angle)) - (real.Y * Math.Sin(angle)));\n\t\t\tret.Y = (float)((real.X * Math.Sin(angle)) + (real.Y * Math.Cos(angle)));\n\n\t\t\tret += origin;\n\t\t\treturn ret;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Rotates a point with the specified angle\n\t\t/// </summary>\n\t\t/// <param name=\"point\">The point to rotate</param>\n\t\t/// <param name=\"angle\">The angle in degrees of the angle to rotate the point by.</param>\n\t\t/// <returns></returns>\n\t\tpublic static Vector2 RotatePoint(Vector2 point, double angle)\n\t\t{\n\t\t\tVector2 real = point;\n\t\t\tVector2 ret = Vector2.Zero;\n\n\t\t\t//We need to use radians for Math.* functions\n\t\t\tangle = ConversionManager.DegreeToRadians(angle);\n\t\t\tret.X = (float)((real.X * Math.Cos(angle)) - (real.Y * Math.Sin(angle)));\n\t\t\tret.Y = (float)((real.X * Math.Sin(angle)) + (real.Y * Math.Cos(angle)));\n\n\t\t\treturn ret;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Structs/RadioButtonGroup.cs",
    "content": "﻿namespace GeeUI.Structs\n{\n    public class RadioButtonGroup\n    {\n       /* List<RadioButton> buttons = new List<RadioButton>();\n\n        public void addButton(RadioButton b)\n        {\n            if (!buttons.Contains(b))\n            {\n                buttons.Add(b);\n                b.group = this;\n            }\n        }\n\n        public void buttonPressed(RadioButton b)\n        {\n            foreach (RadioButton b2 in buttons)\n            {\n                if (b2 != b)\n                    b2.selected = false;\n            }\n        }*/\n    }\n}\n"
  },
  {
    "path": "Lemma/GeeUI/ViewLayouts/BorderViewLayout.cs",
    "content": "﻿using System.Collections.Generic;\nusing GeeUI.Views;\nusing Microsoft.Xna.Framework;\n\nnamespace GeeUI.ViewLayouts\n{\n    public class BorderViewLayout : ViewLayout\n    {\n        List<View> childrenLayout = new List<View>();\n        private int topBottomHeight, rightLeftWidth;\n\n        /// <summary>\n        /// Creates a new BorderViewLayout\n        /// </summary>\n        public BorderViewLayout(View top, View bottom, View left, View right, View middle, int topBottomHeight, int rightLeftWidth)\n        {\n            childrenLayout.Add(top);\n            childrenLayout.Add(bottom);\n            childrenLayout.Add(left);\n            childrenLayout.Add(right);\n            childrenLayout.Add(middle);\n            this.topBottomHeight = topBottomHeight;\n            this.rightLeftWidth = rightLeftWidth;\n        }\n\n        public override void OrderChildren(View parentView)\n        {\n            Rectangle container = parentView.ContentBoundBox;\n            int xStart = container.Left - parentView.X;\n            int yStart = container.Top - parentView.Y;\n            int xEnd = container.Right - parentView.X;\n            int yEnd = container.Bottom - parentView.Y;\n            int height = yEnd - yStart;\n            int width = xEnd - xStart;\n\n            var top = childrenLayout[0];\n            var bottom = childrenLayout[1];\n            var left = childrenLayout[2];\n            var right = childrenLayout[3];\n            var middle = childrenLayout[4];\n\n            top.X = xStart;\n            top.Y = yStart;\n\t\t\ttop.Width.Value = width;\n\t\t\ttop.Height.Value = topBottomHeight;\n\n            left.X = xStart;\n            left.Y = yStart + topBottomHeight;\n\t\t\tleft.Width.Value = rightLeftWidth;\n\t\t\tleft.Height.Value = height - (topBottomHeight * 2);\n\n            bottom.X = xStart;\n            bottom.Y = height - topBottomHeight;\n\t\t\tbottom.Width.Value = width;\n\t\t\tbottom.Height.Value = topBottomHeight;\n\n            right.X = xEnd - rightLeftWidth;\n            right.Y = yStart + topBottomHeight;\n\t\t\tright.Width.Value = rightLeftWidth;\n\t\t\tright.Height.Value = height - (topBottomHeight * 2);\n\n            middle.X = xStart + rightLeftWidth;\n            middle.Y = yStart + topBottomHeight;\n\t\t\tmiddle.Width.Value = width - (rightLeftWidth * 2);\n\t\t\tmiddle.Height.Value = height - (topBottomHeight * 2);\n\n        }\n    }\n}\n"
  },
  {
    "path": "Lemma/GeeUI/ViewLayouts/ExpandToFitLayout.cs",
    "content": "﻿using GeeUI.Views;\nusing System.Collections.Generic;\nnamespace GeeUI.ViewLayouts\n{\n\tpublic class ExpandToFitLayout : ViewLayout\n\t{\n\t\tpublic bool ExpandVertical = true;\n\t\tpublic bool ExpandHorizontal = true;\n\n\t\tpublic int ExtraWidth = 0;\n\t\tpublic int ExtraHeight = 0;\n\n\t\tpublic ExpandToFitLayout()\n\t\t\t: this(true, true)\n\t\t{\n\n\t\t}\n\n\t\tpublic ExpandToFitLayout(bool vertical, bool horizontal)\n\t\t{\n\t\t\tthis.ExpandHorizontal = horizontal;\n\t\t\tthis.ExpandVertical = vertical;\n\t\t}\n\n\t\tpublic override void OrderChildren(View parentView)\n\t\t{\n\t\t\tint leftX = 0, rightX = 0, topY = 0, bottomY = 0;\n\t\t\tint parentLeft = parentView.AbsoluteBoundBox.Left;\n\t\t\tint parentTop = parentView.AbsoluteBoundBox.Top;\n\n\t\t\tforeach (var child in parentView.Children)\n\t\t\t{\n\t\t\t\tif (child.AbsoluteBoundBox.Left < leftX || leftX == 0) leftX = child.AbsoluteBoundBox.Left;\n\t\t\t\tif (child.AbsoluteBoundBox.Top < topY || topY == 0) topY = child.AbsoluteBoundBox.Top;\n\t\t\t\tif (child.AbsoluteBoundBox.Bottom > bottomY || bottomY == 0) bottomY = child.AbsoluteBoundBox.Bottom;\n\t\t\t\tif (child.AbsoluteBoundBox.Right > rightX || rightX == 0) rightX = child.AbsoluteBoundBox.Right;\n\t\t\t}\n\t\t\tif (ExpandHorizontal)\n\t\t\t\tparentView.Width.Value = rightX - parentLeft;\n\t\t\tif (ExpandVertical)\n\t\t\t\tparentView.Height.Value = bottomY - parentTop;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/ViewLayouts/HorizontalViewLayout.cs",
    "content": "﻿using GeeUI.Views;\nusing Microsoft.Xna.Framework;\n\nnamespace GeeUI.ViewLayouts\n{\n\tpublic class HorizontalViewLayout : ViewLayout\n\t{\n\t\tprivate int _paddingBetweenHorizontal;\n\t\tprivate int _paddingBetweenVertical;\n\t\tprivate bool _wrapAround;\n\t\tprivate bool _resizeParentToFit;\n\n\t\t/// <summary>\n\t\t/// Creates a new HorizontalViewLayout with the specified padding\n\t\t/// </summary>\n\t\t/// <param name=\"paddingBetweenHorizontal\">The padding in between each View that is ordered</param>\n\t\t/// <param name=\"wrapAround\">Whether or not to wrap views if they extend past the parent's boundbox.</param>\n\t\t/// <param name=\"paddingBetweenVertical\">If wrapping around, this is the padding in between each layer of views.</param>\n\t\t/// /// <param name=\"resizeParentToFit\">Expand vertically to fit new columns if need be.</param>\n\t\tpublic HorizontalViewLayout(int paddingBetweenHorizontal = 2, bool wrapAround = false, int paddingBetweenVertical = 2, bool resizeParentToFit = false)\n\t\t{\n\t\t\t_paddingBetweenHorizontal = paddingBetweenHorizontal;\n\t\t\t_paddingBetweenVertical = paddingBetweenVertical;\n\t\t\t_wrapAround = wrapAround;\n\t\t\t_resizeParentToFit = resizeParentToFit;\n\t\t}\n\n\t\tprivate void NoWrap(View parentView)\n\t\t{\n\t\t\tRectangle container = parentView.ContentBoundBox;\n\t\t\tint xDone = container.Left - parentView.RealX;\n\t\t\tforeach (View v in parentView.Children)\n\t\t\t{\n\t\t\t\tv.Position.Value = Vector2.Zero;\n\t\t\t\tif (ExcludedChildren.Contains(v)) continue;\n\t\t\t\tv.Position.Value = new Vector2(xDone, container.Top - parentView.RealY);\n\t\t\t\txDone += v.BoundBox.Width + _paddingBetweenHorizontal;\n\t\t\t}\n\t\t}\n\n\t\tprivate void Wrap(View parentView)\n\t\t{\n\t\t\tRectangle container = parentView.ContentBoundBox;\n\t\t\tint xDone = container.Left - parentView.RealX;\n\t\t\tint yDone = container.Top - parentView.RealY;\n\t\t\tView tallestChild = null;\n\t\t\tbool nullify = false;\n\t\t\tint furthestDown = 0;\n\t\t\tforeach (View v in parentView.Children)\n\t\t\t{\n\t\t\t\tif (nullify)\n\t\t\t\t{\n\t\t\t\t\ttallestChild = null; //this is per-column\n\t\t\t\t\tnullify = false;\n\t\t\t\t}\n\t\t\t\tv.Position.Value = Vector2.Zero;\n\t\t\t\tif (ExcludedChildren.Contains(v)) continue;\n\n\t\t\t\tif (tallestChild == null || v.BoundBox.Height > tallestChild.BoundBox.Height)\n\t\t\t\t\ttallestChild = v;\n\n\t\t\t\t//Wrapping around has never felt so good\n\t\t\t\tif (v.BoundBox.Right + xDone > container.Right - parentView.X)\n\t\t\t\t{\n\t\t\t\t\txDone = container.Left - parentView.X;\n\t\t\t\t\tint addHeight = tallestChild.BoundBox.Height + _paddingBetweenVertical;\n\t\t\t\t\tif (_resizeParentToFit)\n\t\t\t\t\t{\n\t\t\t\t\t\tint neededHeight = addHeight + yDone + v.BoundBox.Height;\n\t\t\t\t\t\tif (neededHeight > parentView.ContentBoundBox.Height)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint theHeight = (neededHeight - parentView.ContentBoundBox.Height);\n\t\t\t\t\t\t\tparentView.Height.Value += theHeight;\n\t\t\t\t\t\t\ttallestChild = v;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tyDone += tallestChild.BoundBox.Height + _paddingBetweenVertical;\n\t\t\t\t\tnullify = true;\n\t\t\t\t}\n\n\t\t\t\tv.Position.Value = new Vector2(xDone, yDone);\n\t\t\t\txDone += v.BoundBox.Width + _paddingBetweenHorizontal;\n\t\t\t\tif (tallestChild == v)\n\t\t\t\t\tfurthestDown = v.AbsoluteBoundBox.Bottom - parentView.AbsoluteContentBoundBox.Top;\n\t\t\t}\n\t\t\tif (_resizeParentToFit)\n\t\t\t\tparentView.Height.Value = furthestDown + 1;\n\t\t}\n\n\t\tpublic override void OrderChildren(View parentView)\n\t\t{\n\t\t\tif (!_wrapAround)\n\t\t\t\tNoWrap(parentView);\n\t\t\telse\n\t\t\t\tWrap(parentView);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/ViewLayouts/SpinViewLayout.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GeeUI.Views;\nusing GeeUI.Managers;\nusing GeeUI.Structs;\nusing Microsoft.Xna.Framework;\n\nnamespace GeeUI.ViewLayouts\n{\n    public class SpinViewLayout : ViewLayout\n    {\n        private int _radius = 10;\n        private float timeStep = 0;\n        private float step = 1;\n\n        /// <summary>\n        /// Creates a new SpinViewLayout with the specified radius\n        /// </summary>\n        /// <param name=\"radius\">Radius of the spin</param>\n        public SpinViewLayout(int radius = 10, float step = 1)\n        {\n            _radius = radius;\n            this.step = step;\n        }\n\n        public override void OrderChildren(View parentView)\n        {\n            timeStep += step;\n            double angle = timeStep % 360;\n            double angleStep = (360/parentView.Children.Length);\n\n            Vector2 center = new Vector2(parentView.ContentBoundBox.Width / 2, parentView.ContentBoundBox.Height / 2);\n\n            foreach(View child in parentView.Children)\n            {\n                double rads = ConversionManager.DegreeToRadians(angle);\n\n                child.X = (int) (-_radius * Math.Sin(rads));\n                child.Y = (int) (_radius * Math.Cos(rads));\n\n                child.Position.Value += center;\n                child.Position.Value -= new Vector2(child.Width / 2, child.Height / 2);\n\n                angle += angleStep;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Lemma/GeeUI/ViewLayouts/VerticalViewLayout.cs",
    "content": "﻿using System.Security;\nusing GeeUI.Views;\nusing Microsoft.Xna.Framework;\n\nnamespace GeeUI.ViewLayouts\n{\n\tpublic class VerticalViewLayout : ViewLayout\n\t{\n\t\tprivate int _paddingBetweenHorizontal;\n\t\tprivate int _paddingBetweenVertical;\n\t\tprivate bool _wrapAround;\n\t\tprivate bool _resizeParentToFit;\n\n\t\tprivate int _thinnestSeenParent = -1;\n\n\t\t/// <summary>\n\t\t/// Creates a new HorizontalViewLayout with the specified padding\n\t\t/// </summary>\n\t\t/// <param name=\"paddingBetweenHorizontal\">If wrapping around, this is the padding in between each layer of views.</param>\n\t\t/// <param name=\"wrapAround\">Whether or not to wrap views if they extend past the parent's boundbox.</param>\n\t\t/// <param name=\"paddingBetweenVertical\">The padding in between each View that is ordered</param>\n\t\t/// /// <param name=\"resizeParentToFit\">Expand horizontally to fit new rows if need be</param>\n\t\tpublic VerticalViewLayout(int paddingBetweenVertical = 2, bool wrapAround = true, int paddingBetweenHorizontal = 2, bool resizeParentToFit = false)\n\t\t{\n\t\t\t_paddingBetweenHorizontal = paddingBetweenHorizontal;\n\t\t\t_paddingBetweenVertical = paddingBetweenVertical;\n\t\t\t_wrapAround = wrapAround;\n\t\t\t_resizeParentToFit = resizeParentToFit;\n\t\t}\n\n\t\tprivate void NoWrap(View parentView)\n\t\t{\n\t\t\tRectangle container = parentView.ContentBoundBox;\n\t\t\tint yDone = container.Top - parentView.RealY;\n\t\t\tforeach (View v in parentView.Children)\n\t\t\t{\n\t\t\t\tif (!v.Active) continue;\n\t\t\t\tv.Position.Value = Vector2.Zero;\n\t\t\t\tif (ExcludedChildren.Contains(v)) continue;\n\t\t\t\tv.Position.Value = new Vector2(container.Left - parentView.RealX, yDone);\n\t\t\t\tyDone += v.BoundBox.Height + _paddingBetweenVertical;\n\t\t\t}\n\t\t}\n\n\t\tprivate void Wrap(View parentView)\n\t\t{\n\t\t\tRectangle container = parentView.ContentBoundBox;\n\t\t\tint xDone = container.Left - parentView.RealX;\n\t\t\tint yDone = container.Top - parentView.RealY;\n\t\t\tView widestChild = null;\n\t\t\tbool nullify = false;\n\t\t\tint furthestRight = 0;\n\t\t\tforeach (View v in parentView.Children)\n\t\t\t{\n\t\t\t\tif (!v.Active) continue;\n\t\t\t\tif (nullify)\n\t\t\t\t{\n\t\t\t\t\t//widestChild = null; //this is per-column\n\t\t\t\t\tnullify = false;\n\t\t\t\t}\n\t\t\t\tv.Position.Value = Vector2.Zero;\n\t\t\t\tif (ExcludedChildren.Contains(v)) continue;\n\n\t\t\t\tif (widestChild == null)\n\t\t\t\t{\n\t\t\t\t\twidestChild = v;\n\t\t\t\t}\n\t\t\t\t//Wrapping around has never felt so good\n\t\t\t\tif (v.BoundBox.Bottom + yDone > container.Bottom - parentView.Y)\n\t\t\t\t{\n\t\t\t\t\tyDone = container.Top - parentView.RealY;\n\t\t\t\t\tint addWidth = widestChild.BoundBox.Width + _paddingBetweenHorizontal;\n\t\t\t\t\tif (_resizeParentToFit)\n\t\t\t\t\t{\n\t\t\t\t\t\tint neededWidth = addWidth + xDone + v.BoundBox.Width;\n\t\t\t\t\t\tif (neededWidth > parentView.ContentBoundBox.Width)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint theWidth = (neededWidth - parentView.ContentBoundBox.Width);\n\t\t\t\t\t\t\tparentView.Width.Value += theWidth;\n\t\t\t\t\t\t\twidestChild = v;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\txDone += addWidth;\n\t\t\t\t\tnullify = true;\n\t\t\t\t\twidestChild = v;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (v.BoundBox.Width > widestChild.BoundBox.Width)\n\t\t\t\t\t{\n\t\t\t\t\t\twidestChild = v;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tv.Position.Value = new Vector2(xDone, yDone);\n\t\t\t\tyDone += v.BoundBox.Height + _paddingBetweenVertical;\n\t\t\t\tif (widestChild == v)\n\t\t\t\t\tfurthestRight = v.AbsoluteBoundBox.Right - parentView.AbsoluteContentBoundBox.Left;\n\t\t\t}\n\n\t\t\tif (_resizeParentToFit)\n\t\t\t\tparentView.Width.Value = furthestRight + 1;\n\t\t}\n\n\t\tpublic override void OrderChildren(View parentView)\n\t\t{\n\t\t\tif (_thinnestSeenParent == -1 || parentView.ContentBoundBox.Width < _thinnestSeenParent)\n\t\t\t\t_thinnestSeenParent = parentView.ContentBoundBox.Width;\n\t\t\tif (!_wrapAround)\n\t\t\t\tNoWrap(parentView);\n\t\t\telse\n\t\t\t\tWrap(parentView);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/ViewLayouts/ViewLayout.cs",
    "content": "﻿using GeeUI.Views;\nusing System.Collections.Generic;\nnamespace GeeUI.ViewLayouts\n{\n    public class ViewLayout\n    {\n        /// <summary>\n        /// Any child in this List will be ignored by the ViewLayout.\n        /// </summary>\n        public List<View> ExcludedChildren = new List<View>();\n\n        public ViewLayout()\n        {\n\n        }\n\n        public virtual void OrderChildren(View parentView)\n        {\n\n        }\n    }\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/ButtonView.cs",
    "content": "﻿using Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing GeeUI.Structs;\nusing GeeUI.Managers;\n\nnamespace GeeUI.Views\n{\n\n\tpublic class ButtonView : View\n\t{\n\t\tpublic NinePatch NinePatchNormal;\n\t\tpublic NinePatch NinePatchHover;\n\t\tpublic NinePatch NinePatchClicked;\n\n\t\tpublic View ButtonContentview\n\t\t{\n\t\t\tget {\n\t\t\t\treturn Children.Length == 0 ? null : Children[0];\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (this.Children.Length == 0)\n\t\t\t\t\tthis.Children.Add(value);\n\t\t\t\telse\n\t\t\t\t\tthis.Children[0] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Text\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (!(Children[0] is TextView))\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\tvar c = (TextView) Children[0];\n\t\t\t\treturn c.Text;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (!(Children[0] is TextView)) return;\n\t\t\t\tvar c = (TextView)Children[0];\n\t\t\t\tc.Text.Value = value;\n\t\t\t\tWidth.Value = (int)GeeUIMain.Font.MeasureString(c.Text.Value).X + NinePatchNormal.LeftWidth + NinePatchNormal.RightWidth;\n\t\t\t\tHeight.Value = (int)GeeUIMain.Font.MeasureString(c.Text.Value).Y + NinePatchNormal.TopHeight + NinePatchNormal.BottomHeight;\n\t\t\t}\n\t\t}\n\n\t\tpublic NinePatch CurrentNinepatch\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (MouseOver || Selected)\n\t\t\t\t{\n\t\t\t\t\treturn InputManager.IsMousePressed(MouseButton.Left) ? NinePatchClicked : NinePatchHover;\n\t\t\t\t}\n\t\t\t\treturn NinePatchNormal;\n\t\t\t}\n\t\t}\n\n\t\tpublic ButtonView(GeeUIMain GeeUI, View rootView, string text, Vector2 position)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t\tNinePatchNormal = GeeUIMain.NinePatchBtnDefault;\n\t\t\tNinePatchHover = GeeUIMain.NinePatchBtnHover;\n\t\t\tNinePatchClicked = GeeUIMain.NinePatchBtnClicked;\n\t\t\tPosition.Value = position;\n\n\t\t\t//Make the TextView for the text\n\t\t\tvar textV = new TextView(this.ParentGeeUI, this, text, new Vector2(0, 0)) {TextJustification = TextJustification.Left};\n\t\t\tWidth.Value = (textV.Width.Value = (int)GeeUIMain.Font.MeasureString(text).X) + NinePatchNormal.LeftWidth + NinePatchNormal.RightWidth;\n\t\t\tHeight.Value = (textV.Height.Value = (int)GeeUIMain.Font.MeasureString(text).Y) + NinePatchNormal.TopHeight + NinePatchNormal.BottomHeight;\n\t\t}\n\n\t\tpublic ButtonView(GeeUIMain GeeUI, View rootview, View contentView, Vector2 position)\n\t\t\t: base(GeeUI, rootview)\n\t\t{\n\t\t\tNinePatchNormal = GeeUIMain.NinePatchBtnDefault;\n\t\t\tNinePatchHover = GeeUIMain.NinePatchBtnHover;\n\t\t\tNinePatchClicked = GeeUIMain.NinePatchBtnClicked;\n\t\t\tPosition.Value = position;\n\t\t\tButtonContentview = contentView;\n\t\t}\n\n\t\tpublic override void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\tNinePatch patch = CurrentNinepatch;\n\t\t\tint width = Width - patch.LeftWidth - patch.RightWidth;\n\t\t\tint height = Height - patch.TopHeight - patch.BottomHeight;\n\n\t\t\tpatch.Draw(spriteBatch, AbsolutePosition, width, height, 0f, EffectiveOpacity);\n\n\t\t\tView childView = ButtonContentview;\n\t\t\tif (childView != null)\n\t\t\t{\n\t\t\t\tchildView.Width.Value = width;\n\t\t\t\tchildView.Height.Value = height;\n\t\t\t\tchildView.X = patch.LeftWidth;\n\t\t\t\tchildView.Y = patch.TopHeight;\n\t\t\t}\n\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/CheckBoxView.cs",
    "content": "﻿using System;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing GeeUI.Managers;\n\nnamespace GeeUI.Views\n{\n\tpublic class CheckBoxView : View\n\t{\n\t\tpublic Property<bool> IsChecked = new Property<bool>() { Value = false };\n\t\tpublic bool AllowLabelClicking = true;\n\n\t\tprivate const int SeperationBetweenCbAndText = 3;\n\n\t\tpublic View CheckBoxContentView\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Children.Length == 0 ? null : Children[0];\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (this.Children.Length == 0)\n\t\t\t\t\tthis.Children.Add(value);\n\t\t\t\telse\n\t\t\t\t\tthis.Children[0] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic Texture2D CurTexture\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (Selected || MouseOver)\n\t\t\t\t\treturn IsChecked ? GeeUIMain.TextureCheckBoxSelectedChecked : GeeUIMain.TextureCheckBoxSelected;\n\t\t\t\treturn IsChecked ? GeeUIMain.TextureCheckBoxDefaultChecked : GeeUIMain.TextureCheckBoxDefault;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Rectangle BoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tView child = CheckBoxContentView;\n\t\t\t\tif (child == null)\n\t\t\t\t{\n\t\t\t\t\treturn CurTexture.Bounds;\n\t\t\t\t}\n\t\t\t\treturn new Rectangle((int)RealPosition.X, (int)RealPosition.Y,\n\t\t\t\t\tCurTexture.Width + SeperationBetweenCbAndText + child.BoundBox.Width,\n\n\t\t\t\t\tMath.Max(CurTexture.Height, child.BoundBox.Height));\n\t\t\t}\n\t\t}\n\n\t\tpublic Rectangle CheckBoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Rectangle(AbsoluteX, AbsoluteY,\n\t\t\t\t\tCurTexture.Width,\n\t\t\t\t\tCurTexture.Height);\n\t\t\t}\n\t\t}\n\n\t\tpublic override Rectangle ContentBoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tView child = CheckBoxContentView;\n\t\t\t\tif (child != null)\n\t\t\t\t{\n\t\t\t\t\treturn new Rectangle(RealX + CurTexture.Width + SeperationBetweenCbAndText,\n\t\t\t\t\t\t\t\t\t\t RealY, child.BoundBox.Width, child.BoundBox.Height);\n\t\t\t\t}\n\t\t\t\treturn CurTexture.Bounds;\n\t\t\t}\n\t\t}\n\n\t\tpublic CheckBoxView(GeeUIMain GeeUI, View rootView, Vector2 position, string label)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t\tPosition.Value = position;\n\t\t\tthis.numChildrenAllowed = 1;\n\n\t\t\tnew TextView(GeeUI, this, label, Vector2.Zero);\n\t\t}\n\n\t\tpublic override void OnMClick(Vector2 position, bool fromChild)\n\t\t{\n\t\t\tif (AllowLabelClicking || fromChild == false)\n\t\t\t\tIsChecked.Value = !IsChecked.Value;\n\t\t\tbase.OnMClick(position, fromChild);\n\t\t}\n\n\t\tpublic override void OnMOver()\n\t\t{\n\t\t\tif (!AllowLabelClicking && !CheckBoundBox.Contains(InputManager.GetMousePos()))\n\t\t\t\t_mouseOver = false;\n\t\t\tbase.OnMOver();\n\t\t}\n\n\t\tpublic override void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\tspriteBatch.Draw(CurTexture, AbsolutePosition, Color.White * EffectiveOpacity);\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/DropDownView.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing GeeUI;\nusing GeeUI.Managers;\nusing GeeUI.ViewLayouts;\nusing GeeUI.Views;\nusing Lemma.GeeUI.Composites;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Input;\nusing View = GeeUI.Views.View;\n\nnamespace GeeUI.Views\n{\n\tpublic class DropDownView : View\n\t{\n\t\tpublic class DropDownOption\n\t\t{\n\t\t\tpublic string Text;\n\t\t\tpublic Action OnClicked;\n\t\t\tpublic object Related;\n\t\t}\n\n\t\tprivate PanelView DropDownPanelView;\n\t\tprivate ListView DropDownListView;\n\t\tpublic List<DropDownOption> DropDownOptions = new List<DropDownOption>();\n\t\tprivate List<DropDownOption> DisplayingOptions = new List<DropDownOption>();\n\t\tprivate TextFieldView FilterView;\n\n\t\tpublic Command OnShowing = new Command();\n\n\t\tpublic Property<string> Label = new Property<string>();\n\t\tpublic Property<int> LastItemSelected = new Property<int>() { Value = -1 };\n\t\tpublic Property<bool> AllowRightClickExecute = new Property<bool>();\n\t\tpublic Property<bool> AllowFilterText = new Property<bool>() { Value = true };\n\t\tpublic Property<int> FilterThreshhold = new Property<int>() { Value = 15 };\n\n\t\tprivate int _arrowKeysIndex = 0;\n\n\t\tpublic bool DropDownShowing\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn DropDownPanelView.Active;\n\t\t\t}\n\t\t}\n\n\t\tpublic DropDownView(GeeUIMain theGeeUI, View parentView, Vector2 position)\n\t\t\t: base(theGeeUI, parentView)\n\t\t{\n\t\t\tthis.numChildrenAllowed = 1;\n\t\t\tParentGeeUI.OnKeyPressedHandler += this.keyPressedHandler;\n\t\t\tvar button = new ButtonView(theGeeUI, this, \"\", Vector2.Zero);\n\t\t\tbutton.Add(new Binding<int>(this.Width, button.Width));\n\t\t\tbutton.Add(new Binding<int>(this.Height, button.Height));\n\t\t\tbutton.OnMouseClick += delegate(object sender, EventArgs e)\n\t\t\t{\n\t\t\t\tToggleDropDown();\n\t\t\t\tbutton.TemporarilyIgnoreMouseClickAway = true;\n\t\t\t\tthis.FilterView.TemporarilyIgnoreMouseClickAway = true;\n\t\t\t};\n\n\t\t\tbutton.OnMouseClickAway += delegate(object sender, EventArgs args)\n\t\t\t{\n\t\t\t\tHideDropDown();\n\t\t\t};\n\n\t\t\tbutton.OnMouseRightClick += (sender, args) =>\n\t\t\t{\n\t\t\t\tif (AllowRightClickExecute)\n\t\t\t\t\tExecuteLast();\n\t\t\t};\n\n\t\t\tbutton.Name = \"button\";\n\n\t\t\tthis.DropDownPanelView = new PanelView(theGeeUI, theGeeUI.RootView, Vector2.Zero);\n\t\t\tDropDownPanelView.ChildrenLayouts.Add(new VerticalViewLayout(2, false));\n\t\t\tthis.DropDownPanelView.SelectedNinepatch = this.DropDownPanelView.UnselectedNinepatch = GeeUIMain.NinePatchDropDown;\n\n\t\t\tFilterView = new TextFieldView(theGeeUI, DropDownPanelView, Vector2.Zero);\n\n\t\t\t// HACK\n\t\t\tFilterView.Height.Value = (int)(20 * theGeeUI.Main.FontMultiplier);\n\n\t\t\tFilterView.MultiLine = false;\n\t\t\tFilterView.AllowTab = false;\n\t\t\tFilterView.Add(new Binding<int>(FilterView.Width, x => x - 8, DropDownPanelView.Width));\n\t\t\tFilterView.OnTextChanged = () =>\n\t\t\t{\n\t\t\t\tif (FilterView.Active && DropDownPanelView.Active && AllowFilterText)\n\t\t\t\t{\n\t\t\t\t\tRefilter();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tDropDownListView = new ListView(theGeeUI, DropDownPanelView);\n\t\t\tDropDownListView.ChildrenLayouts.Add(new VerticalViewLayout(1, false));\n\t\t\tDropDownListView.ScrollMultiplier = 20;\n\t\t\tDropDownListView.Add(new Binding<int, Rectangle>(DropDownListView.Width, x => Math.Max(200, x.Width), DropDownListView.ChildrenBoundBox));\n\t\t\tDropDownListView.Add(new Binding<int, Rectangle>(DropDownListView.Height, x => x.Height, DropDownListView.ChildrenBoundBox));\n\n\t\t\tDropDownPanelView.Add(new Binding<int>(DropDownPanelView.Width, DropDownListView.Width));\n\n\t\t\tDropDownListView.Name = \"DropList\";\n\t\t\tDropDownPanelView.Add(new Binding<int>(DropDownPanelView.Height, (i1) => i1 + 2 + ((AllowFilterText && FilterView.Active) ? FilterView.BoundBox.Height : 0), DropDownListView.Height));\n\n\t\t\tDropDownPanelView.Active.Value = false;\n\n\t\t\tthis.Add(new SetBinding<string>(this.Label, delegate(string value)\n\t\t\t{\n\t\t\t\t((ButtonView)FindFirstChildByName(\"button\")).Text = value;\n\t\t\t}));\n\t\t}\n\n\t\tprivate bool justReceivedFocus;\n\t\tpublic override void Focus()\n\t\t{\n\t\t\tthis.ShowDropDown();\n\t\t\tthis.justReceivedFocus = true;\n\t\t}\n\n\t\tpublic override void Blur()\n\t\t{\n\t\t\tthis.HideDropDown();\n\t\t}\n\n\t\tprivate void keyPressedHandler(string keyPressed, Keys key)\n\t\t{\n\t\t\tif (this.DropDownShowing)\n\t\t\t{\n\t\t\t\tif (key == Keys.Escape)\n\t\t\t\t\tthis.HideDropDown();\n\t\t\t\telse if (key == Keys.Down)\n\t\t\t\t{\n\t\t\t\t\tthis._arrowKeysIndex++;\n\t\t\t\t\tthis.ArrowKeysHandle();\n\t\t\t\t}\n\t\t\t\telse if (key == Keys.Up)\n\t\t\t\t{\n\t\t\t\t\tthis._arrowKeysIndex--;\n\t\t\t\t\tthis.ArrowKeysHandle();\n\t\t\t\t}\n\t\t\t\telse if (key == Keys.Tab)\n\t\t\t\t{\n\t\t\t\t\tif (InputManager.IsKeyPressed(Keys.LeftControl))\n\t\t\t\t\t\tthis.Blur();\n\t\t\t\t\telse if (!this.justReceivedFocus)\n\t\t\t\t\t\tthis.FocusNextInputView(reverse: InputManager.IsKeyPressed(Keys.LeftShift));\n\t\t\t\t}\n\t\t\t\telse if (key == Keys.Enter)\n\t\t\t\t{\n\t\t\t\t\tif (DisplayingOptions.Count != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint index = _arrowKeysIndex;\n\t\t\t\t\t\tif (index < 0 || index >= DisplayingOptions.Count)\n\t\t\t\t\t\t\tindex = 0;\n\n\t\t\t\t\t\tvar option = DisplayingOptions[index];\n\t\t\t\t\t\tthis.OnOptionSelected(option);\n\t\t\t\t\t\tHideDropDown();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void ArrowKeysHandle()\n\t\t{\n\t\t\tif (DropDownListView.Children.Length == 0)\n\t\t\t\t_arrowKeysIndex = 0;\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach (var child in DropDownListView.Children)\n\t\t\t\t\tchild.Selected.Value = false;\n\t\t\t\tif (_arrowKeysIndex >= DropDownListView.Children.Length)\n\t\t\t\t\t_arrowKeysIndex = 0;\n\t\t\t\tif (_arrowKeysIndex < 0)\n\t\t\t\t\t_arrowKeysIndex = DropDownListView.Children.Length - 1;\n\t\t\t\tDropDownListView.Children[_arrowKeysIndex].Selected.Value = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Refilter()\n\t\t{\n\t\t\tthis._arrowKeysIndex = 0;\n\t\t\tstring text = FilterView.Text;\n\t\t\tDisplayingOptions = (from op in DropDownOptions\n\t\t\t\t\t\t\t\t\t\t\twhere op.Text.ToLower().Contains(text.ToLower()) || text == \"\"\n\t\t\t\t\t\t\t\t\t\t\tselect op).ToList();\n\n\t\t\tDropDownListView.Children.Clear();\n\t\t\tFilterView.SubmitOnClickAway = false;\n\t\t\tif (DisplayingOptions.Count > 0)\n\t\t\t{\n\t\t\t\tFilterView.OnTextSubmitted = () =>\n\t\t\t\t{\n\t\t\t\t\tif (!string.IsNullOrEmpty(text))\n\t\t\t\t\t\tHideDropDown();\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tforeach (var option in DisplayingOptions)\n\t\t\t{\n\t\t\t\tvar dropButton = new ButtonView(this.ParentGeeUI, DropDownListView, option.Text, Vector2.Zero);\n\t\t\t\tdropButton.OnMouseClick += (sender, args) =>\n\t\t\t\t{\n\t\t\t\t\tOnOptionSelected(option);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tArrowKeysHandle();\n\n\t\t}\n\n\t\tpublic void ExecuteLast()\n\t\t{\n\t\t\tif (LastItemSelected.Value < 0 || LastItemSelected.Value >= DropDownOptions.Count)\n\t\t\t\tLastItemSelected.Value = -1;\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar oc = DropDownOptions[LastItemSelected.Value].OnClicked;\n\t\t\t\tif (oc != null)\n\t\t\t\t\toc();\n\t\t\t}\n\t\t}\n\n\t\tpublic int GetOptionIndex(string optionName)\n\t\t{\n\t\t\tint i = 0;\n\t\t\tforeach (var dropdown in DropDownOptions)\n\t\t\t{\n\t\t\t\tif (dropdown.Text.Equals(optionName))\n\t\t\t\t\treturn i;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic int GetOptionIndexByRelated(object related)\n\t\t{\n\t\t\tint i = 0;\n\t\t\tforeach (var dropdown in DropDownOptions)\n\t\t\t{\n\t\t\t\tif (dropdown.Related.Equals(related))\n\t\t\t\t\treturn i;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic DropDownOption GetSelectedOption()\n\t\t{\n\t\t\tif (LastItemSelected.Value == -1 || LastItemSelected.Value > DropDownOptions.Count - 1)\n\t\t\t\treturn null;\n\t\t\treturn DropDownOptions[LastItemSelected.Value];\n\t\t}\n\n\t\tpublic void SetSelectedOption(string optionName, bool callOnSelected = true)\n\t\t{\n\t\t\tint optionIndex = GetOptionIndex(optionName);\n\t\t\tif (optionIndex != -1)\n\t\t\t\tOnOptionSelected(DropDownOptions[optionIndex], callOnSelected);\n\t\t}\n\n\t\tpublic void SetSelectedOptionByRelated(object related, bool callOnSelected = true)\n\t\t{\n\t\t\tint optionIndex = GetOptionIndexByRelated(related);\n\t\t\tif (optionIndex != -1)\n\t\t\t\tOnOptionSelected(DropDownOptions[optionIndex], callOnSelected);\n\t\t}\n\n\t\tpublic void OnOptionSelected(DropDownOption option, bool call = true)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(this.Label.Value))\n\t\t\t\t((ButtonView)FindFirstChildByName(\"button\")).Text = option.Text;\n\t\t\tif (option.OnClicked != null && call)\n\t\t\t\toption.OnClicked();\n\t\t\tthis.LastItemSelected.Value = GetOptionIndex(option.Text);\n\t\t\tthis.HideDropDown();\n\t\t}\n\n\t\tpublic ButtonView AddOption(string name, Action action, object related = null)\n\t\t{\n\t\t\tif (this.LastItemSelected == -1)\n\t\t\t{\n\t\t\t\tif (string.IsNullOrEmpty(this.Label))\n\t\t\t\t\t((ButtonView)FindFirstChildByName(\"button\")).Text = name;\n\t\t\t\tthis.LastItemSelected.Value = this.DropDownOptions.Count;\n\t\t\t}\n\n\t\t\tvar dropDownOption = new DropDownOption()\n\t\t\t{\n\t\t\t\tText = name,\n\t\t\t\tOnClicked = action,\n\t\t\t\tRelated = related\n\t\t\t};\n\t\t\tDropDownOptions.Add(dropDownOption);\n\n\t\t\tvar dropButton = new ButtonView(this.ParentGeeUI, DropDownListView, name, Vector2.Zero);\n\t\t\tdropButton.OnMouseClick += (sender, args) =>\n\t\t\t{\n\t\t\t\tOnOptionSelected(dropDownOption);\n\t\t\t};\n\t\t\treturn dropButton;\n\t\t}\n\n\t\tpublic void RemoveAllOptions()\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(this.Label))\n\t\t\t\t((ButtonView)FindFirstChildByName(\"button\")).Text = \"\";\n\t\t\tDropDownOptions.Clear();\n\t\t\tDropDownListView.Children.Clear();\n\t\t\tthis.LastItemSelected.Value = -1;\n\t\t}\n\n\t\tprivate Point mouse;\n\t\tpublic override void Update(float dt)\n\t\t{\n\t\t\tif (this.DropDownShowing)\n\t\t\t{\n\t\t\t\tthis.justReceivedFocus = false;\n\t\t\t\tif (this.mouse != InputManager.GetMousePos()\n\t\t\t\t\t&& !DropDownPanelView.AbsoluteBoundBox.Contains(InputManager.GetMousePos())\n\t\t\t\t\t&& !Children[0].AbsoluteBoundBox.Contains(InputManager.GetMousePos()))\n\t\t\t\t{\n\t\t\t\t\tif (InputManager.IsMousePressed(MouseButton.Left)\n\t\t\t\t\t\t|| InputManager.IsMousePressed(MouseButton.Right)\n\t\t\t\t\t\t|| InputManager.IsMousePressed(MouseButton.Middle))\n\t\t\t\t\t\tthis.HideDropDown();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tVector2 target = new Vector2(AbsoluteX - 1, this.AbsoluteBoundBox.Bottom);\n\t\t\t\t\tif (DropDownPanelView.Position != target)\n\t\t\t\t\t\tDropDownPanelView.Position.Value = target;\n\t\t\t\t\tif (DropDownListView.AbsoluteBoundBox.Bottom > ParentGeeUI.RootView.Height)\n\t\t\t\t\t\tDropDownListView.Height.Value -= (DropDownListView.AbsoluteBoundBox.Bottom - ParentGeeUI.RootView.Height);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.Update(dt);\n\t\t}\n\n\t\tpublic void ToggleDropDown()\n\t\t{\n\t\t\tif (this.DropDownShowing)\n\t\t\t\tHideDropDown();\n\t\t\telse\n\t\t\t\tShowDropDown();\n\t\t}\n\n\t\tpublic void HideDropDown()\n\t\t{\n\t\t\tif (DropDownShowing)\n\t\t\t{\n\t\t\t\tDropDownPanelView.Active.Value = false;\n\t\t\t\tif (FilterView.Active)\n\t\t\t\t{\n\t\t\t\t\tFilterView.Selected.Value = FilterView.Active.Value = false;\n\t\t\t\t\tFilterView.ClearText();\n\t\t\t\t\tRefilter();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void ShowDropDown()\n\t\t{\n\t\t\tthis.OnShowing.Execute();\n\t\t\tthis.mouse = InputManager.GetMousePos();\n\t\t\tDropDownPanelView.Active.Value = true;\n\t\t\tDropDownPanelView.FindFirstChildByName(\"DropList\").SetContentOffset(Vector2.Zero);\n\t\t\tDropDownPanelView.BringToFront();\n\t\t\tFilterView.ClearText();\n\t\t\tFilterView.Active.Value = FilterView.Selected.Value = AllowFilterText && FilterThreshhold.Value <= DropDownOptions.Count;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tParentGeeUI.OnKeyPressedHandler -= this.keyPressedHandler;\n\t\t\tthis.DropDownPanelView.RemoveFromParent();\n\t\t\tbase.delete();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/EmptyView.cs",
    "content": "﻿using Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing GeeUI.Structs;\nusing GeeUI.Managers;\n\nnamespace GeeUI.Views\n{\n\t/// <summary>\n\t/// An empty class used as a template. I guess.\n\t/// </summary>\n\tpublic class EmptyView : View\n\t{\n\n\t\tpublic EmptyView(GeeUIMain GeeUI, View rootView)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t}\n\n\t\tpublic override void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\t\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/ImageView.cs",
    "content": "﻿using Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace GeeUI.Views\n{\n    public class ImageView : View\n    {\n        public Texture2D Texture;\n\n        public override Rectangle BoundBox\n        {\n            get\n            {\n                return new Rectangle(RealX, RealY, (int)ScaledImageSize.X, (int)ScaledImageSize.Y);\n            }\n        }\n\n        public Vector2 ScaleVector\n        {\n            get\n            {\n                return new Vector2(Width / (float)Texture.Width, Height / (float)Texture.Height);\n            }\n            set\n            {\n\t\t\t\tWidth.Value = (int)(Texture.Width * value.X);\n\t\t\t\tHeight.Value = (int)(Texture.Height * value.Y);\n            }\n        }\n\n        public Vector2 ScaledImageSize\n        {\n            get\n            {\n                return new Vector2(Width * ScaleVector.X, Height * ScaleVector.Y);\n            }\n        }\n\n\n\t\tpublic ImageView(GeeUIMain GeeUI, View rootView, Texture2D texture)\n\t\t\t: base(GeeUI, rootView)\n        {\n            Texture = texture;\n\t\t\tWidth.Value = texture.Width;\n\t\t\tHeight.Value = texture.Height;\n        }\n\n        public override void Draw(SpriteBatch spriteBatch)\n        {\n\n            spriteBatch.Draw(Texture, AbsolutePosition, null, Color.White * EffectiveOpacity, 0f, Vector2.Zero, ScaleVector, SpriteEffects.None, 0f);\n\n            base.Draw(spriteBatch);\n        }\n    }\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/ListView.cs",
    "content": "﻿using Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing GeeUI.Structs;\nusing GeeUI.Managers;\nusing System;\nusing ComponentBind;\n\nnamespace GeeUI.Views\n{\n\t/// <summary>\n\t/// An empty class used as a template. I guess.\n\t/// </summary>\n\tpublic class ListView : View\n\t{\n\n\t\tpublic NinePatch ContainerNinePatch = null;\n\n\t\tpublic int ScrollMultiplier = 10;\n\n\t\tpublic Property<Rectangle> ChildrenBoundBox = new Property<Rectangle>();\n\n\t\tpublic override void OrderChildren()\n\t\t{\n\t\t\tbase.OrderChildren();\n\t\t\tif (Children.Length == 0)\n\t\t\t\tthis.ChildrenBoundBox.Value = new Rectangle(RealX, RealY, 0, 0);\n\t\t\tPoint max = new Point(int.MinValue, int.MinValue);\n\t\t\tPoint min = new Point(int.MaxValue, int.MaxValue);\n\t\t\tforeach (View child in this.Children)\n\t\t\t{\n\t\t\t\tmax.X = Math.Max(max.X, child.X + child.Width);\n\t\t\t\tmax.Y = Math.Max(max.Y, child.Y + child.Height);\n\t\t\t\tmin.X = Math.Min(min.X, child.X);\n\t\t\t\tmin.Y = Math.Min(min.Y, child.Y);\n\t\t\t}\n\t\t\tthis.ChildrenBoundBox.Value = new Rectangle(min.X, min.Y, max.X - min.X, max.Y - min.Y);\n\t\t}\n\n\t\tpublic ListView(GeeUIMain GeeUI, View rootView)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tthis.recomputeOffset(0);\n\t\t\t}, this.ChildrenBoundBox, this.Width, this.Height));\n\t\t}\n\n\t\tprivate void recomputeOffset(int scroll)\n\t\t{\n\t\t\tint offsetY = (int)this.ContentOffset.Value.Y + scroll;\n\t\t\tRectangle childBoundBox = ChildrenBoundBox;\n\t\t\tif (childBoundBox.Height <= this.Height)\n\t\t\t\toffsetY = 0;\n\t\t\telse\n\t\t\t{\n\t\t\t\toffsetY = Math.Max(offsetY, 0);\n\t\t\t\toffsetY = Math.Min(offsetY, childBoundBox.Height - this.Height);\n\t\t\t}\n\n\t\t\tVector2 target = new Vector2(0, offsetY);\n\t\t\tif (this.ContentOffset != target)\n\t\t\t\tthis.ContentOffset.Value = target;\n\t\t}\n\n\t\tpublic override void OnMScroll(Vector2 position, int scrollDelta, bool fromChild)\n\t\t{\n\t\t\tthis.recomputeOffset(scrollDelta * -ScrollMultiplier);\n\t\t\tbase.OnMScroll(position, scrollDelta, fromChild);\n\t\t}\n\n\t\tpublic override void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\tif (ContainerNinePatch != null)\n\t\t\t\tContainerNinePatch.Draw(spriteBatch, AbsolutePosition, Width, Height, 0f, EffectiveOpacity);\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/PanelView.cs",
    "content": "﻿using GeeUI.Managers;\nusing GeeUI.Structs;\nusing Microsoft.Xna.Framework;\n\nnamespace GeeUI.Views\n{\n\tpublic class PanelView : View\n\t{\n\t\tpublic NinePatch UnselectedNinepatch = new NinePatch();\n\t\tpublic NinePatch SelectedNinepatch = new NinePatch();\n\n\t\tprivate const int ChildrenPadding = 1;\n\n\t\t/// <summary>\n\t\t/// If true, the panel can be dragged by the user.\n\t\t/// </summary>\n\t\tpublic bool Draggable;\n\n\t\t/// <summary>\n\t\t/// If true, the panel can be resized by the user.\n\t\t/// </summary>\n\t\tpublic bool Resizeable = true;\n\n\t\tprivate bool SelectedOffChildren;\n\t\tprivate bool Resizing = false;\n\t\tprivate Vector2 MouseSelectedOffset;\n\n\t\tpublic override Rectangle BoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tNinePatch curPatch = Selected ? SelectedNinepatch : UnselectedNinepatch;\n\t\t\t\treturn new Rectangle((int)RealPosition.X, (int)RealPosition.Y, Width + ChildrenPadding + curPatch.LeftWidth + curPatch.RightWidth, Height + ChildrenPadding + curPatch.TopHeight + curPatch.BottomHeight);\n\t\t\t}\n\t\t}\n\n\t\tpublic override Rectangle ContentBoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tNinePatch curPatch = Selected ? SelectedNinepatch : UnselectedNinepatch;\n\t\t\t\treturn new Rectangle((int)RealPosition.X + curPatch.LeftWidth + ChildrenPadding, (int)RealPosition.Y + curPatch.TopHeight + ChildrenPadding, Width, Height);\n\t\t\t}\n\t\t}\n\n\t\tpublic PanelView(GeeUIMain GeeUI, View rootView, Vector2 position)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t\tSelectedNinepatch = GeeUIMain.NinePatchPanelSelected;\n\t\t\tUnselectedNinepatch = GeeUIMain.NinePatchPanelUnselected;\n\t\t\tPosition.Value = position;\n\t\t}\n\n\t\tpublic override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)\n\t\t{\n\t\t\tNinePatch patch = Selected ? SelectedNinepatch : UnselectedNinepatch;\n\t\t\tpatch.Draw(spriteBatch, AbsolutePosition, Width, Height, 0f, EffectiveOpacity);\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\n\t\tprotected internal void FollowMouse()\n\t\t{\n\t\t\tif (Draggable && !Resizing)\n\t\t\t{\n\t\t\t\tVector2 newMousePosition = InputManager.GetMousePosV();\n\t\t\t\tif (SelectedOffChildren && Selected && InputManager.IsMousePressed(MouseButton.Left))\n\t\t\t\t{\n\t\t\t\t\tPosition.Value = (newMousePosition - MouseSelectedOffset);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (Resizeable && Resizing)\n\t\t\t{\n\t\t\t\tVector2 newMousePosition = InputManager.GetMousePosV();\n\t\t\t\tif (SelectedOffChildren && Selected && InputManager.IsMousePressed(MouseButton.Left))\n\t\t\t\t{\n\t\t\t\t\tint newWidth = (int)newMousePosition.X - BoundBox.X;\n\t\t\t\t\tint newHeight = (int)newMousePosition.Y - BoundBox.Y;\n\t\t\t\t\tif (newWidth >= 10 && newHeight >= 10)\n\t\t\t\t\t{\n\t\t\t\t\t\tWidth.Value = newWidth;\n\t\t\t\t\t\tHeight.Value = newHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void OnMClick(Vector2 position, bool fromChild)\n\t\t{\n\t\t\tSelectedOffChildren = !fromChild;\n\t\t\tSelected.Value = true;\n\t\t\tMouseSelectedOffset = position - Position;\n\t\t\tif (this.Draggable)\n\t\t\t\tthis.BringToFront();\n\n\t\t\tVector2 corner = new Vector2(BoundBox.Right, BoundBox.Bottom);\n\t\t\tVector2 click = position;\n\n\t\t\tResizing = Vector2.Distance(corner, click) <= 20 && !fromChild && click.X <= corner.X && click.Y <= corner.Y;\n\n\t\t\tFollowMouse();\n\t\t\tbase.OnMClick(position, fromChild);\n\t\t}\n\n\t\tpublic override void OnMClickAway()\n\t\t{\n\t\t\tSelectedOffChildren = false;\n\t\t\tSelected.Value = false;\n\t\t\tResizing = false;\n\t\t\tbase.OnMClickAway();\n\t\t}\n\n\t\tpublic override void OnMOver()\n\t\t{\n\t\t\tFollowMouse();\n\t\t\tbase.OnMOver();\n\t\t}\n\n\t\tpublic override void OnMOff()\n\t\t{\n\t\t\tFollowMouse();\n\t\t\tbase.OnMOff();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/SliderView.cs",
    "content": "﻿using System;\n\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing GeeUI.Structs;\nusing GeeUI.Managers;\n\nnamespace GeeUI.Views\n{\n\tpublic class SliderView : View\n\t{\n\t\tpublic delegate void SliderValueChangedHandler(object sender, EventArgs e);\n\n\t\tpublic event SliderValueChangedHandler OnSliderValueChanged;\n\n\t\tpublic Texture2D SliderDefault;\n\t\tpublic Texture2D SliderSelected;\n\n\t\tpublic NinePatch SliderRange = new NinePatch();\n\n\t\tprivate int _min;\n\t\tprivate int _max;\n\n\t\tprivate bool _clicked;\n\n\t\tprivate bool _drawText;\n\t\tpublic bool DrawText\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _drawText;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\t//Only let text be drawn if the user has set the font.\n\t\t\t\t_drawText = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic Color TextColor = Color.Black;\n\n\t\tpublic int CurrentValue\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tfloat percent = (SliderPosition) / (float)(Width - SliderRange.LeftWidth - SliderRange.RightWidth);\n\t\t\t\treturn (int)(_min + ((_max - _min) * percent));\n\t\t\t}\n\t\t}\n\n\t\tpublic int SliderPosition;\n\n\t\tpublic Texture2D CurSliderTexture\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn MouseOver || Selected || _clicked ? SliderSelected : SliderDefault;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Rectangle BoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Rectangle(RealX, RealY, Width, (int)MathHelper.Max(SliderRange.Texture.Height, SliderDefault.Height));\n\t\t\t}\n\t\t}\n\n\t\tpublic SliderView(GeeUIMain GeeUI, View rootView, Vector2 position, int min, int max)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t\tSliderRange = GeeUIMain.NinePatchSliderRange;\n\t\t\tSliderDefault = GeeUIMain.TextureSliderDefault;\n\t\t\tSliderSelected = GeeUIMain.TextureSliderSelected;\n\n\t\t\t_min = min;\n\t\t\t_max = max;\n\n\t\t\tPosition.Value = position;\n\t\t}\n\n\t\tpublic override void OnMClick(Vector2 position, bool fromChild)\n\t\t{\n\t\t\tSliderCalc(position);\n\t\t\t_clicked = true;\n\t\t\tbase.OnMClick(position, fromChild);\n\t\t}\n\t\tpublic override void OnMClickAway()\n\t\t{\n\t\t\t_clicked = false;\n\t\t\tbase.OnMClickAway();\n\t\t}\n\n\t\tpublic override void OnMOver()\n\t\t{\n\t\t\tVector2 position = InputManager.GetMousePosV();\n\t\t\tSliderCalc(position);\n\t\t\tbase.OnMOver();\n\t\t}\n\t\tpublic override void OnMOff()\n\t\t{\n\t\t\tVector2 position = InputManager.GetMousePosV();\n\t\t\tSliderCalc(position);\n\t\t\tbase.OnMOff();\n\t\t}\n\n\t\tprivate void SliderCalc(Vector2 position)\n\t\t{\n\t\t\tif (!_clicked) return;\n\t\t\tif (InputManager.IsMousePressed(MouseButton.Left))\n\t\t\t{\n\t\t\t\tSliderPosition = (int)MathHelper.Clamp((int)(position.X - AbsoluteX + SliderRange.LeftWidth), 0, Width - SliderRange.RightWidth);\n\t\t\t\tif (OnSliderValueChanged != null)\n\t\t\t\t\tOnSliderValueChanged(null, null);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_clicked = false;\n\t\t\t}\n\t\t}\n\n\n\t\tpublic override void Update(float dt)\n\t\t{\n\t\t\tif (_min > _max)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"The minimum value of a slider cannot be above the maximum.\");\n\t\t\t}\n\t\t\tif (SliderPosition > Width) SliderPosition = Width;\n\t\t\tif (SliderPosition < 0) SliderPosition = 0;\n\t\t\tbase.Update(dt);\n\t\t}\n\n\t\tpublic override void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\t//We want to preserve the slider skin's original height.\n\t\t\tSliderRange.Draw(spriteBatch, AbsolutePosition, Width, SliderRange.BottomMostPatch - SliderRange.TopMostPatch, 0f, EffectiveOpacity);\n\t\t\tspriteBatch.Draw(CurSliderTexture, new Vector2(AbsoluteX + SliderRange.LeftWidth - (CurSliderTexture.Width) + SliderPosition, AbsoluteY), null, Color.White * EffectiveOpacity, 0f, new Vector2(CurSliderTexture.Width / -2, 0), 1f, SpriteEffects.None, 0f);\n\t\t\tif (DrawText)\n\t\t\t{\n\t\t\t\tint drawX = AbsoluteX + (Width) / 2;\n\t\t\t\tint drawY = AbsoluteY;\n\t\t\t\tVector2 offset = GeeUIMain.Font.MeasureString(CurrentValue.ToString());\n\t\t\t\toffset.X = (int)(offset.X / 2);\n\t\t\t\tspriteBatch.DrawString(GeeUIMain.Font, CurrentValue.ToString(), new Vector2(drawX, drawY), TextColor * EffectiveOpacity, 0f, offset, 1f, SpriteEffects.None, 0f);\n\t\t\t}\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/TabContainer.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace GeeUI.Views\n{\n\tinternal class TabContainer : View\n\t{\n\t\tpublic TabView ActiveTabView\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tTabView child = (TabView)this.Children[i];\n\t\t\t\t\tif (child.Selected)\n\t\t\t\t\t\treturn child;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tpublic int AllTabsWidth\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (Children.Length == 0) return 0;\n\t\t\t\tView last = Children[Children.Length - 1];\n\t\t\t\treturn (int)last.Position.Value.X + last.BoundBox.Width;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Rectangle BoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn ActiveTabView == null\n\t\t\t\t\t\t   ? new Rectangle(RealX, RealY, 0, 0)\n\t\t\t\t\t\t   : new Rectangle(RealX, RealY, Width, Height);\n\t\t\t}\n\t\t}\n\n\t\tinternal void TabClicked(TabView child)\n\t\t{\n\t\t\tforeach (TabView tab in Children)\n\t\t\t{\n\t\t\t\ttab.Selected.Value = false;\n\t\t\t}\n\t\t\tchild.Selected.Value = true;\n\t\t\tvar host = (TabHost) ParentView;\n\t\t\thost.TabClicked(Children.IndexOf(child));\n\t\t}\n\n\t\tpublic TabView AddTab(string tabText, View tabChild)\n\t\t{\n\t\t\tvar ret = new TabView(ParentGeeUI, this, new Vector2(AllTabsWidth, 0)) { TabText = tabText };\n\t\t\tParentView.Value.Children.Add(tabChild);\n\t\t\tif (ActiveTabView == null)\n\t\t\t\tTabClicked(ret);\n\t\t\telse \n\t\t\t\tTabClicked(ActiveTabView);\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic TabContainer(GeeUIMain GeeUI, View rootView)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t\tPosition.Value = Vector2.Zero;\n\t\t}\n\n\t\tprivate void setChildrenWidth()\n\t\t{\n\t\t\tvar maxWidth = 0;\n\t\t\tforeach (View c in Children)\n\t\t\t\tif (c.Width > maxWidth) maxWidth = c.Width;\n\t\t\tforeach (var child in Children)\n\t\t\t{\n\t\t\t\tchild.Width.Value = maxWidth;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Update(float dt)\n\t\t{\n\t\t\t//setChildrenWidth();\n\t\t\tWidth = ParentView.Value.Width;\n\t\t\tHeight.Value = 0;\n\n\t\t\tforeach(View v in Children)\n\t\t\t{\n\t\t\t\tif (v.BoundBox.Bottom > Height) Height.Value = v.BoundBox.Bottom;\n\t\t\t}\n\t\t\tbase.Update(dt);\n\t\t}\n\n\t\tpublic override void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/TabHost.cs",
    "content": "﻿using System.Linq;\nusing GeeUI.Managers;\nusing GeeUI.ViewLayouts;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Input;\n\nnamespace GeeUI.Views\n{\n\tpublic class TabHost : View\n\t{\n\n\t\tprivate TabContainer TabContainerView\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Children.Length == 0 ? null : (TabContainer)Children[0];\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (Children.Length == 0)\n\t\t\t\t\tthis.Children.Add(value);\n\t\t\t\telse\n\t\t\t\t\tthis.Children[0] = value;\n\t\t\t}\n\t\t}\n\n\t\tprivate View ActiveView\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (this.Children.Length == 1) return null;\n\t\t\t\tforeach (var child in Children)\n\t\t\t\t{\n\t\t\t\t\tif (child == TabContainerView) continue;\n\t\t\t\t\tif (child.Active) return child;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tprivate int CtrlTabIndex = 0;\n\n\t\tpublic TabHost(GeeUIMain GeeUI, View rootView, Vector2 position)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t\tPosition.Value = position;\n\t\t\tTabContainerView = new TabContainer(GeeUI, this);\n\t\t\tTabContainerView.ChildrenLayouts.Add(new HorizontalViewLayout(1, true));\n\n\t\t\tGeeUI.OnKeyPressedHandler += keyPressedHandler;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tthis.ParentGeeUI.OnKeyPressedHandler -= keyPressedHandler;\n\t\t\tbase.delete();\n\t\t}\n\n\t\tvoid keyPressedHandler(string keyPressed, Keys key)\n\t\t{\n\t\t\tif (key == Keys.Tab && InputManager.IsKeyPressed(Keys.LeftControl))\n\t\t\t\tthis.TabTab();\n\t\t}\n\n\t\tprivate void TabTab()\n\t\t{\n\t\t\tif (this.Children.Length > 1 && this.ActiveView.Selected)\n\t\t\t\tthis.SetActiveTab(CtrlTabIndex + 1);\n\t\t}\n\n\t\tinternal View TabViewToView(TabView v)\n\t\t{\n\t\t\tint index = TabContainerView.Children.IndexOf(v) + 1;\n\t\t\treturn index >= Children.Length ? null : Children[index];\n\t\t}\n\n\t\tpublic int TabIndex(string name)\n\t\t{\n\t\t\tfor (int i = 0; i < TabContainerView.Children.Length; i++)\n\t\t\t{\n\t\t\t\tvar tab = TabContainerView.Children[i] as TabView;\n\t\t\t\tif (tab == null) continue;\n\t\t\t\tif (tab.TabText == name)\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\n\t\tpublic void RemoveAllTabs()\n\t\t{\n\t\t\tTabContainerView.Children.Clear();\n\t\t\tforeach (var child in Children)\n\t\t\t{\n\t\t\t\tif (child == TabContainerView) continue;\n\t\t\t\tthis.Children.Remove(child);\n\t\t\t}\n\t\t}\n\n\t\tpublic void RemoveTab(string text)\n\t\t{\n\t\t\tfor (int i = 0; i < TabContainerView.Children.Length; i++)\n\t\t\t{\n\t\t\t\tvar tab = TabContainerView.Children[i] as TabView;\n\t\t\t\tif (tab.TabText == text)\n\t\t\t\t{\n\t\t\t\t\tthis.Children.RemoveAt(i + 1);\n\t\t\t\t\tthis.TabContainerView.Children.Remove(tab);\n\t\t\t\t\tthis.SetActiveTab(i - 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddTab(string tabText, View newTab)\n\t\t{\n\t\t\tTabContainerView.AddTab(tabText, newTab);\n\t\t}\n\n\t\tpublic void SetActiveTab(int index)\n\t\t{\n\t\t\tfor (int i = 0; i < this.TabContainerView.Children.Length; i++)\n\t\t\t{\n\t\t\t\tif (index > TabContainerView.Children.Length - 1)\n\t\t\t\t\tindex = 0;\n\t\t\t\telse if (index < 0)\n\t\t\t\t\tindex = TabContainerView.Children.Length - 1;\n\n\t\t\t\tif (TabContainerView.Children[index].Active)\n\t\t\t\t\tbreak;\n\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\tTabContainerView.TabClicked((TabView)TabContainerView.Children[index]);\n\t\t}\n\n\t\tpublic string GetActiveTab()\n\t\t{\n\t\t\tfor (int i = 0; i < TabContainerView.Children.Length; i++)\n\t\t\t{\n\t\t\t\tvar tab = TabContainerView.Children[i] as TabView;\n\t\t\t\tif (tab != null && tab.Selected)\n\t\t\t\t\treturn tab.TabText;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tinternal void TabClicked(int index)\n\t\t{\n\t\t\tfor (int i = 1; i < Children.Length; i++)\n\t\t\t{\n\t\t\t\tChildren[i].Active.Value = false;\n\t\t\t\tChildren[i].Selected.Value = false;\n\t\t\t}\n\t\t\tChildren[index + 1].Active.Value = true;\n\t\t\tChildren[index + 1].Selected.Value = true;\n\t\t\tCtrlTabIndex = index;\n\t\t}\n\n\t\tpublic override void Update(float dt)\n\t\t{\n\t\t\tfor (int i = 1; i < Children.Length; i++)\n\t\t\t{\n\t\t\t\tChildren[i].Position.Value = new Vector2(0, TabContainerView.BoundBox.Height);\n\t\t\t\tChildren[i].Width = Width;\n\t\t\t\tChildren[i].Height.Value = Height.Value - TabContainerView.BoundBox.Height - 10;\n\t\t\t}\n\t\t\tbase.Update(dt);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/TabView.cs",
    "content": "﻿using Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing GeeUI.Structs;\n\nnamespace GeeUI.Views\n{\n\tinternal class TabView : View\n\t{\n\t\tpublic NinePatch NinePatchSelected = new NinePatch();\n\t\tpublic NinePatch NinePatchDefault = new NinePatch();\n\n\t\tpublic string TabText\n\t\t{\n\t\t\tget { return TabTextView.Text; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tTabTextView.Text.Value = value;\n\t\t\t\tTabTextView.Width.Value = (int)GeeUIMain.Font.MeasureString(value).X;\n\t\t\t\tTabTextView.Height.Value = Height - CurNinepatch.TopHeight - CurNinepatch.BottomHeight;\n\t\t\t\tthis.Width.Value = TabTextView.Width + CurNinepatch.LeftWidth + CurNinepatch.RightWidth;\n\t\t\t}\n\t\t}\n\n\t\tprivate TextView TabTextView\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Children.Length == 0 ? null : (TextView)Children[0];\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (this.Children.Length == 0)\n\t\t\t\t\tthis.Children.Add(value);\n\t\t\t\telse\n\t\t\t\t\tthis.Children[0] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic NinePatch CurNinepatch\n\t\t{\n\t\t\tget { return Selected ? NinePatchSelected : NinePatchDefault; }\n\t\t}\n\n\n\t\tpublic override Rectangle ContentBoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Rectangle(RealX + CurNinepatch.LeftWidth, RealY + CurNinepatch.TopHeight,\n\t\t\t\t\t\tWidth - CurNinepatch.LeftWidth - CurNinepatch.RightWidth,\n\t\t\t\t\t\tHeight - CurNinepatch.TopHeight - CurNinepatch.BottomHeight);\n\t\t\t}\n\t\t}\n\n\t\tpublic TabView(GeeUIMain GeeUI, View rootView, Vector2 position)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t\tPosition.Value = position;\n\t\t\tthis.numChildrenAllowed = 1;\n\n\t\t\tNinePatchDefault = GeeUIMain.NinePatchTabDefault;\n\t\t\tNinePatchSelected = GeeUIMain.NinePatchTabSelected;\n\n\t\t\t// HACK\n\t\t\tthis.Height.Value = (int)(25.0f * GeeUI.Main.FontMultiplier);\n\n\t\t\tnew TextView(GeeUI, this, \"\", Vector2.Zero) {  };\n\t\t}\n\n\t\tpublic override void OnMClick(Vector2 position, bool fromChild)\n\t\t{\n\t\t\tvar p = (TabContainer)ParentView;\n\t\t\tp.TabClicked(this);\n\n\t\t\tbase.OnMClick(position, fromChild);\n\t\t}\n\n\t\tpublic override void Update(float dt)\n\t\t{\n\t\t\tTabTextView.Width.Value = Width - CurNinepatch.LeftWidth - CurNinepatch.RightWidth;\n\t\t\tif (Width >= ParentView.Value.Width) Width.Value = ParentView.Value.Width - 1;\n\t\t\tTabTextView.X = CurNinepatch.LeftWidth;\n\t\t\tTabTextView.Y = CurNinepatch.TopHeight;\n\t\t\tbase.Update(dt);\n\t\t}\n\n\t\tpublic override void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\tvar width = Width - CurNinepatch.LeftWidth - CurNinepatch.RightWidth;\n\t\t\tvar height = Height - CurNinepatch.TopHeight - CurNinepatch.BottomHeight;\n\n\t\t\tCurNinepatch.Draw(spriteBatch, AbsolutePosition, width, height, 0f, EffectiveOpacity);\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/TextFieldView.cs",
    "content": "﻿\nusing System;\nusing System.Reflection;\nusing System.Runtime.Remoting.Messaging;\nusing System.Text.RegularExpressions;\nusing System.Windows.Forms;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing GeeUI.Structs;\nusing GeeUI.Managers;\nusing Keys = Microsoft.Xna.Framework.Input.Keys;\n\nnamespace GeeUI.Views\n{\n\tpublic class TextFieldView : View\n\t{\n\n\t\tpublic static Color DefaultSelectionColor = new Color(13.0f / 255.0f, 103.0f / 255.0f, 172.0f / 255.0f);\n\t\tpublic override Rectangle ContentBoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Rectangle(RealX, RealY, Width, Height);\n\t\t\t}\n\t\t}\n\n\t\tpublic override Rectangle BoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar patch = Selected ? NinePatchSelected : NinePatchDefault;\n\t\t\t\treturn new Rectangle(RealX - patch.LeftWidth, RealY - patch.TopHeight, Width + patch.LeftWidth + patch.RightWidth, Height + patch.TopHeight + patch.BottomHeight);\n\t\t\t}\n\t\t}\n\n\t\tpublic NinePatch NinePatchDefault;\n\t\tpublic NinePatch NinePatchSelected;\n\t\tpublic NinePatch NinePatchRegexGood;\n\t\tpublic NinePatch NinePatchRegexBad;\n\n\t\tpublic bool AllowTab = true;\n\n\t\tpublic Color TextColor;\n\n\t\tpublic bool MultiLine = true;\n\t\tpublic bool Editable = true;\n\n\t\tprivate string _text = \"\";\n\n\t\t//public Property<string> Text;\n\t\tpublic string Text\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn MultiLine ? _text : _text.Replace(\"\\n\", \"\");\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tbool call = _text != value;\n\t\t\t\t_text = value;\n\t\t\t\tif (call) CallOnChanged();\n\t\t\t}\n\t\t}\n\n\t\tpublic int ShownWidth = 0;\n\n\t\tpublic bool SubmitOnClickAway = true;\n\n\t\t//Avoid infinite recursion\n\t\tprivate bool _callingOnChanged = false;\n\n\t\tpublic Action OnTextChanged = null;\n\t\tpublic Action OnTextSubmitted = null;\n\n\t\tprivate int _offsetX;\n\t\tprivate int _offsetY;\n\t\tprivate int _cursorX;\n\t\tprivate int _cursorY;\n\n\t\tprivate Vector2 _selectionStart = new Vector2(-1);\n\t\tprivate Vector2 _selectionEnd = new Vector2(-1);\n\n\t\tprivate float _buttonHeldTime;\n\n\t\t//How long to press before repeating\n\t\tprivate float _buttonHeldTimePreRepeat = 2;\n\t\tprivate string _buttonHeldString = \"\";\n\t\tprivate Keys _buttonHeld = Keys.None;\n\n\t\tfloat _delimiterTime;\n\t\tprivate const float DelimiterLimit = 0.7f;\n\t\tbool _doingDelimiter;\n\n\t\tprivate float _dragOffInterval = 0.015f;\n\t\tprivate float _dragOffTimer = 0f;\n\n\t\tpublic string OffsetText\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar ret = \"\";\n\t\t\t\tvar lines = TextLines;\n\t\t\t\tvar allowedWidth = Width;\n\t\t\t\tvar allowedHeight = Height;\n\t\t\t\tfor (var iY = _offsetY; iY < lines.Length; iY++)\n\t\t\t\t{\n\t\t\t\t\tvar curLine = lines[iY];\n\t\t\t\t\tvar curLineRet = \"\";\n\t\t\t\t\tfor (int iX = _offsetX; iX < curLine.Length; iX++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar lineWidth = (int)GeeUIMain.Font.MeasureString(curLineRet + curLine[iX]).X;\n\t\t\t\t\t\tif (lineWidth >= allowedWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurLineRet += curLine[iX];\n\t\t\t\t\t}\n\t\t\t\t\tShownWidth = curLineRet.Length;\n\t\t\t\t\tvar retTest = ret + curLineRet + (iY + 1 != lines.Length ? \"\\n\" : \"\");\n\t\t\t\t\tvar maxHeight = (int)GeeUIMain.Font.MeasureString(retTest).Y;\n\t\t\t\t\tret += curLineRet + (iY + 1 != lines.Length ? \"\\n\" : \"\");\n\t\t\t\t\tif (maxHeight >= allowedHeight)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\n\t\tpublic string[] TextLines\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Text.Split('\\n');\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tstring cur = \"\";\n\t\t\t\tfor (int i = 0; i < value.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tcur += value[i];\n\t\t\t\t\tif (i < value.Length - 1)\n\t\t\t\t\t\tcur += \"\\n\";\n\t\t\t\t}\n\t\t\t\tText = cur;\n\t\t\t}\n\t\t}\n\n\t\tprivate string _validationRegexString = \"\";\n\t\tprivate Regex _validationRegex;\n\n\t\tpublic string ValidationRegex\n\t\t{\n\t\t\tget { return _validationRegexString; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_validationRegexString = value;\n\t\t\t\t_validationRegex = new Regex(value);\n\t\t\t}\n\t\t}\n\n\t\tpublic Func<string, bool> Validator;\n\n\t\tpublic TextFieldView(GeeUIMain GeeUI, View rootView, Vector2 position)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t\tNinePatchDefault = GeeUIMain.NinePatchTextFieldDefault;\n\t\t\tNinePatchSelected = GeeUIMain.NinePatchTextFieldSelected;\n\t\t\tNinePatchRegexGood = GeeUIMain.NinePatchTextFieldRight;\n\t\t\tNinePatchRegexBad = GeeUIMain.NinePatchTextFieldWrong;\n\n\t\t\tPosition.Value = position;\n\n\t\t\tGeeUI.OnKeyPressedHandler += keyPressedHandler;\n\t\t\tGeeUI.OnKeyReleasedHandler += keyReleasedHandler;\n\n\t\t\tTextColor = GeeUI.TextColorDefault;\n\n\t\t\tContentMustBeScissored.Value = true;\n\n\t\t\t//Text = new Property<string>();\n\t\t\t//Text.Get = () => MultiLine ? Text.Value : Text.Value.Replace(\"\\n\", \"\");\n\t\t}\n\n\t\tvoid keyReleasedHandler(string keyReleased, Keys key)\n\t\t{\n\t\t\tif (_buttonHeld != key) return;\n\t\t\t_buttonHeldTime = 0;\n\t\t\t_buttonHeld = Keys.None;\n\t\t\t_buttonHeldTimePreRepeat = 0;\n\t\t\t_buttonHeldString = \"\";\n\t\t}\n\n\t\tprivate bool justReceivedFocus;\n\t\tpublic override void Focus()\n\t\t{\n\t\t\tbase.Focus();\n\t\t\tthis.justReceivedFocus = true;\n\t\t}\n\n\t\tvoid keyPressedHandler(string keyPressed, Keys key)\n\t\t{\n\t\t\tif (!Selected || !Editable) return;\n\t\t\tif (_buttonHeld != key)\n\t\t\t{\n\t\t\t\t_buttonHeld = key;\n\t\t\t\t_buttonHeldTime = 0;\n\t\t\t\t_buttonHeldTimePreRepeat = 0;\n\t\t\t\t_buttonHeldString = keyPressed;\n\t\t\t}\n\t\t\tbool ctrlPressed = InputManager.IsKeyPressed(Keys.LeftControl) || InputManager.IsKeyPressed(Keys.RightControl);\n\n\t\t\tif (ctrlPressed)\n\t\t\t{\n\t\t\t\tswitch (key)\n\t\t\t\t{\n\t\t\t\t\tcase Keys.A:\n\t\t\t\t\t\tthis._selectionStart = new Vector2(0, 0);\n\t\t\t\t\t\tthis._selectionEnd = new Vector2(TextLines[TextLines.Length - 1].Length, TextLines.Length - 1);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Keys.C:\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Keys.X:\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Keys.V:\n\t\t\t\t\t\tstring text = Clipboard.GetText();\n\t\t\t\t\t\tif (!String.IsNullOrEmpty(text))\n\t\t\t\t\t\t\tAppendTextCursor(text);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Keys.Back:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tswitch (key)\n\t\t\t\t{\n\t\t\t\t\tcase Keys.Back:\n\t\t\t\t\t\terase(false);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Keys.Delete:\n\t\t\t\t\t\terase(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Keys.Left:\n\t\t\t\t\t\tSelectionArrowKeys();\n\t\t\t\t\t\tMoveCursorX(-1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Keys.Right:\n\t\t\t\t\t\tSelectionArrowKeys();\n\t\t\t\t\t\tMoveCursorX(1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Keys.Up:\n\t\t\t\t\t\tSelectionArrowKeys();\n\t\t\t\t\t\tMoveCursorY(-1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Keys.Down:\n\t\t\t\t\t\tSelectionArrowKeys();\n\t\t\t\t\t\tMoveCursorY(1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Keys.Enter:\n\t\t\t\t\t\tif (MultiLine)\n\t\t\t\t\t\t\tAppendTextCursor(\"\\n\");\n\t\t\t\t\t\telse if (Text.Length != 0 && OnTextSubmitted != null && this.Validate())\n\t\t\t\t\t\t\tOnTextSubmitted();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Keys.Space:\n\t\t\t\t\t\tAppendTextCursor(\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Keys.Tab:\n\t\t\t\t\t\tif (InputManager.IsKeyPressed(Keys.LeftControl))\n\t\t\t\t\t\t\tthis.Blur();\n\n\t\t\t\t\t\tif (this.AllowTab && !this.justReceivedFocus)\n\t\t\t\t\t\t\tthis.FocusNextInputView(reverse: InputManager.IsKeyPressed(Keys.LeftShift));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (this.Filter(key))\n\t\t\t\t\t\t\tAppendTextCursor(keyPressed);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tReEvaluateOffset();\n\t\t}\n\n\t\tprivate void SelectionArrowKeys()\n\t\t{\n\t\t\tif (_selectionEnd == _selectionStart || _selectionEnd == new Vector2(-1)) return;\n\n\t\t\tvar start = _selectionStart;\n\t\t\tvar end = _selectionEnd;\n\t\t\tif (_selectionStart.Y > _selectionEnd.Y || (_selectionStart.Y == _selectionEnd.Y && _selectionStart.X > _selectionEnd.X))\n\t\t\t{\n\t\t\t\t//Need to swap the variables.\n\t\t\t\tvar store = start;\n\t\t\t\tstart = end;\n\t\t\t\tend = store;\n\t\t\t}\n\t\t\t_cursorX = (int)end.X;\n\t\t\t_cursorY = (int)end.Y;\n\t\t\t_selectionEnd = _selectionStart = new Vector2(-1);\n\t\t}\n\n\t\tprivate void erase(bool forward)\n\t\t{\n\t\t\tif (_selectionStart == _selectionEnd || _selectionEnd == new Vector2(-1))\n\t\t\t{\n\t\t\t\tvar lines = TextLines;\n\t\t\t\tvar curPos = _cursorX;\n\t\t\t\tfor (var i = 0; i < _cursorY; i++)\n\t\t\t\t{\n\t\t\t\t\tvar lineL = lines[i] + (i < _cursorY ? \"\\n\" : \"\");\n\t\t\t\t\tcurPos += lineL.Length;\n\t\t\t\t}\n\n\t\t\t\tif (forward && curPos < Text.Length)\n\t\t\t\t\tText = Text.Remove(curPos, 1);\n\t\t\t\telse if (!forward && curPos > 0)\n\t\t\t\t{\n\t\t\t\t\tText = Text.Remove(curPos - 1, 1);\n\t\t\t\t\t_cursorX--;\n\t\t\t\t}\n\n\t\t\t\tif (_cursorX < 0)\n\t\t\t\t{\n\t\t\t\t\t_cursorX = lines[_cursorY - 1].Length;\n\t\t\t\t\t_cursorY--;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\tvar start = _selectionStart;\n\t\t\tvar end = _selectionEnd;\n\t\t\tif (_selectionStart.Y > _selectionEnd.Y || (_selectionStart.Y == _selectionEnd.Y && _selectionStart.X > _selectionEnd.X))\n\t\t\t{\n\t\t\t\t//Need to swap the variables.\n\t\t\t\tvar store = start;\n\t\t\t\tstart = end;\n\t\t\t\tend = store;\n\t\t\t}\n\t\t\tstring before = \"\";\n\t\t\tstring after = \"\";\n\n\t\t\tfloat beforeEndX = start.X;\n\t\t\tfloat beforeEndY = start.Y;\n\t\t\tfloat afterStartX = end.X;\n\t\t\tfloat afterStartY = end.Y;\n\n\t\t\tfor (int y = 0; y <= beforeEndY; y++)\n\t\t\t{\n\t\t\t\tif (y != 0) before += \"\\n\";\n\t\t\t\tvar xUnder = (y == beforeEndY) ? beforeEndX : TextLines[y].Length;\n\t\t\t\tfor (int x = 0; x < xUnder; x++)\n\t\t\t\t{\n\t\t\t\t\tbefore += TextLines[y][x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var y = afterStartY; y < TextLines.Length; y++)\n\t\t\t{\n\t\t\t\tif (y != afterStartY) after += \"\\n\";\n\t\t\t\tfor (var x = afterStartX; x < TextLines[(int)y].Length; x++)\n\t\t\t\t{\n\t\t\t\t\tafter += TextLines[(int)y][(int)x];\n\t\t\t\t}\n\t\t\t\tafterStartX = 0;\n\t\t\t}\n\t\t\tText = before;\n\t\t\t//Hacky way of easily finding the co-ordinates for the new cursor position.\n\t\t\t_cursorY = TextLines.Length - 1;\n\t\t\t_cursorX = TextLines[_cursorY].Length;\n\t\t\tText += after;\n\n\t\t\t_selectionEnd = _selectionStart = new Vector2(-1);\n\t\t}\n\n\t\tprivate void MoveCursorX(int xMovement)\n\t\t{\n\t\t\tstring[] lines = TextLines;\n\t\t\t_cursorX += xMovement;\n\t\t\tif (_cursorX < 0)\n\t\t\t{\n\t\t\t\tint yMinus = _cursorY - 1;\n\t\t\t\tif (yMinus < 0)\n\t\t\t\t{\n\t\t\t\t\t_cursorX = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstring line = lines[yMinus];\n\t\t\t\t\t_cursorX = line.Length;\n\t\t\t\t\t_cursorY = yMinus;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (_cursorX > lines[_cursorY].Length)\n\t\t\t{\n\t\t\t\tif (_cursorY < lines.Length - 1)\n\t\t\t\t{\n\t\t\t\t\t_cursorY++;\n\t\t\t\t\t_cursorX = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_cursorX = lines[_cursorY].Length;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tReEvaluateOffset();\n\t\t}\n\n\t\tprivate void MoveCursorY(int yMovement)\n\t\t{\n\t\t\tstring[] lines = TextLines;\n\t\t\t_cursorY += yMovement;\n\t\t\tif (_cursorY >= lines.Length) _cursorY = lines.Length - 1;\n\t\t\telse if (_cursorY < 0) _cursorY = 0;\n\t\t\tstring line = lines[_cursorY];\n\t\t\tif (_cursorX >= line.Length) _cursorX = line.Length;\n\n\t\t\tReEvaluateOffset();\n\t\t}\n\n\t\tprivate void MoveOffsetX(int xMovement, bool moveSelection)\n\t\t{\n\t\t\tif (_offsetX + xMovement > (TextLines[_cursorY].Length - ShownWidth)) xMovement = (TextLines[_cursorY].Length - ShownWidth) - _offsetX;\n\t\t\tif (_offsetX + xMovement < 0) xMovement = -_offsetX;\n\t\t\t_offsetX += xMovement;\n\t\t\tif (moveSelection)\n\t\t\t{\n\t\t\t\t_selectionEnd.X += xMovement;\n\t\t\t}\n\t\t}\n\n\t\tprivate void ReEvaluateOffset()\n\t\t{\n\t\t\tif (_selectionStart == _selectionEnd)\n\t\t\t\t_selectionEnd = _selectionStart = Vector2.Zero;\n\t\t\tvar ret = \"\";\n\t\t\tvar lines = TextLines;\n\t\t\tvar allowedWidth = Width;\n\t\t\tvar allowedHeight = Height;\n\n\t\t\tvar maxCharX = 0;\n\t\t\tvar maxCharY = 0;\n\n\t\t\tvar xDiff = _cursorX - _offsetX;\n\t\t\tvar yDiff = _cursorY - _offsetY;\n\n\t\t\tif (xDiff < 0) _offsetX += xDiff;\n\t\t\tif (yDiff < 0) _offsetY += yDiff;\n\n\t\t\tfor (var iY = _offsetY; iY < lines.Length; iY++)\n\t\t\t{\n\t\t\t\tvar curLine = lines[iY];\n\t\t\t\tvar curLineRet = \"\";\n\t\t\t\tfor (var iX = _offsetX; iX < curLine.Length; iX++)\n\t\t\t\t{\n\t\t\t\t\tvar lineWidth = (int)GeeUIMain.Font.MeasureString(curLineRet + curLine[iX]).X;\n\t\t\t\t\tif (lineWidth >= allowedWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcurLineRet += curLine[iX];\n\t\t\t\t\tif (iY == _cursorY)\n\t\t\t\t\t\tmaxCharX++;\n\t\t\t\t}\n\t\t\t\tret += curLineRet + (iY + 1 != lines.Length ? \"\\n\" : \"\");\n\t\t\t\tvar lineHeight = (int)GeeUIMain.Font.MeasureString(ret).Y;\n\t\t\t\tif (lineHeight >= allowedHeight)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tmaxCharY++;\n\t\t\t}\n\t\t\tif (maxCharX < xDiff)\n\t\t\t\t_offsetX += xDiff - maxCharX;\n\t\t\tif (maxCharY < yDiff) _offsetY++;\n\t\t}\n\n\t\tpublic Func<Keys, bool> Filter = x => true;\n\n\t\tprivate void AppendTextCursor(string text)\n\t\t{\n\t\t\tstring before = \"\";\n\t\t\tstring after = \"\";\n\n\t\t\tfloat beforeEndX = _cursorX;\n\t\t\tfloat beforeEndY = _cursorY;\n\t\t\tfloat afterStartX = _cursorX;\n\t\t\tfloat afterStartY = _cursorY;\n\n\t\t\tif (_selectionStart != _selectionEnd && _selectionEnd != new Vector2(-1))\n\t\t\t{\n\t\t\t\tvar start = _selectionStart;\n\t\t\t\tvar end = _selectionEnd;\n\t\t\t\tif (_selectionStart.Y > _selectionEnd.Y || (_selectionStart.Y == _selectionEnd.Y && _selectionStart.X > _selectionEnd.X))\n\t\t\t\t{\n\t\t\t\t\t//Need to swap the variables.\n\t\t\t\t\tvar store = start;\n\t\t\t\t\tstart = end;\n\t\t\t\t\tend = store;\n\t\t\t\t}\n\n\t\t\t\tbeforeEndX = start.X;\n\t\t\t\tbeforeEndY = start.Y;\n\t\t\t\tafterStartX = end.X;\n\t\t\t\tafterStartY = end.Y;\n\t\t\t}\n\t\t\tfor (int y = 0; y <= beforeEndY; y++)\n\t\t\t{\n\t\t\t\tif (y != 0) before += \"\\n\";\n\t\t\t\tvar xUnder = (y == beforeEndY) ? beforeEndX : TextLines[y].Length;\n\t\t\t\tfor (int x = 0; x < xUnder && x < TextLines[y].Length; x++)\n\t\t\t\t{\n\t\t\t\t\tbefore += TextLines[y][x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var y = afterStartY; y < TextLines.Length; y++)\n\t\t\t{\n\t\t\t\tif (y != afterStartY) after += \"\\n\";\n\t\t\t\tfor (var x = afterStartX; x < TextLines[(int)y].Length; x++)\n\t\t\t\t{\n\t\t\t\t\tafter += TextLines[(int)y][(int)x];\n\t\t\t\t}\n\t\t\t\tafterStartX = 0;\n\t\t\t}\n\t\t\tText = before + text;\n\t\t\t//Hacky way of easily finding the co-ordinates for the new cursor position.\n\t\t\t_cursorY = TextLines.Length - 1;\n\t\t\t_cursorX = TextLines[_cursorY].Length;\n\t\t\tText += after;\n\n\t\t\t_selectionEnd = _selectionStart = new Vector2(-1);\n\t\t}\n\n\t\tpublic void AppendText(string text)\n\t\t{\n\t\t\tText += text;\n\t\t}\n\n\t\tprivate void CallOnChanged()\n\t\t{\n\t\t\tif (OnTextChanged == null || _callingOnChanged) return;\n\t\t\t_callingOnChanged = true;\n\t\t\tOnTextChanged();\n\t\t\t_callingOnChanged = false;\n\t\t}\n\n\t\tpublic void SetCursorPos(int x, int y)\n\t\t{\n\t\t\t_cursorX = x;\n\t\t\t_cursorY = y;\n\t\t\tReEvaluateOffset();\n\t\t}\n\n\t\tpublic bool Validate()\n\t\t{\n\t\t\tif (!MustValidate()) return true;\n\t\t\treturn this.Validator != null ? this.Validator(this.Text) : _validationRegex.IsMatch(Text);\n\t\t}\n\n\t\tpublic bool MustValidate()\n\t\t{\n\t\t\treturn this.Validator != null || !(ValidationRegex == \"\" || _validationRegex == null);\n\t\t}\n\n\t\tpublic Vector2 GetMouseTextPos(Vector2 pos)\n\t\t{\n\t\t\tvar lines = TextLines;\n\n\t\t\tvar patch = Selected ? NinePatchSelected : NinePatchDefault;\n\n\t\t\tvar topLeftContentPos = AbsolutePosition + new Vector2(patch.LeftWidth, patch.TopHeight);\n\t\t\tvar actualClickPos = pos - topLeftContentPos;\n\n\t\t\tvar ret = new Vector2();\n\n\t\t\tvar actualText = \"\";\n\n\t\t\tbool setY = false;\n\t\t\tbool setX = false;\n\t\t\tfor (var iY = _offsetY; iY < lines.Length; iY++)\n\t\t\t{\n\t\t\t\tvar textHeight = (int)GeeUIMain.Font.MeasureString(actualText + lines[iY]).Y;\n\t\t\t\tif (textHeight >= actualClickPos.Y)\n\t\t\t\t{\n\t\t\t\t\tret.Y = iY;\n\t\t\t\t\tsetY = true;\n\n\t\t\t\t\tvar line = lines[iY];\n\n\t\t\t\t\t//No need to make another variable\n\t\t\t\t\tactualText = \"\";\n\n\t\t\t\t\tfor (int iX = _offsetX; iX < line.Length; iX++)\n\t\t\t\t\t{\n\t\t\t\t\t\tactualText += line[iX];\n\t\t\t\t\t\tvar textWidth = (int)GeeUIMain.Font.MeasureString(actualText).X;\n\t\t\t\t\t\tif (textWidth < actualClickPos.X) continue;\n\t\t\t\t\t\tret.X = iX;\n\t\t\t\t\t\tsetX = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tactualText += lines[iY] + \"\\n\";\n\t\t\t}\n\t\t\tif (!setY) ret.Y = TextLines.Length - 1;\n\t\t\tif (!setX)\n\t\t\t\tret.X = TextLines[(int)ret.Y].Length;\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic override void OnMScroll(Vector2 position, int scrollDelta, bool fromChild = false)\n\t\t{\n\t\t\tif ((!Selected && !MouseOver) || !MultiLine)\n\t\t\t{\n\t\t\t\tbase.OnMScroll(position, scrollDelta, fromChild);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tint origOffset = _offsetY;\n\t\t\tint numLines = OffsetText.Split('\\n').Length;\n\t\t\t_offsetY -= scrollDelta;\n\t\t\tif (_offsetY < 0) _offsetY = 0;\n\t\t\tif (_offsetY >= TextLines.Length) _offsetY = TextLines.Length - 1;\n\t\t\tint newLines = OffsetText.Split('\\n').Length;\n\t\t\tif (newLines < numLines && _offsetY > origOffset)\n\t\t\t{\n\t\t\t\t_offsetY = origOffset;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void OnMClick(Vector2 mousePosition, bool fromChild)\n\t\t{\n\t\t\tSelected.Value = true;\n\n\t\t\tvar clickPos = GetMouseTextPos(mousePosition);\n\t\t\t_cursorX = (int)clickPos.X;\n\t\t\t_cursorY = (int)clickPos.Y;\n\n\t\t\t_selectionStart = clickPos;\n\n\t\t\tbase.OnMClick(mousePosition, fromChild);\n\t\t}\n\n\t\tpublic override void OnMClickAway()\n\t\t{\n\t\t\tbool oldSelected = Selected.Value;\n\t\t\tSelected.Value = false;\n\t\t\t_selectionEnd = _selectionStart = new Vector2(-1);\n\t\t\tif (OnTextSubmitted != null && oldSelected && !Selected.Value && SubmitOnClickAway && this.Validate())\n\t\t\t\tOnTextSubmitted();\n\t\t\tbase.OnMClickAway();\n\t\t}\n\n\t\tprivate Vector2 GetDrawPosForCursorPos(int cursorX, int cursorY)\n\t\t{\n\t\t\tvar patch = Selected ? NinePatchSelected : NinePatchDefault;\n\t\t\tvar lines = TextLines;\n\n\t\t\tvar totalLine = \"\";\n\t\t\tfor (int i = _offsetY; i < cursorY && i < lines.Length; i++)\n\t\t\t{\n\t\t\t\tvar line = lines[i];\n\t\t\t\tvar addNewline = (i < cursorY - 1) || (i == cursorY && line.Length == 0);\n\t\t\t\tvar addSpace = (line.Length == 0);\n\t\t\t\tline += (addNewline ? \"\\n\" : \"\");\n\t\t\t\tline += (addSpace ? \" \" : \"\");\n\t\t\t\ttotalLine += line;\n\t\t\t}\n\n\t\t\tvar yDrawPos = (int)(AbsoluteY + patch.TopHeight + GeeUIMain.Font.MeasureString(totalLine).Y);\n\t\t\tvar yDrawLine = lines[cursorY];\n\t\t\tvar cur = \"\";\n\t\t\tfor (var x = _offsetX; x < cursorX && x < yDrawLine.Length; x++)\n\t\t\t\tcur += yDrawLine[x];\n\t\t\tvar xDrawPos = (int)GeeUIMain.Font.MeasureString(cur).X + (AbsoluteX + patch.LeftWidth);\n\n\t\t\treturn new Vector2(xDrawPos, yDrawPos);\n\t\t}\n\n\t\tpublic void ClearText()\n\t\t{\n\t\t\tthis.Text = \"\";\n\t\t\tthis._cursorX = 0;\n\t\t\tthis._cursorY = 0;\n\t\t\tthis._offsetX = 0;\n\t\t\tthis._offsetY = 0;\n\t\t}\n\n\t\tpublic override void Update(float dt)\n\t\t{\n\t\t\tVector2 pos = InputManager.GetMousePosV();\n\t\t\tif (Selected)\n\t\t\t{\n\t\t\t\tif (InputManager.IsMousePressed(MouseButton.Left))\n\t\t\t\t{\n\t\t\t\t\tif (!AbsoluteBoundBox.Contains(InputManager.GetMousePos()))\n\t\t\t\t\t{\n\t\t\t\t\t\t_dragOffTimer += dt;\n\t\t\t\t\t\tif (_dragOffTimer >= _dragOffInterval)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_dragOffTimer -= _dragOffInterval;\n\t\t\t\t\t\t\tif (pos.X > AbsoluteBoundBox.Right)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tMoveOffsetX(1, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (pos.X < AbsoluteBoundBox.Left)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tMoveOffsetX(-1, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\tvar clickPos = GetMouseTextPos(InputManager.GetMousePosV());\n\t\t\t\t\t_selectionEnd = clickPos;\n\t\t\t\t\t_cursorX = (int)clickPos.X;\n\t\t\t\t\t_cursorY = (int)clickPos.Y;\n\t\t\t\t}\n\n\t\t\t\tif (InputManager.IsKeyPressed(_buttonHeld))\n\t\t\t\t{\n\t\t\t\t\t_buttonHeldTimePreRepeat += dt;\n\t\t\t\t\t_buttonHeldTime += dt;\n\t\t\t\t\tif (_buttonHeldTimePreRepeat >= 0.35 && _buttonHeldTime >= 0.03)\n\t\t\t\t\t{\n\t\t\t\t\t\t_buttonHeldTime = 0;\n\t\t\t\t\t\tkeyPressedHandler(_buttonHeldString, _buttonHeld);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tkeyReleasedHandler(\"\", _buttonHeld);\n\t\t\t\t}\n\n\t\t\t\t_delimiterTime += dt;\n\t\t\t\tif (_delimiterTime >= DelimiterLimit)\n\t\t\t\t{\n\t\t\t\t\t_doingDelimiter = !_doingDelimiter;\n\t\t\t\t\t_delimiterTime = 0;\n\t\t\t\t}\n\t\t\t\tthis.justReceivedFocus = false;\n\t\t\t}\n\n\t\t\tbase.Update(dt);\n\t\t}\n\n\t\tpublic override void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\tvar drawPos = GetDrawPosForCursorPos(_cursorX, _cursorY);\n\t\t\tvar xDrawPos = drawPos.X;\n\t\t\tvar yDrawPos = drawPos.Y;\n\n\t\t\tvar patch = Selected ? NinePatchSelected : NinePatchDefault;\n\t\t\tif (MustValidate() && Text.Length > 0)\n\t\t\t{\n\t\t\t\tpatch = Selected ? (Validate() ? NinePatchRegexGood : NinePatchRegexBad) : patch;\n\t\t\t}\n\t\t\tpatch.Draw(spriteBatch, AbsolutePosition, Width, Height, 0f, EffectiveOpacity);\n\n\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\n\t\tpublic override void DrawContent(SpriteBatch spriteBatch)\n\t\t{\n\t\t\tvar drawPos = GetDrawPosForCursorPos(_cursorX, _cursorY);\n\t\t\tvar xDrawPos = drawPos.X;\n\t\t\tvar yDrawPos = drawPos.Y;\n\n\t\t\tvar patch = Selected ? NinePatchSelected : NinePatchDefault;\n\t\t\tif (MustValidate() && Text.Length > 0)\n\t\t\t{\n\t\t\t\tpatch = Selected ? (Validate() ? NinePatchRegexGood : NinePatchRegexBad) : patch;\n\t\t\t}\n\t\t\tif (_selectionStart != _selectionEnd && _selectionEnd != new Vector2(-1))\n\t\t\t{\n\t\t\t\tvar start = _selectionStart;\n\t\t\t\tvar end = _selectionEnd;\n\t\t\t\tif (_selectionStart.Y > _selectionEnd.Y || (_selectionStart.Y == _selectionEnd.Y && _selectionStart.X > _selectionEnd.X))\n\t\t\t\t{\n\t\t\t\t\t//Need to swap the variables.\n\t\t\t\t\tvar store = start;\n\t\t\t\t\tstart = end;\n\t\t\t\t\tend = store;\n\t\t\t\t}\n\n\t\t\t\tfor (int y = (int)Math.Max(0, start.Y); y <= Math.Min(end.Y, TextLines.Length - 1); y++)\n\t\t\t\t{\n\t\t\t\t\tstring line = TextLines[y];\n\t\t\t\t\tif (line == \"\") line = \" \";\n\t\t\t\t\tvar startDrawX = patch.LeftWidth;\n\t\t\t\t\tvar startDrawY = GetDrawPosForCursorPos(0, y).Y;\n\t\t\t\t\tvar endDrawX = Width - patch.RightWidth;\n\t\t\t\t\tvar endDrawY = GeeUIMain.Font.MeasureString(line).Y + startDrawY - 1;\n\t\t\t\t\tstartDrawX += AbsoluteX;\n\t\t\t\t\tendDrawX += AbsoluteX;\n\n\t\t\t\t\tif (y == start.Y)\n\t\t\t\t\t{\n\t\t\t\t\t\tstartDrawX = (int)GetDrawPosForCursorPos((int)start.X, (int)start.Y).X;\n\t\t\t\t\t}\n\t\t\t\t\tif (y == end.Y)\n\t\t\t\t\t{\n\t\t\t\t\t\tendDrawX = (int)GetDrawPosForCursorPos((int)end.X, (int)end.Y).X;\n\t\t\t\t\t}\n\t\t\t\t\tif (y == 0) endDrawY += 1;\n\n\t\t\t\t\tDrawManager.DrawBox(new Vector2(startDrawX, startDrawY), new Vector2(endDrawX, endDrawY), DefaultSelectionColor * EffectiveOpacity, spriteBatch, 0f, 20);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tspriteBatch.DrawString(GeeUIMain.Font, OffsetText, AbsolutePosition + new Vector2(patch.LeftWidth, patch.TopHeight), TextColor * EffectiveOpacity);\n\n\t\t\tif (_doingDelimiter && Selected && _selectionEnd == _selectionStart && Editable)\n\t\t\t{\n\t\t\t\tfloat height = GeeUIMain.Font.MeasureString(\"|\").Y;\n\t\t\t\tDrawManager.DrawBox(new Vector2(xDrawPos, yDrawPos), new Vector2(xDrawPos + 1, yDrawPos + height), TextColor * EffectiveOpacity, spriteBatch  );\n\t\t\t\t//spriteBatch.DrawString(GeeUIMain.Font, \"|\", new Vector2(xDrawPos - 1, yDrawPos), TextColor * EffectiveOpacity);\n\t\t\t}\n\t\t\tbase.DrawContent(spriteBatch);\n\t\t}\n\n\t\tpublic override void OnDelete()\n\t\t{\n\t\t\tParentGeeUI.OnKeyPressedHandler -= keyPressedHandler;\n\t\t\tParentGeeUI.OnKeyReleasedHandler -= keyReleasedHandler;\n\t\t\tbase.OnDelete();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/TextView.cs",
    "content": "﻿using ComponentBind;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework;\nusing GeeUI.Managers;\n\nnamespace GeeUI.Views\n{\n\tpublic class TextView : View\n\t{\n\t\tpublic Property<string> Text = new Property<string>() { Value = \"\" };\n\n\t\tpublic Color TextColor;\n\n\t\tpublic TextJustification TextJustification = TextJustification.Left;\n\n\t\tpublic Property<float> TextScale = new Property<float>() { Value = 1f };\n\n\t\tpublic float TextWidth\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn (GeeUIMain.Font.MeasureString(Text).X * TextScale.Value);\n\t\t\t}\n\t\t}\n\n\t\tprivate Vector2 TextOrigin\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar width = (int)(GeeUIMain.Font.MeasureString(Text).X * TextScale.Value);\n\t\t\t\tvar height = (int)(GeeUIMain.Font.MeasureString(Text).Y * TextScale.Value);\n\t\t\t\tswitch (TextJustification)\n\t\t\t\t{\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn new Vector2(0, 0);\n\n\t\t\t\t\tcase TextJustification.Center:\n\t\t\t\t\t\treturn new Vector2((Width.Value/2) - (width/2), (Height.Value/2) - (height/2))*new Vector2(-1, -1);\n\n\t\t\t\t\tcase TextJustification.Right:\n\t\t\t\t\t\treturn new Vector2(Width.Value - width, 0) * -1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<bool> AutoSize = new Property<bool>() { Value = true };\n\n\t\tpublic TextView(GeeUIMain GeeUI, View rootView, string text, Vector2 position)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t\tText.Value = text;\n\t\t\tPosition.Value = position;\n\t\t\tTextColor = GeeUI.TextColorDefault;\n\n\t\t\tText.AddBinding(new NotifyBinding(HandleResize, Text));\n\t\t\tif(AutoSize.Value) HandleResize();\n\t\t}\n\n\t\tprivate void HandleResize()\n\t\t{\n\t\t\tif (this.AutoSize)\n\t\t\t{\n\t\t\t\tvar width = (int)(GeeUIMain.Font.MeasureString(Text).X * TextScale.Value);\n\t\t\t\tvar height = (int)(GeeUIMain.Font.MeasureString(Text).Y * TextScale.Value);\n\t\t\t\tthis.Width.Value = width;\n\t\t\t\tthis.Height.Value = height;\n\t\t\t}\n\t\t}\n\n\t\tinternal static string TruncateString(string input, int widthAllowed, string ellipsis = \"...\")\n\t\t{\n\t\t\tstring cur = \"\";\n\t\t\tforeach (char t in input)\n\t\t\t{\n\t\t\t\tfloat width = GeeUIMain.Font.MeasureString(cur + t + ellipsis).X;\n\t\t\t\tif (width > widthAllowed)\n\t\t\t\t\tbreak;\n\t\t\t\tcur += t;\n\t\t\t}\n\t\t\treturn cur + (cur.Length != input.Length ? ellipsis : \"\");\n\t\t}\n\n\t\tpublic override void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\tspriteBatch.DrawString(GeeUIMain.Font, Text, AbsolutePosition, TextColor * EffectiveOpacity, 0f, TextOrigin, TextScale.Value, SpriteEffects.None, 0f);\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\n\t}\n\tpublic enum TextJustification\n\t{\n\t\tLeft,\n\t\tCenter,\n\t\tRight\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/View.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing ComponentBind;\nusing Lemma;\nusing Lemma.Components;\nusing Lemma.GeeUI.Composites;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing GeeUI.Structs;\nusing GeeUI.ViewLayouts;\nusing System.Collections.ObjectModel;\n\nnamespace GeeUI.Views\n{\n\tpublic class View : Bindable\n\t{\n\t\tpublic delegate void MouseClickEventHandler(object sender, EventArgs e);\n\t\tpublic delegate void MouseOverEventHandler(object sender, EventArgs e);\n\t\tpublic delegate void MouseOffEventHandler(object sender, EventArgs e);\n\t\tpublic delegate void MouseScrollEventHandler(int delta);\n\n\t\tpublic event MouseClickEventHandler OnMouseClick;\n\t\tpublic event MouseClickEventHandler OnMouseRightClick;\n\t\tpublic event MouseClickEventHandler OnMouseClickAway;\n\t\tpublic event MouseOverEventHandler OnMouseOver;\n\t\tpublic event MouseOffEventHandler OnMouseOff;\n\t\tpublic event MouseScrollEventHandler OnMouseScroll;\n\n\t\tpublic GeeUIMain ParentGeeUI;\n\t\tpublic Property<View> ParentView = new Property<View>();\n\n\t\tpublic List<ViewLayout> ChildrenLayouts = new List<ViewLayout>();\n\n\t\tpublic Property<bool> IgnoreParentBounds = new Property<bool>() { Value = true };\n\t\tpublic Property<bool> Selected = new Property<bool>() { Value = false };\n\t\tpublic Property<bool> Active = new Property<bool>() { Value = true };\n\t\tpublic Property<bool> EnabledScissor = new Property<bool>() { Value = true };\n\t\tpublic Property<bool> ContentMustBeScissored = new Property<bool>() { Value = false };\n\n\t\tpublic Property<bool> AllowMouseEvents = new Property<bool>() { Value = true };\n\n\t\tpublic Property<bool> EnforceRootAttachment = new Property<bool>() { Value = true };\n\n\t\tpublic bool TemporarilyIgnoreMouseClickAway;\n\n\t\tprotected int numChildrenAllowed = -1;\n\n\t\tpublic ToolTip ToolTipView;\n\t\tprivate Property<string> _toolTipText = new Property<string>();\n\t\tprivate float _toolTipTimer;\n\n\t\tpublic Property<float> MyOpacity = new Property<float> { Value = 1f };\n\n\t\tpublic Property<bool> Attached = new Property<bool>();\n\n\t\tpublic float EffectiveOpacity\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (ParentView.Value == null) return MyOpacity;\n\t\t\t\treturn MyOpacity * ParentView.Value.EffectiveOpacity;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual void LoadContent(bool reload)\n\t\t{\n\n\t\t}\n\n\t\tpublic string Name;\n\n\t\tprotected bool _mouseOver;\n\t\t\n\t\tpublic bool MouseOver\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _mouseOver;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tbool old = _mouseOver;\n\t\t\t\t_mouseOver = value;\n\t\t\t\tif (!old && value)\n\t\t\t\t\tOnMOver();\n\t\t\t\telse if (old && !value)\n\t\t\t\t\tOnMOff();\n\n\t\t\t\tif (!value)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < this.Children.Length; i++)\n\t\t\t\t\t\tthis.Children[i].MouseOver = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual Rectangle BoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Rectangle(RealX, RealY, Width, Height);\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual Rectangle AbsoluteBoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (ParentView.Value == null) return BoundBox;\n\t\t\t\tRectangle curBB = BoundBox;\n\t\t\t\treturn new Rectangle(AbsoluteX, AbsoluteY, curBB.Width, curBB.Height);\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual Rectangle ContentBoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn BoundBox;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual Rectangle AbsoluteContentBoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (ParentView.Value == null) return ContentBoundBox;\n\t\t\t\tRectangle curBB = ContentBoundBox;\n\t\t\t\tcurBB.X += AbsoluteX - RealX;\n\t\t\t\tcurBB.Y += AbsoluteY - RealY;\n\t\t\t\treturn curBB;\n\t\t\t}\n\t\t}\n\n\t\tpublic int X\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn (int)Position.Value.X;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tPosition.Value = new Vector2(value, Y);\n\t\t\t}\n\t\t}\n\t\tpublic int Y\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn (int)Position.Value.Y;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tPosition.Value = new Vector2(X, value);\n\t\t\t}\n\t\t}\n\n\t\tpublic int RealX\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (ParentView.Value == null) return X - (int)AnchorOffset.X;\n\t\t\t\treturn X - (int)ParentView.Value.ContentOffset.Value.X - (int)AnchorOffset.X;\n\t\t\t}\n\t\t}\n\n\t\tpublic int RealY\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (ParentView.Value == null) return Y - (int)AnchorOffset.Y;\n\t\t\t\treturn Y - (int)ParentView.Value.ContentOffset.Value.Y - (int)AnchorOffset.Y;\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<Vector2> Position = new Property<Vector2>() { Value = Vector2.Zero };\n\n\t\tpublic Vector2 AnchorOffset\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Vector2((float)Width * AnchorPoint.Value.X, (float)Height * AnchorPoint.Value.Y);\n\t\t\t}\n\t\t}\n\t\tpublic Vector2 RealPosition\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Vector2(RealX, RealY);\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<Vector2> ContentOffset = new Property<Vector2>() { Value = Vector2.Zero };\n\n\t\tpublic Property<Vector2> AnchorPoint = new Property<Vector2>() { Value = Vector2.Zero };\n\n\t\tpublic int AbsoluteX\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn (int)AbsolutePosition.X;\n\t\t\t}\n\t\t}\n\t\tpublic int AbsoluteY\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn (int)AbsolutePosition.Y;\n\t\t\t}\n\t\t}\n\t\tpublic Vector2 AbsolutePosition\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (ParentView.Value == null) return RealPosition;\n\t\t\t\treturn RealPosition + ParentView.Value.AbsolutePosition;\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<int> Width = new Property<int>() { Value = 0 };\n\t\tpublic Property<int> Height = new Property<int>() { Value = 0 };\n\n\t\tpublic ListProperty<View> Children = new ListProperty<View>();\n\n\t\tpublic virtual void Focus()\n\t\t{\n\t\t\tthis.OnMClick(this.AbsolutePosition, false);\n\t\t}\n\n\t\tpublic virtual void Blur()\n\t\t{\n\t\t\tthis.OnMClickAway();\n\t\t}\n\n\t\tprivate View findInputView(bool reverse = false)\n\t\t{\n\t\t\tif (!this.Active)\n\t\t\t\treturn null;\n\n\t\t\tif (this is TextFieldView || this is DropDownView)\n\t\t\t\treturn this;\n\n\t\t\tfor (int i = reverse ? this.Children.Count - 1 : 0; reverse ? (i >= 0) : (i < this.Children.Count); i += reverse ? -1 : 1)\n\t\t\t{\n\t\t\t\tView inputView = this.Children[i].findInputView(reverse);\n\t\t\t\tif (inputView != null)\n\t\t\t\t\treturn inputView;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic void FocusNextInputView(bool reverse = false)\n\t\t{\n\t\t\tView parent = this.ParentView;\n\t\t\tView child = this;\n\t\t\twhile (parent != null)\n\t\t\t{\n\t\t\t\t// Find the current element in the parent's list of children\n\t\t\t\tbool found = false;\n\t\t\t\tbool foundChild = false;\n\t\t\t\tfor (int i = reverse ? parent.Children.Count - 1 : 0; reverse ? (i >= 0) : (i < parent.Children.Count); i += reverse ? -1 : 1)\n\t\t\t\t{\n\t\t\t\t\tView v = parent.Children[i];\n\t\t\t\t\tif (foundChild)\n\t\t\t\t\t{\n\t\t\t\t\t\t// We found the current element; now search our siblings for input views\n\t\t\t\t\t\tView inputView = v.findInputView(reverse);\n\t\t\t\t\t\tif (inputView != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinputView.Focus();\n\t\t\t\t\t\t\tthis.Blur();\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (v == child)\n\t\t\t\t\t\tfoundChild = true;\n\t\t\t\t}\n\n\t\t\t\tif (found)\n\t\t\t\t\tbreak;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tchild = parent;\n\t\t\t\t\tparent = parent.ParentView;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tinternal View(GeeUIMain theGeeUI)\n\t\t{\n\t\t\tParentGeeUI = theGeeUI;\n\n\t\t\tthis.Add(new SetBinding<bool>(this.Attached, delegate(bool value)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\t\tthis.Children[i].Attached.Value = value;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<View>(this.ParentView, delegate(View v)\n\t\t\t{\n\t\t\t\tif (v == null)\n\t\t\t\t{\n\t\t\t\t\tthis.Attached.Value = false;\n\t\t\t\t\tthis.ParentGeeUI.PotentiallyDetached(this);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.Attached.Value = v.Attached;\n\t\t\t}));\n\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tView parent = this.ParentView;\n\t\t\t\tif (parent != null)\n\t\t\t\t\tparent.dirty = true;\n\t\t\t}, this.Position, this.Active, this.Width, this.Height));\n\n\t\t\tthis.Children.ItemAdded += delegate(int index, View child)\n\t\t\t{\n\t\t\t\tif (this.numChildrenAllowed != -1 && this.Children.Length > this.numChildrenAllowed)\n\t\t\t\t\tthrow new Exception(\"GeeUI view exceeded max number of allowed children\");\n\n\t\t\t\tchild.RemoveFromParent();\n\t\t\t\tchild.ParentView.Value = this;\n\t\t\t\tchild.ParentGeeUI = ParentGeeUI;\n\t\t\t\tthis.dirty = true;\n\t\t\t};\n\n\t\t\tthis.Children.ItemRemoved += delegate(int index, View child)\n\t\t\t{\n\t\t\t\tchild.ParentView.Value = null;\n\t\t\t\tthis.dirty = true;\n\t\t\t};\n\n\t\t\tthis.Children.Clearing += delegate()\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\t\tthis.Children[i].ParentView.Value = null;\n\t\t\t\tthis.dirty = true;\n\t\t\t};\n\n\t\t\tthis.Children.ItemChanged += delegate(int index, View old, View newValue)\n\t\t\t{\n\t\t\t\told.ParentView.Value = null;\n\t\t\t\tnewValue.ParentView.Value = this;\n\t\t\t\tthis.dirty = true;\n\t\t\t};\n\t\t}\n\n\t\tpublic View(GeeUIMain geeUi, View parent)\n\t\t\t: this(geeUi)\n\t\t{\n\t\t\tif (parent != null)\n\t\t\t\tparent.Children.Add(this);\n\t\t}\n\n\t\t#region Child management\n\n\t\tpublic virtual void OrderChildren()\n\t\t{\n\t\t\tfor (int i = 0; i < this.ChildrenLayouts.Count; i++)\n\t\t\t\tthis.ChildrenLayouts[i].OrderChildren(this);\n\t\t\tthis.dirty = false;\n\t\t}\n\t\t\n\t\tpublic List<View> FindChildrenByName(string name, int depth = -1, List<View> list = null)\n\t\t{\n\t\t\tif (list == null)\n\t\t\t\tlist = new List<View>();\n\t\t\tbool infinite = depth == -1;\n\t\t\tif (!infinite) depth--;\n\t\t\tif (depth >= 0 || infinite)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tView c = this.Children[i];\n\t\t\t\t\tif (c.Name == name)\n\t\t\t\t\t\tlist.Add(c);\n\t\t\t\t\tc.FindChildrenByName(name, infinite ? -1 : depth, list);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn list;\n\t\t}\n\n\t\tpublic View FindFirstChildByName(string name, int depth = -1)\n\t\t{\n\t\t\tbool infinite = depth == -1;\n\t\t\tif (!infinite) depth--;\n\n\t\t\tif (depth >= 0 || infinite)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tView c = this.Children[i];\n\t\t\t\t\tif (c.Name == name)\n\t\t\t\t\t\treturn c;\n\t\t\t\t\tforeach (var find in c.FindChildrenByName(name, infinite ? -1 : depth))\n\t\t\t\t\t\treturn find;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic void RemoveToolTip()\n\t\t{\n\t\t\t_toolTipTimer = 0f;\n\t\t\tif (this.ToolTipView != null)\n\t\t\t{\n\t\t\t\tthis.ToolTipView.RemoveFromParent();\n\t\t\t\tthis.ToolTipView = null;\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetToolTipText(string text)\n\t\t{\n\t\t\tif (text == null) return;\n\t\t\tthis._toolTipText.Value = text;\n\t\t}\n\n\t\tprivate void ShowToolTip()\n\t\t{\n\t\t\tRemoveToolTip();\n\t\t\tthis.ToolTipView = new ToolTip(ParentGeeUI, ParentGeeUI.RootView, this, this._toolTipText);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Setters\n\n\t\tpublic View SetWidth(int width)\n\t\t{\n\t\t\tthis.Width.Value = width;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic View SetHeight(int height)\n\t\t{\n\t\t\tthis.Height.Value = height;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic View SetPosition(Vector2 position)\n\t\t{\n\t\t\tthis.Position.Value = position;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic View SetOpacity(float opacity)\n\t\t{\n\t\t\tthis.MyOpacity.Value = opacity;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic View SetContentOffset(Vector2 offset)\n\t\t{\n\t\t\tthis.ContentOffset.Value = offset;\n\t\t\treturn this;\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void BringToFront()\n\t\t{\n\t\t\tView p = this.ParentView;\n\t\t\tif (p != null)\n\t\t\t\tp.BringChildToFront(this);\n\t\t}\n\n\t\tpublic void BringChildToFront(View view)\n\t\t{\n\t\t\tif (this.Children[this.Children.Length - 1] != view)\n\t\t\t{\n\t\t\t\tthis.Children.Remove(view);\n\t\t\t\tthis.Children.Add(view);\n\t\t\t\tthis.dirty = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic void RemoveFromParent()\n\t\t{\n\t\t\tView p = this.ParentView;\n\t\t\tif (p != null)\n\t\t\t\tp.Children.Remove(this);\n\t\t}\n\n\t\tpublic void ResetOnMouseClick()\n\t\t{\n\t\t\tthis.OnMouseClick = null;\n\t\t}\n\n\t\tpublic void ResetOnMouseScroll()\n\t\t{\n\t\t\tthis.OnMouseScroll = null;\n\t\t}\n\n\t\t#region Virtual methods/events\n\n\t\tpublic virtual void OnDelete()\n\t\t{\n\t\t\tthis.delete();\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tActive.Value = false;\n\t\t\tforeach (var child in Children)\n\t\t\t\tchild.OnDelete();\n\t\t\tthis.OnMouseClick = null;\n\t\t\tthis.OnMouseClickAway = null;\n\t\t\tthis.OnMouseOff = null;\n\t\t\tthis.OnMouseOver = null;\n\t\t\tthis.OnMouseRightClick = null;\n\t\t\tthis.OnMouseScroll = null;\n\t\t}\n\n\t\tpublic virtual void OnMScroll(Vector2 position, int scrollDelta, bool fromChild)\n\t\t{\n\t\t\tif (ParentView.Value != null) ParentView.Value.OnMScroll(position, scrollDelta, true);\n\t\t\tif (OnMouseScroll != null)\n\t\t\t\tOnMouseScroll(scrollDelta);\n\t\t}\n\n\t\tpublic virtual void OnMRightClick(Vector2 position, bool fromChild)\n\t\t{\n\t\t\tif (OnMouseRightClick != null)\n\t\t\t\tOnMouseRightClick(this, new EventArgs());\n\t\t\tif (ParentView.Value != null) ParentView.Value.OnMRightClick(position, true);\n\t\t}\n\n\t\tpublic virtual void OnMClick(Vector2 position, bool fromChild)\n\t\t{\n\t\t\tif (OnMouseClick != null)\n\t\t\t\tOnMouseClick(this, new EventArgs());\n\t\t\tif (ParentView.Value != null) ParentView.Value.OnMClick(position, true);\n\t\t}\n\n\t\tpublic virtual void OnMClickAway()\n\t\t{\n\t\t\tif (this.TemporarilyIgnoreMouseClickAway)\n\t\t\t\tthis.TemporarilyIgnoreMouseClickAway = false;\n\t\t\telse if (OnMouseClickAway != null)\n\t\t\t\tOnMouseClickAway(this, new EventArgs());\n\t\t}\n\n\t\tpublic virtual void OnMOver()\n\t\t{\n\t\t\tRemoveToolTip();\n\t\t\tif (OnMouseOver != null)\n\t\t\t\tOnMouseOver(this, new EventArgs());\n\t\t\tif (ParentView.Value != null) ParentView.Value.OnMOver();\n\t\t}\n\n\t\tpublic virtual void OnMOff()\n\t\t{\n\t\t\tRemoveToolTip();\n\t\t\tif (OnMouseOff != null)\n\t\t\t\tOnMouseOff(this, new EventArgs());\n\t\t\tif (ParentView.Value != null) ParentView.Value.OnMOff();\n\t\t}\n\n\t\tprotected bool dirty;\n\n\t\tpublic virtual void Update(float dt)\n\t\t{\n\t\t}\n\n\t\tpublic void PostUpdate(float dt)\n\t\t{\n\t\t\tif (MouseOver && !string.IsNullOrEmpty(_toolTipText.Value))\n\t\t\t{\n\t\t\t\t_toolTipTimer += dt;\n\t\t\t\tif (_toolTipTimer >= 1f && ToolTipView == null)\n\t\t\t\t\tShowToolTip();\n\t\t\t}\n\n\t\t\tif (this.dirty)\n\t\t\t\tthis.OrderChildren();\n\t\t}\n\n\t\tpublic virtual void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This will essentially cause the view to draw the things that should be scissored to its own bounds.\n\t\t/// </summary>\n\t\t/// <param name=\"spriteBatch\"></param>\n\t\tpublic virtual void DrawContent(SpriteBatch spriteBatch)\n\t\t{\n\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "Lemma/GeeUI/Views/WindowView.cs",
    "content": "﻿using GeeUI.Structs;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework;\nusing GeeUI.Managers;\n\nnamespace GeeUI.Views\n{\n\tpublic class WindowView : View\n\t{\n\t\tpublic NinePatch NinePatchSelected = new NinePatch();\n\t\tpublic NinePatch NinePatchNormal = new NinePatch();\n\n\t\tpublic string WindowText = \"Hello this is a VIEW!\";\n\n\t\tprotected internal bool SelectedOffChildren;\n\t\tprotected internal Vector2 LastMousePosition = Vector2.Zero;\n\t\tprotected internal Vector2 MouseSelectedOffset = Vector2.Zero;\n\n\t\t/// <summary>\n\t\t/// If true, the window can be dragged by the user.\n\t\t/// </summary>\n\t\tpublic bool Draggable = true;\n\n\t\tpublic View WindowContentView\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Children.Length == 0 ? null : Children[0];\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (this.Children.Length == 0)\n\t\t\t\t\tthis.Children.Add(value);\n\t\t\t\telse\n\t\t\t\t\tthis.Children[0] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Rectangle ContentBoundBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tNinePatch patch = Selected ? NinePatchSelected : NinePatchNormal;\n\t\t\t\tVector2 windowTextSize = GeeUIMain.Font.MeasureString(WindowText);\n\t\t\t\tvar barHeight = (patch.TopHeight + patch.BottomHeight + windowTextSize.Y);\n\t\t\t\treturn new Rectangle(RealX, RealY + (int)barHeight, Width, Height - (int)barHeight);\n\t\t\t}\n\t\t}\n\n\n\t\tpublic WindowView(GeeUIMain GeeUI, View rootView, Vector2 position)\n\t\t\t: base(GeeUI, rootView)\n\t\t{\n\t\t\tPosition.Value = position;\n\t\t\tNinePatchNormal = GeeUIMain.NinePatchWindowUnselected;\n\t\t\tNinePatchSelected = GeeUIMain.NinePatchWindowSelected;\n\t\t}\n\n\t\tprotected internal void FollowMouse()\n\t\t{\n\t\t\tif (!Draggable) return;\n\t\t\tVector2 newMousePosition = InputManager.GetMousePosV();\n\t\t\tif (SelectedOffChildren && Selected && InputManager.IsMousePressed(MouseButton.Left))\n\t\t\t{\n\t\t\t\tPosition.Value = (newMousePosition - MouseSelectedOffset);\n\t\t\t}\n\t\t\tLastMousePosition = newMousePosition;\n\t\t}\n\n\t\tpublic override void Draw(SpriteBatch spriteBatch)\n\t\t{\n\t\t\tNinePatch patch = Selected ? NinePatchSelected : NinePatchNormal;\n\n\t\t\tpatch.Draw(spriteBatch, AbsolutePosition, Width - patch.LeftWidth - patch.RightWidth, (int)GeeUIMain.Font.MeasureString(WindowText).Y, 0f, EffectiveOpacity);\n\n\t\t\tstring text = TextView.TruncateString(WindowText, WindowContentView.ContentBoundBox.Width);\n\t\t\tspriteBatch.DrawString(GeeUIMain.Font, text, AbsolutePosition + new Vector2(patch.LeftWidth, patch.TopHeight), Color.Black * EffectiveOpacity);\n\n\t\t\tif(WindowContentView != null)\n\t\t\t{\n\t\t\t\tWindowContentView.Width = Width;\n\t\t\t\tVector2 windowTextSize = GeeUIMain.Font.MeasureString(WindowText);\n\t\t\t\tvar barHeight = (patch.TopHeight + patch.BottomHeight + windowTextSize.Y);\n\t\t\t\tWindowContentView.Height.Value = Height.Value - (int)barHeight;\n\t\t\t}\n\n\t\t\tbase.Draw(spriteBatch);\n\t\t}\n\n\t\tpublic override void Update(float dt)\n\t\t{\n\t\t\tFollowMouse();\n\t\t\tif (WindowContentView != null)\n\t\t\t{\n\t\t\t\tWindowContentView.IgnoreParentBounds.Value = true;\n\n\t\t\t\tNinePatch patch = Selected ? NinePatchSelected : NinePatchNormal;\n\t\t\t\tVector2 windowTextSize = GeeUIMain.Font.MeasureString(WindowText);\n\t\t\t\tvar barHeight = (patch.TopHeight + patch.BottomHeight + windowTextSize.Y);\n\n\t\t\t\tthis.Width = WindowContentView.Width;\n\t\t\t\tthis.Height.Value = WindowContentView.Height.Value + (int)barHeight;\n\t\t\t}\n\n\t\t\tbase.Update(dt);\n\t\t}\n\n\t\tpublic override void OnMClick(Vector2 position, bool fromChild)\n\t\t{\n\t\t\tSelectedOffChildren = !fromChild;\n\t\t\tSelected.Value = true;\n\t\t\tWindowContentView.Selected.Value = true;\n\t\t\tLastMousePosition = position;\n\t\t\tMouseSelectedOffset = position - Position;\n\n\t\t\tthis.BringToFront();\n\t\t\tFollowMouse();\n\t\t\tbase.OnMClick(position, fromChild);\n\t\t}\n\n\t\tpublic override void OnMClickAway()\n\t\t{\n\t\t\tSelectedOffChildren = false;\n\t\t\tSelected.Value = false;\n\t\t\tWindowContentView.Selected.Value = false;\n\t\t\tbase.OnMClickAway();\n\t\t}\n\t\tpublic override void OnMOff()\n\t\t{\n\t\t\tFollowMouse();\n\t\t\tbase.OnMOff();\n\t\t}\n\n\t\tpublic override void OnMOver()\n\t\t{\n\t\t\tFollowMouse();\n\t\t\tbase.OnMOver();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Graphics/AmbientLight.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class AmbientLight : Component<Main>\n\t{\n\t\tpublic static readonly List<AmbientLight> All = new List<AmbientLight>();\n\n\t\tpublic Property<Vector3> Color = new Property<Vector3> { Value = Vector3.One };\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tAmbientLight.All.Add(this);\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tAmbientLight.All.Remove(this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Graphics/AnimatedModel.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class AnimatedModel : Model, IUpdateableComponent\n\t{\n\t\t// Information about the currently playing animation clips.\n\t\t[XmlIgnore]\n\t\tprivate List<SkinnedModel.Clip> CurrentClips = new List<SkinnedModel.Clip>();\n\n\t\t[XmlIgnore]\n\t\tpublic Dictionary<string, SkinnedModel.Clip> Clips\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.skinningData.Clips;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic List<Matrix> BindPose\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.skinningData.BindPose;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic List<int> SkeletonHierarchy\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.skinningData.SkeletonHierarchy;\n\t\t\t}\n\t\t}\n\n\t\t// Animation blending data\n\n\t\t// Current animation transform matrices.\n\t\tprotected Matrix[] boneTransforms;\n\t\tprotected Matrix[] worldTransforms;\n\t\tprotected Matrix[] skinTransforms;\n\n\t\tpublic bool bound;\n\n\t\tpublic const float DefaultBlendTime = 0.25f;\n\n\t\t// Backlink to the bind pose and skeleton hierarchy data.\n\t\tprivate SkinnedModel.SkinningData skinningData;\n\n\t\tpublic bool IsPlaying(params string[] clipNames)\n\t\t{\n\t\t\tif (clipNames.Length == 0)\n\t\t\t\treturn this.CurrentClips.Count > 0;\n\t\t\tfor (int i = 0; i < clipNames.Length; i++)\n\t\t\t{\n\t\t\t\tstring clipName = clipNames[i];\n\t\t\t\tSkinnedModel.Clip clip;\n\t\t\t\tif (this.skinningData.Clips.TryGetValue(clipName, out clip))\n\t\t\t\t{\n\t\t\t\t\tif (clip.Active && !clip.Stopping)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate class Callback\n\t\t{\n\t\t\tpublic float Offset;\n\t\t\tpublic Command Command;\n\t\t}\n\n\t\tprivate Dictionary<string, List<Callback>> callbacks = new Dictionary<string,List<Callback>>();\n\n\t\tpublic void StartClip(string clipName, int priority = 0, bool loop = false, float blendTime = AnimatedModel.DefaultBlendTime)\n\t\t{\n\t\t\tSkinnedModel.Clip clip = this.skinningData.Clips[clipName];\n\n\t\t\tif (clip.Stopping)\n\t\t\t\tclip.BlendTime = Math.Max(clip.BlendTotalTime - clip.BlendTime, 0);\n\t\t\telse\n\t\t\t\tclip.BlendTime = 0.0f;\n\n\t\t\tclip.BlendTotalTime = blendTime;\n\n\t\t\tclip.Priority = priority;\n\t\t\tclip.CurrentTime = TimeSpan.Zero;\n\t\t\tclip.Loop = loop;\n\t\t\tclip.Stopping = false;\n\t\t\tclip.Active = true;\n\n\t\t\tif (!this.CurrentClips.Contains(clip))\n\t\t\t\tthis.CurrentClips.Add(clip);\n\n\t\t\tthis.CurrentClips.Sort(new Util.LambdaComparer<SkinnedModel.Clip>((x, y) => x.Priority - y.Priority));\n\t\t}\n\n\t\tpublic void Stop(params string[] clips)\n\t\t{\n\t\t\tif (clips.Length == 0)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.CurrentClips.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tSkinnedModel.Clip clip = this.CurrentClips[i];\n\t\t\t\t\tif (!clip.Stopping)\n\t\t\t\t\t{\n\t\t\t\t\t\tclip.Stopping = true;\n\t\t\t\t\t\tclip.BlendTime = Math.Max(clip.BlendTotalTime - clip.BlendTime, 0.0f);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < clips.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tstring clipName = clips[i];\n\t\t\t\t\tSkinnedModel.Clip clip;\n\t\t\t\t\tif (this.skinningData.Clips.TryGetValue(clipName, out clip))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (clip.Active && !clip.Stopping)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclip.Stopping = true;\n\t\t\t\t\t\t\tclip.BlendTime = Math.Max(clip.BlendTotalTime - clip.BlendTime, 0.0f);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Trigger(string clip, float offset, Command callback)\n\t\t{\n\t\t\tList<Callback> list;\n\t\t\tif (!this.callbacks.TryGetValue(clip, out list))\n\t\t\t\tlist = this.callbacks[clip] = new List<Callback>();\n\t\t\tlist.Add(new Callback { Offset = offset, Command = callback });\n\t\t}\n\n\t\tpublic void Bind(AnimatedModel target)\n\t\t{\n\t\t\tthis.boneTransforms = target.boneTransforms;\n\t\t\tthis.worldTransforms = target.worldTransforms;\n\t\t\tthis.skinTransforms = target.skinTransforms;\n\t\t\tthis.bound = true;\n\t\t}\n\n\t\tpublic SkinnedModel.Clip this[string name]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.skinningData.Clips[name];\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Helper used by the Update method to refresh the BoneTransforms data.\n\t\t/// </summary>\n\t\tpublic void UpdateBoneTransforms(TimeSpan elapsedTime)\n\t\t{\n\t\t\tfor (int i = 0; i < this.skinningData.BindPose.Count; i++)\n\t\t\t\tthis.boneTransforms[i] = this.skinningData.BindPose[i];\n\n\t\t\tfor (int i = 0; i < this.CurrentClips.Count; i++)\n\t\t\t{\n\t\t\t\tSkinnedModel.Clip clip = this.CurrentClips[i];\n\t\t\t\tTimeSpan newTime = clip.CurrentTime + new TimeSpan((long)((float)elapsedTime.Ticks * clip.Speed));\n\n\t\t\t\tList<Callback> callbacks;\n\t\t\t\tif (this.callbacks.TryGetValue(clip.Name, out callbacks))\n\t\t\t\t{\n\t\t\t\t\tfloat currentSeconds = (float)clip.CurrentTime.TotalSeconds;\n\t\t\t\t\tfloat newSeconds = (float)newTime.TotalSeconds;\n\t\t\t\t\tfor (int j = 0; j < callbacks.Count; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tCallback c = callbacks[j];\n\t\t\t\t\t\tif (currentSeconds < c.Offset && newSeconds > c.Offset)\n\t\t\t\t\t\t\tc.Command.Execute();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfloat targetStrength = MathHelper.Clamp(clip.TargetStrength, 0.0f, 1.0f);\n\t\t\t\tfloat strengthBlendSpeed = (1.0f / AnimatedModel.DefaultBlendTime) * (float)elapsedTime.TotalSeconds;\n\t\t\t\tclip.Strength += MathHelper.Clamp(targetStrength - clip.Strength, -strengthBlendSpeed, strengthBlendSpeed);\n\n\t\t\t\tif (!clip.Stopping && clip.Duration.TotalSeconds > 0)\n\t\t\t\t{\n\t\t\t\t\tif (!clip.Loop && newTime >= clip.Duration)\n\t\t\t\t\t{\n\t\t\t\t\t\tclip.Stopping = true;\n\t\t\t\t\t\tclip.BlendTime = 0.0f;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tclip.CurrentTime = newTime;\n\t\t\t\t}\n\n\t\t\t\tclip.BlendTime += (float)elapsedTime.TotalSeconds;\n\t\t\t\tfloat blend = clip.Strength;\n\t\t\t\tif (clip.BlendTime < clip.BlendTotalTime)\n\t\t\t\t{\n\t\t\t\t\tfloat b = clip.BlendTime / clip.BlendTotalTime;\n\n\t\t\t\t\tb = -b * (b - 2); // Quadratic easing\n\n\t\t\t\t\tif (clip.Stopping)\n\t\t\t\t\t\tblend *= 1.0f - b;\n\t\t\t\t\telse\n\t\t\t\t\t\tblend *= b;\n\t\t\t\t}\n\t\t\t\telse if (clip.Stopping)\n\t\t\t\t{\n\t\t\t\t\tclip.Active = false;\n\t\t\t\t\tthis.CurrentClips.RemoveAt(i);\n\t\t\t\t\ti--;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (blend > 0.0f)\n\t\t\t\t{\n\t\t\t\t\tif (blend < 1.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int j = 0; j < clip.Channels.Count; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSkinnedModel.Channel channel = clip.Channels[j];\n\t\t\t\t\t\t\tMatrix bone1 = this.boneTransforms[channel.BoneIndex];\n\t\t\t\t\t\t\tVector3 scale1;\n\t\t\t\t\t\t\tQuaternion quat1;\n\t\t\t\t\t\t\tVector3 translation1;\n\t\t\t\t\t\t\tbone1.Decompose(out scale1, out quat1, out translation1);\n\n\t\t\t\t\t\t\tMatrix bone2 = channel.CurrentMatrix;\n\t\t\t\t\t\t\tVector3 scale2;\n\t\t\t\t\t\t\tQuaternion quat2;\n\t\t\t\t\t\t\tVector3 translation2;\n\t\t\t\t\t\t\tbone2.Decompose(out scale2, out quat2, out translation2);\n\n\t\t\t\t\t\t\tthis.boneTransforms[channel.BoneIndex] = Matrix.CreateScale(Vector3.Lerp(scale1, scale2, blend)) * Matrix.CreateFromQuaternion(Quaternion.Lerp(quat1, quat2, blend)) * Matrix.CreateTranslation(Vector3.Lerp(translation1, translation2, blend));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int j = 0; j < clip.Channels.Count; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSkinnedModel.Channel channel = clip.Channels[j];\n\t\t\t\t\t\t\tthis.boneTransforms[channel.BoneIndex] = channel.CurrentMatrix;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach (KeyValuePair<int, Property<Matrix>> pair in this.relativeBoneTransformProperties)\n\t\t\t\tpair.Value.Value = this.boneTransforms[pair.Key];\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Helper used by the Update method to refresh the WorldTransforms data.\n\t\t/// </summary>\n\t\tpublic void UpdateWorldTransforms()\n\t\t{\n\t\t\t// Child bones.\n\t\t\tfor (int bone = 0; bone < this.worldTransforms.Length; bone++)\n\t\t\t{\n\t\t\t\tint parentBone = this.skinningData.SkeletonHierarchy[bone];\n\t\t\t\tif (parentBone == -1)\n\t\t\t\t\tthis.worldTransforms[bone] = this.boneTransforms[bone];\n\t\t\t\telse\n\t\t\t\t\tthis.worldTransforms[bone] = this.boneTransforms[bone] * this.worldTransforms[parentBone];\n\t\t\t\tthis.skinTransforms[bone] = this.skinningData.InverseBindPose[bone] * this.worldTransforms[bone];\n\t\t\t}\n\n\t\t\tforeach (KeyValuePair<int, Property<Matrix>> pair in this.boneTransformProperties)\n\t\t\t\tpair.Value.Value = this.worldTransforms[pair.Key];\n\t\t}\n\n\t\tpublic Matrix GetWorldTransform(int bone)\n\t\t{\n\t\t\tMatrix result = this.boneTransforms[bone];\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tint parent = this.skinningData.SkeletonHierarchy[bone];\n\t\t\t\tif (parent == -1)\n\t\t\t\t\treturn result;\n\t\t\t\telse\n\t\t\t\t\tresult = result * this.boneTransforms[parent];\n\t\t\t\tbone = parent;\n\t\t\t}\n\t\t}\n\n\t\tpublic Matrix GetWorldBindTransform(int bone)\n\t\t{\n\t\t\tMatrix result = this.skinningData.BindPose[bone];\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tint parent = this.skinningData.SkeletonHierarchy[bone];\n\t\t\t\tif (parent == -1)\n\t\t\t\t\treturn result;\n\t\t\t\telse\n\t\t\t\t\tresult = result * this.skinningData.BindPose[parent];\n\t\t\t\tbone = parent;\n\t\t\t}\n\t\t}\n\n\t\tprivate Dictionary<int, Property<Matrix>> boneTransformProperties = new Dictionary<int, Property<Matrix>>();\n\t\tprivate Dictionary<int, Property<Matrix>> absoluteBoneTransformProperties = new Dictionary<int, Property<Matrix>>();\n\t\tprivate Dictionary<int, Property<Matrix>> relativeBoneTransformProperties = new Dictionary<int, Property<Matrix>>();\n\n\t\tpublic AnimatedModel()\n\t\t{\n\t\t\tthis.EnabledWhenPaused = true;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tthis.callbacks.Clear();\n\t\t\tthis.boneTransformProperties.Clear();\n\t\t\tthis.absoluteBoneTransformProperties.Clear();\n\t\t\tthis.relativeBoneTransformProperties.Clear();\n\t\t}\n\n\t\tpublic Property<Matrix> GetRelativeBoneTransform(string bone)\n\t\t{\n\t\t\tProperty<Matrix> property = null;\n\t\t\tint index = this.skinningData.BoneMap[bone];\n\t\t\tif (this.relativeBoneTransformProperties.TryGetValue(index, out property))\n\t\t\t\treturn property;\n\t\t\telse\n\t\t\t{\n\t\t\t\tproperty = new Property<Matrix>();\n\t\t\t\tthis.relativeBoneTransformProperties[index] = property;\n\t\t\t\tthis.Add(new SetBinding<Matrix>(property, delegate(Matrix value)\n\t\t\t\t{\n\t\t\t\t\tthis.boneTransforms[index] = value;\n\t\t\t\t}));\n\t\t\t\treturn property;\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<Matrix> GetBoneTransform(string bone)\n\t\t{\n\t\t\tProperty<Matrix> property = null;\n\t\t\tint index = this.skinningData.BoneMap[bone];\n\t\t\tif (this.boneTransformProperties.TryGetValue(index, out property))\n\t\t\t\treturn property;\n\t\t\telse\n\t\t\t{\n\t\t\t\tproperty = new Property<Matrix>();\n\t\t\t\tthis.boneTransformProperties[index] = property;\n\t\t\t\tthis.Add(new SetBinding<Matrix>(property, delegate(Matrix value)\n\t\t\t\t{\n\t\t\t\t\tthis.worldTransforms[index] = value;\n\t\t\t\t}));\n\t\t\t\treturn property;\n\t\t\t}\n\t\t}\n\n\t\tpublic int GetBoneIndex(string bone)\n\t\t{\n\t\t\treturn this.skinningData.BoneMap[bone];\n\t\t}\n\n\t\tpublic Property<Matrix> GetWorldBoneTransform(string bone)\n\t\t{\n\t\t\tProperty<Matrix> property = null;\n\t\t\tint index = this.skinningData.BoneMap[bone];\n\t\t\tif (this.absoluteBoneTransformProperties.TryGetValue(index, out property))\n\t\t\t\treturn property;\n\t\t\telse\n\t\t\t{\n\t\t\t\tproperty = new Property<Matrix>();\n\t\t\t\tthis.absoluteBoneTransformProperties[index] = property;\n\n\t\t\t\tProperty<Matrix> relativeTransformProperty = this.GetBoneTransform(bone);\n\n\t\t\t\tthis.Add(new Binding<Matrix>(property, () => relativeTransformProperty.Value * this.Transform.Value, this.Transform, relativeTransformProperty));\n\t\t\t\treturn property;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void loadModel(string file, bool reload)\n\t\t{\n\t\t\tbase.loadModel(file, reload);\n\t\t\tif (this.model != null && !reload)\n\t\t\t{\n\t\t\t\t// Look up our custom skinning information.\n\t\t\t\tthis.skinningData = this.model.Tag as SkinnedModel.SkinningData;\n\n\t\t\t\tif (this.skinningData == null)\n\t\t\t\t{\n\t\t\t\t\tthis.model = null;\n\t\t\t\t\tthis.effect = null;\n\t\t\t\t\tthis.IsValid.Value = false;\n\t\t\t\t\tLog.d(string.Format(\"Model has no skinning data: {0}\", file));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!this.bound && (this.boneTransforms == null || this.boneTransforms.Length != this.skinningData.BindPose.Count))\n\t\t\t\t{\n\t\t\t\t\tthis.boneTransforms = new Matrix[this.skinningData.BindPose.Count];\n\t\t\t\t\tthis.worldTransforms = new Matrix[this.skinningData.BindPose.Count];\n\t\t\t\t\tthis.skinTransforms = new Matrix[this.skinningData.BindPose.Count];\n\t\t\t\t\tthis.skinningData.BindPose.CopyTo(this.boneTransforms, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Update(float elapsedTime)\n\t\t{\n\t\t\tif (this.skinningData != null && !this.bound && !this.main.Paused)\n\t\t\t{\n\t\t\t\tthis.UpdateBoneTransforms(new TimeSpan((long)(elapsedTime * TimeSpan.TicksPerSecond)));\n\t\t\t\tthis.UpdateWorldTransforms();\n\t\t\t}\n\t\t}\n\n\t\tprotected override void drawInstances(RenderParameters parameters, Matrix transform)\n\t\t{\n\t\t\t// Animated instancing not supported\n\t\t}\n\n\t\tprotected override bool setParameters(Matrix transform, RenderParameters parameters)\n\t\t{\n\t\t\tbool result = base.setParameters(transform, parameters);\n\t\t\tif (result)\n\t\t\t\tthis.effect.Parameters[\"Bones\"].SetValue(this.skinTransforms);\n\t\t\treturn result;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Graphics/Camera.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Input;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Audio;\nusing Lemma.Util;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class Camera : Component<Main>, IUpdateableComponent\n\t{\n\t\t/// <summary>\n\t\t/// Gets camera view matrix.\n\t\t/// </summary>\n\t\tpublic Property<Matrix> View = new Property<Matrix> { Value = Matrix.Identity };\n\t\t/// <summary>\n\t\t/// Gets the inverse camera view matrix.\n\t\t/// </summary>\n\t\tpublic Property<Matrix> InverseView = new Property<Matrix> { Value = Matrix.Identity };\n\t\t/// <summary>\n\t\t/// Gets or sets camera projection matrix.\n\t\t/// </summary>\n\t\tpublic Property<Matrix> Projection = new Property<Matrix> { Value = Matrix.Identity };\n\t\tpublic Property<Matrix> LastProjection = new Property<Matrix> { Value = Matrix.Identity };\n\t\t/// <summary>\n\t\t/// Gets the inverse of the camera projection matrix.\n\t\t/// </summary>\n\t\tpublic Property<Matrix> InverseProjection = new Property<Matrix> { Value = Matrix.Identity };\n\t\t/// <summary>\n\t\t/// Gets the view matrix from the last frame.\n\t\t/// </summary>\n\t\tpublic Property<Matrix> LastView = new Property<Matrix> { Value = Matrix.Identity };\n\t\t/// <summary>\n\t\t/// Gets the view/projection matrix from the last frame.\n\t\t/// </summary>\n\t\tpublic Property<Matrix> LastViewProjection = new Property<Matrix> { Value = Matrix.Identity };\n\t\t/// <summary>\n\t\t/// Gets camera view matrix multiplied by projection matrix.\n\t\t/// </summary>\n\t\tpublic Property<Matrix> ViewProjection = new Property<Matrix> { Value = Matrix.Identity };\n\t\t/// <summary>\n\t\t/// Gets inverse of the view/projection matrix.\n\t\t/// </summary>\n\t\tpublic Property<Matrix> InverseViewProjection = new Property<Matrix> { Value = Matrix.Identity };\n\t\t/// <summary>\n\t\t/// Gets or sets camera position.\n\t\t/// </summary>\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\t/// <summary>\n\t\t/// Gets or sets camera angles.\n\t\t/// </summary>\n\t\tpublic Property<Vector3> Angles = new Property<Vector3>();\n\t\t/// <summary>\n\t\t/// Gets or sets camera field of view.\n\t\t/// </summary>\n\t\tpublic Property<float> FieldOfView = new Property<float> { Value = MathHelper.ToRadians(80.0f) };\n\n\t\tpublic Property<Point> ViewportSize = new Property<Point> { Value = new Point(1, 1) };\n\t\t/// <summary>\n\t\t/// Gets or sets camera aspect ratio.\n\t\t/// </summary>\n\t\tpublic Property<float> AspectRatio = new Property<float> { Value = 1.0f };\n\t\t/// <summary>\n\t\t/// Gets or sets camera near plane distance.\n\t\t/// </summary>\n\t\tpublic Property<float> NearPlaneDistance = new Property<float> { Value = 0.01f };\n\t\t/// <summary>\n\t\t/// Gets or sets camera far plane distance.\n\t\t/// </summary>\n\t\tpublic Property<float> FarPlaneDistance = new Property<float> { Value = 100.0f };\n\n\t\tpublic Property<Vector3> Forward = new Property<Vector3> { Value = Vector3.Forward };\n\n\t\tpublic Property<Vector3> Right = new Property<Vector3> { Value = Vector3.Right };\n\n\t\tpublic Property<Vector3> Up = new Property<Vector3> { Value = Vector3.Up };\n\n\t\tpublic Property<Matrix> RotationMatrix = new Property<Matrix> { Value = Matrix.Identity };\n\n\t\tpublic Property<Vector2> OrthographicSize = new Property<Vector2> { Value = new Vector2(70.0f, 70.0f) };\n\n\t\tpublic enum ProjectionMode { Perspective, Orthographic, Custom }\n\t\tpublic Property<ProjectionMode> ProjectionType = new Property<ProjectionMode>();\n\n\t\t/// <summary>\n\t\t/// Gets or sets camera's target.\n\t\t/// </summary>\n\t\tpublic Property<Vector3> Target = new Property<Vector3>();\n\n\t\tprivate BoundingFrustum frustum = new BoundingFrustum(Matrix.Identity);\n\t\t[XmlIgnore]\n\t\tpublic BoundingFrustum BoundingFrustum\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tthis.frustum.Matrix = this.ViewProjection;\n\t\t\t\treturn this.frustum;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new Binding<float, Point>(this.AspectRatio, x => (float)x.X / (float)x.Y, this.ViewportSize));\n\t\t\t\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tswitch (this.ProjectionType.Value)\n\t\t\t\t{\n\t\t\t\t\tcase ProjectionMode.Orthographic:\n\t\t\t\t\t\tthis.Projection.Value = Matrix.CreateOrthographic(this.OrthographicSize.Value.X, this.OrthographicSize.Value.Y, this.NearPlaneDistance, this.FarPlaneDistance);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ProjectionMode.Perspective:\n\t\t\t\t\t\tthis.Projection.Value = Matrix.CreatePerspectiveFieldOfView(this.FieldOfView, this.AspectRatio, this.NearPlaneDistance, this.FarPlaneDistance);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}, this.FieldOfView, this.AspectRatio, this.NearPlaneDistance, this.FarPlaneDistance, this.OrthographicSize, this.ProjectionType));\n\n\t\t\tthis.Add(new Binding<Matrix, Matrix>(this.InverseProjection, x => Matrix.Invert(x), this.Projection));\n\t\t\tthis.Add(new Binding<Matrix>(this.ViewProjection, () => this.View.Value * this.Projection, this.View, this.Projection));\n\t\t\tthis.Add(new Binding<Matrix, Matrix>(this.InverseViewProjection, x => Matrix.Invert(x), this.ViewProjection));\n\t\t\tthis.Add(new TwoWayBinding<Vector3, Matrix>(\n\t\t\t\tthis.Angles,\n\t\t\t\tdelegate(Matrix matrix)\n\t\t\t\t{\n\t\t\t\t\tVector3 scale, translation;\n\t\t\t\t\tQuaternion rotation;\n\t\t\t\t\tmatrix.Decompose(out scale, out rotation, out translation);\n\t\t\t\t\tVector3 euler = rotation.ToEuler();\n\t\t\t\t\treturn new Vector3(euler.X, -euler.Y + (float)Math.PI * 0.5f, euler.Z);\n\t\t\t\t},\n\t\t\t\tthis.RotationMatrix,\n\t\t\t\tdelegate(Vector3 angles)\n\t\t\t\t{\n\t\t\t\t\treturn Matrix.CreateRotationX(angles.X) * Matrix.CreateRotationY(angles.Y) * Matrix.CreateRotationZ(angles.Z);\n\t\t\t\t}));\n\n\t\t\tthis.Add(new TwoWayBinding<Matrix, Vector3>(\n\t\t\t\tthis.RotationMatrix,\n\t\t\t\tx => Matrix.CreateLookAt(Vector3.Zero, x, Vector3.Up),\n\t\t\t\tthis.Forward,\n\t\t\t\tx => x.Forward));\n\n\t\t\tthis.Add(new Binding<Vector3, Matrix>(this.Right, x => x.Right, this.RotationMatrix));\n\n\t\t\tthis.Add(new Binding<Vector3, Matrix>(this.Up, x => x.Up, this.RotationMatrix));\n\n\t\t\tthis.Add(new Binding<Matrix>(\n\t\t\t\tthis.View,\n\t\t\t\t() => Matrix.CreateTranslation(-this.Position.Value) * Matrix.Invert(this.RotationMatrix),\n\t\t\t\tthis.Position, this.RotationMatrix));\n\n\t\t\tthis.Add(new Binding<Matrix, Matrix>(this.InverseView, x => Matrix.Invert(x), this.View));\n\n\t\t\tthis.Add(new TwoWayBinding<Vector3, Vector3>(\n\t\t\t\tthis.Angles,\n\t\t\t\tdelegate(Vector3 target)\n\t\t\t\t{\n\t\t\t\t\tVector3 dir = Vector3.Normalize(this.Position.Value - target);\n\t\t\t\t\treturn new Vector3(-(float)Math.Asin(dir.Y), (float)Math.Atan2(dir.X, dir.Z), 0.0f);\n\t\t\t\t},\n\t\t\t\tnew IProperty[] { this.Position },\n\t\t\t\tthis.Target,\n\t\t\t\tdelegate(Vector3 angles)\n\t\t\t\t{\n\t\t\t\t\treturn this.Position.Value + Vector3.TransformNormal(Vector3.Forward, Matrix.CreateRotationX(angles.X) * Matrix.CreateRotationY(angles.Y));\n\t\t\t\t},\n\t\t\t\tnew IProperty[] { this.Position }));\n\t\t}\n\n\t\tpublic void SetFromCamera(Camera other)\n\t\t{\n\t\t\tthis.Position.Value = other.Position;\n\t\t\tthis.RotationMatrix.Value = other.RotationMatrix;\n\t\t\tthis.View.Value = other.View;\n\t\t\tthis.LastView.Value = other.LastView;\n\t\t\tthis.LastViewProjection.Value = other.LastViewProjection;\n\t\t\tthis.SetProjectionFromCamera(other);\n\t\t}\n\t\t\n\t\tpublic void SetProjectionFromCamera(Camera other)\n\t\t{\n\t\t\tthis.ProjectionType.SetStealthy(other.ProjectionType);\n\t\t\tthis.FieldOfView.SetStealthy(other.FieldOfView);\n\t\t\tthis.ViewportSize.SetStealthy(other.ViewportSize);\n\t\t\tthis.AspectRatio.SetStealthy(other.AspectRatio);\n\t\t\tthis.NearPlaneDistance.SetStealthy(other.NearPlaneDistance);\n\t\t\tthis.FarPlaneDistance.SetStealthy(other.FarPlaneDistance);\n\t\t\tthis.Projection.Value = other.Projection;\n\t\t\tthis.LastProjection.Value = other.LastProjection;\n\t\t}\n\n\t\tpublic void SetPerspectiveProjection(float fov, Point viewportSize, float near, float far)\n\t\t{\n\t\t\tthis.FieldOfView.SetStealthy(fov);\n\t\t\tthis.ViewportSize.SetStealthy(viewportSize);\n\t\t\tthis.AspectRatio.SetStealthy((float)viewportSize.X / (float)viewportSize.Y);\n\t\t\tthis.NearPlaneDistance.SetStealthy(near);\n\t\t\tthis.FarPlaneDistance.SetStealthy(far);\n\t\t\tthis.ProjectionType.SetStealthy(ProjectionMode.Perspective);\n\t\t\tthis.Projection.Value = Matrix.CreatePerspectiveFieldOfView(fov, this.AspectRatio, near, far);\n\t\t}\n\n\t\tpublic void SetOrthographicProjection(Point viewportSize, float near, float far)\n\t\t{\n\t\t\tthis.ViewportSize.SetStealthy(viewportSize);\n\t\t\tthis.OrthographicSize.SetStealthy(new Vector2(viewportSize.X, viewportSize.Y));\n\t\t\tthis.NearPlaneDistance.SetStealthy(near);\n\t\t\tthis.FarPlaneDistance.SetStealthy(far);\n\t\t\tthis.ProjectionType.SetStealthy(ProjectionMode.Orthographic);\n\t\t\tthis.Projection.Value = Matrix.CreateOrthographic(viewportSize.X, viewportSize.Y, near, far);\n\t\t}\n\n\t\tvoid IUpdateableComponent.Update(float dt)\n\t\t{\n\t\t\tthis.LastView.Value = this.View;\n\t\t\tthis.LastViewProjection.Value = this.ViewProjection;\n\t\t\tthis.LastProjection.Value = this.Projection;\n\t\t}\n\n\t\tpublic void SetParameters(Effect effect)\n\t\t{\n\t\t\tEffectParameter param = effect.Parameters[\"ViewMatrix\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(this.View);\n\t\t\tparam = effect.Parameters[\"ViewMatrixRotationOnly\"];\n\t\t\tif (param != null)\n\t\t\t{\n\t\t\t\tMatrix m = this.View;\n\t\t\t\tm.Translation = Vector3.Zero;\n\t\t\t\tparam.SetValue(m);\n\t\t\t}\n\t\t\tparam = effect.Parameters[\"InverseViewMatrixRotationOnly\"];\n\t\t\tif (param != null)\n\t\t\t{\n\t\t\t\tMatrix m = this.InverseView;\n\t\t\t\tm.Translation = Vector3.Zero;\n\t\t\t\tparam.SetValue(m);\n\t\t\t}\n\t\t\tparam = effect.Parameters[\"InverseViewMatrix\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(this.InverseView);\n\t\t\tparam = effect.Parameters[\"ProjectionMatrix\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(this.Projection);\n\t\t\tparam = effect.Parameters[\"InverseProjectionMatrix\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(this.InverseProjection);\n\t\t\tparam = effect.Parameters[\"ViewProjectionMatrix\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(this.ViewProjection);\n\t\t\tparam = effect.Parameters[\"FarPlaneDistance\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(this.FarPlaneDistance);\n\t\t\tparam = effect.Parameters[\"NearPlaneDistance\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(this.NearPlaneDistance);\n\t\t\tparam = effect.Parameters[\"InverseViewProjectionMatrix\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(this.InverseViewProjection);\n\t\t\tparam = effect.Parameters[\"LastFrameViewProjectionMatrix\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(this.LastViewProjection);\n\t\t\tparam = effect.Parameters[\"LastFrameViewProjectionMatrixRotationOnly\"];\n\t\t\tif (param != null)\n\t\t\t{\n\t\t\t\tMatrix m = this.LastView;\n\t\t\t\tm.Translation = Vector3.Zero;\n\t\t\t\tparam.SetValue(m * this.LastProjection);\n\t\t\t}\n\t\t\tparam = effect.Parameters[\"LastFrameViewMatrix\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(this.LastView);\n\t\t\tparam = effect.Parameters[\"DestinationDimensions\"];\n\t\t\tif (param != null)\n\t\t\t{\n\t\t\t\tPoint size = this.ViewportSize;\n\t\t\t\tparam.SetValue(new Vector2(size.X, size.Y));\n\t\t\t}\n\t\t}\n\n\t\tpublic Vector2 GetWorldSpaceControllerCoordinates(Vector2 thumbStick)\n\t\t{\n\t\t\tVector3 temp = Vector3.Transform(new Vector3(thumbStick.X, 0.0f, -thumbStick.Y), Matrix.CreateRotationY(this.Angles.Value.Y));\n\t\t\treturn new Vector2(temp.X, temp.Z);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Graphics/Cloud.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Cloud : Component<Main>\n\t{\n\t\tpublic Property<float> Height = new Property<float> { Value = 1.0f };\n\n\t\tpublic Property<Vector2> Velocity = new Property<Vector2> { Value = Vector2.One };\n\n\t\tpublic Property<float> StartDistance = new Property<float> { Value = 50 };\n\n\t\tpublic Property<bool> Infinite = new Property<bool> { Value = true };\n\t}\n}\n"
  },
  {
    "path": "Lemma/Graphics/DirectionalLight.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class DirectionalLight : Component<Main>\n\t{\n\t\tpublic static readonly List<DirectionalLight> All = new List<DirectionalLight>();\n\n\t\tpublic Property<Vector3> Color = new Property<Vector3> { Value = Vector3.One };\n\t\t[XmlIgnore]\n\t\tpublic Property<Quaternion> Quaternion = new Property<Quaternion> { Value = Microsoft.Xna.Framework.Quaternion.Identity };\n\t\tpublic Property<bool> Shadowed = new Property<bool>();\n\n\t\tpublic Property<float> CloudShadow = new Property<float>();\n\n\t\tpublic Property<Vector2> CloudVelocity = new Property<Vector2>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tDirectionalLight.All.Add(this);\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tDirectionalLight.All.Remove(this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Graphics/DynamicModel.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\nusing Lemma.Util;\nusing System.Threading;\n\nnamespace Lemma.Components\n{\n\tpublic class DynamicModel<Vertex> : Model\n\t\twhere Vertex : struct\n\t{\n\t\tprivate DynamicVertexBuffer vertexBuffer;\n\t\tprivate VertexDeclaration declaration;\n\t\tprivate Vertex[] vertices = new Vertex[] {};\n\t\tprivate bool verticesChanged;\n\t\tprivate static IndexBuffer indexBuffer;\n\t\tprivate static object indicesLock = new object();\n\t\tprivate static uint[] indices = new uint[] { };\n\t\tprivate int vertexCount;\n\t\tprivate int indexCount;\n\t\tprivate int lockedVertexCount;\n\n\t\tpublic void UpdateVertices(Vertex[] v, int surfaces)\n\t\t{\n\t\t\tthis.vertices = v;\n\t\t\tthis.vertexCount = surfaces * 4;\n\t\t\tthis.verticesChanged = true;\n\t\t\tthis.indexCount = surfaces * 6;\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic object Lock;\n\n\t\tpublic DynamicModel(VertexDeclaration declaration)\n\t\t{\n\t\t\tthis.Serialize = false;\n\t\t\tthis.declaration = declaration;\n\t\t}\n\n\t\tpublic override void LoadContent(bool reload)\n\t\t{\n\t\t\tbase.LoadContent(reload);\n\t\t\tif (reload)\n\t\t\t{\n\t\t\t\tif (DynamicModel<Vertex>.indexBuffer != null)\n\t\t\t\t{\n\t\t\t\t\tDynamicModel<Vertex>.indexBuffer.Dispose();\n\t\t\t\t\tDynamicModel<Vertex>.indexBuffer = null;\n\t\t\t\t}\n\t\t\t\tthis.loadEffect(this.EffectFile);\n\t\t\t\tif (this.vertexBuffer != null && !this.vertexBuffer.IsDisposed)\n\t\t\t\t\tthis.vertexBuffer.Dispose();\n\t\t\t\tthis.vertexBuffer = null;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void loadEffect(string file)\n\t\t{\n\t\t\tif (file == null)\n\t\t\t\tthrow new Exception(\"Must define effect file for dynamic model.\");\n\t\t\tbase.loadEffect(file);\n\t\t}\n\n\t\tprivate static float growthFactor = 1.5f;\n\n\t\tpublic static uint[] GetIndices(int size)\n\t\t{\n\t\t\tlock (DynamicModel<Vertex>.indicesLock)\n\t\t\t{\n\t\t\t\tif (size <= DynamicModel<Vertex>.indices.Length)\n\t\t\t\t\treturn DynamicModel<Vertex>.indices;\n\n\t\t\t\tint newBufferSize = (int)Math.Pow(DynamicModel<Vertex>.growthFactor, Math.Ceiling(Math.Log(size, DynamicModel<Vertex>.growthFactor)));\n\n\t\t\t\tuint[] newIndices = new uint[newBufferSize];\n\n\t\t\t\tint startGeneratingIndices = (int)Math.Floor(DynamicModel<Vertex>.indices.Length / 6.0f) * 6;\n\t\t\t\tArray.Copy(DynamicModel<Vertex>.indices, newIndices, startGeneratingIndices);\n\n\t\t\t\tDynamicModel<Vertex>.indices = newIndices;\n\n\t\t\t\tuint vertexIndex = ((uint)startGeneratingIndices / 6) * 4;\n\t\t\t\tfor (int index = startGeneratingIndices; index < (int)Math.Floor(newBufferSize / 6.0f) * 6; vertexIndex += 4)\n\t\t\t\t{\n\t\t\t\t\tnewIndices[index++] = vertexIndex + 2;\n\t\t\t\t\tnewIndices[index++] = vertexIndex + 1;\n\t\t\t\t\tnewIndices[index++] = vertexIndex + 0;\n\t\t\t\t\tnewIndices[index++] = vertexIndex + 3;\n\t\t\t\t\tnewIndices[index++] = vertexIndex + 1;\n\t\t\t\t\tnewIndices[index++] = vertexIndex + 2;\n\t\t\t\t}\n\t\t\t\treturn newIndices;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Draws a single mesh using the given world matrix.\n\t\t/// </summary>\n\t\t/// <param name=\"camera\"></param>\n\t\t/// <param name=\"transform\"></param>\n\t\tprotected override void draw(RenderParameters parameters, Matrix transform)\n\t\t{\n\t\t\tbool needNewVertexBuffer = this.vertexBuffer == null || this.vertexBuffer.IsContentLost;\n\n\t\t\tif (this.vertexCount == 0)\n\t\t\t{\n\t\t\t\tthis.verticesChanged = false;\n\t\t\t\tthis.lockedVertexCount = 0;\n\t\t\t}\n\t\t\telse if (needNewVertexBuffer || this.verticesChanged)\n\t\t\t{\n\t\t\t\tbool locked;\n\t\t\t\tif (this.Lock == null)\n\t\t\t\t\tlocked = true;\n\t\t\t\telse\n\t\t\t\t\tlocked = Monitor.TryEnter(this.Lock);\n\n\t\t\t\tif (locked)\n\t\t\t\t{\n\t\t\t\t\tif (needNewVertexBuffer || this.vertexBuffer.VertexCount < this.vertexCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.vertexBuffer != null && !this.vertexBuffer.IsDisposed)\n\t\t\t\t\t\t\tthis.vertexBuffer.Dispose();\n\t\t\t\t\t\tthis.vertexBuffer = new DynamicVertexBuffer\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tthis.main.GraphicsDevice,\n\t\t\t\t\t\t\tthis.declaration,\n\t\t\t\t\t\t\t(int)Math.Pow(DynamicModel<Vertex>.growthFactor, Math.Ceiling(Math.Log(this.vertexCount, DynamicModel<Vertex>.growthFactor))),\n\t\t\t\t\t\t\tBufferUsage.WriteOnly\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tthis.verticesChanged = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (DynamicModel<Vertex>.indexBuffer == null || DynamicModel<Vertex>.indexBuffer.IndexCount < this.indexCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (DynamicModel<Vertex>.indexBuffer != null)\n\t\t\t\t\t\t\tDynamicModel<Vertex>.indexBuffer.Dispose();\n\t\t\t\t\t\t\n\t\t\t\t\t\tlock (DynamicModel<Vertex>.indicesLock)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tuint[] indices = DynamicModel<Vertex>.GetIndices(this.indexCount);\n\t\t\t\t\t\t\tDynamicModel<Vertex>.indexBuffer = new IndexBuffer(this.main.GraphicsDevice, typeof(uint), indices.Length, BufferUsage.WriteOnly);\n\t\t\t\t\t\t\tDynamicModel<Vertex>.indexBuffer.SetData(indices, 0, indices.Length);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.vertexBuffer.SetData(0, this.vertices, 0, this.vertexCount, this.declaration.VertexStride, SetDataOptions.Discard);\n\n\t\t\t\t\tthis.verticesChanged = false;\n\t\t\t\t\tthis.lockedVertexCount = this.vertexCount;\n\n\t\t\t\t\tif (this.Lock != null)\n\t\t\t\t\t\tMonitor.Exit(this.Lock);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.lockedVertexCount > 0 && this.vertexBuffer != null && !this.vertexBuffer.IsContentLost && this.setParameters(transform, parameters))\n\t\t\t{\n\t\t\t\tthis.main.LightingManager.SetRenderParameters(this.effect, parameters);\n\n\t\t\t\tRasterizerState originalState = this.main.GraphicsDevice.RasterizerState;\n\t\t\t\tRasterizerState noCullState = null;\n\t\t\t\tif (parameters.IsMainRender && this.DisableCulling)\n\t\t\t\t{\n\t\t\t\t\tnoCullState = new RasterizerState { CullMode = CullMode.None };\n\t\t\t\t\tthis.main.GraphicsDevice.RasterizerState = noCullState;\n\t\t\t\t}\n\n\t\t\t\tthis.main.GraphicsDevice.SetVertexBuffer(this.vertexBuffer);\n\t\t\t\tthis.main.GraphicsDevice.Indices = DynamicModel<Vertex>.indexBuffer;\n\n\t\t\t\tthis.effect.CurrentTechnique.Passes[0].Apply();\n\t\t\t\tthis.main.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, this.lockedVertexCount, 0, this.lockedVertexCount / 2);\n\t\t\t\tModel.DrawCallCounter++;\n\t\t\t\tModel.TriangleCounter += this.lockedVertexCount / 2;\n\n\t\t\t\tif (noCullState != null)\n\t\t\t\t\tthis.main.GraphicsDevice.RasterizerState = originalState;\n\t\t\t}\n\n\t\t\tif (parameters.IsMainRender)\n\t\t\t{\n\t\t\t\tthis.lastTransform = transform;\n\t\t\t\tthis.lastWorldViewProjection = transform * parameters.Camera.ViewProjection;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Draws a collection of instances. Requires an HLSL effect designed for hardware instancing.\n\t\t/// </summary>\n\t\t/// <param name=\"device\"></param>\n\t\t/// <param name=\"camera\"></param>\n\t\t/// <param name=\"instances\"></param>\n\t\tprotected override void drawInstances(RenderParameters parameters, Matrix transform)\n\t\t{\n\t\t\tthrow new NotSupportedException(\"Instancing not supported for dynamic models.\");\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tif (this.vertexBuffer != null && !this.vertexBuffer.IsDisposed)\n\t\t\t\tthis.vertexBuffer.Dispose();\n\t\t}\n\t}\n\n\tpublic class DynamicModelAlpha<Vertex> : DynamicModel<Vertex>, IDrawableAlphaComponent\n\t\twhere Vertex : struct\n\t{\n\t\tpublic Property<float> Alpha = null;\n\t\tpublic Property<int> DrawOrder { get; set; }\n\n\t\tpublic DynamicModelAlpha(VertexDeclaration declaration)\n\t\t\t: base(declaration)\n\t\t{\n\t\t\tthis.Alpha = this.GetFloatParameter(\"Alpha\");\n\t\t\tthis.Alpha.Value = 1.0f;\n\t\t\tthis.DrawOrder = new Property<int>();\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new NotifyBinding(main.AlphaDrawablesModified, this.DrawOrder));\n\t\t}\n\n\t\tpublic override void Draw(GameTime time, RenderParameters parameters)\n\t\t{\n\t\t\t\n\t\t}\n\n\t\tvoid IDrawableAlphaComponent.DrawAlpha(GameTime time, RenderParameters parameters)\n\t\t{\n\t\t\tif (this.Alpha > 0.0f)\n\t\t\t\tbase.Draw(time, parameters);\n\t\t}\n\n\t\tprotected override bool setParameters(Matrix transform, RenderParameters parameters)\n\t\t{\n\t\t\tbool result = base.setParameters(transform, parameters);\n\t\t\tif (result)\n\t\t\t\tthis.effect.Parameters[\"DepthBuffer\"].SetValue(parameters.DepthBuffer);\n\t\t\treturn result;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Graphics/FullscreenQuad.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Content;\n\nnamespace Lemma.Components\n{\n\tpublic class FullscreenQuad : Component<Main>, IDrawableAlphaComponent\n\t{\n\t\t/// <summary>\n\t\t/// A struct that represents a single vertex in the\n\t\t/// vertex buffer.\n\t\t/// </summary>\n\t\tprivate struct QuadVertex : IVertexType\n\t\t{\n\t\t\tpublic Vector3 Position;\n\t\t\tpublic Vector3 TexCoordAndCornerIndex;\n\t\t\tpublic VertexDeclaration VertexDeclaration\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn FullscreenQuad.VertexDeclaration;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<int> DrawOrder { get; set; }\n\n\t\tprivate VertexBuffer vertexBuffer;\n\n\t\tprivate static VertexDeclaration vertexDeclaration;\n\t\tpublic static VertexDeclaration VertexDeclaration\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (FullscreenQuad.vertexDeclaration == null)\n\t\t\t\t{\n\t\t\t\t\tVertexElement[] declElements = new VertexElement[2];\n\t\t\t\t\tdeclElements[0].Offset = 0;\n\t\t\t\t\tdeclElements[0].UsageIndex = 0;\n\t\t\t\t\tdeclElements[0].VertexElementFormat = VertexElementFormat.Vector3;\n\t\t\t\t\tdeclElements[0].VertexElementUsage = VertexElementUsage.Position;\n\t\t\t\t\tdeclElements[1].Offset = sizeof(float) * 3;\n\t\t\t\t\tdeclElements[1].UsageIndex = 0;\n\t\t\t\t\tdeclElements[1].VertexElementFormat = VertexElementFormat.Vector3;\n\t\t\t\t\tdeclElements[1].VertexElementUsage = VertexElementUsage.TextureCoordinate;\n\t\t\t\t\tFullscreenQuad.vertexDeclaration = new VertexDeclaration(declElements);\n\t\t\t\t}\n\t\t\t\treturn FullscreenQuad.vertexDeclaration;\n\t\t\t}\n\t\t}\n\n\t\tpublic FullscreenQuad()\n\t\t{\n\t\t\tthis.DrawOrder = new Property<int>();\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new NotifyBinding(this.main.AlphaDrawablesModified, this.DrawOrder));\n\t\t}\n\n\t\tpublic virtual void LoadContent(bool reload)\n\t\t{\n\t\t\tif (this.vertexBuffer != null && !this.vertexBuffer.IsDisposed)\n\t\t\t\tthis.vertexBuffer.Dispose();\n\n\t\t\t// Create a vertex buffer for the quad, and fill it in\n\t\t\tthis.vertexBuffer = new VertexBuffer(this.main.GraphicsDevice, typeof(QuadVertex), FullscreenQuad.VertexDeclaration.VertexStride * 4, BufferUsage.None);\n\t\t\tQuadVertex[] vbData = new QuadVertex[4];\n\n\t\t\t// Upper right\n\t\t\tvbData[0].Position = new Vector3(1, 1, 1);\n\t\t\tvbData[0].TexCoordAndCornerIndex = new Vector3(1, 0, 1);\n\n\t\t\t// Lower right\n\t\t\tvbData[1].Position = new Vector3(1, -1, 1);\n\t\t\tvbData[1].TexCoordAndCornerIndex = new Vector3(1, 1, 2);\n\n\t\t\t// Upper left\n\t\t\tvbData[2].Position = new Vector3(-1, 1, 1);\n\t\t\tvbData[2].TexCoordAndCornerIndex = new Vector3(0, 0, 0);\n\n\t\t\t// Lower left\n\t\t\tvbData[3].Position = new Vector3(-1, -1, 1);\n\t\t\tvbData[3].TexCoordAndCornerIndex = new Vector3(0, 1, 3);\n\n\t\t\tthis.vertexBuffer.SetData(vbData);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Draws the full screen quad\n\t\t/// </summary>\n\t\t/// <param name=\"graphicsDevice\">The GraphicsDevice to use for rendering</param>\n\t\tpublic virtual void DrawAlpha(GameTime time, RenderParameters p)\n\t\t{\n\t\t\t// Set the vertex buffer and declaration\n\t\t\tif (this.vertexBuffer.IsDisposed)\n\t\t\t\tthis.LoadContent(true);\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.main.GraphicsDevice.SetVertexBuffer(this.vertexBuffer);\n\n\t\t\t\t// Draw primitives\n\t\t\t\tthis.main.GraphicsDevice.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2);\n\t\t\t\tModel.DrawCallCounter++;\n\t\t\t\tModel.TriangleCounter += 2;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Graphics/LightingManager.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma.Components\n{\n\tpublic class LightingManager : Component<Main>, IGraphicsComponent\n\t{\n\t\tpublic enum DynamicShadowSetting { Off, Low, Medium, High, Ultra };\n\t\tprivate const int maxDirectionalLights = 3;\n\n\t\tpublic const int MaxMaterials = 16;\n\n\t\tprivate int globalShadowMapSize;\n\t\tprivate int detailGlobalShadowMapSize;\n\t\tprivate const float lightShadowThreshold = 60.0f;\n\t\tprivate const float globalShadowFocusInterval = 10.0f;\n\t\tprivate const float detailGlobalShadowSizeRatio = 0.15f;\n\t\tprivate const float detailGlobalShadowFocusInterval = 1.0f;\n\t\tprivate int spotShadowMapSize;\n\t\tprivate int maxShadowedSpotLights;\n\n\t\tprivate Vector3[] directionalLightDirections = new Vector3[LightingManager.maxDirectionalLights];\n\t\tprivate Vector3[] directionalLightColors = new Vector3[LightingManager.maxDirectionalLights];\n\t\tprivate float directionalLightCloudShadow;\n\t\tprivate Vector2 directionalLightCloudVelocity;\n\n\t\tprivate Vector3 ambientLightColor = Vector3.Zero;\n\n\t\tprivate RenderParameters shadowRenderParameters;\n\n\t\tpublic Property<Microsoft.Xna.Framework.Graphics.RenderTarget2D> GlobalShadowMap = new Property<Microsoft.Xna.Framework.Graphics.RenderTarget2D>();\n\t\tpublic Property<Microsoft.Xna.Framework.Graphics.RenderTarget2D> DetailGlobalShadowMap = new Property<Microsoft.Xna.Framework.Graphics.RenderTarget2D>();\n\t\tprivate Microsoft.Xna.Framework.Graphics.RenderTarget2D[] spotShadowMaps;\n\t\tprivate Dictionary<IComponent, int> shadowMapIndices = new Dictionary<IComponent, int>();\n\t\tprivate DirectionalLight globalShadowLight;\n\t\tpublic Property<Matrix> GlobalShadowViewProjection = new Property<Matrix>();\n\t\tpublic Property<Matrix> DetailGlobalShadowViewProjection = new Property<Matrix>();\n\t\tprivate bool globalShadowMapRenderedLastFrame;\n\n\t\tprivate Camera shadowCamera;\n\n\t\tpublic bool EnableGlobalShadowMap { get; private set; }\n\t\tpublic Property<bool> EnableDetailGlobalShadowMap = new Property<bool> { Value = true };\n\n\t\tpublic Property<bool> HasGlobalShadowLight = new Property<bool>();\n\t\tpublic Property<bool> HasGlobalShadowLightClouds = new Property<bool>();\n\n\t\tpublic Property<string> EnvironmentMap = new Property<string>();\n\t\tpublic Property<Vector3> EnvironmentColor = new Property<Vector3>();\n\t\tpublic Property<Color> BackgroundColor = new Property<Color>();\n\n\t\tpublic Property<DynamicShadowSetting> DynamicShadows = new Property<DynamicShadowSetting> { Value = DynamicShadowSetting.Off };\n\n\t\tprivate TextureCube environmentMap;\n\n\t\tprivate void loadEnvironmentMap(string file)\n\t\t{\n\t\t\tthis.environmentMap = file == null ? (TextureCube)null : this.main.MapContent.Load<TextureCube>(file);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.Add(new ChangeBinding<string>(this.EnvironmentMap, delegate(string old, string file)\n\t\t\t{\n\t\t\t\tif (old != file)\n\t\t\t\t\tthis.loadEnvironmentMap(file);\n\t\t\t}));\n\n\t\t\tthis.shadowCamera = new Camera();\n\t\t\tthis.main.AddComponent(this.shadowCamera);\n\t\t\tthis.Add(new SetBinding<DynamicShadowSetting>(this.DynamicShadows, delegate(DynamicShadowSetting value)\n\t\t\t{\n\t\t\t\tthis.shadowMapIndices.Clear();\n\t\t\t\tswitch (value)\n\t\t\t\t{\n\t\t\t\t\tcase DynamicShadowSetting.Off:\n\t\t\t\t\t\tthis.EnableGlobalShadowMap = false;\n\t\t\t\t\t\tthis.maxShadowedSpotLights = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DynamicShadowSetting.Low:\n\t\t\t\t\t\tthis.EnableGlobalShadowMap = true;\n\t\t\t\t\t\tthis.globalShadowMapSize = 1024;\n\t\t\t\t\t\tthis.detailGlobalShadowMapSize = 512;\n\t\t\t\t\t\tthis.maxShadowedSpotLights = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DynamicShadowSetting.Medium:\n\t\t\t\t\t\tthis.EnableGlobalShadowMap = true;\n\t\t\t\t\t\tthis.globalShadowMapSize = 1024;\n\t\t\t\t\t\tthis.detailGlobalShadowMapSize = 1024;\n\t\t\t\t\t\tthis.spotShadowMapSize = 256;\n\t\t\t\t\t\tthis.maxShadowedSpotLights = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DynamicShadowSetting.High:\n\t\t\t\t\t\tthis.EnableGlobalShadowMap = true;\n\t\t\t\t\t\tthis.globalShadowMapSize = 1024;\n\t\t\t\t\t\tthis.detailGlobalShadowMapSize = 1024;\n\t\t\t\t\t\tthis.spotShadowMapSize = 512;\n\t\t\t\t\t\tthis.maxShadowedSpotLights = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DynamicShadowSetting.Ultra:\n\t\t\t\t\t\tthis.EnableGlobalShadowMap = true;\n\t\t\t\t\t\tthis.globalShadowMapSize = 1024;\n\t\t\t\t\t\tthis.detailGlobalShadowMapSize = 2048;\n\t\t\t\t\t\tthis.spotShadowMapSize = 1024;\n\t\t\t\t\t\tthis.maxShadowedSpotLights = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (this.GlobalShadowMap.Value != null)\n\t\t\t\t{\n\t\t\t\t\tthis.GlobalShadowMap.Value.Dispose();\n\n\t\t\t\t\tforeach (Microsoft.Xna.Framework.Graphics.RenderTarget2D target in this.spotShadowMaps)\n\t\t\t\t\t\ttarget.Dispose();\n\t\t\t\t\t\n\t\t\t\t\tthis.DetailGlobalShadowMap.Value.Dispose();\n\t\t\t\t}\n\n\t\t\t\tif (this.EnableGlobalShadowMap)\n\t\t\t\t{\n\t\t\t\t\tthis.GlobalShadowMap.Value = new Microsoft.Xna.Framework.Graphics.RenderTarget2D\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.main.GraphicsDevice,\n\t\t\t\t\t\tthis.globalShadowMapSize,\n\t\t\t\t\t\tthis.globalShadowMapSize,\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\tMicrosoft.Xna.Framework.Graphics.SurfaceFormat.Single,\n\t\t\t\t\t\tMicrosoft.Xna.Framework.Graphics.DepthFormat.Depth24,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tMicrosoft.Xna.Framework.Graphics.RenderTargetUsage.DiscardContents\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tthis.DetailGlobalShadowMap.Value = new Microsoft.Xna.Framework.Graphics.RenderTarget2D\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.main.GraphicsDevice,\n\t\t\t\t\t\tthis.detailGlobalShadowMapSize,\n\t\t\t\t\t\tthis.detailGlobalShadowMapSize,\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\tMicrosoft.Xna.Framework.Graphics.SurfaceFormat.Single,\n\t\t\t\t\t\tMicrosoft.Xna.Framework.Graphics.DepthFormat.Depth24,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tMicrosoft.Xna.Framework.Graphics.RenderTargetUsage.DiscardContents\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.spotShadowMaps = new Microsoft.Xna.Framework.Graphics.RenderTarget2D[this.maxShadowedSpotLights];\n\t\t\t\tfor (int i = 0; i < this.maxShadowedSpotLights; i++)\n\t\t\t\t{\n\t\t\t\t\tthis.spotShadowMaps[i] = new Microsoft.Xna.Framework.Graphics.RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.spotShadowMapSize,\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.spotShadowMapSize,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\tMicrosoft.Xna.Framework.Graphics.SurfaceFormat.Single,\n\t\t\t\t\t\t\t\t\t\t\t\t\tMicrosoft.Xna.Framework.Graphics.DepthFormat.Depth24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t\tMicrosoft.Xna.Framework.Graphics.RenderTargetUsage.DiscardContents);\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis.Add(new CommandBinding(this.main.ReloadedContent, delegate()\n\t\t\t{\n\t\t\t\tthis.DynamicShadows.Reset();\n\t\t\t\tthis.loadEnvironmentMap(this.EnvironmentMap);\n\t\t\t}));\n\n\t\t\tthis.shadowRenderParameters = new RenderParameters { Camera = this.shadowCamera, Technique = Technique.Shadow };\n\t\t}\n\n\t\tpublic void LoadContent(bool reload)\n\t\t{\n\t\t}\n\n\t\tprivate Dictionary<Model.Material, int> materials = new Dictionary<Model.Material, int>();\n\n\t\tpublic void ClearMaterials()\n\t\t{\n\t\t\tthis.materials.Clear();\n\t\t\tthis.materials[Model.Material.Unlit] = 0; // Material with no lighting\n\t\t}\n\n\t\tpublic void SetMaterials(RenderParameters p)\n\t\t{\n\t\t\tforeach (KeyValuePair<Model.Material, int> pair in this.materials)\n\t\t\t\tp.MaterialData[pair.Value] = new Vector2(pair.Key.SpecularPower, pair.Key.SpecularIntensity);\n\t\t}\n\n\t\tpublic void UpdateGlobalLights()\n\t\t{\n\t\t\tthis.globalShadowLight = null;\n\t\t\tint directionalLightIndex = 0;\n\t\t\tforeach (DirectionalLight light in DirectionalLight.All.Where(x => x.Enabled && !x.Suspended).Take(LightingManager.maxDirectionalLights))\n\t\t\t{\n\t\t\t\t// Directional light\n\t\t\t\tint index = directionalLightIndex;\n\t\t\t\tif (light.Shadowed && this.globalShadowLight == null)\n\t\t\t\t{\n\t\t\t\t\t// This light is shadowed; swap it into the first slot.\n\t\t\t\t\t// By convention the first light is the shadow-caster, if there are any shadow-casting lights.\n\t\t\t\t\tthis.directionalLightDirections[index] = this.directionalLightDirections[0];\n\t\t\t\t\tthis.directionalLightColors[index] = this.directionalLightColors[0];\n\t\t\t\t\tthis.directionalLightCloudShadow = light.CloudShadow;\n\t\t\t\t\tthis.directionalLightCloudVelocity = light.CloudVelocity;\n\t\t\t\t\tindex = 0;\n\t\t\t\t\tthis.globalShadowLight = light;\n\t\t\t\t}\n\t\t\t\tthis.directionalLightDirections[index] = Vector3.Transform(new Vector3(0, 0, 1), light.Quaternion);\n\t\t\t\tthis.directionalLightColors[index] = light.Color;\n\t\t\t\tdirectionalLightIndex++;\n\t\t\t}\n\t\t\twhile (directionalLightIndex < LightingManager.maxDirectionalLights)\n\t\t\t{\n\t\t\t\tthis.directionalLightColors[directionalLightIndex] = Vector3.Zero;\n\t\t\t\tdirectionalLightIndex++;\n\t\t\t}\n\n\t\t\tbool hasGlobalLight = this.globalShadowLight != null;\n\t\t\tif (this.HasGlobalShadowLight != hasGlobalLight)\n\t\t\t\tthis.HasGlobalShadowLight.Value = hasGlobalLight;\n\n\t\t\tbool hasClouds = hasGlobalLight && this.directionalLightCloudShadow > 0;\n\t\t\tif (this.HasGlobalShadowLightClouds != hasClouds)\n\t\t\t\tthis.HasGlobalShadowLightClouds.Value = hasClouds;\n\n\t\t\tthis.ambientLightColor = Vector3.Zero;\n\t\t\tforeach (AmbientLight light in AmbientLight.All.Where(x => x.Enabled))\n\t\t\t\tthis.ambientLightColor += light.Color;\n\t\t}\n\n\t\tpublic int GetMaterialIndex(float specularPower, float specularIntensity)\n\t\t{\n\t\t\treturn this.GetMaterialIndex(new Model.Material { SpecularPower = specularPower, SpecularIntensity = specularIntensity, });\n\t\t}\n\n\t\tpublic int GetMaterialIndex(Model.Material key)\n\t\t{\n\t\t\tint id;\n\t\t\tif (!this.materials.TryGetValue(key, out id))\n\t\t\t{\n\t\t\t\tif (this.materials.Count == LightingManager.MaxMaterials)\n\t\t\t\t\tid = LightingManager.MaxMaterials - 1;\n\t\t\t\telse\n\t\t\t\t\tid = this.materials[key] = this.materials.Count;\n\t\t\t}\n\t\t\treturn id;\n\t\t}\n\n\t\tpublic void SetRenderParameters(Microsoft.Xna.Framework.Graphics.Effect effect, RenderParameters parameters)\n\t\t{\n\t\t}\n\n\t\tpublic void RenderGlobalShadowMap(Camera camera)\n\t\t{\n\t\t\tVector3 focus;\n\t\t\tVector3 globalShadowLightForward = Vector3.Transform(Vector3.Forward, this.globalShadowLight.Quaternion);\n\t\t\tfloat size = camera.FarPlaneDistance * 1.75f;\n\t\t\tVector3 shadowCameraOffset = globalShadowLightForward * size * 1.25f;\n\t\t\tfloat farPlane = size * 2.5f;\n\n\t\t\tif (this.globalShadowMapRenderedLastFrame)\n\t\t\t\tthis.globalShadowMapRenderedLastFrame = false;\n\t\t\telse\n\t\t\t{\n\t\t\t\tfocus = camera.Position;\n\t\t\t\tfocus = new Vector3((float)Math.Round(focus.X / LightingManager.globalShadowFocusInterval), (float)Math.Round(focus.Y / LightingManager.globalShadowFocusInterval), (float)Math.Round(focus.Z / LightingManager.globalShadowFocusInterval)) * LightingManager.globalShadowFocusInterval;\n\t\t\t\tthis.shadowCamera.View.Value = Matrix.CreateLookAt(focus + shadowCameraOffset, focus, Vector3.Up);\n\n\t\t\t\tthis.shadowCamera.SetOrthographicProjection(new Point((int)size, (int)size), 1.0f, farPlane);\n\n\t\t\t\tthis.main.GraphicsDevice.SetRenderTarget(this.GlobalShadowMap);\n\t\t\t\tthis.main.GraphicsDevice.Clear(Color.Black);\n\t\t\t\tthis.main.DrawScene(this.shadowRenderParameters);\n\n\t\t\t\tthis.GlobalShadowViewProjection.Value = this.shadowCamera.ViewProjection;\n\t\t\t\tthis.globalShadowMapRenderedLastFrame = true;\n\t\t\t}\n\n\t\t\t// Detail map\n\t\t\tif (this.EnableDetailGlobalShadowMap)\n\t\t\t{\n\t\t\t\tfocus = camera.Position;\n\t\t\t\tfocus = new Vector3((float)Math.Round(focus.X / LightingManager.detailGlobalShadowFocusInterval), (float)Math.Round(focus.Y / LightingManager.detailGlobalShadowFocusInterval), (float)Math.Round(focus.Z / LightingManager.detailGlobalShadowFocusInterval)) * LightingManager.detailGlobalShadowFocusInterval;\n\t\t\t\tthis.shadowCamera.View.Value = Matrix.CreateLookAt(focus + shadowCameraOffset, focus, Vector3.Up);\n\n\t\t\t\tfloat detailSize = size * LightingManager.detailGlobalShadowSizeRatio;\n\t\t\t\tthis.shadowCamera.SetOrthographicProjection(new Point((int)detailSize, (int)detailSize), 1.0f, farPlane);\n\n\t\t\t\tthis.main.GraphicsDevice.SetRenderTarget(this.DetailGlobalShadowMap);\n\t\t\t\tthis.main.GraphicsDevice.Clear(Color.Black);\n\t\t\t\tthis.main.DrawScene(this.shadowRenderParameters);\n\n\t\t\t\tthis.DetailGlobalShadowViewProjection.Value = this.shadowCamera.ViewProjection;\n\t\t\t}\n\t\t}\n\n\t\tpublic void RenderSpotShadowMap(SpotLight light, int index)\n\t\t{\n\t\t\tthis.shadowCamera.View.Value = light.View;\n\t\t\tthis.shadowCamera.SetPerspectiveProjection(light.FieldOfView, new Point(this.spotShadowMapSize, this.spotShadowMapSize), 1.0f, Math.Max(2.0f, light.Attenuation));\n\t\t\tthis.main.GraphicsDevice.SetRenderTarget(this.spotShadowMaps[index]);\n\t\t\tthis.main.GraphicsDevice.Clear(new Color(0, 255, 255));\n\t\t\tthis.main.DrawScene(this.shadowRenderParameters);\n\t\t}\n\n\t\tprivate struct LightEntry<LightType>\n\t\t{\n\t\t\tpublic LightType Light;\n\t\t\tpublic float Score;\n\t\t}\n\t\tprivate List<LightEntry<SpotLight>> spotLightEntries = new List<LightEntry<SpotLight>>();\n\t\tprivate Util.LambdaComparer<LightEntry<SpotLight>> spotLightComparer = new Util.LambdaComparer<LightEntry<SpotLight>>(delegate(LightEntry<SpotLight> a, LightEntry<SpotLight> b)\n\t\t{\n\t\t\treturn a.Score.CompareTo(b.Score);\n\t\t});\n\t\tpublic void RenderShadowMaps(Camera camera)\n\t\t{\n\t\t\tMicrosoft.Xna.Framework.Graphics.RasterizerState originalState = this.main.GraphicsDevice.RasterizerState;\n\t\t\tMicrosoft.Xna.Framework.Graphics.RasterizerState reverseCullState = new Microsoft.Xna.Framework.Graphics.RasterizerState { CullMode = Microsoft.Xna.Framework.Graphics.CullMode.CullClockwiseFace };\n\n\t\t\tthis.main.GraphicsDevice.RasterizerState = reverseCullState;\n\n\t\t\tthis.shadowMapIndices.Clear();\n\n\t\t\tif (this.maxShadowedSpotLights > 0)\n\t\t\t{\n\t\t\t\t// Collect spot lights\n\t\t\t\tforeach (SpotLight light in SpotLight.All)\n\t\t\t\t{\n\t\t\t\t\tif (light.Enabled && !light.Suspended && light.Shadowed && light.Attenuation > 0.0f && camera.BoundingFrustum.Intersects(light.BoundingFrustum))\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat score = (light.Position.Value - camera.Position.Value).LengthSquared() / light.Attenuation;\n\t\t\t\t\t\tif (score < LightingManager.lightShadowThreshold)\n\t\t\t\t\t\t\tthis.spotLightEntries.Add(new LightEntry<SpotLight> { Light = light, Score = score });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.spotLightEntries.Sort(this.spotLightComparer);\n\n\t\t\t\t// Render spot shadow maps\n\t\t\t\tfor (int i = 0; i < this.spotLightEntries.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tLightEntry<SpotLight> entry = this.spotLightEntries[i];\n\t\t\t\t\tthis.shadowMapIndices[entry.Light] = i;\n\t\t\t\t\tthis.RenderSpotShadowMap(entry.Light, i);\n\t\t\t\t\tif (i >= this.maxShadowedSpotLights - 1)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthis.spotLightEntries.Clear();\n\t\t\t}\n\n\t\t\tthis.main.GraphicsDevice.RasterizerState = originalState;\n\n\t\t\t// Render global shadow map\n\t\t\tif (this.EnableGlobalShadowMap && this.globalShadowLight != null)\n\t\t\t\tthis.RenderGlobalShadowMap(camera);\n\t\t}\n\n\t\tpublic void SetGlobalLightParameters(Microsoft.Xna.Framework.Graphics.Effect effect, Camera camera, Vector3 cameraPos)\n\t\t{\n\t\t\teffect.Parameters[\"DirectionalLightDirections\"].SetValue(this.directionalLightDirections);\n\t\t\teffect.Parameters[\"DirectionalLightColors\"].SetValue(this.directionalLightColors);\n\t\t\teffect.Parameters[\"EnvironmentColor\"].SetValue(this.EnvironmentColor);\n\t\t\teffect.Parameters[\"Environment\" + Model.SamplerPostfix].SetValue(this.environmentMap);\n\t\t\teffect.Parameters[\"CloudShadow\"].SetValue(this.directionalLightCloudShadow);\n\t\t\teffect.Parameters[\"CloudOffset\"].SetValue(this.directionalLightCloudVelocity * (this.main.TotalTime / 60.0f));\n\t\t\teffect.Parameters[\"CameraPosition\"].SetValue(cameraPos);\n\n\t\t\tif (this.EnableGlobalShadowMap)\n\t\t\t{\n\t\t\t\teffect.Parameters[\"ShadowViewProjectionMatrix\"].SetValue(Matrix.CreateTranslation(cameraPos) * this.GlobalShadowViewProjection);\n\t\t\t\teffect.Parameters[\"ShadowMapSize\"].SetValue(this.globalShadowMapSize);\n\t\t\t\teffect.Parameters[\"ShadowMap\" + Model.SamplerPostfix].SetValue(this.GlobalShadowMap);\n\n\t\t\t\tif (this.EnableDetailGlobalShadowMap)\n\t\t\t\t{\n\t\t\t\t\teffect.Parameters[\"DetailShadowViewProjectionMatrix\"].SetValue(Matrix.CreateTranslation(cameraPos) * this.DetailGlobalShadowViewProjection);\n\t\t\t\t\teffect.Parameters[\"DetailShadowMapSize\"].SetValue(this.detailGlobalShadowMapSize);\n\t\t\t\t\teffect.Parameters[\"DetailShadowMap\" + Model.SamplerPostfix].SetValue(this.DetailGlobalShadowMap);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetCompositeParameters(Microsoft.Xna.Framework.Graphics.Effect effect)\n\t\t{\n\t\t\teffect.Parameters[\"AmbientLightColor\"].SetValue(this.ambientLightColor);\n\t\t}\n\n\t\tpublic void SetSpotLightParameters(SpotLight light, Microsoft.Xna.Framework.Graphics.Effect effect, Vector3 cameraPos)\n\t\t{\n\t\t\tbool shadowed = light.Shadowed && this.shadowMapIndices.ContainsKey(light);\n\t\t\teffect.CurrentTechnique = effect.Techniques[shadowed ? \"SpotLightShadowed\" : \"SpotLight\"];\n\t\t\tif (shadowed)\n\t\t\t{\n\t\t\t\teffect.Parameters[\"ShadowMap\" + Model.SamplerPostfix].SetValue(this.spotShadowMaps[this.shadowMapIndices[light]]);\n\t\t\t\teffect.Parameters[\"ShadowMapSize\"].SetValue(this.spotShadowMapSize);\n\t\t\t}\n\n\t\t\tfloat horizontalScale = (float)Math.Sin(light.FieldOfView * 0.5f) * light.Attenuation;\n\t\t\tfloat depthScale = (float)Math.Cos(light.FieldOfView * 0.5f) * light.Attenuation;\n\t\t\teffect.Parameters[\"SpotLightViewProjectionMatrix\"].SetValue(Matrix.CreateTranslation(cameraPos) * light.ViewProjection);\n\t\t\teffect.Parameters[\"SpotLightPosition\"].SetValue(light.Position - cameraPos);\n\n\t\t\tMatrix rotation = Matrix.CreateFromQuaternion(light.Orientation);\n\t\t\trotation.Forward *= -1.0f;\n\t\t\teffect.Parameters[\"SpotLightDirection\"].SetValue(rotation.Forward);\n\t\t\teffect.Parameters[\"WorldMatrix\"].SetValue(Matrix.CreateScale(horizontalScale, horizontalScale, depthScale) * rotation * Matrix.CreateTranslation(light.Position - cameraPos));\n\n\t\t\teffect.Parameters[\"SpotLightRadius\"].SetValue(depthScale);\n\t\t\teffect.Parameters[\"SpotLightColor\"].SetValue(light.Color);\n\t\t\teffect.Parameters[\"Cookie\" + Model.SamplerPostfix].SetValue(light.CookieTexture);\n\t\t}\n\n\t\tpublic void SetPointLightParameters(PointLight light, Microsoft.Xna.Framework.Graphics.Effect effect, Vector3 cameraPos)\n\t\t{\n\t\t\teffect.Parameters[\"WorldMatrix\"].SetValue(Matrix.CreateScale(light.Attenuation) * Matrix.CreateTranslation(light.Position - cameraPos));\n\t\t\teffect.Parameters[\"PointLightPosition\"].SetValue(light.Position - cameraPos);\n\t\t\teffect.Parameters[\"PointLightRadius\"].SetValue(light.Attenuation);\n\t\t\teffect.Parameters[\"PointLightColor\"].SetValue(light.Color);\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tthis.shadowCamera.Delete.Execute();\n\n\t\t\tforeach (Microsoft.Xna.Framework.Graphics.RenderTarget2D shadowMap in this.spotShadowMaps)\n\t\t\t\tshadowMap.Dispose();\n\n\t\t\tif (this.GlobalShadowMap.Value != null)\n\t\t\t\tthis.GlobalShadowMap.Value.Dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Graphics/LineDrawer.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class LineDrawer : Component<Main>, IDrawableAlphaComponent\n\t{\n\t\tpublic struct Line\n\t\t{\n\t\t\tpublic VertexPositionColor A;\n\t\t\tpublic VertexPositionColor B;\n\t\t}\n\n\t\tpublic Property<int> DrawOrder { get; set; }\n\n\t\t[XmlIgnore]\n\t\tpublic ListProperty<Line> Lines = new ListProperty<Line>();\n\n\t\tprivate Effect effect;\n\n\t\tprivate bool changed;\n\n\t\tprivate static List<Technique> unsupportedTechniques = new List<Technique>();\n\n\t\tprivate DynamicVertexBuffer vertexBuffer;\n\n\t\tpublic LineDrawer()\n\t\t{\n\t\t\tthis.Serialize = false;\n\t\t\tthis.DrawOrder = new Property<int> { Value = 11 };\n\t\t}\n\n\t\tpublic void LoadContent(bool reload)\n\t\t{\n\t\t\tthis.effect = this.main.Content.Load<Effect>(\"Effects\\\\Lines\").Clone();\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new NotifyBinding(this.main.AlphaDrawablesModified, this.DrawOrder));\n\t\t\tthis.Add(new ListNotifyBinding<Line>(delegate() { this.changed = true; }, this.Lines));\n\t\t}\n\n\t\tvoid IDrawableAlphaComponent.DrawAlpha(Microsoft.Xna.Framework.GameTime time, RenderParameters p)\n\t\t{\n\t\t\tif (this.Lines.Length == 0 || LineDrawer.unsupportedTechniques.Contains(p.Technique))\n\t\t\t\treturn;\n\n\t\t\tif (this.vertexBuffer == null || this.vertexBuffer.IsContentLost || this.Lines.Length * 2 > this.vertexBuffer.VertexCount || this.changed)\n\t\t\t{\n\t\t\t\tthis.changed = false;\n\t\t\t\tif (this.vertexBuffer != null)\n\t\t\t\t\tthis.vertexBuffer.Dispose();\n\n\t\t\t\tthis.vertexBuffer = new DynamicVertexBuffer(this.main.GraphicsDevice, VertexPositionColor.VertexDeclaration, (this.Lines.Length * 2) + 8, BufferUsage.WriteOnly);\n\n\t\t\t\tVertexPositionColor[] data = new VertexPositionColor[this.vertexBuffer.VertexCount];\n\t\t\t\tfor (int i = 0; i < this.Lines.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tLine line = this.Lines[i];\n\t\t\t\t\tdata[i * 2] = line.A;\n\t\t\t\t\tdata[i * 2 + 1] = line.B;\n\t\t\t\t}\n\t\t\t\tthis.vertexBuffer.SetData<VertexPositionColor>(data, 0, this.Lines.Length * 2, SetDataOptions.Discard);\n\t\t\t}\n\n\t\t\tp.Camera.SetParameters(this.effect);\n\t\t\tthis.effect.Parameters[\"Depth\" + Model.SamplerPostfix].SetValue(p.DepthBuffer);\n\n\t\t\t// Draw lines\n\t\t\ttry\n\t\t\t{\n\t\t\t\tthis.effect.CurrentTechnique = this.effect.Techniques[p.TechniqueString];\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\tLineDrawer.unsupportedTechniques.Add(p.Technique);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.effect.CurrentTechnique.Passes[0].Apply();\n\t\t\tthis.main.GraphicsDevice.SetVertexBuffer(this.vertexBuffer);\n\t\t\tthis.main.GraphicsDevice.DrawPrimitives(PrimitiveType.LineList, 0, this.Lines.Length);\n\t\t\tModel.DrawCallCounter++;\n\t\t\tModel.TriangleCounter += this.Lines.Length;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tthis.effect.Dispose();\n\t\t\tif (this.vertexBuffer != null)\n\t\t\t\tthis.vertexBuffer.Dispose();\n\t\t\tbase.delete();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Graphics/Model.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework.Content;\nusing Lemma.Factories;\nusing Lemma.IO;\nusing System.IO;\n\nnamespace Lemma.Components\n{\n\t[XmlInclude(typeof(Material))]\n\t[XmlInclude(typeof(Property<Material>))]\n\t[XmlInclude(typeof(ListProperty<Material>))]\n\tpublic class Model : Component<Main>, IDrawableComponent\n\t{\n#if MONOGAME\n\t\tpublic const string SamplerPostfix = \"Sampler\";\n#else\n\t\tpublic const string SamplerPostfix = \"Texture\";\n#endif\n\n\t\t[XmlIgnore]\n\t\tpublic Property<string> OrderKey { get; private set; }\n\n\t\tprotected struct InstanceVertex\n\t\t{\n\t\t\tpublic Matrix Transform;\n\t\t\tpublic Matrix LastTransform;\n\t\t\tpublic Vector3 Param;\n\t\t}\n\n\t\tpublic float GetDistance(Vector3 camera)\n\t\t{\n\t\t\tVector3 translation = this.Transform.Value.Translation;\n\t\t\tif (this.boundingBoxValid && this.CullBoundingBox)\n\t\t\t{\n\t\t\t\tBoundingBox box = this.BoundingBox;\n\t\t\t\ttranslation += (box.Min + box.Max) * 0.5f;\n\t\t\t}\n\t\t\treturn (translation - camera).LengthSquared();\n\t\t}\n\n\t\tpublic bool IsVisible(BoundingFrustum frustum)\n\t\t{\n\t\t\treturn !this.boundingBoxValid || !this.CullBoundingBox || frustum.Intersects(this.BoundingBox.Value.Transform(Matrix.CreateScale(this.Scale) * this.Transform));\n\t\t}\n\n\t\tpublic static int DrawCallCounter;\n\t\tpublic static int TriangleCounter;\n\n\t\tprotected Microsoft.Xna.Framework.Graphics.Model model;\n\n\t\tpublic Property<string> Filename = new Property<string>();\n\t\tpublic Property<string> EffectFile = new Property<string>();\n\t\tpublic Property<string> TechniquePostfix = new Property<string> { Value = \"\" };\n\t\tprotected Matrix lastWorldViewProjection;\n\t\tprotected Matrix lastTransform;\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> Transform = new Property<Matrix> { Value = Matrix.Identity };\n\t\tpublic Property<Vector3> Scale = new Property<Vector3> { Value = Vector3.One };\n\t\tpublic Property<Vector3> Color = new Property<Vector3> { Value = Vector3.One };\n\n\t\tpublic virtual void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"Scale\", this.Scale);\n\t\t\tthis.Entity.Add(\"Color\", this.Color);\n\t\t\tthis.Entity.Add(\"Filename\", this.Filename, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.Content.RootDirectory, new[] { \"Models\", Path.Combine(MapLoader.MapDirectory, \"Models\") }),\n\t\t\t});\n\t\t}\n\n\t\tpublic struct Material\n\t\t{\n\t\t\tpublic static Material Unlit = new Material();\n\t\t\tpublic float SpecularPower;\n\t\t\tpublic float SpecularIntensity;\n\t\t}\n\t\tpublic Material[] Materials = new []\n\t\t{\n\t\t\tnew Material\n\t\t\t{\n\t\t\t\tSpecularPower = 1.0f,\n\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t},\n\t\t\tMaterial.Unlit,\n\t\t};\n\t\tprivate int[] materialIds = new int[2];\n\n\t\tpublic Property<bool> IsInstanced = new Property<bool>();\n\t\tpublic Property<bool> DisableCulling = new Property<bool>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> IsValid = new Property<bool>();\n\n\t\tprotected Texture2D normalMap;\n\t\tpublic Property<string> NormalMap = new Property<string>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<BoundingBox> BoundingBox = new Property<BoundingBox>();\n\t\tprivate bool boundingBoxValid = false;\n\t\tpublic Property<bool> CullBoundingBox = new Property<bool> { Value = true };\n\n\t\tprotected Texture2D diffuseTexture;\n\t\tpublic Property<string> DiffuseTexture = new Property<string>();\n\n\t\tpublic struct Instance\n\t\t{\n\t\t\tpublic Vector3 Param;\n\t\t\tpublic Matrix Transform;\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic ListProperty<Instance> Instances = new ListProperty<Instance>();\n\n\t\tprivate bool instancesChanged = true;\n\t\tprivate bool lastInstancesChanged;\n\n\t\t[XmlIgnore]\n\t\tpublic bool MapContent = true;\n\n\t\tprotected InstanceVertex[] instanceVertexData;\n\t\tprotected DynamicVertexBuffer instanceVertexBuffer;\n\t\t[XmlIgnore]\n\t\tpublic ListProperty<Technique> UnsupportedTechniques = new ListProperty<Technique>();\n\n\t\tprotected Effect effect;\n\n\t\t// To store instance transform matrices in a vertex buffer, we use this custom\n\t\t// vertex type which encodes 4x4 matrices as a set of four Vector4 values.\n\t\tprotected static VertexDeclaration instanceVertexDeclaration = new VertexDeclaration\n\t\t(\n\t\t\tnew VertexElement(0, VertexElementFormat.Vector4, VertexElementUsage.BlendWeight, 0),\n\t\t\tnew VertexElement(16, VertexElementFormat.Vector4, VertexElementUsage.BlendWeight, 1),\n\t\t\tnew VertexElement(32, VertexElementFormat.Vector4, VertexElementUsage.BlendWeight, 2),\n\t\t\tnew VertexElement(48, VertexElementFormat.Vector4, VertexElementUsage.BlendWeight, 3),\n\t\t\tnew VertexElement(64, VertexElementFormat.Vector4, VertexElementUsage.BlendWeight, 4),\n\t\t\tnew VertexElement(80, VertexElementFormat.Vector4, VertexElementUsage.BlendWeight, 5),\n\t\t\tnew VertexElement(96, VertexElementFormat.Vector4, VertexElementUsage.BlendWeight, 6),\n\t\t\tnew VertexElement(112, VertexElementFormat.Vector4, VertexElementUsage.BlendWeight, 7),\n\t\t\tnew VertexElement(128, VertexElementFormat.Vector3, VertexElementUsage.BlendWeight, 8)\n\t\t);\n\n#if !MONOGAME\n\t\tstatic Dictionary<string, BoundingBox> boundingBoxCache = new Dictionary<string, BoundingBox>();\n#endif\n\n\t\tpublic Model()\n\t\t{\n\t\t\tthis.EnabledWhenPaused = true;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\t// Make sure all the parameters come before the model and effect\n\t\t\tthis.Add(new SetBinding<string>(this.NormalMap, delegate(string value)\n\t\t\t{\n\t\t\t\tthis.normalMap = string.IsNullOrEmpty(value) ? null : (this.MapContent ? this.main.MapContent : this.main.Content).Load<Texture2D>(value);\n\t\t\t\tif (this.effect != null && this.normalMap != null)\n\t\t\t\t{\n\t\t\t\t\tEffectParameter param = this.effect.Parameters[\"NormalMap\" + Model.SamplerPostfix];\n\t\t\t\t\tif (param != null)\n\t\t\t\t\t\tparam.SetValue(this.normalMap);\n\t\t\t\t}\n\t\t\t}));\n\t\t\tthis.Add(new SetBinding<string>(this.DiffuseTexture, delegate(string value)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tthis.diffuseTexture = string.IsNullOrEmpty(value) ? null : (this.MapContent ? this.main.MapContent : this.main.Content).Load<Texture2D>(value);\n\t\t\t\t}\n\t\t\t\tcatch (ContentLoadException)\n\t\t\t\t{\n\t\t\t\t\tthis.diffuseTexture = null;\n\t\t\t\t}\n\t\t\t\tif (this.effect != null && this.diffuseTexture != null)\n\t\t\t\t{\n\t\t\t\t\tEffectParameter param = this.effect.Parameters[\"Diffuse\" + Model.SamplerPostfix];\n\t\t\t\t\tif (param != null)\n\t\t\t\t\t\tparam.SetValue(this.diffuseTexture);\n\t\t\t\t}\n\t\t\t}));\n\t\t\tthis.Add(new SetBinding<Vector3>(this.Color, delegate(Vector3 value)\n\t\t\t{\n\t\t\t\tif (this.effect != null)\n\t\t\t\t{\n\t\t\t\t\tEffectParameter param = this.effect.Parameters[\"DiffuseColor\"];\n\t\t\t\t\tif (param != null)\n\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<BoundingBox>(this.BoundingBox, delegate(BoundingBox value)\n\t\t\t{\n\t\t\t\tthis.boundingBoxValid = true;\n\t\t\t}));\n\n\t\t\tthis.Add(new ChangeBinding<string>(this.Filename, delegate(string old, string value)\n\t\t\t{\n\t\t\t\tif (value == old && this.model != null)\n\t\t\t\t\treturn;\n\t\t\t\tthis.boundingBoxValid = false;\n\t\t\t\tthis.loadModel(value, false);\n#if !MONOGAME\n\t\t\t\tif (this.model != null)\n\t\t\t\t{\n\t\t\t\t\t// TODO: Fix bounding box calculation\n\t\t\t\t\tBoundingBox boundingBox = new BoundingBox();\n\t\t\t\t\tif (!Model.boundingBoxCache.TryGetValue(value, out boundingBox))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Create variables to hold min and max xyz values for the model. Initialise them to extremes\n\t\t\t\t\t\tVector3 modelMax = new Vector3(float.MinValue, float.MinValue, float.MinValue);\n\t\t\t\t\t\tVector3 modelMin = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue);\n\n\t\t\t\t\t\tfor (int i = 0; i < this.model.Meshes.Count; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tModelMesh mesh = this.model.Meshes[i];\n\t\t\t\t\t\t\t//Create variables to hold min and max xyz values for the mesh. Initialise them to extremes\n\t\t\t\t\t\t\tVector3 meshMax = new Vector3(float.MinValue, float.MinValue, float.MinValue);\n\t\t\t\t\t\t\tVector3 meshMin = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue);\n\n\t\t\t\t\t\t\t// There may be multiple parts in a mesh (different materials etc.) so loop through each\n\t\t\t\t\t\t\tfor (int j = 0; j < mesh.MeshParts.Count; j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tModelMeshPart part = mesh.MeshParts[j];\n\t\t\t\t\t\t\t\t// The stride is how big, in bytes, one vertex is in the vertex buffer\n\t\t\t\t\t\t\t\t// We have to use this as we do not know the make up of the vertex\n\t\t\t\t\t\t\t\tint stride = part.VertexBuffer.VertexDeclaration.VertexStride;\n\n\t\t\t\t\t\t\t\tbyte[] vertexData = new byte[stride * part.NumVertices];\n\t\t\t\t\t\t\t\tpart.VertexBuffer.GetData(part.VertexOffset * stride, vertexData, 0, part.NumVertices, 1);\n\n\t\t\t\t\t\t\t\t// Find minimum and maximum xyz values for this mesh part\n\t\t\t\t\t\t\t\t// We know the position will always be the first 3 float values of the vertex data\n\t\t\t\t\t\t\t\tVector3 vertPosition = new Vector3();\n\t\t\t\t\t\t\t\tfor (int ndx = 0; ndx < vertexData.Length; ndx += stride)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvertPosition.X = BitConverter.ToSingle(vertexData, ndx);\n\t\t\t\t\t\t\t\t\tvertPosition.Y = BitConverter.ToSingle(vertexData, ndx + sizeof(float));\n\t\t\t\t\t\t\t\t\tvertPosition.Z = BitConverter.ToSingle(vertexData, ndx + sizeof(float) * 2);\n\n\t\t\t\t\t\t\t\t\t// update our running values from this vertex\n\t\t\t\t\t\t\t\t\tmeshMin = Vector3.Min(meshMin, vertPosition);\n\t\t\t\t\t\t\t\t\tmeshMax = Vector3.Max(meshMax, vertPosition);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Expand model extents by the ones from this mesh\n\t\t\t\t\t\t\tmodelMin = Vector3.Min(modelMin, meshMin);\n\t\t\t\t\t\t\tmodelMax = Vector3.Max(modelMax, meshMax);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tboundingBox = new BoundingBox(modelMin, modelMax);\n\t\t\t\t\t\tModel.boundingBoxCache[value] = boundingBox;\n\t\t\t\t\t}\n\t\t\t\t\tthis.BoundingBox.Value = boundingBox;\n\t\t\t\t}\n#endif\n\t\t\t}));\n\n\t\t\tthis.Add(new ChangeBinding<string>(this.EffectFile, delegate(string old, string value)\n\t\t\t{\n\t\t\t\tif (value == old && this.effect != null)\n\t\t\t\t\treturn;\n\t\t\t\tthis.loadEffect(value);\n\t\t\t}));\n\n\t\t\tthis.Instances.ItemRemoved += delegate(int index, Instance instance)\n\t\t\t{\n\t\t\t\tif (this.instanceVertexData != null)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = index; i < Math.Min(this.Instances.Length, this.instanceVertexData.Length) - 1; i++)\n\t\t\t\t\t\tthis.instanceVertexData[i] = this.instanceVertexData[i + 1];\n\t\t\t\t}\n\t\t\t\tthis.instancesChanged = true;\n\t\t\t};\n\t\t\tthis.Instances.ItemAdded += delegate(int index, Instance instance)\n\t\t\t{\n\t\t\t\tif (this.instanceVertexData != null && index < this.instanceVertexData.Length)\n\t\t\t\t{\n\t\t\t\t\tthis.instanceVertexData[index].LastTransform = instance.Transform;\n\t\t\t\t\tthis.instanceVertexData[index].Transform = instance.Transform;\n\t\t\t\t}\n\t\t\t\tthis.instancesChanged = true;\n\t\t\t};\n\t\t\tthis.Instances.ItemChanged += delegate(int index, Instance old, Instance newValue)\n\t\t\t{\n\t\t\t\tthis.instancesChanged = true;\n\t\t\t};\n\t\t\tthis.Instances.Cleared += delegate()\n\t\t\t{\n\t\t\t\tthis.instancesChanged = true;\n\t\t\t};\n\t\t\tthis.Add(new CommandBinding(this.main.ReloadingContent, delegate()\n\t\t\t{\n\t\t\t\tif (this.instanceVertexBuffer != null)\n\t\t\t\t\tthis.instanceVertexBuffer.Dispose();\n\t\t\t\tthis.instanceVertexBuffer = null;\n\t\t\t}));\n\n\t\t\tthis.OrderKey = new Property<string>();\n\t\t\tthis.Add(new Binding<string>(this.OrderKey, delegate()\n\t\t\t{\n\t\t\t\treturn string.Format(\"{0}|{1}|{2}\", this.EffectFile.Value, this.TechniquePostfix.Value, this.DiffuseTexture.Value);\n\t\t\t}, this.EffectFile, this.TechniquePostfix, this.DiffuseTexture));\n\n\t\t\tthis.Add(new NotifyBinding(this.main.DrawablesModified, this.OrderKey));\n\t\t}\n\n\t\tpublic virtual void LoadContent(bool reload)\n\t\t{\n\t\t\tif (reload)\n\t\t\t\tthis.loadModel(this.Filename, true);\n\t\t}\n\n\t\tprotected virtual void loadEffect(string file)\n\t\t{\n\t\t\tthis.effect = null;\n\t\t\tif (file == null)\n\t\t\t{\n\t\t\t\tif (this.model != null)\n\t\t\t\t\tthis.effect = this.model.Meshes.FirstOrDefault().Effects.FirstOrDefault().Clone();\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis.effect = (this.MapContent ? this.main.MapContent : this.main.Content).Load<Effect>(file).Clone();\n\n\t\t\tif (this.effect != null)\n\t\t\t{\n\t\t\t\t// Reset parameters\n\n\t\t\t\tforeach (IProperty property in this.properties.Values)\n\t\t\t\t{\n\t\t\t\t\t// Render targets should be reloaded from the source\n\t\t\t\t\tif (property.GetType() != typeof(Property<RenderTarget2D>))\n\t\t\t\t\t\tproperty.Reset();\n\t\t\t\t}\n\n\t\t\t\tthis.Color.Reset();\n\t\t\t\tthis.DiffuseTexture.Reset();\n\t\t\t\tthis.NormalMap.Reset();\n\t\t\t}\n\t\t}\n\n\t\tprotected virtual void loadModel(string file, bool reload)\n\t\t{\n\t\t\tif (!reload)\n\t\t\t\tthis.UnsupportedTechniques.Clear();\n\t\t\tif (string.IsNullOrEmpty(file))\n\t\t\t{\n\t\t\t\tthis.model = null;\n\t\t\t\tthis.effect = null;\n\t\t\t\tthis.IsValid.Value = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tthis.model = (this.MapContent ? this.main.MapContent : this.main.Content).Load<Microsoft.Xna.Framework.Graphics.Model>(file);\n\t\t\t\t\tthis.loadEffect(this.EffectFile);\n\t\t\t\t\tthis.IsValid.Value = true;\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tLog.d(e.ToString());\n\t\t\t\t\tthis.model = null;\n\t\t\t\t\tthis.effect = null;\n\t\t\t\t\tthis.IsValid.Value = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate Dictionary<string, IProperty> properties = new Dictionary<string, IProperty>();\n\n\t\tpublic Property<bool> GetBoolParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<bool> property = new Property<bool>();\n\t\t\t\tthis.Add(new SetBinding<bool>(property, delegate(bool value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<bool>)result;\n\t\t}\n\n\t\tpublic Property<bool[]> GetBoolArrayParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<bool[]> property = new Property<bool[]>();\n\t\t\t\tthis.Add(new SetBinding<bool[]>(property, delegate(bool[] value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<bool[]>)result;\n\t\t}\n\n\t\tpublic Property<int> GetIntParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<int> property = new Property<int>();\n\t\t\t\tthis.Add(new SetBinding<int>(property, delegate(int value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<int>)result;\n\t\t}\n\n\t\tpublic Property<int[]> GetIntArrayParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<int[]> property = new Property<int[]>();\n\t\t\t\tthis.Add(new SetBinding<int[]>(property, delegate(int[] value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<int[]>)result;\n\t\t}\n\n\t\tpublic Property<float> GetFloatParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<float> property = new Property<float>();\n\t\t\t\tthis.Add(new SetBinding<float>(property, delegate(float value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<float>)result;\n\t\t}\n\n\t\tpublic Property<float[]> GetFloatArrayParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<float[]> property = new Property<float[]>();\n\t\t\t\tthis.Add(new SetBinding<float[]>(property, delegate(float[] value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<float[]>)result;\n\t\t}\n\n\t\tpublic Property<Vector2> GetVector2Parameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<Vector2> property = new Property<Vector2>();\n\t\t\t\tthis.Add(new SetBinding<Vector2>(property, delegate(Vector2 value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<Vector2>)result;\n\t\t}\n\n\t\tpublic Property<Vector2[]> GetVector2ArrayParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<Vector2[]> property = new Property<Vector2[]>();\n\t\t\t\tthis.Add(new SetBinding<Vector2[]>(property, delegate(Vector2[] value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<Vector2[]>)result;\n\t\t}\n\n\t\tpublic Property<Vector3> GetVector3Parameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<Vector3> property = new Property<Vector3>();\n\t\t\t\tthis.Add(new SetBinding<Vector3>(property, delegate(Vector3 value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<Vector3>)result;\n\t\t}\n\n\t\tpublic Property<Vector3[]> GetVector3ArrayParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<Vector3[]> property = new Property<Vector3[]>();\n\t\t\t\tthis.Add(new SetBinding<Vector3[]>(property, delegate(Vector3[] value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<Vector3[]>)result;\n\t\t}\n\n\t\tpublic Property<Vector4> GetVector4Parameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<Vector4> property = new Property<Vector4>();\n\t\t\t\tthis.Add(new SetBinding<Vector4>(property, delegate(Vector4 value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<Vector4>)result;\n\t\t}\n\n\t\tpublic Property<Vector4[]> GetVector4ArrayParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<Vector4[]> property = new Property<Vector4[]>();\n\t\t\t\tthis.Add(new SetBinding<Vector4[]>(property, delegate(Vector4[] value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<Vector4[]>)result;\n\t\t}\n\n\t\tpublic Property<Matrix> GetMatrixParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<Matrix> property = new Property<Matrix>();\n\t\t\t\tthis.Add(new SetBinding<Matrix>(property, delegate(Matrix value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<Matrix>)result;\n\t\t}\n\n\t\tpublic Property<Matrix[]> GetMatrixArrayParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<Matrix[]> property = new Property<Matrix[]>();\n\t\t\t\tthis.Add(new SetBinding<Matrix[]>(property, delegate(Matrix[] value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null)\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<Matrix[]>)result;\n\t\t}\n\n\t\tpublic Property<Texture2D> GetTexture2DParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<Texture2D> property = new Property<Texture2D>();\n\t\t\t\tthis.Add(new SetBinding<Texture2D>(property, delegate(Texture2D value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null && (value == null || !value.IsDisposed))\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<Texture2D>)result;\n\t\t}\n\n\t\tpublic Property<RenderTarget2D> GetRenderTarget2DParameter(string name)\n\t\t{\n\t\t\tIProperty result = null;\n\t\t\tif (!this.properties.TryGetValue(name, out result))\n\t\t\t{\n\t\t\t\tProperty<RenderTarget2D> property = new Property<RenderTarget2D>();\n\t\t\t\tthis.Add(new SetBinding<RenderTarget2D>(property, delegate(RenderTarget2D value)\n\t\t\t\t{\n\t\t\t\t\tif (this.effect != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tEffectParameter param = this.effect.Parameters[name];\n\t\t\t\t\t\tif (param != null && (value == null || !value.IsDisposed))\n\t\t\t\t\t\t\tparam.SetValue(value);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tthis.properties[name] = property;\n\t\t\t\tresult = property;\n\t\t\t}\n\t\t\treturn (Property<RenderTarget2D>)result;\n\t\t}\n\n\t\tprotected virtual bool setParameters(Matrix transform, RenderParameters parameters)\n\t\t{\n\t\t\tif (this.effect == null || this.UnsupportedTechniques.Contains(parameters.Technique))\n\t\t\t\treturn false;\n\n\t\t\tEffectTechnique technique = this.effect.Techniques[parameters.TechniqueString + this.TechniquePostfix];\n\t\t\tif (technique == null)\n\t\t\t{\n\t\t\t\tthis.UnsupportedTechniques.Add(parameters.Technique);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis.effect.CurrentTechnique = technique;\n\t\t\t\n\t\t\tif (parameters.Technique == Technique.Clip)\n\t\t\t\tthis.effect.Parameters[\"ClipPlanes\"].SetValue(parameters.ClipPlaneData);\n\t\t\tEffectParameter parameter = this.effect.Parameters[\"LastFrameWorldMatrix\"];\n\t\t\tif (parameter != null)\n\t\t\t\tparameter.SetValue(this.lastTransform);\n\t\t\tparameter = this.effect.Parameters[\"LastFrameWorldViewProjectionMatrix\"];\n\t\t\tif (parameter != null)\n\t\t\t\tparameter.SetValue(this.lastWorldViewProjection);\n\t\t\tparameter = this.effect.Parameters[\"WorldMatrix\"];\n\t\t\tif (parameter != null)\n\t\t\t\tparameter.SetValue(transform);\n\t\t\tparameter = this.effect.Parameters[\"WorldViewMatrix\"];\n\t\t\tif (parameter != null)\n\t\t\t\tparameter.SetValue(transform * parameters.Camera.View);\n\t\t\tparameter = this.effect.Parameters[\"Time\"];\n\t\t\tif (parameter != null)\n\t\t\t\tparameter.SetValue(this.main.TotalTime);\n\t\t\tparameters.Camera.SetParameters(this.effect);\n\n\t\t\tif (this.materialIds.Length < this.Materials.Length)\n\t\t\t\tthis.materialIds = new int[this.Materials.Length];\n\t\t\tfor (int i = 0; i < this.Materials.Length; i++)\n\t\t\t\tthis.materialIds[i] = this.main.LightingManager.GetMaterialIndex(this.Materials[i]);\n\n\t\t\tthis.effect.Parameters[\"Materials\"].SetValue(this.materialIds);\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic virtual void Draw(GameTime time, RenderParameters parameters)\n\t\t{\n\t\t\tMatrix transform = Matrix.CreateScale(this.Scale) * this.Transform;\n\t\t\tif (!this.IsInstanced)\n\t\t\t\tthis.draw(parameters, transform);\n\t\t\telse\n\t\t\t\tthis.drawInstances(parameters, transform);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Draws a single mesh using the given world matrix.\n\t\t/// </summary>\n\t\t/// <param name=\"camera\"></param>\n\t\t/// <param name=\"transform\"></param>\n\t\tprotected virtual void draw(RenderParameters parameters, Matrix transform)\n\t\t{\n\t\t\tif (this.model != null)\n\t\t\t{\n\t\t\t\tif (this.setParameters(transform, parameters))\n\t\t\t\t{\n\t\t\t\t\tthis.main.LightingManager.SetRenderParameters(this.effect, parameters);\n\n\t\t\t\t\tRasterizerState originalState = this.main.GraphicsDevice.RasterizerState;\n\t\t\t\t\tRasterizerState noCullState = null;\n\t\t\t\t\tif (this.DisableCulling)\n\t\t\t\t\t{\n\t\t\t\t\t\tnoCullState = new RasterizerState { CullMode = CullMode.None };\n\t\t\t\t\t\tthis.main.GraphicsDevice.RasterizerState = noCullState;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = 0; i < this.model.Meshes.Count; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tModelMesh mesh = this.model.Meshes[i];\n\t\t\t\t\t\tfor (int j = 0; j < mesh.MeshParts.Count; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tModelMeshPart part = mesh.MeshParts[j];\n\t\t\t\t\t\t\tif (part.NumVertices > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Draw all the instance copies in a single call.\n\t\t\t\t\t\t\t\tthis.effect.CurrentTechnique.Passes[0].Apply();\n\t\t\t\t\t\t\t\tthis.main.GraphicsDevice.SetVertexBuffer(part.VertexBuffer, part.VertexOffset);\n\t\t\t\t\t\t\t\tthis.main.GraphicsDevice.Indices = part.IndexBuffer;\n\t\t\t\t\t\t\t\tthis.main.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, part.NumVertices, part.StartIndex, part.PrimitiveCount);\n\t\t\t\t\t\t\t\tModel.DrawCallCounter++;\n\t\t\t\t\t\t\t\tModel.TriangleCounter += part.PrimitiveCount;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (noCullState != null)\n\t\t\t\t\t\tthis.main.GraphicsDevice.RasterizerState = originalState;\n\n\t\t\t\t\tif (parameters.IsMainRender)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.lastTransform = transform;\n\t\t\t\t\t\tthis.lastWorldViewProjection = transform * parameters.Camera.ViewProjection;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Draws a collection of instances. Requires an HLSL effect designed for hardware instancing.\n\t\t/// </summary>\n\t\t/// <param name=\"device\"></param>\n\t\t/// <param name=\"camera\"></param>\n\t\t/// <param name=\"instances\"></param>\n\t\tprotected virtual void drawInstances(RenderParameters parameters, Matrix transform)\n\t\t{\n\t\t\tif (this.Instances.Length == 0)\n\t\t\t\treturn;\n\n\t\t\tbool recalculate = this.instanceVertexBuffer == null || this.instanceVertexBuffer.IsContentLost || (parameters.IsMainRender && (this.instancesChanged || this.lastInstancesChanged));\n\t\t\tif (recalculate)\n\t\t\t{\n\t\t\t\t// If we have more instances than room in our vertex buffer, grow it to the neccessary size.\n\t\t\t\tif (this.instanceVertexBuffer == null || this.instanceVertexBuffer.IsContentLost || this.Instances.Length > this.instanceVertexBuffer.VertexCount)\n\t\t\t\t{\n\t\t\t\t\tif (this.instanceVertexBuffer != null)\n\t\t\t\t\t\tthis.instanceVertexBuffer.Dispose();\n\n\t\t\t\t\tint bufferSize = (int)Math.Pow(2.0, Math.Ceiling(Math.Log(this.Instances.Length, 2.0)));\n\n\t\t\t\t\tthis.instanceVertexBuffer = new DynamicVertexBuffer\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.main.GraphicsDevice,\n\t\t\t\t\t\tModel.instanceVertexDeclaration,\n\t\t\t\t\t\tbufferSize,\n\t\t\t\t\t\tBufferUsage.WriteOnly\n\t\t\t\t\t);\n\n\t\t\t\t\tInstanceVertex[] newData = new InstanceVertex[bufferSize];\n\t\t\t\t\tif (this.instanceVertexData != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tArray.Copy(this.instanceVertexData, newData, Math.Min(bufferSize, this.instanceVertexData.Length));\n\t\t\t\t\t\tfor (int i = this.instanceVertexData.Length; i < this.Instances.Length; i++)\n\t\t\t\t\t\t\tnewData[i].LastTransform = this.Instances[i].Transform;\n\t\t\t\t\t}\n\t\t\t\t\tthis.instanceVertexData = newData;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tfor (int i = 0; i < this.Instances.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tthis.instanceVertexData[i].LastTransform = this.instanceVertexData[i].Transform;\n\t\t\t\t\tInstance instance = this.Instances[i];\n\t\t\t\t\tthis.instanceVertexData[i].Transform = instance.Transform;\n\t\t\t\t\tthis.instanceVertexData[i].Param = instance.Param;\n\t\t\t\t}\n\n\t\t\t\t// Transfer the latest instance transform matrices into the instanceVertexBuffer.\n\t\t\t\tthis.instanceVertexBuffer.SetData<InstanceVertex>(this.instanceVertexData, 0, this.Instances.Length, SetDataOptions.Discard);\n\n\t\t\t\tthis.lastInstancesChanged = this.instancesChanged;\n\t\t\t\tthis.instancesChanged = false;\n\t\t\t}\n\t\t\t\n#if !MONOGAME // TODO: enable hardware instancing for MonoGame\n\t\t\t// Set up the instance rendering effect.\n\t\t\tif (this.setParameters(transform, parameters))\n\t\t\t{\n\t\t\t\tthis.main.LightingManager.SetRenderParameters(this.effect, parameters);\n\n\t\t\t\tRasterizerState originalState = this.main.GraphicsDevice.RasterizerState;\n\t\t\t\tRasterizerState noCullState = null;\n\t\t\t\tif (recalculate && this.DisableCulling)\n\t\t\t\t{\n\t\t\t\t\tnoCullState = new RasterizerState { CullMode = CullMode.None };\n\t\t\t\t\tthis.main.GraphicsDevice.RasterizerState = noCullState;\n\t\t\t\t}\n\n\t\t\t\tfor (int i = 0; i < this.model.Meshes.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tModelMesh mesh = this.model.Meshes[i];\n\t\t\t\t\tfor (int j = 0; j < mesh.MeshParts.Count; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tModelMeshPart meshPart = mesh.MeshParts[j];\n\t\t\t\t\t\t// Tell the GPU to read from both the model vertex buffer plus our instanceVertexBuffer.\n\n\t\t\t\t\t\t// TODO: Monogame support for GraphicsDevice.SetVertexBuffers()\n\t\t\t\t\t\tthis.main.GraphicsDevice.SetVertexBuffers\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew VertexBufferBinding(meshPart.VertexBuffer, meshPart.VertexOffset, 0),\n\t\t\t\t\t\t\tnew VertexBufferBinding(instanceVertexBuffer, 0, 1)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.main.GraphicsDevice.Indices = meshPart.IndexBuffer;\n\n\t\t\t\t\t\t// Draw all the instance copies in a single call.\n\t\t\t\t\t\tthis.effect.CurrentTechnique.Passes[0].Apply();\n\t\t\t\t\t\t// TODO: Monogame support for GraphicsDevice.DrawInstancedPrimitives()\n\t\t\t\t\t\tthis.main.GraphicsDevice.DrawInstancedPrimitives\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tPrimitiveType.TriangleList,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\tmeshPart.NumVertices,\n\t\t\t\t\t\t\tmeshPart.StartIndex,\n\t\t\t\t\t\t\tmeshPart.PrimitiveCount,\n\t\t\t\t\t\t\tthis.Instances.Length\n\t\t\t\t\t\t);\n\t\t\t\t\t\tModel.DrawCallCounter++;\n\t\t\t\t\t\tModel.TriangleCounter += meshPart.PrimitiveCount * this.Instances.Length;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (noCullState != null)\n\t\t\t\t\tthis.main.GraphicsDevice.RasterizerState = originalState;\n\t\t\t}\n#endif\n\n\t\t\tif (parameters.IsMainRender)\n\t\t\t{\n\t\t\t\tthis.lastTransform = transform;\n\t\t\t\tthis.lastWorldViewProjection = transform * parameters.Camera.ViewProjection;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class ModelAlpha : Model, IDrawableAlphaComponent\n\t{\n\t\tpublic Property<float> Alpha = null;\n\t\tpublic Property<int> DrawOrder { get; set; }\n\t\tpublic Property<bool> Distortion = new Property<bool>();\n\n\t\tpublic ModelAlpha()\n\t\t{\n\t\t\tthis.Alpha = this.GetFloatParameter(\"Alpha\");\n\t\t\tthis.Alpha.Value = 1.0f;\n\t\t\tthis.DrawOrder = new Property<int>();\n\t\t}\n\n\t\tpublic override void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"Scale\", this.Scale);\n\t\t\tthis.Entity.Add(\"Color\", this.Color);\n\t\t\tthis.Entity.Add(\"Filename\", this.Filename, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.Content.RootDirectory, new[] { \"AlphaModels\", Path.Combine(MapLoader.MapDirectory, \"AlphaModels\") }),\n\t\t\t});\n\t\t\tthis.Entity.Add(\"Alpha\", this.Alpha);\n\t\t\tthis.Entity.Add(\"DrawOrder\", this.DrawOrder);\n\t\t\tthis.Entity.Add(\"Distortion\", this.Distortion);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tfloat alpha = this.Alpha;\n\t\t\tthis.Alpha = this.GetFloatParameter(\"Alpha\");\n\t\t\tthis.Alpha.Value = alpha;\n\t\t\tthis.Add(new NotifyBinding(this.main.AlphaDrawablesModified, this.DrawOrder));\n\t\t}\n\n\t\tpublic override void Draw(GameTime time, RenderParameters parameters)\n\t\t{\n\t\t\t\n\t\t}\n\n\t\tvoid IDrawableAlphaComponent.DrawAlpha(GameTime time, RenderParameters parameters)\n\t\t{\n\t\t\tif (this.Alpha > 0.0f)\n\t\t\t\tbase.Draw(time, parameters);\n\t\t}\n\n\t\tprotected override bool setParameters(Matrix transform, RenderParameters parameters)\n\t\t{\n\t\t\tbool result = base.setParameters(transform, parameters);\n\t\t\tif (result)\n\t\t\t{\n\t\t\t\tthis.effect.Parameters[\"Depth\" + Model.SamplerPostfix].SetValue(parameters.DepthBuffer);\n\t\t\t\tif (this.Distortion)\n\t\t\t\t\tthis.effect.Parameters[\"Frame\" + Model.SamplerPostfix].SetValue(parameters.FrameBuffer);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tpublic class ModelNonPostProcessed : Model, INonPostProcessedDrawableComponent\n\t{\n\t\tpublic Property<float> Alpha = null;\n\t\tpublic Property<int> DrawOrder { get; set; }\n\t\tpublic Property<bool> Distortion = new Property<bool>();\n\n\t\tpublic ModelNonPostProcessed()\n\t\t{\n\t\t\tthis.Alpha = this.GetFloatParameter(\"Alpha\");\n\t\t\tthis.Alpha.Value = 1.0f;\n\t\t\tthis.DrawOrder = new Property<int>();\n\t\t}\n\n\t\tpublic override void EditorProperties()\n\t\t{\n\t\t\tthis.Entity.Add(\"Scale\", this.Scale);\n\t\t\tthis.Entity.Add(\"Color\", this.Color);\n\t\t\tthis.Entity.Add(\"Filename\", this.Filename);\n\t\t\tthis.Entity.Add(\"Alpha\", this.Alpha);\n\t\t\tthis.Entity.Add(\"DrawOrder\", this.DrawOrder);\n\t\t\tthis.Entity.Add(\"Distortion\", this.Distortion);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tfloat alpha = this.Alpha;\n\t\t\tthis.Alpha = this.GetFloatParameter(\"Alpha\");\n\t\t\tthis.Alpha.Value = alpha;\n\t\t\tthis.Add(new NotifyBinding(this.main.NonPostProcessedDrawablesModified, this.DrawOrder));\n\t\t}\n\n\t\tpublic override void Draw(GameTime time, RenderParameters parameters)\n\t\t{\n\t\t\t\n\t\t}\n\n\t\tvoid INonPostProcessedDrawableComponent.DrawNonPostProcessed(GameTime time, RenderParameters parameters)\n\t\t{\n\t\t\tif (this.Alpha > 0.0f)\n\t\t\t\tbase.Draw(time, parameters);\n\t\t}\n\n\t\tprotected override bool setParameters(Matrix transform, RenderParameters parameters)\n\t\t{\n\t\t\tbool result = base.setParameters(transform, parameters);\n\t\t\tif (result)\n\t\t\t{\n\t\t\t\tif (this.Distortion)\n\t\t\t\t\tthis.effect.Parameters[\"Frame\" + Model.SamplerPostfix].SetValue(parameters.FrameBuffer);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Graphics/ModelInstance.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing Microsoft.Xna.Framework;\nusing System.Collections;\nusing System.Reflection;\n\nnamespace Lemma.Components\n{\n\tpublic class ModelInstance : Component<Main>\n\t{\n\t\tpublic class ModelInstanceSystem : Model\n\t\t{\n\t\t\tpublic string Key;\n\t\t\tprotected ListProperty<ModelInstance> instances = new ListProperty<ModelInstance>();\n\t\t\tprotected IListBinding<ModelInstance> instanceBinding;\n\n\t\t\tpublic override void Awake()\n\t\t\t{\n\t\t\t\tbase.Awake();\n\t\t\t\tthis.Serialize = false;\n\t\t\t\tthis.CullBoundingBox.Value = false;\n\t\t\t\tthis.IsInstanced.Value = true;\n\t\t\t\tthis.instanceBinding = new ListBinding<Model.Instance, ModelInstance>(this.Instances, this.instances, x => new Model.Instance { Param = x.Param, Transform = x.Transform });\n\t\t\t\tthis.Add(this.instanceBinding);\n\t\t\t}\n\n\t\t\tpublic void Add(ModelInstance instance)\n\t\t\t{\n\t\t\t\tthis.instances.Add(instance);\n\t\t\t}\n\n\t\t\tpublic void Remove(ModelInstance instance)\n\t\t\t{\n\t\t\t\tthis.instances.Remove(instance);\n\t\t\t}\n\n\t\t\tprotected override void drawInstances(RenderParameters parameters, Matrix transform)\n\t\t\t{\n\t\t\t\tif (parameters.IsMainRender)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < this.instances.Length; i++)\n\t\t\t\t\t\tthis.instances.Changed(i, this.instances[i]);\n\t\t\t\t}\n\t\t\t\tbase.drawInstances(parameters, transform);\n\t\t\t}\n\n\t\t\tpublic override void delete()\n\t\t\t{\n\t\t\t\tbase.delete();\n\t\t\t\tthis.instanceBinding = null;\n\t\t\t}\n\t\t}\n\n\t\tpublic class ModelInstanceSystemAlpha : ModelInstanceSystem, IDrawableAlphaComponent\n\t\t{\n\t\t\tpublic Property<float> Alpha = null;\n\t\t\tpublic Property<int> DrawOrder { get; set; }\n\n\t\t\tpublic ModelInstanceSystemAlpha()\n\t\t\t{\n\t\t\t\tthis.Alpha = this.GetFloatParameter(\"Alpha\");\n\t\t\t\tthis.Alpha.Value = 1.0f;\n\t\t\t\tthis.DrawOrder = new Property<int>();\n\t\t\t}\n\n\t\t\tpublic override void Awake()\n\t\t\t{\n\t\t\t\tbase.Awake();\n\t\t\t\tthis.Add(new NotifyBinding(this.main.AlphaDrawablesModified, this.DrawOrder));\n\t\t\t}\n\n\t\t\tpublic override void Draw(GameTime time, RenderParameters parameters)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tvoid IDrawableAlphaComponent.DrawAlpha(GameTime time, RenderParameters parameters)\n\t\t\t{\n\t\t\t\tif (this.Alpha > 0.0f)\n\t\t\t\t\tbase.Draw(time, parameters);\n\t\t\t}\n\n\t\t\tprotected override bool setParameters(Matrix transform, RenderParameters parameters)\n\t\t\t{\n\t\t\t\tbool result = base.setParameters(transform, parameters);\n\t\t\t\tif (result)\n\t\t\t\t\tthis.effect.Parameters[\"DepthBuffer\"].SetValue(parameters.DepthBuffer);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\tprotected ModelInstanceSystem model;\n\n\t\tpublic Property<string> Filename = new Property<string>();\n\t\t\n\t\tpublic Property<Matrix> Transform = new Property<Matrix> { Value = Matrix.Identity };\n\n\t\tpublic Property<bool> EnableAlpha = new Property<bool> { Value = false };\n\n\t\tpublic Property<int> InstanceKey = new Property<int>();\n\n\t\tpublic Property<Vector3> Param = new Property<Vector3>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<string> FullInstanceKey = new Property<string>();\n\n\t\t[XmlIgnore]\n\t\tpublic bool IsFirstInstance;\n\n\t\t[XmlIgnore]\n\t\tpublic Model Model\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.model;\n\t\t\t}\n\t\t}\n\n\t\tprotected void refreshModel()\n\t\t{\n\t\t\tif (!string.IsNullOrEmpty(this.Filename))\n\t\t\t{\n\t\t\t\tstring key = string.Format(\"_{0}:{1}+{2}\", (this.EnableAlpha ? \"Alpha\" : \"\"), this.Filename.Value, this.InstanceKey.Value);\n\n\t\t\t\tEntity world = Lemma.Factories.WorldFactory.Instance;\n\t\t\t\t\n\t\t\t\tModelInstanceSystem newModel = this.EnableAlpha ? world.Get<ModelInstanceSystemAlpha>(key) : world.Get<ModelInstanceSystem>(key);\n\n\t\t\t\tbool foundExistingModel = newModel != null;\n\n\t\t\t\tif (!foundExistingModel)\n\t\t\t\t{\n\t\t\t\t\tnewModel = this.EnableAlpha ? new ModelInstanceSystemAlpha() : new ModelInstanceSystem();\n\t\t\t\t\tnewModel.MapContent = true;\n\t\t\t\t\tnewModel.Filename.Value = this.Filename;\n\t\t\t\t\tnewModel.Key = key;\n\t\t\t\t\tworld.Add(key, newModel);\n\t\t\t\t}\n\n\t\t\t\tif (newModel != this.model)\n\t\t\t\t{\n\t\t\t\t\tthis.IsFirstInstance = !foundExistingModel;\n\t\t\t\t\tnewModel.Add(this);\n\t\t\t\t\tif (this.model != null)\n\t\t\t\t\t\tthis.model.Remove(this);\n\t\t\t\t\tthis.model = newModel;\n\t\t\t\t}\n\n\t\t\t\tthis.FullInstanceKey.Value = key;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Setup(string filename, int instanceKey, bool alpha = false)\n\t\t{\n\t\t\tbool refresh = this.Filename.Value != filename;\n\t\t\trefresh |= this.InstanceKey.Value != instanceKey;\n\t\t\tif (refresh)\n\t\t\t{\n\t\t\t\tthis.Filename.SetStealthy(filename);\n\t\t\t\tthis.InstanceKey.SetStealthy(instanceKey);\n\t\t\t\tthis.EnableAlpha.SetStealthy(alpha);\n\t\t\t\tthis.refreshModel();\n\t\t\t\tthis.Filename.Changed();\n\t\t\t\tthis.InstanceKey.Changed();\n\t\t\t\tthis.EnableAlpha.Changed();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.Add(new SetBinding<string>(this.Filename, delegate(string value)\n\t\t\t{\n\t\t\t\tthis.refreshModel();\n\t\t\t}));\n\t\t\tthis.Add(new SetBinding<int>(this.InstanceKey, delegate(int value)\n\t\t\t{\n\t\t\t\tthis.refreshModel();\n\t\t\t}));\n\t\t\tthis.Add(new SetBinding<bool>(this.EnableAlpha, delegate(bool value)\n\t\t\t{\n\t\t\t\tthis.refreshModel();\n\t\t\t}));\n\t\t}\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tif (this.model != null)\n\t\t\t{\n\t\t\t\tthis.model.Remove(this);\n\t\t\t\tthis.model = null;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Graphics/ParticleEmitter.cs",
    "content": "#region File Description\n//-----------------------------------------------------------------------------\n// ParticleEmitter.cs\n//\n// Microsoft XNA Community Game Platform\n// Copyright (C) Microsoft Corporation. All rights reserved.\n//-----------------------------------------------------------------------------\n#endregion\n\n#region Using Statements\nusing System; using ComponentBind;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\nusing System.Collections.Generic;\n#endregion\n\nnamespace Lemma.Components\n{\n\tpublic class ParticleEmitter : Component<Main>, IUpdateableComponent\n\t{\n\t\tprotected float timeBetweenParticles = 0.1f;\n\n\t\tprivate ParticleSystem particleSystem;\n\t\tpublic ParticleSystem ParticleSystem\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.particleSystem;\n\t\t\t}\n\t\t}\n\t\tpublic Property<string> ParticleType = new Property<string>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<Vector3> VelocityOffset = new Property<Vector3>();\n\t\t[XmlIgnore]\n\t\tpublic bool CalculateVelocity = true;\n\t\tpublic Property<Vector3> Jitter = new Property<Vector3>();\n\t\tprotected bool lastPositionSet = false;\n\t\tprotected Vector3 lastPosition;\n\t\tpublic Property<int> ParticlesPerSecond = new Property<int> { Value = 10 };\n\t\t[XmlIgnore]\n\t\tpublic Action<Vector3, Vector3, float> AddParticle;\n\n\t\tprivate static Random random = new Random();\n\n\t\tpublic ParticleEmitter()\n\t\t{\n\t\t\tthis.AddParticle = delegate(Vector3 position, Vector3 velocity, float prime)\n\t\t\t{\n\t\t\t\tthis.particleSystem.AddParticle(position, velocity, -1.0f, -1.0f, prime);\n\t\t\t};\n\t\t}\n\n\t\tprivate static ListProperty<string> particleTypes;\n\t\tpublic void EditorProperties()\n\t\t{\n\t\t\tif (this.main.EditorEnabled && ParticleEmitter.particleTypes == null)\n\t\t\t{\n\t\t\t\tParticleEmitter.particleTypes = new ListProperty<string>();\n\t\t\t\tParticleEmitter.particleTypes.AddAll(ParticleSystem.Types);\n\t\t\t}\n\t\t\tthis.Entity.Add(\"ParticleType\", this.ParticleType, new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = ParticleEmitter.particleTypes,\n\t\t\t});\n\t\t\tthis.Entity.Add(\"Jitter\", this.Jitter);\n\t\t\tthis.Entity.Add(\"ParticlesPerSecond\", this.ParticlesPerSecond);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\n\t\t\tthis.Add(new SetBinding<int>(this.ParticlesPerSecond, delegate(int value)\n\t\t\t{\n\t\t\t\tthis.timeBetweenParticles = value == 0 ? 0.0f : 1.0f / value;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<string>(this.ParticleType, delegate(string value)\n\t\t\t{\n\t\t\t\tthis.particleSystem = value == null ? null : ParticleSystem.Get(this.main, value);\n\t\t\t}));\n\t\t}\n\n\t\tpublic static void Emit(Main main, string type, Vector3 position, float jitter, int amount)\n\t\t{\n\t\t\tParticleSystem particleSystem = ParticleSystem.Get(main, type);\n\t\t\tfor (int i = 0; i < amount; i++)\n\t\t\t\tparticleSystem.AddParticle(position + new Vector3(2.0f * ((float)random.NextDouble() - 0.5f) * jitter, 2.0f * ((float)random.NextDouble() - 0.5f) * jitter, 2.0f * ((float)random.NextDouble() - 0.5f) * jitter), Vector3.Zero);\n\t\t}\n\n\t\tpublic static void Emit(Main main, string type, IEnumerable<Vector3> positions)\n\t\t{\n\t\t\tParticleSystem particleSystem = ParticleSystem.Get(main, type);\n\t\t\tforeach (Vector3 pos in positions)\n\t\t\t\tparticleSystem.AddParticle(pos, Vector3.Zero);\n\t\t}\n\n\t\tpublic void Prime(Vector3 velocity)\n\t\t{\n\t\t\tthis.ParticleSystem.Prime();\n\t\t\tfloat duration = (float)this.particleSystem.Settings.Value.Duration.TotalSeconds;\n\t\t\tint particles = Math.Min((int)(this.ParticlesPerSecond * duration), this.particleSystem.Settings.Value.MaxParticles);\n\t\t\tfloat interval = duration / particles;\n\t\t\tVector3 jitter = this.Jitter;\n\t\t\tfloat prime = duration;\n\t\t\tfor (int i = 0; i < particles; i++)\n\t\t\t{\n\t\t\t\tVector3 position = this.Position + new Vector3(2.0f * ((float)random.NextDouble() - 0.5f) * jitter.X, 2.0f * ((float)random.NextDouble() - 0.5f) * jitter.Y, 2.0f * ((float)random.NextDouble() - 0.5f) * jitter.Z);\n\n\t\t\t\t// Create the particle.\n\t\t\t\tthis.AddParticle(position, velocity, prime);\n\t\t\t\tprime -= interval;\n\t\t\t}\n\t\t}\n\n\t\tprotected float timeLeftOver;\n\n\t\t/// <summary>\n\t\t/// Updates the emitter, creating the appropriate number of particles\n\t\t/// in the appropriate positions.\n\t\t/// </summary>\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (dt == 0 || this.particleSystem == null || this.timeBetweenParticles == 0)\n\t\t\t\treturn;\n\n\t\t\t// Set the initial \"last position\" so we don't add particles between (0, 0, 0) and our initial location\n\t\t\tif (!this.lastPositionSet)\n\t\t\t{\n\t\t\t\tthis.lastPositionSet = true;\n\t\t\t\tthis.lastPosition = this.Position;\n\t\t\t}\n\n\t\t\t// Work out how fast we are moving.\n\t\t\tVector3 velocity = this.CalculateVelocity ? this.VelocityOffset + (this.Position.Value - this.lastPosition) / dt : this.VelocityOffset;\n\n\t\t\t// If we had any time left over that we didn't use during the\n\t\t\t// previous update, add that to the current elapsed time.\n\t\t\tfloat timeToSpend = this.timeLeftOver + dt;\n\t\t\t\t\n\t\t\t// Counter for looping over the time interval.\n\t\t\tfloat currentTime = -this.timeLeftOver;\n\n\t\t\tVector3 jitter = this.Jitter;\n\n\t\t\t// Create particles as long as we have a big enough time interval.\n\t\t\twhile (timeToSpend > this.timeBetweenParticles)\n\t\t\t{\n\t\t\t\tcurrentTime += this.timeBetweenParticles;\n\t\t\t\ttimeToSpend -= this.timeBetweenParticles;\n\n\t\t\t\t// Work out the optimal position for this particle. This will produce\n\t\t\t\t// evenly spaced particles regardless of the object speed, particle\n\t\t\t\t// creation frequency, or game update rate.\n\t\t\t\tfloat mu = currentTime / dt;\n\n\t\t\t\tVector3 position = Vector3.Lerp(this.lastPosition, this.Position, mu);\n\t\t\t\tposition += new Vector3(2.0f * ((float)random.NextDouble() - 0.5f) * jitter.X, 2.0f * ((float)random.NextDouble() - 0.5f) * jitter.Y, 2.0f * ((float)random.NextDouble() - 0.5f) * jitter.Z);\n\n\t\t\t\t// Create the particle.\n\t\t\t\tthis.AddParticle(position, velocity, 0);\n\t\t\t}\n\n\t\t\t// Store any time we didn't use, so it can be part of the next update.\n\t\t\tthis.timeLeftOver = timeToSpend;\n\t\t\tthis.lastPosition = this.Position;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Graphics/ParticleSystem.cs",
    "content": "using System; using ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Content;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Graphics.PackedVector;\nusing System.Collections.Generic;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\t/// <summary>\n\t/// The main component in charge of displaying particles.\n\t/// </summary>\n\tpublic class ParticleSystem : Component<Main>, IUpdateableComponent, IDrawablePostAlphaComponent, IDrawableAlphaComponent, IDrawableComponent\n\t{\n\t\t[XmlIgnore]\n\t\tpublic Property<string> OrderKey { get; private set; }\n\n\t\t[XmlIgnore]\n\t\tpublic Property<int> DrawOrder { get; private set; }\n\n\t\tpublic bool IsVisible(BoundingFrustum frustum)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic float GetDistance(Vector3 camera)\n\t\t{\n\t\t\treturn 0.0f;\n\t\t}\n\n\t\t#region ParticleVertex\n\t\t/// <summary>\n\t\t/// Custom vertex structure for drawing particles.\n\t\t/// </summary>\n\t\tprotected struct ParticleVertex\n\t\t{\n\t\t\t// Stores which corner of the particle quad this vertex represents.\n\t\t\tpublic Short2 Corner;\n\n\t\t\t// Stores the starting position of the particle.\n\t\t\tpublic Vector3 Position;\n\n\t\t\t// Stores the starting velocity of the particle.\n\t\t\tpublic Vector3 Velocity;\n\n\t\t\t// Four random values, used to make each particle look slightly different.\n\t\t\tpublic Color Random;\n\n\t\t\t// The time (in seconds) at which this particle was created.\n\t\t\tpublic float Time;\n\n\t\t\t// Lifetime (in seconds) of this particle.\n\t\t\tpublic float Lifetime;\n\n\t\t\tpublic float StartSize;\n\n\t\t\t// Describe the layout of this vertex structure.\n\t\t\tpublic static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration\n\t\t\t(\n\t\t\t\tnew VertexElement(0, VertexElementFormat.Short2, VertexElementUsage.Position, 0),\n\t\t\t\tnew VertexElement(4, VertexElementFormat.Vector3, VertexElementUsage.Position, 1),\n\t\t\t\tnew VertexElement(16, VertexElementFormat.Vector3, VertexElementUsage.Normal, 0),\n\t\t\t\tnew VertexElement(28, VertexElementFormat.Color, VertexElementUsage.Color, 0),\n\t\t\t\tnew VertexElement(32, VertexElementFormat.Single, VertexElementUsage.TextureCoordinate, 0),\n\t\t\t\tnew VertexElement(36, VertexElementFormat.Single, VertexElementUsage.TextureCoordinate, 1),\n\t\t\t\tnew VertexElement(40, VertexElementFormat.Single, VertexElementUsage.TextureCoordinate, 2)\n\t\t\t);\n\n\n\t\t\t// Describe the size of this vertex structure.\n\t\t\tpublic const int SizeInBytes = 44;\n\t\t}\n\t\t#endregion\n\n\t\t#region ParticleSettings\n\t\t/// <summary>\n\t\t/// Settings class describes all the tweakable options used\n\t\t/// to control the appearance of a particle system.\n\t\t/// </summary>\n\t\tpublic class ParticleSettings\n\t\t{\n\t\t\t// Name of the texture used by this particle system.\n\t\t\tpublic string TextureName = null;\n\n\t\t\tpublic string EffectFile = \"Effects\\\\Particle\";\n\n\t\t\tpublic int DrawOrder = 11; // In front of water and fog\n\n\t\t\t// Maximum number of particles that can be displayed at one time.\n\t\t\tpublic int MaxParticles = 100;\n\n\t\t\tpublic bool PostAlpha = false;\n\n\n\t\t\t// How long these particles will last.\n\t\t\tpublic TimeSpan Duration = TimeSpan.FromSeconds(1);\n\n\n\t\t\t// If greater than zero, some particles will last a shorter time than others.\n\t\t\tpublic float DurationRandomness = 0;\n\n\n\t\t\t// Controls how much particles are influenced by the velocity of the object\n\t\t\t// which created them. You can see this in action with the explosion effect,\n\t\t\t// where the flames continue to move in the same direction as the source\n\t\t\t// projectile. The projectile trail particles, on the other hand, set this\n\t\t\t// value very low so they are less affected by the velocity of the projectile.\n\t\t\tpublic float EmitterVelocitySensitivity = 0.5f;\n\n\n\t\t\t// Range of values controlling how much X and Z axis velocity to give each\n\t\t\t// particle. Values for individual particles are randomly chosen from somewhere\n\t\t\t// between these limits.\n\t\t\tpublic float MinHorizontalVelocity = 0;\n\t\t\tpublic float MaxHorizontalVelocity = 0;\n\n\t\t\tpublic Model.Material Material;\n\n\t\t\t// Range of values controlling how much Y axis velocity to give each particle.\n\t\t\t// Values for individual particles are randomly chosen from somewhere between\n\t\t\t// these limits.\n\t\t\tpublic float MinVerticalVelocity = 0;\n\t\t\tpublic float MaxVerticalVelocity = 0;\n\n\n\t\t\t// Direction and strength of the gravity effect. Note that this can point in any\n\t\t\t// direction, not just down! The fire effect points it upward to make the flames\n\t\t\t// rise, and the smoke plume points it sideways to simulate wind.\n\t\t\tpublic Vector3 Gravity = Vector3.Zero;\n\n\n\t\t\t// Controls how the particle velocity will change over their lifetime. If set\n\t\t\t// to 1, particles will keep going at the same speed as when they were created.\n\t\t\t// If set to 0, particles will come to a complete stop right before they die.\n\t\t\t// Values greater than 1 make the particles speed up over time.\n\t\t\tpublic float EndVelocity = 1;\n\n\n\t\t\t// Range of values controlling the particle color and alpha. Values for\n\t\t\t// individual particles are randomly chosen from somewhere between these limits.\n\t\t\tpublic Vector4 MinColor = Vector4.One;\n\t\t\tpublic Vector4 MaxColor = Vector4.One;\n\n\n\t\t\t// Range of values controlling how fast the particles rotate. Values for\n\t\t\t// individual particles are randomly chosen from somewhere between these\n\t\t\t// limits. If both these values are set to 0, the particle system will\n\t\t\t// automatically switch to an alternative shader technique that does not\n\t\t\t// support rotation, and thus requires significantly less GPU power. This\n\t\t\t// means if you don't need the rotation effect, you may get a performance\n\t\t\t// boost from leaving these values at 0.\n\t\t\tpublic float MinRotateSpeed = 0;\n\t\t\tpublic float MaxRotateSpeed = 0;\n\n\n\t\t\t// Range of values controlling how big the particles are when first created.\n\t\t\t// Values for individual particles are randomly chosen from somewhere between\n\t\t\t// these limits.\n\t\t\tpublic float MinStartSize = 100;\n\t\t\tpublic float MaxStartSize = 100;\n\n\n\t\t\t// Range of values controlling how big particles become at the end of their\n\t\t\t// life. Values for individual particles are randomly chosen from somewhere\n\t\t\t// between these limits.\n\t\t\tpublic float MinEndSize = 100;\n\t\t\tpublic float MaxEndSize = 100;\n\n\n\t\t\t// Alpha blending settings.\n\t\t\tpublic BlendState BlendState = BlendState.NonPremultiplied;\n\n\t\t\tpublic List<Technique> UnsupportedTechniques = new List<Technique>();\n\t\t}\n\t\t#endregion\n\n\t\tpublic static ParticleSystem Add(Main main, string type, ParticleSystem.ParticleSettings settings)\n\t\t{\n\t\t\tif (ParticleSystem.systems == null)\n\t\t\t{\n\t\t\t\tParticleSystem.initialize(main);\n\t\t\t}\n\n\t\t\treturn ParticleSystem.add(main, type, settings);\n\t\t}\n\n\t\tprotected static ParticleSystem add(Main main, string type, ParticleSystem.ParticleSettings settings)\n\t\t{\n\t\t\tParticleSystem system = new ParticleSystem();\n\t\t\tsystem.Type.Value = type;\n\t\t\tsystem.Settings.Value = settings;\n\n\t\t\tParticleSystem.systems.Add(system.Type, system);\n\n\t\t\tmain.AddComponent(system);\n\t\t\treturn system;\n\t\t}\n\n\t\tpublic static void Reset()\n\t\t{\n\t\t\tif (ParticleSystem.systems != null)\n\t\t\t{\n\t\t\t\tforeach (ParticleSystem p in ParticleSystem.systems.Values)\n\t\t\t\t{\n\t\t\t\t\tp.firstActiveParticle = 0;\n\t\t\t\t\tp.firstFreeParticle = 0;\n\t\t\t\t\tp.firstNewParticle = 0;\n\t\t\t\t\tp.firstRetiredParticle = 0;\n\t\t\t\t\tp.currentTime = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<string> Types\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn ParticleSystem.systems.Keys;\n\t\t\t}\n\t\t}\n\n\t\tprivate static void initialize(Main main)\n\t\t{\n\t\t\tParticleSystem.systems = new Dictionary<string, ParticleSystem>();\n\t\t\tParticleSystem.add(main, \"Splash\",\n\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t{\n\t\t\t\tTextureName = \"Particles\\\\splash\",\n\t\t\t\tMaxParticles = 1000,\n\t\t\t\tDuration = TimeSpan.FromSeconds(1.0f),\n\t\t\t\tMinHorizontalVelocity = -4.0f,\n\t\t\t\tMaxHorizontalVelocity = 4.0f,\n\t\t\t\tMinVerticalVelocity = 0.0f,\n\t\t\t\tMaxVerticalVelocity = 5.0f,\n\t\t\t\tGravity = new Vector3(0.0f, -10.0f, 0.0f),\n\t\t\t\tMinRotateSpeed = -2.0f,\n\t\t\t\tMaxRotateSpeed = 2.0f,\n\t\t\t\tMinStartSize = 0.1f,\n\t\t\t\tMaxStartSize = 0.3f,\n\t\t\t\tMinEndSize = 0.0f,\n\t\t\t\tMaxEndSize = 0.0f,\n\t\t\t\tBlendState = BlendState.AlphaBlend,\n\t\t\t\tMinColor = new Vector4(0.7f, 0.75f, 0.8f, 1.0f),\n\t\t\t\tMaxColor = new Vector4(0.7f, 0.75f, 0.8f, 1.0f),\n\t\t\t});\n\n\t\t\tParticleSystem.add(main, \"BigSplash\",\n\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t{\n\t\t\t\tTextureName = \"Particles\\\\big-splash\",\n\t\t\t\tMaxParticles = 1000,\n\t\t\t\tDuration = TimeSpan.FromSeconds(0.5f),\n\t\t\t\tMinHorizontalVelocity = -4.0f,\n\t\t\t\tMaxHorizontalVelocity = 4.0f,\n\t\t\t\tMinVerticalVelocity = 0.0f,\n\t\t\t\tMaxVerticalVelocity = 2.0f,\n\t\t\t\tGravity = new Vector3(0.0f, 0.0f, 0.0f),\n\t\t\t\tMinRotateSpeed = -1.0f,\n\t\t\t\tMaxRotateSpeed = 1.0f,\n\t\t\t\tMinStartSize = 0.5f,\n\t\t\t\tMaxStartSize = 1.0f,\n\t\t\t\tMinEndSize = 1.0f,\n\t\t\t\tMaxEndSize = 2.0f,\n\t\t\t\tBlendState = BlendState.AlphaBlend,\n\t\t\t\tMinColor = new Vector4(0.7f, 0.75f, 0.8f, 0.5f),\n\t\t\t\tMaxColor = new Vector4(0.7f, 0.75f, 0.8f, 0.5f),\n\t\t\t});\n\n#if DEVELOPMENT\n\t\t\tParticleSystem.add(main, \"Debug\",\n\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t{\n\t\t\t\tTextureName = \"Particles\\\\debug\",\n\t\t\t\tMaxParticles = 10000,\n\t\t\t\tDuration = TimeSpan.FromSeconds(1.0f),\n\t\t\t\tEmitterVelocitySensitivity = 0.0f,\n\t\t\t\tMinHorizontalVelocity = 0.0f,\n\t\t\t\tMaxHorizontalVelocity = 0.0f,\n\t\t\t\tMinVerticalVelocity = 0.0f,\n\t\t\t\tMaxVerticalVelocity = 0.0f,\n\t\t\t\tGravity = Vector3.Zero,\n\t\t\t\tMinRotateSpeed = 0.0f,\n\t\t\t\tMaxRotateSpeed = 0.0f,\n\t\t\t\tMinStartSize = 0.5f,\n\t\t\t\tMaxStartSize = 0.5f,\n\t\t\t\tMinEndSize = 0.5f,\n\t\t\t\tMaxEndSize = 0.5f,\n\t\t\t\tBlendState = BlendState.AlphaBlend,\n\t\t\t\tMinColor = Vector4.One,\n\t\t\t\tMaxColor = Vector4.One,\n\t\t\t});\n#endif\n\n\t\t\tParticleSystem.add(main, \"Distortion\",\n\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t{\n\t\t\t\tTextureName = \"Particles\\\\distortion\",\n\t\t\t\tEffectFile = \"Effects\\\\ParticleFrameBufferDistortion\",\n\t\t\t\tMaxParticles = 1000,\n\t\t\t\tDrawOrder = 11,\n\t\t\t\tDuration = TimeSpan.FromSeconds(5.0f),\n\t\t\t\tMinHorizontalVelocity = -0.5f,\n\t\t\t\tMaxHorizontalVelocity = 0.5f,\n\t\t\t\tMinVerticalVelocity = -0.5f,\n\t\t\t\tMaxVerticalVelocity = 0.5f,\n\t\t\t\tGravity = new Vector3(0.0f, 0.0f, 0.0f),\n\t\t\t\tMinRotateSpeed = 0.0f,\n\t\t\t\tMaxRotateSpeed = 0.0f,\n\t\t\t\tMinStartSize = 0.5f,\n\t\t\t\tMaxStartSize = 1.0f,\n\t\t\t\tMinEndSize = 2.0f,\n\t\t\t\tMaxEndSize = 4.0f,\n\t\t\t\tBlendState = BlendState.AlphaBlend,\n\t\t\t\tMinColor = new Vector4(1.2f, 1.4f, 1.6f, 1.0f),\n\t\t\t\tMaxColor = new Vector4(1.2f, 1.4f, 1.6f, 1.0f),\n\t\t\t\tPostAlpha = true,\n\t\t\t\tEmitterVelocitySensitivity = 0.1f,\n\t\t\t});\n\n\t\t\tParticleSystem.add(main, \"Rift\",\n\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t{\n\t\t\t\tTextureName = \"Particles\\\\rift\",\n\t\t\t\tEffectFile = \"Effects\\\\ParticleFrameBufferDistortion\",\n\t\t\t\tMaxParticles = 1000,\n\t\t\t\tDrawOrder = 11,\n\t\t\t\tDuration = TimeSpan.FromSeconds(0.6f),\n\t\t\t\tMinHorizontalVelocity = 0.0f,\n\t\t\t\tMaxHorizontalVelocity = 0.0f,\n\t\t\t\tMinVerticalVelocity = 0.0f,\n\t\t\t\tMaxVerticalVelocity = 0.0f,\n\t\t\t\tGravity = new Vector3(0.0f, 0.0f, 0.0f),\n\t\t\t\tMinRotateSpeed = 0.0f,\n\t\t\t\tMaxRotateSpeed = 0.0f,\n\t\t\t\tMinStartSize = 8.0f,\n\t\t\t\tMaxStartSize = 8.0f,\n\t\t\t\tMinEndSize = 0.0f,\n\t\t\t\tMaxEndSize = 0.0f,\n\t\t\t\tBlendState = BlendState.AlphaBlend,\n\t\t\t\tMinColor = new Vector4(1.2f, 1.4f, 1.6f, 1.0f),\n\t\t\t\tMaxColor = new Vector4(1.2f, 1.4f, 1.6f, 1.0f),\n\t\t\t\tPostAlpha = true,\n\t\t\t\tEmitterVelocitySensitivity = 0.0f,\n\t\t\t});\n\n\t\t\tParticleSystem.Add(main, \"Purple\",\n\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t{\n\t\t\t\tTextureName = \"Particles\\\\spark\",\n\t\t\t\tMaxParticles = 1000,\n\t\t\t\tDuration = TimeSpan.FromSeconds(10.0f),\n\t\t\t\tMinHorizontalVelocity = -0.2f,\n\t\t\t\tMaxHorizontalVelocity = 0.2f,\n\t\t\t\tMinVerticalVelocity = -0.2f,\n\t\t\t\tMaxVerticalVelocity = 0.2f,\n\t\t\t\tGravity = new Vector3(0.0f, 0.0f, 0.0f),\n\t\t\t\tMinRotateSpeed = -4.0f,\n\t\t\t\tMaxRotateSpeed = 4.0f,\n\t\t\t\tMinStartSize = 0.05f,\n\t\t\t\tMaxStartSize = 0.1f,\n\t\t\t\tMinEndSize = 0.05f,\n\t\t\t\tMaxEndSize = 0.1f,\n\t\t\t\tBlendState = Microsoft.Xna.Framework.Graphics.BlendState.Additive,\n\t\t\t\tMinColor = new Vector4(0.8f, 0.3f, 1.5f, 1.0f),\n\t\t\t\tMaxColor = new Vector4(1.0f, 0.5f, 2.0f, 1.0f),\n\t\t\t\tEmitterVelocitySensitivity = 0.1f,\n\t\t\t});\n\n\t\t\tParticleSystem.add(main, \"DistortionSmall\",\n\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t{\n\t\t\t\tTextureName = \"Particles\\\\distortion\",\n\t\t\t\tEffectFile = \"Effects\\\\ParticleFrameBufferDistortion\",\n\t\t\t\tMaxParticles = 1000,\n\t\t\t\tDrawOrder = 11,\n\t\t\t\tDuration = TimeSpan.FromSeconds(1.0f),\n\t\t\t\tMinHorizontalVelocity = -0.15f,\n\t\t\t\tMaxHorizontalVelocity = 0.15f,\n\t\t\t\tMinVerticalVelocity = -0.15f,\n\t\t\t\tMaxVerticalVelocity = 0.15f,\n\t\t\t\tGravity = new Vector3(0.0f, 0.0f, 0.0f),\n\t\t\t\tMinRotateSpeed = 0.0f,\n\t\t\t\tMaxRotateSpeed = 0.0f,\n\t\t\t\tMinStartSize = 0.1f,\n\t\t\t\tMaxStartSize = 0.25f,\n\t\t\t\tMinEndSize = 0.3f,\n\t\t\t\tMaxEndSize = 0.4f,\n\t\t\t\tBlendState = BlendState.AlphaBlend,\n\t\t\t\tMinColor = new Vector4(1.2f, 1.4f, 1.6f, 1.0f),\n\t\t\t\tMaxColor = new Vector4(1.2f, 1.4f, 1.6f, 1.0f),\n\t\t\t\tPostAlpha = true,\n\t\t\t\tEmitterVelocitySensitivity = 0.1f,\n\t\t\t});\n\n\t\t\tParticleSystem.add(main, \"Smoke\",\n\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t{\n\t\t\t\tTextureName = \"Particles\\\\smoke\",\n\t\t\t\tMaxParticles = 1000,\n\t\t\t\tDuration = TimeSpan.FromSeconds(3.0f),\n\t\t\t\tMinHorizontalVelocity = -1.0f,\n\t\t\t\tMaxHorizontalVelocity = 1.0f,\n\t\t\t\tMinVerticalVelocity = 1.0f,\n\t\t\t\tMaxVerticalVelocity = 3.0f,\n\t\t\t\tGravity = new Vector3(0.0f, -2.0f, 0.0f),\n\t\t\t\tMinRotateSpeed = 0.0f,\n\t\t\t\tMaxRotateSpeed = 0.0f,\n\t\t\t\tMinStartSize = 0.5f,\n\t\t\t\tMaxStartSize = 1.0f,\n\t\t\t\tMinEndSize = 2.0f,\n\t\t\t\tMaxEndSize = 4.0f,\n\t\t\t\tBlendState = Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend,\n\t\t\t\tMinColor = new Vector4(1.0f, 1.0f, 1.0f, 0.8f),\n\t\t\t\tMaxColor = new Vector4(1.0f, 1.0f, 1.0f, 0.8f),\n\t\t\t\tEffectFile = \"Effects\\\\ParticleVolume\",\n\t\t\t\tEmitterVelocitySensitivity = 0.2f,\n\t\t\t});\n\n\t\t\tParticleSystem.add(main, \"InfectedShatter\",\n\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t{\n\t\t\t\tTextureName = \"Particles\\\\spark\",\n\t\t\t\tMaxParticles = 1000,\n\t\t\t\tDuration = TimeSpan.FromSeconds(1.0f),\n\t\t\t\tMinHorizontalVelocity = -4.0f,\n\t\t\t\tMaxHorizontalVelocity = 4.0f,\n\t\t\t\tMinVerticalVelocity = 0.0f,\n\t\t\t\tMaxVerticalVelocity = 5.0f,\n\t\t\t\tGravity = new Vector3(0.0f, -8.0f, 0.0f),\n\t\t\t\tMinRotateSpeed = -2.0f,\n\t\t\t\tMaxRotateSpeed = 2.0f,\n\t\t\t\tMinStartSize = 0.1f,\n\t\t\t\tMaxStartSize = 0.3f,\n\t\t\t\tMinEndSize = 0.0f,\n\t\t\t\tMaxEndSize = 0.0f,\n\t\t\t\tBlendState = Microsoft.Xna.Framework.Graphics.BlendState.Additive,\n\t\t\t\tMinColor = new Vector4(2.0f, 0.75f, 0.75f, 1.0f),\n\t\t\t\tMaxColor = new Vector4(2.0f, 0.75f, 0.75f, 1.0f),\n\t\t\t});\n\n\t\t\tParticleSystem.add(main, \"WhiteShatter\",\n\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t{\n\t\t\t\tTextureName = \"Particles\\\\spark\",\n\t\t\t\tMaxParticles = 1000,\n\t\t\t\tDuration = TimeSpan.FromSeconds(1.0f),\n\t\t\t\tMinHorizontalVelocity = -4.0f,\n\t\t\t\tMaxHorizontalVelocity = 4.0f,\n\t\t\t\tMinVerticalVelocity = 0.0f,\n\t\t\t\tMaxVerticalVelocity = 5.0f,\n\t\t\t\tGravity = new Vector3(0.0f, -8.0f, 0.0f),\n\t\t\t\tMinRotateSpeed = -2.0f,\n\t\t\t\tMaxRotateSpeed = 2.0f,\n\t\t\t\tMinStartSize = 0.1f,\n\t\t\t\tMaxStartSize = 0.3f,\n\t\t\t\tMinEndSize = 0.0f,\n\t\t\t\tMaxEndSize = 0.0f,\n\t\t\t\tBlendState = Microsoft.Xna.Framework.Graphics.BlendState.Additive,\n\t\t\t\tMinColor = new Vector4(1.5f, 1.25f, 1.0f, 1.0f),\n\t\t\t\tMaxColor = new Vector4(1.5f, 1.25f, 1.0f, 1.0f),\n\t\t\t});\n\n\t\t\tParticleSystem.add(main, \"Electricity\",\n\t\t\tnew ParticleSystem.ParticleSettings\n\t\t\t{\n\t\t\t\tTextureName = \"Particles\\\\spark\",\n\t\t\t\tMaxParticles = 2000,\n\t\t\t\tDuration = TimeSpan.FromSeconds(0.3f),\n\t\t\t\tMinHorizontalVelocity = -1.0f,\n\t\t\t\tMaxHorizontalVelocity = 1.0f,\n\t\t\t\tMinVerticalVelocity = 0.0f,\n\t\t\t\tMaxVerticalVelocity = 1.5f,\n\t\t\t\tGravity = new Vector3(0.0f, -1.2f, 0.0f),\n\t\t\t\tMinRotateSpeed = -10.0f,\n\t\t\t\tMaxRotateSpeed = 10.0f,\n\t\t\t\tMinStartSize = 0.05f,\n\t\t\t\tMaxStartSize = 0.1f,\n\t\t\t\tMinEndSize = 0.0f,\n\t\t\t\tMaxEndSize = 0.0f,\n\t\t\t\tBlendState = Microsoft.Xna.Framework.Graphics.BlendState.Additive,\n\t\t\t\tMinColor = new Vector4(1.0f, 1.25f, 1.5f, 1.0f),\n\t\t\t\tMaxColor = new Vector4(1.0f, 1.25f, 1.5f, 1.0f),\n\t\t\t});\n\t\t}\n\n\t\tprivate static Dictionary<string, ParticleSystem> systems = null;\n\n\t\tpublic Property<string> Type = new Property<string>();\n\n\t\t// Settings class controls the appearance and animation of this particle system.\n\t\tpublic Property<ParticleSettings> Settings = new Property<ParticleSettings>();\n\t\tprivate ParticleSettings settings;\n\n\t\t// Custom effect for drawing particles. This computes the particle\n\t\t// animation entirely in the vertex shader: no per-particle CPU work required!\n\t\tprivate Effect particleEffect;\n\n\t\t// Shortcuts for accessing frequently changed effect parameters.\n\t\tprivate EffectParameter effectMaterialIdParameter;\n\t\tprivate EffectParameter effectViewParameter;\n\t\tprivate EffectParameter effectInverseViewParameter;\n\t\tprivate EffectParameter effectCameraPositionParameter;\n\t\tprivate EffectParameter effectProjectionParameter;\n\t\tprivate EffectParameter effectViewportScaleParameter;\n\t\tprivate EffectParameter effectTimeParameter;\n\t\tprivate EffectParameter effectDepthBufferParameter;\n\t\tprivate EffectParameter effectFrameBufferParameter;\n\n\t\t// An array of particles, treated as a circular queue.\n\t\tprivate ParticleVertex[] particles;\n\n\t\t// A vertex buffer holding our particles. This contains the same data as\n\t\t// the particles array, but copied across to where the GPU can access it.\n\t\tprivate DynamicVertexBuffer vertexBuffer;\n\n\t\t// Index buffer turns sets of four vertices into particle quads (pairs of triangles).\n\t\tprivate IndexBuffer indexBuffer;\n\n\t\t// The particles array and vertex buffer are treated as a circular queue.\n\t\t// Initially, the entire contents of the array are free, because no particles\n\t\t// are in use. When a new particle is created, this is allocated from the\n\t\t// beginning of the array. If more than one particle is created, these will\n\t\t// always be stored in a consecutive block of array elements. Because all\n\t\t// particles last for the same amount of time, old particles will always be\n\t\t// removed in order from the start of this active particle region, so the\n\t\t// active and free regions will never be intermingled. Because the queue is\n\t\t// circular, there can be times when the active particle region wraps from the\n\t\t// end of the array back to the start. The queue uses modulo arithmetic to\n\t\t// handle these cases. For instance with a four entry queue we could have:\n\t\t//\n\t\t//      0\n\t\t//      1 - first active particle\n\t\t//      2 \n\t\t//      3 - first free particle\n\t\t//\n\t\t// In this case, particles 1 and 2 are active, while 3 and 4 are free.\n\t\t// Using modulo arithmetic we could also have:\n\t\t//\n\t\t//      0\n\t\t//      1 - first free particle\n\t\t//      2 \n\t\t//      3 - first active particle\n\t\t//\n\t\t// Here, 3 and 0 are active, while 1 and 2 are free.\n\t\t//\n\t\t// But wait! The full story is even more complex.\n\t\t//\n\t\t// When we create a new particle, we add them to our managed particles array.\n\t\t// We also need to copy this new data into the GPU vertex buffer, but we don't\n\t\t// want to do that straight away, because setting new data into a vertex buffer\n\t\t// can be an expensive operation. If we are going to be adding several particles\n\t\t// in a single frame, it is faster to initially just store them in our managed\n\t\t// array, and then later upload them all to the GPU in one single call. So our\n\t\t// queue also needs a region for storing new particles that have been added to\n\t\t// the managed array but not yet uploaded to the vertex buffer.\n\t\t//\n\t\t// Another issue occurs when old particles are retired. The CPU and GPU run\n\t\t// asynchronously, so the GPU will often still be busy drawing the previous\n\t\t// frame while the CPU is working on the next frame. This can cause a\n\t\t// synchronization problem if an old particle is retired, and then immediately\n\t\t// overwritten by a new one, because the CPU might try to change the contents\n\t\t// of the vertex buffer while the GPU is still busy drawing the old data from\n\t\t// it. Normally the graphics driver will take care of this by waiting until\n\t\t// the GPU has finished drawing inside the VertexBuffer.SetData call, but we\n\t\t// don't want to waste time waiting around every time we try to add a new\n\t\t// particle! To avoid this delay, we can specify the SetDataOptions.NoOverwrite\n\t\t// flag when we write to the vertex buffer. This basically means \"I promise I\n\t\t// will never try to overwrite any data that the GPU might still be using, so\n\t\t// you can just go ahead and update the buffer straight away\". To keep this\n\t\t// promise, we must avoid reusing vertices immediately after they are drawn.\n\t\t//\n\t\t// So in total, our queue contains four different regions:\n\t\t//\n\t\t// Vertices between firstActiveParticle and firstNewParticle are actively\n\t\t// being drawn, and exist in both the managed particles array and the GPU\n\t\t// vertex buffer.\n\t\t//\n\t\t// Vertices between firstNewParticle and firstFreeParticle are newly created,\n\t\t// and exist only in the managed particles array. These need to be uploaded\n\t\t// to the GPU at the start of the next draw call.\n\t\t//\n\t\t// Vertices between firstFreeParticle and firstRetiredParticle are free and\n\t\t// waiting to be allocated.\n\t\t//\n\t\t// Vertices between firstRetiredParticle and firstActiveParticle are no longer\n\t\t// being drawn, but were drawn recently enough that the GPU could still be\n\t\t// using them. These need to be kept around for a few more frames before they\n\t\t// can be reallocated.\n\n\t\tprivate int firstActiveParticle;\n\t\tprivate int firstNewParticle;\n\t\tprivate int firstFreeParticle;\n\t\tprivate int firstRetiredParticle;\n\n\t\tprivate RasterizerState noCullRasterizerState = new RasterizerState { CullMode = CullMode.None };\n\n\t\t// Store the current time, in seconds.\n\t\tprivate float currentTime;\n\n\t\t// Count how many times Draw has been called. This is used to know\n\t\t// when it is safe to retire old particles back into the free list.\n\t\tprivate int drawCounter;\n\n\t\t// Shared random number generator.\n\t\tprivate static Random random = new Random();\n\n\t\tpublic static ParticleSystem Get(Main main, string type)\n\t\t{\n\t\t\tif (ParticleSystem.systems == null)\n\t\t\t\tParticleSystem.initialize(main);\n\t\t\tParticleSystem value;\n\t\t\tif (ParticleSystem.systems.TryGetValue(type, out value))\n\t\t\t\treturn value;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = true;\n\n\t\t\tthis.OrderKey = new Property<string>();\n\t\t\tthis.Add(new NotifyBinding(this.main.DrawablesModified, this.OrderKey));\n\n\t\t\tthis.DrawOrder = new Property<int> { Value = 11 };\n\t\t\tthis.Add(new NotifyBinding(this.main.AlphaDrawablesModified, this.DrawOrder));\n\t\t\tthis.Add(new NotifyBinding(this.main.PostAlphaDrawablesModified, this.DrawOrder));\n\n\t\t\tthis.Add(new SetBinding<ParticleSettings>(this.Settings, delegate(ParticleSettings value)\n\t\t\t{\n\t\t\t\tthis.settings = value;\n\t\t\t\tif (this.main != null)\n\t\t\t\t{\n\t\t\t\t\tif (this.vertexBuffer != null)\n\t\t\t\t\t\tthis.vertexBuffer.Dispose();\n\t\t\t\t\tif (this.indexBuffer != null)\n\t\t\t\t\t\tthis.indexBuffer.Dispose();\n\t\t\t\t\tthis.initialize(false);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tprotected void initialize(bool reload)\n\t\t{\n\t\t\tif (this.particles == null || this.particles.Length != this.settings.MaxParticles * 4)\n\t\t\t{\n\t\t\t\t// Allocate the particle array, and fill in the corner fields (which never change).\n\t\t\t\tthis.particles = new ParticleVertex[this.settings.MaxParticles * 4];\n\n\t\t\t\tfor (int i = 0; i < this.settings.MaxParticles; i++)\n\t\t\t\t{\n\t\t\t\t\tthis.particles[i * 4 + 0].Corner = new Short2(-1, -1);\n\t\t\t\t\tthis.particles[i * 4 + 1].Corner = new Short2(1, -1);\n\t\t\t\t\tthis.particles[i * 4 + 2].Corner = new Short2(1, 1);\n\t\t\t\t\tthis.particles[i * 4 + 3].Corner = new Short2(-1, 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Create a dynamic vertex buffer.\n\t\t\tthis.vertexBuffer = new DynamicVertexBuffer(this.main.GraphicsDevice, ParticleVertex.VertexDeclaration,\n\t\t\t\t\t\t\t\t\t\t\t\t   this.settings.MaxParticles * 4, BufferUsage.WriteOnly);\n\n\t\t\t// Create and populate the index buffer.\n\t\t\tuint[] indices = new uint[this.settings.MaxParticles * 6];\n\n\t\t\tfor (int i = 0; i < this.settings.MaxParticles; i++)\n\t\t\t{\n\t\t\t\tindices[i * 6 + 0] = (uint)(i * 4 + 0);\n\t\t\t\tindices[i * 6 + 1] = (uint)(i * 4 + 1);\n\t\t\t\tindices[i * 6 + 2] = (uint)(i * 4 + 2);\n\n\t\t\t\tindices[i * 6 + 3] = (uint)(i * 4 + 0);\n\t\t\t\tindices[i * 6 + 4] = (uint)(i * 4 + 2);\n\t\t\t\tindices[i * 6 + 5] = (uint)(i * 4 + 3);\n\t\t\t}\n\n\t\t\tthis.indexBuffer = new IndexBuffer(this.main.GraphicsDevice, typeof(uint), indices.Length, BufferUsage.WriteOnly);\n\n\t\t\tthis.indexBuffer.SetData(indices);\n\n\t\t\tif (this.particleEffect == null || reload)\n\t\t\t{\n\t\t\t\tEffect effect = this.main.Content.Load<Effect>(this.settings.EffectFile);\n\n\t\t\t\t// If we have several particle systems, the content manager will return\n\t\t\t\t// a single shared effect instance to them all. But we want to preconfigure\n\t\t\t\t// the effect with parameters that are specific to this particular\n\t\t\t\t// particle system. By cloning the effect, we prevent one particle system\n\t\t\t\t// from stomping over the parameter settings of another.\n\n\t\t\t\tthis.particleEffect = effect.Clone();\n\t\t\t}\n\n\t\t\tEffectParameterCollection parameters = this.particleEffect.Parameters;\n\n\t\t\t// Look up shortcuts for parameters that change every frame.\n\t\t\tthis.effectViewParameter = parameters[\"View\"];\n\t\t\tthis.effectMaterialIdParameter = parameters[\"MaterialID\"];\n\t\t\tthis.effectInverseViewParameter = parameters[\"InverseView\"];\n\t\t\tthis.effectCameraPositionParameter = parameters[\"CameraPosition\"];\n\t\t\tthis.effectProjectionParameter = parameters[\"Projection\"];\n\t\t\tthis.effectViewportScaleParameter = parameters[\"ViewportScale\"];\n\t\t\tthis.effectTimeParameter = parameters[\"CurrentTime\"];\n\t\t\tthis.effectDepthBufferParameter = parameters[\"Depth\" + Model.SamplerPostfix];\n\t\t\tthis.effectFrameBufferParameter = parameters[\"Frame\" + Model.SamplerPostfix];\n\n\t\t\t// Set the values of parameters that do not change.\n\t\t\tparameters[\"DurationRandomness\"].SetValue(this.settings.DurationRandomness);\n\t\t\tparameters[\"Gravity\"].SetValue(this.settings.Gravity);\n\t\t\tparameters[\"EndVelocity\"].SetValue(this.settings.EndVelocity);\n\t\t\tparameters[\"MinColor\"].SetValue(this.settings.MinColor);\n\t\t\tparameters[\"MaxColor\"].SetValue(this.settings.MaxColor);\n\n\t\t\tEffectParameter param = parameters[\"RotateSpeed\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(new Vector2(this.settings.MinRotateSpeed, this.settings.MaxRotateSpeed));\n\n\t\t\tparam = parameters[\"StartSize\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(new Vector2(this.settings.MinStartSize, this.settings.MaxStartSize));\n\n\t\t\tparam = parameters[\"EndSize\"];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(new Vector2(this.settings.MinEndSize, this.settings.MaxEndSize));\n\n\t\t\t// Load the particle texture, and set it onto the effect.\n\t\t\tTexture2D texture = this.main.Content.Load<Texture2D>(this.settings.TextureName);\n\n\t\t\tparam = parameters[Model.SamplerPostfix];\n\t\t\tif (param != null)\n\t\t\t\tparam.SetValue(texture);\n\n\t\t\tthis.OrderKey.Value = string.Format(\"{0}|{1}\", this.settings.EffectFile, this.settings.TextureName);\n\t\t\tthis.DrawOrder.Value = this.settings.DrawOrder;\n\t\t}\n\n\t\tpublic void LoadContent(bool reload)\n\t\t{\n\t\t\tif (this.settings != null)\n\t\t\t\tthis.initialize(reload);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Updates the particle system.\n\t\t/// </summary>\n\t\tpublic void Update(float elapsedTime)\n\t\t{\n\t\t\tif (this.main.Paused)\n\t\t\t\treturn;\n\n\t\t\tthis.currentTime += elapsedTime;\n\n\t\t\tthis.retireActiveParticles();\n\t\t\tthis.freeRetiredParticles();\n\n\t\t\tif (this.firstActiveParticle == this.firstFreeParticle)\n\t\t\t\tthis.currentTime = 0;\n\n\t\t\tif (this.firstRetiredParticle == this.firstActiveParticle)\n\t\t\t\tthis.drawCounter = 0;\n\t\t}\n\n\t\tpublic void Prime()\n\t\t{\n\t\t\tthis.firstActiveParticle = 0;\n\t\t\tthis.firstFreeParticle = 0;\n\t\t\tthis.firstNewParticle = 0;\n\t\t\tthis.firstRetiredParticle = 0;\n\t\t\tthis.currentTime = (float)this.settings.Duration.TotalSeconds;\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Helper for checking when active particles have reached the end of\n\t\t/// their life. It moves old particles from the active area of the queue\n\t\t/// to the retired section.\n\t\t/// </summary>\n\t\tprotected void retireActiveParticles()\n\t\t{\n\t\t\tfloat particleDuration = (float)settings.Duration.TotalSeconds;\n\n\t\t\twhile (this.firstActiveParticle != this.firstNewParticle)\n\t\t\t{\n\t\t\t\t// Is this particle old enough to retire?\n\t\t\t\t// We multiply the active particle index by four, because each\n\t\t\t\t// particle consists of a quad that is made up of four vertices.\n\t\t\t\tfloat particleAge = this.currentTime - this.particles[this.firstActiveParticle * 4].Time;\n\n\t\t\t\tif (particleAge < particleDuration)\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Remember the time at which we retired this particle.\n\t\t\t\tthis.particles[this.firstActiveParticle * 4].Time = this.drawCounter;\n\n\t\t\t\t// Move the particle from the active to the retired queue.\n\t\t\t\tthis.firstActiveParticle++;\n\n\t\t\t\tif (this.firstActiveParticle >= this.settings.MaxParticles)\n\t\t\t\t\tthis.firstActiveParticle = 0;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Helper for checking when retired particles have been kept around long\n\t\t/// enough that we can be sure the GPU is no longer using them. It moves\n\t\t/// old particles from the retired area of the queue to the free section.\n\t\t/// </summary>\n\t\tprotected void freeRetiredParticles()\n\t\t{\n\t\t\twhile (this.firstRetiredParticle != this.firstActiveParticle)\n\t\t\t{\n\t\t\t\t// Has this particle been unused long enough that\n\t\t\t\t// the GPU is sure to be finished with it?\n\t\t\t\t// We multiply the retired particle index by four, because each\n\t\t\t\t// particle consists of a quad that is made up of four vertices.\n\t\t\t\tint age = this.drawCounter - (int)this.particles[this.firstRetiredParticle * 4].Time;\n\n\t\t\t\t// The GPU is never supposed to get more than 2 frames behind the CPU.\n\t\t\t\t// We add 1 to that, just to be safe in case of buggy drivers that\n\t\t\t\t// might bend the rules and let the GPU get further behind.\n\t\t\t\tif (age < 3)\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Move the particle from the retired to the free queue.\n\t\t\t\tthis.firstRetiredParticle++;\n\n\t\t\t\tif (this.firstRetiredParticle >= settings.MaxParticles)\n\t\t\t\t\tthis.firstRetiredParticle = 0;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Draws the particle system if it is an opaque particle system.\n\t\t/// </summary>\n\t\tvoid IDrawableComponent.Draw(GameTime gameTime, RenderParameters parameters)\n\t\t{\n\t\t\tif (this.settings.BlendState == BlendState.Opaque)\n\t\t\t\tthis.draw(parameters);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Draws the particle system, if it is in fact an alpha-enabled particle system.\n\t\t/// </summary>\n\t\tvoid IDrawablePostAlphaComponent.DrawPostAlpha(GameTime gameTime, RenderParameters parameters)\n\t\t{\n\t\t\tif (this.settings.BlendState != BlendState.Opaque && this.settings.PostAlpha)\n\t\t\t\tthis.draw(parameters);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Draws the particle system, if it is in fact an alpha-enabled particle system.\n\t\t/// </summary>\n\t\tvoid IDrawableAlphaComponent.DrawAlpha(GameTime gameTime, RenderParameters parameters)\n\t\t{\n\t\t\tif (this.settings.BlendState != BlendState.Opaque && !this.settings.PostAlpha)\n\t\t\t\tthis.draw(parameters);\n\t\t}\n\n\t\tprotected void draw(RenderParameters parameters)\n\t\t{\n\t\t\tif (this.settings.UnsupportedTechniques.Contains(parameters.Technique))\n\t\t\t\treturn;\n\n\t\t\tGraphicsDevice device = this.main.GraphicsDevice;\n\n\t\t\t// Restore the vertex buffer contents if the graphics device was lost.\n\t\t\tif (this.vertexBuffer.IsContentLost)\n\t\t\t\tthis.vertexBuffer.SetData(particles);\n\n\t\t\t// If there are any particles waiting in the newly added queue,\n\t\t\t// we'd better upload them to the GPU ready for drawing.\n\t\t\tif (this.firstNewParticle != this.firstFreeParticle)\n\t\t\t\tthis.addNewParticlesToVertexBuffer();\n\n\t\t\t// If there are any active particles, draw them now!\n\t\t\tif (this.firstActiveParticle != this.firstFreeParticle)\n\t\t\t{\n\t\t\t\tstring techniqueName;\n\t\t\t\tif (settings.BlendState == BlendState.Additive)\n\t\t\t\t\ttechniqueName = \"AdditiveParticles\";\n\t\t\t\telse if (settings.BlendState == BlendState.Opaque)\n\t\t\t\t{\n\t\t\t\t\ttechniqueName = \"OpaqueParticles\";\n\t\t\t\t\tthis.main.LightingManager.SetRenderParameters(this.particleEffect, parameters);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\ttechniqueName = \"AlphaParticles\";\n\n\t\t\t\tif (parameters.Technique == Technique.Clip)\n\t\t\t\t\tthis.particleEffect.Parameters[\"ClipPlanes\"].SetValue(parameters.ClipPlaneData);\n\n\t\t\t\ttechniqueName = parameters.TechniqueString + techniqueName;\n\n\t\t\t\tEffectTechnique techniqueInstance = this.particleEffect.Techniques[techniqueName];\n\t\t\t\tif (techniqueInstance == null)\n\t\t\t\t{\n\t\t\t\t\tthis.settings.UnsupportedTechniques.Add(parameters.Technique);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.particleEffect.CurrentTechnique = techniqueInstance;\n\n\t\t\t\tdevice.DepthStencilState = DepthStencilState.DepthRead;\n\n\t\t\t\t// Set an effect parameter describing the viewport size. This is\n\t\t\t\t// needed to convert particle sizes into screen space point sizes.\n\t\t\t\tif (this.effectViewportScaleParameter != null)\n\t\t\t\t\tthis.effectViewportScaleParameter.SetValue(new Vector2(0.5f / device.Viewport.AspectRatio, -0.5f));\n\n\t\t\t\t// Set an effect parameter describing the current time. All the vertex\n\t\t\t\t// shader particle animation is keyed off this value.\n\t\t\t\tthis.effectTimeParameter.SetValue(this.currentTime);\n\n\t\t\t\t// Update view/projection matrix\n\t\t\t\tif (this.effectViewParameter != null)\n\t\t\t\t\tthis.effectViewParameter.SetValue(parameters.Camera.View);\n\t\t\t\tif (this.effectMaterialIdParameter != null)\n\t\t\t\t\tthis.effectMaterialIdParameter.SetValue(this.main.LightingManager.GetMaterialIndex(this.settings.Material));\n\t\t\t\tif (this.effectInverseViewParameter != null)\n\t\t\t\t\tthis.effectInverseViewParameter.SetValue(parameters.Camera.InverseView);\n\t\t\t\tif (this.effectCameraPositionParameter != null)\n\t\t\t\t\tthis.effectCameraPositionParameter.SetValue(parameters.Camera.Position);\n\t\t\t\tif (this.effectProjectionParameter != null)\n\t\t\t\t\tthis.effectProjectionParameter.SetValue(parameters.Camera.Projection);\n\t\t\t\tif (this.effectDepthBufferParameter != null)\n\t\t\t\t\tthis.effectDepthBufferParameter.SetValue(parameters.DepthBuffer);\n\t\t\t\tif (this.effectFrameBufferParameter != null)\n\t\t\t\t\tthis.effectFrameBufferParameter.SetValue(parameters.FrameBuffer);\n\n\t\t\t\t// Set the particle vertex and index buffer.\n\t\t\t\tdevice.SetVertexBuffer(this.vertexBuffer);\n\t\t\t\tdevice.Indices = this.indexBuffer;\n\n\t\t\t\tRasterizerState originalState = this.main.GraphicsDevice.RasterizerState;\n\t\t\t\tthis.main.GraphicsDevice.RasterizerState = this.noCullRasterizerState;\n\n\t\t\t\t// Activate the particle effect.\n\t\t\t\tthis.particleEffect.CurrentTechnique.Passes[0].Apply();\n\n\t\t\t\tif (this.firstActiveParticle < this.firstFreeParticle)\n\t\t\t\t{\n\t\t\t\t\t// If the active particles are all in one consecutive range,\n\t\t\t\t\t// we can draw them all in a single call.\n\t\t\t\t\tdevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0,\n\t\t\t\t\t\t\t\t\t\t\t\t this.firstActiveParticle * 4, (this.firstFreeParticle - this.firstActiveParticle) * 4,\n\t\t\t\t\t\t\t\t\t\t\t\t this.firstActiveParticle * 6, (this.firstFreeParticle - this.firstActiveParticle) * 2);\n\t\t\t\t\tModel.DrawCallCounter++;\n\t\t\t\t\tModel.TriangleCounter += (this.firstFreeParticle - this.firstActiveParticle) * 2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// If the active particle range wraps past the end of the queue\n\t\t\t\t\t// back to the start, we must split them over two draw calls.\n\t\t\t\t\tdevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0,\n\t\t\t\t\t\t\t\t\t\t\t\t this.firstActiveParticle * 4, (this.settings.MaxParticles - this.firstActiveParticle) * 4,\n\t\t\t\t\t\t\t\t\t\t\t\t this.firstActiveParticle * 6, (this.settings.MaxParticles - this.firstActiveParticle) * 2);\n\t\t\t\t\tModel.DrawCallCounter++;\n\t\t\t\t\tModel.TriangleCounter += (this.settings.MaxParticles - this.firstActiveParticle) * 2;\n\n\t\t\t\t\tif (this.firstFreeParticle > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t 0, this.firstFreeParticle * 4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t 0, this.firstFreeParticle * 2);\n\t\t\t\t\t\tModel.DrawCallCounter++;\n\t\t\t\t\t\tModel.TriangleCounter += this.firstFreeParticle * 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.main.GraphicsDevice.RasterizerState = originalState;\n\n\t\t\t\t// Reset some of the renderstates that we changed,\n\t\t\t\t// so as not to mess up any other subsequent drawing.\n\t\t\t\tdevice.DepthStencilState = DepthStencilState.Default;\n\t\t\t}\n\n\t\t\tthis.drawCounter++;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Helper for uploading new particles from our managed\n\t\t/// array to the GPU vertex buffer.\n\t\t/// </summary>\n\t\tprotected void addNewParticlesToVertexBuffer()\n\t\t{\n\t\t\tint stride = ParticleVertex.SizeInBytes;\n\n\t\t\tif (this.firstNewParticle < this.firstFreeParticle)\n\t\t\t{\n\t\t\t\t// If the new particles are all in one consecutive range,\n\t\t\t\t// we can upload them all in a single call.\n\t\t\t\tthis.vertexBuffer.SetData(this.firstNewParticle * stride * 4, this.particles,\n\t\t\t\t\t\t\t\t\t this.firstNewParticle * 4,\n\t\t\t\t\t\t\t\t\t (this.firstFreeParticle - this.firstNewParticle) * 4,\n\t\t\t\t\t\t\t\t\t stride, SetDataOptions.NoOverwrite);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// If the new particle range wraps past the end of the queue\n\t\t\t\t// back to the start, we must split them over two upload calls.\n\t\t\t\tthis.vertexBuffer.SetData(this.firstNewParticle * stride * 4, this.particles,\n\t\t\t\t\t\t\t\t\t this.firstNewParticle * 4,\n\t\t\t\t\t\t\t\t\t (this.settings.MaxParticles - this.firstNewParticle) * 4,\n\t\t\t\t\t\t\t\t\t stride, SetDataOptions.NoOverwrite);\n\n\t\t\t\tif (this.firstFreeParticle > 0)\n\t\t\t\t{\n\t\t\t\t\tthis.vertexBuffer.SetData(0, this.particles,\n\t\t\t\t\t\t\t\t\t\t 0, this.firstFreeParticle * 4,\n\t\t\t\t\t\t\t\t\t\t stride, SetDataOptions.NoOverwrite);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Move the particles we just uploaded from the new to the active queue.\n\t\t\tthis.firstNewParticle = this.firstFreeParticle;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Adds a new particle to the system.\n\t\t/// </summary>\n\t\tpublic void AddParticle(Vector3 position, Vector3 velocity, float lifetime = -1.0f, float size = -1.0f, float prePrime = 0.0f)\n\t\t{\n\t\t\tif (lifetime == -1.0f)\n\t\t\t\tlifetime = (float)this.settings.Duration.TotalSeconds;\n\t\t\t\n\t\t\tif (size == -1.0f)\n\t\t\t\tsize = this.settings.MinStartSize + (float)ParticleSystem.random.NextDouble() * (this.settings.MaxStartSize - this.settings.MinStartSize);\n\n\t\t\t// Figure out where in the circular queue to allocate the new particle.\n\t\t\tint nextFreeParticle = this.firstFreeParticle + 1;\n\n\t\t\tif (nextFreeParticle >= this.settings.MaxParticles)\n\t\t\t\tnextFreeParticle = 0;\n\n\t\t\t// If there are no free particles, we just have to give up.\n\t\t\tif (nextFreeParticle == this.firstRetiredParticle)\n\t\t\t\treturn;\n\n\t\t\t// Adjust the input velocity based on how much\n\t\t\t// this particle system wants to be affected by it.\n\t\t\tvelocity *= this.settings.EmitterVelocitySensitivity;\n\n\t\t\t// Add in some random amount of horizontal velocity.\n\t\t\tfloat horizontalVelocity = MathHelper.Lerp(this.settings.MinHorizontalVelocity,\n\t\t\t\t\t\t\t\t\t\t\t\t\t   this.settings.MaxHorizontalVelocity,\n\t\t\t\t\t\t\t\t\t\t\t\t\t   (float)ParticleSystem.random.NextDouble());\n\n\t\t\tdouble horizontalAngle = ParticleSystem.random.NextDouble() * MathHelper.TwoPi;\n\n\t\t\tvelocity.X += horizontalVelocity * (float)Math.Cos(horizontalAngle);\n\t\t\tvelocity.Z += horizontalVelocity * (float)Math.Sin(horizontalAngle);\n\n\t\t\t// Add in some random amount of vertical velocity.\n\t\t\tvelocity.Y += MathHelper.Lerp(this.settings.MinVerticalVelocity,\n\t\t\t\t\t\t\t\t\t\t  this.settings.MaxVerticalVelocity,\n\t\t\t\t\t\t\t\t\t\t  (float)ParticleSystem.random.NextDouble());\n\n\t\t\t// Choose four random control values. These will be used by the vertex\n\t\t\t// shader to give each particle a different size, rotation, and color.\n\t\t\tColor randomValues = new Color((byte)ParticleSystem.random.Next(255),\n\t\t\t\t\t\t\t\t\t\t   (byte)ParticleSystem.random.Next(255),\n\t\t\t\t\t\t\t\t\t\t   (byte)ParticleSystem.random.Next(255),\n\t\t\t\t\t\t\t\t\t\t   (byte)ParticleSystem.random.Next(255));\n\n\t\t\t// Fill in the particle vertex structure.\n\t\t\tfor (int i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tParticleVertex v = this.particles[this.firstFreeParticle * 4 + i];\n\t\t\t\tv.Position = position;\n\t\t\t\tv.Velocity = velocity;\n\t\t\t\tv.Random = randomValues;\n\t\t\t\tv.Time = this.currentTime - prePrime;\n\t\t\t\tv.Lifetime = lifetime;\n\t\t\t\tv.StartSize = size;\n\t\t\t\tthis.particles[this.firstFreeParticle * 4 + i] = v;\n\t\t\t}\n\n\t\t\tthis.firstFreeParticle = nextFreeParticle;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Graphics/PointLight.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class PointLight : Component<Main>\n\t{\n\t\tpublic static readonly List<PointLight> All = new List<PointLight>();\n\n\t\tpublic Property<Vector3> Color = new Property<Vector3> { Value = Vector3.One };\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<float> Attenuation = new Property<float> { Value = 10.0f };\n\n\t\t[XmlIgnore]\n\t\tpublic Property<BoundingSphere> BoundingSphere = new Property<BoundingSphere>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new Binding<BoundingSphere>(this.BoundingSphere, () => new BoundingSphere(this.Position, this.Attenuation), this.Position, this.Attenuation));\n\t\t\tPointLight.All.Add(this);\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tPointLight.All.Remove(this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Graphics/Renderer.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Content;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic enum Technique { Render, Shadow, Clip };\n\n\tpublic class RenderParameters\n\t{\n\t\tpublic Camera Camera;\n\t\tprivate Plane[] clipPlanes;\n\t\tpublic Plane[] ClipPlanes\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.clipPlanes;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.clipPlanes = value;\n\t\t\t\tif (value == null)\n\t\t\t\t\tthis.ClipPlaneData = new Vector4[] { Vector4.Zero, Vector4.Zero, Vector4.Zero, Vector4.Zero };\n\t\t\t\telse\n\t\t\t\t\tthis.ClipPlaneData = value.Select(x => new Vector4(x.Normal, x.D)).ToArray();\n\t\t\t}\n\t\t}\n\t\tpublic Vector4[] ClipPlaneData;\n\t\tprivate Technique technique;\n\t\tpublic Technique Technique\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.technique;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.technique = value;\n\t\t\t\tthis.TechniqueString = value.ToString();\n\t\t\t}\n\t\t}\n\t\tpublic string TechniqueString;\n\t\tpublic bool ReverseCullOrder;\n\t\tpublic RenderTarget2D DepthBuffer;\n\t\tpublic RenderTarget2D FrameBuffer;\n\t\tpublic bool IsMainRender;\n\t\tpublic static readonly RenderParameters Default = new RenderParameters();\n\t\tpublic Vector2[] MaterialData = new Vector2[LightingManager.MaxMaterials];\n\t\tpublic RenderParameters Clone()\n\t\t{\n\t\t\treturn new RenderParameters\n\t\t\t{\n\t\t\t\tCamera = this.Camera,\n\t\t\t\tclipPlanes = (Plane[])this.clipPlanes.Clone(),\n\t\t\t\tClipPlaneData = (Vector4[])this.ClipPlaneData.Clone(),\n\t\t\t\tTechnique = this.Technique,\n\t\t\t\tReverseCullOrder = this.ReverseCullOrder,\n\t\t\t\tDepthBuffer = this.DepthBuffer,\n\t\t\t\tFrameBuffer = this.FrameBuffer,\n\t\t\t\tIsMainRender = this.IsMainRender,\n\t\t\t\tMaterialData = this.MaterialData.ToArray(),\n\t\t\t};\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Deferred renderer\n\t/// </summary>\n\tpublic class Renderer : Component<Main>, IGraphicsComponent\n\t{\n\t\tprivate LightingManager lightingManager;\n\n\t\t// Geometry\n\t\tprivate static FullscreenQuad quad;\n\t\tprivate static Microsoft.Xna.Framework.Graphics.Model pointLightModel;\n\t\tprivate static Microsoft.Xna.Framework.Graphics.Model spotLightModel;\n\n\t\tpublic Property<float> BlurAmount = new Property<float>();\n\t\tpublic Property<float> SpeedBlurAmount = new Property<float>();\n\t\tpublic Property<Vector3> Tint = new Property<Vector3> { Value = Vector3.One };\n\t\tpublic Property<float> InternalGamma = new Property<float>();\n\t\tpublic Property<float> Gamma = new Property<float> { Value = 1.0f };\n\t\tpublic Property<float> Brightness = new Property<float>();\n\t\tpublic Property<float> MotionBlurAmount = new Property<float> { Value = 1.0f };\n\t\tprivate Texture2D lightRampTexture;\n\t\tpublic Property<string> LightRampTexture = new Property<string>();\n\t\tpublic Property<bool> EnableBloom = new Property<bool> { Value = true };\n\t\tpublic Property<bool> EnableSSAO = new Property<bool> { Value = true };\n\n\t\tprivate Point screenSize;\n\n\t\t// Effects\n\t\tprivate static Effect globalLightEffect;\n\t\tprivate static Effect pointLightEffect;\n\t\tprivate static Effect spotLightEffect;\n\t\tprivate Effect compositeEffect;\n\t\tprivate Effect motionBlurEffect;\n\t\tprivate Effect bloomEffect;\n\t\tprivate Effect blurEffect;\n\t\tprivate Effect clearEffect;\n\t\tprivate Effect downsampleEffect;\n\t\tprivate Effect ssaoEffect;\n\n\t\t// Render targets\n\t\tprivate RenderTarget2D lightingBuffer;\n\t\tprivate RenderTarget2D specularBuffer;\n\t\tprivate RenderTarget2D depthBuffer;\n\t\tprivate RenderTarget2D normalBuffer;\n\t\tprivate RenderTarget2D colorBuffer1;\n\t\tprivate RenderTarget2D colorBuffer2;\n\t\tprivate RenderTarget2D hdrBuffer1;\n\t\tprivate RenderTarget2D hdrBuffer2;\n\t\tprivate RenderTarget2D halfBuffer1;\n\t\tprivate RenderTarget2D halfBuffer2;\n\t\tprivate RenderTarget2D halfDepthBuffer;\n\t\tprivate Texture2D ssaoRandomTexture;\n\t\tprivate RenderTarget2D normalBufferLastFrame;\n\t\tprivate SpriteBatch spriteBatch;\n\n\t\tprivate bool allowSSAO;\n\t\tprivate bool allowBloom;\n\t\tprivate bool allowPostAlphaDrawables;\n\t\tprivate bool allowToneMapping;\n\t\tprivate bool justReallocatedBuffers;\n\t\t\n\t\tprivate static bool staticReloadBound = false;\n\n\t\t/// <summary>\n\t\t/// The class constructor\n\t\t/// </summary>\n\t\t/// <param name=\"graphicsDevice\">The GraphicsDevice to use for rendering</param>\n\t\t/// <param name=\"contentManager\">The ContentManager from which to load Effects</param>\n\t\tpublic Renderer(Main main, bool allowHdr, bool allowBloom, bool allowToneMapping, bool allowSSAO, bool allowPostAlphaDrawables)\n\t\t{\n\t\t\tthis.allowBloom = allowBloom;\n\t\t\tthis.allowSSAO = allowSSAO;\n\t\t\tthis.allowPostAlphaDrawables = allowPostAlphaDrawables;\n\t\t\tthis.allowToneMapping = allowToneMapping;\n\t\t\tthis.hdr = allowHdr;\n\t\t\tthis.lightingManager = main.LightingManager;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.Add(new SetBinding<float>(this.BlurAmount, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.blurEffect.Parameters[\"BlurAmount\"].SetValue(value);\n\t\t\t}));\n\t\t\tthis.Add(new ChangeBinding<string>(this.LightRampTexture, delegate(string old, string file)\n\t\t\t{\n\t\t\t\tif (old != file)\n\t\t\t\t\tthis.loadLightRampTexture(file);\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.InternalGamma, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.Gamma.Reset();\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.MotionBlurAmount, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.motionBlurEffect.Parameters[\"MotionBlurAmount\"].SetValue(value);\n\t\t\t}));\n\t\t\tthis.Add(new SetBinding<float>(this.SpeedBlurAmount, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.motionBlurEffect.Parameters[\"SpeedBlurAmount\"].SetValue(value);\n\t\t\t}));\n\t\t\tthis.SpeedBlurAmount.Value = 0.0f;\n\n\t\t\tthis.Add(new SetBinding<float>(this.Gamma, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.bloomEffect.Parameters[\"Gamma\"].SetValue(value + this.InternalGamma);\n\t\t\t}));\n\t\t\tthis.Add(new SetBinding<Vector3>(this.Tint, delegate(Vector3 value)\n\t\t\t{\n\t\t\t\tthis.bloomEffect.Parameters[\"Tint\"].SetValue(value);\n\t\t\t}));\n\t\t\tthis.Add(new SetBinding<float>(this.Brightness, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.bloomEffect.Parameters[\"Brightness\"].SetValue(value);\n\t\t\t}));\n\t\t}\n\n\t\tpublic void Debug()\n\t\t{\n\t\t\tthis.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque);\n\t\t\tthis.spriteBatch.Draw(this.lightingBuffer, Vector2.Zero, Color.White);\n\t\t\tthis.spriteBatch.End();\n\t\t}\n\n\t\tprivate const string paramLightSampler = \"Ramp\" + Model.SamplerPostfix;\n\t\tprivate void loadLightRampTexture(string file)\n\t\t{\n\t\t\tthis.lightRampTexture = file == null ? (Texture2D)null : this.main.Content.Load<Texture2D>(file);\n\t\t\tthis.bloomEffect.Parameters[paramLightSampler].SetValue(this.lightRampTexture);\n\t\t}\n\n\t\tprivate const string paramCloudSampler = \"Cloud\" + Model.SamplerPostfix;\n\t\tprivate static string[] paramSourceSamplers = new[]\n\t\t{\n\t\t\tstring.Format(\"Source{0}0\", Model.SamplerPostfix),\n\t\t\tstring.Format(\"Source{0}1\", Model.SamplerPostfix),\n\t\t\tstring.Format(\"Source{0}2\", Model.SamplerPostfix),\n\t\t\tstring.Format(\"Source{0}3\", Model.SamplerPostfix),\n\t\t};\n\t\tprivate static string[] paramSourceDimensions = new[]\n\t\t{\n\t\t\t\"SourceDimensions0\",\n\t\t\t\"SourceDimensions1\",\n\t\t\t\"SourceDimensions2\",\n\t\t\t\"SourceDimensions3\",\n\t\t};\n\n\t\tprivate static void reload(Main m)\n\t\t{\n\t\t\t// Load static resources\n\t\t\tif (Renderer.quad == null)\n\t\t\t{\n\t\t\t\tRenderer.quad = new FullscreenQuad();\n\t\t\t\tRenderer.quad.SetMain(m);\n\t\t\t\tRenderer.quad.LoadContent(false);\n\t\t\t\tRenderer.quad.Awake();\n\t\t\t}\n\t\t\telse\n\t\t\t\tRenderer.quad.LoadContent(true);\n\n\t\t\t// Load light models\n\t\t\tRenderer.pointLightModel = m.Content.Load<Microsoft.Xna.Framework.Graphics.Model>(\"InternalModels\\\\pointlight\");\n\t\t\tRenderer.spotLightModel = m.Content.Load<Microsoft.Xna.Framework.Graphics.Model>(\"InternalModels\\\\spotlight\");\n\n\t\t\tRenderer.globalLightEffect = m.Content.Load<Effect>(\"Effects\\\\PostProcess\\\\GlobalLight\").Clone();\n\t\t\tRenderer.pointLightEffect = m.Content.Load<Effect>(\"Effects\\\\PostProcess\\\\PointLight\").Clone();\n\t\t\tRenderer.spotLightEffect = m.Content.Load<Effect>(\"Effects\\\\PostProcess\\\\SpotLight\").Clone();\n\t\t\tRenderer.globalLightEffect.Parameters[paramCloudSampler].SetValue(m.Content.Load<Texture2D>(\"AlphaModels\\\\cloud_texture\"));\n\t\t}\n\n\t\tpublic void LoadContent(bool reload)\n\t\t{\n\t\t\tif (!Renderer.staticReloadBound)\n\t\t\t{\n\t\t\t\tMain m = this.main;\n\t\t\t\tnew CommandBinding(m.ReloadedContent, delegate()\n\t\t\t\t{\n\t\t\t\t\tRenderer.reload(m);\n\t\t\t\t});\n\t\t\t\tRenderer.staticReloadBound = true;\n\t\t\t\tRenderer.reload(m);\n\t\t\t}\n\n\t\t\tif (this.spriteBatch != null)\n\t\t\t\tthis.spriteBatch.Dispose();\n\t\t\tthis.spriteBatch = new SpriteBatch(this.main.GraphicsDevice);\n\n\t\t\t// Initialize our buffers\n\t\t\tthis.ReallocateBuffers(this.screenSize);\n\t\t}\n\n\t\tprivate bool hdr;\n\n\t\tprivate SurfaceFormat hdrSurfaceFormat\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.hdr ? SurfaceFormat.HdrBlendable : SurfaceFormat.Color;\n\t\t\t}\n\t\t}\n\n\t\tprivate const string paramRandomSampler = \"Random\" + Model.SamplerPostfix;\n\t\tpublic void ReallocateBuffers(Point size)\n\t\t{\n\t\t\tthis.compositeEffect = this.main.Content.Load<Effect>(\"Effects\\\\PostProcess\\\\Composite\").Clone();\n\t\t\tthis.compositeEffect.CurrentTechnique = this.compositeEffect.Techniques[\"Composite\"];\n\t\t\tthis.blurEffect = this.main.Content.Load<Effect>(\"Effects\\\\PostProcess\\\\Blur\").Clone();\n\n\t\t\tthis.downsampleEffect = this.main.Content.Load<Effect>(\"Effects\\\\PostProcess\\\\Downsample\").Clone();\n\t\t\tthis.ssaoEffect = this.main.Content.Load<Effect>(\"Effects\\\\PostProcess\\\\SSAO\").Clone();\n\t\t\tthis.ssaoRandomTexture = this.main.Content.Load<Texture2D>(\"Textures\\\\random\");\n\t\t\tthis.ssaoEffect.Parameters[paramRandomSampler].SetValue(this.ssaoRandomTexture);\n\n\t\t\tthis.bloomEffect = this.main.Content.Load<Effect>(\"Effects\\\\PostProcess\\\\Bloom\").Clone();\n\n\t\t\tthis.loadLightRampTexture(this.LightRampTexture);\n\n\t\t\tthis.clearEffect = this.main.Content.Load<Effect>(\"Effects\\\\PostProcess\\\\Clear\").Clone();\n\n\t\t\tthis.motionBlurEffect = this.main.Content.Load<Effect>(\"Effects\\\\PostProcess\\\\MotionBlur\").Clone();\n\n\t\t\tthis.screenSize = size;\n\n\t\t\tif (size.X > 0 && size.Y > 0)\n\t\t\t{\n\t\t\t\t// Lighting buffer\n\t\t\t\tif (this.lightingBuffer != null && !this.lightingBuffer.IsDisposed)\n\t\t\t\t\tthis.lightingBuffer.Dispose();\n\t\t\t\tthis.lightingBuffer = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.X,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.Y,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\tSurfaceFormat.Color,\n\t\t\t\t\t\t\t\t\t\t\t\t\tDepthFormat.None,\n\t\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\n\t\t\t\t// Specular lighting buffer\n\t\t\t\tif (this.specularBuffer != null && !this.specularBuffer.IsDisposed)\n\t\t\t\t\tthis.specularBuffer.Dispose();\n\t\t\t\tthis.specularBuffer = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.X,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.Y,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\tSurfaceFormat.Color,\n\t\t\t\t\t\t\t\t\t\t\t\t\tDepthFormat.None,\n\t\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\n\t\t\t\t// Depth buffer\n\t\t\t\tif (this.depthBuffer != null && !this.depthBuffer.IsDisposed)\n\t\t\t\t\tthis.depthBuffer.Dispose();\n\t\t\t\tthis.depthBuffer = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.X,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.Y,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\tSurfaceFormat.HalfVector2,\n\t\t\t\t\t\t\t\t\t\t\t\t\tDepthFormat.Depth24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\n\t\t\t\t// Normal buffer\n\t\t\t\tif (this.normalBuffer != null && !this.normalBuffer.IsDisposed)\n\t\t\t\t\tthis.normalBuffer.Dispose();\n\t\t\t\tthis.normalBuffer = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.X,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.Y,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\tSurfaceFormat.Color,\n\t\t\t\t\t\t\t\t\t\t\t\t\tDepthFormat.None,\n\t\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\n\t\t\t\t// Color buffer 1\n\t\t\t\tif (this.colorBuffer1 != null && !this.colorBuffer1.IsDisposed)\n\t\t\t\t\tthis.colorBuffer1.Dispose();\n\t\t\t\tthis.colorBuffer1 = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.X,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.Y,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\tSurfaceFormat.Color,\n\t\t\t\t\t\t\t\t\t\t\t\t\tDepthFormat.Depth24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\n\t\t\t\t// Color buffer 2\n\t\t\t\tif (this.colorBuffer2 != null && !this.colorBuffer2.IsDisposed)\n\t\t\t\t\tthis.colorBuffer2.Dispose();\n\t\t\t\tthis.colorBuffer2 = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.X,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.Y,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\tSurfaceFormat.Color,\n\t\t\t\t\t\t\t\t\t\t\t\t\tDepthFormat.Depth24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\n\t\t\t\tif (this.hdr)\n\t\t\t\t{\n\t\t\t\t\t// HDR buffer 1\n\t\t\t\t\tif (this.hdrBuffer1 != null && !this.hdrBuffer1.IsDisposed)\n\t\t\t\t\t\tthis.hdrBuffer1.Dispose();\n\t\t\t\t\tthis.hdrBuffer1 = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize.X,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize.Y,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.hdrSurfaceFormat,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDepthFormat.Depth24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\n\t\t\t\t\t// HDR buffer 2\n\t\t\t\t\tif (this.hdrBuffer2 != null && !this.hdrBuffer2.IsDisposed)\n\t\t\t\t\t\tthis.hdrBuffer2.Dispose();\n\t\t\t\t\tthis.hdrBuffer2 = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize.X,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize.Y,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.hdrSurfaceFormat,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDepthFormat.None,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.hdrBuffer1 = this.colorBuffer1;\n\t\t\t\t\tthis.hdrBuffer2 = this.colorBuffer2;\n\t\t\t\t}\n\n\t\t\t\tif (this.normalBufferLastFrame != null)\n\t\t\t\t{\n\t\t\t\t\tif (!this.normalBufferLastFrame.IsDisposed)\n\t\t\t\t\t\tthis.normalBufferLastFrame.Dispose();\n\t\t\t\t\tthis.normalBufferLastFrame = null;\n\t\t\t\t}\n\n\t\t\t\t// Normal buffer from last frame\n\t\t\t\tthis.normalBufferLastFrame = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.X,\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize.Y,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\tSurfaceFormat.Color,\n\t\t\t\t\t\t\t\t\t\t\t\t\tDepthFormat.None,\n\t\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\n\t\t\t\tif (this.halfBuffer1 != null)\n\t\t\t\t{\n\t\t\t\t\tif (!this.halfBuffer1.IsDisposed)\n\t\t\t\t\t\tthis.halfBuffer1.Dispose();\n\t\t\t\t\tthis.halfBuffer1 = null;\n\t\t\t\t}\n\t\t\t\tif (this.halfBuffer2 != null)\n\t\t\t\t{\n\t\t\t\t\tif (!this.halfBuffer2.IsDisposed)\n\t\t\t\t\t\tthis.halfBuffer2.Dispose();\n\t\t\t\t\tthis.halfBuffer2 = null;\n\t\t\t\t}\n\t\t\t\tif (this.halfDepthBuffer != null)\n\t\t\t\t{\n\t\t\t\t\tif (!this.halfDepthBuffer.IsDisposed)\n\t\t\t\t\t\tthis.halfDepthBuffer.Dispose();\n\t\t\t\t\tthis.halfDepthBuffer = null;\n\t\t\t\t}\n\n\t\t\t\tif (this.allowBloom || this.allowSSAO)\n\t\t\t\t{\n\t\t\t\t\tthis.halfBuffer1 = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\tsize.X / 2,\n\t\t\t\t\t\tsize.Y / 2,\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\tSurfaceFormat.Color,\n\t\t\t\t\t\tDepthFormat.None,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\t\t\t\t\tthis.halfBuffer2 = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\tsize.X / 2,\n\t\t\t\t\t\tsize.Y / 2,\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\tSurfaceFormat.Color,\n\t\t\t\t\t\tDepthFormat.None,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\t\t\t\t}\n\n\t\t\t\tif (this.allowSSAO)\n\t\t\t\t{\n\t\t\t\t\tthis.halfDepthBuffer = new RenderTarget2D(this.main.GraphicsDevice,\n\t\t\t\t\t\tsize.X / 2,\n\t\t\t\t\t\tsize.Y / 2,\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\tSurfaceFormat.Single,\n\t\t\t\t\t\tDepthFormat.None,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tRenderTargetUsage.DiscardContents);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.BlurAmount.Reset();\n\t\t\tthis.SpeedBlurAmount.Reset();\n\t\t\tthis.Tint.Reset();\n\t\t\tthis.InternalGamma.Reset();\n\t\t\tthis.Gamma.Reset();\n\t\t\tthis.Brightness.Reset();\n\t\t\tthis.MotionBlurAmount.Reset();\n\t\t\tthis.LightRampTexture.Reset();\n\n\t\t\tthis.justReallocatedBuffers = true;\n\t\t}\n\n\t\tprivate RenderTarget2D[] sources0 = new RenderTarget2D[0];\n\t\tprivate RenderTarget2D[] sources1 = new RenderTarget2D[1];\n\t\tprivate RenderTarget2D[] sources2 = new RenderTarget2D[2];\n\t\tprivate RenderTarget2D[] sources3 = new RenderTarget2D[3];\n\t\tprivate RenderTarget2D[] sources4 = new RenderTarget2D[4];\n\t\tprivate RenderTarget2D[] destinations1 = new RenderTarget2D[1];\n\t\tprivate RenderTarget2D[] destinations2 = new RenderTarget2D[2];\n\n\t\tpublic void SetRenderTargets(RenderParameters p)\n\t\t{\n\t\t\tif (this.needBufferReallocation())\n\t\t\t\tthis.ReallocateBuffers(this.screenSize);\n\n\t\t\tp.Camera.ViewportSize.Value = this.screenSize;\n\t\t\tthis.main.GraphicsDevice.SetRenderTargets(this.colorBuffer1, this.depthBuffer, this.normalBuffer);\n\t\t\tp.Camera.SetParameters(this.clearEffect);\n\t\t\tthis.destinations1[0] = this.colorBuffer1;\n\t\t\tthis.setTargetParameters(this.sources0, this.destinations1, this.clearEffect);\n\t\t\tColor color = this.lightingManager.BackgroundColor;\n\t\t\tthis.clearEffect.Parameters[\"BackgroundColor\"].SetValue(new Vector3((float)color.R / 255.0f, (float)color.G / 255.0f, (float)color.B / 255.0f));\n\t\t\tthis.main.GraphicsDevice.SamplerStates[1] = SamplerState.PointClamp;\n\t\t\tthis.main.GraphicsDevice.SamplerStates[2] = SamplerState.PointClamp;\n\t\t\tthis.main.GraphicsDevice.SamplerStates[3] = SamplerState.PointClamp;\n\t\t\tthis.main.GraphicsDevice.SamplerStates[4] = SamplerState.PointClamp;\n\t\t\tthis.applyEffect(this.clearEffect);\n\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\t\t}\n\n\t\tprivate bool needBufferReallocation()\n\t\t{\n\t\t\treturn this.lightingBuffer.IsDisposed\n\t\t\t\t|| this.specularBuffer.IsDisposed\n\t\t\t\t|| this.depthBuffer.IsDisposed\n\t\t\t\t|| this.normalBuffer.IsDisposed\n\t\t\t\t|| this.colorBuffer1.IsDisposed\n\t\t\t\t|| this.colorBuffer2.IsDisposed\n\t\t\t\t|| (this.halfBuffer1 != null && this.halfBuffer1.IsDisposed)\n\t\t\t\t|| (this.halfBuffer2 != null && this.halfBuffer2.IsDisposed)\n\t\t\t\t|| (this.halfDepthBuffer != null && this.halfDepthBuffer.IsDisposed)\n\t\t\t\t|| (this.hdrBuffer1 != null && this.hdrBuffer1.IsDisposed)\n\t\t\t\t|| (this.hdrBuffer2 != null && this.hdrBuffer2.IsDisposed)\n\t\t\t\t|| (this.normalBufferLastFrame != null && this.normalBufferLastFrame.IsDisposed);\n\t\t}\n\n\t\tprivate RasterizerState reverseCullState = new RasterizerState { CullMode = CullMode.CullClockwiseFace };\n\n\t\tpublic void PostProcess(RenderTarget2D result, RenderParameters parameters)\n\t\t{\n\t\t\tif (this.needBufferReallocation())\n\t\t\t\treturn;\n\n\t\t\tVector3 originalCameraPosition = parameters.Camera.Position;\n\t\t\tMatrix originalViewMatrix = parameters.Camera.View;\n\t\t\tBoundingFrustum originalBoundingFrustum = parameters.Camera.BoundingFrustum;\n\n\t\t\tparameters.Camera.Position.Value = Vector3.Zero;\n\t\t\tMatrix newViewMatrix = originalViewMatrix;\n\t\t\tnewViewMatrix.Translation = Vector3.Zero;\n\t\t\tparameters.Camera.View.Value = newViewMatrix;\n\n\t\t\tRasterizerState originalState = this.main.GraphicsDevice.RasterizerState;\n\n\t\t\tbool enableSSAO = this.allowSSAO && this.EnableSSAO;\n\n\t\t\tif (enableSSAO)\n\t\t\t{\n\t\t\t\t// Down-sample depth buffer\n\t\t\t\tthis.downsampleEffect.CurrentTechnique = this.downsampleEffect.Techniques[\"DownsampleDepth\"];\n\t\t\t\tthis.sources2[0] = this.depthBuffer;\n\t\t\t\tthis.sources2[1] = this.normalBuffer;\n\t\t\t\tthis.destinations2[0] = this.halfDepthBuffer;\n\t\t\t\tthis.destinations2[1] = this.halfBuffer1;\n\t\t\t\tif (!this.preparePostProcess(this.sources2, this.destinations2, this.downsampleEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\n\t\t\t\t// Compute SSAO\n\t\t\t\tparameters.Camera.SetParameters(this.ssaoEffect);\n\t\t\t\tthis.ssaoEffect.CurrentTechnique = this.ssaoEffect.Techniques[\"SSAO\"];\n\t\t\t\tthis.sources2[0] = this.halfDepthBuffer;\n\t\t\t\tthis.sources2[1] = this.halfBuffer1;\n\t\t\t\tthis.destinations1[0] = this.halfBuffer2;\n\t\t\t\tif (!this.preparePostProcess(this.sources2, this.destinations1, this.ssaoEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\n\t\t\t\t// Blur\n\t\t\t\tthis.ssaoEffect.CurrentTechnique = this.ssaoEffect.Techniques[\"BlurHorizontal\"];\n\t\t\t\tthis.sources2[0] = this.halfBuffer2;\n\t\t\t\tthis.sources2[1] = this.halfDepthBuffer;\n\t\t\t\tthis.destinations1[0] = this.halfBuffer1;\n\t\t\t\tif (!this.preparePostProcess(this.sources2, this.destinations1, this.ssaoEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\n\t\t\t\tthis.ssaoEffect.CurrentTechnique = this.ssaoEffect.Techniques[\"Composite\"];\n\t\t\t\tthis.sources2[0] = this.halfBuffer1;\n\t\t\t\tthis.sources2[1] = this.halfDepthBuffer;\n\t\t\t\tthis.destinations1[0] = this.halfBuffer2;\n\t\t\t\tif (!this.preparePostProcess(this.sources2, this.destinations1, this.ssaoEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\t\t\t}\n\n\t\t\t// Global lighting\n\t\t\tthis.destinations2[0] = this.lightingBuffer;\n\t\t\tthis.destinations2[1] = this.specularBuffer;\n\t\t\tif (!this.setTargets(this.destinations2))\n\t\t\t\treturn;\n\t\t\tstring globalLightTechnique = \"GlobalLight\";\n\t\t\tif (this.lightingManager.EnableGlobalShadowMap && this.lightingManager.HasGlobalShadowLight)\n\t\t\t{\n\t\t\t\tif (parameters.IsMainRender)\n\t\t\t\t{\n\t\t\t\t\tif (this.lightingManager.HasGlobalShadowLightClouds)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.lightingManager.EnableDetailGlobalShadowMap)\n\t\t\t\t\t\t\tglobalLightTechnique = \"GlobalLightDetailShadowClouds\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tglobalLightTechnique = \"GlobalLightShadowClouds\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.lightingManager.EnableDetailGlobalShadowMap)\n\t\t\t\t\t\t\tglobalLightTechnique = \"GlobalLightDetailShadow\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tglobalLightTechnique = \"GlobalLightShadow\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tglobalLightTechnique = \"GlobalLightShadow\";\n\t\t\t}\n\t\t\tRenderer.globalLightEffect.CurrentTechnique = Renderer.globalLightEffect.Techniques[globalLightTechnique];\n\t\t\tparameters.Camera.SetParameters(Renderer.globalLightEffect);\n\t\t\tthis.lightingManager.SetGlobalLightParameters(Renderer.globalLightEffect, parameters.Camera, originalCameraPosition);\n\t\t\tRenderer.globalLightEffect.Parameters[\"Materials\"].SetValue(parameters.MaterialData);\n\t\t\tthis.sources3[0] = this.depthBuffer;\n\t\t\tthis.sources3[1] = this.normalBuffer;\n\t\t\tthis.sources3[2] = this.colorBuffer1;\n\t\t\tthis.destinations2[0] = this.lightingBuffer;\n\t\t\tthis.destinations2[1] = this.specularBuffer;\n\t\t\tthis.setTargetParameters(this.sources3, this.destinations2, Renderer.globalLightEffect);\n\t\t\tthis.applyEffect(Renderer.globalLightEffect);\n\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\n\t\t\t// Spot and point lights\n\t\t\tif (!parameters.ReverseCullOrder)\n\t\t\t\tthis.main.GraphicsDevice.RasterizerState = this.reverseCullState;\n\n\t\t\t// HACK\n\t\t\t// Increase the far plane to prevent clipping back faces of huge lights\n\t\t\tfloat originalFarPlane = parameters.Camera.FarPlaneDistance;\n\t\t\tparameters.Camera.FarPlaneDistance.Value *= 4.0f;\n\t\t\tparameters.Camera.SetParameters(Renderer.pointLightEffect);\n\t\t\tparameters.Camera.SetParameters(Renderer.spotLightEffect);\n\t\t\tparameters.Camera.FarPlaneDistance.Value = originalFarPlane;\n\n\t\t\t// Spot lights\n\t\t\tRenderer.spotLightEffect.Parameters[\"Materials\"].SetValue(parameters.MaterialData);\n\t\t\tthis.setTargetParameters(this.sources3, this.destinations2, Renderer.spotLightEffect);\n\t\t\tfor (int i = 0; i < SpotLight.All.Count; i++)\n\t\t\t{\n\t\t\t\tSpotLight light = SpotLight.All[i];\n\t\t\t\tif (!light.Enabled || light.Suspended || light.Attenuation == 0.0f || light.Color.Value.LengthSquared() == 0.0f || !originalBoundingFrustum.Intersects(light.BoundingFrustum))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tthis.lightingManager.SetSpotLightParameters(light, Renderer.spotLightEffect, originalCameraPosition);\n\t\t\t\tthis.applyEffect(Renderer.spotLightEffect);\n\t\t\t\tthis.drawModel(Renderer.spotLightModel);\n\t\t\t}\n\n\t\t\t// Point lights\n\t\t\tRenderer.pointLightEffect.Parameters[\"Materials\"].SetValue(parameters.MaterialData);\n\t\t\tthis.setTargetParameters(this.sources3, this.destinations2, Renderer.pointLightEffect);\n\t\t\tfor (int i = 0; i < PointLight.All.Count; i++)\n\t\t\t{\n\t\t\t\tPointLight light = PointLight.All[i];\n\t\t\t\tif (!light.Enabled || light.Suspended || light.Attenuation == 0.0f || light.Color.Value.LengthSquared() == 0.0f || !originalBoundingFrustum.Intersects(light.BoundingSphere))\n\t\t\t\t\tcontinue;\n\t\t\t\tthis.lightingManager.SetPointLightParameters(light, Renderer.pointLightEffect, originalCameraPosition);\n\t\t\t\tthis.applyEffect(Renderer.pointLightEffect);\n\t\t\t\tthis.drawModel(Renderer.pointLightModel);\n\t\t\t}\n\n\t\t\tif (!parameters.ReverseCullOrder)\n\t\t\t\tthis.main.GraphicsDevice.RasterizerState = originalState;\n\n\t\t\tRenderTarget2D colorSource = this.colorBuffer1;\n\t\t\tRenderTarget2D colorDestination = this.hdrBuffer2;\n\t\t\tRenderTarget2D colorTemp = null;\n\n\t\t\t// Compositing\n\t\t\tthis.compositeEffect.CurrentTechnique = this.compositeEffect.Techniques[enableSSAO ? \"CompositeSSAO\" : \"Composite\"];\n\t\t\tthis.lightingManager.SetCompositeParameters(this.compositeEffect);\n\t\t\tparameters.Camera.SetParameters(this.compositeEffect);\n\t\t\tthis.compositeEffect.Parameters[\"Materials\"].SetValue(parameters.MaterialData);\n\t\t\tRenderTarget2D[] compositeSources;\n\t\t\tif (enableSSAO)\n\t\t\t{\n\t\t\t\tcompositeSources = this.sources4;\n\t\t\t\tcompositeSources[3] = this.halfBuffer2;\n\t\t\t}\n\t\t\telse\n\t\t\t\tcompositeSources = this.sources3;\n\n\t\t\tcompositeSources[0] = colorSource;\n\t\t\tcompositeSources[1] = this.lightingBuffer;\n\t\t\tcompositeSources[2] = this.specularBuffer;\n\n\t\t\tthis.destinations1[0] = colorDestination;\n\n\t\t\tif (!this.preparePostProcess(compositeSources, this.destinations1, this.compositeEffect))\n\t\t\t\treturn;\n\n\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\n\t\t\tbool enableBloom = this.allowBloom && this.EnableBloom;\n\t\t\tbool enableMotionBlur = this.MotionBlurAmount > 0.0f;\n#if VR\n\t\t\tif (this.main.VR)\n\t\t\t\tenableMotionBlur = false;\n#endif\n\n\t\t\tbool enableBlur = this.BlurAmount > 0.0f;\n\n\t\t\t// Swap the color buffers\n\t\t\tcolorSource = this.hdrBuffer2;\n\t\t\tcolorDestination = enableBloom || this.allowToneMapping || enableBlur || enableMotionBlur ? this.hdrBuffer1 : result;\n\n\t\t\tparameters.DepthBuffer = this.depthBuffer;\n\t\t\tparameters.FrameBuffer = colorSource;\n\n\t\t\t// Alpha components\n\n\t\t\t// Drawing to the color destination\n\t\t\tthis.destinations1[0] = colorDestination;\n\t\t\tif (!this.setTargets(this.destinations1))\n\t\t\t\treturn;\n\n\t\t\t// Copy the color source to the destination\n\t\t\tthis.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque, SamplerState.PointClamp, DepthStencilState.None, originalState);\n\t\t\tthis.spriteBatch.Draw(colorSource, Vector2.Zero, Color.White);\n\t\t\tthis.spriteBatch.End();\n\n\t\t\tparameters.Camera.Position.Value = originalCameraPosition;\n\t\t\tparameters.Camera.View.Value = originalViewMatrix;\n\n\t\t\tthis.main.DrawAlphaComponents(parameters);\n\t\t\tthis.main.DrawPostAlphaComponents(parameters);\n\n\t\t\t// Swap the color buffers\n\t\t\tcolorTemp = colorDestination;\n\t\t\tcolorDestination = colorSource;\n\t\t\tparameters.FrameBuffer = colorSource = colorTemp;\n\n\t\t\t// Bloom\n\t\t\tif (enableBloom)\n\t\t\t{\n\t\t\t\tthis.bloomEffect.CurrentTechnique = this.bloomEffect.Techniques[\"Downsample\"];\n\t\t\t\tthis.sources1[0] = colorSource;\n\t\t\t\tthis.destinations1[0] = this.halfBuffer1;\n\t\t\t\tif (!this.preparePostProcess(this.sources1, this.destinations1, this.bloomEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\n\t\t\t\tthis.bloomEffect.CurrentTechnique = this.bloomEffect.Techniques[\"BlurHorizontal\"];\n\t\t\t\tthis.sources1[0] = this.halfBuffer1;\n\t\t\t\tthis.destinations1[0] = this.halfBuffer2;\n\t\t\t\tif (!this.preparePostProcess(this.sources1, this.destinations1, this.bloomEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\n\t\t\t\tthis.bloomEffect.CurrentTechnique = this.bloomEffect.Techniques[\"BlurVertical\"];\n\t\t\t\tthis.sources1[0] = this.halfBuffer2;\n\t\t\t\tthis.destinations1[0] = this.halfBuffer1;\n\t\t\t\tif (!this.preparePostProcess(this.sources1, this.destinations1, this.bloomEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\n\t\t\t\tthis.bloomEffect.CurrentTechnique = this.bloomEffect.Techniques[\"Composite\"];\n\t\t\t\tthis.sources2[0] = colorSource;\n\t\t\t\tthis.sources2[1] = this.halfBuffer1;\n\t\t\t\tthis.destinations1[0] = enableBlur || enableMotionBlur ? this.colorBuffer2 : result;\n\t\t\t\tif (!this.preparePostProcess(this.sources2, this.destinations1, this.bloomEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\n\t\t\t\t// Swap the color buffers\n\t\t\t\tcolorDestination = this.colorBuffer1;\n\t\t\t\tcolorSource = this.colorBuffer2;\n\t\t\t}\n\t\t\telse if (this.allowToneMapping)\n\t\t\t{\n\t\t\t\tthis.bloomEffect.CurrentTechnique = this.bloomEffect.Techniques[\"ToneMapOnly\"];\n\t\t\t\tthis.sources1[0] = colorSource;\n\t\t\t\tthis.destinations1[0] = enableBlur || enableMotionBlur ? this.colorBuffer2 : result;\n\t\t\t\tif (!this.preparePostProcess(this.sources1, this.destinations1, this.bloomEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\n\t\t\t\t// Swap the color buffers\n\t\t\t\tcolorDestination = this.colorBuffer1;\n\t\t\t\tcolorSource = this.colorBuffer2;\n\t\t\t}\n\n\t\t\t// Motion blur\n\t\t\tif (enableMotionBlur)\n\t\t\t{\n\t\t\t\tthis.motionBlurEffect.CurrentTechnique = this.motionBlurEffect.Techniques[\"MotionBlur\"];\n\t\t\t\tparameters.Camera.SetParameters(this.motionBlurEffect);\n\n\t\t\t\t// If we just reallocated our buffers, don't use the velocity buffer from the last frame because it will be empty\n\t\t\t\tthis.sources3[0] = colorSource;\n\t\t\t\tthis.sources3[1] = this.normalBuffer;\n\t\t\t\tthis.sources3[2] = this.justReallocatedBuffers ? this.normalBuffer : this.normalBufferLastFrame;\n\t\t\t\tthis.destinations1[0] = enableBlur ? colorDestination : result;\n\t\t\t\tif (!this.preparePostProcess(this.sources3, this.destinations1, this.motionBlurEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\n\t\t\t\t// Swap the velocity buffers\n\t\t\t\tRenderTarget2D temp = this.normalBufferLastFrame;\n\t\t\t\tthis.normalBufferLastFrame = this.normalBuffer;\n\t\t\t\tthis.normalBuffer = temp;\n\n\t\t\t\t// Swap the color buffers\n\t\t\t\tcolorTemp = colorDestination;\n\t\t\t\tcolorDestination = colorSource;\n\t\t\t\tcolorSource = colorTemp;\n\t\t\t}\n\n\t\t\tif (enableBlur)\n\t\t\t{\n\t\t\t\t// Blur\n\t\t\t\tthis.blurEffect.CurrentTechnique = this.blurEffect.Techniques[\"BlurHorizontal\"];\n\t\t\t\tparameters.Camera.SetParameters(this.blurEffect);\n\t\t\t\tthis.sources1[0] = colorSource;\n\t\t\t\tthis.destinations1[0] = colorDestination;\n\t\t\t\tif (!this.preparePostProcess(this.sources1, this.destinations1, this.blurEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\t\t\t\tthis.blurEffect.CurrentTechnique = this.blurEffect.Techniques[\"Composite\"];\n\n\t\t\t\t// Swap the color buffers\n\t\t\t\tcolorTemp = colorDestination;\n\t\t\t\tcolorDestination = colorSource;\n\t\t\t\tcolorSource = colorTemp;\n\n\t\t\t\tthis.sources1[0] = colorSource;\n\t\t\t\tthis.destinations1[0] = result;\n\t\t\t\tif (!this.preparePostProcess(this.sources1, this.destinations1, this.blurEffect))\n\t\t\t\t\treturn;\n\t\t\t\tRenderer.quad.DrawAlpha(this.main.GameTime, RenderParameters.Default);\n\t\t\t}\n\n\t\t\tparameters.DepthBuffer = null;\n\t\t\tparameters.FrameBuffer = null;\n\n\t\t\tthis.justReallocatedBuffers = false;\n\t\t}\n\n\t\tprivate void drawModel(Microsoft.Xna.Framework.Graphics.Model model)\n\t\t{\n\t\t\tfor (int i = 0; i < model.Meshes.Count; i++)\n\t\t\t{\n\t\t\t\tModelMesh mesh = model.Meshes[i];\n\t\t\t\tfor (int j = 0; j < mesh.MeshParts.Count; j++)\n\t\t\t\t{\n\t\t\t\t\tModelMeshPart part = mesh.MeshParts[j];\n\t\t\t\t\tif (part.NumVertices > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.main.GraphicsDevice.SetVertexBuffer(part.VertexBuffer);\n\t\t\t\t\t\tthis.main.GraphicsDevice.Indices = part.IndexBuffer;\n\t\t\t\t\t\tthis.main.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, part.NumVertices, part.StartIndex, part.PrimitiveCount);\n\t\t\t\t\t\tModel.DrawCallCounter++;\n\t\t\t\t\t\tModel.TriangleCounter += part.PrimitiveCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate RenderTargetBinding[] bindingsCache = new RenderTargetBinding[2];\n\t\tprivate bool setTargets(RenderTarget2D[] results)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (results == null)\n\t\t\t\t{\n\t\t\t\t\tthis.main.GraphicsDevice.SetRenderTarget(null);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if (results.Length == 1)\n\t\t\t\t{\n\t\t\t\t\tif (results[0] != null && results[0].IsDisposed)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tthis.main.GraphicsDevice.SetRenderTarget(results[0]);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if (results.Length == 2)\n\t\t\t\t{\n\t\t\t\t\tif (results[0].IsDisposed || results[1].IsDisposed)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tthis.bindingsCache[0] = results[0];\n\t\t\t\t\tthis.bindingsCache[1] = results[1];\n\t\t\t\t\tthis.main.GraphicsDevice.SetRenderTargets(this.bindingsCache);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthrow new Exception(\"Divide by cucumber error. Please reboot universe.\");\n\t\t\t}\n\t\t\tcatch (ObjectDisposedException)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tprivate bool preparePostProcess(RenderTarget2D[] sources, RenderTarget2D[] results, Effect effect)\n\t\t{\n\t\t\tif (!this.setTargets(results))\n\t\t\t\treturn false;\n\t\t\tthis.setTargetParameters(sources, results, effect);\n\t\t\tthis.applyEffect(effect);\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate void setTargetParameters(RenderTarget2D[] sources, RenderTarget2D[] results, Effect effect)\n\t\t{\n\t\t\tEffectParameter param;\n\t\t\tfor (int i = 0; i < sources.Length; i++)\n\t\t\t{\n\t\t\t\tparam = effect.Parameters[paramSourceSamplers[i]];\n\t\t\t\tif (param == null)\n\t\t\t\t\tbreak;\n\t\t\t\tparam.SetValue(sources[i]);\n\t\t\t\tparam = effect.Parameters[paramSourceDimensions[i]];\n\t\t\t\tif (param != null)\n\t\t\t\t\tparam.SetValue(new Vector2(sources[i].Width, sources[i].Height));\n\t\t\t}\n\t\t\tparam = effect.Parameters[\"DestinationDimensions\"];\n\t\t\tif (param != null)\n\t\t\t{\n\t\t\t\tif (results == null || results.Length == 0 || results[0] == null)\n\t\t\t\t\tparam.SetValue(new Vector2(this.screenSize.X, this.screenSize.Y));\n\t\t\t\telse\n\t\t\t\t\tparam.SetValue(new Vector2(results[0].Width, results[0].Height));\n\t\t\t}\n\t\t}\n\n\t\tprivate void applyEffect(Effect effect)\n\t\t{\n\t\t\teffect.CurrentTechnique.Passes[0].Apply();\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tthis.lightingBuffer.Dispose();\n\t\t\tthis.normalBuffer.Dispose();\n\t\t\tthis.normalBufferLastFrame.Dispose();\n\t\t\tthis.depthBuffer.Dispose();\n\t\t\tthis.colorBuffer1.Dispose();\n\t\t\tthis.colorBuffer2.Dispose();\n\t\t\tif (this.hdr)\n\t\t\t{\n\t\t\t\tthis.hdrBuffer1.Dispose();\n\t\t\t\tthis.hdrBuffer2.Dispose();\n\t\t\t}\n\t\t\tthis.specularBuffer.Dispose();\n\n\t\t\tthis.compositeEffect.Dispose();\n\t\t\tthis.blurEffect.Dispose();\n\t\t\tthis.clearEffect.Dispose();\n\n\t\t\tif (this.motionBlurEffect != null)\n\t\t\t\tthis.motionBlurEffect.Dispose();\n\n\t\t\tif (this.halfDepthBuffer != null)\n\t\t\t\tthis.halfDepthBuffer.Dispose();\n\t\t\tif (this.halfBuffer1 != null)\n\t\t\t\tthis.halfBuffer1.Dispose();\n\t\t\tif (this.halfBuffer2 != null)\n\t\t\t\tthis.halfBuffer2.Dispose();\n\n\t\t\tif (this.bloomEffect != null)\n\t\t\t\tthis.bloomEffect.Dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Graphics/SpotLight.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class SpotLight : Component<Main>\n\t{\n\t\tpublic static readonly List<SpotLight> All = new List<SpotLight>();\n\n\t\tpublic Property<Vector3> Color = new Property<Vector3> { Value = Vector3.One };\n\t\tpublic Property<Quaternion> Orientation = new Property<Quaternion>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<bool> Shadowed = new Property<bool> { Value = true };\n\t\tpublic Property<float> FieldOfView = new Property<float> { Value = (float)Math.PI * 0.25f };\n\t\tpublic Property<float> Attenuation = new Property<float> { Value = 10.0f };\n\n\t\tprivate BoundingFrustum frustum = new BoundingFrustum(Matrix.Identity);\n\t\t[XmlIgnore]\n\t\tpublic BoundingFrustum BoundingFrustum\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tthis.frustum.Matrix = this.ViewProjection;\n\t\t\t\treturn this.frustum;\n\t\t\t}\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> ViewProjection = new Property<Matrix>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> View = new Property<Matrix>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> Projection = new Property<Matrix>();\n\n\t\tpublic Property<string> CookieTextureFile = new Property<string> { Value = \"Cookies\\\\default\" };\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Texture2D> CookieTexture = new Property<Texture2D>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new SetBinding<float>(this.FieldOfView, delegate(float value)\n\t\t\t{\n\t\t\t\tif (value < 0.01f || value > (float)Math.PI - 0.01f)\n\t\t\t\t\tthis.FieldOfView.Value = Math.Max(0.01f, Math.Min((float)Math.PI - 0.01f, value));\n\t\t\t}));\n\n\t\t\tthis.Add(new Binding<Matrix>(this.View, delegate()\n\t\t\t{\n\t\t\t\treturn Matrix.Invert(Matrix.CreateFromQuaternion(this.Orientation) * Matrix.CreateTranslation(this.Position));\n\t\t\t},\n\t\t\tthis.Position, this.Orientation));\n\n\t\t\tthis.Add(new Binding<Matrix>(this.Projection, delegate()\n\t\t\t{\n\t\t\t\treturn Matrix.CreatePerspectiveFieldOfView(this.FieldOfView, 1.0f, 1.0f, Math.Max(2.0f, this.Attenuation));\n\t\t\t},\n\t\t\tthis.Attenuation, this.FieldOfView));\n\n\t\t\tthis.Add(new Binding<Matrix>(this.ViewProjection, delegate()\n\t\t\t{\n\t\t\t\treturn this.View.Value * this.Projection;\n\t\t\t}, this.View, this.Projection));\n\n\t\t\tthis.Add(new Binding<Texture2D, string>(this.CookieTexture, delegate(string value)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this.main.MapContent.Load<Texture2D>(value);\n\t\t\t\t\t}\n\t\t\t\t\tcatch\n\t\t\t\t\t{\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}, this.CookieTextureFile));\n\n\t\t\tSpotLight.All.Add(this);\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tSpotLight.All.Remove(this);\n\t\t}\n\n\t\tpublic void LoadContent(bool reload)\n\t\t{\n\t\t\tif (reload)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tthis.CookieTexture.Value = this.main.MapContent.Load<Texture2D>(this.CookieTextureFile);\n\t\t\t\t}\n\t\t\t\tcatch (Exception)\n\t\t\t\t{\n\t\t\t\t\tthis.CookieTexture.Value = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/IO/FPSInput.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Input;\nusing Lemma.Util;\n\nnamespace Lemma.Components\n{\n\tpublic class FPSInput : PCInput\n\t{\n\t\tpublic Property<Vector2> Movement = new Property<Vector2> { };\n\n\t\tpublic Property<PCInputBinding> ForwardKey = new Property<PCInputBinding> { Value = new PCInputBinding { Key = Keys.W } };\n\t\tpublic Property<PCInputBinding> BackwardKey = new Property<PCInputBinding> { Value = new PCInputBinding { Key = Keys.S } };\n\t\tpublic Property<PCInputBinding> LeftKey = new Property<PCInputBinding> { Value = new PCInputBinding { Key = Keys.A } };\n\t\tpublic Property<PCInputBinding> RightKey = new Property<PCInputBinding> { Value = new PCInputBinding { Key = Keys.D } };\n\t\t\n\t\tpublic Property<float> MinX = new Property<float> { };\n\t\tpublic Property<float> MaxX = new Property<float> { };\n\t\tpublic Property<float> MinY = new Property<float> { Value = (float)Math.PI * -0.5f };\n\t\tpublic Property<float> MaxY = new Property<float> { Value = (float)Math.PI * 0.5f };\n\n\t\tconst float sensitivityMultiplier = 0.002f;\n\t\tconst float gamePadSensitivityMultiplier = -3.0f;\n\t\tpublic Property<bool> EnableLook = new Property<bool> { Value = true };\n\t\tpublic Property<bool> EnableMovement = new Property<bool> { Value = true };\n\n\t\tpublic Property<float> MouseSensitivity = new Property<float> { Value = 1.0f };\n\t\tpublic Property<bool> InvertMouseX = new Property<bool> { Value = false };\n\t\tpublic Property<bool> InvertMouseY = new Property<bool> { Value = false };\n\n\t\tpublic static readonly Point MouseCenter = new Point(400, 400);\n\n\t\tpublic static void RecenterMouse()\n\t\t{\n\t\t\tMicrosoft.Xna.Framework.Input.Mouse.SetPosition(FPSInput.MouseCenter.X, FPSInput.MouseCenter.Y);\n\t\t}\n\n\t\tpublic void ResetLook(Vector2 value)\n\t\t{\n\t\t\tthis.lastMouseLook = value;\n\t\t}\n\n\t\tprivate void enableLook()\n\t\t{\n\t\t\tthis.Mouse.Value = this.lastMouseLook;\n\t\t\tFPSInput.RecenterMouse();\n\t\t\tMouseState oldState = this.main.MouseState;\n\t\t\tthis.lastMouseNonLook = new Vector2(oldState.X, oldState.Y);\n\t\t\tthis.main.MouseState.Value = new MouseState(FPSInput.MouseCenter.X, FPSInput.MouseCenter.Y, oldState.ScrollWheelValue, oldState.LeftButton, oldState.MiddleButton, oldState.RightButton, oldState.XButton1, oldState.XButton2);\n\t\t}\n\n\t\tprotected Vector2 lastMouseLook, lastMouseNonLook;\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new CommandBinding(this.Enable, delegate()\n\t\t\t{\n\t\t\t\tif (this.EnableLook)\n\t\t\t\t\tthis.enableLook();\n\t\t\t}));\n\t\t\tthis.Add(new CommandBinding(this.Disable, delegate()\n\t\t\t{\n\t\t\t\tif (this.EnableLook)\n\t\t\t\t\tthis.lastMouseLook = this.Mouse;\n\t\t\t\tif (!this.Movement.Value.Equals(Vector2.Zero))\n\t\t\t\t\tthis.Movement.Value = Vector2.Zero;\n\t\t\t}));\n\t\t\tthis.Add(new ChangeBinding<bool>(this.EnableLook, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (value && !old)\n\t\t\t\t\tthis.enableLook();\n\t\t\t\telse if (!value && old)\n\t\t\t\t{\n\t\t\t\t\tthis.lastMouseLook = this.Mouse;\n\t\t\t\t\tMicrosoft.Xna.Framework.Input.Mouse.SetPosition((int)this.lastMouseNonLook.X, (int)this.lastMouseNonLook.Y);\n\t\t\t\t\tif (this.EnableMouse)\n\t\t\t\t\t\tthis.Mouse.Value = this.lastMouseNonLook;\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.MinX, delegate(float value)\n\t\t\t{\n\t\t\t\tfloat v = value.ToAngleRange();\n\t\t\t\tif (v != value)\n\t\t\t\t\tthis.MinX.Value = v;\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.MaxX, delegate(float value)\n\t\t\t{\n\t\t\t\tfloat v = value.ToAngleRange();\n\t\t\t\tif (v != value)\n\t\t\t\t\tthis.MaxX.Value = v;\n\t\t\t}));\n\t\t\tthis.Add(new SetBinding<float>(this.MinY, delegate(float value)\n\t\t\t{\n\t\t\t\tfloat v = value.ToAngleRange();\n\t\t\t\tif (v != value)\n\t\t\t\t\tthis.MinY.Value = v;\n\t\t\t}));\n\t\t\tthis.Add(new SetBinding<float>(this.MaxY, delegate(float value)\n\t\t\t{\n\t\t\t\tfloat v = value.ToAngleRange();\n\t\t\t\tif (v != value)\n\t\t\t\t\tthis.MaxY.Value = v;\n\t\t\t}));\n\t\t}\n\n\t\tpublic override void Update(float elapsedTime)\n\t\t{\n\t\t\tbase.Update(elapsedTime); // Calls handleMouse()\n\n\t\t\tif (!this.main.IsActive || !this.Enabled)\n\t\t\t\treturn;\n\n\t\t\tif (this.EnableMovement)\n\t\t\t{\n\t\t\t\tKeyboardState keyboard = this.main.KeyboardState;\n\t\t\t\tfloat x = this.GetInput(this.LeftKey) ? -1.0f : (this.GetInput(this.RightKey) ? 1.0f : 0.0f);\n\t\t\t\tfloat y = this.GetInput(this.BackwardKey) ? -1.0f : (this.GetInput(this.ForwardKey) ? 1.0f : 0.0f);\n\n\t\t\t\tVector2 newMovement = new Vector2(x, y);\n\n\t\t\t\tGamePadState gamePad = this.main.GamePadState;\n\t\t\t\tif (gamePad.IsConnected)\n\t\t\t\t\tnewMovement += gamePad.ThumbSticks.Left;\n\n\t\t\t\tfloat movementAmount = newMovement.Length();\n\t\t\t\tif (movementAmount > 1)\n\t\t\t\t\tnewMovement /= movementAmount;\n\n\t\t\t\tif (!this.Movement.Value.Equals(newMovement))\n\t\t\t\t\tthis.Movement.Value = newMovement;\n\t\t\t}\n\t\t\telse if (!this.Movement.Value.Equals(Vector2.Zero))\n\t\t\t\tthis.Movement.Value = Vector2.Zero;\n\t\t}\n\n\t\tprotected override void handleMouse()\n\t\t{\n\t\t\tif (this.EnableLook)\n\t\t\t{\n\t\t\t\tif (this.main.IsActive && this.main.LastActive)\n\t\t\t\t{\n\t\t\t\t\tMouseState mouse = this.main.MouseState;\n\n\t\t\t\t\tVector2 mouseMovement = new Vector2(FPSInput.MouseCenter.X - mouse.X, mouse.Y - FPSInput.MouseCenter.Y) * this.MouseSensitivity * FPSInput.sensitivityMultiplier;\n\n\t\t\t\t\tGamePadState gamePad = this.main.GamePadState;\n\t\t\t\t\tif (gamePad.IsConnected)\n\t\t\t\t\t\tmouseMovement += gamePad.ThumbSticks.Right * this.MouseSensitivity * FPSInput.gamePadSensitivityMultiplier * this.main.ElapsedTime;\n\n\t\t\t\t\tif (this.InvertMouseX)\n\t\t\t\t\t\tmouseMovement.X *= -1;\n\t\t\t\t\tif (this.InvertMouseY)\n\t\t\t\t\t\tmouseMovement.Y *= -1;\n\n\t\t\t\t\tif (mouseMovement.LengthSquared() > 0.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector2 newValue = this.Mouse.Value + mouseMovement;\n\n\t\t\t\t\t\tnewValue.X = newValue.X.ToAngleRange();\n\t\t\t\t\t\tnewValue.Y = newValue.Y.ToAngleRange();\n\n\t\t\t\t\t\tfloat minX = this.MinX, maxX = this.MaxX, minY = this.MinY, maxY = this.MaxY;\n\n\t\t\t\t\t\tconst float pi = (float)Math.PI;\n\n\t\t\t\t\t\tif (!(minX == 0 && maxX == 0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat tempX = minX;\n\t\t\t\t\t\t\tminX = Math.Min(minX, maxX);\n\t\t\t\t\t\t\tmaxX = Math.Max(tempX, maxX);\n\n\t\t\t\t\t\t\tif (Math.Abs(minX + pi) + Math.Abs(maxX - pi) < Math.Abs(minX) + Math.Abs(maxX))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (newValue.X < 0 && newValue.X > minX)\n\t\t\t\t\t\t\t\t\tnewValue.X = minX;\n\t\t\t\t\t\t\t\tif (newValue.X > 0 && newValue.X < maxX)\n\t\t\t\t\t\t\t\t\tnewValue.X = maxX;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tnewValue.X = Math.Min(maxX, Math.Max(minX, newValue.X));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfloat tempY = minY;\n\t\t\t\t\t\tminY = Math.Min(minY, maxY);\n\t\t\t\t\t\tmaxY = Math.Max(tempY, maxY);\n\n\t\t\t\t\t\tif (minY < 0 && maxY > 0 && Math.Abs(minY + pi) + Math.Abs(maxY - pi) < Math.Abs(minY) + Math.Abs(maxY))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (newValue.Y < 0 && newValue.Y > minY)\n\t\t\t\t\t\t\t\tnewValue.Y = minY;\n\t\t\t\t\t\t\tif (newValue.Y > 0 && newValue.Y < maxY)\n\t\t\t\t\t\t\t\tnewValue.Y = maxY;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnewValue.Y = Math.Min(maxY, Math.Max(minY, newValue.Y));\n\n\t\t\t\t\t\tthis.Mouse.Value = newValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tFPSInput.RecenterMouse();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbase.handleMouse();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/IO/MapLoader.cs",
    "content": "﻿using System;\nusing System.Linq.Expressions;\nusing BEPUphysics.UpdateableSystems.ForceFields;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing System.Linq;\nusing ICSharpCode.SharpZipLib.Zip;\nusing Microsoft.Xna.Framework;\nusing System.Reflection;\nusing System.IO.IsolatedStorage;\nusing Lemma.Components;\nusing System.Xml.Serialization;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing ICSharpCode.SharpZipLib.GZip;\n\nnamespace Lemma.IO\n{\n\tpublic class MapLoader\n\t{\n\t\tpublic const string MapDirectory = \"Game\";\n\t\tpublic const string MapExtension = \".map\";\n\n\t\tprivate static string[] persistentTypes = new[] { \"PlayerData\", };\n\n\t\tprivate static bool entityIsPersistent(Entity entity)\n\t\t{\n\t\t\treturn MapLoader.persistentTypes.Contains(entity.Type);\n\t\t}\n\n\t\tpublic static Type[] IncludedTypes = new[]\n\t\t{\n\t\t\ttypeof(PlayerTrigger),\n\t\t\ttypeof(Trigger),\n\t\t\ttypeof(PlayerCylinderTrigger),\n\t\t\ttypeof(Voxel),\n\t\t\ttypeof(DynamicVoxel),\n\t\t\ttypeof(PlayerSpawn),\n\t\t\ttypeof(Timer),\n\t\t\ttypeof(Model),\n\t\t\ttypeof(AnimatedModel),\n\t\t\ttypeof(Water),\n\t\t\ttypeof(TextElement),\n\t\t\ttypeof(AmbientLight),\n\t\t\ttypeof(DirectionalLight),\n\t\t\ttypeof(PointLight),\n\t\t\ttypeof(SpotLight),\n\t\t\ttypeof(Script),\n\t\t\ttypeof(ModelInstance),\n\t\t\ttypeof(Zone),\n\t\t\ttypeof(PhysicsBlock),\n\t\t\ttypeof(Player),\n\t\t\ttypeof(ParticleEmitter),\n\t\t\ttypeof(PhysicsSphere),\n\t\t\ttypeof(ModelAlpha),\n\t\t\ttypeof(EnemyBase),\n\t\t\ttypeof(Agent),\n\t\t\ttypeof(AI),\n\t\t\ttypeof(PID),\n\t\t\ttypeof(PID3),\n\t\t\ttypeof(RespawnLocation),\n\t\t\ttypeof(ListProperty<RespawnLocation>),\n\t\t\ttypeof(Property<RespawnLocation>),\n\t\t\ttypeof(VoxelChaseAI),\n\t\t\ttypeof(Phone),\n\t\t\ttypeof(RaycastAI),\n\t\t\ttypeof(SignalTower),\n\t\t\ttypeof(Property<int>),\n\t\t\ttypeof(Property<int>),\n\t\t\ttypeof(Property<float>),\n\t\t\ttypeof(Property<Direction>),\n\t\t\ttypeof(Property<UInt32>),\n\t\t\ttypeof(Propagator),\n\t\t\ttypeof(RotationController),\n\t\t\ttypeof(PlayerData),\n\t\t\ttypeof(Rift),\n\t\t\ttypeof(Collectible),\n\t\t\ttypeof(CameraStop),\n\t\t\ttypeof(AmbientSound),\n\t\t\ttypeof(Sound),\n\t\t\ttypeof(Counter),\n\t\t\ttypeof(Ticker),\n\t\t\ttypeof(RandomTicker),\n\t\t\ttypeof(Setter),\n\t\t\ttypeof(AnimatedSetter),\n\t\t\ttypeof(World),\n\t\t\ttypeof(Note),\n\t\t\ttypeof(VoxelAttachable),\n\t\t\ttypeof(Cloud),\n\t\t\ttypeof(DialogueFile),\n\t\t\ttypeof(EffectBlock),\n\t\t\ttypeof(BlockCloud),\n\t\t\ttypeof(SceneryBlock),\n\t\t\ttypeof(FallingTower),\n\t\t\ttypeof(Joint),\n\t\t\ttypeof(Slider),\n\t\t\ttypeof(Spinner),\n\t\t\ttypeof(Levitator),\n\t\t\ttypeof(RaycastAIMovement),\n\t\t\ttypeof(Exploder),\n\t\t\ttypeof(MapExit),\n\t\t\ttypeof(ImplodeBlock),\n\t\t\ttypeof(TimeTrial),\n\t\t\ttypeof(Rain),\n\t\t\ttypeof(Rotator),\n\t\t\ttypeof(Skybox),\n\t\t\ttypeof(Smoke),\n\t\t\ttypeof(Snake),\n\t\t\ttypeof(Switch),\n\t\t\ttypeof(Turret),\n\t\t\ttypeof(VoxelFill),\n\t\t\ttypeof(Data),\n\t\t\ttypeof(Starter),\n\t\t\ttypeof(Explosion),\n\t\t\ttypeof(Lemma.Components.Binder),\n\t\t\ttypeof(Constant),\n\t\t\ttypeof(MessageDisplayer),\n\t\t\ttypeof(ParticleWind),\n\t\t\ttypeof(VoxelSetter),\n\t\t\ttypeof(ConsoleCommand),\n\t\t\ttypeof(SliderCommon),\n\t\t\ttypeof(StaticSlider),\n\t\t\ttypeof(AnimatedProp),\n\t\t\ttypeof(PowerBlockSocket),\n\t\t\ttypeof(Sequence),\n\t\t\ttypeof(Updater),\n\t\t\ttypeof(LogicGate),\n\t\t\ttypeof(Bouncer),\n\t\t\ttypeof(VoxelTrigger),\n\t\t\ttypeof(Block),\n\t\t\ttypeof(SoundBank),\n\t\t};\n\n\t\tpublic static XmlSerializer Serializer;\n\n\t\tstatic MapLoader()\n\t\t{\n\t\t\tMapLoader.Serializer = new XmlSerializer(typeof(List<Entity>), MapLoader.IncludedTypes);\n\t\t}\n\n\t\tpublic static void LoadKeepEditor(Main main, string filename)\n\t\t{\n\t\t\tMapLoader.load(main, filename, false, null);\n\t\t}\n\n\t\tpublic static void Load(Main main, string filename)\n\t\t{\n\t\t\tMapLoader.load(main, filename, true, null);\n\t\t}\n\n\t\tpublic static void Load(Main main, string filename, Entity playerData)\n\t\t{\n\t\t\tMapLoader.load(main, filename, true, playerData);\n\t\t}\n\n\t\tprivate static void load(Main main, string filename, bool deleteEditor, Entity playerData)\n\t\t{\n\t\t\tif (filename == null)\n\t\t\t\tMapLoader.load(main, (Stream)null, deleteEditor, playerData);\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Don't try to load the menu from a save game\n\t\t\t\tstring directory;\n\t\t\t\tif (main.CurrentSave.Value == null || filename == Main.MenuMap)\n\t\t\t\t\tdirectory = main.MapDirectory;\n\t\t\t\telse\n\t\t\t\t\tdirectory = Path.Combine(main.SaveDirectory, main.CurrentSave);\n\n\t\t\t\tstring filenameWithExtension = filename;\n\t\t\t\tif (!filenameWithExtension.EndsWith(MapLoader.MapExtension))\n\t\t\t\t\tfilenameWithExtension += MapLoader.MapExtension;\n\n\t\t\t\tstring fullFilename = Path.IsPathRooted(filenameWithExtension) ? filenameWithExtension : Path.Combine(directory, filenameWithExtension);\n\n\t\t\t\tif (main.CurrentSave.Value != null && !File.Exists(fullFilename))\n\t\t\t\t\tFile.Copy(Path.Combine(main.MapDirectory, filenameWithExtension), fullFilename);\n\n\t\t\t\tmain.LoadingMap.Execute(filename);\n\n\t\t\t\tmain.MapFile.Value = filename;\n\n\t\t\t\tusing (Stream fs = File.OpenRead(fullFilename))\n\t\t\t\t{\n\t\t\t\t\tusing (Stream stream = new GZipInputStream(fs))\n\t\t\t\t\t\tMapLoader.load(main, stream, deleteEditor, playerData);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static void New(Main main, string filename, string templateMap)\n\t\t{\n\t\t\tmain.LoadingMap.Execute(filename);\n\n\t\t\tmain.MapFile.Value = filename;\n\n\t\t\tif (!filename.EndsWith(MapLoader.MapExtension))\n\t\t\t\tfilename += MapLoader.MapExtension;\n\n\t\t\tmain.ClearEntities(false);\n\n\t\t\tif (!templateMap.EndsWith(MapLoader.MapExtension))\n\t\t\t\ttemplateMap += MapLoader.MapExtension;\n\n\t\t\tusing (Stream fs = File.OpenRead(templateMap))\n\t\t\t{\n\t\t\t\tusing (Stream stream = new GZipInputStream(fs))\n\t\t\t\t\tMapLoader.load(main, stream, false, null);\n\t\t\t}\n\t\t\tWorldFactory.Instance.Get<World>().NewUUID();\n\t\t}\n\n\t\tprivate static void load(Main main, Stream stream, bool deleteEditor, Entity playerData)\n\t\t{\n\t\t\tmain.Camera.Position.Value = new Vector3(0, -1000, 0);\n\t\t\tmain.IsLoadingMap = true;\n\t\t\tmain.ClearEntities(deleteEditor);\n\n\t\t\tif (stream == null)\n\t\t\t\tmain.DefaultLighting(); // There's no World entity to set the correct lighting, so set the defaults\n\t\t\telse\n\t\t\t{\n\t\t\t\tList<Entity> entities = null;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tentities = (List<Entity>)MapLoader.Serializer.Deserialize(stream);\n\t\t\t\t}\n\t\t\t\tcatch (InvalidOperationException e)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"Failed to deserialize file stream.\", e);\n\t\t\t\t}\n\n\t\t\t\tif (playerData != null)\n\t\t\t\t\tentities.Add(playerData);\n\n\t\t\t\tforeach (Entity entity in entities)\n\t\t\t\t{\n\t\t\t\t\tFactory<Main> factory = Factory<Main>.Get(entity.Type);\n\t\t\t\t\tif (factory != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tfactory.Bind(entity, main);\n\t\t\t\t\t\tmain.Add(entity);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmain.IsLoadingMap = false;\n\t\t\tmain.MapLoaded.Execute();\n\t\t}\n\n\t\tpublic static void Save(Main main, string directory, string filename)\n\t\t{\n\t\t\tif (directory == null)\n\t\t\t\tfilename = Path.Combine(main.MapDirectory, filename);\n\t\t\telse\n\t\t\t\tfilename = Path.Combine(directory, Path.GetFileName(filename));\n\n\t\t\tif (!filename.EndsWith(MapLoader.MapExtension))\n\t\t\t\tfilename += MapLoader.MapExtension;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (MemoryStream ms = new MemoryStream())\n\t\t\t\t{\n\t\t\t\t\tMapLoader.Save(main, ms);\n\t\t\t\t\tms.Seek(0, SeekOrigin.Begin);\n\t\t\t\t\tusing (Stream fs = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.None))\n\t\t\t\t\tusing (Stream stream = new GZipOutputStream(fs))\n\t\t\t\t\t\tms.CopyTo(stream);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Failed to save map.\", e);\n\t\t\t}\n\t\t\tGC.Collect();\n\t\t}\n\n\t\tpublic static void Save(Main main, Stream stream)\n\t\t{\n\t\t\tList<Entity> entities = main.Entities.Where(x => x.Serialize && x.Active).ToList();\n\t\t\tMapLoader.Serializer.Serialize(stream, entities);\n\t\t}\n\n\t\tpublic static void LoadWithEntities(Main main, string nextMap, List<Entity> persistentEntities)\n\t\t{\n\t\t\tStream stream = new MemoryStream();\n\t\t\tIO.MapLoader.Serializer.Serialize(stream, persistentEntities);\n\n\t\t\tMapLoader.Load(main, nextMap);\n\n\t\t\tstream.Seek(0, SeekOrigin.Begin);\n\t\t\tList<Entity> entities = (List<Entity>)IO.MapLoader.Serializer.Deserialize(stream);\n\t\t\tforeach (Entity e in entities)\n\t\t\t{\n\t\t\t\tFactory<Main> factory = Factory<Main>.Get(e.Type);\n\t\t\t\te.GUID = 0;\n\t\t\t\tfactory.Bind(e, main);\n\t\t\t\tmain.Add(e);\n\t\t\t}\n\t\t\tstream.Dispose();\n\t\t}\n\n\t\tpublic static void Transition(Main main, string nextMap, string spawn = null)\n\t\t{\n\t\t\tContainer loadingNotification = new Container();\n\t\t\tloadingNotification.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\tloadingNotification.Opacity.Value = UIFactory.Opacity;\n\t\t\tTextElement loadingNotificationText = new TextElement();\n\t\t\tloadingNotificationText.Name.Value = \"Text\";\n\t\t\tloadingNotificationText.FontFile.Value = main.Font;\n\t\t\tloadingNotificationText.Text.Value = \"\\\\loading\";\n\t\t\tloadingNotification.Children.Add(loadingNotificationText);\n\n\t\t\tAnimation anim = new Animation\n\t\t\t(\n\t\t\t\tnew Animation.Set<bool>(main.Menu.CanPause, false),\n\t\t\t\tmain.Spawner.FlashAnimation(),\n\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t{\n\t\t\t\t\tmain.UI.Root.GetChildByName(\"Notifications\").Children.Add(loadingNotification);\n\t\t\t\t}),\n\t\t\t\tnew Animation.Delay(0.01f),\n\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t{\n#if DEMO\n\t\t\t\t\tif (nextMap == \"forest\")\n\t\t\t\t\t{\n\t\t\t\t\t\tmain.Spawner.StartSpawnPoint.Value = \"demo\";\n\t\t\t\t\t\tMapLoader.Load(main, Main.MenuMap);\n\t\t\t\t\t}\n\t\t\t\t\telse\n#endif\n\t\t\t\t\t{\n\t\t\t\t\t\t// We are exiting the map; just save the state of the map without the player.\n\t\t\t\t\t\tListProperty<RespawnLocation> respawnLocations = PlayerDataFactory.Instance.Get<PlayerData>().RespawnLocations;\n\t\t\t\t\t\trespawnLocations.Clear();\n\n\t\t\t\t\t\tList<Entity> persistentEntities = main.Entities.Where((Func<Entity, bool>)MapLoader.entityIsPersistent).ToList();\n\n\t\t\t\t\t\tStream stream = new MemoryStream();\n\t\t\t\t\t\tIO.MapLoader.Serializer.Serialize(stream, persistentEntities);\n\n\t\t\t\t\t\tforeach (Entity e in persistentEntities)\n\t\t\t\t\t\t\te.Delete.Execute();\n\n\t\t\t\t\t\tmain.Spawner.StartSpawnPoint.Value = spawn;\n\n\t\t\t\t\t\tif (PlayerFactory.Instance != null)\n\t\t\t\t\t\t\tPlayerFactory.Instance.Delete.Execute();\n\n\t\t\t\t\t\tmain.SaveCurrentMap(null, default(Point));\n\t\t\t\t\t\tMapLoader.Load(main, nextMap);\n\n\t\t\t\t\t\tstream.Seek(0, SeekOrigin.Begin);\n\t\t\t\t\t\tList<Entity> entities = (List<Entity>)IO.MapLoader.Serializer.Deserialize(stream);\n\t\t\t\t\t\tforeach (Entity e in entities)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tFactory<Main> factory = Factory<Main>.Get(e.Type);\n\t\t\t\t\t\t\te.GUID = 0;\n\t\t\t\t\t\t\tfactory.Bind(e, main);\n\t\t\t\t\t\t\tmain.Add(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstream.Dispose();\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tnew Animation.Delay(0.01f),\n\t\t\t\tnew Animation.Execute(loadingNotification.Delete),\n\t\t\t\tnew Animation.Set<bool>(main.Menu.CanPause, true),\n\t\t\t\tnew Animation.Execute(main.ScheduleSave)\n\t\t\t);\n\t\t\tanim.EnabledWhenPaused = false;\n\t\t\tmain.AddComponent(anim);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/IO/PCInput.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Input;\nusing System.ComponentModel;\nusing Newtonsoft.Json;\n\nnamespace Lemma.Components\n{\n\tpublic class PCInput : ComponentBind.Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic enum MouseButton { None, LeftMouseButton, MiddleMouseButton, RightMouseButton }\n\n\t\tpublic enum InputState { Down, Up }\n\n\t\tpublic struct PCInputBinding\n\t\t{\n\t\t\t[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n\t\t\tpublic Keys Key;\n\t\t\t[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n\t\t\tpublic MouseButton MouseButton;\n\t\t\t[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n\t\t\tpublic Buttons GamePadButton;\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\tstring value = null;\n\t\t\t\tif (this.Key != Keys.None)\n\t\t\t\t\tvalue = \"\\\\\" + this.Key.ToString();\n\t\t\t\telse if (this.MouseButton != PCInput.MouseButton.None)\n\t\t\t\t\tvalue = \"\\\\\" + this.MouseButton.ToString();\n\n\t\t\t\tif (GamePad.GetState(PlayerIndex.One).IsConnected && this.GamePadButton != 0)\n\t\t\t\t\treturn \"\\\\\" + this.GamePadButton.ToString();\n\t\t\t\telse if (value != null)\n\t\t\t\t\treturn value;\n\t\t\t\telse\n\t\t\t\t\treturn \"[?]\";\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<Vector2> Mouse = new Property<Vector2> { };\n\t\tpublic Property<int> ScrollWheel = new Property<int> { };\n\t\tpublic Property<bool> LeftMouseButton = new Property<bool> { };\n\t\tpublic Property<bool> MiddleMouseButton = new Property<bool> { };\n\t\tpublic Property<bool> RightMouseButton = new Property<bool> { };\n\n\t\tpublic Command LeftMouseButtonDown = new Command();\n\t\tpublic Command MiddleMouseButtonDown = new Command();\n\t\tpublic Command RightMouseButtonDown = new Command();\n\t\tpublic Command LeftMouseButtonUp = new Command();\n\t\tpublic Command MiddleMouseButtonUp = new Command();\n\t\tpublic Command RightMouseButtonUp = new Command();\n\t\tpublic Command<int> MouseScrolled = new Command<int>();\n\n\t\tpublic Command<PCInputBinding> AnyInputDown = new Command<PCInputBinding>();\n\n\t\tpublic Property<bool> EnableMouse = new Property<bool> { Value = true };\n\n\t\tpublic void Bind(Property<PCInput.PCInputBinding> inputBinding, InputState state, Action action)\n\t\t{\n\t\t\tCommandBinding commandBinding = null;\n\t\t\tCommandBinding buttonBinding = null;\n\t\t\tAction rebindCommand = delegate()\n\t\t\t{\n\t\t\t\tif (commandBinding != null)\n\t\t\t\t\tthis.Remove(commandBinding);\n\n\t\t\t\tif (buttonBinding != null)\n\t\t\t\t\tthis.Remove(buttonBinding);\n\n\t\t\t\tPCInput.PCInputBinding ib = inputBinding;\n\t\t\t\tif (ib.Key == Keys.None && ib.MouseButton == PCInput.MouseButton.None)\n\t\t\t\t\tcommandBinding = null;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcommandBinding = new CommandBinding(state == InputState.Up ? this.GetInputUp(ib) : this.GetInputDown(ib), action);\n\t\t\t\t\tthis.Add(commandBinding);\n\t\t\t\t}\n\n\t\t\t\tif (ib.GamePadButton == 0)\n\t\t\t\t\tbuttonBinding = null;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbuttonBinding = new CommandBinding(state == InputState.Up ? this.GetButtonUp(ib.GamePadButton) : this.GetButtonDown(ib.GamePadButton), action);\n\t\t\t\t\tthis.Add(buttonBinding);\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis.Add(new NotifyBinding(rebindCommand, inputBinding));\n\t\t\trebindCommand();\n\t\t}\n\n\t\tpublic void Bind(Property<bool> destination, Property<PCInput.PCInputBinding> inputBinding)\n\t\t{\n\t\t\tBinding<bool> binding = null;\n\t\t\tBinding<bool> buttonBinding = null;\n\t\t\tAction rebind = delegate()\n\t\t\t{\n\t\t\t\tif (binding != null)\n\t\t\t\t\tthis.Remove(binding);\n\t\t\t\t\n\t\t\t\tif (buttonBinding != null)\n\t\t\t\t\tthis.Remove(buttonBinding);\n\n\t\t\t\tPCInput.PCInputBinding ib = inputBinding;\n\t\t\t\tif (ib.Key == Keys.None && ib.MouseButton == PCInput.MouseButton.None)\n\t\t\t\t\tbinding = null;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tswitch (ib.MouseButton)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase MouseButton.None:\n\t\t\t\t\t\t\tbinding = new Binding<bool>(destination, this.GetKey(ib.Key));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase MouseButton.LeftMouseButton:\n\t\t\t\t\t\t\tbinding = new Binding<bool>(destination, this.LeftMouseButton);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase MouseButton.RightMouseButton:\n\t\t\t\t\t\t\tbinding = new Binding<bool>(destination, this.RightMouseButton);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase MouseButton.MiddleMouseButton:\n\t\t\t\t\t\t\tbinding = new Binding<bool>(destination, this.MiddleMouseButton);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.Add(binding);\n\t\t\t\t}\n\n\t\t\t\tif (ib.GamePadButton == 0)\n\t\t\t\t\tbuttonBinding = null;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbuttonBinding = new Binding<bool>(destination, this.GetButton(ib.GamePadButton));\n\t\t\t\t\tthis.Add(buttonBinding);\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis.Add(new NotifyBinding(rebind, inputBinding));\n\t\t\trebind();\n\t\t}\n\n\t\tprotected Dictionary<Keys, Property<bool>> keyProperties = new Dictionary<Keys, Property<bool>>();\n\t\tprotected List<Keys> keys = new List<Keys>();\n\n\t\tprotected Dictionary<Keys, Command> keyUpCommands = new Dictionary<Keys, Command>();\n\t\tprotected Dictionary<Keys, Command> keyDownCommands = new Dictionary<Keys, Command>();\n\n\t\tprotected Dictionary<Buttons, Property<bool>> buttonProperties = new Dictionary<Buttons, Property<bool>>();\n\t\tprotected List<Buttons> buttons = new List<Buttons>();\n\n\t\tprotected Dictionary<Buttons, Command> buttonUpCommands = new Dictionary<Buttons, Command>();\n\t\tprotected Dictionary<Buttons, Command> buttonDownCommands = new Dictionary<Buttons, Command>();\n\n\t\tprotected List<Action<PCInput.PCInputBinding>> nextInputListeners = new List<Action<PCInputBinding>>();\n\n\t\tpublic struct Chord\n\t\t{\n\t\t\tpublic Keys Modifier, Key;\n\t\t\tpublic MouseButton Mouse;\n\t\t\t\n\t\t\tpublic bool Exists\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn this.Key != Keys.None || this.Mouse != MouseButton.None;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic Chord(Keys key)\n\t\t\t{\n\t\t\t\tthis.Key = key;\n\t\t\t\tthis.Modifier = Keys.None;\n\t\t\t\tthis.Mouse = MouseButton.None;\n\t\t\t}\n\n\t\t\tpublic Chord(Keys key, Keys modifier)\n\t\t\t{\n\t\t\t\tthis.Key = key;\n\t\t\t\tthis.Modifier = modifier;\n\t\t\t\tthis.Mouse = MouseButton.None;\n\t\t\t}\n\n\t\t\tpublic Chord(MouseButton mouse)\n\t\t\t{\n\t\t\t\tthis.Key = Keys.None;\n\t\t\t\tthis.Modifier = Keys.None;\n\t\t\t\tthis.Mouse = mouse;\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\tif (this.Mouse != MouseButton.None)\n\t\t\t\t{\n\t\t\t\t\tswitch (this.Mouse)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase MouseButton.RightMouseButton:\n\t\t\t\t\t\t\treturn \"Right-click\";\n\t\t\t\t\t\tcase MouseButton.MiddleMouseButton:\n\t\t\t\t\t\t\treturn \"Middle-click\";\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn \"Left-click\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstring key;\n\t\t\t\t\tswitch (this.Key)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase Keys.OemPeriod:\n\t\t\t\t\t\t\tkey = \".\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Keys.OemComma:\n\t\t\t\t\t\t\tkey = \",\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Keys.D0:\n\t\t\t\t\t\t\tkey = \"0\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Keys.D1:\n\t\t\t\t\t\t\tkey = \"1\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Keys.D2:\n\t\t\t\t\t\t\tkey = \"2\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Keys.D3:\n\t\t\t\t\t\t\tkey = \"3\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Keys.D4:\n\t\t\t\t\t\t\tkey = \"4\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Keys.D5:\n\t\t\t\t\t\t\tkey = \"5\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Keys.D6:\n\t\t\t\t\t\t\tkey = \"6\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Keys.D7:\n\t\t\t\t\t\t\tkey = \"7\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Keys.D8:\n\t\t\t\t\t\t\tkey = \"8\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Keys.D9:\n\t\t\t\t\t\t\tkey = \"9\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tkey = this.Key.ToString(); // That's all I feel like doing for now\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.Modifier == Keys.None)\n\t\t\t\t\t\treturn key;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tstring modifier;\n\t\t\t\t\t\tswitch (this.Modifier)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase Keys.LeftControl:\n\t\t\t\t\t\t\t\tmodifier = \"Ctrl\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase Keys.LeftAlt:\n\t\t\t\t\t\t\t\tmodifier = \"Alt\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase Keys.LeftShift:\n\t\t\t\t\t\t\t\tmodifier = \"Shift\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase Keys.LeftWindows:\n\t\t\t\t\t\t\t\tmodifier = \"Windows\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tmodifier = this.Modifier.ToString();\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn string.Format(\"{0}+{1}\", modifier, key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected Dictionary<Chord, Command> chords = new Dictionary<Chord, Command>();\n\n\t\tprotected bool chordActivated = false;\n\n\t\tpublic PCInput()\n\t\t{\n\t\t\tthis.Serialize = false;\n\t\t}\n\n\t\tpublic override Entity Entity\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn base.Entity;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tbase.Entity = value;\n\t\t\t\tthis.EnabledWhenPaused = false;\n\t\t\t}\n\t\t}\n\n\t\tprivate bool preventKeyDownEvents = false;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new CommandBinding(this.Disable, delegate()\n\t\t\t{\n\t\t\t\t// Release all the keys\n\t\t\t\tfor (int i = 0; i < this.keys.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tKeys key = this.keys[i];\n\t\t\t\t\tProperty<bool> prop = this.keyProperties[key];\n\t\t\t\t\tif (prop)\n\t\t\t\t\t{\n\t\t\t\t\t\tCommand command;\n\t\t\t\t\t\tif (this.keyUpCommands.TryGetValue(key, out command))\n\t\t\t\t\t\t\tcommand.Execute();\n\t\t\t\t\t\tprop.Value = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Release all the buttons\n\t\t\t\tfor (int i = 0; i < this.buttons.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tButtons button = this.buttons[i];\n\t\t\t\t\tProperty<bool> prop = this.buttonProperties[button];\n\t\t\t\t\tif (prop)\n\t\t\t\t\t{\n\t\t\t\t\t\tCommand command;\n\t\t\t\t\t\tif (this.buttonUpCommands.TryGetValue(button, out command))\n\t\t\t\t\t\t\tcommand.Execute();\n\t\t\t\t\t\tprop.Value = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.chordActivated = false;\n\n\t\t\t\t// Release mouse buttons\n\t\t\t\tif (this.LeftMouseButton)\n\t\t\t\t{\n\t\t\t\t\tthis.LeftMouseButton.Value = false;\n\t\t\t\t\tthis.LeftMouseButtonUp.Execute();\n\t\t\t\t}\n\n\t\t\t\tif (this.RightMouseButton)\n\t\t\t\t{\n\t\t\t\t\tthis.RightMouseButton.Value = false;\n\t\t\t\t\tthis.RightMouseButtonUp.Execute();\n\t\t\t\t}\n\n\t\t\t\tif (this.MiddleMouseButton)\n\t\t\t\t{\n\t\t\t\t\tthis.MiddleMouseButton.Value = false;\n\t\t\t\t\tthis.MiddleMouseButtonUp.Execute();\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis.Add(new CommandBinding(this.Enable, delegate()\n\t\t\t{\n\t\t\t\t// Don't send key-down events for the first frame after we're enabled.\n\t\t\t\tthis.preventKeyDownEvents = true;\n\t\t\t}));\n\t\t}\n\n\t\tpublic Property<bool> GetKey(Keys key)\n\t\t{\n\t\t\tProperty<bool> result;\n\t\t\tif (!this.keyProperties.TryGetValue(key, out result))\n\t\t\t{\n\t\t\t\tresult = new Property<bool>();\n\t\t\t\tthis.keyProperties.Add(key, result);\n\t\t\t\tthis.keys.Add(key);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Property<bool> GetButton(Buttons button)\n\t\t{\n\t\t\tif (button == 0)\n\t\t\t\treturn new Property<bool>();\n\n\t\t\tProperty<bool> result;\n\t\t\tif (!this.buttonProperties.TryGetValue(button, out result))\n\t\t\t{\n\t\t\t\tresult = new Property<bool>();\n\t\t\t\tthis.buttonProperties.Add(button, result);\n\t\t\t\tthis.buttons.Add(button);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Command GetKeyDown(Keys key)\n\t\t{\n\t\t\tCommand result;\n\t\t\tif (!this.keyDownCommands.TryGetValue(key, out result))\n\t\t\t{\n\t\t\t\tthis.GetKey(key);\n\t\t\t\tresult = new Command();\n\t\t\t\tthis.keyDownCommands.Add(key, result);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Command GetKeyUp(Keys key)\n\t\t{\n\t\t\tCommand result;\n\t\t\tif (!this.keyUpCommands.TryGetValue(key, out result))\n\t\t\t{\n\t\t\t\tthis.GetKey(key);\n\t\t\t\tresult = new Command();\n\t\t\t\tthis.keyUpCommands.Add(key, result);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Command GetButtonDown(Buttons button)\n\t\t{\n\t\t\tCommand result;\n\t\t\tif (!this.buttonDownCommands.TryGetValue(button, out result))\n\t\t\t{\n\t\t\t\tthis.GetButton(button);\n\t\t\t\tresult = new Command();\n\t\t\t\tthis.buttonDownCommands.Add(button, result);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Command GetButtonUp(Buttons button)\n\t\t{\n\t\t\tCommand result;\n\t\t\tif (!this.buttonUpCommands.TryGetValue(button, out result))\n\t\t\t{\n\t\t\t\tthis.GetButton(button);\n\t\t\t\tresult = new Command();\n\t\t\t\tthis.buttonUpCommands.Add(button, result);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic void GetNextInput(Action<PCInput.PCInputBinding> listener)\n\t\t{\n\t\t\tthis.nextInputListeners.Add(listener);\n\t\t}\n\n\t\tpublic bool GetInput(PCInputBinding binding)\n\t\t{\n\t\t\tbool result = false;\n\n\t\t\tif (binding.Key != Keys.None)\n\t\t\t\tresult |= this.GetKey(binding.Key);\n\n\t\t\tswitch (binding.MouseButton)\n\t\t\t{\n\t\t\t\tcase MouseButton.LeftMouseButton:\n\t\t\t\t\tresult |= this.LeftMouseButton;\n\t\t\t\t\tbreak;\n\t\t\t\tcase MouseButton.MiddleMouseButton:\n\t\t\t\t\tresult |= this.MiddleMouseButton;\n\t\t\t\t\tbreak;\n\t\t\t\tcase MouseButton.RightMouseButton:\n\t\t\t\t\tresult |= this.RightMouseButton;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (binding.GamePadButton != 0)\n\t\t\t\tresult |= this.GetButton(binding.GamePadButton);\n\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Command GetInputUp(PCInputBinding binding)\n\t\t{\n\t\t\tif (binding.Key != Keys.None)\n\t\t\t\treturn this.GetKeyUp(binding.Key);\n\t\t\telse if (binding.MouseButton != MouseButton.None)\n\t\t\t{\n\t\t\t\tswitch (binding.MouseButton)\n\t\t\t\t{\n\t\t\t\t\tcase MouseButton.LeftMouseButton:\n\t\t\t\t\t\treturn this.LeftMouseButtonUp;\n\t\t\t\t\tcase MouseButton.MiddleMouseButton:\n\t\t\t\t\t\treturn this.MiddleMouseButtonUp;\n\t\t\t\t\tcase MouseButton.RightMouseButton:\n\t\t\t\t\t\treturn this.RightMouseButtonUp;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn this.GetButtonUp(binding.GamePadButton);\n\t\t}\n\n\t\tpublic Command GetInputDown(PCInputBinding binding)\n\t\t{\n\t\t\tif (binding.Key != Keys.None)\n\t\t\t\treturn this.GetKeyDown(binding.Key);\n\t\t\telse if (binding.MouseButton != MouseButton.None)\n\t\t\t{\n\t\t\t\tswitch (binding.MouseButton)\n\t\t\t\t{\n\t\t\t\t\tcase MouseButton.LeftMouseButton:\n\t\t\t\t\t\treturn this.LeftMouseButtonDown;\n\t\t\t\t\tcase MouseButton.MiddleMouseButton:\n\t\t\t\t\t\treturn this.MiddleMouseButtonDown;\n\t\t\t\t\tcase MouseButton.RightMouseButton:\n\t\t\t\t\t\treturn this.RightMouseButtonDown;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn this.GetButtonDown(binding.GamePadButton);\n\t\t}\n\n\t\tpublic Command GetChord(Chord chord)\n\t\t{\n\t\t\tCommand output;\n\t\t\tif (!this.chords.TryGetValue(chord, out output))\n\t\t\t{\n\t\t\t\tCommand cmd = new Command();\n\t\t\t\tthis.chords.Add(chord, cmd);\n\t\t\t\toutput = cmd;\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\n\t\tprivate void notifyNextInputListeners(PCInput.PCInputBinding input)\n\t\t{\n\t\t\tfor (int i = 0; i < this.nextInputListeners.Count; i++)\n\t\t\t\tthis.nextInputListeners[i](input);\n\t\t\tthis.nextInputListeners.Clear();\n\t\t\tthis.preventKeyDownEvents = true;\n\t\t}\n\n\t\tprivate bool temporarilyIgnoreLMB;\n\n\t\tpublic virtual void Update(float elapsedTime)\n\t\t{\n\t\t\tif (!this.main.IsActive)\n\t\t\t\treturn;\n\n\t\t\tif (!this.main.LastActive)\n\t\t\t{\n\t\t\t\tif (this.main.MouseState.Value.LeftButton == ButtonState.Pressed)\n\t\t\t\t\tthis.temporarilyIgnoreLMB = true;\n\t\t\t}\n\n\t\t\tKeyboardState keyboard = this.main.KeyboardState;\n\n\t\t\tKeys[] keys = keyboard.GetPressedKeys();\n\t\t\tif (keys.Length > 0 && this.nextInputListeners.Count > 0)\n\t\t\t\tthis.notifyNextInputListeners(new PCInputBinding { Key = keys[0] });\n\n\t\t\tif (this.AnyInputDown.Bindings.Count > 0)\n\t\t\t{\n\t\t\t\tKeys[] lastKeys = this.main.LastKeyboardState.Value.GetPressedKeys();\n\t\t\t\tfor (int i = 0; i < keys.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (!lastKeys.Contains(keys[i]))\n\t\t\t\t\t\tthis.AnyInputDown.Execute(new PCInputBinding { Key = keys[i] });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < this.keys.Count; i++)\n\t\t\t{\n\t\t\t\tKeys key = this.keys[i];\n\t\t\t\tProperty<bool> prop = this.keyProperties[key];\n\t\t\t\tbool newValue = keyboard.IsKeyDown(key);\n\t\t\t\tif (prop != newValue)\n\t\t\t\t{\n\t\t\t\t\tprop.Value = newValue;\n\t\t\t\t\tif (!this.preventKeyDownEvents)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (newValue)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tCommand command;\n\t\t\t\t\t\t\tif (this.keyDownCommands.TryGetValue(key, out command))\n\t\t\t\t\t\t\t\tcommand.Execute();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tCommand command;\n\t\t\t\t\t\t\tif (this.keyUpCommands.TryGetValue(key, out command))\n\t\t\t\t\t\t\t\tcommand.Execute();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tGamePadState gamePad = this.main.GamePadState;\n\t\t\tif (gamePad.IsConnected)\n\t\t\t{\n\t\t\t\tif (this.nextInputListeners.Count > 0 || this.AnyInputDown.Bindings.Count > 0)\n\t\t\t\t{\n\t\t\t\t\tGamePadState lastGamePad = this.main.LastGamePadState;\n\t\t\t\t\tList<Buttons> buttons = new List<Buttons>();\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.A) && !lastGamePad.IsButtonDown(Buttons.A))\n\t\t\t\t\t\tbuttons.Add(Buttons.A);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.B) && !lastGamePad.IsButtonDown(Buttons.B))\n\t\t\t\t\t\tbuttons.Add(Buttons.B);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.Back) && !lastGamePad.IsButtonDown(Buttons.Back))\n\t\t\t\t\t\tbuttons.Add(Buttons.Back);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.DPadDown) && !lastGamePad.IsButtonDown(Buttons.DPadDown))\n\t\t\t\t\t\tbuttons.Add(Buttons.DPadDown);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.DPadLeft) && !lastGamePad.IsButtonDown(Buttons.DPadLeft))\n\t\t\t\t\t\tbuttons.Add(Buttons.DPadLeft);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.DPadRight) && !lastGamePad.IsButtonDown(Buttons.DPadRight))\n\t\t\t\t\t\tbuttons.Add(Buttons.DPadRight);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.DPadUp) && !lastGamePad.IsButtonDown(Buttons.DPadUp))\n\t\t\t\t\t\tbuttons.Add(Buttons.DPadUp);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.LeftShoulder) && !lastGamePad.IsButtonDown(Buttons.LeftShoulder))\n\t\t\t\t\t\tbuttons.Add(Buttons.LeftShoulder);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.RightShoulder) && !lastGamePad.IsButtonDown(Buttons.RightShoulder))\n\t\t\t\t\t\tbuttons.Add(Buttons.RightShoulder);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.LeftStick) && !lastGamePad.IsButtonDown(Buttons.LeftStick))\n\t\t\t\t\t\tbuttons.Add(Buttons.LeftStick);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.RightStick) && !lastGamePad.IsButtonDown(Buttons.RightStick))\n\t\t\t\t\t\tbuttons.Add(Buttons.RightStick);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.LeftThumbstickDown) && !lastGamePad.IsButtonDown(Buttons.LeftThumbstickDown))\n\t\t\t\t\t\tbuttons.Add(Buttons.LeftThumbstickDown);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.LeftThumbstickRight) && !lastGamePad.IsButtonDown(Buttons.LeftThumbstickRight))\n\t\t\t\t\t\tbuttons.Add(Buttons.LeftThumbstickRight);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.LeftThumbstickLeft) && !lastGamePad.IsButtonDown(Buttons.LeftThumbstickLeft))\n\t\t\t\t\t\tbuttons.Add(Buttons.LeftThumbstickLeft);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.LeftThumbstickUp) && !lastGamePad.IsButtonDown(Buttons.LeftThumbstickUp))\n\t\t\t\t\t\tbuttons.Add(Buttons.LeftThumbstickUp);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.RightThumbstickDown) && !lastGamePad.IsButtonDown(Buttons.RightThumbstickDown))\n\t\t\t\t\t\tbuttons.Add(Buttons.RightThumbstickDown);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.RightThumbstickRight) && !lastGamePad.IsButtonDown(Buttons.RightThumbstickRight))\n\t\t\t\t\t\tbuttons.Add(Buttons.RightThumbstickRight);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.RightThumbstickLeft) && !lastGamePad.IsButtonDown(Buttons.RightThumbstickLeft))\n\t\t\t\t\t\tbuttons.Add(Buttons.RightThumbstickLeft);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.RightThumbstickUp) && !lastGamePad.IsButtonDown(Buttons.RightThumbstickUp))\n\t\t\t\t\t\tbuttons.Add(Buttons.RightThumbstickUp);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.LeftTrigger) && !lastGamePad.IsButtonDown(Buttons.LeftTrigger))\n\t\t\t\t\t\tbuttons.Add(Buttons.LeftTrigger);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.RightTrigger) && !lastGamePad.IsButtonDown(Buttons.RightTrigger))\n\t\t\t\t\t\tbuttons.Add(Buttons.RightTrigger);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.X) && !lastGamePad.IsButtonDown(Buttons.X))\n\t\t\t\t\t\tbuttons.Add(Buttons.X);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.Y) && !lastGamePad.IsButtonDown(Buttons.Y))\n\t\t\t\t\t\tbuttons.Add(Buttons.Y);\n\t\t\t\t\tif (gamePad.IsButtonDown(Buttons.Start) && !lastGamePad.IsButtonDown(Buttons.Start))\n\t\t\t\t\t\tbuttons.Add(Buttons.Start);\n\n\t\t\t\t\tif (buttons.Count > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.AnyInputDown.Bindings.Count > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int i = 0; i < buttons.Count; i++)\n\t\t\t\t\t\t\t\tthis.AnyInputDown.Execute(new PCInputBinding { GamePadButton = buttons[i] });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.nextInputListeners.Count > 0)\n\t\t\t\t\t\t\tthis.notifyNextInputListeners(new PCInputBinding { GamePadButton = buttons[0] });\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (int i = 0; i < this.buttons.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tButtons button = this.buttons[i];\n\t\t\t\t\tbool newValue = gamePad.IsButtonDown(button);\n\t\t\t\t\tProperty<bool> prop = this.buttonProperties[button];\n\t\t\t\t\tif (prop != newValue)\n\t\t\t\t\t{\n\t\t\t\t\t\tprop.Value = newValue;\n\t\t\t\t\t\tif (!this.preventKeyDownEvents)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (newValue)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tCommand command;\n\t\t\t\t\t\t\t\tif (buttonDownCommands.TryGetValue(button, out command))\n\t\t\t\t\t\t\t\t\tcommand.Execute();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tCommand command;\n\t\t\t\t\t\t\t\tif (buttonUpCommands.TryGetValue(button, out command))\n\t\t\t\t\t\t\t\t\tcommand.Execute();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!this.chordActivated && !this.preventKeyDownEvents)\n\t\t\t{\n\t\t\t\tif (keys.Length == 2)\n\t\t\t\t{\n\t\t\t\t\tChord chord = new Chord();\n\t\t\t\t\tif (keys[1] == Keys.LeftAlt || keys[1] == Keys.LeftControl || keys[1] == Keys.LeftShift || keys[1] == Keys.LeftWindows\n\t\t\t\t\t\t|| keys[1] == Keys.RightAlt || keys[1] == Keys.RightControl || keys[1] == Keys.RightShift || keys[1] == Keys.RightWindows)\n\t\t\t\t\t{\n\t\t\t\t\t\tchord.Modifier = keys[1];\n\t\t\t\t\t\tchord.Key = keys[0];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tchord.Modifier = keys[0];\n\t\t\t\t\t\tchord.Key = keys[1];\n\t\t\t\t\t}\n\n\t\t\t\t\tCommand chordCommand;\n\t\t\t\t\tif (this.chords.TryGetValue(chord, out chordCommand))\n\t\t\t\t\t{\n\t\t\t\t\t\tchordCommand.Execute();\n\t\t\t\t\t\tthis.chordActivated = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (keyboard.GetPressedKeys().Length == 0)\n\t\t\t\tthis.chordActivated = false;\n\n\t\t\tif (this.EnableMouse)\n\t\t\t{\n\t\t\t\tMouseState mouse = this.main.MouseState;\n\t\t\t\tthis.handleMouse();\n\n\t\t\t\tbool newLeftMouseButton = mouse.LeftButton == ButtonState.Pressed;\n\t\t\t\tif (newLeftMouseButton != this.LeftMouseButton)\n\t\t\t\t{\n\t\t\t\t\tthis.LeftMouseButton.Value = newLeftMouseButton;\n\t\t\t\t\tif (!this.preventKeyDownEvents)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (newLeftMouseButton)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!this.temporarilyIgnoreLMB)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (this.nextInputListeners.Count > 0)\n\t\t\t\t\t\t\t\t\tthis.notifyNextInputListeners(new PCInputBinding { MouseButton = MouseButton.LeftMouseButton });\n\t\t\t\t\t\t\t\tthis.LeftMouseButtonDown.Execute();\n\t\t\t\t\t\t\t\tthis.AnyInputDown.Execute(new PCInputBinding { MouseButton = MouseButton.LeftMouseButton });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.temporarilyIgnoreLMB)\n\t\t\t\t\t\t\t\tthis.temporarilyIgnoreLMB = false;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tthis.LeftMouseButtonUp.Execute();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbool newMiddleMouseButton = mouse.MiddleButton == ButtonState.Pressed;\n\t\t\t\tif (newMiddleMouseButton != this.MiddleMouseButton)\n\t\t\t\t{\n\t\t\t\t\tthis.MiddleMouseButton.Value = newMiddleMouseButton;\n\t\t\t\t\tif (!this.preventKeyDownEvents)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (newMiddleMouseButton)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.nextInputListeners.Count > 0)\n\t\t\t\t\t\t\t\tthis.notifyNextInputListeners(new PCInputBinding { MouseButton = MouseButton.MiddleMouseButton });\n\t\t\t\t\t\t\tthis.MiddleMouseButtonDown.Execute();\n\t\t\t\t\t\t\tthis.AnyInputDown.Execute(new PCInputBinding { MouseButton = MouseButton.MiddleMouseButton });\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthis.MiddleMouseButtonUp.Execute();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbool newRightMouseButton = mouse.RightButton == ButtonState.Pressed;\n\t\t\t\tif (newRightMouseButton != this.RightMouseButton)\n\t\t\t\t{\n\t\t\t\t\tthis.RightMouseButton.Value = newRightMouseButton;\n\t\t\t\t\tif (!this.preventKeyDownEvents)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (newRightMouseButton)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.nextInputListeners.Count > 0)\n\t\t\t\t\t\t\t\tthis.notifyNextInputListeners(new PCInputBinding { MouseButton = MouseButton.RightMouseButton });\n\t\t\t\t\t\t\tthis.RightMouseButtonDown.Execute();\n\t\t\t\t\t\t\tthis.AnyInputDown.Execute(new PCInputBinding { MouseButton = MouseButton.RightMouseButton });\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthis.RightMouseButtonUp.Execute();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tint newScrollWheel = mouse.ScrollWheelValue;\n\t\t\t\tint oldScrollWheel = this.ScrollWheel;\n\t\t\t\tif (newScrollWheel != oldScrollWheel)\n\t\t\t\t{\n\t\t\t\t\tthis.ScrollWheel.Value = newScrollWheel;\n\t\t\t\t\tif (!this.preventKeyDownEvents)\n\t\t\t\t\t\tthis.MouseScrolled.Execute(newScrollWheel > oldScrollWheel ? 1 : -1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.preventKeyDownEvents = false;\n\t\t}\n\n\t\tpublic void SwallowEvents()\n\t\t{\n\t\t\tthis.preventKeyDownEvents = true;\n\t\t}\n\n\t\tprotected virtual void handleMouse()\n\t\t{\n\t\t\tMouseState state = this.main.MouseState, lastState = this.main.LastMouseState;\n\t\t\tif (state.X != lastState.X || state.Y != lastState.Y)\n\t\t\t\tthis.Mouse.Value = new Vector2(state.X, state.Y);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/LeaderboardProxy.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Util;\nusing Steamworks;\n\nnamespace Lemma\n{\n\tpublic class LeaderboardProxy\n\t{\n\t\tpublic Command<LeaderboardScoresDownloaded_t, LeaderboardScoresDownloaded_t> OnLeaderboardSync = new Command<LeaderboardScoresDownloaded_t, LeaderboardScoresDownloaded_t>();\n\n\t\tpublic Command OnLeaderboardError = new Command();\n\n#if STEAMWORKS\n\t\tprivate Callback<PersonaStateChange_t> personaCallback;\n\t\tprivate CallResult<LeaderboardFindResult_t> leaderboardFindCall;\n\t\tprivate CallResult<LeaderboardScoreUploaded_t> leaderboardUploadCall;\n\t\tprivate CallResult<LeaderboardScoresDownloaded_t> globalLeaderboardDownloadCall;\n\t\tprivate bool globalScoresDownloaded;\n\t\tprivate LeaderboardScoresDownloaded_t globalScores;\n\t\tprivate CallResult<LeaderboardScoresDownloaded_t> friendLeaderboardDownloadCall;\n\t\tprivate bool friendScoresDownloaded;\n\t\tprivate LeaderboardScoresDownloaded_t friendScores;\n#endif\n\n\t\tpublic Property<bool> PersonaNotification = new Property<bool>();\n\n\t\tprivate int before, after, friendsBefore, friendsAfter;\n\n\t\tpublic LeaderboardProxy(int before = 5, int after = 5, int friendsBefore = 5, int friendsAfter = 5)\n\t\t{\n#if STEAMWORKS\n\t\t\tthis.personaCallback = Callback<PersonaStateChange_t>.Create(this.onPersonaStateChange);\n#endif\n\t\t\tthis.before = before;\n\t\t\tthis.after = after;\n\t\t\tthis.friendsBefore = friendsBefore;\n\t\t\tthis.friendsAfter = friendsAfter;\n\t\t}\n\n\t\tpublic void Unregister()\n\t\t{\n\t\t\tthis.CancelCallbacks();\n#if STEAMWORKS\n\t\t\tif (this.personaCallback != null)\n\t\t\t{\n\t\t\t\tthis.personaCallback.Unregister();\n\t\t\t\tthis.personaCallback = null;\n\t\t\t}\n#endif\n\t\t}\n\n\t\tpublic void CancelCallbacks()\n\t\t{\n#if STEAMWORKS\n\t\t\tif (this.leaderboardFindCall != null)\n\t\t\t\tthis.leaderboardFindCall.Cancel();\n\t\t\tthis.leaderboardFindCall = null;\n\t\t\tif (this.leaderboardUploadCall != null)\n\t\t\t\tthis.leaderboardUploadCall.Cancel();\n\t\t\tthis.leaderboardUploadCall = null;\n\t\t\tif (this.globalLeaderboardDownloadCall != null)\n\t\t\t\tthis.globalLeaderboardDownloadCall.Cancel();\n\t\t\tthis.globalLeaderboardDownloadCall = null;\n\t\t\tif (this.friendLeaderboardDownloadCall != null)\n\t\t\t\tthis.friendLeaderboardDownloadCall.Cancel();\n\t\t\tthis.friendLeaderboardDownloadCall = null;\n\t\t\tthis.friendScoresDownloaded = false;\n\t\t\tthis.globalScoresDownloaded = false;\n#endif\n\t\t}\n\n\t\tprivate void onPersonaStateChange(PersonaStateChange_t persona)\n\t\t{\n\t\t\tthis.PersonaNotification.Changed();\n\t\t}\n\n\t\tprivate void checkLeaderboardsDownloaded()\n\t\t{\n#if STEAMWORKS\n\t\t\tif (this.globalScoresDownloaded && this.friendScoresDownloaded)\n\t\t\t\tthis.OnLeaderboardSync.Execute(this.globalScores, this.friendScores);\n#endif\n\t\t}\n\n\t\tpublic void Sync(string uuid, int score = 0)\n\t\t{\n#if STEAMWORKS\n\t\t\tthis.CancelCallbacks();\n\n\t\t\tif (!SteamWorker.SteamInitialized)\n\t\t\t{\n\t\t\t\tthis.OnLeaderboardError.Execute();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.leaderboardFindCall = new CallResult<LeaderboardFindResult_t>((found, foundFailure) =>\n\t\t\t{\n\t\t\t\tthis.leaderboardFindCall = null;\n\t\t\t\tif (foundFailure)\n\t\t\t\t\tthis.OnLeaderboardError.Execute();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (score > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.leaderboardUploadCall = new CallResult<LeaderboardScoreUploaded_t>(delegate(LeaderboardScoreUploaded_t uploaded, bool uploadedFailure)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.leaderboardUploadCall = null;\n\t\t\t\t\t\t\tif (uploadedFailure)\n\t\t\t\t\t\t\t\tthis.OnLeaderboardError.Execute();\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tthis.download(found.m_hSteamLeaderboard);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.leaderboardUploadCall.Set(SteamUserStats.UploadLeaderboardScore(found.m_hSteamLeaderboard, ELeaderboardUploadScoreMethod.k_ELeaderboardUploadScoreMethodKeepBest, score, new int[] {}, 0));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.download(found.m_hSteamLeaderboard);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.leaderboardFindCall.Set(SteamUserStats.FindOrCreateLeaderboard(uuid, ELeaderboardSortMethod.k_ELeaderboardSortMethodAscending, ELeaderboardDisplayType.k_ELeaderboardDisplayTypeTimeMilliSeconds));\n#endif\n\t\t}\n\n\t\tprivate void download(SteamLeaderboard_t leaderboard)\n\t\t{\n#if STEAMWORKS\n\t\t\tthis.globalLeaderboardDownloadCall = new CallResult<LeaderboardScoresDownloaded_t>((downloaded, downloadedFailure) =>\n\t\t\t{\n\t\t\t\tthis.globalLeaderboardDownloadCall = null;\n\t\t\t\tif (downloadedFailure)\n\t\t\t\t\tthis.OnLeaderboardError.Execute();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (downloaded.m_cEntryCount == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// We're not ranked\n\t\t\t\t\t\t// Get the top global list\n\t\t\t\t\t\tthis.globalLeaderboardDownloadCall = new CallResult<LeaderboardScoresDownloaded_t>((downloaded2, downloadedFailure2) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (downloadedFailure2)\n\t\t\t\t\t\t\t\tthis.OnLeaderboardError.Execute();\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.globalScoresDownloaded = true;\n\t\t\t\t\t\t\t\tthis.globalScores = downloaded2;\n\t\t\t\t\t\t\t\tthis.checkLeaderboardsDownloaded();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.globalLeaderboardDownloadCall.Set(SteamUserStats.DownloadLeaderboardEntries(leaderboard, ELeaderboardDataRequest.k_ELeaderboardDataRequestGlobal, 0, this.before + this.after));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.globalScoresDownloaded = true;\n\t\t\t\t\t\tthis.globalScores = downloaded;\n\t\t\t\t\t\tthis.checkLeaderboardsDownloaded();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.globalLeaderboardDownloadCall.Set(SteamUserStats.DownloadLeaderboardEntries(leaderboard, ELeaderboardDataRequest.k_ELeaderboardDataRequestGlobalAroundUser, -this.before, this.after));\n\t\t\tthis.friendLeaderboardDownloadCall = new CallResult<LeaderboardScoresDownloaded_t>((downloaded, downloadedFailure) =>\n\t\t\t{\n\t\t\t\tthis.friendLeaderboardDownloadCall = null;\n\t\t\t\tif (downloadedFailure)\n\t\t\t\t\tthis.OnLeaderboardError.Execute();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.friendScoresDownloaded = true;\n\t\t\t\t\tthis.friendScores = downloaded;\n\t\t\t\t\tthis.checkLeaderboardsDownloaded();\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.friendLeaderboardDownloadCall.Set(SteamUserStats.DownloadLeaderboardEntries(leaderboard, ELeaderboardDataRequest.k_ELeaderboardDataRequestFriends, -this.friendsBefore, this.friendsAfter));\n#endif\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Lemma.XNA.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <ProjectGuid>{3D2D163E-393B-4AFD-997B-143E909AC653}</ProjectGuid>\n    <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Lemma</RootNamespace>\n    <AssemblyName>Lemma</AssemblyName>\n    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>\n    <XnaPlatform>Windows</XnaPlatform>\n    <XnaCrossPlatformGroupID>557ce702-14e8-4a52-b689-5977223a2d2b</XnaCrossPlatformGroupID>\n    <ApplicationIcon>icon.ico</ApplicationIcon>\n    <Thumbnail>\n    </Thumbnail>\n    <XnaUpgrade>\n    </XnaUpgrade>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <OldToolsVersion>3.5</OldToolsVersion>\n    <UpgradeBackupLocation>\n    </UpgradeBackupLocation>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <TargetFrameworkProfile>Client</TargetFrameworkProfile>\n    <XnaOutputType>Game</XnaOutputType>\n    <XnaProfile>HiDef</XnaProfile>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>0.0.3.0</ApplicationVersion>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|x86' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\x86\\Debug</OutputPath>\n    <DefineConstants>TRACE;DEBUG;WINDOWS;DEVELOPMENT;VR</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoStdLib>true</NoStdLib>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <PlatformTarget>x86</PlatformTarget>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|x86' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\x86\\Release</OutputPath>\n    <DefineConstants>WINDOWS;ANALYTICS;STEAMWORKS;VR</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NoStdLib>true</NoStdLib>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <PlatformTarget>x86</PlatformTarget>\n    <XnaCompressContent>True</XnaCompressContent>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <DebugSymbols>true</DebugSymbols>\n    <GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Development|x86'\">\n    <OutputPath>bin\\x86\\Development\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;WINDOWS;ANALYTICS;CHEAT;STEAMWORKS;DEVELOPMENT</DefineConstants>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <Optimize>true</Optimize>\n    <NoStdLib>true</NoStdLib>\n    <PlatformTarget>x86</PlatformTarget>\n    <UseVSHostingProcess>false</UseVSHostingProcess>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>\n    <XnaCompressContent>True</XnaCompressContent>\n    <DebugType>full</DebugType>\n    <DebugSymbols>true</DebugSymbols>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationManifest>app.manifest</ApplicationManifest>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Microsoft.VisualBasic\" />\n    <Reference Include=\"Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"mscorlib\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"System\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Management\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.XML\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AdapterSelectorForm.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"AdapterSelectorForm.Designer.cs\">\n      <DependentUpon>AdapterSelectorForm.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"ComponentInterfaces.cs\" />\n    <Compile Include=\"Components\\AI.cs\" />\n    <Compile Include=\"Components\\Agent.cs\" />\n    <Compile Include=\"Components\\SoundBank.cs\" />\n    <Compile Include=\"Components\\Bouncer.cs\" />\n    <Compile Include=\"Components\\PowerBlockSocket.cs\" />\n    <Compile Include=\"Components\\AnimatedProp.cs\" />\n    <Compile Include=\"Components\\Data.cs\" />\n    <Compile Include=\"Components\\Block.cs\" />\n    <Compile Include=\"Components\\VoxelTrigger.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\AnimatedSetter.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\LogicGate.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\Sequence.cs\" />\n    <Compile Include=\"Components\\SliderCommon.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\ConsoleCommand.cs\" />\n    <Compile Include=\"Components\\ParticleWind.cs\" />\n    <Compile Include=\"Components\\Rotator.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\Binder.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\Constant.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\MessageDisplayer.cs\" />\n    <Compile Include=\"Components\\Skybox.cs\" />\n    <Compile Include=\"Components\\StaticSlider.cs\" />\n    <Compile Include=\"Components\\Smoke.cs\" />\n    <Compile Include=\"Components\\Snake.cs\" />\n    <Compile Include=\"Components\\Sound.cs\" />\n    <Compile Include=\"Components\\AmbientSound.cs\" />\n    <Compile Include=\"Components\\Analytics.cs\" />\n    <Compile Include=\"Components\\CameraStop.cs\" />\n    <Compile Include=\"Components\\DialogueFile.cs\" />\n    <Compile Include=\"Components\\EffectBlock.cs\" />\n    <Compile Include=\"Components\\BlockCloud.cs\" />\n    <Compile Include=\"Components\\FallingTower.cs\" />\n    <Compile Include=\"Components\\ImplodeBlock.cs\" />\n    <Compile Include=\"Components\\Joint.cs\" />\n    <Compile Include=\"Components\\MapExit.cs\" />\n    <Compile Include=\"Components\\Exploder.cs\" />\n    <Compile Include=\"Components\\Rain.cs\" />\n    <Compile Include=\"Components\\RaycastAIMovement.cs\" />\n    <Compile Include=\"Components\\Levitator.cs\" />\n    <Compile Include=\"Components\\Note.cs\" />\n    <Compile Include=\"Components\\PlayerData.cs\" />\n    <Compile Include=\"Components\\Collectible.cs\" />\n    <Compile Include=\"Components\\Rift.cs\" />\n    <Compile Include=\"Components\\SceneryBlock.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\Scriptlike.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\Counter.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\Setter.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\RandomTicker.cs\" />\n    <Compile Include=\"Components\\Scriptlike\\Ticker.cs\" />\n    <Compile Include=\"Components\\Spinner.cs\" />\n    <Compile Include=\"Components\\Slider.cs\" />\n    <Compile Include=\"Components\\Spawner.cs\" />\n    <Compile Include=\"Components\\Starter.cs\" />\n    <Compile Include=\"Components\\VoxelSetter.cs\" />\n    <Compile Include=\"Components\\Switch.cs\" />\n    <Compile Include=\"Components\\TimeTrial.cs\" />\n    <Compile Include=\"Components\\Turret.cs\" />\n    <Compile Include=\"Components\\VoxelFill.cs\" />\n    <Compile Include=\"ErrorForm.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"ErrorForm.Designer.cs\">\n      <DependentUpon>ErrorForm.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"Factories\\BouncerFactory.cs\" />\n    <Compile Include=\"Factories\\ConsoleCommandFactory.cs\" />\n    <Compile Include=\"Factories\\AnimatedPropFactory.cs\" />\n    <Compile Include=\"Factories\\SoundBankFactory.cs\" />\n    <Compile Include=\"Factories\\SplashOutTriggerFactory.cs\" />\n    <Compile Include=\"Factories\\VoxelTriggerFactory.cs\" />\n    <Compile Include=\"Factories\\PowerBlockSocketFactory.cs\" />\n    <Compile Include=\"Factories\\LogicGateFactory.cs\" />\n    <Compile Include=\"Factories\\SkyDecalFactory.cs\" />\n    <Compile Include=\"Factories\\StaticSliderFactory.cs\" />\n    <Compile Include=\"Factories\\SequenceFactory.cs\" />\n    <Compile Include=\"Factories\\VoxelSetterFactory.cs\" />\n    <Compile Include=\"LeaderboardProxy.cs\" />\n    <Compile Include=\"OvrCapi.cs\" />\n    <Compile Include=\"Player\\FPSCamera.cs\" />\n    <Compile Include=\"Scripts\\DialogueLink.cs\" />\n    <Compile Include=\"Scripts\\DialogueTrigger.cs\" />\n    <Compile Include=\"Scripts\\RiftSpawner.cs\" />\n    <Compile Include=\"Scripts\\SetPhoto.cs\" />\n    <Compile Include=\"Util\\VoxelRip.cs\" />\n    <Compile Include=\"Components\\World.cs\" />\n    <Compile Include=\"Console\\AutoConCommand.cs\" />\n    <Compile Include=\"Console\\AutoConVar.cs\" />\n    <Compile Include=\"Console\\Console.cs\" />\n    <Compile Include=\"Console\\ConsoleParser.cs\" />\n    <Compile Include=\"Console\\ConVar.cs\" />\n    <Compile Include=\"Console\\ConCommand.cs\" />\n    <Compile Include=\"Components\\Propagator.cs\" />\n    <Compile Include=\"Editor\\AnalyticsViewer.cs\" />\n    <Compile Include=\"Editor\\EditorGeeUI.cs\" />\n    <Compile Include=\"Factories\\MessageDisplayerFactory.cs\" />\n    <Compile Include=\"Factories\\ConstantFactory.cs\" />\n    <Compile Include=\"Factories\\ExplosionFactory.cs\" />\n    <Compile Include=\"Factories\\FileFilter.cs\" />\n    <Compile Include=\"Factories\\BinderFactory.cs\" />\n    <Compile Include=\"Factories\\DustFactory.cs\" />\n    <Compile Include=\"Factories\\WaterfallFactory.cs\" />\n    <Compile Include=\"Factories\\SnowFactory.cs\" />\n    <Compile Include=\"Factories\\StarterFactory.cs\" />\n    <Compile Include=\"Factories\\CameraStopFactory.cs\" />\n    <Compile Include=\"Factories\\RandomTickerFactory.cs\" />\n    <Compile Include=\"Factories\\TimeTrialFactory.cs\" />\n    <Compile Include=\"Factories\\PowerSoundFactory.cs\" />\n    <Compile Include=\"Factories\\RotatorFactory.cs\" />\n    <Compile Include=\"Factories\\ImplodeBlockFactory.cs\" />\n    <Compile Include=\"Factories\\RiftFactory.cs\" />\n    <Compile Include=\"Factories\\CollectibleFactory.cs\" />\n    <Compile Include=\"Factories\\CounterFactory.cs\" />\n    <Compile Include=\"Factories\\SetterFactory.cs\" />\n    <Compile Include=\"Factories\\TickerFactory.cs\" />\n    <Compile Include=\"GeeUI\\Composites\\ToolTip.cs\" />\n    <Compile Include=\"GeeUI\\GeeUIMain.cs\" />\n    <Compile Include=\"GeeUI\\Managers\\ConversionManager.cs\" />\n    <Compile Include=\"GeeUI\\Managers\\DrawManager.cs\" />\n    <Compile Include=\"GeeUI\\Managers\\InputManager.cs\" />\n    <Compile Include=\"GeeUI\\Resource1.Designer.cs\">\n      <DependentUpon>Resource1.resx</DependentUpon>\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n    </Compile>\n    <Compile Include=\"GeeUI\\Structs\\BoundKey.cs\" />\n    <Compile Include=\"GeeUI\\Structs\\BoundMouse.cs\" />\n    <Compile Include=\"GeeUI\\Structs\\DropDownItem.cs\" />\n    <Compile Include=\"GeeUI\\Structs\\NinePatch.cs\" />\n    <Compile Include=\"GeeUI\\Structs\\RadioButtonGroup.cs\" />\n    <Compile Include=\"GeeUI\\ViewLayouts\\BorderViewLayout.cs\" />\n    <Compile Include=\"GeeUI\\ViewLayouts\\ExpandToFitLayout.cs\" />\n    <Compile Include=\"GeeUI\\ViewLayouts\\HorizontalViewLayout.cs\" />\n    <Compile Include=\"GeeUI\\ViewLayouts\\SpinViewLayout.cs\" />\n    <Compile Include=\"GeeUI\\ViewLayouts\\VerticalViewLayout.cs\" />\n    <Compile Include=\"GeeUI\\ViewLayouts\\ViewLayout.cs\" />\n    <Compile Include=\"GeeUI\\Views\\DropDownView.cs\" />\n    <Compile Include=\"GeeUI\\Views\\ListView.cs\" />\n    <Compile Include=\"GeeUI\\Views\\EmptyView.cs\" />\n    <Compile Include=\"GeeUI\\Views\\ButtonView.cs\" />\n    <Compile Include=\"GeeUI\\Views\\CheckBoxView.cs\" />\n    <Compile Include=\"GeeUI\\Views\\ImageView.cs\" />\n    <Compile Include=\"GeeUI\\Views\\PanelView.cs\" />\n    <Compile Include=\"GeeUI\\Views\\SliderView.cs\" />\n    <Compile Include=\"GeeUI\\Views\\TabContainer.cs\" />\n    <Compile Include=\"GeeUI\\Views\\TabHost.cs\" />\n    <Compile Include=\"GeeUI\\Views\\TabView.cs\" />\n    <Compile Include=\"GeeUI\\Views\\TextFieldView.cs\" />\n    <Compile Include=\"GeeUI\\Views\\TextView.cs\" />\n    <Compile Include=\"GeeUI\\Views\\View.cs\" />\n    <Compile Include=\"GeeUI\\Views\\WindowView.cs\" />\n    <Compile Include=\"GInterfaces\\ConsoleUI.cs\" />\n    <Compile Include=\"Components\\TimeTrialUI.cs\" />\n    <Compile Include=\"GInterfaces\\TextPrompt.cs\" />\n    <Compile Include=\"GInterfaces\\WorkShopInterface.cs\" />\n    <Compile Include=\"Graphics\\Cloud.cs\" />\n    <Compile Include=\"MainMenu.cs\" />\n    <Compile Include=\"Oculus.cs\" />\n    <Compile Include=\"Player\\BlockPredictor.cs\" />\n    <Compile Include=\"Player\\Jump.cs\" />\n    <Compile Include=\"Player\\PhoneNote.cs\" />\n    <Compile Include=\"Player\\RollKickSlide.cs\" />\n    <Compile Include=\"Player\\RotationController.cs\" />\n    <Compile Include=\"Player\\Rumble.cs\" />\n    <Compile Include=\"Player\\TargetUI.cs\" />\n    <Compile Include=\"Player\\Vault.cs\" />\n    <Compile Include=\"Player\\VirtualReticle.cs\" />\n    <Compile Include=\"Player\\VoxelTools.cs\" />\n    <Compile Include=\"Player\\WallRun.cs\" />\n    <Compile Include=\"Scripts\\Abilities.cs\" />\n    <Compile Include=\"UI\\UIFactory.cs\" />\n    <Compile Include=\"Util\\BitWorker.cs\" />\n    <Compile Include=\"Util\\BSpline.cs\" />\n    <Compile Include=\"Util\\DialogueForest.cs\" />\n    <Compile Include=\"Components\\SoundKiller.cs\" />\n    <Compile Include=\"Components\\SignalTower.cs\" />\n    <Compile Include=\"Player\\Phone.cs\" />\n    <Compile Include=\"Components\\RaycastAI.cs\" />\n    <Compile Include=\"Components\\Trigger.cs\" />\n    <Compile Include=\"Components\\PID.cs\" />\n    <Compile Include=\"Util\\Noise3D.cs\" />\n    <Compile Include=\"Components\\EnemyBase.cs\" />\n    <Compile Include=\"Components\\PhysicsSphere.cs\" />\n    <Compile Include=\"Components\\PlayerCylinderTrigger.cs\" />\n    <Compile Include=\"Components\\PostInitialization.cs\" />\n    <Compile Include=\"Components\\Zone.cs\" />\n    <Compile Include=\"Factories\\CloudFactory.cs\" />\n    <Compile Include=\"Factories\\LowerLimitFactory.cs\" />\n    <Compile Include=\"Factories\\DialogueFileFactory.cs\" />\n    <Compile Include=\"Factories\\SignalTowerFactory.cs\" />\n    <Compile Include=\"Factories\\EvilBlocksFactory.cs\" />\n    <Compile Include=\"Factories\\SwitchFactory.cs\" />\n    <Compile Include=\"Factories\\NoteFactory.cs\" />\n    <Compile Include=\"Factories\\EntityConnectable.cs\" />\n    <Compile Include=\"Factories\\VoxelFillFactory.cs\" />\n    <Compile Include=\"Factories\\TriggerFactory.cs\" />\n    <Compile Include=\"Factories\\SmokeFactory.cs\" />\n    <Compile Include=\"Factories\\LevitatorFactory.cs\" />\n    <Compile Include=\"Components\\Explosion.cs\" />\n    <Compile Include=\"Factories\\ExploderFactory.cs\" />\n    <Compile Include=\"Factories\\SpinnerFactory.cs\" />\n    <Compile Include=\"Factories\\JointFactory.cs\" />\n    <Compile Include=\"Factories\\SceneryBlockFactory.cs\" />\n    <Compile Include=\"Factories\\SkyboxFactory.cs\" />\n    <Compile Include=\"Factories\\VoxelAttachable.cs\" />\n    <Compile Include=\"Factories\\RainFactory.cs\" />\n    <Compile Include=\"Factories\\SliderFactory.cs\" />\n    <Compile Include=\"Factories\\TargetFactory.cs\" />\n    <Compile Include=\"Factories\\SnakeFactory.cs\" />\n    <Compile Include=\"Factories\\ParticleEmitterFactory.cs\" />\n    <Compile Include=\"Factories\\PlayerDataFactory.cs\" />\n    <Compile Include=\"Factories\\EffectBlockFactory.cs\" />\n    <Compile Include=\"Factories\\FallingTowerFactory.cs\" />\n    <Compile Include=\"Factories\\MapExitFactory.cs\" />\n    <Compile Include=\"Factories\\PropFactory.cs\" />\n    <Compile Include=\"Factories\\SoundFactory.cs\" />\n    <Compile Include=\"Components\\VoxelChaseAI.cs\" />\n    <Compile Include=\"Graphics\\DynamicModel.cs\" />\n    <Compile Include=\"Graphics\\LineDrawer.cs\" />\n    <Compile Include=\"Factories\\ZoneFactory.cs\" />\n    <Compile Include=\"Factories\\EmptyFactory.cs\" />\n    <Compile Include=\"Graphics\\AmbientLight.cs\" />\n    <Compile Include=\"Components\\Animation.cs\" />\n    <Compile Include=\"Graphics\\SpotLight.cs\" />\n    <Compile Include=\"Graphics\\DirectionalLight.cs\" />\n    <Compile Include=\"Player\\AnimationController.cs\" />\n    <Compile Include=\"Player\\CameraController.cs\" />\n    <Compile Include=\"Player\\FallDamage.cs\" />\n    <Compile Include=\"Player\\Footsteps.cs\" />\n    <Compile Include=\"Player\\Player.cs\" />\n    <Compile Include=\"Components\\PhysicsBlock.cs\" />\n    <Compile Include=\"Graphics\\PointLight.cs\" />\n    <Compile Include=\"Components\\Script.cs\" />\n    <Compile Include=\"Components\\Updater.cs\" />\n    <Compile Include=\"Editor\\Editor.cs\" />\n    <Compile Include=\"Factories\\AmbientLightFactory.cs\" />\n    <Compile Include=\"Factories\\AmbientSoundFactory.cs\" />\n    <Compile Include=\"Factories\\BlockFactory.cs\" />\n    <Compile Include=\"Factories\\WaterFactory.cs\" />\n    <Compile Include=\"Factories\\SpotLightFactory.cs\" />\n    <Compile Include=\"Factories\\PlayerTriggerFactory.cs\" />\n    <Compile Include=\"Factories\\ScriptFactory.cs\" />\n    <Compile Include=\"Player\\PlayerFactory.cs\" />\n    <Compile Include=\"Factories\\EditorFactory.cs\" />\n    <Compile Include=\"Factories\\PointLightFactory.cs\" />\n    <Compile Include=\"Factories\\TurretFactory.cs\" />\n    <Compile Include=\"Factories\\WorldFactory.cs\" />\n    <Compile Include=\"Components\\Water.cs\" />\n    <Compile Include=\"Menu.cs\" />\n    <Compile Include=\"Player\\PlayerUI.cs\" />\n    <Compile Include=\"Screenshot.cs\" />\n    <Compile Include=\"Strings.cs\" />\n    <Compile Include=\"UI\\Container.cs\" />\n    <Compile Include=\"UI\\LineDrawer2D.cs\" />\n    <Compile Include=\"UI\\ListContainer.cs\" />\n    <Compile Include=\"UI\\Scroller.cs\" />\n    <Compile Include=\"UI\\Sprite.cs\" />\n    <Compile Include=\"Graphics\\ModelInstance.cs\" />\n    <Compile Include=\"Graphics\\ParticleEmitter.cs\" />\n    <Compile Include=\"Graphics\\ParticleSystem.cs\" />\n    <Compile Include=\"UI\\TextElement.cs\" />\n    <Compile Include=\"Factories\\DirectionalLightFactory.cs\" />\n    <Compile Include=\"Factories\\PlayerSpawnFactory.cs\" />\n    <Compile Include=\"Factories\\VoxelFactory.cs\" />\n    <Compile Include=\"Components\\Timer.cs\" />\n    <Compile Include=\"IO\\FPSInput.cs\" />\n    <Compile Include=\"UI\\UIComponent.cs\" />\n    <Compile Include=\"UI\\UIRenderer.cs\" />\n    <Compile Include=\"Util\\AngleTools.cs\" />\n    <Compile Include=\"Util\\BlockingQueue.cs\" />\n    <Compile Include=\"Util\\BoundingBoxExtensions.cs\" />\n    <Compile Include=\"Player\\Character.cs\" />\n    <Compile Include=\"Util\\Algorithms.cs\" />\n    <Compile Include=\"Util\\CustomFluidVolume.cs\" />\n    <Compile Include=\"Util\\LargeObjectHeap.cs\" />\n    <Compile Include=\"Util\\PriorityQueue.cs\" />\n    <Compile Include=\"Util\\ScriptBase.cs\" />\n    <Compile Include=\"Util\\SteamWorker.cs\" />\n    <Compile Include=\"Util\\VectorExtensions.cs\" />\n    <Compile Include=\"Graphics\\AnimatedModel.cs\" />\n    <Compile Include=\"Graphics\\FullscreenQuad.cs\" />\n    <Compile Include=\"Graphics\\LightingManager.cs\" />\n    <Compile Include=\"Graphics\\Renderer.cs\" />\n    <Compile Include=\"Graphics\\Model.cs\" />\n    <Compile Include=\"IO\\PCInput.cs\" />\n    <Compile Include=\"IO\\MapLoader.cs\" />\n    <Compile Include=\"Graphics\\Camera.cs\" />\n    <Compile Include=\"Components\\PlayerTrigger.cs\" />\n    <Compile Include=\"Util\\Direction.cs\" />\n    <Compile Include=\"Main.cs\" />\n    <Compile Include=\"Components\\Voxel.cs\" />\n    <Compile Include=\"Components\\PlayerSpawn.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Util\\LambdaComparer.cs\" />\n    <Compile Include=\"Util\\RectangleExtensions.cs\" />\n    <Compile Include=\"Util\\VoxelAStar.cs\" />\n    <Compile Include=\"Util\\WwisePicker.cs\" />\n    <Compile Include=\"Wwise_IDs.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <NestedContentProject Include=\"Content\\Content.contentproj\">\n      <Project>6d5dbc4b-1de9-47b2-92af-546c5d1e4268</Project>\n      <Visible>False</Visible>\n    </NestedContentProject>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\BEPUphysics\\BEPUphysics.csproj\">\n      <Project>{2A9D2227-78D7-4804-B6D1-560BB43AE911}</Project>\n      <Name>BEPUphysics</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\BEPUutilities\\BEPUutilities.csproj\">\n      <Project>{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}</Project>\n      <Name>BEPUutilities</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\ComponentBind\\ComponentBind.csproj\">\n      <Project>{2D0637AB-A380-4C97-A329-BF7C40C99495}</Project>\n      <Name>ComponentBind</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Excel\\Excel.csproj\">\n      <Project>{4CB0690E-3E7A-497C-9116-D52024F63195}</Project>\n      <Name>Excel</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Newtonsoft.Json\\Newtonsoft.Json.Net40.csproj\">\n      <Project>{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}</Project>\n      <Name>Newtonsoft.Json.Net40</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\SharpZipLib\\src\\ICSharpCode.SharpZLib.csproj\">\n      <Project>{0e7413ff-eb9e-4714-acf2-be3a6a7b2ffd}</Project>\n      <Name>ICSharpCode.SharpZLib</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\SkinnedModel\\SkinnedModelContent.csproj\">\n      <Project>{882A32E7-CB48-4E63-8180-0D1859575723}</Project>\n      <Name>SkinnedModelContent</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Steamworks.NET\\Standalone\\Steamworks.NET.csproj\">\n      <Project>{b3543600-587c-4fdc-994a-cb0bdc629a7e}</Project>\n      <Name>Steamworks.NET</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Wwise\\Wwise.csproj\">\n      <Project>{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}</Project>\n      <Name>Wwise</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"Content\\EngineContent.XNA.contentproj\">\n      <Project>{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}</Project>\n      <Name>EngineContent.XNA %28Content%29</Name>\n      <XnaReferenceType>Content</XnaReferenceType>\n    </ProjectReference>\n    <ProjectReference Include=\"Game\\Game.XNA.contentproj\">\n      <Project>{D487DC94-C8CB-44EB-8A6C-026D03936D1A}</Project>\n      <Name>Game.XNA %28Content\\Game%29</Name>\n      <XnaReferenceType>Content</XnaReferenceType>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.2.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.3.1\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 3.1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Xna.Framework.3.0\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft XNA Framework Redistributable 3.0</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Xna.Framework.4.0\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft XNA Framework Redistributable 4.0</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"attribution.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <None Include=\"app.manifest\" />\n    <None Include=\"GeeUI\\Resources\\btn_clicked.9.png\" />\n    <None Include=\"GeeUI\\Resources\\btn_default.9.png\" />\n    <None Include=\"GeeUI\\Resources\\btn_hover.9.png\" />\n    <Content Include=\"CSteamworks.dll\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"GeeUI\\Resources\\checkbox_checked.png\" />\n    <Content Include=\"GeeUI\\Resources\\checkbox_checked_selected.png\" />\n    <Content Include=\"GeeUI\\Resources\\checkbox_default.png\" />\n    <Content Include=\"GeeUI\\Resources\\checkbox_default_selected.png\" />\n    <None Include=\"GeeUI\\Resources\\panel_selected.png\" />\n    <None Include=\"GeeUI\\Resources\\panel_unselected.png\" />\n    <None Include=\"GeeUI\\Resources\\slider.png\" />\n    <None Include=\"GeeUI\\Resources\\sliderRange.9.png\" />\n    <None Include=\"GeeUI\\Resources\\sliderRange.png\" />\n    <None Include=\"GeeUI\\Resources\\sliderSelected.png\" />\n    <None Include=\"GeeUI\\Resources\\textfield_default.9.png\" />\n    <None Include=\"GeeUI\\Resources\\textfield_selected.9 .png\" />\n    <None Include=\"GeeUI\\Resources\\textfield_selected_right.9.png\" />\n    <None Include=\"GeeUI\\Resources\\textfield_selected_wrong.9.png\" />\n    <None Include=\"GeeUI\\Resources\\window_selected.9.png\" />\n    <None Include=\"GeeUI\\Resources\\window_unselected.9.png\" />\n    <None Include=\"GeeUI\\Resources\\dropdown.png\" />\n    <Content Include=\"icon.ico\" />\n    <Content Include=\"Lemma VR.lnk\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"OculusPlugin.dll\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"README.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"steam_api.dll\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"steam_appid.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"AdapterSelectorForm.resx\">\n      <DependentUpon>AdapterSelectorForm.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"ErrorForm.resx\">\n      <DependentUpon>ErrorForm.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"GeeUI\\Resource1.resx\">\n      <Generator>PublicResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resource11.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Game\\*.cs\" />\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\Microsoft\\XNA Game Studio\\Microsoft.Xna.GameStudio.targets\" Condition=\"\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "Lemma/Main.cs",
    "content": "using System;\nusing System.Security.Cryptography.X509Certificates;\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Threading;\nusing GeeUI.ViewLayouts;\nusing GeeUI.Views;\nusing Lemma.Console;\nusing Lemma.GInterfaces;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Audio;\nusing Microsoft.Xna.Framework.Content;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Input;\n\nusing Lemma.Components;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing System.Linq;\nusing BEPUphysics;\nusing System.Reflection;\nusing System.Globalization;\nusing GeeUI;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\nusing ICSharpCode.SharpZipLib.GZip;\nusing System.Xml.Serialization;\n\nnamespace Lemma\n{\n\tpublic class Main : BaseMain\n\t{\n\t\tstatic Main()\n\t\t{\n\t\t\tJsonConvert.DefaultSettings = delegate()\n\t\t\t{\n\t\t\t\tJsonSerializerSettings settings = new JsonSerializerSettings();\n\t\t\t\tsettings.Converters.Add(new StringEnumConverter());\n\t\t\t\treturn settings;\n\t\t\t};\n\t\t}\n\n\t\tpublic const string InitialMap = \"rain\";\n\n\t\tpublic string Font\n\t\t{\n\t\t\tget\n\t\t\t{\n#if VR\n\t\t\t\tif (this.VR)\n\t\t\t\t\treturn \"FontVR\";\n\t\t\t\telse\n#endif\n\t\t\t\t\treturn \"Font\";\n\t\t\t}\n\t\t}\n\n\t\tpublic float FontMultiplier\n\t\t{\n\t\t\tget\n\t\t\t{\n#if VR\n\t\t\t\tif (this.VR)\n\t\t\t\t\treturn 16.0f / 11.0f;\n\t\t\t\telse\n#endif\n\t\t\t\t\treturn 1.0f;\n\t\t\t}\n\t\t}\n\n\t\tpublic string FontLarge\n\t\t{\n\t\t\tget\n\t\t\t{\n#if VR\n\t\t\t\tif (this.VR)\n\t\t\t\t\treturn \"FontLargeVR\";\n\t\t\t\telse\n#endif\n\t\t\t\t\treturn \"FontLarge\";\n\t\t\t}\n\t\t}\n\n\t\tpublic const int SteamAppID = 300340;\n\n\t\tpublic const string MenuMap = \"..\\\\menu\";\n\t\tpublic const string TemplateMap = \"..\\\\template\";\n\n\t\tpublic class ExitException : Exception\n\t\t{\n\t\t}\n\n\t\tpublic const int ConfigVersion = 9;\n\t\tpublic const int MapVersion = 1027;\n\t\tpublic const int Build = 1088;\n\n\t\tpublic class Config\n\t\t{\n\t\t\tpublic enum Lang\n\t\t\t{\n\t\t\t\ten,\n\t\t\t\tes,\n\t\t\t\tfr,\n\t\t\t\tpl,\n\t\t\t\thu,\n\t\t\t\ttr,\n\t\t\t}\n\t\t\tpublic enum RecordAnalytics\n\t\t\t{\n\t\t\t\tAsk,\n\t\t\t\tOn,\n\t\t\t\tOff,\n\t\t\t}\n\t\t\tpublic Property<Lang> Language = new Property<Lang>();\n\t\t\tpublic Property<bool> Fullscreen = new Property<bool>();\n\t\t\tpublic Property<Point> Size = new Property<Point>();\n\t\t\tpublic Property<bool> Borderless = new Property<bool>();\n\t\t\tpublic Property<Point> FullscreenResolution = new Property<Point>();\n\t\t\tpublic Property<float> MotionBlurAmount = new Property<float>();\n\t\t\tpublic Property<float> Gamma = new Property<float>();\n\t\t\tpublic Property<bool> Reflections = new Property<bool>();\n\t\t\tpublic Property<bool> SSAO = new Property<bool>();\n\t\t\tpublic Property<bool> VolumetricLighting = new Property<bool>();\n\t\t\tpublic Property<bool> Bloom = new Property<bool>();\n\t\t\tpublic Property<LightingManager.DynamicShadowSetting> DynamicShadows = new Property<LightingManager.DynamicShadowSetting>();\n\t\t\tpublic Property<bool> InvertMouseX = new Property<bool>();\n\t\t\tpublic Property<bool> InvertMouseY = new Property<bool>();\n\t\t\tpublic Property<bool> ControllerVibration = new Property<bool>();\n\t\t\tpublic Property<bool> EnableReticle = new Property<bool>();\n\t\t\tpublic Property<bool> EnableReticleVR = new Property<bool>();\n\t\t\tpublic Property<bool> EnableWaypoints = new Property<bool>();\n\t\t\tpublic Property<float> MouseSensitivity = new Property<float>();\n\t\t\tpublic Property<float> FieldOfView = new Property<float>();\n\t\t\tpublic Property<bool> Vsync = new Property<bool>();\n\t\t\tpublic Property<float> SoundEffectVolume = new Property<float> { Value = 1.0f };\n\t\t\tpublic Property<float> MusicVolume = new Property<float> { Value = 1.0f };\n\t\t\tpublic Property<int> FPSLimit = new Property<int>();\n\t\t\tpublic Property<RecordAnalytics> Analytics = new Property<RecordAnalytics>();\n\t\t\tpublic Property<bool> MinimizeCameraMovement = new Property<bool>();\n\t\t\tpublic Property<bool> MinimizeCameraMovementVR = new Property<bool>();\n\t\t\t[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n\t\t\tpublic bool GodMode;\n\t\t\t[JsonIgnore]\n\t\t\tpublic Property<bool> GodModeProperty = new Property<bool>();\n\t\t\t[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]\n\t\t\tpublic int LevelIndex;\n\t\t\t[JsonIgnore]\n\t\t\tpublic Property<int> LevelIndexProperty = new Property<int>();\n\t\t\tpublic int Version;\n\t\t\tpublic string UUID;\n\t\t\tpublic Property<PCInput.PCInputBinding> Forward = new Property<PCInput.PCInputBinding>();\n\t\t\tpublic Property<PCInput.PCInputBinding> Left = new Property<PCInput.PCInputBinding>();\n\t\t\tpublic Property<PCInput.PCInputBinding> Right = new Property<PCInput.PCInputBinding>();\n\t\t\tpublic Property<PCInput.PCInputBinding> Backward = new Property<PCInput.PCInputBinding>();\n\t\t\tpublic Property<PCInput.PCInputBinding> Jump = new Property<PCInput.PCInputBinding>();\n\t\t\tpublic Property<PCInput.PCInputBinding> Parkour = new Property<PCInput.PCInputBinding>();\n\t\t\tpublic Property<PCInput.PCInputBinding> RollKick = new Property<PCInput.PCInputBinding>();\n\t\t\tpublic Property<PCInput.PCInputBinding> TogglePhone = new Property<PCInput.PCInputBinding>();\n\t\t\tpublic Property<PCInput.PCInputBinding> QuickSave = new Property<PCInput.PCInputBinding>();\n\t\t\tpublic Property<PCInput.PCInputBinding> ToggleFullscreen = new Property<PCInput.PCInputBinding>();\n\t\t\tpublic Property<PCInput.PCInputBinding> ToggleConsole = new Property<PCInput.PCInputBinding>();\n\t\t\tpublic Property<PCInput.PCInputBinding> RecenterVRPose = new Property<PCInput.PCInputBinding>();\n\n\t\t\tpublic Config()\n\t\t\t{\n\t\t\t\tthis.FactoryDefaults();\n\t\t\t}\n\n\t\t\tpublic void DefaultControls()\n\t\t\t{\n\t\t\t\tthis.Forward.Value = new PCInput.PCInputBinding { Key = Keys.W };\n\t\t\t\tthis.Left.Value = new PCInput.PCInputBinding { Key = Keys.A };\n\t\t\t\tthis.Right.Value = new PCInput.PCInputBinding { Key = Keys.D };\n\t\t\t\tthis.Backward.Value = new PCInput.PCInputBinding { Key = Keys.S };\n\t\t\t\tthis.Jump.Value = new PCInput.PCInputBinding { Key = Keys.Space, GamePadButton = Buttons.RightTrigger };\n\t\t\t\tthis.Parkour.Value = new PCInput.PCInputBinding { Key = Keys.LeftShift, GamePadButton = Buttons.LeftTrigger };\n\t\t\t\tthis.RollKick.Value = new PCInput.PCInputBinding { MouseButton = PCInput.MouseButton.LeftMouseButton, GamePadButton = Buttons.LeftStick };\n\t\t\t\tthis.TogglePhone.Value = new PCInput.PCInputBinding { Key = Keys.Tab, GamePadButton = Buttons.Y };\n\t\t\t\tthis.QuickSave.Value = new PCInput.PCInputBinding { Key = Keys.F5 };\n\t\t\t\tthis.ToggleFullscreen.Value = new PCInput.PCInputBinding { Key = Keys.F11 };\n\t\t\t\tthis.ToggleConsole.Value = new PCInput.PCInputBinding { Key = Keys.OemTilde };\n\t\t\t\tthis.RecenterVRPose.Value = new PCInput.PCInputBinding { Key = Keys.F2, GamePadButton = Buttons.Back };\n\t\t\t\tthis.InvertMouseX.Value = false;\n\t\t\t\tthis.InvertMouseY.Value = false;\n\t\t\t\tthis.ControllerVibration.Value = true;\n\t\t\t\tthis.MouseSensitivity.Value = 1.0f;\n\t\t\t}\n\n\t\t\tpublic void DefaultOptions()\n\t\t\t{\n\t\t\t\tthis.Version = Main.ConfigVersion;\n\t\t\t\tthis.Language.Value = default(Lang);\n\t\t\t\tthis.Fullscreen.Value = true;\n\t\t\t\tthis.Size.Value = new Point(1280, 720);\n\t\t\t\tthis.Borderless.Value = true;\n\t\t\t\tthis.FullscreenResolution.Value = Point.Zero;\n\t\t\t\tthis.MotionBlurAmount.Value = 0.5f;\n\t\t\t\tthis.Gamma.Value = 1.0f;\n\t\t\t\tthis.Reflections.Value = true;\n\t\t\t\tthis.VolumetricLighting.Value = true;\n\t\t\t\tthis.Bloom.Value = true;\n\t\t\t\tthis.DynamicShadows.Value = LightingManager.DynamicShadowSetting.High;\n\t\t\t\tthis.EnableReticle.Value = false;\n\t\t\t\tthis.EnableReticleVR.Value = true;\n\t\t\t\tthis.EnableWaypoints.Value = true;\n\t\t\t\tthis.FieldOfView.Value = MathHelper.ToRadians(80.0f);\n\t\t\t\tthis.Vsync.Value = false;\n\t\t\t\tthis.SoundEffectVolume.Value = 1.0f;\n\t\t\t\tthis.MusicVolume.Value = 1.0f;\n\t\t\t\tthis.FPSLimit.Value = 120;\n\t\t\t}\n\n\t\t\tpublic void FactoryDefaults()\n\t\t\t{\n\t\t\t\tthis.DefaultOptions();\n\t\t\t\tthis.DefaultControls();\n\t\t\t}\n\t\t}\n\n\t\tpublic class SaveInfo\n\t\t{\n\t\t\tpublic static XmlSerializer Serializer = new XmlSerializer(typeof(SaveInfo), IO.MapLoader.IncludedTypes);\n\t\t\tpublic string MapFile;\n\t\t\tpublic int Version;\n\t\t\tpublic Entity PlayerData;\n\t\t}\n\n\t\tpublic Config Settings;\n\n\t\tpublic static string DataDirectory\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), \"Lemma\");\n\t\t\t}\n\t\t}\n\n\t\tpublic string SaveDirectory;\n\t\tprivate string analyticsDirectory;\n\t\tpublic string CustomMapDirectory;\n\t\tpublic string MapDirectory;\n\t\tprivate string settingsFile;\n\n\t\tpublic Screenshot Screenshot;\n\n\t\tpublic Menu Menu;\n\t\tpublic UIFactory UIFactory;\n\n\t\tpublic Camera Camera;\n\t\tpublic AkListener Listener;\n\n\t\tpublic GraphicsDeviceManager Graphics;\n\t\tpublic Renderer Renderer;\n\n\t\tprotected RenderParameters renderParameters;\n\t\tpublic RenderTarget2D RenderTarget;\n\n\t\tprivate const float performanceUpdateTime = 0.5f;\n\t\tprivate float performanceInterval;\n\n\t\tprivate ListContainer performanceMonitor;\n\n\t\tprivate int frameSum;\n\t\tprivate Property<float> frameRate = new Property<float>();\n\t\tprivate double physicsSum;\n\t\tprivate Property<double> physicsTime = new Property<double>();\n\t\tprivate double updateSum;\n\t\tprivate Property<double> updateTime = new Property<double>();\n\t\tprivate double renderSum;\n\t\tprivate Property<double> renderTime = new Property<double>();\n\t\tprivate Property<int> drawCalls = new Property<int>();\n\t\tprivate Property<int> workingSet = new Property<int>();\n\t\tprivate int drawCallCounter;\n\t\tprivate Property<int> triangles = new Property<int>();\n\t\tprivate int triangleCounter;\n\n\t\tprivate Animation scheduledSave;\n\n\t\tpublic Property<Point> ScreenSize = new Property<Point>();\n\n\t\tpublic Property<bool> MinimizeCameraMovement;\n\n\t\tpublic LightingManager LightingManager;\n\n\t\tpublic UIRenderer UI;\n\t\tpublic GeeUIMain GeeUI;\n\n\t\tpublic Console.Console Console;\n\t\tpublic ConsoleUI ConsoleUI;\n\n\t\tprivate bool mapLoaded;\n\n\t\tpublic Space Space;\n\n\t\tprivate TimeSpan targetElapsedTime;\n\n\t\tprivate List<IGraphicsComponent> graphicsComponents = new List<IGraphicsComponent>();\n\t\tprivate List<IDrawableComponent> drawables = new List<IDrawableComponent>();\n\t\tprivate List<IEarlyUpdateableComponent> earlyUpdateables = new List<IEarlyUpdateableComponent>();\n\t\tprivate List<IUpdateableComponent> updateables = new List<IUpdateableComponent>();\n\t\tprivate List<IDrawablePreFrameComponent> preframeDrawables = new List<IDrawablePreFrameComponent>();\n\t\tprivate List<INonPostProcessedDrawableComponent> nonPostProcessedDrawables = new List<INonPostProcessedDrawableComponent>();\n\t\tprivate List<IDrawableAlphaComponent> alphaDrawables = new List<IDrawableAlphaComponent>();\n\t\tprivate List<IDrawablePostAlphaComponent> postAlphaDrawables = new List<IDrawablePostAlphaComponent>();\n\n\t\tprivate Point? resize;\n\n\t\tpublic Property<string> MapFile = new Property<string>();\n\n\t\tpublic Spawner Spawner;\n\n\t\tpublic Property<KeyboardState> LastKeyboardState = new Property<KeyboardState>();\n\t\tpublic Property<KeyboardState> KeyboardState = new Property<KeyboardState>();\n\t\tpublic Property<MouseState> LastMouseState = new Property<MouseState>();\n\t\tpublic Property<MouseState> MouseState = new Property<MouseState>();\n\t\tpublic Property<GamePadState> LastGamePadState = new Property<GamePadState>();\n\t\tpublic Property<GamePadState> GamePadState = new Property<GamePadState>();\n\t\tpublic Property<bool> GamePadConnected = new Property<bool>();\n\n\t\tpublic Property<float> TimeMultiplier = new Property<float> { Value = 1.0f };\n\t\tpublic Property<float> BaseTimeMultiplier = new Property<float> { Value = 1.0f };\n\t\tpublic Property<float> PauseAudioEffect = new Property<float> { Value = 0.0f };\n\n\t\tpublic static Property<float> TotalGameTime = new Property<float>(); \n\n\t\tpublic Strings Strings = new Strings();\n\n\t\tpublic bool IsLoadingMap = false;\n\n\t\tpublic Command<string> LoadingMap = new Command<string>();\n\n\t\tpublic Command MapLoaded = new Command();\n\n\t\tprotected bool drawablesModified;\n\t\tprotected bool earlyUpdateablesModified;\n\t\tprotected bool alphaDrawablesModified;\n\t\tprotected bool postAlphaDrawablesModified;\n\t\tprotected bool nonPostProcessedDrawablesModified;\n\n\t\tprivate Dictionary<string, float> times;\n\t\tprivate string timesFile;\n\n\t\tprivate SpriteBatch spriteBatch;\n\n#if VR\n\t\tpublic bool VR;\n\t\tpublic const float VRUnitToWorldUnit = 1.5f;\n\t\tpublic Ovr.Hmd VRHmd;\n\t\tprivate Ovr.HmdDesc vrHmdDesc;\n\n\t\tprivate RenderTarget2D vrLeftEyeTarget;\n\t\tprivate RenderTarget2D vrRightEyeTarget;\n\t\tpublic Property<Point> VRActualScreenSize = new Property<Point>();\n\t\tprivate Effect vrEffect;\n\t\tprivate Oculus.DistortionMesh vrLeftMesh = new Oculus.DistortionMesh();\n\t\tprivate Oculus.DistortionMesh vrRightMesh = new Oculus.DistortionMesh();\n\t\tprivate Ovr.FovPort vrLeftFov;\n\t\tprivate Ovr.FovPort vrRightFov;\n\t\tprivate Ovr.EyeRenderDesc vrLeftEyeRenderDesc;\n\t\tprivate Ovr.EyeRenderDesc vrRightEyeRenderDesc;\n\t\tprivate Camera vrCamera;\n\t\tpublic Lemma.Components.ModelNonPostProcessed VRUI;\n\t\tpublic Property<Matrix> VRLastViewProjection = new Property<Matrix>();\n\t\tprivate bool oculusNotFound;\n#endif\n\n\t\tpublic bool IsChallengeMap(string map)\n\t\t{\n\t\t\tif (map == null)\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t{\n\t\t\t\tstring directory = Path.GetDirectoryName(Path.IsPathRooted(map) ? map : Path.GetFullPath(Path.Combine(this.MapDirectory, map)));\n\t\t\t\treturn directory == this.CustomMapDirectory || directory == Path.GetFullPath(Path.Combine(this.MapDirectory, \"Challenge\")) || Path.GetDirectoryName(directory) == SteamWorker.DownloadedMaps.FullName;\n\t\t\t}\n\t\t}\n\n\t\tpublic string GetFullMapPath()\n\t\t{\n\t\t\t// Don't try to load the menu from a save game\n\t\t\tstring filename = this.MapFile;\n\t\t\tif (filename == null)\n\t\t\t\treturn null;\n\n\t\t\tstring directory;\n\t\t\tif (this.CurrentSave.Value == null || filename == Main.MenuMap)\n\t\t\t\tdirectory = this.MapDirectory;\n\t\t\telse\n\t\t\t\tdirectory = Path.Combine(this.SaveDirectory, this.CurrentSave);\n\n\t\t\tstring filenameWithExtension = filename;\n\t\t\tif (!filenameWithExtension.EndsWith(IO.MapLoader.MapExtension))\n\t\t\t\tfilenameWithExtension += IO.MapLoader.MapExtension;\n\n\t\t\treturn Path.IsPathRooted(filenameWithExtension) ? filenameWithExtension : Path.Combine(directory, filenameWithExtension);\n\t\t}\n\n\t\tpublic void FlushComponents()\n\t\t{\n\t\t\tfor (int i = 0; i < this.componentsToAdd.Count; i++)\n\t\t\t{\n\t\t\t\tIComponent c = this.componentsToAdd[i];\n\t\t\t\tc.Start();\n\t\t\t\tType t = c.GetType();\n\t\t\t\tif (typeof(IGraphicsComponent).IsAssignableFrom(t))\n\t\t\t\t\tthis.graphicsComponents.Add((IGraphicsComponent)c);\n\t\t\t\tif (typeof(IDrawableComponent).IsAssignableFrom(t))\n\t\t\t\t{\n\t\t\t\t\tthis.drawables.Add((IDrawableComponent)c);\n\t\t\t\t\tthis.drawablesModified = true;\n\t\t\t\t}\n\t\t\t\tif (typeof(IEarlyUpdateableComponent).IsAssignableFrom(t))\n\t\t\t\t{\n\t\t\t\t\tthis.earlyUpdateables.Add((IEarlyUpdateableComponent)c);\n\t\t\t\t\tthis.earlyUpdateablesModified = true;\n\t\t\t\t}\n\t\t\t\tif (typeof(IUpdateableComponent).IsAssignableFrom(t))\n\t\t\t\t\tthis.updateables.Add((IUpdateableComponent)c);\n\t\t\t\tif (typeof(IDrawablePreFrameComponent).IsAssignableFrom(t))\n\t\t\t\t\tthis.preframeDrawables.Add((IDrawablePreFrameComponent)c);\n\t\t\t\tif (typeof(INonPostProcessedDrawableComponent).IsAssignableFrom(t))\n\t\t\t\t{\n\t\t\t\t\tthis.nonPostProcessedDrawables.Add((INonPostProcessedDrawableComponent)c);\n\t\t\t\t\tthis.nonPostProcessedDrawablesModified = true;\n\t\t\t\t}\n\t\t\t\tif (typeof(IDrawableAlphaComponent).IsAssignableFrom(t))\n\t\t\t\t{\n\t\t\t\t\tthis.alphaDrawables.Add((IDrawableAlphaComponent)c);\n\t\t\t\t\tthis.alphaDrawablesModified = true;\n\t\t\t\t}\n\t\t\t\tif (typeof(IDrawablePostAlphaComponent).IsAssignableFrom(t))\n\t\t\t\t{\n\t\t\t\t\tthis.postAlphaDrawables.Add((IDrawablePostAlphaComponent)c);\n\t\t\t\t\tthis.postAlphaDrawablesModified = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.componentsToAdd.Clear();\n\n\t\t\tfor (int i = 0; i < this.componentsToRemove.Count; i++)\n\t\t\t{\n\t\t\t\tIComponent c = this.componentsToRemove[i];\n\t\t\t\tType t = c.GetType();\n\t\t\t\tif (typeof(IGraphicsComponent).IsAssignableFrom(t))\n\t\t\t\t\tthis.graphicsComponents.Remove((IGraphicsComponent)c);\n\t\t\t\tif (typeof(IEarlyUpdateableComponent).IsAssignableFrom(t))\n\t\t\t\t\tthis.earlyUpdateables.Remove((IEarlyUpdateableComponent)c);\n\t\t\t\tif (typeof(IUpdateableComponent).IsAssignableFrom(t))\n\t\t\t\t\tthis.updateables.Remove((IUpdateableComponent)c);\n\t\t\t\tif (typeof(IDrawableComponent).IsAssignableFrom(t))\n\t\t\t\t\tthis.drawables.Remove((IDrawableComponent)c);\n\t\t\t\tif (typeof(IDrawablePreFrameComponent).IsAssignableFrom(t))\n\t\t\t\t\tthis.preframeDrawables.Remove((IDrawablePreFrameComponent)c);\n\t\t\t\tif (typeof(INonPostProcessedDrawableComponent).IsAssignableFrom(t))\n\t\t\t\t\tthis.nonPostProcessedDrawables.Remove((INonPostProcessedDrawableComponent)c);\n\t\t\t\tif (typeof(IDrawableAlphaComponent).IsAssignableFrom(t))\n\t\t\t\t\tthis.alphaDrawables.Remove((IDrawableAlphaComponent)c);\n\t\t\t\tc.delete();\n\t\t\t}\n\t\t\tthis.componentsToRemove.Clear();\n\t\t}\n\n\t\tpublic void ClearEntities(bool deleteEditor)\n\t\t{\n\t\t\tif (this.MapContent != null)\n\t\t\t\tthis.MapContent.Unload();\n\t\t\tParticleSystem.Reset();\n\t\t\tthis.LightingManager.EnvironmentMap.Value = null;\n\t\t\tthis.MapContent = new ContentManager(this.Services);\n\t\t\tthis.MapContent.RootDirectory = this.Content.RootDirectory;\n\n\t\t\tif (ConsoleUI.Showing)\n\t\t\t\tConsoleUI.Showing.Value = false;\n\n\t\t\tint index = 0;\n\t\t\tint targetCount = deleteEditor ? 0 : 1;\n\t\t\twhile (this.Entities.Length > targetCount)\n\t\t\t{\n\t\t\t\tEntity entity = this.Entities[index];\n\t\t\t\tif (deleteEditor)\n\t\t\t\t\tthis.Remove(entity);\n\t\t\t\telse if (entity.Type == \"Editor\")\n\t\t\t\t\tindex++;\n\t\t\t\telse\n\t\t\t\t\tthis.Remove(entity);\n\t\t\t}\n\t\t\tthis.FlushComponents();\n\t\t\tFactory<Main>.Initialize(); // Clear factories to clear out any relationships that might confuse the garbage collector\n\t\t\tGC.Collect();\n\n\t\t\tthis.TotalTime.Value = 0.0f;\n\t\t\tthis.Renderer.BlurAmount.Value = 0.0f;\n\t\t\tthis.Renderer.Tint.Value = Vector3.One;\n\t\t\tthis.Renderer.Brightness.Value = 0.0f;\n\t\t\tthis.Renderer.SpeedBlurAmount.Value = 0.0f;\n\t\t\tthis.TimeMultiplier.Value = 1.0f;\n\t\t\tthis.BaseTimeMultiplier.Value = 1.0f;\n\t\t\tthis.PauseAudioEffect.Value = 0.0f;\n\t\t\tthis.Camera.Angles.Value = Vector3.Zero;\n\t\t\tthis.Camera.FieldOfView.Value = this.Settings.FieldOfView;\n\t\t\tthis.Menu.ClearMessages();\n\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_ALL);\n\t\t\tAkSoundEngine.SetState(AK.STATES.WATER.GROUP, AK.STATES.WATER.STATE.NORMAL);\n\t\t\tAkSoundEngine.RenderAudio();\n\t\t}\n\n\t\tpublic Command ReloadingContent = new Command();\n\t\tpublic Command ReloadedContent = new Command();\n\n\t\tpublic ContentManager MapContent;\n\n\t\tconst int maxPhysicsFramerate = 75;\n\t\t\n\t\tprivate int monitor;\n\t\tprivate DisplayMode nativeDisplayMode;\n#if VR\n\t\tpublic Main(int monitor, bool vr)\n\t\t{\n\t\t\tthis.monitor = monitor;\n\t\t\tthis.VR = vr;\n\t\t\tthis.nativeDisplayMode = GraphicsAdapter.Adapters[this.monitor].CurrentDisplayMode;\n#else\n\t\tpublic Main(int monitor)\n\t\t{\n#endif\n\t\t\tFactory<Main>.Initialize();\n\t\t\tVoxel.States.Init();\n\t\t\tEditor.SetupDefaultEditorComponents();\n\n#if STEAMWORKS\n\t\t\tif (!SteamWorker.Init())\n\t\t\t\tLog.d(\"Failed to initialize Steamworks.\");\n#if VR\n\t\t\tif (SteamWorker.Initialized && Steamworks.SteamUtils.IsSteamRunningInVR())\n\t\t\t\tthis.VR = vr = true;\n#endif\n#endif\n\n#if VR\n\t\t\tif (this.VR)\n\t\t\t{\n\t\t\t\tif (!Ovr.Hmd.Initialize(new Ovr.InitParams()))\n\t\t\t\t\tthrow new Exception(\"Failed to initialize Oculus runtime.\");\n\t\t\t\tthis.VRHmd = new Ovr.Hmd(0);\n\t\t\t\tif (this.VRHmd == null)\n\t\t\t\t{\n\t\t\t\t\tLog.d(\"Error: no Oculus found.\");\n\t\t\t\t\tthis.VR = false;\n\t\t\t\t\tthis.oculusNotFound = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!this.VRHmd.ConfigureTracking(\n\t\t\t\t\t\t(uint)Ovr.TrackingCaps.Orientation\n\t\t\t\t\t\t| (uint)Ovr.TrackingCaps.MagYawCorrection\n\t\t\t\t\t\t| (uint)Ovr.TrackingCaps.Position, 0))\n\t\t\t\t\t\tthrow new Exception(\"Failed to configure head tracking.\");\n\t\t\t\t\tthis.vrHmdDesc = this.VRHmd.GetDesc();\n\t\t\t\t\tthis.vrLeftFov = this.vrHmdDesc.MaxEyeFov[0];\n\t\t\t\t\tthis.vrRightFov = this.vrHmdDesc.MaxEyeFov[1];\n\t\t\t\t\tOvr.FovPort maxFov = new Ovr.FovPort();\n\t\t\t\t\tmaxFov.UpTan = Math.Max(this.vrLeftFov.UpTan, this.vrRightFov.UpTan);\n\t\t\t\t\tmaxFov.DownTan = Math.Max(this.vrLeftFov.DownTan, this.vrRightFov.DownTan);\n\t\t\t\t\tmaxFov.LeftTan = Math.Max(this.vrLeftFov.LeftTan, this.vrRightFov.LeftTan);\n\t\t\t\t\tmaxFov.RightTan = Math.Max(this.vrLeftFov.RightTan, this.vrRightFov.RightTan);\n\t\t\t\t\tfloat combinedTanHalfFovHorizontal = Math.Max(maxFov.LeftTan, maxFov.RightTan);\n\t\t\t\t\tfloat combinedTanHalfFovVertical = Math.Max(maxFov.UpTan, maxFov.DownTan);\n\t\t\t\t\tthis.vrLeftEyeRenderDesc = this.VRHmd.GetRenderDesc(Ovr.Eye.Left, this.vrLeftFov);\n\t\t\t\t\tthis.vrRightEyeRenderDesc = this.VRHmd.GetRenderDesc(Ovr.Eye.Right, this.vrRightFov);\n\t\t\t\t}\n\t\t\t}\n#endif\n\n\t\t\tthis.Space = new Space();\n\t\t\tthis.Space.TimeStepSettings.TimeStepDuration = 1.0f / (float)maxPhysicsFramerate;\n\t\t\tthis.ScreenSize.Value = new Point(this.Window.ClientBounds.Width, this.Window.ClientBounds.Height);\n\n\t\t\t// Give the space some threads to work with.\n\t\t\t// Just throw a thread at every processor. The thread scheduler will take care of where to put them.\n\t\t\tfor (int i = 0; i < Environment.ProcessorCount - 1; i++)\n\t\t\t\tthis.Space.ThreadManager.AddThread();\n\t\t\tthis.Space.ForceUpdater.Gravity = new Vector3(0, -18.0f, 0);\n\n\t\t\tthis.IsFixedTimeStep = false;\n\n\t\t\tthis.Window.AllowUserResizing = true;\n\t\t\tthis.Window.ClientSizeChanged += new EventHandler<EventArgs>(delegate(object obj, EventArgs e)\n\t\t\t{\n\t\t\t\tif (!this.Settings.Fullscreen)\n\t\t\t\t{\n\t\t\t\t\tRectangle bounds = this.Window.ClientBounds;\n\t\t\t\t\tthis.ScreenSize.Value = new Point(bounds.Width, bounds.Height);\n\t\t\t\t\tthis.resize = new Point(bounds.Width, bounds.Height);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.Graphics = new GraphicsDeviceManager(this);\n\n\t\t\tthis.Content = new ContentManager(this.Services);\n\t\t\tthis.Content.RootDirectory = \"Content\";\n\n\t\t\tthis.Entities = new ListProperty<Entity>();\n\n\t\t\tthis.Camera = new Camera();\n\t\t\tthis.AddComponent(this.Camera);\n\n\t\t\tLemma.Console.Console.AddConVar(new ConVar(\"player_speed\", \"Player speed.\", s =>\n\t\t\t{\n\t\t\t\tEntity playerData = PlayerDataFactory.Instance;\n\t\t\t\tif (playerData != null)\n\t\t\t\t\tplayerData.Get<PlayerData>().MaxSpeed.Value = (float)Lemma.Console.Console.GetConVar(\"player_speed\").GetCastedValue();\n\t\t\t}, \"10\") { TypeConstraint = typeof(float), Validate = o => (float)o > 0 && (float)o < 200 });\n\n\t\t\tLemma.Console.Console.AddConCommand(new ConCommand(\"help\", \"List all commands or get info about a specific command.\",\n\t\t\tdelegate(ConCommand.ArgCollection args)\n\t\t\t{\n\t\t\t\tstring cmd = (string)args.Get(\"command\");\n\t\t\t\tif (string.IsNullOrEmpty(cmd))\n\t\t\t\t\tLemma.Console.Console.Instance.ListAllConsoleStuff();\n\t\t\t\telse\n\t\t\t\t\tLemma.Console.Console.Instance.PrintConCommandDescription(cmd);\n\t\t\t},\n\t\t\tnew ConCommand.CommandArgument() { Name = \"command\", Optional = true }));\n\n\t\t\tLemma.Console.Console.AddConVar(new ConVar(\"time_scale\", \"Time scale (percentage).\", s =>\n\t\t\t{\n\t\t\t\tfloat result;\n\t\t\t\tif (float.TryParse(s, out result))\n\t\t\t\t\tthis.BaseTimeMultiplier.Value = result / 100.0f;\n\t\t\t}, \"100\") { TypeConstraint = typeof(int), Validate = o => (int)o > 0 && (int)o <= 400 });\n\n\t\t\tLemma.Console.Console.AddConCommand(new ConCommand\n\t\t\t(\n\t\t\t\t\"load\", \"Load a map.\", collection =>\n\t\t\t\t{\n\t\t\t\t\tConsoleUI.Showing.Value = false;\n\t\t\t\t\tthis.Menu.Toggle();\n\t\t\t\t\tIO.MapLoader.Transition(this, collection.ParsedArgs[0].StrValue);\n\t\t\t\t},\n\t\t\t\tnew ConCommand.CommandArgument { Name = \"map\", CommandType = typeof(string), Optional = false }\n\t\t\t));\n\n\t\t\tLemma.Console.Console.AddConVar(new ConVar(\"blocks\", \"Player block cheat (white, yellow, blue)\", s =>\n\t\t\t{\n\t\t\t\tEntity player = PlayerFactory.Instance;\n\t\t\t\tif (player != null && player.Active)\n\t\t\t\t{\n\t\t\t\t\tVoxel.t result = Voxel.t.Empty;\n\t\t\t\t\tswitch (s.ToLower())\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"white\":\n\t\t\t\t\t\t\tresult = Voxel.t.WhitePermanent;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"yellow\":\n\t\t\t\t\t\t\tresult = Voxel.t.GlowYellow;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"blue\":\n\t\t\t\t\t\t\tresult = Voxel.t.GlowBlue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tBlockCloud cloud = player.Get<BlockCloud>();\n\t\t\t\t\tcloud.Blocks.Clear();\n\t\t\t\t\tcloud.Type.Value = result;\n\t\t\t\t}\n\t\t\t}, \"none\"));\n\n\t\t\tLemma.Console.Console.AddConCommand(new ConCommand(\"reset_cheevos\", \"Reset all achievements.\", delegate(ConCommand.ArgCollection args)\n\t\t\t{\n\t\t\t\tSteamWorker.ResetAllStats(true);\n\t\t\t}));\n\n\t\t\tLemma.Console.Console.AddConCommand(new ConCommand(\"cheevos\", \"Unlock all achievements.\", delegate(ConCommand.ArgCollection args)\n\t\t\t{\n\t\t\t\tSteamWorker.SetAchievement(\"cheevo_ending_a\");\n\t\t\t\tSteamWorker.SetAchievement(\"cheevo_ending_b\");\n\t\t\t\tSteamWorker.SetAchievement(\"cheevo_ending_c\");\n\t\t\t\tSteamWorker.SetAchievement(\"cheevo_ending_d\");\n\t\t\t\tSteamWorker.SetAchievement(\"cheevo_pillar_crushed\");\n\t\t\t\tSteamWorker.SetAchievement(\"cheevo_flashback\");\n\t\t\t\tSteamWorker.SetAchievement(\"cheevo_god_mode\");\n\t\t\t\tSteamWorker.SetAchievement(\"cheevo_level_editor\");\n\n\t\t\t\tSteamWorker.SetStat(\"stat_orbs_collected\", 49);\n\t\t\t\tSteamWorker.SetStat(\"stat_notes_read\", 36);\n\t\t\t\tSteamWorker.SetStat(\"stat_challenge_levels_played\", 1);\n\t\t\t}));\n\n\t\t\tLemma.Console.Console.AddConCommand(new ConCommand(\"moves\", \"Enable all parkour moves.\", delegate(ConCommand.ArgCollection args)\n\t\t\t{\n\t\t\t\tif (PlayerDataFactory.Instance != null)\n\t\t\t\t{\n\t\t\t\t\tPlayerData playerData = PlayerDataFactory.Instance.Get<PlayerData>();\n\t\t\t\t\tplayerData.EnableRoll.Value = true;\n\t\t\t\t\tplayerData.EnableKick.Value = true;\n\t\t\t\t\tplayerData.EnableWallRun.Value = true;\n\t\t\t\t\tplayerData.EnableWallRunHorizontal.Value = true;\n\t\t\t\t\tplayerData.EnableMoves.Value = true;\n\t\t\t\t\tplayerData.EnableCrouch.Value = true;\n\t\t\t\t\tplayerData.EnableSlowMotion.Value = true;\n\t\t\t\t}\n\t\t\t}));\n\n#if DEVELOPMENT\n\t\t\tLemma.Console.Console.AddConCommand(new ConCommand(\"diavar\", \"Set a dialogue variable.\", delegate(ConCommand.ArgCollection args)\n\t\t\t{\n\t\t\t\tif (args.ParsedArgs.Length == 2)\n\t\t\t\t{\n\t\t\t\t\tif (PlayerDataFactory.Instance != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tPhone phone = PlayerDataFactory.Instance.Get<Phone>();\n\t\t\t\t\t\tphone[args.ParsedArgs[0].StrValue] = args.ParsedArgs[1].StrValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tnew ConCommand.CommandArgument { Name = \"variable\", CommandType = typeof(string), Optional = false, },\n\t\t\tnew ConCommand.CommandArgument { Name = \"value\", CommandType = typeof(string), Optional = false }\n\t\t\t));\n#endif\n\n\t\t\tLemma.Console.Console.AddConCommand(new ConCommand(\"specials\", \"Enable all special abilities.\", delegate(ConCommand.ArgCollection args)\n\t\t\t{\n\t\t\t\tif (PlayerDataFactory.Instance != null)\n\t\t\t\t{\n\t\t\t\t\tPlayerData playerData = PlayerDataFactory.Instance.Get<PlayerData>();\n\t\t\t\t\tplayerData.EnableEnhancedWallRun.Value = true;\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tnew SetBinding<float>(this.PauseAudioEffect, delegate(float value)\n\t\t\t{\n\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.PAUSE_PARAMETER, MathHelper.Clamp(value, 0.0f, 1.0f));\n\t\t\t});\n\n\t\t\tnew CommandBinding(this.MapLoaded, delegate()\n\t\t\t{\n\t\t\t\tthis.mapLoaded = true;\n\t\t\t});\n\n#if DEVELOPMENT\n\t\t\tthis.EditorEnabled.Value = true;\n#else\n\t\t\tthis.EditorEnabled.Value = false;\n#endif\n\n\t\t\tif (!Directory.Exists(Main.DataDirectory))\n\t\t\t\tDirectory.CreateDirectory(Main.DataDirectory);\n\t\t\tthis.settingsFile = Path.Combine(Main.DataDirectory, \"settings.json\");\n\t\t\tthis.SaveDirectory = Path.Combine(Main.DataDirectory, \"saves\");\n\t\t\tif (!Directory.Exists(this.SaveDirectory))\n\t\t\t\tDirectory.CreateDirectory(this.SaveDirectory);\n\t\t\tthis.analyticsDirectory = Path.Combine(Main.DataDirectory, \"analytics\");\n\t\t\tif (!Directory.Exists(this.analyticsDirectory))\n\t\t\t\tDirectory.CreateDirectory(this.analyticsDirectory);\n\t\t\tthis.CustomMapDirectory = Path.Combine(Main.DataDirectory, \"maps\");\n\t\t\tif (!Directory.Exists(this.CustomMapDirectory))\n\t\t\t\tDirectory.CreateDirectory(this.CustomMapDirectory);\n\t\t\tthis.MapDirectory = Path.Combine(this.Content.RootDirectory, IO.MapLoader.MapDirectory);\n\n\t\t\tthis.timesFile = Path.Combine(Main.DataDirectory, \"times.dat\");\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (Stream fs = new FileStream(this.timesFile, FileMode.Open, FileAccess.Read, FileShare.None))\n\t\t\t\tusing (Stream stream = new GZipInputStream(fs))\n\t\t\t\tusing (StreamReader reader = new StreamReader(stream))\n\t\t\t\t\tthis.times = JsonConvert.DeserializeObject<Dictionary<string, float>>(reader.ReadToEnd());\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t}\n\n\t\t\tif (this.times == null)\n\t\t\t\tthis.times = new Dictionary<string, float>();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Attempt to load previous window state\n\t\t\t\tthis.Settings = JsonConvert.DeserializeObject<Config>(File.ReadAllText(this.settingsFile));\n\t\t\t\tif (this.Settings.Version != Main.ConfigVersion)\n\t\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tcatch (Exception) // File doesn't exist, there was a deserialization error, or we are on a new version. Use default window settings\n\t\t\t{\n\t\t\t\tthis.Settings = new Config();\n\t\t\t}\n\n\t\t\tif (string.IsNullOrEmpty(this.Settings.UUID))\n\t\t\t\tthis.Settings.UUID = Guid.NewGuid().ToString().Replace(\"-\", string.Empty).Substring(0, 32);\n\t\t\tthis.Settings.MinimizeCameraMovementVR.Value |= this.Settings.MinimizeCameraMovement;\n\t\t\tthis.MinimizeCameraMovement = this.VR ? this.Settings.MinimizeCameraMovementVR : this.Settings.MinimizeCameraMovement;\n\t\t\tthis.Settings.GodModeProperty.Value = this.Settings.GodMode;\n\t\t\tthis.Settings.LevelIndexProperty.Value = this.Settings.LevelIndex;\n\t\t\tnew NotifyBinding(delegate() { this.Settings.GodMode = this.Settings.GodModeProperty; }, this.Settings.GodModeProperty);\n\t\t\tnew NotifyBinding(delegate() { this.Settings.LevelIndex = this.Settings.LevelIndexProperty; }, this.Settings.LevelIndexProperty);\n\t\t\t\n\t\t\tTextElement.BindableProperties.Add(\"Forward\", this.Settings.Forward);\n\t\t\tTextElement.BindableProperties.Add(\"Left\", this.Settings.Left);\n\t\t\tTextElement.BindableProperties.Add(\"Backward\", this.Settings.Backward);\n\t\t\tTextElement.BindableProperties.Add(\"Right\", this.Settings.Right);\n\t\t\tTextElement.BindableProperties.Add(\"Jump\", this.Settings.Jump);\n\t\t\tTextElement.BindableProperties.Add(\"Parkour\", this.Settings.Parkour);\n\t\t\tTextElement.BindableProperties.Add(\"RollKick\", this.Settings.RollKick);\n\t\t\tTextElement.BindableProperties.Add(\"TogglePhone\", this.Settings.TogglePhone);\n\t\t\tTextElement.BindableProperties.Add(\"QuickSave\", this.Settings.QuickSave);\n\t\t\tTextElement.BindableProperties.Add(\"ToggleFullscreen\", this.Settings.ToggleFullscreen);\n\t\t\tTextElement.BindableProperties.Add(\"RecenterVRPose\", this.Settings.RecenterVRPose);\n\t\t\tTextElement.BindableProperties.Add(\"ToggleConsole\", this.Settings.ToggleConsole);\n\n\t\t\tnew NotifyBinding\n\t\t\t(\n\t\t\t\tthis.updateTimesteps,\n\t\t\t\tthis.BaseTimeMultiplier, this.TimeMultiplier, this.Settings.FPSLimit\n\t\t\t);\n\t\t\tthis.updateTimesteps();\n\n\t\t\tif (this.Settings.FullscreenResolution.Value.X == 0)\n\t\t\t\tthis.Settings.FullscreenResolution.Value = new Point(this.nativeDisplayMode.Width, this.nativeDisplayMode.Height);\n\n\t\t\t// Have to create the menu here so it can catch the PreparingDeviceSettings event\n\t\t\t// We call AddComponent(this.Menu) later on in LoadContent.\n\t\t\tthis.Menu = new Menu();\n\t\t\tthis.Graphics.PreparingDeviceSettings += delegate(object sender, PreparingDeviceSettingsEventArgs args)\n\t\t\t{\n\t\t\t\targs.GraphicsDeviceInformation.Adapter = GraphicsAdapter.Adapters[this.monitor];\n\n\t\t\t\targs.GraphicsDeviceInformation.PresentationParameters.PresentationInterval = PresentInterval.Immediate;\n\n\t\t\t\tList<DisplayMode> supportedDisplayModes = args.GraphicsDeviceInformation.Adapter.SupportedDisplayModes.Where(x => x.Width <= 4096 && x.Height <= 4096).ToList();\n\t\t\t\tint displayModeIndex = 0;\n\t\t\t\tforeach (DisplayMode mode in supportedDisplayModes)\n\t\t\t\t{\n\t\t\t\t\tif (mode.Format == SurfaceFormat.Color && mode.Width == this.Settings.FullscreenResolution.Value.X && mode.Height == this.Settings.FullscreenResolution.Value.Y)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdisplayModeIndex++;\n\t\t\t\t}\n\t\t\t\tthis.Menu.SetupDisplayModes(supportedDisplayModes, displayModeIndex);\n\t\t\t};\n\n\t\t\tthis.Screenshot = new Screenshot();\n\t\t\tthis.AddComponent(this.Screenshot);\n\n\t\t\tthis.Graphics.SynchronizeWithVerticalRetrace = this.Settings.Vsync;\n\t\t\tnew NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tthis.Graphics.SynchronizeWithVerticalRetrace = this.Settings.Vsync;\n\t\t\t\tif (this.Settings.Fullscreen)\n\t\t\t\t\tthis.Graphics.ApplyChanges();\n\t\t\t}, this.Settings.Vsync);\n\n#if VR\n\t\t\tif (this.VR)\n\t\t\t\tthis.ResizeViewport(this.nativeDisplayMode.Width, this.nativeDisplayMode.Height, true, false, false);\n\t\t\telse\n#endif\n\t\t\tif (this.Settings.Fullscreen)\n\t\t\t\tthis.ResizeViewport(this.Settings.FullscreenResolution.Value.X, this.Settings.FullscreenResolution.Value.Y, true, this.Settings.Borderless, false);\n\t\t\telse\n\t\t\t\tthis.ResizeViewport(this.Settings.Size.Value.X, this.Settings.Size.Value.Y, false, this.Settings.Borderless, false);\n\t\t}\n\n\t\tprivate void updateTimesteps()\n\t\t{\n\t\t\tfloat value = this.TimeMultiplier * this.BaseTimeMultiplier;\n\t\t\tthis.targetElapsedTime = TimeSpan.FromSeconds(1.0f / (float)this.Settings.FPSLimit);\n\t\t\tthis.Space.TimeStepSettings.TimeStepDuration = (1.0f / (float)Math.Min(maxPhysicsFramerate, this.Settings.FPSLimit)) * value;\n\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SLOWMOTION, Math.Min(1.0f, (1.0f - value) / 0.6f));\n\t\t}\n\n\t\tprivate void saveTimes()\n\t\t{\n\t\t\tusing (Stream fs = new FileStream(this.timesFile, FileMode.Create, FileAccess.Write, FileShare.None))\n\t\t\tusing (Stream stream = new GZipOutputStream(fs))\n\t\t\tusing (StreamWriter writer = new StreamWriter(stream))\n\t\t\t\twriter.Write(JsonConvert.SerializeObject(this.times));\n\t\t}\n\n\t\tpublic float GetMapTime(string uuid)\n\t\t{\n\t\t\tfloat existingTime;\n\t\t\tthis.times.TryGetValue(uuid, out existingTime);\n\t\t\treturn existingTime;\n\t\t}\n\n\t\tpublic float SaveMapTime(string uuid, float time)\n\t\t{\n\t\t\tfloat existingTime;\n\t\t\tif (this.times.TryGetValue(uuid, out existingTime))\n\t\t\t{\n\t\t\t\tif (existingTime <= 0.0f || time < existingTime)\n\t\t\t\t{\n\t\t\t\t\tthis.times[uuid] = time;\n\t\t\t\t\tthis.saveTimes();\n\t\t\t\t\treturn time;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn existingTime;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.times[uuid] = time;\n\t\t\t\tthis.saveTimes();\n\t\t\t\treturn time;\n\t\t\t}\n\t\t}\n\n\t\tprivate void copySave(string src, string dst)\n\t\t{\n\t\t\tif (!Directory.Exists(dst))\n\t\t\t\tDirectory.CreateDirectory(dst);\n\n\t\t\tstring[] whitelistExtensions = new[] { \".map\", };\n\n\t\t\tforeach (string path in Directory.GetFiles(src))\n\t\t\t{\n\t\t\t\tstring filename = Path.GetFileName(path);\n\t\t\t\tif (whitelistExtensions.Contains(Path.GetExtension(filename)))\n\t\t\t\t\tFile.Copy(path, Path.Combine(dst, filename));\n\t\t\t}\n\t\t}\n\n#if ANALYTICS\n\t\tpublic Session.Recorder SessionRecorder;\n\n\t\tpublic void SaveAnalytics()\n\t\t{\n\t\t\tif (this.Settings.Analytics.Value == Config.RecordAnalytics.On)\n\t\t\t\tthis.SessionRecorder.Save(this.analyticsDirectory, Main.Build, Path.GetFileNameWithoutExtension(this.MapFile), this.TotalTime);\n\t\t}\n\n\t\tpublic string[] AnalyticsSessionFiles\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Directory.GetFiles(this.analyticsDirectory, \"*\", SearchOption.TopDirectoryOnly);\n\t\t\t}\n\t\t}\n\n\t\tprotected override void OnExiting(object sender, EventArgs args)\n\t\t{\n\t\t\tbase.OnExiting(sender, args);\n\t\t\tthis.SessionRecorder.RecordEvent(\"Exit\");\n\t\t\tif (!this.IsChallengeMap(this.MapFile) && this.MapFile.Value != Main.MenuMap)\n\t\t\t\tthis.SaveAnalytics();\n\t\t}\n#endif\n\n\t\tpublic List<Session> LoadAnalytics(string map)\n\t\t{\n\t\t\tmap = Path.GetFileNameWithoutExtension(map);\n\t\t\tList<Session> result = new List<Session>();\n\t\t\tforeach (string file in Directory.GetFiles(this.analyticsDirectory, \"*\", SearchOption.TopDirectoryOnly))\n\t\t\t{\n\t\t\t\tSession s;\n\t\t\t\tif (Debugger.IsAttached)\n\t\t\t\t\ts = Session.Load(file);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\ts = Session.Load(file);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.d(\"Error loading analytics file \" + file);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (s.Build == Main.Build)\n\t\t\t\t{\n\t\t\t\t\tstring sessionMap = s.Map;\n\t\t\t\t\tif (sessionMap == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Attempt to extract the map name from the filename\n\t\t\t\t\t\tstring fileWithoutExtension = Path.GetFileNameWithoutExtension(file);\n\n\t\t\t\t\t\tint firstDash = fileWithoutExtension.IndexOf('-');\n\t\t\t\t\t\tint lastDash = fileWithoutExtension.LastIndexOf('-');\n\n\t\t\t\t\t\tif (firstDash == lastDash) // Old filename format \"map-hash\"\n\t\t\t\t\t\t\tsessionMap = fileWithoutExtension.Substring(0, firstDash);\n\t\t\t\t\t\telse // New format \"build-map-hash\"\n\t\t\t\t\t\t\tsessionMap = fileWithoutExtension.Substring(firstDash + 1, lastDash - (firstDash + 1));\n\t\t\t\t\t}\n\t\t\t\t\tif (sessionMap == map)\n\t\t\t\t\t\tresult.Add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Property<string> CurrentSave = new Property<string>();\n\t\tpublic void Cleanup()\n\t\t{\n\t\t\t// Terminate Wwise\n\t\t\tif (AkSoundEngine.IsInitialized())\n\t\t\t{\n\t\t\t\tAkSoundEngine.Term();\n\t\t\t\t// NOTE: AkCallbackManager needs to handle last few events after sound engine terminates\n\t\t\t\t// So it has to terminate after sound engine does.\n\t\t\t\tAkCallbackManager.Term();\n\t\t\t}\n\n\t\t\tRumble.Reset();\n\t\t}\n\n\t\tprotected bool firstLoadContentCall = true;\n\n\t\tprotected override void LoadContent()\n\t\t{\n\t\t\tthis.MapContent = new ContentManager(this.Services);\n\t\t\tthis.MapContent.RootDirectory = this.Content.RootDirectory;\n\n\t\t\tGeeUIMain.Font = this.Content.Load<SpriteFont>(this.Font);\n\n\t\t\tif (this.firstLoadContentCall)\n\t\t\t{\n\t\t\t\tthis.firstLoadContentCall = false;\n\n\t\t\t\tif (!Directory.Exists(this.MapDirectory))\n\t\t\t\t\tDirectory.CreateDirectory(this.MapDirectory);\n\t\t\t\tstring challengeDirectory = Path.Combine(this.MapDirectory, \"Challenge\");\n\t\t\t\tif (!Directory.Exists(challengeDirectory))\n\t\t\t\t\tDirectory.CreateDirectory(challengeDirectory);\n\n#if VR\n\t\t\t\tif (this.VR)\n\t\t\t\t{\n\t\t\t\t\tthis.vrLeftMesh.Load(this, Ovr.Eye.Left, this.vrLeftFov);\n\t\t\t\t\tthis.vrRightMesh.Load(this, Ovr.Eye.Right, this.vrRightFov);\n\t\t\t\t\tnew CommandBinding(this.ReloadedContent, (Action)this.vrLeftMesh.Reload);\n\t\t\t\t\tnew CommandBinding(this.ReloadedContent, (Action)this.vrRightMesh.Reload);\n\t\t\t\t\tthis.reallocateVrTargets();\n\n\t\t\t\t\tthis.vrCamera = new Camera();\n\t\t\t\t\tthis.AddComponent(this.vrCamera);\n\t\t\t\t}\n#endif\n\n\t\t\t\tthis.GraphicsDevice.PresentationParameters.PresentationInterval = PresentInterval.Immediate;\n\t\t\t\tthis.GeeUI = new GeeUIMain();\n\t\t\t\tthis.AddComponent(GeeUI);\n\n\t\t\t\tthis.ConsoleUI = new ConsoleUI();\n\t\t\t\tthis.AddComponent(ConsoleUI);\n\n\t\t\t\tthis.Console = new Console.Console();\n\t\t\t\tthis.AddComponent(Console);\n\n\t\t\t\tLemma.Console.Console.BindType(null, this);\n\t\t\t\tLemma.Console.Console.BindType(null, Console);\n\n\t\t\t\t// Initialize Wwise\n\t\t\t\tAkGlobalSoundEngineInitializer initializer = new AkGlobalSoundEngineInitializer(Path.Combine(this.Content.RootDirectory, \"Wwise\"));\n\t\t\t\tthis.AddComponent(initializer);\n\n\t\t\t\tthis.Listener = new AkListener();\n\t\t\t\tthis.Listener.Add(new Binding<Vector3>(this.Listener.Position, this.Camera.Position));\n\t\t\t\tthis.Listener.Add(new Binding<Vector3>(this.Listener.Forward, this.Camera.Forward));\n\t\t\t\tthis.Listener.Add(new Binding<Vector3>(this.Listener.Up, this.Camera.Up));\n\t\t\t\tthis.AddComponent(this.Listener);\n\n\t\t\t\t// Create the renderer.\n\t\t\t\tthis.LightingManager = new LightingManager();\n\t\t\t\tthis.AddComponent(this.LightingManager);\n\t\t\t\tthis.Renderer = new Renderer(this, true, true, true, true, true);\n\n\t\t\t\tthis.AddComponent(this.Renderer);\n\t\t\t\tthis.Renderer.ReallocateBuffers(this.ScreenSize);\n\n\t\t\t\tthis.renderParameters = new RenderParameters\n\t\t\t\t{\n\t\t\t\t\tCamera = this.Camera,\n\t\t\t\t\tIsMainRender = true\n\t\t\t\t};\n\n\t\t\t\t// Load strings\n\t\t\t\tthis.Strings.Load(Path.Combine(this.Content.RootDirectory, \"Strings.xlsx\"));\n\n\t\t\t\tthis.UI = new UIRenderer();\n\t\t\t\tthis.UI.GeeUI = this.GeeUI;\n\t\t\t\tthis.AddComponent(this.UI);\n\n\t\t\t\tPCInput input = new PCInput();\n\t\t\t\tthis.AddComponent(input);\n\n\t\t\t\tLemma.Console.Console.BindType(null, input);\n\t\t\t\tLemma.Console.Console.BindType(null, UI);\n\t\t\t\tLemma.Console.Console.BindType(null, Renderer);\n\t\t\t\tLemma.Console.Console.BindType(null, LightingManager);\n\n\t\t\t\tinput.Add(new CommandBinding(input.GetChord(new PCInput.Chord { Modifier = Keys.LeftAlt, Key = Keys.S }), delegate()\n\t\t\t\t{\n\t\t\t\t\t// High-resolution screenshot\n\t\t\t\t\tbool originalModelsVisible = Editor.EditorModelsVisible;\n\t\t\t\t\tEditor.EditorModelsVisible.Value = false;\n\t\t\t\t\tScreenshot s = new Screenshot();\n\t\t\t\t\tthis.AddComponent(s);\n\t\t\t\t\ts.Take(new Point(4096, 2304), delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tstring desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);\n\t\t\t\t\t\tstring path;\n\t\t\t\t\t\tint i = 0;\n\t\t\t\t\t\tdo\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpath = Path.Combine(desktop, string.Format(\"lemma-screen{0}.png\", i));\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (File.Exists(path));\n\n\t\t\t\t\t\tScreenshot.SavePng(s.Buffer, path);\n\n\t\t\t\t\t\tEditor.EditorModelsVisible.Value = originalModelsVisible;\n\n\t\t\t\t\t\ts.Delete.Execute();\n\t\t\t\t\t});\n\t\t\t\t}));\n\n\t\t\t\tthis.performanceMonitor = new ListContainer();\n\t\t\t\tthis.performanceMonitor.Add(new Binding<Vector2, Point>(performanceMonitor.Position, x => new Vector2(x.X, 0), this.ScreenSize));\n\t\t\t\tthis.performanceMonitor.AnchorPoint.Value = new Vector2(1, 0);\n\t\t\t\tthis.performanceMonitor.Visible.Value = false;\n\t\t\t\tthis.performanceMonitor.Name.Value = \"PerformanceMonitor\";\n\t\t\t\tthis.UI.Root.Children.Add(this.performanceMonitor);\n\n\t\t\t\tAction<string, Property<double>> addTimer = delegate(string label, Property<double> property)\n\t\t\t\t{\n\t\t\t\t\tTextElement text = new TextElement();\n\t\t\t\t\ttext.FontFile.Value = this.Font;\n\t\t\t\t\ttext.Add(new Binding<string, double>(text.Text, x => label + \": \" + (x * 1000.0).ToString(\"F\") + \"ms\", property));\n\t\t\t\t\tthis.performanceMonitor.Children.Add(text);\n\t\t\t\t};\n\n\t\t\t\tAction<string, Property<int>> addCounter = delegate(string label, Property<int> property)\n\t\t\t\t{\n\t\t\t\t\tTextElement text = new TextElement();\n\t\t\t\t\ttext.FontFile.Value = this.Font;\n\t\t\t\t\ttext.Add(new Binding<string, int>(text.Text, x => label + \": \" + x.ToString(), property));\n\t\t\t\t\tthis.performanceMonitor.Children.Add(text);\n\t\t\t\t};\n\n\t\t\t\tTextElement frameRateText = new TextElement();\n\t\t\t\tframeRateText.FontFile.Value = this.Font;\n\t\t\t\tframeRateText.Add(new Binding<string, float>(frameRateText.Text, x => \"FPS: \" + x.ToString(\"0\"), this.frameRate));\n\t\t\t\tthis.performanceMonitor.Children.Add(frameRateText);\n\n\t\t\t\taddTimer(\"Physics\", this.physicsTime);\n\t\t\t\taddTimer(\"Update\", this.updateTime);\n\t\t\t\taddTimer(\"Render\", this.renderTime);\n\t\t\t\taddCounter(\"Draw calls\", this.drawCalls);\n\t\t\t\taddCounter(\"Triangles\", this.triangles);\n\t\t\t\taddCounter(\"Working set\", this.workingSet);\n\n\t\t\t\tLemma.Console.Console.AddConCommand(new ConCommand(\"perf\", \"Toggle the performance monitor\", delegate(ConCommand.ArgCollection args)\n\t\t\t\t{\n\t\t\t\t\tthis.performanceMonitor.Visible.Value = !this.performanceMonitor.Visible;\n\t\t\t\t}));\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tIEnumerable<string> globalStaticScripts = Directory.GetFiles(Path.Combine(this.Content.RootDirectory, \"GlobalStaticScripts\"), \"*\", SearchOption.AllDirectories).Select(x => Path.Combine(\"..\\\\GlobalStaticScripts\", Path.GetFileNameWithoutExtension(x)));\n\t\t\t\t\tforeach (string scriptName in globalStaticScripts)\n\t\t\t\t\t\tthis.executeStaticScript(scriptName);\n\t\t\t\t}\n\t\t\t\tcatch (IOException)\n\t\t\t\t{\n\n\t\t\t\t}\n\n\t\t\t\tthis.UIFactory = new UIFactory();\n\t\t\t\tthis.AddComponent(this.UIFactory);\n\t\t\t\tthis.AddComponent(this.Menu); // Have to do this here so the menu's Awake can use all our loaded stuff\n\n\t\t\t\tthis.Spawner = new Spawner();\n\t\t\t\tthis.AddComponent(this.Spawner);\n\n\t\t\t\tthis.UI.IsMouseVisible.Value = true;\n\n\t\t\t\tAKRESULT akresult = AkBankLoader.LoadBank(\"SFX_Bank_01.bnk\");\n\t\t\t\tif (akresult != AKRESULT.AK_Success)\n\t\t\t\t\tLog.d(string.Format(\"Failed to load main sound bank: {0}\", akresult));\n\n#if ANALYTICS\n\t\t\t\tthis.SessionRecorder = new Session.Recorder(this);\n\n\t\t\t\tthis.SessionRecorder.Add(\"Position\", delegate()\n\t\t\t\t{\n\t\t\t\t\tEntity p = PlayerFactory.Instance;\n\t\t\t\t\tif (p != null && p.Active)\n\t\t\t\t\t\treturn p.Get<Transform>().Position;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn Vector3.Zero;\n\t\t\t\t});\n\n\t\t\t\tthis.SessionRecorder.Add(\"Health\", delegate()\n\t\t\t\t{\n\t\t\t\t\tEntity p = PlayerFactory.Instance;\n\t\t\t\t\tif (p != null && p.Active)\n\t\t\t\t\t\treturn p.Get<Player>().Health;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn 0.0f;\n\t\t\t\t});\n\n\t\t\t\tthis.SessionRecorder.Add(\"Framerate\", delegate()\n\t\t\t\t{\n\t\t\t\t\treturn this.frameRate;\n\t\t\t\t});\n\n\t\t\t\tthis.SessionRecorder.Add(\"WorkingSet\", delegate()\n\t\t\t\t{\n\t\t\t\t\treturn this.workingSet;\n\t\t\t\t});\n\t\t\t\tthis.AddComponent(this.SessionRecorder);\n\t\t\t\tthis.SessionRecorder.Add(new Binding<bool, Config.RecordAnalytics>(this.SessionRecorder.EnableUpload, x => x == Config.RecordAnalytics.On, this.Settings.Analytics));\n#endif\n\n\t\t\t\tthis.DefaultLighting();\n\n\t\t\t\tnew SetBinding<float>(this.Settings.SoundEffectVolume, delegate(float value)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.VOLUME_SFX, MathHelper.Clamp(value, 0.0f, 1.0f));\n\t\t\t\t});\n\n\t\t\t\tnew SetBinding<float>(this.Settings.MusicVolume, delegate(float value)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.VOLUME_MUSIC, MathHelper.Clamp(value, 0.0f, 1.0f));\n\t\t\t\t});\n\n\t\t\t\tnew TwoWayBinding<LightingManager.DynamicShadowSetting>(this.Settings.DynamicShadows, this.LightingManager.DynamicShadows);\n\t\t\t\tnew TwoWayBinding<float>(this.Settings.MotionBlurAmount, this.Renderer.MotionBlurAmount);\n\t\t\t\tnew TwoWayBinding<float>(this.Settings.Gamma, this.Renderer.Gamma);\n\t\t\t\tnew TwoWayBinding<bool>(this.Settings.Bloom, this.Renderer.EnableBloom);\n\t\t\t\tnew TwoWayBinding<bool>(this.Settings.SSAO, this.Renderer.EnableSSAO);\n\t\t\t\tnew Binding<float>(this.Camera.FieldOfView, this.Settings.FieldOfView);\n\n\t\t\t\tforeach (string file in Directory.GetFiles(this.MapDirectory, \"*.xlsx\", SearchOption.TopDirectoryOnly))\n\t\t\t\t\tthis.Strings.Load(file);\n\n\t\t\t\tnew Binding<string, Config.Lang>(this.Strings.Language, x => x.ToString(), this.Settings.Language);\n\t\t\t\tnew NotifyBinding(this.SaveSettings, this.Settings.Language);\n\n\t\t\t\tnew CommandBinding(this.MapLoaded, delegate()\n\t\t\t\t{\n\t\t\t\t\tthis.Renderer.BlurAmount.Value = 0.0f;\n\t\t\t\t\tthis.Renderer.Tint.Value = new Vector3(1.0f);\n\t\t\t\t});\n\n#if VR\n\t\t\t\tif (this.VR)\n\t\t\t\t{\n\t\t\t\t\tAction loadVrEffect = delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.vrEffect = this.Content.Load<Effect>(\"Effects\\\\Oculus\");\n\t\t\t\t\t};\n\t\t\t\t\tloadVrEffect();\n\t\t\t\t\tnew CommandBinding(this.ReloadedContent, loadVrEffect);\n\n\t\t\t\t\tthis.UI.Add(new Binding<Point>(this.UI.RenderTargetSize, this.ScreenSize));\n\n\t\t\t\t\tthis.VRUI = new Lemma.Components.ModelNonPostProcessed();\n\t\t\t\t\tthis.VRUI.MapContent = false;\n\t\t\t\t\tthis.VRUI.DrawOrder.Value = 100000; // On top of everything\n\t\t\t\t\tthis.VRUI.Filename.Value = \"Models\\\\plane\";\n\t\t\t\t\tthis.VRUI.EffectFile.Value = \"Effects\\\\VirtualUI\";\n\t\t\t\t\tthis.VRUI.Add(new Binding<Microsoft.Xna.Framework.Graphics.RenderTarget2D>(this.VRUI.GetRenderTarget2DParameter(\"Diffuse\" + Lemma.Components.Model.SamplerPostfix), this.UI.RenderTarget));\n\t\t\t\t\tthis.VRUI.Add(new Binding<Matrix>(this.VRUI.Transform, delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tMatrix rot = this.Camera.RotationMatrix;\n\t\t\t\t\t\tMatrix mat = Matrix.Identity;\n\t\t\t\t\t\tmat.Forward = rot.Right;\n\t\t\t\t\t\tmat.Right = rot.Forward;\n\t\t\t\t\t\tmat.Up = rot.Up;\n\t\t\t\t\t\tmat *= Matrix.CreateScale(7);\n\t\t\t\t\t\tmat.Translation = this.Camera.Position + rot.Forward * 4.0f;\n\t\t\t\t\t\treturn mat;\n\t\t\t\t\t}, this.Camera.Position, this.Camera.RotationMatrix));\n\t\t\t\t\tthis.AddComponent(this.VRUI);\n\n\t\t\t\t\tthis.UI.Setup3D(this.VRUI.Transform);\n\t\t\t\t}\n#endif\n\n#if ANALYTICS\n\t\t\t\tbool editorLastEnabled = this.EditorEnabled;\n\t\t\t\tnew CommandBinding<string>(this.LoadingMap, delegate(string newMap)\n\t\t\t\t{\n\t\t\t\t\tif (this.MapFile.Value != null && !editorLastEnabled)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.SessionRecorder.RecordEvent(\"ChangedMap\", newMap);\n\t\t\t\t\t\tif (!this.IsChallengeMap(this.MapFile) && this.MapFile.Value != Main.MenuMap)\n\t\t\t\t\t\t\tthis.SaveAnalytics();\n\t\t\t\t\t}\n\t\t\t\t\tthis.SessionRecorder.Reset();\n\t\t\t\t\teditorLastEnabled = this.EditorEnabled;\n\t\t\t\t});\n#endif\n\t\t\t\tnew CommandBinding<string>(this.LoadingMap, delegate(string newMap)\n\t\t\t\t{\n\t\t\t\t\tthis.CancelScheduledSave();\n\t\t\t\t});\n\n#if !DEVELOPMENT\n\t\t\t\tIO.MapLoader.Load(this, MenuMap);\n\t\t\t\tthis.Menu.Show(initial: true);\n#endif\n\n#if ANALYTICS\n\t\t\t\tif (this.Settings.Analytics.Value == Config.RecordAnalytics.Ask)\n\t\t\t\t{\n\t\t\t\t\tthis.Menu.ShowDialog(\"\\\\analytics prompt\", \"\\\\enable analytics\", delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Settings.Analytics.Value = Config.RecordAnalytics.On;\n\t\t\t\t\t},\n\t\t\t\t\t\"\\\\disable analytics\", delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Settings.Analytics.Value = Config.RecordAnalytics.Off;\n\t\t\t\t\t});\n\t\t\t\t}\n#endif\n\n#if VR\n\t\t\t\tif (this.oculusNotFound)\n\t\t\t\t\tthis.Menu.HideMessage(null, this.Menu.ShowMessage(null, \"Error: no Oculus found.\"), 6.0f);\n\n\t\t\t\tif (this.VR)\n\t\t\t\t{\n\t\t\t\t\tthis.Menu.EnableInput(false);\n\t\t\t\t\tContainer vrMsg = this.Menu.BuildMessage(\"\\\\vr message\", 300.0f);\n\t\t\t\t\tvrMsg.AnchorPoint.Value = new Vector2(0.5f, 0.5f);\n\t\t\t\t\tvrMsg.Add(new Binding<Vector2, Point>(vrMsg.Position, x => new Vector2(x.X * 0.5f, x.Y * 0.5f), this.ScreenSize));\n\t\t\t\t\tthis.UI.Root.Children.Add(vrMsg);\n\t\t\t\t\tinput.Bind(this.Settings.RecenterVRPose, PCInput.InputState.Down, this.VRHmd.RecenterPose);\n\t\t\t\t\tinput.Bind(this.Settings.RecenterVRPose, PCInput.InputState.Down, delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (vrMsg != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvrMsg.Delete.Execute();\n\t\t\t\t\t\t\tvrMsg = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.Menu.EnableInput(true);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse\n#endif\n\t\t\t\t{\n\t\t\t\t\tinput.Bind(this.Settings.ToggleFullscreen, PCInput.InputState.Down, delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.Settings.Fullscreen) // Already fullscreen. Go to windowed mode.\n\t\t\t\t\t\t\tthis.ExitFullscreen();\n\t\t\t\t\t\telse // In windowed mode. Go to fullscreen.\n\t\t\t\t\t\t\tthis.EnterFullscreen();\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tinput.Bind(this.Settings.QuickSave, PCInput.InputState.Down, delegate()\n\t\t\t\t{\n\t\t\t\t\tthis.SaveWithNotification(true);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.ReloadingContent.Execute();\n\t\t\t\tforeach (IGraphicsComponent c in this.graphicsComponents)\n\t\t\t\t\tc.LoadContent(true);\n\t\t\t\tthis.ReloadedContent.Execute();\n\t\t\t}\n\n\t\t\tthis.GraphicsDevice.RasterizerState = new RasterizerState { MultiSampleAntiAlias = false };\n\n\t\t\tif (this.spriteBatch != null)\n\t\t\t\tthis.spriteBatch.Dispose();\n\t\t\tthis.spriteBatch = new SpriteBatch(this.GraphicsDevice);\n\t\t}\n\n\t\tpublic void DefaultLighting()\n\t\t{\n\t\t\tthis.Renderer.LightRampTexture.Value = \"LightRamps\\\\default\";\n\t\t\tthis.LightingManager.EnvironmentMap.Value = \"EnvironmentMaps\\\\env0\";\n\t\t\tthis.LightingManager.BackgroundColor.Value = new Color(32, 52, 76);\n\t\t}\n\n\t\tprivate bool componentEnabled(IComponent c)\n\t\t{\n\t\t\treturn c.Active && c.Enabled && !c.Suspended && (!this.EditorEnabled || c.EnabledInEditMode) && (!this.Paused || c.EnabledWhenPaused);\n\t\t}\n\n\t\tprotected void executeScript(string scriptName)\n\t\t{\n\t\t\tstring id = \"global_script_\" + scriptName;\n\t\t\tEntity existingEntity = this.GetByID(id);\n\t\t\tif (existingEntity != null)\n\t\t\t\texistingEntity.Get<Script>().Execute.Execute();\n\t\t\telse\n\t\t\t{\n\t\t\t\tEntity scriptEntity = Factory.Get<ScriptFactory>().Create(this);\n\t\t\t\tscriptEntity.ID.Value = id;\n\t\t\t\tFactory.Get<ScriptFactory>().Bind(scriptEntity, this, true);\n\t\t\t\tscriptEntity.Serialize = false;\n\t\t\t\tthis.Add(scriptEntity);\n\t\t\t\tscriptEntity.Get<Script>().ExecuteOnLoad.Value = false;\n\t\t\t\tScript script = scriptEntity.Get<Script>();\n\t\t\t\tscript.Name.Value = scriptName;\n\t\t\t\tscript.Execute.Execute();\n\t\t\t}\n\t\t}\n\n\t\tprotected void executeStaticScript(string scriptName)\n\t\t{\n\t\t\tEntity scriptEntity = Factory.Get<ScriptFactory>().CreateAndBind(this);\n\t\t\tscriptEntity.Serialize = false;\n\t\t\tthis.Add(scriptEntity);\n\t\t\tscriptEntity.Get<Script>().ExecuteOnLoad.Value = false;\n\t\t\tScript script = scriptEntity.Get<Script>();\n\t\t\tscript.Name.Value = scriptName;\n\t\t\tscript.Execute.Execute();\n\t\t\tscriptEntity.Delete.Execute();\n\t\t}\n\n\t\tprivate void createNewSave(string oldSave = null)\n\t\t{\n\t\t\tif (oldSave == null)\n\t\t\t\toldSave = this.CurrentSave;\n\t\t\tstring newSave = DateTime.Now.ToString(\"yyyy-MM-dd HH.mm.ss\");\n\t\t\tif (newSave != oldSave)\n\t\t\t{\n\t\t\t\tDirectory.CreateDirectory(Path.Combine(this.SaveDirectory, newSave));\n\t\t\t\tif (oldSave != null)\n\t\t\t\t\tthis.copySave(Path.Combine(this.SaveDirectory, oldSave), Path.Combine(this.SaveDirectory, newSave));\n\t\t\t\tthis.CurrentSave.Value = newSave;\n\t\t\t}\n\t\t}\n\n\t\tpublic void SaveNew()\n\t\t{\n\t\t\tthis.save(null); // null means don't delete any old saves\n\t\t}\n\n\t\tprivate bool saving;\n\t\tpublic void SaveWithNotification(bool overwrite)\n\t\t{\n\t\t\tif (!this.saving && !this.Paused && this.Menu.CanPause && this.MapFile != Main.MenuMap && !this.IsChallengeMap(this.MapFile) && PlayerFactory.Instance != null)\n\t\t\t{\n\t\t\t\tthis.saving = true;\n\t\t\t\tContainer saveNotification = new Container();\n\t\t\t\tsaveNotification.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\t\tsaveNotification.Opacity.Value = UIFactory.Opacity;\n\t\t\t\tTextElement saveNotificationText = new TextElement();\n\t\t\t\tsaveNotificationText.Name.Value = \"Text\";\n\t\t\t\tsaveNotificationText.FontFile.Value = this.Font;\n\t\t\t\tsaveNotificationText.Text.Value = \"\\\\saving\";\n\t\t\t\tsaveNotification.Children.Add(saveNotificationText);\n\t\t\t\tthis.UI.Root.GetChildByName(\"Notifications\").Children.Add(saveNotification);\n\t\t\t\tthis.AddComponent(new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Delay(0.01f),\n\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (overwrite)\n\t\t\t\t\t\t\tthis.SaveOverwrite();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthis.SaveNew();\n\t\t\t\t\t}),\n\t\t\t\t\tnew Animation.Delay(0.01f),\n\t\t\t\t\tnew Animation.Set<string>(saveNotificationText.Text, \"\\\\saved\"),\n\t\t\t\t\tnew Animation.Parallel\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.FloatMoveTo(saveNotification.Opacity, 0.0f, 1.0f),\n\t\t\t\t\t\tnew Animation.FloatMoveTo(saveNotificationText.Opacity, 0.0f, 1.0f)\n\t\t\t\t\t),\n\t\t\t\t\tnew Animation.Execute(saveNotification.Delete),\n\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.saving = false;\n\t\t\t\t\t})\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\tpublic void SaveOverwrite(string oldSave = null)\n\t\t{\n\t\t\tif (oldSave == null)\n\t\t\t\toldSave = this.CurrentSave;\n\t\t\tthis.save(oldSave);\n\t\t}\n\n\t\tprivate void save(string oldSave)\n\t\t{\n\t\t\tAction doSave = delegate()\n\t\t\t{\n\t\t\t\t// Delete the old save thumbnail.\n\t\t\t\tif (oldSave != null)\n\t\t\t\t\tthis.Menu.RemoveSaveGame(oldSave);\n\n\t\t\t\t// Create the new save.\n\t\t\t\tthis.createNewSave();\n\n\t\t\t\tthis.SaveCurrentMap(this.Screenshot.Buffer, this.Screenshot.Size);\n\n\t\t\t\tthis.Screenshot.Clear();\n\n\t\t\t\tthis.Menu.AddSaveGame(this.CurrentSave);\n\n\t\t\t\t// Delete the old save files.\n\t\t\t\t// We have to do this AFTER creating the new save\n\t\t\t\t// because it copies the old save to create the new one\n\t\t\t\tif (oldSave != null)\n\t\t\t\t\tDirectory.Delete(Path.Combine(this.SaveDirectory, oldSave), true);\n\t\t\t};\n\n\t\t\tif (this.Screenshot.Buffer == null)\n\t\t\t{\n\t\t\t\tPoint size;\n#if VR\n\t\t\t\tif (this.VR)\n\t\t\t\t\tsize = this.VRActualScreenSize;\n\t\t\t\telse\n#endif\n\t\t\t\t\tsize = this.ScreenSize;\n\t\t\t\tthis.Screenshot.Take(size, doSave);\n\t\t\t}\n\t\t\telse\n\t\t\t\tdoSave();\n\t\t}\n\n\t\tpublic void ScheduleSave()\n\t\t{\n\t\t\tif (this.MapFile.Value != Main.MenuMap && (this.scheduledSave == null || !this.scheduledSave.Active))\n\t\t\t{\n\t\t\t\tbool originalCanPause = this.Menu.CanPause;\n\t\t\t\tthis.Menu.CanPause.Value = false;\n\t\t\t\tContainer saveNotification = new Container();\n\t\t\t\tTextElement saveNotificationText = new TextElement();\n\t\t\t\tthis.scheduledSave = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Delay(0.6f),\n\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tPoint size;\n#if VR\n\t\t\t\t\t\tif (this.VR)\n\t\t\t\t\t\t\tsize = this.VRActualScreenSize;\n\t\t\t\t\t\telse\n#endif\n\t\t\t\t\t\t\tsize = this.ScreenSize;\n\t\t\t\t\t\tthis.Screenshot.Take(size);\n\t\t\t\t\t}),\n\t\t\t\t\tnew Animation.Delay(0.01f),\n\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tsaveNotification.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\t\t\t\tsaveNotification.Opacity.Value = UIFactory.Opacity;\n\t\t\t\t\t\tsaveNotificationText.Name.Value = \"Text\";\n\t\t\t\t\t\tsaveNotificationText.FontFile.Value = this.Font;\n\t\t\t\t\t\tsaveNotificationText.Text.Value = \"\\\\saving\";\n\t\t\t\t\t\tsaveNotification.Children.Add(saveNotificationText);\n\t\t\t\t\t\tthis.UI.Root.GetChildByName(\"Notifications\").Children.Add(saveNotification);\n\t\t\t\t\t}),\n\t\t\t\t\tnew Animation.Delay(0.01f),\n\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.SaveOverwrite();\n\t\t\t\t\t}),\n\t\t\t\t\tnew Animation.Delay(0.01f),\n\t\t\t\t\tnew Animation.Set<string>(saveNotificationText.Text, \"\\\\saved\"),\n\t\t\t\t\tnew Animation.Parallel\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.FloatMoveTo(saveNotification.Opacity, 0.0f, 1.0f),\n\t\t\t\t\t\tnew Animation.FloatMoveTo(saveNotificationText.Opacity, 0.0f, 1.0f)\n\t\t\t\t\t),\n\t\t\t\t\tnew Animation.Execute(saveNotification.Delete)\n\t\t\t\t);\n\t\t\t\tthis.scheduledSave.Add(new CommandBinding(this.scheduledSave.Delete, delegate()\n\t\t\t\t{\n\t\t\t\t\tthis.Screenshot.Clear();\n\t\t\t\t\tthis.UI.Root.GetChildByName(\"Notifications\").Children.Clear();\n\t\t\t\t\tthis.Menu.CanPause.Value = originalCanPause;\n\t\t\t\t\tthis.scheduledSave = null;\n\t\t\t\t}));\n\t\t\t\tWorldFactory.Instance.Add(this.scheduledSave);\n\t\t\t}\n\t\t}\n\n\t\tpublic void CancelScheduledSave()\n\t\t{\n\t\t\tif (this.scheduledSave != null && this.scheduledSave.Active)\n\t\t\t\tthis.scheduledSave.Delete.Execute();\n\t\t}\n\n\t\tpublic void SaveCurrentMap(RenderTarget2D screenshot = null, Point screenshotSize = default(Point))\n\t\t{\n\t\t\tif (this.CurrentSave.Value == null)\n\t\t\t\tthis.createNewSave();\n\n\t\t\tstring currentSaveDirectory = Path.Combine(this.SaveDirectory, this.CurrentSave);\n\t\t\tif (screenshot != null)\n\t\t\t{\n\t\t\t\tstring screenshotPath = Path.Combine(currentSaveDirectory, \"thumbnail.png\");\n\t\t\t\tScreenshot.SavePng(screenshot, screenshotPath, 256, (int)(screenshotSize.Y * (256.0f / screenshotSize.X)));\n\t\t\t}\n\n\t\t\tIO.MapLoader.Save(this, currentSaveDirectory, this.MapFile);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (Stream fs = new FileStream(Path.Combine(currentSaveDirectory, \"save.dat\"), FileMode.Create, FileAccess.Write, FileShare.None))\n\t\t\t\tusing (Stream stream = new GZipOutputStream(fs))\n\t\t\t\tusing (StreamWriter writer = new StreamWriter(stream))\n\t\t\t\t\tMain.SaveInfo.Serializer.Serialize(writer, new Main.SaveInfo { MapFile = Path.GetFileNameWithoutExtension(this.MapFile), Version = Main.MapVersion, PlayerData = PlayerDataFactory.Instance });\n\t\t\t}\n\t\t\tcatch (InvalidOperationException e)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Failed to save game.\", e);\n\t\t\t}\n\t\t}\n\n\t\tpublic void SaveSettings()\n\t\t{\n\t\t\tFile.WriteAllText(this.settingsFile, JsonConvert.SerializeObject(this.Settings, Formatting.Indented));\n\t\t}\n\n\t\tpublic void EnterFullscreen()\n\t\t{\n\t\t\tif (!this.Settings.Fullscreen)\n\t\t\t{\n\t\t\t\tPoint res = this.Settings.FullscreenResolution;\n\t\t\t\tthis.ResizeViewport(res.X, res.Y, true, this.Settings.Borderless);\n\t\t\t}\n\t\t}\n\n\t\tpublic void ExitFullscreen()\n\t\t{\n\t\t\tif (this.Settings.Fullscreen && !this.VR)\n\t\t\t{\n\t\t\t\tPoint res = this.Settings.Size;\n\t\t\t\tthis.ResizeViewport(res.X, res.Y, false, this.Settings.Borderless);\n\t\t\t}\n\t\t}\n\n\t\tpublic void DrawablesModified()\n\t\t{\n\t\t\tthis.drawablesModified = true;\n\t\t}\n\n\t\tpublic void EarlyUpdateablesModified()\n\t\t{\n\t\t\tthis.earlyUpdateablesModified = true;\n\t\t}\n\n\t\tpublic void AlphaDrawablesModified()\n\t\t{\n\t\t\tthis.alphaDrawablesModified = true;\n\t\t}\n\n\t\tpublic void PostAlphaDrawablesModified()\n\t\t{\n\t\t\tthis.postAlphaDrawablesModified = true;\n\t\t}\n\n\t\tpublic void NonPostProcessedDrawablesModified()\n\t\t{\n\t\t\tthis.nonPostProcessedDrawablesModified = true;\n\t\t}\n\n\t\tprivate Stopwatch timer = new Stopwatch();\n\t\tprivate Stopwatch frameTimer = new Stopwatch();\n\n\t\tprivate TimeSpan lastFrameTime;\n\n\t\tpublic bool LastActive { get {  return this.lastLastActive; } }\n\t\tprivate bool lastLastActive;\n\t\tprivate bool lastActive;\n\n\t\tprotected override void Update(GameTime gameTime)\n\t\t{\n\t\t\tthis.lastLastActive = this.lastActive;\n\t\t\tif (this.IsActive && !this.lastActive)\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.RESUME_ALL);\n\t\t\telse if (!this.IsActive && this.lastActive)\n\t\t\t{\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PAUSE_ALL);\n\t\t\t\tAkSoundEngine.RenderAudio();\n\t\t\t}\n\t\t\tthis.lastActive = this.IsActive;\n\n\t\t\tif (!this.lastActive)\n\t\t\t\treturn;\n\n\t\t\tif (this.targetElapsedTime > this.lastFrameTime)\n\t\t\t{\n\t\t\t\tTimeSpan diff = this.targetElapsedTime - this.lastFrameTime;\n\t\t\t\tThread.Sleep(diff);\n\t\t\t}\n\n\t\t\tthis.frameTimer.Restart();\n\n\t\t\tif (gameTime.ElapsedGameTime.TotalSeconds > 0.1f)\n\t\t\t\tgameTime = new GameTime(gameTime.TotalGameTime, TimeSpan.FromSeconds(0.1f), false);\n\t\t\tthis.GameTime = gameTime;\n\t\t\tfloat dt = this.ElapsedTime.Value = (float)gameTime.ElapsedGameTime.TotalSeconds * this.TimeMultiplier * this.BaseTimeMultiplier;\n\t\t\tif (!this.Paused)\n\t\t\t\tthis.TotalTime.Value += dt;\n\n\t\t\tif (!this.EditorEnabled && this.mapLoaded)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tIEnumerable<string> mapGlobalScripts = Directory.GetFiles(Path.Combine(this.Content.RootDirectory, \"GlobalScripts\"), \"*\", SearchOption.AllDirectories).Select(x => Path.Combine(\"..\\\\GlobalScripts\", Path.GetFileNameWithoutExtension(x)));\n\t\t\t\t\tforeach (string scriptName in mapGlobalScripts)\n\t\t\t\t\t\tthis.executeScript(scriptName);\n\t\t\t\t}\n\t\t\t\tcatch (IOException)\n\t\t\t\t{\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.mapLoaded = false;\n\n\t\t\tthis.LastKeyboardState.Value = this.KeyboardState;\n\t\t\tthis.KeyboardState.Value = Microsoft.Xna.Framework.Input.Keyboard.GetState();\n\t\t\tthis.LastMouseState.Value = this.MouseState;\n\t\t\tthis.MouseState.Value = Microsoft.Xna.Framework.Input.Mouse.GetState();\n\n\t\t\tthis.LastGamePadState.Value = this.GamePadState;\n\t\t\tthis.GamePadState.Value = Microsoft.Xna.Framework.Input.GamePad.GetState(PlayerIndex.One);\n\t\t\tif (this.GamePadState.Value.IsConnected != this.GamePadConnected)\n\t\t\t\tthis.GamePadConnected.Value = this.GamePadState.Value.IsConnected;\n\n\t\t\tthis.timer.Restart();\n\t\t\tfor (int i = 0; i < this.earlyUpdateables.Count; i++)\n\t\t\t{\n\t\t\t\tIEarlyUpdateableComponent c = this.earlyUpdateables[i];\n\t\t\t\tif (this.componentEnabled(c))\n\t\t\t\t\tc.Update(dt);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < this.updateables.Count; i++)\n\t\t\t{\n\t\t\t\tIUpdateableComponent c = this.updateables[i];\n\t\t\t\tif (this.componentEnabled(c))\n\t\t\t\t\tc.Update(dt);\n\t\t\t}\n\t\t\tthis.FlushComponents();\n\n\t\t\tif (this.earlyUpdateablesModified)\n\t\t\t{\n\t\t\t\tthis.earlyUpdateables.InsertionSort(delegate(IEarlyUpdateableComponent a, IEarlyUpdateableComponent b)\n\t\t\t\t{\n\t\t\t\t\treturn a.UpdateOrder.Value.CompareTo(b.UpdateOrder.Value);\n\t\t\t\t});\n\t\t\t\tthis.earlyUpdateablesModified = false;\n\t\t\t}\n\n\t\t\tif (this.drawablesModified)\n\t\t\t{\n\t\t\t\tthis.drawables.InsertionSort(delegate(IDrawableComponent a, IDrawableComponent b)\n\t\t\t\t{\n\t\t\t\t\treturn a.OrderKey.Value.CompareTo(b.OrderKey.Value);\n\t\t\t\t});\n\t\t\t\tthis.drawablesModified = false;\n\t\t\t}\n\n\t\t\tif (this.alphaDrawablesModified)\n\t\t\t{\n\t\t\t\tthis.alphaDrawables.InsertionSort(delegate(IDrawableAlphaComponent a, IDrawableAlphaComponent b)\n\t\t\t\t{\n\t\t\t\t\treturn a.DrawOrder.Value.CompareTo(b.DrawOrder.Value);\n\t\t\t\t});\n\t\t\t\tthis.alphaDrawablesModified = false;\n\t\t\t}\n\n\t\t\tif (this.postAlphaDrawablesModified)\n\t\t\t{\n\t\t\t\tthis.postAlphaDrawables.InsertionSort(delegate(IDrawablePostAlphaComponent a, IDrawablePostAlphaComponent b)\n\t\t\t\t{\n\t\t\t\t\treturn a.DrawOrder.Value.CompareTo(b.DrawOrder.Value);\n\t\t\t\t});\n\t\t\t\tthis.postAlphaDrawablesModified = false;\n\t\t\t}\n\n\t\t\tif (this.nonPostProcessedDrawablesModified)\n\t\t\t{\n\t\t\t\tthis.nonPostProcessedDrawables.InsertionSort(delegate(INonPostProcessedDrawableComponent a, INonPostProcessedDrawableComponent b)\n\t\t\t\t{\n\t\t\t\t\treturn a.DrawOrder.Value.CompareTo(b.DrawOrder.Value);\n\t\t\t\t});\n\t\t\t\tthis.nonPostProcessedDrawablesModified = false;\n\t\t\t}\n\n\t\t\tthis.timer.Stop();\n\t\t\tthis.updateSum = Math.Max(this.updateSum, this.timer.Elapsed.TotalSeconds);\n\n\t\t\tthis.timer.Restart();\n\t\t\tif (!this.Paused && !this.EditorEnabled && this.Space.TimeStepSettings.TimeStepDuration > 0.0f)\n\t\t\t\tthis.Space.Update(dt);\n\t\t\tthis.timer.Stop();\n\t\t\tthis.physicsSum = Math.Max(this.physicsSum, this.timer.Elapsed.TotalSeconds);\n\n\t\t\tthis.frameSum++;\n\t\t\tthis.performanceInterval += (float)this.GameTime.ElapsedGameTime.TotalSeconds;\n\t\t\tif (this.performanceInterval > Main.performanceUpdateTime)\n\t\t\t{\n\t\t\t\tthis.frameRate.Value = this.frameSum / this.performanceInterval;\n\t\t\t\tif (this.performanceMonitor.Visible)\n\t\t\t\t{\n\t\t\t\t\tthis.physicsTime.Value = this.physicsSum;\n\t\t\t\t\tthis.updateTime.Value = this.updateSum;\n\t\t\t\t\tthis.drawCalls.Value = this.drawCallCounter;\n\t\t\t\t\tthis.triangles.Value = this.triangleCounter;\n\t\t\t\t\tthis.renderTime.Value = this.renderSum;\n\t\t\t\t\tthis.drawCallCounter = 0;\n\t\t\t\t\tthis.triangleCounter = 0;\n\t\t\t\t}\n\t\t\t\tthis.renderSum = 0;\n\t\t\t\tthis.physicsSum = 0;\n\t\t\t\tthis.updateSum = 0;\n\t\t\t\tthis.frameSum = 0;\n\t\t\t\tthis.performanceInterval -= Main.performanceUpdateTime;\n\t\t\t\tthis.workingSet.Value = (int)(Environment.WorkingSet / (long)1048576);\n\t\t\t}\n\n\t\t\tAkSoundEngine.RenderAudio();\n\n\t\t\tTotalGameTime.Value += dt;\n#if STEAMWORKS\n\t\t\tSteamWorker.Update(dt);\n#endif\n\n#if ANALYTICS\n\t\t\tthis.SessionRecorder.Update(dt);\n#endif\n\n\t\t\tif (this.resize != null && this.resize.Value.X > 0 && this.resize.Value.Y > 0)\n\t\t\t{\n\t\t\t\tthis.ResizeViewport(this.resize.Value.X, this.resize.Value.Y, false, false);\n\t\t\t\tthis.resize = null;\n\t\t\t}\n\t\t}\n\n#if VR\n\t\tprivate void drawEye(Camera originalCamera, GameTime gameTime, Ovr.Posef pose, RenderTarget2D renderTarget, bool updateLights)\n\t\t{\n\t\t\tQuaternion quat = new Quaternion(pose.Orientation.x, pose.Orientation.y, pose.Orientation.z, pose.Orientation.w);\n\t\t\tthis.vrCamera.RotationMatrix.Value = Matrix.CreateFromQuaternion(quat) * originalCamera.RotationMatrix;\n\t\t\tVector3 viewAdjust = Vector3.TransformNormal(new Vector3(pose.Position.x, pose.Position.y, pose.Position.z), originalCamera.RotationMatrix);\n\t\t\tthis.vrCamera.Position.Value = originalCamera.Position.Value + viewAdjust * Main.VRUnitToWorldUnit;\n\t\t\tOvr.Matrix4f proj = Ovr.Hmd.GetProjection(this.vrLeftFov, originalCamera.NearPlaneDistance, originalCamera.FarPlaneDistance, (uint)Ovr.Hmd.ProjectionModifier.RightHanded);\n\t\t\tthis.vrCamera.Projection.Value = Oculus.MatrixOvrToXna(proj);\n\n\t\t\tfor (int i = 0; i < this.preframeDrawables.Count; i++)\n\t\t\t{\n\t\t\t\tIDrawablePreFrameComponent c = this.preframeDrawables[i];\n\t\t\t\tif (this.componentEnabled(c))\n\t\t\t\t\tc.DrawPreFrame(gameTime, this.renderParameters);\n\t\t\t}\n\n\t\t\tthis.Renderer.SetRenderTargets(this.renderParameters);\n\n\t\t\tthis.DrawScene(this.renderParameters);\n\n\t\t\tif (updateLights)\n\t\t\t{\n\t\t\t\tthis.LightingManager.UpdateGlobalLights();\n\t\t\t\tthis.LightingManager.RenderShadowMaps(originalCamera);\n\t\t\t}\n\n\t\t\tthis.Renderer.PostProcess(renderTarget, this.renderParameters);\n\n\t\t\tfor (int i = 0; i < this.nonPostProcessedDrawables.Count; i++)\n\t\t\t{\n\t\t\t\tINonPostProcessedDrawableComponent c = this.nonPostProcessedDrawables[i];\n\t\t\t\tif (this.componentEnabled(c))\n\t\t\t\t\tc.DrawNonPostProcessed(gameTime, this.renderParameters);\n\t\t\t}\n\t\t}\n#endif\n\n\t\tprotected override void Draw(GameTime gameTime)\n\t\t{\n\t\t\tif (this.GraphicsDevice == null || this.GraphicsDevice.IsDisposed || this.GraphicsDevice.GraphicsDeviceStatus != GraphicsDeviceStatus.Normal)\n\t\t\t\treturn;\n\n\t\t\tLemma.Components.Model.DrawCallCounter = 0;\n\t\t\tLemma.Components.Model.TriangleCounter = 0;\n\n\t\t\tthis.renderParameters.Technique = Technique.Render;\n\n\t\t\tthis.timer.Restart();\n\n#if VR\n\t\t\tOvr.FrameTiming frameTiming = new Ovr.FrameTiming();\n\t\t\tif (this.VR)\n\t\t\t{\n\t\t\t\tframeTiming = this.VRHmd.BeginFrameTiming(0);\n\n\t\t\t\tCamera originalCamera = this.renderParameters.Camera;\n\t\t\t\tthis.vrCamera.SetFromCamera(originalCamera);\n\t\t\t\tthis.vrCamera.ProjectionType.Value = Camera.ProjectionMode.Custom;\n\t\t\t\tthis.renderParameters.Camera = this.vrCamera;\n\n\t\t\t\tOvr.Posef[] eyes = this.VRHmd.GetEyePoses(0);\n\n\t\t\t\t// Position limitation\n\t\t\t\t{\n\t\t\t\t\tVector3 left = new Vector3(eyes[0].Position.x, eyes[0].Position.y, eyes[0].Position.z);\n\t\t\t\t\tVector3 right = new Vector3(eyes[1].Position.x, eyes[1].Position.y, eyes[1].Position.z);\n\t\t\t\t\tVector3 target = new Vector3(0, 0.0f / VRUnitToWorldUnit, -0.25f / VRUnitToWorldUnit);\n\t\t\t\t\tVector3 targetToEyes = ((left + right) * 0.5f) - target;\n\t\t\t\t\tfloat distance = targetToEyes.Length();\n\t\t\t\t\tconst float limit = 0.5f / VRUnitToWorldUnit;\n\t\t\t\t\tif (distance > limit)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 correction = targetToEyes * ((limit / distance) - 1.0f);\n\t\t\t\t\t\tleft += correction;\n\t\t\t\t\t\tright += correction;\n\t\t\t\t\t\teyes[0].Position.x = left.X;\n\t\t\t\t\t\teyes[0].Position.y = left.Y;\n\t\t\t\t\t\teyes[0].Position.z = left.Z;\n\t\t\t\t\t\teyes[1].Position.x = right.X;\n\t\t\t\t\t\teyes[1].Position.y = right.Y;\n\t\t\t\t\t\teyes[1].Position.z = right.Z;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.vrHmdDesc.EyeRenderOrder[0] == Ovr.Eye.Left)\n\t\t\t\t{\n\t\t\t\t\tthis.drawEye(originalCamera, gameTime, eyes[0], this.vrLeftEyeTarget, true);\n\t\t\t\t\tthis.drawEye(originalCamera, gameTime, eyes[1], this.vrRightEyeTarget, false);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.drawEye(originalCamera, gameTime, eyes[1], this.vrRightEyeTarget, true);\n\t\t\t\t\tthis.drawEye(originalCamera, gameTime, eyes[0], this.vrLeftEyeTarget, false);\n\t\t\t\t}\n\n\t\t\t\tthis.GraphicsDevice.SetRenderTarget(this.RenderTarget);\n\t\t\t\tthis.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Black);\n\n\t\t\t\t/*\n\t\t\t\tthis.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque);\n\t\t\t\tthis.spriteBatch.Draw(this.vrLeftEyeTarget, Vector2.Zero, Color.White);\n\t\t\t\tthis.spriteBatch.Draw(this.vrRightEyeTarget, new Vector2(this.vrLeftEyeTarget.Width, 0), Color.White);\n\t\t\t\tthis.spriteBatch.End();\n\t\t\t\t*/\n\t\t\t\tOvr.Hmd.WaitTillTime(frameTiming.TimewarpPointSeconds);\n\n\t\t\t\tthis.vrLeftMesh.Render(this.vrLeftEyeTarget, eyes[0], this.vrEffect);\n\t\t\t\tthis.vrRightMesh.Render(this.vrRightEyeTarget, eyes[1], this.vrEffect);\n\n\t\t\t\t// Update view projection matrix\n\t\t\t\tthis.VRLastViewProjection.Value = this.vrCamera.ViewProjection;\n\n\t\t\t\tthis.renderParameters.Camera = originalCamera;\n\t\t\t}\n\t\t\telse\n#endif\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.preframeDrawables.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tIDrawablePreFrameComponent c = this.preframeDrawables[i];\n\t\t\t\t\tif (this.componentEnabled(c))\n\t\t\t\t\t\tc.DrawPreFrame(gameTime, this.renderParameters);\n\t\t\t\t}\n\n\t\t\t\tthis.Renderer.SetRenderTargets(this.renderParameters);\n\n\t\t\t\tthis.DrawScene(this.renderParameters);\n\n\t\t\t\tthis.LightingManager.UpdateGlobalLights();\n\t\t\t\tthis.LightingManager.RenderShadowMaps(this.Camera);\n\n\t\t\t\tthis.Renderer.PostProcess(this.RenderTarget, this.renderParameters);\n\n\t\t\t\tfor (int i = 0; i < this.nonPostProcessedDrawables.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tINonPostProcessedDrawableComponent c = this.nonPostProcessedDrawables[i];\n\t\t\t\t\tif (this.componentEnabled(c))\n\t\t\t\t\t\tc.DrawNonPostProcessed(gameTime, this.renderParameters);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.drawCallCounter = Math.Max(this.drawCallCounter, Lemma.Components.Model.DrawCallCounter);\n\t\t\tthis.triangleCounter = Math.Max(this.triangleCounter, Lemma.Components.Model.TriangleCounter);\n\n\t\t\tif (this.RenderTarget != null)\n\t\t\t{\n\t\t\t\t// We just rendered to a target other than the screen.\n\t\t\t\t// So make it so we're rendering to the screen again, then copy the render target to the screen.\n\t\t\t\tthis.GraphicsDevice.SetRenderTarget(null);\n\n\t\t\t\tif (!this.RenderTarget.IsDisposed)\n\t\t\t\t{\n\t\t\t\t\tthis.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque);\n\t\t\t\t\tthis.spriteBatch.Draw(this.RenderTarget, Vector2.Zero, Color.White);\n\t\t\t\t\tthis.spriteBatch.End();\n\t\t\t\t}\n\t\t\t\tthis.RenderTarget = null;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void EndDraw()\n\t\t{\n\t\t\tbase.EndDraw();\n#if VR\n\t\t\tif (this.VR)\n\t\t\t\tthis.VRHmd.EndFrameTiming();\n#endif\n\n\t\t\tthis.timer.Stop();\n\t\t\tthis.frameTimer.Stop();\n\t\t\tthis.renderSum = Math.Max(this.renderSum, this.timer.Elapsed.TotalSeconds);\n\t\t\tthis.lastFrameTime = this.frameTimer.Elapsed;\n\t\t}\n\n\t\tpublic void DrawScene(RenderParameters parameters)\n\t\t{\n\t\t\tif (parameters.Technique != Technique.Shadow)\n\t\t\t\tthis.LightingManager.ClearMaterials();\n\n\t\t\tRasterizerState originalState = this.GraphicsDevice.RasterizerState;\n\t\t\tRasterizerState reverseCullState = null;\n\n\t\t\tif (parameters.ReverseCullOrder)\n\t\t\t{\n\t\t\t\treverseCullState = new RasterizerState { CullMode = CullMode.CullClockwiseFace };\n\t\t\t\tthis.GraphicsDevice.RasterizerState = reverseCullState;\n\t\t\t}\n\n\t\t\tVector3 cameraPos = parameters.Camera.Position;\n\t\t\tBoundingFrustum frustum = parameters.Camera.BoundingFrustum;\n\n\t\t\tfor (int i = 0; i < this.drawables.Count; i++)\n\t\t\t{\n\t\t\t\tIDrawableComponent c = this.drawables[i];\n\t\t\t\tif (this.componentEnabled(c) && c.IsVisible(frustum))\n\t\t\t\t\tc.Draw(this.GameTime, parameters);\n\t\t\t}\n\n\t\t\tif (reverseCullState != null)\n\t\t\t\tthis.GraphicsDevice.RasterizerState = originalState;\n\n\t\t\tif (parameters.Technique != Technique.Shadow)\n\t\t\t\tthis.LightingManager.SetMaterials(parameters);\n\t\t}\n\n\t\tpublic void DrawAlphaComponents(RenderParameters parameters)\n\t\t{\n\t\t\tfor (int i = 0; i < this.alphaDrawables.Count; i++)\n\t\t\t{\n\t\t\t\tIDrawableAlphaComponent c = this.alphaDrawables[i];\n\t\t\t\tif (this.componentEnabled(c))\n\t\t\t\t\tc.DrawAlpha(this.GameTime, parameters);\n\t\t\t}\n\t\t}\n\n\t\tpublic void DrawPostAlphaComponents(RenderParameters parameters)\n\t\t{\n\t\t\tfor (int i = 0; i < this.postAlphaDrawables.Count; i++)\n\t\t\t{\n\t\t\t\tIDrawablePostAlphaComponent c = this.postAlphaDrawables[i];\n\t\t\t\tif (this.componentEnabled(c))\n\t\t\t\t\tc.DrawPostAlpha(this.GameTime, parameters);\n\t\t\t}\n\t\t}\n\n#if VR\n\t\tprivate void reallocateVrTargets()\n\t\t{\n\t\t\tif (this.vrLeftEyeTarget != null)\n\t\t\t{\n\t\t\t\tthis.vrLeftEyeTarget.Dispose();\n\t\t\t\tthis.vrRightEyeTarget.Dispose();\n\t\t\t}\n\n\t\t\tif (this.VRHmd != null)\n\t\t\t{\n\t\t\t\tOvr.Sizei size = this.VRHmd.GetFovTextureSize(Ovr.Eye.Left, this.vrLeftFov, 1.0f);\n\t\t\t\tPoint renderTargetSize = new Point(size.w, size.h);\n\n\t\t\t\tthis.ScreenSize.Value = renderTargetSize;\n\n\t\t\t\tif (this.GraphicsDevice != null)\n\t\t\t\t{\n\t\t\t\t\tthis.vrLeftEyeTarget = new RenderTarget2D(this.GraphicsDevice, renderTargetSize.X, renderTargetSize.Y, false, SurfaceFormat.Color, DepthFormat.None);\n\t\t\t\t\tthis.vrRightEyeTarget = new RenderTarget2D(this.GraphicsDevice, renderTargetSize.X, renderTargetSize.Y, false, SurfaceFormat.Color, DepthFormat.None);\n\n\t\t\t\t\tPresentationParameters presentation = this.GraphicsDevice.PresentationParameters;\n\t\t\t\t\tthis.VRActualScreenSize.Value = new Point(presentation.BackBufferWidth, presentation.BackBufferHeight);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.VRActualScreenSize.Value = new Point(this.Graphics.PreferredBackBufferWidth, this.Graphics.PreferredBackBufferHeight);\n\t\t\t}\n\t\t}\n#endif\n\n\t\tpublic void ResizeViewport(int width, int height, bool fullscreen, bool borderless, bool applyChanges = true)\n\t\t{\n\t\t\tbool currentlyBorderless = !this.Graphics.IsFullScreen;\n\n#if VR\n\t\t\tif (this.VR)\n\t\t\t{\n\t\t\t\tcurrentlyBorderless = false;\n\t\t\t\tborderless = false;\n\t\t\t\tfullscreen = true;\n\t\t\t}\n#endif\n\n\t\t\tbool needApply = false;\n\t\t\tif (this.Settings.Fullscreen != fullscreen)\n\t\t\t\tneedApply = true;\n\n\t\t\tif (fullscreen && (width != this.nativeDisplayMode.Width || height != this.nativeDisplayMode.Height))\n\t\t\t\tborderless = this.Settings.Borderless.Value = false;\n\n\t\t\tif (fullscreen && currentlyBorderless != borderless)\n\t\t\t\tneedApply = true;\n\t\t\tthis.Graphics.IsFullScreen = fullscreen && !borderless;\n\t\t\tif (this.Graphics.PreferredBackBufferWidth != width)\n\t\t\t{\n\t\t\t\tthis.Graphics.PreferredBackBufferWidth = width;\n\t\t\t\tneedApply = true;\n\t\t\t}\n\t\t\tif (this.Graphics.PreferredBackBufferHeight != height)\n\t\t\t{\n\t\t\t\tthis.Graphics.PreferredBackBufferHeight = height;\n\t\t\t\tneedApply = true;\n\t\t\t}\n\n\t\t\tthis.Settings.Fullscreen.Value = fullscreen;\n#if VR\n\t\t\tif (!this.VR)\n#endif\n\t\t\t\tthis.Settings.Borderless.Value = borderless;\n\n\t\t\tif (applyChanges && needApply)\n\t\t\t\tthis.Graphics.ApplyChanges();\n\n#if VR\n\t\t\tif (this.VR)\n\t\t\t\tthis.reallocateVrTargets();\n\t\t\telse\n#endif\n\t\t\t{\n\t\t\t\tif (this.GraphicsDevice != null)\n\t\t\t\t{\n\t\t\t\t\tPresentationParameters presentation = this.GraphicsDevice.PresentationParameters;\n\t\t\t\t\twidth = presentation.BackBufferWidth;\n\t\t\t\t\theight = presentation.BackBufferHeight;\n\t\t\t\t}\n\t\t\t\tthis.ScreenSize.Value = new Point(width, height);\n\t\t\t\tif (fullscreen)\n\t\t\t\t\tthis.Settings.FullscreenResolution.Value = new Point(width, height);\n\t\t\t\telse\n\t\t\t\t\tthis.Settings.Size.Value = new Point(width, height);\n\t\t\t}\n\n\t\t\tif (this.GeeUI != null)\n\t\t\t{\n\t\t\t\tthis.GeeUI.RootView.Width.Value = width;\n\t\t\t\tthis.GeeUI.RootView.Height.Value = height;\n\t\t\t}\n\n\t\t\tif (this.Renderer != null)\n\t\t\t\tthis.Renderer.ReallocateBuffers(this.ScreenSize);\n\n\t\t\tif (!fullscreen || borderless)\n\t\t\t{\n\t\t\t\tSystem.Windows.Forms.Control control = System.Windows.Forms.Control.FromHandle(this.Window.Handle);\n\t\t\t\tSystem.Windows.Forms.Form form = control.FindForm();\n\t\t\t\tform.FormBorderStyle = fullscreen || borderless ? System.Windows.Forms.FormBorderStyle.None : System.Windows.Forms.FormBorderStyle.Sizable;\n\t\t\t\tif (fullscreen && borderless)\n\t\t\t\t\tform.Location = new System.Drawing.Point(0, 0);\n\t\t\t\tthis.resize = null;\n\t\t\t}\n\n#if ANALYTICS\n\t\t\tif (this.SessionRecorder != null)\n\t\t\t\tthis.SessionRecorder.RecordEvent(\"ResizedViewport\", string.Format(\"{0}x{1} {2}\", width, height, fullscreen ? \"fullscreen\" : \"windowed\"));\n#endif\n\t\t\tif (applyChanges && needApply && fullscreen && this.Renderer != null)\n\t\t\t\tthis.LoadContent(); // Reload everything\n\n\t\t\tthis.SaveSettings();\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/MainMenu.cs",
    "content": "using System;\nusing ComponentBind;\nusing Lemma.GameScripts;\nusing Microsoft.Xna.Framework;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Util;\nusing Lemma.Components;\nusing Lemma.Factories;\nusing Microsoft.Xna.Framework.Input;\n\nnamespace Lemma.GameScripts\n{\n\tpublic class MainMenu : ScriptBase\n\t{\n\t\tpublic static new bool AvailableInReleaseEditor = false;\n\n\t\tprivate static PCInput.PCInputBinding[] konamiCode = new[]\n\t\t{\n\t\t\tnew PCInput.PCInputBinding { Key = Keys.Up, GamePadButton = Buttons.DPadUp },\n\t\t\tnew PCInput.PCInputBinding { Key = Keys.Up, GamePadButton = Buttons.DPadUp },\n\t\t\tnew PCInput.PCInputBinding { Key = Keys.Down, GamePadButton = Buttons.DPadDown },\n\t\t\tnew PCInput.PCInputBinding { Key = Keys.Down, GamePadButton = Buttons.DPadDown },\n\t\t\tnew PCInput.PCInputBinding { Key = Keys.Left, GamePadButton = Buttons.DPadLeft },\n\t\t\tnew PCInput.PCInputBinding { Key = Keys.Right, GamePadButton = Buttons.DPadRight },\n\t\t\tnew PCInput.PCInputBinding { Key = Keys.Left, GamePadButton = Buttons.DPadLeft },\n\t\t\tnew PCInput.PCInputBinding { Key = Keys.Right, GamePadButton = Buttons.DPadRight },\n\t\t\tnew PCInput.PCInputBinding { Key = Keys.B, GamePadButton = Buttons.B },\n\t\t\tnew PCInput.PCInputBinding { Key = Keys.A, GamePadButton = Buttons.A },\n\t\t};\n\n\t\tpublic static void Run(Entity script)\n\t\t{\n\t\t\tconst float fadeTime = 1.0f;\n\n\t\t\tmain.Spawner.CanSpawn = false;\n\n\t\t\tSprite logo = new Sprite();\n\t\t\tlogo.Image.Value = \"Images\\\\logo\";\n\t\t\tlogo.AnchorPoint.Value = new Vector2(0.5f, 0.5f);\n\t\t\tmain.UI.Root.Children.Insert(0, logo);\n\n\t\t\tif (main.Spawner.StartSpawnPoint.Value == \"demo\")\n\t\t\t{\n\t\t\t\tmain.UI.IsMouseVisible.Value = true;\n\t\t\t\tlogo.Add(new Binding<Vector2, Point>(logo.Position, x => new Vector2(x.X * 0.5f, x.Y * 0.4f), main.ScreenSize));\n\t\t\t\t\n\t\t\t\tContainer listContainer = main.UIFactory.CreateContainer();\n\t\t\t\tlistContainer.Opacity.Value = 0.5f;\n\t\t\t\tlistContainer.PaddingLeft.Value = listContainer.PaddingRight.Value = listContainer.PaddingBottom.Value = listContainer.PaddingTop.Value = 8.0f * main.FontMultiplier;\n\t\t\t\tlistContainer.Add(new Binding<Vector2, Point>(listContainer.Position, x => new Vector2(x.X * 0.5f, x.Y * 0.65f), main.ScreenSize));\n\t\t\t\tlistContainer.AnchorPoint.Value = new Vector2(0.5f, 0.5f);\n\t\t\t\tlistContainer.Opacity.Value = 0.0f;\n\t\t\t\tscript.Add(new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Delay(1.0f),\n\t\t\t\t\tnew Animation.FloatMoveTo(listContainer.Opacity, 1.0f, fadeTime)\n\t\t\t\t));\n\n\t\t\t\tListContainer list = new ListContainer();\n\t\t\t\tlist.Spacing.Value = 8.0f * main.FontMultiplier;\n\t\t\t\tlist.Alignment.Value = ListContainer.ListAlignment.Middle;\n\t\t\t\tlistContainer.Children.Add(list);\n\t\t\t\tmain.UI.Root.Children.Insert(1, listContainer);\n\n\t\t\t\tscript.Add(new CommandBinding(script.Delete, listContainer.Delete));\n\n\t\t\t\tAction<string> addText = delegate(string text)\n\t\t\t\t{\n\t\t\t\t\tTextElement element = new TextElement();\n\t\t\t\t\telement.FontFile.Value = main.Font;\n\t\t\t\t\telement.Text.Value = text;\n\t\t\t\t\telement.Add(new Binding<float, Vector2>(element.WrapWidth, x => x.X, logo.ScaledSize));\n\t\t\t\t\telement.Opacity.Value = 0.0f;\n\t\t\t\t\tscript.Add(new Animation\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Delay(1.0f),\n\t\t\t\t\t\tnew Animation.FloatMoveTo(element.Opacity, 1.0f, fadeTime)\n\t\t\t\t\t));\n\t\t\t\t\tlist.Children.Add(element);\n\t\t\t\t};\n\n\t\t\t\tAction<string, string> addLink = delegate(string text, string url)\n\t\t\t\t{\n\t\t\t\t\tTextElement element = main.UIFactory.CreateLink(text, url);\n\t\t\t\t\telement.Add(new Binding<float, Vector2>(element.WrapWidth, x => x.X, logo.ScaledSize));\n\t\t\t\t\telement.Opacity.Value = 0.0f;\n\t\t\t\t\tscript.Add(new Animation\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Delay(1.0f),\n\t\t\t\t\t\tnew Animation.FloatMoveTo(element.Opacity, 1.0f, fadeTime)\n\t\t\t\t\t));\n\t\t\t\t\tlist.Children.Add(element);\n\t\t\t\t};\n\n\t\t\t\taddText(\"Thanks for trying the demo!\");\n\t\t\t\taddText(\"If you enjoyed it, please consider buying a Steam key from one of these venues:\");\n\n\t\t\t\taddLink(\"itch.io (best dev cut)\", \"http://et1337.itch.io/lemma\");\n\t\t\t\taddLink(\"Steam (direct)\", \"http://store.steampowered.com/app/300340\");\n\t\t\t}\n\t\t\telse\n\t\t\t\tlogo.Add(new Binding<Vector2, Point>(logo.Position, x => new Vector2(x.X * 0.5f, x.Y * 0.5f), main.ScreenSize));\n\n\t\t\tContainer cornerContainer = main.UIFactory.CreateContainer();\n\t\t\tcornerContainer.AnchorPoint.Value = new Vector2(1, 0);\n\t\t\tcornerContainer.PaddingLeft.Value = cornerContainer.PaddingRight.Value = 12.0f;\n\t\t\t#if VR\n\t\t\tif (main.VR)\n\t\t\t\tcornerContainer.Add(new Binding<Vector2, Point>(cornerContainer.Position, x => new Vector2(x.X * 0.75f, x.Y * 0.25f), main.ScreenSize));\n\t\t\telse\n\t\t\t#endif\n\t\t\t\tcornerContainer.Add(new Binding<Vector2, Point>(cornerContainer.Position, x => new Vector2(x.X - 10.0f, 10.0f), main.ScreenSize));\n\t\t\tmain.UI.Root.Children.Add(cornerContainer);\n\n\t\t\tListContainer corner = new ListContainer();\n\t\t\tcorner.Orientation.Value = ListContainer.ListOrientation.Horizontal;\n\t\t\tcorner.Alignment.Value = ListContainer.ListAlignment.Middle;\n\t\t\tcorner.Spacing.Value = 12.0f;\n\t\t\tcornerContainer.Children.Add(corner);\n\n\t\t\tTextElement version = new TextElement();\n\t\t\tversion.FontFile.Value = main.Font;\n\t\t\tversion.Add(new Binding<string>(version.Text, x => string.Format(main.Strings.Get(\"build number\") ?? \"Build {0}\", Main.Build.ToString()), main.Strings.Language));\n\t\t\tcorner.Children.Add(version);\n\n\t\t\tTextElement webLink = main.UIFactory.CreateLink(\"et1337.com\", \"http://et1337.com\");\n\t\t\tcorner.Children.Add(webLink);\n\n\t\t\tContainer languageMenu = new Container();\n\n\t\t\tContainer languageButton = main.UIFactory.CreateButton(delegate()\n\t\t\t{\n\t\t\t\tlanguageMenu.Visible.Value = !languageMenu.Visible;\n\t\t\t});\n\t\t\tcorner.Children.Add(languageButton);\n\n\t\t\tSprite currentLanguageIcon = new Sprite();\n\t\t\tcurrentLanguageIcon.Add(new Binding<string, Main.Config.Lang>(currentLanguageIcon.Image, x => \"Images\\\\\" + x.ToString(), main.Settings.Language));\n\t\t\tlanguageButton.Children.Add(currentLanguageIcon);\n\n\t\t\tlanguageMenu.Tint.Value = Microsoft.Xna.Framework.Color.Black;\n\t\t\tlanguageMenu.Visible.Value = false;\n\t\t\tlanguageMenu.AnchorPoint.Value = new Vector2(1, 0);\n\t\t\tcornerContainer.CheckLayout();\n\t\t\tlanguageMenu.Add(new Binding<Vector2>(languageMenu.Position, () => languageButton.GetAbsolutePosition() + new Vector2(languageButton.ScaledSize.Value.X, languageButton.ScaledSize.Value.Y), languageButton.Position, languageButton.ScaledSize, cornerContainer.Position));\n\t\t\tmain.UI.Root.Children.Add(languageMenu);\n\t\t\t\n\t\t\tListContainer languages = new ListContainer();\n\t\t\tlanguages.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tlanguages.Alignment.Value = ListContainer.ListAlignment.Max;\n\t\t\tlanguages.Spacing.Value = 0.0f;\n\t\t\tlanguageMenu.Children.Add(languages);\n\t\t\t\n\t\t\tforeach (Main.Config.Lang language in Enum.GetValues(typeof(Main.Config.Lang)))\n\t\t\t{\n\t\t\t\tUIComponent button = main.UIFactory.CreateButton(delegate()\n\t\t\t\t{\n\t\t\t\t\tmain.Settings.Language.Value = language;\n\t\t\t\t\tlanguageMenu.Visible.Value = false;\n\t\t\t\t});\n\n\t\t\t\tSprite icon = new Sprite();\n\t\t\t\ticon.Image.Value = \"Images\\\\\" + language.ToString();\n\t\t\t\tbutton.Children.Add(icon);\n\n\t\t\t\tlanguages.Children.Add(button);\n\t\t\t}\n\n\t\t\tlogo.Opacity.Value = 0.0f;\n\t\t\tversion.Opacity.Value = 0.0f;\n\t\t\tcornerContainer.Opacity.Value = 0.0f;\n\t\t\twebLink.Opacity.Value = 0.0f;\n\t\t\tlanguageButton.Opacity.Value = 0.0f;\n\t\t\tcurrentLanguageIcon.Opacity.Value = 0.0f;\n\n\t\t\tscript.Add(new Animation\n\t\t\t(\n\t\t\t\tnew Animation.Delay(1.0f),\n\t\t\t\tnew Animation.Parallel\n\t\t\t\t(\n\t\t\t\t\tnew Animation.FloatMoveTo(logo.Opacity, 1.0f, fadeTime),\n\t\t\t\t\tnew Animation.FloatMoveTo(version.Opacity, 1.0f, fadeTime),\n\t\t\t\t\tnew Animation.FloatMoveTo(cornerContainer.Opacity, UIFactory.Opacity, fadeTime),\n\t\t\t\t\tnew Animation.FloatMoveTo(webLink.Opacity, 1.0f, fadeTime),\n\t\t\t\t\tnew Animation.FloatMoveTo(languageButton.Opacity, UIFactory.Opacity, fadeTime),\n\t\t\t\t\tnew Animation.FloatMoveTo(currentLanguageIcon.Opacity, 1.0f, fadeTime)\n\t\t\t\t)\n\t\t\t));\n\n\t\t\tscript.Add(new CommandBinding(script.Delete, logo.Delete, cornerContainer.Delete, languageMenu.Delete));\n\n\t\t\tmain.Renderer.InternalGamma.Value = 0.0f;\n\t\t\tmain.Renderer.Brightness.Value = 0.0f;\n\t\t\tmain.Renderer.Tint.Value = new Vector3(0.0f);\n\t\t\tscript.Add(new Animation\n\t\t\t(\n\t\t\t\tnew Animation.Vector3MoveTo(main.Renderer.Tint, new Vector3(1.0f), 0.3f)\n\t\t\t));\n\n\t\t\tif (main.Settings.GodModeProperty)\n\t\t\t\tSteamWorker.SetAchievement(\"cheevo_god_mode\");\n\t\t\telse\n\t\t\t{\n\t\t\t\tint konamiIndex = 0;\n\t\t\t\tPCInput input = script.Create<PCInput>();\n\t\t\t\tinput.Add(new CommandBinding<PCInput.PCInputBinding>(input.AnyInputDown, delegate(PCInput.PCInputBinding button)\n\t\t\t\t{\n\t\t\t\t\tif (!main.Settings.GodModeProperty)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (button.Key == konamiCode[konamiIndex].Key || button.GamePadButton == konamiCode[konamiIndex].GamePadButton)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (konamiIndex == konamiCode.Length - 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmain.Settings.GodModeProperty.Value = true;\n\t\t\t\t\t\t\t\tmain.SaveSettings();\n\t\t\t\t\t\t\t\tSteamWorker.SetAchievement(\"cheevo_god_mode\");\n\t\t\t\t\t\t\t\tmain.Menu.HideMessage(script, main.Menu.ShowMessage(script, \"\\\\god mode\"), 5.0f);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tkonamiIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkonamiIndex = 0;\n\t\t\t\t\t\t\tif (button.Key == konamiCode[konamiIndex].Key || button.GamePadButton == konamiCode[konamiIndex].GamePadButton)\n\t\t\t\t\t\t\t\tkonamiIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Menu.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing GeeUI.Views;\nusing Lemma.Console;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Input;\nusing System.IO;\nusing System.Reflection;\nusing System.Xml.Serialization;\nusing Lemma.Util;\nusing Lemma.GInterfaces;\nusing Lemma.Factories;\nusing Newtonsoft.Json;\nusing ICSharpCode.SharpZipLib.GZip;\nusing Steamworks;\n\nnamespace Lemma.Components\n{\n\tpublic class Menu : Component<Main>, IUpdateableComponent\n\t{\n\t\tprivate static Dictionary<string, string> maps = new Dictionary<string, string>\n\t\t{\n\t\t\t{ \"rain\", \"\\\\map rain\" },\n\t\t\t{ \"dawn\", \"\\\\map dawn\" },\n\t\t\t{ \"forest\", \"\\\\map forest\" },\n\t\t\t{ \"monolith\", \"\\\\map monolith\" },\n\t\t\t{ \"fracture1\", \"\\\\map fracture\" },\n\t\t\t{ \"fortress\", \"\\\\map fortress\" },\n\t\t\t{ \"end\", \"\\\\map mark\" },\n\t\t};\n\n#if DEMO\n\t\tpublic const int MaxLevelIndex = 1;\n#else\n\t\tpublic const int MaxLevelIndex = int.MaxValue;\n#endif\n\n\t\tprivate const float messageFadeTime = 0.75f;\n\t\tprivate const float messageBackgroundOpacity = UIFactory.Opacity;\n\n\t\tprivate const float menuButtonWidth = 310.0f;\n\t\tprivate const float menuButtonLeftPadding = 30.0f;\n\t\tprivate const float animationSpeed = 2.5f;\n\t\tprivate const float hideAnimationSpeed = 5.0f;\n\n\t\tprivate List<Property<PCInput.PCInputBinding>> inputBindings = new List<Property<PCInput.PCInputBinding>>();\n\n\t\tprivate ListContainer messages;\n\t\tprivate ListContainer collectibleCounters;\n\n\t\tprivate PCInput input;\n\n\t\tpublic string Credits;\n\n\t\tprivate int displayModeIndex;\n\n\t\tpublic List<DisplayMode> SupportedDisplayModes;\n\n\t\tProperty<UIComponent> currentMenu = new Property<UIComponent> { Value = null };\n\n\t\tpublic Property<bool> Showing = new Property<bool>();\n\n\t\tpublic Property<bool> CanPause = new Property<bool> { Value = true };\n\n\t\t// Settings to be restored when unpausing\n\t\tprivate float originalBlurAmount = 0.0f;\n\t\tprivate bool originalMouseVisible;\n\t\tprivate bool originalUIMouseVisible;\n\t\tprivate Point originalMousePosition = new Point();\n\t\tprivate float lastGamepadMove;\n\t\tprivate float lastGamepadScroll;\n\n\t\tpublic void ClearMessages()\n\t\t{\n\t\t\tthis.messages.Children.Clear();\n\t\t\tthis.collectibleCounters.Children.Clear();\n\t\t}\n\n\t\tpublic Container BuildMessage(string text = null, float width = 250.0f)\n\t\t{\n\t\t\tContainer msgBackground = new Container();\n\n\t\t\tmsgBackground.Tint.Value = Color.Black;\n\t\t\tmsgBackground.Opacity.Value = messageBackgroundOpacity;\n\t\t\tTextElement msg = new TextElement();\n\t\t\tif (!string.IsNullOrEmpty(text))\n\t\t\t\tmsg.Text.Value = text;\n\t\t\tmsg.FontFile.Value = this.main.Font;\n\t\t\tmsg.WrapWidth.Value = width;\n\t\t\tmsgBackground.Children.Add(msg);\n\t\t\treturn msgBackground;\n\t\t}\n\n\t\tpublic Container ShowMessage(Entity entity, Func<string> text, params IProperty[] properties)\n\t\t{\n\t\t\tContainer container = this.BuildMessage();\n\t\t\tTextElement textElement = (TextElement)container.Children[0];\n\t\t\ttextElement.Add(new Binding<string>(textElement.Text, text, properties));\n\n\t\t\tthis.messages.Children.Add(container);\n\n\t\t\tthis.animateMessage(entity, container);\n\n\t\t\treturn container;\n\t\t}\n\n\t\tprivate void animateMessage(Entity entity, Container container, bool enabledWhenPaused = false)\n\t\t{\n\t\t\tcontainer.CheckLayout();\n\t\t\tVector2 originalSize = container.Size;\n\t\t\tcontainer.ResizeVertical.Value = false;\n\t\t\tcontainer.EnableScissor.Value = true;\n\t\t\tcontainer.Size.Value = new Vector2(originalSize.X, 0);\n\n\t\t\tAnimation anim = new Animation\n\t\t\t(\n\t\t\t\tnew Animation.Ease(new Animation.Vector2MoveTo(container.Size, originalSize, messageFadeTime), Animation.Ease.EaseType.OutExponential),\n\t\t\t\tnew Animation.Set<bool>(container.ResizeVertical, true)\n\t\t\t);\n\n\t\t\tcontainer.UserData.Value = anim;\n\n\t\t\tanim.EnabledWhenPaused = enabledWhenPaused;\n\t\t\tif (entity == null)\n\t\t\t\tthis.main.AddComponent(anim);\n\t\t\telse\n\t\t\t\tentity.Add(anim);\n\t\t}\n\n\t\tpublic Container ShowMessage(Entity entity, string text)\n\t\t{\n\t\t\tContainer container = this.BuildMessage(text);\n\n\t\t\tthis.messages.Children.Add(container);\n\n\t\t\tthis.animateMessage(entity, container);\n\n\t\t\treturn container;\n\t\t}\n\n\t\tpublic Container ShowMessageFormat(Entity entity, string text, params object[] properties)\n\t\t{\n\t\t\tif (text[0] == '\\\\')\n\t\t\t{\n\t\t\t\treturn this.ShowMessage\n\t\t\t\t(\n\t\t\t\t\tentity,\n\t\t\t\t\tdelegate()\n\t\t\t\t\t{\n\t\t\t\t\t\treturn string.Format(main.Strings.Get(text.Substring(1)) ?? text.Substring(1), properties);\n\t\t\t\t\t},\n\t\t\t\t\tthis.main.Strings.Language\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn this.ShowMessage(entity, string.Format(text, properties));\n\t\t}\n\n\t\tpublic void HideMessage(Entity entity, Container container, float delay = 0.0f)\n\t\t{\n\t\t\tif (container != null && container.Active)\n\t\t\t{\n\t\t\t\tcontainer.CheckLayout();\n\t\t\t\tAnimation anim = null;\n\t\t\t\tanim = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Delay(delay),\n\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tAnimation existingAnimation = container.UserData.Value as Animation;\n\t\t\t\t\t\tif (existingAnimation != null && existingAnimation.Active)\n\t\t\t\t\t\t\texistingAnimation.Delete.Execute();\n\t\t\t\t\t\tcontainer.UserData.Value = anim;\n\t\t\t\t\t}),\n\t\t\t\t\tnew Animation.Set<bool>(container.ResizeVertical, false),\n\t\t\t\t\tnew Animation.Ease(new Animation.Vector2MoveTo(container.Size, new Vector2(container.Size.Value.X, 0), messageFadeTime), Animation.Ease.EaseType.OutExponential),\n\t\t\t\t\tnew Animation.Execute(container.Delete)\n\t\t\t\t);\n\n\t\t\t\tif (entity == null)\n\t\t\t\t{\n\t\t\t\t\tanim.EnabledWhenPaused = false;\n\t\t\t\t\tthis.main.AddComponent(anim);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tentity.Add(anim);\n\t\t\t}\n\t\t}\n\n\t\tpublic void RemoveSaveGame(string filename)\n\t\t{\n\t\t\tUIComponent container = this.loadSaveList.Children.FirstOrDefault(x => ((string)x.UserData.Value) == filename);\n\t\t\tif (container != null)\n\t\t\t\tcontainer.Delete.Execute();\n\t\t}\n\n\t\tprivate Main.SaveInfo loadSaveInfo(string timestamp)\n\t\t{\n\t\t\tMain.SaveInfo info;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (Stream fs = new FileStream(Path.Combine(this.main.SaveDirectory, timestamp, \"save.dat\"), FileMode.Open, FileAccess.Read, FileShare.None))\n\t\t\t\tusing (Stream stream = new GZipInputStream(fs))\n\t\t\t\tusing (StreamReader reader = new StreamReader(stream))\n\t\t\t\t{\n\t\t\t\t\tstring data = reader.ReadToEnd();\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tinfo = JsonConvert.DeserializeObject<Main.SaveInfo>(data);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t{\n\t\t\t\t\t\tinfo = (Main.SaveInfo)Main.SaveInfo.Serializer.Deserialize(new StringReader(data));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (info.Version != Main.MapVersion)\n\t\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t\tcatch (Exception) // Incompatible version. Ignore.\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn info;\n\t\t}\n\n\t\tpublic void AddSaveGame(string timestamp)\n\t\t{\n\t\t\tif (this.loadSaveInfo(timestamp) == null) // Incompatible version or error\n\t\t\t\treturn;\n\t\t\tstring thumbnailPath = thumbnailPath = Path.Combine(this.main.SaveDirectory, timestamp, \"thumbnail.png\");\n\t\t\tUIComponent container = this.main.UIFactory.CreateButton();\n\t\t\tcontainer.UserData.Value = timestamp;\n\n\t\t\tListContainer layout = new ListContainer();\n\t\t\tlayout.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tcontainer.Children.Add(layout);\n\n\t\t\tif (File.Exists(thumbnailPath))\n\t\t\t{\n\t\t\t\tSprite sprite = new Sprite();\n\t\t\t\tsprite.IsStandardImage.Value = true;\n\t\t\t\tsprite.Image.Value = thumbnailPath;\n\t\t\t\tlayout.Children.Add(sprite);\n\t\t\t}\n\n\t\t\tTextElement label = new TextElement();\n\t\t\tlabel.FontFile.Value = this.main.Font;\n\t\t\tlabel.Text.Value = timestamp;\n\t\t\tlayout.Children.Add(label);\n\n\t\t\tcontainer.Add(new CommandBinding(container.MouseLeftUp, delegate()\n\t\t\t{\n\t\t\t\tif (this.saveMode)\n\t\t\t\t{\n\t\t\t\t\tthis.ShowDialog(\"\\\\overwrite prompt\", \"\\\\overwrite\", delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tcontainer.Delete.Execute();\n\t\t\t\t\t\tthis.main.SaveOverwrite(timestamp);\n\t\t\t\t\t\tthis.hideLoadSave();\n\t\t\t\t\t\tthis.main.Paused.Value = false;\n\t\t\t\t\t\tthis.restorePausedSettings();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.hideLoadSave();\n\t\t\t\t\tthis.main.Paused.Value = false;\n\t\t\t\t\tthis.restorePausedSettings();\n\t\t\t\t\tthis.main.CurrentSave.Value = timestamp;\n\t\t\t\t\tMain.SaveInfo info = this.loadSaveInfo(timestamp);\n\t\t\t\t\tIO.MapLoader.Load(this.main, info.MapFile, info.PlayerData);\n\t\t\t\t}\n\t\t\t\tcontainer.SwallowCurrentMouseEvent();\n\t\t\t}));\n\n\t\t\tthis.loadSaveList.Children.Insert(1, container);\n\t\t\tthis.loadSaveScroll.ScrollToTop();\n\t\t}\n\n\t\tprivate ListContainer challengeMenu;\n\t\tprivate ListContainer leaderboardMenu;\n\t\tprivate ListContainer leaderboardView;\n\n\t\tprivate ListContainer pauseMenu;\n\t\tprivate ListContainer notifications;\n\n\t\tprivate ListContainer loadSaveMenu;\n\t\tprivate ListContainer loadSaveList;\n\t\tprivate Scroller loadSaveScroll;\n\t\tprivate bool loadSaveShown;\n\t\tprivate Animation loadSaveAnimation;\n\t\tprivate Property<bool> saveMode = new Property<bool> { Value = false };\n\n\t\tprivate Animation pauseAnimation;\n\t\tprivate Container dialog;\n\n\t\tprivate void hidePauseMenu()\n\t\t{\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_UI_SWOOSH);\n\t\t\tif (this.pauseAnimation != null)\n\t\t\t\tthis.pauseAnimation.Delete.Execute();\n\t\t\tthis.pauseAnimation = new Animation\n\t\t\t(\n\t\t\t\tnew Animation.Vector2MoveToSpeed(this.pauseMenu.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\tnew Animation.Set<bool>(this.pauseMenu.Visible, false)\n\t\t\t);\n\t\t\tthis.main.AddComponent(this.pauseAnimation);\n\t\t\tthis.currentMenu.Value = null;\n\t\t}\n\n\t\tprivate void showPauseMenu()\n\t\t{\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_UI_SWOOSH);\n\t\t\tif (this.dialog != null)\n\t\t\t{\n\t\t\t\tthis.dialog.Delete.Execute();\n\t\t\t\tthis.dialog = null;\n\t\t\t}\n\t\t\tthis.pauseMenu.Visible.Value = true;\n\t\t\tif (this.pauseAnimation != null)\n\t\t\t\tthis.pauseAnimation.Delete.Execute();\n\t\t\tthis.pauseAnimation = new Animation(new Animation.Ease(new Animation.Vector2MoveToSpeed(this.pauseMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed), Animation.Ease.EaseType.OutExponential));\n\t\t\tthis.main.AddComponent(this.pauseAnimation);\n\t\t\tthis.currentMenu.Value = this.pauseMenu;\n\t\t}\n\n\t\t// Pause\n\t\tprivate void savePausedSettings(bool initial = false)\n\t\t{\n\t\t\tif (!initial)\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_UI_SWOOSH);\n\t\t\tSession.Recorder.Event(main, \"Pause\");\n\n\t\t\t// Take screenshot\n\t\t\tPoint size;\n#if VR\n\t\t\tif (this.main.VR)\n\t\t\t\tsize = this.main.VRActualScreenSize;\n\t\t\telse\n#endif\n\t\t\t\tsize = this.main.ScreenSize;\n\t\t\tthis.main.Screenshot.Take(size);\n\n\t\t\tthis.originalMouseVisible = this.main.IsMouseVisible;\n\t\t\tthis.originalUIMouseVisible = this.main.UI.IsMouseVisible;\n\t\t\tthis.main.UI.IsMouseVisible.Value = true;\n\t\t\tthis.originalBlurAmount = this.main.Renderer.BlurAmount;\n\n\t\t\t// Save mouse position\n\t\t\tMouseState mouseState = this.main.MouseState;\n\t\t\tthis.originalMousePosition = new Point(mouseState.X, mouseState.Y);\n\n\t\t\tthis.pauseMenu.Visible.Value = true;\n\t\t\tthis.pauseMenu.AnchorPoint.Value = new Vector2(1, 0.5f);\n\n\t\t\t// Blur the screen and show the pause menu\n\t\t\tif (this.pauseAnimation != null && this.pauseAnimation.Active)\n\t\t\t\tthis.pauseAnimation.Delete.Execute();\n\n\t\t\tfloat blurAmount;\n#if VR\n\t\t\tif (this.main.VR)\n\t\t\t\tblurAmount = 0.0f;\n\t\t\telse\n#endif\n\t\t\t{\n\t\t\t\tif (this.main.MapFile.Value == Main.MenuMap)\n\t\t\t\t\tblurAmount = 0.0f;\n\t\t\t\telse\n\t\t\t\t\tblurAmount = 1.0f;\n\t\t\t}\n\n\t\t\tthis.pauseAnimation = new Animation\n\t\t\t(\n\t\t\t\tnew Animation.Parallel\n\t\t\t\t(\n\t\t\t\t\tnew Animation.FloatMoveToSpeed(this.main.Renderer.BlurAmount, blurAmount, 1.0f),\n\t\t\t\t\tnew Animation.Ease\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Parallel\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew Animation.Vector2MoveToSpeed(this.pauseMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed),\n\t\t\t\t\t\t\tnew Animation.FloatMoveToSpeed(this.main.PauseAudioEffect, this.main.MapFile == Main.MenuMap ? 0.0f : 1.0f, Menu.animationSpeed)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tAnimation.Ease.EaseType.OutExponential\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\tthis.main.AddComponent(this.pauseAnimation);\n\n\t\t\tif (!this.main.EditorEnabled)\n\t\t\t{\n\t\t\t\tint orbs_collected = Collectible.Collectibles.Count(x => x.PickedUp);\n\t\t\t\tint orbs_total = Collectible.Collectibles.Count;\n\n\t\t\t\tint notes_collected = Note.Notes.Where(x => x.IsCollected).Count();\n\t\t\t\tint notes_total = Note.Notes.Count;\n\n\t\t\t\tif (orbs_collected < orbs_total)\n\t\t\t\t{\n\t\t\t\t\tContainer container = this.BuildMessage();\n\t\t\t\t\tTextElement textElement = (TextElement)container.Children[0];\n\n\t\t\t\t\ttextElement.Add(new Binding<string>\n\t\t\t\t\t(\n\t\t\t\t\t\ttextElement.Text,\n\t\t\t\t\t\tdelegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn string.Format(main.Strings.Get(\"orbs collected\") ?? \"{0} / {1} orbs collected\", orbs_collected, orbs_total);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tthis.main.Strings.Language\n\t\t\t\t\t));\n\t\t\t\t\t\t\n\t\t\t\t\tthis.collectibleCounters.Children.Add(container);\n\t\t\t\t\tthis.animateMessage(null, container, enabledWhenPaused: true);\n\t\t\t\t}\n\n\t\t\t\tif (notes_collected < notes_total)\n\t\t\t\t{\n\t\t\t\t\tContainer container = this.BuildMessage();\n\t\t\t\t\tTextElement textElement = (TextElement)container.Children[0];\n\n\t\t\t\t\ttextElement.Add(new Binding<string>\n\t\t\t\t\t(\n\t\t\t\t\t\ttextElement.Text,\n\t\t\t\t\t\tdelegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn string.Format(main.Strings.Get(\"notes read\") ?? \"{0} / {1} notes read\", notes_collected, notes_total);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tthis.main.Strings.Language\n\t\t\t\t\t));\n\t\t\t\t\t\t\n\t\t\t\t\tthis.collectibleCounters.Children.Add(container);\n\t\t\t\t\tthis.animateMessage(null, container, enabledWhenPaused: true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.currentMenu.Value = this.pauseMenu;\n\t\t}\n\n\t\t// Unpause\n\t\tprivate void restorePausedSettings()\n\t\t{\n\t\t\tSession.Recorder.Event(main, \"Unpause\");\n\n\t\t\tif (this.pauseAnimation != null && this.pauseAnimation.Active)\n\t\t\t\tthis.pauseAnimation.Delete.Execute();\n\n\t\t\t// Restore mouse\n\t\t\tif (!this.originalMouseVisible)\n\t\t\t{\n\t\t\t\t// Only restore mouse position if the cursor was not visible\n\t\t\t\t// i.e., we're in first-person camera mode\n\t\t\t\tMicrosoft.Xna.Framework.Input.Mouse.SetPosition(this.originalMousePosition.X, this.originalMousePosition.Y);\n\t\t\t\tMouseState m = new MouseState(this.originalMousePosition.X, this.originalMousePosition.Y, this.main.MouseState.Value.ScrollWheelValue, ButtonState.Released, ButtonState.Released, ButtonState.Released, ButtonState.Released, ButtonState.Released);\n\t\t\t\tthis.main.LastMouseState.Value = m;\n\t\t\t\tthis.main.MouseState.Value = m;\n\t\t\t}\n\t\t\tthis.main.UI.IsMouseVisible.Value = this.originalUIMouseVisible;\n\t\t\tthis.main.IsMouseVisible = this.originalMouseVisible;\n\n\t\t\tthis.main.SaveSettings();\n\n\t\t\t// Unlur the screen and show the pause menu\n\t\t\tif (this.pauseAnimation != null && this.pauseAnimation.Active)\n\t\t\t\tthis.pauseAnimation.Delete.Execute();\n\n\t\t\tthis.main.Renderer.BlurAmount.Value = originalBlurAmount;\n\t\t\tthis.pauseAnimation = new Animation\n\t\t\t(\n\t\t\t\tnew Animation.Parallel\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector2MoveToSpeed(this.pauseMenu.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\t\tnew Animation.FloatMoveToSpeed(this.main.PauseAudioEffect, 0.0f, Menu.hideAnimationSpeed)\n\t\t\t\t),\n\t\t\t\tnew Animation.Set<bool>(this.pauseMenu.Visible, false)\n\t\t\t);\n\t\t\tthis.main.AddComponent(this.pauseAnimation);\n\n\t\t\tthis.main.Screenshot.Clear();\n\n\t\t\tthis.currentMenu.Value = null;\n\n\t\t\tthis.collectibleCounters.Children.Clear();\n\t\t}\n\n\t\tprivate float width\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Menu.menuButtonWidth * this.main.FontMultiplier + Menu.menuButtonLeftPadding + 4.0f;\n\t\t\t}\n\t\t}\n\n\t\tprivate float spacing\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn 8.0f * this.main.FontMultiplier;\n\t\t\t}\n\t\t}\n\n\t\tprivate void resizeToMenu(Container c)\n\t\t{\n\t\t\tc.ResizeHorizontal.Value = false;\n\t\t\tc.Size.Value = new Vector2(this.width, 0.0f);\n\t\t\tc.PaddingLeft.Value = Menu.menuButtonLeftPadding;\n\t\t}\n\n\t\tpublic void EnableInput(bool enable)\n\t\t{\n\t\t\tif (this.currentMenu.Value != null && this.dialog == null)\n\t\t\t\tthis.currentMenu.Value.EnableInput.Value = enable;\n\t\t}\n\n\t\tpublic void ShowDialog(string question, string action, Action callback, string alternate = \"\\\\cancel\", Action alternateCallback = null)\n\t\t{\n\t\t\tif (this.dialog != null)\n\t\t\t\tthis.dialog.Delete.Execute();\n\t\t\tthis.EnableInput(false);\n\t\t\tthis.dialog = new Container();\n\t\t\tthis.dialog.Tint.Value = Color.Black;\n\t\t\tthis.dialog.Opacity.Value = UIFactory.Opacity;\n\t\t\tthis.dialog.AnchorPoint.Value = new Vector2(0.5f);\n\t\t\tthis.dialog.Add(new Binding<Vector2, Point>(this.dialog.Position, x => new Vector2(x.X * 0.5f, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tthis.dialog.Add(new CommandBinding(this.dialog.Delete, delegate()\n\t\t\t{\n\t\t\t\tthis.dialog = null;\n\t\t\t\tthis.EnableInput(true);\n\t\t\t}));\n\t\t\tthis.main.UI.Root.Children.Add(this.dialog);\n\n\t\t\tListContainer dialogLayout = new ListContainer();\n\t\t\tdialogLayout.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tthis.dialog.Children.Add(dialogLayout);\n\n\t\t\tTextElement prompt = new TextElement();\n\t\t\tprompt.FontFile.Value = this.main.Font;\n\t\t\tprompt.Text.Value = question;\n\t\t\tdialogLayout.Children.Add(prompt);\n\n\t\t\tListContainer dialogButtons = new ListContainer();\n\t\t\tdialogButtons.Orientation.Value = ListContainer.ListOrientation.Horizontal;\n\t\t\tdialogLayout.Children.Add(dialogButtons);\n\n\t\t\tUIComponent okay = this.main.UIFactory.CreateButton(\"\", delegate()\n\t\t\t{\n\t\t\t\tthis.dialog.Delete.Execute();\n\t\t\t\tcallback();\n\t\t\t});\n\t\t\tTextElement okayText = (TextElement)okay.GetChildByName(\"Text\");\n\t\t\tstring actionGamepad = string.Format(\"{0} gamepad\", action);\n\t\t\tokayText.Add(new Binding<string, bool>(okayText.Text, x => x ? actionGamepad : action, this.main.GamePadConnected));\n\t\t\tokay.Name.Value = \"Okay\";\n\t\t\tdialogButtons.Children.Add(okay);\n\n\t\t\tUIComponent cancel = this.main.UIFactory.CreateButton(alternate, delegate()\n\t\t\t{\n\t\t\t\tthis.dialog.Delete.Execute();\n\t\t\t\tif (alternateCallback != null)\n\t\t\t\t\talternateCallback();\n\t\t\t});\n\t\t\tdialogButtons.Children.Add(cancel);\n\n\t\t\tTextElement cancelText = (TextElement)cancel.GetChildByName(\"Text\");\n\t\t\tstring alternateGamepad = string.Format(\"{0} gamepad\", alternate);\n\t\t\tcancelText.Add(new Binding<string, bool>(cancelText.Text, x => x ? alternateGamepad : alternate, this.main.GamePadConnected));\n\t\t}\n\n\t\tprivate void hideLoadSave()\n\t\t{\n\t\t\tthis.showPauseMenu();\n\n\t\t\tthis.loadSaveShown = false;\n\n\t\t\tif (this.loadSaveAnimation != null)\n\t\t\t\tthis.loadSaveAnimation.Delete.Execute();\n\t\t\tthis.loadSaveAnimation = new Animation\n\t\t\t(\n\t\t\t\tnew Animation.Vector2MoveToSpeed(this.loadSaveMenu.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\tnew Animation.Set<bool>(this.loadSaveMenu.Visible, false)\n\t\t\t);\n\t\t\tthis.main.AddComponent(this.loadSaveAnimation);\n\t\t}\n\n\t\tpublic void SetupDisplayModes(List<DisplayMode> supportedDisplayModes, int displayModeIndex)\n\t\t{\n\t\t\tthis.SupportedDisplayModes = supportedDisplayModes;\n\t\t\tthis.displayModeIndex = displayModeIndex;\n\t\t}\n\n\t\tprivate Animation challengeAnimation = null;\n\t\tprivate Animation leaderboardAnimation = null;\n\t\tprivate Animation leaderboardViewAnimation = null;\n\t\tprivate Animation officialAnimation = null;\n\t\tprivate bool challengeMenuShown = false;\n\t\tprivate Action<bool> hideChallenge = null;\n\t\tprivate Action<bool> hideChallengeMenu = null;\n\t\tprivate Property<bool> leaderboardActive = new Property<bool>();\n\t\tprivate LeaderboardProxy leaderboardProxy = new LeaderboardProxy();\n\t\tprivate bool leaderboardOfficialMaps;\n\t\tpublic void ConstructChallengeMenu()\n\t\t{\n\t\t\t#region Root Challenge Menu\n\t\t\tthis.challengeMenu = new ListContainer();\n\t\t\tthis.challengeMenu.Visible.Value = false;\n\t\t\tthis.challengeMenu.Add(new Binding<Vector2, Point>(this.challengeMenu.Position, x => new Vector2(0, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tthis.challengeMenu.AnchorPoint.Value = new Vector2(1, 0.5f);\n\t\t\tthis.main.UI.Root.Children.Add(this.challengeMenu);\n\t\t\tthis.challengeMenu.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tContainer labelPadding = this.main.UIFactory.CreateContainer();\n\t\t\tthis.resizeToMenu(labelPadding);\n\t\t\tthis.challengeMenu.Children.Add(labelPadding);\n\n\t\t\tListContainer challengeLabelContainer = new ListContainer();\n\t\t\tchallengeLabelContainer.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tlabelPadding.Children.Add(challengeLabelContainer);\n\n\t\t\tTextElement challengeLabel = new TextElement();\n\t\t\tchallengeLabel.FontFile.Value = this.main.Font;\n\t\t\tchallengeLabel.Text.Value = \"\\\\challenge title\";\n\t\t\tchallengeLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tchallengeLabelContainer.Children.Add(challengeLabel);\n\n\t\t\tTextElement challengeWarning = new TextElement();\n\t\t\tchallengeWarning.FontFile.Value = this.main.Font;\n\t\t\tchallengeWarning.Text.Value = \"\\\\challenge warning\";\n\t\t\tchallengeWarning.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tchallengeLabelContainer.Children.Add(challengeWarning);\n\n\t\t\tthis.hideChallengeMenu = delegate(bool showPrev)\n\t\t\t{\n\t\t\t\tif (showPrev)\n\t\t\t\t\tthis.showPauseMenu();\n\n\t\t\t\tif (challengeAnimation != null)\n\t\t\t\t\tchallengeAnimation.Delete.Execute();\n\t\t\t\tchallengeAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector2MoveToSpeed(this.challengeMenu.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\t\tnew Animation.Set<bool>(this.challengeMenu.Visible, false)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(challengeAnimation);\n\t\t\t\tthis.challengeMenuShown = false;\n\t\t\t\tthis.hideChallenge = null;\n\t\t\t};\n\n\t\t\tthis.hideChallenge = hideChallengeMenu;\n\n\t\t\tContainer challengeButton = this.main.UIFactory.CreateButton(\"\\\\challenge levels\", ShowChallengeMenu);\n\t\t\tthis.resizeToMenu(challengeButton);\n\t\t\tchallengeButton.Add(new Binding<bool, string>(challengeButton.Visible, x => x == Main.MenuMap || this.main.IsChallengeMap(x), this.main.MapFile));\n\t\t\tthis.pauseMenu.Children.Add(challengeButton);\n\n\t\t\tContainer challengeBack = this.main.UIFactory.CreateButton(\"\\\\back\", () => hideChallengeMenu(true));\n\t\t\tthis.resizeToMenu(challengeBack);\n\t\t\tthis.challengeMenu.Children.Add(challengeBack);\n\t\t\t#endregion\n\n\t\t\t#region Leaderboard menu\n\t\t\tthis.leaderboardMenu = new ListContainer();\n\t\t\tthis.leaderboardMenu.Visible.Value = false;\n\t\t\tthis.leaderboardMenu.Add(new Binding<Vector2, Point>(this.leaderboardMenu.Position, x => new Vector2(0, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tthis.leaderboardMenu.AnchorPoint.Value = new Vector2(1, 0.5f);\n\t\t\tthis.main.UI.Root.Children.Add(this.leaderboardMenu);\n\t\t\tthis.leaderboardMenu.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tContainer leaderboardLabelPadding = this.main.UIFactory.CreateContainer();\n\t\t\tthis.resizeToMenu(leaderboardLabelPadding);\n\t\t\tthis.leaderboardMenu.Children.Add(leaderboardLabelPadding);\n\n\t\t\tListContainer leaderboardLabelContainer = new ListContainer();\n\t\t\tleaderboardLabelContainer.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tleaderboardLabelPadding.Children.Add(leaderboardLabelContainer);\n\n\t\t\tTextElement leaderboardLabel = new TextElement();\n\t\t\tleaderboardLabel.FontFile.Value = this.main.Font;\n\t\t\tleaderboardLabel.Text.Value = \"\\\\leaderboard title\";\n\t\t\tleaderboardLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tleaderboardLabelContainer.Children.Add(leaderboardLabel);\n\n\t\t\tAction<bool> hideLeaderboardMenu = delegate(bool showPrev)\n\t\t\t{\n\t\t\t\tif (this.leaderboardAnimation != null)\n\t\t\t\t\tthis.leaderboardAnimation.Delete.Execute();\n\t\t\t\tthis.leaderboardAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector2MoveToSpeed(this.leaderboardMenu.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\t\tnew Animation.Set<bool>(this.leaderboardMenu.Visible, false)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(this.leaderboardAnimation);\n\n\t\t\t\tthis.challengeMenuShown = showPrev;\n\t\t\t\tif (showPrev)\n\t\t\t\t\tShowChallengeMenu();\n\t\t\t};\n\n\t\t\tAction showLeaderboardMenu = delegate()\n\t\t\t{\n\t\t\t\thideChallengeMenu(false);\n\t\t\t\tthis.hidePauseMenu();\n\n\t\t\t\tthis.challengeMenuShown = true;\n\n\t\t\t\tthis.leaderboardMenu.Visible.Value = true;\n\t\t\t\tif (this.leaderboardAnimation != null)\n\t\t\t\t\tthis.leaderboardAnimation.Delete.Execute();\n\t\t\t\tthis.leaderboardAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Ease\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Vector2MoveToSpeed(this.leaderboardMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed),\n\t\t\t\t\t\tAnimation.Ease.EaseType.OutExponential\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(this.leaderboardAnimation);\n\t\t\t\tthis.currentMenu.Value = this.leaderboardMenu;\n\t\t\t\tthis.hideChallenge = hideLeaderboardMenu;\n\t\t\t};\n\n\t\t\tContainer leaderboardBack = this.main.UIFactory.CreateButton(\"\\\\back\", () => hideLeaderboardMenu(true));\n\t\t\tthis.resizeToMenu(leaderboardBack);\n\t\t\tthis.leaderboardMenu.Children.Add(leaderboardBack);\n\t\t\t#endregion\n\n\t\t\t#region Leaderboard display\n\t\t\tthis.leaderboardView = new ListContainer();\n\t\t\tthis.leaderboardView.Visible.Value = false;\n\t\t\tthis.leaderboardView.Add(new Binding<Vector2, Point>(this.leaderboardView.Position, x => new Vector2(0, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tthis.leaderboardView.AnchorPoint.Value = new Vector2(1, 0.5f);\n\t\t\tthis.main.UI.Root.Children.Add(this.leaderboardView);\n\t\t\tthis.leaderboardView.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tContainer leaderboardViewLabelPadding = this.main.UIFactory.CreateContainer();\n\t\t\tthis.resizeToMenu(leaderboardViewLabelPadding);\n\t\t\tthis.leaderboardView.Children.Add(leaderboardViewLabelPadding);\n\n\t\t\tListContainer leaderboardViewLabelContainer = new ListContainer();\n\t\t\tleaderboardViewLabelContainer.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tleaderboardViewLabelPadding.Children.Add(leaderboardViewLabelContainer);\n\n\t\t\tTextElement leaderboardViewLabel = new TextElement();\n\t\t\tleaderboardViewLabel.FontFile.Value = this.main.Font;\n\t\t\tleaderboardViewLabel.Text.Value = \"\\\\leaderboard title\";\n\t\t\tleaderboardViewLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tleaderboardViewLabelContainer.Children.Add(leaderboardViewLabel);\n\n\t\t\tTextElement leaderboardViewMapTitle = new TextElement();\n\t\t\tleaderboardViewMapTitle.FontFile.Value = this.main.Font;\n\t\t\tleaderboardViewMapTitle.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tleaderboardViewLabelContainer.Children.Add(leaderboardViewMapTitle);\n\n\t\t\tTextElement leaderboardViewScrollLabel = new TextElement();\n\t\t\tleaderboardViewScrollLabel.FontFile.Value = this.main.Font;\n\t\t\tleaderboardViewScrollLabel.Text.Value = \"\\\\scroll for more\";\n\t\t\tleaderboardViewScrollLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tleaderboardViewLabelContainer.Children.Add(leaderboardViewScrollLabel);\n\n\t\t\tAction<bool> hideLeaderboardView = null;\n\t\t\tAction showOfficialMenu = null, showWorkshopMenu = null;\n\n\t\t\tContainer leaderboardViewBack = this.main.UIFactory.CreateButton(\"\\\\back\", () => hideLeaderboardView(true));\n\t\t\tthis.resizeToMenu(leaderboardViewBack);\n\t\t\tthis.leaderboardView.Children.Add(leaderboardViewBack);\n\n\t\t\tListContainer leaderboardViewList = new ListContainer();\n\t\t\tleaderboardViewList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tScroller leaderboardViewScroller = new Scroller();\n\t\t\tleaderboardViewScroller.Children.Add(leaderboardViewList);\n\t\t\tleaderboardViewScroller.Add(new Binding<Vector2>(leaderboardViewScroller.Size, () => new Vector2(leaderboardViewList.Size.Value.X, this.main.ScreenSize.Value.Y * 0.5f), leaderboardViewList.Size, this.main.ScreenSize));\n\t\t\tthis.leaderboardView.Children.Add(leaderboardViewScroller);\n\n\t\t\thideLeaderboardView = delegate(bool showPrev)\n\t\t\t{\n\t\t\t\tthis.leaderboardProxy.CancelCallbacks();\n\t\t\t\tif (this.leaderboardViewAnimation != null)\n\t\t\t\t\tthis.leaderboardViewAnimation.Delete.Execute();\n\t\t\t\tthis.leaderboardViewAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector2MoveToSpeed(this.leaderboardView.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\t\tnew Animation.Set<bool>(this.leaderboardView.Visible, false)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(this.leaderboardViewAnimation);\n\n\t\t\t\tthis.challengeMenuShown = showPrev;\n\t\t\t\tif (showPrev)\n\t\t\t\t{\n\t\t\t\t\tif (this.leaderboardOfficialMaps)\n\t\t\t\t\t\tshowOfficialMenu();\n\t\t\t\t\telse\n\t\t\t\t\t\tshowWorkshopMenu();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.Add(new CommandBinding(this.leaderboardProxy.OnLeaderboardError, delegate()\n\t\t\t{\n\t\t\t\tleaderboardViewList.Children.Clear();\n\t\t\t\tTextElement error = this.main.UIFactory.CreateLabel();\n\t\t\t\terror.Text.Value = \"\\\\leaderboard error\";\n\t\t\t\tleaderboardViewList.Children.Add(error);;\n\t\t\t}));\n\n\t\t\tthis.Add(new CommandBinding<LeaderboardScoresDownloaded_t, LeaderboardScoresDownloaded_t>(this.leaderboardProxy.OnLeaderboardSync, delegate(LeaderboardScoresDownloaded_t globalScores, LeaderboardScoresDownloaded_t friendScores)\n\t\t\t{\n\t\t\t\tleaderboardViewList.Children.Clear();\n\n\t\t\t\tint[] details = new int[] {};\n\t\t\t\tfor (int i = 0; i < globalScores.m_cEntryCount; i++)\n\t\t\t\t{\n\t\t\t\t\tLeaderboardEntry_t entry;\n\t\t\t\t\tSteamUserStats.GetDownloadedLeaderboardEntry(globalScores.m_hSteamLeaderboardEntries, i, out entry, details, 0);\n\t\t\t\t\tleaderboardViewList.Children.Add(this.leaderboardEntry(entry));\n\t\t\t\t}\n\n\t\t\t\tif (friendScores.m_cEntryCount > 1)\n\t\t\t\t{\n\t\t\t\t\t{\n\t\t\t\t\t\tTextElement friendsLabel = this.main.UIFactory.CreateLabel(\"\\\\friends\");\n\t\t\t\t\t\tContainer labelContainer = this.main.UIFactory.CreateContainer();\n\t\t\t\t\t\tthis.resizeToMenu(labelContainer);\n\t\t\t\t\t\tfriendsLabel.Position.Value = new Vector2(labelContainer.Size.Value.X * 0.5f, 0.0f);\n\t\t\t\t\t\tfriendsLabel.AnchorPoint.Value = new Vector2(0.5f, 0.0f);\n\t\t\t\t\t\tleaderboardViewList.Children.Add(labelContainer);\n\t\t\t\t\t\tlabelContainer.Children.Add(friendsLabel);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = 0; i < friendScores.m_cEntryCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tLeaderboardEntry_t entry;\n\t\t\t\t\t\tSteamUserStats.GetDownloadedLeaderboardEntry(friendScores.m_hSteamLeaderboardEntries, i, out entry, details, 0);\n\t\t\t\t\t\tleaderboardViewList.Children.Add(this.leaderboardEntry(entry));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tAction<string, string> showLeaderboardView = delegate(string name, string uuid)\n\t\t\t{\n\t\t\t\thideLeaderboardMenu(false);\n\t\t\t\tleaderboardViewMapTitle.Text.Value = name;\n\n\t\t\t\tleaderboardViewList.Children.Clear();\n\n\t\t\t\tTextElement loading = this.main.UIFactory.CreateLabel();\n\t\t\t\tloading.Text.Value = \"\\\\loading\";\n\n\t\t\t\tContainer loadingContainer = this.main.UIFactory.CreateContainer();\n\t\t\t\tthis.resizeToMenu(loadingContainer);\n\t\t\t\tloadingContainer.Children.Add(loading);\n\t\t\t\tloading.Position.Value = new Vector2(menuButtonLeftPadding, 0);\n\t\t\t\tloading.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\t\tleaderboardViewList.Children.Add(loadingContainer);\n\n\t\t\t\tthis.leaderboardProxy.Sync(uuid);\n\n\t\t\t\tthis.challengeMenuShown = true;\n\n\t\t\t\tthis.leaderboardView.Visible.Value = true;\n\t\t\t\tif (this.leaderboardViewAnimation != null)\n\t\t\t\t\tthis.leaderboardViewAnimation.Delete.Execute();\n\t\t\t\tthis.leaderboardViewAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Ease\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Vector2MoveToSpeed(this.leaderboardView.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed),\n\t\t\t\t\t\tAnimation.Ease.EaseType.OutExponential\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(this.leaderboardViewAnimation);\n\t\t\t\tthis.currentMenu.Value = leaderboardViewList;\n\t\t\t\tthis.hideChallenge = hideLeaderboardView;\n\t\t\t};\n\t\t\t#endregion\n\n\t\t\t#region Official Maps\n\t\t\tListContainer officialMapsMenu = new ListContainer();\n\t\t\tofficialMapsMenu.Visible.Value = false;\n\t\t\tofficialMapsMenu.Add(new Binding<Vector2, Point>(officialMapsMenu.Position, x => new Vector2(0, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tofficialMapsMenu.AnchorPoint.Value = new Vector2(1, 0.5f);\n\t\t\tthis.main.UI.Root.Children.Add(officialMapsMenu);\n\t\t\tofficialMapsMenu.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tContainer officialLabelPadding = this.main.UIFactory.CreateContainer();\n\t\t\tthis.resizeToMenu(officialLabelPadding);\n\t\t\tofficialMapsMenu.Children.Add(officialLabelPadding);\n\n\t\t\tListContainer officialLabelContainer = new ListContainer();\n\t\t\tofficialLabelContainer.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tofficialLabelPadding.Children.Add(officialLabelContainer);\n\n\t\t\tTextElement officialLabel = new TextElement();\n\t\t\tofficialLabel.FontFile.Value = this.main.Font;\n\t\t\tofficialLabel.Add(new Binding<string, bool>(officialLabel.Text, x => x ? \"\\\\leaderboard title\" : \"\\\\challenge title\", this.leaderboardActive));\n\t\t\tofficialLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tofficialLabelContainer.Children.Add(officialLabel);\n\n\t\t\tTextElement officialLabel2 = new TextElement();\n\t\t\tofficialLabel2.FontFile.Value = this.main.Font;\n\t\t\tofficialLabel2.Text.Value = \"\\\\official levels\";\n\t\t\tofficialLabel2.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tofficialLabelContainer.Children.Add(officialLabel2);\n\n\t\t\tTextElement officialScrollLabel = new TextElement();\n\t\t\tofficialScrollLabel.FontFile.Value = this.main.Font;\n\t\t\tofficialScrollLabel.Text.Value = \"\\\\scroll for more\";\n\t\t\tofficialScrollLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tofficialLabelContainer.Children.Add(officialScrollLabel);\n\n\t\t\tAction<bool> hideOfficialMenu = delegate(bool showPrev)\n\t\t\t{\n\t\t\t\tif (officialAnimation != null)\n\t\t\t\t\tofficialAnimation.Delete.Execute();\n\t\t\t\tofficialAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector2MoveToSpeed(officialMapsMenu.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\t\tnew Animation.Set<bool>(officialMapsMenu.Visible, false)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(officialAnimation);\n\n\t\t\t\tthis.challengeMenuShown = showPrev;\n\t\t\t\tif (showPrev)\n\t\t\t\t{\n\t\t\t\t\tif (this.leaderboardActive)\n\t\t\t\t\t\tshowLeaderboardMenu();\n\t\t\t\t\telse\n\t\t\t\t\t\tShowChallengeMenu();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListContainer officialMapsList = new ListContainer();\n\t\t\tofficialMapsList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tshowOfficialMenu = delegate()\n\t\t\t{\n\t\t\t\tthis.hidePauseMenu();\n\n\t\t\t\tchallengeMenuShown = true;\n\t\t\t\tthis.hideChallenge = hideOfficialMenu;\n\n\t\t\t\tofficialMapsMenu.Visible.Value = true;\n\t\t\t\tif (officialAnimation != null)\n\t\t\t\t\tofficialAnimation.Delete.Execute();\n\t\t\t\tofficialAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Ease\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Vector2MoveToSpeed(officialMapsMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed),\n\t\t\t\t\t\tAnimation.Ease.EaseType.OutExponential\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(officialAnimation);\n\t\t\t\tthis.currentMenu.Value = officialMapsList;\n\t\t\t};\n\n#if STEAMWORKS\n\t\t\tContainer officialLeaderboard = this.main.UIFactory.CreateButton(\"\\\\official levels\", delegate()\n\t\t\t{\n\t\t\t\thideLeaderboardMenu(false);\n\t\t\t\tthis.leaderboardActive.Value = true;\n\t\t\t\tthis.leaderboardOfficialMaps = true;\n\t\t\t\tshowOfficialMenu();\n\t\t\t});\n\t\t\tthis.resizeToMenu(officialLeaderboard);\n\t\t\tthis.leaderboardMenu.Children.Add(officialLeaderboard);\n#endif\n\n\t\t\tContainer officialBack = this.main.UIFactory.CreateButton(\"\\\\back\", () => hideOfficialMenu(true));\n\t\t\tthis.resizeToMenu(officialBack);\n\t\t\tofficialMapsMenu.Children.Add(officialBack);\n\n\t\t\tScroller officialMapScroller = new Scroller();\n\t\t\tofficialMapScroller.Children.Add(officialMapsList);\n\t\t\tofficialMapScroller.Add(new Binding<Vector2>(officialMapScroller.Size, () => new Vector2(officialMapsList.Size.Value.X, this.main.ScreenSize.Value.Y * 0.5f), officialMapsList.Size, this.main.ScreenSize));\n\t\t\tofficialMapsMenu.Children.Add(officialMapScroller);\n\n\t\t\tDirectoryInfo dir = new DirectoryInfo(Path.Combine(this.main.MapDirectory, \"Challenge\"));\n\t\t\tif (dir.Exists)\n\t\t\t{\n\t\t\t\tforeach (var file in dir.GetFiles(\"*.map\"))\n\t\t\t\t{\n\t\t\t\t\tstring display = Path.GetFileNameWithoutExtension(file.Name);\n\t\t\t\t\tContainer button = this.main.UIFactory.CreateButton(display, delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\thideOfficialMenu(false);\n\t\t\t\t\t\tif (this.leaderboardActive)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstring uuid;\n\t\t\t\t\t\t\tusing (Stream fs = File.OpenRead(file.FullName))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tusing (Stream stream = new GZipInputStream(fs))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tuuid = ((List<Entity>)IO.MapLoader.Serializer.Deserialize(stream))[0].Get<World>().UUID;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tshowLeaderboardView(display, uuid);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thidePauseMenu();\n\t\t\t\t\t\t\tthis.main.Paused.Value = false;\n\t\t\t\t\t\t\tthis.restorePausedSettings();\n\t\t\t\t\t\t\tthis.main.CurrentSave.Value = null;\n\t\t\t\t\t\t\tthis.main.AddComponent(new Animation\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tnew Animation.Delay(0.2f),\n\t\t\t\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tIO.MapLoader.Load(this.main, file.FullName);\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tthis.resizeToMenu(button);\n\t\t\t\t\tofficialMapsList.Children.Add(button);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tContainer officialMaps = this.main.UIFactory.CreateButton(\"\\\\official levels\", delegate()\n\t\t\t{\n\t\t\t\thideChallengeMenu(false);\n\t\t\t\tthis.leaderboardActive.Value = false;\n\t\t\t\tshowOfficialMenu();\n\t\t\t});\n\t\t\tthis.resizeToMenu(officialMaps);\n\t\t\tthis.challengeMenu.Children.Add(officialMaps);\n\n\t\t\t#endregion\n\n\t\t\t#region Workshop Maps\n\t\t\tListContainer workshopMapsMenu = new ListContainer();\n\t\t\tworkshopMapsMenu.Visible.Value = false;\n\t\t\tworkshopMapsMenu.Add(new Binding<Vector2, Point>(workshopMapsMenu.Position, x => new Vector2(0, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tworkshopMapsMenu.AnchorPoint.Value = new Vector2(1, 0.5f);\n\t\t\tthis.main.UI.Root.Children.Add(workshopMapsMenu);\n\t\t\tworkshopMapsMenu.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tContainer workshopLabelPadding = this.main.UIFactory.CreateContainer();\n\t\t\tthis.resizeToMenu(workshopLabelPadding);\n\t\t\tworkshopMapsMenu.Children.Add(workshopLabelPadding);\n\n\t\t\tListContainer workshopLabelContainer = new ListContainer();\n\t\t\tworkshopLabelContainer.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tworkshopLabelPadding.Children.Add(workshopLabelContainer);\n\n\t\t\tTextElement workshopLabel = new TextElement();\n\t\t\tworkshopLabel.FontFile.Value = this.main.Font;\n\t\t\tworkshopLabel.Add(new Binding<string, bool>(workshopLabel.Text, x => x ? \"\\\\leaderboard title\" : \"\\\\challenge title\", this.leaderboardActive));\n\t\t\tworkshopLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tworkshopLabelContainer.Children.Add(workshopLabel);\n\n\t\t\tTextElement workshopLabel2 = new TextElement();\n\t\t\tworkshopLabel2.FontFile.Value = this.main.Font;\n\t\t\tworkshopLabel2.Text.Value = \"\\\\workshop levels\";\n\t\t\tworkshopLabel2.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tworkshopLabelContainer.Children.Add(workshopLabel2);\n\n\t\t\tTextElement workshopScrollLabel = new TextElement();\n\t\t\tworkshopScrollLabel.FontFile.Value = this.main.Font;\n\t\t\tworkshopScrollLabel.Text.Value = \"\\\\scroll for more\";\n\t\t\tworkshopScrollLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tworkshopLabelContainer.Children.Add(workshopScrollLabel);\n\n\t\t\tAction<bool> hideWorkshopMenu = delegate(bool showPrev)\n\t\t\t{\n\t\t\t\tif (officialAnimation != null)\n\t\t\t\t\tofficialAnimation.Delete.Execute();\n\t\t\t\tofficialAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector2MoveToSpeed(workshopMapsMenu.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\t\tnew Animation.Set<bool>(workshopMapsMenu.Visible, false)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(officialAnimation);\n\t\t\t\tthis.challengeMenuShown = showPrev;\n\t\t\t\tif (showPrev)\n\t\t\t\t{\n\t\t\t\t\tif (this.leaderboardActive)\n\t\t\t\t\t\tshowLeaderboardMenu();\n\t\t\t\t\telse\n\t\t\t\t\t\tShowChallengeMenu();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tListContainer workshopMapsList = new ListContainer();\n\t\t\tworkshopMapsList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tshowWorkshopMenu = delegate()\n\t\t\t{\n\t\t\t\tthis.hidePauseMenu();\n\n\t\t\t\tchallengeMenuShown = true;\n\t\t\t\tthis.hideChallenge = hideWorkshopMenu;\n\n\t\t\t\tworkshopMapsMenu.Visible.Value = true;\n\t\t\t\tif (officialAnimation != null)\n\t\t\t\t\tofficialAnimation.Delete.Execute();\n\t\t\t\tofficialAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Ease\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Vector2MoveToSpeed(workshopMapsMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed),\n\t\t\t\t\t\tAnimation.Ease.EaseType.OutExponential\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(officialAnimation);\n\t\t\t\tthis.currentMenu.Value = workshopMapsList;\n\t\t\t};\n\t\t\tContainer workshopGetMore = this.main.UIFactory.CreateButton(\"\\\\get more\", delegate()\n\t\t\t{\n\t\t\t\tUIFactory.OpenURL(string.Format(\"http://steamcommunity.com/workshop/browse?appid={0}\", Main.SteamAppID));\n\t\t\t});\n\t\t\tworkshopGetMore.Add(new Binding<bool>(workshopGetMore.Visible, x => !x, this.leaderboardActive));\n\t\t\tthis.resizeToMenu(workshopGetMore);\n\t\t\tworkshopMapsList.Children.Add(workshopGetMore);\n\n\t\t\tContainer workshopBack = this.main.UIFactory.CreateButton(\"\\\\back\", () => hideWorkshopMenu(true));\n\t\t\tthis.resizeToMenu(workshopBack);\n\t\t\tworkshopMapsMenu.Children.Add(workshopBack);\n\n\t\t\tScroller workshopMapsScroller = new Scroller();\n\t\t\tworkshopMapsScroller.Children.Add(workshopMapsList);\n\t\t\tworkshopMapsScroller.Add(new Binding<Vector2>(workshopMapsScroller.Size, () => new Vector2(workshopMapsList.Size.Value.X, this.main.ScreenSize.Value.Y * 0.5f), workshopMapsList.Size, this.main.ScreenSize));\n\t\t\tworkshopMapsMenu.Children.Add(workshopMapsScroller);\n\n\t\t\tAction reloadMaps = delegate()\n\t\t\t{\n\t\t\t\twhile (workshopMapsList.Children.Count > 1)\n\t\t\t\t\tworkshopMapsList.Children.RemoveAt(workshopMapsList.Children.Count - 1);\n\t\t\t\tDirectoryInfo workshopDir = SteamWorker.DownloadedMaps;\n\t\t\t\tif (workshopDir.Exists)\n\t\t\t\t{\n\t\t\t\t\tforeach (var subDir in workshopDir.GetDirectories())\n\t\t\t\t\t{\n\t\t\t\t\t\tSteamWorker.WorkshopMapMetadata\tmetadata = null;\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmetadata = JsonConvert.DeserializeObject<SteamWorker.WorkshopMapMetadata>(File.ReadAllText(Path.Combine(subDir.FullName, \"meta.json\")));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (metadata != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstring mapPath = subDir.GetFiles(subDir.Name + IO.MapLoader.MapExtension)[0].FullName;\n\t\t\t\t\t\t\tContainer button = this.main.UIFactory.CreateButton(metadata.Title, delegate()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\thideWorkshopMenu(false);\n\t\t\t\t\t\t\t\tif (this.leaderboardActive)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstring uuid;\n\t\t\t\t\t\t\t\t\tusing (Stream fs = File.OpenRead(mapPath))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tusing (Stream stream = new GZipInputStream(fs))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tuuid = ((List<Entity>)IO.MapLoader.Serializer.Deserialize(stream))[0].Get<World>().UUID;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tshowLeaderboardView(metadata.Title, uuid);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis.hidePauseMenu();\n\t\t\t\t\t\t\t\t\tthis.main.Paused.Value = false;\n\t\t\t\t\t\t\t\t\tthis.restorePausedSettings();\n\t\t\t\t\t\t\t\t\tthis.main.CurrentSave.Value = null;\n\t\t\t\t\t\t\t\t\tthis.main.AddComponent(new Animation\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\tnew Animation.Delay(0.2f),\n\t\t\t\t\t\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tIO.MapLoader.Load(this.main, mapPath);\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.resizeToMenu(button);\n\t\t\t\t\t\t\tworkshopMapsList.Children.Add(button);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.Add(new CommandBinding(SteamWorker.OnLevelDownloaded, delegate()\n\t\t\t{\n\t\t\t\tif (SteamWorker.Downloading == 0)\n\t\t\t\t\tthis.HideMessage(null, this.ShowMessage(null, \"\\\\workshop downloads complete\"), 3.0f);\n\t\t\t\treloadMaps();\n\t\t\t}));\n\n#if STEAMWORKS\n\t\t\tContainer workshopLeaderboard = this.main.UIFactory.CreateButton(\"\\\\workshop levels\", delegate()\n\t\t\t{\n\t\t\t\treloadMaps();\n\t\t\t\thideLeaderboardMenu(false);\n\t\t\t\tthis.leaderboardActive.Value = true;\n\t\t\t\tthis.leaderboardOfficialMaps = false;\n\t\t\t\tshowWorkshopMenu();\n\t\t\t});\n\t\t\tthis.resizeToMenu(workshopLeaderboard);\n\t\t\tthis.leaderboardMenu.Children.Add(workshopLeaderboard);\n\n\t\t\tContainer workshopMaps = this.main.UIFactory.CreateButton(\"\\\\workshop levels\", delegate()\n\t\t\t{\n\t\t\t\treloadMaps();\n\t\t\t\thideChallengeMenu(false);\n\t\t\t\tthis.leaderboardActive.Value = false;\n\t\t\t\tshowWorkshopMenu();\n\t\t\t});\n\t\t\tthis.resizeToMenu(workshopMaps);\n\t\t\tthis.challengeMenu.Children.Add(workshopMaps);\n\n\t\t\tContainer leaderboardButton = this.main.UIFactory.CreateButton(\"\\\\leaderboard\", showLeaderboardMenu);\n\t\t\tthis.resizeToMenu(leaderboardButton);\n\t\t\tthis.challengeMenu.Children.Add(leaderboardButton);\n\n#endif\n\n\t\t\tContainer levelEditor = this.main.UIFactory.CreateButton(\"\\\\level editor\", delegate()\n\t\t\t{\n\t\t\t\thideChallengeMenu(false);\n\t\t\t\tthis.editMode();\n\t\t\t});\n\t\t\tthis.resizeToMenu(levelEditor);\n\t\t\tthis.challengeMenu.Children.Add(levelEditor);\n\n\t\t\t#endregion\n\t\t}\n\n\t\tpublic void ShowChallengeMenu()\n\t\t{\n\t\t\tthis.hidePauseMenu();\n\n\t\t\tthis.challengeMenuShown = true;\n\n\t\t\tthis.challengeMenu.Visible.Value = true;\n\t\t\tif (challengeAnimation != null)\n\t\t\t\tchallengeAnimation.Delete.Execute();\n\t\t\tchallengeAnimation = new Animation\n\t\t\t(\n\t\t\t\tnew Animation.Ease\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector2MoveToSpeed(this.challengeMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed),\n\t\t\t\t\tAnimation.Ease.EaseType.OutExponential\n\t\t\t\t)\n\t\t\t);\n\t\t\tthis.main.AddComponent(challengeAnimation);\n\t\t\tthis.currentMenu.Value = this.challengeMenu;\n\t\t\tthis.hideChallenge = this.hideChallengeMenu;\n\t\t}\n\n\t\tprivate Container leaderboardEntry(LeaderboardEntry_t entry)\n\t\t{\n\t\t\tContainer container = this.main.UIFactory.CreateButton(delegate()\n\t\t\t{\n\t\t\t\tif (SteamWorker.SteamInitialized)\n\t\t\t\t\tSteamFriends.ActivateGameOverlayToUser(\"steamid\", entry.m_steamIDUser);\n\t\t\t});\n\t\t\tthis.resizeToMenu(container);\n\n\t\t\tTextElement rank = this.main.UIFactory.CreateLabel(entry.m_nGlobalRank.ToString());\n\t\t\trank.AnchorPoint.Value = new Vector2(1, 0);\n\t\t\trank.Position.Value = new Vector2(this.width * 0.15f, 0);\n\t\t\tcontainer.Children.Add(rank);\n\n\t\t\tTextElement name = this.main.UIFactory.CreateLabel();\n\t\t\tname.FilterUnicode.Value = true;\n\t\t\tif (SteamFriends.RequestUserInformation(entry.m_steamIDUser, true))\n\t\t\t{\n\t\t\t\t// Need to wait for a callback before we know their username\n\t\t\t\tname.Add(new Binding<string>(name.Text, () => SteamFriends.GetFriendPersonaName(entry.m_steamIDUser), this.leaderboardProxy.PersonaNotification));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// We already know the username\n\t\t\t\tname.Text.Value = SteamFriends.GetFriendPersonaName(entry.m_steamIDUser);\n\t\t\t}\n\t\t\tname.Position.Value = new Vector2(this.width * 0.15f + this.spacing, 0);\n\t\t\tcontainer.Children.Add(name);\n\n\t\t\tTextElement score = this.main.UIFactory.CreateLabel(TimeTrialUI.SecondsToTimeString((float)entry.m_nScore / 1000.0f));\n\t\t\tscore.AnchorPoint.Value = new Vector2(1, 0);\n\t\t\tscore.Position.Value = new Vector2(this.width - 4.0f - this.spacing, 0);\n\t\t\tcontainer.Children.Add(score);\n\t\t\treturn container;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.input = new PCInput();\n\t\t\tthis.main.AddComponent(this.input);\n\n\t\t\tthis.Add(new Binding<bool, UIComponent>(this.Showing, x => x != null, this.currentMenu));\n\n\t\t\tLog.Handler = delegate(string log)\n\t\t\t{\n#if DEBUG\n\t\t\t\tthis.HideMessage(null, this.ShowMessage(null, log), 2.0f);\n\t\t\t\tthis.main.ConsoleUI.LogText(log);\n#endif\n\t\t\t\tSession.Recorder.Event(main, \"Log\", log);\n\t\t\t};\n\n\t\t\t// Message list\n\t\t\t{\n\t\t\t\tbool vrMessagePlacement = false;\n#if VR\n\t\t\t\tif (this.main.VR)\n\t\t\t\t\tvrMessagePlacement = true;\n#endif\n\t\t\t\tthis.messages = new ListContainer();\n\t\t\t\tthis.messages.Alignment.Value = ListContainer.ListAlignment.Middle;\n\t\t\t\tthis.messages.AnchorPoint.Value = new Vector2(0.5f, 1.0f);\n\t\t\t\tVector2 messagePlacement = new Vector2(0.5f, vrMessagePlacement ? 0.6f : 0.85f);\n\t\t\t\tthis.messages.Add(new Binding<Vector2, Point>(this.messages.Position, x => new Vector2(x.X * messagePlacement.X, x.Y * messagePlacement.Y), this.main.ScreenSize));\n\t\t\t\tthis.main.UI.Root.Children.Add(this.messages);\n\t\t\t}\n\n\t\t\t// Collectible counters\n\t\t\t{\n\t\t\t\tbool vrCounterPlacement = false;\n#if VR\n\t\t\t\tif (this.main.VR)\n\t\t\t\t\tvrCounterPlacement = true;\n#endif\n\t\t\t\tthis.collectibleCounters = new ListContainer();\n\t\t\t\tthis.collectibleCounters.Reversed.Value = true;\n\t\t\t\tthis.collectibleCounters.Alignment.Value = ListContainer.ListAlignment.Middle;\n\t\t\t\tthis.collectibleCounters.AnchorPoint.Value = new Vector2(0.5f, 0.0f);\n\t\t\t\tthis.collectibleCounters.Add(new Binding<bool>(this.collectibleCounters.Visible, x => !x, ConsoleUI.Showing));\n\t\t\t\tVector2 counterPlacement = new Vector2(0.5f, vrCounterPlacement ? 0.4f : 0.15f);\n\t\t\t\tthis.collectibleCounters.Add(new Binding<Vector2, Point>(this.collectibleCounters.Position, x => new Vector2(x.X * counterPlacement.X, x.Y * counterPlacement.Y), this.main.ScreenSize));\n\t\t\t\tthis.main.UI.Root.Children.Add(this.collectibleCounters);\n\t\t\t}\n\n\t\t\t{\n\t\t\t\tContainer downloading = this.BuildMessage();\n\t\t\t\tdownloading.AnchorPoint.Value = new Vector2(1.0f, 0.0f);\n\t\t\t\tdownloading.Add(new Binding<Vector2, Point>(downloading.Position, x => new Vector2(x.X * 0.9f, x.Y * 0.1f), this.main.ScreenSize));\n\t\t\t\tTextElement downloadingLabel = (TextElement)downloading.Children[0];\n\t\t\t\tdownloading.Add(new Binding<bool>(downloading.Visible, () => this.main.MapFile == Main.MenuMap && SteamWorker.Downloading > 0, this.main.MapFile, SteamWorker.Downloading));\n\t\t\t\tdownloadingLabel.Add(new Binding<string>\n\t\t\t\t(\n\t\t\t\t\tdownloadingLabel.Text,\n\t\t\t\t\tdelegate()\n\t\t\t\t\t{\n\t\t\t\t\t\treturn string.Format(main.Strings.Get(\"downloading workshop maps\") ?? \"downloading {0} workshop maps\", SteamWorker.Downloading.Value);\n\t\t\t\t\t},\n\t\t\t\t\tthis.main.Strings.Language, SteamWorker.Downloading\n\t\t\t\t));\n\t\t\t\tthis.main.UI.Root.Children.Add(downloading);\n\t\t\t}\n\n\t\t\tthis.notifications = new ListContainer();\n\t\t\tthis.notifications.Alignment.Value = ListContainer.ListAlignment.Max;\n\t\t\tthis.notifications.AnchorPoint.Value = new Vector2(1.0f, 0.0f);\n\t\t\tthis.notifications.Name.Value = \"Notifications\";\n\t\t\tthis.notifications.Add(new Binding<Vector2, Point>(this.notifications.Position, x => new Vector2(x.X * 0.9f, x.Y * 0.1f), this.main.ScreenSize));\n\t\t\tthis.main.UI.Root.Children.Add(this.notifications);\n\n\t\t\t// Pause menu\n\t\t\tthis.pauseMenu = new ListContainer();\n\t\t\tthis.pauseMenu.Visible.Value = false;\n\t\t\tthis.pauseMenu.Add(new Binding<Vector2, Point>(this.pauseMenu.Position, x => new Vector2(0, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tthis.pauseMenu.AnchorPoint.Value = new Vector2(1, 0.5f);\n\t\t\tthis.main.UI.Root.Children.Add(this.pauseMenu);\n\t\t\tthis.pauseMenu.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\t// Load / save menu\n\t\t\tthis.loadSaveMenu = new ListContainer();\n\t\t\tthis.loadSaveMenu.Visible.Value = false;\n\t\t\tthis.loadSaveMenu.Add(new Binding<Vector2, Point>(this.loadSaveMenu.Position, x => new Vector2(0, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tthis.loadSaveMenu.AnchorPoint.Value = new Vector2(1, 0.5f);\n\t\t\tthis.loadSaveMenu.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tthis.main.UI.Root.Children.Add(this.loadSaveMenu);\n\n\t\t\tContainer loadSavePadding = this.main.UIFactory.CreateContainer();\n\t\t\tthis.resizeToMenu(loadSavePadding);\n\t\t\tthis.loadSaveMenu.Children.Add(loadSavePadding);\n\n\t\t\tListContainer loadSaveLabelContainer = new ListContainer();\n\t\t\tloadSaveLabelContainer.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tloadSavePadding.Children.Add(loadSaveLabelContainer);\n\n\t\t\tTextElement loadSaveLabel = new TextElement();\n\t\t\tloadSaveLabel.FontFile.Value = this.main.Font;\n\t\t\tloadSaveLabel.Add(new Binding<string, bool>(loadSaveLabel.Text, x => x ? \"\\\\save title\" : \"\\\\load title\", this.saveMode));\n\t\t\tloadSaveLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tloadSaveLabelContainer.Children.Add(loadSaveLabel);\n\n\t\t\tTextElement loadSaveScrollLabel = new TextElement();\n\t\t\tloadSaveScrollLabel.FontFile.Value = this.main.Font;\n\t\t\tloadSaveScrollLabel.Text.Value = \"\\\\scroll for more\";\n\t\t\tloadSaveScrollLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tloadSaveLabelContainer.Children.Add(loadSaveScrollLabel);\n\n\t\t\tTextElement quickSaveLabel = new TextElement();\n\t\t\tquickSaveLabel.FontFile.Value = this.main.Font;\n\t\t\tquickSaveLabel.Add(new Binding<bool>(quickSaveLabel.Visible, this.saveMode));\n\t\t\tquickSaveLabel.Text.Value = \"\\\\quicksave instructions\";\n\t\t\tquickSaveLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tloadSaveLabelContainer.Children.Add(quickSaveLabel);\n\n\t\t\tContainer loadSaveBack = this.main.UIFactory.CreateButton(\"\\\\back\", this.hideLoadSave);\n\t\t\tthis.resizeToMenu(loadSaveBack);\n\t\t\tthis.loadSaveMenu.Children.Add(loadSaveBack);\n\n\t\t\tthis.loadSaveScroll = new Scroller();\n\t\t\tthis.loadSaveScroll.Add(new Binding<Vector2, Point>(this.loadSaveScroll.Size, x => new Vector2(Menu.menuButtonWidth * this.main.FontMultiplier + Menu.menuButtonLeftPadding + 4.0f, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tthis.loadSaveMenu.Children.Add(this.loadSaveScroll);\n\n\t\t\tthis.loadSaveList = new ListContainer();\n\t\t\tthis.loadSaveList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tthis.loadSaveScroll.Children.Add(this.loadSaveList);\n\n\t\t\tContainer saveNewButton = this.main.UIFactory.CreateButton(\"\\\\save new\", delegate()\n\t\t\t{\n\t\t\t\tthis.main.SaveNew();\n\t\t\t\tthis.hideLoadSave();\n\t\t\t\tthis.main.Paused.Value = false;\n\t\t\t\tthis.restorePausedSettings();\n\t\t\t});\n\t\t\tthis.resizeToMenu(saveNewButton);\n\t\t\tsaveNewButton.Add(new Binding<bool>(saveNewButton.Visible, this.saveMode));\n\t\t\tthis.loadSaveList.Children.Add(saveNewButton);\n\n\t\t\tforeach (string saveFile in Directory.GetDirectories(this.main.SaveDirectory, \"*\", SearchOption.TopDirectoryOnly).Select(x => Path.GetFileName(x)).OrderBy(x => x))\n\t\t\t\tthis.AddSaveGame(saveFile);\n\n\t\t\t// Settings menu\n\t\t\tbool settingsShown = false;\n\t\t\tAnimation settingsAnimation = null;\n\n\t\t\tFunc<bool, string> boolDisplay = x => x ? \"\\\\on\" : \"\\\\off\";\n\n\t\t\tListContainer settingsMenu = new ListContainer();\n\t\t\tsettingsMenu.Visible.Value = false;\n\t\t\tsettingsMenu.Add(new Binding<Vector2, Point>(settingsMenu.Position, x => new Vector2(0, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tsettingsMenu.AnchorPoint.Value = new Vector2(1, 0.5f);\n\t\t\tthis.main.UI.Root.Children.Add(settingsMenu);\n\t\t\tsettingsMenu.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tContainer settingsLabelPadding = this.main.UIFactory.CreateContainer();\n\t\t\tthis.resizeToMenu(settingsLabelPadding);\n\t\t\tsettingsMenu.Children.Add(settingsLabelPadding);\n\n\t\t\tListContainer settingsLabelContainer = new ListContainer();\n\t\t\tsettingsLabelContainer.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tsettingsLabelPadding.Children.Add(settingsLabelContainer);\n\n\t\t\tTextElement settingsLabel = new TextElement();\n\t\t\tsettingsLabel.FontFile.Value = this.main.Font;\n\t\t\tsettingsLabel.Text.Value = \"\\\\options title\";\n\t\t\tsettingsLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tsettingsLabelContainer.Children.Add(settingsLabel);\n\n\t\t\tTextElement settingsScrollLabel = new TextElement();\n\t\t\tsettingsScrollLabel.FontFile.Value = this.main.Font;\n\t\t\tsettingsScrollLabel.Add(new Binding<string>(settingsScrollLabel.Text, delegate()\n\t\t\t{\n\t\t\t\tif (this.main.GamePadConnected)\n\t\t\t\t\treturn \"\\\\modify setting gamepad\";\n\t\t\t\telse\n\t\t\t\t\treturn \"\\\\modify setting\";\n\t\t\t}, this.main.GamePadConnected));\n\t\t\tsettingsScrollLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tsettingsLabelContainer.Children.Add(settingsScrollLabel);\n\n\t\t\tTextElement settingsScrollLabel2 = new TextElement();\n\t\t\tsettingsScrollLabel2.FontFile.Value = this.main.Font;\n\t\t\tsettingsScrollLabel2.Text.Value = \"\\\\scroll for more\";\n\t\t\tsettingsScrollLabel2.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tsettingsLabelContainer.Children.Add(settingsScrollLabel2);\n\n\t\t\tAction hideSettings = delegate()\n\t\t\t{\n\t\t\t\tthis.main.SaveSettings();\n\t\t\t\tthis.showPauseMenu();\n\n\t\t\t\tsettingsShown = false;\n\n\t\t\t\tif (settingsAnimation != null)\n\t\t\t\t\tsettingsAnimation.Delete.Execute();\n\t\t\t\tsettingsAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector2MoveToSpeed(settingsMenu.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\t\tnew Animation.Set<bool>(settingsMenu.Visible, false)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(settingsAnimation);\n\t\t\t};\n\n\t\t\tContainer settingsBack = this.main.UIFactory.CreateButton(\"\\\\back\", hideSettings);\n\t\t\tthis.resizeToMenu(settingsBack);\n\t\t\tsettingsMenu.Children.Add(settingsBack);\n\n\t\t\tListContainer settingsList = new ListContainer();\n\t\t\tsettingsList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tScroller settingsScroller = new Scroller();\n\t\t\tsettingsScroller.Add(new Binding<Vector2>(settingsScroller.Size, () => new Vector2(settingsList.Size.Value.X, this.main.ScreenSize.Value.Y * 0.5f), settingsList.Size, this.main.ScreenSize));\n\t\t\tsettingsScroller.Children.Add(settingsList);\n\t\t\tsettingsMenu.Children.Add(settingsScroller);\n\n\t\t\tContainer soundEffectVolume = this.main.UIFactory.CreateScrollButton<float>(\"\\\\sound effect volume\", this.main.Settings.SoundEffectVolume, x => ((int)Math.Round(x * 100.0f)).ToString() + \"%\", delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Settings.SoundEffectVolume.Value = MathHelper.Clamp(this.main.Settings.SoundEffectVolume.Value + (delta * 0.1f), 0, 1);\n\t\t\t});\n\t\t\tthis.resizeToMenu(soundEffectVolume);\n\t\t\tsettingsList.Children.Add(soundEffectVolume);\n\n\t\t\tContainer musicVolume = this.main.UIFactory.CreateScrollButton<float>(\"\\\\music volume\", this.main.Settings.MusicVolume, x => ((int)Math.Round(x * 100.0f)).ToString() + \"%\", delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Settings.MusicVolume.Value = MathHelper.Clamp(this.main.Settings.MusicVolume.Value + (delta * 0.1f), 0, 1);\n\t\t\t});\n\t\t\tthis.resizeToMenu(musicVolume);\n\t\t\tsettingsList.Children.Add(musicVolume);\n\n#if VR\n\t\t\tif (this.main.VR)\n\t\t\t{\n\t\t\t\tContainer reticleEnabled = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\reticle\", this.main.Settings.EnableReticleVR, boolDisplay, delegate(int delta)\n\t\t\t\t{\n\t\t\t\t\tthis.main.Settings.EnableReticleVR.Value = !this.main.Settings.EnableReticleVR;\n\t\t\t\t});\n\t\t\t\tthis.resizeToMenu(reticleEnabled);\n\t\t\t\tsettingsList.Children.Add(reticleEnabled);\n\t\t\t}\n\t\t\telse\n#endif\n\t\t\t{\n\t\t\t\tContainer reticleEnabled = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\reticle\", this.main.Settings.EnableReticle, boolDisplay, delegate(int delta)\n\t\t\t\t{\n\t\t\t\t\tthis.main.Settings.EnableReticle.Value = !this.main.Settings.EnableReticle;\n\t\t\t\t});\n\t\t\t\tthis.resizeToMenu(reticleEnabled);\n\t\t\t\tsettingsList.Children.Add(reticleEnabled);\n\t\t\t}\n\n\t\t\t{\n\t\t\t\tContainer minimizeHeadBob = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\minimize head bob\", this.main.MinimizeCameraMovement, boolDisplay, delegate(int delta)\n\t\t\t\t{\n\t\t\t\t\tthis.main.MinimizeCameraMovement.Value = !this.main.MinimizeCameraMovement;\n\t\t\t\t});\n\t\t\t\tthis.resizeToMenu(minimizeHeadBob);\n\t\t\t\tsettingsList.Children.Add(minimizeHeadBob);\n\t\t\t}\n\n\t\t\t{\n\t\t\t\tContainer waypointsEnabled = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\waypoints\", this.main.Settings.EnableWaypoints, boolDisplay, delegate(int delta)\n\t\t\t\t{\n\t\t\t\t\tthis.main.Settings.EnableWaypoints.Value = !this.main.Settings.EnableWaypoints;\n\t\t\t\t});\n\t\t\t\tthis.resizeToMenu(waypointsEnabled);\n\t\t\t\tsettingsList.Children.Add(waypointsEnabled);\n\t\t\t}\n\n#if VR\n\t\t\tif (!this.main.VR)\n#endif\n\t\t\t{\n\t\t\t\tContainer fullscreenResolution = this.main.UIFactory.CreateScrollButton<Point>(\"\\\\fullscreen resolution\", this.main.Settings.FullscreenResolution, x => x.X.ToString() + \"x\" + x.Y.ToString(), delegate(int delta)\n\t\t\t\t{\n\t\t\t\t\tdisplayModeIndex = (displayModeIndex + delta) % this.SupportedDisplayModes.Count();\n\t\t\t\t\twhile (displayModeIndex < 0)\n\t\t\t\t\t\tdisplayModeIndex += this.SupportedDisplayModes.Count();\n\t\t\t\t\tDisplayMode mode = this.SupportedDisplayModes.ElementAt(displayModeIndex);\n\t\t\t\t\tthis.main.Settings.FullscreenResolution.Value = new Point(mode.Width, mode.Height);\n\t\t\t\t});\n\t\t\t\tthis.resizeToMenu(fullscreenResolution);\n\t\t\t\tsettingsList.Children.Add(fullscreenResolution);\n\t\t\t}\n\n#if VR\n\t\t\tif (!this.main.VR)\n#endif\n\t\t\t{\n\t\t\t\tContainer borderless = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\borderless\", this.main.Settings.Borderless, boolDisplay, delegate(int delta)\n\t\t\t\t{\n\t\t\t\t\tthis.main.Settings.Borderless.Value = !this.main.Settings.Borderless;\n\t\t\t\t});\n\t\t\t\tthis.resizeToMenu(borderless);\n\t\t\t\tsettingsList.Children.Add(borderless);\n\t\t\t}\n\n\t\t\tContainer vsyncEnabled = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\vsync\", this.main.Settings.Vsync, boolDisplay, delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Settings.Vsync.Value = !this.main.Settings.Vsync;\n\t\t\t});\n\t\t\tthis.resizeToMenu(vsyncEnabled);\n\t\t\tsettingsList.Children.Add(vsyncEnabled);\n\n#if VR\n\t\t\tif (!this.main.VR)\n#endif\n\t\t\t{\n\t\t\t\tContainer applyResolution = this.main.UIFactory.CreateButton(null, delegate()\n\t\t\t\t{\n\t\t\t\t\tif (this.main.Settings.Fullscreen)\n\t\t\t\t\t{\n\t\t\t\t\t\tPoint res = this.main.Settings.FullscreenResolution;\n\t\t\t\t\t\tthis.main.ResizeViewport(res.X, res.Y, true, this.main.Settings.Borderless);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.main.EnterFullscreen();\n\t\t\t\t});\n\t\t\t\tapplyResolution.Add(new Binding<string, bool>(((TextElement)applyResolution.GetChildByName(\"Text\")).Text, x => x ? \"\\\\apply resolution\" : \"\\\\enter fullscreen\", this.main.Settings.Fullscreen));\n\t\t\t\tthis.resizeToMenu(applyResolution);\n\t\t\t\tsettingsList.Children.Add(applyResolution);\n\t\t\t}\n\n\t\t\tContainer fpsLimit = this.main.UIFactory.CreateScrollButton<int>(\"\\\\fps limit\", this.main.Settings.FPSLimit, delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Settings.FPSLimit.Value = Math.Max(20, this.main.Settings.FPSLimit + delta * 5);\n\t\t\t});\n\t\t\tthis.resizeToMenu(fpsLimit);\n\t\t\tsettingsList.Children.Add(fpsLimit);\n\n\t\t\tContainer gamma = this.main.UIFactory.CreateScrollButton<float>(\"\\\\gamma\", this.main.Renderer.Gamma, x => ((int)Math.Round(x * 100.0f)).ToString() + \"%\", delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Renderer.Gamma.Value = Math.Max(0, Math.Min(2, this.main.Renderer.Gamma + (delta * 0.1f)));\n\t\t\t});\n\t\t\tthis.resizeToMenu(gamma);\n\t\t\tsettingsList.Children.Add(gamma);\n\n#if VR\n\t\t\tif (!this.main.VR)\n#endif\n\t\t\t{\n\t\t\t\tContainer fieldOfView = this.main.UIFactory.CreateScrollButton<float>(\"\\\\field of view\", this.main.Settings.FieldOfView, x => ((int)Math.Round(MathHelper.ToDegrees(this.main.Settings.FieldOfView))).ToString() + \"°\", delegate(int delta)\n\t\t\t\t{\n\t\t\t\t\tthis.main.Settings.FieldOfView.Value = Math.Max(MathHelper.ToRadians(60.0f), Math.Min(MathHelper.ToRadians(120.0f), this.main.Settings.FieldOfView + MathHelper.ToRadians(delta)));\n\t\t\t\t});\n\t\t\t\tthis.resizeToMenu(fieldOfView);\n\t\t\t\tsettingsList.Children.Add(fieldOfView);\n\t\t\t}\n\n#if VR\n\t\t\tif (!this.main.VR)\n#endif\n\t\t\t{\n\t\t\t\tContainer motionBlurAmount = this.main.UIFactory.CreateScrollButton<float>(\"\\\\motion blur amount\", this.main.Renderer.MotionBlurAmount, x => ((int)Math.Round(x * 100.0f)).ToString() + \"%\", delegate(int delta)\n\t\t\t\t{\n\t\t\t\t\tthis.main.Renderer.MotionBlurAmount.Value = Math.Max(0, Math.Min(1, this.main.Renderer.MotionBlurAmount + (delta * 0.1f)));\n\t\t\t\t});\n\t\t\t\tthis.resizeToMenu(motionBlurAmount);\n\t\t\t\tsettingsList.Children.Add(motionBlurAmount);\n\t\t\t}\n\n\t\t\tContainer reflectionsEnabled = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\reflections\", this.main.Settings.Reflections, boolDisplay, delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Settings.Reflections.Value = !this.main.Settings.Reflections;\n\t\t\t});\n\t\t\tthis.resizeToMenu(reflectionsEnabled);\n\t\t\tsettingsList.Children.Add(reflectionsEnabled);\n\n\t\t\tContainer ssaoEnabled = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\ambient occlusion\", this.main.Settings.SSAO, boolDisplay, delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Settings.SSAO.Value = !this.main.Settings.SSAO;\n\t\t\t});\n\t\t\tthis.resizeToMenu(ssaoEnabled);\n\t\t\tsettingsList.Children.Add(ssaoEnabled);\n\n\t\t\tContainer volumetricLightingEnabled = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\volumetric lighting\", this.main.Settings.VolumetricLighting, boolDisplay, delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Settings.VolumetricLighting.Value = !this.main.Settings.VolumetricLighting;\n\t\t\t});\n\t\t\tthis.resizeToMenu(volumetricLightingEnabled);\n\t\t\tsettingsList.Children.Add(volumetricLightingEnabled);\n\n\t\t\tContainer bloomEnabled = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\bloom\", this.main.Renderer.EnableBloom, boolDisplay, delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Renderer.EnableBloom.Value = !this.main.Renderer.EnableBloom;\n\t\t\t});\n\t\t\tthis.resizeToMenu(bloomEnabled);\n\t\t\tsettingsList.Children.Add(bloomEnabled);\n\n\t\t\tint numDynamicShadowSettings = typeof(LightingManager.DynamicShadowSetting).GetFields(BindingFlags.Static | BindingFlags.Public).Length;\n\t\t\tContainer dynamicShadows = this.main.UIFactory.CreateScrollButton<LightingManager.DynamicShadowSetting>(\"\\\\dynamic shadows\", this.main.LightingManager.DynamicShadows, x => \"\\\\\" + x.ToString().ToLower(), delegate(int delta)\n\t\t\t{\n\t\t\t\tint newValue = ((int)this.main.LightingManager.DynamicShadows.Value) + delta;\n\t\t\t\twhile (newValue < 0)\n\t\t\t\t\tnewValue += numDynamicShadowSettings;\n\t\t\t\tthis.main.LightingManager.DynamicShadows.Value = (LightingManager.DynamicShadowSetting)Enum.ToObject(typeof(LightingManager.DynamicShadowSetting), newValue % numDynamicShadowSettings);\n\t\t\t});\n\t\t\tthis.resizeToMenu(dynamicShadows);\n\t\t\tsettingsList.Children.Add(dynamicShadows);\n\n#if ANALYTICS\n\t\t\tContainer analyticsEnabled = this.main.UIFactory.CreateScrollButton<Main.Config.RecordAnalytics>(\"\\\\analytics\", this.main.Settings.Analytics, delegate(int delta)\n\t\t\t{\n\t\t\t\tMain.Config.RecordAnalytics current = this.main.Settings.Analytics;\n\t\t\t\tthis.main.Settings.Analytics.Value = current == Main.Config.RecordAnalytics.On ? Main.Config.RecordAnalytics.Off : Main.Config.RecordAnalytics.On;\n\t\t\t});\n\t\t\tthis.resizeToMenu(analyticsEnabled);\n\t\t\tsettingsList.Children.Add(analyticsEnabled);\n#endif\n\n\t\t\tContainer settingsReset = this.main.UIFactory.CreateButton(\"\\\\reset options\", delegate()\n\t\t\t{\n\t\t\t\tthis.ShowDialog(\"\\\\reset options?\", \"\\\\reset\", delegate()\n\t\t\t\t{\n\t\t\t\t\tthis.main.Settings.DefaultOptions();\n\t\t\t\t\tthis.main.SaveSettings();\n\t\t\t\t});\n\t\t\t});\n\t\t\tthis.resizeToMenu(settingsReset);\n\t\t\tsettingsList.Children.Add(settingsReset);\n\n\t\t\t// Controls menu\n\t\t\tAnimation controlsAnimation = null;\n\n\t\t\tListContainer controlsMenu = new ListContainer();\n\t\t\tcontrolsMenu.Visible.Value = false;\n\t\t\tcontrolsMenu.Add(new Binding<Vector2, Point>(controlsMenu.Position, x => new Vector2(0, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tcontrolsMenu.AnchorPoint.Value = new Vector2(1, 0.5f);\n\t\t\tthis.main.UI.Root.Children.Add(controlsMenu);\n\t\t\tcontrolsMenu.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tContainer controlsLabelPadding = this.main.UIFactory.CreateContainer();\n\t\t\tthis.resizeToMenu(controlsLabelPadding);\n\t\t\tcontrolsMenu.Children.Add(controlsLabelPadding);\n\n\t\t\tListContainer controlsLabelContainer = new ListContainer();\n\t\t\tcontrolsLabelContainer.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tcontrolsLabelPadding.Children.Add(controlsLabelContainer);\n\n\t\t\tTextElement controlsLabel = new TextElement();\n\t\t\tcontrolsLabel.FontFile.Value = this.main.Font;\n\t\t\tcontrolsLabel.Text.Value = \"\\\\controls title\";\n\t\t\tcontrolsLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tcontrolsLabelContainer.Children.Add(controlsLabel);\n\n\t\t\tTextElement controlsScrollLabel = new TextElement();\n\t\t\tcontrolsScrollLabel.FontFile.Value = this.main.Font;\n\t\t\tcontrolsScrollLabel.Text.Value = \"\\\\scroll for more\";\n\t\t\tcontrolsScrollLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tcontrolsLabelContainer.Children.Add(controlsScrollLabel);\n\n\t\t\tbool controlsShown = false;\n\n\t\t\tAction hideControls = delegate()\n\t\t\t{\n\t\t\t\tcontrolsShown = false;\n\t\t\t\tthis.main.SaveSettings();\n\n\t\t\t\tthis.showPauseMenu();\n\n\t\t\t\tif (controlsAnimation != null)\n\t\t\t\t\tcontrolsAnimation.Delete.Execute();\n\t\t\t\tcontrolsAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector2MoveToSpeed(controlsMenu.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\t\tnew Animation.Set<bool>(controlsMenu.Visible, false)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(controlsAnimation);\n\t\t\t};\n\n\t\t\tContainer controlsBack = this.main.UIFactory.CreateButton(\"\\\\back\", hideControls);\n\t\t\tthis.resizeToMenu(controlsBack);\n\t\t\tcontrolsMenu.Children.Add(controlsBack);\n\n\t\t\tListContainer controlsList = new ListContainer();\n\t\t\tcontrolsList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tScroller controlsScroller = new Scroller();\n\t\t\tcontrolsScroller.Add(new Binding<Vector2>(controlsScroller.Size, () => new Vector2(controlsList.Size.Value.X, this.main.ScreenSize.Value.Y * 0.5f), controlsList.Size, this.main.ScreenSize));\n\t\t\tcontrolsScroller.Children.Add(controlsList);\n\t\t\tcontrolsMenu.Children.Add(controlsScroller);\n\n\t\t\tContainer invertMouseX = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\invert look x\", this.main.Settings.InvertMouseX, boolDisplay, delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Settings.InvertMouseX.Value = !this.main.Settings.InvertMouseX;\n\t\t\t});\n\t\t\tthis.resizeToMenu(invertMouseX);\n\t\t\tcontrolsList.Children.Add(invertMouseX);\n\n\t\t\tContainer invertMouseY = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\invert look y\", this.main.Settings.InvertMouseY, boolDisplay, delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Settings.InvertMouseY.Value = !this.main.Settings.InvertMouseY;\n\t\t\t});\n\t\t\tthis.resizeToMenu(invertMouseY);\n\t\t\tcontrolsList.Children.Add(invertMouseY);\n\n\t\t\tContainer mouseSensitivity = this.main.UIFactory.CreateScrollButton<float>(\"\\\\look sensitivity\", this.main.Settings.MouseSensitivity, x => ((int)Math.Round(x * 100.0f)).ToString() + \"%\", delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Settings.MouseSensitivity.Value = Math.Max(0, Math.Min(5, this.main.Settings.MouseSensitivity + (delta * 0.1f)));\n\t\t\t});\n\t\t\tthis.resizeToMenu(mouseSensitivity);\n\t\t\tcontrolsList.Children.Add(mouseSensitivity);\n\n\t\t\tContainer controllerVibration = this.main.UIFactory.CreateScrollButton<bool>(\"\\\\controller vibration\", this.main.Settings.ControllerVibration, boolDisplay, delegate(int delta)\n\t\t\t{\n\t\t\t\tthis.main.Settings.ControllerVibration.Value = !this.main.Settings.ControllerVibration;\n\t\t\t});\n\t\t\tthis.resizeToMenu(controllerVibration);\n\t\t\tcontrolsList.Children.Add(controllerVibration);\n\t\t\tcontrollerVibration.Add(new Binding<bool>(controllerVibration.Visible, this.main.GamePadConnected));\n\n\t\t\tFunc<Property<PCInput.PCInputBinding>, string, bool, bool, Container> addInputSetting = delegate(Property<PCInput.PCInputBinding> setting, string display, bool allowGamepad, bool allowMouse)\n\t\t\t{\n\t\t\t\tthis.inputBindings.Add(setting);\n\t\t\t\tContainer button = this.main.UIFactory.CreatePropertyButton<PCInput.PCInputBinding>(display, setting);\n\t\t\t\tthis.resizeToMenu(button);\n\t\t\t\tbutton.Add(new CommandBinding(button.MouseLeftUp, delegate()\n\t\t\t\t{\n\t\t\t\t\tPCInput.PCInputBinding originalValue = setting;\n\t\t\t\t\tsetting.Value = new PCInput.PCInputBinding();\n\t\t\t\t\tthis.main.UI.EnableMouse.Value = false;\n\t\t\t\t\tinput.GetNextInput(delegate(PCInput.PCInputBinding binding)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (binding.Key == Keys.Escape)\n\t\t\t\t\t\t\tsetting.Value = originalValue;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPCInput.PCInputBinding newValue = new PCInput.PCInputBinding();\n\t\t\t\t\t\t\tnewValue.Key = originalValue.Key;\n\t\t\t\t\t\t\tnewValue.MouseButton = originalValue.MouseButton;\n\t\t\t\t\t\t\tnewValue.GamePadButton = originalValue.GamePadButton;\n\n\t\t\t\t\t\t\tif (binding.Key != Keys.None)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewValue.Key = binding.Key;\n\t\t\t\t\t\t\t\tnewValue.MouseButton = PCInput.MouseButton.None;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (allowMouse && binding.MouseButton != PCInput.MouseButton.None)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewValue.Key = Keys.None;\n\t\t\t\t\t\t\t\tnewValue.MouseButton = binding.MouseButton;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (allowGamepad)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (binding.GamePadButton != 0)\n\t\t\t\t\t\t\t\t\tnewValue.GamePadButton = binding.GamePadButton;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tnewValue.GamePadButton = 0;\n\n\t\t\t\t\t\t\tsetting.Value = newValue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.main.UI.EnableMouse.Value = true;\n\t\t\t\t\t});\n\t\t\t\t}));\n\t\t\t\tcontrolsList.Children.Add(button);\n\t\t\t\treturn button;\n\t\t\t};\n\n\t\t\tAction<Container> hideForGamepad = delegate(Container c)\n\t\t\t{\n\t\t\t\tc.Add(new Binding<bool>(c.Visible, x => !x, this.main.GamePadConnected));\n\t\t\t};\n\n\t\t\thideForGamepad(addInputSetting(this.main.Settings.Forward, \"\\\\move forward\", false, true));\n\t\t\thideForGamepad(addInputSetting(this.main.Settings.Left, \"\\\\move left\", false, true));\n\t\t\thideForGamepad(addInputSetting(this.main.Settings.Backward, \"\\\\move backward\", false, true));\n\t\t\thideForGamepad(addInputSetting(this.main.Settings.Right, \"\\\\move right\", false, true));\n\t\t\taddInputSetting(this.main.Settings.Jump, \"\\\\jump\", true, true);\n\t\t\taddInputSetting(this.main.Settings.Parkour, \"\\\\parkour\", true, true);\n\t\t\taddInputSetting(this.main.Settings.RollKick, \"\\\\roll / kick\", true, true);\n\t\t\taddInputSetting(this.main.Settings.TogglePhone, \"\\\\toggle phone\", true, true);\n\t\t\taddInputSetting(this.main.Settings.QuickSave, \"\\\\quicksave\", true, true);\n#if VR\n\t\t\tif (this.main.VR)\n\t\t\t\taddInputSetting(this.main.Settings.RecenterVRPose, \"\\\\recenter pose\", true, true);\n#endif\n\t\t\tContainer consoleSetting = addInputSetting(this.main.Settings.ToggleConsole, \"\\\\toggle console\", true, true);\n\t\t\tconsoleSetting.Add(new Binding<bool>(consoleSetting.Visible, this.main.Settings.GodModeProperty));\n\n#if VR\n\t\t\tif (!this.main.VR)\n#endif\n\t\t\t{\n\t\t\t\t// Mapping LMB to toggle fullscreen makes it impossible to change any other settings.\n\t\t\t\t// So don't allow it.\n\t\t\t\taddInputSetting(this.main.Settings.ToggleFullscreen, \"\\\\toggle fullscreen\", true, false);\n\t\t\t}\n\n\t\t\tContainer controlsReset = this.main.UIFactory.CreateButton(\"\\\\reset options\", delegate()\n\t\t\t{\n\t\t\t\tthis.ShowDialog(\"\\\\reset options?\", \"\\\\reset\", delegate()\n\t\t\t\t{\n\t\t\t\t\tthis.main.Settings.DefaultControls();\n\t\t\t\t\tthis.main.SaveSettings();\n\t\t\t\t});\n\t\t\t});\n\t\t\tthis.resizeToMenu(controlsReset);\n\t\t\tcontrolsList.Children.Add(controlsReset);\n\n\t\t\t// Start menu\n\t\t\tAnimation startAnimation = null;\n\t\t\tbool startShown = false;\n\n\t\t\tListContainer startMenu = new ListContainer();\n\t\t\tstartMenu.Visible.Value = false;\n\t\t\tstartMenu.Add(new Binding<Vector2, Point>(startMenu.Position, x => new Vector2(0, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tstartMenu.AnchorPoint.Value = new Vector2(1, 0.5f);\n\t\t\tthis.main.UI.Root.Children.Add(startMenu);\n\t\t\tstartMenu.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tContainer startLabelPadding = this.main.UIFactory.CreateContainer();\n\t\t\tthis.resizeToMenu(startLabelPadding);\n\t\t\tstartMenu.Children.Add(startLabelPadding);\n\n\t\t\tListContainer startLabelContainer = new ListContainer();\n\t\t\tstartLabelContainer.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tstartLabelPadding.Children.Add(startLabelContainer);\n\n\t\t\tTextElement startLabel = new TextElement();\n\t\t\tstartLabel.FontFile.Value = this.main.Font;\n\t\t\tstartLabel.Text.Value = \"\\\\start title\";\n\t\t\tstartLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tstartLabelContainer.Children.Add(startLabel);\n\n\t\t\tTextElement startScrollLabel = new TextElement();\n\t\t\tstartScrollLabel.FontFile.Value = this.main.Font;\n\t\t\tstartScrollLabel.Text.Value = \"\\\\scroll for more\";\n\t\t\tstartScrollLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tstartLabelContainer.Children.Add(startScrollLabel);\n\n\t\t\tAction hideStart = delegate()\n\t\t\t{\n\t\t\t\tstartShown = false;\n\n\t\t\t\tthis.showPauseMenu();\n\n\t\t\t\tif (startAnimation != null)\n\t\t\t\t\tstartAnimation.Delete.Execute();\n\t\t\t\tstartAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector2MoveToSpeed(startMenu.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\t\tnew Animation.Set<bool>(startMenu.Visible, false)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(startAnimation);\n\t\t\t};\n\n\t\t\tContainer startBack = this.main.UIFactory.CreateButton(\"\\\\back\", hideStart);\n\t\t\tthis.resizeToMenu(startBack);\n\t\t\tstartMenu.Children.Add(startBack);\n\n\t\t\tListContainer startList = new ListContainer();\n\t\t\tstartList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\t{\n\t\t\t\tint i = 0;\n\t\t\t\tforeach (KeyValuePair<string, string> item in Menu.maps)\n\t\t\t\t{\n\t\t\t\t\tint index = i;\n\t\t\t\t\tstring m = item.Key;\n\t\t\t\t\tContainer button = this.main.UIFactory.CreateButton(item.Value, delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\thideStart();\n\t\t\t\t\t\tthis.restorePausedSettings();\n\t\t\t\t\t\tthis.main.CurrentSave.Value = null;\n\t\t\t\t\t\tthis.main.AddComponent(new Animation\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew Animation.Delay(0.2f),\n\t\t\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.main.Spawner.StartSpawnPoint.Value = \"_main_menu\";\n\t\t\t\t\t\t\t\tIO.MapLoader.Load(this.main, m);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t));\n\t\t\t\t\t});\n\t\t\t\t\tbutton.Add(new Binding<bool>(button.Visible, () => index <= MaxLevelIndex && (this.main.Settings.GodModeProperty || this.main.Settings.LevelIndexProperty >= index), this.main.Settings.GodModeProperty, this.main.Settings.LevelIndexProperty));\n\t\t\t\t\tthis.resizeToMenu(button);\n\t\t\t\t\tstartList.Children.Add(button);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tScroller startScroller = new Scroller();\n\t\t\tstartScroller.Children.Add(startList);\n\t\t\tstartScroller.Add(new Binding<Vector2>(startScroller.Size, () => new Vector2(startList.Size.Value.X, this.main.ScreenSize.Value.Y * 0.5f), startList.Size, this.main.ScreenSize));\n\t\t\tstartMenu.Children.Add(startScroller);\n\n#if DEMO\n\t\t\t{\n\t\t\t\tContainer labelPadding = this.main.UIFactory.CreateContainer();\n\t\t\t\tlabelPadding.Opacity.Value = 0.0f;\n\t\t\t\tthis.resizeToMenu(labelPadding);\n\t\t\t\tthis.pauseMenu.Children.Add(labelPadding);\n\n\t\t\t\tTextElement label = new TextElement();\n\t\t\t\tlabel.FontFile.Value = this.main.Font;\n\t\t\t\tlabel.Text.Value = \"\\\\demo\";\n\t\t\t\tlabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\t\tlabelPadding.Children.Add(label);\n\t\t\t}\n#endif\n\n\t\t\t// Resume button\n\t\t\tContainer resume = this.main.UIFactory.CreateButton(\"\\\\resume\", delegate()\n\t\t\t{\n\t\t\t\tthis.main.Paused.Value = false;\n\t\t\t\tthis.restorePausedSettings();\n\t\t\t});\n\t\t\tthis.resizeToMenu(resume);\n\t\t\tresume.Visible.Value = false;\n\t\t\tthis.pauseMenu.Children.Add(resume);\n\t\t\tresume.Add(new Binding<bool, string>(resume.Visible, x => x != Main.MenuMap, this.main.MapFile));\n\n\t\t\t// Start button\n\t\t\tContainer start = this.main.UIFactory.CreateButton(\"\\\\new game\", delegate()\n\t\t\t{\n\t\t\t\tthis.hidePauseMenu();\n\n\t\t\t\tstartMenu.Visible.Value = true;\n\t\t\t\tif (startAnimation != null)\n\t\t\t\t\tstartAnimation.Delete.Execute();\n\t\t\t\tstartAnimation = new Animation(new Animation.Ease(new Animation.Vector2MoveToSpeed(startMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed), Animation.Ease.EaseType.OutExponential));\n\t\t\t\tthis.main.AddComponent(startAnimation);\n\n\t\t\t\tstartShown = true;\n\t\t\t\tthis.currentMenu.Value = startList;\n\t\t\t});\n\t\t\tthis.resizeToMenu(start);\n\t\t\tstart.Add(new Binding<bool, string>(start.Visible, x => x == Main.MenuMap, this.main.MapFile));\n\t\t\tthis.pauseMenu.Children.Add(start);\n\n\t\t\t// Save button\n\t\t\tContainer saveButton = this.main.UIFactory.CreateButton(\"\\\\save\", delegate()\n\t\t\t{\n\t\t\t\tif (PlayerFactory.Instance != null)\n\t\t\t\t{\n\t\t\t\t\tthis.hidePauseMenu();\n\n\t\t\t\t\tthis.saveMode.Value = true;\n\n\t\t\t\t\tthis.loadSaveMenu.Visible.Value = true;\n\t\t\t\t\tif (this.loadSaveAnimation != null)\n\t\t\t\t\t\tthis.loadSaveAnimation.Delete.Execute();\n\t\t\t\t\tthis.loadSaveAnimation = new Animation(new Animation.Ease(new Animation.Vector2MoveToSpeed(this.loadSaveMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed), Animation.Ease.EaseType.OutExponential));\n\t\t\t\t\tthis.main.AddComponent(this.loadSaveAnimation);\n\n\t\t\t\t\tthis.loadSaveShown = true;\n\t\t\t\t\tthis.currentMenu.Value = this.loadSaveList;\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.resizeToMenu(saveButton);\n\t\t\tsaveButton.Add(new Binding<bool>(saveButton.Visible, () => this.main.MapFile != Main.MenuMap && !this.main.IsChallengeMap(this.main.MapFile) && !this.main.EditorEnabled, this.main.MapFile, this.main.EditorEnabled));\n\t\t\tthis.pauseMenu.Children.Add(saveButton);\n\n\t\t\tAction showLoad = delegate()\n\t\t\t{\n\t\t\t\tthis.hidePauseMenu();\n\n\t\t\t\tthis.saveMode.Value = false;\n\n\t\t\t\tthis.loadSaveMenu.Visible.Value = true;\n\t\t\t\tif (this.loadSaveAnimation != null)\n\t\t\t\t\tthis.loadSaveAnimation.Delete.Execute();\n\t\t\t\tthis.loadSaveAnimation = new Animation(new Animation.Ease(new Animation.Vector2MoveToSpeed(this.loadSaveMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed), Animation.Ease.EaseType.OutExponential));\n\t\t\t\tthis.main.AddComponent(this.loadSaveAnimation);\n\n\t\t\t\tthis.loadSaveShown = true;\n\t\t\t\tthis.currentMenu.Value = this.loadSaveList;\n\t\t\t};\n\n\t\t\t// Load button\n\t\t\tContainer load = this.main.UIFactory.CreateButton(\"\\\\load\", showLoad);\n\t\t\tload.Add(new Binding<bool>(load.Visible, () => !this.main.IsChallengeMap(this.main.MapFile) && !this.main.EditorEnabled, this.main.MapFile, this.main.EditorEnabled));\n\t\t\tthis.resizeToMenu(load);\n\t\t\tthis.pauseMenu.Children.Add(load);\n\n\t\t\t// Retry button\n\t\t\tContainer retry = this.main.UIFactory.CreateButton(\"\\\\retry\", delegate()\n\t\t\t{\n\t\t\t\tthis.pauseMenu.Visible.Value = false;\n\t\t\t\tthis.currentMenu.Value = null;\n\t\t\t\tthis.main.Paused.Value = false;\n\t\t\t\tif (this.pauseAnimation != null)\n\t\t\t\t{\n\t\t\t\t\tthis.pauseAnimation.Delete.Execute();\n\t\t\t\t\tthis.pauseAnimation = null;\n\t\t\t\t}\n\n\t\t\t\tIO.MapLoader.Load(this.main, this.main.MapFile);\n\t\t\t});\n\t\t\tretry.Add(new Binding<bool>(retry.Visible, () => !this.main.EditorEnabled && this.main.IsChallengeMap(this.main.MapFile), this.main.EditorEnabled, this.main.MapFile));\n\t\t\tthis.resizeToMenu(retry);\n\t\t\tthis.pauseMenu.Children.Add(retry);\n\n\t\t\tConstructChallengeMenu();\n\n\t\t\t// Controls button\n\t\t\tContainer controlsButton = this.main.UIFactory.CreateButton(\"\\\\controls\", delegate()\n\t\t\t{\n\t\t\t\tthis.hidePauseMenu();\n\n\t\t\t\tcontrolsMenu.Visible.Value = true;\n\t\t\t\tif (controlsAnimation != null)\n\t\t\t\t\tcontrolsAnimation.Delete.Execute();\n\t\t\t\tcontrolsAnimation = new Animation(new Animation.Ease(new Animation.Vector2MoveToSpeed(controlsMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed), Animation.Ease.EaseType.OutExponential));\n\t\t\t\tthis.main.AddComponent(controlsAnimation);\n\n\t\t\t\tcontrolsShown = true;\n\t\t\t\tthis.currentMenu.Value = controlsList;\n\t\t\t});\n\t\t\tthis.resizeToMenu(controlsButton);\n\t\t\tthis.pauseMenu.Children.Add(controlsButton);\n\n\t\t\t// Settings button\n\t\t\tContainer settingsButton = this.main.UIFactory.CreateButton(\"\\\\options\", delegate()\n\t\t\t{\n\t\t\t\tthis.hidePauseMenu();\n\n\t\t\t\tsettingsMenu.Visible.Value = true;\n\t\t\t\tif (settingsAnimation != null)\n\t\t\t\t\tsettingsAnimation.Delete.Execute();\n\t\t\t\tsettingsAnimation = new Animation(new Animation.Ease(new Animation.Vector2MoveToSpeed(settingsMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed), Animation.Ease.EaseType.OutExponential));\n\t\t\t\tthis.main.AddComponent(settingsAnimation);\n\n\t\t\t\tsettingsShown = true;\n\n\t\t\t\tthis.currentMenu.Value = settingsList;\n\t\t\t});\n\t\t\tthis.resizeToMenu(settingsButton);\n\t\t\tthis.pauseMenu.Children.Add(settingsButton);\n\n#if VR\n\t\t\t// Recenter VR pose button\n\t\t\tif (this.main.VR)\n\t\t\t{\n\t\t\t\tContainer recenterVrPose = this.main.UIFactory.CreateButton(\"\\\\recenter pose button\", this.main.VRHmd.RecenterPose);\n\t\t\t\tthis.resizeToMenu(recenterVrPose);\n\t\t\t\tpauseMenu.Children.Add(recenterVrPose);\n\t\t\t}\n#endif\n\n\t\t\t// Edit mode toggle button\n\t\t\tContainer switchToEditMode = this.main.UIFactory.CreateButton(\"\\\\edit mode\", this.editMode);\n\t\t\tswitchToEditMode.Add(new Binding<bool>(switchToEditMode.Visible, () => !this.main.EditorEnabled && (this.main.Settings.GodModeProperty || Path.GetDirectoryName(this.main.MapFile) == this.main.CustomMapDirectory), this.main.EditorEnabled, this.main.MapFile, this.main.Settings.GodModeProperty));\n\t\t\tthis.resizeToMenu(switchToEditMode);\n\t\t\tthis.pauseMenu.Children.Add(switchToEditMode);\n\n\t\t\t// Credits window\n\t\t\tAnimation creditsAnimation = null;\n\t\t\tbool creditsShown = false;\n\n\t\t\tListContainer creditsMenu = new ListContainer();\n\t\t\tcreditsMenu.Visible.Value = false;\n\t\t\tcreditsMenu.Add(new Binding<Vector2, Point>(creditsMenu.Position, x => new Vector2(0, x.Y * 0.5f), this.main.ScreenSize));\n\t\t\tcreditsMenu.AnchorPoint.Value = new Vector2(1, 0.5f);\n\t\t\tthis.main.UI.Root.Children.Add(creditsMenu);\n\t\t\tcreditsMenu.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\n\t\t\tContainer creditsLabelPadding = this.main.UIFactory.CreateContainer();\n\t\t\tthis.resizeToMenu(creditsLabelPadding);\n\t\t\tcreditsMenu.Children.Add(creditsLabelPadding);\n\n\t\t\tListContainer creditsLabelContainer = new ListContainer();\n\t\t\tcreditsLabelContainer.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tcreditsLabelPadding.Children.Add(creditsLabelContainer);\n\n\t\t\tTextElement creditsLabel = new TextElement();\n\t\t\tcreditsLabel.FontFile.Value = this.main.Font;\n\t\t\tcreditsLabel.Text.Value = \"\\\\credits title\";\n\t\t\tcreditsLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tcreditsLabelContainer.Children.Add(creditsLabel);\n\n\t\t\tTextElement creditsScrollLabel = new TextElement();\n\t\t\tcreditsScrollLabel.FontFile.Value = this.main.Font;\n\t\t\tcreditsScrollLabel.Text.Value = \"\\\\scroll for more\";\n\t\t\tcreditsScrollLabel.WrapWidth.Value = menuButtonWidth - menuButtonLeftPadding;\n\t\t\tcreditsLabelContainer.Children.Add(creditsScrollLabel);\n\n\t\t\tAction hideCredits = delegate()\n\t\t\t{\n\t\t\t\tcreditsShown = false;\n\n\t\t\t\tthis.showPauseMenu();\n\n\t\t\t\tif (creditsAnimation != null)\n\t\t\t\t\tcreditsAnimation.Delete.Execute();\n\t\t\t\tcreditsAnimation = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Vector2MoveToSpeed(creditsMenu.AnchorPoint, new Vector2(1, 0.5f), Menu.hideAnimationSpeed),\n\t\t\t\t\tnew Animation.Set<bool>(creditsMenu.Visible, false)\n\t\t\t\t);\n\t\t\t\tthis.main.AddComponent(creditsAnimation);\n\t\t\t};\n\n\t\t\tContainer creditsBack = this.main.UIFactory.CreateButton(\"\\\\back\", delegate()\n\t\t\t{\n\t\t\t\thideCredits();\n\t\t\t});\n\t\t\tthis.resizeToMenu(creditsBack);\n\t\t\tcreditsMenu.Children.Add(creditsBack);\n\n\t\t\tContainer creditsDisplay = new Container();\n\t\t\tcreditsDisplay.PaddingLeft.Value = Menu.menuButtonLeftPadding;\n\t\t\tcreditsDisplay.Opacity.Value = 0;\n\n\t\t\tTextElement creditsText = new TextElement();\n\t\t\tcreditsText.FontFile.Value = this.main.Font;\n\t\t\tcreditsText.Text.Value = this.Credits = File.ReadAllText(\"attribution.txt\");\n\t\t\tcreditsDisplay.Children.Add(creditsText);\n\n\t\t\tScroller creditsScroller = new Scroller();\n\t\t\tcreditsScroller.Add(new Binding<Vector2>(creditsScroller.Size, () => new Vector2(creditsDisplay.Size.Value.X, this.main.ScreenSize.Value.Y * 0.5f), creditsDisplay.Size, this.main.ScreenSize));\n\t\t\tcreditsScroller.Children.Add(creditsDisplay);\n\t\t\tcreditsMenu.Children.Add(creditsScroller);\n\n\t\t\t// Credits button\n\t\t\tContainer credits = this.main.UIFactory.CreateButton(\"\\\\credits\", delegate()\n\t\t\t{\n\t\t\t\tthis.hidePauseMenu();\n\n\t\t\t\tcreditsMenu.Visible.Value = true;\n\t\t\t\tif (creditsAnimation != null)\n\t\t\t\t\tcreditsAnimation.Delete.Execute();\n\t\t\t\tcreditsAnimation = new Animation(new Animation.Ease(new Animation.Vector2MoveToSpeed(creditsMenu.AnchorPoint, new Vector2(0, 0.5f), Menu.animationSpeed), Animation.Ease.EaseType.OutExponential));\n\t\t\t\tthis.main.AddComponent(creditsAnimation);\n\n\t\t\t\tcreditsShown = true;\n\t\t\t\tthis.currentMenu.Value = creditsDisplay;\n\t\t\t});\n\t\t\tthis.resizeToMenu(credits);\n\t\t\tcredits.Add(new Binding<bool, string>(credits.Visible, x => x == Main.MenuMap, this.main.MapFile));\n\t\t\tthis.pauseMenu.Children.Add(credits);\n\n\t\t\t// Main menu button\n\t\t\tContainer mainMenu = this.main.UIFactory.CreateButton(\"\\\\main menu\", delegate()\n\t\t\t{\n\t\t\t\tthis.ShowDialog\n\t\t\t\t(\n\t\t\t\t\t\"\\\\quit prompt\", \"\\\\quit\",\n\t\t\t\t\tdelegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.main.CurrentSave.Value = null;\n\t\t\t\t\t\tthis.main.EditorEnabled.Value = false;\n\t\t\t\t\t\tIO.MapLoader.Load(this.main, Main.MenuMap);\n\t\t\t\t\t\tthis.main.Paused.Value = false;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t\tthis.resizeToMenu(mainMenu);\n\t\t\tthis.pauseMenu.Children.Add(mainMenu);\n\t\t\tmainMenu.Add(new Binding<bool, string>(mainMenu.Visible, x => x != Main.MenuMap, this.main.MapFile));\n\n\t\t\t// Exit button\n\t\t\tContainer exit = this.main.UIFactory.CreateButton(\"\\\\exit\", delegate()\n\t\t\t{\n\t\t\t\tif (this.main.MapFile.Value != Main.MenuMap)\n\t\t\t\t{\n\t\t\t\t\tthis.ShowDialog\n\t\t\t\t\t(\n\t\t\t\t\t\t\"\\\\exit prompt\", \"\\\\exit\",\n\t\t\t\t\t\tdelegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.main.SaveSettings();\n\t\t\t\t\t\t\tthrow new Main.ExitException();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthrow new Main.ExitException();\n\t\t\t});\n\t\t\tthis.resizeToMenu(exit);\n\t\t\tthis.pauseMenu.Children.Add(exit);\n\n\t\t\t// Escape key\n\t\t\t// Make sure we can only pause when there is a player currently spawned\n\t\t\t// Otherwise we could save the current map without the player. And that would be awkward.\n\t\t\tFunc<bool> canPause = delegate()\n\t\t\t{\n\t\t\t\tif (!this.CanPause)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (this.main.Paused)\n\t\t\t\t\treturn this.main.MapFile.Value != Main.MenuMap; // Only allow pausing on the menu map, don't allow unpausing\n\n\t\t\t\tif (SteamWorker.OverlayActive || !SteamWorker.OverlaySafelyGone)\n\t\t\t\t\treturn false;\n\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tAction togglePause = delegate()\n\t\t\t{\n\t\t\t\tif (this.dialog != null)\n\t\t\t\t{\n\t\t\t\t\tthis.dialog.Delete.Execute();\n\t\t\t\t\tthis.dialog = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (settingsShown)\n\t\t\t\t{\n\t\t\t\t\thideSettings();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (controlsShown)\n\t\t\t\t{\n\t\t\t\t\thideControls();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (creditsShown)\n\t\t\t\t{\n\t\t\t\t\thideCredits();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (this.loadSaveShown)\n\t\t\t\t{\n\t\t\t\t\tthis.hideLoadSave();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (startShown)\n\t\t\t\t{\n\t\t\t\t\thideStart();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (this.challengeMenuShown)\n\t\t\t\t{\n\t\t\t\t\tthis.hideChallenge(true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.main.MapFile.Value == Main.MenuMap)\n\t\t\t\t{\n\t\t\t\t\tif (this.currentMenu.Value == null)\n\t\t\t\t\t\tthis.savePausedSettings();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (this.currentMenu.Value == null)\n\t\t\t\t\t\tthis.savePausedSettings();\n\t\t\t\t\telse if (ConsoleUI.Showing)\n\t\t\t\t\t\tConsoleUI.Showing.Value = false;\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.restorePausedSettings();\n\t\t\t\t\tthis.main.Paused.Value = this.currentMenu.Value != null;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.input.Bind(this.main.Settings.ToggleConsole, PCInput.InputState.Up, delegate()\n\t\t\t{\n\t\t\t\tif (this.main.Settings.GodModeProperty && (this.main.Paused || this.CanPause) && !this.main.IsChallengeMap(this.main.MapFile))\n\t\t\t\t{\n\t\t\t\t\tif (this.currentMenu.Value == null && !ConsoleUI.Showing)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (canPause())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttogglePause();\n\t\t\t\t\t\t\tConsoleUI.Showing.Value = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tConsoleUI.Showing.Value = !ConsoleUI.Showing.Value;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.input.Add(new CommandBinding(input.GetKeyDown(Keys.Escape), delegate()\n\t\t\t{\n\t\t\t\tif (this.main.EditorEnabled)\n\t\t\t\t\treturn canPause() && (this.currentMenu.Value != null || this.dialog != null);\n\t\t\t\telse\n\t\t\t\t\treturn canPause() || this.dialog != null;\n\t\t\t}, togglePause));\n\t\t\tthis.input.Add(new CommandBinding(input.GetButtonDown(Buttons.Start), canPause, togglePause));\n\t\t\tthis.input.Add(new CommandBinding(input.GetButtonDown(Buttons.B), () => this.currentMenu.Value != null || this.dialog != null, togglePause));\n\n\t\t\t// Gamepad menu code\n\n\t\t\tint selected = 0;\n\n\t\t\tFunc<UIComponent, int, int, int> nextMenuItem = delegate(UIComponent menu, int current, int delta)\n\t\t\t{\n\t\t\t\tint end = menu.Children.Count;\n\t\t\t\tint newValue = current + delta;\n\t\t\t\tif (newValue < 0)\n\t\t\t\t\treturn end - 1;\n\t\t\t\telse if (newValue > end - 1)\n\t\t\t\t\treturn 0;\n\t\t\t\telse\n\t\t\t\t\treturn newValue;\n\t\t\t};\n\n\t\t\tFunc<UIComponent, bool> isButton = delegate(UIComponent item)\n\t\t\t{\n\t\t\t\treturn item.Visible && item.GetType() == typeof(Container) && item.MouseLeftUp.Bindings.Count > 0;\n\t\t\t};\n\n\t\t\tFunc<UIComponent, bool> isScrollButton = delegate(UIComponent item)\n\t\t\t{\n\t\t\t\treturn item.Visible && item.GetType() == typeof(Container) && item.GetChildByName(\"<\") != null;\n\t\t\t};\n\n\t\t\tthis.input.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tUIComponent menu = this.currentMenu;\n\t\t\t\tif (menu != null && menu != creditsDisplay)\n\t\t\t\t{\n\t\t\t\t\tforeach (UIComponent item in menu.Children)\n\t\t\t\t\t\titem.Highlighted.Value = false;\n\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tforeach (UIComponent item in menu.Children)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (isButton(item) || isScrollButton(item))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (main.GamePadConnected)\n\t\t\t\t\t\t\t\titem.Highlighted.Value = true;\n\t\t\t\t\t\t\tselected = i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, this.currentMenu));\n\n\t\t\tconst float gamepadMoveInterval = 0.1f;\n\t\t\tconst float gamepadScrollMoveInterval = 0.2f;\n\t\t\tAction<int> moveSelection = delegate(int delta)\n\t\t\t{\n\t\t\t\tif (this.main.GameTime.TotalGameTime.TotalSeconds - this.lastGamepadMove > gamepadMoveInterval\n\t\t\t\t\t&& this.main.GameTime.TotalGameTime.TotalSeconds - this.lastGamepadScroll > gamepadScrollMoveInterval)\n\t\t\t\t{\n\t\t\t\t\tUIComponent menu = this.currentMenu;\n\t\t\t\t\tif (menu != null && menu.EnableInput && this.dialog == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (menu == creditsDisplay)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tScroller scroll = (Scroller)menu.Parent;\n\t\t\t\t\t\t\tscroll.MouseScrolled.Execute(delta * -4);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tContainer button;\n\t\t\t\t\t\tif (selected >= 0 && selected < menu.Children.Length)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbutton = (Container)menu.Children[selected];\n\t\t\t\t\t\t\tbutton.Highlighted.Value = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (menu.Children.Count > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint i = nextMenuItem(menu, selected, delta);\n\t\t\t\t\t\t\twhile (true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUIComponent item = menu.Children[i];\n\t\t\t\t\t\t\t\tif (isButton(item) || isScrollButton(item))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tselected = i;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ti = nextMenuItem(menu, i, delta);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.lastGamepadMove = (float)this.main.GameTime.TotalGameTime.TotalSeconds;\n\n\t\t\t\t\t\t\tif (selected >= 0 && selected < menu.Children.Count)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbutton = (Container)menu.Children[selected];\n\t\t\t\t\t\t\t\tbutton.Highlighted.Value = true;\n\n\t\t\t\t\t\t\t\tif (menu.Parent.Value.GetType() == typeof(Scroller))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tScroller scroll = (Scroller)menu.Parent;\n\t\t\t\t\t\t\t\t\tscroll.ScrollTo(button);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetButtonDown(Buttons.LeftThumbstickUp), delegate()\n\t\t\t{\n\t\t\t\tmoveSelection(-1);\n\t\t\t}));\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetButtonDown(Buttons.DPadUp), delegate()\n\t\t\t{\n\t\t\t\tmoveSelection(-1);\n\t\t\t}));\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetKeyDown(Keys.Up), delegate()\n\t\t\t{\n\t\t\t\tif (!ConsoleUI.Showing)\n\t\t\t\t\tmoveSelection(-1);\n\t\t\t}));\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetButtonDown(Buttons.LeftThumbstickDown), delegate()\n\t\t\t{\n\t\t\t\tmoveSelection(1);\n\t\t\t}));\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetButtonDown(Buttons.DPadDown), delegate()\n\t\t\t{\n\t\t\t\tmoveSelection(1);\n\t\t\t}));\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetKeyDown(Keys.Down), delegate()\n\t\t\t{\n\t\t\t\tif (!ConsoleUI.Showing)\n\t\t\t\t\tmoveSelection(1);\n\t\t\t}));\n\n\t\t\tAction clickSelection = delegate()\n\t\t\t{\n\t\t\t\tif (!ConsoleUI.Showing)\n\t\t\t\t{\n\t\t\t\t\tif (this.dialog != null)\n\t\t\t\t\t\tthis.dialog.GetChildByName(\"Okay\").MouseLeftUp.Execute();\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tUIComponent menu = this.currentMenu;\n\t\t\t\t\t\tif (menu != null && menu != creditsDisplay)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (selected >= 0 && selected < menu.Children.Count)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUIComponent selectedItem = menu.Children[selected];\n\t\t\t\t\t\t\t\tif (isScrollButton(selectedItem) && selectedItem.Highlighted)\n\t\t\t\t\t\t\t\t\tselectedItem.GetChildByName(\">\").MouseLeftUp.Execute();\n\t\t\t\t\t\t\t\telse if (isButton(selectedItem) && selectedItem.Highlighted)\n\t\t\t\t\t\t\t\t\tselectedItem.MouseLeftUp.Execute();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetButtonDown(Buttons.A), clickSelection));\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetKeyDown(Keys.Enter), clickSelection));\n\n\t\t\tAction<int> scrollButton = delegate(int delta)\n\t\t\t{\n\t\t\t\tif (this.main.GameTime.TotalGameTime.TotalSeconds - this.lastGamepadMove > gamepadScrollMoveInterval\n\t\t\t\t\t&& this.main.GameTime.TotalGameTime.TotalSeconds - this.lastGamepadScroll > gamepadMoveInterval)\n\t\t\t\t{\n\t\t\t\t\tUIComponent menu = this.currentMenu;\n\t\t\t\t\tif (menu != null && menu != creditsDisplay && this.dialog == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (selected >= 0 && selected < menu.Children.Count)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tUIComponent selectedItem = menu.Children[selected];\n\t\t\t\t\t\t\tif (isScrollButton(selectedItem) && selectedItem.Highlighted)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tselectedItem.GetChildByName(delta > 0 ? \">\" : \"<\").MouseLeftUp.Execute();\n\t\t\t\t\t\t\t\tthis.lastGamepadScroll = (float)this.main.GameTime.TotalGameTime.TotalSeconds;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetButtonDown(Buttons.LeftThumbstickLeft), delegate()\n\t\t\t{\n\t\t\t\tscrollButton(-1);\n\t\t\t}));\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetButtonDown(Buttons.DPadLeft), delegate()\n\t\t\t{\n\t\t\t\tscrollButton(-1);\n\t\t\t}));\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetKeyDown(Keys.Left), delegate()\n\t\t\t{\n\t\t\t\tif (!ConsoleUI.Showing)\n\t\t\t\t\tscrollButton(-1);\n\t\t\t}));\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetButtonDown(Buttons.LeftThumbstickRight), delegate()\n\t\t\t{\n\t\t\t\tscrollButton(1);\n\t\t\t}));\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetButtonDown(Buttons.DPadRight), delegate()\n\t\t\t{\n\t\t\t\tscrollButton(1);\n\t\t\t}));\n\n\t\t\tthis.input.Add(new CommandBinding(this.input.GetKeyDown(Keys.Right), delegate()\n\t\t\t{\n\t\t\t\tif (!ConsoleUI.Showing)\n\t\t\t\t\tscrollButton(1);\n\t\t\t}));\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.main.GamePadState.Value.IsConnected != this.main.LastGamePadState.Value.IsConnected)\n\t\t\t{\n\t\t\t\t// Re-bind inputs so their string representations are properly displayed\n\t\t\t\t// We need to show both PC and gamepad bindings\n\n\t\t\t\tforeach (Property<PCInput.PCInputBinding> binding in this.inputBindings)\n\t\t\t\t\tbinding.Reset();\n\t\t\t}\n\t\t}\n\n\t\tprivate void editMode()\n\t\t{\n\t\t\tthis.pauseMenu.Visible.Value = false;\n\t\t\tthis.currentMenu.Value = null;\n\t\t\tthis.main.Paused.Value = false;\n\t\t\tif (this.pauseAnimation != null)\n\t\t\t{\n\t\t\t\tthis.pauseAnimation.Delete.Execute();\n\t\t\t\tthis.pauseAnimation = null;\n\t\t\t}\n\t\t\tthis.main.EditorEnabled.Value = true;\n\t\t\tthis.main.CurrentSave.Value = null;\n\n\t\t\tif (this.main.Settings.GodModeProperty || Path.GetDirectoryName(this.main.MapFile) == this.main.CustomMapDirectory)\n\t\t\t\tIO.MapLoader.Load(this.main, this.main.MapFile);\n\t\t\telse\n\t\t\t\tIO.MapLoader.Load(this.main, null);\n\t\t}\n\n\t\tpublic void Show(bool initial = false)\n\t\t{\n\t\t\tif (!this.Showing)\n\t\t\t\tthis.savePausedSettings(initial);\n\t\t}\n\n\t\tpublic void Toggle()\n\t\t{\n\t\t\tif (this.Showing)\n\t\t\t{\n\t\t\t\tif (this.currentMenu.Value == this.pauseMenu)\n\t\t\t\t\tthis.restorePausedSettings();\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis.savePausedSettings();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Oculus.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma\n{\n#if VR\n\tpublic class Oculus\n\t{\n\t\tpublic static Matrix MatrixOvrToXna(Ovr.Matrix4f m)\n\t\t{\n\t\t\treturn new Matrix\n\t\t\t(\n\t\t\t\tm.m[0, 0],\n\t\t\t\tm.m[1, 0],\n\t\t\t\tm.m[2, 0],\n\t\t\t\tm.m[3, 0],\n\t\t\t\tm.m[0, 1],\n\t\t\t\tm.m[1, 1],\n\t\t\t\tm.m[2, 1],\n\t\t\t\tm.m[3, 1],\n\t\t\t\tm.m[0, 2],\n\t\t\t\tm.m[1, 2],\n\t\t\t\tm.m[2, 2],\n\t\t\t\tm.m[3, 2],\n\t\t\t\tm.m[0, 3],\n\t\t\t\tm.m[1, 3],\n\t\t\t\tm.m[2, 3],\n\t\t\t\tm.m[3, 3]\n\t\t\t);\n\t\t}\n\n\t\tpublic class DistortionMesh\n\t\t{\n\t\t\tprivate VertexBuffer vb;\n\t\t\tprivate IndexBuffer ib;\n\n\t\t\tprivate Vector2 uvScale;\n\t\t\tprivate Vector2 uvOffset;\n\n\t\t\tprivate Ovr.Eye eye;\n\t\t\tprivate Ovr.FovPort fov;\n\t\t\tprivate Main main;\n\n\t\t\tpublic void Reload()\n\t\t\t{\n\t\t\t\tOvr.DistortionMesh meshData = this.main.VRHmd.CreateDistortionMesh(this.eye, this.fov, this.main.VRHmd.GetDesc().DistortionCaps).Value;\n\t\t\t\tPoint textureSize = this.main.ScreenSize;\n\t\t\t\tOvr.Vector2f[] scaleAndOffset = this.main.VRHmd.GetRenderScaleAndOffset(this.fov, new Ovr.Sizei(textureSize.X, textureSize.Y), new Ovr.Recti { Size = { w = textureSize.X, h = textureSize.Y } });\n\t\t\t\tthis.uvScale = new Vector2(scaleAndOffset[0].x, scaleAndOffset[0].y);\n\t\t\t\tthis.uvOffset = new Vector2(scaleAndOffset[1].x, scaleAndOffset[1].y);\n\t\t\t\tVertex[] vertices = new Vertex[meshData.VertexCount];\n\t\t\t\tfor (int i = 0; i < meshData.VertexCount; i++)\n\t\t\t\t{\n\t\t\t\t\tOvr.DistortionVertex v = meshData.pVertexData[i];\n\t\t\t\t\tvertices[i].ScreenPosNDC = new Vector2(v.ScreenPosNDC.x, v.ScreenPosNDC.y);\n\t\t\t\t\tvertices[i].TimeWarpFactor = v.TimeWarpFactor;\n\t\t\t\t\tvertices[i].VignetteFactor = v.VignetteFactor;\n\t\t\t\t\tvertices[i].TanEyeAnglesR = new Vector2(v.TanEyeAnglesR.x, v.TanEyeAnglesR.y);\n\t\t\t\t\tvertices[i].TanEyeAnglesG = new Vector2(v.TanEyeAnglesG.x, v.TanEyeAnglesG.y);\n\t\t\t\t\tvertices[i].TanEyeAnglesB = new Vector2(v.TanEyeAnglesB.x, v.TanEyeAnglesB.y);\n\t\t\t\t}\n\n\t\t\t\tthis.vb = new VertexBuffer(this.main.GraphicsDevice, typeof(Vertex), (int)meshData.VertexCount, BufferUsage.WriteOnly);\n\t\t\t\tthis.vb.SetData<Vertex>(vertices);\n\n\t\t\t\tthis.ib = new IndexBuffer(this.main.GraphicsDevice, IndexElementSize.SixteenBits, (int)meshData.IndexCount, BufferUsage.WriteOnly);\n\t\t\t\tthis.ib.SetData<short>(meshData.pIndexData);\n\t\t\t}\n\n\t\t\tpublic void Load(Main m, Ovr.Eye eyeType, Ovr.FovPort fov)\n\t\t\t{\n\t\t\t\tthis.main = m;\n\t\t\t\tthis.fov = fov;\n\t\t\t\tthis.eye = eyeType;\n\t\t\t\tthis.Reload();\n\t\t\t}\n\n\t\t\tpublic void Render(RenderTarget2D frameBuffer, Ovr.Posef eyePose, Effect effect)\n\t\t\t{\n\t\t\t\teffect.Parameters[\"EyeToSourceUVScale\"].SetValue(this.uvScale);\n\t\t\t\teffect.Parameters[\"EyeToSourceUVOffset\"].SetValue(this.uvOffset);\n\t\t\t\tOvr.Matrix4f[] timeWarpMatrices = this.main.VRHmd.GetEyeTimewarpMatrices(this.eye, eyePose);\n\t\t\t\teffect.Parameters[\"EyeRotationStart\"].SetValue(Oculus.MatrixOvrToXna(timeWarpMatrices[0]));\n\t\t\t\teffect.Parameters[\"EyeRotationEnd\"].SetValue(Oculus.MatrixOvrToXna(timeWarpMatrices[1]));\n\t\t\t\teffect.Parameters[\"FrameBuffer\" + Lemma.Components.Model.SamplerPostfix].SetValue(frameBuffer);\n\t\t\t\teffect.CurrentTechnique.Passes[0].Apply();\n\n\t\t\t\tthis.main.GraphicsDevice.SetVertexBuffer(this.vb);\n\t\t\t\tthis.main.GraphicsDevice.Indices = this.ib;\n\n\t\t\t\t// Draw primitives\n\t\t\t\tthis.main.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, this.vb.VertexCount, 0, this.ib.IndexCount / 3);\n\t\t\t\tLemma.Components.Model.DrawCallCounter++;\n\t\t\t\tLemma.Components.Model.TriangleCounter += this.ib.IndexCount / 3;\n\t\t\t}\n\n\t\t\tpublic struct Vertex : IVertexType\n\t\t\t{\n\t\t\t\tpublic Vector2 ScreenPosNDC; // [-1,+1],[-1,+1] over the entire framebuffer.\n\t\t\t\tpublic float TimeWarpFactor; // Lerp factor between time-warp matrices. Can be encoded in Pos.z.\n\t\t\t\tpublic float VignetteFactor; // Vignette fade factor. Can be encoded in Pos.w.\n\t\t\t\tpublic Vector2 TanEyeAnglesR;\n\t\t\t\tpublic Vector2 TanEyeAnglesG;\n\t\t\t\tpublic Vector2 TanEyeAnglesB;\n\t\t\t\tpublic readonly static VertexDeclaration Declaration = new VertexDeclaration\n\t\t\t\t(\n\t\t\t\t\tnew VertexElement(0, VertexElementFormat.Vector2, VertexElementUsage.Position, 0),\n\t\t\t\t\tnew VertexElement(8, VertexElementFormat.Single, VertexElementUsage.Position, 1),\n\t\t\t\t\tnew VertexElement(12, VertexElementFormat.Single, VertexElementUsage.Position, 2),\n\t\t\t\t\tnew VertexElement(16, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0),\n\t\t\t\t\tnew VertexElement(24, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 1),\n\t\t\t\t\tnew VertexElement(32, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 2)\n\t\t\t\t);\n\n\t\t\t\tpublic VertexDeclaration VertexDeclaration\n\t\t\t\t{\n\t\t\t\t\tget\n\t\t\t\t\t{\n\t\t\t\t\t\treturn Vertex.Declaration;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n#endif\n}\n"
  },
  {
    "path": "Lemma/OvrCapi.cs",
    "content": "/************************************************************************************\n\nCopyright   :   Copyright 2014 Oculus VR, LLC. All Rights reserved.\n\nLicensed under the Oculus VR Rift SDK License Version 3.2 (the \"License\");\nyou may not use the Oculus VR Rift SDK except in compliance with the License,\nwhich is provided at the time of installation or download, or which\notherwise accompanies this software in either electronic or hard copy form.\n\nYou may obtain a copy of the License at\n\nhttp://www.oculusvr.com/licenses/LICENSE-3.2\n\nUnless required by applicable law or agreed to in writing, the Oculus VR SDK\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n************************************************************************************/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\n\nnamespace Ovr\n{\n    /// <summary>\n    /// A 2D vector with integer components.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct Vector2i\n    {\n        [FieldOffset(0)] public Int32 x;\n        [FieldOffset(4)] public Int32 y;\n\n        public Vector2i(Int32 _x, Int32 _y)\n        {\n            x = _x;\n            y = _y;\n        }\n    };\n\n    /// <summary>\n    /// A 2D size with integer components.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct Sizei\n    {\n        [FieldOffset(0)] public Int32 w;\n        [FieldOffset(4)] public Int32 h;\n\n        public Sizei(Int32 _w, Int32 _h)\n        {\n            w = _w;\n            h = _h;\n        }\n    };\n\n    /// <summary>\n    /// A 2D rectangle with a position and size.\n    /// All components are integers.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct Recti\n    {\n        [FieldOffset(0)] public Vector2i Pos;\n        [FieldOffset(8)] public Sizei Size;\n    };\n\n    /// <summary>\n    /// A quaternion rotation.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct Quatf\n    {\n        [FieldOffset(0)] public float x;\n        [FieldOffset(4)] public float y;\n        [FieldOffset(8)] public float z;\n        [FieldOffset(12)] public float w;\n\n        public Quatf(float _x, float _y, float _z, float _w)\n        {\n            x = _x;\n            y = _y;\n            z = _z;\n            w = _w;\n        }\n    };\n\n    /// <summary>\n    /// A 2D vector with float components.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct Vector2f\n    {\n        [FieldOffset(0)] public float x;\n        [FieldOffset(4)] public float y;\n\n        public Vector2f(float _x, float _y)\n        {\n            x = _x;\n            y = _y;\n        }\n    };\n\n    /// <summary>\n    /// A 3D vector with float components.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct Vector3f\n    {\n        [FieldOffset(0)] public float x;\n        [FieldOffset(4)] public float y;\n        [FieldOffset(8)] public float z;\n\n        public Vector3f(float _x, float _y, float _z)\n        {\n            x = _x;\n            y = _y;\n            z = _z;\n        }\n    };\n\n    /// <summary>\n    /// A 4x4 matrix with float elements.\n    /// </summary>\n    [StructLayout(LayoutKind.Sequential)]\n    public struct Matrix4f\n    {\n        public float[,] m;\n\n        internal Matrix4f(Matrix4f_Raw raw)\n        {\n            this.m = new float[,] {\n                { raw.m00, raw.m01, raw.m02, raw.m03 },\n                { raw.m10, raw.m11, raw.m12, raw.m13 },\n                { raw.m20, raw.m21, raw.m22, raw.m23 },\n                { raw.m30, raw.m31, raw.m32, raw.m33 } };\n        }\n    };\n\n    [StructLayout(LayoutKind.Explicit)]\n    internal struct Matrix4f_Raw\n    {\n        [FieldOffset(0)] public float m00;\n        [FieldOffset(4)] public float m01;\n        [FieldOffset(8)] public float m02;\n        [FieldOffset(12)] public float m03;\n\n        [FieldOffset(16)] public float m10;\n        [FieldOffset(20)] public float m11;\n        [FieldOffset(24)] public float m12;\n        [FieldOffset(28)] public float m13;\n\n        [FieldOffset(32)] public float m20;\n        [FieldOffset(36)] public float m21;\n        [FieldOffset(40)] public float m22;\n        [FieldOffset(44)] public float m23;\n\n        [FieldOffset(48)] public float m30;\n        [FieldOffset(52)] public float m31;\n        [FieldOffset(56)] public float m32;\n        [FieldOffset(60)] public float m33;\n    };\n\n    /// <summary>\n    /// Position and orientation together.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct Posef\n    {\n        [FieldOffset(0)] public Quatf Orientation;\n        [FieldOffset(16)] public Vector3f Position;\n\n        public Posef(Quatf q, Vector3f p)\n        {\n            Orientation = q;\n            Position = p;\n        }\n    };\n\n    /// <summary>\n    /// A full pose (rigid body) configuration with first and second derivatives.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct PoseStatef\n    {\n        /// <summary>\n        /// The body's position and orientation.\n        /// </summary>\n        [FieldOffset(0)] public Posef ThePose;\n        /// <summary>\n        /// The body's angular velocity in radians per second.\n        /// </summary>\n        [FieldOffset(28)] public Vector3f AngularVelocity;\n        /// <summary>\n        /// The body's velocity in meters per second.\n        /// </summary>\n        [FieldOffset(40)] public Vector3f LinearVelocity;\n        /// <summary>\n        /// The body's angular acceleration in radians per second per second.\n        /// </summary>\n        [FieldOffset(52)] public Vector3f AngularAcceleration;\n        /// <summary>\n        /// The body's acceleration in meters per second per second.\n        /// </summary>\n        [FieldOffset(64)] public Vector3f LinearAcceleration;\n        [FieldOffset(76)] private UInt32 pad0;\n        /// <summary>\n        /// Absolute time of this state sample.\n        /// </summary>\n        [FieldOffset(80)] public double TimeInSeconds;\n    };\n\n    public enum InitFlags\n    {\n        /// <summary>\n        // When a debug library is requested, a slower debugging version of the library will\n        // be run which can be used to help solve problems in the library and debug game code.\n        /// </summary>\n        Debug          = 0x00000001,\n\n        /// <summary>\n        // When ServerOptional is set, the ovr_Initialize() call not will block waiting for\n        // the server to respond.  If the server is not reachable it may still succeed.\n        /// </summary>\n        ServerOptional = 0x00000002,\n\n        /// <summary>\n        // When a version is requested, LibOVR runtime will respect the RequestedMinorVersion\n        // field and will verify that the RequestedMinorVersion is supported.\n        /// </summary>\n        RequestVersion = 0x00000004,\n\n        /// <summary>\n        // Forces debug features of LibOVR off explicitly, even if it is built in debug mode.\n        /// </summary>\n        ForceNoDebug   = 0x00000008,\n    }\n\n    /// <summary>\n    /// Logging levels\n    /// </summary>\n    public enum LogLevel\n    {\n        Debug = 0,\n        Info  = 1,\n        Error = 2,\n    }\n\n    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]\n    public delegate void CAPICallback(int level, string message);\n\n    /// <summary>\n    /// Configuration settings passed to the Initialize function\n    /// </summary>\n    [StructLayout(LayoutKind.Sequential, Pack = 1)]\n    public class InitParams\n    {\n        /// <summary>\n        /// Flags from ovrExFlags to override default behavior.\n        /// Pass 0 for the defaults.\n        /// </summary>\n        public UInt32 Flags;               // Combination of ovrExFlags or 0\n\n        /// <summary>\n        /// Request a specific version.\n        /// This must be set to OVR_MINOR_VERSION.\n        /// </summary>\n        public UInt32 RequestedMinorVersion;\n\n        /// <summary>\n        /// Log callback function, which may be called at any time asynchronously from\n        /// multiple threads until ovr_Shutdown() completes.\n        /// Pass 0 for no log callback.\n        /// </summary>\n        public CAPICallback LogCallback;         // Function pointer or 0\n\n        /// <summary>\n        /// Number of milliseconds to wait for a connection to the server.\n        /// Pass 0 for the default timeout.\n        /// </summary>\n        public UInt32 ConnectionTimeoutMS; // Timeout in Milliseconds or 0\n\n        // This technically pads too far in 32-bit mode, but providing too large a buffer is okay.\n        private UInt32 pad0;\n    }\n\n    /// <summary>\n    /// Field Of View (FOV) in tangent of the angle units.\n    /// As an example, for a standard 90 degree vertical FOV, we would\n    /// have: { UpTan = tan(90 degrees / 2), DownTan = tan(90 degrees / 2) }.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct FovPort\n    {\n        /// <summary>\n        /// The tangent of the angle between the viewing vector and the top edge of the field of view.\n        /// </summary>\n        [FieldOffset(0)] public float UpTan;\n        /// <summary>\n        /// The tangent of the angle between the viewing vector and the bottom edge of the field of view.\n        /// </summary>\n        [FieldOffset(4)] public float DownTan;\n        /// <summary>\n        /// The tangent of the angle between the viewing vector and the left edge of the field of view.\n        /// </summary>\n        [FieldOffset(8)] public float LeftTan;\n        /// <summary>\n        /// The tangent of the angle between the viewing vector and the right edge of the field of view.\n        /// </summary>\n        [FieldOffset(12)] public float RightTan;\n    };\n\n    //-----------------------------------------------------------------------------------\n    // ***** HMD Types\n\n    /// <summary>\n    /// Enumerates all HMD types that we support.\n    /// </summary>\n    public enum HmdType\n    {\n        None      = 0,\n        DK1       = 3,\n        DKHD      = 4,\n        DK2       = 6,\n        BlackStar = 7,\n        CB        = 8,\n        Other // Some HMD other than the ones in this enumeration.\n    };\n\n    /// <summary>\n    /// HMD capability bits reported by device.\n    /// </summary>\n    public enum HmdCaps\n    {\n        /// <summary>\n        /// (read only) The HMD is plugged in and detected by the system.\n        /// </summary>\n        Present           = 0x0001,\n        /// <summary>\n        /// (read only) The HMD and its sensor are available for ownership use.\n        /// i.e. it is not already owned by another application.\n        /// </summary>\n        Available         = 0x0002,\n        /// <summary>\n        /// (read only) Set to 'true' if we captured ownership of this HMD.\n        /// </summary>\n        Captured          = 0x0004,\n        /// <summary>\n        /// (read only) Means the display driver is in compatibility mode.\n        /// </summary>\n        ExtendDesktop     = 0x0008,\n        /// <summary>\n        /// (read only) Means HMD device is a virtual debug device.\n        /// </summary>\n        DebugDevice       = 0x0010,\n\n        // Modifiable flags (through ovrHmd_SetEnabledCaps).\n\n        /// <summary>\n        /// Disables mirroring of HMD output to the window. This may improve\n        /// rendering performance slightly (only if 'ExtendDesktop' is off).\n        /// </summary>\n        NoMirrorToWindow  = 0x2000,\n        /// <summary>\n        /// Turns off HMD screen and output (only if 'ExtendDesktop' is off).\n        /// </summary>\n        DisplayOff        = 0x0040,\n        /// <summary>\n        /// HMD supports low persistence mode.\n        /// </summary>\n        LowPersistence    = 0x0080,\n        /// <summary>\n        /// Adjust prediction dynamically based on internally measured latency.\n        /// </summary>\n        DynamicPrediction = 0x0200,\n        /// <summary>\n        /// Support rendering without VSync for debugging.\n        /// </summary>\n        NoVSync           = 0x1000,\n\n        /// <summary>\n        /// These bits can be modified by ovrHmd_SetEnabledCaps.\n        /// </summary>\n        WritableMask      = NoMirrorToWindow\n                            | DisplayOff\n                            | LowPersistence\n                            | DynamicPrediction\n                            | NoVSync,\n\n        /// <summary>\n        /// These flags are currently passed into the service. May change without notice.\n        /// </summary>\n        ServiceMask       = NoMirrorToWindow\n                            | DisplayOff\n                            | LowPersistence\n                            | DynamicPrediction,\n    };\n\n    /// <summary>\n    /// Tracking capability bits reported by the device.\n    /// Used with ovrHmd_ConfigureTracking.\n    /// </summary>\n    public enum TrackingCaps\n    {\n        /// <summary>\n        /// Supports orientation tracking (IMU).\n        /// </summary>\n        Orientation       = 0x0010,\n        /// <summary>\n        /// Supports yaw drift correction via a magnetometer or other means.\n        /// </summary>\n        MagYawCorrection  = 0x0020,\n        /// <summary>\n        /// Supports positional tracking.\n        /// </summary>\n        Position          = 0x0040,\n        /// <summary>\n        /// Overrides the other flags. Indicates that the application\n        /// doesn't care about tracking settings. This is the internal\n        /// default before ovrHmd_ConfigureTracking is called.\n        /// </summary>\n        Idle              = 0x0100,\n    };\n\n    /// <summary>\n    /// Distortion capability bits reported by device.\n    /// Used with ovrHmd_ConfigureRendering and ovrHmd_CreateDistortionMesh.\n    /// </summary>\n    public enum DistortionCaps\n    {\n        /// <summary>\n        /// Supports chromatic aberration correction.\n        /// </summary>\n        Chromatic = 0x01,\n        /// <summary>\n        /// Supports timewarp.\n        /// </summary>\n        TimeWarp = 0x02,\n\n        // 0x04 unused\n\n        /// <summary>\n        /// Supports vignetting around the edges of the view.\n        /// </summary>\n        Vignette = 0x08,\n        /// <summary>\n        /// Do not save and restore the graphics state when rendering distortion.\n        /// </summary>\n        NoRestore = 0x10,\n        /// <summary>\n        /// Flip the vertical texture coordinate of input images.\n        /// </summary>\n        FlipInput = 0x20,\n        /// <summary>\n        /// Assume input images are in sRGB gamma-corrected color space.\n        /// </summary>\n        SRGB = 0x40,\n        /// <summary>\n        /// Overdrive brightness transitions to reduce artifacts on DK2+ displays\n        /// </summary>\n        Overdrive = 0x80,\n        /// <summary>\n        /// High-quality sampling of distortion buffer for anti-aliasing\n        /// </summary>\n        HqDistortion = 0x100,\n        /// </summary>\n        /// Indicates window is fullscreen on a device when set.\n        /// The SDK will automatically apply distortion mesh rotation if needed.\n        /// </summary>\n        LinuxDevFullscreen = 0x200,\n        /// <summary>\n        /// Using compute shader (DX11+ only)\n        /// </summary>\n        ComputeShader = 0x400,\n        /// <summary>\n        /// Use when profiling with timewarp to remove false positives\n        /// </summary>\n        ProfileNoTimewarpSpinWaits = 0x10000,\n    };\n\n    /// <summary>\n    /// Specifies which eye is being used for rendering.\n    /// This type explicitly does not include a third \"NoStereo\" option, as such is\n    /// not required for an HMD-centered API.\n    /// </summary>\n    public enum Eye\n    {\n        Left  = 0,\n        Right = 1,\n        Count = 2,\n    };\n\n    /// <summary>\n    /// This is a complete descriptor of the HMD.\n    /// </summary>\n    public struct HmdDesc\n    {\n        /// <summary>\n        /// Internal handle of this HMD.\n        /// </summary>\n        public IntPtr Handle;\n\n        /// <summary>\n        /// This HMD's type.\n        /// </summary>\n        public HmdType Type;\n\n        /// <summary>\n        /// Name string describing the product: \"Oculus Rift DK1\", etc.\n        /// </summary>\n        public string ProductName;\n        public string Manufacturer;\n\n        /// <summary>\n        /// HID Vendor and ProductId of the device.\n        /// </summary>\n        public short VendorId;\n        public short ProductId;\n        /// <summary>\n        /// Sensor (and display) serial number.\n        /// </summary>\n        public string SerialNumber;\n        /// <summary>\n        /// Sensor firmware version.\n        /// </summary>\n        public short FirmwareMajor;\n        public short FirmwareMinor;\n        /// <summary>\n        /// External tracking camera frustum dimensions (if present).\n        /// </summary>\n        public float CameraFrustumHFovInRadians;\n        public float CameraFrustumVFovInRadians;\n        public float CameraFrustumNearZInMeters;\n        public float CameraFrustumFarZInMeters;\n\n        /// <summary>\n        /// Capability bits described by ovrHmdCaps.\n        /// </summary>\n        public uint HmdCaps;\n        /// <summary>\n        /// Capability bits described by ovrTrackingCaps.\n        /// </summary>\n        public uint TrackingCaps;\n        /// <summary>\n        /// Capability bits described by ovrDistortionCaps.\n        /// </summary>\n        public uint DistortionCaps;\n\n        /// <summary>\n        /// Defines the recommended optical FOV for the HMD.\n        /// </summary>\n        public FovPort[] DefaultEyeFov;\n        /// <summary>\n        /// Defines the maximum optical FOV for the HMD.\n        /// </summary>\n        public FovPort[] MaxEyeFov;\n\n        /// <summary>\n        /// Preferred eye rendering order for best performance.\n        /// Can help reduce latency on sideways-scanned screens.\n        /// </summary>\n        public Eye[] EyeRenderOrder;\n\n        /// <summary>\n        /// Resolution of the full HMD screen (both eyes) in pixels.\n        /// </summary>\n        public Sizei Resolution;\n        /// <summary>\n        /// Location of the application window on the desktop (or 0,0).\n        /// </summary>\n        public Vector2i WindowsPos;\n\n        /// <summary>\n        /// Display that the HMD should present on.\n        /// TBD: It may be good to remove this information relying on WindowPos instead.\n        /// Ultimately, we may need to come up with a more convenient alternative,\n        /// such as API-specific functions that return adapter, or something that will\n        /// work with our monitor driver.\n        /// Windows: (e.g. \"\\\\\\\\.\\\\DISPLAY3\", can be used in EnumDisplaySettings/CreateDC).\n        /// </summary>\n        public string DisplayDeviceName;\n        /// <summary>\n        /// MacOS:\n        /// </summary>\n        public int DisplayId;\n\n        internal HmdDesc(HmdDesc_Raw32 raw)\n        {\n            this.Handle                     = raw.Handle;\n            this.Type                       = (HmdType)raw.Type;\n            this.ProductName                = Marshal.PtrToStringAnsi(raw.ProductName);\n            this.Manufacturer               = Marshal.PtrToStringAnsi(raw.Manufacturer);\n            this.VendorId                   = (short)raw.VendorId;\n            this.ProductId                  = (short)raw.ProductId;\n            this.SerialNumber               = raw.SerialNumber;\n            this.FirmwareMajor              = (short)raw.FirmwareMajor;\n            this.FirmwareMinor              = (short)raw.FirmwareMinor;\n            this.CameraFrustumHFovInRadians = raw.CameraFrustumHFovInRadians;\n            this.CameraFrustumVFovInRadians = raw.CameraFrustumVFovInRadians;\n            this.CameraFrustumNearZInMeters = raw.CameraFrustumNearZInMeters;\n            this.CameraFrustumFarZInMeters  = raw.CameraFrustumFarZInMeters;\n            this.HmdCaps                    = raw.HmdCaps;\n            this.TrackingCaps               = raw.TrackingCaps;\n            this.DistortionCaps             = raw.DistortionCaps;\n            this.Resolution                 = raw.Resolution;\n            this.WindowsPos                 = raw.WindowsPos;\n            this.DefaultEyeFov              = new FovPort[2] { raw.DefaultEyeFov_0, raw.DefaultEyeFov_1 };\n            this.MaxEyeFov                  = new FovPort[2] { raw.MaxEyeFov_0, raw.MaxEyeFov_1 };\n            this.EyeRenderOrder             = new Eye[2] { Eye.Left, Eye.Right };\n            this.DisplayDeviceName          = Marshal.PtrToStringAnsi(raw.DisplayDeviceName);\n            this.DisplayId                  = raw.DisplayId;\n        }\n        internal HmdDesc(HmdDesc_Raw64 raw)\n        {\n            this.Handle                     = raw.Handle;\n            this.Type                       = (HmdType)raw.Type;\n            this.ProductName                = Marshal.PtrToStringAnsi(raw.ProductName);\n            this.Manufacturer               = Marshal.PtrToStringAnsi(raw.Manufacturer);\n            this.VendorId                   = (short)raw.VendorId;\n            this.ProductId                  = (short)raw.ProductId;\n            this.SerialNumber               = raw.SerialNumber;\n            this.FirmwareMajor              = (short)raw.FirmwareMajor;\n            this.FirmwareMinor              = (short)raw.FirmwareMinor;\n            this.CameraFrustumHFovInRadians = raw.CameraFrustumHFovInRadians;\n            this.CameraFrustumVFovInRadians = raw.CameraFrustumVFovInRadians;\n            this.CameraFrustumNearZInMeters = raw.CameraFrustumNearZInMeters;\n            this.CameraFrustumFarZInMeters  = raw.CameraFrustumFarZInMeters;\n            this.HmdCaps                    = raw.HmdCaps;\n            this.TrackingCaps               = raw.TrackingCaps;\n            this.DistortionCaps             = raw.DistortionCaps;\n            this.Resolution                 = raw.Resolution;\n            this.WindowsPos                 = raw.WindowsPos;\n            this.DefaultEyeFov              = new FovPort[2] { raw.DefaultEyeFov_0, raw.DefaultEyeFov_1 };\n            this.MaxEyeFov                  = new FovPort[2] { raw.MaxEyeFov_0, raw.MaxEyeFov_1 };\n            this.EyeRenderOrder             = new Eye[2] { Eye.Left, Eye.Right };\n            this.DisplayDeviceName          = Marshal.PtrToStringAnsi(raw.DisplayDeviceName);\n            this.DisplayId                  = raw.DisplayId;\n        }\n    };\n\n    // Internal description for HMD; must match C 'ovrHmdDesc' layout.\n    [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]\n    internal struct HmdDesc_Raw32\n    {\n        public IntPtr Handle;\n        public UInt32 Type;\n        // Use IntPtr so that CLR doesn't try to deallocate string.\n        public IntPtr ProductName;\n        public IntPtr Manufacturer;\n        // HID Vendor and ProductId of the device.\n        public UInt16 VendorId;\n        public UInt16 ProductId;\n        // Sensor (and display) serial number.\n        [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 24)]\n        public string SerialNumber;\n        // Sensor firmware\n        public UInt16 FirmwareMajor;\n        public UInt16 FirmwareMinor;\n        // Fixed camera frustum dimensions, if present\n        public float CameraFrustumHFovInRadians;\n        public float CameraFrustumVFovInRadians;\n        public float CameraFrustumNearZInMeters;\n        public float CameraFrustumFarZInMeters;\n        public UInt32 HmdCaps;\n        public UInt32 TrackingCaps;\n        public UInt32 DistortionCaps;\n        // C# arrays are dynamic and thus not supported as return values, so just expand the struct.\n        public FovPort DefaultEyeFov_0;\n        public FovPort DefaultEyeFov_1;\n        public FovPort MaxEyeFov_0;\n        public FovPort MaxEyeFov_1;\n        public UInt32 EyeRenderOrder_0;\n        public UInt32 EyeRenderOrder_1;\n        public Sizei Resolution;\n        public Vector2i WindowsPos;\n        public IntPtr DisplayDeviceName;\n        public Int32 DisplayId;\n    };\n\n    // Internal description for HMD; must match C 'ovrHmdDesc' layout.\n    [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]\n    internal struct HmdDesc_Raw64\n    {\n        public IntPtr Handle;\n        public UInt32 Type;\n        private UInt32 pad0;\n        // Use IntPtr so that CLR doesn't try to deallocate string.\n        public IntPtr ProductName;\n        public IntPtr Manufacturer;\n        // HID Vendor and ProductId of the device.\n        public UInt16 VendorId;\n        public UInt16 ProductId;\n        // Sensor (and display) serial number.\n        [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 24)]\n        public string SerialNumber;\n        // Sensor firmware\n        public UInt16 FirmwareMajor;\n        public UInt16 FirmwareMinor;\n        // Fixed camera frustum dimensions, if present\n        public float CameraFrustumHFovInRadians;\n        public float CameraFrustumVFovInRadians;\n        public float CameraFrustumNearZInMeters;\n        public float CameraFrustumFarZInMeters;\n        public UInt32 HmdCaps;\n        public UInt32 TrackingCaps;\n        public UInt32 DistortionCaps;\n        // C# arrays are dynamic and thus not supported as return values, so just expand the struct.\n        public FovPort DefaultEyeFov_0;\n        public FovPort DefaultEyeFov_1;\n        public FovPort MaxEyeFov_0;\n        public FovPort MaxEyeFov_1;\n        public UInt32 EyeRenderOrder_0;\n        public UInt32 EyeRenderOrder_1;\n        public Sizei Resolution;\n        public Vector2i WindowsPos;\n        private UInt32 pad1;\n        public IntPtr DisplayDeviceName;\n        public Int32 DisplayId;\n        private UInt32 pad2;\n    };\n\n    /// <summary>\n    /// Bit flags describing the current status of sensor tracking.\n    /// The values must be the same as in enum StatusBits.\n    /// </summary>\n    public enum StatusBits\n    {\n        /// <summary>\n        /// Orientation is currently tracked (connected and in use).\n        /// </summary>\n        OrientationTracked    = 0x0001,\n        /// <summary>\n        /// Position is currently tracked (false if out of range).\n        /// </summary>\n        PositionTracked       = 0x0002,\n        /// <summary>\n        /// Camera pose is currently tracked.\n        /// </summary>\n        CameraPoseTracked     = 0x0004,\n        /// <summary>\n        /// Position tracking hardware is connected.\n        /// </summary>\n        PositionConnected     = 0x0020,\n        /// <summary>\n        /// HMD Display is available and connected.\n        /// </summary>\n        HmdConnected          = 0x0080,\n    };\n\n    /// <summary>\n    /// Specifies a reading we can query from the sensor.\n    /// </summary>\n    public struct SensorData\n    {\n        /// <summary>\n        /// Acceleration reading in m/s^2.\n        /// </summary>\n        public Vector3f Accelerometer;\n        /// <summary>\n        /// Rotation rate in rad/s.\n        /// </summary>\n        public Vector3f Gyro;\n        /// <summary>\n        /// Magnetic field in Gauss.\n        /// </summary>\n        public Vector3f Magnetometer;\n        /// <summary>\n        /// Temperature of the sensor in degrees Celsius.\n        /// </summary>\n        public float Temperature;\n        /// <summary>\n        /// Time when the reported IMU reading took place, in seconds.\n        /// </summary>\n        public float TimeInSeconds;\n    };\n\n    /// <summary>\n    /// Tracking state at a given absolute time (describes predicted HMD pose etc).\n    /// Returned by ovrHmd_GetTrackingState.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct TrackingState\n    {\n        /// <summary>\n        /// Predicted head pose (and derivatives) at the requested absolute time.\n        /// The look-ahead interval is equal to (HeadPose.TimeInSeconds - RawSensorData.TimeInSeconds).\n        /// </summary>\n        [FieldOffset(0)] public PoseStatef HeadPose;\n\n        /// <summary>\n        /// Current pose of the external camera (if present).\n        /// This pose includes camera tilt (roll and pitch). For a leveled coordinate\n        /// system use LeveledCameraPose.\n        /// </summary>\n        [FieldOffset(88)] public Posef CameraPose;\n\n        /// <summary>\n        /// Camera frame aligned with gravity.\n        /// This value includes position and yaw of the camera, but not roll and pitch.\n        /// It can be used as a reference point to render real-world objects in the correct location.\n        /// </summary>\n        [FieldOffset(116)] public Posef LeveledCameraPose;\n\n        /// <summary>\n        /// The most recent sensor data received from the HMD.\n        /// </summary>\n        [FieldOffset(144)] public SensorData RawSensorData;\n\n        /// <summary>\n        /// Tracking status described by ovrStatusBits.\n        /// </summary>\n        [FieldOffset(188)] public UInt32 StatusFlags;\n\n        /// <summary>\n        /// Tag the vision processing results to a certain frame counter number.\n        /// </summary>\n        [FieldOffset(192)] public UInt32 LastCameraFrameCounter;\n\n        [FieldOffset(196)] private UInt32 pad0;\n    };\n\n    /// <summary>\n    /// Frame timing data reported by ovrHmd_BeginFrameTiming() or ovrHmd_BeginFrame().\n    /// </summary>\n    [StructLayout(LayoutKind.Sequential)]\n    public struct FrameTiming\n    {\n        /// <summary>\n        /// The amount of time that has passed since the previous frame's\n        /// ThisFrameSeconds value (usable for movement scaling).\n        /// This will be clamped to no more than 0.1 seconds to prevent\n        /// excessive movement after pauses due to loading or initialization.\n        /// </summary>\n        public float DeltaSeconds;\n\n        // It is generally expected that the following holds:\n        // ThisFrameSeconds < TimewarpPointSeconds < NextFrameSeconds <\n        // EyeScanoutSeconds[EyeOrder[0]] <= ScanoutMidpointSeconds <= EyeScanoutSeconds[EyeOrder[1]].\n\n        /// <summary>\n        /// Absolute time value when rendering of this frame began or is expected to\n        /// begin. Generally equal to NextFrameSeconds of the previous frame. Can be used\n        /// for animation timing.\n        /// </summary>\n        public double ThisFrameSeconds;\n        /// <summary>\n        /// Absolute point when IMU expects to be sampled for this frame.\n        /// </summary>\n        public double TimewarpPointSeconds;\n        /// <summary>\n        /// Absolute time when frame Present followed by GPU Flush will finish and the next frame begins.\n        /// </summary>\n        public double NextFrameSeconds;\n\n        /// <summary>\n        /// Time when half of the screen will be scanned out. Can be passed as an absolute time\n        /// to ovrHmd_GetTrackingState() to get the predicted general orientation.\n        /// </summary>\n        public double ScanoutMidpointSeconds;\n        /// <summary>\n        /// Timing points when each eye will be scanned out to display. Used when rendering each eye.\n        /// </summary>\n        public double[] EyeScanoutSeconds;\n\n        internal FrameTiming(FrameTiming_Raw raw)\n        {\n            this.DeltaSeconds           = raw.DeltaSeconds;\n            this.ThisFrameSeconds       = raw.ThisFrameSeconds;\n            this.TimewarpPointSeconds   = raw.TimewarpPointSeconds;\n            this.NextFrameSeconds       = raw.NextFrameSeconds;\n            this.ScanoutMidpointSeconds = raw.ScanoutMidpointSeconds;\n            this.EyeScanoutSeconds      = new double[2] { raw.EyeScanoutSeconds_0, raw.EyeScanoutSeconds_1 };\n        }\n    };\n\n    // Internal description for ovrFrameTiming; must match C 'ovrFrameTiming' layout.\n    [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Ansi)]\n    internal struct FrameTiming_Raw\n    {\n        [FieldOffset(0)] public float DeltaSeconds;\n        [FieldOffset(4)] private UInt32 pad0;\n        [FieldOffset(8)] public double ThisFrameSeconds;\n        [FieldOffset(16)] public double TimewarpPointSeconds;\n        [FieldOffset(24)] public double NextFrameSeconds;\n        [FieldOffset(32)] public double ScanoutMidpointSeconds;\n        // C# arrays are dynamic and thus not supported as return values, so just expand the struct.\n        [FieldOffset(40)] public double EyeScanoutSeconds_0;\n        [FieldOffset(48)] public double EyeScanoutSeconds_1;\n    };\n\n    /// <summary>\n    /// Rendering information for each eye. Computed by either ovrHmd_ConfigureRendering()\n    /// or ovrHmd_GetRenderDesc() based on the specified FOV. Note that the rendering viewport\n    /// is not included here as it can be specified separately and modified per frame through:\n    ///    (a) ovrHmd_GetRenderScaleAndOffset in the case of client rendered distortion,\n    /// or (b) passing different values via ovrTexture in the case of SDK rendered distortion.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct EyeRenderDesc\n    {\n        /// <summary>\n        /// The eye index this instance corresponds to.\n        /// </summary>\n        [FieldOffset(0)] public UInt32 Eye;\n        /// <summary>\n        /// The field of view.\n        /// </summary>\n        [FieldOffset(4)] public FovPort Fov;\n        /// <summary>\n        /// Distortion viewport.\n        /// </summary>\n        [FieldOffset(20)] public Recti DistortedViewport;\n        /// <summary>\n        /// How many display pixels will fit in tan(angle) = 1.\n        /// </summary>\n        [FieldOffset(36)] public Vector2f PixelsPerTanAngleAtCenter;\n        /// <summary>\n        /// Translation to be applied to view matrix for each eye offset.\n        /// </summary>\n        [FieldOffset(44)] public Vector3f HmdToEyeViewOffset;\n    };\n\n    //-----------------------------------------------------------------------------------\n    // ***** Platform-independent Rendering Configuration\n\n    /// <summary>\n    /// These types are used to hide platform-specific details when passing\n    /// render device, OS, and texture data to the API.\n    ///\n    /// The benefit of having these wrappers versus platform-specific API functions is\n    /// that they allow game glue code to be portable. A typical example is an\n    /// engine that has multiple back ends, say GL and D3D. Portable code that calls\n    /// these back ends may also use LibOVR. To do this, back ends can be modified\n    /// to return portable types such as ovrTexture and ovrRenderAPIConfig.\n    /// </summary>\n    public enum RenderAPIType\n    {\n        None,\n        OpenGL,\n        Android_GLES,  // May include extra native window pointers, etc.\n        D3D9,\n        D3D10, // Deprecated: Not supported for SDK rendering\n        D3D11,\n        Count,\n    };\n\n    /// <summary>\n    /// Platform-independent part of rendering API-configuration data.\n    /// It is a part of ovrRenderAPIConfig, passed to ovrHmd_Configure.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct RenderAPIConfigHeader\n    {\n        [FieldOffset(0)] public RenderAPIType API;\n        [FieldOffset(4)] public Sizei BackBufferSize; // Previously named RTSize.\n        [FieldOffset(12)] public Int32 Multisample;\n    };\n\n    [StructLayout(LayoutKind.Sequential, Pack = 1)]\n    internal struct RenderAPIConfig_Raw\n    {\n        public RenderAPIConfigHeader Header;\n        public IntPtr PlatformData0;\n        public IntPtr PlatformData1;\n        public IntPtr PlatformData2;\n        public IntPtr PlatformData3;\n        public IntPtr PlatformData4;\n        public IntPtr PlatformData5;\n        public IntPtr PlatformData6;\n        public IntPtr PlatformData7;\n    };\n\n    /// <summary>\n    /// Contains platform-specific information for rendering.\n    /// </summary>\n    public abstract class RenderAPIConfig\n    {\n        public RenderAPIConfig() { Header.API = RenderAPIType.None; }\n\n        public RenderAPIConfigHeader Header;\n\n        internal abstract RenderAPIConfig_Raw ToRaw();\n    }\n\n    /// <summary>\n    /// Contains OpenGL-specific rendering information for Windows.\n    /// </summary>\n    public class OpenGLWindowsConfig : RenderAPIConfig\n    {\n        public OpenGLWindowsConfig(Sizei backBufferSize, int multisample, IntPtr hwnd, IntPtr HDCDeviceContext)\n        {\n            Header.API = RenderAPIType.OpenGL;\n            Header.BackBufferSize = backBufferSize;\n            Header.Multisample = multisample;\n            _hwnd = hwnd;\n            _HDCDeviceContext = HDCDeviceContext;\n        }\n\n        internal override RenderAPIConfig_Raw ToRaw()\n        {\n            RenderAPIConfig_Raw config = new RenderAPIConfig_Raw();\n            config.Header = this.Header;\n            config.PlatformData0 = this._hwnd;\n            config.PlatformData1 = this._HDCDeviceContext;\n            return config;\n        }\n\n        public IntPtr _hwnd;\n        public IntPtr _HDCDeviceContext;\n    }\n\n    /// <summary>\n    /// Contains OpenGL-specific rendering information for Linux.\n    /// </summary>\n    public class OpenGLLinuxConfig : RenderAPIConfig\n    {\n        public OpenGLLinuxConfig(Sizei backBufferSize, int multisample, IntPtr optionalXDisplay, IntPtr optionalWindow)\n        {\n            Header.API = RenderAPIType.OpenGL;\n            Header.BackBufferSize = backBufferSize;\n            Header.Multisample = multisample;\n            _OptionalXDisplay = optionalXDisplay;\n            _OptionalWindow = optionalWindow;\n        }\n\n        internal override RenderAPIConfig_Raw ToRaw()\n        {\n            RenderAPIConfig_Raw config = new RenderAPIConfig_Raw();\n            config.Header = this.Header;\n            config.PlatformData0 = this._OptionalXDisplay;\n            config.PlatformData1 = this._OptionalWindow;\n            return config;\n        }\n\n        IntPtr _OptionalXDisplay;\n        IntPtr _OptionalWindow;\n    }\n\n    /// <summary>\n    /// Contains OpenGL ES-specific rendering information.\n    /// </summary>\n    public class AndroidGLESConfig : RenderAPIConfig\n    {\n        public AndroidGLESConfig(Sizei backBufferSize, int multisample)\n        {\n            Header.API = RenderAPIType.Android_GLES;\n            Header.BackBufferSize = backBufferSize;\n            Header.Multisample = multisample;\n        }\n\n        internal override RenderAPIConfig_Raw ToRaw()\n        {\n            RenderAPIConfig_Raw config = new RenderAPIConfig_Raw();\n            config.Header = this.Header;\n            return config;\n        }\n    }\n\n    /// <summary>\n    /// Contains D3D9-specific rendering information.\n    /// </summary>\n    public class D3D9Config : RenderAPIConfig\n    {\n        public D3D9Config(Sizei backBufferSize, int multisample, IntPtr IDirect3DDevice9_pDevice, IntPtr IDirect3DSwapChain9_pSwapChain)\n        {\n            Header.API = RenderAPIType.D3D9;\n            Header.BackBufferSize = backBufferSize;\n            Header.Multisample = multisample;\n            _IDirect3DDevice9_pDevice = IDirect3DDevice9_pDevice;\n            _IDirect3DSwapChain9_pSwapChain = IDirect3DSwapChain9_pSwapChain;\n        }\n\n        internal override RenderAPIConfig_Raw ToRaw()\n        {\n            RenderAPIConfig_Raw config = new RenderAPIConfig_Raw();\n            config.Header = this.Header;\n            config.PlatformData0 = this._IDirect3DDevice9_pDevice;\n            config.PlatformData1 = this._IDirect3DSwapChain9_pSwapChain;\n            return config;\n        }\n\n        IntPtr _IDirect3DDevice9_pDevice;\n        IntPtr _IDirect3DSwapChain9_pSwapChain;\n    }\n\n    /// <summary>\n    /// Contains D3D11-specific rendering information.\n    /// </summary>\n    public class D3D11Config : RenderAPIConfig\n    {\n        public D3D11Config(Sizei backBufferSize, int multisample, IntPtr ID3D11Device_pDevice, IntPtr ID3D11DeviceContext_pDeviceContext, IntPtr ID3D11RenderTargetView_pBackBufferRT, IntPtr ID3D11BackBufferUAV, IntPtr IDXGISwapChain_pSwapChain)\n        {\n            Header.API = RenderAPIType.D3D11;\n            Header.BackBufferSize = backBufferSize;\n            Header.Multisample = multisample;\n            _ID3D11Device_pDevice = ID3D11Device_pDevice;\n            _ID3D11DeviceContext_pDeviceContext = ID3D11DeviceContext_pDeviceContext;\n            _ID3D11RenderTargetView_pBackBufferRT = ID3D11RenderTargetView_pBackBufferRT;\n            _ID3D11BackBufferUAV = ID3D11BackBufferUAV;\n            _IDXGISwapChain_pSwapChain = IDXGISwapChain_pSwapChain;\n        }\n\n        internal override RenderAPIConfig_Raw ToRaw()\n        {\n            RenderAPIConfig_Raw config = new RenderAPIConfig_Raw();\n            config.Header = this.Header;\n            config.PlatformData0 = this._ID3D11Device_pDevice;\n            config.PlatformData1 = this._ID3D11DeviceContext_pDeviceContext;\n            config.PlatformData2 = this._ID3D11RenderTargetView_pBackBufferRT;\n            config.PlatformData3 = this._ID3D11BackBufferUAV;\n            config.PlatformData4 = this._IDXGISwapChain_pSwapChain;\n            return config;\n        }\n\n        IntPtr _ID3D11Device_pDevice;\n        IntPtr _ID3D11DeviceContext_pDeviceContext;\n        IntPtr _ID3D11RenderTargetView_pBackBufferRT;\n        IntPtr _ID3D11BackBufferUAV;\n        IntPtr _IDXGISwapChain_pSwapChain;\n    }\n\n    /// <summary>\n    /// Platform-independent part of the eye texture descriptor.\n    /// It is a part of ovrTexture, passed to ovrHmd_EndFrame.\n    /// If RenderViewport is all zeros then the full texture will be used.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct TextureHeader\n    {\n        [FieldOffset(0)] public UInt32 API;\n        [FieldOffset(4)] public Sizei TextureSize;\n        [FieldOffset(12)] public Recti RenderViewport;  // Pixel viewport in texture that holds eye image.\n    };\n\n    /// <summary>\n    /// Contains platform-specific information for rendering.\n    /// </summary>\n    public abstract class Texture\n    {\n        public Texture() { Header.API = (UInt32)RenderAPIType.None; }\n\n        public TextureHeader Header;\n\n        internal abstract Texture_Raw ToRaw();\n    }\n\n    /// <summary>\n    /// Contains OpenGL-specific texture information\n    /// </summary>\n    public class GLTextureData : Texture\n    {\n        public GLTextureData(Sizei textureSize, Recti renderViewport, IntPtr texId)\n        {\n            Header.API = (UInt32)RenderAPIType.OpenGL;\n            Header.TextureSize = textureSize;\n            Header.RenderViewport = renderViewport;\n            _texId = texId;\n        }\n\n        internal override Texture_Raw ToRaw()\n        {\n            Texture_Raw config = new Texture_Raw();\n            config.Header = this.Header;\n            config.PlatformData_0 = this._texId;\n            return config;\n        }\n\n        public IntPtr _texId;\n    }\n\n    /// <summary>\n    /// Contains D3D9-specific texture information\n    /// </summary>\n    public class D3D9TextureData : Texture\n    {\n        public D3D9TextureData(Sizei textureSize, Recti renderViewport, IntPtr IDirect3DTexture9_pTexture)\n        {\n            Header.API = (UInt32)RenderAPIType.D3D9;\n            Header.TextureSize = textureSize;\n            Header.RenderViewport = renderViewport;\n            _IDirect3DTexture9_pTexture = IDirect3DTexture9_pTexture;\n        }\n\n        internal override Texture_Raw ToRaw()\n        {\n            Texture_Raw config = new Texture_Raw();\n            config.Header = this.Header;\n            config.PlatformData_0 = this._IDirect3DTexture9_pTexture;\n            return config;\n        }\n\n        public IntPtr _IDirect3DTexture9_pTexture;\n    }\n\n    /// <summary>\n    /// Contains D3D10-specific texture information\n    /// </summary>\n    public class D3D10TextureData : Texture\n    {\n        public D3D10TextureData(Sizei textureSize, Recti renderViewport, IntPtr ID3D10Texture2D_pTexture, IntPtr ID3D10ShaderResourceView_pSRView)\n        {\n            Header.API = (UInt32)RenderAPIType.D3D10;\n            Header.TextureSize = textureSize;\n            Header.RenderViewport = renderViewport;\n            _ID3D10Texture2D_pTexture = ID3D10Texture2D_pTexture;\n            _ID3D10ShaderResourceView_pSRView = ID3D10ShaderResourceView_pSRView;\n        }\n\n        internal override Texture_Raw ToRaw()\n        {\n            Texture_Raw config = new Texture_Raw();\n            config.Header = this.Header;\n            config.PlatformData_0 = this._ID3D10Texture2D_pTexture;\n            config.PlatformData_1 = this._ID3D10ShaderResourceView_pSRView;\n            return config;\n        }\n\n        public IntPtr _ID3D10Texture2D_pTexture, _ID3D10ShaderResourceView_pSRView;\n    }\n\n\n    /// <summary>\n    /// Contains D3D11-specific texture information\n    /// </summary>\n    public class D3D11TextureData : Texture\n    {\n        public D3D11TextureData(Sizei textureSize, Recti renderViewport, IntPtr ID3D11Texture2D_pTexture, IntPtr ID3D11ShaderResourceView_pSRView)\n        {\n            Header.API = (UInt32)RenderAPIType.D3D11;\n            Header.TextureSize = textureSize;\n            Header.RenderViewport = renderViewport;\n            _ID3D11Texture2D_pTexture = ID3D11Texture2D_pTexture;\n            _ID3D11ShaderResourceView_pSRView = ID3D11ShaderResourceView_pSRView;\n        }\n\n        internal override Texture_Raw ToRaw()\n        {\n            Texture_Raw config = new Texture_Raw();\n            config.Header = this.Header;\n            config.PlatformData_0 = this._ID3D11Texture2D_pTexture;\n            config.PlatformData_1 = this._ID3D11ShaderResourceView_pSRView;\n            return config;\n        }\n\n        public IntPtr _ID3D11Texture2D_pTexture, _ID3D11ShaderResourceView_pSRView;\n    }\n\n    // Internal description for ovrTexture; must match C 'ovrTexture' layout.\n    [StructLayout(LayoutKind.Sequential, Pack = 1)]\n    internal struct Texture_Raw\n    {\n        public TextureHeader Header;\n        private UInt32 pad0;\n        public IntPtr PlatformData_0;\n        public IntPtr PlatformData_1;\n        public IntPtr PlatformData_2;\n        public IntPtr PlatformData_3;\n        public IntPtr PlatformData_4;\n        public IntPtr PlatformData_5;\n        public IntPtr PlatformData_6;\n        public IntPtr PlatformData_7;\n    };\n\n    /// <summary>\n    /// Describes a vertex used by the distortion mesh. This is intended to be converted into\n    /// the engine-specific format. Some fields may be unused based on the ovrDistortionCaps\n    /// flags selected. TexG and TexB, for example, are not used if chromatic correction is\n    /// not requested.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct DistortionVertex\n    {\n        /// <summary>\n        /// [-1,+1],[-1,+1] over the entire framebuffer.\n        /// </summary>\n        [FieldOffset(0)] public Vector2f ScreenPosNDC;\n        /// <summary>\n        /// Lerp factor between time-warp matrices. Can be encoded in Pos.z.\n        /// </summary>\n        [FieldOffset(8)] public float TimeWarpFactor;\n        /// <summary>\n        /// Vignette fade factor. Can be encoded in Pos.w.\n        /// </summary>\n        [FieldOffset(12)] public float VignetteFactor;\n        /// <summary>\n        /// The tangents of the horizontal and vertical eye angles for the red channel.\n        /// </summary>\n        [FieldOffset(16)] public Vector2f TanEyeAnglesR;\n        /// <summary>\n        /// The tangents of the horizontal and vertical eye angles for the green channel.\n        /// </summary>\n        [FieldOffset(24)] public Vector2f TanEyeAnglesG;\n        /// <summary>\n        /// The tangents of the horizontal and vertical eye angles for the blue channel.\n        /// </summary>\n        [FieldOffset(32)] public Vector2f TanEyeAnglesB;\n    };\n\n    /// <summary>\n    /// Describes a full set of distortion mesh data, filled in by ovrHmd_CreateDistortionMesh.\n    /// Contents of this data structure, if not null, should be freed by ovrHmd_DestroyDistortionMesh.\n    /// </summary>\n    public struct DistortionMesh\n    {\n        /// <summary>\n        /// The distortion vertices representing each point in the mesh.\n        /// </summary>\n        public DistortionVertex[] pVertexData;\n        /// <summary>\n        /// Indices for connecting the mesh vertices into polygons.\n        /// </summary>\n        public short[] pIndexData;\n        /// <summary>\n        /// The number of vertices in the mesh.\n        /// </summary>\n        public uint VertexCount;\n        /// <summary>\n        /// The number of indices in the mesh.\n        /// </summary>\n        public uint IndexCount;\n\n        internal DistortionMesh(DistortionMesh_Raw raw)\n        {\n            this.VertexCount = raw.VertexCount;\n            this.pVertexData = new DistortionVertex[this.VertexCount];\n            this.IndexCount  = raw.IndexCount;\n            this.pIndexData  = new short[this.IndexCount];\n\n            // Copy data\n            System.Type vertexType = typeof(DistortionVertex);\n            Int32 vertexSize = Marshal.SizeOf(vertexType);\n            Int32 indexSize  = sizeof(short);\n            Int64 pvertices  = raw.pVertexData.ToInt64();\n            Int64 pindices   = raw.pIndexData.ToInt64();\n\n            // TODO: Investigate using Marshal.Copy() or Buffer.BlockCopy() for improved performance\n\n            for (int i = 0; i < raw.VertexCount; i++)\n            {\n                pVertexData[i] = (DistortionVertex)Marshal.PtrToStructure(new IntPtr(pvertices), vertexType);\n                pvertices += vertexSize;\n            }\n            // Indices are stored as shorts.\n            for (int j = 0; j < raw.IndexCount; j++)\n            {\n                pIndexData[j] = Marshal.ReadInt16(new IntPtr(pindices));\n                pindices += indexSize;\n            }\n        }\n    };\n\n    // Internal description for ovrDistortionMesh; must match C 'ovrDistortionMesh' layout.\n    [StructLayout(LayoutKind.Sequential, Pack = 1)]\n    internal struct DistortionMesh_Raw\n    {\n        public IntPtr pVertexData;\n        public IntPtr pIndexData;\n        public UInt32 VertexCount;\n        public UInt32 IndexCount;\n    };\n\n    /// <summary>\n    /// Used by ovrhmd_GetHSWDisplayState to report the current display state.\n    /// </summary>\n    [StructLayout(LayoutKind.Explicit)]\n    public struct HSWDisplayState\n    {\n        /// <summary>\n        /// If true then the warning should be currently visible\n        /// and the following variables have meaning. Else there is no\n        /// warning being displayed for this application on the given HMD.\n        /// True if the Health&Safety Warning is currently displayed.\n        /// </summary>\n        [FieldOffset(0)] public byte Displayed;\n        /// <summary>\n        /// Absolute time when the warning was first displayed. See ovr_GetTimeInSeconds().\n        /// </summary>\n        [FieldOffset(8)] public double StartTime;\n        /// <summary>\n        /// Earliest absolute time when the warning can be dismissed. May be a time in the past.\n        /// </summary>\n        [FieldOffset(16)] public double DismissibleTime;\n    };\n\n    /// <summary>\n    /// Provides an interface to a CAPI HMD object.  The ovrHmd instance is normally\n    /// created by ovrHmd::Create, after which its other methods can be called.\n    /// The typical process would involve calling:\n    ///\n    /// Setup:\n    ///   - Initialize() to initialize the OVR SDK.\n    ///   - Construct Hmd to create an ovrHmd.\n    ///   - Use hmd members and ovrHmd_GetFovTextureSize() to determine graphics configuration.\n    ///   - ConfigureTracking() to configure and initialize tracking.\n    ///   - ConfigureRendering() to setup graphics for SDK rendering, which is the preferred approach.\n    ///   - Please refer to \"Client Distortion Rendering\" below if you prefer to do that instead.\n    ///   - If ovrHmdCap_ExtendDesktop is not set, use ovrHmd_AttachToWindow to associate the window with an Hmd.\n    ///   - Allocate render textures as needed.\n    ///\n    /// Game Loop:\n    ///   - Call ovrHmd_BeginFrame() to get frame timing and orientation information.\n    ///   - Render each eye in between, using ovrHmd_GetEyePoses or ovrHmd_GetHmdPosePerEye to get the predicted hmd pose and each eye pose.\n    ///   - Call ovrHmd_EndFrame() to render distorted textures to the back buffer\n    ///     and present them on the Hmd.\n    ///\n    /// Shutdown:\n    ///   - Dispose the Hmd to release the ovrHmd.\n    ///   - ovr_Shutdown() to shutdown the OVR SDK.\n    /// </summary>\n    public class Hmd : IDisposable\n    {\n        public const string OVR_VERSION_STRING                    = \"0.5.0\";\n        public const string OVR_KEY_USER                          = \"User\";\n        public const string OVR_KEY_NAME                          = \"Name\";\n        public const string OVR_KEY_GENDER                        = \"Gender\";\n        public const string OVR_KEY_PLAYER_HEIGHT                 = \"PlayerHeight\";\n        public const string OVR_KEY_EYE_HEIGHT                    = \"EyeHeight\";\n        public const string OVR_KEY_IPD                           = \"IPD\";\n        public const string OVR_KEY_NECK_TO_EYE_DISTANCE          = \"NeckEyeDistance\";\n        public const string OVR_KEY_EYE_RELIEF_DIAL               = \"EyeReliefDial\";\n        public const string OVR_KEY_EYE_TO_NOSE_DISTANCE          = \"EyeToNoseDist\";\n        public const string OVR_KEY_MAX_EYE_TO_PLATE_DISTANCE     = \"MaxEyeToPlateDist\";\n        public const string OVR_KEY_EYE_CUP                       = \"EyeCup\";\n        public const string OVR_KEY_CUSTOM_EYE_RENDER             = \"CustomEyeRender\";\n        public const string OVR_KEY_CAMERA_POSITION               = \"CenteredFromWorld\";\n\n        // Default measurements empirically determined at Oculus to make us happy\n        // The neck model numbers were derived as an average of the male and female averages from ANSUR-88\n        // NECK_TO_EYE_HORIZONTAL = H22 - H43 = INFRAORBITALE_BACK_OF_HEAD - TRAGION_BACK_OF_HEAD\n        // NECK_TO_EYE_VERTICAL = H21 - H15 = GONION_TOP_OF_HEAD - ECTOORBITALE_TOP_OF_HEAD\n        // These were determined to be the best in a small user study, clearly beating out the previous default values\n        public const string OVR_DEFAULT_GENDER                = \"Unknown\";\n        public const float OVR_DEFAULT_PLAYER_HEIGHT          = 1.778f;\n        public const float OVR_DEFAULT_EYE_HEIGHT             = 1.675f;\n        public const float OVR_DEFAULT_IPD                    = 0.064f;\n        public const float OVR_DEFAULT_NECK_TO_EYE_HORIZONTAL = 0.0805f;\n        public const float OVR_DEFAULT_NECK_TO_EYE_VERTICAL   = 0.075f;\n        public const float OVR_DEFAULT_EYE_RELIEF_DIAL        = 3;\n        public readonly float[] OVR_DEFAULT_CAMERA_POSITION   = {0,0,0,1,0,0,0};\n\n        private IntPtr HmdPtr;\n        private bool IsUserAllocated = false;\n\n        // Used to return color result to avoid per-frame allocation.\n        private byte[] LatencyTestRgb = new byte[3];\n        \n        // -----------------------------------------------------------------------------------\n        // Static Methods\n\n        /// <summary>\n        /// ovr_InitializeRenderingShim initializes the rendering shim apart from everything\n        /// else in LibOVR. This may be helpful if the application prefers to avoid\n        /// creating any OVR resources (allocations, service connections, etc) at this point.\n        /// ovr_InitializeRenderingShim does not bring up anything within LibOVR except the\n        /// necessary hooks to enable the Direct-to-Rift functionality.\n        ///\n        /// Either ovr_InitializeRenderingShim() or ovr_Initialize() must be called before any\n        /// Direct3D or OpenGL initialization is done by application (creation of devices, etc).\n        /// ovr_Initialize() must still be called after to use the rest of LibOVR APIs.\n        ///\n        /// Same as ovr_InitializeRenderingShim except it requests to support at least the\n        /// given minor LibOVR library version.\n        /// </summary>\n        public static bool InitializeRenderingShim(int requestedMinorVersion)\n        {\n            return ovr_InitializeRenderingShim(requestedMinorVersion) != 0;\n        }\n\n        public static bool InitializeRenderingShim()\n        {\n            return ovr_InitializeRenderingShim() != 0;\n        }\n\n        /// Library init/shutdown, must be called around all other OVR code.\n        /// No other functions calls besides ovr_InitializeRenderingShim are allowed\n        /// before ovr_Initialize succeeds or after ovr_Shutdown.\n\n        /// <summary>\n        /// Initializes all Oculus functionality.\n        /// A second call to Initialize after successful second call returns true.\n        /// </summary>\n        public static bool Initialize(InitParams Params)\n        {\n            return ovr_Initialize(Params) != 0;\n        }\n\n        /// <summary>\n        /// Shuts down all Oculus functionality.\n        /// </summary>\n        public static void Shutdown()\n        {\n            ovr_Shutdown();\n        }\n\n        /// <summary>\n        /// Returns version string representing libOVR version.\n        /// </summary>\n        public static string GetVersionString()\n        {\n            return Marshal.PtrToStringAnsi(ovr_GetVersionString());\n        }\n\n        /// <summary>\n        /// Detects or re-detects HMDs and reports the total number detected.\n        /// Users can get information about each HMD by calling ovrHmd_Create with an index.\n        /// Returns -1 when the service is unreachable.\n        /// </summary>\n        public static int Detect()\n        {\n            return ovrHmd_Detect();\n        }\n\n        /// <summary>\n        /// Enumerates modifications to the projection matrix based on the application's needs\n        /// </summary>\n        [Flags]\n        public enum ProjectionModifier\n        {\n            /// <summary>\n            /// Use for generating a default projection matrix that is:\n            /// * Left-handed\n            /// * Near depth values stored in the depth buffer are smaller than far depth values\n            /// * Both near and far are explicitly defined\n            /// * With a clipping range that is (0 to w)\n            /// </summary>\n            None              = 0x00,\n\n            /// <summary>\n            /// Enable if using right-handed transformations in your application\n            /// </summary>\n            RightHanded       = 0x01,\n\n            /// <summary>\n            /// After projection transform is applied, far values stored in the depth buffer will be less than closer depth values\n            /// NOTE: Enable only if application is using a floating-point depth buffer for proper precision\n            /// </summary>\n            FarLessThanNear   = 0x02,\n\n            /// <summary>\n            /// When this flag is used, the zfar value pushed into ovrMatrix4f_Projection() will be ignored\n            /// NOTE: Enable only if ovrProjection_FarLessThanNear is also enabled where the far clipping plane will be pushed to infinity\n            /// </summary>\n            FarClipAtInfinity = 0x04,\n\n            /// <summary>\n            /// Enable if application is rendering with OpenGL and expects a projection matrix with a clipping range of (-w to w)\n            /// Ignore this flag if your application already handles the conversion from D3D range (0 to w) to OpenGL\n            /// </summary>\n            ClipRangeOpenGL   = 0x08,\n        }\n\n        /// <summary>\n        /// Used to generate projection from ovrEyeDesc::Fov.\n        /// </summary>\n        public static Matrix4f GetProjection(\n            FovPort fov,\n            float znear,\n            float zfar,\n            uint projectionModFlags)\n        {\n            return new Matrix4f(ovrMatrix4f_Projection(\n                fov,\n                znear,\n                   zfar,\n                projectionModFlags));\n        }\n\n        /// <summary>\n        /// Used for 2D rendering, Y is down\n        /// orthoScale = 1.0f / pixelsPerTanAngleAtCenter\n        /// orthoDistance = distance from camera, such as 0.8m\n        /// </summary>\n        public static Matrix4f GetOrthoSubProjection(Matrix4f projection, Vector2f orthoScale, float orthoDistance, float hmdToEyeViewOffsetX)\n        {\n            return new Matrix4f(ovrMatrix4f_OrthoSubProjection(projection, orthoScale, orthoDistance, hmdToEyeViewOffsetX));\n        }\n\n        /// <summary>\n        /// Returns global, absolute high-resolution time in seconds. This is the same\n        /// value as used in sensor messages.\n        /// </summary>\n        public static double GetTimeInSeconds()\n        {\n            return ovr_GetTimeInSeconds();\n        }\n\n        /// <summary>\n        /// Waits until the specified absolute time.\n        /// </summary>\n        public static double WaitTillTime(double absTime)\n        {\n            return ovr_WaitTillTime(absTime);\n        }\n\n        // -----------------------------------------------------------------------------------\n        // **** Constructor\n        \n        /// <summary>\n        /// Creates an HMD and the underlying native ovrHmd pointer at the given index.\n        /// Index can [0 .. ovrHmd_Detect()-1]. Index mappings can cange after each ovrHmd_Detect call.\n        /// </summary>\n        public Hmd(int index)\n        {\n            this.HmdPtr = ovrHmd_Create(index);\n            if (this.HmdPtr == IntPtr.Zero)\n                throw new ArgumentException(\"Failed to create HMD at index \" + index);\n        }\n\n        /// <summary>\n        /// Constructs an Hmd that wraps the given native ovrHmd pointer.\n        /// </summary>\n        public Hmd(IntPtr hmdPtr)\n        {\n            this.HmdPtr = hmdPtr;\n            IsUserAllocated = true;\n        }\n        \n        /// <summary>\n        /// Creates a 'fake' HMD used for debugging only. This is not tied to specific hardware,\n        /// but may be used to debug some of the related rendering.\n        /// </summary>\n        public Hmd(HmdType type)\n        {\n            this.HmdPtr = ovrHmd_CreateDebug(type);\n            if (this.HmdPtr == IntPtr.Zero)\n                throw new ArgumentException(\"Failed to create debug HMD of type \" + type);\n        }\n\n        ~Hmd()\n        {\n            Dispose();\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        /// <filterpriority>2</filterpriority>\n        /// <remarks>Call <see cref=\"Dispose\"/> when you are finished using the <see cref=\"Ovr.Hmd\"/>. The <see cref=\"Dispose\"/> method\n        /// leaves the <see cref=\"Ovr.Hmd\"/> in an unusable state. After calling <see cref=\"Dispose\"/>, you must release all\n        /// references to the <see cref=\"Ovr.Hmd\"/> so the garbage collector can reclaim the memory that the\n        /// <see cref=\"Ovr.Hmd\"/> was occupying.</remarks>\n        public void Dispose()\n        {\n            if (!IsUserAllocated && this.HmdPtr != IntPtr.Zero)\n            {\n                ovrHmd_Destroy(this.HmdPtr);\n                this.HmdPtr = IntPtr.Zero;\n            }\n\n            GC.SuppressFinalize(this);\n        }\n\n        /// <summary>\n        /// Returns last error for HMD state. Returns null for no error.\n        /// String is valid until next call or GetLastError or HMD is destroyed.\n        /// </summary>\n        public string GetLastError()\n        {\n            return ovrHmd_GetLastError(HmdPtr);\n        }\n\n        /// <summary>\n        /// Platform specific function to specify the application window whose output will be \n        /// displayed on the HMD. Only used if the ovrHmdCap_ExtendDesktop flag is false.\n        ///   Windows: SwapChain associated with this window will be displayed on the HMD.\n        ///            Specify 'destMirrorRect' in window coordinates to indicate an area\n        ///            of the render target output that will be mirrored from 'sourceRenderTargetRect'.\n        ///            Null pointers mean \"full size\".\n        /// @note Source and dest mirror rects are not yet implemented.\n        /// </summary>\n        public bool AttachToWindow(Recti destMirrorRect, Recti sourceRenderTargetRect, IntPtr WindowPtr)\n        {\n            return ovrHmd_AttachToWindow(HmdPtr, WindowPtr, destMirrorRect, sourceRenderTargetRect) != 0;\n        }\n\n        /// <summary>\n        /// Returns capability bits that are enabled at this time as described by ovrHmdCaps.\n        /// Note that this value is different font ovrHmdDesc::HmdCaps, which describes what\n        /// capabilities are available for that HMD.\n        /// </summary>\n        public uint GetEnabledCaps()\n        {\n            return ovrHmd_GetEnabledCaps(HmdPtr);\n        }\n        \n        /// <summary>\n        /// Modifies capability bits described by ovrHmdCaps that can be modified,\n        /// such as ovrHmdCap_LowPersistance.\n        /// </summary>\n        public void SetEnabledCaps(uint capsBits)\n        {\n            ovrHmd_SetEnabledCaps(HmdPtr, capsBits);\n        }\n\n        /// <summary>\n        /// Returns an ovrHmdDesc, which provides a complete description for the HMD\n        /// </summary>\n        public HmdDesc GetDesc()\n        {\n            if (IntPtr.Size == 8)\n            {\n                HmdDesc_Raw64 rawDesc = (HmdDesc_Raw64)Marshal.PtrToStructure(HmdPtr, typeof(HmdDesc_Raw64));\n                return new HmdDesc(rawDesc);\n            }\n            else\n            {\n                HmdDesc_Raw32 rawDesc = (HmdDesc_Raw32)Marshal.PtrToStructure(HmdPtr, typeof(HmdDesc_Raw32));\n                return new HmdDesc(rawDesc);\n            }\n        }\n\n        //-------------------------------------------------------------------------------------\n        // ***** Tracking Interface\n        \n        /// <summary>\n        /// All tracking interface functions are thread-safe, allowing tracking state to be sampled\n        /// from different threads.\n        /// ConfigureTracking starts sensor sampling, enabling specified capabilities,\n        ///    described by ovrTrackingCaps.\n        ///  - supportedTrackingCaps specifies support that is requested. The function will succeed\n        ///   even if these caps are not available (i.e. sensor or camera is unplugged). Support\n        ///    will automatically be enabled if such device is plugged in later. Software should\n        ///    check ovrTrackingState.StatusFlags for real-time status.\n        ///  - requiredTrackingCaps specify sensor capabilities required at the time of the call.\n        ///    If they are not available, the function will fail. Pass 0 if only specifying\n        ///    supportedTrackingCaps.\n        ///  - Pass 0 for both supportedTrackingCaps and requiredTrackingCaps to disable tracking.\n        /// </summary>\n        public bool ConfigureTracking(uint supportedTrackingCaps, uint requiredTrackingCaps)\n        {\n            return ovrHmd_ConfigureTracking(HmdPtr, supportedTrackingCaps, requiredTrackingCaps) != 0;\n        }\n\n        /// <summary>\n        /// Re-centers the sensor orientation.\n        /// Normally this will recenter the (x,y,z) translational components and the yaw\n        /// component of orientation.\n        /// </summary>\n        public void RecenterPose()\n        {\n            ovrHmd_RecenterPose(HmdPtr);\n        }\n\n        /// <summary>\n        /// Returns tracking state reading based on the specified absolute system time.\n        /// Pass an absTime value of 0.0 to request the most recent sensor reading. In this case\n        /// both PredictedPose and SamplePose will have the same value.\n        /// ovrHmd_GetEyePoses relies on this function internally.\n        /// This may also be used for more refined timing of FrontBuffer rendering logic, etc.\n        /// </summary>\n        public TrackingState GetTrackingState(double absTime)\n        {\n            return ovrHmd_GetTrackingState(HmdPtr, absTime);\n        }\n\n        /// <summary>\n        /// The following is deprecated.\n        /// </summary>\n        public void ResetOnlyBackOfHeadTrackingForConnectConf()\n        {\n            ovrHmd_ResetOnlyBackOfHeadTrackingForConnectConf(HmdPtr);\n        }\n\n        //-------------------------------------------------------------------------------------\n        // ***** Graphics Setup\n        \n        /// <summary>\n        /// Calculates the recommended texture size for rendering a given eye within the HMD\n        /// with a given FOV cone. Higher FOV will generally require larger textures to\n        /// maintain quality.\n        ///  - pixelsPerDisplayPixel specifies the ratio of the number of render target pixels\n        ///    to display pixels at the center of distortion. 1.0 is the default value. Lower\n        ///    values can improve performance.\n        /// </summary>\n        public Sizei GetFovTextureSize(Eye eye, FovPort fov, float pixelsPerDisplayPixel)\n        {\n            return ovrHmd_GetFovTextureSize(HmdPtr, eye, fov, pixelsPerDisplayPixel);\n        }\n\n        //-------------------------------------------------------------------------------------\n        // *****  Rendering API Thread Safety\n\n        //  All of rendering functions including the configure and frame functions\n        // are *NOT thread safe*. It is ok to use ConfigureRendering on one thread and handle\n        //  frames on another thread, but explicit synchronization must be done since\n        //  functions that depend on configured state are not reentrant.\n        //\n        //  As an extra requirement, any of the following calls must be done on\n        //  the render thread, which is the same thread that calls ovrHmd_BeginFrame\n        //  or ovrHmd_BeginFrameTiming.\n        //    - ovrHmd_EndFrame\n        //    - ovrHmd_GetEyeTimewarpMatrices\n\n        //-------------------------------------------------------------------------------------\n        // *****  SDK Distortion Rendering Functions\n\n        // These functions support rendering of distortion by the SDK through direct\n        // access to the underlying rendering API, such as D3D or GL.\n        // This is the recommended approach since it allows better support for future\n        // Oculus hardware, and enables a range of low-level optimizations.\n\n        /// <summary>\n        /// Configures rendering and fills in computed render parameters.\n        /// This function can be called multiple times to change rendering settings.\n        /// eyeRenderDescOut is a pointer to an array of two EyeRenderDesc structs\n        /// that are used to return complete rendering information for each eye.\n        ///  - apiConfig provides D3D/OpenGL specific parameters. Pass null\n        ///    to shutdown rendering and release all resources.\n        ///  - distortionCaps describe desired distortion settings.\n        /// </summary>\n        public EyeRenderDesc[] ConfigureRendering(ref RenderAPIConfig renderAPIConfig, FovPort[] eyeFovIn, uint distortionCaps)\n        {\n            EyeRenderDesc[] eyeRenderDesc = new EyeRenderDesc[] { new EyeRenderDesc(), new EyeRenderDesc() };\n            RenderAPIConfig_Raw rawConfig = renderAPIConfig.ToRaw();\n\n            bool result = ovrHmd_ConfigureRendering(HmdPtr, ref rawConfig, distortionCaps, eyeFovIn, eyeRenderDesc) != 0;\n            if (result)\n                return eyeRenderDesc;\n            return null;\n        }\n\n        /// <summary>\n        /// Begins a frame, returning timing information.\n        /// This should be called at the beginning of the game rendering loop (on the render thread).\n        /// Pass 0 for the frame index if not using ovrHmd_GetFrameTiming.\n        /// </summary>\n        public FrameTiming BeginFrame(uint frameIndex)\n        {\n            FrameTiming_Raw raw = ovrHmd_BeginFrame(HmdPtr, frameIndex);\n            return new FrameTiming(raw);\n        }\n\n        /// <summary>\n        /// Ends a frame, submitting the rendered textures to the frame buffer.\n        /// - RenderViewport within each eyeTexture can change per frame if necessary.\n        /// - 'renderPose' will typically be the value returned from ovrHmd_GetEyePoses,\n        ///   ovrHmd_GetHmdPosePerEye but can be different if a different head pose was\n           ///   used for rendering.\n        /// - This may perform distortion and scaling internally, assuming is it not\n        ///   delegated to another thread.\n        /// - Must be called on the same thread as BeginFrame.\n        /// - *** This Function will call Present/SwapBuffers and potentially wait for GPU Sync ***.\n        /// </summary>\n        public void EndFrame(Posef[] renderPose, Texture[] eyeTexture)\n        {\n            Texture_Raw[] raw = new Texture_Raw[eyeTexture.Length];\n            for (int i = 0; i < eyeTexture.Length; i++)\n            {\n                raw[i] = eyeTexture[i].ToRaw();\n            }\n            \n            ovrHmd_EndFrame(HmdPtr, renderPose, raw);\n        }\n\n        /// <summary>\n        /// Returns predicted head pose in outHmdTrackingState and offset eye poses in outEyePoses\n        /// as an atomic operation. Caller need not worry about applying HmdToEyeViewOffset to the\n        /// returned outEyePoses variables.\n        /// - Thread-safe function where caller should increment frameIndex with every frame\n        ///   and pass the index where applicable to functions called on the  rendering thread.\n        /// - hmdToEyeViewOffset[2] can be EyeRenderDesc.HmdToEyeViewOffset returned from\n        ///   ovrHmd_ConfigureRendering or ovrHmd_GetRenderDesc. For monoscopic rendering,\n        ///   use a vector that is the average of the two vectors for both eyes.\n        /// - If frameIndex is not being utilized, pass in 0.\n        /// - Assuming outEyePoses are used for rendering, it should be passed into ovrHmd_EndFrame.\n        /// - If caller doesn't need outHmdTrackingState, it can be passed in as NULL\n        /// </summary>\n        public Posef[] GetEyePoses(uint frameIndex)\n        {\n            FovPort leftFov = GetDesc().DefaultEyeFov[(int)Eye.Left];\n            FovPort rightFov = GetDesc().DefaultEyeFov[(int)Eye.Right];\n\n            EyeRenderDesc leftDesc = GetRenderDesc(Eye.Left, leftFov);\n            EyeRenderDesc rightDesc = GetRenderDesc(Eye.Right, rightFov);\n\n            TrackingState trackingState = new TrackingState();\n            Vector3f[] eyeOffsets = { leftDesc.HmdToEyeViewOffset, rightDesc.HmdToEyeViewOffset };\n            Posef[] eyePoses = { new Posef(), new Posef() };\n\n            ovrHmd_GetEyePoses(HmdPtr, frameIndex, eyeOffsets, eyePoses, ref trackingState);\n\n            return eyePoses;\n        }\n\n        /// <summary>\n        /// Function was previously called ovrHmd_GetEyePose\n        /// Returns the predicted head pose to use when rendering the specified eye.\n        /// - Important: Caller must apply HmdToEyeViewOffset before using ovrPosef for rendering\n        /// - Must be called between ovrHmd_BeginFrameTiming and ovrHmd_EndFrameTiming.\n        /// - If returned pose is used for rendering the eye, it should be passed to ovrHmd_EndFrame.\n        /// - Parameter 'eye' is used internally for prediction timing only\n        /// </summary>\n        public Posef GetHmdPosePerEye(Eye eye)\n        {\n            return ovrHmd_GetHmdPosePerEye(HmdPtr, eye);\n        }\n\n        //-------------------------------------------------------------------------------------\n        // *****  Client Distortion Rendering Functions\n\n        // These functions provide the distortion data and render timing support necessary to allow\n        // client rendering of distortion. Client-side rendering involves the following steps:\n        //\n        //  1. Setup ovrEyeDesc based on the desired texture size and FOV.\n        //     Call ovrHmd_GetRenderDesc to get the necessary rendering parameters for each eye.\n        //\n        //  2. Use ovrHmd_CreateDistortionMesh to generate the distortion mesh.\n        //\n        //  3. Use ovrHmd_BeginFrameTiming, ovrHmd_GetEyePoses, and ovrHmd_BeginFrameTiming in\n        //     the rendering loop to obtain timing and predicted head orientation when rendering each eye.\n        //      - When using timewarp, use ovr_WaitTillTime after the rendering and gpu flush, followed\n        //        by ovrHmd_GetEyeTimewarpMatrices to obtain the timewarp matrices used\n        //        by the distortion pixel shader. This will minimize latency.\n        //\n\n        /// <summary>\n        /// Computes the distortion viewport, view adjust, and other rendering parameters for\n        /// the specified eye. This can be used instead of ovrHmd_ConfigureRendering to do\n        /// setup for client rendered distortion.\n        /// </summary>\n        public EyeRenderDesc GetRenderDesc(Eye eyeType, FovPort fov)\n        {\n            return ovrHmd_GetRenderDesc(HmdPtr, eyeType, fov);\n        }\n\n        /// <summary>\n        /// Generate distortion mesh per eye.\n        /// Distortion capabilities will depend on 'distortionCaps' flags. Users should\n        /// render using the appropriate shaders based on their settings.\n        /// Distortion mesh data will be allocated and written into the ovrDistortionMesh data structure,\n        /// which should be explicitly freed with ovrHmd_DestroyDistortionMesh.\n        /// Users should call ovrHmd_GetRenderScaleAndOffset to get uvScale and Offset values for rendering.\n        /// The function shouldn't fail unless theres is a configuration or memory error, in which case\n        /// ovrDistortionMesh values will be set to null.\n        /// This is the only function in the SDK reliant on eye relief, currently imported from profiles,\n        /// or overridden here.\n        /// </summary>\n        public DistortionMesh? CreateDistortionMesh(Eye eye, FovPort fov, uint distortionCaps)\n        {\n            DistortionMesh_Raw rawMesh = new DistortionMesh_Raw();\n\n            bool result = ovrHmd_CreateDistortionMesh(HmdPtr, eye, fov, distortionCaps, out rawMesh) != 0;\n\n            if (!result)\n            {\n                return null;\n            }\n\n            DistortionMesh mesh = new DistortionMesh(rawMesh);\n            ovrHmd_DestroyDistortionMesh(ref rawMesh);\n            return mesh;\n        }\n\n        public DistortionMesh? CreateDistortionMeshDebug(Eye eye, FovPort fov, uint distortionCaps, float debugEyeReliefOverrideInMeters)\n        {\n            DistortionMesh_Raw rawMesh = new DistortionMesh_Raw();\n\n            bool result = ovrHmd_CreateDistortionMeshDebug(\n                HmdPtr,\n                eye,\n                fov,\n                distortionCaps,\n                out rawMesh,\n                debugEyeReliefOverrideInMeters) != 0;\n\n            if (!result)\n            {\n                return null;\n            }\n\n            DistortionMesh mesh = new DistortionMesh(rawMesh);\n            ovrHmd_DestroyDistortionMesh(ref rawMesh);\n            return mesh;\n        }\n\n        /// <summary>\n        /// Computes updated 'uvScaleOffsetOut' to be used with a distortion if render target size or\n        /// viewport changes after the fact. This can be used to adjust render size every frame if desired.\n        /// </summary>\n        public Vector2f[] GetRenderScaleAndOffset(FovPort fov, Sizei textureSize, Recti renderViewport)\n        {\n            Vector2f[] uvScaleOffsetOut = new Vector2f[] { new Vector2f(), new Vector2f() };\n            ovrHmd_GetRenderScaleAndOffset(fov, textureSize, renderViewport, uvScaleOffsetOut);\n            return uvScaleOffsetOut;\n        }\n\n        /// <summary>\n        /// Thread-safe timing function for the main thread. Caller should increment frameIndex\n        /// with every frame and pass the index where applicable to functions called on the\n        /// rendering thread.\n        /// </summary>\n        public FrameTiming GetFrameTiming(uint frameIndex)\n        {\n            FrameTiming_Raw raw = ovrHmd_GetFrameTiming(HmdPtr, frameIndex);\n            return new FrameTiming(raw);\n        }\n\n        /// <summary>\n        /// Called at the beginning of the frame on the rendering thread.\n        /// Pass frameIndex == 0 if ovrHmd_GetFrameTiming isn't being used. Otherwise,\n        /// pass the same frame index as was used for GetFrameTiming on the main thread.\n        /// </summary>\n        public FrameTiming BeginFrameTiming(uint frameIndex)\n        {\n            FrameTiming_Raw raw = ovrHmd_BeginFrameTiming(HmdPtr, frameIndex);\n            return new FrameTiming(raw);\n        }\n\n        /// <summary>\n        /// Marks the end of client distortion rendered frame, tracking the necessary timing information.\n        /// This function must be called immediately after Present/SwapBuffers + GPU sync. GPU sync is\n        /// important before this call to reduce latency and ensure proper timing.\n        /// </summary>\n        public void EndFrameTiming()\n        {\n            ovrHmd_EndFrameTiming(HmdPtr);\n        }\n\n        /// <summary>\n        /// Initializes and resets frame time tracking. This is typically not necessary, but\n        /// is helpful if game changes vsync state or video mode. vsync is assumed to be on if this\n        /// isn't called. Resets internal frame index to the specified number.\n        /// </summary>\n        public void ResetFrameTiming(uint frameIndex)\n        {\n            ovrHmd_ResetFrameTiming(HmdPtr, frameIndex);\n        }\n\n        /// <summary>\n        /// Computes timewarp matrices used by distortion mesh shader, these are used to adjust\n        /// for head orientation change since the last call to ovrHmd_GetEyePoses\n        /// when rendering this eye. The ovrDistortionVertex::TimeWarpFactor is used to blend between the\n        /// matrices, usually representing two different sides of the screen.\n        /// Must be called on the same thread as ovrHmd_BeginFrameTiming.\n        /// </summary>\n        public Matrix4f[] GetEyeTimewarpMatrices(Eye eye, Posef renderPose)\n        {\n            Matrix4f_Raw[] rawMats = {new Matrix4f_Raw(), new Matrix4f_Raw()};\n            ovrHmd_GetEyeTimewarpMatrices(HmdPtr, eye, renderPose, rawMats);\n\n            Matrix4f[] mats = {new Matrix4f(rawMats[0]), new Matrix4f(rawMats[1])};\n            return mats;\n        }\n\n        public Matrix4f[] GetEyeTimewarpMatricesDebug(Eye eye, Posef renderPose, Quatf extraQuat, double debugTimingOffsetInSeconds)\n        {\n            Matrix4f_Raw[] rawMats = {new Matrix4f_Raw(), new Matrix4f_Raw()};\n            ovrHmd_GetEyeTimewarpMatricesDebug(HmdPtr, eye, renderPose, extraQuat, rawMats, debugTimingOffsetInSeconds);\n\n            Matrix4f[] mats = {new Matrix4f(rawMats[0]), new Matrix4f(rawMats[1])};\n            return mats;\n        }\n\n        // -----------------------------------------------------------------------------------\n        // ***** Latency Test interface\n\n        /// <summary>\n        /// Does latency test processing and returns 'TRUE' if specified rgb color should\n        /// be used to clear the screen.\n        /// </summary>\n        public byte[] ProcessLatencyTest()\n        {\n            if (ovrHmd_ProcessLatencyTest(HmdPtr, LatencyTestRgb) != 0)\n                return LatencyTestRgb;\n            return null;\n        }\n\n        /// <summary>\n        /// Returns non-null string once with latency test result, when it is available.\n        /// Buffer is valid until next call.\n        /// </summary>\n        public string GetLatencyTestResult()\n        {\n            IntPtr p = ovrHmd_GetLatencyTestResult(HmdPtr);\n            return (p == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(p);\n        }\n\n        /// <summary>\n        /// Returns the latency testing color in rgbColorOut to render when using a DK2\n        /// Returns false if this feature is disabled or not-applicable (e.g. using a DK1)\n        /// </summary>\n        public byte[] GetLatencyTest2DrawColor()\n        {\n            if (ovrHmd_GetLatencyTest2DrawColor(HmdPtr, LatencyTestRgb) != 0)\n                return LatencyTestRgb;\n            return null;\n        }\n\n        //-------------------------------------------------------------------------------------\n        // ***** Health and Safety Warning Display interface\n        //\n\n        /// <summary>\n        /// Returns the current state of the HSW display. If the application is doing the rendering of\n        /// the HSW display then this function serves to indicate that the warning should be\n        /// currently displayed. If the application is using SDK-based eye rendering then the SDK by\n        /// default automatically handles the drawing of the HSW display. An application that uses\n        /// application-based eye rendering should use this function to know when to start drawing the\n        /// HSW display itself and can optionally use it in conjunction with ovrhmd_DismissHSWDisplay\n        /// as described below.\n        ///\n        /// Example usage for application-based rendering:\n        ///    bool HSWDisplayCurrentlyDisplayed = false; // global or class member variable\n        ///    ovrHSWDisplayState hswDisplayState = hmd.GetHSWDisplayState();\n        ///\n        ///    if (hswDisplayState.Displayed && !HSWDisplayCurrentlyDisplayed)\n        ///    {\n        ///        <insert model into the scene that stays in front of the user>\n        ///        HSWDisplayCurrentlyDisplayed = true;\n        ///    }\n        /// </summary>\n        public HSWDisplayState GetHSWDisplayState()\n        {\n            HSWDisplayState hswDisplayState;\n            ovrHmd_GetHSWDisplayState(HmdPtr, out hswDisplayState);\n            return hswDisplayState;\n        }\n\n        /// <summary>\n        /// Requests a dismissal of the HSWDisplay at the earliest possible time, which may be seconds\n        /// into the future due to display longevity requirements.\n        /// Returns true if the display is valid, in which case the request can always be honored.\n        ///\n        /// Example usage :\n        ///    void ProcessEvent(int key) {\n        ///        if (key == escape)\n        ///            hmd.DismissHSWDisplay();\n        ///    }\n        /// <summary>\n        public bool DismissHSWDisplay()\n        {\n            return ovrHmd_DismissHSWDisplay(HmdPtr) != 0;\n        }\n\n        // -----------------------------------------------------------------------------------\n        // ***** Property Access\n\n        // NOTICE: This is experimental part of API that is likely to go away or change.\n\n        // These allow accessing different properties of the HMD and profile.\n        // Some of the properties may go away with profile/HMD versions, so software should\n        // use defaults and/or proper fallbacks.\n\n        /// <summary>\n        /// Get boolean property. Returns first element if property is a boolean array.\n        /// Returns defaultValue if property doesn't exist.\n        /// </summary>\n        public bool GetBool(string propertyName, bool defaultVal)\n        {\n            return ovrHmd_GetBool(HmdPtr, propertyName, Convert.ToSByte(defaultVal)) != 0;\n        }\n\n        /// <summary>\n        /// Modify bool property; false if property doesn't exist or is readonly.\n        /// </summary>\n        public bool SetBool(string propertyName, bool val)\n        {\n            return ovrHmd_SetBool(HmdPtr, propertyName, Convert.ToSByte(val)) != 0;\n        }\n\n        /// <summary>\n        /// Get integer property. Returns first element if property is an integer array.\n        /// Returns defaultValue if property doesn't exist.\n        /// </summary>\n        public int GetInt(string propertyName, int defaultVal)\n        {\n            return ovrHmd_GetInt(HmdPtr, propertyName, defaultVal);\n        }\n\n        /// <summary>\n        /// Modify integer property; false if property doesn't exist or is readonly.\n        /// </summary>\n        public bool SetInt(string propertyName, int val)\n        {\n            return ovrHmd_SetInt(HmdPtr, propertyName, val) != 0;\n        }\n\n        /// <summary>\n        /// Get float property. Returns first element if property is a float array.\n        /// Returns defaultValue if property doesn't exist.\n        /// </summary>\n        public float GetFloat(string propertyName, float defaultVal)\n        {\n            return ovrHmd_GetFloat(HmdPtr, propertyName, defaultVal);\n        }\n\n        /// <summary>\n        /// Modify float property; false if property doesn't exist or is readonly.\n        /// </summary>\n        public bool SetFloat(string propertyName, float val)\n        {\n            return ovrHmd_SetFloat(HmdPtr, propertyName, val) != 0;\n        }\n\n        /// <summary>\n        /// Get float[] property. Returns the number of elements filled in, 0 if property doesn't exist.\n        /// Maximum of arraySize elements will be written.\n        /// </summary>\n        public float[] GetFloatArray(string propertyName, float[] values)\n        {\n            if (values == null)\n                return null;\n\n            ovrHmd_GetFloatArray(HmdPtr, propertyName, values, (uint)values.Length);\n            return values;\n        }\n\n        /// <summary>\n        /// Modify float[] property; false if property doesn't exist or is readonly.\n        /// </summary>\n        public bool SetFloatArray(string propertyName, float[] values)\n        {\n            if (values == null)\n                values = new float[0];\n\n            return ovrHmd_SetFloatArray(HmdPtr, propertyName, values, (uint)values.Length) != 0;\n        }\n\n        /// <summary>\n        /// Get string property. Returns first element if property is a string array.\n        /// Returns defaultValue if property doesn't exist.\n        /// String memory is guaranteed to exist until next call to GetString or GetStringArray, or HMD is destroyed.\n        /// </summary>\n        public string GetString(string propertyName, string defaultVal)\n        {\n            IntPtr p = ovrHmd_GetString(HmdPtr, propertyName, null);\n            if (p == IntPtr.Zero)\n                return defaultVal;\n            return Marshal.PtrToStringAnsi(p);\n        }\n\n        /// <summary>\n        /// Set string property\n        /// </summary>\n        public bool SetString(string propertyName, string val)\n        {\n            return ovrHmd_SetString(HmdPtr, propertyName, val) != 0;\n        }\n\n        // -----------------------------------------------------------------------------------\n        // ***** Logging\n\n        /// <summary>\n        /// Start performance logging. guid is optional and if included is written with each file entry.\n        /// If called while logging is already active with the same filename, only the guid will be updated\n        /// If called while logging is already active with a different filename, ovrHmd_StopPerfLog() will be called, followed by ovrHmd_StartPerfLog()\n        /// </summary>\n        public bool StartPerfLog(string fileName, string userData1)\n        {\n            return ovrHmd_StartPerfLog(HmdPtr, fileName, userData1) != 0;\n        }\n\n        /// <summary>\n        /// Stop performance logging.\n        /// </summary>\n        public bool StopPerfLog()\n        {\n            return ovrHmd_StopPerfLog(HmdPtr) != 0;\n        }\n\n        public const string LibFile = \"OculusPlugin\";\n\n        // Imported functions from\n        // OVRPlugin.dll    (PC)\n        // OVRPlugin.bundle (OSX)\n        // OVRPlugin.so     (Linux, Android)\n\n        // -----------------------------------------------------------------------------------\n        // ***** Private Interface to libOVR\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovr_InitializeRenderingShim(int requestedMinorVersion);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovr_InitializeRenderingShim();\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovr_Initialize(InitParams Params);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovr_Shutdown();\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern IntPtr ovr_GetVersionString();\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern int ovrHmd_Detect();\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern IntPtr ovrHmd_Create(int index);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_Destroy(IntPtr hmd);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern IntPtr ovrHmd_CreateDebug(HmdType type);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern string ovrHmd_GetLastError(IntPtr hmd);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_AttachToWindow(\n                IntPtr hmd,\n                   IntPtr window,\n                   Recti destMirrorRect,\n                   Recti sourceRenderTargetRect);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern uint ovrHmd_GetEnabledCaps(IntPtr hmd);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_SetEnabledCaps(IntPtr hmd, uint capsBits);\n\n        //-------------------------------------------------------------------------------------\n        // ***** Sensor Interface\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_ConfigureTracking(\n                IntPtr hmd,\n                   uint supportedTrackingCaps,\n                   uint requiredTrackingCaps);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_RecenterPose(IntPtr hmd);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern TrackingState ovrHmd_GetTrackingState(IntPtr hmd, double absTime);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_ResetOnlyBackOfHeadTrackingForConnectConf(IntPtr hmd);\n\n        //-------------------------------------------------------------------------------------\n        // ***** Graphics Setup\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern Sizei ovrHmd_GetFovTextureSize(\n                IntPtr hmd,\n                Eye eye,\n                   FovPort fov,\n                   float pixelsPerDisplayPixel);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_ConfigureRendering(\n                IntPtr hmd,\n                ref RenderAPIConfig_Raw apiConfig,\n                uint distortionCaps,\n                [In] FovPort[] eyeFovIn,\n                [In, Out] EyeRenderDesc[] eyeRenderDescOut);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern FrameTiming_Raw ovrHmd_BeginFrame(IntPtr hmd, uint frameIndex);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_EndFrame(\n                IntPtr hmd,\n                   [In] Posef[] renderPose,\n                   [In] Texture_Raw[] eyeTexture);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_GetEyePoses(\n                IntPtr hmd,\n                uint frameIndex,\n                [In] Vector3f[] hmdToEyeViewOffset,\n                [In, Out] Posef[] eyePosesOut,\n                [In, Out] ref TrackingState hmdTrackingStateOut);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern Posef ovrHmd_GetHmdPosePerEye(\n                IntPtr hmd,\n                Eye eye);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern EyeRenderDesc ovrHmd_GetRenderDesc(IntPtr hmd, Eye eye, FovPort fov);\n\n        // -----------------------------------------------------------------------------------\n        // **** Game-side rendering API\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_CreateDistortionMesh(\n                IntPtr hmd,\n                Eye eye,\n                FovPort fov,\n                uint distortionCaps,\n                [Out] out DistortionMesh_Raw meshData);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_CreateDistortionMeshDebug(\n                IntPtr hmd,\n                Eye eye,\n                FovPort fov,\n                uint distortionCaps,\n                [Out] out DistortionMesh_Raw meshData,\n                float debugEyeReliefOverrideInMeters);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_DestroyDistortionMesh(ref DistortionMesh_Raw meshData);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_GetRenderScaleAndOffset(\n                FovPort fov,\n                Sizei textureSize,\n                Recti renderViewport,\n                [MarshalAs(UnmanagedType.LPArray, SizeConst = 2)]\n                [Out] Vector2f[] uvScaleOffsetOut);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern FrameTiming_Raw ovrHmd_GetFrameTiming(IntPtr hmd, uint frameIndex);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern FrameTiming_Raw ovrHmd_BeginFrameTiming(IntPtr hmd, uint frameIndex);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_EndFrameTiming(IntPtr hmd);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_ResetFrameTiming(IntPtr hmd, uint frameIndex);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_GetEyeTimewarpMatrices(\n                IntPtr hmd,\n                   Eye eye,\n                   Posef renderPose,\n                [MarshalAs(UnmanagedType.LPArray, SizeConst = 2)]\n                [Out] Matrix4f_Raw[] twnOut);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_GetEyeTimewarpMatricesDebug(\n                IntPtr hmd,\n                   Eye eye,\n                   Posef renderPose,\n                Quatf extraQuat,\n                [MarshalAs(UnmanagedType.LPArray, SizeConst = 2)]\n                [Out] Matrix4f_Raw[] twnOut,\n                double debugTimingOffsetInSeconds);\n\n        //-------------------------------------------------------------------------------------\n        // Stateless math setup functions\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern Matrix4f_Raw ovrMatrix4f_Projection(\n                FovPort fov,\n                   float znear,\n                   float zfar,\n                uint projectionModFlags);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern Matrix4f_Raw ovrMatrix4f_OrthoSubProjection(\n                Matrix4f projection,\n                Vector2f orthoScale,\n                float orthoDistance,\n                float hmdToEyeViewOffsetX);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern double ovr_GetTimeInSeconds();\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern double ovr_WaitTillTime(double absTime);\n\n        // -----------------------------------------------------------------------------------\n        // ***** Latency Test interface\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_ProcessLatencyTest(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPArray, SizeConst = 3)]\n                [Out] byte[] rgbColorOut);\n        // Returns IntPtr to avoid allocation.\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern IntPtr ovrHmd_GetLatencyTestResult(IntPtr hmd);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_GetLatencyTest2DrawColor(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPArray, SizeConst = 3)]\n                [Out] byte[] rgbColorOut);\n\n        //-------------------------------------------------------------------------------------\n        // ***** Health and Safety Warning Display interface\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern void ovrHmd_GetHSWDisplayState(\n                IntPtr hmd,\n                   [Out] out HSWDisplayState hasWarningState);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_DismissHSWDisplay(IntPtr hmd);\n        \n        // -----------------------------------------------------------------------------------\n        // ***** Property Access\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_GetBool(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string propertyName,\n                sbyte defaultVal);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_SetBool(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string propertyName,\n                sbyte val);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern int ovrHmd_GetInt(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string propertyName,\n                int defaultVal);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_SetInt(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string propertyName,\n                int val);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern float ovrHmd_GetFloat(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string propertyName,\n                float defaultVal);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_SetFloat(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string propertyName,\n                float val);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern uint ovrHmd_GetFloatArray(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string propertyName,\n                float[] values, // TBD: Passing var size?\n                uint arraySize);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_SetFloatArray(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string propertyName,\n                float[] values, // TBD: Passing var size?\n                uint arraySize);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern IntPtr ovrHmd_GetString(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string propertyName,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string defaultVal);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_SetString(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string propertyName,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string val);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_StartPerfLog(\n                IntPtr hmd,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string fileName,\n                [MarshalAs(UnmanagedType.LPStr)]\n                string userData1);\n        [DllImport(LibFile, CallingConvention = CallingConvention.Cdecl)]\n        private static extern sbyte ovrHmd_StopPerfLog(IntPtr hmd);\n    }\n}\n"
  },
  {
    "path": "Lemma/Player/AnimationController.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Lemma.Util;\n\nnamespace Lemma.Components\n{\n\tpublic class AnimationController : Component<Main>, IUpdateableComponent\n\t{\n\t\tprivate class AnimationInfo\n\t\t{\n\t\t\tpublic int Priority;\n\t\t\tpublic float DefaultStrength;\n\t\t}\n\n\t\t// Input properties\n\t\tpublic Property<Vector3> SupportVelocity = new Property<Vector3>();\n\t\tpublic Property<bool> Kicking = new Property<bool>();\n\t\tpublic Property<bool> IsSupported = new Property<bool>();\n\t\tpublic Property<bool> IsSwimming = new Property<bool>();\n\t\tpublic Property<WallRun.State> WallRunState = new Property<WallRun.State>();\n\t\tpublic Property<bool> EnableWalking = new Property<bool>();\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\t\tpublic Property<Vector2> Movement = new Property<Vector2>();\n\t\tpublic Property<bool> Crouched = new Property<bool>();\n\t\tpublic Property<Vector2> Mouse = new Property<Vector2>();\n\t\tpublic Property<float> Rotation = new Property<float>();\n\t\tpublic Property<bool> EnableLean = new Property<bool>();\n\t\tpublic Property<Voxel> WallRunMap = new Property<Voxel>();\n\t\tpublic Property<Direction> WallDirection = new Property<Direction>();\n\n\t\tprivate Random random = new Random();\n\n\t\t// Output\n\t\tpublic Property<float> Lean = new Property<float>();\n\t\tprivate AnimatedModel model;\n\t\tprivate SkinnedModel.Clip sprintAnimation;\n\t\tprivate SkinnedModel.Clip runAnimation;\n\t\tprivate SkinnedModel.Clip fallAnimation;\n\t\tprivate Property<Matrix> relativeHeadBone;\n\n\t\tprivate float lastRotation;\n\n\t\tprivate float breathing;\n\n\t\tprivate float idleRotation;\n\t\tprivate bool idling;\n\t\tprivate float idleRotationBlend;\n\t\tprivate const float idleRotationBlendTime = 0.3f;\n\n\t\tprivate const float animationSpeedCoefficient = 1.0f / 4.5f;\n\t\tprivate const float animationSpeedCoefficientWallRun = 1.0f / 3.0f;\n\t\tprivate const float maxAnimationSpeed = 1.45f;\n\t\tprivate const float maxAnimationSpeedWallRun = 2.0f;\n\t\tprivate const float animationSpeedCoefficientCrouched = 1.0f / 2.2f;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Serialize = false;\n\t\t\tthis.lastRotation = this.idleRotation = this.Rotation;\n\t\t\tSoundKiller.Add(this.Entity, AK.EVENTS.STOP_PLAYER_BREATHING_SOFT);\n\t\t}\n\n\t\tpublic void Bind(AnimatedModel m)\n\t\t{\n\t\t\tthis.model = m;\n\t\t\tthis.sprintAnimation = m[\"Sprint\"];\n\t\t\tthis.runAnimation = m[\"Run\"];\n\t\t\tthis.fallAnimation = m[\"Fall\"];\n\n\t\t\tm[\"Idle\"].GetChannel(m.GetBoneIndex(\"ORG-spine\")).Filter = delegate(Matrix spine)\n\t\t\t{\n\t\t\t\tfloat x;\n\t\t\t\tif (this.idleRotationBlend < 1.0f)\n\t\t\t\t\tx = (this.Rotation - this.idleRotation.ClosestAngle(this.Rotation)) * Math.Max(0.0f, 1.0f - this.idleRotationBlend);\n\t\t\t\telse if (this.idling)\n\t\t\t\t\tx = this.Rotation - this.idleRotation.ClosestAngle(this.Rotation);\n\t\t\t\telse\n\t\t\t\t\tx = 0.0f;\n\t\t\t\treturn spine * Matrix.CreateRotationY(x);\n\t\t\t};\n\n\t\t\tint headIndex = m.GetBoneIndex(\"ORG-head\");\n\t\t\tMatrix headBindPose = m.GetWorldBindTransform(headIndex) * Matrix.CreateTranslation(0, 0.1f, 0.25f);\n\t\t\tFunc<SkinnedModel.Clip, Func<Matrix, Matrix>> cancelHeadBob = delegate(SkinnedModel.Clip clip)\n\t\t\t{\n\t\t\t\tint bone = headIndex;\n\t\t\t\tList<SkinnedModel.Channel> channels = new List<SkinnedModel.Channel>();\n\t\t\t\tchannels.Add(new SkinnedModel.Channel { BoneIndex = bone });\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tint parent = m.SkeletonHierarchy[bone];\n\t\t\t\t\tif (parent == -1)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse\n\t\t\t\t\t\tchannels.Add(clip.GetChannel(parent) ?? new SkinnedModel.Channel { BoneIndex = bone });\n\t\t\t\t\tbone = parent;\n\t\t\t\t}\n\t\t\t\treturn delegate(Matrix x)\n\t\t\t\t{\n\t\t\t\t\tif (main.MinimizeCameraMovement)\n\t\t\t\t\t{\n\t\t\t\t\t\tMatrix world = Matrix.Identity;\n\t\t\t\t\t\tfor (int i = 0; i < channels.Count; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSkinnedModel.Channel channel = channels[i];\n\t\t\t\t\t\t\tif (channel.Count == 0)\n\t\t\t\t\t\t\t\tworld = world * m.BindPose[channel.BoneIndex];\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tworld = world * channel.CurrentMatrix;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn headBindPose * Matrix.Invert(world);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\treturn x;\n\t\t\t\t};\n\t\t\t};\n\n\t\t\tint cameraIndex = m.GetBoneIndex(\"Camera\");\n\t\t\tFunc<SkinnedModel.Clip, Func<Matrix, Matrix>> cancelRotation = delegate(SkinnedModel.Clip clip)\n\t\t\t{\n\t\t\t\tint bone = cameraIndex;\n\t\t\t\tList<SkinnedModel.Channel> channels = new List<SkinnedModel.Channel>();\n\t\t\t\tchannels.Add(new SkinnedModel.Channel { BoneIndex = bone });\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tint parent = m.SkeletonHierarchy[bone];\n\t\t\t\t\tif (parent == -1)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse\n\t\t\t\t\t\tchannels.Add(clip.GetChannel(parent) ?? new SkinnedModel.Channel { BoneIndex = bone });\n\t\t\t\t\tbone = parent;\n\t\t\t\t}\n\t\t\t\treturn delegate(Matrix x)\n\t\t\t\t{\n\t\t\t\t\tif (\n#if VR\n\t\t\t\t\t\tthis.main.VR ||\n#endif\n\t\t\t\t\t\tthis.main.MinimizeCameraMovement)\n\t\t\t\t\t{\n\t\t\t\t\t\tMatrix world = Matrix.Identity;\n\t\t\t\t\t\tfor (int i = 0; i < channels.Count; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSkinnedModel.Channel channel = channels[i];\n\t\t\t\t\t\t\tif (channel.Count == 0)\n\t\t\t\t\t\t\t\tworld = world * m.BindPose[channel.BoneIndex];\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tworld = world * channel.CurrentMatrix;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tMatrix rot = Matrix.Invert(world) * Matrix.CreateRotationX((float)Math.PI * 0.5f);\n\t\t\t\t\t\trot.Translation = x.Translation;\n\t\t\t\t\t\treturn rot;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\treturn x;\n\t\t\t\t};\n\t\t\t};\n\n\t\t\tm[\"Run\"].GetChannel(headIndex).Filter = cancelHeadBob(m[\"Run\"]);\n\t\t\tm[\"RunLeft\"].GetChannel(headIndex).Filter = cancelHeadBob(m[\"RunLeft\"]);\n\t\t\tm[\"RunRight\"].GetChannel(headIndex).Filter = cancelHeadBob(m[\"RunRight\"]);\n\t\t\tm[\"RunLeftForward\"].GetChannel(headIndex).Filter = cancelHeadBob(m[\"RunLeftForward\"]);\n\t\t\tm[\"RunRightForward\"].GetChannel(headIndex).Filter = cancelHeadBob(m[\"RunRightForward\"]);\n\t\t\tm[\"Sprint\"].GetChannel(headIndex).Filter = cancelHeadBob(m[\"Sprint\"]);\n\t\t\tm[\"Slide\"].GetChannel(cameraIndex).Filter = cancelRotation(m[\"Slide\"]);\n\t\t\tm[\"WallRunLeft\"].GetChannel(cameraIndex).Filter = cancelRotation(m[\"WallRunLeft\"]);\n\t\t\tm[\"WallRunRight\"].GetChannel(cameraIndex).Filter = cancelRotation(m[\"WallRunRight\"]);\n\t\t\tm[\"TopOut\"].GetChannel(cameraIndex).Filter = cancelRotation(m[\"TopOut\"]);\n\t\t\tm[\"Land\"].GetChannel(cameraIndex).Filter = cancelRotation(m[\"Land\"]);\n\t\t\tm[\"LandHard\"].GetChannel(cameraIndex).Filter = cancelRotation(m[\"LandHard\"]);\n\n\t\t\tm[\"Idle\"].GetChannel(m.GetBoneIndex(\"ORG-hips\")).Filter = delegate(Matrix hips)\n\t\t\t{\n\t\t\t\tfloat x;\n\t\t\t\tif (this.idleRotationBlend < 1.0f)\n\t\t\t\t\tx = (this.idleRotation.ClosestAngle(this.Rotation) - this.Rotation) * Math.Max(0.0f, 1.0f - this.idleRotationBlend);\n\t\t\t\telse if (this.idling)\n\t\t\t\t\tx = this.idleRotation.ClosestAngle(this.Rotation) - this.Rotation;\n\t\t\t\telse\n\t\t\t\t\tx = 0.0f;\n\t\t\t\treturn hips * Matrix.CreateRotationZ(x);\n\t\t\t};\n\n\t\t\tthis.relativeHeadBone = m.GetRelativeBoneTransform(\"ORG-head\");\n\t\t\tm[\"Swim\"].Speed = 2.0f;\n\t\t\tm[\"SwimForward\"].Speed = 2.0f;\n\t\t\tm[\"TurnLeft\"].Speed = 2.0f;\n\t\t\tm[\"TurnRight\"].Speed = 2.0f;\n\n\t\t\tm[\"WallRunStraight\"].GetChannel(m.GetBoneIndex(\"ORG-hips\")).Filter = delegate(Matrix hips)\n\t\t\t{\n\t\t\t\thips.Translation += new Vector3(0, 1, 0);\n\t\t\t\treturn hips;\n\t\t\t};\n\t\t}\n\n\t\t// Animations and their priorities\n\t\tprivate static Dictionary<string, AnimationInfo> movementAnimations = new Dictionary<string, AnimationInfo>\n\t\t{\n\t\t\t{ \"Idle\", new AnimationInfo { Priority = -1, DefaultStrength = 1.0f, } },\n\t\t\t{ \"Run\", new AnimationInfo { Priority = 0 } },\n\t\t\t{ \"RunBackward\", new AnimationInfo { Priority = 0 } },\n\t\t\t{ \"RunLeft\", new AnimationInfo { Priority = 0 } },\n\t\t\t{ \"RunRight\", new AnimationInfo { Priority = 0 } },\n\t\t\t{ \"RunLeftForward\", new AnimationInfo { Priority = 0 } },\n\t\t\t{ \"RunRightForward\", new AnimationInfo { Priority = 0 } },\n\t\t\t{ \"Sprint\", new AnimationInfo { Priority = 1 } },\n\t\t};\n\n\t\t// Split the unit circle into 8 pie slices, starting with positive X\n\t\tprivate static string[] directions = new[]\n\t\t{\n\t\t\t\"RunRight\",\n\t\t\t\"RunRightForward\",\n\t\t\t\"Run\",\n\t\t\t\"RunLeftForward\",\n\t\t\t\"RunLeft\",\n\t\t\t\"RunBackward\",\n\t\t\t\"RunBackward\",\n\t\t\t\"RunBackward\",\n\t\t};\n\n\t\tprivate static Dictionary<string, AnimationInfo> crouchMovementAnimations = new Dictionary<string, AnimationInfo>\n\t\t{\n\t\t\t{ \"CrouchIdle\", new AnimationInfo { Priority = 1, DefaultStrength = 1.0f } },\n\t\t\t{ \"CrouchWalk\", new AnimationInfo { Priority = 2 } },\n\t\t\t{ \"CrouchWalkBackward\", new AnimationInfo { Priority = 2 } },\n\t\t\t{ \"CrouchStrafeLeft\", new AnimationInfo { Priority = 2 } },\n\t\t\t{ \"CrouchStrafeRight\", new AnimationInfo { Priority = 2 } },\n\t\t};\n\n\t\tprivate static string[] crouchDirections = new[]\n\t\t{\n\t\t\t\"CrouchStrafeRight\",\n\t\t\t\"CrouchStrafeRight\",\n\t\t\t\"CrouchWalk\",\n\t\t\t\"CrouchStrafeLeft\",\n\t\t\t\"CrouchStrafeLeft\",\n\t\t\t\"CrouchWalkBackward\",\n\t\t\t\"CrouchWalkBackward\",\n\t\t\t\"CrouchWalkBackward\",\n\t\t};\n\n\t\tconst float sprintRange = 1.0f;\n\t\tconst float sprintThreshold = Character.DefaultMaxSpeed - sprintRange;\n\n\t\tprivate float lastHorizontalSpeed;\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tVector2 mouse = this.Mouse;\n\n\t\t\tVector3 relativeVelocity = this.LinearVelocity.Value - this.SupportVelocity.Value;\n\t\t\tVector3 horizontalRelativeVelocity = relativeVelocity;\n\t\t\thorizontalRelativeVelocity.Y = 0;\n\t\t\tfloat horizontalSpeed = horizontalRelativeVelocity.Length();\n\t\t\tif (horizontalSpeed < this.lastHorizontalSpeed)\n\t\t\t\thorizontalSpeed = Math.Max(horizontalSpeed, this.lastHorizontalSpeed - 40.0f * dt);\n\t\t\telse if (horizontalSpeed > this.lastHorizontalSpeed)\n\t\t\t\thorizontalSpeed = Math.Min(horizontalSpeed, this.lastHorizontalSpeed + 10.0f * dt);\n\t\t\tthis.lastHorizontalSpeed = horizontalSpeed;\n\n\t\t\tif (this.WallRunState == WallRun.State.None)\n\t\t\t{\n\t\t\t\tthis.model.Stop\n\t\t\t\t(\n\t\t\t\t\t\"WallRunLeft\",\n\t\t\t\t\t\"WallRunRight\",\n\t\t\t\t\t\"WallRunStraight\",\n\t\t\t\t\t\"WallSlideDown\",\n\t\t\t\t\t\"WallSlideReverse\"\n\t\t\t\t);\n\n\t\t\t\tif (this.IsSupported)\n\t\t\t\t{\n\t\t\t\t\tthis.model.Stop\n\t\t\t\t\t(\n\t\t\t\t\t\t\"Jump\",\n\t\t\t\t\t\t\"Jump02\",\n\t\t\t\t\t\t\"Jump03\",\n\t\t\t\t\t\t\"JumpLeft\",\n\t\t\t\t\t\t\"JumpBackward\",\n\t\t\t\t\t\t\"JumpRight\",\n\t\t\t\t\t\t\"Fall\",\n\t\t\t\t\t\t\"Swim\",\n\t\t\t\t\t\t\"SwimForward\"\n\t\t\t\t\t);\n\n\t\t\t\t\tVector2 dir = this.Movement;\n\t\t\t\t\tfloat angle = (float)Math.Atan2(dir.Y, dir.X);\n\t\t\t\t\tif (angle < 0.0f)\n\t\t\t\t\t\tangle += (float)Math.PI * 2.0f;\n\n\t\t\t\t\tstring movementAnimation;\n\n\t\t\t\t\tif (this.EnableWalking)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.Crouched)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (dir.LengthSquared() == 0.0f)\n\t\t\t\t\t\t\t\tmovementAnimation = \"CrouchIdle\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tmovementAnimation = AnimationController.crouchDirections[(int)Math.Round(angle / ((float)Math.PI * 0.25f)) % 8];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (dir.LengthSquared() == 0.0f)\n\t\t\t\t\t\t\t\tmovementAnimation = \"Idle\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tmovementAnimation = AnimationController.directions[(int)Math.Round(angle / ((float)Math.PI * 0.25f)) % 8];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.Crouched)\n\t\t\t\t\t\t\tmovementAnimation = \"CrouchIdle\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmovementAnimation = \"Idle\";\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach (KeyValuePair<string, AnimationInfo> animation in this.Crouched ? crouchMovementAnimations : movementAnimations)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (animation.Key != \"Idle\" && animation.Key != \"CrouchIdle\")\n\t\t\t\t\t\t\tthis.model[animation.Key].Speed = Math.Min(horizontalSpeed * (this.Crouched ? animationSpeedCoefficientCrouched : animationSpeedCoefficient), maxAnimationSpeed);\n\t\t\t\t\t\tthis.model[animation.Key].TargetStrength = animation.Key == movementAnimation ? 1.0f : animation.Value.DefaultStrength;\n\t\t\t\t\t}\n\n\t\t\t\t\tbool nowIdling = false;\n\t\t\t\t\tif (movementAnimation == \"Run\")\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.sprintAnimation.TargetStrength = MathHelper.Clamp((horizontalSpeed - sprintThreshold) / sprintRange, 0.0f, 1.0f);\n\t\t\t\t\t\tthis.runAnimation.TargetStrength = Math.Min(MathHelper.Clamp(horizontalSpeed / sprintThreshold, 0.0f, 1.0f), 1.0f - this.sprintAnimation.TargetStrength);\n\t\t\t\t\t}\n\t\t\t\t\telse if (movementAnimation != \"Idle\" && movementAnimation != \"CrouchIdle\")\n\t\t\t\t\t\tthis.model[movementAnimation].TargetStrength = MathHelper.Clamp(this.Crouched ? horizontalSpeed / 2.0f : horizontalSpeed / sprintThreshold, 0.0f, 1.0f);\n\t\t\t\t\telse if (movementAnimation == \"Idle\")\n\t\t\t\t\t\tnowIdling = true;\n\n\t\t\t\t\tif (nowIdling)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.idling)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// We're already idling. Blend to new idle rotation if necessary\n\t\t\t\t\t\t\tif (this.idleRotationBlend < 1.0f)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.idleRotationBlend += dt / idleRotationBlendTime;\n\t\t\t\t\t\t\t\tif (this.idleRotationBlend >= 1.0f)\n\t\t\t\t\t\t\t\t\tthis.idleRotation = this.Rotation; // We're done blending\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfloat rotationDiff = this.Rotation - this.idleRotation.ClosestAngle(this.Rotation);\n\t\t\t\t\t\t\t\tif (Math.Abs(rotationDiff) > Math.PI * 0.25)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis.idleRotationBlend = 0.0f; // Start blending to new rotation\n\t\t\t\t\t\t\t\t\tthis.model.StartClip(rotationDiff > 0.0f ? \"TurnLeft\" : \"TurnRight\", 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse // We just started idling.\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.idleRotationBlend >= 1.0f) // Save the current rotation.\n\t\t\t\t\t\t\t\tthis.idleRotation = this.Rotation;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.idling) // We're just now coming out of idle state\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (this.idleRotationBlend > 1.0f)\n\t\t\t\t\t\t\t\tthis.idleRotationBlend = 0.0f;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.idleRotationBlend < 1.0f)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.idleRotationBlend += dt / idleRotationBlendTime;\n\t\t\t\t\t\t\tif (this.idleRotationBlend >= 1.0f)\n\t\t\t\t\t\t\t\tthis.idleRotation = this.Rotation; // We're done blending\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.idling = nowIdling;\n\n\t\t\t\t\tif (!this.model.IsPlaying(movementAnimation))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (string anim in this.Crouched ? movementAnimations.Keys : crouchMovementAnimations.Keys)\n\t\t\t\t\t\t\tthis.model.Stop(anim);\n\t\t\t\t\t\tDictionary<string, AnimationInfo> animations = this.Crouched ? crouchMovementAnimations : movementAnimations;\n\t\t\t\t\t\tTimeSpan currentTime = TimeSpan.FromSeconds(this.random.NextDouble() * this.model[animations.Keys.First()].Duration.TotalSeconds);\n\t\t\t\t\t\tforeach (KeyValuePair<string, AnimationInfo> animation in animations)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.model.StartClip(animation.Key, animation.Value.Priority, true, AnimatedModel.DefaultBlendTime);\n\t\t\t\t\t\t\tSkinnedModel.Clip clip = this.model[animation.Key];\n\t\t\t\t\t\t\tclip.CurrentTime = currentTime;\n\t\t\t\t\t\t\tclip.Strength = animation.Value.DefaultStrength;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.idling = false;\n\t\t\t\t\tforeach (string anim in movementAnimations.Keys)\n\t\t\t\t\t\tthis.model.Stop(anim);\n\t\t\t\t\tforeach (string anim in crouchMovementAnimations.Keys)\n\t\t\t\t\t\tthis.model.Stop(anim);\n\n\t\t\t\t\tif (this.IsSwimming)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.model.Stop(\"Fall\");\n\t\t\t\t\t\tif (this.Movement.Value.Y > 0.25f)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.model.Stop(\"Swim\");\n\t\t\t\t\t\t\tif (!this.model.IsPlaying(\"SwimForward\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.model.StartClip(\"SwimForward\", 0, true, AnimatedModel.DefaultBlendTime);\n\t\t\t\t\t\t\t\tSkinnedModel.Clip clip = this.model[\"SwimForward\"];\n\t\t\t\t\t\t\t\tclip.CurrentTime = TimeSpan.FromSeconds(this.random.NextDouble() * clip.Duration.TotalSeconds);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.model.Stop(\"SwimForward\");\n\t\t\t\t\t\t\tif (!this.model.IsPlaying(\"Swim\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.model.StartClip(\"Swim\", 0, true, AnimatedModel.DefaultBlendTime);\n\t\t\t\t\t\t\t\tSkinnedModel.Clip clip = this.model[\"Swim\"];\n\t\t\t\t\t\t\t\tclip.CurrentTime = TimeSpan.FromSeconds(this.random.NextDouble() * clip.Duration.TotalSeconds);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.model.Stop(\"SwimForward\");\n\t\t\t\t\t\tif (!this.model.IsPlaying(\"Fall\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.model.StartClip(\"Fall\", 0, true, AnimatedModel.DefaultBlendTime);\n\t\t\t\t\t\t\tthis.fallAnimation.CurrentTime = TimeSpan.FromSeconds(random.NextDouble() * this.fallAnimation.Duration.TotalSeconds);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.fallAnimation.Speed = MathHelper.Clamp(this.LinearVelocity.Value.Length() * (1.0f / 20.0f), 0, 2);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.idling = false;\n\t\t\t\tthis.model.Stop\n\t\t\t\t(\n\t\t\t\t\t\"Jump\",\n\t\t\t\t\t\"Jump02\",\n\t\t\t\t\t\"Jump03\",\n\t\t\t\t\t\"JumpLeft\",\n\t\t\t\t\t\"JumpBackward\",\n\t\t\t\t\t\"JumpRight\",\n\t\t\t\t\t\"Fall\"\n\t\t\t\t);\n\t\t\t\tforeach (string anim in movementAnimations.Keys)\n\t\t\t\t\tthis.model.Stop(anim);\n\n\t\t\t\tstring wallRunAnimation;\n\t\t\t\tswitch (this.WallRunState.Value)\n\t\t\t\t{\n\t\t\t\t\tcase WallRun.State.Straight:\n\t\t\t\t\t\twallRunAnimation = \"WallRunStraight\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase WallRun.State.Down:\n\t\t\t\t\t\twallRunAnimation = \"WallSlideDown\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase WallRun.State.Left:\n\t\t\t\t\t\twallRunAnimation = \"WallRunLeft\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase WallRun.State.Right:\n\t\t\t\t\t\twallRunAnimation = \"WallRunRight\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\twallRunAnimation = null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!this.model.IsPlaying(wallRunAnimation))\n\t\t\t\t{\n\t\t\t\t\tthis.model.Stop\n\t\t\t\t\t(\n\t\t\t\t\t\t\"WallRunStraight\",\n\t\t\t\t\t\t\"WallSlideDown\",\n\t\t\t\t\t\t\"WallRunLeft\",\n\t\t\t\t\t\t\"WallRunRight\",\n\t\t\t\t\t\t\"WallSlideReverse\"\n\t\t\t\t\t);\n\t\t\t\t\tthis.model.StartClip(wallRunAnimation, 1, true);\n\t\t\t\t}\n\n\t\t\t\tif (wallRunAnimation != null)\n\t\t\t\t{\n\t\t\t\t\tVector3 wallNormal = this.WallRunMap.Value.GetAbsoluteVector(this.WallDirection.Value.GetVector());\n\t\t\t\t\tfloat animationSpeed = (relativeVelocity - wallNormal * Vector3.Dot(relativeVelocity, wallNormal)).Length();\n\t\t\t\t\tthis.model[wallRunAnimation].Speed = Math.Min(maxAnimationSpeedWallRun, animationSpeed * animationSpeedCoefficientWallRun);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Rotate head to match mouse\n\t\t\tthis.relativeHeadBone.Value *= Matrix.CreateRotationX(mouse.Y * 0.6f);\n\t\t\tthis.model.UpdateWorldTransforms();\n\n\t\t\tfloat l = 0.0f;\n\t\t\tif (this.EnableLean\n\t\t\t\t&& !this.main.MinimizeCameraMovement\n#if VR\n\t\t\t\t&& !this.main.VR\n#endif\n\t\t\t\t)\n\t\t\t{\n\t\t\t\tl = horizontalSpeed * (this.lastRotation.ClosestAngle(this.Rotation) - this.Rotation) * (1.0f / 60.0f) / dt;\n\t\t\t}\n\n\t\t\tthis.Lean.Value += (l - this.Lean) * 20.0f * dt;\n\n\t\t\tthis.lastRotation = this.Rotation;\n\n\t\t\tconst float timeScale = 5.0f;\n\t\t\tconst float softBreathingThresholdPercentage = 0.75f;\n\t\t\tfloat newBreathing;\n\t\t\tif (!this.Crouched && this.Movement.Value.LengthSquared() > 0.0f && horizontalSpeed > Character.DefaultMaxSpeed * 0.75f)\n\t\t\t{\n\t\t\t\tnewBreathing = Math.Min(this.breathing + (dt / timeScale), 1.0f);\n\t\t\t\tif (this.breathing < softBreathingThresholdPercentage && newBreathing > softBreathingThresholdPercentage)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_BREATHING_SOFT, this.Entity);\n\t\t\t\t\tnewBreathing = 1.0f;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnewBreathing = Math.Max(0, this.breathing - dt / timeScale);\n\t\t\t\tif (this.breathing > softBreathingThresholdPercentage && newBreathing < softBreathingThresholdPercentage)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_PLAYER_BREATHING_SOFT, this.Entity);\n\t\t\t\t\tnewBreathing = 0.0f;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.breathing = newBreathing;\n\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_PLAYER_SLIDE, MathHelper.Clamp(relativeVelocity.Length() / 8.0f, 0.0f, 1.0f) * (this.Kicking ? 1.0f : 0.25f));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/BlockPredictor.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class BlockPredictor : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic class Possibility\n\t\t{\n\t\t\tpublic Voxel Map;\n\t\t\tpublic Voxel.Coord StartCoord;\n\t\t\tpublic Voxel.Coord EndCoord;\n\t\t\tpublic ModelAlpha Model;\n\t\t}\n\n\t\tprivate class Prediction\n\t\t{\n\t\t\tpublic Vector3 Position;\n\t\t\tpublic float Time;\n\t\t\tpublic int Level;\n\t\t}\n\n\t\t// Input properties\n\t\tpublic Property<float> Rotation = new Property<float>();\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\t\tpublic Property<Vector3> FootPosition = new Property<Vector3>();\n\t\tpublic Property<float> MaxSpeed = new Property<float>();\n\t\tpublic Property<float> JumpSpeed = new Property<float>();\n\t\tpublic Property<bool> IsSupported = new Property<bool>();\n\t\tpublic Property<Voxel.t> BlockType = new Property<Voxel.t>();\n\n\t\tprivate const float blockPossibilityFadeInTime = 0.075f;\n\t\tprivate const float blockPossibilityTotalLifetime = 2.0f;\n\t\tprivate const float blockPossibilityInitialAlpha = 0.5f;\n\t\tprivate const int searchDistance = 12;\n\t\tprivate const int platformSize = 3;\n\t\tprivate const int additionalWallDistance = 5;\n\n\t\tprivate float blockPossibilityLifetime = 0.0f;\n\n\t\tprivate Dictionary<Voxel, List<Possibility>> possibilities = new Dictionary<Voxel, List<Possibility>>();\n\t\t\n\t\tpublic IEnumerable<Possibility> AllPossibilities\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.possibilities.Values.SelectMany(x => x);\n\t\t\t}\n\t\t}\n\n\t\tpublic int PossibilityCount\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.possibilities.Count;\n\t\t\t}\n\t\t}\n\n\t\tprivate static Direction[] platformBuildableDirections = DirectionExtensions.HorizontalDirections.Union(new[] { Direction.NegativeY }).ToArray();\n\n\t\tprivate ParticleSystem particleSystem;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Serialize = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.particleSystem = ParticleSystem.Get(main, \"Distortion\");\n\t\t}\n\n\t\tpublic void ClearPossibilities()\n\t\t{\n\t\t\tforeach (Possibility block in this.AllPossibilities)\n\t\t\t\tblock.Model.Delete.Execute();\n\t\t\tthis.possibilities.Clear();\n\t\t}\n\n\t\tpublic void AddPossibility(Possibility block)\n\t\t{\n\t\t\tif (block.Model == null)\n\t\t\t{\n\t\t\t\tVector3 start = block.Map.GetRelativePosition(block.StartCoord), end = block.Map.GetRelativePosition(block.EndCoord);\n\n\t\t\t\tVector3 scale = new Vector3(Math.Abs(end.X - start.X) + 0.1f, Math.Abs(end.Y - start.Y) + 0.1f, Math.Abs(end.Z - start.Z) + 0.1f);\n\t\t\t\tMatrix matrix = Matrix.CreateScale(scale) * Matrix.CreateTranslation(new Vector3(-0.5f) + (start + end) * 0.5f);\n\n\t\t\t\tModelAlpha box = new ModelAlpha();\n\t\t\t\tbox.Filename.Value = \"AlphaModels\\\\distortion-box\";\n\t\t\t\tbox.Distortion.Value = true;\n\t\t\t\tswitch (this.BlockType.Value)\n\t\t\t\t{\n\t\t\t\t\tcase Voxel.t.GlowBlue:\n\t\t\t\t\t\tbox.Color.Value = new Vector3(2.0f, 2.0f, 3.0f);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Voxel.t.GlowYellow:\n\t\t\t\t\t\tbox.Color.Value = new Vector3(3.0f, 3.0f, 2.0f);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbox.Color.Value = new Vector3(2.5f, 2.5f, 2.5f);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbox.Alpha.Value = blockPossibilityInitialAlpha;\n\t\t\t\tbox.Serialize = false;\n\t\t\t\tbox.DrawOrder.Value = 11; // In front of water\n\t\t\t\tbox.BoundingBox.Value = new BoundingBox(new Vector3(-0.5f), new Vector3(0.5f));\n\t\t\t\tbox.GetVector3Parameter(\"Scale\").Value = scale;\n\t\t\t\tbox.Add(new Binding<Matrix>(box.Transform, x => matrix * x, block.Map.Transform));\n\t\t\t\tthis.Entity.Add(box);\n\t\t\t\tblock.Model = box;\n\t\t\t}\n\n\t\t\tList<Possibility> mapList;\n\t\t\tif (!this.possibilities.TryGetValue(block.Map, out mapList))\n\t\t\t{\n\t\t\t\tmapList = new List<Possibility>();\n\t\t\t\tpossibilities[block.Map] = mapList;\n\t\t\t}\n\t\t\tmapList.Add(block);\n\t\t\tblockPossibilityLifetime = 0.0f;\n\t\t}\n\n\t\tpublic List<Possibility> GetPossibilities(Voxel m)\n\t\t{\n\t\t\tList<Possibility> result;\n\t\t\tthis.possibilities.TryGetValue(m, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic void InstantiatePossibility(Possibility block)\n\t\t{\n\t\t\tblock.Model.Delete.Execute();\n\t\t\tList<Possibility> mapList = possibilities[block.Map];\n\t\t\tmapList.Remove(block);\n\t\t\tif (mapList.Count == 0)\n\t\t\t\tpossibilities.Remove(block.Map);\n\n\t\t\tbool regenerate = block.Map.Empty(block.StartCoord.CoordinatesBetween(block.EndCoord), false, false);\n\t\t\tforeach (Voxel.Coord c in block.StartCoord.CoordinatesBetween(block.EndCoord))\n\t\t\t{\n\t\t\t\tVector3 absolutePos = block.Map.GetAbsolutePosition(c);\n\t\t\t\tbool foundConflict = false;\n\t\t\t\tforeach (Voxel m2 in Voxel.ActivePhysicsVoxels)\n\t\t\t\t{\n\t\t\t\t\tif (m2 != block.Map && m2[absolutePos].ID != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tfoundConflict = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!foundConflict)\n\t\t\t\t\tregenerate |= block.Map.Fill(c, Voxel.States.Blue);\n\t\t\t}\n\n\t\t\tif (regenerate)\n\t\t\t{\n\t\t\t\tblock.Map.Regenerate();\n\t\t\t\tconst float prePrime = 2.0f;\n\t\t\t\t// Front and back faces\n\t\t\t\tfor (int x = block.StartCoord.X; x < block.EndCoord.X; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = block.StartCoord.Y; y < block.EndCoord.Y; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tparticleSystem.AddParticle(block.Map.GetAbsolutePosition(x, y, block.EndCoord.Z - 1), Vector3.Zero, -1.0f, prePrime);\n\t\t\t\t\t\tparticleSystem.AddParticle(block.Map.GetAbsolutePosition(x, y, block.StartCoord.Z), Vector3.Zero, -1.0f, prePrime);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Left and right faces\n\t\t\t\tfor (int z = block.StartCoord.Z; z < block.EndCoord.Z; z++)\n\t\t\t\t{\n\t\t\t\t\tfor (int y = block.StartCoord.Y; y < block.EndCoord.Y; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tparticleSystem.AddParticle(block.Map.GetAbsolutePosition(block.StartCoord.X, y, z), Vector3.Zero, -1.0f, prePrime);\n\t\t\t\t\t\tparticleSystem.AddParticle(block.Map.GetAbsolutePosition(block.EndCoord.X - 1, y, z), Vector3.Zero, -1.0f, prePrime);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Top and bottom faces\n\t\t\t\tfor (int z = block.StartCoord.Z; z < block.EndCoord.Z; z++)\n\t\t\t\t{\n\t\t\t\t\tfor (int x = block.StartCoord.X; x < block.EndCoord.X; x++)\n\t\t\t\t\t{\n\t\t\t\t\t\tparticleSystem.AddParticle(block.Map.GetAbsolutePosition(x, block.StartCoord.Y, z), Vector3.Zero, -1.0f, prePrime);\n\t\t\t\t\t\tparticleSystem.AddParticle(block.Map.GetAbsolutePosition(x, block.EndCoord.Y - 1, z), Vector3.Zero, -1.0f, prePrime);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_MAGIC_CUBE_STINGER, this.Entity);\n\t\t\t}\n\t\t}\n\n\t\tprivate static string[] ignoreTypes = new[] { \"Bouncer\", \"Spinner\", };\n\n\t\t// Function for finding a platform to build for the player\n\t\tpublic Possibility FindPlatform(Vector3 position)\n\t\t{\n\t\t\tint shortestDistance = searchDistance;\n\t\t\tDirection relativeShortestDirection = Direction.None, absoluteShortestDirection = Direction.None;\n\t\t\tVoxel.Coord shortestCoordinate = new Voxel.Coord();\n\t\t\tVoxel shortestMap = null;\n\n\t\t\tEffectBlockFactory blockFactory = Factory.Get<EffectBlockFactory>();\n\t\t\tforeach (Voxel map in Voxel.ActivePhysicsVoxels)\n\t\t\t{\n\t\t\t\tif (!ignoreTypes.Contains(map.Entity.Type))\n\t\t\t\t{\n\t\t\t\t\tList<Matrix> results = new List<Matrix>();\n\t\t\t\t\tVoxel.Coord absolutePlayerCoord = map.GetCoordinate(position);\n\t\t\t\t\tbool inMap = map.GetChunk(absolutePlayerCoord, false) != null;\n\t\t\t\t\tforeach (Direction absoluteDir in platformBuildableDirections)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord playerCoord = absoluteDir == Direction.NegativeY ? absolutePlayerCoord : map.GetCoordinate(position + new Vector3(0, platformSize / -2.0f, 0));\n\t\t\t\t\t\tDirection relativeDir = map.GetRelativeDirection(absoluteDir);\n\t\t\t\t\t\tif (!inMap && map.GetChunk(playerCoord.Move(relativeDir, searchDistance), false) == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tfor (int i = 1; i < shortestDistance; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord coord = playerCoord.Move(relativeDir, i);\n\t\t\t\t\t\t\tVoxel.State state = map[coord];\n\n\t\t\t\t\t\t\tif (state == Voxel.States.Empty)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif (this.canBuild(state) && this.canBuild(map.GetAbsolutePosition(coord)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tshortestDistance = i;\n\t\t\t\t\t\t\t\trelativeShortestDirection = relativeDir;\n\t\t\t\t\t\t\t\tabsoluteShortestDirection = absoluteDir;\n\t\t\t\t\t\t\t\tshortestCoordinate = playerCoord;\n\t\t\t\t\t\t\t\tshortestMap = map;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (shortestMap != null && shortestDistance > 1)\n\t\t\t{\n\t\t\t\tDirection yDir = relativeShortestDirection.IsParallel(Direction.PositiveY) ? Direction.PositiveX : Direction.PositiveY;\n\t\t\t\tDirection zDir = relativeShortestDirection.Cross(yDir);\n\n\t\t\t\tint initialOffset = absoluteShortestDirection == Direction.NegativeY ? 0 : -2;\n\t\t\t\tVoxel.Coord startCoord = shortestCoordinate.Move(relativeShortestDirection, initialOffset).Move(yDir, platformSize / -2).Move(zDir, platformSize / -2);\n\t\t\t\tVoxel.Coord endCoord = startCoord.Move(relativeShortestDirection, -initialOffset + shortestDistance).Move(yDir, platformSize).Move(zDir, platformSize);\n\n\t\t\t\treturn new Possibility\n\t\t\t\t{\n\t\t\t\t\tMap = shortestMap,\n\t\t\t\t\tStartCoord = new Voxel.Coord { X = Math.Min(startCoord.X, endCoord.X), Y = Math.Min(startCoord.Y, endCoord.Y), Z = Math.Min(startCoord.Z, endCoord.Z) },\n\t\t\t\t\tEndCoord = new Voxel.Coord { X = Math.Max(startCoord.X, endCoord.X), Y = Math.Max(startCoord.Y, endCoord.Y), Z = Math.Max(startCoord.Z, endCoord.Z) },\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate bool canBuild(Voxel.State s)\n\t\t{\n\t\t\treturn s != Voxel.States.Blue\n\t\t\t\t&& s != Voxel.States.Powered\n\t\t\t\t&& s != Voxel.States.Infected\n\t\t\t\t&& s != Voxel.States.HardInfected\n\t\t\t\t&& s != Voxel.States.SliderPowered\n\t\t\t\t&& s != Voxel.States.Slider\n\t\t\t\t&& s != Voxel.States.SocketBlue\n\t\t\t\t&& s != Voxel.States.SocketWhite\n\t\t\t\t&& s != Voxel.States.SocketYellow;\n\t\t}\n\n\t\tprivate bool canBuild(Vector3 pos)\n\t\t{\n\t\t\treturn Zone.CanBuild(pos) && Water.Get(pos) == null;\n\t\t}\n\n\t\t// Function for finding a wall to build for the player\n\t\tpublic Possibility FindWall(Vector3 position, Vector2 direction)\n\t\t{\n\t\t\tVoxel shortestMap = null;\n\t\t\tVoxel.Coord shortestPlayerCoord = new Voxel.Coord();\n\t\t\tDirection shortestWallDirection = Direction.None;\n\t\t\tDirection shortestBuildDirection = Direction.None;\n\t\t\tint shortestDistance = searchDistance;\n\n\t\t\tEffectBlockFactory blockFactory = Factory.Get<EffectBlockFactory>();\n\t\t\tforeach (Voxel map in Voxel.ActivePhysicsVoxels)\n\t\t\t{\n\t\t\t\tif (!ignoreTypes.Contains(map.Entity.Type))\n\t\t\t\t{\n\t\t\t\t\tforeach (Direction absoluteWallDir in DirectionExtensions.HorizontalDirections)\n\t\t\t\t\t{\n\t\t\t\t\t\tDirection relativeWallDir = map.GetRelativeDirection(absoluteWallDir);\n\t\t\t\t\t\tVector3 wallVector = map.GetAbsoluteVector(relativeWallDir.GetVector());\n\t\t\t\t\t\tfloat dot = Vector2.Dot(direction, Vector2.Normalize(new Vector2(wallVector.X, wallVector.Z)));\n\t\t\t\t\t\tif (dot > -0.25f && dot < 0.8f)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord coord = map.GetCoordinate(position).Move(relativeWallDir, 2);\n\t\t\t\t\t\t\tforeach (Direction dir in DirectionExtensions.Directions.Where(x => x.IsPerpendicular(relativeWallDir)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (int i = 0; i < shortestDistance; i++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tVoxel.Coord c = coord.Move(dir, i);\n\t\t\t\t\t\t\t\t\tVoxel.State state = map[c];\n\n\t\t\t\t\t\t\t\t\tif (state == Voxel.States.Empty)\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\t\tif (this.canBuild(state) && this.canBuild(map.GetAbsolutePosition(c)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tshortestMap = map;\n\t\t\t\t\t\t\t\t\t\tshortestBuildDirection = dir;\n\t\t\t\t\t\t\t\t\t\tshortestWallDirection = relativeWallDir;\n\t\t\t\t\t\t\t\t\t\tshortestDistance = i;\n\t\t\t\t\t\t\t\t\t\tshortestPlayerCoord = coord;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (shortestMap != null)\n\t\t\t{\n\t\t\t\t// Found something to build a wall on.\n\t\t\t\tDirection dirU = shortestBuildDirection;\n\t\t\t\tDirection dirV = dirU.Cross(shortestWallDirection);\n\t\t\t\tVoxel.Coord startCoord = shortestPlayerCoord.Move(dirU, shortestDistance).Move(dirV, additionalWallDistance);\n\t\t\t\tVoxel.Coord endCoord = shortestPlayerCoord.Move(dirU, -additionalWallDistance).Move(dirV, -additionalWallDistance).Move(shortestWallDirection);\n\t\t\t\treturn new Possibility\n\t\t\t\t{\n\t\t\t\t\tMap = shortestMap,\n\t\t\t\t\tStartCoord = new Voxel.Coord { X = Math.Min(startCoord.X, endCoord.X), Y = Math.Min(startCoord.Y, endCoord.Y), Z = Math.Min(startCoord.Z, endCoord.Z) },\n\t\t\t\t\tEndCoord = new Voxel.Coord { X = Math.Max(startCoord.X, endCoord.X), Y = Math.Max(startCoord.Y, endCoord.Y), Z = Math.Max(startCoord.Z, endCoord.Z) },\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate float getPredictionInterval(float speed)\n\t\t{\n\t\t\t// Interval is the time in seconds between locations where we will check for buildable platforms\n\t\t\treturn 0.3f * (8.0f / Math.Max(5.0f, this.LinearVelocity.Value.Length()));\n\t\t}\n\n\t\tprivate void predictJump(Queue<Prediction> predictions, Vector3 start, Vector3 v, int level)\n\t\t{\n\t\t\tfloat time = this.getPredictionInterval(v.Length());\n\t\t\twhile (time < (level == 0 ? 1.5f : 1.0f))\n\t\t\t{\n\t\t\t\tpredictions.Enqueue(new Prediction { Position = start + (v * time) + (time * time * 0.5f * main.Space.ForceUpdater.Gravity), Time = time, Level = level });\n\t\t\t\ttime += this.getPredictionInterval((v + main.Space.ForceUpdater.Gravity * time).Length());\n\t\t\t}\n\t\t}\n\n\t\tprivate Vector3 startSlowMo(Queue<Prediction> predictions)\n\t\t{\n\t\t\tVector3 straightAhead = Matrix.CreateRotationY(this.Rotation).Forward * -this.MaxSpeed;\n\t\t\tVector3 velocity;\n\t\t\tVector3 startPosition;\n\n\t\t\tif (this.IsSupported)\n\t\t\t{\n\t\t\t\tstartPosition = this.FootPosition + straightAhead;\n\n\t\t\t\tvelocity = (straightAhead * 0.5f) + new Vector3(0, this.JumpSpeed, 0);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstartPosition = this.FootPosition;\n\n\t\t\t\tvelocity = this.LinearVelocity;\n\t\t\t\tif (velocity.Length() < this.MaxSpeed * 0.25f)\n\t\t\t\t\tvelocity += straightAhead * 0.5f;\n\t\t\t}\n\n\t\t\tthis.predictJump(predictions, startPosition, velocity, 0);\n\n\t\t\tVector3 jumpVelocity = velocity;\n\t\t\tjumpVelocity.Y = this.JumpSpeed;\n\n\t\t\treturn jumpVelocity;\n\t\t}\n\n\t\tpublic void PredictPlatforms()\n\t\t{\n\t\t\tQueue<Prediction> predictions = new Queue<Prediction>();\n\t\t\tVector3 jumpVelocity = this.startSlowMo(predictions);\n\n\t\t\tfloat interval = this.getPredictionInterval(jumpVelocity.Length());\n\n\t\t\tfloat[] lastPredictionHit = new float[] { 0.0f, 0.0f };\n\n\t\t\twhile (predictions.Count > 0)\n\t\t\t{\n\t\t\t\tPrediction prediction = predictions.Dequeue();\n\n\t\t\t\tif (prediction.Time > lastPredictionHit[prediction.Level] + (interval * 1.5f))\n\t\t\t\t{\n\t\t\t\t\tPossibility possibility = this.FindPlatform(prediction.Position);\n\t\t\t\t\tif (possibility != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tlastPredictionHit[prediction.Level] = prediction.Time;\n\t\t\t\t\t\tthis.AddPossibility(possibility);\n\t\t\t\t\t\tif (prediction.Level == 0)\n\t\t\t\t\t\t\tthis.predictJump(predictions, prediction.Position, jumpVelocity, prediction.Level + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void PredictWalls()\n\t\t{\n\t\t\t// Predict block possibilities\n\t\t\tQueue<Prediction> predictions = new Queue<Prediction>();\n\t\t\tthis.startSlowMo(predictions);\n\t\t\tMatrix rotationMatrix = Matrix.CreateRotationY(this.Rotation);\n\t\t\tVector2 direction = new Vector2(-rotationMatrix.Forward.X, -rotationMatrix.Forward.Z);\n\n\t\t\twhile (predictions.Count > 0)\n\t\t\t{\n\t\t\t\tPrediction prediction = predictions.Dequeue();\n\t\t\t\tPossibility possibility = this.FindWall(prediction.Position, direction);\n\t\t\t\tif (possibility != null)\n\t\t\t\t{\n\t\t\t\t\tthis.AddPossibility(possibility);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.possibilities.Count > 0)\n\t\t\t{\n\t\t\t\tthis.blockPossibilityLifetime += dt;\n\t\t\t\tif (this.blockPossibilityLifetime > blockPossibilityTotalLifetime)\n\t\t\t\t\tthis.ClearPossibilities();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfloat alpha;\n\t\t\t\t\tif (this.blockPossibilityLifetime < blockPossibilityFadeInTime)\n\t\t\t\t\t\talpha = blockPossibilityInitialAlpha * (this.blockPossibilityLifetime / blockPossibilityFadeInTime);\n\t\t\t\t\telse\n\t\t\t\t\t\talpha = blockPossibilityInitialAlpha * (1.0f - (this.blockPossibilityLifetime / blockPossibilityTotalLifetime));\n\n\t\t\t\t\tVector3 offset = new Vector3(this.blockPossibilityLifetime * 0.2f);\n\t\t\t\t\tforeach (Possibility block in this.possibilities.Values.SelectMany(x => x))\n\t\t\t\t\t{\n\t\t\t\t\t\tblock.Model.Alpha.Value = alpha;\n\t\t\t\t\t\tblock.Model.GetVector3Parameter(\"Offset\").Value = offset;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Player/CameraController.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Lemma.Util;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class CameraController : Component<Main>, IUpdateableComponent\n\t{\n\t\tprivate Noise3D noise;\n\n\t\tprivate float shakeTime = 0.0f;\n\t\tprivate const float totalShakeTime = 0.5f;\n\t\tprivate float shakeAmount;\n\n\t\t// Input commands\n\t\t[XmlIgnore]\n\t\tpublic Command<Vector3, float> Shake = new Command<Vector3, float>();\n\n\t\t// Input properties\n\t\t[XmlIgnore]\n\t\tpublic Property<float> BaseCameraShakeAmount = new Property<float>();\n\t\tpublic Property<float> CameraShakeAmount = new Property<float>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> CameraBone = new Property<Matrix>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> HeadBone = new Property<Matrix>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> ModelTransform = new Property<Matrix>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector2> Mouse = new Property<Vector2>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\t\t[XmlIgnore]\n\t\tpublic Property<float> MaxSpeed = new Property<float>();\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> ThirdPerson = new Property<bool>();\n\t\t[XmlIgnore]\n\t\tpublic Property<float> Lean = new Property<float>();\n\t\t[XmlIgnore]\n\t\tpublic Vector3 Offset;\n\n\t\t// Output properties\n\t\tpublic Property<float> TotalCameraShake = new Property<float>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Serialize = false;\n\t\t\tthis.noise = new Noise3D();\n\t\t\tthis.Add(new CommandBinding(this.Disable, delegate()\n\t\t\t{\n\t\t\t\tthis.main.Renderer.SpeedBlurAmount.Value = 0;\n\t\t\t}));\n\n\t\t\tthis.Shake.Action = delegate(Vector3 pos, float size)\n\t\t\t{\n\t\t\t\tfloat targetShake = Math.Max(0.0f, 1.0f - ((pos - main.Camera.Position).Length() / size));\n\t\t\t\tthis.shakeAmount = Math.Max(this.shakeAmount * this.blendShake(), targetShake);\n\t\t\t\tthis.shakeTime = totalShakeTime;\n\t\t\t};\n\t\t}\n\n\t\tprivate float blendShake() // hehe\n\t\t{\n\t\t\tfloat x = this.shakeTime / CameraController.totalShakeTime;\n\t\t\t// x starts at 1 and goes down to 0\n\t\t\tif (x > 0.75f)\n\t\t\t\treturn 1.0f - ((x - 0.75f) / 0.25f);\n\t\t\telse\n\t\t\t\treturn x / 0.75f;\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tVector2 mouse = this.Mouse;\n\t\t\tVector3 shake = Vector3.Zero;\n\t\t\tfloat finalShakeAmount = this.BaseCameraShakeAmount + this.CameraShakeAmount;\n\t\t\tif (this.shakeTime > 0.0f)\n\t\t\t{\n\t\t\t\tfinalShakeAmount += this.shakeAmount * this.blendShake();\n\t\t\t\tthis.shakeTime -= dt;\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis.shakeAmount = 0.0f;\n\n\t\t\tthis.TotalCameraShake.Value = finalShakeAmount;\n\t\t\tif (finalShakeAmount > 0.0f)\n\t\t\t{\n\t\t\t\tfloat offset = main.TotalTime * 15.0f;\n\t\t\t\tshake = new Vector3(this.noise.Sample(new Vector3(offset)), this.noise.Sample(new Vector3(offset + 64)), noise.Sample(new Vector3(offset + 128))) * finalShakeAmount * 0.3f;\n\t\t\t}\n\n\t\t\tVector3 cameraPosition = Vector3.Transform(this.Offset, Matrix.CreateRotationY((float)Math.PI) * this.HeadBone.Value * this.ModelTransform);\n\n\t\t\tif (this.ThirdPerson)\n\t\t\t{\n\t\t\t\tcameraPosition = Vector3.Transform(new Vector3(0.0f, 3.0f, 0.0f), this.ModelTransform);\n\n\t\t\t\tmain.Camera.Angles.Value = new Vector3(-mouse.Y + shake.X, mouse.X + (float)Math.PI * 1.0f + shake.Y, shake.Z);\n\n\t\t\t\tVoxel.GlobalRaycastResult hit = Voxel.GlobalRaycast(cameraPosition, -main.Camera.Forward.Value, 5.0f);\n\n\t\t\t\tfloat cameraDistance = 4.0f;\n\t\t\t\tif (hit.Voxel != null)\n\t\t\t\t\tcameraDistance = (hit.Position - cameraPosition).Length() - 1.0f;\n\t\t\t\tmain.Camera.Position.Value = cameraPosition + (main.Camera.Right.Value * cameraDistance * -0.25f) + (main.Camera.Forward.Value * -cameraDistance);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tMatrix cameraOrientation = this.CameraBone.Value * Matrix.CreateRotationY(mouse.X + shake.X);\n\n\t\t\t\tmain.Camera.Position.Value = cameraPosition;\n\n\t\t\t\tMatrix rot = Matrix.Identity;\n\t\t\t\trot.Forward = Vector3.Normalize(Vector3.TransformNormal(new Vector3(0, 1.0f, 0), cameraOrientation));\n\t\t\t\trot.Up = Vector3.Normalize(Vector3.TransformNormal(new Vector3(0.0f, 0, 1.0f), cameraOrientation));\n\t\t\t\trot.Right = Vector3.Normalize(Vector3.Cross(rot.Forward, rot.Up));\n\n\t\t\t\tmain.Camera.RotationMatrix.Value = rot * Matrix.CreateFromAxisAngle(rot.Forward, shake.Z + this.Lean) * Matrix.CreateFromAxisAngle(rot.Right, -mouse.Y + shake.Y);\n\t\t\t}\n\n\t\t\tfloat minBlur = 4.0f;\n\t\t\tfloat maxBlur = this.MaxSpeed.Value + 2.0f;\n\t\t\tfloat speed = Math.Abs(Vector3.Dot(this.LinearVelocity.Value, main.Camera.Forward));\n\t\t\tmain.Renderer.SpeedBlurAmount.Value = Math.Min(1.0f, Math.Max(0.0f, (speed - minBlur) / (maxBlur - minBlur)));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/Character.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing BEPUphysics.UpdateableSystems;\nusing BEPUphysics.Entities.Prefabs;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionRuleManagement;\nusing BEPUphysics.Entities;\nusing BEPUphysics;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Lemma.Components;\nusing BEPUphysics.CollisionTests;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Util\n{\n\tpublic class Character : Updateable, IEndOfTimeStepUpdateable\n\t{\n\t\tpublic const float DefaultMaxSpeed = 8.8f;\n\t\tpublic const float DefaultJumpSpeed = 9.5f;\n\t\tpublic const float DefaultRadius = 1.75f * 0.5f;\n\t\tpublic const float DefaultHeight = 2.75f;\n\t\tpublic const float DefaultCrouchedHeight = 1.7f;\n\t\tpublic const float DefaultSupportHeight = 1.25f;\n\t\tpublic const float DefaultCrouchedSupportHeight = 0.5f;\n\t\tpublic const float DefaultTotalHeight = DefaultHeight + DefaultSupportHeight;\n\t\tpublic const float DefaultCrouchedTotalHeight = DefaultCrouchedHeight + DefaultCrouchedSupportHeight;\n\t\tpublic const float DefaultMass = 4.0f;\n\n\t\tpublic const float InitialAccelerationSpeedThreshold = 4.0f;\n\n\t\t/// <summary>\n\t\t/// A box positioned relative to the character's body used to identify collision pairs with nearby objects that could be possibly stood upon.\n\t\t/// </summary>\n\t\tprivate Box collisionPairCollector;\n\n\t\t/// <summary>\n\t\t/// The distance above the ground that the bottom of the character's body floats.\n\t\t/// </summary>\n\t\tpublic Property<float> SupportHeight = new Property<float>();\n\n\t\t/// <summary>\n\t\t/// Rate of increase in the character's speed in the movementDirection.\n\t\t/// </summary>\n\t\tpublic Property<float> Acceleration = new Property<float> { Value = 4.5f };\n\n\t\tpublic Property<float> InitialAcceleration = new Property<float> { Value = 25.0f };\n\n\t\t/// <summary>\n\t\t/// The character's physical representation that handles iteractions with the environment.\n\t\t/// </summary>\n\t\t[XmlIgnore]\n\t\tpublic Capsule Body;\n\n\t\t/// <summary>\n\t\t/// Whether or not the character is currently standing on anything that can be walked upon.\n\t\t/// False if there exists no support or the support is too heavily sloped, otherwise true.\n\t\t/// </summary>\n\t\tpublic Property<bool> HasTraction = new Property<bool>();\n\n\t\t/// <summary>\n\t\t/// Whether or not the character is currently standing on anything.\n\t\t/// </summary>\n\t\tpublic Property<bool> IsSupported = new Property<bool>();\n\n\t\tpublic Property<bool> IsSwimming = new Property<bool>();\n\n\t\t/// <summary>\n\t\t/// Initial vertical speed when jumping.\n\t\t/// </summary>\n\t\tpublic Property<float> JumpSpeed = new Property<float> { Value = Character.DefaultJumpSpeed };\n\n\t\t// Input property\n\t\tpublic Property<WallRun.State> WallRunState = new Property<WallRun.State>();\n\n\t\t/// <summary>\n\t\t/// The maximum slope under which walking forces can be applied.\n\t\t/// </summary>\n\t\tpublic Property<float> MaxSlope = new Property<float> { Value = (float)Math.PI * 0.3f };\n\n\t\t/// <summary>\n\t\t/// Maximum speed in the movementDirection that can be attained.\n\t\t/// </summary>\n\t\tpublic Property<float> MaxSpeed = new Property<float> { Value = 8 };\n\n\t\t/// <summary>\n\t\t/// Normalized direction which the character tries to move.\n\t\t/// </summary>\n\t\tpublic Property<Vector2> MovementDirection = new Property<Vector2> { Value = Vector2.Zero };\n\n\t\tpublic Property<bool> SwimUp = new Property<bool>();\n\n\t\tpublic Property<float> Height = new Property<float>();\n\t\tpublic Property<float> Radius = new Property<float>();\n\t\tpublic Property<float> Mass = new Property<float>();\n\n\t\t/// <summary>\n\t\t/// Deceleration applied to oppose horizontal movement when the character does not have a steady foothold on the ground (hasTraction == false).\n\t\t/// </summary>\n\t\tpublic Property<float> SlidingDeceleration = new Property<float> { Value = 0.3f };\n\n\t\tpublic Property<float> NoTractionAcceleration = new Property<float> { Value = 7.0f };\n\n\t\tpublic Property<Vector3> VelocityAdjustments = new Property<Vector3>();\n\n\t\t/// <summary>\n\t\t/// Deceleration applied to oppose uncontrolled horizontal movement when the character has a steady foothold on the ground (hasTraction == true).\n\t\t/// </summary>\n\t\tpublic Property<float> TractionDeceleration = new Property<float> { Value = 100.0f };\n\n\t\tpublic Property<bool> EnableWalking = new Property<bool> { Value = true };\n\n\t\t/// <summary>\n\t\t/// The location of the player's feet.\n\t\t/// </summary>\n\t\tpublic Property<Vector3> SupportLocation = new Property<Vector3>();\n\n\t\tpublic Property<Vector3> SupportVelocity = new Property<Vector3>();\n\n\t\tpublic Property<Matrix> Transform = new Property<Matrix>();\n\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\n\t\t/// <summary>\n\t\t/// The physics entity the player is currently standing on.\n\t\t/// </summary>\n\t\tpublic Property<BEPUphysics.Entities.Entity> SupportEntity = new Property<BEPUphysics.Entities.Entity>();\n\n\t\tpublic Command<Collidable, ContactCollection> Collided = new Command<Collidable, ContactCollection>();\n\n\t\tpublic float NormalHeight;\n\t\tpublic float NormalSupportHeight;\n\n\t\tpublic float CrouchedHeight;\n\t\tpublic float CrouchedSupportHeight;\n\n\t\tpublic Property<bool> Crouched = new Property<bool>();\n\t\tpublic Property<bool> AllowUncrouch = new Property<bool>();\n\n\t\tprivate Vector3[] rayOffsets;\n\n\t\tpublic static readonly CollisionGroup NoCollideGroup = new CollisionGroup();\n\t\tpublic static readonly CollisionGroup CharacterGroup = new CollisionGroup();\n\n\t\tstatic Character()\n\t\t{\n\t\t\tCollisionRules.CollisionGroupRules.Add(new CollisionGroupPair(Character.NoCollideGroup, Character.CharacterGroup), CollisionRule.NoBroadPhase);\n\t\t}\n\n\t\tprivate float edgeTimer;\n\t\tprivate const float edgeTime = 0.3f; // For a split second after walking off an edge, pretend like we're still supported\n\n\t\tprivate Main main;\n\n\t\t/// <summary>\n\t\t/// Constructs a simple character controller.\n\t\t/// </summary>\n\t\t/// <param name=\"position\">Location to initially place the character.</param>\n\t\t/// <param name=\"height\">The height of the character.</param>\n\t\t/// <param name=\"radius\">The diameter of the character.</param>\n\t\t/// <param name=\"supportHeight\">The distance above the ground that the bottom of the character's body floats.</param>\n\t\t/// <param name=\"mass\">Total mass of the character.</param>\n\t\tpublic Character(Main main, Bindable bindable, Vector3 position, float height = Character.DefaultHeight, float crouchedHeight = Character.DefaultCrouchedHeight, float radius = Character.DefaultRadius, float supportHeight = Character.DefaultSupportHeight, float crouchedSupportHeight = Character.DefaultCrouchedSupportHeight, float mass = Character.DefaultMass)\n\t\t{\n\t\t\tthis.main = main;\n\t\t\tthis.Radius.Value = radius;\n\t\t\tthis.Mass.Value = mass;\n\t\t\tthis.Body = new Capsule(position, height, radius, mass);\n\t\t\tthis.Body.Tag = this;\n\t\t\tthis.Body.CollisionInformation.Tag = this;\n\t\t\tthis.Body.IgnoreShapeChanges = true;\n\t\t\tthis.Body.LinearDamping = 0.0f;\n\t\t\tthis.Body.CollisionInformation.CollisionRules.Group = Character.CharacterGroup;\n\t\t\tthis.NormalHeight = height;\n\t\t\tthis.CrouchedHeight = crouchedHeight;\n\t\t\tthis.Body.CollisionInformation.Events.ContactCreated += new BEPUphysics.BroadPhaseEntries.Events.ContactCreatedEventHandler<EntityCollidable>(Events_ContactCreated);\n\t\t\tthis.collisionPairCollector = new Box(position + new Vector3(0, (height * -0.5f) - supportHeight, 0), radius * 2, supportHeight * 2, radius, 1);\n\t\t\tthis.collisionPairCollector.CollisionInformation.CollisionRules.Personal = CollisionRule.NoNarrowPhaseUpdate; //Prevents collision detection/contact generation from being run.\n\t\t\tthis.collisionPairCollector.IsAffectedByGravity = false;\n\t\t\tthis.collisionPairCollector.CollisionInformation.CollisionRules.Group = Character.CharacterGroup;\n\t\t\tCollisionRules.AddRule(this.collisionPairCollector, this.Body, CollisionRule.NoBroadPhase); //Prevents the creation of any collision pairs between the body and the collector.\n\t\t\tthis.SupportHeight.Value = supportHeight;\n\t\t\tthis.NormalSupportHeight = supportHeight;\n\t\t\tthis.CrouchedSupportHeight = crouchedSupportHeight;\n\n\t\t\tthis.Body.LocalInertiaTensorInverse = new BEPUutilities.Matrix3x3();\n\t\t\tthis.collisionPairCollector.LocalInertiaTensorInverse = new BEPUutilities.Matrix3x3();\n\n\t\t\tbindable.Add(new ChangeBinding<bool>(this.Crouched, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (value && !old)\n\t\t\t\t{\n\t\t\t\t\tthis.Body.Position += new Vector3(0, (this.CrouchedSupportHeight - this.NormalSupportHeight) + 0.5f * (this.CrouchedHeight - this.NormalHeight), 0);\n\t\t\t\t\tthis.Height.Value = this.CrouchedHeight;\n\t\t\t\t\tthis.Body.Length = this.Height.Value - this.Radius * 2;\n\t\t\t\t\tthis.SupportHeight.Value = this.CrouchedSupportHeight;\n\t\t\t\t}\n\t\t\t\telse if (!value && old)\n\t\t\t\t{\n\t\t\t\t\tthis.Height.Value = this.NormalHeight;\n\t\t\t\t\tthis.Body.Length = this.Height.Value - this.Radius * 2;\n\t\t\t\t\tthis.Body.Position += new Vector3(0, (this.NormalSupportHeight - this.CrouchedSupportHeight) + 0.5f * (this.NormalHeight - this.CrouchedHeight), 0);\n\t\t\t\t\tthis.SupportHeight.Value = this.NormalSupportHeight;\n\t\t\t\t}\n\t\t\t\tthis.collisionPairCollector.Height = this.SupportHeight * 2;\n\t\t\t\tthis.Transform.Value = this.Body.WorldTransform;\n\t\t\t}));\n\n\t\t\tbindable.Add(new SetBinding<Matrix>(this.Transform, delegate(Matrix m)\n\t\t\t{\n\t\t\t\tthis.Body.WorldTransform = m;\n\t\t\t}));\n\n\t\t\tbindable.Add(new SetBinding<Vector3>(this.LinearVelocity, delegate(Vector3 v)\n\t\t\t{\n\t\t\t\tthis.Body.LinearVelocity = v;\n\t\t\t}));\n\n\t\t\t//Make the body slippery.\n\t\t\t//Note that this will not make all collisions have zero friction;\n\t\t\t//the friction coefficient between a pair of objects is based\n\t\t\t//on a blending of the two objects' materials.\n\t\t\tthis.Body.Material.KineticFriction = 0.0f;\n\t\t\tthis.Body.Material.StaticFriction = 0.0f;\n\t\t\tthis.Body.Material.Bounciness = 0.0f;\n\n\t\t\tconst int rayChecks = 4;\n\t\t\tfloat rayCheckRadius = radius - 0.1f;\n\t\t\tthis.rayOffsets = new[] { Vector3.Zero }.Concat(Enumerable.Range(0, rayChecks).Select(\n\t\t\tdelegate(int x)\n\t\t\t{\n\t\t\t\tfloat angle = x * ((2.0f * (float)Math.PI) / (float)rayChecks);\n\t\t\t\treturn new Vector3((float)Math.Cos(angle) * rayCheckRadius, 0, (float)Math.Sin(angle) * rayCheckRadius);\n\t\t\t})).ToArray();\n\t\t\tthis.IsUpdating = false;\n\t\t}\n\n\t\tprivate void Events_ContactCreated(EntityCollidable sender, Collidable other, BEPUphysics.NarrowPhaseSystems.Pairs.CollidablePairHandler pair, BEPUphysics.CollisionTests.ContactData contact)\n\t\t{\n\t\t\tthis.Collided.Execute(other, pair.Contacts);\n\t\t}\n\n\t\tprivate bool lastSupported = true;\n\t\tpublic Property<float> LastSupportedSpeed = new Property<float>();\n\t\t/// <summary>\n\t\t/// Handles the updating of the character.  Called by the owning space object when necessary.\n\t\t/// </summary>\n\t\t/// <param name=\"dt\">Simulation seconds since the last update.</param>\n\t\tvoid IEndOfTimeStepUpdateable.Update(float dt)\n\t\t{\n\t\t\tBEPUphysics.Entities.Entity supportEntity;\n\t\t\tobject supportEntityTag;\n\t\t\tVector3 supportLocation, supportNormal;\n\t\t\tfloat supportDistance;\n\n\t\t\tbool foundSupport = this.findSupport(out supportEntityTag, out supportEntity, out supportLocation, out supportNormal, out supportDistance);\n\n\t\t\tif (!foundSupport && this.WallRunState.Value == WallRun.State.None)\n\t\t\t{\n\t\t\t\t// Keep the player from getting stuck on corners\n\t\t\t\tforeach (Contact contact in this.Body.CollisionInformation.Pairs.SelectMany(x => x.Contacts.Select(y => y.Contact)))\n\t\t\t\t{\n\t\t\t\t\tVector3 normal = (contact.Position - this.Body.Position).SetComponent(Direction.PositiveY, 0);\n\t\t\t\t\tfloat length = normal.Length();\n\t\t\t\t\tif (length > 0.5f)\n\t\t\t\t\t\tthis.Body.LinearVelocity += -0.1f * (normal / length);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Support location only has velocity if we're actually sitting on an entity, as opposed to some static geometry.\n\t\t\t// linear velocity of point on body relative to center\n\t\t\tVector3 supportLocationVelocity;\n\t\t\tif (supportEntity != null)\n\t\t\t{\n\t\t\t\tsupportLocationVelocity = supportEntity.LinearVelocity // linear component\n\t\t\t\t\t+ Vector3.Cross(supportEntity.AngularVelocity, supportLocation - supportEntity.Position);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tVoxel supportVoxel = supportEntityTag as Voxel;\n\t\t\t\tif (supportVoxel == null)\n\t\t\t\t\tsupportLocationVelocity = Vector3.Zero;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsupportLocationVelocity = supportVoxel.LinearVelocity // linear component\n\t\t\t\t\t\t+ Vector3.Cross(supportVoxel.AngularVelocity, supportLocation - supportVoxel.Transform.Value.Translation);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\n\t\t\tif (supportLocationVelocity.Y < this.Body.LinearVelocity.Y - 4.0f)\n\t\t\t\tfoundSupport = false;\n\n\t\t\tif (!this.IsSwimming && foundSupport)\n\t\t\t{\n\t\t\t\tthis.SupportEntity.Value = supportEntity;\n\t\t\t\tthis.SupportLocation.Value = supportLocation;\n\t\t\t\tthis.SupportVelocity.Value = supportLocationVelocity;\n\t\t\t\tthis.IsSupported.Value = true;\n\t\t\t\tthis.lastSupported = true;\n\t\t\t\tthis.support(supportLocationVelocity, supportNormal, supportDistance, dt);\n\t\t\t\tthis.HasTraction.Value = this.isSupportSlopeWalkable(supportNormal);\n\t\t\t\tthis.handleHorizontalMotion(supportLocationVelocity, supportNormal, dt);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (this.lastSupported)\n\t\t\t\t{\n\t\t\t\t\tthis.LastSupportedSpeed.Value = new Vector2(this.Body.LinearVelocity.X, this.Body.LinearVelocity.Z).Length();\n\t\t\t\t\tthis.lastSupported = false;\n\t\t\t\t\tthis.edgeTimer = 0;\n\t\t\t\t}\n\n\t\t\t\tthis.edgeTimer += dt;\n\t\t\t\tif (this.edgeTimer > edgeTime)\n\t\t\t\t{\n\t\t\t\t\tthis.SupportEntity.Value = null;\n\t\t\t\t\tthis.SupportVelocity.Value = Vector3.Zero;\n\t\t\t\t\tthis.IsSupported.Value = false;\n\t\t\t\t\tthis.HasTraction.Value = false;\n\t\t\t\t}\n\n\t\t\t\tif (this.EnableWalking)\n\t\t\t\t{\n\t\t\t\t\tif (this.IsSwimming)\n\t\t\t\t\t\tthis.handleNoTraction(dt, this.TractionDeceleration * 0.7f, this.MaxSpeed * 0.7f, this.SwimUp);\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.handleNoTraction(dt, 0.0f, this.LastSupportedSpeed, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.Crouched && this.AllowUncrouch)\n\t\t\t{\n\t\t\t\t// Try to uncrouch\n\n\t\t\t\tVector3 rayOrigin = this.Body.Position;\n\n\t\t\t\tbool foundCeiling = false;\n\n\t\t\t\tforeach (Vector3 rayStart in this.rayOffsets.Select(x => x + rayOrigin))\n\t\t\t\t{\n\t\t\t\t\tRayCastResult rayHit;\n\t\t\t\t\tif (this.main.Space.RayCast(new Ray(rayStart, Vector3.Up), (this.NormalHeight * 0.5f) + (this.NormalSupportHeight - this.SupportHeight), Character.raycastFilter, out rayHit))\n\t\t\t\t\t{\n\t\t\t\t\t\tfoundCeiling = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!foundCeiling)\n\t\t\t\t\tthis.Crouched.Value = false;\n\t\t\t}\n\t\t\telse if (!this.Crouched && this.IsSupported)\n\t\t\t{\n\t\t\t\t// Keep the player from fitting into spaces that are too small vertically\n\t\t\t\tVector3 pos = this.Body.Position;\n\t\t\t\tVector2 offset = new Vector2(supportLocation.X - pos.X, supportLocation.Z - pos.Z);\n\t\t\t\tif (offset.LengthSquared() > 0)\n\t\t\t\t{\n\t\t\t\t\tRayCastResult rayHit;\n\t\t\t\t\tVector3 rayStart = supportLocation;\n\t\t\t\t\trayStart.Y = pos.Y + (this.Height * 0.5f) - 1.0f;\n\t\t\t\t\tif (this.main.Space.RayCast(new Ray(rayStart, Vector3.Up), 1.0f, Character.raycastFilter, out rayHit))\n\t\t\t\t\t{\n\t\t\t\t\t\toffset.Normalize();\n\t\t\t\t\t\tVector2 velocity = new Vector2(this.Body.LinearVelocity.X, this.Body.LinearVelocity.Z);\n\t\t\t\t\t\tfloat speed = Vector2.Dot(velocity, offset);\n\t\t\t\t\t\tif (speed > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvelocity -= offset * speed * 1.5f;\n\t\t\t\t\t\t\tthis.Body.LinearVelocity = new Vector3(velocity.X, this.Body.LinearVelocity.Y, velocity.Y);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.collisionPairCollector.LinearVelocity = this.Body.LinearVelocity;\n\t\t\tthis.collisionPairCollector.Position = this.Body.Position + new Vector3(0, (this.Height * -0.5f) - this.SupportHeight, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Locates the closest support entity by performing a raycast at collected candidates.\n\t\t/// </summary>\n\t\t/// <param name=\"supportEntity\">The closest supporting entity.</param>\n\t\t/// <param name=\"supportLocation\">The support location where the ray hit the entity.</param>\n\t\t/// <param name=\"supportNormal\">The normal at the surface where the ray hit the entity.</param>\n\t\t/// <param name=\"supportDistance\">Distance from the character to the support location.</param>\n\t\t/// <returns>Whether or not a support was located.</returns>\n\t\tprivate bool findSupport(out object supportEntityTag, out BEPUphysics.Entities.Entity supportEntity, out Vector3 supportLocation, out Vector3 supportNormal, out float supportDistance)\n\t\t{\n\t\t\tsupportEntity = null;\n\t\t\tsupportEntityTag = null;\n\t\t\tsupportLocation = BEPUutilities.Toolbox.NoVector;\n\t\t\tsupportNormal = BEPUutilities.Toolbox.NoVector;\n\t\t\tsupportDistance = float.MaxValue;\n\n\t\t\tconst float fudgeFactor = 0.1f;\n\t\t\tVector3 rayOrigin = this.Body.Position;\n\t\t\trayOrigin.Y += fudgeFactor + this.Height * -0.5f;\n\n\t\t\tfor (int i = 0; i < this.collisionPairCollector.CollisionInformation.Pairs.Count; i++)\n\t\t\t{\n\t\t\t\tvar pair = this.collisionPairCollector.CollisionInformation.Pairs[i];\n\t\t\t\t//Determine which member of the collision pair is the possible support.\n\t\t\t\tCollidable candidate = (pair.BroadPhaseOverlap.EntryA == collisionPairCollector.CollisionInformation ? pair.BroadPhaseOverlap.EntryB : pair.BroadPhaseOverlap.EntryA) as Collidable;\n\t\t\t\t//Ensure that the candidate is a valid supporting entity.\n\t\t\t\tif (candidate.CollisionRules.Personal >= CollisionRule.NoSolver)\n\t\t\t\t\tcontinue; //It is invalid!\n\n\t\t\t\tif (candidate.CollisionRules.Group == Character.NoCollideGroup)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t//The maximum length is supportHeight * 2 instead of supportHeight alone because the character should be able to step downwards.\n\t\t\t\t//This acts like a sort of 'glue' to help the character stick on the ground in general.\n\t\t\t\tfloat maximumDistance;\n\t\t\t\t//The 'glue' effect should only occur if the character has a solid hold on the ground though.\n\t\t\t\t//Otherwise, the character is falling or sliding around uncontrollably.\n\t\t\t\tif (this.HasTraction && !this.IsSwimming)\n\t\t\t\t\tmaximumDistance = fudgeFactor + (this.SupportHeight * 2.0f);\n\t\t\t\telse\n\t\t\t\t\tmaximumDistance = fudgeFactor + this.SupportHeight;\n\n\t\t\t\tforeach (Vector3 rayStart in this.rayOffsets.Select(x => x + rayOrigin))\n\t\t\t\t{\n\t\t\t\t\tBEPUutilities.RayHit rayHit;\n\t\t\t\t\t// Fire a ray at the candidate and determine some details!\n\t\t\t\t\tif (candidate.RayCast(new Ray(rayStart, Vector3.Down), maximumDistance, out rayHit))\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 n = Vector3.Normalize(rayHit.Normal);\n\n\t\t\t\t\t\tif (n.Y > supportNormal.Y)\n\t\t\t\t\t\t\tsupportNormal = n;\n\n\t\t\t\t\t\t// We want to find the closest support, so compare it against the last closest support.\n\t\t\t\t\t\tif (rayHit.T < supportDistance && n.Y > 0.25f)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsupportDistance = rayHit.T - fudgeFactor;\n\t\t\t\t\t\t\tsupportLocation = rayHit.Location;\n\t\t\t\t\t\t\tif (rayHit.T < 0.0f)\n\t\t\t\t\t\t\t\tsupportNormal = Vector3.Up;\n\n\t\t\t\t\t\t\tvar entityInfo = candidate as EntityCollidable;\n\t\t\t\t\t\t\tif (entityInfo != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsupportEntity = entityInfo.Entity;\n\t\t\t\t\t\t\t\tsupportEntityTag = supportEntity != null ? supportEntity.Tag : candidate.Tag;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tsupportEntityTag = candidate.Tag;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool isSupported = supportDistance < float.MaxValue;\n\t\t\treturn isSupported;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determines if the ground supporting the character is sloped gently enough to allow for normal walking.\n\t\t/// </summary>\n\t\t/// <param name=\"supportNormal\">Normal of the surface being stood upon.</param>\n\t\t/// <returns>Whether or not the slope is walkable.</returns>\n\t\tprivate bool isSupportSlopeWalkable(Vector3 supportNormal)\n\t\t{\n\t\t\t//The following operation is equivalent to performing a dot product between the support normal and Vector3.Down and finding the angle it represents using Acos.\n\t\t\treturn Math.Acos(Math.Abs(Math.Min(supportNormal.Y, 1))) <= this.MaxSlope;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Maintains the position of the character's body above the ground.\n\t\t/// </summary>\n\t\t/// <param name=\"supportLocationVelocity\">Velocity of the support point connected to the supportEntity.</param>\n\t\t/// <param name=\"supportNormal\">The normal at the surface where the ray hit the entity.</param>\n\t\t/// <param name=\"supportDistance\">Distance from the character to the support location.</param>\n\t\tprivate void support(Vector3 supportLocationVelocity, Vector3 supportNormal, float supportDistance, float dt)\n\t\t{\n\t\t\t//Put the character at the right distance from the ground.\n\t\t\tfloat supportVerticalVelocity = Math.Max(supportLocationVelocity.Y, -0.1f);\n\t\t\tfloat heightDifference = this.SupportHeight - supportDistance;\n\t\t\tthis.Body.Position += (new Vector3(0, MathHelper.Clamp(heightDifference, (supportVerticalVelocity - 10.0f) * dt, (supportVerticalVelocity + 10.0f) * dt), 0));\n\n\t\t\t//Remove from the character velocity which would push it toward or away from the surface.\n\t\t\t//This is a relative velocity, so the velocity of the body and the velocity of a point on the support entity must be found.\n\t\t\tfloat bodyNormalVelocity = Vector3.Dot(this.Body.LinearVelocity, supportNormal);\n\t\t\tfloat supportEntityNormalVelocity = Vector3.Dot(supportLocationVelocity, supportNormal);\n\t\t\tVector3 diff = (bodyNormalVelocity - supportEntityNormalVelocity) * -supportNormal;\n\t\t\tdiff.Y = Math.Max(diff.Y, 0);\n\t\t\tthis.Body.LinearVelocity += diff;\n\n\t\t\tBEPUphysics.Entities.Entity supportEntity = this.SupportEntity;\n\t\t\tif (supportEntity != null && supportEntity.IsAffectedByGravity)\n\t\t\t{\n\t\t\t\tVector3 supportLocation = this.SupportLocation;\n\t\t\t\tVector3 impulse = (this.Body.Mass * 1.5f) * ((Space)this.Space).ForceUpdater.Gravity * dt;\n\t\t\t\tsupportEntity.ApplyImpulse(ref supportLocation, ref impulse);\n\t\t\t\tsupportEntity.ActivityInformation.Activate();\n\t\t\t}\n\t\t}\n\n\t\tprivate static Func<BEPUphysics.BroadPhaseEntries.BroadPhaseEntry, bool> raycastFilter = a => a.CollisionRules.Group != Character.CharacterGroup && a.CollisionRules.Group != Character.NoCollideGroup;\n\n\t\tprivate bool slide(ref Vector2 movement, Vector3 wallRay)\n\t\t{\n\t\t\tRayCastResult rayHit;\n\t\t\tif (this.main.Space.RayCast(new Ray(this.Body.Position, wallRay), this.Radius + 0.25f, Character.raycastFilter, out rayHit)\n\t\t\t\t|| this.main.Space.RayCast(new Ray(this.Body.Position + new Vector3(0, 1, 0), wallRay), this.Radius + 0.25f, Character.raycastFilter, out rayHit)\n\t\t\t\t|| this.main.Space.RayCast(new Ray(this.Body.Position + new Vector3(0, -1, 0), wallRay), this.Radius + 0.25f, Character.raycastFilter, out rayHit))\n\t\t\t{\n\t\t\t\tVector3 orthogonal = Vector3.Cross(rayHit.HitData.Normal, wallRay);\n\t\t\t\tVector3 newMovement3 = Vector3.Cross(rayHit.HitData.Normal, orthogonal);\n\t\t\t\tVector2 newMovement = new Vector2(newMovement3.X, newMovement3.Z);\n\t\t\t\tnewMovement.Normalize();\n\t\t\t\tif (Vector2.Dot(newMovement, movement) < 0)\n\t\t\t\t\tnewMovement *= -1.0f;\n\n\t\t\t\tif (Vector2.Dot(newMovement, movement) > 0.5f) // The new direction is similar to what we want. Go ahead.\n\t\t\t\t{\n\t\t\t\t\tnewMovement *= movement.Length();\n\t\t\t\t\tmovement = newMovement;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn false; // New direction is too different. Continue in the old direction.\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Manages movement acceleration, deceleration, and sliding.\n\t\t/// </summary>\n\t\t/// <param name=\"supportLocationVelocity\">Velocity of the support point connected to the supportEntity.</param>\n\t\t/// <param name=\"supportNormal\">The normal at the surface where the ray hit the entity.</param>\n\t\t/// <param name=\"dt\">Timestep of the simulation.</param>\n\t\tprivate void handleHorizontalMotion(Vector3 supportLocationVelocity, Vector3 supportNormal, float dt)\n\t\t{\n\t\t\tVector3 velocityAdjustment = new Vector3(0.0f);\n\t\t\tif (this.HasTraction && this.MovementDirection != Vector2.Zero && this.EnableWalking)\n\t\t\t{\n\t\t\t\t// Identify a coordinate system that uses the support normal as Y.\n\t\t\t\t// X is the axis point along the left (negative) and right (positive) relative to the movement direction.\n\t\t\t\t// Z points forward (positive) and backward (negative) in the movement direction modified to be parallel to the surface.\n\n\t\t\t\tVector2 movement = this.MovementDirection;\n\t\t\t\tif (!this.slide(ref movement, new Vector3(movement.X, 0, movement.Y)))\n\t\t\t\t{\n\t\t\t\t\tfloat angle = (float)Math.Atan2(movement.Y, movement.X);\n\t\t\t\t\tif (!this.slide(ref movement, new Vector3((float)Math.Cos(angle + (float)Math.PI * 0.25f), 0, (float)Math.Sin(angle + (float)Math.PI * 0.25f))))\n\t\t\t\t\t\tthis.slide(ref movement, new Vector3((float)Math.Cos(angle - (float)Math.PI * 0.25f), 0, (float)Math.Sin(angle - (float)Math.PI * 0.25f)));\n\t\t\t\t}\n\n\t\t\t\tVector3 horizontal = new Vector3(movement.X, 0, movement.Y);\n\t\t\t\tVector3 x = Vector3.Normalize(Vector3.Cross(horizontal, supportNormal));\n\t\t\t\tVector3 z = Vector3.Normalize(Vector3.Cross(supportNormal, x)) * horizontal.Length();\n\n\t\t\t\tVector2 netVelocity = new Vector2(this.Body.LinearVelocity.X - supportLocationVelocity.X, this.Body.LinearVelocity.Z - supportLocationVelocity.Z);\n\t\t\t\tfloat accel;\n\t\t\t\tif (Vector2.Dot(new Vector2(horizontal.X, horizontal.Z), netVelocity) < 0)\n\t\t\t\t\taccel = this.TractionDeceleration;\n\t\t\t\telse if (netVelocity.Length() < Character.InitialAccelerationSpeedThreshold)\n\t\t\t\t\taccel = this.InitialAcceleration;\n\t\t\t\telse\n\t\t\t\t\taccel = this.Acceleration;\n\t\t\t\taccel += Math.Abs(Vector2.Dot(new Vector2(x.X, x.Z), netVelocity)) * this.Acceleration * 2.0f;\n\n\t\t\t\t// Remove from the character a portion of velocity which pushes it horizontally off the desired movement track defined by the movementDirection.\n\n\t\t\t\tfloat bodyXVelocity = Vector3.Dot(this.Body.LinearVelocity, x);\n\t\t\t\tfloat supportEntityXVelocity = Vector3.Dot(supportLocationVelocity, x);\n\t\t\t\tfloat velocityChange = MathHelper.Clamp(bodyXVelocity - supportEntityXVelocity, -dt * this.TractionDeceleration, dt * this.TractionDeceleration);\n\t\t\t\tvelocityAdjustment -= velocityChange * x;\n\n\t\t\t\tfloat bodyZVelocity = Vector3.Dot(this.Body.LinearVelocity, z);\n\t\t\t\tfloat supportEntityZVelocity = Vector3.Dot(supportLocationVelocity, z);\n\t\t\t\tfloat netZVelocity = bodyZVelocity - supportEntityZVelocity;\n\n\t\t\t\t// The velocity difference along the Z axis should accelerate/decelerate to match the goal velocity (max speed).\n\t\t\t\tfloat speed = this.Crouched ? this.MaxSpeed * 0.3f : this.MaxSpeed;\n\t\t\t\tif (netZVelocity > speed)\n\t\t\t\t{\n\t\t\t\t\t// Decelerate\n\t\t\t\t\tvelocityChange = Math.Min(dt * this.TractionDeceleration, netZVelocity - speed);\n\t\t\t\t\tvelocityAdjustment -= velocityChange * z;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Accelerate\n\t\t\t\t\tvelocityChange = Math.Min(dt * accel, speed - netZVelocity);\n\t\t\t\t\tvelocityAdjustment += velocityChange * z;\n\t\t\t\t\tif (z.Y > 0.0f)\n\t\t\t\t\t\tvelocityAdjustment += new Vector3(0, z.Y * Math.Min(dt * this.Acceleration * 2.0f, speed - netZVelocity) * 2.0f, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfloat deceleration;\n\t\t\t\tif (this.HasTraction)\n\t\t\t\t\tdeceleration = dt * this.TractionDeceleration;\n\t\t\t\telse\n\t\t\t\t\tdeceleration = dt * this.SlidingDeceleration;\n\t\t\t\t// Remove from the character a portion of velocity defined by the deceleration.\n\t\t\t\tVector3 bodyHorizontalVelocity = this.Body.LinearVelocity - Vector3.Dot(this.Body.LinearVelocity, supportNormal) * supportNormal;\n\t\t\t\tVector3 supportHorizontalVelocity = supportLocationVelocity - Vector3.Dot(supportLocationVelocity, supportNormal) * supportNormal;\n\t\t\t\tVector3 relativeVelocity = bodyHorizontalVelocity - supportHorizontalVelocity;\n\t\t\t\tfloat speed = relativeVelocity.Length();\n\t\t\t\tif (speed > 0)\n\t\t\t\t{\n\t\t\t\t\tVector3 horizontalDirection = relativeVelocity / speed;\n\t\t\t\t\tfloat velocityChange = Math.Min(speed, deceleration);\n\t\t\t\t\tvelocityAdjustment -= velocityChange * horizontalDirection;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.Body.LinearVelocity += velocityAdjustment;\n\t\t\tthis.VelocityAdjustments.Value = velocityAdjustment;\n\t\t}\n\n\t\tprivate void handleNoTraction(float dt, float tractionDeceleration, float maxSpeed, bool swimUp)\n\t\t{\n\t\t\tVector3 velocityAdjustment = new Vector3(0.0f);\n\t\t\tif (this.MovementDirection != Vector2.Zero)\n\t\t\t{\n\t\t\t\t//Identify a coordinate system that uses the support normal as Y.\n\t\t\t\t//X is the axis point along the left (negative) and right (positive) relative to the movement direction.\n\t\t\t\t//Z points forward (positive) and backward (negative) in the movement direction modified to be parallel to the surface.\n\t\t\t\tVector3 horizontal = new Vector3(this.MovementDirection.Value.X, 0, this.MovementDirection.Value.Y);\n\t\t\t\tVector3 x = Vector3.Cross(horizontal, Vector3.Up);\n\n\t\t\t\t//Remove from the character a portion of velocity which pushes it horizontally off the desired movement track defined by the movementDirection.\n\t\t\t\tfloat bodyXVelocity = Vector3.Dot(this.Body.LinearVelocity, x);\n\t\t\t\tfloat velocityChange = MathHelper.Clamp(bodyXVelocity, -dt * tractionDeceleration, dt * tractionDeceleration);\n\t\t\t\tvelocityAdjustment -= velocityChange * x;\n\n\t\t\t\tfloat bodyZVelocity = Vector3.Dot(this.Body.LinearVelocity, horizontal);\n\t\t\t\t//The velocity difference along the Z axis should accelerate/decelerate to match the goal velocity (max speed).\n\t\t\t\tif (bodyZVelocity > maxSpeed)\n\t\t\t\t{\n\t\t\t\t\t//Decelerate\n\t\t\t\t\tvelocityChange = Math.Min(dt * this.NoTractionAcceleration, bodyZVelocity - maxSpeed);\n\t\t\t\t\tvelocityAdjustment -= velocityChange * horizontal;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//Accelerate\n\t\t\t\t\tvelocityChange = Math.Min(dt * this.NoTractionAcceleration, maxSpeed - bodyZVelocity);\n\t\t\t\t\tvelocityAdjustment += velocityChange * horizontal;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfloat deceleration = dt * tractionDeceleration;\n\t\t\t\t// Remove from the character a portion of velocity defined by the deceleration.\n\t\t\t\tVector3 bodyHorizontalVelocity = this.Body.LinearVelocity;\n\t\t\t\tbodyHorizontalVelocity.Y = 0.0f;\n\t\t\t\tfloat speed = bodyHorizontalVelocity.Length();\n\t\t\t\tif (speed > 0)\n\t\t\t\t{\n\t\t\t\t\tVector3 horizontalDirection = bodyHorizontalVelocity / speed;\n\t\t\t\t\tfloat velocityChange = Math.Min(speed, deceleration);\n\t\t\t\t\tvelocityAdjustment -= velocityChange * horizontalDirection;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (swimUp)\n\t\t\t\tvelocityAdjustment += new Vector3(0, 7.0f * dt, 0);\n\n\t\t\tthis.VelocityAdjustments.Value = velocityAdjustment;\n\t\t\tthis.Body.LinearVelocity += velocityAdjustment;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Activates the character, adding its components to the space. \n\t\t/// </summary>\n\t\tpublic void Activate()\n\t\t{\n\t\t\tif (!this.IsUpdating)\n\t\t\t{\n\t\t\t\tthis.IsUpdating = true;\n\t\t\t\tif (this.Body.Space == null)\n\t\t\t\t{\n\t\t\t\t\tthis.Space.Add(this.Body);\n\t\t\t\t\tthis.Space.Add(this.collisionPairCollector);\n\t\t\t\t}\n\t\t\t\tthis.HasTraction.Value = false;\n\t\t\t\tthis.IsSupported.Value = false;\n\t\t\t\tthis.Body.LinearVelocity = Vector3.Zero;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Deactivates the character, removing its components from the space.\n\t\t/// </summary>\n\t\tpublic void Deactivate()\n\t\t{\n\t\t\tif (this.IsUpdating)\n\t\t\t{\n\t\t\t\tthis.IsUpdating = false;\n\t\t\t\tthis.Body.Position = new Vector3(10000, 0, 0);\n\t\t\t\tif (this.Body.Space != null)\n\t\t\t\t{\n\t\t\t\t\tthis.Body.Space.Remove(this.Body);\n\t\t\t\t\tthis.collisionPairCollector.Space.Remove(this.collisionPairCollector);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Called by the engine when the character is added to the space.\n\t\t/// Activates the character.\n\t\t/// </summary>\n\t\t/// <param name=\"newSpace\">Space to which the character was added.</param>\n\t\tpublic override void OnAdditionToSpace(ISpace newSpace)\n\t\t{\n\t\t\tbase.OnAdditionToSpace(newSpace); //sets this object's space to the newSpace.\n\t\t\tthis.Activate();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Called by the engine when the character is removed from the space.\n\t\t/// Deactivates the character.\n\t\t/// </summary>\n\t\tpublic override void OnRemovalFromSpace(ISpace oldSpace)\n\t\t{\n\t\t\tthis.Deactivate();\n\t\t\tbase.OnRemovalFromSpace(oldSpace); //Sets this object's space to null.\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/FPSCamera.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Lemma.Util;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class FPSCamera : Component<Main>, IUpdateableComponent\n\t{\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector2> Mouse = new Property<Vector2>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector2> Movement = new Property<Vector2>();\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> Up = new Property<bool>();\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> Down = new Property<bool>();\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> SpeedMode = new Property<bool>();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Serialize = false;\n\t\t\tthis.Add(new CommandBinding(this.Enable, delegate()\n\t\t\t{\n\t\t\t\tthis.main.Renderer.SpeedBlurAmount.Value = 0;\n\t\t\t}));\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tVector2 movement2 = this.Movement;\n\t\t\tVector3 movement3 = Vector3.TransformNormal(new Vector3(movement2.X, 0, -movement2.Y), this.main.Camera.RotationMatrix);\n\t\t\tif (this.Up)\n\t\t\t\tmovement3 = movement3.SetComponent(Direction.PositiveY, 1.0f);\n\t\t\telse if (this.Down)\n\t\t\t\tmovement3 = movement3.SetComponent(Direction.NegativeY, 1.0f);\n\t\t\tthis.main.Camera.Position.Value += movement3 * (this.SpeedMode ? 30.0f : 15.0f) * dt;\n\n\t\t\tVector2 mouse = this.Mouse;\n\t\t\tthis.main.Camera.Angles.Value = new Vector3(-mouse.Y, mouse.X, 0.0f);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/FallDamage.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class FallDamage : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic const float DamageVelocity = -20.0f; // Vertical velocity below which damage occurs\n\t\tpublic const float RollingDamageVelocity = -28.0f; // Damage velocity when rolling\n\t\tpublic const float DamageMultiplier = 0.2f;\n\t\tpublic const float DeathVelocity = DamageVelocity - (1.0f / DamageMultiplier);\n\t\tpublic const float RollingDeathVelocity = RollingDamageVelocity - (1.0f / DamageMultiplier);\n\n\t\t// Input commands\n\t\tpublic Command<float> Apply = new Command<float>();\n\t\tpublic Command<BEPUphysics.BroadPhaseEntries.Collidable, ContactCollection> Collided = new Command<BEPUphysics.BroadPhaseEntries.Collidable,ContactCollection>();\n\n\t\t// Output commands\n\t\tpublic Command<float> Rumble = new Command<float>();\n\t\tpublic Command LockRotation = new Command();\n\t\tpublic Property<bool> Landing = new Property<bool>();\n\n\t\t// Input properties\n\t\tpublic Property<bool> IsSupported = new Property<bool>();\n\t\tpublic Property<bool> PhoneOrNoteActive = new Property<bool>();\n\n\t\tprivate bool lastSupported;\n\n\t\tprivate float landingTimer;\n\n\t\tprivate const float landingTime = 0.75f;\n\n\t\t// Animated model\n\t\tpublic void Bind(AnimatedModel m)\n\t\t{\n\t\t\tthis.model = m;\n\t\t\tm[\"Land\"].Strength = m[\"Land\"].TargetStrength = 0.7f;\n\t\t\tthis.landAnimation = m[\"LandHard\"];\n\t\t\tthis.landAnimation.GetChannel(m.GetBoneIndex(\"ORG-hips\")).Filter = delegate(Matrix hips)\n\t\t\t{\n\t\t\t\tfloat t = (float)this.landAnimation.CurrentTime.TotalSeconds;\n\t\t\t\thips.Translation += new Vector3(0, Math.Max(0.0f, 1.0f - (t > 0.75f ? t - 0.75f : 0)), 0);\n\t\t\t\treturn hips;\n\t\t\t};\n\t\t\tthis.landAnimation.Speed = 1.5f;\n\t\t}\n\n\t\tprivate AnimatedModel model;\n\t\tprivate SkinnedModel.Clip landAnimation;\n\n\t\t// Output properties\n\t\tpublic Property<float> Health = new Property<float>();\n\t\tpublic Property<bool> EnableWalking = new Property<bool>();\n\t\tpublic Property<bool> EnableMoves = new Property<bool>();\n\t\tpublic Command<float> PhysicsDamage = new Command<float>(); // Damage incurred from physics stuff smashing us\n\n\t\t// Input/output properties\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\n\t\tprivate Vector3 lastLinearVelocity;\n\t\tprivate bool disabledMoves;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Serialize = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Apply.Action = delegate(float verticalAcceleration) { this.apply(verticalAcceleration, false); };\n\n\t\t\t// Damage the player if they hit something too hard\n\t\t\tthis.Collided.Action = delegate(BEPUphysics.BroadPhaseEntries.Collidable other, ContactCollection contacts)\n\t\t\t{\n\t\t\t\tDynamicVoxel map = other.Tag as DynamicVoxel;\n\t\t\t\tif (map != null)\n\t\t\t\t{\n\t\t\t\t\tfloat force = contacts[contacts.Count - 1].NormalImpulse;\n\t\t\t\t\tfloat threshold = map.Dangerous ? 20.0f : 50.0f;\n\t\t\t\t\tfloat playerLastSpeed = Vector3.Dot(this.lastLinearVelocity, Vector3.Normalize(-contacts[contacts.Count - 1].Contact.Normal)) * 2.5f;\n\t\t\t\t\tif (force > threshold + playerLastSpeed + 4.0f)\n\t\t\t\t\t\tthis.PhysicsDamage.Execute((force - threshold - playerLastSpeed) * 0.04f);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tpublic bool ApplyJump()\n\t\t{\n\t\t\treturn this.apply(this.lastLinearVelocity.Y - this.LinearVelocity.Value.Y, true);\n\t\t}\n\n\t\tprivate bool apply(float verticalAcceleration, bool jumping)\n\t\t{\n\t\t\tbool rolling = this.model.IsPlaying(\"Roll\") || this.model.IsPlaying(\"Kick\");\n\t\t\tfloat v = rolling ? RollingDamageVelocity : DamageVelocity;\n\t\t\tbool grunted = false;\n\t\t\tif (verticalAcceleration < v)\n\t\t\t{\n\t\t\t\tfloat damage = (verticalAcceleration - v) * DamageMultiplier;\n\t\t\t\tgrunted = damage < 0.0f;\n\t\t\t\tthis.Health.Value += damage;\n\t\t\t\t// Health component will take care of rumble\n\t\t\t\tif (this.Health.Value <= 0.0f)\n\t\t\t\t{\n\t\t\t\t\tmain.Spawner.RespawnDistance = Spawner.DefaultRespawnDistance;\n\t\t\t\t\tmain.Spawner.RespawnInterval = Spawner.DefaultRespawnInterval;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!rolling && !jumping)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.LinearVelocity.Value = new Vector3(0, this.LinearVelocity.Value.Y, 0);\n\t\t\t\t\t\tthis.Landing.Value = true;\n\t\t\t\t\t\tthis.LockRotation.Execute();\n\t\t\t\t\t\tthis.landingTimer = 0;\n\t\t\t\t\t\tthis.model.StartClip(\"LandHard\", 0, false, 0.1f);\n\t\t\t\t\t\tthis.EnableWalking.Value = false;\n\t\t\t\t\t\tthis.EnableMoves.Value = false;\n\t\t\t\t\t\tthis.disabledMoves = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (verticalAcceleration < -5.0f)\n\t\t\t{\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_CLOTHING, this.Entity);\n\t\t\t\tif (verticalAcceleration < -13.0f)\n\t\t\t\t{\n\t\t\t\t\tif (!rolling)\n\t\t\t\t\t\tthis.model.StartClip(\"Land\", 4);\n\t\t\t\t\tthis.Rumble.Execute(0.2f);\n\n\t\t\t\t\tif (verticalAcceleration < -16.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_LAND, this.Entity);\n\t\t\t\t\t\tgrunted = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn grunted;\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.Landing)\n\t\t\t{\n\t\t\t\tthis.landingTimer += dt;\n\t\t\t\tif (this.landingTimer > landingTime)\n\t\t\t\t\tthis.Landing.Value = false;\n\t\t\t}\n\n\t\t\tif (!this.lastSupported && this.IsSupported)\n\t\t\t{\n\t\t\t\t// Damage the player if they fall too hard and they're not smashing or rolling\n\t\t\t\tfloat accel = this.lastLinearVelocity.Y - this.LinearVelocity.Value.Y;\n\t\t\t\tthis.Apply.Execute(accel);\n\t\t\t}\n\n\t\t\tif (this.disabledMoves && (!this.landAnimation.Active || this.landAnimation.CurrentTime.TotalSeconds > 1.0f))\n\t\t\t{\n\t\t\t\t// We disabled walking while the land animation was playing.\n\t\t\t\t// Now re-enable it\n\t\t\t\tif (!this.PhoneOrNoteActive)\n\t\t\t\t{\n\t\t\t\t\tthis.EnableWalking.Value = true;\n\t\t\t\t\tthis.EnableMoves.Value = true;\n\t\t\t\t}\n\t\t\t\tthis.disabledMoves = false;\n\t\t\t}\n\n\t\t\tthis.lastSupported = this.IsSupported;\n\t\t\tthis.lastLinearVelocity = this.LinearVelocity;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tif (!this.PhoneOrNoteActive)\n\t\t\t{\n\t\t\t\tthis.EnableWalking.Value = true;\n\t\t\t\tthis.EnableMoves.Value = true;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/Footsteps.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Lemma.Util;\nusing System.Xml.Serialization;\nusing Lemma.Factories;\n\nnamespace Lemma.Components\n{\n\tpublic class RespawnLocation\n\t{\n\t\tpublic Entity.Handle Map;\n\t\tpublic Voxel.Coord Coordinate;\n\t\tpublic float Rotation;\n\t\tpublic Vector3 OriginalPosition;\n\t}\n\n\tpublic class Footsteps : Component<Main>, IUpdateableComponent\n\t{\n\t\t// Input commands\n\t\t[XmlIgnore]\n\t\tpublic Command Footstep = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Property<WallRun.State> WallRunState = new Property<WallRun.State>();\n\n\t\t// Output commands\n\t\t[XmlIgnore]\n\t\tpublic Command<Voxel, Voxel.Coord, Direction> WalkedOn = new Command<Voxel, Voxel.Coord, Direction>();\n\n\t\t// Input properties\n\t\tpublic Property<bool> SoundEnabled = new Property<bool>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<float> Rotation = new Property<float>();\n\t\tpublic Property<float> CharacterHeight = new Property<float>();\n\t\tpublic Property<float> SupportHeight = new Property<float>();\n\t\tpublic Property<bool> IsSupported = new Property<bool>();\n\t\tpublic Property<bool> IsSwimming = new Property<bool>();\n\n\t\t// Output properties\n\t\tpublic ListProperty<RespawnLocation> RespawnLocations = new ListProperty<RespawnLocation>();\n\n\t\t// Input/output properties\n\t\tpublic Command<float> Damage = new Command<float>();\n\n\t\tprivate Voxel.GlobalRaycastResult groundRaycast;\n\t\tprivate bool lastSupported;\n\n\t\tprivate int walkedOnCount;\n\t\tprivate float lastFootstepSound = -1.0f;\n\t\tprivate const float footstepSoundInterval = 0.1f;\n\t\tprivate bool infectedDamage;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Serialize = false;\n\t\n\t\t\tthis.Footstep.Action = delegate()\n\t\t\t{\n\t\t\t\tif (this.SoundEnabled && this.main.TotalTime - this.lastFootstepSound > footstepSoundInterval)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.FOOTSTEP_PLAY, this.Entity);\n\t\t\t\t\tthis.lastFootstepSound = this.main.TotalTime;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.Add(new CommandBinding<Voxel, Voxel.Coord, Direction>(this.WalkedOn, delegate(Voxel map, Voxel.Coord coord, Direction dir)\n\t\t\t{\n\t\t\t\tVoxel.State state = map[coord];\n\n\t\t\t\tif (state != Voxel.States.Empty)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.SetSwitch(AK.SWITCHES.FOOTSTEP_MATERIAL.GROUP, state.FootstepSwitch, this.Entity);\n\n\t\t\t\t\tif (this.WallRunState.Value == WallRun.State.None)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (map.GetAbsoluteDirection(dir) == Direction.NegativeY && !this.IsSwimming)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.walkedOnCount++;\n\t\t\t\t\t\t\tif (this.walkedOnCount >= 2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Every few tiles, save off the location for the auto-respawn system\n\t\t\t\t\t\t\t\tcoord.Data = null;\n\t\t\t\t\t\t\t\tthis.RespawnLocations.Add(new RespawnLocation\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tCoordinate = coord,\n\t\t\t\t\t\t\t\t\tMap = map.Entity,\n\t\t\t\t\t\t\t\t\tRotation = this.Rotation,\n\t\t\t\t\t\t\t\t\tOriginalPosition = map.GetAbsolutePosition(coord),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\twhile (this.RespawnLocations.Length > Spawner.RespawnMemoryLength)\n\t\t\t\t\t\t\t\t\tthis.RespawnLocations.RemoveAt(0);\n\t\t\t\t\t\t\t\tthis.walkedOnCount = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tVoxel.t id = state.ID;\n\t\t\t\tif (id == Voxel.t.Neutral)\n\t\t\t\t{\n\t\t\t\t\tmap.Empty(coord, false, true, map);\n\t\t\t\t\tbool isPowered = false;\n\t\t\t\t\tfor (int i = 0; i < 6; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord adjacentCoord = coord.Move(DirectionExtensions.Directions[i]);\n\t\t\t\t\t\tVoxel.t adjacentId = map[coord].ID;\n\t\t\t\t\t\tif (adjacentId == Voxel.t.Powered || adjacentId == Voxel.t.PermanentPowered || adjacentId == Voxel.t.PoweredSwitch || adjacentId == Voxel.t.HardPowered)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tisPowered = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmap.Fill(coord, isPowered ? Voxel.States.Powered : Voxel.States.Blue);\n\t\t\t\t\tmap.Regenerate();\n\t\t\t\t\tWorldFactory.Instance.Get<Propagator>().Sparks(map.GetAbsolutePosition(coord), Propagator.Spark.Normal);\n\t\t\t\t}\n\t\t\t\telse if (id == Voxel.t.Reset)\n\t\t\t\t{\n\t\t\t\t\tbool regenerate = false;\n\n\t\t\t\t\tQueue<Voxel.Coord> queue = new Queue<Voxel.Coord>();\n\t\t\t\t\tqueue.Enqueue(coord);\n\t\t\t\t\tVoxel.CoordSetCache.Add(coord);\n\t\t\t\t\twhile (queue.Count > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord c = queue.Dequeue();\n\t\t\t\t\t\tfor (int i = 0; i < 6; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord adjacentCoord = c.Move(DirectionExtensions.Directions[i]);\n\t\t\t\t\t\t\tif (!Voxel.CoordSetCache.Contains(adjacentCoord))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tVoxel.CoordSetCache.Add(adjacentCoord);\n\t\t\t\t\t\t\t\tVoxel.t adjacentID = map[adjacentCoord].ID;\n\t\t\t\t\t\t\t\tif (adjacentID == Voxel.t.Reset || adjacentID == Voxel.t.Hard)\n\t\t\t\t\t\t\t\t\tqueue.Enqueue(adjacentCoord);\n\t\t\t\t\t\t\t\telse if (adjacentID == Voxel.t.Infected || adjacentID == Voxel.t.Blue || adjacentID == Voxel.t.Powered)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacentCoord, false, true, map);\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacentCoord, Voxel.States.Neutral);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (adjacentID == Voxel.t.HardPowered || adjacentID == Voxel.t.HardInfected)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmap.Empty(adjacentCoord, false, true, map);\n\t\t\t\t\t\t\t\t\tmap.Fill(adjacentCoord, Voxel.States.Hard);\n\t\t\t\t\t\t\t\t\tregenerate = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tVoxel.CoordSetCache.Clear();\n\t\t\t\t\tif (regenerate)\n\t\t\t\t\t\tmap.Regenerate();\n\t\t\t\t}\n\n\t\t\t\t// Lava. Damage the player character if it steps on lava.\n\t\t\t\tbool isInfected = id == Voxel.t.Infected || id == Voxel.t.HardInfected;\n\t\t\t\tif (isInfected)\n\t\t\t\t\tthis.Damage.Execute(0.2f);\n\t\t\t\telse if (id == Voxel.t.Floater)\n\t\t\t\t{\n\t\t\t\t\t// Floater. Delete the block after a delay.\n\t\t\t\t\tVector3 pos = map.GetAbsolutePosition(coord);\n\t\t\t\t\tParticleEmitter.Emit(main, \"Smoke\", pos, 1.0f, 10);\n\t\t\t\t\tSound.PostEvent(AK.EVENTS.PLAY_CRUMBLE, pos);\n\t\t\t\t\tWorldFactory.Instance.Add(new Animation\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Delay(0.5f),\n\t\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (map[coord].ID == Voxel.t.Floater)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmap.Empty(coord);\n\t\t\t\t\t\t\t\tmap.Regenerate();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t\tthis.infectedDamage = isInfected;\n\t\t\t}));\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tVoxel oldMap = this.groundRaycast.Voxel;\n\t\t\tVoxel.Coord? oldCoord = this.groundRaycast.Coordinate;\n\t\t\t\n\t\t\tDirection direction;\n\n\t\t\t// Wall-run code will call our WalkedOn event for us, so only worry about this stuff if we're walking normally\n\t\t\tif (this.WallRunState == WallRun.State.None)\n\t\t\t{\n\t\t\t\tthis.groundRaycast = Voxel.GlobalRaycast(this.Position, Vector3.Down, this.CharacterHeight.Value * 0.5f + this.SupportHeight + 1.1f);\n\t\t\t\tdirection = this.groundRaycast.Normal.GetReverse();\n\n\t\t\t\tif (this.groundRaycast.Voxel != null &&\n\t\t\t\t\t(this.groundRaycast.Voxel != oldMap || oldCoord == null || !oldCoord.Value.Equivalent(this.groundRaycast.Coordinate.Value)))\n\t\t\t\t{\n\t\t\t\t\tthis.WalkedOn.Execute(this.groundRaycast.Voxel, this.groundRaycast.Coordinate.Value, direction);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.IsSupported && !this.lastSupported)\n\t\t\t\tthis.Footstep.Execute();\n\n\t\t\tif (this.infectedDamage && (this.IsSupported || this.WallRunState != WallRun.State.None))\n\t\t\t\tthis.Damage.Execute(0.6f * dt);\n\n\t\t\tthis.lastSupported = this.IsSupported;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/Jump.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Jump : Component<Main>\n\t{\n\t\tprivate Random random = new Random();\n\n\t\t// Input/output properties\n\t\tpublic Property<bool> IsSupported = new Property<bool>();\n\t\tpublic Property<bool> HasTraction = new Property<bool>();\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\t\tpublic Property<Vector3> SupportVelocity = new Property<Vector3>();\n\t\tpublic Property<BEPUphysics.Entities.Entity> SupportEntity = new Property<BEPUphysics.Entities.Entity>();\n\n\t\t// Input properties\n\t\tpublic Property<Vector2> AbsoluteMovementDirection = new Property<Vector2>();\n\t\tpublic Property<WallRun.State> WallRunState = new Property<WallRun.State>();\n\t\tpublic Property<float> Rotation = new Property<float>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<Vector3> FloorPosition = new Property<Vector3>();\n\t\tpublic Property<float> MaxSpeed = new Property<float>();\n\t\tpublic Property<float> JumpSpeed = new Property<float>();\n\t\tpublic Property<float> Mass = new Property<float>();\n\t\tpublic Property<float> LastRollKickEnded = new Property<float>();\n\t\tpublic Property<Voxel> WallRunMap = new Property<Voxel>();\n\t\tpublic Property<Direction> WallDirection = new Property<Direction>();\n\t\tpublic Property<bool> Crouched = new Property<bool>();\n\n\t\t// Output\n\t\tpublic Command<Voxel, Voxel.Coord, Direction> WalkedOn = new Command<Voxel, Voxel.Coord, Direction>();\n\t\tpublic Command DeactivateWallRun = new Command();\n\t\tpublic FallDamage FallDamage;\n\t\tpublic BlockPredictor Predictor;\n\n\t\tpublic Property<Voxel> LastWallRunMap = new Property<Voxel>();\n\t\tpublic Property<Direction> LastWallDirection = new Property<Direction>();\n\t\tpublic Property<bool> CanKick = new Property<bool>();\n\t\tpublic Property<float> LastWallJump = new Property<float> { Value = -1.0f };\n\t\tpublic Property<float> LastJump = new Property<float> { Value = -1.0f };\n\t\tpublic Property<float> LastSupportedSpeed = new Property<float>();\n\n\t\tprivate AnimatedModel model;\n\n\t\tpublic void Bind(AnimatedModel m)\n\t\t{\n\t\t\tFunc<Matrix, Matrix> filter = delegate(Matrix mat)\n\t\t\t{\n\t\t\t\tmat.Translation = new Vector3(0.0f, 0.2f, 2.0f);\n\t\t\t\treturn mat;\n\t\t\t};\n\t\t\tm[\"Jump\"].GetChannel(m.GetBoneIndex(\"ORG-hips\")).Filter = filter;\n\t\t\tm[\"Jump02\"].GetChannel(m.GetBoneIndex(\"ORG-hips\")).Filter = filter;\n\t\t\tm[\"Jump03\"].GetChannel(m.GetBoneIndex(\"ORG-hips\")).Filter = filter;\n\t\t\tm[\"JumpLeft\"].GetChannel(m.GetBoneIndex(\"ORG-hips\")).Filter = filter;\n\t\t\tm[\"JumpRight\"].GetChannel(m.GetBoneIndex(\"ORG-hips\")).Filter = filter;\n\t\t\tm[\"JumpBackward\"].GetChannel(m.GetBoneIndex(\"ORG-hips\")).Filter = filter;\n\t\t\tm[\"Fall\"].GetChannel(m.GetBoneIndex(\"ORG-hips\")).Filter = filter;\n\t\t\tthis.model = m;\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Serialize = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (this.IsSupported)\n\t\t\t\t\tthis.wallJumpCount = 0;\n\t\t\t}, this.IsSupported));\n\t\t}\n\n\t\tprivate int wallJumpCount;\n\t\tprivate Vector3 wallJumpChainStart;\n\n\t\tprivate const float jumpCoolDown = 0.3f;\n\n\t\tprivate string lastJumpAnimation;\n\t\tprivate string randomJumpAnimation()\n\t\t{\n\t\t\tstring anim;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tswitch (this.random.Next(3))\n\t\t\t\t{\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tanim = \"Jump02\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tanim = \"Jump03\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tanim = \"Jump\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (this.lastJumpAnimation == anim);\n\n\t\t\tthis.lastJumpAnimation = anim;\n\t\t\treturn anim;\n\t\t}\n\n\t\tpublic bool Go()\n\t\t{\n\t\t\tif (this.main.TotalTime - this.LastJump < jumpCoolDown || this.Crouched)\n\t\t\t\treturn false;\n\n\t\t\tbool supported = this.IsSupported;\n\n\t\t\tWallRun.State wallRunState = this.WallRunState;\n\n\t\t\tMatrix rotationMatrix = Matrix.CreateRotationY(this.Rotation);\n\t\t\tVector3 forward = -rotationMatrix.Forward;\n\n\t\t\tVector2 jumpDirection = this.AbsoluteMovementDirection;\n\n\t\t\tVector3 baseVelocity = Vector3.Zero;\n\n\t\t\tbool wallJumping = false;\n\n\t\t\tconst float wallJumpHorizontalVelocityAmount = 0.75f;\n\t\t\tconst float wallJumpDistance = 2.0f;\n\n\t\t\tAction<Voxel, Direction, Voxel.Coord> wallJump = delegate(Voxel wallJumpMap, Direction wallNormalDirection, Voxel.Coord wallCoordinate)\n\t\t\t{\n\t\t\t\tthis.LastWallRunMap.Value = wallJumpMap;\n\t\t\t\tthis.LastWallDirection.Value = wallNormalDirection.GetReverse();\n\t\t\t\tthis.LastWallJump.Value = main.TotalTime;\n\n\t\t\t\tVoxel.State wallType = wallJumpMap[wallCoordinate];\n\t\t\t\tif (wallType == Voxel.States.Empty) // Empty. Must be a block possibility that hasn't been instantiated yet\n\t\t\t\t\twallType = Voxel.States.Blue;\n\n\t\t\t\tthis.WalkedOn.Execute(wallJumpMap, wallCoordinate, wallNormalDirection.GetReverse());\n\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.FOOTSTEP_PLAY, this.Entity);\n\n\t\t\t\twallJumping = true;\n\t\t\t\t// Set up wall jump velocity\n\t\t\t\tVector3 absoluteWallNormal = wallJumpMap.GetAbsoluteVector(wallNormalDirection.GetVector());\n\t\t\t\tVector2 wallNormal2 = new Vector2(absoluteWallNormal.X, absoluteWallNormal.Z);\n\t\t\t\twallNormal2.Normalize();\n\n\t\t\t\tbool wallRunningStraight = wallRunState == WallRun.State.Straight || wallRunState == WallRun.State.Down;\n\t\t\t\tif (wallRunningStraight)\n\t\t\t\t\tjumpDirection = new Vector2(main.Camera.Forward.Value.X, main.Camera.Forward.Value.Z);\n\t\t\t\telse\n\t\t\t\t\tjumpDirection = new Vector2(forward.X, forward.Z);\n\n\t\t\t\tjumpDirection.Normalize();\n\n\t\t\t\tfloat dot = Vector2.Dot(wallNormal2, jumpDirection);\n\t\t\t\tif (dot < 0)\n\t\t\t\t\tjumpDirection = jumpDirection - (2.0f * dot * wallNormal2);\n\t\t\t\tjumpDirection *= wallJumpHorizontalVelocityAmount;\n\n\t\t\t\tif (!wallRunningStraight && Math.Abs(dot) < 0.5f)\n\t\t\t\t{\n\t\t\t\t\t// If we're jumping perpendicular to the wall, add some velocity so we jump away from the wall a bit\n\t\t\t\t\tjumpDirection += wallJumpHorizontalVelocityAmount * 0.75f * wallNormal2;\n\t\t\t\t}\n\n\t\t\t\tVector3 supportLocation = this.FloorPosition;\n\t\t\t\tbaseVelocity += wallJumpMap.LinearVelocity + Vector3.Cross(wallJumpMap.AngularVelocity, supportLocation - wallJumpMap.Transform.Value.Translation);\n\t\t\t};\n\n\t\t\tif (!supported && wallRunState == WallRun.State.None\n\t\t\t\t&& this.LinearVelocity.Value.Y > Lemma.Components.FallDamage.DamageVelocity * 1.5f)\n\t\t\t{\n\t\t\t\t// We're not doing our normal jump, and not wall-runnign\n\t\t\t\t// See if we can wall-jump\n\t\t\t\tVector3 playerPos = this.Position;\n\t\t\t\tVoxel.GlobalRaycastResult? closestWallRaycastHit = null;\n\t\t\t\tVector3 closestWallRaycastDirection = Vector3.Zero;\n\n\t\t\t\tforeach (Vector3 dir in new[] { rotationMatrix.Left, rotationMatrix.Right, rotationMatrix.Backward, rotationMatrix.Forward })\n\t\t\t\t{\n\t\t\t\t\tVoxel.GlobalRaycastResult hit = Voxel.GlobalRaycast(playerPos, dir, wallJumpDistance);\n\t\t\t\t\tif (hit.Voxel != null && (!closestWallRaycastHit.HasValue || hit.Distance < closestWallRaycastHit.Value.Distance))\n\t\t\t\t\t{\n\t\t\t\t\t\tclosestWallRaycastDirection = dir;\n\t\t\t\t\t\tclosestWallRaycastHit = hit;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (closestWallRaycastHit != null)\n\t\t\t\t{\n\t\t\t\t\tVoxel m = closestWallRaycastHit.Value.Voxel;\n\t\t\t\t\twallJump(m, closestWallRaycastHit.Value.Normal, closestWallRaycastHit.Value.Coordinate.Value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we're wall-running, we can wall-jump\n\t\t\t// Add some velocity so we jump away from the wall a bit\n\t\t\tif (wallRunState != WallRun.State.None)\n\t\t\t{\n\t\t\t\tVector3 pos = this.FloorPosition + new Vector3(0, 0.5f, 0);\n\t\t\t\tVoxel.Coord wallCoord = this.WallRunMap.Value.GetCoordinate(pos).Move(this.WallDirection, 2);\n\t\t\t\twallJump(this.WallRunMap, this.WallDirection.Value.GetReverse(), wallCoord);\n\t\t\t}\n\n\t\t\tbool go = supported || wallJumping;\n\n\t\t\tBlockPredictor.Possibility instantiatedBlockPossibility = null;\n\t\t\tVoxel.Coord instantiatedBlockPossibilityCoord = default(Voxel.Coord);\n\n\t\t\tif (!go)\n\t\t\t{\n\t\t\t\t// Check block possibilities beneath us\n\t\t\t\tVector3 jumpPos = this.FloorPosition + new Vector3(0, -1.0f, 0);\n\t\t\t\tforeach (BlockPredictor.Possibility possibility in this.Predictor.AllPossibilities)\n\t\t\t\t{\n\t\t\t\t\tVoxel.Coord possibilityCoord = possibility.Map.GetCoordinate(jumpPos);\n\t\t\t\t\tif (possibilityCoord.Between(possibility.StartCoord, possibility.EndCoord)\n\t\t\t\t\t\t&& !possibility.Map.GetCoordinate(jumpPos + new Vector3(2.0f)).Between(possibility.StartCoord, possibility.EndCoord))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Predictor.InstantiatePossibility(possibility);\n\t\t\t\t\t\tgo = true;\n\t\t\t\t\t\tinstantiatedBlockPossibility = possibility;\n\t\t\t\t\t\tinstantiatedBlockPossibilityCoord = possibilityCoord;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!go)\n\t\t\t{\n\t\t\t\t// Check block possibilities for wall jumping\n\t\t\t\tVector3 playerPos = this.Position;\n\t\t\t\tVector3[] wallJumpDirections = new[] { rotationMatrix.Left, rotationMatrix.Right, rotationMatrix.Forward };\n\t\t\t\tforeach (BlockPredictor.Possibility possibility in this.Predictor.AllPossibilities)\n\t\t\t\t{\n\t\t\t\t\tforeach (Vector3 dir in wallJumpDirections)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (Voxel.Coord coord in possibility.Map.Rasterize(playerPos, playerPos + (dir * wallJumpDistance)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (coord.Between(possibility.StartCoord, possibility.EndCoord))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.Predictor.InstantiatePossibility(possibility);\n\t\t\t\t\t\t\t\tinstantiatedBlockPossibility = possibility;\n\t\t\t\t\t\t\t\tinstantiatedBlockPossibilityCoord = coord;\n\t\t\t\t\t\t\t\twallJump(possibility.Map, possibility.Map.GetRelativeDirection(dir).GetReverse(), coord);\n\t\t\t\t\t\t\t\twallJumping = true;\n\t\t\t\t\t\t\t\tgo = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (wallJumping)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (wallJumping)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (go)\n\t\t\t{\n\t\t\t\tfloat totalMultiplier = 1.0f;\n\n\t\t\t\tbool grunted = false;\n\n\t\t\t\tif (wallJumping)\n\t\t\t\t{\n\t\t\t\t\tif (this.wallJumpCount == 0)\n\t\t\t\t\t\tthis.wallJumpChainStart = this.Position;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 chainDistance = this.Position - this.wallJumpChainStart;\n\t\t\t\t\t\tchainDistance.Y = 0.0f;\n\t\t\t\t\t\tif (chainDistance.Length() > 6.0f)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.wallJumpCount = 0;\n\t\t\t\t\t\t\tthis.wallJumpChainStart = this.Position;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.wallJumpCount > 3)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\ttotalMultiplier = 1.0f - Math.Min(1.0f, this.wallJumpCount / 8.0f);\n\t\t\t\t\tthis.wallJumpCount++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Regular jump\n\t\t\t\t\t// Take base velocity into account\n\t\t\t\t\tbaseVelocity += this.SupportVelocity;\n\n\t\t\t\t\tgrunted = this.FallDamage.ApplyJump();\n\t\t\t\t\tif (!this.Active) // We got killed by fall damage\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tif (instantiatedBlockPossibility != null)\n\t\t\t\t\t\tthis.WalkedOn.Execute(instantiatedBlockPossibility.Map, instantiatedBlockPossibilityCoord, instantiatedBlockPossibility.Map.GetRelativeDirection(Direction.NegativeY));\n\n\t\t\t\t\t// Also manually reset our ability to kick and wall-jump\n\t\t\t\t\tthis.CanKick.Value = true;\n\t\t\t\t\tthis.wallJumpCount = 0;\n\t\t\t\t}\n\n\t\t\t\tVector3 velocity = this.LinearVelocity - baseVelocity;\n\t\t\t\tfloat currentVerticalSpeed = velocity.Y;\n\t\t\t\tvelocity.Y = 0.0f;\n\t\t\t\tfloat jumpSpeed = jumpDirection.Length();\n\t\t\t\tif (jumpSpeed > 0)\n\t\t\t\t\tjumpDirection *= (wallJumping ? Math.Max(this.MaxSpeed, Vector3.Dot(forward, velocity)) : velocity.Length()) / jumpSpeed;\n\n\t\t\t\tif (main.TotalTime - this.LastRollKickEnded < 0.3f)\n\t\t\t\t\ttotalMultiplier *= 1.2f;\n\n\t\t\t\tfloat verticalJumpSpeed = this.JumpSpeed;\n\n\t\t\t\t// If we're not instantiating a block possibility beneath us or we're not currently falling, incorporate some of our existing vertical velocity in our jump\n\t\t\t\tif (instantiatedBlockPossibility == null || wallJumping || currentVerticalSpeed > 0.0f)\n\t\t\t\t\tverticalJumpSpeed += currentVerticalSpeed * 0.5f;\n\n\t\t\t\tthis.LinearVelocity.Value = baseVelocity + new Vector3(jumpDirection.X, verticalJumpSpeed, jumpDirection.Y) * totalMultiplier;\n\n\t\t\t\tvelocity = this.LinearVelocity;\n\t\t\t\tvelocity.Y = 0.0f;\n\t\t\t\tthis.LastSupportedSpeed.Value = velocity.Length();\n\n\t\t\t\tif (supported && this.SupportEntity.Value != null)\n\t\t\t\t{\n\t\t\t\t\tVector3 impulsePosition = this.FloorPosition;\n\t\t\t\t\tVector3 impulse = this.LinearVelocity.Value * this.Mass * -1.0f;\n\t\t\t\t\tthis.SupportEntity.Value.ApplyImpulse(ref impulsePosition, ref impulse);\n\t\t\t\t}\n\n\t\t\t\tSession.Recorder.Event(main, \"Jump\");\n\n\t\t\t\tthis.IsSupported.Value = false;\n\t\t\t\tthis.SupportEntity.Value = null;\n\t\t\t\tthis.HasTraction.Value = false;\n\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_JUMP, this.Entity);\n\t\t\t\tif (!grunted && (float)this.random.NextDouble() < 0.15f)\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_LAND, this.Entity); // Grunt\n\n\t\t\t\tthis.model.Stop\n\t\t\t\t(\n\t\t\t\t\t\"Vault\",\n\t\t\t\t\t\"Mantle\",\n\t\t\t\t\t\"TopOut\",\n\t\t\t\t\t\"Jump\",\n\t\t\t\t\t\"Jump02\",\n\t\t\t\t\t\"Jump03\",\n\t\t\t\t\t\"JumpLeft\",\n\t\t\t\t\t\"JumpRight\",\n\t\t\t\t\t\"JumpBackward\"\n\t\t\t\t);\n\n\t\t\t\tvelocity = -Vector3.TransformNormal(this.LinearVelocity, Matrix.CreateRotationY(-this.Rotation));\n\t\t\t\tvelocity.Y = 0.0f;\n\t\t\t\tif (wallRunState == WallRun.State.Left || wallRunState == WallRun.State.Right)\n\t\t\t\t\tvelocity.Z = 0.0f;\n\t\t\t\telse if (wallJumping)\n\t\t\t\t\tvelocity.Z *= 0.5f;\n\t\t\t\telse\n\t\t\t\t\tvelocity.X = 0.0f;\n\t\t\t\tDirection direction = DirectionExtensions.GetDirectionFromVector(velocity);\n\t\t\t\tstring animation;\n\t\t\t\tswitch (direction)\n\t\t\t\t{\n\t\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\t\tanimation = \"JumpLeft\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\t\tanimation = \"JumpRight\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\t\tanimation = wallJumping ? \"JumpBackward\" : this.randomJumpAnimation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tanimation = this.randomJumpAnimation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthis.model.StartClip(animation, 4, false);\n\t\t\t\tthis.model[animation].CurrentTime = TimeSpan.FromSeconds(0.2);\n\n\t\t\t\t// Deactivate any wall-running we're doing\n\t\t\t\tthis.DeactivateWallRun.Execute();\n\n\t\t\t\t// Play a footstep sound since we're jumping off the ground\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.FOOTSTEP_PLAY, this.Entity);\n\n\t\t\t\tthis.LastJump.Value = this.main.TotalTime;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/Phone.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing System.Collections;\nusing Microsoft.Xna.Framework;\nusing System.ComponentModel;\nusing ComponentBind;\nusing Lemma.Util;\n\nnamespace Lemma.Components\n{\n\t[XmlInclude(typeof(Phone.Message))]\n\t[XmlInclude(typeof(ListProperty<Phone.Message>))]\n\t[XmlInclude(typeof(Phone.Schedule))]\n\t[XmlInclude(typeof(ListProperty<Phone.Schedule>))]\n\t[XmlInclude(typeof(Phone.Ans))]\n\t[XmlInclude(typeof(ListProperty<Phone.Ans>))]\n\tpublic class Phone : ComponentBind.Component<Main>, IUpdateableComponent, DialogueForest.IClient\n\t{\n\t\tpublic class Message\n\t\t{\n\t\t\tpublic string ID;\n\t\t\tpublic string Name;\n\t\t\tpublic Sender Sender;\n\t\t}\n\n\t\tpublic class Schedule\n\t\t{\n\t\t\tpublic float Delay;\n\t\t\tpublic Message Message;\n\t\t}\n\n\t\tpublic class Ans\n\t\t{\n\t\t\tpublic string Name;\n\n\t\t\t[DefaultValue(true)]\n\t\t\tpublic bool Exclusive = true;\n\n\t\t\t[DefaultValue(null)]\n\t\t\tpublic string ParentID;\n\n\t\t\tpublic string ID;\n\n\t\t\tpublic Ans()\n\t\t\t\t: this(null, null)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic Ans(string name, string id = null, bool exclusive = true)\n\t\t\t{\n\t\t\t\tthis.ID = id;\n\t\t\t\tthis.Name = name;\n\t\t\t\tthis.Exclusive = exclusive;\n\t\t\t}\n\t\t}\n\n\t\tprivate Dictionary<string, string> variables = new Dictionary<string,string>();\n\n\t\t[XmlArray(\"Variables\")]\n\t\t[XmlArrayItem(\"Variable\", Type = typeof(DictionaryEntry))]\n\t\tpublic DictionaryEntry[] Variables\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\t// Make an array of DictionaryEntries to return\n\t\t\t\tDictionaryEntry[] ret = new DictionaryEntry[this.variables.Count];\n\t\t\t\tint i = 0;\n\t\t\t\tDictionaryEntry de;\n\t\t\t\t// Iterate through properties to load items into the array.\n\t\t\t\tforeach (KeyValuePair<string, string> pair in this.variables)\n\t\t\t\t{\n\t\t\t\t\tde = new DictionaryEntry();\n\t\t\t\t\tde.Key = pair.Key;\n\t\t\t\t\tde.Value = pair.Value;\n\t\t\t\t\tret[i] = de;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.variables.Clear();\n\t\t\t\tfor (int i = 0; i < value.Length; i++)\n\t\t\t\t\tthis.variables.Add((string)value[i].Key, (string)value[i].Value);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledInEditMode = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic ListProperty<Schedule> Schedules = new ListProperty<Schedule>();\n\n\t\tpublic ListProperty<Message> Messages = new ListProperty<Message>();\n\n\t\tpublic ListProperty<Ans> ActiveAnswers = new ListProperty<Ans>();\n\n\t\tpublic Property<string> Photo = new Property<string>();\n\n\t\tpublic enum Mode { Messages, Photos }\n\n\t\tpublic enum Sender { Player, A, B }\n\n\t\tpublic Property<Sender> CurrentPartner = new Property<Sender> { Value = Sender.A };\n\n\t\tpublic Property<Mode> CurrentMode = new Property<Mode>();\n\n\t\tpublic Property<bool> CanReceiveMessages = new Property<bool>();\n\n\t\tpublic Property<bool> WaitForAnswer = new Property<bool>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Show = new Command();\n\n\t\t[XmlIgnore]\n\t\tpublic Command MessageReceived = new Command();\n\n\t\tvoid IUpdateableComponent.Update(float dt)\n\t\t{\n\t\t\tList<Schedule> removals = new List<Schedule>();\n\t\t\tforeach (Schedule s in this.Schedules)\n\t\t\t{\n\t\t\t\ts.Delay -= dt;\n\t\t\t\tif (this.CanReceiveMessages && s.Delay < 0.0f)\n\t\t\t\t\tremovals.Add(s);\n\t\t\t}\n\n\t\t\tforeach (Schedule s in removals)\n\t\t\t\tthis.Schedules.Remove(s);\n\n\t\t\tforeach (Schedule s in removals)\n\t\t\t\tthis.Msg(s.Message);\n\t\t}\n\n\t\tpublic void Delay(float delay, Sender sender, string name, string id = null)\n\t\t{\n\t\t\tSchedule s = new Schedule\n\t\t\t{\n\t\t\t\tDelay = delay,\n\t\t\t\tMessage = new Message\n\t\t\t\t{\n\t\t\t\t\tName = name,\n\t\t\t\t\tID = id,\n\t\t\t\t\tSender = sender,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.Schedules.Add(s);\n\t\t}\n\n\t\tpublic void Msg(Message msg)\n\t\t{\n\t\t\tif (this.Messages.Length >= 256)\n\t\t\t\tthis.Messages.RemoveAt(0);\n\t\t\tthis.Messages.Add(msg);\n\n\t\t\tCommand callback;\n\t\t\tthis.messageCallbacks.TryGetValue(msg.Name, out callback);\n\t\t\tif (callback != null)\n\t\t\t\tcallback.Execute();\n\n\t\t\tCommand cmd;\n\t\t\tthis.visitCallbacks.TryGetValue(msg.Name, out cmd);\n\t\t\tif (cmd != null)\n\t\t\t\tcmd.Execute();\n\n\t\t\tthis.MessageReceived.Execute();\n\t\t}\n\n\t\tpublic void ArchivedMsg(string name, string text = null)\n\t\t{\n\t\t\tthis.Messages.Add(new Message { Sender = Sender.Player, Name = name, });\n\t\t}\n\n\t\tpublic void ArchivedAns(string name)\n\t\t{\n\t\t\tthis.Messages.Add(new Message { Sender = Sender.A, Name = name, });\n\t\t}\n\n\t\tprivate Dictionary<string, Command> messageCallbacks = new Dictionary<string, Command>();\n\t\tprivate Dictionary<string, Command> visitCallbacks = new Dictionary<string, Command>();\n\t\tprivate Dictionary<string, Command<string>> answerCallbacks = new Dictionary<string, Command<string>>();\n\n\t\tpublic string LastMessageID()\n\t\t{\n\t\t\tif (this.Messages.Length > 0)\n\t\t\t{\n\t\t\t\tMessage msg = this.Messages[this.Messages.Length - 1];\n\t\t\t\treturn msg.ID;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic void Answer(Ans answer)\n\t\t{\n\t\t\tstring messageID;\n\n\t\t\tif (string.IsNullOrEmpty(answer.ParentID))\n\t\t\t\tmessageID = this.LastMessageID();\n\t\t\telse\n\t\t\t\tmessageID = answer.ParentID;\n\n\t\t\tthis.Messages.Add(new Message { Sender = Sender.Player, Name = answer.Name, });\n\t\t\tif (answer.Exclusive)\n\t\t\t\tthis.ActiveAnswers.Clear();\n\t\t\telse\n\t\t\t\tthis.ActiveAnswers.Remove(answer);\n\t\t\t\n\t\t\tthis.WaitForAnswer.Value = false;\n\n\t\t\tif (messageID != null)\n\t\t\t{\n\t\t\t\tCommand<string> callback;\n\t\t\t\tthis.answerCallbacks.TryGetValue(messageID, out callback);\n\t\t\t\tif (callback != null)\n\t\t\t\t\tcallback.Execute(answer.Name);\n\n\t\t\t\tCommand cmd;\n\t\t\t\tthis.visitCallbacks.TryGetValue(answer.Name, out cmd);\n\t\t\t\tif (cmd != null)\n\t\t\t\t\tcmd.Execute();\n\n\t\t\t\tDialogueForest.Node selectedChoice = this.forest[answer.ID];\n\t\t\t\tif (selectedChoice != null)\n\t\t\t\t{\n\t\t\t\t\tDialogueForest.Node next = selectedChoice.next != null ? forest[selectedChoice.next] : null;\n\t\t\t\t\tif (next != null)\n\t\t\t\t\t\tthis.execute(next);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Choices(params Ans[] answers)\n\t\t{\n\t\t\tthis.ActiveAnswers.Clear();\n\t\t\tforeach (Ans answer in answers)\n\t\t\t\tthis.ActiveAnswers.Add(answer);\n\t\t\tthis.WaitForAnswer.Value = true;\n\t\t}\n\n\t\tpublic Command OnMessage(string text)\n\t\t{\n\t\t\tCommand cmd;\n\t\t\tthis.messageCallbacks.TryGetValue(text, out cmd);\n\t\t\tif (cmd == null)\n\t\t\t\tthis.messageCallbacks[text] = cmd = new Command();\n\t\t\treturn cmd;\n\t\t}\n\n\t\tpublic Command OnVisit(string text)\n\t\t{\n\t\t\tCommand cmd;\n\t\t\tthis.visitCallbacks.TryGetValue(text, out cmd);\n\t\t\tif (cmd == null)\n\t\t\t\tthis.visitCallbacks[text] = cmd = new Command();\n\t\t\treturn cmd;\n\t\t}\n\n\t\tpublic Command<string> OnAnswer(string text)\n\t\t{\n\t\t\tCommand<string> cmd;\n\t\t\tthis.answerCallbacks.TryGetValue(text, out cmd);\n\t\t\tif (cmd == null)\n\t\t\t\tthis.answerCallbacks[text] = cmd = new Command<string>();\n\t\t\treturn cmd;\n\t\t}\n\n\t\tpublic string this[string variable]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tstring value;\n\t\t\t\tthis.variables.TryGetValue(variable, out value);\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.variables[variable] = value;\n\t\t\t}\n\t\t}\n\n\t\tprivate DialogueForest forest;\n\t\tpublic void Bind(DialogueForest forest)\n\t\t{\n\t\t\tthis.forest = forest;\n\t\t}\n\n\t\tpublic void Execute(DialogueForest.Node node)\n\t\t{\n\t\t\tthis.execute(node);\n\t\t\tif (this.Schedules.Length == 0)\n\t\t\t{\n\t\t\t\t// If there are choices available, they will initiate a conversation.\n\t\t\t\t// The player should be able to pull up the phone, see the choices, and walk away without picking any of them.\n\t\t\t\t// Normally, you can't put the phone down until you've picked an answer.\n\t\t\t\tthis.WaitForAnswer.Value = false;\n\t\t\t}\n\t\t}\n\n\t\tprivate void execute(DialogueForest.Node node)\n\t\t{\n\t\t\tthis.forest.Execute(node, this);\n\t\t}\n\n\t\tvoid DialogueForest.IClient.Visit(DialogueForest.Node node)\n\t\t{\n\t\t\tif (!string.IsNullOrEmpty(node.name) && node.type != DialogueForest.Node.Type.Text)\n\t\t\t{\n\t\t\t\tCommand cmd;\n\t\t\t\tthis.visitCallbacks.TryGetValue(node.name, out cmd);\n\t\t\t\tif (cmd != null)\n\t\t\t\t\tcmd.Execute();\n\t\t\t}\n\t\t}\n\n\t\tvoid DialogueForest.IClient.Text(DialogueForest.Node node, int level)\n\t\t{\n\t\t\tthis.Delay(messageDelay * level, this.CurrentPartner, node.name, node.id);\n\t\t}\n\n\t\tprivate const float messageDelay = 3.0f; // seconds in between each message\n\t\tvoid DialogueForest.IClient.Choice(DialogueForest.Node node, IEnumerable<DialogueForest.Node> choices)\n\t\t{\n\t\t\tthis.ActiveAnswers.Clear();\n\t\t\tthis.ActiveAnswers.AddAll(choices.Select(x => new Ans { ParentID = node.id, ID = x.id, Name = x.name }));\n\t\t\tthis.WaitForAnswer.Value = true;\n\t\t}\n\n\t\tpublic void Set(string key, string value)\n\t\t{\n\t\t\tthis[key] = value;\n\t\t}\n\n\t\tpublic string Get(string key)\n\t\t{\n\t\t\treturn this[key];\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/PhoneNote.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing GeeUI.Managers;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Input;\n\nnamespace Lemma.Components\n{\n\tpublic class PhoneNote\n\t{\n\t\tpublic static void Attach(Main main, Entity entity, Player player, AnimatedModel model, FPSInput input, Phone phone, Property<bool> enableWalking, Property<bool> phoneActive, Property<bool> noteActive)\n\t\t{\n\t\t\tUIRenderer phoneUi = entity.GetOrCreate<UIRenderer>(\"PhoneUI\");\n\t\t\tmodel[\"Phone\"].Speed = model[\"VRPhone\"].Speed = model[\"Note\"].Speed = model[\"VRNote\"].Speed = 0.25f;\n\n\t\t\tconst float phoneWidth = 200.0f;\n\n\t\t\tphoneUi.RenderTargetBackground.Value = Microsoft.Xna.Framework.Color.White;\n\t\t\tphoneUi.RenderTargetSize.Value = new Point((int)phoneWidth, (int)(phoneWidth * 2.0f));\n\t\t\tphoneUi.Serialize = false;\n\t\t\tphoneUi.Enabled.Value = false;\n#if VR\n\t\t\tif (main.VR)\n\t\t\t\tphoneUi.Reticle.Tint.Value = new Color(0.0f, 0.0f, 0.0f);\n#endif\n\n\t\t\tModel phoneModel = entity.GetOrCreate<Model>(\"PhoneModel\");\n\t\t\tphoneModel.Filename.Value = \"Models\\\\phone\";\n\t\t\tphoneModel.Color.Value = new Vector3(0.13f, 0.13f, 0.13f);\n\t\t\tphoneModel.Serialize = false;\n\t\t\tphoneModel.Enabled.Value = false;\n\n\t\t\tProperty<Matrix> phoneBone = model.GetBoneTransform(\"Phone\");\n\t\t\tphoneModel.Add(new Binding<Matrix>(phoneModel.Transform, () => phoneBone.Value * model.Transform, phoneBone, model.Transform));\n\n\t\t\tModel screen = entity.GetOrCreate<Model>(\"Screen\");\n\t\t\tscreen.Filename.Value = \"Models\\\\plane\";\n\t\t\tscreen.Add(new Binding<Microsoft.Xna.Framework.Graphics.RenderTarget2D>(screen.GetRenderTarget2DParameter(\"Diffuse\" + Model.SamplerPostfix), phoneUi.RenderTarget));\n\t\t\tscreen.Add(new Binding<Matrix>(screen.Transform, x => Matrix.CreateTranslation(0.015f, 0.0f, 0.0f) * x, phoneModel.Transform));\n\t\t\tscreen.Serialize = false;\n\t\t\tscreen.Enabled.Value = false;\n\n\t\t\tPointLight phoneLight = entity.Create<PointLight>();\n\t\t\tphoneLight.Serialize = false;\n\t\t\tphoneLight.Enabled.Value = false;\n\t\t\tphoneLight.Attenuation.Value = 0.5f;\n\t\t\tphoneLight.Add(new Binding<Vector3, Matrix>(phoneLight.Position, x => x.Translation, screen.Transform));\n\n\t\t\tPointLight noteLight = entity.Create<PointLight>();\n\t\t\tnoteLight.Serialize = false;\n\t\t\tnoteLight.Enabled.Value = false;\n\t\t\tnoteLight.Attenuation.Value = 1.0f;\n\t\t\tnoteLight.Color.Value = new Vector3(0.3f);\n\t\t\tnoteLight.Add(new Binding<Vector3>(noteLight.Position, () => Vector3.Transform(new Vector3(0.25f, 0.0f, 0.0f), phoneBone.Value * model.Transform), phoneBone, model.Transform));\n\n\t\t\tconst float screenScale = 0.0007f;\n\t\t\tscreen.Scale.Value = new Vector3(1.0f, (float)phoneUi.RenderTargetSize.Value.Y * screenScale, (float)phoneUi.RenderTargetSize.Value.X * screenScale);\n\n\t\t\t// Transform screen space mouse position into 3D, then back into the 2D space of the phone UI\n\t\t\tProperty<Matrix> screenTransform = new Property<Matrix>();\n\t\t\tscreen.Add(new Binding<Matrix>(screenTransform, () => Matrix.CreateScale(screen.Scale) * screen.Transform, screen.Scale, screen.Transform));\n\t\t\tphoneUi.Setup3D(screenTransform);\n\n\t\t\t// Phone UI\n\n\t\t\tconst float padding = 8.0f;\n\t\t\tconst float messageWidth = phoneWidth - padding * 2.0f;\n\n\t\t\tFunc<Property<Color>, string, float, Container> makeButton = delegate(Property<Color> color, string text, float width)\n\t\t\t{\n\t\t\t\tContainer bg = new Container();\n\t\t\t\tbg.Tint.Value = color;\n\t\t\t\tbg.PaddingBottom.Value = bg.PaddingLeft.Value = bg.PaddingRight.Value = bg.PaddingTop.Value = padding * 0.5f;\n\t\t\t\tbg.Add(new Binding<Color>(bg.Tint, () => bg.Highlighted ? new Color(color.Value.ToVector4() + new Vector4(0.2f, 0.2f, 0.2f, 0.0f)) : color, bg.Highlighted, color));\n\n\t\t\t\tTextElement msg = new TextElement();\n\t\t\t\tmsg.Name.Value = \"Text\";\n\t\t\t\tmsg.FontFile.Value = main.Font;\n\t\t\t\tmsg.Text.Value = text;\n\t\t\t\tmsg.WrapWidth.Value = width;\n\t\t\t\tbg.Children.Add(msg);\n\t\t\t\treturn bg;\n\t\t\t};\n\n\t\t\tAction<Container, float> centerButton = delegate(Container button, float width)\n\t\t\t{\n\t\t\t\tTextElement text = (TextElement)button.Children[0];\n\t\t\t\ttext.AnchorPoint.Value = new Vector2(0.5f, 0);\n\t\t\t\ttext.Add(new Binding<Vector2>(text.Position, x => new Vector2(x.X * 0.5f, padding), button.Size));\n\t\t\t\tbutton.ResizeHorizontal.Value = false;\n\t\t\t\tbutton.ResizeVertical.Value = false;\n\t\t\t\tbutton.Size.Value = new Vector2(width, 36.0f * main.FontMultiplier);\n\t\t\t};\n\n\t\t\tFunc<UIComponent, bool, Container> makeAlign = delegate(UIComponent component, bool right)\n\t\t\t{\n\t\t\t\tContainer container = new Container();\n\t\t\t\tcontainer.Opacity.Value = 0.0f;\n\t\t\t\tcontainer.PaddingBottom.Value = container.PaddingLeft.Value = container.PaddingRight.Value = container.PaddingTop.Value = 0.0f;\n\t\t\t\tcontainer.ResizeHorizontal.Value = false;\n\t\t\t\tcontainer.Size.Value = new Vector2(messageWidth, 0.0f);\n\t\t\t\tcomponent.AnchorPoint.Value = new Vector2(right ? 1.0f : 0.0f, 0.0f);\n\t\t\t\tcomponent.Position.Value = new Vector2(right ? messageWidth : 0.0f, 0.0f);\n\t\t\t\tcontainer.Children.Add(component);\n\t\t\t\treturn container;\n\t\t\t};\n\n\t\t\tProperty<Color> incomingColor = new Property<Color> { Value = new Color(0.0f, 0.0f, 0.0f, 1.0f) };\n\t\t\tProperty<Color> outgoingColor = new Property<Color> { Value = new Color(0.0f, 0.175f, 0.35f, 1.0f) };\n\t\t\tProperty<Color> alternateSenderColor = new Property<Color> { Value = new Color(0.25f, 0.0f, 0.25f, 1.0f) };\n\t\t\tProperty<Color> composeColor = new Property<Color> { Value = new Color(0.5f, 0.0f, 0.0f, 1.0f) };\n\t\t\tProperty<Color> disabledColor = new Property<Color> { Value = new Color(0.35f, 0.35f, 0.35f, 1.0f) };\n\t\t\tProperty<Color> topBarColor = new Property<Color> { Value = new Color(0.15f, 0.15f, 0.15f, 1.0f) };\n\n\t\t\tContainer topBarContainer = new Container();\n\t\t\ttopBarContainer.ResizeHorizontal.Value = false;\n\t\t\ttopBarContainer.Size.Value = new Vector2(phoneUi.RenderTargetSize.Value.X, 0.0f);\n\t\t\ttopBarContainer.Tint.Value = topBarColor;\n\t\t\tphoneUi.Root.Children.Add(topBarContainer);\n\n\t\t\tListContainer phoneTopBar = new ListContainer();\n\t\t\tphoneTopBar.Orientation.Value = ListContainer.ListOrientation.Horizontal;\n\t\t\tphoneTopBar.Spacing.Value = padding;\n\t\t\ttopBarContainer.Children.Add(phoneTopBar);\n\n\t\t\tSprite signalIcon = new Sprite();\n\t\t\tsignalIcon.Image.Value = \"Images\\\\signal\";\n\t\t\tphoneTopBar.Children.Add(signalIcon);\n\n\t\t\tTextElement noService = new TextElement();\n\t\t\tnoService.FontFile.Value = main.Font;\n\t\t\tnoService.Text.Value = \"\\\\no service\";\n\t\t\tphoneTopBar.Children.Add(noService);\n\n\t\t\tsignalIcon.Add(new Binding<bool>(signalIcon.Visible, () => player.SignalTower.Value.Target != null || phone.ActiveAnswers.Length > 0 || phone.Schedules.Length > 0, player.SignalTower, phone.ActiveAnswers.Length, phone.Schedules.Length));\n\t\t\tnoService.Add(new Binding<bool>(noService.Visible, x => !x, signalIcon.Visible));\n\n\t\t\tListContainer tabs = new ListContainer();\n\t\t\ttabs.Orientation.Value = ListContainer.ListOrientation.Horizontal;\n\t\t\ttabs.Spacing.Value = 0;\n\t\t\tphoneUi.Root.Children.Add(tabs);\n\n\t\t\tProperty<Color> messageTabColor = new Property<Color> { Value = outgoingColor };\n\t\t\tphoneUi.Add(new Binding<Color, Phone.Mode>(messageTabColor, x => x == Phone.Mode.Messages ? outgoingColor : topBarColor, phone.CurrentMode));\n\t\t\tContainer messageTab = makeButton(messageTabColor, \"\\\\messages\", phoneUi.RenderTargetSize.Value.X * 0.5f - padding);\n\t\t\tcenterButton(messageTab, phoneUi.RenderTargetSize.Value.X * 0.5f);\n\t\t\ttabs.Children.Add(messageTab);\n\t\t\tmessageTab.Add(new CommandBinding(messageTab.MouseLeftUp, delegate()\n\t\t\t{\n\t\t\t\tphone.CurrentMode.Value = Phone.Mode.Messages;\n\t\t\t}));\n\n\t\t\tProperty<Color> photoTabColor = new Property<Color> { Value = topBarColor };\n\t\t\tphoneUi.Add(new Binding<Color>(photoTabColor, delegate()\n\t\t\t{\n\t\t\t\tif (phone.CurrentMode == Phone.Mode.Photos)\n\t\t\t\t\treturn outgoingColor;\n\t\t\t\telse if (string.IsNullOrEmpty(phone.Photo))\n\t\t\t\t\treturn disabledColor;\n\t\t\t\telse\n\t\t\t\t\treturn topBarColor;\n\t\t\t}, phone.CurrentMode, phone.Photo));\n\t\t\tContainer photoTab = makeButton(photoTabColor, \"\\\\photos\", phoneUi.RenderTargetSize.Value.X * 0.5f - padding);\n\t\t\tcenterButton(photoTab, phoneUi.RenderTargetSize.Value.X * 0.5f);\n\t\t\ttabs.Children.Add(photoTab);\n\t\t\tphotoTab.Add(new CommandBinding(photoTab.MouseLeftUp, delegate()\n\t\t\t{\n\t\t\t\tif (!string.IsNullOrEmpty(phone.Photo))\n\t\t\t\t\tphone.CurrentMode.Value = Phone.Mode.Photos;\n\t\t\t}));\n\n\t\t\ttabs.Add(new Binding<Vector2>(tabs.Position, x => new Vector2(0, x.Y), topBarContainer.Size));\n\n\t\t\tListContainer messageLayout = new ListContainer();\n\t\t\tmessageLayout.Spacing.Value = padding;\n\t\t\tmessageLayout.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tmessageLayout.Add(new Binding<Vector2>(messageLayout.Position, () => new Vector2(padding, topBarContainer.Size.Value.Y + tabs.Size.Value.Y), topBarContainer.Size, tabs.Size));\n\t\t\tmessageLayout.Add(new Binding<Vector2>(messageLayout.Size, () => new Vector2(phoneUi.RenderTargetSize.Value.X - padding * 2.0f, phoneUi.RenderTargetSize.Value.Y - padding - topBarContainer.Size.Value.Y - tabs.Size.Value.Y), phoneUi.RenderTargetSize, topBarContainer.Size, tabs.Size));\n\t\t\tmessageLayout.Add(new Binding<bool, Phone.Mode>(messageLayout.Visible, x => x == Phone.Mode.Messages, phone.CurrentMode));\n\t\t\tphoneUi.Root.Children.Add(messageLayout);\n\n\t\t\tContainer photoLayout = new Container();\n\t\t\tphotoLayout.Opacity.Value = 0;\n\t\t\tphotoLayout.PaddingLeft.Value = photoLayout.PaddingRight.Value = photoLayout.PaddingTop.Value = photoLayout.PaddingBottom.Value = 0;\n\t\t\tphotoLayout.Add(new Binding<Vector2>(photoLayout.Position, () => new Vector2(0, topBarContainer.Size.Value.Y + tabs.Size.Value.Y), topBarContainer.Size, tabs.Size));\n\t\t\tphotoLayout.Add(new Binding<Vector2>(photoLayout.Size, () => new Vector2(phoneUi.RenderTargetSize.Value.X, phoneUi.RenderTargetSize.Value.Y - topBarContainer.Size.Value.Y - tabs.Size.Value.Y), phoneUi.RenderTargetSize, topBarContainer.Size, tabs.Size));\n\t\t\tphotoLayout.Add(new Binding<bool>(photoLayout.Visible, x => !x, messageLayout.Visible));\n\t\t\tphoneUi.Root.Children.Add(photoLayout);\n\n\t\t\tSprite photoImage = new Sprite();\n\t\t\tphotoImage.AnchorPoint.Value = new Vector2(0.5f, 0.5f);\n\t\t\tphotoImage.Add(new Binding<string>(photoImage.Image, phone.Photo));\n\t\t\tphotoImage.Add(new Binding<Vector2>(photoImage.Position, x => x * 0.5f, photoLayout.Size));\n\t\t\tphotoLayout.Children.Add(photoImage);\n\n\t\t\tContainer composeButton = makeButton(composeColor, \"\\\\compose\", messageWidth - padding * 2.0f);\n\t\t\tTextElement composeText = (TextElement)composeButton.GetChildByName(\"Text\");\n\t\t\tcomposeText.Add(new Binding<string, bool>(composeText.Text, x => x ? \"\\\\compose gamepad\" : \"\\\\compose\", main.GamePadConnected));\n\t\t\tUIComponent composeAlign = makeAlign(composeButton, true);\n\n\t\t\tScroller phoneScroll = new Scroller();\n\t\t\tphoneScroll.ResizeVertical.Value = false;\n\t\t\tphoneScroll.Add(new Binding<Vector2>(phoneScroll.Size, () => new Vector2(messageLayout.Size.Value.X, messageLayout.Size.Value.Y - messageLayout.Spacing.Value - composeAlign.ScaledSize.Value.Y), messageLayout.Size, messageLayout.Spacing, composeAlign.ScaledSize));\n\n\t\t\tmessageLayout.Children.Add(phoneScroll);\n\t\t\tmessageLayout.Children.Add(composeAlign);\n\n\t\t\tListContainer msgList = new ListContainer();\n\t\t\tmsgList.Spacing.Value = padding * 0.5f;\n\t\t\tmsgList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tmsgList.ResizePerpendicular.Value = false;\n\t\t\tmsgList.Size.Value = new Vector2(messageWidth, 0.0f);\n\t\t\tphoneScroll.Children.Add(msgList);\n\n\t\t\tContainer answerContainer = new Container();\n\t\t\tanswerContainer.PaddingBottom.Value = answerContainer.PaddingLeft.Value = answerContainer.PaddingRight.Value = answerContainer.PaddingTop.Value = padding;\n\t\t\tanswerContainer.Tint.Value = incomingColor;\n\t\t\tanswerContainer.AnchorPoint.Value = new Vector2(1.0f, 1.0f);\n\t\t\tphoneUi.Root.CheckLayout();\n\t\t\tanswerContainer.Position.Value = composeAlign.GetAbsolutePosition() + new Vector2(composeAlign.ScaledSize.Value.X, 0);\n\t\t\tphoneUi.Root.Children.Add(answerContainer);\n\t\t\tanswerContainer.Visible.Value = false;\n\n\t\t\tListContainer answerList = new ListContainer();\n\t\t\tanswerList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tanswerList.Alignment.Value = ListContainer.ListAlignment.Max;\n\t\t\tanswerContainer.Children.Add(answerList);\n\n\t\t\tint selectedAnswer = 0;\n\n\t\t\tcomposeButton.Add(new CommandBinding(composeButton.MouseLeftUp, delegate()\n\t\t\t{\n\t\t\t\tanswerContainer.Visible.Value = !answerContainer.Visible;\n\t\t\t\tif (answerContainer.Visible && main.GamePadConnected)\n\t\t\t\t{\n\t\t\t\t\tselectedAnswer = 0;\n\t\t\t\t\tforeach (UIComponent answer in answerList.Children)\n\t\t\t\t\t\tanswer.Highlighted.Value = false;\n\t\t\t\t\tanswerList.Children[0].Highlighted.Value = true;\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\ttabs.Add(new Binding<bool>(tabs.EnableInput, () => !main.Paused && !answerContainer.Visible, answerContainer.Visible, main.Paused));\n\t\t\tmsgList.Add(new Binding<bool>(msgList.EnableInput, () => !main.Paused && !answerContainer.Visible, answerContainer.Visible, main.Paused));\n\t\t\tanswerContainer.Add(new Binding<bool>(answerContainer.EnableInput, x => !x, main.Paused));\n\t\t\tcomposeButton.Add(new Binding<bool>(composeButton.EnableInput, x => !x, main.Paused));\n\n\t\t\tAction scrollToBottom = delegate()\n\t\t\t{\n\t\t\t\t// HACK\n\t\t\t\tAnimation scroll = new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Delay(0.01f),\n\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tphoneScroll.ScrollToBottom();\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t\tentity.Add(scroll);\n\t\t\t};\n\n\t\t\t// Note\n\n\t\t\tUIRenderer noteUi = entity.GetOrCreate<UIRenderer>(\"NoteUI\");\n\n\t\t\tconst float noteWidth = 400.0f;\n\n\t\t\tnoteUi.RenderTargetBackground.Value = new Microsoft.Xna.Framework.Color(0.8f, 0.75f, 0.7f);\n\t\t\tnoteUi.RenderTargetSize.Value = new Point((int)noteWidth, (int)(noteWidth * 1.29f)); // 8.5x11 aspect ratio\n\t\t\tnoteUi.Serialize = false;\n\t\t\tnoteUi.Enabled.Value = false;\n\n\t\t\tModel noteModel = entity.GetOrCreate<Model>(\"Note\");\n\t\t\tnoteModel.Filename.Value = \"Models\\\\note\";\n\t\t\tnoteModel.Add(new Binding<Microsoft.Xna.Framework.Graphics.RenderTarget2D>(noteModel.GetRenderTarget2DParameter(\"Diffuse\" + Model.SamplerPostfix), noteUi.RenderTarget));\n\t\t\tnoteModel.Add(new Binding<Matrix>(noteModel.Transform, x => Matrix.CreateTranslation(-0.005f, 0.05f, 0.08f) * x, phoneModel.Transform));\n\t\t\tnoteModel.Serialize = false;\n\t\t\tnoteModel.Enabled.Value = false;\n\n\t\t\tContainer togglePhoneMessage = null;\n\n\t\t\tentity.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tbool hasSignalTower = (player.SignalTower.Value.Target != null && player.SignalTower.Value.Target.Active && !string.IsNullOrEmpty(player.SignalTower.Value.Target.Get<SignalTower>().Initial));\n\t\t\t\tif (hasSignalTower)\n\t\t\t\t\tphone.Enabled.Value = true;\n\n\t\t\t\tbool hasNoteOrSignalTower = (player.Note.Value.Target != null && player.Note.Value.Target.Active) || hasSignalTower;\n\n\t\t\t\tif (togglePhoneMessage == null && hasNoteOrSignalTower)\n\t\t\t\t\ttogglePhoneMessage = main.Menu.ShowMessage(entity, hasSignalTower ? \"\\\\signal tower prompt\" : \"\\\\note prompt\");\n\t\t\t\telse if (togglePhoneMessage != null && !hasNoteOrSignalTower && !phoneActive && !noteActive)\n\t\t\t\t{\n\t\t\t\t\tmain.Menu.HideMessage(null, togglePhoneMessage);\n\t\t\t\t\ttogglePhoneMessage = null;\n\t\t\t\t}\n\t\t\t}, player.Note, player.SignalTower));\n\n\t\t\tentity.Add(new CommandBinding(entity.Delete, delegate()\n\t\t\t{\n\t\t\t\tif (togglePhoneMessage != null && togglePhoneMessage.Active)\n\t\t\t\t\ttogglePhoneMessage.Delete.Execute();\n\t\t\t\tif (noteActive)\n\t\t\t\t{\n\t\t\t\t\tnoteActive.Value = false;\n\t\t\t\t\tplayer.Note.Value = null;\n\t\t\t\t\tenableWalking.Value = true;\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\t// Note UI\n\n\t\t\tconst float notePadding = 40.0f;\n\n\t\t\tListContainer noteLayout = new ListContainer();\n\t\t\tnoteLayout.Spacing.Value = padding;\n\t\t\tnoteLayout.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tnoteLayout.Alignment.Value = ListContainer.ListAlignment.Min;\n\t\t\tnoteLayout.Position.Value = new Vector2(notePadding, notePadding);\n\t\t\tnoteLayout.Add(new Binding<Vector2, Point>(noteLayout.Size, x => new Vector2(x.X - notePadding * 2.0f, x.Y - notePadding * 2.0f), noteUi.RenderTargetSize));\n\t\t\tnoteUi.Root.Children.Add(noteLayout);\n\n\t\t\tSprite noteUiImage = new Sprite();\n\t\t\tnoteLayout.Children.Add(noteUiImage);\n\n\t\t\tTextElement noteUiText = new TextElement();\n\t\t\tnoteUiText.FontFile.Value = main.Font;\n\t\t\tnoteUiText.Tint.Value = new Microsoft.Xna.Framework.Color(0.1f, 0.1f, 0.1f);\n\t\t\tnoteUiText.Add(new Binding<float, Vector2>(noteUiText.WrapWidth, x => x.X, noteLayout.Size));\n\t\t\tnoteLayout.Children.Add(noteUiText);\n\n\t\t\t// Toggle note\n\t\t\tAnimation noteAnim = null;\n\n\t\t\tfloat startRotationY = 0;\n\t\t\tAction<bool> showNote = delegate(bool show)\n\t\t\t{\n\t\t\t\tmodel.Stop(\"Phone\", \"Note\", \"VRPhone\", \"VRNote\");\n\t\t\t\tEntity noteEntity = player.Note.Value.Target;\n\t\t\t\tnoteActive.Value = show && noteEntity != null;\n\t\t\t\tNote note = noteEntity != null ? noteEntity.Get<Note>() : null;\n\t\t\t\tif (noteActive)\n\t\t\t\t{\n\t\t\t\t\tinput.EnableLook.Value = input.EnableMouse.Value = false;\n\t\t\t\t\tenableWalking.Value = false;\n\t\t\t\t\tnoteModel.Enabled.Value = true;\n\t\t\t\t\tnoteUi.Enabled.Value = true;\n\t\t\t\t\tnoteLight.Enabled.Value = true;\n\t\t\t\t\tSession.Recorder.Event(main, \"Note\", note.Text);\n\t\t\t\t\tnoteUiImage.Image.Value = note.Image;\n\t\t\t\t\tnoteUiText.Text.Value = note.Text;\n\t\t\t\t\tstring noteAnimation;\n#if VR\n\t\t\t\t\tif (main.VR)\n\t\t\t\t\t\tnoteAnimation = \"VRNote\";\n\t\t\t\t\telse\n#endif\n\t\t\t\t\t\tnoteAnimation = \"Note\";\n\n\t\t\t\t\tmodel.StartClip(noteAnimation, 6, true, AnimatedModel.DefaultBlendTime * 2.0f);\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_NOTE_PICKUP, entity);\n\n\t\t\t\t\tif (noteAnim != null && noteAnim.Active)\n\t\t\t\t\t\tnoteAnim.Delete.Execute();\n\t\t\t\t\telse\n\t\t\t\t\t\tstartRotationY = input.Mouse.Value.Y;\n\t\t\t\t\t// Level the player's view\n\t\t\t\t\tnoteAnim = new Animation\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Ease\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew Animation.Custom(delegate(float x)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinput.Mouse.Value = new Vector2(input.Mouse.Value.X, startRotationY * (1.0f - x));\n\t\t\t\t\t\t\t}, 0.5f),\n\t\t\t\t\t\t\tAnimation.Ease.EaseType.OutQuadratic\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tentity.Add(noteAnim);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tenableWalking.Value = true;\n\t\t\t\t\tif (note != null)\n\t\t\t\t\t\tSession.Recorder.Event(main, \"NoteEnd\");\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_NOTE_DROP, entity);\n\t\t\t\t\tif (note != null && !note.IsCollected)\n\t\t\t\t\t\tnote.IsCollected.Value = true;\n\n\t\t\t\t\t// Return the player's view\n\t\t\t\t\tif (noteAnim != null && noteAnim.Active)\n\t\t\t\t\t\tnoteAnim.Delete.Execute();\n\t\t\t\t\tnoteAnim = new Animation\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Ease\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew Animation.Custom(delegate(float x)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinput.Mouse.Value = new Vector2(input.Mouse.Value.X, startRotationY * x);\n\t\t\t\t\t\t\t}, 0.5f),\n\t\t\t\t\t\t\tAnimation.Ease.EaseType.OutQuadratic\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnoteModel.Enabled.Value = false;\n\t\t\t\t\t\t\tnoteUi.Enabled.Value = false;\n\t\t\t\t\t\t\tnoteLight.Enabled.Value = false;\n\t\t\t\t\t\t\tinput.EnableLook.Value = input.EnableMouse.Value = true;\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tentity.Add(noteAnim);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Toggle phone\n\n\t\t\tAnimation phoneAnim = null;\n\n\t\t\tAction<bool> showPhone = delegate(bool show)\n\t\t\t{\n\t\t\t\tif (togglePhoneMessage != null)\n\t\t\t\t{\n\t\t\t\t\tmain.Menu.HideMessage(null, togglePhoneMessage);\n\t\t\t\t\ttogglePhoneMessage = null;\n\t\t\t\t}\n\n\t\t\t\tif (show || (phone.Schedules.Length == 0 && !phone.WaitForAnswer))\n\t\t\t\t{\n\t\t\t\t\tphoneActive.Value = show;\n\t\t\t\t\tanswerContainer.Visible.Value = false;\n\n\t\t\t\t\tmodel.Stop(\"Phone\", \"Note\", \"VRPhone\", \"VRNote\");\n\t\t\t\t\tif (phoneActive)\n\t\t\t\t\t{\n\t\t\t\t\t\tphoneUi.IsMouseVisible.Value = true;\n\t\t\t\t\t\tenableWalking.Value = false;\n\t\t\t\t\t\tphoneModel.Enabled.Value = true;\n\t\t\t\t\t\tscreen.Enabled.Value = true;\n\t\t\t\t\t\tphoneUi.Enabled.Value = true;\n\t\t\t\t\t\tphoneLight.Enabled.Value = true;\n\t\t\t\t\t\tinput.EnableLook.Value = input.EnableMouse.Value = false;\n\t\t\t\t\t\tSession.Recorder.Event(main, \"Phone\");\n\t\t\t\t\t\tphoneScroll.CheckLayout();\n\t\t\t\t\t\tscrollToBottom();\n\n\t\t\t\t\t\tstring phoneAnimation;\n#if VR\n\t\t\t\t\t\tif (main.VR)\n\t\t\t\t\t\t\tphoneAnimation = \"VRPhone\";\n\t\t\t\t\t\telse\n#endif\n\t\t\t\t\t\t\tphoneAnimation = \"Phone\";\n\n\t\t\t\t\t\tmodel.StartClip(phoneAnimation, 6, true, AnimatedModel.DefaultBlendTime * 2.0f);\n\n\t\t\t\t\t\t// Level the player's view\n\t\t\t\t\t\tif (phoneAnim != null && phoneAnim.Active)\n\t\t\t\t\t\t\tphoneAnim.Delete.Execute();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tstartRotationY = input.Mouse.Value.Y;\n\t\t\t\t\t\tphoneAnim = new Animation\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew Animation.Ease\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tnew Animation.Custom(delegate(float x)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tinput.Mouse.Value = new Vector2(input.Mouse.Value.X, startRotationY * (1.0f - x));\n\t\t\t\t\t\t\t\t}, 0.5f),\n\t\t\t\t\t\t\t\tAnimation.Ease.EaseType.OutQuadratic\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tentity.Add(phoneAnim);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSession.Recorder.Event(main, \"PhoneEnd\");\n\t\t\t\t\t\tenableWalking.Value = true;\n\t\t\t\t\t\tphoneUi.IsMouseVisible.Value = false;\n\n\t\t\t\t\t\t// Return the player's view\n\t\t\t\t\t\tif (phoneAnim != null && phoneAnim.Active)\n\t\t\t\t\t\t\tphoneAnim.Delete.Execute();\n\t\t\t\t\t\tphoneAnim = new Animation\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tnew Animation.Ease\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tnew Animation.Custom(delegate(float x)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tinput.Mouse.Value = new Vector2(input.Mouse.Value.X, startRotationY * x);\n\t\t\t\t\t\t\t\t}, 0.5f),\n\t\t\t\t\t\t\t\tAnimation.Ease.EaseType.OutQuadratic\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tnew Animation.Execute(delegate()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tphoneModel.Enabled.Value = false;\n\t\t\t\t\t\t\t\tscreen.Enabled.Value = false;\n\t\t\t\t\t\t\t\tphoneUi.Enabled.Value = false;\n\t\t\t\t\t\t\t\tphoneLight.Enabled.Value = false;\n\t\t\t\t\t\t\t\tinput.EnableLook.Value = input.EnableMouse.Value = true;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t\tentity.Add(phoneAnim);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tinput.Bind(main.Settings.TogglePhone, PCInput.InputState.Down, delegate()\n\t\t\t{\n\t\t\t\t// Special hack to prevent phone toggling when you're trying to open the Steam overlay\n\t\t\t\tif (main.Settings.TogglePhone.Value.Key == Keys.Tab && input.GetKey(Keys.LeftShift))\n\t\t\t\t\treturn;\n\n\t\t\t\tif (noteActive || phoneActive || phone.CanReceiveMessages)\n\t\t\t\t{\n\t\t\t\t\tif (!phoneActive && (noteActive || player.Note.Value.Target != null))\n\t\t\t\t\t\tshowNote(!noteActive);\n\t\t\t\t\telse if (phone.Enabled)\n\t\t\t\t\t\tshowPhone(!phoneActive);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tphone.Add(new CommandBinding(phone.Show, delegate()\n\t\t\t{\n\t\t\t\tphone.Enabled.Value = true;\n\t\t\t\tif (!phoneActive)\n\t\t\t\t\tshowPhone(true);\n\t\t\t}));\n\n\t\t\t// Gamepad code for the phone\n\n\t\t\tinput.Add(new CommandBinding(input.GetButtonUp(Buttons.A), () => phoneActive && composeButton.Visible && phone.CurrentMode.Value == Phone.Mode.Messages, delegate()\n\t\t\t{\n\t\t\t\tif (answerContainer.Visible)\n\t\t\t\t\tanswerList.Children[selectedAnswer].MouseLeftUp.Execute();\n\t\t\t\telse\n\t\t\t\t\tcomposeButton.MouseLeftUp.Execute();\n\t\t\t}));\n\n\t\t\tinput.Add(new CommandBinding(input.GetButtonUp(Buttons.B), () => phoneActive && answerContainer.Visible, delegate()\n\t\t\t{\n\t\t\t\tanswerContainer.Visible.Value = false;\n\t\t\t}));\n\n\t\t\tconst float moveInterval = 0.1f;\n\t\t\tconst float switchInterval = 0.2f;\n\t\t\tfloat lastScroll = 0;\n\t\t\tfloat lastModeSwitch = 0;\n\t\t\tAction<int> scrollPhone = delegate(int delta)\n\t\t\t{\n\t\t\t\tif (main.TotalTime - lastScroll > moveInterval\n\t\t\t\t\t&& main.TotalTime - lastModeSwitch > switchInterval)\n\t\t\t\t{\n\t\t\t\t\tif (answerContainer.Visible)\n\t\t\t\t\t{\n\t\t\t\t\t\tanswerList.Children[selectedAnswer].Highlighted.Value = false;\n\t\t\t\t\t\tselectedAnswer += delta;\n\t\t\t\t\t\twhile (selectedAnswer < 0)\n\t\t\t\t\t\t\tselectedAnswer += answerList.Children.Length;\n\t\t\t\t\t\twhile (selectedAnswer > answerList.Children.Length - 1)\n\t\t\t\t\t\t\tselectedAnswer -= answerList.Children.Length;\n\t\t\t\t\t\tanswerList.Children[selectedAnswer].Highlighted.Value = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tphoneScroll.MouseScrolled.Execute(delta * -4);\n\t\t\t\t\tlastScroll = main.TotalTime;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tAction switchMode = delegate()\n\t\t\t{\n\t\t\t\tif (main.TotalTime - lastScroll > switchInterval\n\t\t\t\t\t&& main.TotalTime - lastModeSwitch > moveInterval)\n\t\t\t\t{\n\t\t\t\t\tPhone.Mode current = phone.CurrentMode;\n\t\t\t\t\tPhone.Mode nextMode = current == Phone.Mode.Messages ? Phone.Mode.Photos : Phone.Mode.Messages;\n\t\t\t\t\tif (nextMode == Phone.Mode.Photos && string.IsNullOrEmpty(phone.Photo))\n\t\t\t\t\t\tnextMode = Phone.Mode.Messages;\n\t\t\t\t\tphone.CurrentMode.Value = nextMode;\n\t\t\t\t\tlastModeSwitch = main.TotalTime;\n\t\t\t\t}\n\t\t\t};\n\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.LeftThumbstickLeft), () => phoneActive && !answerContainer.Visible, switchMode));\n\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.LeftThumbstickRight), () => phoneActive && !answerContainer.Visible, switchMode));\n\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.DPadLeft), () => phoneActive && !answerContainer.Visible, switchMode));\n\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.DPadRight), () => phoneActive && !answerContainer.Visible, switchMode));\n\n\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.LeftThumbstickUp), () => phoneActive, delegate()\n\t\t\t{\n\t\t\t\tscrollPhone(-1);\n\t\t\t}));\n\n\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.DPadUp), () => phoneActive, delegate()\n\t\t\t{\n\t\t\t\tscrollPhone(-1);\n\t\t\t}));\n\n\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.LeftThumbstickDown), () => phoneActive, delegate()\n\t\t\t{\n\t\t\t\tscrollPhone(1);\n\t\t\t}));\n\n\t\t\tinput.Add(new CommandBinding(input.GetButtonDown(Buttons.DPadDown), () => phoneActive, delegate()\n\t\t\t{\n\t\t\t\tscrollPhone(1);\n\t\t\t}));\n\n\t\t\tFunc<Phone.Sender, Property<Color>> messageColor = delegate(Phone.Sender sender)\n\t\t\t{\n\t\t\t\tswitch (sender)\n\t\t\t\t{\n\t\t\t\t\tcase Phone.Sender.Player:\n\t\t\t\t\t\treturn outgoingColor;\n\t\t\t\t\tcase Phone.Sender.A:\n\t\t\t\t\t\treturn incomingColor;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn alternateSenderColor;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tmsgList.Add(new ListBinding<UIComponent, Phone.Message>\n\t\t\t(\n\t\t\t\tmsgList.Children,\n\t\t\t\tphone.Messages,\n\t\t\t\tdelegate(Phone.Message msg)\n\t\t\t\t{\n\t\t\t\t\treturn makeAlign(makeButton(messageColor(msg.Sender), \"\\\\\" + msg.Name, messageWidth - padding * 2.0f), msg.Sender == Phone.Sender.Player);\n\t\t\t\t}\n\t\t\t));\n\n\t\t\tAction<float, Container> animateMessage = delegate(float delay, Container msg)\n\t\t\t{\n\t\t\t\tmsg.CheckLayout();\n\t\t\t\tVector2 originalSize = msg.Size;\n\t\t\t\tmsg.Size.Value = new Vector2(0, originalSize.Y);\n\t\t\t\tentity.Add(new Animation\n\t\t\t\t(\n\t\t\t\t\tnew Animation.Delay(delay),\n\t\t\t\t\tnew Animation.Ease(new Animation.Vector2MoveTo(msg.Size, originalSize, 0.5f), Animation.Ease.EaseType.OutExponential)\n\t\t\t\t));\n\t\t\t};\n\n\t\t\tContainer typingIndicator = null;\n\n\t\t\tAction showTypingIndicator = delegate()\n\t\t\t{\n\t\t\t\ttypingIndicator = makeAlign(makeButton(incomingColor, \"\\\\...\", messageWidth - padding * 2.0f), false);\n\t\t\t\tmsgList.Children.Add(typingIndicator);\n\t\t\t\tanimateMessage(0.2f, typingIndicator);\n\t\t\t};\n\n\t\t\tif (phone.Schedules.Length > 0)\n\t\t\t\tshowTypingIndicator();\n\n\t\t\tanswerList.Add(new ListBinding<UIComponent, Phone.Ans>\n\t\t\t(\n\t\t\t\tanswerList.Children,\n\t\t\t\tphone.ActiveAnswers,\n\t\t\t\tdelegate(Phone.Ans answer)\n\t\t\t\t{\n\t\t\t\t\tUIComponent button = makeButton(outgoingColor, \"\\\\\" + answer.Name, messageWidth - padding * 4.0f);\n\t\t\t\t\tbutton.Add(new CommandBinding(button.MouseLeftUp, delegate()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!phone.WaitForAnswer) // If we're not waiting for an answer, the player must be initiating a conversation\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// This is the start of a conversation\n\t\t\t\t\t\t\t// Disable the signal tower if we're in range\n\t\t\t\t\t\t\tEntity s = player.SignalTower.Value.Target;\n\t\t\t\t\t\t\tif (s != null)\n\t\t\t\t\t\t\t\ts.Get<SignalTower>().Initial.Value = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PHONE_SEND, entity);\n\t\t\t\t\t\tphone.Answer(answer);\n\n\t\t\t\t\t\tscrollToBottom();\n\t\t\t\t\t\tif (phone.Schedules.Length == 0) // No more messages incoming\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (togglePhoneMessage == null)\n\t\t\t\t\t\t\t\ttogglePhoneMessage = main.Menu.ShowMessage(entity, \"\\\\phone done prompt\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// More messages incoming\n\t\t\t\t\t\t\tshowTypingIndicator();\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t\treturn button;\n\t\t\t\t}\n\t\t\t));\n\n\t\t\tAction refreshComposeButtonVisibility = delegate()\n\t\t\t{\n\t\t\t\tbool show = phone.ActiveAnswers.Length > 0 && phone.Schedules.Length == 0;\n\t\t\t\tanswerContainer.Visible.Value &= show;\n\t\t\t\tcomposeButton.Visible.Value = show;\n\t\t\t\tselectedAnswer = 0;\n\t\t\t};\n\t\t\tcomposeButton.Add(new ListNotifyBinding<Phone.Ans>(refreshComposeButtonVisibility, phone.ActiveAnswers));\n\t\t\tcomposeButton.Add(new ListNotifyBinding<Phone.Schedule>(refreshComposeButtonVisibility, phone.Schedules));\n\t\t\trefreshComposeButtonVisibility();\n\n\t\t\tentity.Add(new CommandBinding(phone.MessageReceived, delegate()\n\t\t\t{\n\t\t\t\tif (typingIndicator != null)\n\t\t\t\t{\n\t\t\t\t\ttypingIndicator.Delete.Execute();\n\t\t\t\t\ttypingIndicator = null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (phone.Schedules.Length > 0)\n\t\t\t\t\tshowTypingIndicator();\n\n\t\t\t\tfloat delay;\n\t\t\t\tif (phoneActive)\n\t\t\t\t{\n\t\t\t\t\tscrollToBottom();\n\t\t\t\t\tdelay = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tshowPhone(true);\n\t\t\t\t\tdelay = 0.5f;\n\t\t\t\t}\n\n\t\t\t\t// Animate the new message\n\t\t\t\tanimateMessage(delay, (Container)msgList.Children[msgList.Children.Length - 1].Children[0]);\n\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PHONE_VIBRATE, entity);\n\t\t\t\tif (togglePhoneMessage == null && phone.Schedules.Length == 0 && phone.ActiveAnswers.Length == 0) // No more messages incoming, and no more answers to give\n\t\t\t\t\ttogglePhoneMessage = main.Menu.ShowMessage(entity, \"[{{TogglePhone}}]\");\n\t\t\t}));\n\n\t\t\tif (noteActive)\n\t\t\t\tshowNote(true);\n\t\t\telse if (phoneActive)\n\t\t\t\tshowPhone(true);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/Player.cs",
    "content": "﻿using System;\nusing BEPUphysics;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.Entities;\nusing BEPUphysics.Entities.Prefabs;\nusing BEPUphysics.UpdateableSystems;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.CollisionRuleManagement;\nusing Lemma.Util;\nusing BEPUphysics.CollisionTests;\nusing System.Xml.Serialization;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing ComponentBind;\n\nnamespace Lemma.Components\n{\n\tpublic class Player : Component<Main>, IUpdateableComponent, IEarlyUpdateableComponent\n\t{\n\t\tpublic const float SlowmoTime = 1.5f;\n\t\t[XmlIgnore]\n\t\tpublic Character Character;\n\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> EnableCrouch = new Property<bool>();\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> PermanentEnableMoves = new Property<bool> { Value = true };\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> TemporaryEnableMoves = new Property<bool> { Value = true };\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> SlowMotion = new Property<bool>();\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> EnableSlowMotion = new Property<bool>();\n\n\t\tpublic Property<ComponentBind.Entity.Handle> Note = new Property<ComponentBind.Entity.Handle>();\n\t\tpublic Property<ComponentBind.Entity.Handle> SignalTower = new Property<ComponentBind.Entity.Handle>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command Die = new Command();\n\n\t\tprivate const float damageSoundInterval = 0.4f;\n\t\tprivate float damageTimer = damageSoundInterval + 1.0f;\n\t\tprivate float slowmoTimer;\n\t\tpublic Property<float> Health = new Property<float> { Value = 1.0f };\n\n\t\tprivate float lastSpeed = 0.0f;\n\n\t\t[XmlIgnore]\n\t\tpublic Command<float> Rumble = new Command<float>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<int> UpdateOrder { get; set; }\n\n\t\tprivate const float healthRegenerateDelay = 3.0f;\n\t\tprivate const float healthRegenerateRate = 0.1f;\n\n\t\tpublic Player()\n\t\t{\n\t\t\tthis.UpdateOrder = new Property<int> { Value = 0 };\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Character = new Character(this.main, this, Vector3.Zero);\n\t\t\tthis.Add(new NotifyBinding(this.main.EarlyUpdateablesModified, this.UpdateOrder));\n\t\t\tthis.Character.Body.Tag = this;\n\t\t\tthis.main.Space.Add(this.Character);\n\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_FALL, this.Entity);\n\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_PLAYER_FALL, 0.0f);\n\t\t\tSoundKiller.Add(this.Entity, AK.EVENTS.STOP_PLAYER_FALL);\n\n\t\t\tthis.Add(new ChangeBinding<float>(this.Health, delegate(float old, float value)\n\t\t\t{\n\t\t\t\tif (value < old && this.damageTimer > damageSoundInterval)\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_HURT, this.Entity);\n\t\t\t\t\tthis.damageTimer = 0.0f;\n\t\t\t\t\tthis.Rumble.Execute(Math.Min(0.3f, (old - value) * 2.0f));\n\t\t\t\t}\n\t\t\t\tif (old > 0.0f && value <= 0.0f)\n\t\t\t\t\tthis.Die.Execute();\n\t\t\t}));\n\n\t\t\tthis.Add(new Binding<float>(this.main.TimeMultiplier, () => this.SlowMotion && !this.main.Paused ? 0.4f : 1.0f, this.SlowMotion, this.main.Paused));\n\t\t\tthis.Add(new ChangeBinding<bool>(this.SlowMotion, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (!old && value)\n\t\t\t\t{\n\t\t\t\t\tthis.slowmoTimer = 0;\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tthis.main.TimeMultiplier.Value = 1.0f;\n\t\t\tthis.main.Space.Remove(this.Character);\n\t\t}\n\n\t\tvoid IEarlyUpdateableComponent.Update(float dt)\n\t\t{\n\t\t\tthis.Character.Transform.Value = this.Character.Body.WorldTransform;\n\t\t\tthis.Character.LinearVelocity.Value = this.Character.Body.LinearVelocity;\n\t\t}\n\n\t\tvoid IUpdateableComponent.Update(float dt)\n\t\t{\n\t\t\tif (this.SlowMotion)\n\t\t\t{\n\t\t\t\tthis.slowmoTimer += dt;\n\t\t\t\tif (this.slowmoTimer > Player.SlowmoTime)\n\t\t\t\t\tthis.SlowMotion.Value = false;\n\t\t\t}\n\n\t\t\tthis.damageTimer += dt;\n\t\t\tif (this.Health < 1.0f)\n\t\t\t{\n\t\t\t\tif (this.damageTimer > Player.healthRegenerateDelay)\n\t\t\t\t\tthis.Health.Value += Player.healthRegenerateRate * dt;\n\t\t\t}\n\n\t\t\tVector3 velocity = this.Character.LinearVelocity.Value;\n\t\t\tif (this.SlowMotion && velocity.Y < FallDamage.RollingDeathVelocity)\n\t\t\t\tthis.SlowMotion.Value = false;\n\n\t\t\tfloat speed = velocity.Length();\n\t\t\tif (speed < this.lastSpeed)\n\t\t\t\tspeed = Math.Max(speed, this.lastSpeed - 40.0f * dt);\n\t\t\telse if (speed > this.lastSpeed)\n\t\t\t\tspeed = Math.Min(speed, this.lastSpeed + 10.0f * dt);\n\t\t\tthis.lastSpeed = speed;\n\t\t\tfloat maxSpeed = this.Character.MaxSpeed * 1.3f;\n\t\t\tfloat volume;\n\t\t\tif (speed > maxSpeed)\n\t\t\t\tvolume = (speed - maxSpeed) / (maxSpeed * 2.0f);\n\t\t\telse\n\t\t\t\tvolume = 0.0f;\n\t\t\tAkSoundEngine.SetRTPCValue(AK.GAME_PARAMETERS.SFX_PLAYER_FALL, volume);\n\n\t\t\t// Determine if the player is swimming\n\t\t\tbool swimming = false;\n\t\t\tVector3 pos = this.Character.Transform.Value.Translation + new Vector3(0, -1.0f, 0);\n\t\t\tforeach (Water w in Water.ActiveInstances)\n\t\t\t{\n\t\t\t\tif (w.Fluid.BoundingBox.Contains(pos) != ContainmentType.Disjoint)\n\t\t\t\t{\n\t\t\t\t\tswimming = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.Character.IsSwimming.Value = swimming;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/PlayerFactory.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework.Input;\nusing BEPUphysics;\nusing Lemma.Util;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing BEPUphysics.NarrowPhaseSystems.Pairs;\nusing Lemma.Console;\n\nnamespace Lemma.Factories\n{\n\tpublic class PlayerFactory : Factory<Main>\n\t{\n\t\tpublic PlayerFactory()\n\t\t{\n\t\t\tthis.Color = new Vector3(0.4f, 0.4f, 0.4f);\n\t\t\tthis.EditorCanSpawn = false;\n\t\t}\n\n\t\tpublic override Entity Create(Main main)\n\t\t{\n\t\t\treturn new Entity(main, \"Player\");\n\t\t}\n\n\t\tprivate static Entity instance;\n\t\tpublic static Entity Instance\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (PlayerFactory.instance != null && !PlayerFactory.instance.Active)\n\t\t\t\t\tPlayerFactory.instance = null;\n\t\t\t\treturn PlayerFactory.instance;\n\t\t\t}\n\n\t\t\tset\n\t\t\t{\n\t\t\t\tPlayerFactory.instance = value;\n\t\t\t}\n\t\t}\n\n\t\tprivate Random random = new Random();\n\n\t\tpublic override void Bind(Entity entity, Main main, bool creating = false)\n\t\t{\n\t\t\tMain.Config settings = main.Settings;\n\t\t\tTransform transform = entity.GetOrCreate<Transform>(\"Transform\");\n\n\t\t\tentity.CannotSuspend = true;\n\n\t\t\tPlayerFactory.Instance = entity;\n\n\t\t\tthis.SetMain(entity, main);\n\n\t\t\tFPSInput input = new FPSInput();\n\t\t\tinput.EnabledWhenPaused = false;\n\t\t\tentity.Add(\"Input\", input);\n\n\t\t\tUpdater parkour = entity.Create<Updater>();\n\t\t\tUpdater jumper = entity.Create<Updater>();\n\n\t\t\tPlayer player = entity.GetOrCreate<Player>(\"Player\");\n\n\t\t\tAnimatedModel firstPersonModel = entity.GetOrCreate<AnimatedModel>(\"FirstPersonModel\");\n\t\t\tfirstPersonModel.MapContent = false;\n\t\t\tfirstPersonModel.Serialize = false;\n\t\t\tfirstPersonModel.Filename.Value = \"Models\\\\joan-firstperson\";\n\t\t\tfirstPersonModel.CullBoundingBox.Value = false;\n\n\t\t\tAnimatedModel model = entity.GetOrCreate<AnimatedModel>(\"Model\");\n\t\t\tmodel.MapContent = false;\n\t\t\tmodel.Serialize = false;\n\t\t\tmodel.Filename.Value = \"Models\\\\joan\";\n\t\t\tmodel.CullBoundingBox.Value = false;\n\n\t\t\tAnimationController anim = entity.GetOrCreate<AnimationController>(\"AnimationController\");\n\t\t\tRotationController rotation = entity.GetOrCreate<RotationController>(\"Rotation\");\n\t\t\tBlockPredictor predictor = entity.GetOrCreate<BlockPredictor>(\"BlockPredictor\");\n\t\t\tJump jump = entity.GetOrCreate<Jump>(\"Jump\");\n\t\t\tRollKickSlide rollKickSlide = entity.GetOrCreate<RollKickSlide>(\"RollKickSlide\");\n\t\t\tVault vault = entity.GetOrCreate<Vault>(\"Vault\");\n\t\t\tWallRun wallRun = entity.GetOrCreate<WallRun>(\"WallRun\");\n\t\t\tVoxelTools voxelTools = entity.GetOrCreate<VoxelTools>(\"VoxelTools\");\n\t\t\tFootsteps footsteps = entity.GetOrCreate<Footsteps>(\"Footsteps\");\n\t\t\tFallDamage fallDamage = entity.GetOrCreate<FallDamage>(\"FallDamage\");\n\t\t\tFPSCamera fpsCamera = entity.GetOrCreate<FPSCamera>(\"FPSCamera\");\n\t\t\tfpsCamera.Enabled.Value = false;\n\t\t\tRumble rumble = entity.GetOrCreate<Rumble>(\"Rumble\");\n\t\t\tCameraController cameraControl = entity.GetOrCreate<CameraController>(\"CameraControl\");\n\n\t\t\tProperty<Vector3> floor = new Property<Vector3>();\n\t\t\ttransform.Add(new Binding<Vector3>(floor, () => transform.Position + new Vector3(0, player.Character.Height * -0.5f, 0), transform.Position, player.Character.Height));\n\t\t\tSound.AttachTracker(entity, floor);\n\n\t\t\tpredictor.Add(new Binding<Vector3>(predictor.FootPosition, floor));\n\t\t\tpredictor.Add(new Binding<Vector3>(predictor.LinearVelocity, player.Character.LinearVelocity));\n\t\t\tpredictor.Add(new Binding<float>(predictor.Rotation, rotation.Rotation));\n\t\t\tpredictor.Add(new Binding<float>(predictor.MaxSpeed, player.Character.MaxSpeed));\n\t\t\tpredictor.Add(new Binding<float>(predictor.JumpSpeed, player.Character.JumpSpeed));\n\t\t\tpredictor.Add(new Binding<bool>(predictor.IsSupported, player.Character.IsSupported));\n\n\t\t\tjump.Add(new Binding<bool>(jump.Crouched, player.Character.Crouched));\n\t\t\tjump.Add(new TwoWayBinding<bool>(player.Character.IsSupported, jump.IsSupported));\n\t\t\tjump.Add(new TwoWayBinding<bool>(player.Character.HasTraction, jump.HasTraction));\n\t\t\tjump.Add(new TwoWayBinding<Vector3>(player.Character.LinearVelocity, jump.LinearVelocity));\n\t\t\tjump.Add(new TwoWayBinding<BEPUphysics.Entities.Entity>(jump.SupportEntity, player.Character.SupportEntity));\n\t\t\tjump.Add(new TwoWayBinding<Vector3>(jump.SupportVelocity, player.Character.SupportVelocity));\n\t\t\tjump.Add(new Binding<Vector2>(jump.AbsoluteMovementDirection, player.Character.MovementDirection));\n\t\t\tjump.Add(new Binding<WallRun.State>(jump.WallRunState, wallRun.CurrentState));\n\t\t\tjump.Add(new Binding<float>(jump.Rotation, rotation.Rotation));\n\t\t\tjump.Add(new Binding<Vector3>(jump.Position, transform.Position));\n\t\t\tjump.Add(new Binding<Vector3>(jump.FloorPosition, floor));\n\t\t\tjump.Add(new Binding<float>(jump.MaxSpeed, player.Character.MaxSpeed));\n\t\t\tjump.Add(new Binding<float>(jump.JumpSpeed, player.Character.JumpSpeed));\n\t\t\tjump.Add(new Binding<float>(jump.Mass, player.Character.Mass));\n\t\t\tjump.Add(new Binding<float>(jump.LastRollKickEnded, rollKickSlide.LastRollKickEnded));\n\t\t\tjump.Add(new Binding<Voxel>(jump.WallRunMap, wallRun.WallRunVoxel));\n\t\t\tjump.Add(new Binding<Direction>(jump.WallDirection, wallRun.WallDirection));\n\t\t\tjump.Add(new CommandBinding<Voxel, Voxel.Coord, Direction>(jump.WalkedOn, footsteps.WalkedOn));\n\t\t\tjump.Add(new CommandBinding(jump.DeactivateWallRun, (Action)wallRun.Deactivate));\n\t\t\tjump.FallDamage = fallDamage;\n\t\t\tjump.Predictor = predictor;\n\t\t\tjump.Bind(model);\n\t\t\tjump.Add(new TwoWayBinding<Voxel>(wallRun.LastWallRunMap, jump.LastWallRunMap));\n\t\t\tjump.Add(new TwoWayBinding<Direction>(wallRun.LastWallDirection, jump.LastWallDirection));\n\t\t\tjump.Add(new TwoWayBinding<bool>(rollKickSlide.CanKick, jump.CanKick));\n\t\t\tjump.Add(new TwoWayBinding<float>(player.Character.LastSupportedSpeed, jump.LastSupportedSpeed));\n\n\t\t\twallRun.Add(new Binding<bool>(wallRun.IsSwimming, player.Character.IsSwimming));\n\t\t\twallRun.Add(new TwoWayBinding<Vector3>(player.Character.LinearVelocity, wallRun.LinearVelocity));\n\t\t\twallRun.Add(new TwoWayBinding<Vector3>(transform.Position, wallRun.Position));\n\t\t\twallRun.Add(new TwoWayBinding<bool>(player.Character.IsSupported, wallRun.IsSupported));\n\t\t\twallRun.Add(new CommandBinding(wallRun.LockRotation, (Action)rotation.Lock));\n\t\t\twallRun.Add(new CommandBinding<float>(wallRun.UpdateLockedRotation, rotation.UpdateLockedRotation));\n\t\t\tvault.Add(new CommandBinding(wallRun.Vault, delegate() { vault.Go(true); }));\n\t\t\twallRun.Predictor = predictor;\n\t\t\twallRun.Add(new Binding<float>(wallRun.Height, player.Character.Height));\n\t\t\twallRun.Add(new Binding<float>(wallRun.JumpSpeed, player.Character.JumpSpeed));\n\t\t\twallRun.Add(new Binding<float>(wallRun.MaxSpeed, player.Character.MaxSpeed));\n\t\t\twallRun.Add(new TwoWayBinding<float>(rotation.Rotation, wallRun.Rotation));\n\t\t\twallRun.Add(new TwoWayBinding<bool>(player.Character.AllowUncrouch, wallRun.AllowUncrouch));\n\t\t\twallRun.Add(new TwoWayBinding<bool>(player.Character.HasTraction, wallRun.HasTraction));\n\t\t\twallRun.Add(new Binding<float>(wallRun.LastWallJump, jump.LastWallJump));\n\t\t\twallRun.Add(new Binding<float>(player.Character.LastSupportedSpeed, wallRun.LastSupportedSpeed));\n\t\t\tplayer.Add(new Binding<WallRun.State>(player.Character.WallRunState, wallRun.CurrentState));\n\n\t\t\tinput.Bind(rollKickSlide.RollKickButton, settings.RollKick);\n\t\t\trollKickSlide.Add(new Binding<bool>(rollKickSlide.EnableCrouch, player.EnableCrouch));\n\t\t\trollKickSlide.Add(new Binding<float>(rollKickSlide.Rotation, rotation.Rotation));\n\t\t\trollKickSlide.Add(new Binding<bool>(rollKickSlide.IsSwimming, player.Character.IsSwimming));\n\t\t\trollKickSlide.Add(new Binding<bool>(rollKickSlide.IsSupported, player.Character.IsSupported));\n\t\t\trollKickSlide.Add(new Binding<Vector3>(rollKickSlide.FloorPosition, floor));\n\t\t\trollKickSlide.Add(new Binding<float>(rollKickSlide.Height, player.Character.Height));\n\t\t\trollKickSlide.Add(new Binding<float>(rollKickSlide.MaxSpeed, player.Character.MaxSpeed));\n\t\t\trollKickSlide.Add(new Binding<float>(rollKickSlide.JumpSpeed, player.Character.JumpSpeed));\n\t\t\trollKickSlide.Add(new Binding<Vector3>(rollKickSlide.SupportVelocity, player.Character.SupportVelocity));\n\t\t\trollKickSlide.Add(new TwoWayBinding<bool>(wallRun.EnableEnhancedWallRun, rollKickSlide.EnableEnhancedRollSlide));\n\t\t\trollKickSlide.Add(new TwoWayBinding<bool>(player.Character.AllowUncrouch, rollKickSlide.AllowUncrouch));\n\t\t\trollKickSlide.Add(new TwoWayBinding<bool>(player.Character.Crouched, rollKickSlide.Crouched));\n\t\t\trollKickSlide.Add(new TwoWayBinding<bool>(player.Character.EnableWalking, rollKickSlide.EnableWalking));\n\t\t\trollKickSlide.Add(new TwoWayBinding<Vector3>(player.Character.LinearVelocity, rollKickSlide.LinearVelocity));\n\t\t\trollKickSlide.Add(new TwoWayBinding<Vector3>(transform.Position, rollKickSlide.Position));\n\t\t\trollKickSlide.Predictor = predictor;\n\t\t\trollKickSlide.Bind(model);\n\t\t\trollKickSlide.VoxelTools = voxelTools;\n\t\t\trollKickSlide.Add(new CommandBinding(rollKickSlide.DeactivateWallRun, (Action)wallRun.Deactivate));\n\t\t\trollKickSlide.Add(new CommandBinding(rollKickSlide.Footstep, footsteps.Footstep));\n\t\t\trollKickSlide.Add(new CommandBinding(rollKickSlide.LockRotation, (Action)rotation.Lock));\n\t\t\tSoundKiller.Add(entity, AK.EVENTS.STOP_PLAYER_SLIDE_LOOP);\n\n\t\t\tvault.Add(new Binding<Vector3>(vault.Position, transform.Position));\n\t\t\tvault.Add(new Binding<Vector3>(vault.FloorPosition, floor));\n\t\t\tvault.Add(new Binding<float>(vault.MaxSpeed, player.Character.MaxSpeed));\n\t\t\tvault.Add(new Binding<WallRun.State>(vault.WallRunState, wallRun.CurrentState));\n\t\t\tvault.Add(new CommandBinding(vault.LockRotation, (Action)rotation.Lock));\n\t\t\tvault.Add(new CommandBinding(vault.DeactivateWallRun, (Action)wallRun.Deactivate));\n\t\t\tvault.Add(new TwoWayBinding<float>(player.Character.LastSupportedSpeed, vault.LastSupportedSpeed));\n\t\t\tvault.Add(new CommandBinding<float>(vault.FallDamage, fallDamage.Apply));\n\t\t\tvault.Bind(model);\n\t\t\tvault.Predictor = predictor;\n\t\t\tvault.Add(new TwoWayBinding<float>(rotation.Rotation, vault.Rotation));\n\t\t\tvault.Add(new TwoWayBinding<bool>(player.Character.IsSupported, vault.IsSupported));\n\t\t\tvault.Add(new TwoWayBinding<bool>(player.Character.HasTraction, vault.HasTraction));\n\t\t\tvault.Add(new TwoWayBinding<Vector3>(player.Character.LinearVelocity, vault.LinearVelocity));\n\t\t\tvault.Add(new TwoWayBinding<bool>(player.Character.EnableWalking, vault.EnableWalking));\n\t\t\tvault.Add(new TwoWayBinding<bool>(player.Character.AllowUncrouch, vault.AllowUncrouch));\n\t\t\tvault.Add(new TwoWayBinding<bool>(player.Character.Crouched, vault.Crouched));\n\t\t\tvault.Add(new Binding<float>(vault.Radius, player.Character.Radius));\n\n\t\t\trotation.Add(new TwoWayBinding<Vector2>(rotation.Mouse, input.Mouse));\n\t\t\trotation.Add(new Binding<bool>(rotation.Rolling, rollKickSlide.Rolling));\n\t\t\trotation.Add(new Binding<bool>(rotation.Kicking, rollKickSlide.Kicking));\n\t\t\trotation.Add(new Binding<Vault.State>(rotation.VaultState, vault.CurrentState));\n\t\t\trotation.Add(new Binding<WallRun.State>(rotation.WallRunState, wallRun.CurrentState));\n\n\t\t\tvoxelTools.Add(new Binding<float>(voxelTools.Height, player.Character.Height));\n\t\t\tvoxelTools.Add(new Binding<float>(voxelTools.SupportHeight, player.Character.SupportHeight));\n\t\t\tvoxelTools.Add(new Binding<Vector3>(voxelTools.Position, transform.Position));\n\n\t\t\tanim.Add(new Binding<bool>(anim.IsSupported, player.Character.IsSupported));\n\t\t\tanim.Add(new Binding<WallRun.State>(anim.WallRunState, wallRun.CurrentState));\n\t\t\tanim.Add(new Binding<bool>(anim.EnableWalking, player.Character.EnableWalking));\n\t\t\tanim.Add(new Binding<bool>(anim.Crouched, player.Character.Crouched));\n\t\t\tanim.Add(new Binding<Vector3>(anim.LinearVelocity, player.Character.LinearVelocity));\n\t\t\tanim.Add(new Binding<Vector2>(anim.Movement, input.Movement));\n\t\t\tanim.Add(new Binding<Vector2>(anim.Mouse, input.Mouse));\n\t\t\tanim.Add(new Binding<float>(anim.Rotation, rotation.Rotation));\n\t\t\tanim.Add(new Binding<Voxel>(anim.WallRunMap, wallRun.WallRunVoxel));\n\t\t\tanim.Add(new Binding<Direction>(anim.WallDirection, wallRun.WallDirection));\n\t\t\tanim.Add(new Binding<bool>(anim.IsSwimming, player.Character.IsSwimming));\n\t\t\tanim.Add(new Binding<bool>(anim.Kicking, rollKickSlide.Kicking));\n\t\t\tanim.Add(new Binding<Vector3>(anim.SupportVelocity, player.Character.SupportVelocity));\n\t\t\tanim.Add\n\t\t\t(\n\t\t\t\tnew Binding<bool>\n\t\t\t\t(\n\t\t\t\t\tanim.EnableLean,\n\t\t\t\t\t() => player.Character.EnableWalking.Value && player.Character.IsSupported.Value && input.Movement.Value.Y > 0.5f,\n\t\t\t\t\tplayer.Character.EnableWalking, player.Character.IsSupported, input.Movement\n\t\t\t\t)\n\t\t\t);\n\t\t\tanim.Bind(model);\n\n\t\t\t// Camera control\n\t\t\tmodel.UpdateWorldTransforms();\n\n\t\t\tcameraControl.Add(new Binding<Vector2>(cameraControl.Mouse, input.Mouse));\n\t\t\tcameraControl.Add(new Binding<float>(cameraControl.Lean, x => x * (float)Math.PI * 0.05f, anim.Lean));\n\t\t\tcameraControl.Add(new Binding<Vector3>(cameraControl.LinearVelocity, player.Character.LinearVelocity));\n\t\t\tcameraControl.Add(new Binding<float>(cameraControl.MaxSpeed, player.Character.MaxSpeed));\n\t\t\tcameraControl.Add(new Binding<Matrix>(cameraControl.CameraBone, model.GetBoneTransform(\"Camera\")));\n\t\t\tcameraControl.Add(new Binding<Matrix>(cameraControl.HeadBone, model.GetBoneTransform(\"ORG-head\")));\n\t\t\tcameraControl.Add(new Binding<Matrix>(cameraControl.ModelTransform, model.Transform));\n\t\t\tcameraControl.Add(new Binding<float>(cameraControl.BaseCameraShakeAmount, () => MathHelper.Clamp((player.Character.LinearVelocity.Value.Length() - (player.Character.MaxSpeed * 2.5f)) / (player.Character.MaxSpeed * 4.0f), 0, 1), player.Character.LinearVelocity, player.Character.MaxSpeed));\n\t\t\tcameraControl.Offset = model.GetBoneTransform(\"Camera\").Value.Translation - model.GetBoneTransform(\"ORG-head\").Value.Translation;\n\n\t\t\tfloat heightOffset = 0.1f;\n#if VR\n\t\t\tif (main.VR)\n\t\t\t\theightOffset = 0.4f;\n#endif\n\t\t\tcameraControl.Offset += new Vector3(0, heightOffset, 0);\n\n\t\t\trumble.Add(new Binding<float>(rumble.CameraShake, cameraControl.TotalCameraShake));\n\t\t\trumble.Add(new CommandBinding<float>(fallDamage.Rumble, rumble.Go));\n\t\t\trumble.Add(new CommandBinding<float>(player.Rumble, rumble.Go));\n\t\t\trumble.Add(new CommandBinding<float>(rollKickSlide.Rumble, rumble.Go));\n\n\t\t\tfirstPersonModel.Add(new Binding<bool>(firstPersonModel.Enabled, x => !x, cameraControl.ThirdPerson));\n\n\t\t\tmodel.Add(new ChangeBinding<bool>(cameraControl.ThirdPerson, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (value && !old)\n\t\t\t\t{\n\t\t\t\t\tmodel.UnsupportedTechniques.Remove(Technique.Clip);\n\t\t\t\t\tmodel.UnsupportedTechniques.Remove(Technique.Render);\n\t\t\t\t}\n\t\t\t\telse if (old && !value)\n\t\t\t\t{\n\t\t\t\t\tmodel.UnsupportedTechniques.Add(Technique.Clip);\n\t\t\t\t\tmodel.UnsupportedTechniques.Add(Technique.Render);\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tLemma.Console.Console.AddConCommand(new Console.ConCommand(\"third_person\", \"Toggle third-person view (warning: janky)\", delegate(Console.ConCommand.ArgCollection args)\n\t\t\t{\n\t\t\t\tcameraControl.ThirdPerson.Value = !cameraControl.ThirdPerson;\n\t\t\t}));\n\t\t\tLemma.Console.Console.AddConCommand(new Console.ConCommand(\"velocity\", \"Toggle debug velocity display\", delegate(Console.ConCommand.ArgCollection args)\n\t\t\t{\n\t\t\t\tPlayerData data = PlayerDataFactory.Instance.Get<PlayerData>();\n\t\t\t\tdata.DebugVelocity.Value = !data.DebugVelocity.Value;\n\t\t\t}));\n\t\t\tentity.Add(new CommandBinding(entity.Delete, delegate()\n\t\t\t{\n\t\t\t\tLemma.Console.Console.RemoveConCommand(\"third_person\");\n\t\t\t\tLemma.Console.Console.RemoveConCommand(\"velocity\");\n\t\t\t}));\n\n\t\t\t// When rotation is locked, we want to make sure the player can't turn their head\n\t\t\t// 180 degrees from the direction they're facing\n\n#if VR\n\t\t\tif (main.VR)\n\t\t\t\tinput.MaxY.Value = input.MinY.Value = 0;\n\t\t\telse\n#endif\n\t\t\t\tinput.Add(new Binding<float>(input.MaxY, () => rotation.Locked ? (float)Math.PI * 0.3f : (float)Math.PI * 0.4f, rotation.Locked));\n\n\t\t\tinput.Add(new Binding<float>(input.MinX, () => rotation.Locked ? rotation.Rotation + ((float)Math.PI * -0.4f) : 0.0f, rotation.Rotation, rotation.Locked));\n\t\t\tinput.Add(new Binding<float>(input.MaxX, () => rotation.Locked ? rotation.Rotation + ((float)Math.PI * 0.4f) : 0.0f, rotation.Rotation, rotation.Locked));\n\t\t\tinput.Add(new NotifyBinding(delegate() { input.Mouse.Changed(); }, rotation.Locked)); // Make sure the rotation locking takes effect even if the player doesn't move the mouse\n\n\t\t\t// Setup rendering properties\n\n\t\t\tmodel.Materials = firstPersonModel.Materials = new Model.Material[3];\n\n\t\t\t// Hoodie and shoes\n\t\t\tmodel.Materials[0] = new Model.Material\n\t\t\t{\n\t\t\t\tSpecularIntensity = 0.0f,\n\t\t\t\tSpecularPower = 1.0f,\n\t\t\t};\n\n\t\t\t// Hands\n\t\t\tmodel.Materials[1] = new Model.Material\n\t\t\t{\n\t\t\t\tSpecularIntensity = 0.3f,\n\t\t\t\tSpecularPower = 2.0f,\n\t\t\t};\n\n\t\t\t// Pants and skin\n\t\t\tmodel.Materials[2] = new Model.Material\n\t\t\t{\n\t\t\t\tSpecularIntensity = 0.5f,\n\t\t\t\tSpecularPower = 20.0f,\n\t\t\t};\n\n\t\t\tfirstPersonModel.Bind(model);\n\n\t\t\t// Third person model only gets rendered for shadows. No regular rendering or reflections.\n\t\t\tmodel.UnsupportedTechniques.Add(Technique.Clip);\n\t\t\tmodel.UnsupportedTechniques.Add(Technique.Render);\n\t\t\t\n\t\t\t// First-person model only used for regular rendering. No shadows or reflections.\n\t\t\tfirstPersonModel.UnsupportedTechniques.Add(Technique.Shadow);\n\t\t\tfirstPersonModel.UnsupportedTechniques.Add(Technique.Clip);\n\n\t\t\t// Build UI\n\t\t\tUIRenderer ui = new UIRenderer();\n\t\t\tui.DrawOrder.Value = -1;\n\t\t\tui.EnabledWhenPaused = true;\n\t\t\tui.EnabledInEditMode = false;\n\t\t\tentity.Add(\"UI\", ui);\n\n\t\t\tinput.Add(new Binding<float>(input.MouseSensitivity, settings.MouseSensitivity));\n\t\t\tinput.Add(new Binding<bool>(input.InvertMouseX, settings.InvertMouseX));\n\t\t\tinput.Add(new Binding<bool>(input.InvertMouseY, settings.InvertMouseY));\n\t\t\tinput.Add(new Binding<PCInput.PCInputBinding>(input.LeftKey, settings.Left));\n\t\t\tinput.Add(new Binding<PCInput.PCInputBinding>(input.RightKey, settings.Right));\n\t\t\tinput.Add(new Binding<PCInput.PCInputBinding>(input.BackwardKey, settings.Backward));\n\t\t\tinput.Add(new Binding<PCInput.PCInputBinding>(input.ForwardKey, settings.Forward));\n\n\t\t\tmodel.StartClip(\"Idle\", 0, true, AnimatedModel.DefaultBlendTime);\n\n\t\t\t// Set up AI agent\n\t\t\tAgent agent = entity.GetOrCreate<Agent>();\n\t\t\tagent.Add(new TwoWayBinding<float>(player.Health, agent.Health));\n\t\t\tagent.Add(new Binding<Vector3>(agent.Position, () => transform.Position.Value + new Vector3(0, player.Character.Height * -0.5f, 0), transform.Position, player.Character.Height));\n\t\t\tagent.Add(new Binding<bool>(agent.Loud, () => player.Character.MovementDirection.Value.LengthSquared() > 0 && !player.Character.Crouched, player.Character.Crouched));\n\n\t\t\t// Blocks\n\t\t\tBlockCloud blockCloud = entity.GetOrCreate<BlockCloud>(\"BlockCloud\");\n\t\t\tblockCloud.Scale.Value = 0.5f;\n\t\t\tblockCloud.Add(new Binding<Vector3>(blockCloud.Position, () => transform.Position.Value + new Vector3(0, player.Character.Height * 0.5f + player.Character.LinearVelocity.Value.Y, 0), transform.Position, player.Character.Height, player.Character.LinearVelocity));\n\t\t\tblockCloud.Blocks.ItemAdded += delegate(int index, Entity.Handle block)\n\t\t\t{\n\t\t\t\tEntity e = block.Target;\n\t\t\t\tif (e != null)\n\t\t\t\t{\n\t\t\t\t\te.Serialize = false;\n\t\t\t\t\tPhysicsBlock.CancelPlayerCollisions(e.Get<PhysicsBlock>());\n\t\t\t\t}\n\t\t\t};\n\t\t\tpredictor.Add(new Binding<Voxel.t>(predictor.BlockType, blockCloud.Type));\n\n\t\t\tPointLight blockLight = entity.Create<PointLight>();\n\t\t\tblockLight.Add(new Binding<Vector3>(blockLight.Position, blockCloud.AveragePosition));\n\t\t\tblockLight.Add(new Binding<bool, int>(blockLight.Enabled, x => x > 0, blockCloud.Blocks.Length));\n\t\t\tblockLight.Attenuation.Value = 30.0f;\n\t\t\tblockLight.Add(new Binding<Vector3, Voxel.t>(blockLight.Color, delegate(Voxel.t t)\n\t\t\t{\n\t\t\t\tswitch (t)\n\t\t\t\t{\n\t\t\t\t\tcase Voxel.t.GlowBlue:\n\t\t\t\t\t\treturn new Vector3(0.7f, 0.7f, 0.9f);\n\t\t\t\t\tcase Voxel.t.GlowYellow:\n\t\t\t\t\t\treturn new Vector3(0.9f, 0.9f, 0.7f);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn new Vector3(0.8f, 0.8f, 0.8f);\n\t\t\t\t}\n\t\t\t}, blockCloud.Type));\n\n\t\t\tblockLight.Add(new ChangeBinding<bool>(blockLight.Enabled, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (!old && value)\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_MAGIC_CUBE_LOOP, entity);\n\t\t\t\telse if (old && !value)\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_MAGIC_CUBE_LOOP, entity);\n\t\t\t}));\n\t\t\tif (blockLight.Enabled)\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_MAGIC_CUBE_LOOP, entity);\n\n\t\t\t// Death\n\t\t\tentity.Add(new CommandBinding(player.Die, blockCloud.Clear));\n\t\t\tentity.Add(new CommandBinding(player.Die, delegate()\n\t\t\t{\n\t\t\t\tSession.Recorder.Event(main, \"Die\");\n\t\t\t\tif (agent.Killed || Agent.Query(transform.Position, 0.0f, 10.0f, x => x != agent) != null)\n\t\t\t\t{\n\t\t\t\t\tSession.Recorder.Event(main, \"Killed\");\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_DEATH, entity);\n\t\t\t\t\tmain.Spawner.RespawnDistance = Spawner.KilledRespawnDistance;\n\t\t\t\t\tmain.Spawner.RespawnInterval = Spawner.KilledRespawnInterval;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmain.Spawner.RespawnDistance = Spawner.DefaultRespawnDistance;\n\t\t\t\t\tmain.Spawner.RespawnInterval = Spawner.DefaultRespawnInterval;\n\t\t\t\t}\n\t\t\t\tentity.Add(new Animation(new Animation.Execute(entity.Delete)));\n\t\t\t}));\n\n\t\t\tplayer.EnabledInEditMode = false;\n\n\t\t\tplayer.Add(new TwoWayBinding<Matrix>(transform.Matrix, player.Character.Transform));\n\n\t\t\tmodel.Add(new Binding<Matrix>(model.Transform, delegate()\n\t\t\t{\n\t\t\t\tconst float leanAmount = (float)Math.PI * 0.1f;\n\t\t\t\treturn Matrix.CreateTranslation(0, (player.Character.Height * -0.5f) - player.Character.SupportHeight, 0) * Matrix.CreateRotationZ(anim.Lean * leanAmount) * Matrix.CreateRotationY(rotation.Rotation) * transform.Matrix;\n\t\t\t}, transform.Matrix, rotation.Rotation, player.Character.Height, player.Character.SupportHeight, anim.Lean));\n\n\t\t\tfirstPersonModel.Add(new Binding<Matrix>(firstPersonModel.Transform, model.Transform));\n\t\t\tfirstPersonModel.Add(new Binding<Vector3>(firstPersonModel.Scale, model.Scale));\n\n\t\t\tWallRun.State[] footstepWallrunStates = new[]\n\t\t\t{\n\t\t\t\tWallRun.State.Left,\n\t\t\t\tWallRun.State.Right,\n\t\t\t\tWallRun.State.Straight,\n\t\t\t\tWallRun.State.None,\n\t\t\t};\n\t\t\tfootsteps.Add(new Binding<bool>(footsteps.SoundEnabled, () => !player.Character.Crouched && footstepWallrunStates.Contains(wallRun.CurrentState) || (player.Character.IsSupported && player.Character.EnableWalking), player.Character.IsSupported, player.Character.EnableWalking, wallRun.CurrentState, player.Character.Crouched));\n\t\t\tfootsteps.Add(new Binding<Vector3>(footsteps.Position, transform.Position));\n\t\t\tfootsteps.Add(new Binding<float>(footsteps.Rotation, rotation.Rotation));\n\t\t\tfootsteps.Add(new Binding<float>(footsteps.CharacterHeight, player.Character.Height));\n\t\t\tfootsteps.Add(new Binding<float>(footsteps.SupportHeight, player.Character.SupportHeight));\n\t\t\tfootsteps.Add(new Binding<bool>(footsteps.IsSupported, player.Character.IsSupported));\n\t\t\tfootsteps.Add(new Binding<bool>(footsteps.IsSwimming, player.Character.IsSwimming));\n\t\t\tfootsteps.Add(new CommandBinding<float>(footsteps.Damage, agent.Damage));\n\t\t\tfootsteps.Add(new CommandBinding<Voxel, Voxel.Coord, Direction>(wallRun.WalkedOn, footsteps.WalkedOn));\n\t\t\tmodel.Trigger(\"Run\", 0.16f, footsteps.Footstep);\n\t\t\tmodel.Trigger(\"Run\", 0.58f, footsteps.Footstep);\n\t\t\tmodel.Trigger(\"WallRunLeft\", 0.16f, footsteps.Footstep);\n\t\t\tmodel.Trigger(\"WallRunLeft\", 0.58f, footsteps.Footstep);\n\t\t\tmodel.Trigger(\"WallRunRight\", 0.16f, footsteps.Footstep);\n\t\t\tmodel.Trigger(\"WallRunRight\", 0.58f, footsteps.Footstep);\n\t\t\tmodel.Trigger(\"WallRunStraight\", 0.16f, footsteps.Footstep);\n\t\t\tmodel.Trigger(\"WallRunStraight\", 0.58f, footsteps.Footstep);\n\t\t\tmodel.Trigger(\"TurnLeft\", 0.15f, footsteps.Footstep);\n\t\t\tmodel.Trigger(\"TurnRight\", 0.15f, footsteps.Footstep);\n\t\t\tmodel.Trigger(\"TopOut\", 1.0f, new Command\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_GRUNT, entity);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tmain.UI.IsMouseVisible.Value = false;\n\n\t\t\tSkinnedModel.Clip sprintAnimation = model[\"Sprint\"], runAnimation = model[\"Run\"];\n\n\t\t\t// Movement binding\n\t\t\tplayer.Add(new Binding<Vector2>(player.Character.MovementDirection, delegate()\n\t\t\t{\n\t\t\t\tVector2 movement = input.Movement;\n\t\t\t\tif (movement.LengthSquared() == 0.0f)\n\t\t\t\t\treturn Vector2.Zero;\n\n\t\t\t\tMatrix matrix = Matrix.CreateRotationY(rotation.Rotation);\n\n\t\t\t\tVector2 forwardDir = new Vector2(matrix.Forward.X, matrix.Forward.Z);\n\t\t\t\tVector2 rightDir = new Vector2(matrix.Right.X, matrix.Right.Z);\n\t\t\t\treturn -(forwardDir * movement.Y) - (rightDir * movement.X);\n\t\t\t}, input.Movement, rotation.Rotation));\n\n\t\t\tplayer.Character.Crouched.Value = true;\n\t\t\tplayer.Character.AllowUncrouch.Value = true;\n\n\t\t\t// Fall damage\n\t\t\tfallDamage.Add(new Binding<bool>(fallDamage.IsSupported, player.Character.IsSupported));\n\t\t\tfallDamage.Add(new TwoWayBinding<Vector3>(player.Character.LinearVelocity, fallDamage.LinearVelocity));\n\t\t\tfallDamage.Add(new TwoWayBinding<float>(player.Health, fallDamage.Health));\n\t\t\tfallDamage.Add(new CommandBinding<BEPUphysics.BroadPhaseEntries.Collidable, ContactCollection>(player.Character.Collided, fallDamage.Collided));\n\t\t\tfallDamage.Add(new TwoWayBinding<bool>(player.Character.EnableWalking, fallDamage.EnableWalking));\n\t\t\tfallDamage.Add(new TwoWayBinding<bool>(player.TemporaryEnableMoves, fallDamage.EnableMoves));\n\t\t\tfallDamage.Add(new TwoWayBinding<bool>(fallDamage.Landing, rotation.Landing));\n\t\t\tfallDamage.Add(new CommandBinding(fallDamage.LockRotation, (Action)rotation.Lock));\n\t\t\tfallDamage.Add(new CommandBinding<float>(fallDamage.PhysicsDamage, agent.Damage));\n\t\t\tfallDamage.Bind(model);\n\n\t\t\t// Swim up\n\t\t\tinput.Bind(player.Character.SwimUp, settings.Jump);\n\n\t\t\tfloat parkourTime = 0;\n\t\t\tfloat jumpTime = 0;\n\t\t\tjumper.Action = delegate(float dt)\n\t\t\t{\n\t\t\t\tif (player.PermanentEnableMoves\n\t\t\t\t\t&& player.TemporaryEnableMoves\n\t\t\t\t\t&& player.Character.EnableWalking\n\t\t\t\t\t&& vault.CurrentState.Value == Vault.State.None\n\t\t\t\t\t&& !rollKickSlide.Rolling && !rollKickSlide.Kicking\n\t\t\t\t\t&& jumpTime < Player.SlowmoTime)\n\t\t\t\t{\n\t\t\t\t\tif (jump.Go())\n\t\t\t\t\t{\n\t\t\t\t\t\tparkour.Enabled.Value = false;\n\t\t\t\t\t\tjumper.Enabled.Value = false;\n\t\t\t\t\t}\n\t\t\t\t\tjumpTime += dt;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tjumper.Enabled.Value = false;\n\t\t\t};\n\t\t\tjumper.Add(new CommandBinding(jumper.Enable, delegate() { jumpTime = 0; }));\n\t\t\tjumper.Enabled.Value = false;\n\t\t\tentity.Add(jumper);\n\n\t\t\t// Jumping\n\t\t\tinput.Bind(settings.Jump, PCInput.InputState.Down, delegate()\n\t\t\t{\n\t\t\t\tjumper.Enabled.Value = true;\n\t\t\t});\n\n\t\t\tinput.Bind(settings.Jump, PCInput.InputState.Up, delegate()\n\t\t\t{\n\t\t\t\tjumper.Enabled.Value = false;\n\t\t\t});\n\n\t\t\t// Wall-run, vault, predictive\n\t\t\tparkour.Action = delegate(float dt)\n\t\t\t{\n\t\t\t\tif (player.PermanentEnableMoves\n\t\t\t\t\t&& player.TemporaryEnableMoves\n\t\t\t\t\t&& player.Character.EnableWalking\n\t\t\t\t\t&& !(player.Character.Crouched && player.Character.IsSupported)\n\t\t\t\t\t&& vault.CurrentState.Value == Vault.State.None\n\t\t\t\t\t&& !rollKickSlide.Kicking\n\t\t\t\t\t&& !rollKickSlide.Rolling\n\t\t\t\t\t&& wallRun.CurrentState.Value == WallRun.State.None\n\t\t\t\t\t&& parkourTime < Player.SlowmoTime)\n\t\t\t\t{\n\t\t\t\t\tbool didSomething = false;\n\n\t\t\t\t\tbool parkourBeganThisFrame = parkourTime == 0;\n\t\t\t\t\tif (predictor.PossibilityCount > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// In slow motion, prefer left and right wall-running\n\t\t\t\t\t\tif (!(didSomething = wallRun.Activate(WallRun.State.Left, parkourBeganThisFrame)))\n\t\t\t\t\t\t\tif (!(didSomething = wallRun.Activate(WallRun.State.Right, parkourBeganThisFrame)))\n\t\t\t\t\t\t\t\tif (!(didSomething = vault.Go(parkourBeganThisFrame)))\n\t\t\t\t\t\t\t\t\tdidSomething = wallRun.Activate(WallRun.State.Straight, parkourBeganThisFrame);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// In normal mode, prefer straight wall-running\n\t\t\t\t\t\tif (!(didSomething = vault.Go(parkourBeganThisFrame)))\n\t\t\t\t\t\t\tif (!(didSomething = wallRun.Activate(WallRun.State.Straight, parkourBeganThisFrame)))\n\t\t\t\t\t\t\t\tif (!(didSomething = wallRun.Activate(WallRun.State.Left, parkourBeganThisFrame)))\n\t\t\t\t\t\t\t\t\tdidSomething = wallRun.Activate(WallRun.State.Right, parkourBeganThisFrame);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (didSomething)\n\t\t\t\t\t{\n\t\t\t\t\t\tjumper.Enabled.Value = false;\n\t\t\t\t\t\tplayer.SlowMotion.Value = false;\n\t\t\t\t\t\tparkour.Enabled.Value = false;\n\t\t\t\t\t}\n\t\t\t\t\telse if (parkourBeganThisFrame && player.Character.LinearVelocity.Value.Y > FallDamage.RollingDeathVelocity)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (blockCloud.Blocks.Length > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tplayer.SlowMotion.Value = true;\n\t\t\t\t\t\t\tpredictor.ClearPossibilities();\n\t\t\t\t\t\t\tpredictor.PredictPlatforms();\n\t\t\t\t\t\t\tpredictor.PredictWalls();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (player.EnableSlowMotion)\n\t\t\t\t\t\t\tplayer.SlowMotion.Value = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tparkourTime += dt;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tparkour.Enabled.Value = false;\n\t\t\t};\n\t\t\tparkour.Add(new CommandBinding(parkour.Enable, delegate()\n\t\t\t{\n\t\t\t\tparkourTime = 0;\n\t\t\t}));\n\t\t\tentity.Add(parkour);\n\t\t\tparkour.Enabled.Value = false;\n\n\t\t\tinput.Bind(settings.Parkour, PCInput.InputState.Down, delegate()\n\t\t\t{\n\t\t\t\tparkour.Enabled.Value = true;\n\t\t\t});\n\n\t\t\tinput.Bind(settings.Parkour, PCInput.InputState.Up, delegate()\n\t\t\t{\n\t\t\t\tparkour.Enabled.Value = false;\n\t\t\t\twallRun.Deactivate();\n\t\t\t\tif (player.SlowMotion)\n\t\t\t\t\tplayer.SlowMotion.Value = false;\n\t\t\t});\n\n\t\t\tinput.Bind(settings.RollKick, PCInput.InputState.Down, delegate()\n\t\t\t{\n\t\t\t\tif (player.PermanentEnableMoves\n\t\t\t\t\t&& player.TemporaryEnableMoves\n\t\t\t\t\t&& player.Character.EnableWalking)\n\t\t\t\t{\n\t\t\t\t\trollKickSlide.Go();\n\t\t\t\t\tparkour.Enabled.Value = false;\n\t\t\t\t\tjumper.Enabled.Value = false;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tinput.Bind(settings.RollKick, PCInput.InputState.Up, delegate()\n\t\t\t{\n\t\t\t\tif (!rollKickSlide.Rolling && !rollKickSlide.Kicking)\n\t\t\t\t\tplayer.Character.AllowUncrouch.Value = true;\n\t\t\t});\n\n\t\t\t// Player data bindings\n\n\t\t\tentity.Add(new PostInitialization(delegate()\n\t\t\t{\n\t\t\t\tEntity dataEntity = PlayerDataFactory.Instance;\n\t\t\t\tPlayerData playerData = dataEntity.Get<PlayerData>();\n\n\t\t\t\t// HACK. Overwriting the property rather than binding the two together. Oh well.\n\t\t\t\t// This is because I haven't written a two-way list binding.\n\t\t\t\tfootsteps.RespawnLocations = playerData.RespawnLocations;\n\t\t\t\t\n\t\t\t\t// Bind player data properties\n\t\t\t\tentity.Add(new TwoWayBinding<float>(WorldFactory.Instance.Get<World>().CameraShakeAmount, cameraControl.CameraShakeAmount));\n\t\t\t\tentity.Add(new TwoWayBinding<bool>(playerData.EnableRoll, rollKickSlide.EnableRoll));\n\t\t\t\tentity.Add(new TwoWayBinding<bool>(playerData.EnableCrouch, player.EnableCrouch));\n\t\t\t\tentity.Add(new TwoWayBinding<bool>(playerData.EnableKick, rollKickSlide.EnableKick));\n\t\t\t\tentity.Add(new TwoWayBinding<bool>(playerData.EnableWallRun, wallRun.EnableWallRun));\n\t\t\t\tentity.Add(new TwoWayBinding<bool>(playerData.EnableWallRunHorizontal, wallRun.EnableWallRunHorizontal));\n\t\t\t\tentity.Add(new TwoWayBinding<bool>(playerData.EnableEnhancedWallRun, wallRun.EnableEnhancedWallRun));\n\t\t\t\tentity.Add(new TwoWayBinding<bool>(playerData.EnableMoves, player.PermanentEnableMoves));\n\t\t\t\tentity.Add(new TwoWayBinding<float>(playerData.MaxSpeed, player.Character.MaxSpeed));\n\t\t\t\tentity.Add(new Binding<bool>(fallDamage.PhoneOrNoteActive, () => playerData.PhoneActive || playerData.NoteActive, playerData.PhoneActive, playerData.NoteActive));\n\n\t\t\t\tif (playerData.CloudType.Value == Voxel.t.Empty) // This makes everything work if we spawn next to a power block socket\n\t\t\t\t\tentity.Add(new TwoWayBinding<Voxel.t>(blockCloud.Type, playerData.CloudType));\n\t\t\t\telse\n\t\t\t\t\tentity.Add(new TwoWayBinding<Voxel.t>(playerData.CloudType, blockCloud.Type));\n\n\t\t\t\tentity.Add(new TwoWayBinding<bool>(playerData.ThirdPerson, cameraControl.ThirdPerson));\n\t\t\t\tentity.Add(new TwoWayBinding<bool>(playerData.EnableSlowMotion, player.EnableSlowMotion));\n\n\t\t\t\tPhone phone = dataEntity.GetOrCreate<Phone>(\"Phone\");\n\n\t\t\t\tentity.Add\n\t\t\t\t(\n\t\t\t\t\tnew Binding<bool>\n\t\t\t\t\t(\n\t\t\t\t\t\tphone.CanReceiveMessages,\n\t\t\t\t\t\t() => player.Character.IsSupported && !player.Character.IsSwimming && !player.Character.Crouched,\n\t\t\t\t\t\tplayer.Character.IsSupported,\n\t\t\t\t\t\tplayer.Character.IsSwimming,\n\t\t\t\t\t\tplayer.Character.Crouched\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tPhoneNote.Attach(main, entity, player, model, input, phone, player.Character.EnableWalking, playerData.PhoneActive, playerData.NoteActive);\n\n\t\t\t\tPlayerUI.Attach(main, entity, ui, player.Health, rotation.Rotation, playerData.NoteActive, playerData.PhoneActive, player.Character.LinearVelocity, playerData.DebugVelocity);\n\t\t\t}));\n\n\t\t\tfpsCamera.Add(new Binding<Vector2>(fpsCamera.Mouse, input.Mouse));\n\t\t\tfpsCamera.Add(new Binding<Vector2>(fpsCamera.Movement, input.Movement));\n\t\t\tinput.Bind(fpsCamera.SpeedMode, settings.Parkour);\n\t\t\tinput.Bind(fpsCamera.Up, settings.Jump);\n\t\t\tfpsCamera.Add(new Binding<bool>(fpsCamera.Down, input.GetKey(Keys.LeftControl)));\n\t\t\tLemma.Console.Console.AddConCommand(new ConCommand(\"noclip\", \"Toggle free camera mode\", delegate(ConCommand.ArgCollection args)\n\t\t\t{\n\t\t\t\tbool freeCameraMode = !fpsCamera.Enabled;\n\t\t\t\tfpsCamera.Enabled.Value = freeCameraMode;\n\t\t\t\tcameraControl.Enabled.Value = !freeCameraMode;\n\t\t\t\tfirstPersonModel.Enabled.Value = !freeCameraMode;\n\t\t\t\tmodel.Enabled.Value = !freeCameraMode;\n\t\t\t\tui.Enabled.Value = !freeCameraMode;\n\t\t\t\tplayer.Character.EnableWalking.Value = !freeCameraMode;\n\t\t\t\tplayer.TemporaryEnableMoves.Value = !freeCameraMode;\n\t\t\t\tplayer.Character.Body.IsAffectedByGravity = !freeCameraMode;\n\t\t\t\tif (freeCameraMode)\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_PLAYER_BREATHING_SOFT, entity);\n\t\t\t\telse\n\t\t\t\t\ttransform.Position.Value = main.Camera.Position;\n\t\t\t}));\n\n\t\t\tentity.Add(new CommandBinding(entity.Delete, delegate()\n\t\t\t{\n\t\t\t\tLemma.Console.Console.RemoveConCommand(\"noclip\");\n\t\t\t\tif (fpsCamera.Enabled) // Movement is disabled. Re-enable it.\n\t\t\t\t{\n\t\t\t\t\tplayer.Character.EnableWalking.Value = true;\n\t\t\t\t\tplayer.TemporaryEnableMoves.Value = true;\n\t\t\t\t}\n\t\t\t\tPlayerFactory.Instance = null;\n\t\t\t}));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/PlayerUI.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing ComponentBind;\n\nnamespace Lemma.Factories\n{\n\tpublic class PlayerUI\n\t{\n\t\tpublic static void Attach(Main main, Entity entity, UIRenderer ui, Property<float> health, Property<float> rotation, Property<bool> noteActive, Property<bool> phoneActive, Property<Vector3> linearVelocity, Property<bool> enableDebugVelocity)\n\t\t{\n\t\t\tSprite damageOverlay = new Sprite();\n\t\t\tdamageOverlay.Image.Value = \"Images\\\\damage\";\n\t\t\tdamageOverlay.AnchorPoint.Value = new Vector2(0.5f);\n\t\t\tui.Root.Children.Add(damageOverlay);\n\n\t\t\t// Center the damage overlay and scale it to fit the screen\n\t\t\tdamageOverlay.Add(new Binding<Vector2, Point>(damageOverlay.Position, x => new Vector2(x.X * 0.5f, x.Y * 0.5f), main.ScreenSize));\n\t\t\tdamageOverlay.Add(new Binding<Vector2>(damageOverlay.Scale, () => new Vector2(main.ScreenSize.Value.X / damageOverlay.Size.Value.X, main.ScreenSize.Value.Y / damageOverlay.Size.Value.Y), main.ScreenSize, damageOverlay.Size));\n\t\t\tdamageOverlay.Add(new Binding<float, float>(damageOverlay.Opacity, x => 1.0f - x, health));\n\n\t\t\tContainer debugVelocityContainer = main.UIFactory.CreateContainer();\n\t\t\tdebugVelocityContainer.Opacity.Value = UIFactory.Opacity;\n\t\t\tdebugVelocityContainer.AnchorPoint.Value = new Vector2(1.0f, 0.0f);\n\t\t\tbool vr = false;\n#if VR\n\t\t\tvr = main.VR;\n#endif\n\t\t\tdebugVelocityContainer.Add(new Binding<Vector2, Point>(debugVelocityContainer.Position, x => new Vector2(x.X * 0.9f, x.Y * (vr ? 0.7f : 0.9f)), main.ScreenSize));\n\t\t\tdebugVelocityContainer.Add(new Binding<bool>(debugVelocityContainer.Visible, enableDebugVelocity));\n\t\t\tui.Root.Children.Add(debugVelocityContainer);\n\n\t\t\tListContainer debugVelocityList = new ListContainer();\n\t\t\tdebugVelocityList.Orientation.Value = ListContainer.ListOrientation.Vertical;\n\t\t\tdebugVelocityContainer.Children.Add(debugVelocityList);\n\n\t\t\tTextElement debugVelocity = main.UIFactory.CreateLabel();\n\t\t\tdebugVelocity.Add(new Binding<string, Vector3>(debugVelocity.Text, x => Math.Abs(x.Y).ToString(\"00.00\"), linearVelocity));\n\t\t\tdebugVelocityList.Children.Add(debugVelocity);\n\n\t\t\tTextElement debugHorizontalVelocity = main.UIFactory.CreateLabel();\n\t\t\tdebugHorizontalVelocity.Add(new Binding<string, Vector3>(debugHorizontalVelocity.Text, x =>\n\t\t\t{\n\t\t\t\tx.Y = 0.0f;\n\t\t\t\treturn x.Length().ToString(\"00.00\");\n\t\t\t}, linearVelocity));\n\t\t\tdebugVelocityList.Children.Add(debugHorizontalVelocity);\n\n#if VR\n\t\t\tif (main.VR)\n\t\t\t{\n\t\t\t\tVirtualReticle reticleController = entity.GetOrCreate<VirtualReticle>();\n\t\t\t\treticleController.Add(new Binding<float>(reticleController.Rotation, rotation));\n\n\t\t\t\tModelNonPostProcessed reticle = entity.Create<ModelNonPostProcessed>();\n\t\t\t\treticle.Filename.Value = \"Models\\\\plane\";\n\t\t\t\treticle.EffectFile.Value = \"Effects\\\\VirtualUI\";\n\t\t\t\treticle.DiffuseTexture.Value = \"Images\\\\reticle\";\n\t\t\t\treticle.Add(new Binding<Matrix>(reticle.Transform, reticleController.Transform));\n\t\t\t\treticle.Add(new Binding<bool>(reticle.Enabled, () => !main.Paused && !phoneActive && !noteActive && main.Settings.EnableReticleVR, main.Paused, phoneActive, noteActive, main.Settings.EnableReticleVR));\n\t\t\t}\n\t\t\telse\n#endif\n\t\t\t{\n\t\t\t\tSprite reticle = new Sprite();\n\t\t\t\treticle.Image.Value = \"Images\\\\reticle\";\n\t\t\t\treticle.AnchorPoint.Value = new Vector2(0.5f);\n\t\t\t\treticle.Opacity.Value = 0.5f;\n\t\t\t\tui.Root.Children.Add(reticle);\n\n\t\t\t\treticle.Add(new Binding<bool>(reticle.Visible, main.Settings.EnableReticle));\n\n\t\t\t\t// Center the reticle\n\t\t\t\treticle.Add(new Binding<Vector2, Point>(reticle.Position, x => new Vector2(x.X * 0.5f, x.Y * 0.5f), main.ScreenSize));\n\t\t\t}\n\n\t\t\tUIComponent targets = new UIComponent();\n\t\t\tui.Root.Children.Add(targets);\n\n\t\t\tTargetUI targetUi = entity.GetOrCreate<TargetUI>();\n\t\t\ttargetUi.Add(new ListBinding<UIComponent>(targetUi.Sprites, targets.Children));\n\n\t\t\ttargets.Add(new ListBinding<UIComponent, Transform>(targets.Children, TargetFactory.Positions, delegate(Transform target)\n\t\t\t{\n\t\t\t\tSprite sprite = new Sprite();\n\t\t\t\tsprite.Image.Value = \"Images\\\\target\";\n\t\t\t\tsprite.AnchorPoint.Value = new Vector2(0.5f, 0.5f);\n\t\t\t\tsprite.UserData.Value = target;\n\t\t\t\tsprite.Add(new Binding<bool>(sprite.Visible, () => target.Enabled && main.Settings.EnableWaypoints, target.Enabled, main.Settings.EnableWaypoints));\n\t\t\t\treturn sprite;\n\t\t\t}));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/RollKickSlide.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class RollKickSlide : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic void StopKick()\n\t\t{\n\t\t\tif (this.Kicking)\n\t\t\t{\n\t\t\t\tthis.LastRollKickEnded.Value = main.TotalTime;\n\t\t\t\tthis.Kicking.Value = false;\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_PLAYER_SLIDE_LOOP, this.Entity);\n\t\t\t\tthis.model.Stop(\"Kick\", \"Slide\");\n\t\t\t\tthis.EnableWalking.Value = true;\n\t\t\t\tif (!this.RollKickButton)\n\t\t\t\t\tthis.AllowUncrouch.Value = true;\n\t\t\t}\n\t\t}\n\n\t\t// Input\n\t\tpublic Property<bool> RollKickButton = new Property<bool>();\n\t\tpublic Property<bool> EnableRoll = new Property<bool>();\n\t\tpublic Property<bool> EnableKick = new Property<bool>();\n\t\tpublic Property<bool> EnableCrouch = new Property<bool>();\n\t\tpublic Property<float> Rotation = new Property<float>();\n\t\tpublic Property<bool> IsSwimming = new Property<bool>();\n\t\tpublic Property<bool> IsSupported = new Property<bool>();\n\t\tpublic Property<Vector3> FloorPosition = new Property<Vector3>();\n\t\tpublic Property<Vector3> SupportVelocity = new Property<Vector3>();\n\t\tpublic Property<float> Height = new Property<float>();\n\t\tpublic Property<float> MaxSpeed = new Property<float>();\n\t\tpublic Property<float> JumpSpeed = new Property<float>();\n\t\tpublic Property<bool> EnableEnhancedRollSlide = new Property<bool>();\n\n\t\t// Input/output\n\t\tpublic Property<bool> AllowUncrouch = new Property<bool>();\n\t\tpublic Property<bool> Crouched = new Property<bool>();\n\t\tpublic Property<bool> EnableWalking = new Property<bool>();\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\t\tpublic BlockPredictor Predictor;\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\n\t\t// Output\n\t\tpublic Property<bool> Rolling = new Property<bool>();\n\t\tpublic Property<bool> Kicking = new Property<bool>();\n\t\tpublic Property<float> LastRollKickEnded = new Property<float> { Value = -1.0f };\n\t\tpublic Property<float> LastRollStarted = new Property<float> { Value = -1.0f };\n\t\tpublic Command DeactivateWallRun = new Command();\n\t\tpublic Command Footstep = new Command();\n\t\tpublic Command LockRotation = new Command();\n\t\tpublic Command<float> Rumble = new Command<float>();\n\t\tprivate AnimatedModel model;\n\t\tpublic VoxelTools VoxelTools;\n\n\t\tpublic Property<bool> CanKick = new Property<bool>();\n\t\tprivate float rollKickTime = 0.0f;\n\t\tprivate bool firstTimeBreak = false;\n\t\tprivate Vector3 forward;\n\t\tprivate Vector3 right;\n\t\tprivate Direction forwardDir;\n\t\tprivate Direction rightDir;\n\t\tprivate Voxel floorMap;\n\t\tprivate Voxel.Coord floorCoordinate;\n\t\tprivate bool shouldBuildFloor;\n\t\tprivate bool sliding;\n\t\tprivate Vector3 velocity;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Serialize = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (this.IsSupported)\n\t\t\t\t\tthis.CanKick.Value = true;\n\t\t\t}, this.IsSupported));\n\t\t}\n\n\t\tpublic void Bind(AnimatedModel model)\n\t\t{\n\t\t\tthis.model = model;\n\t\t\tmodel[\"Slide\"].Speed = 1.4f;\n\t\t\tmodel[\"Roll\"].Speed = 1.75f;\n\t\t\tthis.model[\"Kick\"].GetChannel(this.model.GetBoneIndex(\"ORG-hips\")).Filter = delegate(Matrix m)\n\t\t\t{\n\t\t\t\tm.Translation += new Vector3(0.0f, 0.0f, -1.25f);\n\t\t\t\treturn m;\n\t\t\t};\n\t\t}\n\n\t\tprivate const float coolDown = 0.35f;\n\n\t\tprivate bool determineShouldBuildFloor(Voxel v, Voxel.State floorState)\n\t\t{\n\t\t\tbool result = false;\n\t\t\tif (floorState == Voxel.States.Blue || floorState == Voxel.States.Powered)\n\t\t\t{\n\t\t\t\t// If we're standing on blue or powered, we need to check if we're close to a non-blue block before we can build a floor\n\t\t\t\t// This prevents the player from building a floor infinitely\n\t\t\t\tif (VoxelAStar.BroadphaseSearch(this.floorMap, this.floorCoordinate, 6, x => x.Type != Voxel.States.Blue && x.Type != Voxel.States.Powered) != null)\n\t\t\t\t\tresult = true;\n\t\t\t}\n\t\t\telse if (v == null || v.Entity.Type != \"Bouncer\")\n\t\t\t\tresult = true;\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic void Go(bool overrideCooldown = false)\n\t\t{\n\t\t\tif (this.Rolling || this.Kicking || (main.TotalTime - this.LastRollKickEnded < coolDown && !overrideCooldown))\n\t\t\t\treturn;\n\n\t\t\tMatrix rotationMatrix = Matrix.CreateRotationY(this.Rotation);\n\t\t\tthis.forward = -rotationMatrix.Forward;\n\t\t\tthis.right = rotationMatrix.Right;\n\t\t\tthis.shouldBuildFloor = false;\n\n\t\t\tbool instantiatedBlockPossibility = false;\n\n\t\t\tif (this.EnableCrouch && this.EnableRoll && !this.IsSwimming\n\t\t\t\t&& (!this.EnableKick || !this.IsSupported || (this.LinearVelocity.Value - this.SupportVelocity.Value).Length() < 4.0f))\n\t\t\t{\n\t\t\t\t// Try to roll\n\t\t\t\tVector3 playerPos = this.FloorPosition + new Vector3(0, 0.5f, 0);\n\n\t\t\t\tVoxel.GlobalRaycastResult floorRaycast = this.raycastFloor();\n\n\t\t\t\tbool nearGround = this.LinearVelocity.Value.Y < this.SupportVelocity.Value.Y + 0.1f && floorRaycast.Voxel != null;\n\n\t\t\t\tthis.floorCoordinate = new Voxel.Coord();\n\t\t\t\tthis.floorMap = null;\n\n\t\t\t\tif (nearGround)\n\t\t\t\t{\n\t\t\t\t\tthis.floorMap = floorRaycast.Voxel;\n\t\t\t\t\tthis.floorCoordinate = floorRaycast.Coordinate.Value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Check for block possibilities\n\t\t\t\t\tforeach (BlockPredictor.Possibility block in this.Predictor.AllPossibilities)\n\t\t\t\t\t{\n\t\t\t\t\t\tbool first = true;\n\t\t\t\t\t\tforeach (Voxel.Coord coord in block.Map.Rasterize(playerPos + Vector3.Up * 2.0f, playerPos + (Vector3.Down * (this.Height + 3.0f))))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (coord.Between(block.StartCoord, block.EndCoord))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (first)\n\t\t\t\t\t\t\t\t\tbreak; // If the top coord is intersecting the possible block, we're too far down into the block. Need to be at the top.\n\t\t\t\t\t\t\t\tthis.Predictor.InstantiatePossibility(block);\n\t\t\t\t\t\t\t\tinstantiatedBlockPossibility = true;\n\t\t\t\t\t\t\t\tthis.floorMap = block.Map;\n\t\t\t\t\t\t\t\tthis.floorCoordinate = coord;\n\t\t\t\t\t\t\t\tthis.Position.Value += new Vector3(0, this.floorMap.GetAbsolutePosition(coord).Y + 2 - this.FloorPosition.Value.Y, 0);\n\t\t\t\t\t\t\t\tthis.shouldBuildFloor = true;\n\t\t\t\t\t\t\t\tnearGround = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfirst = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nearGround)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (nearGround)\n\t\t\t\t{\n\t\t\t\t\t// We're rolling.\n\t\t\t\t\tthis.Rolling.Value = true;\n\n\t\t\t\t\tSession.Recorder.Event(main, \"Roll\");\n\n\t\t\t\t\tthis.DeactivateWallRun.Execute();\n\n\t\t\t\t\tthis.EnableWalking.Value = false;\n\t\t\t\t\tthis.LockRotation.Execute();\n\n\t\t\t\t\tthis.Footstep.Execute(); // We just landed; play a footstep sound\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_ROLL, this.Entity);\n\n\t\t\t\t\tthis.model.StartClip(\"Roll\", 5, false, AnimatedModel.DefaultBlendTime);\n\n\t\t\t\t\tVoxel.State floorState = floorRaycast.Voxel == null ? Voxel.States.Empty : floorRaycast.Coordinate.Value.Data;\n\t\t\t\t\tif (this.EnableEnhancedRollSlide && (instantiatedBlockPossibility || (this.IsSupported && floorState != Voxel.States.Slider && floorState != Voxel.States.SliderPowered)))\n\t\t\t\t\t\tthis.shouldBuildFloor |= this.determineShouldBuildFloor(floorRaycast.Voxel, floorState);\n\t\t\t\t\t\n\t\t\t\t\t// If the player is not yet supported, that means they're just about to land.\n\t\t\t\t\t// So give them a little speed boost for having such good timing.\n\t\t\t\t\tthis.velocity = this.SupportVelocity + this.forward * this.MaxSpeed * (this.IsSupported ? 0.75f : 1.25f);\n\t\t\t\t\tthis.LinearVelocity.Value = new Vector3(this.velocity.X, instantiatedBlockPossibility ? 0.0f : this.LinearVelocity.Value.Y, this.velocity.Z);\n\n\t\t\t\t\t// Crouch\n\t\t\t\t\tthis.Crouched.Value = true;\n\t\t\t\t\tthis.AllowUncrouch.Value = false;\n\n\t\t\t\t\tthis.rightDir = this.floorMap.GetRelativeDirection(this.right);\n\t\t\t\t\tthis.forwardDir = this.floorMap.GetRelativeDirection(this.forward);\n\n\t\t\t\t\tthis.rollKickTime = 0.0f;\n\t\t\t\t\tthis.firstTimeBreak = true;\n\t\t\t\t\tthis.LastRollStarted.Value = this.main.TotalTime;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!this.Rolling && this.EnableCrouch && this.EnableKick && this.CanKick && !this.Kicking && !this.IsSwimming && Vector3.Dot(this.LinearVelocity.Value - this.SupportVelocity, this.forward) > 0.05f)\n\t\t\t{\n\t\t\t\t// Kick\n\t\t\t\tthis.Kicking.Value = true;\n\t\t\t\tthis.CanKick.Value = false;\n\n\t\t\t\tSession.Recorder.Event(main, \"Kick\");\n\n\t\t\t\tthis.DeactivateWallRun.Execute();\n\n\t\t\t\tthis.EnableWalking.Value = false;\n\t\t\t\tthis.LockRotation.Execute();\n\n\t\t\t\tthis.Crouched.Value = true;\n\t\t\t\tthis.AllowUncrouch.Value = false;\n\n\t\t\t\tVector3 playerPos = this.FloorPosition + new Vector3(0, 0.5f, 0);\n\n\t\t\t\tthis.sliding = false;\n\n\t\t\t\tVoxel.GlobalRaycastResult floorRaycast = this.raycastFloor();\n\t\t\t\tthis.floorMap = floorRaycast.Voxel;\n\n\t\t\t\tif (instantiatedBlockPossibility)\n\t\t\t\t{\n\t\t\t\t\tthis.sliding = true;\n\t\t\t\t\tthis.shouldBuildFloor = true;\n\t\t\t\t}\n\t\t\t\telse if (this.floorMap == null)\n\t\t\t\t{\n\t\t\t\t\tthis.shouldBuildFloor = false;\n\t\t\t\t\tthis.sliding = false;\n\t\t\t\t\tthis.floorCoordinate = new Voxel.Coord();\n\t\t\t\t}\n\t\t\t\telse if (this.LinearVelocity.Value.Y - this.SupportVelocity.Value.Y < 1.0f)\n\t\t\t\t{\n\t\t\t\t\tthis.floorCoordinate = floorRaycast.Coordinate.Value;\n\t\t\t\t\tif (this.EnableEnhancedRollSlide)\n\t\t\t\t\t\tthis.shouldBuildFloor |= this.determineShouldBuildFloor(floorRaycast.Voxel, floorRaycast.Coordinate.Value.Data);\n\t\t\t\t\tthis.sliding = true;\n\t\t\t\t}\n\n\t\t\t\tfloat forwardSpeed = Vector3.Dot(this.forward, this.LinearVelocity.Value - this.SupportVelocity);\n\t\t\t\tif (forwardSpeed < this.MaxSpeed * 1.1f)\n\t\t\t\t{\n\t\t\t\t\tif (this.sliding)\n\t\t\t\t\t\tthis.velocity = this.LinearVelocity.Value + this.forward * (this.MaxSpeed - forwardSpeed);\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.velocity = this.LinearVelocity.Value + this.forward * Math.Max(4.0f, forwardSpeed * 0.4f) + new Vector3(0, this.JumpSpeed * 0.2f, 0);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.velocity = this.LinearVelocity;\n\n\t\t\t\tif (this.sliding)\n\t\t\t\t\tthis.velocity.Y = 0.0f;\n\n\t\t\t\tthis.LinearVelocity.Value = this.velocity;\n\n\t\t\t\tthis.model.StartClip(this.sliding ? \"Slide\" : \"Kick\", 5, false, AnimatedModel.DefaultBlendTime);\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_SLIDE, this.Entity);\n\t\t\t\tif (this.sliding) // We're sliding on the floor\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_SLIDE_LOOP, this.Entity);\n\n\t\t\t\tthis.forwardDir = Direction.None;\n\t\t\t\tthis.rightDir = Direction.None;\n\n\t\t\t\tif (this.floorMap != null)\n\t\t\t\t{\n\t\t\t\t\tthis.forwardDir = this.floorMap.GetRelativeDirection(this.forward);\n\t\t\t\t\tthis.rightDir = this.floorMap.GetRelativeDirection(this.right);\n\t\t\t\t}\n\n\t\t\t\tthis.rollKickTime = 0.0f;\n\t\t\t\tthis.firstTimeBreak = true;\n\t\t\t}\n\t\t}\n\n\t\tprivate Voxel.GlobalRaycastResult raycastFloor()\n\t\t{\n\t\t\tVector3 playerPos = this.FloorPosition + new Vector3(0, 0.5f, 0);\n\n\t\t\treturn Voxel.GlobalRaycast(playerPos, Vector3.Down, this.Height + MathHelper.Clamp((this.LinearVelocity.Value.Y - this.SupportVelocity.Value.Y) * -0.3f, 0.0f, 5.0f));\n\t\t}\n\n\t\tprivate void checkShouldBuildFloor()\n\t\t{\n\t\t\tif (this.EnableEnhancedRollSlide)\n\t\t\t{\n\t\t\t\tVoxel.GlobalRaycastResult floorRaycast = this.raycastFloor();\n\t\t\t\tif (floorRaycast.Voxel != null && floorRaycast.Voxel.Entity.Type != \"Bouncer\")\n\t\t\t\t{\n\t\t\t\t\tVoxel.t t = floorRaycast.Voxel[floorRaycast.Coordinate.Value].ID;\n\t\t\t\t\tif (t != Voxel.t.Blue && t != Voxel.t.Powered && t != Voxel.t.Slider && t != Voxel.t.SliderPowered)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.floorCoordinate = floorRaycast.Coordinate.Value;\n\t\t\t\t\t\tthis.shouldBuildFloor = true;\n\t\t\t\t\t\tif (this.Kicking)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.sliding = true;\n\t\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_SLIDE_LOOP, this.Entity);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.Rolling)\n\t\t\t{\n\t\t\t\tthis.rollKickTime += dt;\n\n\t\t\t\tVector3 originalVelocity = this.LinearVelocity;\n\t\t\t\tthis.LinearVelocity.Value = new Vector3(this.velocity.X, originalVelocity.Y, this.velocity.Z);\n\n\t\t\t\tif (this.rollKickTime > 0.1f && (this.rollKickTime > 1.0f || Vector3.Dot(originalVelocity - this.SupportVelocity, this.forward) < 0.1f))\n\t\t\t\t{\n\t\t\t\t\tthis.Rolling.Value = false;\n\t\t\t\t\tthis.EnableWalking.Value = true;\n\t\t\t\t\tif (!this.RollKickButton)\n\t\t\t\t\t\tthis.AllowUncrouch.Value = true;\n\t\t\t\t\tthis.LastRollKickEnded.Value = main.TotalTime;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (this.VoxelTools.BreakWalls(this.forward, this.right))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.firstTimeBreak)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.Rumble.Execute(0.5f);\n\t\t\t\t\t\t\tSound.PostEvent(AK.EVENTS.PLAY_WALL_BREAK, this.FloorPosition + this.forward * 2.0f);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.firstTimeBreak = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.shouldBuildFloor)\n\t\t\t\t\t\tthis.VoxelTools.BuildFloor(this.floorMap, this.floorCoordinate, this.forwardDir, this.rightDir);\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.checkShouldBuildFloor();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (this.Kicking)\n\t\t\t{\n\t\t\t\tthis.rollKickTime += dt;\n\n\t\t\t\tVector3 originalVelocity = this.LinearVelocity;\n\t\t\t\tthis.LinearVelocity.Value = new Vector3(this.velocity.X, originalVelocity.Y, this.velocity.Z);\n\n\t\t\t\tif (!this.IsSupported) \n\t\t\t\t{\n\t\t\t\t\tif (this.sliding)\n\t\t\t\t\t{\n\t\t\t\t\t\t// We started out on the ground, but we kicked off an edge.\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_PLAYER_SLIDE_LOOP, this.Entity);\n\t\t\t\t\t}\n\t\t\t\t\telse if (originalVelocity.Y - this.SupportVelocity.Value.Y < FallDamage.DamageVelocity)\n\t\t\t\t\t{\n\t\t\t\t\t\t// We weren't supported when we started kicking. We're flying.\n\t\t\t\t\t\t// Roll if we hit the ground while kicking mid-air\n\t\t\t\t\t\tVector3 playerPos = this.FloorPosition + new Vector3(0, 0.5f, 0);\n\t\t\t\t\t\tVoxel.GlobalRaycastResult r = this.raycastFloor();\n\t\t\t\t\t\tif (r.Voxel != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.StopKick();\n\t\t\t\t\t\t\tthis.Go(true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.rollKickTime > 1.0f\n\t\t\t\t\t|| (this.rollKickTime > 0.7f && (!this.RollKickButton || Vector3.Dot(originalVelocity - this.SupportVelocity, this.forward) < 0.1f)))\n\t\t\t\t{\n\t\t\t\t\tthis.StopKick();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.VoxelTools.BreakWalls(this.forward, this.right))\n\t\t\t\t{\n\t\t\t\t\tif (this.firstTimeBreak)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Rumble.Execute(0.5f);\n\t\t\t\t\t\tSound.PostEvent(AK.EVENTS.PLAY_WALL_BREAK, this.FloorPosition + this.forward * 2.0f);\n\t\t\t\t\t}\n\t\t\t\t\tthis.firstTimeBreak = false;\n\t\t\t\t}\n\t\t\t\tif (this.shouldBuildFloor)\n\t\t\t\t\tthis.VoxelTools.BuildFloor(this.floorMap, this.floorCoordinate, this.forwardDir, this.rightDir);\n\t\t\t\telse if (this.sliding)\n\t\t\t\t\tthis.checkShouldBuildFloor();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/RotationController.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Lemma.Util;\n\nnamespace Lemma.Components\n{\n\tpublic class RotationController : Component<Main>, IUpdateableComponent\n\t{\n\t\t// Input properties\n\t\t[XmlIgnore]\n\t\tpublic Property<WallRun.State> WallRunState = new Property<WallRun.State>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Vault.State> VaultState = new Property<Vault.State>();\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> Rolling = new Property<bool>();\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> Kicking = new Property<bool>();\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> Landing = new Property<bool>();\n\n\t\t// Input/output properties\n\t\tpublic Property<float> Rotation = new Property<float>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector2> Mouse = new Property<Vector2>();\n\n\t\t// Output properties\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> Locked = new Property<bool>();\n\n\t\tconst float rotationLockBlendTime = 0.3f;\n\t\tfloat lockedRotationValue = 0.0f;\n\t\tfloat rotationLockBlending = rotationLockBlendTime;\n\n\t\tprivate bool updating;\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tthis.Mouse.Value = new Vector2(this.Rotation, 0.0f);\n\t\t\tthis.Add(new ChangeBinding<float>(this.Rotation, delegate(float old, float value)\n\t\t\t{\n\t\t\t\tif (this.Locked && !this.updating)\n\t\t\t\t\tthis.Mouse.Value += new Vector2(value - old, 0);\n\t\t\t}));\n\t\t\tthis.Add(new NotifyBinding(this.Unlock, this.Locked, this.WallRunState, this.Kicking, this.Rolling, this.VaultState, this.Landing));\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic void UpdateLockedRotation(float value)\n\t\t{\n\t\t\tthis.updating = true;\n\t\t\tthis.Rotation.Value = value;\n\t\t\tthis.lockedRotationValue = value.ClosestAngle(this.Mouse.Value.X);\n\t\t\tthis.rotationLockBlending = 0;\n\t\t\tthis.updating = false;\n\t\t}\n\n\t\tpublic void Lock()\n\t\t{\n\t\t\tif (!this.Locked)\n\t\t\t{\n\t\t\t\tthis.lockedRotationValue = this.Rotation.Value.ClosestAngle(this.Mouse.Value.X);\n\t\t\t\tthis.rotationLockBlending = rotationLockBlendTime;\n\t\t\t\tthis.Locked.Value = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Unlock()\n\t\t{\n\t\t\tif (this.Locked && this.WallRunState.Value == WallRun.State.None && !this.Kicking && !this.Rolling && this.VaultState.Value == Vault.State.None && !this.Landing)\n\t\t\t{\n\t\t\t\tthis.rotationLockBlending = 0.0f;\n\t\t\t\tthis.Locked.Value = false;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.rotationLockBlending < rotationLockBlendTime)\n\t\t\t\tthis.rotationLockBlending += dt;\n\n\t\t\tif (!this.Locked)\n\t\t\t{\n\t\t\t\tif (this.rotationLockBlending < rotationLockBlendTime)\n\t\t\t\t{\n\t\t\t\t\tthis.lockedRotationValue = this.lockedRotationValue.ClosestAngle(this.Mouse.Value.X);\n\t\t\t\t\tthis.Rotation.Value = this.lockedRotationValue + (this.Mouse.Value.X - this.lockedRotationValue) * (this.rotationLockBlending / rotationLockBlendTime);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.Rotation.Value = this.Mouse.Value.X;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Player/Rumble.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Input;\n\nnamespace Lemma.Components\n{\n\tpublic class Rumble : Component<Main>, IUpdateableComponent\n\t{\n\t\t// Input properties\n\t\tpublic Property<float> BaseAmount = new Property<float>();\n\t\tpublic Property<float> CameraShake = new Property<float>();\n\n\t\tprivate Property<float> internalAmount = new Property<float>();\n\n\t\tprivate const float fadeTime = 0.5f;\n\n\t\tpublic void Go(float amount)\n\t\t{\n\t\t\tthis.internalAmount.Value = Math.Max(this.internalAmount, amount);\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Serialize = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tfloat a = (main.Paused || !main.Settings.ControllerVibration) ? 0.0f : MathHelper.Clamp(this.BaseAmount + this.CameraShake + this.internalAmount, 0.0f, 1.0f);\n\t\t\t\tGamePad.SetVibration(PlayerIndex.One, a, a);\n\t\t\t}, this.BaseAmount, this.CameraShake, this.internalAmount, main.Paused, main.Settings.ControllerVibration));\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tRumble.Reset();\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tfloat a = this.internalAmount;\n\t\t\tif (a > 0.0f)\n\t\t\t\tthis.internalAmount.Value = MathHelper.Clamp(a - dt / fadeTime, 0.0f, 1.0f);\n\t\t}\n\n\t\tpublic static void Reset()\n\t\t{\n\t\t\tGamePad.SetVibration(PlayerIndex.One, 0.0f, 0.0f);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Player/TargetUI.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class TargetUI : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic ListProperty<UIComponent> Sprites = new ListProperty<UIComponent>();\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tconst string targetOnScreen = \"Images\\\\target\";\n\t\t\tconst string targetOffScreen = \"Images\\\\target-pointer\";\n\t\t\tforeach (Sprite sprite in this.Sprites)\n\t\t\t{\n\t\t\t\tif (sprite.Visible)\n\t\t\t\t{\n\t\t\t\t\tTransform target = (Transform)sprite.UserData.Value;\n\t\t\t\t\tVector3 pos = target.Position.Value;\n\t\t\t\t\tMatrix viewProj;\n#if VR\n\t\t\t\t\tif (this.main.VR)\n\t\t\t\t\t\tviewProj = this.main.VRLastViewProjection;\n\t\t\t\t\telse\n#endif\n\t\t\t\t\t\tviewProj = this.main.Camera.ViewProjection;\n\n\t\t\t\t\tVector4 projectionSpace = Vector4.Transform(new Vector4(pos.X, pos.Y, pos.Z, 1.0f), viewProj);\n\t\t\t\t\tfloat originalDepth = projectionSpace.Z;\n\t\t\t\t\tprojectionSpace /= projectionSpace.W;\n\n\t\t\t\t\tPoint screenSize = main.ScreenSize;\n\t\t\t\t\tVector2 screenCenter = new Vector2(screenSize.X * 0.5f, screenSize.Y * 0.5f);\n\n\t\t\t\t\tVector2 offset = new Vector2(projectionSpace.X * (float)screenSize.X * 0.5f, -projectionSpace.Y * (float)screenSize.Y * 0.5f);\n\n\t\t\t\t\tfloat radius;\n#if VR\n\t\t\t\t\tif (this.main.VR)\n\t\t\t\t\t\tradius = Math.Min(screenSize.X, screenSize.Y) * 0.5f * 0.5f;\n\t\t\t\t\telse\n#endif\n\t\t\t\t\t\tradius = Math.Min(screenSize.X, screenSize.Y) * 0.95f * 0.5f;\n\n\t\t\t\t\tfloat offsetLength = offset.Length();\n\n\t\t\t\t\tVector2 normalizedOffset = offset / offsetLength;\n\n\t\t\t\t\tbool offscreen = offsetLength > radius;\n\n\t\t\t\t\tbool behind = originalDepth < main.Camera.NearPlaneDistance;\n\t\t\t\t\t{\n\t\t\t\t\t\tstring img = offscreen || behind ? targetOffScreen : targetOnScreen;\n\n\t\t\t\t\t\tif (sprite.Image.Value != img)\n\t\t\t\t\t\t\tsprite.Image.Value = img;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (behind)\n\t\t\t\t\t\tnormalizedOffset *= -1.0f;\n\n\t\t\t\t\tif (offscreen || behind)\n\t\t\t\t\t\tsprite.Rotation.Value = -(float)Math.Atan2(normalizedOffset.Y, -normalizedOffset.X) - (float)Math.PI * 0.5f;\n\t\t\t\t\telse\n\t\t\t\t\t\tsprite.Rotation.Value = 0.0f;\n\n\t\t\t\t\tif (behind || offscreen)\n\t\t\t\t\t\toffset = normalizedOffset * radius;\n\n\t\t\t\t\tsprite.Position.Value = screenCenter + offset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/Vault.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class Vault : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic enum State\n\t\t{\n\t\t\tNone,\n\t\t\tStraight,\n\t\t}\n\n\t\tprivate Random random = new Random();\n\n\t\t// Input\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<Vector3> FloorPosition = new Property<Vector3>();\n\t\tpublic Property<float> MaxSpeed = new Property<float>();\n\t\tpublic Property<WallRun.State> WallRunState = new Property<WallRun.State>();\n\t\tpublic Property<float> Radius = new Property<float>();\n\n\t\t// Output\n\t\tpublic Property<State> CurrentState = new Property<State>();\n\t\tpublic Command LockRotation = new Command();\n\t\tpublic Property<float> LastSupportedSpeed = new Property<float>();\n\t\tpublic Command DeactivateWallRun = new Command();\n\t\tpublic Command<float> FallDamage = new Command<float>();\n\t\tprivate AnimatedModel model;\n\t\tpublic Property<float> LastVaultStarted = new Property<float> { Value = -1.0f };\n\n\t\t// Input/output\n\t\tpublic BlockPredictor Predictor;\n\t\tpublic Property<float> Rotation = new Property<float>();\n\t\tpublic Property<bool> IsSupported = new Property<bool>();\n\t\tpublic Property<bool> HasTraction = new Property<bool>();\n\t\tpublic Property<bool> EnableWalking = new Property<bool>();\n\t\tpublic Property<bool> AllowUncrouch = new Property<bool>();\n\t\tpublic Property<bool> Crouched = new Property<bool>();\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\n\t\tprivate float vaultTime;\n\n\t\tprivate bool vaultOver;\n\t\tprivate bool isTopOut;\n\t\tprivate bool shallowMantle;\n\t\t\n\t\tprivate float moveForwardStartTime;\n\t\tprivate bool movingForward;\n\n\t\tprivate Vector3 originalPosition;\n\t\tprivate Vector3 relativeVaultStartPosition;\n\t\tprivate Vector3 vaultVelocity;\n\t\tprivate float initialVerticalDifference;\n\t\tprivate Vector3 forward;\n\t\tprivate Voxel map;\n\t\tprivate Voxel.Coord coord;\n\n\t\tconst float topOutVerticalSpeed = 4.5f;\n\t\tconst float mantleVaultVerticalSpeed = 8.0f;\n\t\tconst float maxVaultTime = 1.0f;\n\t\tconst float maxTopoutTime = 2.0f;\n\t\tconst int searchUpDistance = 2;\n\t\tconst int searchDownDistance = 4;\n\t\tconst int searchForwardDistance = 2;\n\n\t\tpublic void Bind(AnimatedModel model)\n\t\t{\n\t\t\tthis.model = model;\n\n\t\t\t// Filters are in Blender's Z-up coordinate system\n\n\t\t\tthis.model[\"Mantle\"].Speed = 1.3f;\n\t\t\tSkinnedModel.Clip mantle = this.model[\"Mantle\"];\n\t\t\tmantle.GetChannel(this.model.GetBoneIndex(\"ORG-hips\")).Filter = delegate(Matrix m)\n\t\t\t{\n\t\t\t\tfloat blend = (float)mantle.CurrentTime.TotalSeconds / (float)mantle.Duration.TotalSeconds;\n\t\t\t\tm.Translation = new Vector3(0.0f, this.shallowMantle ? blend : -(1.0f - blend), 2.0f - (MathHelper.Clamp(blend, 0, 1.5f)));\n\t\t\t\treturn m;\n\t\t\t};\n\t\t\tthis.model[\"TopOut\"].Speed = 1.8f;\n\t\t\tthis.model[\"TopOut\"].GetChannel(this.model.GetBoneIndex(\"ORG-hips\")).Filter = delegate(Matrix m)\n\t\t\t{\n\t\t\t\tVector3 diff = Vector3.Transform(this.relativeVaultStartPosition, this.map.Transform) + new Vector3(0, 0.535f + (this.Crouched ? 0.0f : Character.DefaultTotalHeight - Character.DefaultCrouchedTotalHeight), 0) - this.Position;\n\t\t\t\tm.Translation += Vector3.Transform(diff, Matrix.CreateRotationY(-this.Rotation) * Matrix.CreateRotationX((float)Math.PI * 0.5f));\n\t\t\t\treturn m;\n\t\t\t};\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Serialize = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tprivate enum CandidateStatus { Good, Uneven, Bad }\n\n\t\tprivate static CandidateStatus checkAdjacent(Voxel v, Voxel.Coord coord, Direction up, Direction backward, Direction right)\n\t\t{\n\t\t\tif (v[coord.Move(backward)] != Voxel.States.Empty\n\t\t\t\t|| v[coord.Move(up).Move(backward)] != Voxel.States.Empty\n\t\t\t\t|| v[coord.Move(up, 2).Move(backward)] != Voxel.States.Empty\n\t\t\t\t|| v[coord.Move(up, 3).Move(backward)] != Voxel.States.Empty\n\t\t\t\t|| v[coord.Move(up)] != Voxel.States.Empty\n\t\t\t\t|| v[coord.Move(up, 2)] != Voxel.States.Empty\n\t\t\t\t|| v[coord.Move(up, 3)] != Voxel.States.Empty)\n\t\t\t\treturn CandidateStatus.Bad;\n\t\t\telse if (v[coord.Move(right, -1).Move(up)] != Voxel.States.Empty\n\t\t\t\t|| v[coord.Move(right, -1).Move(up, 2)] != Voxel.States.Empty\n\t\t\t\t|| v[coord.Move(right, -1).Move(up, 3)] != Voxel.States.Empty\n\t\t\t\t|| v[coord.Move(right).Move(up)] != Voxel.States.Empty\n\t\t\t\t|| v[coord.Move(right).Move(up, 2)] != Voxel.States.Empty\n\t\t\t\t|| v[coord.Move(right).Move(up, 3)] != Voxel.States.Empty)\n\t\t\t\treturn CandidateStatus.Uneven;\n\t\t\telse\n\t\t\t\treturn CandidateStatus.Good;\n\t\t}\n\n\t\tpublic bool Go(bool checkPossibilities)\n\t\t{\n\t\t\tif (this.main.TotalTime - this.LastVaultStarted < vaultCoolDown)\n\t\t\t\treturn false;\n\n\t\t\tMatrix rotationMatrix = Matrix.CreateRotationY(this.Rotation);\n\t\t\tforeach (Voxel map in Voxel.ActivePhysicsVoxels)\n\t\t\t{\n\t\t\t\tDirection up = map.GetRelativeDirection(Direction.PositiveY);\n\t\t\t\tDirection backward = map.GetRelativeDirection(rotationMatrix.Forward);\n\t\t\t\tDirection right = up.Cross(backward);\n\t\t\t\tVector3 pos = this.Position + rotationMatrix.Forward * -(this.Radius + 0.95f);\n\t\t\t\tVoxel.Coord resortCoord = default(Voxel.Coord);\n\t\t\t\tbool resort = false;\n\t\t\t\tfor (int j = 0; j < searchForwardDistance; j++)\n\t\t\t\t{\n\t\t\t\t\tVoxel.Coord baseCoord = map.GetCoordinate(pos + (rotationMatrix.Forward * -j)).Move(up, searchUpDistance);\n\t\t\t\t\tforeach (int x in new[] { 0, -1, 1 })\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord coord = baseCoord.Move(right, x);\n\t\t\t\t\t\tfor (int i = 0; i < searchDownDistance; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (map[coord] != Voxel.States.Empty)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tCandidateStatus status = checkAdjacent(map, coord, up, backward, right);\n\t\t\t\t\t\t\t\tif (status == CandidateStatus.Bad)\n\t\t\t\t\t\t\t\t\tbreak; // Conflict\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tbool conflict = false;\n\t\t\t\t\t\t\t\t// Check other voxels for conflicts\n\t\t\t\t\t\t\t\tforeach (Voxel v in Voxel.ActivePhysicsVoxels)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (v != map)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tDirection up2 = v.GetRelativeDirection(Direction.PositiveY);\n\t\t\t\t\t\t\t\t\t\tDirection backward2 = v.GetRelativeDirection(rotationMatrix.Forward);\n\t\t\t\t\t\t\t\t\t\tDirection right2 = up2.Cross(backward2);\n\n\t\t\t\t\t\t\t\t\t\tVoxel.Coord coord2 = v.GetCoordinate(map.GetAbsolutePosition(coord));\n\t\t\t\t\t\t\t\t\t\tif (v[coord2] != Voxel.States.Empty\n\t\t\t\t\t\t\t\t\t\t\t|| checkAdjacent(v, coord2, up2, backward2, right2) != CandidateStatus.Good)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tconflict = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (conflict)\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tif (status == CandidateStatus.Uneven && !resort)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tresortCoord = coord;\n\t\t\t\t\t\t\t\t\tresort = true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Vault\n\t\t\t\t\t\t\t\tthis.vault(map, coord.Move(up), false);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcoord = coord.Move(up.GetReverse());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (resort)\n\t\t\t\t{\n\t\t\t\t\tthis.vault(map, resortCoord.Move(up), true);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (checkPossibilities)\n\t\t\t{\n\t\t\t\t// Check block possibilities for vaulting\n\t\t\t\tforeach (BlockPredictor.Possibility possibility in this.Predictor.AllPossibilities)\n\t\t\t\t{\n\t\t\t\t\tDirection up = possibility.Map.GetRelativeDirection(Direction.PositiveY);\n\t\t\t\t\tDirection right = possibility.Map.GetRelativeDirection(Vector3.Cross(Vector3.Up, -rotationMatrix.Forward));\n\t\t\t\t\tVector3 pos = this.Position + rotationMatrix.Forward * (this.WallRunState == WallRun.State.Straight ? -1.75f : -1.25f);\n\t\t\t\t\tVoxel.Coord baseCoord = possibility.Map.GetCoordinate(pos).Move(up, searchUpDistance);\n\t\t\t\t\tforeach (int x in new[] { 0, -1, 1 })\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord coord = baseCoord.Move(right, x);\n\t\t\t\t\t\tfor (int i = 0; i < searchDownDistance; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord downCoord = coord.Move(up.GetReverse());\n\t\t\t\t\t\t\tif (!coord.Between(possibility.StartCoord, possibility.EndCoord) && downCoord.Between(possibility.StartCoord, possibility.EndCoord))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.Predictor.InstantiatePossibility(possibility);\n\t\t\t\t\t\t\t\tthis.vault(possibility.Map, coord, false);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcoord = coord.Move(up.GetReverse());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate Vector3 getSupportVelocity(Voxel voxel)\n\t\t{\n\t\t\tif (voxel == null)\n\t\t\t\treturn Vector3.Zero;\n\t\t\telse\n\t\t\t\treturn voxel.LinearVelocity + Vector3.Cross(voxel.AngularVelocity, this.FloorPosition - voxel.Transform.Value.Translation);\n\t\t}\n\n\t\tprivate bool uncrouchEarly;\n\t\tprivate void vault(Voxel map, Voxel.Coord coord, bool uneven)\n\t\t{\n\t\t\tVector3 supportLocation = this.FloorPosition;\n\t\t\tVector3 supportVelocity = this.getSupportVelocity(map);\n\n\t\t\tfloat verticalVelocityChange = this.LinearVelocity.Value.Y - supportVelocity.Y;\n\t\t\tif (verticalVelocityChange < Components.FallDamage.DeathVelocity)\n\t\t\t\treturn; // Don't even try to grab\n\n\t\t\tthis.FallDamage.Execute(verticalVelocityChange);\n\t\t\tif (!this.Active) // We died from fall damage\n\t\t\t\treturn;\n\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_VAULT, this.Entity);\n\n\t\t\tthis.DeactivateWallRun.Execute();\n\t\t\tthis.CurrentState.Value = State.Straight;\n\n\t\t\tthis.coord = coord;\n\n\t\t\tVector3 coordPosition = map.GetAbsolutePosition(coord);\n\t\t\tthis.forward = coordPosition - this.Position;\n\t\t\tthis.initialVerticalDifference = forward.Y;\n\n\t\t\tthis.isTopOut = this.initialVerticalDifference > 1.75f || verticalVelocityChange < Lemma.Components.FallDamage.DamageVelocity;\n\n\t\t\tthis.forward.Y = 0.0f;\n\n\t\t\tfloat horizontalDistanceToCoord = this.forward.Length();\n\t\t\tthis.forward /= horizontalDistanceToCoord;\n\n\t\t\tVector3 pos = coordPosition + this.forward * (Character.DefaultRadius + 1.0f);\n\t\t\tpos.Y = this.Position.Value.Y;\n\t\t\tthis.Position.Value = pos;\n\n\t\t\t// If there's nothing on the other side of the wall (it's a one-block-wide wall)\n\t\t\t// then vault over it rather than standing on top of it\n\t\t\tthis.vaultOver = this.initialVerticalDifference > 0.0f\n\t\t\t\t&& map[coordPosition + this.forward].ID == Voxel.t.Empty\n\t\t\t\t&& map[coordPosition + this.forward + new Vector3(0, -1, 0)].ID == Voxel.t.Empty\n\t\t\t\t&& map[coordPosition + this.forward + new Vector3(0, -2, 0)].ID == Voxel.t.Empty;\n\n\t\t\t// Grunt if we're going up\n\t\t\t// If we're falling down, don't grunt because we might already be grunting from the fall damage\n\t\t\t// That would just be awkward\n\t\t\tif (this.random.NextDouble() > 0.5 && verticalVelocityChange >= 0 && !this.isTopOut)\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_GRUNT, this.Entity);\n\n\t\t\tthis.vaultVelocity = supportVelocity + new Vector3(0, this.isTopOut ? topOutVerticalSpeed : mantleVaultVerticalSpeed, 0);\n\n\t\t\tthis.map = map;\n\n\t\t\tthis.LinearVelocity.Value = this.vaultVelocity;\n\t\t\tthis.IsSupported.Value = false;\n\t\t\tthis.HasTraction.Value = false;\n\n\t\t\tDirection relativeDir = map.GetRelativeDirection(this.forward);\n\t\t\tVector3 absoluteDirVector = map.GetAbsoluteVector(relativeDir.GetVector());\n\t\t\tthis.Rotation.Value = (float)Math.Atan2(absoluteDirVector.X, absoluteDirVector.Z);\n\t\t\tthis.LockRotation.Execute();\n\n\t\t\tthis.EnableWalking.Value = false;\n\t\t\tthis.Crouched.Value = true;\n\t\t\tthis.AllowUncrouch.Value = false;\n\n\t\t\tSession.Recorder.Event(main, \"Vault\");\n\t\t\tthis.model.Stop\n\t\t\t(\n\t\t\t\t\"Mantle\",\n\t\t\t\t\"TopOut\",\n\t\t\t\t\"Jump\",\n\t\t\t\t\"Jump02\",\n\t\t\t\t\"Jump03\",\n\t\t\t\t\"JumpLeft\",\n\t\t\t\t\"JumpRight\",\n\t\t\t\t\"JumpBackward\"\n\t\t\t);\n\t\t\tthis.model.StartClip(this.isTopOut ? \"TopOut\" : \"Mantle\", 4, false, AnimatedModel.DefaultBlendTime);\n\n\t\t\tif (this.vaultOver)\n\t\t\t\tthis.shallowMantle = false;\n\t\t\telse if (!this.isTopOut)\n\t\t\t{\n\t\t\t\t// We're mantling\n\t\t\t\t// Determine if this is a shallow mantle or not\n\t\t\t\tthis.shallowMantle = map[coordPosition + this.forward * 1.5f + new Vector3(0, 1, 0)].ID != Voxel.t.Empty\n\t\t\t\t\t|| map[coordPosition + this.forward * 1.5f + new Vector3(0, 2, 0)].ID != Voxel.t.Empty;\n\t\t\t}\n\n\t\t\tthis.vaultTime = 0.0f;\n\t\t\tthis.moveForwardStartTime = 0.0f;\n\t\t\tthis.movingForward = false;\n\t\t\tthis.originalPosition = this.Position;\n\n\t\t\tDirection up = map.GetRelativeDirection(Direction.PositiveY);\n\n\t\t\t// If this is a top-out, we have to make sure the animation lines up perfectly\n\t\t\tif (this.isTopOut)\n\t\t\t\tthis.relativeVaultStartPosition = map.GetRelativePosition(coord.Move(relativeDir, -2)) + up.GetVector() * -3.7f;\n\t\t\telse\n\t\t\t\tthis.relativeVaultStartPosition = Vector3.Transform(this.originalPosition, Matrix.Invert(this.map.Transform));\n\n\t\t\tif (uneven)\n\t\t\t{\n\t\t\t\t// We're climbing an uneven surface, we need to uncrouch early if possible\n\t\t\t\tDirection right = relativeDir.Cross(up);\n\t\t\t\tthis.uncrouchEarly = map[coord.Move(up, 3).Move(right, -1)] == Voxel.States.Empty\n\t\t\t\t\t&& map[coord.Move(up, 3)] == Voxel.States.Empty\n\t\t\t\t\t&& map[coord.Move(up, 3).Move(right, 1)] == Voxel.States.Empty;\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis.uncrouchEarly = false;\n\t\t\t\n\t\t\tthis.LastVaultStarted.Value = this.main.TotalTime;\n\t\t}\n\n\t\tprivate const float vaultCoolDown = 0.5f;\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.CurrentState != State.None)\n\t\t\t{\n\t\t\t\tthis.vaultTime += dt;\n\n\t\t\t\tbool done = false;\n\n\t\t\t\tif (this.movingForward)\n\t\t\t\t{\n\t\t\t\t\tif (this.uncrouchEarly)\n\t\t\t\t\t\tthis.AllowUncrouch.Value = true;\n\n\t\t\t\t\tif (this.isTopOut)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!this.model.IsPlaying(\"TopOut\"))\n\t\t\t\t\t\t\tdone = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat moveForwardTime = this.vaultTime - this.moveForwardStartTime;\n\t\t\t\t\t\tif (this.vaultOver)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (moveForwardTime > 0.15f)\n\t\t\t\t\t\t\t\tdone = true; // Done moving forward\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (moveForwardTime > 0.25f)\n\t\t\t\t\t\t\t\tdone = true; // Done moving forward\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!done)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Still moving forward\n\t\t\t\t\t\tVector3 supportVelocity = this.getSupportVelocity(this.map);\n\t\t\t\t\t\tthis.LinearVelocity.Value = supportVelocity + this.forward * (this.isTopOut ? this.MaxSpeed * 0.5f : this.MaxSpeed);\n\t\t\t\t\t\tthis.LastSupportedSpeed.Value = this.LinearVelocity.Value.Length();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// We're still going up.\n\n\t\t\t\t\tif (this.LinearVelocity.Value.Y - this.getSupportVelocity(this.map).Y < 0.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\t// We hit something above us.\n\t\t\t\t\t\tdone = true;\n\t\t\t\t\t\tthis.model.Stop(\"TopOut\", \"Mantle\");\n\t\t\t\t\t\tthis.map = null;\n\t\t\t\t\t}\n\t\t\t\t\telse if (this.IsSupported || this.vaultTime > (this.isTopOut ? maxTopoutTime : maxVaultTime)\n\t\t\t\t\t\t|| (this.FloorPosition.Value.Y > this.map.GetAbsolutePosition(this.coord).Y + 0.1f)) // Move forward\n\t\t\t\t\t{\n\t\t\t\t\t\t// We've reached the top of the vault. Start moving forward.\n\t\t\t\t\t\t// Max vault time ensures we never get stuck\n\n\t\t\t\t\t\tif (this.isTopOut || this.vaultOver)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// We need to keep the vault mover alive for a while\n\t\t\t\t\t\t\t// to keep the player moving forward over the wall\n\t\t\t\t\t\t\tthis.movingForward = true;\n\t\t\t\t\t\t\tthis.moveForwardStartTime = this.vaultTime;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// It's just a mantle, we're done\n\t\t\t\t\t\t\tthis.LinearVelocity.Value = this.getSupportVelocity(this.map) + this.forward * this.MaxSpeed;\n\t\t\t\t\t\t\tthis.LastSupportedSpeed.Value = this.LinearVelocity.Value.Length();\n\t\t\t\t\t\t\tdone = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse // We're still going up.\n\t\t\t\t\t\tthis.LinearVelocity.Value = this.vaultVelocity;\n\t\t\t\t}\n\n\t\t\t\tif (done)\n\t\t\t\t{\n\t\t\t\t\tthis.CurrentState.Value = State.None;\n\t\t\t\t\tthis.EnableWalking.Value = true;\n\t\t\t\t\tthis.Entity.Add(new Animation\n\t\t\t\t\t(\n\t\t\t\t\t\tnew Animation.Delay(0.1f),\n\t\t\t\t\t\tnew Animation.Set<bool>(this.AllowUncrouch, true)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (this.map != null && !this.model.IsPlaying(\"TopOut\", \"Mantle\"))\n\t\t\t\tthis.map = null;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/VirtualReticle.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma\n{\n\tpublic class VirtualReticle : Component<Main>, IUpdateableComponent\n\t{\n\t\tprivate const float size = 0.01f;\n\n\t\t// Input properties\n\t\tpublic Property<float> Rotation = new Property<float>();\n\n\t\t// Output properties\n\t\tpublic Property<Matrix> Transform = new Property<Matrix>();\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tVector3 cameraPosition = this.main.Camera.Position;\n\t\t\tVector3 forwardVector = -Matrix.CreateRotationY(this.Rotation).Forward;\n\n\t\t\tMatrix matrix = Matrix.CreateRotationY(this.Rotation + (float)Math.PI * 0.5f);\n\n\t\t\tVoxel.GlobalRaycastResult hit = Voxel.GlobalRaycast(cameraPosition, forwardVector, this.main.Camera.FarPlaneDistance, null, true);\n\t\t\tif (hit.Voxel != null)\n\t\t\t{\n\t\t\t\tmatrix *= Matrix.CreateScale(hit.Distance * VirtualReticle.size);\n\t\t\t\tmatrix.Translation = hit.Position;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmatrix *= Matrix.CreateScale(this.main.Camera.FarPlaneDistance * VirtualReticle.size);\n\t\t\t\tmatrix.Translation = cameraPosition + forwardVector * this.main.Camera.FarPlaneDistance;\n\t\t\t}\n\t\t\tthis.Transform.Value = matrix;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Player/VoxelTools.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class VoxelTools : Component<Main>\n\t{\n\t\t// Input properties\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<float> Height = new Property<float>();\n\t\tpublic Property<float> SupportHeight = new Property<float>();\n\n\t\tprivate Random random = new Random();\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Serialize = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic void BuildFloor(Voxel floorMap, Voxel.Coord floorCoordinate, Direction forwardDir, Direction rightDir)\n\t\t{\n\t\t\tList<EffectBlockFactory.BlockBuildOrder> buildCoords = new List<EffectBlockFactory.BlockBuildOrder>();\n\n\t\t\tVoxel.Coord newFloorCoordinate = floorMap.GetCoordinate(this.Position);\n\t\t\tfloorCoordinate.SetComponent(rightDir, newFloorCoordinate.GetComponent(rightDir));\n\t\t\tfloorCoordinate.SetComponent(forwardDir, newFloorCoordinate.GetComponent(forwardDir));\n\t\t\tDirection upDir = floorMap.GetRelativeDirection(Direction.PositiveY);\n\n\t\t\tconst int radius = 3;\n\t\t\tforeach (Voxel.Coord x in this.spreadFromCenter(floorCoordinate, rightDir))\n\t\t\t{\n\t\t\t\tif (floorMap[x.Move(upDir)].Hard)\n\t\t\t\t\tbreak;\n\t\t\t\tint dx = x.GetComponent(rightDir) - floorCoordinate.GetComponent(rightDir);\n\t\t\t\tfor (Voxel.Coord y = x.Move(forwardDir, -radius); y.GetComponent(forwardDir) < floorCoordinate.GetComponent(forwardDir) + radius; y = y.Move(forwardDir))\n\t\t\t\t{\n\t\t\t\t\tif (floorMap[y.Move(upDir)].Hard)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tint dy = y.GetComponent(forwardDir) - floorCoordinate.GetComponent(forwardDir);\n\t\t\t\t\tif ((float)Math.Sqrt(dx * dx + dy * dy) < radius && floorMap[y].ID == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tbuildCoords.Add(new EffectBlockFactory.BlockBuildOrder\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel = floorMap,\n\t\t\t\t\t\t\tCoordinate = y,\n\t\t\t\t\t\t\tState = Voxel.States.Blue,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tFactory.Get<EffectBlockFactory>().Build(this.main, buildCoords, this.Position);\n\t\t}\n\n\t\tprivate IEnumerable<Voxel.Coord> spreadFromCenter(Voxel.Coord center, Direction dir)\n\t\t{\n\t\t\tfor (Voxel.Coord z = center.Move(dir, -1); z.GetComponent(dir) > center.GetComponent(dir) - 3; z = z.Move(dir.GetReverse()))\n\t\t\t\tyield return z;\n\t\t\tfor (Voxel.Coord z = center.Clone(); z.GetComponent(dir) < center.GetComponent(dir) + 3; z = z.Move(dir))\n\t\t\t\tyield return z;\n\t\t}\n\n\t\tpublic bool BreakWalls(Vector3 forward, Vector3 right)\n\t\t{\n\t\t\tBlockFactory blockFactory = Factory.Get<BlockFactory>();\n\t\t\tVector3 basePos = this.Position + new Vector3(0, 0.2f + (this.Height * -0.5f) - this.SupportHeight, 0) + forward * -1.0f;\n\t\t\tbool broke = false;\n\t\t\tforeach (Voxel map in Voxel.ActivePhysicsVoxels.ToList())\n\t\t\t{\n\t\t\t\tList<Voxel.Coord> removals = new List<Voxel.Coord>();\n\t\t\t\tQuaternion mapQuaternion = Quaternion.CreateFromRotationMatrix(map.Transform);\n\t\t\t\tVoxel.Coord top = map.GetCoordinate(basePos + new Vector3(0, this.Height + this.SupportHeight + 0.5f, 0));\n\t\t\t\tDirection upDir = map.GetRelativeDirection(Vector3.Up);\n\t\t\t\tDirection rightDir = map.GetRelativeDirection(right);\n\t\t\t\tDirection forwardDir = map.GetRelativeDirection(forward);\n\t\t\t\tVoxel.Coord center = map.GetCoordinate(basePos);\n\t\t\t\tfor (Voxel.Coord y = center.Clone(); y.GetComponent(upDir) <= top.GetComponent(upDir); y = y.Move(upDir))\n\t\t\t\t{\n\t\t\t\t\tint minZ = center.GetComponent(rightDir) - 10;\n\t\t\t\t\tint maxZ = minZ + 20;\n\t\t\t\t\tforeach (Voxel.Coord x in this.spreadFromCenter(y, rightDir))\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord z = x.Clone();\n\t\t\t\t\t\tfor (int i = 0; i < 4; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.State state = map[z];\n\t\t\t\t\t\t\tint zRightDimension = z.GetComponent(rightDir);\n\t\t\t\t\t\t\tif (zRightDimension > minZ && zRightDimension < maxZ && state.ID != 0 && !removals.Contains(z))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (state.Permanent || state.Hard)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (zRightDimension >= center.GetComponent(rightDir))\n\t\t\t\t\t\t\t\t\t\tmaxZ = zRightDimension;\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tminZ = zRightDimension;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbroke = true;\n\t\t\t\t\t\t\t\t\tremovals.Add(z);\n\t\t\t\t\t\t\t\t\tVector3 cellPos = map.GetAbsolutePosition(z);\n\t\t\t\t\t\t\t\t\tVector3 toCell = cellPos - basePos;\n\t\t\t\t\t\t\t\t\tEntity block = blockFactory.CreateAndBind(this.main);\n\t\t\t\t\t\t\t\t\tTransform blockTransform = block.Get<Transform>();\n\t\t\t\t\t\t\t\t\tblockTransform.Position.Value = cellPos;\n\t\t\t\t\t\t\t\t\tblockTransform.Quaternion.Value = Quaternion.CreateFromYawPitchRoll(((float)this.random.NextDouble() - 0.5f) * 2.0f, ((float)this.random.NextDouble() - 0.5f) * 2.0f, ((float)this.random.NextDouble() - 0.5f) * 2.0f);\n\t\t\t\t\t\t\t\t\tstate.ApplyToBlock(block);\n\t\t\t\t\t\t\t\t\ttoCell += forward * 4.0f;\n\t\t\t\t\t\t\t\t\ttoCell.Normalize();\n\t\t\t\t\t\t\t\t\tPhysicsBlock physicsBlock = block.Get<PhysicsBlock>();\n\t\t\t\t\t\t\t\t\tphysicsBlock.Box.LinearVelocity = toCell * 15.0f;\n\t\t\t\t\t\t\t\t\tphysicsBlock.Box.AngularVelocity = new Vector3(((float)this.random.NextDouble() - 0.5f) * 2.0f * (float)Math.PI, ((float)this.random.NextDouble() - 0.5f) * 2.0f * (float)Math.PI, ((float)this.random.NextDouble() - 0.5f) * 2.0f * (float)Math.PI);\n\t\t\t\t\t\t\t\t\tmain.Add(block);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tz = z.Move(forwardDir);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (removals.Count > 0)\n\t\t\t\t{\n\t\t\t\t\tmap.Empty(removals);\n\t\t\t\t\tmap.Regenerate();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn broke;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Player/WallRun.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Factories;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class WallRun : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic enum State { None, Left, Right, Straight, Down }\n\n\t\t// Input/output properties\n\t\tpublic Property<Vector3> LinearVelocity = new Property<Vector3>();\n\t\tpublic Property<Vector3> Position = new Property<Vector3>();\n\t\tpublic Property<float> Rotation = new Property<float>();\n\t\tpublic Property<bool> IsSupported = new Property<bool>();\n\t\tpublic BlockPredictor Predictor;\n\n\t\t// Input properties\n\t\tpublic Property<bool> IsSwimming = new Property<bool>();\n\t\tpublic Property<float> Height = new Property<float>();\n\t\tpublic Property<float> JumpSpeed = new Property<float>();\n\t\tpublic Property<float> MaxSpeed = new Property<float>();\n\t\tpublic Property<bool> EnableWallRun = new Property<bool>();\n\t\tpublic Property<bool> EnableWallRunHorizontal = new Property<bool>();\n\t\tpublic Property<bool> EnableEnhancedWallRun = new Property<bool>();\n\t\tpublic Property<float> LastWallJump = new Property<float>();\n\n\t\t// Output properties\n\t\tpublic Property<bool> AllowUncrouch = new Property<bool>();\n\t\tpublic Property<bool> HasTraction = new Property<bool>();\n\t\tpublic Command StopKick = new Command();\n\t\tpublic Command LockRotation = new Command();\n\t\tpublic Command<float> UpdateLockedRotation = new Command<float>();\n\t\tpublic Command Vault = new Command();\n\t\tpublic Command<Voxel, Voxel.Coord, Direction> WalkedOn = new Command<Voxel, Voxel.Coord, Direction>();\n\t\tpublic Property<State> CurrentState = new Property<State>();\n\t\tpublic Property<Voxel> WallRunVoxel = new Property<Voxel>();\n\t\tpublic Property<Direction> WallDirection = new Property<Direction>();\n\t\tpublic Property<Direction> WallRunDirection = new Property<Direction>();\n\t\tpublic Property<float> LastSupportedSpeed = new Property<float>();\n\n\t\tprivate const float minWallRunSpeed = 4.0f;\n\n\t\tprivate float lastWallRunEnded = -1.0f;\n\t\tprivate const float wallRunDelay = 0.75f;\n\n\t\t// Since block possibilities are instantiated on another thread,\n\t\t// we have to give that thread some time to do it before checking if there is actually a wall to run on.\n\t\t// Otherwise, we will immediately stop wall-running since the wall hasn't been instantiated yet.\n\t\tprivate float wallInstantiationTimer = 0.0f;\n\n\t\tpublic Property<Voxel> LastWallRunMap = new Property<Voxel>();\n\t\tpublic Property<Direction> LastWallDirection = new Property<Direction>();\n\n\t\tprivate Voxel.Coord lastWallRunCoord;\n\n\t\tprivate Vector3 lastWallRunStart;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Serialize = false;\n\t\t\tthis.EnabledWhenPaused = false;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_PLAYER_SLIDE_LOOP, this.Entity);\n\t\t}\n\n\t\tpublic bool Activate(State state, bool checkPossibilities)\n\t\t{\n\t\t\tif (!this.EnableWallRun)\n\t\t\t\treturn false;\n\n\t\t\tVector3 playerVelocity = this.LinearVelocity.Value;\n\t\t\tif (playerVelocity.Y < FallDamage.RollingDamageVelocity)\n\t\t\t\treturn false;\n\n\t\t\tif (this.IsSwimming)\n\t\t\t{\n\t\t\t\tif (state == State.Left || state == State.Right)\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.wallInstantiationTimer = 0.0f;\n\n\t\t\t// Prevent the player from repeatedly wall-running and wall-jumping ad infinitum.\n\t\t\tbool wallRunJumpDelayPassed = main.TotalTime - this.LastWallJump > wallRunDelay;\n\n\t\t\tMatrix matrix = Matrix.CreateRotationY(this.Rotation);\n\n\t\t\tVector3 forwardVector = -matrix.Forward;\n\n\t\t\tVector3 wallVector;\n\t\t\tswitch (state)\n\t\t\t{\n\t\t\t\tcase State.Straight:\n\t\t\t\t\twallVector = forwardVector;\n\t\t\t\t\tbreak;\n\t\t\t\tcase State.Left:\n\t\t\t\t\tif (!this.EnableWallRunHorizontal)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\twallVector = -matrix.Left;\n\t\t\t\t\tbreak;\n\t\t\t\tcase State.Right:\n\t\t\t\t\tif (!this.EnableWallRunHorizontal)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\twallVector = -matrix.Right;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\twallVector = Vector3.Zero;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tVector3 pos = this.Position + new Vector3(0, this.Height * -0.5f, 0);\n\n\t\t\t// Attempt to wall-run on an existing map\n\t\t\tbool addInitialVelocity = false;\n\t\t\tVoxel closestVoxel = null;\n\t\t\tVoxel.Coord closestCoord = default(Voxel.Coord);\n\t\t\tconst int maxWallDistance = 4;\n\t\t\tint closestDistance = maxWallDistance;\n\t\t\tDirection closestDir = Direction.None;\n\t\t\tforeach (Voxel voxel in Voxel.ActivePhysicsVoxels)\n\t\t\t{\n\t\t\t\tVector3 baseVelocity = voxel.LinearVelocity + Vector3.Cross(voxel.AngularVelocity, this.Position - voxel.Transform.Value.Translation);\n\t\t\t\tVector3 v = Vector3.Normalize(playerVelocity - baseVelocity);\n\t\t\t\tv.Y = 0.0f;\n\t\t\t\tif (Vector3.Dot(forwardVector, v) < -0.3f)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tVoxel.Coord coord = voxel.GetCoordinate(pos);\n\t\t\t\tDirection dir = voxel.GetRelativeDirection(wallVector);\n\t\t\t\tDirection up = voxel.GetRelativeDirection(Direction.PositiveY);\n\t\t\t\tDirection forwardDir = voxel.GetRelativeDirection(forwardVector);\n\t\t\t\tfor (int i = 1; i < maxWallDistance; i++)\n\t\t\t\t{\n\t\t\t\t\tVoxel.Coord wallCoord = coord.Move(dir, i);\n\t\t\t\t\tif (voxel[coord.Move(dir, i - 1)] != Voxel.States.Empty\n\t\t\t\t\t\t|| voxel[coord.Move(dir, i - 1).Move(up, 1)] != Voxel.States.Empty\n\t\t\t\t\t\t|| voxel[coord.Move(dir, i - 1).Move(up, 2)] != Voxel.States.Empty\n\t\t\t\t\t\t|| ((state == State.Left || state == State.Right)\n\t\t\t\t\t\t\t&& (voxel[coord.Move(forwardDir).Move(dir, i - 1)] != Voxel.States.Empty\n\t\t\t\t\t\t\t|| voxel[coord.Move(forwardDir).Move(dir, i - 1).Move(up, 1)] != Voxel.States.Empty\n\t\t\t\t\t\t\t|| voxel[coord.Move(forwardDir).Move(dir, i - 1).Move(up, 2)] != Voxel.States.Empty)))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Blocked\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Need at least two blocks to consider it a wall\n\t\t\t\t\tif (voxel[wallCoord].ID != 0 && voxel[wallCoord.Move(up)].ID != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tbool differentWall = voxel != this.LastWallRunMap.Value || dir != this.LastWallDirection.Value;\n\t\t\t\t\t\tif ((differentWall || wallRunJumpDelayPassed) && i < closestDistance)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclosestVoxel = voxel;\n\t\t\t\t\t\t\tclosestDistance = i;\n\t\t\t\t\t\t\tclosestCoord = coord;\n\t\t\t\t\t\t\tclosestDir = dir;\n\t\t\t\t\t\t\tVector3 wallRunStartDiff = this.lastWallRunStart - this.Position;\n\t\t\t\t\t\t\twallRunStartDiff.Y = 0.0f;\n\t\t\t\t\t\t\taddInitialVelocity = this.IsSupported || (differentWall && (wallRunStartDiff.Length() > 2.0f || main.TotalTime - this.lastWallRunEnded > wallRunDelay));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (checkPossibilities)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Check block possibilities\n\t\t\t\t\t\tList<BlockPredictor.Possibility> mapBlockPossibilities = this.Predictor.GetPossibilities(voxel);\n\t\t\t\t\t\tif (mapBlockPossibilities != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach (BlockPredictor.Possibility block in mapBlockPossibilities)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (wallCoord.Between(block.StartCoord, block.EndCoord))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis.Predictor.InstantiatePossibility(block);\n\t\t\t\t\t\t\t\t\tthis.Predictor.ClearPossibilities();\n\t\t\t\t\t\t\t\t\tclosestVoxel = voxel;\n\t\t\t\t\t\t\t\t\tclosestDistance = i;\n\t\t\t\t\t\t\t\t\tclosestCoord = coord;\n\t\t\t\t\t\t\t\t\tclosestDir = dir;\n\t\t\t\t\t\t\t\t\taddInitialVelocity = true;\n\t\t\t\t\t\t\t\t\tthis.wallInstantiationTimer = 0.25f;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (closestVoxel != null)\n\t\t\t{\n\t\t\t\tif ((state == State.Left || state == State.Right) && !addInitialVelocity && Vector3.Dot(forwardVector, playerVelocity) < minWallRunSpeed)\n\t\t\t\t\treturn false;\n\t\t\t\tthis.Position.Value = closestVoxel.GetAbsolutePosition(closestCoord.Move(closestDir, closestDistance - 2)) + new Vector3(0, this.Height * 0.5f, 0);\n\t\t\t\tthis.setup(closestVoxel, closestDir, state, forwardVector, addInitialVelocity);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate void setup(Voxel voxel, Direction dir, State state, Vector3 forwardVector, bool addInitialVelocity, bool rotationAlreadyLocked = false)\n\t\t{\n\t\t\tthis.StopKick.Execute();\n\t\t\tthis.AllowUncrouch.Value = true;\n\n\t\t\tthis.WallRunVoxel.Value = this.LastWallRunMap.Value = voxel;\n\t\t\tthis.WallDirection.Value = this.LastWallDirection.Value = dir;\n\t\t\tthis.lastWallRunCoord = new Voxel.Coord { X = int.MinValue, Y = int.MinValue, Z = int.MinValue };\n\t\t\tthis.lastWallRunStart = this.Position;\n\n\t\t\tVector3 baseVelocity = voxel.LinearVelocity + Vector3.Cross(voxel.AngularVelocity, this.Position - voxel.Transform.Value.Translation);\n\t\t\tif (state == State.Straight)\n\t\t\t{\n\t\t\t\t// Determine if we're actually going down\n\t\t\t\tfloat threshold = addInitialVelocity ? -0.5f : 0.0f;\n\t\t\t\tif (!this.IsSupported && this.LinearVelocity.Value.Y - baseVelocity.Y < threshold)\n\t\t\t\t\tstate = State.Down;\n\t\t\t}\n\n\t\t\tthis.CurrentState.Value = state;\n\n\t\t\tSession.Recorder.Event(main, \"WallRun\", this.CurrentState.Value.ToString());\n\n\t\t\tthis.WallRunDirection.Value = state == State.Straight ? voxel.GetRelativeDirection(Vector3.Up) : (state == State.Down ? voxel.GetRelativeDirection(Vector3.Down) : dir.Cross(voxel.GetRelativeDirection(Vector3.Up)));\n\n\t\t\tif (state == State.Straight || state == State.Down)\n\t\t\t{\n\t\t\t\tif (state == State.Straight)\n\t\t\t\t{\n\t\t\t\t\tVector3 velocity = this.LinearVelocity.Value;\n\t\t\t\t\tvelocity.X = baseVelocity.X;\n\t\t\t\t\tvelocity.Z = baseVelocity.Z;\n\t\t\t\t\tif (addInitialVelocity)\n\t\t\t\t\t\tvelocity.Y = Math.Max(this.JumpSpeed * 1.3f, (this.LinearVelocity.Value.Y * 1.4f) + this.JumpSpeed * 0.5f);\n\t\t\t\t\telse\n\t\t\t\t\t\tvelocity.Y = this.LinearVelocity.Value.Y;\n\n\t\t\t\t\tthis.LinearVelocity.Value = velocity;\n\t\t\t\t\tthis.IsSupported.Value = false;\n\t\t\t\t\tthis.HasTraction.Value = false;\n\t\t\t\t}\n\t\t\t\tVector3 wallVector = this.WallRunVoxel.Value.GetAbsoluteVector(this.WallDirection.Value.GetVector());\n\n\t\t\t\t// Make sure we lock in the correct rotation value\n\t\t\t\tfloat rotation = (float)Math.Atan2(wallVector.X, wallVector.Z);\n\t\t\t\tif (rotationAlreadyLocked)\n\t\t\t\t\tthis.UpdateLockedRotation.Execute(rotation);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.Rotation.Value = rotation;\n\t\t\t\t\tthis.LockRotation.Execute();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.IsSupported.Value = false;\n\t\t\t\tthis.HasTraction.Value = false;\n\t\t\t\tVector3 velocity = voxel.GetAbsoluteVector(this.WallRunDirection.Value.GetVector());\n\t\t\t\tif (Vector3.Dot(velocity, forwardVector) < 0.0f)\n\t\t\t\t{\n\t\t\t\t\tvelocity = -velocity;\n\t\t\t\t\tthis.WallRunDirection.Value = this.WallRunDirection.Value.GetReverse();\n\t\t\t\t}\n\n\t\t\t\tfloat rotation = (float)Math.Atan2(velocity.X, velocity.Z);\n\t\t\t\tif (rotationAlreadyLocked)\n\t\t\t\t\tthis.UpdateLockedRotation.Execute(rotation);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.Rotation.Value = rotation;\n\t\t\t\t\tthis.LockRotation.Execute();\n\t\t\t\t}\n\n\t\t\t\tif (addInitialVelocity)\n\t\t\t\t{\n\t\t\t\t\tvelocity.Y = 0;\n\t\t\t\t\tfloat length = velocity.Length();\n\t\t\t\t\tif (length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvelocity /= length;\n\n\t\t\t\t\t\tVector3 currentHorizontalVelocity = this.LinearVelocity - baseVelocity;\n\t\t\t\t\t\tfloat currentVerticalSpeed = currentHorizontalVelocity.Y;\n\t\t\t\t\t\tcurrentHorizontalVelocity.Y = 0.0f;\n\t\t\t\t\t\tfloat horizontalSpeed = currentHorizontalVelocity.Length();\n\t\t\t\t\t\tvelocity *= Math.Min(this.MaxSpeed * 1.4f, Math.Max(horizontalSpeed * 1.1f, 6.0f));\n\n\t\t\t\t\t\tif (Vector3.Dot(velocity - baseVelocity, forwardVector) < minWallRunSpeed + 1.0f)\n\t\t\t\t\t\t\tvelocity += forwardVector * ((minWallRunSpeed + 2.0f) - Vector3.Dot(velocity - baseVelocity, forwardVector));\n\n\t\t\t\t\t\tvelocity += baseVelocity;\n\n\t\t\t\t\t\tvelocity.Y = (currentVerticalSpeed > -10.0f ? Math.Max(currentVerticalSpeed * 0.5f, 0.0f) + velocity.Length() * 0.6f : currentVerticalSpeed * 0.5f + 3.0f);\n\n\t\t\t\t\t\tthis.LinearVelocity.Value = velocity;\n\t\t\t\t\t\tthis.LastSupportedSpeed.Value = Vector3.Dot(velocity, forwardVector);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.CurrentState != State.Straight)\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_SLIDE_LOOP, this.Entity);\n\t\t}\n\n\t\tpublic void Deactivate()\n\t\t{\n\t\t\tif (this.CurrentState.Value != State.None)\n\t\t\t\tthis.lastWallRunEnded = main.TotalTime; // Prevent the player from repeatedly wall-running and wall-jumping ad infinitum.\n\n\t\t\tthis.WallRunVoxel.Value = null;\n\t\t\tthis.WallDirection.Value = Direction.None;\n\t\t\tthis.WallRunDirection.Value = Direction.None;\n\t\t\tthis.CurrentState.Value = State.None;\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.STOP_PLAYER_SLIDE_LOOP, this.Entity);\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.IsSupported)\n\t\t\t{\n\t\t\t\tthis.lastWallRunEnded = -1000.0f;\n\t\t\t\tthis.LastWallRunMap.Value = null;\n\t\t\t}\n\t\t\tState wallRunState = this.CurrentState;\n\t\t\tif (wallRunState != State.None)\n\t\t\t{\n\t\t\t\tthis.Vault.Execute(); // Try to vault up\n\t\t\t\tif (this.CurrentState.Value == State.None) // We vaulted\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!this.WallRunVoxel.Value.Active || this.IsSupported)\n\t\t\t\t{\n\t\t\t\t\tthis.Deactivate();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tVoxel voxel = this.WallRunVoxel.Value;\n\t\t\t\tif (voxel == null || !voxel.Active)\n\t\t\t\t{\n\t\t\t\t\tthis.Deactivate();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tVector3 wallRunVector = voxel.GetAbsoluteVector(this.WallRunDirection.Value.GetVector());\n\t\t\t\tVector3 baseVelocity = voxel.LinearVelocity + Vector3.Cross(voxel.AngularVelocity, this.Position - voxel.Transform.Value.Translation);\n\t\t\t\tfloat wallRunSpeed = Vector3.Dot(this.LinearVelocity.Value - baseVelocity, wallRunVector);\n\t\t\t\tVector3 pos = this.Position + new Vector3(0, this.Height * -0.5f, 0);\n\n\t\t\t\tif (wallRunState == State.Straight)\n\t\t\t\t{\n\t\t\t\t\tif (wallRunSpeed < 0.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Start sliding down\n\t\t\t\t\t\tthis.CurrentState.Value = wallRunState = State.Down;\n\t\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_PLAYER_SLIDE_LOOP, this.Entity);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (wallRunState == State.Left || wallRunState == State.Right)\n\t\t\t\t{\n\t\t\t\t\tif (this.IsSupported || wallRunSpeed < minWallRunSpeed)\n\t\t\t\t\t{\n\t\t\t\t\t\t// We landed on the ground or we're going too slow to continue wall-running\n\t\t\t\t\t\tthis.Deactivate();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// Check if we should switch to another wall\n\t\t\t\t\t\tVector3 wallVector = voxel.GetAbsoluteVector(this.WallDirection.Value.GetVector());\n\t\t\t\t\t\tVoxel.GlobalRaycastResult result = Voxel.GlobalRaycast(pos, wallRunVector + wallVector, 2.0f);\n\t\t\t\t\t\tif (result.Voxel != null && result.Voxel != voxel)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat dot = Vector3.Dot(result.Voxel.GetAbsoluteVector(result.Normal.GetReverse().GetVector()), wallVector);\n\t\t\t\t\t\t\tif (dot > 0.7f)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tMatrix matrix = Matrix.CreateRotationY(this.Rotation);\n\t\t\t\t\t\t\t\tVector3 forwardVector = -matrix.Forward;\n\t\t\t\t\t\t\t\tthis.setup(result.Voxel, result.Normal.GetReverse(), wallRunState, forwardVector, false, true);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tVoxel.Coord coord = voxel.GetCoordinate(pos);\n\t\t\t\tVoxel.Coord wallCoord = coord.Move(this.WallDirection, 2);\n\t\t\t\tVoxel.State wallType = voxel[wallCoord];\n\n\t\t\t\tif (!wallCoord.Equivalent(this.lastWallRunCoord))\n\t\t\t\t{\n\t\t\t\t\tthis.lastWallRunCoord = wallCoord;\n\t\t\t\t\tthis.WalkedOn.Execute(voxel, wallCoord, this.WallDirection);\n\t\t\t\t}\n\n\t\t\t\tif (this.EnableEnhancedWallRun\n\t\t\t\t\t&& (wallRunState == State.Left || wallRunState == State.Right)\n\t\t\t\t\t&& Zone.CanBuild(this.Position)\n\t\t\t\t\t&& voxel.Entity.Type != \"Bouncer\")\n\t\t\t\t{\n\t\t\t\t\tDirection up = voxel.GetRelativeDirection(Direction.PositiveY);\n\t\t\t\t\tif (up.IsPerpendicular(this.WallDirection))\n\t\t\t\t\t{\n\t\t\t\t\t\tDirection right = this.WallDirection.Value.Cross(up);\n\n\t\t\t\t\t\tList<EffectBlockFactory.BlockBuildOrder> buildCoords = new List<EffectBlockFactory.BlockBuildOrder>();\n\n\t\t\t\t\t\tconst int radius = 5;\n\t\t\t\t\t\tint upwardRadius = wallRunState == State.Down ? 0 : radius;\n\t\t\t\t\t\tfor (Voxel.Coord x = wallCoord.Move(right, -radius); x.GetComponent(right) < wallCoord.GetComponent(right) + radius; x = x.Move(right))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint dx = x.GetComponent(right) - wallCoord.GetComponent(right);\n\t\t\t\t\t\t\tfor (Voxel.Coord y = x.Move(up, -radius); y.GetComponent(up) < wallCoord.GetComponent(up) + upwardRadius; y = y.Move(up))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tint dy = y.GetComponent(up) - wallCoord.GetComponent(up);\n\t\t\t\t\t\t\t\tif ((float)Math.Sqrt(dx * dx + dy * dy) < radius && voxel[y].ID == 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbuildCoords.Add(new EffectBlockFactory.BlockBuildOrder\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tVoxel = voxel,\n\t\t\t\t\t\t\t\t\t\tCoordinate = y,\n\t\t\t\t\t\t\t\t\t\tState = Voxel.States.Blue,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tFactory.Get<EffectBlockFactory>().Build(main, buildCoords, this.Position);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Deactivate();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (wallType.ID == 0 && this.wallInstantiationTimer == 0.0f) // We ran out of wall to walk on\n\t\t\t\t{\n\t\t\t\t\tthis.Deactivate();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.wallInstantiationTimer = Math.Max(0.0f, this.wallInstantiationTimer - dt);\n\n\t\t\t\tVector3 coordPos = voxel.GetAbsolutePosition(coord);\n\n\t\t\t\tVector3 normal = voxel.GetAbsoluteVector(this.WallDirection.Value.GetVector());\n\t\t\t\t// Equation of a plane\n\t\t\t\t// normal (dot) point = d\n\t\t\t\tfloat d = Vector3.Dot(normal, coordPos) + (wallRunState == State.Down ? 0.3f : 0.4f);\n\n\t\t\t\t// Distance along the normal to keep the player glued to the wall\n\t\t\t\tfloat snapDistance = d - Vector3.Dot(pos, normal);\n\n\t\t\t\tthis.Position.Value += normal * snapDistance;\n\n\t\t\t\tVector3 velocity = this.LinearVelocity;\n\n\t\t\t\t// Also fix the velocity so we don't jitter away from the wall\n\t\t\t\tvelocity -= Vector3.Dot(velocity, normal) * normal;\n\n\t\t\t\t// Slow our descent\n\t\t\t\tvelocity += new Vector3(0, (wallRunState == State.Straight ? 3.0f : 10.0f) * dt, 0);\n\n\t\t\t\tthis.LinearVelocity.Value = velocity;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Program.cs",
    "content": "using System;\nusing ComponentBind;\nusing System.Linq;\nusing Microsoft.Xna.Framework;\nusing System.IO;\nusing System.Reflection;\nusing System.Diagnostics;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma\n{\n\t\n\tpublic static class Program\n\t{\n\t\t\n\t\t/// <summary>\n\t\t/// The main entry point for the application.\n\t\t/// </summary>\n\t    [STAThread]\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tSystem.Windows.Forms.Application.EnableVisualStyles();\n#if VR\n\t\t\tbool vr = args.Select(x => x.ToLower()).Contains(\"-vr\");\n#endif\n\n\t\t\tint monitor = 0;\n\t\t\tif (GraphicsAdapter.Adapters.Count > 1)\n\t\t\t{\n\t\t\t\tAdapterSelectorForm selectorForm = new AdapterSelectorForm(vr);\n\t\t\t\tSystem.Windows.Forms.Application.Run(selectorForm);\n\t\t\t\tif (!selectorForm.Go)\n\t\t\t\t\treturn;\n\n\t\t\t\tvr = selectorForm.VR;\n\t\t\t\tmonitor = selectorForm.Monitor;\n\t\t\t}\n\n\t\t\tMain main = null;\n\t\t\tif (Debugger.IsAttached)\n\t\t\t{\n#if VR\n\t\t\t\tmain = new Main(monitor, vr);\n#else\n\t\t\t\tmain = new Main(monitor);\n#endif\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tmain.Run();\n\t\t\t\t}\n\t\t\t\tcatch (Main.ExitException)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\tmain.Cleanup();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n#if VR\n\t\t\t\t\tmain = new Main(monitor, vr);\n#else\n\t\t\t\t\tmain = new Main(monitor);\n#endif\n\t\t\t\t\tmain.Run();\n\t\t\t\t}\n\t\t\t\tcatch (Main.ExitException)\n\t\t\t\t{\n#if ANALYTICS\n\t\t\t\t\tmain.SessionRecorder.RecordEvent(\"Exit\");\n\t\t\t\t\tif (!main.IsChallengeMap(main.MapFile) && main.MapFile.Value != Lemma.Main.MenuMap)\n\t\t\t\t\t\tmain.SaveAnalytics();\n#endif\n\t\t\t\t}\n#if !DEBUG\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tstring uuid = main != null ? (main.Settings != null ? main.Settings.UUID : null) : null;\n\t\t\t\t\tLemma.Main.Config.RecordAnalytics analytics = main != null ? (main.Settings != null ? main.Settings.Analytics : Lemma.Main.Config.RecordAnalytics.Off) : Lemma.Main.Config.RecordAnalytics.Off;\n\t\t\t\t\tErrorForm errorForm = new ErrorForm(e.ToString(), uuid, analytics == Lemma.Main.Config.RecordAnalytics.On);\n#if ANALYTICS\n\t\t\t\t\tif (main != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tmain.SessionRecorder.RecordEvent(\"Crash\", e.ToString());\n\t\t\t\t\t\tmain.SaveAnalytics();\n\t\t\t\t\t\terrorForm.Session = main.SessionRecorder;\n\t\t\t\t\t}\n#endif\n\t\t\t\t\tSystem.Windows.Forms.Application.Run(errorForm);\n\t\t\t\t}\n#endif\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\tif (main != null)\n\t\t\t\t\t\tmain.Cleanup();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Lemma\")]\n[assembly: AssemblyProduct(\"Lemma\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyCompany(\"\")]\n\n[assembly: AssemblyCopyright(\"Copyright © Evan Todd 2015\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"24e64adc-2ce9-41bf-926c-f3c2fe633840\")]\n\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "Lemma/README.txt",
    "content": "\nLEMMA\nhttps://helvetica-scenario.itch.io/lemma\n\nMinimum Requirements\n====================\n\n\tWindows Vista\n\tDirectX 10 graphics card\n\t2 GB RAM\n\t.NET Framework 4\t\thttp://www.microsoft.com/en-us/download/details.aspx?id=30653\n\tXNA Framework 4\t\t\thttp://www.microsoft.com/en-us/download/details.aspx?id=20914\n\nVR Instructions\n===============\n\nLemma only supports Oculus Rift in Extended Mode.\n\nIf you have a Rift plugged in and set to Extended Mode, or if you have multiple\nmonitors, Lemma will show a launcher that allows you to choose which display to\nuse. From there you can check the \"VR\" checkbox to enable VR mode.\n\nProblems?\n=========\n\n- Check the forums: http://steamcommunity.com/app/300340/discussions/\n\n- Contact evan@etodd.io"
  },
  {
    "path": "Lemma/Screenshot.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma\n{\n\tpublic class Screenshot : Component<Main>, IUpdateableComponent\n\t{\n\t\tpublic RenderTarget2D Buffer = null;\n\t\tpublic Point Size { get; private set; }\n\n\t\tpublic void Clear()\n\t\t{\n\t\t\tif (this.Buffer != null)\n\t\t\t\tthis.Buffer.Dispose();\n\t\t\tthis.Buffer = null;\n\t\t\tthis.Size = Point.Zero;\n\t\t}\n\n\t\tprivate Action callback;\n\t\tprivate bool take;\n\t\tprivate Point originalScreenSize;\n\n\t\tpublic void Take(Point size, Action callback = null)\n\t\t{\n\t\t\tif (size.X > 0 && size.Y > 0)\n\t\t\t{\n\t\t\t\tthis.Size = size;\n\t\t\t\tthis.originalScreenSize = this.main.ScreenSize;\n\n\t\t\t\tif (\n#if VR\n\t\t\t\t!this.main.VR &&\n#endif\n\t\t\t\t(this.Size.X > this.originalScreenSize.X || this.Size.Y > this.originalScreenSize.Y))\n\t\t\t\t{\n\t\t\t\t\tthis.main.Renderer.ReallocateBuffers(size);\n\t\t\t\t\tthis.main.ScreenSize.Value = size;\n\t\t\t\t}\n\t\t\t\tthis.Buffer = new RenderTarget2D(this.main.GraphicsDevice, size.X, size.Y, false, SurfaceFormat.Color, DepthFormat.Depth16);\n\t\t\t\tthis.main.RenderTarget = this.Buffer;\n\t\t\t\tthis.take = true;\n\t\t\t\tthis.callback = callback;\n\t\t\t}\n\t\t\telse if (callback != null)\n\t\t\t\tcallback();\n\t\t}\n\n\t\tpublic void Update(float dt)\n\t\t{\n\t\t\tif (this.take)\n\t\t\t{\n\t\t\t\tthis.main.RenderTarget = null;\n\n\t\t\t\tif (\n#if VR\n\t\t\t\t!this.main.VR &&\n#endif\n\t\t\t\t(this.Size.X > this.originalScreenSize.X || this.Size.Y > this.originalScreenSize.Y))\n\t\t\t\t{\n\t\t\t\t\tthis.main.Renderer.ReallocateBuffers(this.originalScreenSize);\n\t\t\t\t\tthis.main.ScreenSize.Value = this.originalScreenSize;\n\t\t\t\t}\n\n\t\t\t\tif (this.callback != null)\n\t\t\t\t\tthis.callback();\n\t\t\t\tthis.callback = null;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tthis.Clear();\n\t\t}\n\n\t\tpublic static void SavePng(RenderTarget2D t, string path, int width = 0, int height = 0)\n\t\t{\n\t\t\tif (width == 0)\n\t\t\t\twidth = t.Width;\n\t\t\tif (height == 0)\n\t\t\t\theight = t.Height;\n\n\t\t\tbyte[] imageData = new byte[4 * t.Width * t.Height];\n\t\t\tt.GetData<byte>(imageData);\n\t\t\t// Flip R and B.\n\t\t\tfor (int i = 0; i < imageData.Length; i+= 4)\n\t\t\t{\n\t\t\t\tbyte tmp = imageData[i];\n\t\t\t\timageData[i] = imageData[i + 2];\n\t\t\t\timageData[i + 2] = tmp;\n\t\t\t}\n\n\t\t\tusing (System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(t.Width, t.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb))\n\t\t\t{\n\t\t\t\tSystem.Drawing.Imaging.BitmapData bmData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, t.Width, t.Height), System.Drawing.Imaging.ImageLockMode.ReadWrite, bitmap.PixelFormat);\n\t\t\t\tIntPtr pnative = bmData.Scan0;\n\t\t\t\tSystem.Runtime.InteropServices.Marshal.Copy(imageData, 0, pnative, 4 * t.Width * t.Height);\n\t\t\t\tbitmap.UnlockBits(bmData);\n\t\t\t\tif (width != t.Width || height != t.Height)\n\t\t\t\t{\n\t\t\t\t\tusing (System.Drawing.Bitmap resized = new System.Drawing.Bitmap(bitmap, width, height))\n\t\t\t\t\t\tresized.Save(path, System.Drawing.Imaging.ImageFormat.Png);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tbitmap.Save(path, System.Drawing.Imaging.ImageFormat.Png);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Scripts/Abilities.cs",
    "content": "using System;\nusing ComponentBind;\nusing Lemma.GameScripts;\nusing Microsoft.Xna.Framework;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Util;\nusing Lemma.Components;\nusing Lemma.Factories;\n\nnamespace Lemma.GameScripts\n{\n\tpublic class Abilities : ScriptBase\n\t{\n\t\tpublic static void Run(Entity script)\n\t\t{\n\t\t\tPlayerData playerData = PlayerDataFactory.Instance.Get<PlayerData>();\n\n\t\t\tscript.Add(new TwoWayBinding<bool>(property<bool>(script, \"Roll\"), playerData.EnableRoll));\n\t\t\tscript.Add(new TwoWayBinding<bool>(property<bool>(script, \"Crouch\"), playerData.EnableCrouch));\n\t\t\tscript.Add(new TwoWayBinding<bool>(property<bool>(script, \"Kick\"), playerData.EnableKick));\n\t\t\tscript.Add(new TwoWayBinding<bool>(property<bool>(script, \"WallRun\"), playerData.EnableWallRun));\n\t\t\tscript.Add(new TwoWayBinding<bool>(property<bool>(script, \"WallRunHorizontal\"), playerData.EnableWallRunHorizontal));\n\t\t\tscript.Add(new TwoWayBinding<bool>(property<bool>(script, \"EnhancedWallRun\"), playerData.EnableEnhancedWallRun));\n\t\t\tscript.Add(new TwoWayBinding<bool>(property<bool>(script, \"Moves\"), playerData.EnableMoves));\n\t\t\tscript.Add(new TwoWayBinding<bool>(property<bool>(script, \"SlowMotion\"), playerData.EnableSlowMotion));\n\t\t\tscript.Add(new TwoWayBinding<bool>(property<bool>(script, \"Phone\"), PlayerDataFactory.Instance.Get<Phone>().Enabled));\n\t\t}\n\n\t\tpublic static IEnumerable<string> EditorProperties(Entity script)\n\t\t{\n\t\t\tscript.Add(\"Roll\", property<bool>(script, \"Roll\"));\n\t\t\tscript.Add(\"Crouch\", property<bool>(script, \"Crouch\"));\n\t\t\tscript.Add(\"Kick\", property<bool>(script, \"Kick\"));\n\t\t\tscript.Add(\"WallRun\", property<bool>(script, \"WallRun\"));\n\t\t\tscript.Add(\"WallRunHorizontal\", property<bool>(script, \"WallRunHorizontal\"));\n\t\t\tscript.Add(\"EnhancedWallRun\", property<bool>(script, \"EnhancedWallRun\"));\n\t\t\tscript.Add(\"Moves\", property<bool>(script, \"Moves\"));\n\t\t\tscript.Add(\"Phone\", property<bool>(script, \"Phone\"));\n\t\t\tscript.Add(\"SlowMotion\", property<bool>(script, \"SlowMotion\"));\n\t\t\treturn new string[]\n\t\t\t{\n\t\t\t\t\"Roll\",\n\t\t\t\t\"Crouch\",\n\t\t\t\t\"Kick\",\n\t\t\t\t\"WallRun\",\n\t\t\t\t\"WallRunHorizontal\",\n\t\t\t\t\"EnhancedWallRun\",\n\t\t\t\t\"Moves\",\n\t\t\t\t\"Phone\",\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Scripts/DialogueLink.cs",
    "content": "using System;\nusing ComponentBind;\nusing Lemma.GameScripts;\nusing Microsoft.Xna.Framework;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Util;\nusing Lemma.Components;\nusing Lemma.Factories;\n\nnamespace Lemma.GameScripts\n{\n\tpublic class DialogueLink : ScriptBase\n\t{\n\t\tpublic static new bool AvailableInReleaseEditor = true;\n\t\tpublic static void Run(Entity script)\n\t\t{\n\t\t\tProperty<string> lastNode = property<string>(script, \"LastNode\");\n\t\t\tProperty<string> nextNode = property<string>(script, \"NextNode\");\n\n\t\t\tPhone phone = PlayerDataFactory.Instance.Get<Phone>();\n\t\t\tscript.Add(new CommandBinding(phone.OnVisit(lastNode), new Command\n\t\t\t{\n\t\t\t\tAction = delegate()\n\t\t\t\t{\n\t\t\t\t\tDialogueForest forest = WorldFactory.Instance.Get<World>().DialogueForest;\n\t\t\t\t\tDialogueForest.Node n = forest.GetByName(nextNode);\n\t\t\t\t\tphone.Execute(n);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tpublic static IEnumerable<string> EditorProperties(Entity script)\n\t\t{\n\t\t\tscript.Add(\"LastNode\", property<string>(script, \"LastNode\"));\n\t\t\tscript.Add(\"NextNode\", property<string>(script, \"NextNode\"));\n\t\t\treturn new string[]\n\t\t\t{\n\t\t\t\t\"LastNode\",\n\t\t\t\t\"NextNode\",\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Scripts/DialogueTrigger.cs",
    "content": "using System;\nusing ComponentBind;\nusing Lemma.GameScripts;\nusing Microsoft.Xna.Framework;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Util;\nusing Lemma.Components;\nusing Lemma.Factories;\n\nnamespace Lemma.GameScripts\n{\n\tpublic class DialogueTrigger : ScriptBase\n\t{\n\t\tpublic static new bool AvailableInReleaseEditor = true;\n\t\tpublic static void Run(Entity script)\n\t\t{\n\t\t\tProperty<string> node = property<string>(script, \"Node\");\n\t\t\tCommand trigger = command(script, \"Trigger\");\n\n\t\t\tPhone phone = PlayerDataFactory.Instance.Get<Phone>();\n\t\t\tif (!string.IsNullOrEmpty(node))\n\t\t\t\tscript.Add(new CommandBinding(phone.OnVisit(node), trigger));\n\t\t}\n\n\t\tpublic static IEnumerable<string> EditorProperties(Entity script)\n\t\t{\n\t\t\tscript.Add(\"Node\", property<string>(script, \"Node\"));\n\t\t\treturn new string[]\n\t\t\t{\n\t\t\t\t\"Node\",\n\t\t\t};\n\t\t}\n\n\t\tpublic static IEnumerable<string> Commands(Entity script)\n\t\t{\n\t\t\tscript.Add(\"Trigger\", command(script, \"Trigger\"));\n\t\t\treturn new string[]\n\t\t\t{\n\t\t\t\t\"Trigger\",\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Scripts/RiftSpawner.cs",
    "content": "using System;\nusing ComponentBind;\nusing Lemma.GameScripts;\nusing Microsoft.Xna.Framework;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Util;\nusing Lemma.Components;\nusing Lemma.Factories;\n\nnamespace Lemma.GameScripts\n{\n\tpublic class RiftSpawner : ScriptBase\n\t{\n\t\tpublic static new bool AvailableInReleaseEditor = true;\n\t\tprivate static Random random = new Random();\n\t\tpublic static void Run(Entity script)\n\t\t{\n\t\t\tUpdater updater = script.Create<Updater>();\n\t\t\tCommand enable = command(script, \"Enable\");\n\t\t\tCommand disable = command(script, \"Disable\");\n\t\t\tProperty<bool> enabled = property<bool>(script, \"Enabled\");\n\t\t\tupdater.Add(new Binding<bool>(updater.Enabled, enabled));\n\n\t\t\tscript.Add(new CommandBinding(enable, () => !enabled, delegate()\n\t\t\t{\n\t\t\t\tenabled.Value = true;\n\t\t\t}));\n\n\t\t\tscript.Add(new CommandBinding(disable, () => enabled, delegate()\n\t\t\t{\n\t\t\t\tenabled.Value = false;\n\t\t\t}));\n\n\t\t\tAmbientSound sound = script.Create<AmbientSound>();\n\t\t\tsound.PlayCue.Value = AK.EVENTS.PLAY_MONOLITH_LOOP;\n\t\t\tsound.StopCue.Value = AK.EVENTS.STOP_ALL_OBJECT;\n\t\t\tsound.Add(new Binding<bool>(sound.Enabled, enabled));\n\n\t\t\tscript.Add(new Binding<float, bool>(WorldFactory.Instance.Get<World>().CameraShakeAmount, x => x ? 0.02f : 0.0f, enabled));\n\n\t\t\tscript.Add(new ChangeBinding<bool>(enabled, delegate(bool old, bool value)\n\t\t\t{\n\t\t\t\tif (!old && value)\n\t\t\t\t\tenable.Execute();\n\t\t\t\telse if (old && !value)\n\t\t\t\t\tdisable.Execute();\n\t\t\t}));\n\n\t\t\tRiftFactory riftFactory = Factory.Get<RiftFactory>();\n\t\t\tconst float minInterval = 3.0f;\n\t\t\tconst float maxInterval = 8.0f;\n\t\t\tfloat interval = minInterval + (float)random.NextDouble() * (maxInterval - minInterval);\n\t\t\tupdater.Action = delegate(float dt)\n\t\t\t{\n\t\t\t\tEntity player = PlayerFactory.Instance;\n\t\t\t\tif (player != null)\n\t\t\t\t{\n\t\t\t\t\tinterval -= dt;\n\t\t\t\t\tif (interval < 0.0f)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector3 pos = player.Get<Transform>().Position;\n\t\t\t\t\t\tVector3 dir = Vector3.Normalize(new Vector3((float)random.NextDouble() * 2.0f - 1.0f, (float)random.NextDouble() * 2.0f - 1.0f, (float)random.NextDouble() * 2.0f - 1.0f));\n\t\t\t\t\t\tVoxel.GlobalRaycastResult hit = default(Voxel.GlobalRaycastResult);\n\t\t\t\t\t\tint radius = random.Next(4, 10);\n\t\t\t\t\t\tint tries = 30;\n\t\t\t\t\t\tbool success = false;\n\t\t\t\t\t\twhile (tries > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thit = Voxel.GlobalRaycast(pos, dir, 50.0f);\n\n\t\t\t\t\t\t\tif (hit.Voxel != null\n\t\t\t\t\t\t\t\t&& hit.Distance > radius\n\t\t\t\t\t\t\t\t&& Rift.Query(hit.Position) == null\n\t\t\t\t\t\t\t\t&& Zone.CanSpawnRift(hit.Position)\n\t\t\t\t\t\t\t\t&& MapExit.Query(hit.Position, 5 + radius) == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsuccess = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttries--;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (success)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tEntity rift = riftFactory.CreateAndBind(main);\n\t\t\t\t\t\t\trift.Get<Transform>().Position.Value = hit.Position;\n\t\t\t\t\t\t\tVoxelAttachable attachment = rift.Get<VoxelAttachable>();\n\t\t\t\t\t\t\tattachment.AttachedVoxel.Value = hit.Voxel.Entity;\n\t\t\t\t\t\t\tattachment.Coord.Value = hit.Coordinate.Value;\n\t\t\t\t\t\t\tRift riftComponent = rift.Get<Rift>();\n\t\t\t\t\t\t\triftComponent.Radius.Value = radius;\n\t\t\t\t\t\t\tmain.Add(rift);\n\t\t\t\t\t\t\triftComponent.Enabled.Value = true;\n\t\t\t\t\t\t\tinterval = minInterval + (float)random.NextDouble() * (maxInterval - minInterval);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tscript.Add(updater);\n\t\t}\n\n\t\tpublic static IEnumerable<string> EditorProperties(Entity script)\n\t\t{\n\t\t\tscript.Add(\"Enabled\", property<bool>(script, \"Enabled\"));\n\t\t\treturn new string[]\n\t\t\t{\n\t\t\t\t\"Enabled\",\n\t\t\t};\n\t\t}\n\n\t\tpublic static IEnumerable<string> Commands(Entity script)\n\t\t{\n\t\t\tscript.Add(\"Enable\", command(script, \"Enable\"));\n\t\t\tscript.Add(\"Disable\", command(script, \"Disable\"));\n\t\t\treturn new string[]\n\t\t\t{\n\t\t\t\t\"Enable\",\n\t\t\t\t\"Disable\",\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Scripts/SetPhoto.cs",
    "content": "using System;\nusing ComponentBind;\nusing Lemma.GameScripts;\nusing Microsoft.Xna.Framework;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Util;\nusing Lemma.Components;\nusing Lemma.Factories;\nusing Lemma.GInterfaces;\n\nnamespace Lemma.GameScripts\n{\n\tpublic class SetPhoto : ScriptBase\n\t{\n\t\tpublic static new bool AvailableInReleaseEditor = true;\n\t\tpublic static void Run(Entity script)\n\t\t{\n\t\t\tPhone phone = PlayerDataFactory.Instance.Get<Phone>();\n\t\t\tphone.Photo.Value = property<string>(script, \"Photo\");\n\t\t\tphone.CurrentMode.Value = Phone.Mode.Photos;\n\t\t\tphone.Show.Execute();\n\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_CAMERA_SHUTTER, PlayerFactory.Instance);\n\t\t}\n\n\t\tpublic static IEnumerable<string> EditorProperties(Entity script)\n\t\t{\n\t\t\tscript.Add(\"Photo\", property<string>(script, \"Photo\"), new PropertyEntry.EditorData\n\t\t\t{\n\t\t\t\tOptions = FileFilter.Get(main, main.Content.RootDirectory, new[] { \"Images\", \"Game\\\\Images\" }),\n\t\t\t});\n\t\t\treturn new[] { \"Photo\" };\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Strings.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing Excel;\nusing Lemma.Components;\n\nnamespace Lemma\n{\n\tpublic class Strings\n\t{\n\t\tprivate Dictionary<string, Dictionary<string, string>> data = new Dictionary<string,Dictionary<string, string>>();\n\n\t\tpublic Property<string> Language = new Property<string> { Value = \"en\" };\n\t\t\n\t\tpublic void Load(string filename)\n\t\t{\n\t\t\tusing (Stream stream = new FileStream(filename, FileMode.Open, FileAccess.Read))\n\t\t\t{\n\t\t\t\tIExcelDataReader reader = ExcelReaderFactory.CreateOpenXmlReader(stream);\n\t\t\t\treader.IsFirstRowAsColumnNames = true;\n\n\t\t\t\treader.Read(); // Read first row\n\n\t\t\t\t// Initialize languages\n\t\t\t\tDictionary<string, Dictionary<string, string>> languages = new Dictionary<string, Dictionary<string, string>>();\n\t\t\t\tList<Dictionary<string, string>> languageList = new List<Dictionary<string,string>>();\n\t\t\t\tfor (int i = 1; i < reader.FieldCount; i++)\n\t\t\t\t{\n\t\t\t\t\tstring language = reader.GetString(i);\n\t\t\t\t\tDictionary<string, string> dict;\n\t\t\t\t\tif (!this.data.TryGetValue(language, out dict))\n\t\t\t\t\t{\n\t\t\t\t\t\tdict = new Dictionary<string, string>();\n\t\t\t\t\t\tthis.data[language] = dict;\n\t\t\t\t\t}\n\t\t\t\t\tlanguageList.Add(dict);\n\t\t\t\t}\n\n\t\t\t\twhile (reader.Read())\n\t\t\t\t{\n\t\t\t\t\tstring key = reader.GetString(0);\n\t\t\t\t\tif (!string.IsNullOrEmpty(key))\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int i = 0; i < Math.Min(languageList.Count, reader.FieldCount); i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlanguageList[i].Add(key, reader.GetString(i + 1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (ArgumentException e)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthrow new Exception(string.Format(\"Duplicate localization key: \\\"{0}\\\"\", key), e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic string Get(string key)\n\t\t{\n\t\t\tDictionary<string, string> language;\n\t\t\tif (!this.data.TryGetValue(this.Language, out language))\n\t\t\t\treturn null;\n\n\t\t\tstring result;\n\t\t\tlanguage.TryGetValue(key, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic bool HasKey(string key)\n\t\t{\n\t\t\tif (key == null)\n\t\t\t\treturn false;\n\n\t\t\tDictionary<string, string> language;\n\t\t\tif (!this.data.TryGetValue(this.Language, out language))\n\t\t\t\treturn false;\n\n\t\t\tstring result;\n\t\t\treturn language.TryGetValue(key, out result);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/UI/Container.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma.Components\n{\n\tpublic class Container : UIComponent\n\t{\n\t\tpublic Property<float> PaddingLeft = new Property<float> { Value = 4.0f };\n\t\tpublic Property<float> PaddingRight = new Property<float> { Value = 4.0f };\n\t\tpublic Property<float> PaddingBottom = new Property<float> { Value = 4.0f };\n\t\tpublic Property<float> PaddingTop = new Property<float> { Value = 4.0f };\n\t\tpublic Property<Color> Tint = new Property<Color> { Value = new Color(255, 255, 255, 255) };\n\t\tpublic Property<float> Opacity = new Property<float> { Value = 1.0f };\n\t\tpublic Property<bool> ResizeHorizontal = new Property<bool> { Value = true };\n\t\tpublic Property<bool> ResizeVertical = new Property<bool> { Value = true };\n\n\t\tprivate static Texture2D texture;\n\t\tprivate NotifyBinding binding;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new ListNotifyBinding<UIComponent>(this.childrenChanged, this.Children));\n\t\t\tthis.Add(new NotifyBinding(this.childrenChanged, this.ResizeHorizontal, this.ResizeVertical, this.PaddingLeft, this.PaddingRight, this.PaddingBottom, this.PaddingTop));\n\t\t\tthis.childrenChanged();\n\t\t}\n\n\t\tprivate void childrenChanged()\n\t\t{\n\t\t\tif (this.binding != null)\n\t\t\t{\n\t\t\t\tthis.Remove(this.binding);\n\t\t\t\tthis.binding = null;\n\t\t\t}\n\t\t\tthis.layoutDirty = true;\n\t\t}\n\n\t\tprotected override void updateLayout()\n\t\t{\n\t\t\tif (!this.ResizeHorizontal && !this.ResizeVertical)\n\t\t\t\treturn;\n\n\t\t\tif (this.binding == null)\n\t\t\t{\n\t\t\t\tthis.binding = new NotifyBinding(delegate() { this.layoutDirty = true; }, this.Children.SelectMany(x => new IProperty[] { x.ScaledSize, x.Visible }).ToArray());\n\t\t\t\tthis.Add(this.binding);\n\t\t\t}\n\n\t\t\tVector2 size = new Vector2(this.PaddingLeft, this.PaddingTop);\n\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t{\n\t\t\t\tUIComponent child = this.Children[i];\n\t\t\t\tVector2 childPos = child.Position;\n\t\t\t\tVector2 min = childPos - (child.AnchorPoint.Value * child.Size.Value);\n\t\t\t\tchildPos.X += Math.Max(0, this.PaddingLeft - min.X);\n\t\t\t\tchildPos.Y += Math.Max(0, this.PaddingTop - min.Y);\n\t\t\t\tchild.Position.Value = childPos;\n\t\t\t\tif (child.Visible)\n\t\t\t\t{\n\t\t\t\t\tVector2 max = childPos + (child.InverseAnchorPoint.Value * child.Size.Value);\n\t\t\t\t\tsize.X = Math.Max(size.X, max.X);\n\t\t\t\t\tsize.Y = Math.Max(size.Y, max.Y);\n\t\t\t\t}\n\t\t\t}\n\t\t\tVector2 originalSize = this.Size;\n\t\t\tsize.X = this.ResizeHorizontal ? size.X + this.PaddingRight : originalSize.X;\n\t\t\tsize.Y = this.ResizeVertical ? size.Y + this.PaddingBottom : originalSize.Y;\n\t\t\tthis.Size.Value = size;\n\t\t}\n\n\t\tpublic override void LoadContent(bool reload)\n\t\t{\n\t\t\tbase.LoadContent(reload);\n\t\t\tif (Container.texture == null || Container.texture.IsDisposed || Container.texture.GraphicsDevice != this.main.GraphicsDevice)\n\t\t\t{\n\t\t\t\tContainer.texture = new Texture2D(this.main.GraphicsDevice, 1, 1);\n\t\t\t\tContainer.texture.SetData(new[] { Color.White });\n\t\t\t}\n\t\t}\n\n\t\tprotected override void draw(GameTime time, Matrix parent, Matrix transform)\n\t\t{\n\t\t\tif (this.Opacity > 0.0f)\n\t\t\t{\n\t\t\t\tVector2 position = Vector2.Transform(this.Position, parent);\n\t\t\t\tfloat rotation = this.Rotation + (float)Math.Atan2(parent.M12, parent.M11);\n\t\t\t\tVector2 scale = this.Scale;\n\t\t\t\tscale.X *= (float)Math.Sqrt((parent.M11 * parent.M11) + (parent.M12 * parent.M12));\n\t\t\t\tscale.Y *= (float)Math.Sqrt((parent.M21 * parent.M21) + (parent.M22 * parent.M22));\n\n\t\t\t\tRectangle rect = this.Rectangle;\n\t\t\t\trect.Width = (int)Math.Round((float)rect.Width * scale.X);\n\t\t\t\trect.Height = (int)Math.Round((float)rect.Height * scale.Y);\n\t\t\t\trect.Offset((int)Math.Round(position.X), (int)Math.Round(position.Y));\n\n\t\t\t\tthis.renderer.Batch.Draw(Container.texture, rect, null, this.Tint.Value * this.Opacity.Value, rotation, this.AnchorPoint, SpriteEffects.None, this.DrawOrder);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/UI/LineDrawer2D.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Components\n{\n\tpublic class LineDrawer2D : UIComponent\n\t{\n\t\tpublic struct Line\n\t\t{\n\t\t\tpublic VertexPositionColor A;\n\t\t\tpublic VertexPositionColor B;\n\t\t}\n\n\t\t[XmlIgnore]\n\t\tpublic ListProperty<Line> Lines = new ListProperty<Line>();\n\n\t\tpublic Property<Vector4> Color = new Property<Vector4> { Value = Vector4.One };\n\n\t\tprivate Effect effect;\n\n\t\tprivate bool changed;\n\n\t\tprivate DynamicVertexBuffer vertexBuffer;\n\n\t\tpublic override void LoadContent(bool reload)\n\t\t{\n\t\t\tthis.effect = this.main.Content.Load<Effect>(\"Effects\\\\Lines2D\").Clone();\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.requiresNewBatch = true;\n\t\t\tthis.Add(new ListNotifyBinding<Line>(delegate() { this.changed = true; }, this.Lines));\n\t\t}\n\n\t\tprotected override void draw(GameTime time, Matrix parent, Matrix transform)\n\t\t{\n\t\t\tif (this.Lines.Length == 0)\n\t\t\t\treturn;\n\n\t\t\tif (this.vertexBuffer == null || this.vertexBuffer.IsContentLost || this.Lines.Length * 2 > this.vertexBuffer.VertexCount || this.changed)\n\t\t\t{\n\t\t\t\tthis.changed = false;\n\t\t\t\tif (this.vertexBuffer != null)\n\t\t\t\t\tthis.vertexBuffer.Dispose();\n\n\t\t\t\tthis.vertexBuffer = new DynamicVertexBuffer(this.main.GraphicsDevice, VertexPositionColor.VertexDeclaration, (this.Lines.Length * 2) + 8, BufferUsage.WriteOnly);\n\n\t\t\t\tVertexPositionColor[] data = new VertexPositionColor[this.vertexBuffer.VertexCount];\n\t\t\t\tint i = 0;\n\t\t\t\tforeach (Line line in this.Lines)\n\t\t\t\t{\n\t\t\t\t\tdata[i] = line.A;\n\t\t\t\t\tdata[i + 1] = line.B;\n\t\t\t\t\ti += 2;\n\t\t\t\t}\n\t\t\t\tthis.vertexBuffer.SetData<VertexPositionColor>(data, 0, this.Lines.Length * 2, SetDataOptions.Discard);\n\t\t\t}\n\n\t\t\tViewport viewport = this.main.GraphicsDevice.Viewport;\n\t\t\tfloat inverseWidth = (viewport.Width > 0) ? (1f / (float)viewport.Width) : 0f;\n\t\t\tfloat inverseHeight = (viewport.Height > 0) ? (-1f / (float)viewport.Height) : 0f;\n\t\t\tMatrix projection = default(Matrix);\n\t\t\tprojection.M11 = inverseWidth * 2f;\n\t\t\tprojection.M22 = inverseHeight * 2f;\n\t\t\tprojection.M33 = 1f;\n\t\t\tprojection.M44 = 1f;\n\t\t\tprojection.M41 = -1f;\n\t\t\tprojection.M42 = 1f;\n\t\t\tprojection.M41 -= inverseWidth;\n\t\t\tprojection.M42 -= inverseHeight;\n\n\t\t\tthis.effect.Parameters[\"Color\"].SetValue(this.Color);\n\t\t\tthis.effect.Parameters[\"Transform\"].SetValue(transform * projection);\n\n\t\t\tthis.effect.CurrentTechnique.Passes[0].Apply();\n\t\t\tthis.main.GraphicsDevice.SetVertexBuffer(this.vertexBuffer);\n\t\t\tthis.main.GraphicsDevice.DrawPrimitives(PrimitiveType.LineList, 0, this.Lines.Length);\n\t\t\tModel.DrawCallCounter++;\n\t\t\tModel.TriangleCounter += this.Lines.Length;\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tthis.effect.Dispose();\n\t\t\tif (this.vertexBuffer != null)\n\t\t\t\tthis.vertexBuffer.Dispose();\n\t\t\tbase.delete();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/UI/ListContainer.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class ListContainer : UIComponent\n\t{\n\t\tpublic enum ListOrientation\n\t\t{\n\t\t\tVertical, Horizontal\n\t\t}\n\n\t\tpublic enum ListAlignment\n\t\t{\n\t\t\tMin, Middle, Max\n\t\t}\n\n\t\tpublic Property<ListOrientation> Orientation = new Property<ListOrientation> { Value = ListOrientation.Vertical };\n\t\tpublic Property<ListAlignment> Alignment = new Property<ListAlignment> { Value = ListAlignment.Min };\n\t\tpublic Property<bool> ResizePerpendicular = new Property<bool> { Value = true };\n\t\tpublic Property<bool> Reversed = new Property<bool> { Value = false };\n\t\tpublic Property<float> Spacing = new Property<float> { Value = 2.0f };\n\t\tprivate NotifyBinding binding;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new ListNotifyBinding<UIComponent>(this.childrenChanged, this.Children));\n\t\t\tthis.Add(new NotifyBinding(delegate() { this.layoutDirty = true; }, this.Orientation, this.Spacing, this.ResizePerpendicular));\n\t\t\tthis.childrenChanged();\n\t\t}\n\n\t\tprivate void childrenChanged()\n\t\t{\n\t\t\tif (this.binding != null)\n\t\t\t\tthis.Remove(this.binding);\n\t\t\tthis.binding = null;\n\t\t\tthis.layoutDirty = true;\n\t\t}\n\n\t\tprotected override void updateLayout()\n\t\t{\n\t\t\tif (this.binding == null)\n\t\t\t{\n\t\t\t\tthis.binding = new NotifyBinding(delegate() { this.layoutDirty = true; }, this.Children.SelectMany(x => new IProperty[] { x.ScaledSize, x.Visible }).ToArray());\n\t\t\t\tthis.Add(this.binding);\n\t\t\t}\n\n\t\t\tfloat spacing = this.Spacing;\n\n\t\t\tVector2 maxSize = Vector2.Zero;\n\t\t\tif (this.ResizePerpendicular)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tUIComponent child = this.Children[i];\n\t\t\t\t\tif (child.Visible)\n\t\t\t\t\t{\n\t\t\t\t\t\tVector2 size = child.ScaledSize;\n\t\t\t\t\t\tmaxSize.X = Math.Max(maxSize.X, size.X);\n\t\t\t\t\t\tmaxSize.Y = Math.Max(maxSize.Y, size.Y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tmaxSize = this.Size;\n\n\t\t\tif (this.Orientation.Value == ListOrientation.Horizontal)\n\t\t\t{\n\t\t\t\tVector2 anchorPoint;\n\t\t\t\tswitch (this.Alignment.Value)\n\t\t\t\t{\n\t\t\t\t\tcase ListAlignment.Min:\n\t\t\t\t\t\tanchorPoint = Vector2.Zero;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ListAlignment.Middle:\n\t\t\t\t\t\tanchorPoint = new Vector2(0, 0.5f);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ListAlignment.Max:\n\t\t\t\t\t\tanchorPoint = new Vector2(0, 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tanchorPoint = Vector2.Zero;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tVector2 pos = new Vector2(0, maxSize.Y * anchorPoint.Y);\n\t\t\t\tforeach (UIComponent child in this.Reversed ? this.Children.Reverse() : this.Children)\n\t\t\t\t{\n\t\t\t\t\tchild.AnchorPoint.Value = anchorPoint;\n\t\t\t\t\tchild.Position.Value = pos;\n\t\t\t\t\tif (child.Visible)\n\t\t\t\t\t\tpos.X += child.ScaledSize.Value.X + spacing;\n\t\t\t\t}\n\t\t\t\tthis.Size.Value = new Vector2(Math.Max(0, pos.X - spacing), maxSize.Y);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tVector2 anchorPoint;\n\t\t\t\tswitch (this.Alignment.Value)\n\t\t\t\t{\n\t\t\t\t\tcase ListAlignment.Min:\n\t\t\t\t\t\tanchorPoint = Vector2.Zero;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ListAlignment.Middle:\n\t\t\t\t\t\tanchorPoint = new Vector2(0.5f, 0);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ListAlignment.Max:\n\t\t\t\t\t\tanchorPoint = new Vector2(1, 0);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tanchorPoint = Vector2.Zero;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tVector2 pos = new Vector2(maxSize.X * anchorPoint.X, 0);\n\t\t\t\tforeach (UIComponent child in this.Reversed ? this.Children.Reverse() : this.Children)\n\t\t\t\t{\n\t\t\t\t\tchild.AnchorPoint.Value = anchorPoint;\n\t\t\t\t\tchild.Position.Value = pos;\n\t\t\t\t\tif (child.Visible)\n\t\t\t\t\t\tpos.Y += child.ScaledSize.Value.Y + spacing;\n\t\t\t\t}\n\t\t\t\tthis.Size.Value = new Vector2(maxSize.X, Math.Max(0, pos.Y - spacing));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/UI/Scroller.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Input;\n\nnamespace Lemma.Components\n{\n\tpublic class Scroller : UIComponent\n\t{\n\t\tpublic Property<float> ScrollAmount = new Property<float> { Value = 30.0f };\n\n\t\tpublic Property<bool> EnableScroll = new Property<bool> { Value = true };\n\n\t\tpublic Property<bool> DefaultScrollHorizontal = new Property<bool>();\n\n\t\tpublic Property<bool> ResizeHorizontal = new Property<bool>();\n\n\t\tpublic Property<float> MaxHorizontalSize = new Property<float>();\n\n\t\tpublic Property<bool> ResizeVertical = new Property<bool>();\n\n\t\tpublic Property<float> MaxVerticalSize = new Property<float>();\n\n\t\tprivate NotifyBinding binding = null;\n\n\t\tpublic Scroller()\n\t\t{\n\t\t\tthis.EnableScissor.Value = true;\n\t\t}\n\t\t\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tnew CommandBinding<int>(this.MouseScrolled, delegate(int delta)\n\t\t\t{\n\t\t\t\tif (this.Children.Length == 1 && this.EnableScroll)\n\t\t\t\t{\n\t\t\t\t\tUIComponent child = this.Children.First();\n\t\t\t\t\tbool horizontalScroll = this.main.KeyboardState.Value.IsKeyDown(Keys.LeftShift);\n\t\t\t\t\tif (this.DefaultScrollHorizontal)\n\t\t\t\t\t\thorizontalScroll = !horizontalScroll;\n\t\t\t\t\tVector2 newPosition = child.Position + (horizontalScroll ? new Vector2(delta * this.ScrollAmount, 0) : new Vector2(0, delta * this.ScrollAmount));\n\n\t\t\t\t\tnewPosition.X = Math.Max(newPosition.X, this.Size.Value.X - child.ScaledSize.Value.X);\n\t\t\t\t\tnewPosition.X = Math.Min(newPosition.X, 0);\n\n\t\t\t\t\tnewPosition.Y = Math.Max(newPosition.Y, this.Size.Value.Y - child.ScaledSize.Value.Y);\n\t\t\t\t\tnewPosition.Y = Math.Min(newPosition.Y, 0);\n\t\t\t\t\tchild.Position.Value = newPosition;\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.Add(new ListNotifyBinding<UIComponent>(this.childrenChanged, this.Children));\n\t\t\tthis.childrenChanged();\n\t\t}\n\n\t\tprivate void childrenChanged()\n\t\t{\n\t\t\tthis.layoutDirty = true;\n\t\t\tif (this.binding != null)\n\t\t\t\tthis.Remove(this.binding);\n\t\t\tthis.binding = null;\n\t\t}\n\n\t\tprotected override void updateLayout()\n\t\t{\n\t\t\tif (this.binding == null)\n\t\t\t{\n\t\t\t\tif (this.Children.Length == 1)\n\t\t\t\t{\n\t\t\t\t\tUIComponent child = this.Children.First();\n\t\t\t\t\tthis.binding = new NotifyBinding(delegate() { this.layoutDirty = true; }, this.Size, child.ScaledSize);\n\t\t\t\t\tthis.Add(this.binding);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.Children.Length == 1)\n\t\t\t{\n\t\t\t\tUIComponent child = this.Children.First();\n\t\t\t\tVector2 newPosition = child.Position;\n\n\t\t\t\tif (this.ResizeHorizontal)\n\t\t\t\t{\n\t\t\t\t\tfloat size = child.ScaledSize.Value.X;\n\t\t\t\t\tif (size > this.MaxHorizontalSize && this.MaxHorizontalSize != 0.0f)\n\t\t\t\t\t\tsize = this.MaxHorizontalSize;\n\t\t\t\t\tthis.Size.Value = new Vector2(size, this.Size.Value.Y);\n\t\t\t\t}\n\t\t\t\tnewPosition.X = Math.Max(newPosition.X, this.Size.Value.X - child.ScaledSize.Value.X);\n\t\t\t\tnewPosition.X = Math.Min(newPosition.X, 0);\n\n\t\t\t\tif (this.ResizeVertical)\n\t\t\t\t{\n\t\t\t\t\tfloat size = child.ScaledSize.Value.Y;\n\t\t\t\t\tif (size > this.MaxVerticalSize && this.MaxVerticalSize != 0.0f)\n\t\t\t\t\t\tsize = this.MaxVerticalSize;\n\t\t\t\t\tthis.Size.Value = new Vector2(this.Size.Value.X, size);\n\t\t\t\t}\n\t\t\t\tnewPosition.Y = Math.Max(newPosition.Y, this.Size.Value.Y - child.ScaledSize.Value.Y);\n\t\t\t\tnewPosition.Y = Math.Min(newPosition.Y, 0);\n\t\t\t\tchild.Position.Value = newPosition;\n\t\t\t}\n\t\t}\n\n\t\tpublic void ScrollToBottom()\n\t\t{\n\t\t\tif (this.Children.Length == 1)\n\t\t\t{\n\t\t\t\tUIComponent child = this.Children.First();\n\n\t\t\t\tVector2 newPosition = child.Position;\n\t\t\t\tnewPosition.Y = Math.Min(this.Size.Value.Y - child.ScaledSize.Value.Y, 0);\n\t\t\t\tchild.Position.Value = newPosition;\n\t\t\t}\n\t\t}\n\n\t\tpublic void ScrollTo(UIComponent target)\n\t\t{\n\t\t\tif (this.Children.Length == 1)\n\t\t\t{\n\t\t\t\tUIComponent child = this.Children.First();\n\n\t\t\t\tVector2 newPosition = child.Position;\n\n\t\t\t\tVector2 targetPos = target.ScaledSize.Value;\n\t\t\t\twhile (target != child)\n\t\t\t\t{\n\t\t\t\t\ttargetPos += target.Position;\n\t\t\t\t\ttarget = target.Parent;\n\t\t\t\t}\n\n\t\t\t\tnewPosition.Y = Math.Min(this.Size.Value.Y - targetPos.Y, 0);\n\t\t\t\tchild.Position.Value = newPosition;\n\t\t\t}\n\t\t}\n\n\t\tpublic void ScrollToTop()\n\t\t{\n\t\t\tif (this.Children.Length == 1)\n\t\t\t{\n\t\t\t\tUIComponent child = this.Children.First();\n\n\t\t\t\tVector2 newPosition = child.Position;\n\t\t\t\tnewPosition.Y = Math.Max(this.Size.Value.Y - child.ScaledSize.Value.Y, 0);\n\t\t\t\tchild.Position.Value = newPosition;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/UI/Sprite.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework;\nusing System.IO;\n\nnamespace Lemma.Components\n{\n\tpublic class Sprite : UIComponent\n\t{\n\t\tpublic Property<string> Image = new Property<string>();\n\t\tpublic Property<bool> IsStandardImage = new Property<bool>();\n\t\tpublic Property<Color> Tint = new Property<Color> { Value = new Color(255, 255, 255, 255) };\n\t\tpublic Property<float> Opacity = new Property<float> { Value = 1.0f };\n\t\tpublic Property<SpriteEffects> Effects = new Property<SpriteEffects> { Value = SpriteEffects.None };\n\t\tprivate Texture2D texture;\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new SetBinding<string>(this.Image, delegate(string value)\n\t\t\t{\n\t\t\t\tthis.loadTexture(value);\n\t\t\t}));\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tif (this.IsStandardImage)\n\t\t\t\tthis.texture.Dispose();\n\t\t\tbase.delete();\n\t\t}\n\n\t\tpublic override void LoadContent(bool reload)\n\t\t{\n\t\t\tbase.LoadContent(reload);\n\t\t\tif (reload)\n\t\t\t\tthis.loadTexture(this.Image);\n\t\t}\n\n\t\tprivate void loadTexture(string file)\n\t\t{\n\t\t\tif (file == null)\n\t\t\t{\n\t\t\t\tthis.texture = null;\n\t\t\t\tthis.Size.Value = Vector2.Zero;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (this.IsStandardImage)\n\t\t\t\t{\n\t\t\t\t\tusing (Stream stream = File.OpenRead(file))\n\t\t\t\t\t\tthis.texture = Texture2D.FromStream(this.main.GraphicsDevice, stream);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.texture = this.main.MapContent.Load<Texture2D>(file);\n\t\t\t\tthis.Size.Value = new Vector2(this.texture.Width, this.texture.Height);\n\t\t\t}\n\t\t}\n\n\t\tprotected override void draw(GameTime time, Matrix parent, Matrix transform)\n\t\t{\n\t\t\tif (this.texture != null)\n\t\t\t{\n\t\t\t\tif (this.texture.IsDisposed)\n\t\t\t\t\tthis.loadTexture(this.Image);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tVector2 position = Vector2.Transform(this.Position, parent);\n\t\t\t\t\tfloat rotation = this.Rotation + (float)Math.Atan2(parent.M12, parent.M11);\n\t\t\t\t\tVector2 scale = this.Scale;\n\t\t\t\t\tscale.X *= (float)Math.Sqrt((parent.M11 * parent.M11) + (parent.M12 * parent.M12));\n\t\t\t\t\tscale.Y *= (float)Math.Sqrt((parent.M21 * parent.M21) + (parent.M22 * parent.M22));\n\t\t\t\t\tthis.renderer.Batch.Draw(this.texture, position, null, this.Tint.Value * this.Opacity.Value, rotation, this.AnchorPoint.Value * this.Size, scale, this.Effects, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/UI/TextElement.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework;\nusing System.Globalization;\n\nnamespace Lemma.Components\n{\n\tpublic class TextElement : UIComponent\n\t{\n\t\tpublic Property<string> FontFile = new Property<string>();\n\t\tpublic Property<string> Text = new Property<string> { Value = \"\" };\n\t\tpublic Property<Color> Tint = new Property<Color> { Value = Color.White };\n\t\tpublic Property<float> Opacity = new Property<float> { Value = 1.0f };\n\t\tpublic Property<float> WrapWidth = new Property<float> { Value = 0.0f };\n\t\tpublic Property<bool> Interpolation = new Property<bool> { Value = true };\n\t\tpublic Property<bool> FilterUnicode = new Property<bool>();\n\t\tprivate SpriteFont font;\n\n\t\tprivate Property<string> internalText = new Property<string> { Value = \"\" };\n\t\tprivate Binding<string> internalTextBinding;\n\t\tprivate NotifyBinding languageBinding;\n\n\t\tpublic static Dictionary<string, IProperty> BindableProperties = new Dictionary<string, IProperty>();\n\n\t\tprivate string wrappedText;\n\n\t\tpublic TextElement()\n\t\t{\n\t\t\tthis.Position.Value = new Vector2(10.0f, 10.0f);\n\t\t}\n\n\t\tprivate String wrapText(String text, float width)\n\t\t{\n\t\t\tString line = String.Empty;\n\t\t\tString returnString = String.Empty;\n\t\t\tString[] wordArray = text.Split(' ');\n\n\t\t\tforeach (String word in wordArray)\n\t\t\t{\n\t\t\t\tif (this.font.MeasureString(line + word).Length() > width)\n\t\t\t\t{\n\t\t\t\t\treturnString = returnString + line + '\\n';\n\t\t\t\t\tline = String.Empty;\n\t\t\t\t}\n\n\t\t\t\tline = line + word + ' ';\n\t\t\t}\n\n\t\t\treturn returnString + line;\n\t\t}\n\n\t\tprivate void updateText()\n\t\t{\n\t\t\tif (this.font == null)\n\t\t\t\treturn;\n\n\t\t\tstring text = this.internalText;\n\t\t\tfloat wrapWidth = this.WrapWidth;\n\t\t\tif (text == null)\n\t\t\t\tthis.wrappedText = null;\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (this.FilterUnicode)\n\t\t\t\t\ttext = new string(text.Select(x => this.font.Characters.Contains(x) ? x : ' ').ToArray());\n\t\t\t\tif (wrapWidth > 0.0f)\n\t\t\t\t\tthis.wrappedText = this.wrapText(text, wrapWidth);\n\t\t\t\telse\n\t\t\t\t\tthis.wrappedText = text;\n\t\t\t}\n\t\t\tthis.Size.Value = this.font.MeasureString(this.wrappedText ?? \"\");\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.Add(new SetBinding<string>(this.FontFile, delegate(string value)\n\t\t\t{\n\t\t\t\tif (this.main != null)\n\t\t\t\t\tthis.loadFont();\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<string>(this.internalText, delegate(string value)\n\t\t\t{\n\t\t\t\tthis.updateText();\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<float>(this.WrapWidth, delegate(float value)\n\t\t\t{\n\t\t\t\tthis.updateText();\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<bool>(this.FilterUnicode, delegate(bool value)\n\t\t\t{\n\t\t\t\tthis.updateText();\n\t\t\t}));\n\n\t\t\tthis.Add(new SetBinding<string>(this.Text, delegate(string value)\n\t\t\t{\n\t\t\t\tif (this.internalTextBinding != null)\n\t\t\t\t\tthis.Remove(this.internalTextBinding);\n\n\t\t\t\tif (this.languageBinding != null)\n\t\t\t\t\tthis.Remove(this.languageBinding);\n\n\t\t\t\tif (this.Interpolation)\n\t\t\t\t{\n\t\t\t\t\tList<IProperty> dependencies = new List<IProperty>();\n\n\t\t\t\t\tbool dependsOnLanguage = false;\n\n\t\t\t\t\tStringBuilder builder;\n\t\t\t\t\tif (value != null && value.Length > 0 && value[0] == '\\\\')\n\t\t\t\t\t{\n\t\t\t\t\t\tstring key = value.Substring(1);\n\t\t\t\t\t\tstring translated = this.main.Strings.Get(key);\n\t\t\t\t\t\tif (translated == null)\n\t\t\t\t\t\t\ttranslated = key;\n\t\t\t\t\t\tbuilder = new StringBuilder(translated);\n\t\t\t\t\t\tdependsOnLanguage = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tbuilder = new StringBuilder(value);\n\n\t\t\t\t\tfor (int i = 0; i < builder.Length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (builder[i] == '{' && builder[i + 1] == '{')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Grab the key\n\t\t\t\t\t\t\tstring key = null;\n\t\t\t\t\t\t\tStringBuilder keyBuilder = new StringBuilder();\n\t\t\t\t\t\t\tfor (int j = i + 2; j < builder.Length; j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (builder[j] == '}' && builder[j + 1] == '}')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tkey = keyBuilder.ToString();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tkeyBuilder.Append(builder[j]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (key != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tIProperty property;\n\t\t\t\t\t\t\t\tif (TextElement.BindableProperties.TryGetValue(key, out property))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstring oldKey = string.Format(\"{{{{{0}}}}}\", key);\n\t\t\t\t\t\t\t\t\tstring argumentIndexKey = string.Format(\"{{{0}}}\", dependencies.Count);\n\t\t\t\t\t\t\t\t\tbuilder.Replace(oldKey, argumentIndexKey, i, key.Length + 4);\n\t\t\t\t\t\t\t\t\tdependencies.Add(property);\n\t\t\t\t\t\t\t\t\ti += argumentIndexKey.Length - 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dependencies.Count > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdependsOnLanguage = true;\n\t\t\t\t\t\tstring format = builder.ToString();\n\t\t\t\t\t\tIProperty[] dependenciesArray = dependencies.ToArray();\n\t\t\t\t\t\tthis.internalTextBinding = new Binding<string>(this.internalText, delegate()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstring[] strings = new string[dependenciesArray.Length];\n\t\t\t\t\t\t\tfor (int i = 0; i < dependenciesArray.Length; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstring dependency = dependenciesArray[i].ToString();\n\t\t\t\t\t\t\t\tif (dependency[0] == '\\\\')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstring key = dependency.Substring(1);\n\t\t\t\t\t\t\t\t\tdependency = this.main.Strings.Get(key);\n\t\t\t\t\t\t\t\t\tif (dependency == null)\n\t\t\t\t\t\t\t\t\t\tdependency = key;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstrings[i] = dependency;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn string.Format(CultureInfo.CurrentCulture, format, strings);\n\t\t\t\t\t\t}, dependenciesArray);\n\t\t\t\t\t\tthis.Add(this.internalTextBinding);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.internalTextBinding = null;\n\t\t\t\t\t\tthis.internalText.Value = builder.ToString();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dependsOnLanguage)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.languageBinding = new NotifyBinding(this.Text.Reset, this.main.Strings.Language);\n\t\t\t\t\t\tthis.Add(this.languageBinding);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.languageBinding = null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.internalTextBinding = null;\n\t\t\t\t\tthis.languageBinding = null;\n\t\t\t\t\tthis.internalText.Value = value;\n\t\t\t\t}\n\t\t\t}));\n\t\t\tthis.Add(new NotifyBinding(this.Text.Reset, this.Interpolation));\n\t\t}\n\n\t\tpublic override void LoadContent(bool reload)\n\t\t{\n\t\t\tbase.LoadContent(reload);\n\t\t\tthis.loadFont();\n\t\t}\n\n\t\tprotected void loadFont()\n\t\t{\n\t\t\tthis.font = this.main.Content.Load<SpriteFont>(this.FontFile);\n\t\t\tthis.updateText();\n\t\t}\n\n\t\tprotected override void draw(GameTime time, Matrix parent, Matrix transform)\n\t\t{\n\t\t\tVector2 position = Vector2.Transform(this.Position, parent);\n\t\t\tposition.X = (float)Math.Round(position.X);\n\t\t\tposition.Y = (float)Math.Round(position.Y);\n\t\t\tfloat rotation = this.Rotation + (float)Math.Atan2(parent.M12, parent.M11);\n\t\t\tVector2 scale = this.Scale;\n\t\t\tscale.X *= (float)Math.Sqrt((parent.M11 * parent.M11) + (parent.M12 * parent.M12));\n\t\t\tscale.Y *= (float)Math.Sqrt((parent.M21 * parent.M21) + (parent.M22 * parent.M22));\n\n\t\t\tVector2 origin = this.AnchorPoint.Value * this.Size;\n\t\t\torigin.X = (float)Math.Round(origin.X);\n\t\t\torigin.Y = (float)Math.Round(origin.Y);\n\n\t\t\tthis.renderer.Batch.DrawString(\n\t\t\t\tthis.font,\n\t\t\t\tthis.wrappedText ?? \"\",\n\t\t\t\tposition,\n\t\t\t\tthis.Tint.Value * this.Opacity.Value,\n\t\t\t\trotation,\n\t\t\t\torigin,\n\t\t\t\tscale,\n\t\t\t\tSpriteEffects.None,\n\t\t\t\tthis.DrawOrder);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/UI/UIComponent.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Input;\nusing System.Xml.Serialization;\nusing System.Collections;\nusing System.Xml;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework.Graphics;\n\nnamespace Lemma.Components\n{\n\tpublic class UIComponent : Component<Main>, IGraphicsComponent\n\t{\n\t\tprivate UIRenderer _renderer;\n\t\tprotected UIRenderer renderer\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this._renderer;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis._renderer = value;\n\t\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\t\tthis.Children[i].renderer = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<object> UserData = new Property<object>();\n\t\tpublic Property<Vector2> AnchorPoint = new Property<Vector2>();\n\t\tpublic Property<Vector2> Position = new Property<Vector2>();\n\t\tpublic Property<Vector2> Size = new Property<Vector2>();\n\t\tpublic Property<Vector2> Scale = new Property<Vector2> { Value = Vector2.One };\n\t\tpublic Property<float> Rotation = new Property<float>();\n\t\tpublic Property<bool> Visible = new Property<bool> { Value = true };\n\t\tpublic Property<bool> EnableScissor = new Property<bool>();\n\t\tpublic Property<bool> SwallowMouseEvents = new Property<bool>();\n\t\tpublic Property<string> Name = new Property<string>();\n\t\tpublic Property<int> DrawOrder = new Property<int>();\n\t\tpublic Property<bool> EnableInput = new Property<bool> { Value = true };\n\n\t\tprotected bool requiresNewBatch = false;\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector2> ScaledSize = new Property<Vector2>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector2> InverseAnchorPoint = new Property<Vector2> { Value = new Vector2(0.5f, 0.5f) };\n\t\t[XmlIgnore]\n\t\tpublic Property<Rectangle> Rectangle = new Property<Rectangle>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Rectangle> ScaledRectangle = new Property<Rectangle>();\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> Highlighted = new Property<bool>();\n\t\t[XmlIgnore]\n\t\tpublic Property<UIComponent> Parent = new Property<UIComponent>();\n\t\t[XmlIgnore]\n\t\tpublic Property<Matrix> Transform = new Property<Matrix> { Value = Matrix.Identity };\n\t\t[XmlIgnore]\n\t\tpublic Property<bool> MouseLocked = new Property<bool>();\n\n\t\t[XmlIgnore]\n\t\tpublic Command MouseOver = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command MouseOut = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command MouseLeftDown = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command MouseLeftUp = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command MouseMiddleDown = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command MouseMiddleUp = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command MouseRightDown = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command MouseRightUp = new Command();\n\t\t[XmlIgnore]\n\t\tpublic Command<int> MouseScrolled = new Command<int>();\n\n\t\tpublic ListProperty<UIComponent> Children = new ListProperty<UIComponent>();\n\n\t\tprotected bool layoutDirty;\n\n\t\tpublic virtual void LoadContent(bool reload)\n\t\t{\n\t\t\tif (reload)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\t\tthis.Children[i].LoadContent(true);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tif (this.Parent.Value != null)\n\t\t\t\tthis.Parent.Value.Children.Remove(this);\n\t\t\telse\n\t\t\t\tthis.deleteWithoutRemovingFromParent();\n\t\t}\n\n\t\tprivate void deleteWithoutRemovingFromParent()\n\t\t{\n\t\t\tthis.Parent.Value = null;\n\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\tthis.Children[i].deleteWithoutRemovingFromParent();\n\t\t\tthis.Delete.Execute();\n\t\t}\n\n\t\tpublic void CheckLayout()\n\t\t{\n\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\tthis.Children[i].CheckLayout();\n\t\t\tif (this.layoutDirty)\n\t\t\t{\n\t\t\t\tthis.updateLayout();\n\t\t\t\tthis.layoutDirty = false;\n\t\t\t}\n\t\t}\n\n\t\tpublic UIComponent GetChildByName(string name)\n\t\t{\n\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t{\n\t\t\t\tUIComponent child = this.Children[i];\n\t\t\t\tif (child.Name.Value == name)\n\t\t\t\t\treturn child;\n\t\t\t\tUIComponent result = child.GetChildByName(name);\n\t\t\t\tif (result != null)\n\t\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected virtual void updateLayout()\n\t\t{\n\n\t\t}\n\n\t\tpublic void Detach()\n\t\t{\n\t\t\tthis.Parent.Value.Children.RemoveWithoutNotifying(this);\n\t\t\tthis.Parent.Value = null;\n\t\t}\n\n\t\tpublic UIComponent()\n\t\t{\n\t\t\tthis.Children.ItemAdded += new ListProperty<UIComponent>.ItemAddedEventHandler(delegate(int index, UIComponent child)\n\t\t\t{\n\t\t\t\tif (child.Parent.Value != null)\n\t\t\t\t\tthrow new Exception(\"UIComponent was added as a child, but it already had a parent.\");\n\t\t\t\tchild.renderer = this.renderer;\n\t\t\t\tchild.Parent.Value = this;\n\t\t\t\tif (child.main == null && this.main != null)\n\t\t\t\t\tthis.main.AddComponent(child);\n\t\t\t});\n\t\t\tthis.Children.ItemChanged += new ListProperty<UIComponent>.ItemChangedEventHandler(delegate(int index, UIComponent old, UIComponent newValue)\n\t\t\t{\n\t\t\t\told.deleteWithoutRemovingFromParent();\n\t\t\t\tnewValue.renderer = this.renderer;\n\t\t\t\tif (newValue.Parent.Value != this)\n\t\t\t\t\tnewValue.Parent.Value = this;\n\t\t\t\tif (newValue.main == null && this.main != null)\n\t\t\t\t\tthis.main.AddComponent(newValue);\n\t\t\t});\n\t\t\tthis.Children.ItemRemoved += new ListProperty<UIComponent>.ItemRemovedEventHandler(delegate(int index, UIComponent child)\n\t\t\t{\n\t\t\t\tchild.deleteWithoutRemovingFromParent();\n\t\t\t});\n\t\t\tthis.Children.Clearing += new ListProperty<UIComponent>.ClearEventHandler(delegate()\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\t\tthis.Children[i].deleteWithoutRemovingFromParent();\n\t\t\t});\n\t\t}\n\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\n\t\t\tthis.Add(new TwoWayBinding<Vector2, Vector2>(\n\t\t\t\tthis.AnchorPoint,\n\t\t\t\tx => new Vector2(1.0f - x.X, 1.0f - x.Y),\n\t\t\t\tthis.InverseAnchorPoint,\n\t\t\t\tx => new Vector2(1.0f - x.X, 1.0f - x.Y)));\n\t\t\tthis.Add(new Binding<Vector2>(this.ScaledSize, () => this.Scale * this.Size.Value, this.Scale, this.Size));\n\t\t\tthis.Add(new Binding<Rectangle, Vector2>(this.Rectangle, x => new Rectangle(0, 0, (int)Math.Round(x.X), (int)Math.Round(x.Y)), this.Size));\n\t\t\tthis.Add(new Binding<Rectangle, Vector2>(this.ScaledRectangle, x => new Rectangle(0, 0, (int)Math.Round(x.X), (int)Math.Round(x.Y)), this.ScaledSize));\n\t\t\tthis.Add(new Binding<Matrix>(this.Transform, delegate()\n\t\t\t{\n\t\t\t\tMatrix mat = Matrix.CreateTranslation(new Vector3(-(this.Size.Value * this.AnchorPoint), 0.0f))\n\t\t\t\t\t* Matrix.CreateRotationZ(this.Rotation)\n\t\t\t\t\t* Matrix.CreateScale(new Vector3(this.Scale, 1.0f));\n\t\t\t\tmat.Translation += new Vector3(this.Position.Value, 0.0f);\n\t\t\t\treturn mat;\n\t\t\t}, this.Position, this.Size, this.Scale, this.Rotation, this.AnchorPoint));\n\n\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t{\n\t\t\t\tUIComponent child = this.Children[i];\n\t\t\t\tif (child.main == null)\n\t\t\t\t\tthis.main.AddComponent(child);\n\t\t\t}\n\t\t}\n\n\t\tpublic Matrix GetAbsoluteTransform()\n\t\t{\n\t\t\tUIComponent x = this;\n\t\t\tMatrix result = x.Transform;\n\t\t\twhile (x.Parent.Value != null)\n\t\t\t{\n\t\t\t\tx = x.Parent;\n\t\t\t\tresult *= x.Transform;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Vector2 GetAbsolutePosition()\n\t\t{\n\t\t\tMatrix mat = this.GetAbsoluteTransform();\n\t\t\treturn new Vector2(mat.Translation.X, mat.Translation.Y);\n\t\t}\n\n\t\tprivate bool swallowCurrentMouseEvent;\n\t\tpublic void SwallowCurrentMouseEvent()\n\t\t{\n\t\t\tthis.swallowCurrentMouseEvent = true;\n\t\t}\n\n\t\tpublic bool HandleMouse(MouseState mouse, MouseState lastMouse, Matrix parent, bool mouseContainedInParent)\n\t\t{\n\t\t\tif (!this.Visible || !this.EnableInput || main.GeeUI.LastClickCaptured)\n\t\t\t\treturn false;\n\t\t\tMatrix transform = this.Transform * parent;\n\n\t\t\tbool newHighlighted = this.MouseLocked;\n\n\t\t\tif (!newHighlighted && mouseContainedInParent)\n\t\t\t{\n\t\t\t\tVector3 pos = new Vector3(mouse.X, mouse.Y, 0.0f);\n\t\t\t\tpos = Vector3.Transform(pos, Matrix.Invert(transform));\n\t\t\t\tPoint relativePoint = new Point((int)Math.Round(pos.X), (int)Math.Round(pos.Y));\n\t\t\t\tnewHighlighted = this.Rectangle.Value.Contains(relativePoint);\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfor (int i = this.Children.Length - 1; i >= 0 && i < this.Children.Length; i--)\n\t\t\t\t{\n\t\t\t\t\tif (this.Children[i].HandleMouse(mouse, lastMouse, transform, newHighlighted))\n\t\t\t\t\t\treturn true; // Mouse events have been swallowed\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (InvalidOperationException)\n\t\t\t{\n\t\t\t\t// Children were modified while we were iterating.\n\t\t\t}\n\n\t\t\tPoint absolutePoint = new Point(mouse.X, mouse.Y);\n\n\t\t\tif (newHighlighted && !this.Highlighted)\n\t\t\t{\n\t\t\t\tthis.MouseOver.Execute();\n\t\t\t\tthis.Highlighted.Value = true;\n\t\t\t}\n\t\t\telse if (!newHighlighted && this.Highlighted)\n\t\t\t{\n\t\t\t\tthis.MouseOut.Execute();\n\t\t\t\tthis.Highlighted.Value = false;\n\t\t\t}\n\n\t\t\tif (newHighlighted)\n\t\t\t{\n\t\t\t\tif (mouse.LeftButton == ButtonState.Pressed && lastMouse.LeftButton == ButtonState.Released)\n\t\t\t\t\tthis.MouseLeftDown.Execute();\n\t\t\t\telse if (mouse.LeftButton == ButtonState.Released && lastMouse.LeftButton == ButtonState.Pressed)\n\t\t\t\t\tthis.MouseLeftUp.Execute();\n\n\t\t\t\tif (mouse.MiddleButton == ButtonState.Pressed && lastMouse.MiddleButton == ButtonState.Released)\n\t\t\t\t\tthis.MouseMiddleDown.Execute();\n\t\t\t\telse if (mouse.MiddleButton == ButtonState.Released && lastMouse.MiddleButton == ButtonState.Pressed)\n\t\t\t\t\tthis.MouseMiddleUp.Execute();\n\n\t\t\t\tif (mouse.RightButton == ButtonState.Pressed && lastMouse.RightButton == ButtonState.Released)\n\t\t\t\t\tthis.MouseRightDown.Execute();\n\t\t\t\telse if (mouse.RightButton == ButtonState.Released && lastMouse.RightButton == ButtonState.Pressed)\n\t\t\t\t\tthis.MouseRightUp.Execute();\n\n\t\t\t\tif (mouse.ScrollWheelValue != lastMouse.ScrollWheelValue)\n\t\t\t\t\tthis.MouseScrolled.Execute(mouse.ScrollWheelValue > lastMouse.ScrollWheelValue ? 1 : -1);\n\t\t\t}\n\t\t\tif (this.swallowCurrentMouseEvent)\n\t\t\t{\n\t\t\t\tthis.swallowCurrentMouseEvent = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn newHighlighted && (this.SwallowMouseEvents || this.MouseLocked); // Swallow the mouse events so no one else handles them\n\t\t}\n\n\t\tpublic void Draw(GameTime time, Matrix parent, Rectangle scissor)\n\t\t{\n\t\t\tMatrix transform = this.Transform * parent;\n\t\t\tRectangle newScissor = scissor;\n\t\t\tif (this.EnableScissor)\n\t\t\t\tnewScissor = scissor.Intersect(RectangleExtensions.Create(Vector2.Transform(Vector2.Zero, transform), Vector2.Transform(this.Size, transform)));\n\n\t\t\tif (newScissor.Width > 0 && newScissor.Height > 0)\n\t\t\t{\n\t\t\t\tif (this.EnableScissor)\n\t\t\t\t{\n\t\t\t\t\tthis.renderer.Batch.End();\n\t\t\t\t\tthis.renderer.Batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, this.renderer.RasterizerState, null, Matrix.Identity);\n\t\t\t\t\tthis.main.GraphicsDevice.ScissorRectangle = newScissor;\n\t\t\t\t}\n\n\t\t\t\tthis.draw(time, parent, transform);\n\t\t\t\tfor (int i = 0; i < this.Children.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tUIComponent child = this.Children[i];\n\t\t\t\t\tif (child.Visible)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.main.GraphicsDevice.ScissorRectangle != newScissor || child.requiresNewBatch)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.renderer.Batch.End();\n\t\t\t\t\t\t\tthis.renderer.Batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, this.renderer.RasterizerState, null, Matrix.Identity);\n\t\t\t\t\t\t\tthis.main.GraphicsDevice.ScissorRectangle = newScissor;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchild.Draw(time, transform, newScissor);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.EnableScissor)\n\t\t\t{\n\t\t\t\t// Restore original scissor\n\t\t\t\tthis.renderer.Batch.End();\n\t\t\t\tthis.renderer.Batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, this.renderer.RasterizerState, null, Matrix.Identity);\n\t\t\t\tthis.main.GraphicsDevice.ScissorRectangle = scissor;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected virtual void draw(GameTime time, Matrix parent, Matrix transform)\n\t\t{\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/UI/UIFactory.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Util;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Components\n{\n\tpublic class UIFactory : Component<Main>\n\t{\n\t\tpublic const float Opacity = 0.65f;\n\n\t\tpublic static void OpenURL(string url)\n\t\t{\n#if STEAMWORKS\n\t\t\tif (SteamWorker.Initialized)\n\t\t\t{\n\t\t\t\tSteamworks.SteamFriends.ActivateGameOverlayToWebPage(url);\n\t\t\t}\n\t\t\telse\n#endif\n\t\t\t{\n\t\t\t\tSystem.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(url));\n\t\t\t}\n\t\t}\n\n\t\tpublic TextElement CreateLink(string text, string url)\n\t\t{\n\t\t\tSystem.Windows.Forms.Form winForm = (System.Windows.Forms.Form)System.Windows.Forms.Form.FromHandle(this.main.Window.Handle);\n\n\t\t\tTextElement element = new TextElement();\n\t\t\telement.FontFile.Value = this.main.Font;\n\t\t\telement.Text.Value = text;\n\t\t\telement.Add(new Binding<Color, bool>(element.Tint, x => x ? new Color(1.0f, 0.7f, 0.8f) : new Color(0.0f, 0.8f, 1.0f), element.Highlighted));\n\t\t\telement.Add(new CommandBinding(element.MouseLeftUp, delegate()\n\t\t\t{\n\t\t\t\tUIFactory.OpenURL(url);\n\t\t\t}));\n\t\t\telement.Add(new CommandBinding(element.MouseOver, delegate()\n\t\t\t{\n\t\t\t\twinForm.Cursor = System.Windows.Forms.Cursors.Hand;\n\t\t\t}));\n\t\t\telement.Add(new CommandBinding(element.MouseOut, delegate()\n\t\t\t{\n\t\t\t\twinForm.Cursor = System.Windows.Forms.Cursors.Default;\n\t\t\t}));\n\t\t\telement.Add(new CommandBinding(element.Delete, delegate()\n\t\t\t{\n\t\t\t\tif (element.Highlighted)\n\t\t\t\t\twinForm.Cursor = System.Windows.Forms.Cursors.Default;\n\t\t\t}));\n\n\t\t\treturn element;\n\t\t}\n\n\t\tpublic Container CreateScrollButton<Type>(string label, Property<Type> property, Action<int> scrolled)\n\t\t{\n\t\t\treturn this.CreateScrollButton<Type>(label, property, x => x.ToString(), scrolled);\n\t\t}\n\n\t\tpublic TextElement CreateLabel(string label = null)\n\t\t{\n\t\t\tTextElement text = new TextElement();\n\t\t\ttext.FontFile.Value = this.main.Font;\n\t\t\tif (label != null)\n\t\t\t\ttext.Text.Value = label;\n\t\t\treturn text;\n\t\t}\n\n\t\tpublic Container CreatePropertyButton<Type>(string label, Property<Type> property)\n\t\t{\n\t\t\treturn this.CreatePropertyButton<Type>(label, property, x => x.ToString());\n\t\t}\n\n\t\tpublic Container CreatePropertyButton<Type>(string label, Property<Type> property, Func<Type, string> conversion)\n\t\t{\n\t\t\tContainer result = this.CreateButton();\n\n\t\t\tTextElement text = this.CreateLabel(label);\n\t\t\tresult.Children.Add(text);\n\n\t\t\tTextElement value = this.CreateLabel();\n\t\t\tvalue.Add(new Binding<Vector2>(value.Position, () => new Vector2(result.Size.Value.X - result.PaddingRight.Value, value.Position.Value.Y), result.Size, result.PaddingRight));\n\t\t\tvalue.AnchorPoint.Value = new Vector2(1, 0);\n\t\t\tvalue.Add(new Binding<string, Type>(value.Text, conversion, property));\n\t\t\tresult.Children.Add(value);\n\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Container CreateScrollButton<Type>(string label, Property<Type> property, Func<Type, string> conversion, Action<int> scrolled)\n\t\t{\n\t\t\tContainer result = this.CreateButton();\n\n\t\t\tTextElement text = this.CreateLabel(label);\n\t\t\tresult.Children.Add(text);\n\n\t\t\tListContainer valueList = new ListContainer();\n\t\t\tvalueList.Orientation.Value = ListContainer.ListOrientation.Horizontal;\n\t\t\tvalueList.Add(new Binding<Vector2>(valueList.Position, () => new Vector2(result.Size.Value.X - result.PaddingRight.Value, valueList.Position.Value.Y), result.Size, result.PaddingRight));\n\t\t\tvalueList.AnchorPoint.Value = new Vector2(1, 0);\n\t\t\tresult.Children.Add(valueList);\n\n\t\t\tContainer left = this.CreateButton(\"<\");\n\t\t\tleft.Name.Value = \"<\";\n\t\t\tvalueList.Children.Add(left);\n\n\t\t\tContainer valueContainer = new Container();\n\t\t\tvalueContainer.Opacity.Value = 0.0f;\n\t\t\tvalueContainer.ResizeHorizontal.Value = false;\n\t\t\tvalueContainer.Size.Value = new Vector2(80.0f * this.main.FontMultiplier, 0.0f);\n\t\t\tvalueList.Children.Add(valueContainer);\n\n\t\t\tTextElement value = this.CreateLabel();\n\t\t\tvalue.Add(new Binding<string, Type>(value.Text, conversion, property));\n\t\t\tvalue.AnchorPoint.Value = new Vector2(0.5f);\n\t\t\tvalue.Add(new Binding<Vector2>(value.Position, x => x * 0.5f, valueContainer.Size));\n\t\t\tvalueContainer.Children.Add(value);\n\n\t\t\tContainer right = this.CreateButton(\">\");\n\t\t\tright.Name.Value = \">\";\n\t\t\tvalueList.Children.Add(right);\n\n\t\t\tleft.Add(new CommandBinding(left.MouseLeftUp, delegate()\n\t\t\t{\n\t\t\t\tscrolled(-1);\n\t\t\t}));\n\n\t\t\tright.Add(new CommandBinding(right.MouseLeftUp, delegate()\n\t\t\t{\n\t\t\t\tscrolled(1);\n\t\t\t}));\n\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Container CreateContainer()\n\t\t{\n\t\t\tContainer result = new Container();\n\t\t\tresult.Tint.Value = Color.Black;\n\t\t\treturn result;\n\t\t}\n\n\t\tprivate static Color highlightColor = new Color(0.0f, 0.175f, 0.35f);\n\n\t\tpublic Container CreateButton(Action action = null)\n\t\t{\n\t\t\tContainer result = this.CreateContainer();\n\n\t\t\tresult.Add(new Binding<Color, bool>(result.Tint, x => x ? UIFactory.highlightColor : new Color(0.0f, 0.0f, 0.0f), result.Highlighted));\n\t\t\tresult.Add(new Binding<float, bool>(result.Opacity, x => x ? 1.0f : Opacity, result.Highlighted));\n\t\t\tresult.Add(new NotifyBinding(delegate()\n\t\t\t{\n\t\t\t\tif (result.Highlighted)\n\t\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_UI_MOUSEOVER);\n\t\t\t}, result.Highlighted));\n\n\t\t\tresult.Add(new CommandBinding(result.MouseLeftDown, delegate()\n\t\t\t{\n\t\t\t\tresult.Tint.Value = Color.Black;\n\t\t\t}));\n\t\t\tresult.Add(new CommandBinding(result.MouseLeftUp, delegate()\n\t\t\t{\n\t\t\t\tAkSoundEngine.PostEvent(AK.EVENTS.PLAY_UI_CLICK);\n\t\t\t\tif (action != null)\n\t\t\t\t\taction();\n\t\t\t}));\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Container CreateButton(string label, Action action = null)\n\t\t{\n\t\t\tContainer result = this.CreateButton(action);\n\t\t\tTextElement text = new TextElement();\n\t\t\ttext.FontFile.Value = this.main.Font;\n\t\t\ttext.Name.Value = \"Text\";\n\t\t\ttext.Text.Value = label;\n\t\t\tresult.Children.Add(text);\n\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/UI/UIRenderer.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Console;\nusing Microsoft.Xna.Framework;\nusing System.Xml.Serialization;\nusing Microsoft.Xna.Framework.Input;\nusing Microsoft.Xna.Framework.Graphics;\nusing GeeUI;\n\nnamespace Lemma.Components\n{\n\tpublic class UIRenderer : Component<Main>, IUpdateableComponent, INonPostProcessedDrawableComponent, IDrawablePreFrameComponent\n\t{\n\t\tpublic class RootUIComponent : UIComponent\n\t\t{\n\t\t\tpublic RootUIComponent(UIRenderer renderer)\n\t\t\t{\n\t\t\t\tthis.renderer = renderer;\n\t\t\t}\n\t\t}\n\n\t\tpublic Property<int> DrawOrder { get; set; }\n\n\t\tpublic void Setup3D(Property<Matrix> transform)\n\t\t{\n\t\t\tthis.MouseFilter = delegate(MouseState mouse)\n\t\t\t{\n\t\t\t\tPoint screenSize = this.main.ScreenSize;\n\t\t\t\tMicrosoft.Xna.Framework.Graphics.Viewport viewport = new Viewport(0, 0, screenSize.X, screenSize.Y);\n\n\t\t\t\tMatrix inverseTransform = Matrix.Invert(transform);\n\t\t\t\tVector3 ray = Vector3.Normalize(viewport.Unproject(new Vector3(mouse.X, mouse.Y, 1), main.Camera.Projection, main.Camera.View, Matrix.Identity) - viewport.Unproject(new Vector3(mouse.X, mouse.Y, 0), main.Camera.Projection, main.Camera.View, Matrix.Identity));\n\t\t\t\tVector3 rayStart = main.Camera.Position;\n\n\t\t\t\tray = Vector3.TransformNormal(ray, inverseTransform);\n\t\t\t\trayStart = Vector3.Transform(rayStart, inverseTransform);\n\n\t\t\t\tPoint output;\n\n\t\t\t\tfloat? intersection = new Ray(rayStart, ray).Intersects(new Plane(Vector3.Right, 0.0f));\n\t\t\t\tif (intersection.HasValue)\n\t\t\t\t{\n\t\t\t\t\tVector3 intersectionPoint = rayStart + ray * intersection.Value;\n\t\t\t\t\tPoint size = this.RenderTargetSize;\n\t\t\t\t\tVector2 sizeF = new Vector2(size.X, size.Y);\n\t\t\t\t\toutput = new Point((int)((0.5f - intersectionPoint.Z) * sizeF.X), (int)((0.5f - intersectionPoint.Y) * sizeF.Y));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\toutput = new Point(-1, -1);\n\n\t\t\t\treturn new MouseState\n\t\t\t\t(\n\t\t\t\t\toutput.X,\n\t\t\t\t\toutput.Y,\n\t\t\t\t\tmouse.ScrollWheelValue,\n\t\t\t\t\tmouse.LeftButton,\n\t\t\t\t\tmouse.MiddleButton,\n\t\t\t\t\tmouse.RightButton,\n\t\t\t\t\tmouse.XButton1,\n\t\t\t\t\tmouse.XButton2\n\t\t\t\t);\n\t\t\t};\n\t\t}\n\n\t\tpublic GeeUIMain GeeUI;\n\n\t\t[XmlIgnore]\n\t\tpublic RasterizerState RasterizerState;\n\n\t\t[XmlIgnore]\n\t\tpublic SpriteBatch Batch;\n\n\t\t[XmlIgnore]\n\t\tpublic RootUIComponent Root;\n\n\t\t[XmlIgnore]\n\t\tpublic Command SwallowMouseEvents = new Command();\n\n\t\tpublic Property<bool> EnableMouse = new Property<bool> { Value = true };\n\n\t\tpublic Property<Point> RenderTargetSize = new Property<Point>();\n\n\t\tpublic Property<Color> RenderTargetBackground = new Property<Color>();\n\n\t\t[XmlIgnore]\n\t\tpublic Property<RenderTarget2D> RenderTarget = new Property<RenderTarget2D>();\n\n\t\t[XmlIgnore]\n\t\tpublic Func<MouseState, MouseState> MouseFilter = x => x;\n\n\t\t[XmlIgnore]\n\t\tpublic Property<Vector2> Mouse = new Property<Vector2>();\n\n\t\tpublic Property<bool> IsMouseVisible = new Property<bool> { };\n\n\t\tprivate MouseState lastMouseState;\n\t\tprivate MouseState lastRealMouseState;\n\n\t\tprivate void resize()\n\t\t{\n\t\t\tif (this.RenderTarget.Value != null)\n\t\t\t\tthis.RenderTarget.Value.Dispose();\n\t\t\tthis.RenderTarget.Value = null;\n\n\t\t\tPoint size = this.RenderTargetSize;\n\t\t\tPoint screenSize = this.main.ScreenSize;\n\t\t\tif (size.X > 0 && size.Y > 0)\n\t\t\t{\n\t\t\t\tthis.RenderTarget.Value = new RenderTarget2D(this.main.GraphicsDevice, size.X, size.Y, false, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);\n\t\t\t\tthis.Root.Size.Value = new Vector2(size.X, size.Y);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis.Root.Size.Value = new Vector2(screenSize.X, screenSize.Y);\n\n#if VR\n\t\t\tif (this.main.VR)\n\t\t\t{\n\t\t\t\tthis.mousePos.X = screenSize.X / 2;\n\t\t\t\tthis.mousePos.Y = screenSize.Y / 2;\n\t\t\t}\n#endif\n\n\t\t\tthis.needResize = false;\n\t\t}\n\n#if VR\n\t\tpublic Sprite Reticle;\n#endif\n\n\t\tpublic UIRenderer()\n\t\t{\n\t\t\tthis.DrawOrder = new Property<int> { Value = 0 };\n\t\t\tthis.RasterizerState = new RasterizerState { ScissorTestEnable = true, CullMode = CullMode.None };\n\t\t\tthis.Root = new RootUIComponent(this);\n\t\t\tthis.Root.AnchorPoint.Value = Vector2.Zero;\n\t\t\tthis.Serialize = false;\n\t\t}\n\n\t\tprivate bool needResize = false;\n\t\tpublic override void Awake()\n\t\t{\n\t\t\tbase.Awake();\n\t\t\tthis.Add(new NotifyBinding(delegate() { this.needResize = true; }, this.RenderTargetSize));\n\t\t\tthis.Add(new NotifyBinding(delegate() { this.needResize = true; }, this.main.ScreenSize));\n\t\t\tthis.lastMouseState = this.main.LastMouseState;\n\t\t\tthis.main.GraphicsDevice.DeviceReset += this.deviceReset;\n\t\t\tthis.main.AddComponent(this.Root);\n\t\t\tthis.Root.Add(new Binding<Vector2, Point>(this.Root.Size, x => new Vector2(x.X, x.Y), main.ScreenSize));\n\n#if VR\n\t\t\tif (this.main.VR)\n\t\t\t{\n\t\t\t\tthis.Reticle = new Sprite();\n\t\t\t\tthis.Reticle.Image.Value = \"Images\\\\cursor\";\n\t\t\t\tthis.Reticle.AnchorPoint.Value = new Vector2(0.0f, 0.0f);\n\t\t\t\tthis.Root.Children.Add(this.Reticle);\n\t\t\t\tthis.Reticle.Add(new Binding<Vector2>(this.Reticle.Position, this.Mouse));\n\t\t\t\tthis.Reticle.Add(new Binding<bool>(this.Reticle.Visible, this.IsMouseVisible));\n\t\t\t\t// HACK: Make sure reticle is always on top.\n\t\t\t\tthis.Root.Children.ItemAdded += delegate(int index, UIComponent c)\n\t\t\t\t{\n\t\t\t\t\tif (c != this.Reticle && this.Root.Children.Contains(this.Reticle))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Reticle.Detach();\n\t\t\t\t\t\tthis.Root.Children.Add(this.Reticle);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\telse\n#endif\n\t\t\t{\n\t\t\t\tthis.Add(new NotifyBinding(delegate()\n\t\t\t\t{\n\t\t\t\t\tthis.main.IsMouseVisible = this.IsMouseVisible;\n\t\t\t\t}, this.IsMouseVisible));\n\t\t\t}\n\t\t}\n\n\t\tprivate void deviceReset(object sender, EventArgs e)\n\t\t{\n\t\t\tthis.needResize = true;\n\t\t}\n\n\t\tpublic void LoadContent(bool reload)\n\t\t{\n\t\t\tthis.Batch = new SpriteBatch(this.main.GraphicsDevice);\n\t\t\tthis.needResize = true;\n\t\t}\n\n#if VR\n\t\tprivate Point mousePos;\n#endif\n\n\t\tvoid IUpdateableComponent.Update(float dt)\n\t\t{\n\t\t\tif (this.main.IsActive && this.EnableMouse)\n\t\t\t{\n\t\t\t\tMouseState realMouseState = this.main.MouseState;\n#if VR\n\t\t\t\tPoint lastMousePos = new Point();\n\t\t\t\tif (this.main.VR)\n\t\t\t\t{\n\t\t\t\t\tlastMousePos = this.mousePos;\n\t\t\t\t\tthis.mousePos.X += realMouseState.X - FPSInput.MouseCenter.X;\n\t\t\t\t\tthis.mousePos.Y += realMouseState.Y - FPSInput.MouseCenter.Y;\n\t\t\t\t\tFPSInput.RecenterMouse();\n\t\t\t\t\trealMouseState = new MouseState\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.mousePos.X,\n\t\t\t\t\t\tthis.mousePos.Y,\n\t\t\t\t\t\trealMouseState.ScrollWheelValue,\n\t\t\t\t\t\trealMouseState.LeftButton,\n\t\t\t\t\t\trealMouseState.MiddleButton,\n\t\t\t\t\t\trealMouseState.RightButton,\n\t\t\t\t\t\trealMouseState.XButton1,\n\t\t\t\t\t\trealMouseState.XButton2\n\t\t\t\t\t);\n\t\t\t\t}\n#endif\n\t\t\t\tMouseState current = this.MouseFilter(realMouseState), last = this.lastMouseState;\n\n#if VR\n\t\t\t\tif (this.main.VR)\n\t\t\t\t{\n\t\t\t\t\tPoint size = this.RenderTargetSize;\n\t\t\t\t\tif (current.X > size.X)\n\t\t\t\t\t\tthis.mousePos.X = Math.Min(this.mousePos.X, lastMousePos.X);\n\t\t\t\t\tif (current.X < 0)\n\t\t\t\t\t\tthis.mousePos.X = Math.Max(this.mousePos.X, lastMousePos.X);\n\t\t\t\t\tif (current.Y > size.Y)\n\t\t\t\t\t\tthis.mousePos.Y = Math.Min(this.mousePos.Y, lastMousePos.Y);\n\t\t\t\t\tif (current.Y < 0)\n\t\t\t\t\t\tthis.mousePos.Y = Math.Max(this.mousePos.Y, lastMousePos.Y);\n\t\t\t\t}\n#endif\n\n\t\t\t\tif (this.GeeUI != null)\n\t\t\t\t\tthis.GeeUI.Update(dt, this.main.KeyboardState, current);\n\n\t\t\t\tthis.Mouse.Value = new Vector2(current.X, current.Y);\n\t\t\t\tif (current.LeftButton != last.LeftButton\n\t\t\t\t\t|| current.RightButton != last.RightButton\n\t\t\t\t\t|| current.MiddleButton != last.MiddleButton\n\t\t\t\t\t|| current.ScrollWheelValue != last.ScrollWheelValue\n\t\t\t\t\t|| realMouseState.X != this.lastRealMouseState.X\n\t\t\t\t\t|| realMouseState.Y != this.lastRealMouseState.Y\n\t\t\t\t\t|| current.XButton1 != last.XButton1\n\t\t\t\t\t|| current.XButton2 != last.XButton2)\n\t\t\t\t{\n\t\t\t\t\tif (this.Root.HandleMouse(current, last, Matrix.Identity, true))\n\t\t\t\t\t\tthis.SwallowMouseEvents.Execute();\n\t\t\t\t\tthis.lastMouseState = current;\n\t\t\t\t\tthis.lastRealMouseState = realMouseState;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void draw(GameTime time, Point screenSize)\n\t\t{\n\t\t\tthis.Root.CheckLayout();\n\n\t\t\tRasterizerState originalState = this.main.GraphicsDevice.RasterizerState;\n\n\t\t\tthis.Batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, this.RasterizerState, null, Matrix.Identity);\n\n\t\t\tif (this.GeeUI != null)\n\t\t\t\tthis.GeeUI.Draw(this.Batch);\n\n\t\t\tthis.Root.Draw(time, Matrix.Identity, new Rectangle(0, 0, screenSize.X, screenSize.Y));\n\n\t\t\tthis.Batch.End();\n\n\t\t\tthis.main.GraphicsDevice.RasterizerState = originalState;\n\t\t}\n\n\t\tvoid INonPostProcessedDrawableComponent.DrawNonPostProcessed(GameTime time, RenderParameters parameters)\n\t\t{\n\t\t\tif (this.RenderTarget.Value == null)\n\t\t\t{\n\t\t\t\tViewport vp = this.main.GraphicsDevice.Viewport;\n\t\t\t\tthis.draw(time, new Point(vp.Width, vp.Height));\n\t\t\t}\n\t\t}\n\n\t\tvoid IDrawablePreFrameComponent.DrawPreFrame(GameTime time, RenderParameters parameters)\n\t\t{\n\t\t\tif (this.needResize)\n\t\t\t\tthis.resize();\n\n\t\t\tif (this.RenderTarget.Value != null)\n\t\t\t{\n\t\t\t\tthis.main.GraphicsDevice.SetRenderTarget(this.RenderTarget);\n\t\t\t\tthis.main.GraphicsDevice.Clear(this.RenderTargetBackground);\n\t\t\t\tthis.draw(time, this.RenderTargetSize);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void delete()\n\t\t{\n\t\t\tbase.delete();\n\t\t\tif (this.RenderTarget.Value != null)\n\t\t\t{\n\t\t\t\tthis.RenderTarget.Value.Dispose();\n\t\t\t\tthis.RenderTarget.Value = null;\n\t\t\t}\n\t\t\tthis.main.GraphicsDevice.DeviceReset -= this.deviceReset;\n\t\t\tthis.main.RemoveComponent(this.Root);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/Algorithms.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Lemma.Util\n{\n\tpublic static class Algorithms\n\t{\n\t\tpublic static void InsertionSort<T>(this IList<T> list, Comparison<T> comparison)\n\t\t{\n\t\t\tint count = list.Count;\n\t\t\tfor (int j = 1; j < count; j++)\n\t\t\t{\n\t\t\t\tT key = list[j];\n\n\t\t\t\tint i = j - 1;\n\t\t\t\tfor (; i >= 0 && comparison(list[i], key) > 0; i--)\n\t\t\t\t\tlist[i + 1] = list[i];\n\t\t\t\tif (i != j - 1)\n\t\t\t\t\tlist[i + 1] = key;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/AngleTools.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Lemma.Util\n{\n\tpublic static class AngleTools\n\t{\n\t\tconst float twoPi = (float)Math.PI * 2.0f;\n\t\tconst float pi = (float)Math.PI;\n\t\t// Converts the given angle (in radians) to the range (-pi, pi)\n\t\tpublic static float ToAngleRange(this float angle)\n\t\t{\n\t\t\twhile (angle > pi)\n\t\t\t\tangle -= twoPi;\n\t\t\twhile (angle < -pi)\n\t\t\t\tangle += twoPi;\n\t\t\treturn angle;\n\t\t}\n\n\t\tpublic static float ClosestAngle(this float angle, float other)\n\t\t{\n\t\t\twhile (angle > other + pi)\n\t\t\t\tangle -= twoPi;\n\t\t\twhile (angle < other - pi)\n\t\t\t\tangle += twoPi;\n\t\t\treturn angle;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/BSpline.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Util\n{\n\tpublic class BSpline\n\t{\n\t\tpublic struct ControlPoint\n\t\t{\n\t\t\tpublic Vector3 Position;\n\t\t\tpublic Quaternion Orientation;\n\t\t\tpublic float Offset;\n\t\t\tpublic float FieldOfView;\n\n\t\t\tpublic static ControlPoint Lerp(ControlPoint a, ControlPoint b, float x)\n\t\t\t{\n\t\t\t\tControlPoint result;\n\t\t\t\tresult.Position = Vector3.Lerp(a.Position, b.Position, x);\n\t\t\t\tresult.Orientation = Quaternion.Lerp(a.Orientation, b.Orientation, x);\n\t\t\t\tresult.Offset = MathHelper.Lerp(a.Offset, b.Offset, x);\n\t\t\t\tresult.FieldOfView = MathHelper.Lerp(a.FieldOfView, b.FieldOfView, x);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\tconst int order = 2;\n\t\tprivate List<ControlPoint> points = new List<ControlPoint>();\n\n\t\tpublic float Duration;\n\n\t\tprivate float knot(int i)\n\t\t{\n\t\t\treturn MathHelper.Clamp((float)i / (float)this.points.Count, 0.0f, 1.0f);\n\t\t}\n\n\t\tprivate ControlPoint deBoor(int k, int i, float x)\n\t\t{\n\t\t\tif (k == 0)\n\t\t\t\treturn this.points[Math.Max(0, Math.Min(i + 1, this.points.Count - 1))];\n\t\t\telse\n\t\t\t{\n\t\t\t\tfloat pre = (x - this.knot(i)) / (this.knot(i + order + 1 - k) - this.knot(i));\n\t\t\t\tControlPoint a = this.deBoor(k - 1, i - 1, x);\n\t\t\t\tControlPoint b = this.deBoor(k - 1, i, x);\n\t\t\t\treturn ControlPoint.Lerp(a, b, pre);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Add(Vector3 pos, Quaternion q = default(Quaternion), float offset = 0.0f, float fov = 80.0f)\n\t\t{\n\t\t\tthis.points.Add(new ControlPoint { Position = pos, Orientation = q, Offset = offset, FieldOfView = MathHelper.ToRadians(fov) });\n\t\t}\n\n\t\tpublic ControlPoint Evaluate(float x)\n\t\t{\n\t\t\tControlPoint result = default(ControlPoint);\n\t\t\tif (this.points.Count == 2)\n\t\t\t\tresult = ControlPoint.Lerp(this.points[0], this.points[1], x);\n\t\t\telse\n\t\t\t\tresult = this.deBoor(order, (int)(x * this.points.Count), x);\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/BitWorker.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Lemma.Util\n{\n\tpublic static class BitWorker\n\t{\n\t\tpublic static bool BitSet(this byte toCheck, int index)\n\t\t{\n\t\t\treturn ((toCheck & ((byte)1 << index)) != 0);\n\t\t}\n\n\t\tpublic static bool BitSet(this short toCheck, int index)\n\t\t{\n\t\t\treturn ((toCheck & ((short)1 << index)) != 0);\n\t\t}\n\n\t\tpublic static bool BitSet(this int toCheck, int index)\n\t\t{\n\t\t\treturn ((toCheck & ((int)1 << index)) != 0);\n\t\t}\n\n\t\tpublic static bool BitSet(this long toCheck, int index)\n\t\t{\n\t\t\treturn ((toCheck & ((long)1 << index)) != 0);\n\t\t}\n\n\t\tpublic static byte SetBit(this byte toSet, int index, bool set = true)\n\t\t{\n\t\t\tif (set)\n\t\t\t{\n\t\t\t\treturn (byte)(toSet | ~(1 << index));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn (byte)(toSet & ~(1 << index));\n\t\t\t}\n\t\t}\n\n\t\tpublic static short SetBit(this short toSet, int index, bool set = true)\n\t\t{\n\t\t\tif (set)\n\t\t\t{\n\t\t\t\treturn (short)(toSet | ~(1 << index));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn (short)(toSet & ~(1 << index));\n\t\t\t}\n\t\t}\n\n\t\tpublic static int SetBit(this int toSet, int index, bool set = true)\n\t\t{\n\t\t\tif (set)\n\t\t\t{\n\t\t\t\treturn (toSet | (1 << index));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn (toSet & ~(1 << index));\n\t\t\t}\n\t\t}\n\n\t\tpublic static long SetBit(this long toSet, int index, bool set = true)\n\t\t{\n\t\t\tif (set)\n\t\t\t{\n\t\t\t\treturn (toSet | (1 << index));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn (toSet & ~(1 << index));\n\t\t\t}\n\t\t}\n\n\t\tpublic static short StoreByte(this short toSet, byte toStore, int index = 0)\n\t\t{\n\t\t\tif (index > 7) throw new ArgumentException(\"Index to store byte must not be over 7\");\n\t\t\tfor (int i = index; i < index + 8; i++)\n\t\t\t\ttoSet = toSet.SetBit(i, toStore.BitSet(i - index));\n\t\t\treturn toSet;\n\t\t}\n\n\t\tpublic static int StoreByte(this int toSet, byte toStore, int index = 0)\n\t\t{\n\t\t\tif (index > 24) throw new ArgumentException(\"Index to store byte must not be over 24\");\n\t\t\tfor (int i = index; i < index + 8; i++)\n\t\t\t\ttoSet = toSet.SetBit(i, toStore.BitSet(i - index));\n\t\t\treturn toSet;\n\t\t}\n\n\t\tpublic static int StoreShort(this int toSet, short toStore, int index = 0)\n\t\t{\n\t\t\tif (index > 16) throw new ArgumentException(\"Index to store byte must not be over 16\");\n\t\t\tfor (int i = index; i < index + 16; i++)\n\t\t\t\ttoSet = toSet.SetBit(i, toStore.BitSet(i - index));\n\t\t\treturn toSet;\n\t\t}\n\n\t\tpublic static long StoreByte(this long toSet, byte toStore, int index = 0)\n\t\t{\n\t\t\tif (index > 55) throw new ArgumentException(\"Index to store byte must not be over 55\");\n\t\t\tfor (int i = index; i < index + 8; i++)\n\t\t\t\ttoSet = toSet.SetBit(i, toStore.BitSet(i - index));\n\t\t\treturn toSet;\n\t\t}\n\n\t\tpublic static long StoreShort(this long toSet, short toStore, int index = 0)\n\t\t{\n\t\t\tif (index > 47) throw new ArgumentException(\"Index to store byte must not be over 47\");\n\t\t\tfor (int i = index; i < index + 16; i++)\n\t\t\t\ttoSet = toSet.SetBit(i, toStore.BitSet(i - index));\n\t\t\treturn toSet;\n\t\t}\n\n\t\tpublic static long StoreInt(this long toSet, int toStore, int index = 0)\n\t\t{\n\t\t\tif (index > 31) throw new ArgumentException(\"Index to store byte must not be over 31\");\n\t\t\tfor (int i = index; i < index + 32; i++)\n\t\t\t\ttoSet = toSet.SetBit(i, toStore.BitSet(i - index));\n\t\t\treturn toSet;\n\t\t}\n\n\t\tpublic static byte ExtractBits(this byte toExtract, int index, int num)\n\t\t{\n\t\t\tbyte ret = 0;\n\t\t\tfor (int i = index; i < index + num; i++)\n\t\t\t{\n\t\t\t\tret = ret.SetBit(i - index, toExtract.BitSet(i));\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic static short ExtractBits(this short toExtract, int index, int num)\n\t\t{\n\t\t\tshort ret = 0;\n\t\t\tfor (int i = index; i < index + num; i++)\n\t\t\t{\n\t\t\t\tret = ret.SetBit(i - index, toExtract.BitSet(i));\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic static int ExtractBits(this int toExtract, int index, int num)\n\t\t{\n\t\t\tint ret = 0;\n\t\t\tfor (int i = index; i < index + num; i++)\n\t\t\t{\n\t\t\t\tret = ret.SetBit(i - index, toExtract.BitSet(i));\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic static long ExtractBits(this long toExtract, int index, int num)\n\t\t{\n\t\t\tlong ret = 0;\n\t\t\tfor (int i = index; i < index + num; i++)\n\t\t\t{\n\t\t\t\tret = ret.SetBit(i - index, toExtract.BitSet(i));\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic static void PackInts(List<int> result, int numBitsPer, IList<int> ints)\n\t\t{\n\t\t\tint numBitsPerInt = sizeof(int) * 8;\n\t\t\tif (numBitsPer > numBitsPerInt)\n\t\t\t\tthrow new ArgumentException(\"You are an idiot.\");\n\t\t\tint currentInt = 0;\n\t\t\tint currentIntIndex = 0;\n\t\t\tint storingIntIndex = 0;\n\t\t\tint storingInt = 0;\n\t\t\tint i;\n\n\t\t\tfor (i = 0; i < ints.Count; i++)\n\t\t\t{\n\t\t\t\tint theInt = ints[i];\n\t\t\t\tif (theInt < 0)\n\t\t\t\t{\n\t\t\t\t\tints[i] = (-theInt).SetBit(numBitsPer - 1, true);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tints[i] = theInt.SetBit(numBitsPer - 1, false);\n\t\t\t\t}\n\t\t\t}\n\t\t\ti = 0;\n\t\t\t\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (i >= ints.Count)\n\t\t\t\t{\n\t\t\t\t\tif (currentIntIndex != 0)\n\t\t\t\t\t\tresult.Add(currentInt);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tstoringInt = ints[i];\n\t\t\t\t\n\t\t\t\tbool incrementI = (numBitsPer - storingIntIndex) <= (numBitsPerInt - currentIntIndex);\n\t\t\t\tfor (; storingIntIndex < numBitsPer; storingIntIndex++)\n\t\t\t\t{\n\t\t\t\t\t//We will NOT exhaust one of our ints for storing. That is, we will fully store this int.\n\t\t\t\t\tif (incrementI)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentInt = currentInt.SetBit(currentIntIndex++, storingInt.BitSet(storingIntIndex));\n\t\t\t\t\t}\n\t\t\t\t\t//We WILL NOT fully store this int.\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (currentIntIndex >= numBitsPerInt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tresult.Add(currentInt);\n\t\t\t\t\t\t\tcurrentIntIndex = 0;\n\t\t\t\t\t\t\tcurrentInt = 0;\n\t\t\t\t\t\t\tincrementI = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentInt = currentInt.SetBit(currentIntIndex++, storingInt.BitSet(storingIntIndex));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (currentIntIndex >= numBitsPerInt)\n\t\t\t\t{\n\t\t\t\t\tresult.Add(currentInt);\n\t\t\t\t\tcurrentIntIndex = 0;\n\t\t\t\t\tcurrentInt = 0;\n\t\t\t\t\tincrementI = true;\n\t\t\t\t}\n\t\t\t\tif (incrementI)\n\t\t\t\t{\n\t\t\t\t\ti++;\n\t\t\t\t\tstoringIntIndex = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static int[] UnPackInts(int numBitsPer, int numToPull, IList<int> ints)\n\t\t{\n\t\t\tint numBitsPerInt = 32;\n\t\t\tif (numBitsPer > numBitsPerInt) throw new ArgumentException(\"You are an idiot.\");\n\n\t\t\tif (numToPull == -1)\n\t\t\t{\n\t\t\t\tnumToPull = (int)Math.Floor((float)(numBitsPerInt * ints.Count) / (float)numBitsPer);\n\t\t\t}\n\n\t\t\tList<int> ret = new List<int>();\n\t\t\tint currentInt = 0;\n\t\t\tint currentIntIndex = 0;\n\t\t\tint unPackingIntIndex = 0;\n\t\t\tint unPackingInt = 0;\n\t\t\tint i = 0;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (i >= ints.Count)\n\t\t\t\t{\n\t\t\t\t\tif (currentIntIndex != 0)\n\t\t\t\t\t\tret.Add(currentInt);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tunPackingInt = ints[i];\n\t\t\t\tfor (; unPackingIntIndex < numBitsPerInt; unPackingIntIndex++)\n\t\t\t\t{\n\t\t\t\t\tif (currentIntIndex >= numBitsPer)\n\t\t\t\t\t{\n\t\t\t\t\t\tret.Add(currentInt);\n\t\t\t\t\t\tcurrentIntIndex = 0;\n\t\t\t\t\t\tcurrentInt = 0;\n\t\t\t\t\t}\n\t\t\t\t\tcurrentInt = currentInt.SetBit(currentIntIndex++, unPackingInt.BitSet(unPackingIntIndex));\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t\tunPackingIntIndex = 0;\n\t\t\t}\n\t\t\tfor(i = 0; i < ret.Count; i++)\n\t\t\t{\n\t\t\t\tint b = ret[i];\n\t\t\t\tif (b.BitSet(numBitsPer - 1))\n\t\t\t\t{\n\t\t\t\t\tb = -(b.SetBit(numBitsPer - 1, false));\n\t\t\t\t\tret[i] = b;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ret.Count > numToPull) return ret.GetRange(0, numToPull).ToArray();\n\t\t\treturn ret.ToArray();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/BlockingQueue.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\nnamespace Lemma.Util\n{\n\tpublic class BlockingQueue<T>\n\t{\n\t\tprivate readonly Queue<T> queue = new Queue<T>();\n\n\t\tpublic int Count\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.queue.Count;\n\t\t\t}\n\t\t}\n\n\t\tprivate readonly int maxSize;\n\t\tpublic BlockingQueue(int maxSize = 0)\n\t\t{\n\t\t\tthis.maxSize = maxSize;\n\t\t}\n\n\t\tpublic void Enqueue(T item)\n\t\t{\n\t\t\tlock (this.queue)\n\t\t\t{\n\t\t\t\twhile (this.maxSize > 0 && this.queue.Count >= this.maxSize)\n\t\t\t\t\tMonitor.Wait(this.queue);\n\t\t\t\tif (!this.queue.Contains(item))\n\t\t\t\t{\n\t\t\t\t\tthis.queue.Enqueue(item);\n\t\t\t\t\tif (this.queue.Count == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t// wake up any blocked dequeue\n\t\t\t\t\t\tMonitor.PulseAll(this.queue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Clear()\n\t\t{\n\t\t\tlock (this.queue)\n\t\t\t{\n\t\t\t\tthis.queue.Clear();\n\t\t\t\tif (this.maxSize > 0)\n\t\t\t\t{\n\t\t\t\t\t// wake up any blocked enqueue\n\t\t\t\t\tMonitor.PulseAll(this.queue);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic T Dequeue()\n\t\t{\n\t\t\tlock (this.queue)\n\t\t\t{\n\t\t\t\twhile (this.queue.Count == 0)\n\t\t\t\t\tMonitor.Wait(this.queue);\n\t\t\t\tT item = this.queue.Dequeue();\n\t\t\t\tif (this.maxSize > 0 && this.queue.Count == this.maxSize - 1)\n\t\t\t\t{\n\t\t\t\t\t// wake up any blocked enqueue\n\t\t\t\t\tMonitor.PulseAll(this.queue);\n\t\t\t\t}\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Util/BoundingBoxExtensions.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Util\n{\n\tpublic static class BoundingBoxExtensions\n\t{\n\t\tprivate static Vector3[] cornerCache = new Vector3[8];\n\t\tpublic static BoundingBox Transform(this BoundingBox box, Matrix matrix)\n\t\t{\n\t\t\tcornerCache[0] = new Vector3(box.Min.X, box.Min.Y, box.Min.Z);\n\t\t\tcornerCache[1] = new Vector3(box.Min.X, box.Min.Y, box.Max.Z);\n\t\t\tcornerCache[2] = new Vector3(box.Min.X, box.Max.Y, box.Min.Z);\n\t\t\tcornerCache[3] = new Vector3(box.Min.X, box.Max.Y, box.Max.Z);\n\t\t\tcornerCache[4] = new Vector3(box.Max.X, box.Min.Y, box.Min.Z);\n\t\t\tcornerCache[5] = new Vector3(box.Max.X, box.Min.Y, box.Max.Z);\n\t\t\tcornerCache[6] = new Vector3(box.Max.X, box.Max.Y, box.Min.Z);\n\t\t\tcornerCache[7] = new Vector3(box.Max.X, box.Max.Y, box.Max.Z);\n\t\t\tVector3.Transform(cornerCache, ref matrix, cornerCache);\n\t\t\tbox.Min = new Vector3(float.MaxValue);\n\t\t\tbox.Max = new Vector3(float.MinValue);\n\t\t\tforeach (Vector3 corner in cornerCache)\n\t\t\t{\n\t\t\t\tbox.Min.X = Math.Min(box.Min.X, corner.X);\n\t\t\t\tbox.Min.Y = Math.Min(box.Min.Y, corner.Y);\n\t\t\t\tbox.Min.Z = Math.Min(box.Min.Z, corner.Z);\n\t\t\t\tbox.Max.X = Math.Max(box.Max.X, corner.X);\n\t\t\t\tbox.Max.Y = Math.Max(box.Max.Y, corner.Y);\n\t\t\t\tbox.Max.Z = Math.Max(box.Max.Z, corner.Z);\n\t\t\t}\n\t\t\treturn box;\n\t\t}\n\n\t\tpublic static BoundingBox Expand(this BoundingBox box, float amount)\n\t\t{\n\t\t\treturn new BoundingBox(box.Min - new Vector3(amount), box.Max + new Vector3(amount));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/CustomFluidVolume.cs",
    "content": "using System; using ComponentBind;\nusing System.Collections.Generic;\nusing BEPUphysics.BroadPhaseSystems;\nusing BEPUphysics.BroadPhaseEntries;\nusing BEPUphysics.BroadPhaseEntries.MobileCollidables;\nusing Microsoft.Xna.Framework;\nusing BEPUphysics.Threading;\nusing BEPUphysics.UpdateableSystems;\nusing Lemma.Components;\nusing BEPUphysics;\nusing System.Xml.Serialization;\n\nnamespace Lemma.Util\n{\n\n\t/// <summary>\n\t/// Volume in which physically simulated objects have a buoyancy force applied to them based on their density and volume.\n\t/// </summary>\n\tpublic class CustomFluidVolume : Updateable, IDuringForcesUpdateable\n\t{\n\t\t//The current FluidVolume implementation is awfully awful.\n\t\t//It only currently supports horizontal surface planes, since it uses\n\t\t//entity bounding boxes directly rather than using an affinely transformed bounding box.\n\t\t//The 'surfacetriangles' approach to fluid volumes is pretty goofy to begin with. \n\t\t//A mesh-based volume would be a lot better for content development.\n\n\t\tfloat surfacePlaneHeight;\n\t\tVector3 upVector;\n\t\t///<summary>\n\t\t/// Gets the up vector of the fluid volume.\n\t\t///</summary>\n\t\tpublic Vector3 UpVector\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn upVector;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tupVector = value;\n\t\t\t\tRecalculateBoundingBox();\n\t\t\t}\n\t\t}\n\n\t\tBoundingBox boundingBox;\n\t\t/// <summary>\n\t\t/// Bounding box surrounding the surface tris and entire depth of the object.\n\t\t/// </summary>\n\t\tpublic BoundingBox BoundingBox\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn boundingBox;\n\t\t\t}\n\t\t}\n\n\t\tfloat maxDepth;\n\t\t/// <summary>\n\t\t/// Maximum depth of the fluid from the surface.\n\t\t/// </summary>\n\t\tpublic float MaxDepth\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn maxDepth;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tmaxDepth = value;\n\t\t\t\tRecalculateBoundingBox();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Density of the fluid represented in the volume.\n\t\t/// </summary>\n\t\tpublic float Density { get; set; }\n\n\t\tint samplePointsPerDimension = 8;\n\t\t/// <summary>\n\t\t/// Number of locations along each of the horizontal axes from which to sample the shape.\n\t\t/// Defaults to 8.\n\t\t/// </summary>\n\t\tpublic int SamplePointsPerDimension\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn samplePointsPerDimension;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tsamplePointsPerDimension = value;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Fraction by which to reduce the linear momentum of floating objects each update.\n\t\t/// </summary>\n\t\tpublic float LinearDamping { get; set; }\n\n\t\t/// <summary>\n\t\t/// Fraction by which to reduce the angular momentum of floating objects each update.\n\t\t/// </summary>\n\t\tpublic float AngularDamping { get; set; }\n\n\n\n\t\tprivate Vector3 flowDirection;\n\t\t/// <summary>\n\t\t/// Direction in which to exert force on objects within the fluid.\n\t\t/// flowForce and maxFlowSpeed must have valid values as well for the flow to work.\n\t\t/// </summary>\n\t\tpublic Vector3 FlowDirection\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn flowDirection;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tfloat length = value.Length();\n\t\t\t\tif (length > 0)\n\t\t\t\t{\n\t\t\t\t\tflowDirection = value / length;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tflowDirection = Vector3.Zero;\n\t\t\t}\n\t\t}\n\n\t\tprivate float flowForce;\n\n\t\t/// <summary>\n\t\t/// Magnitude of the flow's force, in units of flow direction.\n\t\t/// flowDirection and maxFlowSpeed must have valid values as well for the flow to work.\n\t\t/// </summary>\n\t\tpublic float FlowForce\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn flowForce;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tflowForce = value;\n\t\t\t}\n\t\t}\n\n\t\tfloat maxFlowSpeed;\n\t\t/// <summary>\n\t\t/// Maximum speed of the flow; objects will not be accelerated by the flow force beyond this speed.\n\t\t/// flowForce and flowDirection must have valid values as well for the flow to work.\n\t\t/// </summary>\n\t\tpublic float MaxFlowSpeed\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn maxFlowSpeed;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tmaxFlowSpeed = value;\n\t\t\t}\n\n\t\t}\n\n\t\tIQueryAccelerator QueryAccelerator { get; set; }\n\n\t\t///<summary>\n\t\t/// Gets or sets the thread manager used by the fluid volume.\n\t\t///</summary>\n\t\tpublic IThreadManager ThreadManager { get; set; }\n\n\t\tprivate List<Vector3[]> surfaceTriangles;\n\t\t/// <summary>\n\t\t/// List of coplanar triangles composing the surface of the fluid.\n\t\t/// </summary>\n\t\tpublic List<Vector3[]> SurfaceTriangles\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn surfaceTriangles;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tsurfaceTriangles = value;\n\t\t\t\tRecalculateBoundingBox();\n\t\t\t}\n\t\t}\n\n\t\tfloat gravity;\n\t\t///<summary>\n\t\t/// Gets or sets the gravity used by the fluid volume.\n\t\t///</summary>\n\t\tpublic float Gravity\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn gravity;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tgravity = value;\n\t\t\t}\n\t\t}\n\n\n\n\t\t/// <summary>\n\t\t/// Creates a fluid volume.\n\t\t/// </summary>\n\t\t/// <param name=\"upVector\">Up vector of the fluid volume.</param>\n\t\t/// <param name=\"gravity\">Strength of gravity for the purposes of the fluid volume.</param>\n\t\t/// <param name=\"surfaceTriangles\">List of triangles composing the surface of the fluid.  Set up as a list of length 3 arrays of Vector3's.</param>\n\t\t/// <param name=\"depth\">Depth of the fluid back along the surface normal.</param>\n\t\t/// <param name=\"fluidDensity\">Density of the fluid represented in the volume.</param>\n\t\t/// <param name=\"linearDamping\">Fraction by which to reduce the linear momentum of floating objects each update, in addition to any of the body's own damping.</param>\n\t\t/// <param name=\"angularDamping\">Fraction by which to reduce the angular momentum of floating objects each update, in addition to any of the body's own damping.</param>\n\t\t/// <param name=\"queryAccelerator\">System to accelerate queries to find nearby entities.</param>\n\t\t/// <param name=\"threadManager\">Thread manager used by the fluid volume.</param>\n\t\tpublic CustomFluidVolume(Vector3 upVector, float gravity, List<Vector3[]> surfaceTriangles, float depth, float fluidDensity, float linearDamping, float angularDamping,\n\t\t\tIQueryAccelerator queryAccelerator, IThreadManager threadManager)\n\t\t{\n\t\t\tGravity = gravity;\n\t\t\tSurfaceTriangles = surfaceTriangles;\n\t\t\tMaxDepth = depth;\n\t\t\tDensity = fluidDensity;\n\t\t\tLinearDamping = linearDamping;\n\t\t\tAngularDamping = angularDamping;\n\n\t\t\tUpVector = upVector;\n\t\t\tQueryAccelerator = queryAccelerator;\n\t\t\tThreadManager = threadManager;\n\n\t\t\tanalyzeCollisionEntryDelegate = AnalyzeCollisionEntry;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Recalculates the bounding box of the fluid based on its depth, surface normal, and surface triangles.\n\t\t/// </summary>\n\t\tpublic void RecalculateBoundingBox()\n\t\t{\n\t\t\tvar points = BEPUutilities.ResourceManagement.CommonResources.GetVectorList();\n\t\t\tforeach (var tri in SurfaceTriangles)\n\t\t\t{\n\t\t\t\tpoints.Add(tri[0]);\n\t\t\t\tpoints.Add(tri[1]);\n\t\t\t\tpoints.Add(tri[2]);\n\t\t\t\tpoints.Add(tri[0] - upVector * MaxDepth);\n\t\t\t\tpoints.Add(tri[1] - upVector * MaxDepth);\n\t\t\t\tpoints.Add(tri[2] - upVector * MaxDepth);\n\t\t\t}\n\t\t\tboundingBox = BoundingBox.CreateFromPoints(points);\n\t\t\tsurfacePlaneHeight = Vector3.Dot(points[0], upVector);\n\t\t\tBEPUutilities.ResourceManagement.CommonResources.GiveBack(points);\n\t\t}\n\n\t\tList<BroadPhaseEntry> collisionEntries = new List<BroadPhaseEntry>();\n\n\t\t/// <summary>\n\t\t/// Applies buoyancy forces to appropriate objects.\n\t\t/// Called automatically when needed by the owning Space.\n\t\t/// </summary>\n\t\t/// <param name=\"dt\">Time since last frame in physical logic.</param>\n\t\tvoid IDuringForcesUpdateable.Update(float dt)\n\t\t{\n\t\t\tQueryAccelerator.GetEntries(boundingBox, collisionEntries);\n\t\t\t//Could integrate the entire thing into the collision detection pipeline.  Applying forces\n\t\t\t//in the collision detection pipeline isn't allowed, so there'd still need to be an Updateable involved.\n\t\t\t//However, the broadphase query would be eliminated and the raycasting work would be automatically multithreaded.\n\n\t\t\tthis.dt = dt;\n\t\t\t\n\t\t\t//Don't always multithread.  For small numbers of objects, the overhead of using multithreading isn't worth it.\n\t\t\t//Could tune this value depending on platform for better performance.\n\t\t\tif (collisionEntries.Count > 30 && ThreadManager.ThreadCount > 1)\n\t\t\t\tThreadManager.ForLoop(0, collisionEntries.Count, analyzeCollisionEntryDelegate);\n\t\t\telse\n\t\t\t\tfor (int i = 0; i < collisionEntries.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tAnalyzeCollisionEntry(i);\n\t\t\t\t}\n\n\t\t\tcollisionEntries.Clear();\n\t\t}\n\n\t\tpublic List<EntityCollidable> NotifyEntries = new List<EntityCollidable>();\n\n\t\tfloat dt;\n\t\tAction<int> analyzeCollisionEntryDelegate;\n\n\t\tvoid AnalyzeCollisionEntry(int i)\n\t\t{\n\t\t\tvar entityEntry = collisionEntries[i] as EntityCollidable;\n\t\t\tif (entityEntry != null && entityEntry.Entity.ActivityInformation.IsActive && entityEntry.Entity.IsDynamic)\n\t\t\t{\n\t\t\t\tbool keepGoing = false;\n\t\t\t\tforeach (var tri in surfaceTriangles)\n\t\t\t\t{\n\t\t\t\t\t//Don't need to do anything if the entity is outside of the water.\n\t\t\t\t\tVector3 pos = entityEntry.WorldTransform.Position;\n\t\t\t\t\tif (BEPUutilities.Toolbox.IsPointInsideTriangle(ref tri[0], ref tri[1], ref tri[2], ref pos))\n\t\t\t\t\t{\n\t\t\t\t\t\tkeepGoing = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!keepGoing)\n\t\t\t\t\treturn;\n\n\t\t\t\t//The entity is submerged, apply buoyancy forces.\n\t\t\t\tfloat submergedVolume;\n\t\t\t\tVector3 submergedCenter;\n\t\t\t\tGetBuoyancyInformation(entityEntry, out submergedVolume, out submergedCenter);\n\t\t\t\tif (submergedVolume > 0)\n\t\t\t\t{\n\t\t\t\t\tVector3 force;\n\t\t\t\t\tVector3.Multiply(ref upVector, -gravity * Density * dt * submergedVolume, out force);\n\t\t\t\t\tentityEntry.Entity.ApplyImpulse(ref submergedCenter, ref force);\n\n\t\t\t\t\tfloat fractionSubmerged = submergedVolume / entityEntry.Entity.Volume;\n\t\t\t\t\t//Flow\n\t\t\t\t\tif (FlowForce != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat dot = Math.Max(Vector3.Dot(entityEntry.Entity.LinearVelocity, flowDirection), 0);\n\t\t\t\t\t\tif (dot < MaxFlowSpeed)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforce = Math.Min(FlowForce, (MaxFlowSpeed - dot) * entityEntry.Entity.Mass) * dt * fractionSubmerged * FlowDirection;\n\t\t\t\t\t\t\tentityEntry.Entity.ApplyLinearImpulse(ref force);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//Damping\n\t\t\t\t\tentityEntry.Entity.ModifyLinearDamping(fractionSubmerged * LinearDamping);\n\t\t\t\t\tentityEntry.Entity.ModifyAngularDamping(fractionSubmerged * AngularDamping);\n\n\t\t\t\t\tif (submergedVolume < entityEntry.Entity.Volume)\n\t\t\t\t\t{\n\t\t\t\t\t\t// The entity is intersecting the surface\n\t\t\t\t\t\tIComponent tag = entityEntry.Tag as IComponent ?? entityEntry.Entity.Tag as IComponent;\n\t\t\t\t\t\tif (tag != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (this.NotifyEntries)\n\t\t\t\t\t\t\t\tthis.NotifyEntries.Add(entityEntry);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvoid GetBuoyancyInformation(EntityCollidable info, out float submergedVolume, out Vector3 submergedCenter)\n\t\t{\n\t\t\tBoundingBox entityBoundingBox;\n\t\t\tentityBoundingBox = info.BoundingBox;// new BoundingBox();\n\t\t\t//info.ComputeBoundingBox(ref surfaceOrientationTranspose, out entityBoundingBox);\n\t\t\tif (entityBoundingBox.Min.Y > surfacePlaneHeight)\n\t\t\t{\n\t\t\t\t//Fish out of the water.  Don't need to do raycast tests on objects not at the boundary.\n\t\t\t\tsubmergedVolume = 0;\n\t\t\t\tsubmergedCenter = info.WorldTransform.Position;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (entityBoundingBox.Max.Y < surfacePlaneHeight)\n\t\t\t{\n\t\t\t\tsubmergedVolume = info.Entity.Volume;\n\t\t\t\tsubmergedCenter = info.WorldTransform.Position;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tVector3 origin, xSpacing, zSpacing;\n\t\t\tfloat perColumnArea;\n\t\t\tGetSamplingOrigin(ref entityBoundingBox, out xSpacing, out zSpacing, out perColumnArea, out origin);\n\n\t\t\tfloat boundingBoxHeight = entityBoundingBox.Max.Y - entityBoundingBox.Min.Y;\n\t\t\tfloat maxLength = surfacePlaneHeight - entityBoundingBox.Min.Y;\n\t\t\tsubmergedCenter = new Vector3();\n\t\t\tsubmergedVolume = 0;\n\t\t\tfor (int i = 0; i < samplePointsPerDimension; i++)\n\t\t\t{\n\t\t\t\tfor (int j = 0; j < samplePointsPerDimension; j++)\n\t\t\t\t{\n\t\t\t\t\tVector3 columnVolumeCenter;\n\t\t\t\t\tfloat submergedHeight;\n\t\t\t\t\tif ((submergedHeight = GetSubmergedHeight(info, maxLength, boundingBoxHeight, ref origin, ref xSpacing, ref zSpacing, i, j, out columnVolumeCenter)) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat columnVolume = submergedHeight * perColumnArea;\n\t\t\t\t\t\tVector3.Multiply(ref columnVolumeCenter, columnVolume, out columnVolumeCenter);\n\t\t\t\t\t\tVector3.Add(ref columnVolumeCenter, ref submergedCenter, out submergedCenter);\n\t\t\t\t\t\tsubmergedVolume += columnVolume;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tVector3.Divide(ref submergedCenter, submergedVolume, out submergedCenter);\n\n\t\t}\n\n\t\tvoid GetSamplingOrigin(ref BoundingBox entityBoundingBox, out Vector3 xSpacing, out Vector3 zSpacing, out float perColumnArea, out Vector3 origin)\n\t\t{\n\t\t\t//Compute spacing and increment informaiton.\n\t\t\tfloat widthIncrement = (entityBoundingBox.Max.X - entityBoundingBox.Min.X) / samplePointsPerDimension;\n\t\t\tfloat lengthIncrement = (entityBoundingBox.Max.Z - entityBoundingBox.Min.Z) / samplePointsPerDimension;\n\t\t\tVector3 right = BEPUutilities.Toolbox.RightVector;// new Vector3(surfaceOrientationTranspose.M11, surfaceOrientationTranspose.M21, surfaceOrientationTranspose.M31);\n\t\t\tVector3.Multiply(ref right, widthIncrement, out xSpacing);\n\t\t\tVector3 backward = BEPUutilities.Toolbox.BackVector;// new Vector3(surfaceOrientationTranspose.M13, surfaceOrientationTranspose.M23, surfaceOrientationTranspose.M33);\n\t\t\tVector3.Multiply(ref backward, lengthIncrement, out zSpacing);\n\t\t\tperColumnArea = widthIncrement * lengthIncrement;\n\n\n\t\t\t//Compute the origin.\n\t\t\tVector3 minimum = entityBoundingBox.Min;\n\t\t\t//Matrix3X3.TransformTranspose(ref entityBoundingBox.Min, ref surfaceOrientationTranspose, out minimum);\n\t\t\tVector3 offset;\n\t\t\tVector3.Multiply(ref xSpacing, .5f, out offset);\n\t\t\tVector3.Add(ref minimum, ref offset, out origin);\n\t\t\tVector3.Multiply(ref zSpacing, .5f, out offset);\n\t\t\tVector3.Add(ref origin, ref offset, out origin);\n\n\n\t\t\t// Could adjust the grid origin such that a ray always hits the deepest point.\n\t\t\t//The below code is a prototype of the idea, but has bugs.\n\t\t\t//var convexInfo = info as ConvexCollisionInformation;\n\t\t\t//if (convexInfo != null)\n\t\t\t//{\n\t\t\t//    Vector3 dir;\n\t\t\t//    Vector3.Negate(ref upVector, out dir);\n\t\t\t//    Vector3 extremePoint;\n\t\t\t//    convexInfo.Shape.GetExtremePoint(dir, ref convexInfo.worldTransform, out extremePoint);\n\t\t\t//    //Use extreme point to snap to grid.\n\t\t\t//    Vector3.Subtract(ref extremePoint, ref origin, out offset);\n\t\t\t//    float offsetX, offsetZ;\n\t\t\t//    Vector3.Dot(ref offset, ref right, out offsetX);\n\t\t\t//    Vector3.Dot(ref offset, ref backward, out offsetZ);\n\t\t\t//    offsetX %= widthIncrement;\n\t\t\t//    offsetZ %= lengthIncrement;\n\n\t\t\t//    if (offsetX > .5f * widthIncrement)\n\t\t\t//    {\n\t\t\t//        Vector3.Multiply(ref right, 1 - offsetX, out offset);\n\t\t\t//    }\n\t\t\t//    else\n\t\t\t//    {\n\t\t\t//        Vector3.Multiply(ref right, -offsetX, out offset);\n\t\t\t//    }\n\n\t\t\t//    if (offsetZ > .5f * lengthIncrement)\n\t\t\t//    {\n\t\t\t//        Vector3 temp;\n\t\t\t//        Vector3.Multiply(ref right, 1 - offsetZ, out temp);\n\t\t\t//        Vector3.Add(ref temp, ref offset, out offset);\n\t\t\t//    }\n\t\t\t//    else\n\t\t\t//    {\n\t\t\t//        Vector3 temp;\n\t\t\t//        Vector3.Multiply(ref right, -offsetZ, out temp);\n\t\t\t//        Vector3.Add(ref temp, ref offset, out offset);\n\t\t\t//    }\n\n\t\t\t//    Vector3.Add(ref origin, ref offset, out origin);\n\n\n\t\t\t//}\n\t\t}\n\n\t\tfloat GetSubmergedHeight(Collidable info, float maxLength, float boundingBoxHeight, ref Vector3 rayOrigin, ref Vector3 xSpacing, ref Vector3 zSpacing, int i, int j, out Vector3 volumeCenter)\n\t\t{\n\t\t\tRay ray;\n\t\t\tVector3.Multiply(ref xSpacing, i, out ray.Position);\n\t\t\tVector3.Multiply(ref zSpacing, j, out ray.Direction);\n\t\t\tVector3.Add(ref ray.Position, ref ray.Direction, out ray.Position);\n\t\t\tVector3.Add(ref ray.Position, ref rayOrigin, out ray.Position);\n\t\t\tray.Direction = upVector;\n\t\t\t//do a bottom-up raycast.\n\t\t\tBEPUutilities.RayHit rayHit;\n\t\t\t//Only go up to maxLength.  If it's further away than maxLength, then it's above the water and it doesn't contribute anything.\n\t\t\tif (info.RayCast(ray, maxLength, out rayHit))\n\t\t\t{\n\t\t\t\t//Position the ray to point from the other side.\n\t\t\t\tVector3.Multiply(ref ray.Direction, boundingBoxHeight, out ray.Direction);\n\t\t\t\tVector3.Add(ref ray.Position, ref ray.Direction, out ray.Position);\n\t\t\t\tVector3.Negate(ref upVector, out ray.Direction);\n\t\t\t\tfloat bottomY = rayHit.Location.Y;\n\t\t\t\tfloat bottom = rayHit.T;\n\t\t\t\tVector3 bottomPosition = rayHit.Location;\n\t\t\t\tif (info.RayCast(ray, boundingBoxHeight - rayHit.T, out rayHit))\n\t\t\t\t{\n\t\t\t\t\tVector3.Add(ref rayHit.Location, ref bottomPosition, out volumeCenter);\n\t\t\t\t\tVector3.Multiply(ref volumeCenter, .5f, out volumeCenter);\n\t\t\t\t\treturn Math.Min(surfacePlaneHeight - bottomY, boundingBoxHeight - rayHit.T - bottom);\n\t\t\t\t}\n\t\t\t\t//This inner raycast should always hit, but just in case it doesn't due to some numerical problem, give it a graceful way out.\n\t\t\t\tvolumeCenter = Vector3.Zero;\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvolumeCenter = Vector3.Zero;\n\t\t\treturn 0;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Util/DialogueForest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Newtonsoft.Json;\nusing ComponentBind;\nusing Newtonsoft.Json.Converters;\n\nnamespace Lemma.Util\n{\n\tpublic class DialogueForest\n\t{\n\t\tpublic interface IClient\n\t\t{\n\t\t\tvoid Visit(Node node);\n\t\t\tvoid Text(Node node, int level);\n\t\t\tvoid Choice(Node node, IEnumerable<Node> choices);\n\t\t\tvoid Set(string key, string value);\n\t\t\tstring Get(string key);\n\t\t}\n\n\t\tpublic class Node\n\t\t{\n\t\t\tpublic enum Type\n\t\t\t{\n\t\t\t\tNode, Text, Choice, Branch, Set\n\t\t\t}\n\t\t\tpublic string next;\n\t\t\tpublic List<string> choices;\n\t\t\tpublic Dictionary<string, string> branches;\n\t\t\tpublic string id;\n\t\t\tpublic string name;\n\t\t\tpublic string variable;\n\t\t\tpublic string value;\n\t\t\tpublic Type type;\n\t\t}\n\n\t\tprivate Dictionary<string, Node> nodes = new Dictionary<string, Node>();\n\t\tprivate Dictionary<string, Node> nodesByName = new Dictionary<string, Node>();\n\n\t\tpublic IEnumerable<Node> Load(string data)\n\t\t{\n\t\t\tList<Node> nodes = JsonConvert.DeserializeObject<List<Node>>(data);\n\n\t\t\tforeach (Node node in nodes)\n\t\t\t{\n\t\t\t\tthis.nodes[node.id] = node;\n\t\t\t\tif (node.name != null)\n\t\t\t\t\tthis.nodesByName[node.name] = node;\n\t\t\t}\n\t\t\treturn nodes;\n\t\t}\n\n\t\tpublic Node this[string id]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tNode result;\n\t\t\t\tthis.nodes.TryGetValue(id, out result);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\tpublic Node GetByName(string name)\n\t\t{\n\t\t\tNode result;\n\t\t\tthis.nodesByName.TryGetValue(name, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic IEnumerable<Node> Nodes\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.nodes.Values;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Validate(Strings strings)\n\t\t{\n#if DEBUG\n\t\t\tforeach (Node n in this.nodes.Values)\n\t\t\t{\n\t\t\t\tif ((n.type == Node.Type.Choice || n.type == Node.Type.Text) && !strings.HasKey(n.name))\n\t\t\t\t\tLog.d(string.Format(\"Invalid dialogue {0} \\\"{1}\\\"\", n.type.ToString(), n.name));\n\t\t\t}\n#endif\n\t\t}\n\n\t\tpublic void Execute(Node node, IClient client, int textLevel = 1)\n\t\t{\n\t\t\tclient.Visit(node);\n\t\t\tstring next = null;\n\t\t\tswitch (node.type)\n\t\t\t{\n\t\t\t\tcase Node.Type.Node:\n\t\t\t\t\tif (node.choices != null && node.choices.Count > 0)\n\t\t\t\t\t\tclient.Choice(node, node.choices.Select(x => this[x]));\n\t\t\t\t\tnext = node.next;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Node.Type.Text:\n\t\t\t\t\tclient.Text(node, textLevel);\n\t\t\t\t\tif (node.choices != null && node.choices.Count > 0)\n\t\t\t\t\t\tclient.Choice(node, node.choices.Select(x => this[x]));\n\t\t\t\t\tnext = node.next;\n\t\t\t\t\ttextLevel++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Node.Type.Set:\n\t\t\t\t\tclient.Set(node.variable, node.value);\n\t\t\t\t\tnext = node.next;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Node.Type.Branch:\n\t\t\t\t\tstring key = client.Get(node.variable);\n\t\t\t\t\tif (key == null || !node.branches.TryGetValue(key, out next))\n\t\t\t\t\t\tnode.branches.TryGetValue(\"_default\", out next);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (next != null)\n\t\t\t\tthis.Execute(this[next], client, textLevel);\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Util/Direction.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\nusing Lemma.Components;\n\nnamespace Lemma.Util\n{\n\tpublic enum Direction { PositiveX, NegativeX, PositiveY, NegativeY, PositiveZ, NegativeZ, None }\n\n\tpublic static class VectorDirectionExtensions\n\t{\n\t\tpublic static float GetComponent(this Vector3 vector, Direction dir)\n\t\t{\n\t\t\tswitch (dir)\n\t\t\t{\n\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\treturn -vector.X;\n\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\treturn vector.X;\n\t\t\t\tcase Direction.NegativeY:\n\t\t\t\t\treturn -vector.Y;\n\t\t\t\tcase Direction.PositiveY:\n\t\t\t\t\treturn vector.Y;\n\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\treturn -vector.Z;\n\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\treturn vector.Z;\n\t\t\t\tdefault:\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Vector3 SetComponent(this Vector3 vector, Direction dir, float value)\n\t\t{\n\t\t\tswitch (dir)\n\t\t\t{\n\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\treturn new Vector3(-value, vector.Y, vector.Z);\n\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\treturn new Vector3(value, vector.Y, vector.Z);\n\t\t\t\tcase Direction.NegativeY:\n\t\t\t\t\treturn new Vector3(vector.X, -value, vector.Z);\n\t\t\t\tcase Direction.PositiveY:\n\t\t\t\t\treturn new Vector3(vector.X, value, vector.Z);\n\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\treturn new Vector3(vector.X, vector.Y, -value);\n\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\treturn new Vector3(vector.X, vector.Y, value);\n\t\t\t\tdefault:\n\t\t\t\t\treturn vector;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static class DirectionExtensions\n\t{\n\t\tpublic static Direction[] Directions = new Direction[] { Direction.PositiveX, Direction.NegativeX, Direction.PositiveY, Direction.NegativeY, Direction.PositiveZ, Direction.NegativeZ };\n\t\tpublic static Direction[] HorizontalDirections = new Direction[] { Direction.PositiveX, Direction.NegativeX, Direction.PositiveZ, Direction.NegativeZ };\n\n\t\tpublic static Direction GetDirectionFromVector(Vector2 dir)\n\t\t{\n\t\t\tif (Math.Abs(dir.X) > Math.Abs(dir.Y))\n\t\t\t\treturn dir.X > 0.0f ? Direction.PositiveX : (dir.X < 0.0f ? Direction.NegativeX : Direction.None);\n\t\t\telse\n\t\t\t\treturn dir.Y > 0.0f ? Direction.PositiveZ : (dir.Y < 0.0f ? Direction.NegativeZ : Direction.None);\n\t\t}\n\n\t\tpublic static bool IsNegative(this Direction dir)\n\t\t{\n\t\t\treturn dir == Direction.NegativeX || dir == Direction.NegativeY || dir == Direction.NegativeZ;\n\t\t}\n\n\t\tpublic static Direction Cross(this Direction a, Direction b)\n\t\t{\n\t\t\tif (a.IsParallel(Direction.PositiveX) && b.IsParallel(Direction.PositiveY))\n\t\t\t\treturn Direction.PositiveZ;\n\t\t\telse if (a.IsParallel(Direction.PositiveX) && b.IsParallel(Direction.PositiveZ))\n\t\t\t\treturn Direction.PositiveY;\n\t\t\telse if (a.IsParallel(Direction.PositiveY) && b.IsParallel(Direction.PositiveX))\n\t\t\t\treturn Direction.PositiveZ;\n\t\t\telse if (a.IsParallel(Direction.PositiveY) && b.IsParallel(Direction.PositiveZ))\n\t\t\t\treturn Direction.PositiveX;\n\t\t\telse if (a.IsParallel(Direction.PositiveZ) && b.IsParallel(Direction.PositiveX))\n\t\t\t\treturn Direction.PositiveY;\n\t\t\telse if (a.IsParallel(Direction.PositiveZ) && b.IsParallel(Direction.PositiveY))\n\t\t\t\treturn Direction.PositiveX;\n\t\t\treturn Direction.None;\n\t\t}\n\n\t\tpublic static Direction GetDirectionFromVector(Vector3 dir)\n\t\t{\n\t\t\tfloat dx = Math.Abs(dir.X), dy = Math.Abs(dir.Y), dz = Math.Abs(dir.Z);\n\t\t\tif (dx > dy && dx > dz)\n\t\t\t\treturn dir.X > 0.0f ? Direction.PositiveX : Direction.NegativeX;\n\t\t\telse if (dy > dz)\n\t\t\t\treturn dir.Y > 0.0f ? Direction.PositiveY : Direction.NegativeY;\n\t\t\telse\n\t\t\t\treturn dir.Z > 0.0f ? Direction.PositiveZ : (dir.Z < 0.0f ? Direction.NegativeZ : Direction.None);\n\t\t}\n\n\t\tpublic static Direction GetDirectionFromName(string name)\n\t\t{\n\t\t\tswitch (name)\n\t\t\t{\n\t\t\t\tcase \"NegativeX\":\n\t\t\t\t\treturn Direction.NegativeX;\n\t\t\t\tcase \"PositiveX\":\n\t\t\t\t\treturn Direction.PositiveX;\n\t\t\t\tcase \"NegativeY\":\n\t\t\t\t\treturn Direction.NegativeY;\n\t\t\t\tcase \"PositiveY\":\n\t\t\t\t\treturn Direction.PositiveY;\n\t\t\t\tcase \"NegativeZ\":\n\t\t\t\t\treturn Direction.NegativeZ;\n\t\t\t\tcase \"PositiveZ\":\n\t\t\t\t\treturn Direction.PositiveZ;\n\t\t\t}\n\t\t\treturn Direction.None;\n\t\t}\n\n\t\tpublic static bool IsPositive(this Direction dir)\n\t\t{\n\t\t\treturn dir == Direction.PositiveX || dir == Direction.PositiveY || dir == Direction.PositiveZ;\n\t\t}\n\n\t\tpublic static bool IsPerpendicular(this Direction a, Direction b)\n\t\t{\n\t\t\treturn DirectionExtensions.isPerpendicular(a, b) || DirectionExtensions.isPerpendicular(b, a);\n\t\t}\n\n\t\tpublic static bool IsParallel(this Direction a, Direction b)\n\t\t{\n\t\t\treturn !DirectionExtensions.IsPerpendicular(a, b);\n\t\t}\n\n\t\tpublic static bool IsOpposite(this Direction a, Direction b)\n\t\t{\n\t\t\treturn b == a.GetReverse();\n\t\t}\n\n\t\tprivate static bool isPerpendicular(Direction a, Direction b)\n\t\t{\n\t\t\treturn ((a == Direction.NegativeX || a == Direction.PositiveX) && !(b == Direction.NegativeX || b == Direction.PositiveX))\n\t\t\t\t|| ((a == Direction.NegativeY || a == Direction.PositiveY) && !(b == Direction.NegativeY || b == Direction.PositiveY))\n\t\t\t\t|| ((a == Direction.NegativeZ || a == Direction.PositiveZ) && !(b == Direction.NegativeZ || b == Direction.PositiveZ));\n\t\t}\n\n\t\tpublic static Vector3 GetVector(this Direction dir)\n\t\t{\n\t\t\tswitch (dir)\n\t\t\t{\n\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\treturn new Vector3(-1.0f, 0.0f, 0.0f);\n\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\treturn new Vector3(1.0f, 0.0f, 0.0f);\n\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\treturn new Vector3(0.0f, 0.0f, -1.0f);\n\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\treturn new Vector3(0.0f, 0.0f, 1.0f);\n\t\t\t\tcase Direction.PositiveY:\n\t\t\t\t\treturn new Vector3(0.0f, 1.0f, 0.0f);\n\t\t\t\tcase Direction.NegativeY:\n\t\t\t\t\treturn new Vector3(0.0f, -1.0f, 0.0f);\n\t\t\t}\n\t\t\treturn Vector3.Zero;\n\t\t}\n\n\t\tpublic static Voxel.Coord GetCoordinate(this Direction dir)\n\t\t{\n\t\t\tswitch (dir)\n\t\t\t{\n\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\treturn new Voxel.Coord { X = -1, Y = 0, Z = 0 };\n\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\treturn new Voxel.Coord { X = 1, Y = 0, Z = 0 };\n\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\treturn new Voxel.Coord { X = 0, Y = 0, Z = -1 };\n\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\treturn new Voxel.Coord { X = 0, Y = 0, Z = 1 };\n\t\t\t\tcase Direction.PositiveY:\n\t\t\t\t\treturn new Voxel.Coord { X = 0, Y = 1, Z = 0 };\n\t\t\t\tcase Direction.NegativeY:\n\t\t\t\t\treturn new Voxel.Coord { X = 0, Y = -1, Z = 0 };\n\t\t\t}\n\t\t\treturn new Voxel.Coord { X = 0, Y = 0, Z = 0 };\n\t\t}\n\n\t\tpublic static Direction RotateCounterClockwise(this Direction dir)\n\t\t{\n\t\t\tswitch (dir)\n\t\t\t{\n\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\treturn Direction.PositiveZ;\n\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\treturn Direction.PositiveX;\n\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\treturn Direction.NegativeZ;\n\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\treturn Direction.NegativeX;\n\t\t\t}\n\t\t\treturn Direction.None;\n\t\t}\n\n\t\tpublic static Direction RotateClockwise(this Direction dir)\n\t\t{\n\t\t\tswitch (dir)\n\t\t\t{\n\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\treturn Direction.NegativeZ;\n\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\treturn Direction.PositiveX;\n\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\treturn Direction.PositiveZ;\n\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\treturn Direction.NegativeX;\n\t\t\t}\n\t\t\treturn Direction.None;\n\t\t}\n\n\t\tpublic static Direction GetReverse(this Direction dir)\n\t\t{\n\t\t\tswitch (dir)\n\t\t\t{\n\t\t\t\tcase Direction.NegativeX:\n\t\t\t\t\treturn Direction.PositiveX;\n\t\t\t\tcase Direction.PositiveX:\n\t\t\t\t\treturn Direction.NegativeX;\n\t\t\t\tcase Direction.NegativeZ:\n\t\t\t\t\treturn Direction.PositiveZ;\n\t\t\t\tcase Direction.PositiveZ:\n\t\t\t\t\treturn Direction.NegativeZ;\n\t\t\t\tcase Direction.PositiveY:\n\t\t\t\t\treturn Direction.NegativeY;\n\t\t\t\tcase Direction.NegativeY:\n\t\t\t\t\treturn Direction.PositiveY;\n\t\t\t}\n\t\t\treturn Direction.None;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/LambdaComparer.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Lemma.Util\n{\n\tpublic class LambdaComparer<T> : IComparer<T>\n\t{\n\t\tprivate readonly Func<T, T, int> lambda;\n\n\t\tpublic LambdaComparer(Func<T, T, int> _lambda)\n\t\t{\n\t\t\tif (_lambda == null)\n\t\t\t\tthrow new ArgumentNullException(\"_lambda\");\n\n\t\t\tthis.lambda = _lambda;\n\t\t}\n\n\t\tpublic int Compare(T x, T y)\n\t\t{\n\t\t\treturn this.lambda(x, y);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/LargeObjectHeap.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Lemma.Util\n{\n\tpublic class LargeObjectHeap<Type>\n\t{\n\t\tpublic static float GrowthFactor = 1.5f;\n\n\t\tprivate Dictionary<int, Queue<Type>> free = new Dictionary<int, Queue<Type>>();\n\n\t\tprivate static LargeObjectHeap<Type> instance;\n\n\t\tpublic static LargeObjectHeap<Type> Get(Func<int, Type> constructor)\n\t\t{\n\t\t\treturn LargeObjectHeap<Type>.Get(constructor, x => x > 1000);\n\t\t}\n\n\t\tpublic static LargeObjectHeap<Type> Get(Func<int, Type> constructor, Func<int, bool> reuse)\n\t\t{\n\t\t\tif (LargeObjectHeap<Type>.instance == null)\n\t\t\t{\n\t\t\t\tLargeObjectHeap<Type>.instance = new LargeObjectHeap<Type>();\n\t\t\t\tLargeObjectHeap<Type>.instance.constructor = constructor;\n\t\t\t\tLargeObjectHeap<Type>.instance.reuse = reuse;\n\t\t\t}\n\t\t\treturn LargeObjectHeap<Type>.instance;\n\t\t}\n\t\t\t\n\t\tprivate Func<int, Type> constructor;\n\t\tprivate Func<int, bool> reuse;\n\n\t\tprivate LargeObjectHeap()\n\t\t{\n\t\t}\n\n\t\tpublic Type Get(int size)\n\t\t{\n\t\t\tType t;\n\t\t\tQueue<Type> queue;\n\t\t\tif (reuse(size) && this.free.TryGetValue(size, out queue) && queue.Count > 0)\n\t\t\t\tt = queue.Dequeue();\n\t\t\telse\n\t\t\t\tt = this.constructor(size);\n\t\t\treturn t;\n\t\t}\n\n\t\tpublic void Free(int size, Type t)\n\t\t{\n\t\t\tif (this.reuse(size))\n\t\t\t{\n\t\t\t\tQueue<Type> queue;\n\t\t\t\tif (!this.free.TryGetValue(size, out queue))\n\t\t\t\t\tqueue = this.free[size] = new Queue<Type>();\n\t\t\t\tqueue.Enqueue(t);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/Noise3D.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Serialization;\nusing Microsoft.Xna.Framework;\nusing Lemma.Factories;\nusing ComponentBind;\nusing Lemma.Components;\n\nnamespace Lemma.Util\n{\n\tpublic class Noise3D\n\t{\n\t\t// =========================\n\t\t// Classic 2D and 3D perlin noise implementation\n\t\t// Adapted from http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf\n\t\t// =========================\n\n\t\t// Array of possible gradients to choose from for each cell.\n\t\t// The permutation array indexes into this array.\n\t\tprivate static Vector3[] gradients = new[]\n\t\t{\n\t\t\tnew Vector3(1, 1, 0),\n\t\t\tnew Vector3(-1, 1, 0),\n\t\t\tnew Vector3(1, -1, 0),\n\t\t\tnew Vector3(-1, -1, 0),\n\t\t\tnew Vector3(1, 0, 1),\n\t\t\tnew Vector3(-1, 0, 1),\n\t\t\tnew Vector3(1, 0, -1),\n\t\t\tnew Vector3(-1, 0, -1),\n\t\t\tnew Vector3(0, 1, 1),\n\t\t\tnew Vector3(0, -1, 1),\n\t\t\tnew Vector3(0, 1, -1),\n\t\t\tnew Vector3(0, -1, -1),\n\t\t};\n\n\t\t// Pseudo-random permutation index array.\n\t\t// This is actually constant in the reference implementation.\n\t\t// But we want a different map each time.\n\t\t// This way I could set a seed if I wanted to re-generate the same map later.\n\t\tprivate int[] permutations = new int[512];\n\n\t\tprivate static Random random = new Random();\n\n\t\tpublic Noise3D()\n\t\t{\n\t\t\tthis.reseed();\n\t\t}\n\n\t\tprivate void reseed()\n\t\t{\n\t\t\tfor (int i = 0; i < 512; i++)\n\t\t\t\tthis.permutations[i] = Noise3D.random.Next(256);\n\t\t}\n\n\t\tpublic Command Reseed = new Command();\n\n\t\t// Get a pseudo-random gradient for the given 2D cell\n\t\tprivate Vector2 gradientAtCell2d(int x, int y)\n\t\t{\n\t\t\tVector3 g = gradients[this.permutations[x + this.permutations[y]] % gradients.Length];\n\t\t\treturn new Vector2(g.X, g.Y);\n\t\t}\n\n\t\t// Get a psuedo-random gradient for the given 3D cell\n\t\tprivate Vector3 gradientAtCell3d(Voxel.Coord coord)\n\t\t{\n\t\t\treturn gradients[this.permutations[coord.X + this.permutations[coord.Y + this.permutations[coord.Z]]] % gradients.Length];\n\t\t}\n\n\t\t// f(x) = 6x^5 - 15x^4 + 10x^3\n\t\tprivate static float blendCurve(float t)\n\t\t{\n\t\t\treturn t * t * t * (t * (t * 6.0f - 15.0f) + 10.0f);\n\t\t}\n\n\t\t// Interpolate between two float values\n\t\tprivate static float lerp(float a, float b, float blend)\n\t\t{\n\t\t\treturn a + (blend * (b - a));\n\t\t}\n\n\t\t// Classic 2D perlin noise\n\t\tfloat noise2d(Vector2 pos)\n\t\t{\n\t\t\tint x = (int)Math.Floor(pos.X) & 255;\n\t\t\tint y = (int)Math.Floor(pos.Y) & 255;\n\t\t\t\n\t\t\tVector2 withinCell = pos - new Vector2(x, y);\n\t\t\t\n\t\t\t// Calculate contribution of gradients from each cell\n\t\t\tfloat contribution00 = Vector2.Dot(this.gradientAtCell2d(x, y), withinCell);\n\t\t\tfloat contribution01 = Vector2.Dot(this.gradientAtCell2d(x, y + 1), withinCell - new Vector2(0, 1));\n\t\t\tfloat contribution10 = Vector2.Dot(this.gradientAtCell2d(x + 1, y), withinCell - new Vector2(1, 0));\n\t\t\tfloat contribution11 = Vector2.Dot(this.gradientAtCell2d(x + 1, y + 1), withinCell - new Vector2(1, 1));\n\t\t\t\n\t\t\tVector2 blend = new Vector2(blendCurve(withinCell.X), blendCurve(withinCell.Y));\n\t\t\t\n\t\t\t// Interpolate along X\n\t\t\tfloat contribution0 = lerp(contribution00, contribution10, blend.X);\n\t\t\tfloat contribution1 = lerp(contribution01, contribution11, blend.X);\n\t\t\t\n\t\t\t// Interpolate along Y\n\t\t\treturn lerp(contribution0, contribution1, blend.Y);\n\t\t}\n\n\t\t// Classic 3D perlin noise\n\t\tfloat noise3d(Vector3 pos)\n\t\t{\n\t\t\tVoxel.Coord cell = new Voxel.Coord { X = (int)Math.Floor(pos.X) & 255, Y = (int)Math.Floor(pos.Y) & 255, Z = (int)Math.Floor(pos.Z) & 255 };\n\t\t\t\n\t\t\tpos.X = pos.X % 256;\n\t\t\tpos.Y = pos.Y % 256;\n\t\t\tpos.Z = pos.Z % 256;\n\t\t\tVector3 withinCell = pos - new Vector3(cell.X, cell.Y, cell.Z);\n\t\t\t\n\t\t\t// Calculate contribution of gradients from each cell\n\t\t\tfloat contribution000 = Vector3.Dot(this.gradientAtCell3d(cell), withinCell);\n\t\t\tfloat contribution001 = Vector3.Dot(this.gradientAtCell3d(cell.Move(0, 0, 1)), withinCell - new Vector3(0, 0, 1));\n\t\t\tfloat contribution010 = Vector3.Dot(this.gradientAtCell3d(cell.Move(0, 1, 0)), withinCell - new Vector3(0, 1, 0));\n\t\t\tfloat contribution011 = Vector3.Dot(this.gradientAtCell3d(cell.Move(0, 1, 1)), withinCell - new Vector3(0, 1, 1));\n\t\t\tfloat contribution100 = Vector3.Dot(this.gradientAtCell3d(cell.Move(1, 0, 0)), withinCell - new Vector3(1, 0, 0));\n\t\t\tfloat contribution101 = Vector3.Dot(this.gradientAtCell3d(cell.Move(1, 0, 1)), withinCell - new Vector3(1, 0, 1));\n\t\t\tfloat contribution110 = Vector3.Dot(this.gradientAtCell3d(cell.Move(1, 1, 0)), withinCell - new Vector3(1, 1, 0));\n\t\t\tfloat contribution111 = Vector3.Dot(this.gradientAtCell3d(cell.Move(1, 1, 1)), withinCell - new Vector3(1, 1, 1));\n\t\t\t\n\t\t\tVector3 blend = new Vector3(blendCurve(withinCell.X), blendCurve(withinCell.Y), blendCurve(withinCell.Z));\n\t\t\t\n\t\t\t// Interpolate along X\n\t\t\tfloat contribution00 = lerp(contribution000, contribution100, blend.X);\n\t\t\tfloat contribution01 = lerp(contribution001, contribution101, blend.X);\n\t\t\tfloat contribution10 = lerp(contribution010, contribution110, blend.X);\n\t\t\tfloat contribution11 = lerp(contribution011, contribution111, blend.X);\n\t\t\t\n\t\t\t// Interpolate along Y\n\t\t\tfloat contribution0 = lerp(contribution00, contribution10, blend.Y);\n\t\t\tfloat contribution1 = lerp(contribution01, contribution11, blend.Y);\n\t\t\t\n\t\t\t// Interpolate along Z\n\t\t\treturn lerp(contribution0, contribution1, blend.Z);\n\t\t}\n\n\t\t// =========================\n\t\t// Procedural generation of a voxel environment based on the above noise functions.\n\t\t// =========================\n\n\t\t// This is the density function that builds the environment.\n\t\t// We sample the noise function at different octaves and combine them together.\n\t\t// If its value sampled at a certain voxel cell is above a certain threshold,\n\t\t// we fill in that voxel cell.\n\t\tprivate float density(Voxel.Coord sample)\n\t\t{\n\t\t\tVector3 sampleVector = new Vector3(sample.X, sample.Y, sample.Z);\n\n\t\t\t// First octave\n\t\t\tfloat value = this.noise3d(sampleVector / this.PrimaryOctave1);\n\t\t\t\n\t\t\t// Second octave\n\t\t\tvalue += this.noise3d(sampleVector / this.PrimaryOctave2) * 0.8f;\n\t\t\t\n\t\t\t// Third octave\n\t\t\tvalue += this.noise3d(sampleVector / this.PrimaryOctave3) * 0.4f;\n\t\t\t\n\t\t\treturn value;\n\t\t}\n\n\t\tpublic Property<float> PrimaryOctave1 = new Property<float> { Value = 50.0f };\n\n\t\tpublic Property<float> PrimaryOctave2 = new Property<float> { Value = 20.0f };\n\n\t\tpublic Property<float> PrimaryOctave3 = new Property<float> { Value = 10.0f };\n\n\t\tpublic Property<float> SecondaryOctave = new Property<float> { Value = 30.0f };\n\n\t\tpublic Property<float> HeightOctave = new Property<float> { Value = 20.0f };\n\n\t\tpublic float Sample(Vector3 vector)\n\t\t{\n\t\t\treturn this.noise3d(vector);\n\t\t}\n\n\t\tpublic float Sample(Voxel voxel, Voxel.Coord coord, float octave)\n\t\t{\n\t\t\tcoord.X -= voxel.MinX;\n\t\t\tcoord.Y -= voxel.MinY;\n\t\t\tcoord.Z -= voxel.MinZ;\n\t\t\treturn this.noise3d(new Vector3(coord.X / octave, coord.Y / octave, coord.Z / octave));\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Util/PriorityQueue.cs",
    "content": "﻿// Stolen and adapted from http://www.codeguru.com/csharp/csharp/cs_misc/designtechniques/article.php/c12527\n\nusing System; using ComponentBind;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Lemma.Util\n{\n\tpublic class PriorityQueue<T>\n\t{\n\t\tprotected List<T> list = new List<T>();\n\t\tprotected IComparer<T> comparer;\n\n\t\tpublic PriorityQueue()\n\t\t{\n\t\t\tthis.comparer = Comparer<T>.Default;\n\t\t}\n\n\t\tpublic PriorityQueue(IComparer<T> comparer)\n\t\t{\n\t\t\tthis.comparer = comparer;\n\t\t}\n\n\t\tpublic PriorityQueue(IComparer<T> comparer, int capacity)\n\t\t{\n\t\t\tthis.comparer = comparer;\n\t\t\tthis.list.Capacity = capacity;\n\t\t}\n\n\t\tprotected void SwitchElements(int i, int j)\n\t\t{\n\t\t\tT h = this.list[i];\n\t\t\tthis.list[i] = this.list[j];\n\t\t\tthis.list[j] = h;\n\t\t}\n\n\t\tprotected virtual int OnCompare(int i, int j)\n\t\t{\n\t\t\treturn this.comparer.Compare(list[i], list[j]);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Push an object onto the PQ\n\t\t/// </summary>\n\t\t/// <param name=\"O\">The new object</param>\n\t\t/// <returns>The index in the list where the object is _now_. This will change when objects are taken from or put onto the PQ.</returns>\n\t\tpublic int Push(T item)\n\t\t{\n\t\t\tint p = this.list.Count, p2;\n\t\t\tthis.list.Add(item); // E[p] = O\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif (p == 0)\n\t\t\t\t\tbreak;\n\t\t\t\tp2 = (p - 1) / 2;\n\t\t\t\tif (this.OnCompare(p, p2) < 0)\n\t\t\t\t{\n\t\t\t\t\tthis.SwitchElements(p, p2);\n\t\t\t\t\tp = p2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tbreak;\n\t\t\t} while (true);\n\t\t\treturn p;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the smallest object and remove it.\n\t\t/// </summary>\n\t\t/// <returns>The smallest object</returns>\n\t\tpublic T Pop()\n\t\t{\n\t\t\tT result = this.list[0];\n\t\t\tint p = 0, p1, p2, pn;\n\t\t\tthis.list[0] = this.list[this.list.Count - 1];\n\t\t\tthis.list.RemoveAt(this.list.Count - 1);\n\t\t\tdo\n\t\t\t{\n\t\t\t\tpn = p;\n\t\t\t\tp1 = 2 * p + 1;\n\t\t\t\tp2 = 2 * p + 2;\n\t\t\t\tif (this.list.Count > p1 && this.OnCompare(p, p1) > 0) // links kleiner\n\t\t\t\t\tp = p1;\n\t\t\t\tif (this.list.Count > p2 && this.OnCompare(p, p2) > 0) // rechts noch kleiner\n\t\t\t\t\tp = p2;\n\n\t\t\t\tif (p == pn)\n\t\t\t\t\tbreak;\n\t\t\t\tthis.SwitchElements(p, pn);\n\t\t\t} while (true);\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Notify the PQ that the object at position i has changed\n\t\t/// and the PQ needs to restore order.\n\t\t/// Since you dont have access to any indexes (except by using the\n\t\t/// explicit IList.this) you should not call this function without knowing exactly\n\t\t/// what you do.\n\t\t/// </summary>\n\t\t/// <param name=\"i\">The index of the changed object.</param>\n\t\tpublic void Update(T item)\n\t\t{\n\t\t\tint i = this.list.IndexOf(item);\n\t\t\tint p = i, pn;\n\t\t\tint p1, p2;\n\t\t\tdo\t// aufsteigen\n\t\t\t{\n\t\t\t\tif (p == 0)\n\t\t\t\t\tbreak;\n\t\t\t\tp2 = (p - 1) / 2;\n\t\t\t\tif (this.OnCompare(p, p2) < 0)\n\t\t\t\t{\n\t\t\t\t\tthis.SwitchElements(p, p2);\n\t\t\t\t\tp = p2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tbreak;\n\t\t\t} while (true);\n\t\t\tif (p < i)\n\t\t\t\treturn;\n\t\t\tdo\t   // absteigen\n\t\t\t{\n\t\t\t\tpn = p;\n\t\t\t\tp1 = 2 * p + 1;\n\t\t\t\tp2 = 2 * p + 2;\n\t\t\t\tif (this.list.Count > p1 && this.OnCompare(p, p1) > 0) // links kleiner\n\t\t\t\t\tp = p1;\n\t\t\t\tif (this.list.Count > p2 && this.OnCompare(p, p2) > 0) // rechts noch kleiner\n\t\t\t\t\tp = p2;\n\n\t\t\t\tif (p == pn)\n\t\t\t\t\tbreak;\n\t\t\t\tthis.SwitchElements(p, pn);\n\t\t\t} while (true);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the smallest object without removing it.\n\t\t/// </summary>\n\t\t/// <returns>The smallest object</returns>\n\t\tpublic T Peek()\n\t\t{\n\t\t\tif (this.list.Count > 0)\n\t\t\t\treturn this.list[0];\n\t\t\treturn default(T);\n\t\t}\n\n\t\tpublic void Clear()\n\t\t{\n\t\t\tthis.list.Clear();\n\t\t}\n\n\t\tpublic int Count\n\t\t{\n\t\t\tget { return this.list.Count; }\n\t\t}\n\n\t\tpublic T this[int index]\n\t\t{\n\t\t\tget { return this.list[index]; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.list[index] = value;\n\t\t\t\tthis.Update(value);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Util/RectangleExtensions.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Util\n{\n\tpublic static class RectangleExtensions\n\t{\n\t\tpublic static Rectangle Create(Vector2 min, Vector2 max)\n\t\t{\n\t\t\treturn new Rectangle((int)Math.Round(min.X), (int)Math.Round(min.Y), (int)Math.Round(max.X - min.X), (int)Math.Round(max.Y - min.Y));\n\t\t}\n\n\t\tpublic static Rectangle Intersect(this Rectangle self, Rectangle other)\n\t\t{\n\t\t\tint x = Math.Max(self.X, other.X);\n\t\t\tint y = Math.Max(self.Y, other.Y);\n\t\t\treturn new Rectangle(x, y, Math.Min(self.X + self.Width, other.X + other.Width) - x, Math.Min(self.Y + self.Height, other.Y + other.Height) - y);\n\t\t}\n\n\t\tpublic static Rectangle Union(this Rectangle self, Rectangle other)\n\t\t{\n\t\t\tint x = Math.Min(self.X, other.X);\n\t\t\tint y = Math.Min(self.Y, other.Y);\n\t\t\treturn new Rectangle(x, y, Math.Max(self.X + self.Width, other.X + other.Width) - x, Math.Max(self.Y + self.Height, other.Y + other.Height) - y);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/ScriptBase.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\nusing Lemma.Factories;\nusing Lemma.Console;\n\nnamespace Lemma.GameScripts\n{\n\tpublic class ScriptBase\n\t{\n\t\tpublic static Main main;\n\t\tpublic static Renderer renderer;\n\t\tpublic static bool AvailableInReleaseEditor = true;\n\n\t\tprotected static Entity get(string id)\n\t\t{\n\t\t\treturn ScriptBase.main.GetByID(id);\n\t\t}\n\n\t\tprotected static Container showMessage(Func<string> text, params IProperty[] properties)\n\t\t{\n\t\t\treturn main.Menu.ShowMessage(WorldFactory.Instance, text, properties);\n\t\t}\n\n\t\tprotected static Container showMessage(string text)\n\t\t{\n\t\t\treturn main.Menu.ShowMessage(WorldFactory.Instance, text);\n\t\t}\n\n\t\tprotected static void hideMessage(Container container, float delay = 0.0f)\n\t\t{\n\t\t\tmain.Menu.HideMessage(WorldFactory.Instance, container, delay);\n\t\t}\n\n\t\tprotected static void bindEntityTrigger(string id, Action callback, bool oneTimeOnly = true)\n\t\t{\n\t\t\tEntity triggerEntity = ScriptBase.get(id);\n\t\t\tif (triggerEntity == null)\n\t\t\t{\n\t\t\t\tLog.d(\"Entity \" + id + \" not found!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tTrigger trigger = triggerEntity.Get<Trigger>();\n\t\t\tAction[] callbacks;\n\t\t\tif (oneTimeOnly)\n\t\t\t\tcallbacks = new[] { callback, delegate() { trigger.Enabled.Value = false; } };\n\t\t\telse\n\t\t\t\tcallbacks = new[] { callback };\n\t\t\ttriggerEntity.Add(new CommandBinding(trigger.Entered, callbacks));\n\t\t}\n\n\t\tprotected static void bindEntityTriggerLeave(string id, Action callback, bool oneTimeOnly = false)\n\t\t{\n\t\t\tEntity triggerEntity = ScriptBase.get(id);\n\t\t\tif (triggerEntity == null)\n\t\t\t{\n\t\t\t\tLog.d(\"Entity \" + id + \" not found!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tTrigger trigger = triggerEntity.Get<Trigger>();\n\t\t\tAction[] callbacks;\n\t\t\tif (oneTimeOnly)\n\t\t\t\tcallbacks = new[] { callback, delegate() { trigger.Enabled.Value = false; } };\n\t\t\telse\n\t\t\t\tcallbacks = new[] { callback };\n\t\t\ttriggerEntity.Add(new CommandBinding(trigger.Exited, callbacks));\n\t\t}\n\n\t\tprotected static Property<T> property<T>(Entity script, string name, T defaultValue = default(T))\n\t\t{\n\t\t\tData data = script.GetOrCreate<Data>(\"Data\");\n\t\t\treturn data.Property<T>(name, defaultValue);\n\t\t}\n\n\t\tprotected static ListProperty<T> listProperty<T>(Entity script, string name)\n\t\t{\n\t\t\tData data = script.GetOrCreate<Data>(\"Data\");\n\t\t\treturn data.ListProperty<T>(name);\n\t\t}\n\n\t\tprotected static Command command(Entity script, string name)\n\t\t{\n\t\t\tData data = script.GetOrCreate<Data>(\"Data\");\n\t\t\treturn data.Command(name);\n\t\t}\n\t\t\n\t\tprotected static void bindPlayerTrigger(string id, Action callback, bool oneTimeOnly = true)\n\t\t{\n\t\t\tEntity triggerEntity = ScriptBase.get(id);\n\t\t\tif (triggerEntity == null)\n\t\t\t{\n\t\t\t\tLog.d(\"Entity \" + id + \" not found!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tPlayerTrigger trigger = triggerEntity.Get<PlayerTrigger>();\n\t\t\tAction[] callbacks;\n\t\t\tif (oneTimeOnly)\n\t\t\t\tcallbacks = new[] { callback, delegate() { trigger.Enabled.Value = false; } };\n\t\t\telse\n\t\t\t\tcallbacks = new[] { callback };\n\t\t\ttriggerEntity.Add(new CommandBinding(trigger.PlayerEntered, callbacks));\n\t\t}\n\n\t\tprotected static void bindTriggerLeave(string id, Action callback, bool oneTimeOnly = false)\n\t\t{\n\t\t\tEntity triggerEntity = ScriptBase.get(id);\n\t\t\tif (triggerEntity == null)\n\t\t\t{\n\t\t\t\tLog.d(\"Entity \" + id + \" not found!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tPlayerTrigger trigger = triggerEntity.Get<PlayerTrigger>();\n\t\t\tAction[] callbacks;\n\t\t\tif (oneTimeOnly)\n\t\t\t\tcallbacks = new[] { callback, delegate() { trigger.Enabled.Value = false; } };\n\t\t\telse\n\t\t\t\tcallbacks = new[] { callback };\n\t\t\ttriggerEntity.Add(new CommandBinding(trigger.PlayerExited, callbacks));\n\t\t}\n\t\t\n\t\tprotected static void consoleCommand(ConCommand conCommand)\n\t\t{\n\t\t\tLemma.Console.Console.AddConCommand(conCommand);\n\t\t\tWorldFactory.Instance.Add(new CommandBinding(WorldFactory.Instance.Delete, delegate()\n\t\t\t{\n\t\t\t\tLemma.Console.Console.RemoveConCommand(conCommand.Name);\n\t\t\t}));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/SteamWorker.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Drawing.Text;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Components;\nusing Lemma.Console;\nusing Newtonsoft.Json;\nusing Steamworks;\n\nnamespace Lemma.Util\n{\n\tpublic static class SteamWorker\n\t{\n\t\tpublic static DirectoryInfo DownloadedMaps\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tstring completedDirectory = SteamWorker.WSFilesDirectory;\n\t\t\t\tif (!Directory.Exists(completedDirectory))\n\t\t\t\t\tDirectory.CreateDirectory(completedDirectory);\n\t\t\t\treturn new DirectoryInfo(completedDirectory);\n\t\t\t}\n\t\t}\n\n\t\tprivate static uint ugcPage = 0;\n\n\t\tprivate static Dictionary<string, bool> _achievementDictionary;\n\t\tprivate static Dictionary<string, int> _statDictionary;\n\n\t\tprivate static DateTime _statsLastUploaded = DateTime.Now;\n\n\t\tprivate static bool _anythingChanged = false;\n\n\t\tpublic static Property<bool> SteamInitialized = new Property<bool>();\n\n\t\tpublic static Property<bool> StatsInitialized = new Property<bool>();\n\n\t\tpublic static Property<bool> OverlayActive = new Property<bool>();\n\n\t\tpublic static bool OverlaySafelyGone\n\t\t{\n\t\t\tget { return _overlayTimer <= 0; }\n\t\t}\n\n\t\tprivate static float _overlayTimer = 0f;\n\n\t\tpublic static bool Initialized\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn SteamInitialized && StatsInitialized;\n\t\t\t}\n\t\t}\n\n\t\tprivate static List<object> callbacks = new List<object>();\n\n\t\tprivate static CallResult<SteamUGCQueryCompleted_t> queryResult;\n\n\t\tprivate static bool Init_SteamGame()\n\t\t{\n\t\t\t//Getting here means Steamworks MUST have initialized successfully. Oh, && operator!\n\t\t\tRemoveWSTemp();\n\t\t\tcallbacks.Add(Callback<SteamUGCQueryCompleted_t>.Create(OnUGCQueryReturn));\n\t\t\tcallbacks.Add(Callback<UserStatsReceived_t>.Create(OnUserStatsReceived));\n\t\t\tcallbacks.Add(Callback<RemoteStoragePublishedFileSubscribed_t>.Create(OnSubscribed));\n\t\t\tcallbacks.Add(Callback<GameOverlayActivated_t>.Create(OnOverlayActivated));\n\n\t\t\tqueryResult = QuerySubscribed();\n\t\t\tif (!SteamUserStats.RequestCurrentStats()) return false;\n\t\t\t_achievementDictionary = new Dictionary<string, bool>();\n\t\t\t_statDictionary = new Dictionary<string, int>();\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static bool Init()\n\t\t{\n\t\t\ttry\n\t\t\t{\n#if STEAMWORKS\n\t\t\t\treturn SteamInitialized.Value = (SteamAPI.Init() && Init_SteamGame());\n#else\n\t\t\t\treturn SteamInitialized.Value = false;\n#endif\n\t\t\t}\n\t\t\tcatch (DllNotFoundException)\n\t\t\t{\n\t\t\t\tLog.d(\"Steam DLL not found.\");\n\t\t\t\t//Required DLLs ain't there\n\t\t\t\tSteamInitialized.Value = false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Shutdown()\n\t\t{\n#if STEAMWORKS\n\t\t\tSteamAPI.Shutdown();\n#endif\n\t\t}\n\n\t\tpublic static void Update(float dt)\n\t\t{\n#if STEAMWORKS\n\t\t\tif (SteamInitialized)\n\t\t\t\tSteamAPI.RunCallbacks();\n\t\t\tif (_overlayTimer > 0)\n\t\t\t\t_overlayTimer -= dt;\n#endif\n\t\t}\n\n\t\tprivate static string WSFilesDirectory\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Path.Combine(Main.DataDirectory, \"workshop\");\n\t\t\t}\n\t\t}\n\n\t\tprivate static string WSTempDirectory\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Path.Combine(Main.DataDirectory, \"tmp\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static void RemoveWSTemp()\n\t\t{\n\t\t\tstring tempDirectory = SteamWorker.WSTempDirectory;\n\t\t\tif (!Directory.Exists(tempDirectory))\n\t\t\t\tDirectory.CreateDirectory(tempDirectory);\n\n\t\t\tforeach (var dir in Directory.GetDirectories(tempDirectory))\n\t\t\t\tDirectory.Delete(dir, true);\n\n\t\t\tforeach (var file in Directory.GetFiles(tempDirectory))\n\t\t\t\tFile.Delete(file);\n\t\t}\n\n\t\tpublic static bool WriteFileUGC(string path, string steamPath)\n\t\t{\n\t\t\tif (!SteamInitialized) return false;\n\t\t\tif (!File.Exists(path)) return false;\n\t\t\tbyte[] data = File.ReadAllBytes(path);\n\t\t\treturn SteamRemoteStorage.FileWrite(steamPath, data, data.Length);\n\t\t}\n\n\t\tpublic static CallResult<RemoteStorageFileShareResult_t> ShareFileUGC(string path, Action<bool, UGCHandle_t> onShare = null)\n\t\t{\n\t\t\tvar callResult = new CallResult<RemoteStorageFileShareResult_t>((result, failure) =>\n\t\t\t{\n\t\t\t\tif (result.m_eResult == EResult.k_EResultOK)\n\t\t\t\t{\n\t\t\t\t\tif (onShare != null)\n\t\t\t\t\t\tonShare(true, result.m_hFile);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (onShare != null)\n\t\t\t\t\t\tonShare(false, result.m_hFile);\n\t\t\t\t}\n\t\t\t});\n\t\t\tcallResult.Set(SteamRemoteStorage.FileShare(path));\n\t\t\treturn callResult;\n\t\t}\n\n\t\tpublic static CallResult<RemoteStorageUpdatePublishedFileResult_t> UpdateWorkshopMap(PublishedFileId_t workshop, string pchFile, string imageFile, string name, string description, Action<bool> onDone)\n\t\t{\n\t\t\tvar updateHandle = SteamRemoteStorage.CreatePublishedFileUpdateRequest(workshop);\n\t\t\tSteamRemoteStorage.UpdatePublishedFileTitle(updateHandle, name);\n\t\t\tSteamRemoteStorage.UpdatePublishedFileDescription(updateHandle, description);\n\t\t\tSteamRemoteStorage.UpdatePublishedFileFile(updateHandle, pchFile);\n\t\t\tSteamRemoteStorage.UpdatePublishedFilePreviewFile(updateHandle, imageFile);\n\t\t\tvar call = SteamRemoteStorage.CommitPublishedFileUpdate(updateHandle);\n\t\t\tvar callResult = new CallResult<RemoteStorageUpdatePublishedFileResult_t>((result, failure) =>\n\t\t\t{\n\t\t\t\tif (onDone != null)\n\t\t\t\t\tonDone(result.m_eResult == EResult.k_EResultOK && !failure);\n\t\t\t});\n\t\t\tcallResult.Set(call);\n\t\t\treturn callResult;\n\t\t}\n\n\t\tpublic static CallResult<RemoteStoragePublishFileResult_t> UploadWorkShop(string mapFile, string imageFile, string title, string description, Action<bool, bool, PublishedFileId_t> onDone)\n\t\t{\n\t\t\tvar call = SteamRemoteStorage.PublishWorkshopFile(mapFile, imageFile, new AppId_t(Main.SteamAppID), title, description,\n\t\t\t\tERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic, new List<string>(),\n\t\t\t\tEWorkshopFileType.k_EWorkshopFileTypeCommunity);\n\n\t\t\tvar callResult = new CallResult<RemoteStoragePublishFileResult_t>((result, failure) =>\n\t\t\t{\n\t\t\t\tonDone(result.m_eResult == EResult.k_EResultOK, result.m_bUserNeedsToAcceptWorkshopLegalAgreement, result.m_nPublishedFileId);\n\t\t\t});\n\t\t\tcallResult.Set(call);\n\t\t\treturn callResult;\n\t\t}\n\n\t\t[AutoConCommand(\"set_stat\", \"Set a Steam stat\")]\n\t\tpublic static void SetStat(string name, int newVal, bool forceUpload = true)\n\t\t{\n\t\t\tif (!Initialized) return;\n\n\t\t\tvar curVal = 0;\n\t\t\t_statDictionary.TryGetValue(name, out curVal);\n\t\t\tif (newVal <= curVal)\n\t\t\t\treturn;\n\n\t\t\t_statDictionary[name] = newVal;\n\t\t\tSteamUserStats.SetStat(name, newVal);\n\t\t\t_anythingChanged = true;\n\n\t\t\tif (forceUpload)\n\t\t\t\tUploadStats();\n\t\t}\n\n\t\tpublic static void IndicateAchievementProgress(string name, uint value, uint max)\n\t\t{\n\t\t\tif (Initialized && _achievementDictionary.ContainsKey(name))\n\t\t\t\tSteamworks.SteamUserStats.IndicateAchievementProgress(name, value, max);\n\t\t}\n\n\t\tpublic static void IncrementStat(string name, int increment)\n\t\t{\n\t\t\tif (!Initialized) return;\n\t\t\tSetStat(name, GetStat(name) + increment);\n\t\t}\n\n\t\tpublic static int GetStat(string name)\n\t\t{\n\t\t\tif (!Initialized) return 0;\n\t\t\tif (!_statDictionary.ContainsKey(name)) return 0;\n\t\t\treturn _statDictionary[name];\n\t\t}\n\n\t\tpublic static void SetAchievement(string name, bool forceUpload = true)\n\t\t{\n\t\t\tif (!Initialized) return;\n\t\t\tbool existing_value = false;\n\t\t\t_achievementDictionary.TryGetValue(name, out existing_value);\n\t\t\tif (existing_value) return; //No use setting an already-unlocked cheevo.\n\t\t\t_achievementDictionary[name] = true;\n\t\t\tSteamUserStats.SetAchievement(name);\n\t\t\t_anythingChanged = true;\n\t\t\tif (forceUpload)\n\t\t\t\tUploadStats();\n\t\t}\n\n\t\t[AutoConCommand(\"upload_stats\", \"Upload stats to Steam\")]\n\t\tpublic static void UploadStats(bool force = false)\n\t\t{\n\t\t\tif (!Initialized) return;\n\t\t\tif (!_anythingChanged && !force) return;\n\t\t\tSteamUserStats.StoreStats();\n\t\t\t_anythingChanged = false;\n\t\t\t_statsLastUploaded = DateTime.Now;\n\t\t}\n\n\t\t[AutoConCommand(\"reset_stats\", \"Reset all stats.\")]\n\t\tpublic static void ResetAllStats(bool andCheevos = true)\n\t\t{\n\t\t\tif (!SteamInitialized) return;\n\t\t\tSteamUserStats.ResetAllStats(andCheevos);\n\t\t\tSteamUserStats.RequestCurrentStats();\n\n\t\t\t_achievementDictionary = new Dictionary<string, bool>();\n\t\t\t_statDictionary = new Dictionary<string, int>();\n\t\t\tStatsInitialized.Value = false;\n\t\t}\n\n\t\tpublic class WorkshopMapMetadata\n\t\t{\n\t\t\tpublic string PchFileName;\n\t\t\tpublic string Title;\n\t\t}\n\n\t\tpublic static Property<int> Downloading = new Property<int>();\n\t\tpublic static Command OnLevelDownloaded = new Command();\n\t\tprivate static CallResult<RemoteStorageDownloadUGCResult_t> downloadResult;\n\t\tprivate static CallResult<RemoteStorageGetPublishedFileDetailsResult_t> DownloadLevel(PublishedFileId_t file)\n\t\t{\n\t\t\tvar publishedCall = SteamRemoteStorage.GetPublishedFileDetails(file, 0);\n\n\t\t\tstring tempDirectory = SteamWorker.WSTempDirectory;\n\t\t\tstring completedDirectory = SteamWorker.WSFilesDirectory;\n\n\t\t\tif (!Directory.Exists(tempDirectory))\n\t\t\t\tDirectory.CreateDirectory(tempDirectory);\n\t\t\tif (!Directory.Exists(completedDirectory))\n\t\t\t\tDirectory.CreateDirectory(completedDirectory);\n\n\t\t\tstring tempDirectoryNew = Path.Combine(tempDirectory, file.m_PublishedFileId.ToString());\n\t\t\tstring completedDirectoryNew = Path.Combine(completedDirectory, file.m_PublishedFileId.ToString());\n\n\t\t\tif (!Directory.Exists(tempDirectoryNew))\n\t\t\t\tDirectory.CreateDirectory(tempDirectoryNew);\n\t\t\tif (!Directory.Exists(completedDirectoryNew))\n\t\t\t\tDirectory.CreateDirectory(completedDirectoryNew);\n\n\t\t\tstring metadataPath = Path.Combine(completedDirectoryNew, \"meta.json\");\n\t\t\tWorkshopMapMetadata metadata = null;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tmetadata = JsonConvert.DeserializeObject<WorkshopMapMetadata>(File.ReadAllText(metadataPath));\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\n\t\t\t}\n\n\t\t\tvar callResult = new CallResult<RemoteStorageGetPublishedFileDetailsResult_t>((t, failure) =>\n\t\t\t{\n\t\t\t\tif (!failure && t.m_eResult == EResult.k_EResultOK)\n\t\t\t\t{\n\t\t\t\t\tif (metadata == null || metadata.PchFileName != t.m_pchFileName)\n\t\t\t\t\t{\n\t\t\t\t\t\tDownloading.Value++;\n\n\t\t\t\t\t\tstring mapFileTemp = Path.Combine(tempDirectoryNew, file.m_PublishedFileId.ToString() + IO.MapLoader.MapExtension);\n\t\t\t\t\t\tstring imageFileTemp = Path.Combine(tempDirectoryNew, file.m_PublishedFileId.ToString() + \".png\");\n\t\t\t\t\t\tvar downloadMapCall = SteamRemoteStorage.UGCDownloadToLocation(t.m_hFile, mapFileTemp, 1);\n\t\t\t\t\t\tdownloadResult = new CallResult<RemoteStorageDownloadUGCResult_t>((resultT, ioFailure) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (ioFailure)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tDownloading.Value = Math.Max(0, Downloading - 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tAction<RemoteStorageDownloadUGCResult_t, bool> onImgDownloaded = (resultT2, ioFailure2) =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tDownloading.Value = Math.Max(0, Downloading - 1);\n\t\t\t\t\t\t\t\t\tif (!ioFailure2)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tstring mapFileNew = mapFileTemp.Replace(tempDirectoryNew, completedDirectoryNew);\n\t\t\t\t\t\t\t\t\t\tif (File.Exists(mapFileNew))\n\t\t\t\t\t\t\t\t\t\t\tFile.Delete(mapFileNew);\n\t\t\t\t\t\t\t\t\t\tFile.Move(mapFileTemp, mapFileNew);\n\t\t\t\t\t\t\t\t\t\tstring imageFileNew = imageFileTemp.Replace(tempDirectoryNew, completedDirectoryNew);\n\t\t\t\t\t\t\t\t\t\tif (File.Exists(imageFileNew))\n\t\t\t\t\t\t\t\t\t\t\tFile.Delete(imageFileNew);\n\t\t\t\t\t\t\t\t\t\tFile.Move(imageFileTemp, imageFileNew);\n\t\t\t\t\t\t\t\t\t\tFile.WriteAllText(metadataPath, JsonConvert.SerializeObject(new WorkshopMapMetadata { PchFileName = t.m_pchFileName, Title = t.m_rgchTitle }));\n\t\t\t\t\t\t\t\t\t\tOnLevelDownloaded.Execute();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tvar downloadImageCall = SteamRemoteStorage.UGCDownloadToLocation(t.m_hPreviewFile, imageFileTemp, 1);\n\t\t\t\t\t\t\t\tdownloadResult = new CallResult<RemoteStorageDownloadUGCResult_t>(\n\t\t\t\t\t\t\t\t\t(ugcResultT, bIoFailure) => onImgDownloaded(ugcResultT, bIoFailure));\n\t\t\t\t\t\t\t\tdownloadResult.Set(downloadImageCall);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tdownloadResult.Set(downloadMapCall);\n\t\t\t\t\t}\n\t\t\t\t\telse if (metadata.Title != t.m_rgchTitle)\n\t\t\t\t\t{\n\t\t\t\t\t\tmetadata.Title = t.m_rgchTitle;\n\t\t\t\t\t\tFile.WriteAllText(metadataPath, JsonConvert.SerializeObject(metadata));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tcallResult.Set(publishedCall);\n\t\t\treturn callResult;\n\t\t}\n\n\t\tprivate static CallResult<SteamUGCQueryCompleted_t> QuerySubscribed()\n\t\t{\n\t\t\tugcPage++;\n\n\t\t\tvar query = SteamUGC.CreateQueryUserUGCRequest(SteamUser.GetSteamID().GetAccountID(),\n\t\t\t   EUserUGCList.k_EUserUGCList_Subscribed, EUGCMatchingUGCType.k_EUGCMatchingUGCType_UsableInGame,\n\t\t\t   EUserUGCListSortOrder.k_EUserUGCListSortOrder_SubscriptionDateDesc, new AppId_t(Main.SteamAppID), new AppId_t(Main.SteamAppID),\n\t\t\t   ugcPage);\n\n\t\t\tvar call = SteamUGC.SendQueryUGCRequest(query);\n\n\t\t\tvar callResult = new CallResult<SteamUGCQueryCompleted_t>((t, failure) =>\n\t\t\t{\n\t\t\t\tOnUGCQueryReturn(t);\n\t\t\t});\n\t\t\tcallResult.Set(call);\n\t\t\treturn callResult;\n\t\t}\n\n\t\tpublic static CallResult<SteamUGCQueryCompleted_t> GetCreatedWorkShopEntries(Action<IEnumerable<SteamUGCDetails_t>> onResult)\n\t\t{\n\t\t\tvar query = SteamUGC.CreateQueryUserUGCRequest(SteamUser.GetSteamID().GetAccountID(),\n\t\t\t   EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_UsableInGame,\n\t\t\t   EUserUGCListSortOrder.k_EUserUGCListSortOrder_LastUpdatedDesc, new AppId_t(Main.SteamAppID), new AppId_t(Main.SteamAppID),\n\t\t\t   1);\n\n\t\t\tvar call = SteamUGC.SendQueryUGCRequest(query);\n\n\t\t\tvar callResult = new CallResult<SteamUGCQueryCompleted_t>((t, failure) =>\n\t\t\t{\n\t\t\t\tif (onResult == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tList<SteamUGCDetails_t> ret = new List<SteamUGCDetails_t>();\n\n\t\t\t\tfor (uint i = 0; i < t.m_unNumResultsReturned; i++)\n\t\t\t\t{\n\t\t\t\t\tvar deets = new SteamUGCDetails_t();\n\t\t\t\t\tif (SteamUGC.GetQueryUGCResult(t.m_handle, i, out deets))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (deets.m_nConsumerAppID.m_AppId == Main.SteamAppID && deets.m_eFileType == EWorkshopFileType.k_EWorkshopFileTypeCommunity)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tret.Add(deets);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tonResult(ret);\n\t\t\t});\n\t\t\tcallResult.Set(call);\n\t\t\treturn callResult;\n\t\t}\n\n\t\t#region Callbacks\n\n\t\tprivate static void OnOverlayActivated(GameOverlayActivated_t callback)\n\t\t{\n\t\t\tOverlayActive.Value = callback.m_bActive != 0;\n\t\t\tif (!OverlayActive) _overlayTimer = 0.2f;\n\t\t}\n\n\t\tprivate static List<string> directories = new List<string>();\n\t\tprivate static void OnUGCQueryReturn(SteamUGCQueryCompleted_t handle)\n\t\t{\n\t\t\tif (ugcPage == 1)\n\t\t\t{\n\t\t\t\tdirectories.Clear();\n\t\t\t\tforeach (var s in SteamWorker.DownloadedMaps.GetDirectories())\n\t\t\t\t{\n\t\t\t\t\tdirectories.Add(s.Name);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (uint i = 0; i < handle.m_unNumResultsReturned; i++)\n\t\t\t{\n\t\t\t\tSteamUGCDetails_t deets;\n\t\t\t\tif (SteamUGC.GetQueryUGCResult(handle.m_handle, i, out deets))\n\t\t\t\t{\n\t\t\t\t\tdirectories.Remove(deets.m_nPublishedFileId.m_PublishedFileId.ToString());\n\t\t\t\t\tif (deets.m_nConsumerAppID.m_AppId == Main.SteamAppID && deets.m_eFileType == EWorkshopFileType.k_EWorkshopFileTypeCommunity)\n\t\t\t\t\t{\n\t\t\t\t\t\tDownloadLevel(deets.m_nPublishedFileId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (handle.m_unTotalMatchingResults > handle.m_unNumResultsReturned && handle.m_unNumResultsReturned != 0)\n\t\t\t\tqueryResult = QuerySubscribed();\n\t\t\telse\n\t\t\t{\n\t\t\t\t//This whole ordeal deletes folders in here that are not currently-subscribed workshop maps.\n\t\t\t\tforeach (var dir in directories)\n\t\t\t\t{\n\t\t\t\t\tDirectory.Delete(Path.Combine(DownloadedMaps.FullName, dir), true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tprivate static CallResult<RemoteStorageGetPublishedFileDetailsResult_t> downloadLevelResult;\n\t\tprivate static void OnSubscribed(RemoteStoragePublishedFileSubscribed_t subscribed)\n\t\t{\n\t\t\tif (!SteamInitialized) return;\n\n\t\t\t//Because Steam can be an idiot sometimes!\n\t\t\tif (subscribed.m_nAppID.m_AppId != Main.SteamAppID) return;\n\n\t\t\tdownloadLevelResult = DownloadLevel(subscribed.m_nPublishedFileId);\n\t\t}\n\n\t\tprivate static void OnUserStatsReceived(UserStatsReceived_t pCallback)\n\t\t{\n\t\t\tif (!SteamInitialized) return;\n\n\t\t\tif (pCallback.m_nGameID != Main.SteamAppID || pCallback.m_eResult != EResult.k_EResultOK) return;\n\n\t\t\t//I'm sorry, Evan. We'll need to find somewhere nice to put this part.\n\t\t\tstring[] cheevoNames = new string[]\n\t\t\t{\n\t\t\t\t\"ending_a\",\n\t\t\t\t\"ending_b\",\n\t\t\t\t\"ending_c\",\n\t\t\t\t\"ending_d\",\n\t\t\t\t\"pillar_crushed\",\n\t\t\t\t\"orbs\",\n\t\t\t\t\"notes\",\n\t\t\t\t\"flashback\",\n\t\t\t\t\"god_mode\",\n\t\t\t\t\"first_orb\",\n\t\t\t\t\"first_note\",\n\t\t\t\t\"first_challenge_level\",\n\t\t\t\t\"level_editor\",\n\t\t\t};\n\t\t\tstring[] statNames = new string[]\n\t\t\t{\n\t\t\t\t\"orbs_collected\",\n\t\t\t\t\"notes_read\",\n\t\t\t\t\"challenge_levels_played\",\n\t\t\t};\n\n\t\t\tforeach (var cheevo in cheevoNames)\n\t\t\t{\n\t\t\t\tbool value;\n\t\t\t\tbool success = SteamUserStats.GetAchievement(\"cheevo_\" + cheevo, out value);\n\t\t\t\tif (success)\n\t\t\t\t\t_achievementDictionary.Add(\"cheevo_\" + cheevo, value);\n\t\t\t\telse\n\t\t\t\t\t_achievementDictionary.Add(\"cheevo_\" + cheevo, false);\n\t\t\t}\n\n\t\t\tforeach (var stat in statNames)\n\t\t\t{\n\t\t\t\tint value;\n\t\t\t\tbool success = SteamUserStats.GetStat(\"stat_\" + stat, out value);\n\t\t\t\tif (success)\n\t\t\t\t\t_statDictionary.Add(\"stat_\" + stat, value);\n\t\t\t\telse\n\t\t\t\t\t_statDictionary.Add(\"stat_\" + stat, 0);\n\t\t\t}\n\t\t\tStatsInitialized.Value = true;\n\t\t}\n\t\t#endregion\n\n\t}\n}"
  },
  {
    "path": "Lemma/Util/VectorExtensions.cs",
    "content": "﻿using System; using ComponentBind;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Util\n{\n\tpublic enum VectorElement { X, Y, Z, W }\n\tpublic static class VectorExtensions\n\t{\n\t\t// returns Euler angles that point from one point to another\n\t\tpublic static Vector3 AngleTo(Vector3 from, Vector3 location)\n\t\t{\n\t\t\tVector3 angle = new Vector3();\n\t\t\tVector3 v3 = Vector3.Normalize(location - from);\n\t\t\tangle.X = (float)Math.Asin(v3.Y);\n\t\t\tangle.Y = (float)Math.Atan2(-v3.Z, -v3.X);\n\t\t\treturn angle;\n\t\t}\n\n\t\t// converts a Quaternion to Euler angles (X = pitch, Y = yaw, Z = roll)\n\t\tpublic static Vector3 ToEuler(this Quaternion rotation)\n\t\t{\n\t\t\tVector3 rotationaxes = new Vector3();\n\n\t\t\tVector3 forward = Vector3.Transform(Vector3.Forward, rotation);\n\t\t\tVector3 up = Vector3.Transform(Vector3.Up, rotation);\n\t\t\trotationaxes = AngleTo(new Vector3(), forward);\n\t\t\tif (rotationaxes.X == MathHelper.PiOver2)\n\t\t\t{\n\t\t\t\trotationaxes.Y = (float)Math.Atan2(up.Z, up.X);\n\t\t\t\trotationaxes.Z = 0;\n\t\t\t}\n\t\t\telse if (rotationaxes.X == -MathHelper.PiOver2)\n\t\t\t{\n\t\t\t\trotationaxes.Y = (float)Math.Atan2(-up.Z, -up.X);\n\t\t\t\trotationaxes.Z = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tup = Vector3.Transform(up, Matrix.CreateRotationY(-rotationaxes.Y));\n\t\t\t\tup = Vector3.Transform(up, Matrix.CreateRotationX(-rotationaxes.X));\n\t\t\t\trotationaxes.Z = (float)Math.Atan2(up.Y, -up.X);\n\t\t\t}\n\t\t\treturn rotationaxes;\n\t\t}\n\n\t\tpublic static float GetElement(this Vector2 v, VectorElement element)\n\t\t{\n\t\t\tswitch (element)\n\t\t\t{\n\t\t\t\tcase VectorElement.X:\n\t\t\t\t\treturn v.X;\n\t\t\t\tcase VectorElement.Y:\n\t\t\t\t\treturn v.Y;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Tried to get non-existent element from vector.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static Vector2 SetElement(this Vector2 v, VectorElement element, float value)\n\t\t{\n\t\t\tswitch (element)\n\t\t\t{\n\t\t\t\tcase VectorElement.X:\n\t\t\t\t\treturn new Vector2(value, v.Y);\n\t\t\t\tcase VectorElement.Y:\n\t\t\t\t\treturn new Vector2(v.X, value);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Tried to set non-existent element in vector.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static float GetElement(this Vector3 v, VectorElement element)\n\t\t{\n\t\t\tswitch (element)\n\t\t\t{\n\t\t\t\tcase VectorElement.X:\n\t\t\t\t\treturn v.X;\n\t\t\t\tcase VectorElement.Y:\n\t\t\t\t\treturn v.Y;\n\t\t\t\tcase VectorElement.Z:\n\t\t\t\t\treturn v.Z;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Tried to get non-existent element from vector.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static Vector3 SetElement(this Vector3 v, VectorElement element, float value)\n\t\t{\n\t\t\tswitch (element)\n\t\t\t{\n\t\t\t\tcase VectorElement.X:\n\t\t\t\t\treturn new Vector3(value, v.Y, v.Z);\n\t\t\t\tcase VectorElement.Y:\n\t\t\t\t\treturn new Vector3(v.X, value, v.Z);\n\t\t\t\tcase VectorElement.Z:\n\t\t\t\t\treturn new Vector3(v.X, v.Y, value);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Tried to set non-existent element in vector.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static float GetElement(this Vector4 v, VectorElement element)\n\t\t{\n\t\t\tswitch (element)\n\t\t\t{\n\t\t\t\tcase VectorElement.X:\n\t\t\t\t\treturn v.X;\n\t\t\t\tcase VectorElement.Y:\n\t\t\t\t\treturn v.Y;\n\t\t\t\tcase VectorElement.Z:\n\t\t\t\t\treturn v.Z;\n\t\t\t\tcase VectorElement.W:\n\t\t\t\t\treturn v.W;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Tried to get non-existent element from vector.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static Vector4 SetElement(this Vector4 v, VectorElement element, float value)\n\t\t{\n\t\t\tswitch (element)\n\t\t\t{\n\t\t\t\tcase VectorElement.X:\n\t\t\t\t\treturn new Vector4(value, v.Y, v.Z, v.W);\n\t\t\t\tcase VectorElement.Y:\n\t\t\t\t\treturn new Vector4(v.X, value, v.Z, v.W);\n\t\t\t\tcase VectorElement.Z:\n\t\t\t\t\treturn new Vector4(v.X, v.Y, value, v.W);\n\t\t\t\tcase VectorElement.W:\n\t\t\t\t\treturn new Vector4(v.X, v.Y, v.Z, value);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Tried to set non-existent element in vector.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static float GetElement(this Quaternion v, VectorElement element)\n\t\t{\n\t\t\tswitch (element)\n\t\t\t{\n\t\t\t\tcase VectorElement.X:\n\t\t\t\t\treturn v.X;\n\t\t\t\tcase VectorElement.Y:\n\t\t\t\t\treturn v.Y;\n\t\t\t\tcase VectorElement.Z:\n\t\t\t\t\treturn v.Z;\n\t\t\t\tcase VectorElement.W:\n\t\t\t\t\treturn v.W;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Tried to get non-existent element from vector.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static Quaternion SetElement(this Quaternion v, VectorElement element, float value)\n\t\t{\n\t\t\tswitch (element)\n\t\t\t{\n\t\t\t\tcase VectorElement.X:\n\t\t\t\t\treturn new Quaternion(value, v.Y, v.Z, v.W);\n\t\t\t\tcase VectorElement.Y:\n\t\t\t\t\treturn new Quaternion(v.X, value, v.Z, v.W);\n\t\t\t\tcase VectorElement.Z:\n\t\t\t\t\treturn new Quaternion(v.X, v.Y, value, v.W);\n\t\t\t\tcase VectorElement.W:\n\t\t\t\t\treturn new Quaternion(v.X, v.Y, v.Z, value);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Tried to set non-existent element in vector.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static byte GetElement(this Color v, VectorElement element)\n\t\t{\n\t\t\tswitch (element)\n\t\t\t{\n\t\t\t\tcase VectorElement.X:\n\t\t\t\t\treturn v.R;\n\t\t\t\tcase VectorElement.Y:\n\t\t\t\t\treturn v.G;\n\t\t\t\tcase VectorElement.Z:\n\t\t\t\t\treturn v.B;\n\t\t\t\tcase VectorElement.W:\n\t\t\t\t\treturn v.A;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Tried to get non-existent element from color.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static Color SetElement(this Color v, VectorElement element, byte value)\n\t\t{\n\t\t\tswitch (element)\n\t\t\t{\n\t\t\t\tcase VectorElement.X:\n\t\t\t\t\treturn new Color(value, v.G, v.B, v.A);\n\t\t\t\tcase VectorElement.Y:\n\t\t\t\t\treturn new Color(v.R, value, v.B, v.A);\n\t\t\t\tcase VectorElement.Z:\n\t\t\t\t\treturn new Color(v.R, v.G, value, v.A);\n\t\t\t\tcase VectorElement.W:\n\t\t\t\t\treturn new Color(v.R, v.G, v.B, value);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Tried to set non-existent element in color.\");\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/Util/VoxelAStar.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Lemma.Components;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Util\n{\n\tpublic class VoxelAStar\n\t{\n\t\tprivate class BroadphaseEntry\n\t\t{\n\t\t\tpublic BroadphaseEntry Parent;\n\t\t\tpublic Voxel.Box Box;\n\t\t\tpublic int G;\n\t\t\tpublic float F;\n\t\t\tpublic int BoxSize;\n\t\t}\n\n\t\tprivate static void reconstructBroadphasePath(BroadphaseEntry entry, Stack<Voxel.Box> result)\n\t\t{\n\t\t\twhile (entry != null)\n\t\t\t{\n\t\t\t\tresult.Push(entry.Box);\n\t\t\t\tentry = entry.Parent;\n\t\t\t}\n\t\t}\n\n\t\tprivate static Dictionary<Voxel.Box, int> broadphaseClosed = new Dictionary<Voxel.Box,int>();\n\t\tprivate static PriorityQueue<BroadphaseEntry> broadphaseQueue = new PriorityQueue<BroadphaseEntry>(new LambdaComparer<BroadphaseEntry>((x, y) => x.F.CompareTo(y.F)));\n\t\tprivate static Dictionary<Voxel.Box, BroadphaseEntry> broadphaseQueueLookup = new Dictionary<Voxel.Box, BroadphaseEntry>();\n\n\t\tpublic static bool Broadphase(Voxel m, Voxel.Box start, Voxel.Coord target, Func<Voxel.State, bool> filter, Stack<Voxel.Box> result, int maxIterations = 50)\n\t\t{\n\t\t\tBroadphaseEntry closestEntry = null;\n\t\t\tbool found = false;\n\t\t\tlock (m.MutationLock)\n\t\t\t{\n\t\t\t\tVector3 targetPos = m.GetRelativePosition(target);\n\t\t\t\tBroadphaseEntry startEntry = new BroadphaseEntry\n\t\t\t\t{\n\t\t\t\t\tParent = null,\n\t\t\t\t\tBox = start,\n\t\t\t\t\tG = 0,\n\t\t\t\t\tF = (targetPos - start.GetCenter()).Length(),\n\t\t\t\t\tBoxSize = Math.Max(start.Width, Math.Max(start.Height, start.Depth)),\n\t\t\t\t};\n\t\t\t\tbroadphaseQueue.Push(startEntry);\n\t\t\t\tbroadphaseQueueLookup[start] = startEntry;\n\n\t\t\t\tfloat closestHeuristic = float.MaxValue;\n\n\t\t\t\tint iterations = 0;\n\t\t\t\twhile (broadphaseQueue.Count > 0 && iterations < maxIterations)\n\t\t\t\t{\n\t\t\t\t\titerations++;\n\n\t\t\t\t\tBroadphaseEntry entry = broadphaseQueue.Pop();\n\n\t\t\t\t\tif (entry.Box.Contains(target))\n\t\t\t\t\t{\n\t\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tbroadphaseQueueLookup.Remove(entry.Box);\n\n\t\t\t\t\tbroadphaseClosed[entry.Box] = entry.G;\n\t\t\t\t\tlock (entry.Box.Adjacent)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int i = 0; i < entry.Box.Adjacent.Count; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Box adjacent = entry.Box.Adjacent[i];\n\t\t\t\t\t\t\tif (adjacent == null || !filter(adjacent.Type))\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tint boxSize = (int)((adjacent.Width + adjacent.Height + adjacent.Depth) / 3.0f);\n\n\t\t\t\t\t\t\tint tentativeGScore = entry.G + boxSize;\n\n\t\t\t\t\t\t\tint previousGScore;\n\t\t\t\t\t\t\tbool hasPreviousGScore = broadphaseClosed.TryGetValue(adjacent, out previousGScore);\n\n\t\t\t\t\t\t\tif (hasPreviousGScore && tentativeGScore > previousGScore)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tBroadphaseEntry alreadyInQueue;\n\t\t\t\t\t\t\tbroadphaseQueueLookup.TryGetValue(adjacent, out alreadyInQueue);\n\n\t\t\t\t\t\t\tif (alreadyInQueue == null || tentativeGScore < previousGScore)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBroadphaseEntry newEntry = alreadyInQueue != null ? alreadyInQueue : new BroadphaseEntry();\n\n\t\t\t\t\t\t\t\tnewEntry.Parent = entry;\n\t\t\t\t\t\t\t\tnewEntry.G = tentativeGScore;\n\t\t\t\t\t\t\t\tfloat heuristic = (targetPos - adjacent.GetCenter()).Length();\n\t\t\t\t\t\t\t\tnewEntry.F = tentativeGScore + heuristic;\n\n\t\t\t\t\t\t\t\tif (heuristic < closestHeuristic)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tclosestEntry = newEntry;\n\t\t\t\t\t\t\t\t\tclosestHeuristic = heuristic;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (alreadyInQueue == null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnewEntry.Box = adjacent;\n\t\t\t\t\t\t\t\t\tnewEntry.BoxSize = boxSize;\n\t\t\t\t\t\t\t\t\tbroadphaseQueue.Push(newEntry);\n\t\t\t\t\t\t\t\t\tbroadphaseQueueLookup[adjacent] = newEntry;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbroadphaseClosed.Clear();\n\t\t\tbroadphaseQueue.Clear();\n\t\t\tbroadphaseQueueLookup.Clear();\n\t\t\tif (closestEntry != null)\n\t\t\t\tVoxelAStar.reconstructBroadphasePath(closestEntry, result);\n\t\t\treturn found;\n\t\t}\n\n\t\tprivate class NarrowphaseEntry\n\t\t{\n\t\t\tpublic NarrowphaseEntry Parent;\n\t\t\tpublic Voxel.Coord Coord;\n\t\t\tpublic int G;\n\t\t\tpublic float F;\n\t\t}\n\n\t\tprivate static void reconstructNarrowphasePath(NarrowphaseEntry entry, Stack<Voxel.Coord> result)\n\t\t{\n\t\t\twhile (entry != null)\n\t\t\t{\n\t\t\t\tresult.Push(entry.Coord);\n\t\t\t\tentry = entry.Parent;\n\t\t\t}\n\t\t}\n\n\t\tprivate static Dictionary<Voxel.Coord, int> narrowphaseClosed = new Dictionary<Voxel.Coord, int>();\n\t\tprivate static PriorityQueue<NarrowphaseEntry> narrowphaseQueue = new PriorityQueue<NarrowphaseEntry>(new LambdaComparer<NarrowphaseEntry>((x, y) => x.F.CompareTo(y.F)));\n\t\tprivate static Dictionary<Voxel.Coord, NarrowphaseEntry> narrowphaseQueueLookup = new Dictionary<Voxel.Coord, NarrowphaseEntry>();\n\n\t\tpublic static void Narrowphase(Voxel m, Voxel.Coord start, Voxel.Box target, Stack<Voxel.Coord> result)\n\t\t{\n\t\t\tVoxel.Box currentBox = m.GetBox(start);\n\t\t\tif (currentBox == null)\n\t\t\t\treturn;\n\t\t\tVector3 targetPos = target.GetCenter();\n\t\t\tNarrowphaseEntry startEntry = new NarrowphaseEntry\n\t\t\t{\n\t\t\t\tParent = null,\n\t\t\t\tCoord = start,\n\t\t\t\tG = 0,\n\t\t\t\tF = (targetPos - m.GetRelativePosition(start)).Length(),\n\t\t\t};\n\t\t\tnarrowphaseQueue.Push(startEntry);\n\t\t\tnarrowphaseQueueLookup[start] = startEntry;\n\n\t\t\tNarrowphaseEntry closestEntry = null;\n\t\t\tfloat closestHeuristic = float.MaxValue;\n\n\t\t\tint iterations = 0;\n\t\t\twhile (narrowphaseQueue.Count > 0 && iterations < 80)\n\t\t\t{\n\t\t\t\titerations++;\n\n\t\t\t\tNarrowphaseEntry entry = narrowphaseQueue.Pop();\n\n\t\t\t\tif (m.GetBox(entry.Coord) == target)\n\t\t\t\t{\n\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tnarrowphaseQueueLookup.Remove(entry.Coord);\n\n\t\t\t\tnarrowphaseClosed[entry.Coord] = entry.G;\n\t\t\t\tfor (int i = 0; i < 6; i++)\n\t\t\t\t{\n\t\t\t\t\tVoxel.Coord adjacent = entry.Coord.Move(DirectionExtensions.Directions[i]);\n\t\t\t\t\tif (!currentBox.Contains(adjacent) && !target.Contains(adjacent))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tint tentativeGScore = entry.G + 1;\n\n\t\t\t\t\tint previousGScore;\n\t\t\t\t\tbool hasPreviousGScore = narrowphaseClosed.TryGetValue(adjacent, out previousGScore);\n\n\t\t\t\t\tif (hasPreviousGScore && tentativeGScore > previousGScore)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tNarrowphaseEntry alreadyInQueue;\n\t\t\t\t\tnarrowphaseQueueLookup.TryGetValue(adjacent, out alreadyInQueue);\n\n\t\t\t\t\tif (alreadyInQueue == null || tentativeGScore < previousGScore)\n\t\t\t\t\t{\n\t\t\t\t\t\tNarrowphaseEntry newEntry = alreadyInQueue != null ? alreadyInQueue : new NarrowphaseEntry();\n\n\t\t\t\t\t\tnewEntry.Parent = entry;\n\t\t\t\t\t\tnewEntry.G = tentativeGScore;\n\t\t\t\t\t\tfloat heuristic = (targetPos - m.GetRelativePosition(adjacent)).Length();\n\t\t\t\t\t\tnewEntry.F = tentativeGScore + heuristic;\n\n\t\t\t\t\t\tif (heuristic < closestHeuristic)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclosestEntry = newEntry;\n\t\t\t\t\t\t\tclosestHeuristic = heuristic;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (alreadyInQueue == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewEntry.Coord = adjacent;\n\t\t\t\t\t\t\tnarrowphaseQueue.Push(newEntry);\n\t\t\t\t\t\t\tnarrowphaseQueueLookup[adjacent] = newEntry;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnarrowphaseClosed.Clear();\n\t\t\tnarrowphaseQueue.Clear();\n\t\t\tnarrowphaseQueueLookup.Clear();\n\t\t\tif (closestEntry != null)\n\t\t\t\tVoxelAStar.reconstructNarrowphasePath(closestEntry, result);\n\t\t}\n\n\t\t// Search for nearby boxes that meet a filter criteria within a vaguely defined radius\n\t\tpublic static Voxel.Box BroadphaseSearch(Voxel v, Voxel.Coord coord, int radius, Func<Voxel.Box, bool> filter)\n\t\t{\n\t\t\tQueue<Voxel.Box> queue = new Queue<Voxel.Box>();\n\t\t\tDictionary<Voxel.Box, int> visited = new Dictionary<Voxel.Box, int>();\n\t\t\tVoxel.Box startBox = v.GetBox(coord);\n\t\t\tif (startBox == null)\n\t\t\t\treturn null;\n\t\t\tqueue.Enqueue(startBox);\n\t\t\tvisited[startBox] = 0;\n\t\t\tint maxSearch = radius * radius * radius;\n\t\t\tint searchIndex = 0;\n\t\t\twhile (queue.Count > 0 && searchIndex < maxSearch)\n\t\t\t{\n\t\t\t\tsearchIndex++;\n\t\t\t\tVoxel.Box b = queue.Dequeue();\n\t\t\t\tlock (b.Adjacent)\n\t\t\t\t{\n\t\t\t\t\tint parentGScore = visited[b];\n\t\t\t\t\tfor (int i = 0; i < b.Adjacent.Count; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Box adjacent = b.Adjacent[i];\n\t\t\t\t\t\tint tentativeGScore = parentGScore + adjacent.Width * adjacent.Height * adjacent.Depth;\n\t\t\t\t\t\tint previousGScore;\n\t\t\t\t\t\tif (!visited.TryGetValue(adjacent, out previousGScore) || tentativeGScore < previousGScore)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvisited[adjacent] = tentativeGScore;\n\n\t\t\t\t\t\t\tif (parentGScore < radius * radius\n\t\t\t\t\t\t\t\t&& coord.X >= adjacent.X - radius && coord.X < adjacent.X + adjacent.Width + radius\n\t\t\t\t\t\t\t\t&& coord.Y >= adjacent.Y - radius && coord.Y < adjacent.Y + adjacent.Height + radius\n\t\t\t\t\t\t\t\t&& coord.Z >= adjacent.Z - radius && coord.Z < adjacent.Z + adjacent.Depth + radius)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (filter(adjacent))\n\t\t\t\t\t\t\t\t\treturn adjacent;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tqueue.Enqueue(adjacent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Util/VoxelRip.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ComponentBind;\nusing Lemma.Components;\nusing Lemma.Factories;\nusing Microsoft.Xna.Framework;\n\nnamespace Lemma.Util\n{\n\tpublic class VoxelRip\n\t{\n\t\tprivate static Random random = new Random();\n\n\t\tpublic static bool Go(Voxel voxel, Voxel.Coord center, int radius, Action<List<DynamicVoxel>> callback = null)\n\t\t{\n\t\t\tif (!voxel[center].Permanent)\n\t\t\t{\n\t\t\t\t// Break off a chunk of this voxel into a new DynamicMap.\n\n\t\t\t\tList<Voxel.Coord> edges = new List<Voxel.Coord>();\n\n\t\t\t\tVoxel.Coord ripStart = center.Move(-radius, -radius, -radius);\n\t\t\t\tVoxel.Coord ripEnd = center.Move(radius, radius, radius);\n\n\t\t\t\tDictionary<Voxel.Box, bool> permanentBoxes = new Dictionary<Voxel.Box, bool>();\n\t\t\t\tforeach (Voxel.Coord c in ripStart.CoordinatesBetween(ripEnd))\n\t\t\t\t{\n\t\t\t\t\tVoxel.Box box = voxel.GetBox(c);\n\t\t\t\t\tif (box != null && box.Type.Permanent)\n\t\t\t\t\t\tpermanentBoxes[box] = true;\n\t\t\t\t}\n\n\t\t\t\tforeach (Voxel.Box b in permanentBoxes.Keys)\n\t\t\t\t{\n\t\t\t\t\t// Top and bottom\n\t\t\t\t\tfor (int x = b.X - 1; x <= b.X + b.Width; x++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int z = b.Z - 1; z <= b.Z + b.Depth; z++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord coord = new Voxel.Coord { X = x, Y = b.Y + b.Height, Z = z };\n\t\t\t\t\t\t\tif (coord.Between(ripStart, ripEnd))\n\t\t\t\t\t\t\t\tedges.Add(coord);\n\n\t\t\t\t\t\t\tcoord = new Voxel.Coord { X = x, Y = b.Y - 1, Z = z };\n\t\t\t\t\t\t\tif (coord.Between(ripStart, ripEnd))\n\t\t\t\t\t\t\t\tedges.Add(coord);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Outer shell\n\t\t\t\t\tfor (int y = b.Y; y < b.Y + b.Height; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left and right\n\t\t\t\t\t\tfor (int z = b.Z - 1; z <= b.Z + b.Depth; z++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord coord = new Voxel.Coord { X = b.X - 1, Y = y, Z = z };\n\t\t\t\t\t\t\tif (coord.Between(ripStart, ripEnd))\n\t\t\t\t\t\t\t\tedges.Add(coord);\n\n\t\t\t\t\t\t\tcoord = new Voxel.Coord { X = b.X + b.Width, Y = y, Z = z };\n\t\t\t\t\t\t\tif (coord.Between(ripStart, ripEnd))\n\t\t\t\t\t\t\t\tedges.Add(coord);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Backward and forward\n\t\t\t\t\t\tfor (int x = b.X; x < b.X + b.Width; x++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVoxel.Coord coord = new Voxel.Coord { X = x, Y = y, Z = b.Z - 1 };\n\t\t\t\t\t\t\tif (coord.Between(ripStart, ripEnd))\n\t\t\t\t\t\t\t\tedges.Add(coord);\n\n\t\t\t\t\t\t\tcoord = new Voxel.Coord { X = x, Y = y, Z = b.Z + b.Depth };\n\t\t\t\t\t\t\tif (coord.Between(ripStart, ripEnd))\n\t\t\t\t\t\t\t\tedges.Add(coord);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (edges.Contains(center))\n\t\t\t\t\treturn false;\n\n\t\t\t\t// Top and bottom\n\t\t\t\tfor (int x = ripStart.X; x <= ripEnd.X; x++)\n\t\t\t\t{\n\t\t\t\t\tfor (int z = ripStart.Z; z <= ripEnd.Z; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord c = new Voxel.Coord { X = x, Y = ripStart.Y, Z = z };\n\t\t\t\t\t\tVoxel.State s = voxel[c];\n\t\t\t\t\t\tif (s != Voxel.States.Empty && !s.Permanent)\n\t\t\t\t\t\t\tedges.Add(c);\n\t\t\t\t\t\tc = new Voxel.Coord { X = x, Y = ripEnd.Y, Z = z };\n\t\t\t\t\t\ts = voxel[c];\n\t\t\t\t\t\tif (s != Voxel.States.Empty && !s.Permanent)\n\t\t\t\t\t\t\tedges.Add(c);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Sides\n\t\t\t\tfor (int y = ripStart.Y + 1; y <= ripEnd.Y - 1; y++)\n\t\t\t\t{\n\t\t\t\t\t// Left and right\n\t\t\t\t\tfor (int z = ripStart.Z; z <= ripEnd.Z; z++)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord c = new Voxel.Coord { X = ripStart.X, Y = y, Z = z };\n\t\t\t\t\t\tVoxel.State s = voxel[c];\n\t\t\t\t\t\tif (s != Voxel.States.Empty && !s.Permanent)\n\t\t\t\t\t\t\tedges.Add(c);\n\t\t\t\t\t\tc = new Voxel.Coord { X = ripEnd.X, Y = y, Z = z };\n\t\t\t\t\t\ts = voxel[c];\n\t\t\t\t\t\tif (s != Voxel.States.Empty && !s.Permanent)\n\t\t\t\t\t\t\tedges.Add(c);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Backward and forward\n\t\t\t\t\tfor (int x = ripStart.X; x <= ripEnd.X; x++)\n\t\t\t\t\t{\n\t\t\t\t\t\tVoxel.Coord c = new Voxel.Coord { X = x, Y = y, Z = ripStart.Z };\n\t\t\t\t\t\tVoxel.State s = voxel[c];\n\t\t\t\t\t\tif (s != Voxel.States.Empty && !s.Permanent)\n\t\t\t\t\t\t\tedges.Add(c);\n\t\t\t\t\t\tc = new Voxel.Coord { X = x, Y = y, Z = ripEnd.Z };\n\t\t\t\t\t\ts = voxel[c];\n\t\t\t\t\t\tif (s != Voxel.States.Empty && !s.Permanent)\n\t\t\t\t\t\t\tedges.Add(c);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tPropagator p = WorldFactory.Instance.Get<Propagator>();\n\t\t\t\tforeach (Voxel.Coord c in edges)\n\t\t\t\t\tp.SparksLowPriority(voxel.GetAbsolutePosition(c), Propagator.Spark.Dangerous);\n\n\t\t\t\tvoxel.Empty(edges);\n\n\t\t\t\tvoxel.Regenerate(callback);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static void Consolidate(Main main, DynamicVoxel voxel, float interval = 1.0f)\n\t\t{\n\t\t\tint maxDistance = 12;\n\t\t\tVoxel closestVoxel = null;\n\t\t\tVoxel.Coord closestCoord = new Voxel.Coord();\n\t\t\tforeach (Voxel m in Voxel.ActivePhysicsVoxels)\n\t\t\t{\n\t\t\t\tif (m == voxel)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tVoxel.Coord relativeCoord = m.GetCoordinate(voxel.Transform.Value.Translation);\n\t\t\t\tVoxel.Coord? closestFilled = m.FindClosestFilledCell(relativeCoord, maxDistance);\n\t\t\t\tif (closestFilled != null)\n\t\t\t\t{\n\t\t\t\t\tmaxDistance = Math.Min(Math.Abs(relativeCoord.X - closestFilled.Value.X), Math.Min(Math.Abs(relativeCoord.Y - closestFilled.Value.Y), Math.Abs(relativeCoord.Z - closestFilled.Value.Z)));\n\t\t\t\t\tclosestVoxel = m;\n\t\t\t\t\tclosestCoord = closestFilled.Value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (closestVoxel != null)\n\t\t\t\tVoxelRip.Consolidate(main, voxel, closestVoxel, closestCoord, interval);\n\t\t}\n\t\t\n\t\tpublic static void Consolidate(Main main, DynamicVoxel voxel, Voxel targetVoxel, Voxel.Coord targetCoord, float interval = 1.0f)\n\t\t{\n\t\t\tif (targetVoxel != null)\n\t\t\t{\n\t\t\t\t// Combine this map with the other one\n\n\t\t\t\tDirection x = targetVoxel.GetRelativeDirection(voxel.GetAbsoluteVector(Vector3.Right));\n\t\t\t\tDirection y = targetVoxel.GetRelativeDirection(voxel.GetAbsoluteVector(Vector3.Up));\n\t\t\t\tDirection z = targetVoxel.GetRelativeDirection(voxel.GetAbsoluteVector(Vector3.Backward));\n\n\t\t\t\tif (x.IsParallel(y))\n\t\t\t\t\tx = y.Cross(z);\n\t\t\t\telse if (y.IsParallel(z))\n\t\t\t\t\ty = x.Cross(z);\n\n\t\t\t\tVoxel.Coord offset = new Voxel.Coord();\n\t\t\t\tfloat closestCoordDistance = float.MaxValue;\n\t\t\t\tVector3 closestCoordPosition = targetVoxel.GetAbsolutePosition(targetCoord);\n\t\t\t\tlock (voxel.MutationLock)\n\t\t\t\t{\n\t\t\t\t\tforeach (Voxel.Coord c in voxel.Chunks.SelectMany(c => c.Boxes).SelectMany(b => b.GetCoords()))\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat distance = (voxel.GetAbsolutePosition(c) - closestCoordPosition).LengthSquared();\n\t\t\t\t\t\tif (distance < closestCoordDistance)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclosestCoordDistance = distance;\n\t\t\t\t\t\t\toffset = c;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tVector3 toLevitatingMap = voxel.Transform.Value.Translation - targetVoxel.GetAbsolutePosition(targetCoord);\n\t\t\t\toffset = offset.Move(voxel.GetRelativeDirection(-toLevitatingMap));\n\n\t\t\t\tQuaternion orientation = Quaternion.CreateFromRotationMatrix(voxel.Transform.Value);\n\n\t\t\t\tEffectBlockFactory blockFactory = Factory.Get<EffectBlockFactory>();\n\n\t\t\t\tint index = 0;\n\t\t\t\tList<Voxel.Coord> coords;\n\t\t\t\tlock (voxel.MutationLock)\n\t\t\t\t\tcoords = voxel.Chunks.SelectMany(c => c.Boxes).SelectMany(b => b.GetCoords()).ToList();\n\t\t\t\tVoxel.Coord camera = voxel.GetCoordinate(main.Camera.Position);\n\t\t\t\tforeach (Voxel.Coord c in coords.OrderBy(c2 => new Vector3(c2.X - camera.X, c2.Y - camera.Y, c2.Z - camera.Z).LengthSquared()))\n\t\t\t\t{\n\t\t\t\t\tVoxel.Coord offsetFromCenter = c.Move(-offset.X, -offset.Y, -offset.Z);\n\t\t\t\t\tVoxel.Coord targetCoord2 = new Voxel.Coord();\n\t\t\t\t\ttargetCoord2.SetComponent(x, offsetFromCenter.GetComponent(Direction.PositiveX));\n\t\t\t\t\ttargetCoord2.SetComponent(y, offsetFromCenter.GetComponent(Direction.PositiveY));\n\t\t\t\t\ttargetCoord2.SetComponent(z, offsetFromCenter.GetComponent(Direction.PositiveZ));\n\t\t\t\t\ttargetCoord2 = targetCoord2.Move(targetCoord.X, targetCoord.Y, targetCoord.Z);\n\t\t\t\t\tif (targetVoxel[targetCoord2].ID == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tEntity blockEntity = blockFactory.CreateAndBind(main);\n\t\t\t\t\t\tc.Data.ApplyToEffectBlock(blockEntity.Get<ModelInstance>());\n\t\t\t\t\t\tEffectBlock effectBlock = blockEntity.Get<EffectBlock>();\n\t\t\t\t\t\teffectBlock.Offset.Value = targetVoxel.GetRelativePosition(targetCoord2);\n\t\t\t\t\t\teffectBlock.DoScale = false;\n\t\t\t\t\t\teffectBlock.StartPosition = voxel.GetAbsolutePosition(c);\n\t\t\t\t\t\teffectBlock.StartOrientation = orientation;\n\t\t\t\t\t\teffectBlock.TotalLifetime = (0.05f + (index * 0.0075f)) * interval;\n\t\t\t\t\t\teffectBlock.Setup(targetVoxel.Entity, targetCoord2, c.Data.ID);\n\t\t\t\t\t\tmain.Add(blockEntity);\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Delete the map\n\t\t\t\tvoxel.Entity.Delete.Execute();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "Lemma/Util/WwisePicker.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing ComponentBind;\n\nnamespace Lemma.Util\n{\n\tpublic class WwisePicker\n\t{\n\t\tprivate static ListProperty<KeyValuePair<uint, string>> list;\n\t\tpublic static ListProperty<KeyValuePair<uint, string>> Get(Main main)\n\t\t{\n\t\t\tif (main.EditorEnabled)\n\t\t\t{\n\t\t\t\tif (list == null)\n\t\t\t\t{\n\t\t\t\t\tlist = new ListProperty<KeyValuePair<uint, string>>();\n\t\t\t\t\tlist.Add(new KeyValuePair<uint, string>(0, \"[null]\"));\n\t\t\t\t\tFieldInfo[] members = typeof(AK.EVENTS).GetFields(BindingFlags.Static | BindingFlags.Public);\n\t\t\t\t\tfor (int i = 0; i < members.Length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tFieldInfo field = members[i];\n\t\t\t\t\t\tlist.Add(new KeyValuePair<uint, string>((uint)field.GetValue(null), field.Name));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn list;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Lemma/WwiseIDConverter.py",
    "content": "'''\nCreated on Mar 12, 2013\n\n@author: bli\n'''\n\nimport sys, os, argparse\nfrom os.path import exists, join, dirname, abspath\nScriptDir = abspath(dirname(__file__))\ng_PosixLinebreak = '\\n'\n\nclass WwiseIDConverter(object):\n\t'''Convert Wwise soundbank ID header from C++ to C#. Save it under the same folder of the input header.'''\n\n\tdef __init__(self, inHeader, outputDirectory):\n\t\tself.inHeader = inHeader\n\t\tself.outHeader = join(outputDirectory, 'Wwise_IDs.cs')\n\t\n\tdef Convert(self):\n\t\tlines = self._ImportFile(self.inHeader)\n\n\t\t# Extract ID part\n\t\tIDStartKey = 'namespace'\n\t\tstartLine = self._FindKeyLine(lines, IDStartKey)\n\t\tIDEndKey = '#endif'\n\t\tendLine = self._FindKeyLine(lines, IDEndKey)\n\t\tlines = lines[startLine : endLine]\n\t\n\t\t# Use C# class for namespace\n\t\tCType = 'namespace'\n\t\tCSType = 'public class'\n\t\tself._ReplaceLineByLine(lines, CType, CSType)\n\t\n\t\n\t\t# Replace AK type with C# types\n\t\tCType = 'static const AkUniqueID'\n\t\tCSType = 'public static uint'\n\t\tself._ReplaceLineByLine(lines, CType, CSType)\n\t\n\t\toutDir = abspath(dirname(self.outHeader))\n\t\tif not os.path.exists(outDir):\n\t\t\tos.makedirs(outDir)\n\t\tself._ExportFile(self.outHeader, lines)\n\t\n\tdef _ImportFile(self, inputFile):\n\t\trawLines = []\n\t\twith open(inputFile) as f:\n\t\t\trawLines = f.readlines()\n\t\t\tf.close()\n\t\t\n\t\treturn rawLines\n\t\n\tdef _ExportFile(self, outputFile, outputLines):\n\t\t# append line separators if none\n\t\tfor ll in range(len(outputLines)):\n\t\t\thasNoLinebreak = outputLines[ll].find(os.linesep) == -1 and outputLines[ll].find(g_PosixLinebreak) == -1\n\t\t\tif hasNoLinebreak:\n\t\t\t\toutputLines[ll] += g_PosixLinebreak\n\t\t\t\n\t\twith open(outputFile, 'w') as f:\n\t\t\tf.writelines(outputLines)\n\t\t\tf.close()\n\t\n\t\n\tdef _FindKeyLine(self, lines, key):\n\t\tkeyLineNumber = 0\n\t\tfor ll in range(len(lines)):\n\t\t\tfoundKey = lines[ll].find(key) != -1\n\t\t\tif foundKey:\n\t\t\t\tkeyLineNumber = ll\n\t\t\t\tbreak\n\t\treturn keyLineNumber\n\t\n\tdef _ReplaceLineByLine(self, lines, inPattern, outPattern):\n\t\tfor ll in range(len(lines)):\n\t\t\tnamespaceStartCol = lines[ll].find(inPattern)\n\t\t\tfoundNamespace = namespaceStartCol != -1\n\t\t\tif foundNamespace:\n\t\t\t\tlines[ll] = lines[ll].replace(inPattern, outPattern)\n\t\t\nif __name__ == '__main__':\n\tparser = argparse.ArgumentParser(description='Convert Wwise SoundBank ID C++ header into C# for Unity.')\n\tparser.add_argument('WwiseIDHeader', action='store', default='UndefinedHeader', help='Full path to Wwise SoundBank ID C++ header, e.g., Wwise_IDs.h')\n\tparser.add_argument('OutputDirectory', action='store', default=None, help='Output directory (defaults to the same folder)')\n\t\n\targs = parser.parse_args()\n\tinHeader = args.WwiseIDHeader\n\tif not exists(inHeader):\n\t\traise RuntimeError('Input header file does not exist: {}'.format(inHeader))\n\tif args.OutputDirectory is None:\n\t\targs.OutputDirectory = os.path.dirname(inHeader)\n\t\n\tconverter = WwiseIDConverter(inHeader, args.OutputDirectory)\n\tconverter.Convert()\n\n"
  },
  {
    "path": "Lemma/Wwise_IDs.cs",
    "content": "public class AK\n{\n    public class EVENTS\n    {\n        public static uint EVIL_CUBES_CHASE = 654471079U;\n        public static uint EVIL_CUBES_IDLE = 1697385721U;\n        public static uint FOOTSTEP_PLAY = 1531891632U;\n        public static uint PAUSE_ALL = 3864097025U;\n        public static uint PAUSE_DISTRACTING_SOUNDS = 1662086833U;\n        public static uint PLAY_BIG_WIND = 217752029U;\n        public static uint PLAY_BLOCK_BUILD = 1262469596U;\n        public static uint PLAY_BLOCK_RUMBLE = 2442588307U;\n        public static uint PLAY_BLUE_BURN = 216387374U;\n        public static uint PLAY_CAMERA_SHUTTER = 1401567661U;\n        public static uint PLAY_COLLECTIBLE = 661747096U;\n        public static uint PLAY_CRUMBLE = 4130713930U;\n        public static uint PLAY_DOOR_AMBIENCE = 48136393U;\n        public static uint PLAY_DOOR_OPEN = 1660008929U;\n        public static uint PLAY_EVIL_CUBES = 1708164667U;\n        public static uint PLAY_EXPLOSION = 4030404899U;\n        public static uint PLAY_EXPLOSION_CLOSE = 2460394138U;\n        public static uint PLAY_EXTERIOR_WIND = 2186390081U;\n        public static uint PLAY_FLOATER_BUILD = 1370228436U;\n        public static uint PLAY_FOREST_VALLEY_AMBIENT = 954121400U;\n        public static uint PLAY_GLOWSQUARE = 2925563572U;\n        public static uint PLAY_MAGIC_CUBE_LOOP = 3187778582U;\n        public static uint PLAY_MAGIC_CUBE_STINGER = 2253299882U;\n        public static uint PLAY_MAGIC_CUBES = 4209015896U;\n        public static uint PLAY_MONOLITH_LOOP = 1920428907U;\n        public static uint PLAY_MONOLITH_POWERUP = 1490340003U;\n        public static uint PLAY_MUSIC_AQUA = 3353261050U;\n        public static uint PLAY_MUSIC_DARK = 2649426350U;\n        public static uint PLAY_MUSIC_DARK2 = 1191197912U;\n        public static uint PLAY_MUSIC_DAWN = 2565538184U;\n        public static uint PLAY_MUSIC_DAWN_RANDOM = 3887439446U;\n        public static uint PLAY_MUSIC_FOREST = 1820169829U;\n        public static uint PLAY_MUSIC_FROST = 3147354588U;\n        public static uint PLAY_MUSIC_NOSTALGIC = 1765947264U;\n        public static uint PLAY_MUSIC_OVERVIEW = 2507565207U;\n        public static uint PLAY_MUSIC_RAIN = 3259798356U;\n        public static uint PLAY_MUSIC_STINGER = 1904807532U;\n        public static uint PLAY_MUSIC_STINGER_02 = 1344053969U;\n        public static uint PLAY_MUSIC_STINGER_03 = 1344053968U;\n        public static uint PLAY_MUSIC_THEME_LOOP = 4120562202U;\n        public static uint PLAY_NOTE_DROP = 4017882330U;\n        public static uint PLAY_NOTE_PICKUP = 2403250269U;\n        public static uint PLAY_ORANGE_BURN = 1341922784U;\n        public static uint PLAY_PHONE_PICKUP = 2791348401U;\n        public static uint PLAY_PHONE_SEND = 1672978639U;\n        public static uint PLAY_PHONE_VIBRATE = 1246969326U;\n        public static uint PLAY_PHYSICS_SLAM = 4268997543U;\n        public static uint PLAY_PHYSICS_SLAM_LARGE = 340000179U;\n        public static uint PLAY_PLAYER_BREATHING_SOFT = 4243459973U;\n        public static uint PLAY_PLAYER_CLOTHING = 1403802228U;\n        public static uint PLAY_PLAYER_DEATH = 1835085974U;\n        public static uint PLAY_PLAYER_FALL = 1306343379U;\n        public static uint PLAY_PLAYER_GASP = 3609231453U;\n        public static uint PLAY_PLAYER_GRUNT = 4270092958U;\n        public static uint PLAY_PLAYER_HURT = 887999531U;\n        public static uint PLAY_PLAYER_JUMP = 562256996U;\n        public static uint PLAY_PLAYER_LAND = 4249207015U;\n        public static uint PLAY_PLAYER_ROLL = 2370959289U;\n        public static uint PLAY_PLAYER_SLIDE = 2425231895U;\n        public static uint PLAY_PLAYER_SLIDE_LOOP = 693421804U;\n        public static uint PLAY_PLAYER_VAULT = 1447419404U;\n        public static uint PLAY_RAIN = 2838936948U;\n        public static uint PLAY_RED_BURN = 472607653U;\n        public static uint PLAY_RIFT = 2887989871U;\n        public static uint PLAY_RIFT_BLOCK = 2879928657U;\n        public static uint PLAY_RIFT_OPEN = 2529943266U;\n        public static uint PLAY_SIGNAL_TOWER_ACTIVATE = 2645903392U;\n        public static uint PLAY_SIGNAL_TOWER_LOOP = 1879386073U;\n        public static uint PLAY_SNAKE = 324904978U;\n        public static uint PLAY_SWITCH_MUSIC1 = 1893257791U;\n        public static uint PLAY_SWITCH_MUSIC2 = 1893257788U;\n        public static uint PLAY_SWITCH_MUSIC3 = 1893257789U;\n        public static uint PLAY_SWITCH_MUSIC4 = 1893257786U;\n        public static uint PLAY_SWITCH_OFF = 1895765680U;\n        public static uint PLAY_SWITCH_ON = 1693166490U;\n        public static uint PLAY_THUNDER = 3870462868U;\n        public static uint PLAY_TOWER_FALL = 2207156983U;\n        public static uint PLAY_TURRET_CHARGE = 3393910755U;\n        public static uint PLAY_TURRET_DEATH = 3291199175U;\n        public static uint PLAY_TURRET_FIRE = 3057469883U;\n        public static uint PLAY_TURRET_LOOP = 1669082849U;\n        public static uint PLAY_TURRET_MISS = 187900779U;\n        public static uint PLAY_UI_CLICK = 1749424733U;\n        public static uint PLAY_UI_MOUSEOVER = 808445146U;\n        public static uint PLAY_UI_SWOOSH = 935590362U;\n        public static uint PLAY_WALL_BREAK = 4127016698U;\n        public static uint PLAY_WATER_LOOP = 1564978696U;\n        public static uint PLAY_WATER_SPLASH = 1591852251U;\n        public static uint PLAY_WATER_SPLASH_HEAVY = 1166068147U;\n        public static uint PLAY_WATER_SPLASH_OUT = 332641338U;\n        public static uint PLAY_WATER_SPLASH_OUT_BIG = 571717257U;\n        public static uint PLAY_WATERFALL_LOOP = 2021604517U;\n        public static uint PLAY_WHITE_LIGHT = 3583610488U;\n        public static uint PLAY_WHITE_LIGHT_HIT = 1136344990U;\n        public static uint PLAY_WHITE_SHATTER = 2667853543U;\n        public static uint RESUME_ALL = 3679762312U;\n        public static uint SLIDER1_LOOP = 654783868U;\n        public static uint SLIDER1_STOP = 2742134786U;\n        public static uint SLIDER2_LOOP = 2295651613U;\n        public static uint SLIDER2_STOP = 1466206051U;\n        public static uint SLIDER3_LOOP = 2278489546U;\n        public static uint SLIDER3_STOP = 1648258440U;\n        public static uint STOP_ALL = 452547817U;\n        public static uint STOP_ALL_OBJECT = 2638811145U;\n        public static uint STOP_BLOCK_RUMBLE = 1611896069U;\n        public static uint STOP_DOOR_AMBIENCE = 2699574911U;\n        public static uint STOP_EVIL_CUBES = 3034540413U;\n        public static uint STOP_EXTERIOR_WIND = 4269705691U;\n        public static uint STOP_FOREST_VALLEY_AMBIENT = 2984996438U;\n        public static uint STOP_GLOWSQUARE = 1198720254U;\n        public static uint STOP_MAGIC_CUBE_LOOP = 2741847256U;\n        public static uint STOP_MUSIC = 2837384057U;\n        public static uint STOP_MUSIC_FOREST = 2506571047U;\n        public static uint STOP_MUSIC_THEME = 2480681107U;\n        public static uint STOP_PLAYER_BREATHING_SOFT = 1454416799U;\n        public static uint STOP_PLAYER_FALL = 3680109729U;\n        public static uint STOP_PLAYER_SLIDE_LOOP = 651971942U;\n        public static uint STOP_RAIN = 3206237490U;\n        public static uint STOP_SIGNAL_TOWER_LOOP = 2826848843U;\n        public static uint STOP_SNAKE = 380055560U;\n        public static uint STOP_TURRET_LOOP = 328308863U;\n        public static uint STOP_WATER_LOOP = 105164338U;\n        public static uint STOP_WATERFALL_LOOP = 552611043U;\n        public static uint STOP_WHITE_LIGHT = 2253775078U;\n    } // public class EVENTS\n\n    public class STATES\n    {\n        public class WATER\n        {\n            public static uint GROUP = 2654748154U;\n\n            public class STATE\n            {\n                public static uint NORMAL = 1160234136U;\n                public static uint UNDERWATER = 2213237662U;\n            } // public class STATE\n        } // public class WATER\n\n    } // public class STATES\n\n    public class SWITCHES\n    {\n        public class FOOTSTEP_MATERIAL\n        {\n            public static uint GROUP = 684570577U;\n\n            public class SWITCH\n            {\n                public static uint GRAVEL = 2185786256U;\n                public static uint METAL = 2473969246U;\n                public static uint SAND = 803837735U;\n                public static uint STONE = 1216965916U;\n                public static uint WOOD = 2058049674U;\n            } // public class SWITCH\n        } // public class FOOTSTEP_MATERIAL\n\n    } // public class SWITCHES\n\n    public class GAME_PARAMETERS\n    {\n        public static uint MUSIC_AMBIENT_PROGRESS = 2736694343U;\n        public static uint PAUSE_PARAMETER = 2977051669U;\n        public static uint PHYSICS_SLAM_SIZE = 2607872900U;\n        public static uint RAIN_VOLUME = 2458116344U;\n        public static uint SFX_GLOWSQUARE_PITCH = 3613648624U;\n        public static uint SFX_PLAYER_FALL = 1894448894U;\n        public static uint SFX_PLAYER_SLIDE = 4199053580U;\n        public static uint SFX_TURRET_PITCH = 905427040U;\n        public static uint SFX_WATER_SPLASH_VOLUME = 4073721865U;\n        public static uint SLOWMOTION = 340593036U;\n        public static uint VOLUME_MUSIC = 3891337659U;\n        public static uint VOLUME_SFX = 3673881719U;\n    } // public class GAME_PARAMETERS\n\n    public class BANKS\n    {\n        public static uint INIT = 1355168291U;\n        public static uint APARTMENT = 4154495109U;\n        public static uint AQUA = 3149800173U;\n        public static uint DARK2 = 2462366677U;\n        public static uint DAWN = 2009803003U;\n        public static uint FOREST = 491961918U;\n        public static uint FROST = 1747045785U;\n        public static uint MONOLITH = 346542641U;\n        public static uint NOSTALGIC = 1863221701U;\n        public static uint RAIN = 2043403999U;\n        public static uint SFX_BANK_01 = 1878155811U;\n    } // public class BANKS\n\n    public class BUSSES\n    {\n        public static uint BUS_ALL_SFX = 463913585U;\n        public static uint BUS_MUSIC = 1162281553U;\n        public static uint BUS_SFX = 3895923845U;\n        public static uint BUS_SFX_BREATHDUCK = 3381165833U;\n        public static uint BUS_SFX_BREATHINGINPUT = 3302530918U;\n        public static uint BUS_SFX_EXPLOSION = 975872589U;\n        public static uint BUS_UI = 1746463750U;\n        public static uint MASTER_AUDIO_BUS = 3803692087U;\n        public static uint MASTER_SECONDARY_BUS = 805203703U;\n    } // public class BUSSES\n\n    public class AUX_BUSSES\n    {\n        public static uint REVERB = 348963605U;\n        public static uint REVERB_SUBTLE = 1938853151U;\n    } // public class AUX_BUSSES\n\n}// public class AK\n\n"
  },
  {
    "path": "Lemma/app.manifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<asmv1:assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv1=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv2=\"urn:schemas-microsoft-com:asm.v2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <assemblyIdentity version=\"1.0.0.0\" name=\"Lemma.app\"/>\n  <asmv1:application  xmlns:asmv1=\"urn:schemas-microsoft-com:asm.v1\">\n    <asmv1:windowsSettings xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">\n      <dpiAware>True/PM</dpiAware>\n    </asmv1:windowsSettings>\n  </asmv1:application>\n</asmv1:assembly>\n"
  },
  {
    "path": "Lemma/attribution.txt",
    "content": "Created by Evan Todd\nhttp://etodd.io\n\n------------------------------------------\n\nCollaborators\n\nAntonio Yáñez -- Animation\nhttp://www.ayaba.graphics\n\nAshton Morris -- Music and sound\nhttp://ashtonmorris.com\n\nJosh Coffey -- Programming\nhttp://geel.io\n\nJack Menhorn -- Music and sound\nhttp://jackmenhorn.com\n\nNaila Burney -- Sound and voice acting\nhttps://www.behance.net/nailaburney\n\nSam Gebhardt -- Promotional artwork\nhttp://samgebhardt.com/\n\n------------------------------------------\n\nCGTextures source material\n\nLemma/Content/Textures/red-rock.png\nLemma/Content/Textures/red-rock-normal.png\nLemma/Content/Textures/rock-grass.png\nLemma/Content/Textures/rock-grass-normal.png\nLemma/Content/Textures/hex.png\nLemma/Content/Textures/hex-normal.png\nLemma/Content/Textures/lattice.png\nLemma/Content/Textures/lattice-normal.png\n\n------------------------------------------\n\nSkyboxes\n\nTim Heldna\nhttp://www.garagegames.com/community/blogs/view/12655\nJockum Skoglund aka hipshot\nhttp://www.zfight.com\nColin Lowndes\nhttp://www.3delyvisions.com\n'The Mighty Pete'\nhttp://www.petesoasis.com\n\n------------------------------------------\n\nImages / photos\n\nfoliage.png based on Leaves-4145.jpg by David R. Tribble\nhttp://commons.wikimedia.org/wiki/File:Leaves-4146.jpg\nTribal photo - \"Índios isolados no Acre 3\" by Gleilson Miranda / Governo do Acre\nhttp://www.flickr.com/photos/fotosdoacre/3793140793/in/set-72157621833492035.\nLicensed under Creative Commons Attribution 2.0 via Wikimedia Commons\nhttp://commons.wikimedia.org/wiki/File:%C3%8Dndios_isolados_no_Acre_3.jpg\n\n------------------------------------------\n\nFreesound audio source material\n\nhttp://freesound.org\n\nlucid drone.wav by decembered -- License: Attribution\nhttp://www.freesound.org/people/decembered/sounds/42761/ \ncoldwater_waves.wav by Corsica_S -- License: Attribution\nhttp://www.freesound.org/people/Corsica_S/sounds/92822/ \nWater_Splash_Objects_falling.aif by Dynamicell -- License: Attribution\nhttp://www.freesound.org/people/Dynamicell/sounds/17832/ \nSS BOOM 01.wav by sandyrb -- License: Attribution\nhttp://www.freesound.org/people/sandyrb/sounds/84346/ \nrbh rain 01-04.wav by RHumphries -- License: Attribution\nhttp://www.freesound.org/people/RHumphries/sounds/2519/ \nmega-thunder.wav by Erdie -- License: Attribution\nhttp://www.freesound.org/people/Erdie/sounds/24003/ \nrbh thunder storm.wav by RHumphries -- License: Attribution\nhttp://www.freesound.org/people/RHumphries/sounds/2523/ \nsalt 1-3.wav by melack -- License: Attribution/\nhttp://www.freesound.org/people/melack/sounds/9191 \nSplash.wav by daveincamas -- License: Attribution\nhttp://www.freesound.org/people/daveincamas/sounds/59104/ \nBreathOfDeath.aif by gabemiller74 -- License: Attribution\nhttp://www.freesound.org/people/gabemiller74/sounds/60571/ \nSplash 1.wav by FreqMan -- License: Attribution\nhttp://www.freesound.org/people/FreqMan/sounds/25819/ \nPage_Turn_29.wav by Koops -- License: Attribution\nhttp://www.freesound.org/people/Koops/sounds/20263/ \n\n------------------------------------------\n\nPlayer model adapted from MakeHuman\nhttp://makehuman.org/\n\nMoral support and maintenance of sanity thanks to The Central Ohio Gamedev Group\nhttp://www.meetup.com/The-Cogg/\n\nPolish translation by Łukasz Zając & Bartosz Michalik\nSpanish translation by Antonio Baena\nHungarian translation by Zsolt Brechler\nTurkish translation by Recep Samed Üçer & Umut Can Turan\nFrench translation by Le-Kinder\n\n------------------------------------------\n\nSpecial thanks to\n\nMy parents\n\n------------------------------------------\n\nHe was pierced for our transgressions;\nHe was crushed for our iniquities."
  },
  {
    "path": "Lemma/build-demo.bat",
    "content": "rm bin/x86/Release/Content/Game/Images/*.xnb\nrm bin/x86/Release/Content/Game/Models/*.xnb\nrm bin/x86/Release/Content/Game/*.map\nrm bin/x86/Release/Content/Game/*.xlsx\nrm bin/x86/Release/Content/Game/*.dlz\nrm bin/x86/Release/Content/Game/Challenge/*.map\nrm bin/x86/Release/Content/Wwise/Windows/*.bnk\n\ncp bin/x86/Debug/Content/Game/Images/material-propagation.xnb bin/x86/Release/Content/Game/Images\ncp bin/x86/Debug/Content/Game/Images/wave-functions.xnb bin/x86/Release/Content/Game/Images\n\ncp Game/rain.map bin/x86/Release/Content/Game\ncp Game/rain.xlsx bin/x86/Release/Content/Game\ncp Game/rain.dlz bin/x86/Release/Content/Game\n\ncp Game/dawn.map bin/x86/Release/Content/Game\ncp Game/dawn.xlsx bin/x86/Release/Content/Game\ncp Game/dawn.dlz bin/x86/Release/Content/Game\n\ncp Game/dawn2.map bin/x86/Release/Content/Game\n\ncp \"Game/Challenge/01 - Tunnel.map\" bin/x86/Release/Content/Game/Challenge\ncp \"Game/Challenge/02 - Desert.map\" bin/x86/Release/Content/Game/Challenge\ncp \"Game/Challenge/03 - Twilight.map\" bin/x86/Release/Content/Game/Challenge\ncp \"Game/Challenge/04 - Gauntlet.map\" bin/x86/Release/Content/Game/Challenge\ncp \"Game/Challenge/05 - Rubicon.map\" bin/x86/Release/Content/Game/Challenge\n\ncp Content/Wwise/Windows/Dark2.bnk bin/x86/Release/Content/Wwise/Windows\ncp Content/Wwise/Windows/Dawn.bnk bin/x86/Release/Content/Wwise/Windows\ncp Content/Wwise/Windows/Init.bnk bin/x86/Release/Content/Wwise/Windows\ncp Content/Wwise/Windows/Rain.bnk bin/x86/Release/Content/Wwise/Windows\ncp Content/Wwise/Windows/SFX_Bank_01.bnk bin/x86/Release/Content/Wwise/Windows\n"
  },
  {
    "path": "Lemma/build-nonsteam.bat",
    "content": "rm bin/x86/Release/*.xml\nrm bin/x86/Release/steam_api.dll\nrm bin/x86/Release/CSteamworks.dll\nrm bin/x86/Release/steam_appid.txt"
  },
  {
    "path": "Lemma/maps-compress.bat",
    "content": "cd Game\ngzip *.map\nFOR %%f IN (*.map.gz) DO RENAME \"%%f\" \"%%~nf\"\ncd Challenge\ngzip *.map\nFOR %%f IN (*.map.gz) DO RENAME \"%%f\" \"%%~nf\"\ncd ../../Content\ngzip *.map\nFOR %%f IN (*.map.gz) DO RENAME \"%%f\" \"%%~nf\"\ncd .."
  },
  {
    "path": "Lemma/maps-decompress.bat",
    "content": "cd Game\nren *.map *.map.gz\ngzip -d *.map.gz\ncd Challenge\nren *.map *.map.gz\ngzip -d *.map.gz\ncd ../../Content\nren *.map *.map.gz\ngzip -d *.map.gz\ncd .."
  },
  {
    "path": "Lemma/maps-save.bat",
    "content": "cp bin/x86/Debug/Content/Game/*.map Game/\ncp bin/x86/Debug/Content/Game/Challenge/*.map Game/Challenge\ncp bin/x86/Debug/Content/*.map Content/"
  },
  {
    "path": "Lemma/steam_appid.txt",
    "content": "300340"
  },
  {
    "path": "Lemma/wwise-convert-ids.bat",
    "content": "python WwiseIDConverter.py Wwise_IDs.h .\\\ndel Wwise_IDs.h"
  },
  {
    "path": "Lemma/wwise-sync.bat",
    "content": "copy C:\\Users\\Evan\\Dropbox\\Lemma\\Current\\GeneratedSoundBanks\\Windows\\*.bnk Content\\Wwise\\Windows\\\ncopy C:\\Users\\Evan\\Dropbox\\Lemma\\Current\\GeneratedSoundBanks\\Wwise_IDs.h .\\\ncall wwise-convert-ids.bat"
  },
  {
    "path": "Lemma.XNA.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2013\nVisualStudioVersion = 12.0.40629.0\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Lemma.XNA\", \"Lemma\\Lemma.XNA.csproj\", \"{3D2D163E-393B-4AFD-997B-143E909AC653}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"EngineContent.XNA\", \"Lemma\\Content\\EngineContent.XNA.contentproj\", \"{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SkinnedModelContent\", \"SkinnedModel\\SkinnedModelContent.csproj\", \"{882A32E7-CB48-4E63-8180-0D1859575723}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"PipelineExtensions.XNA\", \"PipelineExtensions\\PipelineExtensions.XNA.csproj\", \"{4636C7E1-B845-4B83-B96D-64A11B8A4515}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"BEPUphysics\", \"BEPUphysics\\BEPUphysics.csproj\", \"{2A9D2227-78D7-4804-B6D1-560BB43AE911}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"BEPUutilities\", \"BEPUutilities\\BEPUutilities.csproj\", \"{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Game.XNA\", \"Lemma\\Game\\Game.XNA.contentproj\", \"{D487DC94-C8CB-44EB-8A6C-026D03936D1A}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Excel\", \"Excel\\Excel.csproj\", \"{4CB0690E-3E7A-497C-9116-D52024F63195}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.SharpZLib\", \"SharpZipLib\\src\\ICSharpCode.SharpZLib.csproj\", \"{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Wwise\", \"Wwise\\Wwise.csproj\", \"{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ComponentBind\", \"ComponentBind\\ComponentBind.csproj\", \"{2D0637AB-A380-4C97-A329-BF7C40C99495}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Newtonsoft.Json.Net40\", \"Newtonsoft.Json\\Newtonsoft.Json.Net40.csproj\", \"{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Steamworks.NET\", \"Steamworks.NET\\Standalone\\Steamworks.NET.csproj\", \"{B3543600-587C-4FDC-994A-CB0BDC629A7E}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tDebug|Mixed Platforms = Debug|Mixed Platforms\n\t\tDebug|Win32 = Debug|Win32\n\t\tDebug|x64 = Debug|x64\n\t\tDebug|x86 = Debug|x86\n\t\tDebug|Xbox 360 = Debug|Xbox 360\n\t\tMSTEST_DEBUG|Any CPU = MSTEST_DEBUG|Any CPU\n\t\tMSTEST_DEBUG|Mixed Platforms = MSTEST_DEBUG|Mixed Platforms\n\t\tMSTEST_DEBUG|Win32 = MSTEST_DEBUG|Win32\n\t\tMSTEST_DEBUG|x64 = MSTEST_DEBUG|x64\n\t\tMSTEST_DEBUG|x86 = MSTEST_DEBUG|x86\n\t\tMSTEST_DEBUG|Xbox 360 = MSTEST_DEBUG|Xbox 360\n\t\tMSTEST_RELEASE|Any CPU = MSTEST_RELEASE|Any CPU\n\t\tMSTEST_RELEASE|Mixed Platforms = MSTEST_RELEASE|Mixed Platforms\n\t\tMSTEST_RELEASE|Win32 = MSTEST_RELEASE|Win32\n\t\tMSTEST_RELEASE|x64 = MSTEST_RELEASE|x64\n\t\tMSTEST_RELEASE|x86 = MSTEST_RELEASE|x86\n\t\tMSTEST_RELEASE|Xbox 360 = MSTEST_RELEASE|Xbox 360\n\t\tNUNIT_DEBUG|Any CPU = NUNIT_DEBUG|Any CPU\n\t\tNUNIT_DEBUG|Mixed Platforms = NUNIT_DEBUG|Mixed Platforms\n\t\tNUNIT_DEBUG|Win32 = NUNIT_DEBUG|Win32\n\t\tNUNIT_DEBUG|x64 = NUNIT_DEBUG|x64\n\t\tNUNIT_DEBUG|x86 = NUNIT_DEBUG|x86\n\t\tNUNIT_DEBUG|Xbox 360 = NUNIT_DEBUG|Xbox 360\n\t\tNUNIT_RELEASE|Any CPU = NUNIT_RELEASE|Any CPU\n\t\tNUNIT_RELEASE|Mixed Platforms = NUNIT_RELEASE|Mixed Platforms\n\t\tNUNIT_RELEASE|Win32 = NUNIT_RELEASE|Win32\n\t\tNUNIT_RELEASE|x64 = NUNIT_RELEASE|x64\n\t\tNUNIT_RELEASE|x86 = NUNIT_RELEASE|x86\n\t\tNUNIT_RELEASE|Xbox 360 = NUNIT_RELEASE|Xbox 360\n\t\tOSX-Linux|Any CPU = OSX-Linux|Any CPU\n\t\tOSX-Linux|Mixed Platforms = OSX-Linux|Mixed Platforms\n\t\tOSX-Linux|Win32 = OSX-Linux|Win32\n\t\tOSX-Linux|x64 = OSX-Linux|x64\n\t\tOSX-Linux|x86 = OSX-Linux|x86\n\t\tOSX-Linux|Xbox 360 = OSX-Linux|Xbox 360\n\t\tRelease|Any CPU = Release|Any CPU\n\t\tRelease|Mixed Platforms = Release|Mixed Platforms\n\t\tRelease|Win32 = Release|Win32\n\t\tRelease|x64 = Release|x64\n\t\tRelease|x86 = Release|x86\n\t\tRelease|Xbox 360 = Release|Xbox 360\n\t\tWindows|Any CPU = Windows|Any CPU\n\t\tWindows|Mixed Platforms = Windows|Mixed Platforms\n\t\tWindows|Win32 = Windows|Win32\n\t\tWindows|x64 = Windows|x64\n\t\tWindows|x86 = Windows|x86\n\t\tWindows|Xbox 360 = Windows|Xbox 360\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Debug|Any CPU.ActiveCfg = Debug|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Debug|Mixed Platforms.ActiveCfg = Debug|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Debug|Mixed Platforms.Build.0 = Debug|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Debug|Win32.ActiveCfg = Debug|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Debug|x64.ActiveCfg = Debug|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Debug|x86.Build.0 = Debug|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Debug|Xbox 360.ActiveCfg = Debug|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_DEBUG|Any CPU.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_DEBUG|Mixed Platforms.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_DEBUG|Win32.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_DEBUG|x64.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_DEBUG|x86.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_DEBUG|x86.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_DEBUG|Xbox 360.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_RELEASE|Any CPU.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_RELEASE|Mixed Platforms.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_RELEASE|Win32.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_RELEASE|x64.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_RELEASE|x86.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_RELEASE|x86.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.MSTEST_RELEASE|Xbox 360.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_DEBUG|Any CPU.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_DEBUG|Mixed Platforms.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_DEBUG|Win32.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_DEBUG|x64.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_DEBUG|x86.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_DEBUG|x86.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_DEBUG|Xbox 360.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_RELEASE|Any CPU.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_RELEASE|Mixed Platforms.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_RELEASE|Win32.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_RELEASE|x64.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_RELEASE|x86.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_RELEASE|x86.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.NUNIT_RELEASE|Xbox 360.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.OSX-Linux|Any CPU.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.OSX-Linux|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.OSX-Linux|Mixed Platforms.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.OSX-Linux|Win32.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.OSX-Linux|Win32.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.OSX-Linux|x64.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.OSX-Linux|x86.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.OSX-Linux|x86.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.OSX-Linux|Xbox 360.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Release|Any CPU.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Release|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Release|Mixed Platforms.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Release|Win32.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Release|x64.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Release|x86.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Release|x86.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Release|Xbox 360.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Windows|Any CPU.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Windows|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Windows|Mixed Platforms.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Windows|Win32.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Windows|Win32.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Windows|x64.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Windows|x86.ActiveCfg = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Windows|x86.Build.0 = Release|x86\n\t\t{3D2D163E-393B-4AFD-997B-143E909AC653}.Windows|Xbox 360.ActiveCfg = Release|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Debug|Any CPU.ActiveCfg = Debug|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Debug|Mixed Platforms.ActiveCfg = Debug|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Debug|Win32.ActiveCfg = Debug|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Debug|x64.ActiveCfg = Debug|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_DEBUG|Any CPU.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_DEBUG|Win32.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_DEBUG|x64.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_DEBUG|x86.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_DEBUG|Xbox 360.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_RELEASE|Any CPU.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_RELEASE|Win32.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_RELEASE|x64.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_RELEASE|x86.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.MSTEST_RELEASE|Xbox 360.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_DEBUG|Any CPU.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_DEBUG|Win32.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_DEBUG|x64.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_DEBUG|x86.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_DEBUG|Xbox 360.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_RELEASE|Any CPU.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_RELEASE|Win32.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_RELEASE|x64.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_RELEASE|x86.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.NUNIT_RELEASE|Xbox 360.ActiveCfg = Editor|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.OSX-Linux|Any CPU.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.OSX-Linux|Mixed Platforms.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.OSX-Linux|Win32.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.OSX-Linux|x64.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.OSX-Linux|x86.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.OSX-Linux|Xbox 360.ActiveCfg = Release|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Release|Any CPU.ActiveCfg = Release|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Release|Win32.ActiveCfg = Release|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Release|x64.ActiveCfg = Release|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Release|x86.ActiveCfg = Release|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Release|Xbox 360.ActiveCfg = Release|Xbox 360\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Windows|Any CPU.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Windows|Mixed Platforms.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Windows|Win32.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Windows|x64.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Windows|x86.ActiveCfg = Editor|x86\n\t\t{6D5DBC4B-1DE9-47B2-92AF-546C5D1E4268}.Windows|Xbox 360.ActiveCfg = Release|Xbox 360\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Debug|Win32.ActiveCfg = Debug|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_DEBUG|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_DEBUG|Any CPU.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_DEBUG|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_DEBUG|Win32.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_DEBUG|x64.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_DEBUG|x86.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_DEBUG|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_RELEASE|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_RELEASE|Any CPU.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_RELEASE|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_RELEASE|Win32.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_RELEASE|x64.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_RELEASE|x86.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.MSTEST_RELEASE|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_DEBUG|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_DEBUG|Any CPU.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_DEBUG|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_DEBUG|Win32.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_DEBUG|x64.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_DEBUG|x86.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_DEBUG|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_RELEASE|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_RELEASE|Any CPU.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_RELEASE|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_RELEASE|Win32.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_RELEASE|x64.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_RELEASE|x86.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.NUNIT_RELEASE|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.OSX-Linux|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.OSX-Linux|Any CPU.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.OSX-Linux|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.OSX-Linux|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.OSX-Linux|Win32.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.OSX-Linux|x64.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.OSX-Linux|x86.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.OSX-Linux|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Release|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Release|Win32.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Release|x86.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Release|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Windows|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Windows|Any CPU.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Windows|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Windows|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Windows|Win32.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Windows|x64.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Windows|x86.ActiveCfg = Release|Any CPU\n\t\t{882A32E7-CB48-4E63-8180-0D1859575723}.Windows|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|Any CPU.ActiveCfg = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|Any CPU.Build.0 = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|Mixed Platforms.ActiveCfg = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|Mixed Platforms.Build.0 = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|Win32.ActiveCfg = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|Win32.Build.0 = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|x64.ActiveCfg = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|x64.Build.0 = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|x86.Build.0 = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|Xbox 360.ActiveCfg = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Debug|Xbox 360.Build.0 = Debug|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|Any CPU.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|Any CPU.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|Mixed Platforms.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|Win32.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|Win32.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|x64.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|x64.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|x86.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|x86.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|Xbox 360.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_DEBUG|Xbox 360.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|Any CPU.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|Any CPU.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|Mixed Platforms.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|Win32.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|Win32.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|x64.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|x64.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|x86.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|x86.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|Xbox 360.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.MSTEST_RELEASE|Xbox 360.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|Any CPU.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|Any CPU.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|Mixed Platforms.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|Win32.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|Win32.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|x64.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|x64.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|x86.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|x86.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|Xbox 360.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_DEBUG|Xbox 360.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|Any CPU.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|Any CPU.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|Mixed Platforms.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|Win32.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|Win32.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|x64.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|x64.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|x86.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|x86.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|Xbox 360.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.NUNIT_RELEASE|Xbox 360.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|Any CPU.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|Any CPU.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|Mixed Platforms.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|Win32.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|Win32.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|x64.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|x64.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|x86.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|x86.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|Xbox 360.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.OSX-Linux|Xbox 360.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|Any CPU.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|Any CPU.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|Mixed Platforms.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|Mixed Platforms.Deploy.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|Win32.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|Win32.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|x64.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|x64.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|x86.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|x86.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|Xbox 360.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Release|Xbox 360.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|Any CPU.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|Any CPU.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|Mixed Platforms.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|Win32.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|Win32.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|x64.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|x64.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|x86.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|x86.Build.0 = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|Xbox 360.ActiveCfg = Release|x86\n\t\t{4636C7E1-B845-4B83-B96D-64A11B8A4515}.Windows|Xbox 360.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Debug|Any CPU.ActiveCfg = Debug|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Debug|Mixed Platforms.ActiveCfg = Debug|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Debug|Mixed Platforms.Build.0 = Debug|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Debug|Win32.ActiveCfg = Debug|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Debug|x64.ActiveCfg = Debug|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Debug|x86.Build.0 = Debug|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Debug|Xbox 360.ActiveCfg = Debug|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_DEBUG|Any CPU.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_DEBUG|Mixed Platforms.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_DEBUG|Win32.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_DEBUG|x64.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_DEBUG|x86.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_DEBUG|x86.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_DEBUG|Xbox 360.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_RELEASE|Any CPU.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_RELEASE|Mixed Platforms.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_RELEASE|Win32.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_RELEASE|x64.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_RELEASE|x86.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_RELEASE|x86.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.MSTEST_RELEASE|Xbox 360.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_DEBUG|Any CPU.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_DEBUG|Mixed Platforms.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_DEBUG|Win32.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_DEBUG|x64.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_DEBUG|x86.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_DEBUG|x86.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_DEBUG|Xbox 360.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_RELEASE|Any CPU.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_RELEASE|Mixed Platforms.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_RELEASE|Win32.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_RELEASE|x64.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_RELEASE|x86.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_RELEASE|x86.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.NUNIT_RELEASE|Xbox 360.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.OSX-Linux|Any CPU.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.OSX-Linux|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.OSX-Linux|Mixed Platforms.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.OSX-Linux|Win32.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.OSX-Linux|Win32.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.OSX-Linux|x64.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.OSX-Linux|x86.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.OSX-Linux|x86.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.OSX-Linux|Xbox 360.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Release|Any CPU.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Release|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Release|Mixed Platforms.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Release|Win32.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Release|x64.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Release|x86.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Release|x86.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Release|Xbox 360.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Windows|Any CPU.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Windows|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Windows|Mixed Platforms.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Windows|Win32.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Windows|Win32.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Windows|x64.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Windows|x86.ActiveCfg = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Windows|x86.Build.0 = Release|x86\n\t\t{2A9D2227-78D7-4804-B6D1-560BB43AE911}.Windows|Xbox 360.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Debug|Any CPU.ActiveCfg = Debug|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Debug|Mixed Platforms.Build.0 = Debug|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Debug|Win32.ActiveCfg = Debug|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Debug|x64.ActiveCfg = Debug|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Debug|x86.Build.0 = Debug|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Debug|Xbox 360.ActiveCfg = Debug|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_DEBUG|Any CPU.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_DEBUG|Mixed Platforms.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_DEBUG|Win32.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_DEBUG|x64.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_DEBUG|x86.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_DEBUG|x86.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_DEBUG|Xbox 360.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_RELEASE|Any CPU.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_RELEASE|Mixed Platforms.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_RELEASE|Win32.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_RELEASE|x64.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_RELEASE|x86.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_RELEASE|x86.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.MSTEST_RELEASE|Xbox 360.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_DEBUG|Any CPU.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_DEBUG|Mixed Platforms.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_DEBUG|Win32.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_DEBUG|x64.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_DEBUG|x86.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_DEBUG|x86.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_DEBUG|Xbox 360.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_RELEASE|Any CPU.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_RELEASE|Mixed Platforms.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_RELEASE|Win32.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_RELEASE|x64.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_RELEASE|x86.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_RELEASE|x86.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.NUNIT_RELEASE|Xbox 360.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.OSX-Linux|Any CPU.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.OSX-Linux|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.OSX-Linux|Mixed Platforms.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.OSX-Linux|Win32.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.OSX-Linux|Win32.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.OSX-Linux|x64.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.OSX-Linux|x86.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.OSX-Linux|x86.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.OSX-Linux|Xbox 360.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Release|Any CPU.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Release|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Release|Mixed Platforms.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Release|Win32.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Release|x64.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Release|x86.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Release|x86.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Release|Xbox 360.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Windows|Any CPU.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Windows|Mixed Platforms.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Windows|Mixed Platforms.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Windows|Win32.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Windows|Win32.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Windows|x64.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Windows|x86.ActiveCfg = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Windows|x86.Build.0 = Release|x86\n\t\t{E3AAEB61-D7DF-4E7E-A75B-B5282D2FF3F5}.Windows|Xbox 360.ActiveCfg = Release|x86\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Debug|Win32.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_DEBUG|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_DEBUG|Win32.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_DEBUG|x64.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_DEBUG|x86.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_DEBUG|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_RELEASE|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_RELEASE|Win32.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_RELEASE|x64.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_RELEASE|x86.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.MSTEST_RELEASE|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_DEBUG|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_DEBUG|Win32.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_DEBUG|x64.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_DEBUG|x86.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_DEBUG|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_RELEASE|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_RELEASE|Win32.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_RELEASE|x64.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_RELEASE|x86.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.NUNIT_RELEASE|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.OSX-Linux|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.OSX-Linux|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.OSX-Linux|Win32.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.OSX-Linux|x64.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.OSX-Linux|x86.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.OSX-Linux|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Release|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Release|Win32.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Release|x64.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Release|x86.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Release|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Windows|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Windows|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Windows|Win32.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Windows|x64.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Windows|x86.ActiveCfg = Debug|Any CPU\n\t\t{D487DC94-C8CB-44EB-8A6C-026D03936D1A}.Windows|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Debug|Win32.ActiveCfg = Debug|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_DEBUG|Any CPU.ActiveCfg = MSTEST_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_DEBUG|Any CPU.Build.0 = MSTEST_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = MSTEST_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_DEBUG|Mixed Platforms.Build.0 = MSTEST_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_DEBUG|Win32.ActiveCfg = MSTEST_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_DEBUG|x64.ActiveCfg = MSTEST_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_DEBUG|x86.ActiveCfg = MSTEST_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_DEBUG|Xbox 360.ActiveCfg = MSTEST_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_RELEASE|Any CPU.ActiveCfg = MSTEST_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_RELEASE|Any CPU.Build.0 = MSTEST_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = MSTEST_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_RELEASE|Mixed Platforms.Build.0 = MSTEST_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_RELEASE|Win32.ActiveCfg = MSTEST_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_RELEASE|x64.ActiveCfg = MSTEST_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_RELEASE|x86.ActiveCfg = MSTEST_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.MSTEST_RELEASE|Xbox 360.ActiveCfg = MSTEST_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_DEBUG|Any CPU.ActiveCfg = NUNIT_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_DEBUG|Any CPU.Build.0 = NUNIT_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = NUNIT_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_DEBUG|Mixed Platforms.Build.0 = NUNIT_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_DEBUG|Win32.ActiveCfg = NUNIT_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_DEBUG|x64.ActiveCfg = NUNIT_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_DEBUG|x86.ActiveCfg = NUNIT_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_DEBUG|Xbox 360.ActiveCfg = NUNIT_DEBUG|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_RELEASE|Any CPU.ActiveCfg = NUNIT_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_RELEASE|Any CPU.Build.0 = NUNIT_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = NUNIT_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_RELEASE|Mixed Platforms.Build.0 = NUNIT_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_RELEASE|Win32.ActiveCfg = NUNIT_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_RELEASE|x64.ActiveCfg = NUNIT_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_RELEASE|x86.ActiveCfg = NUNIT_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.NUNIT_RELEASE|Xbox 360.ActiveCfg = NUNIT_RELEASE|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.OSX-Linux|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.OSX-Linux|Any CPU.Build.0 = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.OSX-Linux|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.OSX-Linux|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.OSX-Linux|Win32.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.OSX-Linux|x64.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.OSX-Linux|x86.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.OSX-Linux|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Release|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Release|Win32.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Release|x86.Build.0 = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Release|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Windows|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Windows|Any CPU.Build.0 = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Windows|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Windows|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Windows|Win32.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Windows|x64.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Windows|x86.ActiveCfg = Release|Any CPU\n\t\t{4CB0690E-3E7A-497C-9116-D52024F63195}.Windows|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|Win32.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_DEBUG|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_DEBUG|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_DEBUG|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_DEBUG|Win32.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_DEBUG|x64.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_DEBUG|x86.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_DEBUG|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_RELEASE|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_RELEASE|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_RELEASE|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_RELEASE|Win32.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_RELEASE|x64.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_RELEASE|x86.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.MSTEST_RELEASE|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_DEBUG|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_DEBUG|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_DEBUG|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_DEBUG|Win32.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_DEBUG|x64.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_DEBUG|x86.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_DEBUG|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_RELEASE|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_RELEASE|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_RELEASE|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_RELEASE|Win32.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_RELEASE|x64.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_RELEASE|x86.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.NUNIT_RELEASE|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.OSX-Linux|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.OSX-Linux|Any CPU.Build.0 = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.OSX-Linux|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.OSX-Linux|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.OSX-Linux|Win32.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.OSX-Linux|x64.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.OSX-Linux|x86.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.OSX-Linux|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|Win32.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|x86.Build.0 = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Windows|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Windows|Any CPU.Build.0 = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Windows|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Windows|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Windows|Win32.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Windows|x64.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Windows|x86.ActiveCfg = Release|Any CPU\n\t\t{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Windows|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Debug|Win32.ActiveCfg = Debug|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_DEBUG|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_DEBUG|Any CPU.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_DEBUG|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_DEBUG|Win32.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_DEBUG|x64.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_DEBUG|x86.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_DEBUG|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_RELEASE|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_RELEASE|Any CPU.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_RELEASE|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_RELEASE|Win32.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_RELEASE|x64.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_RELEASE|x86.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.MSTEST_RELEASE|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_DEBUG|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_DEBUG|Any CPU.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_DEBUG|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_DEBUG|Win32.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_DEBUG|x64.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_DEBUG|x86.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_DEBUG|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_RELEASE|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_RELEASE|Any CPU.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_RELEASE|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_RELEASE|Win32.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_RELEASE|x64.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_RELEASE|x86.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.NUNIT_RELEASE|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.OSX-Linux|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.OSX-Linux|Any CPU.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.OSX-Linux|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.OSX-Linux|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.OSX-Linux|Win32.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.OSX-Linux|x64.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.OSX-Linux|x86.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.OSX-Linux|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Release|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Release|Win32.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Release|x86.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Release|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Windows|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Windows|Any CPU.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Windows|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Windows|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Windows|Win32.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Windows|x64.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Windows|x86.ActiveCfg = Release|Any CPU\n\t\t{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}.Windows|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Debug|Win32.ActiveCfg = Debug|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_DEBUG|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_DEBUG|Any CPU.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_DEBUG|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_DEBUG|Win32.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_DEBUG|x64.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_DEBUG|x86.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_DEBUG|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_RELEASE|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_RELEASE|Any CPU.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_RELEASE|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_RELEASE|Win32.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_RELEASE|x64.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_RELEASE|x86.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.MSTEST_RELEASE|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_DEBUG|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_DEBUG|Any CPU.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_DEBUG|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_DEBUG|Win32.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_DEBUG|x64.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_DEBUG|x86.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_DEBUG|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_RELEASE|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_RELEASE|Any CPU.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_RELEASE|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_RELEASE|Win32.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_RELEASE|x64.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_RELEASE|x86.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.NUNIT_RELEASE|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.OSX-Linux|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.OSX-Linux|Any CPU.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.OSX-Linux|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.OSX-Linux|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.OSX-Linux|Win32.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.OSX-Linux|x64.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.OSX-Linux|x86.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.OSX-Linux|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Release|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Release|Win32.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Release|x86.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Release|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Windows|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Windows|Any CPU.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Windows|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Windows|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Windows|Win32.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Windows|x64.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Windows|x86.ActiveCfg = Release|Any CPU\n\t\t{2D0637AB-A380-4C97-A329-BF7C40C99495}.Windows|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Debug|Win32.ActiveCfg = Debug|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_DEBUG|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_DEBUG|Any CPU.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_DEBUG|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_DEBUG|Win32.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_DEBUG|x64.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_DEBUG|x86.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_DEBUG|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_RELEASE|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_RELEASE|Any CPU.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_RELEASE|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_RELEASE|Win32.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_RELEASE|x64.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_RELEASE|x86.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.MSTEST_RELEASE|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_DEBUG|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_DEBUG|Any CPU.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_DEBUG|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_DEBUG|Win32.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_DEBUG|x64.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_DEBUG|x86.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_DEBUG|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_RELEASE|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_RELEASE|Any CPU.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_RELEASE|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_RELEASE|Win32.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_RELEASE|x64.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_RELEASE|x86.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.NUNIT_RELEASE|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.OSX-Linux|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.OSX-Linux|Any CPU.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.OSX-Linux|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.OSX-Linux|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.OSX-Linux|Win32.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.OSX-Linux|x64.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.OSX-Linux|x86.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.OSX-Linux|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Release|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Release|Win32.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Release|x86.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Release|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Windows|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Windows|Any CPU.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Windows|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Windows|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Windows|Win32.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Windows|x64.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Windows|x86.ActiveCfg = Release|Any CPU\n\t\t{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}.Windows|Xbox 360.ActiveCfg = Release|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Debug|Any CPU.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Debug|Any CPU.Build.0 = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Debug|Mixed Platforms.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Debug|Mixed Platforms.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Debug|Win32.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Debug|Win32.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Debug|x64.ActiveCfg = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Debug|x64.Build.0 = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Debug|x86.ActiveCfg = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Debug|x86.Build.0 = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Debug|Xbox 360.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_DEBUG|Any CPU.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_DEBUG|Any CPU.Build.0 = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_DEBUG|Mixed Platforms.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_DEBUG|Mixed Platforms.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_DEBUG|Win32.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_DEBUG|Win32.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_DEBUG|x64.ActiveCfg = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_DEBUG|x64.Build.0 = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_DEBUG|x86.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_DEBUG|x86.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_DEBUG|Xbox 360.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_RELEASE|Any CPU.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_RELEASE|Any CPU.Build.0 = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_RELEASE|Mixed Platforms.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_RELEASE|Mixed Platforms.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_RELEASE|Win32.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_RELEASE|Win32.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_RELEASE|x64.ActiveCfg = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_RELEASE|x64.Build.0 = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_RELEASE|x86.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_RELEASE|x86.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.MSTEST_RELEASE|Xbox 360.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_DEBUG|Any CPU.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_DEBUG|Any CPU.Build.0 = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_DEBUG|Mixed Platforms.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_DEBUG|Mixed Platforms.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_DEBUG|Win32.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_DEBUG|Win32.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_DEBUG|x64.ActiveCfg = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_DEBUG|x64.Build.0 = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_DEBUG|x86.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_DEBUG|x86.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_DEBUG|Xbox 360.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_RELEASE|Any CPU.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_RELEASE|Any CPU.Build.0 = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_RELEASE|Mixed Platforms.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_RELEASE|Mixed Platforms.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_RELEASE|Win32.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_RELEASE|Win32.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_RELEASE|x64.ActiveCfg = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_RELEASE|x64.Build.0 = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_RELEASE|x86.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_RELEASE|x86.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.NUNIT_RELEASE|Xbox 360.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.OSX-Linux|Any CPU.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.OSX-Linux|Any CPU.Build.0 = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.OSX-Linux|Mixed Platforms.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.OSX-Linux|Mixed Platforms.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.OSX-Linux|Win32.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.OSX-Linux|Win32.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.OSX-Linux|x64.ActiveCfg = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.OSX-Linux|x64.Build.0 = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.OSX-Linux|x86.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.OSX-Linux|x86.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.OSX-Linux|Xbox 360.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Release|Any CPU.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Release|Any CPU.Build.0 = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Release|Mixed Platforms.ActiveCfg = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Release|Mixed Platforms.Build.0 = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Release|Win32.ActiveCfg = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Release|Win32.Build.0 = OSX-Linux|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Release|x64.ActiveCfg = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Release|x64.Build.0 = OSX-Linux|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Release|x86.ActiveCfg = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Release|x86.Build.0 = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Release|Xbox 360.ActiveCfg = OSX-Linux|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Windows|Any CPU.ActiveCfg = Windows|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Windows|Any CPU.Build.0 = Windows|Any CPU\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Windows|Mixed Platforms.ActiveCfg = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Windows|Mixed Platforms.Build.0 = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Windows|Win32.ActiveCfg = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Windows|Win32.Build.0 = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Windows|x64.ActiveCfg = Windows|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Windows|x64.Build.0 = Windows|x64\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Windows|x86.ActiveCfg = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Windows|x86.Build.0 = Windows|x86\n\t\t{B3543600-587C-4FDC-994A-CB0BDC629A7E}.Windows|Xbox 360.ActiveCfg = Windows|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "Newtonsoft.Json/Bson/BsonBinaryType.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json.Bson\n{\n    internal enum BsonBinaryType : byte\n    {\n        Binary = 0x00,\n        Function = 0x01,\n\n        [Obsolete(\"This type has been deprecated in the BSON specification. Use Binary instead.\")]\n        BinaryOld = 0x02,\n\n        [Obsolete(\"This type has been deprecated in the BSON specification. Use Uuid instead.\")]\n        UuidOld = 0x03,\n        Uuid = 0x04,\n        Md5 = 0x05,\n        UserDefined = 0x80\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Bson/BsonBinaryWriter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Bson\n{\n    internal class BsonBinaryWriter\n    {\n        private static readonly Encoding Encoding = new UTF8Encoding(false);\n\n        private readonly BinaryWriter _writer;\n\n        private byte[] _largeByteBuffer;\n\n        public DateTimeKind DateTimeKindHandling { get; set; }\n\n        public BsonBinaryWriter(BinaryWriter writer)\n        {\n            DateTimeKindHandling = DateTimeKind.Utc;\n            _writer = writer;\n        }\n\n        public void Flush()\n        {\n            _writer.Flush();\n        }\n\n        public void Close()\n        {\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            _writer.Close();\n#else\n            _writer.Dispose();\n#endif\n        }\n\n        public void WriteToken(BsonToken t)\n        {\n            CalculateSize(t);\n            WriteTokenInternal(t);\n        }\n\n        private void WriteTokenInternal(BsonToken t)\n        {\n            switch (t.Type)\n            {\n                case BsonType.Object:\n                {\n                    BsonObject value = (BsonObject)t;\n                    _writer.Write(value.CalculatedSize);\n                    foreach (BsonProperty property in value)\n                    {\n                        _writer.Write((sbyte)property.Value.Type);\n                        WriteString((string)property.Name.Value, property.Name.ByteCount, null);\n                        WriteTokenInternal(property.Value);\n                    }\n                    _writer.Write((byte)0);\n                }\n                    break;\n                case BsonType.Array:\n                {\n                    BsonArray value = (BsonArray)t;\n                    _writer.Write(value.CalculatedSize);\n                    ulong index = 0;\n                    foreach (BsonToken c in value)\n                    {\n                        _writer.Write((sbyte)c.Type);\n                        WriteString(index.ToString(CultureInfo.InvariantCulture), MathUtils.IntLength(index), null);\n                        WriteTokenInternal(c);\n                        index++;\n                    }\n                    _writer.Write((byte)0);\n                }\n                    break;\n                case BsonType.Integer:\n                {\n                    BsonValue value = (BsonValue)t;\n                    _writer.Write(Convert.ToInt32(value.Value, CultureInfo.InvariantCulture));\n                }\n                    break;\n                case BsonType.Long:\n                {\n                    BsonValue value = (BsonValue)t;\n                    _writer.Write(Convert.ToInt64(value.Value, CultureInfo.InvariantCulture));\n                }\n                    break;\n                case BsonType.Number:\n                {\n                    BsonValue value = (BsonValue)t;\n                    _writer.Write(Convert.ToDouble(value.Value, CultureInfo.InvariantCulture));\n                }\n                    break;\n                case BsonType.String:\n                {\n                    BsonString value = (BsonString)t;\n                    WriteString((string)value.Value, value.ByteCount, value.CalculatedSize - 4);\n                }\n                    break;\n                case BsonType.Boolean:\n                {\n                    BsonValue value = (BsonValue)t;\n                    _writer.Write((bool)value.Value);\n                }\n                    break;\n                case BsonType.Null:\n                case BsonType.Undefined:\n                    break;\n                case BsonType.Date:\n                {\n                    BsonValue value = (BsonValue)t;\n\n                    long ticks = 0;\n\n                    if (value.Value is DateTime)\n                    {\n                        DateTime dateTime = (DateTime)value.Value;\n                        if (DateTimeKindHandling == DateTimeKind.Utc)\n                            dateTime = dateTime.ToUniversalTime();\n                        else if (DateTimeKindHandling == DateTimeKind.Local)\n                            dateTime = dateTime.ToLocalTime();\n\n                        ticks = DateTimeUtils.ConvertDateTimeToJavaScriptTicks(dateTime, false);\n                    }\n#if !NET20\n                    else\n                    {\n                        DateTimeOffset dateTimeOffset = (DateTimeOffset)value.Value;\n                        ticks = DateTimeUtils.ConvertDateTimeToJavaScriptTicks(dateTimeOffset.UtcDateTime, dateTimeOffset.Offset);\n                    }\n#endif\n\n                    _writer.Write(ticks);\n                }\n                    break;\n                case BsonType.Binary:\n                {\n                    BsonBinary value = (BsonBinary)t;\n\n                    byte[] data = (byte[])value.Value;\n                    _writer.Write(data.Length);\n                    _writer.Write((byte)value.BinaryType);\n                    _writer.Write(data);\n                }\n                    break;\n                case BsonType.Oid:\n                {\n                    BsonValue value = (BsonValue)t;\n\n                    byte[] data = (byte[])value.Value;\n                    _writer.Write(data);\n                }\n                    break;\n                case BsonType.Regex:\n                {\n                    BsonRegex value = (BsonRegex)t;\n\n                    WriteString((string)value.Pattern.Value, value.Pattern.ByteCount, null);\n                    WriteString((string)value.Options.Value, value.Options.ByteCount, null);\n                }\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException(\"t\", \"Unexpected token when writing BSON: {0}\".FormatWith(CultureInfo.InvariantCulture, t.Type));\n            }\n        }\n\n        private void WriteString(string s, int byteCount, int? calculatedlengthPrefix)\n        {\n            if (calculatedlengthPrefix != null)\n                _writer.Write(calculatedlengthPrefix.Value);\n\n            WriteUtf8Bytes(s, byteCount);\n\n            _writer.Write((byte)0);\n        }\n\n        public void WriteUtf8Bytes(string s, int byteCount)\n        {\n            if (s != null)\n            {\n                if (_largeByteBuffer == null)\n                {\n                    _largeByteBuffer = new byte[256];\n                }\n                if (byteCount <= 256)\n                {\n                    Encoding.GetBytes(s, 0, s.Length, _largeByteBuffer, 0);\n                    _writer.Write(_largeByteBuffer, 0, byteCount);\n                }\n                else\n                {\n                    byte[] bytes = Encoding.GetBytes(s);\n                    _writer.Write(bytes);\n                }\n            }\n        }\n\n        private int CalculateSize(int stringByteCount)\n        {\n            return stringByteCount + 1;\n        }\n\n        private int CalculateSizeWithLength(int stringByteCount, bool includeSize)\n        {\n            int baseSize = (includeSize)\n                ? 5 // size bytes + terminator\n                : 1; // terminator\n\n            return baseSize + stringByteCount;\n        }\n\n        private int CalculateSize(BsonToken t)\n        {\n            switch (t.Type)\n            {\n                case BsonType.Object:\n                {\n                    BsonObject value = (BsonObject)t;\n\n                    int bases = 4;\n                    foreach (BsonProperty p in value)\n                    {\n                        int size = 1;\n                        size += CalculateSize(p.Name);\n                        size += CalculateSize(p.Value);\n\n                        bases += size;\n                    }\n                    bases += 1;\n                    value.CalculatedSize = bases;\n                    return bases;\n                }\n                case BsonType.Array:\n                {\n                    BsonArray value = (BsonArray)t;\n\n                    int size = 4;\n                    ulong index = 0;\n                    foreach (BsonToken c in value)\n                    {\n                        size += 1;\n                        size += CalculateSize(MathUtils.IntLength(index));\n                        size += CalculateSize(c);\n                        index++;\n                    }\n                    size += 1;\n                    value.CalculatedSize = size;\n\n                    return value.CalculatedSize;\n                }\n                case BsonType.Integer:\n                    return 4;\n                case BsonType.Long:\n                    return 8;\n                case BsonType.Number:\n                    return 8;\n                case BsonType.String:\n                {\n                    BsonString value = (BsonString)t;\n                    string s = (string)value.Value;\n                    value.ByteCount = (s != null) ? Encoding.GetByteCount(s) : 0;\n                    value.CalculatedSize = CalculateSizeWithLength(value.ByteCount, value.IncludeLength);\n\n                    return value.CalculatedSize;\n                }\n                case BsonType.Boolean:\n                    return 1;\n                case BsonType.Null:\n                case BsonType.Undefined:\n                    return 0;\n                case BsonType.Date:\n                    return 8;\n                case BsonType.Binary:\n                {\n                    BsonBinary value = (BsonBinary)t;\n\n                    byte[] data = (byte[])value.Value;\n                    value.CalculatedSize = 4 + 1 + data.Length;\n\n                    return value.CalculatedSize;\n                }\n                case BsonType.Oid:\n                    return 12;\n                case BsonType.Regex:\n                {\n                    BsonRegex value = (BsonRegex)t;\n                    int size = 0;\n                    size += CalculateSize(value.Pattern);\n                    size += CalculateSize(value.Options);\n                    value.CalculatedSize = size;\n\n                    return value.CalculatedSize;\n                }\n                default:\n                    throw new ArgumentOutOfRangeException(\"t\", \"Unexpected token when writing BSON: {0}\".FormatWith(CultureInfo.InvariantCulture, t.Type));\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Bson/BsonObjectId.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Bson\n{\n    /// <summary>\n    /// Represents a BSON Oid (object id).\n    /// </summary>\n    public class BsonObjectId\n    {\n        /// <summary>\n        /// Gets or sets the value of the Oid.\n        /// </summary>\n        /// <value>The value of the Oid.</value>\n        public byte[] Value { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BsonObjectId\"/> class.\n        /// </summary>\n        /// <param name=\"value\">The Oid value.</param>\n        public BsonObjectId(byte[] value)\n        {\n            ValidationUtils.ArgumentNotNull(value, \"value\");\n            if (value.Length != 12)\n                throw new ArgumentException(\"An ObjectId must be 12 bytes\", \"value\");\n\n            Value = value;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Bson/BsonReader.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Text;\nusing System.IO;\nusing Newtonsoft.Json.Serialization;\nusing Newtonsoft.Json.Utilities;\nusing Newtonsoft.Json.Linq;\n\nnamespace Newtonsoft.Json.Bson\n{\n    /// <summary>\n    /// Represents a reader that provides fast, non-cached, forward-only access to serialized Json data.\n    /// </summary>\n    public class BsonReader : JsonReader\n    {\n        private const int MaxCharBytesSize = 128;\n        private static readonly byte[] SeqRange1 = new byte[] { 0, 127 }; // range of 1-byte sequence\n        private static readonly byte[] SeqRange2 = new byte[] { 194, 223 }; // range of 2-byte sequence\n        private static readonly byte[] SeqRange3 = new byte[] { 224, 239 }; // range of 3-byte sequence\n        private static readonly byte[] SeqRange4 = new byte[] { 240, 244 }; // range of 4-byte sequence\n\n        private readonly BinaryReader _reader;\n        private readonly List<ContainerContext> _stack;\n\n        private byte[] _byteBuffer;\n        private char[] _charBuffer;\n\n        private BsonType _currentElementType;\n        private BsonReaderState _bsonReaderState;\n        private ContainerContext _currentContext;\n\n        private bool _readRootValueAsArray;\n        private bool _jsonNet35BinaryCompatibility;\n        private DateTimeKind _dateTimeKindHandling;\n\n        private enum BsonReaderState\n        {\n            Normal,\n            ReferenceStart,\n            ReferenceRef,\n            ReferenceId,\n            CodeWScopeStart,\n            CodeWScopeCode,\n            CodeWScopeScope,\n            CodeWScopeScopeObject,\n            CodeWScopeScopeEnd\n        }\n\n        private class ContainerContext\n        {\n            public readonly BsonType Type;\n            public int Length;\n            public int Position;\n\n            public ContainerContext(BsonType type)\n            {\n                Type = type;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, <c>false</c>.\n        /// </value>\n        [Obsolete(\"JsonNet35BinaryCompatibility will be removed in a future version of Json.NET.\")]\n        public bool JsonNet35BinaryCompatibility\n        {\n            get { return _jsonNet35BinaryCompatibility; }\n            set { _jsonNet35BinaryCompatibility = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the root object will be read as a JSON array.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if the root object will be read as a JSON array; otherwise, <c>false</c>.\n        /// </value>\n        public bool ReadRootValueAsArray\n        {\n            get { return _readRootValueAsArray; }\n            set { _readRootValueAsArray = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"DateTimeKind\" /> used when reading <see cref=\"DateTime\"/> values from BSON.\n        /// </summary>\n        /// <value>The <see cref=\"DateTimeKind\" /> used when reading <see cref=\"DateTime\"/> values from BSON.</value>\n        public DateTimeKind DateTimeKindHandling\n        {\n            get { return _dateTimeKindHandling; }\n            set { _dateTimeKindHandling = value; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BsonReader\"/> class.\n        /// </summary>\n        /// <param name=\"stream\">The stream.</param>\n        public BsonReader(Stream stream)\n            : this(stream, false, DateTimeKind.Local)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BsonReader\"/> class.\n        /// </summary>\n        /// <param name=\"reader\">The reader.</param>\n        public BsonReader(BinaryReader reader)\n            : this(reader, false, DateTimeKind.Local)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BsonReader\"/> class.\n        /// </summary>\n        /// <param name=\"stream\">The stream.</param>\n        /// <param name=\"readRootValueAsArray\">if set to <c>true</c> the root object will be read as a JSON array.</param>\n        /// <param name=\"dateTimeKindHandling\">The <see cref=\"DateTimeKind\" /> used when reading <see cref=\"DateTime\"/> values from BSON.</param>\n        public BsonReader(Stream stream, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling)\n        {\n            ValidationUtils.ArgumentNotNull(stream, \"stream\");\n            _reader = new BinaryReader(stream);\n            _stack = new List<ContainerContext>();\n            _readRootValueAsArray = readRootValueAsArray;\n            _dateTimeKindHandling = dateTimeKindHandling;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BsonReader\"/> class.\n        /// </summary>\n        /// <param name=\"reader\">The reader.</param>\n        /// <param name=\"readRootValueAsArray\">if set to <c>true</c> the root object will be read as a JSON array.</param>\n        /// <param name=\"dateTimeKindHandling\">The <see cref=\"DateTimeKind\" /> used when reading <see cref=\"DateTime\"/> values from BSON.</param>\n        public BsonReader(BinaryReader reader, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling)\n        {\n            ValidationUtils.ArgumentNotNull(reader, \"reader\");\n            _reader = reader;\n            _stack = new List<ContainerContext>();\n            _readRootValueAsArray = readRootValueAsArray;\n            _dateTimeKindHandling = dateTimeKindHandling;\n        }\n\n        private string ReadElement()\n        {\n            _currentElementType = ReadType();\n            string elementName = ReadString();\n            return elementName;\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"T:Byte[]\"/>.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:Byte[]\"/> or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.\n        /// </returns>\n        public override byte[] ReadAsBytes()\n        {\n            return ReadAsBytesInternal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{Decimal}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{Decimal}\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override decimal? ReadAsDecimal()\n        {\n            return ReadAsDecimalInternal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{Int32}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{Int32}\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override int? ReadAsInt32()\n        {\n            return ReadAsInt32Internal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"String\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"String\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override string ReadAsString()\n        {\n            return ReadAsStringInternal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{DateTime}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"String\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override DateTime? ReadAsDateTime()\n        {\n            return ReadAsDateTimeInternal();\n        }\n\n#if !NET20\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{DateTimeOffset}\"/>.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"Nullable{DateTimeOffset}\"/>. This method will return <c>null</c> at the end of an array.\n        /// </returns>\n        public override DateTimeOffset? ReadAsDateTimeOffset()\n        {\n            return ReadAsDateTimeOffsetInternal();\n        }\n#endif\n\n        /// <summary>\n        /// Reads the next JSON token from the stream.\n        /// </summary>\n        /// <returns>\n        /// true if the next token was read successfully; false if there are no more tokens to read.\n        /// </returns>\n        public override bool Read()\n        {\n            _readType = Json.ReadType.Read;\n\n            return ReadInternal();\n        }\n\n        internal override bool ReadInternal()\n        {\n            try\n            {\n                bool success;\n\n                switch (_bsonReaderState)\n                {\n                    case BsonReaderState.Normal:\n                        success = ReadNormal();\n                        break;\n                    case BsonReaderState.ReferenceStart:\n                    case BsonReaderState.ReferenceRef:\n                    case BsonReaderState.ReferenceId:\n                        success = ReadReference();\n                        break;\n                    case BsonReaderState.CodeWScopeStart:\n                    case BsonReaderState.CodeWScopeCode:\n                    case BsonReaderState.CodeWScopeScope:\n                    case BsonReaderState.CodeWScopeScopeObject:\n                    case BsonReaderState.CodeWScopeScopeEnd:\n                        success = ReadCodeWScope();\n                        break;\n                    default:\n                        throw JsonReaderException.Create(this, \"Unexpected state: {0}\".FormatWith(CultureInfo.InvariantCulture, _bsonReaderState));\n                }\n\n                if (!success)\n                {\n                    SetToken(JsonToken.None);\n                    return false;\n                }\n\n                return true;\n            }\n            catch (EndOfStreamException)\n            {\n                SetToken(JsonToken.None);\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Changes the <see cref=\"JsonReader.State\"/> to Closed.\n        /// </summary>\n        public override void Close()\n        {\n            base.Close();\n\n            if (CloseInput && _reader != null)\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n                _reader.Close();\n#else\n                _reader.Dispose();\n#endif\n        }\n\n        private bool ReadCodeWScope()\n        {\n            switch (_bsonReaderState)\n            {\n                case BsonReaderState.CodeWScopeStart:\n                    SetToken(JsonToken.PropertyName, \"$code\");\n                    _bsonReaderState = BsonReaderState.CodeWScopeCode;\n                    return true;\n                case BsonReaderState.CodeWScopeCode:\n                    // total CodeWScope size - not used\n                    ReadInt32();\n\n                    SetToken(JsonToken.String, ReadLengthString());\n                    _bsonReaderState = BsonReaderState.CodeWScopeScope;\n                    return true;\n                case BsonReaderState.CodeWScopeScope:\n                    if (CurrentState == State.PostValue)\n                    {\n                        SetToken(JsonToken.PropertyName, \"$scope\");\n                        return true;\n                    }\n                    else\n                    {\n                        SetToken(JsonToken.StartObject);\n                        _bsonReaderState = BsonReaderState.CodeWScopeScopeObject;\n\n                        ContainerContext newContext = new ContainerContext(BsonType.Object);\n                        PushContext(newContext);\n                        newContext.Length = ReadInt32();\n\n                        return true;\n                    }\n                case BsonReaderState.CodeWScopeScopeObject:\n                    bool result = ReadNormal();\n                    if (result && TokenType == JsonToken.EndObject)\n                        _bsonReaderState = BsonReaderState.CodeWScopeScopeEnd;\n\n                    return result;\n                case BsonReaderState.CodeWScopeScopeEnd:\n                    SetToken(JsonToken.EndObject);\n                    _bsonReaderState = BsonReaderState.Normal;\n                    return true;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        private bool ReadReference()\n        {\n            switch (CurrentState)\n            {\n                case State.ObjectStart:\n                {\n                    SetToken(JsonToken.PropertyName, JsonTypeReflector.RefPropertyName);\n                    _bsonReaderState = BsonReaderState.ReferenceRef;\n                    return true;\n                }\n                case State.Property:\n                {\n                    if (_bsonReaderState == BsonReaderState.ReferenceRef)\n                    {\n                        SetToken(JsonToken.String, ReadLengthString());\n                        return true;\n                    }\n                    else if (_bsonReaderState == BsonReaderState.ReferenceId)\n                    {\n                        SetToken(JsonToken.Bytes, ReadBytes(12));\n                        return true;\n                    }\n                    else\n                    {\n                        throw JsonReaderException.Create(this, \"Unexpected state when reading BSON reference: \" + _bsonReaderState);\n                    }\n                }\n                case State.PostValue:\n                {\n                    if (_bsonReaderState == BsonReaderState.ReferenceRef)\n                    {\n                        SetToken(JsonToken.PropertyName, JsonTypeReflector.IdPropertyName);\n                        _bsonReaderState = BsonReaderState.ReferenceId;\n                        return true;\n                    }\n                    else if (_bsonReaderState == BsonReaderState.ReferenceId)\n                    {\n                        SetToken(JsonToken.EndObject);\n                        _bsonReaderState = BsonReaderState.Normal;\n                        return true;\n                    }\n                    else\n                    {\n                        throw JsonReaderException.Create(this, \"Unexpected state when reading BSON reference: \" + _bsonReaderState);\n                    }\n                }\n                default:\n                    throw JsonReaderException.Create(this, \"Unexpected state when reading BSON reference: \" + CurrentState);\n            }\n        }\n\n        private bool ReadNormal()\n        {\n            switch (CurrentState)\n            {\n                case State.Start:\n                {\n                    JsonToken token = (!_readRootValueAsArray) ? JsonToken.StartObject : JsonToken.StartArray;\n                    BsonType type = (!_readRootValueAsArray) ? BsonType.Object : BsonType.Array;\n\n                    SetToken(token);\n                    ContainerContext newContext = new ContainerContext(type);\n                    PushContext(newContext);\n                    newContext.Length = ReadInt32();\n                    return true;\n                }\n                case State.Complete:\n                case State.Closed:\n                    return false;\n                case State.Property:\n                {\n                    ReadType(_currentElementType);\n                    return true;\n                }\n                case State.ObjectStart:\n                case State.ArrayStart:\n                case State.PostValue:\n                    ContainerContext context = _currentContext;\n                    if (context == null)\n                        return false;\n\n                    int lengthMinusEnd = context.Length - 1;\n\n                    if (context.Position < lengthMinusEnd)\n                    {\n                        if (context.Type == BsonType.Array)\n                        {\n                            ReadElement();\n                            ReadType(_currentElementType);\n                            return true;\n                        }\n                        else\n                        {\n                            SetToken(JsonToken.PropertyName, ReadElement());\n                            return true;\n                        }\n                    }\n                    else if (context.Position == lengthMinusEnd)\n                    {\n                        if (ReadByte() != 0)\n                            throw JsonReaderException.Create(this, \"Unexpected end of object byte value.\");\n\n                        PopContext();\n                        if (_currentContext != null)\n                            MovePosition(context.Length);\n\n                        JsonToken endToken = (context.Type == BsonType.Object) ? JsonToken.EndObject : JsonToken.EndArray;\n                        SetToken(endToken);\n                        return true;\n                    }\n                    else\n                    {\n                        throw JsonReaderException.Create(this, \"Read past end of current container context.\");\n                    }\n                case State.ConstructorStart:\n                    break;\n                case State.Constructor:\n                    break;\n                case State.Error:\n                    break;\n                case State.Finished:\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n\n            return false;\n        }\n\n        private void PopContext()\n        {\n            _stack.RemoveAt(_stack.Count - 1);\n            if (_stack.Count == 0)\n                _currentContext = null;\n            else\n                _currentContext = _stack[_stack.Count - 1];\n        }\n\n        private void PushContext(ContainerContext newContext)\n        {\n            _stack.Add(newContext);\n            _currentContext = newContext;\n        }\n\n        private byte ReadByte()\n        {\n            MovePosition(1);\n            return _reader.ReadByte();\n        }\n\n        private void ReadType(BsonType type)\n        {\n            switch (type)\n            {\n                case BsonType.Number:\n                    double d = ReadDouble();\n\n                    if (_floatParseHandling == FloatParseHandling.Decimal)\n                        SetToken(JsonToken.Float, Convert.ToDecimal(d, CultureInfo.InvariantCulture));\n                    else\n                        SetToken(JsonToken.Float, d);\n                    break;\n                case BsonType.String:\n                case BsonType.Symbol:\n                    SetToken(JsonToken.String, ReadLengthString());\n                    break;\n                case BsonType.Object:\n                {\n                    SetToken(JsonToken.StartObject);\n\n                    ContainerContext newContext = new ContainerContext(BsonType.Object);\n                    PushContext(newContext);\n                    newContext.Length = ReadInt32();\n                    break;\n                }\n                case BsonType.Array:\n                {\n                    SetToken(JsonToken.StartArray);\n\n                    ContainerContext newContext = new ContainerContext(BsonType.Array);\n                    PushContext(newContext);\n                    newContext.Length = ReadInt32();\n                    break;\n                }\n                case BsonType.Binary:\n                    SetToken(JsonToken.Bytes, ReadBinary());\n                    break;\n                case BsonType.Undefined:\n                    SetToken(JsonToken.Undefined);\n                    break;\n                case BsonType.Oid:\n                    byte[] oid = ReadBytes(12);\n                    SetToken(JsonToken.Bytes, oid);\n                    break;\n                case BsonType.Boolean:\n                    bool b = Convert.ToBoolean(ReadByte());\n                    SetToken(JsonToken.Boolean, b);\n                    break;\n                case BsonType.Date:\n                    long ticks = ReadInt64();\n                    DateTime utcDateTime = DateTimeUtils.ConvertJavaScriptTicksToDateTime(ticks);\n\n                    DateTime dateTime;\n                    switch (DateTimeKindHandling)\n                    {\n                        case DateTimeKind.Unspecified:\n                            dateTime = DateTime.SpecifyKind(utcDateTime, DateTimeKind.Unspecified);\n                            break;\n                        case DateTimeKind.Local:\n                            dateTime = utcDateTime.ToLocalTime();\n                            break;\n                        default:\n                            dateTime = utcDateTime;\n                            break;\n                    }\n\n                    SetToken(JsonToken.Date, dateTime);\n                    break;\n                case BsonType.Null:\n                    SetToken(JsonToken.Null);\n                    break;\n                case BsonType.Regex:\n                    string expression = ReadString();\n                    string modifiers = ReadString();\n\n                    string regex = @\"/\" + expression + @\"/\" + modifiers;\n                    SetToken(JsonToken.String, regex);\n                    break;\n                case BsonType.Reference:\n                    SetToken(JsonToken.StartObject);\n                    _bsonReaderState = BsonReaderState.ReferenceStart;\n                    break;\n                case BsonType.Code:\n                    SetToken(JsonToken.String, ReadLengthString());\n                    break;\n                case BsonType.CodeWScope:\n                    SetToken(JsonToken.StartObject);\n                    _bsonReaderState = BsonReaderState.CodeWScopeStart;\n                    break;\n                case BsonType.Integer:\n                    SetToken(JsonToken.Integer, (long)ReadInt32());\n                    break;\n                case BsonType.TimeStamp:\n                case BsonType.Long:\n                    SetToken(JsonToken.Integer, ReadInt64());\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException(\"type\", \"Unexpected BsonType value: \" + type);\n            }\n        }\n\n        private byte[] ReadBinary()\n        {\n            int dataLength = ReadInt32();\n\n            BsonBinaryType binaryType = (BsonBinaryType)ReadByte();\n\n#pragma warning disable 612,618\n            // the old binary type has the data length repeated in the data for some reason\n            if (binaryType == BsonBinaryType.BinaryOld && !_jsonNet35BinaryCompatibility)\n            {\n                dataLength = ReadInt32();\n            }\n#pragma warning restore 612,618\n\n            return ReadBytes(dataLength);\n        }\n\n        private string ReadString()\n        {\n            EnsureBuffers();\n\n            StringBuilder builder = null;\n\n            int totalBytesRead = 0;\n            // used in case of left over multibyte characters in the buffer\n            int offset = 0;\n            do\n            {\n                int count = offset;\n                byte b;\n                while (count < MaxCharBytesSize && (b = _reader.ReadByte()) > 0)\n                {\n                    _byteBuffer[count++] = b;\n                }\n                int byteCount = count - offset;\n                totalBytesRead += byteCount;\n\n                if (count < MaxCharBytesSize && builder == null)\n                {\n                    // pref optimization to avoid reading into a string builder\n                    // if string is smaller than the buffer then return it directly\n                    int length = Encoding.UTF8.GetChars(_byteBuffer, 0, byteCount, _charBuffer, 0);\n\n                    MovePosition(totalBytesRead + 1);\n                    return new string(_charBuffer, 0, length);\n                }\n                else\n                {\n                    // calculate the index of the end of the last full character in the buffer\n                    int lastFullCharStop = GetLastFullCharStop(count - 1);\n\n                    int charCount = Encoding.UTF8.GetChars(_byteBuffer, 0, lastFullCharStop + 1, _charBuffer, 0);\n\n                    if (builder == null)\n                        builder = new StringBuilder(MaxCharBytesSize * 2);\n\n                    builder.Append(_charBuffer, 0, charCount);\n\n                    if (lastFullCharStop < byteCount - 1)\n                    {\n                        offset = byteCount - lastFullCharStop - 1;\n                        // copy left over multi byte characters to beginning of buffer for next iteration\n                        Array.Copy(_byteBuffer, lastFullCharStop + 1, _byteBuffer, 0, offset);\n                    }\n                    else\n                    {\n                        // reached end of string\n                        if (count < MaxCharBytesSize)\n                        {\n                            MovePosition(totalBytesRead + 1);\n                            return builder.ToString();\n                        }\n\n                        offset = 0;\n                    }\n                }\n            } while (true);\n        }\n\n        private string ReadLengthString()\n        {\n            int length = ReadInt32();\n\n            MovePosition(length);\n\n            string s = GetString(length - 1);\n            _reader.ReadByte();\n\n            return s;\n        }\n\n        private string GetString(int length)\n        {\n            if (length == 0)\n                return string.Empty;\n\n            EnsureBuffers();\n\n            StringBuilder builder = null;\n\n            int totalBytesRead = 0;\n\n            // used in case of left over multibyte characters in the buffer\n            int offset = 0;\n            do\n            {\n                int count = ((length - totalBytesRead) > MaxCharBytesSize - offset)\n                    ? MaxCharBytesSize - offset\n                    : length - totalBytesRead;\n\n                int byteCount = _reader.Read(_byteBuffer, offset, count);\n\n                if (byteCount == 0)\n                    throw new EndOfStreamException(\"Unable to read beyond the end of the stream.\");\n\n                totalBytesRead += byteCount;\n\n                // Above, byteCount is how many bytes we read this time.\n                // Below, byteCount is how many bytes are in the _byteBuffer.\n                byteCount += offset;\n\n                if (byteCount == length)\n                {\n                    // pref optimization to avoid reading into a string builder\n                    // first iteration and all bytes read then return string directly\n                    int charCount = Encoding.UTF8.GetChars(_byteBuffer, 0, byteCount, _charBuffer, 0);\n                    return new string(_charBuffer, 0, charCount);\n                }\n                else\n                {\n                    int lastFullCharStop = GetLastFullCharStop(byteCount - 1);\n\n                    if (builder == null)\n                        builder = new StringBuilder(length);\n\n                    int charCount = Encoding.UTF8.GetChars(_byteBuffer, 0, lastFullCharStop + 1, _charBuffer, 0);\n                    builder.Append(_charBuffer, 0, charCount);\n\n                    if (lastFullCharStop < byteCount - 1)\n                    {\n                        offset = byteCount - lastFullCharStop - 1;\n                        // copy left over multi byte characters to beginning of buffer for next iteration\n                        Array.Copy(_byteBuffer, lastFullCharStop + 1, _byteBuffer, 0, offset);\n                    }\n                    else\n                    {\n                        offset = 0;\n                    }\n                }\n            } while (totalBytesRead < length);\n\n            return builder.ToString();\n        }\n\n        private int GetLastFullCharStop(int start)\n        {\n            int lookbackPos = start;\n            int bis = 0;\n            while (lookbackPos >= 0)\n            {\n                bis = BytesInSequence(_byteBuffer[lookbackPos]);\n                if (bis == 0)\n                {\n                    lookbackPos--;\n                    continue;\n                }\n                else if (bis == 1)\n                {\n                    break;\n                }\n                else\n                {\n                    lookbackPos--;\n                    break;\n                }\n            }\n            if (bis == start - lookbackPos)\n            {\n                //Full character.\n                return start;\n            }\n            else\n            {\n                return lookbackPos;\n            }\n        }\n\n        private int BytesInSequence(byte b)\n        {\n            if (b <= SeqRange1[1]) return 1;\n            if (b >= SeqRange2[0] && b <= SeqRange2[1]) return 2;\n            if (b >= SeqRange3[0] && b <= SeqRange3[1]) return 3;\n            if (b >= SeqRange4[0] && b <= SeqRange4[1]) return 4;\n            return 0;\n        }\n\n        private void EnsureBuffers()\n        {\n            if (_byteBuffer == null)\n            {\n                _byteBuffer = new byte[MaxCharBytesSize];\n            }\n            if (_charBuffer == null)\n            {\n                int charBufferSize = Encoding.UTF8.GetMaxCharCount(MaxCharBytesSize);\n                _charBuffer = new char[charBufferSize];\n            }\n        }\n\n        private double ReadDouble()\n        {\n            MovePosition(8);\n            return _reader.ReadDouble();\n        }\n\n        private int ReadInt32()\n        {\n            MovePosition(4);\n            return _reader.ReadInt32();\n        }\n\n        private long ReadInt64()\n        {\n            MovePosition(8);\n            return _reader.ReadInt64();\n        }\n\n        private BsonType ReadType()\n        {\n            MovePosition(1);\n            return (BsonType)_reader.ReadSByte();\n        }\n\n        private void MovePosition(int count)\n        {\n            _currentContext.Position += count;\n        }\n\n        private byte[] ReadBytes(int count)\n        {\n            MovePosition(count);\n            return _reader.ReadBytes(count);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Bson/BsonToken.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Newtonsoft.Json.Bson\n{\n    internal abstract class BsonToken\n    {\n        public abstract BsonType Type { get; }\n        public BsonToken Parent { get; set; }\n        public int CalculatedSize { get; set; }\n    }\n\n    internal class BsonObject : BsonToken, IEnumerable<BsonProperty>\n    {\n        private readonly List<BsonProperty> _children = new List<BsonProperty>();\n\n        public void Add(string name, BsonToken token)\n        {\n            _children.Add(new BsonProperty { Name = new BsonString(name, false), Value = token });\n            token.Parent = this;\n        }\n\n        public override BsonType Type\n        {\n            get { return BsonType.Object; }\n        }\n\n        public IEnumerator<BsonProperty> GetEnumerator()\n        {\n            return _children.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n\n    internal class BsonArray : BsonToken, IEnumerable<BsonToken>\n    {\n        private readonly List<BsonToken> _children = new List<BsonToken>();\n\n        public void Add(BsonToken token)\n        {\n            _children.Add(token);\n            token.Parent = this;\n        }\n\n        public override BsonType Type\n        {\n            get { return BsonType.Array; }\n        }\n\n        public IEnumerator<BsonToken> GetEnumerator()\n        {\n            return _children.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n\n    internal class BsonValue : BsonToken\n    {\n        private readonly object _value;\n        private readonly BsonType _type;\n\n        public BsonValue(object value, BsonType type)\n        {\n            _value = value;\n            _type = type;\n        }\n\n        public object Value\n        {\n            get { return _value; }\n        }\n\n        public override BsonType Type\n        {\n            get { return _type; }\n        }\n    }\n\n    internal class BsonString : BsonValue\n    {\n        public int ByteCount { get; set; }\n        public bool IncludeLength { get; set; }\n\n        public BsonString(object value, bool includeLength)\n            : base(value, BsonType.String)\n        {\n            IncludeLength = includeLength;\n        }\n    }\n\n    internal class BsonBinary : BsonValue\n    {\n        public BsonBinaryType BinaryType { get; set; }\n\n        public BsonBinary(byte[] value, BsonBinaryType binaryType)\n            : base(value, BsonType.Binary)\n        {\n            BinaryType = binaryType;\n        }\n    }\n\n    internal class BsonRegex : BsonToken\n    {\n        public BsonString Pattern { get; set; }\n        public BsonString Options { get; set; }\n\n        public BsonRegex(string pattern, string options)\n        {\n            Pattern = new BsonString(pattern, false);\n            Options = new BsonString(options, false);\n        }\n\n        public override BsonType Type\n        {\n            get { return BsonType.Regex; }\n        }\n    }\n\n    internal class BsonProperty\n    {\n        public BsonString Name { get; set; }\n        public BsonToken Value { get; set; }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Bson/BsonType.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json.Bson\n{\n    internal enum BsonType : sbyte\n    {\n        Number = 1,\n        String = 2,\n        Object = 3,\n        Array = 4,\n        Binary = 5,\n        Undefined = 6,\n        Oid = 7,\n        Boolean = 8,\n        Date = 9,\n        Null = 10,\n        Regex = 11,\n        Reference = 12,\n        Code = 13,\n        Symbol = 14,\n        CodeWScope = 15,\n        Integer = 16,\n        TimeStamp = 17,\n        Long = 18,\n        MinKey = -1,\n        MaxKey = 127\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Bson/BsonWriter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\nusing System.Numerics;\n#endif\nusing System.Text;\nusing Newtonsoft.Json.Utilities;\nusing Newtonsoft.Json.Linq;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Bson\n{\n    /// <summary>\n    /// Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data.\n    /// </summary>\n    public class BsonWriter : JsonWriter\n    {\n        private readonly BsonBinaryWriter _writer;\n\n        private BsonToken _root;\n        private BsonToken _parent;\n        private string _propertyName;\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"DateTimeKind\" /> used when writing <see cref=\"DateTime\"/> values to BSON.\n        /// When set to <see cref=\"DateTimeKind.Unspecified\" /> no conversion will occur.\n        /// </summary>\n        /// <value>The <see cref=\"DateTimeKind\" /> used when writing <see cref=\"DateTime\"/> values to BSON.</value>\n        public DateTimeKind DateTimeKindHandling\n        {\n            get { return _writer.DateTimeKindHandling; }\n            set { _writer.DateTimeKindHandling = value; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BsonWriter\"/> class.\n        /// </summary>\n        /// <param name=\"stream\">The stream.</param>\n        public BsonWriter(Stream stream)\n        {\n            ValidationUtils.ArgumentNotNull(stream, \"stream\");\n            _writer = new BsonBinaryWriter(new BinaryWriter(stream));\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"BsonWriter\"/> class.\n        /// </summary>\n        /// <param name=\"writer\">The writer.</param>\n        public BsonWriter(BinaryWriter writer)\n        {\n            ValidationUtils.ArgumentNotNull(writer, \"writer\");\n            _writer = new BsonBinaryWriter(writer);\n        }\n\n        /// <summary>\n        /// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.\n        /// </summary>\n        public override void Flush()\n        {\n            _writer.Flush();\n        }\n\n        /// <summary>\n        /// Writes the end.\n        /// </summary>\n        /// <param name=\"token\">The token.</param>\n        protected override void WriteEnd(JsonToken token)\n        {\n            base.WriteEnd(token);\n            RemoveParent();\n\n            if (Top == 0)\n            {\n                _writer.WriteToken(_root);\n            }\n        }\n\n        /// <summary>\n        /// Writes out a comment <code>/*...*/</code> containing the specified text.\n        /// </summary>\n        /// <param name=\"text\">Text to place inside the comment.</param>\n        public override void WriteComment(string text)\n        {\n            throw JsonWriterException.Create(this, \"Cannot write JSON comment as BSON.\", null);\n        }\n\n        /// <summary>\n        /// Writes the start of a constructor with the given name.\n        /// </summary>\n        /// <param name=\"name\">The name of the constructor.</param>\n        public override void WriteStartConstructor(string name)\n        {\n            throw JsonWriterException.Create(this, \"Cannot write JSON constructor as BSON.\", null);\n        }\n\n        /// <summary>\n        /// Writes raw JSON.\n        /// </summary>\n        /// <param name=\"json\">The raw JSON to write.</param>\n        public override void WriteRaw(string json)\n        {\n            throw JsonWriterException.Create(this, \"Cannot write raw JSON as BSON.\", null);\n        }\n\n        /// <summary>\n        /// Writes raw JSON where a value is expected and updates the writer's state.\n        /// </summary>\n        /// <param name=\"json\">The raw JSON to write.</param>\n        public override void WriteRawValue(string json)\n        {\n            throw JsonWriterException.Create(this, \"Cannot write raw JSON as BSON.\", null);\n        }\n\n        /// <summary>\n        /// Writes the beginning of a Json array.\n        /// </summary>\n        public override void WriteStartArray()\n        {\n            base.WriteStartArray();\n\n            AddParent(new BsonArray());\n        }\n\n        /// <summary>\n        /// Writes the beginning of a Json object.\n        /// </summary>\n        public override void WriteStartObject()\n        {\n            base.WriteStartObject();\n\n            AddParent(new BsonObject());\n        }\n\n        /// <summary>\n        /// Writes the property name of a name/value pair on a Json object.\n        /// </summary>\n        /// <param name=\"name\">The name of the property.</param>\n        public override void WritePropertyName(string name)\n        {\n            base.WritePropertyName(name);\n\n            _propertyName = name;\n        }\n\n        /// <summary>\n        /// Closes this stream and the underlying stream.\n        /// </summary>\n        public override void Close()\n        {\n            base.Close();\n\n            if (CloseOutput && _writer != null)\n                _writer.Close();\n        }\n\n        private void AddParent(BsonToken container)\n        {\n            AddToken(container);\n            _parent = container;\n        }\n\n        private void RemoveParent()\n        {\n            _parent = _parent.Parent;\n        }\n\n        private void AddValue(object value, BsonType type)\n        {\n            AddToken(new BsonValue(value, type));\n        }\n\n        internal void AddToken(BsonToken token)\n        {\n            if (_parent != null)\n            {\n                if (_parent is BsonObject)\n                {\n                    ((BsonObject)_parent).Add(_propertyName, token);\n                    _propertyName = null;\n                }\n                else\n                {\n                    ((BsonArray)_parent).Add(token);\n                }\n            }\n            else\n            {\n                if (token.Type != BsonType.Object && token.Type != BsonType.Array)\n                    throw JsonWriterException.Create(this, \"Error writing {0} value. BSON must start with an Object or Array.\".FormatWith(CultureInfo.InvariantCulture, token.Type), null);\n\n                _parent = token;\n                _root = token;\n            }\n        }\n\n        #region WriteValue methods\n        /// <summary>\n        /// Writes a <see cref=\"Object\"/> value.\n        /// An error will raised if the value cannot be written as a single JSON token.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Object\"/> value to write.</param>\n        public override void WriteValue(object value)\n        {\n#if !(NET20 || NET35 || PORTABLE || PORTABLE40)\n            if (value is BigInteger)\n            {\n                InternalWriteValue(JsonToken.Integer);\n                AddToken(new BsonBinary(((BigInteger)value).ToByteArray(), BsonBinaryType.Binary));\n            }\n            else\n#endif\n            {\n                base.WriteValue(value);\n            }\n        }\n\n        /// <summary>\n        /// Writes a null value.\n        /// </summary>\n        public override void WriteNull()\n        {\n            base.WriteNull();\n            AddValue(null, BsonType.Null);\n        }\n\n        /// <summary>\n        /// Writes an undefined value.\n        /// </summary>\n        public override void WriteUndefined()\n        {\n            base.WriteUndefined();\n            AddValue(null, BsonType.Undefined);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"String\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"String\"/> value to write.</param>\n        public override void WriteValue(string value)\n        {\n            base.WriteValue(value);\n            if (value == null)\n                AddValue(null, BsonType.Null);\n            else\n                AddToken(new BsonString(value, true));\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int32\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int32\"/> value to write.</param>\n        public override void WriteValue(int value)\n        {\n            base.WriteValue(value);\n            AddValue(value, BsonType.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt32\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt32\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(uint value)\n        {\n            if (value > int.MaxValue)\n                throw JsonWriterException.Create(this, \"Value is too large to fit in a signed 32 bit integer. BSON does not support unsigned values.\", null);\n\n            base.WriteValue(value);\n            AddValue(value, BsonType.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int64\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int64\"/> value to write.</param>\n        public override void WriteValue(long value)\n        {\n            base.WriteValue(value);\n            AddValue(value, BsonType.Long);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt64\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt64\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(ulong value)\n        {\n            if (value > long.MaxValue)\n                throw JsonWriterException.Create(this, \"Value is too large to fit in a signed 64 bit integer. BSON does not support unsigned values.\", null);\n\n            base.WriteValue(value);\n            AddValue(value, BsonType.Long);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Single\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Single\"/> value to write.</param>\n        public override void WriteValue(float value)\n        {\n            base.WriteValue(value);\n            AddValue(value, BsonType.Number);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Double\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Double\"/> value to write.</param>\n        public override void WriteValue(double value)\n        {\n            base.WriteValue(value);\n            AddValue(value, BsonType.Number);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Boolean\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Boolean\"/> value to write.</param>\n        public override void WriteValue(bool value)\n        {\n            base.WriteValue(value);\n            AddValue(value, BsonType.Boolean);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int16\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int16\"/> value to write.</param>\n        public override void WriteValue(short value)\n        {\n            base.WriteValue(value);\n            AddValue(value, BsonType.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt16\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt16\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(ushort value)\n        {\n            base.WriteValue(value);\n            AddValue(value, BsonType.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Char\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Char\"/> value to write.</param>\n        public override void WriteValue(char value)\n        {\n            base.WriteValue(value);\n            string s = null;\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            s = value.ToString(CultureInfo.InvariantCulture);\n#else\n            s = value.ToString();\n#endif\n            AddToken(new BsonString(s, true));\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Byte\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Byte\"/> value to write.</param>\n        public override void WriteValue(byte value)\n        {\n            base.WriteValue(value);\n            AddValue(value, BsonType.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"SByte\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"SByte\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(sbyte value)\n        {\n            base.WriteValue(value);\n            AddValue(value, BsonType.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Decimal\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Decimal\"/> value to write.</param>\n        public override void WriteValue(decimal value)\n        {\n            base.WriteValue(value);\n            AddValue(value, BsonType.Number);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"DateTime\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"DateTime\"/> value to write.</param>\n        public override void WriteValue(DateTime value)\n        {\n            base.WriteValue(value);\n            value = DateTimeUtils.EnsureDateTime(value, DateTimeZoneHandling);\n            AddValue(value, BsonType.Date);\n        }\n\n#if !NET20\n        /// <summary>\n        /// Writes a <see cref=\"DateTimeOffset\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"DateTimeOffset\"/> value to write.</param>\n        public override void WriteValue(DateTimeOffset value)\n        {\n            base.WriteValue(value);\n            AddValue(value, BsonType.Date);\n        }\n#endif\n\n        /// <summary>\n        /// Writes a <see cref=\"T:Byte[]\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"T:Byte[]\"/> value to write.</param>\n        public override void WriteValue(byte[] value)\n        {\n            base.WriteValue(value);\n            AddToken(new BsonBinary(value, BsonBinaryType.Binary));\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Guid\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Guid\"/> value to write.</param>\n        public override void WriteValue(Guid value)\n        {\n            base.WriteValue(value);\n            AddToken(new BsonBinary(value.ToByteArray(), BsonBinaryType.Uuid));\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"TimeSpan\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"TimeSpan\"/> value to write.</param>\n        public override void WriteValue(TimeSpan value)\n        {\n            base.WriteValue(value);\n            AddToken(new BsonString(value.ToString(), true));\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Uri\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Uri\"/> value to write.</param>\n        public override void WriteValue(Uri value)\n        {\n            base.WriteValue(value);\n            AddToken(new BsonString(value.ToString(), true));\n        }\n        #endregion\n\n        /// <summary>\n        /// Writes a <see cref=\"T:Byte[]\"/> value that represents a BSON object id.\n        /// </summary>\n        /// <param name=\"value\">The Object ID value to write.</param>\n        public void WriteObjectId(byte[] value)\n        {\n            ValidationUtils.ArgumentNotNull(value, \"value\");\n\n            if (value.Length != 12)\n                throw JsonWriterException.Create(this, \"An object id must be 12 bytes\", null);\n\n            // hack to update the writer state\n            UpdateScopeWithFinishedValue();\n            AutoComplete(JsonToken.Undefined);\n            AddValue(value, BsonType.Oid);\n        }\n\n        /// <summary>\n        /// Writes a BSON regex.\n        /// </summary>\n        /// <param name=\"pattern\">The regex pattern.</param>\n        /// <param name=\"options\">The regex options.</param>\n        public void WriteRegex(string pattern, string options)\n        {\n            ValidationUtils.ArgumentNotNull(pattern, \"pattern\");\n\n            // hack to update the writer state\n            UpdateScopeWithFinishedValue();\n            AutoComplete(JsonToken.Undefined);\n            AddToken(new BsonRegex(pattern, options));\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/ConstructorHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies how constructors are used when initializing objects during deserialization by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public enum ConstructorHandling\n    {\n        /// <summary>\n        /// First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor.\n        /// </summary>\n        Default = 0,\n\n        /// <summary>\n        /// Json.NET will use a non-public default constructor before falling back to a paramatized constructor.\n        /// </summary>\n        AllowNonPublicDefaultConstructor = 1\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Converters/BinaryConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\nusing System;\nusing System.Data.SqlTypes;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\nusing System.Collections.Generic;\n\nnamespace Newtonsoft.Json.Converters\n{\n#if !NET20\n    internal interface IBinary\n    {\n        byte[] ToArray();\n    }\n#endif\n\n    /// <summary>\n    /// Converts a binary value to and from a base 64 string value.\n    /// </summary>\n    public class BinaryConverter : JsonConverter\n    {\n#if !NET20\n        private const string BinaryTypeName = \"System.Data.Linq.Binary\";\n#endif\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            if (value == null)\n            {\n                writer.WriteNull();\n                return;\n            }\n\n            byte[] data = GetByteArray(value);\n\n            writer.WriteValue(data);\n        }\n\n        private byte[] GetByteArray(object value)\n        {\n#if !(NET20)\n            if (value.GetType().AssignableToTypeName(BinaryTypeName))\n            {\n                IBinary binary = DynamicWrapper.CreateWrapper<IBinary>(value);\n                return binary.ToArray();\n            }\n#endif\n            if (value is SqlBinary)\n                return ((SqlBinary)value).Value;\n\n            throw new JsonSerializationException(\"Unexpected value type when writing binary: {0}\".FormatWith(CultureInfo.InvariantCulture, value.GetType()));\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            Type t = (ReflectionUtils.IsNullableType(objectType))\n                ? Nullable.GetUnderlyingType(objectType)\n                : objectType;\n\n            if (reader.TokenType == JsonToken.Null)\n            {\n                if (!ReflectionUtils.IsNullable(objectType))\n                    throw JsonSerializationException.Create(reader, \"Cannot convert null value to {0}.\".FormatWith(CultureInfo.InvariantCulture, objectType));\n\n                return null;\n            }\n\n            byte[] data;\n\n            if (reader.TokenType == JsonToken.StartArray)\n            {\n                data = ReadByteArray(reader);\n            }\n            else if (reader.TokenType == JsonToken.String)\n            {\n                // current token is already at base64 string\n                // unable to call ReadAsBytes so do it the old fashion way\n                string encodedData = reader.Value.ToString();\n                data = Convert.FromBase64String(encodedData);\n            }\n            else\n            {\n                throw JsonSerializationException.Create(reader, \"Unexpected token parsing binary. Expected String or StartArray, got {0}.\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n            }\n\n\n#if !NET20\n            if (t.AssignableToTypeName(BinaryTypeName))\n                return Activator.CreateInstance(t, data);\n#endif\n\n            if (t == typeof(SqlBinary))\n                return new SqlBinary(data);\n\n            throw JsonSerializationException.Create(reader, \"Unexpected object type when writing binary: {0}\".FormatWith(CultureInfo.InvariantCulture, objectType));\n        }\n\n        private byte[] ReadByteArray(JsonReader reader)\n        {\n            List<byte> byteList = new List<byte>();\n\n            while (reader.Read())\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.Integer:\n                        byteList.Add(Convert.ToByte(reader.Value, CultureInfo.InvariantCulture));\n                        break;\n                    case JsonToken.EndArray:\n                        return byteList.ToArray();\n                    case JsonToken.Comment:\n                        // skip\n                        break;\n                    default:\n                        throw JsonSerializationException.Create(reader, \"Unexpected token when reading bytes: {0}\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n                }\n            }\n\n            throw JsonSerializationException.Create(reader, \"Unexpected end when reading bytes.\");\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n#if !NET20\n            if (objectType.AssignableToTypeName(BinaryTypeName))\n                return true;\n#endif\n\n            if (objectType == typeof(SqlBinary) || objectType == typeof(SqlBinary?))\n                return true;\n\n            return false;\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Converters/BsonObjectIdConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing Newtonsoft.Json.Bson;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts a <see cref=\"BsonObjectId\"/> to and from JSON and BSON.\n    /// </summary>\n    public class BsonObjectIdConverter : JsonConverter\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            BsonObjectId objectId = (BsonObjectId)value;\n\n            BsonWriter bsonWriter = writer as BsonWriter;\n            if (bsonWriter != null)\n            {\n                bsonWriter.WriteObjectId(objectId.Value);\n            }\n            else\n            {\n                writer.WriteValue(objectId.Value);\n            }\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if (reader.TokenType != JsonToken.Bytes)\n                throw new JsonSerializationException(\"Expected Bytes but got {0}.\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n\n            byte[] value = (byte[])reader.Value;\n\n            return new BsonObjectId(value);\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return (objectType == typeof(BsonObjectId));\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Converters/CustomCreationConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Create a custom object\n    /// </summary>\n    /// <typeparam name=\"T\">The object type to convert.</typeparam>\n    public abstract class CustomCreationConverter<T> : JsonConverter\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            throw new NotSupportedException(\"CustomCreationConverter should only be used while deserializing.\");\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if (reader.TokenType == JsonToken.Null)\n                return null;\n\n            T value = Create(objectType);\n            if (value == null)\n                throw new JsonSerializationException(\"No object created.\");\n\n            serializer.Populate(reader, value);\n            return value;\n        }\n\n        /// <summary>\n        /// Creates an object which will then be populated by the serializer.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>The created object.</returns>\n        public abstract T Create(Type objectType);\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return typeof(T).IsAssignableFrom(objectType);\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether this <see cref=\"JsonConverter\"/> can write JSON.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if this <see cref=\"JsonConverter\"/> can write JSON; otherwise, <c>false</c>.\n        /// </value>\n        public override bool CanWrite\n        {\n            get { return false; }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Converters/DataSetConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\nusing System;\nusing System.Data;\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts a <see cref=\"DataSet\"/> to and from JSON.\n    /// </summary>\n    public class DataSetConverter : JsonConverter\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            DataSet dataSet = (DataSet)value;\n            DefaultContractResolver resolver = serializer.ContractResolver as DefaultContractResolver;\n\n            DataTableConverter converter = new DataTableConverter();\n\n            writer.WriteStartObject();\n\n            foreach (DataTable table in dataSet.Tables)\n            {\n                writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(table.TableName) : table.TableName);\n\n                converter.WriteJson(writer, table, serializer);\n            }\n\n            writer.WriteEndObject();\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            // handle typed datasets\n            DataSet ds = (objectType == typeof(DataSet))\n                ? new DataSet()\n                : (DataSet)Activator.CreateInstance(objectType);\n\n            DataTableConverter converter = new DataTableConverter();\n\n            reader.Read();\n\n            while (reader.TokenType == JsonToken.PropertyName)\n            {\n                DataTable dt = ds.Tables[(string)reader.Value];\n                bool exists = (dt != null);\n\n                dt = (DataTable)converter.ReadJson(reader, typeof(DataTable), dt, serializer);\n\n                if (!exists)\n                    ds.Tables.Add(dt);\n\n                reader.Read();\n            }\n\n            return ds;\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified value type.\n        /// </summary>\n        /// <param name=\"valueType\">Type of the value.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified value type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type valueType)\n        {\n            return typeof(DataSet).IsAssignableFrom(valueType);\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Converters/DataTableConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections.Generic;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\nusing System;\nusing System.Data;\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts a <see cref=\"DataTable\"/> to and from JSON.\n    /// </summary>\n    public class DataTableConverter : JsonConverter\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            DataTable table = (DataTable)value;\n            DefaultContractResolver resolver = serializer.ContractResolver as DefaultContractResolver;\n\n            writer.WriteStartArray();\n\n            foreach (DataRow row in table.Rows)\n            {\n                writer.WriteStartObject();\n                foreach (DataColumn column in row.Table.Columns)\n                {\n                    if (serializer.NullValueHandling == NullValueHandling.Ignore && (row[column] == null || row[column] == DBNull.Value))\n                        continue;\n\n                    writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(column.ColumnName) : column.ColumnName);\n                    serializer.Serialize(writer, row[column]);\n                }\n                writer.WriteEndObject();\n            }\n\n            writer.WriteEndArray();\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            DataTable dt = existingValue as DataTable;\n\n            if (dt == null)\n            {\n                // handle typed datasets\n                dt = (objectType == typeof(DataTable))\n                    ? new DataTable()\n                    : (DataTable)Activator.CreateInstance(objectType);\n            }\n\n            if (reader.TokenType == JsonToken.PropertyName)\n            {\n                dt.TableName = (string)reader.Value;\n\n                reader.Read();\n            }\n\n            if (reader.TokenType == JsonToken.StartArray)\n                reader.Read();\n\n            while (reader.TokenType != JsonToken.EndArray)\n            {\n                CreateRow(reader, dt);\n\n                reader.Read();\n            }\n\n            return dt;\n        }\n\n        private static void CreateRow(JsonReader reader, DataTable dt)\n        {\n            DataRow dr = dt.NewRow();\n            reader.Read();\n\n            while (reader.TokenType == JsonToken.PropertyName)\n            {\n                string columnName = (string)reader.Value;\n\n                reader.Read();\n\n                DataColumn column = dt.Columns[columnName];\n                if (column == null)\n                {\n                    Type columnType = GetColumnDataType(reader);\n                    column = new DataColumn(columnName, columnType);\n                    dt.Columns.Add(column);\n                }\n\n                if (column.DataType == typeof(DataTable))\n                {\n                    if (reader.TokenType == JsonToken.StartArray)\n                        reader.Read();\n\n                    DataTable nestedDt = new DataTable();\n\n                    while (reader.TokenType != JsonToken.EndArray)\n                    {\n                        CreateRow(reader, nestedDt);\n\n                        reader.Read();\n                    }\n\n                    dr[columnName] = nestedDt;\n                }\n                else if (column.DataType.IsArray)\n                {\n                    if (reader.TokenType == JsonToken.StartArray)\n                        reader.Read();\n\n                    List<object> o = new List<object>();\n\n                    while (reader.TokenType != JsonToken.EndArray)\n                    {\n                        o.Add(reader.Value);\n                        reader.Read();\n                    }\n\n                    Array destinationArray = Array.CreateInstance(column.DataType.GetElementType(), o.Count);\n                    Array.Copy(o.ToArray(), destinationArray, o.Count);\n\n                    dr[columnName] = destinationArray;\n                }\n                else\n                {\n                    dr[columnName] = reader.Value ?? DBNull.Value;\n                }\n                \n                reader.Read();\n            }\n\n            dr.EndEdit();\n            dt.Rows.Add(dr);\n        }\n\n        private static Type GetColumnDataType(JsonReader reader)\n        {\n            JsonToken tokenType = reader.TokenType;\n\n            switch (tokenType)\n            {\n                case JsonToken.Integer:\n                    return typeof(long);\n                case JsonToken.Float:\n                    return typeof(double);\n                case JsonToken.String:\n                case JsonToken.Null:\n                case JsonToken.Undefined:\n                    return typeof(string);\n                case JsonToken.Boolean:\n                    return typeof(bool);\n                case JsonToken.Date:\n                    return typeof(DateTime);\n                case JsonToken.StartArray:\n                    reader.Read();\n                    if (reader.TokenType == JsonToken.StartObject)\n                        return typeof(DataTable); // nested datatable\n\n                    Type arrayType = GetColumnDataType(reader);\n                    return arrayType.MakeArrayType();\n                default:\n                    throw new JsonException(\"Unexpected JSON token while reading DataTable: {0}\".FormatWith(CultureInfo.InvariantCulture, tokenType));\n            }\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified value type.\n        /// </summary>\n        /// <param name=\"valueType\">Type of the value.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified value type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type valueType)\n        {\n            return typeof(DataTable).IsAssignableFrom(valueType);\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Converters/DateTimeConverterBase.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Provides a base class for converting a <see cref=\"DateTime\"/> to and from JSON.\n    /// </summary>\n    public abstract class DateTimeConverterBase : JsonConverter\n    {\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            if (objectType == typeof(DateTime) || objectType == typeof(DateTime?))\n                return true;\n#if !NET20\n            if (objectType == typeof(DateTimeOffset) || objectType == typeof(DateTimeOffset?))\n                return true;\n#endif\n\n            return false;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Converters/DiscriminatedUnionConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NET35 || NET20 || NETFX_CORE)\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.ComponentModel;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\nusing System.Reflection;\nusing Newtonsoft.Json.Serialization;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts a F# discriminated union type to and from JSON.\n    /// </summary>\n    public class DiscriminatedUnionConverter : JsonConverter\n    {\n        private const string CasePropertyName = \"Case\";\n        private const string FieldsPropertyName = \"Fields\";\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            DefaultContractResolver resolver = serializer.ContractResolver as DefaultContractResolver;\n\n            Type t = value.GetType();\n\n            object result = FSharpUtils.GetUnionFields(null, value, t, null);\n            object info = FSharpUtils.GetUnionCaseInfo(result);\n            object fields = FSharpUtils.GetUnionCaseFields(result);\n            object caseName = FSharpUtils.GetUnionCaseInfoName(info);\n\n            writer.WriteStartObject();\n            writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(CasePropertyName) : CasePropertyName);\n            writer.WriteValue((string)caseName);\n            writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(FieldsPropertyName) : FieldsPropertyName);\n            serializer.Serialize(writer, fields);\n            writer.WriteEndObject();\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if (reader.TokenType == JsonToken.Null)\n                return null;\n\n            IEnumerable cases = (IEnumerable)FSharpUtils.GetUnionCases(null, objectType, null);\n\n            ReadAndAssertProperty(reader, CasePropertyName);\n            ReadAndAssert(reader);\n\n            string caseName = reader.Value.ToString();\n\n            object matchingCaseInfo = null;\n            foreach (object c in cases)\n            {\n                if ((string)FSharpUtils.GetUnionCaseInfoName(c) == caseName)\n                {\n                    matchingCaseInfo = c;\n                    break;\n                }\n            }\n\n            if (matchingCaseInfo == null)\n                throw new JsonSerializationException(\"No union type found with the name '{0}'.\".FormatWith(CultureInfo.InvariantCulture, caseName));\n\n            ReadAndAssertProperty(reader, FieldsPropertyName);\n            // start array\n            ReadAndAssert(reader);\n            // first value\n            ReadAndAssert(reader);\n\n            PropertyInfo[] fieldProperties = (PropertyInfo[])FSharpUtils.GetUnionCaseInfoFields(matchingCaseInfo);\n            List<object> fieldValues = new List<object>();\n            foreach (PropertyInfo field in fieldProperties)\n            {\n                fieldValues.Add(serializer.Deserialize(reader, field.PropertyType));\n                ReadAndAssert(reader);\n            }\n\n            // end object\n            ReadAndAssert(reader);\n\n            return FSharpUtils.MakeUnion(null, matchingCaseInfo, fieldValues.ToArray(), null);\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            if (typeof(IEnumerable).IsAssignableFrom(objectType))\n                return false;\n\n            // all fsharp objects have CompilationMappingAttribute\n            // get the fsharp assembly from the attribute and initialize latebound methods\n            object[] attributes;\n#if !(NETFX_CORE || PORTABLE)\n            attributes = objectType.GetCustomAttributes(true);\n#else\n            attributes = objectType.GetTypeInfo().GetCustomAttributes(true).ToArray();\n#endif\n\n            bool isFSharpType = false;\n            foreach (object attribute in attributes)\n            {\n                Type attributeType = attribute.GetType();\n                if (attributeType.Name == \"CompilationMappingAttribute\")\n                {\n                    FSharpUtils.EnsureInitialized(attributeType.Assembly());\n\n                    isFSharpType = true;\n                    break;\n                }\n            }\n\n            if (!isFSharpType)\n                return false;\n\n            return (bool)FSharpUtils.IsUnion(null, objectType, null);\n        }\n\n        private static void ReadAndAssertProperty(JsonReader reader, string propertyName)\n        {\n            ReadAndAssert(reader);\n\n            if (reader.TokenType != JsonToken.PropertyName || !string.Equals(reader.Value.ToString(), propertyName, StringComparison.OrdinalIgnoreCase))\n                throw new JsonSerializationException(\"Expected JSON property '{0}'.\".FormatWith(CultureInfo.InvariantCulture, propertyName));\n        }\n\n        private static void ReadAndAssert(JsonReader reader)\n        {\n            if (!reader.Read())\n                throw new JsonSerializationException(\"Unexpected end.\");\n        }\n    }\n}\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Converters/EntityKeyMemberConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)\nusing System;\nusing Newtonsoft.Json.Serialization;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Converters\n{\n    internal interface IEntityKeyMember\n    {\n        string Key { get; set; }\n        object Value { get; set; }\n    }\n\n    /// <summary>\n    /// Converts an Entity Framework EntityKey to and from JSON.\n    /// </summary>\n    public class EntityKeyMemberConverter : JsonConverter\n    {\n        private const string EntityKeyMemberFullTypeName = \"System.Data.EntityKeyMember\";\n\n        private const string KeyPropertyName = \"Key\";\n        private const string TypePropertyName = \"Type\";\n        private const string ValuePropertyName = \"Value\";\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            DefaultContractResolver resolver = serializer.ContractResolver as DefaultContractResolver;\n\n            IEntityKeyMember entityKeyMember = DynamicWrapper.CreateWrapper<IEntityKeyMember>(value);\n            Type keyType = (entityKeyMember.Value != null) ? entityKeyMember.Value.GetType() : null;\n\n            writer.WriteStartObject();\n            writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(KeyPropertyName) : KeyPropertyName);\n            writer.WriteValue(entityKeyMember.Key);\n            writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(TypePropertyName) : TypePropertyName);\n            writer.WriteValue((keyType != null) ? keyType.FullName : null);\n\n            writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(ValuePropertyName) : ValuePropertyName);\n\n            if (keyType != null)\n            {\n                string valueJson;\n                if (JsonSerializerInternalWriter.TryConvertToString(entityKeyMember.Value, keyType, out valueJson))\n                    writer.WriteValue(valueJson);\n                else\n                    writer.WriteValue(entityKeyMember.Value);\n            }\n            else\n            {\n                writer.WriteNull();\n            }\n\n            writer.WriteEndObject();\n        }\n\n        private static void ReadAndAssertProperty(JsonReader reader, string propertyName)\n        {\n            ReadAndAssert(reader);\n\n            if (reader.TokenType != JsonToken.PropertyName || !string.Equals(reader.Value.ToString(), propertyName, StringComparison.OrdinalIgnoreCase))\n                throw new JsonSerializationException(\"Expected JSON property '{0}'.\".FormatWith(CultureInfo.InvariantCulture, propertyName));\n        }\n\n        private static void ReadAndAssert(JsonReader reader)\n        {\n            if (!reader.Read())\n                throw new JsonSerializationException(\"Unexpected end.\");\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            IEntityKeyMember entityKeyMember = DynamicWrapper.CreateWrapper<IEntityKeyMember>(Activator.CreateInstance(objectType));\n\n            ReadAndAssertProperty(reader, KeyPropertyName);\n            ReadAndAssert(reader);\n            entityKeyMember.Key = reader.Value.ToString();\n\n            ReadAndAssertProperty(reader, TypePropertyName);\n            ReadAndAssert(reader);\n            string type = reader.Value.ToString();\n\n            Type t = Type.GetType(type);\n\n            ReadAndAssertProperty(reader, ValuePropertyName);\n            ReadAndAssert(reader);\n            entityKeyMember.Value = serializer.Deserialize(reader, t);\n\n            ReadAndAssert(reader);\n\n            return DynamicWrapper.GetUnderlyingObject(entityKeyMember);\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType.AssignableToTypeName(EntityKeyMemberFullTypeName);\n        }\n    }\n}\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Converters/ExpandoObjectConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NET35 || NET20 || PORTABLE40)\n\nusing System;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts an ExpandoObject to and from JSON.\n    /// </summary>\n    public class ExpandoObjectConverter : JsonConverter\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            // can write is set to false\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            return ReadValue(reader);\n        }\n\n        private object ReadValue(JsonReader reader)\n        {\n            while (reader.TokenType == JsonToken.Comment)\n            {\n                if (!reader.Read())\n                    throw JsonSerializationException.Create(reader, \"Unexpected end when reading ExpandoObject.\");\n            }\n\n            switch (reader.TokenType)\n            {\n                case JsonToken.StartObject:\n                    return ReadObject(reader);\n                case JsonToken.StartArray:\n                    return ReadList(reader);\n                default:\n                    if (JsonReader.IsPrimitiveToken(reader.TokenType))\n                        return reader.Value;\n\n                    throw JsonSerializationException.Create(reader, \"Unexpected token when converting ExpandoObject: {0}\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n            }\n        }\n\n        private object ReadList(JsonReader reader)\n        {\n            IList<object> list = new List<object>();\n\n            while (reader.Read())\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.Comment:\n                        break;\n                    default:\n                        object v = ReadValue(reader);\n\n                        list.Add(v);\n                        break;\n                    case JsonToken.EndArray:\n                        return list;\n                }\n            }\n\n            throw JsonSerializationException.Create(reader, \"Unexpected end when reading ExpandoObject.\");\n        }\n\n        private object ReadObject(JsonReader reader)\n        {\n            IDictionary<string, object> expandoObject = new ExpandoObject();\n\n            while (reader.Read())\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.PropertyName:\n                        string propertyName = reader.Value.ToString();\n\n                        if (!reader.Read())\n                            throw JsonSerializationException.Create(reader, \"Unexpected end when reading ExpandoObject.\");\n\n                        object v = ReadValue(reader);\n\n                        expandoObject[propertyName] = v;\n                        break;\n                    case JsonToken.Comment:\n                        break;\n                    case JsonToken.EndObject:\n                        return expandoObject;\n                }\n            }\n\n            throw JsonSerializationException.Create(reader, \"Unexpected end when reading ExpandoObject.\");\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return (objectType == typeof(ExpandoObject));\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether this <see cref=\"JsonConverter\"/> can write JSON.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if this <see cref=\"JsonConverter\"/> can write JSON; otherwise, <c>false</c>.\n        /// </value>\n        public override bool CanWrite\n        {\n            get { return false; }\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Converters/IsoDateTimeConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts a <see cref=\"DateTime\"/> to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z).\n    /// </summary>\n    public class IsoDateTimeConverter : DateTimeConverterBase\n    {\n        private const string DefaultDateTimeFormat = \"yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK\";\n\n        private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind;\n        private string _dateTimeFormat;\n        private CultureInfo _culture;\n\n        /// <summary>\n        /// Gets or sets the date time styles used when converting a date to and from JSON.\n        /// </summary>\n        /// <value>The date time styles used when converting a date to and from JSON.</value>\n        public DateTimeStyles DateTimeStyles\n        {\n            get { return _dateTimeStyles; }\n            set { _dateTimeStyles = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the date time format used when converting a date to and from JSON.\n        /// </summary>\n        /// <value>The date time format used when converting a date to and from JSON.</value>\n        public string DateTimeFormat\n        {\n            get { return _dateTimeFormat ?? string.Empty; }\n            set { _dateTimeFormat = StringUtils.NullEmptyString(value); }\n        }\n\n        /// <summary>\n        /// Gets or sets the culture used when converting a date to and from JSON.\n        /// </summary>\n        /// <value>The culture used when converting a date to and from JSON.</value>\n        public CultureInfo Culture\n        {\n            get { return _culture ?? CultureInfo.CurrentCulture; }\n            set { _culture = value; }\n        }\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            string text;\n\n            if (value is DateTime)\n            {\n                DateTime dateTime = (DateTime)value;\n\n                if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal\n                    || (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)\n                    dateTime = dateTime.ToUniversalTime();\n\n                text = dateTime.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture);\n            }\n#if !NET20\n            else if (value is DateTimeOffset)\n            {\n                DateTimeOffset dateTimeOffset = (DateTimeOffset)value;\n                if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal\n                    || (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)\n                    dateTimeOffset = dateTimeOffset.ToUniversalTime();\n\n                text = dateTimeOffset.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture);\n            }\n#endif\n            else\n            {\n                throw new JsonSerializationException(\"Unexpected value when converting date. Expected DateTime or DateTimeOffset, got {0}.\".FormatWith(CultureInfo.InvariantCulture, ReflectionUtils.GetObjectType(value)));\n            }\n\n            writer.WriteValue(text);\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            bool nullable = ReflectionUtils.IsNullableType(objectType);\n            Type t = (nullable)\n                ? Nullable.GetUnderlyingType(objectType)\n                : objectType;\n\n            if (reader.TokenType == JsonToken.Null)\n            {\n                if (!ReflectionUtils.IsNullableType(objectType))\n                    throw JsonSerializationException.Create(reader, \"Cannot convert null value to {0}.\".FormatWith(CultureInfo.InvariantCulture, objectType));\n\n                return null;\n            }\n\n            if (reader.TokenType == JsonToken.Date)\n            {\n#if !NET20\n                if (t == typeof(DateTimeOffset))\n                    return reader.Value is DateTimeOffset ? reader.Value : new DateTimeOffset((DateTime)reader.Value);\n#endif\n\n                return reader.Value;\n            }\n\n            if (reader.TokenType != JsonToken.String)\n                throw JsonSerializationException.Create(reader, \"Unexpected token parsing date. Expected String, got {0}.\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n\n            string dateText = reader.Value.ToString();\n\n            if (string.IsNullOrEmpty(dateText) && nullable)\n                return null;\n\n#if !NET20\n            if (t == typeof(DateTimeOffset))\n            {\n                if (!string.IsNullOrEmpty(_dateTimeFormat))\n                    return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles);\n                else\n                    return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles);\n            }\n#endif\n\n            if (!string.IsNullOrEmpty(_dateTimeFormat))\n                return DateTime.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles);\n            else\n                return DateTime.Parse(dateText, Culture, _dateTimeStyles);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Converters/JavaScriptDateTimeConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts a <see cref=\"DateTime\"/> to and from a JavaScript date constructor (e.g. new Date(52231943)).\n    /// </summary>\n    public class JavaScriptDateTimeConverter : DateTimeConverterBase\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            long ticks;\n\n            if (value is DateTime)\n            {\n                DateTime dateTime = (DateTime)value;\n                DateTime utcDateTime = dateTime.ToUniversalTime();\n                ticks = DateTimeUtils.ConvertDateTimeToJavaScriptTicks(utcDateTime);\n            }\n#if !NET20\n            else if (value is DateTimeOffset)\n            {\n                DateTimeOffset dateTimeOffset = (DateTimeOffset)value;\n                DateTimeOffset utcDateTimeOffset = dateTimeOffset.ToUniversalTime();\n                ticks = DateTimeUtils.ConvertDateTimeToJavaScriptTicks(utcDateTimeOffset.UtcDateTime);\n            }\n#endif\n            else\n            {\n                throw new JsonSerializationException(\"Expected date object value.\");\n            }\n\n            writer.WriteStartConstructor(\"Date\");\n            writer.WriteValue(ticks);\n            writer.WriteEndConstructor();\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing property value of the JSON that is being converted.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            Type t = (ReflectionUtils.IsNullableType(objectType))\n                ? Nullable.GetUnderlyingType(objectType)\n                : objectType;\n\n            if (reader.TokenType == JsonToken.Null)\n            {\n                if (!ReflectionUtils.IsNullable(objectType))\n                    throw JsonSerializationException.Create(reader, \"Cannot convert null value to {0}.\".FormatWith(CultureInfo.InvariantCulture, objectType));\n\n                return null;\n            }\n\n            if (reader.TokenType != JsonToken.StartConstructor || !string.Equals(reader.Value.ToString(), \"Date\", StringComparison.Ordinal))\n                throw JsonSerializationException.Create(reader, \"Unexpected token or value when parsing date. Token: {0}, Value: {1}\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType, reader.Value));\n\n            reader.Read();\n\n            if (reader.TokenType != JsonToken.Integer)\n                throw JsonSerializationException.Create(reader, \"Unexpected token parsing date. Expected Integer, got {0}.\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n\n            long ticks = (long)reader.Value;\n\n            DateTime d = DateTimeUtils.ConvertJavaScriptTicksToDateTime(ticks);\n\n            reader.Read();\n\n            if (reader.TokenType != JsonToken.EndConstructor)\n                throw JsonSerializationException.Create(reader, \"Unexpected token parsing date. Expected EndConstructor, got {0}.\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n\n#if !NET20\n            if (t == typeof(DateTimeOffset))\n                return new DateTimeOffset(d);\n#endif\n\n            return d;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Converters/JsonValueConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n\n#if NETFX_CORE\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Security;\nusing Newtonsoft.Json.Utilities;\nusing Windows.Data.Json;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts a <see cref=\"IJsonValue\"/> to and from JSON.\n    /// </summary>\n    public class JsonValueConverter : JsonConverter\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            WriteJsonValue(writer, (IJsonValue)value);\n        }\n\n        private void WriteJsonValue(JsonWriter writer, IJsonValue value)\n        {\n            switch (value.ValueType)\n            {\n                case JsonValueType.Array:\n                {\n                    JsonArray a = value.GetArray();\n                    writer.WriteStartArray();\n                    for (int i = 0; i < a.Count; i++)\n                    {\n                        WriteJsonValue(writer, a[i]);\n                    }\n                    writer.WriteEndArray();\n                }\n                    break;\n                case JsonValueType.Boolean:\n                {\n                    writer.WriteValue(value.GetBoolean());\n                }\n                    break;\n                case JsonValueType.Null:\n                {\n                    writer.WriteNull();\n                }\n                    break;\n                case JsonValueType.Number:\n                {\n                    // JsonValue doesn't support integers\n                    // serialize whole numbers without a decimal point\n                    double d = value.GetNumber();\n                    bool isInteger = (d % 1 == 0);\n                    if (isInteger && d <= long.MaxValue && d >= long.MinValue)\n                        writer.WriteValue(Convert.ToInt64(d));\n                    else\n                        writer.WriteValue(d);\n                }\n                    break;\n                case JsonValueType.Object:\n                {\n                    JsonObject o = value.GetObject();\n                    writer.WriteStartObject();\n                    foreach (KeyValuePair<string, IJsonValue> v in o)\n                    {\n                        writer.WritePropertyName(v.Key);\n                        WriteJsonValue(writer, v.Value);\n                    }\n                    writer.WriteEndObject();\n                }\n                    break;\n                case JsonValueType.String:\n                {\n                    writer.WriteValue(value.GetString());\n                }\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException(\"ValueType\");\n            }\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if (reader.TokenType == JsonToken.None)\n                reader.Read();\n\n            IJsonValue value = CreateJsonValue(reader);\n\n            if (!objectType.IsAssignableFrom(value.GetType()))\n                throw JsonSerializationException.Create(reader, \"Could not convert '{0}' to '{1}'.\".FormatWith(CultureInfo.InvariantCulture, value.GetType(), objectType));\n\n            return value;\n        }\n\n        private IJsonValue CreateJsonValue(JsonReader reader)\n        {\n            while (reader.TokenType == JsonToken.Comment)\n            {\n                if (!reader.Read())\n                    throw JsonSerializationException.Create(reader, \"Unexpected end.\");\n            }\n\n            switch (reader.TokenType)\n            {\n                case JsonToken.StartObject:\n                {\n                    return CreateJsonObject(reader);\n                }\n                case JsonToken.StartArray:\n                {\n                    JsonArray a = new JsonArray();\n\n                    while (reader.Read())\n                    {\n                        switch (reader.TokenType)\n                        {\n                            case JsonToken.EndArray:\n                                return a;\n                            default:\n                                IJsonValue value = CreateJsonValue(reader);\n                                a.Add(value);\n                                break;\n                        }\n                    }\n                }\n                    break;\n                case JsonToken.Integer:\n                case JsonToken.Float:\n                    return JsonValue.CreateNumberValue(Convert.ToDouble(reader.Value, CultureInfo.InvariantCulture));\n                case JsonToken.String:\n                    return JsonValue.CreateStringValue(reader.Value.ToString());\n                case JsonToken.Boolean:\n                    return JsonValue.CreateBooleanValue(Convert.ToBoolean(reader.Value, CultureInfo.InvariantCulture));\n                case JsonToken.Null:\n                    // surely there is a better way to create a null value than this?\n                    return JsonValue.Parse(\"null\");\n                case JsonToken.Date:\n                    return JsonValue.CreateStringValue(reader.Value.ToString());\n                case JsonToken.Bytes:\n                    return JsonValue.CreateStringValue(reader.Value.ToString());\n                default:\n                    throw JsonSerializationException.Create(reader, \"Unexpected or unsupported token: {0}\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n            }\n\n            throw JsonSerializationException.Create(reader, \"Unexpected end.\");\n        }\n\n        private JsonObject CreateJsonObject(JsonReader reader)\n        {\n            JsonObject o = new JsonObject();\n            string propertyName = null;\n\n            while (reader.Read())\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.PropertyName:\n                        propertyName = (string)reader.Value;\n                        break;\n                    case JsonToken.EndObject:\n                        return o;\n                    case JsonToken.Comment:\n                        break;\n                    default:\n                        IJsonValue propertyValue = CreateJsonValue(reader);\n                        o.Add(propertyName, propertyValue);\n                        break;\n                }\n            }\n\n            throw JsonSerializationException.Create(reader, \"Unexpected end.\");\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return typeof(IJsonValue).IsAssignableFrom(objectType);\n        }\n    }\n}\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Converters/KeyValuePairConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Serialization;\nusing Newtonsoft.Json.Utilities;\nusing System.Reflection;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts a <see cref=\"KeyValuePair{TKey,TValue}\"/> to and from JSON.\n    /// </summary>\n    public class KeyValuePairConverter : JsonConverter\n    {\n        private const string KeyName = \"Key\";\n        private const string ValueName = \"Value\";\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            Type t = value.GetType();\n            IList<Type> genericArguments = t.GetGenericArguments();\n            Type keyType = genericArguments[0];\n            Type valueType = genericArguments[1];\n\n            PropertyInfo keyProperty = t.GetProperty(KeyName);\n            PropertyInfo valueProperty = t.GetProperty(ValueName);\n\n            DefaultContractResolver resolver = serializer.ContractResolver as DefaultContractResolver;\n\n            writer.WriteStartObject();\n\n            writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(KeyName) : KeyName);\n            serializer.Serialize(writer, ReflectionUtils.GetMemberValue(keyProperty, value), keyType);\n            writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(ValueName) : ValueName);\n            serializer.Serialize(writer, ReflectionUtils.GetMemberValue(valueProperty, value), valueType);\n            writer.WriteEndObject();\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            bool isNullable = ReflectionUtils.IsNullableType(objectType);\n\n            if (reader.TokenType == JsonToken.Null)\n            {\n                if (!isNullable)\n                    throw JsonSerializationException.Create(reader, \"Cannot convert null value to KeyValuePair.\");\n\n                return null;\n            }\n\n            Type t = (isNullable)\n                ? Nullable.GetUnderlyingType(objectType)\n                : objectType;\n\n            IList<Type> genericArguments = t.GetGenericArguments();\n            Type keyType = genericArguments[0];\n            Type valueType = genericArguments[1];\n\n            object key = null;\n            object value = null;\n\n            reader.Read();\n\n            while (reader.TokenType == JsonToken.PropertyName)\n            {\n                string propertyName = reader.Value.ToString();\n                if (string.Equals(propertyName, KeyName, StringComparison.OrdinalIgnoreCase))\n                {\n                    reader.Read();\n                    key = serializer.Deserialize(reader, keyType);\n                }\n                else if (string.Equals(propertyName, ValueName, StringComparison.OrdinalIgnoreCase))\n                {\n                    reader.Read();\n                    value = serializer.Deserialize(reader, valueType);\n                }\n                else\n                {\n                    reader.Skip();\n                }\n\n                reader.Read();\n            }\n\n            return Activator.CreateInstance(t, key, value);\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            Type t = (ReflectionUtils.IsNullableType(objectType))\n                ? Nullable.GetUnderlyingType(objectType)\n                : objectType;\n\n            if (t.IsValueType() && t.IsGenericType())\n                return (t.GetGenericTypeDefinition() == typeof(KeyValuePair<,>));\n\n            return false;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Converters/RegexConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Text.RegularExpressions;\nusing Newtonsoft.Json.Bson;\nusing System.Globalization;\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts a <see cref=\"Regex\"/> to and from JSON and BSON.\n    /// </summary>\n    public class RegexConverter : JsonConverter\n    {\n        private const string PatternName = \"Pattern\";\n        private const string OptionsName = \"Options\";\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            Regex regex = (Regex)value;\n\n            BsonWriter bsonWriter = writer as BsonWriter;\n            if (bsonWriter != null)\n                WriteBson(bsonWriter, regex);\n            else\n                WriteJson(writer, regex, serializer);\n        }\n\n        private bool HasFlag(RegexOptions options, RegexOptions flag)\n        {\n            return ((options & flag) == flag);\n        }\n\n        private void WriteBson(BsonWriter writer, Regex regex)\n        {\n            // Regular expression - The first cstring is the regex pattern, the second\n            // is the regex options string. Options are identified by characters, which \n            // must be stored in alphabetical order. Valid options are 'i' for case \n            // insensitive matching, 'm' for multiline matching, 'x' for verbose mode, \n            // 'l' to make \\w, \\W, etc. locale dependent, 's' for dotall mode \n            // ('.' matches everything), and 'u' to make \\w, \\W, etc. match unicode.\n\n            string options = null;\n\n            if (HasFlag(regex.Options, RegexOptions.IgnoreCase))\n                options += \"i\";\n\n            if (HasFlag(regex.Options, RegexOptions.Multiline))\n                options += \"m\";\n\n            if (HasFlag(regex.Options, RegexOptions.Singleline))\n                options += \"s\";\n\n            options += \"u\";\n\n            if (HasFlag(regex.Options, RegexOptions.ExplicitCapture))\n                options += \"x\";\n\n            writer.WriteRegex(regex.ToString(), options);\n        }\n\n        private void WriteJson(JsonWriter writer, Regex regex, JsonSerializer serializer)\n        {\n            DefaultContractResolver resolver = serializer.ContractResolver as DefaultContractResolver;\n\n            writer.WriteStartObject();\n            writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(PatternName) : PatternName);\n            writer.WriteValue(regex.ToString());\n            writer.WritePropertyName((resolver != null) ? resolver.GetResolvedPropertyName(OptionsName) : OptionsName);\n            serializer.Serialize(writer, regex.Options);\n            writer.WriteEndObject();\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if (reader.TokenType == JsonToken.StartObject)\n                return ReadRegexObject(reader, serializer);\n\n            if (reader.TokenType == JsonToken.String)\n                return ReadRegexString(reader);\n\n            throw JsonSerializationException.Create(reader, \"Unexpected token when reading Regex.\");\n        }\n\n        private object ReadRegexString(JsonReader reader)\n        {\n            string regexText = (string)reader.Value;\n            int patternOptionDelimiterIndex = regexText.LastIndexOf('/');\n\n            string patternText = regexText.Substring(1, patternOptionDelimiterIndex - 1);\n            string optionsText = regexText.Substring(patternOptionDelimiterIndex + 1);\n\n            RegexOptions options = RegexOptions.None;\n            foreach (char c in optionsText)\n            {\n                switch (c)\n                {\n                    case 'i':\n                        options |= RegexOptions.IgnoreCase;\n                        break;\n                    case 'm':\n                        options |= RegexOptions.Multiline;\n                        break;\n                    case 's':\n                        options |= RegexOptions.Singleline;\n                        break;\n                    case 'x':\n                        options |= RegexOptions.ExplicitCapture;\n                        break;\n                }\n            }\n\n            return new Regex(patternText, options);\n        }\n\n        private Regex ReadRegexObject(JsonReader reader, JsonSerializer serializer)\n        {\n            string pattern = null;\n            RegexOptions? options = null;\n\n            while (reader.Read())\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.PropertyName:\n                        string propertyName = reader.Value.ToString();\n\n                        if (!reader.Read())\n                            throw JsonSerializationException.Create(reader, \"Unexpected end when reading Regex.\");\n\n                        if (string.Equals(propertyName, PatternName, StringComparison.OrdinalIgnoreCase))\n                            pattern = (string)reader.Value;\n                        else if (string.Equals(propertyName, OptionsName, StringComparison.OrdinalIgnoreCase))\n                            options = serializer.Deserialize<RegexOptions>(reader);\n                        else\n                            reader.Skip();\n                        break;\n                    case JsonToken.Comment:\n                        break;\n                    case JsonToken.EndObject:\n                        if (pattern == null)\n                            throw JsonSerializationException.Create(reader, \"Error deserializing Regex. No pattern found.\");\n\n                        return new Regex(pattern, options ?? RegexOptions.None);\n                }\n            }\n\n            throw JsonSerializationException.Create(reader, \"Unexpected end when reading Regex.\");\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return (objectType == typeof(Regex));\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Converters/StringEnumConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing Newtonsoft.Json.Utilities;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts an <see cref=\"Enum\"/> to and from its name string value.\n    /// </summary>\n    public class StringEnumConverter : JsonConverter\n    {\n        private static readonly ThreadSafeStore<Type, BidirectionalDictionary<string, string>> EnumMemberNamesPerType = new ThreadSafeStore<Type, BidirectionalDictionary<string, string>>(InitializeEnumType);\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the written enum text should be camel case.\n        /// </summary>\n        /// <value><c>true</c> if the written enum text will be camel case; otherwise, <c>false</c>.</value>\n        public bool CamelCaseText { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether integer values are allowed.\n        /// </summary>\n        /// <value><c>true</c> if integers are allowed; otherwise, <c>false</c>.</value>\n        public bool AllowIntegerValues { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"StringEnumConverter\"/> class.\n        /// </summary>\n        public StringEnumConverter()\n        {\n            AllowIntegerValues = true;\n        }\n\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            if (value == null)\n            {\n                writer.WriteNull();\n                return;\n            }\n\n            Enum e = (Enum)value;\n\n            string enumName = e.ToString(\"G\");\n\n            if (char.IsNumber(enumName[0]) || enumName[0] == '-')\n            {\n                // enum value has no name so write number\n                writer.WriteValue(value);\n            }\n            else\n            {\n                BidirectionalDictionary<string, string> map = EnumMemberNamesPerType.Get(e.GetType());\n\n                string[] names = enumName.Split(',');\n                for (int i = 0; i < names.Length; i++)\n                {\n                    string name = names[i].Trim();\n\n                    string resolvedEnumName;\n                    map.TryGetByFirst(name, out resolvedEnumName);\n                    resolvedEnumName = resolvedEnumName ?? name;\n\n                    if (CamelCaseText)\n                        resolvedEnumName = StringUtils.ToCamelCase(resolvedEnumName);\n\n                    names[i] = resolvedEnumName;\n                }\n\n                string finalName = string.Join(\", \", names);\n\n                writer.WriteValue(finalName);\n            }\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            bool isNullable = ReflectionUtils.IsNullableType(objectType);\n            Type t = isNullable ? Nullable.GetUnderlyingType(objectType) : objectType;\n\n            if (reader.TokenType == JsonToken.Null)\n            {\n                if (!ReflectionUtils.IsNullableType(objectType))\n                    throw JsonSerializationException.Create(reader, \"Cannot convert null value to {0}.\".FormatWith(CultureInfo.InvariantCulture, objectType));\n\n                return null;\n            }\n\n            try\n            {\n                if (reader.TokenType == JsonToken.String)\n                {\n                    string enumText = reader.Value.ToString();\n                    if (enumText == string.Empty && isNullable)\n                        return null;\n\n                    string finalEnumText;\n\n                    BidirectionalDictionary<string, string> map = EnumMemberNamesPerType.Get(t);\n                    if (enumText.IndexOf(',') != -1)\n                    {\n                        string[] names = enumText.Split(',');\n                        for (int i = 0; i < names.Length; i++)\n                        {\n                            string name = names[i].Trim();\n\n                            names[i] = ResolvedEnumName(map, name);\n                        }\n\n                        finalEnumText = string.Join(\", \", names);\n                    }\n                    else\n                    {\n                        finalEnumText = ResolvedEnumName(map, enumText);\n                    }\n\n                    return Enum.Parse(t, finalEnumText, true);\n                }\n\n                if (reader.TokenType == JsonToken.Integer)\n                {\n                    if (!AllowIntegerValues)\n                        throw JsonSerializationException.Create(reader, \"Integer value {0} is not allowed.\".FormatWith(CultureInfo.InvariantCulture, reader.Value));\n\n                    return ConvertUtils.ConvertOrCast(reader.Value, CultureInfo.InvariantCulture, t);\n                }\n            }\n            catch (Exception ex)\n            {\n                throw JsonSerializationException.Create(reader, \"Error converting value {0} to type '{1}'.\".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.FormatValueForPrint(reader.Value), objectType), ex);\n            }\n\n            // we don't actually expect to get here.\n            throw JsonSerializationException.Create(reader, \"Unexpected token {0} when parsing enum.\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n        }\n\n        private static string ResolvedEnumName(BidirectionalDictionary<string, string> map, string enumText)\n        {\n            string resolvedEnumName;\n            map.TryGetBySecond(enumText, out resolvedEnumName);\n            resolvedEnumName = resolvedEnumName ?? enumText;\n            return resolvedEnumName;\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            Type t = (ReflectionUtils.IsNullableType(objectType))\n                ? Nullable.GetUnderlyingType(objectType)\n                : objectType;\n\n            return t.IsEnum();\n        }\n\n        private static BidirectionalDictionary<string, string> InitializeEnumType(Type type)\n        {\n            BidirectionalDictionary<string, string> map = new BidirectionalDictionary<string, string>(\n                StringComparer.OrdinalIgnoreCase,\n                StringComparer.OrdinalIgnoreCase);\n\n            foreach (FieldInfo f in type.GetFields())\n            {\n                string n1 = f.Name;\n                string n2;\n\n#if !NET20\n                n2 = f.GetCustomAttributes(typeof(EnumMemberAttribute), true)\n                    .Cast<EnumMemberAttribute>()\n                    .Select(a => a.Value)\n                    .SingleOrDefault() ?? f.Name;\n#else\n                n2 = f.Name;\n#endif\n\n                string s;\n                if (map.TryGetBySecond(n2, out s))\n                    throw new InvalidOperationException(\"Enum name '{0}' already exists on enum '{1}'.\".FormatWith(CultureInfo.InvariantCulture, n2, type.Name));\n\n                map.Set(n1, n2);\n            }\n\n            return map;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Converters/VersionConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Converters\n{\n    /// <summary>\n    /// Converts a <see cref=\"Version\"/> to and from a string (e.g. \"1.2.3.4\").\n    /// </summary>\n    public class VersionConverter : JsonConverter\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            if (value == null)\n            {\n                writer.WriteNull();\n            }\n            else if (value is Version)\n            {\n                writer.WriteValue(value.ToString());\n            }\n            else\n            {\n                throw new JsonSerializationException(\"Expected Version object value\");\n            }\n        }\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing property value of the JSON that is being converted.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if (reader.TokenType == JsonToken.Null)\n            {\n                return null;\n            }\n            else\n            {\n                if (reader.TokenType == JsonToken.String)\n                {\n                    try\n                    {\n                        Version v = new Version((string)reader.Value);\n                        return v;\n                    }\n                    catch (Exception ex)\n                    {\n                        throw JsonSerializationException.Create(reader, \"Error parsing version string: {0}\".FormatWith(CultureInfo.InvariantCulture, reader.Value), ex);\n                    }\n                }\n                else\n                {\n                    throw JsonSerializationException.Create(reader, \"Unexpected token or value when parsing version. Token: {0}, Value: {1}\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType, reader.Value));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type objectType)\n        {\n            return objectType == typeof(Version);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Converters/XmlNodeConverter.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !PORTABLE40\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Xml;\n#if !(NET20 || PORTABLE40)\nusing System.Xml.Linq;\n#endif\nusing Newtonsoft.Json.Utilities;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Converters\n{\n    #region XmlNodeWrappers\n#if !NETFX_CORE && !PORTABLE && !PORTABLE40\n    internal class XmlDocumentWrapper : XmlNodeWrapper, IXmlDocument\n    {\n        private readonly XmlDocument _document;\n\n        public XmlDocumentWrapper(XmlDocument document)\n            : base(document)\n        {\n            _document = document;\n        }\n\n        public IXmlNode CreateComment(string data)\n        {\n            return new XmlNodeWrapper(_document.CreateComment(data));\n        }\n\n        public IXmlNode CreateTextNode(string text)\n        {\n            return new XmlNodeWrapper(_document.CreateTextNode(text));\n        }\n\n        public IXmlNode CreateCDataSection(string data)\n        {\n            return new XmlNodeWrapper(_document.CreateCDataSection(data));\n        }\n\n        public IXmlNode CreateWhitespace(string text)\n        {\n            return new XmlNodeWrapper(_document.CreateWhitespace(text));\n        }\n\n        public IXmlNode CreateSignificantWhitespace(string text)\n        {\n            return new XmlNodeWrapper(_document.CreateSignificantWhitespace(text));\n        }\n\n        public IXmlNode CreateXmlDeclaration(string version, string encoding, string standalone)\n        {\n            return new XmlDeclarationWrapper(_document.CreateXmlDeclaration(version, encoding, standalone));\n        }\n\n        public IXmlNode CreateXmlDocumentType(string name, string publicId, string systemId, string internalSubset)\n        {\n            return new XmlDocumentTypeWrapper(_document.CreateDocumentType(name, publicId, systemId, null));\n        }\n\n        public IXmlNode CreateProcessingInstruction(string target, string data)\n        {\n            return new XmlNodeWrapper(_document.CreateProcessingInstruction(target, data));\n        }\n\n        public IXmlElement CreateElement(string elementName)\n        {\n            return new XmlElementWrapper(_document.CreateElement(elementName));\n        }\n\n        public IXmlElement CreateElement(string qualifiedName, string namespaceUri)\n        {\n            return new XmlElementWrapper(_document.CreateElement(qualifiedName, namespaceUri));\n        }\n\n        public IXmlNode CreateAttribute(string name, string value)\n        {\n            XmlNodeWrapper attribute = new XmlNodeWrapper(_document.CreateAttribute(name));\n            attribute.Value = value;\n\n            return attribute;\n        }\n\n        public IXmlNode CreateAttribute(string qualifiedName, string namespaceUri, string value)\n        {\n            XmlNodeWrapper attribute = new XmlNodeWrapper(_document.CreateAttribute(qualifiedName, namespaceUri));\n            attribute.Value = value;\n\n            return attribute;\n        }\n\n        public IXmlElement DocumentElement\n        {\n            get\n            {\n                if (_document.DocumentElement == null)\n                    return null;\n\n                return new XmlElementWrapper(_document.DocumentElement);\n            }\n        }\n    }\n\n    internal class XmlElementWrapper : XmlNodeWrapper, IXmlElement\n    {\n        private readonly XmlElement _element;\n\n        public XmlElementWrapper(XmlElement element)\n            : base(element)\n        {\n            _element = element;\n        }\n\n        public void SetAttributeNode(IXmlNode attribute)\n        {\n            XmlNodeWrapper xmlAttributeWrapper = (XmlNodeWrapper)attribute;\n\n            _element.SetAttributeNode((XmlAttribute)xmlAttributeWrapper.WrappedNode);\n        }\n\n        public string GetPrefixOfNamespace(string namespaceUri)\n        {\n            return _element.GetPrefixOfNamespace(namespaceUri);\n        }\n\n        public bool IsEmpty\n        {\n            get { return _element.IsEmpty; }\n        }\n    }\n\n    internal class XmlDeclarationWrapper : XmlNodeWrapper, IXmlDeclaration\n    {\n        private readonly XmlDeclaration _declaration;\n\n        public XmlDeclarationWrapper(XmlDeclaration declaration)\n            : base(declaration)\n        {\n            _declaration = declaration;\n        }\n\n        public string Version\n        {\n            get { return _declaration.Version; }\n        }\n\n        public string Encoding\n        {\n            get { return _declaration.Encoding; }\n            set { _declaration.Encoding = value; }\n        }\n\n        public string Standalone\n        {\n            get { return _declaration.Standalone; }\n            set { _declaration.Standalone = value; }\n        }\n    }\n\n    internal class XmlDocumentTypeWrapper : XmlNodeWrapper, IXmlDocumentType\n    {\n        private readonly XmlDocumentType _documentType;\n\n        public XmlDocumentTypeWrapper(XmlDocumentType documentType)\n            : base(documentType)\n        {\n            _documentType = documentType;\n        }\n\n        public string Name\n        {\n            get { return _documentType.Name; }\n        }\n\n        public string System\n        {\n            get { return _documentType.SystemId; }\n        }\n\n        public string Public\n        {\n            get { return _documentType.PublicId; }\n        }\n\n        public string InternalSubset\n        {\n            get { return _documentType.InternalSubset; }\n        }\n\n        public new string LocalName\n        {\n            get { return \"DOCTYPE\"; }\n        }\n    }\n\n    internal class XmlNodeWrapper : IXmlNode\n    {\n        private readonly XmlNode _node;\n\n        public XmlNodeWrapper(XmlNode node)\n        {\n            _node = node;\n        }\n\n        public object WrappedNode\n        {\n            get { return _node; }\n        }\n\n        public XmlNodeType NodeType\n        {\n            get { return _node.NodeType; }\n        }\n\n        public string LocalName\n        {\n            get { return _node.LocalName; }\n        }\n\n        public IList<IXmlNode> ChildNodes\n        {\n            get { return _node.ChildNodes.Cast<XmlNode>().Select(n => WrapNode(n)).ToList(); }\n        }\n\n        private IXmlNode WrapNode(XmlNode node)\n        {\n            switch (node.NodeType)\n            {\n                case XmlNodeType.Element:\n                    return new XmlElementWrapper((XmlElement)node);\n                case XmlNodeType.XmlDeclaration:\n                    return new XmlDeclarationWrapper((XmlDeclaration)node);\n                case XmlNodeType.DocumentType:\n                    return new XmlDocumentTypeWrapper((XmlDocumentType)node);\n                default:\n                    return new XmlNodeWrapper(node);\n            }\n        }\n\n        public IList<IXmlNode> Attributes\n        {\n            get\n            {\n                if (_node.Attributes == null)\n                    return null;\n\n                return _node.Attributes.Cast<XmlAttribute>().Select(a => WrapNode(a)).ToList();\n            }\n        }\n\n        public IXmlNode ParentNode\n        {\n            get\n            {\n                XmlNode node = (_node is XmlAttribute)\n                    ? ((XmlAttribute)_node).OwnerElement\n                    : _node.ParentNode;\n\n                if (node == null)\n                    return null;\n\n                return WrapNode(node);\n            }\n        }\n\n        public string Value\n        {\n            get { return _node.Value; }\n            set { _node.Value = value; }\n        }\n\n        public IXmlNode AppendChild(IXmlNode newChild)\n        {\n            XmlNodeWrapper xmlNodeWrapper = (XmlNodeWrapper)newChild;\n            _node.AppendChild(xmlNodeWrapper._node);\n\n            return newChild;\n        }\n\n        public string NamespaceUri\n        {\n            get { return _node.NamespaceURI; }\n        }\n    }\n#endif\n    #endregion\n\n    #region Interfaces\n    internal interface IXmlDocument : IXmlNode\n    {\n        IXmlNode CreateComment(string text);\n        IXmlNode CreateTextNode(string text);\n        IXmlNode CreateCDataSection(string data);\n        IXmlNode CreateWhitespace(string text);\n        IXmlNode CreateSignificantWhitespace(string text);\n        IXmlNode CreateXmlDeclaration(string version, string encoding, string standalone);\n        IXmlNode CreateXmlDocumentType(string name, string publicId, string systemId, string internalSubset);\n        IXmlNode CreateProcessingInstruction(string target, string data);\n        IXmlElement CreateElement(string elementName);\n        IXmlElement CreateElement(string qualifiedName, string namespaceUri);\n        IXmlNode CreateAttribute(string name, string value);\n        IXmlNode CreateAttribute(string qualifiedName, string namespaceUri, string value);\n\n        IXmlElement DocumentElement { get; }\n    }\n\n    internal interface IXmlDeclaration : IXmlNode\n    {\n        string Version { get; }\n        string Encoding { get; set; }\n        string Standalone { get; set; }\n    }\n\n    internal interface IXmlDocumentType : IXmlNode\n    {\n        string Name { get; }\n        string System { get; }\n        string Public { get; }\n        string InternalSubset { get; }\n    }\n\n    internal interface IXmlElement : IXmlNode\n    {\n        void SetAttributeNode(IXmlNode attribute);\n        string GetPrefixOfNamespace(string namespaceUri);\n        bool IsEmpty { get; }\n    }\n\n    internal interface IXmlNode\n    {\n        XmlNodeType NodeType { get; }\n        string LocalName { get; }\n        IList<IXmlNode> ChildNodes { get; }\n        IList<IXmlNode> Attributes { get; }\n        IXmlNode ParentNode { get; }\n        string Value { get; set; }\n        IXmlNode AppendChild(IXmlNode newChild);\n        string NamespaceUri { get; }\n        object WrappedNode { get; }\n    }\n    #endregion\n\n    #region XNodeWrappers\n#if !NET20\n    internal class XDeclarationWrapper : XObjectWrapper, IXmlDeclaration\n    {\n        internal XDeclaration Declaration { get; private set; }\n\n        public XDeclarationWrapper(XDeclaration declaration)\n            : base(null)\n        {\n            Declaration = declaration;\n        }\n\n        public override XmlNodeType NodeType\n        {\n            get { return XmlNodeType.XmlDeclaration; }\n        }\n\n        public string Version\n        {\n            get { return Declaration.Version; }\n        }\n\n        public string Encoding\n        {\n            get { return Declaration.Encoding; }\n            set { Declaration.Encoding = value; }\n        }\n\n        public string Standalone\n        {\n            get { return Declaration.Standalone; }\n            set { Declaration.Standalone = value; }\n        }\n    }\n\n    internal class XDocumentTypeWrapper : XObjectWrapper, IXmlDocumentType\n    {\n        private readonly XDocumentType _documentType;\n\n        public XDocumentTypeWrapper(XDocumentType documentType)\n            : base(documentType)\n        {\n            _documentType = documentType;\n        }\n\n        public string Name\n        {\n            get { return _documentType.Name; }\n        }\n\n        public string System\n        {\n            get { return _documentType.SystemId; }\n        }\n\n        public string Public\n        {\n            get { return _documentType.PublicId; }\n        }\n\n        public string InternalSubset\n        {\n            get { return _documentType.InternalSubset; }\n        }\n\n        public new string LocalName\n        {\n            get { return \"DOCTYPE\"; }\n        }\n    }\n\n    internal class XDocumentWrapper : XContainerWrapper, IXmlDocument\n    {\n        private XDocument Document\n        {\n            get { return (XDocument)WrappedNode; }\n        }\n\n        public XDocumentWrapper(XDocument document)\n            : base(document)\n        {\n        }\n\n        public override IList<IXmlNode> ChildNodes\n        {\n            get\n            {\n                IList<IXmlNode> childNodes = base.ChildNodes;\n\n                if (Document.Declaration != null)\n                    childNodes.Insert(0, new XDeclarationWrapper(Document.Declaration));\n\n                return childNodes;\n            }\n        }\n\n        public IXmlNode CreateComment(string text)\n        {\n            return new XObjectWrapper(new XComment(text));\n        }\n\n        public IXmlNode CreateTextNode(string text)\n        {\n            return new XObjectWrapper(new XText(text));\n        }\n\n        public IXmlNode CreateCDataSection(string data)\n        {\n            return new XObjectWrapper(new XCData(data));\n        }\n\n        public IXmlNode CreateWhitespace(string text)\n        {\n            return new XObjectWrapper(new XText(text));\n        }\n\n        public IXmlNode CreateSignificantWhitespace(string text)\n        {\n            return new XObjectWrapper(new XText(text));\n        }\n\n        public IXmlNode CreateXmlDeclaration(string version, string encoding, string standalone)\n        {\n            return new XDeclarationWrapper(new XDeclaration(version, encoding, standalone));\n        }\n\n        public IXmlNode CreateXmlDocumentType(string name, string publicId, string systemId, string internalSubset)\n        {\n            return new XDocumentTypeWrapper(new XDocumentType(name, publicId, systemId, internalSubset));\n        }\n\n        public IXmlNode CreateProcessingInstruction(string target, string data)\n        {\n            return new XProcessingInstructionWrapper(new XProcessingInstruction(target, data));\n        }\n\n        public IXmlElement CreateElement(string elementName)\n        {\n            return new XElementWrapper(new XElement(elementName));\n        }\n\n        public IXmlElement CreateElement(string qualifiedName, string namespaceUri)\n        {\n            string localName = MiscellaneousUtils.GetLocalName(qualifiedName);\n            return new XElementWrapper(new XElement(XName.Get(localName, namespaceUri)));\n        }\n\n        public IXmlNode CreateAttribute(string name, string value)\n        {\n            return new XAttributeWrapper(new XAttribute(name, value));\n        }\n\n        public IXmlNode CreateAttribute(string qualifiedName, string namespaceUri, string value)\n        {\n            string localName = MiscellaneousUtils.GetLocalName(qualifiedName);\n            return new XAttributeWrapper(new XAttribute(XName.Get(localName, namespaceUri), value));\n        }\n\n        public IXmlElement DocumentElement\n        {\n            get\n            {\n                if (Document.Root == null)\n                    return null;\n\n                return new XElementWrapper(Document.Root);\n            }\n        }\n\n        public override IXmlNode AppendChild(IXmlNode newChild)\n        {\n            XDeclarationWrapper declarationWrapper = newChild as XDeclarationWrapper;\n            if (declarationWrapper != null)\n            {\n                Document.Declaration = declarationWrapper.Declaration;\n                return declarationWrapper;\n            }\n            else\n            {\n                return base.AppendChild(newChild);\n            }\n        }\n    }\n\n    internal class XTextWrapper : XObjectWrapper\n    {\n        private XText Text\n        {\n            get { return (XText)WrappedNode; }\n        }\n\n        public XTextWrapper(XText text)\n            : base(text)\n        {\n        }\n\n        public override string Value\n        {\n            get { return Text.Value; }\n            set { Text.Value = value; }\n        }\n\n        public override IXmlNode ParentNode\n        {\n            get\n            {\n                if (Text.Parent == null)\n                    return null;\n\n                return XContainerWrapper.WrapNode(Text.Parent);\n            }\n        }\n    }\n\n    internal class XCommentWrapper : XObjectWrapper\n    {\n        private XComment Text\n        {\n            get { return (XComment)WrappedNode; }\n        }\n\n        public XCommentWrapper(XComment text)\n            : base(text)\n        {\n        }\n\n        public override string Value\n        {\n            get { return Text.Value; }\n            set { Text.Value = value; }\n        }\n\n        public override IXmlNode ParentNode\n        {\n            get\n            {\n                if (Text.Parent == null)\n                    return null;\n\n                return XContainerWrapper.WrapNode(Text.Parent);\n            }\n        }\n    }\n\n    internal class XProcessingInstructionWrapper : XObjectWrapper\n    {\n        private XProcessingInstruction ProcessingInstruction\n        {\n            get { return (XProcessingInstruction)WrappedNode; }\n        }\n\n        public XProcessingInstructionWrapper(XProcessingInstruction processingInstruction)\n            : base(processingInstruction)\n        {\n        }\n\n        public override string LocalName\n        {\n            get { return ProcessingInstruction.Target; }\n        }\n\n        public override string Value\n        {\n            get { return ProcessingInstruction.Data; }\n            set { ProcessingInstruction.Data = value; }\n        }\n    }\n\n    internal class XContainerWrapper : XObjectWrapper\n    {\n        private XContainer Container\n        {\n            get { return (XContainer)WrappedNode; }\n        }\n\n        public XContainerWrapper(XContainer container)\n            : base(container)\n        {\n        }\n\n        public override IList<IXmlNode> ChildNodes\n        {\n            get { return Container.Nodes().Select(n => WrapNode(n)).ToList(); }\n        }\n\n        public override IXmlNode ParentNode\n        {\n            get\n            {\n                if (Container.Parent == null)\n                    return null;\n\n                return WrapNode(Container.Parent);\n            }\n        }\n\n        internal static IXmlNode WrapNode(XObject node)\n        {\n            if (node is XDocument)\n                return new XDocumentWrapper((XDocument)node);\n            else if (node is XElement)\n                return new XElementWrapper((XElement)node);\n            else if (node is XContainer)\n                return new XContainerWrapper((XContainer)node);\n            else if (node is XProcessingInstruction)\n                return new XProcessingInstructionWrapper((XProcessingInstruction)node);\n            else if (node is XText)\n                return new XTextWrapper((XText)node);\n            else if (node is XComment)\n                return new XCommentWrapper((XComment)node);\n            else if (node is XAttribute)\n                return new XAttributeWrapper((XAttribute)node);\n            else if (node is XDocumentType)\n                return new XDocumentTypeWrapper((XDocumentType)node);\n            else\n                return new XObjectWrapper(node);\n        }\n\n        public override IXmlNode AppendChild(IXmlNode newChild)\n        {\n            Container.Add(newChild.WrappedNode);\n            return newChild;\n        }\n    }\n\n    internal class XObjectWrapper : IXmlNode\n    {\n        private readonly XObject _xmlObject;\n\n        public XObjectWrapper(XObject xmlObject)\n        {\n            _xmlObject = xmlObject;\n        }\n\n        public object WrappedNode\n        {\n            get { return _xmlObject; }\n        }\n\n        public virtual XmlNodeType NodeType\n        {\n            get { return _xmlObject.NodeType; }\n        }\n\n        public virtual string LocalName\n        {\n            get { return null; }\n        }\n\n        public virtual IList<IXmlNode> ChildNodes\n        {\n            get { return new List<IXmlNode>(); }\n        }\n\n        public virtual IList<IXmlNode> Attributes\n        {\n            get { return null; }\n        }\n\n        public virtual IXmlNode ParentNode\n        {\n            get { return null; }\n        }\n\n        public virtual string Value\n        {\n            get { return null; }\n            set { throw new InvalidOperationException(); }\n        }\n\n        public virtual IXmlNode AppendChild(IXmlNode newChild)\n        {\n            throw new InvalidOperationException();\n        }\n\n        public virtual string NamespaceUri\n        {\n            get { return null; }\n        }\n    }\n\n    internal class XAttributeWrapper : XObjectWrapper\n    {\n        private XAttribute Attribute\n        {\n            get { return (XAttribute)WrappedNode; }\n        }\n\n        public XAttributeWrapper(XAttribute attribute)\n            : base(attribute)\n        {\n        }\n\n        public override string Value\n        {\n            get { return Attribute.Value; }\n            set { Attribute.Value = value; }\n        }\n\n        public override string LocalName\n        {\n            get { return Attribute.Name.LocalName; }\n        }\n\n        public override string NamespaceUri\n        {\n            get { return Attribute.Name.NamespaceName; }\n        }\n\n        public override IXmlNode ParentNode\n        {\n            get\n            {\n                if (Attribute.Parent == null)\n                    return null;\n\n                return XContainerWrapper.WrapNode(Attribute.Parent);\n            }\n        }\n    }\n\n    internal class XElementWrapper : XContainerWrapper, IXmlElement\n    {\n        private XElement Element\n        {\n            get { return (XElement)WrappedNode; }\n        }\n\n        public XElementWrapper(XElement element)\n            : base(element)\n        {\n        }\n\n        public void SetAttributeNode(IXmlNode attribute)\n        {\n            XObjectWrapper wrapper = (XObjectWrapper)attribute;\n            Element.Add(wrapper.WrappedNode);\n        }\n\n        public override IList<IXmlNode> Attributes\n        {\n            get { return Element.Attributes().Select(a => new XAttributeWrapper(a)).Cast<IXmlNode>().ToList(); }\n        }\n\n        public override string Value\n        {\n            get { return Element.Value; }\n            set { Element.Value = value; }\n        }\n\n        public override string LocalName\n        {\n            get { return Element.Name.LocalName; }\n        }\n\n        public override string NamespaceUri\n        {\n            get { return Element.Name.NamespaceName; }\n        }\n\n        public string GetPrefixOfNamespace(string namespaceUri)\n        {\n            return Element.GetPrefixOfNamespace(namespaceUri);\n        }\n\n        public bool IsEmpty\n        {\n            get { return Element.IsEmpty; }\n        }\n    }\n#endif\n    #endregion\n\n    /// <summary>\n    /// Converts XML to and from JSON.\n    /// </summary>\n    public class XmlNodeConverter : JsonConverter\n    {\n        private const string TextName = \"#text\";\n        private const string CommentName = \"#comment\";\n        private const string CDataName = \"#cdata-section\";\n        private const string WhitespaceName = \"#whitespace\";\n        private const string SignificantWhitespaceName = \"#significant-whitespace\";\n        private const string DeclarationName = \"?xml\";\n        private const string JsonNamespaceUri = \"http://james.newtonking.com/projects/json\";\n\n        /// <summary>\n        /// Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements.\n        /// </summary>\n        /// <value>The name of the deserialize root element.</value>\n        public string DeserializeRootElementName { get; set; }\n\n        /// <summary>\n        /// Gets or sets a flag to indicate whether to write the Json.NET array attribute.\n        /// This attribute helps preserve arrays when converting the written XML back to JSON.\n        /// </summary>\n        /// <value><c>true</c> if the array attibute is written to the XML; otherwise, <c>false</c>.</value>\n        public bool WriteArrayAttribute { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether to write the root JSON object.\n        /// </summary>\n        /// <value><c>true</c> if the JSON root object is omitted; otherwise, <c>false</c>.</value>\n        public bool OmitRootObject { get; set; }\n\n        #region Writing\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <param name=\"value\">The value.</param>\n        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n        {\n            IXmlNode node = WrapXml(value);\n\n            XmlNamespaceManager manager = new XmlNamespaceManager(new NameTable());\n            PushParentNamespaces(node, manager);\n\n            if (!OmitRootObject)\n                writer.WriteStartObject();\n\n            SerializeNode(writer, node, manager, !OmitRootObject);\n\n            if (!OmitRootObject)\n                writer.WriteEndObject();\n        }\n\n        private IXmlNode WrapXml(object value)\n        {\n#if !NET20\n            if (value is XObject)\n                return XContainerWrapper.WrapNode((XObject)value);\n#endif\n#if !(NETFX_CORE || PORTABLE)\n            if (value is XmlNode)\n                return new XmlNodeWrapper((XmlNode)value);\n#endif\n\n            throw new ArgumentException(\"Value must be an XML object.\", \"value\");\n        }\n\n        private void PushParentNamespaces(IXmlNode node, XmlNamespaceManager manager)\n        {\n            List<IXmlNode> parentElements = null;\n\n            IXmlNode parent = node;\n            while ((parent = parent.ParentNode) != null)\n            {\n                if (parent.NodeType == XmlNodeType.Element)\n                {\n                    if (parentElements == null)\n                        parentElements = new List<IXmlNode>();\n\n                    parentElements.Add(parent);\n                }\n            }\n\n            if (parentElements != null)\n            {\n                parentElements.Reverse();\n\n                foreach (IXmlNode parentElement in parentElements)\n                {\n                    manager.PushScope();\n                    foreach (IXmlNode attribute in parentElement.Attributes)\n                    {\n                        if (attribute.NamespaceUri == \"http://www.w3.org/2000/xmlns/\" && attribute.LocalName != \"xmlns\")\n                            manager.AddNamespace(attribute.LocalName, attribute.Value);\n                    }\n                }\n            }\n        }\n\n        private string ResolveFullName(IXmlNode node, XmlNamespaceManager manager)\n        {\n            string prefix = (node.NamespaceUri == null || (node.LocalName == \"xmlns\" && node.NamespaceUri == \"http://www.w3.org/2000/xmlns/\"))\n                ? null\n                : manager.LookupPrefix(node.NamespaceUri);\n\n            if (!string.IsNullOrEmpty(prefix))\n                return prefix + \":\" + node.LocalName;\n            else\n                return node.LocalName;\n        }\n\n        private string GetPropertyName(IXmlNode node, XmlNamespaceManager manager)\n        {\n            switch (node.NodeType)\n            {\n                case XmlNodeType.Attribute:\n                    if (node.NamespaceUri == JsonNamespaceUri)\n                        return \"$\" + node.LocalName;\n                    else\n                        return \"@\" + ResolveFullName(node, manager);\n                case XmlNodeType.CDATA:\n                    return CDataName;\n                case XmlNodeType.Comment:\n                    return CommentName;\n                case XmlNodeType.Element:\n                    return ResolveFullName(node, manager);\n                case XmlNodeType.ProcessingInstruction:\n                    return \"?\" + ResolveFullName(node, manager);\n                case XmlNodeType.DocumentType:\n                    return \"!\" + ResolveFullName(node, manager);\n                case XmlNodeType.XmlDeclaration:\n                    return DeclarationName;\n                case XmlNodeType.SignificantWhitespace:\n                    return SignificantWhitespaceName;\n                case XmlNodeType.Text:\n                    return TextName;\n                case XmlNodeType.Whitespace:\n                    return WhitespaceName;\n                default:\n                    throw new JsonSerializationException(\"Unexpected XmlNodeType when getting node name: \" + node.NodeType);\n            }\n        }\n\n        private bool IsArray(IXmlNode node)\n        {\n            IXmlNode jsonArrayAttribute = (node.Attributes != null)\n                ? node.Attributes.SingleOrDefault(a => a.LocalName == \"Array\" && a.NamespaceUri == JsonNamespaceUri)\n                : null;\n\n            return (jsonArrayAttribute != null && XmlConvert.ToBoolean(jsonArrayAttribute.Value));\n        }\n\n        private void SerializeGroupedNodes(JsonWriter writer, IXmlNode node, XmlNamespaceManager manager, bool writePropertyName)\n        {\n            // group nodes together by name\n            Dictionary<string, List<IXmlNode>> nodesGroupedByName = new Dictionary<string, List<IXmlNode>>();\n\n            for (int i = 0; i < node.ChildNodes.Count; i++)\n            {\n                IXmlNode childNode = node.ChildNodes[i];\n                string nodeName = GetPropertyName(childNode, manager);\n\n                List<IXmlNode> nodes;\n                if (!nodesGroupedByName.TryGetValue(nodeName, out nodes))\n                {\n                    nodes = new List<IXmlNode>();\n                    nodesGroupedByName.Add(nodeName, nodes);\n                }\n\n                nodes.Add(childNode);\n            }\n\n            // loop through grouped nodes. write single name instances as normal,\n            // write multiple names together in an array\n            foreach (KeyValuePair<string, List<IXmlNode>> nodeNameGroup in nodesGroupedByName)\n            {\n                List<IXmlNode> groupedNodes = nodeNameGroup.Value;\n                bool writeArray;\n\n                if (groupedNodes.Count == 1)\n                {\n                    writeArray = IsArray(groupedNodes[0]);\n                }\n                else\n                {\n                    writeArray = true;\n                }\n\n                if (!writeArray)\n                {\n                    SerializeNode(writer, groupedNodes[0], manager, writePropertyName);\n                }\n                else\n                {\n                    string elementNames = nodeNameGroup.Key;\n\n                    if (writePropertyName)\n                        writer.WritePropertyName(elementNames);\n\n                    writer.WriteStartArray();\n\n                    for (int i = 0; i < groupedNodes.Count; i++)\n                    {\n                        SerializeNode(writer, groupedNodes[i], manager, false);\n                    }\n\n                    writer.WriteEndArray();\n                }\n            }\n        }\n\n        private void SerializeNode(JsonWriter writer, IXmlNode node, XmlNamespaceManager manager, bool writePropertyName)\n        {\n            switch (node.NodeType)\n            {\n                case XmlNodeType.Document:\n                case XmlNodeType.DocumentFragment:\n                    SerializeGroupedNodes(writer, node, manager, writePropertyName);\n                    break;\n                case XmlNodeType.Element:\n                    if (IsArray(node) && node.ChildNodes.All(n => n.LocalName == node.LocalName) && node.ChildNodes.Count > 0)\n                    {\n                        SerializeGroupedNodes(writer, node, manager, false);\n                    }\n                    else\n                    {\n                        manager.PushScope();\n\n                        foreach (IXmlNode attribute in node.Attributes)\n                        {\n                            if (attribute.NamespaceUri == \"http://www.w3.org/2000/xmlns/\")\n                            {\n                                string namespacePrefix = (attribute.LocalName != \"xmlns\")\n                                    ? attribute.LocalName\n                                    : string.Empty;\n                                string namespaceUri = attribute.Value;\n\n                                manager.AddNamespace(namespacePrefix, namespaceUri);\n                            }\n                        }\n\n                        if (writePropertyName)\n                            writer.WritePropertyName(GetPropertyName(node, manager));\n\n                        if (!ValueAttributes(node.Attributes).Any() && node.ChildNodes.Count == 1\n                            && node.ChildNodes[0].NodeType == XmlNodeType.Text)\n                        {\n                            // write elements with a single text child as a name value pair\n                            writer.WriteValue(node.ChildNodes[0].Value);\n                        }\n                        else if (node.ChildNodes.Count == 0 && CollectionUtils.IsNullOrEmpty(node.Attributes))\n                        {\n                            IXmlElement element = (IXmlElement)node;\n\n                            // empty element\n                            if (element.IsEmpty)\n                                writer.WriteNull();\n                            else\n                                writer.WriteValue(string.Empty);\n                        }\n                        else\n                        {\n                            writer.WriteStartObject();\n\n                            for (int i = 0; i < node.Attributes.Count; i++)\n                            {\n                                SerializeNode(writer, node.Attributes[i], manager, true);\n                            }\n\n                            SerializeGroupedNodes(writer, node, manager, true);\n\n                            writer.WriteEndObject();\n                        }\n\n                        manager.PopScope();\n                    }\n\n                    break;\n                case XmlNodeType.Comment:\n                    if (writePropertyName)\n                        writer.WriteComment(node.Value);\n                    break;\n                case XmlNodeType.Attribute:\n                case XmlNodeType.Text:\n                case XmlNodeType.CDATA:\n                case XmlNodeType.ProcessingInstruction:\n                case XmlNodeType.Whitespace:\n                case XmlNodeType.SignificantWhitespace:\n                    if (node.NamespaceUri == \"http://www.w3.org/2000/xmlns/\" && node.Value == JsonNamespaceUri)\n                        return;\n\n                    if (node.NamespaceUri == JsonNamespaceUri)\n                    {\n                        if (node.LocalName == \"Array\")\n                            return;\n                    }\n\n                    if (writePropertyName)\n                        writer.WritePropertyName(GetPropertyName(node, manager));\n                    writer.WriteValue(node.Value);\n                    break;\n                case XmlNodeType.XmlDeclaration:\n                    IXmlDeclaration declaration = (IXmlDeclaration)node;\n                    writer.WritePropertyName(GetPropertyName(node, manager));\n                    writer.WriteStartObject();\n\n                    if (!string.IsNullOrEmpty(declaration.Version))\n                    {\n                        writer.WritePropertyName(\"@version\");\n                        writer.WriteValue(declaration.Version);\n                    }\n                    if (!string.IsNullOrEmpty(declaration.Encoding))\n                    {\n                        writer.WritePropertyName(\"@encoding\");\n                        writer.WriteValue(declaration.Encoding);\n                    }\n                    if (!string.IsNullOrEmpty(declaration.Standalone))\n                    {\n                        writer.WritePropertyName(\"@standalone\");\n                        writer.WriteValue(declaration.Standalone);\n                    }\n\n                    writer.WriteEndObject();\n                    break;\n                case XmlNodeType.DocumentType:\n                    IXmlDocumentType documentType = (IXmlDocumentType)node;\n                    writer.WritePropertyName(GetPropertyName(node, manager));\n                    writer.WriteStartObject();\n\n                    if (!string.IsNullOrEmpty(documentType.Name))\n                    {\n                        writer.WritePropertyName(\"@name\");\n                        writer.WriteValue(documentType.Name);\n                    }\n                    if (!string.IsNullOrEmpty(documentType.Public))\n                    {\n                        writer.WritePropertyName(\"@public\");\n                        writer.WriteValue(documentType.Public);\n                    }\n                    if (!string.IsNullOrEmpty(documentType.System))\n                    {\n                        writer.WritePropertyName(\"@system\");\n                        writer.WriteValue(documentType.System);\n                    }\n                    if (!string.IsNullOrEmpty(documentType.InternalSubset))\n                    {\n                        writer.WritePropertyName(\"@internalSubset\");\n                        writer.WriteValue(documentType.InternalSubset);\n                    }\n\n                    writer.WriteEndObject();\n                    break;\n                default:\n                    throw new JsonSerializationException(\"Unexpected XmlNodeType when serializing nodes: \" + node.NodeType);\n            }\n        }\n        #endregion\n\n        #region Reading\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n        {\n            if (reader.TokenType == JsonToken.Null)\n                return null;\n\n            XmlNamespaceManager manager = new XmlNamespaceManager(new NameTable());\n            IXmlDocument document = null;\n            IXmlNode rootNode = null;\n\n#if !NET20\n            if (typeof(XObject).IsAssignableFrom(objectType))\n            {\n                if (objectType != typeof(XDocument) && objectType != typeof(XElement))\n                    throw new JsonSerializationException(\"XmlNodeConverter only supports deserializing XDocument or XElement.\");\n\n                XDocument d = new XDocument();\n                document = new XDocumentWrapper(d);\n                rootNode = document;\n            }\n#endif\n#if !(NETFX_CORE || PORTABLE)\n            if (typeof(XmlNode).IsAssignableFrom(objectType))\n            {\n                if (objectType != typeof(XmlDocument))\n                    throw new JsonSerializationException(\"XmlNodeConverter only supports deserializing XmlDocuments\");\n\n                XmlDocument d = new XmlDocument();\n                document = new XmlDocumentWrapper(d);\n                rootNode = document;\n            }\n#endif\n\n            if (document == null || rootNode == null)\n                throw new JsonSerializationException(\"Unexpected type when converting XML: \" + objectType);\n\n            if (reader.TokenType != JsonToken.StartObject)\n                throw new JsonSerializationException(\"XmlNodeConverter can only convert JSON that begins with an object.\");\n\n            if (!string.IsNullOrEmpty(DeserializeRootElementName))\n            {\n                //rootNode = document.CreateElement(DeserializeRootElementName);\n                //document.AppendChild(rootNode);\n                ReadElement(reader, document, rootNode, DeserializeRootElementName, manager);\n            }\n            else\n            {\n                reader.Read();\n                DeserializeNode(reader, document, manager, rootNode);\n            }\n\n#if !NET20\n            if (objectType == typeof(XElement))\n            {\n                XElement element = (XElement)document.DocumentElement.WrappedNode;\n                element.Remove();\n\n                return element;\n            }\n#endif\n\n            return document.WrappedNode;\n        }\n\n        private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode)\n        {\n            switch (propertyName)\n            {\n                case TextName:\n                    currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString()));\n                    break;\n                case CDataName:\n                    currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString()));\n                    break;\n                case WhitespaceName:\n                    currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString()));\n                    break;\n                case SignificantWhitespaceName:\n                    currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString()));\n                    break;\n                default:\n                    // processing instructions and the xml declaration start with ?\n                    if (!string.IsNullOrEmpty(propertyName) && propertyName[0] == '?')\n                    {\n                        CreateInstruction(reader, document, currentNode, propertyName);\n                    }\n                    else if (string.Equals(propertyName, \"!DOCTYPE\", StringComparison.OrdinalIgnoreCase))\n                    {\n                        CreateDocumentType(reader, document, currentNode);\n                    }\n                    else\n                    {\n                        if (reader.TokenType == JsonToken.StartArray)\n                        {\n                            // handle nested arrays\n                            ReadArrayElements(reader, document, propertyName, currentNode, manager);\n                            return;\n                        }\n\n                        // have to wait until attributes have been parsed before creating element\n                        // attributes may contain namespace info used by the element\n                        ReadElement(reader, document, currentNode, propertyName, manager);\n                    }\n                    break;\n            }\n        }\n\n        private void ReadElement(JsonReader reader, IXmlDocument document, IXmlNode currentNode, string propertyName, XmlNamespaceManager manager)\n        {\n            if (string.IsNullOrEmpty(propertyName))\n                throw new JsonSerializationException(\"XmlNodeConverter cannot convert JSON with an empty property name to XML.\");\n\n            Dictionary<string, string> attributeNameValues = ReadAttributeElements(reader, manager);\n\n            string elementPrefix = MiscellaneousUtils.GetPrefix(propertyName);\n\n            if (propertyName.StartsWith(\"@\"))\n            {\n                string attributeName = propertyName.Substring(1);\n                string attributeValue = reader.Value.ToString();\n\n                string attributePrefix = MiscellaneousUtils.GetPrefix(attributeName);\n\n                IXmlNode attribute = (!string.IsNullOrEmpty(attributePrefix))\n                    ? document.CreateAttribute(attributeName, manager.LookupNamespace(attributePrefix), attributeValue)\n                    : document.CreateAttribute(attributeName, attributeValue);\n\n                ((IXmlElement)currentNode).SetAttributeNode(attribute);\n            }\n            else\n            {\n                IXmlElement element = CreateElement(propertyName, document, elementPrefix, manager);\n\n                currentNode.AppendChild(element);\n\n                // add attributes to newly created element\n                foreach (KeyValuePair<string, string> nameValue in attributeNameValues)\n                {\n                    string attributePrefix = MiscellaneousUtils.GetPrefix(nameValue.Key);\n\n                    IXmlNode attribute = (!string.IsNullOrEmpty(attributePrefix))\n                        ? document.CreateAttribute(nameValue.Key, manager.LookupNamespace(attributePrefix), nameValue.Value)\n                        : document.CreateAttribute(nameValue.Key, nameValue.Value);\n\n                    element.SetAttributeNode(attribute);\n                }\n\n                if (reader.TokenType == JsonToken.String\n                    || reader.TokenType == JsonToken.Integer\n                    || reader.TokenType == JsonToken.Float\n                    || reader.TokenType == JsonToken.Boolean\n                    || reader.TokenType == JsonToken.Date)\n                {\n                    element.AppendChild(document.CreateTextNode(ConvertTokenToXmlValue(reader)));\n                }\n                else if (reader.TokenType == JsonToken.Null)\n                {\n                    // empty element. do nothing\n                }\n                else\n                {\n                    // finished element will have no children to deserialize\n                    if (reader.TokenType != JsonToken.EndObject)\n                    {\n                        manager.PushScope();\n                        DeserializeNode(reader, document, manager, element);\n                        manager.PopScope();\n                    }\n\n                    manager.RemoveNamespace(string.Empty, manager.DefaultNamespace);\n                }\n            }\n        }\n\n        private string ConvertTokenToXmlValue(JsonReader reader)\n        {\n            if (reader.TokenType == JsonToken.String)\n            {\n                return reader.Value.ToString();\n            }\n            else if (reader.TokenType == JsonToken.Integer)\n            {\n                return XmlConvert.ToString(Convert.ToInt64(reader.Value, CultureInfo.InvariantCulture));\n            }\n            else if (reader.TokenType == JsonToken.Float)\n            {\n                if (reader.Value is decimal)\n                    return XmlConvert.ToString((decimal)reader.Value);\n                if (reader.Value is float)\n                    return XmlConvert.ToString((float)reader.Value);\n                \n                return XmlConvert.ToString(Convert.ToDouble(reader.Value, CultureInfo.InvariantCulture));\n            }\n            else if (reader.TokenType == JsonToken.Boolean)\n            {\n                return XmlConvert.ToString(Convert.ToBoolean(reader.Value, CultureInfo.InvariantCulture));\n            }\n            else if (reader.TokenType == JsonToken.Date)\n            {\n#if !NET20\n                if (reader.Value is DateTimeOffset)\n                    return XmlConvert.ToString((DateTimeOffset)reader.Value);\n#endif\n\n                DateTime d = Convert.ToDateTime(reader.Value, CultureInfo.InvariantCulture);\n#if !(NETFX_CORE || PORTABLE)\n                return XmlConvert.ToString(d, DateTimeUtils.ToSerializationMode(d.Kind));\n#else\n                return XmlConvert.ToString(d);\n#endif\n            }\n            else if (reader.TokenType == JsonToken.Null)\n            {\n                return null;\n            }\n            else\n            {\n                throw JsonSerializationException.Create(reader, \"Cannot get an XML string value from token type '{0}'.\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n            }\n        }\n\n        private void ReadArrayElements(JsonReader reader, IXmlDocument document, string propertyName, IXmlNode currentNode, XmlNamespaceManager manager)\n        {\n            string elementPrefix = MiscellaneousUtils.GetPrefix(propertyName);\n\n            IXmlElement nestedArrayElement = CreateElement(propertyName, document, elementPrefix, manager);\n\n            currentNode.AppendChild(nestedArrayElement);\n\n            int count = 0;\n            while (reader.Read() && reader.TokenType != JsonToken.EndArray)\n            {\n                DeserializeValue(reader, document, manager, propertyName, nestedArrayElement);\n                count++;\n            }\n\n            if (WriteArrayAttribute)\n            {\n                AddJsonArrayAttribute(nestedArrayElement, document);\n            }\n\n            if (count == 1 && WriteArrayAttribute)\n            {\n                IXmlElement arrayElement = nestedArrayElement.ChildNodes.OfType<IXmlElement>().Single(n => n.LocalName == propertyName);\n                AddJsonArrayAttribute(arrayElement, document);\n            }\n        }\n\n        private void AddJsonArrayAttribute(IXmlElement element, IXmlDocument document)\n        {\n            element.SetAttributeNode(document.CreateAttribute(\"json:Array\", JsonNamespaceUri, \"true\"));\n\n#if !NET20\n            // linq to xml doesn't automatically include prefixes via the namespace manager\n            if (element is XElementWrapper)\n            {\n                if (element.GetPrefixOfNamespace(JsonNamespaceUri) == null)\n                {\n                    element.SetAttributeNode(document.CreateAttribute(\"xmlns:json\", \"http://www.w3.org/2000/xmlns/\", JsonNamespaceUri));\n                }\n            }\n#endif\n        }\n\n        private Dictionary<string, string> ReadAttributeElements(JsonReader reader, XmlNamespaceManager manager)\n        {\n            Dictionary<string, string> attributeNameValues = new Dictionary<string, string>();\n            bool finishedAttributes = false;\n            bool finishedElement = false;\n\n            // a string token means the element only has a single text child\n            if (reader.TokenType != JsonToken.String\n                && reader.TokenType != JsonToken.Null\n                && reader.TokenType != JsonToken.Boolean\n                && reader.TokenType != JsonToken.Integer\n                && reader.TokenType != JsonToken.Float\n                && reader.TokenType != JsonToken.Date\n                && reader.TokenType != JsonToken.StartConstructor)\n            {\n                // read properties until first non-attribute is encountered\n                while (!finishedAttributes && !finishedElement && reader.Read())\n                {\n                    switch (reader.TokenType)\n                    {\n                        case JsonToken.PropertyName:\n                            string attributeName = reader.Value.ToString();\n\n                            if (!string.IsNullOrEmpty(attributeName))\n                            {\n                                char firstChar = attributeName[0];\n                                string attributeValue;\n\n                                switch (firstChar)\n                                {\n                                    case '@':\n                                        attributeName = attributeName.Substring(1);\n                                        reader.Read();\n                                        attributeValue = ConvertTokenToXmlValue(reader);\n                                        attributeNameValues.Add(attributeName, attributeValue);\n\n                                        string namespacePrefix;\n                                        if (IsNamespaceAttribute(attributeName, out namespacePrefix))\n                                        {\n                                            manager.AddNamespace(namespacePrefix, attributeValue);\n                                        }\n                                        break;\n                                    case '$':\n                                        attributeName = attributeName.Substring(1);\n                                        reader.Read();\n                                        attributeValue = reader.Value.ToString();\n\n                                        // check that JsonNamespaceUri is in scope\n                                        // if it isn't then add it to document and namespace manager\n                                        string jsonPrefix = manager.LookupPrefix(JsonNamespaceUri);\n                                        if (jsonPrefix == null)\n                                        {\n                                            // ensure that the prefix used is free\n                                            int? i = null;\n                                            while (manager.LookupNamespace(\"json\" + i) != null)\n                                            {\n                                                i = i.GetValueOrDefault() + 1;\n                                            }\n                                            jsonPrefix = \"json\" + i;\n\n                                            attributeNameValues.Add(\"xmlns:\" + jsonPrefix, JsonNamespaceUri);\n                                            manager.AddNamespace(jsonPrefix, JsonNamespaceUri);\n                                        }\n\n                                        attributeNameValues.Add(jsonPrefix + \":\" + attributeName, attributeValue);\n                                        break;\n                                    default:\n                                        finishedAttributes = true;\n                                        break;\n                                }\n                            }\n                            else\n                            {\n                               \n                                finishedAttributes = true;\n                            }\n\n                            break;\n                        case JsonToken.EndObject:\n                            finishedElement = true;\n                            break;\n                        default:\n                            throw new JsonSerializationException(\"Unexpected JsonToken: \" + reader.TokenType);\n                    }\n                }\n            }\n\n            return attributeNameValues;\n        }\n\n        private void CreateInstruction(JsonReader reader, IXmlDocument document, IXmlNode currentNode, string propertyName)\n        {\n            if (propertyName == DeclarationName)\n            {\n                string version = null;\n                string encoding = null;\n                string standalone = null;\n                while (reader.Read() && reader.TokenType != JsonToken.EndObject)\n                {\n                    switch (reader.Value.ToString())\n                    {\n                        case \"@version\":\n                            reader.Read();\n                            version = reader.Value.ToString();\n                            break;\n                        case \"@encoding\":\n                            reader.Read();\n                            encoding = reader.Value.ToString();\n                            break;\n                        case \"@standalone\":\n                            reader.Read();\n                            standalone = reader.Value.ToString();\n                            break;\n                        default:\n                            throw new JsonSerializationException(\"Unexpected property name encountered while deserializing XmlDeclaration: \" + reader.Value);\n                    }\n                }\n\n                IXmlNode declaration = document.CreateXmlDeclaration(version, encoding, standalone);\n                currentNode.AppendChild(declaration);\n            }\n            else\n            {\n                IXmlNode instruction = document.CreateProcessingInstruction(propertyName.Substring(1), reader.Value.ToString());\n                currentNode.AppendChild(instruction);\n            }\n        }\n\n        private void CreateDocumentType(JsonReader reader, IXmlDocument document, IXmlNode currentNode)\n        {\n            string name = null;\n            string publicId = null;\n            string systemId = null;\n            string internalSubset = null;\n            while (reader.Read() && reader.TokenType != JsonToken.EndObject)\n            {\n                switch (reader.Value.ToString())\n                {\n                    case \"@name\":\n                        reader.Read();\n                        name = reader.Value.ToString();\n                        break;\n                    case \"@public\":\n                        reader.Read();\n                        publicId = reader.Value.ToString();\n                        break;\n                    case \"@system\":\n                        reader.Read();\n                        systemId = reader.Value.ToString();\n                        break;\n                    case \"@internalSubset\":\n                        reader.Read();\n                        internalSubset = reader.Value.ToString();\n                        break;\n                    default:\n                        throw new JsonSerializationException(\"Unexpected property name encountered while deserializing XmlDeclaration: \" + reader.Value);\n                }\n            }\n\n            IXmlNode documentType = document.CreateXmlDocumentType(name, publicId, systemId, internalSubset);\n            currentNode.AppendChild(documentType);\n        }\n\n        private IXmlElement CreateElement(string elementName, IXmlDocument document, string elementPrefix, XmlNamespaceManager manager)\n        {\n            string ns = string.IsNullOrEmpty(elementPrefix) ? manager.DefaultNamespace : manager.LookupNamespace(elementPrefix);\n\n            IXmlElement element = (!string.IsNullOrEmpty(ns)) ? document.CreateElement(elementName, ns) : document.CreateElement(elementName);\n\n            return element;\n        }\n\n        private void DeserializeNode(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, IXmlNode currentNode)\n        {\n            do\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.PropertyName:\n                        if (currentNode.NodeType == XmlNodeType.Document && document.DocumentElement != null)\n                            throw new JsonSerializationException(\"JSON root object has multiple properties. The root object must have a single property in order to create a valid XML document. Consider specifing a DeserializeRootElementName.\");\n\n                        string propertyName = reader.Value.ToString();\n                        reader.Read();\n\n                        if (reader.TokenType == JsonToken.StartArray)\n                        {\n                            int count = 0;\n                            while (reader.Read() && reader.TokenType != JsonToken.EndArray)\n                            {\n                                DeserializeValue(reader, document, manager, propertyName, currentNode);\n                                count++;\n                            }\n\n                            if (count == 1 && WriteArrayAttribute)\n                            {\n                                IXmlElement arrayElement = currentNode.ChildNodes.OfType<IXmlElement>().Single(n => n.LocalName == propertyName);\n                                AddJsonArrayAttribute(arrayElement, document);\n                            }\n                        }\n                        else\n                        {\n                            DeserializeValue(reader, document, manager, propertyName, currentNode);\n                        }\n                        break;\n                    case JsonToken.StartConstructor:\n                        string constructorName = reader.Value.ToString();\n\n                        while (reader.Read() && reader.TokenType != JsonToken.EndConstructor)\n                        {\n                            DeserializeValue(reader, document, manager, constructorName, currentNode);\n                        }\n                        break;\n                    case JsonToken.Comment:\n                        currentNode.AppendChild(document.CreateComment((string)reader.Value));\n                        break;\n                    case JsonToken.EndObject:\n                    case JsonToken.EndArray:\n                        return;\n                    default:\n                        throw new JsonSerializationException(\"Unexpected JsonToken when deserializing node: \" + reader.TokenType);\n                }\n            } while (reader.TokenType == JsonToken.PropertyName || reader.Read());\n            // don't read if current token is a property. token was already read when parsing element attributes\n        }\n\n        /// <summary>\n        /// Checks if the attributeName is a namespace attribute.\n        /// </summary>\n        /// <param name=\"attributeName\">Attribute name to test.</param>\n        /// <param name=\"prefix\">The attribute name prefix if it has one, otherwise an empty string.</param>\n        /// <returns>True if attribute name is for a namespace attribute, otherwise false.</returns>\n        private bool IsNamespaceAttribute(string attributeName, out string prefix)\n        {\n            if (attributeName.StartsWith(\"xmlns\", StringComparison.Ordinal))\n            {\n                if (attributeName.Length == 5)\n                {\n                    prefix = string.Empty;\n                    return true;\n                }\n                else if (attributeName[5] == ':')\n                {\n                    prefix = attributeName.Substring(6, attributeName.Length - 6);\n                    return true;\n                }\n            }\n            prefix = null;\n            return false;\n        }\n\n        private IEnumerable<IXmlNode> ValueAttributes(IEnumerable<IXmlNode> c)\n        {\n            return c.Where(a => a.NamespaceUri != JsonNamespaceUri);\n        }\n        #endregion\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified value type.\n        /// </summary>\n        /// <param name=\"valueType\">Type of the value.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified value type; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool CanConvert(Type valueType)\n        {\n#if !NET20\n            if (typeof(XObject).IsAssignableFrom(valueType))\n                return true;\n#endif\n#if !(NETFX_CORE || PORTABLE)\n            if (typeof(XmlNode).IsAssignableFrom(valueType))\n                return true;\n#endif\n\n            return false;\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/DateFormatHandling.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies how dates are formatted when writing JSON text.\n    /// </summary>\n    public enum DateFormatHandling\n    {\n        /// <summary>\n        /// Dates are written in the ISO 8601 format, e.g. \"2012-03-21T05:40Z\".\n        /// </summary>\n        IsoDateFormat,\n\n        /// <summary>\n        /// Dates are written in the Microsoft JSON format, e.g. \"\\/Date(1198908717056)\\/\".\n        /// </summary>\n        MicrosoftDateFormat\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/DateParseHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies how date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed when reading JSON text.\n    /// </summary>\n    public enum DateParseHandling\n    {\n        /// <summary>\n        /// Date formatted strings are not parsed to a date type and are read as strings.\n        /// </summary>\n        None,\n\n        /// <summary>\n        /// Date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed to <see cref=\"DateTime\"/>.\n        /// </summary>\n        DateTime,\n#if !NET20\n        /// <summary>\n        /// Date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed to <see cref=\"DateTimeOffset\"/>.\n        /// </summary>\n        DateTimeOffset\n#endif\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/DateTimeZoneHandling.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies how to treat the time value when converting between string and <see cref=\"DateTime\"/>.\n    /// </summary>\n    public enum DateTimeZoneHandling\n    {\n        /// <summary>\n        /// Treat as local time. If the <see cref=\"DateTime\"/> object represents a Coordinated Universal Time (UTC), it is converted to the local time.\n        /// </summary>\n        Local,\n\n        /// <summary>\n        /// Treat as a UTC. If the <see cref=\"DateTime\"/> object represents a local time, it is converted to a UTC.\n        /// </summary>\n        Utc,\n\n        /// <summary>\n        /// Treat as a local time if a <see cref=\"DateTime\"/> is being converted to a string.\n        /// If a string is being converted to <see cref=\"DateTime\"/>, convert to a local time if a time zone is specified.\n        /// </summary>\n        Unspecified,\n\n        /// <summary>\n        /// Time zone information should be preserved when converting.\n        /// </summary>\n        RoundtripKind\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/DefaultValueHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.ComponentModel;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies default value handling options for the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    /// <example>\n    ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\SerializationTests.cs\" region=\"ReducingSerializedJsonSizeDefaultValueHandlingObject\" title=\"DefaultValueHandling Class\" />\n    ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\SerializationTests.cs\" region=\"ReducingSerializedJsonSizeDefaultValueHandlingExample\" title=\"DefaultValueHandling Ignore Example\" />\n    /// </example>\n    [Flags]\n    public enum DefaultValueHandling\n    {\n        /// <summary>\n        /// Include members where the member value is the same as the member's default value when serializing objects.\n        /// Included members are written to JSON. Has no effect when deserializing.\n        /// </summary>\n        Include = 0,\n\n        /// <summary>\n        /// Ignore members where the member value is the same as the member's default value when serializing objects\n        /// so that is is not written to JSON.\n        /// This option will ignore all default values (e.g. <c>null</c> for objects and nullable types; <c>0</c> for integers,\n        /// decimals and floating point numbers; and <c>false</c> for booleans). The default value ignored can be changed by\n        /// placing the <see cref=\"DefaultValueAttribute\"/> on the property.\n        /// </summary>\n        Ignore = 1,\n\n        /// <summary>\n        /// Members with a default value but no JSON will be set to their default value when deserializing.\n        /// </summary>\n        Populate = 2,\n\n        /// <summary>\n        /// Ignore members where the member value is the same as the member's default value when serializing objects\n        /// and sets members to their default value when deserializing.\n        /// </summary>\n        IgnoreAndPopulate = Ignore | Populate\n    }\n}\n"
  },
  {
    "path": "Newtonsoft.Json/FloatFormatHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies float format handling options when writing special floating point numbers, e.g. <see cref=\"F:System.Double.NaN\"/>,\n    /// <see cref=\"F:System.Double.PositiveInfinity\"/> and <see cref=\"F:System.Double.NegativeInfinity\"/> with <see cref=\"JsonWriter\"/>.\n    /// </summary>\n    public enum FloatFormatHandling\n    {\n        /// <summary>\n        /// Write special floating point values as strings in JSON, e.g. \"NaN\", \"Infinity\", \"-Infinity\".\n        /// </summary>\n        String,\n\n        /// <summary>\n        /// Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity.\n        /// Note that this will produce non-valid JSON.\n        /// </summary>\n        Symbol,\n\n        /// <summary>\n        /// Write special floating point values as the property's default value in JSON, e.g. 0.0 for a <see cref=\"System.Double\"/> property, null for a <see cref=\"System.Nullable{Double}\"/> property.\n        /// </summary>\n        DefaultValue\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/FloatParseHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text.\n    /// </summary>\n    public enum FloatParseHandling\n    {\n        /// <summary>\n        /// Floating point numbers are parsed to <see cref=\"Double\"/>.\n        /// </summary>\n        Double,\n\n        /// <summary>\n        /// Floating point numbers are parsed to <see cref=\"Decimal\"/>.\n        /// </summary>\n        Decimal\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/FormatterAssemblyStyle.cs",
    "content": "﻿\n#if PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE\n\nnamespace System.Runtime.Serialization.Formatters\n{\n    /// <summary>\n    /// Indicates the method that will be used during deserialization for locating and loading assemblies.\n    /// </summary>\n    public enum FormatterAssemblyStyle\n    {\n        /// <summary>\n        /// In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method is used to load the assembly.\n        /// </summary>\n        Simple,\n\n        /// <summary>\n        /// In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the Assembly class is used to load the assembly.\n        /// </summary>\n        Full\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Formatting.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies formatting options for the <see cref=\"JsonTextWriter\"/>.\n    /// </summary>\n    public enum Formatting\n    {\n        /// <summary>\n        /// No special formatting is applied. This is the default.\n        /// </summary>\n        None,\n\n        /// <summary>\n        /// Causes child objects to be indented according to the <see cref=\"JsonTextWriter.Indentation\"/> and <see cref=\"JsonTextWriter.IndentChar\"/> settings.\n        /// </summary>\n        Indented\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/IJsonLineInfo.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Provides an interface to enable a class to return line and position information.\n    /// </summary>\n    public interface IJsonLineInfo\n    {\n        /// <summary>\n        /// Gets a value indicating whether the class can return line information.\n        /// </summary>\n        /// <returns>\n        /// \t<c>true</c> if LineNumber and LinePosition can be provided; otherwise, <c>false</c>.\n        /// </returns>\n        bool HasLineInfo();\n\n        /// <summary>\n        /// Gets the current line number.\n        /// </summary>\n        /// <value>The current line number or 0 if no line information is available (for example, HasLineInfo returns false).</value>\n        int LineNumber { get; }\n\n        /// <summary>\n        /// Gets the current line position.\n        /// </summary>\n        /// <value>The current line position or 0 if no line information is available (for example, HasLineInfo returns false).</value>\n        int LinePosition { get; }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonArrayAttribute.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Instructs the <see cref=\"JsonSerializer\"/> how to serialize the collection.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]\n    public sealed class JsonArrayAttribute : JsonContainerAttribute\n    {\n        private bool _allowNullItems;\n\n        /// <summary>\n        /// Gets or sets a value indicating whether null items are allowed in the collection.\n        /// </summary>\n        /// <value><c>true</c> if null items are allowed in the collection; otherwise, <c>false</c>.</value>\n        public bool AllowNullItems\n        {\n            get { return _allowNullItems; }\n            set { _allowNullItems = value; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonArrayAttribute\"/> class.\n        /// </summary>\n        public JsonArrayAttribute()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonObjectAttribute\"/> class with a flag indicating whether the array can contain null items\n        /// </summary>\n        /// <param name=\"allowNullItems\">A flag indicating whether the array can contain null items.</param>\n        public JsonArrayAttribute(bool allowNullItems)\n        {\n            _allowNullItems = allowNullItems;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonArrayAttribute\"/> class with the specified container Id.\n        /// </summary>\n        /// <param name=\"id\">The container Id.</param>\n        public JsonArrayAttribute(string id)\n            : base(id)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonConstructorAttribute.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Instructs the <see cref=\"JsonSerializer\"/> to use the specified constructor when deserializing that object.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false)]\n    public sealed class JsonConstructorAttribute : Attribute\n    {\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonContainerAttribute.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Instructs the <see cref=\"JsonSerializer\"/> how to serialize the object.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]\n    public abstract class JsonContainerAttribute : Attribute\n    {\n        /// <summary>\n        /// Gets or sets the id.\n        /// </summary>\n        /// <value>The id.</value>\n        public string Id { get; set; }\n\n        /// <summary>\n        /// Gets or sets the title.\n        /// </summary>\n        /// <value>The title.</value>\n        public string Title { get; set; }\n\n        /// <summary>\n        /// Gets or sets the description.\n        /// </summary>\n        /// <value>The description.</value>\n        public string Description { get; set; }\n\n        /// <summary>\n        /// Gets the collection's items converter.\n        /// </summary>\n        /// <value>The collection's items converter.</value>\n        public Type ItemConverterType { get; set; }\n\n        // yuck. can't set nullable properties on an attribute in C#\n        // have to use this approach to get an unset default state\n        internal bool? _isReference;\n        internal bool? _itemIsReference;\n        internal ReferenceLoopHandling? _itemReferenceLoopHandling;\n        internal TypeNameHandling? _itemTypeNameHandling;\n\n        /// <summary>\n        /// Gets or sets a value that indicates whether to preserve object references.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> to keep object reference; otherwise, <c>false</c>. The default is <c>false</c>.\n        /// </value>\n        public bool IsReference\n        {\n            get { return _isReference ?? default(bool); }\n            set { _isReference = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets a value that indicates whether to preserve collection's items references.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> to keep collection's items object references; otherwise, <c>false</c>. The default is <c>false</c>.\n        /// </value>\n        public bool ItemIsReference\n        {\n            get { return _itemIsReference ?? default(bool); }\n            set { _itemIsReference = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the reference loop handling used when serializing the collection's items.\n        /// </summary>\n        /// <value>The reference loop handling.</value>\n        public ReferenceLoopHandling ItemReferenceLoopHandling\n        {\n            get { return _itemReferenceLoopHandling ?? default(ReferenceLoopHandling); }\n            set { _itemReferenceLoopHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the type name handling used when serializing the collection's items.\n        /// </summary>\n        /// <value>The type name handling.</value>\n        public TypeNameHandling ItemTypeNameHandling\n        {\n            get { return _itemTypeNameHandling ?? default(TypeNameHandling); }\n            set { _itemTypeNameHandling = value; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonContainerAttribute\"/> class.\n        /// </summary>\n        protected JsonContainerAttribute()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonContainerAttribute\"/> class with the specified container Id.\n        /// </summary>\n        /// <param name=\"id\">The container Id.</param>\n        protected JsonContainerAttribute(string id)\n        {\n            Id = id;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonConvert.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.IO;\nusing System.Globalization;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\nusing System.Numerics;\n#endif\n#if !(NET20 || NET35 || PORTABLE40)\nusing System.Threading.Tasks;\n#endif\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Utilities;\nusing System.Xml;\nusing Newtonsoft.Json.Converters;\nusing Newtonsoft.Json.Serialization;\nusing System.Text;\n#if !(NET20 || PORTABLE40)\nusing System.Xml.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Provides methods for converting between common language runtime types and JSON types.\n    /// </summary>\n    /// <example>\n    ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\SerializationTests.cs\" region=\"SerializeObject\" title=\"Serializing and Deserializing JSON with JsonConvert\" />\n    /// </example>\n    public static class JsonConvert\n    {\n        /// <summary>\n        /// Gets or sets a function that creates default <see cref=\"JsonSerializerSettings\"/>.\n        /// Default settings are automatically used by serialization methods on <see cref=\"JsonConvert\"/>,\n        /// and <see cref=\"JToken.ToObject{T}()\"/> and <see cref=\"JToken.FromObject(object)\"/> on <see cref=\"JToken\"/>.\n        /// To serialize without using any default settings create a <see cref=\"JsonSerializer\"/> with\n        /// <see cref=\"JsonSerializer.Create()\"/>.\n        /// </summary>\n        public static Func<JsonSerializerSettings> DefaultSettings { get; set; }\n\n        /// <summary>\n        /// Represents JavaScript's boolean value true as a string. This field is read-only.\n        /// </summary>\n        public static readonly string True = \"true\";\n\n        /// <summary>\n        /// Represents JavaScript's boolean value false as a string. This field is read-only.\n        /// </summary>\n        public static readonly string False = \"false\";\n\n        /// <summary>\n        /// Represents JavaScript's null as a string. This field is read-only.\n        /// </summary>\n        public static readonly string Null = \"null\";\n\n        /// <summary>\n        /// Represents JavaScript's undefined as a string. This field is read-only.\n        /// </summary>\n        public static readonly string Undefined = \"undefined\";\n\n        /// <summary>\n        /// Represents JavaScript's positive infinity as a string. This field is read-only.\n        /// </summary>\n        public static readonly string PositiveInfinity = \"Infinity\";\n\n        /// <summary>\n        /// Represents JavaScript's negative infinity as a string. This field is read-only.\n        /// </summary>\n        public static readonly string NegativeInfinity = \"-Infinity\";\n\n        /// <summary>\n        /// Represents JavaScript's NaN as a string. This field is read-only.\n        /// </summary>\n        public static readonly string NaN = \"NaN\";\n\n        /// <summary>\n        /// Converts the <see cref=\"DateTime\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"DateTime\"/>.</returns>\n        public static string ToString(DateTime value)\n        {\n            return ToString(value, DateFormatHandling.IsoDateFormat, DateTimeZoneHandling.RoundtripKind);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"DateTime\"/> to its JSON string representation using the <see cref=\"DateFormatHandling\"/> specified.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <param name=\"format\">The format the date will be converted to.</param>\n        /// <param name=\"timeZoneHandling\">The time zone handling when the date is converted to a string.</param>\n        /// <returns>A JSON string representation of the <see cref=\"DateTime\"/>.</returns>\n        public static string ToString(DateTime value, DateFormatHandling format, DateTimeZoneHandling timeZoneHandling)\n        {\n            DateTime updatedDateTime = DateTimeUtils.EnsureDateTime(value, timeZoneHandling);\n\n            using (StringWriter writer = StringUtils.CreateStringWriter(64))\n            {\n                writer.Write('\"');\n                DateTimeUtils.WriteDateTimeString(writer, updatedDateTime, format, null, CultureInfo.InvariantCulture);\n                writer.Write('\"');\n                return writer.ToString();\n            }\n        }\n\n#if !NET20\n        /// <summary>\n        /// Converts the <see cref=\"DateTimeOffset\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"DateTimeOffset\"/>.</returns>\n        public static string ToString(DateTimeOffset value)\n        {\n            return ToString(value, DateFormatHandling.IsoDateFormat);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"DateTimeOffset\"/> to its JSON string representation using the <see cref=\"DateFormatHandling\"/> specified.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <param name=\"format\">The format the date will be converted to.</param>\n        /// <returns>A JSON string representation of the <see cref=\"DateTimeOffset\"/>.</returns>\n        public static string ToString(DateTimeOffset value, DateFormatHandling format)\n        {\n            using (StringWriter writer = StringUtils.CreateStringWriter(64))\n            {\n                writer.Write('\"');\n                DateTimeUtils.WriteDateTimeOffsetString(writer, value, format, null, CultureInfo.InvariantCulture);\n                writer.Write('\"');\n                return writer.ToString();\n            }\n        }\n#endif\n\n        /// <summary>\n        /// Converts the <see cref=\"Boolean\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Boolean\"/>.</returns>\n        public static string ToString(bool value)\n        {\n            return (value) ? True : False;\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Char\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Char\"/>.</returns>\n        public static string ToString(char value)\n        {\n            return ToString(char.ToString(value));\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Enum\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Enum\"/>.</returns>\n        public static string ToString(Enum value)\n        {\n            return value.ToString(\"D\");\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Int32\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Int32\"/>.</returns>\n        public static string ToString(int value)\n        {\n            return value.ToString(null, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Int16\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Int16\"/>.</returns>\n        public static string ToString(short value)\n        {\n            return value.ToString(null, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"UInt16\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"UInt16\"/>.</returns>\n        [CLSCompliant(false)]\n        public static string ToString(ushort value)\n        {\n            return value.ToString(null, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"UInt32\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"UInt32\"/>.</returns>\n        [CLSCompliant(false)]\n        public static string ToString(uint value)\n        {\n            return value.ToString(null, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Int64\"/>  to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Int64\"/>.</returns>\n        public static string ToString(long value)\n        {\n            return value.ToString(null, CultureInfo.InvariantCulture);\n        }\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n        private static string ToStringInternal(BigInteger value)\n        {\n            return value.ToString(null, CultureInfo.InvariantCulture);\n        }\n#endif\n\n        /// <summary>\n        /// Converts the <see cref=\"UInt64\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"UInt64\"/>.</returns>\n        [CLSCompliant(false)]\n        public static string ToString(ulong value)\n        {\n            return value.ToString(null, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Single\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Single\"/>.</returns>\n        public static string ToString(float value)\n        {\n            return EnsureDecimalPlace(value, value.ToString(\"R\", CultureInfo.InvariantCulture));\n        }\n\n        internal static string ToString(float value, FloatFormatHandling floatFormatHandling, char quoteChar, bool nullable)\n        {\n            return EnsureFloatFormat(value, EnsureDecimalPlace(value, value.ToString(\"R\", CultureInfo.InvariantCulture)), floatFormatHandling, quoteChar, nullable);\n        }\n\n        private static string EnsureFloatFormat(double value, string text, FloatFormatHandling floatFormatHandling, char quoteChar, bool nullable)\n        {\n            if (floatFormatHandling == FloatFormatHandling.Symbol || !(double.IsInfinity(value) || double.IsNaN(value)))\n                return text;\n\n            if (floatFormatHandling == FloatFormatHandling.DefaultValue)\n                return (!nullable) ? \"0.0\" : Null;\n\n            return quoteChar + text + quoteChar;\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Double\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Double\"/>.</returns>\n        public static string ToString(double value)\n        {\n            return EnsureDecimalPlace(value, value.ToString(\"R\", CultureInfo.InvariantCulture));\n        }\n\n        internal static string ToString(double value, FloatFormatHandling floatFormatHandling, char quoteChar, bool nullable)\n        {\n            return EnsureFloatFormat(value, EnsureDecimalPlace(value, value.ToString(\"R\", CultureInfo.InvariantCulture)), floatFormatHandling, quoteChar, nullable);\n        }\n\n        private static string EnsureDecimalPlace(double value, string text)\n        {\n            if (double.IsNaN(value) || double.IsInfinity(value) || text.IndexOf('.') != -1 || text.IndexOf('E') != -1 || text.IndexOf('e') != -1)\n                return text;\n\n            return text + \".0\";\n        }\n\n        private static string EnsureDecimalPlace(string text)\n        {\n            if (text.IndexOf('.') != -1)\n                return text;\n\n            return text + \".0\";\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Byte\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Byte\"/>.</returns>\n        public static string ToString(byte value)\n        {\n            return value.ToString(null, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"SByte\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"SByte\"/>.</returns>\n        [CLSCompliant(false)]\n        public static string ToString(sbyte value)\n        {\n            return value.ToString(null, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Decimal\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"SByte\"/>.</returns>\n        public static string ToString(decimal value)\n        {\n            return EnsureDecimalPlace(value.ToString(null, CultureInfo.InvariantCulture));\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Guid\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Guid\"/>.</returns>\n        public static string ToString(Guid value)\n        {\n            return ToString(value, '\"');\n        }\n\n        internal static string ToString(Guid value, char quoteChar)\n        {\n            string text = null;\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            text = value.ToString(\"D\", CultureInfo.InvariantCulture);\n#else\n            text = value.ToString(\"D\");\n#endif\n\n            return quoteChar + text + quoteChar;\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"TimeSpan\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"TimeSpan\"/>.</returns>\n        public static string ToString(TimeSpan value)\n        {\n            return ToString(value, '\"');\n        }\n\n        internal static string ToString(TimeSpan value, char quoteChar)\n        {\n            return ToString(value.ToString(), quoteChar);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Uri\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Uri\"/>.</returns>\n        public static string ToString(Uri value)\n        {\n            if (value == null)\n                return Null;\n\n            return ToString(value, '\"');\n        }\n\n        internal static string ToString(Uri value, char quoteChar)\n        {\n            return ToString(value.OriginalString, quoteChar);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"String\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"String\"/>.</returns>\n        public static string ToString(string value)\n        {\n            return ToString(value, '\"');\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"String\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <param name=\"delimiter\">The string delimiter character.</param>\n        /// <returns>A JSON string representation of the <see cref=\"String\"/>.</returns>\n        public static string ToString(string value, char delimiter)\n        {\n            if (delimiter != '\"' && delimiter != '\\'')\n                throw new ArgumentException(\"Delimiter must be a single or double quote.\", \"delimiter\");\n\n            return JavaScriptUtils.ToEscapedJavaScriptString(value, delimiter, true);\n        }\n\n        /// <summary>\n        /// Converts the <see cref=\"Object\"/> to its JSON string representation.\n        /// </summary>\n        /// <param name=\"value\">The value to convert.</param>\n        /// <returns>A JSON string representation of the <see cref=\"Object\"/>.</returns>\n        public static string ToString(object value)\n        {\n            if (value == null)\n                return Null;\n\n            PrimitiveTypeCode typeCode = ConvertUtils.GetTypeCode(value);\n\n            switch (typeCode)\n            {\n                case PrimitiveTypeCode.String:\n                    return ToString((string)value);\n                case PrimitiveTypeCode.Char:\n                    return ToString((char)value);\n                case PrimitiveTypeCode.Boolean:\n                    return ToString((bool)value);\n                case PrimitiveTypeCode.SByte:\n                    return ToString((sbyte)value);\n                case PrimitiveTypeCode.Int16:\n                    return ToString((short)value);\n                case PrimitiveTypeCode.UInt16:\n                    return ToString((ushort)value);\n                case PrimitiveTypeCode.Int32:\n                    return ToString((int)value);\n                case PrimitiveTypeCode.Byte:\n                    return ToString((byte)value);\n                case PrimitiveTypeCode.UInt32:\n                    return ToString((uint)value);\n                case PrimitiveTypeCode.Int64:\n                    return ToString((long)value);\n                case PrimitiveTypeCode.UInt64:\n                    return ToString((ulong)value);\n                case PrimitiveTypeCode.Single:\n                    return ToString((float)value);\n                case PrimitiveTypeCode.Double:\n                    return ToString((double)value);\n                case PrimitiveTypeCode.DateTime:\n                    return ToString((DateTime)value);\n                case PrimitiveTypeCode.Decimal:\n                    return ToString((decimal)value);\n#if !(NETFX_CORE || PORTABLE)\n                case PrimitiveTypeCode.DBNull:\n                    return Null;\n#endif\n#if !NET20\n                case PrimitiveTypeCode.DateTimeOffset:\n                    return ToString((DateTimeOffset)value);\n#endif\n                case PrimitiveTypeCode.Guid:\n                    return ToString((Guid)value);\n                case PrimitiveTypeCode.Uri:\n                    return ToString((Uri)value);\n                case PrimitiveTypeCode.TimeSpan:\n                    return ToString((TimeSpan)value);\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n                case PrimitiveTypeCode.BigInteger:\n                    return ToStringInternal((BigInteger)value);\n#endif\n            }\n\n            throw new ArgumentException(\"Unsupported type: {0}. Use the JsonSerializer class to get the object's JSON representation.\".FormatWith(CultureInfo.InvariantCulture, value.GetType()));\n        }\n\n        #region Serialize\n        /// <summary>\n        /// Serializes the specified object to a JSON string.\n        /// </summary>\n        /// <param name=\"value\">The object to serialize.</param>\n        /// <returns>A JSON string representation of the object.</returns>\n        public static string SerializeObject(object value)\n        {\n            return SerializeObject(value, null, (JsonSerializerSettings)null);\n        }\n\n        /// <summary>\n        /// Serializes the specified object to a JSON string using formatting.\n        /// </summary>\n        /// <param name=\"value\">The object to serialize.</param>\n        /// <param name=\"formatting\">Indicates how the output is formatted.</param>\n        /// <returns>\n        /// A JSON string representation of the object.\n        /// </returns>\n        public static string SerializeObject(object value, Formatting formatting)\n        {\n            return SerializeObject(value, formatting, (JsonSerializerSettings)null);\n        }\n\n        /// <summary>\n        /// Serializes the specified object to a JSON string using a collection of <see cref=\"JsonConverter\"/>.\n        /// </summary>\n        /// <param name=\"value\">The object to serialize.</param>\n        /// <param name=\"converters\">A collection converters used while serializing.</param>\n        /// <returns>A JSON string representation of the object.</returns>\n        public static string SerializeObject(object value, params JsonConverter[] converters)\n        {\n            JsonSerializerSettings settings = (converters != null && converters.Length > 0)\n                ? new JsonSerializerSettings { Converters = converters }\n                : null;\n\n            return SerializeObject(value, null, settings);\n        }\n\n        /// <summary>\n        /// Serializes the specified object to a JSON string using formatting and a collection of <see cref=\"JsonConverter\"/>.\n        /// </summary>\n        /// <param name=\"value\">The object to serialize.</param>\n        /// <param name=\"formatting\">Indicates how the output is formatted.</param>\n        /// <param name=\"converters\">A collection converters used while serializing.</param>\n        /// <returns>A JSON string representation of the object.</returns>\n        public static string SerializeObject(object value, Formatting formatting, params JsonConverter[] converters)\n        {\n            JsonSerializerSettings settings = (converters != null && converters.Length > 0)\n                ? new JsonSerializerSettings { Converters = converters }\n                : null;\n\n            return SerializeObject(value, null, formatting, settings);\n        }\n\n        /// <summary>\n        /// Serializes the specified object to a JSON string using <see cref=\"JsonSerializerSettings\"/>.\n        /// </summary>\n        /// <param name=\"value\">The object to serialize.</param>\n        /// <param name=\"settings\">The <see cref=\"JsonSerializerSettings\"/> used to serialize the object.\n        /// If this is null, default serialization settings will be is used.</param>\n        /// <returns>\n        /// A JSON string representation of the object.\n        /// </returns>\n        public static string SerializeObject(object value, JsonSerializerSettings settings)\n        {\n            return SerializeObject(value, null, settings);\n        }\n\n        /// <summary>\n        /// Serializes the specified object to a JSON string using a type, formatting and <see cref=\"JsonSerializerSettings\"/>.\n        /// </summary>\n        /// <param name=\"value\">The object to serialize.</param>\n        /// <param name=\"settings\">The <see cref=\"JsonSerializerSettings\"/> used to serialize the object.\n        /// If this is null, default serialization settings will be is used.</param>\n        /// <param name=\"type\">\n        /// The type of the value being serialized.\n        /// This parameter is used when <see cref=\"TypeNameHandling\"/> is Auto to write out the type name if the type of the value does not match.\n        /// Specifing the type is optional.\n        /// </param>\n        /// <returns>\n        /// A JSON string representation of the object.\n        /// </returns>\n        public static string SerializeObject(object value, Type type, JsonSerializerSettings settings)\n        {\n            JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);\n\n            return SerializeObjectInternal(value, type, jsonSerializer);\n        }\n\n        /// <summary>\n        /// Serializes the specified object to a JSON string using formatting and <see cref=\"JsonSerializerSettings\"/>.\n        /// </summary>\n        /// <param name=\"value\">The object to serialize.</param>\n        /// <param name=\"formatting\">Indicates how the output is formatted.</param>\n        /// <param name=\"settings\">The <see cref=\"JsonSerializerSettings\"/> used to serialize the object.\n        /// If this is null, default serialization settings will be is used.</param>\n        /// <returns>\n        /// A JSON string representation of the object.\n        /// </returns>\n        public static string SerializeObject(object value, Formatting formatting, JsonSerializerSettings settings)\n        {\n            return SerializeObject(value, null, formatting, settings);\n        }\n\n        /// <summary>\n        /// Serializes the specified object to a JSON string using a type, formatting and <see cref=\"JsonSerializerSettings\"/>.\n        /// </summary>\n        /// <param name=\"value\">The object to serialize.</param>\n        /// <param name=\"formatting\">Indicates how the output is formatted.</param>\n        /// <param name=\"settings\">The <see cref=\"JsonSerializerSettings\"/> used to serialize the object.\n        /// If this is null, default serialization settings will be is used.</param>\n        /// <param name=\"type\">\n        /// The type of the value being serialized.\n        /// This parameter is used when <see cref=\"TypeNameHandling\"/> is Auto to write out the type name if the type of the value does not match.\n        /// Specifing the type is optional.\n        /// </param>\n        /// <returns>\n        /// A JSON string representation of the object.\n        /// </returns>\n        public static string SerializeObject(object value, Type type, Formatting formatting, JsonSerializerSettings settings)\n        {\n            JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);\n            jsonSerializer.Formatting = formatting;\n\n            return SerializeObjectInternal(value, type, jsonSerializer);\n        }\n\n        private static string SerializeObjectInternal(object value, Type type, JsonSerializer jsonSerializer)\n        {\n            StringBuilder sb = new StringBuilder(256);\n            StringWriter sw = new StringWriter(sb, CultureInfo.InvariantCulture);\n            using (JsonTextWriter jsonWriter = new JsonTextWriter(sw))\n            {\n                jsonWriter.Formatting = jsonSerializer.Formatting;\n\n                jsonSerializer.Serialize(jsonWriter, value, type);\n            }\n\n            return sw.ToString();\n        }\n\n#if !(NET20 || NET35 || PORTABLE40)\n        /// <summary>\n        /// Asynchronously serializes the specified object to a JSON string.\n        /// Serialization will happen on a new thread.\n        /// </summary>\n        /// <param name=\"value\">The object to serialize.</param>\n        /// <returns>\n        /// A task that represents the asynchronous serialize operation. The value of the <c>TResult</c> parameter contains a JSON string representation of the object.\n        /// </returns>\n        [ObsoleteAttribute(\"SerializeObjectAsync is obsolete. Use the Task.Factory.StartNew method to serialize JSON asynchronously: Task.Factory.StartNew(() => JsonConvert.SerializeObject(value))\")]\n        public static Task<string> SerializeObjectAsync(object value)\n        {\n            return SerializeObjectAsync(value, Formatting.None, null);\n        }\n\n        /// <summary>\n        /// Asynchronously serializes the specified object to a JSON string using formatting.\n        /// Serialization will happen on a new thread.\n        /// </summary>\n        /// <param name=\"value\">The object to serialize.</param>\n        /// <param name=\"formatting\">Indicates how the output is formatted.</param>\n        /// <returns>\n        /// A task that represents the asynchronous serialize operation. The value of the <c>TResult</c> parameter contains a JSON string representation of the object.\n        /// </returns>\n        [ObsoleteAttribute(\"SerializeObjectAsync is obsolete. Use the Task.Factory.StartNew method to serialize JSON asynchronously: Task.Factory.StartNew(() => JsonConvert.SerializeObject(value, formatting))\")]\n        public static Task<string> SerializeObjectAsync(object value, Formatting formatting)\n        {\n            return SerializeObjectAsync(value, formatting, null);\n        }\n\n        /// <summary>\n        /// Asynchronously serializes the specified object to a JSON string using formatting and a collection of <see cref=\"JsonConverter\"/>.\n        /// Serialization will happen on a new thread.\n        /// </summary>\n        /// <param name=\"value\">The object to serialize.</param>\n        /// <param name=\"formatting\">Indicates how the output is formatted.</param>\n        /// <param name=\"settings\">The <see cref=\"JsonSerializerSettings\"/> used to serialize the object.\n        /// If this is null, default serialization settings will be is used.</param>\n        /// <returns>\n        /// A task that represents the asynchronous serialize operation. The value of the <c>TResult</c> parameter contains a JSON string representation of the object.\n        /// </returns>\n        [ObsoleteAttribute(\"SerializeObjectAsync is obsolete. Use the Task.Factory.StartNew method to serialize JSON asynchronously: Task.Factory.StartNew(() => JsonConvert.SerializeObject(value, formatting, settings))\")]\n        public static Task<string> SerializeObjectAsync(object value, Formatting formatting, JsonSerializerSettings settings)\n        {\n            return Task.Factory.StartNew(() => SerializeObject(value, formatting, settings));\n        }\n#endif\n        #endregion\n\n        #region Deserialize\n        /// <summary>\n        /// Deserializes the JSON to a .NET object.\n        /// </summary>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <returns>The deserialized object from the Json string.</returns>\n        public static object DeserializeObject(string value)\n        {\n            return DeserializeObject(value, null, (JsonSerializerSettings)null);\n        }\n\n        /// <summary>\n        /// Deserializes the JSON to a .NET object using <see cref=\"JsonSerializerSettings\"/>.\n        /// </summary>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <param name=\"settings\">\n        /// The <see cref=\"JsonSerializerSettings\"/> used to deserialize the object.\n        /// If this is null, default serialization settings will be is used.\n        /// </param>\n        /// <returns>The deserialized object from the JSON string.</returns>\n        public static object DeserializeObject(string value, JsonSerializerSettings settings)\n        {\n            return DeserializeObject(value, null, settings);\n        }\n\n        /// <summary>\n        /// Deserializes the JSON to the specified .NET type.\n        /// </summary>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <param name=\"type\">The <see cref=\"Type\"/> of object being deserialized.</param>\n        /// <returns>The deserialized object from the Json string.</returns>\n        public static object DeserializeObject(string value, Type type)\n        {\n            return DeserializeObject(value, type, (JsonSerializerSettings)null);\n        }\n\n        /// <summary>\n        /// Deserializes the JSON to the specified .NET type.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the object to deserialize to.</typeparam>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <returns>The deserialized object from the Json string.</returns>\n        public static T DeserializeObject<T>(string value)\n        {\n            return DeserializeObject<T>(value, (JsonSerializerSettings)null);\n        }\n\n        /// <summary>\n        /// Deserializes the JSON to the given anonymous type.\n        /// </summary>\n        /// <typeparam name=\"T\">\n        /// The anonymous type to deserialize to. This can't be specified\n        /// traditionally and must be infered from the anonymous type passed\n        /// as a parameter.\n        /// </typeparam>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <param name=\"anonymousTypeObject\">The anonymous type object.</param>\n        /// <returns>The deserialized anonymous type from the JSON string.</returns>\n        public static T DeserializeAnonymousType<T>(string value, T anonymousTypeObject)\n        {\n            return DeserializeObject<T>(value);\n        }\n\n        /// <summary>\n        /// Deserializes the JSON to the given anonymous type using <see cref=\"JsonSerializerSettings\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">\n        /// The anonymous type to deserialize to. This can't be specified\n        /// traditionally and must be infered from the anonymous type passed\n        /// as a parameter.\n        /// </typeparam>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <param name=\"anonymousTypeObject\">The anonymous type object.</param>\n        /// <param name=\"settings\">\n        /// The <see cref=\"JsonSerializerSettings\"/> used to deserialize the object.\n        /// If this is null, default serialization settings will be is used.\n        /// </param>\n        /// <returns>The deserialized anonymous type from the JSON string.</returns>\n        public static T DeserializeAnonymousType<T>(string value, T anonymousTypeObject, JsonSerializerSettings settings)\n        {\n            return DeserializeObject<T>(value, settings);\n        }\n\n        /// <summary>\n        /// Deserializes the JSON to the specified .NET type using a collection of <see cref=\"JsonConverter\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the object to deserialize to.</typeparam>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <param name=\"converters\">Converters to use while deserializing.</param>\n        /// <returns>The deserialized object from the JSON string.</returns>\n        public static T DeserializeObject<T>(string value, params JsonConverter[] converters)\n        {\n            return (T)DeserializeObject(value, typeof(T), converters);\n        }\n\n        /// <summary>\n        /// Deserializes the JSON to the specified .NET type using <see cref=\"JsonSerializerSettings\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the object to deserialize to.</typeparam>\n        /// <param name=\"value\">The object to deserialize.</param>\n        /// <param name=\"settings\">\n        /// The <see cref=\"JsonSerializerSettings\"/> used to deserialize the object.\n        /// If this is null, default serialization settings will be is used.\n        /// </param>\n        /// <returns>The deserialized object from the JSON string.</returns>\n        public static T DeserializeObject<T>(string value, JsonSerializerSettings settings)\n        {\n            return (T)DeserializeObject(value, typeof(T), settings);\n        }\n\n        /// <summary>\n        /// Deserializes the JSON to the specified .NET type using a collection of <see cref=\"JsonConverter\"/>.\n        /// </summary>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <param name=\"type\">The type of the object to deserialize.</param>\n        /// <param name=\"converters\">Converters to use while deserializing.</param>\n        /// <returns>The deserialized object from the JSON string.</returns>\n        public static object DeserializeObject(string value, Type type, params JsonConverter[] converters)\n        {\n            JsonSerializerSettings settings = (converters != null && converters.Length > 0)\n                ? new JsonSerializerSettings { Converters = converters }\n                : null;\n\n            return DeserializeObject(value, type, settings);\n        }\n\n        /// <summary>\n        /// Deserializes the JSON to the specified .NET type using <see cref=\"JsonSerializerSettings\"/>.\n        /// </summary>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <param name=\"type\">The type of the object to deserialize to.</param>\n        /// <param name=\"settings\">\n        /// The <see cref=\"JsonSerializerSettings\"/> used to deserialize the object.\n        /// If this is null, default serialization settings will be is used.\n        /// </param>\n        /// <returns>The deserialized object from the JSON string.</returns>\n        public static object DeserializeObject(string value, Type type, JsonSerializerSettings settings)\n        {\n            ValidationUtils.ArgumentNotNull(value, \"value\");\n\n            JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);\n\n            // by default DeserializeObject should check for additional content\n            if (!jsonSerializer.IsCheckAdditionalContentSet())\n                jsonSerializer.CheckAdditionalContent = true;\n\n            using (var reader = new JsonTextReader(new StringReader(value)))\n            {\n                return jsonSerializer.Deserialize(reader, type);\n            }\n        }\n\n#if !(NET20 || NET35 || PORTABLE40)\n        /// <summary>\n        /// Asynchronously deserializes the JSON to the specified .NET type.\n        /// Deserialization will happen on a new thread.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the object to deserialize to.</typeparam>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <returns>\n        /// A task that represents the asynchronous deserialize operation. The value of the <c>TResult</c> parameter contains the deserialized object from the JSON string.\n        /// </returns>\n        [ObsoleteAttribute(\"DeserializeObjectAsync is obsolete. Use the Task.Factory.StartNew method to deserialize JSON asynchronously: Task.Factory.StartNew(() => JsonConvert.DeserializeObject<T>(value))\")]\n        public static Task<T> DeserializeObjectAsync<T>(string value)\n        {\n            return DeserializeObjectAsync<T>(value, null);\n        }\n\n        /// <summary>\n        /// Asynchronously deserializes the JSON to the specified .NET type using <see cref=\"JsonSerializerSettings\"/>.\n        /// Deserialization will happen on a new thread.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the object to deserialize to.</typeparam>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <param name=\"settings\">\n        /// The <see cref=\"JsonSerializerSettings\"/> used to deserialize the object.\n        /// If this is null, default serialization settings will be is used.\n        /// </param>\n        /// <returns>\n        /// A task that represents the asynchronous deserialize operation. The value of the <c>TResult</c> parameter contains the deserialized object from the JSON string.\n        /// </returns>\n        [ObsoleteAttribute(\"DeserializeObjectAsync is obsolete. Use the Task.Factory.StartNew method to deserialize JSON asynchronously: Task.Factory.StartNew(() => JsonConvert.DeserializeObject<T>(value, settings))\")]\n        public static Task<T> DeserializeObjectAsync<T>(string value, JsonSerializerSettings settings)\n        {\n            return Task.Factory.StartNew(() => DeserializeObject<T>(value, settings));\n        }\n\n        /// <summary>\n        /// Asynchronously deserializes the JSON to the specified .NET type.\n        /// Deserialization will happen on a new thread.\n        /// </summary>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <returns>\n        /// A task that represents the asynchronous deserialize operation. The value of the <c>TResult</c> parameter contains the deserialized object from the JSON string.\n        /// </returns>\n        [ObsoleteAttribute(\"DeserializeObjectAsync is obsolete. Use the Task.Factory.StartNew method to deserialize JSON asynchronously: Task.Factory.StartNew(() => JsonConvert.DeserializeObject(value))\")]\n        public static Task<object> DeserializeObjectAsync(string value)\n        {\n            return DeserializeObjectAsync(value, null, null);\n        }\n\n        /// <summary>\n        /// Asynchronously deserializes the JSON to the specified .NET type using <see cref=\"JsonSerializerSettings\"/>.\n        /// Deserialization will happen on a new thread.\n        /// </summary>\n        /// <param name=\"value\">The JSON to deserialize.</param>\n        /// <param name=\"type\">The type of the object to deserialize to.</param>\n        /// <param name=\"settings\">\n        /// The <see cref=\"JsonSerializerSettings\"/> used to deserialize the object.\n        /// If this is null, default serialization settings will be is used.\n        /// </param>\n        /// <returns>\n        /// A task that represents the asynchronous deserialize operation. The value of the <c>TResult</c> parameter contains the deserialized object from the JSON string.\n        /// </returns>\n        [ObsoleteAttribute(\"DeserializeObjectAsync is obsolete. Use the Task.Factory.StartNew method to deserialize JSON asynchronously: Task.Factory.StartNew(() => JsonConvert.DeserializeObject(value, type, settings))\")]\n        public static Task<object> DeserializeObjectAsync(string value, Type type, JsonSerializerSettings settings)\n        {\n            return Task.Factory.StartNew(() => DeserializeObject(value, type, settings));\n        }\n#endif\n        #endregion\n\n        /// <summary>\n        /// Populates the object with values from the JSON string.\n        /// </summary>\n        /// <param name=\"value\">The JSON to populate values from.</param>\n        /// <param name=\"target\">The target object to populate values onto.</param>\n        public static void PopulateObject(string value, object target)\n        {\n            PopulateObject(value, target, null);\n        }\n\n        /// <summary>\n        /// Populates the object with values from the JSON string using <see cref=\"JsonSerializerSettings\"/>.\n        /// </summary>\n        /// <param name=\"value\">The JSON to populate values from.</param>\n        /// <param name=\"target\">The target object to populate values onto.</param>\n        /// <param name=\"settings\">\n        /// The <see cref=\"JsonSerializerSettings\"/> used to deserialize the object.\n        /// If this is null, default serialization settings will be is used.\n        /// </param>\n        public static void PopulateObject(string value, object target, JsonSerializerSettings settings)\n        {\n            JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);\n\n            using (JsonReader jsonReader = new JsonTextReader(new StringReader(value)))\n            {\n                jsonSerializer.Populate(jsonReader, target);\n\n                if (jsonReader.Read() && jsonReader.TokenType != JsonToken.Comment)\n                    throw new JsonSerializationException(\"Additional text found in JSON string after finishing deserializing object.\");\n            }\n        }\n\n#if !(NET20 || NET35 || PORTABLE40)\n        /// <summary>\n        /// Asynchronously populates the object with values from the JSON string using <see cref=\"JsonSerializerSettings\"/>.\n        /// </summary>\n        /// <param name=\"value\">The JSON to populate values from.</param>\n        /// <param name=\"target\">The target object to populate values onto.</param>\n        /// <param name=\"settings\">\n        /// The <see cref=\"JsonSerializerSettings\"/> used to deserialize the object.\n        /// If this is null, default serialization settings will be is used.\n        /// </param>\n        /// <returns>\n        /// A task that represents the asynchronous populate operation.\n        /// </returns>\n        [ObsoleteAttribute(\"PopulateObjectAsync is obsolete. Use the Task.Factory.StartNew method to populate an object with JSON values asynchronously: Task.Factory.StartNew(() => JsonConvert.PopulateObject(value, target, settings))\")]\n        public static Task PopulateObjectAsync(string value, object target, JsonSerializerSettings settings)\n        {\n            return Task.Factory.StartNew(() => PopulateObject(value, target, settings));\n        }\n#endif\n\n#if !(PORTABLE40 || PORTABLE || NETFX_CORE)\n        /// <summary>\n        /// Serializes the XML node to a JSON string.\n        /// </summary>\n        /// <param name=\"node\">The node to serialize.</param>\n        /// <returns>A JSON string of the XmlNode.</returns>\n        public static string SerializeXmlNode(XmlNode node)\n        {\n            return SerializeXmlNode(node, Formatting.None);\n        }\n\n        /// <summary>\n        /// Serializes the XML node to a JSON string using formatting.\n        /// </summary>\n        /// <param name=\"node\">The node to serialize.</param>\n        /// <param name=\"formatting\">Indicates how the output is formatted.</param>\n        /// <returns>A JSON string of the XmlNode.</returns>\n        public static string SerializeXmlNode(XmlNode node, Formatting formatting)\n        {\n            XmlNodeConverter converter = new XmlNodeConverter();\n\n            return SerializeObject(node, formatting, converter);\n        }\n\n        /// <summary>\n        /// Serializes the XML node to a JSON string using formatting and omits the root object if <paramref name=\"omitRootObject\"/> is <c>true</c>.\n        /// </summary>\n        /// <param name=\"node\">The node to serialize.</param>\n        /// <param name=\"formatting\">Indicates how the output is formatted.</param>\n        /// <param name=\"omitRootObject\">Omits writing the root object.</param>\n        /// <returns>A JSON string of the XmlNode.</returns>\n        public static string SerializeXmlNode(XmlNode node, Formatting formatting, bool omitRootObject)\n        {\n            XmlNodeConverter converter = new XmlNodeConverter { OmitRootObject = omitRootObject };\n\n            return SerializeObject(node, formatting, converter);\n        }\n\n        /// <summary>\n        /// Deserializes the XmlNode from a JSON string.\n        /// </summary>\n        /// <param name=\"value\">The JSON string.</param>\n        /// <returns>The deserialized XmlNode</returns>\n        public static XmlDocument DeserializeXmlNode(string value)\n        {\n            return DeserializeXmlNode(value, null);\n        }\n\n        /// <summary>\n        /// Deserializes the XmlNode from a JSON string nested in a root elment specified by <paramref name=\"deserializeRootElementName\"/>.\n        /// </summary>\n        /// <param name=\"value\">The JSON string.</param>\n        /// <param name=\"deserializeRootElementName\">The name of the root element to append when deserializing.</param>\n        /// <returns>The deserialized XmlNode</returns>\n        public static XmlDocument DeserializeXmlNode(string value, string deserializeRootElementName)\n        {\n            return DeserializeXmlNode(value, deserializeRootElementName, false);\n        }\n\n        /// <summary>\n        /// Deserializes the XmlNode from a JSON string nested in a root elment specified by <paramref name=\"deserializeRootElementName\"/>\n        /// and writes a .NET array attribute for collections.\n        /// </summary>\n        /// <param name=\"value\">The JSON string.</param>\n        /// <param name=\"deserializeRootElementName\">The name of the root element to append when deserializing.</param>\n        /// <param name=\"writeArrayAttribute\">\n        /// A flag to indicate whether to write the Json.NET array attribute.\n        /// This attribute helps preserve arrays when converting the written XML back to JSON.\n        /// </param>\n        /// <returns>The deserialized XmlNode</returns>\n        public static XmlDocument DeserializeXmlNode(string value, string deserializeRootElementName, bool writeArrayAttribute)\n        {\n            XmlNodeConverter converter = new XmlNodeConverter();\n            converter.DeserializeRootElementName = deserializeRootElementName;\n            converter.WriteArrayAttribute = writeArrayAttribute;\n\n            return (XmlDocument)DeserializeObject(value, typeof(XmlDocument), converter);\n        }\n#endif\n\n#if !NET20 && !PORTABLE40\n        /// <summary>\n        /// Serializes the <see cref=\"XNode\"/> to a JSON string.\n        /// </summary>\n        /// <param name=\"node\">The node to convert to JSON.</param>\n        /// <returns>A JSON string of the XNode.</returns>\n        public static string SerializeXNode(XObject node)\n        {\n            return SerializeXNode(node, Formatting.None);\n        }\n\n        /// <summary>\n        /// Serializes the <see cref=\"XNode\"/> to a JSON string using formatting.\n        /// </summary>\n        /// <param name=\"node\">The node to convert to JSON.</param>\n        /// <param name=\"formatting\">Indicates how the output is formatted.</param>\n        /// <returns>A JSON string of the XNode.</returns>\n        public static string SerializeXNode(XObject node, Formatting formatting)\n        {\n            return SerializeXNode(node, formatting, false);\n        }\n\n        /// <summary>\n        /// Serializes the <see cref=\"XNode\"/> to a JSON string using formatting and omits the root object if <paramref name=\"omitRootObject\"/> is <c>true</c>.\n        /// </summary>\n        /// <param name=\"node\">The node to serialize.</param>\n        /// <param name=\"formatting\">Indicates how the output is formatted.</param>\n        /// <param name=\"omitRootObject\">Omits writing the root object.</param>\n        /// <returns>A JSON string of the XNode.</returns>\n        public static string SerializeXNode(XObject node, Formatting formatting, bool omitRootObject)\n        {\n            XmlNodeConverter converter = new XmlNodeConverter { OmitRootObject = omitRootObject };\n\n            return SerializeObject(node, formatting, converter);\n        }\n\n        /// <summary>\n        /// Deserializes the <see cref=\"XNode\"/> from a JSON string.\n        /// </summary>\n        /// <param name=\"value\">The JSON string.</param>\n        /// <returns>The deserialized XNode</returns>\n        public static XDocument DeserializeXNode(string value)\n        {\n            return DeserializeXNode(value, null);\n        }\n\n        /// <summary>\n        /// Deserializes the <see cref=\"XNode\"/> from a JSON string nested in a root elment specified by <paramref name=\"deserializeRootElementName\"/>.\n        /// </summary>\n        /// <param name=\"value\">The JSON string.</param>\n        /// <param name=\"deserializeRootElementName\">The name of the root element to append when deserializing.</param>\n        /// <returns>The deserialized XNode</returns>\n        public static XDocument DeserializeXNode(string value, string deserializeRootElementName)\n        {\n            return DeserializeXNode(value, deserializeRootElementName, false);\n        }\n\n        /// <summary>\n        /// Deserializes the <see cref=\"XNode\"/> from a JSON string nested in a root elment specified by <paramref name=\"deserializeRootElementName\"/>\n        /// and writes a .NET array attribute for collections.\n        /// </summary>\n        /// <param name=\"value\">The JSON string.</param>\n        /// <param name=\"deserializeRootElementName\">The name of the root element to append when deserializing.</param>\n        /// <param name=\"writeArrayAttribute\">\n        /// A flag to indicate whether to write the Json.NET array attribute.\n        /// This attribute helps preserve arrays when converting the written XML back to JSON.\n        /// </param>\n        /// <returns>The deserialized XNode</returns>\n        public static XDocument DeserializeXNode(string value, string deserializeRootElementName, bool writeArrayAttribute)\n        {\n            XmlNodeConverter converter = new XmlNodeConverter();\n            converter.DeserializeRootElementName = deserializeRootElementName;\n            converter.WriteArrayAttribute = writeArrayAttribute;\n\n            return (XDocument)DeserializeObject(value, typeof(XDocument), converter);\n        }\n#endif\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonConverter.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Newtonsoft.Json.Utilities;\nusing Newtonsoft.Json.Schema;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Converts an object to and from JSON.\n    /// </summary>\n    public abstract class JsonConverter\n    {\n        /// <summary>\n        /// Writes the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"writer\">The <see cref=\"JsonWriter\"/> to write to.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        public abstract void WriteJson(JsonWriter writer, object value, JsonSerializer serializer);\n\n        /// <summary>\n        /// Reads the JSON representation of the object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from.</param>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <param name=\"existingValue\">The existing value of object being read.</param>\n        /// <param name=\"serializer\">The calling serializer.</param>\n        /// <returns>The object value.</returns>\n        public abstract object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer);\n\n        /// <summary>\n        /// Determines whether this instance can convert the specified object type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>\n        /// \t<c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.\n        /// </returns>\n        public abstract bool CanConvert(Type objectType);\n\n        /// <summary>\n        /// Gets the <see cref=\"JsonSchema\"/> of the JSON produced by the JsonConverter.\n        /// </summary>\n        /// <returns>The <see cref=\"JsonSchema\"/> of the JSON produced by the JsonConverter.</returns>\n        public virtual JsonSchema GetSchema()\n        {\n            return null;\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether this <see cref=\"JsonConverter\"/> can read JSON.\n        /// </summary>\n        /// <value><c>true</c> if this <see cref=\"JsonConverter\"/> can read JSON; otherwise, <c>false</c>.</value>\n        public virtual bool CanRead\n        {\n            get { return true; }\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether this <see cref=\"JsonConverter\"/> can write JSON.\n        /// </summary>\n        /// <value><c>true</c> if this <see cref=\"JsonConverter\"/> can write JSON; otherwise, <c>false</c>.</value>\n        public virtual bool CanWrite\n        {\n            get { return true; }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonConverterAttribute.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Instructs the <see cref=\"JsonSerializer\"/> to use the specified <see cref=\"JsonConverter\"/> when serializing the member or class.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Enum | AttributeTargets.Parameter, AllowMultiple = false)]\n    public sealed class JsonConverterAttribute : Attribute\n    {\n        private readonly Type _converterType;\n\n        /// <summary>\n        /// Gets the type of the converter.\n        /// </summary>\n        /// <value>The type of the converter.</value>\n        public Type ConverterType\n        {\n            get { return _converterType; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonConverterAttribute\"/> class.\n        /// </summary>\n        /// <param name=\"converterType\">Type of the converter.</param>\n        public JsonConverterAttribute(Type converterType)\n        {\n            if (converterType == null)\n                throw new ArgumentNullException(\"converterType\");\n\n            _converterType = converterType;\n        }\n\n        internal static JsonConverter CreateJsonConverterInstance(Type converterType)\n        {\n            try\n            {\n                return (JsonConverter)Activator.CreateInstance(converterType);\n            }\n            catch (Exception ex)\n            {\n                throw new JsonException(\"Error creating {0}\".FormatWith(CultureInfo.InvariantCulture, converterType), ex);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonConverterCollection.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Collections.ObjectModel;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Represents a collection of <see cref=\"JsonConverter\"/>.\n    /// </summary>\n    public class JsonConverterCollection : Collection<JsonConverter>\n    {\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonDictionaryAttribute.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Instructs the <see cref=\"JsonSerializer\"/> how to serialize the collection.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]\n    public sealed class JsonDictionaryAttribute : JsonContainerAttribute\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonDictionaryAttribute\"/> class.\n        /// </summary>\n        public JsonDictionaryAttribute()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonDictionaryAttribute\"/> class with the specified container Id.\n        /// </summary>\n        /// <param name=\"id\">The container Id.</param>\n        public JsonDictionaryAttribute(string id)\n            : base(id)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonException.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Runtime.Serialization;\nusing System.Text;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// The exception thrown when an error occurs during Json serialization or deserialization.\n    /// </summary>\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n    [Serializable]\n#endif\n    public class JsonException : Exception\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonException\"/> class.\n        /// </summary>\n        public JsonException()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonException\"/> class\n        /// with a specified error message.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        public JsonException(string message)\n            : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonException\"/> class\n        /// with a specified error message and a reference to the inner exception that is the cause of this exception.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>\n        public JsonException(string message, Exception innerException)\n            : base(message, innerException)\n        {\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonException\"/> class.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">The <paramref name=\"info\"/> parameter is null. </exception>\n        /// <exception cref=\"T:System.Runtime.Serialization.SerializationException\">The class name is null or <see cref=\"P:System.Exception.HResult\"/> is zero (0). </exception>\n        public JsonException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n#endif\n\n        internal static JsonException Create(IJsonLineInfo lineInfo, string path, string message)\n        {\n            message = JsonPosition.FormatMessage(lineInfo, path, message);\n\n            return new JsonException(message);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonExtensionDataAttribute.cs",
    "content": "﻿using System;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Instructs the <see cref=\"JsonSerializer\"/> to deserialize properties with no matching class member into the specified collection\n    /// and write values during serialization.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]\n    public class JsonExtensionDataAttribute : Attribute\n    {\n        /// <summary>\n        /// Gets or sets a value that indicates whether to write extension data when serializing the object.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> to write extension data when serializing the object; otherwise, <c>false</c>. The default is <c>true</c>.\n        /// </value>\n        public bool WriteData { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value that indicates whether to read extension data when deserializing the object.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> to read extension data when deserializing the object; otherwise, <c>false</c>. The default is <c>true</c>.\n        /// </value>\n        public bool ReadData { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonExtensionDataAttribute\"/> class.\n        /// </summary>\n        public JsonExtensionDataAttribute()\n        {\n            WriteData = true;\n            ReadData = true;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonIgnoreAttribute.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Instructs the <see cref=\"JsonSerializer\"/> not to serialize the public field or public read/write property value.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]\n    public sealed class JsonIgnoreAttribute : Attribute\n    {\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonObjectAttribute.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Instructs the <see cref=\"JsonSerializer\"/> how to serialize the object.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, AllowMultiple = false)]\n    public sealed class JsonObjectAttribute : JsonContainerAttribute\n    {\n        private MemberSerialization _memberSerialization = MemberSerialization.OptOut;\n\n        // yuck. can't set nullable properties on an attribute in C#\n        // have to use this approach to get an unset default state\n        internal Required? _itemRequired;\n\n        /// <summary>\n        /// Gets or sets the member serialization.\n        /// </summary>\n        /// <value>The member serialization.</value>\n        public MemberSerialization MemberSerialization\n        {\n            get { return _memberSerialization; }\n            set { _memberSerialization = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets a value that indicates whether the object's properties are required.\n        /// </summary>\n        /// <value>\n        /// \tA value indicating whether the object's properties are required.\n        /// </value>\n        public Required ItemRequired\n        {\n            get { return _itemRequired ?? default(Required); }\n            set { _itemRequired = value; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonObjectAttribute\"/> class.\n        /// </summary>\n        public JsonObjectAttribute()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonObjectAttribute\"/> class with the specified member serialization.\n        /// </summary>\n        /// <param name=\"memberSerialization\">The member serialization.</param>\n        public JsonObjectAttribute(MemberSerialization memberSerialization)\n        {\n            MemberSerialization = memberSerialization;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonObjectAttribute\"/> class with the specified container Id.\n        /// </summary>\n        /// <param name=\"id\">The container Id.</param>\n        public JsonObjectAttribute(string id)\n            : base(id)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonPosition.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Text;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json\n{\n    internal enum JsonContainerType\n    {\n        None,\n        Object,\n        Array,\n        Constructor\n    }\n\n    internal struct JsonPosition\n    {\n        internal JsonContainerType Type;\n        internal int Position;\n        internal string PropertyName;\n        internal bool HasIndex;\n\n        public JsonPosition(JsonContainerType type)\n        {\n            Type = type;\n            HasIndex = TypeHasIndex(type);\n            Position = -1;\n            PropertyName = null;\n        }\n\n        internal void WriteTo(StringBuilder sb)\n        {\n            switch (Type)\n            {\n                case JsonContainerType.Object:\n                    if (sb.Length > 0)\n                        sb.Append(\".\");\n                    sb.Append(PropertyName);\n                    break;\n                case JsonContainerType.Array:\n                case JsonContainerType.Constructor:\n                    sb.Append(\"[\");\n                    sb.Append(Position);\n                    sb.Append(\"]\");\n                    break;\n            }\n        }\n\n        internal static bool TypeHasIndex(JsonContainerType type)\n        {\n            return (type == JsonContainerType.Array || type == JsonContainerType.Constructor);\n        }\n\n        internal static string BuildPath(IEnumerable<JsonPosition> positions)\n        {\n            StringBuilder sb = new StringBuilder();\n\n            foreach (JsonPosition state in positions)\n            {\n                state.WriteTo(sb);\n            }\n\n            return sb.ToString();\n        }\n\n        internal static string FormatMessage(IJsonLineInfo lineInfo, string path, string message)\n        {\n            // don't add a fullstop and space when message ends with a new line\n            if (!message.EndsWith(Environment.NewLine))\n            {\n                message = message.Trim();\n\n                if (!message.EndsWith(\".\"))\n                    message += \".\";\n\n                message += \" \";\n            }\n\n            message += \"Path '{0}'\".FormatWith(CultureInfo.InvariantCulture, path);\n\n            if (lineInfo != null && lineInfo.HasLineInfo())\n                message += \", line {0}, position {1}\".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);\n\n            message += \".\";\n\n            return message;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonPropertyAttribute.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Instructs the <see cref=\"JsonSerializer\"/> to always serialize the member with the specified name.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false)]\n    public sealed class JsonPropertyAttribute : Attribute\n    {\n        // yuck. can't set nullable properties on an attribute in C#\n        // have to use this approach to get an unset default state\n        internal NullValueHandling? _nullValueHandling;\n        internal DefaultValueHandling? _defaultValueHandling;\n        internal ReferenceLoopHandling? _referenceLoopHandling;\n        internal ObjectCreationHandling? _objectCreationHandling;\n        internal TypeNameHandling? _typeNameHandling;\n        internal bool? _isReference;\n        internal int? _order;\n        internal Required? _required;\n        internal bool? _itemIsReference;\n        internal ReferenceLoopHandling? _itemReferenceLoopHandling;\n        internal TypeNameHandling? _itemTypeNameHandling;\n\n        /// <summary>\n        /// Gets or sets the converter used when serializing the property's collection items.\n        /// </summary>\n        /// <value>The collection's items converter.</value>\n        public Type ItemConverterType { get; set; }\n\n        /// <summary>\n        /// Gets or sets the null value handling used when serializing this property.\n        /// </summary>\n        /// <value>The null value handling.</value>\n        public NullValueHandling NullValueHandling\n        {\n            get { return _nullValueHandling ?? default(NullValueHandling); }\n            set { _nullValueHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the default value handling used when serializing this property.\n        /// </summary>\n        /// <value>The default value handling.</value>\n        public DefaultValueHandling DefaultValueHandling\n        {\n            get { return _defaultValueHandling ?? default(DefaultValueHandling); }\n            set { _defaultValueHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the reference loop handling used when serializing this property.\n        /// </summary>\n        /// <value>The reference loop handling.</value>\n        public ReferenceLoopHandling ReferenceLoopHandling\n        {\n            get { return _referenceLoopHandling ?? default(ReferenceLoopHandling); }\n            set { _referenceLoopHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the object creation handling used when deserializing this property.\n        /// </summary>\n        /// <value>The object creation handling.</value>\n        public ObjectCreationHandling ObjectCreationHandling\n        {\n            get { return _objectCreationHandling ?? default(ObjectCreationHandling); }\n            set { _objectCreationHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the type name handling used when serializing this property.\n        /// </summary>\n        /// <value>The type name handling.</value>\n        public TypeNameHandling TypeNameHandling\n        {\n            get { return _typeNameHandling ?? default(TypeNameHandling); }\n            set { _typeNameHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets whether this property's value is serialized as a reference.\n        /// </summary>\n        /// <value>Whether this property's value is serialized as a reference.</value>\n        public bool IsReference\n        {\n            get { return _isReference ?? default(bool); }\n            set { _isReference = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the order of serialization and deserialization of a member.\n        /// </summary>\n        /// <value>The numeric order of serialization or deserialization.</value>\n        public int Order\n        {\n            get { return _order ?? default(int); }\n            set { _order = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether this property is required.\n        /// </summary>\n        /// <value>\n        /// \tA value indicating whether this property is required.\n        /// </value>\n        public Required Required\n        {\n            get { return _required ?? Required.Default; }\n            set { _required = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the name of the property.\n        /// </summary>\n        /// <value>The name of the property.</value>\n        public string PropertyName { get; set; }\n\n        /// <summary>\n        /// Gets or sets the the reference loop handling used when serializing the property's collection items.\n        /// </summary>\n        /// <value>The collection's items reference loop handling.</value>\n        public ReferenceLoopHandling ItemReferenceLoopHandling\n        {\n            get { return _itemReferenceLoopHandling ?? default(ReferenceLoopHandling); }\n            set { _itemReferenceLoopHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the the type name handling used when serializing the property's collection items.\n        /// </summary>\n        /// <value>The collection's items type name handling.</value>\n        public TypeNameHandling ItemTypeNameHandling\n        {\n            get { return _itemTypeNameHandling ?? default(TypeNameHandling); }\n            set { _itemTypeNameHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets whether this property's collection items are serialized as a reference.\n        /// </summary>\n        /// <value>Whether this property's collection items are serialized as a reference.</value>\n        public bool ItemIsReference\n        {\n            get { return _itemIsReference ?? default(bool); }\n            set { _itemIsReference = value; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonPropertyAttribute\"/> class.\n        /// </summary>\n        public JsonPropertyAttribute()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonPropertyAttribute\"/> class with the specified name.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        public JsonPropertyAttribute(string propertyName)\n        {\n            PropertyName = propertyName;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonReader.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Globalization;\nusing Newtonsoft.Json.Serialization;\nusing Newtonsoft.Json.Utilities;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Represents a reader that provides fast, non-cached, forward-only access to serialized Json data.\n    /// </summary>\n    public abstract class JsonReader : IDisposable\n    {\n        /// <summary>\n        /// Specifies the state of the reader.\n        /// </summary>\n        protected internal enum State\n        {\n            /// <summary>\n            /// The Read method has not been called.\n            /// </summary>\n            Start,\n\n            /// <summary>\n            /// The end of the file has been reached successfully.\n            /// </summary>\n            Complete,\n\n            /// <summary>\n            /// Reader is at a property.\n            /// </summary>\n            Property,\n\n            /// <summary>\n            /// Reader is at the start of an object.\n            /// </summary>\n            ObjectStart,\n\n            /// <summary>\n            /// Reader is in an object.\n            /// </summary>\n            Object,\n\n            /// <summary>\n            /// Reader is at the start of an array.\n            /// </summary>\n            ArrayStart,\n\n            /// <summary>\n            /// Reader is in an array.\n            /// </summary>\n            Array,\n\n            /// <summary>\n            /// The Close method has been called.\n            /// </summary>\n            Closed,\n\n            /// <summary>\n            /// Reader has just read a value.\n            /// </summary>\n            PostValue,\n\n            /// <summary>\n            /// Reader is at the start of a constructor.\n            /// </summary>\n            ConstructorStart,\n\n            /// <summary>\n            /// Reader in a constructor.\n            /// </summary>\n            Constructor,\n\n            /// <summary>\n            /// An error occurred that prevents the read operation from continuing.\n            /// </summary>\n            Error,\n\n            /// <summary>\n            /// The end of the file has been reached successfully.\n            /// </summary>\n            Finished\n        }\n\n        // current Token data\n        private JsonToken _tokenType;\n        private object _value;\n        internal char _quoteChar;\n        internal State _currentState;\n        internal ReadType _readType;\n        private JsonPosition _currentPosition;\n        private CultureInfo _culture;\n        private DateTimeZoneHandling _dateTimeZoneHandling;\n        private int? _maxDepth;\n        private bool _hasExceededMaxDepth;\n        internal DateParseHandling _dateParseHandling;\n        internal FloatParseHandling _floatParseHandling;\n        private string _dateFormatString;\n        private readonly List<JsonPosition> _stack;\n\n        /// <summary>\n        /// Gets the current reader state.\n        /// </summary>\n        /// <value>The current reader state.</value>\n        protected State CurrentState\n        {\n            get { return _currentState; }\n        }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the underlying stream or\n        /// <see cref=\"TextReader\"/> should be closed when the reader is closed.\n        /// </summary>\n        /// <value>\n        /// true to close the underlying stream or <see cref=\"TextReader\"/> when\n        /// the reader is closed; otherwise false. The default is true.\n        /// </value>\n        public bool CloseInput { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether multiple pieces of JSON content can\n        /// be read from a continuous stream without erroring.\n        /// </summary>\n        /// <value>\n        /// true to support reading multiple pieces of JSON content; otherwise false. The default is false.\n        /// </value>\n        public bool SupportMultipleContent { get; set; }\n\n        /// <summary>\n        /// Gets the quotation mark character used to enclose the value of a string.\n        /// </summary>\n        public virtual char QuoteChar\n        {\n            get { return _quoteChar; }\n            protected internal set { _quoteChar = value; }\n        }\n\n        /// <summary>\n        /// Get or set how <see cref=\"DateTime\"/> time zones are handling when reading JSON.\n        /// </summary>\n        public DateTimeZoneHandling DateTimeZoneHandling\n        {\n            get { return _dateTimeZoneHandling; }\n            set { _dateTimeZoneHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed when reading JSON.\n        /// </summary>\n        public DateParseHandling DateParseHandling\n        {\n            get { return _dateParseHandling; }\n            set { _dateParseHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text.\n        /// </summary>\n        public FloatParseHandling FloatParseHandling\n        {\n            get { return _floatParseHandling; }\n            set { _floatParseHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how custom date formatted strings are parsed when reading JSON.\n        /// </summary>\n        public string DateFormatString\n        {\n            get { return _dateFormatString; }\n            set { _dateFormatString = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a <see cref=\"JsonReaderException\"/>.\n        /// </summary>\n        public int? MaxDepth\n        {\n            get { return _maxDepth; }\n            set\n            {\n                if (value <= 0)\n                    throw new ArgumentException(\"Value must be positive.\", \"value\");\n\n                _maxDepth = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the type of the current JSON token. \n        /// </summary>\n        public virtual JsonToken TokenType\n        {\n            get { return _tokenType; }\n        }\n\n        /// <summary>\n        /// Gets the text value of the current JSON token.\n        /// </summary>\n        public virtual object Value\n        {\n            get { return _value; }\n        }\n\n        /// <summary>\n        /// Gets The Common Language Runtime (CLR) type for the current JSON token.\n        /// </summary>\n        public virtual Type ValueType\n        {\n            get { return (_value != null) ? _value.GetType() : null; }\n        }\n\n        /// <summary>\n        /// Gets the depth of the current token in the JSON document.\n        /// </summary>\n        /// <value>The depth of the current token in the JSON document.</value>\n        public virtual int Depth\n        {\n            get\n            {\n                int depth = _stack.Count;\n                if (IsStartToken(TokenType) || _currentPosition.Type == JsonContainerType.None)\n                    return depth;\n                else\n                    return depth + 1;\n            }\n        }\n\n        /// <summary>\n        /// Gets the path of the current JSON token. \n        /// </summary>\n        public virtual string Path\n        {\n            get\n            {\n                if (_currentPosition.Type == JsonContainerType.None)\n                    return string.Empty;\n\n                bool insideContainer = (_currentState != State.ArrayStart\n                                        && _currentState != State.ConstructorStart\n                                        && _currentState != State.ObjectStart);\n\n                IEnumerable<JsonPosition> positions = (!insideContainer)\n                    ? _stack\n                    : _stack.Concat(new[] { _currentPosition });\n\n                return JsonPosition.BuildPath(positions);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the culture used when reading JSON. Defaults to <see cref=\"CultureInfo.InvariantCulture\"/>.\n        /// </summary>\n        public CultureInfo Culture\n        {\n            get { return _culture ?? CultureInfo.InvariantCulture; }\n            set { _culture = value; }\n        }\n\n        internal JsonPosition GetPosition(int depth)\n        {\n            if (depth < _stack.Count)\n                return _stack[depth];\n\n            return _currentPosition;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonReader\"/> class with the specified <see cref=\"TextReader\"/>.\n        /// </summary>\n        protected JsonReader()\n        {\n            _currentState = State.Start;\n            _stack = new List<JsonPosition>(4);\n            _dateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;\n            _dateParseHandling = DateParseHandling.DateTime;\n            _floatParseHandling = FloatParseHandling.Double;\n\n            CloseInput = true;\n        }\n\n        private void Push(JsonContainerType value)\n        {\n            UpdateScopeWithFinishedValue();\n\n            if (_currentPosition.Type == JsonContainerType.None)\n            {\n                _currentPosition = new JsonPosition(value);\n            }\n            else\n            {\n                _stack.Add(_currentPosition);\n                _currentPosition = new JsonPosition(value);\n\n                // this is a little hacky because Depth increases when first property/value is written but only testing here is faster/simpler\n                if (_maxDepth != null && Depth + 1 > _maxDepth && !_hasExceededMaxDepth)\n                {\n                    _hasExceededMaxDepth = true;\n                    throw JsonReaderException.Create(this, \"The reader's MaxDepth of {0} has been exceeded.\".FormatWith(CultureInfo.InvariantCulture, _maxDepth));\n                }\n            }\n        }\n\n        private JsonContainerType Pop()\n        {\n            JsonPosition oldPosition;\n            if (_stack.Count > 0)\n            {\n                oldPosition = _currentPosition;\n                _currentPosition = _stack[_stack.Count - 1];\n                _stack.RemoveAt(_stack.Count - 1);\n            }\n            else\n            {\n                oldPosition = _currentPosition;\n                _currentPosition = new JsonPosition();\n            }\n\n            if (_maxDepth != null && Depth <= _maxDepth)\n                _hasExceededMaxDepth = false;\n\n            return oldPosition.Type;\n        }\n\n        private JsonContainerType Peek()\n        {\n            return _currentPosition.Type;\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream.\n        /// </summary>\n        /// <returns>true if the next token was read successfully; false if there are no more tokens to read.</returns>\n        public abstract bool Read();\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{Int32}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{Int32}\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public abstract int? ReadAsInt32();\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"String\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"String\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public abstract string ReadAsString();\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"T:Byte[]\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"T:Byte[]\"/> or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>\n        public abstract byte[] ReadAsBytes();\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{Decimal}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{Decimal}\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public abstract decimal? ReadAsDecimal();\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{DateTime}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"String\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public abstract DateTime? ReadAsDateTime();\n\n#if !NET20\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{DateTimeOffset}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{DateTimeOffset}\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public abstract DateTimeOffset? ReadAsDateTimeOffset();\n#endif\n\n        internal virtual bool ReadInternal()\n        {\n            throw new NotImplementedException();\n        }\n\n#if !NET20\n        internal DateTimeOffset? ReadAsDateTimeOffsetInternal()\n        {\n            _readType = ReadType.ReadAsDateTimeOffset;\n\n            JsonToken t;\n\n            do\n            {\n                if (!ReadInternal())\n                {\n                    SetToken(JsonToken.None);\n                    return null;\n                }\n                else\n                {\n                    t = TokenType;\n                }\n            } while (t == JsonToken.Comment);\n\n            if (t == JsonToken.Date)\n            {\n                if (Value is DateTime)\n                    SetToken(JsonToken.Date, new DateTimeOffset((DateTime)Value), false);\n\n                return (DateTimeOffset)Value;\n            }\n\n            if (t == JsonToken.Null)\n                return null;\n\n            DateTimeOffset dt;\n            if (t == JsonToken.String)\n            {\n                string s = (string)Value;\n                if (string.IsNullOrEmpty(s))\n                {\n                    SetToken(JsonToken.Null);\n                    return null;\n                }\n\n                object temp;\n                if (DateTimeUtils.TryParseDateTime(s, DateParseHandling.DateTimeOffset, DateTimeZoneHandling, _dateFormatString, Culture, out temp))\n                {\n                    dt = (DateTimeOffset)temp;\n                    SetToken(JsonToken.Date, dt, false);\n                    return dt;\n                }\n\n                if (DateTimeOffset.TryParse(s, Culture, DateTimeStyles.RoundtripKind, out dt))\n                {\n                    SetToken(JsonToken.Date, dt, false);\n                    return dt;\n                }\n                \n                throw JsonReaderException.Create(this, \"Could not convert string to DateTimeOffset: {0}.\".FormatWith(CultureInfo.InvariantCulture, Value));\n            }\n\n            if (t == JsonToken.EndArray)\n                return null;\n\n            throw JsonReaderException.Create(this, \"Error reading date. Unexpected token: {0}.\".FormatWith(CultureInfo.InvariantCulture, t));\n        }\n#endif\n\n        internal byte[] ReadAsBytesInternal()\n        {\n            _readType = ReadType.ReadAsBytes;\n\n            JsonToken t;\n\n            do\n            {\n                if (!ReadInternal())\n                {\n                    SetToken(JsonToken.None);\n                    return null;\n                }\n                else\n                {\n                    t = TokenType;\n                }\n            } while (t == JsonToken.Comment);\n\n            if (IsWrappedInTypeObject())\n            {\n                byte[] data = ReadAsBytes();\n                ReadInternal();\n                SetToken(JsonToken.Bytes, data, false);\n                return data;\n            }\n\n            // attempt to convert possible base 64 string to bytes\n            if (t == JsonToken.String)\n            {\n                string s = (string)Value;\n                byte[] data = (s.Length == 0) ? new byte[0] : Convert.FromBase64String(s);\n                SetToken(JsonToken.Bytes, data, false);\n                return data;\n            }\n\n            if (t == JsonToken.Null)\n                return null;\n\n            if (t == JsonToken.Bytes)\n                return (byte[])Value;\n\n            if (t == JsonToken.StartArray)\n            {\n                List<byte> data = new List<byte>();\n\n                while (ReadInternal())\n                {\n                    t = TokenType;\n                    switch (t)\n                    {\n                        case JsonToken.Integer:\n                            data.Add(Convert.ToByte(Value, CultureInfo.InvariantCulture));\n                            break;\n                        case JsonToken.EndArray:\n                            byte[] d = data.ToArray();\n                            SetToken(JsonToken.Bytes, d, false);\n                            return d;\n                        case JsonToken.Comment:\n                            // skip\n                            break;\n                        default:\n                            throw JsonReaderException.Create(this, \"Unexpected token when reading bytes: {0}.\".FormatWith(CultureInfo.InvariantCulture, t));\n                    }\n                }\n\n                throw JsonReaderException.Create(this, \"Unexpected end when reading bytes.\");\n            }\n\n            if (t == JsonToken.EndArray)\n                return null;\n\n            throw JsonReaderException.Create(this, \"Error reading bytes. Unexpected token: {0}.\".FormatWith(CultureInfo.InvariantCulture, t));\n        }\n\n        internal decimal? ReadAsDecimalInternal()\n        {\n            _readType = ReadType.ReadAsDecimal;\n\n            JsonToken t;\n\n            do\n            {\n                if (!ReadInternal())\n                {\n                    SetToken(JsonToken.None);\n                    return null;\n                }\n                else\n                {\n                    t = TokenType;\n                }\n            } while (t == JsonToken.Comment);\n\n            if (t == JsonToken.Integer || t == JsonToken.Float)\n            {\n                if (!(Value is decimal))\n                    SetToken(JsonToken.Float, Convert.ToDecimal(Value, CultureInfo.InvariantCulture), false);\n\n                return (decimal)Value;\n            }\n\n            if (t == JsonToken.Null)\n                return null;\n\n            decimal d;\n            if (t == JsonToken.String)\n            {\n                string s = (string)Value;\n                if (string.IsNullOrEmpty(s))\n                {\n                    SetToken(JsonToken.Null);\n                    return null;\n                }\n\n                if (decimal.TryParse(s, NumberStyles.Number, Culture, out d))\n                {\n                    SetToken(JsonToken.Float, d, false);\n                    return d;\n                }\n                else\n                {\n                    throw JsonReaderException.Create(this, \"Could not convert string to decimal: {0}.\".FormatWith(CultureInfo.InvariantCulture, Value));\n                }\n            }\n\n            if (t == JsonToken.EndArray)\n                return null;\n\n            throw JsonReaderException.Create(this, \"Error reading decimal. Unexpected token: {0}.\".FormatWith(CultureInfo.InvariantCulture, t));\n        }\n\n        internal int? ReadAsInt32Internal()\n        {\n            _readType = ReadType.ReadAsInt32;\n\n            JsonToken t;\n\n            do\n            {\n                if (!ReadInternal())\n                {\n                    SetToken(JsonToken.None);\n                    return null;\n                }\n                else\n                {\n                    t = TokenType;\n                }\n            } while (t == JsonToken.Comment);\n\n            if (t == JsonToken.Integer || t == JsonToken.Float)\n            {\n                if (!(Value is int))\n                    SetToken(JsonToken.Integer, Convert.ToInt32(Value, CultureInfo.InvariantCulture), false);\n\n                return (int)Value;\n            }\n\n            if (t == JsonToken.Null)\n                return null;\n\n            int i;\n            if (t == JsonToken.String)\n            {\n                string s = (string)Value;\n                if (string.IsNullOrEmpty(s))\n                {\n                    SetToken(JsonToken.Null);\n                    return null;\n                }\n\n                if (int.TryParse(s, NumberStyles.Integer, Culture, out i))\n                {\n                    SetToken(JsonToken.Integer, i, false);\n                    return i;\n                }\n                else\n                {\n                    throw JsonReaderException.Create(this, \"Could not convert string to integer: {0}.\".FormatWith(CultureInfo.InvariantCulture, Value));\n                }\n            }\n\n            if (t == JsonToken.EndArray)\n                return null;\n\n            throw JsonReaderException.Create(this, \"Error reading integer. Unexpected token: {0}.\".FormatWith(CultureInfo.InvariantCulture, TokenType));\n        }\n\n        internal string ReadAsStringInternal()\n        {\n            _readType = ReadType.ReadAsString;\n\n            JsonToken t;\n\n            do\n            {\n                if (!ReadInternal())\n                {\n                    SetToken(JsonToken.None);\n                    return null;\n                }\n                else\n                {\n                    t = TokenType;\n                }\n            } while (t == JsonToken.Comment);\n\n            if (t == JsonToken.String)\n                return (string)Value;\n\n            if (t == JsonToken.Null)\n                return null;\n\n            if (IsPrimitiveToken(t))\n            {\n                if (Value != null)\n                {\n                    string s;\n                    if (Value is IFormattable)\n                        s = ((IFormattable)Value).ToString(null, Culture);\n                    else\n                        s = Value.ToString();\n\n                    SetToken(JsonToken.String, s, false);\n                    return s;\n                }\n            }\n\n            if (t == JsonToken.EndArray)\n                return null;\n\n            throw JsonReaderException.Create(this, \"Error reading string. Unexpected token: {0}.\".FormatWith(CultureInfo.InvariantCulture, t));\n        }\n\n        internal DateTime? ReadAsDateTimeInternal()\n        {\n            _readType = ReadType.ReadAsDateTime;\n\n            do\n            {\n                if (!ReadInternal())\n                {\n                    SetToken(JsonToken.None);\n                    return null;\n                }\n            } while (TokenType == JsonToken.Comment);\n\n            if (TokenType == JsonToken.Date)\n                return (DateTime)Value;\n\n            if (TokenType == JsonToken.Null)\n                return null;\n\n            DateTime dt;\n            if (TokenType == JsonToken.String)\n            {\n                string s = (string)Value;\n                if (string.IsNullOrEmpty(s))\n                {\n                    SetToken(JsonToken.Null);\n                    return null;\n                }\n\n                object temp;\n                if (DateTimeUtils.TryParseDateTime(s, DateParseHandling.DateTime, DateTimeZoneHandling, _dateFormatString, Culture, out temp))\n                {\n                    dt = (DateTime)temp;\n                    dt = DateTimeUtils.EnsureDateTime(dt, DateTimeZoneHandling);\n                    SetToken(JsonToken.Date, dt, false);\n                    return dt;\n                }\n\n                if (DateTime.TryParse(s, Culture, DateTimeStyles.RoundtripKind, out dt))\n                {\n                    dt = DateTimeUtils.EnsureDateTime(dt, DateTimeZoneHandling);\n                    SetToken(JsonToken.Date, dt, false);\n                    return dt;\n                }\n\n                throw JsonReaderException.Create(this, \"Could not convert string to DateTime: {0}.\".FormatWith(CultureInfo.InvariantCulture, Value));\n            }\n\n            if (TokenType == JsonToken.EndArray)\n                return null;\n\n            throw JsonReaderException.Create(this, \"Error reading date. Unexpected token: {0}.\".FormatWith(CultureInfo.InvariantCulture, TokenType));\n        }\n\n        private bool IsWrappedInTypeObject()\n        {\n            _readType = ReadType.Read;\n\n            if (TokenType == JsonToken.StartObject)\n            {\n                if (!ReadInternal())\n                    throw JsonReaderException.Create(this, \"Unexpected end when reading bytes.\");\n\n                if (Value.ToString() == JsonTypeReflector.TypePropertyName)\n                {\n                    ReadInternal();\n                    if (Value != null && Value.ToString().StartsWith(\"System.Byte[]\"))\n                    {\n                        ReadInternal();\n                        if (Value.ToString() == JsonTypeReflector.ValuePropertyName)\n                        {\n                            return true;\n                        }\n                    }\n                }\n\n                throw JsonReaderException.Create(this, \"Error reading bytes. Unexpected token: {0}.\".FormatWith(CultureInfo.InvariantCulture, JsonToken.StartObject));\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Skips the children of the current token.\n        /// </summary>\n        public void Skip()\n        {\n            if (TokenType == JsonToken.PropertyName)\n                Read();\n\n            if (IsStartToken(TokenType))\n            {\n                int depth = Depth;\n\n                while (Read() && (depth < Depth))\n                {\n                }\n            }\n        }\n\n        /// <summary>\n        /// Sets the current token.\n        /// </summary>\n        /// <param name=\"newToken\">The new token.</param>\n        protected void SetToken(JsonToken newToken)\n        {\n            SetToken(newToken, null, true);\n        }\n\n        /// <summary>\n        /// Sets the current token and value.\n        /// </summary>\n        /// <param name=\"newToken\">The new token.</param>\n        /// <param name=\"value\">The value.</param>\n        protected void SetToken(JsonToken newToken, object value)\n        {\n            SetToken(newToken, value, true);\n        }\n\n        internal void SetToken(JsonToken newToken, object value, bool updateIndex)\n        {\n            _tokenType = newToken;\n            _value = value;\n\n            switch (newToken)\n            {\n                case JsonToken.StartObject:\n                    _currentState = State.ObjectStart;\n                    Push(JsonContainerType.Object);\n                    break;\n                case JsonToken.StartArray:\n                    _currentState = State.ArrayStart;\n                    Push(JsonContainerType.Array);\n                    break;\n                case JsonToken.StartConstructor:\n                    _currentState = State.ConstructorStart;\n                    Push(JsonContainerType.Constructor);\n                    break;\n                case JsonToken.EndObject:\n                    ValidateEnd(JsonToken.EndObject);\n                    break;\n                case JsonToken.EndArray:\n                    ValidateEnd(JsonToken.EndArray);\n                    break;\n                case JsonToken.EndConstructor:\n                    ValidateEnd(JsonToken.EndConstructor);\n                    break;\n                case JsonToken.PropertyName:\n                    _currentState = State.Property;\n\n                    _currentPosition.PropertyName = (string)value;\n                    break;\n                case JsonToken.Undefined:\n                case JsonToken.Integer:\n                case JsonToken.Float:\n                case JsonToken.Boolean:\n                case JsonToken.Null:\n                case JsonToken.Date:\n                case JsonToken.String:\n                case JsonToken.Raw:\n                case JsonToken.Bytes:\n                    if (Peek() != JsonContainerType.None)\n                        _currentState = State.PostValue;\n                    else\n                        SetFinished();\n\n                    if (updateIndex)\n                        UpdateScopeWithFinishedValue();\n                    break;\n            }\n        }\n\n        private void UpdateScopeWithFinishedValue()\n        {\n            if (_currentPosition.HasIndex)\n                _currentPosition.Position++;\n        }\n\n        private void ValidateEnd(JsonToken endToken)\n        {\n            JsonContainerType currentObject = Pop();\n\n            if (GetTypeForCloseToken(endToken) != currentObject)\n                throw JsonReaderException.Create(this, \"JsonToken {0} is not valid for closing JsonType {1}.\".FormatWith(CultureInfo.InvariantCulture, endToken, currentObject));\n\n            if (Peek() != JsonContainerType.None)\n                _currentState = State.PostValue;\n            else\n                SetFinished();\n        }\n\n        /// <summary>\n        /// Sets the state based on current token type.\n        /// </summary>\n        protected void SetStateBasedOnCurrent()\n        {\n            JsonContainerType currentObject = Peek();\n\n            switch (currentObject)\n            {\n                case JsonContainerType.Object:\n                    _currentState = State.Object;\n                    break;\n                case JsonContainerType.Array:\n                    _currentState = State.Array;\n                    break;\n                case JsonContainerType.Constructor:\n                    _currentState = State.Constructor;\n                    break;\n                case JsonContainerType.None:\n                    SetFinished();\n                    break;\n                default:\n                    throw JsonReaderException.Create(this, \"While setting the reader state back to current object an unexpected JsonType was encountered: {0}\".FormatWith(CultureInfo.InvariantCulture, currentObject));\n            }\n        }\n\n        private void SetFinished()\n        {\n            if (SupportMultipleContent)\n                _currentState = State.Start;\n            else\n                _currentState = State.Finished;\n        }\n\n        internal static bool IsPrimitiveToken(JsonToken token)\n        {\n            switch (token)\n            {\n                case JsonToken.Integer:\n                case JsonToken.Float:\n                case JsonToken.String:\n                case JsonToken.Boolean:\n                case JsonToken.Undefined:\n                case JsonToken.Null:\n                case JsonToken.Date:\n                case JsonToken.Bytes:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n\n        internal static bool IsStartToken(JsonToken token)\n        {\n            switch (token)\n            {\n                case JsonToken.StartObject:\n                case JsonToken.StartArray:\n                case JsonToken.StartConstructor:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n\n        private JsonContainerType GetTypeForCloseToken(JsonToken token)\n        {\n            switch (token)\n            {\n                case JsonToken.EndObject:\n                    return JsonContainerType.Object;\n                case JsonToken.EndArray:\n                    return JsonContainerType.Array;\n                case JsonToken.EndConstructor:\n                    return JsonContainerType.Constructor;\n                default:\n                    throw JsonReaderException.Create(this, \"Not a valid close JsonToken: {0}\".FormatWith(CultureInfo.InvariantCulture, token));\n            }\n        }\n\n        /// <summary>\n        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n        /// </summary>\n        void IDisposable.Dispose()\n        {\n            Dispose(true);\n        }\n\n        /// <summary>\n        /// Releases unmanaged and - optionally - managed resources\n        /// </summary>\n        /// <param name=\"disposing\"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>\n        protected virtual void Dispose(bool disposing)\n        {\n            if (_currentState != State.Closed && disposing)\n                Close();\n        }\n\n        /// <summary>\n        /// Changes the <see cref=\"State\"/> to Closed. \n        /// </summary>\n        public virtual void Close()\n        {\n            _currentState = State.Closed;\n            _tokenType = JsonToken.None;\n            _value = null;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonReaderException.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Globalization;\nusing System.Runtime.Serialization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// The exception thrown when an error occurs while reading Json text.\n    /// </summary>\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n    [Serializable]\n#endif\n    public class JsonReaderException : JsonException\n    {\n        /// <summary>\n        /// Gets the line number indicating where the error occurred.\n        /// </summary>\n        /// <value>The line number indicating where the error occurred.</value>\n        public int LineNumber { get; private set; }\n\n        /// <summary>\n        /// Gets the line position indicating where the error occurred.\n        /// </summary>\n        /// <value>The line position indicating where the error occurred.</value>\n        public int LinePosition { get; private set; }\n\n        /// <summary>\n        /// Gets the path to the JSON where the error occurred.\n        /// </summary>\n        /// <value>The path to the JSON where the error occurred.</value>\n        public string Path { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonReaderException\"/> class.\n        /// </summary>\n        public JsonReaderException()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonReaderException\"/> class\n        /// with a specified error message.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        public JsonReaderException(string message)\n            : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonReaderException\"/> class\n        /// with a specified error message and a reference to the inner exception that is the cause of this exception.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>\n        public JsonReaderException(string message, Exception innerException)\n            : base(message, innerException)\n        {\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonReaderException\"/> class.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">The <paramref name=\"info\"/> parameter is null. </exception>\n        /// <exception cref=\"T:System.Runtime.Serialization.SerializationException\">The class name is null or <see cref=\"P:System.Exception.HResult\"/> is zero (0). </exception>\n        public JsonReaderException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n#endif\n\n        internal JsonReaderException(string message, Exception innerException, string path, int lineNumber, int linePosition)\n            : base(message, innerException)\n        {\n            Path = path;\n            LineNumber = lineNumber;\n            LinePosition = linePosition;\n        }\n\n        internal static JsonReaderException Create(JsonReader reader, string message)\n        {\n            return Create(reader, message, null);\n        }\n\n        internal static JsonReaderException Create(JsonReader reader, string message, Exception ex)\n        {\n            return Create(reader as IJsonLineInfo, reader.Path, message, ex);\n        }\n\n        internal static JsonReaderException Create(IJsonLineInfo lineInfo, string path, string message, Exception ex)\n        {\n            message = JsonPosition.FormatMessage(lineInfo, path, message);\n\n            int lineNumber;\n            int linePosition;\n            if (lineInfo != null && lineInfo.HasLineInfo())\n            {\n                lineNumber = lineInfo.LineNumber;\n                linePosition = lineInfo.LinePosition;\n            }\n            else\n            {\n                lineNumber = 0;\n                linePosition = 0;\n            }\n\n            return new JsonReaderException(message, ex, path, lineNumber, linePosition);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonSerializationException.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.Serialization;\nusing System.Text;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// The exception thrown when an error occurs during Json serialization or deserialization.\n    /// </summary>\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n    [Serializable]\n#endif\n    public class JsonSerializationException : JsonException\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSerializationException\"/> class.\n        /// </summary>\n        public JsonSerializationException()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSerializationException\"/> class\n        /// with a specified error message.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        public JsonSerializationException(string message)\n            : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSerializationException\"/> class\n        /// with a specified error message and a reference to the inner exception that is the cause of this exception.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>\n        public JsonSerializationException(string message, Exception innerException)\n            : base(message, innerException)\n        {\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSerializationException\"/> class.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">The <paramref name=\"info\"/> parameter is null. </exception>\n        /// <exception cref=\"T:System.Runtime.Serialization.SerializationException\">The class name is null or <see cref=\"P:System.Exception.HResult\"/> is zero (0). </exception>\n        public JsonSerializationException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n#endif\n\n        internal static JsonSerializationException Create(JsonReader reader, string message)\n        {\n            return Create(reader, message, null);\n        }\n\n        internal static JsonSerializationException Create(JsonReader reader, string message, Exception ex)\n        {\n            return Create(reader as IJsonLineInfo, reader.Path, message, ex);\n        }\n\n        internal static JsonSerializationException Create(IJsonLineInfo lineInfo, string path, string message, Exception ex)\n        {\n            message = JsonPosition.FormatMessage(lineInfo, path, message);\n\n            return new JsonSerializationException(message, ex);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonSerializer.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Runtime.Serialization.Formatters;\nusing Newtonsoft.Json.Converters;\nusing Newtonsoft.Json.Serialization;\nusing Newtonsoft.Json.Utilities;\nusing System.Runtime.Serialization;\nusing ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Serializes and deserializes objects into and from the JSON format.\n    /// The <see cref=\"JsonSerializer\"/> enables you to control how objects are encoded into JSON.\n    /// </summary>\n    public class JsonSerializer\n    {\n        #region Properties_binder\n        internal TypeNameHandling _typeNameHandling;\n        internal FormatterAssemblyStyle _typeNameAssemblyFormat;\n        internal PreserveReferencesHandling _preserveReferencesHandling;\n        internal ReferenceLoopHandling _referenceLoopHandling;\n        internal MissingMemberHandling _missingMemberHandling;\n        internal ObjectCreationHandling _objectCreationHandling;\n        internal NullValueHandling _nullValueHandling;\n        internal DefaultValueHandling _defaultValueHandling;\n        internal ConstructorHandling _constructorHandling;\n        internal MetadataPropertyHandling _metadataPropertyHandling;\n        internal JsonConverterCollection _converters;\n        internal IContractResolver _contractResolver;\n        internal ITraceWriter _traceWriter;\n        internal SerializationBinder _binder;\n        internal StreamingContext _context;\n        private IReferenceResolver _referenceResolver;\n\n        private Formatting? _formatting;\n        private DateFormatHandling? _dateFormatHandling;\n        private DateTimeZoneHandling? _dateTimeZoneHandling;\n        private DateParseHandling? _dateParseHandling;\n        private FloatFormatHandling? _floatFormatHandling;\n        private FloatParseHandling? _floatParseHandling;\n        private StringEscapeHandling? _stringEscapeHandling;\n        private CultureInfo _culture;\n        private int? _maxDepth;\n        private bool _maxDepthSet;\n        private bool? _checkAdditionalContent;\n        private string _dateFormatString;\n        private bool _dateFormatStringSet;\n\n        /// <summary>\n        /// Occurs when the <see cref=\"JsonSerializer\"/> errors during serialization and deserialization.\n        /// </summary>\n        public virtual event EventHandler<ErrorEventArgs> Error;\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"IReferenceResolver\"/> used by the serializer when resolving references.\n        /// </summary>\n        public virtual IReferenceResolver ReferenceResolver\n        {\n            get { return GetReferenceResolver(); }\n            set\n            {\n                if (value == null)\n                    throw new ArgumentNullException(\"value\", \"Reference resolver cannot be null.\");\n\n                _referenceResolver = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"SerializationBinder\"/> used by the serializer when resolving type names.\n        /// </summary>\n        public virtual SerializationBinder Binder\n        {\n            get { return _binder; }\n            set\n            {\n                if (value == null)\n                    throw new ArgumentNullException(\"value\", \"Serialization binder cannot be null.\");\n\n                _binder = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"ITraceWriter\"/> used by the serializer when writing trace messages.\n        /// </summary>\n        /// <value>The trace writer.</value>\n        public virtual ITraceWriter TraceWriter\n        {\n            get { return _traceWriter; }\n            set { _traceWriter = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets how type name writing and reading is handled by the serializer.\n        /// </summary>\n        public virtual TypeNameHandling TypeNameHandling\n        {\n            get { return _typeNameHandling; }\n            set\n            {\n                if (value < TypeNameHandling.None || value > TypeNameHandling.Auto)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                _typeNameHandling = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets how a type name assembly is written and resolved by the serializer.\n        /// </summary>\n        /// <value>The type name assembly format.</value>\n        public virtual FormatterAssemblyStyle TypeNameAssemblyFormat\n        {\n            get { return _typeNameAssemblyFormat; }\n            set\n            {\n                if (value < FormatterAssemblyStyle.Simple || value > FormatterAssemblyStyle.Full)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                _typeNameAssemblyFormat = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets how object references are preserved by the serializer.\n        /// </summary>\n        public virtual PreserveReferencesHandling PreserveReferencesHandling\n        {\n            get { return _preserveReferencesHandling; }\n            set\n            {\n                if (value < PreserveReferencesHandling.None || value > PreserveReferencesHandling.All)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                _preserveReferencesHandling = value;\n            }\n        }\n\n        /// <summary>\n        /// Get or set how reference loops (e.g. a class referencing itself) is handled.\n        /// </summary>\n        public virtual ReferenceLoopHandling ReferenceLoopHandling\n        {\n            get { return _referenceLoopHandling; }\n            set\n            {\n                if (value < ReferenceLoopHandling.Error || value > ReferenceLoopHandling.Serialize)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                _referenceLoopHandling = value;\n            }\n        }\n\n        /// <summary>\n        /// Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization.\n        /// </summary>\n        public virtual MissingMemberHandling MissingMemberHandling\n        {\n            get { return _missingMemberHandling; }\n            set\n            {\n                if (value < MissingMemberHandling.Ignore || value > MissingMemberHandling.Error)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                _missingMemberHandling = value;\n            }\n        }\n\n        /// <summary>\n        /// Get or set how null values are handled during serialization and deserialization.\n        /// </summary>\n        public virtual NullValueHandling NullValueHandling\n        {\n            get { return _nullValueHandling; }\n            set\n            {\n                if (value < NullValueHandling.Include || value > NullValueHandling.Ignore)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                _nullValueHandling = value;\n            }\n        }\n\n        /// <summary>\n        /// Get or set how null default are handled during serialization and deserialization.\n        /// </summary>\n        public virtual DefaultValueHandling DefaultValueHandling\n        {\n            get { return _defaultValueHandling; }\n            set\n            {\n                if (value < DefaultValueHandling.Include || value > DefaultValueHandling.IgnoreAndPopulate)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                _defaultValueHandling = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets how objects are created during deserialization.\n        /// </summary>\n        /// <value>The object creation handling.</value>\n        public virtual ObjectCreationHandling ObjectCreationHandling\n        {\n            get { return _objectCreationHandling; }\n            set\n            {\n                if (value < ObjectCreationHandling.Auto || value > ObjectCreationHandling.Replace)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                _objectCreationHandling = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets how constructors are used during deserialization.\n        /// </summary>\n        /// <value>The constructor handling.</value>\n        public virtual ConstructorHandling ConstructorHandling\n        {\n            get { return _constructorHandling; }\n            set\n            {\n                if (value < ConstructorHandling.Default || value > ConstructorHandling.AllowNonPublicDefaultConstructor)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                _constructorHandling = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets how metadata properties are used during deserialization.\n        /// </summary>\n        /// <value>The metadata properties handling.</value>\n        public virtual MetadataPropertyHandling MetadataPropertyHandling\n        {\n            get { return _metadataPropertyHandling; }\n            set\n            {\n                if (value < MetadataPropertyHandling.Default || value > MetadataPropertyHandling.ReadAhead)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                _metadataPropertyHandling = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets a collection <see cref=\"JsonConverter\"/> that will be used during serialization.\n        /// </summary>\n        /// <value>Collection <see cref=\"JsonConverter\"/> that will be used during serialization.</value>\n        public virtual JsonConverterCollection Converters\n        {\n            get\n            {\n                if (_converters == null)\n                    _converters = new JsonConverterCollection();\n\n                return _converters;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the contract resolver used by the serializer when\n        /// serializing .NET objects to JSON and vice versa.\n        /// </summary>\n        public virtual IContractResolver ContractResolver\n        {\n            get { return _contractResolver; }\n            set { _contractResolver = value ?? DefaultContractResolver.Instance; }\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"StreamingContext\"/> used by the serializer when invoking serialization callback methods.\n        /// </summary>\n        /// <value>The context.</value>\n        public virtual StreamingContext Context\n        {\n            get { return _context; }\n            set { _context = value; }\n        }\n\n        /// <summary>\n        /// Indicates how JSON text output is formatted.\n        /// </summary>\n        public virtual Formatting Formatting\n        {\n            get { return _formatting ?? JsonSerializerSettings.DefaultFormatting; }\n            set { _formatting = value; }\n        }\n\n        /// <summary>\n        /// Get or set how dates are written to JSON text.\n        /// </summary>\n        public virtual DateFormatHandling DateFormatHandling\n        {\n            get { return _dateFormatHandling ?? JsonSerializerSettings.DefaultDateFormatHandling; }\n            set { _dateFormatHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how <see cref=\"DateTime\"/> time zones are handling during serialization and deserialization.\n        /// </summary>\n        public virtual DateTimeZoneHandling DateTimeZoneHandling\n        {\n            get { return _dateTimeZoneHandling ?? JsonSerializerSettings.DefaultDateTimeZoneHandling; }\n            set { _dateTimeZoneHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed when reading JSON.\n        /// </summary>\n        public virtual DateParseHandling DateParseHandling\n        {\n            get { return _dateParseHandling ?? JsonSerializerSettings.DefaultDateParseHandling; }\n            set { _dateParseHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text.\n        /// </summary>\n        public virtual FloatParseHandling FloatParseHandling\n        {\n            get { return _floatParseHandling ?? JsonSerializerSettings.DefaultFloatParseHandling; }\n            set { _floatParseHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how special floating point numbers, e.g. <see cref=\"F:System.Double.NaN\"/>,\n        /// <see cref=\"F:System.Double.PositiveInfinity\"/> and <see cref=\"F:System.Double.NegativeInfinity\"/>,\n        /// are written as JSON text.\n        /// </summary>\n        public virtual FloatFormatHandling FloatFormatHandling\n        {\n            get { return _floatFormatHandling ?? JsonSerializerSettings.DefaultFloatFormatHandling; }\n            set { _floatFormatHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how strings are escaped when writing JSON text.\n        /// </summary>\n        public virtual StringEscapeHandling StringEscapeHandling\n        {\n            get { return _stringEscapeHandling ?? JsonSerializerSettings.DefaultStringEscapeHandling; }\n            set { _stringEscapeHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how <see cref=\"DateTime\"/> and <see cref=\"DateTimeOffset\"/> values are formatting when writing JSON text.\n        /// </summary>\n        public virtual string DateFormatString\n        {\n            get { return _dateFormatString ?? JsonSerializerSettings.DefaultDateFormatString; }\n            set\n            {\n                _dateFormatString = value;\n                _dateFormatStringSet = true;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the culture used when reading JSON. Defaults to <see cref=\"CultureInfo.InvariantCulture\"/>.\n        /// </summary>\n        public virtual CultureInfo Culture\n        {\n            get { return _culture ?? JsonSerializerSettings.DefaultCulture; }\n            set { _culture = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a <see cref=\"JsonReaderException\"/>.\n        /// </summary>\n        public virtual int? MaxDepth\n        {\n            get { return _maxDepth; }\n            set\n            {\n                if (value <= 0)\n                    throw new ArgumentException(\"Value must be positive.\", \"value\");\n\n                _maxDepth = value;\n                _maxDepthSet = true;\n            }\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether there will be a check for additional JSON content after deserializing an object.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if there will be a check for additional JSON content after deserializing an object; otherwise, <c>false</c>.\n        /// </value>\n        public virtual bool CheckAdditionalContent\n        {\n            get { return _checkAdditionalContent ?? JsonSerializerSettings.DefaultCheckAdditionalContent; }\n            set { _checkAdditionalContent = value; }\n        }\n\n        internal bool IsCheckAdditionalContentSet()\n        {\n            return (_checkAdditionalContent != null);\n        }\n        #endregion\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSerializer\"/> class.\n        /// </summary>\n        public JsonSerializer()\n        {\n            _referenceLoopHandling = JsonSerializerSettings.DefaultReferenceLoopHandling;\n            _missingMemberHandling = JsonSerializerSettings.DefaultMissingMemberHandling;\n            _nullValueHandling = JsonSerializerSettings.DefaultNullValueHandling;\n            _defaultValueHandling = JsonSerializerSettings.DefaultDefaultValueHandling;\n            _objectCreationHandling = JsonSerializerSettings.DefaultObjectCreationHandling;\n            _preserveReferencesHandling = JsonSerializerSettings.DefaultPreserveReferencesHandling;\n            _constructorHandling = JsonSerializerSettings.DefaultConstructorHandling;\n            _typeNameHandling = JsonSerializerSettings.DefaultTypeNameHandling;\n            _metadataPropertyHandling = JsonSerializerSettings.DefaultMetadataPropertyHandling;\n            _context = JsonSerializerSettings.DefaultContext;\n            _binder = DefaultSerializationBinder.Instance;\n\n            _culture = JsonSerializerSettings.DefaultCulture;\n            _contractResolver = DefaultContractResolver.Instance;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"JsonSerializer\"/> instance.\n        /// The <see cref=\"JsonSerializer\"/> will not use default settings.\n        /// </summary>\n        /// <returns>\n        /// A new <see cref=\"JsonSerializer\"/> instance.\n        /// The <see cref=\"JsonSerializer\"/> will not use default settings.\n        /// </returns>\n        public static JsonSerializer Create()\n        {\n            return new JsonSerializer();\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"JsonSerializer\"/> instance using the specified <see cref=\"JsonSerializerSettings\"/>.\n        /// The <see cref=\"JsonSerializer\"/> will not use default settings.\n        /// </summary>\n        /// <param name=\"settings\">The settings to be applied to the <see cref=\"JsonSerializer\"/>.</param>\n        /// <returns>\n        /// A new <see cref=\"JsonSerializer\"/> instance using the specified <see cref=\"JsonSerializerSettings\"/>.\n        /// The <see cref=\"JsonSerializer\"/> will not use default settings.\n        /// </returns>\n        public static JsonSerializer Create(JsonSerializerSettings settings)\n        {\n            JsonSerializer serializer = Create();\n\n            if (settings != null)\n                ApplySerializerSettings(serializer, settings);\n\n            return serializer;\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"JsonSerializer\"/> instance.\n        /// The <see cref=\"JsonSerializer\"/> will use default settings.\n        /// </summary>\n        /// <returns>\n        /// A new <see cref=\"JsonSerializer\"/> instance.\n        /// The <see cref=\"JsonSerializer\"/> will use default settings.\n        /// </returns>\n        public static JsonSerializer CreateDefault()\n        {\n            // copy static to local variable to avoid concurrency issues\n            Func<JsonSerializerSettings> defaultSettingsCreator = JsonConvert.DefaultSettings;\n            JsonSerializerSettings defaultSettings = (defaultSettingsCreator != null) ? defaultSettingsCreator() : null;\n\n            return Create(defaultSettings);\n        }\n\n        /// <summary>\n        /// Creates a new <see cref=\"JsonSerializer\"/> instance using the specified <see cref=\"JsonSerializerSettings\"/>.\n        /// The <see cref=\"JsonSerializer\"/> will use default settings.\n        /// </summary>\n        /// <param name=\"settings\">The settings to be applied to the <see cref=\"JsonSerializer\"/>.</param>\n        /// <returns>\n        /// A new <see cref=\"JsonSerializer\"/> instance using the specified <see cref=\"JsonSerializerSettings\"/>.\n        /// The <see cref=\"JsonSerializer\"/> will use default settings.\n        /// </returns>\n        public static JsonSerializer CreateDefault(JsonSerializerSettings settings)\n        {\n            JsonSerializer serializer = CreateDefault();\n            if (settings != null)\n                ApplySerializerSettings(serializer, settings);\n\n            return serializer;\n        }\n\n        private static void ApplySerializerSettings(JsonSerializer serializer, JsonSerializerSettings settings)\n        {\n            if (!CollectionUtils.IsNullOrEmpty(settings.Converters))\n            {\n                // insert settings converters at the beginning so they take precedence\n                // if user wants to remove one of the default converters they will have to do it manually\n                for (int i = 0; i < settings.Converters.Count; i++)\n                {\n                    serializer.Converters.Insert(i, settings.Converters[i]);\n                }\n            }\n\n            // serializer specific\n            if (settings._typeNameHandling != null)\n                serializer.TypeNameHandling = settings.TypeNameHandling;\n            if (settings._metadataPropertyHandling != null)\n                serializer.MetadataPropertyHandling = settings.MetadataPropertyHandling;\n            if (settings._typeNameAssemblyFormat != null)\n                serializer.TypeNameAssemblyFormat = settings.TypeNameAssemblyFormat;\n            if (settings._preserveReferencesHandling != null)\n                serializer.PreserveReferencesHandling = settings.PreserveReferencesHandling;\n            if (settings._referenceLoopHandling != null)\n                serializer.ReferenceLoopHandling = settings.ReferenceLoopHandling;\n            if (settings._missingMemberHandling != null)\n                serializer.MissingMemberHandling = settings.MissingMemberHandling;\n            if (settings._objectCreationHandling != null)\n                serializer.ObjectCreationHandling = settings.ObjectCreationHandling;\n            if (settings._nullValueHandling != null)\n                serializer.NullValueHandling = settings.NullValueHandling;\n            if (settings._defaultValueHandling != null)\n                serializer.DefaultValueHandling = settings.DefaultValueHandling;\n            if (settings._constructorHandling != null)\n                serializer.ConstructorHandling = settings.ConstructorHandling;\n            if (settings._context != null)\n                serializer.Context = settings.Context;\n            if (settings._checkAdditionalContent != null)\n                serializer._checkAdditionalContent = settings._checkAdditionalContent;\n\n            if (settings.Error != null)\n                serializer.Error += settings.Error;\n\n            if (settings.ContractResolver != null)\n                serializer.ContractResolver = settings.ContractResolver;\n            if (settings.ReferenceResolver != null)\n                serializer.ReferenceResolver = settings.ReferenceResolver;\n            if (settings.TraceWriter != null)\n                serializer.TraceWriter = settings.TraceWriter;\n            if (settings.Binder != null)\n                serializer.Binder = settings.Binder;\n\n            // reader/writer specific\n            // unset values won't override reader/writer set values\n            if (settings._formatting != null)\n                serializer._formatting = settings._formatting;\n            if (settings._dateFormatHandling != null)\n                serializer._dateFormatHandling = settings._dateFormatHandling;\n            if (settings._dateTimeZoneHandling != null)\n                serializer._dateTimeZoneHandling = settings._dateTimeZoneHandling;\n            if (settings._dateParseHandling != null)\n                serializer._dateParseHandling = settings._dateParseHandling;\n            if (settings._dateFormatStringSet)\n            {\n                serializer._dateFormatString = settings._dateFormatString;\n                serializer._dateFormatStringSet = settings._dateFormatStringSet;\n            }\n            if (settings._floatFormatHandling != null)\n                serializer._floatFormatHandling = settings._floatFormatHandling;\n            if (settings._floatParseHandling != null)\n                serializer._floatParseHandling = settings._floatParseHandling;\n            if (settings._stringEscapeHandling != null)\n                serializer._stringEscapeHandling = settings._stringEscapeHandling;\n            if (settings._culture != null)\n                serializer._culture = settings._culture;\n            if (settings._maxDepthSet)\n            {\n                serializer._maxDepth = settings._maxDepth;\n                serializer._maxDepthSet = settings._maxDepthSet;\n            }\n        }\n\n        /// <summary>\n        /// Populates the JSON values onto the target object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"TextReader\"/> that contains the JSON structure to reader values from.</param>\n        /// <param name=\"target\">The target object to populate values onto.</param>\n        public void Populate(TextReader reader, object target)\n        {\n            Populate(new JsonTextReader(reader), target);\n        }\n\n        /// <summary>\n        /// Populates the JSON values onto the target object.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> that contains the JSON structure to reader values from.</param>\n        /// <param name=\"target\">The target object to populate values onto.</param>\n        public void Populate(JsonReader reader, object target)\n        {\n            PopulateInternal(reader, target);\n        }\n\n        internal virtual void PopulateInternal(JsonReader reader, object target)\n        {\n            ValidationUtils.ArgumentNotNull(reader, \"reader\");\n            ValidationUtils.ArgumentNotNull(target, \"target\");\n\n            JsonSerializerInternalReader serializerReader = new JsonSerializerInternalReader(this);\n            serializerReader.Populate(reader, target);\n        }\n\n        /// <summary>\n        /// Deserializes the Json structure contained by the specified <see cref=\"JsonReader\"/>.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> that contains the JSON structure to deserialize.</param>\n        /// <returns>The <see cref=\"Object\"/> being deserialized.</returns>\n        public object Deserialize(JsonReader reader)\n        {\n            return Deserialize(reader, null);\n        }\n\n        /// <summary>\n        /// Deserializes the Json structure contained by the specified <see cref=\"StringReader\"/>\n        /// into an instance of the specified type.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"TextReader\"/> containing the object.</param>\n        /// <param name=\"objectType\">The <see cref=\"Type\"/> of object being deserialized.</param>\n        /// <returns>The instance of <paramref name=\"objectType\"/> being deserialized.</returns>\n        public object Deserialize(TextReader reader, Type objectType)\n        {\n            return Deserialize(new JsonTextReader(reader), objectType);\n        }\n\n        /// <summary>\n        /// Deserializes the Json structure contained by the specified <see cref=\"JsonReader\"/>\n        /// into an instance of the specified type.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> containing the object.</param>\n        /// <typeparam name=\"T\">The type of the object to deserialize.</typeparam>\n        /// <returns>The instance of <typeparamref name=\"T\"/> being deserialized.</returns>\n        public T Deserialize<T>(JsonReader reader)\n        {\n            return (T)Deserialize(reader, typeof(T));\n        }\n\n        /// <summary>\n        /// Deserializes the Json structure contained by the specified <see cref=\"JsonReader\"/>\n        /// into an instance of the specified type.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> containing the object.</param>\n        /// <param name=\"objectType\">The <see cref=\"Type\"/> of object being deserialized.</param>\n        /// <returns>The instance of <paramref name=\"objectType\"/> being deserialized.</returns>\n        public object Deserialize(JsonReader reader, Type objectType)\n        {\n            return DeserializeInternal(reader, objectType);\n        }\n\n        internal virtual object DeserializeInternal(JsonReader reader, Type objectType)\n        {\n            ValidationUtils.ArgumentNotNull(reader, \"reader\");\n\n            // set serialization options onto reader\n            CultureInfo previousCulture = null;\n            if (_culture != null && !_culture.Equals(reader.Culture))\n            {\n                previousCulture = reader.Culture;\n                reader.Culture = _culture;\n            }\n\n            DateTimeZoneHandling? previousDateTimeZoneHandling = null;\n            if (_dateTimeZoneHandling != null && reader.DateTimeZoneHandling != _dateTimeZoneHandling)\n            {\n                previousDateTimeZoneHandling = reader.DateTimeZoneHandling;\n                reader.DateTimeZoneHandling = _dateTimeZoneHandling.Value;\n            }\n\n            DateParseHandling? previousDateParseHandling = null;\n            if (_dateParseHandling != null && reader.DateParseHandling != _dateParseHandling)\n            {\n                previousDateParseHandling = reader.DateParseHandling;\n                reader.DateParseHandling = _dateParseHandling.Value;\n            }\n\n            FloatParseHandling? previousFloatParseHandling = null;\n            if (_floatParseHandling != null && reader.FloatParseHandling != _floatParseHandling)\n            {\n                previousFloatParseHandling = reader.FloatParseHandling;\n                reader.FloatParseHandling = _floatParseHandling.Value;\n            }\n\n            int? previousMaxDepth = null;\n            if (_maxDepthSet && reader.MaxDepth != _maxDepth)\n            {\n                previousMaxDepth = reader.MaxDepth;\n                reader.MaxDepth = _maxDepth;\n            }\n\n            string previousDateFormatString = null;\n            if (_dateFormatStringSet && reader.DateFormatString != _dateFormatString)\n            {\n                previousDateFormatString = reader.DateFormatString;\n                reader.DateFormatString = _dateFormatString;\n            }\n\n            TraceJsonReader traceJsonReader = (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                ? new TraceJsonReader(reader)\n                : null;\n\n            JsonSerializerInternalReader serializerReader = new JsonSerializerInternalReader(this);\n            object value = serializerReader.Deserialize(traceJsonReader ?? reader, objectType, CheckAdditionalContent);\n\n            if (traceJsonReader != null)\n                TraceWriter.Trace(TraceLevel.Verbose, \"Deserialized JSON: \" + Environment.NewLine + traceJsonReader.GetJson(), null);\n\n            // reset reader back to previous options\n            if (previousCulture != null)\n                reader.Culture = previousCulture;\n            if (previousDateTimeZoneHandling != null)\n                reader.DateTimeZoneHandling = previousDateTimeZoneHandling.Value;\n            if (previousDateParseHandling != null)\n                reader.DateParseHandling = previousDateParseHandling.Value;\n            if (previousFloatParseHandling != null)\n                reader.FloatParseHandling = previousFloatParseHandling.Value;\n            if (_maxDepthSet)\n                reader.MaxDepth = previousMaxDepth;\n            if (_dateFormatStringSet)\n                reader.DateFormatString = previousDateFormatString;\n\n            return value;\n        }\n\n        /// <summary>\n        /// Serializes the specified <see cref=\"Object\"/> and writes the Json structure\n        /// to a <c>Stream</c> using the specified <see cref=\"TextWriter\"/>. \n        /// </summary>\n        /// <param name=\"textWriter\">The <see cref=\"TextWriter\"/> used to write the Json structure.</param>\n        /// <param name=\"value\">The <see cref=\"Object\"/> to serialize.</param>\n        public void Serialize(TextWriter textWriter, object value)\n        {\n            Serialize(new JsonTextWriter(textWriter), value);\n        }\n\n        /// <summary>\n        /// Serializes the specified <see cref=\"Object\"/> and writes the Json structure\n        /// to a <c>Stream</c> using the specified <see cref=\"TextWriter\"/>. \n        /// </summary>\n        /// <param name=\"jsonWriter\">The <see cref=\"JsonWriter\"/> used to write the Json structure.</param>\n        /// <param name=\"value\">The <see cref=\"Object\"/> to serialize.</param>\n        /// <param name=\"objectType\">\n        /// The type of the value being serialized.\n        /// This parameter is used when <see cref=\"TypeNameHandling\"/> is Auto to write out the type name if the type of the value does not match.\n        /// Specifing the type is optional.\n        /// </param>\n        public void Serialize(JsonWriter jsonWriter, object value, Type objectType)\n        {\n            SerializeInternal(jsonWriter, value, objectType);\n        }\n\n        /// <summary>\n        /// Serializes the specified <see cref=\"Object\"/> and writes the Json structure\n        /// to a <c>Stream</c> using the specified <see cref=\"TextWriter\"/>. \n        /// </summary>\n        /// <param name=\"textWriter\">The <see cref=\"TextWriter\"/> used to write the Json structure.</param>\n        /// <param name=\"value\">The <see cref=\"Object\"/> to serialize.</param>\n        /// <param name=\"objectType\">\n        /// The type of the value being serialized.\n        /// This parameter is used when <see cref=\"TypeNameHandling\"/> is Auto to write out the type name if the type of the value does not match.\n        /// Specifing the type is optional.\n        /// </param>\n        public void Serialize(TextWriter textWriter, object value, Type objectType)\n        {\n            Serialize(new JsonTextWriter(textWriter), value, objectType);\n        }\n\n        /// <summary>\n        /// Serializes the specified <see cref=\"Object\"/> and writes the Json structure\n        /// to a <c>Stream</c> using the specified <see cref=\"JsonWriter\"/>. \n        /// </summary>\n        /// <param name=\"jsonWriter\">The <see cref=\"JsonWriter\"/> used to write the Json structure.</param>\n        /// <param name=\"value\">The <see cref=\"Object\"/> to serialize.</param>\n        public void Serialize(JsonWriter jsonWriter, object value)\n        {\n            SerializeInternal(jsonWriter, value, null);\n        }\n\n        internal virtual void SerializeInternal(JsonWriter jsonWriter, object value, Type objectType)\n        {\n            ValidationUtils.ArgumentNotNull(jsonWriter, \"jsonWriter\");\n\n            // set serialization options onto writer\n            Formatting? previousFormatting = null;\n            if (_formatting != null && jsonWriter.Formatting != _formatting)\n            {\n                previousFormatting = jsonWriter.Formatting;\n                jsonWriter.Formatting = _formatting.Value;\n            }\n\n            DateFormatHandling? previousDateFormatHandling = null;\n            if (_dateFormatHandling != null && jsonWriter.DateFormatHandling != _dateFormatHandling)\n            {\n                previousDateFormatHandling = jsonWriter.DateFormatHandling;\n                jsonWriter.DateFormatHandling = _dateFormatHandling.Value;\n            }\n\n            DateTimeZoneHandling? previousDateTimeZoneHandling = null;\n            if (_dateTimeZoneHandling != null && jsonWriter.DateTimeZoneHandling != _dateTimeZoneHandling)\n            {\n                previousDateTimeZoneHandling = jsonWriter.DateTimeZoneHandling;\n                jsonWriter.DateTimeZoneHandling = _dateTimeZoneHandling.Value;\n            }\n\n            FloatFormatHandling? previousFloatFormatHandling = null;\n            if (_floatFormatHandling != null && jsonWriter.FloatFormatHandling != _floatFormatHandling)\n            {\n                previousFloatFormatHandling = jsonWriter.FloatFormatHandling;\n                jsonWriter.FloatFormatHandling = _floatFormatHandling.Value;\n            }\n\n            StringEscapeHandling? previousStringEscapeHandling = null;\n            if (_stringEscapeHandling != null && jsonWriter.StringEscapeHandling != _stringEscapeHandling)\n            {\n                previousStringEscapeHandling = jsonWriter.StringEscapeHandling;\n                jsonWriter.StringEscapeHandling = _stringEscapeHandling.Value;\n            }\n\n            CultureInfo previousCulture = null;\n            if (_culture != null && !_culture.Equals(jsonWriter.Culture))\n            {\n                previousCulture = jsonWriter.Culture;\n                jsonWriter.Culture = _culture;\n            }\n\n            string previousDateFormatString = null;\n            if (_dateFormatStringSet && jsonWriter.DateFormatString != _dateFormatString)\n            {\n                previousDateFormatString = jsonWriter.DateFormatString;\n                jsonWriter.DateFormatString = _dateFormatString;\n            }\n\n            TraceJsonWriter traceJsonWriter = (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                ? new TraceJsonWriter(jsonWriter)\n                : null;\n\n            JsonSerializerInternalWriter serializerWriter = new JsonSerializerInternalWriter(this);\n            serializerWriter.Serialize(traceJsonWriter ?? jsonWriter, value, objectType);\n\n            if (traceJsonWriter != null)\n                TraceWriter.Trace(TraceLevel.Verbose, \"Serialized JSON: \" + Environment.NewLine + traceJsonWriter.GetJson(), null);\n\n            // reset writer back to previous options\n            if (previousFormatting != null)\n                jsonWriter.Formatting = previousFormatting.Value;\n            if (previousDateFormatHandling != null)\n                jsonWriter.DateFormatHandling = previousDateFormatHandling.Value;\n            if (previousDateTimeZoneHandling != null)\n                jsonWriter.DateTimeZoneHandling = previousDateTimeZoneHandling.Value;\n            if (previousFloatFormatHandling != null)\n                jsonWriter.FloatFormatHandling = previousFloatFormatHandling.Value;\n            if (previousStringEscapeHandling != null)\n                jsonWriter.StringEscapeHandling = previousStringEscapeHandling.Value;\n            if (_dateFormatStringSet)\n                jsonWriter.DateFormatString = previousDateFormatString;\n            if (previousCulture != null)\n                jsonWriter.Culture = previousCulture;\n        }\n\n        internal IReferenceResolver GetReferenceResolver()\n        {\n            if (_referenceResolver == null)\n                _referenceResolver = new DefaultReferenceResolver();\n\n            return _referenceResolver;\n        }\n\n        internal JsonConverter GetMatchingConverter(Type type)\n        {\n            return GetMatchingConverter(_converters, type);\n        }\n\n        internal static JsonConverter GetMatchingConverter(IList<JsonConverter> converters, Type objectType)\n        {\n#if DEBUG\n            ValidationUtils.ArgumentNotNull(objectType, \"objectType\");\n#endif\n\n            if (converters != null)\n            {\n                for (int i = 0; i < converters.Count; i++)\n                {\n                    JsonConverter converter = converters[i];\n\n                    if (converter.CanConvert(objectType))\n                        return converter;\n                }\n            }\n\n            return null;\n        }\n\n        internal void OnError(ErrorEventArgs e)\n        {\n            EventHandler<ErrorEventArgs> error = Error;\n            if (error != null)\n                error(this, e);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonSerializerSettings.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Runtime.Serialization.Formatters;\nusing Newtonsoft.Json.Serialization;\nusing System.Runtime.Serialization;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies the settings on a <see cref=\"JsonSerializer\"/> object.\n    /// </summary>\n    public class JsonSerializerSettings\n    {\n        internal const ReferenceLoopHandling DefaultReferenceLoopHandling = ReferenceLoopHandling.Error;\n        internal const MissingMemberHandling DefaultMissingMemberHandling = MissingMemberHandling.Ignore;\n        internal const NullValueHandling DefaultNullValueHandling = NullValueHandling.Include;\n        internal const DefaultValueHandling DefaultDefaultValueHandling = DefaultValueHandling.Include;\n        internal const ObjectCreationHandling DefaultObjectCreationHandling = ObjectCreationHandling.Auto;\n        internal const PreserveReferencesHandling DefaultPreserveReferencesHandling = PreserveReferencesHandling.None;\n        internal const ConstructorHandling DefaultConstructorHandling = ConstructorHandling.Default;\n        internal const TypeNameHandling DefaultTypeNameHandling = TypeNameHandling.None;\n        internal const MetadataPropertyHandling DefaultMetadataPropertyHandling = MetadataPropertyHandling.Default;\n        internal const FormatterAssemblyStyle DefaultTypeNameAssemblyFormat = FormatterAssemblyStyle.Simple;\n        internal static readonly StreamingContext DefaultContext;\n\n        internal const Formatting DefaultFormatting = Formatting.None;\n        internal const DateFormatHandling DefaultDateFormatHandling = DateFormatHandling.IsoDateFormat;\n        internal const DateTimeZoneHandling DefaultDateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;\n        internal const DateParseHandling DefaultDateParseHandling = DateParseHandling.DateTime;\n        internal const FloatParseHandling DefaultFloatParseHandling = FloatParseHandling.Double;\n        internal const FloatFormatHandling DefaultFloatFormatHandling = FloatFormatHandling.String;\n        internal const StringEscapeHandling DefaultStringEscapeHandling = StringEscapeHandling.Default;\n        internal const FormatterAssemblyStyle DefaultFormatterAssemblyStyle = FormatterAssemblyStyle.Simple;\n        internal static readonly CultureInfo DefaultCulture;\n        internal const bool DefaultCheckAdditionalContent = false;\n        internal const string DefaultDateFormatString = @\"yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK\";\n\n        internal Formatting? _formatting;\n        internal DateFormatHandling? _dateFormatHandling;\n        internal DateTimeZoneHandling? _dateTimeZoneHandling;\n        internal DateParseHandling? _dateParseHandling;\n        internal FloatFormatHandling? _floatFormatHandling;\n        internal FloatParseHandling? _floatParseHandling;\n        internal StringEscapeHandling? _stringEscapeHandling;\n        internal CultureInfo _culture;\n        internal bool? _checkAdditionalContent;\n        internal int? _maxDepth;\n        internal bool _maxDepthSet;\n        internal string _dateFormatString;\n        internal bool _dateFormatStringSet;\n        internal FormatterAssemblyStyle? _typeNameAssemblyFormat;\n        internal DefaultValueHandling? _defaultValueHandling;\n        internal PreserveReferencesHandling? _preserveReferencesHandling;\n        internal NullValueHandling? _nullValueHandling;\n        internal ObjectCreationHandling? _objectCreationHandling;\n        internal MissingMemberHandling? _missingMemberHandling;\n        internal ReferenceLoopHandling? _referenceLoopHandling;\n        internal StreamingContext? _context;\n        internal ConstructorHandling? _constructorHandling;\n        internal TypeNameHandling? _typeNameHandling;\n        internal MetadataPropertyHandling? _metadataPropertyHandling;\n\n        /// <summary>\n        /// Gets or sets how reference loops (e.g. a class referencing itself) is handled.\n        /// </summary>\n        /// <value>Reference loop handling.</value>\n        public ReferenceLoopHandling ReferenceLoopHandling\n        {\n            get { return _referenceLoopHandling ?? DefaultReferenceLoopHandling; }\n            set { _referenceLoopHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization.\n        /// </summary>\n        /// <value>Missing member handling.</value>\n        public MissingMemberHandling MissingMemberHandling\n        {\n            get { return _missingMemberHandling ?? DefaultMissingMemberHandling; }\n            set { _missingMemberHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets how objects are created during deserialization.\n        /// </summary>\n        /// <value>The object creation handling.</value>\n        public ObjectCreationHandling ObjectCreationHandling\n        {\n            get { return _objectCreationHandling ?? DefaultObjectCreationHandling; }\n            set { _objectCreationHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets how null values are handled during serialization and deserialization.\n        /// </summary>\n        /// <value>Null value handling.</value>\n        public NullValueHandling NullValueHandling\n        {\n            get { return _nullValueHandling ?? DefaultNullValueHandling; }\n            set { _nullValueHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets how null default are handled during serialization and deserialization.\n        /// </summary>\n        /// <value>The default value handling.</value>\n        public DefaultValueHandling DefaultValueHandling\n        {\n            get { return _defaultValueHandling ?? DefaultDefaultValueHandling; }\n            set { _defaultValueHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets a collection <see cref=\"JsonConverter\"/> that will be used during serialization.\n        /// </summary>\n        /// <value>The converters.</value>\n        public IList<JsonConverter> Converters { get; set; }\n\n        /// <summary>\n        /// Gets or sets how object references are preserved by the serializer.\n        /// </summary>\n        /// <value>The preserve references handling.</value>\n        public PreserveReferencesHandling PreserveReferencesHandling\n        {\n            get { return _preserveReferencesHandling ?? DefaultPreserveReferencesHandling; }\n            set { _preserveReferencesHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets how type name writing and reading is handled by the serializer.\n        /// </summary>\n        /// <value>The type name handling.</value>\n        public TypeNameHandling TypeNameHandling\n        {\n            get { return _typeNameHandling ?? DefaultTypeNameHandling; }\n            set { _typeNameHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets how metadata properties are used during deserialization.\n        /// </summary>\n        /// <value>The metadata properties handling.</value>\n        public MetadataPropertyHandling MetadataPropertyHandling\n        {\n            get { return _metadataPropertyHandling ?? DefaultMetadataPropertyHandling; }\n            set { _metadataPropertyHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets how a type name assembly is written and resolved by the serializer.\n        /// </summary>\n        /// <value>The type name assembly format.</value>\n        public FormatterAssemblyStyle TypeNameAssemblyFormat\n        {\n            get { return _typeNameAssemblyFormat ?? DefaultFormatterAssemblyStyle; }\n            set { _typeNameAssemblyFormat = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets how constructors are used during deserialization.\n        /// </summary>\n        /// <value>The constructor handling.</value>\n        public ConstructorHandling ConstructorHandling\n        {\n            get { return _constructorHandling ?? DefaultConstructorHandling; }\n            set { _constructorHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the contract resolver used by the serializer when\n        /// serializing .NET objects to JSON and vice versa.\n        /// </summary>\n        /// <value>The contract resolver.</value>\n        public IContractResolver ContractResolver { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"IReferenceResolver\"/> used by the serializer when resolving references.\n        /// </summary>\n        /// <value>The reference resolver.</value>\n        public IReferenceResolver ReferenceResolver { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"ITraceWriter\"/> used by the serializer when writing trace messages.\n        /// </summary>\n        /// <value>The trace writer.</value>\n        public ITraceWriter TraceWriter { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"SerializationBinder\"/> used by the serializer when resolving type names.\n        /// </summary>\n        /// <value>The binder.</value>\n        public SerializationBinder Binder { get; set; }\n\n        /// <summary>\n        /// Gets or sets the error handler called during serialization and deserialization.\n        /// </summary>\n        /// <value>The error handler called during serialization and deserialization.</value>\n        public EventHandler<ErrorEventArgs> Error { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"StreamingContext\"/> used by the serializer when invoking serialization callback methods.\n        /// </summary>\n        /// <value>The context.</value>\n        public StreamingContext Context\n        {\n            get { return _context ?? DefaultContext; }\n            set { _context = value; }\n        }\n\n        /// <summary>\n        /// Get or set how <see cref=\"DateTime\"/> and <see cref=\"DateTimeOffset\"/> values are formatting when writing JSON text.\n        /// </summary>\n        public string DateFormatString\n        {\n            get { return _dateFormatString ?? DefaultDateFormatString; }\n            set\n            {\n                _dateFormatString = value;\n                _dateFormatStringSet = true;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a <see cref=\"JsonReaderException\"/>.\n        /// </summary>\n        public int? MaxDepth\n        {\n            get { return _maxDepth; }\n            set\n            {\n                if (value <= 0)\n                    throw new ArgumentException(\"Value must be positive.\", \"value\");\n\n                _maxDepth = value;\n                _maxDepthSet = true;\n            }\n        }\n\n        /// <summary>\n        /// Indicates how JSON text output is formatted.\n        /// </summary>\n        public Formatting Formatting\n        {\n            get { return _formatting ?? DefaultFormatting; }\n            set { _formatting = value; }\n        }\n\n        /// <summary>\n        /// Get or set how dates are written to JSON text.\n        /// </summary>\n        public DateFormatHandling DateFormatHandling\n        {\n            get { return _dateFormatHandling ?? DefaultDateFormatHandling; }\n            set { _dateFormatHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how <see cref=\"DateTime\"/> time zones are handling during serialization and deserialization.\n        /// </summary>\n        public DateTimeZoneHandling DateTimeZoneHandling\n        {\n            get { return _dateTimeZoneHandling ?? DefaultDateTimeZoneHandling; }\n            set { _dateTimeZoneHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how date formatted strings, e.g. \"\\/Date(1198908717056)\\/\" and \"2012-03-21T05:40Z\", are parsed when reading JSON.\n        /// </summary>\n        public DateParseHandling DateParseHandling\n        {\n            get { return _dateParseHandling ?? DefaultDateParseHandling; }\n            set { _dateParseHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how special floating point numbers, e.g. <see cref=\"F:System.Double.NaN\"/>,\n        /// <see cref=\"F:System.Double.PositiveInfinity\"/> and <see cref=\"F:System.Double.NegativeInfinity\"/>,\n        /// are written as JSON.\n        /// </summary>\n        public FloatFormatHandling FloatFormatHandling\n        {\n            get { return _floatFormatHandling ?? DefaultFloatFormatHandling; }\n            set { _floatFormatHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text.\n        /// </summary>\n        public FloatParseHandling FloatParseHandling\n        {\n            get { return _floatParseHandling ?? DefaultFloatParseHandling; }\n            set { _floatParseHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how strings are escaped when writing JSON text.\n        /// </summary>\n        public StringEscapeHandling StringEscapeHandling\n        {\n            get { return _stringEscapeHandling ?? DefaultStringEscapeHandling; }\n            set { _stringEscapeHandling = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the culture used when reading JSON. Defaults to <see cref=\"CultureInfo.InvariantCulture\"/>.\n        /// </summary>\n        public CultureInfo Culture\n        {\n            get { return _culture ?? DefaultCulture; }\n            set { _culture = value; }\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether there will be a check for additional content after deserializing an object.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if there will be a check for additional content after deserializing an object; otherwise, <c>false</c>.\n        /// </value>\n        public bool CheckAdditionalContent\n        {\n            get { return _checkAdditionalContent ?? DefaultCheckAdditionalContent; }\n            set { _checkAdditionalContent = value; }\n        }\n\n        static JsonSerializerSettings()\n        {\n            DefaultContext = new StreamingContext();\n            DefaultCulture = CultureInfo.InvariantCulture;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSerializerSettings\"/> class.\n        /// </summary>\n        public JsonSerializerSettings()\n        {\n            Converters = new List<JsonConverter>();\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonTextReader.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\nusing System.Numerics;\n#endif\nusing System.Text;\nusing System.IO;\nusing System.Xml;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json\n{\n    internal enum ReadType\n    {\n        Read,\n        ReadAsInt32,\n        ReadAsBytes,\n        ReadAsString,\n        ReadAsDecimal,\n        ReadAsDateTime,\n#if !NET20\n        ReadAsDateTimeOffset\n#endif\n    }\n\n    /// <summary>\n    /// Represents a reader that provides fast, non-cached, forward-only access to JSON text data.\n    /// </summary>\n    public class JsonTextReader : JsonReader, IJsonLineInfo\n    {\n        private const char UnicodeReplacementChar = '\\uFFFD';\n\n        private readonly TextReader _reader;\n        private char[] _chars;\n        private int _charsUsed;\n        private int _charPos;\n        private int _lineStartPos;\n        private int _lineNumber;\n        private bool _isEndOfFile;\n        private StringBuffer _buffer;\n        private StringReference _stringReference;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonReader\"/> class with the specified <see cref=\"TextReader\"/>.\n        /// </summary>\n        /// <param name=\"reader\">The <c>TextReader</c> containing the XML data to read.</param>\n        public JsonTextReader(TextReader reader)\n        {\n            if (reader == null)\n                throw new ArgumentNullException(\"reader\");\n\n            _reader = reader;\n            _lineNumber = 1;\n            _chars = new char[1025];\n        }\n\n#if DEBUG\n        internal void SetCharBuffer(char[] chars)\n        {\n            _chars = chars;\n        }\n#endif\n\n        private StringBuffer GetBuffer()\n        {\n            if (_buffer == null)\n            {\n                _buffer = new StringBuffer(1025);\n            }\n            else\n            {\n                _buffer.Position = 0;\n            }\n\n            return _buffer;\n        }\n\n        private void OnNewLine(int pos)\n        {\n            _lineNumber++;\n            _lineStartPos = pos - 1;\n        }\n\n        private void ParseString(char quote)\n        {\n            _charPos++;\n\n            ShiftBufferIfNeeded();\n            ReadStringIntoBuffer(quote);\n\n            if (_readType == ReadType.ReadAsBytes)\n            {\n                byte[] data;\n                if (_stringReference.Length == 0)\n                {\n                    data = new byte[0];\n                }\n                else\n                {\n                    data = Convert.FromBase64CharArray(_stringReference.Chars, _stringReference.StartIndex, _stringReference.Length);\n                }\n\n                SetToken(JsonToken.Bytes, data);\n            }\n            else if (_readType == ReadType.ReadAsString)\n            {\n                string text = _stringReference.ToString();\n\n                SetToken(JsonToken.String, text);\n                _quoteChar = quote;\n            }\n            else\n            {\n                string text = _stringReference.ToString();\n\n                if (_dateParseHandling != DateParseHandling.None)\n                {\n                    DateParseHandling dateParseHandling;\n                    if (_readType == ReadType.ReadAsDateTime)\n                        dateParseHandling = DateParseHandling.DateTime;\n#if !NET20\n                    else if (_readType == ReadType.ReadAsDateTimeOffset)\n                        dateParseHandling = DateParseHandling.DateTimeOffset;\n#endif\n                    else\n                        dateParseHandling = _dateParseHandling;\n\n                    object dt;\n                    if (DateTimeUtils.TryParseDateTime(text, dateParseHandling, DateTimeZoneHandling, DateFormatString, Culture, out dt))\n                    {\n                        SetToken(JsonToken.Date, dt);\n                        return;\n                    }\n                }\n\n                SetToken(JsonToken.String, text);\n                _quoteChar = quote;\n            }\n        }\n\n        private static void BlockCopyChars(char[] src, int srcOffset, char[] dst, int dstOffset, int count)\n        {\n            const int charByteCount = 2;\n\n            Buffer.BlockCopy(src, srcOffset * charByteCount, dst, dstOffset * charByteCount, count * charByteCount);\n        }\n\n        private void ShiftBufferIfNeeded()\n        {\n            // once in the last 10% of the buffer shift the remainling content to the start to avoid\n            // unnessesarly increasing the buffer size when reading numbers/strings\n            int length = _chars.Length;\n            if (length - _charPos <= length * 0.1)\n            {\n                int count = _charsUsed - _charPos;\n                if (count > 0)\n                    BlockCopyChars(_chars, _charPos, _chars, 0, count);\n\n                _lineStartPos -= _charPos;\n                _charPos = 0;\n                _charsUsed = count;\n                _chars[_charsUsed] = '\\0';\n            }\n        }\n\n        private int ReadData(bool append)\n        {\n            return ReadData(append, 0);\n        }\n\n        private int ReadData(bool append, int charsRequired)\n        {\n            if (_isEndOfFile)\n                return 0;\n\n            // char buffer is full\n            if (_charsUsed + charsRequired >= _chars.Length - 1)\n            {\n                if (append)\n                {\n                    // copy to new array either double the size of the current or big enough to fit required content\n                    int newArrayLength = Math.Max(_chars.Length * 2, _charsUsed + charsRequired + 1);\n\n                    // increase the size of the buffer\n                    char[] dst = new char[newArrayLength];\n\n                    BlockCopyChars(_chars, 0, dst, 0, _chars.Length);\n\n                    _chars = dst;\n                }\n                else\n                {\n                    int remainingCharCount = _charsUsed - _charPos;\n\n                    if (remainingCharCount + charsRequired + 1 >= _chars.Length)\n                    {\n                        // the remaining count plus the required is bigger than the current buffer size\n                        char[] dst = new char[remainingCharCount + charsRequired + 1];\n\n                        if (remainingCharCount > 0)\n                            BlockCopyChars(_chars, _charPos, dst, 0, remainingCharCount);\n\n                        _chars = dst;\n                    }\n                    else\n                    {\n                        // copy any remaining data to the beginning of the buffer if needed and reset positions\n                        if (remainingCharCount > 0)\n                            BlockCopyChars(_chars, _charPos, _chars, 0, remainingCharCount);\n                    }\n\n                    _lineStartPos -= _charPos;\n                    _charPos = 0;\n                    _charsUsed = remainingCharCount;\n                }\n            }\n\n            int attemptCharReadCount = _chars.Length - _charsUsed - 1;\n\n            int charsRead = _reader.Read(_chars, _charsUsed, attemptCharReadCount);\n\n            _charsUsed += charsRead;\n\n            if (charsRead == 0)\n                _isEndOfFile = true;\n\n            _chars[_charsUsed] = '\\0';\n            return charsRead;\n        }\n\n        private bool EnsureChars(int relativePosition, bool append)\n        {\n            if (_charPos + relativePosition >= _charsUsed)\n                return ReadChars(relativePosition, append);\n\n            return true;\n        }\n\n        private bool ReadChars(int relativePosition, bool append)\n        {\n            if (_isEndOfFile)\n                return false;\n\n            int charsRequired = _charPos + relativePosition - _charsUsed + 1;\n\n            int totalCharsRead = 0;\n\n            // it is possible that the TextReader doesn't return all data at once\n            // repeat read until the required text is returned or the reader is out of content\n            do\n            {\n                int charsRead = ReadData(append, charsRequired - totalCharsRead);\n\n                // no more content\n                if (charsRead == 0)\n                    break;\n\n                totalCharsRead += charsRead;\n            } while (totalCharsRead < charsRequired);\n\n            if (totalCharsRead < charsRequired)\n                return false;\n            return true;\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream.\n        /// </summary>\n        /// <returns>\n        /// true if the next token was read successfully; false if there are no more tokens to read.\n        /// </returns>\n        [DebuggerStepThrough]\n        public override bool Read()\n        {\n            _readType = ReadType.Read;\n            if (!ReadInternal())\n            {\n                SetToken(JsonToken.None);\n                return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"T:Byte[]\"/>.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:Byte[]\"/> or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.\n        /// </returns>\n        public override byte[] ReadAsBytes()\n        {\n            return ReadAsBytesInternal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{Decimal}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{Decimal}\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override decimal? ReadAsDecimal()\n        {\n            return ReadAsDecimalInternal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{Int32}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{Int32}\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override int? ReadAsInt32()\n        {\n            return ReadAsInt32Internal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"String\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"String\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override string ReadAsString()\n        {\n            return ReadAsStringInternal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{DateTime}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"String\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override DateTime? ReadAsDateTime()\n        {\n            return ReadAsDateTimeInternal();\n        }\n\n#if !NET20\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{DateTimeOffset}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"DateTimeOffset\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override DateTimeOffset? ReadAsDateTimeOffset()\n        {\n            return ReadAsDateTimeOffsetInternal();\n        }\n#endif\n\n        internal override bool ReadInternal()\n        {\n            while (true)\n            {\n                switch (_currentState)\n                {\n                    case State.Start:\n                    case State.Property:\n                    case State.Array:\n                    case State.ArrayStart:\n                    case State.Constructor:\n                    case State.ConstructorStart:\n                        return ParseValue();\n                    case State.Complete:\n                        break;\n                    case State.Object:\n                    case State.ObjectStart:\n                        return ParseObject();\n                    case State.PostValue:\n                        // returns true if it hits\n                        // end of object or array\n                        if (ParsePostValue())\n                            return true;\n                        break;\n                    case State.Finished:\n                        if (EnsureChars(0, false))\n                        {\n                            EatWhitespace(false);\n                            if (_isEndOfFile)\n                            {\n                                return false;\n                            }\n                            if (_chars[_charPos] == '/')\n                            {\n                                ParseComment();\n                                return true;\n                            }\n                            else\n                            {\n                                throw JsonReaderException.Create(this, \"Additional text encountered after finished reading JSON content: {0}.\".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos]));\n                            }\n                        }\n                        return false;\n                    case State.Closed:\n                        break;\n                    case State.Error:\n                        break;\n                    default:\n                        throw JsonReaderException.Create(this, \"Unexpected state: {0}.\".FormatWith(CultureInfo.InvariantCulture, CurrentState));\n                }\n            }\n        }\n\n        private void ReadStringIntoBuffer(char quote)\n        {\n            int charPos = _charPos;\n            int initialPosition = _charPos;\n            int lastWritePosition = _charPos;\n            StringBuffer buffer = null;\n\n            while (true)\n            {\n                switch (_chars[charPos++])\n                {\n                    case '\\0':\n                        if (_charsUsed == charPos - 1)\n                        {\n                            charPos--;\n\n                            if (ReadData(true) == 0)\n                            {\n                                _charPos = charPos;\n                                throw JsonReaderException.Create(this, \"Unterminated string. Expected delimiter: {0}.\".FormatWith(CultureInfo.InvariantCulture, quote));\n                            }\n                        }\n                        break;\n                    case '\\\\':\n                        _charPos = charPos;\n                        if (!EnsureChars(0, true))\n                        {\n                            _charPos = charPos;\n                            throw JsonReaderException.Create(this, \"Unterminated string. Expected delimiter: {0}.\".FormatWith(CultureInfo.InvariantCulture, quote));\n                        }\n\n                        // start of escape sequence\n                        int escapeStartPos = charPos - 1;\n\n                        char currentChar = _chars[charPos];\n\n                        char writeChar;\n\n                        switch (currentChar)\n                        {\n                            case 'b':\n                                charPos++;\n                                writeChar = '\\b';\n                                break;\n                            case 't':\n                                charPos++;\n                                writeChar = '\\t';\n                                break;\n                            case 'n':\n                                charPos++;\n                                writeChar = '\\n';\n                                break;\n                            case 'f':\n                                charPos++;\n                                writeChar = '\\f';\n                                break;\n                            case 'r':\n                                charPos++;\n                                writeChar = '\\r';\n                                break;\n                            case '\\\\':\n                                charPos++;\n                                writeChar = '\\\\';\n                                break;\n                            case '\"':\n                            case '\\'':\n                            case '/':\n                                writeChar = currentChar;\n                                charPos++;\n                                break;\n                            case 'u':\n                                charPos++;\n                                _charPos = charPos;\n                                writeChar = ParseUnicode();\n\n                                if (StringUtils.IsLowSurrogate(writeChar))\n                                {\n                                    // low surrogate with no preceding high surrogate; this char is replaced\n                                    writeChar = UnicodeReplacementChar;\n                                }\n                                else if (StringUtils.IsHighSurrogate(writeChar))\n                                {\n                                    bool anotherHighSurrogate;\n\n                                    // loop for handling situations where there are multiple consecutive high surrogates\n                                    do\n                                    {\n                                        anotherHighSurrogate = false;\n\n                                        // potential start of a surrogate pair\n                                        if (EnsureChars(2, true) && _chars[_charPos] == '\\\\' && _chars[_charPos + 1] == 'u')\n                                        {\n                                            char highSurrogate = writeChar;\n\n                                            _charPos += 2;\n                                            writeChar = ParseUnicode();\n\n                                            if (StringUtils.IsLowSurrogate(writeChar))\n                                            {\n                                                // a valid surrogate pair!\n                                            }\n                                            else if (StringUtils.IsHighSurrogate(writeChar))\n                                            {\n                                                // another high surrogate; replace current and start check over\n                                                highSurrogate = UnicodeReplacementChar;\n                                                anotherHighSurrogate = true;\n                                            }\n                                            else\n                                            {\n                                                // high surrogate not followed by low surrogate; original char is replaced\n                                                highSurrogate = UnicodeReplacementChar;\n                                            }\n\n                                            if (buffer == null)\n                                                buffer = GetBuffer();\n\n                                            WriteCharToBuffer(buffer, highSurrogate, lastWritePosition, escapeStartPos);\n                                            lastWritePosition = _charPos;\n                                        }\n                                        else\n                                        {\n                                            // there are not enough remaining chars for the low surrogate or is not follow by unicode sequence\n                                            // replace high surrogate and continue on as usual\n                                            writeChar = UnicodeReplacementChar;\n                                        }\n                                    } while (anotherHighSurrogate);\n                                }\n\n                                charPos = _charPos;\n                                break;\n                            default:\n                                charPos++;\n                                _charPos = charPos;\n                                throw JsonReaderException.Create(this, \"Bad JSON escape sequence: {0}.\".FormatWith(CultureInfo.InvariantCulture, @\"\\\" + currentChar));\n                        }\n\n                        if (buffer == null)\n                            buffer = GetBuffer();\n\n                        WriteCharToBuffer(buffer, writeChar, lastWritePosition, escapeStartPos);\n\n                        lastWritePosition = charPos;\n                        break;\n                    case StringUtils.CarriageReturn:\n                        _charPos = charPos - 1;\n                        ProcessCarriageReturn(true);\n                        charPos = _charPos;\n                        break;\n                    case StringUtils.LineFeed:\n                        _charPos = charPos - 1;\n                        ProcessLineFeed();\n                        charPos = _charPos;\n                        break;\n                    case '\"':\n                    case '\\'':\n                        if (_chars[charPos - 1] == quote)\n                        {\n                            charPos--;\n\n                            if (initialPosition == lastWritePosition)\n                            {\n                                _stringReference = new StringReference(_chars, initialPosition, charPos - initialPosition);\n                            }\n                            else\n                            {\n                                if (buffer == null)\n                                    buffer = GetBuffer();\n\n                                if (charPos > lastWritePosition)\n                                    buffer.Append(_chars, lastWritePosition, charPos - lastWritePosition);\n\n                                _stringReference = new StringReference(buffer.GetInternalBuffer(), 0, buffer.Position);\n                            }\n\n                            charPos++;\n                            _charPos = charPos;\n                            return;\n                        }\n                        break;\n                }\n            }\n        }\n\n        private void WriteCharToBuffer(StringBuffer buffer, char writeChar, int lastWritePosition, int writeToPosition)\n        {\n            if (writeToPosition > lastWritePosition)\n            {\n                buffer.Append(_chars, lastWritePosition, writeToPosition - lastWritePosition);\n            }\n\n            buffer.Append(writeChar);\n        }\n\n        private char ParseUnicode()\n        {\n            char writeChar;\n            if (EnsureChars(4, true))\n            {\n                string hexValues = new string(_chars, _charPos, 4);\n                char hexChar = Convert.ToChar(int.Parse(hexValues, NumberStyles.HexNumber, NumberFormatInfo.InvariantInfo));\n                writeChar = hexChar;\n\n                _charPos += 4;\n            }\n            else\n            {\n                throw JsonReaderException.Create(this, \"Unexpected end while parsing unicode character.\");\n            }\n            return writeChar;\n        }\n\n        private void ReadNumberIntoBuffer()\n        {\n            int charPos = _charPos;\n\n            while (true)\n            {\n                switch (_chars[charPos++])\n                {\n                    case '\\0':\n                        if (_charsUsed == charPos - 1)\n                        {\n                            charPos--;\n                            _charPos = charPos;\n                            if (ReadData(true) == 0)\n                                return;\n                        }\n                        else\n                        {\n                            _charPos = charPos - 1;\n                            return;\n                        }\n                        break;\n                    case '-':\n                    case '+':\n                    case 'a':\n                    case 'A':\n                    case 'b':\n                    case 'B':\n                    case 'c':\n                    case 'C':\n                    case 'd':\n                    case 'D':\n                    case 'e':\n                    case 'E':\n                    case 'f':\n                    case 'F':\n                    case 'x':\n                    case 'X':\n                    case '.':\n                    case '0':\n                    case '1':\n                    case '2':\n                    case '3':\n                    case '4':\n                    case '5':\n                    case '6':\n                    case '7':\n                    case '8':\n                    case '9':\n                        break;\n                    default:\n                        _charPos = charPos - 1;\n                        return;\n                }\n            }\n        }\n\n        private void ClearRecentString()\n        {\n            if (_buffer != null)\n                _buffer.Position = 0;\n\n            _stringReference = new StringReference();\n        }\n\n        private bool ParsePostValue()\n        {\n            while (true)\n            {\n                char currentChar = _chars[_charPos];\n\n                switch (currentChar)\n                {\n                    case '\\0':\n                        if (_charsUsed == _charPos)\n                        {\n                            if (ReadData(false) == 0)\n                            {\n                                _currentState = State.Finished;\n                                return false;\n                            }\n                        }\n                        else\n                        {\n                            _charPos++;\n                        }\n                        break;\n                    case '}':\n                        _charPos++;\n                        SetToken(JsonToken.EndObject);\n                        return true;\n                    case ']':\n                        _charPos++;\n                        SetToken(JsonToken.EndArray);\n                        return true;\n                    case ')':\n                        _charPos++;\n                        SetToken(JsonToken.EndConstructor);\n                        return true;\n                    case '/':\n                        ParseComment();\n                        return true;\n                    case ',':\n                        _charPos++;\n\n                        // finished parsing\n                        SetStateBasedOnCurrent();\n                        return false;\n                    case ' ':\n                    case StringUtils.Tab:\n                        // eat\n                        _charPos++;\n                        break;\n                    case StringUtils.CarriageReturn:\n                        ProcessCarriageReturn(false);\n                        break;\n                    case StringUtils.LineFeed:\n                        ProcessLineFeed();\n                        break;\n                    default:\n                        if (char.IsWhiteSpace(currentChar))\n                        {\n                            // eat\n                            _charPos++;\n                        }\n                        else\n                        {\n                            throw JsonReaderException.Create(this, \"After parsing a value an unexpected character was encountered: {0}.\".FormatWith(CultureInfo.InvariantCulture, currentChar));\n                        }\n                        break;\n                }\n            }\n        }\n\n        private bool ParseObject()\n        {\n            while (true)\n            {\n                char currentChar = _chars[_charPos];\n\n                switch (currentChar)\n                {\n                    case '\\0':\n                        if (_charsUsed == _charPos)\n                        {\n                            if (ReadData(false) == 0)\n                                return false;\n                        }\n                        else\n                        {\n                            _charPos++;\n                        }\n                        break;\n                    case '}':\n                        SetToken(JsonToken.EndObject);\n                        _charPos++;\n                        return true;\n                    case '/':\n                        ParseComment();\n                        return true;\n                    case StringUtils.CarriageReturn:\n                        ProcessCarriageReturn(false);\n                        break;\n                    case StringUtils.LineFeed:\n                        ProcessLineFeed();\n                        break;\n                    case ' ':\n                    case StringUtils.Tab:\n                        // eat\n                        _charPos++;\n                        break;\n                    default:\n                        if (char.IsWhiteSpace(currentChar))\n                        {\n                            // eat\n                            _charPos++;\n                        }\n                        else\n                        {\n                            return ParseProperty();\n                        }\n                        break;\n                }\n            }\n        }\n\n        private bool ParseProperty()\n        {\n            char firstChar = _chars[_charPos];\n            char quoteChar;\n\n            if (firstChar == '\"' || firstChar == '\\'')\n            {\n                _charPos++;\n                quoteChar = firstChar;\n                ShiftBufferIfNeeded();\n                ReadStringIntoBuffer(quoteChar);\n            }\n            else if (ValidIdentifierChar(firstChar))\n            {\n                quoteChar = '\\0';\n                ShiftBufferIfNeeded();\n                ParseUnquotedProperty();\n            }\n            else\n            {\n                throw JsonReaderException.Create(this, \"Invalid property identifier character: {0}.\".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos]));\n            }\n\n            string propertyName = _stringReference.ToString();\n\n            EatWhitespace(false);\n\n            if (_chars[_charPos] != ':')\n                throw JsonReaderException.Create(this, \"Invalid character after parsing property name. Expected ':' but got: {0}.\".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos]));\n\n            _charPos++;\n\n            SetToken(JsonToken.PropertyName, propertyName);\n            _quoteChar = quoteChar;\n            ClearRecentString();\n\n            return true;\n        }\n\n        private bool ValidIdentifierChar(char value)\n        {\n            return (char.IsLetterOrDigit(value) || value == '_' || value == '$');\n        }\n\n        private void ParseUnquotedProperty()\n        {\n            int initialPosition = _charPos;\n\n            // parse unquoted property name until whitespace or colon\n            while (true)\n            {\n                switch (_chars[_charPos])\n                {\n                    case '\\0':\n                        if (_charsUsed == _charPos)\n                        {\n                            if (ReadData(true) == 0)\n                                throw JsonReaderException.Create(this, \"Unexpected end while parsing unquoted property name.\");\n\n                            break;\n                        }\n\n                        _stringReference = new StringReference(_chars, initialPosition, _charPos - initialPosition);\n                        return;\n                    default:\n                        char currentChar = _chars[_charPos];\n\n                        if (ValidIdentifierChar(currentChar))\n                        {\n                            _charPos++;\n                            break;\n                        }\n                        else if (char.IsWhiteSpace(currentChar) || currentChar == ':')\n                        {\n                            _stringReference = new StringReference(_chars, initialPosition, _charPos - initialPosition);\n                            return;\n                        }\n\n                        throw JsonReaderException.Create(this, \"Invalid JavaScript property identifier character: {0}.\".FormatWith(CultureInfo.InvariantCulture, currentChar));\n                }\n            }\n        }\n\n        private bool ParseValue()\n        {\n            while (true)\n            {\n                char currentChar = _chars[_charPos];\n\n                switch (currentChar)\n                {\n                    case '\\0':\n                        if (_charsUsed == _charPos)\n                        {\n                            if (ReadData(false) == 0)\n                                return false;\n                        }\n                        else\n                        {\n                            _charPos++;\n                        }\n                        break;\n                    case '\"':\n                    case '\\'':\n                        ParseString(currentChar);\n                        return true;\n                    case 't':\n                        ParseTrue();\n                        return true;\n                    case 'f':\n                        ParseFalse();\n                        return true;\n                    case 'n':\n                        if (EnsureChars(1, true))\n                        {\n                            char next = _chars[_charPos + 1];\n\n                            if (next == 'u')\n                                ParseNull();\n                            else if (next == 'e')\n                                ParseConstructor();\n                            else\n                                throw JsonReaderException.Create(this, \"Unexpected character encountered while parsing value: {0}.\".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos]));\n                        }\n                        else\n                        {\n                            throw JsonReaderException.Create(this, \"Unexpected end.\");\n                        }\n                        return true;\n                    case 'N':\n                        ParseNumberNaN();\n                        return true;\n                    case 'I':\n                        ParseNumberPositiveInfinity();\n                        return true;\n                    case '-':\n                        if (EnsureChars(1, true) && _chars[_charPos + 1] == 'I')\n                            ParseNumberNegativeInfinity();\n                        else\n                            ParseNumber();\n                        return true;\n                    case '/':\n                        ParseComment();\n                        return true;\n                    case 'u':\n                        ParseUndefined();\n                        return true;\n                    case '{':\n                        _charPos++;\n                        SetToken(JsonToken.StartObject);\n                        return true;\n                    case '[':\n                        _charPos++;\n                        SetToken(JsonToken.StartArray);\n                        return true;\n                    case ']':\n                        _charPos++;\n                        SetToken(JsonToken.EndArray);\n                        return true;\n                    case ',':\n                        // don't increment position, the next call to read will handle comma\n                        // this is done to handle multiple empty comma values\n                        SetToken(JsonToken.Undefined);\n                        return true;\n                    case ')':\n                        _charPos++;\n                        SetToken(JsonToken.EndConstructor);\n                        return true;\n                    case StringUtils.CarriageReturn:\n                        ProcessCarriageReturn(false);\n                        break;\n                    case StringUtils.LineFeed:\n                        ProcessLineFeed();\n                        break;\n                    case ' ':\n                    case StringUtils.Tab:\n                        // eat\n                        _charPos++;\n                        break;\n                    default:\n                        if (char.IsWhiteSpace(currentChar))\n                        {\n                            // eat\n                            _charPos++;\n                            break;\n                        }\n                        else if (char.IsNumber(currentChar) || currentChar == '-' || currentChar == '.')\n                        {\n                            ParseNumber();\n                            return true;\n                        }\n                        else\n                        {\n                            throw JsonReaderException.Create(this, \"Unexpected character encountered while parsing value: {0}.\".FormatWith(CultureInfo.InvariantCulture, currentChar));\n                        }\n                }\n            }\n        }\n\n        private void ProcessLineFeed()\n        {\n            _charPos++;\n            OnNewLine(_charPos);\n        }\n\n        private void ProcessCarriageReturn(bool append)\n        {\n            _charPos++;\n\n            if (EnsureChars(1, append) && _chars[_charPos] == StringUtils.LineFeed)\n                _charPos++;\n\n            OnNewLine(_charPos);\n        }\n\n        private bool EatWhitespace(bool oneOrMore)\n        {\n            bool finished = false;\n            bool ateWhitespace = false;\n            while (!finished)\n            {\n                char currentChar = _chars[_charPos];\n\n                switch (currentChar)\n                {\n                    case '\\0':\n                        if (_charsUsed == _charPos)\n                        {\n                            if (ReadData(false) == 0)\n                                finished = true;\n                        }\n                        else\n                        {\n                            _charPos++;\n                        }\n                        break;\n                    case StringUtils.CarriageReturn:\n                        ProcessCarriageReturn(false);\n                        break;\n                    case StringUtils.LineFeed:\n                        ProcessLineFeed();\n                        break;\n                    default:\n                        if (currentChar == ' ' || char.IsWhiteSpace(currentChar))\n                        {\n                            ateWhitespace = true;\n                            _charPos++;\n                        }\n                        else\n                        {\n                            finished = true;\n                        }\n                        break;\n                }\n            }\n\n            return (!oneOrMore || ateWhitespace);\n        }\n\n        private void ParseConstructor()\n        {\n            if (MatchValueWithTrailingSeparator(\"new\"))\n            {\n                EatWhitespace(false);\n\n                int initialPosition = _charPos;\n                int endPosition;\n\n                while (true)\n                {\n                    char currentChar = _chars[_charPos];\n                    if (currentChar == '\\0')\n                    {\n                        if (_charsUsed == _charPos)\n                        {\n                            if (ReadData(true) == 0)\n                                throw JsonReaderException.Create(this, \"Unexpected end while parsing constructor.\");\n                        }\n                        else\n                        {\n                            endPosition = _charPos;\n                            _charPos++;\n                            break;\n                        }\n                    }\n                    else if (char.IsLetterOrDigit(currentChar))\n                    {\n                        _charPos++;\n                    }\n                    else if (currentChar == StringUtils.CarriageReturn)\n                    {\n                        endPosition = _charPos;\n                        ProcessCarriageReturn(true);\n                        break;\n                    }\n                    else if (currentChar == StringUtils.LineFeed)\n                    {\n                        endPosition = _charPos;\n                        ProcessLineFeed();\n                        break;\n                    }\n                    else if (char.IsWhiteSpace(currentChar))\n                    {\n                        endPosition = _charPos;\n                        _charPos++;\n                        break;\n                    }\n                    else if (currentChar == '(')\n                    {\n                        endPosition = _charPos;\n                        break;\n                    }\n                    else\n                    {\n                        throw JsonReaderException.Create(this, \"Unexpected character while parsing constructor: {0}.\".FormatWith(CultureInfo.InvariantCulture, currentChar));\n                    }\n                }\n\n                _stringReference = new StringReference(_chars, initialPosition, endPosition - initialPosition);\n                string constructorName = _stringReference.ToString();\n\n                EatWhitespace(false);\n\n                if (_chars[_charPos] != '(')\n                    throw JsonReaderException.Create(this, \"Unexpected character while parsing constructor: {0}.\".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos]));\n\n                _charPos++;\n\n                ClearRecentString();\n\n                SetToken(JsonToken.StartConstructor, constructorName);\n            }\n            else\n            {\n                throw JsonReaderException.Create(this, \"Unexpected content while parsing JSON.\");\n            }\n        }\n\n        private void ParseNumber()\n        {\n            ShiftBufferIfNeeded();\n\n            char firstChar = _chars[_charPos];\n            int initialPosition = _charPos;\n\n            ReadNumberIntoBuffer();\n\n            _stringReference = new StringReference(_chars, initialPosition, _charPos - initialPosition);\n\n            object numberValue;\n            JsonToken numberType;\n\n            bool singleDigit = (char.IsDigit(firstChar) && _stringReference.Length == 1);\n            bool nonBase10 = (firstChar == '0' && _stringReference.Length > 1\n                              && _stringReference.Chars[_stringReference.StartIndex + 1] != '.'\n                              && _stringReference.Chars[_stringReference.StartIndex + 1] != 'e'\n                              && _stringReference.Chars[_stringReference.StartIndex + 1] != 'E');\n\n            if (_readType == ReadType.ReadAsInt32)\n            {\n                if (singleDigit)\n                {\n                    // digit char values start at 48\n                    numberValue = firstChar - 48;\n                }\n                else if (nonBase10)\n                {\n                    string number = _stringReference.ToString();\n\n                    // decimal.Parse doesn't support parsing hexadecimal values\n                    int integer = number.StartsWith(\"0x\", StringComparison.OrdinalIgnoreCase)\n                        ? Convert.ToInt32(number, 16)\n                        : Convert.ToInt32(number, 8);\n\n                    numberValue = integer;\n                }\n                else\n                {\n                    int value;\n                    ParseResult parseResult = ConvertUtils.Int32TryParse(_stringReference.Chars, _stringReference.StartIndex, _stringReference.Length, out value);\n                    if (parseResult == ParseResult.Success)\n                        numberValue = value;\n                    else if (parseResult == ParseResult.Overflow)\n                        throw JsonReaderException.Create(this, \"JSON integer {0} is too large or small for an Int32.\".FormatWith(CultureInfo.InvariantCulture, _stringReference.ToString()));\n                    else\n                        throw JsonReaderException.Create(this, \"Input string '{0}' is not a valid integer.\".FormatWith(CultureInfo.InvariantCulture, _stringReference.ToString()));\n                }\n\n                numberType = JsonToken.Integer;\n            }\n            else if (_readType == ReadType.ReadAsDecimal)\n            {\n                if (singleDigit)\n                {\n                    // digit char values start at 48\n                    numberValue = (decimal)firstChar - 48;\n                }\n                else if (nonBase10)\n                {\n                    string number = _stringReference.ToString();\n\n                    // decimal.Parse doesn't support parsing hexadecimal values\n                    long integer = number.StartsWith(\"0x\", StringComparison.OrdinalIgnoreCase)\n                        ? Convert.ToInt64(number, 16)\n                        : Convert.ToInt64(number, 8);\n\n                    numberValue = Convert.ToDecimal(integer);\n                }\n                else\n                {\n                    string number = _stringReference.ToString();\n\n                    decimal value;\n                    if (decimal.TryParse(number, NumberStyles.Number | NumberStyles.AllowExponent, CultureInfo.InvariantCulture, out value))\n                        numberValue = value;\n                    else\n                        throw JsonReaderException.Create(this, \"Input string '{0}' is not a valid decimal.\".FormatWith(CultureInfo.InvariantCulture, _stringReference.ToString()));\n                }\n\n                numberType = JsonToken.Float;\n            }\n            else\n            {\n                if (singleDigit)\n                {\n                    // digit char values start at 48\n                    numberValue = (long)firstChar - 48;\n                    numberType = JsonToken.Integer;\n                }\n                else if (nonBase10)\n                {\n                    string number = _stringReference.ToString();\n\n                    numberValue = number.StartsWith(\"0x\", StringComparison.OrdinalIgnoreCase)\n                        ? Convert.ToInt64(number, 16)\n                        : Convert.ToInt64(number, 8);\n                    numberType = JsonToken.Integer;\n                }\n                else\n                {\n                    long value;\n                    ParseResult parseResult = ConvertUtils.Int64TryParse(_stringReference.Chars, _stringReference.StartIndex, _stringReference.Length, out value);\n                    if (parseResult == ParseResult.Success)\n                    {\n                        numberValue = value;\n                        numberType = JsonToken.Integer;\n                    }\n                    else if (parseResult == ParseResult.Overflow)\n                    {\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n                        string number = _stringReference.ToString();\n                        numberValue = BigInteger.Parse(number, CultureInfo.InvariantCulture);\n                        numberType = JsonToken.Integer;\n#else\n                        throw JsonReaderException.Create(this, \"JSON integer {0} is too large or small for an Int64.\".FormatWith(CultureInfo.InvariantCulture, _stringReference.ToString()));\n#endif\n                    }\n                    else\n                    {\n                        string number = _stringReference.ToString();\n\n                        if (_floatParseHandling == FloatParseHandling.Decimal)\n                        {\n                            decimal d;\n                            if (decimal.TryParse(number, NumberStyles.Number | NumberStyles.AllowExponent, CultureInfo.InvariantCulture, out d))\n                                numberValue = d;\n                            else\n                                throw JsonReaderException.Create(this, \"Input string '{0}' is not a valid decimal.\".FormatWith(CultureInfo.InvariantCulture, number));\n                        }\n                        else\n                        {\n                            double d;\n                            if (double.TryParse(number, NumberStyles.Float | NumberStyles.AllowThousands, CultureInfo.InvariantCulture, out d))\n                                numberValue = d;\n                            else\n                                throw JsonReaderException.Create(this, \"Input string '{0}' is not a valid number.\".FormatWith(CultureInfo.InvariantCulture, number));\n                        }\n\n                        numberType = JsonToken.Float;\n                    }\n                }\n            }\n\n            ClearRecentString();\n\n            SetToken(numberType, numberValue);\n        }\n\n        private void ParseComment()\n        {\n            // should have already parsed / character before reaching this method\n            _charPos++;\n\n            if (!EnsureChars(1, false))\n                throw JsonReaderException.Create(this, \"Unexpected end while parsing comment.\");\n\n            bool singlelineComment;\n\n            if (_chars[_charPos] == '*')\n                singlelineComment = false;\n            else if (_chars[_charPos] == '/')\n                singlelineComment = true;\n            else\n                throw JsonReaderException.Create(this, \"Error parsing comment. Expected: *, got {0}.\".FormatWith(CultureInfo.InvariantCulture, _chars[_charPos]));\n\n            _charPos++;\n\n            int initialPosition = _charPos;\n\n            bool commentFinished = false;\n\n            while (!commentFinished)\n            {\n                switch (_chars[_charPos])\n                {\n                    case '\\0':\n                        if (_charsUsed == _charPos)\n                        {\n                            if (ReadData(true) == 0)\n                            {\n                                if (!singlelineComment)\n                                    throw JsonReaderException.Create(this, \"Unexpected end while parsing comment.\");\n\n                                _stringReference = new StringReference(_chars, initialPosition, _charPos - initialPosition);\n                                commentFinished = true;\n                            }\n                        }\n                        else\n                        {\n                            _charPos++;\n                        }\n                        break;\n                    case '*':\n                        _charPos++;\n\n                        if (!singlelineComment)\n                        {\n                            if (EnsureChars(0, true))\n                            {\n                                if (_chars[_charPos] == '/')\n                                {\n                                    _stringReference = new StringReference(_chars, initialPosition, _charPos - initialPosition - 1);\n\n                                    _charPos++;\n                                    commentFinished = true;\n                                }\n                            }\n                        }\n                        break;\n                    case StringUtils.CarriageReturn:\n                        if (singlelineComment)\n                        {\n                            _stringReference = new StringReference(_chars, initialPosition, _charPos - initialPosition);\n                            commentFinished = true;\n                        }\n                        ProcessCarriageReturn(true);\n                        break;\n                    case StringUtils.LineFeed:\n                        if (singlelineComment)\n                        {\n                            _stringReference = new StringReference(_chars, initialPosition, _charPos - initialPosition);\n                            commentFinished = true;\n                        }\n                        ProcessLineFeed();\n                        break;\n                    default:\n                        _charPos++;\n                        break;\n                }\n            }\n\n            SetToken(JsonToken.Comment, _stringReference.ToString());\n\n            ClearRecentString();\n        }\n\n        private bool MatchValue(string value)\n        {\n            if (!EnsureChars(value.Length - 1, true))\n                return false;\n\n            for (int i = 0; i < value.Length; i++)\n            {\n                if (_chars[_charPos + i] != value[i])\n                {\n                    return false;\n                }\n            }\n\n            _charPos += value.Length;\n\n            return true;\n        }\n\n        private bool MatchValueWithTrailingSeparator(string value)\n        {\n            // will match value and then move to the next character, checking that it is a separator character\n            bool match = MatchValue(value);\n\n            if (!match)\n                return false;\n\n            if (!EnsureChars(0, false))\n                return true;\n\n            return IsSeparator(_chars[_charPos]) || _chars[_charPos] == '\\0';\n        }\n\n        private bool IsSeparator(char c)\n        {\n            switch (c)\n            {\n                case '}':\n                case ']':\n                case ',':\n                    return true;\n                case '/':\n                    // check next character to see if start of a comment\n                    if (!EnsureChars(1, false))\n                        return false;\n\n                    var nextChart = _chars[_charPos + 1];\n\n                    return (nextChart == '*' || nextChart == '/');\n                case ')':\n                    if (CurrentState == State.Constructor || CurrentState == State.ConstructorStart)\n                        return true;\n                    break;\n                case ' ':\n                case StringUtils.Tab:\n                case StringUtils.LineFeed:\n                case StringUtils.CarriageReturn:\n                    return true;\n                default:\n                    if (char.IsWhiteSpace(c))\n                        return true;\n                    break;\n            }\n\n            return false;\n        }\n\n        private void ParseTrue()\n        {\n            // check characters equal 'true'\n            // and that it is followed by either a separator character\n            // or the text ends\n            if (MatchValueWithTrailingSeparator(JsonConvert.True))\n            {\n                SetToken(JsonToken.Boolean, true);\n            }\n            else\n            {\n                throw JsonReaderException.Create(this, \"Error parsing boolean value.\");\n            }\n        }\n\n        private void ParseNull()\n        {\n            if (MatchValueWithTrailingSeparator(JsonConvert.Null))\n            {\n                SetToken(JsonToken.Null);\n            }\n            else\n            {\n                throw JsonReaderException.Create(this, \"Error parsing null value.\");\n            }\n        }\n\n        private void ParseUndefined()\n        {\n            if (MatchValueWithTrailingSeparator(JsonConvert.Undefined))\n            {\n                SetToken(JsonToken.Undefined);\n            }\n            else\n            {\n                throw JsonReaderException.Create(this, \"Error parsing undefined value.\");\n            }\n        }\n\n        private void ParseFalse()\n        {\n            if (MatchValueWithTrailingSeparator(JsonConvert.False))\n            {\n                SetToken(JsonToken.Boolean, false);\n            }\n            else\n            {\n                throw JsonReaderException.Create(this, \"Error parsing boolean value.\");\n            }\n        }\n\n        private void ParseNumberNegativeInfinity()\n        {\n            if (MatchValueWithTrailingSeparator(JsonConvert.NegativeInfinity))\n            {\n                if (_floatParseHandling == FloatParseHandling.Decimal)\n                    throw new JsonReaderException(\"Cannot read -Infinity as a decimal.\");\n\n                SetToken(JsonToken.Float, double.NegativeInfinity);\n            }\n            else\n            {\n                throw JsonReaderException.Create(this, \"Error parsing negative infinity value.\");\n            }\n        }\n\n        private void ParseNumberPositiveInfinity()\n        {\n            if (MatchValueWithTrailingSeparator(JsonConvert.PositiveInfinity))\n            {\n                if (_floatParseHandling == FloatParseHandling.Decimal)\n                    throw new JsonReaderException(\"Cannot read Infinity as a decimal.\");\n\n                SetToken(JsonToken.Float, double.PositiveInfinity);\n            }\n            else\n            {\n                throw JsonReaderException.Create(this, \"Error parsing positive infinity value.\");\n            }\n        }\n\n        private void ParseNumberNaN()\n        {\n            if (MatchValueWithTrailingSeparator(JsonConvert.NaN))\n            {\n                if (_floatParseHandling == FloatParseHandling.Decimal)\n                    throw new JsonReaderException(\"Cannot read NaN as a decimal.\");\n\n                SetToken(JsonToken.Float, double.NaN);\n            }\n            else\n            {\n                throw JsonReaderException.Create(this, \"Error parsing NaN value.\");\n            }\n        }\n\n        /// <summary>\n        /// Changes the state to closed. \n        /// </summary>\n        public override void Close()\n        {\n            base.Close();\n\n            if (CloseInput && _reader != null)\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n                _reader.Close();\n#else\n                _reader.Dispose();\n#endif\n\n            if (_buffer != null)\n                _buffer.Clear();\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether the class can return line information.\n        /// </summary>\n        /// <returns>\n        /// \t<c>true</c> if LineNumber and LinePosition can be provided; otherwise, <c>false</c>.\n        /// </returns>\n        public bool HasLineInfo()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Gets the current line number.\n        /// </summary>\n        /// <value>\n        /// The current line number or 0 if no line information is available (for example, HasLineInfo returns false).\n        /// </value>\n        public int LineNumber\n        {\n            get\n            {\n                if (CurrentState == State.Start && LinePosition == 0)\n                    return 0;\n\n                return _lineNumber;\n            }\n        }\n\n        /// <summary>\n        /// Gets the current line position.\n        /// </summary>\n        /// <value>\n        /// The current line position or 0 if no line information is available (for example, HasLineInfo returns false).\n        /// </value>\n        public int LinePosition\n        {\n            get { return _charPos - _lineStartPos; }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonTextWriter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\nusing System.Numerics;\n#endif\nusing System.Text;\nusing System.IO;\nusing System.Xml;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Represents a writer that provides a fast, non-cached, forward-only way of generating Json data.\n    /// </summary>\n    public class JsonTextWriter : JsonWriter\n    {\n        private readonly TextWriter _writer;\n        private Base64Encoder _base64Encoder;\n        private char _indentChar;\n        private int _indentation;\n        private char _quoteChar;\n        private bool _quoteName;\n        private bool[] _charEscapeFlags;\n        private char[] _writeBuffer;\n\n        private Base64Encoder Base64Encoder\n        {\n            get\n            {\n                if (_base64Encoder == null)\n                    _base64Encoder = new Base64Encoder(_writer);\n\n                return _base64Encoder;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets how many IndentChars to write for each level in the hierarchy when <see cref=\"Formatting\"/> is set to <c>Formatting.Indented</c>.\n        /// </summary>\n        public int Indentation\n        {\n            get { return _indentation; }\n            set\n            {\n                if (value < 0)\n                    throw new ArgumentException(\"Indentation value must be greater than 0.\");\n\n                _indentation = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets which character to use to quote attribute values.\n        /// </summary>\n        public char QuoteChar\n        {\n            get { return _quoteChar; }\n            set\n            {\n                if (value != '\"' && value != '\\'')\n                    throw new ArgumentException(@\"Invalid JavaScript string quote character. Valid quote characters are ' and \"\".\");\n\n                _quoteChar = value;\n                UpdateCharEscapeFlags();\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets which character to use for indenting when <see cref=\"Formatting\"/> is set to <c>Formatting.Indented</c>.\n        /// </summary>\n        public char IndentChar\n        {\n            get { return _indentChar; }\n            set { _indentChar = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether object names will be surrounded with quotes.\n        /// </summary>\n        public bool QuoteName\n        {\n            get { return _quoteName; }\n            set { _quoteName = value; }\n        }\n\n        /// <summary>\n        /// Creates an instance of the <c>JsonWriter</c> class using the specified <see cref=\"TextWriter\"/>. \n        /// </summary>\n        /// <param name=\"textWriter\">The <c>TextWriter</c> to write to.</param>\n        public JsonTextWriter(TextWriter textWriter)\n        {\n            if (textWriter == null)\n                throw new ArgumentNullException(\"textWriter\");\n\n            _writer = textWriter;\n            _quoteChar = '\"';\n            _quoteName = true;\n            _indentChar = ' ';\n            _indentation = 2;\n\n            UpdateCharEscapeFlags();\n        }\n\n        /// <summary>\n        /// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.\n        /// </summary>\n        public override void Flush()\n        {\n            _writer.Flush();\n        }\n\n        /// <summary>\n        /// Closes this stream and the underlying stream.\n        /// </summary>\n        public override void Close()\n        {\n            base.Close();\n\n            if (CloseOutput && _writer != null)\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n                _writer.Close();\n#else\n                _writer.Dispose();\n#endif\n        }\n\n        /// <summary>\n        /// Writes the beginning of a Json object.\n        /// </summary>\n        public override void WriteStartObject()\n        {\n            InternalWriteStart(JsonToken.StartObject, JsonContainerType.Object);\n\n            _writer.Write(\"{\");\n        }\n\n        /// <summary>\n        /// Writes the beginning of a Json array.\n        /// </summary>\n        public override void WriteStartArray()\n        {\n            InternalWriteStart(JsonToken.StartArray, JsonContainerType.Array);\n\n            _writer.Write(\"[\");\n        }\n\n        /// <summary>\n        /// Writes the start of a constructor with the given name.\n        /// </summary>\n        /// <param name=\"name\">The name of the constructor.</param>\n        public override void WriteStartConstructor(string name)\n        {\n            InternalWriteStart(JsonToken.StartConstructor, JsonContainerType.Constructor);\n\n            _writer.Write(\"new \");\n            _writer.Write(name);\n            _writer.Write(\"(\");\n        }\n\n        /// <summary>\n        /// Writes the specified end token.\n        /// </summary>\n        /// <param name=\"token\">The end token to write.</param>\n        protected override void WriteEnd(JsonToken token)\n        {\n            switch (token)\n            {\n                case JsonToken.EndObject:\n                    _writer.Write(\"}\");\n                    break;\n                case JsonToken.EndArray:\n                    _writer.Write(\"]\");\n                    break;\n                case JsonToken.EndConstructor:\n                    _writer.Write(\")\");\n                    break;\n                default:\n                    throw JsonWriterException.Create(this, \"Invalid JsonToken: \" + token, null);\n            }\n        }\n\n        /// <summary>\n        /// Writes the property name of a name/value pair on a Json object.\n        /// </summary>\n        /// <param name=\"name\">The name of the property.</param>\n        public override void WritePropertyName(string name)\n        {\n            InternalWritePropertyName(name);\n\n            WriteEscapedString(name, _quoteName);\n\n            _writer.Write(':');\n        }\n\n        /// <summary>\n        /// Writes the property name of a name/value pair on a JSON object.\n        /// </summary>\n        /// <param name=\"name\">The name of the property.</param>\n        /// <param name=\"escape\">A flag to indicate whether the text should be escaped when it is written as a JSON property name.</param>\n        public override void WritePropertyName(string name, bool escape)\n        {\n            InternalWritePropertyName(name);\n\n            if (escape)\n            {\n                WriteEscapedString(name, _quoteName);\n            }\n            else\n            {\n                if (_quoteName)\n                    _writer.Write(_quoteChar);\n\n                _writer.Write(name);\n\n                if (_quoteName)\n                    _writer.Write(_quoteChar);\n            }\n\n            _writer.Write(':');\n        }\n\n        internal override void OnStringEscapeHandlingChanged()\n        {\n            UpdateCharEscapeFlags();\n        }\n\n        private void UpdateCharEscapeFlags()\n        {\n            if (StringEscapeHandling == StringEscapeHandling.EscapeHtml)\n                _charEscapeFlags = JavaScriptUtils.HtmlCharEscapeFlags;\n            else if (_quoteChar == '\"')\n                _charEscapeFlags = JavaScriptUtils.DoubleQuoteCharEscapeFlags;\n            else\n                _charEscapeFlags = JavaScriptUtils.SingleQuoteCharEscapeFlags;\n        }\n\n        /// <summary>\n        /// Writes indent characters.\n        /// </summary>\n        protected override void WriteIndent()\n        {\n            _writer.Write(Environment.NewLine);\n\n            // levels of indentation multiplied by the indent count\n            int currentIndentCount = Top * _indentation;\n\n            while (currentIndentCount > 0)\n            {\n                // write up to a max of 10 characters at once to avoid creating too many new strings\n                int writeCount = Math.Min(currentIndentCount, 10);\n\n                _writer.Write(new string(_indentChar, writeCount));\n\n                currentIndentCount -= writeCount;\n            }\n        }\n\n        /// <summary>\n        /// Writes the JSON value delimiter.\n        /// </summary>\n        protected override void WriteValueDelimiter()\n        {\n            _writer.Write(',');\n        }\n\n        /// <summary>\n        /// Writes an indent space.\n        /// </summary>\n        protected override void WriteIndentSpace()\n        {\n            _writer.Write(' ');\n        }\n\n        private void WriteValueInternal(string value, JsonToken token)\n        {\n            _writer.Write(value);\n        }\n\n        #region WriteValue methods\n        /// <summary>\n        /// Writes a <see cref=\"Object\"/> value.\n        /// An error will raised if the value cannot be written as a single JSON token.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Object\"/> value to write.</param>\n        public override void WriteValue(object value)\n        {\n#if !(NET20 || NET35 || PORTABLE || PORTABLE40)\n            if (value is BigInteger)\n            {\n                InternalWriteValue(JsonToken.Integer);\n                WriteValueInternal(((BigInteger)value).ToString(CultureInfo.InvariantCulture), JsonToken.String);\n            }\n            else\n#endif\n            {\n                base.WriteValue(value);\n            }\n        }\n\n        /// <summary>\n        /// Writes a null value.\n        /// </summary>\n        public override void WriteNull()\n        {\n            InternalWriteValue(JsonToken.Null);\n            WriteValueInternal(JsonConvert.Null, JsonToken.Null);\n        }\n\n        /// <summary>\n        /// Writes an undefined value.\n        /// </summary>\n        public override void WriteUndefined()\n        {\n            InternalWriteValue(JsonToken.Undefined);\n            WriteValueInternal(JsonConvert.Undefined, JsonToken.Undefined);\n        }\n\n        /// <summary>\n        /// Writes raw JSON.\n        /// </summary>\n        /// <param name=\"json\">The raw JSON to write.</param>\n        public override void WriteRaw(string json)\n        {\n            InternalWriteRaw();\n\n            _writer.Write(json);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"String\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"String\"/> value to write.</param>\n        public override void WriteValue(string value)\n        {\n            InternalWriteValue(JsonToken.String);\n\n            if (value == null)\n                WriteValueInternal(JsonConvert.Null, JsonToken.Null);\n            else\n                WriteEscapedString(value, true);\n        }\n\n        private void WriteEscapedString(string value, bool quote)\n        {\n            EnsureWriteBuffer();\n            JavaScriptUtils.WriteEscapedJavaScriptString(_writer, value, _quoteChar, quote, _charEscapeFlags, StringEscapeHandling, ref _writeBuffer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int32\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int32\"/> value to write.</param>\n        public override void WriteValue(int value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n            WriteIntegerValue(value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt32\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt32\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(uint value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n            WriteIntegerValue(value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int64\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int64\"/> value to write.</param>\n        public override void WriteValue(long value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n            WriteIntegerValue(value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt64\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt64\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(ulong value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n            WriteIntegerValue(value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Single\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Single\"/> value to write.</param>\n        public override void WriteValue(float value)\n        {\n            InternalWriteValue(JsonToken.Float);\n            WriteValueInternal(JsonConvert.ToString(value, FloatFormatHandling, QuoteChar, false), JsonToken.Float);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Single}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Single}\"/> value to write.</param>\n        public override void WriteValue(float? value)\n        {\n            if (value == null)\n            {\n                WriteNull();\n            }\n            else\n            {\n                InternalWriteValue(JsonToken.Float);\n                WriteValueInternal(JsonConvert.ToString(value.Value, FloatFormatHandling, QuoteChar, true), JsonToken.Float);\n            }\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Double\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Double\"/> value to write.</param>\n        public override void WriteValue(double value)\n        {\n            InternalWriteValue(JsonToken.Float);\n            WriteValueInternal(JsonConvert.ToString(value, FloatFormatHandling, QuoteChar, false), JsonToken.Float);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Double}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Double}\"/> value to write.</param>\n        public override void WriteValue(double? value)\n        {\n            if (value == null)\n            {\n                WriteNull();\n            }\n            else\n            {\n                InternalWriteValue(JsonToken.Float);\n                WriteValueInternal(JsonConvert.ToString(value.Value, FloatFormatHandling, QuoteChar, true), JsonToken.Float);\n            }\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Boolean\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Boolean\"/> value to write.</param>\n        public override void WriteValue(bool value)\n        {\n            InternalWriteValue(JsonToken.Boolean);\n            WriteValueInternal(JsonConvert.ToString(value), JsonToken.Boolean);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int16\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int16\"/> value to write.</param>\n        public override void WriteValue(short value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n            WriteIntegerValue(value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt16\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt16\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(ushort value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n            WriteIntegerValue(value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Char\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Char\"/> value to write.</param>\n        public override void WriteValue(char value)\n        {\n            InternalWriteValue(JsonToken.String);\n            WriteValueInternal(JsonConvert.ToString(value), JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Byte\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Byte\"/> value to write.</param>\n        public override void WriteValue(byte value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n            WriteIntegerValue(value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"SByte\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"SByte\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(sbyte value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n            WriteIntegerValue(value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Decimal\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Decimal\"/> value to write.</param>\n        public override void WriteValue(decimal value)\n        {\n            InternalWriteValue(JsonToken.Float);\n            WriteValueInternal(JsonConvert.ToString(value), JsonToken.Float);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"DateTime\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"DateTime\"/> value to write.</param>\n        public override void WriteValue(DateTime value)\n        {\n            InternalWriteValue(JsonToken.Date);\n            value = DateTimeUtils.EnsureDateTime(value, DateTimeZoneHandling);\n\n            if (string.IsNullOrEmpty(DateFormatString))\n            {\n                EnsureWriteBuffer();\n\n                int pos = 0;\n                _writeBuffer[pos++] = _quoteChar;\n                pos = DateTimeUtils.WriteDateTimeString(_writeBuffer, pos, value, null, value.Kind, DateFormatHandling);\n                _writeBuffer[pos++] = _quoteChar;\n\n                _writer.Write(_writeBuffer, 0, pos);\n            }\n            else\n            {\n                _writer.Write(_quoteChar);\n                _writer.Write(value.ToString(DateFormatString, Culture));\n                _writer.Write(_quoteChar);\n            }\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"T:Byte[]\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"T:Byte[]\"/> value to write.</param>\n        public override void WriteValue(byte[] value)\n        {\n            if (value == null)\n            {\n                WriteNull();\n            }\n            else\n            {\n                InternalWriteValue(JsonToken.Bytes);\n                _writer.Write(_quoteChar);\n                Base64Encoder.Encode(value, 0, value.Length);\n                Base64Encoder.Flush();\n                _writer.Write(_quoteChar);\n            }\n        }\n\n#if !NET20\n        /// <summary>\n        /// Writes a <see cref=\"DateTimeOffset\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"DateTimeOffset\"/> value to write.</param>\n        public override void WriteValue(DateTimeOffset value)\n        {\n            InternalWriteValue(JsonToken.Date);\n\n            if (string.IsNullOrEmpty(DateFormatString))\n            {\n                EnsureWriteBuffer();\n\n                int pos = 0;\n                _writeBuffer[pos++] = _quoteChar;\n                pos = DateTimeUtils.WriteDateTimeString(_writeBuffer, pos, (DateFormatHandling == DateFormatHandling.IsoDateFormat) ? value.DateTime : value.UtcDateTime, value.Offset, DateTimeKind.Local, DateFormatHandling);\n                _writeBuffer[pos++] = _quoteChar;\n\n                _writer.Write(_writeBuffer, 0, pos);\n            }\n            else\n            {\n                _writer.Write(_quoteChar);\n                _writer.Write(value.ToString(DateFormatString, Culture));\n                _writer.Write(_quoteChar);\n            }\n        }\n#endif\n\n        /// <summary>\n        /// Writes a <see cref=\"Guid\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Guid\"/> value to write.</param>\n        public override void WriteValue(Guid value)\n        {\n            InternalWriteValue(JsonToken.String);\n            WriteValueInternal(JsonConvert.ToString(value, _quoteChar), JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"TimeSpan\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"TimeSpan\"/> value to write.</param>\n        public override void WriteValue(TimeSpan value)\n        {\n            InternalWriteValue(JsonToken.String);\n            WriteValueInternal(JsonConvert.ToString(value, _quoteChar), JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Uri\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Uri\"/> value to write.</param>\n        public override void WriteValue(Uri value)\n        {\n            if (value == null)\n            {\n                WriteNull();\n            }\n            else\n            {\n                InternalWriteValue(JsonToken.String);\n                WriteValueInternal(JsonConvert.ToString(value, _quoteChar), JsonToken.String);\n            }\n        }\n        #endregion\n\n        /// <summary>\n        /// Writes out a comment <code>/*...*/</code> containing the specified text. \n        /// </summary>\n        /// <param name=\"text\">Text to place inside the comment.</param>\n        public override void WriteComment(string text)\n        {\n            InternalWriteComment();\n\n            _writer.Write(\"/*\");\n            _writer.Write(text);\n            _writer.Write(\"*/\");\n        }\n\n        /// <summary>\n        /// Writes out the given white space.\n        /// </summary>\n        /// <param name=\"ws\">The string of white space characters.</param>\n        public override void WriteWhitespace(string ws)\n        {\n            InternalWriteWhitespace(ws);\n\n            _writer.Write(ws);\n        }\n\n        private void EnsureWriteBuffer()\n        {\n            if (_writeBuffer == null)\n                _writeBuffer = new char[64];\n        }\n\n        private void WriteIntegerValue(long value)\n        {\n            EnsureWriteBuffer();\n\n            if (value >= 0 && value <= 9)\n            {\n                _writer.Write((char)('0' + value));\n            }\n            else\n            {\n                ulong uvalue = (value < 0) ? (ulong)-value : (ulong)value;\n\n                if (value < 0)\n                    _writer.Write('-');\n\n                WriteIntegerValue(uvalue);\n            }\n        }\n\n        private void WriteIntegerValue(ulong uvalue)\n        {\n            EnsureWriteBuffer();\n\n            if (uvalue <= 9)\n            {\n                _writer.Write((char)('0' + uvalue));\n            }\n            else\n            {\n                int totalLength = MathUtils.IntLength(uvalue);\n                int length = 0;\n\n                do\n                {\n                    _writeBuffer[totalLength - ++length] = (char)('0' + (uvalue % 10));\n                    uvalue /= 10;\n                } while (uvalue != 0);\n\n                _writer.Write(_writeBuffer, 0, length);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonToken.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies the type of Json token.\n    /// </summary>\n    public enum JsonToken\n    {\n        /// <summary>\n        /// This is returned by the <see cref=\"JsonReader\"/> if a <see cref=\"JsonReader.Read\"/> method has not been called. \n        /// </summary>\n        None,\n\n        /// <summary>\n        /// An object start token.\n        /// </summary>\n        StartObject,\n\n        /// <summary>\n        /// An array start token.\n        /// </summary>\n        StartArray,\n\n        /// <summary>\n        /// A constructor start token.\n        /// </summary>\n        StartConstructor,\n\n        /// <summary>\n        /// An object property name.\n        /// </summary>\n        PropertyName,\n\n        /// <summary>\n        /// A comment.\n        /// </summary>\n        Comment,\n\n        /// <summary>\n        /// Raw JSON.\n        /// </summary>\n        Raw,\n\n        /// <summary>\n        /// An integer.\n        /// </summary>\n        Integer,\n\n        /// <summary>\n        /// A float.\n        /// </summary>\n        Float,\n\n        /// <summary>\n        /// A string.\n        /// </summary>\n        String,\n\n        /// <summary>\n        /// A boolean.\n        /// </summary>\n        Boolean,\n\n        /// <summary>\n        /// A null token.\n        /// </summary>\n        Null,\n\n        /// <summary>\n        /// An undefined token.\n        /// </summary>\n        Undefined,\n\n        /// <summary>\n        /// An object end token.\n        /// </summary>\n        EndObject,\n\n        /// <summary>\n        /// An array end token.\n        /// </summary>\n        EndArray,\n\n        /// <summary>\n        /// A constructor end token.\n        /// </summary>\n        EndConstructor,\n\n        /// <summary>\n        /// A Date.\n        /// </summary>\n        Date,\n\n        /// <summary>\n        /// Byte data.\n        /// </summary>\n        Bytes\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonValidatingReader.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\nusing System.Numerics;\n#endif\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Schema;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\nusing System.Text.RegularExpressions;\nusing System.IO;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Represents a reader that provides <see cref=\"JsonSchema\"/> validation.\n    /// </summary>\n    public class JsonValidatingReader : JsonReader, IJsonLineInfo\n    {\n        private class SchemaScope\n        {\n            private readonly JTokenType _tokenType;\n            private readonly IList<JsonSchemaModel> _schemas;\n            private readonly Dictionary<string, bool> _requiredProperties;\n\n            public string CurrentPropertyName { get; set; }\n            public int ArrayItemCount { get; set; }\n            public bool IsUniqueArray { get; set; }\n            public bool IsEnum { get; set; }\n            public IList<JToken> UniqueArrayItems { get; set; }\n            public JTokenWriter CurrentItemWriter { get; set; }\n\n            public IList<JsonSchemaModel> Schemas\n            {\n                get { return _schemas; }\n            }\n\n            public Dictionary<string, bool> RequiredProperties\n            {\n                get { return _requiredProperties; }\n            }\n\n            public JTokenType TokenType\n            {\n                get { return _tokenType; }\n            }\n\n            public SchemaScope(JTokenType tokenType, IList<JsonSchemaModel> schemas)\n            {\n                _tokenType = tokenType;\n                _schemas = schemas;\n\n                _requiredProperties = schemas.SelectMany<JsonSchemaModel, string>(GetRequiredProperties).Distinct().ToDictionary(p => p, p => false);\n\n                if (tokenType == JTokenType.Array && schemas.Any(s => s.UniqueItems))\n                {\n                    IsUniqueArray = true;\n                    UniqueArrayItems = new List<JToken>();\n                }\n            }\n\n            private IEnumerable<string> GetRequiredProperties(JsonSchemaModel schema)\n            {\n                if (schema == null || schema.Properties == null)\n                    return Enumerable.Empty<string>();\n\n                return schema.Properties.Where(p => p.Value.Required).Select(p => p.Key);\n            }\n        }\n\n        private readonly JsonReader _reader;\n        private readonly Stack<SchemaScope> _stack;\n        private JsonSchema _schema;\n        private JsonSchemaModel _model;\n        private SchemaScope _currentScope;\n\n        /// <summary>\n        /// Sets an event handler for receiving schema validation errors.\n        /// </summary>\n        public event ValidationEventHandler ValidationEventHandler;\n\n        /// <summary>\n        /// Gets the text value of the current JSON token.\n        /// </summary>\n        /// <value></value>\n        public override object Value\n        {\n            get { return _reader.Value; }\n        }\n\n        /// <summary>\n        /// Gets the depth of the current token in the JSON document.\n        /// </summary>\n        /// <value>The depth of the current token in the JSON document.</value>\n        public override int Depth\n        {\n            get { return _reader.Depth; }\n        }\n\n        /// <summary>\n        /// Gets the path of the current JSON token. \n        /// </summary>\n        public override string Path\n        {\n            get { return _reader.Path; }\n        }\n\n        /// <summary>\n        /// Gets the quotation mark character used to enclose the value of a string.\n        /// </summary>\n        /// <value></value>\n        public override char QuoteChar\n        {\n            get { return _reader.QuoteChar; }\n            protected internal set { }\n        }\n\n        /// <summary>\n        /// Gets the type of the current JSON token.\n        /// </summary>\n        /// <value></value>\n        public override JsonToken TokenType\n        {\n            get { return _reader.TokenType; }\n        }\n\n        /// <summary>\n        /// Gets the Common Language Runtime (CLR) type for the current JSON token.\n        /// </summary>\n        /// <value></value>\n        public override Type ValueType\n        {\n            get { return _reader.ValueType; }\n        }\n\n        private void Push(SchemaScope scope)\n        {\n            _stack.Push(scope);\n            _currentScope = scope;\n        }\n\n        private SchemaScope Pop()\n        {\n            SchemaScope poppedScope = _stack.Pop();\n            _currentScope = (_stack.Count != 0)\n                ? _stack.Peek()\n                : null;\n\n            return poppedScope;\n        }\n\n        private IList<JsonSchemaModel> CurrentSchemas\n        {\n            get { return _currentScope.Schemas; }\n        }\n\n        private static readonly IList<JsonSchemaModel> EmptySchemaList = new List<JsonSchemaModel>();\n\n        private IList<JsonSchemaModel> CurrentMemberSchemas\n        {\n            get\n            {\n                if (_currentScope == null)\n                    return new List<JsonSchemaModel>(new[] { _model });\n\n                if (_currentScope.Schemas == null || _currentScope.Schemas.Count == 0)\n                    return EmptySchemaList;\n\n                switch (_currentScope.TokenType)\n                {\n                    case JTokenType.None:\n                        return _currentScope.Schemas;\n                    case JTokenType.Object:\n                    {\n                        if (_currentScope.CurrentPropertyName == null)\n                            throw new JsonReaderException(\"CurrentPropertyName has not been set on scope.\");\n\n                        IList<JsonSchemaModel> schemas = new List<JsonSchemaModel>();\n\n                        foreach (JsonSchemaModel schema in CurrentSchemas)\n                        {\n                            JsonSchemaModel propertySchema;\n                            if (schema.Properties != null && schema.Properties.TryGetValue(_currentScope.CurrentPropertyName, out propertySchema))\n                            {\n                                schemas.Add(propertySchema);\n                            }\n                            if (schema.PatternProperties != null)\n                            {\n                                foreach (KeyValuePair<string, JsonSchemaModel> patternProperty in schema.PatternProperties)\n                                {\n                                    if (Regex.IsMatch(_currentScope.CurrentPropertyName, patternProperty.Key))\n                                    {\n                                        schemas.Add(patternProperty.Value);\n                                    }\n                                }\n                            }\n\n                            if (schemas.Count == 0 && schema.AllowAdditionalProperties && schema.AdditionalProperties != null)\n                                schemas.Add(schema.AdditionalProperties);\n                        }\n\n                        return schemas;\n                    }\n                    case JTokenType.Array:\n                    {\n                        IList<JsonSchemaModel> schemas = new List<JsonSchemaModel>();\n\n                        foreach (JsonSchemaModel schema in CurrentSchemas)\n                        {\n                            if (!schema.PositionalItemsValidation)\n                            {\n                                if (schema.Items != null && schema.Items.Count > 0)\n                                    schemas.Add(schema.Items[0]);\n                            }\n                            else\n                            {\n                                if (schema.Items != null && schema.Items.Count > 0)\n                                {\n                                    if (schema.Items.Count > (_currentScope.ArrayItemCount - 1))\n                                        schemas.Add(schema.Items[_currentScope.ArrayItemCount - 1]);\n                                }\n\n                                if (schema.AllowAdditionalItems && schema.AdditionalItems != null)\n                                    schemas.Add(schema.AdditionalItems);\n                            }\n                        }\n\n                        return schemas;\n                    }\n                    case JTokenType.Constructor:\n                        return EmptySchemaList;\n                    default:\n                        throw new ArgumentOutOfRangeException(\"TokenType\", \"Unexpected token type: {0}\".FormatWith(CultureInfo.InvariantCulture, _currentScope.TokenType));\n                }\n            }\n        }\n\n        private void RaiseError(string message, JsonSchemaModel schema)\n        {\n            IJsonLineInfo lineInfo = this;\n\n            string exceptionMessage = (lineInfo.HasLineInfo())\n                ? message + \" Line {0}, position {1}.\".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition)\n                : message;\n\n            OnValidationEvent(new JsonSchemaException(exceptionMessage, null, Path, lineInfo.LineNumber, lineInfo.LinePosition));\n        }\n\n        private void OnValidationEvent(JsonSchemaException exception)\n        {\n            ValidationEventHandler handler = ValidationEventHandler;\n            if (handler != null)\n                handler(this, new ValidationEventArgs(exception));\n            else\n                throw exception;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonValidatingReader\"/> class that\n        /// validates the content returned from the given <see cref=\"JsonReader\"/>.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read from while validating.</param>\n        public JsonValidatingReader(JsonReader reader)\n        {\n            ValidationUtils.ArgumentNotNull(reader, \"reader\");\n            _reader = reader;\n            _stack = new Stack<SchemaScope>();\n        }\n\n        /// <summary>\n        /// Gets or sets the schema.\n        /// </summary>\n        /// <value>The schema.</value>\n        public JsonSchema Schema\n        {\n            get { return _schema; }\n            set\n            {\n                if (TokenType != JsonToken.None)\n                    throw new InvalidOperationException(\"Cannot change schema while validating JSON.\");\n\n                _schema = value;\n                _model = null;\n            }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"JsonReader\"/> used to construct this <see cref=\"JsonValidatingReader\"/>.\n        /// </summary>\n        /// <value>The <see cref=\"JsonReader\"/> specified in the constructor.</value>\n        public JsonReader Reader\n        {\n            get { return _reader; }\n        }\n\n        private void ValidateNotDisallowed(JsonSchemaModel schema)\n        {\n            if (schema == null)\n                return;\n\n            JsonSchemaType? currentNodeType = GetCurrentNodeSchemaType();\n            if (currentNodeType != null)\n            {\n                if (JsonSchemaGenerator.HasFlag(schema.Disallow, currentNodeType.Value))\n                    RaiseError(\"Type {0} is disallowed.\".FormatWith(CultureInfo.InvariantCulture, currentNodeType), schema);\n            }\n        }\n\n        private JsonSchemaType? GetCurrentNodeSchemaType()\n        {\n            switch (_reader.TokenType)\n            {\n                case JsonToken.StartObject:\n                    return JsonSchemaType.Object;\n                case JsonToken.StartArray:\n                    return JsonSchemaType.Array;\n                case JsonToken.Integer:\n                    return JsonSchemaType.Integer;\n                case JsonToken.Float:\n                    return JsonSchemaType.Float;\n                case JsonToken.String:\n                    return JsonSchemaType.String;\n                case JsonToken.Boolean:\n                    return JsonSchemaType.Boolean;\n                case JsonToken.Null:\n                    return JsonSchemaType.Null;\n                default:\n                    return null;\n            }\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{Int32}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{Int32}\"/>.</returns>\n        public override int? ReadAsInt32()\n        {\n            int? i = _reader.ReadAsInt32();\n\n            ValidateCurrentToken();\n            return i;\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"T:Byte[]\"/>.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:Byte[]\"/> or a null reference if the next JSON token is null.\n        /// </returns>\n        public override byte[] ReadAsBytes()\n        {\n            byte[] data = _reader.ReadAsBytes();\n\n            ValidateCurrentToken();\n            return data;\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{Decimal}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{Decimal}\"/>.</returns>\n        public override decimal? ReadAsDecimal()\n        {\n            decimal? d = _reader.ReadAsDecimal();\n\n            ValidateCurrentToken();\n            return d;\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"String\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"String\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override string ReadAsString()\n        {\n            string s = _reader.ReadAsString();\n\n            ValidateCurrentToken();\n            return s;\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{DateTime}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"String\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override DateTime? ReadAsDateTime()\n        {\n            DateTime? dateTime = _reader.ReadAsDateTime();\n\n            ValidateCurrentToken();\n            return dateTime;\n        }\n\n#if !NET20\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{DateTimeOffset}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{DateTimeOffset}\"/>.</returns>\n        public override DateTimeOffset? ReadAsDateTimeOffset()\n        {\n            DateTimeOffset? dateTimeOffset = _reader.ReadAsDateTimeOffset();\n\n            ValidateCurrentToken();\n            return dateTimeOffset;\n        }\n#endif\n\n        /// <summary>\n        /// Reads the next JSON token from the stream.\n        /// </summary>\n        /// <returns>\n        /// true if the next token was read successfully; false if there are no more tokens to read.\n        /// </returns>\n        public override bool Read()\n        {\n            if (!_reader.Read())\n                return false;\n\n            if (_reader.TokenType == JsonToken.Comment)\n                return true;\n\n            ValidateCurrentToken();\n            return true;\n        }\n\n        private void ValidateCurrentToken()\n        {\n            // first time validate has been called. build model\n            if (_model == null)\n            {\n                JsonSchemaModelBuilder builder = new JsonSchemaModelBuilder();\n                _model = builder.Build(_schema);\n\n                if (!JsonWriter.IsStartToken(_reader.TokenType))\n                    Push(new SchemaScope(JTokenType.None, CurrentMemberSchemas));\n            }\n\n            switch (_reader.TokenType)\n            {\n                case JsonToken.StartObject:\n                    ProcessValue();\n                    IList<JsonSchemaModel> objectSchemas = CurrentMemberSchemas.Where(ValidateObject).ToList();\n                    Push(new SchemaScope(JTokenType.Object, objectSchemas));\n                    WriteToken(CurrentSchemas);\n                    break;\n                case JsonToken.StartArray:\n                    ProcessValue();\n                    IList<JsonSchemaModel> arraySchemas = CurrentMemberSchemas.Where(ValidateArray).ToList();\n                    Push(new SchemaScope(JTokenType.Array, arraySchemas));\n                    WriteToken(CurrentSchemas);\n                    break;\n                case JsonToken.StartConstructor:\n                    ProcessValue();\n                    Push(new SchemaScope(JTokenType.Constructor, null));\n                    WriteToken(CurrentSchemas);\n                    break;\n                case JsonToken.PropertyName:\n                    WriteToken(CurrentSchemas);\n                    foreach (JsonSchemaModel schema in CurrentSchemas)\n                    {\n                        ValidatePropertyName(schema);\n                    }\n                    break;\n                case JsonToken.Raw:\n                    ProcessValue();\n                    break;\n                case JsonToken.Integer:\n                    ProcessValue();\n                    WriteToken(CurrentMemberSchemas);\n                    foreach (JsonSchemaModel schema in CurrentMemberSchemas)\n                    {\n                        ValidateInteger(schema);\n                    }\n                    break;\n                case JsonToken.Float:\n                    ProcessValue();\n                    WriteToken(CurrentMemberSchemas);\n                    foreach (JsonSchemaModel schema in CurrentMemberSchemas)\n                    {\n                        ValidateFloat(schema);\n                    }\n                    break;\n                case JsonToken.String:\n                    ProcessValue();\n                    WriteToken(CurrentMemberSchemas);\n                    foreach (JsonSchemaModel schema in CurrentMemberSchemas)\n                    {\n                        ValidateString(schema);\n                    }\n                    break;\n                case JsonToken.Boolean:\n                    ProcessValue();\n                    WriteToken(CurrentMemberSchemas);\n                    foreach (JsonSchemaModel schema in CurrentMemberSchemas)\n                    {\n                        ValidateBoolean(schema);\n                    }\n                    break;\n                case JsonToken.Null:\n                    ProcessValue();\n                    WriteToken(CurrentMemberSchemas);\n                    foreach (JsonSchemaModel schema in CurrentMemberSchemas)\n                    {\n                        ValidateNull(schema);\n                    }\n                    break;\n                case JsonToken.EndObject:\n                    WriteToken(CurrentSchemas);\n                    foreach (JsonSchemaModel schema in CurrentSchemas)\n                    {\n                        ValidateEndObject(schema);\n                    }\n                    Pop();\n                    break;\n                case JsonToken.EndArray:\n                    WriteToken(CurrentSchemas);\n                    foreach (JsonSchemaModel schema in CurrentSchemas)\n                    {\n                        ValidateEndArray(schema);\n                    }\n                    Pop();\n                    break;\n                case JsonToken.EndConstructor:\n                    WriteToken(CurrentSchemas);\n                    Pop();\n                    break;\n                case JsonToken.Undefined:\n                case JsonToken.Date:\n                case JsonToken.Bytes:\n                    // these have no equivalent in JSON schema\n                    WriteToken(CurrentMemberSchemas);\n                    break;\n                case JsonToken.None:\n                    // no content, do nothing\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        private void WriteToken(IList<JsonSchemaModel> schemas)\n        {\n            foreach (SchemaScope schemaScope in _stack)\n            {\n                bool isInUniqueArray = (schemaScope.TokenType == JTokenType.Array && schemaScope.IsUniqueArray && schemaScope.ArrayItemCount > 0);\n\n                if (isInUniqueArray || schemaScope.IsEnum || schemas.Any(s => s.Enum != null))\n                {\n                    if (schemaScope.CurrentItemWriter == null)\n                    {\n                        if (JsonWriter.IsEndToken(_reader.TokenType))\n                            continue;\n\n                        schemaScope.CurrentItemWriter = new JTokenWriter();\n                    }\n\n                    schemaScope.CurrentItemWriter.WriteToken(_reader, false);\n\n                    // finished writing current item\n                    if (schemaScope.CurrentItemWriter.Top == 0 && _reader.TokenType != JsonToken.PropertyName)\n                    {\n                        JToken finishedItem = schemaScope.CurrentItemWriter.Token;\n\n                        // start next item with new writer\n                        schemaScope.CurrentItemWriter = null;\n\n                        if (isInUniqueArray)\n                        {\n                            if (schemaScope.UniqueArrayItems.Contains(finishedItem, JToken.EqualityComparer))\n                                RaiseError(\"Non-unique array item at index {0}.\".FormatWith(CultureInfo.InvariantCulture, schemaScope.ArrayItemCount - 1), schemaScope.Schemas.First(s => s.UniqueItems));\n\n                            schemaScope.UniqueArrayItems.Add(finishedItem);\n                        }\n                        else if (schemaScope.IsEnum || schemas.Any(s => s.Enum != null))\n                        {\n                            foreach (JsonSchemaModel schema in schemas)\n                            {\n                                if (schema.Enum != null)\n                                {\n                                    if (!schema.Enum.ContainsValue(finishedItem, JToken.EqualityComparer))\n                                    {\n                                        StringWriter sw = new StringWriter(CultureInfo.InvariantCulture);\n                                        finishedItem.WriteTo(new JsonTextWriter(sw));\n\n                                        RaiseError(\"Value {0} is not defined in enum.\".FormatWith(CultureInfo.InvariantCulture, sw.ToString()), schema);\n                                    }\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        private void ValidateEndObject(JsonSchemaModel schema)\n        {\n            if (schema == null)\n                return;\n\n            Dictionary<string, bool> requiredProperties = _currentScope.RequiredProperties;\n\n            if (requiredProperties != null)\n            {\n                List<string> unmatchedRequiredProperties =\n                    requiredProperties.Where(kv => !kv.Value).Select(kv => kv.Key).ToList();\n\n                if (unmatchedRequiredProperties.Count > 0)\n                    RaiseError(\"Required properties are missing from object: {0}.\".FormatWith(CultureInfo.InvariantCulture, string.Join(\", \", unmatchedRequiredProperties.ToArray())), schema);\n            }\n        }\n\n        private void ValidateEndArray(JsonSchemaModel schema)\n        {\n            if (schema == null)\n                return;\n\n            int arrayItemCount = _currentScope.ArrayItemCount;\n\n            if (schema.MaximumItems != null && arrayItemCount > schema.MaximumItems)\n                RaiseError(\"Array item count {0} exceeds maximum count of {1}.\".FormatWith(CultureInfo.InvariantCulture, arrayItemCount, schema.MaximumItems), schema);\n\n            if (schema.MinimumItems != null && arrayItemCount < schema.MinimumItems)\n                RaiseError(\"Array item count {0} is less than minimum count of {1}.\".FormatWith(CultureInfo.InvariantCulture, arrayItemCount, schema.MinimumItems), schema);\n        }\n\n        private void ValidateNull(JsonSchemaModel schema)\n        {\n            if (schema == null)\n                return;\n\n            if (!TestType(schema, JsonSchemaType.Null))\n                return;\n\n            ValidateNotDisallowed(schema);\n        }\n\n        private void ValidateBoolean(JsonSchemaModel schema)\n        {\n            if (schema == null)\n                return;\n\n            if (!TestType(schema, JsonSchemaType.Boolean))\n                return;\n\n            ValidateNotDisallowed(schema);\n        }\n\n        private void ValidateString(JsonSchemaModel schema)\n        {\n            if (schema == null)\n                return;\n\n            if (!TestType(schema, JsonSchemaType.String))\n                return;\n\n            ValidateNotDisallowed(schema);\n\n            string value = _reader.Value.ToString();\n\n            if (schema.MaximumLength != null && value.Length > schema.MaximumLength)\n                RaiseError(\"String '{0}' exceeds maximum length of {1}.\".FormatWith(CultureInfo.InvariantCulture, value, schema.MaximumLength), schema);\n\n            if (schema.MinimumLength != null && value.Length < schema.MinimumLength)\n                RaiseError(\"String '{0}' is less than minimum length of {1}.\".FormatWith(CultureInfo.InvariantCulture, value, schema.MinimumLength), schema);\n\n            if (schema.Patterns != null)\n            {\n                foreach (string pattern in schema.Patterns)\n                {\n                    if (!Regex.IsMatch(value, pattern))\n                        RaiseError(\"String '{0}' does not match regex pattern '{1}'.\".FormatWith(CultureInfo.InvariantCulture, value, pattern), schema);\n                }\n            }\n        }\n\n        private void ValidateInteger(JsonSchemaModel schema)\n        {\n            if (schema == null)\n                return;\n\n            if (!TestType(schema, JsonSchemaType.Integer))\n                return;\n\n            ValidateNotDisallowed(schema);\n\n            object value = _reader.Value;\n\n            if (schema.Maximum != null)\n            {\n                if (JValue.Compare(JTokenType.Integer, value, schema.Maximum) > 0)\n                    RaiseError(\"Integer {0} exceeds maximum value of {1}.\".FormatWith(CultureInfo.InvariantCulture, value, schema.Maximum), schema);\n                if (schema.ExclusiveMaximum && JValue.Compare(JTokenType.Integer, value, schema.Maximum) == 0)\n                    RaiseError(\"Integer {0} equals maximum value of {1} and exclusive maximum is true.\".FormatWith(CultureInfo.InvariantCulture, value, schema.Maximum), schema);\n            }\n\n            if (schema.Minimum != null)\n            {\n                if (JValue.Compare(JTokenType.Integer, value, schema.Minimum) < 0)\n                    RaiseError(\"Integer {0} is less than minimum value of {1}.\".FormatWith(CultureInfo.InvariantCulture, value, schema.Minimum), schema);\n                if (schema.ExclusiveMinimum && JValue.Compare(JTokenType.Integer, value, schema.Minimum) == 0)\n                    RaiseError(\"Integer {0} equals minimum value of {1} and exclusive minimum is true.\".FormatWith(CultureInfo.InvariantCulture, value, schema.Minimum), schema);\n            }\n\n            if (schema.DivisibleBy != null)\n            {\n                bool notDivisible;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n                if (value is BigInteger)\n                {\n                    // not that this will lose any decimal point on DivisibleBy\n                    // so manually raise an error if DivisibleBy is not an integer and value is not zero\n                    BigInteger i = (BigInteger)value;\n                    bool divisibleNonInteger = !Math.Abs(schema.DivisibleBy.Value - Math.Truncate(schema.DivisibleBy.Value)).Equals(0);\n                    if (divisibleNonInteger)\n                        notDivisible = i != 0;\n                    else\n                        notDivisible = i % new BigInteger(schema.DivisibleBy.Value) != 0;\n                }\n                else\n#endif\n                    notDivisible = !IsZero(Convert.ToInt64(value, CultureInfo.InvariantCulture) % schema.DivisibleBy.Value);\n\n                if (notDivisible)\n                    RaiseError(\"Integer {0} is not evenly divisible by {1}.\".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.DivisibleBy), schema);\n            }\n        }\n\n        private void ProcessValue()\n        {\n            if (_currentScope != null && _currentScope.TokenType == JTokenType.Array)\n            {\n                _currentScope.ArrayItemCount++;\n\n                foreach (JsonSchemaModel currentSchema in CurrentSchemas)\n                {\n                    // if there is positional validation and the array index is past the number of item validation schemas and there is no additonal items then error\n                    if (currentSchema != null\n                        && currentSchema.PositionalItemsValidation\n                        && !currentSchema.AllowAdditionalItems\n                        && (currentSchema.Items == null || _currentScope.ArrayItemCount - 1 >= currentSchema.Items.Count))\n                    {\n                        RaiseError(\"Index {0} has not been defined and the schema does not allow additional items.\".FormatWith(CultureInfo.InvariantCulture, _currentScope.ArrayItemCount), currentSchema);\n                    }\n                }\n            }\n        }\n\n        private void ValidateFloat(JsonSchemaModel schema)\n        {\n            if (schema == null)\n                return;\n\n            if (!TestType(schema, JsonSchemaType.Float))\n                return;\n\n            ValidateNotDisallowed(schema);\n\n            double value = Convert.ToDouble(_reader.Value, CultureInfo.InvariantCulture);\n\n            if (schema.Maximum != null)\n            {\n                if (value > schema.Maximum)\n                    RaiseError(\"Float {0} exceeds maximum value of {1}.\".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.Maximum), schema);\n                if (schema.ExclusiveMaximum && value == schema.Maximum)\n                    RaiseError(\"Float {0} equals maximum value of {1} and exclusive maximum is true.\".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.Maximum), schema);\n            }\n\n            if (schema.Minimum != null)\n            {\n                if (value < schema.Minimum)\n                    RaiseError(\"Float {0} is less than minimum value of {1}.\".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.Minimum), schema);\n                if (schema.ExclusiveMinimum && value == schema.Minimum)\n                    RaiseError(\"Float {0} equals minimum value of {1} and exclusive minimum is true.\".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.Minimum), schema);\n            }\n\n            if (schema.DivisibleBy != null)\n            {\n                double remainder = FloatingPointRemainder(value, schema.DivisibleBy.Value);\n\n                if (!IsZero(remainder))\n                    RaiseError(\"Float {0} is not evenly divisible by {1}.\".FormatWith(CultureInfo.InvariantCulture, JsonConvert.ToString(value), schema.DivisibleBy), schema);\n            }\n        }\n\n        private static double FloatingPointRemainder(double dividend, double divisor)\n        {\n            return dividend - Math.Floor(dividend / divisor) * divisor;\n        }\n\n        private static bool IsZero(double value)\n        {\n            const double epsilon = 2.2204460492503131e-016;\n\n            return Math.Abs(value) < 20.0 * epsilon;\n        }\n\n        private void ValidatePropertyName(JsonSchemaModel schema)\n        {\n            if (schema == null)\n                return;\n\n            string propertyName = Convert.ToString(_reader.Value, CultureInfo.InvariantCulture);\n\n            if (_currentScope.RequiredProperties.ContainsKey(propertyName))\n                _currentScope.RequiredProperties[propertyName] = true;\n\n            if (!schema.AllowAdditionalProperties)\n            {\n                bool propertyDefinied = IsPropertyDefinied(schema, propertyName);\n\n                if (!propertyDefinied)\n                    RaiseError(\"Property '{0}' has not been defined and the schema does not allow additional properties.\".FormatWith(CultureInfo.InvariantCulture, propertyName), schema);\n            }\n\n            _currentScope.CurrentPropertyName = propertyName;\n        }\n\n        private bool IsPropertyDefinied(JsonSchemaModel schema, string propertyName)\n        {\n            if (schema.Properties != null && schema.Properties.ContainsKey(propertyName))\n                return true;\n\n            if (schema.PatternProperties != null)\n            {\n                foreach (string pattern in schema.PatternProperties.Keys)\n                {\n                    if (Regex.IsMatch(propertyName, pattern))\n                        return true;\n                }\n            }\n\n            return false;\n        }\n\n        private bool ValidateArray(JsonSchemaModel schema)\n        {\n            if (schema == null)\n                return true;\n\n            return (TestType(schema, JsonSchemaType.Array));\n        }\n\n        private bool ValidateObject(JsonSchemaModel schema)\n        {\n            if (schema == null)\n                return true;\n\n            return (TestType(schema, JsonSchemaType.Object));\n        }\n\n        private bool TestType(JsonSchemaModel currentSchema, JsonSchemaType currentType)\n        {\n            if (!JsonSchemaGenerator.HasFlag(currentSchema.Type, currentType))\n            {\n                RaiseError(\"Invalid type. Expected {0} but got {1}.\".FormatWith(CultureInfo.InvariantCulture, currentSchema.Type, currentType), currentSchema);\n                return false;\n            }\n\n            return true;\n        }\n\n        bool IJsonLineInfo.HasLineInfo()\n        {\n            IJsonLineInfo lineInfo = _reader as IJsonLineInfo;\n            return lineInfo != null && lineInfo.HasLineInfo();\n        }\n\n        int IJsonLineInfo.LineNumber\n        {\n            get\n            {\n                IJsonLineInfo lineInfo = _reader as IJsonLineInfo;\n                return (lineInfo != null) ? lineInfo.LineNumber : 0;\n            }\n        }\n\n        int IJsonLineInfo.LinePosition\n        {\n            get\n            {\n                IJsonLineInfo lineInfo = _reader as IJsonLineInfo;\n                return (lineInfo != null) ? lineInfo.LinePosition : 0;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonWriter.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\nusing System.Numerics;\n#endif\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Represents a writer that provides a fast, non-cached, forward-only way of generating Json data.\n    /// </summary>\n    public abstract class JsonWriter : IDisposable\n    {\n        internal enum State\n        {\n            Start,\n            Property,\n            ObjectStart,\n            Object,\n            ArrayStart,\n            Array,\n            ConstructorStart,\n            Constructor,\n            Closed,\n            Error\n        }\n\n        // array that gives a new state based on the current state an the token being written\n        private static readonly State[][] StateArray;\n\n        internal static readonly State[][] StateArrayTempate = new[]\n        {\n            //                                      Start                    PropertyName            ObjectStart         Object            ArrayStart              Array                   ConstructorStart        Constructor             Closed          Error\n            //\n            /* None                        */new[] { State.Error,            State.Error,            State.Error,        State.Error,      State.Error,            State.Error,            State.Error,            State.Error,            State.Error,    State.Error },\n            /* StartObject                 */new[] { State.ObjectStart,      State.ObjectStart,      State.Error,        State.Error,      State.ObjectStart,      State.ObjectStart,      State.ObjectStart,      State.ObjectStart,      State.Error,    State.Error },\n            /* StartArray                  */new[] { State.ArrayStart,       State.ArrayStart,       State.Error,        State.Error,      State.ArrayStart,       State.ArrayStart,       State.ArrayStart,       State.ArrayStart,       State.Error,    State.Error },\n            /* StartConstructor            */new[] { State.ConstructorStart, State.ConstructorStart, State.Error,        State.Error,      State.ConstructorStart, State.ConstructorStart, State.ConstructorStart, State.ConstructorStart, State.Error,    State.Error },\n            /* Property                    */new[] { State.Property,         State.Error,            State.Property,     State.Property,   State.Error,            State.Error,            State.Error,            State.Error,            State.Error,    State.Error },\n            /* Comment                     */new[] { State.Start,            State.Property,         State.ObjectStart,  State.Object,     State.ArrayStart,       State.Array,            State.Constructor,      State.Constructor,      State.Error,    State.Error },\n            /* Raw                         */new[] { State.Start,            State.Property,         State.ObjectStart,  State.Object,     State.ArrayStart,       State.Array,            State.Constructor,      State.Constructor,      State.Error,    State.Error },\n            /* Value (this will be copied) */new[] { State.Start,            State.Object,           State.Error,        State.Error,      State.Array,            State.Array,            State.Constructor,      State.Constructor,      State.Error,    State.Error }\n        };\n\n        internal static State[][] BuildStateArray()\n        {\n            var allStates = StateArrayTempate.ToList();\n            var errorStates = StateArrayTempate[0];\n            var valueStates = StateArrayTempate[7];\n\n            foreach (JsonToken valueToken in EnumUtils.GetValues(typeof(JsonToken)))\n            {\n                if (allStates.Count <= (int)valueToken)\n                {\n                    switch (valueToken)\n                    {\n                        case JsonToken.Integer:\n                        case JsonToken.Float:\n                        case JsonToken.String:\n                        case JsonToken.Boolean:\n                        case JsonToken.Null:\n                        case JsonToken.Undefined:\n                        case JsonToken.Date:\n                        case JsonToken.Bytes:\n                            allStates.Add(valueStates);\n                            break;\n                        default:\n                            allStates.Add(errorStates);\n                            break;\n                    }\n                }\n            }\n\n            return allStates.ToArray();\n        }\n\n        static JsonWriter()\n        {\n            StateArray = BuildStateArray();\n        }\n\n        private readonly List<JsonPosition> _stack;\n        private JsonPosition _currentPosition;\n        private State _currentState;\n        private Formatting _formatting;\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the underlying stream or\n        /// <see cref=\"TextReader\"/> should be closed when the writer is closed.\n        /// </summary>\n        /// <value>\n        /// true to close the underlying stream or <see cref=\"TextReader\"/> when\n        /// the writer is closed; otherwise false. The default is true.\n        /// </value>\n        public bool CloseOutput { get; set; }\n\n        /// <summary>\n        /// Gets the top.\n        /// </summary>\n        /// <value>The top.</value>\n        protected internal int Top\n        {\n            get\n            {\n                int depth = _stack.Count;\n                if (Peek() != JsonContainerType.None)\n                    depth++;\n\n                return depth;\n            }\n        }\n\n        /// <summary>\n        /// Gets the state of the writer.\n        /// </summary>\n        public WriteState WriteState\n        {\n            get\n            {\n                switch (_currentState)\n                {\n                    case State.Error:\n                        return WriteState.Error;\n                    case State.Closed:\n                        return WriteState.Closed;\n                    case State.Object:\n                    case State.ObjectStart:\n                        return WriteState.Object;\n                    case State.Array:\n                    case State.ArrayStart:\n                        return WriteState.Array;\n                    case State.Constructor:\n                    case State.ConstructorStart:\n                        return WriteState.Constructor;\n                    case State.Property:\n                        return WriteState.Property;\n                    case State.Start:\n                        return WriteState.Start;\n                    default:\n                        throw JsonWriterException.Create(this, \"Invalid state: \" + _currentState, null);\n                }\n            }\n        }\n\n        internal string ContainerPath\n        {\n            get\n            {\n                if (_currentPosition.Type == JsonContainerType.None)\n                    return string.Empty;\n\n                return JsonPosition.BuildPath(_stack);\n            }\n        }\n\n        /// <summary>\n        /// Gets the path of the writer. \n        /// </summary>\n        public string Path\n        {\n            get\n            {\n                if (_currentPosition.Type == JsonContainerType.None)\n                    return string.Empty;\n\n                bool insideContainer = (_currentState != State.ArrayStart\n                                        && _currentState != State.ConstructorStart\n                                        && _currentState != State.ObjectStart);\n\n                IEnumerable<JsonPosition> positions = (!insideContainer)\n                    ? _stack\n                    : _stack.Concat(new[] { _currentPosition });\n\n                return JsonPosition.BuildPath(positions);\n            }\n        }\n\n        private DateFormatHandling _dateFormatHandling;\n        private DateTimeZoneHandling _dateTimeZoneHandling;\n        private StringEscapeHandling _stringEscapeHandling;\n        private FloatFormatHandling _floatFormatHandling;\n        private string _dateFormatString;\n        private CultureInfo _culture;\n\n        /// <summary>\n        /// Indicates how JSON text output is formatted.\n        /// </summary>\n        public Formatting Formatting\n        {\n            get { return _formatting; }\n            set { _formatting = value; }\n        }\n\n        /// <summary>\n        /// Get or set how dates are written to JSON text.\n        /// </summary>\n        public DateFormatHandling DateFormatHandling\n        {\n            get { return _dateFormatHandling; }\n            set { _dateFormatHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how <see cref=\"DateTime\"/> time zones are handling when writing JSON text.\n        /// </summary>\n        public DateTimeZoneHandling DateTimeZoneHandling\n        {\n            get { return _dateTimeZoneHandling; }\n            set { _dateTimeZoneHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how strings are escaped when writing JSON text.\n        /// </summary>\n        public StringEscapeHandling StringEscapeHandling\n        {\n            get { return _stringEscapeHandling; }\n            set\n            {\n                _stringEscapeHandling = value;\n                OnStringEscapeHandlingChanged();\n            }\n        }\n\n        internal virtual void OnStringEscapeHandlingChanged()\n        {\n            // hacky but there is a calculated value that relies on StringEscapeHandling\n        }\n\n        /// <summary>\n        /// Get or set how special floating point numbers, e.g. <see cref=\"F:System.Double.NaN\"/>,\n        /// <see cref=\"F:System.Double.PositiveInfinity\"/> and <see cref=\"F:System.Double.NegativeInfinity\"/>,\n        /// are written to JSON text.\n        /// </summary>\n        public FloatFormatHandling FloatFormatHandling\n        {\n            get { return _floatFormatHandling; }\n            set { _floatFormatHandling = value; }\n        }\n\n        /// <summary>\n        /// Get or set how <see cref=\"DateTime\"/> and <see cref=\"DateTimeOffset\"/> values are formatting when writing JSON text.\n        /// </summary>\n        public string DateFormatString\n        {\n            get { return _dateFormatString; }\n            set { _dateFormatString = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets the culture used when writing JSON. Defaults to <see cref=\"CultureInfo.InvariantCulture\"/>.\n        /// </summary>\n        public CultureInfo Culture\n        {\n            get { return _culture ?? CultureInfo.InvariantCulture; }\n            set { _culture = value; }\n        }\n\n        /// <summary>\n        /// Creates an instance of the <c>JsonWriter</c> class. \n        /// </summary>\n        protected JsonWriter()\n        {\n            _stack = new List<JsonPosition>(4);\n            _currentState = State.Start;\n            _formatting = Formatting.None;\n            _dateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;\n\n            CloseOutput = true;\n        }\n\n        internal void UpdateScopeWithFinishedValue()\n        {\n            if (_currentPosition.HasIndex)\n                _currentPosition.Position++;\n        }\n\n        private void Push(JsonContainerType value)\n        {\n            if (_currentPosition.Type != JsonContainerType.None)\n                _stack.Add(_currentPosition);\n\n            _currentPosition = new JsonPosition(value);\n        }\n\n        private JsonContainerType Pop()\n        {\n            JsonPosition oldPosition = _currentPosition;\n\n            if (_stack.Count > 0)\n            {\n                _currentPosition = _stack[_stack.Count - 1];\n                _stack.RemoveAt(_stack.Count - 1);\n            }\n            else\n            {\n                _currentPosition = new JsonPosition();\n            }\n\n            return oldPosition.Type;\n        }\n\n        private JsonContainerType Peek()\n        {\n            return _currentPosition.Type;\n        }\n\n        /// <summary>\n        /// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.\n        /// </summary>\n        public abstract void Flush();\n\n        /// <summary>\n        /// Closes this stream and the underlying stream.\n        /// </summary>\n        public virtual void Close()\n        {\n            AutoCompleteAll();\n        }\n\n        /// <summary>\n        /// Writes the beginning of a Json object.\n        /// </summary>\n        public virtual void WriteStartObject()\n        {\n            InternalWriteStart(JsonToken.StartObject, JsonContainerType.Object);\n        }\n\n        /// <summary>\n        /// Writes the end of a Json object.\n        /// </summary>\n        public virtual void WriteEndObject()\n        {\n            InternalWriteEnd(JsonContainerType.Object);\n        }\n\n        /// <summary>\n        /// Writes the beginning of a Json array.\n        /// </summary>\n        public virtual void WriteStartArray()\n        {\n            InternalWriteStart(JsonToken.StartArray, JsonContainerType.Array);\n        }\n\n        /// <summary>\n        /// Writes the end of an array.\n        /// </summary>\n        public virtual void WriteEndArray()\n        {\n            InternalWriteEnd(JsonContainerType.Array);\n        }\n\n        /// <summary>\n        /// Writes the start of a constructor with the given name.\n        /// </summary>\n        /// <param name=\"name\">The name of the constructor.</param>\n        public virtual void WriteStartConstructor(string name)\n        {\n            InternalWriteStart(JsonToken.StartConstructor, JsonContainerType.Constructor);\n        }\n\n        /// <summary>\n        /// Writes the end constructor.\n        /// </summary>\n        public virtual void WriteEndConstructor()\n        {\n            InternalWriteEnd(JsonContainerType.Constructor);\n        }\n\n        /// <summary>\n        /// Writes the property name of a name/value pair on a JSON object.\n        /// </summary>\n        /// <param name=\"name\">The name of the property.</param>\n        public virtual void WritePropertyName(string name)\n        {\n            InternalWritePropertyName(name);\n        }\n\n        /// <summary>\n        /// Writes the property name of a name/value pair on a JSON object.\n        /// </summary>\n        /// <param name=\"name\">The name of the property.</param>\n        /// <param name=\"escape\">A flag to indicate whether the text should be escaped when it is written as a JSON property name.</param>\n        public virtual void WritePropertyName(string name, bool escape)\n        {\n            WritePropertyName(name);\n        }\n\n        /// <summary>\n        /// Writes the end of the current Json object or array.\n        /// </summary>\n        public virtual void WriteEnd()\n        {\n            WriteEnd(Peek());\n        }\n\n        /// <summary>\n        /// Writes the current <see cref=\"JsonReader\"/> token and its children.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read the token from.</param>\n        public void WriteToken(JsonReader reader)\n        {\n            WriteToken(reader, true, true);\n        }\n\n        /// <summary>\n        /// Writes the current <see cref=\"JsonReader\"/> token.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> to read the token from.</param>\n        /// <param name=\"writeChildren\">A flag indicating whether the current token's children should be written.</param>\n        public void WriteToken(JsonReader reader, bool writeChildren)\n        {\n            ValidationUtils.ArgumentNotNull(reader, \"reader\");\n\n            WriteToken(reader, writeChildren, true);\n        }\n\n        internal void WriteToken(JsonReader reader, bool writeChildren, bool writeDateConstructorAsDate)\n        {\n            int initialDepth;\n\n            if (reader.TokenType == JsonToken.None)\n                initialDepth = -1;\n            else if (!IsStartToken(reader.TokenType))\n                initialDepth = reader.Depth + 1;\n            else\n                initialDepth = reader.Depth;\n\n            WriteToken(reader, initialDepth, writeChildren, writeDateConstructorAsDate);\n        }\n\n        internal void WriteToken(JsonReader reader, int initialDepth, bool writeChildren, bool writeDateConstructorAsDate)\n        {\n            do\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.None:\n                        // read to next\n                        break;\n                    case JsonToken.StartObject:\n                        WriteStartObject();\n                        break;\n                    case JsonToken.StartArray:\n                        WriteStartArray();\n                        break;\n                    case JsonToken.StartConstructor:\n                        string constructorName = reader.Value.ToString();\n                        // write a JValue date when the constructor is for a date\n                        if (writeDateConstructorAsDate && string.Equals(constructorName, \"Date\", StringComparison.Ordinal))\n                            WriteConstructorDate(reader);\n                        else\n                            WriteStartConstructor(reader.Value.ToString());\n                        break;\n                    case JsonToken.PropertyName:\n                        WritePropertyName(reader.Value.ToString());\n                        break;\n                    case JsonToken.Comment:\n                        WriteComment((reader.Value != null) ? reader.Value.ToString() : null);\n                        break;\n                    case JsonToken.Integer:\n#if !(NET20 || NET35 || PORTABLE || PORTABLE40)\n                        if (reader.Value is BigInteger)\n                        {\n                            WriteValue((BigInteger)reader.Value);\n                        }\n                        else\n#endif\n                        {\n                            WriteValue(Convert.ToInt64(reader.Value, CultureInfo.InvariantCulture));\n                        }\n                        break;\n                    case JsonToken.Float:\n                        object value = reader.Value;\n\n                        if (value is decimal)\n                            WriteValue((decimal)value);\n                        else if (value is double)\n                            WriteValue((double)value);\n                        else if (value is float)\n                            WriteValue((float)value);\n                        else\n                            WriteValue(Convert.ToDouble(value, CultureInfo.InvariantCulture));\n                        break;\n                    case JsonToken.String:\n                        WriteValue(reader.Value.ToString());\n                        break;\n                    case JsonToken.Boolean:\n                        WriteValue(Convert.ToBoolean(reader.Value, CultureInfo.InvariantCulture));\n                        break;\n                    case JsonToken.Null:\n                        WriteNull();\n                        break;\n                    case JsonToken.Undefined:\n                        WriteUndefined();\n                        break;\n                    case JsonToken.EndObject:\n                        WriteEndObject();\n                        break;\n                    case JsonToken.EndArray:\n                        WriteEndArray();\n                        break;\n                    case JsonToken.EndConstructor:\n                        WriteEndConstructor();\n                        break;\n                    case JsonToken.Date:\n#if !NET20\n                        if (reader.Value is DateTimeOffset)\n                            WriteValue((DateTimeOffset)reader.Value);\n                        else\n#endif\n                            WriteValue(Convert.ToDateTime(reader.Value, CultureInfo.InvariantCulture));\n                        break;\n                    case JsonToken.Raw:\n                        WriteRawValue((reader.Value != null) ? reader.Value.ToString() : null);\n                        break;\n                    case JsonToken.Bytes:\n                        WriteValue((byte[])reader.Value);\n                        break;\n                    default:\n                        throw MiscellaneousUtils.CreateArgumentOutOfRangeException(\"TokenType\", reader.TokenType, \"Unexpected token type.\");\n                }\n            } while (\n                // stop if we have reached the end of the token being read\n                initialDepth - 1 < reader.Depth - (IsEndToken(reader.TokenType) ? 1 : 0)\n                && writeChildren\n                && reader.Read());\n        }\n\n        private void WriteConstructorDate(JsonReader reader)\n        {\n            if (!reader.Read())\n                throw JsonWriterException.Create(this, \"Unexpected end when reading date constructor.\", null);\n            if (reader.TokenType != JsonToken.Integer)\n                throw JsonWriterException.Create(this, \"Unexpected token when reading date constructor. Expected Integer, got \" + reader.TokenType, null);\n\n            long ticks = (long)reader.Value;\n            DateTime date = DateTimeUtils.ConvertJavaScriptTicksToDateTime(ticks);\n\n            if (!reader.Read())\n                throw JsonWriterException.Create(this, \"Unexpected end when reading date constructor.\", null);\n            if (reader.TokenType != JsonToken.EndConstructor)\n                throw JsonWriterException.Create(this, \"Unexpected token when reading date constructor. Expected EndConstructor, got \" + reader.TokenType, null);\n\n            WriteValue(date);\n        }\n\n        internal static bool IsEndToken(JsonToken token)\n        {\n            switch (token)\n            {\n                case JsonToken.EndObject:\n                case JsonToken.EndArray:\n                case JsonToken.EndConstructor:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n\n        internal static bool IsStartToken(JsonToken token)\n        {\n            switch (token)\n            {\n                case JsonToken.StartObject:\n                case JsonToken.StartArray:\n                case JsonToken.StartConstructor:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n\n        private void WriteEnd(JsonContainerType type)\n        {\n            switch (type)\n            {\n                case JsonContainerType.Object:\n                    WriteEndObject();\n                    break;\n                case JsonContainerType.Array:\n                    WriteEndArray();\n                    break;\n                case JsonContainerType.Constructor:\n                    WriteEndConstructor();\n                    break;\n                default:\n                    throw JsonWriterException.Create(this, \"Unexpected type when writing end: \" + type, null);\n            }\n        }\n\n        private void AutoCompleteAll()\n        {\n            while (Top > 0)\n            {\n                WriteEnd();\n            }\n        }\n\n        private JsonToken GetCloseTokenForType(JsonContainerType type)\n        {\n            switch (type)\n            {\n                case JsonContainerType.Object:\n                    return JsonToken.EndObject;\n                case JsonContainerType.Array:\n                    return JsonToken.EndArray;\n                case JsonContainerType.Constructor:\n                    return JsonToken.EndConstructor;\n                default:\n                    throw JsonWriterException.Create(this, \"No close token for type: \" + type, null);\n            }\n        }\n\n        private void AutoCompleteClose(JsonContainerType type)\n        {\n            // write closing symbol and calculate new state\n            int levelsToComplete = 0;\n\n            if (_currentPosition.Type == type)\n            {\n                levelsToComplete = 1;\n            }\n            else\n            {\n                int top = Top - 2;\n                for (int i = top; i >= 0; i--)\n                {\n                    int currentLevel = top - i;\n\n                    if (_stack[currentLevel].Type == type)\n                    {\n                        levelsToComplete = i + 2;\n                        break;\n                    }\n                }\n            }\n\n            if (levelsToComplete == 0)\n                throw JsonWriterException.Create(this, \"No token to close.\", null);\n\n            for (int i = 0; i < levelsToComplete; i++)\n            {\n                JsonToken token = GetCloseTokenForType(Pop());\n\n                if (_currentState == State.Property)\n                    WriteNull();\n\n                if (_formatting == Formatting.Indented)\n                {\n                    if (_currentState != State.ObjectStart && _currentState != State.ArrayStart)\n                        WriteIndent();\n                }\n\n                WriteEnd(token);\n\n                JsonContainerType currentLevelType = Peek();\n\n                switch (currentLevelType)\n                {\n                    case JsonContainerType.Object:\n                        _currentState = State.Object;\n                        break;\n                    case JsonContainerType.Array:\n                        _currentState = State.Array;\n                        break;\n                    case JsonContainerType.Constructor:\n                        _currentState = State.Array;\n                        break;\n                    case JsonContainerType.None:\n                        _currentState = State.Start;\n                        break;\n                    default:\n                        throw JsonWriterException.Create(this, \"Unknown JsonType: \" + currentLevelType, null);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Writes the specified end token.\n        /// </summary>\n        /// <param name=\"token\">The end token to write.</param>\n        protected virtual void WriteEnd(JsonToken token)\n        {\n        }\n\n        /// <summary>\n        /// Writes indent characters.\n        /// </summary>\n        protected virtual void WriteIndent()\n        {\n        }\n\n        /// <summary>\n        /// Writes the JSON value delimiter.\n        /// </summary>\n        protected virtual void WriteValueDelimiter()\n        {\n        }\n\n        /// <summary>\n        /// Writes an indent space.\n        /// </summary>\n        protected virtual void WriteIndentSpace()\n        {\n        }\n\n        internal void AutoComplete(JsonToken tokenBeingWritten)\n        {\n            // gets new state based on the current state and what is being written\n            State newState = StateArray[(int)tokenBeingWritten][(int)_currentState];\n\n            if (newState == State.Error)\n                throw JsonWriterException.Create(this, \"Token {0} in state {1} would result in an invalid JSON object.\".FormatWith(CultureInfo.InvariantCulture, tokenBeingWritten.ToString(), _currentState.ToString()), null);\n\n            if ((_currentState == State.Object || _currentState == State.Array || _currentState == State.Constructor) && tokenBeingWritten != JsonToken.Comment)\n            {\n                WriteValueDelimiter();\n            }\n\n            if (_formatting == Formatting.Indented)\n            {\n                if (_currentState == State.Property)\n                    WriteIndentSpace();\n\n                // don't indent a property when it is the first token to be written (i.e. at the start)\n                if ((_currentState == State.Array || _currentState == State.ArrayStart || _currentState == State.Constructor || _currentState == State.ConstructorStart)\n                    || (tokenBeingWritten == JsonToken.PropertyName && _currentState != State.Start))\n                    WriteIndent();\n            }\n\n            _currentState = newState;\n        }\n\n        #region WriteValue methods\n        /// <summary>\n        /// Writes a null value.\n        /// </summary>\n        public virtual void WriteNull()\n        {\n            InternalWriteValue(JsonToken.Null);\n        }\n\n        /// <summary>\n        /// Writes an undefined value.\n        /// </summary>\n        public virtual void WriteUndefined()\n        {\n            InternalWriteValue(JsonToken.Undefined);\n        }\n\n        /// <summary>\n        /// Writes raw JSON without changing the writer's state.\n        /// </summary>\n        /// <param name=\"json\">The raw JSON to write.</param>\n        public virtual void WriteRaw(string json)\n        {\n            InternalWriteRaw();\n        }\n\n        /// <summary>\n        /// Writes raw JSON where a value is expected and updates the writer's state.\n        /// </summary>\n        /// <param name=\"json\">The raw JSON to write.</param>\n        public virtual void WriteRawValue(string json)\n        {\n            // hack. want writer to change state as if a value had been written\n            UpdateScopeWithFinishedValue();\n            AutoComplete(JsonToken.Undefined);\n            WriteRaw(json);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"String\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"String\"/> value to write.</param>\n        public virtual void WriteValue(string value)\n        {\n            InternalWriteValue(JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int32\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int32\"/> value to write.</param>\n        public virtual void WriteValue(int value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt32\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt32\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public virtual void WriteValue(uint value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int64\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int64\"/> value to write.</param>\n        public virtual void WriteValue(long value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt64\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt64\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public virtual void WriteValue(ulong value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Single\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Single\"/> value to write.</param>\n        public virtual void WriteValue(float value)\n        {\n            InternalWriteValue(JsonToken.Float);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Double\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Double\"/> value to write.</param>\n        public virtual void WriteValue(double value)\n        {\n            InternalWriteValue(JsonToken.Float);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Boolean\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Boolean\"/> value to write.</param>\n        public virtual void WriteValue(bool value)\n        {\n            InternalWriteValue(JsonToken.Boolean);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int16\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int16\"/> value to write.</param>\n        public virtual void WriteValue(short value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt16\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt16\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public virtual void WriteValue(ushort value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Char\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Char\"/> value to write.</param>\n        public virtual void WriteValue(char value)\n        {\n            InternalWriteValue(JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Byte\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Byte\"/> value to write.</param>\n        public virtual void WriteValue(byte value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"SByte\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"SByte\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public virtual void WriteValue(sbyte value)\n        {\n            InternalWriteValue(JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Decimal\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Decimal\"/> value to write.</param>\n        public virtual void WriteValue(decimal value)\n        {\n            InternalWriteValue(JsonToken.Float);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"DateTime\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"DateTime\"/> value to write.</param>\n        public virtual void WriteValue(DateTime value)\n        {\n            InternalWriteValue(JsonToken.Date);\n        }\n\n#if !NET20\n        /// <summary>\n        /// Writes a <see cref=\"DateTimeOffset\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"DateTimeOffset\"/> value to write.</param>\n        public virtual void WriteValue(DateTimeOffset value)\n        {\n            InternalWriteValue(JsonToken.Date);\n        }\n#endif\n\n        /// <summary>\n        /// Writes a <see cref=\"Guid\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Guid\"/> value to write.</param>\n        public virtual void WriteValue(Guid value)\n        {\n            InternalWriteValue(JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"TimeSpan\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"TimeSpan\"/> value to write.</param>\n        public virtual void WriteValue(TimeSpan value)\n        {\n            InternalWriteValue(JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Int32}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Int32}\"/> value to write.</param>\n        public virtual void WriteValue(int? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{UInt32}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{UInt32}\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public virtual void WriteValue(uint? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Int64}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Int64}\"/> value to write.</param>\n        public virtual void WriteValue(long? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{UInt64}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{UInt64}\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public virtual void WriteValue(ulong? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Single}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Single}\"/> value to write.</param>\n        public virtual void WriteValue(float? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Double}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Double}\"/> value to write.</param>\n        public virtual void WriteValue(double? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Boolean}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Boolean}\"/> value to write.</param>\n        public virtual void WriteValue(bool? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Int16}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Int16}\"/> value to write.</param>\n        public virtual void WriteValue(short? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{UInt16}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{UInt16}\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public virtual void WriteValue(ushort? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Char}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Char}\"/> value to write.</param>\n        public virtual void WriteValue(char? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Byte}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Byte}\"/> value to write.</param>\n        public virtual void WriteValue(byte? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{SByte}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{SByte}\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public virtual void WriteValue(sbyte? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Decimal}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Decimal}\"/> value to write.</param>\n        public virtual void WriteValue(decimal? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{DateTime}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{DateTime}\"/> value to write.</param>\n        public virtual void WriteValue(DateTime? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n#if !NET20\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{DateTimeOffset}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{DateTimeOffset}\"/> value to write.</param>\n        public virtual void WriteValue(DateTimeOffset? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n#endif\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{Guid}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{Guid}\"/> value to write.</param>\n        public virtual void WriteValue(Guid? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Nullable{TimeSpan}\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Nullable{TimeSpan}\"/> value to write.</param>\n        public virtual void WriteValue(TimeSpan? value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                WriteValue(value.Value);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"T:Byte[]\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"T:Byte[]\"/> value to write.</param>\n        public virtual void WriteValue(byte[] value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                InternalWriteValue(JsonToken.Bytes);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Uri\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Uri\"/> value to write.</param>\n        public virtual void WriteValue(Uri value)\n        {\n            if (value == null)\n                WriteNull();\n            else\n                InternalWriteValue(JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Object\"/> value.\n        /// An error will raised if the value cannot be written as a single JSON token.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Object\"/> value to write.</param>\n        public virtual void WriteValue(object value)\n        {\n            if (value == null)\n            {\n                WriteNull();\n            }\n            else\n            {\n#if !(NET20 || NET35 || PORTABLE || PORTABLE40)\n                // this is here because adding a WriteValue(BigInteger) to JsonWriter will\n                // mean the user has to add a reference to System.Numerics.dll\n                if (value is BigInteger)\n                    throw CreateUnsupportedTypeException(this, value);\n#endif\n\n                WriteValue(this, ConvertUtils.GetTypeCode(value), value);\n            }\n        }\n        #endregion\n\n        /// <summary>\n        /// Writes out a comment <code>/*...*/</code> containing the specified text. \n        /// </summary>\n        /// <param name=\"text\">Text to place inside the comment.</param>\n        public virtual void WriteComment(string text)\n        {\n            InternalWriteComment();\n        }\n\n        /// <summary>\n        /// Writes out the given white space.\n        /// </summary>\n        /// <param name=\"ws\">The string of white space characters.</param>\n        public virtual void WriteWhitespace(string ws)\n        {\n            InternalWriteWhitespace(ws);\n        }\n\n        void IDisposable.Dispose()\n        {\n            Dispose(true);\n        }\n\n        private void Dispose(bool disposing)\n        {\n            if (_currentState != State.Closed)\n                Close();\n        }\n\n        internal static void WriteValue(JsonWriter writer, PrimitiveTypeCode typeCode, object value)\n        {\n            switch (typeCode)\n            {\n                case PrimitiveTypeCode.Char:\n                    writer.WriteValue((char)value);\n                    break;\n                case PrimitiveTypeCode.CharNullable:\n                    writer.WriteValue((value == null) ? (char?)null : (char)value);\n                    break;\n                case PrimitiveTypeCode.Boolean:\n                    writer.WriteValue((bool)value);\n                    break;\n                case PrimitiveTypeCode.BooleanNullable:\n                    writer.WriteValue((value == null) ? (bool?)null : (bool)value);\n                    break;\n                case PrimitiveTypeCode.SByte:\n                    writer.WriteValue((sbyte)value);\n                    break;\n                case PrimitiveTypeCode.SByteNullable:\n                    writer.WriteValue((value == null) ? (sbyte?)null : (sbyte)value);\n                    break;\n                case PrimitiveTypeCode.Int16:\n                    writer.WriteValue((short)value);\n                    break;\n                case PrimitiveTypeCode.Int16Nullable:\n                    writer.WriteValue((value == null) ? (short?)null : (short)value);\n                    break;\n                case PrimitiveTypeCode.UInt16:\n                    writer.WriteValue((ushort)value);\n                    break;\n                case PrimitiveTypeCode.UInt16Nullable:\n                    writer.WriteValue((value == null) ? (ushort?)null : (ushort)value);\n                    break;\n                case PrimitiveTypeCode.Int32:\n                    writer.WriteValue((int)value);\n                    break;\n                case PrimitiveTypeCode.Int32Nullable:\n                    writer.WriteValue((value == null) ? (int?)null : (int)value);\n                    break;\n                case PrimitiveTypeCode.Byte:\n                    writer.WriteValue((byte)value);\n                    break;\n                case PrimitiveTypeCode.ByteNullable:\n                    writer.WriteValue((value == null) ? (byte?)null : (byte)value);\n                    break;\n                case PrimitiveTypeCode.UInt32:\n                    writer.WriteValue((uint)value);\n                    break;\n                case PrimitiveTypeCode.UInt32Nullable:\n                    writer.WriteValue((value == null) ? (uint?)null : (uint)value);\n                    break;\n                case PrimitiveTypeCode.Int64:\n                    writer.WriteValue((long)value);\n                    break;\n                case PrimitiveTypeCode.Int64Nullable:\n                    writer.WriteValue((value == null) ? (long?)null : (long)value);\n                    break;\n                case PrimitiveTypeCode.UInt64:\n                    writer.WriteValue((ulong)value);\n                    break;\n                case PrimitiveTypeCode.UInt64Nullable:\n                    writer.WriteValue((value == null) ? (ulong?)null : (ulong)value);\n                    break;\n                case PrimitiveTypeCode.Single:\n                    writer.WriteValue((float)value);\n                    break;\n                case PrimitiveTypeCode.SingleNullable:\n                    writer.WriteValue((value == null) ? (float?)null : (float)value);\n                    break;\n                case PrimitiveTypeCode.Double:\n                    writer.WriteValue((double)value);\n                    break;\n                case PrimitiveTypeCode.DoubleNullable:\n                    writer.WriteValue((value == null) ? (double?)null : (double)value);\n                    break;\n                case PrimitiveTypeCode.DateTime:\n                    writer.WriteValue((DateTime)value);\n                    break;\n                case PrimitiveTypeCode.DateTimeNullable:\n                    writer.WriteValue((value == null) ? (DateTime?)null : (DateTime)value);\n                    break;\n#if !NET20\n                case PrimitiveTypeCode.DateTimeOffset:\n                    writer.WriteValue((DateTimeOffset)value);\n                    break;\n                case PrimitiveTypeCode.DateTimeOffsetNullable:\n                    writer.WriteValue((value == null) ? (DateTimeOffset?)null : (DateTimeOffset)value);\n                    break;\n#endif\n                case PrimitiveTypeCode.Decimal:\n                    writer.WriteValue((decimal)value);\n                    break;\n                case PrimitiveTypeCode.DecimalNullable:\n                    writer.WriteValue((value == null) ? (decimal?)null : (decimal)value);\n                    break;\n                case PrimitiveTypeCode.Guid:\n                    writer.WriteValue((Guid)value);\n                    break;\n                case PrimitiveTypeCode.GuidNullable:\n                    writer.WriteValue((value == null) ? (Guid?)null : (Guid)value);\n                    break;\n                case PrimitiveTypeCode.TimeSpan:\n                    writer.WriteValue((TimeSpan)value);\n                    break;\n                case PrimitiveTypeCode.TimeSpanNullable:\n                    writer.WriteValue((value == null) ? (TimeSpan?)null : (TimeSpan)value);\n                    break;\n#if !(PORTABLE || PORTABLE40 || NET35 || NET20)\n                case PrimitiveTypeCode.BigInteger:\n                    // this will call to WriteValue(object)\n                    writer.WriteValue((BigInteger)value);\n                    break;\n                case PrimitiveTypeCode.BigIntegerNullable:\n                    // this will call to WriteValue(object)\n                    writer.WriteValue((value == null) ? (BigInteger?)null : (BigInteger)value);\n                    break;\n#endif\n                case PrimitiveTypeCode.Uri:\n                    writer.WriteValue((Uri)value);\n                    break;\n                case PrimitiveTypeCode.String:\n                    writer.WriteValue((string)value);\n                    break;\n                case PrimitiveTypeCode.Bytes:\n                    writer.WriteValue((byte[])value);\n                    break;\n#if !(PORTABLE || NETFX_CORE)\n                case PrimitiveTypeCode.DBNull:\n                    writer.WriteNull();\n                    break;\n#endif\n                default:\n#if !(PORTABLE || NETFX_CORE)\n                    if (value is IConvertible)\n                    {\n                        // the value is a non-standard IConvertible\n                        // convert to the underlying value and retry\n                        IConvertible convertable = (IConvertible)value;\n\n                        TypeInformation typeInformation = ConvertUtils.GetTypeInformation(convertable);\n\n                        // if convertable has an underlying typecode of Object then attempt to convert it to a string\n                        PrimitiveTypeCode resolvedTypeCode = (typeInformation.TypeCode == PrimitiveTypeCode.Object) ? PrimitiveTypeCode.String : typeInformation.TypeCode;\n                        Type resolvedType = (typeInformation.TypeCode == PrimitiveTypeCode.Object) ? typeof(string) : typeInformation.Type;\n\n                        object convertedValue = convertable.ToType(resolvedType, CultureInfo.InvariantCulture);\n\n                        WriteValue(writer, resolvedTypeCode, convertedValue);\n                        break;\n                    }\n                    else\n#endif\n                    {\n                        throw CreateUnsupportedTypeException(writer, value);\n                    }\n            }\n        }\n\n        private static JsonWriterException CreateUnsupportedTypeException(JsonWriter writer, object value)\n        {\n            return JsonWriterException.Create(writer, \"Unsupported type: {0}. Use the JsonSerializer class to get the object's JSON representation.\".FormatWith(CultureInfo.InvariantCulture, value.GetType()), null);\n        }\n\n        /// <summary>\n        /// Sets the state of the JsonWriter,\n        /// </summary>\n        /// <param name=\"token\">The JsonToken being written.</param>\n        /// <param name=\"value\">The value being written.</param>\n        protected void SetWriteState(JsonToken token, object value)\n        {\n            switch (token)\n            {\n                case JsonToken.StartObject:\n                    InternalWriteStart(token, JsonContainerType.Object);\n                    break;\n                case JsonToken.StartArray:\n                    InternalWriteStart(token, JsonContainerType.Array);\n                    break;\n                case JsonToken.StartConstructor:\n                    InternalWriteStart(token, JsonContainerType.Constructor);\n                    break;\n                case JsonToken.PropertyName:\n                    if (!(value is string))\n                        throw new ArgumentException(\"A name is required when setting property name state.\", \"value\");\n\n                    InternalWritePropertyName((string)value);\n                    break;\n                case JsonToken.Comment:\n                    InternalWriteComment();\n                    break;\n                case JsonToken.Raw:\n                    InternalWriteRaw();\n                    break;\n                case JsonToken.Integer:\n                case JsonToken.Float:\n                case JsonToken.String:\n                case JsonToken.Boolean:\n                case JsonToken.Date:\n                case JsonToken.Bytes:\n                case JsonToken.Null:\n                case JsonToken.Undefined:\n                    InternalWriteValue(token);\n                    break;\n                case JsonToken.EndObject:\n                    InternalWriteEnd(JsonContainerType.Object);\n                    break;\n                case JsonToken.EndArray:\n                    InternalWriteEnd(JsonContainerType.Array);\n                    break;\n                case JsonToken.EndConstructor:\n                    InternalWriteEnd(JsonContainerType.Constructor);\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException(\"token\");\n            }\n        }\n\n        internal void InternalWriteEnd(JsonContainerType container)\n        {\n            AutoCompleteClose(container);\n        }\n\n        internal void InternalWritePropertyName(string name)\n        {\n            _currentPosition.PropertyName = name;\n            AutoComplete(JsonToken.PropertyName);\n        }\n\n        internal void InternalWriteRaw()\n        {\n        }\n\n        internal void InternalWriteStart(JsonToken token, JsonContainerType container)\n        {\n            UpdateScopeWithFinishedValue();\n            AutoComplete(token);\n            Push(container);\n        }\n\n        internal void InternalWriteValue(JsonToken token)\n        {\n            UpdateScopeWithFinishedValue();\n            AutoComplete(token);\n        }\n\n        internal void InternalWriteWhitespace(string ws)\n        {\n            if (ws != null)\n            {\n                if (!StringUtils.IsWhiteSpace(ws))\n                    throw JsonWriterException.Create(this, \"Only white space characters should be used.\", null);\n            }\n        }\n\n        internal void InternalWriteComment()\n        {\n            AutoComplete(JsonToken.Comment);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/JsonWriterException.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.Serialization;\nusing System.Text;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// The exception thrown when an error occurs while reading Json text.\n    /// </summary>\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n    [Serializable]\n#endif\n    public class JsonWriterException : JsonException\n    {\n        /// <summary>\n        /// Gets the path to the JSON where the error occurred.\n        /// </summary>\n        /// <value>The path to the JSON where the error occurred.</value>\n        public string Path { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonWriterException\"/> class.\n        /// </summary>\n        public JsonWriterException()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonWriterException\"/> class\n        /// with a specified error message.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        public JsonWriterException(string message)\n            : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonWriterException\"/> class\n        /// with a specified error message and a reference to the inner exception that is the cause of this exception.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>\n        public JsonWriterException(string message, Exception innerException)\n            : base(message, innerException)\n        {\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonWriterException\"/> class.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">The <paramref name=\"info\"/> parameter is null. </exception>\n        /// <exception cref=\"T:System.Runtime.Serialization.SerializationException\">The class name is null or <see cref=\"P:System.Exception.HResult\"/> is zero (0). </exception>\n        public JsonWriterException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n#endif\n\n        internal JsonWriterException(string message, Exception innerException, string path)\n            : base(message, innerException)\n        {\n            Path = path;\n        }\n\n        internal static JsonWriterException Create(JsonWriter writer, string message, Exception ex)\n        {\n            return Create(writer.ContainerPath, message, ex);\n        }\n\n        internal static JsonWriterException Create(string path, string message, Exception ex)\n        {\n            message = JsonPosition.FormatMessage(null, path, message);\n\n            return new JsonWriterException(message, ex, path);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/Extensions.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Contains the LINQ to JSON extension methods.\n    /// </summary>\n    public static class Extensions\n    {\n        /// <summary>\n        /// Returns a collection of tokens that contains the ancestors of every token in the source collection.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the objects in source, constrained to <see cref=\"JToken\"/>.</typeparam>\n        /// <param name=\"source\">An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the source collection.</param>\n        /// <returns>An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the ancestors of every node in the source collection.</returns>\n        public static IJEnumerable<JToken> Ancestors<T>(this IEnumerable<T> source) where T : JToken\n        {\n            ValidationUtils.ArgumentNotNull(source, \"source\");\n\n            return source.SelectMany(j => j.Ancestors()).AsJEnumerable();\n        }\n\n        //TODO\n        //public static IEnumerable<JObject> AncestorsAndSelf<T>(this IEnumerable<T> source) where T : JObject\n        //{\n        //  ValidationUtils.ArgumentNotNull(source, \"source\");\n\n        //  return source.SelectMany(j => j.AncestorsAndSelf());\n        //}\n\n        /// <summary>\n        /// Returns a collection of tokens that contains the descendants of every token in the source collection.\n        /// </summary>\n        /// <typeparam name=\"T\">The type of the objects in source, constrained to <see cref=\"JContainer\"/>.</typeparam>\n        /// <param name=\"source\">An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the source collection.</param>\n        /// <returns>An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the descendants of every node in the source collection.</returns>\n        public static IJEnumerable<JToken> Descendants<T>(this IEnumerable<T> source) where T : JContainer\n        {\n            ValidationUtils.ArgumentNotNull(source, \"source\");\n\n            return source.SelectMany(j => j.Descendants()).AsJEnumerable();\n        }\n\n        //TODO\n        //public static IEnumerable<JObject> DescendantsAndSelf<T>(this IEnumerable<T> source) where T : JContainer\n        //{\n        //  ValidationUtils.ArgumentNotNull(source, \"source\");\n\n        //  return source.SelectMany(j => j.DescendantsAndSelf());\n        //}\n\n        /// <summary>\n        /// Returns a collection of child properties of every object in the source collection.\n        /// </summary>\n        /// <param name=\"source\">An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JObject\"/> that contains the source collection.</param>\n        /// <returns>An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JProperty\"/> that contains the properties of every object in the source collection.</returns>\n        public static IJEnumerable<JProperty> Properties(this IEnumerable<JObject> source)\n        {\n            ValidationUtils.ArgumentNotNull(source, \"source\");\n\n            return source.SelectMany(d => d.Properties()).AsJEnumerable();\n        }\n\n        /// <summary>\n        /// Returns a collection of child values of every object in the source collection with the given key.\n        /// </summary>\n        /// <param name=\"source\">An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the source collection.</param>\n        /// <param name=\"key\">The token key.</param>\n        /// <returns>An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the values of every node in the source collection with the given key.</returns>\n        public static IJEnumerable<JToken> Values(this IEnumerable<JToken> source, object key)\n        {\n            return Values<JToken, JToken>(source, key).AsJEnumerable();\n        }\n\n        /// <summary>\n        /// Returns a collection of child values of every object in the source collection.\n        /// </summary>\n        /// <param name=\"source\">An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the source collection.</param>\n        /// <returns>An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the values of every node in the source collection.</returns>\n        public static IJEnumerable<JToken> Values(this IEnumerable<JToken> source)\n        {\n            return source.Values(null);\n        }\n\n        /// <summary>\n        /// Returns a collection of converted child values of every object in the source collection with the given key.\n        /// </summary>\n        /// <typeparam name=\"U\">The type to convert the values to.</typeparam>\n        /// <param name=\"source\">An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the source collection.</param>\n        /// <param name=\"key\">The token key.</param>\n        /// <returns>An <see cref=\"IEnumerable{T}\"/> that contains the converted values of every node in the source collection with the given key.</returns>\n        public static IEnumerable<U> Values<U>(this IEnumerable<JToken> source, object key)\n        {\n            return Values<JToken, U>(source, key);\n        }\n\n        /// <summary>\n        /// Returns a collection of converted child values of every object in the source collection.\n        /// </summary>\n        /// <typeparam name=\"U\">The type to convert the values to.</typeparam>\n        /// <param name=\"source\">An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the source collection.</param>\n        /// <returns>An <see cref=\"IEnumerable{T}\"/> that contains the converted values of every node in the source collection.</returns>\n        public static IEnumerable<U> Values<U>(this IEnumerable<JToken> source)\n        {\n            return Values<JToken, U>(source, null);\n        }\n\n        /// <summary>\n        /// Converts the value.\n        /// </summary>\n        /// <typeparam name=\"U\">The type to convert the value to.</typeparam>\n        /// <param name=\"value\">A <see cref=\"JToken\"/> cast as a <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/>.</param>\n        /// <returns>A converted value.</returns>\n        public static U Value<U>(this IEnumerable<JToken> value)\n        {\n            return value.Value<JToken, U>();\n        }\n\n        /// <summary>\n        /// Converts the value.\n        /// </summary>\n        /// <typeparam name=\"T\">The source collection type.</typeparam>\n        /// <typeparam name=\"U\">The type to convert the value to.</typeparam>\n        /// <param name=\"value\">A <see cref=\"JToken\"/> cast as a <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/>.</param>\n        /// <returns>A converted value.</returns>\n        public static U Value<T, U>(this IEnumerable<T> value) where T : JToken\n        {\n            ValidationUtils.ArgumentNotNull(value, \"source\");\n\n            JToken token = value as JToken;\n            if (token == null)\n                throw new ArgumentException(\"Source value must be a JToken.\");\n\n            return token.Convert<JToken, U>();\n        }\n\n\n        internal static IEnumerable<U> Values<T, U>(this IEnumerable<T> source, object key) where T : JToken\n        {\n            ValidationUtils.ArgumentNotNull(source, \"source\");\n\n            foreach (JToken token in source)\n            {\n                if (key == null)\n                {\n                    if (token is JValue)\n                    {\n                        yield return Convert<JValue, U>((JValue)token);\n                    }\n                    else\n                    {\n                        foreach (JToken t in token.Children())\n                        {\n                            yield return t.Convert<JToken, U>();\n                        }\n                    }\n                }\n                else\n                {\n                    JToken value = token[key];\n                    if (value != null)\n                        yield return value.Convert<JToken, U>();\n                }\n            }\n\n            yield break;\n        }\n\n        //TODO\n        //public static IEnumerable<T> InDocumentOrder<T>(this IEnumerable<T> source) where T : JObject;\n\n        //public static IEnumerable<JToken> Children<T>(this IEnumerable<T> source) where T : JToken\n        //{\n        //  ValidationUtils.ArgumentNotNull(source, \"source\");\n\n        //  return source.SelectMany(c => c.Children());\n        //}\n\n        /// <summary>\n        /// Returns a collection of child tokens of every array in the source collection.\n        /// </summary>\n        /// <typeparam name=\"T\">The source collection type.</typeparam>\n        /// <param name=\"source\">An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the source collection.</param>\n        /// <returns>An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the values of every node in the source collection.</returns>\n        public static IJEnumerable<JToken> Children<T>(this IEnumerable<T> source) where T : JToken\n        {\n            return Children<T, JToken>(source).AsJEnumerable();\n        }\n\n        /// <summary>\n        /// Returns a collection of converted child tokens of every array in the source collection.\n        /// </summary>\n        /// <param name=\"source\">An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the source collection.</param>\n        /// <typeparam name=\"U\">The type to convert the values to.</typeparam>\n        /// <typeparam name=\"T\">The source collection type.</typeparam>\n        /// <returns>An <see cref=\"IEnumerable{T}\"/> that contains the converted values of every node in the source collection.</returns>\n        public static IEnumerable<U> Children<T, U>(this IEnumerable<T> source) where T : JToken\n        {\n            ValidationUtils.ArgumentNotNull(source, \"source\");\n\n            return source.SelectMany(c => c.Children()).Convert<JToken, U>();\n        }\n\n        internal static IEnumerable<U> Convert<T, U>(this IEnumerable<T> source) where T : JToken\n        {\n            ValidationUtils.ArgumentNotNull(source, \"source\");\n\n            foreach (T token in source)\n            {\n                yield return Convert<JToken, U>(token);\n            }\n        }\n\n        internal static U Convert<T, U>(this T token) where T : JToken\n        {\n            if (token == null)\n                return default(U);\n\n            if (token is U\n                // don't want to cast JValue to its interfaces, want to get the internal value\n                && typeof(U) != typeof(IComparable) && typeof(U) != typeof(IFormattable))\n            {\n                // HACK\n                return (U)(object)token;\n            }\n            else\n            {\n                JValue value = token as JValue;\n                if (value == null)\n                    throw new InvalidCastException(\"Cannot cast {0} to {1}.\".FormatWith(CultureInfo.InvariantCulture, token.GetType(), typeof(T)));\n\n                if (value.Value is U)\n                    return (U)value.Value;\n\n                Type targetType = typeof(U);\n\n                if (ReflectionUtils.IsNullableType(targetType))\n                {\n                    if (value.Value == null)\n                        return default(U);\n\n                    targetType = Nullable.GetUnderlyingType(targetType);\n                }\n\n                return (U)System.Convert.ChangeType(value.Value, targetType, CultureInfo.InvariantCulture);\n            }\n        }\n\n        //TODO\n        //public static void Remove<T>(this IEnumerable<T> source) where T : JContainer;\n\n        /// <summary>\n        /// Returns the input typed as <see cref=\"IJEnumerable{T}\"/>.\n        /// </summary>\n        /// <param name=\"source\">An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the source collection.</param>\n        /// <returns>The input typed as <see cref=\"IJEnumerable{T}\"/>.</returns>\n        public static IJEnumerable<JToken> AsJEnumerable(this IEnumerable<JToken> source)\n        {\n            return source.AsJEnumerable<JToken>();\n        }\n\n        /// <summary>\n        /// Returns the input typed as <see cref=\"IJEnumerable{T}\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The source collection type.</typeparam>\n        /// <param name=\"source\">An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> that contains the source collection.</param>\n        /// <returns>The input typed as <see cref=\"IJEnumerable{T}\"/>.</returns>\n        public static IJEnumerable<T> AsJEnumerable<T>(this IEnumerable<T> source) where T : JToken\n        {\n            if (source == null)\n                return null;\n            else if (source is IJEnumerable<T>)\n                return (IJEnumerable<T>)source;\n            else\n                return new JEnumerable<T>(source);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/IJEnumerable.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections.Generic;\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a collection of <see cref=\"JToken\"/> objects.\n    /// </summary>\n    /// <typeparam name=\"T\">The type of token</typeparam>\n    public interface IJEnumerable<\n#if !(NET20 || NET35 || PORTABLE40)\n        out\n#endif\n            T> : IEnumerable<T> where T : JToken\n    {\n        /// <summary>\n        /// Gets the <see cref=\"IJEnumerable{JToken}\"/> with the specified key.\n        /// </summary>\n        /// <value></value>\n        IJEnumerable<JToken> this[object key] { get; }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JArray.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Utilities;\nusing System.IO;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a JSON array.\n    /// </summary>\n    /// <example>\n    ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\LinqToJsonTests.cs\" region=\"LinqToJsonCreateParseArray\" title=\"Parsing a JSON Array from Text\" />\n    /// </example>\n    public class JArray : JContainer, IList<JToken>\n    {\n        private readonly List<JToken> _values = new List<JToken>();\n\n        /// <summary>\n        /// Gets the container's children tokens.\n        /// </summary>\n        /// <value>The container's children tokens.</value>\n        protected override IList<JToken> ChildrenTokens\n        {\n            get { return _values; }\n        }\n\n        /// <summary>\n        /// Gets the node type for this <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <value>The type.</value>\n        public override JTokenType Type\n        {\n            get { return JTokenType.Array; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JArray\"/> class.\n        /// </summary>\n        public JArray()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JArray\"/> class from another <see cref=\"JArray\"/> object.\n        /// </summary>\n        /// <param name=\"other\">A <see cref=\"JArray\"/> object to copy from.</param>\n        public JArray(JArray other)\n            : base(other)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JArray\"/> class with the specified content.\n        /// </summary>\n        /// <param name=\"content\">The contents of the array.</param>\n        public JArray(params object[] content)\n            : this((object)content)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JArray\"/> class with the specified content.\n        /// </summary>\n        /// <param name=\"content\">The contents of the array.</param>\n        public JArray(object content)\n        {\n            Add(content);\n        }\n\n        internal override bool DeepEquals(JToken node)\n        {\n            JArray t = node as JArray;\n            return (t != null && ContentsEqual(t));\n        }\n\n        internal override JToken CloneToken()\n        {\n            return new JArray(this);\n        }\n\n        /// <summary>\n        /// Loads an <see cref=\"JArray\"/> from a <see cref=\"JsonReader\"/>. \n        /// </summary>\n        /// <param name=\"reader\">A <see cref=\"JsonReader\"/> that will be read for the content of the <see cref=\"JArray\"/>.</param>\n        /// <returns>A <see cref=\"JArray\"/> that contains the JSON that was read from the specified <see cref=\"JsonReader\"/>.</returns>\n        public new static JArray Load(JsonReader reader)\n        {\n            if (reader.TokenType == JsonToken.None)\n            {\n                if (!reader.Read())\n                    throw JsonReaderException.Create(reader, \"Error reading JArray from JsonReader.\");\n            }\n\n            while (reader.TokenType == JsonToken.Comment)\n            {\n                reader.Read();\n            }\n\n            if (reader.TokenType != JsonToken.StartArray)\n                throw JsonReaderException.Create(reader, \"Error reading JArray from JsonReader. Current JsonReader item is not an array: {0}\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n\n            JArray a = new JArray();\n            a.SetLineInfo(reader as IJsonLineInfo);\n\n            a.ReadTokenFrom(reader);\n\n            return a;\n        }\n\n        /// <summary>\n        /// Load a <see cref=\"JArray\"/> from a string that contains JSON.\n        /// </summary>\n        /// <param name=\"json\">A <see cref=\"String\"/> that contains JSON.</param>\n        /// <returns>A <see cref=\"JArray\"/> populated from the string that contains JSON.</returns>\n        /// <example>\n        ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\LinqToJsonTests.cs\" region=\"LinqToJsonCreateParseArray\" title=\"Parsing a JSON Array from Text\" />\n        /// </example>\n        public new static JArray Parse(string json)\n        {\n            using (JsonReader reader = new JsonTextReader(new StringReader(json)))\n            {\n                JArray a = Load(reader);\n\n                if (reader.Read() && reader.TokenType != JsonToken.Comment)\n                    throw JsonReaderException.Create(reader, \"Additional text found in JSON string after parsing content.\");\n\n                return a;\n            }\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JArray\"/> from an object.\n        /// </summary>\n        /// <param name=\"o\">The object that will be used to create <see cref=\"JArray\"/>.</param>\n        /// <returns>A <see cref=\"JArray\"/> with the values of the specified object</returns>\n        public new static JArray FromObject(object o)\n        {\n            return FromObject(o, JsonSerializer.CreateDefault());\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JArray\"/> from an object.\n        /// </summary>\n        /// <param name=\"o\">The object that will be used to create <see cref=\"JArray\"/>.</param>\n        /// <param name=\"jsonSerializer\">The <see cref=\"JsonSerializer\"/> that will be used to read the object.</param>\n        /// <returns>A <see cref=\"JArray\"/> with the values of the specified object</returns>\n        public new static JArray FromObject(object o, JsonSerializer jsonSerializer)\n        {\n            JToken token = FromObjectInternal(o, jsonSerializer);\n\n            if (token.Type != JTokenType.Array)\n                throw new ArgumentException(\"Object serialized to {0}. JArray instance expected.\".FormatWith(CultureInfo.InvariantCulture, token.Type));\n\n            return (JArray)token;\n        }\n\n        /// <summary>\n        /// Writes this token to a <see cref=\"JsonWriter\"/>.\n        /// </summary>\n        /// <param name=\"writer\">A <see cref=\"JsonWriter\"/> into which this method will write.</param>\n        /// <param name=\"converters\">A collection of <see cref=\"JsonConverter\"/> which will be used when writing the token.</param>\n        public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)\n        {\n            writer.WriteStartArray();\n\n            for (int i = 0; i < _values.Count; i++)\n            {\n                _values[i].WriteTo(writer, converters);\n            }\n\n            writer.WriteEndArray();\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"JToken\"/> with the specified key.\n        /// </summary>\n        /// <value>The <see cref=\"JToken\"/> with the specified key.</value>\n        public override JToken this[object key]\n        {\n            get\n            {\n                ValidationUtils.ArgumentNotNull(key, \"o\");\n\n                if (!(key is int))\n                    throw new ArgumentException(\"Accessed JArray values with invalid key value: {0}. Array position index expected.\".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key)));\n\n                return GetItem((int)key);\n            }\n            set\n            {\n                ValidationUtils.ArgumentNotNull(key, \"o\");\n\n                if (!(key is int))\n                    throw new ArgumentException(\"Set JArray values with invalid key value: {0}. Array position index expected.\".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key)));\n\n                SetItem((int)key, value);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"Newtonsoft.Json.Linq.JToken\"/> at the specified index.\n        /// </summary>\n        /// <value></value>\n        public JToken this[int index]\n        {\n            get { return GetItem(index); }\n            set { SetItem(index, value); }\n        }\n\n        #region IList<JToken> Members\n        /// <summary>\n        /// Determines the index of a specific item in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.\n        /// </summary>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</param>\n        /// <returns>\n        /// The index of <paramref name=\"item\"/> if found in the list; otherwise, -1.\n        /// </returns>\n        public int IndexOf(JToken item)\n        {\n            return IndexOfItem(item);\n        }\n\n        /// <summary>\n        /// Inserts an item to the <see cref=\"T:System.Collections.Generic.IList`1\"/> at the specified index.\n        /// </summary>\n        /// <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n        /// <param name=\"item\">The object to insert into the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</param>\n        /// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n        /// \t<paramref name=\"index\"/> is not a valid index in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</exception>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.IList`1\"/> is read-only.</exception>\n        public void Insert(int index, JToken item)\n        {\n            InsertItem(index, item, false);\n        }\n\n        /// <summary>\n        /// Removes the <see cref=\"T:System.Collections.Generic.IList`1\"/> item at the specified index.\n        /// </summary>\n        /// <param name=\"index\">The zero-based index of the item to remove.</param>\n        /// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n        /// \t<paramref name=\"index\"/> is not a valid index in the <see cref=\"T:System.Collections.Generic.IList`1\"/>.</exception>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.IList`1\"/> is read-only.</exception>\n        public void RemoveAt(int index)\n        {\n            RemoveItemAt(index);\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\" /> that can be used to iterate through the collection.\n        /// </returns>\n        public IEnumerator<JToken> GetEnumerator()\n        {\n            return Children().GetEnumerator();\n        }\n        #endregion\n\n        #region ICollection<JToken> Members\n        /// <summary>\n        /// Adds an item to the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <param name=\"item\">The object to add to the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is read-only.</exception>\n        public void Add(JToken item)\n        {\n            Add((object)item);\n        }\n\n        /// <summary>\n        /// Removes all items from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is read-only. </exception>\n        public void Clear()\n        {\n            ClearItems();\n        }\n\n        /// <summary>\n        /// Determines whether the <see cref=\"T:System.Collections.Generic.ICollection`1\"/> contains a specific value.\n        /// </summary>\n        /// <param name=\"item\">The object to locate in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> is found in the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>; otherwise, false.\n        /// </returns>\n        public bool Contains(JToken item)\n        {\n            return ContainsItem(item);\n        }\n\n        /// <summary>\n        /// Copies to.\n        /// </summary>\n        /// <param name=\"array\">The array.</param>\n        /// <param name=\"arrayIndex\">Index of the array.</param>\n        public void CopyTo(JToken[] array, int arrayIndex)\n        {\n            CopyItemsTo(array, arrayIndex);\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether the <see cref=\"T:System.Collections.Generic.ICollection`1\" /> is read-only.\n        /// </summary>\n        /// <returns>true if the <see cref=\"T:System.Collections.Generic.ICollection`1\" /> is read-only; otherwise, false.</returns>\n        public bool IsReadOnly\n        {\n            get { return false; }\n        }\n\n        /// <summary>\n        /// Removes the first occurrence of a specific object from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </summary>\n        /// <param name=\"item\">The object to remove from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.</param>\n        /// <returns>\n        /// true if <paramref name=\"item\"/> was successfully removed from the <see cref=\"T:System.Collections.Generic.ICollection`1\"/>; otherwise, false. This method also returns false if <paramref name=\"item\"/> is not found in the original <see cref=\"T:System.Collections.Generic.ICollection`1\"/>.\n        /// </returns>\n        /// <exception cref=\"T:System.NotSupportedException\">The <see cref=\"T:System.Collections.Generic.ICollection`1\"/> is read-only.</exception>\n        public bool Remove(JToken item)\n        {\n            return RemoveItem(item);\n        }\n        #endregion\n\n        internal override int GetDeepHashCode()\n        {\n            return ContentsHashCode();\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JConstructor.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a JSON constructor.\n    /// </summary>\n    public class JConstructor : JContainer\n    {\n        private string _name;\n        private readonly List<JToken> _values = new List<JToken>();\n\n        /// <summary>\n        /// Gets the container's children tokens.\n        /// </summary>\n        /// <value>The container's children tokens.</value>\n        protected override IList<JToken> ChildrenTokens\n        {\n            get { return _values; }\n        }\n\n        /// <summary>\n        /// Gets or sets the name of this constructor.\n        /// </summary>\n        /// <value>The constructor name.</value>\n        public string Name\n        {\n            get { return _name; }\n            set { _name = value; }\n        }\n\n        /// <summary>\n        /// Gets the node type for this <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <value>The type.</value>\n        public override JTokenType Type\n        {\n            get { return JTokenType.Constructor; }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JConstructor\"/> class.\n        /// </summary>\n        public JConstructor()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JConstructor\"/> class from another <see cref=\"JConstructor\"/> object.\n        /// </summary>\n        /// <param name=\"other\">A <see cref=\"JConstructor\"/> object to copy from.</param>\n        public JConstructor(JConstructor other)\n            : base(other)\n        {\n            _name = other.Name;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JConstructor\"/> class with the specified name and content.\n        /// </summary>\n        /// <param name=\"name\">The constructor name.</param>\n        /// <param name=\"content\">The contents of the constructor.</param>\n        public JConstructor(string name, params object[] content)\n            : this(name, (object)content)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JConstructor\"/> class with the specified name and content.\n        /// </summary>\n        /// <param name=\"name\">The constructor name.</param>\n        /// <param name=\"content\">The contents of the constructor.</param>\n        public JConstructor(string name, object content)\n            : this(name)\n        {\n            Add(content);\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JConstructor\"/> class with the specified name.\n        /// </summary>\n        /// <param name=\"name\">The constructor name.</param>\n        public JConstructor(string name)\n        {\n            ValidationUtils.ArgumentNotNullOrEmpty(name, \"name\");\n\n            _name = name;\n        }\n\n        internal override bool DeepEquals(JToken node)\n        {\n            JConstructor c = node as JConstructor;\n            return (c != null && _name == c.Name && ContentsEqual(c));\n        }\n\n        internal override JToken CloneToken()\n        {\n            return new JConstructor(this);\n        }\n\n        /// <summary>\n        /// Writes this token to a <see cref=\"JsonWriter\"/>.\n        /// </summary>\n        /// <param name=\"writer\">A <see cref=\"JsonWriter\"/> into which this method will write.</param>\n        /// <param name=\"converters\">A collection of <see cref=\"JsonConverter\"/> which will be used when writing the token.</param>\n        public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)\n        {\n            writer.WriteStartConstructor(_name);\n\n            foreach (JToken token in Children())\n            {\n                token.WriteTo(writer, converters);\n            }\n\n            writer.WriteEndConstructor();\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"JToken\"/> with the specified key.\n        /// </summary>\n        /// <value>The <see cref=\"JToken\"/> with the specified key.</value>\n        public override JToken this[object key]\n        {\n            get\n            {\n                ValidationUtils.ArgumentNotNull(key, \"o\");\n\n                if (!(key is int))\n                    throw new ArgumentException(\"Accessed JConstructor values with invalid key value: {0}. Argument position index expected.\".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key)));\n\n                return GetItem((int)key);\n            }\n            set\n            {\n                ValidationUtils.ArgumentNotNull(key, \"o\");\n\n                if (!(key is int))\n                    throw new ArgumentException(\"Set JConstructor values with invalid key value: {0}. Argument position index expected.\".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key)));\n\n                SetItem((int)key, value);\n            }\n        }\n\n        internal override int GetDeepHashCode()\n        {\n            return _name.GetHashCode() ^ ContentsHashCode();\n        }\n\n        /// <summary>\n        /// Loads an <see cref=\"JConstructor\"/> from a <see cref=\"JsonReader\"/>. \n        /// </summary>\n        /// <param name=\"reader\">A <see cref=\"JsonReader\"/> that will be read for the content of the <see cref=\"JConstructor\"/>.</param>\n        /// <returns>A <see cref=\"JConstructor\"/> that contains the JSON that was read from the specified <see cref=\"JsonReader\"/>.</returns>\n        public new static JConstructor Load(JsonReader reader)\n        {\n            if (reader.TokenType == JsonToken.None)\n            {\n                if (!reader.Read())\n                    throw JsonReaderException.Create(reader, \"Error reading JConstructor from JsonReader.\");\n            }\n\n            while (reader.TokenType == JsonToken.Comment)\n            {\n                reader.Read();\n            }\n\n            if (reader.TokenType != JsonToken.StartConstructor)\n                throw JsonReaderException.Create(reader, \"Error reading JConstructor from JsonReader. Current JsonReader item is not a constructor: {0}\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n\n            JConstructor c = new JConstructor((string)reader.Value);\n            c.SetLineInfo(reader as IJsonLineInfo);\n\n            c.ReadTokenFrom(reader);\n\n            return c;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JContainer.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\n#if !PORTABLE40\nusing System.Collections.Specialized;\n#endif\nusing System.Threading;\nusing Newtonsoft.Json.Utilities;\nusing System.Collections;\nusing System.Globalization;\nusing System.ComponentModel;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a token that can contain other tokens.\n    /// </summary>\n    public abstract class JContainer : JToken, IList<JToken>\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n        , ITypedList, IBindingList\n#elif PORTABLE\n    , INotifyCollectionChanged\n#endif\n        , IList\n#if !(NET20 || NET35 || NETFX_CORE || PORTABLE40 || PORTABLE)\n        , INotifyCollectionChanged\n#endif\n    {\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        internal ListChangedEventHandler _listChanged;\n        internal AddingNewEventHandler _addingNew;\n\n        /// <summary>\n        /// Occurs when the list changes or an item in the list changes.\n        /// </summary>\n        public event ListChangedEventHandler ListChanged\n        {\n            add { _listChanged += value; }\n            remove { _listChanged -= value; }\n        }\n\n        /// <summary>\n        /// Occurs before an item is added to the collection.\n        /// </summary>\n        public event AddingNewEventHandler AddingNew\n        {\n            add { _addingNew += value; }\n            remove { _addingNew -= value; }\n        }\n#endif\n#if !(NET20 || NET35 || PORTABLE40)\n        internal NotifyCollectionChangedEventHandler _collectionChanged;\n\n        /// <summary>\n        /// Occurs when the items list of the collection has changed, or the collection is reset.\n        /// </summary>\n        public event NotifyCollectionChangedEventHandler CollectionChanged\n        {\n            add { _collectionChanged += value; }\n            remove { _collectionChanged -= value; }\n        }\n#endif\n\n        /// <summary>\n        /// Gets the container's children tokens.\n        /// </summary>\n        /// <value>The container's children tokens.</value>\n        protected abstract IList<JToken> ChildrenTokens { get; }\n\n        private object _syncRoot;\n#if !(PORTABLE40)\n        private bool _busy;\n#endif\n\n        internal JContainer()\n        {\n        }\n\n        internal JContainer(JContainer other)\n            : this()\n        {\n            ValidationUtils.ArgumentNotNull(other, \"c\");\n\n            foreach (JToken child in other)\n            {\n                Add(child);\n            }\n        }\n\n        internal void CheckReentrancy()\n        {\n#if !(PORTABLE40)\n            if (_busy)\n                throw new InvalidOperationException(\"Cannot change {0} during a collection change event.\".FormatWith(CultureInfo.InvariantCulture, GetType()));\n#endif\n        }\n\n        internal virtual IList<JToken> CreateChildrenCollection()\n        {\n            return new List<JToken>();\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        /// <summary>\n        /// Raises the <see cref=\"AddingNew\"/> event.\n        /// </summary>\n        /// <param name=\"e\">The <see cref=\"AddingNewEventArgs\"/> instance containing the event data.</param>\n        protected virtual void OnAddingNew(AddingNewEventArgs e)\n        {\n            AddingNewEventHandler handler = _addingNew;\n            if (handler != null)\n                handler(this, e);\n        }\n\n        /// <summary>\n        /// Raises the <see cref=\"ListChanged\"/> event.\n        /// </summary>\n        /// <param name=\"e\">The <see cref=\"ListChangedEventArgs\"/> instance containing the event data.</param>\n        protected virtual void OnListChanged(ListChangedEventArgs e)\n        {\n            ListChangedEventHandler handler = _listChanged;\n\n            if (handler != null)\n            {\n                _busy = true;\n                try\n                {\n                    handler(this, e);\n                }\n                finally\n                {\n                    _busy = false;\n                }\n            }\n        }\n#endif\n#if !(NET20 || NET35 || PORTABLE40)\n        /// <summary>\n        /// Raises the <see cref=\"CollectionChanged\"/> event.\n        /// </summary>\n        /// <param name=\"e\">The <see cref=\"NotifyCollectionChangedEventArgs\"/> instance containing the event data.</param>\n        protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)\n        {\n            NotifyCollectionChangedEventHandler handler = _collectionChanged;\n\n            if (handler != null)\n            {\n                _busy = true;\n                try\n                {\n                    handler(this, e);\n                }\n                finally\n                {\n                    _busy = false;\n                }\n            }\n        }\n#endif\n\n        /// <summary>\n        /// Gets a value indicating whether this token has child tokens.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if this token has child values; otherwise, <c>false</c>.\n        /// </value>\n        public override bool HasValues\n        {\n            get { return ChildrenTokens.Count > 0; }\n        }\n\n        internal bool ContentsEqual(JContainer container)\n        {\n            if (container == this)\n                return true;\n\n            IList<JToken> t1 = ChildrenTokens;\n            IList<JToken> t2 = container.ChildrenTokens;\n\n            if (t1.Count != t2.Count)\n                return false;\n\n            for (int i = 0; i < t1.Count; i++)\n            {\n                if (!t1[i].DeepEquals(t2[i]))\n                    return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Get the first child token of this token.\n        /// </summary>\n        /// <value>\n        /// A <see cref=\"JToken\"/> containing the first child token of the <see cref=\"JToken\"/>.\n        /// </value>\n        public override JToken First\n        {\n            get { return ChildrenTokens.FirstOrDefault(); }\n        }\n\n        /// <summary>\n        /// Get the last child token of this token.\n        /// </summary>\n        /// <value>\n        /// A <see cref=\"JToken\"/> containing the last child token of the <see cref=\"JToken\"/>.\n        /// </value>\n        public override JToken Last\n        {\n            get { return ChildrenTokens.LastOrDefault(); }\n        }\n\n        /// <summary>\n        /// Returns a collection of the child tokens of this token, in document order.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> containing the child tokens of this <see cref=\"JToken\"/>, in document order.\n        /// </returns>\n        public override JEnumerable<JToken> Children()\n        {\n            return new JEnumerable<JToken>(ChildrenTokens);\n        }\n\n        /// <summary>\n        /// Returns a collection of the child values of this token, in document order.\n        /// </summary>\n        /// <typeparam name=\"T\">The type to convert the values to.</typeparam>\n        /// <returns>\n        /// A <see cref=\"IEnumerable{T}\"/> containing the child values of this <see cref=\"JToken\"/>, in document order.\n        /// </returns>\n        public override IEnumerable<T> Values<T>()\n        {\n            return ChildrenTokens.Convert<JToken, T>();\n        }\n\n        /// <summary>\n        /// Returns a collection of the descendant tokens for this token in document order.\n        /// </summary>\n        /// <returns>An <see cref=\"IEnumerable{JToken}\"/> containing the descendant tokens of the <see cref=\"JToken\"/>.</returns>\n        public IEnumerable<JToken> Descendants()\n        {\n            foreach (JToken o in ChildrenTokens)\n            {\n                yield return o;\n                JContainer c = o as JContainer;\n                if (c != null)\n                {\n                    foreach (JToken d in c.Descendants())\n                    {\n                        yield return d;\n                    }\n                }\n            }\n        }\n\n        internal bool IsMultiContent(object content)\n        {\n            return (content is IEnumerable && !(content is string) && !(content is JToken) && !(content is byte[]));\n        }\n\n        internal JToken EnsureParentToken(JToken item, bool skipParentCheck)\n        {\n            if (item == null)\n                return new JValue((object)null);\n\n            if (skipParentCheck)\n                return item;\n\n            // to avoid a token having multiple parents or creating a recursive loop, create a copy if...\n            // the item already has a parent\n            // the item is being added to itself\n            // the item is being added to the root parent of itself\n            if (item.Parent != null || item == this || (item.HasValues && Root == item))\n                item = item.CloneToken();\n\n            return item;\n        }\n\n        private class JTokenReferenceEqualityComparer : IEqualityComparer<JToken>\n        {\n            public static readonly JTokenReferenceEqualityComparer Instance = new JTokenReferenceEqualityComparer();\n\n            public bool Equals(JToken x, JToken y)\n            {\n                return ReferenceEquals(x, y);\n            }\n\n            public int GetHashCode(JToken obj)\n            {\n                if (obj == null)\n                    return 0;\n\n                return obj.GetHashCode();\n            }\n        }\n\n        internal int IndexOfItem(JToken item)\n        {\n            return ChildrenTokens.IndexOf(item, JTokenReferenceEqualityComparer.Instance);\n        }\n\n        internal virtual void InsertItem(int index, JToken item, bool skipParentCheck)\n        {\n            if (index > ChildrenTokens.Count)\n                throw new ArgumentOutOfRangeException(\"index\", \"Index must be within the bounds of the List.\");\n\n            CheckReentrancy();\n\n            item = EnsureParentToken(item, skipParentCheck);\n\n            JToken previous = (index == 0) ? null : ChildrenTokens[index - 1];\n            // haven't inserted new token yet so next token is still at the inserting index\n            JToken next = (index == ChildrenTokens.Count) ? null : ChildrenTokens[index];\n\n            ValidateToken(item, null);\n\n            item.Parent = this;\n\n            item.Previous = previous;\n            if (previous != null)\n                previous.Next = item;\n\n            item.Next = next;\n            if (next != null)\n                next.Previous = item;\n\n            ChildrenTokens.Insert(index, item);\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            if (_listChanged != null)\n                OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));\n#endif\n#if !(NET20 || NET35 || PORTABLE40)\n            if (_collectionChanged != null)\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index));\n#endif\n        }\n\n        internal virtual void RemoveItemAt(int index)\n        {\n            if (index < 0)\n                throw new ArgumentOutOfRangeException(\"index\", \"Index is less than 0.\");\n            if (index >= ChildrenTokens.Count)\n                throw new ArgumentOutOfRangeException(\"index\", \"Index is equal to or greater than Count.\");\n\n            CheckReentrancy();\n\n            JToken item = ChildrenTokens[index];\n            JToken previous = (index == 0) ? null : ChildrenTokens[index - 1];\n            JToken next = (index == ChildrenTokens.Count - 1) ? null : ChildrenTokens[index + 1];\n\n            if (previous != null)\n                previous.Next = next;\n            if (next != null)\n                next.Previous = previous;\n\n            item.Parent = null;\n            item.Previous = null;\n            item.Next = null;\n\n            ChildrenTokens.RemoveAt(index);\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            if (_listChanged != null)\n                OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));\n#endif\n#if !(NET20 || NET35 || PORTABLE40)\n            if (_collectionChanged != null)\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, index));\n#endif\n        }\n\n        internal virtual bool RemoveItem(JToken item)\n        {\n            int index = IndexOfItem(item);\n            if (index >= 0)\n            {\n                RemoveItemAt(index);\n                return true;\n            }\n\n            return false;\n        }\n\n        internal virtual JToken GetItem(int index)\n        {\n            return ChildrenTokens[index];\n        }\n\n        internal virtual void SetItem(int index, JToken item)\n        {\n            if (index < 0)\n                throw new ArgumentOutOfRangeException(\"index\", \"Index is less than 0.\");\n            if (index >= ChildrenTokens.Count)\n                throw new ArgumentOutOfRangeException(\"index\", \"Index is equal to or greater than Count.\");\n\n            JToken existing = ChildrenTokens[index];\n\n            if (IsTokenUnchanged(existing, item))\n                return;\n\n            CheckReentrancy();\n\n            item = EnsureParentToken(item, false);\n\n            ValidateToken(item, existing);\n\n            JToken previous = (index == 0) ? null : ChildrenTokens[index - 1];\n            JToken next = (index == ChildrenTokens.Count - 1) ? null : ChildrenTokens[index + 1];\n\n            item.Parent = this;\n\n            item.Previous = previous;\n            if (previous != null)\n                previous.Next = item;\n\n            item.Next = next;\n            if (next != null)\n                next.Previous = item;\n\n            ChildrenTokens[index] = item;\n\n            existing.Parent = null;\n            existing.Previous = null;\n            existing.Next = null;\n\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n            if (_listChanged != null)\n                OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));\n#endif\n#if !(NET20 || NET35 || PORTABLE40)\n            if (_collectionChanged != null)\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, item, existing, index));\n#endif\n        }\n\n        internal virtual void ClearItems()\n        {\n            CheckReentrancy();\n\n            foreach (JToken item in ChildrenTokens)\n            {\n                item.Parent = null;\n                item.Previous = null;\n                item.Next = null;\n            }\n\n            ChildrenTokens.Clear();\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            if (_listChanged != null)\n                OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));\n#endif\n#if !(NET20 || NET35 || PORTABLE40)\n            if (_collectionChanged != null)\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));\n#endif\n        }\n\n        internal virtual void ReplaceItem(JToken existing, JToken replacement)\n        {\n            if (existing == null || existing.Parent != this)\n                return;\n\n            int index = IndexOfItem(existing);\n            SetItem(index, replacement);\n        }\n\n        internal virtual bool ContainsItem(JToken item)\n        {\n            return (IndexOfItem(item) != -1);\n        }\n\n        internal virtual void CopyItemsTo(Array array, int arrayIndex)\n        {\n            if (array == null)\n                throw new ArgumentNullException(\"array\");\n            if (arrayIndex < 0)\n                throw new ArgumentOutOfRangeException(\"arrayIndex\", \"arrayIndex is less than 0.\");\n            if (arrayIndex >= array.Length && arrayIndex != 0)\n                throw new ArgumentException(\"arrayIndex is equal to or greater than the length of array.\");\n            if (Count > array.Length - arrayIndex)\n                throw new ArgumentException(\"The number of elements in the source JObject is greater than the available space from arrayIndex to the end of the destination array.\");\n\n            int index = 0;\n            foreach (JToken token in ChildrenTokens)\n            {\n                array.SetValue(token, arrayIndex + index);\n                index++;\n            }\n        }\n\n        internal static bool IsTokenUnchanged(JToken currentValue, JToken newValue)\n        {\n            JValue v1 = currentValue as JValue;\n            if (v1 != null)\n            {\n                // null will get turned into a JValue of type null\n                if (v1.Type == JTokenType.Null && newValue == null)\n                    return true;\n\n                return v1.Equals(newValue);\n            }\n\n            return false;\n        }\n\n        internal virtual void ValidateToken(JToken o, JToken existing)\n        {\n            ValidationUtils.ArgumentNotNull(o, \"o\");\n\n            if (o.Type == JTokenType.Property)\n                throw new ArgumentException(\"Can not add {0} to {1}.\".FormatWith(CultureInfo.InvariantCulture, o.GetType(), GetType()));\n        }\n\n        /// <summary>\n        /// Adds the specified content as children of this <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"content\">The content to be added.</param>\n        public virtual void Add(object content)\n        {\n            AddInternal(ChildrenTokens.Count, content, false);\n        }\n\n        internal void AddAndSkipParentCheck(JToken token)\n        {\n            AddInternal(ChildrenTokens.Count, token, true);\n        }\n\n        /// <summary>\n        /// Adds the specified content as the first children of this <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"content\">The content to be added.</param>\n        public void AddFirst(object content)\n        {\n            AddInternal(0, content, false);\n        }\n\n        internal void AddInternal(int index, object content, bool skipParentCheck)\n        {\n            if (IsMultiContent(content))\n            {\n                IEnumerable enumerable = (IEnumerable)content;\n\n                int multiIndex = index;\n                foreach (object c in enumerable)\n                {\n                    AddInternal(multiIndex, c, skipParentCheck);\n                    multiIndex++;\n                }\n            }\n            else\n            {\n                JToken item = CreateFromContent(content);\n\n                InsertItem(index, item, skipParentCheck);\n            }\n        }\n\n        internal JToken CreateFromContent(object content)\n        {\n            if (content is JToken)\n                return (JToken)content;\n\n            return new JValue(content);\n        }\n\n        /// <summary>\n        /// Creates an <see cref=\"JsonWriter\"/> that can be used to add tokens to the <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <returns>An <see cref=\"JsonWriter\"/> that is ready to have content written to it.</returns>\n        public JsonWriter CreateWriter()\n        {\n            return new JTokenWriter(this);\n        }\n\n        /// <summary>\n        /// Replaces the children nodes of this token with the specified content.\n        /// </summary>\n        /// <param name=\"content\">The content.</param>\n        public void ReplaceAll(object content)\n        {\n            ClearItems();\n            Add(content);\n        }\n\n        /// <summary>\n        /// Removes the child nodes from this token.\n        /// </summary>\n        public void RemoveAll()\n        {\n            ClearItems();\n        }\n\n        internal void ReadTokenFrom(JsonReader reader)\n        {\n            int startDepth = reader.Depth;\n\n            if (!reader.Read())\n                throw JsonReaderException.Create(reader, \"Error reading {0} from JsonReader.\".FormatWith(CultureInfo.InvariantCulture, GetType().Name));\n\n            ReadContentFrom(reader);\n\n            int endDepth = reader.Depth;\n\n            if (endDepth > startDepth)\n                throw JsonReaderException.Create(reader, \"Unexpected end of content while loading {0}.\".FormatWith(CultureInfo.InvariantCulture, GetType().Name));\n        }\n\n        internal void ReadContentFrom(JsonReader r)\n        {\n            ValidationUtils.ArgumentNotNull(r, \"r\");\n            IJsonLineInfo lineInfo = r as IJsonLineInfo;\n\n            JContainer parent = this;\n\n            do\n            {\n                if (parent is JProperty && ((JProperty)parent).Value != null)\n                {\n                    if (parent == this)\n                        return;\n\n                    parent = parent.Parent;\n                }\n\n                switch (r.TokenType)\n                {\n                    case JsonToken.None:\n                        // new reader. move to actual content\n                        break;\n                    case JsonToken.StartArray:\n                        JArray a = new JArray();\n                        a.SetLineInfo(lineInfo);\n                        parent.Add(a);\n                        parent = a;\n                        break;\n\n                    case JsonToken.EndArray:\n                        if (parent == this)\n                            return;\n\n                        parent = parent.Parent;\n                        break;\n                    case JsonToken.StartObject:\n                        JObject o = new JObject();\n                        o.SetLineInfo(lineInfo);\n                        parent.Add(o);\n                        parent = o;\n                        break;\n                    case JsonToken.EndObject:\n                        if (parent == this)\n                            return;\n\n                        parent = parent.Parent;\n                        break;\n                    case JsonToken.StartConstructor:\n                        JConstructor constructor = new JConstructor(r.Value.ToString());\n                        constructor.SetLineInfo(lineInfo);\n                        parent.Add(constructor);\n                        parent = constructor;\n                        break;\n                    case JsonToken.EndConstructor:\n                        if (parent == this)\n                            return;\n\n                        parent = parent.Parent;\n                        break;\n                    case JsonToken.String:\n                    case JsonToken.Integer:\n                    case JsonToken.Float:\n                    case JsonToken.Date:\n                    case JsonToken.Boolean:\n                    case JsonToken.Bytes:\n                        JValue v = new JValue(r.Value);\n                        v.SetLineInfo(lineInfo);\n                        parent.Add(v);\n                        break;\n                    case JsonToken.Comment:\n                        v = JValue.CreateComment(r.Value.ToString());\n                        v.SetLineInfo(lineInfo);\n                        parent.Add(v);\n                        break;\n                    case JsonToken.Null:\n                        v = new JValue(null, JTokenType.Null);\n                        v.SetLineInfo(lineInfo);\n                        parent.Add(v);\n                        break;\n                    case JsonToken.Undefined:\n                        v = new JValue(null, JTokenType.Undefined);\n                        v.SetLineInfo(lineInfo);\n                        parent.Add(v);\n                        break;\n                    case JsonToken.PropertyName:\n                        string propertyName = r.Value.ToString();\n                        JProperty property = new JProperty(propertyName);\n                        property.SetLineInfo(lineInfo);\n                        JObject parentObject = (JObject)parent;\n                        // handle multiple properties with the same name in JSON\n                        JProperty existingPropertyWithName = parentObject.Property(propertyName);\n                        if (existingPropertyWithName == null)\n                            parent.Add(property);\n                        else\n                            existingPropertyWithName.Replace(property);\n                        parent = property;\n                        break;\n                    default:\n                        throw new InvalidOperationException(\"The JsonReader should not be on a token of type {0}.\".FormatWith(CultureInfo.InvariantCulture, r.TokenType));\n                }\n            } while (r.Read());\n        }\n\n        internal int ContentsHashCode()\n        {\n            int hashCode = 0;\n            foreach (JToken item in ChildrenTokens)\n            {\n                hashCode ^= item.GetDeepHashCode();\n            }\n            return hashCode;\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        string ITypedList.GetListName(PropertyDescriptor[] listAccessors)\n        {\n            return string.Empty;\n        }\n\n        PropertyDescriptorCollection ITypedList.GetItemProperties(PropertyDescriptor[] listAccessors)\n        {\n            ICustomTypeDescriptor d = First as ICustomTypeDescriptor;\n            if (d != null)\n                return d.GetProperties();\n\n            return null;\n        }\n#endif\n\n        #region IList<JToken> Members\n        int IList<JToken>.IndexOf(JToken item)\n        {\n            return IndexOfItem(item);\n        }\n\n        void IList<JToken>.Insert(int index, JToken item)\n        {\n            InsertItem(index, item, false);\n        }\n\n        void IList<JToken>.RemoveAt(int index)\n        {\n            RemoveItemAt(index);\n        }\n\n        JToken IList<JToken>.this[int index]\n        {\n            get { return GetItem(index); }\n            set { SetItem(index, value); }\n        }\n        #endregion\n\n        #region ICollection<JToken> Members\n        void ICollection<JToken>.Add(JToken item)\n        {\n            Add(item);\n        }\n\n        void ICollection<JToken>.Clear()\n        {\n            ClearItems();\n        }\n\n        bool ICollection<JToken>.Contains(JToken item)\n        {\n            return ContainsItem(item);\n        }\n\n        void ICollection<JToken>.CopyTo(JToken[] array, int arrayIndex)\n        {\n            CopyItemsTo(array, arrayIndex);\n        }\n\n        bool ICollection<JToken>.IsReadOnly\n        {\n            get { return false; }\n        }\n\n        bool ICollection<JToken>.Remove(JToken item)\n        {\n            return RemoveItem(item);\n        }\n        #endregion\n\n        private JToken EnsureValue(object value)\n        {\n            if (value == null)\n                return null;\n\n            if (value is JToken)\n                return (JToken)value;\n\n            throw new ArgumentException(\"Argument is not a JToken.\");\n        }\n\n        #region IList Members\n        int IList.Add(object value)\n        {\n            Add(EnsureValue(value));\n            return Count - 1;\n        }\n\n        void IList.Clear()\n        {\n            ClearItems();\n        }\n\n        bool IList.Contains(object value)\n        {\n            return ContainsItem(EnsureValue(value));\n        }\n\n        int IList.IndexOf(object value)\n        {\n            return IndexOfItem(EnsureValue(value));\n        }\n\n        void IList.Insert(int index, object value)\n        {\n            InsertItem(index, EnsureValue(value), false);\n        }\n\n        bool IList.IsFixedSize\n        {\n            get { return false; }\n        }\n\n        bool IList.IsReadOnly\n        {\n            get { return false; }\n        }\n\n        void IList.Remove(object value)\n        {\n            RemoveItem(EnsureValue(value));\n        }\n\n        void IList.RemoveAt(int index)\n        {\n            RemoveItemAt(index);\n        }\n\n        object IList.this[int index]\n        {\n            get { return GetItem(index); }\n            set { SetItem(index, EnsureValue(value)); }\n        }\n        #endregion\n\n        #region ICollection Members\n        void ICollection.CopyTo(Array array, int index)\n        {\n            CopyItemsTo(array, index);\n        }\n\n        /// <summary>\n        /// Gets the count of child JSON tokens.\n        /// </summary>\n        /// <value>The count of child JSON tokens</value>\n        public int Count\n        {\n            get { return ChildrenTokens.Count; }\n        }\n\n        bool ICollection.IsSynchronized\n        {\n            get { return false; }\n        }\n\n        object ICollection.SyncRoot\n        {\n            get\n            {\n                if (_syncRoot == null)\n                    Interlocked.CompareExchange(ref _syncRoot, new object(), null);\n\n                return _syncRoot;\n            }\n        }\n        #endregion\n\n        #region IBindingList Members\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n        void IBindingList.AddIndex(PropertyDescriptor property)\n        {\n        }\n\n        object IBindingList.AddNew()\n        {\n            AddingNewEventArgs args = new AddingNewEventArgs();\n            OnAddingNew(args);\n\n            if (args.NewObject == null)\n                throw new JsonException(\"Could not determine new value to add to '{0}'.\".FormatWith(CultureInfo.InvariantCulture, GetType()));\n\n            if (!(args.NewObject is JToken))\n                throw new JsonException(\"New item to be added to collection must be compatible with {0}.\".FormatWith(CultureInfo.InvariantCulture, typeof(JToken)));\n\n            JToken newItem = (JToken)args.NewObject;\n            Add(newItem);\n\n            return newItem;\n        }\n\n        bool IBindingList.AllowEdit\n        {\n            get { return true; }\n        }\n\n        bool IBindingList.AllowNew\n        {\n            get { return true; }\n        }\n\n        bool IBindingList.AllowRemove\n        {\n            get { return true; }\n        }\n\n        void IBindingList.ApplySort(PropertyDescriptor property, ListSortDirection direction)\n        {\n            throw new NotSupportedException();\n        }\n\n        int IBindingList.Find(PropertyDescriptor property, object key)\n        {\n            throw new NotSupportedException();\n        }\n\n        bool IBindingList.IsSorted\n        {\n            get { return false; }\n        }\n\n        void IBindingList.RemoveIndex(PropertyDescriptor property)\n        {\n        }\n\n        void IBindingList.RemoveSort()\n        {\n            throw new NotSupportedException();\n        }\n\n        ListSortDirection IBindingList.SortDirection\n        {\n            get { return ListSortDirection.Ascending; }\n        }\n\n        PropertyDescriptor IBindingList.SortProperty\n        {\n            get { return null; }\n        }\n\n        bool IBindingList.SupportsChangeNotification\n        {\n            get { return true; }\n        }\n\n        bool IBindingList.SupportsSearching\n        {\n            get { return false; }\n        }\n\n        bool IBindingList.SupportsSorting\n        {\n            get { return false; }\n        }\n#endif\n        #endregion\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JEnumerable.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections.Generic;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\nusing Newtonsoft.Json.Utilities;\nusing System.Collections;\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a collection of <see cref=\"JToken\"/> objects.\n    /// </summary>\n    /// <typeparam name=\"T\">The type of token</typeparam>\n    public struct JEnumerable<T> : IJEnumerable<T> where T : JToken\n    {\n        /// <summary>\n        /// An empty collection of <see cref=\"JToken\"/> objects.\n        /// </summary>\n        public static readonly JEnumerable<T> Empty = new JEnumerable<T>(Enumerable.Empty<T>());\n\n        private readonly IEnumerable<T> _enumerable;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JEnumerable{T}\"/> struct.\n        /// </summary>\n        /// <param name=\"enumerable\">The enumerable.</param>\n        public JEnumerable(IEnumerable<T> enumerable)\n        {\n            ValidationUtils.ArgumentNotNull(enumerable, \"enumerable\");\n\n            _enumerable = enumerable;\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n        /// </returns>\n        public IEnumerator<T> GetEnumerator()\n        {\n            return _enumerable.GetEnumerator();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through a collection.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n        /// </returns>\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"IJEnumerable{JToken}\"/> with the specified key.\n        /// </summary>\n        /// <value></value>\n        public IJEnumerable<JToken> this[object key]\n        {\n            get { return new JEnumerable<JToken>(Extensions.Values<T, JToken>(_enumerable, key)); }\n        }\n\n        /// <summary>\n        /// Determines whether the specified <see cref=\"System.Object\"/> is equal to this instance.\n        /// </summary>\n        /// <param name=\"obj\">The <see cref=\"System.Object\"/> to compare with this instance.</param>\n        /// <returns>\n        /// \t<c>true</c> if the specified <see cref=\"System.Object\"/> is equal to this instance; otherwise, <c>false</c>.\n        /// </returns>\n        public override bool Equals(object obj)\n        {\n            if (obj is JEnumerable<T>)\n                return _enumerable.Equals(((JEnumerable<T>)obj)._enumerable);\n\n            return false;\n        }\n\n        /// <summary>\n        /// Returns a hash code for this instance.\n        /// </summary>\n        /// <returns>\n        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. \n        /// </returns>\n        public override int GetHashCode()\n        {\n            return _enumerable.GetHashCode();\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JObject.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n#if !PORTABLE40\nusing System.Collections.Specialized;\n#endif\nusing System.ComponentModel;\n#if !(NET35 || NET20 || PORTABLE40)\nusing System.Dynamic;\nusing System.Linq.Expressions;\n#endif\nusing System.IO;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a JSON object.\n    /// </summary>\n    /// <example>\n    ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\LinqToJsonTests.cs\" region=\"LinqToJsonCreateParse\" title=\"Parsing a JSON Object from Text\" />\n    /// </example>\n    public class JObject : JContainer, IDictionary<string, JToken>, INotifyPropertyChanged\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        , ICustomTypeDescriptor\n#endif\n#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)\n        , INotifyPropertyChanging\n#endif\n    {\n        private readonly JPropertyKeyedCollection _properties = new JPropertyKeyedCollection();\n\n        /// <summary>\n        /// Gets the container's children tokens.\n        /// </summary>\n        /// <value>The container's children tokens.</value>\n        protected override IList<JToken> ChildrenTokens\n        {\n            get { return _properties; }\n        }\n\n        /// <summary>\n        /// Occurs when a property value changes.\n        /// </summary>\n        public event PropertyChangedEventHandler PropertyChanged;\n\n#if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40)\n        /// <summary>\n        /// Occurs when a property value is changing.\n        /// </summary>\n        public event PropertyChangingEventHandler PropertyChanging;\n#endif\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JObject\"/> class.\n        /// </summary>\n        public JObject()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JObject\"/> class from another <see cref=\"JObject\"/> object.\n        /// </summary>\n        /// <param name=\"other\">A <see cref=\"JObject\"/> object to copy from.</param>\n        public JObject(JObject other)\n            : base(other)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JObject\"/> class with the specified content.\n        /// </summary>\n        /// <param name=\"content\">The contents of the object.</param>\n        public JObject(params object[] content)\n            : this((object)content)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JObject\"/> class with the specified content.\n        /// </summary>\n        /// <param name=\"content\">The contents of the object.</param>\n        public JObject(object content)\n        {\n            Add(content);\n        }\n\n        internal override bool DeepEquals(JToken node)\n        {\n            JObject t = node as JObject;\n            if (t == null)\n                return false;\n\n            return _properties.Compare(t._properties);\n        }\n\n        internal override void InsertItem(int index, JToken item, bool skipParentCheck)\n        {\n            // don't add comments to JObject, no name to reference comment by\n            if (item != null && item.Type == JTokenType.Comment)\n                return;\n\n            base.InsertItem(index, item, skipParentCheck);\n        }\n\n        internal override void ValidateToken(JToken o, JToken existing)\n        {\n            ValidationUtils.ArgumentNotNull(o, \"o\");\n\n            if (o.Type != JTokenType.Property)\n                throw new ArgumentException(\"Can not add {0} to {1}.\".FormatWith(CultureInfo.InvariantCulture, o.GetType(), GetType()));\n\n            JProperty newProperty = (JProperty)o;\n\n            if (existing != null)\n            {\n                JProperty existingProperty = (JProperty)existing;\n\n                if (newProperty.Name == existingProperty.Name)\n                    return;\n            }\n\n            if (_properties.TryGetValue(newProperty.Name, out existing))\n                throw new ArgumentException(\"Can not add property {0} to {1}. Property with the same name already exists on object.\".FormatWith(CultureInfo.InvariantCulture, newProperty.Name, GetType()));\n        }\n\n        internal void InternalPropertyChanged(JProperty childProperty)\n        {\n            OnPropertyChanged(childProperty.Name);\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            if (_listChanged != null)\n                OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, IndexOfItem(childProperty)));\n#endif\n#if !(NET20 || NET35 || PORTABLE40)\n            if (_collectionChanged != null)\n                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, childProperty, childProperty, IndexOfItem(childProperty)));\n#endif\n        }\n\n        internal void InternalPropertyChanging(JProperty childProperty)\n        {\n#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)\n            OnPropertyChanging(childProperty.Name);\n#endif\n        }\n\n        internal override JToken CloneToken()\n        {\n            return new JObject(this);\n        }\n\n        /// <summary>\n        /// Gets the node type for this <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <value>The type.</value>\n        public override JTokenType Type\n        {\n            get { return JTokenType.Object; }\n        }\n\n        /// <summary>\n        /// Gets an <see cref=\"IEnumerable{JProperty}\"/> of this object's properties.\n        /// </summary>\n        /// <returns>An <see cref=\"IEnumerable{JProperty}\"/> of this object's properties.</returns>\n        public IEnumerable<JProperty> Properties()\n        {\n            return _properties.Cast<JProperty>();\n        }\n\n        /// <summary>\n        /// Gets a <see cref=\"JProperty\"/> the specified name.\n        /// </summary>\n        /// <param name=\"name\">The property name.</param>\n        /// <returns>A <see cref=\"JProperty\"/> with the specified name or null.</returns>\n        public JProperty Property(string name)\n        {\n            if (name == null)\n                return null;\n\n            JToken property;\n            _properties.TryGetValue(name, out property);\n            return (JProperty)property;\n        }\n\n        /// <summary>\n        /// Gets an <see cref=\"JEnumerable{JToken}\"/> of this object's property values.\n        /// </summary>\n        /// <returns>An <see cref=\"JEnumerable{JToken}\"/> of this object's property values.</returns>\n        public JEnumerable<JToken> PropertyValues()\n        {\n            return new JEnumerable<JToken>(Properties().Select(p => p.Value));\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"JToken\"/> with the specified key.\n        /// </summary>\n        /// <value>The <see cref=\"JToken\"/> with the specified key.</value>\n        public override JToken this[object key]\n        {\n            get\n            {\n                ValidationUtils.ArgumentNotNull(key, \"o\");\n\n                string propertyName = key as string;\n                if (propertyName == null)\n                    throw new ArgumentException(\"Accessed JObject values with invalid key value: {0}. Object property name expected.\".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key)));\n\n                return this[propertyName];\n            }\n            set\n            {\n                ValidationUtils.ArgumentNotNull(key, \"o\");\n\n                string propertyName = key as string;\n                if (propertyName == null)\n                    throw new ArgumentException(\"Set JObject values with invalid key value: {0}. Object property name expected.\".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.ToString(key)));\n\n                this[propertyName] = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"Newtonsoft.Json.Linq.JToken\"/> with the specified property name.\n        /// </summary>\n        /// <value></value>\n        public JToken this[string propertyName]\n        {\n            get\n            {\n                ValidationUtils.ArgumentNotNull(propertyName, \"propertyName\");\n\n                JProperty property = Property(propertyName);\n\n                return (property != null) ? property.Value : null;\n            }\n            set\n            {\n                JProperty property = Property(propertyName);\n                if (property != null)\n                {\n                    property.Value = value;\n                }\n                else\n                {\n#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)\n                    OnPropertyChanging(propertyName);\n#endif\n                    Add(new JProperty(propertyName, value));\n                    OnPropertyChanged(propertyName);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Loads an <see cref=\"JObject\"/> from a <see cref=\"JsonReader\"/>. \n        /// </summary>\n        /// <param name=\"reader\">A <see cref=\"JsonReader\"/> that will be read for the content of the <see cref=\"JObject\"/>.</param>\n        /// <returns>A <see cref=\"JObject\"/> that contains the JSON that was read from the specified <see cref=\"JsonReader\"/>.</returns>\n        public new static JObject Load(JsonReader reader)\n        {\n            ValidationUtils.ArgumentNotNull(reader, \"reader\");\n\n            if (reader.TokenType == JsonToken.None)\n            {\n                if (!reader.Read())\n                    throw JsonReaderException.Create(reader, \"Error reading JObject from JsonReader.\");\n            }\n\n            while (reader.TokenType == JsonToken.Comment)\n            {\n                reader.Read();\n            }\n\n            if (reader.TokenType != JsonToken.StartObject)\n            {\n                throw JsonReaderException.Create(reader, \"Error reading JObject from JsonReader. Current JsonReader item is not an object: {0}\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n            }\n\n            JObject o = new JObject();\n            o.SetLineInfo(reader as IJsonLineInfo);\n\n            o.ReadTokenFrom(reader);\n\n            return o;\n        }\n\n        /// <summary>\n        /// Load a <see cref=\"JObject\"/> from a string that contains JSON.\n        /// </summary>\n        /// <param name=\"json\">A <see cref=\"String\"/> that contains JSON.</param>\n        /// <returns>A <see cref=\"JObject\"/> populated from the string that contains JSON.</returns>\n        /// <example>\n        ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\LinqToJsonTests.cs\" region=\"LinqToJsonCreateParse\" title=\"Parsing a JSON Object from Text\" />\n        /// </example>\n        public new static JObject Parse(string json)\n        {\n            using (JsonReader reader = new JsonTextReader(new StringReader(json)))\n            {\n                JObject o = Load(reader);\n\n                if (reader.Read() && reader.TokenType != JsonToken.Comment)\n                    throw JsonReaderException.Create(reader, \"Additional text found in JSON string after parsing content.\");\n\n                return o;\n            }\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JObject\"/> from an object.\n        /// </summary>\n        /// <param name=\"o\">The object that will be used to create <see cref=\"JObject\"/>.</param>\n        /// <returns>A <see cref=\"JObject\"/> with the values of the specified object</returns>\n        public new static JObject FromObject(object o)\n        {\n            return FromObject(o, JsonSerializer.CreateDefault());\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JArray\"/> from an object.\n        /// </summary>\n        /// <param name=\"o\">The object that will be used to create <see cref=\"JArray\"/>.</param>\n        /// <param name=\"jsonSerializer\">The <see cref=\"JsonSerializer\"/> that will be used to read the object.</param>\n        /// <returns>A <see cref=\"JArray\"/> with the values of the specified object</returns>\n        public new static JObject FromObject(object o, JsonSerializer jsonSerializer)\n        {\n            JToken token = FromObjectInternal(o, jsonSerializer);\n\n            if (token != null && token.Type != JTokenType.Object)\n                throw new ArgumentException(\"Object serialized to {0}. JObject instance expected.\".FormatWith(CultureInfo.InvariantCulture, token.Type));\n\n            return (JObject)token;\n        }\n\n        /// <summary>\n        /// Writes this token to a <see cref=\"JsonWriter\"/>.\n        /// </summary>\n        /// <param name=\"writer\">A <see cref=\"JsonWriter\"/> into which this method will write.</param>\n        /// <param name=\"converters\">A collection of <see cref=\"JsonConverter\"/> which will be used when writing the token.</param>\n        public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)\n        {\n            writer.WriteStartObject();\n\n            for (int i = 0; i < _properties.Count; i++)\n            {\n                _properties[i].WriteTo(writer, converters);\n            }\n\n            writer.WriteEndObject();\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"Newtonsoft.Json.Linq.JToken\"/> with the specified property name.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        /// <returns>The <see cref=\"Newtonsoft.Json.Linq.JToken\"/> with the specified property name.</returns>\n        public JToken GetValue(string propertyName)\n        {\n            return GetValue(propertyName, StringComparison.Ordinal);\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"Newtonsoft.Json.Linq.JToken\"/> with the specified property name.\n        /// The exact property name will be searched for first and if no matching property is found then\n        /// the <see cref=\"StringComparison\"/> will be used to match a property.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        /// <param name=\"comparison\">One of the enumeration values that specifies how the strings will be compared.</param>\n        /// <returns>The <see cref=\"Newtonsoft.Json.Linq.JToken\"/> with the specified property name.</returns>\n        public JToken GetValue(string propertyName, StringComparison comparison)\n        {\n            if (propertyName == null)\n                return null;\n\n            // attempt to get value via dictionary first for performance\n            JProperty property = Property(propertyName);\n            if (property != null)\n                return property.Value;\n\n            // test above already uses this comparison so no need to repeat\n            if (comparison != StringComparison.Ordinal)\n            {\n                foreach (JProperty p in _properties)\n                {\n                    if (string.Equals(p.Name, propertyName, comparison))\n                        return p.Value;\n                }\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Tries to get the <see cref=\"Newtonsoft.Json.Linq.JToken\"/> with the specified property name.\n        /// The exact property name will be searched for first and if no matching property is found then\n        /// the <see cref=\"StringComparison\"/> will be used to match a property.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <param name=\"comparison\">One of the enumeration values that specifies how the strings will be compared.</param>\n        /// <returns>true if a value was successfully retrieved; otherwise, false.</returns>\n        public bool TryGetValue(string propertyName, StringComparison comparison, out JToken value)\n        {\n            value = GetValue(propertyName, comparison);\n            return (value != null);\n        }\n\n        #region IDictionary<string,JToken> Members\n        /// <summary>\n        /// Adds the specified property name.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        /// <param name=\"value\">The value.</param>\n        public void Add(string propertyName, JToken value)\n        {\n            Add(new JProperty(propertyName, value));\n        }\n\n        bool IDictionary<string, JToken>.ContainsKey(string key)\n        {\n            return _properties.Contains(key);\n        }\n\n        ICollection<string> IDictionary<string, JToken>.Keys\n        {\n            // todo: make order the collection returned match JObject order\n            get { return _properties.Keys; }\n        }\n\n        /// <summary>\n        /// Removes the property with the specified name.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        /// <returns>true if item was successfully removed; otherwise, false.</returns>\n        public bool Remove(string propertyName)\n        {\n            JProperty property = Property(propertyName);\n            if (property == null)\n                return false;\n\n            property.Remove();\n            return true;\n        }\n\n        /// <summary>\n        /// Tries the get value.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>true if a value was successfully retrieved; otherwise, false.</returns>\n        public bool TryGetValue(string propertyName, out JToken value)\n        {\n            JProperty property = Property(propertyName);\n            if (property == null)\n            {\n                value = null;\n                return false;\n            }\n\n            value = property.Value;\n            return true;\n        }\n\n        ICollection<JToken> IDictionary<string, JToken>.Values\n        {\n            get\n            {\n                // todo: need to wrap _properties.Values with a collection to get the JProperty value\n                throw new NotImplementedException();\n            }\n        }\n        #endregion\n\n        #region ICollection<KeyValuePair<string,JToken>> Members\n        void ICollection<KeyValuePair<string, JToken>>.Add(KeyValuePair<string, JToken> item)\n        {\n            Add(new JProperty(item.Key, item.Value));\n        }\n\n        void ICollection<KeyValuePair<string, JToken>>.Clear()\n        {\n            RemoveAll();\n        }\n\n        bool ICollection<KeyValuePair<string, JToken>>.Contains(KeyValuePair<string, JToken> item)\n        {\n            JProperty property = Property(item.Key);\n            if (property == null)\n                return false;\n\n            return (property.Value == item.Value);\n        }\n\n        void ICollection<KeyValuePair<string, JToken>>.CopyTo(KeyValuePair<string, JToken>[] array, int arrayIndex)\n        {\n            if (array == null)\n                throw new ArgumentNullException(\"array\");\n            if (arrayIndex < 0)\n                throw new ArgumentOutOfRangeException(\"arrayIndex\", \"arrayIndex is less than 0.\");\n            if (arrayIndex >= array.Length && arrayIndex != 0)\n                throw new ArgumentException(\"arrayIndex is equal to or greater than the length of array.\");\n            if (Count > array.Length - arrayIndex)\n                throw new ArgumentException(\"The number of elements in the source JObject is greater than the available space from arrayIndex to the end of the destination array.\");\n\n            int index = 0;\n            foreach (JProperty property in _properties)\n            {\n                array[arrayIndex + index] = new KeyValuePair<string, JToken>(property.Name, property.Value);\n                index++;\n            }\n        }\n\n        bool ICollection<KeyValuePair<string, JToken>>.IsReadOnly\n        {\n            get { return false; }\n        }\n\n        bool ICollection<KeyValuePair<string, JToken>>.Remove(KeyValuePair<string, JToken> item)\n        {\n            if (!((ICollection<KeyValuePair<string, JToken>>)this).Contains(item))\n                return false;\n\n            ((IDictionary<string, JToken>)this).Remove(item.Key);\n            return true;\n        }\n        #endregion\n\n        internal override int GetDeepHashCode()\n        {\n            return ContentsHashCode();\n        }\n\n        /// <summary>\n        /// Returns an enumerator that iterates through the collection.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n        /// </returns>\n        public IEnumerator<KeyValuePair<string, JToken>> GetEnumerator()\n        {\n            foreach (JProperty property in _properties)\n            {\n                yield return new KeyValuePair<string, JToken>(property.Name, property.Value);\n            }\n        }\n\n        /// <summary>\n        /// Raises the <see cref=\"PropertyChanged\"/> event with the provided arguments.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        protected virtual void OnPropertyChanged(string propertyName)\n        {\n            if (PropertyChanged != null)\n                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE || NET20)\n        /// <summary>\n        /// Raises the <see cref=\"PropertyChanging\"/> event with the provided arguments.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        protected virtual void OnPropertyChanging(string propertyName)\n        {\n            if (PropertyChanging != null)\n                PropertyChanging(this, new PropertyChangingEventArgs(propertyName));\n        }\n#endif\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        // include custom type descriptor on JObject rather than use a provider because the properties are specific to a type\n\n        #region ICustomTypeDescriptor\n        /// <summary>\n        /// Returns the properties for this instance of a component.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.ComponentModel.PropertyDescriptorCollection\"/> that represents the properties for this component instance.\n        /// </returns>\n        PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties()\n        {\n            return ((ICustomTypeDescriptor)this).GetProperties(null);\n        }\n\n        /// <summary>\n        /// Returns the properties for this instance of a component using the attribute array as a filter.\n        /// </summary>\n        /// <param name=\"attributes\">An array of type <see cref=\"T:System.Attribute\"/> that is used as a filter.</param>\n        /// <returns>\n        /// A <see cref=\"T:System.ComponentModel.PropertyDescriptorCollection\"/> that represents the filtered properties for this component instance.\n        /// </returns>\n        PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)\n        {\n            PropertyDescriptorCollection descriptors = new PropertyDescriptorCollection(null);\n\n            foreach (KeyValuePair<string, JToken> propertyValue in this)\n            {\n                descriptors.Add(new JPropertyDescriptor(propertyValue.Key));\n            }\n\n            return descriptors;\n        }\n\n        /// <summary>\n        /// Returns a collection of custom attributes for this instance of a component.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.ComponentModel.AttributeCollection\"/> containing the attributes for this object.\n        /// </returns>\n        AttributeCollection ICustomTypeDescriptor.GetAttributes()\n        {\n            return AttributeCollection.Empty;\n        }\n\n        /// <summary>\n        /// Returns the class name of this instance of a component.\n        /// </summary>\n        /// <returns>\n        /// The class name of the object, or null if the class does not have a name.\n        /// </returns>\n        string ICustomTypeDescriptor.GetClassName()\n        {\n            return null;\n        }\n\n        /// <summary>\n        /// Returns the name of this instance of a component.\n        /// </summary>\n        /// <returns>\n        /// The name of the object, or null if the object does not have a name.\n        /// </returns>\n        string ICustomTypeDescriptor.GetComponentName()\n        {\n            return null;\n        }\n\n        /// <summary>\n        /// Returns a type converter for this instance of a component.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.ComponentModel.TypeConverter\"/> that is the converter for this object, or null if there is no <see cref=\"T:System.ComponentModel.TypeConverter\"/> for this object.\n        /// </returns>\n        TypeConverter ICustomTypeDescriptor.GetConverter()\n        {\n            return new TypeConverter();\n        }\n\n        /// <summary>\n        /// Returns the default event for this instance of a component.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.ComponentModel.EventDescriptor\"/> that represents the default event for this object, or null if this object does not have events.\n        /// </returns>\n        EventDescriptor ICustomTypeDescriptor.GetDefaultEvent()\n        {\n            return null;\n        }\n\n        /// <summary>\n        /// Returns the default property for this instance of a component.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.ComponentModel.PropertyDescriptor\"/> that represents the default property for this object, or null if this object does not have properties.\n        /// </returns>\n        PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty()\n        {\n            return null;\n        }\n\n        /// <summary>\n        /// Returns an editor of the specified type for this instance of a component.\n        /// </summary>\n        /// <param name=\"editorBaseType\">A <see cref=\"T:System.Type\"/> that represents the editor for this object.</param>\n        /// <returns>\n        /// An <see cref=\"T:System.Object\"/> of the specified type that is the editor for this object, or null if the editor cannot be found.\n        /// </returns>\n        object ICustomTypeDescriptor.GetEditor(Type editorBaseType)\n        {\n            return null;\n        }\n\n        /// <summary>\n        /// Returns the events for this instance of a component using the specified attribute array as a filter.\n        /// </summary>\n        /// <param name=\"attributes\">An array of type <see cref=\"T:System.Attribute\"/> that is used as a filter.</param>\n        /// <returns>\n        /// An <see cref=\"T:System.ComponentModel.EventDescriptorCollection\"/> that represents the filtered events for this component instance.\n        /// </returns>\n        EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes)\n        {\n            return EventDescriptorCollection.Empty;\n        }\n\n        /// <summary>\n        /// Returns the events for this instance of a component.\n        /// </summary>\n        /// <returns>\n        /// An <see cref=\"T:System.ComponentModel.EventDescriptorCollection\"/> that represents the events for this component instance.\n        /// </returns>\n        EventDescriptorCollection ICustomTypeDescriptor.GetEvents()\n        {\n            return EventDescriptorCollection.Empty;\n        }\n\n        /// <summary>\n        /// Returns an object that contains the property described by the specified property descriptor.\n        /// </summary>\n        /// <param name=\"pd\">A <see cref=\"T:System.ComponentModel.PropertyDescriptor\"/> that represents the property whose owner is to be found.</param>\n        /// <returns>\n        /// An <see cref=\"T:System.Object\"/> that represents the owner of the specified property.\n        /// </returns>\n        object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd)\n        {\n            return null;\n        }\n        #endregion\n\n#endif\n\n#if !(NET35 || NET20 || PORTABLE40)\n        /// <summary>\n        /// Returns the <see cref=\"T:System.Dynamic.DynamicMetaObject\"/> responsible for binding operations performed on this object.\n        /// </summary>\n        /// <param name=\"parameter\">The expression tree representation of the runtime value.</param>\n        /// <returns>\n        /// The <see cref=\"T:System.Dynamic.DynamicMetaObject\"/> to bind this object.\n        /// </returns>\n        protected override DynamicMetaObject GetMetaObject(Expression parameter)\n        {\n            return new DynamicProxyMetaObject<JObject>(parameter, this, new JObjectDynamicProxy(), true);\n        }\n\n        private class JObjectDynamicProxy : DynamicProxy<JObject>\n        {\n            public override bool TryGetMember(JObject instance, GetMemberBinder binder, out object result)\n            {\n                // result can be null\n                result = instance[binder.Name];\n                return true;\n            }\n\n            public override bool TrySetMember(JObject instance, SetMemberBinder binder, object value)\n            {\n                JToken v = value as JToken;\n\n                // this can throw an error if value isn't a valid for a JValue\n                if (v == null)\n                    v = new JValue(value);\n\n                instance[binder.Name] = v;\n                return true;\n            }\n\n            public override IEnumerable<string> GetDynamicMemberNames(JObject instance)\n            {\n                return instance.Properties().Select(p => p.Name);\n            }\n        }\n#endif\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JProperty.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Utilities;\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a JSON property.\n    /// </summary>\n    public class JProperty : JContainer\n    {\n        private readonly List<JToken> _content = new List<JToken>();\n        private readonly string _name;\n\n        /// <summary>\n        /// Gets the container's children tokens.\n        /// </summary>\n        /// <value>The container's children tokens.</value>\n        protected override IList<JToken> ChildrenTokens\n        {\n            get { return _content; }\n        }\n\n        /// <summary>\n        /// Gets the property name.\n        /// </summary>\n        /// <value>The property name.</value>\n        public string Name\n        {\n            [DebuggerStepThrough]\n            get { return _name; }\n        }\n\n        /// <summary>\n        /// Gets or sets the property value.\n        /// </summary>\n        /// <value>The property value.</value>\n        public JToken Value\n        {\n            [DebuggerStepThrough]\n            get { return (_content.Count > 0) ? _content[0] : null; }\n            set\n            {\n                CheckReentrancy();\n\n                JToken newValue = value ?? new JValue((object)null);\n\n                if (_content.Count == 0)\n                {\n                    InsertItem(0, newValue, false);\n                }\n                else\n                {\n                    SetItem(0, newValue);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JProperty\"/> class from another <see cref=\"JProperty\"/> object.\n        /// </summary>\n        /// <param name=\"other\">A <see cref=\"JProperty\"/> object to copy from.</param>\n        public JProperty(JProperty other)\n            : base(other)\n        {\n            _name = other.Name;\n        }\n\n        internal override JToken GetItem(int index)\n        {\n            if (index != 0)\n                throw new ArgumentOutOfRangeException();\n\n            return Value;\n        }\n\n        internal override void SetItem(int index, JToken item)\n        {\n            if (index != 0)\n                throw new ArgumentOutOfRangeException();\n\n            if (IsTokenUnchanged(Value, item))\n                return;\n\n            if (Parent != null)\n                ((JObject)Parent).InternalPropertyChanging(this);\n\n            base.SetItem(0, item);\n\n            if (Parent != null)\n                ((JObject)Parent).InternalPropertyChanged(this);\n        }\n\n        internal override bool RemoveItem(JToken item)\n        {\n            throw new JsonException(\"Cannot add or remove items from {0}.\".FormatWith(CultureInfo.InvariantCulture, typeof(JProperty)));\n        }\n\n        internal override void RemoveItemAt(int index)\n        {\n            throw new JsonException(\"Cannot add or remove items from {0}.\".FormatWith(CultureInfo.InvariantCulture, typeof(JProperty)));\n        }\n\n        internal override void InsertItem(int index, JToken item, bool skipParentCheck)\n        {\n            // don't add comments to JProperty\n            if (item != null && item.Type == JTokenType.Comment)\n                return;\n\n            if (Value != null)\n                throw new JsonException(\"{0} cannot have multiple values.\".FormatWith(CultureInfo.InvariantCulture, typeof(JProperty)));\n\n            base.InsertItem(0, item, false);\n        }\n\n        internal override bool ContainsItem(JToken item)\n        {\n            return (Value == item);\n        }\n\n        internal override void ClearItems()\n        {\n            throw new JsonException(\"Cannot add or remove items from {0}.\".FormatWith(CultureInfo.InvariantCulture, typeof(JProperty)));\n        }\n\n        internal override bool DeepEquals(JToken node)\n        {\n            JProperty t = node as JProperty;\n            return (t != null && _name == t.Name && ContentsEqual(t));\n        }\n\n        internal override JToken CloneToken()\n        {\n            return new JProperty(this);\n        }\n\n        /// <summary>\n        /// Gets the node type for this <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <value>The type.</value>\n        public override JTokenType Type\n        {\n            [DebuggerStepThrough]\n            get { return JTokenType.Property; }\n        }\n\n        internal JProperty(string name)\n        {\n            // called from JTokenWriter\n            ValidationUtils.ArgumentNotNull(name, \"name\");\n\n            _name = name;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JProperty\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The property name.</param>\n        /// <param name=\"content\">The property content.</param>\n        public JProperty(string name, params object[] content)\n            : this(name, (object)content)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JProperty\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The property name.</param>\n        /// <param name=\"content\">The property content.</param>\n        public JProperty(string name, object content)\n        {\n            ValidationUtils.ArgumentNotNull(name, \"name\");\n\n            _name = name;\n\n            Value = IsMultiContent(content)\n                ? new JArray(content)\n                : CreateFromContent(content);\n        }\n\n        /// <summary>\n        /// Writes this token to a <see cref=\"JsonWriter\"/>.\n        /// </summary>\n        /// <param name=\"writer\">A <see cref=\"JsonWriter\"/> into which this method will write.</param>\n        /// <param name=\"converters\">A collection of <see cref=\"JsonConverter\"/> which will be used when writing the token.</param>\n        public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)\n        {\n            writer.WritePropertyName(_name);\n\n            JToken value = Value;\n            if (value != null)\n                value.WriteTo(writer, converters);\n            else\n                writer.WriteNull();\n        }\n\n        internal override int GetDeepHashCode()\n        {\n            return _name.GetHashCode() ^ ((Value != null) ? Value.GetDeepHashCode() : 0);\n        }\n\n        /// <summary>\n        /// Loads an <see cref=\"JProperty\"/> from a <see cref=\"JsonReader\"/>. \n        /// </summary>\n        /// <param name=\"reader\">A <see cref=\"JsonReader\"/> that will be read for the content of the <see cref=\"JProperty\"/>.</param>\n        /// <returns>A <see cref=\"JProperty\"/> that contains the JSON that was read from the specified <see cref=\"JsonReader\"/>.</returns>\n        public new static JProperty Load(JsonReader reader)\n        {\n            if (reader.TokenType == JsonToken.None)\n            {\n                if (!reader.Read())\n                    throw JsonReaderException.Create(reader, \"Error reading JProperty from JsonReader.\");\n            }\n\n            while (reader.TokenType == JsonToken.Comment)\n            {\n                reader.Read();\n            }\n\n            if (reader.TokenType != JsonToken.PropertyName)\n                throw JsonReaderException.Create(reader, \"Error reading JProperty from JsonReader. Current JsonReader item is not a property: {0}\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n\n            JProperty p = new JProperty((string)reader.Value);\n            p.SetLineInfo(reader as IJsonLineInfo);\n\n            p.ReadTokenFrom(reader);\n\n            return p;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JPropertyDescriptor.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\nusing System;\nusing System.ComponentModel;\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a view of a <see cref=\"JProperty\"/>.\n    /// </summary>\n    public class JPropertyDescriptor : PropertyDescriptor\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JPropertyDescriptor\"/> class.\n        /// </summary>\n        /// <param name=\"name\">The name.</param>\n        public JPropertyDescriptor(string name)\n            : base(name, null)\n        {\n        }\n\n        private static JObject CastInstance(object instance)\n        {\n            return (JObject)instance;\n        }\n\n        /// <summary>\n        /// When overridden in a derived class, returns whether resetting an object changes its value.\n        /// </summary>\n        /// <returns>\n        /// true if resetting the component changes its value; otherwise, false.\n        /// </returns>\n        /// <param name=\"component\">The component to test for reset capability. \n        ///                 </param>\n        public override bool CanResetValue(object component)\n        {\n            return false;\n        }\n\n        /// <summary>\n        /// When overridden in a derived class, gets the current value of the property on a component.\n        /// </summary>\n        /// <returns>\n        /// The value of a property for a given component.\n        /// </returns>\n        /// <param name=\"component\">The component with the property for which to retrieve the value. \n        ///                 </param>\n        public override object GetValue(object component)\n        {\n            JToken token = CastInstance(component)[Name];\n\n            return token;\n        }\n\n        /// <summary>\n        /// When overridden in a derived class, resets the value for this property of the component to the default value.\n        /// </summary>\n        /// <param name=\"component\">The component with the property value that is to be reset to the default value. \n        ///                 </param>\n        public override void ResetValue(object component)\n        {\n        }\n\n        /// <summary>\n        /// When overridden in a derived class, sets the value of the component to a different value.\n        /// </summary>\n        /// <param name=\"component\">The component with the property value that is to be set. \n        ///                 </param><param name=\"value\">The new value. \n        ///                 </param>\n        public override void SetValue(object component, object value)\n        {\n            JToken token = (value is JToken) ? (JToken)value : new JValue(value);\n\n            CastInstance(component)[Name] = token;\n        }\n\n        /// <summary>\n        /// When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted.\n        /// </summary>\n        /// <returns>\n        /// true if the property should be persisted; otherwise, false.\n        /// </returns>\n        /// <param name=\"component\">The component with the property to be examined for persistence. \n        ///                 </param>\n        public override bool ShouldSerializeValue(object component)\n        {\n            return false;\n        }\n\n        /// <summary>\n        /// When overridden in a derived class, gets the type of the component this property is bound to.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Type\"/> that represents the type of component this property is bound to. When the <see cref=\"M:System.ComponentModel.PropertyDescriptor.GetValue(System.Object)\"/> or <see cref=\"M:System.ComponentModel.PropertyDescriptor.SetValue(System.Object,System.Object)\"/> methods are invoked, the object specified might be an instance of this type.\n        /// </returns>\n        public override Type ComponentType\n        {\n            get { return typeof(JObject); }\n        }\n\n        /// <summary>\n        /// When overridden in a derived class, gets a value indicating whether this property is read-only.\n        /// </summary>\n        /// <returns>\n        /// true if the property is read-only; otherwise, false.\n        /// </returns>\n        public override bool IsReadOnly\n        {\n            get { return false; }\n        }\n\n        /// <summary>\n        /// When overridden in a derived class, gets the type of the property.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.Type\"/> that represents the type of the property.\n        /// </returns>\n        public override Type PropertyType\n        {\n            get { return typeof(object); }\n        }\n\n        /// <summary>\n        /// Gets the hash code for the name of the member.\n        /// </summary>\n        /// <value></value>\n        /// <returns>\n        /// The hash code for the name of the member.\n        /// </returns>\n        protected override int NameHashCode\n        {\n            get\n            {\n                // override property to fix up an error in its documentation\n                int nameHashCode = base.NameHashCode;\n                return nameHashCode;\n            }\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Linq/JPropertyKeyedCollection.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nnamespace Newtonsoft.Json.Linq\n{\n    internal class JPropertyKeyedCollection : Collection<JToken>\n    {\n        private static readonly IEqualityComparer<string> Comparer = StringComparer.Ordinal;\n\n        private Dictionary<string, JToken> _dictionary;\n\n        private void AddKey(string key, JToken item)\n        {\n            EnsureDictionary();\n            _dictionary[key] = item;\n        }\n\n        protected void ChangeItemKey(JToken item, string newKey)\n        {\n            if (!ContainsItem(item))\n                throw new ArgumentException(\"The specified item does not exist in this KeyedCollection.\");\n\n            string keyForItem = GetKeyForItem(item);\n            if (!Comparer.Equals(keyForItem, newKey))\n            {\n                if (newKey != null)\n                    AddKey(newKey, item);\n\n                if (keyForItem != null)\n                    RemoveKey(keyForItem);\n            }\n        }\n\n        protected override void ClearItems()\n        {\n            base.ClearItems();\n\n            if (_dictionary != null)\n                _dictionary.Clear();\n        }\n\n        public bool Contains(string key)\n        {\n            if (key == null)\n                throw new ArgumentNullException(\"key\");\n\n            if (_dictionary != null)\n                return _dictionary.ContainsKey(key);\n\n            return false;\n        }\n\n        private bool ContainsItem(JToken item)\n        {\n            if (_dictionary == null)\n                return false;\n\n            string key = GetKeyForItem(item);\n            JToken value;\n            return _dictionary.TryGetValue(key, out value);\n        }\n\n        private void EnsureDictionary()\n        {\n            if (_dictionary == null)\n                _dictionary = new Dictionary<string, JToken>(Comparer);\n        }\n\n        private string GetKeyForItem(JToken item)\n        {\n            return ((JProperty)item).Name;\n        }\n\n        protected override void InsertItem(int index, JToken item)\n        {\n            AddKey(GetKeyForItem(item), item);\n            base.InsertItem(index, item);\n        }\n\n        public bool Remove(string key)\n        {\n            if (key == null)\n                throw new ArgumentNullException(\"key\");\n\n            if (_dictionary != null)\n                return _dictionary.ContainsKey(key) && Remove(_dictionary[key]);\n\n            return false;\n        }\n\n        protected override void RemoveItem(int index)\n        {\n            string keyForItem = GetKeyForItem(Items[index]);\n            RemoveKey(keyForItem);\n            base.RemoveItem(index);\n        }\n\n        private void RemoveKey(string key)\n        {\n            if (_dictionary != null)\n                _dictionary.Remove(key);\n        }\n\n        protected override void SetItem(int index, JToken item)\n        {\n            string keyForItem = GetKeyForItem(item);\n            string keyAtIndex = GetKeyForItem(Items[index]);\n\n            if (Comparer.Equals(keyAtIndex, keyForItem))\n            {\n                if (_dictionary != null)\n                    _dictionary[keyForItem] = item;\n            }\n            else\n            {\n                AddKey(keyForItem, item);\n\n                if (keyAtIndex != null)\n                    RemoveKey(keyAtIndex);\n            }\n            base.SetItem(index, item);\n        }\n\n        public JToken this[string key]\n        {\n            get\n            {\n                if (key == null)\n                    throw new ArgumentNullException(\"key\");\n\n                if (_dictionary != null)\n                    return _dictionary[key];\n\n                throw new KeyNotFoundException();\n            }\n        }\n\n        public bool TryGetValue(string key, out JToken value)\n        {\n            if (_dictionary == null)\n            {\n                value = null;\n                return false;\n            }\n\n            return _dictionary.TryGetValue(key, out value);\n        }\n\n        public ICollection<string> Keys\n        {\n            get\n            {\n                EnsureDictionary();\n                return _dictionary.Keys;\n            }\n        }\n\n        public ICollection<JToken> Values\n        {\n            get\n            {\n                EnsureDictionary();\n                return _dictionary.Values;\n            }\n        }\n\n        public bool Compare(JPropertyKeyedCollection other)\n        {\n            if (this == other)\n                return true;\n\n            // dictionaries in JavaScript aren't ordered\n            // ignore order when comparing properties\n            Dictionary<string, JToken> d1 = _dictionary;\n            Dictionary<string, JToken> d2 = other._dictionary;\n\n            if (d1 == null && d2 == null)\n                return true;\n\n            if (d1 == null)\n                return (d2.Count == 0);\n\n            if (d2 == null)\n                return (d1.Count == 0);\n\n            if (d1.Count != d2.Count)\n                return false;\n\n            foreach (KeyValuePair<string, JToken> keyAndProperty in d1)\n            {\n                JToken secondValue;\n                if (!d2.TryGetValue(keyAndProperty.Key, out secondValue))\n                    return false;\n\n                JProperty p1 = (JProperty)keyAndProperty.Value;\n                JProperty p2 = (JProperty)secondValue;\n\n                if (!p1.Value.DeepEquals(p2.Value))\n                    return false;\n            }\n\n            return true;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JRaw.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Globalization;\nusing System.IO;\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a raw JSON string.\n    /// </summary>\n    public class JRaw : JValue\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JRaw\"/> class from another <see cref=\"JRaw\"/> object.\n        /// </summary>\n        /// <param name=\"other\">A <see cref=\"JRaw\"/> object to copy from.</param>\n        public JRaw(JRaw other)\n            : base(other)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JRaw\"/> class.\n        /// </summary>\n        /// <param name=\"rawJson\">The raw json.</param>\n        public JRaw(object rawJson)\n            : base(rawJson, JTokenType.Raw)\n        {\n        }\n\n        /// <summary>\n        /// Creates an instance of <see cref=\"JRaw\"/> with the content of the reader's current token.\n        /// </summary>\n        /// <param name=\"reader\">The reader.</param>\n        /// <returns>An instance of <see cref=\"JRaw\"/> with the content of the reader's current token.</returns>\n        public static JRaw Create(JsonReader reader)\n        {\n            using (StringWriter sw = new StringWriter(CultureInfo.InvariantCulture))\n            using (JsonTextWriter jsonWriter = new JsonTextWriter(sw))\n            {\n                jsonWriter.WriteToken(reader);\n\n                return new JRaw(sw.ToString());\n            }\n        }\n\n        internal override JToken CloneToken()\n        {\n            return new JRaw(this);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JToken.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Linq.JsonPath;\n#if !(NET35 || NET20 || PORTABLE40)\nusing System.Dynamic;\nusing System.Linq.Expressions;\n#endif\nusing System.IO;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\nusing System.Numerics;\n#endif\nusing System.Text;\nusing Newtonsoft.Json.Utilities;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Collections;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents an abstract JSON token.\n    /// </summary>\n    public abstract class JToken : IJEnumerable<JToken>, IJsonLineInfo\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        , ICloneable\n#endif\n#if !(NET35 || NET20 || PORTABLE40)\n        , IDynamicMetaObjectProvider\n#endif\n    {\n        private JContainer _parent;\n        private JToken _previous;\n        private JToken _next;\n        private static JTokenEqualityComparer _equalityComparer;\n\n        private int? _lineNumber;\n        private int? _linePosition;\n\n        private static readonly JTokenType[] BooleanTypes = new[] { JTokenType.Integer, JTokenType.Float, JTokenType.String, JTokenType.Comment, JTokenType.Raw, JTokenType.Boolean };\n        private static readonly JTokenType[] NumberTypes = new[] { JTokenType.Integer, JTokenType.Float, JTokenType.String, JTokenType.Comment, JTokenType.Raw, JTokenType.Boolean };\n        private static readonly JTokenType[] BigIntegerTypes = new[] { JTokenType.Integer, JTokenType.Float, JTokenType.String, JTokenType.Comment, JTokenType.Raw, JTokenType.Boolean, JTokenType.Bytes };\n        private static readonly JTokenType[] StringTypes = new[] { JTokenType.Date, JTokenType.Integer, JTokenType.Float, JTokenType.String, JTokenType.Comment, JTokenType.Raw, JTokenType.Boolean, JTokenType.Bytes, JTokenType.Guid, JTokenType.TimeSpan, JTokenType.Uri };\n        private static readonly JTokenType[] GuidTypes = new[] { JTokenType.String, JTokenType.Comment, JTokenType.Raw, JTokenType.Guid, JTokenType.Bytes };\n        private static readonly JTokenType[] TimeSpanTypes = new[] { JTokenType.String, JTokenType.Comment, JTokenType.Raw, JTokenType.TimeSpan };\n        private static readonly JTokenType[] UriTypes = new[] { JTokenType.String, JTokenType.Comment, JTokenType.Raw, JTokenType.Uri };\n        private static readonly JTokenType[] CharTypes = new[] { JTokenType.Integer, JTokenType.Float, JTokenType.String, JTokenType.Comment, JTokenType.Raw };\n        private static readonly JTokenType[] DateTimeTypes = new[] { JTokenType.Date, JTokenType.String, JTokenType.Comment, JTokenType.Raw };\n        private static readonly JTokenType[] BytesTypes = new[] { JTokenType.Bytes, JTokenType.String, JTokenType.Comment, JTokenType.Raw, JTokenType.Integer };\n\n        /// <summary>\n        /// Gets a comparer that can compare two tokens for value equality.\n        /// </summary>\n        /// <value>A <see cref=\"JTokenEqualityComparer\"/> that can compare two nodes for value equality.</value>\n        public static JTokenEqualityComparer EqualityComparer\n        {\n            get\n            {\n                if (_equalityComparer == null)\n                    _equalityComparer = new JTokenEqualityComparer();\n\n                return _equalityComparer;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the parent.\n        /// </summary>\n        /// <value>The parent.</value>\n        public JContainer Parent\n        {\n            [DebuggerStepThrough]\n            get { return _parent; }\n            internal set { _parent = value; }\n        }\n\n        /// <summary>\n        /// Gets the root <see cref=\"JToken\"/> of this <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <value>The root <see cref=\"JToken\"/> of this <see cref=\"JToken\"/>.</value>\n        public JToken Root\n        {\n            get\n            {\n                JContainer parent = Parent;\n                if (parent == null)\n                    return this;\n\n                while (parent.Parent != null)\n                {\n                    parent = parent.Parent;\n                }\n\n                return parent;\n            }\n        }\n\n        internal abstract JToken CloneToken();\n        internal abstract bool DeepEquals(JToken node);\n\n        /// <summary>\n        /// Gets the node type for this <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <value>The type.</value>\n        public abstract JTokenType Type { get; }\n\n        /// <summary>\n        /// Gets a value indicating whether this token has child tokens.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if this token has child values; otherwise, <c>false</c>.\n        /// </value>\n        public abstract bool HasValues { get; }\n\n        /// <summary>\n        /// Compares the values of two tokens, including the values of all descendant tokens.\n        /// </summary>\n        /// <param name=\"t1\">The first <see cref=\"JToken\"/> to compare.</param>\n        /// <param name=\"t2\">The second <see cref=\"JToken\"/> to compare.</param>\n        /// <returns>true if the tokens are equal; otherwise false.</returns>\n        public static bool DeepEquals(JToken t1, JToken t2)\n        {\n            return (t1 == t2 || (t1 != null && t2 != null && t1.DeepEquals(t2)));\n        }\n\n        /// <summary>\n        /// Gets the next sibling token of this node.\n        /// </summary>\n        /// <value>The <see cref=\"JToken\"/> that contains the next sibling token.</value>\n        public JToken Next\n        {\n            get { return _next; }\n            internal set { _next = value; }\n        }\n\n        /// <summary>\n        /// Gets the previous sibling token of this node.\n        /// </summary>\n        /// <value>The <see cref=\"JToken\"/> that contains the previous sibling token.</value>\n        public JToken Previous\n        {\n            get { return _previous; }\n            internal set { _previous = value; }\n        }\n\n        /// <summary>\n        /// Gets the path of the JSON token. \n        /// </summary>\n        public string Path\n        {\n            get\n            {\n                if (Parent == null)\n                    return string.Empty;\n\n                IList<JToken> ancestors = Ancestors().Reverse().ToList();\n                ancestors.Add(this);\n\n                StringBuilder sb = new StringBuilder();\n                for (int i = 0; i < ancestors.Count; i++)\n                {\n                    JToken current = ancestors[i];\n                    JToken next = null;\n                    if (i + 1 < ancestors.Count)\n                        next = ancestors[i + 1];\n                    else if (ancestors[i].Type == JTokenType.Property)\n                        next = ancestors[i];\n\n                    if (next != null)\n                    {\n                        switch (current.Type)\n                        {\n                            case JTokenType.Property:\n                                JProperty property = (JProperty)current;\n\n                                if (sb.Length > 0)\n                                    sb.Append(\".\");\n\n                                sb.Append(property.Name);\n                                break;\n                            case JTokenType.Array:\n                            case JTokenType.Constructor:\n                                int index = ((IList<JToken>)current).IndexOf(next);\n\n                                sb.Append(\"[\");\n                                sb.Append(index);\n                                sb.Append(\"]\");\n                                break;\n                        }\n                    }\n                }\n\n                return sb.ToString();\n            }\n        }\n\n        internal JToken()\n        {\n        }\n\n        /// <summary>\n        /// Adds the specified content immediately after this token.\n        /// </summary>\n        /// <param name=\"content\">A content object that contains simple content or a collection of content objects to be added after this token.</param>\n        public void AddAfterSelf(object content)\n        {\n            if (_parent == null)\n                throw new InvalidOperationException(\"The parent is missing.\");\n\n            int index = _parent.IndexOfItem(this);\n            _parent.AddInternal(index + 1, content, false);\n        }\n\n        /// <summary>\n        /// Adds the specified content immediately before this token.\n        /// </summary>\n        /// <param name=\"content\">A content object that contains simple content or a collection of content objects to be added before this token.</param>\n        public void AddBeforeSelf(object content)\n        {\n            if (_parent == null)\n                throw new InvalidOperationException(\"The parent is missing.\");\n\n            int index = _parent.IndexOfItem(this);\n            _parent.AddInternal(index, content, false);\n        }\n\n        /// <summary>\n        /// Returns a collection of the ancestor tokens of this token.\n        /// </summary>\n        /// <returns>A collection of the ancestor tokens of this token.</returns>\n        public IEnumerable<JToken> Ancestors()\n        {\n            for (JToken parent = Parent; parent != null; parent = parent.Parent)\n            {\n                yield return parent;\n            }\n        }\n\n        /// <summary>\n        /// Returns a collection of the sibling tokens after this token, in document order.\n        /// </summary>\n        /// <returns>A collection of the sibling tokens after this tokens, in document order.</returns>\n        public IEnumerable<JToken> AfterSelf()\n        {\n            if (Parent == null)\n                yield break;\n\n            for (JToken o = Next; o != null; o = o.Next)\n            {\n                yield return o;\n            }\n        }\n\n        /// <summary>\n        /// Returns a collection of the sibling tokens before this token, in document order.\n        /// </summary>\n        /// <returns>A collection of the sibling tokens before this token, in document order.</returns>\n        public IEnumerable<JToken> BeforeSelf()\n        {\n            for (JToken o = Parent.First; o != this; o = o.Next)\n            {\n                yield return o;\n            }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"JToken\"/> with the specified key.\n        /// </summary>\n        /// <value>The <see cref=\"JToken\"/> with the specified key.</value>\n        public virtual JToken this[object key]\n        {\n            get { throw new InvalidOperationException(\"Cannot access child value on {0}.\".FormatWith(CultureInfo.InvariantCulture, GetType())); }\n            set { throw new InvalidOperationException(\"Cannot set child value on {0}.\".FormatWith(CultureInfo.InvariantCulture, GetType())); }\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"JToken\"/> with the specified key converted to the specified type.\n        /// </summary>\n        /// <typeparam name=\"T\">The type to convert the token to.</typeparam>\n        /// <param name=\"key\">The token key.</param>\n        /// <returns>The converted token value.</returns>\n        public virtual T Value<T>(object key)\n        {\n            JToken token = this[key];\n\n            // null check to fix MonoTouch issue - https://github.com/dolbz/Newtonsoft.Json/commit/a24e3062846b30ee505f3271ac08862bb471b822\n            return token == null ? default(T) : Extensions.Convert<JToken, T>(token);\n        }\n\n        /// <summary>\n        /// Get the first child token of this token.\n        /// </summary>\n        /// <value>A <see cref=\"JToken\"/> containing the first child token of the <see cref=\"JToken\"/>.</value>\n        public virtual JToken First\n        {\n            get { throw new InvalidOperationException(\"Cannot access child value on {0}.\".FormatWith(CultureInfo.InvariantCulture, GetType())); }\n        }\n\n        /// <summary>\n        /// Get the last child token of this token.\n        /// </summary>\n        /// <value>A <see cref=\"JToken\"/> containing the last child token of the <see cref=\"JToken\"/>.</value>\n        public virtual JToken Last\n        {\n            get { throw new InvalidOperationException(\"Cannot access child value on {0}.\".FormatWith(CultureInfo.InvariantCulture, GetType())); }\n        }\n\n        /// <summary>\n        /// Returns a collection of the child tokens of this token, in document order.\n        /// </summary>\n        /// <returns>An <see cref=\"IEnumerable{T}\"/> of <see cref=\"JToken\"/> containing the child tokens of this <see cref=\"JToken\"/>, in document order.</returns>\n        public virtual JEnumerable<JToken> Children()\n        {\n            return JEnumerable<JToken>.Empty;\n        }\n\n        /// <summary>\n        /// Returns a collection of the child tokens of this token, in document order, filtered by the specified type.\n        /// </summary>\n        /// <typeparam name=\"T\">The type to filter the child tokens on.</typeparam>\n        /// <returns>A <see cref=\"JEnumerable{T}\"/> containing the child tokens of this <see cref=\"JToken\"/>, in document order.</returns>\n        public JEnumerable<T> Children<T>() where T : JToken\n        {\n            return new JEnumerable<T>(Children().OfType<T>());\n        }\n\n        /// <summary>\n        /// Returns a collection of the child values of this token, in document order.\n        /// </summary>\n        /// <typeparam name=\"T\">The type to convert the values to.</typeparam>\n        /// <returns>A <see cref=\"IEnumerable{T}\"/> containing the child values of this <see cref=\"JToken\"/>, in document order.</returns>\n        public virtual IEnumerable<T> Values<T>()\n        {\n            throw new InvalidOperationException(\"Cannot access child value on {0}.\".FormatWith(CultureInfo.InvariantCulture, GetType()));\n        }\n\n        /// <summary>\n        /// Removes this token from its parent.\n        /// </summary>\n        public void Remove()\n        {\n            if (_parent == null)\n                throw new InvalidOperationException(\"The parent is missing.\");\n\n            _parent.RemoveItem(this);\n        }\n\n        /// <summary>\n        /// Replaces this token with the specified token.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public void Replace(JToken value)\n        {\n            if (_parent == null)\n                throw new InvalidOperationException(\"The parent is missing.\");\n\n            _parent.ReplaceItem(this, value);\n        }\n\n        /// <summary>\n        /// Writes this token to a <see cref=\"JsonWriter\"/>.\n        /// </summary>\n        /// <param name=\"writer\">A <see cref=\"JsonWriter\"/> into which this method will write.</param>\n        /// <param name=\"converters\">A collection of <see cref=\"JsonConverter\"/> which will be used when writing the token.</param>\n        public abstract void WriteTo(JsonWriter writer, params JsonConverter[] converters);\n\n        /// <summary>\n        /// Returns the indented JSON for this token.\n        /// </summary>\n        /// <returns>\n        /// The indented JSON for this token.\n        /// </returns>\n        public override string ToString()\n        {\n            return ToString(Formatting.Indented);\n        }\n\n        /// <summary>\n        /// Returns the JSON for this token using the given formatting and converters.\n        /// </summary>\n        /// <param name=\"formatting\">Indicates how the output is formatted.</param>\n        /// <param name=\"converters\">A collection of <see cref=\"JsonConverter\"/> which will be used when writing the token.</param>\n        /// <returns>The JSON for this token using the given formatting and converters.</returns>\n        public string ToString(Formatting formatting, params JsonConverter[] converters)\n        {\n            using (StringWriter sw = new StringWriter(CultureInfo.InvariantCulture))\n            {\n                JsonTextWriter jw = new JsonTextWriter(sw);\n                jw.Formatting = formatting;\n\n                WriteTo(jw, converters);\n\n                return sw.ToString();\n            }\n        }\n\n        private static JValue EnsureValue(JToken value)\n        {\n            if (value == null)\n                throw new ArgumentNullException(\"value\");\n\n            if (value is JProperty)\n                value = ((JProperty)value).Value;\n\n            JValue v = value as JValue;\n\n            return v;\n        }\n\n        private static string GetType(JToken token)\n        {\n            ValidationUtils.ArgumentNotNull(token, \"token\");\n\n            if (token is JProperty)\n                token = ((JProperty)token).Value;\n\n            return token.Type.ToString();\n        }\n\n        private static bool ValidateToken(JToken o, JTokenType[] validTypes, bool nullable)\n        {\n            return (Array.IndexOf(validTypes, o.Type) != -1) || (nullable && (o.Type == JTokenType.Null || o.Type == JTokenType.Undefined));\n        }\n\n        #region Cast from operators\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Boolean\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator bool(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, BooleanTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to Boolean.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return Convert.ToBoolean((int)(BigInteger)v.Value);\n#endif\n\n            return Convert.ToBoolean(v.Value, CultureInfo.InvariantCulture);\n        }\n\n#if !NET20\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.DateTimeOffset\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator DateTimeOffset(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, DateTimeTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to DateTimeOffset.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n            if (v.Value is DateTimeOffset)\n                return (DateTimeOffset)v.Value;\n            if (v.Value is string)\n                return DateTimeOffset.Parse((string)v.Value, CultureInfo.InvariantCulture);\n            return new DateTimeOffset(Convert.ToDateTime(v.Value, CultureInfo.InvariantCulture));\n        }\n#endif\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{Boolean}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator bool?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, BooleanTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to Boolean.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return Convert.ToBoolean((int)(BigInteger)v.Value);\n#endif\n\n            return (v.Value != null) ? (bool?)Convert.ToBoolean(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Int64\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator long(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to Int64.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (long)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToInt64(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{DateTime}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator DateTime?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, DateTimeTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to DateTime.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !NET20\n            if (v.Value is DateTimeOffset)\n                return ((DateTimeOffset)v.Value).DateTime;\n#endif\n\n            return (v.Value != null) ? (DateTime?)Convert.ToDateTime(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n#if !NET20\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{DateTimeOffset}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator DateTimeOffset?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, DateTimeTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to DateTimeOffset.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n            if (v.Value == null)\n                return null;\n            if (v.Value is DateTimeOffset)\n                return (DateTimeOffset?)v.Value;\n            if (v.Value is string)\n                return DateTimeOffset.Parse((string)v.Value, CultureInfo.InvariantCulture);\n            return new DateTimeOffset(Convert.ToDateTime(v.Value, CultureInfo.InvariantCulture));\n        }\n#endif\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{Decimal}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator decimal?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to Decimal.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (decimal?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (decimal?)Convert.ToDecimal(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{Double}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator double?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to Double.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (double?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (double?)Convert.ToDouble(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{Char}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator char?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, CharTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to Char.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (char?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (char?)Convert.ToChar(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Int32\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator int(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to Int32.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (int)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToInt32(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Int16\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator short(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to Int16.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (short)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToInt16(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.UInt16\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        [CLSCompliant(false)]\n        public static explicit operator ushort(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to UInt16.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (ushort)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToUInt16(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Char\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        [CLSCompliant(false)]\n        public static explicit operator char(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, CharTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to Char.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (char)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToChar(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Byte\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator byte(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to Byte.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (byte)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToByte(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.SByte\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        [CLSCompliant(false)]\n        public static explicit operator sbyte(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to SByte.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (sbyte)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToSByte(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{Int32}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator int?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to Int32.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (int?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (int?)Convert.ToInt32(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{Int16}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator short?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to Int16.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (short?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (short?)Convert.ToInt16(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{UInt16}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        [CLSCompliant(false)]\n        public static explicit operator ushort?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to UInt16.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (ushort?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (ushort?)Convert.ToUInt16(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{Byte}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator byte?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to Byte.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (byte?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (byte?)Convert.ToByte(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{SByte}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        [CLSCompliant(false)]\n        public static explicit operator sbyte?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to SByte.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (sbyte?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (sbyte?)Convert.ToByte(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.DateTime\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator DateTime(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, DateTimeTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to DateTime.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !NET20\n            if (v.Value is DateTimeOffset)\n                return ((DateTimeOffset)v.Value).DateTime;\n#endif\n\n            return Convert.ToDateTime(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{Int64}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator long?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to Int64.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (long?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (long?)Convert.ToInt64(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{Single}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator float?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to Single.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (float?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (float?)Convert.ToSingle(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Decimal\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator decimal(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to Decimal.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (decimal)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToDecimal(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{UInt32}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        [CLSCompliant(false)]\n        public static explicit operator uint?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to UInt32.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (uint?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (uint?)Convert.ToUInt32(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"Nullable{UInt64}\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        [CLSCompliant(false)]\n        public static explicit operator ulong?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to UInt64.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (ulong?)(BigInteger)v.Value;\n#endif\n\n            return (v.Value != null) ? (ulong?)Convert.ToUInt64(v.Value, CultureInfo.InvariantCulture) : null;\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Double\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator double(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to Double.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (double)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToDouble(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Single\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator float(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to Single.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (float)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToSingle(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.String\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator string(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, StringTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to String.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n            if (v.Value == null)\n                return null;\n            if (v.Value is byte[])\n                return Convert.ToBase64String((byte[])v.Value);\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return ((BigInteger)v.Value).ToString(CultureInfo.InvariantCulture);\n#endif\n\n            return Convert.ToString(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.UInt32\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        [CLSCompliant(false)]\n        public static explicit operator uint(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to UInt32.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (uint)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToUInt32(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.UInt64\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        [CLSCompliant(false)]\n        public static explicit operator ulong(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, NumberTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to UInt64.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return (ulong)(BigInteger)v.Value;\n#endif\n\n            return Convert.ToUInt64(v.Value, CultureInfo.InvariantCulture);\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"T:System.Byte[]\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator byte[](JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, BytesTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to byte array.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n            if (v.Value is string)\n                return Convert.FromBase64String(Convert.ToString(v.Value, CultureInfo.InvariantCulture));\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (v.Value is BigInteger)\n                return ((BigInteger)v.Value).ToByteArray();\n#endif\n\n            if (v.Value is byte[])\n                return (byte[])v.Value;\n\n            throw new ArgumentException(\"Can not convert {0} to byte array.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Guid\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator Guid(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, GuidTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to Guid.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n            if (v.Value is byte[])\n                return new Guid((byte[])v.Value);\n\n            return (v.Value is Guid) ? (Guid)v.Value : new Guid(Convert.ToString(v.Value, CultureInfo.InvariantCulture));\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Guid\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator Guid?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, GuidTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to Guid.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n            if (v.Value == null)\n                return null;\n\n            if (v.Value is byte[])\n                return new Guid((byte[])v.Value);\n\n            return (v.Value is Guid) ? (Guid)v.Value : new Guid(Convert.ToString(v.Value, CultureInfo.InvariantCulture));\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.TimeSpan\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator TimeSpan(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, TimeSpanTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to TimeSpan.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n            return (v.Value is TimeSpan) ? (TimeSpan)v.Value : ConvertUtils.ParseTimeSpan(Convert.ToString(v.Value, CultureInfo.InvariantCulture));\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.TimeSpan\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator TimeSpan?(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, TimeSpanTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to TimeSpan.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n            if (v.Value == null)\n                return null;\n\n            return (v.Value is TimeSpan) ? (TimeSpan)v.Value : ConvertUtils.ParseTimeSpan(Convert.ToString(v.Value, CultureInfo.InvariantCulture));\n        }\n\n        /// <summary>\n        /// Performs an explicit conversion from <see cref=\"Newtonsoft.Json.Linq.JToken\"/> to <see cref=\"System.Uri\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>The result of the conversion.</returns>\n        public static explicit operator Uri(JToken value)\n        {\n            if (value == null)\n                return null;\n\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, UriTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to Uri.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n            if (v.Value == null)\n                return null;\n\n            return (v.Value is Uri) ? (Uri)v.Value : new Uri(Convert.ToString(v.Value, CultureInfo.InvariantCulture));\n        }\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n        private static BigInteger ToBigInteger(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, BigIntegerTypes, false))\n                throw new ArgumentException(\"Can not convert {0} to BigInteger.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n            return ConvertUtils.ToBigInteger(v.Value);\n        }\n\n        private static BigInteger? ToBigIntegerNullable(JToken value)\n        {\n            JValue v = EnsureValue(value);\n            if (v == null || !ValidateToken(v, BigIntegerTypes, true))\n                throw new ArgumentException(\"Can not convert {0} to BigInteger.\".FormatWith(CultureInfo.InvariantCulture, GetType(value)));\n\n            if (v.Value == null)\n                return null;\n\n            return ConvertUtils.ToBigInteger(v.Value);\n        }\n#endif\n        #endregion\n\n        #region Cast to operators\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Boolean\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(bool value)\n        {\n            return new JValue(value);\n        }\n\n#if !NET20\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"DateTimeOffset\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(DateTimeOffset value)\n        {\n            return new JValue(value);\n        }\n#endif\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Byte\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(byte value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{Byte}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(byte? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"SByte\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        [CLSCompliant(false)]\n        public static implicit operator JToken(sbyte value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{SByte}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        [CLSCompliant(false)]\n        public static implicit operator JToken(sbyte? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{Boolean}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(bool? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{Int64}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(long value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{DateTime}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(DateTime? value)\n        {\n            return new JValue(value);\n        }\n\n#if !NET20\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{DateTimeOffset}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(DateTimeOffset? value)\n        {\n            return new JValue(value);\n        }\n#endif\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{Decimal}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(decimal? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{Double}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(double? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Int16\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        [CLSCompliant(false)]\n        public static implicit operator JToken(short value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"UInt16\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        [CLSCompliant(false)]\n        public static implicit operator JToken(ushort value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Int32\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(int value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{Int32}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(int? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"DateTime\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(DateTime value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{Int64}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(long? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{Single}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(float? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Decimal\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(decimal value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{Int16}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        [CLSCompliant(false)]\n        public static implicit operator JToken(short? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{UInt16}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        [CLSCompliant(false)]\n        public static implicit operator JToken(ushort? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{UInt32}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        [CLSCompliant(false)]\n        public static implicit operator JToken(uint? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{UInt64}\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        [CLSCompliant(false)]\n        public static implicit operator JToken(ulong? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Double\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(double value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Single\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(float value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"String\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(string value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"UInt32\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        [CLSCompliant(false)]\n        public static implicit operator JToken(uint value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"UInt64\"/> to <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        [CLSCompliant(false)]\n        public static implicit operator JToken(ulong value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"T:System.Byte[]\"/> to <see cref=\"Newtonsoft.Json.Linq.JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(byte[] value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"T:System.Uri\"/> to <see cref=\"Newtonsoft.Json.Linq.JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(Uri value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"T:System.TimeSpan\"/> to <see cref=\"Newtonsoft.Json.Linq.JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(TimeSpan value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{TimeSpan}\"/> to <see cref=\"Newtonsoft.Json.Linq.JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(TimeSpan? value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"T:System.Guid\"/> to <see cref=\"Newtonsoft.Json.Linq.JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(Guid value)\n        {\n            return new JValue(value);\n        }\n\n        /// <summary>\n        /// Performs an implicit conversion from <see cref=\"Nullable{Guid}\"/> to <see cref=\"Newtonsoft.Json.Linq.JToken\"/>.\n        /// </summary>\n        /// <param name=\"value\">The value to create a <see cref=\"JValue\"/> from.</param>\n        /// <returns>The <see cref=\"JValue\"/> initialized with the specified value.</returns>\n        public static implicit operator JToken(Guid? value)\n        {\n            return new JValue(value);\n        }\n        #endregion\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return ((IEnumerable<JToken>)this).GetEnumerator();\n        }\n\n        IEnumerator<JToken> IEnumerable<JToken>.GetEnumerator()\n        {\n            return Children().GetEnumerator();\n        }\n\n        internal abstract int GetDeepHashCode();\n\n        IJEnumerable<JToken> IJEnumerable<JToken>.this[object key]\n        {\n            get { return this[key]; }\n        }\n\n        /// <summary>\n        /// Creates an <see cref=\"JsonReader\"/> for this token.\n        /// </summary>\n        /// <returns>An <see cref=\"JsonReader\"/> that can be used to read this token and its descendants.</returns>\n        public JsonReader CreateReader()\n        {\n            return new JTokenReader(this, Path);\n        }\n\n        internal static JToken FromObjectInternal(object o, JsonSerializer jsonSerializer)\n        {\n            ValidationUtils.ArgumentNotNull(o, \"o\");\n            ValidationUtils.ArgumentNotNull(jsonSerializer, \"jsonSerializer\");\n\n            JToken token;\n            using (JTokenWriter jsonWriter = new JTokenWriter())\n            {\n                jsonSerializer.Serialize(jsonWriter, o);\n                token = jsonWriter.Token;\n            }\n\n            return token;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JToken\"/> from an object.\n        /// </summary>\n        /// <param name=\"o\">The object that will be used to create <see cref=\"JToken\"/>.</param>\n        /// <returns>A <see cref=\"JToken\"/> with the value of the specified object</returns>\n        public static JToken FromObject(object o)\n        {\n            return FromObjectInternal(o, JsonSerializer.CreateDefault());\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JToken\"/> from an object using the specified <see cref=\"JsonSerializer\"/>.\n        /// </summary>\n        /// <param name=\"o\">The object that will be used to create <see cref=\"JToken\"/>.</param>\n        /// <param name=\"jsonSerializer\">The <see cref=\"JsonSerializer\"/> that will be used when reading the object.</param>\n        /// <returns>A <see cref=\"JToken\"/> with the value of the specified object</returns>\n        public static JToken FromObject(object o, JsonSerializer jsonSerializer)\n        {\n            return FromObjectInternal(o, jsonSerializer);\n        }\n\n        /// <summary>\n        /// Creates the specified .NET type from the <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The object type that the token will be deserialized to.</typeparam>\n        /// <returns>The new object created from the JSON value.</returns>\n        public T ToObject<T>()\n        {\n            return (T)ToObject(typeof(T));\n        }\n\n        /// <summary>\n        /// Creates the specified .NET type from the <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"objectType\">The object type that the token will be deserialized to.</param>\n        /// <returns>The new object created from the JSON value.</returns>\n        public object ToObject(Type objectType)\n        {\n            if (JsonConvert.DefaultSettings == null)\n            {\n                PrimitiveTypeCode typeCode = ConvertUtils.GetTypeCode(objectType);\n\n                switch (typeCode)\n                {\n                    case PrimitiveTypeCode.BooleanNullable:\n                        return (bool?)this;\n                    case PrimitiveTypeCode.Boolean:\n                        return (bool)this;\n                    case PrimitiveTypeCode.CharNullable:\n                        return (char?)this;\n                    case PrimitiveTypeCode.Char:\n                        return (char)this;\n                    case PrimitiveTypeCode.SByte:\n                        return (sbyte?)this;\n                    case PrimitiveTypeCode.SByteNullable:\n                        return (sbyte)this;\n                    case PrimitiveTypeCode.ByteNullable:\n                        return (byte?)this;\n                    case PrimitiveTypeCode.Byte:\n                        return (byte)this;\n                    case PrimitiveTypeCode.Int16Nullable:\n                        return (short?)this;\n                    case PrimitiveTypeCode.Int16:\n                        return (short)this;\n                    case PrimitiveTypeCode.UInt16Nullable:\n                        return (ushort?)this;\n                    case PrimitiveTypeCode.UInt16:\n                        return (ushort)this;\n                    case PrimitiveTypeCode.Int32Nullable:\n                        return (int?)this;\n                    case PrimitiveTypeCode.Int32:\n                        return (int)this;\n                    case PrimitiveTypeCode.UInt32Nullable:\n                        return (uint?)this;\n                    case PrimitiveTypeCode.UInt32:\n                        return (uint)this;\n                    case PrimitiveTypeCode.Int64Nullable:\n                        return (long?)this;\n                    case PrimitiveTypeCode.Int64:\n                        return (long)this;\n                    case PrimitiveTypeCode.UInt64Nullable:\n                        return (ulong?)this;\n                    case PrimitiveTypeCode.UInt64:\n                        return (ulong)this;\n                    case PrimitiveTypeCode.SingleNullable:\n                        return (float?)this;\n                    case PrimitiveTypeCode.Single:\n                        return (float)this;\n                    case PrimitiveTypeCode.DoubleNullable:\n                        return (double?)this;\n                    case PrimitiveTypeCode.Double:\n                        return (double)this;\n                    case PrimitiveTypeCode.DecimalNullable:\n                        return (decimal?)this;\n                    case PrimitiveTypeCode.Decimal:\n                        return (decimal)this;\n                    case PrimitiveTypeCode.DateTimeNullable:\n                        return (DateTime?)this;\n                    case PrimitiveTypeCode.DateTime:\n                        return (DateTime)this;\n#if !NET20\n                    case PrimitiveTypeCode.DateTimeOffsetNullable:\n                        return (DateTimeOffset?)this;\n                    case PrimitiveTypeCode.DateTimeOffset:\n                        return (DateTimeOffset)this;\n#endif\n                    case PrimitiveTypeCode.String:\n                        return (string)this;\n                    case PrimitiveTypeCode.GuidNullable:\n                        return (Guid?)this;\n                    case PrimitiveTypeCode.Guid:\n                        return (Guid)this;\n                    case PrimitiveTypeCode.Uri:\n                        return (Uri)this;\n                    case PrimitiveTypeCode.TimeSpanNullable:\n                        return (TimeSpan?)this;\n                    case PrimitiveTypeCode.TimeSpan:\n                        return (TimeSpan)this;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n                    case PrimitiveTypeCode.BigIntegerNullable:\n                        return ToBigIntegerNullable(this);\n                    case PrimitiveTypeCode.BigInteger:\n                        return ToBigInteger(this);\n#endif\n                }\n            }\n\n            return ToObject(objectType, JsonSerializer.CreateDefault());\n        }\n\n        /// <summary>\n        /// Creates the specified .NET type from the <see cref=\"JToken\"/> using the specified <see cref=\"JsonSerializer\"/>.\n        /// </summary>\n        /// <typeparam name=\"T\">The object type that the token will be deserialized to.</typeparam>\n        /// <param name=\"jsonSerializer\">The <see cref=\"JsonSerializer\"/> that will be used when creating the object.</param>\n        /// <returns>The new object created from the JSON value.</returns>\n        public T ToObject<T>(JsonSerializer jsonSerializer)\n        {\n            return (T)ToObject(typeof(T), jsonSerializer);\n        }\n\n        /// <summary>\n        /// Creates the specified .NET type from the <see cref=\"JToken\"/> using the specified <see cref=\"JsonSerializer\"/>.\n        /// </summary>\n        /// <param name=\"objectType\">The object type that the token will be deserialized to.</param>\n        /// <param name=\"jsonSerializer\">The <see cref=\"JsonSerializer\"/> that will be used when creating the object.</param>\n        /// <returns>The new object created from the JSON value.</returns>\n        public object ToObject(Type objectType, JsonSerializer jsonSerializer)\n        {\n            ValidationUtils.ArgumentNotNull(jsonSerializer, \"jsonSerializer\");\n\n            using (JTokenReader jsonReader = new JTokenReader(this))\n            {\n                return jsonSerializer.Deserialize(jsonReader, objectType);\n            }\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JToken\"/> from a <see cref=\"JsonReader\"/>.\n        /// </summary>\n        /// <param name=\"reader\">An <see cref=\"JsonReader\"/> positioned at the token to read into this <see cref=\"JToken\"/>.</param>\n        /// <returns>\n        /// An <see cref=\"JToken\"/> that contains the token and its descendant tokens\n        /// that were read from the reader. The runtime type of the token is determined\n        /// by the token type of the first token encountered in the reader.\n        /// </returns>\n        public static JToken ReadFrom(JsonReader reader)\n        {\n            ValidationUtils.ArgumentNotNull(reader, \"reader\");\n\n            if (reader.TokenType == JsonToken.None)\n            {\n                if (!reader.Read())\n                    throw JsonReaderException.Create(reader, \"Error reading JToken from JsonReader.\");\n            }\n\n            if (reader.TokenType == JsonToken.StartObject)\n                return JObject.Load(reader);\n\n            if (reader.TokenType == JsonToken.StartArray)\n                return JArray.Load(reader);\n\n            if (reader.TokenType == JsonToken.PropertyName)\n                return JProperty.Load(reader);\n\n            if (reader.TokenType == JsonToken.StartConstructor)\n                return JConstructor.Load(reader);\n\n            if (!JsonReader.IsStartToken(reader.TokenType))\n                return new JValue(reader.Value);\n\n            throw JsonReaderException.Create(reader, \"Error reading JToken from JsonReader. Unexpected token: {0}\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n        }\n\n        /// <summary>\n        /// Load a <see cref=\"JToken\"/> from a string that contains JSON.\n        /// </summary>\n        /// <param name=\"json\">A <see cref=\"String\"/> that contains JSON.</param>\n        /// <returns>A <see cref=\"JToken\"/> populated from the string that contains JSON.</returns>\n        public static JToken Parse(string json)\n        {\n            using (JsonReader reader = new JsonTextReader(new StringReader(json)))\n            {\n                JToken t = Load(reader);\n\n                if (reader.Read() && reader.TokenType != JsonToken.Comment)\n                    throw JsonReaderException.Create(reader, \"Additional text found in JSON string after parsing content.\");\n\n                return t;\n            }\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JToken\"/> from a <see cref=\"JsonReader\"/>.\n        /// </summary>\n        /// <param name=\"reader\">An <see cref=\"JsonReader\"/> positioned at the token to read into this <see cref=\"JToken\"/>.</param>\n        /// <returns>\n        /// An <see cref=\"JToken\"/> that contains the token and its descendant tokens\n        /// that were read from the reader. The runtime type of the token is determined\n        /// by the token type of the first token encountered in the reader.\n        /// </returns>\n        public static JToken Load(JsonReader reader)\n        {\n            return ReadFrom(reader);\n        }\n\n        internal void SetLineInfo(IJsonLineInfo lineInfo)\n        {\n            if (lineInfo == null || !lineInfo.HasLineInfo())\n                return;\n\n            SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition);\n        }\n\n        internal void SetLineInfo(int lineNumber, int linePosition)\n        {\n            _lineNumber = lineNumber;\n            _linePosition = linePosition;\n        }\n\n        bool IJsonLineInfo.HasLineInfo()\n        {\n            return (_lineNumber != null && _linePosition != null);\n        }\n\n        int IJsonLineInfo.LineNumber\n        {\n            get { return _lineNumber ?? 0; }\n        }\n\n        int IJsonLineInfo.LinePosition\n        {\n            get { return _linePosition ?? 0; }\n        }\n\n        /// <summary>\n        /// Selects a <see cref=\"JToken\"/> using a JPath expression. Selects the token that matches the object path.\n        /// </summary>\n        /// <param name=\"path\">\n        /// A <see cref=\"String\"/> that contains a JPath expression.\n        /// </param>\n        /// <returns>A <see cref=\"JToken\"/>, or null.</returns>\n        public JToken SelectToken(string path)\n        {\n            return SelectToken(path, false);\n        }\n\n        /// <summary>\n        /// Selects a <see cref=\"JToken\"/> using a JPath expression. Selects the token that matches the object path.\n        /// </summary>\n        /// <param name=\"path\">\n        /// A <see cref=\"String\"/> that contains a JPath expression.\n        /// </param>\n        /// <param name=\"errorWhenNoMatch\">A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression.</param>\n        /// <returns>A <see cref=\"JToken\"/>.</returns>\n        public JToken SelectToken(string path, bool errorWhenNoMatch)\n        {\n            JPath p = new JPath(path);\n\n            JToken token = null;\n            foreach (JToken t in p.Evaluate(this, errorWhenNoMatch))\n            {\n                if (token != null)\n                    throw new JsonException(\"Path returned multiple tokens.\");\n\n                token = t;\n            }\n\n            return token;\n        }\n\n        /// <summary>\n        /// Selects a collection of elements using a JPath expression.\n        /// </summary>\n        /// <param name=\"path\">\n        /// A <see cref=\"String\"/> that contains a JPath expression.\n        /// </param>\n        /// <returns>An <see cref=\"IEnumerable{JToken}\"/> that contains the selected elements.</returns>\n        public IEnumerable<JToken> SelectTokens(string path)\n        {\n            return SelectTokens(path, false);\n        }\n\n        /// <summary>\n        /// Selects a collection of elements using a JPath expression.\n        /// </summary>\n        /// <param name=\"path\">\n        /// A <see cref=\"String\"/> that contains a JPath expression.\n        /// </param>\n        /// <param name=\"errorWhenNoMatch\">A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression.</param>\n        /// <returns>An <see cref=\"IEnumerable{JToken}\"/> that contains the selected elements.</returns>\n        public IEnumerable<JToken> SelectTokens(string path, bool errorWhenNoMatch)\n        {\n            JPath p = new JPath(path);\n            return p.Evaluate(this, errorWhenNoMatch);\n        }\n\n#if !(NET35 || NET20 || PORTABLE40)\n        /// <summary>\n        /// Returns the <see cref=\"T:System.Dynamic.DynamicMetaObject\"/> responsible for binding operations performed on this object.\n        /// </summary>\n        /// <param name=\"parameter\">The expression tree representation of the runtime value.</param>\n        /// <returns>\n        /// The <see cref=\"T:System.Dynamic.DynamicMetaObject\"/> to bind this object.\n        /// </returns>\n        protected virtual DynamicMetaObject GetMetaObject(Expression parameter)\n        {\n            return new DynamicProxyMetaObject<JToken>(parameter, this, new DynamicProxy<JToken>(), true);\n        }\n\n        /// <summary>\n        /// Returns the <see cref=\"T:System.Dynamic.DynamicMetaObject\"/> responsible for binding operations performed on this object.\n        /// </summary>\n        /// <param name=\"parameter\">The expression tree representation of the runtime value.</param>\n        /// <returns>\n        /// The <see cref=\"T:System.Dynamic.DynamicMetaObject\"/> to bind this object.\n        /// </returns>\n        DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject(Expression parameter)\n        {\n            return GetMetaObject(parameter);\n        }\n#endif\n\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n        object ICloneable.Clone()\n        {\n            return DeepClone();\n        }\n#endif\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"JToken\"/>. All child tokens are recursively cloned.\n        /// </summary>\n        /// <returns>A new instance of the <see cref=\"JToken\"/>.</returns>\n        public JToken DeepClone()\n        {\n            return CloneToken();\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JTokenEqualityComparer.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections.Generic;\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Compares tokens to determine whether they are equal.\n    /// </summary>\n    public class JTokenEqualityComparer : IEqualityComparer<JToken>\n    {\n        /// <summary>\n        /// Determines whether the specified objects are equal.\n        /// </summary>\n        /// <param name=\"x\">The first object of type <see cref=\"JToken\"/> to compare.</param>\n        /// <param name=\"y\">The second object of type <see cref=\"JToken\"/> to compare.</param>\n        /// <returns>\n        /// true if the specified objects are equal; otherwise, false.\n        /// </returns>\n        public bool Equals(JToken x, JToken y)\n        {\n            return JToken.DeepEquals(x, y);\n        }\n\n        /// <summary>\n        /// Returns a hash code for the specified object.\n        /// </summary>\n        /// <param name=\"obj\">The <see cref=\"T:System.Object\"/> for which a hash code is to be returned.</param>\n        /// <returns>A hash code for the specified object.</returns>\n        /// <exception cref=\"T:System.ArgumentNullException\">The type of <paramref name=\"obj\"/> is a reference type and <paramref name=\"obj\"/> is null.</exception>\n        public int GetHashCode(JToken obj)\n        {\n            if (obj == null)\n                return 0;\n\n            return obj.GetDeepHashCode();\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JTokenReader.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a reader that provides fast, non-cached, forward-only access to serialized Json data.\n    /// </summary>\n    public class JTokenReader : JsonReader, IJsonLineInfo\n    {\n        private readonly string _initialPath;\n        private readonly JToken _root;\n        private JToken _parent;\n        internal JToken _current;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JTokenReader\"/> class.\n        /// </summary>\n        /// <param name=\"token\">The token to read from.</param>\n        public JTokenReader(JToken token)\n        {\n            ValidationUtils.ArgumentNotNull(token, \"token\");\n\n            _root = token;\n            _current = token;\n        }\n\n        internal JTokenReader(JToken token, string initialPath)\n            : this(token)\n        {\n            _initialPath = initialPath;\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"T:Byte[]\"/>.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:Byte[]\"/> or a null reference if the next JSON token is null. This method will return <c>null</c> at the end of an array.\n        /// </returns>\n        public override byte[] ReadAsBytes()\n        {\n            return ReadAsBytesInternal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{Decimal}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{Decimal}\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override decimal? ReadAsDecimal()\n        {\n            return ReadAsDecimalInternal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{Int32}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{Int32}\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override int? ReadAsInt32()\n        {\n            return ReadAsInt32Internal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"String\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"String\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override string ReadAsString()\n        {\n            return ReadAsStringInternal();\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{DateTime}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"String\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override DateTime? ReadAsDateTime()\n        {\n            return ReadAsDateTimeInternal();\n        }\n\n#if !NET20\n        /// <summary>\n        /// Reads the next JSON token from the stream as a <see cref=\"Nullable{DateTimeOffset}\"/>.\n        /// </summary>\n        /// <returns>A <see cref=\"Nullable{DateTimeOffset}\"/>. This method will return <c>null</c> at the end of an array.</returns>\n        public override DateTimeOffset? ReadAsDateTimeOffset()\n        {\n            return ReadAsDateTimeOffsetInternal();\n        }\n#endif\n\n        internal override bool ReadInternal()\n        {\n            if (CurrentState != State.Start)\n            {\n                JContainer container = _current as JContainer;\n                if (container != null && _parent != container)\n                    return ReadInto(container);\n                else\n                    return ReadOver(_current);\n            }\n\n            SetToken(_current);\n            return true;\n        }\n\n        /// <summary>\n        /// Reads the next JSON token from the stream.\n        /// </summary>\n        /// <returns>\n        /// true if the next token was read successfully; false if there are no more tokens to read.\n        /// </returns>\n        public override bool Read()\n        {\n            _readType = ReadType.Read;\n\n            return ReadInternal();\n        }\n\n        private bool ReadOver(JToken t)\n        {\n            if (t == _root)\n                return ReadToEnd();\n\n            JToken next = t.Next;\n            if ((next == null || next == t) || t == t.Parent.Last)\n            {\n                if (t.Parent == null)\n                    return ReadToEnd();\n\n                return SetEnd(t.Parent);\n            }\n            else\n            {\n                _current = next;\n                SetToken(_current);\n                return true;\n            }\n        }\n\n        private bool ReadToEnd()\n        {\n            SetToken(JsonToken.None);\n            return false;\n        }\n\n        private bool IsEndElement\n        {\n            get { return (_current == _parent); }\n        }\n\n        private JsonToken? GetEndToken(JContainer c)\n        {\n            switch (c.Type)\n            {\n                case JTokenType.Object:\n                    return JsonToken.EndObject;\n                case JTokenType.Array:\n                    return JsonToken.EndArray;\n                case JTokenType.Constructor:\n                    return JsonToken.EndConstructor;\n                case JTokenType.Property:\n                    return null;\n                default:\n                    throw MiscellaneousUtils.CreateArgumentOutOfRangeException(\"Type\", c.Type, \"Unexpected JContainer type.\");\n            }\n        }\n\n        private bool ReadInto(JContainer c)\n        {\n            JToken firstChild = c.First;\n            if (firstChild == null)\n            {\n                return SetEnd(c);\n            }\n            else\n            {\n                SetToken(firstChild);\n                _current = firstChild;\n                _parent = c;\n                return true;\n            }\n        }\n\n        private bool SetEnd(JContainer c)\n        {\n            JsonToken? endToken = GetEndToken(c);\n            if (endToken != null)\n            {\n                SetToken(endToken.Value);\n                _current = c;\n                _parent = c;\n                return true;\n            }\n            else\n            {\n                return ReadOver(c);\n            }\n        }\n\n        private void SetToken(JToken token)\n        {\n            switch (token.Type)\n            {\n                case JTokenType.Object:\n                    SetToken(JsonToken.StartObject);\n                    break;\n                case JTokenType.Array:\n                    SetToken(JsonToken.StartArray);\n                    break;\n                case JTokenType.Constructor:\n                    SetToken(JsonToken.StartConstructor, ((JConstructor)token).Name);\n                    break;\n                case JTokenType.Property:\n                    SetToken(JsonToken.PropertyName, ((JProperty)token).Name);\n                    break;\n                case JTokenType.Comment:\n                    SetToken(JsonToken.Comment, ((JValue)token).Value);\n                    break;\n                case JTokenType.Integer:\n                    SetToken(JsonToken.Integer, ((JValue)token).Value);\n                    break;\n                case JTokenType.Float:\n                    SetToken(JsonToken.Float, ((JValue)token).Value);\n                    break;\n                case JTokenType.String:\n                    SetToken(JsonToken.String, ((JValue)token).Value);\n                    break;\n                case JTokenType.Boolean:\n                    SetToken(JsonToken.Boolean, ((JValue)token).Value);\n                    break;\n                case JTokenType.Null:\n                    SetToken(JsonToken.Null, ((JValue)token).Value);\n                    break;\n                case JTokenType.Undefined:\n                    SetToken(JsonToken.Undefined, ((JValue)token).Value);\n                    break;\n                case JTokenType.Date:\n                    SetToken(JsonToken.Date, ((JValue)token).Value);\n                    break;\n                case JTokenType.Raw:\n                    SetToken(JsonToken.Raw, ((JValue)token).Value);\n                    break;\n                case JTokenType.Bytes:\n                    SetToken(JsonToken.Bytes, ((JValue)token).Value);\n                    break;\n                case JTokenType.Guid:\n                    SetToken(JsonToken.String, SafeToString(((JValue)token).Value));\n                    break;\n                case JTokenType.Uri:\n                    SetToken(JsonToken.String, SafeToString(((JValue)token).Value));\n                    break;\n                case JTokenType.TimeSpan:\n                    SetToken(JsonToken.String, SafeToString(((JValue)token).Value));\n                    break;\n                default:\n                    throw MiscellaneousUtils.CreateArgumentOutOfRangeException(\"Type\", token.Type, \"Unexpected JTokenType.\");\n            }\n        }\n\n        private string SafeToString(object value)\n        {\n            return (value != null) ? value.ToString() : null;\n        }\n\n        bool IJsonLineInfo.HasLineInfo()\n        {\n            if (CurrentState == State.Start)\n                return false;\n\n            IJsonLineInfo info = IsEndElement ? null : _current;\n            return (info != null && info.HasLineInfo());\n        }\n\n        int IJsonLineInfo.LineNumber\n        {\n            get\n            {\n                if (CurrentState == State.Start)\n                    return 0;\n\n                IJsonLineInfo info = IsEndElement ? null : _current;\n                if (info != null)\n                    return info.LineNumber;\n\n                return 0;\n            }\n        }\n\n        int IJsonLineInfo.LinePosition\n        {\n            get\n            {\n                if (CurrentState == State.Start)\n                    return 0;\n\n                IJsonLineInfo info = IsEndElement ? null : _current;\n                if (info != null)\n                    return info.LinePosition;\n\n                return 0;\n            }\n        }\n\n        /// <summary>\n        /// Gets the path of the current JSON token. \n        /// </summary>\n        public override string Path\n        {\n            get\n            {\n                string path = base.Path;\n\n                if (!string.IsNullOrEmpty(_initialPath))\n                {\n                    if (string.IsNullOrEmpty(path))\n                        return _initialPath;\n\n                    if (_initialPath.EndsWith(\"]\", StringComparison.OrdinalIgnoreCase)\n                        || path.StartsWith(\"[\", StringComparison.OrdinalIgnoreCase))\n                        path = _initialPath + path;\n                    else\n                        path = _initialPath + \".\" + path;\n                }\n\n                return path;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JTokenType.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Specifies the type of token.\n    /// </summary>\n    public enum JTokenType\n    {\n        /// <summary>\n        /// No token type has been set.\n        /// </summary>\n        None,\n\n        /// <summary>\n        /// A JSON object.\n        /// </summary>\n        Object,\n\n        /// <summary>\n        /// A JSON array.\n        /// </summary>\n        Array,\n\n        /// <summary>\n        /// A JSON constructor.\n        /// </summary>\n        Constructor,\n\n        /// <summary>\n        /// A JSON object property.\n        /// </summary>\n        Property,\n\n        /// <summary>\n        /// A comment.\n        /// </summary>\n        Comment,\n\n        /// <summary>\n        /// An integer value.\n        /// </summary>\n        Integer,\n\n        /// <summary>\n        /// A float value.\n        /// </summary>\n        Float,\n\n        /// <summary>\n        /// A string value.\n        /// </summary>\n        String,\n\n        /// <summary>\n        /// A boolean value.\n        /// </summary>\n        Boolean,\n\n        /// <summary>\n        /// A null value.\n        /// </summary>\n        Null,\n\n        /// <summary>\n        /// An undefined value.\n        /// </summary>\n        Undefined,\n\n        /// <summary>\n        /// A date value.\n        /// </summary>\n        Date,\n\n        /// <summary>\n        /// A raw JSON value.\n        /// </summary>\n        Raw,\n\n        /// <summary>\n        /// A collection of bytes value.\n        /// </summary>\n        Bytes,\n\n        /// <summary>\n        /// A Guid value.\n        /// </summary>\n        Guid,\n\n        /// <summary>\n        /// A Uri value.\n        /// </summary>\n        Uri,\n\n        /// <summary>\n        /// A TimeSpan value.\n        /// </summary>\n        TimeSpan\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JTokenWriter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Globalization;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\nusing System.Numerics;\n#endif\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a writer that provides a fast, non-cached, forward-only way of generating Json data.\n    /// </summary>\n    public class JTokenWriter : JsonWriter\n    {\n        private JContainer _token;\n        private JContainer _parent;\n        // used when writer is writing single value and the value has no containing parent\n        private JValue _value;\n\n        /// <summary>\n        /// Gets the token being writen.\n        /// </summary>\n        /// <value>The token being writen.</value>\n        public JToken Token\n        {\n            get\n            {\n                if (_token != null)\n                    return _token;\n\n                return _value;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JTokenWriter\"/> class writing to the given <see cref=\"JContainer\"/>.\n        /// </summary>\n        /// <param name=\"container\">The container being written to.</param>\n        public JTokenWriter(JContainer container)\n        {\n            ValidationUtils.ArgumentNotNull(container, \"container\");\n\n            _token = container;\n            _parent = container;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JTokenWriter\"/> class.\n        /// </summary>\n        public JTokenWriter()\n        {\n        }\n\n        /// <summary>\n        /// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.\n        /// </summary>\n        public override void Flush()\n        {\n        }\n\n        /// <summary>\n        /// Closes this stream and the underlying stream.\n        /// </summary>\n        public override void Close()\n        {\n            base.Close();\n        }\n\n        /// <summary>\n        /// Writes the beginning of a Json object.\n        /// </summary>\n        public override void WriteStartObject()\n        {\n            base.WriteStartObject();\n\n            AddParent(new JObject());\n        }\n\n        private void AddParent(JContainer container)\n        {\n            if (_parent == null)\n                _token = container;\n            else\n                _parent.AddAndSkipParentCheck(container);\n\n            _parent = container;\n        }\n\n        private void RemoveParent()\n        {\n            _parent = _parent.Parent;\n\n            if (_parent != null && _parent.Type == JTokenType.Property)\n                _parent = _parent.Parent;\n        }\n\n        /// <summary>\n        /// Writes the beginning of a Json array.\n        /// </summary>\n        public override void WriteStartArray()\n        {\n            base.WriteStartArray();\n\n            AddParent(new JArray());\n        }\n\n        /// <summary>\n        /// Writes the start of a constructor with the given name.\n        /// </summary>\n        /// <param name=\"name\">The name of the constructor.</param>\n        public override void WriteStartConstructor(string name)\n        {\n            base.WriteStartConstructor(name);\n\n            AddParent(new JConstructor(name));\n        }\n\n        /// <summary>\n        /// Writes the end.\n        /// </summary>\n        /// <param name=\"token\">The token.</param>\n        protected override void WriteEnd(JsonToken token)\n        {\n            RemoveParent();\n        }\n\n        /// <summary>\n        /// Writes the property name of a name/value pair on a Json object.\n        /// </summary>\n        /// <param name=\"name\">The name of the property.</param>\n        public override void WritePropertyName(string name)\n        {\n            base.WritePropertyName(name);\n\n            AddParent(new JProperty(name));\n        }\n\n        private void AddValue(object value, JsonToken token)\n        {\n            AddValue(new JValue(value), token);\n        }\n\n        internal void AddValue(JValue value, JsonToken token)\n        {\n            if (_parent != null)\n            {\n                _parent.Add(value);\n\n                if (_parent.Type == JTokenType.Property)\n                    _parent = _parent.Parent;\n            }\n            else\n            {\n                _value = value ?? new JValue((object)null);\n            }\n        }\n\n        #region WriteValue methods\n        /// <summary>\n        /// Writes a <see cref=\"Object\"/> value.\n        /// An error will raised if the value cannot be written as a single JSON token.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Object\"/> value to write.</param>\n        public override void WriteValue(object value)\n        {\n#if !(NET20 || NET35 || PORTABLE || PORTABLE40)\n            if (value is BigInteger)\n            {\n                InternalWriteValue(JsonToken.Integer);\n                AddValue(value, JsonToken.Integer);\n            }\n            else\n#endif\n            {\n                base.WriteValue(value);\n            }\n        }\n\n        /// <summary>\n        /// Writes a null value.\n        /// </summary>\n        public override void WriteNull()\n        {\n            base.WriteNull();\n            AddValue(null, JsonToken.Null);\n        }\n\n        /// <summary>\n        /// Writes an undefined value.\n        /// </summary>\n        public override void WriteUndefined()\n        {\n            base.WriteUndefined();\n            AddValue(null, JsonToken.Undefined);\n        }\n\n        /// <summary>\n        /// Writes raw JSON.\n        /// </summary>\n        /// <param name=\"json\">The raw JSON to write.</param>\n        public override void WriteRaw(string json)\n        {\n            base.WriteRaw(json);\n            AddValue(new JRaw(json), JsonToken.Raw);\n        }\n\n        /// <summary>\n        /// Writes out a comment <code>/*...*/</code> containing the specified text.\n        /// </summary>\n        /// <param name=\"text\">Text to place inside the comment.</param>\n        public override void WriteComment(string text)\n        {\n            base.WriteComment(text);\n            AddValue(JValue.CreateComment(text), JsonToken.Comment);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"String\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"String\"/> value to write.</param>\n        public override void WriteValue(string value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int32\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int32\"/> value to write.</param>\n        public override void WriteValue(int value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt32\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt32\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(uint value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int64\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int64\"/> value to write.</param>\n        public override void WriteValue(long value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt64\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt64\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(ulong value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Single\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Single\"/> value to write.</param>\n        public override void WriteValue(float value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Float);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Double\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Double\"/> value to write.</param>\n        public override void WriteValue(double value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Float);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Boolean\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Boolean\"/> value to write.</param>\n        public override void WriteValue(bool value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Boolean);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Int16\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Int16\"/> value to write.</param>\n        public override void WriteValue(short value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"UInt16\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"UInt16\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(ushort value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Char\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Char\"/> value to write.</param>\n        public override void WriteValue(char value)\n        {\n            base.WriteValue(value);\n            string s = null;\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            s = value.ToString(CultureInfo.InvariantCulture);\n#else\n            s = value.ToString();\n#endif\n            AddValue(s, JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Byte\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Byte\"/> value to write.</param>\n        public override void WriteValue(byte value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"SByte\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"SByte\"/> value to write.</param>\n        [CLSCompliant(false)]\n        public override void WriteValue(sbyte value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Integer);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Decimal\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Decimal\"/> value to write.</param>\n        public override void WriteValue(decimal value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Float);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"DateTime\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"DateTime\"/> value to write.</param>\n        public override void WriteValue(DateTime value)\n        {\n            base.WriteValue(value);\n            value = DateTimeUtils.EnsureDateTime(value, DateTimeZoneHandling);\n            AddValue(value, JsonToken.Date);\n        }\n\n#if !NET20\n        /// <summary>\n        /// Writes a <see cref=\"DateTimeOffset\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"DateTimeOffset\"/> value to write.</param>\n        public override void WriteValue(DateTimeOffset value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Date);\n        }\n#endif\n\n        /// <summary>\n        /// Writes a <see cref=\"T:Byte[]\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"T:Byte[]\"/> value to write.</param>\n        public override void WriteValue(byte[] value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.Bytes);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"TimeSpan\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"TimeSpan\"/> value to write.</param>\n        public override void WriteValue(TimeSpan value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Guid\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Guid\"/> value to write.</param>\n        public override void WriteValue(Guid value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.String);\n        }\n\n        /// <summary>\n        /// Writes a <see cref=\"Uri\"/> value.\n        /// </summary>\n        /// <param name=\"value\">The <see cref=\"Uri\"/> value to write.</param>\n        public override void WriteValue(Uri value)\n        {\n            base.WriteValue(value);\n            AddValue(value, JsonToken.String);\n        }\n        #endregion\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JValue.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n#if !(NET35 || NET20 || PORTABLE40)\nusing System.Dynamic;\nusing System.Linq.Expressions;\n#endif\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\nusing System.Numerics;\n\n#endif\n\nnamespace Newtonsoft.Json.Linq\n{\n    /// <summary>\n    /// Represents a value in JSON (string, integer, date, etc).\n    /// </summary>\n    public class JValue : JToken, IEquatable<JValue>, IFormattable, IComparable, IComparable<JValue>\n#if !(NETFX_CORE || PORTABLE)\n        , IConvertible\n#endif\n    {\n        private JTokenType _valueType;\n        private object _value;\n\n        internal JValue(object value, JTokenType type)\n        {\n            _value = value;\n            _valueType = type;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class from another <see cref=\"JValue\"/> object.\n        /// </summary>\n        /// <param name=\"other\">A <see cref=\"JValue\"/> object to copy from.</param>\n        public JValue(JValue other)\n            : this(other.Value, other.Type)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(long value)\n            : this(value, JTokenType.Integer)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(decimal value)\n            : this(value, JTokenType.Float)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(char value)\n            : this(value, JTokenType.String)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        [CLSCompliant(false)]\n        public JValue(ulong value)\n            : this(value, JTokenType.Integer)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(double value)\n            : this(value, JTokenType.Float)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(float value)\n            : this(value, JTokenType.Float)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(DateTime value)\n            : this(value, JTokenType.Date)\n        {\n        }\n\n#if !NET20\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(DateTimeOffset value)\n            : this(value, JTokenType.Date)\n        {\n        }\n#endif\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(bool value)\n            : this(value, JTokenType.Boolean)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(string value)\n            : this(value, JTokenType.String)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(Guid value)\n            : this(value, JTokenType.Guid)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(Uri value)\n            : this(value, (value != null) ? JTokenType.Uri : JTokenType.Null)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(TimeSpan value)\n            : this(value, JTokenType.TimeSpan)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JValue\"/> class with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        public JValue(object value)\n            : this(value, GetValueType(null, value))\n        {\n        }\n\n        internal override bool DeepEquals(JToken node)\n        {\n            JValue other = node as JValue;\n            if (other == null)\n                return false;\n            if (other == this)\n                return true;\n\n            return ValuesEquals(this, other);\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether this token has child tokens.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if this token has child values; otherwise, <c>false</c>.\n        /// </value>\n        public override bool HasValues\n        {\n            get { return false; }\n        }\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n        private static int CompareBigInteger(BigInteger i1, object i2)\n        {\n            int result = i1.CompareTo(ConvertUtils.ToBigInteger(i2));\n\n            if (result != 0)\n                return result;\n\n            // converting a fractional number to a BigInteger will lose the fraction\n            // check for fraction if result is two numbers are equal\n            if (i2 is decimal)\n            {\n                decimal d = (decimal)i2;\n                return (0m).CompareTo(Math.Abs(d - Math.Truncate(d)));\n            }\n            else if (i2 is double || i2 is float)\n            {\n                double d = Convert.ToDouble(i2, CultureInfo.InvariantCulture);\n                return (0d).CompareTo(Math.Abs(d - Math.Truncate(d)));\n            }\n\n            return result;\n        }\n#endif\n\n        internal static int Compare(JTokenType valueType, object objA, object objB)\n        {\n            if (objA == null && objB == null)\n                return 0;\n            if (objA != null && objB == null)\n                return 1;\n            if (objA == null && objB != null)\n                return -1;\n\n            switch (valueType)\n            {\n                case JTokenType.Integer:\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n                    if (objA is BigInteger)\n                        return CompareBigInteger((BigInteger)objA, objB);\n                    if (objB is BigInteger)\n                        return -CompareBigInteger((BigInteger)objB, objA);\n#endif\n                    if (objA is ulong || objB is ulong || objA is decimal || objB is decimal)\n                        return Convert.ToDecimal(objA, CultureInfo.InvariantCulture).CompareTo(Convert.ToDecimal(objB, CultureInfo.InvariantCulture));\n                    else if (objA is float || objB is float || objA is double || objB is double)\n                        return CompareFloat(objA, objB);\n                    else\n                        return Convert.ToInt64(objA, CultureInfo.InvariantCulture).CompareTo(Convert.ToInt64(objB, CultureInfo.InvariantCulture));\n                case JTokenType.Float:\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n                    if (objA is BigInteger)\n                        return CompareBigInteger((BigInteger)objA, objB);\n                    if (objB is BigInteger)\n                        return -CompareBigInteger((BigInteger)objB, objA);\n#endif\n                    return CompareFloat(objA, objB);\n                case JTokenType.Comment:\n                case JTokenType.String:\n                case JTokenType.Raw:\n                    string s1 = Convert.ToString(objA, CultureInfo.InvariantCulture);\n                    string s2 = Convert.ToString(objB, CultureInfo.InvariantCulture);\n\n                    return string.CompareOrdinal(s1, s2);\n                case JTokenType.Boolean:\n                    bool b1 = Convert.ToBoolean(objA, CultureInfo.InvariantCulture);\n                    bool b2 = Convert.ToBoolean(objB, CultureInfo.InvariantCulture);\n\n                    return b1.CompareTo(b2);\n                case JTokenType.Date:\n#if !NET20\n                    if (objA is DateTime)\n                    {\n#endif\n                        DateTime date1 = (DateTime)objA;\n                        DateTime date2;\n\n#if !NET20\n                        if (objB is DateTimeOffset)\n                            date2 = ((DateTimeOffset)objB).DateTime;\n                        else\n#endif\n                            date2 = Convert.ToDateTime(objB, CultureInfo.InvariantCulture);\n\n                        return date1.CompareTo(date2);\n#if !NET20\n                    }\n                    else\n                    {\n                        DateTimeOffset date1 = (DateTimeOffset)objA;\n                        DateTimeOffset date2;\n\n                        if (objB is DateTimeOffset)\n                            date2 = (DateTimeOffset)objB;\n                        else\n                            date2 = new DateTimeOffset(Convert.ToDateTime(objB, CultureInfo.InvariantCulture));\n\n                        return date1.CompareTo(date2);\n                    }\n#endif\n                case JTokenType.Bytes:\n                    if (!(objB is byte[]))\n                        throw new ArgumentException(\"Object must be of type byte[].\");\n\n                    byte[] bytes1 = objA as byte[];\n                    byte[] bytes2 = objB as byte[];\n                    if (bytes1 == null)\n                        return -1;\n                    if (bytes2 == null)\n                        return 1;\n\n                    return MiscellaneousUtils.ByteArrayCompare(bytes1, bytes2);\n                case JTokenType.Guid:\n                    if (!(objB is Guid))\n                        throw new ArgumentException(\"Object must be of type Guid.\");\n\n                    Guid guid1 = (Guid)objA;\n                    Guid guid2 = (Guid)objB;\n\n                    return guid1.CompareTo(guid2);\n                case JTokenType.Uri:\n                    if (!(objB is Uri))\n                        throw new ArgumentException(\"Object must be of type Uri.\");\n\n                    Uri uri1 = (Uri)objA;\n                    Uri uri2 = (Uri)objB;\n\n                    return Comparer<string>.Default.Compare(uri1.ToString(), uri2.ToString());\n                case JTokenType.TimeSpan:\n                    if (!(objB is TimeSpan))\n                        throw new ArgumentException(\"Object must be of type TimeSpan.\");\n\n                    TimeSpan ts1 = (TimeSpan)objA;\n                    TimeSpan ts2 = (TimeSpan)objB;\n\n                    return ts1.CompareTo(ts2);\n                default:\n                    throw MiscellaneousUtils.CreateArgumentOutOfRangeException(\"valueType\", valueType, \"Unexpected value type: {0}\".FormatWith(CultureInfo.InvariantCulture, valueType));\n            }\n        }\n\n        private static int CompareFloat(object objA, object objB)\n        {\n            double d1 = Convert.ToDouble(objA, CultureInfo.InvariantCulture);\n            double d2 = Convert.ToDouble(objB, CultureInfo.InvariantCulture);\n\n            // take into account possible floating point errors\n            if (MathUtils.ApproxEquals(d1, d2))\n                return 0;\n\n            return d1.CompareTo(d2);\n        }\n\n#if !(NET35 || NET20 || PORTABLE40)\n        private static bool Operation(ExpressionType operation, object objA, object objB, out object result)\n        {\n            if (objA is string || objB is string)\n            {\n                if (operation == ExpressionType.Add || operation == ExpressionType.AddAssign)\n                {\n                    result = ((objA != null) ? objA.ToString() : null) + ((objB != null) ? objB.ToString() : null);\n                    return true;\n                }\n            }\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (objA is BigInteger || objB is BigInteger)\n            {\n                if (objA == null || objB == null)\n                {\n                    result = null;\n                    return true;\n                }\n\n                // not that this will lose the fraction\n                // BigInteger doesn't have operators with non-integer types\n                BigInteger i1 = ConvertUtils.ToBigInteger(objA);\n                BigInteger i2 = ConvertUtils.ToBigInteger(objB);\n\n                switch (operation)\n                {\n                    case ExpressionType.Add:\n                    case ExpressionType.AddAssign:\n                        result = i1 + i2;\n                        return true;\n                    case ExpressionType.Subtract:\n                    case ExpressionType.SubtractAssign:\n                        result = i1 - i2;\n                        return true;\n                    case ExpressionType.Multiply:\n                    case ExpressionType.MultiplyAssign:\n                        result = i1 * i2;\n                        return true;\n                    case ExpressionType.Divide:\n                    case ExpressionType.DivideAssign:\n                        result = i1 / i2;\n                        return true;\n                }\n            }\n            else\n#endif\n                if (objA is ulong || objB is ulong || objA is decimal || objB is decimal)\n                {\n                    if (objA == null || objB == null)\n                    {\n                        result = null;\n                        return true;\n                    }\n\n                    decimal d1 = Convert.ToDecimal(objA, CultureInfo.InvariantCulture);\n                    decimal d2 = Convert.ToDecimal(objB, CultureInfo.InvariantCulture);\n\n                    switch (operation)\n                    {\n                        case ExpressionType.Add:\n                        case ExpressionType.AddAssign:\n                            result = d1 + d2;\n                            return true;\n                        case ExpressionType.Subtract:\n                        case ExpressionType.SubtractAssign:\n                            result = d1 - d2;\n                            return true;\n                        case ExpressionType.Multiply:\n                        case ExpressionType.MultiplyAssign:\n                            result = d1 * d2;\n                            return true;\n                        case ExpressionType.Divide:\n                        case ExpressionType.DivideAssign:\n                            result = d1 / d2;\n                            return true;\n                    }\n                }\n                else if (objA is float || objB is float || objA is double || objB is double)\n                {\n                    if (objA == null || objB == null)\n                    {\n                        result = null;\n                        return true;\n                    }\n\n                    double d1 = Convert.ToDouble(objA, CultureInfo.InvariantCulture);\n                    double d2 = Convert.ToDouble(objB, CultureInfo.InvariantCulture);\n\n                    switch (operation)\n                    {\n                        case ExpressionType.Add:\n                        case ExpressionType.AddAssign:\n                            result = d1 + d2;\n                            return true;\n                        case ExpressionType.Subtract:\n                        case ExpressionType.SubtractAssign:\n                            result = d1 - d2;\n                            return true;\n                        case ExpressionType.Multiply:\n                        case ExpressionType.MultiplyAssign:\n                            result = d1 * d2;\n                            return true;\n                        case ExpressionType.Divide:\n                        case ExpressionType.DivideAssign:\n                            result = d1 / d2;\n                            return true;\n                    }\n                }\n                else if (objA is int || objA is uint || objA is long || objA is short || objA is ushort || objA is sbyte || objA is byte ||\n                         objB is int || objB is uint || objB is long || objB is short || objB is ushort || objB is sbyte || objB is byte)\n                {\n                    if (objA == null || objB == null)\n                    {\n                        result = null;\n                        return true;\n                    }\n\n                    long l1 = Convert.ToInt64(objA, CultureInfo.InvariantCulture);\n                    long l2 = Convert.ToInt64(objB, CultureInfo.InvariantCulture);\n\n                    switch (operation)\n                    {\n                        case ExpressionType.Add:\n                        case ExpressionType.AddAssign:\n                            result = l1 + l2;\n                            return true;\n                        case ExpressionType.Subtract:\n                        case ExpressionType.SubtractAssign:\n                            result = l1 - l2;\n                            return true;\n                        case ExpressionType.Multiply:\n                        case ExpressionType.MultiplyAssign:\n                            result = l1 * l2;\n                            return true;\n                        case ExpressionType.Divide:\n                        case ExpressionType.DivideAssign:\n                            result = l1 / l2;\n                            return true;\n                    }\n                }\n\n            result = null;\n            return false;\n        }\n#endif\n\n        internal override JToken CloneToken()\n        {\n            return new JValue(this);\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JValue\"/> comment with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>A <see cref=\"JValue\"/> comment with the given value.</returns>\n        public static JValue CreateComment(string value)\n        {\n            return new JValue(value, JTokenType.Comment);\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JValue\"/> string with the given value.\n        /// </summary>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>A <see cref=\"JValue\"/> string with the given value.</returns>\n        public static JValue CreateString(string value)\n        {\n            return new JValue(value, JTokenType.String);\n        }\n\n        private static JTokenType GetValueType(JTokenType? current, object value)\n        {\n            if (value == null)\n                return JTokenType.Null;\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            else if (value == DBNull.Value)\n                return JTokenType.Null;\n#endif\n            else if (value is string)\n                return GetStringValueType(current);\n            else if (value is long || value is int || value is short || value is sbyte\n                     || value is ulong || value is uint || value is ushort || value is byte)\n                return JTokenType.Integer;\n            else if (value is Enum)\n                return JTokenType.Integer;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            else if (value is BigInteger)\n                return JTokenType.Integer;\n#endif\n            else if (value is double || value is float || value is decimal)\n                return JTokenType.Float;\n            else if (value is DateTime)\n                return JTokenType.Date;\n#if !NET20\n            else if (value is DateTimeOffset)\n                return JTokenType.Date;\n#endif\n            else if (value is byte[])\n                return JTokenType.Bytes;\n            else if (value is bool)\n                return JTokenType.Boolean;\n            else if (value is Guid)\n                return JTokenType.Guid;\n            else if (value is Uri)\n                return JTokenType.Uri;\n            else if (value is TimeSpan)\n                return JTokenType.TimeSpan;\n\n            throw new ArgumentException(\"Could not determine JSON object type for type {0}.\".FormatWith(CultureInfo.InvariantCulture, value.GetType()));\n        }\n\n        private static JTokenType GetStringValueType(JTokenType? current)\n        {\n            if (current == null)\n                return JTokenType.String;\n\n            switch (current.Value)\n            {\n                case JTokenType.Comment:\n                case JTokenType.String:\n                case JTokenType.Raw:\n                    return current.Value;\n                default:\n                    return JTokenType.String;\n            }\n        }\n\n        /// <summary>\n        /// Gets the node type for this <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <value>The type.</value>\n        public override JTokenType Type\n        {\n            get { return _valueType; }\n        }\n\n        /// <summary>\n        /// Gets or sets the underlying token value.\n        /// </summary>\n        /// <value>The underlying token value.</value>\n        public object Value\n        {\n            get { return _value; }\n            set\n            {\n                Type currentType = (_value != null) ? _value.GetType() : null;\n                Type newType = (value != null) ? value.GetType() : null;\n\n                if (currentType != newType)\n                    _valueType = GetValueType(_valueType, value);\n\n                _value = value;\n            }\n        }\n\n        /// <summary>\n        /// Writes this token to a <see cref=\"JsonWriter\"/>.\n        /// </summary>\n        /// <param name=\"writer\">A <see cref=\"JsonWriter\"/> into which this method will write.</param>\n        /// <param name=\"converters\">A collection of <see cref=\"JsonConverter\"/> which will be used when writing the token.</param>\n        public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)\n        {\n            if (converters != null && converters.Length > 0 && _value != null)\n            {\n                JsonConverter matchingConverter = JsonSerializer.GetMatchingConverter(converters, _value.GetType());\n                if (matchingConverter != null && matchingConverter.CanWrite)\n                {\n                    matchingConverter.WriteJson(writer, _value, JsonSerializer.CreateDefault());\n                    return;\n                }\n            }\n\n            switch (_valueType)\n            {\n                case JTokenType.Comment:\n                    writer.WriteComment((_value != null) ? _value.ToString() : null);\n                    return;\n                case JTokenType.Raw:\n                    writer.WriteRawValue((_value != null) ? _value.ToString() : null);\n                    return;\n                case JTokenType.Null:\n                    writer.WriteNull();\n                    return;\n                case JTokenType.Undefined:\n                    writer.WriteUndefined();\n                    return;\n                case JTokenType.Integer:\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n                    if (_value is BigInteger)\n                        writer.WriteValue((BigInteger)_value);\n                    else\n#endif\n                        writer.WriteValue(Convert.ToInt64(_value, CultureInfo.InvariantCulture));\n                    return;\n                case JTokenType.Float:\n                    if (_value is decimal)\n                        writer.WriteValue((decimal)_value);\n                    else if (_value is double)\n                        writer.WriteValue((double)_value);\n                    else if (_value is float)\n                        writer.WriteValue((float)_value);\n                    else\n                        writer.WriteValue(Convert.ToDouble(_value, CultureInfo.InvariantCulture));\n                    return;\n                case JTokenType.String:\n                    writer.WriteValue((_value != null) ? _value.ToString() : null);\n                    return;\n                case JTokenType.Boolean:\n                    writer.WriteValue(Convert.ToBoolean(_value, CultureInfo.InvariantCulture));\n                    return;\n                case JTokenType.Date:\n#if !NET20\n                    if (_value is DateTimeOffset)\n                        writer.WriteValue((DateTimeOffset)_value);\n                    else\n#endif\n                        writer.WriteValue(Convert.ToDateTime(_value, CultureInfo.InvariantCulture));\n                    return;\n                case JTokenType.Bytes:\n                    writer.WriteValue((byte[])_value);\n                    return;\n                case JTokenType.Guid:\n                case JTokenType.Uri:\n                case JTokenType.TimeSpan:\n                    writer.WriteValue((_value != null) ? _value.ToString() : null);\n                    return;\n            }\n\n            throw MiscellaneousUtils.CreateArgumentOutOfRangeException(\"TokenType\", _valueType, \"Unexpected token type.\");\n        }\n\n        internal override int GetDeepHashCode()\n        {\n            int valueHashCode = (_value != null) ? _value.GetHashCode() : 0;\n\n            return _valueType.GetHashCode() ^ valueHashCode;\n        }\n\n        private static bool ValuesEquals(JValue v1, JValue v2)\n        {\n            return (v1 == v2 || (v1._valueType == v2._valueType && Compare(v1._valueType, v1._value, v2._value) == 0));\n        }\n\n        /// <summary>\n        /// Indicates whether the current object is equal to another object of the same type.\n        /// </summary>\n        /// <returns>\n        /// true if the current object is equal to the <paramref name=\"other\"/> parameter; otherwise, false.\n        /// </returns>\n        /// <param name=\"other\">An object to compare with this object.</param>\n        public bool Equals(JValue other)\n        {\n            if (other == null)\n                return false;\n\n            return ValuesEquals(this, other);\n        }\n\n        /// <summary>\n        /// Determines whether the specified <see cref=\"T:System.Object\"/> is equal to the current <see cref=\"T:System.Object\"/>.\n        /// </summary>\n        /// <param name=\"obj\">The <see cref=\"T:System.Object\"/> to compare with the current <see cref=\"T:System.Object\"/>.</param>\n        /// <returns>\n        /// true if the specified <see cref=\"T:System.Object\"/> is equal to the current <see cref=\"T:System.Object\"/>; otherwise, false.\n        /// </returns>\n        /// <exception cref=\"T:System.NullReferenceException\">\n        /// The <paramref name=\"obj\"/> parameter is null.\n        /// </exception>\n        public override bool Equals(object obj)\n        {\n            if (obj == null)\n                return false;\n\n            JValue otherValue = obj as JValue;\n            if (otherValue != null)\n                return Equals(otherValue);\n\n            return base.Equals(obj);\n        }\n\n        /// <summary>\n        /// Serves as a hash function for a particular type.\n        /// </summary>\n        /// <returns>\n        /// A hash code for the current <see cref=\"T:System.Object\"/>.\n        /// </returns>\n        public override int GetHashCode()\n        {\n            if (_value == null)\n                return 0;\n\n            return _value.GetHashCode();\n        }\n\n        /// <summary>\n        /// Returns a <see cref=\"System.String\"/> that represents this instance.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"System.String\"/> that represents this instance.\n        /// </returns>\n        public override string ToString()\n        {\n            if (_value == null)\n                return string.Empty;\n\n            return _value.ToString();\n        }\n\n        /// <summary>\n        /// Returns a <see cref=\"System.String\"/> that represents this instance.\n        /// </summary>\n        /// <param name=\"format\">The format.</param>\n        /// <returns>\n        /// A <see cref=\"System.String\"/> that represents this instance.\n        /// </returns>\n        public string ToString(string format)\n        {\n            return ToString(format, CultureInfo.CurrentCulture);\n        }\n\n        /// <summary>\n        /// Returns a <see cref=\"System.String\"/> that represents this instance.\n        /// </summary>\n        /// <param name=\"formatProvider\">The format provider.</param>\n        /// <returns>\n        /// A <see cref=\"System.String\"/> that represents this instance.\n        /// </returns>\n        public string ToString(IFormatProvider formatProvider)\n        {\n            return ToString(null, formatProvider);\n        }\n\n        /// <summary>\n        /// Returns a <see cref=\"System.String\"/> that represents this instance.\n        /// </summary>\n        /// <param name=\"format\">The format.</param>\n        /// <param name=\"formatProvider\">The format provider.</param>\n        /// <returns>\n        /// A <see cref=\"System.String\"/> that represents this instance.\n        /// </returns>\n        public string ToString(string format, IFormatProvider formatProvider)\n        {\n            if (_value == null)\n                return string.Empty;\n\n            IFormattable formattable = _value as IFormattable;\n            if (formattable != null)\n                return formattable.ToString(format, formatProvider);\n            else\n                return _value.ToString();\n        }\n\n#if !(NET35 || NET20 || PORTABLE40)\n        /// <summary>\n        /// Returns the <see cref=\"T:System.Dynamic.DynamicMetaObject\"/> responsible for binding operations performed on this object.\n        /// </summary>\n        /// <param name=\"parameter\">The expression tree representation of the runtime value.</param>\n        /// <returns>\n        /// The <see cref=\"T:System.Dynamic.DynamicMetaObject\"/> to bind this object.\n        /// </returns>\n        protected override DynamicMetaObject GetMetaObject(Expression parameter)\n        {\n            return new DynamicProxyMetaObject<JValue>(parameter, this, new JValueDynamicProxy(), true);\n        }\n\n        private class JValueDynamicProxy : DynamicProxy<JValue>\n        {\n            public override bool TryConvert(JValue instance, ConvertBinder binder, out object result)\n            {\n                if (binder.Type == typeof(JValue))\n                {\n                    result = instance;\n                    return true;\n                }\n\n                object value = instance.Value;\n\n                if (value == null)\n                {\n                    result = null;\n                    return ReflectionUtils.IsNullable(binder.Type);\n                }\n\n                result = ConvertUtils.Convert(instance.Value, CultureInfo.InvariantCulture, binder.Type);\n                return true;\n            }\n\n            public override bool TryBinaryOperation(JValue instance, BinaryOperationBinder binder, object arg, out object result)\n            {\n                object compareValue = (arg is JValue) ? ((JValue)arg).Value : arg;\n\n                switch (binder.Operation)\n                {\n                    case ExpressionType.Equal:\n                        result = (Compare(instance.Type, instance.Value, compareValue) == 0);\n                        return true;\n                    case ExpressionType.NotEqual:\n                        result = (Compare(instance.Type, instance.Value, compareValue) != 0);\n                        return true;\n                    case ExpressionType.GreaterThan:\n                        result = (Compare(instance.Type, instance.Value, compareValue) > 0);\n                        return true;\n                    case ExpressionType.GreaterThanOrEqual:\n                        result = (Compare(instance.Type, instance.Value, compareValue) >= 0);\n                        return true;\n                    case ExpressionType.LessThan:\n                        result = (Compare(instance.Type, instance.Value, compareValue) < 0);\n                        return true;\n                    case ExpressionType.LessThanOrEqual:\n                        result = (Compare(instance.Type, instance.Value, compareValue) <= 0);\n                        return true;\n                    case ExpressionType.Add:\n                    case ExpressionType.AddAssign:\n                    case ExpressionType.Subtract:\n                    case ExpressionType.SubtractAssign:\n                    case ExpressionType.Multiply:\n                    case ExpressionType.MultiplyAssign:\n                    case ExpressionType.Divide:\n                    case ExpressionType.DivideAssign:\n                        if (Operation(binder.Operation, instance.Value, compareValue, out result))\n                        {\n                            result = new JValue(result);\n                            return true;\n                        }\n                        break;\n                }\n\n                result = null;\n                return false;\n            }\n        }\n#endif\n\n        int IComparable.CompareTo(object obj)\n        {\n            if (obj == null)\n                return 1;\n\n            object otherValue = (obj is JValue) ? ((JValue)obj).Value : obj;\n\n            return Compare(_valueType, _value, otherValue);\n        }\n\n        /// <summary>\n        /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.\n        /// </summary>\n        /// <param name=\"obj\">An object to compare with this instance.</param>\n        /// <returns>\n        /// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings:\n        /// Value\n        /// Meaning\n        /// Less than zero\n        /// This instance is less than <paramref name=\"obj\"/>.\n        /// Zero\n        /// This instance is equal to <paramref name=\"obj\"/>.\n        /// Greater than zero\n        /// This instance is greater than <paramref name=\"obj\"/>.\n        /// </returns>\n        /// <exception cref=\"T:System.ArgumentException\">\n        /// \t<paramref name=\"obj\"/> is not the same type as this instance.\n        /// </exception>\n        public int CompareTo(JValue obj)\n        {\n            if (obj == null)\n                return 1;\n\n            return Compare(_valueType, _value, obj._value);\n        }\n\n#if !(NETFX_CORE || PORTABLE)\n        TypeCode IConvertible.GetTypeCode()\n        {\n            if (_value == null)\n                return TypeCode.Empty;\n\n#if !NET20\n            if (_value is DateTimeOffset)\n                return TypeCode.DateTime;\n#endif\n#if !(NET20 || NET35 || PORTABLE40)\n            if (_value is BigInteger)\n                return TypeCode.Object;\n#endif\n\n            return System.Type.GetTypeCode(_value.GetType());\n        }\n\n        bool IConvertible.ToBoolean(IFormatProvider provider)\n        {\n            return (bool)this;\n        }\n\n        char IConvertible.ToChar(IFormatProvider provider)\n        {\n            return (char)this;\n        }\n\n        sbyte IConvertible.ToSByte(IFormatProvider provider)\n        {\n            return (sbyte)this;\n        }\n\n        byte IConvertible.ToByte(IFormatProvider provider)\n        {\n            return (byte)this;\n        }\n\n        short IConvertible.ToInt16(IFormatProvider provider)\n        {\n            return (short)this;\n        }\n\n        ushort IConvertible.ToUInt16(IFormatProvider provider)\n        {\n            return (ushort)this;\n        }\n\n        int IConvertible.ToInt32(IFormatProvider provider)\n        {\n            return (int)this;\n        }\n\n        uint IConvertible.ToUInt32(IFormatProvider provider)\n        {\n            return (uint)this;\n        }\n\n        long IConvertible.ToInt64(IFormatProvider provider)\n        {\n            return (long)this;\n        }\n\n        ulong IConvertible.ToUInt64(IFormatProvider provider)\n        {\n            return (ulong)this;\n        }\n\n        float IConvertible.ToSingle(IFormatProvider provider)\n        {\n            return (float)this;\n        }\n\n        double IConvertible.ToDouble(IFormatProvider provider)\n        {\n            return (double)this;\n        }\n\n        decimal IConvertible.ToDecimal(IFormatProvider provider)\n        {\n            return (decimal)this;\n        }\n\n        DateTime IConvertible.ToDateTime(IFormatProvider provider)\n        {\n            return (DateTime)this;\n        }\n\n        object IConvertible.ToType(Type conversionType, IFormatProvider provider)\n        {\n            return ToObject(conversionType);\n        }\n#endif\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JsonPath/ArrayIndexFilter.cs",
    "content": "using System.Collections.Generic;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Linq.JsonPath\n{\n    internal class ArrayIndexFilter : PathFilter\n    {\n        public int? Index { get; set; }\n\n        public override IEnumerable<JToken> ExecuteFilter(IEnumerable<JToken> current, bool errorWhenNoMatch)\n        {\n            foreach (JToken t in current)\n            {\n                if (Index != null)\n                {\n                    JToken v = GetTokenIndex(t, errorWhenNoMatch, Index.Value);\n\n                    if (v != null)\n                        yield return v;\n                }\n                else\n                {\n                    if (t is JArray || t is JConstructor)\n                    {\n                        foreach (JToken v in t)\n                        {\n                            yield return v;\n                        }\n                    }\n                    else\n                    {\n                        if (errorWhenNoMatch)\n                            throw new JsonException(\"Index * not valid on {0}.\".FormatWith(CultureInfo.InvariantCulture, t.GetType().Name));\n                    }\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JsonPath/ArrayMultipleIndexFilter.cs",
    "content": "using System.Collections.Generic;\n\nnamespace Newtonsoft.Json.Linq.JsonPath\n{\n    internal class ArrayMultipleIndexFilter : PathFilter\n    {\n        public List<int> Indexes { get; set; }\n\n        public override IEnumerable<JToken> ExecuteFilter(IEnumerable<JToken> current, bool errorWhenNoMatch)\n        {\n            foreach (JToken t in current)\n            {\n                foreach (int i in Indexes)\n                {\n                    JToken v = GetTokenIndex(t, errorWhenNoMatch, i);\n\n                    if (v != null)\n                        yield return v;\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JsonPath/ArraySliceFilter.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Linq.JsonPath\n{\n    internal class ArraySliceFilter : PathFilter\n    {\n        public int? Start { get; set; }\n        public int? End { get; set; }\n        public int? Step { get; set; }\n\n        public override IEnumerable<JToken> ExecuteFilter(IEnumerable<JToken> current, bool errorWhenNoMatch)\n        {\n            if (Step == 0)\n                throw new JsonException(\"Step cannot be zero.\");\n\n            foreach (JToken t in current)\n            {\n                JArray a = t as JArray;\n                if (a != null)\n                {\n                    // set defaults for null arguments\n                    int stepCount = Step ?? 1;\n                    int startIndex = Start ?? ((stepCount > 0) ? 0 : a.Count - 1);\n                    int stopIndex = End ?? ((stepCount > 0) ? a.Count : -1);\n\n                    // start from the end of the list if start is negitive\n                    if (Start < 0) startIndex = a.Count + startIndex;\n\n                    // end from the start of the list if stop is negitive\n                    if (End < 0) stopIndex = a.Count + stopIndex;\n\n                    // ensure indexes keep within collection bounds\n                    startIndex = Math.Max(startIndex, (stepCount > 0) ? 0 : int.MinValue);\n                    startIndex = Math.Min(startIndex, (stepCount > 0) ? a.Count : a.Count - 1);\n                    stopIndex = Math.Max(stopIndex, -1);\n                    stopIndex = Math.Min(stopIndex, a.Count);\n\n                    bool positiveStep = (stepCount > 0);\n\n                    if (IsValid(startIndex, stopIndex, positiveStep))\n                    {\n                        for (int i = startIndex; IsValid(i, stopIndex, positiveStep); i += stepCount)\n                        {\n                            yield return a[i];\n                        }\n                    }\n                    else\n                    {\n                        if (errorWhenNoMatch)\n                            throw new JsonException(\"Array slice of {0} to {1} returned no results.\".FormatWith(CultureInfo.InvariantCulture,\n                                Start != null ? Start.Value.ToString(CultureInfo.InvariantCulture) : \"*\",\n                                End != null ? End.Value.ToString(CultureInfo.InvariantCulture) : \"*\"));\n                    }\n                }\n                else\n                {\n                    if (errorWhenNoMatch)\n                        throw new JsonException(\"Array slice is not valid on {0}.\".FormatWith(CultureInfo.InvariantCulture, t.GetType().Name));\n                }\n            }\n        }\n\n        private bool IsValid(int index, int stopIndex, bool positiveStep)\n        {\n            if (positiveStep)\n                return (index < stopIndex);\n\n            return (index > stopIndex);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JsonPath/FieldFilter.cs",
    "content": "using System.Collections.Generic;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Linq.JsonPath\n{\n    internal class FieldFilter : PathFilter\n    {\n        public string Name { get; set; }\n\n        public override IEnumerable<JToken> ExecuteFilter(IEnumerable<JToken> current, bool errorWhenNoMatch)\n        {\n            foreach (JToken t in current)\n            {\n                JObject o = t as JObject;\n                if (o != null)\n                {\n                    if (Name != null)\n                    {\n                        JToken v = o[Name];\n\n                        if (v != null)\n                            yield return v;\n                        else if (errorWhenNoMatch)\n                            throw new JsonException(\"Property '{0}' does not exist on JObject.\".FormatWith(CultureInfo.InvariantCulture, Name));\n                    }\n                    else\n                    {\n                        foreach (KeyValuePair<string, JToken> p in o)\n                        {\n                            yield return p.Value;\n                        }\n                    }\n                }\n                else\n                {\n                    if (errorWhenNoMatch)\n                        throw new JsonException(\"Property '{0}' not valid on {1}.\".FormatWith(CultureInfo.InvariantCulture, Name ?? \"*\", t.GetType().Name));\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JsonPath/FieldMultipleFilter.cs",
    "content": "using System.Collections.Generic;\nusing System.Globalization;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Linq.JsonPath\n{\n    internal class FieldMultipleFilter : PathFilter\n    {\n        public List<string> Names { get; set; }\n\n        public override IEnumerable<JToken> ExecuteFilter(IEnumerable<JToken> current, bool errorWhenNoMatch)\n        {\n            foreach (JToken t in current)\n            {\n                JObject o = t as JObject;\n                if (o != null)\n                {\n                    foreach (string name in Names)\n                    {\n                        JToken v = o[name];\n\n                        if (v != null)\n                            yield return v;\n\n                        if (errorWhenNoMatch)\n                            throw new JsonException(\"Property '{0}' does not exist on JObject.\".FormatWith(CultureInfo.InvariantCulture, name));\n                    }\n                }\n                else\n                {\n                    if (errorWhenNoMatch)\n                        throw new JsonException(\"Properties {0} not valid on {1}.\".FormatWith(CultureInfo.InvariantCulture, string.Join(\", \", Names.Select(n => \"'\" + n + \"'\").ToArray()), t.GetType().Name));\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JsonPath/JPath.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Text;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Linq.JsonPath\n{\n    internal class JPath\n    {\n        private readonly string _expression;\n        public List<PathFilter> Filters { get; private set; }\n\n        private int _currentIndex;\n\n        public JPath(string expression)\n        {\n            ValidationUtils.ArgumentNotNull(expression, \"expression\");\n            _expression = expression;\n            Filters = new List<PathFilter>();\n\n            ParseMain();\n        }\n\n        private void ParseMain()\n        {\n            int currentPartStartIndex = _currentIndex;\n\n            EatWhitespace();\n\n            if (_expression.Length == _currentIndex)\n                return;\n\n            if (_expression[_currentIndex] == '$')\n            {\n                if (_expression.Length == 1)\n                    return;\n\n                // only increment position for \"$.\" or \"$[\"\n                // otherwise assume property that starts with $\n                char c = _expression[_currentIndex + 1];\n                if (c == '.' || c == '[')\n                {\n                    _currentIndex++;\n                    currentPartStartIndex = _currentIndex;\n                }\n            }\n\n            if (!ParsePath(Filters, currentPartStartIndex, false))\n            {\n                int lastCharacterIndex = _currentIndex;\n\n                EatWhitespace();\n\n                if (_currentIndex < _expression.Length)\n                    throw new JsonException(\"Unexpected character while parsing path: \" + _expression[lastCharacterIndex]);\n            }\n        }\n\n        private bool ParsePath(List<PathFilter> filters, int currentPartStartIndex, bool query)\n        {\n            bool scan = false;\n            bool followingIndexer = false;\n            bool followingDot = false;\n\n            bool ended = false;\n            while (_currentIndex < _expression.Length && !ended)\n            {\n                char currentChar = _expression[_currentIndex];\n\n                switch (currentChar)\n                {\n                    case '[':\n                    case '(':\n                        if (_currentIndex > currentPartStartIndex)\n                        {\n                            string member = _expression.Substring(currentPartStartIndex, _currentIndex - currentPartStartIndex);\n                            PathFilter filter = (scan) ? (PathFilter)new ScanFilter() { Name = member } : new FieldFilter() { Name = member };\n                            filters.Add(filter);\n                            scan = false;\n                        }\n\n                        filters.Add(ParseIndexer(currentChar));\n                        _currentIndex++;\n                        currentPartStartIndex = _currentIndex;\n                        followingIndexer = true;\n                        followingDot = false;\n                        break;\n                    case ']':\n                    case ')':\n                        ended = true;\n                        break;\n                    case ' ':\n                        //EatWhitespace();\n                        if (_currentIndex < _expression.Length)\n                            ended = true;\n                        break;\n                    case '.':\n                        if (_currentIndex > currentPartStartIndex)\n                        {\n                            string member = _expression.Substring(currentPartStartIndex, _currentIndex - currentPartStartIndex);\n                            if (member == \"*\")\n                                member = null;\n                            PathFilter filter = (scan) ? (PathFilter)new ScanFilter() { Name = member } : new FieldFilter() { Name = member };\n                            filters.Add(filter);\n                            scan = false;\n                        }\n                        if (_currentIndex + 1 < _expression.Length && _expression[_currentIndex + 1] == '.')\n                        {\n                            scan = true;\n                            _currentIndex++;\n                        }\n                        _currentIndex++;\n                        currentPartStartIndex = _currentIndex;\n                        followingIndexer = false;\n                        followingDot = true;\n                        break;\n                    default:\n                        if (query && (currentChar == '=' || currentChar == '<' || currentChar == '!' || currentChar == '>' || currentChar == '|' || currentChar == '&'))\n                        {\n                            ended = true;\n                        }\n                        else\n                        {\n                            if (followingIndexer)\n                                throw new JsonException(\"Unexpected character following indexer: \" + currentChar);\n\n                            _currentIndex++;\n                        }\n                        break;\n                }\n            }\n\n            bool atPathEnd = (_currentIndex == _expression.Length);\n\n            if (_currentIndex > currentPartStartIndex)\n            {\n                string member = _expression.Substring(currentPartStartIndex, _currentIndex - currentPartStartIndex).TrimEnd();\n                if (member == \"*\")\n                    member = null;\n                PathFilter filter = (scan) ? (PathFilter)new ScanFilter() { Name = member } : new FieldFilter() { Name = member };\n                filters.Add(filter);\n            }\n            else\n            {\n                // no field name following dot in path and at end of base path/query\n                if (followingDot && (atPathEnd || query))\n                    throw new JsonException(\"Unexpected end while parsing path.\");\n            }\n\n            return atPathEnd;\n        }\n\n        private PathFilter ParseIndexer(char indexerOpenChar)\n        {\n            _currentIndex++;\n\n            char indexerCloseChar = (indexerOpenChar == '[') ? ']' : ')';\n\n            EnsureLength(\"Path ended with open indexer.\");\n\n            EatWhitespace();\n\n            if (_expression[_currentIndex] == '\\'')\n            {\n                return ParseQuotedField(indexerCloseChar);\n            }\n            else if (_expression[_currentIndex] == '?')\n            {\n                return ParseQuery(indexerCloseChar);\n            }\n            else\n            {\n                return ParseArrayIndexer(indexerCloseChar);\n            }\n        }\n\n        private PathFilter ParseArrayIndexer(char indexerCloseChar)\n        {\n            int start = _currentIndex;\n            int? end = null;\n            List<int> indexes = null;\n            int colonCount = 0;\n            int? startIndex = null;\n            int? endIndex = null;\n            int? step = null;\n\n            while (_currentIndex < _expression.Length)\n            {\n                char currentCharacter = _expression[_currentIndex];\n\n                if (currentCharacter == ' ')\n                {\n                    end = _currentIndex;\n                    EatWhitespace();\n                    continue;\n                }\n\n                if (currentCharacter == indexerCloseChar)\n                {\n                    int length = (end ?? _currentIndex) - start;\n\n                    if (indexes != null)\n                    {\n                        if (length == 0)\n                            throw new JsonException(\"Array index expected.\");\n\n                        string indexer = _expression.Substring(start, length);\n                        int index = Convert.ToInt32(indexer, CultureInfo.InvariantCulture);\n\n                        indexes.Add(index);\n                        return new ArrayMultipleIndexFilter { Indexes = indexes };\n                    }\n                    else if (colonCount > 0)\n                    {\n                        if (length > 0)\n                        {\n                            string indexer = _expression.Substring(start, length);\n                            int index = Convert.ToInt32(indexer, CultureInfo.InvariantCulture);\n\n                            if (colonCount == 1)\n                                endIndex = index;\n                            else\n                                step = index;\n                        }\n\n                        return new ArraySliceFilter { Start = startIndex, End = endIndex, Step = step };\n                    }\n                    else\n                    {\n                        if (length == 0)\n                            throw new JsonException(\"Array index expected.\");\n\n                        string indexer = _expression.Substring(start, length);\n                        int index = Convert.ToInt32(indexer, CultureInfo.InvariantCulture);\n\n                        return new ArrayIndexFilter { Index = index };\n                    }\n                } else if (currentCharacter == ',')\n                {\n                    int length = (end ?? _currentIndex) - start;\n\n                    if (length == 0)\n                        throw new JsonException(\"Array index expected.\");\n\n                    if (indexes == null)\n                        indexes = new List<int>();\n\n                    string indexer = _expression.Substring(start, length);\n                    indexes.Add(Convert.ToInt32(indexer, CultureInfo.InvariantCulture));\n\n                    _currentIndex++;\n\n                    EatWhitespace();\n\n                    start = _currentIndex;\n                    end = null;\n                }\n                else if (currentCharacter == '*')\n                {\n                    _currentIndex++;\n                    EnsureLength(\"Path ended with open indexer.\");\n                    EatWhitespace();\n\n                    if (_expression[_currentIndex] != indexerCloseChar)\n                        throw new JsonException(\"Unexpected character while parsing path indexer: \" + currentCharacter);\n\n                    return new ArrayIndexFilter();\n                }\n                else if (currentCharacter == ':')\n                {\n                    int length = (end ?? _currentIndex) - start;\n\n                    if (length > 0)\n                    {\n                        string indexer = _expression.Substring(start, length);\n                        int index = Convert.ToInt32(indexer, CultureInfo.InvariantCulture);\n\n                        if (colonCount == 0)\n                            startIndex = index;\n                        else if (colonCount == 1)\n                            endIndex = index;\n                        else\n                            step = index;\n                    }\n\n                    colonCount++;\n\n                    _currentIndex++;\n\n                    EatWhitespace();\n\n                    start = _currentIndex;\n                    end = null;\n                }\n                else if (!char.IsDigit(currentCharacter) && currentCharacter != '-')\n                {\n                    throw new JsonException(\"Unexpected character while parsing path indexer: \" + currentCharacter);\n                }\n                else\n                {\n                    if (end != null)\n                        throw new JsonException(\"Unexpected character while parsing path indexer: \" + currentCharacter);\n\n                    _currentIndex++;\n                }\n\n            }\n\n            throw new JsonException(\"Path ended with open indexer.\");\n        }\n\n        private void EatWhitespace()\n        {\n            while (_currentIndex < _expression.Length)\n            {\n                if (_expression[_currentIndex] != ' ')\n                    break;\n\n                _currentIndex++;\n            }\n        }\n\n        private PathFilter ParseQuery(char indexerCloseChar)\n        {\n            _currentIndex++;\n            EnsureLength(\"Path ended with open indexer.\");\n\n            if (_expression[_currentIndex] != '(')\n                throw new JsonException(\"Unexpected character while parsing path indexer: \" + _expression[_currentIndex]);\n\n            _currentIndex++;\n\n            QueryExpression expression = ParseExpression();\n\n            _currentIndex++;\n            EnsureLength(\"Path ended with open indexer.\");\n            EatWhitespace();\n\n            if (_expression[_currentIndex] != indexerCloseChar)\n                throw new JsonException(\"Unexpected character while parsing path indexer: \" + _expression[_currentIndex]);\n\n            return new QueryFilter\n            {\n                Expression = expression\n            };\n        }\n\n        private QueryExpression ParseExpression()\n        {\n            QueryExpression rootExpression = null;\n            CompositeExpression parentExpression = null;\n\n            while (_currentIndex < _expression.Length)\n            {\n                EatWhitespace();\n\n                if (_expression[_currentIndex] != '@')\n                    throw new JsonException(\"Unexpected character while parsing path query: \" + _expression[_currentIndex]);\n\n                _currentIndex++;\n\n                List<PathFilter> expressionPath = new List<PathFilter>();\n\n                if (ParsePath(expressionPath, _currentIndex, true))\n                    throw new JsonException(\"Path ended with open query.\");\n\n                EatWhitespace();\n                EnsureLength(\"Path ended with open query.\");\n\n                QueryOperator op;\n                object value = null;\n                if (_expression[_currentIndex] == ')'\n                    || _expression[_currentIndex] == '|'\n                    || _expression[_currentIndex] == '&')\n                {\n                    op = QueryOperator.Exists;\n                }\n                else\n                {\n                    op = ParseOperator();\n\n                    EatWhitespace();\n                    EnsureLength(\"Path ended with open query.\");\n\n                    value = ParseValue();\n\n                    EatWhitespace();\n                    EnsureLength(\"Path ended with open query.\");\n                }\n\n                BooleanQueryExpression booleanExpression = new BooleanQueryExpression\n                {\n                    Path = expressionPath,\n                    Operator = op,\n                    Value = (op != QueryOperator.Exists) ? new JValue(value) : null\n                };\n\n                if (_expression[_currentIndex] == ')')\n                {\n                    if (parentExpression != null)\n                    {\n                        parentExpression.Expressions.Add(booleanExpression);\n                        return rootExpression;\n                    }\n                    \n                    return booleanExpression;\n                }\n                if (_expression[_currentIndex] == '&' && Match(\"&&\"))\n                {\n                    if (parentExpression == null || parentExpression.Operator != QueryOperator.And)\n                    {\n                        CompositeExpression andExpression = new CompositeExpression { Operator = QueryOperator.And };\n\n                        if (parentExpression != null)\n                            parentExpression.Expressions.Add(andExpression);\n\n                        parentExpression = andExpression;\n\n                        if (rootExpression == null)\n                            rootExpression = parentExpression;\n                    }\n\n                    parentExpression.Expressions.Add(booleanExpression);\n                }\n                if (_expression[_currentIndex] == '|' && Match(\"||\"))\n                {\n                    if (parentExpression == null || parentExpression.Operator != QueryOperator.Or)\n                    {\n                        CompositeExpression orExpression = new CompositeExpression { Operator = QueryOperator.Or };\n\n                        if (parentExpression != null)\n                            parentExpression.Expressions.Add(orExpression);\n\n                        parentExpression = orExpression;\n\n                        if (rootExpression == null)\n                            rootExpression = parentExpression;\n                    }\n\n                    parentExpression.Expressions.Add(booleanExpression);\n                }\n            }\n\n            throw new JsonException(\"Path ended with open query.\");\n        }\n\n        private object ParseValue()\n        {\n            char currentChar = _expression[_currentIndex];\n            if (currentChar == '\\'')\n            {\n                return ReadQuotedString();\n            }\n            else if (char.IsDigit(currentChar) || currentChar == '-')\n            {\n                StringBuilder sb = new StringBuilder();\n                sb.Append(currentChar);\n\n                _currentIndex++;\n                while (_currentIndex < _expression.Length)\n                {\n                    currentChar = _expression[_currentIndex];\n                    if (currentChar == ' ' || currentChar == ')')\n                    {\n                        string numberText = sb.ToString();\n\n                        if (numberText.IndexOfAny(new char[] { '.', 'E', 'e' }) != -1)\n                        {\n                            double d;\n                            if (double.TryParse(numberText, NumberStyles.Float | NumberStyles.AllowThousands, CultureInfo.InvariantCulture, out d))\n                                return d;\n                            else\n                                throw new JsonException(\"Could not read query value.\");\n                        }\n                        else\n                        {\n                            long l;\n                            if (long.TryParse(numberText, NumberStyles.Integer, CultureInfo.InvariantCulture, out l))\n                                return l;\n                            else\n                                throw new JsonException(\"Could not read query value.\");\n                        }\n                    }\n                    else\n                    {\n                        sb.Append(currentChar);\n                        _currentIndex++;\n                    }\n                }\n            }\n            else if (currentChar == 't')\n            {\n                if (Match(\"true\"))\n                    return true;\n            }\n            else if (currentChar == 'f')\n            {\n                if (Match(\"false\"))\n                    return false;\n            }\n            else if (currentChar == 'n')\n            {\n                if (Match(\"null\"))\n                    return null;\n            }\n\n            throw new JsonException(\"Could not read query value.\");\n        }\n\n        private string ReadQuotedString()\n        {\n            StringBuilder sb = new StringBuilder();\n\n            _currentIndex++;\n            while (_currentIndex < _expression.Length)\n            {\n                char currentChar = _expression[_currentIndex];\n                if (currentChar == '\\\\' && _currentIndex + 1 < _expression.Length)\n                {\n                    _currentIndex++;\n\n                    if (_expression[_currentIndex] == '\\'')\n                        sb.Append('\\'');\n                    else if (_expression[_currentIndex] == '\\\\')\n                        sb.Append('\\\\');\n                    else\n                        throw new JsonException(@\"Unknown escape chracter: \\\" + _expression[_currentIndex]);\n\n                    _currentIndex++;\n                }\n                else if (currentChar == '\\'')\n                {\n                    _currentIndex++;\n                    {\n                        return sb.ToString();\n                    }\n                }\n                else\n                {\n                    _currentIndex++;\n                    sb.Append(currentChar);\n                }\n            }\n\n            throw new JsonException(\"Path ended with an open string.\");\n        }\n\n        private bool Match(string s)\n        {\n            int currentPosition = _currentIndex;\n            foreach (char c in s)\n            {\n                if (currentPosition < _expression.Length && _expression[currentPosition] == c)\n                    currentPosition++;\n                else\n                    return false;\n            }\n\n            _currentIndex = currentPosition;\n            return true;\n        }\n\n        private QueryOperator ParseOperator()\n        {\n            if (_currentIndex + 1 >= _expression.Length)\n                throw new JsonException(\"Path ended with open query.\");\n\n            if (Match(\"==\"))\n                return QueryOperator.Equals;\n            if (Match(\"!=\") || Match(\"<>\"))\n                return QueryOperator.NotEquals;\n            if (Match(\"<=\"))\n                return QueryOperator.LessThanOrEquals;\n            if (Match(\"<\"))\n                return QueryOperator.LessThan;\n            if (Match(\">=\"))\n                return QueryOperator.GreaterThanOrEquals;\n            if (Match(\">\"))\n                return QueryOperator.GreaterThan;\n\n            throw new JsonException(\"Could not read query operator.\");\n        }\n\n        private PathFilter ParseQuotedField(char indexerCloseChar)\n        {\n            //_currentIndex++;\n            //int start = _currentIndex;\n\n            List<string> fields = null;\n\n            while (_currentIndex < _expression.Length)\n            {\n                string field = ReadQuotedString();\n\n                //_currentIndex++;\n                //EnsureLength(\"Path ended with open indexer.\");\n                EatWhitespace();\n                EnsureLength(\"Path ended with open indexer.\");\n\n                if (_expression[_currentIndex] == indexerCloseChar)\n                {\n                    _currentIndex++;\n\n                    if (fields != null)\n                    {\n                        fields.Add(field);\n                        return new FieldMultipleFilter { Names = fields };\n                    }\n                    else\n                    {\n                        return new FieldFilter { Name = field };\n                    }\n                }\n                else if (_expression[_currentIndex] == ',')\n                {\n                    _currentIndex++;\n                    EatWhitespace();\n\n                    if (fields == null)\n                        fields = new List<string>();\n\n                    fields.Add(field);\n                }\n                else\n                {\n                    throw new JsonException(\"Unexpected character while parsing path indexer: \" + _expression[_currentIndex]);\n                }\n            }\n\n            throw new JsonException(\"Path ended with open indexer.\");\n        }\n\n        private void EnsureLength(string message)\n        {\n            if (_currentIndex >= _expression.Length)\n                throw new JsonException(message);\n        }\n\n        internal IEnumerable<JToken> Evaluate(JToken t, bool errorWhenNoMatch)\n        {\n            return Evaluate(Filters, t, errorWhenNoMatch);\n        }\n\n        internal static IEnumerable<JToken> Evaluate(List<PathFilter> filters, JToken t, bool errorWhenNoMatch)\n        {\n            IEnumerable<JToken> current = new[] { t };\n            foreach (PathFilter filter in filters)\n            {\n                current = filter.ExecuteFilter(current, errorWhenNoMatch);\n            }\n\n            return current;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JsonPath/PathFilter.cs",
    "content": "using System.Collections.Generic;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Linq.JsonPath\n{\n    internal abstract class PathFilter\n    {\n        public abstract IEnumerable<JToken> ExecuteFilter(IEnumerable<JToken> current, bool errorWhenNoMatch);\n\n        protected static JToken GetTokenIndex(JToken t, bool errorWhenNoMatch, int index)\n        {\n            JArray a = t as JArray;\n            JConstructor c = t as JConstructor;\n\n            if (a != null)\n            {\n                if (a.Count <= index)\n                {\n                    if (errorWhenNoMatch)\n                        throw new JsonException(\"Index {0} outside the bounds of JArray.\".FormatWith(CultureInfo.InvariantCulture, index));\n\n                    return null;\n                }\n\n                return a[index];\n            }\n            else if (c != null)\n            {\n                if (c.Count <= index)\n                {\n                    if (errorWhenNoMatch)\n                        throw new JsonException(\"Index {0} outside the bounds of JConstructor.\".FormatWith(CultureInfo.InvariantCulture, index));\n\n                    return null;\n                }\n\n                return c[index];\n            }\n            else\n            {\n                if (errorWhenNoMatch)\n                    throw new JsonException(\"Index {0} not valid on {1}.\".FormatWith(CultureInfo.InvariantCulture, index, t.GetType().Name));\n\n                return null;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JsonPath/QueryExpression.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Newtonsoft.Json.Linq.JsonPath\n{\n    internal enum QueryOperator\n    {\n        None,\n        Equals,\n        NotEquals,\n        Exists,\n        LessThan,\n        LessThanOrEquals,\n        GreaterThan,\n        GreaterThanOrEquals,\n        And,\n        Or\n    }\n\n    internal abstract class QueryExpression\n    {\n        public QueryOperator Operator { get; set; }\n\n        public abstract bool IsMatch(JToken t);\n    }\n\n    internal class CompositeExpression : QueryExpression\n    {\n        public List<QueryExpression> Expressions { get; set; }\n\n        public CompositeExpression()\n        {\n            Expressions = new List<QueryExpression>();\n        }\n\n        public override bool IsMatch(JToken t)\n        {\n            switch (Operator)\n            {\n                case QueryOperator.And:\n                    foreach (QueryExpression e in Expressions)\n                    {\n                        if (!e.IsMatch(t))\n                            return false;\n                    }\n                    return true;\n                case QueryOperator.Or:\n                    foreach (QueryExpression e in Expressions)\n                    {\n                        if (e.IsMatch(t))\n                            return true;\n                    }\n                    return false;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n    }\n\n    internal class BooleanQueryExpression : QueryExpression\n    {\n        public List<PathFilter> Path { get; set; }\n        public JValue Value { get; set; }\n\n        public override bool IsMatch(JToken t)\n        {\n            IEnumerable<JToken> pathResult = JPath.Evaluate(Path, t, false);\n\n            foreach (JToken r in pathResult)\n            {\n                JValue v = r as JValue;\n                switch (Operator)\n                {\n                    case QueryOperator.Equals:\n                        if (v != null && v.Equals(Value))\n                            return true;\n                        break;\n                    case QueryOperator.NotEquals:\n                        if (v != null && !v.Equals(Value))\n                            return true;\n                        break;\n                    case QueryOperator.GreaterThan:\n                        if (v != null && v.CompareTo(Value) > 0)\n                            return true;\n                        break;\n                    case QueryOperator.GreaterThanOrEquals:\n                        if (v != null && v.CompareTo(Value) >= 0)\n                            return true;\n                        break;\n                    case QueryOperator.LessThan:\n                        if (v != null && v.CompareTo(Value) < 0)\n                            return true;\n                        break;\n                    case QueryOperator.LessThanOrEquals:\n                        if (v != null && v.CompareTo(Value) <= 0)\n                            return true;\n                        break;\n                    case QueryOperator.Exists:\n                        return true;\n                    default:\n                        throw new ArgumentOutOfRangeException();\n                }\n            }\n\n            return false;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JsonPath/QueryFilter.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Newtonsoft.Json.Linq.JsonPath\n{\n    internal class QueryFilter : PathFilter\n    {\n        public QueryExpression Expression { get; set; }\n\n        public override IEnumerable<JToken> ExecuteFilter(IEnumerable<JToken> current, bool errorWhenNoMatch)\n        {\n            foreach (JToken t in current)\n            {\n                foreach (JToken v in t)\n                {\n                    if (Expression.IsMatch(v))\n                        yield return v;\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Linq/JsonPath/ScanFilter.cs",
    "content": "using System.Collections.Generic;\n\nnamespace Newtonsoft.Json.Linq.JsonPath\n{\n    internal class ScanFilter : PathFilter\n    {\n        public string Name { get; set; }\n\n        public override IEnumerable<JToken> ExecuteFilter(IEnumerable<JToken> current, bool errorWhenNoMatch)\n        {\n            foreach (JToken root in current)\n            {\n                if (Name == null)\n                    yield return root;\n\n                JToken value = root;\n                JToken container = root;\n\n                while (true)\n                {\n                    if (container != null)\n                    {\n                        value = container.First;\n                    }\n                    else\n                    {\n                        while (value != null && value != root && value == value.Parent.Last)\n                        {\n                            value = value.Parent;\n                        }\n\n                        if (value == null || value == root)\n                            break;\n\n                        value = value.Next;\n                    }\n\n                    JProperty e = value as JProperty;\n                    if (e != null)\n                    {\n                        if (e.Name == Name)\n                            yield return e.Value;\n                    }\n                    else\n                    {\n                        if (Name == null)\n                            yield return value;\n                    }\n\n                    container = value as JContainer;\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/MemberSerialization.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Runtime.Serialization;\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies the member serialization options for the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public enum MemberSerialization\n    {\n#pragma warning disable 1584,1711,1572,1581,1580,1574\n        /// <summary>\n        /// All public members are serialized by default. Members can be excluded using <see cref=\"JsonIgnoreAttribute\"/> or <see cref=\"NonSerializedAttribute\"/>.\n        /// This is the default member serialization mode.\n        /// </summary>\n        OptOut,\n\n        /// <summary>\n        /// Only members must be marked with <see cref=\"JsonPropertyAttribute\"/> or <see cref=\"DataMemberAttribute\"/> are serialized.\n        /// This member serialization mode can also be set by marking the class with <see cref=\"DataContractAttribute\"/>.\n        /// </summary>\n        OptIn,\n\n        /// <summary>\n        /// All public and private fields are serialized. Members can be excluded using <see cref=\"JsonIgnoreAttribute\"/> or <see cref=\"NonSerializedAttribute\"/>.\n        /// This member serialization mode can also be set by marking the class with <see cref=\"SerializableAttribute\"/>\n        /// and setting IgnoreSerializableAttribute on <see cref=\"DefaultContractResolver\"/> to false.\n        /// </summary>\n        Fields\n#pragma warning restore 1584,1711,1572,1581,1580,1574\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/MetadataPropertyHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies metadata property handling options for the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public enum MetadataPropertyHandling\n    {\n        /// <summary>\n        /// Read metadata properties located at the start of a JSON object.\n        /// </summary>\n        Default = 0,\n\n        /// <summary>\n        /// Read metadata properties located anywhere in a JSON object. Note that this setting will impact performance.\n        /// </summary>\n        ReadAhead = 1,\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/MissingMemberHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies missing member handling options for the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public enum MissingMemberHandling\n    {\n        /// <summary>\n        /// Ignore a missing member and do not attempt to deserialize it.\n        /// </summary>\n        Ignore = 0,\n\n        /// <summary>\n        /// Throw a <see cref=\"JsonSerializationException\"/> when a missing member is encountered during deserialization.\n        /// </summary>\n        Error = 1\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Newtonsoft.Json.Net40.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>9.0.30729</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Newtonsoft.Json</RootNamespace>\n    <AssemblyName>Newtonsoft.Json</AssemblyName>\n    <SignAssembly>false</SignAssembly>\n    <AssemblyOriginatorKeyFile>\n    </AssemblyOriginatorKeyFile>\n    <SccProjectName>\n    </SccProjectName>\n    <SccLocalPath>\n    </SccLocalPath>\n    <SccAuxPath>\n    </SccAuxPath>\n    <SccProvider>\n    </SccProvider>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <OldToolsVersion>3.5</OldToolsVersion>\n    <UpgradeBackupLocation>\n    </UpgradeBackupLocation>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n    <TargetFrameworkProfile>Client</TargetFrameworkProfile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\Net40\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;NET40;CODE_ANALYSIS</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Debug\\Net40\\Newtonsoft.Json.xml</DocumentationFile>\n    <RunCodeAnalysis>true</RunCodeAnalysis>\n    <CodeAnalysisRules>\n    </CodeAnalysisRules>\n    <CodeAnalysisRuleSet>Newtonsoft.Json.ruleset</CodeAnalysisRuleSet>\n    <UseVSHostingProcess>true</UseVSHostingProcess>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\Net40\\</OutputPath>\n    <DefineConstants>TRACE;NET40;CODE_ANALYSIS</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Release\\Net40\\Newtonsoft.Json.xml</DocumentationFile>\n    <CodeAnalysisRuleSet>Newtonsoft.Json.ruleset</CodeAnalysisRuleSet>\n    <UseVSHostingProcess>true</UseVSHostingProcess>\n    <RunCodeAnalysis>true</RunCodeAnalysis>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\">\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Numerics\" />\n    <Reference Include=\"System.Runtime.Serialization\">\n      <RequiredTargetFramework>3.0</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"System.Xml.Linq\">\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Bson\\BsonBinaryType.cs\" />\n    <Compile Include=\"Bson\\BsonBinaryWriter.cs\" />\n    <Compile Include=\"Bson\\BsonReader.cs\" />\n    <Compile Include=\"Bson\\BsonToken.cs\" />\n    <Compile Include=\"Bson\\BsonType.cs\" />\n    <Compile Include=\"Bson\\BsonWriter.cs\" />\n    <Compile Include=\"Bson\\BsonObjectId.cs\" />\n    <Compile Include=\"Converters\\BinaryConverter.cs\" />\n    <Compile Include=\"Converters\\DataSetConverter.cs\" />\n    <Compile Include=\"Converters\\DataTableConverter.cs\" />\n    <Compile Include=\"Converters\\CustomCreationConverter.cs\" />\n    <Compile Include=\"Converters\\DateTimeConverterBase.cs\" />\n    <Compile Include=\"Converters\\DiscriminatedUnionConverter.cs\" />\n    <Compile Include=\"Converters\\EntityKeyMemberConverter.cs\" />\n    <Compile Include=\"Converters\\ExpandoObjectConverter.cs\" />\n    <Compile Include=\"Converters\\KeyValuePairConverter.cs\" />\n    <Compile Include=\"Converters\\BsonObjectIdConverter.cs\" />\n    <Compile Include=\"Converters\\RegexConverter.cs\" />\n    <Compile Include=\"Converters\\StringEnumConverter.cs\" />\n    <Compile Include=\"ConstructorHandling.cs\" />\n    <Compile Include=\"Converters\\VersionConverter.cs\" />\n    <Compile Include=\"FloatFormatHandling.cs\" />\n    <Compile Include=\"FloatParseHandling.cs\" />\n    <Compile Include=\"JsonDictionaryAttribute.cs\" />\n    <Compile Include=\"JsonException.cs\" />\n    <Compile Include=\"DateFormatHandling.cs\" />\n    <Compile Include=\"DateParseHandling.cs\" />\n    <Compile Include=\"DateTimeZoneHandling.cs\" />\n    <Compile Include=\"Formatting.cs\" />\n    <Compile Include=\"JsonConstructorAttribute.cs\" />\n    <Compile Include=\"JsonExtensionDataAttribute.cs\" />\n    <Compile Include=\"JsonPosition.cs\" />\n    <Compile Include=\"Linq\\JPropertyKeyedCollection.cs\" />\n    <Compile Include=\"Linq\\JsonPath\\ArrayIndexFilter.cs\" />\n    <Compile Include=\"Linq\\JsonPath\\ArrayMultipleIndexFilter.cs\" />\n    <Compile Include=\"Linq\\JsonPath\\ArraySliceFilter.cs\" />\n    <Compile Include=\"Linq\\JsonPath\\FieldFilter.cs\" />\n    <Compile Include=\"Linq\\JsonPath\\FieldMultipleFilter.cs\" />\n    <Compile Include=\"Linq\\JsonPath\\JPath.cs\" />\n    <Compile Include=\"Linq\\JsonPath\\PathFilter.cs\" />\n    <Compile Include=\"Linq\\JsonPath\\QueryExpression.cs\" />\n    <Compile Include=\"Linq\\JsonPath\\QueryFilter.cs\" />\n    <Compile Include=\"Linq\\JsonPath\\ScanFilter.cs\" />\n    <Compile Include=\"MetadataPropertyHandling.cs\" />\n    <Compile Include=\"Serialization\\DiagnosticsTraceWriter.cs\" />\n    <Compile Include=\"Serialization\\ExpressionValueProvider.cs\" />\n    <Compile Include=\"Serialization\\ITraceWriter.cs\" />\n    <Compile Include=\"Serialization\\JsonContainerContract.cs\" />\n    <Compile Include=\"Serialization\\MemoryTraceWriter.cs\" />\n    <Compile Include=\"Serialization\\TraceJsonReader.cs\" />\n    <Compile Include=\"Serialization\\TraceJsonWriter.cs\" />\n    <Compile Include=\"StringEscapeHandling.cs\" />\n    <Compile Include=\"Utilities\\DateTimeParser.cs\" />\n    <Compile Include=\"Utilities\\DynamicProxy.cs\" />\n    <Compile Include=\"Linq\\JRaw.cs\" />\n    <Compile Include=\"Required.cs\" />\n    <Compile Include=\"Serialization\\JsonDynamicContract.cs\" />\n    <Compile Include=\"Serialization\\JsonFormatterConverter.cs\" />\n    <Compile Include=\"Serialization\\JsonISerializableContract.cs\" />\n    <Compile Include=\"Serialization\\JsonLinqContract.cs\" />\n    <Compile Include=\"Serialization\\JsonPrimitiveContract.cs\" />\n    <Compile Include=\"Serialization\\DynamicValueProvider.cs\" />\n    <Compile Include=\"Serialization\\ErrorEventArgs.cs\" />\n    <Compile Include=\"Linq\\JPropertyDescriptor.cs\" />\n    <Compile Include=\"Serialization\\DefaultReferenceResolver.cs\" />\n    <Compile Include=\"PreserveReferencesHandling.cs\" />\n    <Compile Include=\"IJsonLineInfo.cs\" />\n    <Compile Include=\"JsonArrayAttribute.cs\" />\n    <Compile Include=\"JsonContainerAttribute.cs\" />\n    <Compile Include=\"DefaultValueHandling.cs\" />\n    <Compile Include=\"JsonConverterAttribute.cs\" />\n    <Compile Include=\"JsonObjectAttribute.cs\" />\n    <Compile Include=\"JsonSerializerSettings.cs\" />\n    <Compile Include=\"JsonValidatingReader.cs\" />\n    <Compile Include=\"Linq\\IJEnumerable.cs\" />\n    <Compile Include=\"Linq\\JTokenEqualityComparer.cs\" />\n    <Compile Include=\"MemberSerialization.cs\" />\n    <Compile Include=\"ObjectCreationHandling.cs\" />\n    <Compile Include=\"Converters\\IsoDateTimeConverter.cs\" />\n    <Compile Include=\"Converters\\JavaScriptDateTimeConverter.cs\" />\n    <Compile Include=\"Converters\\XmlNodeConverter.cs\" />\n    <Compile Include=\"JsonTextReader.cs\" />\n    <Compile Include=\"JsonPropertyAttribute.cs\" />\n    <Compile Include=\"JsonIgnoreAttribute.cs\" />\n    <Compile Include=\"JsonTextWriter.cs\" />\n    <Compile Include=\"JsonWriterException.cs\" />\n    <Compile Include=\"JsonReaderException.cs\" />\n    <Compile Include=\"JsonConverter.cs\" />\n    <Compile Include=\"JsonConverterCollection.cs\" />\n    <Compile Include=\"JsonReader.cs\" />\n    <Compile Include=\"JsonConvert.cs\" />\n    <Compile Include=\"JsonSerializationException.cs\" />\n    <Compile Include=\"JsonSerializer.cs\" />\n    <Compile Include=\"Linq\\Extensions.cs\" />\n    <Compile Include=\"Linq\\JConstructor.cs\" />\n    <Compile Include=\"Linq\\JContainer.cs\" />\n    <Compile Include=\"Linq\\JEnumerable.cs\" />\n    <Compile Include=\"Linq\\JObject.cs\" />\n    <Compile Include=\"Linq\\JArray.cs\" />\n    <Compile Include=\"Linq\\JTokenReader.cs\" />\n    <Compile Include=\"Linq\\JTokenWriter.cs\" />\n    <Compile Include=\"Linq\\JToken.cs\" />\n    <Compile Include=\"Linq\\JProperty.cs\" />\n    <Compile Include=\"Linq\\JTokenType.cs\" />\n    <Compile Include=\"Linq\\JValue.cs\" />\n    <Compile Include=\"Schema\\Extensions.cs\" />\n    <Compile Include=\"Schema\\JsonSchemaException.cs\" />\n    <Compile Include=\"Schema\\JsonSchemaModel.cs\" />\n    <Compile Include=\"Schema\\JsonSchemaModelBuilder.cs\" />\n    <Compile Include=\"Schema\\JsonSchemaNodeCollection.cs\" />\n    <Compile Include=\"Schema\\JsonSchemaNode.cs\" />\n    <Compile Include=\"Schema\\JsonSchemaResolver.cs\" />\n    <Compile Include=\"Schema\\JsonSchemaWriter.cs\" />\n    <Compile Include=\"Schema\\UndefinedSchemaIdHandling.cs\" />\n    <Compile Include=\"Schema\\ValidationEventArgs.cs\" />\n    <Compile Include=\"Schema\\ValidationEventHandler.cs\" />\n    <Compile Include=\"Serialization\\CamelCasePropertyNamesContractResolver.cs\" />\n    <Compile Include=\"Serialization\\DefaultContractResolver.cs\" />\n    <Compile Include=\"Serialization\\DefaultSerializationBinder.cs\" />\n    <Compile Include=\"Serialization\\ErrorContext.cs\" />\n    <Compile Include=\"Serialization\\IContractResolver.cs\" />\n    <Compile Include=\"Serialization\\IValueProvider.cs\" />\n    <Compile Include=\"Serialization\\JsonArrayContract.cs\" />\n    <Compile Include=\"Serialization\\JsonContract.cs\" />\n    <Compile Include=\"Serialization\\JsonDictionaryContract.cs\" />\n    <Compile Include=\"Serialization\\JsonProperty.cs\" />\n    <Compile Include=\"Serialization\\JsonPropertyCollection.cs\" />\n    <Compile Include=\"MissingMemberHandling.cs\" />\n    <Compile Include=\"NullValueHandling.cs\" />\n    <Compile Include=\"ReferenceLoopHandling.cs\" />\n    <Compile Include=\"Schema\\JsonSchema.cs\" />\n    <Compile Include=\"Schema\\JsonSchemaBuilder.cs\" />\n    <Compile Include=\"Schema\\JsonSchemaConstants.cs\" />\n    <Compile Include=\"Schema\\JsonSchemaGenerator.cs\" />\n    <Compile Include=\"Serialization\\IReferenceResolver.cs\" />\n    <Compile Include=\"Schema\\JsonSchemaType.cs\" />\n    <Compile Include=\"Serialization\\JsonObjectContract.cs\" />\n    <Compile Include=\"Serialization\\JsonSerializerInternalBase.cs\" />\n    <Compile Include=\"Serialization\\JsonSerializerInternalReader.cs\" />\n    <Compile Include=\"Serialization\\JsonSerializerInternalWriter.cs\" />\n    <Compile Include=\"Serialization\\JsonSerializerProxy.cs\" />\n    <Compile Include=\"Serialization\\JsonStringContract.cs\" />\n    <Compile Include=\"Serialization\\JsonTypeReflector.cs\" />\n    <Compile Include=\"Serialization\\CachedAttributeGetter.cs\" />\n    <Compile Include=\"Serialization\\LateBoundMetadataTypeAttribute.cs\" />\n    <Compile Include=\"Serialization\\ReflectionValueProvider.cs\" />\n    <Compile Include=\"Serialization\\OnErrorAttribute.cs\" />\n    <Compile Include=\"Utilities\\Base64Encoder.cs\" />\n    <Compile Include=\"Utilities\\DynamicProxyMetaObject.cs\" />\n    <Compile Include=\"Utilities\\DynamicUtils.cs\" />\n    <Compile Include=\"Utilities\\DynamicWrapper.cs\" />\n    <Compile Include=\"Utilities\\DynamicReflectionDelegateFactory.cs\" />\n    <Compile Include=\"Serialization\\ObjectConstructor.cs\" />\n    <Compile Include=\"Utilities\\ExpressionReflectionDelegateFactory.cs\" />\n    <Compile Include=\"Utilities\\FSharpUtils.cs\" />\n    <Compile Include=\"Utilities\\ILGeneratorExtensions.cs\" />\n    <Compile Include=\"Utilities\\ImmutableCollectionsUtils.cs\" />\n    <Compile Include=\"Utilities\\LinqBridge.cs\" />\n    <Compile Include=\"Utilities\\ReflectionDelegateFactory.cs\" />\n    <Compile Include=\"Utilities\\LateBoundReflectionDelegateFactory.cs\" />\n    <Compile Include=\"Utilities\\MethodCall.cs\" />\n    <Compile Include=\"Utilities\\StringReference.cs\" />\n    <Compile Include=\"Utilities\\ThreadSafeStore.cs\" />\n    <Compile Include=\"TypeNameHandling.cs\" />\n    <Compile Include=\"Utilities\\BidirectionalDictionary.cs\" />\n    <Compile Include=\"Utilities\\ConvertUtils.cs\" />\n    <Compile Include=\"Utilities\\CollectionWrapper.cs\" />\n    <Compile Include=\"Utilities\\DateTimeUtils.cs\" />\n    <Compile Include=\"Utilities\\DictionaryWrapper.cs\" />\n    <Compile Include=\"Utilities\\EnumUtils.cs\" />\n    <Compile Include=\"Utilities\\EnumValue.cs\" />\n    <Compile Include=\"Utilities\\EnumValues.cs\" />\n    <Compile Include=\"Utilities\\JavaScriptUtils.cs\" />\n    <Compile Include=\"JsonToken.cs\" />\n    <Compile Include=\"JsonWriter.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Utilities\\StringBuffer.cs\" />\n    <Compile Include=\"Utilities\\CollectionUtils.cs\" />\n    <Compile Include=\"Utilities\\MathUtils.cs\" />\n    <Compile Include=\"Utilities\\MiscellaneousUtils.cs\" />\n    <Compile Include=\"Utilities\\ReflectionUtils.cs\" />\n    <Compile Include=\"Utilities\\StringUtils.cs\" />\n    <Compile Include=\"Utilities\\TypeExtensions.cs\" />\n    <Compile Include=\"Utilities\\ValidationUtils.cs\" />\n    <Compile Include=\"WriteState.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.2.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Dynamic.snk\" />\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n</Project>"
  },
  {
    "path": "Newtonsoft.Json/Newtonsoft.Json.ruleset",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RuleSet Name=\"Newtonsoft.Json.ruleset\" ToolsVersion=\"12.0\">\n  <IncludeAll Action=\"Warning\" />\n  <Rules AnalyzerId=\"Microsoft.Analyzers.ManagedCodeAnalysis\" RuleNamespace=\"Microsoft.Rules.Managed\">\n    <Rule Id=\"CA1000\" Action=\"None\" />\n    <Rule Id=\"CA1001\" Action=\"None\" />\n    <Rule Id=\"CA1002\" Action=\"None\" />\n    <Rule Id=\"CA1003\" Action=\"None\" />\n    <Rule Id=\"CA1004\" Action=\"None\" />\n    <Rule Id=\"CA1005\" Action=\"None\" />\n    <Rule Id=\"CA1006\" Action=\"None\" />\n    <Rule Id=\"CA1007\" Action=\"None\" />\n    <Rule Id=\"CA1008\" Action=\"None\" />\n    <Rule Id=\"CA1009\" Action=\"None\" />\n    <Rule Id=\"CA1010\" Action=\"None\" />\n    <Rule Id=\"CA1011\" Action=\"None\" />\n    <Rule Id=\"CA1012\" Action=\"None\" />\n    <Rule Id=\"CA1013\" Action=\"None\" />\n    <Rule Id=\"CA1014\" Action=\"None\" />\n    <Rule Id=\"CA1016\" Action=\"None\" />\n    <Rule Id=\"CA1017\" Action=\"None\" />\n    <Rule Id=\"CA1018\" Action=\"None\" />\n    <Rule Id=\"CA1019\" Action=\"None\" />\n    <Rule Id=\"CA1020\" Action=\"None\" />\n    <Rule Id=\"CA1021\" Action=\"None\" />\n    <Rule Id=\"CA1023\" Action=\"None\" />\n    <Rule Id=\"CA1024\" Action=\"None\" />\n    <Rule Id=\"CA1025\" Action=\"None\" />\n    <Rule Id=\"CA1026\" Action=\"None\" />\n    <Rule Id=\"CA1027\" Action=\"None\" />\n    <Rule Id=\"CA1028\" Action=\"None\" />\n    <Rule Id=\"CA1030\" Action=\"None\" />\n    <Rule Id=\"CA1031\" Action=\"None\" />\n    <Rule Id=\"CA1032\" Action=\"None\" />\n    <Rule Id=\"CA1033\" Action=\"None\" />\n    <Rule Id=\"CA1034\" Action=\"None\" />\n    <Rule Id=\"CA1035\" Action=\"None\" />\n    <Rule Id=\"CA1036\" Action=\"None\" />\n    <Rule Id=\"CA1038\" Action=\"None\" />\n    <Rule Id=\"CA1039\" Action=\"None\" />\n    <Rule Id=\"CA1040\" Action=\"None\" />\n    <Rule Id=\"CA1041\" Action=\"None\" />\n    <Rule Id=\"CA1043\" Action=\"None\" />\n    <Rule Id=\"CA1044\" Action=\"None\" />\n    <Rule Id=\"CA1045\" Action=\"None\" />\n    <Rule Id=\"CA1046\" Action=\"None\" />\n    <Rule Id=\"CA1047\" Action=\"None\" />\n    <Rule Id=\"CA1048\" Action=\"None\" />\n    <Rule Id=\"CA1049\" Action=\"None\" />\n    <Rule Id=\"CA1050\" Action=\"None\" />\n    <Rule Id=\"CA1051\" Action=\"None\" />\n    <Rule Id=\"CA1052\" Action=\"None\" />\n    <Rule Id=\"CA1053\" Action=\"None\" />\n    <Rule Id=\"CA1054\" Action=\"None\" />\n    <Rule Id=\"CA1055\" Action=\"None\" />\n    <Rule Id=\"CA1056\" Action=\"None\" />\n    <Rule Id=\"CA1057\" Action=\"None\" />\n    <Rule Id=\"CA1058\" Action=\"None\" />\n    <Rule Id=\"CA1059\" Action=\"None\" />\n    <Rule Id=\"CA1060\" Action=\"None\" />\n    <Rule Id=\"CA1061\" Action=\"None\" />\n    <Rule Id=\"CA1062\" Action=\"None\" />\n    <Rule Id=\"CA1063\" Action=\"None\" />\n    <Rule Id=\"CA1064\" Action=\"None\" />\n    <Rule Id=\"CA1065\" Action=\"None\" />\n    <Rule Id=\"CA1300\" Action=\"None\" />\n    <Rule Id=\"CA1301\" Action=\"None\" />\n    <Rule Id=\"CA1302\" Action=\"None\" />\n    <Rule Id=\"CA1303\" Action=\"None\" />\n    <Rule Id=\"CA1304\" Action=\"Error\" />\n    <Rule Id=\"CA1305\" Action=\"Error\" />\n    <Rule Id=\"CA1306\" Action=\"None\" />\n    <Rule Id=\"CA1307\" Action=\"None\" />\n    <Rule Id=\"CA1308\" Action=\"None\" />\n    <Rule Id=\"CA1309\" Action=\"None\" />\n    <Rule Id=\"CA1400\" Action=\"None\" />\n    <Rule Id=\"CA1401\" Action=\"None\" />\n    <Rule Id=\"CA1402\" Action=\"None\" />\n    <Rule Id=\"CA1403\" Action=\"None\" />\n    <Rule Id=\"CA1404\" Action=\"None\" />\n    <Rule Id=\"CA1405\" Action=\"None\" />\n    <Rule Id=\"CA1406\" Action=\"None\" />\n    <Rule Id=\"CA1407\" Action=\"None\" />\n    <Rule Id=\"CA1408\" Action=\"None\" />\n    <Rule Id=\"CA1409\" Action=\"None\" />\n    <Rule Id=\"CA1410\" Action=\"None\" />\n    <Rule Id=\"CA1411\" Action=\"None\" />\n    <Rule Id=\"CA1412\" Action=\"None\" />\n    <Rule Id=\"CA1413\" Action=\"None\" />\n    <Rule Id=\"CA1414\" Action=\"None\" />\n    <Rule Id=\"CA1415\" Action=\"None\" />\n    <Rule Id=\"CA1500\" Action=\"None\" />\n    <Rule Id=\"CA1501\" Action=\"None\" />\n    <Rule Id=\"CA1502\" Action=\"None\" />\n    <Rule Id=\"CA1504\" Action=\"None\" />\n    <Rule Id=\"CA1505\" Action=\"None\" />\n    <Rule Id=\"CA1506\" Action=\"None\" />\n    <Rule Id=\"CA1600\" Action=\"None\" />\n    <Rule Id=\"CA1601\" Action=\"None\" />\n    <Rule Id=\"CA1700\" Action=\"None\" />\n    <Rule Id=\"CA1701\" Action=\"None\" />\n    <Rule Id=\"CA1702\" Action=\"None\" />\n    <Rule Id=\"CA1703\" Action=\"None\" />\n    <Rule Id=\"CA1704\" Action=\"None\" />\n    <Rule Id=\"CA1707\" Action=\"None\" />\n    <Rule Id=\"CA1708\" Action=\"None\" />\n    <Rule Id=\"CA1709\" Action=\"None\" />\n    <Rule Id=\"CA1710\" Action=\"None\" />\n    <Rule Id=\"CA1711\" Action=\"None\" />\n    <Rule Id=\"CA1712\" Action=\"None\" />\n    <Rule Id=\"CA1713\" Action=\"None\" />\n    <Rule Id=\"CA1714\" Action=\"None\" />\n    <Rule Id=\"CA1715\" Action=\"None\" />\n    <Rule Id=\"CA1716\" Action=\"None\" />\n    <Rule Id=\"CA1717\" Action=\"None\" />\n    <Rule Id=\"CA1719\" Action=\"None\" />\n    <Rule Id=\"CA1720\" Action=\"None\" />\n    <Rule Id=\"CA1721\" Action=\"None\" />\n    <Rule Id=\"CA1722\" Action=\"None\" />\n    <Rule Id=\"CA1724\" Action=\"None\" />\n    <Rule Id=\"CA1725\" Action=\"None\" />\n    <Rule Id=\"CA1726\" Action=\"None\" />\n    <Rule Id=\"CA1800\" Action=\"None\" />\n    <Rule Id=\"CA1801\" Action=\"None\" />\n    <Rule Id=\"CA1802\" Action=\"None\" />\n    <Rule Id=\"CA1804\" Action=\"None\" />\n    <Rule Id=\"CA1806\" Action=\"None\" />\n    <Rule Id=\"CA1809\" Action=\"None\" />\n    <Rule Id=\"CA1810\" Action=\"None\" />\n    <Rule Id=\"CA1811\" Action=\"None\" />\n    <Rule Id=\"CA1812\" Action=\"None\" />\n    <Rule Id=\"CA1813\" Action=\"None\" />\n    <Rule Id=\"CA1814\" Action=\"None\" />\n    <Rule Id=\"CA1815\" Action=\"None\" />\n    <Rule Id=\"CA1816\" Action=\"None\" />\n    <Rule Id=\"CA1819\" Action=\"None\" />\n    <Rule Id=\"CA1820\" Action=\"None\" />\n    <Rule Id=\"CA1821\" Action=\"None\" />\n    <Rule Id=\"CA1822\" Action=\"None\" />\n    <Rule Id=\"CA1823\" Action=\"None\" />\n    <Rule Id=\"CA1824\" Action=\"None\" />\n    <Rule Id=\"CA1900\" Action=\"None\" />\n    <Rule Id=\"CA1901\" Action=\"None\" />\n    <Rule Id=\"CA1903\" Action=\"Error\" />\n    <Rule Id=\"CA2000\" Action=\"None\" />\n    <Rule Id=\"CA2001\" Action=\"None\" />\n    <Rule Id=\"CA2002\" Action=\"None\" />\n    <Rule Id=\"CA2003\" Action=\"None\" />\n    <Rule Id=\"CA2004\" Action=\"None\" />\n    <Rule Id=\"CA2006\" Action=\"None\" />\n    <Rule Id=\"CA2100\" Action=\"None\" />\n    <Rule Id=\"CA2101\" Action=\"None\" />\n    <Rule Id=\"CA2102\" Action=\"None\" />\n    <Rule Id=\"CA2103\" Action=\"None\" />\n    <Rule Id=\"CA2104\" Action=\"None\" />\n    <Rule Id=\"CA2105\" Action=\"None\" />\n    <Rule Id=\"CA2106\" Action=\"None\" />\n    <Rule Id=\"CA2107\" Action=\"None\" />\n    <Rule Id=\"CA2108\" Action=\"None\" />\n    <Rule Id=\"CA2109\" Action=\"None\" />\n    <Rule Id=\"CA2111\" Action=\"None\" />\n    <Rule Id=\"CA2112\" Action=\"None\" />\n    <Rule Id=\"CA2114\" Action=\"None\" />\n    <Rule Id=\"CA2115\" Action=\"None\" />\n    <Rule Id=\"CA2116\" Action=\"None\" />\n    <Rule Id=\"CA2117\" Action=\"None\" />\n    <Rule Id=\"CA2118\" Action=\"None\" />\n    <Rule Id=\"CA2119\" Action=\"None\" />\n    <Rule Id=\"CA2120\" Action=\"None\" />\n    <Rule Id=\"CA2121\" Action=\"None\" />\n    <Rule Id=\"CA2122\" Action=\"None\" />\n    <Rule Id=\"CA2123\" Action=\"None\" />\n    <Rule Id=\"CA2124\" Action=\"None\" />\n    <Rule Id=\"CA2126\" Action=\"None\" />\n    <Rule Id=\"CA2130\" Action=\"None\" />\n    <Rule Id=\"CA2131\" Action=\"None\" />\n    <Rule Id=\"CA2132\" Action=\"None\" />\n    <Rule Id=\"CA2133\" Action=\"None\" />\n    <Rule Id=\"CA2134\" Action=\"None\" />\n    <Rule Id=\"CA2135\" Action=\"None\" />\n    <Rule Id=\"CA2136\" Action=\"None\" />\n    <Rule Id=\"CA2137\" Action=\"None\" />\n    <Rule Id=\"CA2138\" Action=\"None\" />\n    <Rule Id=\"CA2139\" Action=\"None\" />\n    <Rule Id=\"CA2140\" Action=\"None\" />\n    <Rule Id=\"CA2141\" Action=\"None\" />\n    <Rule Id=\"CA2142\" Action=\"None\" />\n    <Rule Id=\"CA2143\" Action=\"None\" />\n    <Rule Id=\"CA2144\" Action=\"None\" />\n    <Rule Id=\"CA2145\" Action=\"None\" />\n    <Rule Id=\"CA2146\" Action=\"None\" />\n    <Rule Id=\"CA2147\" Action=\"None\" />\n    <Rule Id=\"CA2149\" Action=\"None\" />\n    <Rule Id=\"CA2200\" Action=\"None\" />\n    <Rule Id=\"CA2201\" Action=\"None\" />\n    <Rule Id=\"CA2202\" Action=\"None\" />\n    <Rule Id=\"CA2204\" Action=\"None\" />\n    <Rule Id=\"CA2205\" Action=\"None\" />\n    <Rule Id=\"CA2207\" Action=\"None\" />\n    <Rule Id=\"CA2208\" Action=\"None\" />\n    <Rule Id=\"CA2210\" Action=\"None\" />\n    <Rule Id=\"CA2211\" Action=\"None\" />\n    <Rule Id=\"CA2212\" Action=\"None\" />\n    <Rule Id=\"CA2213\" Action=\"None\" />\n    <Rule Id=\"CA2214\" Action=\"None\" />\n    <Rule Id=\"CA2215\" Action=\"None\" />\n    <Rule Id=\"CA2216\" Action=\"None\" />\n    <Rule Id=\"CA2217\" Action=\"None\" />\n    <Rule Id=\"CA2218\" Action=\"None\" />\n    <Rule Id=\"CA2219\" Action=\"None\" />\n    <Rule Id=\"CA2220\" Action=\"None\" />\n    <Rule Id=\"CA2221\" Action=\"None\" />\n    <Rule Id=\"CA2222\" Action=\"None\" />\n    <Rule Id=\"CA2223\" Action=\"None\" />\n    <Rule Id=\"CA2224\" Action=\"None\" />\n    <Rule Id=\"CA2225\" Action=\"None\" />\n    <Rule Id=\"CA2226\" Action=\"None\" />\n    <Rule Id=\"CA2227\" Action=\"None\" />\n    <Rule Id=\"CA2228\" Action=\"None\" />\n    <Rule Id=\"CA2229\" Action=\"None\" />\n    <Rule Id=\"CA2230\" Action=\"None\" />\n    <Rule Id=\"CA2231\" Action=\"None\" />\n    <Rule Id=\"CA2232\" Action=\"None\" />\n    <Rule Id=\"CA2233\" Action=\"None\" />\n    <Rule Id=\"CA2234\" Action=\"None\" />\n    <Rule Id=\"CA2235\" Action=\"None\" />\n    <Rule Id=\"CA2236\" Action=\"None\" />\n    <Rule Id=\"CA2237\" Action=\"None\" />\n    <Rule Id=\"CA2238\" Action=\"None\" />\n    <Rule Id=\"CA2239\" Action=\"None\" />\n    <Rule Id=\"CA2240\" Action=\"None\" />\n    <Rule Id=\"CA2241\" Action=\"None\" />\n    <Rule Id=\"CA2242\" Action=\"None\" />\n    <Rule Id=\"CA2243\" Action=\"None\" />\n  </Rules>\n</RuleSet>"
  },
  {
    "path": "Newtonsoft.Json/NullValueHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies null value handling options for the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    /// <example>\n    ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\SerializationTests.cs\" region=\"ReducingSerializedJsonSizeNullValueHandlingObject\" title=\"NullValueHandling Class\" />\n    ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\SerializationTests.cs\" region=\"ReducingSerializedJsonSizeNullValueHandlingExample\" title=\"NullValueHandling Ignore Example\" />\n    /// </example>\n    public enum NullValueHandling\n    {\n        /// <summary>\n        /// Include null values when serializing and deserializing objects.\n        /// </summary>\n        Include = 0,\n\n        /// <summary>\n        /// Ignore null values when serializing and deserializing objects.\n        /// </summary>\n        Ignore = 1\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/ObjectCreationHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies how object creation is handled by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public enum ObjectCreationHandling\n    {\n        /// <summary>\n        /// Reuse existing objects, create new objects when needed.\n        /// </summary>\n        Auto = 0,\n\n        /// <summary>\n        /// Only reuse existing objects.\n        /// </summary>\n        Reuse = 1,\n\n        /// <summary>\n        /// Always create new objects.\n        /// </summary>\n        Replace = 2\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/PreserveReferencesHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies reference handling options for the <see cref=\"JsonSerializer\"/>.\n    /// Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable.\n    /// </summary>\n    /// <example>\n    ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\SerializationTests.cs\" region=\"PreservingObjectReferencesOn\" title=\"Preserve Object References\" />       \n    /// </example>\n    [Flags]\n    public enum PreserveReferencesHandling\n    {\n        /// <summary>\n        /// Do not preserve references when serializing types.\n        /// </summary>\n        None = 0,\n\n        /// <summary>\n        /// Preserve references when serializing into a JSON object structure.\n        /// </summary>\n        Objects = 1,\n\n        /// <summary>\n        /// Preserve references when serializing into a JSON array structure.\n        /// </summary>\n        Arrays = 2,\n\n        /// <summary>\n        /// Preserve references when serializing.\n        /// </summary>\n        All = Objects | Arrays\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Properties/AssemblyInfo.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Security;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n#if PORTABLE40\n[assembly: AssemblyTitle(\"Json.NET Portable .NET 4.0\")]\n#elif PORTABLE\n[assembly: AssemblyTitle(\"Json.NET Portable\")]\n#elif NETFX_CORE\n[assembly: AssemblyTitle(\"Json.NET WinRT\")]\n#elif NET20\n[assembly: AssemblyTitle(\"Json.NET .NET 2.0\")]\n[assembly: AllowPartiallyTrustedCallers]\n#elif NET35\n[assembly: AssemblyTitle(\"Json.NET .NET 3.5\")]\n[assembly: AllowPartiallyTrustedCallers]\n#elif NET40\n[assembly: AssemblyTitle(\"Json.NET .NET 4.0\")]\n[assembly: AllowPartiallyTrustedCallers]\n#else\n[assembly: AssemblyTitle(\"Json.NET\")]\n[assembly: AllowPartiallyTrustedCallers]\n#endif\n\n#if !SIGNED\n\n[assembly: InternalsVisibleTo(\"Newtonsoft.Json.Tests\")]\n#else\n[assembly: InternalsVisibleTo(\"Newtonsoft.Json.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f561df277c6c0b497d629032b410cdcf286e537c054724f7ffa0164345f62b3e642029d7a80cc351918955328c4adc8a048823ef90b0cf38ea7db0d729caf2b633c3babe08b0310198c1081995c19029bc675193744eab9d7345b8a67258ec17d112cebdbbb2a281487dceeafb9d83aa930f32103fbe1d2911425bc5744002c7\")]\n#endif\n\n[assembly: InternalsVisibleTo(\"Newtonsoft.Json.Dynamic, PublicKey=0024000004800000940000000602000000240000525341310004000001000100cbd8d53b9d7de30f1f1278f636ec462cf9c254991291e66ebb157a885638a517887633b898ccbcf0d5c5ff7be85a6abe9e765d0ac7cd33c68dac67e7e64530e8222101109f154ab14a941c490ac155cd1d4fcba0fabb49016b4ef28593b015cab5937da31172f03f67d09edda404b88a60023f062ae71d0b2e4438b74cc11dc9\")]\n[assembly: AssemblyDescription(\"Json.NET is a popular high-performance JSON framework for .NET\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Newtonsoft\")]\n[assembly: AssemblyProduct(\"Json.NET\")]\n[assembly: AssemblyCopyright(\"Copyright  James Newton-King 2008\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n#if !(PORTABLE40 || PORTABLE)\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM componenets.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n\n[assembly: Guid(\"9ca358aa-317b-4925-8ada-4a29e943a363\")]\n#endif\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Revision and Build Numbers \n// by using the '*' as shown below:\n\n[assembly: AssemblyVersion(\"6.0.0.0\")]\n[assembly: AssemblyFileVersion(\"6.0.3.17227\")]\n[assembly: CLSCompliant(true)]\n"
  },
  {
    "path": "Newtonsoft.Json/ReferenceLoopHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies reference loop handling options for the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public enum ReferenceLoopHandling\n    {\n        /// <summary>\n        /// Throw a <see cref=\"JsonSerializationException\"/> when a loop is encountered.\n        /// </summary>\n        Error = 0,\n\n        /// <summary>\n        /// Ignore loop references and do not serialize.\n        /// </summary>\n        Ignore = 1,\n\n        /// <summary>\n        /// Serialize loop references.\n        /// </summary>\n        Serialize = 2\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Required.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Indicating whether a property is required.\n    /// </summary>\n    public enum Required\n    {\n        /// <summary>\n        /// The property is not required. The default state.\n        /// </summary>\n        Default,\n\n        /// <summary>\n        /// The property must be defined in JSON but can be a null value.\n        /// </summary>\n        AllowNull,\n\n        /// <summary>\n        /// The property must be defined in JSON and cannot be a null value.\n        /// </summary>\n        Always\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/Extensions.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Schema\n{\n    /// <summary>\n    /// Contains the JSON schema extension methods.\n    /// </summary>\n    public static class Extensions\n    {\n        /// <summary>\n        /// Determines whether the <see cref=\"JToken\"/> is valid.\n        /// </summary>\n        /// <param name=\"source\">The source <see cref=\"JToken\"/> to test.</param>\n        /// <param name=\"schema\">The schema to test with.</param>\n        /// <returns>\n        /// \t<c>true</c> if the specified <see cref=\"JToken\"/> is valid; otherwise, <c>false</c>.\n        /// </returns>\n        public static bool IsValid(this JToken source, JsonSchema schema)\n        {\n            bool valid = true;\n            source.Validate(schema, (sender, args) => { valid = false; });\n            return valid;\n        }\n\n        /// <summary>\n        /// Determines whether the <see cref=\"JToken\"/> is valid.\n        /// </summary>\n        /// <param name=\"source\">The source <see cref=\"JToken\"/> to test.</param>\n        /// <param name=\"schema\">The schema to test with.</param>\n        /// <param name=\"errorMessages\">When this method returns, contains any error messages generated while validating. </param>\n        /// <returns>\n        /// \t<c>true</c> if the specified <see cref=\"JToken\"/> is valid; otherwise, <c>false</c>.\n        /// </returns>\n        public static bool IsValid(this JToken source, JsonSchema schema, out IList<string> errorMessages)\n        {\n            IList<string> errors = new List<string>();\n\n            source.Validate(schema, (sender, args) => errors.Add(args.Message));\n\n            errorMessages = errors;\n            return (errorMessages.Count == 0);\n        }\n\n        /// <summary>\n        /// Validates the specified <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"source\">The source <see cref=\"JToken\"/> to test.</param>\n        /// <param name=\"schema\">The schema to test with.</param>\n        public static void Validate(this JToken source, JsonSchema schema)\n        {\n            source.Validate(schema, null);\n        }\n\n        /// <summary>\n        /// Validates the specified <see cref=\"JToken\"/>.\n        /// </summary>\n        /// <param name=\"source\">The source <see cref=\"JToken\"/> to test.</param>\n        /// <param name=\"schema\">The schema to test with.</param>\n        /// <param name=\"validationEventHandler\">The validation event handler.</param>\n        public static void Validate(this JToken source, JsonSchema schema, ValidationEventHandler validationEventHandler)\n        {\n            ValidationUtils.ArgumentNotNull(source, \"source\");\n            ValidationUtils.ArgumentNotNull(schema, \"schema\");\n\n            using (JsonValidatingReader reader = new JsonValidatingReader(source.CreateReader()))\n            {\n                reader.Schema = schema;\n                if (validationEventHandler != null)\n                    reader.ValidationEventHandler += validationEventHandler;\n\n                while (reader.Read())\n                {\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchema.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Schema\n{\n    /// <summary>\n    /// An in-memory representation of a JSON Schema.\n    /// </summary>\n    public class JsonSchema\n    {\n        /// <summary>\n        /// Gets or sets the id.\n        /// </summary>\n        public string Id { get; set; }\n\n        /// <summary>\n        /// Gets or sets the title.\n        /// </summary>\n        public string Title { get; set; }\n\n        /// <summary>\n        /// Gets or sets whether the object is required.\n        /// </summary>\n        public bool? Required { get; set; }\n\n        /// <summary>\n        /// Gets or sets whether the object is read only.\n        /// </summary>\n        public bool? ReadOnly { get; set; }\n\n        /// <summary>\n        /// Gets or sets whether the object is visible to users.\n        /// </summary>\n        public bool? Hidden { get; set; }\n\n        /// <summary>\n        /// Gets or sets whether the object is transient.\n        /// </summary>\n        public bool? Transient { get; set; }\n\n        /// <summary>\n        /// Gets or sets the description of the object.\n        /// </summary>\n        public string Description { get; set; }\n\n        /// <summary>\n        /// Gets or sets the types of values allowed by the object.\n        /// </summary>\n        /// <value>The type.</value>\n        public JsonSchemaType? Type { get; set; }\n\n        /// <summary>\n        /// Gets or sets the pattern.\n        /// </summary>\n        /// <value>The pattern.</value>\n        public string Pattern { get; set; }\n\n        /// <summary>\n        /// Gets or sets the minimum length.\n        /// </summary>\n        /// <value>The minimum length.</value>\n        public int? MinimumLength { get; set; }\n\n        /// <summary>\n        /// Gets or sets the maximum length.\n        /// </summary>\n        /// <value>The maximum length.</value>\n        public int? MaximumLength { get; set; }\n\n        /// <summary>\n        /// Gets or sets a number that the value should be divisble by.\n        /// </summary>\n        /// <value>A number that the value should be divisble by.</value>\n        public double? DivisibleBy { get; set; }\n\n        /// <summary>\n        /// Gets or sets the minimum.\n        /// </summary>\n        /// <value>The minimum.</value>\n        public double? Minimum { get; set; }\n\n        /// <summary>\n        /// Gets or sets the maximum.\n        /// </summary>\n        /// <value>The maximum.</value>\n        public double? Maximum { get; set; }\n\n        /// <summary>\n        /// Gets or sets a flag indicating whether the value can not equal the number defined by the \"minimum\" attribute.\n        /// </summary>\n        /// <value>A flag indicating whether the value can not equal the number defined by the \"minimum\" attribute.</value>\n        public bool? ExclusiveMinimum { get; set; }\n\n        /// <summary>\n        /// Gets or sets a flag indicating whether the value can not equal the number defined by the \"maximum\" attribute.\n        /// </summary>\n        /// <value>A flag indicating whether the value can not equal the number defined by the \"maximum\" attribute.</value>\n        public bool? ExclusiveMaximum { get; set; }\n\n        /// <summary>\n        /// Gets or sets the minimum number of items.\n        /// </summary>\n        /// <value>The minimum number of items.</value>\n        public int? MinimumItems { get; set; }\n\n        /// <summary>\n        /// Gets or sets the maximum number of items.\n        /// </summary>\n        /// <value>The maximum number of items.</value>\n        public int? MaximumItems { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"JsonSchema\"/> of items.\n        /// </summary>\n        /// <value>The <see cref=\"JsonSchema\"/> of items.</value>\n        public IList<JsonSchema> Items { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether items in an array are validated using the <see cref=\"JsonSchema\"/> instance at their array position from <see cref=\"JsonSchema.Items\"/>.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if items are validated using their array position; otherwise, <c>false</c>.\n        /// </value>\n        public bool PositionalItemsValidation { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"JsonSchema\"/> of additional items.\n        /// </summary>\n        /// <value>The <see cref=\"JsonSchema\"/> of additional items.</value>\n        public JsonSchema AdditionalItems { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether additional items are allowed.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if additional items are allowed; otherwise, <c>false</c>.\n        /// </value>\n        public bool AllowAdditionalItems { get; set; }\n\n        /// <summary>\n        /// Gets or sets whether the array items must be unique.\n        /// </summary>\n        public bool UniqueItems { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"JsonSchema\"/> of properties.\n        /// </summary>\n        /// <value>The <see cref=\"JsonSchema\"/> of properties.</value>\n        public IDictionary<string, JsonSchema> Properties { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"JsonSchema\"/> of additional properties.\n        /// </summary>\n        /// <value>The <see cref=\"JsonSchema\"/> of additional properties.</value>\n        public JsonSchema AdditionalProperties { get; set; }\n\n        /// <summary>\n        /// Gets or sets the pattern properties.\n        /// </summary>\n        /// <value>The pattern properties.</value>\n        public IDictionary<string, JsonSchema> PatternProperties { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether additional properties are allowed.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if additional properties are allowed; otherwise, <c>false</c>.\n        /// </value>\n        public bool AllowAdditionalProperties { get; set; }\n\n        /// <summary>\n        /// Gets or sets the required property if this property is present.\n        /// </summary>\n        /// <value>The required property if this property is present.</value>\n        public string Requires { get; set; }\n\n        /// <summary>\n        /// Gets or sets the a collection of valid enum values allowed.\n        /// </summary>\n        /// <value>A collection of valid enum values allowed.</value>\n        public IList<JToken> Enum { get; set; }\n\n        /// <summary>\n        /// Gets or sets disallowed types.\n        /// </summary>\n        /// <value>The disallow types.</value>\n        public JsonSchemaType? Disallow { get; set; }\n\n        /// <summary>\n        /// Gets or sets the default value.\n        /// </summary>\n        /// <value>The default value.</value>\n        public JToken Default { get; set; }\n\n        /// <summary>\n        /// Gets or sets the collection of <see cref=\"JsonSchema\"/> that this schema extends.\n        /// </summary>\n        /// <value>The collection of <see cref=\"JsonSchema\"/> that this schema extends.</value>\n        public IList<JsonSchema> Extends { get; set; }\n\n        /// <summary>\n        /// Gets or sets the format.\n        /// </summary>\n        /// <value>The format.</value>\n        public string Format { get; set; }\n\n        internal string Location { get; set; }\n\n        private readonly string _internalId = Guid.NewGuid().ToString(\"N\");\n\n        internal string InternalId\n        {\n            get { return _internalId; }\n        }\n\n        // if this is set then this schema instance is just a deferred reference\n        // and will be replaced when the schema reference is resolved\n        internal string DeferredReference { get; set; }\n        internal bool ReferencesResolved { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSchema\"/> class.\n        /// </summary>\n        public JsonSchema()\n        {\n            AllowAdditionalProperties = true;\n            AllowAdditionalItems = true;\n        }\n\n        /// <summary>\n        /// Reads a <see cref=\"JsonSchema\"/> from the specified <see cref=\"JsonReader\"/>.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> containing the JSON Schema to read.</param>\n        /// <returns>The <see cref=\"JsonSchema\"/> object representing the JSON Schema.</returns>\n        public static JsonSchema Read(JsonReader reader)\n        {\n            return Read(reader, new JsonSchemaResolver());\n        }\n\n        /// <summary>\n        /// Reads a <see cref=\"JsonSchema\"/> from the specified <see cref=\"JsonReader\"/>.\n        /// </summary>\n        /// <param name=\"reader\">The <see cref=\"JsonReader\"/> containing the JSON Schema to read.</param>\n        /// <param name=\"resolver\">The <see cref=\"JsonSchemaResolver\"/> to use when resolving schema references.</param>\n        /// <returns>The <see cref=\"JsonSchema\"/> object representing the JSON Schema.</returns>\n        public static JsonSchema Read(JsonReader reader, JsonSchemaResolver resolver)\n        {\n            ValidationUtils.ArgumentNotNull(reader, \"reader\");\n            ValidationUtils.ArgumentNotNull(resolver, \"resolver\");\n\n            JsonSchemaBuilder builder = new JsonSchemaBuilder(resolver);\n            return builder.Read(reader);\n        }\n\n        /// <summary>\n        /// Load a <see cref=\"JsonSchema\"/> from a string that contains schema JSON.\n        /// </summary>\n        /// <param name=\"json\">A <see cref=\"String\"/> that contains JSON.</param>\n        /// <returns>A <see cref=\"JsonSchema\"/> populated from the string that contains JSON.</returns>\n        public static JsonSchema Parse(string json)\n        {\n            return Parse(json, new JsonSchemaResolver());\n        }\n\n        /// <summary>\n        /// Parses the specified json.\n        /// </summary>\n        /// <param name=\"json\">The json.</param>\n        /// <param name=\"resolver\">The resolver.</param>\n        /// <returns>A <see cref=\"JsonSchema\"/> populated from the string that contains JSON.</returns>\n        public static JsonSchema Parse(string json, JsonSchemaResolver resolver)\n        {\n            ValidationUtils.ArgumentNotNull(json, \"json\");\n\n            using (JsonReader reader = new JsonTextReader(new StringReader(json)))\n            {\n                return Read(reader, resolver);\n            }\n        }\n\n        /// <summary>\n        /// Writes this schema to a <see cref=\"JsonWriter\"/>.\n        /// </summary>\n        /// <param name=\"writer\">A <see cref=\"JsonWriter\"/> into which this method will write.</param>\n        public void WriteTo(JsonWriter writer)\n        {\n            WriteTo(writer, new JsonSchemaResolver());\n        }\n\n        /// <summary>\n        /// Writes this schema to a <see cref=\"JsonWriter\"/> using the specified <see cref=\"JsonSchemaResolver\"/>.\n        /// </summary>\n        /// <param name=\"writer\">A <see cref=\"JsonWriter\"/> into which this method will write.</param>\n        /// <param name=\"resolver\">The resolver used.</param>\n        public void WriteTo(JsonWriter writer, JsonSchemaResolver resolver)\n        {\n            ValidationUtils.ArgumentNotNull(writer, \"writer\");\n            ValidationUtils.ArgumentNotNull(resolver, \"resolver\");\n\n            JsonSchemaWriter schemaWriter = new JsonSchemaWriter(writer, resolver);\n            schemaWriter.WriteSchema(this);\n        }\n\n        /// <summary>\n        /// Returns a <see cref=\"T:System.String\"/> that represents the current <see cref=\"T:System.Object\"/>.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"T:System.String\"/> that represents the current <see cref=\"T:System.Object\"/>.\n        /// </returns>\n        public override string ToString()\n        {\n            StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);\n            JsonTextWriter jsonWriter = new JsonTextWriter(writer);\n            jsonWriter.Formatting = Formatting.Indented;\n\n            WriteTo(jsonWriter);\n\n            return writer.ToString();\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchemaBuilder.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Serialization;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\nusing Newtonsoft.Json.Linq;\n\nnamespace Newtonsoft.Json.Schema\n{\n    internal class JsonSchemaBuilder\n    {\n        private readonly IList<JsonSchema> _stack;\n        private readonly JsonSchemaResolver _resolver;\n        private readonly IDictionary<string, JsonSchema> _documentSchemas;\n        private JsonSchema _currentSchema;\n        private JObject _rootSchema;\n\n        public JsonSchemaBuilder(JsonSchemaResolver resolver)\n        {\n            _stack = new List<JsonSchema>();\n            _documentSchemas = new Dictionary<string, JsonSchema>();\n            _resolver = resolver;\n        }\n\n        private void Push(JsonSchema value)\n        {\n            _currentSchema = value;\n            _stack.Add(value);\n            _resolver.LoadedSchemas.Add(value);\n            _documentSchemas.Add(value.Location, value);\n        }\n\n        private JsonSchema Pop()\n        {\n            JsonSchema poppedSchema = _currentSchema;\n            _stack.RemoveAt(_stack.Count - 1);\n            _currentSchema = _stack.LastOrDefault();\n\n            return poppedSchema;\n        }\n\n        private JsonSchema CurrentSchema\n        {\n            get { return _currentSchema; }\n        }\n\n        internal JsonSchema Read(JsonReader reader)\n        {\n            JToken schemaToken = JToken.ReadFrom(reader);\n\n            _rootSchema = schemaToken as JObject;\n\n            JsonSchema schema = BuildSchema(schemaToken);\n\n            ResolveReferences(schema);\n\n            return schema;\n        }\n\n        private string UnescapeReference(string reference)\n        {\n            return Uri.UnescapeDataString(reference).Replace(\"~1\", \"/\").Replace(\"~0\", \"~\");\n        }\n\n        private JsonSchema ResolveReferences(JsonSchema schema)\n        {\n            if (schema.DeferredReference != null)\n            {\n                string reference = schema.DeferredReference;\n\n                bool locationReference = (reference.StartsWith(\"#\", StringComparison.OrdinalIgnoreCase));\n                if (locationReference)\n                    reference = UnescapeReference(reference);\n\n                JsonSchema resolvedSchema = _resolver.GetSchema(reference);\n\n                if (resolvedSchema == null)\n                {\n                    if (locationReference)\n                    {\n                        string[] escapedParts = schema.DeferredReference.TrimStart('#').Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);\n                        JToken currentToken = _rootSchema;\n                        foreach (string escapedPart in escapedParts)\n                        {\n                            string part = UnescapeReference(escapedPart);\n\n                            if (currentToken.Type == JTokenType.Object)\n                            {\n                                currentToken = currentToken[part];\n                            }\n                            else if (currentToken.Type == JTokenType.Array || currentToken.Type == JTokenType.Constructor)\n                            {\n                                int index;\n                                if (int.TryParse(part, out index) && index >= 0 && index < currentToken.Count())\n                                    currentToken = currentToken[index];\n                                else\n                                    currentToken = null;\n                            }\n\n                            if (currentToken == null)\n                                break;\n                        }\n\n                        if (currentToken != null)\n                            resolvedSchema = BuildSchema(currentToken);\n                    }\n\n                    if (resolvedSchema == null)\n                        throw new JsonException(\"Could not resolve schema reference '{0}'.\".FormatWith(CultureInfo.InvariantCulture, schema.DeferredReference));\n                }\n\n                schema = resolvedSchema;\n            }\n\n            if (schema.ReferencesResolved)\n                return schema;\n\n            schema.ReferencesResolved = true;\n\n            if (schema.Extends != null)\n            {\n                for (int i = 0; i < schema.Extends.Count; i++)\n                {\n                    schema.Extends[i] = ResolveReferences(schema.Extends[i]);\n                }\n            }\n\n            if (schema.Items != null)\n            {\n                for (int i = 0; i < schema.Items.Count; i++)\n                {\n                    schema.Items[i] = ResolveReferences(schema.Items[i]);\n                }\n            }\n\n            if (schema.AdditionalItems != null)\n                schema.AdditionalItems = ResolveReferences(schema.AdditionalItems);\n\n            if (schema.PatternProperties != null)\n            {\n                foreach (KeyValuePair<string, JsonSchema> patternProperty in schema.PatternProperties.ToList())\n                {\n                    schema.PatternProperties[patternProperty.Key] = ResolveReferences(patternProperty.Value);\n                }\n            }\n\n            if (schema.Properties != null)\n            {\n                foreach (KeyValuePair<string, JsonSchema> property in schema.Properties.ToList())\n                {\n                    schema.Properties[property.Key] = ResolveReferences(property.Value);\n                }\n            }\n\n            if (schema.AdditionalProperties != null)\n                schema.AdditionalProperties = ResolveReferences(schema.AdditionalProperties);\n\n            return schema;\n        }\n\n        private JsonSchema BuildSchema(JToken token)\n        {\n            JObject schemaObject = token as JObject;\n            if (schemaObject == null)\n                throw JsonException.Create(token, token.Path, \"Expected object while parsing schema object, got {0}.\".FormatWith(CultureInfo.InvariantCulture, token.Type));\n\n            JToken referenceToken;\n            if (schemaObject.TryGetValue(JsonTypeReflector.RefPropertyName, out referenceToken))\n            {\n                JsonSchema deferredSchema = new JsonSchema();\n                deferredSchema.DeferredReference = (string)referenceToken;\n\n                return deferredSchema;\n            }\n\n            string location = token.Path.Replace(\".\", \"/\").Replace(\"[\", \"/\").Replace(\"]\", string.Empty);\n            if (!string.IsNullOrEmpty(location))\n                location = \"/\" + location;\n            location = \"#\" + location;\n\n            JsonSchema existingSchema;\n            if (_documentSchemas.TryGetValue(location, out existingSchema))\n                return existingSchema;\n\n            Push(new JsonSchema { Location = location });\n\n            ProcessSchemaProperties(schemaObject);\n\n            return Pop();\n        }\n\n        private void ProcessSchemaProperties(JObject schemaObject)\n        {\n            foreach (KeyValuePair<string, JToken> property in schemaObject)\n            {\n                switch (property.Key)\n                {\n                    case JsonSchemaConstants.TypePropertyName:\n                        CurrentSchema.Type = ProcessType(property.Value);\n                        break;\n                    case JsonSchemaConstants.IdPropertyName:\n                        CurrentSchema.Id = (string)property.Value;\n                        break;\n                    case JsonSchemaConstants.TitlePropertyName:\n                        CurrentSchema.Title = (string)property.Value;\n                        break;\n                    case JsonSchemaConstants.DescriptionPropertyName:\n                        CurrentSchema.Description = (string)property.Value;\n                        break;\n                    case JsonSchemaConstants.PropertiesPropertyName:\n                        CurrentSchema.Properties = ProcessProperties(property.Value);\n                        break;\n                    case JsonSchemaConstants.ItemsPropertyName:\n                        ProcessItems(property.Value);\n                        break;\n                    case JsonSchemaConstants.AdditionalPropertiesPropertyName:\n                        ProcessAdditionalProperties(property.Value);\n                        break;\n                    case JsonSchemaConstants.AdditionalItemsPropertyName:\n                        ProcessAdditionalItems(property.Value);\n                        break;\n                    case JsonSchemaConstants.PatternPropertiesPropertyName:\n                        CurrentSchema.PatternProperties = ProcessProperties(property.Value);\n                        break;\n                    case JsonSchemaConstants.RequiredPropertyName:\n                        CurrentSchema.Required = (bool)property.Value;\n                        break;\n                    case JsonSchemaConstants.RequiresPropertyName:\n                        CurrentSchema.Requires = (string)property.Value;\n                        break;\n                    case JsonSchemaConstants.MinimumPropertyName:\n                        CurrentSchema.Minimum = (double)property.Value;\n                        break;\n                    case JsonSchemaConstants.MaximumPropertyName:\n                        CurrentSchema.Maximum = (double)property.Value;\n                        break;\n                    case JsonSchemaConstants.ExclusiveMinimumPropertyName:\n                        CurrentSchema.ExclusiveMinimum = (bool)property.Value;\n                        break;\n                    case JsonSchemaConstants.ExclusiveMaximumPropertyName:\n                        CurrentSchema.ExclusiveMaximum = (bool)property.Value;\n                        break;\n                    case JsonSchemaConstants.MaximumLengthPropertyName:\n                        CurrentSchema.MaximumLength = (int)property.Value;\n                        break;\n                    case JsonSchemaConstants.MinimumLengthPropertyName:\n                        CurrentSchema.MinimumLength = (int)property.Value;\n                        break;\n                    case JsonSchemaConstants.MaximumItemsPropertyName:\n                        CurrentSchema.MaximumItems = (int)property.Value;\n                        break;\n                    case JsonSchemaConstants.MinimumItemsPropertyName:\n                        CurrentSchema.MinimumItems = (int)property.Value;\n                        break;\n                    case JsonSchemaConstants.DivisibleByPropertyName:\n                        CurrentSchema.DivisibleBy = (double)property.Value;\n                        break;\n                    case JsonSchemaConstants.DisallowPropertyName:\n                        CurrentSchema.Disallow = ProcessType(property.Value);\n                        break;\n                    case JsonSchemaConstants.DefaultPropertyName:\n                        CurrentSchema.Default = property.Value.DeepClone();\n                        break;\n                    case JsonSchemaConstants.HiddenPropertyName:\n                        CurrentSchema.Hidden = (bool)property.Value;\n                        break;\n                    case JsonSchemaConstants.ReadOnlyPropertyName:\n                        CurrentSchema.ReadOnly = (bool)property.Value;\n                        break;\n                    case JsonSchemaConstants.FormatPropertyName:\n                        CurrentSchema.Format = (string)property.Value;\n                        break;\n                    case JsonSchemaConstants.PatternPropertyName:\n                        CurrentSchema.Pattern = (string)property.Value;\n                        break;\n                    case JsonSchemaConstants.EnumPropertyName:\n                        ProcessEnum(property.Value);\n                        break;\n                    case JsonSchemaConstants.ExtendsPropertyName:\n                        ProcessExtends(property.Value);\n                        break;\n                    case JsonSchemaConstants.UniqueItemsPropertyName:\n                        CurrentSchema.UniqueItems = (bool)property.Value;\n                        break;\n                }\n            }\n        }\n\n        private void ProcessExtends(JToken token)\n        {\n            IList<JsonSchema> schemas = new List<JsonSchema>();\n\n            if (token.Type == JTokenType.Array)\n            {\n                foreach (JToken schemaObject in token)\n                {\n                    schemas.Add(BuildSchema(schemaObject));\n                }\n            }\n            else\n            {\n                JsonSchema schema = BuildSchema(token);\n                if (schema != null)\n                    schemas.Add(schema);\n            }\n\n            if (schemas.Count > 0)\n                CurrentSchema.Extends = schemas;\n        }\n\n        private void ProcessEnum(JToken token)\n        {\n            if (token.Type != JTokenType.Array)\n                throw JsonException.Create(token, token.Path, \"Expected Array token while parsing enum values, got {0}.\".FormatWith(CultureInfo.InvariantCulture, token.Type));\n\n            CurrentSchema.Enum = new List<JToken>();\n\n            foreach (JToken enumValue in token)\n            {\n                CurrentSchema.Enum.Add(enumValue.DeepClone());\n            }\n        }\n\n        private void ProcessAdditionalProperties(JToken token)\n        {\n            if (token.Type == JTokenType.Boolean)\n                CurrentSchema.AllowAdditionalProperties = (bool)token;\n            else\n                CurrentSchema.AdditionalProperties = BuildSchema(token);\n        }\n\n        private void ProcessAdditionalItems(JToken token)\n        {\n            if (token.Type == JTokenType.Boolean)\n                CurrentSchema.AllowAdditionalItems = (bool)token;\n            else\n                CurrentSchema.AdditionalItems = BuildSchema(token);\n        }\n\n        private IDictionary<string, JsonSchema> ProcessProperties(JToken token)\n        {\n            IDictionary<string, JsonSchema> properties = new Dictionary<string, JsonSchema>();\n\n            if (token.Type != JTokenType.Object)\n                throw JsonException.Create(token, token.Path, \"Expected Object token while parsing schema properties, got {0}.\".FormatWith(CultureInfo.InvariantCulture, token.Type));\n\n            foreach (JProperty propertyToken in token)\n            {\n                if (properties.ContainsKey(propertyToken.Name))\n                    throw new JsonException(\"Property {0} has already been defined in schema.\".FormatWith(CultureInfo.InvariantCulture, propertyToken.Name));\n\n                properties.Add(propertyToken.Name, BuildSchema(propertyToken.Value));\n            }\n\n            return properties;\n        }\n\n        private void ProcessItems(JToken token)\n        {\n            CurrentSchema.Items = new List<JsonSchema>();\n\n            switch (token.Type)\n            {\n                case JTokenType.Object:\n                    CurrentSchema.Items.Add(BuildSchema(token));\n                    CurrentSchema.PositionalItemsValidation = false;\n                    break;\n                case JTokenType.Array:\n                    CurrentSchema.PositionalItemsValidation = true;\n                    foreach (JToken schemaToken in token)\n                    {\n                        CurrentSchema.Items.Add(BuildSchema(schemaToken));\n                    }\n                    break;\n                default:\n                    throw JsonException.Create(token, token.Path, \"Expected array or JSON schema object, got {0}.\".FormatWith(CultureInfo.InvariantCulture, token.Type));\n            }\n        }\n\n        private JsonSchemaType? ProcessType(JToken token)\n        {\n            switch (token.Type)\n            {\n                case JTokenType.Array:\n                    // ensure type is in blank state before ORing values\n                    JsonSchemaType? type = JsonSchemaType.None;\n\n                    foreach (JToken typeToken in token)\n                    {\n                        if (typeToken.Type != JTokenType.String)\n                            throw JsonException.Create(typeToken, typeToken.Path, \"Exception JSON schema type string token, got {0}.\".FormatWith(CultureInfo.InvariantCulture, token.Type));\n\n                        type = type | MapType((string)typeToken);\n                    }\n\n                    return type;\n                case JTokenType.String:\n                    return MapType((string)token);\n                default:\n                    throw JsonException.Create(token, token.Path, \"Expected array or JSON schema type string token, got {0}.\".FormatWith(CultureInfo.InvariantCulture, token.Type));\n            }\n        }\n\n        internal static JsonSchemaType MapType(string type)\n        {\n            JsonSchemaType mappedType;\n            if (!JsonSchemaConstants.JsonSchemaTypeMapping.TryGetValue(type, out mappedType))\n                throw new JsonException(\"Invalid JSON schema type: {0}\".FormatWith(CultureInfo.InvariantCulture, type));\n\n            return mappedType;\n        }\n\n        internal static string MapType(JsonSchemaType type)\n        {\n            return JsonSchemaConstants.JsonSchemaTypeMapping.Single(kv => kv.Value == type).Key;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchemaConstants.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections.Generic;\n\nnamespace Newtonsoft.Json.Schema\n{\n    internal static class JsonSchemaConstants\n    {\n        public const string TypePropertyName = \"type\";\n        public const string PropertiesPropertyName = \"properties\";\n        public const string ItemsPropertyName = \"items\";\n        public const string AdditionalItemsPropertyName = \"additionalItems\";\n        public const string RequiredPropertyName = \"required\";\n        public const string PatternPropertiesPropertyName = \"patternProperties\";\n        public const string AdditionalPropertiesPropertyName = \"additionalProperties\";\n        public const string RequiresPropertyName = \"requires\";\n        public const string MinimumPropertyName = \"minimum\";\n        public const string MaximumPropertyName = \"maximum\";\n        public const string ExclusiveMinimumPropertyName = \"exclusiveMinimum\";\n        public const string ExclusiveMaximumPropertyName = \"exclusiveMaximum\";\n        public const string MinimumItemsPropertyName = \"minItems\";\n        public const string MaximumItemsPropertyName = \"maxItems\";\n        public const string PatternPropertyName = \"pattern\";\n        public const string MaximumLengthPropertyName = \"maxLength\";\n        public const string MinimumLengthPropertyName = \"minLength\";\n        public const string EnumPropertyName = \"enum\";\n        public const string ReadOnlyPropertyName = \"readonly\";\n        public const string TitlePropertyName = \"title\";\n        public const string DescriptionPropertyName = \"description\";\n        public const string FormatPropertyName = \"format\";\n        public const string DefaultPropertyName = \"default\";\n        public const string TransientPropertyName = \"transient\";\n        public const string DivisibleByPropertyName = \"divisibleBy\";\n        public const string HiddenPropertyName = \"hidden\";\n        public const string DisallowPropertyName = \"disallow\";\n        public const string ExtendsPropertyName = \"extends\";\n        public const string IdPropertyName = \"id\";\n        public const string UniqueItemsPropertyName = \"uniqueItems\";\n\n        public const string OptionValuePropertyName = \"value\";\n        public const string OptionLabelPropertyName = \"label\";\n\n        public static readonly IDictionary<string, JsonSchemaType> JsonSchemaTypeMapping = new Dictionary<string, JsonSchemaType>\n        {\n            { \"string\", JsonSchemaType.String },\n            { \"object\", JsonSchemaType.Object },\n            { \"integer\", JsonSchemaType.Integer },\n            { \"number\", JsonSchemaType.Float },\n            { \"null\", JsonSchemaType.Null },\n            { \"boolean\", JsonSchemaType.Boolean },\n            { \"array\", JsonSchemaType.Array },\n            { \"any\", JsonSchemaType.Any }\n        };\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchemaException.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Runtime.Serialization;\n\nnamespace Newtonsoft.Json.Schema\n{\n    /// <summary>\n    /// Returns detailed information about the schema exception.\n    /// </summary>\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n    [Serializable]\n#endif\n    public class JsonSchemaException : JsonException\n    {\n        /// <summary>\n        /// Gets the line number indicating where the error occurred.\n        /// </summary>\n        /// <value>The line number indicating where the error occurred.</value>\n        public int LineNumber { get; private set; }\n\n\n        /// <summary>\n        /// Gets the line position indicating where the error occurred.\n        /// </summary>\n        /// <value>The line position indicating where the error occurred.</value>\n        public int LinePosition { get; private set; }\n\n        /// <summary>\n        /// Gets the path to the JSON where the error occurred.\n        /// </summary>\n        /// <value>The path to the JSON where the error occurred.</value>\n        public string Path { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSchemaException\"/> class.\n        /// </summary>\n        public JsonSchemaException()\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSchemaException\"/> class\n        /// with a specified error message.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        public JsonSchemaException(string message)\n            : base(message)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSchemaException\"/> class\n        /// with a specified error message and a reference to the inner exception that is the cause of this exception.\n        /// </summary>\n        /// <param name=\"message\">The error message that explains the reason for the exception.</param>\n        /// <param name=\"innerException\">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>\n        public JsonSchemaException(string message, Exception innerException)\n            : base(message, innerException)\n        {\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSchemaException\"/> class.\n        /// </summary>\n        /// <param name=\"info\">The <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n        /// <param name=\"context\">The <see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        /// <exception cref=\"T:System.ArgumentNullException\">The <paramref name=\"info\"/> parameter is null. </exception>\n        /// <exception cref=\"T:System.Runtime.Serialization.SerializationException\">The class name is null or <see cref=\"P:System.Exception.HResult\"/> is zero (0). </exception>\n        public JsonSchemaException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n#endif\n\n        internal JsonSchemaException(string message, Exception innerException, string path, int lineNumber, int linePosition)\n            : base(message, innerException)\n        {\n            Path = path;\n            LineNumber = lineNumber;\n            LinePosition = linePosition;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchemaGenerator.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Globalization;\nusing System.ComponentModel;\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Utilities;\nusing Newtonsoft.Json.Serialization;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Schema\n{\n    /// <summary>\n    /// Generates a <see cref=\"JsonSchema\"/> from a specified <see cref=\"Type\"/>.\n    /// </summary>\n    public class JsonSchemaGenerator\n    {\n        /// <summary>\n        /// Gets or sets how undefined schemas are handled by the serializer.\n        /// </summary>\n        public UndefinedSchemaIdHandling UndefinedSchemaIdHandling { get; set; }\n\n        private IContractResolver _contractResolver;\n\n        /// <summary>\n        /// Gets or sets the contract resolver.\n        /// </summary>\n        /// <value>The contract resolver.</value>\n        public IContractResolver ContractResolver\n        {\n            get\n            {\n                if (_contractResolver == null)\n                    return DefaultContractResolver.Instance;\n\n                return _contractResolver;\n            }\n            set { _contractResolver = value; }\n        }\n\n        private class TypeSchema\n        {\n            public Type Type { get; private set; }\n            public JsonSchema Schema { get; private set; }\n\n            public TypeSchema(Type type, JsonSchema schema)\n            {\n                ValidationUtils.ArgumentNotNull(type, \"type\");\n                ValidationUtils.ArgumentNotNull(schema, \"schema\");\n\n                Type = type;\n                Schema = schema;\n            }\n        }\n\n        private JsonSchemaResolver _resolver;\n        private readonly IList<TypeSchema> _stack = new List<TypeSchema>();\n        private JsonSchema _currentSchema;\n\n        private JsonSchema CurrentSchema\n        {\n            get { return _currentSchema; }\n        }\n\n        private void Push(TypeSchema typeSchema)\n        {\n            _currentSchema = typeSchema.Schema;\n            _stack.Add(typeSchema);\n            _resolver.LoadedSchemas.Add(typeSchema.Schema);\n        }\n\n        private TypeSchema Pop()\n        {\n            TypeSchema popped = _stack[_stack.Count - 1];\n            _stack.RemoveAt(_stack.Count - 1);\n            TypeSchema newValue = _stack.LastOrDefault();\n            if (newValue != null)\n            {\n                _currentSchema = newValue.Schema;\n            }\n            else\n            {\n                _currentSchema = null;\n            }\n\n            return popped;\n        }\n\n        /// <summary>\n        /// Generate a <see cref=\"JsonSchema\"/> from the specified type.\n        /// </summary>\n        /// <param name=\"type\">The type to generate a <see cref=\"JsonSchema\"/> from.</param>\n        /// <returns>A <see cref=\"JsonSchema\"/> generated from the specified type.</returns>\n        public JsonSchema Generate(Type type)\n        {\n            return Generate(type, new JsonSchemaResolver(), false);\n        }\n\n        /// <summary>\n        /// Generate a <see cref=\"JsonSchema\"/> from the specified type.\n        /// </summary>\n        /// <param name=\"type\">The type to generate a <see cref=\"JsonSchema\"/> from.</param>\n        /// <param name=\"resolver\">The <see cref=\"JsonSchemaResolver\"/> used to resolve schema references.</param>\n        /// <returns>A <see cref=\"JsonSchema\"/> generated from the specified type.</returns>\n        public JsonSchema Generate(Type type, JsonSchemaResolver resolver)\n        {\n            return Generate(type, resolver, false);\n        }\n\n        /// <summary>\n        /// Generate a <see cref=\"JsonSchema\"/> from the specified type.\n        /// </summary>\n        /// <param name=\"type\">The type to generate a <see cref=\"JsonSchema\"/> from.</param>\n        /// <param name=\"rootSchemaNullable\">Specify whether the generated root <see cref=\"JsonSchema\"/> will be nullable.</param>\n        /// <returns>A <see cref=\"JsonSchema\"/> generated from the specified type.</returns>\n        public JsonSchema Generate(Type type, bool rootSchemaNullable)\n        {\n            return Generate(type, new JsonSchemaResolver(), rootSchemaNullable);\n        }\n\n        /// <summary>\n        /// Generate a <see cref=\"JsonSchema\"/> from the specified type.\n        /// </summary>\n        /// <param name=\"type\">The type to generate a <see cref=\"JsonSchema\"/> from.</param>\n        /// <param name=\"resolver\">The <see cref=\"JsonSchemaResolver\"/> used to resolve schema references.</param>\n        /// <param name=\"rootSchemaNullable\">Specify whether the generated root <see cref=\"JsonSchema\"/> will be nullable.</param>\n        /// <returns>A <see cref=\"JsonSchema\"/> generated from the specified type.</returns>\n        public JsonSchema Generate(Type type, JsonSchemaResolver resolver, bool rootSchemaNullable)\n        {\n            ValidationUtils.ArgumentNotNull(type, \"type\");\n            ValidationUtils.ArgumentNotNull(resolver, \"resolver\");\n\n            _resolver = resolver;\n\n            return GenerateInternal(type, (!rootSchemaNullable) ? Required.Always : Required.Default, false);\n        }\n\n        private string GetTitle(Type type)\n        {\n            JsonContainerAttribute containerAttribute = JsonTypeReflector.GetJsonContainerAttribute(type);\n\n            if (containerAttribute != null && !string.IsNullOrEmpty(containerAttribute.Title))\n                return containerAttribute.Title;\n\n            return null;\n        }\n\n        private string GetDescription(Type type)\n        {\n            JsonContainerAttribute containerAttribute = JsonTypeReflector.GetJsonContainerAttribute(type);\n\n            if (containerAttribute != null && !string.IsNullOrEmpty(containerAttribute.Description))\n                return containerAttribute.Description;\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            DescriptionAttribute descriptionAttribute = ReflectionUtils.GetAttribute<DescriptionAttribute>(type);\n            if (descriptionAttribute != null)\n                return descriptionAttribute.Description;\n#endif\n\n            return null;\n        }\n\n        private string GetTypeId(Type type, bool explicitOnly)\n        {\n            JsonContainerAttribute containerAttribute = JsonTypeReflector.GetJsonContainerAttribute(type);\n\n            if (containerAttribute != null && !string.IsNullOrEmpty(containerAttribute.Id))\n                return containerAttribute.Id;\n\n            if (explicitOnly)\n                return null;\n\n            switch (UndefinedSchemaIdHandling)\n            {\n                case UndefinedSchemaIdHandling.UseTypeName:\n                    return type.FullName;\n                case UndefinedSchemaIdHandling.UseAssemblyQualifiedName:\n                    return type.AssemblyQualifiedName;\n                default:\n                    return null;\n            }\n        }\n\n        private JsonSchema GenerateInternal(Type type, Required valueRequired, bool required)\n        {\n            ValidationUtils.ArgumentNotNull(type, \"type\");\n\n            string resolvedId = GetTypeId(type, false);\n            string explicitId = GetTypeId(type, true);\n\n            if (!string.IsNullOrEmpty(resolvedId))\n            {\n                JsonSchema resolvedSchema = _resolver.GetSchema(resolvedId);\n                if (resolvedSchema != null)\n                {\n                    // resolved schema is not null but referencing member allows nulls\n                    // change resolved schema to allow nulls. hacky but what are ya gonna do?\n                    if (valueRequired != Required.Always && !HasFlag(resolvedSchema.Type, JsonSchemaType.Null))\n                        resolvedSchema.Type |= JsonSchemaType.Null;\n                    if (required && resolvedSchema.Required != true)\n                        resolvedSchema.Required = true;\n\n                    return resolvedSchema;\n                }\n            }\n\n            // test for unresolved circular reference\n            if (_stack.Any(tc => tc.Type == type))\n            {\n                throw new JsonException(\"Unresolved circular reference for type '{0}'. Explicitly define an Id for the type using a JsonObject/JsonArray attribute or automatically generate a type Id using the UndefinedSchemaIdHandling property.\".FormatWith(CultureInfo.InvariantCulture, type));\n            }\n\n            JsonContract contract = ContractResolver.ResolveContract(type);\n            JsonConverter converter;\n            if ((converter = contract.Converter) != null || (converter = contract.InternalConverter) != null)\n            {\n                JsonSchema converterSchema = converter.GetSchema();\n                if (converterSchema != null)\n                    return converterSchema;\n            }\n\n            Push(new TypeSchema(type, new JsonSchema()));\n\n            if (explicitId != null)\n                CurrentSchema.Id = explicitId;\n\n            if (required)\n                CurrentSchema.Required = true;\n            CurrentSchema.Title = GetTitle(type);\n            CurrentSchema.Description = GetDescription(type);\n\n            if (converter != null)\n            {\n                // todo: Add GetSchema to JsonConverter and use here?\n                CurrentSchema.Type = JsonSchemaType.Any;\n            }\n            else\n            {\n                switch (contract.ContractType)\n                {\n                    case JsonContractType.Object:\n                        CurrentSchema.Type = AddNullType(JsonSchemaType.Object, valueRequired);\n                        CurrentSchema.Id = GetTypeId(type, false);\n                        GenerateObjectSchema(type, (JsonObjectContract)contract);\n                        break;\n                    case JsonContractType.Array:\n                        CurrentSchema.Type = AddNullType(JsonSchemaType.Array, valueRequired);\n\n                        CurrentSchema.Id = GetTypeId(type, false);\n\n                        JsonArrayAttribute arrayAttribute = JsonTypeReflector.GetJsonContainerAttribute(type) as JsonArrayAttribute;\n                        bool allowNullItem = (arrayAttribute == null || arrayAttribute.AllowNullItems);\n\n                        Type collectionItemType = ReflectionUtils.GetCollectionItemType(type);\n                        if (collectionItemType != null)\n                        {\n                            CurrentSchema.Items = new List<JsonSchema>();\n                            CurrentSchema.Items.Add(GenerateInternal(collectionItemType, (!allowNullItem) ? Required.Always : Required.Default, false));\n                        }\n                        break;\n                    case JsonContractType.Primitive:\n                        CurrentSchema.Type = GetJsonSchemaType(type, valueRequired);\n\n                        if (CurrentSchema.Type == JsonSchemaType.Integer && type.IsEnum() && !type.IsDefined(typeof(FlagsAttribute), true))\n                        {\n                            CurrentSchema.Enum = new List<JToken>();\n\n                            EnumValues<long> enumValues = EnumUtils.GetNamesAndValues<long>(type);\n                            foreach (EnumValue<long> enumValue in enumValues)\n                            {\n                                JToken value = JToken.FromObject(enumValue.Value);\n\n                                CurrentSchema.Enum.Add(value);\n                            }\n                        }\n                        break;\n                    case JsonContractType.String:\n                        JsonSchemaType schemaType = (!ReflectionUtils.IsNullable(contract.UnderlyingType))\n                            ? JsonSchemaType.String\n                            : AddNullType(JsonSchemaType.String, valueRequired);\n\n                        CurrentSchema.Type = schemaType;\n                        break;\n                    case JsonContractType.Dictionary:\n                        CurrentSchema.Type = AddNullType(JsonSchemaType.Object, valueRequired);\n\n                        Type keyType;\n                        Type valueType;\n                        ReflectionUtils.GetDictionaryKeyValueTypes(type, out keyType, out valueType);\n\n                        if (keyType != null)\n                        {\n                            JsonContract keyContract = ContractResolver.ResolveContract(keyType);\n\n                            // can be converted to a string\n                            if (keyContract.ContractType == JsonContractType.Primitive)\n                            {\n                                CurrentSchema.AdditionalProperties = GenerateInternal(valueType, Required.Default, false);\n                            }\n                        }\n                        break;\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n                    case JsonContractType.Serializable:\n                        CurrentSchema.Type = AddNullType(JsonSchemaType.Object, valueRequired);\n                        CurrentSchema.Id = GetTypeId(type, false);\n                        GenerateISerializableContract(type, (JsonISerializableContract)contract);\n                        break;\n#endif\n#if !(NET35 || NET20 || PORTABLE40)\n                    case JsonContractType.Dynamic:\n#endif\n                    case JsonContractType.Linq:\n                        CurrentSchema.Type = JsonSchemaType.Any;\n                        break;\n                    default:\n                        throw new JsonException(\"Unexpected contract type: {0}\".FormatWith(CultureInfo.InvariantCulture, contract));\n                }\n            }\n\n            return Pop().Schema;\n        }\n\n        private JsonSchemaType AddNullType(JsonSchemaType type, Required valueRequired)\n        {\n            if (valueRequired != Required.Always)\n                return type | JsonSchemaType.Null;\n\n            return type;\n        }\n\n        private bool HasFlag(DefaultValueHandling value, DefaultValueHandling flag)\n        {\n            return ((value & flag) == flag);\n        }\n\n        private void GenerateObjectSchema(Type type, JsonObjectContract contract)\n        {\n            CurrentSchema.Properties = new Dictionary<string, JsonSchema>();\n            foreach (JsonProperty property in contract.Properties)\n            {\n                if (!property.Ignored)\n                {\n                    bool optional = property.NullValueHandling == NullValueHandling.Ignore ||\n                                    HasFlag(property.DefaultValueHandling.GetValueOrDefault(), DefaultValueHandling.Ignore) ||\n                                    property.ShouldSerialize != null ||\n                                    property.GetIsSpecified != null;\n\n                    JsonSchema propertySchema = GenerateInternal(property.PropertyType, property.Required, !optional);\n\n                    if (property.DefaultValue != null)\n                        propertySchema.Default = JToken.FromObject(property.DefaultValue);\n\n                    CurrentSchema.Properties.Add(property.PropertyName, propertySchema);\n                }\n            }\n\n            if (type.IsSealed())\n                CurrentSchema.AllowAdditionalProperties = false;\n        }\n\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n        private void GenerateISerializableContract(Type type, JsonISerializableContract contract)\n        {\n            CurrentSchema.AllowAdditionalProperties = true;\n        }\n#endif\n\n        internal static bool HasFlag(JsonSchemaType? value, JsonSchemaType flag)\n        {\n            // default value is Any\n            if (value == null)\n                return true;\n\n            bool match = ((value & flag) == flag);\n            if (match)\n                return true;\n\n            // integer is a subset of float\n            if (flag == JsonSchemaType.Integer && (value & JsonSchemaType.Float) == JsonSchemaType.Float)\n                return true;\n\n            return false;\n        }\n\n        private JsonSchemaType GetJsonSchemaType(Type type, Required valueRequired)\n        {\n            JsonSchemaType schemaType = JsonSchemaType.None;\n            if (valueRequired != Required.Always && ReflectionUtils.IsNullable(type))\n            {\n                schemaType = JsonSchemaType.Null;\n                if (ReflectionUtils.IsNullableType(type))\n                    type = Nullable.GetUnderlyingType(type);\n            }\n\n            PrimitiveTypeCode typeCode = ConvertUtils.GetTypeCode(type);\n\n            switch (typeCode)\n            {\n                case PrimitiveTypeCode.Empty:\n                case PrimitiveTypeCode.Object:\n                    return schemaType | JsonSchemaType.String;\n#if !(NETFX_CORE || PORTABLE)\n                case PrimitiveTypeCode.DBNull:\n                    return schemaType | JsonSchemaType.Null;\n#endif\n                case PrimitiveTypeCode.Boolean:\n                    return schemaType | JsonSchemaType.Boolean;\n                case PrimitiveTypeCode.Char:\n                    return schemaType | JsonSchemaType.String;\n                case PrimitiveTypeCode.SByte:\n                case PrimitiveTypeCode.Byte:\n                case PrimitiveTypeCode.Int16:\n                case PrimitiveTypeCode.UInt16:\n                case PrimitiveTypeCode.Int32:\n                case PrimitiveTypeCode.UInt32:\n                case PrimitiveTypeCode.Int64:\n                case PrimitiveTypeCode.UInt64:\n#if !(PORTABLE || NET35 || NET20)\n                case PrimitiveTypeCode.BigInteger:\n#endif\n                    return schemaType | JsonSchemaType.Integer;\n                case PrimitiveTypeCode.Single:\n                case PrimitiveTypeCode.Double:\n                case PrimitiveTypeCode.Decimal:\n                    return schemaType | JsonSchemaType.Float;\n                    // convert to string?\n                case PrimitiveTypeCode.DateTime:\n#if !NET20\n                case PrimitiveTypeCode.DateTimeOffset:\n#endif\n                    return schemaType | JsonSchemaType.String;\n                case PrimitiveTypeCode.String:\n                case PrimitiveTypeCode.Uri:\n                case PrimitiveTypeCode.Guid:\n                case PrimitiveTypeCode.TimeSpan:\n                case PrimitiveTypeCode.Bytes:\n                    return schemaType | JsonSchemaType.String;\n                default:\n                    throw new JsonException(\"Unexpected type code '{0}' for type '{1}'.\".FormatWith(CultureInfo.InvariantCulture, typeCode, type));\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchemaModel.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Schema\n{\n    internal class JsonSchemaModel\n    {\n        public bool Required { get; set; }\n        public JsonSchemaType Type { get; set; }\n        public int? MinimumLength { get; set; }\n        public int? MaximumLength { get; set; }\n        public double? DivisibleBy { get; set; }\n        public double? Minimum { get; set; }\n        public double? Maximum { get; set; }\n        public bool ExclusiveMinimum { get; set; }\n        public bool ExclusiveMaximum { get; set; }\n        public int? MinimumItems { get; set; }\n        public int? MaximumItems { get; set; }\n        public IList<string> Patterns { get; set; }\n        public IList<JsonSchemaModel> Items { get; set; }\n        public IDictionary<string, JsonSchemaModel> Properties { get; set; }\n        public IDictionary<string, JsonSchemaModel> PatternProperties { get; set; }\n        public JsonSchemaModel AdditionalProperties { get; set; }\n        public JsonSchemaModel AdditionalItems { get; set; }\n        public bool PositionalItemsValidation { get; set; }\n        public bool AllowAdditionalProperties { get; set; }\n        public bool AllowAdditionalItems { get; set; }\n        public bool UniqueItems { get; set; }\n        public IList<JToken> Enum { get; set; }\n        public JsonSchemaType Disallow { get; set; }\n\n        public JsonSchemaModel()\n        {\n            Type = JsonSchemaType.Any;\n            AllowAdditionalProperties = true;\n            AllowAdditionalItems = true;\n            Required = false;\n        }\n\n        public static JsonSchemaModel Create(IList<JsonSchema> schemata)\n        {\n            JsonSchemaModel model = new JsonSchemaModel();\n\n            foreach (JsonSchema schema in schemata)\n            {\n                Combine(model, schema);\n            }\n\n            return model;\n        }\n\n        private static void Combine(JsonSchemaModel model, JsonSchema schema)\n        {\n            // Version 3 of the Draft JSON Schema has the default value of Not Required\n            model.Required = model.Required || (schema.Required ?? false);\n            model.Type = model.Type & (schema.Type ?? JsonSchemaType.Any);\n\n            model.MinimumLength = MathUtils.Max(model.MinimumLength, schema.MinimumLength);\n            model.MaximumLength = MathUtils.Min(model.MaximumLength, schema.MaximumLength);\n\n            // not sure what is the best way to combine divisibleBy\n            model.DivisibleBy = MathUtils.Max(model.DivisibleBy, schema.DivisibleBy);\n\n            model.Minimum = MathUtils.Max(model.Minimum, schema.Minimum);\n            model.Maximum = MathUtils.Max(model.Maximum, schema.Maximum);\n            model.ExclusiveMinimum = model.ExclusiveMinimum || (schema.ExclusiveMinimum ?? false);\n            model.ExclusiveMaximum = model.ExclusiveMaximum || (schema.ExclusiveMaximum ?? false);\n\n            model.MinimumItems = MathUtils.Max(model.MinimumItems, schema.MinimumItems);\n            model.MaximumItems = MathUtils.Min(model.MaximumItems, schema.MaximumItems);\n            model.PositionalItemsValidation = model.PositionalItemsValidation || schema.PositionalItemsValidation;\n            model.AllowAdditionalProperties = model.AllowAdditionalProperties && schema.AllowAdditionalProperties;\n            model.AllowAdditionalItems = model.AllowAdditionalItems && schema.AllowAdditionalItems;\n            model.UniqueItems = model.UniqueItems || schema.UniqueItems;\n            if (schema.Enum != null)\n            {\n                if (model.Enum == null)\n                    model.Enum = new List<JToken>();\n\n                model.Enum.AddRangeDistinct(schema.Enum, JToken.EqualityComparer);\n            }\n            model.Disallow = model.Disallow | (schema.Disallow ?? JsonSchemaType.None);\n\n            if (schema.Pattern != null)\n            {\n                if (model.Patterns == null)\n                    model.Patterns = new List<string>();\n\n                model.Patterns.AddDistinct(schema.Pattern);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchemaModelBuilder.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections.Generic;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Schema\n{\n    internal class JsonSchemaModelBuilder\n    {\n        private JsonSchemaNodeCollection _nodes = new JsonSchemaNodeCollection();\n        private Dictionary<JsonSchemaNode, JsonSchemaModel> _nodeModels = new Dictionary<JsonSchemaNode, JsonSchemaModel>();\n        private JsonSchemaNode _node;\n\n        public JsonSchemaModel Build(JsonSchema schema)\n        {\n            _nodes = new JsonSchemaNodeCollection();\n            _node = AddSchema(null, schema);\n\n            _nodeModels = new Dictionary<JsonSchemaNode, JsonSchemaModel>();\n            JsonSchemaModel model = BuildNodeModel(_node);\n\n            return model;\n        }\n\n        public JsonSchemaNode AddSchema(JsonSchemaNode existingNode, JsonSchema schema)\n        {\n            string newId;\n            if (existingNode != null)\n            {\n                if (existingNode.Schemas.Contains(schema))\n                    return existingNode;\n\n                newId = JsonSchemaNode.GetId(existingNode.Schemas.Union(new[] { schema }));\n            }\n            else\n            {\n                newId = JsonSchemaNode.GetId(new[] { schema });\n            }\n\n            if (_nodes.Contains(newId))\n                return _nodes[newId];\n\n            JsonSchemaNode currentNode = (existingNode != null)\n                ? existingNode.Combine(schema)\n                : new JsonSchemaNode(schema);\n\n            _nodes.Add(currentNode);\n\n            AddProperties(schema.Properties, currentNode.Properties);\n\n            AddProperties(schema.PatternProperties, currentNode.PatternProperties);\n\n            if (schema.Items != null)\n            {\n                for (int i = 0; i < schema.Items.Count; i++)\n                {\n                    AddItem(currentNode, i, schema.Items[i]);\n                }\n            }\n\n            if (schema.AdditionalItems != null)\n                AddAdditionalItems(currentNode, schema.AdditionalItems);\n\n            if (schema.AdditionalProperties != null)\n                AddAdditionalProperties(currentNode, schema.AdditionalProperties);\n\n            if (schema.Extends != null)\n            {\n                foreach (JsonSchema jsonSchema in schema.Extends)\n                {\n                    currentNode = AddSchema(currentNode, jsonSchema);\n                }\n            }\n\n            return currentNode;\n        }\n\n        public void AddProperties(IDictionary<string, JsonSchema> source, IDictionary<string, JsonSchemaNode> target)\n        {\n            if (source != null)\n            {\n                foreach (KeyValuePair<string, JsonSchema> property in source)\n                {\n                    AddProperty(target, property.Key, property.Value);\n                }\n            }\n        }\n\n        public void AddProperty(IDictionary<string, JsonSchemaNode> target, string propertyName, JsonSchema schema)\n        {\n            JsonSchemaNode propertyNode;\n            target.TryGetValue(propertyName, out propertyNode);\n\n            target[propertyName] = AddSchema(propertyNode, schema);\n        }\n\n        public void AddItem(JsonSchemaNode parentNode, int index, JsonSchema schema)\n        {\n            JsonSchemaNode existingItemNode = (parentNode.Items.Count > index)\n                ? parentNode.Items[index]\n                : null;\n\n            JsonSchemaNode newItemNode = AddSchema(existingItemNode, schema);\n\n            if (!(parentNode.Items.Count > index))\n            {\n                parentNode.Items.Add(newItemNode);\n            }\n            else\n            {\n                parentNode.Items[index] = newItemNode;\n            }\n        }\n\n        public void AddAdditionalProperties(JsonSchemaNode parentNode, JsonSchema schema)\n        {\n            parentNode.AdditionalProperties = AddSchema(parentNode.AdditionalProperties, schema);\n        }\n\n        public void AddAdditionalItems(JsonSchemaNode parentNode, JsonSchema schema)\n        {\n            parentNode.AdditionalItems = AddSchema(parentNode.AdditionalItems, schema);\n        }\n\n        private JsonSchemaModel BuildNodeModel(JsonSchemaNode node)\n        {\n            JsonSchemaModel model;\n            if (_nodeModels.TryGetValue(node, out model))\n                return model;\n\n            model = JsonSchemaModel.Create(node.Schemas);\n            _nodeModels[node] = model;\n\n            foreach (KeyValuePair<string, JsonSchemaNode> property in node.Properties)\n            {\n                if (model.Properties == null)\n                    model.Properties = new Dictionary<string, JsonSchemaModel>();\n\n                model.Properties[property.Key] = BuildNodeModel(property.Value);\n            }\n            foreach (KeyValuePair<string, JsonSchemaNode> property in node.PatternProperties)\n            {\n                if (model.PatternProperties == null)\n                    model.PatternProperties = new Dictionary<string, JsonSchemaModel>();\n\n                model.PatternProperties[property.Key] = BuildNodeModel(property.Value);\n            }\n            foreach (JsonSchemaNode t in node.Items)\n            {\n                if (model.Items == null)\n                    model.Items = new List<JsonSchemaModel>();\n\n                model.Items.Add(BuildNodeModel(t));\n            }\n            if (node.AdditionalProperties != null)\n                model.AdditionalProperties = BuildNodeModel(node.AdditionalProperties);\n            if (node.AdditionalItems != null)\n                model.AdditionalItems = BuildNodeModel(node.AdditionalItems);\n\n            return model;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchemaNode.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Schema\n{\n    internal class JsonSchemaNode\n    {\n        public string Id { get; private set; }\n        public ReadOnlyCollection<JsonSchema> Schemas { get; private set; }\n        public Dictionary<string, JsonSchemaNode> Properties { get; private set; }\n        public Dictionary<string, JsonSchemaNode> PatternProperties { get; private set; }\n        public List<JsonSchemaNode> Items { get; private set; }\n        public JsonSchemaNode AdditionalProperties { get; set; }\n        public JsonSchemaNode AdditionalItems { get; set; }\n\n        public JsonSchemaNode(JsonSchema schema)\n        {\n            Schemas = new ReadOnlyCollection<JsonSchema>(new[] { schema });\n            Properties = new Dictionary<string, JsonSchemaNode>();\n            PatternProperties = new Dictionary<string, JsonSchemaNode>();\n            Items = new List<JsonSchemaNode>();\n\n            Id = GetId(Schemas);\n        }\n\n        private JsonSchemaNode(JsonSchemaNode source, JsonSchema schema)\n        {\n            Schemas = new ReadOnlyCollection<JsonSchema>(source.Schemas.Union(new[] { schema }).ToList());\n            Properties = new Dictionary<string, JsonSchemaNode>(source.Properties);\n            PatternProperties = new Dictionary<string, JsonSchemaNode>(source.PatternProperties);\n            Items = new List<JsonSchemaNode>(source.Items);\n            AdditionalProperties = source.AdditionalProperties;\n            AdditionalItems = source.AdditionalItems;\n\n            Id = GetId(Schemas);\n        }\n\n        public JsonSchemaNode Combine(JsonSchema schema)\n        {\n            return new JsonSchemaNode(this, schema);\n        }\n\n        public static string GetId(IEnumerable<JsonSchema> schemata)\n        {\n            return string.Join(\"-\", schemata.Select(s => s.InternalId).OrderBy(id => id, StringComparer.Ordinal).ToArray());\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchemaNodeCollection.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections.ObjectModel;\n\nnamespace Newtonsoft.Json.Schema\n{\n    internal class JsonSchemaNodeCollection : KeyedCollection<string, JsonSchemaNode>\n    {\n        protected override string GetKeyForItem(JsonSchemaNode item)\n        {\n            return item.Id;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchemaResolver.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Schema\n{\n    /// <summary>\n    /// Resolves <see cref=\"JsonSchema\"/> from an id.\n    /// </summary>\n    public class JsonSchemaResolver\n    {\n        /// <summary>\n        /// Gets or sets the loaded schemas.\n        /// </summary>\n        /// <value>The loaded schemas.</value>\n        public IList<JsonSchema> LoadedSchemas { get; protected set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonSchemaResolver\"/> class.\n        /// </summary>\n        public JsonSchemaResolver()\n        {\n            LoadedSchemas = new List<JsonSchema>();\n        }\n\n        /// <summary>\n        /// Gets a <see cref=\"JsonSchema\"/> for the specified reference.\n        /// </summary>\n        /// <param name=\"reference\">The id.</param>\n        /// <returns>A <see cref=\"JsonSchema\"/> for the specified reference.</returns>\n        public virtual JsonSchema GetSchema(string reference)\n        {\n            JsonSchema schema = LoadedSchemas.SingleOrDefault(s => string.Equals(s.Id, reference, StringComparison.Ordinal));\n\n            if (schema == null)\n                schema = LoadedSchemas.SingleOrDefault(s => string.Equals(s.Location, reference, StringComparison.Ordinal));\n\n            return schema;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchemaType.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json.Schema\n{\n    /// <summary>\n    /// The value types allowed by the <see cref=\"JsonSchema\"/>.\n    /// </summary>\n    [Flags]\n    public enum JsonSchemaType\n    {\n        /// <summary>\n        /// No type specified.\n        /// </summary>\n        None = 0,\n\n        /// <summary>\n        /// String type.\n        /// </summary>\n        String = 1,\n\n        /// <summary>\n        /// Float type.\n        /// </summary>\n        Float = 2,\n\n        /// <summary>\n        /// Integer type.\n        /// </summary>\n        Integer = 4,\n\n        /// <summary>\n        /// Boolean type.\n        /// </summary>\n        Boolean = 8,\n\n        /// <summary>\n        /// Object type.\n        /// </summary>\n        Object = 16,\n\n        /// <summary>\n        /// Array type.\n        /// </summary>\n        Array = 32,\n\n        /// <summary>\n        /// Null type.\n        /// </summary>\n        Null = 64,\n\n        /// <summary>\n        /// Any type.\n        /// </summary>\n        Any = String | Float | Integer | Boolean | Object | Array | Null\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/JsonSchemaWriter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections.Generic;\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Serialization;\nusing Newtonsoft.Json.Utilities;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Schema\n{\n    internal class JsonSchemaWriter\n    {\n        private readonly JsonWriter _writer;\n        private readonly JsonSchemaResolver _resolver;\n\n        public JsonSchemaWriter(JsonWriter writer, JsonSchemaResolver resolver)\n        {\n            ValidationUtils.ArgumentNotNull(writer, \"writer\");\n            _writer = writer;\n            _resolver = resolver;\n        }\n\n        private void ReferenceOrWriteSchema(JsonSchema schema)\n        {\n            if (schema.Id != null && _resolver.GetSchema(schema.Id) != null)\n            {\n                _writer.WriteStartObject();\n                _writer.WritePropertyName(JsonTypeReflector.RefPropertyName);\n                _writer.WriteValue(schema.Id);\n                _writer.WriteEndObject();\n            }\n            else\n            {\n                WriteSchema(schema);\n            }\n        }\n\n        public void WriteSchema(JsonSchema schema)\n        {\n            ValidationUtils.ArgumentNotNull(schema, \"schema\");\n\n            if (!_resolver.LoadedSchemas.Contains(schema))\n                _resolver.LoadedSchemas.Add(schema);\n\n            _writer.WriteStartObject();\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.IdPropertyName, schema.Id);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.TitlePropertyName, schema.Title);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.DescriptionPropertyName, schema.Description);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.RequiredPropertyName, schema.Required);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.ReadOnlyPropertyName, schema.ReadOnly);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.HiddenPropertyName, schema.Hidden);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.TransientPropertyName, schema.Transient);\n            if (schema.Type != null)\n                WriteType(JsonSchemaConstants.TypePropertyName, _writer, schema.Type.Value);\n            if (!schema.AllowAdditionalProperties)\n            {\n                _writer.WritePropertyName(JsonSchemaConstants.AdditionalPropertiesPropertyName);\n                _writer.WriteValue(schema.AllowAdditionalProperties);\n            }\n            else\n            {\n                if (schema.AdditionalProperties != null)\n                {\n                    _writer.WritePropertyName(JsonSchemaConstants.AdditionalPropertiesPropertyName);\n                    ReferenceOrWriteSchema(schema.AdditionalProperties);\n                }\n            }\n            if (!schema.AllowAdditionalItems)\n            {\n                _writer.WritePropertyName(JsonSchemaConstants.AdditionalItemsPropertyName);\n                _writer.WriteValue(schema.AllowAdditionalItems);\n            }\n            else\n            {\n                if (schema.AdditionalItems != null)\n                {\n                    _writer.WritePropertyName(JsonSchemaConstants.AdditionalItemsPropertyName);\n                    ReferenceOrWriteSchema(schema.AdditionalItems);\n                }\n            }\n            WriteSchemaDictionaryIfNotNull(_writer, JsonSchemaConstants.PropertiesPropertyName, schema.Properties);\n            WriteSchemaDictionaryIfNotNull(_writer, JsonSchemaConstants.PatternPropertiesPropertyName, schema.PatternProperties);\n            WriteItems(schema);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.MinimumPropertyName, schema.Minimum);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.MaximumPropertyName, schema.Maximum);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.ExclusiveMinimumPropertyName, schema.ExclusiveMinimum);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.ExclusiveMaximumPropertyName, schema.ExclusiveMaximum);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.MinimumLengthPropertyName, schema.MinimumLength);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.MaximumLengthPropertyName, schema.MaximumLength);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.MinimumItemsPropertyName, schema.MinimumItems);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.MaximumItemsPropertyName, schema.MaximumItems);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.DivisibleByPropertyName, schema.DivisibleBy);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.FormatPropertyName, schema.Format);\n            WritePropertyIfNotNull(_writer, JsonSchemaConstants.PatternPropertyName, schema.Pattern);\n            if (schema.Enum != null)\n            {\n                _writer.WritePropertyName(JsonSchemaConstants.EnumPropertyName);\n                _writer.WriteStartArray();\n                foreach (JToken token in schema.Enum)\n                {\n                    token.WriteTo(_writer);\n                }\n                _writer.WriteEndArray();\n            }\n            if (schema.Default != null)\n            {\n                _writer.WritePropertyName(JsonSchemaConstants.DefaultPropertyName);\n                schema.Default.WriteTo(_writer);\n            }\n            if (schema.Disallow != null)\n                WriteType(JsonSchemaConstants.DisallowPropertyName, _writer, schema.Disallow.Value);\n            if (schema.Extends != null && schema.Extends.Count > 0)\n            {\n                _writer.WritePropertyName(JsonSchemaConstants.ExtendsPropertyName);\n                if (schema.Extends.Count == 1)\n                {\n                    ReferenceOrWriteSchema(schema.Extends[0]);\n                }\n                else\n                {\n                    _writer.WriteStartArray();\n                    foreach (JsonSchema jsonSchema in schema.Extends)\n                    {\n                        ReferenceOrWriteSchema(jsonSchema);\n                    }\n                    _writer.WriteEndArray();\n                }\n            }\n            _writer.WriteEndObject();\n        }\n\n        private void WriteSchemaDictionaryIfNotNull(JsonWriter writer, string propertyName, IDictionary<string, JsonSchema> properties)\n        {\n            if (properties != null)\n            {\n                writer.WritePropertyName(propertyName);\n                writer.WriteStartObject();\n                foreach (KeyValuePair<string, JsonSchema> property in properties)\n                {\n                    writer.WritePropertyName(property.Key);\n                    ReferenceOrWriteSchema(property.Value);\n                }\n                writer.WriteEndObject();\n            }\n        }\n\n        private void WriteItems(JsonSchema schema)\n        {\n            if (schema.Items == null && !schema.PositionalItemsValidation)\n                return;\n\n            _writer.WritePropertyName(JsonSchemaConstants.ItemsPropertyName);\n\n            if (!schema.PositionalItemsValidation)\n            {\n                if (schema.Items != null && schema.Items.Count > 0)\n                {\n                    ReferenceOrWriteSchema(schema.Items[0]);\n                }\n                else\n                {\n                    _writer.WriteStartObject();\n                    _writer.WriteEndObject();\n                }\n                return;\n            }\n\n            _writer.WriteStartArray();\n            if (schema.Items != null)\n            {\n                foreach (JsonSchema itemSchema in schema.Items)\n                {\n                    ReferenceOrWriteSchema(itemSchema);\n                }\n            }\n            _writer.WriteEndArray();\n        }\n\n        private void WriteType(string propertyName, JsonWriter writer, JsonSchemaType type)\n        {\n            IList<JsonSchemaType> types;\n            if (System.Enum.IsDefined(typeof(JsonSchemaType), type))\n                types = new List<JsonSchemaType> { type };\n            else\n                types = EnumUtils.GetFlagsValues(type).Where(v => v != JsonSchemaType.None).ToList();\n\n            if (types.Count == 0)\n                return;\n\n            writer.WritePropertyName(propertyName);\n\n            if (types.Count == 1)\n            {\n                writer.WriteValue(JsonSchemaBuilder.MapType(types[0]));\n                return;\n            }\n\n            writer.WriteStartArray();\n            foreach (JsonSchemaType jsonSchemaType in types)\n            {\n                writer.WriteValue(JsonSchemaBuilder.MapType(jsonSchemaType));\n            }\n            writer.WriteEndArray();\n        }\n\n        private void WritePropertyIfNotNull(JsonWriter writer, string propertyName, object value)\n        {\n            if (value != null)\n            {\n                writer.WritePropertyName(propertyName);\n                writer.WriteValue(value);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/UndefinedSchemaIdHandling.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json.Schema\n{\n    /// <summary>\n    /// Specifies undefined schema Id handling options for the <see cref=\"JsonSchemaGenerator\"/>.\n    /// </summary>\n    public enum UndefinedSchemaIdHandling\n    {\n        /// <summary>\n        /// Do not infer a schema Id.\n        /// </summary>\n        None = 0,\n\n        /// <summary>\n        /// Use the .NET type name as the schema Id.\n        /// </summary>\n        UseTypeName = 1,\n\n        /// <summary>\n        /// Use the assembly qualified .NET type name as the schema Id.\n        /// </summary>\n        UseAssemblyQualifiedName = 2,\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/ValidationEventArgs.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Schema\n{\n    /// <summary>\n    /// Returns detailed information related to the <see cref=\"ValidationEventHandler\"/>.\n    /// </summary>\n    public class ValidationEventArgs : EventArgs\n    {\n        private readonly JsonSchemaException _ex;\n\n        internal ValidationEventArgs(JsonSchemaException ex)\n        {\n            ValidationUtils.ArgumentNotNull(ex, \"ex\");\n            _ex = ex;\n        }\n\n        /// <summary>\n        /// Gets the <see cref=\"JsonSchemaException\"/> associated with the validation error.\n        /// </summary>\n        /// <value>The JsonSchemaException associated with the validation error.</value>\n        public JsonSchemaException Exception\n        {\n            get { return _ex; }\n        }\n\n        /// <summary>\n        /// Gets the path of the JSON location where the validation error occurred.\n        /// </summary>\n        /// <value>The path of the JSON location where the validation error occurred.</value>\n        public string Path\n        {\n            get { return _ex.Path; }\n        }\n\n        /// <summary>\n        /// Gets the text description corresponding to the validation error.\n        /// </summary>\n        /// <value>The text description.</value>\n        public string Message\n        {\n            get { return _ex.Message; }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Schema/ValidationEventHandler.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json.Schema\n{\n    /// <summary>\n    /// Represents the callback method that will handle JSON schema validation events and the <see cref=\"ValidationEventArgs\"/>.\n    /// </summary>\n    public delegate void ValidationEventHandler(object sender, ValidationEventArgs e);\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/CachedAttributeGetter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Reflection;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal static class CachedAttributeGetter<T> where T : Attribute\n    {\n        private static readonly ThreadSafeStore<object, T> TypeAttributeCache = new ThreadSafeStore<object, T>(JsonTypeReflector.GetAttribute<T>);\n\n        public static T GetAttribute(object type)\n        {\n            return TypeAttributeCache.Get(type);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/CamelCasePropertyNamesContractResolver.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Resolves member mappings for a type, camel casing property names.\n    /// </summary>\n    public class CamelCasePropertyNamesContractResolver : DefaultContractResolver\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"CamelCasePropertyNamesContractResolver\"/> class.\n        /// </summary>\n        public CamelCasePropertyNamesContractResolver()\n            : base(true)\n        {\n        }\n\n        /// <summary>\n        /// Resolves the name of the property.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        /// <returns>The property name camel cased.</returns>\n        protected internal override string ResolvePropertyName(string propertyName)\n        {\n            // lower case the first letter of the passed in name\n            return StringUtils.ToCamelCase(propertyName);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/DefaultContractResolver.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections;\n#if !(NET35 || NET20 || PORTABLE || PORTABLE40)\nusing System.Collections.Concurrent;\n#endif\nusing System.Collections.Generic;\nusing System.ComponentModel;\n#if !(NET35 || NET20 || PORTABLE40)\nusing System.Dynamic;\n#endif\nusing System.Globalization;\nusing System.Reflection;\nusing System.Runtime.Serialization;\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\nusing System.Security.Permissions;\n#endif\nusing System.Xml.Serialization;\nusing Newtonsoft.Json.Converters;\nusing Newtonsoft.Json.Utilities;\nusing Newtonsoft.Json.Linq;\nusing System.Runtime.CompilerServices;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal struct ResolverContractKey : IEquatable<ResolverContractKey>\n    {\n        private readonly Type _resolverType;\n        private readonly Type _contractType;\n\n        public ResolverContractKey(Type resolverType, Type contractType)\n        {\n            _resolverType = resolverType;\n            _contractType = contractType;\n        }\n\n        public override int GetHashCode()\n        {\n            return _resolverType.GetHashCode() ^ _contractType.GetHashCode();\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (!(obj is ResolverContractKey))\n                return false;\n\n            return Equals((ResolverContractKey)obj);\n        }\n\n        public bool Equals(ResolverContractKey other)\n        {\n            return (_resolverType == other._resolverType && _contractType == other._contractType);\n        }\n    }\n\n    /// <summary>\n    /// Used by <see cref=\"JsonSerializer\"/> to resolves a <see cref=\"JsonContract\"/> for a given <see cref=\"Type\"/>.\n    /// </summary>\n    public class DefaultContractResolver : IContractResolver\n    {\n        private static readonly IContractResolver _instance = new DefaultContractResolver(true);\n\n        internal static IContractResolver Instance\n        {\n            get { return _instance; }\n        }\n\n        private static readonly IList<JsonConverter> BuiltInConverters = new List<JsonConverter>\n        {\n#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)\n            new EntityKeyMemberConverter(),\n#endif\n#if !(NET35 || NET20 || PORTABLE40)\n            new ExpandoObjectConverter(),\n#endif\n#if !(PORTABLE40)\n            new XmlNodeConverter(),\n#endif\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            new BinaryConverter(),\n            new DataSetConverter(),\n            new DataTableConverter(),\n#endif\n#if NETFX_CORE\n            new JsonValueConverter(),\n#endif\n#if !(NET35 || NET20 || NETFX_CORE)\n            new DiscriminatedUnionConverter(),\n#endif\n            new KeyValuePairConverter(),\n            new BsonObjectIdConverter(),\n            new RegexConverter()\n        };\n\n        private static Dictionary<ResolverContractKey, JsonContract> _sharedContractCache;\n        private static readonly object _typeContractCacheLock = new object();\n\n        private Dictionary<ResolverContractKey, JsonContract> _instanceContractCache;\n        private readonly bool _sharedCache;\n\n        /// <summary>\n        /// Gets a value indicating whether members are being get and set using dynamic code generation.\n        /// This value is determined by the runtime permissions available.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if using dynamic code generation; otherwise, <c>false</c>.\n        /// </value>\n        public bool DynamicCodeGeneration\n        {\n            get { return JsonTypeReflector.DynamicCodeGeneration; }\n        }\n\n#if !(NETFX_CORE || PORTABLE)\n        /// <summary>\n        /// Gets or sets the default members search flags.\n        /// </summary>\n        /// <value>The default members search flags.</value>\n        [ObsoleteAttribute(\"DefaultMembersSearchFlags is obsolete. To modify the members serialized inherit from DefaultContractResolver and override the GetSerializableMembers method instead.\")] \n        public BindingFlags DefaultMembersSearchFlags { get; set; }\n#else\n        private BindingFlags DefaultMembersSearchFlags = BindingFlags.Instance | BindingFlags.Public;\n#endif\n\n        /// <summary>\n        /// Gets or sets a value indicating whether compiler generated members should be serialized.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if serialized compiler generated members; otherwise, <c>false</c>.\n        /// </value>\n        public bool SerializeCompilerGeneratedMembers { get; set; }\n\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n        /// <summary>\n        /// Gets or sets a value indicating whether to ignore the <see cref=\"ISerializable\"/> interface when serializing and deserializing types.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if the <see cref=\"ISerializable\"/> interface will be ignored when serializing and deserializing types; otherwise, <c>false</c>.\n        /// </value>\n        public bool IgnoreSerializableInterface { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether to ignore the <see cref=\"SerializableAttribute\"/> attribute when serializing and deserializing types.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if the <see cref=\"SerializableAttribute\"/> attribute will be ignored when serializing and deserializing types; otherwise, <c>false</c>.\n        /// </value>\n        public bool IgnoreSerializableAttribute { get; set; }\n#endif\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DefaultContractResolver\"/> class.\n        /// </summary>\n        public DefaultContractResolver()\n            : this(false)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DefaultContractResolver\"/> class.\n        /// </summary>\n        /// <param name=\"shareCache\">\n        /// If set to <c>true</c> the <see cref=\"DefaultContractResolver\"/> will use a cached shared with other resolvers of the same type.\n        /// Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected\n        /// behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly\n        /// recommended to reuse <see cref=\"DefaultContractResolver\"/> instances with the <see cref=\"JsonSerializer\"/>.\n        /// </param>\n        public DefaultContractResolver(bool shareCache)\n        {\n#if !NETFX_CORE\n#pragma warning disable 618\n            DefaultMembersSearchFlags = BindingFlags.Public | BindingFlags.Instance;\n#pragma warning restore 618\n#endif\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n            IgnoreSerializableAttribute = true;\n#endif\n\n            _sharedCache = shareCache;\n        }\n\n        private Dictionary<ResolverContractKey, JsonContract> GetCache()\n        {\n            if (_sharedCache)\n                return _sharedContractCache;\n            else\n                return _instanceContractCache;\n        }\n\n        private void UpdateCache(Dictionary<ResolverContractKey, JsonContract> cache)\n        {\n            if (_sharedCache)\n                _sharedContractCache = cache;\n            else\n                _instanceContractCache = cache;\n        }\n\n        /// <summary>\n        /// Resolves the contract for a given type.\n        /// </summary>\n        /// <param name=\"type\">The type to resolve a contract for.</param>\n        /// <returns>The contract for a given type.</returns>\n        public virtual JsonContract ResolveContract(Type type)\n        {\n            if (type == null)\n                throw new ArgumentNullException(\"type\");\n\n            JsonContract contract;\n            ResolverContractKey key = new ResolverContractKey(GetType(), type);\n            Dictionary<ResolverContractKey, JsonContract> cache = GetCache();\n            if (cache == null || !cache.TryGetValue(key, out contract))\n            {\n                contract = CreateContract(type);\n\n                // avoid the possibility of modifying the cache dictionary while another thread is accessing it\n                lock (_typeContractCacheLock)\n                {\n                    cache = GetCache();\n                    Dictionary<ResolverContractKey, JsonContract> updatedCache =\n                        (cache != null)\n                            ? new Dictionary<ResolverContractKey, JsonContract>(cache)\n                            : new Dictionary<ResolverContractKey, JsonContract>();\n                    updatedCache[key] = contract;\n\n                    UpdateCache(updatedCache);\n                }\n            }\n\n            return contract;\n        }\n\n        /// <summary>\n        /// Gets the serializable members for the type.\n        /// </summary>\n        /// <param name=\"objectType\">The type to get serializable members for.</param>\n        /// <returns>The serializable members for the type.</returns>\n        protected virtual List<MemberInfo> GetSerializableMembers(Type objectType)\n        {\n            bool ignoreSerializableAttribute;\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n            ignoreSerializableAttribute = IgnoreSerializableAttribute;\n#else\n            ignoreSerializableAttribute = true;\n#endif\n\n            MemberSerialization memberSerialization = JsonTypeReflector.GetObjectMemberSerialization(objectType, ignoreSerializableAttribute);\n\n            List<MemberInfo> allMembers = ReflectionUtils.GetFieldsAndProperties(objectType, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static)\n                .Where(m => !ReflectionUtils.IsIndexedProperty(m)).ToList();\n\n            List<MemberInfo> serializableMembers = new List<MemberInfo>();\n\n            if (memberSerialization != MemberSerialization.Fields)\n            {\n#if !NET20\n                DataContractAttribute dataContractAttribute = JsonTypeReflector.GetDataContractAttribute(objectType);\n#endif\n\n#pragma warning disable 618\n                List<MemberInfo> defaultMembers = ReflectionUtils.GetFieldsAndProperties(objectType, DefaultMembersSearchFlags)\n                    .Where(m => !ReflectionUtils.IsIndexedProperty(m)).ToList();\n#pragma warning restore 618\n\n                foreach (MemberInfo member in allMembers)\n                {\n                    // exclude members that are compiler generated if set\n                    if (SerializeCompilerGeneratedMembers || !member.IsDefined(typeof(CompilerGeneratedAttribute), true))\n                    {\n                        if (defaultMembers.Contains(member))\n                        {\n                            // add all members that are found by default member search\n                            serializableMembers.Add(member);\n                        }\n                        else\n                        {\n                            // add members that are explicitly marked with JsonProperty/DataMember attribute\n                            // or are a field if serializing just fields\n                            if (JsonTypeReflector.GetAttribute<JsonPropertyAttribute>(member) != null)\n                                serializableMembers.Add(member);\n#if !NET20\n                            else if (dataContractAttribute != null && JsonTypeReflector.GetAttribute<DataMemberAttribute>(member) != null)\n                                serializableMembers.Add(member);\n#endif\n                            else if (memberSerialization == MemberSerialization.Fields && member.MemberType() == MemberTypes.Field)\n                                serializableMembers.Add(member);\n                        }\n                    }\n                }\n\n#if !NET20\n                Type match;\n                // don't include EntityKey on entities objects... this is a bit hacky\n                if (objectType.AssignableToTypeName(\"System.Data.Objects.DataClasses.EntityObject\", out match))\n                    serializableMembers = serializableMembers.Where(ShouldSerializeEntityMember).ToList();\n#endif\n            }\n            else\n            {\n                // serialize all fields\n                foreach (MemberInfo member in allMembers)\n                {\n                    FieldInfo field = member as FieldInfo;\n                    if (field != null && !field.IsStatic)\n                        serializableMembers.Add(member);\n                }\n            }\n\n            return serializableMembers;\n        }\n\n#if !NET20\n        private bool ShouldSerializeEntityMember(MemberInfo memberInfo)\n        {\n            PropertyInfo propertyInfo = memberInfo as PropertyInfo;\n            if (propertyInfo != null)\n            {\n                if (propertyInfo.PropertyType.IsGenericType() && propertyInfo.PropertyType.GetGenericTypeDefinition().FullName == \"System.Data.Objects.DataClasses.EntityReference`1\")\n                    return false;\n            }\n\n            return true;\n        }\n#endif\n\n        /// <summary>\n        /// Creates a <see cref=\"JsonObjectContract\"/> for the given type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>A <see cref=\"JsonObjectContract\"/> for the given type.</returns>\n        protected virtual JsonObjectContract CreateObjectContract(Type objectType)\n        {\n            JsonObjectContract contract = new JsonObjectContract(objectType);\n            InitializeContract(contract);\n\n            bool ignoreSerializableAttribute;\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n            ignoreSerializableAttribute = IgnoreSerializableAttribute;\n#else\n            ignoreSerializableAttribute = true;\n#endif\n\n            contract.MemberSerialization = JsonTypeReflector.GetObjectMemberSerialization(contract.NonNullableUnderlyingType, ignoreSerializableAttribute);\n            contract.Properties.AddRange(CreateProperties(contract.NonNullableUnderlyingType, contract.MemberSerialization));\n\n            JsonObjectAttribute attribute = JsonTypeReflector.GetJsonObjectAttribute(contract.NonNullableUnderlyingType);\n            if (attribute != null)\n                contract.ItemRequired = attribute._itemRequired;\n\n            ConstructorInfo overrideConstructor = GetAttributeConstructor(contract.NonNullableUnderlyingType);\n\n            // check if a JsonConstructorAttribute has been defined and use that\n            if (overrideConstructor != null)\n            {\n                contract.OverrideConstructor = overrideConstructor;\n                contract.ConstructorParameters.AddRange(CreateConstructorParameters(overrideConstructor, contract.Properties));\n            }\n            else if (contract.MemberSerialization == MemberSerialization.Fields)\n            {\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n                // mimic DataContractSerializer behaviour when populating fields by overriding default creator to create an uninitialized object\n                // note that this is only possible when the application is fully trusted so fall back to using the default constructor (if available) in partial trust\n                if (JsonTypeReflector.FullyTrusted)\n                    contract.DefaultCreator = contract.GetUninitializedObject;\n#endif\n            }\n            else if (contract.DefaultCreator == null || contract.DefaultCreatorNonPublic)\n            {\n                ConstructorInfo constructor = GetParametrizedConstructor(contract.NonNullableUnderlyingType);\n                if (constructor != null)\n                {\n                    contract.ParametrizedConstructor = constructor;\n                    contract.ConstructorParameters.AddRange(CreateConstructorParameters(constructor, contract.Properties));\n                }\n            }\n\n            MemberInfo extensionDataMember = GetExtensionDataMemberForType(contract.NonNullableUnderlyingType);\n            if (extensionDataMember != null)\n                SetExtensionDataDelegates(contract, extensionDataMember);\n\n            return contract;\n        }\n\n        private MemberInfo GetExtensionDataMemberForType(Type type)\n        {\n            IEnumerable<MemberInfo> members = GetClassHierarchyForType(type).SelectMany(baseType =>\n            {\n                IList<MemberInfo> m = new List<MemberInfo>();\n                m.AddRange(baseType.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly));\n                m.AddRange(baseType.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly));\n\n                return m;\n            });\n\n            MemberInfo extensionDataMember = members.LastOrDefault(m =>\n            {\n                MemberTypes memberType = m.MemberType();\n                if (memberType != MemberTypes.Property && memberType != MemberTypes.Field)\n                    return false;\n\n                // last instance of attribute wins on type if there are multiple\n                if (!m.IsDefined(typeof(JsonExtensionDataAttribute), false))\n                    return false;\n\n                Type t = ReflectionUtils.GetMemberUnderlyingType(m);\n\n                Type dictionaryType;\n                if (ReflectionUtils.ImplementsGenericDefinition(t, typeof(IDictionary<,>), out dictionaryType))\n                {\n                    Type keyType = dictionaryType.GetGenericArguments()[0];\n                    Type valueType = dictionaryType.GetGenericArguments()[1];\n\n                    if (keyType.IsAssignableFrom(typeof(string)) && valueType.IsAssignableFrom(typeof(JToken)))\n                        return true;\n                }\n\n                throw new JsonException(\"Invalid extension data attribute on '{0}'. Member '{1}' type must implement IDictionary<string, JToken>.\".FormatWith(CultureInfo.InvariantCulture, GetClrTypeFullName(m.DeclaringType), m.Name));\n            });\n\n            return extensionDataMember;\n        }\n\n        private static void SetExtensionDataDelegates(JsonObjectContract contract, MemberInfo member)\n        {\n            JsonExtensionDataAttribute extensionDataAttribute = ReflectionUtils.GetAttribute<JsonExtensionDataAttribute>(member);\n            if (extensionDataAttribute == null)\n                return;\n\n            Type t = ReflectionUtils.GetMemberUnderlyingType(member);\n\n            Type dictionaryType;\n            ReflectionUtils.ImplementsGenericDefinition(t, typeof(IDictionary<,>), out dictionaryType);\n\n            Type keyType = dictionaryType.GetGenericArguments()[0];\n            Type valueType = dictionaryType.GetGenericArguments()[1];\n            bool isJTokenValueType = typeof(JToken).IsAssignableFrom(valueType);\n\n            // change type to a class if it is the base interface so it can be instantiated if needed\n            if (ReflectionUtils.IsGenericDefinition(t, typeof(IDictionary<,>)))\n                t = typeof(Dictionary<,>).MakeGenericType(keyType, valueType);\n\n            MethodInfo addMethod = t.GetMethod(\"Add\", new[] { keyType, valueType });\n            Func<object, object> getExtensionDataDictionary = JsonTypeReflector.ReflectionDelegateFactory.CreateGet<object>(member);\n            Action<object, object> setExtensionDataDictionary = JsonTypeReflector.ReflectionDelegateFactory.CreateSet<object>(member);\n            Func<object> createExtensionDataDictionary = JsonTypeReflector.ReflectionDelegateFactory.CreateDefaultConstructor<object>(t);\n            MethodCall<object, object> setExtensionDataDictionaryValue = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(addMethod);\n\n            ExtensionDataSetter extensionDataSetter = (o, key, value) =>\n            {\n                object dictionary = getExtensionDataDictionary(o);\n                if (dictionary == null)\n                {\n                    dictionary = createExtensionDataDictionary();\n                    setExtensionDataDictionary(o, dictionary);\n                }\n\n                // convert object value to JToken so it is compatible with dictionary\n                // could happen because of primitive types, type name handling and references\n                if (isJTokenValueType && !(value is JToken))\n                    value = (value != null) ? JToken.FromObject(value) : new JValue(null, JTokenType.Null);\n\n                setExtensionDataDictionaryValue(dictionary, key, value);\n            };\n\n            Type enumerableWrapper = typeof(DictionaryEnumerator<,>).MakeGenericType(keyType, valueType);\n            ConstructorInfo constructors = enumerableWrapper.GetConstructors().First();\n            MethodCall<object, object> createEnumerableWrapper = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(constructors);\n\n            ExtensionDataGetter extensionDataGetter = o =>\n            {\n                object dictionary = getExtensionDataDictionary(o);\n                if (dictionary == null)\n                    return null;\n\n                return (IEnumerable<KeyValuePair<object, object>>)createEnumerableWrapper(null, dictionary);\n            };\n\n            if (extensionDataAttribute.ReadData)\n                contract.ExtensionDataSetter = extensionDataSetter;\n\n            if (extensionDataAttribute.WriteData)\n                contract.ExtensionDataGetter = extensionDataGetter;\n        }\n\n        internal struct DictionaryEnumerator<TEnumeratorKey, TEnumeratorValue> : IEnumerable<KeyValuePair<object, object>>, IEnumerator<KeyValuePair<object, object>>\n        {\n            private readonly IEnumerator<KeyValuePair<TEnumeratorKey, TEnumeratorValue>> _e;\n\n            public DictionaryEnumerator(IEnumerable<KeyValuePair<TEnumeratorKey, TEnumeratorValue>> e)\n            {\n                ValidationUtils.ArgumentNotNull(e, \"e\");\n                _e = e.GetEnumerator();\n            }\n\n            public bool MoveNext()\n            {\n                return _e.MoveNext();\n            }\n\n            public void Reset()\n            {\n                _e.Reset();\n            }\n\n            public KeyValuePair<object, object> Current\n            {\n                get { return new KeyValuePair<object, object>(_e.Current.Key, _e.Current.Value); }\n            }\n\n            public void Dispose()\n            {\n                _e.Dispose();\n            }\n\n            object IEnumerator.Current\n            {\n                get { return Current; }\n            }\n\n            public IEnumerator<KeyValuePair<object, object>> GetEnumerator()\n            {\n                return this;\n            }\n\n            IEnumerator IEnumerable.GetEnumerator()\n            {\n                return this;\n            }\n        }\n\n        private ConstructorInfo GetAttributeConstructor(Type objectType)\n        {\n            IList<ConstructorInfo> markedConstructors = objectType.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Where(c => c.IsDefined(typeof(JsonConstructorAttribute), true)).ToList();\n\n            if (markedConstructors.Count > 1)\n                throw new JsonException(\"Multiple constructors with the JsonConstructorAttribute.\");\n            else if (markedConstructors.Count == 1)\n                return markedConstructors[0];\n\n            // little hack to get Version objects to deserialize correctly\n            if (objectType == typeof(Version))\n                return objectType.GetConstructor(new[] { typeof(int), typeof(int), typeof(int), typeof(int) });\n\n            return null;\n        }\n\n        private ConstructorInfo GetParametrizedConstructor(Type objectType)\n        {\n            IList<ConstructorInfo> constructors = objectType.GetConstructors(BindingFlags.Public | BindingFlags.Instance).ToList();\n\n            if (constructors.Count == 1)\n                return constructors[0];\n            else\n                return null;\n        }\n\n        /// <summary>\n        /// Creates the constructor parameters.\n        /// </summary>\n        /// <param name=\"constructor\">The constructor to create properties for.</param>\n        /// <param name=\"memberProperties\">The type's member properties.</param>\n        /// <returns>Properties for the given <see cref=\"ConstructorInfo\"/>.</returns>\n        protected virtual IList<JsonProperty> CreateConstructorParameters(ConstructorInfo constructor, JsonPropertyCollection memberProperties)\n        {\n            var constructorParameters = constructor.GetParameters();\n\n            JsonPropertyCollection parameterCollection = new JsonPropertyCollection(constructor.DeclaringType);\n\n            foreach (ParameterInfo parameterInfo in constructorParameters)\n            {\n                // it is possible to generate a ParameterInfo with a null name using Reflection.Emit\n                // protect against an ArgumentNullException from GetClosestMatchProperty by testing for null here\n                JsonProperty matchingMemberProperty = (parameterInfo.Name != null) ? memberProperties.GetClosestMatchProperty(parameterInfo.Name) : null;\n\n                // type must match as well as name\n                if (matchingMemberProperty != null && matchingMemberProperty.PropertyType != parameterInfo.ParameterType)\n                    matchingMemberProperty = null;\n\n                // ensure that property will have a name from matching property or from parameterinfo\n                // parameterinfo could have no name if generated by a proxy (I'm looking at you Castle)\n                if (matchingMemberProperty != null || parameterInfo.Name != null)\n                {\n                    JsonProperty property = CreatePropertyFromConstructorParameter(matchingMemberProperty, parameterInfo);\n\n                    if (property != null)\n                    {\n                        parameterCollection.AddProperty(property);\n                    }\n                }\n            }\n\n            return parameterCollection;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JsonProperty\"/> for the given <see cref=\"ParameterInfo\"/>.\n        /// </summary>\n        /// <param name=\"matchingMemberProperty\">The matching member property.</param>\n        /// <param name=\"parameterInfo\">The constructor parameter.</param>\n        /// <returns>A created <see cref=\"JsonProperty\"/> for the given <see cref=\"ParameterInfo\"/>.</returns>\n        protected virtual JsonProperty CreatePropertyFromConstructorParameter(JsonProperty matchingMemberProperty, ParameterInfo parameterInfo)\n        {\n            JsonProperty property = new JsonProperty();\n            property.PropertyType = parameterInfo.ParameterType;\n\n            bool allowNonPublicAccess;\n            SetPropertySettingsFromAttributes(property, parameterInfo, parameterInfo.Name, parameterInfo.Member.DeclaringType, MemberSerialization.OptOut, out allowNonPublicAccess);\n\n            property.Readable = false;\n            property.Writable = true;\n\n            // \"inherit\" values from matching member property if unset on parameter\n            if (matchingMemberProperty != null)\n            {\n                property.PropertyName = (property.PropertyName != parameterInfo.Name) ? property.PropertyName : matchingMemberProperty.PropertyName;\n                property.Converter = property.Converter ?? matchingMemberProperty.Converter;\n                property.MemberConverter = property.MemberConverter ?? matchingMemberProperty.MemberConverter;\n\n                if (!property._hasExplicitDefaultValue && matchingMemberProperty._hasExplicitDefaultValue)\n                    property.DefaultValue = matchingMemberProperty.DefaultValue;\n\n                property._required = property._required ?? matchingMemberProperty._required;\n                property.IsReference = property.IsReference ?? matchingMemberProperty.IsReference;\n                property.NullValueHandling = property.NullValueHandling ?? matchingMemberProperty.NullValueHandling;\n                property.DefaultValueHandling = property.DefaultValueHandling ?? matchingMemberProperty.DefaultValueHandling;\n                property.ReferenceLoopHandling = property.ReferenceLoopHandling ?? matchingMemberProperty.ReferenceLoopHandling;\n                property.ObjectCreationHandling = property.ObjectCreationHandling ?? matchingMemberProperty.ObjectCreationHandling;\n                property.TypeNameHandling = property.TypeNameHandling ?? matchingMemberProperty.TypeNameHandling;\n            }\n\n            return property;\n        }\n\n        /// <summary>\n        /// Resolves the default <see cref=\"JsonConverter\" /> for the contract.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>The contract's default <see cref=\"JsonConverter\" />.</returns>\n        protected virtual JsonConverter ResolveContractConverter(Type objectType)\n        {\n            return JsonTypeReflector.GetJsonConverter(objectType, objectType);\n        }\n\n        private Func<object> GetDefaultCreator(Type createdType)\n        {\n            return JsonTypeReflector.ReflectionDelegateFactory.CreateDefaultConstructor<object>(createdType);\n        }\n\n#if !NET20\n        [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Portability\", \"CA1903:UseOnlyApiFromTargetedFramework\", MessageId = \"System.Runtime.Serialization.DataContractAttribute.#get_IsReference()\")]\n#endif\n        private void InitializeContract(JsonContract contract)\n        {\n            JsonContainerAttribute containerAttribute = JsonTypeReflector.GetJsonContainerAttribute(contract.NonNullableUnderlyingType);\n            if (containerAttribute != null)\n            {\n                contract.IsReference = containerAttribute._isReference;\n            }\n#if !NET20\n            else\n            {\n                DataContractAttribute dataContractAttribute = JsonTypeReflector.GetDataContractAttribute(contract.NonNullableUnderlyingType);\n                // doesn't have a null value\n                if (dataContractAttribute != null && dataContractAttribute.IsReference)\n                    contract.IsReference = true;\n            }\n#endif\n\n            contract.Converter = ResolveContractConverter(contract.NonNullableUnderlyingType);\n\n            // then see whether object is compadible with any of the built in converters\n            contract.InternalConverter = JsonSerializer.GetMatchingConverter(BuiltInConverters, contract.NonNullableUnderlyingType);\n\n            if (ReflectionUtils.HasDefaultConstructor(contract.CreatedType, true)\n                || contract.CreatedType.IsValueType())\n            {\n                contract.DefaultCreator = GetDefaultCreator(contract.CreatedType);\n\n                contract.DefaultCreatorNonPublic = (!contract.CreatedType.IsValueType() &&\n                                                    ReflectionUtils.GetDefaultConstructor(contract.CreatedType) == null);\n            }\n\n            ResolveCallbackMethods(contract, contract.NonNullableUnderlyingType);\n        }\n\n        private void ResolveCallbackMethods(JsonContract contract, Type t)\n        {\n            List<SerializationCallback> onSerializing;\n            List<SerializationCallback> onSerialized;\n            List<SerializationCallback> onDeserializing;\n            List<SerializationCallback> onDeserialized;\n            List<SerializationErrorCallback> onError;\n\n            GetCallbackMethodsForType(t, out onSerializing, out onSerialized, out onDeserializing, out onDeserialized, out onError);\n\n            if (onSerializing != null)\n            {\n#if !(NET35 || NET20 || NETFX_CORE)\n                if (t.Name != FSharpUtils.FSharpSetTypeName && t.Name != FSharpUtils.FSharpMapTypeName)\n#endif\n                {\n#if NETFX_CORE\n                    if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>)))\n                         contract.OnSerializingCallbacks.AddRange(onSerializing);\n#else\n                    contract.OnSerializingCallbacks.AddRange(onSerializing);\n#endif\n                }\n            }\n\n            if (onSerialized != null)\n                contract.OnSerializedCallbacks.AddRange(onSerialized);\n\n            if (onDeserializing != null)\n            {\n                contract.OnDeserializingCallbacks.AddRange(onDeserializing);\n            }\n\n            if (onDeserialized != null)\n            {\n#if !(NET35 || NET20 || NETFX_CORE)\n                if (t.Name != FSharpUtils.FSharpSetTypeName && t.Name != FSharpUtils.FSharpMapTypeName)\n#endif\n                {\n                    // ConcurrentDictionary throws an error here so don't use its OnDeserialized - http://json.codeplex.com/discussions/257093\n#if !(NET35 || NET20 || PORTABLE || PORTABLE40)\n                    if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>)))\n                        contract.OnDeserializedCallbacks.AddRange(onDeserialized);\n#else\n                    contract.OnDeserializedCallbacks.AddRange(onDeserialized);\n#endif\n                }\n            }\n\n            if (onError != null)\n                contract.OnErrorCallbacks.AddRange(onError);\n        }\n\n        private void GetCallbackMethodsForType(Type type, out List<SerializationCallback> onSerializing, out List<SerializationCallback> onSerialized, out List<SerializationCallback> onDeserializing, out List<SerializationCallback> onDeserialized, out List<SerializationErrorCallback> onError)\n        {\n            onSerializing = null;\n            onSerialized = null;\n            onDeserializing = null;\n            onDeserialized = null;\n            onError = null;\n\n            foreach (Type baseType in GetClassHierarchyForType(type))\n            {\n                // while we allow more than one OnSerialized total, only one can be defined per class\n                MethodInfo currentOnSerializing = null;\n                MethodInfo currentOnSerialized = null;\n                MethodInfo currentOnDeserializing = null;\n                MethodInfo currentOnDeserialized = null;\n                MethodInfo currentOnError = null;\n\n                foreach (MethodInfo method in baseType.GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))\n                {\n                    // compact framework errors when getting parameters for a generic method\n                    // lame, but generic methods should not be callbacks anyway\n                    if (method.ContainsGenericParameters)\n                        continue;\n\n                    Type prevAttributeType = null;\n                    ParameterInfo[] parameters = method.GetParameters();\n\n                    if (IsValidCallback(method, parameters, typeof(OnSerializingAttribute), currentOnSerializing, ref prevAttributeType))\n                    {\n                        onSerializing = onSerializing ?? new List<SerializationCallback>();\n                        onSerializing.Add(JsonContract.CreateSerializationCallback(method));\n                        currentOnSerializing = method;\n                    }\n                    if (IsValidCallback(method, parameters, typeof(OnSerializedAttribute), currentOnSerialized, ref prevAttributeType))\n                    {\n                        onSerialized = onSerialized ?? new List<SerializationCallback>();\n                        onSerialized.Add(JsonContract.CreateSerializationCallback(method));\n                        currentOnSerialized = method;\n                    }\n                    if (IsValidCallback(method, parameters, typeof(OnDeserializingAttribute), currentOnDeserializing, ref prevAttributeType))\n                    {\n                        onDeserializing = onDeserializing ?? new List<SerializationCallback>();\n                        onDeserializing.Add(JsonContract.CreateSerializationCallback(method));\n                        currentOnDeserializing = method;\n                    }\n                    if (IsValidCallback(method, parameters, typeof(OnDeserializedAttribute), currentOnDeserialized, ref prevAttributeType))\n                    {\n                        onDeserialized = onDeserialized ?? new List<SerializationCallback>();\n                        onDeserialized.Add(JsonContract.CreateSerializationCallback(method));\n                        currentOnDeserialized = method;\n                    }\n                    if (IsValidCallback(method, parameters, typeof(OnErrorAttribute), currentOnError, ref prevAttributeType))\n                    {\n                        onError = onError ?? new List<SerializationErrorCallback>();\n                        onError.Add(JsonContract.CreateSerializationErrorCallback(method));\n                        currentOnError = method;\n                    }\n                }\n            }\n        }\n\n        private List<Type> GetClassHierarchyForType(Type type)\n        {\n            List<Type> ret = new List<Type>();\n\n            Type current = type;\n            while (current != null && current != typeof(object))\n            {\n                ret.Add(current);\n                current = current.BaseType();\n            }\n\n            // Return the class list in order of simple => complex\n            ret.Reverse();\n            return ret;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JsonDictionaryContract\"/> for the given type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>A <see cref=\"JsonDictionaryContract\"/> for the given type.</returns>\n        protected virtual JsonDictionaryContract CreateDictionaryContract(Type objectType)\n        {\n            JsonDictionaryContract contract = new JsonDictionaryContract(objectType);\n            InitializeContract(contract);\n\n            contract.PropertyNameResolver = ResolvePropertyName;\n\n            return contract;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JsonArrayContract\"/> for the given type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>A <see cref=\"JsonArrayContract\"/> for the given type.</returns>\n        protected virtual JsonArrayContract CreateArrayContract(Type objectType)\n        {\n            JsonArrayContract contract = new JsonArrayContract(objectType);\n            InitializeContract(contract);\n\n            return contract;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JsonPrimitiveContract\"/> for the given type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>A <see cref=\"JsonPrimitiveContract\"/> for the given type.</returns>\n        protected virtual JsonPrimitiveContract CreatePrimitiveContract(Type objectType)\n        {\n            JsonPrimitiveContract contract = new JsonPrimitiveContract(objectType);\n            InitializeContract(contract);\n\n            return contract;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JsonLinqContract\"/> for the given type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>A <see cref=\"JsonLinqContract\"/> for the given type.</returns>\n        protected virtual JsonLinqContract CreateLinqContract(Type objectType)\n        {\n            JsonLinqContract contract = new JsonLinqContract(objectType);\n            InitializeContract(contract);\n\n            return contract;\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        /// <summary>\n        /// Creates a <see cref=\"JsonISerializableContract\"/> for the given type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>A <see cref=\"JsonISerializableContract\"/> for the given type.</returns>\n        protected virtual JsonISerializableContract CreateISerializableContract(Type objectType)\n        {\n            JsonISerializableContract contract = new JsonISerializableContract(objectType);\n            InitializeContract(contract);\n\n            ConstructorInfo constructorInfo = contract.NonNullableUnderlyingType.GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, new[] { typeof(SerializationInfo), typeof(StreamingContext) }, null);\n            if (constructorInfo != null)\n            {\n                MethodCall<object, object> methodCall = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(constructorInfo);\n\n                contract.ISerializableCreator = (args => methodCall(null, args));\n            }\n\n            return contract;\n        }\n#endif\n\n#if !(NET35 || NET20 || PORTABLE40)\n        /// <summary>\n        /// Creates a <see cref=\"JsonDynamicContract\"/> for the given type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>A <see cref=\"JsonDynamicContract\"/> for the given type.</returns>\n        protected virtual JsonDynamicContract CreateDynamicContract(Type objectType)\n        {\n            JsonDynamicContract contract = new JsonDynamicContract(objectType);\n            InitializeContract(contract);\n\n            contract.PropertyNameResolver = ResolvePropertyName;\n            contract.Properties.AddRange(CreateProperties(objectType, MemberSerialization.OptOut));\n\n            return contract;\n        }\n#endif\n\n        /// <summary>\n        /// Creates a <see cref=\"JsonStringContract\"/> for the given type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>A <see cref=\"JsonStringContract\"/> for the given type.</returns>\n        protected virtual JsonStringContract CreateStringContract(Type objectType)\n        {\n            JsonStringContract contract = new JsonStringContract(objectType);\n            InitializeContract(contract);\n\n            return contract;\n        }\n\n        /// <summary>\n        /// Determines which contract type is created for the given type.\n        /// </summary>\n        /// <param name=\"objectType\">Type of the object.</param>\n        /// <returns>A <see cref=\"JsonContract\"/> for the given type.</returns>\n        protected virtual JsonContract CreateContract(Type objectType)\n        {\n            Type t = ReflectionUtils.EnsureNotNullableType(objectType);\n\n            if (IsJsonPrimitiveType(objectType))\n                return CreatePrimitiveContract(objectType);\n\n            if (JsonTypeReflector.GetJsonObjectAttribute(t) != null)\n                return CreateObjectContract(objectType);\n\n            if (JsonTypeReflector.GetJsonArrayAttribute(t) != null)\n                return CreateArrayContract(objectType);\n\n            if (JsonTypeReflector.GetJsonDictionaryAttribute(t) != null)\n                return CreateDictionaryContract(objectType);\n\n            if (t == typeof(JToken) || t.IsSubclassOf(typeof(JToken)))\n                return CreateLinqContract(objectType);\n\n            if (CollectionUtils.IsDictionaryType(t))\n                return CreateDictionaryContract(objectType);\n\n            if (typeof(IEnumerable).IsAssignableFrom(t))\n                return CreateArrayContract(objectType);\n\n            if (CanConvertToString(t))\n                return CreateStringContract(objectType);\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            if (!IgnoreSerializableInterface && typeof(ISerializable).IsAssignableFrom(t))\n                return CreateISerializableContract(objectType);\n#endif\n\n#if !(NET35 || NET20 || PORTABLE40)\n            if (typeof(IDynamicMetaObjectProvider).IsAssignableFrom(t))\n                return CreateDynamicContract(objectType);\n#endif\n\n#if !(PORTABLE || NETFX_CORE)\n            // tested last because it is not possible to automatically deserialize custom IConvertible types\n            if (IsIConvertible(t))\n                return CreatePrimitiveContract(t);\n#endif\n\n            return CreateObjectContract(objectType);\n        }\n\n        internal static bool IsJsonPrimitiveType(Type t)\n        {\n            PrimitiveTypeCode typeCode = ConvertUtils.GetTypeCode(t);\n\n            return (typeCode != PrimitiveTypeCode.Empty && typeCode != PrimitiveTypeCode.Object);\n        }\n\n#if !(PORTABLE || NETFX_CORE)\n        internal static bool IsIConvertible(Type t)\n        {\n            if (typeof(IConvertible).IsAssignableFrom(t)\n                || (ReflectionUtils.IsNullableType(t) && typeof(IConvertible).IsAssignableFrom(Nullable.GetUnderlyingType(t))))\n            {\n                return !typeof(JToken).IsAssignableFrom(t);\n            }\n\n            return false;\n        }\n#endif\n\n        internal static bool CanConvertToString(Type type)\n        {\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            TypeConverter converter = ConvertUtils.GetConverter(type);\n\n            // use the objectType's TypeConverter if it has one and can convert to a string\n            if (converter != null\n                && !(converter is ComponentConverter)\n                && !(converter is ReferenceConverter)\n                && converter.GetType() != typeof(TypeConverter))\n            {\n                if (converter.CanConvertTo(typeof(string)))\n                    return true;\n            }\n#endif\n\n            if (type == typeof(Type) || type.IsSubclassOf(typeof(Type)))\n                return true;\n\n            return false;\n        }\n\n        private static bool IsValidCallback(MethodInfo method, ParameterInfo[] parameters, Type attributeType, MethodInfo currentCallback, ref Type prevAttributeType)\n        {\n            if (!method.IsDefined(attributeType, false))\n                return false;\n\n            if (currentCallback != null)\n                throw new JsonException(\"Invalid attribute. Both '{0}' and '{1}' in type '{2}' have '{3}'.\".FormatWith(CultureInfo.InvariantCulture, method, currentCallback, GetClrTypeFullName(method.DeclaringType), attributeType));\n\n            if (prevAttributeType != null)\n                throw new JsonException(\"Invalid Callback. Method '{3}' in type '{2}' has both '{0}' and '{1}'.\".FormatWith(CultureInfo.InvariantCulture, prevAttributeType, attributeType, GetClrTypeFullName(method.DeclaringType), method));\n\n            if (method.IsVirtual)\n                throw new JsonException(\"Virtual Method '{0}' of type '{1}' cannot be marked with '{2}' attribute.\".FormatWith(CultureInfo.InvariantCulture, method, GetClrTypeFullName(method.DeclaringType), attributeType));\n\n            if (method.ReturnType != typeof(void))\n                throw new JsonException(\"Serialization Callback '{1}' in type '{0}' must return void.\".FormatWith(CultureInfo.InvariantCulture, GetClrTypeFullName(method.DeclaringType), method));\n\n            if (attributeType == typeof(OnErrorAttribute))\n            {\n                if (parameters == null || parameters.Length != 2 || parameters[0].ParameterType != typeof(StreamingContext) || parameters[1].ParameterType != typeof(ErrorContext))\n                    throw new JsonException(\"Serialization Error Callback '{1}' in type '{0}' must have two parameters of type '{2}' and '{3}'.\".FormatWith(CultureInfo.InvariantCulture, GetClrTypeFullName(method.DeclaringType), method, typeof(StreamingContext), typeof(ErrorContext)));\n            }\n            else\n            {\n                if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType != typeof(StreamingContext))\n                    throw new JsonException(\"Serialization Callback '{1}' in type '{0}' must have a single parameter of type '{2}'.\".FormatWith(CultureInfo.InvariantCulture, GetClrTypeFullName(method.DeclaringType), method, typeof(StreamingContext)));\n            }\n\n            prevAttributeType = attributeType;\n\n            return true;\n        }\n\n        internal static string GetClrTypeFullName(Type type)\n        {\n            if (type.IsGenericTypeDefinition() || !type.ContainsGenericParameters())\n                return type.FullName;\n\n            return string.Format(CultureInfo.InvariantCulture, \"{0}.{1}\", new object[] { type.Namespace, type.Name });\n        }\n\n        /// <summary>\n        /// Creates properties for the given <see cref=\"JsonContract\"/>.\n        /// </summary>\n        /// <param name=\"type\">The type to create properties for.</param>\n        /// /// <param name=\"memberSerialization\">The member serialization mode for the type.</param>\n        /// <returns>Properties for the given <see cref=\"JsonContract\"/>.</returns>\n        protected virtual IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)\n        {\n            List<MemberInfo> members = GetSerializableMembers(type);\n            if (members == null)\n                throw new JsonSerializationException(\"Null collection of seralizable members returned.\");\n\n            JsonPropertyCollection properties = new JsonPropertyCollection(type);\n\n            foreach (MemberInfo member in members)\n            {\n                JsonProperty property = CreateProperty(member, memberSerialization);\n\n                if (property != null)\n                    properties.AddProperty(property);\n            }\n\n            IList<JsonProperty> orderedProperties = properties.OrderBy(p => p.Order ?? -1).ToList();\n            return orderedProperties;\n        }\n\n        /// <summary>\n        /// Creates the <see cref=\"IValueProvider\"/> used by the serializer to get and set values from a member.\n        /// </summary>\n        /// <param name=\"member\">The member.</param>\n        /// <returns>The <see cref=\"IValueProvider\"/> used by the serializer to get and set values from a member.</returns>\n        protected virtual IValueProvider CreateMemberValueProvider(MemberInfo member)\n        {\n            // warning - this method use to cause errors with Intellitrace. Retest in VS Ultimate after changes\n            IValueProvider valueProvider;\n\n#if !(PORTABLE40 || PORTABLE || NETFX_CORE)\n            if (DynamicCodeGeneration)\n                valueProvider = new DynamicValueProvider(member);\n            else\n                valueProvider = new ReflectionValueProvider(member);\n#elif !(PORTABLE40)\n      valueProvider = new ExpressionValueProvider(member);\n#else\n            valueProvider = new ReflectionValueProvider(member);\n#endif\n\n            return valueProvider;\n        }\n\n        /// <summary>\n        /// Creates a <see cref=\"JsonProperty\"/> for the given <see cref=\"MemberInfo\"/>.\n        /// </summary>\n        /// <param name=\"memberSerialization\">The member's parent <see cref=\"MemberSerialization\"/>.</param>\n        /// <param name=\"member\">The member to create a <see cref=\"JsonProperty\"/> for.</param>\n        /// <returns>A created <see cref=\"JsonProperty\"/> for the given <see cref=\"MemberInfo\"/>.</returns>\n        protected virtual JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)\n        {\n            JsonProperty property = new JsonProperty();\n            property.PropertyType = ReflectionUtils.GetMemberUnderlyingType(member);\n            property.DeclaringType = member.DeclaringType;\n            property.ValueProvider = CreateMemberValueProvider(member);\n\n            bool allowNonPublicAccess;\n            SetPropertySettingsFromAttributes(property, member, member.Name, member.DeclaringType, memberSerialization, out allowNonPublicAccess);\n\n            if (memberSerialization != MemberSerialization.Fields)\n            {\n                property.Readable = ReflectionUtils.CanReadMemberValue(member, allowNonPublicAccess);\n                property.Writable = ReflectionUtils.CanSetMemberValue(member, allowNonPublicAccess, property.HasMemberAttribute);\n            }\n            else\n            {\n                // write to readonly fields\n                property.Readable = true;\n                property.Writable = true;\n            }\n            property.ShouldSerialize = CreateShouldSerializeTest(member);\n\n            SetIsSpecifiedActions(property, member, allowNonPublicAccess);\n\n            return property;\n        }\n\n        private void SetPropertySettingsFromAttributes(JsonProperty property, object attributeProvider, string name, Type declaringType, MemberSerialization memberSerialization, out bool allowNonPublicAccess)\n        {\n#if !NET20\n            DataContractAttribute dataContractAttribute = JsonTypeReflector.GetDataContractAttribute(declaringType);\n\n            MemberInfo memberInfo = attributeProvider as MemberInfo;\n\n            DataMemberAttribute dataMemberAttribute;\n            if (dataContractAttribute != null && memberInfo != null)\n                dataMemberAttribute = JsonTypeReflector.GetDataMemberAttribute((MemberInfo)memberInfo);\n            else\n                dataMemberAttribute = null;\n#endif\n\n            JsonPropertyAttribute propertyAttribute = JsonTypeReflector.GetAttribute<JsonPropertyAttribute>(attributeProvider);\n            if (propertyAttribute != null)\n                property.HasMemberAttribute = true;\n\n            string mappedName;\n            if (propertyAttribute != null && propertyAttribute.PropertyName != null)\n                mappedName = propertyAttribute.PropertyName;\n#if !NET20\n            else if (dataMemberAttribute != null && dataMemberAttribute.Name != null)\n                mappedName = dataMemberAttribute.Name;\n#endif\n            else\n                mappedName = name;\n\n            property.PropertyName = ResolvePropertyName(mappedName);\n            property.UnderlyingName = name;\n\n            bool hasMemberAttribute = false;\n            if (propertyAttribute != null)\n            {\n                property._required = propertyAttribute._required;\n                property.Order = propertyAttribute._order;\n                property.DefaultValueHandling = propertyAttribute._defaultValueHandling;\n                hasMemberAttribute = true;\n            }\n#if !NET20\n            else if (dataMemberAttribute != null)\n            {\n                property._required = (dataMemberAttribute.IsRequired) ? Required.AllowNull : Required.Default;\n                property.Order = (dataMemberAttribute.Order != -1) ? (int?)dataMemberAttribute.Order : null;\n                property.DefaultValueHandling = (!dataMemberAttribute.EmitDefaultValue) ? (DefaultValueHandling?)DefaultValueHandling.Ignore : null;\n                hasMemberAttribute = true;\n            }\n#endif\n\n            bool hasJsonIgnoreAttribute =\n                JsonTypeReflector.GetAttribute<JsonIgnoreAttribute>(attributeProvider) != null\n                    // automatically ignore extension data dictionary property if it is public\n                || JsonTypeReflector.GetAttribute<JsonExtensionDataAttribute>(attributeProvider) != null\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n                || JsonTypeReflector.GetAttribute<NonSerializedAttribute>(attributeProvider) != null\n#endif\n                ;\n\n            if (memberSerialization != MemberSerialization.OptIn)\n            {\n                bool hasIgnoreDataMemberAttribute = false;\n\n#if !(NET20 || NET35)\n                hasIgnoreDataMemberAttribute = (JsonTypeReflector.GetAttribute<IgnoreDataMemberAttribute>(attributeProvider) != null);\n#endif\n\n                // ignored if it has JsonIgnore or NonSerialized or IgnoreDataMember attributes\n                property.Ignored = (hasJsonIgnoreAttribute || hasIgnoreDataMemberAttribute);\n            }\n            else\n            {\n                // ignored if it has JsonIgnore/NonSerialized or does not have DataMember or JsonProperty attributes\n                property.Ignored = (hasJsonIgnoreAttribute || !hasMemberAttribute);\n            }\n\n            // resolve converter for property\n            // the class type might have a converter but the property converter takes presidence\n            property.Converter = JsonTypeReflector.GetJsonConverter(attributeProvider, property.PropertyType);\n            property.MemberConverter = JsonTypeReflector.GetJsonConverter(attributeProvider, property.PropertyType);\n\n            DefaultValueAttribute defaultValueAttribute = JsonTypeReflector.GetAttribute<DefaultValueAttribute>(attributeProvider);\n            if (defaultValueAttribute != null)\n                property.DefaultValue = defaultValueAttribute.Value;\n\n            property.NullValueHandling = (propertyAttribute != null) ? propertyAttribute._nullValueHandling : null;\n            property.ReferenceLoopHandling = (propertyAttribute != null) ? propertyAttribute._referenceLoopHandling : null;\n            property.ObjectCreationHandling = (propertyAttribute != null) ? propertyAttribute._objectCreationHandling : null;\n            property.TypeNameHandling = (propertyAttribute != null) ? propertyAttribute._typeNameHandling : null;\n            property.IsReference = (propertyAttribute != null) ? propertyAttribute._isReference : null;\n\n            property.ItemIsReference = (propertyAttribute != null) ? propertyAttribute._itemIsReference : null;\n            property.ItemConverter =\n                (propertyAttribute != null && propertyAttribute.ItemConverterType != null)\n                    ? JsonConverterAttribute.CreateJsonConverterInstance(propertyAttribute.ItemConverterType)\n                    : null;\n            property.ItemReferenceLoopHandling = (propertyAttribute != null) ? propertyAttribute._itemReferenceLoopHandling : null;\n            property.ItemTypeNameHandling = (propertyAttribute != null) ? propertyAttribute._itemTypeNameHandling : null;\n\n            allowNonPublicAccess = false;\n#pragma warning disable 618\n            if ((DefaultMembersSearchFlags & BindingFlags.NonPublic) == BindingFlags.NonPublic)\n                allowNonPublicAccess = true;\n#pragma warning restore 618\n            if (propertyAttribute != null)\n                allowNonPublicAccess = true;\n            if (memberSerialization == MemberSerialization.Fields)\n                allowNonPublicAccess = true;\n\n#if !NET20\n            if (dataMemberAttribute != null)\n            {\n                allowNonPublicAccess = true;\n                property.HasMemberAttribute = true;\n            }\n#endif\n        }\n\n        private Predicate<object> CreateShouldSerializeTest(MemberInfo member)\n        {\n            MethodInfo shouldSerializeMethod = member.DeclaringType.GetMethod(JsonTypeReflector.ShouldSerializePrefix + member.Name, ReflectionUtils.EmptyTypes);\n\n            if (shouldSerializeMethod == null || shouldSerializeMethod.ReturnType != typeof(bool))\n                return null;\n\n            MethodCall<object, object> shouldSerializeCall =\n                JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(shouldSerializeMethod);\n\n            return o => (bool)shouldSerializeCall(o);\n        }\n\n        private void SetIsSpecifiedActions(JsonProperty property, MemberInfo member, bool allowNonPublicAccess)\n        {\n            MemberInfo specifiedMember = member.DeclaringType.GetProperty(member.Name + JsonTypeReflector.SpecifiedPostfix);\n            if (specifiedMember == null)\n                specifiedMember = member.DeclaringType.GetField(member.Name + JsonTypeReflector.SpecifiedPostfix);\n\n            if (specifiedMember == null || ReflectionUtils.GetMemberUnderlyingType(specifiedMember) != typeof(bool))\n            {\n                return;\n            }\n\n            Func<object, object> specifiedPropertyGet = JsonTypeReflector.ReflectionDelegateFactory.CreateGet<object>(specifiedMember);\n\n            property.GetIsSpecified = o => (bool)specifiedPropertyGet(o);\n\n            if (ReflectionUtils.CanSetMemberValue(specifiedMember, allowNonPublicAccess, false))\n                property.SetIsSpecified = JsonTypeReflector.ReflectionDelegateFactory.CreateSet<object>(specifiedMember);\n        }\n\n        /// <summary>\n        /// Resolves the name of the property.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        /// <returns>Name of the property.</returns>\n        protected internal virtual string ResolvePropertyName(string propertyName)\n        {\n            return propertyName;\n        }\n\n        /// <summary>\n        /// Gets the resolved name of the property.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        /// <returns>Name of the property.</returns>\n        public string GetResolvedPropertyName(string propertyName)\n        {\n            // this is a new method rather than changing the visibility of ResolvePropertyName to avoid\n            // a breaking change for anyone who has overidden the method\n            return ResolvePropertyName(propertyName);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/DefaultReferenceResolver.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal class DefaultReferenceResolver : IReferenceResolver\n    {\n        private int _referenceCount;\n\n        private BidirectionalDictionary<string, object> GetMappings(object context)\n        {\n            JsonSerializerInternalBase internalSerializer;\n\n            if (context is JsonSerializerInternalBase)\n                internalSerializer = (JsonSerializerInternalBase)context;\n            else if (context is JsonSerializerProxy)\n                internalSerializer = ((JsonSerializerProxy)context).GetInternalSerializer();\n            else\n                throw new JsonException(\"The DefaultReferenceResolver can only be used internally.\");\n\n            return internalSerializer.DefaultReferenceMappings;\n        }\n\n        public object ResolveReference(object context, string reference)\n        {\n            object value;\n            GetMappings(context).TryGetByFirst(reference, out value);\n            return value;\n        }\n\n        public string GetReference(object context, object value)\n        {\n            var mappings = GetMappings(context);\n\n            string reference;\n            if (!mappings.TryGetBySecond(value, out reference))\n            {\n                _referenceCount++;\n                reference = _referenceCount.ToString(CultureInfo.InvariantCulture);\n                mappings.Set(reference, value);\n            }\n\n            return reference;\n        }\n\n        public void AddReference(object context, string reference, object value)\n        {\n            GetMappings(context).Set(reference, value);\n        }\n\n        public bool IsReferenced(object context, object value)\n        {\n            string reference;\n            return GetMappings(context).TryGetBySecond(value, out reference);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Runtime.Serialization;\nusing System.Reflection;\nusing System.Globalization;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// The default serialization binder used when resolving and loading classes from type names.\n    /// </summary>\n    public class DefaultSerializationBinder : SerializationBinder\n    {\n        internal static readonly DefaultSerializationBinder Instance = new DefaultSerializationBinder();\n\n        private readonly ThreadSafeStore<TypeNameKey, Type> _typeCache = new ThreadSafeStore<TypeNameKey, Type>(GetTypeFromTypeNameKey);\n\n        private static Type GetTypeFromTypeNameKey(TypeNameKey typeNameKey)\n        {\n            string assemblyName = typeNameKey.AssemblyName;\n            string typeName = typeNameKey.TypeName;\n\n            if (assemblyName != null)\n            {\n                Assembly assembly;\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n                // look, I don't like using obsolete methods as much as you do but this is the only way\n                // Assembly.Load won't check the GAC for a partial name\n#pragma warning disable 618,612\n                assembly = Assembly.LoadWithPartialName(assemblyName);\n#pragma warning restore 618,612\n#elif NETFX_CORE || PORTABLE\n        assembly = Assembly.Load(new AssemblyName(assemblyName));\n#else\n                assembly = Assembly.Load(assemblyName);\n#endif\n\n#if !(PORTABLE40 || PORTABLE || NETFX_CORE)\n                if (assembly == null)\n                {\n                    // will find assemblies loaded with Assembly.LoadFile outside of the main directory\n                    Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();\n                    foreach (Assembly a in loadedAssemblies)\n                    {\n                        if (a.FullName == assemblyName)\n                        {\n                            assembly = a;\n                            break;\n                        }\n                    }\n                }\n#endif\n\n                if (assembly == null)\n                    throw new JsonSerializationException(\"Could not load assembly '{0}'.\".FormatWith(CultureInfo.InvariantCulture, assemblyName));\n\n                Type type = assembly.GetType(typeName);\n                if (type == null)\n                    throw new JsonSerializationException(\"Could not find type '{0}' in assembly '{1}'.\".FormatWith(CultureInfo.InvariantCulture, typeName, assembly.FullName));\n\n                return type;\n            }\n            else\n            {\n                return Type.GetType(typeName);\n            }\n        }\n\n        internal struct TypeNameKey : IEquatable<TypeNameKey>\n        {\n            internal readonly string AssemblyName;\n            internal readonly string TypeName;\n\n            public TypeNameKey(string assemblyName, string typeName)\n            {\n                AssemblyName = assemblyName;\n                TypeName = typeName;\n            }\n\n            public override int GetHashCode()\n            {\n                return ((AssemblyName != null) ? AssemblyName.GetHashCode() : 0) ^ ((TypeName != null) ? TypeName.GetHashCode() : 0);\n            }\n\n            public override bool Equals(object obj)\n            {\n                if (!(obj is TypeNameKey))\n                    return false;\n\n                return Equals((TypeNameKey)obj);\n            }\n\n            public bool Equals(TypeNameKey other)\n            {\n                return (AssemblyName == other.AssemblyName && TypeName == other.TypeName);\n            }\n        }\n\n        /// <summary>\n        /// When overridden in a derived class, controls the binding of a serialized object to a type.\n        /// </summary>\n        /// <param name=\"assemblyName\">Specifies the <see cref=\"T:System.Reflection.Assembly\"/> name of the serialized object.</param>\n        /// <param name=\"typeName\">Specifies the <see cref=\"T:System.Type\"/> name of the serialized object.</param>\n        /// <returns>\n        /// The type of the object the formatter creates a new instance of.\n        /// </returns>\n        public override Type BindToType(string assemblyName, string typeName)\n        {\n            return _typeCache.Get(new TypeNameKey(assemblyName, typeName));\n        }\n\n#if !(NET35 || NET20)\n        /// <summary>\n        /// When overridden in a derived class, controls the binding of a serialized object to a type.\n        /// </summary>\n        /// <param name=\"serializedType\">The type of the object the formatter creates a new instance of.</param>\n        /// <param name=\"assemblyName\">Specifies the <see cref=\"T:System.Reflection.Assembly\"/> name of the serialized object. </param>\n        /// <param name=\"typeName\">Specifies the <see cref=\"T:System.Type\"/> name of the serialized object. </param>\n        public override void BindToName(Type serializedType, out string assemblyName, out string typeName)\n        {\n#if NETFX_CORE || PORTABLE\n            assemblyName = serializedType.GetTypeInfo().Assembly.FullName;\n            typeName = serializedType.FullName;\n#else\n            assemblyName = serializedType.Assembly.FullName;\n            typeName = serializedType.FullName;\n#endif\n        }\n#endif\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/DiagnosticsTraceWriter.cs",
    "content": "﻿#if !(PORTABLE40 || PORTABLE || NETFX_CORE)\nusing System;\nusing System.Diagnostics;\nusing DiagnosticsTrace = System.Diagnostics.Trace;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Represents a trace writer that writes to the application's <see cref=\"TraceListener\"/> instances.\n    /// </summary>\n    public class DiagnosticsTraceWriter : ITraceWriter\n    {\n        /// <summary>\n        /// Gets the <see cref=\"TraceLevel\"/> that will be used to filter the trace messages passed to the writer.\n        /// For example a filter level of <code>Info</code> will exclude <code>Verbose</code> messages and include <code>Info</code>,\n        /// <code>Warning</code> and <code>Error</code> messages.\n        /// </summary>\n        /// <value>\n        /// The <see cref=\"TraceLevel\"/> that will be used to filter the trace messages passed to the writer.\n        /// </value>\n        public TraceLevel LevelFilter { get; set; }\n\n        private TraceEventType GetTraceEventType(TraceLevel level)\n        {\n            switch (level)\n            {\n                case TraceLevel.Error:\n                    return TraceEventType.Error;\n                case TraceLevel.Warning:\n                    return TraceEventType.Warning;\n                case TraceLevel.Info:\n                    return TraceEventType.Information;\n                case TraceLevel.Verbose:\n                    return TraceEventType.Verbose;\n                default:\n                    throw new ArgumentOutOfRangeException(\"level\");\n            }\n        }\n\n        /// <summary>\n        /// Writes the specified trace level, message and optional exception.\n        /// </summary>\n        /// <param name=\"level\">The <see cref=\"TraceLevel\"/> at which to write this trace.</param>\n        /// <param name=\"message\">The trace message.</param>\n        /// <param name=\"ex\">The trace exception. This parameter is optional.</param>\n        public void Trace(TraceLevel level, string message, Exception ex)\n        {\n            if (level == TraceLevel.Off)\n                return;\n\n            TraceEventCache eventCache = new TraceEventCache();\n            TraceEventType traceEventType = GetTraceEventType(level);\n\n            foreach (TraceListener listener in DiagnosticsTrace.Listeners)\n            {\n                if (!listener.IsThreadSafe)\n                {\n                    lock (listener)\n                    {\n                        listener.TraceEvent(eventCache, \"Newtonsoft.Json\", traceEventType, 0, message);\n                    }\n                }\n                else\n                {\n                    listener.TraceEvent(eventCache, \"Newtonsoft.Json\", traceEventType, 0, message);\n                }\n\n                if (DiagnosticsTrace.AutoFlush)\n                    listener.Flush();\n            }\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Serialization/DynamicValueProvider.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(PORTABLE40 || PORTABLE || NETFX_CORE)\nusing System;\nusing System.Collections.Generic;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#endif\nusing System.Text;\nusing System.Reflection;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Get and set values for a <see cref=\"MemberInfo\"/> using dynamic methods.\n    /// </summary>\n    public class DynamicValueProvider : IValueProvider\n    {\n        private readonly MemberInfo _memberInfo;\n        private Func<object, object> _getter;\n        private Action<object, object> _setter;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"DynamicValueProvider\"/> class.\n        /// </summary>\n        /// <param name=\"memberInfo\">The member info.</param>\n        public DynamicValueProvider(MemberInfo memberInfo)\n        {\n            ValidationUtils.ArgumentNotNull(memberInfo, \"memberInfo\");\n            _memberInfo = memberInfo;\n        }\n\n        /// <summary>\n        /// Sets the value.\n        /// </summary>\n        /// <param name=\"target\">The target to set the value on.</param>\n        /// <param name=\"value\">The value to set on the target.</param>\n        public void SetValue(object target, object value)\n        {\n            try\n            {\n                if (_setter == null)\n                    _setter = DynamicReflectionDelegateFactory.Instance.CreateSet<object>(_memberInfo);\n\n#if DEBUG\n                // dynamic method doesn't check whether the type is 'legal' to set\n                // add this check for unit tests\n                if (value == null)\n                {\n                    if (!ReflectionUtils.IsNullable(ReflectionUtils.GetMemberUnderlyingType(_memberInfo)))\n                        throw new JsonSerializationException(\"Incompatible value. Cannot set {0} to null.\".FormatWith(CultureInfo.InvariantCulture, _memberInfo));\n                }\n                else if (!ReflectionUtils.GetMemberUnderlyingType(_memberInfo).IsAssignableFrom(value.GetType()))\n                {\n                    throw new JsonSerializationException(\"Incompatible value. Cannot set {0} to type {1}.\".FormatWith(CultureInfo.InvariantCulture, _memberInfo, value.GetType()));\n                }\n#endif\n\n                _setter(target, value);\n            }\n            catch (Exception ex)\n            {\n                throw new JsonSerializationException(\"Error setting value to '{0}' on '{1}'.\".FormatWith(CultureInfo.InvariantCulture, _memberInfo.Name, target.GetType()), ex);\n            }\n        }\n\n        /// <summary>\n        /// Gets the value.\n        /// </summary>\n        /// <param name=\"target\">The target to get the value from.</param>\n        /// <returns>The value.</returns>\n        public object GetValue(object target)\n        {\n            try\n            {\n                if (_getter == null)\n                    _getter = DynamicReflectionDelegateFactory.Instance.CreateGet<object>(_memberInfo);\n\n                return _getter(target);\n            }\n            catch (Exception ex)\n            {\n                throw new JsonSerializationException(\"Error getting value from '{0}' on '{1}'.\".FormatWith(CultureInfo.InvariantCulture, _memberInfo.Name, target.GetType()), ex);\n            }\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Serialization/ErrorContext.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Provides information surrounding an error.\n    /// </summary>\n    public class ErrorContext\n    {\n        internal ErrorContext(object originalObject, object member, string path, Exception error)\n        {\n            OriginalObject = originalObject;\n            Member = member;\n            Error = error;\n            Path = path;\n        }\n\n        internal bool Traced { get; set; }\n\n        /// <summary>\n        /// Gets the error.\n        /// </summary>\n        /// <value>The error.</value>\n        public Exception Error { get; private set; }\n\n        /// <summary>\n        /// Gets the original object that caused the error.\n        /// </summary>\n        /// <value>The original object that caused the error.</value>\n        public object OriginalObject { get; private set; }\n\n        /// <summary>\n        /// Gets the member that caused the error.\n        /// </summary>\n        /// <value>The member that caused the error.</value>\n        public object Member { get; private set; }\n\n        /// <summary>\n        /// Gets the path of the JSON location where the error occurred.\n        /// </summary>\n        /// <value>The path of the JSON location where the error occurred.</value>\n        public string Path { get; private set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether this <see cref=\"ErrorContext\"/> is handled.\n        /// </summary>\n        /// <value><c>true</c> if handled; otherwise, <c>false</c>.</value>\n        public bool Handled { get; set; }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/ErrorEventArgs.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Provides data for the Error event.\n    /// </summary>\n    public class ErrorEventArgs : EventArgs\n    {\n        /// <summary>\n        /// Gets the current object the error event is being raised against.\n        /// </summary>\n        /// <value>The current object the error event is being raised against.</value>\n        public object CurrentObject { get; private set; }\n\n        /// <summary>\n        /// Gets the error context.\n        /// </summary>\n        /// <value>The error context.</value>\n        public ErrorContext ErrorContext { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ErrorEventArgs\"/> class.\n        /// </summary>\n        /// <param name=\"currentObject\">The current object.</param>\n        /// <param name=\"errorContext\">The error context.</param>\n        public ErrorEventArgs(object currentObject, ErrorContext errorContext)\n        {\n            CurrentObject = currentObject;\n            ErrorContext = errorContext;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/ExpressionValueProvider.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NET20 || NET35 || PORTABLE40)\nusing System;\nusing System.Collections.Generic;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#endif\nusing System.Text;\nusing System.Reflection;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Get and set values for a <see cref=\"MemberInfo\"/> using dynamic methods.\n    /// </summary>\n    public class ExpressionValueProvider : IValueProvider\n    {\n        private readonly MemberInfo _memberInfo;\n        private Func<object, object> _getter;\n        private Action<object, object> _setter;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ExpressionValueProvider\"/> class.\n        /// </summary>\n        /// <param name=\"memberInfo\">The member info.</param>\n        public ExpressionValueProvider(MemberInfo memberInfo)\n        {\n            ValidationUtils.ArgumentNotNull(memberInfo, \"memberInfo\");\n            _memberInfo = memberInfo;\n        }\n\n        /// <summary>\n        /// Sets the value.\n        /// </summary>\n        /// <param name=\"target\">The target to set the value on.</param>\n        /// <param name=\"value\">The value to set on the target.</param>\n        public void SetValue(object target, object value)\n        {\n            try\n            {\n                if (_setter == null)\n                    _setter = ExpressionReflectionDelegateFactory.Instance.CreateSet<object>(_memberInfo);\n\n#if DEBUG\n                // dynamic method doesn't check whether the type is 'legal' to set\n                // add this check for unit tests\n                if (value == null)\n                {\n                    if (!ReflectionUtils.IsNullable(ReflectionUtils.GetMemberUnderlyingType(_memberInfo)))\n                        throw new JsonSerializationException(\"Incompatible value. Cannot set {0} to null.\".FormatWith(CultureInfo.InvariantCulture, _memberInfo));\n                }\n                else if (!ReflectionUtils.GetMemberUnderlyingType(_memberInfo).IsAssignableFrom(value.GetType()))\n                {\n                    throw new JsonSerializationException(\"Incompatible value. Cannot set {0} to type {1}.\".FormatWith(CultureInfo.InvariantCulture, _memberInfo, value.GetType()));\n                }\n#endif\n\n                _setter(target, value);\n            }\n            catch (Exception ex)\n            {\n                throw new JsonSerializationException(\"Error setting value to '{0}' on '{1}'.\".FormatWith(CultureInfo.InvariantCulture, _memberInfo.Name, target.GetType()), ex);\n            }\n        }\n\n        /// <summary>\n        /// Gets the value.\n        /// </summary>\n        /// <param name=\"target\">The target to get the value from.</param>\n        /// <returns>The value.</returns>\n        public object GetValue(object target)\n        {\n            try\n            {\n                if (_getter == null)\n                    _getter = ExpressionReflectionDelegateFactory.Instance.CreateGet<object>(_memberInfo);\n\n                return _getter(target);\n            }\n            catch (Exception ex)\n            {\n                throw new JsonSerializationException(\"Error getting value from '{0}' on '{1}'.\".FormatWith(CultureInfo.InvariantCulture, _memberInfo.Name, target.GetType()), ex);\n            }\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Serialization/IContractResolver.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Used by <see cref=\"JsonSerializer\"/> to resolves a <see cref=\"JsonContract\"/> for a given <see cref=\"Type\"/>.\n    /// </summary>\n    /// <example>\n    ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\SerializationTests.cs\" region=\"ReducingSerializedJsonSizeContractResolverObject\" title=\"IContractResolver Class\" />\n    ///   <code lang=\"cs\" source=\"..\\Src\\Newtonsoft.Json.Tests\\Documentation\\SerializationTests.cs\" region=\"ReducingSerializedJsonSizeContractResolverExample\" title=\"IContractResolver Example\" />\n    /// </example>\n    public interface IContractResolver\n    {\n        /// <summary>\n        /// Resolves the contract for a given type.\n        /// </summary>\n        /// <param name=\"type\">The type to resolve a contract for.</param>\n        /// <returns>The contract for a given type.</returns>\n        JsonContract ResolveContract(Type type);\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/IReferenceResolver.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Used to resolve references when serializing and deserializing JSON by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public interface IReferenceResolver\n    {\n        /// <summary>\n        /// Resolves a reference to its object.\n        /// </summary>\n        /// <param name=\"context\">The serialization context.</param>\n        /// <param name=\"reference\">The reference to resolve.</param>\n        /// <returns>The object that</returns>\n        object ResolveReference(object context, string reference);\n\n        /// <summary>\n        /// Gets the reference for the sepecified object.\n        /// </summary>\n        /// <param name=\"context\">The serialization context.</param>\n        /// <param name=\"value\">The object to get a reference for.</param>\n        /// <returns>The reference to the object.</returns>\n        string GetReference(object context, object value);\n\n        /// <summary>\n        /// Determines whether the specified object is referenced.\n        /// </summary>\n        /// <param name=\"context\">The serialization context.</param>\n        /// <param name=\"value\">The object to test for a reference.</param>\n        /// <returns>\n        /// \t<c>true</c> if the specified object is referenced; otherwise, <c>false</c>.\n        /// </returns>\n        bool IsReferenced(object context, object value);\n\n        /// <summary>\n        /// Adds a reference to the specified object.\n        /// </summary>\n        /// <param name=\"context\">The serialization context.</param>\n        /// <param name=\"reference\">The reference.</param>\n        /// <param name=\"value\">The object to reference.</param>\n        void AddReference(object context, string reference, object value);\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/ITraceWriter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Represents a trace writer.\n    /// </summary>\n    public interface ITraceWriter\n    {\n        /// <summary>\n        /// Gets the <see cref=\"TraceLevel\"/> that will be used to filter the trace messages passed to the writer.\n        /// For example a filter level of <code>Info</code> will exclude <code>Verbose</code> messages and include <code>Info</code>,\n        /// <code>Warning</code> and <code>Error</code> messages.\n        /// </summary>\n        /// <value>The <see cref=\"TraceLevel\"/> that will be used to filter the trace messages passed to the writer.</value>\n        TraceLevel LevelFilter { get; }\n\n        /// <summary>\n        /// Writes the specified trace level, message and optional exception.\n        /// </summary>\n        /// <param name=\"level\">The <see cref=\"TraceLevel\"/> at which to write this trace.</param>\n        /// <param name=\"message\">The trace message.</param>\n        /// <param name=\"ex\">The trace exception. This parameter is optional.</param>\n        void Trace(TraceLevel level, string message, Exception ex);\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/IValueProvider.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Provides methods to get and set values.\n    /// </summary>\n    public interface IValueProvider\n    {\n        /// <summary>\n        /// Sets the value.\n        /// </summary>\n        /// <param name=\"target\">The target to set the value on.</param>\n        /// <param name=\"value\">The value to set on the target.</param>\n        void SetValue(object target, object value);\n\n        /// <summary>\n        /// Gets the value.\n        /// </summary>\n        /// <param name=\"target\">The target to get the value from.</param>\n        /// <returns>The value.</returns>\n        object GetValue(object target);\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonArrayContract.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Globalization;\nusing System.Reflection;\nusing Newtonsoft.Json.Utilities;\nusing System.Collections;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Contract details for a <see cref=\"Type\"/> used by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public class JsonArrayContract : JsonContainerContract\n    {\n        /// <summary>\n        /// Gets the <see cref=\"Type\"/> of the collection items.\n        /// </summary>\n        /// <value>The <see cref=\"Type\"/> of the collection items.</value>\n        public Type CollectionItemType { get; private set; }\n\n        /// <summary>\n        /// Gets a value indicating whether the collection type is a multidimensional array.\n        /// </summary>\n        /// <value><c>true</c> if the collection type is a multidimensional array; otherwise, <c>false</c>.</value>\n        public bool IsMultidimensionalArray { get; private set; }\n\n        private readonly bool _isCollectionItemTypeNullableType;\n        private readonly Type _genericCollectionDefinitionType;\n\n        private Type _genericWrapperType;\n        private MethodCall<object, object> _genericWrapperCreator;\n        private Func<object> _genericTemporaryCollectionCreator;\n\n        internal bool IsArray { get; private set; }\n        internal bool ShouldCreateWrapper { get; private set; }\n        internal bool CanDeserialize { get; private set; }\n        internal MethodBase ParametrizedConstructor { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonArrayContract\"/> class.\n        /// </summary>\n        /// <param name=\"underlyingType\">The underlying type for the contract.</param>\n        public JsonArrayContract(Type underlyingType)\n            : base(underlyingType)\n        {\n            ContractType = JsonContractType.Array;\n            IsArray = CreatedType.IsArray;\n\n            bool canDeserialize;\n\n            Type tempCollectionType;\n            if (IsArray)\n            {\n                CollectionItemType = ReflectionUtils.GetCollectionItemType(UnderlyingType);\n                IsReadOnlyOrFixedSize = true;\n                _genericCollectionDefinitionType = typeof(List<>).MakeGenericType(CollectionItemType);\n\n                canDeserialize = true;\n                IsMultidimensionalArray = (IsArray && UnderlyingType.GetArrayRank() > 1);\n            }\n            else if (typeof(IList).IsAssignableFrom(underlyingType))\n            {\n                if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(ICollection<>), out _genericCollectionDefinitionType))\n                    CollectionItemType = _genericCollectionDefinitionType.GetGenericArguments()[0];\n                else\n                    CollectionItemType = ReflectionUtils.GetCollectionItemType(underlyingType);\n\n                if (underlyingType == typeof(IList))\n                    CreatedType = typeof(List<object>);\n\n                if (CollectionItemType != null)\n                    ParametrizedConstructor = CollectionUtils.ResolveEnumableCollectionConstructor(underlyingType, CollectionItemType);\n\n                IsReadOnlyOrFixedSize = ReflectionUtils.InheritsGenericDefinition(underlyingType, typeof(ReadOnlyCollection<>));\n                canDeserialize = true;\n            }\n            else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(ICollection<>), out _genericCollectionDefinitionType))\n            {\n                CollectionItemType = _genericCollectionDefinitionType.GetGenericArguments()[0];\n\n                if (ReflectionUtils.IsGenericDefinition(underlyingType, typeof(ICollection<>))\n                    || ReflectionUtils.IsGenericDefinition(underlyingType, typeof(IList<>)))\n                    CreatedType = typeof(List<>).MakeGenericType(CollectionItemType);\n\n#if !(NET20 || NET35 || PORTABLE40)\n                if (ReflectionUtils.IsGenericDefinition(underlyingType, typeof(ISet<>)))\n                    CreatedType = typeof(HashSet<>).MakeGenericType(CollectionItemType);\n#endif\n\n                ParametrizedConstructor = CollectionUtils.ResolveEnumableCollectionConstructor(underlyingType, CollectionItemType);\n                canDeserialize = true;\n                ShouldCreateWrapper = true;\n            }\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IReadOnlyCollection<>), out tempCollectionType))\n            {\n                CollectionItemType = underlyingType.GetGenericArguments()[0];\n\n                if (ReflectionUtils.IsGenericDefinition(underlyingType, typeof(IReadOnlyCollection<>))\n                    || ReflectionUtils.IsGenericDefinition(underlyingType, typeof(IReadOnlyList<>)))\n                    CreatedType = typeof(ReadOnlyCollection<>).MakeGenericType(CollectionItemType);\n\n                _genericCollectionDefinitionType = typeof(List<>).MakeGenericType(CollectionItemType);\n                ParametrizedConstructor = CollectionUtils.ResolveEnumableCollectionConstructor(CreatedType, CollectionItemType);\n                IsReadOnlyOrFixedSize = true;\n                canDeserialize = (ParametrizedConstructor != null);\n            }\n#endif\n            else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IEnumerable<>), out tempCollectionType))\n            {\n                CollectionItemType = tempCollectionType.GetGenericArguments()[0];\n\n                if (ReflectionUtils.IsGenericDefinition(UnderlyingType, typeof(IEnumerable<>)))\n                    CreatedType = typeof(List<>).MakeGenericType(CollectionItemType);\n\n                ParametrizedConstructor = CollectionUtils.ResolveEnumableCollectionConstructor(underlyingType, CollectionItemType);\n\n#if !(NET35 || NET20 || NETFX_CORE)\n                if (ParametrizedConstructor == null && underlyingType.Name == FSharpUtils.FSharpListTypeName)\n                {\n                    FSharpUtils.EnsureInitialized(underlyingType.Assembly());\n                    ParametrizedConstructor = FSharpUtils.CreateSeq(CollectionItemType);\n                }\n#endif\n\n                if (underlyingType.IsGenericType() && underlyingType.GetGenericTypeDefinition() == typeof(IEnumerable<>))\n                {\n                    _genericCollectionDefinitionType = tempCollectionType;\n\n                    IsReadOnlyOrFixedSize = false;\n                    ShouldCreateWrapper = false;\n                    canDeserialize = true;\n                }\n                else\n                {\n                    _genericCollectionDefinitionType = typeof(List<>).MakeGenericType(CollectionItemType);\n\n                    IsReadOnlyOrFixedSize = true;\n                    ShouldCreateWrapper = true;\n                    canDeserialize = (ParametrizedConstructor != null);\n                }\n            }\n            else\n            {\n                // types that implement IEnumerable and nothing else\n                canDeserialize = false;\n                ShouldCreateWrapper = true;\n            }\n\n            CanDeserialize = canDeserialize;\n\n            if (CollectionItemType != null)\n                _isCollectionItemTypeNullableType = ReflectionUtils.IsNullableType(CollectionItemType);\n\n#if (NET20 || NET35)\n    // bug in .NET 2.0 & 3.5 that List<Nullable<T>> throws an error when adding null via IList.Add(object)\n    // wrapper will handle calling Add(T) instead\n      if (_isCollectionItemTypeNullableType\n        && (ReflectionUtils.InheritsGenericDefinition(CreatedType, typeof(List<>), out tempCollectionType)\n        || (IsArray && !IsMultidimensionalArray)))\n      {\n        ShouldCreateWrapper = true;\n      }\n#endif\n\n#if !(NET20 || NET35 || NET40 || PORTABLE40)\n            Type immutableCreatedType;\n            MethodBase immutableParameterizedCreator;\n            if (ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(underlyingType, CollectionItemType, out immutableCreatedType, out immutableParameterizedCreator))\n            {\n                CreatedType = immutableCreatedType;\n                ParametrizedConstructor = immutableParameterizedCreator;\n                IsReadOnlyOrFixedSize = true;\n                CanDeserialize = true;\n            }\n#endif\n        }\n\n        internal IWrappedCollection CreateWrapper(object list)\n        {\n            if (_genericWrapperCreator == null)\n            {\n                _genericWrapperType = typeof(CollectionWrapper<>).MakeGenericType(CollectionItemType);\n\n                Type constructorArgument;\n\n                if (ReflectionUtils.InheritsGenericDefinition(_genericCollectionDefinitionType, typeof(List<>))\n                    || _genericCollectionDefinitionType.GetGenericTypeDefinition() == typeof(IEnumerable<>))\n                    constructorArgument = typeof(ICollection<>).MakeGenericType(CollectionItemType);\n                else\n                    constructorArgument = _genericCollectionDefinitionType;\n\n                ConstructorInfo genericWrapperConstructor = _genericWrapperType.GetConstructor(new[] { constructorArgument });\n                _genericWrapperCreator = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(genericWrapperConstructor);\n            }\n\n            return (IWrappedCollection)_genericWrapperCreator(null, list);\n        }\n\n        internal IList CreateTemporaryCollection()\n        {\n            if (_genericTemporaryCollectionCreator == null)\n            {\n                // multidimensional array will also have array instances in it\n                Type collectionItemType = (IsMultidimensionalArray) ? typeof(object) : CollectionItemType;\n                Type temporaryListType = typeof(List<>).MakeGenericType(collectionItemType);\n                _genericTemporaryCollectionCreator = JsonTypeReflector.ReflectionDelegateFactory.CreateDefaultConstructor<object>(temporaryListType);\n            }\n\n            return (IList)_genericTemporaryCollectionCreator();\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonContainerContract.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Reflection;\nusing Newtonsoft.Json.Utilities;\nusing System.Collections;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Contract details for a <see cref=\"Type\"/> used by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public class JsonContainerContract : JsonContract\n    {\n        private JsonContract _itemContract;\n        private JsonContract _finalItemContract;\n\n        // will be null for containers that don't have an item type (e.g. IList) or for complex objects\n        internal JsonContract ItemContract\n        {\n            get { return _itemContract; }\n            set\n            {\n                _itemContract = value;\n                if (_itemContract != null)\n                {\n                    _finalItemContract = (_itemContract.UnderlyingType.IsSealed()) ? _itemContract : null;\n                }\n                else\n                {\n                    _finalItemContract = null;\n                }\n            }\n        }\n\n        // the final (i.e. can't be inherited from like a sealed class or valuetype) item contract\n        internal JsonContract FinalItemContract\n        {\n            get { return _finalItemContract; }\n        }\n\n        /// <summary>\n        /// Gets or sets the default collection items <see cref=\"JsonConverter\" />.\n        /// </summary>\n        /// <value>The converter.</value>\n        public JsonConverter ItemConverter { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the collection items preserve object references.\n        /// </summary>\n        /// <value><c>true</c> if collection items preserve object references; otherwise, <c>false</c>.</value>\n        public bool? ItemIsReference { get; set; }\n\n        /// <summary>\n        /// Gets or sets the collection item reference loop handling.\n        /// </summary>\n        /// <value>The reference loop handling.</value>\n        public ReferenceLoopHandling? ItemReferenceLoopHandling { get; set; }\n\n        /// <summary>\n        /// Gets or sets the collection item type name handling.\n        /// </summary>\n        /// <value>The type name handling.</value>\n        public TypeNameHandling? ItemTypeNameHandling { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonContainerContract\"/> class.\n        /// </summary>\n        /// <param name=\"underlyingType\">The underlying type for the contract.</param>\n        internal JsonContainerContract(Type underlyingType)\n            : base(underlyingType)\n        {\n            JsonContainerAttribute jsonContainerAttribute = JsonTypeReflector.GetJsonContainerAttribute(underlyingType);\n\n            if (jsonContainerAttribute != null)\n            {\n                if (jsonContainerAttribute.ItemConverterType != null)\n                    ItemConverter = JsonConverterAttribute.CreateJsonConverterInstance(jsonContainerAttribute.ItemConverterType);\n\n                ItemIsReference = jsonContainerAttribute._itemIsReference;\n                ItemReferenceLoopHandling = jsonContainerAttribute._itemReferenceLoopHandling;\n                ItemTypeNameHandling = jsonContainerAttribute._itemTypeNameHandling;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonContract.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal enum JsonContractType\n    {\n        None,\n        Object,\n        Array,\n        Primitive,\n        String,\n        Dictionary,\n#if !(NET35 || NET20 || PORTABLE40)\n        Dynamic,\n#endif\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n        Serializable,\n#endif\n        Linq\n    }\n\n    /// <summary>\n    /// Handles <see cref=\"JsonSerializer\"/> serialization callback events.\n    /// </summary>\n    /// <param name=\"o\">The object that raised the callback event.</param>\n    /// <param name=\"context\">The streaming context.</param>\n    public delegate void SerializationCallback(object o, StreamingContext context);\n\n    /// <summary>\n    /// Handles <see cref=\"JsonSerializer\"/> serialization error callback events.\n    /// </summary>\n    /// <param name=\"o\">The object that raised the callback event.</param>\n    /// <param name=\"context\">The streaming context.</param>\n    /// <param name=\"errorContext\">The error context.</param>\n    public delegate void SerializationErrorCallback(object o, StreamingContext context, ErrorContext errorContext);\n\n    /// <summary>\n    /// Sets extension data for an object during deserialization.\n    /// </summary>\n    /// <param name=\"o\">The object to set extension data on.</param>\n    /// <param name=\"key\">The extension data key.</param>\n    /// <param name=\"value\">The extension data value.</param>\n    public delegate void ExtensionDataSetter(object o, string key, object value);\n\n    /// <summary>\n    /// Gets extension data for an object during serialization.\n    /// </summary>\n    /// <param name=\"o\">The object to set extension data on.</param>\n    public delegate IEnumerable<KeyValuePair<object, object>> ExtensionDataGetter(object o);\n\n    /// <summary>\n    /// Contract details for a <see cref=\"Type\"/> used by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public abstract class JsonContract\n    {\n        internal bool IsNullable;\n        internal bool IsConvertable;\n        internal bool IsSealed;\n        internal bool IsEnum;\n        internal Type NonNullableUnderlyingType;\n        internal ReadType InternalReadType;\n        internal JsonContractType ContractType;\n        internal bool IsReadOnlyOrFixedSize;\n        internal bool IsInstantiable;\n\n        private List<SerializationCallback> _onDeserializedCallbacks;\n        private IList<SerializationCallback> _onDeserializingCallbacks;\n        private IList<SerializationCallback> _onSerializedCallbacks;\n        private IList<SerializationCallback> _onSerializingCallbacks;\n        private IList<SerializationErrorCallback> _onErrorCallbacks;\n\n        /// <summary>\n        /// Gets the underlying type for the contract.\n        /// </summary>\n        /// <value>The underlying type for the contract.</value>\n        public Type UnderlyingType { get; private set; }\n\n        /// <summary>\n        /// Gets or sets the type created during deserialization.\n        /// </summary>\n        /// <value>The type created during deserialization.</value>\n        public Type CreatedType { get; set; }\n\n        /// <summary>\n        /// Gets or sets whether this type contract is serialized as a reference.\n        /// </summary>\n        /// <value>Whether this type contract is serialized as a reference.</value>\n        public bool? IsReference { get; set; }\n\n        /// <summary>\n        /// Gets or sets the default <see cref=\"JsonConverter\" /> for this contract.\n        /// </summary>\n        /// <value>The converter.</value>\n        public JsonConverter Converter { get; set; }\n\n        // internally specified JsonConverter's to override default behavour\n        // checked for after passed in converters and attribute specified converters\n        internal JsonConverter InternalConverter { get; set; }\n\n        /// <summary>\n        /// Gets or sets all methods called immediately after deserialization of the object.\n        /// </summary>\n        /// <value>The methods called immediately after deserialization of the object.</value>\n        public IList<SerializationCallback> OnDeserializedCallbacks\n        {\n            get\n            {\n                if (_onDeserializedCallbacks == null)\n                    _onDeserializedCallbacks = new List<SerializationCallback>();\n\n                return _onDeserializedCallbacks;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets all methods called during deserialization of the object.\n        /// </summary>\n        /// <value>The methods called during deserialization of the object.</value>\n        public IList<SerializationCallback> OnDeserializingCallbacks\n        {\n            get\n            {\n                if (_onDeserializingCallbacks == null)\n                    _onDeserializingCallbacks = new List<SerializationCallback>();\n\n                return _onDeserializingCallbacks;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets all methods called after serialization of the object graph.\n        /// </summary>\n        /// <value>The methods called after serialization of the object graph.</value>\n        public IList<SerializationCallback> OnSerializedCallbacks\n        {\n            get\n            {\n                if (_onSerializedCallbacks == null)\n                    _onSerializedCallbacks = new List<SerializationCallback>();\n\n                return _onSerializedCallbacks;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets all methods called before serialization of the object.\n        /// </summary>\n        /// <value>The methods called before serialization of the object.</value>\n        public IList<SerializationCallback> OnSerializingCallbacks\n        {\n            get\n            {\n                if (_onSerializingCallbacks == null)\n                    _onSerializingCallbacks = new List<SerializationCallback>();\n\n                return _onSerializingCallbacks;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets all method called when an error is thrown during the serialization of the object.\n        /// </summary>\n        /// <value>The methods called when an error is thrown during the serialization of the object.</value>\n        public IList<SerializationErrorCallback> OnErrorCallbacks\n        {\n            get\n            {\n                if (_onErrorCallbacks == null)\n                    _onErrorCallbacks = new List<SerializationErrorCallback>();\n\n                return _onErrorCallbacks;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the method called immediately after deserialization of the object.\n        /// </summary>\n        /// <value>The method called immediately after deserialization of the object.</value>\n        [Obsolete(\"This property is obsolete and has been replaced by the OnDeserializedCallbacks collection.\")]\n        public MethodInfo OnDeserialized\n        {\n            get { return (OnDeserializedCallbacks.Count > 0) ? OnDeserializedCallbacks[0].Method() : null; }\n            set\n            {\n                OnDeserializedCallbacks.Clear();\n                OnDeserializedCallbacks.Add(CreateSerializationCallback(value));\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the method called during deserialization of the object.\n        /// </summary>\n        /// <value>The method called during deserialization of the object.</value>\n        [Obsolete(\"This property is obsolete and has been replaced by the OnDeserializingCallbacks collection.\")]\n        public MethodInfo OnDeserializing\n        {\n            get { return (OnDeserializingCallbacks.Count > 0) ? OnDeserializingCallbacks[0].Method() : null; }\n            set\n            {\n                OnDeserializingCallbacks.Clear();\n                OnDeserializingCallbacks.Add(CreateSerializationCallback(value));\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the method called after serialization of the object graph.\n        /// </summary>\n        /// <value>The method called after serialization of the object graph.</value>\n        [Obsolete(\"This property is obsolete and has been replaced by the OnSerializedCallbacks collection.\")]\n        public MethodInfo OnSerialized\n        {\n            get { return (OnSerializedCallbacks.Count > 0) ? OnSerializedCallbacks[0].Method() : null; }\n            set\n            {\n                OnSerializedCallbacks.Clear();\n                OnSerializedCallbacks.Add(CreateSerializationCallback(value));\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the method called before serialization of the object.\n        /// </summary>\n        /// <value>The method called before serialization of the object.</value>\n        [Obsolete(\"This property is obsolete and has been replaced by the OnSerializingCallbacks collection.\")]\n        public MethodInfo OnSerializing\n        {\n            get { return (OnSerializingCallbacks.Count > 0) ? OnSerializingCallbacks[0].Method() : null; }\n            set\n            {\n                OnSerializingCallbacks.Clear();\n                OnSerializingCallbacks.Add(CreateSerializationCallback(value));\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the method called when an error is thrown during the serialization of the object.\n        /// </summary>\n        /// <value>The method called when an error is thrown during the serialization of the object.</value>\n        [Obsolete(\"This property is obsolete and has been replaced by the OnErrorCallbacks collection.\")]\n        public MethodInfo OnError\n        {\n            get { return (OnErrorCallbacks.Count > 0) ? OnErrorCallbacks[0].Method() : null; }\n            set\n            {\n                OnErrorCallbacks.Clear();\n                OnErrorCallbacks.Add(CreateSerializationErrorCallback(value));\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the default creator method used to create the object.\n        /// </summary>\n        /// <value>The default creator method used to create the object.</value>\n        public Func<object> DefaultCreator { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether the default creator is non public.\n        /// </summary>\n        /// <value><c>true</c> if the default object creator is non-public; otherwise, <c>false</c>.</value>\n        public bool DefaultCreatorNonPublic { get; set; }\n\n        internal JsonContract(Type underlyingType)\n        {\n            ValidationUtils.ArgumentNotNull(underlyingType, \"underlyingType\");\n\n            UnderlyingType = underlyingType;\n\n            IsSealed = underlyingType.IsSealed();\n            IsInstantiable = !(underlyingType.IsInterface() || underlyingType.IsAbstract());\n\n            IsNullable = ReflectionUtils.IsNullable(underlyingType);\n            NonNullableUnderlyingType = (IsNullable && ReflectionUtils.IsNullableType(underlyingType)) ? Nullable.GetUnderlyingType(underlyingType) : underlyingType;\n\n            CreatedType = NonNullableUnderlyingType;\n\n            IsConvertable = ConvertUtils.IsConvertible(NonNullableUnderlyingType);\n            IsEnum = NonNullableUnderlyingType.IsEnum();\n\n            if (NonNullableUnderlyingType == typeof(byte[]))\n            {\n                InternalReadType = ReadType.ReadAsBytes;\n            }\n            else if (NonNullableUnderlyingType == typeof(int))\n            {\n                InternalReadType = ReadType.ReadAsInt32;\n            }\n            else if (NonNullableUnderlyingType == typeof(decimal))\n            {\n                InternalReadType = ReadType.ReadAsDecimal;\n            }\n            else if (NonNullableUnderlyingType == typeof(string))\n            {\n                InternalReadType = ReadType.ReadAsString;\n            }\n            else if (NonNullableUnderlyingType == typeof(DateTime))\n            {\n                InternalReadType = ReadType.ReadAsDateTime;\n            }\n#if !NET20\n            else if (NonNullableUnderlyingType == typeof(DateTimeOffset))\n            {\n                InternalReadType = ReadType.ReadAsDateTimeOffset;\n            }\n#endif\n            else\n            {\n                InternalReadType = ReadType.Read;\n            }\n        }\n\n        internal void InvokeOnSerializing(object o, StreamingContext context)\n        {\n            if (_onSerializingCallbacks != null)\n            {\n                foreach (SerializationCallback callback in _onSerializingCallbacks)\n                {\n                    callback(o, context);\n                }\n            }\n        }\n\n        internal void InvokeOnSerialized(object o, StreamingContext context)\n        {\n            if (_onSerializedCallbacks != null)\n            {\n                foreach (SerializationCallback callback in _onSerializedCallbacks)\n                {\n                    callback(o, context);\n                }\n            }\n        }\n\n        internal void InvokeOnDeserializing(object o, StreamingContext context)\n        {\n            if (_onDeserializingCallbacks != null)\n            {\n                foreach (SerializationCallback callback in _onDeserializingCallbacks)\n                {\n                    callback(o, context);\n                }\n            }\n        }\n\n        internal void InvokeOnDeserialized(object o, StreamingContext context)\n        {\n            if (_onDeserializedCallbacks != null)\n            {\n                foreach (SerializationCallback callback in _onDeserializedCallbacks)\n                {\n                    callback(o, context);\n                }\n            }\n        }\n\n        internal void InvokeOnError(object o, StreamingContext context, ErrorContext errorContext)\n        {\n            if (_onErrorCallbacks != null)\n            {\n                foreach (SerializationErrorCallback callback in _onErrorCallbacks)\n                {\n                    callback(o, context, errorContext);\n                }\n            }\n        }\n\n        internal static SerializationCallback CreateSerializationCallback(MethodInfo callbackMethodInfo)\n        {\n            return (o, context) => callbackMethodInfo.Invoke(o, new object[] { context });\n        }\n\n        internal static SerializationErrorCallback CreateSerializationErrorCallback(MethodInfo callbackMethodInfo)\n        {\n            return (o, context, econtext) => callbackMethodInfo.Invoke(o, new object[] { context, econtext });\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonDictionaryContract.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Reflection;\nusing Newtonsoft.Json.Utilities;\nusing System.Collections;\n\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#endif\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Contract details for a <see cref=\"Type\"/> used by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public class JsonDictionaryContract : JsonContainerContract\n    {\n        /// <summary>\n        /// Gets or sets the property name resolver.\n        /// </summary>\n        /// <value>The property name resolver.</value>\n        public Func<string, string> PropertyNameResolver { get; set; }\n\n        /// <summary>\n        /// Gets the <see cref=\"Type\"/> of the dictionary keys.\n        /// </summary>\n        /// <value>The <see cref=\"Type\"/> of the dictionary keys.</value>\n        public Type DictionaryKeyType { get; private set; }\n\n        /// <summary>\n        /// Gets the <see cref=\"Type\"/> of the dictionary values.\n        /// </summary>\n        /// <value>The <see cref=\"Type\"/> of the dictionary values.</value>\n        public Type DictionaryValueType { get; private set; }\n\n        internal JsonContract KeyContract { get; set; }\n\n        private readonly bool _isDictionaryValueTypeNullableType;\n        private readonly Type _genericCollectionDefinitionType;\n\n        private Type _genericWrapperType;\n        private MethodCall<object, object> _genericWrapperCreator;\n\n        private Func<object> _genericTemporaryDictionaryCreator;\n\n        internal bool ShouldCreateWrapper { get; private set; }\n        internal MethodBase ParametrizedConstructor { get; private set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonDictionaryContract\"/> class.\n        /// </summary>\n        /// <param name=\"underlyingType\">The underlying type for the contract.</param>\n        public JsonDictionaryContract(Type underlyingType)\n            : base(underlyingType)\n        {\n            ContractType = JsonContractType.Dictionary;\n\n            Type keyType;\n            Type valueType;\n\n            if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IDictionary<,>), out _genericCollectionDefinitionType))\n            {\n                keyType = _genericCollectionDefinitionType.GetGenericArguments()[0];\n                valueType = _genericCollectionDefinitionType.GetGenericArguments()[1];\n\n                if (ReflectionUtils.IsGenericDefinition(UnderlyingType, typeof(IDictionary<,>)))\n                    CreatedType = typeof(Dictionary<,>).MakeGenericType(keyType, valueType);\n\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                IsReadOnlyOrFixedSize = ReflectionUtils.InheritsGenericDefinition(underlyingType, typeof(ReadOnlyDictionary<,>));\n#endif\n            }\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IReadOnlyDictionary<,>), out _genericCollectionDefinitionType))\n            {\n                keyType = _genericCollectionDefinitionType.GetGenericArguments()[0];\n                valueType = _genericCollectionDefinitionType.GetGenericArguments()[1];\n\n                if (ReflectionUtils.IsGenericDefinition(UnderlyingType, typeof(IReadOnlyDictionary<,>)))\n                    CreatedType = typeof(ReadOnlyDictionary<,>).MakeGenericType(keyType, valueType);\n\n                IsReadOnlyOrFixedSize = true;\n            }\n#endif\n            else\n            {\n                ReflectionUtils.GetDictionaryKeyValueTypes(UnderlyingType, out keyType, out valueType);\n\n                if (UnderlyingType == typeof(IDictionary))\n                    CreatedType = typeof(Dictionary<object, object>);\n            }\n\n            if (keyType != null && valueType != null)\n            {\n                ParametrizedConstructor = CollectionUtils.ResolveEnumableCollectionConstructor(CreatedType, typeof(KeyValuePair<,>).MakeGenericType(keyType, valueType));\n\n#if !(NET35 || NET20 || NETFX_CORE)\n                if (ParametrizedConstructor == null && underlyingType.Name == FSharpUtils.FSharpMapTypeName)\n                {\n                    FSharpUtils.EnsureInitialized(underlyingType.Assembly());\n                    ParametrizedConstructor = FSharpUtils.CreateMap(keyType, valueType);\n                }\n#endif\n            }\n\n            ShouldCreateWrapper = !typeof(IDictionary).IsAssignableFrom(CreatedType);\n\n            DictionaryKeyType = keyType;\n            DictionaryValueType = valueType;\n\n            if (DictionaryValueType != null)\n                _isDictionaryValueTypeNullableType = ReflectionUtils.IsNullableType(DictionaryValueType);\n\n#if (NET20 || NET35)\n      Type tempDictioanryType;\n\n        // bug in .NET 2.0 & 3.5 that Dictionary<TKey, Nullable<TValue>> throws an error when adding null via IDictionary[key] = object\n      // wrapper will handle calling Add(T) instead\n      if (_isDictionaryValueTypeNullableType\n        && (ReflectionUtils.InheritsGenericDefinition(CreatedType, typeof(Dictionary<,>), out tempDictioanryType)))\n      {\n        ShouldCreateWrapper = true;\n      }\n#endif\n\n#if !(NET20 || NET35 || NET40 || PORTABLE40)\n            Type immutableCreatedType;\n            MethodBase immutableParameterizedCreator;\n            if (ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(underlyingType, DictionaryKeyType, DictionaryValueType, out immutableCreatedType, out immutableParameterizedCreator))\n            {\n                CreatedType = immutableCreatedType;\n                ParametrizedConstructor = immutableParameterizedCreator;\n                IsReadOnlyOrFixedSize = true;\n            }\n#endif\n        }\n\n        internal IWrappedDictionary CreateWrapper(object dictionary)\n        {\n            if (_genericWrapperCreator == null)\n            {\n                _genericWrapperType = typeof(DictionaryWrapper<,>).MakeGenericType(DictionaryKeyType, DictionaryValueType);\n\n                ConstructorInfo genericWrapperConstructor = _genericWrapperType.GetConstructor(new[] { _genericCollectionDefinitionType });\n                _genericWrapperCreator = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(genericWrapperConstructor);\n            }\n\n            return (IWrappedDictionary)_genericWrapperCreator(null, dictionary);\n        }\n\n        internal IDictionary CreateTemporaryDictionary()\n        {\n            if (_genericTemporaryDictionaryCreator == null)\n            {\n                Type temporaryDictionaryType = typeof(Dictionary<,>).MakeGenericType(DictionaryKeyType, DictionaryValueType);\n\n                _genericTemporaryDictionaryCreator = JsonTypeReflector.ReflectionDelegateFactory.CreateDefaultConstructor<object>(temporaryDictionaryType);\n            }\n\n            return (IDictionary)_genericTemporaryDictionaryCreator();\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonDynamicContract.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NET35 || NET20 || PORTABLE40)\nusing System;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing Newtonsoft.Json.Utilities;\nusing System.Collections;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Contract details for a <see cref=\"Type\"/> used by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public class JsonDynamicContract : JsonContainerContract\n    {\n        /// <summary>\n        /// Gets the object's properties.\n        /// </summary>\n        /// <value>The object's properties.</value>\n        public JsonPropertyCollection Properties { get; private set; }\n\n        /// <summary>\n        /// Gets or sets the property name resolver.\n        /// </summary>\n        /// <value>The property name resolver.</value>\n        public Func<string, string> PropertyNameResolver { get; set; }\n\n        private readonly ThreadSafeStore<string, CallSite<Func<CallSite, object, object>>> _callSiteGetters =\n            new ThreadSafeStore<string, CallSite<Func<CallSite, object, object>>>(CreateCallSiteGetter);\n\n        private readonly ThreadSafeStore<string, CallSite<Func<CallSite, object, object, object>>> _callSiteSetters =\n            new ThreadSafeStore<string, CallSite<Func<CallSite, object, object, object>>>(CreateCallSiteSetter);\n\n        private static CallSite<Func<CallSite, object, object>> CreateCallSiteGetter(string name)\n        {\n            GetMemberBinder getMemberBinder = (GetMemberBinder)DynamicUtils.BinderWrapper.GetMember(name, typeof(DynamicUtils));\n\n            return CallSite<Func<CallSite, object, object>>.Create(new NoThrowGetBinderMember(getMemberBinder));\n        }\n\n        private static CallSite<Func<CallSite, object, object, object>> CreateCallSiteSetter(string name)\n        {\n            SetMemberBinder binder = (SetMemberBinder)DynamicUtils.BinderWrapper.SetMember(name, typeof(DynamicUtils));\n\n            return CallSite<Func<CallSite, object, object, object>>.Create(new NoThrowSetBinderMember(binder));\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonDynamicContract\"/> class.\n        /// </summary>\n        /// <param name=\"underlyingType\">The underlying type for the contract.</param>\n        public JsonDynamicContract(Type underlyingType)\n            : base(underlyingType)\n        {\n            ContractType = JsonContractType.Dynamic;\n\n            Properties = new JsonPropertyCollection(UnderlyingType);\n        }\n\n        internal bool TryGetMember(IDynamicMetaObjectProvider dynamicProvider, string name, out object value)\n        {\n            ValidationUtils.ArgumentNotNull(dynamicProvider, \"dynamicProvider\");\n\n            CallSite<Func<CallSite, object, object>> callSite = _callSiteGetters.Get(name);\n\n            object result = callSite.Target(callSite, dynamicProvider);\n\n            if (!ReferenceEquals(result, NoThrowExpressionVisitor.ErrorResult))\n            {\n                value = result;\n                return true;\n            }\n            else\n            {\n                value = null;\n                return false;\n            }\n        }\n\n        internal bool TrySetMember(IDynamicMetaObjectProvider dynamicProvider, string name, object value)\n        {\n            ValidationUtils.ArgumentNotNull(dynamicProvider, \"dynamicProvider\");\n\n            CallSite<Func<CallSite, object, object, object>> callSite = _callSiteSetters.Get(name);\n\n            object result = callSite.Target(callSite, dynamicProvider, value);\n\n            return !ReferenceEquals(result, NoThrowExpressionVisitor.ErrorResult);\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonFormatterConverter.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\nusing System;\nusing System.Globalization;\nusing System.Runtime.Serialization;\nusing Newtonsoft.Json.Utilities;\nusing Newtonsoft.Json.Linq;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal class JsonFormatterConverter : IFormatterConverter\n    {\n        private readonly JsonSerializer _serializer;\n\n        public JsonFormatterConverter(JsonSerializer serializer)\n        {\n            ValidationUtils.ArgumentNotNull(serializer, \"serializer\");\n\n            _serializer = serializer;\n        }\n\n        private T GetTokenValue<T>(object value)\n        {\n            ValidationUtils.ArgumentNotNull(value, \"value\");\n\n            JValue v = (JValue)value;\n            return (T)System.Convert.ChangeType(v.Value, typeof(T), CultureInfo.InvariantCulture);\n        }\n\n        public object Convert(object value, Type type)\n        {\n            ValidationUtils.ArgumentNotNull(value, \"value\");\n\n            JToken token = value as JToken;\n            if (token == null)\n                throw new ArgumentException(\"Value is not a JToken.\", \"value\");\n\n            return _serializer.Deserialize(token.CreateReader(), type);\n        }\n\n        public object Convert(object value, TypeCode typeCode)\n        {\n            ValidationUtils.ArgumentNotNull(value, \"value\");\n\n            if (value is JValue)\n                value = ((JValue)value).Value;\n\n            return System.Convert.ChangeType(value, typeCode, CultureInfo.InvariantCulture);\n        }\n\n        public bool ToBoolean(object value)\n        {\n            return GetTokenValue<bool>(value);\n        }\n\n        public byte ToByte(object value)\n        {\n            return GetTokenValue<byte>(value);\n        }\n\n        public char ToChar(object value)\n        {\n            return GetTokenValue<char>(value);\n        }\n\n        public DateTime ToDateTime(object value)\n        {\n            return GetTokenValue<DateTime>(value);\n        }\n\n        public decimal ToDecimal(object value)\n        {\n            return GetTokenValue<decimal>(value);\n        }\n\n        public double ToDouble(object value)\n        {\n            return GetTokenValue<double>(value);\n        }\n\n        public short ToInt16(object value)\n        {\n            return GetTokenValue<short>(value);\n        }\n\n        public int ToInt32(object value)\n        {\n            return GetTokenValue<int>(value);\n        }\n\n        public long ToInt64(object value)\n        {\n            return GetTokenValue<long>(value);\n        }\n\n        public sbyte ToSByte(object value)\n        {\n            return GetTokenValue<sbyte>(value);\n        }\n\n        public float ToSingle(object value)\n        {\n            return GetTokenValue<float>(value);\n        }\n\n        public string ToString(object value)\n        {\n            return GetTokenValue<string>(value);\n        }\n\n        public ushort ToUInt16(object value)\n        {\n            return GetTokenValue<ushort>(value);\n        }\n\n        public uint ToUInt32(object value)\n        {\n            return GetTokenValue<uint>(value);\n        }\n\n        public ulong ToUInt64(object value)\n        {\n            return GetTokenValue<ulong>(value);\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonISerializableContract.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\nusing System;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Contract details for a <see cref=\"Type\"/> used by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public class JsonISerializableContract : JsonContainerContract\n    {\n        /// <summary>\n        /// Gets or sets the ISerializable object constructor.\n        /// </summary>\n        /// <value>The ISerializable object constructor.</value>\n        public ObjectConstructor<object> ISerializableCreator { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonISerializableContract\"/> class.\n        /// </summary>\n        /// <param name=\"underlyingType\">The underlying type for the contract.</param>\n        public JsonISerializableContract(Type underlyingType)\n            : base(underlyingType)\n        {\n            ContractType = JsonContractType.Serializable;\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonLinqContract.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Contract details for a <see cref=\"Type\"/> used by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public class JsonLinqContract : JsonContract\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonLinqContract\"/> class.\n        /// </summary>\n        /// <param name=\"underlyingType\">The underlying type for the contract.</param>\n        public JsonLinqContract(Type underlyingType)\n            : base(underlyingType)\n        {\n            ContractType = JsonContractType.Linq;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonObjectContract.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Globalization;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing System.Security;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Contract details for a <see cref=\"Type\"/> used by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public class JsonObjectContract : JsonContainerContract\n    {\n        /// <summary>\n        /// Gets or sets the object member serialization.\n        /// </summary>\n        /// <value>The member object serialization.</value>\n        public MemberSerialization MemberSerialization { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value that indicates whether the object's properties are required.\n        /// </summary>\n        /// <value>\n        /// \tA value indicating whether the object's properties are required.\n        /// </value>\n        public Required? ItemRequired { get; set; }\n\n        /// <summary>\n        /// Gets the object's properties.\n        /// </summary>\n        /// <value>The object's properties.</value>\n        public JsonPropertyCollection Properties { get; private set; }\n\n        /// <summary>\n        /// Gets the constructor parameters required for any non-default constructor\n        /// </summary>\n        public JsonPropertyCollection ConstructorParameters { get; private set; }\n\n        /// <summary>\n        /// Gets or sets the override constructor used to create the object.\n        /// This is set when a constructor is marked up using the\n        /// JsonConstructor attribute.\n        /// </summary>\n        /// <value>The override constructor.</value>\n        public ConstructorInfo OverrideConstructor { get; set; }\n\n        /// <summary>\n        /// Gets or sets the parametrized constructor used to create the object.\n        /// </summary>\n        /// <value>The parametrized constructor.</value>\n        public ConstructorInfo ParametrizedConstructor { get; set; }\n\n        /// <summary>\n        /// Gets or sets the extension data setter.\n        /// </summary>\n        public ExtensionDataSetter ExtensionDataSetter { get; set; }\n\n        /// <summary>\n        /// Gets or sets the extension data getter.\n        /// </summary>\n        public ExtensionDataGetter ExtensionDataGetter { get; set; }\n\n        private bool? _hasRequiredOrDefaultValueProperties;\n\n        internal bool HasRequiredOrDefaultValueProperties\n        {\n            get\n            {\n                if (_hasRequiredOrDefaultValueProperties == null)\n                {\n                    _hasRequiredOrDefaultValueProperties = false;\n\n                    if (ItemRequired.GetValueOrDefault(Required.Default) != Required.Default)\n                    {\n                        _hasRequiredOrDefaultValueProperties = true;\n                    }\n                    else\n                    {\n                        foreach (JsonProperty property in Properties)\n                        {\n                            if (property.Required != Required.Default || ((property.DefaultValueHandling & DefaultValueHandling.Populate) == DefaultValueHandling.Populate) && property.Writable)\n                            {\n                                _hasRequiredOrDefaultValueProperties = true;\n                                break;\n                            }\n                        }\n                    }\n                }\n\n                return _hasRequiredOrDefaultValueProperties.Value;\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonObjectContract\"/> class.\n        /// </summary>\n        /// <param name=\"underlyingType\">The underlying type for the contract.</param>\n        public JsonObjectContract(Type underlyingType)\n            : base(underlyingType)\n        {\n            ContractType = JsonContractType.Object;\n\n            Properties = new JsonPropertyCollection(UnderlyingType);\n            ConstructorParameters = new JsonPropertyCollection(UnderlyingType);\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n#if !(NET20 || NET35)\n        [SecuritySafeCritical]\n#endif\n        internal object GetUninitializedObject()\n        {\n            // we should never get here if the environment is not fully trusted, check just in case\n            if (!JsonTypeReflector.FullyTrusted)\n                throw new JsonException(\"Insufficient permissions. Creating an uninitialized '{0}' type requires full trust.\".FormatWith(CultureInfo.InvariantCulture, NonNullableUnderlyingType));\n\n            return FormatterServices.GetUninitializedObject(NonNullableUnderlyingType);\n        }\n#endif\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonPrimitiveContract.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Contract details for a <see cref=\"Type\"/> used by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public class JsonPrimitiveContract : JsonContract\n    {\n        internal PrimitiveTypeCode TypeCode { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonPrimitiveContract\"/> class.\n        /// </summary>\n        /// <param name=\"underlyingType\">The underlying type for the contract.</param>\n        public JsonPrimitiveContract(Type underlyingType)\n            : base(underlyingType)\n        {\n            ContractType = JsonContractType.Primitive;\n\n            TypeCode = ConvertUtils.GetTypeCode(underlyingType);\n            IsReadOnlyOrFixedSize = true;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonProperty.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing Newtonsoft.Json.Utilities;\n\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#endif\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Maps a JSON property to a .NET member or constructor parameter.\n    /// </summary>\n    public class JsonProperty\n    {\n        internal Required? _required;\n        internal bool _hasExplicitDefaultValue;\n        internal object _defaultValue;\n\n        private string _propertyName;\n        private bool _skipPropertyNameEscape;\n\n        // use to cache contract during deserialization\n        internal JsonContract PropertyContract { get; set; }\n\n        /// <summary>\n        /// Gets or sets the name of the property.\n        /// </summary>\n        /// <value>The name of the property.</value>\n        public string PropertyName\n        {\n            get { return _propertyName; }\n            set\n            {\n                _propertyName = value;\n                CalculateSkipPropertyNameEscape();\n            }\n        }\n\n        private void CalculateSkipPropertyNameEscape()\n        {\n            if (_propertyName == null)\n            {\n                _skipPropertyNameEscape = false;\n            }\n            else\n            {\n                _skipPropertyNameEscape = true;\n                foreach (char c in _propertyName)\n                {\n                    if (!char.IsLetterOrDigit(c) && c != '_' && c != '@')\n                    {\n                        _skipPropertyNameEscape = false;\n                        break;\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the type that declared this property.\n        /// </summary>\n        /// <value>The type that declared this property.</value>\n        public Type DeclaringType { get; set; }\n\n        /// <summary>\n        /// Gets or sets the order of serialization and deserialization of a member.\n        /// </summary>\n        /// <value>The numeric order of serialization or deserialization.</value>\n        public int? Order { get; set; }\n\n        /// <summary>\n        /// Gets or sets the name of the underlying member or parameter.\n        /// </summary>\n        /// <value>The name of the underlying member or parameter.</value>\n        public string UnderlyingName { get; set; }\n\n        /// <summary>\n        /// Gets the <see cref=\"IValueProvider\"/> that will get and set the <see cref=\"JsonProperty\"/> during serialization.\n        /// </summary>\n        /// <value>The <see cref=\"IValueProvider\"/> that will get and set the <see cref=\"JsonProperty\"/> during serialization.</value>\n        public IValueProvider ValueProvider { get; set; }\n\n        /// <summary>\n        /// Gets or sets the type of the property.\n        /// </summary>\n        /// <value>The type of the property.</value>\n        public Type PropertyType { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"JsonConverter\" /> for the property.\n        /// If set this converter takes presidence over the contract converter for the property type.\n        /// </summary>\n        /// <value>The converter.</value>\n        public JsonConverter Converter { get; set; }\n\n        /// <summary>\n        /// Gets or sets the member converter.\n        /// </summary>\n        /// <value>The member converter.</value>\n        public JsonConverter MemberConverter { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether this <see cref=\"JsonProperty\"/> is ignored.\n        /// </summary>\n        /// <value><c>true</c> if ignored; otherwise, <c>false</c>.</value>\n        public bool Ignored { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether this <see cref=\"JsonProperty\"/> is readable.\n        /// </summary>\n        /// <value><c>true</c> if readable; otherwise, <c>false</c>.</value>\n        public bool Readable { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether this <see cref=\"JsonProperty\"/> is writable.\n        /// </summary>\n        /// <value><c>true</c> if writable; otherwise, <c>false</c>.</value>\n        public bool Writable { get; set; }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether this <see cref=\"JsonProperty\"/> has a member attribute.\n        /// </summary>\n        /// <value><c>true</c> if has a member attribute; otherwise, <c>false</c>.</value>\n        public bool HasMemberAttribute { get; set; }\n\n        /// <summary>\n        /// Gets the default value.\n        /// </summary>\n        /// <value>The default value.</value>\n        public object DefaultValue\n        {\n            get { return _defaultValue; }\n            set\n            {\n                _hasExplicitDefaultValue = true;\n                _defaultValue = value;\n            }\n        }\n\n        internal object GetResolvedDefaultValue()\n        {\n            if (!_hasExplicitDefaultValue && PropertyType != null)\n                return ReflectionUtils.GetDefaultValue(PropertyType);\n\n            return _defaultValue;\n        }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether this <see cref=\"JsonProperty\"/> is required.\n        /// </summary>\n        /// <value>A value indicating whether this <see cref=\"JsonProperty\"/> is required.</value>\n        public Required Required\n        {\n            get { return _required ?? Required.Default; }\n            set { _required = value; }\n        }\n\n        /// <summary>\n        /// Gets or sets a value indicating whether this property preserves object references.\n        /// </summary>\n        /// <value>\n        /// \t<c>true</c> if this instance is reference; otherwise, <c>false</c>.\n        /// </value>\n        public bool? IsReference { get; set; }\n\n        /// <summary>\n        /// Gets or sets the property null value handling.\n        /// </summary>\n        /// <value>The null value handling.</value>\n        public NullValueHandling? NullValueHandling { get; set; }\n\n        /// <summary>\n        /// Gets or sets the property default value handling.\n        /// </summary>\n        /// <value>The default value handling.</value>\n        public DefaultValueHandling? DefaultValueHandling { get; set; }\n\n        /// <summary>\n        /// Gets or sets the property reference loop handling.\n        /// </summary>\n        /// <value>The reference loop handling.</value>\n        public ReferenceLoopHandling? ReferenceLoopHandling { get; set; }\n\n        /// <summary>\n        /// Gets or sets the property object creation handling.\n        /// </summary>\n        /// <value>The object creation handling.</value>\n        public ObjectCreationHandling? ObjectCreationHandling { get; set; }\n\n        /// <summary>\n        /// Gets or sets or sets the type name handling.\n        /// </summary>\n        /// <value>The type name handling.</value>\n        public TypeNameHandling? TypeNameHandling { get; set; }\n\n        /// <summary>\n        /// Gets or sets a predicate used to determine whether the property should be serialize.\n        /// </summary>\n        /// <value>A predicate used to determine whether the property should be serialize.</value>\n        public Predicate<object> ShouldSerialize { get; set; }\n\n        /// <summary>\n        /// Gets or sets a predicate used to determine whether the property should be serialized.\n        /// </summary>\n        /// <value>A predicate used to determine whether the property should be serialized.</value>\n        public Predicate<object> GetIsSpecified { get; set; }\n\n        /// <summary>\n        /// Gets or sets an action used to set whether the property has been deserialized.\n        /// </summary>\n        /// <value>An action used to set whether the property has been deserialized.</value>\n        public Action<object, object> SetIsSpecified { get; set; }\n\n        /// <summary>\n        /// Returns a <see cref=\"String\"/> that represents this instance.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"String\"/> that represents this instance.\n        /// </returns>\n        public override string ToString()\n        {\n            return PropertyName;\n        }\n\n        /// <summary>\n        /// Gets or sets the converter used when serializing the property's collection items.\n        /// </summary>\n        /// <value>The collection's items converter.</value>\n        public JsonConverter ItemConverter { get; set; }\n\n        /// <summary>\n        /// Gets or sets whether this property's collection items are serialized as a reference.\n        /// </summary>\n        /// <value>Whether this property's collection items are serialized as a reference.</value>\n        public bool? ItemIsReference { get; set; }\n\n        /// <summary>\n        /// Gets or sets the the type name handling used when serializing the property's collection items.\n        /// </summary>\n        /// <value>The collection's items type name handling.</value>\n        public TypeNameHandling? ItemTypeNameHandling { get; set; }\n\n        /// <summary>\n        /// Gets or sets the the reference loop handling used when serializing the property's collection items.\n        /// </summary>\n        /// <value>The collection's items reference loop handling.</value>\n        public ReferenceLoopHandling? ItemReferenceLoopHandling { get; set; }\n\n        internal void WritePropertyName(JsonWriter writer)\n        {\n            if (_skipPropertyNameEscape)\n                writer.WritePropertyName(PropertyName, false);\n            else\n                writer.WritePropertyName(PropertyName);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonPropertyCollection.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Collections.ObjectModel;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// A collection of <see cref=\"JsonProperty\"/> objects.\n    /// </summary>\n    public class JsonPropertyCollection : KeyedCollection<string, JsonProperty>\n    {\n        private readonly Type _type;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonPropertyCollection\"/> class.\n        /// </summary>\n        /// <param name=\"type\">The type.</param>\n        public JsonPropertyCollection(Type type)\n            : base(StringComparer.Ordinal)\n        {\n            ValidationUtils.ArgumentNotNull(type, \"type\");\n            _type = type;\n        }\n\n        /// <summary>\n        /// When implemented in a derived class, extracts the key from the specified element.\n        /// </summary>\n        /// <param name=\"item\">The element from which to extract the key.</param>\n        /// <returns>The key for the specified element.</returns>\n        protected override string GetKeyForItem(JsonProperty item)\n        {\n            return item.PropertyName;\n        }\n\n        /// <summary>\n        /// Adds a <see cref=\"JsonProperty\"/> object.\n        /// </summary>\n        /// <param name=\"property\">The property to add to the collection.</param>\n        public void AddProperty(JsonProperty property)\n        {\n            if (Contains(property.PropertyName))\n            {\n                // don't overwrite existing property with ignored property\n                if (property.Ignored)\n                    return;\n\n                JsonProperty existingProperty = this[property.PropertyName];\n                bool duplicateProperty = true;\n\n                if (existingProperty.Ignored)\n                {\n                    // remove ignored property so it can be replaced in collection\n                    Remove(existingProperty);\n                    duplicateProperty = false;\n                }\n                else\n                {\n                    if (property.DeclaringType != null && existingProperty.DeclaringType != null)\n                    {\n                        if (property.DeclaringType.IsSubclassOf(existingProperty.DeclaringType))\n                        {\n                            // current property is on a derived class and hides the existing\n                            Remove(existingProperty);\n                            duplicateProperty = false;\n                        }\n                        if (existingProperty.DeclaringType.IsSubclassOf(property.DeclaringType))\n                        {\n                            // current property is hidden by the existing so don't add it\n                            return;\n                        }\n                    }\n                }\n\n                if (duplicateProperty)\n                    throw new JsonSerializationException(\"A member with the name '{0}' already exists on '{1}'. Use the JsonPropertyAttribute to specify another name.\".FormatWith(CultureInfo.InvariantCulture, property.PropertyName, _type));\n            }\n\n            Add(property);\n        }\n\n        /// <summary>\n        /// Gets the closest matching <see cref=\"JsonProperty\"/> object.\n        /// First attempts to get an exact case match of propertyName and then\n        /// a case insensitive match.\n        /// </summary>\n        /// <param name=\"propertyName\">Name of the property.</param>\n        /// <returns>A matching property if found.</returns>\n        public JsonProperty GetClosestMatchProperty(string propertyName)\n        {\n            JsonProperty property = GetProperty(propertyName, StringComparison.Ordinal);\n            if (property == null)\n                property = GetProperty(propertyName, StringComparison.OrdinalIgnoreCase);\n\n            return property;\n        }\n\n        private bool TryGetValue(string key, out JsonProperty item)\n        {\n            if (Dictionary == null)\n            {\n                item = default(JsonProperty);\n                return false;\n            }\n\n            return Dictionary.TryGetValue(key, out item);\n        }\n\n        /// <summary>\n        /// Gets a property by property name.\n        /// </summary>\n        /// <param name=\"propertyName\">The name of the property to get.</param>\n        /// <param name=\"comparisonType\">Type property name string comparison.</param>\n        /// <returns>A matching property if found.</returns>\n        public JsonProperty GetProperty(string propertyName, StringComparison comparisonType)\n        {\n            // KeyedCollection has an ordinal comparer\n            if (comparisonType == StringComparison.Ordinal)\n            {\n                JsonProperty property;\n                if (TryGetValue(propertyName, out property))\n                    return property;\n\n                return null;\n            }\n\n            foreach (JsonProperty property in this)\n            {\n                if (string.Equals(propertyName, property.PropertyName, comparisonType))\n                {\n                    return property;\n                }\n            }\n\n            return null;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonSerializerInternalBase.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Net;\nusing System.Runtime.CompilerServices;\nusing Newtonsoft.Json.Utilities;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal abstract class JsonSerializerInternalBase\n    {\n        private class ReferenceEqualsEqualityComparer : IEqualityComparer<object>\n        {\n            bool IEqualityComparer<object>.Equals(object x, object y)\n            {\n                return ReferenceEquals(x, y);\n            }\n\n            int IEqualityComparer<object>.GetHashCode(object obj)\n            {\n#if !(NETFX_CORE)\n                // put objects in a bucket based on their reference\n                return RuntimeHelpers.GetHashCode(obj);\n#else\n    // put all objects in the same bucket so ReferenceEquals is called on all\n        return -1;\n#endif\n            }\n        }\n\n        private ErrorContext _currentErrorContext;\n        private BidirectionalDictionary<string, object> _mappings;\n        private bool _serializing;\n\n        internal readonly JsonSerializer Serializer;\n        internal readonly ITraceWriter TraceWriter;\n\n        protected JsonSerializerInternalBase(JsonSerializer serializer)\n        {\n            ValidationUtils.ArgumentNotNull(serializer, \"serializer\");\n\n            Serializer = serializer;\n            TraceWriter = serializer.TraceWriter;\n\n            // kind of a hack but meh. might clean this up later\n            _serializing = (GetType() == typeof(JsonSerializerInternalWriter));\n        }\n\n        internal BidirectionalDictionary<string, object> DefaultReferenceMappings\n        {\n            get\n            {\n                // override equality comparer for object key dictionary\n                // object will be modified as it deserializes and might have mutable hashcode\n                if (_mappings == null)\n                    _mappings = new BidirectionalDictionary<string, object>(\n                        EqualityComparer<string>.Default,\n                        new ReferenceEqualsEqualityComparer(),\n                        \"A different value already has the Id '{0}'.\",\n                        \"A different Id has already been assigned for value '{0}'.\");\n\n                return _mappings;\n            }\n        }\n\n        private ErrorContext GetErrorContext(object currentObject, object member, string path, Exception error)\n        {\n            if (_currentErrorContext == null)\n                _currentErrorContext = new ErrorContext(currentObject, member, path, error);\n\n            if (_currentErrorContext.Error != error)\n                throw new InvalidOperationException(\"Current error context error is different to requested error.\");\n\n            return _currentErrorContext;\n        }\n\n        protected void ClearErrorContext()\n        {\n            if (_currentErrorContext == null)\n                throw new InvalidOperationException(\"Could not clear error context. Error context is already null.\");\n\n            _currentErrorContext = null;\n        }\n\n        protected bool IsErrorHandled(object currentObject, JsonContract contract, object keyValue, IJsonLineInfo lineInfo, string path, Exception ex)\n        {\n            ErrorContext errorContext = GetErrorContext(currentObject, keyValue, path, ex);\n\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Error && !errorContext.Traced)\n            {\n                // only write error once\n                errorContext.Traced = true;\n\n                string message = (_serializing) ? \"Error serializing\" : \"Error deserializing\";\n                if (contract != null)\n                    message += \" \" + contract.UnderlyingType;\n                message += \". \" + ex.Message;\n\n                // add line information to non-json.net exception message\n                if (!(ex is JsonException))\n                    message = JsonPosition.FormatMessage(lineInfo, path, message);\n\n                TraceWriter.Trace(TraceLevel.Error, message, ex);\n            }\n\n            // attribute method is non-static so don't invoke if no object\n            if (contract != null && currentObject != null)\n                contract.InvokeOnError(currentObject, Serializer.Context, errorContext);\n\n            if (!errorContext.Handled)\n                Serializer.OnError(new ErrorEventArgs(currentObject, errorContext));\n\n            return errorContext.Handled;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n#if !(NET35 || NET20 || PORTABLE40)\nusing System.ComponentModel;\nusing System.Dynamic;\n#endif\nusing System.Diagnostics;\nusing System.Globalization;\n#if !(PORTABLE || PORTABLE40 || NET35 || NET20)\nusing System.Numerics;\n#endif\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Utilities;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal class JsonSerializerInternalReader : JsonSerializerInternalBase\n    {\n        internal enum PropertyPresence\n        {\n            None,\n            Null,\n            Value\n        }\n\n        private JsonSerializerProxy _internalSerializer;\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        private JsonFormatterConverter _formatterConverter;\n#endif\n\n        public JsonSerializerInternalReader(JsonSerializer serializer)\n            : base(serializer)\n        {\n        }\n\n        public void Populate(JsonReader reader, object target)\n        {\n            ValidationUtils.ArgumentNotNull(target, \"target\");\n\n            Type objectType = target.GetType();\n\n            JsonContract contract = Serializer._contractResolver.ResolveContract(objectType);\n\n            if (reader.TokenType == JsonToken.None)\n                reader.Read();\n\n            if (reader.TokenType == JsonToken.StartArray)\n            {\n                if (contract.ContractType == JsonContractType.Array)\n                {\n                    JsonArrayContract arrayContract = (JsonArrayContract)contract;\n\n                    PopulateList((arrayContract.ShouldCreateWrapper) ? arrayContract.CreateWrapper(target) : (IList)target, reader, arrayContract, null, null);\n                }\n                else\n                {\n                    throw JsonSerializationException.Create(reader, \"Cannot populate JSON array onto type '{0}'.\".FormatWith(CultureInfo.InvariantCulture, objectType));\n                }\n            }\n            else if (reader.TokenType == JsonToken.StartObject)\n            {\n                CheckedRead(reader);\n\n                string id = null;\n                if (reader.TokenType == JsonToken.PropertyName && string.Equals(reader.Value.ToString(), JsonTypeReflector.IdPropertyName, StringComparison.Ordinal))\n                {\n                    CheckedRead(reader);\n                    id = (reader.Value != null) ? reader.Value.ToString() : null;\n                    CheckedRead(reader);\n                }\n\n                if (contract.ContractType == JsonContractType.Dictionary)\n                {\n                    JsonDictionaryContract dictionaryContract = (JsonDictionaryContract)contract;\n                    PopulateDictionary((dictionaryContract.ShouldCreateWrapper) ? dictionaryContract.CreateWrapper(target) : (IDictionary)target, reader, dictionaryContract, null, id);\n                }\n                else if (contract.ContractType == JsonContractType.Object)\n                {\n                    PopulateObject(target, reader, (JsonObjectContract)contract, null, id);\n                }\n                else\n                {\n                    throw JsonSerializationException.Create(reader, \"Cannot populate JSON object onto type '{0}'.\".FormatWith(CultureInfo.InvariantCulture, objectType));\n                }\n            }\n            else\n            {\n                throw JsonSerializationException.Create(reader, \"Unexpected initial token '{0}' when populating object. Expected JSON object or array.\".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));\n            }\n        }\n\n        private JsonContract GetContractSafe(Type type)\n        {\n            if (type == null)\n                return null;\n\n            return Serializer._contractResolver.ResolveContract(type);\n        }\n\n        public object Deserialize(JsonReader reader, Type objectType, bool checkAdditionalContent)\n        {\n            if (reader == null)\n                throw new ArgumentNullException(\"reader\");\n\n            JsonContract contract = GetContractSafe(objectType);\n\n            try\n            {\n                JsonConverter converter = GetConverter(contract, null, null, null);\n\n                if (reader.TokenType == JsonToken.None && !ReadForType(reader, contract, converter != null))\n                {\n                    if (contract != null && !contract.IsNullable)\n                        throw JsonSerializationException.Create(reader, \"No JSON content found and type '{0}' is not nullable.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n\n                    return null;\n                }\n\n                object deserializedValue;\n\n                if (converter != null && converter.CanRead)\n                    deserializedValue = DeserializeConvertable(converter, reader, objectType, null);\n                else\n                    deserializedValue = CreateValueInternal(reader, objectType, contract, null, null, null, null);\n\n                if (checkAdditionalContent)\n                {\n                    if (reader.Read() && reader.TokenType != JsonToken.Comment)\n                        throw new JsonSerializationException(\"Additional text found in JSON string after finishing deserializing object.\");\n                }\n\n                return deserializedValue;\n            }\n            catch (Exception ex)\n            {\n                if (IsErrorHandled(null, contract, null, reader as IJsonLineInfo, reader.Path, ex))\n                {\n                    HandleError(reader, false, 0);\n                    return null;\n                }\n                else\n                {\n                    // clear context in case serializer is being used inside a converter\n                    // if the converter wraps the error then not clearing the context will cause this error:\n                    // \"Current error context error is different to requested error.\"\n                    ClearErrorContext();\n                    throw;\n                }\n            }\n        }\n\n        private JsonSerializerProxy GetInternalSerializer()\n        {\n            if (_internalSerializer == null)\n                _internalSerializer = new JsonSerializerProxy(this);\n\n            return _internalSerializer;\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        private JsonFormatterConverter GetFormatterConverter()\n        {\n            if (_formatterConverter == null)\n                _formatterConverter = new JsonFormatterConverter(GetInternalSerializer());\n\n            return _formatterConverter;\n        }\n#endif\n\n        private JToken CreateJToken(JsonReader reader, JsonContract contract)\n        {\n            ValidationUtils.ArgumentNotNull(reader, \"reader\");\n\n            if (contract != null && contract.UnderlyingType == typeof(JRaw))\n            {\n                return JRaw.Create(reader);\n            }\n            else\n            {\n                JToken token;\n                using (JTokenWriter writer = new JTokenWriter())\n                {\n                    writer.WriteToken(reader);\n                    token = writer.Token;\n                }\n\n                return token;\n            }\n        }\n\n        private JToken CreateJObject(JsonReader reader)\n        {\n            ValidationUtils.ArgumentNotNull(reader, \"reader\");\n\n            // this is needed because we've already read inside the object, looking for metadata properties\n            using (JTokenWriter writer = new JTokenWriter())\n            {\n                writer.WriteStartObject();\n\n                do\n                {\n                    if (reader.TokenType == JsonToken.PropertyName)\n                    {\n                        string propertyName = (string)reader.Value;\n                        if (!reader.Read())\n                            break;\n\n                        if (CheckPropertyName(reader, propertyName))\n                            continue;\n\n                        writer.WritePropertyName(propertyName);\n                        writer.WriteToken(reader, true, true);\n                    }\n                    else\n                    {\n                        writer.WriteEndObject();\n                        return writer.Token;\n                    }\n                } while (reader.Read());\n\n                throw JsonSerializationException.Create(reader, \"Unexpected end when deserializing object.\");\n            }\n        }\n\n        private object CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, object existingValue)\n        {\n            if (contract != null && contract.ContractType == JsonContractType.Linq)\n                return CreateJToken(reader, contract);\n\n            do\n            {\n                switch (reader.TokenType)\n                {\n                    // populate a typed object or generic dictionary/array\n                    // depending upon whether an objectType was supplied\n                    case JsonToken.StartObject:\n                        return CreateObject(reader, objectType, contract, member, containerContract, containerMember, existingValue);\n                    case JsonToken.StartArray:\n                        return CreateList(reader, objectType, contract, member, existingValue, null);\n                    case JsonToken.Integer:\n                    case JsonToken.Float:\n                    case JsonToken.Boolean:\n                    case JsonToken.Date:\n                    case JsonToken.Bytes:\n                        return EnsureType(reader, reader.Value, CultureInfo.InvariantCulture, contract, objectType);\n                    case JsonToken.String:\n                        string s = (string)reader.Value;\n\n                        // convert empty string to null automatically for nullable types\n                        if (string.IsNullOrEmpty(s) && objectType != typeof(string) && objectType != typeof(object) && contract != null && contract.IsNullable)\n                            return null;\n\n                        // string that needs to be returned as a byte array should be base 64 decoded\n                        if (objectType == typeof(byte[]))\n                            return Convert.FromBase64String(s);\n\n                        return EnsureType(reader, s, CultureInfo.InvariantCulture, contract, objectType);\n                    case JsonToken.StartConstructor:\n                        string constructorName = reader.Value.ToString();\n\n                        return EnsureType(reader, constructorName, CultureInfo.InvariantCulture, contract, objectType);\n                    case JsonToken.Null:\n                    case JsonToken.Undefined:\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n                        if (objectType == typeof(DBNull))\n                            return DBNull.Value;\n#endif\n\n                        return EnsureType(reader, reader.Value, CultureInfo.InvariantCulture, contract, objectType);\n                    case JsonToken.Raw:\n                        return new JRaw((string)reader.Value);\n                    case JsonToken.Comment:\n                        // ignore\n                        break;\n                    default:\n                        throw JsonSerializationException.Create(reader, \"Unexpected token while deserializing object: \" + reader.TokenType);\n                }\n            } while (reader.Read());\n\n            throw JsonSerializationException.Create(reader, \"Unexpected end when deserializing object.\");\n        }\n\n        internal string GetExpectedDescription(JsonContract contract)\n        {\n            switch (contract.ContractType)\n            {\n                case JsonContractType.Object:\n                case JsonContractType.Dictionary:\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n                case JsonContractType.Serializable:\n#endif\n#if !(NET35 || NET20 || PORTABLE40)\n                case JsonContractType.Dynamic:\n#endif\n                    return @\"JSON object (e.g. {\"\"name\"\":\"\"value\"\"})\";\n                case JsonContractType.Array:\n                    return @\"JSON array (e.g. [1,2,3])\";\n                case JsonContractType.Primitive:\n                    return @\"JSON primitive value (e.g. string, number, boolean, null)\";\n                case JsonContractType.String:\n                    return @\"JSON string value\";\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        private JsonConverter GetConverter(JsonContract contract, JsonConverter memberConverter, JsonContainerContract containerContract, JsonProperty containerProperty)\n        {\n            JsonConverter converter = null;\n            if (memberConverter != null)\n            {\n                // member attribute converter\n                converter = memberConverter;\n            }\n            else if (containerProperty != null && containerProperty.ItemConverter != null)\n            {\n                converter = containerProperty.ItemConverter;\n            }\n            else if (containerContract != null && containerContract.ItemConverter != null)\n            {\n                converter = containerContract.ItemConverter;\n            }\n            else if (contract != null)\n            {\n                JsonConverter matchingConverter;\n                if (contract.Converter != null)\n                    // class attribute converter\n                    converter = contract.Converter;\n                else if ((matchingConverter = Serializer.GetMatchingConverter(contract.UnderlyingType)) != null)\n                    // passed in converters\n                    converter = matchingConverter;\n                else if (contract.InternalConverter != null)\n                    // internally specified converter\n                    converter = contract.InternalConverter;\n            }\n            return converter;\n        }\n\n        private object CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, object existingValue)\n        {\n            string id;\n            object newValue;\n            Type resolvedObjectType = objectType;\n\n            if (Serializer.MetadataPropertyHandling == MetadataPropertyHandling.ReadAhead)\n            {\n                var tokenReader = reader as JTokenReader;\n                if (tokenReader == null)\n                {\n                    JToken t = JToken.ReadFrom(reader);\n                    tokenReader = (JTokenReader)t.CreateReader();\n\n                    // start\n                    CheckedRead(tokenReader);\n\n                    reader = tokenReader;\n                }\n\n                if (ReadMetadataPropertiesToken(tokenReader, ref resolvedObjectType, ref contract, member, containerContract, containerMember, existingValue, out newValue, out id))\n                    return newValue;\n            }\n            else\n            {\n                CheckedRead(reader);\n                if (ReadMetadataProperties(reader, ref resolvedObjectType, ref contract, member, containerContract, containerMember, existingValue, out newValue, out id))\n                    return newValue;\n            }\n\n            if (HasNoDefinedType(contract))\n                return CreateJObject(reader);\n\n            switch (contract.ContractType)\n            {\n                case JsonContractType.Object:\n                {\n                    bool createdFromNonDefaultConstructor = false;\n                    JsonObjectContract objectContract = (JsonObjectContract)contract;\n                    object targetObject;\n                    // check that if type name handling is being used that the existing value is compatible with the specified type\n                    if (existingValue != null && (resolvedObjectType == objectType || resolvedObjectType.IsAssignableFrom(existingValue.GetType())))\n                        targetObject = existingValue;\n                    else\n                        targetObject = CreateNewObject(reader, objectContract, member, containerMember, id, out createdFromNonDefaultConstructor);\n\n                    // don't populate if read from non-default constructor because the object has already been read\n                    if (createdFromNonDefaultConstructor)\n                        return targetObject;\n\n                    return PopulateObject(targetObject, reader, objectContract, member, id);\n                }\n                case JsonContractType.Primitive:\n                {\n                    JsonPrimitiveContract primitiveContract = (JsonPrimitiveContract)contract;\n                    // if the content is inside $value then read past it\n                    if (reader.TokenType == JsonToken.PropertyName && string.Equals(reader.Value.ToString(), JsonTypeReflector.ValuePropertyName, StringComparison.Ordinal))\n                    {\n                        CheckedRead(reader);\n\n                        // the token should not be an object because the $type value could have been included in the object\n                        // without needing the $value property\n                        if (reader.TokenType == JsonToken.StartObject)\n                            throw JsonSerializationException.Create(reader, \"Unexpected token when deserializing primitive value: \" + reader.TokenType);\n\n                        object value = CreateValueInternal(reader, resolvedObjectType, primitiveContract, member, null, null, existingValue);\n\n                        CheckedRead(reader);\n                        return value;\n                    }\n                    break;\n                }\n                case JsonContractType.Dictionary:\n                {\n                    JsonDictionaryContract dictionaryContract = (JsonDictionaryContract)contract;\n                    object targetDictionary;\n\n                    if (existingValue == null)\n                    {\n                        bool createdFromNonDefaultConstructor;\n                        IDictionary dictionary = CreateNewDictionary(reader, dictionaryContract, out createdFromNonDefaultConstructor);\n\n                        if (createdFromNonDefaultConstructor)\n                        {\n                            if (id != null)\n                                throw JsonSerializationException.Create(reader, \"Cannot preserve reference to readonly dictionary, or dictionary created from a non-default constructor: {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n\n                            if (contract.OnSerializingCallbacks.Count > 0)\n                                throw JsonSerializationException.Create(reader, \"Cannot call OnSerializing on readonly dictionary, or dictionary created from a non-default constructor: {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n\n                            if (contract.OnErrorCallbacks.Count > 0)\n                                throw JsonSerializationException.Create(reader, \"Cannot call OnError on readonly list, or dictionary created from a non-default constructor: {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n\n                            if (dictionaryContract.ParametrizedConstructor == null)\n                                throw JsonSerializationException.Create(reader, \"Cannot deserialize readonly or fixed size dictionary: {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n                        }\n\n                        PopulateDictionary(dictionary, reader, dictionaryContract, member, id);\n\n                        if (createdFromNonDefaultConstructor)\n                        {\n                            ConstructorInfo constructor = dictionaryContract.ParametrizedConstructor as ConstructorInfo;\n                            if (constructor != null)\n                                return constructor.Invoke(new object[] { dictionary });\n\n                            return dictionaryContract.ParametrizedConstructor.Invoke(null, new object[] { dictionary });\n                        }\n                        else if (dictionary is IWrappedDictionary)\n                        {\n                            return ((IWrappedDictionary)dictionary).UnderlyingDictionary;\n                        }\n\n                        targetDictionary = dictionary;\n                    }\n                    else\n                    {\n                        targetDictionary = PopulateDictionary(dictionaryContract.ShouldCreateWrapper ? dictionaryContract.CreateWrapper(existingValue) : (IDictionary)existingValue, reader, dictionaryContract, member, id);\n                    }\n\n                    return targetDictionary;\n                }\n#if !(NET35 || NET20 || PORTABLE40)\n                case JsonContractType.Dynamic:\n                    JsonDynamicContract dynamicContract = (JsonDynamicContract)contract;\n                    return CreateDynamic(reader, dynamicContract, member, id);\n#endif\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n                case JsonContractType.Serializable:\n                    JsonISerializableContract serializableContract = (JsonISerializableContract)contract;\n                    return CreateISerializable(reader, serializableContract, member, id);\n#endif\n            }\n\n            throw JsonSerializationException.Create(reader, @\"Cannot deserialize the current JSON object (e.g. {{\"\"name\"\":\"\"value\"\"}}) into type '{0}' because the type requires a {1} to deserialize correctly.\nTo fix this error either change the JSON to a {1} or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.\n\".FormatWith(CultureInfo.InvariantCulture, resolvedObjectType, GetExpectedDescription(contract)));\n        }\n\n        private bool ReadMetadataPropertiesToken(JTokenReader reader, ref Type objectType, ref JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, object existingValue, out object newValue, out string id)\n        {\n            id = null;\n            newValue = null;\n\n            if (reader.TokenType == JsonToken.StartObject)\n            {\n                JObject current = (JObject)reader._current;\n\n                JToken refToken = current[JsonTypeReflector.RefPropertyName];\n                if (refToken != null)\n                {\n                    if (refToken.Type != JTokenType.String && refToken.Type != JTokenType.Null)\n                        throw JsonSerializationException.Create(refToken, refToken.Path, \"JSON reference {0} property must have a string or null value.\".FormatWith(CultureInfo.InvariantCulture, JsonTypeReflector.RefPropertyName), null);\n\n                    JToken property = refToken.Parent;\n                    JToken additionalContent = null;\n                    if (property.Next != null)\n                        additionalContent = property.Next;\n                    else if (property.Previous != null)\n                        additionalContent = property.Previous;\n\n                    string reference = (string)refToken;\n\n                    if (reference != null)\n                    {\n                        if (additionalContent != null)\n                            throw JsonSerializationException.Create(additionalContent, additionalContent.Path, \"Additional content found in JSON reference object. A JSON reference object should only have a {0} property.\".FormatWith(CultureInfo.InvariantCulture, JsonTypeReflector.RefPropertyName), null);\n\n                        newValue = Serializer.GetReferenceResolver().ResolveReference(this, reference);\n\n                        if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                            TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Resolved object reference '{0}' to {1}.\".FormatWith(CultureInfo.InvariantCulture, reference, newValue.GetType())), null);\n\n                        reader.Skip();\n                        return true;\n                    }\n                }\n                JToken typeToken = current[JsonTypeReflector.TypePropertyName];\n                if (typeToken != null)\n                {\n                    string qualifiedTypeName = (string)typeToken;\n                    JsonReader typeTokenReader = typeToken.CreateReader();\n                    CheckedRead(typeTokenReader);\n                    ResolveTypeName(typeTokenReader, ref objectType, ref contract, member, containerContract, containerMember, qualifiedTypeName);\n\n                    JToken valueToken = current[JsonTypeReflector.ValuePropertyName];\n                    if (valueToken != null)\n                    {\n                        while (true)\n                        {\n                            CheckedRead(reader);\n                            if (reader.TokenType == JsonToken.PropertyName)\n                            {\n                                if ((string)reader.Value == JsonTypeReflector.ValuePropertyName)\n                                    return false;\n                            }\n\n                            CheckedRead(reader);\n                            reader.Skip();\n                        }\n                    }\n                }\n                JToken idToken = current[JsonTypeReflector.IdPropertyName];\n                if (idToken != null)\n                {\n                    id = (string)idToken;\n                }\n                JToken valuesToken = current[JsonTypeReflector.ArrayValuesPropertyName];\n                if (valuesToken != null)\n                {\n                    JsonReader listReader = valuesToken.CreateReader();\n                    CheckedRead(listReader);\n                    newValue = CreateList(listReader, objectType, contract, member, existingValue, id);\n\n                    reader.Skip();\n                    return true;\n                }\n            }\n\n            CheckedRead(reader);\n            return false;\n        }\n\n        private bool ReadMetadataProperties(JsonReader reader, ref Type objectType, ref JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, object existingValue, out object newValue, out string id)\n        {\n            id = null;\n            newValue = null;\n\n            if (reader.TokenType == JsonToken.PropertyName)\n            {\n                string propertyName = reader.Value.ToString();\n\n                if (propertyName.Length > 0 && propertyName[0] == '$')\n                {\n                    // read metadata properties\n                    // $type, $id, $ref, etc\n                    bool metadataProperty;\n\n                    do\n                    {\n                        propertyName = reader.Value.ToString();\n\n                        if (string.Equals(propertyName, JsonTypeReflector.RefPropertyName, StringComparison.Ordinal))\n                        {\n                            CheckedRead(reader);\n                            if (reader.TokenType != JsonToken.String && reader.TokenType != JsonToken.Null)\n                                throw JsonSerializationException.Create(reader, \"JSON reference {0} property must have a string or null value.\".FormatWith(CultureInfo.InvariantCulture, JsonTypeReflector.RefPropertyName));\n\n                            string reference = (reader.Value != null) ? reader.Value.ToString() : null;\n\n                            CheckedRead(reader);\n\n                            if (reference != null)\n                            {\n                                if (reader.TokenType == JsonToken.PropertyName)\n                                    throw JsonSerializationException.Create(reader, \"Additional content found in JSON reference object. A JSON reference object should only have a {0} property.\".FormatWith(CultureInfo.InvariantCulture, JsonTypeReflector.RefPropertyName));\n\n                                newValue = Serializer.GetReferenceResolver().ResolveReference(this, reference);\n\n                                if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                                    TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Resolved object reference '{0}' to {1}.\".FormatWith(CultureInfo.InvariantCulture, reference, newValue.GetType())), null);\n\n                                return true;\n                            }\n                            else\n                            {\n                                metadataProperty = true;\n                            }\n                        }\n                        else if (string.Equals(propertyName, JsonTypeReflector.TypePropertyName, StringComparison.Ordinal))\n                        {\n                            CheckedRead(reader);\n                            string qualifiedTypeName = reader.Value.ToString();\n\n                            ResolveTypeName(reader, ref objectType, ref contract, member, containerContract, containerMember, qualifiedTypeName);\n\n                            CheckedRead(reader);\n\n                            metadataProperty = true;\n                        }\n                        else if (string.Equals(propertyName, JsonTypeReflector.IdPropertyName, StringComparison.Ordinal))\n                        {\n                            CheckedRead(reader);\n\n                            id = (reader.Value != null) ? reader.Value.ToString() : null;\n\n                            CheckedRead(reader);\n                            metadataProperty = true;\n                        }\n                        else if (string.Equals(propertyName, JsonTypeReflector.ArrayValuesPropertyName, StringComparison.Ordinal))\n                        {\n                            CheckedRead(reader);\n                            object list = CreateList(reader, objectType, contract, member, existingValue, id);\n                            CheckedRead(reader);\n                            newValue = list;\n                            return true;\n                        }\n                        else\n                        {\n                            metadataProperty = false;\n                        }\n                    } while (metadataProperty && reader.TokenType == JsonToken.PropertyName);\n                }\n            }\n            return false;\n        }\n\n        private void ResolveTypeName(JsonReader reader, ref Type objectType, ref JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, string qualifiedTypeName)\n        {\n            TypeNameHandling resolvedTypeNameHandling =\n                ((member != null) ? member.TypeNameHandling : null)\n                ?? ((containerContract != null) ? containerContract.ItemTypeNameHandling : null)\n                ?? ((containerMember != null) ? containerMember.ItemTypeNameHandling : null)\n                ?? Serializer._typeNameHandling;\n\n            if (resolvedTypeNameHandling != TypeNameHandling.None)\n            {\n                string typeName;\n                string assemblyName;\n                ReflectionUtils.SplitFullyQualifiedTypeName(qualifiedTypeName, out typeName, out assemblyName);\n\n                Type specifiedType;\n                try\n                {\n                    specifiedType = Serializer._binder.BindToType(assemblyName, typeName);\n                }\n                catch (Exception ex)\n                {\n                    throw JsonSerializationException.Create(reader, \"Error resolving type specified in JSON '{0}'.\".FormatWith(CultureInfo.InvariantCulture, qualifiedTypeName), ex);\n                }\n\n                if (specifiedType == null)\n                    throw JsonSerializationException.Create(reader, \"Type specified in JSON '{0}' was not resolved.\".FormatWith(CultureInfo.InvariantCulture, qualifiedTypeName));\n\n                if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                    TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Resolved type '{0}' to {1}.\".FormatWith(CultureInfo.InvariantCulture, qualifiedTypeName, specifiedType)), null);\n\n                if (objectType != null\n#if !(NET35 || NET20 || PORTABLE40)\n                    && objectType != typeof(IDynamicMetaObjectProvider)\n#endif\n                    && !objectType.IsAssignableFrom(specifiedType))\n                    throw JsonSerializationException.Create(reader, \"Type specified in JSON '{0}' is not compatible with '{1}'.\".FormatWith(CultureInfo.InvariantCulture, specifiedType.AssemblyQualifiedName, objectType.AssemblyQualifiedName));\n\n                objectType = specifiedType;\n                contract = GetContractSafe(specifiedType);\n            }\n        }\n\n        private JsonArrayContract EnsureArrayContract(JsonReader reader, Type objectType, JsonContract contract)\n        {\n            if (contract == null)\n                throw JsonSerializationException.Create(reader, \"Could not resolve type '{0}' to a JsonContract.\".FormatWith(CultureInfo.InvariantCulture, objectType));\n\n            JsonArrayContract arrayContract = contract as JsonArrayContract;\n            if (arrayContract == null)\n                throw JsonSerializationException.Create(reader, @\"Cannot deserialize the current JSON array (e.g. [1,2,3]) into type '{0}' because the type requires a {1} to deserialize correctly.\nTo fix this error either change the JSON to a {1} or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.\n\".FormatWith(CultureInfo.InvariantCulture, objectType, GetExpectedDescription(contract)));\n\n            return arrayContract;\n        }\n\n        private void CheckedRead(JsonReader reader)\n        {\n            if (!reader.Read())\n                throw JsonSerializationException.Create(reader, \"Unexpected end when deserializing object.\");\n        }\n\n        private object CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, object existingValue, string id)\n        {\n            object value;\n\n            if (HasNoDefinedType(contract))\n                return CreateJToken(reader, contract);\n\n            JsonArrayContract arrayContract = EnsureArrayContract(reader, objectType, contract);\n\n            if (existingValue == null)\n            {\n                bool createdFromNonDefaultConstructor;\n                IList list = CreateNewList(reader, arrayContract, out createdFromNonDefaultConstructor);\n\n                if (createdFromNonDefaultConstructor)\n                {\n                    if (id != null)\n                        throw JsonSerializationException.Create(reader, \"Cannot preserve reference to array or readonly list, or list created from a non-default constructor: {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n\n                    if (contract.OnSerializingCallbacks.Count > 0)\n                        throw JsonSerializationException.Create(reader, \"Cannot call OnSerializing on an array or readonly list, or list created from a non-default constructor: {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n\n                    if (contract.OnErrorCallbacks.Count > 0)\n                        throw JsonSerializationException.Create(reader, \"Cannot call OnError on an array or readonly list, or list created from a non-default constructor: {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n\n                    if (arrayContract.ParametrizedConstructor == null && !arrayContract.IsArray)\n                        throw JsonSerializationException.Create(reader, \"Cannot deserialize readonly or fixed size list: {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n                }\n\n                if (!arrayContract.IsMultidimensionalArray)\n                    PopulateList(list, reader, arrayContract, member, id);\n                else\n                    PopulateMultidimensionalArray(list, reader, arrayContract, member, id);\n\n                if (createdFromNonDefaultConstructor)\n                {\n                    if (arrayContract.IsMultidimensionalArray)\n                    {\n                        list = CollectionUtils.ToMultidimensionalArray(list, arrayContract.CollectionItemType, contract.CreatedType.GetArrayRank());\n                    }\n                    else if (arrayContract.IsArray)\n                    {\n                        Array a = Array.CreateInstance(arrayContract.CollectionItemType, list.Count);\n                        list.CopyTo(a, 0);\n                        list = a;\n                    }\n                    else\n                    {\n                        // call constructor that takes IEnumerable<T>\n                        ConstructorInfo constructor = arrayContract.ParametrizedConstructor as ConstructorInfo;\n                        if (constructor != null)\n                            return constructor.Invoke(new object[] { list });\n\n                        return arrayContract.ParametrizedConstructor.Invoke(null, new object[] { list });\n                    }\n                }\n                else if (list is IWrappedCollection)\n                {\n                    return ((IWrappedCollection)list).UnderlyingCollection;\n                }\n\n                value = list;\n            }\n            else\n            {\n                value = PopulateList((arrayContract.ShouldCreateWrapper) ? arrayContract.CreateWrapper(existingValue) : (IList)existingValue, reader, arrayContract, member, id);\n            }\n\n            return value;\n        }\n\n        private bool HasNoDefinedType(JsonContract contract)\n        {\n            return (contract == null || contract.UnderlyingType == typeof(object) || contract.ContractType == JsonContractType.Linq\n#if !(NET35 || NET20 || PORTABLE40)\n                    || contract.UnderlyingType == typeof(IDynamicMetaObjectProvider)\n#endif\n                );\n        }\n\n        private object EnsureType(JsonReader reader, object value, CultureInfo culture, JsonContract contract, Type targetType)\n        {\n            if (targetType == null)\n                return value;\n\n            Type valueType = ReflectionUtils.GetObjectType(value);\n\n            // type of value and type of target don't match\n            // attempt to convert value's type to target's type\n            if (valueType != targetType)\n            {\n                if (value == null && contract.IsNullable)\n                    return null;\n\n                try\n                {\n                    if (contract.IsConvertable)\n                    {\n                        JsonPrimitiveContract primitiveContract = (JsonPrimitiveContract)contract;\n\n                        if (contract.IsEnum)\n                        {\n                            if (value is string)\n                                return Enum.Parse(contract.NonNullableUnderlyingType, value.ToString(), true);\n                            else if (ConvertUtils.IsInteger(primitiveContract.TypeCode))\n                                return Enum.ToObject(contract.NonNullableUnderlyingType, value);\n                        }\n\n#if !(PORTABLE || PORTABLE40 || NET35 || NET20)\n                        if (value is BigInteger)\n                            return ConvertUtils.FromBigInteger((BigInteger)value, targetType);\n#endif\n\n                        // this won't work when converting to a custom IConvertible\n                        return Convert.ChangeType(value, contract.NonNullableUnderlyingType, culture);\n                    }\n\n                    return ConvertUtils.ConvertOrCast(value, culture, contract.NonNullableUnderlyingType);\n                }\n                catch (Exception ex)\n                {\n                    throw JsonSerializationException.Create(reader, \"Error converting value {0} to type '{1}'.\".FormatWith(CultureInfo.InvariantCulture, MiscellaneousUtils.FormatValueForPrint(value), targetType), ex);\n                }\n            }\n\n            return value;\n        }\n\n        private bool SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, object target)\n        {\n            object currentValue;\n            bool useExistingValue;\n            JsonContract propertyContract;\n            bool gottenCurrentValue;\n\n            if (CalculatePropertyDetails(property, ref propertyConverter, containerContract, containerProperty, reader, target, out useExistingValue, out currentValue, out propertyContract, out gottenCurrentValue))\n                return false;\n\n            object value;\n\n            if (propertyConverter != null && propertyConverter.CanRead)\n            {\n                if (!gottenCurrentValue && target != null && property.Readable)\n                    currentValue = property.ValueProvider.GetValue(target);\n\n                value = DeserializeConvertable(propertyConverter, reader, property.PropertyType, currentValue);\n            }\n            else\n            {\n                value = CreateValueInternal(reader, property.PropertyType, propertyContract, property, containerContract, containerProperty, (useExistingValue) ? currentValue : null);\n            }\n\n            // always set the value if useExistingValue is false,\n            // otherwise also set it if CreateValue returns a new value compared to the currentValue\n            // this could happen because of a JsonConverter against the type\n            if ((!useExistingValue || value != currentValue)\n                && ShouldSetPropertyValue(property, value))\n            {\n                property.ValueProvider.SetValue(target, value);\n\n                if (property.SetIsSpecified != null)\n                {\n                    if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                        TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"IsSpecified for property '{0}' on {1} set to true.\".FormatWith(CultureInfo.InvariantCulture, property.PropertyName, property.DeclaringType)), null);\n\n                    property.SetIsSpecified(target, true);\n                }\n\n                return true;\n            }\n\n            // the value wasn't set be JSON was populated onto the existing value\n            return useExistingValue;\n        }\n\n        private bool CalculatePropertyDetails(JsonProperty property, ref JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, object target, out bool useExistingValue, out object currentValue, out JsonContract propertyContract, out bool gottenCurrentValue)\n        {\n            currentValue = null;\n            useExistingValue = false;\n            propertyContract = null;\n            gottenCurrentValue = false;\n\n            if (property.Ignored)\n                return true;\n\n            JsonToken tokenType = reader.TokenType;\n\n            if (property.PropertyContract == null)\n                property.PropertyContract = GetContractSafe(property.PropertyType);\n\n            ObjectCreationHandling objectCreationHandling =\n                property.ObjectCreationHandling.GetValueOrDefault(Serializer._objectCreationHandling);\n\n            if ((objectCreationHandling != ObjectCreationHandling.Replace)\n                && (tokenType == JsonToken.StartArray || tokenType == JsonToken.StartObject)\n                && property.Readable)\n            {\n                currentValue = property.ValueProvider.GetValue(target);\n                gottenCurrentValue = true;\n\n                if (currentValue != null)\n                {\n                    propertyContract = GetContractSafe(currentValue.GetType());\n\n                    useExistingValue = (!propertyContract.IsReadOnlyOrFixedSize && !propertyContract.UnderlyingType.IsValueType());\n                }\n            }\n\n            if (!property.Writable && !useExistingValue)\n                return true;\n\n            // test tokentype here because null might not be convertable to some types, e.g. ignoring null when applied to DateTime\n            if (property.NullValueHandling.GetValueOrDefault(Serializer._nullValueHandling) == NullValueHandling.Ignore && tokenType == JsonToken.Null)\n                return true;\n\n            // test tokentype here because default value might not be convertable to actual type, e.g. default of \"\" for DateTime\n            if (HasFlag(property.DefaultValueHandling.GetValueOrDefault(Serializer._defaultValueHandling), DefaultValueHandling.Ignore)\n                && !HasFlag(property.DefaultValueHandling.GetValueOrDefault(Serializer._defaultValueHandling), DefaultValueHandling.Populate)\n                && JsonReader.IsPrimitiveToken(tokenType)\n                && MiscellaneousUtils.ValueEquals(reader.Value, property.GetResolvedDefaultValue()))\n                return true;\n\n            if (currentValue == null)\n            {\n                propertyContract = property.PropertyContract;\n            }\n            else\n            {\n                propertyContract = GetContractSafe(currentValue.GetType());\n\n                if (propertyContract != property.PropertyContract)\n                    propertyConverter = GetConverter(propertyContract, property.MemberConverter, containerContract, containerProperty);\n            }\n\n            return false;\n        }\n\n        private void AddReference(JsonReader reader, string id, object value)\n        {\n            try\n            {\n                if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                    TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Read object reference Id '{0}' for {1}.\".FormatWith(CultureInfo.InvariantCulture, id, value.GetType())), null);\n\n                Serializer.GetReferenceResolver().AddReference(this, id, value);\n            }\n            catch (Exception ex)\n            {\n                throw JsonSerializationException.Create(reader, \"Error reading object reference '{0}'.\".FormatWith(CultureInfo.InvariantCulture, id), ex);\n            }\n        }\n\n        private bool HasFlag(DefaultValueHandling value, DefaultValueHandling flag)\n        {\n            return ((value & flag) == flag);\n        }\n\n        private bool ShouldSetPropertyValue(JsonProperty property, object value)\n        {\n            if (property.NullValueHandling.GetValueOrDefault(Serializer._nullValueHandling) == NullValueHandling.Ignore && value == null)\n                return false;\n\n            if (HasFlag(property.DefaultValueHandling.GetValueOrDefault(Serializer._defaultValueHandling), DefaultValueHandling.Ignore)\n                && !HasFlag(property.DefaultValueHandling.GetValueOrDefault(Serializer._defaultValueHandling), DefaultValueHandling.Populate)\n                && MiscellaneousUtils.ValueEquals(value, property.GetResolvedDefaultValue()))\n                return false;\n\n            if (!property.Writable)\n                return false;\n\n            return true;\n        }\n\n        private IList CreateNewList(JsonReader reader, JsonArrayContract contract, out bool createdFromNonDefaultConstructor)\n        {\n            // some types like non-generic IEnumerable can be serialized but not deserialized\n            if (!contract.CanDeserialize)\n                throw JsonSerializationException.Create(reader, \"Cannot create and populate list type {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.CreatedType));\n\n            if (contract.IsReadOnlyOrFixedSize)\n            {\n                createdFromNonDefaultConstructor = true;\n                IList list = contract.CreateTemporaryCollection();\n\n                if (contract.ShouldCreateWrapper)\n                    list = contract.CreateWrapper(list);\n\n                return list;\n            }\n            else if (contract.DefaultCreator != null && (!contract.DefaultCreatorNonPublic || Serializer._constructorHandling == ConstructorHandling.AllowNonPublicDefaultConstructor))\n            {\n                object list = contract.DefaultCreator();\n\n                if (contract.ShouldCreateWrapper)\n                    list = contract.CreateWrapper(list);\n\n                createdFromNonDefaultConstructor = false;\n                return (IList)list;\n            }\n            else if (contract.ParametrizedConstructor != null)\n            {\n                createdFromNonDefaultConstructor = true;\n                return contract.CreateTemporaryCollection();\n            }\n            else\n            {\n                throw JsonSerializationException.Create(reader, \"Unable to find a constructor to use for type {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n            }\n        }\n\n        private IDictionary CreateNewDictionary(JsonReader reader, JsonDictionaryContract contract, out bool createdFromNonDefaultConstructor)\n        {\n            if (contract.IsReadOnlyOrFixedSize)\n            {\n                createdFromNonDefaultConstructor = true;\n                return contract.CreateTemporaryDictionary();\n            }\n            else if (contract.DefaultCreator != null && (!contract.DefaultCreatorNonPublic || Serializer._constructorHandling == ConstructorHandling.AllowNonPublicDefaultConstructor))\n            {\n                object dictionary = contract.DefaultCreator();\n\n                if (contract.ShouldCreateWrapper)\n                    dictionary = contract.CreateWrapper(dictionary);\n\n                createdFromNonDefaultConstructor = false;\n                return (IDictionary)dictionary;\n            }\n            else if (contract.ParametrizedConstructor != null)\n            {\n                createdFromNonDefaultConstructor = true;\n                return contract.CreateTemporaryDictionary();\n            }\n            else\n            {\n                throw JsonSerializationException.Create(reader, \"Unable to find a default constructor to use for type {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n            }\n        }\n\n        private void OnDeserializing(JsonReader reader, JsonContract contract, object value)\n        {\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Started deserializing {0}\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)), null);\n\n            contract.InvokeOnDeserializing(value, Serializer._context);\n        }\n\n        private void OnDeserialized(JsonReader reader, JsonContract contract, object value)\n        {\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Finished deserializing {0}\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)), null);\n\n            contract.InvokeOnDeserialized(value, Serializer._context);\n        }\n\n        private object PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, string id)\n        {\n            IWrappedDictionary wrappedDictionary = dictionary as IWrappedDictionary;\n            object underlyingDictionary = wrappedDictionary != null ? wrappedDictionary.UnderlyingDictionary : dictionary;\n\n            if (id != null)\n                AddReference(reader, id, underlyingDictionary);\n\n            OnDeserializing(reader, contract, underlyingDictionary);\n\n            int initialDepth = reader.Depth;\n\n            if (contract.KeyContract == null)\n                contract.KeyContract = GetContractSafe(contract.DictionaryKeyType);\n\n            if (contract.ItemContract == null)\n                contract.ItemContract = GetContractSafe(contract.DictionaryValueType);\n\n            JsonConverter dictionaryValueConverter = contract.ItemConverter ?? GetConverter(contract.ItemContract, null, contract, containerProperty);\n            PrimitiveTypeCode keyTypeCode = (contract.KeyContract is JsonPrimitiveContract) ? ((JsonPrimitiveContract)contract.KeyContract).TypeCode : PrimitiveTypeCode.Empty;\n\n            bool finished = false;\n            do\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.PropertyName:\n                        object keyValue = reader.Value;\n                        if (CheckPropertyName(reader, keyValue.ToString()))\n                            continue;\n\n                        try\n                        {\n                            try\n                            {\n                                DateParseHandling dateParseHandling;\n                                switch (keyTypeCode)\n                                {\n                                    case PrimitiveTypeCode.DateTime:\n                                    case PrimitiveTypeCode.DateTimeNullable:\n                                        dateParseHandling = DateParseHandling.DateTime;\n                                        break;\n#if !NET20\n                                    case PrimitiveTypeCode.DateTimeOffset:\n                                    case PrimitiveTypeCode.DateTimeOffsetNullable:\n                                        dateParseHandling = DateParseHandling.DateTimeOffset;\n                                        break;\n#endif\n                                    default:\n                                        dateParseHandling = DateParseHandling.None;\n                                        break;\n                                }\n\n                                // this is for correctly reading ISO and MS formatted dictionary keys\n                                object dt;\n                                if (dateParseHandling != DateParseHandling.None && DateTimeUtils.TryParseDateTime(keyValue.ToString(), dateParseHandling, reader.DateTimeZoneHandling, reader.DateFormatString, reader.Culture, out dt))\n                                    keyValue = dt;\n                                else\n                                    keyValue = EnsureType(reader, keyValue, CultureInfo.InvariantCulture, contract.KeyContract, contract.DictionaryKeyType);\n                            }\n                            catch (Exception ex)\n                            {\n                                throw JsonSerializationException.Create(reader, \"Could not convert string '{0}' to dictionary key type '{1}'. Create a TypeConverter to convert from the string to the key type object.\".FormatWith(CultureInfo.InvariantCulture, reader.Value, contract.DictionaryKeyType), ex);\n                            }\n\n                            if (!ReadForType(reader, contract.ItemContract, dictionaryValueConverter != null))\n                                throw JsonSerializationException.Create(reader, \"Unexpected end when deserializing object.\");\n\n                            object itemValue;\n                            if (dictionaryValueConverter != null && dictionaryValueConverter.CanRead)\n                                itemValue = DeserializeConvertable(dictionaryValueConverter, reader, contract.DictionaryValueType, null);\n                            else\n                                itemValue = CreateValueInternal(reader, contract.DictionaryValueType, contract.ItemContract, null, contract, containerProperty, null);\n\n                            dictionary[keyValue] = itemValue;\n                        }\n                        catch (Exception ex)\n                        {\n                            if (IsErrorHandled(underlyingDictionary, contract, keyValue, reader as IJsonLineInfo, reader.Path, ex))\n                                HandleError(reader, true, initialDepth);\n                            else\n                                throw;\n                        }\n                        break;\n                    case JsonToken.Comment:\n                        break;\n                    case JsonToken.EndObject:\n                        finished = true;\n                        break;\n                    default:\n                        throw JsonSerializationException.Create(reader, \"Unexpected token when deserializing object: \" + reader.TokenType);\n                }\n            } while (!finished && reader.Read());\n\n            if (!finished)\n                ThrowUnexpectedEndException(reader, contract, underlyingDictionary, \"Unexpected end when deserializing object.\");\n\n            OnDeserialized(reader, contract, underlyingDictionary);\n            return underlyingDictionary;\n        }\n\n        private object PopulateMultidimensionalArray(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, string id)\n        {\n            int rank = contract.UnderlyingType.GetArrayRank();\n\n            if (id != null)\n                AddReference(reader, id, list);\n\n            OnDeserializing(reader, contract, list);\n\n            JsonContract collectionItemContract = GetContractSafe(contract.CollectionItemType);\n            JsonConverter collectionItemConverter = GetConverter(collectionItemContract, null, contract, containerProperty);\n\n            int? previousErrorIndex = null;\n            Stack<IList> listStack = new Stack<IList>();\n            listStack.Push(list);\n            IList currentList = list;\n\n            bool finished = false;\n            do\n            {\n                int initialDepth = reader.Depth;\n\n                if (listStack.Count == rank)\n                {\n                    try\n                    {\n                        if (ReadForType(reader, collectionItemContract, collectionItemConverter != null))\n                        {\n                            switch (reader.TokenType)\n                            {\n                                case JsonToken.EndArray:\n                                    listStack.Pop();\n                                    currentList = listStack.Peek();\n                                    previousErrorIndex = null;\n                                    break;\n                                case JsonToken.Comment:\n                                    break;\n                                default:\n                                    object value;\n\n                                    if (collectionItemConverter != null && collectionItemConverter.CanRead)\n                                        value = DeserializeConvertable(collectionItemConverter, reader, contract.CollectionItemType, null);\n                                    else\n                                        value = CreateValueInternal(reader, contract.CollectionItemType, collectionItemContract, null, contract, containerProperty, null);\n\n                                    currentList.Add(value);\n                                    break;\n                            }\n                        }\n                        else\n                        {\n                            break;\n                        }\n                    }\n                    catch (Exception ex)\n                    {\n                        JsonPosition errorPosition = reader.GetPosition(initialDepth);\n\n                        if (IsErrorHandled(list, contract, errorPosition.Position, reader as IJsonLineInfo, reader.Path, ex))\n                        {\n                            HandleError(reader, true, initialDepth);\n\n                            if (previousErrorIndex != null && previousErrorIndex == errorPosition.Position)\n                            {\n                                // reader index has not moved since previous error handling\n                                // break out of reading array to prevent infinite loop\n                                throw JsonSerializationException.Create(reader, \"Infinite loop detected from error handling.\", ex);\n                            }\n                            else\n                            {\n                                previousErrorIndex = errorPosition.Position;\n                            }\n                        }\n                        else\n                        {\n                            throw;\n                        }\n                    }\n                }\n                else\n                {\n                    if (reader.Read())\n                    {\n                        switch (reader.TokenType)\n                        {\n                            case JsonToken.StartArray:\n                                IList newList = new List<object>();\n                                currentList.Add(newList);\n                                listStack.Push(newList);\n                                currentList = newList;\n                                break;\n                            case JsonToken.EndArray:\n                                listStack.Pop();\n\n                                if (listStack.Count > 0)\n                                {\n                                    currentList = listStack.Peek();\n                                }\n                                else\n                                {\n                                    finished = true;\n                                }\n                                break;\n                            case JsonToken.Comment:\n                                break;\n                            default:\n                                throw JsonSerializationException.Create(reader, \"Unexpected token when deserializing multidimensional array: \" + reader.TokenType);\n                        }\n                    }\n                    else\n                    {\n                        break;\n                    }\n                }\n            } while (!finished);\n\n            if (!finished)\n                ThrowUnexpectedEndException(reader, contract, list, \"Unexpected end when deserializing array.\");\n\n            OnDeserialized(reader, contract, list);\n            return list;\n        }\n\n        private void ThrowUnexpectedEndException(JsonReader reader, JsonContract contract, object currentObject, string message)\n        {\n            try\n            {\n                throw JsonSerializationException.Create(reader, message);\n            }\n            catch (Exception ex)\n            {\n                if (IsErrorHandled(currentObject, contract, null, reader as IJsonLineInfo, reader.Path, ex))\n                    HandleError(reader, false, 0);\n                else\n                    throw;\n            }\n        }\n\n        private object PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, string id)\n        {\n            IWrappedCollection wrappedCollection = list as IWrappedCollection;\n            object underlyingList = wrappedCollection != null ? wrappedCollection.UnderlyingCollection : list;\n\n            if (id != null)\n                AddReference(reader, id, underlyingList);\n\n            // can't populate an existing array\n            if (list.IsFixedSize)\n            {\n                reader.Skip();\n                return underlyingList;\n            }\n\n            OnDeserializing(reader, contract, underlyingList);\n\n            int initialDepth = reader.Depth;\n\n            if (contract.ItemContract == null)\n                contract.ItemContract = GetContractSafe(contract.CollectionItemType);\n\n            JsonConverter collectionItemConverter = GetConverter(contract.ItemContract, null, contract, containerProperty);\n\n            int? previousErrorIndex = null;\n\n            bool finished = false;\n            do\n            {\n                try\n                {\n                    if (ReadForType(reader, contract.ItemContract, collectionItemConverter != null))\n                    {\n                        switch (reader.TokenType)\n                        {\n                            case JsonToken.EndArray:\n                                finished = true;\n                                break;\n                            case JsonToken.Comment:\n                                break;\n                            default:\n                                object value;\n\n                                if (collectionItemConverter != null && collectionItemConverter.CanRead)\n                                    value = DeserializeConvertable(collectionItemConverter, reader, contract.CollectionItemType, null);\n                                else\n                                    value = CreateValueInternal(reader, contract.CollectionItemType, contract.ItemContract, null, contract, containerProperty, null);\n\n                                list.Add(value);\n                                break;\n                        }\n                    }\n                    else\n                    {\n                        break;\n                    }\n                }\n                catch (Exception ex)\n                {\n                    JsonPosition errorPosition = reader.GetPosition(initialDepth);\n\n                    if (IsErrorHandled(underlyingList, contract, errorPosition.Position, reader as IJsonLineInfo, reader.Path, ex))\n                    {\n                        HandleError(reader, true, initialDepth);\n\n                        if (previousErrorIndex != null && previousErrorIndex == errorPosition.Position)\n                        {\n                            // reader index has not moved since previous error handling\n                            // break out of reading array to prevent infinite loop\n                            throw JsonSerializationException.Create(reader, \"Infinite loop detected from error handling.\", ex);\n                        }\n                        else\n                        {\n                            previousErrorIndex = errorPosition.Position;\n                        }\n                    }\n                    else\n                    {\n                        throw;\n                    }\n                }\n            } while (!finished);\n\n            if (!finished)\n                ThrowUnexpectedEndException(reader, contract, underlyingList, \"Unexpected end when deserializing array.\");\n\n            OnDeserialized(reader, contract, underlyingList);\n            return underlyingList;\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        private object CreateISerializable(JsonReader reader, JsonISerializableContract contract, JsonProperty member, string id)\n        {\n            Type objectType = contract.UnderlyingType;\n\n            if (!JsonTypeReflector.FullyTrusted)\n            {\n                throw JsonSerializationException.Create(reader, @\"Type '{0}' implements ISerializable but cannot be deserialized using the ISerializable interface because the current application is not fully trusted and ISerializable can expose secure data.\nTo fix this error either change the environment to be fully trusted, change the application to not deserialize the type, add JsonObjectAttribute to the type or change the JsonSerializer setting ContractResolver to use a new DefaultContractResolver with IgnoreSerializableInterface set to true.\n\".FormatWith(CultureInfo.InvariantCulture, objectType));\n            }\n\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Deserializing {0} using ISerializable constructor.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)), null);\n\n            SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, GetFormatterConverter());\n\n            bool finished = false;\n            do\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.PropertyName:\n                        string memberName = reader.Value.ToString();\n                        if (!reader.Read())\n                            throw JsonSerializationException.Create(reader, \"Unexpected end when setting {0}'s value.\".FormatWith(CultureInfo.InvariantCulture, memberName));\n\n                        if (reader.TokenType == JsonToken.StartObject)\n                        {\n                            // this will read any potential type names embedded in json\n                            object o = CreateObject(reader, null, null, null, contract, member, null);\n                            serializationInfo.AddValue(memberName, o);\n                        }\n                        else\n                        {\n                            serializationInfo.AddValue(memberName, JToken.ReadFrom(reader));\n                        }\n                        break;\n                    case JsonToken.Comment:\n                        break;\n                    case JsonToken.EndObject:\n                        finished = true;\n                        break;\n                    default:\n                        throw JsonSerializationException.Create(reader, \"Unexpected token when deserializing object: \" + reader.TokenType);\n                }\n            } while (!finished && reader.Read());\n\n            if (!finished)\n                ThrowUnexpectedEndException(reader, contract, serializationInfo, \"Unexpected end when deserializing object.\");\n\n            if (contract.ISerializableCreator == null)\n                throw JsonSerializationException.Create(reader, \"ISerializable type '{0}' does not have a valid constructor. To correctly implement ISerializable a constructor that takes SerializationInfo and StreamingContext parameters should be present.\".FormatWith(CultureInfo.InvariantCulture, objectType));\n\n            object createdObject = contract.ISerializableCreator(serializationInfo, Serializer._context);\n\n            if (id != null)\n                AddReference(reader, id, createdObject);\n\n            // these are together because OnDeserializing takes an object but for an ISerializable the object is fully created in the constructor\n            OnDeserializing(reader, contract, createdObject);\n            OnDeserialized(reader, contract, createdObject);\n\n            return createdObject;\n        }\n#endif\n\n#if !(NET35 || NET20 || PORTABLE40)\n        private object CreateDynamic(JsonReader reader, JsonDynamicContract contract, JsonProperty member, string id)\n        {\n            IDynamicMetaObjectProvider newObject;\n\n            if (!contract.IsInstantiable)\n                throw JsonSerializationException.Create(reader, \"Could not create an instance of type {0}. Type is an interface or abstract class and cannot be instantiated.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n\n            if (contract.DefaultCreator != null &&\n                (!contract.DefaultCreatorNonPublic || Serializer._constructorHandling == ConstructorHandling.AllowNonPublicDefaultConstructor))\n                newObject = (IDynamicMetaObjectProvider)contract.DefaultCreator();\n            else\n                throw JsonSerializationException.Create(reader, \"Unable to find a default constructor to use for type {0}.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));\n\n            if (id != null)\n                AddReference(reader, id, newObject);\n\n            OnDeserializing(reader, contract, newObject);\n\n            int initialDepth = reader.Depth;\n\n            bool finished = false;\n            do\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.PropertyName:\n                        string memberName = reader.Value.ToString();\n\n                        try\n                        {\n                            if (!reader.Read())\n                                throw JsonSerializationException.Create(reader, \"Unexpected end when setting {0}'s value.\".FormatWith(CultureInfo.InvariantCulture, memberName));\n\n                            // first attempt to find a settable property, otherwise fall back to a dynamic set without type\n                            JsonProperty property = contract.Properties.GetClosestMatchProperty(memberName);\n\n                            if (property != null && property.Writable && !property.Ignored)\n                            {\n                                if (property.PropertyContract == null)\n                                    property.PropertyContract = GetContractSafe(property.PropertyType);\n\n                                JsonConverter propertyConverter = GetConverter(property.PropertyContract, property.MemberConverter, null, null);\n\n                                if (!SetPropertyValue(property, propertyConverter, null, member, reader, newObject))\n                                    reader.Skip();\n                            }\n                            else\n                            {\n                                Type t = (JsonReader.IsPrimitiveToken(reader.TokenType)) ? reader.ValueType : typeof(IDynamicMetaObjectProvider);\n\n                                JsonContract dynamicMemberContract = GetContractSafe(t);\n                                JsonConverter dynamicMemberConverter = GetConverter(dynamicMemberContract, null, null, member);\n\n                                object value;\n                                if (dynamicMemberConverter != null && dynamicMemberConverter.CanRead)\n                                    value = DeserializeConvertable(dynamicMemberConverter, reader, t, null);\n                                else\n                                    value = CreateValueInternal(reader, t, dynamicMemberContract, null, null, member, null);\n\n                                contract.TrySetMember(newObject, memberName, value);\n                            }\n                        }\n                        catch (Exception ex)\n                        {\n                            if (IsErrorHandled(newObject, contract, memberName, reader as IJsonLineInfo, reader.Path, ex))\n                                HandleError(reader, true, initialDepth);\n                            else\n                                throw;\n                        }\n                        break;\n                    case JsonToken.EndObject:\n                        finished = true;\n                        break;\n                    default:\n                        throw JsonSerializationException.Create(reader, \"Unexpected token when deserializing object: \" + reader.TokenType);\n                }\n            } while (!finished && reader.Read());\n\n            if (!finished)\n                ThrowUnexpectedEndException(reader, contract, newObject, \"Unexpected end when deserializing object.\");\n\n            OnDeserialized(reader, contract, newObject);\n\n            return newObject;\n        }\n#endif\n\n        private object CreateObjectFromNonDefaultConstructor(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ConstructorInfo constructorInfo, string id)\n        {\n            ValidationUtils.ArgumentNotNull(constructorInfo, \"constructorInfo\");\n\n            // only need to keep a track of properies presence if they are required or a value should be defaulted if missing\n            Dictionary<JsonProperty, PropertyPresence> propertiesPresence = (contract.HasRequiredOrDefaultValueProperties || HasFlag(Serializer._defaultValueHandling, DefaultValueHandling.Populate))\n                ? contract.Properties.ToDictionary(m => m, m => PropertyPresence.None)\n                : null;\n\n            Type objectType = contract.UnderlyingType;\n\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Deserializing {0} using a non-default constructor '{1}'.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType, constructorInfo)), null);\n\n            IDictionary<string, object> extensionData;\n            IDictionary<JsonProperty, object> propertyValues = ResolvePropertyAndConstructorValues(contract, containerProperty, reader, objectType, out extensionData);\n\n            IDictionary<ParameterInfo, object> constructorParameters = constructorInfo.GetParameters().ToDictionary(p => p, p => (object)null);\n            IDictionary<JsonProperty, object> remainingPropertyValues = new Dictionary<JsonProperty, object>();\n\n            foreach (KeyValuePair<JsonProperty, object> propertyValue in propertyValues)\n            {\n                ParameterInfo matchingConstructorParameter = constructorParameters.ForgivingCaseSensitiveFind(kv => kv.Key.Name, propertyValue.Key.UnderlyingName).Key;\n                if (matchingConstructorParameter != null)\n                    constructorParameters[matchingConstructorParameter] = propertyValue.Value;\n                else\n                    remainingPropertyValues.Add(propertyValue);\n\n                if (propertiesPresence != null)\n                {\n                    // map from constructor property to normal property\n                    var property = propertiesPresence.Keys.FirstOrDefault(p => p.PropertyName == propertyValue.Key.PropertyName);\n                    if (property != null)\n                        propertiesPresence[property] = (propertyValue.Value == null) ? PropertyPresence.Null : PropertyPresence.Value;\n                }\n            }\n\n            object createdObject = constructorInfo.Invoke(constructorParameters.Values.ToArray());\n\n            if (id != null)\n                AddReference(reader, id, createdObject);\n\n            OnDeserializing(reader, contract, createdObject);\n\n            // go through unused values and set the newly created object's properties\n            foreach (KeyValuePair<JsonProperty, object> remainingPropertyValue in remainingPropertyValues)\n            {\n                JsonProperty property = remainingPropertyValue.Key;\n                object value = remainingPropertyValue.Value;\n\n                if (ShouldSetPropertyValue(property, value))\n                {\n                    property.ValueProvider.SetValue(createdObject, value);\n                }\n                else if (!property.Writable && value != null)\n                {\n                    // handle readonly collection/dictionary properties\n                    JsonContract propertyContract = Serializer._contractResolver.ResolveContract(property.PropertyType);\n\n                    if (propertyContract.ContractType == JsonContractType.Array)\n                    {\n                        JsonArrayContract propertyArrayContract = (JsonArrayContract)propertyContract;\n\n                        object createdObjectCollection = property.ValueProvider.GetValue(createdObject);\n                        if (createdObjectCollection != null)\n                        {\n                            IWrappedCollection createdObjectCollectionWrapper = propertyArrayContract.CreateWrapper(createdObjectCollection);\n                            IWrappedCollection newValues = propertyArrayContract.CreateWrapper(value);\n\n                            foreach (object newValue in newValues)\n                            {\n                                createdObjectCollectionWrapper.Add(newValue);\n                            }\n                        }\n                    }\n                    else if (propertyContract.ContractType == JsonContractType.Dictionary)\n                    {\n                        JsonDictionaryContract dictionaryContract = (JsonDictionaryContract)propertyContract;\n\n                        object createdObjectDictionary = property.ValueProvider.GetValue(createdObject);\n                        if (createdObjectDictionary != null)\n                        {\n                            IDictionary targetDictionary = (dictionaryContract.ShouldCreateWrapper) ? dictionaryContract.CreateWrapper(createdObjectDictionary) : (IDictionary)createdObjectDictionary;\n                            IDictionary newValues = (dictionaryContract.ShouldCreateWrapper) ? dictionaryContract.CreateWrapper(value) : (IDictionary)value;\n\n                            foreach (DictionaryEntry newValue in newValues)\n                            {\n                                targetDictionary.Add(newValue.Key, newValue.Value);\n                            }\n                        }\n                    }\n                }\n            }\n\n            if (extensionData != null)\n            {\n                foreach (KeyValuePair<string, object> e in extensionData)\n                {\n                    contract.ExtensionDataSetter(createdObject, e.Key, e.Value);\n                }\n            }\n\n            EndObject(createdObject, reader, contract, reader.Depth, propertiesPresence);\n\n            OnDeserialized(reader, contract, createdObject);\n            return createdObject;\n        }\n\n        private object DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, object existingValue)\n        {\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Started deserializing {0} with converter {1}.\".FormatWith(CultureInfo.InvariantCulture, objectType, converter.GetType())), null);\n\n            object value = converter.ReadJson(reader, objectType, existingValue, GetInternalSerializer());\n\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Finished deserializing {0} with converter {1}.\".FormatWith(CultureInfo.InvariantCulture, objectType, converter.GetType())), null);\n\n            return value;\n        }\n\n        private IDictionary<JsonProperty, object> ResolvePropertyAndConstructorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType, out IDictionary<string, object> extensionData)\n        {\n            extensionData = (contract.ExtensionDataSetter != null) ? new Dictionary<string, object>() : null;\n\n            IDictionary<JsonProperty, object> propertyValues = new Dictionary<JsonProperty, object>();\n            bool exit = false;\n            do\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.PropertyName:\n                        string memberName = reader.Value.ToString();\n\n                        // attempt exact case match first\n                        // then try match ignoring case\n                        JsonProperty property = contract.ConstructorParameters.GetClosestMatchProperty(memberName) ??\n                                                contract.Properties.GetClosestMatchProperty(memberName);\n\n                        if (property != null)\n                        {\n                            if (property.PropertyContract == null)\n                                property.PropertyContract = GetContractSafe(property.PropertyType);\n\n                            JsonConverter propertyConverter = GetConverter(property.PropertyContract, property.MemberConverter, contract, containerProperty);\n\n                            if (!ReadForType(reader, property.PropertyContract, propertyConverter != null))\n                                throw JsonSerializationException.Create(reader, \"Unexpected end when setting {0}'s value.\".FormatWith(CultureInfo.InvariantCulture, memberName));\n\n                            if (!property.Ignored)\n                            {\n                                if (property.PropertyContract == null)\n                                    property.PropertyContract = GetContractSafe(property.PropertyType);\n\n                                object propertyValue;\n                                if (propertyConverter != null && propertyConverter.CanRead)\n                                    propertyValue = DeserializeConvertable(propertyConverter, reader, property.PropertyType, null);\n                                else\n                                    propertyValue = CreateValueInternal(reader, property.PropertyType, property.PropertyContract, property, contract, containerProperty, null);\n\n                                propertyValues[property] = propertyValue;\n                                continue;\n                            }\n                        }\n                        else\n                        {\n                            if (!reader.Read())\n                                throw JsonSerializationException.Create(reader, \"Unexpected end when setting {0}'s value.\".FormatWith(CultureInfo.InvariantCulture, memberName));\n\n                            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                                TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Could not find member '{0}' on {1}.\".FormatWith(CultureInfo.InvariantCulture, memberName, contract.UnderlyingType)), null);\n\n                            if (Serializer._missingMemberHandling == MissingMemberHandling.Error)\n                                throw JsonSerializationException.Create(reader, \"Could not find member '{0}' on object of type '{1}'\".FormatWith(CultureInfo.InvariantCulture, memberName, objectType.Name));\n                        }\n\n                        if (extensionData != null)\n                        {\n                            object value = CreateValueInternal(reader, null, null, null, contract, containerProperty, null);\n                            extensionData[memberName] = value;\n                        }\n                        else\n                        {\n                            reader.Skip();\n                        }\n                        break;\n                    case JsonToken.Comment:\n                        break;\n                    case JsonToken.EndObject:\n                        exit = true;\n                        break;\n                    default:\n                        throw JsonSerializationException.Create(reader, \"Unexpected token when deserializing object: \" + reader.TokenType);\n                }\n            } while (!exit && reader.Read());\n\n            return propertyValues;\n        }\n\n        private bool ReadForType(JsonReader reader, JsonContract contract, bool hasConverter)\n        {\n            // don't read properties with converters as a specific value\n            // the value might be a string which will then get converted which will error if read as date for example\n            if (hasConverter)\n                return reader.Read();\n\n            ReadType t = (contract != null) ? contract.InternalReadType : ReadType.Read;\n\n            switch (t)\n            {\n                case ReadType.Read:\n                    do\n                    {\n                        if (!reader.Read())\n                            return false;\n                    } while (reader.TokenType == JsonToken.Comment);\n\n                    return true;\n                case ReadType.ReadAsInt32:\n                    reader.ReadAsInt32();\n                    break;\n                case ReadType.ReadAsDecimal:\n                    reader.ReadAsDecimal();\n                    break;\n                case ReadType.ReadAsBytes:\n                    reader.ReadAsBytes();\n                    break;\n                case ReadType.ReadAsString:\n                    reader.ReadAsString();\n                    break;\n                case ReadType.ReadAsDateTime:\n                    reader.ReadAsDateTime();\n                    break;\n#if !NET20\n                case ReadType.ReadAsDateTimeOffset:\n                    reader.ReadAsDateTimeOffset();\n                    break;\n#endif\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n\n            return (reader.TokenType != JsonToken.None);\n        }\n\n        public object CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, string id, out bool createdFromNonDefaultConstructor)\n        {\n            object newObject = null;\n\n            if (!objectContract.IsInstantiable)\n                throw JsonSerializationException.Create(reader, \"Could not create an instance of type {0}. Type is an interface or abstract class and cannot be instantiated.\".FormatWith(CultureInfo.InvariantCulture, objectContract.UnderlyingType));\n\n            if (objectContract.OverrideConstructor != null)\n            {\n                if (objectContract.OverrideConstructor.GetParameters().Length > 0)\n                {\n                    createdFromNonDefaultConstructor = true;\n                    return CreateObjectFromNonDefaultConstructor(reader, objectContract, containerMember, objectContract.OverrideConstructor, id);\n                }\n\n                newObject = objectContract.OverrideConstructor.Invoke(null);\n            }\n            else if (objectContract.DefaultCreator != null &&\n                     (!objectContract.DefaultCreatorNonPublic || Serializer._constructorHandling == ConstructorHandling.AllowNonPublicDefaultConstructor || objectContract.ParametrizedConstructor == null))\n            {\n                // use the default constructor if it is...\n                // public\n                // non-public and the user has change constructor handling settings\n                // non-public and there is no other constructor\n                newObject = objectContract.DefaultCreator();\n            }\n            else if (objectContract.ParametrizedConstructor != null)\n            {\n                createdFromNonDefaultConstructor = true;\n                return CreateObjectFromNonDefaultConstructor(reader, objectContract, containerMember, objectContract.ParametrizedConstructor, id);\n            }\n\n            if (newObject == null)\n                throw JsonSerializationException.Create(reader, \"Unable to find a constructor to use for type {0}. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute.\".FormatWith(CultureInfo.InvariantCulture, objectContract.UnderlyingType));\n\n            createdFromNonDefaultConstructor = false;\n            return newObject;\n        }\n\n        private object PopulateObject(object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, string id)\n        {\n            OnDeserializing(reader, contract, newObject);\n\n            // only need to keep a track of properies presence if they are required or a value should be defaulted if missing\n            Dictionary<JsonProperty, PropertyPresence> propertiesPresence = (contract.HasRequiredOrDefaultValueProperties || HasFlag(Serializer._defaultValueHandling, DefaultValueHandling.Populate))\n                ? contract.Properties.ToDictionary(m => m, m => PropertyPresence.None)\n                : null;\n\n            if (id != null)\n                AddReference(reader, id, newObject);\n\n            int initialDepth = reader.Depth;\n\n            bool finished = false;\n            do\n            {\n                switch (reader.TokenType)\n                {\n                    case JsonToken.PropertyName:\n                    {\n                        string memberName = reader.Value.ToString();\n\n                        if (CheckPropertyName(reader, memberName))\n                            continue;\n\n                        try\n                        {\n                            // attempt exact case match first\n                            // then try match ignoring case\n                            JsonProperty property = contract.Properties.GetClosestMatchProperty(memberName);\n\n                            if (property == null)\n                            {\n                                if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                                    TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, \"Could not find member '{0}' on {1}\".FormatWith(CultureInfo.InvariantCulture, memberName, contract.UnderlyingType)), null);\n\n                                if (Serializer._missingMemberHandling == MissingMemberHandling.Error)\n                                    throw JsonSerializationException.Create(reader, \"Could not find member '{0}' on object of type '{1}'\".FormatWith(CultureInfo.InvariantCulture, memberName, contract.UnderlyingType.Name));\n\n                                if (!reader.Read())\n                                    break;\n\n                                SetExtensionData(contract, member, reader, memberName, newObject);\n                                continue;\n                            }\n\n                            if (property.PropertyContract == null)\n                                property.PropertyContract = GetContractSafe(property.PropertyType);\n\n                            JsonConverter propertyConverter = GetConverter(property.PropertyContract, property.MemberConverter, contract, member);\n\n                            if (!ReadForType(reader, property.PropertyContract, propertyConverter != null))\n                                throw JsonSerializationException.Create(reader, \"Unexpected end when setting {0}'s value.\".FormatWith(CultureInfo.InvariantCulture, memberName));\n\n                            SetPropertyPresence(reader, property, propertiesPresence);\n\n                            // set extension data if property is ignored or readonly\n                            if (!SetPropertyValue(property, propertyConverter, contract, member, reader, newObject))\n                                SetExtensionData(contract, member, reader, memberName, newObject);\n                        }\n                        catch (Exception ex)\n                        {\n                            if (IsErrorHandled(newObject, contract, memberName, reader as IJsonLineInfo, reader.Path, ex))\n                                HandleError(reader, true, initialDepth);\n                            else\n                                throw;\n                        }\n                        break;\n                    }\n                    case JsonToken.EndObject:\n                        finished = true;\n                        break;\n                    case JsonToken.Comment:\n                        // ignore\n                        break;\n                    default:\n                        throw JsonSerializationException.Create(reader, \"Unexpected token when deserializing object: \" + reader.TokenType);\n                }\n            } while (!finished && reader.Read());\n\n            if (!finished)\n                ThrowUnexpectedEndException(reader, contract, newObject, \"Unexpected end when deserializing object.\");\n\n            EndObject(newObject, reader, contract, initialDepth, propertiesPresence);\n\n            OnDeserialized(reader, contract, newObject);\n            return newObject;\n        }\n\n        private bool CheckPropertyName(JsonReader reader, string memberName)\n        {\n            if (Serializer.MetadataPropertyHandling == MetadataPropertyHandling.ReadAhead)\n            {\n                switch (memberName)\n                {\n                    case JsonTypeReflector.IdPropertyName:\n                    case JsonTypeReflector.RefPropertyName:\n                    case JsonTypeReflector.TypePropertyName:\n                    case JsonTypeReflector.ArrayValuesPropertyName:\n                        reader.Skip();\n                        return true;\n                }\n            }\n            return false;\n        }\n\n        private void SetExtensionData(JsonObjectContract contract, JsonProperty member, JsonReader reader, string memberName, object o)\n        {\n            if (contract.ExtensionDataSetter != null)\n            {\n                try\n                {\n                    object value = CreateValueInternal(reader, null, null, null, contract, member, null);\n\n                    contract.ExtensionDataSetter(o, memberName, value);\n                }\n                catch (Exception ex)\n                {\n                    throw JsonSerializationException.Create(reader, \"Error setting value in extension data for type '{0}'.\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType), ex);\n                }\n            }\n            else\n            {\n                reader.Skip();\n            }\n        }\n\n        private void EndObject(object newObject, JsonReader reader, JsonObjectContract contract, int initialDepth, Dictionary<JsonProperty, PropertyPresence> propertiesPresence)\n        {\n            if (propertiesPresence != null)\n            {\n                foreach (KeyValuePair<JsonProperty, PropertyPresence> propertyPresence in propertiesPresence)\n                {\n                    JsonProperty property = propertyPresence.Key;\n                    PropertyPresence presence = propertyPresence.Value;\n\n                    if (presence == PropertyPresence.None || presence == PropertyPresence.Null)\n                    {\n                        try\n                        {\n                            Required resolvedRequired = property._required ?? contract.ItemRequired ?? Required.Default;\n\n                            switch (presence)\n                            {\n                                case PropertyPresence.None:\n                                    if (resolvedRequired == Required.AllowNull || resolvedRequired == Required.Always)\n                                        throw JsonSerializationException.Create(reader, \"Required property '{0}' not found in JSON.\".FormatWith(CultureInfo.InvariantCulture, property.PropertyName));\n\n                                    if (property.PropertyContract == null)\n                                        property.PropertyContract = GetContractSafe(property.PropertyType);\n\n                                    if (HasFlag(property.DefaultValueHandling.GetValueOrDefault(Serializer._defaultValueHandling), DefaultValueHandling.Populate) && property.Writable)\n                                        property.ValueProvider.SetValue(newObject, EnsureType(reader, property.GetResolvedDefaultValue(), CultureInfo.InvariantCulture, property.PropertyContract, property.PropertyType));\n                                    break;\n                                case PropertyPresence.Null:\n                                    if (resolvedRequired == Required.Always)\n                                        throw JsonSerializationException.Create(reader, \"Required property '{0}' expects a value but got null.\".FormatWith(CultureInfo.InvariantCulture, property.PropertyName));\n                                    break;\n                            }\n                        }\n                        catch (Exception ex)\n                        {\n                            if (IsErrorHandled(newObject, contract, property.PropertyName, reader as IJsonLineInfo, reader.Path, ex))\n                                HandleError(reader, true, initialDepth);\n                            else\n                                throw;\n                        }\n                    }\n                }\n            }\n        }\n\n        private void SetPropertyPresence(JsonReader reader, JsonProperty property, Dictionary<JsonProperty, PropertyPresence> requiredProperties)\n        {\n            if (property != null && requiredProperties != null)\n            {\n                requiredProperties[property] = (reader.TokenType == JsonToken.Null || reader.TokenType == JsonToken.Undefined)\n                    ? PropertyPresence.Null\n                    : PropertyPresence.Value;\n            }\n        }\n\n        private void HandleError(JsonReader reader, bool readPastError, int initialDepth)\n        {\n            ClearErrorContext();\n\n            if (readPastError)\n            {\n                reader.Skip();\n\n                while (reader.Depth > (initialDepth + 1))\n                {\n                    if (!reader.Read())\n                        break;\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.ComponentModel;\n#if !(NET35 || NET20 || PORTABLE40)\nusing System.Dynamic;\n#endif\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Security;\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Utilities;\nusing System.Runtime.Serialization;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal class JsonSerializerInternalWriter : JsonSerializerInternalBase\n    {\n        private JsonContract _rootContract;\n        private int _rootLevel;\n        private readonly List<object> _serializeStack = new List<object>();\n        private JsonSerializerProxy _internalSerializer;\n\n        public JsonSerializerInternalWriter(JsonSerializer serializer)\n            : base(serializer)\n        {\n        }\n\n        public void Serialize(JsonWriter jsonWriter, object value, Type objectType)\n        {\n            if (jsonWriter == null)\n                throw new ArgumentNullException(\"jsonWriter\");\n\n            _rootContract = (objectType != null) ? Serializer._contractResolver.ResolveContract(objectType) : null;\n            _rootLevel = _serializeStack.Count + 1;\n\n            JsonContract contract = GetContractSafe(value);\n\n            try\n            {\n                SerializeValue(jsonWriter, value, contract, null, null, null);\n            }\n            catch (Exception ex)\n            {\n                if (IsErrorHandled(null, contract, null, null, jsonWriter.Path, ex))\n                {\n                    HandleError(jsonWriter, 0);\n                }\n                else\n                {\n                    // clear context in case serializer is being used inside a converter\n                    // if the converter wraps the error then not clearing the context will cause this error:\n                    // \"Current error context error is different to requested error.\"\n                    ClearErrorContext();\n                    throw;\n                }\n            }\n            finally\n            {\n                // clear root contract to ensure that if level was > 1 then it won't\n                // accidently be used for non root values\n                _rootContract = null;\n            }\n        }\n\n        private JsonSerializerProxy GetInternalSerializer()\n        {\n            if (_internalSerializer == null)\n                _internalSerializer = new JsonSerializerProxy(this);\n\n            return _internalSerializer;\n        }\n\n        private JsonContract GetContractSafe(object value)\n        {\n            if (value == null)\n                return null;\n\n            return Serializer._contractResolver.ResolveContract(value.GetType());\n        }\n\n        private void SerializePrimitive(JsonWriter writer, object value, JsonPrimitiveContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\n        {\n            if (contract.TypeCode == PrimitiveTypeCode.Bytes)\n            {\n                // if type name handling is enabled then wrap the base64 byte string in an object with the type name\n                bool includeTypeDetails = ShouldWriteType(TypeNameHandling.Objects, contract, member, containerContract, containerProperty);\n                if (includeTypeDetails)\n                {\n                    writer.WriteStartObject();\n                    WriteTypeProperty(writer, contract.CreatedType);\n                    writer.WritePropertyName(JsonTypeReflector.ValuePropertyName, false);\n\n                    JsonWriter.WriteValue(writer, contract.TypeCode, value);\n\n                    writer.WriteEndObject();\n                    return;\n                }\n            }\n\n            JsonWriter.WriteValue(writer, contract.TypeCode, value);\n        }\n\n        private void SerializeValue(JsonWriter writer, object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\n        {\n            if (value == null)\n            {\n                writer.WriteNull();\n                return;\n            }\n\n            JsonConverter converter;\n            if ((((converter = (member != null) ? member.Converter : null) != null)\n                 || ((converter = (containerProperty != null) ? containerProperty.ItemConverter : null) != null)\n                 || ((converter = (containerContract != null) ? containerContract.ItemConverter : null) != null)\n                 || ((converter = valueContract.Converter) != null)\n                 || ((converter = Serializer.GetMatchingConverter(valueContract.UnderlyingType)) != null)\n                 || ((converter = valueContract.InternalConverter) != null))\n                && converter.CanWrite)\n            {\n                SerializeConvertable(writer, converter, value, valueContract, containerContract, containerProperty);\n                return;\n            }\n\n            switch (valueContract.ContractType)\n            {\n                case JsonContractType.Object:\n                    SerializeObject(writer, value, (JsonObjectContract)valueContract, member, containerContract, containerProperty);\n                    break;\n                case JsonContractType.Array:\n                    JsonArrayContract arrayContract = (JsonArrayContract)valueContract;\n                    if (!arrayContract.IsMultidimensionalArray)\n                        SerializeList(writer, (IEnumerable)value, arrayContract, member, containerContract, containerProperty);\n                    else\n                        SerializeMultidimensionalArray(writer, (Array)value, arrayContract, member, containerContract, containerProperty);\n                    break;\n                case JsonContractType.Primitive:\n                    SerializePrimitive(writer, value, (JsonPrimitiveContract)valueContract, member, containerContract, containerProperty);\n                    break;\n                case JsonContractType.String:\n                    SerializeString(writer, value, (JsonStringContract)valueContract);\n                    break;\n                case JsonContractType.Dictionary:\n                    JsonDictionaryContract dictionaryContract = (JsonDictionaryContract)valueContract;\n                    SerializeDictionary(writer, (value is IDictionary) ? (IDictionary)value : dictionaryContract.CreateWrapper(value), dictionaryContract, member, containerContract, containerProperty);\n                    break;\n#if !(NET35 || NET20 || PORTABLE40)\n                case JsonContractType.Dynamic:\n                    SerializeDynamic(writer, (IDynamicMetaObjectProvider)value, (JsonDynamicContract)valueContract, member, containerContract, containerProperty);\n                    break;\n#endif\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n                case JsonContractType.Serializable:\n                    SerializeISerializable(writer, (ISerializable)value, (JsonISerializableContract)valueContract, member, containerContract, containerProperty);\n                    break;\n#endif\n                case JsonContractType.Linq:\n                    ((JToken)value).WriteTo(writer, Serializer.Converters.ToArray());\n                    break;\n            }\n        }\n\n        private bool? ResolveIsReference(JsonContract contract, JsonProperty property, JsonContainerContract collectionContract, JsonProperty containerProperty)\n        {\n            bool? isReference = null;\n\n            // value could be coming from a dictionary or array and not have a property\n            if (property != null)\n                isReference = property.IsReference;\n\n            if (isReference == null && containerProperty != null)\n                isReference = containerProperty.ItemIsReference;\n\n            if (isReference == null && collectionContract != null)\n                isReference = collectionContract.ItemIsReference;\n\n            if (isReference == null)\n                isReference = contract.IsReference;\n\n            return isReference;\n        }\n\n        private bool ShouldWriteReference(object value, JsonProperty property, JsonContract valueContract, JsonContainerContract collectionContract, JsonProperty containerProperty)\n        {\n            if (value == null)\n                return false;\n            if (valueContract.ContractType == JsonContractType.Primitive || valueContract.ContractType == JsonContractType.String)\n                return false;\n\n            bool? isReference = ResolveIsReference(valueContract, property, collectionContract, containerProperty);\n\n            if (isReference == null)\n            {\n                if (valueContract.ContractType == JsonContractType.Array)\n                    isReference = HasFlag(Serializer._preserveReferencesHandling, PreserveReferencesHandling.Arrays);\n                else\n                    isReference = HasFlag(Serializer._preserveReferencesHandling, PreserveReferencesHandling.Objects);\n            }\n\n            if (!isReference.Value)\n                return false;\n\n            return Serializer.GetReferenceResolver().IsReferenced(this, value);\n        }\n\n        private bool ShouldWriteProperty(object memberValue, JsonProperty property)\n        {\n            if (property.NullValueHandling.GetValueOrDefault(Serializer._nullValueHandling) == NullValueHandling.Ignore &&\n                memberValue == null)\n                return false;\n\n            if (HasFlag(property.DefaultValueHandling.GetValueOrDefault(Serializer._defaultValueHandling), DefaultValueHandling.Ignore)\n                && MiscellaneousUtils.ValueEquals(memberValue, property.GetResolvedDefaultValue()))\n                return false;\n\n            return true;\n        }\n\n        private bool CheckForCircularReference(JsonWriter writer, object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty)\n        {\n            if (value == null || contract.ContractType == JsonContractType.Primitive || contract.ContractType == JsonContractType.String)\n                return true;\n\n            ReferenceLoopHandling? referenceLoopHandling = null;\n\n            if (property != null)\n                referenceLoopHandling = property.ReferenceLoopHandling;\n\n            if (referenceLoopHandling == null && containerProperty != null)\n                referenceLoopHandling = containerProperty.ItemReferenceLoopHandling;\n\n            if (referenceLoopHandling == null && containerContract != null)\n                referenceLoopHandling = containerContract.ItemReferenceLoopHandling;\n\n            if (_serializeStack.IndexOf(value) != -1)\n            {\n                string message = \"Self referencing loop detected\";\n                if (property != null)\n                    message += \" for property '{0}'\".FormatWith(CultureInfo.InvariantCulture, property.PropertyName);\n                message += \" with type '{0}'.\".FormatWith(CultureInfo.InvariantCulture, value.GetType());\n\n                switch (referenceLoopHandling.GetValueOrDefault(Serializer._referenceLoopHandling))\n                {\n                    case ReferenceLoopHandling.Error:\n                        throw JsonSerializationException.Create(null, writer.ContainerPath, message, null);\n                    case ReferenceLoopHandling.Ignore:\n                        if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                            TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(null, writer.Path, message + \". Skipping serializing self referenced value.\"), null);\n\n                        return false;\n                    case ReferenceLoopHandling.Serialize:\n                        if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                            TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(null, writer.Path, message + \". Serializing self referenced value.\"), null);\n\n                        return true;\n                }\n            }\n\n            return true;\n        }\n\n        private void WriteReference(JsonWriter writer, object value)\n        {\n            string reference = GetReference(writer, value);\n\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(null, writer.Path, \"Writing object reference to Id '{0}' for {1}.\".FormatWith(CultureInfo.InvariantCulture, reference, value.GetType())), null);\n\n            writer.WriteStartObject();\n            writer.WritePropertyName(JsonTypeReflector.RefPropertyName, false);\n            writer.WriteValue(reference);\n            writer.WriteEndObject();\n        }\n\n        private string GetReference(JsonWriter writer, object value)\n        {\n            try\n            {\n                string reference = Serializer.GetReferenceResolver().GetReference(this, value);\n\n                return reference;\n            }\n            catch (Exception ex)\n            {\n                throw JsonSerializationException.Create(null, writer.ContainerPath, \"Error writing object reference for '{0}'.\".FormatWith(CultureInfo.InvariantCulture, value.GetType()), ex);\n            }\n        }\n\n        internal static bool TryConvertToString(object value, Type type, out string s)\n        {\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            TypeConverter converter = ConvertUtils.GetConverter(type);\n\n            // use the objectType's TypeConverter if it has one and can convert to a string\n            if (converter != null\n                && !(converter is ComponentConverter)\n                && converter.GetType() != typeof(TypeConverter))\n            {\n                if (converter.CanConvertTo(typeof(string)))\n                {\n                    s = converter.ConvertToInvariantString(value);\n                    return true;\n                }\n            }\n#endif\n\n#if NETFX_CORE || PORTABLE\n      if (value is Guid || value is Uri || value is TimeSpan)\n      {\n        s = value.ToString();\n        return true;\n      }\n#endif\n\n            if (value is Type)\n            {\n                s = ((Type)value).AssemblyQualifiedName;\n                return true;\n            }\n\n            s = null;\n            return false;\n        }\n\n        private void SerializeString(JsonWriter writer, object value, JsonStringContract contract)\n        {\n            OnSerializing(writer, contract, value);\n\n            string s;\n            TryConvertToString(value, contract.UnderlyingType, out s);\n            writer.WriteValue(s);\n\n            OnSerialized(writer, contract, value);\n        }\n\n        private void OnSerializing(JsonWriter writer, JsonContract contract, object value)\n        {\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(null, writer.Path, \"Started serializing {0}\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)), null);\n\n            contract.InvokeOnSerializing(value, Serializer._context);\n        }\n\n        private void OnSerialized(JsonWriter writer, JsonContract contract, object value)\n        {\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(null, writer.Path, \"Finished serializing {0}\".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)), null);\n\n            contract.InvokeOnSerialized(value, Serializer._context);\n        }\n\n        private void SerializeObject(JsonWriter writer, object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\n        {\n            OnSerializing(writer, contract, value);\n\n            _serializeStack.Add(value);\n\n            WriteObjectStart(writer, value, contract, member, collectionContract, containerProperty);\n\n            int initialDepth = writer.Top;\n\n            for (int index = 0; index < contract.Properties.Count; index++)\n            {\n                JsonProperty property = contract.Properties[index];\n                try\n                {\n                    object memberValue;\n                    JsonContract memberContract;\n\n                    if (!CalculatePropertyValues(writer, value, contract, member, property, out memberContract, out memberValue))\n                        continue;\n\n                    property.WritePropertyName(writer);\n                    SerializeValue(writer, memberValue, memberContract, property, contract, member);\n                }\n                catch (Exception ex)\n                {\n                    if (IsErrorHandled(value, contract, property.PropertyName, null, writer.ContainerPath, ex))\n                        HandleError(writer, initialDepth);\n                    else\n                        throw;\n                }\n            }\n\n            if (contract.ExtensionDataGetter != null)\n            {\n                IEnumerable<KeyValuePair<object, object>> extensionData = contract.ExtensionDataGetter(value);\n                if (extensionData != null)\n                {\n                    foreach (KeyValuePair<object, object> e in extensionData)\n                    {\n                        JsonContract keyContract = GetContractSafe(e.Key);\n                        JsonContract valueContract = GetContractSafe(e.Value);\n\n                        bool escape;\n                        string propertyName = GetPropertyName(writer, e.Key, keyContract, out escape);\n\n                        if (ShouldWriteReference(e.Value, null, valueContract, contract, member))\n                        {\n                            writer.WritePropertyName(propertyName);\n                            WriteReference(writer, e.Value);\n                        }\n                        else\n                        {\n                            if (!CheckForCircularReference(writer, e.Value, null, valueContract, contract, member))\n                                continue;\n\n                            writer.WritePropertyName(propertyName);\n\n                            SerializeValue(writer, e.Value, valueContract, null, contract, member);\n                        }\n                    }\n                }\n            }\n\n            writer.WriteEndObject();\n\n            _serializeStack.RemoveAt(_serializeStack.Count - 1);\n\n            OnSerialized(writer, contract, value);\n        }\n\n        private bool CalculatePropertyValues(JsonWriter writer, object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, out JsonContract memberContract, out object memberValue)\n        {\n            if (!property.Ignored && property.Readable && ShouldSerialize(writer, property, value) && IsSpecified(writer, property, value))\n            {\n                if (property.PropertyContract == null)\n                    property.PropertyContract = Serializer._contractResolver.ResolveContract(property.PropertyType);\n\n                memberValue = property.ValueProvider.GetValue(value);\n                memberContract = (property.PropertyContract.IsSealed) ? property.PropertyContract : GetContractSafe(memberValue);\n\n                if (ShouldWriteProperty(memberValue, property))\n                {\n                    if (ShouldWriteReference(memberValue, property, memberContract, contract, member))\n                    {\n                        property.WritePropertyName(writer);\n                        WriteReference(writer, memberValue);\n                        return false;\n                    }\n\n                    if (!CheckForCircularReference(writer, memberValue, property, memberContract, contract, member))\n                        return false;\n\n                    if (memberValue == null)\n                    {\n                        JsonObjectContract objectContract = contract as JsonObjectContract;\n                        Required resolvedRequired = property._required ?? ((objectContract != null) ? objectContract.ItemRequired : null) ?? Required.Default;\n                        if (resolvedRequired == Required.Always)\n                            throw JsonSerializationException.Create(null, writer.ContainerPath, \"Cannot write a null value for property '{0}'. Property requires a value.\".FormatWith(CultureInfo.InvariantCulture, property.PropertyName), null);\n                    }\n\n                    return true;\n                }\n            }\n\n            memberContract = null;\n            memberValue = null;\n            return false;\n        }\n\n        private void WriteObjectStart(JsonWriter writer, object value, JsonContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\n        {\n            writer.WriteStartObject();\n\n            bool isReference = ResolveIsReference(contract, member, collectionContract, containerProperty) ?? HasFlag(Serializer._preserveReferencesHandling, PreserveReferencesHandling.Objects);\n            if (isReference)\n            {\n                WriteReferenceIdProperty(writer, contract.UnderlyingType, value);\n            }\n            if (ShouldWriteType(TypeNameHandling.Objects, contract, member, collectionContract, containerProperty))\n            {\n                WriteTypeProperty(writer, contract.UnderlyingType);\n            }\n        }\n\n        private void WriteReferenceIdProperty(JsonWriter writer, Type type, object value)\n        {\n            string reference = GetReference(writer, value);\n\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(null, writer.Path, \"Writing object reference Id '{0}' for {1}.\".FormatWith(CultureInfo.InvariantCulture, reference, type)), null);\n\n            writer.WritePropertyName(JsonTypeReflector.IdPropertyName, false);\n            writer.WriteValue(reference);\n        }\n\n        private void WriteTypeProperty(JsonWriter writer, Type type)\n        {\n            string typeName = ReflectionUtils.GetTypeName(type, Serializer._typeNameAssemblyFormat, Serializer._binder);\n\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(null, writer.Path, \"Writing type name '{0}' for {1}.\".FormatWith(CultureInfo.InvariantCulture, typeName, type)), null);\n\n            writer.WritePropertyName(JsonTypeReflector.TypePropertyName, false);\n            writer.WriteValue(typeName);\n        }\n\n        private bool HasFlag(DefaultValueHandling value, DefaultValueHandling flag)\n        {\n            return ((value & flag) == flag);\n        }\n\n        private bool HasFlag(PreserveReferencesHandling value, PreserveReferencesHandling flag)\n        {\n            return ((value & flag) == flag);\n        }\n\n        private bool HasFlag(TypeNameHandling value, TypeNameHandling flag)\n        {\n            return ((value & flag) == flag);\n        }\n\n        private void SerializeConvertable(JsonWriter writer, JsonConverter converter, object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)\n        {\n            if (ShouldWriteReference(value, null, contract, collectionContract, containerProperty))\n            {\n                WriteReference(writer, value);\n            }\n            else\n            {\n                if (!CheckForCircularReference(writer, value, null, contract, collectionContract, containerProperty))\n                    return;\n\n                _serializeStack.Add(value);\n\n                if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                    TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(null, writer.Path, \"Started serializing {0} with converter {1}.\".FormatWith(CultureInfo.InvariantCulture, value.GetType(), converter.GetType())), null);\n\n                converter.WriteJson(writer, value, GetInternalSerializer());\n\n                if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)\n                    TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(null, writer.Path, \"Finished serializing {0} with converter {1}.\".FormatWith(CultureInfo.InvariantCulture, value.GetType(), converter.GetType())), null);\n\n                _serializeStack.RemoveAt(_serializeStack.Count - 1);\n            }\n        }\n\n        private void SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\n        {\n            IWrappedCollection wrappedCollection = values as IWrappedCollection;\n            object underlyingList = wrappedCollection != null ? wrappedCollection.UnderlyingCollection : values;\n\n            OnSerializing(writer, contract, underlyingList);\n\n            _serializeStack.Add(underlyingList);\n\n            bool hasWrittenMetadataObject = WriteStartArray(writer, underlyingList, contract, member, collectionContract, containerProperty);\n\n            writer.WriteStartArray();\n\n            int initialDepth = writer.Top;\n\n            int index = 0;\n            // note that an error in the IEnumerable won't be caught\n            foreach (object value in values)\n            {\n                try\n                {\n                    JsonContract valueContract = contract.FinalItemContract ?? GetContractSafe(value);\n\n                    if (ShouldWriteReference(value, null, valueContract, contract, member))\n                    {\n                        WriteReference(writer, value);\n                    }\n                    else\n                    {\n                        if (CheckForCircularReference(writer, value, null, valueContract, contract, member))\n                        {\n                            SerializeValue(writer, value, valueContract, null, contract, member);\n                        }\n                    }\n                }\n                catch (Exception ex)\n                {\n                    if (IsErrorHandled(underlyingList, contract, index, null, writer.ContainerPath, ex))\n                        HandleError(writer, initialDepth);\n                    else\n                        throw;\n                }\n                finally\n                {\n                    index++;\n                }\n            }\n\n            writer.WriteEndArray();\n\n            if (hasWrittenMetadataObject)\n                writer.WriteEndObject();\n\n            _serializeStack.RemoveAt(_serializeStack.Count - 1);\n\n            OnSerialized(writer, contract, underlyingList);\n        }\n\n        private void SerializeMultidimensionalArray(JsonWriter writer, Array values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\n        {\n            OnSerializing(writer, contract, values);\n\n            _serializeStack.Add(values);\n\n            bool hasWrittenMetadataObject = WriteStartArray(writer, values, contract, member, collectionContract, containerProperty);\n\n            SerializeMultidimensionalArray(writer, values, contract, member, writer.Top, new int[0]);\n\n            if (hasWrittenMetadataObject)\n                writer.WriteEndObject();\n\n            _serializeStack.RemoveAt(_serializeStack.Count - 1);\n\n            OnSerialized(writer, contract, values);\n        }\n\n        private void SerializeMultidimensionalArray(JsonWriter writer, Array values, JsonArrayContract contract, JsonProperty member, int initialDepth, int[] indices)\n        {\n            int dimension = indices.Length;\n            int[] newIndices = new int[dimension + 1];\n            for (int i = 0; i < dimension; i++)\n            {\n                newIndices[i] = indices[i];\n            }\n\n            writer.WriteStartArray();\n\n            for (int i = 0; i < values.GetLength(dimension); i++)\n            {\n                newIndices[dimension] = i;\n                bool isTopLevel = (newIndices.Length == values.Rank);\n\n                if (isTopLevel)\n                {\n                    object value = values.GetValue(newIndices);\n\n                    try\n                    {\n                        JsonContract valueContract = contract.FinalItemContract ?? GetContractSafe(value);\n\n                        if (ShouldWriteReference(value, null, valueContract, contract, member))\n                        {\n                            WriteReference(writer, value);\n                        }\n                        else\n                        {\n                            if (CheckForCircularReference(writer, value, null, valueContract, contract, member))\n                            {\n                                SerializeValue(writer, value, valueContract, null, contract, member);\n                            }\n                        }\n                    }\n                    catch (Exception ex)\n                    {\n                        if (IsErrorHandled(values, contract, i, null, writer.ContainerPath, ex))\n                            HandleError(writer, initialDepth + 1);\n                        else\n                            throw;\n                    }\n                }\n                else\n                {\n                    SerializeMultidimensionalArray(writer, values, contract, member, initialDepth + 1, newIndices);\n                }\n            }\n\n            writer.WriteEndArray();\n        }\n\n        private bool WriteStartArray(JsonWriter writer, object values, JsonArrayContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\n        {\n            bool isReference = ResolveIsReference(contract, member, containerContract, containerProperty) ?? HasFlag(Serializer._preserveReferencesHandling, PreserveReferencesHandling.Arrays);\n            bool includeTypeDetails = ShouldWriteType(TypeNameHandling.Arrays, contract, member, containerContract, containerProperty);\n            bool writeMetadataObject = isReference || includeTypeDetails;\n\n            if (writeMetadataObject)\n            {\n                writer.WriteStartObject();\n\n                if (isReference)\n                {\n                    WriteReferenceIdProperty(writer, contract.UnderlyingType, values);\n                }\n                if (includeTypeDetails)\n                {\n                    WriteTypeProperty(writer, values.GetType());\n                }\n                writer.WritePropertyName(JsonTypeReflector.ArrayValuesPropertyName, false);\n            }\n\n            if (contract.ItemContract == null)\n                contract.ItemContract = Serializer._contractResolver.ResolveContract(contract.CollectionItemType ?? typeof(object));\n\n            return writeMetadataObject;\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n#if !(NET20 || NET35)\n        [SecuritySafeCritical]\n#endif\n        private void SerializeISerializable(JsonWriter writer, ISerializable value, JsonISerializableContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\n        {\n            if (!JsonTypeReflector.FullyTrusted)\n            {\n                throw JsonSerializationException.Create(null, writer.ContainerPath, @\"Type '{0}' implements ISerializable but cannot be serialized using the ISerializable interface because the current application is not fully trusted and ISerializable can expose secure data.\nTo fix this error either change the environment to be fully trusted, change the application to not deserialize the type, add JsonObjectAttribute to the type or change the JsonSerializer setting ContractResolver to use a new DefaultContractResolver with IgnoreSerializableInterface set to true.\".FormatWith(CultureInfo.InvariantCulture, value.GetType()), null);\n            }\n\n            OnSerializing(writer, contract, value);\n            _serializeStack.Add(value);\n\n            WriteObjectStart(writer, value, contract, member, collectionContract, containerProperty);\n\n            SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, new FormatterConverter());\n            value.GetObjectData(serializationInfo, Serializer._context);\n\n            foreach (SerializationEntry serializationEntry in serializationInfo)\n            {\n                JsonContract valueContract = GetContractSafe(serializationEntry.Value);\n\n                if (CheckForCircularReference(writer, serializationEntry.Value, null, valueContract, contract, member))\n                {\n                    writer.WritePropertyName(serializationEntry.Name);\n                    SerializeValue(writer, serializationEntry.Value, valueContract, null, contract, member);\n                }\n            }\n\n            writer.WriteEndObject();\n\n            _serializeStack.RemoveAt(_serializeStack.Count - 1);\n            OnSerialized(writer, contract, value);\n        }\n#endif\n\n#if !(NET35 || NET20 || PORTABLE40)\n        private void SerializeDynamic(JsonWriter writer, IDynamicMetaObjectProvider value, JsonDynamicContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\n        {\n            OnSerializing(writer, contract, value);\n            _serializeStack.Add(value);\n\n            WriteObjectStart(writer, value, contract, member, collectionContract, containerProperty);\n\n            int initialDepth = writer.Top;\n\n            for (int index = 0; index < contract.Properties.Count; index++)\n            {\n                JsonProperty property = contract.Properties[index];\n\n                // only write non-dynamic properties that have an explicit attribute\n                if (property.HasMemberAttribute)\n                {\n                    try\n                    {\n                        object memberValue;\n                        JsonContract memberContract;\n\n                        if (!CalculatePropertyValues(writer, value, contract, member, property, out memberContract, out memberValue))\n                            continue;\n\n                        property.WritePropertyName(writer);\n                        SerializeValue(writer, memberValue, memberContract, property, contract, member);\n                    }\n                    catch (Exception ex)\n                    {\n                        if (IsErrorHandled(value, contract, property.PropertyName, null, writer.ContainerPath, ex))\n                            HandleError(writer, initialDepth);\n                        else\n                            throw;\n                    }\n                }\n            }\n\n            foreach (string memberName in value.GetDynamicMemberNames())\n            {\n                object memberValue;\n                if (contract.TryGetMember(value, memberName, out memberValue))\n                {\n                    try\n                    {\n                        JsonContract valueContract = GetContractSafe(memberValue);\n\n                        if (!ShouldWriteDynamicProperty(memberValue))\n                            continue;\n\n                        if (CheckForCircularReference(writer, memberValue, null, valueContract, contract, member))\n                        {\n                            string resolvedPropertyName = (contract.PropertyNameResolver != null)\n                                ? contract.PropertyNameResolver(memberName)\n                                : memberName;\n\n                            writer.WritePropertyName(resolvedPropertyName);\n                            SerializeValue(writer, memberValue, valueContract, null, contract, member);\n                        }\n                    }\n                    catch (Exception ex)\n                    {\n                        if (IsErrorHandled(value, contract, memberName, null, writer.ContainerPath, ex))\n                            HandleError(writer, initialDepth);\n                        else\n                            throw;\n                    }\n                }\n            }\n\n            writer.WriteEndObject();\n\n            _serializeStack.RemoveAt(_serializeStack.Count - 1);\n            OnSerialized(writer, contract, value);\n        }\n#endif\n\n        private bool ShouldWriteDynamicProperty(object memberValue)\n        {\n            if (Serializer._nullValueHandling == NullValueHandling.Ignore && memberValue == null)\n                return false;\n\n            if (HasFlag(Serializer._defaultValueHandling, DefaultValueHandling.Ignore) &&\n                (memberValue == null || MiscellaneousUtils.ValueEquals(memberValue, ReflectionUtils.GetDefaultValue(memberValue.GetType()))))\n                return false;\n\n            return true;\n        }\n\n        private bool ShouldWriteType(TypeNameHandling typeNameHandlingFlag, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\n        {\n            TypeNameHandling resolvedTypeNameHandling =\n                ((member != null) ? member.TypeNameHandling : null)\n                ?? ((containerProperty != null) ? containerProperty.ItemTypeNameHandling : null)\n                ?? ((containerContract != null) ? containerContract.ItemTypeNameHandling : null)\n                ?? Serializer._typeNameHandling;\n\n            if (HasFlag(resolvedTypeNameHandling, typeNameHandlingFlag))\n                return true;\n\n            // instance type and the property's type's contract default type are different (no need to put the type in JSON because the type will be created by default)\n            if (HasFlag(resolvedTypeNameHandling, TypeNameHandling.Auto))\n            {\n                if (member != null)\n                {\n                    if (contract.UnderlyingType != member.PropertyContract.CreatedType)\n                        return true;\n                }\n                else if (containerContract != null)\n                {\n                    if (containerContract.ItemContract == null || contract.UnderlyingType != containerContract.ItemContract.CreatedType)\n                        return true;\n                }\n                else if (_rootContract != null && _serializeStack.Count == _rootLevel)\n                {\n                    if (contract.UnderlyingType != _rootContract.CreatedType)\n                        return true;\n                }\n            }\n\n            return false;\n        }\n\n        private void SerializeDictionary(JsonWriter writer, IDictionary values, JsonDictionaryContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\n        {\n            IWrappedDictionary wrappedDictionary = values as IWrappedDictionary;\n            object underlyingDictionary = wrappedDictionary != null ? wrappedDictionary.UnderlyingDictionary : values;\n\n            OnSerializing(writer, contract, underlyingDictionary);\n            _serializeStack.Add(underlyingDictionary);\n\n            WriteObjectStart(writer, underlyingDictionary, contract, member, collectionContract, containerProperty);\n\n            if (contract.ItemContract == null)\n                contract.ItemContract = Serializer._contractResolver.ResolveContract(contract.DictionaryValueType ?? typeof(object));\n\n            if (contract.KeyContract == null)\n                contract.KeyContract = Serializer._contractResolver.ResolveContract(contract.DictionaryKeyType ?? typeof(object));\n\n            int initialDepth = writer.Top;\n\n            foreach (DictionaryEntry entry in values)\n            {\n                bool escape;\n                string propertyName = GetPropertyName(writer, entry.Key, contract.KeyContract, out escape);\n\n                propertyName = (contract.PropertyNameResolver != null)\n                    ? contract.PropertyNameResolver(propertyName)\n                    : propertyName;\n\n                try\n                {\n                    object value = entry.Value;\n                    JsonContract valueContract = contract.FinalItemContract ?? GetContractSafe(value);\n\n                    if (ShouldWriteReference(value, null, valueContract, contract, member))\n                    {\n                        writer.WritePropertyName(propertyName, escape);\n                        WriteReference(writer, value);\n                    }\n                    else\n                    {\n                        if (!CheckForCircularReference(writer, value, null, valueContract, contract, member))\n                            continue;\n\n                        writer.WritePropertyName(propertyName, escape);\n\n                        SerializeValue(writer, value, valueContract, null, contract, member);\n                    }\n                }\n                catch (Exception ex)\n                {\n                    if (IsErrorHandled(underlyingDictionary, contract, propertyName, null, writer.ContainerPath, ex))\n                        HandleError(writer, initialDepth);\n                    else\n                        throw;\n                }\n            }\n\n            writer.WriteEndObject();\n\n            _serializeStack.RemoveAt(_serializeStack.Count - 1);\n\n            OnSerialized(writer, contract, underlyingDictionary);\n        }\n\n        private string GetPropertyName(JsonWriter writer, object name, JsonContract contract, out bool escape)\n        {\n            string propertyName;\n\n            if (contract.ContractType == JsonContractType.Primitive)\n            {\n                JsonPrimitiveContract primitiveContract = (JsonPrimitiveContract)contract;\n                if (primitiveContract.TypeCode == PrimitiveTypeCode.DateTime || primitiveContract.TypeCode == PrimitiveTypeCode.DateTimeNullable)\n                {\n                    escape = false;\n                    StringWriter sw = new StringWriter(CultureInfo.InvariantCulture);\n                    DateTimeUtils.WriteDateTimeString(sw, (DateTime)name, writer.DateFormatHandling, writer.DateFormatString, writer.Culture);\n                    return sw.ToString();\n                }\n#if !NET20\n                else if (primitiveContract.TypeCode == PrimitiveTypeCode.DateTimeOffset || primitiveContract.TypeCode == PrimitiveTypeCode.DateTimeOffsetNullable)\n                {\n                    escape = false;\n                    StringWriter sw = new StringWriter(CultureInfo.InvariantCulture);\n                    DateTimeUtils.WriteDateTimeOffsetString(sw, (DateTimeOffset)name, writer.DateFormatHandling, writer.DateFormatString, writer.Culture);\n                    return sw.ToString();\n                }\n#endif\n                else\n                {\n                    escape = true;\n                    return Convert.ToString(name, CultureInfo.InvariantCulture);\n                }\n            }\n            else if (TryConvertToString(name, name.GetType(), out propertyName))\n            {\n                escape = true;\n                return propertyName;\n            }\n            else\n            {\n                escape = true;\n                return name.ToString();\n            }\n        }\n\n        private void HandleError(JsonWriter writer, int initialDepth)\n        {\n            ClearErrorContext();\n\n            if (writer.WriteState == WriteState.Property)\n                writer.WriteNull();\n\n            while (writer.Top > initialDepth)\n            {\n                writer.WriteEnd();\n            }\n        }\n\n        private bool ShouldSerialize(JsonWriter writer, JsonProperty property, object target)\n        {\n            if (property.ShouldSerialize == null)\n                return true;\n\n            bool shouldSerialize = property.ShouldSerialize(target);\n\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(null, writer.Path, \"ShouldSerialize result for property '{0}' on {1}: {2}\".FormatWith(CultureInfo.InvariantCulture, property.PropertyName, property.DeclaringType, shouldSerialize)), null);\n\n            return shouldSerialize;\n        }\n\n        private bool IsSpecified(JsonWriter writer, JsonProperty property, object target)\n        {\n            if (property.GetIsSpecified == null)\n                return true;\n\n            bool isSpecified = property.GetIsSpecified(target);\n\n            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)\n                TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(null, writer.Path, \"IsSpecified result for property '{0}' on {1}: {2}\".FormatWith(CultureInfo.InvariantCulture, property.PropertyName, property.DeclaringType, isSpecified)), null);\n\n            return isSpecified;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonSerializerProxy.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Globalization;\nusing System.Runtime.Serialization.Formatters;\nusing Newtonsoft.Json.Utilities;\nusing System.Runtime.Serialization;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal class JsonSerializerProxy : JsonSerializer\n    {\n        private readonly JsonSerializerInternalReader _serializerReader;\n        private readonly JsonSerializerInternalWriter _serializerWriter;\n        private readonly JsonSerializer _serializer;\n\n        public override event EventHandler<ErrorEventArgs> Error\n        {\n            add { _serializer.Error += value; }\n            remove { _serializer.Error -= value; }\n        }\n\n        public override IReferenceResolver ReferenceResolver\n        {\n            get { return _serializer.ReferenceResolver; }\n            set { _serializer.ReferenceResolver = value; }\n        }\n\n        public override ITraceWriter TraceWriter\n        {\n            get { return _serializer.TraceWriter; }\n            set { _serializer.TraceWriter = value; }\n        }\n\n        public override JsonConverterCollection Converters\n        {\n            get { return _serializer.Converters; }\n        }\n\n        public override DefaultValueHandling DefaultValueHandling\n        {\n            get { return _serializer.DefaultValueHandling; }\n            set { _serializer.DefaultValueHandling = value; }\n        }\n\n        public override IContractResolver ContractResolver\n        {\n            get { return _serializer.ContractResolver; }\n            set { _serializer.ContractResolver = value; }\n        }\n\n        public override MissingMemberHandling MissingMemberHandling\n        {\n            get { return _serializer.MissingMemberHandling; }\n            set { _serializer.MissingMemberHandling = value; }\n        }\n\n        public override NullValueHandling NullValueHandling\n        {\n            get { return _serializer.NullValueHandling; }\n            set { _serializer.NullValueHandling = value; }\n        }\n\n        public override ObjectCreationHandling ObjectCreationHandling\n        {\n            get { return _serializer.ObjectCreationHandling; }\n            set { _serializer.ObjectCreationHandling = value; }\n        }\n\n        public override ReferenceLoopHandling ReferenceLoopHandling\n        {\n            get { return _serializer.ReferenceLoopHandling; }\n            set { _serializer.ReferenceLoopHandling = value; }\n        }\n\n        public override PreserveReferencesHandling PreserveReferencesHandling\n        {\n            get { return _serializer.PreserveReferencesHandling; }\n            set { _serializer.PreserveReferencesHandling = value; }\n        }\n\n        public override TypeNameHandling TypeNameHandling\n        {\n            get { return _serializer.TypeNameHandling; }\n            set { _serializer.TypeNameHandling = value; }\n        }\n\n        public override MetadataPropertyHandling MetadataPropertyHandling\n        {\n            get { return _serializer.MetadataPropertyHandling; }\n            set { _serializer.MetadataPropertyHandling = value; }\n        }\n\n        public override FormatterAssemblyStyle TypeNameAssemblyFormat\n        {\n            get { return _serializer.TypeNameAssemblyFormat; }\n            set { _serializer.TypeNameAssemblyFormat = value; }\n        }\n\n        public override ConstructorHandling ConstructorHandling\n        {\n            get { return _serializer.ConstructorHandling; }\n            set { _serializer.ConstructorHandling = value; }\n        }\n\n        public override SerializationBinder Binder\n        {\n            get { return _serializer.Binder; }\n            set { _serializer.Binder = value; }\n        }\n\n        public override StreamingContext Context\n        {\n            get { return _serializer.Context; }\n            set { _serializer.Context = value; }\n        }\n\n        public override Formatting Formatting\n        {\n            get { return _serializer.Formatting; }\n            set { _serializer.Formatting = value; }\n        }\n\n        public override DateFormatHandling DateFormatHandling\n        {\n            get { return _serializer.DateFormatHandling; }\n            set { _serializer.DateFormatHandling = value; }\n        }\n\n        public override DateTimeZoneHandling DateTimeZoneHandling\n        {\n            get { return _serializer.DateTimeZoneHandling; }\n            set { _serializer.DateTimeZoneHandling = value; }\n        }\n\n        public override DateParseHandling DateParseHandling\n        {\n            get { return _serializer.DateParseHandling; }\n            set { _serializer.DateParseHandling = value; }\n        }\n\n        public override FloatFormatHandling FloatFormatHandling\n        {\n            get { return _serializer.FloatFormatHandling; }\n            set { _serializer.FloatFormatHandling = value; }\n        }\n\n        public override FloatParseHandling FloatParseHandling\n        {\n            get { return _serializer.FloatParseHandling; }\n            set { _serializer.FloatParseHandling = value; }\n        }\n\n        public override StringEscapeHandling StringEscapeHandling\n        {\n            get { return _serializer.StringEscapeHandling; }\n            set { _serializer.StringEscapeHandling = value; }\n        }\n\n        public override string DateFormatString\n        {\n            get { return _serializer.DateFormatString; }\n            set { _serializer.DateFormatString = value; }\n        }\n\n        public override CultureInfo Culture\n        {\n            get { return _serializer.Culture; }\n            set { _serializer.Culture = value; }\n        }\n\n        public override int? MaxDepth\n        {\n            get { return _serializer.MaxDepth; }\n            set { _serializer.MaxDepth = value; }\n        }\n\n        public override bool CheckAdditionalContent\n        {\n            get { return _serializer.CheckAdditionalContent; }\n            set { _serializer.CheckAdditionalContent = value; }\n        }\n\n        internal JsonSerializerInternalBase GetInternalSerializer()\n        {\n            if (_serializerReader != null)\n                return _serializerReader;\n            else\n                return _serializerWriter;\n        }\n\n        public JsonSerializerProxy(JsonSerializerInternalReader serializerReader)\n        {\n            ValidationUtils.ArgumentNotNull(serializerReader, \"serializerReader\");\n\n            _serializerReader = serializerReader;\n            _serializer = serializerReader.Serializer;\n        }\n\n        public JsonSerializerProxy(JsonSerializerInternalWriter serializerWriter)\n        {\n            ValidationUtils.ArgumentNotNull(serializerWriter, \"serializerWriter\");\n\n            _serializerWriter = serializerWriter;\n            _serializer = serializerWriter.Serializer;\n        }\n\n        internal override object DeserializeInternal(JsonReader reader, Type objectType)\n        {\n            if (_serializerReader != null)\n                return _serializerReader.Deserialize(reader, objectType, false);\n            else\n                return _serializer.Deserialize(reader, objectType);\n        }\n\n        internal override void PopulateInternal(JsonReader reader, object target)\n        {\n            if (_serializerReader != null)\n                _serializerReader.Populate(reader, target);\n            else\n                _serializer.Populate(reader, target);\n        }\n\n        internal override void SerializeInternal(JsonWriter jsonWriter, object value, Type rootType)\n        {\n            if (_serializerWriter != null)\n                _serializerWriter.Serialize(jsonWriter, value, rootType);\n            else\n                _serializer.Serialize(jsonWriter, value);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonStringContract.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Contract details for a <see cref=\"Type\"/> used by the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    public class JsonStringContract : JsonPrimitiveContract\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"JsonStringContract\"/> class.\n        /// </summary>\n        /// <param name=\"underlyingType\">The underlying type for the contract.</param>\n        public JsonStringContract(Type underlyingType)\n            : base(underlyingType)\n        {\n            ContractType = JsonContractType.String;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/JsonTypeReflector.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.ComponentModel;\nusing System.Globalization;\nusing System.Reflection;\nusing System.Security;\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\nusing System.Security.Permissions;\n#endif\nusing Newtonsoft.Json.Utilities;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\nusing System.Runtime.Serialization;\n\nnamespace Newtonsoft.Json.Serialization\n{\n#if !NET20 && !NETFX_CORE\n    internal interface IMetadataTypeAttribute\n    {\n        Type MetadataClassType { get; }\n    }\n#endif\n\n    internal static class JsonTypeReflector\n    {\n        private static bool? _dynamicCodeGeneration;\n        private static bool? _fullyTrusted;\n\n        public const string IdPropertyName = \"$id\";\n        public const string RefPropertyName = \"$ref\";\n        public const string TypePropertyName = \"$type\";\n        public const string ValuePropertyName = \"$value\";\n        public const string ArrayValuesPropertyName = \"$values\";\n\n        public const string ShouldSerializePrefix = \"ShouldSerialize\";\n        public const string SpecifiedPostfix = \"Specified\";\n\n        private static readonly ThreadSafeStore<object, Type> JsonConverterTypeCache = new ThreadSafeStore<object, Type>(GetJsonConverterTypeFromAttribute);\n#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)\n        private static readonly ThreadSafeStore<Type, Type> AssociatedMetadataTypesCache = new ThreadSafeStore<Type, Type>(GetAssociateMetadataTypeFromAttribute);\n\n        private const string MetadataTypeAttributeTypeName =\n            \"System.ComponentModel.DataAnnotations.MetadataTypeAttribute, System.ComponentModel.DataAnnotations, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\";\n\n        private static Type _cachedMetadataTypeAttributeType;\n#endif\n\n        public static JsonContainerAttribute GetJsonContainerAttribute(Type type)\n        {\n            return CachedAttributeGetter<JsonContainerAttribute>.GetAttribute(type);\n        }\n\n        public static JsonObjectAttribute GetJsonObjectAttribute(Type type)\n        {\n            return GetJsonContainerAttribute(type) as JsonObjectAttribute;\n        }\n\n        public static JsonArrayAttribute GetJsonArrayAttribute(Type type)\n        {\n            return GetJsonContainerAttribute(type) as JsonArrayAttribute;\n        }\n\n        public static JsonDictionaryAttribute GetJsonDictionaryAttribute(Type type)\n        {\n            return GetJsonContainerAttribute(type) as JsonDictionaryAttribute;\n        }\n\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n        public static SerializableAttribute GetSerializableAttribute(Type type)\n        {\n            return CachedAttributeGetter<SerializableAttribute>.GetAttribute(type);\n        }\n#endif\n\n#if !NET20\n        public static DataContractAttribute GetDataContractAttribute(Type type)\n        {\n            // DataContractAttribute does not have inheritance\n            Type currentType = type;\n\n            while (currentType != null)\n            {\n                DataContractAttribute result = CachedAttributeGetter<DataContractAttribute>.GetAttribute(currentType);\n                if (result != null)\n                    return result;\n\n                currentType = currentType.BaseType();\n            }\n\n            return null;\n        }\n\n        public static DataMemberAttribute GetDataMemberAttribute(MemberInfo memberInfo)\n        {\n            // DataMemberAttribute does not have inheritance\n\n            // can't override a field\n            if (memberInfo.MemberType() == MemberTypes.Field)\n                return CachedAttributeGetter<DataMemberAttribute>.GetAttribute(memberInfo);\n\n            // search property and then search base properties if nothing is returned and the property is virtual\n            PropertyInfo propertyInfo = (PropertyInfo)memberInfo;\n            DataMemberAttribute result = CachedAttributeGetter<DataMemberAttribute>.GetAttribute(propertyInfo);\n            if (result == null)\n            {\n                if (propertyInfo.IsVirtual())\n                {\n                    Type currentType = propertyInfo.DeclaringType;\n\n                    while (result == null && currentType != null)\n                    {\n                        PropertyInfo baseProperty = (PropertyInfo)ReflectionUtils.GetMemberInfoFromType(currentType, propertyInfo);\n                        if (baseProperty != null && baseProperty.IsVirtual())\n                            result = CachedAttributeGetter<DataMemberAttribute>.GetAttribute(baseProperty);\n\n                        currentType = currentType.BaseType();\n                    }\n                }\n            }\n\n            return result;\n        }\n#endif\n\n        public static MemberSerialization GetObjectMemberSerialization(Type objectType, bool ignoreSerializableAttribute)\n        {\n            JsonObjectAttribute objectAttribute = GetJsonObjectAttribute(objectType);\n            if (objectAttribute != null)\n                return objectAttribute.MemberSerialization;\n\n#if !NET20\n            DataContractAttribute dataContractAttribute = GetDataContractAttribute(objectType);\n            if (dataContractAttribute != null)\n                return MemberSerialization.OptIn;\n#endif\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            if (!ignoreSerializableAttribute)\n            {\n                SerializableAttribute serializableAttribute = GetSerializableAttribute(objectType);\n                if (serializableAttribute != null)\n                    return MemberSerialization.Fields;\n            }\n#endif\n\n            // the default\n            return MemberSerialization.OptOut;\n        }\n\n        private static Type GetJsonConverterType(object attributeProvider)\n        {\n            return JsonConverterTypeCache.Get(attributeProvider);\n        }\n\n        private static Type GetJsonConverterTypeFromAttribute(object attributeProvider)\n        {\n            JsonConverterAttribute converterAttribute = GetAttribute<JsonConverterAttribute>(attributeProvider);\n            return (converterAttribute != null)\n                ? converterAttribute.ConverterType\n                : null;\n        }\n\n        public static JsonConverter GetJsonConverter(object attributeProvider, Type targetConvertedType)\n        {\n            Type converterType = GetJsonConverterType(attributeProvider);\n\n            if (converterType != null)\n            {\n                JsonConverter memberConverter = JsonConverterAttribute.CreateJsonConverterInstance(converterType);\n\n                return memberConverter;\n            }\n\n            return null;\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        public static TypeConverter GetTypeConverter(Type type)\n        {\n            return TypeDescriptor.GetConverter(type);\n        }\n#endif\n\n#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)\n        private static Type GetAssociatedMetadataType(Type type)\n        {\n            return AssociatedMetadataTypesCache.Get(type);\n        }\n\n        private static Type GetAssociateMetadataTypeFromAttribute(Type type)\n        {\n            Type metadataTypeAttributeType = GetMetadataTypeAttributeType();\n            if (metadataTypeAttributeType == null)\n                return null;\n\n            object attribute = type.GetCustomAttributes(metadataTypeAttributeType, true).SingleOrDefault();\n            if (attribute == null)\n                return null;\n\n            IMetadataTypeAttribute metadataTypeAttribute = (DynamicCodeGeneration)\n                ? DynamicWrapper.CreateWrapper<IMetadataTypeAttribute>(attribute)\n                : new LateBoundMetadataTypeAttribute(attribute);\n\n            return metadataTypeAttribute.MetadataClassType;\n        }\n\n        private static Type GetMetadataTypeAttributeType()\n        {\n            // always attempt to get the metadata type attribute type\n            // the assembly may have been loaded since last time\n            if (_cachedMetadataTypeAttributeType == null)\n            {\n                Type metadataTypeAttributeType = Type.GetType(MetadataTypeAttributeTypeName);\n\n                if (metadataTypeAttributeType != null)\n                    _cachedMetadataTypeAttributeType = metadataTypeAttributeType;\n                else\n                    return null;\n            }\n\n            return _cachedMetadataTypeAttributeType;\n        }\n#endif\n\n        private static T GetAttribute<T>(Type type) where T : Attribute\n        {\n            T attribute;\n\n#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)\n            Type metadataType = GetAssociatedMetadataType(type);\n            if (metadataType != null)\n            {\n                attribute = ReflectionUtils.GetAttribute<T>(metadataType, true);\n                if (attribute != null)\n                    return attribute;\n            }\n#endif\n\n            attribute = ReflectionUtils.GetAttribute<T>(type, true);\n            if (attribute != null)\n                return attribute;\n\n            foreach (Type typeInterface in type.GetInterfaces())\n            {\n                attribute = ReflectionUtils.GetAttribute<T>(typeInterface, true);\n                if (attribute != null)\n                    return attribute;\n            }\n\n            return null;\n        }\n\n        private static T GetAttribute<T>(MemberInfo memberInfo) where T : Attribute\n        {\n            T attribute;\n\n#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)\n            Type metadataType = GetAssociatedMetadataType(memberInfo.DeclaringType);\n            if (metadataType != null)\n            {\n                MemberInfo metadataTypeMemberInfo = ReflectionUtils.GetMemberInfoFromType(metadataType, memberInfo);\n\n                if (metadataTypeMemberInfo != null)\n                {\n                    attribute = ReflectionUtils.GetAttribute<T>(metadataTypeMemberInfo, true);\n                    if (attribute != null)\n                        return attribute;\n                }\n            }\n#endif\n\n            attribute = ReflectionUtils.GetAttribute<T>(memberInfo, true);\n            if (attribute != null)\n                return attribute;\n\n            if (memberInfo.DeclaringType != null)\n            {\n                foreach (Type typeInterface in memberInfo.DeclaringType.GetInterfaces())\n                {\n                    MemberInfo interfaceTypeMemberInfo = ReflectionUtils.GetMemberInfoFromType(typeInterface, memberInfo);\n\n                    if (interfaceTypeMemberInfo != null)\n                    {\n                        attribute = ReflectionUtils.GetAttribute<T>(interfaceTypeMemberInfo, true);\n                        if (attribute != null)\n                            return attribute;\n                    }\n                }\n            }\n\n            return null;\n        }\n\n        public static T GetAttribute<T>(object provider) where T : Attribute\n        {\n            Type type = provider as Type;\n            if (type != null)\n                return GetAttribute<T>(type);\n\n            MemberInfo memberInfo = provider as MemberInfo;\n            if (memberInfo != null)\n                return GetAttribute<T>(memberInfo);\n\n            return ReflectionUtils.GetAttribute<T>(provider, true);\n        }\n\n#if DEBUG\n        internal static void SetFullyTrusted(bool fullyTrusted)\n        {\n            _fullyTrusted = fullyTrusted;\n        }\n\n        internal static void SetDynamicCodeGeneration(bool dynamicCodeGeneration)\n        {\n            _dynamicCodeGeneration = dynamicCodeGeneration;\n        }\n#endif\n\n        public static bool DynamicCodeGeneration\n        {\n#if !(NET20 || NET35 || NETFX_CORE || PORTABLE)\n            [SecuritySafeCritical]\n#endif\n                get\n            {\n                if (_dynamicCodeGeneration == null)\n                {\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n                    try\n                    {\n                        new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Demand();\n                        new ReflectionPermission(ReflectionPermissionFlag.RestrictedMemberAccess).Demand();\n                        new SecurityPermission(SecurityPermissionFlag.SkipVerification).Demand();\n                        new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();\n                        new SecurityPermission(PermissionState.Unrestricted).Demand();\n                        _dynamicCodeGeneration = true;\n                    }\n                    catch (Exception)\n                    {\n                        _dynamicCodeGeneration = false;\n                    }\n#else\n                    _dynamicCodeGeneration = false;\n#endif\n                }\n\n                return _dynamicCodeGeneration.Value;\n            }\n        }\n\n        public static bool FullyTrusted\n        {\n            get\n            {\n                if (_fullyTrusted == null)\n                {\n#if (NETFX_CORE || PORTABLE || PORTABLE40)\n                    _fullyTrusted = false;\n#elif !(NET20 || NET35 || PORTABLE40)\n                    AppDomain appDomain = AppDomain.CurrentDomain;\n\n                    _fullyTrusted = appDomain.IsHomogenous && appDomain.IsFullyTrusted;\n#else\n          try\n          {\n            new SecurityPermission(PermissionState.Unrestricted).Demand();\n            _fullyTrusted = true;\n          }\n          catch (Exception)\n          {\n            _fullyTrusted = false;\n          }\n#endif\n                }\n\n                return _fullyTrusted.Value;\n            }\n        }\n\n        public static ReflectionDelegateFactory ReflectionDelegateFactory\n        {\n            get\n            {\n#if !(PORTABLE40 || PORTABLE || NETFX_CORE)\n                if (DynamicCodeGeneration)\n                    return DynamicReflectionDelegateFactory.Instance;\n\n                return LateBoundReflectionDelegateFactory.Instance;\n#elif !(PORTABLE40)\n        return ExpressionReflectionDelegateFactory.Instance;\n#else\n                return LateBoundReflectionDelegateFactory.Instance;\n#endif\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/LateBoundMetadataTypeAttribute.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !NET20 && !NETFX_CORE\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Newtonsoft.Json.Utilities;\nusing System.Reflection;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal class LateBoundMetadataTypeAttribute : IMetadataTypeAttribute\n    {\n        private static PropertyInfo _metadataClassTypeProperty;\n\n        private readonly object _attribute;\n\n        public LateBoundMetadataTypeAttribute(object attribute)\n        {\n            _attribute = attribute;\n        }\n\n        public Type MetadataClassType\n        {\n            get\n            {\n                if (_metadataClassTypeProperty == null)\n                    _metadataClassTypeProperty = _attribute.GetType().GetProperty(\"MetadataClassType\");\n\n                return (Type)ReflectionUtils.GetMemberValue(_metadataClassTypeProperty, _attribute);\n            }\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Serialization/MemoryTraceWriter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Text;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Represents a trace writer that writes to memory. When the trace message limit is\n    /// reached then old trace messages will be removed as new messages are added.\n    /// </summary>\n    public class MemoryTraceWriter : ITraceWriter\n    {\n        private readonly Queue<string> _traceMessages;\n\n        /// <summary>\n        /// Gets the <see cref=\"TraceLevel\"/> that will be used to filter the trace messages passed to the writer.\n        /// For example a filter level of <code>Info</code> will exclude <code>Verbose</code> messages and include <code>Info</code>,\n        /// <code>Warning</code> and <code>Error</code> messages.\n        /// </summary>\n        /// <value>\n        /// The <see cref=\"TraceLevel\"/> that will be used to filter the trace messages passed to the writer.\n        /// </value>\n        public TraceLevel LevelFilter { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"MemoryTraceWriter\"/> class.\n        /// </summary>\n        public MemoryTraceWriter()\n        {\n            LevelFilter = TraceLevel.Verbose;\n            _traceMessages = new Queue<string>();\n        }\n\n        /// <summary>\n        /// Writes the specified trace level, message and optional exception.\n        /// </summary>\n        /// <param name=\"level\">The <see cref=\"TraceLevel\"/> at which to write this trace.</param>\n        /// <param name=\"message\">The trace message.</param>\n        /// <param name=\"ex\">The trace exception. This parameter is optional.</param>\n        public void Trace(TraceLevel level, string message, Exception ex)\n        {\n            string traceMessage = DateTime.Now.ToString(\"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff\", CultureInfo.InvariantCulture) + \" \" + level.ToString(\"g\") + \" \" + message;\n\n            if (_traceMessages.Count >= 1000)\n                _traceMessages.Dequeue();\n\n            _traceMessages.Enqueue(traceMessage);\n        }\n\n        /// <summary>\n        /// Returns an enumeration of the most recent trace messages.\n        /// </summary>\n        /// <returns>An enumeration of the most recent trace messages.</returns>\n        public IEnumerable<string> GetTraceMessages()\n        {\n            return _traceMessages;\n        }\n\n        /// <summary>\n        /// Returns a <see cref=\"String\"/> of the most recent trace messages.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"String\"/> of the most recent trace messages.\n        /// </returns>\n        public override string ToString()\n        {\n            StringBuilder sb = new StringBuilder();\n            foreach (string traceMessage in _traceMessages)\n            {\n                if (sb.Length > 0)\n                    sb.AppendLine();\n\n                sb.Append(traceMessage);\n            }\n\n            return sb.ToString();\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/ObjectConstructor.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Represents a method that constructs an object.\n    /// </summary>\n    /// <typeparam name=\"T\">The object type to create.</typeparam>\n    public delegate object ObjectConstructor<T>(params object[] args);\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/OnErrorAttribute.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// When applied to a method, specifies that the method is called when an error occurs serializing an object.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Method, Inherited = false)]\n    public sealed class OnErrorAttribute : Attribute\n    {\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/ReflectionValueProvider.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Reflection;\nusing Newtonsoft.Json.Utilities;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    /// <summary>\n    /// Get and set values for a <see cref=\"MemberInfo\"/> using reflection.\n    /// </summary>\n    public class ReflectionValueProvider : IValueProvider\n    {\n        private readonly MemberInfo _memberInfo;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ReflectionValueProvider\"/> class.\n        /// </summary>\n        /// <param name=\"memberInfo\">The member info.</param>\n        public ReflectionValueProvider(MemberInfo memberInfo)\n        {\n            ValidationUtils.ArgumentNotNull(memberInfo, \"memberInfo\");\n            _memberInfo = memberInfo;\n        }\n\n        /// <summary>\n        /// Sets the value.\n        /// </summary>\n        /// <param name=\"target\">The target to set the value on.</param>\n        /// <param name=\"value\">The value to set on the target.</param>\n        public void SetValue(object target, object value)\n        {\n            try\n            {\n                ReflectionUtils.SetMemberValue(_memberInfo, target, value);\n            }\n            catch (Exception ex)\n            {\n                throw new JsonSerializationException(\"Error setting value to '{0}' on '{1}'.\".FormatWith(CultureInfo.InvariantCulture, _memberInfo.Name, target.GetType()), ex);\n            }\n        }\n\n        /// <summary>\n        /// Gets the value.\n        /// </summary>\n        /// <param name=\"target\">The target to get the value from.</param>\n        /// <returns>The value.</returns>\n        public object GetValue(object target)\n        {\n            try\n            {\n                return ReflectionUtils.GetMemberValue(_memberInfo, target);\n            }\n            catch (Exception ex)\n            {\n                throw new JsonSerializationException(\"Error getting value from '{0}' on '{1}'.\".FormatWith(CultureInfo.InvariantCulture, _memberInfo.Name, target.GetType()), ex);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/TraceJsonReader.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal class TraceJsonReader : JsonReader, IJsonLineInfo\n    {\n        private readonly JsonReader _innerReader;\n        private readonly JsonTextWriter _textWriter;\n        private readonly StringWriter _sw;\n\n        public TraceJsonReader(JsonReader innerReader)\n        {\n            _innerReader = innerReader;\n\n            _sw = new StringWriter(CultureInfo.InvariantCulture);\n            _textWriter = new JsonTextWriter(_sw);\n            _textWriter.Formatting = Formatting.Indented;\n        }\n\n        public string GetJson()\n        {\n            return _sw.ToString();\n        }\n\n        public override bool Read()\n        {\n            var value = _innerReader.Read();\n            _textWriter.WriteToken(_innerReader, false, false);\n            return value;\n        }\n\n        public override int? ReadAsInt32()\n        {\n            var value = _innerReader.ReadAsInt32();\n            _textWriter.WriteToken(_innerReader, false, false);\n            return value;\n        }\n\n        public override string ReadAsString()\n        {\n            var value = _innerReader.ReadAsString();\n            _textWriter.WriteToken(_innerReader, false, false);\n            return value;\n        }\n\n        public override byte[] ReadAsBytes()\n        {\n            var value = _innerReader.ReadAsBytes();\n            _textWriter.WriteToken(_innerReader, false, false);\n            return value;\n        }\n\n        public override decimal? ReadAsDecimal()\n        {\n            var value = _innerReader.ReadAsDecimal();\n            _textWriter.WriteToken(_innerReader, false, false);\n            return value;\n        }\n\n        public override DateTime? ReadAsDateTime()\n        {\n            var value = _innerReader.ReadAsDateTime();\n            _textWriter.WriteToken(_innerReader, false, false);\n            return value;\n        }\n\n#if !NET20\n        public override DateTimeOffset? ReadAsDateTimeOffset()\n        {\n            var value = _innerReader.ReadAsDateTimeOffset();\n            _textWriter.WriteToken(_innerReader, false, false);\n            return value;\n        }\n#endif\n\n        public override int Depth\n        {\n            get { return _innerReader.Depth; }\n        }\n\n        public override string Path\n        {\n            get { return _innerReader.Path; }\n        }\n\n        public override char QuoteChar\n        {\n            get { return _innerReader.QuoteChar; }\n            protected internal set { _innerReader.QuoteChar = value; }\n        }\n\n        public override JsonToken TokenType\n        {\n            get { return _innerReader.TokenType; }\n        }\n\n        public override object Value\n        {\n            get { return _innerReader.Value; }\n        }\n\n        public override Type ValueType\n        {\n            get { return _innerReader.ValueType; }\n        }\n\n        public override void Close()\n        {\n            _innerReader.Close();\n        }\n\n        bool IJsonLineInfo.HasLineInfo()\n        {\n            IJsonLineInfo lineInfo = _innerReader as IJsonLineInfo;\n            return lineInfo != null && lineInfo.HasLineInfo();\n        }\n\n        int IJsonLineInfo.LineNumber\n        {\n            get\n            {\n                IJsonLineInfo lineInfo = _innerReader as IJsonLineInfo;\n                return (lineInfo != null) ? lineInfo.LineNumber : 0;\n            }\n        }\n\n        int IJsonLineInfo.LinePosition\n        {\n            get\n            {\n                IJsonLineInfo lineInfo = _innerReader as IJsonLineInfo;\n                return (lineInfo != null) ? lineInfo.LinePosition : 0;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Serialization/TraceJsonWriter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\n#if !(NET20 || NET35 || PORTABLE || PORTABLE40)\nusing System.Numerics;\n#endif\nusing System.Text;\n\nnamespace Newtonsoft.Json.Serialization\n{\n    internal class TraceJsonWriter : JsonWriter\n    {\n        private readonly JsonWriter _innerWriter;\n        private readonly JsonTextWriter _textWriter;\n        private readonly StringWriter _sw;\n\n        public TraceJsonWriter(JsonWriter innerWriter)\n        {\n            _innerWriter = innerWriter;\n\n            _sw = new StringWriter(CultureInfo.InvariantCulture);\n            _textWriter = new JsonTextWriter(_sw);\n            _textWriter.Formatting = Formatting.Indented;\n            _textWriter.Culture = innerWriter.Culture;\n            _textWriter.DateFormatHandling = innerWriter.DateFormatHandling;\n            _textWriter.DateFormatString = innerWriter.DateFormatString;\n            _textWriter.DateTimeZoneHandling = innerWriter.DateTimeZoneHandling;\n            _textWriter.FloatFormatHandling = innerWriter.FloatFormatHandling;\n        }\n\n        public string GetJson()\n        {\n            return _sw.ToString();\n        }\n\n        public override void WriteValue(decimal value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(bool value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(byte value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(byte? value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(char value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(byte[] value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(DateTime value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n#if !NET20\n        public override void WriteValue(DateTimeOffset value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n#endif\n\n        public override void WriteValue(double value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteUndefined()\n        {\n            _textWriter.WriteUndefined();\n            _innerWriter.WriteUndefined();\n            base.WriteUndefined();\n        }\n\n        public override void WriteNull()\n        {\n            _textWriter.WriteNull();\n            _innerWriter.WriteNull();\n            base.WriteUndefined();\n        }\n\n        public override void WriteValue(float value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(Guid value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(int value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(long value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(object value)\n        {\n#if !(NET20 || NET35 || PORTABLE || PORTABLE40)\n            if (value is BigInteger)\n            {\n                _textWriter.WriteValue(value);\n                _innerWriter.WriteValue(value);\n                InternalWriteValue(JsonToken.Integer);\n            }\n            else\n#endif\n            {\n                _textWriter.WriteValue(value);\n                _innerWriter.WriteValue(value);\n                base.WriteValue(value);\n            }\n        }\n\n        public override void WriteValue(sbyte value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(short value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(string value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(TimeSpan value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(uint value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(ulong value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(Uri value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteValue(ushort value)\n        {\n            _textWriter.WriteValue(value);\n            _innerWriter.WriteValue(value);\n            base.WriteValue(value);\n        }\n\n        public override void WriteWhitespace(string ws)\n        {\n            _textWriter.WriteWhitespace(ws);\n            _innerWriter.WriteWhitespace(ws);\n            base.WriteWhitespace(ws);\n        }\n\n        //protected override void WriteValueDelimiter()\n        //{\n        //  _textWriter.WriteValueDelimiter();\n        //  _innerWriter.WriteValueDelimiter();\n        //  base.WriteValueDelimiter();\n        //}\n\n        //protected override void WriteIndent()\n        //{\n        //  base.WriteIndent();\n        //}\n\n        public override void WriteComment(string text)\n        {\n            _textWriter.WriteComment(text);\n            _innerWriter.WriteComment(text);\n            base.WriteComment(text);\n        }\n\n        //public override void WriteEnd()\n        //{\n        //  _textWriter.WriteEnd();\n        //  _innerWriter.WriteEnd();\n        //  base.WriteEnd();\n        //}\n\n        //protected override void WriteEnd(JsonToken token)\n        //{\n        //  base.WriteEnd(token);\n        //}\n\n        public override void WriteStartArray()\n        {\n            _textWriter.WriteStartArray();\n            _innerWriter.WriteStartArray();\n            base.WriteStartArray();\n        }\n\n        public override void WriteEndArray()\n        {\n            _textWriter.WriteEndArray();\n            _innerWriter.WriteEndArray();\n            base.WriteEndArray();\n        }\n\n        public override void WriteStartConstructor(string name)\n        {\n            _textWriter.WriteStartConstructor(name);\n            _innerWriter.WriteStartConstructor(name);\n            base.WriteStartConstructor(name);\n        }\n\n        public override void WriteEndConstructor()\n        {\n            _textWriter.WriteEndConstructor();\n            _innerWriter.WriteEndConstructor();\n            base.WriteEndConstructor();\n        }\n\n        public override void WritePropertyName(string name)\n        {\n            _textWriter.WritePropertyName(name);\n            _innerWriter.WritePropertyName(name);\n            base.WritePropertyName(name);\n        }\n\n        public override void WritePropertyName(string name, bool escape)\n        {\n            _textWriter.WritePropertyName(name, escape);\n            _innerWriter.WritePropertyName(name, escape);\n\n            // method with escape will error\n            base.WritePropertyName(name);\n        }\n\n        public override void WriteStartObject()\n        {\n            _textWriter.WriteStartObject();\n            _innerWriter.WriteStartObject();\n            base.WriteStartObject();\n        }\n\n        public override void WriteEndObject()\n        {\n            _textWriter.WriteEndObject();\n            _innerWriter.WriteEndObject();\n            base.WriteEndObject();\n        }\n\n        public override void WriteRaw(string json)\n        {\n            _textWriter.WriteRaw(json);\n            _innerWriter.WriteRaw(json);\n            base.WriteRaw(json);\n        }\n\n        public override void WriteRawValue(string json)\n        {\n            _textWriter.WriteRawValue(json);\n            _innerWriter.WriteRawValue(json);\n            base.WriteRawValue(json);\n        }\n\n        //protected override void WriteIndentSpace()\n        //{\n        //  _textWriter.WriteIndentSpace();\n        //  _innerWriter.WriteIndentSpace();\n        //  base.WriteIndentSpace();\n        //}\n\n        public override void Close()\n        {\n            _textWriter.Close();\n            _innerWriter.Close();\n            base.Close();\n        }\n\n        public override void Flush()\n        {\n            _textWriter.Flush();\n            _innerWriter.Flush();\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/SerializationBinder.cs",
    "content": "﻿\n#if PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE\nusing System;\nusing System.Reflection;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Allows users to control class loading and mandate what class to load.\n    /// </summary>\n    public abstract class SerializationBinder\n    {\n        /// <summary>\n        /// When overridden in a derived class, controls the binding of a serialized object to a type.\n        /// </summary>\n        /// <param name=\"assemblyName\">Specifies the <see cref=\"Assembly\"/> name of the serialized object.</param>\n        /// <param name=\"typeName\">Specifies the <see cref=\"Type\"/> name of the serialized object</param>\n        /// <returns>The type of the object the formatter creates a new instance of.</returns>\n        public abstract Type BindToType(string assemblyName, string typeName);\n\n        /// <summary>\n        /// When overridden in a derived class, controls the binding of a serialized object to a type.\n        /// </summary>\n        /// <param name=\"serializedType\">The type of the object the formatter creates a new instance of.</param>\n        /// <param name=\"assemblyName\">Specifies the <see cref=\"Assembly\"/> name of the serialized object.</param>\n        /// <param name=\"typeName\">Specifies the <see cref=\"Type\"/> name of the serialized object.</param>\n        public virtual void BindToName(Type serializedType, out string assemblyName, out string typeName)\n        {\n            assemblyName = null;\n            typeName = null;\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/StringEscapeHandling.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies how strings are escaped when writing JSON text.\n    /// </summary>\n    public enum StringEscapeHandling\n    {\n        /// <summary>\n        /// Only control characters (e.g. newline) are escaped.\n        /// </summary>\n        Default,\n\n        /// <summary>\n        /// All non-ASCII and control characters (e.g. newline) are escaped.\n        /// </summary>\n        EscapeNonAscii,\n\n        /// <summary>\n        /// HTML (&lt;, &gt;, &amp;, &apos;, &quot;) and control characters (e.g. newline) are escaped.\n        /// </summary>\n        EscapeHtml\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/TraceLevel.cs",
    "content": "﻿\n#if (NETFX_CORE || PORTABLE40 || PORTABLE)\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies what messages to output for the <see cref=\"ITraceWriter\"/> class.\n    /// </summary>\n    public enum TraceLevel\n    {\n        /// <summary>\n        /// Output no tracing and debugging messages.\n        /// </summary>\n        Off,\n\n        /// <summary>\n        /// Output error-handling messages.\n        /// </summary>\n        Error,\n\n        /// <summary>\n        /// Output warnings and error-handling messages.\n        /// </summary>\n        Warning,\n\n        /// <summary>\n        /// Output informational messages, warnings, and error-handling messages.\n        /// </summary>\n        Info,\n\n        /// <summary>\n        /// Output all debugging and tracing messages.\n        /// </summary>\n        Verbose\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/TypeNameHandling.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies type name handling options for the <see cref=\"JsonSerializer\"/>.\n    /// </summary>\n    [Flags]\n    public enum TypeNameHandling\n    {\n        /// <summary>\n        /// Do not include the .NET type name when serializing types.\n        /// </summary>\n        None = 0,\n\n        /// <summary>\n        /// Include the .NET type name when serializing into a JSON object structure.\n        /// </summary>\n        Objects = 1,\n\n        /// <summary>\n        /// Include the .NET type name when serializing into a JSON array structure.\n        /// </summary>\n        Arrays = 2,\n\n        /// <summary>\n        /// Always include the .NET type name when serializing.\n        /// </summary>\n        All = Objects | Arrays,\n\n        /// <summary>\n        /// Include the .NET type name when the type of the object being serialized is not the same as its declared type.\n        /// </summary>\n        Auto = 4\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/Base64Encoder.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.IO;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal class Base64Encoder\n    {\n        private const int Base64LineSize = 76;\n        private const int LineSizeInBytes = 57;\n\n        private readonly char[] _charsLine = new char[Base64LineSize];\n        private readonly TextWriter _writer;\n\n        private byte[] _leftOverBytes;\n        private int _leftOverBytesCount;\n\n        public Base64Encoder(TextWriter writer)\n        {\n            ValidationUtils.ArgumentNotNull(writer, \"writer\");\n            _writer = writer;\n        }\n\n        public void Encode(byte[] buffer, int index, int count)\n        {\n            if (buffer == null)\n                throw new ArgumentNullException(\"buffer\");\n\n            if (index < 0)\n                throw new ArgumentOutOfRangeException(\"index\");\n\n            if (count < 0)\n                throw new ArgumentOutOfRangeException(\"count\");\n\n            if (count > (buffer.Length - index))\n                throw new ArgumentOutOfRangeException(\"count\");\n\n            if (_leftOverBytesCount > 0)\n            {\n                int leftOverBytesCount = _leftOverBytesCount;\n                while (leftOverBytesCount < 3 && count > 0)\n                {\n                    _leftOverBytes[leftOverBytesCount++] = buffer[index++];\n                    count--;\n                }\n                if (count == 0 && leftOverBytesCount < 3)\n                {\n                    _leftOverBytesCount = leftOverBytesCount;\n                    return;\n                }\n                int num2 = Convert.ToBase64CharArray(_leftOverBytes, 0, 3, _charsLine, 0);\n                WriteChars(_charsLine, 0, num2);\n            }\n            _leftOverBytesCount = count % 3;\n            if (_leftOverBytesCount > 0)\n            {\n                count -= _leftOverBytesCount;\n                if (_leftOverBytes == null)\n                {\n                    _leftOverBytes = new byte[3];\n                }\n                for (int i = 0; i < _leftOverBytesCount; i++)\n                {\n                    _leftOverBytes[i] = buffer[(index + count) + i];\n                }\n            }\n            int num4 = index + count;\n            int length = LineSizeInBytes;\n            while (index < num4)\n            {\n                if ((index + length) > num4)\n                {\n                    length = num4 - index;\n                }\n                int num6 = Convert.ToBase64CharArray(buffer, index, length, _charsLine, 0);\n                WriteChars(_charsLine, 0, num6);\n                index += length;\n            }\n        }\n\n        public void Flush()\n        {\n            if (_leftOverBytesCount > 0)\n            {\n                int count = Convert.ToBase64CharArray(_leftOverBytes, 0, _leftOverBytesCount, _charsLine, 0);\n                WriteChars(_charsLine, 0, count);\n                _leftOverBytesCount = 0;\n            }\n        }\n\n        private void WriteChars(char[] chars, int index, int count)\n        {\n            _writer.Write(chars, index, count);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/BidirectionalDictionary.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal class BidirectionalDictionary<TFirst, TSecond>\n    {\n        private readonly IDictionary<TFirst, TSecond> _firstToSecond;\n        private readonly IDictionary<TSecond, TFirst> _secondToFirst;\n        private readonly string _duplicateFirstErrorMessage;\n        private readonly string _duplicateSecondErrorMessage;\n\n        public BidirectionalDictionary()\n            : this(EqualityComparer<TFirst>.Default, EqualityComparer<TSecond>.Default)\n        {\n        }\n\n        public BidirectionalDictionary(IEqualityComparer<TFirst> firstEqualityComparer, IEqualityComparer<TSecond> secondEqualityComparer)\n            : this(\n                firstEqualityComparer,\n                secondEqualityComparer,\n                \"Duplicate item already exists for '{0}'.\",\n                \"Duplicate item already exists for '{0}'.\")\n        {\n        }\n\n        public BidirectionalDictionary(IEqualityComparer<TFirst> firstEqualityComparer, IEqualityComparer<TSecond> secondEqualityComparer,\n            string duplicateFirstErrorMessage, string duplicateSecondErrorMessage)\n        {\n            _firstToSecond = new Dictionary<TFirst, TSecond>(firstEqualityComparer);\n            _secondToFirst = new Dictionary<TSecond, TFirst>(secondEqualityComparer);\n            _duplicateFirstErrorMessage = duplicateFirstErrorMessage;\n            _duplicateSecondErrorMessage = duplicateSecondErrorMessage;\n        }\n\n        public void Set(TFirst first, TSecond second)\n        {\n            TFirst existingFirst;\n            TSecond existingSecond;\n\n            if (_firstToSecond.TryGetValue(first, out existingSecond))\n            {\n                if (!existingSecond.Equals(second))\n                    throw new ArgumentException(_duplicateFirstErrorMessage.FormatWith(CultureInfo.InvariantCulture, first));\n            }\n\n            if (_secondToFirst.TryGetValue(second, out existingFirst))\n            {\n                if (!existingFirst.Equals(first))\n                    throw new ArgumentException(_duplicateSecondErrorMessage.FormatWith(CultureInfo.InvariantCulture, second));\n            }\n\n            _firstToSecond.Add(first, second);\n            _secondToFirst.Add(second, first);\n        }\n\n        public bool TryGetByFirst(TFirst first, out TSecond second)\n        {\n            return _firstToSecond.TryGetValue(first, out second);\n        }\n\n        public bool TryGetBySecond(TSecond second, out TFirst first)\n        {\n            return _secondToFirst.TryGetValue(second, out first);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/CollectionUtils.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Reflection;\nusing System.Text;\nusing System.Collections;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\nusing System.Globalization;\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class CollectionUtils\n    {\n        /// <summary>\n        /// Determines whether the collection is null or empty.\n        /// </summary>\n        /// <param name=\"collection\">The collection.</param>\n        /// <returns>\n        /// \t<c>true</c> if the collection is null or empty; otherwise, <c>false</c>.\n        /// </returns>\n        public static bool IsNullOrEmpty<T>(ICollection<T> collection)\n        {\n            if (collection != null)\n            {\n                return (collection.Count == 0);\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Adds the elements of the specified collection to the specified generic IList.\n        /// </summary>\n        /// <param name=\"initial\">The list to add to.</param>\n        /// <param name=\"collection\">The collection of elements to add.</param>\n        public static void AddRange<T>(this IList<T> initial, IEnumerable<T> collection)\n        {\n            if (initial == null)\n                throw new ArgumentNullException(\"initial\");\n\n            if (collection == null)\n                return;\n\n            foreach (T value in collection)\n            {\n                initial.Add(value);\n            }\n        }\n\n#if (NET20 || NET35 || PORTABLE40)\n        public static void AddRange<T>(this IList<T> initial, IEnumerable collection)\n        {\n            ValidationUtils.ArgumentNotNull(initial, \"initial\");\n\n            // because earlier versions of .NET didn't support covariant generics\n            initial.AddRange(collection.Cast<T>());\n        }\n#endif\n\n        public static bool IsDictionaryType(Type type)\n        {\n            ValidationUtils.ArgumentNotNull(type, \"type\");\n\n            if (typeof(IDictionary).IsAssignableFrom(type))\n                return true;\n            if (ReflectionUtils.ImplementsGenericDefinition(type, typeof(IDictionary<,>)))\n                return true;\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            if (ReflectionUtils.ImplementsGenericDefinition(type, typeof(IReadOnlyDictionary<,>)))\n                return true;\n#endif\n\n            return false;\n        }\n\n        public static ConstructorInfo ResolveEnumableCollectionConstructor(Type collectionType, Type collectionItemType)\n        {\n            Type genericEnumerable = typeof(IEnumerable<>).MakeGenericType(collectionItemType);\n\n            foreach (ConstructorInfo constructor in collectionType.GetConstructors(BindingFlags.Public | BindingFlags.Instance))\n            {\n                IList<ParameterInfo> parameters = constructor.GetParameters();\n\n                if (parameters.Count == 1)\n                {\n                    if (genericEnumerable.IsAssignableFrom(parameters[0].ParameterType))\n                        return constructor;\n                }\n            }\n\n            return null;\n        }\n\n        public static bool AddDistinct<T>(this IList<T> list, T value)\n        {\n            return list.AddDistinct(value, EqualityComparer<T>.Default);\n        }\n\n        public static bool AddDistinct<T>(this IList<T> list, T value, IEqualityComparer<T> comparer)\n        {\n            if (list.ContainsValue(value, comparer))\n                return false;\n\n            list.Add(value);\n            return true;\n        }\n\n        // this is here because LINQ Bridge doesn't support Contains with IEqualityComparer<T>\n        public static bool ContainsValue<TSource>(this IEnumerable<TSource> source, TSource value, IEqualityComparer<TSource> comparer)\n        {\n            if (comparer == null)\n                comparer = EqualityComparer<TSource>.Default;\n\n            if (source == null)\n                throw new ArgumentNullException(\"source\");\n\n            foreach (TSource local in source)\n            {\n                if (comparer.Equals(local, value))\n                    return true;\n            }\n\n            return false;\n        }\n\n        public static bool AddRangeDistinct<T>(this IList<T> list, IEnumerable<T> values, IEqualityComparer<T> comparer)\n        {\n            bool allAdded = true;\n            foreach (T value in values)\n            {\n                if (!list.AddDistinct(value, comparer))\n                    allAdded = false;\n            }\n\n            return allAdded;\n        }\n\n        public static int IndexOf<T>(this IEnumerable<T> collection, Func<T, bool> predicate)\n        {\n            int index = 0;\n            foreach (T value in collection)\n            {\n                if (predicate(value))\n                    return index;\n\n                index++;\n            }\n\n            return -1;\n        }\n\n        /// <summary>\n        /// Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer.\n        /// </summary>\n        /// <typeparam name=\"TSource\">The type of the elements of source.</typeparam>\n        /// <param name=\"list\">A sequence in which to locate a value.</param>\n        /// <param name=\"value\">The object to locate in the sequence</param>\n        /// <param name=\"comparer\">An equality comparer to compare values.</param>\n        /// <returns>The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, 1.</returns>\n        public static int IndexOf<TSource>(this IEnumerable<TSource> list, TSource value, IEqualityComparer<TSource> comparer)\n        {\n            int index = 0;\n            foreach (TSource item in list)\n            {\n                if (comparer.Equals(item, value))\n                {\n                    return index;\n                }\n                index++;\n            }\n            return -1;\n        }\n\n        private static IList<int> GetDimensions(IList values)\n        {\n            IList<int> dimensions = new List<int>();\n\n            IList currentArray = values;\n            while (true)\n            {\n                dimensions.Add(currentArray.Count);\n                if (currentArray.Count == 0)\n                    break;\n\n                object v = currentArray[0];\n                if (v is IList)\n                    currentArray = (IList)v;\n                else\n                    break;\n            }\n\n            return dimensions;\n        }\n\n        private static void CopyFromJaggedToMultidimensionalArray(IList values, Array multidimensionalArray, int[] indices)\n        {\n            int dimension = indices.Length;\n            if (dimension == multidimensionalArray.Rank)\n            {\n                multidimensionalArray.SetValue(JaggedArrayGetValue(values, indices), indices);\n                return;\n            }\n\n            int dimensionLength = multidimensionalArray.GetLength(dimension);\n            IList list = (IList)JaggedArrayGetValue(values, indices);\n            int currentValuesLength = list.Count;\n            if (currentValuesLength != dimensionLength)\n                throw new Exception(\"Cannot deserialize non-cubical array as multidimensional array.\");\n\n            int[] newIndices = new int[dimension + 1];\n            for (int i = 0; i < dimension; i++)\n            {\n                newIndices[i] = indices[i];\n            }\n\n            for (int i = 0; i < multidimensionalArray.GetLength(dimension); i++)\n            {\n                newIndices[dimension] = i;\n                CopyFromJaggedToMultidimensionalArray(values, multidimensionalArray, newIndices);\n            }\n        }\n\n        private static object JaggedArrayGetValue(IList values, int[] indices)\n        {\n            IList currentList = values;\n            for (int i = 0; i < indices.Length; i++)\n            {\n                int index = indices[i];\n                if (i == indices.Length - 1)\n                    return currentList[index];\n                else\n                    currentList = (IList)currentList[index];\n            }\n            return currentList;\n        }\n\n        public static Array ToMultidimensionalArray(IList values, Type type, int rank)\n        {\n            IList<int> dimensions = GetDimensions(values);\n\n            while (dimensions.Count < rank)\n            {\n                dimensions.Add(0);\n            }\n\n            Array multidimensionalArray = Array.CreateInstance(type, dimensions.ToArray());\n            CopyFromJaggedToMultidimensionalArray(values, multidimensionalArray, new int[0]);\n\n            return multidimensionalArray;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/CollectionWrapper.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Threading;\nusing System.Globalization;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal interface IWrappedCollection : IList\n    {\n        object UnderlyingCollection { get; }\n    }\n\n    internal class CollectionWrapper<T> : ICollection<T>, IWrappedCollection\n    {\n        private readonly IList _list;\n        private readonly ICollection<T> _genericCollection;\n        private object _syncRoot;\n\n        public CollectionWrapper(IList list)\n        {\n            ValidationUtils.ArgumentNotNull(list, \"list\");\n\n            if (list is ICollection<T>)\n                _genericCollection = (ICollection<T>)list;\n            else\n                _list = list;\n        }\n\n        public CollectionWrapper(ICollection<T> list)\n        {\n            ValidationUtils.ArgumentNotNull(list, \"list\");\n\n            _genericCollection = list;\n        }\n\n        public virtual void Add(T item)\n        {\n            if (_genericCollection != null)\n                _genericCollection.Add(item);\n            else\n                _list.Add(item);\n        }\n\n        public virtual void Clear()\n        {\n            if (_genericCollection != null)\n                _genericCollection.Clear();\n            else\n                _list.Clear();\n        }\n\n        public virtual bool Contains(T item)\n        {\n            if (_genericCollection != null)\n                return _genericCollection.Contains(item);\n            else\n                return _list.Contains(item);\n        }\n\n        public virtual void CopyTo(T[] array, int arrayIndex)\n        {\n            if (_genericCollection != null)\n                _genericCollection.CopyTo(array, arrayIndex);\n            else\n                _list.CopyTo(array, arrayIndex);\n        }\n\n        public virtual int Count\n        {\n            get\n            {\n                if (_genericCollection != null)\n                    return _genericCollection.Count;\n                else\n                    return _list.Count;\n            }\n        }\n\n        public virtual bool IsReadOnly\n        {\n            get\n            {\n                if (_genericCollection != null)\n                    return _genericCollection.IsReadOnly;\n                else\n                    return _list.IsReadOnly;\n            }\n        }\n\n        public virtual bool Remove(T item)\n        {\n            if (_genericCollection != null)\n            {\n                return _genericCollection.Remove(item);\n            }\n            else\n            {\n                bool contains = _list.Contains(item);\n\n                if (contains)\n                    _list.Remove(item);\n\n                return contains;\n            }\n        }\n\n        public virtual IEnumerator<T> GetEnumerator()\n        {\n            if (_genericCollection != null)\n                return _genericCollection.GetEnumerator();\n\n            return _list.Cast<T>().GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            if (_genericCollection != null)\n                return _genericCollection.GetEnumerator();\n            else\n                return _list.GetEnumerator();\n        }\n\n        int IList.Add(object value)\n        {\n            VerifyValueType(value);\n            Add((T)value);\n\n            return (Count - 1);\n        }\n\n        bool IList.Contains(object value)\n        {\n            if (IsCompatibleObject(value))\n                return Contains((T)value);\n\n            return false;\n        }\n\n        int IList.IndexOf(object value)\n        {\n            if (_genericCollection != null)\n                throw new InvalidOperationException(\"Wrapped ICollection<T> does not support IndexOf.\");\n\n            if (IsCompatibleObject(value))\n                return _list.IndexOf((T)value);\n\n            return -1;\n        }\n\n        void IList.RemoveAt(int index)\n        {\n            if (_genericCollection != null)\n                throw new InvalidOperationException(\"Wrapped ICollection<T> does not support RemoveAt.\");\n\n            _list.RemoveAt(index);\n        }\n\n        void IList.Insert(int index, object value)\n        {\n            if (_genericCollection != null)\n                throw new InvalidOperationException(\"Wrapped ICollection<T> does not support Insert.\");\n\n            VerifyValueType(value);\n            _list.Insert(index, (T)value);\n        }\n\n        bool IList.IsFixedSize\n        {\n            get\n            {\n                if (_genericCollection != null)\n                    // ICollection<T> only has IsReadOnly\n                    return _genericCollection.IsReadOnly;\n                else\n                    return _list.IsFixedSize;\n            }\n        }\n\n        void IList.Remove(object value)\n        {\n            if (IsCompatibleObject(value))\n                Remove((T)value);\n        }\n\n        object IList.this[int index]\n        {\n            get\n            {\n                if (_genericCollection != null)\n                    throw new InvalidOperationException(\"Wrapped ICollection<T> does not support indexer.\");\n\n                return _list[index];\n            }\n            set\n            {\n                if (_genericCollection != null)\n                    throw new InvalidOperationException(\"Wrapped ICollection<T> does not support indexer.\");\n\n                VerifyValueType(value);\n                _list[index] = (T)value;\n            }\n        }\n\n        void ICollection.CopyTo(Array array, int arrayIndex)\n        {\n            CopyTo((T[])array, arrayIndex);\n        }\n\n        bool ICollection.IsSynchronized\n        {\n            get { return false; }\n        }\n\n        object ICollection.SyncRoot\n        {\n            get\n            {\n                if (_syncRoot == null)\n                    Interlocked.CompareExchange(ref _syncRoot, new object(), null);\n\n                return _syncRoot;\n            }\n        }\n\n        private static void VerifyValueType(object value)\n        {\n            if (!IsCompatibleObject(value))\n                throw new ArgumentException(\"The value '{0}' is not of type '{1}' and cannot be used in this generic collection.\".FormatWith(CultureInfo.InvariantCulture, value, typeof(T)), \"value\");\n        }\n\n        private static bool IsCompatibleObject(object value)\n        {\n            if (!(value is T) && (value != null || (typeof(T).IsValueType() && !ReflectionUtils.IsNullableType(typeof(T)))))\n                return false;\n\n            return true;\n        }\n\n        public object UnderlyingCollection\n        {\n            get\n            {\n                if (_genericCollection != null)\n                    return _genericCollection;\n                else\n                    return _list;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/ConvertUtils.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.ComponentModel;\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\nusing System.Numerics;\n#endif\nusing System.Text;\nusing Newtonsoft.Json.Serialization;\nusing System.Reflection;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#endif\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\nusing System.Data.SqlTypes;\n\n#endif\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal enum PrimitiveTypeCode\n    {\n        Empty,\n        Object,\n        Char,\n        CharNullable,\n        Boolean,\n        BooleanNullable,\n        SByte,\n        SByteNullable,\n        Int16,\n        Int16Nullable,\n        UInt16,\n        UInt16Nullable,\n        Int32,\n        Int32Nullable,\n        Byte,\n        ByteNullable,\n        UInt32,\n        UInt32Nullable,\n        Int64,\n        Int64Nullable,\n        UInt64,\n        UInt64Nullable,\n        Single,\n        SingleNullable,\n        Double,\n        DoubleNullable,\n        DateTime,\n        DateTimeNullable,\n#if !NET20\n        DateTimeOffset,\n        DateTimeOffsetNullable,\n#endif\n        Decimal,\n        DecimalNullable,\n        Guid,\n        GuidNullable,\n        TimeSpan,\n        TimeSpanNullable,\n#if !(PORTABLE || NET35 || NET20)\n        BigInteger,\n        BigIntegerNullable,\n#endif\n        Uri,\n        String,\n        Bytes,\n        DBNull\n    }\n\n    internal class TypeInformation\n    {\n        public Type Type { get; set; }\n        public PrimitiveTypeCode TypeCode { get; set; }\n    }\n\n    internal enum ParseResult\n    {\n        None,\n        Success,\n        Overflow,\n        Invalid\n    }\n\n    internal static class ConvertUtils\n    {\n        private static readonly Dictionary<Type, PrimitiveTypeCode> TypeCodeMap =\n            new Dictionary<Type, PrimitiveTypeCode>\n            {\n                { typeof(char), PrimitiveTypeCode.Char },\n                { typeof(char?), PrimitiveTypeCode.CharNullable },\n                { typeof(bool), PrimitiveTypeCode.Boolean },\n                { typeof(bool?), PrimitiveTypeCode.BooleanNullable },\n                { typeof(sbyte), PrimitiveTypeCode.SByte },\n                { typeof(sbyte?), PrimitiveTypeCode.SByteNullable },\n                { typeof(short), PrimitiveTypeCode.Int16 },\n                { typeof(short?), PrimitiveTypeCode.Int16Nullable },\n                { typeof(ushort), PrimitiveTypeCode.UInt16 },\n                { typeof(ushort?), PrimitiveTypeCode.UInt16Nullable },\n                { typeof(int), PrimitiveTypeCode.Int32 },\n                { typeof(int?), PrimitiveTypeCode.Int32Nullable },\n                { typeof(byte), PrimitiveTypeCode.Byte },\n                { typeof(byte?), PrimitiveTypeCode.ByteNullable },\n                { typeof(uint), PrimitiveTypeCode.UInt32 },\n                { typeof(uint?), PrimitiveTypeCode.UInt32Nullable },\n                { typeof(long), PrimitiveTypeCode.Int64 },\n                { typeof(long?), PrimitiveTypeCode.Int64Nullable },\n                { typeof(ulong), PrimitiveTypeCode.UInt64 },\n                { typeof(ulong?), PrimitiveTypeCode.UInt64Nullable },\n                { typeof(float), PrimitiveTypeCode.Single },\n                { typeof(float?), PrimitiveTypeCode.SingleNullable },\n                { typeof(double), PrimitiveTypeCode.Double },\n                { typeof(double?), PrimitiveTypeCode.DoubleNullable },\n                { typeof(DateTime), PrimitiveTypeCode.DateTime },\n                { typeof(DateTime?), PrimitiveTypeCode.DateTimeNullable },\n#if !NET20\n                { typeof(DateTimeOffset), PrimitiveTypeCode.DateTimeOffset },\n                { typeof(DateTimeOffset?), PrimitiveTypeCode.DateTimeOffsetNullable },\n#endif\n                { typeof(decimal), PrimitiveTypeCode.Decimal },\n                { typeof(decimal?), PrimitiveTypeCode.DecimalNullable },\n                { typeof(Guid), PrimitiveTypeCode.Guid },\n                { typeof(Guid?), PrimitiveTypeCode.GuidNullable },\n                { typeof(TimeSpan), PrimitiveTypeCode.TimeSpan },\n                { typeof(TimeSpan?), PrimitiveTypeCode.TimeSpanNullable },\n#if !(PORTABLE || PORTABLE40 || NET35 || NET20)\n                { typeof(BigInteger), PrimitiveTypeCode.BigInteger },\n                { typeof(BigInteger?), PrimitiveTypeCode.BigIntegerNullable },\n#endif\n                { typeof(Uri), PrimitiveTypeCode.Uri },\n                { typeof(string), PrimitiveTypeCode.String },\n                { typeof(byte[]), PrimitiveTypeCode.Bytes },\n#if !(PORTABLE || PORTABLE40 || NETFX_CORE)\n                { typeof(DBNull), PrimitiveTypeCode.DBNull }\n#endif\n            };\n\n        private static readonly List<TypeInformation> PrimitiveTypeCodes = new List<TypeInformation>\n        {\n            new TypeInformation { Type = typeof(object), TypeCode = PrimitiveTypeCode.Empty },\n            new TypeInformation { Type = typeof(object), TypeCode = PrimitiveTypeCode.Object },\n            new TypeInformation { Type = typeof(object), TypeCode = PrimitiveTypeCode.DBNull },\n            new TypeInformation { Type = typeof(bool), TypeCode = PrimitiveTypeCode.Boolean },\n            new TypeInformation { Type = typeof(char), TypeCode = PrimitiveTypeCode.Char },\n            new TypeInformation { Type = typeof(sbyte), TypeCode = PrimitiveTypeCode.SByte },\n            new TypeInformation { Type = typeof(byte), TypeCode = PrimitiveTypeCode.Byte },\n            new TypeInformation { Type = typeof(short), TypeCode = PrimitiveTypeCode.Int16 },\n            new TypeInformation { Type = typeof(ushort), TypeCode = PrimitiveTypeCode.UInt16 },\n            new TypeInformation { Type = typeof(int), TypeCode = PrimitiveTypeCode.Int32 },\n            new TypeInformation { Type = typeof(uint), TypeCode = PrimitiveTypeCode.UInt32 },\n            new TypeInformation { Type = typeof(long), TypeCode = PrimitiveTypeCode.Int64 },\n            new TypeInformation { Type = typeof(ulong), TypeCode = PrimitiveTypeCode.UInt64 },\n            new TypeInformation { Type = typeof(float), TypeCode = PrimitiveTypeCode.Single },\n            new TypeInformation { Type = typeof(double), TypeCode = PrimitiveTypeCode.Double },\n            new TypeInformation { Type = typeof(decimal), TypeCode = PrimitiveTypeCode.Decimal },\n            new TypeInformation { Type = typeof(DateTime), TypeCode = PrimitiveTypeCode.DateTime },\n            new TypeInformation { Type = typeof(object), TypeCode = PrimitiveTypeCode.Empty }, // no 17 in TypeCode for some reason\n            new TypeInformation { Type = typeof(string), TypeCode = PrimitiveTypeCode.String }\n        };\n\n        public static PrimitiveTypeCode GetTypeCode(Type t)\n        {\n            PrimitiveTypeCode typeCode;\n            if (TypeCodeMap.TryGetValue(t, out typeCode))\n                return typeCode;\n\n            if (t.IsEnum())\n                return GetTypeCode(Enum.GetUnderlyingType(t));\n\n            // performance?\n            if (ReflectionUtils.IsNullableType(t))\n            {\n                Type nonNullable = Nullable.GetUnderlyingType(t);\n                if (nonNullable.IsEnum())\n                {\n                    Type nullableUnderlyingType = typeof(Nullable<>).MakeGenericType(Enum.GetUnderlyingType(nonNullable));\n                    return GetTypeCode(nullableUnderlyingType);\n                }\n            }\n\n            return PrimitiveTypeCode.Object;\n        }\n\n        public static PrimitiveTypeCode GetTypeCode(object o)\n        {\n            return GetTypeCode(o.GetType());\n        }\n\n#if !(NETFX_CORE || PORTABLE)\n        public static TypeInformation GetTypeInformation(IConvertible convertable)\n        {\n            TypeInformation typeInformation = PrimitiveTypeCodes[(int)convertable.GetTypeCode()];\n            return typeInformation;\n        }\n#endif\n\n        public static bool IsConvertible(Type t)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return typeof(IConvertible).IsAssignableFrom(t);\n#else\n      return (\n        t == typeof(bool) || t == typeof(byte) || t == typeof(char) || t == typeof(DateTime) || t == typeof(decimal) || t == typeof(double) || t == typeof(short) || t == typeof(int) ||\n        t == typeof(long) || t == typeof(sbyte) || t == typeof(float) || t == typeof(string) || t == typeof(ushort) || t == typeof(uint) || t == typeof(ulong) || t.IsEnum());\n#endif\n        }\n\n        public static TimeSpan ParseTimeSpan(string input)\n        {\n#if !(NET35 || NET20)\n            return TimeSpan.Parse(input, CultureInfo.InvariantCulture);\n#else\n            return TimeSpan.Parse(input);\n#endif\n        }\n\n        internal struct TypeConvertKey : IEquatable<TypeConvertKey>\n        {\n            private readonly Type _initialType;\n            private readonly Type _targetType;\n\n            public Type InitialType\n            {\n                get { return _initialType; }\n            }\n\n            public Type TargetType\n            {\n                get { return _targetType; }\n            }\n\n            public TypeConvertKey(Type initialType, Type targetType)\n            {\n                _initialType = initialType;\n                _targetType = targetType;\n            }\n\n            public override int GetHashCode()\n            {\n                return _initialType.GetHashCode() ^ _targetType.GetHashCode();\n            }\n\n            public override bool Equals(object obj)\n            {\n                if (!(obj is TypeConvertKey))\n                    return false;\n\n                return Equals((TypeConvertKey)obj);\n            }\n\n            public bool Equals(TypeConvertKey other)\n            {\n                return (_initialType == other._initialType && _targetType == other._targetType);\n            }\n        }\n\n        private static readonly ThreadSafeStore<TypeConvertKey, Func<object, object>> CastConverters =\n            new ThreadSafeStore<TypeConvertKey, Func<object, object>>(CreateCastConverter);\n\n        private static Func<object, object> CreateCastConverter(TypeConvertKey t)\n        {\n            MethodInfo castMethodInfo = t.TargetType.GetMethod(\"op_Implicit\", new[] { t.InitialType });\n            if (castMethodInfo == null)\n                castMethodInfo = t.TargetType.GetMethod(\"op_Explicit\", new[] { t.InitialType });\n\n            if (castMethodInfo == null)\n                return null;\n\n            MethodCall<object, object> call = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(castMethodInfo);\n\n            return o => call(null, o);\n        }\n\n#if !(NET20 || NET35 || PORTABLE || PORTABLE40)\n        internal static BigInteger ToBigInteger(object value)\n        {\n            if (value is BigInteger)\n                return (BigInteger)value;\n            if (value is string)\n                return BigInteger.Parse((string)value, CultureInfo.InvariantCulture);\n            if (value is float)\n                return new BigInteger((float)value);\n            if (value is double)\n                return new BigInteger((double)value);\n            if (value is decimal)\n                return new BigInteger((decimal)value);\n            if (value is int)\n                return new BigInteger((int)value);\n            if (value is long)\n                return new BigInteger((long)value);\n            if (value is uint)\n                return new BigInteger((uint)value);\n            if (value is ulong)\n                return new BigInteger((ulong)value);\n            if (value is byte[])\n                return new BigInteger((byte[])value);\n\n            throw new InvalidCastException(\"Cannot convert {0} to BigInteger.\".FormatWith(CultureInfo.InvariantCulture, value.GetType()));\n        }\n\n        public static object FromBigInteger(BigInteger i, Type targetType)\n        {\n            if (targetType == typeof(decimal))\n                return (decimal)i;\n            if (targetType == typeof(double))\n                return (double)i;\n            if (targetType == typeof(float))\n                return (float)i;\n            if (targetType == typeof(ulong))\n                return (ulong)i;\n\n            try\n            {\n                return System.Convert.ChangeType((long)i, targetType, CultureInfo.InvariantCulture);\n            }\n            catch (Exception ex)\n            {\n                throw new InvalidOperationException(\"Can not convert from BigInteger to {0}.\".FormatWith(CultureInfo.InvariantCulture, targetType), ex);\n            }\n        }\n#endif\n\n        #region TryConvert\n        internal enum ConvertResult\n        {\n            Success,\n            CannotConvertNull,\n            NotInstantiableType,\n            NoValidConversion\n        }\n\n        public static object Convert(object initialValue, CultureInfo culture, Type targetType)\n        {\n            object value;\n            switch (TryConvertInternal(initialValue, culture, targetType, out value))\n            {\n                case ConvertResult.Success:\n                    return value;\n                case ConvertResult.CannotConvertNull:\n                    throw new Exception(\"Can not convert null {0} into non-nullable {1}.\".FormatWith(CultureInfo.InvariantCulture, initialValue.GetType(), targetType));\n                case ConvertResult.NotInstantiableType:\n                    throw new ArgumentException(\"Target type {0} is not a value type or a non-abstract class.\".FormatWith(CultureInfo.InvariantCulture, targetType), \"targetType\");\n                case ConvertResult.NoValidConversion:\n                    throw new InvalidOperationException(\"Can not convert from {0} to {1}.\".FormatWith(CultureInfo.InvariantCulture, initialValue.GetType(), targetType));\n                default:\n                    throw new InvalidOperationException(\"Unexpected conversion result.\");\n            }\n        }\n\n        private static bool TryConvert(object initialValue, CultureInfo culture, Type targetType, out object value)\n        {\n            try\n            {\n                if (TryConvertInternal(initialValue, culture, targetType, out value) == ConvertResult.Success)\n                    return true;\n\n                value = null;\n                return false;\n            }\n            catch\n            {\n                value = null;\n                return false;\n            }\n        }\n\n        private static ConvertResult TryConvertInternal(object initialValue, CultureInfo culture, Type targetType, out object value)\n        {\n            if (initialValue == null)\n                throw new ArgumentNullException(\"initialValue\");\n\n            if (ReflectionUtils.IsNullableType(targetType))\n                targetType = Nullable.GetUnderlyingType(targetType);\n\n            Type initialType = initialValue.GetType();\n\n            if (targetType == initialType)\n            {\n                value = initialValue;\n                return ConvertResult.Success;\n            }\n\n            // use Convert.ChangeType if both types are IConvertible\n            if (ConvertUtils.IsConvertible(initialValue.GetType()) && ConvertUtils.IsConvertible(targetType))\n            {\n                if (targetType.IsEnum())\n                {\n                    if (initialValue is string)\n                    {\n                        value = Enum.Parse(targetType, initialValue.ToString(), true);\n                        return ConvertResult.Success;\n                    }\n                    else if (IsInteger(initialValue))\n                    {\n                        value = Enum.ToObject(targetType, initialValue);\n                        return ConvertResult.Success;\n                    }\n                }\n\n                value = System.Convert.ChangeType(initialValue, targetType, culture);\n                return ConvertResult.Success;\n            }\n\n#if !NET20\n            if (initialValue is DateTime && targetType == typeof(DateTimeOffset))\n            {\n                value = new DateTimeOffset((DateTime)initialValue);\n                return ConvertResult.Success;\n            }\n#endif\n\n            if (initialValue is byte[] && targetType == typeof(Guid))\n            {\n                value = new Guid((byte[])initialValue);\n                return ConvertResult.Success;\n            }\n\n            if (initialValue is string)\n            {\n                if (targetType == typeof(Guid))\n                {\n                    value = new Guid((string)initialValue);\n                    return ConvertResult.Success;\n                }\n                if (targetType == typeof(Uri))\n                {\n                    value = new Uri((string)initialValue, UriKind.RelativeOrAbsolute);\n                    return ConvertResult.Success;\n                }\n                if (targetType == typeof(TimeSpan))\n                {\n                    value = ParseTimeSpan((string)initialValue);\n                    return ConvertResult.Success;\n                }\n                if (targetType == typeof(byte[]))\n                {\n                    value = System.Convert.FromBase64String((string)initialValue);\n                    return ConvertResult.Success;\n                }\n                if (typeof(Type).IsAssignableFrom(targetType))\n                {\n                    value = Type.GetType((string)initialValue, true);\n                    return ConvertResult.Success;\n                }\n            }\n\n#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)\n            if (targetType == typeof(BigInteger))\n            {\n                value = ToBigInteger(initialValue);\n                return ConvertResult.Success;\n            }\n            if (initialValue is BigInteger)\n            {\n                value = FromBigInteger((BigInteger)initialValue, targetType);\n                return ConvertResult.Success;\n            }\n#endif\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            // see if source or target types have a TypeConverter that converts between the two\n            TypeConverter toConverter = GetConverter(initialType);\n\n            if (toConverter != null && toConverter.CanConvertTo(targetType))\n            {\n                value = toConverter.ConvertTo(null, culture, initialValue, targetType);\n                return ConvertResult.Success;\n            }\n\n            TypeConverter fromConverter = GetConverter(targetType);\n\n            if (fromConverter != null && fromConverter.CanConvertFrom(initialType))\n            {\n                value = fromConverter.ConvertFrom(null, culture, initialValue);\n                return ConvertResult.Success;\n            }\n#endif\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            // handle DBNull and INullable\n            if (initialValue == DBNull.Value)\n            {\n                if (ReflectionUtils.IsNullable(targetType))\n                {\n                    value = EnsureTypeAssignable(null, initialType, targetType);\n                    return ConvertResult.Success;\n                }\n\n                // cannot convert null to non-nullable\n                value = null;\n                return ConvertResult.CannotConvertNull;\n            }\n#endif\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            if (initialValue is INullable)\n            {\n                value = EnsureTypeAssignable(ToValue((INullable)initialValue), initialType, targetType);\n                return ConvertResult.Success;\n            }\n#endif\n\n            if (targetType.IsInterface() || targetType.IsGenericTypeDefinition() || targetType.IsAbstract())\n            {\n                value = null;\n                return ConvertResult.NotInstantiableType;\n            }\n\n            value = null;\n            return ConvertResult.NoValidConversion;\n        }\n        #endregion\n\n        #region ConvertOrCast\n        /// <summary>\n        /// Converts the value to the specified type. If the value is unable to be converted, the\n        /// value is checked whether it assignable to the specified type.\n        /// </summary>\n        /// <param name=\"initialValue\">The value to convert.</param>\n        /// <param name=\"culture\">The culture to use when converting.</param>\n        /// <param name=\"targetType\">The type to convert or cast the value to.</param>\n        /// <returns>\n        /// The converted type. If conversion was unsuccessful, the initial value\n        /// is returned if assignable to the target type.\n        /// </returns>\n        public static object ConvertOrCast(object initialValue, CultureInfo culture, Type targetType)\n        {\n            object convertedValue;\n\n            if (targetType == typeof(object))\n                return initialValue;\n\n            if (initialValue == null && ReflectionUtils.IsNullable(targetType))\n                return null;\n\n            if (TryConvert(initialValue, culture, targetType, out convertedValue))\n                return convertedValue;\n\n            return EnsureTypeAssignable(initialValue, ReflectionUtils.GetObjectType(initialValue), targetType);\n        }\n        #endregion\n\n        private static object EnsureTypeAssignable(object value, Type initialType, Type targetType)\n        {\n            Type valueType = (value != null) ? value.GetType() : null;\n\n            if (value != null)\n            {\n                if (targetType.IsAssignableFrom(valueType))\n                    return value;\n\n                Func<object, object> castConverter = CastConverters.Get(new TypeConvertKey(valueType, targetType));\n                if (castConverter != null)\n                    return castConverter(value);\n            }\n            else\n            {\n                if (ReflectionUtils.IsNullable(targetType))\n                    return null;\n            }\n\n            throw new ArgumentException(\"Could not cast or convert from {0} to {1}.\".FormatWith(CultureInfo.InvariantCulture, (initialType != null) ? initialType.ToString() : \"{null}\", targetType));\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        public static object ToValue(INullable nullableValue)\n        {\n            if (nullableValue == null)\n                return null;\n            else if (nullableValue is SqlInt32)\n                return ToValue((SqlInt32)nullableValue);\n            else if (nullableValue is SqlInt64)\n                return ToValue((SqlInt64)nullableValue);\n            else if (nullableValue is SqlBoolean)\n                return ToValue((SqlBoolean)nullableValue);\n            else if (nullableValue is SqlString)\n                return ToValue((SqlString)nullableValue);\n            else if (nullableValue is SqlDateTime)\n                return ToValue((SqlDateTime)nullableValue);\n\n            throw new ArgumentException(\"Unsupported INullable type: {0}\".FormatWith(CultureInfo.InvariantCulture, nullableValue.GetType()));\n        }\n#endif\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        internal static TypeConverter GetConverter(Type t)\n        {\n            return JsonTypeReflector.GetTypeConverter(t);\n        }\n#endif\n\n        public static bool IsInteger(object value)\n        {\n            switch (GetTypeCode(value))\n            {\n                case PrimitiveTypeCode.SByte:\n                case PrimitiveTypeCode.Byte:\n                case PrimitiveTypeCode.Int16:\n                case PrimitiveTypeCode.UInt16:\n                case PrimitiveTypeCode.Int32:\n                case PrimitiveTypeCode.UInt32:\n                case PrimitiveTypeCode.Int64:\n                case PrimitiveTypeCode.UInt64:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n\n        public static ParseResult Int32TryParse(char[] chars, int start, int length, out int value)\n        {\n            value = 0;\n\n            if (length == 0)\n                return ParseResult.Invalid;\n\n            bool isNegative = (chars[start] == '-');\n\n            if (isNegative)\n            {\n                // text just a negative sign\n                if (length == 1)\n                    return ParseResult.Invalid;\n\n                start++;\n                length--;\n            }\n\n            int end = start + length;\n\n            for (int i = start; i < end; i++)\n            {\n                int c = chars[i] - '0';\n\n                if (c < 0 || c > 9)\n                    return ParseResult.Invalid;\n\n                int newValue = (10 * value) - c;\n\n                // overflow has caused the number to loop around\n                if (newValue > value)\n                {\n                    i++;\n\n                    // double check the rest of the string that there wasn't anything invalid\n                    // invalid result takes precedence over overflow result\n                    for (; i < end; i++)\n                    {\n                        c = chars[i] - '0';\n\n                        if (c < 0 || c > 9)\n                            return ParseResult.Invalid;\n                    }\n\n                    return ParseResult.Overflow;\n                }\n\n                value = newValue;\n            }\n\n            // go from negative to positive to avoids overflow\n            // negative can be slightly bigger than positive\n            if (!isNegative)\n            {\n                // negative integer can be one bigger than positive\n                if (value == int.MinValue)\n                    return ParseResult.Overflow;\n\n                value = -value;\n            }\n\n            return ParseResult.Success;\n        }\n\n        public static ParseResult Int64TryParse(char[] chars, int start, int length, out long value)\n        {\n            value = 0;\n\n            if (length == 0)\n                return ParseResult.Invalid;\n\n            bool isNegative = (chars[start] == '-');\n\n            if (isNegative)\n            {\n                // text just a negative sign\n                if (length == 1)\n                    return ParseResult.Invalid;\n\n                start++;\n                length--;\n            }\n\n            int end = start + length;\n\n            for (int i = start; i < end; i++)\n            {\n                int c = chars[i] - '0';\n\n                if (c < 0 || c > 9)\n                    return ParseResult.Invalid;\n\n                long newValue = (10 * value) - c;\n\n                // overflow has caused the number to loop around\n                if (newValue > value)\n                {\n                    i++;\n\n                    // double check the rest of the string that there wasn't anything invalid\n                    // invalid result takes precedence over overflow result\n                    for (; i < end; i++)\n                    {\n                        c = chars[i] - '0';\n\n                        if (c < 0 || c > 9)\n                            return ParseResult.Invalid;\n                    }\n\n                    return ParseResult.Overflow;\n                }\n\n                value = newValue;\n            }\n\n            // go from negative to positive to avoids overflow\n            // negative can be slightly bigger than positive\n            if (!isNegative)\n            {\n                // negative integer can be one bigger than positive\n                if (value == long.MinValue)\n                    return ParseResult.Overflow;\n\n                value = -value;\n            }\n\n            return ParseResult.Success;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/DateTimeParser.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal enum ParserTimeZone\n    {\n        Unspecified,\n        Utc,\n        LocalWestOfUtc,\n        LocalEastOfUtc\n    }\n\n    internal struct DateTimeParser\n    {\n        static DateTimeParser()\n        {\n            Power10 = new[] { -1, 10, 100, 1000, 10000, 100000, 1000000 };\n\n            Lzyyyy = \"yyyy\".Length;\n            Lzyyyy_ = \"yyyy-\".Length;\n            Lzyyyy_MM = \"yyyy-MM\".Length;\n            Lzyyyy_MM_ = \"yyyy-MM-\".Length;\n            Lzyyyy_MM_dd = \"yyyy-MM-dd\".Length;\n            Lzyyyy_MM_ddT = \"yyyy-MM-ddT\".Length;\n            LzHH = \"HH\".Length;\n            LzHH_ = \"HH:\".Length;\n            LzHH_mm = \"HH:mm\".Length;\n            LzHH_mm_ = \"HH:mm:\".Length;\n            LzHH_mm_ss = \"HH:mm:ss\".Length;\n            Lz_ = \"-\".Length;\n            Lz_zz = \"-zz\".Length;\n            Lz_zz_ = \"-zz:\".Length;\n            Lz_zz_zz = \"-zz:zz\".Length;\n        }\n\n        public int Year;\n        public int Month;\n        public int Day;\n        public int Hour;\n        public int Minute;\n        public int Second;\n        public int Fraction;\n        public int ZoneHour;\n        public int ZoneMinute;\n        public ParserTimeZone Zone;\n\n        private string _text;\n        private int _length;\n\n        private static readonly int[] Power10;\n\n        private static readonly int Lzyyyy;\n        private static readonly int Lzyyyy_;\n        private static readonly int Lzyyyy_MM;\n        private static readonly int Lzyyyy_MM_;\n        private static readonly int Lzyyyy_MM_dd;\n        private static readonly int Lzyyyy_MM_ddT;\n        private static readonly int LzHH;\n        private static readonly int LzHH_;\n        private static readonly int LzHH_mm;\n        private static readonly int LzHH_mm_;\n        private static readonly int LzHH_mm_ss;\n        private static readonly int Lz_;\n        private static readonly int Lz_zz;\n        private static readonly int Lz_zz_;\n        private static readonly int Lz_zz_zz;\n\n        private const short MaxFractionDigits = 7;\n\n        public bool Parse(string text)\n        {\n            _text = text;\n            _length = text.Length;\n\n            if (ParseDate(0) && ParseChar(Lzyyyy_MM_dd, 'T') && ParseTimeAndZoneAndWhitespace(Lzyyyy_MM_ddT))\n                return true;\n\n            return false;\n        }\n\n        private bool ParseDate(int start)\n        {\n            return (Parse4Digit(start, out Year)\n                    && 1 <= Year\n                    && ParseChar(start + Lzyyyy, '-')\n                    && Parse2Digit(start + Lzyyyy_, out Month)\n                    && 1 <= Month\n                    && Month <= 12\n                    && ParseChar(start + Lzyyyy_MM, '-')\n                    && Parse2Digit(start + Lzyyyy_MM_, out Day)\n                    && 1 <= Day\n                    && Day <= DateTime.DaysInMonth(Year, Month));\n        }\n\n        private bool ParseTimeAndZoneAndWhitespace(int start)\n        {\n            return (ParseTime(ref start) && ParseZone(start));\n        }\n\n        private bool ParseTime(ref int start)\n        {\n            if (!(Parse2Digit(start, out Hour)\n                  && Hour < 24\n                  && ParseChar(start + LzHH, ':')\n                  && Parse2Digit(start + LzHH_, out Minute)\n                  && Minute < 60\n                  && ParseChar(start + LzHH_mm, ':')\n                  && Parse2Digit(start + LzHH_mm_, out Second)\n                  && Second < 60))\n            {\n                return false;\n            }\n\n            start += LzHH_mm_ss;\n            if (ParseChar(start, '.'))\n            {\n                Fraction = 0;\n                int numberOfDigits = 0;\n\n                while (++start < _length && numberOfDigits < MaxFractionDigits)\n                {\n                    int digit = _text[start] - '0';\n                    if (digit < 0 || digit > 9)\n                        break;\n\n                    Fraction = (Fraction * 10) + digit;\n\n                    numberOfDigits++;\n                }\n\n                if (numberOfDigits < MaxFractionDigits)\n                {\n                    if (numberOfDigits == 0)\n                        return false;\n\n                    Fraction *= Power10[MaxFractionDigits - numberOfDigits];\n                }\n            }\n            return true;\n        }\n\n        private bool ParseZone(int start)\n        {\n            if (start < _length)\n            {\n                char ch = _text[start];\n                if (ch == 'Z' || ch == 'z')\n                {\n                    Zone = ParserTimeZone.Utc;\n                    start++;\n                }\n                else\n                {\n                    if (start + 2 < _length\n                        && Parse2Digit(start + Lz_, out ZoneHour)\n                        && ZoneHour <= 99)\n                    {\n                        switch (ch)\n                        {\n                            case '-':\n                                Zone = ParserTimeZone.LocalWestOfUtc;\n                                start += Lz_zz;\n                                break;\n\n                            case '+':\n                                Zone = ParserTimeZone.LocalEastOfUtc;\n                                start += Lz_zz;\n                                break;\n                        }\n                    }\n\n                    if (start < _length)\n                    {\n                        if (ParseChar(start, ':'))\n                        {\n                            start += 1;\n\n                            if (start + 1 < _length\n                                && Parse2Digit(start, out ZoneMinute)\n                                && ZoneMinute <= 99)\n                            {\n                                start += 2;\n                            }\n                        }\n                        else\n                        {\n                            if (start + 1 < _length\n                                && Parse2Digit(start, out ZoneMinute)\n                                && ZoneMinute <= 99)\n                            {\n                                start += 2;\n                            }\n                        }\n                    }\n                }\n            }\n\n            return (start == _length);\n        }\n\n        private bool Parse4Digit(int start, out int num)\n        {\n            if (start + 3 < _length)\n            {\n                int digit1 = _text[start] - '0';\n                int digit2 = _text[start + 1] - '0';\n                int digit3 = _text[start + 2] - '0';\n                int digit4 = _text[start + 3] - '0';\n                if (0 <= digit1 && digit1 < 10\n                    && 0 <= digit2 && digit2 < 10\n                    && 0 <= digit3 && digit3 < 10\n                    && 0 <= digit4 && digit4 < 10)\n                {\n                    num = (((((digit1 * 10) + digit2) * 10) + digit3) * 10) + digit4;\n                    return true;\n                }\n            }\n            num = 0;\n            return false;\n        }\n\n        private bool Parse2Digit(int start, out int num)\n        {\n            if (start + 1 < _length)\n            {\n                int digit1 = _text[start] - '0';\n                int digit2 = _text[start + 1] - '0';\n                if (0 <= digit1 && digit1 < 10\n                    && 0 <= digit2 && digit2 < 10)\n                {\n                    num = (digit1 * 10) + digit2;\n                    return true;\n                }\n            }\n            num = 0;\n            return false;\n        }\n\n        private bool ParseChar(int start, char ch)\n        {\n            return (start < _length && _text[start] == ch);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/DateTimeUtils.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.IO;\nusing System.Xml;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class DateTimeUtils\n    {\n        internal static readonly long InitialJavaScriptDateTicks = 621355968000000000;\n\n        private const int DaysPer100Years = 36524;\n        private const int DaysPer400Years = 146097;\n        private const int DaysPer4Years = 1461;\n        private const int DaysPerYear = 365;\n        private const long TicksPerDay = 864000000000L;\n        private static readonly int[] DaysToMonth365;\n        private static readonly int[] DaysToMonth366;\n\n        static DateTimeUtils()\n        {\n            DaysToMonth365 = new[] { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };\n            DaysToMonth366 = new[] { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 };\n        }\n\n        public static TimeSpan GetUtcOffset(this DateTime d)\n        {\n#if NET20\n      return TimeZone.CurrentTimeZone.GetUtcOffset(d);\n#else\n            return TimeZoneInfo.Local.GetUtcOffset(d);\n#endif\n        }\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n        public static XmlDateTimeSerializationMode ToSerializationMode(DateTimeKind kind)\n        {\n            switch (kind)\n            {\n                case DateTimeKind.Local:\n                    return XmlDateTimeSerializationMode.Local;\n                case DateTimeKind.Unspecified:\n                    return XmlDateTimeSerializationMode.Unspecified;\n                case DateTimeKind.Utc:\n                    return XmlDateTimeSerializationMode.Utc;\n                default:\n                    throw MiscellaneousUtils.CreateArgumentOutOfRangeException(\"kind\", kind, \"Unexpected DateTimeKind value.\");\n            }\n        }\n#endif\n\n        internal static DateTime EnsureDateTime(DateTime value, DateTimeZoneHandling timeZone)\n        {\n            switch (timeZone)\n            {\n                case DateTimeZoneHandling.Local:\n                    value = SwitchToLocalTime(value);\n                    break;\n                case DateTimeZoneHandling.Utc:\n                    value = SwitchToUtcTime(value);\n                    break;\n                case DateTimeZoneHandling.Unspecified:\n                    value = new DateTime(value.Ticks, DateTimeKind.Unspecified);\n                    break;\n                case DateTimeZoneHandling.RoundtripKind:\n                    break;\n                default:\n                    throw new ArgumentException(\"Invalid date time handling value.\");\n            }\n\n            return value;\n        }\n\n        private static DateTime SwitchToLocalTime(DateTime value)\n        {\n            switch (value.Kind)\n            {\n                case DateTimeKind.Unspecified:\n                    return new DateTime(value.Ticks, DateTimeKind.Local);\n\n                case DateTimeKind.Utc:\n                    return value.ToLocalTime();\n\n                case DateTimeKind.Local:\n                    return value;\n            }\n            return value;\n        }\n\n        private static DateTime SwitchToUtcTime(DateTime value)\n        {\n            switch (value.Kind)\n            {\n                case DateTimeKind.Unspecified:\n                    return new DateTime(value.Ticks, DateTimeKind.Utc);\n\n                case DateTimeKind.Utc:\n                    return value;\n\n                case DateTimeKind.Local:\n                    return value.ToUniversalTime();\n            }\n            return value;\n        }\n\n        private static long ToUniversalTicks(DateTime dateTime)\n        {\n            if (dateTime.Kind == DateTimeKind.Utc)\n                return dateTime.Ticks;\n\n            return ToUniversalTicks(dateTime, dateTime.GetUtcOffset());\n        }\n\n        private static long ToUniversalTicks(DateTime dateTime, TimeSpan offset)\n        {\n            // special case min and max value\n            // they never have a timezone appended to avoid issues\n            if (dateTime.Kind == DateTimeKind.Utc || dateTime == DateTime.MaxValue || dateTime == DateTime.MinValue)\n                return dateTime.Ticks;\n\n            long ticks = dateTime.Ticks - offset.Ticks;\n            if (ticks > 3155378975999999999L)\n                return 3155378975999999999L;\n\n            if (ticks < 0L)\n                return 0L;\n\n            return ticks;\n        }\n\n        internal static long ConvertDateTimeToJavaScriptTicks(DateTime dateTime, TimeSpan offset)\n        {\n            long universialTicks = ToUniversalTicks(dateTime, offset);\n\n            return UniversialTicksToJavaScriptTicks(universialTicks);\n        }\n\n        internal static long ConvertDateTimeToJavaScriptTicks(DateTime dateTime)\n        {\n            return ConvertDateTimeToJavaScriptTicks(dateTime, true);\n        }\n\n        internal static long ConvertDateTimeToJavaScriptTicks(DateTime dateTime, bool convertToUtc)\n        {\n            long ticks = (convertToUtc) ? ToUniversalTicks(dateTime) : dateTime.Ticks;\n\n            return UniversialTicksToJavaScriptTicks(ticks);\n        }\n\n        private static long UniversialTicksToJavaScriptTicks(long universialTicks)\n        {\n            long javaScriptTicks = (universialTicks - InitialJavaScriptDateTicks) / 10000;\n\n            return javaScriptTicks;\n        }\n\n        internal static DateTime ConvertJavaScriptTicksToDateTime(long javaScriptTicks)\n        {\n            DateTime dateTime = new DateTime((javaScriptTicks * 10000) + InitialJavaScriptDateTicks, DateTimeKind.Utc);\n\n            return dateTime;\n        }\n\n        #region Parse\n        internal static bool TryParseDateIso(string text, DateParseHandling dateParseHandling, DateTimeZoneHandling dateTimeZoneHandling, out object dt)\n        {\n            DateTimeParser dateTimeParser = new DateTimeParser();\n            if (!dateTimeParser.Parse(text))\n            {\n                dt = null;\n                return false;\n            }\n\n            DateTime d = new DateTime(dateTimeParser.Year, dateTimeParser.Month, dateTimeParser.Day, dateTimeParser.Hour, dateTimeParser.Minute, dateTimeParser.Second);\n            d = d.AddTicks(dateTimeParser.Fraction);\n\n#if !NET20\n            if (dateParseHandling == DateParseHandling.DateTimeOffset)\n            {\n                TimeSpan offset;\n\n                switch (dateTimeParser.Zone)\n                {\n                    case ParserTimeZone.Utc:\n                        offset = new TimeSpan(0L);\n                        break;\n                    case ParserTimeZone.LocalWestOfUtc:\n                        offset = new TimeSpan(-dateTimeParser.ZoneHour, -dateTimeParser.ZoneMinute, 0);\n                        break;\n                    case ParserTimeZone.LocalEastOfUtc:\n                        offset = new TimeSpan(dateTimeParser.ZoneHour, dateTimeParser.ZoneMinute, 0);\n                        break;\n                    default:\n                        offset = TimeZoneInfo.Local.GetUtcOffset(d);\n                        break;\n                }\n\n                long ticks = d.Ticks - offset.Ticks;\n                if (ticks < 0 || ticks > 3155378975999999999)\n                {\n                    dt = null;\n                    return false;\n                }\n\n                dt = new DateTimeOffset(d, offset);\n                return true;\n            }\n            else\n#endif\n            {\n                long ticks;\n\n                switch (dateTimeParser.Zone)\n                {\n                    case ParserTimeZone.Utc:\n                        d = new DateTime(d.Ticks, DateTimeKind.Utc);\n                        break;\n\n                    case ParserTimeZone.LocalWestOfUtc:\n                    {\n                        TimeSpan offset = new TimeSpan(dateTimeParser.ZoneHour, dateTimeParser.ZoneMinute, 0);\n                        ticks = d.Ticks + offset.Ticks;\n                        if (ticks <= DateTime.MaxValue.Ticks)\n                        {\n                            d = new DateTime(ticks, DateTimeKind.Utc).ToLocalTime();\n                        }\n                        else\n                        {\n                            ticks += d.GetUtcOffset().Ticks;\n                            if (ticks > DateTime.MaxValue.Ticks)\n                                ticks = DateTime.MaxValue.Ticks;\n\n                            d = new DateTime(ticks, DateTimeKind.Local);\n                        }\n                        break;\n                    }\n                    case ParserTimeZone.LocalEastOfUtc:\n                    {\n                        TimeSpan offset = new TimeSpan(dateTimeParser.ZoneHour, dateTimeParser.ZoneMinute, 0);\n                        ticks = d.Ticks - offset.Ticks;\n                        if (ticks >= DateTime.MinValue.Ticks)\n                        {\n                            d = new DateTime(ticks, DateTimeKind.Utc).ToLocalTime();\n                        }\n                        else\n                        {\n                            ticks += d.GetUtcOffset().Ticks;\n                            if (ticks < DateTime.MinValue.Ticks)\n                                ticks = DateTime.MinValue.Ticks;\n\n                            d = new DateTime(ticks, DateTimeKind.Local);\n                        }\n                        break;\n                    }\n                }\n\n                dt = EnsureDateTime(d, dateTimeZoneHandling);\n                return true;\n            }\n        }\n\n        internal static bool TryParseDateTime(string s, DateParseHandling dateParseHandling, DateTimeZoneHandling dateTimeZoneHandling, string dateFormatString, CultureInfo culture, out object dt)\n        {\n            if (s.Length > 0)\n            {\n                if (s[0] == '/')\n                {\n                    if (s.StartsWith(\"/Date(\", StringComparison.Ordinal) && s.EndsWith(\")/\", StringComparison.Ordinal))\n                    {\n                        if (TryParseDateMicrosoft(s, dateParseHandling, dateTimeZoneHandling, out dt))\n                            return true;\n                    }\n                }\n                else if (s.Length >= 19 && s.Length <= 40 && char.IsDigit(s[0]) && s[10] == 'T')\n                {\n                    if (TryParseDateIso(s, dateParseHandling, dateTimeZoneHandling, out dt))\n                        return true;\n                }\n\n                if (!string.IsNullOrEmpty(dateFormatString))\n                {\n                    if (TryParseDateExact(s, dateParseHandling, dateTimeZoneHandling, dateFormatString, culture, out dt))\n                        return true;\n                }\n            }\n\n            dt = null;\n            return false;\n        }\n\n        private static bool TryParseDateMicrosoft(string text, DateParseHandling dateParseHandling, DateTimeZoneHandling dateTimeZoneHandling, out object dt)\n        {\n            string value = text.Substring(6, text.Length - 8);\n            DateTimeKind kind = DateTimeKind.Utc;\n\n            int index = value.IndexOf('+', 1);\n\n            if (index == -1)\n                index = value.IndexOf('-', 1);\n\n            TimeSpan offset = TimeSpan.Zero;\n\n            if (index != -1)\n            {\n                kind = DateTimeKind.Local;\n                offset = ReadOffset(value.Substring(index));\n                value = value.Substring(0, index);\n            }\n\n            long javaScriptTicks = long.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture);\n\n            DateTime utcDateTime = ConvertJavaScriptTicksToDateTime(javaScriptTicks);\n\n#if !NET20\n            if (dateParseHandling == DateParseHandling.DateTimeOffset)\n            {\n                dt = new DateTimeOffset(utcDateTime.Add(offset).Ticks, offset);\n                return true;\n            }\n            else\n#endif\n            {\n                DateTime dateTime;\n\n                switch (kind)\n                {\n                    case DateTimeKind.Unspecified:\n                        dateTime = DateTime.SpecifyKind(utcDateTime.ToLocalTime(), DateTimeKind.Unspecified);\n                        break;\n                    case DateTimeKind.Local:\n                        dateTime = utcDateTime.ToLocalTime();\n                        break;\n                    default:\n                        dateTime = utcDateTime;\n                        break;\n                }\n\n                dt = EnsureDateTime(dateTime, dateTimeZoneHandling);\n                return true;\n            }\n        }\n\n        private static bool TryParseDateExact(string text, DateParseHandling dateParseHandling, DateTimeZoneHandling dateTimeZoneHandling, string dateFormatString, CultureInfo culture, out object dt)\n        {\n#if !NET20\n            if (dateParseHandling == DateParseHandling.DateTimeOffset)\n            {\n                DateTimeOffset temp;\n                if (DateTimeOffset.TryParseExact(text, dateFormatString, culture, DateTimeStyles.RoundtripKind, out temp))\n                {\n                    dt = temp;\n                    return true;\n                }\n            }\n            else\n#endif\n            {\n                DateTime temp;\n                if (DateTime.TryParseExact(text, dateFormatString, culture, DateTimeStyles.RoundtripKind, out temp))\n                {\n                    temp = EnsureDateTime(temp, dateTimeZoneHandling);\n                    dt = temp;\n                    return true;\n                }\n            }\n\n            dt = null;\n            return false;\n        }\n\n        private static TimeSpan ReadOffset(string offsetText)\n        {\n            bool negative = (offsetText[0] == '-');\n\n            int hours = int.Parse(offsetText.Substring(1, 2), NumberStyles.Integer, CultureInfo.InvariantCulture);\n            int minutes = 0;\n            if (offsetText.Length >= 5)\n                minutes = int.Parse(offsetText.Substring(3, 2), NumberStyles.Integer, CultureInfo.InvariantCulture);\n\n            TimeSpan offset = TimeSpan.FromHours(hours) + TimeSpan.FromMinutes(minutes);\n            if (negative)\n                offset = offset.Negate();\n\n            return offset;\n        }\n        #endregion\n\n        #region Write\n        internal static void WriteDateTimeString(TextWriter writer, DateTime value, DateFormatHandling format, string formatString, CultureInfo culture)\n        {\n            if (string.IsNullOrEmpty(formatString))\n            {\n                char[] chars = new char[64];\n                int pos = WriteDateTimeString(chars, 0, value, null, value.Kind, format);\n                writer.Write(chars, 0, pos);\n            }\n            else\n            {\n                writer.Write(value.ToString(formatString, culture));\n            }\n        }\n\n        internal static int WriteDateTimeString(char[] chars, int start, DateTime value, TimeSpan? offset, DateTimeKind kind, DateFormatHandling format)\n        {\n            int pos = start;\n\n            if (format == DateFormatHandling.MicrosoftDateFormat)\n            {\n                TimeSpan o = offset ?? value.GetUtcOffset();\n\n                long javaScriptTicks = ConvertDateTimeToJavaScriptTicks(value, o);\n\n                @\"\\/Date(\".CopyTo(0, chars, pos, 7);\n                pos += 7;\n\n                string ticksText = javaScriptTicks.ToString(CultureInfo.InvariantCulture);\n                ticksText.CopyTo(0, chars, pos, ticksText.Length);\n                pos += ticksText.Length;\n\n                switch (kind)\n                {\n                    case DateTimeKind.Unspecified:\n                        if (value != DateTime.MaxValue && value != DateTime.MinValue)\n                            pos = WriteDateTimeOffset(chars, pos, o, format);\n                        break;\n                    case DateTimeKind.Local:\n                        pos = WriteDateTimeOffset(chars, pos, o, format);\n                        break;\n                }\n\n                @\")\\/\".CopyTo(0, chars, pos, 3);\n                pos += 3;\n            }\n            else\n            {\n                pos = WriteDefaultIsoDate(chars, pos, value);\n\n                switch (kind)\n                {\n                    case DateTimeKind.Local:\n                        pos = WriteDateTimeOffset(chars, pos, offset ?? value.GetUtcOffset(), format);\n                        break;\n                    case DateTimeKind.Utc:\n                        chars[pos++] = 'Z';\n                        break;\n                }\n            }\n\n            return pos;\n        }\n\n        internal static int WriteDefaultIsoDate(char[] chars, int start, DateTime dt)\n        {\n            int length = 19;\n\n            int year;\n            int month;\n            int day;\n            GetDateValues(dt, out year, out month, out day);\n\n            CopyIntToCharArray(chars, start, year, 4);\n            chars[start + 4] = '-';\n            CopyIntToCharArray(chars, start + 5, month, 2);\n            chars[start + 7] = '-';\n            CopyIntToCharArray(chars, start + 8, day, 2);\n            chars[start + 10] = 'T';\n            CopyIntToCharArray(chars, start + 11, dt.Hour, 2);\n            chars[start + 13] = ':';\n            CopyIntToCharArray(chars, start + 14, dt.Minute, 2);\n            chars[start + 16] = ':';\n            CopyIntToCharArray(chars, start + 17, dt.Second, 2);\n\n            int fraction = (int)(dt.Ticks % 10000000L);\n\n            if (fraction != 0)\n            {\n                int digits = 7;\n                while ((fraction % 10) == 0)\n                {\n                    digits--;\n                    fraction /= 10;\n                }\n\n                chars[start + 19] = '.';\n                CopyIntToCharArray(chars, start + 20, fraction, digits);\n\n                length += digits + 1;\n            }\n\n            return start + length;\n        }\n\n        private static void CopyIntToCharArray(char[] chars, int start, int value, int digits)\n        {\n            while (digits-- != 0)\n            {\n                chars[start + digits] = (char)((value % 10) + 48);\n                value /= 10;\n            }\n        }\n\n        internal static int WriteDateTimeOffset(char[] chars, int start, TimeSpan offset, DateFormatHandling format)\n        {\n            chars[start++] = (offset.Ticks >= 0L) ? '+' : '-';\n\n            int absHours = Math.Abs(offset.Hours);\n            CopyIntToCharArray(chars, start, absHours, 2);\n            start += 2;\n\n            if (format == DateFormatHandling.IsoDateFormat)\n                chars[start++] = ':';\n\n            int absMinutes = Math.Abs(offset.Minutes);\n            CopyIntToCharArray(chars, start, absMinutes, 2);\n            start += 2;\n\n            return start;\n        }\n\n#if !NET20\n        internal static void WriteDateTimeOffsetString(TextWriter writer, DateTimeOffset value, DateFormatHandling format, string formatString, CultureInfo culture)\n        {\n            if (string.IsNullOrEmpty(formatString))\n            {\n                char[] chars = new char[64];\n                int pos = WriteDateTimeString(chars, 0, (format == DateFormatHandling.IsoDateFormat) ? value.DateTime : value.UtcDateTime, value.Offset, DateTimeKind.Local, format);\n\n                writer.Write(chars, 0, pos);\n            }\n            else\n            {\n                writer.Write(value.ToString(formatString, culture));\n            }\n        }\n#endif\n        #endregion\n\n        private static void GetDateValues(DateTime td, out int year, out int month, out int day)\n        {\n            long ticks = td.Ticks;\n            // n = number of days since 1/1/0001\n            int n = (int)(ticks / TicksPerDay);\n            // y400 = number of whole 400-year periods since 1/1/0001\n            int y400 = n / DaysPer400Years;\n            // n = day number within 400-year period\n            n -= y400 * DaysPer400Years;\n            // y100 = number of whole 100-year periods within 400-year period\n            int y100 = n / DaysPer100Years;\n            // Last 100-year period has an extra day, so decrement result if 4\n            if (y100 == 4)\n                y100 = 3;\n            // n = day number within 100-year period\n            n -= y100 * DaysPer100Years;\n            // y4 = number of whole 4-year periods within 100-year period\n            int y4 = n / DaysPer4Years;\n            // n = day number within 4-year period\n            n -= y4 * DaysPer4Years;\n            // y1 = number of whole years within 4-year period\n            int y1 = n / DaysPerYear;\n            // Last year has an extra day, so decrement result if 4\n            if (y1 == 4)\n                y1 = 3;\n\n            year = y400 * 400 + y100 * 100 + y4 * 4 + y1 + 1;\n\n            // n = day number within year\n            n -= y1 * DaysPerYear;\n\n            // Leap year calculation looks different from IsLeapYear since y1, y4,\n            // and y100 are relative to year 1, not year 0\n            bool leapYear = y1 == 3 && (y4 != 24 || y100 == 3);\n            int[] days = leapYear ? DaysToMonth366 : DaysToMonth365;\n            // All months have less than 32 days, so n >> 5 is a good conservative\n            // estimate for the month\n            int m = n >> 5 + 1;\n            // m = 1-based month number\n            while (n >= days[m])\n            {\n                m++;\n            }\n\n            month = m;\n\n            // Return 1-based day-of-month\n            day = n - days[m - 1] + 1;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/DictionaryWrapper.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Threading;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal interface IWrappedDictionary\n        : IDictionary\n    {\n        object UnderlyingDictionary { get; }\n    }\n\n    internal class DictionaryWrapper<TKey, TValue> : IDictionary<TKey, TValue>, IWrappedDictionary\n    {\n        private readonly IDictionary _dictionary;\n        private readonly IDictionary<TKey, TValue> _genericDictionary;\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n        private readonly IReadOnlyDictionary<TKey, TValue> _readOnlyDictionary;\n#endif\n        private object _syncRoot;\n\n        public DictionaryWrapper(IDictionary dictionary)\n        {\n            ValidationUtils.ArgumentNotNull(dictionary, \"dictionary\");\n\n            _dictionary = dictionary;\n        }\n\n        public DictionaryWrapper(IDictionary<TKey, TValue> dictionary)\n        {\n            ValidationUtils.ArgumentNotNull(dictionary, \"dictionary\");\n\n            _genericDictionary = dictionary;\n        }\n\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n        public DictionaryWrapper(IReadOnlyDictionary<TKey, TValue> dictionary)\n        {\n            ValidationUtils.ArgumentNotNull(dictionary, \"dictionary\");\n\n            _readOnlyDictionary = dictionary;\n        }\n#endif\n\n        public void Add(TKey key, TValue value)\n        {\n            if (_dictionary != null)\n                _dictionary.Add(key, value);\n            else if (_genericDictionary != null)\n                _genericDictionary.Add(key, value);\n            else\n                throw new NotSupportedException();\n        }\n\n        public bool ContainsKey(TKey key)\n        {\n            if (_dictionary != null)\n                return _dictionary.Contains(key);\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n                return _readOnlyDictionary.ContainsKey(key);\n#endif\n            else\n                return _genericDictionary.ContainsKey(key);\n        }\n\n        public ICollection<TKey> Keys\n        {\n            get\n            {\n                if (_dictionary != null)\n                    return _dictionary.Keys.Cast<TKey>().ToList();\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    return _readOnlyDictionary.Keys.ToList();\n#endif\n                else\n                    return _genericDictionary.Keys;\n            }\n        }\n\n        public bool Remove(TKey key)\n        {\n            if (_dictionary != null)\n            {\n                if (_dictionary.Contains(key))\n                {\n                    _dictionary.Remove(key);\n                    return true;\n                }\n                else\n                {\n                    return false;\n                }\n            }\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n            {\n                throw new NotSupportedException();\n            }\n#endif\n            else\n            {\n                return _genericDictionary.Remove(key);\n            }\n        }\n\n        public bool TryGetValue(TKey key, out TValue value)\n        {\n            if (_dictionary != null)\n            {\n                if (!_dictionary.Contains(key))\n                {\n                    value = default(TValue);\n                    return false;\n                }\n                else\n                {\n                    value = (TValue)_dictionary[key];\n                    return true;\n                }\n            }\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n            {\n                throw new NotSupportedException();\n            }\n#endif\n            else\n            {\n                return _genericDictionary.TryGetValue(key, out value);\n            }\n        }\n\n        public ICollection<TValue> Values\n        {\n            get\n            {\n                if (_dictionary != null)\n                    return _dictionary.Values.Cast<TValue>().ToList();\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    return _readOnlyDictionary.Values.ToList();\n#endif\n                else\n                    return _genericDictionary.Values;\n            }\n        }\n\n        public TValue this[TKey key]\n        {\n            get\n            {\n                if (_dictionary != null)\n                    return (TValue)_dictionary[key];\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    return _readOnlyDictionary[key];\n#endif\n                else\n                    return _genericDictionary[key];\n            }\n            set\n            {\n                if (_dictionary != null)\n                    _dictionary[key] = value;\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    throw new NotSupportedException();\n#endif\n                else\n                    _genericDictionary[key] = value;\n            }\n        }\n\n        public void Add(KeyValuePair<TKey, TValue> item)\n        {\n            if (_dictionary != null)\n                ((IList)_dictionary).Add(item);\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n                throw new NotSupportedException();\n#endif\n            else if (_genericDictionary != null)\n                _genericDictionary.Add(item);\n        }\n\n        public void Clear()\n        {\n            if (_dictionary != null)\n                _dictionary.Clear();\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n                throw new NotSupportedException();\n#endif\n            else\n                _genericDictionary.Clear();\n        }\n\n        public bool Contains(KeyValuePair<TKey, TValue> item)\n        {\n            if (_dictionary != null)\n                return ((IList)_dictionary).Contains(item);\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n                return _readOnlyDictionary.Contains(item);\n#endif\n            else\n                return _genericDictionary.Contains(item);\n        }\n\n        public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)\n        {\n            if (_dictionary != null)\n            {\n                foreach (DictionaryEntry item in _dictionary)\n                {\n                    array[arrayIndex++] = new KeyValuePair<TKey, TValue>((TKey)item.Key, (TValue)item.Value);\n                }\n            }\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n            {\n                throw new NotSupportedException();\n            }\n#endif\n            else\n            {\n                _genericDictionary.CopyTo(array, arrayIndex);\n            }\n        }\n\n        public int Count\n        {\n            get\n            {\n                if (_dictionary != null)\n                    return _dictionary.Count;\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    return _readOnlyDictionary.Count;\n#endif\n                else\n                    return _genericDictionary.Count;\n            }\n        }\n\n        public bool IsReadOnly\n        {\n            get\n            {\n                if (_dictionary != null)\n                    return _dictionary.IsReadOnly;\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    return true;\n#endif\n                else\n                    return _genericDictionary.IsReadOnly;\n            }\n        }\n\n        public bool Remove(KeyValuePair<TKey, TValue> item)\n        {\n            if (_dictionary != null)\n            {\n                if (_dictionary.Contains(item.Key))\n                {\n                    object value = _dictionary[item.Key];\n\n                    if (object.Equals(value, item.Value))\n                    {\n                        _dictionary.Remove(item.Key);\n                        return true;\n                    }\n                    else\n                    {\n                        return false;\n                    }\n                }\n                else\n                {\n                    return true;\n                }\n            }\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n            {\n                throw new NotSupportedException();\n            }\n#endif\n            else\n            {\n                return _genericDictionary.Remove(item);\n            }\n        }\n\n        public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()\n        {\n            if (_dictionary != null)\n                return _dictionary.Cast<DictionaryEntry>().Select(de => new KeyValuePair<TKey, TValue>((TKey)de.Key, (TValue)de.Value)).GetEnumerator();\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n                return _readOnlyDictionary.GetEnumerator();\n#endif\n            else\n                return _genericDictionary.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        void IDictionary.Add(object key, object value)\n        {\n            if (_dictionary != null)\n                _dictionary.Add(key, value);\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n                throw new NotSupportedException();\n#endif\n            else\n                _genericDictionary.Add((TKey)key, (TValue)value);\n        }\n\n        object IDictionary.this[object key]\n        {\n            get\n            {\n                if (_dictionary != null)\n                    return _dictionary[key];\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    return _readOnlyDictionary[(TKey)key];\n#endif\n                else\n                    return _genericDictionary[(TKey)key];\n            }\n            set\n            {\n                if (_dictionary != null)\n                    _dictionary[key] = value;\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    throw new NotSupportedException();\n#endif\n                else\n                    _genericDictionary[(TKey)key] = (TValue)value;\n            }\n        }\n\n        private struct DictionaryEnumerator<TEnumeratorKey, TEnumeratorValue> : IDictionaryEnumerator\n        {\n            private readonly IEnumerator<KeyValuePair<TEnumeratorKey, TEnumeratorValue>> _e;\n\n            public DictionaryEnumerator(IEnumerator<KeyValuePair<TEnumeratorKey, TEnumeratorValue>> e)\n            {\n                ValidationUtils.ArgumentNotNull(e, \"e\");\n                _e = e;\n            }\n\n            public DictionaryEntry Entry\n            {\n                get { return (DictionaryEntry)Current; }\n            }\n\n            public object Key\n            {\n                get { return Entry.Key; }\n            }\n\n            public object Value\n            {\n                get { return Entry.Value; }\n            }\n\n            public object Current\n            {\n                get { return new DictionaryEntry(_e.Current.Key, _e.Current.Value); }\n            }\n\n            public bool MoveNext()\n            {\n                return _e.MoveNext();\n            }\n\n            public void Reset()\n            {\n                _e.Reset();\n            }\n        }\n\n        IDictionaryEnumerator IDictionary.GetEnumerator()\n        {\n            if (_dictionary != null)\n                return _dictionary.GetEnumerator();\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n                return new DictionaryEnumerator<TKey, TValue>(_readOnlyDictionary.GetEnumerator());\n#endif\n            else\n                return new DictionaryEnumerator<TKey, TValue>(_genericDictionary.GetEnumerator());\n        }\n\n        bool IDictionary.Contains(object key)\n        {\n            if (_genericDictionary != null)\n                return _genericDictionary.ContainsKey((TKey)key);\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n                return _readOnlyDictionary.ContainsKey((TKey)key);\n#endif\n            else\n                return _dictionary.Contains(key);\n        }\n\n        bool IDictionary.IsFixedSize\n        {\n            get\n            {\n                if (_genericDictionary != null)\n                    return false;\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    return true;\n#endif\n                else\n                    return _dictionary.IsFixedSize;\n            }\n        }\n\n        ICollection IDictionary.Keys\n        {\n            get\n            {\n                if (_genericDictionary != null)\n                    return _genericDictionary.Keys.ToList();\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    return _readOnlyDictionary.Keys.ToList();\n#endif\n                else\n                    return _dictionary.Keys;\n            }\n        }\n\n        public void Remove(object key)\n        {\n            if (_dictionary != null)\n                _dictionary.Remove(key);\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n                throw new NotSupportedException();\n#endif\n            else\n                _genericDictionary.Remove((TKey)key);\n        }\n\n        ICollection IDictionary.Values\n        {\n            get\n            {\n                if (_genericDictionary != null)\n                    return _genericDictionary.Values.ToList();\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    return _readOnlyDictionary.Values.ToList();\n#endif\n                else\n                    return _dictionary.Values;\n            }\n        }\n\n        void ICollection.CopyTo(Array array, int index)\n        {\n            if (_dictionary != null)\n                _dictionary.CopyTo(array, index);\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n            else if (_readOnlyDictionary != null)\n                throw new NotSupportedException();\n#endif\n            else\n                _genericDictionary.CopyTo((KeyValuePair<TKey, TValue>[])array, index);\n        }\n\n        bool ICollection.IsSynchronized\n        {\n            get\n            {\n                if (_dictionary != null)\n                    return _dictionary.IsSynchronized;\n                else\n                    return false;\n            }\n        }\n\n        object ICollection.SyncRoot\n        {\n            get\n            {\n                if (_syncRoot == null)\n                    Interlocked.CompareExchange(ref _syncRoot, new object(), null);\n\n                return _syncRoot;\n            }\n        }\n\n        public object UnderlyingDictionary\n        {\n            get\n            {\n                if (_dictionary != null)\n                    return _dictionary;\n#if !(NET40 || NET35 || NET20 || PORTABLE40)\n                else if (_readOnlyDictionary != null)\n                    return _readOnlyDictionary;\n#endif\n                else\n                    return _genericDictionary;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/DynamicProxy.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NET35 || NET20 || PORTABLE40)\nusing System;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Text;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal class DynamicProxy<T>\n    {\n        public virtual IEnumerable<string> GetDynamicMemberNames(T instance)\n        {\n            return new string[0];\n        }\n\n        public virtual bool TryBinaryOperation(T instance, BinaryOperationBinder binder, object arg, out object result)\n        {\n            result = null;\n            return false;\n        }\n\n        public virtual bool TryConvert(T instance, ConvertBinder binder, out object result)\n        {\n            result = null;\n            return false;\n        }\n\n        public virtual bool TryCreateInstance(T instance, CreateInstanceBinder binder, object[] args, out object result)\n        {\n            result = null;\n            return false;\n        }\n\n        public virtual bool TryDeleteIndex(T instance, DeleteIndexBinder binder, object[] indexes)\n        {\n            return false;\n        }\n\n        public virtual bool TryDeleteMember(T instance, DeleteMemberBinder binder)\n        {\n            return false;\n        }\n\n        public virtual bool TryGetIndex(T instance, GetIndexBinder binder, object[] indexes, out object result)\n        {\n            result = null;\n            return false;\n        }\n\n        public virtual bool TryGetMember(T instance, GetMemberBinder binder, out object result)\n        {\n            result = null;\n            return false;\n        }\n\n        public virtual bool TryInvoke(T instance, InvokeBinder binder, object[] args, out object result)\n        {\n            result = null;\n            return false;\n        }\n\n        public virtual bool TryInvokeMember(T instance, InvokeMemberBinder binder, object[] args, out object result)\n        {\n            result = null;\n            return false;\n        }\n\n        public virtual bool TrySetIndex(T instance, SetIndexBinder binder, object[] indexes, object value)\n        {\n            return false;\n        }\n\n        public virtual bool TrySetMember(T instance, SetMemberBinder binder, object value)\n        {\n            return false;\n        }\n\n        public virtual bool TryUnaryOperation(T instance, UnaryOperationBinder binder, out object result)\n        {\n            result = null;\n            return false;\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Utilities/DynamicProxyMetaObject.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NET35 || NET20 || PORTABLE40)\nusing System;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Reflection;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal sealed class DynamicProxyMetaObject<T> : DynamicMetaObject\n    {\n        private readonly DynamicProxy<T> _proxy;\n        private readonly bool _dontFallbackFirst;\n\n        internal DynamicProxyMetaObject(Expression expression, T value, DynamicProxy<T> proxy, bool dontFallbackFirst)\n            : base(expression, BindingRestrictions.Empty, value)\n        {\n            _proxy = proxy;\n            _dontFallbackFirst = dontFallbackFirst;\n        }\n\n        private new T Value\n        {\n            get { return (T)base.Value; }\n        }\n\n        private bool IsOverridden(string method)\n        {\n            return ReflectionUtils.IsMethodOverridden(_proxy.GetType(), typeof(DynamicProxy<T>), method);\n        }\n\n        public override DynamicMetaObject BindGetMember(GetMemberBinder binder)\n        {\n            return IsOverridden(\"TryGetMember\")\n                ? CallMethodWithResult(\"TryGetMember\", binder, NoArgs, e => binder.FallbackGetMember(this, e))\n                : base.BindGetMember(binder);\n        }\n\n        public override DynamicMetaObject BindSetMember(SetMemberBinder binder, DynamicMetaObject value)\n        {\n            return IsOverridden(\"TrySetMember\")\n                ? CallMethodReturnLast(\"TrySetMember\", binder, GetArgs(value), e => binder.FallbackSetMember(this, value, e))\n                : base.BindSetMember(binder, value);\n        }\n\n        public override DynamicMetaObject BindDeleteMember(DeleteMemberBinder binder)\n        {\n            return IsOverridden(\"TryDeleteMember\")\n                ? CallMethodNoResult(\"TryDeleteMember\", binder, NoArgs, e => binder.FallbackDeleteMember(this, e))\n                : base.BindDeleteMember(binder);\n        }\n\n\n        public override DynamicMetaObject BindConvert(ConvertBinder binder)\n        {\n            return IsOverridden(\"TryConvert\")\n                ? CallMethodWithResult(\"TryConvert\", binder, NoArgs, e => binder.FallbackConvert(this, e))\n                : base.BindConvert(binder);\n        }\n\n        public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args)\n        {\n            if (!IsOverridden(\"TryInvokeMember\"))\n                return base.BindInvokeMember(binder, args);\n\n            //\n            // Generate a tree like:\n            //\n            // {\n            //   object result;\n            //   TryInvokeMember(payload, out result)\n            //      ? result\n            //      : TryGetMember(payload, out result)\n            //          ? FallbackInvoke(result)\n            //          : fallbackResult\n            // }\n            //\n            // Then it calls FallbackInvokeMember with this tree as the\n            // \"error\", giving the language the option of using this\n            // tree or doing .NET binding.\n            //\n            Fallback fallback = e => binder.FallbackInvokeMember(this, args, e);\n\n            DynamicMetaObject call = BuildCallMethodWithResult(\n                \"TryInvokeMember\",\n                binder,\n                GetArgArray(args),\n                BuildCallMethodWithResult(\n                    \"TryGetMember\",\n                    new GetBinderAdapter(binder),\n                    NoArgs,\n                    fallback(null),\n                    e => binder.FallbackInvoke(e, args, null)\n                    ),\n                null\n                );\n\n            return _dontFallbackFirst ? call : fallback(call);\n        }\n\n\n        public override DynamicMetaObject BindCreateInstance(CreateInstanceBinder binder, DynamicMetaObject[] args)\n        {\n            return IsOverridden(\"TryCreateInstance\")\n                ? CallMethodWithResult(\"TryCreateInstance\", binder, GetArgArray(args), e => binder.FallbackCreateInstance(this, args, e))\n                : base.BindCreateInstance(binder, args);\n        }\n\n        public override DynamicMetaObject BindInvoke(InvokeBinder binder, DynamicMetaObject[] args)\n        {\n            return IsOverridden(\"TryInvoke\")\n                ? CallMethodWithResult(\"TryInvoke\", binder, GetArgArray(args), e => binder.FallbackInvoke(this, args, e))\n                : base.BindInvoke(binder, args);\n        }\n\n        public override DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg)\n        {\n            return IsOverridden(\"TryBinaryOperation\")\n                ? CallMethodWithResult(\"TryBinaryOperation\", binder, GetArgs(arg), e => binder.FallbackBinaryOperation(this, arg, e))\n                : base.BindBinaryOperation(binder, arg);\n        }\n\n        public override DynamicMetaObject BindUnaryOperation(UnaryOperationBinder binder)\n        {\n            return IsOverridden(\"TryUnaryOperation\")\n                ? CallMethodWithResult(\"TryUnaryOperation\", binder, NoArgs, e => binder.FallbackUnaryOperation(this, e))\n                : base.BindUnaryOperation(binder);\n        }\n\n        public override DynamicMetaObject BindGetIndex(GetIndexBinder binder, DynamicMetaObject[] indexes)\n        {\n            return IsOverridden(\"TryGetIndex\")\n                ? CallMethodWithResult(\"TryGetIndex\", binder, GetArgArray(indexes), e => binder.FallbackGetIndex(this, indexes, e))\n                : base.BindGetIndex(binder, indexes);\n        }\n\n        public override DynamicMetaObject BindSetIndex(SetIndexBinder binder, DynamicMetaObject[] indexes, DynamicMetaObject value)\n        {\n            return IsOverridden(\"TrySetIndex\")\n                ? CallMethodReturnLast(\"TrySetIndex\", binder, GetArgArray(indexes, value), e => binder.FallbackSetIndex(this, indexes, value, e))\n                : base.BindSetIndex(binder, indexes, value);\n        }\n\n        public override DynamicMetaObject BindDeleteIndex(DeleteIndexBinder binder, DynamicMetaObject[] indexes)\n        {\n            return IsOverridden(\"TryDeleteIndex\")\n                ? CallMethodNoResult(\"TryDeleteIndex\", binder, GetArgArray(indexes), e => binder.FallbackDeleteIndex(this, indexes, e))\n                : base.BindDeleteIndex(binder, indexes);\n        }\n\n        private delegate DynamicMetaObject Fallback(DynamicMetaObject errorSuggestion);\n\n        private static readonly Expression[] NoArgs = new Expression[0];\n\n        private static Expression[] GetArgs(params DynamicMetaObject[] args)\n        {\n            return args.Select(arg => Expression.Convert(arg.Expression, typeof(object))).ToArray();\n        }\n\n        private static Expression[] GetArgArray(DynamicMetaObject[] args)\n        {\n            return new[] { Expression.NewArrayInit(typeof(object), GetArgs(args)) };\n        }\n\n        private static Expression[] GetArgArray(DynamicMetaObject[] args, DynamicMetaObject value)\n        {\n            return new Expression[]\n            {\n                Expression.NewArrayInit(typeof(object), GetArgs(args)),\n                Expression.Convert(value.Expression, typeof(object))\n            };\n        }\n\n        private static ConstantExpression Constant(DynamicMetaObjectBinder binder)\n        {\n            Type t = binder.GetType();\n            while (!t.IsVisible())\n                t = t.BaseType();\n            return Expression.Constant(binder, t);\n        }\n\n        /// <summary>\n        /// Helper method for generating a MetaObject which calls a\n        /// specific method on Dynamic that returns a result\n        /// </summary>\n        private DynamicMetaObject CallMethodWithResult(string methodName, DynamicMetaObjectBinder binder, Expression[] args, Fallback fallback, Fallback fallbackInvoke = null)\n        {\n            //\n            // First, call fallback to do default binding\n            // This produces either an error or a call to a .NET member\n            //\n            DynamicMetaObject fallbackResult = fallback(null);\n\n            DynamicMetaObject callDynamic = BuildCallMethodWithResult(methodName, binder, args, fallbackResult, fallbackInvoke);\n\n            //\n            // Now, call fallback again using our new MO as the error\n            // When we do this, one of two things can happen:\n            //   1. Binding will succeed, and it will ignore our call to\n            //      the dynamic method, OR\n            //   2. Binding will fail, and it will use the MO we created\n            //      above.\n            //\n\n            return _dontFallbackFirst ? callDynamic : fallback(callDynamic);\n        }\n\n        private DynamicMetaObject BuildCallMethodWithResult(string methodName, DynamicMetaObjectBinder binder, Expression[] args, DynamicMetaObject fallbackResult, Fallback fallbackInvoke)\n        {\n            //\n            // Build a new expression like:\n            // {\n            //   object result;\n            //   TryGetMember(payload, out result) ? fallbackInvoke(result) : fallbackResult\n            // }\n            //\n            ParameterExpression result = Expression.Parameter(typeof(object), null);\n\n            IList<Expression> callArgs = new List<Expression>();\n            callArgs.Add(Expression.Convert(Expression, typeof(T)));\n            callArgs.Add(Constant(binder));\n            callArgs.AddRange(args);\n            callArgs.Add(result);\n\n            DynamicMetaObject resultMetaObject = new DynamicMetaObject(result, BindingRestrictions.Empty);\n\n            // Need to add a conversion if calling TryConvert\n            if (binder.ReturnType != typeof(object))\n            {\n                UnaryExpression convert = Expression.Convert(resultMetaObject.Expression, binder.ReturnType);\n                // will always be a cast or unbox\n\n                resultMetaObject = new DynamicMetaObject(convert, resultMetaObject.Restrictions);\n            }\n\n            if (fallbackInvoke != null)\n                resultMetaObject = fallbackInvoke(resultMetaObject);\n\n            DynamicMetaObject callDynamic = new DynamicMetaObject(\n                Expression.Block(\n                    new[] { result },\n                    Expression.Condition(\n                        Expression.Call(\n                            Expression.Constant(_proxy),\n                            typeof(DynamicProxy<T>).GetMethod(methodName),\n                            callArgs\n                            ),\n                        resultMetaObject.Expression,\n                        fallbackResult.Expression,\n                        binder.ReturnType\n                        )\n                    ),\n                GetRestrictions().Merge(resultMetaObject.Restrictions).Merge(fallbackResult.Restrictions)\n                );\n\n            return callDynamic;\n        }\n\n        /// <summary>\n        /// Helper method for generating a MetaObject which calls a\n        /// specific method on Dynamic, but uses one of the arguments for\n        /// the result.\n        /// </summary>\n        private DynamicMetaObject CallMethodReturnLast(string methodName, DynamicMetaObjectBinder binder, Expression[] args, Fallback fallback)\n        {\n            //\n            // First, call fallback to do default binding\n            // This produces either an error or a call to a .NET member\n            //\n            DynamicMetaObject fallbackResult = fallback(null);\n\n            //\n            // Build a new expression like:\n            // {\n            //   object result;\n            //   TrySetMember(payload, result = value) ? result : fallbackResult\n            // }\n            //\n            ParameterExpression result = Expression.Parameter(typeof(object), null);\n\n            IList<Expression> callArgs = new List<Expression>();\n            callArgs.Add(Expression.Convert(Expression, typeof(T)));\n            callArgs.Add(Constant(binder));\n            callArgs.AddRange(args);\n            callArgs[args.Length + 1] = Expression.Assign(result, callArgs[args.Length + 1]);\n\n            DynamicMetaObject callDynamic = new DynamicMetaObject(\n                Expression.Block(\n                    new[] { result },\n                    Expression.Condition(\n                        Expression.Call(\n                            Expression.Constant(_proxy),\n                            typeof(DynamicProxy<T>).GetMethod(methodName),\n                            callArgs\n                            ),\n                        result,\n                        fallbackResult.Expression,\n                        typeof(object)\n                        )\n                    ),\n                GetRestrictions().Merge(fallbackResult.Restrictions)\n                );\n\n            //\n            // Now, call fallback again using our new MO as the error\n            // When we do this, one of two things can happen:\n            //   1. Binding will succeed, and it will ignore our call to\n            //      the dynamic method, OR\n            //   2. Binding will fail, and it will use the MO we created\n            //      above.\n            //\n            return _dontFallbackFirst ? callDynamic : fallback(callDynamic);\n        }\n\n        /// <summary>\n        /// Helper method for generating a MetaObject which calls a\n        /// specific method on Dynamic, but uses one of the arguments for\n        /// the result.\n        /// </summary>\n        private DynamicMetaObject CallMethodNoResult(string methodName, DynamicMetaObjectBinder binder, Expression[] args, Fallback fallback)\n        {\n            //\n            // First, call fallback to do default binding\n            // This produces either an error or a call to a .NET member\n            //\n            DynamicMetaObject fallbackResult = fallback(null);\n\n            IList<Expression> callArgs = new List<Expression>();\n            callArgs.Add(Expression.Convert(Expression, typeof(T)));\n            callArgs.Add(Constant(binder));\n            callArgs.AddRange(args);\n\n            //\n            // Build a new expression like:\n            //   if (TryDeleteMember(payload)) { } else { fallbackResult }\n            //\n            DynamicMetaObject callDynamic = new DynamicMetaObject(\n                Expression.Condition(\n                    Expression.Call(\n                        Expression.Constant(_proxy),\n                        typeof(DynamicProxy<T>).GetMethod(methodName),\n                        callArgs\n                        ),\n                    Expression.Empty(),\n                    fallbackResult.Expression,\n                    typeof(void)\n                    ),\n                GetRestrictions().Merge(fallbackResult.Restrictions)\n                );\n\n            //\n            // Now, call fallback again using our new MO as the error\n            // When we do this, one of two things can happen:\n            //   1. Binding will succeed, and it will ignore our call to\n            //      the dynamic method, OR\n            //   2. Binding will fail, and it will use the MO we created\n            //      above.\n            //\n            return _dontFallbackFirst ? callDynamic : fallback(callDynamic);\n        }\n\n        /// <summary>\n        /// Returns a Restrictions object which includes our current restrictions merged\n        /// with a restriction limiting our type\n        /// </summary>\n        private BindingRestrictions GetRestrictions()\n        {\n            return (Value == null && HasValue)\n                ? BindingRestrictions.GetInstanceRestriction(Expression, null)\n                : BindingRestrictions.GetTypeRestriction(Expression, LimitType);\n        }\n\n        public override IEnumerable<string> GetDynamicMemberNames()\n        {\n            return _proxy.GetDynamicMemberNames(Value);\n        }\n\n        // It is okay to throw NotSupported from this binder. This object\n        // is only used by DynamicObject.GetMember--it is not expected to\n        // (and cannot) implement binding semantics. It is just so the DO\n        // can use the Name and IgnoreCase properties.\n        private sealed class GetBinderAdapter : GetMemberBinder\n        {\n            internal GetBinderAdapter(InvokeMemberBinder binder) :\n                base(binder.Name, binder.IgnoreCase)\n            {\n            }\n\n            public override DynamicMetaObject FallbackGetMember(DynamicMetaObject target, DynamicMetaObject errorSuggestion)\n            {\n                throw new NotSupportedException();\n            }\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(PORTABLE || NETFX_CORE || PORTABLE40)\nusing System;\nusing System.Collections.Generic;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#endif\nusing System.Reflection;\nusing System.Reflection.Emit;\nusing Newtonsoft.Json.Serialization;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal class DynamicReflectionDelegateFactory : ReflectionDelegateFactory\n    {\n        public static DynamicReflectionDelegateFactory Instance = new DynamicReflectionDelegateFactory();\n\n        private static DynamicMethod CreateDynamicMethod(string name, Type returnType, Type[] parameterTypes, Type owner)\n        {\n            DynamicMethod dynamicMethod = !owner.IsInterface()\n                ? new DynamicMethod(name, returnType, parameterTypes, owner, true)\n                : new DynamicMethod(name, returnType, parameterTypes, owner.Module, true);\n\n            return dynamicMethod;\n        }\n\n        public override MethodCall<T, object> CreateMethodCall<T>(MethodBase method)\n        {\n            DynamicMethod dynamicMethod = CreateDynamicMethod(method.ToString(), typeof(object), new[] { typeof(object), typeof(object[]) }, method.DeclaringType);\n            ILGenerator generator = dynamicMethod.GetILGenerator();\n\n            GenerateCreateMethodCallIL(method, generator);\n\n            return (MethodCall<T, object>)dynamicMethod.CreateDelegate(typeof(MethodCall<T, object>));\n        }\n\n        private void GenerateCreateMethodCallIL(MethodBase method, ILGenerator generator)\n        {\n            ParameterInfo[] args = method.GetParameters();\n\n            Label argsOk = generator.DefineLabel();\n\n            generator.Emit(OpCodes.Ldarg_1);\n            generator.Emit(OpCodes.Ldlen);\n            generator.Emit(OpCodes.Ldc_I4, args.Length);\n            generator.Emit(OpCodes.Beq, argsOk);\n\n            generator.Emit(OpCodes.Newobj, typeof(TargetParameterCountException).GetConstructor(ReflectionUtils.EmptyTypes));\n            generator.Emit(OpCodes.Throw);\n\n            generator.MarkLabel(argsOk);\n\n            if (!method.IsConstructor && !method.IsStatic)\n                generator.PushInstance(method.DeclaringType);\n\n            for (int i = 0; i < args.Length; i++)\n            {\n                generator.Emit(OpCodes.Ldarg_1);\n                generator.Emit(OpCodes.Ldc_I4, i);\n                generator.Emit(OpCodes.Ldelem_Ref);\n\n                generator.UnboxIfNeeded(args[i].ParameterType);\n            }\n\n            if (method.IsConstructor)\n                generator.Emit(OpCodes.Newobj, (ConstructorInfo)method);\n            else\n                generator.CallMethod((MethodInfo)method);\n\n            Type returnType = method.IsConstructor\n                ? method.DeclaringType\n                : ((MethodInfo)method).ReturnType;\n\n            if (returnType != typeof(void))\n                generator.BoxIfNeeded(returnType);\n            else\n                generator.Emit(OpCodes.Ldnull);\n\n            generator.Return();\n        }\n\n        public override Func<T> CreateDefaultConstructor<T>(Type type)\n        {\n            DynamicMethod dynamicMethod = CreateDynamicMethod(\"Create\" + type.FullName, typeof(T), ReflectionUtils.EmptyTypes, type);\n            dynamicMethod.InitLocals = true;\n            ILGenerator generator = dynamicMethod.GetILGenerator();\n\n            GenerateCreateDefaultConstructorIL(type, generator);\n\n            return (Func<T>)dynamicMethod.CreateDelegate(typeof(Func<T>));\n        }\n\n        private void GenerateCreateDefaultConstructorIL(Type type, ILGenerator generator)\n        {\n            if (type.IsValueType())\n            {\n                generator.DeclareLocal(type);\n                generator.Emit(OpCodes.Ldloc_0);\n                generator.Emit(OpCodes.Box, type);\n            }\n            else\n            {\n                ConstructorInfo constructorInfo =\n                    type.GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null,\n                        ReflectionUtils.EmptyTypes, null);\n\n                if (constructorInfo == null)\n                    throw new ArgumentException(\"Could not get constructor for {0}.\".FormatWith(CultureInfo.InvariantCulture, type));\n\n                generator.Emit(OpCodes.Newobj, constructorInfo);\n            }\n\n            generator.Return();\n        }\n\n        public override Func<T, object> CreateGet<T>(PropertyInfo propertyInfo)\n        {\n            DynamicMethod dynamicMethod = CreateDynamicMethod(\"Get\" + propertyInfo.Name, typeof(T), new[] { typeof(object) }, propertyInfo.DeclaringType);\n            ILGenerator generator = dynamicMethod.GetILGenerator();\n\n            GenerateCreateGetPropertyIL(propertyInfo, generator);\n\n            return (Func<T, object>)dynamicMethod.CreateDelegate(typeof(Func<T, object>));\n        }\n\n        private void GenerateCreateGetPropertyIL(PropertyInfo propertyInfo, ILGenerator generator)\n        {\n            MethodInfo getMethod = propertyInfo.GetGetMethod(true);\n            if (getMethod == null)\n                throw new ArgumentException(\"Property '{0}' does not have a getter.\".FormatWith(CultureInfo.InvariantCulture, propertyInfo.Name));\n\n            if (!getMethod.IsStatic)\n                generator.PushInstance(propertyInfo.DeclaringType);\n\n            generator.CallMethod(getMethod);\n            generator.BoxIfNeeded(propertyInfo.PropertyType);\n            generator.Return();\n        }\n\n        public override Func<T, object> CreateGet<T>(FieldInfo fieldInfo)\n        {\n            DynamicMethod dynamicMethod = CreateDynamicMethod(\"Get\" + fieldInfo.Name, typeof(T), new[] { typeof(object) }, fieldInfo.DeclaringType);\n            ILGenerator generator = dynamicMethod.GetILGenerator();\n\n            GenerateCreateGetFieldIL(fieldInfo, generator);\n\n            return (Func<T, object>)dynamicMethod.CreateDelegate(typeof(Func<T, object>));\n        }\n\n        private void GenerateCreateGetFieldIL(FieldInfo fieldInfo, ILGenerator generator)\n        {\n            if (!fieldInfo.IsStatic)\n                generator.PushInstance(fieldInfo.DeclaringType);\n\n            generator.Emit(OpCodes.Ldfld, fieldInfo);\n            generator.BoxIfNeeded(fieldInfo.FieldType);\n            generator.Return();\n        }\n\n        public override Action<T, object> CreateSet<T>(FieldInfo fieldInfo)\n        {\n            DynamicMethod dynamicMethod = CreateDynamicMethod(\"Set\" + fieldInfo.Name, null, new[] { typeof(T), typeof(object) }, fieldInfo.DeclaringType);\n            ILGenerator generator = dynamicMethod.GetILGenerator();\n\n            GenerateCreateSetFieldIL(fieldInfo, generator);\n\n            return (Action<T, object>)dynamicMethod.CreateDelegate(typeof(Action<T, object>));\n        }\n\n        internal static void GenerateCreateSetFieldIL(FieldInfo fieldInfo, ILGenerator generator)\n        {\n            if (!fieldInfo.IsStatic)\n                generator.PushInstance(fieldInfo.DeclaringType);\n\n            generator.Emit(OpCodes.Ldarg_1);\n            generator.UnboxIfNeeded(fieldInfo.FieldType);\n            generator.Emit(OpCodes.Stfld, fieldInfo);\n            generator.Return();\n        }\n\n        public override Action<T, object> CreateSet<T>(PropertyInfo propertyInfo)\n        {\n            DynamicMethod dynamicMethod = CreateDynamicMethod(\"Set\" + propertyInfo.Name, null, new[] { typeof(T), typeof(object) }, propertyInfo.DeclaringType);\n            ILGenerator generator = dynamicMethod.GetILGenerator();\n\n            GenerateCreateSetPropertyIL(propertyInfo, generator);\n\n            return (Action<T, object>)dynamicMethod.CreateDelegate(typeof(Action<T, object>));\n        }\n\n        internal static void GenerateCreateSetPropertyIL(PropertyInfo propertyInfo, ILGenerator generator)\n        {\n            MethodInfo setMethod = propertyInfo.GetSetMethod(true);\n            if (!setMethod.IsStatic)\n                generator.PushInstance(propertyInfo.DeclaringType);\n\n            generator.Emit(OpCodes.Ldarg_1);\n            generator.UnboxIfNeeded(propertyInfo.PropertyType);\n            generator.CallMethod(setMethod);\n            generator.Return();\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Utilities/DynamicUtils.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NET35 || NET20 || PORTABLE40)\nusing System;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.Linq;\nusing System.Linq.Expressions;\n#if !(PORTABLE)\nusing System.Reflection;\n#else\nusing Microsoft.CSharp.RuntimeBinder;\n#endif\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Globalization;\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class DynamicUtils\n    {\n        internal static class BinderWrapper\n        {\n#if !(PORTABLE)\n            public const string CSharpAssemblyName = \"Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\";\n\n            private const string BinderTypeName = \"Microsoft.CSharp.RuntimeBinder.Binder, \" + CSharpAssemblyName;\n            private const string CSharpArgumentInfoTypeName = \"Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo, \" + CSharpAssemblyName;\n            private const string CSharpArgumentInfoFlagsTypeName = \"Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, \" + CSharpAssemblyName;\n            private const string CSharpBinderFlagsTypeName = \"Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags, \" + CSharpAssemblyName;\n\n            private static object _getCSharpArgumentInfoArray;\n            private static object _setCSharpArgumentInfoArray;\n            private static MethodCall<object, object> _getMemberCall;\n            private static MethodCall<object, object> _setMemberCall;\n            private static bool _init;\n\n            private static void Init()\n            {\n                if (!_init)\n                {\n                    Type binderType = Type.GetType(BinderTypeName, false);\n                    if (binderType == null)\n                        throw new InvalidOperationException(\"Could not resolve type '{0}'. You may need to add a reference to Microsoft.CSharp.dll to work with dynamic types.\".FormatWith(CultureInfo.InvariantCulture, BinderTypeName));\n\n                    // None\n                    _getCSharpArgumentInfoArray = CreateSharpArgumentInfoArray(0);\n                    // None, Constant | UseCompileTimeType\n                    _setCSharpArgumentInfoArray = CreateSharpArgumentInfoArray(0, 3);\n                    CreateMemberCalls();\n\n                    _init = true;\n                }\n            }\n\n            private static object CreateSharpArgumentInfoArray(params int[] values)\n            {\n                Type csharpArgumentInfoType = Type.GetType(CSharpArgumentInfoTypeName);\n                Type csharpArgumentInfoFlags = Type.GetType(CSharpArgumentInfoFlagsTypeName);\n\n                Array a = Array.CreateInstance(csharpArgumentInfoType, values.Length);\n\n                for (int i = 0; i < values.Length; i++)\n                {\n                    MethodInfo createArgumentInfoMethod = csharpArgumentInfoType.GetMethod(\"Create\", new[] { csharpArgumentInfoFlags, typeof(string) });\n                    object arg = createArgumentInfoMethod.Invoke(null, new object[] { 0, null });\n                    a.SetValue(arg, i);\n                }\n\n                return a;\n            }\n\n            private static void CreateMemberCalls()\n            {\n                Type csharpArgumentInfoType = Type.GetType(CSharpArgumentInfoTypeName, true);\n                Type csharpBinderFlagsType = Type.GetType(CSharpBinderFlagsTypeName, true);\n                Type binderType = Type.GetType(BinderTypeName, true);\n\n                Type csharpArgumentInfoTypeEnumerableType = typeof(IEnumerable<>).MakeGenericType(csharpArgumentInfoType);\n\n                MethodInfo getMemberMethod = binderType.GetMethod(\"GetMember\", new[] { csharpBinderFlagsType, typeof(string), typeof(Type), csharpArgumentInfoTypeEnumerableType });\n                _getMemberCall = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(getMemberMethod);\n\n                MethodInfo setMemberMethod = binderType.GetMethod(\"SetMember\", new[] { csharpBinderFlagsType, typeof(string), typeof(Type), csharpArgumentInfoTypeEnumerableType });\n                _setMemberCall = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(setMemberMethod);\n            }\n#endif\n\n            public static CallSiteBinder GetMember(string name, Type context)\n            {\n#if !(PORTABLE)\n                Init();\n                return (CallSiteBinder)_getMemberCall(null, 0, name, context, _getCSharpArgumentInfoArray);\n#else\n        return Binder.GetMember(\n          CSharpBinderFlags.None, name, context, new[] {CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)});\n#endif\n            }\n\n            public static CallSiteBinder SetMember(string name, Type context)\n            {\n#if !(PORTABLE)\n                Init();\n                return (CallSiteBinder)_setMemberCall(null, 0, name, context, _setCSharpArgumentInfoArray);\n#else\n        return Binder.SetMember(\n          CSharpBinderFlags.None, name, context, new[]\n                                                   {\n                                                     CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null),\n                                                     CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null)\n                                                   });\n#endif\n            }\n        }\n\n        public static IEnumerable<string> GetDynamicMemberNames(this IDynamicMetaObjectProvider dynamicProvider)\n        {\n            DynamicMetaObject metaObject = dynamicProvider.GetMetaObject(Expression.Constant(dynamicProvider));\n            return metaObject.GetDynamicMemberNames();\n        }\n    }\n\n    internal class NoThrowGetBinderMember : GetMemberBinder\n    {\n        private readonly GetMemberBinder _innerBinder;\n\n        public NoThrowGetBinderMember(GetMemberBinder innerBinder)\n            : base(innerBinder.Name, innerBinder.IgnoreCase)\n        {\n            _innerBinder = innerBinder;\n        }\n\n        public override DynamicMetaObject FallbackGetMember(DynamicMetaObject target, DynamicMetaObject errorSuggestion)\n        {\n            DynamicMetaObject retMetaObject = _innerBinder.Bind(target, new DynamicMetaObject[] { });\n\n            NoThrowExpressionVisitor noThrowVisitor = new NoThrowExpressionVisitor();\n            Expression resultExpression = noThrowVisitor.Visit(retMetaObject.Expression);\n\n            DynamicMetaObject finalMetaObject = new DynamicMetaObject(resultExpression, retMetaObject.Restrictions);\n            return finalMetaObject;\n        }\n    }\n\n    internal class NoThrowSetBinderMember : SetMemberBinder\n    {\n        private readonly SetMemberBinder _innerBinder;\n\n        public NoThrowSetBinderMember(SetMemberBinder innerBinder)\n            : base(innerBinder.Name, innerBinder.IgnoreCase)\n        {\n            _innerBinder = innerBinder;\n        }\n\n        public override DynamicMetaObject FallbackSetMember(DynamicMetaObject target, DynamicMetaObject value, DynamicMetaObject errorSuggestion)\n        {\n            DynamicMetaObject retMetaObject = _innerBinder.Bind(target, new DynamicMetaObject[] { value });\n\n            NoThrowExpressionVisitor noThrowVisitor = new NoThrowExpressionVisitor();\n            Expression resultExpression = noThrowVisitor.Visit(retMetaObject.Expression);\n\n            DynamicMetaObject finalMetaObject = new DynamicMetaObject(resultExpression, retMetaObject.Restrictions);\n            return finalMetaObject;\n        }\n    }\n\n    internal class NoThrowExpressionVisitor : ExpressionVisitor\n    {\n        internal static readonly object ErrorResult = new object();\n\n        protected override Expression VisitConditional(ConditionalExpression node)\n        {\n            // if the result of a test is to throw an error, rewrite to result an error result value\n            if (node.IfFalse.NodeType == ExpressionType.Throw)\n                return Expression.Condition(node.Test, node.IfTrue, Expression.Constant(ErrorResult));\n\n            return base.VisitConditional(node);\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Utilities/DynamicWrapper.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Reflection;\nusing System.Reflection.Emit;\nusing System.Resources;\nusing System.Globalization;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal class DynamicWrapperBase\n    {\n        protected internal object UnderlyingObject;\n    }\n\n    internal static class DynamicWrapper\n    {\n        private static readonly object _lock = new object();\n        private static readonly WrapperDictionary _wrapperDictionary = new WrapperDictionary();\n\n        private static ModuleBuilder _moduleBuilder;\n\n        private static ModuleBuilder ModuleBuilder\n        {\n            get\n            {\n                Init();\n                return _moduleBuilder;\n            }\n        }\n\n        private static void Init()\n        {\n            if (_moduleBuilder == null)\n            {\n                lock (_lock)\n                {\n                    if (_moduleBuilder == null)\n                    {\n                        AssemblyName assemblyName = new AssemblyName(\"Newtonsoft.Json.Dynamic\");\n                        assemblyName.KeyPair = new StrongNameKeyPair(GetStrongKey());\n\n                        AssemblyBuilder assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);\n                        _moduleBuilder = assembly.DefineDynamicModule(\"Newtonsoft.Json.DynamicModule\", false);\n                    }\n                }\n            }\n        }\n\n        private static byte[] GetStrongKey()\n        {\n            const string name = \"Newtonsoft.Json.Dynamic.snk\";\n\n            using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name))\n            {\n                if (stream == null)\n                    throw new MissingManifestResourceException(\"Should have \" + name + \" as an embedded resource.\");\n\n                int length = (int)stream.Length;\n                byte[] buffer = new byte[length];\n                stream.Read(buffer, 0, length);\n\n                return buffer;\n            }\n        }\n\n        public static Type GetWrapper(Type interfaceType, Type realObjectType)\n        {\n            Type wrapperType = _wrapperDictionary.GetType(interfaceType, realObjectType);\n\n            if (wrapperType == null)\n            {\n                lock (_lock)\n                {\n                    wrapperType = _wrapperDictionary.GetType(interfaceType, realObjectType);\n\n                    if (wrapperType == null)\n                    {\n                        wrapperType = GenerateWrapperType(interfaceType, realObjectType);\n                        _wrapperDictionary.SetType(interfaceType, realObjectType, wrapperType);\n                    }\n                }\n            }\n\n            return wrapperType;\n        }\n\n        public static object GetUnderlyingObject(object wrapper)\n        {\n            DynamicWrapperBase wrapperBase = wrapper as DynamicWrapperBase;\n            if (wrapperBase == null)\n                throw new ArgumentException(\"Object is not a wrapper.\", \"wrapper\");\n\n            return wrapperBase.UnderlyingObject;\n        }\n\n        private static Type GenerateWrapperType(Type interfaceType, Type underlyingType)\n        {\n            TypeBuilder wrapperBuilder = ModuleBuilder.DefineType(\n                \"{0}_{1}_Wrapper\".FormatWith(CultureInfo.InvariantCulture, interfaceType.Name, underlyingType.Name),\n                TypeAttributes.NotPublic | TypeAttributes.Sealed,\n                typeof(DynamicWrapperBase),\n                new[] { interfaceType });\n\n            WrapperMethodBuilder wrapperMethod = new WrapperMethodBuilder(underlyingType, wrapperBuilder);\n\n            foreach (MethodInfo method in interfaceType.GetAllMethods())\n            {\n                wrapperMethod.Generate(method);\n            }\n\n            return wrapperBuilder.CreateType();\n        }\n\n        public static T CreateWrapper<T>(object realObject) where T : class\n        {\n            var dynamicType = GetWrapper(typeof(T), realObject.GetType());\n            var dynamicWrapper = (DynamicWrapperBase)Activator.CreateInstance(dynamicType);\n\n            dynamicWrapper.UnderlyingObject = realObject;\n\n            return dynamicWrapper as T;\n        }\n    }\n\n    internal class WrapperMethodBuilder\n    {\n        private readonly Type _realObjectType;\n        private readonly TypeBuilder _wrapperBuilder;\n\n        public WrapperMethodBuilder(Type realObjectType, TypeBuilder proxyBuilder)\n        {\n            _realObjectType = realObjectType;\n            _wrapperBuilder = proxyBuilder;\n        }\n\n        public void Generate(MethodInfo newMethod)\n        {\n            if (newMethod.IsGenericMethod)\n                newMethod = newMethod.GetGenericMethodDefinition();\n\n            FieldInfo srcField = typeof(DynamicWrapperBase).GetField(\"UnderlyingObject\", BindingFlags.Instance | BindingFlags.NonPublic);\n\n            var parameters = newMethod.GetParameters();\n            var parameterTypes = parameters.Select(parameter => parameter.ParameterType).ToArray();\n\n            MethodBuilder methodBuilder = _wrapperBuilder.DefineMethod(\n                newMethod.Name,\n                MethodAttributes.Public | MethodAttributes.Virtual,\n                newMethod.ReturnType,\n                parameterTypes);\n\n            if (newMethod.IsGenericMethod)\n            {\n                methodBuilder.DefineGenericParameters(\n                    newMethod.GetGenericArguments().Select(arg => arg.Name).ToArray());\n            }\n\n            ILGenerator ilGenerator = methodBuilder.GetILGenerator();\n\n            LoadUnderlyingObject(ilGenerator, srcField);\n            PushParameters(parameters, ilGenerator);\n            ExecuteMethod(newMethod, parameterTypes, ilGenerator);\n            Return(ilGenerator);\n        }\n\n        private static void Return(ILGenerator ilGenerator)\n        {\n            ilGenerator.Emit(OpCodes.Ret);\n        }\n\n        private void ExecuteMethod(MethodBase newMethod, Type[] parameterTypes, ILGenerator ilGenerator)\n        {\n            MethodInfo srcMethod = GetMethod(newMethod, parameterTypes);\n\n            if (srcMethod == null)\n                throw new MissingMethodException(\"Unable to find method \" + newMethod.Name + \" on \" + _realObjectType.FullName);\n\n            ilGenerator.Emit(OpCodes.Call, srcMethod);\n        }\n\n        private MethodInfo GetMethod(MethodBase realMethod, Type[] parameterTypes)\n        {\n            if (realMethod.IsGenericMethod)\n                return _realObjectType.GetGenericMethod(realMethod.Name, parameterTypes);\n\n            return _realObjectType.GetMethod(realMethod.Name, parameterTypes);\n        }\n\n        private static void PushParameters(ICollection<ParameterInfo> parameters, ILGenerator ilGenerator)\n        {\n            for (int i = 1; i < parameters.Count + 1; i++)\n                ilGenerator.Emit(OpCodes.Ldarg, i);\n        }\n\n        private static void LoadUnderlyingObject(ILGenerator ilGenerator, FieldInfo srcField)\n        {\n            ilGenerator.Emit(OpCodes.Ldarg_0);\n            ilGenerator.Emit(OpCodes.Ldfld, srcField);\n        }\n    }\n\n    internal class WrapperDictionary\n    {\n        private readonly Dictionary<string, Type> _wrapperTypes = new Dictionary<string, Type>();\n\n        private static string GenerateKey(Type interfaceType, Type realObjectType)\n        {\n            return interfaceType.Name + \"_\" + realObjectType.Name;\n        }\n\n        public Type GetType(Type interfaceType, Type realObjectType)\n        {\n            string key = GenerateKey(interfaceType, realObjectType);\n\n            if (_wrapperTypes.ContainsKey(key))\n                return _wrapperTypes[key];\n\n            return null;\n        }\n\n        public void SetType(Type interfaceType, Type realObjectType, Type wrapperType)\n        {\n            string key = GenerateKey(interfaceType, realObjectType);\n\n            if (_wrapperTypes.ContainsKey(key))\n                _wrapperTypes[key] = wrapperType;\n            else\n                _wrapperTypes.Add(key, wrapperType);\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Utilities/EnumUtils.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\nusing System.Reflection;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class EnumUtils\n    {\n        public static IList<T> GetFlagsValues<T>(T value) where T : struct\n        {\n            Type enumType = typeof(T);\n\n            if (!enumType.IsDefined(typeof(FlagsAttribute), false))\n                throw new ArgumentException(\"Enum type {0} is not a set of flags.\".FormatWith(CultureInfo.InvariantCulture, enumType));\n\n            Type underlyingType = Enum.GetUnderlyingType(value.GetType());\n\n            ulong num = Convert.ToUInt64(value, CultureInfo.InvariantCulture);\n            EnumValues<ulong> enumNameValues = GetNamesAndValues<T>();\n            IList<T> selectedFlagsValues = new List<T>();\n\n            foreach (EnumValue<ulong> enumNameValue in enumNameValues)\n            {\n                if ((num & enumNameValue.Value) == enumNameValue.Value && enumNameValue.Value != 0)\n                    selectedFlagsValues.Add((T)Convert.ChangeType(enumNameValue.Value, underlyingType, CultureInfo.CurrentCulture));\n            }\n\n            if (selectedFlagsValues.Count == 0 && enumNameValues.SingleOrDefault(v => v.Value == 0) != null)\n                selectedFlagsValues.Add(default(T));\n\n            return selectedFlagsValues;\n        }\n\n        /// <summary>\n        /// Gets a dictionary of the names and values of an Enum type.\n        /// </summary>\n        /// <returns></returns>\n        public static EnumValues<ulong> GetNamesAndValues<T>() where T : struct\n        {\n            return GetNamesAndValues<ulong>(typeof(T));\n        }\n\n        /// <summary>\n        /// Gets a dictionary of the names and values of an Enum type.\n        /// </summary>\n        /// <param name=\"enumType\">The enum type to get names and values for.</param>\n        /// <returns></returns>\n        public static EnumValues<TUnderlyingType> GetNamesAndValues<TUnderlyingType>(Type enumType) where TUnderlyingType : struct\n        {\n            if (enumType == null)\n                throw new ArgumentNullException(\"enumType\");\n\n            ValidationUtils.ArgumentTypeIsEnum(enumType, \"enumType\");\n\n            IList<object> enumValues = GetValues(enumType);\n            IList<string> enumNames = GetNames(enumType);\n\n            EnumValues<TUnderlyingType> nameValues = new EnumValues<TUnderlyingType>();\n\n            for (int i = 0; i < enumValues.Count; i++)\n            {\n                try\n                {\n                    nameValues.Add(new EnumValue<TUnderlyingType>(enumNames[i], (TUnderlyingType)Convert.ChangeType(enumValues[i], typeof(TUnderlyingType), CultureInfo.CurrentCulture)));\n                }\n                catch (OverflowException e)\n                {\n                    throw new InvalidOperationException(\n                        string.Format(CultureInfo.InvariantCulture, \"Value from enum with the underlying type of {0} cannot be added to dictionary with a value type of {1}. Value was too large: {2}\",\n                            Enum.GetUnderlyingType(enumType), typeof(TUnderlyingType), Convert.ToUInt64(enumValues[i], CultureInfo.InvariantCulture)), e);\n                }\n            }\n\n            return nameValues;\n        }\n\n        public static IList<object> GetValues(Type enumType)\n        {\n            if (!enumType.IsEnum())\n                throw new ArgumentException(\"Type '\" + enumType.Name + \"' is not an enum.\");\n\n            List<object> values = new List<object>();\n\n            var fields = from field in enumType.GetFields()\n                where field.IsLiteral\n                select field;\n\n            foreach (FieldInfo field in fields)\n            {\n                object value = field.GetValue(enumType);\n                values.Add(value);\n            }\n\n            return values;\n        }\n\n        public static IList<string> GetNames(Type enumType)\n        {\n            if (!enumType.IsEnum())\n                throw new ArgumentException(\"Type '\" + enumType.Name + \"' is not an enum.\");\n\n            List<string> values = new List<string>();\n\n            var fields = from field in enumType.GetFields()\n                where field.IsLiteral\n                select field;\n\n            foreach (FieldInfo field in fields)\n            {\n                values.Add(field.Name);\n            }\n\n            return values;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/EnumValue.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal class EnumValue<T> where T : struct\n    {\n        private readonly string _name;\n        private readonly T _value;\n\n        public string Name\n        {\n            get { return _name; }\n        }\n\n        public T Value\n        {\n            get { return _value; }\n        }\n\n        public EnumValue(string name, T value)\n        {\n            _name = name;\n            _value = value;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/EnumValues.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Collections.ObjectModel;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal class EnumValues<T> : KeyedCollection<string, EnumValue<T>> where T : struct\n    {\n        protected override string GetKeyForItem(EnumValue<T> item)\n        {\n            return item.Name;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/ExpressionReflectionDelegateFactory.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(PORTABLE40 || NET20 || NET35)\nusing System;\nusing System.Linq.Expressions;\nusing System.Reflection;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal class ExpressionReflectionDelegateFactory : ReflectionDelegateFactory\n    {\n        private static readonly ExpressionReflectionDelegateFactory _instance = new ExpressionReflectionDelegateFactory();\n\n        internal static ReflectionDelegateFactory Instance\n        {\n            get { return _instance; }\n        }\n\n        public override MethodCall<T, object> CreateMethodCall<T>(MethodBase method)\n        {\n            ValidationUtils.ArgumentNotNull(method, \"method\");\n\n            Type type = typeof(object);\n\n            ParameterExpression targetParameterExpression = Expression.Parameter(type, \"target\");\n            ParameterExpression argsParameterExpression = Expression.Parameter(typeof(object[]), \"args\");\n\n            ParameterInfo[] parametersInfo = method.GetParameters();\n\n            Expression[] argsExpression = new Expression[parametersInfo.Length];\n\n            for (int i = 0; i < parametersInfo.Length; i++)\n            {\n                Expression indexExpression = Expression.Constant(i);\n\n                Expression paramAccessorExpression = Expression.ArrayIndex(argsParameterExpression, indexExpression);\n\n                paramAccessorExpression = EnsureCastExpression(paramAccessorExpression, parametersInfo[i].ParameterType);\n\n                argsExpression[i] = paramAccessorExpression;\n            }\n\n            Expression callExpression;\n            if (method.IsConstructor)\n            {\n                callExpression = Expression.New((ConstructorInfo)method, argsExpression);\n            }\n            else if (method.IsStatic)\n            {\n                callExpression = Expression.Call((MethodInfo)method, argsExpression);\n            }\n            else\n            {\n                Expression readParameter = EnsureCastExpression(targetParameterExpression, method.DeclaringType);\n\n                callExpression = Expression.Call(readParameter, (MethodInfo)method, argsExpression);\n            }\n\n            if (method is MethodInfo)\n            {\n                MethodInfo m = (MethodInfo)method;\n                if (m.ReturnType != typeof(void))\n                    callExpression = EnsureCastExpression(callExpression, type);\n                else\n                    callExpression = Expression.Block(callExpression, Expression.Constant(null));\n            }\n            else\n            {\n                callExpression = EnsureCastExpression(callExpression, type);\n            }\n\n            LambdaExpression lambdaExpression = Expression.Lambda(typeof(MethodCall<T, object>), callExpression, targetParameterExpression, argsParameterExpression);\n\n            MethodCall<T, object> compiled = (MethodCall<T, object>)lambdaExpression.Compile();\n            return compiled;\n        }\n\n        public override Func<T> CreateDefaultConstructor<T>(Type type)\n        {\n            ValidationUtils.ArgumentNotNull(type, \"type\");\n\n            // avoid error from expressions compiler because of abstract class\n            if (type.IsAbstract())\n                return () => (T)Activator.CreateInstance(type);\n\n            try\n            {\n                Type resultType = typeof(T);\n\n                Expression expression = Expression.New(type);\n\n                expression = EnsureCastExpression(expression, resultType);\n\n                LambdaExpression lambdaExpression = Expression.Lambda(typeof(Func<T>), expression);\n\n                Func<T> compiled = (Func<T>)lambdaExpression.Compile();\n                return compiled;\n            }\n            catch\n            {\n                // an error can be thrown if constructor is not valid on Win8\n                // will have INVOCATION_FLAGS_NON_W8P_FX_API invocation flag\n                return () => (T)Activator.CreateInstance(type);\n            }\n        }\n\n        public override Func<T, object> CreateGet<T>(PropertyInfo propertyInfo)\n        {\n            ValidationUtils.ArgumentNotNull(propertyInfo, \"propertyInfo\");\n\n            Type instanceType = typeof(T);\n            Type resultType = typeof(object);\n\n            ParameterExpression parameterExpression = Expression.Parameter(instanceType, \"instance\");\n            Expression resultExpression;\n\n            MethodInfo getMethod = propertyInfo.GetGetMethod(true);\n\n            if (getMethod.IsStatic)\n            {\n                resultExpression = Expression.MakeMemberAccess(null, propertyInfo);\n            }\n            else\n            {\n                Expression readParameter = EnsureCastExpression(parameterExpression, propertyInfo.DeclaringType);\n\n                resultExpression = Expression.MakeMemberAccess(readParameter, propertyInfo);\n            }\n\n            resultExpression = EnsureCastExpression(resultExpression, resultType);\n\n            LambdaExpression lambdaExpression = Expression.Lambda(typeof(Func<T, object>), resultExpression, parameterExpression);\n\n            Func<T, object> compiled = (Func<T, object>)lambdaExpression.Compile();\n            return compiled;\n        }\n\n        public override Func<T, object> CreateGet<T>(FieldInfo fieldInfo)\n        {\n            ValidationUtils.ArgumentNotNull(fieldInfo, \"fieldInfo\");\n\n            ParameterExpression sourceParameter = Expression.Parameter(typeof(T), \"source\");\n\n            Expression fieldExpression;\n            if (fieldInfo.IsStatic)\n            {\n                fieldExpression = Expression.Field(null, fieldInfo);\n            }\n            else\n            {\n                Expression sourceExpression = EnsureCastExpression(sourceParameter, fieldInfo.DeclaringType);\n\n                fieldExpression = Expression.Field(sourceExpression, fieldInfo);\n            }\n\n            fieldExpression = EnsureCastExpression(fieldExpression, typeof(object));\n\n            Func<T, object> compiled = Expression.Lambda<Func<T, object>>(fieldExpression, sourceParameter).Compile();\n            return compiled;\n        }\n\n        public override Action<T, object> CreateSet<T>(FieldInfo fieldInfo)\n        {\n            ValidationUtils.ArgumentNotNull(fieldInfo, \"fieldInfo\");\n\n            // use reflection for structs\n            // expression doesn't correctly set value\n            if (fieldInfo.DeclaringType.IsValueType() || fieldInfo.IsInitOnly)\n                return LateBoundReflectionDelegateFactory.Instance.CreateSet<T>(fieldInfo);\n\n            ParameterExpression sourceParameterExpression = Expression.Parameter(typeof(T), \"source\");\n            ParameterExpression valueParameterExpression = Expression.Parameter(typeof(object), \"value\");\n\n            Expression fieldExpression;\n            if (fieldInfo.IsStatic)\n            {\n                fieldExpression = Expression.Field(null, fieldInfo);\n            }\n            else\n            {\n                Expression sourceExpression = EnsureCastExpression(sourceParameterExpression, fieldInfo.DeclaringType);\n\n                fieldExpression = Expression.Field(sourceExpression, fieldInfo);\n            }\n\n            Expression valueExpression = EnsureCastExpression(valueParameterExpression, fieldExpression.Type);\n\n            BinaryExpression assignExpression = Expression.Assign(fieldExpression, valueExpression);\n\n            LambdaExpression lambdaExpression = Expression.Lambda(typeof(Action<T, object>), assignExpression, sourceParameterExpression, valueParameterExpression);\n\n            Action<T, object> compiled = (Action<T, object>)lambdaExpression.Compile();\n            return compiled;\n        }\n\n        public override Action<T, object> CreateSet<T>(PropertyInfo propertyInfo)\n        {\n            ValidationUtils.ArgumentNotNull(propertyInfo, \"propertyInfo\");\n\n            // use reflection for structs\n            // expression doesn't correctly set value\n            if (propertyInfo.DeclaringType.IsValueType())\n                return LateBoundReflectionDelegateFactory.Instance.CreateSet<T>(propertyInfo);\n\n            Type instanceType = typeof(T);\n            Type valueType = typeof(object);\n\n            ParameterExpression instanceParameter = Expression.Parameter(instanceType, \"instance\");\n\n            ParameterExpression valueParameter = Expression.Parameter(valueType, \"value\");\n            Expression readValueParameter = EnsureCastExpression(valueParameter, propertyInfo.PropertyType);\n\n            MethodInfo setMethod = propertyInfo.GetSetMethod(true);\n\n            Expression setExpression;\n            if (setMethod.IsStatic)\n            {\n                setExpression = Expression.Call(setMethod, readValueParameter);\n            }\n            else\n            {\n                Expression readInstanceParameter = EnsureCastExpression(instanceParameter, propertyInfo.DeclaringType);\n\n                setExpression = Expression.Call(readInstanceParameter, setMethod, readValueParameter);\n            }\n\n            LambdaExpression lambdaExpression = Expression.Lambda(typeof(Action<T, object>), setExpression, instanceParameter, valueParameter);\n\n            Action<T, object> compiled = (Action<T, object>)lambdaExpression.Compile();\n            return compiled;\n        }\n\n        private Expression EnsureCastExpression(Expression expression, Type targetType)\n        {\n            Type expressionType = expression.Type;\n\n            // check if a cast or conversion is required\n            if (expressionType == targetType || (!expressionType.IsValueType() && targetType.IsAssignableFrom(expressionType)))\n                return expression;\n\n            return Expression.Convert(expression, targetType);\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Utilities/FSharpUtils.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System.Threading;\n#if !(NET35 || NET20 || NETFX_CORE)\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class FSharpUtils\n    {\n        private static readonly object Lock = new object();\n\n        private static bool _initialized;\n        private static MethodInfo _ofSeq;\n\n        public static Assembly FSharpCoreAssembly { get; private set; }\n        public static MethodCall<object, object> IsUnion { get; private set; }\n        public static MethodCall<object, object> GetUnionFields { get; private set; }\n        public static MethodCall<object, object> GetUnionCases { get; private set; }\n        public static MethodCall<object, object> MakeUnion { get; private set; }\n        public static Func<object, object> GetUnionCaseInfoName { get; private set; }\n        public static Func<object, object> GetUnionCaseInfo { get; private set; }\n        public static Func<object, object> GetUnionCaseFields { get; private set; }\n        public static MethodCall<object, object> GetUnionCaseInfoFields { get; private set; }\n\n        public const string FSharpSetTypeName = \"FSharpSet`1\";\n        public const string FSharpListTypeName = \"FSharpList`1\";\n        public const string FSharpMapTypeName = \"FSharpMap`2\";\n\n        public static void EnsureInitialized(Assembly fsharpCoreAssembly)\n        {\n            if (!_initialized)\n            {\n                lock (Lock)\n                {\n                    if (!_initialized)\n                    {\n                        FSharpCoreAssembly = fsharpCoreAssembly;\n\n                        Type fsharpType = fsharpCoreAssembly.GetType(\"Microsoft.FSharp.Reflection.FSharpType\");\n\n                        MethodInfo isUnionMethodInfo = fsharpType.GetMethod(\"IsUnion\", BindingFlags.Public | BindingFlags.Static);\n                        IsUnion = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(isUnionMethodInfo);\n\n                        MethodInfo getUnionCasesMethodInfo = fsharpType.GetMethod(\"GetUnionCases\", BindingFlags.Public | BindingFlags.Static);\n                        GetUnionCases = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(getUnionCasesMethodInfo);\n\n                        Type fsharpValue = fsharpCoreAssembly.GetType(\"Microsoft.FSharp.Reflection.FSharpValue\");\n\n                        MethodInfo getUnionFieldsMethodInfo = fsharpValue.GetMethod(\"GetUnionFields\", BindingFlags.Public | BindingFlags.Static);\n                        GetUnionFields = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(getUnionFieldsMethodInfo);\n\n                        GetUnionCaseInfo = JsonTypeReflector.ReflectionDelegateFactory.CreateGet<object>(getUnionFieldsMethodInfo.ReturnType.GetProperty(\"Item1\"));\n                        GetUnionCaseFields = JsonTypeReflector.ReflectionDelegateFactory.CreateGet<object>(getUnionFieldsMethodInfo.ReturnType.GetProperty(\"Item2\"));\n\n                        MethodInfo makeUnionMethodInfo = fsharpValue.GetMethod(\"MakeUnion\", BindingFlags.Public | BindingFlags.Static);\n                        MakeUnion = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(makeUnionMethodInfo);\n\n                        Type unionCaseInfo = fsharpCoreAssembly.GetType(\"Microsoft.FSharp.Reflection.UnionCaseInfo\");\n\n                        GetUnionCaseInfoName = JsonTypeReflector.ReflectionDelegateFactory.CreateGet<object>(unionCaseInfo.GetProperty(\"Name\"));\n                        GetUnionCaseInfoFields = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(unionCaseInfo.GetMethod(\"GetFields\"));\n\n                        Type listModule = fsharpCoreAssembly.GetType(\"Microsoft.FSharp.Collections.ListModule\");\n                        _ofSeq = listModule.GetMethod(\"OfSeq\");\n\n#if !(NETFX_CORE || PORTABLE)\n                        Thread.MemoryBarrier();\n#endif\n                        _initialized = true;\n                    }\n                }\n            }\n        }\n\n        public static MethodInfo CreateSeq(Type t)\n        {\n            MethodInfo seqType = _ofSeq.MakeGenericMethod(t);\n\n            return seqType;\n        }\n\n        public static MethodInfo CreateMap(Type keyType, Type valueType)\n        {\n            Type t = typeof(FSharpMapCreator<,>).MakeGenericType(keyType, valueType);\n\n            MethodInfo initializeMethod = t.GetMethod(\"EnsureInitialized\");\n\n            initializeMethod.Invoke(null, new object[] { FSharpCoreAssembly });\n\n            MethodInfo typedCreateMethod = t.GetMethod(\"CreateMapGeneric\");\n\n            return typedCreateMethod;\n        }\n\n    }\n\n    internal static class FSharpMapCreator<TKey, TValue>\n    {\n        private static bool _initialized;\n        private static MethodCall<object, object> _createMap;\n\n        public static void EnsureInitialized(Assembly fsharpCoreAssembly)\n        {\n            if (!_initialized)\n            {\n                Type mapType = fsharpCoreAssembly.GetType(\"Microsoft.FSharp.Collections.FSharpMap`2\");\n\n                Type genericMapType = mapType.MakeGenericType(typeof(TKey), typeof(TValue));\n\n                ConstructorInfo ctor = genericMapType.GetConstructor(new[] { typeof(IEnumerable<Tuple<TKey, TValue>>) });\n\n                _createMap = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object>(ctor);\n                \n                _initialized = true;\n            }\n        }\n\n        public static object CreateMapGeneric(IEnumerable<KeyValuePair<TKey, TValue>> values)\n        {\n            IEnumerable<Tuple<TKey, TValue>> tupleValues = values.Select(kv => new Tuple<TKey, TValue>(kv.Key, kv.Value));\n\n            object map = _createMap(null, tupleValues);\n            return map;\n        }\n    }\n}\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(PORTABLE40 || PORTABLE || NETFX_CORE)\nusing System;\nusing System.Reflection.Emit;\nusing System.Reflection;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class ILGeneratorExtensions\n    {\n        public static void PushInstance(this ILGenerator generator, Type type)\n        {\n            generator.Emit(OpCodes.Ldarg_0);\n            if (type.IsValueType())\n                generator.Emit(OpCodes.Unbox, type);\n            else\n                generator.Emit(OpCodes.Castclass, type);\n        }\n\n        public static void BoxIfNeeded(this ILGenerator generator, Type type)\n        {\n            if (type.IsValueType())\n                generator.Emit(OpCodes.Box, type);\n            else\n                generator.Emit(OpCodes.Castclass, type);\n        }\n\n        public static void UnboxIfNeeded(this ILGenerator generator, Type type)\n        {\n            if (type.IsValueType())\n                generator.Emit(OpCodes.Unbox_Any, type);\n            else\n                generator.Emit(OpCodes.Castclass, type);\n        }\n\n        public static void CallMethod(this ILGenerator generator, MethodInfo methodInfo)\n        {\n            if (methodInfo.IsFinal || !methodInfo.IsVirtual)\n                generator.Emit(OpCodes.Call, methodInfo);\n            else\n                generator.Emit(OpCodes.Callvirt, methodInfo);\n        }\n\n        public static void Return(this ILGenerator generator)\n        {\n            generator.Emit(OpCodes.Ret);\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Utilities/ImmutableCollectionsUtils.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\n#if !(NET20 || NET35 || NET40 || PORTABLE40)\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class ImmutableCollectionsUtils\n    {\n        internal class ImmutableCollectionTypeInfo\n        {\n            public ImmutableCollectionTypeInfo(string contractTypeName, string createdTypeName, string builderTypeName)\n            {\n                ContractTypeName = contractTypeName;\n                CreatedTypeName = createdTypeName;\n                BuilderTypeName = builderTypeName;\n            }\n\n            public string ContractTypeName { get; set; }\n            public string CreatedTypeName { get; set; }\n            public string BuilderTypeName { get; set; }\n        }\n\n        private const string ImmutableListGenericInterfaceTypeName = \"System.Collections.Immutable.IImmutableList`1\";\n        private const string ImmutableQueueGenericInterfaceTypeName = \"System.Collections.Immutable.IImmutableQueue`1\";\n        private const string ImmutableStackGenericInterfaceTypeName = \"System.Collections.Immutable.IImmutableStack`1\";\n        private const string ImmutableSetGenericInterfaceTypeName = \"System.Collections.Immutable.IImmutableSet`1\";\n\n        private const string ImmutableArrayTypeName = \"System.Collections.Immutable.ImmutableArray\";\n        private const string ImmutableArrayGenericTypeName = \"System.Collections.Immutable.ImmutableArray`1\";\n\n        private const string ImmutableListTypeName = \"System.Collections.Immutable.ImmutableList\";\n        private const string ImmutableListGenericTypeName = \"System.Collections.Immutable.ImmutableList`1\";\n\n        private const string ImmutableQueueTypeName = \"System.Collections.Immutable.ImmutableQueue\";\n        private const string ImmutableQueueGenericTypeName = \"System.Collections.Immutable.ImmutableQueue`1\";\n\n        private const string ImmutableStackTypeName = \"System.Collections.Immutable.ImmutableStack\";\n        private const string ImmutableStackGenericTypeName = \"System.Collections.Immutable.ImmutableStack`1\";\n\n        private const string ImmutableSortedSetTypeName = \"System.Collections.Immutable.ImmutableSortedSet\";\n        private const string ImmutableSortedSetGenericTypeName = \"System.Collections.Immutable.ImmutableSortedSet`1\";\n\n        private const string ImmutableHashSetTypeName = \"System.Collections.Immutable.ImmutableHashSet\";\n        private const string ImmutableHashSetGenericTypeName = \"System.Collections.Immutable.ImmutableHashSet`1\";\n\n        private static readonly IList<ImmutableCollectionTypeInfo> ArrayContractImmutableCollectionDefinitions = new List<ImmutableCollectionTypeInfo>\n        {\n            new ImmutableCollectionTypeInfo(ImmutableListGenericInterfaceTypeName, ImmutableListGenericTypeName, ImmutableListTypeName),\n            new ImmutableCollectionTypeInfo(ImmutableListGenericTypeName, ImmutableListGenericTypeName, ImmutableListTypeName),\n            new ImmutableCollectionTypeInfo(ImmutableQueueGenericInterfaceTypeName, ImmutableQueueGenericTypeName, ImmutableQueueTypeName),\n            new ImmutableCollectionTypeInfo(ImmutableQueueGenericTypeName, ImmutableQueueGenericTypeName, ImmutableQueueTypeName),\n            new ImmutableCollectionTypeInfo(ImmutableStackGenericInterfaceTypeName, ImmutableStackGenericTypeName, ImmutableStackTypeName),\n            new ImmutableCollectionTypeInfo(ImmutableStackGenericTypeName, ImmutableStackGenericTypeName, ImmutableStackTypeName),\n            new ImmutableCollectionTypeInfo(ImmutableSetGenericInterfaceTypeName, ImmutableSortedSetGenericTypeName, ImmutableSortedSetTypeName),\n            new ImmutableCollectionTypeInfo(ImmutableSortedSetGenericTypeName, ImmutableSortedSetGenericTypeName, ImmutableSortedSetTypeName),\n            new ImmutableCollectionTypeInfo(ImmutableHashSetGenericTypeName, ImmutableHashSetGenericTypeName, ImmutableHashSetTypeName),\n            new ImmutableCollectionTypeInfo(ImmutableArrayGenericTypeName, ImmutableArrayGenericTypeName, ImmutableArrayTypeName)\n        };\n\n        private const string ImmutableDictionaryGenericInterfaceTypeName = \"System.Collections.Immutable.IImmutableDictionary`2\";\n\n        private const string ImmutableDictionaryTypeName = \"System.Collections.Immutable.ImmutableDictionary\";\n        private const string ImmutableDictionaryGenericTypeName = \"System.Collections.Immutable.ImmutableDictionary`2\";\n\n        private const string ImmutableSortedDictionaryTypeName = \"System.Collections.Immutable.ImmutableSortedDictionary\";\n        private const string ImmutableSortedDictionaryGenericTypeName = \"System.Collections.Immutable.ImmutableSortedDictionary`2\";\n\n        private static readonly IList<ImmutableCollectionTypeInfo> DictionaryContractImmutableCollectionDefinitions = new List<ImmutableCollectionTypeInfo>\n        {\n            new ImmutableCollectionTypeInfo(ImmutableDictionaryGenericInterfaceTypeName, ImmutableSortedDictionaryGenericTypeName, ImmutableSortedDictionaryTypeName),\n            new ImmutableCollectionTypeInfo(ImmutableSortedDictionaryGenericTypeName, ImmutableSortedDictionaryGenericTypeName, ImmutableSortedDictionaryTypeName),\n            new ImmutableCollectionTypeInfo(ImmutableDictionaryGenericTypeName, ImmutableDictionaryGenericTypeName, ImmutableDictionaryTypeName)\n        };\n\n        internal static bool TryBuildImmutableForArrayContract(Type underlyingType, Type collectionItemType, out Type createdType, out MethodBase parameterizedCreator)\n        {\n            if (underlyingType.IsGenericType())\n            {\n                string name = underlyingType.GetGenericTypeDefinition().FullName;\n                ImmutableCollectionTypeInfo definition = ArrayContractImmutableCollectionDefinitions.FirstOrDefault(d => d.ContractTypeName == name);\n                if (definition != null)\n                {\n                    Type createdTypeDefinition = Type.GetType(definition.CreatedTypeName + \", System.Collections.Immutable\");\n                    Type builderTypeDefinition = Type.GetType(definition.BuilderTypeName + \", System.Collections.Immutable\");\n                    if (createdTypeDefinition != null && builderTypeDefinition != null)\n                    {\n                        MethodInfo mb = builderTypeDefinition.GetMethods().FirstOrDefault(m => m.Name == \"CreateRange\" && m.GetParameters().Length == 1);\n                        if (mb != null)\n                        {\n                            createdType = createdTypeDefinition.MakeGenericType(collectionItemType);\n                            parameterizedCreator = mb.MakeGenericMethod(collectionItemType);\n                            return true;\n                        }\n                    }\n                }\n            }\n\n            createdType = null;\n            parameterizedCreator = null;\n            return false;\n        }\n\n        internal static bool TryBuildImmutableForDictionaryContract(Type underlyingType, Type keyItemType, Type valueItemType, out Type createdType, out MethodBase parameterizedCreator)\n        {\n            if (underlyingType.IsGenericType())\n            {\n                string name = underlyingType.GetGenericTypeDefinition().FullName;\n                ImmutableCollectionTypeInfo definition = DictionaryContractImmutableCollectionDefinitions.FirstOrDefault(d => d.ContractTypeName == name);\n                if (definition != null)\n                {\n                    Type createdTypeDefinition = Type.GetType(definition.CreatedTypeName + \", System.Collections.Immutable\");\n                    Type builderTypeDefinition = Type.GetType(definition.BuilderTypeName + \", System.Collections.Immutable\");\n                    if (createdTypeDefinition != null && builderTypeDefinition != null)\n                    {\n                        MethodInfo mb = builderTypeDefinition.GetMethods().FirstOrDefault(m =>\n                        {\n                            ParameterInfo[] parameters = m.GetParameters();\n\n                            return m.Name == \"CreateRange\" && parameters.Length == 1 && parameters[0].ParameterType.IsGenericType() && parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(IEnumerable<>);\n                        });\n                        if (mb != null)\n                        {\n                            createdType = createdTypeDefinition.MakeGenericType(keyItemType, valueItemType);\n                            parameterizedCreator = mb.MakeGenericMethod(keyItemType, valueItemType);\n                            return true;\n                        }\n                    }\n                }\n            }\n\n            createdType = null;\n            parameterizedCreator = null;\n            return false;\n        }\n    }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Utilities/JavaScriptUtils.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Collections.Generic;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n\n#endif\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class JavaScriptUtils\n    {\n        internal static readonly bool[] SingleQuoteCharEscapeFlags = new bool[128];\n        internal static readonly bool[] DoubleQuoteCharEscapeFlags = new bool[128];\n        internal static readonly bool[] HtmlCharEscapeFlags = new bool[128];\n\n        static JavaScriptUtils()\n        {\n            IList<char> escapeChars = new List<char>\n            {\n                '\\n', '\\r', '\\t', '\\\\', '\\f', '\\b',\n            };\n            for (int i = 0; i < ' '; i++)\n            {\n                escapeChars.Add((char)i);\n            }\n\n            foreach (var escapeChar in escapeChars.Union(new[] { '\\'' }))\n            {\n                SingleQuoteCharEscapeFlags[escapeChar] = true;\n            }\n            foreach (var escapeChar in escapeChars.Union(new[] { '\"' }))\n            {\n                DoubleQuoteCharEscapeFlags[escapeChar] = true;\n            }\n            foreach (var escapeChar in escapeChars.Union(new[] { '\"', '\\'', '<', '>', '&' }))\n            {\n                HtmlCharEscapeFlags[escapeChar] = true;\n            }\n        }\n\n        private const string EscapedUnicodeText = \"!\";\n\n        public static void WriteEscapedJavaScriptString(TextWriter writer, string s, char delimiter, bool appendDelimiters,\n            bool[] charEscapeFlags, StringEscapeHandling stringEscapeHandling, ref char[] writeBuffer)\n        {\n            // leading delimiter\n            if (appendDelimiters)\n                writer.Write(delimiter);\n\n            if (s != null)\n            {\n                int lastWritePosition = 0;\n\n                for (int i = 0; i < s.Length; i++)\n                {\n                    var c = s[i];\n\n                    if (c < charEscapeFlags.Length && !charEscapeFlags[c])\n                        continue;\n\n                    string escapedValue;\n\n                    switch (c)\n                    {\n                        case '\\t':\n                            escapedValue = @\"\\t\";\n                            break;\n                        case '\\n':\n                            escapedValue = @\"\\n\";\n                            break;\n                        case '\\r':\n                            escapedValue = @\"\\r\";\n                            break;\n                        case '\\f':\n                            escapedValue = @\"\\f\";\n                            break;\n                        case '\\b':\n                            escapedValue = @\"\\b\";\n                            break;\n                        case '\\\\':\n                            escapedValue = @\"\\\\\";\n                            break;\n                        case '\\u0085': // Next Line\n                            escapedValue = @\"\\u0085\";\n                            break;\n                        case '\\u2028': // Line Separator\n                            escapedValue = @\"\\u2028\";\n                            break;\n                        case '\\u2029': // Paragraph Separator\n                            escapedValue = @\"\\u2029\";\n                            break;\n                        default:\n                            if (c < charEscapeFlags.Length || stringEscapeHandling == StringEscapeHandling.EscapeNonAscii)\n                            {\n                                if (c == '\\'' && stringEscapeHandling != StringEscapeHandling.EscapeHtml)\n                                {\n                                    escapedValue = @\"\\'\";\n                                }\n                                else if (c == '\"' && stringEscapeHandling != StringEscapeHandling.EscapeHtml)\n                                {\n                                    escapedValue = @\"\\\"\"\";\n                                }\n                                else\n                                {\n                                    if (writeBuffer == null)\n                                        writeBuffer = new char[6];\n\n                                    StringUtils.ToCharAsUnicode(c, writeBuffer);\n\n                                    // slightly hacky but it saves multiple conditions in if test\n                                    escapedValue = EscapedUnicodeText;\n                                }\n                            }\n                            else\n                            {\n                                escapedValue = null;\n                            }\n                            break;\n                    }\n\n                    if (escapedValue == null)\n                        continue;\n\n                    bool isEscapedUnicodeText = string.Equals(escapedValue, EscapedUnicodeText);\n\n                    if (i > lastWritePosition)\n                    {\n                        int length = i - lastWritePosition + ((isEscapedUnicodeText) ? 6 : 0);\n                        int start = (isEscapedUnicodeText) ? 6 : 0;\n\n                        if (writeBuffer == null || writeBuffer.Length < length)\n                        {\n                            char[] newBuffer = new char[length];\n\n                            // the unicode text is already in the buffer\n                            // copy it over when creating new buffer\n                            if (isEscapedUnicodeText)\n                                Array.Copy(writeBuffer, newBuffer, 6);\n\n                            writeBuffer = newBuffer;\n                        }\n\n                        s.CopyTo(lastWritePosition, writeBuffer, start, length - start);\n\n                        // write unchanged chars before writing escaped text\n                        writer.Write(writeBuffer, start, length - start);\n                    }\n\n                    lastWritePosition = i + 1;\n                    if (!isEscapedUnicodeText)\n                        writer.Write(escapedValue);\n                    else\n                        writer.Write(writeBuffer, 0, 6);\n                }\n\n                if (lastWritePosition == 0)\n                {\n                    // no escaped text, write entire string\n                    writer.Write(s);\n                }\n                else\n                {\n                    int length = s.Length - lastWritePosition;\n\n                    if (writeBuffer == null || writeBuffer.Length < length)\n                        writeBuffer = new char[length];\n\n                    s.CopyTo(lastWritePosition, writeBuffer, 0, length);\n\n                    // write remaining text\n                    writer.Write(writeBuffer, 0, length);\n                }\n            }\n\n            // trailing delimiter\n            if (appendDelimiters)\n                writer.Write(delimiter);\n        }\n\n        public static string ToEscapedJavaScriptString(string value, char delimiter, bool appendDelimiters)\n        {\n            using (StringWriter w = StringUtils.CreateStringWriter(StringUtils.GetLength(value) ?? 16))\n            {\n                char[] buffer = null;\n                WriteEscapedJavaScriptString(w, value, delimiter, appendDelimiters, (delimiter == '\"') ? DoubleQuoteCharEscapeFlags : SingleQuoteCharEscapeFlags, StringEscapeHandling.Default, ref buffer);\n                return w.ToString();\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/LateBoundReflectionDelegateFactory.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing Newtonsoft.Json.Serialization;\nusing System.Reflection;\n\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#endif\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal class LateBoundReflectionDelegateFactory : ReflectionDelegateFactory\n    {\n        private static readonly LateBoundReflectionDelegateFactory _instance = new LateBoundReflectionDelegateFactory();\n\n        internal static ReflectionDelegateFactory Instance\n        {\n            get { return _instance; }\n        }\n\n        public override MethodCall<T, object> CreateMethodCall<T>(MethodBase method)\n        {\n            ValidationUtils.ArgumentNotNull(method, \"method\");\n\n            ConstructorInfo c = method as ConstructorInfo;\n            if (c != null)\n                return (o, a) => c.Invoke(a);\n\n            return (o, a) => method.Invoke(o, a);\n        }\n\n        public override Func<T> CreateDefaultConstructor<T>(Type type)\n        {\n            ValidationUtils.ArgumentNotNull(type, \"type\");\n\n            if (type.IsValueType())\n                return () => (T)Activator.CreateInstance(type);\n\n            ConstructorInfo constructorInfo = ReflectionUtils.GetDefaultConstructor(type, true);\n\n            return () => (T)constructorInfo.Invoke(null);\n        }\n\n        public override Func<T, object> CreateGet<T>(PropertyInfo propertyInfo)\n        {\n            ValidationUtils.ArgumentNotNull(propertyInfo, \"propertyInfo\");\n\n            return o => propertyInfo.GetValue(o, null);\n        }\n\n        public override Func<T, object> CreateGet<T>(FieldInfo fieldInfo)\n        {\n            ValidationUtils.ArgumentNotNull(fieldInfo, \"fieldInfo\");\n\n            return o => fieldInfo.GetValue(o);\n        }\n\n        public override Action<T, object> CreateSet<T>(FieldInfo fieldInfo)\n        {\n            ValidationUtils.ArgumentNotNull(fieldInfo, \"fieldInfo\");\n\n            return (o, v) => fieldInfo.SetValue(o, v);\n        }\n\n        public override Action<T, object> CreateSet<T>(PropertyInfo propertyInfo)\n        {\n            ValidationUtils.ArgumentNotNull(propertyInfo, \"propertyInfo\");\n\n            return (o, v) => propertyInfo.SetValue(o, v, null);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/LinqBridge.cs",
    "content": "﻿\n#if NET20\n\n#region License, Terms and Author(s)\n//\n// LINQBridge\n// Copyright (c) 2007-9 Atif Aziz, Joseph Albahari. All rights reserved.\n//\n//  Author(s):\n//\n//      Atif Aziz, http://www.raboof.com\n//\n// This library is free software; you can redistribute it and/or modify it \n// under the terms of the New BSD License, a copy of which should have \n// been delivered along with this distribution.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A \n// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, \n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY \n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n#endregion\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json.Utilities.LinqBridge\n{\n  /// <summary>\n  /// Provides a set of static (Shared in Visual Basic) methods for \n  /// querying objects that implement <see cref=\"IEnumerable{T}\" />.\n  /// </summary>\n  internal static partial class Enumerable\n  {\n    /// <summary>\n    /// Returns the input typed as <see cref=\"IEnumerable{T}\"/>.\n    /// </summary>\n\n    public static IEnumerable<TSource> AsEnumerable<TSource>(IEnumerable<TSource> source)\n    {\n      return source;\n    }\n\n    /// <summary>\n    /// Returns an empty <see cref=\"IEnumerable{T}\"/> that has the \n    /// specified type argument.\n    /// </summary>\n\n    public static IEnumerable<TResult> Empty<TResult>()\n    {\n      return Sequence<TResult>.Empty;\n    }\n\n    /// <summary>\n    /// Converts the elements of an <see cref=\"IEnumerable\"/> to the \n    /// specified type.\n    /// </summary>\n\n    public static IEnumerable<TResult> Cast<TResult>(\n      this IEnumerable source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return CastYield<TResult>(source);\n    }\n\n    private static IEnumerable<TResult> CastYield<TResult>(\n      IEnumerable source)\n    {\n      foreach (var item in source)\n        yield return (TResult) item;\n    }\n\n    /// <summary>\n    /// Filters the elements of an <see cref=\"IEnumerable\"/> based on a specified type.\n    /// </summary>\n\n    public static IEnumerable<TResult> OfType<TResult>(\n      this IEnumerable source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return OfTypeYield<TResult>(source);\n    }\n\n    private static IEnumerable<TResult> OfTypeYield<TResult>(\n      IEnumerable source)\n    {\n      foreach (var item in source)\n        if (item is TResult)\n          yield return (TResult) item;\n    }\n\n    /// <summary>\n    /// Generates a sequence of integral numbers within a specified range.\n    /// </summary>\n    /// <param name=\"start\">The value of the first integer in the sequence.</param>\n    /// <param name=\"count\">The number of sequential integers to generate.</param>\n\n    public static IEnumerable<int> Range(int start, int count)\n    {\n      if (count < 0)\n        throw new ArgumentOutOfRangeException(\"count\", count, null);\n\n      var end = (long) start + count;\n      if (end - 1 >= int.MaxValue)\n        throw new ArgumentOutOfRangeException(\"count\", count, null);\n\n      return RangeYield(start, end);\n    }\n\n    private static IEnumerable<int> RangeYield(int start, long end)\n    {\n      for (var i = start; i < end; i++)\n        yield return i;\n    }\n\n    /// <summary>\n    /// Generates a sequence that contains one repeated value.\n    /// </summary>\n\n    public static IEnumerable<TResult> Repeat<TResult>(TResult element, int count)\n    {\n      if (count < 0) throw new ArgumentOutOfRangeException(\"count\", count, null);\n\n      return RepeatYield(element, count);\n    }\n\n    private static IEnumerable<TResult> RepeatYield<TResult>(TResult element, int count)\n    {\n      for (var i = 0; i < count; i++)\n        yield return element;\n    }\n\n    /// <summary>\n    /// Filters a sequence of values based on a predicate.\n    /// </summary>\n\n    public static IEnumerable<TSource> Where<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      CheckNotNull(predicate, \"predicate\");\n\n      return source.Where((item, i) => predicate(item));\n    }\n\n    /// <summary>\n    /// Filters a sequence of values based on a predicate. \n    /// Each element's index is used in the logic of the predicate function.\n    /// </summary>\n\n    public static IEnumerable<TSource> Where<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int, bool> predicate)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(predicate, \"predicate\");\n\n      return WhereYield(source, predicate);\n    }\n\n    private static IEnumerable<TSource> WhereYield<TSource>(\n      IEnumerable<TSource> source,\n      Func<TSource, int, bool> predicate)\n    {\n      var i = 0;\n      foreach (var item in source)\n        if (predicate(item, i++))\n          yield return item;\n    }\n\n    /// <summary>\n    /// Projects each element of a sequence into a new form.\n    /// </summary>\n\n    public static IEnumerable<TResult> Select<TSource, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TResult> selector)\n    {\n      CheckNotNull(selector, \"selector\");\n\n      return source.Select((item, i) => selector(item));\n    }\n\n    /// <summary>\n    /// Projects each element of a sequence into a new form by \n    /// incorporating the element's index.\n    /// </summary>\n\n    public static IEnumerable<TResult> Select<TSource, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int, TResult> selector)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(selector, \"selector\");\n\n      return SelectYield(source, selector);\n    }\n\n    private static IEnumerable<TResult> SelectYield<TSource, TResult>(\n      IEnumerable<TSource> source,\n      Func<TSource, int, TResult> selector)\n    {\n      var i = 0;\n      foreach (var item in source)\n        yield return selector(item, i++);\n    }\n\n    /// <summary>\n    /// Projects each element of a sequence to an <see cref=\"IEnumerable{T}\" /> \n    /// and flattens the resulting sequences into one sequence.\n    /// </summary>\n\n    public static IEnumerable<TResult> SelectMany<TSource, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, IEnumerable<TResult>> selector)\n    {\n      CheckNotNull(selector, \"selector\");\n\n      return source.SelectMany((item, i) => selector(item));\n    }\n\n    /// <summary>\n    /// Projects each element of a sequence to an <see cref=\"IEnumerable{T}\" />, \n    /// and flattens the resulting sequences into one sequence. The \n    /// index of each source element is used in the projected form of \n    /// that element.\n    /// </summary>\n\n    public static IEnumerable<TResult> SelectMany<TSource, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int, IEnumerable<TResult>> selector)\n    {\n      CheckNotNull(selector, \"selector\");\n\n      return source.SelectMany(selector, (item, subitem) => subitem);\n    }\n\n    /// <summary>\n    /// Projects each element of a sequence to an <see cref=\"IEnumerable{T}\" />, \n    /// flattens the resulting sequences into one sequence, and invokes \n    /// a result selector function on each element therein.\n    /// </summary>\n\n    public static IEnumerable<TResult> SelectMany<TSource, TCollection, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, IEnumerable<TCollection>> collectionSelector,\n      Func<TSource, TCollection, TResult> resultSelector)\n    {\n      CheckNotNull(collectionSelector, \"collectionSelector\");\n\n      return source.SelectMany((item, i) => collectionSelector(item), resultSelector);\n    }\n\n    /// <summary>\n    /// Projects each element of a sequence to an <see cref=\"IEnumerable{T}\" />, \n    /// flattens the resulting sequences into one sequence, and invokes \n    /// a result selector function on each element therein. The index of \n    /// each source element is used in the intermediate projected form \n    /// of that element.\n    /// </summary>\n\n    public static IEnumerable<TResult> SelectMany<TSource, TCollection, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int, IEnumerable<TCollection>> collectionSelector,\n      Func<TSource, TCollection, TResult> resultSelector)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(collectionSelector, \"collectionSelector\");\n      CheckNotNull(resultSelector, \"resultSelector\");\n\n      return SelectManyYield(source, collectionSelector, resultSelector);\n    }\n\n    private static IEnumerable<TResult> SelectManyYield<TSource, TCollection, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int, IEnumerable<TCollection>> collectionSelector,\n      Func<TSource, TCollection, TResult> resultSelector)\n    {\n      var i = 0;\n      foreach (var item in source)\n        foreach (var subitem in collectionSelector(item, i++))\n          yield return resultSelector(item, subitem);\n    }\n\n    /// <summary>\n    /// Returns elements from a sequence as long as a specified condition is true.\n    /// </summary>\n\n    public static IEnumerable<TSource> TakeWhile<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      CheckNotNull(predicate, \"predicate\");\n\n      return source.TakeWhile((item, i) => predicate(item));\n    }\n\n    /// <summary>\n    /// Returns elements from a sequence as long as a specified condition is true.\n    /// The element's index is used in the logic of the predicate function.\n    /// </summary>\n\n    public static IEnumerable<TSource> TakeWhile<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int, bool> predicate)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(predicate, \"predicate\");\n\n      return TakeWhileYield(source, predicate);\n    }\n\n    private static IEnumerable<TSource> TakeWhileYield<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int, bool> predicate)\n    {\n      var i = 0;\n      foreach (var item in source)\n        if (predicate(item, i++))\n          yield return item;\n        else\n          break;\n    }\n\n    private static class Futures<T>\n    {\n      public static readonly Func<T> Default = () => default(T);\n      public static readonly Func<T> Undefined = () => { throw new InvalidOperationException(); };\n    }\n\n    /// <summary>\n    /// Base implementation of First operator.\n    /// </summary>\n\n    private static TSource FirstImpl<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource> empty)\n    {\n      CheckNotNull(source, \"source\");\n      Debug.Assert(empty != null);\n\n      var list = source as IList<TSource>; // optimized case for lists\n      if (list != null)\n        return list.Count > 0 ? list[0] : empty();\n\n      using (var e = source.GetEnumerator()) // fallback for enumeration\n        return e.MoveNext() ? e.Current : empty();\n    }\n\n    /// <summary>\n    /// Returns the first element of a sequence.\n    /// </summary>\n\n    public static TSource First<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      return source.FirstImpl(Futures<TSource>.Undefined);\n    }\n\n    /// <summary>\n    /// Returns the first element in a sequence that satisfies a specified condition.\n    /// </summary>\n\n    public static TSource First<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      return First(source.Where(predicate));\n    }\n\n    /// <summary>\n    /// Returns the first element of a sequence, or a default value if \n    /// the sequence contains no elements.\n    /// </summary>\n\n    public static TSource FirstOrDefault<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      return source.FirstImpl(Futures<TSource>.Default);\n    }\n\n    /// <summary>\n    /// Returns the first element of the sequence that satisfies a \n    /// condition or a default value if no such element is found.\n    /// </summary>\n\n    public static TSource FirstOrDefault<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      return FirstOrDefault(source.Where(predicate));\n    }\n\n    /// <summary>\n    /// Base implementation of Last operator.\n    /// </summary>\n\n    private static TSource LastImpl<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource> empty)\n    {\n      CheckNotNull(source, \"source\");\n\n      var list = source as IList<TSource>; // optimized case for lists\n      if (list != null)\n        return list.Count > 0 ? list[list.Count - 1] : empty();\n\n      using (var e = source.GetEnumerator())\n      {\n        if (!e.MoveNext())\n          return empty();\n\n        var last = e.Current;\n        while (e.MoveNext())\n          last = e.Current;\n\n        return last;\n      }\n    }\n\n    /// <summary>\n    /// Returns the last element of a sequence.\n    /// </summary>\n    public static TSource Last<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      return source.LastImpl(Futures<TSource>.Undefined);\n    }\n\n    /// <summary>\n    /// Returns the last element of a sequence that satisfies a \n    /// specified condition.\n    /// </summary>\n\n    public static TSource Last<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      return Last(source.Where(predicate));\n    }\n\n    /// <summary>\n    /// Returns the last element of a sequence, or a default value if \n    /// the sequence contains no elements.\n    /// </summary>\n\n    public static TSource LastOrDefault<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      return source.LastImpl(Futures<TSource>.Default);\n    }\n\n    /// <summary>\n    /// Returns the last element of a sequence that satisfies a \n    /// condition or a default value if no such element is found.\n    /// </summary>\n\n    public static TSource LastOrDefault<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      return LastOrDefault(source.Where(predicate));\n    }\n\n    /// <summary>\n    /// Base implementation of Single operator.\n    /// </summary>\n\n    private static TSource SingleImpl<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource> empty)\n    {\n      CheckNotNull(source, \"source\");\n\n      using (var e = source.GetEnumerator())\n      {\n        if (e.MoveNext())\n        {\n          var single = e.Current;\n          if (!e.MoveNext())\n            return single;\n\n          throw new InvalidOperationException();\n        }\n\n        return empty();\n      }\n    }\n\n    /// <summary>\n    /// Returns the only element of a sequence, and throws an exception \n    /// if there is not exactly one element in the sequence.\n    /// </summary>\n\n    public static TSource Single<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      return source.SingleImpl(Futures<TSource>.Undefined);\n    }\n\n    /// <summary>\n    /// Returns the only element of a sequence that satisfies a \n    /// specified condition, and throws an exception if more than one \n    /// such element exists.\n    /// </summary>\n\n    public static TSource Single<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      return Single(source.Where(predicate));\n    }\n\n    /// <summary>\n    /// Returns the only element of a sequence, or a default value if \n    /// the sequence is empty; this method throws an exception if there \n    /// is more than one element in the sequence.\n    /// </summary>\n\n    public static TSource SingleOrDefault<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      return source.SingleImpl(Futures<TSource>.Default);\n    }\n\n    /// <summary>\n    /// Returns the only element of a sequence that satisfies a \n    /// specified condition or a default value if no such element \n    /// exists; this method throws an exception if more than one element \n    /// satisfies the condition.\n    /// </summary>\n\n    public static TSource SingleOrDefault<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      return SingleOrDefault(source.Where(predicate));\n    }\n\n    /// <summary>\n    /// Returns the element at a specified index in a sequence.\n    /// </summary>\n\n    public static TSource ElementAt<TSource>(\n      this IEnumerable<TSource> source,\n      int index)\n    {\n      CheckNotNull(source, \"source\");\n\n      if (index < 0)\n        throw new ArgumentOutOfRangeException(\"index\", index, null);\n\n      var list = source as IList<TSource>;\n      if (list != null)\n        return list[index];\n\n      try\n      {\n        return source.SkipWhile((item, i) => i < index).First();\n      }\n      catch (InvalidOperationException) // if thrown by First\n      {\n        throw new ArgumentOutOfRangeException(\"index\", index, null);\n      }\n    }\n\n    /// <summary>\n    /// Returns the element at a specified index in a sequence or a \n    /// default value if the index is out of range.\n    /// </summary>\n\n    public static TSource ElementAtOrDefault<TSource>(\n      this IEnumerable<TSource> source,\n      int index)\n    {\n      CheckNotNull(source, \"source\");\n\n      if (index < 0)\n        return default(TSource);\n\n      var list = source as IList<TSource>;\n      if (list != null)\n        return index < list.Count ? list[index] : default(TSource);\n\n      return source.SkipWhile((item, i) => i < index).FirstOrDefault();\n    }\n\n    /// <summary>\n    /// Inverts the order of the elements in a sequence.\n    /// </summary>\n\n    public static IEnumerable<TSource> Reverse<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return ReverseYield(source);\n    }\n\n    private static IEnumerable<TSource> ReverseYield<TSource>(IEnumerable<TSource> source)\n    {\n      var stack = new Stack<TSource>();\n      foreach (var item in source)\n        stack.Push(item);\n\n      foreach (var item in stack)\n        yield return item;\n    }\n\n    /// <summary>\n    /// Returns a specified number of contiguous elements from the start \n    /// of a sequence.\n    /// </summary>\n\n    public static IEnumerable<TSource> Take<TSource>(\n      this IEnumerable<TSource> source,\n      int count)\n    {\n      return source.Where((item, i) => i < count);\n    }\n\n    /// <summary>\n    /// Bypasses a specified number of elements in a sequence and then \n    /// returns the remaining elements.\n    /// </summary>\n\n    public static IEnumerable<TSource> Skip<TSource>(\n      this IEnumerable<TSource> source,\n      int count)\n    {\n      return source.Where((item, i) => i >= count);\n    }\n\n    /// <summary>\n    /// Bypasses elements in a sequence as long as a specified condition \n    /// is true and then returns the remaining elements.\n    /// </summary>\n\n    public static IEnumerable<TSource> SkipWhile<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      CheckNotNull(predicate, \"predicate\");\n\n      return source.SkipWhile((item, i) => predicate(item));\n    }\n\n    /// <summary>\n    /// Bypasses elements in a sequence as long as a specified condition \n    /// is true and then returns the remaining elements. The element's \n    /// index is used in the logic of the predicate function.\n    /// </summary>\n\n    public static IEnumerable<TSource> SkipWhile<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int, bool> predicate)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(predicate, \"predicate\");\n\n      return SkipWhileYield(source, predicate);\n    }\n\n    private static IEnumerable<TSource> SkipWhileYield<TSource>(\n      IEnumerable<TSource> source,\n      Func<TSource, int, bool> predicate)\n    {\n      using (var e = source.GetEnumerator())\n      {\n        for (var i = 0;; i++)\n        {\n          if (!e.MoveNext())\n            yield break;\n\n          if (!predicate(e.Current, i))\n            break;\n        }\n\n        do\n        {\n          yield return e.Current;\n        } while (e.MoveNext());\n      }\n    }\n\n    /// <summary>\n    /// Returns the number of elements in a sequence.\n    /// </summary>\n\n    public static int Count<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      var collection = source as ICollection;\n      return collection != null\n               ? collection.Count\n               : source.Aggregate(0, (count, item) => checked(count + 1));\n    }\n\n    /// <summary>\n    /// Returns a number that represents how many elements in the \n    /// specified sequence satisfy a condition.\n    /// </summary>\n\n    public static int Count<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      return Count(source.Where(predicate));\n    }\n\n    /// <summary>\n    /// Returns an <see cref=\"Int64\"/> that represents the total number \n    /// of elements in a sequence.\n    /// </summary>\n\n    public static long LongCount<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      var array = source as Array;\n      return array != null\n               ? array.LongLength\n               : source.Aggregate(0L, (count, item) => count + 1);\n    }\n\n    /// <summary>\n    /// Returns an <see cref=\"Int64\"/> that represents how many elements \n    /// in a sequence satisfy a condition.\n    /// </summary>\n\n    public static long LongCount<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      return LongCount(source.Where(predicate));\n    }\n\n    /// <summary>\n    /// Concatenates two sequences.\n    /// </summary>\n\n    public static IEnumerable<TSource> Concat<TSource>(\n      this IEnumerable<TSource> first,\n      IEnumerable<TSource> second)\n    {\n      CheckNotNull(first, \"first\");\n      CheckNotNull(second, \"second\");\n\n      return ConcatYield(first, second);\n    }\n\n    private static IEnumerable<TSource> ConcatYield<TSource>(\n      IEnumerable<TSource> first,\n      IEnumerable<TSource> second)\n    {\n      foreach (var item in first)\n        yield return item;\n\n      foreach (var item in second)\n        yield return item;\n    }\n\n    /// <summary>\n    /// Creates a <see cref=\"List{T}\"/> from an <see cref=\"IEnumerable{T}\"/>.\n    /// </summary>\n\n    public static List<TSource> ToList<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return new List<TSource>(source);\n    }\n\n    /// <summary>\n    /// Creates an array from an <see cref=\"IEnumerable{T}\"/>.\n    /// </summary>\n\n    public static TSource[] ToArray<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      return source.ToList().ToArray();\n    }\n\n    /// <summary>\n    /// Returns distinct elements from a sequence by using the default \n    /// equality comparer to compare values.\n    /// </summary>\n\n    public static IEnumerable<TSource> Distinct<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      return Distinct(source, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Returns distinct elements from a sequence by using a specified \n    /// <see cref=\"IEqualityComparer{T}\"/> to compare values.\n    /// </summary>\n\n    public static IEnumerable<TSource> Distinct<TSource>(\n      this IEnumerable<TSource> source,\n      IEqualityComparer<TSource> comparer)\n    {\n      CheckNotNull(source, \"source\");\n\n      return DistinctYield(source, comparer);\n    }\n\n    private static IEnumerable<TSource> DistinctYield<TSource>(\n      IEnumerable<TSource> source,\n      IEqualityComparer<TSource> comparer)\n    {\n      var set = new Dictionary<TSource, object>(comparer);\n      var gotNull = false;\n\n      foreach (var item in source)\n      {\n        if (item == null)\n        {\n          if (gotNull)\n            continue;\n          gotNull = true;\n        }\n        else\n        {\n          if (set.ContainsKey(item))\n            continue;\n          set.Add(item, null);\n        }\n\n        yield return item;\n      }\n    }\n\n    /// <summary>\n    /// Creates a <see cref=\"Lookup{TKey,TElement}\" /> from an \n    /// <see cref=\"IEnumerable{T}\" /> according to a specified key \n    /// selector function.\n    /// </summary>\n\n    public static ILookup<TKey, TSource> ToLookup<TSource, TKey>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector)\n    {\n      return ToLookup(source, keySelector, e => e, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Creates a <see cref=\"Lookup{TKey,TElement}\" /> from an \n    /// <see cref=\"IEnumerable{T}\" /> according to a specified key \n    /// selector function and a key comparer.\n    /// </summary>\n\n    public static ILookup<TKey, TSource> ToLookup<TSource, TKey>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      IEqualityComparer<TKey> comparer)\n    {\n      return ToLookup(source, keySelector, e => e, comparer);\n    }\n\n    /// <summary>\n    /// Creates a <see cref=\"Lookup{TKey,TElement}\" /> from an \n    /// <see cref=\"IEnumerable{T}\" /> according to specified key \n    /// and element selector functions.\n    /// </summary>\n\n    public static ILookup<TKey, TElement> ToLookup<TSource, TKey, TElement>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      Func<TSource, TElement> elementSelector)\n    {\n      return ToLookup(source, keySelector, elementSelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Creates a <see cref=\"Lookup{TKey,TElement}\" /> from an \n    /// <see cref=\"IEnumerable{T}\" /> according to a specified key \n    /// selector function, a comparer and an element selector function.\n    /// </summary>\n\n    public static ILookup<TKey, TElement> ToLookup<TSource, TKey, TElement>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      Func<TSource, TElement> elementSelector,\n      IEqualityComparer<TKey> comparer)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(keySelector, \"keySelector\");\n      CheckNotNull(elementSelector, \"elementSelector\");\n\n      var lookup = new Lookup<TKey, TElement>(comparer);\n\n      foreach (var item in source)\n      {\n        var key = keySelector(item);\n\n        var grouping = (Grouping<TKey, TElement>) lookup.Find(key);\n        if (grouping == null)\n        {\n          grouping = new Grouping<TKey, TElement>(key);\n          lookup.Add(grouping);\n        }\n\n        grouping.Add(elementSelector(item));\n      }\n\n      return lookup;\n    }\n\n    /// <summary>\n    /// Groups the elements of a sequence according to a specified key \n    /// selector function.\n    /// </summary>\n\n    public static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector)\n    {\n      return GroupBy(source, keySelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Groups the elements of a sequence according to a specified key \n    /// selector function and compares the keys by using a specified \n    /// comparer.\n    /// </summary>\n\n    public static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      IEqualityComparer<TKey> comparer)\n    {\n      return GroupBy(source, keySelector, e => e, comparer);\n    }\n\n    /// <summary>\n    /// Groups the elements of a sequence according to a specified key \n    /// selector function and projects the elements for each group by \n    /// using a specified function.\n    /// </summary>\n\n    public static IEnumerable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      Func<TSource, TElement> elementSelector)\n    {\n      return GroupBy(source, keySelector, elementSelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Groups the elements of a sequence according to a specified key \n    /// selector function and creates a result value from each group and \n    /// its key.\n    /// </summary>\n\n    public static IEnumerable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      Func<TSource, TElement> elementSelector,\n      IEqualityComparer<TKey> comparer)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(keySelector, \"keySelector\");\n      CheckNotNull(elementSelector, \"elementSelector\");\n\n      return ToLookup(source, keySelector, elementSelector, comparer);\n    }\n\n    /// <summary>\n    /// Groups the elements of a sequence according to a key selector \n    /// function. The keys are compared by using a comparer and each \n    /// group's elements are projected by using a specified function.\n    /// </summary>\n\n    public static IEnumerable<TResult> GroupBy<TSource, TKey, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      Func<TKey, IEnumerable<TSource>, TResult> resultSelector)\n    {\n      return GroupBy(source, keySelector, resultSelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Groups the elements of a sequence according to a specified key \n    /// selector function and creates a result value from each group and \n    /// its key. The elements of each group are projected by using a \n    /// specified function.\n    /// </summary>\n\n    public static IEnumerable<TResult> GroupBy<TSource, TKey, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      Func<TKey, IEnumerable<TSource>, TResult> resultSelector,\n      IEqualityComparer<TKey> comparer)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(keySelector, \"keySelector\");\n      CheckNotNull(resultSelector, \"resultSelector\");\n\n      return ToLookup(source, keySelector, comparer).Select(g => resultSelector(g.Key, g));\n    }\n\n    /// <summary>\n    /// Groups the elements of a sequence according to a specified key \n    /// selector function and creates a result value from each group and \n    /// its key. The keys are compared by using a specified comparer.\n    /// </summary>\n\n    public static IEnumerable<TResult> GroupBy<TSource, TKey, TElement, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      Func<TSource, TElement> elementSelector,\n      Func<TKey, IEnumerable<TElement>, TResult> resultSelector)\n    {\n      return GroupBy(source, keySelector, elementSelector, resultSelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Groups the elements of a sequence according to a specified key \n    /// selector function and creates a result value from each group and \n    /// its key. Key values are compared by using a specified comparer, \n    /// and the elements of each group are projected by using a \n    /// specified function.\n    /// </summary>\n\n    public static IEnumerable<TResult> GroupBy<TSource, TKey, TElement, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      Func<TSource, TElement> elementSelector,\n      Func<TKey, IEnumerable<TElement>, TResult> resultSelector,\n      IEqualityComparer<TKey> comparer)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(keySelector, \"keySelector\");\n      CheckNotNull(elementSelector, \"elementSelector\");\n      CheckNotNull(resultSelector, \"resultSelector\");\n\n      return ToLookup(source, keySelector, elementSelector, comparer)\n        .Select(g => resultSelector(g.Key, g));\n    }\n\n    /// <summary>\n    /// Applies an accumulator function over a sequence.\n    /// </summary>\n\n    public static TSource Aggregate<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TSource, TSource> func)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(func, \"func\");\n\n      using (var e = source.GetEnumerator())\n      {\n        if (!e.MoveNext())\n          throw new InvalidOperationException();\n\n        return e.Renumerable().Skip(1).Aggregate(e.Current, func);\n      }\n    }\n\n    /// <summary>\n    /// Applies an accumulator function over a sequence. The specified \n    /// seed value is used as the initial accumulator value.\n    /// </summary>\n\n    public static TAccumulate Aggregate<TSource, TAccumulate>(\n      this IEnumerable<TSource> source,\n      TAccumulate seed,\n      Func<TAccumulate, TSource, TAccumulate> func)\n    {\n      return Aggregate(source, seed, func, r => r);\n    }\n\n    /// <summary>\n    /// Applies an accumulator function over a sequence. The specified \n    /// seed value is used as the initial accumulator value, and the \n    /// specified function is used to select the result value.\n    /// </summary>\n\n    public static TResult Aggregate<TSource, TAccumulate, TResult>(\n      this IEnumerable<TSource> source,\n      TAccumulate seed,\n      Func<TAccumulate, TSource, TAccumulate> func,\n      Func<TAccumulate, TResult> resultSelector)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(func, \"func\");\n      CheckNotNull(resultSelector, \"resultSelector\");\n\n      var result = seed;\n\n      foreach (var item in source)\n        result = func(result, item);\n\n      return resultSelector(result);\n    }\n\n    /// <summary>\n    /// Produces the set union of two sequences by using the default \n    /// equality comparer.\n    /// </summary>\n\n    public static IEnumerable<TSource> Union<TSource>(\n      this IEnumerable<TSource> first,\n      IEnumerable<TSource> second)\n    {\n      return Union(first, second, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Produces the set union of two sequences by using a specified \n    /// <see cref=\"IEqualityComparer{T}\" />.\n    /// </summary>\n\n    public static IEnumerable<TSource> Union<TSource>(\n      this IEnumerable<TSource> first,\n      IEnumerable<TSource> second,\n      IEqualityComparer<TSource> comparer)\n    {\n      return first.Concat(second).Distinct(comparer);\n    }\n\n    /// <summary>\n    /// Returns the elements of the specified sequence or the type \n    /// parameter's default value in a singleton collection if the \n    /// sequence is empty.\n    /// </summary>\n\n    public static IEnumerable<TSource> DefaultIfEmpty<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      return source.DefaultIfEmpty(default(TSource));\n    }\n\n    /// <summary>\n    /// Returns the elements of the specified sequence or the specified \n    /// value in a singleton collection if the sequence is empty.\n    /// </summary>\n\n    public static IEnumerable<TSource> DefaultIfEmpty<TSource>(\n      this IEnumerable<TSource> source,\n      TSource defaultValue)\n    {\n      CheckNotNull(source, \"source\");\n\n      return DefaultIfEmptyYield(source, defaultValue);\n    }\n\n    private static IEnumerable<TSource> DefaultIfEmptyYield<TSource>(\n      IEnumerable<TSource> source,\n      TSource defaultValue)\n    {\n      using (var e = source.GetEnumerator())\n      {\n        if (!e.MoveNext())\n          yield return defaultValue;\n        else\n          do\n          {\n            yield return e.Current;\n          } while (e.MoveNext());\n      }\n    }\n\n    /// <summary>\n    /// Determines whether all elements of a sequence satisfy a condition.\n    /// </summary>\n\n    public static bool All<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(predicate, \"predicate\");\n\n      foreach (var item in source)\n        if (!predicate(item))\n          return false;\n\n      return true;\n    }\n\n    /// <summary>\n    /// Determines whether a sequence contains any elements.\n    /// </summary>\n\n    public static bool Any<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      using (var e = source.GetEnumerator())\n        return e.MoveNext();\n    }\n\n    /// <summary>\n    /// Determines whether any element of a sequence satisfies a \n    /// condition.\n    /// </summary>\n\n    public static bool Any<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, bool> predicate)\n    {\n      return source.Where(predicate).Any();\n    }\n\n    /// <summary>\n    /// Determines whether a sequence contains a specified element by \n    /// using the default equality comparer.\n    /// </summary>\n\n    public static bool Contains<TSource>(\n      this IEnumerable<TSource> source,\n      TSource value)\n    {\n      return source.Contains(value, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Determines whether a sequence contains a specified element by \n    /// using a specified <see cref=\"IEqualityComparer{T}\" />.\n    /// </summary>\n\n    public static bool Contains<TSource>(\n      this IEnumerable<TSource> source,\n      TSource value,\n      IEqualityComparer<TSource> comparer)\n    {\n      CheckNotNull(source, \"source\");\n\n      if (comparer == null)\n      {\n        var collection = source as ICollection<TSource>;\n        if (collection != null)\n          return collection.Contains(value);\n      }\n\n      comparer = comparer ?? EqualityComparer<TSource>.Default;\n      return source.Any(item => comparer.Equals(item, value));\n    }\n\n    /// <summary>\n    /// Determines whether two sequences are equal by comparing the \n    /// elements by using the default equality comparer for their type.\n    /// </summary>\n\n    public static bool SequenceEqual<TSource>(\n      this IEnumerable<TSource> first,\n      IEnumerable<TSource> second)\n    {\n      return first.SequenceEqual(second, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Determines whether two sequences are equal by comparing their \n    /// elements by using a specified <see cref=\"IEqualityComparer{T}\" />.\n    /// </summary>\n\n    public static bool SequenceEqual<TSource>(\n      this IEnumerable<TSource> first,\n      IEnumerable<TSource> second,\n      IEqualityComparer<TSource> comparer)\n    {\n      CheckNotNull(first, \"frist\");\n      CheckNotNull(second, \"second\");\n\n      comparer = comparer ?? EqualityComparer<TSource>.Default;\n\n      using (IEnumerator<TSource> lhs = first.GetEnumerator(),\n                                  rhs = second.GetEnumerator())\n      {\n        do\n        {\n          if (!lhs.MoveNext())\n            return !rhs.MoveNext();\n\n          if (!rhs.MoveNext())\n            return false;\n        } while (comparer.Equals(lhs.Current, rhs.Current));\n      }\n\n      return false;\n    }\n\n    /// <summary>\n    /// Base implementation for Min/Max operator.\n    /// </summary>\n\n    private static TSource MinMaxImpl<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TSource, bool> lesser)\n    {\n      CheckNotNull(source, \"source\");\n      Debug.Assert(lesser != null);\n\n      return source.Aggregate((a, item) => lesser(a, item) ? a : item);\n    }\n\n    /// <summary>\n    /// Base implementation for Min/Max operator for nullable types.\n    /// </summary>\n\n    private static TSource? MinMaxImpl<TSource>(\n      this IEnumerable<TSource?> source,\n      TSource? seed, Func<TSource?, TSource?, bool> lesser) where TSource : struct\n    {\n      CheckNotNull(source, \"source\");\n      Debug.Assert(lesser != null);\n\n      return source.Aggregate(seed, (a, item) => lesser(a, item) ? a : item);\n      //  == MinMaxImpl(Repeat<TSource?>(null, 1).Concat(source), lesser);\n    }\n\n    /// <summary>\n    /// Returns the minimum value in a generic sequence.\n    /// </summary>\n\n    public static TSource Min<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      var comparer = Comparer<TSource>.Default;\n      return source.MinMaxImpl((x, y) => comparer.Compare(x, y) < 0);\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a generic \n    /// sequence and returns the minimum resulting value.\n    /// </summary>\n\n    public static TResult Min<TSource, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TResult> selector)\n    {\n      return source.Select(selector).Min();\n    }\n\n    /// <summary>\n    /// Returns the maximum value in a generic sequence.\n    /// </summary>\n\n    public static TSource Max<TSource>(\n      this IEnumerable<TSource> source)\n    {\n      var comparer = Comparer<TSource>.Default;\n      return source.MinMaxImpl((x, y) => comparer.Compare(x, y) > 0);\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a generic \n    /// sequence and returns the maximum resulting value.\n    /// </summary>\n\n    public static TResult Max<TSource, TResult>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TResult> selector)\n    {\n      return source.Select(selector).Max();\n    }\n\n    /// <summary>\n    /// Makes an enumerator seen as enumerable once more.\n    /// </summary>\n    /// <remarks>\n    /// The supplied enumerator must have been started. The first element\n    /// returned is the element the enumerator was on when passed in.\n    /// DO NOT use this method if the caller must be a generator. It is\n    /// mostly safe among aggregate operations.\n    /// </remarks>\n\n    private static IEnumerable<T> Renumerable<T>(this IEnumerator<T> e)\n    {\n      Debug.Assert(e != null);\n\n      do\n      {\n        yield return e.Current;\n      } while (e.MoveNext());\n    }\n\n    /// <summary>\n    /// Sorts the elements of a sequence in ascending order according to a key.\n    /// </summary>\n\n    public static IOrderedEnumerable<TSource> OrderBy<TSource, TKey>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector)\n    {\n      return source.OrderBy(keySelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Sorts the elements of a sequence in ascending order by using a \n    /// specified comparer.\n    /// </summary>\n\n    public static IOrderedEnumerable<TSource> OrderBy<TSource, TKey>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      IComparer<TKey> comparer)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(keySelector, \"keySelector\");\n\n      return new OrderedEnumerable<TSource, TKey>(source, keySelector, comparer, /* descending */ false);\n    }\n\n    /// <summary>\n    /// Sorts the elements of a sequence in descending order according to a key.\n    /// </summary>\n\n    public static IOrderedEnumerable<TSource> OrderByDescending<TSource, TKey>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector)\n    {\n      return source.OrderByDescending(keySelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    ///  Sorts the elements of a sequence in descending order by using a \n    /// specified comparer. \n    /// </summary>\n\n    public static IOrderedEnumerable<TSource> OrderByDescending<TSource, TKey>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      IComparer<TKey> comparer)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(source, \"keySelector\");\n\n      return new OrderedEnumerable<TSource, TKey>(source, keySelector, comparer, /* descending */ true);\n    }\n\n    /// <summary>\n    /// Performs a subsequent ordering of the elements in a sequence in \n    /// ascending order according to a key.\n    /// </summary>\n\n    public static IOrderedEnumerable<TSource> ThenBy<TSource, TKey>(\n      this IOrderedEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector)\n    {\n      return source.ThenBy(keySelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Performs a subsequent ordering of the elements in a sequence in \n    /// ascending order by using a specified comparer.\n    /// </summary>\n\n    public static IOrderedEnumerable<TSource> ThenBy<TSource, TKey>(\n      this IOrderedEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      IComparer<TKey> comparer)\n    {\n      CheckNotNull(source, \"source\");\n\n      return source.CreateOrderedEnumerable(keySelector, comparer, /* descending */ false);\n    }\n\n    /// <summary>\n    /// Performs a subsequent ordering of the elements in a sequence in \n    /// descending order, according to a key.\n    /// </summary>\n\n    public static IOrderedEnumerable<TSource> ThenByDescending<TSource, TKey>(\n      this IOrderedEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector)\n    {\n      return source.ThenByDescending(keySelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Performs a subsequent ordering of the elements in a sequence in \n    /// descending order by using a specified comparer.\n    /// </summary>\n\n    public static IOrderedEnumerable<TSource> ThenByDescending<TSource, TKey>(\n      this IOrderedEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      IComparer<TKey> comparer)\n    {\n      CheckNotNull(source, \"source\");\n\n      return source.CreateOrderedEnumerable(keySelector, comparer, /* descending */ true);\n    }\n\n    /// <summary>\n    /// Base implementation for Intersect and Except operators.\n    /// </summary>\n\n    private static IEnumerable<TSource> IntersectExceptImpl<TSource>(\n      this IEnumerable<TSource> first,\n      IEnumerable<TSource> second,\n      IEqualityComparer<TSource> comparer,\n      bool flag)\n    {\n      CheckNotNull(first, \"first\");\n      CheckNotNull(second, \"second\");\n\n      var keys = new List<TSource>();\n      var flags = new Dictionary<TSource, bool>(comparer);\n\n      foreach (var item in first.Where(k => !flags.ContainsKey(k)))\n      {\n        flags.Add(item, !flag);\n        keys.Add(item);\n      }\n\n      foreach (var item in second.Where(flags.ContainsKey))\n        flags[item] = flag;\n\n      //\n      // As per docs, \"the marked elements are yielded in the order in \n      // which they were collected.\n      //\n\n      return keys.Where(item => flags[item]);\n    }\n\n    /// <summary>\n    /// Produces the set intersection of two sequences by using the \n    /// default equality comparer to compare values.\n    /// </summary>\n\n    public static IEnumerable<TSource> Intersect<TSource>(\n      this IEnumerable<TSource> first,\n      IEnumerable<TSource> second)\n    {\n      return first.Intersect(second, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Produces the set intersection of two sequences by using the \n    /// specified <see cref=\"IEqualityComparer{T}\" /> to compare values.\n    /// </summary>\n\n    public static IEnumerable<TSource> Intersect<TSource>(\n      this IEnumerable<TSource> first,\n      IEnumerable<TSource> second,\n      IEqualityComparer<TSource> comparer)\n    {\n      return IntersectExceptImpl(first, second, comparer, /* flag */ true);\n    }\n\n    /// <summary>\n    /// Produces the set difference of two sequences by using the \n    /// default equality comparer to compare values.\n    /// </summary>\n\n    public static IEnumerable<TSource> Except<TSource>(\n      this IEnumerable<TSource> first,\n      IEnumerable<TSource> second)\n    {\n      return first.Except(second, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Produces the set difference of two sequences by using the \n    /// specified <see cref=\"IEqualityComparer{T}\" /> to compare values.\n    /// </summary>\n\n    public static IEnumerable<TSource> Except<TSource>(\n      this IEnumerable<TSource> first,\n      IEnumerable<TSource> second,\n      IEqualityComparer<TSource> comparer)\n    {\n      return IntersectExceptImpl(first, second, comparer, /* flag */ false);\n    }\n\n    /// <summary>\n    /// Creates a <see cref=\"Dictionary{TKey,TValue}\" /> from an \n    /// <see cref=\"IEnumerable{T}\" /> according to a specified key \n    /// selector function.\n    /// </summary>\n\n    public static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector)\n    {\n      return source.ToDictionary(keySelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Creates a <see cref=\"Dictionary{TKey,TValue}\" /> from an \n    /// <see cref=\"IEnumerable{T}\" /> according to a specified key \n    /// selector function and key comparer.\n    /// </summary>\n\n    public static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      IEqualityComparer<TKey> comparer)\n    {\n      return source.ToDictionary(keySelector, e => e);\n    }\n\n    /// <summary>\n    /// Creates a <see cref=\"Dictionary{TKey,TValue}\" /> from an \n    /// <see cref=\"IEnumerable{T}\" /> according to specified key \n    /// selector and element selector functions.\n    /// </summary>\n\n    public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      Func<TSource, TElement> elementSelector)\n    {\n      return source.ToDictionary(keySelector, elementSelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Creates a <see cref=\"Dictionary{TKey,TValue}\" /> from an \n    /// <see cref=\"IEnumerable{T}\" /> according to a specified key \n    /// selector function, a comparer, and an element selector function.\n    /// </summary>\n\n    public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(\n      this IEnumerable<TSource> source,\n      Func<TSource, TKey> keySelector,\n      Func<TSource, TElement> elementSelector,\n      IEqualityComparer<TKey> comparer)\n    {\n      CheckNotNull(source, \"source\");\n      CheckNotNull(keySelector, \"keySelector\");\n      CheckNotNull(elementSelector, \"elementSelector\");\n\n      var dict = new Dictionary<TKey, TElement>(comparer);\n\n      foreach (var item in source)\n      {\n        //\n        // ToDictionary is meant to throw ArgumentNullException if\n        // keySelector produces a key that is null and \n        // Argument exception if keySelector produces duplicate keys \n        // for two elements. Incidentally, the doucmentation for\n        // IDictionary<TKey, TValue>.Add says that the Add method\n        // throws the same exceptions under the same circumstances\n        // so we don't need to do any additional checking or work\n        // here and let the Add implementation do all the heavy\n        // lifting.\n        //\n\n        dict.Add(keySelector(item), elementSelector(item));\n      }\n\n      return dict;\n    }\n\n    /// <summary>\n    /// Correlates the elements of two sequences based on matching keys. \n    /// The default equality comparer is used to compare keys.\n    /// </summary>\n\n    public static IEnumerable<TResult> Join<TOuter, TInner, TKey, TResult>(\n      this IEnumerable<TOuter> outer,\n      IEnumerable<TInner> inner,\n      Func<TOuter, TKey> outerKeySelector,\n      Func<TInner, TKey> innerKeySelector,\n      Func<TOuter, TInner, TResult> resultSelector)\n    {\n      return outer.Join(inner, outerKeySelector, innerKeySelector, resultSelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Correlates the elements of two sequences based on matching keys. \n    /// The default equality comparer is used to compare keys. A \n    /// specified <see cref=\"IEqualityComparer{T}\" /> is used to compare keys.\n    /// </summary>\n\n    public static IEnumerable<TResult> Join<TOuter, TInner, TKey, TResult>(\n      this IEnumerable<TOuter> outer,\n      IEnumerable<TInner> inner,\n      Func<TOuter, TKey> outerKeySelector,\n      Func<TInner, TKey> innerKeySelector,\n      Func<TOuter, TInner, TResult> resultSelector,\n      IEqualityComparer<TKey> comparer)\n    {\n      CheckNotNull(outer, \"outer\");\n      CheckNotNull(inner, \"inner\");\n      CheckNotNull(outerKeySelector, \"outerKeySelector\");\n      CheckNotNull(innerKeySelector, \"innerKeySelector\");\n      CheckNotNull(resultSelector, \"resultSelector\");\n\n      var lookup = inner.ToLookup(innerKeySelector, comparer);\n\n      return\n        from o in outer\n        from i in lookup[outerKeySelector(o)]\n        select resultSelector(o, i);\n    }\n\n    /// <summary>\n    /// Correlates the elements of two sequences based on equality of \n    /// keys and groups the results. The default equality comparer is \n    /// used to compare keys.\n    /// </summary>\n\n    public static IEnumerable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(\n      this IEnumerable<TOuter> outer,\n      IEnumerable<TInner> inner,\n      Func<TOuter, TKey> outerKeySelector,\n      Func<TInner, TKey> innerKeySelector,\n      Func<TOuter, IEnumerable<TInner>, TResult> resultSelector)\n    {\n      return outer.GroupJoin(inner, outerKeySelector, innerKeySelector, resultSelector, /* comparer */ null);\n    }\n\n    /// <summary>\n    /// Correlates the elements of two sequences based on equality of \n    /// keys and groups the results. The default equality comparer is \n    /// used to compare keys. A specified <see cref=\"IEqualityComparer{T}\" /> \n    /// is used to compare keys.\n    /// </summary>\n\n    public static IEnumerable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(\n      this IEnumerable<TOuter> outer,\n      IEnumerable<TInner> inner,\n      Func<TOuter, TKey> outerKeySelector,\n      Func<TInner, TKey> innerKeySelector,\n      Func<TOuter, IEnumerable<TInner>, TResult> resultSelector,\n      IEqualityComparer<TKey> comparer)\n    {\n      CheckNotNull(outer, \"outer\");\n      CheckNotNull(inner, \"inner\");\n      CheckNotNull(outerKeySelector, \"outerKeySelector\");\n      CheckNotNull(innerKeySelector, \"innerKeySelector\");\n      CheckNotNull(resultSelector, \"resultSelector\");\n\n      var lookup = inner.ToLookup(innerKeySelector, comparer);\n      return outer.Select(o => resultSelector(o, lookup[outerKeySelector(o)]));\n    }\n\n    [DebuggerStepThrough]\n    private static void CheckNotNull<T>(T value, string name) where T : class\n    {\n      if (value == null)\n        throw new ArgumentNullException(name);\n    }\n\n    private static class Sequence<T>\n    {\n      public static readonly IEnumerable<T> Empty = new T[0];\n    }\n\n    private sealed class Grouping<K, V> : List<V>, IGrouping<K, V>\n    {\n      internal Grouping(K key)\n      {\n        Key = key;\n      }\n\n      public K Key { get; private set; }\n    }\n  }\n\n  internal partial class Enumerable\n  {\n    /// <summary>\n    /// Computes the sum of a sequence of nullable <see cref=\"System.Int32\" /> values.\n    /// </summary>\n\n    public static int Sum(\n      this IEnumerable<int> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      int sum = 0;\n      foreach (var num in source)\n        sum = checked(sum + num);\n\n      return sum;\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of nullable <see cref=\"System.Int32\" /> \n    /// values that are obtained by invoking a transform function on \n    /// each element of the input sequence.\n    /// </summary>\n\n    public static int Sum<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int> selector)\n    {\n      return source.Select(selector).Sum();\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of nullable <see cref=\"System.Int32\" /> values.\n    /// </summary>\n\n    public static double Average(\n      this IEnumerable<int> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      long sum = 0;\n      long count = 0;\n\n      foreach (var num in source)\n        checked\n        {\n          sum += (int) num;\n          count++;\n        }\n\n      if (count == 0)\n        throw new InvalidOperationException();\n\n      return (double) sum/count;\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of nullable <see cref=\"System.Int32\" /> values \n    /// that are obtained by invoking a transform function on each \n    /// element of the input sequence.\n    /// </summary>\n\n    public static double Average<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int> selector)\n    {\n      return source.Select(selector).Average();\n    }\n\n\n    /// <summary>\n    /// Computes the sum of a sequence of <see cref=\"System.Int32\" /> values.\n    /// </summary>\n\n    public static int? Sum(\n      this IEnumerable<int?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      int sum = 0;\n      foreach (var num in source)\n        sum = checked(sum + (num ?? 0));\n\n      return sum;\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of <see cref=\"System.Int32\" /> \n    /// values that are obtained by invoking a transform function on \n    /// each element of the input sequence.\n    /// </summary>\n\n    public static int? Sum<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int?> selector)\n    {\n      return source.Select(selector).Sum();\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of <see cref=\"System.Int32\" /> values.\n    /// </summary>\n\n    public static double? Average(\n      this IEnumerable<int?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      long sum = 0;\n      long count = 0;\n\n      foreach (var num in source.Where(n => n != null))\n        checked\n        {\n          sum += (int) num;\n          count++;\n        }\n\n      if (count == 0)\n        return null;\n\n      return (double?) sum/count;\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of <see cref=\"System.Int32\" /> values \n    /// that are obtained by invoking a transform function on each \n    /// element of the input sequence.\n    /// </summary>\n\n    public static double? Average<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int?> selector)\n    {\n      return source.Select(selector).Average();\n    }\n\n    /// <summary>\n    /// Returns the minimum value in a sequence of nullable \n    /// <see cref=\"System.Int32\" /> values.\n    /// </summary>\n\n    public static int? Min(\n      this IEnumerable<int?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x);\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a sequence and \n    /// returns the minimum nullable <see cref=\"System.Int32\" /> value.\n    /// </summary>\n\n    public static int? Min<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int?> selector)\n    {\n      return source.Select(selector).Min();\n    }\n\n    /// <summary>\n    /// Returns the maximum value in a sequence of nullable \n    /// <see cref=\"System.Int32\" /> values.\n    /// </summary>\n\n    public static int? Max(\n      this IEnumerable<int?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return MinMaxImpl(source.Where(x => x != null),\n                        null, (max, x) => x == null || (max != null && x.Value < max.Value));\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a sequence and \n    /// returns the maximum nullable <see cref=\"System.Int32\" /> value.\n    /// </summary>\n\n    public static int? Max<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, int?> selector)\n    {\n      return source.Select(selector).Max();\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of nullable <see cref=\"System.Int64\" /> values.\n    /// </summary>\n\n    public static long Sum(\n      this IEnumerable<long> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      long sum = 0;\n      foreach (var num in source)\n        sum = checked(sum + num);\n\n      return sum;\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of nullable <see cref=\"System.Int64\" /> \n    /// values that are obtained by invoking a transform function on \n    /// each element of the input sequence.\n    /// </summary>\n\n    public static long Sum<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, long> selector)\n    {\n      return source.Select(selector).Sum();\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of nullable <see cref=\"System.Int64\" /> values.\n    /// </summary>\n\n    public static double Average(\n      this IEnumerable<long> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      long sum = 0;\n      long count = 0;\n\n      foreach (var num in source)\n        checked\n        {\n          sum += (long) num;\n          count++;\n        }\n\n      if (count == 0)\n        throw new InvalidOperationException();\n\n      return (double) sum/count;\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of nullable <see cref=\"System.Int64\" /> values \n    /// that are obtained by invoking a transform function on each \n    /// element of the input sequence.\n    /// </summary>\n\n    public static double Average<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, long> selector)\n    {\n      return source.Select(selector).Average();\n    }\n\n\n    /// <summary>\n    /// Computes the sum of a sequence of <see cref=\"System.Int64\" /> values.\n    /// </summary>\n\n    public static long? Sum(\n      this IEnumerable<long?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      long sum = 0;\n      foreach (var num in source)\n        sum = checked(sum + (num ?? 0));\n\n      return sum;\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of <see cref=\"System.Int64\" /> \n    /// values that are obtained by invoking a transform function on \n    /// each element of the input sequence.\n    /// </summary>\n\n    public static long? Sum<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, long?> selector)\n    {\n      return source.Select(selector).Sum();\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of <see cref=\"System.Int64\" /> values.\n    /// </summary>\n\n    public static double? Average(\n      this IEnumerable<long?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      long sum = 0;\n      long count = 0;\n\n      foreach (var num in source.Where(n => n != null))\n        checked\n        {\n          sum += (long) num;\n          count++;\n        }\n\n      if (count == 0)\n        return null;\n\n      return (double?) sum/count;\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of <see cref=\"System.Int64\" /> values \n    /// that are obtained by invoking a transform function on each \n    /// element of the input sequence.\n    /// </summary>\n\n    public static double? Average<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, long?> selector)\n    {\n      return source.Select(selector).Average();\n    }\n\n    /// <summary>\n    /// Returns the minimum value in a sequence of nullable \n    /// <see cref=\"System.Int64\" /> values.\n    /// </summary>\n\n    public static long? Min(\n      this IEnumerable<long?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x);\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a sequence and \n    /// returns the minimum nullable <see cref=\"System.Int64\" /> value.\n    /// </summary>\n\n    public static long? Min<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, long?> selector)\n    {\n      return source.Select(selector).Min();\n    }\n\n    /// <summary>\n    /// Returns the maximum value in a sequence of nullable \n    /// <see cref=\"System.Int64\" /> values.\n    /// </summary>\n\n    public static long? Max(\n      this IEnumerable<long?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return MinMaxImpl(source.Where(x => x != null),\n                        null, (max, x) => x == null || (max != null && x.Value < max.Value));\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a sequence and \n    /// returns the maximum nullable <see cref=\"System.Int64\" /> value.\n    /// </summary>\n\n    public static long? Max<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, long?> selector)\n    {\n      return source.Select(selector).Max();\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of nullable <see cref=\"System.Single\" /> values.\n    /// </summary>\n\n    public static float Sum(\n      this IEnumerable<float> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      float sum = 0;\n      foreach (var num in source)\n        sum = checked(sum + num);\n\n      return sum;\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of nullable <see cref=\"System.Single\" /> \n    /// values that are obtained by invoking a transform function on \n    /// each element of the input sequence.\n    /// </summary>\n\n    public static float Sum<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, float> selector)\n    {\n      return source.Select(selector).Sum();\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of nullable <see cref=\"System.Single\" /> values.\n    /// </summary>\n\n    public static float Average(\n      this IEnumerable<float> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      float sum = 0;\n      long count = 0;\n\n      foreach (var num in source)\n        checked\n        {\n          sum += (float) num;\n          count++;\n        }\n\n      if (count == 0)\n        throw new InvalidOperationException();\n\n      return (float) sum/count;\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of nullable <see cref=\"System.Single\" /> values \n    /// that are obtained by invoking a transform function on each \n    /// element of the input sequence.\n    /// </summary>\n\n    public static float Average<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, float> selector)\n    {\n      return source.Select(selector).Average();\n    }\n\n\n    /// <summary>\n    /// Computes the sum of a sequence of <see cref=\"System.Single\" /> values.\n    /// </summary>\n\n    public static float? Sum(\n      this IEnumerable<float?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      float sum = 0;\n      foreach (var num in source)\n        sum = checked(sum + (num ?? 0));\n\n      return sum;\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of <see cref=\"System.Single\" /> \n    /// values that are obtained by invoking a transform function on \n    /// each element of the input sequence.\n    /// </summary>\n\n    public static float? Sum<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, float?> selector)\n    {\n      return source.Select(selector).Sum();\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of <see cref=\"System.Single\" /> values.\n    /// </summary>\n\n    public static float? Average(\n      this IEnumerable<float?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      float sum = 0;\n      long count = 0;\n\n      foreach (var num in source.Where(n => n != null))\n        checked\n        {\n          sum += (float) num;\n          count++;\n        }\n\n      if (count == 0)\n        return null;\n\n      return (float?) sum/count;\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of <see cref=\"System.Single\" /> values \n    /// that are obtained by invoking a transform function on each \n    /// element of the input sequence.\n    /// </summary>\n\n    public static float? Average<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, float?> selector)\n    {\n      return source.Select(selector).Average();\n    }\n\n    /// <summary>\n    /// Returns the minimum value in a sequence of nullable \n    /// <see cref=\"System.Single\" /> values.\n    /// </summary>\n\n    public static float? Min(\n      this IEnumerable<float?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x);\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a sequence and \n    /// returns the minimum nullable <see cref=\"System.Single\" /> value.\n    /// </summary>\n\n    public static float? Min<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, float?> selector)\n    {\n      return source.Select(selector).Min();\n    }\n\n    /// <summary>\n    /// Returns the maximum value in a sequence of nullable \n    /// <see cref=\"System.Single\" /> values.\n    /// </summary>\n\n    public static float? Max(\n      this IEnumerable<float?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return MinMaxImpl(source.Where(x => x != null),\n                        null, (max, x) => x == null || (max != null && x.Value < max.Value));\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a sequence and \n    /// returns the maximum nullable <see cref=\"System.Single\" /> value.\n    /// </summary>\n\n    public static float? Max<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, float?> selector)\n    {\n      return source.Select(selector).Max();\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of nullable <see cref=\"System.Double\" /> values.\n    /// </summary>\n\n    public static double Sum(\n      this IEnumerable<double> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      double sum = 0;\n      foreach (var num in source)\n        sum = checked(sum + num);\n\n      return sum;\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of nullable <see cref=\"System.Double\" /> \n    /// values that are obtained by invoking a transform function on \n    /// each element of the input sequence.\n    /// </summary>\n\n    public static double Sum<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, double> selector)\n    {\n      return source.Select(selector).Sum();\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of nullable <see cref=\"System.Double\" /> values.\n    /// </summary>\n\n    public static double Average(\n      this IEnumerable<double> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      double sum = 0;\n      long count = 0;\n\n      foreach (var num in source)\n        checked\n        {\n          sum += (double) num;\n          count++;\n        }\n\n      if (count == 0)\n        throw new InvalidOperationException();\n\n      return (double) sum/count;\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of nullable <see cref=\"System.Double\" /> values \n    /// that are obtained by invoking a transform function on each \n    /// element of the input sequence.\n    /// </summary>\n\n    public static double Average<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, double> selector)\n    {\n      return source.Select(selector).Average();\n    }\n\n\n    /// <summary>\n    /// Computes the sum of a sequence of <see cref=\"System.Double\" /> values.\n    /// </summary>\n\n    public static double? Sum(\n      this IEnumerable<double?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      double sum = 0;\n      foreach (var num in source)\n        sum = checked(sum + (num ?? 0));\n\n      return sum;\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of <see cref=\"System.Double\" /> \n    /// values that are obtained by invoking a transform function on \n    /// each element of the input sequence.\n    /// </summary>\n\n    public static double? Sum<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, double?> selector)\n    {\n      return source.Select(selector).Sum();\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of <see cref=\"System.Double\" /> values.\n    /// </summary>\n\n    public static double? Average(\n      this IEnumerable<double?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      double sum = 0;\n      long count = 0;\n\n      foreach (var num in source.Where(n => n != null))\n        checked\n        {\n          sum += (double) num;\n          count++;\n        }\n\n      if (count == 0)\n        return null;\n\n      return (double?) sum/count;\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of <see cref=\"System.Double\" /> values \n    /// that are obtained by invoking a transform function on each \n    /// element of the input sequence.\n    /// </summary>\n\n    public static double? Average<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, double?> selector)\n    {\n      return source.Select(selector).Average();\n    }\n\n    /// <summary>\n    /// Returns the minimum value in a sequence of nullable \n    /// <see cref=\"System.Double\" /> values.\n    /// </summary>\n\n    public static double? Min(\n      this IEnumerable<double?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x);\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a sequence and \n    /// returns the minimum nullable <see cref=\"System.Double\" /> value.\n    /// </summary>\n\n    public static double? Min<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, double?> selector)\n    {\n      return source.Select(selector).Min();\n    }\n\n    /// <summary>\n    /// Returns the maximum value in a sequence of nullable \n    /// <see cref=\"System.Double\" /> values.\n    /// </summary>\n\n    public static double? Max(\n      this IEnumerable<double?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return MinMaxImpl(source.Where(x => x != null),\n                        null, (max, x) => x == null || (max != null && x.Value < max.Value));\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a sequence and \n    /// returns the maximum nullable <see cref=\"System.Double\" /> value.\n    /// </summary>\n\n    public static double? Max<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, double?> selector)\n    {\n      return source.Select(selector).Max();\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of nullable <see cref=\"System.Decimal\" /> values.\n    /// </summary>\n\n    public static decimal Sum(\n      this IEnumerable<decimal> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      decimal sum = 0;\n      foreach (var num in source)\n        sum = checked(sum + num);\n\n      return sum;\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of nullable <see cref=\"System.Decimal\" /> \n    /// values that are obtained by invoking a transform function on \n    /// each element of the input sequence.\n    /// </summary>\n\n    public static decimal Sum<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, decimal> selector)\n    {\n      return source.Select(selector).Sum();\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of nullable <see cref=\"System.Decimal\" /> values.\n    /// </summary>\n\n    public static decimal Average(\n      this IEnumerable<decimal> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      decimal sum = 0;\n      long count = 0;\n\n      foreach (var num in source)\n        checked\n        {\n          sum += (decimal) num;\n          count++;\n        }\n\n      if (count == 0)\n        throw new InvalidOperationException();\n\n      return (decimal) sum/count;\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of nullable <see cref=\"System.Decimal\" /> values \n    /// that are obtained by invoking a transform function on each \n    /// element of the input sequence.\n    /// </summary>\n\n    public static decimal Average<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, decimal> selector)\n    {\n      return source.Select(selector).Average();\n    }\n\n\n    /// <summary>\n    /// Computes the sum of a sequence of <see cref=\"System.Decimal\" /> values.\n    /// </summary>\n\n    public static decimal? Sum(\n      this IEnumerable<decimal?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      decimal sum = 0;\n      foreach (var num in source)\n        sum = checked(sum + (num ?? 0));\n\n      return sum;\n    }\n\n    /// <summary>\n    /// Computes the sum of a sequence of <see cref=\"System.Decimal\" /> \n    /// values that are obtained by invoking a transform function on \n    /// each element of the input sequence.\n    /// </summary>\n\n    public static decimal? Sum<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, decimal?> selector)\n    {\n      return source.Select(selector).Sum();\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of <see cref=\"System.Decimal\" /> values.\n    /// </summary>\n\n    public static decimal? Average(\n      this IEnumerable<decimal?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      decimal sum = 0;\n      long count = 0;\n\n      foreach (var num in source.Where(n => n != null))\n        checked\n        {\n          sum += (decimal) num;\n          count++;\n        }\n\n      if (count == 0)\n        return null;\n\n      return (decimal?) sum/count;\n    }\n\n    /// <summary>\n    /// Computes the average of a sequence of <see cref=\"System.Decimal\" /> values \n    /// that are obtained by invoking a transform function on each \n    /// element of the input sequence.\n    /// </summary>\n\n    public static decimal? Average<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, decimal?> selector)\n    {\n      return source.Select(selector).Average();\n    }\n\n    /// <summary>\n    /// Returns the minimum value in a sequence of nullable \n    /// <see cref=\"System.Decimal\" /> values.\n    /// </summary>\n\n    public static decimal? Min(\n      this IEnumerable<decimal?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x);\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a sequence and \n    /// returns the minimum nullable <see cref=\"System.Decimal\" /> value.\n    /// </summary>\n\n    public static decimal? Min<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, decimal?> selector)\n    {\n      return source.Select(selector).Min();\n    }\n\n    /// <summary>\n    /// Returns the maximum value in a sequence of nullable \n    /// <see cref=\"System.Decimal\" /> values.\n    /// </summary>\n\n    public static decimal? Max(\n      this IEnumerable<decimal?> source)\n    {\n      CheckNotNull(source, \"source\");\n\n      return MinMaxImpl(source.Where(x => x != null),\n                        null, (max, x) => x == null || (max != null && x.Value < max.Value));\n    }\n\n    /// <summary>\n    /// Invokes a transform function on each element of a sequence and \n    /// returns the maximum nullable <see cref=\"System.Decimal\" /> value.\n    /// </summary>\n\n    public static decimal? Max<TSource>(\n      this IEnumerable<TSource> source,\n      Func<TSource, decimal?> selector)\n    {\n      return source.Select(selector).Max();\n    }\n  }\n\n  /// <summary>\n  /// Represents a collection of objects that have a common key.\n  /// </summary>\n  internal partial interface IGrouping<TKey, TElement> : IEnumerable<TElement>\n  {\n    /// <summary>\n    /// Gets the key of the <see cref=\"IGrouping{TKey,TElement}\" />.\n    /// </summary>\n\n    TKey Key { get; }\n  }\n\n  /// <summary>\n  /// Defines an indexer, size property, and Boolean search method for \n  /// data structures that map keys to <see cref=\"IEnumerable{T}\"/> \n  /// sequences of values.\n  /// </summary>\n  internal partial interface ILookup<TKey, TElement> : IEnumerable<IGrouping<TKey, TElement>>\n  {\n    bool Contains(TKey key);\n    int Count { get; }\n    IEnumerable<TElement> this[TKey key] { get; }\n  }\n\n  /// <summary>\n  /// Represents a sorted sequence.\n  /// </summary>\n  internal partial interface IOrderedEnumerable<TElement> : IEnumerable<TElement>\n  {\n    /// <summary>\n    /// Performs a subsequent ordering on the elements of an \n    /// <see cref=\"IOrderedEnumerable{T}\"/> according to a key.\n    /// </summary>\n\n    IOrderedEnumerable<TElement> CreateOrderedEnumerable<TKey>(\n      Func<TElement, TKey> keySelector, IComparer<TKey> comparer, bool descending);\n  }\n\n  /// <summary>\n  /// Represents a collection of keys each mapped to one or more values.\n  /// </summary>\n  internal sealed class Lookup<TKey, TElement> : ILookup<TKey, TElement>\n  {\n    private readonly Dictionary<TKey, IGrouping<TKey, TElement>> _map;\n\n    internal Lookup(IEqualityComparer<TKey> comparer)\n    {\n      _map = new Dictionary<TKey, IGrouping<TKey, TElement>>(comparer);\n    }\n\n    internal void Add(IGrouping<TKey, TElement> item)\n    {\n      _map.Add(item.Key, item);\n    }\n\n    internal IEnumerable<TElement> Find(TKey key)\n    {\n      IGrouping<TKey, TElement> grouping;\n      return _map.TryGetValue(key, out grouping) ? grouping : null;\n    }\n\n    /// <summary>\n    /// Gets the number of key/value collection pairs in the <see cref=\"Lookup{TKey,TElement}\" />.\n    /// </summary>\n\n    public int Count\n    {\n      get { return _map.Count; }\n    }\n\n    /// <summary>\n    /// Gets the collection of values indexed by the specified key.\n    /// </summary>\n\n    public IEnumerable<TElement> this[TKey key]\n    {\n      get\n      {\n        IGrouping<TKey, TElement> result;\n        return _map.TryGetValue(key, out result) ? result : Enumerable.Empty<TElement>();\n      }\n    }\n\n    /// <summary>\n    /// Determines whether a specified key is in the <see cref=\"Lookup{TKey,TElement}\" />.\n    /// </summary>\n\n    public bool Contains(TKey key)\n    {\n      return _map.ContainsKey(key);\n    }\n\n    /// <summary>\n    /// Applies a transform function to each key and its associated \n    /// values and returns the results.\n    /// </summary>\n\n    public IEnumerable<TResult> ApplyResultSelector<TResult>(\n      Func<TKey, IEnumerable<TElement>, TResult> resultSelector)\n    {\n      if (resultSelector == null)\n        throw new ArgumentNullException(\"resultSelector\");\n\n      foreach (var pair in _map)\n        yield return resultSelector(pair.Key, pair.Value);\n    }\n\n    /// <summary>\n    /// Returns a generic enumerator that iterates through the <see cref=\"Lookup{TKey,TElement}\" />.\n    /// </summary>\n\n    public IEnumerator<IGrouping<TKey, TElement>> GetEnumerator()\n    {\n      return _map.Values.GetEnumerator();\n    }\n\n    IEnumerator IEnumerable.GetEnumerator()\n    {\n      return GetEnumerator();\n    }\n  }\n\n  internal sealed class OrderedEnumerable<T, K> : IOrderedEnumerable<T>\n  {\n    private readonly IEnumerable<T> _source;\n    private readonly List<Comparison<T>> _comparisons;\n\n    public OrderedEnumerable(IEnumerable<T> source,\n                             Func<T, K> keySelector, IComparer<K> comparer, bool descending) :\n                               this(source, null, keySelector, comparer, descending)\n    {\n    }\n\n    private OrderedEnumerable(IEnumerable<T> source, List<Comparison<T>> comparisons,\n                              Func<T, K> keySelector, IComparer<K> comparer, bool descending)\n    {\n      if (source == null) throw new ArgumentNullException(\"source\");\n      if (keySelector == null) throw new ArgumentNullException(\"keySelector\");\n\n      _source = source;\n\n      comparer = comparer ?? Comparer<K>.Default;\n\n      if (comparisons == null)\n        comparisons = new List<Comparison<T>>( /* capacity */ 4);\n\n      comparisons.Add((x, y)\n                      => (descending ? -1 : 1)*comparer.Compare(keySelector(x), keySelector(y)));\n\n      _comparisons = comparisons;\n    }\n\n    public IOrderedEnumerable<T> CreateOrderedEnumerable<KK>(\n      Func<T, KK> keySelector, IComparer<KK> comparer, bool descending)\n    {\n      return new OrderedEnumerable<T, KK>(_source, _comparisons, keySelector, comparer, descending);\n    }\n\n    public IEnumerator<T> GetEnumerator()\n    {\n      //\n      // We sort using List<T>.Sort, but docs say that it performs an \n      // unstable sort. LINQ, on the other hand, says OrderBy performs \n      // a stable sort. So convert the source sequence into a sequence \n      // of tuples where the second element tags the position of the \n      // element from the source sequence (First). The position is \n      // then used as a tie breaker when all keys compare equal,\n      // thus making the sort stable.\n      //\n\n      var list = _source.Select(new Func<T, int, Tuple<T, int>>(TagPosition)).ToList();\n\n      list.Sort((x, y) =>\n        {\n          //\n          // Compare keys from left to right.\n          //\n\n          var comparisons = _comparisons;\n          for (var i = 0; i < comparisons.Count; i++)\n          {\n            var result = comparisons[i](x.First, y.First);\n            if (result != 0)\n              return result;\n          }\n\n          //\n          // All keys compared equal so now break the tie by their\n          // position in the original sequence, making the sort stable.\n          //\n\n          return x.Second.CompareTo(y.Second);\n        });\n\n      return list.Select(new Func<Tuple<T, int>, T>(GetFirst)).GetEnumerator();\n\n    }\n\n    /// <remarks>\n    /// See <a href=\"http://code.google.com/p/linqbridge/issues/detail?id=11\">issue #11</a>\n    /// for why this method is needed and cannot be expressed as a \n    /// lambda at the call site.\n    /// </remarks>\n\n    private static Tuple<T, int> TagPosition(T e, int i)\n    {\n      return new Tuple<T, int>(e, i);\n    }\n\n    /// <remarks>\n    /// See <a href=\"http://code.google.com/p/linqbridge/issues/detail?id=11\">issue #11</a>\n    /// for why this method is needed and cannot be expressed as a \n    /// lambda at the call site.\n    /// </remarks>\n\n    private static T GetFirst(Tuple<T, int> pv)\n    {\n      return pv.First;\n    }\n\n    IEnumerator IEnumerable.GetEnumerator()\n    {\n      return GetEnumerator();\n    }\n  }\n\n  [Serializable]\n  internal struct Tuple<TFirst, TSecond> : IEquatable<Tuple<TFirst, TSecond>>\n  {\n    public TFirst First { get; private set; }\n    public TSecond Second { get; private set; }\n\n    public Tuple(TFirst first, TSecond second)\n      : this()\n    {\n      First = first;\n      Second = second;\n    }\n\n    public override bool Equals(object obj)\n    {\n      return obj != null\n             && obj is Tuple<TFirst, TSecond>\n             && base.Equals((Tuple<TFirst, TSecond>) obj);\n    }\n\n    public bool Equals(Tuple<TFirst, TSecond> other)\n    {\n      return EqualityComparer<TFirst>.Default.Equals(other.First, First)\n             && EqualityComparer<TSecond>.Default.Equals(other.Second, Second);\n    }\n\n    public override int GetHashCode()\n    {\n      var num = 0x7a2f0b42;\n      num = (-1521134295*num) + EqualityComparer<TFirst>.Default.GetHashCode(First);\n      return (-1521134295*num) + EqualityComparer<TSecond>.Default.GetHashCode(Second);\n    }\n\n    public override string ToString()\n    {\n      return string.Format(CultureInfo.InvariantCulture, @\"{{ First = {0}, Second = {1} }}\", First, Second);\n    }\n  }\n}\n\nnamespace Newtonsoft.Json.Serialization\n{\n#pragma warning disable 1591\n  public delegate TResult Func<TResult>();\n\n  public delegate TResult Func<T, TResult>(T a);\n\n  public delegate TResult Func<T1, T2, TResult>(T1 arg1, T2 arg2);\n\n  public delegate TResult Func<T1, T2, T3, TResult>(T1 arg1, T2 arg2, T3 arg3);\n\n  public delegate TResult Func<T1, T2, T3, T4, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);\n\n  public delegate void Action();\n\n  public delegate void Action<T1, T2>(T1 arg1, T2 arg2);\n\n  public delegate void Action<T1, T2, T3>(T1 arg1, T2 arg2, T3 arg3);\n\n  public delegate void Action<T1, T2, T3, T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);\n#pragma warning restore 1591\n}\n\nnamespace System.Runtime.CompilerServices\n{\n  /// <remarks>\n  /// This attribute allows us to define extension methods without \n  /// requiring .NET Framework 3.5. For more information, see the section,\n  /// <a href=\"http://msdn.microsoft.com/en-us/magazine/cc163317.aspx#S7\">Extension Methods in .NET Framework 2.0 Apps</a>,\n  /// of <a href=\"http://msdn.microsoft.com/en-us/magazine/cc163317.aspx\">Basic Instincts: Extension Methods</a>\n  /// column in <a href=\"http://msdn.microsoft.com/msdnmag/\">MSDN Magazine</a>, \n  /// issue <a href=\"http://msdn.microsoft.com/en-us/magazine/cc135410.aspx\">Nov 2007</a>.\n  /// </remarks>\n\n  [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]\n  internal sealed class ExtensionAttribute : Attribute { }\n}\n\n#endif"
  },
  {
    "path": "Newtonsoft.Json/Utilities/MathUtils.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class MathUtils\n    {\n        public static int IntLength(ulong i)\n        {\n            if (i < 10000000000)\n            {\n                if (i < 10) return 1;\n                if (i < 100) return 2;\n                if (i < 1000) return 3;\n                if (i < 10000) return 4;\n                if (i < 100000) return 5;\n                if (i < 1000000) return 6;\n                if (i < 10000000) return 7;\n                if (i < 100000000) return 8;\n                if (i < 1000000000) return 9;\n\n                return 10;\n            }\n            else\n            {\n                if (i < 100000000000) return 11;\n                if (i < 1000000000000) return 12;\n                if (i < 10000000000000) return 13;\n                if (i < 100000000000000) return 14;\n                if (i < 1000000000000000) return 15;\n                if (i < 10000000000000000) return 16;\n                if (i < 100000000000000000) return 17;\n                if (i < 1000000000000000000) return 18;\n                if (i < 10000000000000000000) return 19;\n\n                return 20;\n            }\n        }\n\n        public static char IntToHex(int n)\n        {\n            if (n <= 9)\n                return (char)(n + 48);\n\n            return (char)((n - 10) + 97);\n        }\n\n        public static int? Min(int? val1, int? val2)\n        {\n            if (val1 == null)\n                return val2;\n            if (val2 == null)\n                return val1;\n\n            return Math.Min(val1.Value, val2.Value);\n        }\n\n        public static int? Max(int? val1, int? val2)\n        {\n            if (val1 == null)\n                return val2;\n            if (val2 == null)\n                return val1;\n\n            return Math.Max(val1.Value, val2.Value);\n        }\n\n        public static double? Max(double? val1, double? val2)\n        {\n            if (val1 == null)\n                return val2;\n            if (val2 == null)\n                return val1;\n\n            return Math.Max(val1.Value, val2.Value);\n        }\n\n        public static bool ApproxEquals(double d1, double d2)\n        {\n            const double epsilon = 2.2204460492503131E-16;\n\n            if (d1 == d2)\n                return true;\n\n            double tolerance = ((Math.Abs(d1) + Math.Abs(d2)) + 10.0) * epsilon;\n            double difference = d1 - d2;\n\n            return (-tolerance < difference && tolerance > difference);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/MethodCall.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal delegate TResult MethodCall<T, TResult>(T target, params object[] args);\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/MiscellaneousUtils.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Reflection;\nusing System.Text;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal delegate T Creator<T>();\n\n    internal static class MiscellaneousUtils\n    {\n        public static bool ValueEquals(object objA, object objB)\n        {\n            if (objA == null && objB == null)\n                return true;\n            if (objA != null && objB == null)\n                return false;\n            if (objA == null && objB != null)\n                return false;\n\n            // comparing an Int32 and Int64 both of the same value returns false\n            // make types the same then compare\n            if (objA.GetType() != objB.GetType())\n            {\n                if (ConvertUtils.IsInteger(objA) && ConvertUtils.IsInteger(objB))\n                    return Convert.ToDecimal(objA, CultureInfo.CurrentCulture).Equals(Convert.ToDecimal(objB, CultureInfo.CurrentCulture));\n                else if ((objA is double || objA is float || objA is decimal) && (objB is double || objB is float || objB is decimal))\n                    return MathUtils.ApproxEquals(Convert.ToDouble(objA, CultureInfo.CurrentCulture), Convert.ToDouble(objB, CultureInfo.CurrentCulture));\n                else\n                    return false;\n            }\n\n            return objA.Equals(objB);\n        }\n\n        public static ArgumentOutOfRangeException CreateArgumentOutOfRangeException(string paramName, object actualValue, string message)\n        {\n            string newMessage = message + Environment.NewLine + @\"Actual value was {0}.\".FormatWith(CultureInfo.InvariantCulture, actualValue);\n\n            return new ArgumentOutOfRangeException(paramName, newMessage);\n        }\n\n        public static string ToString(object value)\n        {\n            if (value == null)\n                return \"{null}\";\n\n            return (value is string) ? @\"\"\"\" + value.ToString() + @\"\"\"\" : value.ToString();\n        }\n\n        public static int ByteArrayCompare(byte[] a1, byte[] a2)\n        {\n            int lengthCompare = a1.Length.CompareTo(a2.Length);\n            if (lengthCompare != 0)\n                return lengthCompare;\n\n            for (int i = 0; i < a1.Length; i++)\n            {\n                int valueCompare = a1[i].CompareTo(a2[i]);\n                if (valueCompare != 0)\n                    return valueCompare;\n            }\n\n            return 0;\n        }\n\n        public static string GetPrefix(string qualifiedName)\n        {\n            string prefix;\n            string localName;\n            GetQualifiedNameParts(qualifiedName, out prefix, out localName);\n\n            return prefix;\n        }\n\n        public static string GetLocalName(string qualifiedName)\n        {\n            string prefix;\n            string localName;\n            GetQualifiedNameParts(qualifiedName, out prefix, out localName);\n\n            return localName;\n        }\n\n        public static void GetQualifiedNameParts(string qualifiedName, out string prefix, out string localName)\n        {\n            int colonPosition = qualifiedName.IndexOf(':');\n\n            if ((colonPosition == -1 || colonPosition == 0) || (qualifiedName.Length - 1) == colonPosition)\n            {\n                prefix = null;\n                localName = qualifiedName;\n            }\n            else\n            {\n                prefix = qualifiedName.Substring(0, colonPosition);\n                localName = qualifiedName.Substring(colonPosition + 1);\n            }\n        }\n\n        internal static string FormatValueForPrint(object value)\n        {\n            if (value == null)\n                return \"{null}\";\n\n            if (value is string)\n                return @\"\"\"\" + value + @\"\"\"\";\n\n            return value.ToString();\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/ReflectionDelegateFactory.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Globalization;\nusing System.Reflection;\nusing Newtonsoft.Json.Serialization;\n\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#endif\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal abstract class ReflectionDelegateFactory\n    {\n        public Func<T, object> CreateGet<T>(MemberInfo memberInfo)\n        {\n            PropertyInfo propertyInfo = memberInfo as PropertyInfo;\n            if (propertyInfo != null)\n                return CreateGet<T>(propertyInfo);\n\n            FieldInfo fieldInfo = memberInfo as FieldInfo;\n            if (fieldInfo != null)\n                return CreateGet<T>(fieldInfo);\n\n            throw new Exception(\"Could not create getter for {0}.\".FormatWith(CultureInfo.InvariantCulture, memberInfo));\n        }\n\n        public Action<T, object> CreateSet<T>(MemberInfo memberInfo)\n        {\n            PropertyInfo propertyInfo = memberInfo as PropertyInfo;\n            if (propertyInfo != null)\n                return CreateSet<T>(propertyInfo);\n\n            FieldInfo fieldInfo = memberInfo as FieldInfo;\n            if (fieldInfo != null)\n                return CreateSet<T>(fieldInfo);\n\n            throw new Exception(\"Could not create setter for {0}.\".FormatWith(CultureInfo.InvariantCulture, memberInfo));\n        }\n\n        public abstract MethodCall<T, object> CreateMethodCall<T>(MethodBase method);\n        public abstract Func<T> CreateDefaultConstructor<T>(Type type);\n        public abstract Func<T, object> CreateGet<T>(PropertyInfo propertyInfo);\n        public abstract Func<T, object> CreateGet<T>(FieldInfo fieldInfo);\n        public abstract Action<T, object> CreateSet<T>(FieldInfo fieldInfo);\n        public abstract Action<T, object> CreateSet<T>(PropertyInfo propertyInfo);\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/ReflectionUtils.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\n#if !(PORTABLE || PORTABLE40 || NET35 || NET20)\nusing System.Numerics;\n#endif\nusing System.Reflection;\nusing System.Collections;\nusing System.Globalization;\nusing System.Runtime.Serialization;\nusing System.Runtime.Serialization.Formatters;\nusing System.Text;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json.Utilities\n{\n#if (NETFX_CORE || PORTABLE || PORTABLE40)\n    internal enum MemberTypes\n    {\n        Property,\n        Field,\n        Event,\n        Method,\n        Other\n    }\n#endif\n\n#if NETFX_CORE || PORTABLE\n    [Flags]\n    internal enum BindingFlags\n    {\n        Default = 0,\n        IgnoreCase = 1,\n        DeclaredOnly = 2,\n        Instance = 4,\n        Static = 8,\n        Public = 16,\n        NonPublic = 32,\n        FlattenHierarchy = 64,\n        InvokeMethod = 256,\n        CreateInstance = 512,\n        GetField = 1024,\n        SetField = 2048,\n        GetProperty = 4096,\n        SetProperty = 8192,\n        PutDispProperty = 16384,\n        ExactBinding = 65536,\n        PutRefDispProperty = 32768,\n        SuppressChangeType = 131072,\n        OptionalParamBinding = 262144,\n        IgnoreReturn = 16777216\n    }\n#endif\n\n    internal static class ReflectionUtils\n    {\n        public static readonly Type[] EmptyTypes;\n\n        static ReflectionUtils()\n        {\n#if !(NETFX_CORE || PORTABLE40 || PORTABLE)\n            EmptyTypes = Type.EmptyTypes;\n#else\n            EmptyTypes = new Type[0];\n#endif\n        }\n\n        public static bool IsVirtual(this PropertyInfo propertyInfo)\n        {\n            ValidationUtils.ArgumentNotNull(propertyInfo, \"propertyInfo\");\n\n            MethodInfo m = propertyInfo.GetGetMethod();\n            if (m != null && m.IsVirtual)\n                return true;\n\n            m = propertyInfo.GetSetMethod();\n            if (m != null && m.IsVirtual)\n                return true;\n\n            return false;\n        }\n\n        public static MethodInfo GetBaseDefinition(this PropertyInfo propertyInfo)\n        {\n            ValidationUtils.ArgumentNotNull(propertyInfo, \"propertyInfo\");\n\n            MethodInfo m = propertyInfo.GetGetMethod();\n            if (m != null)\n                return m.GetBaseDefinition();\n\n            m = propertyInfo.GetSetMethod();\n            if (m != null)\n                return m.GetBaseDefinition();\n\n            return null;\n        }\n\n        public static bool IsPublic(PropertyInfo property)\n        {\n            if (property.GetGetMethod() != null && property.GetGetMethod().IsPublic)\n                return true;\n            if (property.GetSetMethod() != null && property.GetSetMethod().IsPublic)\n                return true;\n\n            return false;\n        }\n\n        public static Type GetObjectType(object v)\n        {\n            return (v != null) ? v.GetType() : null;\n        }\n\n        public static string GetTypeName(Type t, FormatterAssemblyStyle assemblyFormat, SerializationBinder binder)\n        {\n            string fullyQualifiedTypeName;\n#if !(NET20 || NET35)\n            if (binder != null)\n            {\n                string assemblyName, typeName;\n                binder.BindToName(t, out assemblyName, out typeName);\n                fullyQualifiedTypeName = typeName + (assemblyName == null ? \"\" : \", \" + assemblyName);\n            }\n            else\n            {\n                fullyQualifiedTypeName = t.AssemblyQualifiedName;\n            }\n#else\n            fullyQualifiedTypeName = t.AssemblyQualifiedName;\n#endif\n\n            switch (assemblyFormat)\n            {\n                case FormatterAssemblyStyle.Simple:\n                    return RemoveAssemblyDetails(fullyQualifiedTypeName);\n                case FormatterAssemblyStyle.Full:\n                    return fullyQualifiedTypeName;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n        }\n\n        private static string RemoveAssemblyDetails(string fullyQualifiedTypeName)\n        {\n            StringBuilder builder = new StringBuilder();\n\n            // loop through the type name and filter out qualified assembly details from nested type names\n            bool writingAssemblyName = false;\n            bool skippingAssemblyDetails = false;\n            for (int i = 0; i < fullyQualifiedTypeName.Length; i++)\n            {\n                char current = fullyQualifiedTypeName[i];\n                switch (current)\n                {\n                    case '[':\n                        writingAssemblyName = false;\n                        skippingAssemblyDetails = false;\n                        builder.Append(current);\n                        break;\n                    case ']':\n                        writingAssemblyName = false;\n                        skippingAssemblyDetails = false;\n                        builder.Append(current);\n                        break;\n                    case ',':\n                        if (!writingAssemblyName)\n                        {\n                            writingAssemblyName = true;\n                            builder.Append(current);\n                        }\n                        else\n                        {\n                            skippingAssemblyDetails = true;\n                        }\n                        break;\n                    default:\n                        if (!skippingAssemblyDetails)\n                            builder.Append(current);\n                        break;\n                }\n            }\n\n            return builder.ToString();\n        }\n\n        public static bool HasDefaultConstructor(Type t, bool nonPublic)\n        {\n            ValidationUtils.ArgumentNotNull(t, \"t\");\n\n            if (t.IsValueType())\n                return true;\n\n            return (GetDefaultConstructor(t, nonPublic) != null);\n        }\n\n        public static ConstructorInfo GetDefaultConstructor(Type t)\n        {\n            return GetDefaultConstructor(t, false);\n        }\n\n        public static ConstructorInfo GetDefaultConstructor(Type t, bool nonPublic)\n        {\n            BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Public;\n            if (nonPublic)\n                bindingFlags = bindingFlags | BindingFlags.NonPublic;\n\n            return t.GetConstructors(bindingFlags).SingleOrDefault(c => !c.GetParameters().Any());\n        }\n\n        public static bool IsNullable(Type t)\n        {\n            ValidationUtils.ArgumentNotNull(t, \"t\");\n\n            if (t.IsValueType())\n                return IsNullableType(t);\n\n            return true;\n        }\n\n        public static bool IsNullableType(Type t)\n        {\n            ValidationUtils.ArgumentNotNull(t, \"t\");\n\n            return (t.IsGenericType() && t.GetGenericTypeDefinition() == typeof(Nullable<>));\n        }\n\n        public static Type EnsureNotNullableType(Type t)\n        {\n            return (IsNullableType(t))\n                ? Nullable.GetUnderlyingType(t)\n                : t;\n        }\n\n        public static bool IsGenericDefinition(Type type, Type genericInterfaceDefinition)\n        {\n            if (!type.IsGenericType())\n                return false;\n\n            Type t = type.GetGenericTypeDefinition();\n            return (t == genericInterfaceDefinition);\n        }\n\n        public static bool ImplementsGenericDefinition(Type type, Type genericInterfaceDefinition)\n        {\n            Type implementingType;\n            return ImplementsGenericDefinition(type, genericInterfaceDefinition, out implementingType);\n        }\n\n        public static bool ImplementsGenericDefinition(Type type, Type genericInterfaceDefinition, out Type implementingType)\n        {\n            ValidationUtils.ArgumentNotNull(type, \"type\");\n            ValidationUtils.ArgumentNotNull(genericInterfaceDefinition, \"genericInterfaceDefinition\");\n\n            if (!genericInterfaceDefinition.IsInterface() || !genericInterfaceDefinition.IsGenericTypeDefinition())\n                throw new ArgumentNullException(\"'{0}' is not a generic interface definition.\".FormatWith(CultureInfo.InvariantCulture, genericInterfaceDefinition));\n\n            if (type.IsInterface())\n            {\n                if (type.IsGenericType())\n                {\n                    Type interfaceDefinition = type.GetGenericTypeDefinition();\n\n                    if (genericInterfaceDefinition == interfaceDefinition)\n                    {\n                        implementingType = type;\n                        return true;\n                    }\n                }\n            }\n\n            foreach (Type i in type.GetInterfaces())\n            {\n                if (i.IsGenericType())\n                {\n                    Type interfaceDefinition = i.GetGenericTypeDefinition();\n\n                    if (genericInterfaceDefinition == interfaceDefinition)\n                    {\n                        implementingType = i;\n                        return true;\n                    }\n                }\n            }\n\n            implementingType = null;\n            return false;\n        }\n\n        public static bool InheritsGenericDefinition(Type type, Type genericClassDefinition)\n        {\n            Type implementingType;\n            return InheritsGenericDefinition(type, genericClassDefinition, out implementingType);\n        }\n\n        public static bool InheritsGenericDefinition(Type type, Type genericClassDefinition, out Type implementingType)\n        {\n            ValidationUtils.ArgumentNotNull(type, \"type\");\n            ValidationUtils.ArgumentNotNull(genericClassDefinition, \"genericClassDefinition\");\n\n            if (!genericClassDefinition.IsClass() || !genericClassDefinition.IsGenericTypeDefinition())\n                throw new ArgumentNullException(\"'{0}' is not a generic class definition.\".FormatWith(CultureInfo.InvariantCulture, genericClassDefinition));\n\n            return InheritsGenericDefinitionInternal(type, genericClassDefinition, out implementingType);\n        }\n\n        private static bool InheritsGenericDefinitionInternal(Type currentType, Type genericClassDefinition, out Type implementingType)\n        {\n            if (currentType.IsGenericType())\n            {\n                Type currentGenericClassDefinition = currentType.GetGenericTypeDefinition();\n\n                if (genericClassDefinition == currentGenericClassDefinition)\n                {\n                    implementingType = currentType;\n                    return true;\n                }\n            }\n\n            if (currentType.BaseType() == null)\n            {\n                implementingType = null;\n                return false;\n            }\n\n            return InheritsGenericDefinitionInternal(currentType.BaseType(), genericClassDefinition, out implementingType);\n        }\n\n        /// <summary>\n        /// Gets the type of the typed collection's items.\n        /// </summary>\n        /// <param name=\"type\">The type.</param>\n        /// <returns>The type of the typed collection's items.</returns>\n        public static Type GetCollectionItemType(Type type)\n        {\n            ValidationUtils.ArgumentNotNull(type, \"type\");\n            Type genericListType;\n\n            if (type.IsArray)\n            {\n                return type.GetElementType();\n            }\n            else if (ImplementsGenericDefinition(type, typeof(IEnumerable<>), out genericListType))\n            {\n                if (genericListType.IsGenericTypeDefinition())\n                    throw new Exception(\"Type {0} is not a collection.\".FormatWith(CultureInfo.InvariantCulture, type));\n\n                return genericListType.GetGenericArguments()[0];\n            }\n            else if (typeof(IEnumerable).IsAssignableFrom(type))\n            {\n                return null;\n            }\n            else\n            {\n                throw new Exception(\"Type {0} is not a collection.\".FormatWith(CultureInfo.InvariantCulture, type));\n            }\n        }\n\n        public static void GetDictionaryKeyValueTypes(Type dictionaryType, out Type keyType, out Type valueType)\n        {\n            ValidationUtils.ArgumentNotNull(dictionaryType, \"type\");\n\n            Type genericDictionaryType;\n            if (ImplementsGenericDefinition(dictionaryType, typeof(IDictionary<,>), out genericDictionaryType))\n            {\n                if (genericDictionaryType.IsGenericTypeDefinition())\n                    throw new Exception(\"Type {0} is not a dictionary.\".FormatWith(CultureInfo.InvariantCulture, dictionaryType));\n\n                Type[] dictionaryGenericArguments = genericDictionaryType.GetGenericArguments();\n\n                keyType = dictionaryGenericArguments[0];\n                valueType = dictionaryGenericArguments[1];\n                return;\n            }\n            else if (typeof(IDictionary).IsAssignableFrom(dictionaryType))\n            {\n                keyType = null;\n                valueType = null;\n                return;\n            }\n            else\n            {\n                throw new Exception(\"Type {0} is not a dictionary.\".FormatWith(CultureInfo.InvariantCulture, dictionaryType));\n            }\n        }\n\n        /// <summary>\n        /// Gets the member's underlying type.\n        /// </summary>\n        /// <param name=\"member\">The member.</param>\n        /// <returns>The underlying type of the member.</returns>\n        public static Type GetMemberUnderlyingType(MemberInfo member)\n        {\n            ValidationUtils.ArgumentNotNull(member, \"member\");\n\n            switch (member.MemberType())\n            {\n                case MemberTypes.Field:\n                    return ((FieldInfo)member).FieldType;\n                case MemberTypes.Property:\n                    return ((PropertyInfo)member).PropertyType;\n                case MemberTypes.Event:\n                    return ((EventInfo)member).EventHandlerType;\n                default:\n                    throw new ArgumentException(\"MemberInfo must be of type FieldInfo, PropertyInfo or EventInfo\", \"member\");\n            }\n        }\n\n        /// <summary>\n        /// Determines whether the member is an indexed property.\n        /// </summary>\n        /// <param name=\"member\">The member.</param>\n        /// <returns>\n        /// \t<c>true</c> if the member is an indexed property; otherwise, <c>false</c>.\n        /// </returns>\n        public static bool IsIndexedProperty(MemberInfo member)\n        {\n            ValidationUtils.ArgumentNotNull(member, \"member\");\n\n            PropertyInfo propertyInfo = member as PropertyInfo;\n\n            if (propertyInfo != null)\n                return IsIndexedProperty(propertyInfo);\n            else\n                return false;\n        }\n\n        /// <summary>\n        /// Determines whether the property is an indexed property.\n        /// </summary>\n        /// <param name=\"property\">The property.</param>\n        /// <returns>\n        /// \t<c>true</c> if the property is an indexed property; otherwise, <c>false</c>.\n        /// </returns>\n        public static bool IsIndexedProperty(PropertyInfo property)\n        {\n            ValidationUtils.ArgumentNotNull(property, \"property\");\n\n            return (property.GetIndexParameters().Length > 0);\n        }\n\n        /// <summary>\n        /// Gets the member's value on the object.\n        /// </summary>\n        /// <param name=\"member\">The member.</param>\n        /// <param name=\"target\">The target object.</param>\n        /// <returns>The member's value on the object.</returns>\n        public static object GetMemberValue(MemberInfo member, object target)\n        {\n            ValidationUtils.ArgumentNotNull(member, \"member\");\n            ValidationUtils.ArgumentNotNull(target, \"target\");\n\n            switch (member.MemberType())\n            {\n                case MemberTypes.Field:\n                    return ((FieldInfo)member).GetValue(target);\n                case MemberTypes.Property:\n                    try\n                    {\n                        return ((PropertyInfo)member).GetValue(target, null);\n                    }\n                    catch (TargetParameterCountException e)\n                    {\n                        throw new ArgumentException(\"MemberInfo '{0}' has index parameters\".FormatWith(CultureInfo.InvariantCulture, member.Name), e);\n                    }\n                default:\n                    throw new ArgumentException(\"MemberInfo '{0}' is not of type FieldInfo or PropertyInfo\".FormatWith(CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, member.Name), \"member\");\n            }\n        }\n\n        /// <summary>\n        /// Sets the member's value on the target object.\n        /// </summary>\n        /// <param name=\"member\">The member.</param>\n        /// <param name=\"target\">The target.</param>\n        /// <param name=\"value\">The value.</param>\n        public static void SetMemberValue(MemberInfo member, object target, object value)\n        {\n            ValidationUtils.ArgumentNotNull(member, \"member\");\n            ValidationUtils.ArgumentNotNull(target, \"target\");\n\n            switch (member.MemberType())\n            {\n                case MemberTypes.Field:\n                    ((FieldInfo)member).SetValue(target, value);\n                    break;\n                case MemberTypes.Property:\n                    ((PropertyInfo)member).SetValue(target, value, null);\n                    break;\n                default:\n                    throw new ArgumentException(\"MemberInfo '{0}' must be of type FieldInfo or PropertyInfo\".FormatWith(CultureInfo.InvariantCulture, member.Name), \"member\");\n            }\n        }\n\n        /// <summary>\n        /// Determines whether the specified MemberInfo can be read.\n        /// </summary>\n        /// <param name=\"member\">The MemberInfo to determine whether can be read.</param>\n        /// /// <param name=\"nonPublic\">if set to <c>true</c> then allow the member to be gotten non-publicly.</param>\n        /// <returns>\n        /// \t<c>true</c> if the specified MemberInfo can be read; otherwise, <c>false</c>.\n        /// </returns>\n        public static bool CanReadMemberValue(MemberInfo member, bool nonPublic)\n        {\n            switch (member.MemberType())\n            {\n                case MemberTypes.Field:\n                    FieldInfo fieldInfo = (FieldInfo)member;\n\n                    if (nonPublic)\n                        return true;\n                    else if (fieldInfo.IsPublic)\n                        return true;\n                    return false;\n                case MemberTypes.Property:\n                    PropertyInfo propertyInfo = (PropertyInfo)member;\n\n                    if (!propertyInfo.CanRead)\n                        return false;\n                    if (nonPublic)\n                        return true;\n                    return (propertyInfo.GetGetMethod(nonPublic) != null);\n                default:\n                    return false;\n            }\n        }\n\n        /// <summary>\n        /// Determines whether the specified MemberInfo can be set.\n        /// </summary>\n        /// <param name=\"member\">The MemberInfo to determine whether can be set.</param>\n        /// <param name=\"nonPublic\">if set to <c>true</c> then allow the member to be set non-publicly.</param>\n        /// <param name=\"canSetReadOnly\">if set to <c>true</c> then allow the member to be set if read-only.</param>\n        /// <returns>\n        /// \t<c>true</c> if the specified MemberInfo can be set; otherwise, <c>false</c>.\n        /// </returns>\n        public static bool CanSetMemberValue(MemberInfo member, bool nonPublic, bool canSetReadOnly)\n        {\n            switch (member.MemberType())\n            {\n                case MemberTypes.Field:\n                    FieldInfo fieldInfo = (FieldInfo)member;\n\n                    if (fieldInfo.IsInitOnly && !canSetReadOnly)\n                        return false;\n                    if (nonPublic)\n                        return true;\n                    else if (fieldInfo.IsPublic)\n                        return true;\n                    return false;\n                case MemberTypes.Property:\n                    PropertyInfo propertyInfo = (PropertyInfo)member;\n\n                    if (!propertyInfo.CanWrite)\n                        return false;\n                    if (nonPublic)\n                        return true;\n                    return (propertyInfo.GetSetMethod(nonPublic) != null);\n                default:\n                    return false;\n            }\n        }\n\n        public static List<MemberInfo> GetFieldsAndProperties(Type type, BindingFlags bindingAttr)\n        {\n            List<MemberInfo> targetMembers = new List<MemberInfo>();\n\n            targetMembers.AddRange(GetFields(type, bindingAttr));\n            targetMembers.AddRange(GetProperties(type, bindingAttr));\n\n            // for some reason .NET returns multiple members when overriding a generic member on a base class\n            // http://social.msdn.microsoft.com/Forums/en-US/b5abbfee-e292-4a64-8907-4e3f0fb90cd9/reflection-overriden-abstract-generic-properties?forum=netfxbcl\n            // filter members to only return the override on the topmost class\n            // update: I think this is fixed in .NET 3.5 SP1 - leave this in for now...\n            List<MemberInfo> distinctMembers = new List<MemberInfo>(targetMembers.Count);\n\n            foreach (var groupedMember in targetMembers.GroupBy(m => m.Name))\n            {\n                int count = groupedMember.Count();\n                IList<MemberInfo> members = groupedMember.ToList();\n\n                if (count == 1)\n                {\n                    distinctMembers.Add(members.First());\n                }\n                else\n                {\n                    IList<MemberInfo> resolvedMembers = new List<MemberInfo>();\n                    foreach (MemberInfo memberInfo in members)\n                    {\n                        // this is a bit hacky\n                        // if the hiding property is hiding a base property and it is virtual\n                        // then this ensures the derived property gets used\n                        if (resolvedMembers.Count == 0)\n                            resolvedMembers.Add(memberInfo);\n                        else if (!IsOverridenGenericMember(memberInfo, bindingAttr) || memberInfo.Name == \"Item\")\n                            resolvedMembers.Add(memberInfo);\n                    }\n\n                    distinctMembers.AddRange(resolvedMembers);\n                }\n            }\n\n            return distinctMembers;\n        }\n\n        private static bool IsOverridenGenericMember(MemberInfo memberInfo, BindingFlags bindingAttr)\n        {\n            if (memberInfo.MemberType() != MemberTypes.Property)\n                return false;\n\n            PropertyInfo propertyInfo = (PropertyInfo)memberInfo;\n            if (!IsVirtual(propertyInfo))\n                return false;\n\n            Type declaringType = propertyInfo.DeclaringType;\n            if (!declaringType.IsGenericType())\n                return false;\n            Type genericTypeDefinition = declaringType.GetGenericTypeDefinition();\n            if (genericTypeDefinition == null)\n                return false;\n            MemberInfo[] members = genericTypeDefinition.GetMember(propertyInfo.Name, bindingAttr);\n            if (members.Length == 0)\n                return false;\n            Type memberUnderlyingType = GetMemberUnderlyingType(members[0]);\n            if (!memberUnderlyingType.IsGenericParameter)\n                return false;\n\n            return true;\n        }\n\n        public static T GetAttribute<T>(object attributeProvider) where T : Attribute\n        {\n            return GetAttribute<T>(attributeProvider, true);\n        }\n\n        public static T GetAttribute<T>(object attributeProvider, bool inherit) where T : Attribute\n        {\n            T[] attributes = GetAttributes<T>(attributeProvider, inherit);\n\n            return (attributes != null) ? attributes.SingleOrDefault() : null;\n        }\n\n#if !(NETFX_CORE || PORTABLE)\n        public static T[] GetAttributes<T>(object attributeProvider, bool inherit) where T : Attribute\n        {\n            ValidationUtils.ArgumentNotNull(attributeProvider, \"attributeProvider\");\n\n            object provider = attributeProvider;\n\n            // http://hyperthink.net/blog/getcustomattributes-gotcha/\n            // ICustomAttributeProvider doesn't do inheritance\n\n            if (provider is Type)\n                return (T[])((Type)provider).GetCustomAttributes(typeof(T), inherit);\n\n            if (provider is Assembly)\n                return (T[])Attribute.GetCustomAttributes((Assembly)provider, typeof(T));\n\n            if (provider is MemberInfo)\n                return (T[])Attribute.GetCustomAttributes((MemberInfo)provider, typeof(T), inherit);\n\n#if !PORTABLE40\n            if (provider is Module)\n                return (T[])Attribute.GetCustomAttributes((Module)provider, typeof(T), inherit);\n#endif\n\n            if (provider is ParameterInfo)\n                return (T[])Attribute.GetCustomAttributes((ParameterInfo)provider, typeof(T), inherit);\n\n#if !PORTABLE40\n            return (T[])((ICustomAttributeProvider)attributeProvider).GetCustomAttributes(typeof(T), inherit);\n#endif\n            throw new Exception(\"Cannot get attributes from '{0}'.\".FormatWith(CultureInfo.InvariantCulture, provider));\n        }\n#else\n        public static T[] GetAttributes<T>(object provider, bool inherit) where T : Attribute\n        {\n            if (provider is Type)\n                return ((Type) provider).GetTypeInfo().GetCustomAttributes<T>(inherit).ToArray();\n\n            if (provider is Assembly)\n                return ((Assembly) provider).GetCustomAttributes<T>().ToArray();\n\n            if (provider is MemberInfo)\n                return ((MemberInfo) provider).GetCustomAttributes<T>(inherit).ToArray();\n\n            if (provider is Module)\n                return ((Module) provider).GetCustomAttributes<T>().ToArray();\n\n            if (provider is ParameterInfo)\n                return ((ParameterInfo) provider).GetCustomAttributes<T>(inherit).ToArray();\n\n            throw new Exception(\"Cannot get attributes from '{0}'.\".FormatWith(CultureInfo.InvariantCulture, provider));\n        }\n#endif\n\n        public static void SplitFullyQualifiedTypeName(string fullyQualifiedTypeName, out string typeName, out string assemblyName)\n        {\n            int? assemblyDelimiterIndex = GetAssemblyDelimiterIndex(fullyQualifiedTypeName);\n\n            if (assemblyDelimiterIndex != null)\n            {\n                typeName = fullyQualifiedTypeName.Substring(0, assemblyDelimiterIndex.Value).Trim();\n                assemblyName = fullyQualifiedTypeName.Substring(assemblyDelimiterIndex.Value + 1, fullyQualifiedTypeName.Length - assemblyDelimiterIndex.Value - 1).Trim();\n            }\n            else\n            {\n                typeName = fullyQualifiedTypeName;\n                assemblyName = null;\n            }\n        }\n\n        private static int? GetAssemblyDelimiterIndex(string fullyQualifiedTypeName)\n        {\n            // we need to get the first comma following all surrounded in brackets because of generic types\n            // e.g. System.Collections.Generic.Dictionary`2[[System.String, mscorlib,Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\n            int scope = 0;\n            for (int i = 0; i < fullyQualifiedTypeName.Length; i++)\n            {\n                char current = fullyQualifiedTypeName[i];\n                switch (current)\n                {\n                    case '[':\n                        scope++;\n                        break;\n                    case ']':\n                        scope--;\n                        break;\n                    case ',':\n                        if (scope == 0)\n                            return i;\n                        break;\n                }\n            }\n\n            return null;\n        }\n\n        public static MemberInfo GetMemberInfoFromType(Type targetType, MemberInfo memberInfo)\n        {\n            const BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;\n\n            switch (memberInfo.MemberType())\n            {\n                case MemberTypes.Property:\n                    PropertyInfo propertyInfo = (PropertyInfo)memberInfo;\n\n                    Type[] types = propertyInfo.GetIndexParameters().Select(p => p.ParameterType).ToArray();\n\n                    return targetType.GetProperty(propertyInfo.Name, bindingAttr, null, propertyInfo.PropertyType, types, null);\n                default:\n                    return targetType.GetMember(memberInfo.Name, memberInfo.MemberType(), bindingAttr).SingleOrDefault();\n            }\n        }\n\n        public static IEnumerable<FieldInfo> GetFields(Type targetType, BindingFlags bindingAttr)\n        {\n            ValidationUtils.ArgumentNotNull(targetType, \"targetType\");\n\n            List<MemberInfo> fieldInfos = new List<MemberInfo>(targetType.GetFields(bindingAttr));\n#if !(NETFX_CORE || PORTABLE)\n            // Type.GetFields doesn't return inherited private fields\n            // manually find private fields from base class\n            GetChildPrivateFields(fieldInfos, targetType, bindingAttr);\n#endif\n\n            return fieldInfos.Cast<FieldInfo>();\n        }\n\n        private static void GetChildPrivateFields(IList<MemberInfo> initialFields, Type targetType, BindingFlags bindingAttr)\n        {\n            // fix weirdness with private FieldInfos only being returned for the current Type\n            // find base type fields and add them to result\n            if ((bindingAttr & BindingFlags.NonPublic) != 0)\n            {\n                // modify flags to not search for public fields\n                BindingFlags nonPublicBindingAttr = bindingAttr.RemoveFlag(BindingFlags.Public);\n\n                while ((targetType = targetType.BaseType()) != null)\n                {\n                    // filter out protected fields\n                    IEnumerable<MemberInfo> childPrivateFields =\n                        targetType.GetFields(nonPublicBindingAttr).Where(f => f.IsPrivate).Cast<MemberInfo>();\n\n                    initialFields.AddRange(childPrivateFields);\n                }\n            }\n        }\n\n        public static IEnumerable<PropertyInfo> GetProperties(Type targetType, BindingFlags bindingAttr)\n        {\n            ValidationUtils.ArgumentNotNull(targetType, \"targetType\");\n\n            List<PropertyInfo> propertyInfos = new List<PropertyInfo>(targetType.GetProperties(bindingAttr));\n            GetChildPrivateProperties(propertyInfos, targetType, bindingAttr);\n\n            // a base class private getter/setter will be inaccessable unless the property was gotten from the base class\n            for (int i = 0; i < propertyInfos.Count; i++)\n            {\n                PropertyInfo member = propertyInfos[i];\n                if (member.DeclaringType != targetType)\n                {\n                    PropertyInfo declaredMember = (PropertyInfo)GetMemberInfoFromType(member.DeclaringType, member);\n                    propertyInfos[i] = declaredMember;\n                }\n            }\n\n            return propertyInfos;\n        }\n\n        public static BindingFlags RemoveFlag(this BindingFlags bindingAttr, BindingFlags flag)\n        {\n            return ((bindingAttr & flag) == flag)\n                ? bindingAttr ^ flag\n                : bindingAttr;\n        }\n\n        private static void GetChildPrivateProperties(IList<PropertyInfo> initialProperties, Type targetType, BindingFlags bindingAttr)\n        {\n            // fix weirdness with private PropertyInfos only being returned for the current Type\n            // find base type properties and add them to result\n\n            // also find base properties that have been hidden by subtype properties with the same name\n\n            while ((targetType = targetType.BaseType()) != null)\n            {\n                foreach (PropertyInfo propertyInfo in targetType.GetProperties(bindingAttr))\n                {\n                    PropertyInfo subTypeProperty = propertyInfo;\n\n                    if (!IsPublic(subTypeProperty))\n                    {\n                        // have to test on name rather than reference because instances are different\n                        // depending on the type that GetProperties was called on\n                        int index = initialProperties.IndexOf(p => p.Name == subTypeProperty.Name);\n                        if (index == -1)\n                        {\n                            initialProperties.Add(subTypeProperty);\n                        }\n                        else\n                        {\n                            PropertyInfo childProperty = initialProperties[index];\n                            // don't replace public child with private base\n                            if (!IsPublic(childProperty))\n                            {\n                                // replace nonpublic properties for a child, but gotten from\n                                // the parent with the one from the child\n                                // the property gotten from the child will have access to private getter/setter\n                                initialProperties[index] = subTypeProperty;\n                            }\n                        }\n                    }\n                    else\n                    {\n                        if (!subTypeProperty.IsVirtual())\n                        {\n                            int index = initialProperties.IndexOf(p => p.Name == subTypeProperty.Name\n                                                                       && p.DeclaringType == subTypeProperty.DeclaringType);\n\n                            if (index == -1)\n                                initialProperties.Add(subTypeProperty);\n                        }\n                        else\n                        {\n                            int index = initialProperties.IndexOf(p => p.Name == subTypeProperty.Name\n                                                                       && p.IsVirtual()\n                                                                       && p.GetBaseDefinition() != null\n                                                                       && p.GetBaseDefinition().DeclaringType.IsAssignableFrom(subTypeProperty.DeclaringType));\n\n                            if (index == -1)\n                                initialProperties.Add(subTypeProperty);\n                        }\n                    }\n                }\n            }\n        }\n\n        public static bool IsMethodOverridden(Type currentType, Type methodDeclaringType, string method)\n        {\n            bool isMethodOverriden = currentType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)\n                .Any(info =>\n                    info.Name == method &&\n                    // check that the method overrides the original on DynamicObjectProxy\n                    info.DeclaringType != methodDeclaringType\n                    && info.GetBaseDefinition().DeclaringType == methodDeclaringType\n                );\n\n            return isMethodOverriden;\n        }\n\n        public static object GetDefaultValue(Type type)\n        {\n            if (!type.IsValueType())\n                return null;\n\n            switch (ConvertUtils.GetTypeCode(type))\n            {\n                case PrimitiveTypeCode.Boolean:\n                    return false;\n                case PrimitiveTypeCode.Char:\n                case PrimitiveTypeCode.SByte:\n                case PrimitiveTypeCode.Byte:\n                case PrimitiveTypeCode.Int16:\n                case PrimitiveTypeCode.UInt16:\n                case PrimitiveTypeCode.Int32:\n                case PrimitiveTypeCode.UInt32:\n                    return 0;\n                case PrimitiveTypeCode.Int64:\n                case PrimitiveTypeCode.UInt64:\n                    return 0L;\n                case PrimitiveTypeCode.Single:\n                    return 0f;\n                case PrimitiveTypeCode.Double:\n                    return 0.0;\n                case PrimitiveTypeCode.Decimal:\n                    return 0m;\n                case PrimitiveTypeCode.DateTime:\n                    return new DateTime();\n#if !(PORTABLE || PORTABLE40 || NET35 || NET20)\n                case PrimitiveTypeCode.BigInteger:\n                    return new BigInteger();\n#endif\n                case PrimitiveTypeCode.Guid:\n                    return new Guid();\n#if !NET20\n                case PrimitiveTypeCode.DateTimeOffset:\n                    return new DateTimeOffset();\n#endif\n            }\n\n            if (IsNullable(type))\n                return null;\n\n            // possibly use IL initobj for perf here?\n            return Activator.CreateInstance(type);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/StringBuffer.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    /// <summary>\n    /// Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer.\n    /// </summary>\n    internal class StringBuffer\n    {\n        private char[] _buffer;\n        private int _position;\n\n        private static readonly char[] EmptyBuffer = new char[0];\n\n        public int Position\n        {\n            get { return _position; }\n            set { _position = value; }\n        }\n\n        public StringBuffer()\n        {\n            _buffer = EmptyBuffer;\n        }\n\n        public StringBuffer(int initalSize)\n        {\n            _buffer = new char[initalSize];\n        }\n\n        public void Append(char value)\n        {\n            // test if the buffer array is large enough to take the value\n            if (_position == _buffer.Length)\n                EnsureSize(1);\n\n            // set value and increment poisition\n            _buffer[_position++] = value;\n        }\n\n        public void Append(char[] buffer, int startIndex, int count)\n        {\n            if (_position + count >= _buffer.Length)\n                EnsureSize(count);\n\n            Array.Copy(buffer, startIndex, _buffer, _position, count);\n\n            _position += count;\n        }\n\n        public void Clear()\n        {\n            _buffer = EmptyBuffer;\n            _position = 0;\n        }\n\n        private void EnsureSize(int appendLength)\n        {\n            char[] newBuffer = new char[(_position + appendLength) * 2];\n\n            Array.Copy(_buffer, newBuffer, _position);\n\n            _buffer = newBuffer;\n        }\n\n        public override string ToString()\n        {\n            return ToString(0, _position);\n        }\n\n        public string ToString(int start, int length)\n        {\n            // TODO: validation\n            return new string(_buffer, start, length);\n        }\n\n        public char[] GetInternalBuffer()\n        {\n            return _buffer;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/StringReference.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal struct StringReference\n    {\n        private readonly char[] _chars;\n        private readonly int _startIndex;\n        private readonly int _length;\n\n        public char[] Chars\n        {\n            get { return _chars; }\n        }\n\n        public int StartIndex\n        {\n            get { return _startIndex; }\n        }\n\n        public int Length\n        {\n            get { return _length; }\n        }\n\n        public StringReference(char[] chars, int startIndex, int length)\n        {\n            _chars = chars;\n            _startIndex = startIndex;\n            _length = length;\n        }\n\n        public override string ToString()\n        {\n            return new string(_chars, _startIndex, _length);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/StringUtils.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing System.Globalization;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class StringUtils\n    {\n        public const string CarriageReturnLineFeed = \"\\r\\n\";\n        public const string Empty = \"\";\n        public const char CarriageReturn = '\\r';\n        public const char LineFeed = '\\n';\n        public const char Tab = '\\t';\n\n        public static string FormatWith(this string format, IFormatProvider provider, object arg0)\n        {\n            return format.FormatWith(provider, new[] { arg0 });\n        }\n\n        public static string FormatWith(this string format, IFormatProvider provider, object arg0, object arg1)\n        {\n            return format.FormatWith(provider, new[] { arg0, arg1 });\n        }\n\n        public static string FormatWith(this string format, IFormatProvider provider, object arg0, object arg1, object arg2)\n        {\n            return format.FormatWith(provider, new[] { arg0, arg1, arg2 });\n        }\n\n        public static string FormatWith(this string format, IFormatProvider provider, params object[] args)\n        {\n            ValidationUtils.ArgumentNotNull(format, \"format\");\n\n            return string.Format(provider, format, args);\n        }\n\n        /// <summary>\n        /// Determines whether the string is all white space. Empty string will return false.\n        /// </summary>\n        /// <param name=\"s\">The string to test whether it is all white space.</param>\n        /// <returns>\n        /// \t<c>true</c> if the string is all white space; otherwise, <c>false</c>.\n        /// </returns>\n        public static bool IsWhiteSpace(string s)\n        {\n            if (s == null)\n                throw new ArgumentNullException(\"s\");\n\n            if (s.Length == 0)\n                return false;\n\n            for (int i = 0; i < s.Length; i++)\n            {\n                if (!char.IsWhiteSpace(s[i]))\n                    return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Nulls an empty string.\n        /// </summary>\n        /// <param name=\"s\">The string.</param>\n        /// <returns>Null if the string was null, otherwise the string unchanged.</returns>\n        public static string NullEmptyString(string s)\n        {\n            return (string.IsNullOrEmpty(s)) ? null : s;\n        }\n\n        public static StringWriter CreateStringWriter(int capacity)\n        {\n            StringBuilder sb = new StringBuilder(capacity);\n            StringWriter sw = new StringWriter(sb, CultureInfo.InvariantCulture);\n\n            return sw;\n        }\n\n        public static int? GetLength(string value)\n        {\n            if (value == null)\n                return null;\n            else\n                return value.Length;\n        }\n\n        public static void ToCharAsUnicode(char c, char[] buffer)\n        {\n            buffer[0] = '\\\\';\n            buffer[1] = 'u';\n            buffer[2] = MathUtils.IntToHex((c >> 12) & '\\x000f');\n            buffer[3] = MathUtils.IntToHex((c >> 8) & '\\x000f');\n            buffer[4] = MathUtils.IntToHex((c >> 4) & '\\x000f');\n            buffer[5] = MathUtils.IntToHex(c & '\\x000f');\n        }\n\n        public static TSource ForgivingCaseSensitiveFind<TSource>(this IEnumerable<TSource> source, Func<TSource, string> valueSelector, string testValue)\n        {\n            if (source == null)\n                throw new ArgumentNullException(\"source\");\n            if (valueSelector == null)\n                throw new ArgumentNullException(\"valueSelector\");\n\n            var caseInsensitiveResults = source.Where(s => string.Equals(valueSelector(s), testValue, StringComparison.OrdinalIgnoreCase));\n            if (caseInsensitiveResults.Count() <= 1)\n            {\n                return caseInsensitiveResults.SingleOrDefault();\n            }\n            else\n            {\n                // multiple results returned. now filter using case sensitivity\n                var caseSensitiveResults = source.Where(s => string.Equals(valueSelector(s), testValue, StringComparison.Ordinal));\n                return caseSensitiveResults.SingleOrDefault();\n            }\n        }\n\n        public static string ToCamelCase(string s)\n        {\n            if (string.IsNullOrEmpty(s))\n                return s;\n\n            if (!char.IsUpper(s[0]))\n                return s;\n\n            StringBuilder sb = new StringBuilder();\n            for (int i = 0; i < s.Length; i++)\n            {\n                bool hasNext = (i + 1 < s.Length);\n                if ((i == 0 || !hasNext) || char.IsUpper(s[i + 1]))\n                {\n                    char lowerCase;\n#if !(NETFX_CORE || PORTABLE)\n                    lowerCase = char.ToLower(s[i], CultureInfo.InvariantCulture);\n#else\n                    lowerCase = char.ToLower(s[i]);\n#endif\n\n                    sb.Append(lowerCase);\n                }\n                else\n                {\n                    sb.Append(s.Substring(i));\n                    break;\n                }\n            }\n\n            return sb.ToString();\n        }\n\n        public static bool IsHighSurrogate(char c)\n        {\n#if !(PORTABLE40 || PORTABLE)\n            return char.IsHighSurrogate(c);\n#else\n            return (c >= 55296 && c <= 56319);\n#endif\n        }\n\n        public static bool IsLowSurrogate(char c)\n        {\n#if !(PORTABLE40 || PORTABLE)\n            return char.IsLowSurrogate(c);\n#else\n            return (c >= 56320 && c <= 57343);\n#endif\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/ThreadSafeStore.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#endif\nusing System.Threading;\nusing Newtonsoft.Json.Serialization;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal class ThreadSafeStore<TKey, TValue>\n    {\n        private readonly object _lock = new object();\n        private Dictionary<TKey, TValue> _store;\n        private readonly Func<TKey, TValue> _creator;\n\n        public ThreadSafeStore(Func<TKey, TValue> creator)\n        {\n            if (creator == null)\n                throw new ArgumentNullException(\"creator\");\n\n            _creator = creator;\n            _store = new Dictionary<TKey, TValue>();\n        }\n\n        public TValue Get(TKey key)\n        {\n            TValue value;\n            if (!_store.TryGetValue(key, out value))\n                return AddValue(key);\n\n            return value;\n        }\n\n        private TValue AddValue(TKey key)\n        {\n            TValue value = _creator(key);\n\n            lock (_lock)\n            {\n                if (_store == null)\n                {\n                    _store = new Dictionary<TKey, TValue>();\n                    _store[key] = value;\n                }\n                else\n                {\n                    // double check locking\n                    TValue checkValue;\n                    if (_store.TryGetValue(key, out checkValue))\n                        return checkValue;\n\n                    Dictionary<TKey, TValue> newStore = new Dictionary<TKey, TValue>(_store);\n                    newStore[key] = value;\n\n#if !(NETFX_CORE || PORTABLE)\n                    Thread.MemoryBarrier();\n#endif\n                    _store = newStore;\n                }\n\n                return value;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/TypeExtensions.cs",
    "content": "﻿#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing System.Reflection;\n#if NET20\nusing Newtonsoft.Json.Utilities.LinqBridge;\n#else\nusing System.Linq;\n#endif\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class TypeExtensions\n    {\n#if NETFX_CORE || PORTABLE\n        private static BindingFlags DefaultFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;\n\n        public static MethodInfo GetGetMethod(this PropertyInfo propertyInfo)\n        {\n            return propertyInfo.GetGetMethod(false);\n        }\n\n        public static MethodInfo GetGetMethod(this PropertyInfo propertyInfo, bool nonPublic)\n        {\n            MethodInfo getMethod = propertyInfo.GetMethod;\n            if (getMethod != null && (getMethod.IsPublic || nonPublic))\n                return getMethod;\n\n            return null;\n        }\n\n        public static MethodInfo GetSetMethod(this PropertyInfo propertyInfo)\n        {\n            return propertyInfo.GetSetMethod(false);\n        }\n\n        public static MethodInfo GetSetMethod(this PropertyInfo propertyInfo, bool nonPublic)\n        {\n            MethodInfo setMethod = propertyInfo.SetMethod;\n            if (setMethod != null && (setMethod.IsPublic || nonPublic))\n                return setMethod;\n\n            return null;\n        }\n\n        public static bool IsSubclassOf(this Type type, Type c)\n        {\n            return type.GetTypeInfo().IsSubclassOf(c);\n        }\n\n        public static bool IsAssignableFrom(this Type type, Type c)\n        {\n            return type.GetTypeInfo().IsAssignableFrom(c.GetTypeInfo());\n        }\n#endif\n\n        public static MethodInfo Method(this Delegate d)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return d.Method;\n#else\n            return d.GetMethodInfo();\n#endif\n        }\n\n        public static MemberTypes MemberType(this MemberInfo memberInfo)\n        {\n#if !(NETFX_CORE || PORTABLE || PORTABLE40)\n            return memberInfo.MemberType;\n#else\n            if (memberInfo is PropertyInfo)\n                return MemberTypes.Property;\n            else if (memberInfo is FieldInfo)\n                return MemberTypes.Field;\n            else if (memberInfo is EventInfo)\n                return MemberTypes.Event;\n            else if (memberInfo is MethodInfo)\n                return MemberTypes.Method;\n            else\n                return MemberTypes.Other;\n#endif\n        }\n\n        public static bool ContainsGenericParameters(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.ContainsGenericParameters;\n#else\n            return type.GetTypeInfo().ContainsGenericParameters;\n#endif\n        }\n\n        public static bool IsInterface(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.IsInterface;\n#else\n            return type.GetTypeInfo().IsInterface;\n#endif\n        }\n\n        public static bool IsGenericType(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.IsGenericType;\n#else\n            return type.GetTypeInfo().IsGenericType;\n#endif\n        }\n\n        public static bool IsGenericTypeDefinition(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.IsGenericTypeDefinition;\n#else\n            return type.GetTypeInfo().IsGenericTypeDefinition;\n#endif\n        }\n\n        public static Type BaseType(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.BaseType;\n#else\n            return type.GetTypeInfo().BaseType;\n#endif\n        }\n\n        public static Assembly Assembly(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.Assembly;\n#else\n            return type.GetTypeInfo().Assembly;\n#endif\n        }\n\n        public static bool IsEnum(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.IsEnum;\n#else\n            return type.GetTypeInfo().IsEnum;\n#endif\n        }\n\n        public static bool IsClass(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.IsClass;\n#else\n            return type.GetTypeInfo().IsClass;\n#endif\n        }\n\n        public static bool IsSealed(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.IsSealed;\n#else\n            return type.GetTypeInfo().IsSealed;\n#endif\n        }\n\n#if PORTABLE40\n        public static PropertyInfo GetProperty(this Type type, string name, BindingFlags bindingFlags, object placeholder1, Type propertyType, IList<Type> indexParameters, object placeholder2)\n        {\n            IList<PropertyInfo> propertyInfos = type.GetProperties(bindingFlags);\n\n            return propertyInfos.Where(p =>\n            {\n                if (name != null && name != p.Name)\n                    return false;\n                if (propertyType != null && propertyType != p.PropertyType)\n                    return false;\n                if (indexParameters != null)\n                {\n                    if (!p.GetIndexParameters().Select(ip => ip.ParameterType).SequenceEqual(indexParameters))\n                        return false;\n                }\n\n                return true;\n            }).SingleOrDefault();\n        }\n\n        public static IEnumerable<MemberInfo> GetMember(this Type type, string name, MemberTypes memberType, BindingFlags bindingFlags)\n        {\n            return type.GetMembers(bindingFlags).Where(m =>\n            {\n                if (name != null && name != m.Name)\n                    return false;\n                if (m.MemberType() != memberType)\n                    return false;\n\n                return true;\n            });\n        }\n#endif\n\n#if (NETFX_CORE || PORTABLE)\n        public static MethodInfo GetBaseDefinition(this MethodInfo method)\n        {\n            return method.GetRuntimeBaseDefinition();\n        }\n#endif\n\n#if (NETFX_CORE || PORTABLE)\n        public static bool IsDefined(this Type type, Type attributeType, bool inherit)\n        {\n            return type.GetTypeInfo().CustomAttributes.Any(a => a.AttributeType == attributeType);\n        }\n\n        public static MethodInfo GetMethod(this Type type, string name)\n        {\n            return type.GetMethod(name, DefaultFlags);\n        }\n\n        public static MethodInfo GetMethod(this Type type, string name, BindingFlags bindingFlags)\n        {\n            return type.GetTypeInfo().GetDeclaredMethod(name);\n        }\n\n        public static MethodInfo GetMethod(this Type type, IList<Type> parameterTypes)\n        {\n            return type.GetMethod(null, parameterTypes);\n        }\n\n        public static MethodInfo GetMethod(this Type type, string name, IList<Type> parameterTypes)\n        {\n            return type.GetMethod(name, DefaultFlags, null, parameterTypes, null);\n        }\n\n        public static MethodInfo GetMethod(this Type type, string name, BindingFlags bindingFlags, object placeHolder1, IList<Type> parameterTypes, object placeHolder2)\n        {\n            return type.GetTypeInfo().DeclaredMethods.Where(m =>\n                                                                {\n                                                                    if (name != null && m.Name != name)\n                                                                        return false;\n\n                                                                    if (!TestAccessibility(m, bindingFlags))\n                                                                        return false;\n\n                                                                    return m.GetParameters().Select(p => p.ParameterType).SequenceEqual(parameterTypes);\n                                                                }).SingleOrDefault();\n        }\n\n        public static PropertyInfo GetProperty(this Type type, string name, BindingFlags bindingFlags, object placeholder1, Type propertyType, IList<Type> indexParameters, object placeholder2)\n        {\n            return type.GetTypeInfo().DeclaredProperties.Where(p =>\n                                                                   {\n                                                                       if (name != null && name != p.Name)\n                                                                           return false;\n                                                                       if (propertyType != null && propertyType != p.PropertyType)\n                                                                           return false;\n                                                                       if (indexParameters != null)\n                                                                       {\n                                                                           if (!p.GetIndexParameters().Select(ip => ip.ParameterType).SequenceEqual(indexParameters))\n                                                                               return false;\n                                                                       }\n\n                                                                       return true;\n                                                                   }).SingleOrDefault();\n        }\n\n        public static IEnumerable<MemberInfo> GetMember(this Type type, string name, MemberTypes memberType, BindingFlags bindingFlags)\n        {\n            return type.GetTypeInfo().GetMembersRecursive().Where(m =>\n                                                                      {\n                                                                          if (name != null && name != m.Name)\n                                                                              return false;\n                                                                          if (m.MemberType() != memberType)\n                                                                              return false;\n                                                                          if (!TestAccessibility(m, bindingFlags))\n                                                                              return false;\n\n                                                                          return true;\n                                                                      });\n        }\n\n        public static IEnumerable<ConstructorInfo> GetConstructors(this Type type)\n        {\n            return type.GetConstructors(DefaultFlags);\n        }\n\n        public static IEnumerable<ConstructorInfo> GetConstructors(this Type type, BindingFlags bindingFlags)\n        {\n            return type.GetConstructors(bindingFlags, null);\n        }\n\n        private static IEnumerable<ConstructorInfo> GetConstructors(this Type type, BindingFlags bindingFlags, IList<Type> parameterTypes)\n        {\n            return type.GetTypeInfo().DeclaredConstructors.Where(c =>\n                                                                     {\n                                                                         if (!TestAccessibility(c, bindingFlags))\n                                                                             return false;\n\n                                                                         if (parameterTypes != null && !c.GetParameters().Select(p => p.ParameterType).SequenceEqual(parameterTypes))\n                                                                             return false;\n\n                                                                         return true;\n                                                                     });\n        }\n\n        public static ConstructorInfo GetConstructor(this Type type, IList<Type> parameterTypes)\n        {\n            return type.GetConstructor(DefaultFlags, null, parameterTypes, null);\n        }\n\n        public static ConstructorInfo GetConstructor(this Type type, BindingFlags bindingFlags, object placeholder1, IList<Type> parameterTypes, object placeholder2)\n        {\n            return type.GetConstructors(bindingFlags, parameterTypes).SingleOrDefault();\n        }\n\n        public static MemberInfo[] GetMember(this Type type, string member)\n        {\n            return type.GetMember(member, DefaultFlags);\n        }\n\n        public static MemberInfo[] GetMember(this Type type, string member, BindingFlags bindingFlags)\n        {\n            return type.GetTypeInfo().GetMembersRecursive().Where(m => m.Name == member && TestAccessibility(m, bindingFlags)).ToArray();\n        }\n\n        public static MemberInfo GetField(this Type type, string member)\n        {\n            return type.GetField(member, DefaultFlags);\n        }\n\n        public static MemberInfo GetField(this Type type, string member, BindingFlags bindingFlags)\n        {\n            return type.GetTypeInfo().GetDeclaredField(member);\n        }\n\n        public static IEnumerable<PropertyInfo> GetProperties(this Type type, BindingFlags bindingFlags)\n        {\n            IList<PropertyInfo> properties = (bindingFlags.HasFlag(BindingFlags.DeclaredOnly))\n                                                 ? type.GetTypeInfo().DeclaredProperties.ToList()\n                                                 : type.GetTypeInfo().GetPropertiesRecursive();\n\n            return properties.Where(p => TestAccessibility(p, bindingFlags));\n        }\n\n        private static IList<MemberInfo> GetMembersRecursive(this TypeInfo type)\n        {\n            TypeInfo t = type;\n            IList<MemberInfo> members = new List<MemberInfo>();\n            while (t != null)\n            {\n                foreach (var member in t.DeclaredMembers)\n                {\n                    if (!members.Any(p => p.Name == member.Name))\n                        members.Add(member);\n                }\n                t = (t.BaseType != null) ? t.BaseType.GetTypeInfo() : null;\n            }\n\n            return members;\n        }\n\n        private static IList<PropertyInfo> GetPropertiesRecursive(this TypeInfo type)\n        {\n            TypeInfo t = type;\n            IList<PropertyInfo> properties = new List<PropertyInfo>();\n            while (t != null)\n            {\n                foreach (var member in t.DeclaredProperties)\n                {\n                    if (!properties.Any(p => p.Name == member.Name))\n                        properties.Add(member);\n                }\n                t = (t.BaseType != null) ? t.BaseType.GetTypeInfo() : null;\n            }\n\n            return properties;\n        }\n\n        private static IList<FieldInfo> GetFieldsRecursive(this TypeInfo type)\n        {\n            TypeInfo t = type;\n            IList<FieldInfo> fields = new List<FieldInfo>();\n            while (t != null)\n            {\n                foreach (var member in t.DeclaredFields)\n                {\n                    if (!fields.Any(p => p.Name == member.Name))\n                        fields.Add(member);\n                }\n                t = (t.BaseType != null) ? t.BaseType.GetTypeInfo() : null;\n            }\n\n            return fields;\n        }\n\n        public static IEnumerable<MethodInfo> GetMethods(this Type type, BindingFlags bindingFlags)\n        {\n            return type.GetTypeInfo().DeclaredMethods;\n        }\n\n        public static PropertyInfo GetProperty(this Type type, string name)\n        {\n            return type.GetProperty(name, DefaultFlags);\n        }\n\n        public static PropertyInfo GetProperty(this Type type, string name, BindingFlags bindingFlags)\n        {\n            return type.GetTypeInfo().GetDeclaredProperty(name);\n        }\n\n        public static IEnumerable<FieldInfo> GetFields(this Type type)\n        {\n            return type.GetFields(DefaultFlags);\n        }\n\n        public static IEnumerable<FieldInfo> GetFields(this Type type, BindingFlags bindingFlags)\n        {\n            IList<FieldInfo> fields = (bindingFlags.HasFlag(BindingFlags.DeclaredOnly))\n                                          ? type.GetTypeInfo().DeclaredFields.ToList()\n                                          : type.GetTypeInfo().GetFieldsRecursive();\n\n            return fields.Where(f => TestAccessibility(f, bindingFlags)).ToList();\n        }\n\n        private static bool TestAccessibility(PropertyInfo member, BindingFlags bindingFlags)\n        {\n            if (member.GetMethod != null && TestAccessibility(member.GetMethod, bindingFlags))\n                return true;\n\n            if (member.SetMethod != null && TestAccessibility(member.SetMethod, bindingFlags))\n                return true;\n\n            return false;\n        }\n\n        private static bool TestAccessibility(MemberInfo member, BindingFlags bindingFlags)\n        {\n            if (member is FieldInfo)\n            {\n                return TestAccessibility((FieldInfo) member, bindingFlags);\n            }\n            else if (member is MethodBase)\n            {\n                return TestAccessibility((MethodBase) member, bindingFlags);\n            }\n            else if (member is PropertyInfo)\n            {\n                return TestAccessibility((PropertyInfo) member, bindingFlags);\n            }\n\n            throw new Exception(\"Unexpected member type.\");\n        }\n\n        private static bool TestAccessibility(FieldInfo member, BindingFlags bindingFlags)\n        {\n            bool visibility = (member.IsPublic && bindingFlags.HasFlag(BindingFlags.Public)) ||\n                              (!member.IsPublic && bindingFlags.HasFlag(BindingFlags.NonPublic));\n\n            bool instance = (member.IsStatic && bindingFlags.HasFlag(BindingFlags.Static)) ||\n                            (!member.IsStatic && bindingFlags.HasFlag(BindingFlags.Instance));\n\n            return visibility && instance;\n        }\n\n        private static bool TestAccessibility(MethodBase member, BindingFlags bindingFlags)\n        {\n            bool visibility = (member.IsPublic && bindingFlags.HasFlag(BindingFlags.Public)) ||\n                              (!member.IsPublic && bindingFlags.HasFlag(BindingFlags.NonPublic));\n\n            bool instance = (member.IsStatic && bindingFlags.HasFlag(BindingFlags.Static)) ||\n                            (!member.IsStatic && bindingFlags.HasFlag(BindingFlags.Instance));\n\n            return visibility && instance;\n        }\n\n        public static Type[] GetGenericArguments(this Type type)\n        {\n            return type.GetTypeInfo().GenericTypeArguments;\n        }\n\n        public static IEnumerable<Type> GetInterfaces(this Type type)\n        {\n            return type.GetTypeInfo().ImplementedInterfaces;\n        }\n\n        public static IEnumerable<MethodInfo> GetMethods(this Type type)\n        {\n            return type.GetTypeInfo().DeclaredMethods;\n        }\n#endif\n\n        public static bool IsAbstract(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.IsAbstract;\n#else\n            return type.GetTypeInfo().IsAbstract;\n#endif\n        }\n\n        public static bool IsVisible(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.IsVisible;\n#else\n            return type.GetTypeInfo().IsVisible;\n#endif\n        }\n\n        public static bool IsValueType(this Type type)\n        {\n#if !(NETFX_CORE || PORTABLE)\n            return type.IsValueType;\n#else\n            return type.GetTypeInfo().IsValueType;\n#endif\n        }\n\n        public static bool AssignableToTypeName(this Type type, string fullTypeName, out Type match)\n        {\n            Type current = type;\n\n            while (current != null)\n            {\n                if (string.Equals(current.FullName, fullTypeName, StringComparison.Ordinal))\n                {\n                    match = current;\n                    return true;\n                }\n\n                current = current.BaseType();\n            }\n\n            foreach (Type i in type.GetInterfaces())\n            {\n                if (string.Equals(i.Name, fullTypeName, StringComparison.Ordinal))\n                {\n                    match = type;\n                    return true;\n                }\n            }\n\n            match = null;\n            return false;\n        }\n\n        public static bool AssignableToTypeName(this Type type, string fullTypeName)\n        {\n            Type match;\n            return type.AssignableToTypeName(fullTypeName, out match);\n        }\n\n        public static MethodInfo GetGenericMethod(this Type type, string name, params Type[] parameterTypes)\n        {\n            var methods = type.GetMethods().Where(method => method.Name == name);\n\n            foreach (var method in methods)\n            {\n                if (method.HasParameters(parameterTypes))\n                    return method;\n            }\n\n            return null;\n        }\n\n        public static bool HasParameters(this MethodInfo method, params Type[] parameterTypes)\n        {\n            var methodParameters = method.GetParameters().Select(parameter => parameter.ParameterType).ToArray();\n\n            if (methodParameters.Length != parameterTypes.Length)\n                return false;\n\n            for (int i = 0; i < methodParameters.Length; i++)\n                if (methodParameters[i].ToString() != parameterTypes[i].ToString())\n                    return false;\n\n            return true;\n        }\n\n        public static IEnumerable<Type> GetAllInterfaces(this Type target)\n        {\n            foreach (var i in target.GetInterfaces())\n            {\n                yield return i;\n                foreach (var ci in i.GetInterfaces())\n                {\n                    yield return ci;\n                }\n            }\n        }\n\n        public static IEnumerable<MethodInfo> GetAllMethods(this Type target)\n        {\n            var allTypes = target.GetAllInterfaces().ToList();\n            allTypes.Add(target);\n\n            return from type in allTypes\n                   from method in type.GetMethods()\n                   select method;\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/Utilities/ValidationUtils.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Globalization;\n\nnamespace Newtonsoft.Json.Utilities\n{\n    internal static class ValidationUtils\n    {\n        public static void ArgumentNotNullOrEmpty(string value, string parameterName)\n        {\n            if (value == null)\n                throw new ArgumentNullException(parameterName);\n\n            if (value.Length == 0)\n                throw new ArgumentException(\"'{0}' cannot be empty.\".FormatWith(CultureInfo.InvariantCulture, parameterName), parameterName);\n        }\n\n        public static void ArgumentTypeIsEnum(Type enumType, string parameterName)\n        {\n            ArgumentNotNull(enumType, \"enumType\");\n\n            if (!enumType.IsEnum())\n                throw new ArgumentException(\"Type {0} is not an Enum.\".FormatWith(CultureInfo.InvariantCulture, enumType), parameterName);\n        }\n\n        public static void ArgumentNotNull(object value, string parameterName)\n        {\n            if (value == null)\n                throw new ArgumentNullException(parameterName);\n        }\n    }\n}"
  },
  {
    "path": "Newtonsoft.Json/WriteState.cs",
    "content": "#region License\n// Copyright (c) 2007 James Newton-King\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n#endregion\n\nusing System;\n\nnamespace Newtonsoft.Json\n{\n    /// <summary>\n    /// Specifies the state of the <see cref=\"JsonWriter\"/>.\n    /// </summary>\n    public enum WriteState\n    {\n        /// <summary>\n        /// An exception has been thrown, which has left the <see cref=\"JsonWriter\"/> in an invalid state.\n        /// You may call the <see cref=\"JsonWriter.Close\"/> method to put the <see cref=\"JsonWriter\"/> in the <c>Closed</c> state.\n        /// Any other <see cref=\"JsonWriter\"/> method calls results in an <see cref=\"InvalidOperationException\"/> being thrown. \n        /// </summary>\n        Error,\n\n        /// <summary>\n        /// The <see cref=\"JsonWriter.Close\"/> method has been called. \n        /// </summary>\n        Closed,\n\n        /// <summary>\n        /// An object is being written. \n        /// </summary>\n        Object,\n\n        /// <summary>\n        /// A array is being written.\n        /// </summary>\n        Array,\n\n        /// <summary>\n        /// A constructor is being written.\n        /// </summary>\n        Constructor,\n\n        /// <summary>\n        /// A property is being written.\n        /// </summary>\n        Property,\n\n        /// <summary>\n        /// A write method has not been called.\n        /// </summary>\n        Start\n    }\n}"
  },
  {
    "path": "PipelineExtensions/.gitignore",
    "content": "\nbin\nobj"
  },
  {
    "path": "PipelineExtensions/ByteImporter.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Content.Pipeline;\nusing Microsoft.Xna.Framework.Content.Pipeline.Graphics;\n\nnamespace PipelineExtensions\n{\n\t[ContentImporter(\".*\", DisplayName = \"Byte Importer\", DefaultProcessor = \"PassThroughProcessor\")]\n\tpublic class ByteImporter : ContentImporter<byte[]>\n\t{\n\t\tpublic override byte[] Import(string filename, ContentImporterContext context)\n\t\t{\n\t\t\treturn System.IO.File.ReadAllBytes(filename);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "PipelineExtensions/CubemapProcessor.cs",
    "content": "#region File Description\n//-----------------------------------------------------------------------------\n// CubemapProcessor.cs\n//\n// Microsoft XNA Community Game Platform\n// Copyright (C) Microsoft Corporation. All rights reserved.\n//-----------------------------------------------------------------------------\n#endregion\n\n#region Using Statements\nusing System;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Content.Pipeline;\nusing Microsoft.Xna.Framework.Content.Pipeline.Graphics;\n#endregion\n\nnamespace PipelineExtensions\n{\n    /// <summary>\n    /// Custom content pipeline processor converts regular\n    /// 2D images into reflection cubemaps.\n    /// </summary>\n    [ContentProcessor]\n    public class CubemapProcessor : ContentProcessor<TextureContent, TextureCubeContent>\n    {\n        const int cubemapSize = 256;\n\n        /// <summary>\n        /// Converts an arbitrary 2D image into a reflection cubemap.\n        /// </summary>\n        public override TextureCubeContent Process(TextureContent input,\n                                                   ContentProcessorContext context)\n        {\n            // Convert the input data to Color format, for ease of processing.\n            input.ConvertBitmapType(typeof(PixelBitmapContent<Color>));\n\n            // Mirror the source image from left to right.\n            PixelBitmapContent<Color> mirrored;\n\n            mirrored = MirrorBitmap((PixelBitmapContent<Color>)input.Faces[0][0]);\n\n            // Create the six cubemap faces.\n            TextureCubeContent cubemap = new TextureCubeContent();\n\n            cubemap.Faces[(int)CubeMapFace.NegativeZ] = CreateSideFace(mirrored, 0);\n            cubemap.Faces[(int)CubeMapFace.NegativeX] = CreateSideFace(mirrored, 1);\n            cubemap.Faces[(int)CubeMapFace.PositiveZ] = CreateSideFace(mirrored, 2);\n            cubemap.Faces[(int)CubeMapFace.PositiveX] = CreateSideFace(mirrored, 3);\n            cubemap.Faces[(int)CubeMapFace.PositiveY] = CreateTopFace(mirrored);\n            cubemap.Faces[(int)CubeMapFace.NegativeY] = CreateBottomFace(mirrored);\n\n            // Calculate mipmap data.\n            cubemap.GenerateMipmaps(true);\n\n            // Compress the cubemap into DXT1 format.\n            cubemap.ConvertBitmapType(typeof(Dxt1BitmapContent));\n\n            return cubemap;\n        }\n\n\n        /// <summary>\n        /// Our source data is just a regular 2D image, but to make a good\n        /// cubemap we need this to wrap on all sides without any visible seams.\n        /// An easy way of making an image wrap from left to right is simply to\n        /// put a mirrored copy of the image next to the original. The point\n        /// where the image mirrors is still pretty obvious, but for a reflection\n        /// map this will be good enough.\n        /// </summary>\n        static PixelBitmapContent<Color> MirrorBitmap(PixelBitmapContent<Color> source)\n        {\n            int width = source.Width * 2;\n\n            PixelBitmapContent<Color> mirrored;\n            \n            mirrored = new PixelBitmapContent<Color>(width, source.Height);\n\n            for (int y = 0; y < source.Height; y++)\n            {\n                for (int x = 0; x < source.Width; x++)\n                {\n                    Color color = source.GetPixel(x, y);\n\n                    mirrored.SetPixel(x, y, color);\n                    mirrored.SetPixel(width - x - 1, y, color);\n                }\n            }\n\n            return mirrored;\n        }\n\n\n        /// <summary>\n        /// The four side faces of the cubemap are easy to create: we just copy\n        /// out the appropriate region from the middle of the source bitmap.\n        /// </summary>\n        static BitmapContent CreateSideFace(PixelBitmapContent<Color> source,\n            int cubeSide)\n        {\n            PixelBitmapContent<Color> result;\n            \n            result = new PixelBitmapContent<Color>(cubemapSize, cubemapSize);\n\n            Rectangle sourceRegion = new Rectangle(source.Width * cubeSide / 4,\n                                                   source.Height / 3,\n                                                   source.Width / 4,\n                                                   source.Height / 3);\n\n            Rectangle destinationRegion = new Rectangle(0, 0, cubemapSize, cubemapSize);\n\n            BitmapContent.Copy(source, sourceRegion, result, destinationRegion);\n\n            return result;\n        }\n\n\n        /// <summary>\n        /// We have to do a lot of stretching and warping to create the top\n        /// and bottom faces of the cubemap. To keep the result nicely free\n        /// of jaggies, we do this computation on a larger version of the\n        /// bitmap, then scale down the final result to antialias it.\n        /// </summary>\n        const int multisampleScale = 4;\n\n        \n        /// <summary>\n        /// Folds four flaps inward from the top of the source bitmap,\n        /// to create the top face of the cubemap.\n        /// </summary>\n        static BitmapContent CreateTopFace(PixelBitmapContent<Color> source)\n        {\n            PixelBitmapContent<Color> result;\n            \n            result = new PixelBitmapContent<Color>(cubemapSize * multisampleScale,\n                                                   cubemapSize * multisampleScale);\n\n            int right = cubemapSize * multisampleScale - 1;\n\n            ScaleTrapezoid(source, 0, -1, result, right, 0,    -1,  0,  0,  1);\n            ScaleTrapezoid(source, 1, -1, result, 0,     0,     0,  1,  1,  0);\n            ScaleTrapezoid(source, 2, -1, result, 0,     right, 1,  0,  0, -1);\n            ScaleTrapezoid(source, 3, -1, result, right, right, 0, -1, -1,  0);\n\n            return BlurCubemapFace(result);\n        }\n\n\n        /// <summary>\n        /// Folds four flaps inward from the bottom of the source bitmap,\n        /// to create the bottom face of the cubemap.\n        /// </summary>\n        static BitmapContent CreateBottomFace(PixelBitmapContent<Color> source)\n        {\n            PixelBitmapContent<Color> result;\n\n            result = new PixelBitmapContent<Color>(cubemapSize * multisampleScale,\n                                                   cubemapSize * multisampleScale);\n\n            int right = cubemapSize * multisampleScale - 1;\n\n            ScaleTrapezoid(source, 0, 1, result, right, right, -1,  0,  0, -1);\n            ScaleTrapezoid(source, 1, 1, result, 0,     right,  0, -1,  1,  0); \n            ScaleTrapezoid(source, 2, 1, result, 0,     0,      1,  0,  0,  1);\n            ScaleTrapezoid(source, 3, 1, result, right, 0,      0,  1, -1,  0);\n\n            return BlurCubemapFace(result);\n        }\n\n\n        /// <summary>\n        /// Worker function for folding and stretching a flap from the source\n        /// image to make up one quarter of the top or bottom cubemap faces.\n        /// </summary>\n        static void ScaleTrapezoid(PixelBitmapContent<Color> source,\n                                   int cubeSide, int cubeY,\n                                   PixelBitmapContent<Color> destination,\n                                   int destinationX, int destinationY,\n                                   int xDirection1, int yDirection1,\n                                   int xDirection2, int yDirection2)\n        {\n            int size = destination.Width;\n\n            // Compute the source x location.\n            int baseSourceX = cubeSide * source.Width / 4;\n\n            // Copy the image data one row at a time.\n            for (int row = 0; row < size / 2; row++)\n            {\n                // Compute the source y location.\n                int sourceY;\n\n                if (cubeY < 0)\n                    sourceY = source.Height / 3;\n                else\n                    sourceY = source.Height * 2 / 3;\n\n                sourceY += cubeY * row * source.Height / 3 / (size / 2);\n\n                // Stretch this row from the source to destination.\n                int x = destinationX;\n                int y = destinationY;\n\n                int rowLength = size - row * 2;\n\n                for (int i = 0; i < rowLength; i++)\n                {\n                    int sourceX = baseSourceX + i * source.Width / 4 / rowLength;\n\n                    Color color = source.GetPixel(sourceX, sourceY);\n\n                    destination.SetPixel(x, y, color);\n\n                    x += xDirection1;\n                    y += yDirection1;\n                }\n\n                // Advance to the start of the next row.\n                destinationX += xDirection1 + xDirection2;\n                destinationY += yDirection1 + yDirection2;\n            }\n        }\n\n        \n        /// <summary>\n        /// The top and bottom cubemap faces will have a nasty discontinuity\n        /// in the middle where the four source image flaps meet. We can cover\n        /// this up by applying a blur filter to the problematic area.\n        /// </summary>\n        static BitmapContent BlurCubemapFace(PixelBitmapContent<Color> source)\n        {\n            // Create two temporary bitmaps.\n            PixelBitmapContent<Vector4> temp1, temp2;\n\n            temp1 = new PixelBitmapContent<Vector4>(cubemapSize, cubemapSize);\n            temp2 = new PixelBitmapContent<Vector4>(cubemapSize, cubemapSize);\n\n            // Antialias by shrinking the larger generated image to the final size.\n            BitmapContent.Copy(source, temp1);\n\n            // Apply the blur in two passes, first horizontally, then vertically.\n            ApplyBlurPass(temp1, temp2, 1, 0);\n            ApplyBlurPass(temp2, temp1, 0, 1);\n\n            // Convert the result back to Color format.\n            PixelBitmapContent<Color> result;\n\n            result = new PixelBitmapContent<Color>(cubemapSize, cubemapSize);\n\n            BitmapContent.Copy(temp1, result);\n\n            return result;\n        }\n\n\n        /// <summary>\n        /// Applies a single pass of a separable box filter, blurring either\n        /// along the x or y axis. This could give much higher quality results\n        /// if we used a gaussian filter kernel rather than this simplistic box,\n        /// but this is good enough to get the job done.\n        /// </summary>\n        static void ApplyBlurPass(PixelBitmapContent<Vector4> source,\n                                  PixelBitmapContent<Vector4> destination,\n                                  int dx, int dy)\n        {\n            int cubemapCenter = cubemapSize / 2;\n\n            for (int y = 0; y < cubemapSize; y++)\n            {\n                for (int x = 0; x < cubemapSize; x++)\n                {\n                    // How far is this texel from the center of the image?\n                    int xDist = cubemapCenter - x;\n                    int yDist = cubemapCenter - y;\n\n                    int distance = (int)Math.Sqrt(xDist * xDist + yDist * yDist);\n\n                    // Blur more in the center, less near the edges.\n                    int blurAmount = Math.Max(cubemapCenter - distance, 0) / 8;\n\n                    // Accumulate source texel values.\n                    Vector4 blurredValue = Vector4.Zero;\n\n                    for (int i = -blurAmount; i <= blurAmount; i++)\n                    {\n                        blurredValue += source.GetPixel(x + dx * i, y + dy * i);\n                    }\n\n                    // Average them to calculate a blurred result.\n                    blurredValue /= blurAmount * 2 + 1;\n\n                    destination.SetPixel(x, y, blurredValue);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "PipelineExtensions/CustomModelProcessor.cs",
    "content": "#region File Description\n//-----------------------------------------------------------------------------\n// NormalMappingModelProcessor.cs\n//\n// Microsoft XNA Community Game Platform\n// Copyright (C) Microsoft Corporation. All rights reserved.\n//-----------------------------------------------------------------------------\n#endregion\n\nusing System;\nusing System.Collections.Generic;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Audio;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Input;\nusing Microsoft.Xna.Framework.Content;\nusing Microsoft.Xna.Framework.Content.Pipeline.Processors;\nusing Microsoft.Xna.Framework.Content.Pipeline.Graphics;\nusing Microsoft.Xna.Framework.Content.Pipeline;\nusing System.IO;\nusing System.ComponentModel;\n#if MONOGAME\nusing MonoGameContentProcessors.Processors;\n#endif\n\nnamespace PipelineExtensions\n{\n\t/// <summary>\n\t/// The NormalMappingModelProcessor is used to change the material/effect applied\n\t/// to a model. After going through this processor, the output model will be set\n\t/// up to be rendered with NormalMapping.fx.\n\t/// </summary>\n\t[ContentProcessor(DisplayName=\"Lemma Model Processor\")]\n\tpublic class CustomModelProcessor : ModelProcessor\n\t{\n\n#if MONOGAME\n\t\tpublic const string SamplerPostfix = \"Sampler\";\n#else\n\t\tpublic const string SamplerPostfix = \"Texture\";\n#endif\n\n\t\t// this constant determines where we will look for the normal map in the opaque\n\t\t// data dictionary.\n\t\tpublic const string NormalMapKey = \"NormalMap\" + SamplerPostfix;\n\n\t\t/// <summary>\n\t\t/// We override this property from the base processor and force it to always\n\t\t/// return true: tangent frames are required for normal mapping, so they should\n\t\t/// not be optional.\n\t\t/// </summary>\n\t\t[Browsable(false)]\n\t\tpublic override bool GenerateTangentFrames\n\t\t{\n\t\t\tget { return true; }\n\t\t\tset { }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The user can set this value in the property grid. If it is set, the model\n\t\t/// will use this value for its normal map texture, overriding anything in the\n\t\t/// opaque data. We use the display name and description attributes to control\n\t\t/// how the property appears in the UI.\n\t\t/// </summary>\n\t\t[DisplayName(\"Normal Map Texture\")]\n\t\t[Description(\"If set, this file will be used as the normal map on the model, overriding anything found in the opaque data.\")]\n\t\t[DefaultValue(\"\")]\n\t\tpublic string NormalMapTexture\n\t\t{\n\t\t\tget { return normalMapTexture; }\n\t\t\tset { normalMapTexture = value; }\n\t\t}\n\t\tprivate string normalMapTexture;\n\n\t\t/// <summary>\n\t\t/// The user can set this value in the property grid. If it is set, the model\n\t\t/// will use this value for its diffuse texture, overriding anything in the\n\t\t/// opaque data. We use the display name and description attributes to control\n\t\t/// how the property appears in the UI.\n\t\t/// </summary>\n\t\t[DisplayName(\"Diffuse Texture\")]\n\t\t[Description(\"If set, this file will be used as the diffuse map on the model.\")]\n\t\t[DefaultValue(\"\")]\n\t\tpublic string DiffuseTexture\n\t\t{\n\t\t\tget { return diffuseTexture; }\n\t\t\tset { diffuseTexture = value; }\n\t\t}\n\t\tprivate string diffuseTexture;\n\n\t\t/// <summary>\n\t\t/// The user can set this value in the property grid. If it is set, the model\n\t\t/// will use this value for its effect filename, overriding anything in the\n\t\t/// opaque data. We use the display name and description attributes to control\n\t\t/// how the property appears in the UI.\n\t\t/// </summary>\n\t\t[DisplayName(\"Effect File Name\")]\n\t\t[Description(\"If set, this file will be used as the effect for all meshes in the model.\")]\n\t\t[DefaultValue(\"\")]\n\t\tpublic string EffectFileName\n\t\t{\n\t\t\tget { return effectFileName; }\n\t\t\tset { effectFileName = value; }\n\t\t}\n\t\tprivate string effectFileName;\n\n\t\tString directory;\n\n\t\tpublic override ModelContent Process(NodeContent input,\tContentProcessorContext context)\n\t\t{\n\t\t\tif (input == null)\n\t\t\t\tthrow new ArgumentNullException(\"input\");\n\n\t\t\tdirectory = Path.GetDirectoryName(input.Identity.SourceFilename);\n\n\t\t\tthis.LookUpNormalMapAndAddToTextures(input);\n\n\t\t\treturn base.Process(input, context);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Looks into the OpaqueData property on the \"mesh\" object, and looks for a\n\t\t/// a string containing the path to the normal map. The normal map is added\n\t\t/// to the Textures collection for each of the mesh's materials.\n\t\t/// </summary>\n\t\tprivate void LookUpNormalMapAndAddToTextures(NodeContent node)\n\t\t{\n\t\t\tMeshContent mesh = node as MeshContent;\n\t\t\tif (mesh != null)\n\t\t\t{\n\t\t\t\tstring pathToNormalMap;\n\n\t\t\t\t// if NormalMapTexture hasn't been set in the UI, we'll try to look up\n\t\t\t\t// the normal map using the opaque data.\n\t\t\t\tif (String.IsNullOrEmpty(NormalMapTexture))\n\t\t\t\t\tpathToNormalMap = mesh.OpaqueData.GetValue<string>(NormalMapKey, null);\n\t\t\t\t// However, if the NormalMapTexture is set, we'll use that value for\n\t\t\t\t// ever mesh in the scene.\n\t\t\t\telse\n\t\t\t\t\tpathToNormalMap = NormalMapTexture;\n\n\t\t\t\tif (pathToNormalMap != null)\n\t\t\t\t{\n\t\t\t\t\tpathToNormalMap = Path.Combine(directory, pathToNormalMap);\n\t\t\t\t\tforeach (GeometryContent geometry in mesh.Geometry)\n\t\t\t\t\t\tgeometry.Material.Textures.Add(NormalMapKey, new ExternalReference<TextureContent>(pathToNormalMap));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach (NodeContent child in node.Children)\n\t\t\t\tthis.LookUpNormalMapAndAddToTextures(child);\n\t\t}\n\n\n\t\t// acceptableVertexChannelNames are the inputs that the normal map effect\n\t\t// expects.  The NormalMappingModelProcessor overrides ProcessVertexChannel\n\t\t// to remove all vertex channels which don't have one of these four\n\t\t// names.\n\t\tstatic IList<string> acceptableVertexChannelNames = new string[]\n\t\t{\n\t\t\tVertexChannelNames.TextureCoordinate(0),\n\t\t\tVertexChannelNames.Normal(0),\n\t\t\tVertexChannelNames.Binormal(0),\n\t\t\tVertexChannelNames.Tangent(0),\n\t\t\tVertexChannelNames.Weights(0)\n\t\t};\n\n\n\t\t/// <summary>\n\t\t/// As an optimization, ProcessVertexChannel is overriden to remove data which\n\t\t/// is not used by the vertex shader.\n\t\t/// </summary>\n\t\t/// <param name=\"geometry\">the geometry object which contains the \n\t\t/// vertex channel</param>\n\t\t/// <param name=\"vertexChannelIndex\">the index of the vertex channel\n\t\t/// to operate on</param>\n\t\t/// <param name=\"context\">the context that the processor is operating\n\t\t/// under.  in most cases, this parameter isn't necessary; but could\n\t\t/// be used to log a warning that a channel had been removed.</param>\n\t\tprotected override void ProcessVertexChannel(GeometryContent geometry, int vertexChannelIndex, ContentProcessorContext context)\n\t\t{\n\t\t\tString vertexChannelName = geometry.Vertices.Channels[vertexChannelIndex].Name;\n\t\t\t\n\t\t\t// if this vertex channel has an acceptable names, process it as normal.\n\t\t\tif (acceptableVertexChannelNames.Contains(vertexChannelName))\n\t\t\t\tbase.ProcessVertexChannel(geometry, vertexChannelIndex, context);\n\t\t\t// otherwise, remove it from the vertex channels; it's just extra data\n\t\t\t// we don't need.\n\t\t\telse\n\t\t\t\tgeometry.Vertices.Channels.Remove(vertexChannelName);\n\t\t}\n\n\t\tprotected override MaterialContent ConvertMaterial(MaterialContent material, ContentProcessorContext context)\n\t\t{\n\t\t\tstring effectFile = this.effectFileName;\n\t\t\tif (string.IsNullOrEmpty(effectFile))\n\t\t\t{\n\t\t\t\tif (string.IsNullOrEmpty(this.normalMapTexture))\n\t\t\t\t{\n\t\t\t\t\tif (string.IsNullOrEmpty(this.diffuseTexture))\n\t\t\t\t\t\teffectFile = \"Effects\\\\DefaultSolidColor.fx\";\n\t\t\t\t\telse\n\t\t\t\t\t\teffectFile = \"Effects\\\\Default.fx\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\teffectFile = \"Effects\\\\DefaultNormalMap.fx\";\n\t\t\t}\n\n\t\t\tEffectMaterialContent normalMappingMaterial = new EffectMaterialContent();\n\t\t\tnormalMappingMaterial.Effect = new ExternalReference<EffectContent>(Path.Combine(directory, effectFile));\n\n\t\t\tOpaqueDataDictionary processorParameters = new OpaqueDataDictionary();\n\t\t\tprocessorParameters[\"ColorKeyColor\"] = this.ColorKeyColor;\n\t\t\tprocessorParameters[\"ColorKeyEnabled\"] = this.ColorKeyEnabled;\n\t\t\tprocessorParameters[\"TextureFormat\"] = this.TextureFormat;\n\t\t\tprocessorParameters[\"PremultiplyTextureAlpha\"] = this.PremultiplyTextureAlpha;\n\t\t\tprocessorParameters[\"PremultiplyVertexColors\"] = this.PremultiplyVertexColors;\n\t\t\tprocessorParameters[\"GenerateMipmaps\"] = this.GenerateMipmaps;\n\t\t\tprocessorParameters[\"ResizeTexturesToPowerOfTwo\"] = this.ResizeTexturesToPowerOfTwo;\n\n\t\t\t// copy the textures in the original material to the new normal mapping\n\t\t\t// material. this way the diffuse texture is preserved. The\n\t\t\t// PreprocessSceneHierarchy function has already added the normal map\n\t\t\t// texture to the Textures collection, so that will be copied as well.\n\t\t\tforeach (KeyValuePair<String, ExternalReference<TextureContent>> texture in material.Textures)\n\t\t\t\tnormalMappingMaterial.Textures.Add(texture.Key, texture.Value);\n\n\t\t\tif (!string.IsNullOrEmpty(diffuseTexture))\n\t\t\t\tnormalMappingMaterial.Textures.Add(\"DiffuseTexture\", new ExternalReference<TextureContent>(Path.Combine(directory, diffuseTexture)));\n\n\t\t\t// and convert the material using the NormalMappingMaterialProcessor,\n\t\t\t// who has something special in store for the normal map.\n#if MONOGAME\n\t\t\treturn context.Convert<MaterialContent, MaterialContent>(normalMappingMaterial, typeof(MGMaterialProcessor).Name, processorParameters);\n#else\n\t\t\treturn context.Convert<MaterialContent, MaterialContent>(normalMappingMaterial, typeof(MaterialProcessor).Name, processorParameters);\n#endif\n\t\t}\n\t}\n}"
  },
  {
    "path": "PipelineExtensions/PipelineExtensions.XNA.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <ProjectGuid>{4636C7E1-B845-4B83-B96D-64A11B8A4515}</ProjectGuid>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>PipelineExtensions</RootNamespace>\n    <AssemblyName>PipelineExtensions</AssemblyName>\n    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|x86' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\x86\\Debug</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <PlatformTarget>x86</PlatformTarget>\n    <XnaPlatform>Windows</XnaPlatform>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)' == 'Release|x86'\">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\x86\\Release\\</OutputPath>\n    <DefineConstants>\n    </DefineConstants>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x86</PlatformTarget>\n    <ErrorReport>prompt</ErrorReport>\n    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>\n    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>\n    <Optimize>true</Optimize>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Content.Pipeline, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Content.Pipeline.FBXImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"System\">\n      <Private>False</Private>\n    </Reference>\n    <Reference Include=\"System.XML\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"ByteImporter.cs\" />\n    <Compile Include=\"CubemapProcessor.cs\" />\n    <Compile Include=\"CustomModelProcessor.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"SkinnedModelImporter.cs\" />\n    <Compile Include=\"SkinnedModelProcessor.cs\" />\n    <Compile Include=\"TextImporter.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\SkinnedModel\\SkinnedModelContent.csproj\">\n      <Project>{882A32E7-CB48-4E63-8180-0D1859575723}</Project>\n      <Name>SkinnedModelContent</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\Microsoft\\XNA Game Studio\\Microsoft.Xna.GameStudio.ContentPipelineExtensions.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n     Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "PipelineExtensions/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"PipelineExtensions\")]\n[assembly: AssemblyProduct(\"PipelineExtensions\")]\n[assembly: AssemblyDescription(\"Content Pipeline extension based on the XNA Skinned Model sample.\")]\n[assembly: AssemblyCompany(\"Microsoft\")]\n[assembly: AssemblyCopyright(\"Copyright © Microsoft 2009\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"004749eb-b0cf-4c1f-bdf3-390054aa0da5\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "PipelineExtensions/SkinnedModelImporter.cs",
    "content": "#region File Description\n//-----------------------------------------------------------------------------\n// Author: C J Bailey\n//-----------------------------------------------------------------------------\n// FBX Multi Take importer for XNA 4\n// Imports an FBX (ascii) file containing multiple animations and splits out the \n// \"takes\" data.  It then simply builds temporary FBX files (one for each \n// animation), processes each one with the standard FBX importer and combine \n// them into a single output at the end.  \n// This automates what many do manually.\n//-----------------------------------------------------------------------------\n// Discussion Forum\n// http://forums.create.msdn.com/forums/p/68149/426645.aspx\n//-----------------------------------------------------------------------------\n#endregion\n\n#region MIT License\n/*\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n#endregion\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.IO;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Xml;\nusing System.Linq;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Content;\nusing Microsoft.Xna.Framework.Content.Pipeline;\nusing Microsoft.Xna.Framework.Content.Pipeline.Graphics;\nusing Microsoft.Xna.Framework.Content.Pipeline.Processors;\nusing Microsoft.Xna.Framework.Design;\n\n// The type to import.\nusing TImport = Microsoft.Xna.Framework.Content.Pipeline.Graphics.NodeContent;\n\n// Change the namespace to suit your project\nnamespace PipelineExtensions\n{\n\t[ContentImporter(\".fbx\", DisplayName = \"Multi-take FBX Importer\", DefaultProcessor = \"SkinnedModelProcessor\")]\n\tpublic class SkinnedModelImporter : FbxImporter\n\t{\n\t\tprivate List<string> _animfiles;\n\t\tprivate List<string> _fbxheader;\n\t\tprivate TImport _master;\n\t\tprivate ContentImporterContext _context;\n\t\t\n\t\tpublic override TImport Import(string filename, ContentImporterContext context)\n\t\t{\n\t\t\t_context = context;\n\n\t\t\t// _animfiles will contain list of new temp anim files.\n\t\t\t_animfiles = new List<string>();\n\n\t\t\t// Decouple header and animation data.\n\t\t\tExtractAnimations(filename);\n\t\t\t\n\t\t\t// Process master file (this will also process the first animation)\n\t\t\t_master = base.Import(filename, context);\n\n\t\t\t// Process the remaining animations.\n\t\t\tforeach (string file in _animfiles) {\n\t\t\t\tTImport anim = base.Import(file, context);\n\t\t\t\t\n\t\t\t\t// Append animation to master NodeContent.\n\t\t\t\tAppendAnimation(_master, anim);\n\t\t\t}\n\t\t\t\n\t\t\t// Delete the temporary animation files.\n\t\t\tDeleteTempFiles();\n\t\t\t\n\t\t\treturn _master;\n\t\t}\n\t\t\n\t\tprivate void AppendAnimation(NodeContent masternode, NodeContent animnode)\n\t\t{\n\t\t\tforeach (KeyValuePair<string, AnimationContent> anim in animnode.Animations)\n\t\t\t\tmasternode.Animations[anim.Key] = anim.Value;\n\t\t\t\n\t\t\t//foreach (NodeContent child in animnode.Children) {\n\t\t\t//    if (child != null) {\n\t\t\t//        AppendAnimation(child);\n\t\t\t//    }\n\t\t\t//}\n\n\t\t\tfor (int i = 0; i < masternode.Children.Count; i++) {\n\t\t\t\tif (animnode.Children[i] != null) {\n\t\t\t\t\tAppendAnimation(masternode.Children[i], animnode.Children[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprivate void ExtractAnimations(string filename)\n\t\t{\n\t\t\tList<string> masterFile = File.ReadAllLines(filename).ToList();\n\t\t\tstring path = Path.GetDirectoryName(filename);\n\t\t\tint open_idx = 0,\n\t\t\t\tlength,\n\t\t\t\tnum_open = -1,\n\t\t\t\tfilenum = 0;\n\t\t\tbool foundTake = false;\n\n\t\t\tint idx = masterFile.IndexOf(\"Takes:  {\") + 1;\n\t\t\t_fbxheader = masterFile.Take(idx).ToList();\n\t\t\tList<string> anims = masterFile.Skip(idx).ToList();\n\t\t\t\n\t\t\t// Extract each animation and create a temporary anim file.\n\t\t\tfor (int i = 0; i < anims.Count; i++) {\n\t\t\t\tif (anims[i].Contains(\"Take: \")) {\n\t\t\t\t\topen_idx = i;\n\t\t\t\t\tnum_open = 0;\n\t\t\t\t\tfoundTake = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (anims[i].Contains(\"{\") &&\n\t\t\t\t\tfoundTake) {\n\t\t\t\t\tnum_open++;\n\t\t\t\t}\n\n\t\t\t\tif (anims[i].Contains(\"}\") &&\n\t\t\t\t\tfoundTake) {\n\t\t\t\t\tnum_open--;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (num_open == 0 &&\n\t\t\t\t\tfoundTake) {\n\t\t\t\t\t// Skip first animation since this is processed in the master\n\t\t\t\t\t// fbx file.\n\t\t\t\t\tif (filenum > 0) {\n\t\t\t\t\t\tlength = i - open_idx + 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Create temp file from header + anim data.\n\t\t\t\t\t\tCreateTempFile(Path.Combine(path, \"tmp.anim.\" + filenum + \".fbx\"),\n\t\t\t\t\t\t\t\t\t   anims.Skip(open_idx).Take(length).ToArray());\n\t\t\t\t\t}\n\t\t\t\t\tfilenum++;\n\t\t\t\t\tfoundTake = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprivate void CreateTempFile(string filename, string[] data)\n\t\t{\n\t\t\tList<string> completefile = new List<string>();\n\t\t\tcompletefile.AddRange(_fbxheader);\n\t\t\tcompletefile.AddRange(data);\n\n\t\t\ttry {\n\t\t\t\t// Write data to new temp file.\n\t\t\t\tFile.WriteAllLines(filename, completefile.ToArray());\n\n\t\t\t\t// Store temp file name for processing.\n\t\t\t\t_animfiles.Add(filename);\n\t\t\t}\n\t\t\tcatch {\n\t\t\t\t// Error while creating temp file.\n\t\t\t\t_context.Logger.LogWarning(null, null, \"Error creating temp file: {0}\", filename);\n\t\t\t}\n\t\t}\n\t\t\n\t\tprivate void DeleteTempFiles()\n\t\t{\n\t\t\tforeach (string file in _animfiles) {\n\t\t\t\tFile.Delete(file);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "PipelineExtensions/SkinnedModelProcessor.cs",
    "content": "#region File Description\n//-----------------------------------------------------------------------------\n// SkinnedModelProcessor.cs\n//\n// Microsoft XNA Community Game Platform\n// Copyright (C) Microsoft Corporation. All rights reserved.\n//-----------------------------------------------------------------------------\n#endregion\n\n#region Using Statements\nusing System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Content.Pipeline;\nusing Microsoft.Xna.Framework.Content.Pipeline.Graphics;\nusing Microsoft.Xna.Framework.Content.Pipeline.Processors;\nusing SkinnedModel;\n#endregion\n\nnamespace PipelineExtensions\n{\n\t/// <summary>\n\t/// Custom processor extends the builtin framework ModelProcessor class,\n\t/// adding animation support.\n\t/// </summary>\n\t[ContentProcessor(DisplayName = \"Lemma Skinned Model Processor\")]\n\tpublic class SkinnedModelProcessor : CustomModelProcessor\n\t{\n\t\tprivate const int defaultMaxBones = 67;\n\t\t[DisplayName(\"Max Bones\")]\n\t\t[Description(\"Max bone count.\")]\n\t\t[DefaultValue(67)]\n\t\tpublic int MaxBones\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.maxBones;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.maxBones = value;\n\t\t\t}\n\t\t}\n\t\tprivate int maxBones = defaultMaxBones;\n\n\t\t/// <summary>\n\t\t/// The main Process method converts an intermediate format content pipeline\n\t\t/// NodeContent tree to a ModelContent object with embedded animation data.\n\t\t/// </summary>\n\t\tpublic override ModelContent Process(NodeContent input, ContentProcessorContext context)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(this.EffectFileName))\n\t\t\t\tthis.EffectFileName = \"Effects\\\\Animation.fx\";\n\n\t\t\tValidateMesh(input, context, null);\n\n\t\t\t// Find the skeleton.\n\t\t\tBoneContent skeleton = MeshHelper.FindSkeleton(input);\n\n\t\t\tif (skeleton == null)\n\t\t\t\tthrow new InvalidContentException(\"Input skeleton not found.\");\n\n\t\t\t// We don't want to have to worry about different parts of the model being\n\t\t\t// in different local coordinate systems, so let's just bake everything.\n\t\t\tFlattenTransforms(input, skeleton);\n\n\t\t\t// Read the bind pose and skeleton hierarchy data.\n\t\t\tIList<BoneContent> bones = MeshHelper.FlattenSkeleton(skeleton);\n\n\t\t\tif (bones.Count > this.maxBones)\n\t\t\t\tthrow new InvalidContentException(string.Format(\"Skeleton has {0} bones, but the maximum supported is {1}.\", bones.Count, this.maxBones));\n\n\t\t\tDictionary<string, int> boneMap = new Dictionary<string, int>();\n\t\t\tList<Matrix> bindPose = new List<Matrix>();\n\t\t\tList<Matrix> inverseBindPose = new List<Matrix>();\n\t\t\tList<int> skeletonHierarchy = new List<int>();\n\n\t\t\tint i = 0;\n\t\t\tforeach (BoneContent bone in bones)\n\t\t\t{\n\t\t\t\tboneMap.Add(bone.Name, i);\n\t\t\t\tbindPose.Add(bone.Transform);\n\t\t\t\tinverseBindPose.Add(Matrix.Invert(bone.AbsoluteTransform));\n\t\t\t\tskeletonHierarchy.Add(bones.IndexOf(bone.Parent as BoneContent));\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\t// Convert animation data to our runtime format.\n\t\t\tDictionary<string, Clip> animationClips;\n\t\t\tanimationClips = ProcessAnimations(skeleton.Animations, bones);\n\n\t\t\t// Chain to the base ModelProcessor class so it can convert the model data.\n\t\t\tModelContent model = base.Process(input, context);\n\n\t\t\t// Store our custom animation data in the Tag property of the model.\n\t\t\tmodel.Tag = new SkinningData(boneMap, animationClips, bindPose, inverseBindPose, skeletonHierarchy);\n\n\t\t\treturn model;\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Converts an intermediate format content pipeline AnimationContentDictionary\n\t\t/// object to our runtime AnimationClip format.\n\t\t/// </summary>\n\t\tstatic Dictionary<string, Clip> ProcessAnimations(AnimationContentDictionary animations, IList<BoneContent> bones)\n\t\t{\n\t\t\t// Build up a table mapping bone names to indices.\n\t\t\tDictionary<string, int> boneMap = new Dictionary<string, int>();\n\n\t\t\tfor (int i = 0; i < bones.Count; i++)\n\t\t\t{\n\t\t\t\tstring boneName = bones[i].Name;\n\n\t\t\t\tif (!string.IsNullOrEmpty(boneName))\n\t\t\t\t\tboneMap.Add(boneName, i);\n\t\t\t}\n\n\t\t\t// Convert each animation in turn.\n\t\t\tDictionary<string, Clip> animationClips;\n\t\t\tanimationClips = new Dictionary<string, Clip>();\n\n\t\t\tforeach (KeyValuePair<string, AnimationContent> animation in animations)\n\t\t\t{\n\t\t\t\tClip processed = ProcessAnimation(animation.Value, boneMap);\n\t\t\t\tprocessed.Name = animation.Key;\n\n\t\t\t\tanimationClips.Add(animation.Key, processed);\n\t\t\t}\n\n\t\t\treturn animationClips;\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Converts an intermediate format content pipeline AnimationContent\n\t\t/// object to our runtime AnimationClip format.\n\t\t/// </summary>\n\t\tstatic Clip ProcessAnimation(AnimationContent animation, Dictionary<string, int> boneMap)\n\t\t{\n\t\t\tDictionary<int, Channel> channels = new Dictionary<int, Channel>();\n\n\t\t\t// For each input animation channel.\n\t\t\tforeach (KeyValuePair<string, AnimationChannel> inputChannel in animation.Channels)\n\t\t\t{\n\t\t\t\t// Look up what bone this channel is controlling.\n\t\t\t\tint boneIndex;\n\n\t\t\t\tif (!boneMap.TryGetValue(inputChannel.Key, out boneIndex))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (inputChannel.Value.Count > 0)\n\t\t\t\t{\n\t\t\t\t\tChannel newChannel = null;\n\n\t\t\t\t\tif (!channels.TryGetValue(boneIndex, out newChannel))\n\t\t\t\t\t{\n\t\t\t\t\t\tchannels[boneIndex] = newChannel = new Channel();\n\t\t\t\t\t\tnewChannel.BoneIndex = boneIndex;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach (AnimationKeyframe keyframe in inputChannel.Value)\n\t\t\t\t\t\tnewChannel.Add(new Keyframe(keyframe.Time, keyframe.Transform));\n\t\t\t\t\t\n\t\t\t\t\tnewChannel.Sort(CompareKeyframeTimes);\n\n\t\t\t\t\tfor (int i = 2; i < newChannel.Count; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tKeyframe keyframe = newChannel[i];\n\t\t\t\t\t\tif (newChannel[i - 1].Transform.Equals(keyframe.Transform)\n\t\t\t\t\t\t\t&& newChannel[newChannel.Count - 2].Transform.Equals(keyframe.Transform))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewChannel.RemoveAt(i - 1);\n\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new Clip(channels.Values);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Comparison function for sorting keyframes into ascending time order.\n\t\t/// </summary>\n\t\tstatic int CompareKeyframeTimes(Keyframe a, Keyframe b)\n\t\t{\n\t\t\treturn a.Time.CompareTo(b.Time);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Makes sure this mesh contains the kind of data we know how to animate.\n\t\t/// </summary>\n\t\tstatic void ValidateMesh(NodeContent node, ContentProcessorContext context, string parentBoneName)\n\t\t{\n\t\t\tMeshContent mesh = node as MeshContent;\n\n\t\t\tif (mesh != null)\n\t\t\t{\n\t\t\t\t// Validate the mesh.\n\t\t\t\tif (parentBoneName != null)\n\t\t\t\t{\n\t\t\t\t\tcontext.Logger.LogWarning(null, null,\n\t\t\t\t\t\t\"Mesh {0} is a child of bone {1}. SkinnedModelProcessor \" +\n\t\t\t\t\t\t\"does not correctly handle meshes that are children of bones.\",\n\t\t\t\t\t\tmesh.Name, parentBoneName);\n\t\t\t\t}\n\n\t\t\t\tif (!MeshHasSkinning(mesh))\n\t\t\t\t{\n\t\t\t\t\tcontext.Logger.LogWarning(null, null,\n\t\t\t\t\t\t\"Mesh {0} has no skinning information, so it has been deleted.\",\n\t\t\t\t\t\tmesh.Name);\n\n\t\t\t\t\tmesh.Parent.Children.Remove(mesh);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (node is BoneContent)\n\t\t\t{\n\t\t\t\t// If this is a bone, remember that we are now looking inside it.\n\t\t\t\tparentBoneName = node.Name;\n\t\t\t}\n\n\t\t\t// Recurse (iterating over a copy of the child collection,\n\t\t\t// because validating children may delete some of them).\n\t\t\tforeach (NodeContent child in new List<NodeContent>(node.Children))\n\t\t\t\tValidateMesh(child, context, parentBoneName);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Checks whether a mesh contains skininng information.\n\t\t/// </summary>\n\t\tstatic bool MeshHasSkinning(MeshContent mesh)\n\t\t{\n\t\t\tforeach (GeometryContent geometry in mesh.Geometry)\n\t\t\t{\n\t\t\t\tif (!geometry.Vertices.Channels.Contains(VertexChannelNames.Weights()))\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bakes unwanted transforms into the model geometry,\n\t\t/// so everything ends up in the same coordinate system.\n\t\t/// </summary>\n\t\tstatic void FlattenTransforms(NodeContent node, BoneContent skeleton)\n\t\t{\n\t\t\tforeach (NodeContent child in node.Children)\n\t\t\t{\n\t\t\t\t// Don't process the skeleton, because that is special.\n\t\t\t\tif (child == skeleton)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Bake the local transform into the actual geometry.\n\t\t\t\tMeshHelper.TransformScene(child, child.Transform);\n\n\t\t\t\t// Having baked it, we can now set the local\n\t\t\t\t// coordinate system back to identity.\n\t\t\t\tchild.Transform = Matrix.Identity;\n\n\t\t\t\t// Recurse.\n\t\t\t\tFlattenTransforms(child, skeleton);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "PipelineExtensions/TextImporter.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Graphics;\nusing Microsoft.Xna.Framework.Content.Pipeline;\nusing Microsoft.Xna.Framework.Content.Pipeline.Graphics;\n\nnamespace PipelineExtensions\n{\n\t[ContentImporter(\".*\", DisplayName = \"String Importer\", DefaultProcessor = \"PassThroughProcessor\")]\n\tpublic class TextImporter : ContentImporter<string>\n\t{\n\t\tpublic override string Import(string filename, ContentImporterContext context)\n\t\t{\n\t\t\treturn System.IO.File.ReadAllText(filename);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "PipelineExtensions/__init__.py",
    "content": "# ##### BEGIN GPL LICENSE BLOCK #####\n#\n#  This program is free software; you can redistribute it and/or\n#  modify it under the terms of the GNU General Public License\n#  as published by the Free Software Foundation; either version 2\n#  of the License, or (at your option) any later version.\n#\n#  This program is distributed in the hope that it will be useful,\n#  but WITHOUT ANY WARRANTY; without even the implied warranty of\n#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n#  GNU General Public License for more details.\n#\n#  You should have received a copy of the GNU General Public License\n#  along with this program; if not, write to the Free Software Foundation,\n#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n#\n# ##### END GPL LICENSE BLOCK #####\n\n# <pep8-80 compliant>\n\nbl_info = {\n    \"name\": \"Autodesk FBX format\",\n    \"author\": \"Campbell Barton\",\n    \"blender\": (2, 59, 0),\n    \"location\": \"File > Import-Export\",\n    \"description\": \"Export FBX meshes, UV's, vertex colors, materials, \"\n                   \"textures, cameras, lamps and actions\",\n    \"warning\": \"\",\n    \"wiki_url\": \"http://wiki.blender.org/index.php/Extensions:2.6/Py/\"\n                \"Scripts/Import-Export/Autodesk_FBX\",\n    \"tracker_url\": \"\",\n    \"support\": 'OFFICIAL',\n    \"category\": \"Import-Export\"}\n\n\nif \"bpy\" in locals():\n    import imp\n    if \"import_fbx\" in locals():\n        imp.reload(import_fbx)\n    if \"export_fbx\" in locals():\n        imp.reload(export_fbx)\n\n\nimport bpy\nfrom bpy.props import (StringProperty,\n                       BoolProperty,\n                       FloatProperty,\n                       EnumProperty,\n                       )\n\nfrom bpy_extras.io_utils import (ImportHelper,\n                                 ExportHelper,\n                                 path_reference_mode,\n                                 axis_conversion,\n                                 )\n\nclass ImportFBX(bpy.types.Operator, ImportHelper):\n    \"\"\"Load a FBX geometry file\"\"\"\n    bl_idname = \"import_scene.fbx\"\n    bl_label = \"Import FBX\"\n    bl_options = {'UNDO', 'PRESET'}\n\n    directory = StringProperty()\n\n    filename_ext = \".fbx\"\n    filter_glob = StringProperty(default=\"*.fbx\", options={'HIDDEN'})\n\n    use_image_search = BoolProperty(\n            name=\"Image Search\",\n            description=\"Search subdirs for any associated images \"\n                        \"(Warning, may be slow)\",\n            default=True,\n            )\n\n    use_alpha_decals = BoolProperty(\n            name=\"Alpha Decals\",\n            description=\"Treat materials with alpha as decals \"\n                        \"(no shadow casting)\",\n            default=False,\n            options={'HIDDEN'}\n            )\n    decal_offset = FloatProperty(\n            name=\"Decal Offset\",\n            description=\"Displace geometry of alpha meshes\",\n            min=0.0, max=1.0,\n            default=0.0,\n            options={'HIDDEN'}\n            )\n\n    axis_forward = EnumProperty(\n            name=\"Forward\",\n            items=(('X', \"X Forward\", \"\"),\n                   ('Y', \"Y Forward\", \"\"),\n                   ('Z', \"Z Forward\", \"\"),\n                   ('-X', \"-X Forward\", \"\"),\n                   ('-Y', \"-Y Forward\", \"\"),\n                   ('-Z', \"-Z Forward\", \"\"),\n                   ),\n            default='-Z',\n            )\n    axis_up = EnumProperty(\n            name=\"Up\",\n            items=(('X', \"X Up\", \"\"),\n                   ('Y', \"Y Up\", \"\"),\n                   ('Z', \"Z Up\", \"\"),\n                   ('-X', \"-X Up\", \"\"),\n                   ('-Y', \"-Y Up\", \"\"),\n                   ('-Z', \"-Z Up\", \"\"),\n                   ),\n            default='Y',\n            )\n    global_scale = FloatProperty(\n            name=\"Scale\",\n            min=0.001, max=1000.0,\n            default=1.0,\n            )\n\n    def execute(self, context):\n        from mathutils import Matrix\n\n        keywords = self.as_keywords(ignore=(\"axis_forward\",\n                                            \"axis_up\",\n                                            \"global_scale\",\n                                            \"filter_glob\",\n                                            \"directory\",\n                                            ))\n\n        global_matrix = (Matrix.Scale(self.global_scale, 4) *\n                         axis_conversion(from_forward=self.axis_forward,\n                                         from_up=self.axis_up,\n                                         ).to_4x4())\n        keywords[\"global_matrix\"] = global_matrix\n        keywords[\"use_cycles\"] = (context.scene.render.engine == 'CYCLES')\n\n        from . import import_fbx\n        return import_fbx.load(self, context, **keywords)\n\n\nclass ExportFBX(bpy.types.Operator, ExportHelper):\n    \"\"\"Selection to an ASCII Autodesk FBX\"\"\"\n    bl_idname = \"export_scene.fbx\"\n    bl_label = \"Export FBX\"\n    bl_options = {'UNDO', 'PRESET'}\n\n    filename_ext = \".fbx\"\n    filter_glob = StringProperty(default=\"*.fbx\", options={'HIDDEN'})\n\n    # List of operator properties, the attributes will be assigned\n    # to the class instance from the operator settings before calling.\n\n    use_selection = BoolProperty(\n            name=\"Selected Objects\",\n            description=\"Export selected objects on visible layers\",\n            default=False,\n            )\n    global_scale = FloatProperty(\n            name=\"Scale\",\n            description=(\"Scale all data \"\n                         \"(Some importers do not support scaled armatures!)\"),\n            min=0.001, max=1000.0,\n            soft_min=0.01, soft_max=1000.0,\n            default=1.0,\n            )\n    axis_forward = EnumProperty(\n            name=\"Forward\",\n            items=(('X', \"X Forward\", \"\"),\n                   ('Y', \"Y Forward\", \"\"),\n                   ('Z', \"Z Forward\", \"\"),\n                   ('-X', \"-X Forward\", \"\"),\n                   ('-Y', \"-Y Forward\", \"\"),\n                   ('-Z', \"-Z Forward\", \"\"),\n                   ),\n            default='-Z',\n            )\n    axis_up = EnumProperty(\n            name=\"Up\",\n            items=(('X', \"X Up\", \"\"),\n                   ('Y', \"Y Up\", \"\"),\n                   ('Z', \"Z Up\", \"\"),\n                   ('-X', \"-X Up\", \"\"),\n                   ('-Y', \"-Y Up\", \"\"),\n                   ('-Z', \"-Z Up\", \"\"),\n                   ),\n            default='Y',\n            )\n\n    object_types = EnumProperty(\n            name=\"Object Types\",\n            options={'ENUM_FLAG'},\n            items=(('EMPTY', \"Empty\", \"\"),\n                   ('CAMERA', \"Camera\", \"\"),\n                   ('LAMP', \"Lamp\", \"\"),\n                   ('ARMATURE', \"Armature\", \"\"),\n                   ('MESH', \"Mesh\", \"\"),\n                   ),\n            default={'EMPTY', 'CAMERA', 'LAMP', 'ARMATURE', 'MESH'},\n            )\n\n    use_mesh_modifiers = BoolProperty(\n            name=\"Apply Modifiers\",\n            description=\"Apply modifiers to mesh objects\",\n            default=True,\n            )\n    mesh_smooth_type = EnumProperty(\n            name=\"Smoothing\",\n            items=(('OFF', \"Off\", \"Don't write smoothing\"),\n                   ('FACE', \"Face\", \"Write face smoothing\"),\n                   ('EDGE', \"Edge\", \"Write edge smoothing\"),\n                   ),\n            default='FACE',\n            )\n\n    use_mesh_edges = BoolProperty(\n            name=\"Include Edges\",\n            default=False,\n            )\n    use_armature_deform_only = BoolProperty(\n            name=\"Only Deform Bones\",\n            description=\"Only write deforming bones\",\n            default=False,\n            )\n    use_anim = BoolProperty(\n            name=\"Include Animation\",\n            description=\"Export keyframe animation\",\n            default=True,\n            )\n    use_anim_action_all = BoolProperty(\n            name=\"All Actions\",\n            description=(\"Export all actions for armatures or just the \"\n                         \"currently selected action\"),\n            default=True,\n            )\n    use_default_take = BoolProperty(\n            name=\"Include Default Take\",\n            description=(\"Export currently assigned object and armature \"\n                         \"animations into a default take from the scene \"\n                         \"start/end frames\"),\n            default=True\n            )\n    use_anim_optimize = BoolProperty(\n            name=\"Optimize Keyframes\",\n            description=\"Remove double keyframes\",\n            default=True,\n            )\n    anim_optimize_precision = FloatProperty(\n            name=\"Precision\",\n            description=(\"Tolerance for comparing double keyframes \"\n                        \"(higher for greater accuracy)\"),\n            min=0.0, max=20.0,  # from 10^2 to 10^-18 frames precision.\n            soft_min=1.0, soft_max=16.0,\n            default=6.0,  # default: 10^-4 frames.\n            )\n    path_mode = path_reference_mode\n    batch_mode = EnumProperty(\n            name=\"Batch Mode\",\n            items=(('OFF', \"Off\", \"Active scene to file\"),\n                   ('SCENE', \"Scene\", \"Each scene as a file\"),\n                   ('GROUP', \"Group\", \"Each group as a file\"),\n                   ),\n            )\n    use_batch_own_dir = BoolProperty(\n            name=\"Batch Own Dir\",\n            description=\"Create a dir for each exported file\",\n            default=True,\n            )\n    use_metadata = BoolProperty(\n            name=\"Use Metadata\",\n            default=True,\n            options={'HIDDEN'},\n            )\n\n    @property\n    def check_extension(self):\n        return self.batch_mode == 'OFF'\n\n    def execute(self, context):\n        from mathutils import Matrix\n        if not self.filepath:\n            raise Exception(\"filepath not set\")\n\n\n        global_matrix = (Matrix.Scale(self.global_scale, 4) *\n                         axis_conversion(to_forward=self.axis_forward,\n                                         to_up=self.axis_up,\n                                         ).to_4x4())\n\n        keywords = self.as_keywords(ignore=(\"axis_forward\",\n                                            \"axis_up\",\n                                            \"global_scale\",\n                                            \"check_existing\",\n                                            \"filter_glob\",\n                                            ))\n\n        keywords[\"global_matrix\"] = global_matrix\n\n        from . import export_fbx\n        return export_fbx.save(self, context, **keywords)\n\n\ndef menu_func_import(self, context):\n    self.layout.operator(ImportFBX.bl_idname, text=\"Autodesk FBX (.fbx)\")\n\n\ndef menu_func_export(self, context):\n    self.layout.operator(ExportFBX.bl_idname, text=\"Autodesk FBX (.fbx)\")\n\n\ndef register():\n    bpy.utils.register_module(__name__)\n\n    bpy.types.INFO_MT_file_import.append(menu_func_import)\n    bpy.types.INFO_MT_file_export.append(menu_func_export)\n\n\ndef unregister():\n    bpy.utils.unregister_module(__name__)\n\n    bpy.types.INFO_MT_file_import.remove(menu_func_import)\n    bpy.types.INFO_MT_file_export.remove(menu_func_export)\n\nif __name__ == \"__main__\":\n    register()\n"
  },
  {
    "path": "PipelineExtensions/export_fbx.py",
    "content": "# ##### BEGIN GPL LICENSE BLOCK #####\n#\n#  This program is free software; you can redistribute it and/or\n#  modify it under the terms of the GNU General Public License\n#  as published by the Free Software Foundation; either version 2\n#  of the License, or (at your option) any later version.\n#\n#  This program is distributed in the hope that it will be useful,\n#  but WITHOUT ANY WARRANTY; without even the implied warranty of\n#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n#  GNU General Public License for more details.\n#\n#  You should have received a copy of the GNU General Public License\n#  along with this program; if not, write to the Free Software Foundation,\n#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n#\n# ##### END GPL LICENSE BLOCK #####\n\n# <pep8 compliant>\n\n# Script copyright (C) Campbell Barton\n\n\nimport os\nimport time\nimport math  # math.pi\n\nimport bpy\nfrom mathutils import Vector, Matrix\n\ndef grouper_exact(it, chunk_size):\n    \"\"\"\n    Grouper-like func, but returns exactly all elements from it:\n\n    >>> for chunk in grouper_exact(range(10), 3): print(e)\n    (0,1,2)\n    (3,4,5)\n    (6,7,8)\n    (9,)\n\n    About 2 times slower than simple zip(*[it] * 3), but does not need to convert iterator to sequence to be sure to\n    get exactly all elements in it (i.e. get a last chunk that may be smaller than chunk_size).\n    \"\"\"\n    import itertools\n    i = itertools.zip_longest(*[iter(it)] * chunk_size, fillvalue=...)\n    curr = next(i)\n    for nxt in i:\n        yield curr\n        curr = nxt\n    if ... in curr:\n        yield curr[:curr.index(...)]\n    else:\n        yield curr\n\n# I guess FBX uses degrees instead of radians (Arystan).\n# Call this function just before writing to FBX.\n# 180 / math.pi == 57.295779513\ndef tuple_rad_to_deg(eul):\n    return eul[0] * 57.295779513, eul[1] * 57.295779513, eul[2] * 57.295779513\n\n# Used to add the scene name into the filepath without using odd chars\nsane_name_mapping_ob = {}\nsane_name_mapping_ob_unique = set()\nsane_name_mapping_mat = {}\nsane_name_mapping_tex = {}\nsane_name_mapping_take = {}\nsane_name_mapping_group = {}\n\n# Make sure reserved names are not used\nsane_name_mapping_ob['Scene'] = 'Scene_'\nsane_name_mapping_ob_unique.add('Scene_')\n\n\ndef increment_string(t):\n    name = t\n    num = ''\n    while name and name[-1].isdigit():\n        num = name[-1] + num\n        name = name[:-1]\n    if num:\n        return '%s%d' % (name, int(num) + 1)\n    else:\n        return name + '_0'\n\n\n# todo - Disallow the name 'Scene' - it will bugger things up.\ndef sane_name(data, dct, unique_set=None):\n    #if not data: return None\n\n    if type(data) == tuple:  # materials are paired up with images\n        data, other = data\n        use_other = True\n    else:\n        other = None\n        use_other = False\n\n    name = data.name if data else None\n    orig_name = name\n\n    if other:\n        orig_name_other = other.name\n        name = '%s #%s' % (name, orig_name_other)\n    else:\n        orig_name_other = None\n\n    # dont cache, only ever call once for each data type now,\n    # so as to avoid namespace collision between types - like with objects <-> bones\n    #try:\t\treturn dct[name]\n    #except:\t\tpass\n\n    if not name:\n        name = 'unnamed'  # blank string, ASKING FOR TROUBLE!\n    else:\n\n        name = bpy.path.clean_name(name)  # use our own\n\n    name_unique = dct.values() if unique_set is None else unique_set\n\n    while name in name_unique:\n        name = increment_string(name)\n\n    if use_other:  # even if other is None - orig_name_other will be a string or None\n        dct[orig_name, orig_name_other] = name\n    else:\n        dct[orig_name] = name\n\n    if unique_set is not None:\n        unique_set.add(name)\n\n    return name\n\n\ndef sane_obname(data):\n    return sane_name(data, sane_name_mapping_ob, sane_name_mapping_ob_unique)\n\n\ndef sane_matname(data):\n    return sane_name(data, sane_name_mapping_mat)\n\n\ndef sane_texname(data):\n    return sane_name(data, sane_name_mapping_tex)\n\n\ndef sane_takename(data):\n    return sane_name(data, sane_name_mapping_take)\n\n\ndef sane_groupname(data):\n    return sane_name(data, sane_name_mapping_group)\n\n\ndef mat4x4str(mat):\n    # blender matrix is row major, fbx is col major so transpose on write\n    return (\"%.15f,%.15f,%.15f,%.15f,\"\n            \"%.15f,%.15f,%.15f,%.15f,\"\n            \"%.15f,%.15f,%.15f,%.15f,\"\n            \"%.15f,%.15f,%.15f,%.15f\" %\n            tuple([f for v in mat.transposed() for f in v]))\n\n\ndef action_bone_names(obj, action):\n    from bpy.types import PoseBone\n\n    names = set()\n    path_resolve = obj.path_resolve\n\n    for fcu in action.fcurves:\n        try:\n            prop = path_resolve(fcu.data_path, False)\n        except:\n            prop = None\n\n        if prop is not None:\n            data = prop.data\n            if isinstance(data, PoseBone):\n                names.add(data.name)\n\n    return names\n\n\n# ob must be OB_MESH\ndef BPyMesh_meshWeight2List(ob, me):\n    \"\"\" Takes a mesh and return its group names and a list of lists, one list per vertex.\n    aligning the each vert list with the group names, each list contains float value for the weight.\n    These 2 lists can be modified and then used with list2MeshWeight to apply the changes.\n    \"\"\"\n\n    # Clear the vert group.\n    groupNames = [g.name for g in ob.vertex_groups]\n    len_groupNames = len(groupNames)\n\n    if not len_groupNames:\n        # no verts? return a vert aligned empty list\n        return [[] for i in range(len(me.vertices))], []\n    else:\n        vWeightList = [[0.0] * len_groupNames for i in range(len(me.vertices))]\n\n    for i, v in enumerate(me.vertices):\n        for g in v.groups:\n            # possible weights are out of range\n            index = g.group\n            if index < len_groupNames:\n                vWeightList[i][index] = g.weight\n\n    return groupNames, vWeightList\n\n\ndef meshNormalizedWeights(ob, me):\n    groupNames, vWeightList = BPyMesh_meshWeight2List(ob, me)\n\n    if not groupNames:\n        return [], []\n\n    for i, vWeights in enumerate(vWeightList):\n        tot = 0.0\n        for w in vWeights:\n            tot += w\n\n        if tot:\n            for j, w in enumerate(vWeights):\n                vWeights[j] = w / tot\n\n    return groupNames, vWeightList\n\nheader_comment = \\\n'''; FBX 6.1.0 project file\n; Created by Blender FBX Exporter\n; for support mail: ideasman42@gmail.com\n; ----------------------------------------------------\n\n'''\n\n\n# This func can be called with just the filepath\ndef save_single(operator, scene, filepath=\"\",\n        global_matrix=None,\n        context_objects=None,\n        object_types={'EMPTY', 'CAMERA', 'LAMP', 'ARMATURE', 'MESH'},\n        use_mesh_modifiers=True,\n        mesh_smooth_type='FACE',\n        use_armature_deform_only=False,\n        use_anim=True,\n        use_anim_optimize=True,\n        anim_optimize_precision=6,\n        use_anim_action_all=False,\n        use_metadata=True,\n        path_mode='AUTO',\n        use_mesh_edges=True,\n        use_rotate_workaround=True,\n        use_default_take=True,\n    ):\n\n    import bpy_extras.io_utils\n\n    # Only used for camera and lamp rotations\n    mtx_x90 = Matrix.Rotation(math.pi / 2.0, 3, 'X')\n    # Used for mesh and armature rotations\n    mtx4_z90 = Matrix.Rotation(math.pi / 2.0, 4, 'Z')\n    # Rotation does not work for XNA animations.  I do not know why but they end up a mess! (JCB)\n    if use_rotate_workaround:\n        # Set rotation to Matrix Identity for XNA (JCB)\n        mtx4_z90.identity()\n\n    if global_matrix is None:\n        global_matrix = Matrix()\n        global_scale = 1.0\n    else:\n        global_scale = global_matrix.median_scale\n\n    # Use this for working out paths relative to the export location\n    base_src = os.path.dirname(bpy.data.filepath)\n    base_dst = os.path.dirname(filepath)\n\n    # collect images to copy\n    copy_set = set()\n\n    # ----------------------------------------------\n    # storage classes\n    class my_bone_class(object):\n        __slots__ = (\"blenName\",\n                     \"blenBone\",\n                     \"blenMeshes\",\n                     \"restMatrix\",\n                     \"parent\",\n                     \"blenName\",\n                     \"fbxName\",\n                     \"fbxArm\",\n                     \"__pose_bone\",\n                     \"__anim_poselist\")\n\n        def __init__(self, blenBone, fbxArm):\n\n            # This is so 2 armatures dont have naming conflicts since FBX bones use object namespace\n            self.fbxName = sane_obname(blenBone)\n\n            self.blenName = blenBone.name\n            self.blenBone = blenBone\n            self.blenMeshes = {}  # fbxMeshObName : mesh\n            self.fbxArm = fbxArm\n            self.restMatrix = blenBone.matrix_local\n\n            # not used yet\n            #~ self.restMatrixInv = self.restMatrix.inverted()\n            #~ self.restMatrixLocal = None # set later, need parent matrix\n\n            self.parent = None\n\n            # not public\n            pose = fbxArm.blenObject.pose\n            self.__pose_bone = pose.bones[self.blenName]\n\n            # store a list if matrices here, (poseMatrix, head, tail)\n            # {frame:posematrix, frame:posematrix, ...}\n            self.__anim_poselist = {}\n\n        '''\n        def calcRestMatrixLocal(self):\n            if self.parent:\n                self.restMatrixLocal = self.restMatrix * self.parent.restMatrix.inverted()\n            else:\n                self.restMatrixLocal = self.restMatrix.copy()\n        '''\n        def setPoseFrame(self, f):\n            # cache pose info here, frame must be set beforehand\n\n            # Didnt end up needing head or tail, if we do - here it is.\n            '''\n            self.__anim_poselist[f] = (\\\n                self.__pose_bone.poseMatrix.copy(),\\\n                self.__pose_bone.head.copy(),\\\n                self.__pose_bone.tail.copy() )\n            '''\n\n            self.__anim_poselist[f] = self.__pose_bone.matrix.copy()\n\n        def getPoseBone(self):\n            return self.__pose_bone\n\n        # get pose from frame.\n        def getPoseMatrix(self, f):  # ----------------------------------------------\n            return self.__anim_poselist[f]\n        '''\n        def getPoseHead(self, f):\n            #return self.__pose_bone.head.copy()\n            return self.__anim_poselist[f][1].copy()\n        def getPoseTail(self, f):\n            #return self.__pose_bone.tail.copy()\n            return self.__anim_poselist[f][2].copy()\n        '''\n        # end\n\n        def getAnimParRelMatrix(self, frame):\n            #arm_mat = self.fbxArm.matrixWorld\n            #arm_mat = self.fbxArm.parRelMatrix()\n            if not self.parent:\n                #return mtx4_z90 * (self.getPoseMatrix(frame) * arm_mat) # dont apply arm matrix anymore\n                return self.getPoseMatrix(frame) * mtx4_z90\n            else:\n                #return (mtx4_z90 * ((self.getPoseMatrix(frame) * arm_mat)))  *  (mtx4_z90 * (self.parent.getPoseMatrix(frame) * arm_mat)).inverted()\n                return (self.parent.getPoseMatrix(frame) * mtx4_z90).inverted() * ((self.getPoseMatrix(frame)) * mtx4_z90)\n\n        # we need thes because cameras and lights modified rotations\n        def getAnimParRelMatrixRot(self, frame):\n            return self.getAnimParRelMatrix(frame)\n\n        def flushAnimData(self):\n            self.__anim_poselist.clear()\n\n    class my_object_generic(object):\n        __slots__ = (\"fbxName\",\n                     \"blenObject\",\n                     \"blenData\",\n                     \"origData\",\n                     \"blenTextures\",\n                     \"blenMaterials\",\n                     \"blenMaterialList\",\n                     \"blenAction\",\n                     \"blenActionList\",\n                     \"fbxGroupNames\",\n                     \"fbxParent\",\n                     \"fbxBoneParent\",\n                     \"fbxBones\",\n                     \"fbxArm\",\n                     \"matrixWorld\",\n                     \"__anim_poselist\",\n                     )\n\n        # Other settings can be applied for each type - mesh, armature etc.\n        def __init__(self, ob, matrixWorld=None):\n            self.fbxName = sane_obname(ob)\n            self.blenObject = ob\n            self.fbxGroupNames = []\n            self.fbxParent = None  # set later on IF the parent is in the selection.\n            self.fbxArm = None\n            if matrixWorld:\n                self.matrixWorld = global_matrix * matrixWorld\n            else:\n                self.matrixWorld = global_matrix * ob.matrix_world\n\n            self.__anim_poselist = {}  # we should only access this\n\n        def parRelMatrix(self):\n            if self.fbxParent:\n                return self.fbxParent.matrixWorld.inverted() * self.matrixWorld\n            else:\n                return self.matrixWorld\n\n        def setPoseFrame(self, f, fake=False):\n            if fake:\n                self.__anim_poselist[f] = self.matrixWorld * global_matrix.inverted()\n            else:\n                self.__anim_poselist[f] = self.blenObject.matrix_world.copy()\n\n        def getAnimParRelMatrix(self, frame):\n            if self.fbxParent:\n                #return (self.__anim_poselist[frame] * self.fbxParent.__anim_poselist[frame].inverted() ) * global_matrix\n                return (global_matrix * self.fbxParent.__anim_poselist[frame]).inverted() * (global_matrix * self.__anim_poselist[frame])\n            else:\n                return global_matrix * self.__anim_poselist[frame]\n\n        def getAnimParRelMatrixRot(self, frame):\n            obj_type = self.blenObject.type\n            if self.fbxParent:\n                matrix_rot = ((global_matrix * self.fbxParent.__anim_poselist[frame]).inverted() * (global_matrix * self.__anim_poselist[frame])).to_3x3()\n            else:\n                matrix_rot = (global_matrix * self.__anim_poselist[frame]).to_3x3()\n\n            # Lamps need to be rotated\n            if obj_type == 'LAMP':\n                matrix_rot = matrix_rot * mtx_x90\n            elif obj_type == 'CAMERA':\n                y = matrix_rot * Vector((0.0, 1.0, 0.0))\n                matrix_rot = Matrix.Rotation(math.pi / 2.0, 3, y) * matrix_rot\n\n            return matrix_rot\n\n    # ----------------------------------------------\n\n    print('\\nFBX export starting... %r' % filepath)\n    start_time = time.process_time()\n    try:\n        file = open(filepath, \"w\", encoding=\"utf8\", newline=\"\\n\")\n    except:\n        import traceback\n        traceback.print_exc()\n        operator.report({'ERROR'}, \"Couldn't open file %r\" % filepath)\n        return {'CANCELLED'}\n\n    # convenience\n    fw = file.write\n\n    # scene = context.scene  # now passed as an arg instead of context\n    world = scene.world\n\n    # ---------------------------- Write the header first\n    fw(header_comment)\n    if use_metadata:\n        curtime = time.localtime()[0:6]\n    else:\n        curtime = (0, 0, 0, 0, 0, 0)\n    #\n    fw(\n'''FBXHeaderExtension:  {\n\tFBXHeaderVersion: 1003\n\tFBXVersion: 6100\n\tCreationTimeStamp:  {\n\t\tVersion: 1000\n\t\tYear: %.4i\n\t\tMonth: %.2i\n\t\tDay: %.2i\n\t\tHour: %.2i\n\t\tMinute: %.2i\n\t\tSecond: %.2i\n\t\tMillisecond: 0\n\t}\n\tCreator: \"FBX SDK/FBX Plugins build 20070228\"\n\tOtherFlags:  {\n\t\tFlagPLE: 0\n\t}\n}''' % (curtime))\n\n    fw('\\nCreationTime: \"%.4i-%.2i-%.2i %.2i:%.2i:%.2i:000\"' % curtime)\n    fw('\\nCreator: \"Blender version %s\"' % bpy.app.version_string)\n\n    pose_items = []  # list of (fbxName, matrix) to write pose data for, easier to collect along the way\n\n    # --------------- funcs for exporting\n    def object_tx(ob, loc, matrix, matrix_mod=None):\n        \"\"\"\n        Matrix mod is so armature objects can modify their bone matrices\n        \"\"\"\n        if isinstance(ob, bpy.types.Bone):\n\n            # we know we have a matrix\n            # matrix = mtx4_z90 * (ob.matrix['ARMATURESPACE'] * matrix_mod)\n            matrix = ob.matrix_local * mtx4_z90  # dont apply armature matrix anymore\n\n            parent = ob.parent\n            if parent:\n                #par_matrix = mtx4_z90 * (parent.matrix['ARMATURESPACE'] * matrix_mod)\n                par_matrix = parent.matrix_local * mtx4_z90  # dont apply armature matrix anymore\n                matrix = par_matrix.inverted() * matrix\n\n            loc, rot, scale = matrix.decompose()\n            matrix_rot = rot.to_matrix()\n\n            loc = tuple(loc)\n            rot = tuple(rot.to_euler())  # quat -> euler\n            scale = tuple(scale)\n\n            # Essential for XNA to use the original matrix not rotated nor scaled (JCB)\n            if use_rotate_workaround:\n                matrix = ob.matrix_local\n\n        else:\n            # This is bad because we need the parent relative matrix from the fbx parent (if we have one), dont use anymore\n            #if ob and not matrix: matrix = ob.matrix_world * global_matrix\n            if ob and not matrix:\n                raise Exception(\"error: this should never happen!\")\n\n            matrix_rot = matrix\n            #if matrix:\n            #    matrix = matrix_scale * matrix\n\n            if matrix:\n                loc, rot, scale = matrix.decompose()\n                matrix_rot = rot.to_matrix()\n\n                # Lamps need to be rotated\n                if ob and ob.type == 'LAMP':\n                    matrix_rot = matrix_rot * mtx_x90\n                elif ob and ob.type == 'CAMERA':\n                    y = matrix_rot * Vector((0.0, 1.0, 0.0))\n                    matrix_rot = Matrix.Rotation(math.pi / 2.0, 3, y) * matrix_rot\n                # else do nothing.\n\n                loc = tuple(loc)\n                rot = tuple(matrix_rot.to_euler())\n                scale = tuple(scale)\n            else:\n                if not loc:\n                    loc = 0.0, 0.0, 0.0\n                scale = 1.0, 1.0, 1.0\n                rot = 0.0, 0.0, 0.0\n\n        return loc, rot, scale, matrix, matrix_rot\n\n    def write_object_tx(ob, loc, matrix, matrix_mod=None):\n        \"\"\"\n        We have loc to set the location if non blender objects that have a location\n\n        matrix_mod is only used for bones at the moment\n        \"\"\"\n        loc, rot, scale, matrix, matrix_rot = object_tx(ob, loc, matrix, matrix_mod)\n\n        fw('\\n\\t\\t\\tProperty: \"Lcl Translation\", \"Lcl Translation\", \"A+\",%.15f,%.15f,%.15f' % loc)\n        fw('\\n\\t\\t\\tProperty: \"Lcl Rotation\", \"Lcl Rotation\", \"A+\",%.15f,%.15f,%.15f' % tuple_rad_to_deg(rot))\n        fw('\\n\\t\\t\\tProperty: \"Lcl Scaling\", \"Lcl Scaling\", \"A+\",%.15f,%.15f,%.15f' % scale)\n        return loc, rot, scale, matrix, matrix_rot\n\n    def get_constraints(ob=None):\n        # Set variables to their defaults.\n        constraint_values = {\"loc_min\": (0.0, 0.0, 0.0),\n                             \"loc_max\": (0.0, 0.0, 0.0),\n                             \"loc_limit\": (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),\n                             \"rot_min\": (0.0, 0.0, 0.0),\n                             \"rot_max\": (0.0, 0.0, 0.0),\n                             \"rot_limit\": (0.0, 0.0, 0.0),\n                             \"sca_min\": (1.0, 1.0, 1.0),\n                             \"sca_max\": (1.0, 1.0, 1.0),\n                             \"sca_limit\": (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),\n                            }\n\n        # Iterate through the list of constraints for this object to get the information in a format which is compatible with the FBX format.\n        if ob is not None:\n            for constraint in ob.constraints:\n                if constraint.type == 'LIMIT_LOCATION':\n                    constraint_values[\"loc_min\"] = constraint.min_x, constraint.min_y, constraint.min_z\n                    constraint_values[\"loc_max\"] = constraint.max_x, constraint.max_y, constraint.max_z\n                    constraint_values[\"loc_limit\"] = constraint.use_min_x, constraint.use_min_y, constraint.use_min_z, constraint.use_max_x, constraint.use_max_y, constraint.use_max_z\n                elif constraint.type == 'LIMIT_ROTATION':\n                    constraint_values[\"rot_min\"] = math.degrees(constraint.min_x), math.degrees(constraint.min_y), math.degrees(constraint.min_z)\n                    constraint_values[\"rot_max\"] = math.degrees(constraint.max_x), math.degrees(constraint.max_y), math.degrees(constraint.max_z)\n                    constraint_values[\"rot_limit\"] = constraint.use_limit_x, constraint.use_limit_y, constraint.use_limit_z\n                elif constraint.type == 'LIMIT_SCALE':\n                    constraint_values[\"sca_min\"] = constraint.min_x, constraint.min_y, constraint.min_z\n                    constraint_values[\"sca_max\"] = constraint.max_x, constraint.max_y, constraint.max_z\n                    constraint_values[\"sca_limit\"] = constraint.use_min_x, constraint.use_min_y, constraint.use_min_z, constraint.use_max_x, constraint.use_max_y, constraint.use_max_z\n\n        # in case bad values are assigned.\n        assert(len(constraint_values) == 9)\n\n        return constraint_values\n\n    def write_object_props(ob=None, loc=None, matrix=None, matrix_mod=None, pose_bone=None):\n        # Check if a pose exists for this object and set the constraint soruce accordingly. (Poses only exsit if the object is a bone.)\n        if pose_bone:\n            constraints = get_constraints(pose_bone)\n        else:\n            constraints = get_constraints(ob)\n\n        # if the type is 0 its an empty otherwise its a mesh\n        # only difference at the moment is one has a color\n        fw('''\n\t\tProperties60:  {\n\t\t\tProperty: \"QuaternionInterpolate\", \"bool\", \"\",0\n\t\t\tProperty: \"Visibility\", \"Visibility\", \"A+\",1''')\n\n        loc, rot, scale, matrix, matrix_rot = write_object_tx(ob, loc, matrix, matrix_mod)\n\n        # Rotation order, note, for FBX files Iv loaded normal order is 1\n        # setting to zero.\n        # eEULER_XYZ = 0\n        # eEULER_XZY\n        # eEULER_YZX\n        # eEULER_YXZ\n        # eEULER_ZXY\n        # eEULER_ZYX\n\n        fw('\\n\\t\\t\\tProperty: \"RotationOffset\", \"Vector3D\", \"\",0,0,0'\n           '\\n\\t\\t\\tProperty: \"RotationPivot\", \"Vector3D\", \"\",0,0,0'\n           '\\n\\t\\t\\tProperty: \"ScalingOffset\", \"Vector3D\", \"\",0,0,0'\n           '\\n\\t\\t\\tProperty: \"ScalingPivot\", \"Vector3D\", \"\",0,0,0'\n           '\\n\\t\\t\\tProperty: \"TranslationActive\", \"bool\", \"\",0'\n           )\n\n        fw('\\n\\t\\t\\tProperty: \"TranslationMin\", \"Vector3D\", \"\",%.15g,%.15g,%.15g' % constraints[\"loc_min\"])\n        fw('\\n\\t\\t\\tProperty: \"TranslationMax\", \"Vector3D\", \"\",%.15g,%.15g,%.15g' % constraints[\"loc_max\"])\n        fw('\\n\\t\\t\\tProperty: \"TranslationMinX\", \"bool\", \"\",%d' % constraints[\"loc_limit\"][0])\n        fw('\\n\\t\\t\\tProperty: \"TranslationMinY\", \"bool\", \"\",%d' % constraints[\"loc_limit\"][1])\n        fw('\\n\\t\\t\\tProperty: \"TranslationMinZ\", \"bool\", \"\",%d' % constraints[\"loc_limit\"][2])\n        fw('\\n\\t\\t\\tProperty: \"TranslationMaxX\", \"bool\", \"\",%d' % constraints[\"loc_limit\"][3])\n        fw('\\n\\t\\t\\tProperty: \"TranslationMaxY\", \"bool\", \"\",%d' % constraints[\"loc_limit\"][4])\n        fw('\\n\\t\\t\\tProperty: \"TranslationMaxZ\", \"bool\", \"\",%d' % constraints[\"loc_limit\"][5])\n\n        fw('\\n\\t\\t\\tProperty: \"RotationOrder\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"RotationSpaceForLimitOnly\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"AxisLen\", \"double\", \"\",10'\n           '\\n\\t\\t\\tProperty: \"PreRotation\", \"Vector3D\", \"\",0,0,0'\n           '\\n\\t\\t\\tProperty: \"PostRotation\", \"Vector3D\", \"\",0,0,0'\n           '\\n\\t\\t\\tProperty: \"RotationActive\", \"bool\", \"\",0'\n           )\n\n        fw('\\n\\t\\t\\tProperty: \"RotationMin\", \"Vector3D\", \"\",%.15g,%.15g,%.15g' % constraints[\"rot_min\"])\n        fw('\\n\\t\\t\\tProperty: \"RotationMax\", \"Vector3D\", \"\",%.15g,%.15g,%.15g' % constraints[\"rot_max\"])\n        fw('\\n\\t\\t\\tProperty: \"RotationMinX\", \"bool\", \"\",%d' % constraints[\"rot_limit\"][0])\n        fw('\\n\\t\\t\\tProperty: \"RotationMinY\", \"bool\", \"\",%d' % constraints[\"rot_limit\"][1])\n        fw('\\n\\t\\t\\tProperty: \"RotationMinZ\", \"bool\", \"\",%d' % constraints[\"rot_limit\"][2])\n        fw('\\n\\t\\t\\tProperty: \"RotationMaxX\", \"bool\", \"\",%d' % constraints[\"rot_limit\"][0])\n        fw('\\n\\t\\t\\tProperty: \"RotationMaxY\", \"bool\", \"\",%d' % constraints[\"rot_limit\"][1])\n        fw('\\n\\t\\t\\tProperty: \"RotationMaxZ\", \"bool\", \"\",%d' % constraints[\"rot_limit\"][2])\n\n        fw('\\n\\t\\t\\tProperty: \"RotationStiffnessX\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"RotationStiffnessY\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"RotationStiffnessZ\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MinDampRangeX\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MinDampRangeY\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MinDampRangeZ\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MaxDampRangeX\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MaxDampRangeY\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MaxDampRangeZ\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MinDampStrengthX\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MinDampStrengthY\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MinDampStrengthZ\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MaxDampStrengthX\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MaxDampStrengthY\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"MaxDampStrengthZ\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"PreferedAngleX\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"PreferedAngleY\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"PreferedAngleZ\", \"double\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"InheritType\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"ScalingActive\", \"bool\", \"\",0'\n           )\n\n        fw('\\n\\t\\t\\tProperty: \"ScalingMin\", \"Vector3D\", \"\",%.15g,%.15g,%.15g' % constraints[\"sca_min\"])\n        fw('\\n\\t\\t\\tProperty: \"ScalingMax\", \"Vector3D\", \"\",%.15g,%.15g,%.15g' % constraints[\"sca_max\"])\n        fw('\\n\\t\\t\\tProperty: \"ScalingMinX\", \"bool\", \"\",%d' % constraints[\"sca_limit\"][0])\n        fw('\\n\\t\\t\\tProperty: \"ScalingMinY\", \"bool\", \"\",%d' % constraints[\"sca_limit\"][1])\n        fw('\\n\\t\\t\\tProperty: \"ScalingMinZ\", \"bool\", \"\",%d' % constraints[\"sca_limit\"][2])\n        fw('\\n\\t\\t\\tProperty: \"ScalingMaxX\", \"bool\", \"\",%d' % constraints[\"sca_limit\"][3])\n        fw('\\n\\t\\t\\tProperty: \"ScalingMaxY\", \"bool\", \"\",%d' % constraints[\"sca_limit\"][4])\n        fw('\\n\\t\\t\\tProperty: \"ScalingMaxZ\", \"bool\", \"\",%d' % constraints[\"sca_limit\"][5])\n\n        fw('\\n\\t\\t\\tProperty: \"GeometricTranslation\", \"Vector3D\", \"\",0,0,0'\n           '\\n\\t\\t\\tProperty: \"GeometricRotation\", \"Vector3D\", \"\",0,0,0'\n           '\\n\\t\\t\\tProperty: \"GeometricScaling\", \"Vector3D\", \"\",1,1,1'\n           '\\n\\t\\t\\tProperty: \"LookAtProperty\", \"object\", \"\"'\n           '\\n\\t\\t\\tProperty: \"UpVectorProperty\", \"object\", \"\"'\n           '\\n\\t\\t\\tProperty: \"Show\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"NegativePercentShapeSupport\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"DefaultAttributeIndex\", \"int\", \"\",0'\n           )\n\n        if ob and not isinstance(ob, bpy.types.Bone):\n            # Only mesh objects have color\n            fw('\\n\\t\\t\\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8'\n               '\\n\\t\\t\\tProperty: \"Size\", \"double\", \"\",100'\n               '\\n\\t\\t\\tProperty: \"Look\", \"enum\", \"\",1'\n               )\n\n        return loc, rot, scale, matrix, matrix_rot\n\n    # -------------------------------------------- Armatures\n    #def write_bone(bone, name, matrix_mod):\n    def write_bone(my_bone):\n        fw('\\n\\tModel: \"Model::%s\", \"Limb\" {' % my_bone.fbxName)\n        fw('\\n\\t\\tVersion: 232')\n\n        #~ poseMatrix = write_object_props(my_bone.blenBone, None, None, my_bone.fbxArm.parRelMatrix())[3]\n        poseMatrix = write_object_props(my_bone.blenBone, pose_bone=my_bone.getPoseBone())[3]  # dont apply bone matrices anymore\n\n        # Use the same calculation as in write_sub_deformer_skin to compute the global\n        # transform of the bone for the bind pose.\n        global_matrix_bone = (my_bone.fbxArm.matrixWorld * my_bone.restMatrix) * mtx4_z90\n        pose_items.append((my_bone.fbxName, global_matrix_bone))\n\n        # fw('\\n\\t\\t\\tProperty: \"Size\", \"double\", \"\",%.6f' % ((my_bone.blenData.head['ARMATURESPACE'] - my_bone.blenData.tail['ARMATURESPACE']) * my_bone.fbxArm.parRelMatrix()).length)\n        fw('\\n\\t\\t\\tProperty: \"Size\", \"double\", \"\",1')\n\n        #((my_bone.blenData.head['ARMATURESPACE'] * my_bone.fbxArm.matrixWorld) - (my_bone.blenData.tail['ARMATURESPACE'] * my_bone.fbxArm.parRelMatrix())).length)\n\n        \"\"\"\n        fw('\\n\\t\\t\\tProperty: \"LimbLength\", \"double\", \"\",%.6f' %\\\n            ((my_bone.blenBone.head['ARMATURESPACE'] - my_bone.blenBone.tail['ARMATURESPACE']) * my_bone.fbxArm.parRelMatrix()).length)\n        \"\"\"\n\n        fw('\\n\\t\\t\\tProperty: \"LimbLength\", \"double\", \"\",%.6f' %\n           (my_bone.blenBone.head_local - my_bone.blenBone.tail_local).length)\n\n        #fw('\\n\\t\\t\\tProperty: \"LimbLength\", \"double\", \"\",1')\n        fw('\\n\\t\\t\\tProperty: \"Color\", \"ColorRGB\", \"\",0.8,0.8,0.8'\n           '\\n\\t\\t\\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8'\n           '\\n\\t\\t}'\n           '\\n\\t\\tMultiLayer: 0'\n           '\\n\\t\\tMultiTake: 1'\n           '\\n\\t\\tShading: Y'\n           '\\n\\t\\tCulling: \"CullingOff\"'\n           '\\n\\t\\tTypeFlags: \"Skeleton\"'\n           '\\n\\t}'\n           )\n\n    def write_camera_switch():\n        fw('''\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t\tVersion: 232''')\n\n        write_object_props()\n        fw('''\n\t\t\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8\n\t\t\tProperty: \"Camera Index\", \"Integer\", \"A+\",100\n\t\t}\n\t\tMultiLayer: 0\n\t\tMultiTake: 1\n\t\tHidden: \"True\"\n\t\tShading: W\n\t\tCulling: \"CullingOff\"\n\t\tVersion: 101\n\t\tName: \"Model::Camera Switcher\"\n\t\tCameraId: 0\n\t\tCameraName: 100\n\t\tCameraIndexName:\n\t}''')\n\n    def write_camera_dummy(name, loc, near, far, proj_type, up):\n        fw('\\n\\tModel: \"Model::%s\", \"Camera\" {' % name)\n        fw('\\n\\t\\tVersion: 232')\n        write_object_props(None, loc)\n\n        fw('\\n\\t\\t\\tProperty: \"Color\", \"Color\", \"A\",0.8,0.8,0.8'\n           '\\n\\t\\t\\tProperty: \"Roll\", \"Roll\", \"A+\",0'\n           '\\n\\t\\t\\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",40'\n           '\\n\\t\\t\\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",1'\n           '\\n\\t\\t\\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",1'\n           '\\n\\t\\t\\tProperty: \"OpticalCenterX\", \"Real\", \"A+\",0'\n           '\\n\\t\\t\\tProperty: \"OpticalCenterY\", \"Real\", \"A+\",0'\n           '\\n\\t\\t\\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0.63,0.63,0.63'\n           '\\n\\t\\t\\tProperty: \"TurnTable\", \"Real\", \"A+\",0'\n           '\\n\\t\\t\\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1'\n           '\\n\\t\\t\\tProperty: \"UseMotionBlur\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"ResolutionMode\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"ApertureMode\", \"enum\", \"\",2'\n           '\\n\\t\\t\\tProperty: \"GateFit\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"FocalLength\", \"Real\", \"A+\",21.3544940948486'\n           '\\n\\t\\t\\tProperty: \"CameraFormat\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"AspectW\", \"double\", \"\",320'\n           '\\n\\t\\t\\tProperty: \"AspectH\", \"double\", \"\",200'\n           '\\n\\t\\t\\tProperty: \"PixelAspectRatio\", \"double\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"UseFrameColor\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3'\n           '\\n\\t\\t\\tProperty: \"ShowName\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"ShowGrid\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"ShowAzimut\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"ShowTimeCode\", \"bool\", \"\",0'\n           )\n\n        fw('\\n\\t\\t\\tProperty: \"NearPlane\", \"double\", \"\",%.6f' % near)\n        fw('\\n\\t\\t\\tProperty: \"FarPlane\", \"double\", \"\",%.6f' % far)\n\n        fw('\\n\\t\\t\\tProperty: \"FilmWidth\", \"double\", \"\",0.816'\n           '\\n\\t\\t\\tProperty: \"FilmHeight\", \"double\", \"\",0.612'\n           '\\n\\t\\t\\tProperty: \"FilmAspectRatio\", \"double\", \"\",1.33333333333333'\n           '\\n\\t\\t\\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"FilmFormatIndex\", \"enum\", \"\",4'\n           '\\n\\t\\t\\tProperty: \"ViewFrustum\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2'\n           '\\n\\t\\t\\tProperty: \"BackPlaneDistance\", \"double\", \"\",100'\n           '\\n\\t\\t\\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"LockMode\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"FitImage\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"Crop\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"Center\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"KeepRatio\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"BackgroundMode\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5'\n           '\\n\\t\\t\\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",1.33333333333333'\n           '\\n\\t\\t\\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100'\n           '\\n\\t\\t\\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50'\n           '\\n\\t\\t\\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50'\n           )\n\n        fw('\\n\\t\\t\\tProperty: \"CameraProjectionType\", \"enum\", \"\",%i' % proj_type)\n\n        fw('\\n\\t\\t\\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"UseDepthOfField\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"FocusSource\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"FocusAngle\", \"double\", \"\",3.5'\n           '\\n\\t\\t\\tProperty: \"FocusDistance\", \"double\", \"\",200'\n           '\\n\\t\\t\\tProperty: \"UseAntialiasing\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777'\n           '\\n\\t\\t\\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"FrameSamplingCount\", \"int\", \"\",7'\n           '\\n\\t\\t}'\n           '\\n\\t\\tMultiLayer: 0'\n           '\\n\\t\\tMultiTake: 0'\n           '\\n\\t\\tHidden: \"True\"'\n           '\\n\\t\\tShading: Y'\n           '\\n\\t\\tCulling: \"CullingOff\"'\n           '\\n\\t\\tTypeFlags: \"Camera\"'\n           '\\n\\t\\tGeometryVersion: 124'\n           )\n\n        fw('\\n\\t\\tPosition: %.6f,%.6f,%.6f' % loc)\n        fw('\\n\\t\\tUp: %i,%i,%i' % up)\n\n        fw('\\n\\t\\tLookAt: 0,0,0'\n           '\\n\\t\\tShowInfoOnMoving: 1'\n           '\\n\\t\\tShowAudio: 0'\n           '\\n\\t\\tAudioColor: 0,1,0'\n           '\\n\\t\\tCameraOrthoZoom: 1'\n           '\\n\\t}'\n           )\n\n    def write_camera_default():\n        # This sucks but to match FBX converter its easier to\n        # write the cameras though they are not needed.\n        write_camera_dummy('Producer Perspective', (0, 71.3, 287.5), 10, 4000, 0, (0, 1, 0))\n        write_camera_dummy('Producer Top', (0, 4000, 0), 1, 30000, 1, (0, 0, -1))\n        write_camera_dummy('Producer Bottom', (0, -4000, 0), 1, 30000, 1, (0, 0, -1))\n        write_camera_dummy('Producer Front', (0, 0, 4000), 1, 30000, 1, (0, 1, 0))\n        write_camera_dummy('Producer Back', (0, 0, -4000), 1, 30000, 1, (0, 1, 0))\n        write_camera_dummy('Producer Right', (4000, 0, 0), 1, 30000, 1, (0, 1, 0))\n        write_camera_dummy('Producer Left', (-4000, 0, 0), 1, 30000, 1, (0, 1, 0))\n\n    def write_camera(my_cam):\n        \"\"\"\n        Write a blender camera\n        \"\"\"\n        render = scene.render\n        width = render.resolution_x\n        height = render.resolution_y\n        aspect = width / height\n\n        data = my_cam.blenObject.data\n        # film width & height from mm to inches\n        filmwidth = data.sensor_width * 0.0393700787\n        filmheight = data.sensor_height * 0.0393700787\n        filmaspect = filmwidth / filmheight\n        # film offset\n        offsetx = filmwidth * data.shift_x\n        offsety = filmaspect * filmheight * data.shift_y\n\n        fw('\\n\\tModel: \"Model::%s\", \"Camera\" {' % my_cam.fbxName)\n        fw('\\n\\t\\tVersion: 232')\n        loc, rot, scale, matrix, matrix_rot = write_object_props(my_cam.blenObject, None, my_cam.parRelMatrix())\n\n        fw('\\n\\t\\t\\tProperty: \"Roll\", \"Roll\", \"A+\",0')\n        fw('\\n\\t\\t\\tProperty: \"FieldOfView\", \"FieldOfView\", \"A+\",%.6f' % math.degrees(data.angle_x))\n        fw('\\n\\t\\t\\tProperty: \"FieldOfViewX\", \"FieldOfView\", \"A+\",%.6f' % math.degrees(data.angle_x))\n        fw('\\n\\t\\t\\tProperty: \"FieldOfViewY\", \"FieldOfView\", \"A+\",%.6f' % math.degrees(data.angle_y))\n\n        fw('\\n\\t\\t\\tProperty: \"FocalLength\", \"Number\", \"A+\",%.6f' % data.lens)\n        fw('\\n\\t\\t\\tProperty: \"FilmOffsetX\", \"Number\", \"A+\",%.6f' % offsetx)\n        fw('\\n\\t\\t\\tProperty: \"FilmOffsetY\", \"Number\", \"A+\",%.6f' % offsety)\n\n        fw('\\n\\t\\t\\tProperty: \"BackgroundColor\", \"Color\", \"A+\",0,0,0'\n           '\\n\\t\\t\\tProperty: \"TurnTable\", \"Real\", \"A+\",0'\n           '\\n\\t\\t\\tProperty: \"DisplayTurnTableIcon\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"Motion Blur Intensity\", \"Real\", \"A+\",1'\n           '\\n\\t\\t\\tProperty: \"UseMotionBlur\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"UseRealTimeMotionBlur\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"ResolutionMode\", \"enum\", \"\",0'\n            # note that aperture mode 3 is focal length and not horizontal\n           '\\n\\t\\t\\tProperty: \"ApertureMode\", \"enum\", \"\",3'  # horizontal - Houdini compatible\n           '\\n\\t\\t\\tProperty: \"GateFit\", \"enum\", \"\",2'\n           '\\n\\t\\t\\tProperty: \"CameraFormat\", \"enum\", \"\",0'\n           )\n\n        fw('\\n\\t\\t\\tProperty: \"AspectW\", \"double\", \"\",%i' % width)\n        fw('\\n\\t\\t\\tProperty: \"AspectH\", \"double\", \"\",%i' % height)\n\n        \"\"\"Camera aspect ratio modes.\n            0 If the ratio mode is eWINDOW_SIZE, both width and height values aren't relevant.\n            1 If the ratio mode is eFIXED_RATIO, the height value is set to 1.0 and the width value is relative to the height value.\n            2 If the ratio mode is eFIXED_RESOLUTION, both width and height values are in pixels.\n            3 If the ratio mode is eFIXED_WIDTH, the width value is in pixels and the height value is relative to the width value.\n            4 If the ratio mode is eFIXED_HEIGHT, the height value is in pixels and the width value is relative to the height value.\n\n        Definition at line 234 of file kfbxcamera.h. \"\"\"\n\n        fw('\\n\\t\\t\\tProperty: \"PixelAspectRatio\", \"double\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"UseFrameColor\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"FrameColor\", \"ColorRGB\", \"\",0.3,0.3,0.3'\n           '\\n\\t\\t\\tProperty: \"ShowName\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"ShowGrid\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"ShowOpticalCenter\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"ShowAzimut\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"ShowTimeCode\", \"bool\", \"\",0'\n           )\n\n        fw('\\n\\t\\t\\tProperty: \"NearPlane\", \"double\", \"\",%.6f' % (data.clip_start * global_scale))\n        fw('\\n\\t\\t\\tProperty: \"FarPlane\", \"double\", \"\",%.6f' % (data.clip_end * global_scale))\n\n        fw('\\n\\t\\t\\tProperty: \"FilmWidth\", \"double\", \"\",%.6f' % filmwidth)\n        fw('\\n\\t\\t\\tProperty: \"FilmHeight\", \"double\", \"\",%.6f' % filmheight)\n        fw('\\n\\t\\t\\tProperty: \"FilmAspectRatio\", \"double\", \"\",%.6f' % filmaspect)\n\n        fw('\\n\\t\\t\\tProperty: \"FilmSqueezeRatio\", \"double\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"FilmFormatIndex\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"ViewFrustum\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"ViewFrustumNearFarPlane\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"ViewFrustumBackPlaneMode\", \"enum\", \"\",2'\n           '\\n\\t\\t\\tProperty: \"BackPlaneDistance\", \"double\", \"\",100'\n           '\\n\\t\\t\\tProperty: \"BackPlaneDistanceMode\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"ViewCameraToLookAt\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"LockMode\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"LockInterestNavigation\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"FitImage\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"Crop\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"Center\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"KeepRatio\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"BackgroundMode\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"BackgroundAlphaTreshold\", \"double\", \"\",0.5'\n           '\\n\\t\\t\\tProperty: \"ForegroundTransparent\", \"bool\", \"\",1'\n           '\\n\\t\\t\\tProperty: \"DisplaySafeArea\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"SafeAreaDisplayStyle\", \"enum\", \"\",1'\n           )\n\n        fw('\\n\\t\\t\\tProperty: \"SafeAreaAspectRatio\", \"double\", \"\",%.6f' % aspect)\n\n        fw('\\n\\t\\t\\tProperty: \"Use2DMagnifierZoom\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"2D Magnifier Zoom\", \"Real\", \"A+\",100'\n           '\\n\\t\\t\\tProperty: \"2D Magnifier X\", \"Real\", \"A+\",50'\n           '\\n\\t\\t\\tProperty: \"2D Magnifier Y\", \"Real\", \"A+\",50'\n           '\\n\\t\\t\\tProperty: \"CameraProjectionType\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"UseRealTimeDOFAndAA\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"UseDepthOfField\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"FocusSource\", \"enum\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"FocusAngle\", \"double\", \"\",3.5'\n           '\\n\\t\\t\\tProperty: \"FocusDistance\", \"double\", \"\",200'\n           '\\n\\t\\t\\tProperty: \"UseAntialiasing\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"AntialiasingIntensity\", \"double\", \"\",0.77777'\n           '\\n\\t\\t\\tProperty: \"UseAccumulationBuffer\", \"bool\", \"\",0'\n           '\\n\\t\\t\\tProperty: \"FrameSamplingCount\", \"int\", \"\",7'\n           )\n\n        fw('\\n\\t\\t}')\n\n        fw('\\n\\t\\tMultiLayer: 0'\n           '\\n\\t\\tMultiTake: 0'\n           '\\n\\t\\tShading: Y'\n           '\\n\\t\\tCulling: \"CullingOff\"'\n           '\\n\\t\\tTypeFlags: \"Camera\"'\n           '\\n\\t\\tGeometryVersion: 124'\n           )\n\n        fw('\\n\\t\\tPosition: %.6f,%.6f,%.6f' % loc)\n        fw('\\n\\t\\tUp: %.6f,%.6f,%.6f' % (matrix_rot * Vector((0.0, 1.0, 0.0)))[:])\n        fw('\\n\\t\\tLookAt: %.6f,%.6f,%.6f' % (matrix_rot * Vector((0.0, 0.0, -1.0)))[:])\n\n        #fw('\\n\\t\\tUp: 0,0,0' )\n        #fw('\\n\\t\\tLookAt: 0,0,0' )\n\n        fw('\\n\\t\\tShowInfoOnMoving: 1')\n        fw('\\n\\t\\tShowAudio: 0')\n        fw('\\n\\t\\tAudioColor: 0,1,0')\n        fw('\\n\\t\\tCameraOrthoZoom: 1')\n        fw('\\n\\t}')\n\n    def write_light(my_light):\n        light = my_light.blenObject.data\n        fw('\\n\\tModel: \"Model::%s\", \"Light\" {' % my_light.fbxName)\n        fw('\\n\\t\\tVersion: 232')\n\n        write_object_props(my_light.blenObject, None, my_light.parRelMatrix())\n\n        # Why are these values here twice?????? - oh well, follow the holy sdk's output\n\n        # Blender light types match FBX's, funny coincidence, we just need to\n        # be sure that all unsupported types are made into a point light\n        #ePOINT,\n        #eDIRECTIONAL\n        #eSPOT\n        light_type_items = {'POINT': 0, 'SUN': 1, 'SPOT': 2, 'HEMI': 3, 'AREA': 4}\n        light_type = light_type_items[light.type]\n\n        if light_type > 2:\n            light_type = 1  # hemi and area lights become directional\n\n        if light.type == 'HEMI':\n            do_light = not (light.use_diffuse or light.use_specular)\n            do_shadow = False\n        else:\n            do_light = not (light.use_only_shadow or (not light.use_diffuse and not light.use_specular))\n            do_shadow = (light.shadow_method in {'RAY_SHADOW', 'BUFFER_SHADOW'})\n\n        # scale = abs(global_matrix.to_scale()[0])  # scale is always uniform in this case  #  UNUSED\n\n        fw('\\n\\t\\t\\tProperty: \"LightType\", \"enum\", \"\",%i' % light_type)\n        fw('\\n\\t\\t\\tProperty: \"CastLightOnObject\", \"bool\", \"\",1')\n        fw('\\n\\t\\t\\tProperty: \"DrawVolumetricLight\", \"bool\", \"\",1')\n        fw('\\n\\t\\t\\tProperty: \"DrawGroundProjection\", \"bool\", \"\",1')\n        fw('\\n\\t\\t\\tProperty: \"DrawFrontFacingVolumetricLight\", \"bool\", \"\",0')\n        fw('\\n\\t\\t\\tProperty: \"GoboProperty\", \"object\", \"\"')\n        fw('\\n\\t\\t\\tProperty: \"Color\", \"Color\", \"A+\",1,1,1')\n        if light.type == 'SPOT':\n            fw('\\n\\t\\t\\tProperty: \"OuterAngle\", \"Number\", \"A+\",%.2f' %\n               math.degrees(light.spot_size))\n            fw('\\n\\t\\t\\tProperty: \"InnerAngle\", \"Number\", \"A+\",%.2f' %\n               (math.degrees(light.spot_size) - math.degrees(light.spot_size) * light.spot_blend))\n\n        fw('\\n\\t\\t\\tProperty: \"Fog\", \"Fog\", \"A+\",50')\n        fw('\\n\\t\\t\\tProperty: \"Color\", \"Color\", \"A\",%.2f,%.2f,%.2f' % tuple(light.color))\n        fw('\\n\\t\\t\\tProperty: \"Intensity\", \"Intensity\", \"A+\",%.2f' % (light.energy * 100.0))\n\n        fw('\\n\\t\\t\\tProperty: \"Fog\", \"Fog\", \"A+\",50')\n        fw('\\n\\t\\t\\tProperty: \"LightType\", \"enum\", \"\",%i' % light_type)\n        fw('\\n\\t\\t\\tProperty: \"CastLightOnObject\", \"bool\", \"\",%i' % do_light)\n        fw('\\n\\t\\t\\tProperty: \"DrawGroundProjection\", \"bool\", \"\",1')\n        fw('\\n\\t\\t\\tProperty: \"DrawFrontFacingVolumetricLight\", \"bool\", \"\",0')\n        fw('\\n\\t\\t\\tProperty: \"DrawVolumetricLight\", \"bool\", \"\",1')\n        fw('\\n\\t\\t\\tProperty: \"GoboProperty\", \"object\", \"\"')\n        if light.type in {'SPOT', 'POINT'}:\n            if light.falloff_type == 'CONSTANT':\n                fw('\\n\\t\\t\\tProperty: \"DecayType\", \"enum\", \"\",0')\n            if light.falloff_type == 'INVERSE_LINEAR':\n                fw('\\n\\t\\t\\tProperty: \"DecayType\", \"enum\", \"\",1')\n                fw('\\n\\t\\t\\tProperty: \"EnableFarAttenuation\", \"bool\", \"\",1')\n                fw('\\n\\t\\t\\tProperty: \"FarAttenuationEnd\", \"double\", \"\",%.2f' % (light.distance * 2.0))\n            if light.falloff_type == 'INVERSE_SQUARE':\n                fw('\\n\\t\\t\\tProperty: \"DecayType\", \"enum\", \"\",2')\n                fw('\\n\\t\\t\\tProperty: \"EnableFarAttenuation\", \"bool\", \"\",1')\n                fw('\\n\\t\\t\\tProperty: \"FarAttenuationEnd\", \"double\", \"\",%.2f' % (light.distance * 2.0))\n\n        fw('\\n\\t\\t\\tProperty: \"CastShadows\", \"bool\", \"\",%i' % do_shadow)\n        fw('\\n\\t\\t\\tProperty: \"ShadowColor\", \"ColorRGBA\", \"\",0,0,0,1')\n        fw('\\n\\t\\t}')\n\n        fw('\\n\\t\\tMultiLayer: 0'\n           '\\n\\t\\tMultiTake: 0'\n           '\\n\\t\\tShading: Y'\n           '\\n\\t\\tCulling: \"CullingOff\"'\n           '\\n\\t\\tTypeFlags: \"Light\"'\n           '\\n\\t\\tGeometryVersion: 124'\n           '\\n\\t}'\n           )\n\n    # matrixOnly is not used at the moment\n    def write_null(my_null=None, fbxName=None, fbxType=\"Null\", fbxTypeFlags=\"Null\"):\n        # ob can be null\n        if not fbxName:\n            fbxName = my_null.fbxName\n\n        fw('\\n\\tModel: \"Model::%s\", \"%s\" {' % (fbxName, fbxType))\n        fw('\\n\\t\\tVersion: 232')\n\n        if my_null:\n            poseMatrix = write_object_props(my_null.blenObject, None, my_null.parRelMatrix())[3]\n        else:\n            poseMatrix = write_object_props()[3]\n\n        pose_items.append((fbxName, poseMatrix))\n\n        fw('\\n\\t\\t}'\n           '\\n\\t\\tMultiLayer: 0'\n           '\\n\\t\\tMultiTake: 1'\n           '\\n\\t\\tShading: Y'\n           '\\n\\t\\tCulling: \"CullingOff\"'\n           )\n\n        fw('\\n\\t\\tTypeFlags: \"%s\"' % fbxTypeFlags)\n        fw('\\n\\t}')\n\n    # Material Settings\n    if world:\n        world_amb = world.ambient_color[:]\n    else:\n        world_amb = 0.0, 0.0, 0.0  # default value\n\n    def write_material(matname, mat):\n        fw('\\n\\tMaterial: \"Material::%s\", \"\" {' % matname)\n\n        # Todo, add more material Properties.\n        if mat:\n            mat_cold = tuple(mat.diffuse_color)\n            mat_cols = tuple(mat.specular_color)\n            #mat_colm = tuple(mat.mirCol) # we wont use the mirror color\n            mat_colamb = 1.0, 1.0, 1.0\n\n            mat_dif = mat.diffuse_intensity\n            mat_amb = mat.ambient\n            mat_hard = ((float(mat.specular_hardness) - 1.0) / 510.0) * 128.0\n            mat_spec = mat.specular_intensity\n            mat_alpha = mat.alpha\n            mat_emit = mat.emit\n            mat_shadeless = mat.use_shadeless\n            if mat_shadeless:\n                mat_shader = 'Lambert'\n            else:\n                if mat.diffuse_shader == 'LAMBERT':\n                    mat_shader = 'Lambert'\n                else:\n                    mat_shader = 'Phong'\n        else:\n            mat_cold = 0.8, 0.8, 0.8\n            mat_cols = 1.0, 1.0, 1.0\n            mat_colamb = 1.0, 1.0, 1.0\n            # mat_colm\n            mat_dif = 0.8\n            mat_amb = 1.0\n            mat_hard = 12.3\n            mat_spec = 0.5\n            mat_alpha = 1.0\n            mat_emit = 0.0\n            mat_shadeless = False\n            mat_shader = 'Phong'\n\n        fw('\\n\\t\\tVersion: 102')\n        fw('\\n\\t\\tShadingModel: \"%s\"' % mat_shader.lower())\n        fw('\\n\\t\\tMultiLayer: 0')\n\n        fw('\\n\\t\\tProperties60:  {')\n        fw('\\n\\t\\t\\tProperty: \"ShadingModel\", \"KString\", \"\", \"%s\"' % mat_shader)\n        fw('\\n\\t\\t\\tProperty: \"MultiLayer\", \"bool\", \"\",0')\n        fw('\\n\\t\\t\\tProperty: \"EmissiveColor\", \"ColorRGB\", \"\",%.4f,%.4f,%.4f' % mat_cold)  # emit and diffuse color are he same in blender\n        fw('\\n\\t\\t\\tProperty: \"EmissiveFactor\", \"double\", \"\",%.4f' % mat_emit)\n\n        fw('\\n\\t\\t\\tProperty: \"AmbientColor\", \"ColorRGB\", \"\",%.4f,%.4f,%.4f' % mat_colamb)\n        fw('\\n\\t\\t\\tProperty: \"AmbientFactor\", \"double\", \"\",%.4f' % mat_amb)\n        fw('\\n\\t\\t\\tProperty: \"DiffuseColor\", \"ColorRGB\", \"\",%.4f,%.4f,%.4f' % mat_cold)\n        fw('\\n\\t\\t\\tProperty: \"DiffuseFactor\", \"double\", \"\",%.4f' % mat_dif)\n        fw('\\n\\t\\t\\tProperty: \"Bump\", \"Vector3D\", \"\",0,0,0')\n        fw('\\n\\t\\t\\tProperty: \"TransparentColor\", \"ColorRGB\", \"\",1,1,1')\n        fw('\\n\\t\\t\\tProperty: \"TransparencyFactor\", \"double\", \"\",%.4f' % (1.0 - mat_alpha))\n        if not mat_shadeless:\n            fw('\\n\\t\\t\\tProperty: \"SpecularColor\", \"ColorRGB\", \"\",%.4f,%.4f,%.4f' % mat_cols)\n            fw('\\n\\t\\t\\tProperty: \"SpecularFactor\", \"double\", \"\",%.4f' % mat_spec)\n            fw('\\n\\t\\t\\tProperty: \"ShininessExponent\", \"double\", \"\",%.1f' % mat_hard)\n            fw('\\n\\t\\t\\tProperty: \"ReflectionColor\", \"ColorRGB\", \"\",0,0,0')\n            fw('\\n\\t\\t\\tProperty: \"ReflectionFactor\", \"double\", \"\",1')\n        fw('\\n\\t\\t\\tProperty: \"Emissive\", \"ColorRGB\", \"\",0,0,0')\n        fw('\\n\\t\\t\\tProperty: \"Ambient\", \"ColorRGB\", \"\",%.1f,%.1f,%.1f' % mat_colamb)\n        fw('\\n\\t\\t\\tProperty: \"Diffuse\", \"ColorRGB\", \"\",%.1f,%.1f,%.1f' % mat_cold)\n        if not mat_shadeless:\n            fw('\\n\\t\\t\\tProperty: \"Specular\", \"ColorRGB\", \"\",%.1f,%.1f,%.1f' % mat_cols)\n            fw('\\n\\t\\t\\tProperty: \"Shininess\", \"double\", \"\",%.1f' % mat_hard)\n        fw('\\n\\t\\t\\tProperty: \"Opacity\", \"double\", \"\",%.1f' % mat_alpha)\n        if not mat_shadeless:\n            fw('\\n\\t\\t\\tProperty: \"Reflectivity\", \"double\", \"\",0')\n\n        fw('\\n\\t\\t}')\n        fw('\\n\\t}')\n\n    # tex is an Image (Arystan)\n    def write_video(texname, tex):\n        # Same as texture really!\n        fw('\\n\\tVideo: \"Video::%s\", \"Clip\" {' % texname)\n\n        fw('''\n\t\tType: \"Clip\"\n\t\tProperties60:  {\n\t\t\tProperty: \"FrameRate\", \"double\", \"\",0\n\t\t\tProperty: \"LastFrame\", \"int\", \"\",0\n\t\t\tProperty: \"Width\", \"int\", \"\",0\n\t\t\tProperty: \"Height\", \"int\", \"\",0''')\n        if tex:\n            fname_rel = bpy_extras.io_utils.path_reference(tex.filepath, base_src, base_dst, path_mode, \"\", copy_set, tex.library)\n            fname_strip = bpy.path.basename(fname_rel)\n        else:\n            fname_strip = fname_rel = \"\"\n\n        fw('\\n\\t\\t\\tProperty: \"Path\", \"charptr\", \"\", \"%s\"' % fname_strip)\n\n        fw('''\n\t\t\tProperty: \"StartFrame\", \"int\", \"\",0\n\t\t\tProperty: \"StopFrame\", \"int\", \"\",0\n\t\t\tProperty: \"PlaySpeed\", \"double\", \"\",1\n\t\t\tProperty: \"Offset\", \"KTime\", \"\",0\n\t\t\tProperty: \"InterlaceMode\", \"enum\", \"\",0\n\t\t\tProperty: \"FreeRunning\", \"bool\", \"\",0\n\t\t\tProperty: \"Loop\", \"bool\", \"\",0\n\t\t\tProperty: \"AccessMode\", \"enum\", \"\",0\n\t\t}\n\t\tUseMipMap: 0''')\n\n        fw('\\n\\t\\tFilename: \"%s\"' % fname_strip)\n        fw('\\n\\t\\tRelativeFilename: \"%s\"' % fname_rel)  # make relative\n        fw('\\n\\t}')\n\n    def write_texture(texname, tex, num):\n        # if tex is None then this is a dummy tex\n        fw('\\n\\tTexture: \"Texture::%s\", \"TextureVideoClip\" {' % texname)\n        fw('\\n\\t\\tType: \"TextureVideoClip\"')\n        fw('\\n\\t\\tVersion: 202')\n        # TODO, rare case _empty_ exists as a name.\n        fw('\\n\\t\\tTextureName: \"Texture::%s\"' % texname)\n\n        fw('''\n\t\tProperties60:  {\n\t\t\tProperty: \"Translation\", \"Vector\", \"A+\",0,0,0\n\t\t\tProperty: \"Rotation\", \"Vector\", \"A+\",0,0,0\n\t\t\tProperty: \"Scaling\", \"Vector\", \"A+\",1,1,1''')\n        fw('\\n\\t\\t\\tProperty: \"Texture alpha\", \"Number\", \"A+\",%i' % num)\n\n        # WrapModeU/V 0==rep, 1==clamp, TODO add support\n        fw('''\n\t\t\tProperty: \"TextureTypeUse\", \"enum\", \"\",0\n\t\t\tProperty: \"CurrentTextureBlendMode\", \"enum\", \"\",1\n\t\t\tProperty: \"UseMaterial\", \"bool\", \"\",0\n\t\t\tProperty: \"UseMipMap\", \"bool\", \"\",0\n\t\t\tProperty: \"CurrentMappingType\", \"enum\", \"\",0\n\t\t\tProperty: \"UVSwap\", \"bool\", \"\",0''')\n\n        fw('\\n\\t\\t\\tProperty: \"WrapModeU\", \"enum\", \"\",%i' % tex.use_clamp_x)\n        fw('\\n\\t\\t\\tProperty: \"WrapModeV\", \"enum\", \"\",%i' % tex.use_clamp_y)\n\n        fw('''\n\t\t\tProperty: \"TextureRotationPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"TextureScalingPivot\", \"Vector3D\", \"\",0,0,0\n\t\t\tProperty: \"VideoProperty\", \"object\", \"\"\n\t\t}''')\n\n        fw('\\n\\t\\tMedia: \"Video::%s\"' % texname)\n\n        if tex:\n            fname_rel = bpy_extras.io_utils.path_reference(tex.filepath, base_src, base_dst, path_mode, \"\", copy_set, tex.library)\n            fname_strip = bpy.path.basename(fname_rel)\n        else:\n            fname_strip = fname_rel = \"\"\n\n        fw('\\n\\t\\tFileName: \"%s\"' % fname_strip)\n        fw('\\n\\t\\tRelativeFilename: \"%s\"' % fname_rel)  # need some make relative command\n\n        fw('''\n\t\tModelUVTranslation: 0,0\n\t\tModelUVScaling: 1,1\n\t\tTexture_Alpha_Source: \"None\"\n\t\tCropping: 0,0,0,0\n\t}''')\n\n    def write_deformer_skin(obname):\n        \"\"\"\n        Each mesh has its own deformer\n        \"\"\"\n        fw('\\n\\tDeformer: \"Deformer::Skin %s\", \"Skin\" {' % obname)\n        fw('''\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Skin\"\n\t\tProperties60:  {\n\t\t}\n\t\tLink_DeformAcuracy: 50\n\t}''')\n\n    # in the example was 'Bip01 L Thigh_2'\n    def write_sub_deformer_skin(my_mesh, my_bone, weights):\n\n        \"\"\"\n        Each subdeformer is specific to a mesh, but the bone it links to can be used by many sub-deformers\n        So the SubDeformer needs the mesh-object name as a prefix to make it unique\n\n        Its possible that there is no matching vgroup in this mesh, in that case no verts are in the subdeformer,\n        a but silly but dosnt really matter\n        \"\"\"\n        fw('\\n\\tDeformer: \"SubDeformer::Cluster %s %s\", \"Cluster\" {' % (my_mesh.fbxName, my_bone.fbxName))\n\n        fw('''\n\t\tVersion: 100\n\t\tMultiLayer: 0\n\t\tType: \"Cluster\"\n\t\tProperties60:  {\n\t\t\tProperty: \"SrcModel\", \"object\", \"\"\n\t\t\tProperty: \"SrcModelReference\", \"object\", \"\"\n\t\t}\n\t\tUserData: \"\", \"\"''')\n\n        # Support for bone parents\n        if my_mesh.fbxBoneParent:\n            if my_mesh.fbxBoneParent == my_bone:\n                # TODO - this is a bit lazy, we could have a simple write loop\n                # for this case because all weights are 1.0 but for now this is ok\n                # Parent Bones arent used all that much anyway.\n                vgroup_data = [(j, 1.0) for j in range(len(my_mesh.blenData.vertices))]\n            else:\n                # This bone is not a parent of this mesh object, no weights\n                vgroup_data = []\n\n        else:\n            # Normal weight painted mesh\n            if my_bone.blenName in weights[0]:\n                # Before we used normalized weight list\n                group_index = weights[0].index(my_bone.blenName)\n                vgroup_data = [(j, weight[group_index]) for j, weight in enumerate(weights[1]) if weight[group_index]]\n            else:\n                vgroup_data = []\n\n        fw('\\n\\t\\tIndexes: ')\n\n        i = -1\n        for vg in vgroup_data:\n            if i == -1:\n                fw('%i' % vg[0])\n                i = 0\n            else:\n                if i == 23:\n                    fw('\\n\\t\\t')\n                    i = 0\n                fw(',%i' % vg[0])\n            i += 1\n\n        fw('\\n\\t\\tWeights: ')\n        i = -1\n        for vg in vgroup_data:\n            if i == -1:\n                fw('%.8f' % vg[1])\n                i = 0\n            else:\n                if i == 38:\n                    fw('\\n\\t\\t')\n                    i = 0\n                fw(',%.8f' % vg[1])\n            i += 1\n\n        # Set TransformLink to the global transform of the bone and Transform\n        # equal to the mesh's transform in bone space.\n        # http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/why-the-values-return-by-fbxcluster-gettransformmatrix-x-not-same-with-the-value-in-ascii-fbx-file/\n\n        global_bone_matrix = (my_bone.fbxArm.matrixWorld * my_bone.restMatrix) * mtx4_z90\n        global_mesh_matrix = my_mesh.matrixWorld\n        transform_matrix = (global_bone_matrix.inverted() * global_mesh_matrix)\n\n        global_bone_matrix_string = mat4x4str(global_bone_matrix )\n        transform_matrix_string = mat4x4str(transform_matrix )\n\n        fw('\\n\\t\\tTransform: %s' % transform_matrix_string)\n        fw('\\n\\t\\tTransformLink: %s' % global_bone_matrix_string)\n        fw('\\n\\t}')\n\n    def write_mesh(my_mesh):\n        me = my_mesh.blenData\n\n        # if there are non None materials on this mesh\n        do_materials = bool([m for m in my_mesh.blenMaterials if m is not None])\n        do_textures = bool([t for t in my_mesh.blenTextures if t is not None])\n        do_uvs = bool(me.uv_layers)\n        do_shapekeys = (my_mesh.blenObject.type == 'MESH' and\n                        my_mesh.blenObject.data.shape_keys and\n                        len(my_mesh.blenObject.data.vertices) == len(me.vertices))\n        # print(len(my_mesh.blenObject.data.vertices), len(me.vertices))  # XXX does not work when org obj is no mesh!\n\n        fw('\\n\\tModel: \"Model::%s\", \"Mesh\" {' % my_mesh.fbxName)\n        fw('\\n\\t\\tVersion: 232')  # newline is added in write_object_props\n\n        # convert into lists once.\n\n        poseMatrix = write_object_props(my_mesh.blenObject, None, my_mesh.parRelMatrix())[3]\n\n        # Calculate the global transform for the mesh in the bind pose the same way we do\n        # in write_sub_deformer_skin\n        globalMeshBindPose = my_mesh.matrixWorld * mtx4_z90\n        pose_items.append((my_mesh.fbxName, globalMeshBindPose))\n\n        if do_shapekeys:\n            for kb in my_mesh.blenObject.data.shape_keys.key_blocks[1:]:\n                fw('\\n\\t\\t\\tProperty: \"%s\", \"Number\", \"AN\",0' % kb.name)\n\n        fw('\\n\\t\\t}')\n\n        fw('\\n\\t\\tMultiLayer: 0'\n           '\\n\\t\\tMultiTake: 1'\n           '\\n\\t\\tShading: Y'\n           '\\n\\t\\tCulling: \"CullingOff\"'\n           )\n\n\n\n\n\n\n        # Write the Real Mesh data here\n        fw('\\n\\t\\tVertices: ')\n        _nchunk = 12  # Number of coordinates per line.\n        t_co = [None] * len(me.vertices) * 3\n        me.vertices.foreach_get(\"co\", t_co)\n        fw(',\\n\\t\\t          '.join(','.join('%.6f' % co for co in chunk) for chunk in grouper_exact(t_co, _nchunk)))\n        del t_co\n\n        fw('\\n\\t\\tPolygonVertexIndex: ')\n        _nchunk = 32  # Number of indices per line.\n        # A bit more complicated, as we have to ^-1 last index of each loop.\n        # NOTE: Here we assume that loops order matches polygons order!\n        t_vi = [None] * len(me.loops)\n        me.loops.foreach_get(\"vertex_index\", t_vi)\n        t_ls = [None] * len(me.polygons)\n        me.polygons.foreach_get(\"loop_start\", t_ls)\n        if t_ls != sorted(t_ls):\n            print(\"Error: polygons and loops orders do not match!\")\n        for ls in t_ls:\n            t_vi[ls - 1] ^= -1\n        prep = ',\\n\\t\\t                    '\n        fw(prep.join(','.join('%i' % vi for vi in chunk) for chunk in grouper_exact(t_vi, _nchunk)))\n        del t_vi\n        del t_ls\n\n        if use_mesh_edges:\n            t_vi = [None] * len(me.edges) * 2\n            me.edges.foreach_get(\"vertices\", t_vi)\n\n            # write loose edges as faces.\n            t_el = [None] * len(me.edges)\n            me.edges.foreach_get(\"is_loose\", t_el)\n            num_lose = sum(t_el)\n            if num_lose != 0:\n                it_el = ((vi ^ -1) if (idx % 2) else vi for idx, vi in enumerate(t_vi) if t_el[idx // 2])\n                if (len(me.loops)):\n                    fw(prep)\n                fw(prep.join(','.join('%i' % vi for vi in chunk) for chunk in grouper_exact(it_el, _nchunk)))\n\n            fw('\\n\\t\\tEdges: ')\n            fw(',\\n\\t\\t       '.join(','.join('%i' % vi for vi in chunk) for chunk in grouper_exact(t_vi, _nchunk)))\n            del t_vi\n            del t_el\n\n        fw('\\n\\t\\tGeometryVersion: 124')\n\n        _nchunk = 12  # Number of coordinates per line.\n        t_vn = [None] * len(me.loops) * 3\n        me.calc_normals_split()\n        # NOTE: Here we assume that loops order matches polygons order!\n        me.loops.foreach_get(\"normal\", t_vn)\n        fw('\\n\\t\\tLayerElementNormal: 0 {'\n           '\\n\\t\\t\\tVersion: 101'\n           '\\n\\t\\t\\tName: \"\"'\n           '\\n\\t\\t\\tMappingInformationType: \"ByPolygonVertex\"'\n           '\\n\\t\\t\\tReferenceInformationType: \"Direct\"'  # We could save some space with IndexToDirect here too...\n           '\\n\\t\\t\\tNormals: ')\n        fw(',\\n\\t\\t\\t         '.join(','.join('%.6f' % n for n in chunk) for chunk in grouper_exact(t_vn, _nchunk)))\n        fw('\\n\\t\\t}')\n        del t_vn\n        me.free_normals_split()\n\n        # Write Face Smoothing\n        _nchunk = 64  # Number of bool per line.\n        if mesh_smooth_type == 'FACE':\n            t_ps = [None] * len(me.polygons)\n            me.polygons.foreach_get(\"use_smooth\", t_ps)\n            fw('\\n\\t\\tLayerElementSmoothing: 0 {'\n               '\\n\\t\\t\\tVersion: 102'\n               '\\n\\t\\t\\tName: \"\"'\n               '\\n\\t\\t\\tMappingInformationType: \"ByPolygon\"'\n               '\\n\\t\\t\\tReferenceInformationType: \"Direct\"'\n               '\\n\\t\\t\\tSmoothing: ')\n            fw(',\\n\\t\\t\\t           '.join(','.join('%d' % b for b in chunk) for chunk in grouper_exact(t_ps, _nchunk)))\n            fw('\\n\\t\\t}')\n            del t_ps\n        elif mesh_smooth_type == 'EDGE':\n            # Write Edge Smoothing\n            t_es = [None] * len(me.edges)\n            me.edges.foreach_get(\"use_edge_sharp\", t_es)\n            fw('\\n\\t\\tLayerElementSmoothing: 0 {'\n               '\\n\\t\\t\\tVersion: 101'\n               '\\n\\t\\t\\tName: \"\"'\n               '\\n\\t\\t\\tMappingInformationType: \"ByEdge\"'\n               '\\n\\t\\t\\tReferenceInformationType: \"Direct\"'\n               '\\n\\t\\t\\tSmoothing: ')\n            fw(',\\n\\t\\t\\t           '\n               ''.join(','.join('%d' % (not b) for b in chunk) for chunk in grouper_exact(t_es, _nchunk)))\n            fw('\\n\\t\\t}')\n            del t_es\n        elif mesh_smooth_type == 'OFF':\n            pass\n        else:\n            raise Exception(\"invalid mesh_smooth_type: %r\" % mesh_smooth_type)\n\n        # Write VertexColor Layers\n        # note, no programs seem to use this info :/\n        collayers = []\n        if len(me.vertex_colors):\n            collayers = me.vertex_colors\n            t_lc = [None] * len(me.loops) * 3\n            col2idx = None\n            _nchunk = 4  # Number of colors per line\n            _nchunk_idx = 64  # Number of color indices per line\n            for colindex, collayer in enumerate(collayers):\n                collayer.data.foreach_get(\"color\", t_lc)\n                lc = tuple(zip(*[iter(t_lc)] * 3))\n                fw('\\n\\t\\tLayerElementColor: %i {'\n                   '\\n\\t\\t\\tVersion: 101'\n                   '\\n\\t\\t\\tName: \"%s\"'\n                   '\\n\\t\\t\\tMappingInformationType: \"ByPolygonVertex\"'\n                   '\\n\\t\\t\\tReferenceInformationType: \"IndexToDirect\"'\n                   '\\n\\t\\t\\tColors: ' % (colindex, collayer.name))\n\n                col2idx = tuple(set(lc))\n                fw(',\\n\\t\\t\\t        '.join(','.join('%.6f,%.6f,%.6f,1' % c for c in chunk)\n                                            for chunk in grouper_exact(col2idx, _nchunk)))\n\n                fw('\\n\\t\\t\\tColorIndex: ')\n                col2idx = {col: idx for idx, col in enumerate(col2idx)}\n                fw(',\\n\\t\\t\\t            '\n                   ''.join(','.join('%d' % col2idx[c] for c in chunk) for chunk in grouper_exact(lc, _nchunk_idx)))\n                fw('\\n\\t\\t}')\n            del t_lc\n\n        # Write UV and texture layers.\n        uvlayers = []\n        uvtextures = []\n        if do_uvs:\n            uvlayers = me.uv_layers\n            uvtextures = me.uv_textures\n            t_uv = [None] * len(me.loops) * 2\n            t_pi = None\n            uv2idx = None\n            tex2idx = None\n            _nchunk = 6  # Number of UVs per line\n            _nchunk_idx = 64  # Number of UV indices per line\n            if do_textures:\n                is_tex_unique = len(my_mesh.blenTextures) == 1\n                tex2idx = {None: -1}\n                tex2idx.update({tex: i for i, tex in enumerate(my_mesh.blenTextures)})\n\n            for uvindex, (uvlayer, uvtexture) in enumerate(zip(uvlayers, uvtextures)):\n                uvlayer.data.foreach_get(\"uv\", t_uv)\n                uvco = tuple(zip(*[iter(t_uv)] * 2))\n                fw('\\n\\t\\tLayerElementUV: %d {'\n                   '\\n\\t\\t\\tVersion: 101'\n                   '\\n\\t\\t\\tName: \"%s\"'\n                   '\\n\\t\\t\\tMappingInformationType: \"ByPolygonVertex\"'\n                   '\\n\\t\\t\\tReferenceInformationType: \"IndexToDirect\"'\n                   '\\n\\t\\t\\tUV: ' % (uvindex, uvlayer.name))\n                uv2idx = tuple(set(uvco))\n                fw(',\\n\\t\\t\\t    '\n                   ''.join(','.join('%.6f,%.6f' % uv for uv in chunk) for chunk in grouper_exact(uv2idx, _nchunk)))\n                fw('\\n\\t\\t\\tUVIndex: ')\n                uv2idx = {uv: idx for idx, uv in enumerate(uv2idx)}\n                fw(',\\n\\t\\t\\t         '\n                   ''.join(','.join('%d' % uv2idx[uv] for uv in chunk) for chunk in grouper_exact(uvco, _nchunk_idx)))\n                fw('\\n\\t\\t}')\n\n                if do_textures:\n                    fw('\\n\\t\\tLayerElementTexture: %d {'\n                       '\\n\\t\\t\\tVersion: 101'\n                       '\\n\\t\\t\\tName: \"%s\"' \n                       '\\n\\t\\t\\tMappingInformationType: \"%s\"'\n                       '\\n\\t\\t\\tReferenceInformationType: \"IndexToDirect\"'\n                       '\\n\\t\\t\\tBlendMode: \"Translucent\"'\n                       '\\n\\t\\t\\tTextureAlpha: 1'\n                       '\\n\\t\\t\\tTextureId: '\n                       % (uvindex, uvlayer.name, ('AllSame' if is_tex_unique else 'ByPolygon')))\n                    if is_tex_unique:\n                        fw('0')\n                    else:\n                        t_pi = (d.image for d in uvtexture.data)  # Can't use foreach_get here :(\n                        fw(',\\n\\t\\t\\t           '.join(','.join('%d' % tex2idx[i] for i in chunk)\n                                                       for chunk in grouper_exact(t_pi, _nchunk_idx)))\n                    fw('\\n\\t\\t}')\n            if not do_textures:\n                fw('\\n\\t\\tLayerElementTexture: 0 {'\n                   '\\n\\t\\t\\tVersion: 101'\n                   '\\n\\t\\t\\tName: \"\"'\n                   '\\n\\t\\t\\tMappingInformationType: \"NoMappingInformation\"'\n                   '\\n\\t\\t\\tReferenceInformationType: \"IndexToDirect\"'\n                   '\\n\\t\\t\\tBlendMode: \"Translucent\"'\n                   '\\n\\t\\t\\tTextureAlpha: 1'\n                   '\\n\\t\\t\\tTextureId: '\n                   '\\n\\t\\t}')\n            del t_uv\n            del t_pi\n\n        # Done with UV/textures.\n        if do_materials:\n            is_mat_unique = len(my_mesh.blenMaterials) == 1\n            fw('\\n\\t\\tLayerElementMaterial: 0 {'\n               '\\n\\t\\t\\tVersion: 101'\n               '\\n\\t\\t\\tName: \"\"'\n               '\\n\\t\\t\\tMappingInformationType: \"%s\"'\n               '\\n\\t\\t\\tReferenceInformationType: \"IndexToDirect\"'\n               '\\n\\t\\t\\tMaterials: ' % ('AllSame' if is_mat_unique else 'ByPolygon',))\n            if is_mat_unique:\n                fw('0')\n            else:\n                _nchunk = 64  # Number of material indices per line\n                # Build a material mapping for this\n                mat2idx = {mt: i for i, mt in enumerate(my_mesh.blenMaterials)}  # (local-mat, tex) -> global index.\n                mats = my_mesh.blenMaterialList\n                if me.uv_textures.active and do_uvs:\n                    poly_tex = me.uv_textures.active.data\n                else:\n                    poly_tex = [None] * len(me.polygons)\n                _it_mat = (mats[p.material_index] for p in me.polygons)\n                _it_tex = (pt.image if pt else None for pt in poly_tex)  # WARNING - MULTI UV LAYER IMAGES NOT SUPPORTED\n                t_mti = (mat2idx[m, t] for m, t in zip(_it_mat, _it_tex))\n                fw(',\\n\\t\\t\\t           '\n                   ''.join(','.join('%d' % i for i in chunk) for chunk in grouper_exact(t_mti, _nchunk)))\n            fw('\\n\\t\\t}')\n\n        fw('\\n\\t\\tLayer: 0 {'\n           '\\n\\t\\t\\tVersion: 100'\n           '\\n\\t\\t\\tLayerElement:  {'\n           '\\n\\t\\t\\t\\tType: \"LayerElementNormal\"'\n           '\\n\\t\\t\\t\\tTypedIndex: 0'\n           '\\n\\t\\t\\t}')\n\n        # Smoothing info\n        if mesh_smooth_type != 'OFF':\n            fw('\\n\\t\\t\\tLayerElement:  {'\n               '\\n\\t\\t\\t\\tType: \"LayerElementSmoothing\"'\n               '\\n\\t\\t\\t\\tTypedIndex: 0'\n               '\\n\\t\\t\\t}')\n\n        if me.vertex_colors:\n            fw('\\n\\t\\t\\tLayerElement:  {'\n               '\\n\\t\\t\\t\\tType: \"LayerElementColor\"'\n               '\\n\\t\\t\\t\\tTypedIndex: 0'\n               '\\n\\t\\t\\t}')\n\n        if do_uvs:  # same as me.faceUV\n            fw('\\n\\t\\t\\tLayerElement:  {'\n               '\\n\\t\\t\\t\\tType: \"LayerElementUV\"'\n               '\\n\\t\\t\\t\\tTypedIndex: 0'\n               '\\n\\t\\t\\t}')\n\n        # Always write this\n        #if do_textures:\n        if True:\n            fw('\\n\\t\\t\\tLayerElement:  {'\n               '\\n\\t\\t\\t\\tType: \"LayerElementTexture\"'\n               '\\n\\t\\t\\t\\tTypedIndex: 0'\n               '\\n\\t\\t\\t}')\n\n        if do_materials:\n            fw('\\n\\t\\t\\tLayerElement:  {'\n               '\\n\\t\\t\\t\\tType: \"LayerElementMaterial\"'\n               '\\n\\t\\t\\t\\tTypedIndex: 0'\n               '\\n\\t\\t\\t}')\n\n        fw('\\n\\t\\t}')\n\n        if len(uvlayers) > 1:\n            for i in range(1, len(uvlayers)):\n                fw('\\n\\t\\tLayer: %d {'\n                   '\\n\\t\\t\\tVersion: 100'\n                   '\\n\\t\\t\\tLayerElement:  {'\n                   '\\n\\t\\t\\t\\tType: \"LayerElementUV\"'\n                   '\\n\\t\\t\\t\\tTypedIndex: %d'\n                   '\\n\\t\\t\\t}' % (i, i))\n                if do_textures:\n                    fw('\\n\\t\\t\\tLayerElement:  {'\n                       '\\n\\t\\t\\t\\tType: \"LayerElementTexture\"'\n                       '\\n\\t\\t\\t\\tTypedIndex: %d'\n                       '\\n\\t\\t\\t}' % i)\n                else:\n                    fw('\\n\\t\\t\\tLayerElement:  {'\n                       '\\n\\t\\t\\t\\tType: \"LayerElementTexture\"'\n                       '\\n\\t\\t\\t\\tTypedIndex: 0'\n                       '\\n\\t\\t\\t}')\n                fw('\\n\\t\\t}')\n\n        # XXX Col layers are written before UV ones above, why adding them after UV here???\n        #     And why this offset based on len(UV layers) - 1???\n        #     I have the feeling some indices are wrong here!\n        #     --mont29\n        if len(collayers) > 1:\n            # Take into account any UV layers\n            layer_offset = len(uvlayers) - 1 if uvlayers else 0\n            for i in range(layer_offset, len(collayers) + layer_offset):\n                fw('\\n\\t\\tLayer: %d {'\n                   '\\n\\t\\t\\tVersion: 100'\n                   '\\n\\t\\t\\tLayerElement:  {'\n                   '\\n\\t\\t\\t\\tType: \"LayerElementColor\"'\n                   '\\n\\t\\t\\t\\tTypedIndex: %d'\n                   '\\n\\t\\t\\t}'\n                   '\\n\\t\\t}' % (i, i))\n\n        if do_shapekeys:\n            # Not sure this works really good...\n            #     Aren't key's co already relative if set as such?\n            #     Also, does not handle custom relative option for each key...\n            # --mont29\n            import operator\n            key_blocks = my_mesh.blenObject.data.shape_keys.key_blocks[:]\n            t_sk_basis = [None] * len(me.vertices) * 3\n            t_sk = [None] * len(me.vertices) * 3\n            key_blocks[0].data.foreach_get(\"co\", t_sk_basis)\n            _nchunk = 4  # Number of delta coordinates per line\n            _nchunk_idx = 32  # Number of vert indices per line\n\n            for kb in key_blocks[1:]:\n                kb.data.foreach_get(\"co\", t_sk)\n                _dcos = tuple(zip(*[map(operator.sub, t_sk, t_sk_basis)] * 3))\n                verts = tuple(i for i, dco in enumerate(_dcos) if sum(map(operator.pow, dco, (2, 2, 2))) > 3e-12)\n                dcos = (_dcos[i] for i in verts)\n                fw('\\n\\t\\tShape: \"%s\" {'\n                   '\\n\\t\\t\\tIndexes: ' % kb.name)\n                fw(',\\n\\t\\t\\t         '\n                   ''.join(','.join('%d' % i for i in chunk) for chunk in grouper_exact(verts, _nchunk_idx)))\n\n                fw('\\n\\t\\t\\tVertices: ')\n                fw(',\\n\\t\\t\\t          '\n                   ''.join(','.join('%.6f,%.6f,%.6f' % c for c in chunk) for chunk in grouper_exact(dcos, _nchunk)))\n                # all zero, why? - campbell\n                # Would need to recompute them I guess... and I assume those are supposed to be delta as well?\n                fw('\\n\\t\\t\\tNormals: ')\n                fw(',\\n\\t\\t\\t         '\n                   ''.join(','.join('0,0,0' for c in chunk) for chunk in grouper_exact(range(len(verts)), _nchunk)))\n                fw('\\n\\t\\t}')\n            del t_sk_basis\n            del t_sk\n\n        fw('\\n\\t}')\n\n    def write_group(name):\n        fw('\\n\\tGroupSelection: \"GroupSelection::%s\", \"Default\" {' % name)\n\n        fw('''\n\t\tProperties60:  {\n\t\t\tProperty: \"MultiLayer\", \"bool\", \"\",0\n\t\t\tProperty: \"Pickable\", \"bool\", \"\",1\n\t\t\tProperty: \"Transformable\", \"bool\", \"\",1\n\t\t\tProperty: \"Show\", \"bool\", \"\",1\n\t\t}\n\t\tMultiLayer: 0\n\t}''')\n\n    # add meshes here to clear because they are not used anywhere.\n    meshes_to_clear = []\n\n    ob_meshes = []\n    ob_lights = []\n    ob_cameras = []\n    # in fbx we export bones as children of the mesh\n    # armatures not a part of a mesh, will be added to ob_arms\n    ob_bones = []\n    ob_arms = []\n    ob_null = []  # emptys\n\n    # List of types that have blender objects (not bones)\n    ob_all_typegroups = [ob_meshes, ob_lights, ob_cameras, ob_arms, ob_null]\n\n    groups = []  # blender groups, only add ones that have objects in the selections\n    materials = set()  # (mat, image) items\n    textures = set()\n\n    tmp_ob_type = None  # in case no objects are exported, so as not to raise an error\n\n## XXX\n\n    if 'ARMATURE' in object_types:\n        # This is needed so applying modifiers dosnt apply the armature deformation, its also needed\n        # ...so mesh objects return their rest worldspace matrix when bone-parents are exported as weighted meshes.\n        # set every armature to its rest, backup the original values so we done mess up the scene\n        ob_arms_orig_rest = [arm.pose_position for arm in bpy.data.armatures]\n\n        for arm in bpy.data.armatures:\n            arm.pose_position = 'REST'\n\n        if ob_arms_orig_rest:\n            for ob_base in bpy.data.objects:\n                if ob_base.type == 'ARMATURE':\n                    ob_base.update_tag()\n\n            # This causes the makeDisplayList command to effect the mesh\n            scene.frame_set(scene.frame_current)\n\n    for ob_base in context_objects:\n\n        # ignore dupli children\n        if ob_base.parent and ob_base.parent.dupli_type in {'VERTS', 'FACES'}:\n            continue\n\n        obs = [(ob_base, ob_base.matrix_world.copy())]\n        if ob_base.dupli_type != 'NONE':\n            ob_base.dupli_list_create(scene)\n            obs = [(dob.object, dob.matrix.copy()) for dob in ob_base.dupli_list]\n\n        for ob, mtx in obs:\n            tmp_ob_type = ob.type\n            if tmp_ob_type == 'CAMERA':\n                if 'CAMERA' in object_types:\n                    ob_cameras.append(my_object_generic(ob, mtx))\n            elif tmp_ob_type == 'LAMP':\n                if 'LAMP' in object_types:\n                    ob_lights.append(my_object_generic(ob, mtx))\n            elif tmp_ob_type == 'ARMATURE':\n                if 'ARMATURE' in object_types:\n                    # TODO - armatures dont work in dupligroups!\n                    if ob not in ob_arms:\n                        ob_arms.append(ob)\n                    # ob_arms.append(ob) # replace later. was \"ob_arms.append(sane_obname(ob), ob)\"\n            elif tmp_ob_type == 'EMPTY':\n                if 'EMPTY' in object_types:\n                    ob_null.append(my_object_generic(ob, mtx))\n            elif 'MESH' in object_types:\n                origData = True\n                if tmp_ob_type != 'MESH':\n                    try:\n                        me = ob.to_mesh(scene, True, 'PREVIEW')\n                    except:\n                        me = None\n\n                    if me:\n                        meshes_to_clear.append(me)\n                        mats = me.materials\n                        origData = False\n                else:\n                    # Mesh Type!\n                    if use_mesh_modifiers:\n                        me = ob.to_mesh(scene, True, 'PREVIEW')\n\n                        # print ob, me, me.getVertGroupNames()\n                        meshes_to_clear.append(me)\n                        origData = False\n                        mats = me.materials\n                    else:\n                        me = ob.data\n                        me.update()\n                        mats = me.materials\n\n# \t\t\t\t\t\t# Support object colors\n# \t\t\t\t\t\ttmp_colbits = ob.colbits\n# \t\t\t\t\t\tif tmp_colbits:\n# \t\t\t\t\t\t\ttmp_ob_mats = ob.getMaterials(1) # 1 so we get None's too.\n# \t\t\t\t\t\t\tfor i in xrange(16):\n# \t\t\t\t\t\t\t\tif tmp_colbits & (1<<i):\n# \t\t\t\t\t\t\t\t\tmats[i] = tmp_ob_mats[i]\n# \t\t\t\t\t\t\tdel tmp_ob_mats\n# \t\t\t\t\t\tdel tmp_colbits\n\n                if me:\n# \t\t\t\t\t# This WILL modify meshes in blender if use_mesh_modifiers is disabled.\n# \t\t\t\t\t# so strictly this is bad. but only in rare cases would it have negative results\n# \t\t\t\t\t# say with dupliverts the objects would rotate a bit differently\n# \t\t\t\t\tif EXP_MESH_HQ_NORMALS:\n# \t\t\t\t\t\tBPyMesh.meshCalcNormals(me) # high quality normals nice for realtime engines.\n\n                    if not mats:\n                        mats = [None]\n\n                    texture_set_local = set()\n                    material_set_local = set()\n                    if me.uv_textures:\n                        for uvlayer in me.uv_textures:\n                            for p, p_uv in zip(me.polygons, uvlayer.data):\n                                tex = p_uv.image\n                                texture_set_local.add(tex)\n                                mat = mats[p.material_index]\n\n                                # Should not be needed anymore.\n                                #try:\n                                    #mat = mats[p.material_index]\n                                #except:\n                                    #mat = None\n\n                                material_set_local.add((mat, tex))\n\n                    else:\n                        for mat in mats:\n                            # 2.44 use mat.lib too for uniqueness\n                            material_set_local.add((mat, None))\n\n                    textures |= texture_set_local\n                    materials |= material_set_local\n\n                    if 'ARMATURE' in object_types:\n                        armob = ob.find_armature()\n                        blenParentBoneName = None\n\n                        # parent bone - special case\n                        if (not armob) and ob.parent and ob.parent.type == 'ARMATURE' and \\\n                                ob.parent_type == 'BONE':\n                            armob = ob.parent\n                            blenParentBoneName = ob.parent_bone\n\n                        if armob and armob not in ob_arms:\n                            ob_arms.append(armob)\n\n                        # Warning for scaled, mesh objects with armatures\n                        if abs(ob.scale[0] - 1.0) > 0.05 or abs(ob.scale[1] - 1.0) > 0.05 or abs(ob.scale[1] - 1.0) > 0.05:\n                            operator.report({'WARNING'}, \"Object '%s' has a scale of (%.3f, %.3f, %.3f), \" \\\n                                                         \"Armature deformation will not work as expected \" \\\n                                                         \"(apply Scale to fix)\" % ((ob.name,) + tuple(ob.scale)))\n\n                    else:\n                        blenParentBoneName = armob = None\n\n                    my_mesh = my_object_generic(ob, mtx)\n                    my_mesh.blenData = me\n                    my_mesh.origData = origData\n                    my_mesh.blenMaterials = list(material_set_local)\n                    my_mesh.blenMaterialList = mats\n                    my_mesh.blenTextures = list(texture_set_local)\n\n                    # sort the name so we get predictable output, some items may be NULL\n                    my_mesh.blenMaterials.sort(key=lambda m: (getattr(m[0], \"name\", \"\"), getattr(m[1], \"name\", \"\")))\n                    my_mesh.blenTextures.sort(key=lambda m: getattr(m, \"name\", \"\"))\n\n                    # if only 1 null texture then empty the list\n                    if len(my_mesh.blenTextures) == 1 and my_mesh.blenTextures[0] is None:\n                        my_mesh.blenTextures = []\n\n                    my_mesh.fbxArm = armob  # replace with my_object_generic armature instance later\n                    my_mesh.fbxBoneParent = blenParentBoneName  # replace with my_bone instance later\n\n                    ob_meshes.append(my_mesh)\n\n        # not forgetting to free dupli_list\n        if ob_base.dupli_list:\n            ob_base.dupli_list_clear()\n\n    if 'ARMATURE' in object_types:\n        # now we have the meshes, restore the rest arm position\n        for i, arm in enumerate(bpy.data.armatures):\n            arm.pose_position = ob_arms_orig_rest[i]\n\n        if ob_arms_orig_rest:\n            for ob_base in bpy.data.objects:\n                if ob_base.type == 'ARMATURE':\n                    ob_base.update_tag()\n            # This causes the makeDisplayList command to effect the mesh\n            scene.frame_set(scene.frame_current)\n\n    del tmp_ob_type, context_objects\n\n    # now we have collected all armatures, add bones\n    for i, ob in enumerate(ob_arms):\n\n        ob_arms[i] = my_arm = my_object_generic(ob)\n\n        my_arm.fbxBones = []\n        my_arm.blenData = ob.data\n        if ob.animation_data:\n            my_arm.blenAction = ob.animation_data.action\n        else:\n            my_arm.blenAction = None\n        my_arm.blenActionList = []\n\n        # fbxName, blenderObject, my_bones, blenderActions\n        #ob_arms[i] = fbxArmObName, ob, arm_my_bones, (ob.action, [])\n\n        if use_armature_deform_only:\n            # tag non deforming bones that have no deforming children\n            deform_map = dict.fromkeys(my_arm.blenData.bones, False)\n            for bone in my_arm.blenData.bones:\n                if bone.use_deform:\n                    deform_map[bone] = True\n                    # tag all parents, even ones that are not deform since their child _is_\n                    for parent in bone.parent_recursive:\n                        deform_map[parent] = True\n\n        for bone in my_arm.blenData.bones:\n\n            if use_armature_deform_only:\n                # if this bone doesnt deform, and none of its children deform, skip it!\n                if not deform_map[bone]:\n                    continue\n\n            my_bone = my_bone_class(bone, my_arm)\n            my_arm.fbxBones.append(my_bone)\n            ob_bones.append(my_bone)\n\n        if use_armature_deform_only:\n            del deform_map\n\n    # add the meshes to the bones and replace the meshes armature with own armature class\n    #for obname, ob, mtx, me, mats, arm, armname in ob_meshes:\n    for my_mesh in ob_meshes:\n        # Replace\n        # ...this could be sped up with dictionary mapping but its unlikely for\n        # it ever to be a bottleneck - (would need 100+ meshes using armatures)\n        if my_mesh.fbxArm:\n            for my_arm in ob_arms:\n                if my_arm.blenObject == my_mesh.fbxArm:\n                    my_mesh.fbxArm = my_arm\n                    break\n\n        for my_bone in ob_bones:\n\n            # The mesh uses this bones armature!\n            if my_bone.fbxArm == my_mesh.fbxArm:\n                if my_bone.blenBone.use_deform:\n                    my_bone.blenMeshes[my_mesh.fbxName] = me\n\n                # parent bone: replace bone names with our class instances\n                # my_mesh.fbxBoneParent is None or a blender bone name initialy, replacing if the names match.\n                if my_mesh.fbxBoneParent == my_bone.blenName:\n                    my_mesh.fbxBoneParent = my_bone\n\n    bone_deformer_count = 0  # count how many bones deform a mesh\n    my_bone_blenParent = None\n    for my_bone in ob_bones:\n        my_bone_blenParent = my_bone.blenBone.parent\n        if my_bone_blenParent:\n            for my_bone_parent in ob_bones:\n                # Note 2.45rc2 you can compare bones normally\n                if my_bone_blenParent.name == my_bone_parent.blenName and my_bone.fbxArm == my_bone_parent.fbxArm:\n                    my_bone.parent = my_bone_parent\n                    break\n\n        # Not used at the moment\n        # my_bone.calcRestMatrixLocal()\n        bone_deformer_count += len(my_bone.blenMeshes)\n\n    del my_bone_blenParent\n\n    # Build blenObject -> fbxObject mapping\n    # this is needed for groups as well as fbxParenting\n    bpy.data.objects.tag(False)\n\n    # using a list of object names for tagging (Arystan)\n\n    tmp_obmapping = {}\n    for ob_generic in ob_all_typegroups:\n        for ob_base in ob_generic:\n            ob_base.blenObject.tag = True\n            tmp_obmapping[ob_base.blenObject] = ob_base\n\n    # Build Groups from objects we export\n    for blenGroup in bpy.data.groups:\n        fbxGroupName = None\n        for ob in blenGroup.objects:\n            if ob.tag:\n                if fbxGroupName is None:\n                    fbxGroupName = sane_groupname(blenGroup)\n                    groups.append((fbxGroupName, blenGroup))\n\n                tmp_obmapping[ob].fbxGroupNames.append(fbxGroupName)  # also adds to the objects fbxGroupNames\n\n    groups.sort()  # not really needed\n\n    # Assign parents using this mapping\n    for ob_generic in ob_all_typegroups:\n        for my_ob in ob_generic:\n            parent = my_ob.blenObject.parent\n            if parent and parent.tag:  # does it exist and is it in the mapping\n                my_ob.fbxParent = tmp_obmapping[parent]\n\n    del tmp_obmapping\n    # Finished finding groups we use\n\n    # == WRITE OBJECTS TO THE FILE ==\n    # == From now on we are building the FBX file from the information collected above (JCB)\n\n    materials = [(sane_matname(mat_tex_pair), mat_tex_pair) for mat_tex_pair in materials]\n    textures = [(sane_texname(tex), tex) for tex in textures if tex]\n    materials.sort(key=lambda m: m[0])  # sort by name\n    textures.sort(key=lambda m: m[0])\n\n    camera_count = 8 if 'CAMERA' in object_types else 0\n\n    # sanity checks\n    try:\n        assert(not (ob_meshes and ('MESH' not in object_types)))\n        assert(not (materials and ('MESH' not in object_types)))\n        assert(not (textures and ('MESH' not in object_types)))\n\n        assert(not (ob_lights and ('LAMP' not in object_types)))\n\n        assert(not (ob_cameras and ('CAMERA' not in object_types)))\n    except AssertionError:\n        import traceback\n        traceback.print_exc()\n\n    fw('''\n\n; Object definitions\n;------------------------------------------------------------------\n\nDefinitions:  {\n\tVersion: 100\n\tCount: %i''' % (\n        1 + camera_count +\n        len(ob_meshes) +\n        len(ob_lights) +\n        len(ob_cameras) +\n        len(ob_arms) +\n        len(ob_null) +\n        len(ob_bones) +\n        bone_deformer_count +\n        len(materials) +\n        (len(textures) * 2)))  # add 1 for global settings\n\n    del bone_deformer_count\n\n    fw('''\n\tObjectType: \"Model\" {\n\t\tCount: %i\n\t}''' % (\n        camera_count +\n        len(ob_meshes) +\n        len(ob_lights) +\n        len(ob_cameras) +\n        len(ob_arms) +\n        len(ob_null) +\n        len(ob_bones)))\n\n    fw('''\n\tObjectType: \"Geometry\" {\n\t\tCount: %i\n\t}''' % len(ob_meshes))\n\n    if materials:\n        fw('''\n\tObjectType: \"Material\" {\n\t\tCount: %i\n\t}''' % len(materials))\n\n    if textures:\n        fw('''\n\tObjectType: \"Texture\" {\n\t\tCount: %i\n\t}''' % len(textures))  # add 1 for an empty tex\n        fw('''\n\tObjectType: \"Video\" {\n\t\tCount: %i\n\t}''' % len(textures))  # add 1 for an empty tex\n\n    tmp = 0\n    # Add deformer nodes\n    for my_mesh in ob_meshes:\n        if my_mesh.fbxArm:\n            tmp += 1\n\n    # Add subdeformers\n    for my_bone in ob_bones:\n        tmp += len(my_bone.blenMeshes)\n\n    if tmp:\n        fw('''\n\tObjectType: \"Deformer\" {\n\t\tCount: %i\n\t}''' % tmp)\n    del tmp\n\n    # Bind pose is essential for XNA if the 'MESH' is included,\n    # but could be removed now?\n    fw('''\n\tObjectType: \"Pose\" {\n\t\tCount: 1\n\t}''')\n\n    if groups:\n        fw('''\n\tObjectType: \"GroupSelection\" {\n\t\tCount: %i\n\t}''' % len(groups))\n\n    fw('''\n\tObjectType: \"GlobalSettings\" {\n\t\tCount: 1\n\t}\n}''')\n\n    fw('''\n\n; Object properties\n;------------------------------------------------------------------\n\nObjects:  {''')\n\n    if 'CAMERA' in object_types:\n        # To comply with other FBX FILES\n        write_camera_switch()\n\n    for my_null in ob_null:\n        write_null(my_null)\n\n    # XNA requires the armature to be a Limb (JCB)\n    # Note, 2.58 and previous wrote these as normal empties and it worked mostly (except for XNA)\n    for my_arm in ob_arms:\n        write_null(my_arm, fbxType=\"Limb\", fbxTypeFlags=\"Skeleton\")\n\n    for my_cam in ob_cameras:\n        write_camera(my_cam)\n\n    for my_light in ob_lights:\n        write_light(my_light)\n\n    for my_mesh in ob_meshes:\n        write_mesh(my_mesh)\n\n    #for bonename, bone, obname, me, armob in ob_bones:\n    for my_bone in ob_bones:\n        write_bone(my_bone)\n\n    if 'CAMERA' in object_types:\n        write_camera_default()\n\n    for matname, (mat, tex) in materials:\n        write_material(matname, mat)  # We only need to have a material per image pair, but no need to write any image info into the material (dumb fbx standard)\n\n    # each texture uses a video, odd\n    for texname, tex in textures:\n        write_video(texname, tex)\n    i = 0\n    for texname, tex in textures:\n        write_texture(texname, tex, i)\n        i += 1\n\n    for groupname, group in groups:\n        write_group(groupname)\n\n    # NOTE - c4d and motionbuilder dont need normalized weights, but deep-exploration 5 does and (max?) do.\n\n    # Write armature modifiers\n    # TODO - add another MODEL? - because of this skin definition.\n    for my_mesh in ob_meshes:\n        if my_mesh.fbxArm:\n            write_deformer_skin(my_mesh.fbxName)\n\n            # Get normalized weights for temorary use\n            if my_mesh.fbxBoneParent:\n                weights = None\n            else:\n                weights = meshNormalizedWeights(my_mesh.blenObject, my_mesh.blenData)\n\n            #for bonename, bone, obname, bone_mesh, armob in ob_bones:\n            for my_bone in ob_bones:\n                if me in iter(my_bone.blenMeshes.values()):\n                    write_sub_deformer_skin(my_mesh, my_bone, weights)\n\n    # Write pose is really weird, only needed when an armature and mesh are used together\n    # each by themselves do not need pose data. For now only pose meshes and bones\n\n    # Bind pose is essential for XNA if the 'MESH' is included (JCB)\n    fw('''\n\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\n\t\tType: \"BindPose\"\n\t\tVersion: 100\n\t\tProperties60:  {\n\t\t}\n\t\tNbPoseNodes: ''')\n    fw(str(len(pose_items)))\n\n    for fbxName, matrix in pose_items:\n        fw('\\n\\t\\tPoseNode:  {')\n        fw('\\n\\t\\t\\tNode: \"Model::%s\"' % fbxName)\n        fw('\\n\\t\\t\\tMatrix: %s' % mat4x4str(matrix if matrix else Matrix()))\n        fw('\\n\\t\\t}')\n\n    fw('\\n\\t}')\n\n    # Finish Writing Objects\n    # Write global settings\n    fw('''\n\tGlobalSettings:  {\n\t\tVersion: 1000\n\t\tProperties60:  {\n\t\t\tProperty: \"UpAxis\", \"int\", \"\",1\n\t\t\tProperty: \"UpAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"FrontAxis\", \"int\", \"\",2\n\t\t\tProperty: \"FrontAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"CoordAxis\", \"int\", \"\",0\n\t\t\tProperty: \"CoordAxisSign\", \"int\", \"\",1\n\t\t\tProperty: \"UnitScaleFactor\", \"double\", \"\",1\n\t\t}\n\t}\n''')\n    fw('}')\n\n    fw('''\n\n; Object relations\n;------------------------------------------------------------------\n\nRelations:  {''')\n\n    # Nulls are likely to cause problems for XNA\n\n    for my_null in ob_null:\n        fw('\\n\\tModel: \"Model::%s\", \"Null\" {\\n\\t}' % my_null.fbxName)\n\n    # Armature must be a Limb for XNA\n    # Note, 2.58 and previous wrote these as normal empties and it worked mostly (except for XNA)\n    for my_arm in ob_arms:\n        fw('\\n\\tModel: \"Model::%s\", \"Limb\" {\\n\\t}' % my_arm.fbxName)\n\n    for my_mesh in ob_meshes:\n        fw('\\n\\tModel: \"Model::%s\", \"Mesh\" {\\n\\t}' % my_mesh.fbxName)\n\n    # TODO - limbs can have the same name for multiple armatures, should prefix.\n    #for bonename, bone, obname, me, armob in ob_bones:\n    for my_bone in ob_bones:\n        fw('\\n\\tModel: \"Model::%s\", \"Limb\" {\\n\\t}' % my_bone.fbxName)\n\n    for my_cam in ob_cameras:\n        fw('\\n\\tModel: \"Model::%s\", \"Camera\" {\\n\\t}' % my_cam.fbxName)\n\n    for my_light in ob_lights:\n        fw('\\n\\tModel: \"Model::%s\", \"Light\" {\\n\\t}' % my_light.fbxName)\n\n    fw('''\n\tModel: \"Model::Producer Perspective\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Top\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Bottom\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Front\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Back\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Right\", \"Camera\" {\n\t}\n\tModel: \"Model::Producer Left\", \"Camera\" {\n\t}\n\tModel: \"Model::Camera Switcher\", \"CameraSwitcher\" {\n\t}''')\n\n    for matname, (mat, tex) in materials:\n        fw('\\n\\tMaterial: \"Material::%s\", \"\" {\\n\\t}' % matname)\n\n    if textures:\n        for texname, tex in textures:\n            fw('\\n\\tTexture: \"Texture::%s\", \"TextureVideoClip\" {\\n\\t}' % texname)\n        for texname, tex in textures:\n            fw('\\n\\tVideo: \"Video::%s\", \"Clip\" {\\n\\t}' % texname)\n\n    # deformers - modifiers\n    for my_mesh in ob_meshes:\n        if my_mesh.fbxArm:\n            fw('\\n\\tDeformer: \"Deformer::Skin %s\", \"Skin\" {\\n\\t}' % my_mesh.fbxName)\n\n    #for bonename, bone, obname, me, armob in ob_bones:\n    for my_bone in ob_bones:\n        for fbxMeshObName in my_bone.blenMeshes:  # .keys() - fbxMeshObName\n            # is this bone effecting a mesh?\n            fw('\\n\\tDeformer: \"SubDeformer::Cluster %s %s\", \"Cluster\" {\\n\\t}' % (fbxMeshObName, my_bone.fbxName))\n\n    # This should be at the end\n    # fw('\\n\\tPose: \"Pose::BIND_POSES\", \"BindPose\" {\\n\\t}')\n\n    for groupname, group in groups:\n        fw('\\n\\tGroupSelection: \"GroupSelection::%s\", \"Default\" {\\n\\t}' % groupname)\n\n    fw('\\n}')\n    fw('''\n\n; Object connections\n;------------------------------------------------------------------\n\nConnections:  {''')\n\n    # NOTE - The FBX SDK does not care about the order but some importers DO!\n    # for instance, defining the material->mesh connection\n    # before the mesh->parent crashes cinema4d\n\n    for ob_generic in ob_all_typegroups:  # all blender 'Object's we support\n        for my_ob in ob_generic:\n            # for deformed meshes, don't have any parents or they can get twice transformed.\n            if my_ob.fbxParent and (not my_ob.fbxArm):\n                fw('\\n\\tConnect: \"OO\", \"Model::%s\", \"Model::%s\"' % (my_ob.fbxName, my_ob.fbxParent.fbxName))\n            else:\n                fw('\\n\\tConnect: \"OO\", \"Model::%s\", \"Model::Scene\"' % my_ob.fbxName)\n\n    if materials:\n        for my_mesh in ob_meshes:\n            # Connect all materials to all objects, not good form but ok for now.\n            for mat, tex in my_mesh.blenMaterials:\n                mat_name = mat.name if mat else None\n                tex_name = tex.name if tex else None\n\n                fw('\\n\\tConnect: \"OO\", \"Material::%s\", \"Model::%s\"' % (sane_name_mapping_mat[mat_name, tex_name], my_mesh.fbxName))\n\n    if textures:\n        for my_mesh in ob_meshes:\n            if my_mesh.blenTextures:\n                # fw('\\n\\tConnect: \"OO\", \"Texture::_empty_\", \"Model::%s\"' % my_mesh.fbxName)\n                for tex in my_mesh.blenTextures:\n                    if tex:\n                        fw('\\n\\tConnect: \"OO\", \"Texture::%s\", \"Model::%s\"' % (sane_name_mapping_tex[tex.name], my_mesh.fbxName))\n\n        for texname, tex in textures:\n            fw('\\n\\tConnect: \"OO\", \"Video::%s\", \"Texture::%s\"' % (texname, texname))\n\n    if 'MESH' in object_types:\n        for my_mesh in ob_meshes:\n            if my_mesh.fbxArm:\n                fw('\\n\\tConnect: \"OO\", \"Deformer::Skin %s\", \"Model::%s\"' % (my_mesh.fbxName, my_mesh.fbxName))\n\n        for my_bone in ob_bones:\n            for fbxMeshObName in my_bone.blenMeshes:  # .keys()\n                fw('\\n\\tConnect: \"OO\", \"SubDeformer::Cluster %s %s\", \"Deformer::Skin %s\"' % (fbxMeshObName, my_bone.fbxName, fbxMeshObName))\n\n        # limbs -> deformers\n        for my_bone in ob_bones:\n            for fbxMeshObName in my_bone.blenMeshes:  # .keys()\n                fw('\\n\\tConnect: \"OO\", \"Model::%s\", \"SubDeformer::Cluster %s %s\"' % (my_bone.fbxName, fbxMeshObName, my_bone.fbxName))\n\n    #for bonename, bone, obname, me, armob in ob_bones:\n    for my_bone in ob_bones:\n        # Always parent to armature now\n        if my_bone.parent:\n            fw('\\n\\tConnect: \"OO\", \"Model::%s\", \"Model::%s\"' % (my_bone.fbxName, my_bone.parent.fbxName))\n        else:\n            # the armature object is written as an empty and all root level bones connect to it\n            fw('\\n\\tConnect: \"OO\", \"Model::%s\", \"Model::%s\"' % (my_bone.fbxName, my_bone.fbxArm.fbxName))\n\n    # groups\n    if groups:\n        for ob_generic in ob_all_typegroups:\n            for ob_base in ob_generic:\n                for fbxGroupName in ob_base.fbxGroupNames:\n                    fw('\\n\\tConnect: \"OO\", \"Model::%s\", \"GroupSelection::%s\"' % (ob_base.fbxName, fbxGroupName))\n\n    # I think the following always duplicates the armature connection because it is also in ob_all_typegroups above! (JCB)\n    # for my_arm in ob_arms:\n    #     fw('\\n\\tConnect: \"OO\", \"Model::%s\", \"Model::Scene\"' % my_arm.fbxName)\n\n    fw('\\n}')\n\n    # Needed for scene footer as well as animation\n    render = scene.render\n\n    # from the FBX sdk\n    #define KTIME_ONE_SECOND        KTime (K_LONGLONG(46186158000))\n    def fbx_time(t):\n        # 0.5 + val is the same as rounding.\n        return int(0.5 + ((t / fps) * 46186158000))\n\n    fps = float(render.fps)\n    start = scene.frame_start\n    end = scene.frame_end\n    if end < start:\n        start, end = end, start\n\n    # comment the following line, otherwise we dont get the pose\n    # if start==end: use_anim = False\n\n    # animations for these object types\n    ob_anim_lists = ob_bones, ob_meshes, ob_null, ob_cameras, ob_lights, ob_arms\n\n    if use_anim and [tmp for tmp in ob_anim_lists if tmp]:\n\n        frame_orig = scene.frame_current\n\n        if use_anim_optimize:\n            # Do we really want to keep such behavior? User could enter real value directly...\n            ANIM_OPTIMIZE_PRECISSION_FLOAT = 10 ** (-anim_optimize_precision + 2)\n\n        # default action, when no actions are avaioable\n        tmp_actions = []\n        blenActionDefault = None\n        action_lastcompat = None\n\n        # instead of tagging\n        tagged_actions = []\n\n        # get the current action first so we can use it if we only export one action (JCB)\n        for my_arm in ob_arms:\n            blenActionDefault = my_arm.blenAction\n            if blenActionDefault:\n                break\n\n        if use_anim_action_all:\n            tmp_actions = bpy.data.actions[:]\n        elif not use_default_take:\n            if blenActionDefault:\n                # Export the current action (JCB)\n                tmp_actions.append(blenActionDefault)\n\n        if tmp_actions:\n            # find which actions are compatible with the armatures\n            tmp_act_count = 0\n            for my_arm in ob_arms:\n\n                arm_bone_names = set([my_bone.blenName for my_bone in my_arm.fbxBones])\n\n                for action in tmp_actions:\n\n                    if arm_bone_names.intersection(action_bone_names(my_arm.blenObject, action)):  # at least one channel matches.\n                        my_arm.blenActionList.append(action)\n                        tagged_actions.append(action.name)\n                        tmp_act_count += 1\n\n                        # in case there are no actions applied to armatures\n                        # for example, when a user deletes the current action.\n                        action_lastcompat = action\n\n            if tmp_act_count:\n                # unlikely to ever happen but if no actions applied to armatures, just use the last compatible armature.\n                if not blenActionDefault:\n                    blenActionDefault = action_lastcompat\n\n        del action_lastcompat\n\n        if use_default_take:\n            tmp_actions.insert(0, None)  # None is the default action\n\n        fw('''\n;Takes and animation section\n;----------------------------------------------------\n\nTakes:  {''')\n\n        if blenActionDefault and not use_default_take:\n            fw('\\n\\tCurrent: \"%s\"' % sane_takename(blenActionDefault))\n        else:\n            fw('\\n\\tCurrent: \"Default Take\"')\n\n        for blenAction in tmp_actions:\n            # we have tagged all actious that are used be selected armatures\n            if blenAction:\n                if blenAction.name in tagged_actions:\n                    print('\\taction: \"%s\" exporting...' % blenAction.name)\n                else:\n                    print('\\taction: \"%s\" has no armature using it, skipping' % blenAction.name)\n                    continue\n\n            if blenAction is None:\n                # Warning, this only accounts for tmp_actions being [None]\n                take_name = \"Default Take\"\n                act_start = start\n                act_end = end\n            else:\n                # use existing name\n                take_name = sane_name_mapping_take.get(blenAction.name)\n                if take_name is None:\n                    take_name = sane_takename(blenAction)\n\n                act_start, act_end = blenAction.frame_range\n                act_start = int(act_start)\n                act_end = int(act_end)\n\n                # Set the action active\n                for my_arm in ob_arms:\n                    if my_arm.blenObject.animation_data and blenAction in my_arm.blenActionList:\n                        my_arm.blenObject.animation_data.action = blenAction\n\n            # Use the action name as the take name and the take filename (JCB)\n            fw('\\n\\tTake: \"%s\" {' % take_name)\n            fw('\\n\\t\\tFileName: \"%s.tak\"' % take_name.replace(\" \", \"_\"))\n            fw('\\n\\t\\tLocalTime: %i,%i' % (fbx_time(act_start - 1), fbx_time(act_end - 1)))  # ??? - not sure why this is needed\n            fw('\\n\\t\\tReferenceTime: %i,%i' % (fbx_time(act_start - 1), fbx_time(act_end - 1)))  # ??? - not sure why this is needed\n\n            fw('''\n\n\t\t;Models animation\n\t\t;----------------------------------------------------''')\n\n            # set pose data for all bones\n            # do this here in case the action changes\n            '''\n            for my_bone in ob_bones:\n                my_bone.flushAnimData()\n            '''\n            i = act_start\n            while i <= act_end:\n                scene.frame_set(i)\n                for ob_generic in ob_anim_lists:\n                    for my_ob in ob_generic:\n                        #Blender.Window.RedrawAll()\n                        if ob_generic == ob_meshes and my_ob.fbxArm:\n                            # We cant animate armature meshes!\n                            my_ob.setPoseFrame(i, fake=True)\n                        else:\n                            my_ob.setPoseFrame(i)\n\n                i += 1\n\n            #for bonename, bone, obname, me, armob in ob_bones:\n            for ob_generic in (ob_bones, ob_meshes, ob_null, ob_cameras, ob_lights, ob_arms):\n\n                for my_ob in ob_generic:\n\n                    if ob_generic == ob_meshes and my_ob.fbxArm:\n                        # do nothing,\n                        pass\n                    else:\n\n                        fw('\\n\\t\\tModel: \"Model::%s\" {' % my_ob.fbxName)  # ??? - not sure why this is needed\n                        fw('\\n\\t\\t\\tVersion: 1.1')\n                        fw('\\n\\t\\t\\tChannel: \"Transform\" {')\n\n                        context_bone_anim_mats = [(my_ob.getAnimParRelMatrix(frame), my_ob.getAnimParRelMatrixRot(frame)) for frame in range(act_start, act_end + 1)]\n\n                        # ----------------\n                        # ----------------\n                        for TX_LAYER, TX_CHAN in enumerate('TRS'):  # transform, rotate, scale\n\n                            if TX_CHAN == 'T':\n                                context_bone_anim_vecs = [mtx[0].to_translation() for mtx in context_bone_anim_mats]\n                            elif\tTX_CHAN == 'S':\n                                context_bone_anim_vecs = [mtx[0].to_scale() for mtx in context_bone_anim_mats]\n                            elif\tTX_CHAN == 'R':\n                                # Was....\n                                # elif \tTX_CHAN=='R':\tcontext_bone_anim_vecs = [mtx[1].to_euler()\t\t\tfor mtx in context_bone_anim_mats]\n                                #\n                                # ...but we need to use the previous euler for compatible conversion.\n                                context_bone_anim_vecs = []\n                                prev_eul = None\n                                for mtx in context_bone_anim_mats:\n                                    if prev_eul:\n                                        prev_eul = mtx[1].to_euler('XYZ', prev_eul)\n                                    else:\n                                        prev_eul = mtx[1].to_euler()\n                                    context_bone_anim_vecs.append(tuple_rad_to_deg(prev_eul))\n\n                            fw('\\n\\t\\t\\t\\tChannel: \"%s\" {' % TX_CHAN)  # translation\n\n                            for i in range(3):\n                                # Loop on each axis of the bone\n                                fw('\\n\\t\\t\\t\\t\\tChannel: \"%s\" {' % ('XYZ'[i]))  # translation\n                                fw('\\n\\t\\t\\t\\t\\t\\tDefault: %.15f' % context_bone_anim_vecs[0][i])\n                                fw('\\n\\t\\t\\t\\t\\t\\tKeyVer: 4005')\n\n                                if not use_anim_optimize:\n                                    # Just write all frames, simple but in-eficient\n                                    fw('\\n\\t\\t\\t\\t\\t\\tKeyCount: %i' % (1 + act_end - act_start))\n                                    fw('\\n\\t\\t\\t\\t\\t\\tKey: ')\n                                    frame = act_start\n                                    while frame <= act_end:\n                                        if frame != act_start:\n                                            fw(',')\n\n                                        # Curve types are 'C,n' for constant, 'L' for linear\n                                        # C,n is for bezier? - linear is best for now so we can do simple keyframe removal\n                                        fw('\\n\\t\\t\\t\\t\\t\\t\\t%i,%.15f,L' % (fbx_time(frame - 1), context_bone_anim_vecs[frame - act_start][i]))\n                                        frame += 1\n                                else:\n                                    # remove unneeded keys, j is the frame, needed when some frames are removed.\n                                    context_bone_anim_keys = [(vec[i], j) for j, vec in enumerate(context_bone_anim_vecs)]\n\n                                    # last frame to fisrt frame, missing 1 frame on either side.\n                                    # removeing in a backwards loop is faster\n                                    #for j in xrange( (act_end-act_start)-1, 0, -1 ):\n                                    # j = (act_end-act_start)-1\n                                    j = len(context_bone_anim_keys) - 2\n                                    while j > 0 and len(context_bone_anim_keys) > 2:\n                                        # print j, len(context_bone_anim_keys)\n                                        # Is this key the same as the ones next to it?\n\n                                        # co-linear horizontal...\n                                        if\t\tabs(context_bone_anim_keys[j][0] - context_bone_anim_keys[j - 1][0]) < ANIM_OPTIMIZE_PRECISSION_FLOAT and \\\n                                                abs(context_bone_anim_keys[j][0] - context_bone_anim_keys[j + 1][0]) < ANIM_OPTIMIZE_PRECISSION_FLOAT:\n\n                                            del context_bone_anim_keys[j]\n\n                                        else:\n                                            frame_range = float(context_bone_anim_keys[j + 1][1] - context_bone_anim_keys[j - 1][1])\n                                            frame_range_fac1 = (context_bone_anim_keys[j + 1][1] - context_bone_anim_keys[j][1]) / frame_range\n                                            frame_range_fac2 = 1.0 - frame_range_fac1\n\n                                            if abs(((context_bone_anim_keys[j - 1][0] * frame_range_fac1 + context_bone_anim_keys[j + 1][0] * frame_range_fac2)) - context_bone_anim_keys[j][0]) < ANIM_OPTIMIZE_PRECISSION_FLOAT:\n                                                del context_bone_anim_keys[j]\n                                            else:\n                                                j -= 1\n\n                                        # keep the index below the list length\n                                        if j > len(context_bone_anim_keys) - 2:\n                                            j = len(context_bone_anim_keys) - 2\n\n                                    if len(context_bone_anim_keys) == 2 and context_bone_anim_keys[0][0] == context_bone_anim_keys[1][0]:\n\n                                        # This axis has no moton, its okay to skip KeyCount and Keys in this case\n                                        # pass\n\n                                        # better write one, otherwise we loose poses with no animation\n                                        fw('\\n\\t\\t\\t\\t\\t\\tKeyCount: 1')\n                                        fw('\\n\\t\\t\\t\\t\\t\\tKey: ')\n                                        fw('\\n\\t\\t\\t\\t\\t\\t\\t%i,%.15f,L' % (fbx_time(start), context_bone_anim_keys[0][0]))\n                                    else:\n                                        # We only need to write these if there is at least one\n                                        fw('\\n\\t\\t\\t\\t\\t\\tKeyCount: %i' % len(context_bone_anim_keys))\n                                        fw('\\n\\t\\t\\t\\t\\t\\tKey: ')\n                                        for val, frame in context_bone_anim_keys:\n                                            if frame != context_bone_anim_keys[0][1]:  # not the first\n                                                fw(',')\n                                            # frame is already one less then blenders frame\n                                            fw('\\n\\t\\t\\t\\t\\t\\t\\t%i,%.15f,L' % (fbx_time(frame), val))\n\n                                if i == 0:\n                                    fw('\\n\\t\\t\\t\\t\\t\\tColor: 1,0,0')\n                                elif i == 1:\n                                    fw('\\n\\t\\t\\t\\t\\t\\tColor: 0,1,0')\n                                elif i == 2:\n                                    fw('\\n\\t\\t\\t\\t\\t\\tColor: 0,0,1')\n\n                                fw('\\n\\t\\t\\t\\t\\t}')\n                            fw('\\n\\t\\t\\t\\t\\tLayerType: %i' % (TX_LAYER + 1))\n                            fw('\\n\\t\\t\\t\\t}')\n\n                        # ---------------\n\n                        fw('\\n\\t\\t\\t}')\n                        fw('\\n\\t\\t}')\n\n            # end the take\n            fw('\\n\\t}')\n\n            # end action loop. set original actions\n            # do this after every loop in case actions effect eachother.\n            for my_arm in ob_arms:\n                if my_arm.blenObject.animation_data:\n                    my_arm.blenObject.animation_data.action = my_arm.blenAction\n\n        fw('\\n}')\n\n        scene.frame_set(frame_orig)\n\n    else:\n        # no animation\n        fw('\\n;Takes and animation section')\n        fw('\\n;----------------------------------------------------')\n        fw('\\n')\n        fw('\\nTakes:  {')\n        fw('\\n\\tCurrent: \"\"')\n        fw('\\n}')\n\n    # write meshes animation\n    #for obname, ob, mtx, me, mats, arm, armname in ob_meshes:\n\n    # Clear mesh data Only when writing with modifiers applied\n    for me in meshes_to_clear:\n        bpy.data.meshes.remove(me)\n\n    # --------------------------- Footer\n    if world:\n        m = world.mist_settings\n        has_mist = m.use_mist\n        mist_intense = m.intensity\n        mist_start = m.start\n        mist_end = m.depth\n        # mist_height = m.height  # UNUSED\n        world_hor = world.horizon_color\n    else:\n        has_mist = mist_intense = mist_start = mist_end = 0\n        world_hor = 0, 0, 0\n\n    fw('\\n;Version 5 settings')\n    fw('\\n;------------------------------------------------------------------')\n    fw('\\n')\n    fw('\\nVersion5:  {')\n    fw('\\n\\tAmbientRenderSettings:  {')\n    fw('\\n\\t\\tVersion: 101')\n    fw('\\n\\t\\tAmbientLightColor: %.1f,%.1f,%.1f,0' % tuple(world_amb))\n    fw('\\n\\t}')\n    fw('\\n\\tFogOptions:  {')\n    fw('\\n\\t\\tFogEnable: %i' % has_mist)\n    fw('\\n\\t\\tFogMode: 0')\n    fw('\\n\\t\\tFogDensity: %.3f' % mist_intense)\n    fw('\\n\\t\\tFogStart: %.3f' % mist_start)\n    fw('\\n\\t\\tFogEnd: %.3f' % mist_end)\n    fw('\\n\\t\\tFogColor: %.1f,%.1f,%.1f,1' % tuple(world_hor))\n    fw('\\n\\t}')\n    fw('\\n\\tSettings:  {')\n    fw('\\n\\t\\tFrameRate: \"%i\"' % int(fps))\n    fw('\\n\\t\\tTimeFormat: 1')\n    fw('\\n\\t\\tSnapOnFrames: 0')\n    fw('\\n\\t\\tReferenceTimeIndex: -1')\n    fw('\\n\\t\\tTimeLineStartTime: %i' % fbx_time(start - 1))\n    fw('\\n\\t\\tTimeLineStopTime: %i' % fbx_time(end - 1))\n    fw('\\n\\t}')\n    fw('\\n\\tRendererSetting:  {')\n    fw('\\n\\t\\tDefaultCamera: \"Producer Perspective\"')\n    fw('\\n\\t\\tDefaultViewingMode: 0')\n    fw('\\n\\t}')\n    fw('\\n}')\n    fw('\\n')\n\n    # XXX, shouldnt be global!\n    for mapping in (sane_name_mapping_ob,\n                    sane_name_mapping_ob_unique,\n                    sane_name_mapping_mat,\n                    sane_name_mapping_tex,\n                    sane_name_mapping_take,\n                    sane_name_mapping_group,\n                    ):\n        mapping.clear()\n    del mapping\n\n    del ob_arms[:]\n    del ob_bones[:]\n    del ob_cameras[:]\n    del ob_lights[:]\n    del ob_meshes[:]\n    del ob_null[:]\n\n    file.close()\n\n    # copy all collected files.\n    bpy_extras.io_utils.path_reference_copy(copy_set)\n\n    print('export finished in %.4f sec.' % (time.process_time() - start_time))\n    return {'FINISHED'}\n\n\n# defaults for applications, currently only unity but could add others.\ndef defaults_unity3d():\n    return dict(global_matrix=Matrix.Rotation(-math.pi / 2.0, 4, 'X'),\n                use_selection=False,\n                object_types={'ARMATURE', 'EMPTY', 'MESH'},\n                use_mesh_modifiers=True,\n                use_armature_deform_only=True,\n                use_anim=True,\n                use_anim_optimize=False,\n                use_anim_action_all=True,\n                batch_mode='OFF',\n                use_default_take=True,\n                )\n\n\ndef save(operator, context,\n         filepath=\"\",\n         use_selection=False,\n         batch_mode='OFF',\n         use_batch_own_dir=False,\n         **kwargs\n         ):\n\n    if bpy.ops.object.mode_set.poll():\n        bpy.ops.object.mode_set(mode='OBJECT')\n\n    if batch_mode == 'OFF':\n        kwargs_mod = kwargs.copy()\n        if use_selection:\n            kwargs_mod[\"context_objects\"] = context.selected_objects\n        else:\n            kwargs_mod[\"context_objects\"] = context.scene.objects\n\n        return save_single(operator, context.scene, filepath, **kwargs_mod)\n    else:\n        fbxpath = filepath\n\n        prefix = os.path.basename(fbxpath)\n        if prefix:\n            fbxpath = os.path.dirname(fbxpath)\n\n        if not fbxpath.endswith(os.sep):\n            fbxpath += os.sep\n\n        if batch_mode == 'GROUP':\n            data_seq = bpy.data.groups\n        else:\n            data_seq = bpy.data.scenes\n\n        # call this function within a loop with BATCH_ENABLE == False\n        # no scene switching done at the moment.\n        # orig_sce = context.scene\n\n        new_fbxpath = fbxpath  # own dir option modifies, we need to keep an original\n        for data in data_seq:  # scene or group\n            newname = prefix + bpy.path.clean_name(data.name)\n\n            if use_batch_own_dir:\n                new_fbxpath = fbxpath + newname + os.sep\n                # path may already exist\n                # TODO - might exist but be a file. unlikely but should probably account for it.\n\n                if not os.path.exists(new_fbxpath):\n                    os.makedirs(new_fbxpath)\n\n            filepath = new_fbxpath + newname + '.fbx'\n\n            print('\\nBatch exporting %s as...\\n\\t%r' % (data, filepath))\n\n            # XXX don't know what to do with this, probably do the same? (Arystan)\n            if batch_mode == 'GROUP':  # group\n                # group, so objects update properly, add a dummy scene.\n                scene = bpy.data.scenes.new(name=\"FBX_Temp\")\n                scene.layers = [True] * 20\n                # bpy.data.scenes.active = scene # XXX, cant switch\n                for ob_base in data.objects:\n                    scene.objects.link(ob_base)\n\n                scene.update()\n            else:\n                scene = data\n\n                # TODO - BUMMER! Armatures not in the group wont animate the mesh\n\n            # else:  # scene\n            #     data_seq.active = data\n\n            # Call self with modified args\n            # Dont pass batch options since we already usedt them\n            kwargs_batch = kwargs.copy()\n\n            kwargs_batch[\"context_objects\"] = data.objects\n\n            save_single(operator, scene, filepath, **kwargs_batch)\n\n            if batch_mode == 'GROUP':\n                # remove temp group scene\n                bpy.data.scenes.remove(scene)\n\n        # no active scene changing!\n        # bpy.data.scenes.active = orig_sce\n\n        return {'FINISHED'}  # so the script wont run after we have batch exported.\n\n\n# NOTE TO Campbell -\n#   Can any or all of the following notes be removed because some have been here for a long time? (JCB 27 July 2011)\n# NOTES (all line numbers correspond to original export_fbx.py (under release/scripts)\n# - get rid of bpy.path.clean_name somehow\n# + get rid of BPyObject_getObjectArmature, move it in RNA?\n# - implement all BPyMesh_* used here with RNA\n# - getDerivedObjects is not fully replicated with .dupli* funcs\n# - don't know what those colbits are, do we need them? they're said to be deprecated in DNA_object_types.h: 1886-1893\n# - no hq normals: 1900-1901\n"
  },
  {
    "path": "README.md",
    "content": "Lemma\n=====\n\n[![Lemma](http://i.imgur.com/Nb6pffrl.png)](https://helvetica-scenario.itch.io/lemma)\n\n[**Lemma**](https://helvetica-scenario.itch.io/lemma) is an **immersive first-person parkour** game.\nEvery parkour move has the potential to **modify the environment**.\nSurfaces pop in and out of existence at will.\n\nWhat is this?\n-------------\n\nAll the code and some of the assets for Lemma are open source. Everything you need\nto create your own single-player campaign is there, including a level editor.\n\nIs it good code?\n------------------\n\nNot really. The project started in 2010 and served as a test bed for a lot of\nhairbrained ideas I had back then. Consider it an example of what *not* to do.\n\nGetting started\n---------------\n\n1. Install [Microsoft Visual C# 2015](https://www.visualstudio.com/downloads/download-visual-studio-vs)\nand [XNA Game Studio 4.0 Refresh](https://mxa.codeplex.com/releases/view/618279).\n1. Clone the repository.\n1. Open `Lemma.sln`.\n1. [Set the active solution configuration](http://msdn.microsoft.com/en-us/library/wx0123s5(v=vs.100).aspx)\nto `Release`.\n1. Build and run the solution.\n1. On the main menu, hit \"switch to edit mode\" to open the level editor.\n\nLevel editor\n------------\nSee the [Official level editor guide](http://steamcommunity.com/sharedfiles/filedetails/?id=273022369).\n\nBlender pipeline\n----------------\n\nTo make or edit models, you'll need [Blender](http://blender.org). The asset\npipeline has been tested with [Blender 2.70a](http://download.blender.org/release/Blender2.70/).\nHere's how to get started:\n\n1. Install Blender 2.70a.\n1. Find the file `export_fbx.py` in the `PipelineExtensions` project.\n1. Copy the file into the Blender program folder under\n`2.70\\scripts\\addons\\io_scene_fbx` (it should replace an existing file).\n1. Open Blender and make sure the [FBX export addon is enabled](http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python/Add-Ons#Enabling_and_Disabling).\n1. Open a .blend file and select File -> Export -> Autodesk FBX.\n1. Use the following export settings for animations:\n\n[![Blender FBX animation export settings](http://i.imgur.com/RRhsEey.png)](http://i.imgur.com/RRhsEey.png)\n\nLicense\n=======\n\nThe following textures are adapted from [CGTextures](http://www.cgtextures.com)\nsource images, and are therefore only made available here for modding purposes:\n\n\tLemma/Content/Textures/red-rock.png\n\tLemma/Content/Textures/red-rock-normal.png\n\tLemma/Content/Textures/rock-grass.png\n\tLemma/Content/Textures/rock-grass-normal.png\n\tLemma/Content/Textures/hex.png\n\tLemma/Content/Textures/hex-normal.png\n\tLemma/Content/Textures/lattice.png\n\tLemma/Content/Textures/lattice-normal.png\n\nTo use them for your own purposes, you must re-download them from CGTextures\nand follow their usage guidelines.\n\nThe singleplayer game content lives in a closed-source Git submodule. However,\neverything in this repository not listed in the \"Internet Credits\" section of\n`attribution.txt` is made available under the following license:\n\nThe MIT License (MIT)\n---------------------\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "SkinnedModel/.gitignore",
    "content": "\nbin\nobj"
  },
  {
    "path": "SkinnedModel/Channel.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Microsoft.Xna.Framework.Content;\nusing Microsoft.Xna.Framework;\n\nnamespace SkinnedModel\n{\n\tpublic class Channel : List<Keyframe>\n\t{\n\t\tpublic Channel()\n\t\t{\n\t\t\tthis.CurrentKeyframeIndex = 0;\n\t\t}\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic int CurrentKeyframeIndex;\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic int LastKeyframeIndex;\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic Matrix CurrentMatrix;\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic Func<Matrix, Matrix> Filter;\n\n\t\t[ContentSerializer]\n\t\tpublic int BoneIndex;\n\t}\n}\n"
  },
  {
    "path": "SkinnedModel/Clip.cs",
    "content": "#region File Description\n//-----------------------------------------------------------------------------\n// AnimationClip.cs\n//\n// Microsoft XNA Community Game Platform\n// Copyright (C) Microsoft Corporation. All rights reserved.\n//-----------------------------------------------------------------------------\n#endregion\n\n#region Using Statements\nusing System;\nusing System.Collections.Generic;\nusing Microsoft.Xna.Framework.Content;\nusing Microsoft.Xna.Framework;\n#endregion\n\nnamespace SkinnedModel\n{\n\t/// <summary>\n\t/// An animation clip is the runtime equivalent of the\n\t/// Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationContent type.\n\t/// It holds all the keyframes needed to describe a single animation.\n\t/// </summary>\n\tpublic class Clip\n\t{\n\t\t/// <summary>\n\t\t/// Constructs a new animation clip object.\n\t\t/// </summary>\n\t\tpublic Clip(IEnumerable<Channel> channels)\n\t\t{\n\t\t\tthis.Channels = new List<Channel>(channels);\n\t\t\tforeach (Channel channel in this.Channels)\n\t\t\t{\n\t\t\t\tTimeSpan offset = channel[0].Time;\n\t\t\t\tif (offset.TotalSeconds < 0)\n\t\t\t\t{\n\t\t\t\t\toffset = offset.Negate();\n\t\t\t\t\tforeach (Keyframe frame in channel)\n\t\t\t\t\t{\n\t\t\t\t\t\tframe.Time += offset;\n\t\t\t\t\t\tif (this.Duration < frame.Time)\n\t\t\t\t\t\t\tthis.Duration = frame.Time;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach (Keyframe frame in channel)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (this.Duration < frame.Time)\n\t\t\t\t\t\t\tthis.Duration = frame.Time;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Private constructor for use by the XNB deserializer.\n\t\t/// </summary>\n\t\tprivate Clip()\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the total length of the animation.\n\t\t/// </summary>\n\t\t[ContentSerializer]\n\t\tpublic TimeSpan Duration;\n\n\t\t[ContentSerializer]\n\t\tpublic string Name;\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic int Priority;\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic float BlendTime;\n\t\t[ContentSerializerIgnore]\n\t\tpublic float BlendTotalTime;\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic float Speed = 1.0f;\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic bool Loop;\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic float Strength = 1.0f;\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic float TargetStrength = 1.0f;\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic bool Active;\n\n\t\tpublic float TotalStrength\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tfloat blend = this.BlendTotalTime > 0.0f ? MathHelper.Clamp(this.BlendTime / this.BlendTotalTime, 0, 1) : 1.0f;\n\t\t\t\tblend = -blend * (blend - 2); // Quadratic easing\n\t\t\t\tif (this.Stopping)\n\t\t\t\t\tblend = 1.0f - blend;\n\t\t\t\treturn MathHelper.Clamp(this.Strength * blend, 0.0f, 1.0f);\n\t\t\t}\n\t\t}\n\n\t\tprivate List<Channel> channels;\n\t\t/// <summary>\n\t\t/// Gets a combined list containing all the keyframes for all bones,\n\t\t/// sorted by time.\n\t\t/// </summary>\n\t\t[ContentSerializer]\n\t\tpublic List<Channel> Channels\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn this.channels;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthis.channels = value;\n\t\t\t\tforeach (Channel channel in this.channels)\n\t\t\t\t{\n\t\t\t\t\tif (channel.Count > 1)\n\t\t\t\t\t\tchannel.CurrentKeyframeIndex = 1;\n\t\t\t\t\telse\n\t\t\t\t\t\tchannel.CurrentMatrix = channel[0].Transform;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic Channel GetChannel(int boneIndex)\n\t\t{\n\t\t\treturn this.channels.Find(x => x.BoneIndex == boneIndex);\n\t\t}\n\n\t\t[ContentSerializerIgnore]\n\t\tpublic bool Stopping;\n\n\t\tprotected TimeSpan currentTime;\n\t\t[ContentSerializerIgnore]\n\t\tpublic TimeSpan CurrentTime\n\t\t{\n\t\t\tget { return this.currentTime; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (this.Channels == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tTimeSpan time = value;\n\t\t\t\tif (this.Loop)\n\t\t\t\t{\n\t\t\t\t\tif (this.Duration.TotalSeconds > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (time > this.Duration)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach (Channel channel in this.Channels)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (channel.Count > 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tchannel.LastKeyframeIndex = 0;\n\t\t\t\t\t\t\t\t\tchannel.CurrentKeyframeIndex = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (time > this.Duration)\n\t\t\t\t\t\t\ttime -= this.Duration;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\ttime = time > this.Duration ? this.Duration : time;\n\n\t\t\t\tforeach (Channel channel in this.Channels)\n\t\t\t\t{\n\t\t\t\t\tif (channel.Count > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tint index = time > this.currentTime ? channel.CurrentKeyframeIndex : 0;\n\n\t\t\t\t\t\twhile (index < channel.Count - 1 && channel[index].Time <= time)\n\t\t\t\t\t\t\tindex++;\n\n\t\t\t\t\t\tchannel.LastKeyframeIndex = Math.Max(0, index - 1);\n\t\t\t\t\t\tchannel.CurrentKeyframeIndex = index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.currentTime = time;\n\n\t\t\t\tforeach (Channel channel in this.Channels)\n\t\t\t\t{\n\t\t\t\t\tif (channel.Count > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tKeyframe lastKeyframe = channel[channel.LastKeyframeIndex];\n\t\t\t\t\t\tKeyframe currentKeyframe = channel[channel.CurrentKeyframeIndex];\n\t\t\t\t\t\tdouble lerp = (this.currentTime.TotalSeconds - lastKeyframe.Time.TotalSeconds) / (currentKeyframe.Time.TotalSeconds - lastKeyframe.Time.TotalSeconds);\n\t\t\t\t\t\tfloat blend = (float)Math.Min(lerp, 1.0);\n\n\t\t\t\t\t\tMatrix bone1 = lastKeyframe.Transform;\n\t\t\t\t\t\tVector3 scale1;\n\t\t\t\t\t\tQuaternion quat1;\n\t\t\t\t\t\tVector3 translation1;\n\t\t\t\t\t\tbone1.Decompose(out scale1, out quat1, out translation1);\n\n\t\t\t\t\t\tMatrix bone2 = currentKeyframe.Transform;\n\t\t\t\t\t\tVector3 scale2;\n\t\t\t\t\t\tQuaternion quat2;\n\t\t\t\t\t\tVector3 translation2;\n\t\t\t\t\t\tbone2.Decompose(out scale2, out quat2, out translation2);\n\n\t\t\t\t\t\tMatrix m = Matrix.CreateScale(Vector3.Lerp(scale1, scale2, blend)) * Matrix.CreateFromQuaternion(Quaternion.Lerp(quat1, quat2, blend)) * Matrix.CreateTranslation(Vector3.Lerp(translation1, translation2, blend));\n\t\t\t\t\t\tif (channel.Filter == null)\n\t\t\t\t\t\t\tchannel.CurrentMatrix = m;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tchannel.CurrentMatrix = channel.Filter(m);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "SkinnedModel/Keyframe.cs",
    "content": "#region File Description\n//-----------------------------------------------------------------------------\n// Keyframe.cs\n//\n// Microsoft XNA Community Game Platform\n// Copyright (C) Microsoft Corporation. All rights reserved.\n//-----------------------------------------------------------------------------\n#endregion\n\n#region Using Statements\nusing System;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Content;\n#endregion\n\nnamespace SkinnedModel\n{\n\t/// <summary>\n\t/// Describes the position of a single bone at a single point in time.\n\t/// </summary>\n\tpublic class Keyframe\n\t{\n\t\t/// <summary>\n\t\t/// Constructs a new keyframe object.\n\t\t/// </summary>\n\t\tpublic Keyframe(TimeSpan time, Matrix transform)\n\t\t{\n\t\t\tthis.Time = time;\n\t\t\tthis.Transform = transform;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Private constructor for use by the XNB deserializer.\n\t\t/// </summary>\n\t\tprivate Keyframe()\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the time offset from the start of the animation to this keyframe.\n\t\t/// </summary>\n\t\t[ContentSerializer]\n\t\tpublic TimeSpan Time { get; set; }\n\n\t\t/// <summary>\n\t\t/// Gets the bone transform for this keyframe.\n\t\t/// </summary>\n\t\t[ContentSerializer]\n\t\tpublic Matrix Transform { get; set; }\n\t}\n}\n"
  },
  {
    "path": "SkinnedModel/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"SkinnedModel\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Microsoft\")]\n[assembly: AssemblyProduct(\"SkinnedModel\")]\n[assembly: AssemblyCopyright(\"Copyright © Microsoft 2010\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"6eee3d47-6331-4fbc-a54d-f1beb97bc57b\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "SkinnedModel/SkinnedModel.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{7D386992-B626-46C6-A196-F4CE42F36190}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>SkinnedModel</RootNamespace>\n    <AssemblyName>SkinnedModel</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\Runtime\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\Runtime\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Clip.cs\" />\n    <Compile Include=\"Channel.cs\" />\n    <Compile Include=\"Keyframe.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"SkinningData.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\MonoGame\\MonoGame.Framework\\MonoGame.Framework.Windows.csproj\">\n      <Project>{7DE47032-A904-4C29-BD22-2D235E8D91BA}</Project>\n      <Name>MonoGame.Framework.Windows</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "SkinnedModel/SkinnedModelContent.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{882A32E7-CB48-4E63-8180-0D1859575723}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>SkinnedModel</RootNamespace>\n    <AssemblyName>SkinnedModel</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\Content\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\Content\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Channel.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Clip.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Keyframe.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"SkinningData.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "SkinnedModel/SkinningData.cs",
    "content": "#region File Description\n//-----------------------------------------------------------------------------\n// SkinningData.cs\n//\n// Microsoft XNA Community Game Platform\n// Copyright (C) Microsoft Corporation. All rights reserved.\n//-----------------------------------------------------------------------------\n#endregion\n\n#region Using Statements\nusing System.Collections.Generic;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Content;\n#endregion\n\nnamespace SkinnedModel\n{\n\t/// <summary>\n\t/// Combines all the data needed to render and animate a skinned object.\n\t/// This is typically stored in the Tag property of the Model being animated.\n\t/// </summary>\n\tpublic class SkinningData\n\t{\n\t\t/// <summary>\n\t\t/// Constructs a new skinning data object.\n\t\t/// </summary>\n\t\tpublic SkinningData(Dictionary<string, int> boneMap, Dictionary<string, Clip> clips,\n\t\t\t\t\t\t\tList<Matrix> bindPose, List<Matrix> inverseBindPose,\n\t\t\t\t\t\t\tList<int> skeletonHierarchy)\n\t\t{\n\t\t\tthis.BoneMap = boneMap;\n\t\t\tthis.Clips = clips;\n\t\t\tthis.BindPose = bindPose;\n\t\t\tthis.InverseBindPose = inverseBindPose;\n\t\t\tthis.SkeletonHierarchy = skeletonHierarchy;\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Private constructor for use by the XNB deserializer.\n\t\t/// </summary>\n\t\tprivate SkinningData()\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Map of bone names to indices.\n\t\t/// </summary>\n\t\t[ContentSerializer]\n\t\tpublic Dictionary<string, int> BoneMap { get; set; }\n\n\t\t/// <summary>\n\t\t/// Gets a collection of animation clips. These are stored by name in a\n\t\t/// dictionary, so there could for instance be clips for \"Walk\", \"Run\",\n\t\t/// \"JumpReallyHigh\", etc.\n\t\t/// </summary>\n\t\t[ContentSerializer]\n\t\tpublic Dictionary<string, Clip> Clips { get; set; }\n\n\n\t\t/// <summary>\n\t\t/// Bindpose matrices for each bone in the skeleton,\n\t\t/// relative to the parent bone.\n\t\t/// </summary>\n\t\t[ContentSerializer]\n\t\tpublic List<Matrix> BindPose { get; set; }\n\n\n\t\t/// <summary>\n\t\t/// Vertex to bonespace transforms for each bone in the skeleton.\n\t\t/// </summary>\n\t\t[ContentSerializer]\n\t\tpublic List<Matrix> InverseBindPose { get; set; }\n\n\n\t\t/// <summary>\n\t\t/// For each bone in the skeleton, stores the index of the parent bone.\n\t\t/// </summary>\n\t\t[ContentSerializer]\n\t\tpublic List<int> SkeletonHierarchy { get; set; }\n\t}\n}\n"
  },
  {
    "path": "Steam/app_build_300340.vdf",
    "content": "\"appbuild\"\n{\n\t\"appid\"\t\"300340\"\n\t\"desc\" \"Lemma\" // description for this build\n\t\"buildoutput\" \".\" // build output folder for .log, .csm & .csd files, relative to location of this file\n\t\"contentroot\" \".\" // root content folder, relative to location of this file\n\t\"setlive\"\t\"\" // branch to set live after successful build, non if empty\n\t\"preview\" \"0\" // to enable preview builds\n\t\"local\"\t\"\"\t// set to flie path of local content server \n\t\n\t\"depots\"\n\t{\n\t\t\"300341\" \"depot_build_300341.vdf\"\n\t\t\"386000\" \"depot_build_386000.vdf\"\n\t}\n}"
  },
  {
    "path": "Steam/app_build_372580.vdf",
    "content": "\"appbuild\"\n{\n\t\"appid\"\t\"372580\"\n\t\"desc\" \"Lemma Demo\" // description for this build\n\t\"buildoutput\" \".\" // build output folder for .log, .csm & .csd files, relative to location of this file\n\t\"contentroot\" \".\" // root content folder, relative to location of this file\n\t\"setlive\"\t\"\" // branch to set live after successful build, non if empty\n\t\"preview\" \"0\" // to enable preview builds\n\t\"local\"\t\"\"\t// set to flie path of local content server \n\t\n\t\"depots\"\n\t{\n\t\t\"372581\" \"depot_build_372581.vdf\"\n\t}\n}"
  },
  {
    "path": "Steam/build_demo.bat",
    "content": "rm ../Lemma/bin/x86/Release/*.xml\n..\\..\\steamsdk\\tools\\ContentBuilder\\builder\\steamcmd.exe +login %1 %2 +run_app_build %~dp0%app_build_372580.vdf +quit\n"
  },
  {
    "path": "Steam/depot_build_300341.vdf",
    "content": "\"DepotBuildConfig\"\n{\n\t// Set your assigned depot ID here\n\t\"DepotID\" \"300341\"\n\n\t// include all files recursively\n  \"FileMapping\"\n  {\n  \t// This can be a full path, or a path relative to ContentRoot\n    \"LocalPath\" \"..\\Lemma\\bin\\x86\\Release\\*\"\n    \n    // This is a path relative to the install folder of your game\n    \"DepotPath\" \".\"\n    \n    // If LocalPath contains wildcards, setting this means that all\n    // matching files within subdirectories of LocalPath will also\n    // be included.\n    \"recursive\" \"1\"\n  }\n\n\t// but exclude all symbol files  \n\t// This can be a full path, or a path relative to ContentRoot\n  \"FileExclusion\" \"*.xml\"\n  \"FileExculsion\" \"*steam_appid.txt*\"\n}"
  },
  {
    "path": "Steam/depot_build_372581.vdf",
    "content": "\"DepotBuildConfig\"\n{\n\t// Set your assigned depot ID here\n\t\"DepotID\" \"372581\"\n\n\t// include all files recursively\n  \"FileMapping\"\n  {\n  \t// This can be a full path, or a path relative to ContentRoot\n    \"LocalPath\" \"..\\Lemma\\bin\\x86\\Release\\*\"\n    \n    // This is a path relative to the install folder of your game\n    \"DepotPath\" \".\"\n    \n    // If LocalPath contains wildcards, setting this means that all\n    // matching files within subdirectories of LocalPath will also\n    // be included.\n    \"recursive\" \"1\"\n  }\n\n  // but exclude all symbol files  \n  // This can be a full path, or a path relative to ContentRoot\n  \"FileExclusion\" \"*.xml\"\n  \"FileExculsion\" \"*steam_appid.txt*\"\n}"
  },
  {
    "path": "Steam/depot_build_386000.vdf",
    "content": "\"DepotBuildConfig\"\n{\n\t// Set your assigned depot ID here\n\t\"DepotID\" \"386000\"\n\n\t// include all files recursively\n  \"FileMapping\"\n  {\n  \t// This can be a full path, or a path relative to ContentRoot\n    \"LocalPath\" \"..\\OST\\*\"\n    \n    // This is a path relative to the install folder of your game\n    \"DepotPath\" \".\"\n    \n    // If LocalPath contains wildcards, setting this means that all\n    // matching files within subdirectories of LocalPath will also\n    // be included.\n    \"recursive\" \"1\"\n  }\n}"
  },
  {
    "path": "Steam/run_build.bat",
    "content": "rm ../Lemma/bin/x86/Release/*.xml\n..\\..\\steamsdk\\tools\\ContentBuilder\\builder\\steamcmd.exe +login %1 %2 +run_app_build %~dp0%app_build_300340.vdf +quit\n"
  },
  {
    "path": "Wwise/AkAuxSend.cs",
    "content": "//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\n//This component is the conceptual equivalent of the Reverb zone.  However, any effect can be used.  This is defined in the Wwise project.\n//It simply demonstrates one way to manage multiple environements. \n//All the real meat is in AkEnvironementAware.cs.  This class could be replaced by a simple tag on a collider.\npublic class AkAuxSend : Component<BaseMain>\n{\n\tpublic string auxBusName;\n\tpublic float rollOffDistance;\n\tprivate uint m_auxBusID;\n\t\n\tpublic uint GetAuxBusID()\n\t{\n\t\treturn m_auxBusID;\n\t}\n\t\n\tpublic virtual float GetAuxSendValueForPosition(Vector3 in_pos)\n\t{\n\t\treturn 1.0f;\n\t}\n\t\n\tpublic override void Awake()\n\t{\n\t\tbase.Awake();\n\t\t//Cache the ID to avoid repetitive calls to GetIDFromString that will give the same result.\n\t\tm_auxBusID = AkSoundEngine.GetIDFromString(auxBusName);\n\t}\n}\n"
  },
  {
    "path": "Wwise/AkAuxSendAware.cs",
    "content": "//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing ComponentBind;\nusing System.Collections.Generic;\n\n//TODO potential optimization: split this class into 2 objects, one for moving objects and one for static objects.\n\n//This component should be added to any object that needs to have environment effects (e.g. reverb) applied to it.\n//This works hand in hand with AkAuxSend-derived classes (e.g. AkBoxAuxSendironment).  \n//When the AkAuxSendAware is within an AkAuxSend, an environment percentage value is computed (the amount of wet\n//signal the AuxSendironment is contributing) and applied to this object.\npublic class AkAuxSendAware : Component<BaseMain>, IUpdateableComponent\n{\t\t\t\n\tprivate List<AkAuxSend> m_activeAuxSends = new List<AkAuxSend>();\n\tprivate AkAuxSendArray m_auxSendValues;\n\tprivate Transform transform;\n\n\tpublic Command<Entity> OnEnter = new Command<Entity>();\n\tpublic Command<Entity> OnExit = new Command<Entity>();\n\t\n\t//When starting, check if any of our parent objects have the AkAuxSend component.\n\t//We'll assume that this object is then affected by the same AuxSendironment setting.\n\tpublic override void Awake()\n\t{\n\t\tbase.Awake();\n\t\tthis.Serialize = false;\n\t\tthis.transform = this.Entity.Get<Transform>();\n\n\t\t//When entering an AuxSendironment, add it to the list of active AuxSendironments\n\t\tthis.OnEnter.Action = this.AddAuxSend;\n\t\n\t\t//When exiting an AuxSendironment, remove it from active AuxSendironments\n\t\tthis.OnExit.Action = delegate(Entity other)\n\t\t{\n\t\t\tAkAuxSend AuxSend = other.Get<AkAuxSend>();\n\t\t\tif (AuxSend != null)\n\t\t\t{\n\t\t\t\tm_activeAuxSends.Remove(AuxSend);\n\t\t\t\tm_auxSendValues = null;\n\t\t\t\tUpdateAuxSend();\t\t\t\n\t\t\t}\n\t\t};\n\n\t\tthis.AddAuxSend(this.Entity);\n\t}\n\t\n\t\n\tvoid AddAuxSend(Entity in_AuxSendObject)\n\t{\n\t\tAkAuxSend AuxSend = in_AuxSendObject.Get<AkAuxSend>();\n\t\tif (AuxSend != null)\n\t\t{\n\t\t\tm_activeAuxSends.Add(AuxSend);\n\t\t\tm_auxSendValues = null;\n\t\t\tUpdateAuxSend();\t\t\t\n\t\t}\n\t}\n\t\n\tpublic void Update(float dt)\n\t{\n\t\t//For this example, we assume:\n\t\t//- The AkAuxSend objects don't move.\n\t\t//- The Game Object has a AkGameObjectTracker component.\n\t\t//- The Collider position anchor is at the center.\n\t\t\t\t\n\t\t//If we know this object hasn't moved, don't update the AuxSendironment data uselessly.\t\t\t\t\n\t\tAkGameObjectTracker tracker = this.Entity.Get<AkGameObjectTracker>();\n\t\tif (tracker != null && tracker.HasMovedInLastFrame())\n\t\t{\n\t\t\tUpdateAuxSend();\n\t\t}\t\t\n\t}\n\t\n\tvoid UpdateAuxSend()\n\t{\n\t\tif (m_auxSendValues == null)\n\t\t\tm_auxSendValues = new AkAuxSendArray((uint)m_activeAuxSends.Count);\n\t\telse\n\t\t\tm_auxSendValues.Reset();\t\t\t\t\n\t\t\t\t\n\t\tforeach(AkAuxSend AuxSend in m_activeAuxSends)\n\t\t\tm_auxSendValues.Add(AuxSend.GetAuxBusID(), AuxSend.GetAuxSendValueForPosition(this.transform.Position));\n\t\t\n\t\tAkSoundEngine.SetGameObjectAuxSendValues(this.Entity, m_auxSendValues, (uint)m_activeAuxSends.Count);\n\t}\n}\n"
  },
  {
    "path": "Wwise/AkBankPath.cs",
    "content": "//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.IO;\n\n\n// This class is used for returning correct path strings for retrieving various soundbank file locations,\n// based on Unity usecases. The main concerns include platform sub-folders and path separator conventions.\n// The class makes path string retrieval transparent for all platforms in all contexts. Clients of the class\n// only needs to use the public methods to get physically correct path strings after setting flag isToUsePosixPathSeparator. By default, the flag is turned off for non-buildPipeline usecases.\n//\n// Unity usecases:\n// - A BuildPipeline user context uses POSIX path convention for all platforms, including Windows and Xbox360.\n// - Other usecases use platform-specific path conventions.\n\npublic class AkBankPath\n{\n\n\tprivate static string defaultBasePath = Path.Combine(\"Audio\", \"GeneratedSoundBanks\");\t//Default value.  Will be overwritten by the user.\n\tprivate static bool isToUsePosixPathSeparator = false;\n\tprivate static bool isToAppendTrailingPathSeparator = true;\n\t\n\tstatic AkBankPath ()\n\t{\n\t\tisToUsePosixPathSeparator = false;\n\t}\n\n\tpublic static void UsePosixPath() { isToUsePosixPathSeparator = true; }\n\tpublic static void UsePlatformSpecificPath() { isToUsePosixPathSeparator = false; }\n\t\n\tpublic static void SetToAppendTrailingPathSeparator(bool add) { isToAppendTrailingPathSeparator = add; }\n\n#if !UNITY_METRO\n\tpublic static bool Exists(string path)\n\t{\n\t\tDirectoryInfo basePathDir = new DirectoryInfo(path);\n\t\treturn basePathDir.Exists;\n\t}\n#endif // #if !UNITY_METRO\n\n\tpublic static string GetDefaultPath() { return defaultBasePath; }\n\t\n\tpublic static string GetFullBasePath() \n\t{\n\t\t// Get full path of base path\n#if UNITY_ANDROID && ! UNITY_EDITOR\n\t\t// Wwise Android SDK now loads SoundBanks from APKs.\n\t#if AK_LOAD_BANK_IN_MEMORY\n\t\tstring fullBasePath = Path.Combine(Application.streamingAssetsPath, AkGlobalSoundEngineInitializer.GetBasePath());\n\t#else\n\t\tstring fullBasePath = AkGlobalSoundEngineInitializer.GetBasePath();\n\t#endif // #if AK_LOAD_BANK_IN_MEMORY\n\t\t\n#elif UNITY_PS3 && ! UNITY_EDITOR\n\t\t// NOTE: Work-around for Unity PS3 (up till 3.5.2) bug: Application.streamingAssetsPath points to wrong location: /app_home/PS3_GAME/USRDIR/Raw\n\t\tconst string StreamingAssetsPath = \"/app_home/PS3_GAME/USRDIR/Media/Raw\";\n\t\tstring fullBasePath = Path.Combine(StreamingAssetsPath, AkGlobalSoundEngineInitializer.GetBasePath());\n#else\n\t\tstring fullBasePath = Path.GetFullPath(AkGlobalSoundEngineInitializer.GetBasePath());\n#endif\n\t\tLazyAppendTrailingSeparator(ref fullBasePath);\n\t\tLazyConvertPathConvention(ref fullBasePath);\n\t\treturn fullBasePath;\n\t}\n\t\n\tpublic static string GetPlatformBasePath()\n\t{\n\t\t// Combine base path with platform sub-folder\n\t\tstring platformBasePath = Path.Combine(GetFullBasePath(), GetPlatformSubDirectory());\n\t\t\n\t\tLazyAppendTrailingSeparator(ref platformBasePath);\n\n\t\tLazyConvertPathConvention(ref platformBasePath);\n\n\t\treturn platformBasePath;\n\t}\n\n\tstatic public string GetPlatformSubDirectory()\n\t{\n\t\tstring platformSubDir = \"Undefined platform sub-folder\";        \n\t\t\n#if WINDOWS\n\t\tplatformSubDir = Path.DirectorySeparatorChar == '/' ? \"Mac\" : \"Windows\";\n#elif MAC\n\t\tplatformSubDir = Path.DirectorySeparatorChar == '/' ? \"Mac\" : \"Windows\";\n#endif\n\t\treturn platformSubDir;\n\t}\n\n\tpublic static void LazyConvertPathConvention(ref string path)\n\t{\n\t\tif (isToUsePosixPathSeparator)\n\t\t\tConvertToPosixPath(ref path);\n\t\telse\n\t\t{\n#if !UNITY_METRO\n\t\t\tif (Path.DirectorySeparatorChar == '/')\n\t\t\t\tConvertToPosixPath(ref path);\n\t\t\telse\n\t\t\t\tConvertToWindowsPath(ref path);\n#else\n\t\t\tConvertToWindowsPath(ref path);\n#endif // #if !UNITY_METRO\n\t\t}\n\t} \n\t\n\tpublic static void ConvertToWindowsPath(ref string path)\n\t{\n\t\tpath.Trim();\n\t\tpath = path.Replace(\"/\", \"\\\\\");\n\t\tpath = path.TrimStart('\\\\');\n\t}\n\n\tpublic static void ConvertToWindowsCommandPath(ref string path)\n\t{\n\t\tpath.Trim();\n\t\tpath = path.Replace(\"/\", \"\\\\\\\\\");\n\t\tpath = path.Replace(\"\\\\\", \"\\\\\\\\\");\n\t\tpath = path.TrimStart('\\\\');\n\t}    \n\t\n\tpublic static void ConvertToPosixPath(ref string path)\n\t{\n\t\tpath.Trim();\n\t\tpath = path.Replace(\"\\\\\", \"/\");\n\t\tpath = path.TrimStart('\\\\');\n\t}\n\t\n\tpublic static void LazyAppendTrailingSeparator(ref string path)\n\t{\n\t\tif ( ! isToAppendTrailingPathSeparator )\n\t\t\treturn;\n#if !UNITY_METRO\n\t\tif ( ! path.EndsWith(Path.DirectorySeparatorChar.ToString()) )\n\t\t{\n\t\t\tpath += Path.DirectorySeparatorChar;\n\t\t}\n#else\n\t\tif ( ! path.EndsWith(\"\\\\\") )\n\t\t{\n\t\t\tpath += \"\\\\\";\n\t\t}\n#endif // #if !UNITY_METRO\n\t}\n}\n"
  },
  {
    "path": "Wwise/AkGameObject.cs",
    "content": "//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing Microsoft.Xna.Framework;\nusing ComponentBind;\n\n// This component is added automatically to all Unity Game Object that are passed to Wwise API (see AkSoundEngine.cs).  \n// It manages registration of the game object inside the Wwise Sound Engine\npublic class AkGameObject : ComponentBind.Component<BaseMain>\n{\n\tpublic override void Awake()\n\t{\t\t\t\t\n\t\tbase.Awake();\n\t\tthis.Serialize = false;\n\t\tthis.EnabledWhenPaused = false;\n\n\t\t// Register a Game Object in the sound engine, with its name.\t\t\n\t\tAkSoundEngine.RegisterGameObj(this.Entity, this.Entity.ToString());\n\t\tthis.Update();\n\t}\n\n\tpublic virtual void Update()\n\t{\n\t\tTransform transform = this.Entity.Get<Transform>();\n\t\tif (transform != null)\n\t\t{\n\t\t\tVector3 position = transform.Position;\n\t\t\tVector3 forward = Vector3.Transform(Vector3.Forward, transform.Quaternion);\n\t\t\t\t\n\t\t\t// Set the original position\n\t\t\tAkSoundEngine.SetObjectPosition\n\t\t\t(\n\t\t\t\tthis.Entity,\n\t\t\t\tposition.X, \n\t\t\t\tposition.Y, \n\t\t\t\tposition.Z, \n\t\t\t\tforward.X,\n\t\t\t\tforward.Y, \n\t\t\t\tforward.Z\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic override void delete()\n\t{\n\t\tbase.delete();\n\t\tif (AkSoundEngine.IsInitialized())\n\t\t\tAkSoundEngine.UnregisterGameObj(this.Entity);\n\t}\n}\n"
  },
  {
    "path": "Wwise/AkGameObjectTracker.cs",
    "content": "//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing Microsoft.Xna.Framework;\nusing ComponentBind;\n\n//Add this script on a Game Object that will emit sounds and that will move during gameplay.\n//For more information, see the Wwise SDK doc in the section AK::SoundEngine::SetObjectPosition\npublic class AkGameObjectTracker : AkGameObject\n{    \n\tprivate Vector3 pos;\n\tprivate Vector3 forward;\n\n\tprivate bool hasMoved;\n\n\tpublic bool HasMovedInLastFrame()\n\t{\n\t\tbool result = this.hasMoved;\n\t\tthis.hasMoved = false;\n\t\treturn result;\n\t}\n\n\tpublic Property<Matrix> Matrix = new Property<Matrix>();\n\n\tpublic override void Awake()\n\t{\n\t\tbase.Awake();\n\t\tthis.Add(new NotifyBinding(this.Update, this.Matrix));\n\t}\n\n\tpublic void AuxSend(AkAuxSendArray aux, uint count)\n\t{\n\t\tAkSoundEngine.SetGameObjectAuxSendValues(this.Entity, aux, count);\n\t}\n\n\tpublic override void Update()\n\t{\n\t\tMatrix m = this.Matrix;\n\t\tVector3 pos = m.Translation;\n\t\tVector3 forward = m.Forward;\n\t\tif (this.pos == pos && this.forward == forward)\n\t\t{\n\t\t\tthis.hasMoved = false;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.pos = pos;\n\t\tthis.forward = forward;    \n\t\tthis.hasMoved = true;\n\n\t\t// Update position\n\t\tAkSoundEngine.SetObjectPosition\n\t\t(\n\t\t\tthis.Entity, \n\t\t\tpos.X, \n\t\t\tpos.Y, \n\t\t\tpos.Z, \n\t\t\tforward.X,\n\t\t\tforward.Y, \n\t\t\tforward.Z\n\t\t);\n\t}\n}"
  },
  {
    "path": "Wwise/AkGlobalSoundEngineInitializer.cs",
    "content": "//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing System.Collections.Generic;\nusing System.IO;\nusing System;\nusing ComponentBind;\n#pragma warning disable 0219, 0414\n\n// This script deals with initialization, and frame updates of the Wwise audio engine.  \n// It must be present on one Game Object at the beginning of the game to initialize the audio properly.\n// It must be executed BEFORE any other monoBehaviors that use AkSoundEngine.\n// For more information about Wwise initialization and termination see the Wwise SDK doc:\n// Wwise SDK | Sound Engine Integration Walkthrough | Initialize the Different Modules of the Sound Engine \n// and also, check AK::SoundEngine::Init & Term.\npublic class AkGlobalSoundEngineInitializer : Component<BaseMain>\n{\n\tpublic string basePath = AkBankPath.GetDefaultPath();\t//Path for the soundbanks.  This must contain one sub folder per platform (see AkBankPath for the names).\n\tpublic string language = \"English(US)\";\n\tpublic int defaultPoolSize = 4096; //4 megs for the metadata pool\n\tpublic int lowerPoolSize = 2048; //2 megs for the processing pool\n\tpublic int streamingPoolSize = 1024; //1 meg for disk streaming.\n\tpublic float memoryCutoffThreshold = 0.95f;   //When reaching 95% of used memory, lowest priority sounds are killed.\n\n\tprivate static AkGlobalSoundEngineInitializer ms_Instance;\n\t\n\tpublic static string GetBasePath()\n\t{\n\t\treturn ms_Instance.basePath;\n\t}\n\n\tpublic static string GetCurrentLanguage()\n\t{\n\t   return ms_Instance.language;\n\t}\n\n\tpublic AkGlobalSoundEngineInitializer(string basePath)\n\t{\n\t\tif (ms_Instance != null)\n\t\t\treturn; //Don't init twice\n\n\t\tthis.basePath = basePath;\n\t\t\n#if UNITY_ANDROID && !UNITY_EDITOR\n\t\tInitalizeAndroidSoundBankIO();\n#endif\n\n\t\tLog.d(\"WwiseUnity: Initialize sound engine ...\");\n\n\t\t//Use default properties for most SoundEngine subsystem.  \n\t\t//The game programmer should modify these when needed.  See the Wwise SDK documentation for the initialization.\n\t\t//These settings may very well change for each target platform.\n\t\tAkMemSettings memSettings = new AkMemSettings();\n\t\tmemSettings.uMaxNumPools = 20;\n\n\t\tAkDeviceSettings deviceSettings = new AkDeviceSettings();\n\t\tAkSoundEngine.GetDefaultDeviceSettings(deviceSettings);\n\n\t\tAkStreamMgrSettings streamingSettings = new AkStreamMgrSettings();\n\t\tstreamingSettings.uMemorySize = (uint)streamingPoolSize * 1024;\n\n\t\tAkInitSettings initSettings = new AkInitSettings();\n\t\tAkSoundEngine.GetDefaultInitSettings(initSettings);\n\t\tinitSettings.uDefaultPoolSize = (uint)defaultPoolSize * 1024;\n\n\t\tAkPlatformInitSettings platformSettings = new AkPlatformInitSettings();\n\t\tAkSoundEngine.GetDefaultPlatformInitSettings(platformSettings);\n\t\tplatformSettings.uLEngineDefaultPoolSize = (uint)lowerPoolSize * 1024;\n\t\tplatformSettings.fLEngineDefaultPoolRatioThreshold = memoryCutoffThreshold;\n\n\t\tAkMusicSettings musicSettings = new AkMusicSettings();\n\t\tAkSoundEngine.GetDefaultMusicSettings(musicSettings);\n\n\t\tAKRESULT result = AkSoundEngine.Init(memSettings, streamingSettings, deviceSettings, initSettings, platformSettings, musicSettings);\n\t\tif (result != AKRESULT.AK_Success)\n\t\t{\n\t\t\tLog.d(\"Wwise: Failed to initialize the sound engine. Abort.\");\n\t\t\treturn; //AkSoundEngine.Init should have logged more details.\n\t\t}\n\n\t\tms_Instance = this;\n\n\t\tAkBankPath.UsePlatformSpecificPath();\n\t\tstring platformBasePath = AkBankPath.GetPlatformBasePath();\n// Note: Android low-level IO uses relative path to \"assets\" folder of the apk as SoundBank folder.\n// Unity uses full paths for general path checks. We thus don't use DirectoryInfo.Exists to test \n// our SoundBank folder for Android.\n#if !UNITY_ANDROID && !UNITY_METRO && !UNITY_PSP2\n\t\tif ( ! AkBankPath.Exists(platformBasePath) )\n\t\t{\n\t\t\tstring errorMsg = string.Format(\"Wwise: Failed to find soundbank folder: {0}. Abort.\", platformBasePath);\n\t\t\tLog.d(errorMsg);\n\t\t\tms_Instance = null;\n\t\t\treturn;\n\t\t}\n#endif // #if !UNITY_ANDROID\n\n\t\tAkSoundEngine.SetBasePath(platformBasePath);\n\t\tAkSoundEngine.SetCurrentLanguage(language);\n\t\t\n\t\tresult = AkCallbackManager.Init();\n\t\tif (result != AKRESULT.AK_Success)\n\t\t{\n\t\t\tLog.d(\"Wwise: Failed to initialize Callback Manager. Terminate sound engine.\");\n\t\t\tAkSoundEngine.Term();\t\n\t\t\tms_Instance = null;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tAkCallbackManager.SetMonitoringCallback(ErrorLevel.ErrorLevel_All, null);\n\t\t\n\t\t//Debug.Log(\"WwiseUnity: Sound engine initialized.\");\n\t\t\n\t\t//The sound engine should not be destroyed once it is initialized.\n\t\t//DontDestroyOnLoad(this);\n\t\t\n\t\t//Load the init bank right away.  Errors will be logged automatically.\n\t\tuint BankID;\n#if UNITY_ANDROID && !UNITY_METRO && AK_LOAD_BANK_IN_MEMORY\n\tresult = AkInMemBankLoader.LoadNonLocalizedBank(\"Init.bnk\");\n#else\n\t\tresult = AkSoundEngine.LoadBank(\"Init.bnk\", AkSoundEngine.AK_DEFAULT_POOL_ID, out BankID);\n#endif // #if UNITY_ANDROID && !UNITY_METRO && AK_ANDROID_BANK_IN_OBB\n\t\tif (result != AKRESULT.AK_Success)\n\t\t{\n\t\t\tLog.d(\"Wwise: Failed load Init.bnk with result: \" + result.ToString());\n\t\t}\n\t}\n\t\n\tpublic override void delete()\n\t{\t\n\t\tbase.delete();\n\t\tms_Instance = null;\n\t\t// Do nothing. AkGlobalSoundEngineTerminator handles sound engine termination.\n\t}\n\t\n#if UNITY_ANDROID && !UNITY_EDITOR\n\tprivate bool InitalizeAndroidSoundBankIO()\n\t{\n\t\tJavaVM.AttachCurrentThread();\n\n\t\t// Find main activity..\n\t\tIntPtr cls_Activity = JNI.FindClass(\"com/unity3d/player/UnityPlayer\");\n\t\tint fid_Activity = JNI.GetStaticFieldID(cls_Activity, \"currentActivity\", \"Landroid/app/Activity;\");\n\t\tIntPtr obj_Activity = JNI.GetStaticObjectField(cls_Activity, fid_Activity);\n\t\tif ( obj_Activity == IntPtr.Zero )\n\t\t{\n\t\t\tDebug.LogError(\"WwiseUnity: Failed to get UnityPlayer activity. Aborted.\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Create a JavaClass object...\n\t\tconst string AkPackageClass = \"com/audiokinetic/aksoundengine/SoundBankIOInitalizerJavaClass\";\n\t\tIntPtr cls_JavaClass = JNI.FindClass(AkPackageClass);\n\t\tif ( cls_JavaClass == IntPtr.Zero )\n\t\t{\n\t\t\tDebug.LogError(\"WwiseUnity: Failed to find Java class. Check if plugin JAR file is available in Assets/Plugins/Android. Aborted.\");\n\t\t\treturn false;\n\t\t}\n\n\t\tint mid_JavaClass = JNI.GetMethodID(cls_JavaClass, \"<init>\", \"(Landroid/app/Activity;)V\");\n\n\t\tIntPtr obj_JavaClass = JNI.NewObject(cls_JavaClass, mid_JavaClass, obj_Activity);\n\n\n\t\t// Create a global reference to the JavaClass object and fetch method id(s)..\n\t\tIntPtr soundBankIOInitalizerJavaClass = JNI.NewGlobalRef(obj_JavaClass);\n\t\t\n\t\tstring methodName = \"LoadLibraryByArch\";\n\t\tint loadLibraryJavaMethodID = JNI.GetMethodID(cls_JavaClass, methodName, \"(I)I\");\n\t\tif ( loadLibraryJavaMethodID == 0 )\n\t\t{\n\t\t\tDebug.LogError(string.Format(\"WwiseUnity: Failed to find Java class method {0}. Check method name and signature in JNI query. Aborted.\", methodName));\n\t\t\treturn false;\n\t\t}\n\t\t\n// get the Java String object from the JavaClass object\n#if AK_ARCH_ANDROID_ARMEABI\n\t\tint archID = 1;\n#elif AK_ARCH_ANDROID_ARMEABIV7A\n\t\tint archID = 0;\n#else\n\t\tint archID = 0;\n#endif\n\t\tJNI.CallObjectMethod(soundBankIOInitalizerJavaClass, loadLibraryJavaMethodID, new IntPtr(archID));\n\t\t\n\t\tmethodName = \"SetAssetManager\";\n\t\tint setAssetManagerMethodID = JNI.GetMethodID(cls_JavaClass, methodName, \"()I\");\n\t\tif ( setAssetManagerMethodID == 0 )\n\t\t{\n\t\t\tDebug.LogError(string.Format(\"WwiseUnity: Failed to find Java class method {0}. Check method name and signature in JNI query. Aborted.\", methodName));\n\t\t\treturn false;\n\t\t}\t\t\n\n\t\t// get the Java String object from the JavaClass object\n\t\tIntPtr ret = JNI.CallObjectMethod(soundBankIOInitalizerJavaClass, setAssetManagerMethodID);\n\t\tif ( ret != IntPtr.Zero )\n\t\t{\n\t\t\tDebug.LogError(\"WwiseUnity: Failed to set AssetManager for Android SoundBank low-level IO handler. Aborted.\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t\t\n\t}\n\n\tvoid OnApplicationFocus(bool focus)\n\t{\n\t\tif (ms_Instance != null)\n\t\t{\n\t\t\tif ( focus )\n\t\t\t{\n\t\t\t\tuint id = AkSoundEngine.PostEvent(\"Resume_All_Global\", null);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tuint id = AkSoundEngine.PostEvent(\"Pause_All_Global\", null);\n\t\t\t}\n\n\t\t\tAkSoundEngine.RenderAudio();\n\t\t}\n\n\t}\n#endif\n\n#if UNITY_IOS && !UNITY_EDITOR\n\tpublic static object ms_interruptCallbackCookie = null;\n\tprivate static bool ms_isAudioSessionInterrupted = false;\n\n\t// WG-23508: This may not work reliably due to the Unity platform-switch uncertainty during compile time.\n\t// Add native C++ calls to the generated AppController.mm delegates instead.\n\t// See documentation Platform-specific Information section for detail.\n\tvoid OnApplicationPause(bool pause)\n\t{\n\t\tAkSoundEngine.ListenToAudioSessionInterruption(pause, false);\n\t}\n\n\tpublic static AKRESULT AppInterruptCallback(int in_iEnterInterruption, AKRESULT in_prevEngineStepResult, object in_Cookie)\n\t{\n\t\tif (in_iEnterInterruption != 0)\n\t\t{\n\t\t\tms_isAudioSessionInterrupted = true;\n\t\t\tDebug.Log(\"Wwise: iOS audio session is interrupted by another app. Tap device screen to restore app's audio.\");\n\t\t}\n\t\t\n\t\treturn AKRESULT.AK_Success;\n\t}\n\n\tvoid OnGUI()\n\t{\n\t\tif ( ms_isAudioSessionInterrupted && Input.touchCount > 0 ) \n\t\t{\n\t\t\tAKRESULT res = AkSoundEngine.ListenToAudioSessionInterruption(false, false);\n\t\t\tif (res == AKRESULT.AK_Success || res == AKRESULT.AK_Cancelled)\n\t\t\t{\n\t\t\t\tDebug.Log(\"Wwise: App audio restored or already restored.\");\n\t\t\t\tms_isAudioSessionInterrupted = false;\n\t\t\t}\n\t\t}\n\t}\n#endif // #if UNITY_IOS && !UNITY_EDITOR\n\n}\n"
  },
  {
    "path": "Wwise/AkGlobalSoundEngineTerminator.cs",
    "content": "//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.IO;\n#pragma warning disable 0219, 0414\n\n// This script deals with termination of the Wwise audio engine.  \n// It must be present on one Game Object that gets destroyed last in the game.\n// It must be executed AFTER any other monoBehaviors that use AkSoundEngine.\n// For more information about Wwise initialization and termination see the Wwise SDK doc:\n// Wwise SDK | Sound Engine Integration Walkthrough | Initialize the Different Modules of the Sound Engine \n// and also, check AK::SoundEngine::Init & Term.\npublic class AkGlobalSoundEngineTerminator : Component<BaseMain>\n{\n\tstatic private AkGlobalSoundEngineTerminator ms_Instance = null;\n\n\tpublic override void Awake()\n\t{\n\t\tbase.Awake();\n\t\tif (ms_Instance != null)\n\t\t\treturn; //Don't init twice\n\n\t\tms_Instance = this;\n\t\t// Do nothing. AkGlobalSoundEngineTerminator handles sound engine initialization.\n\t}\n\n\tpublic override void delete()\n\t{\n\t\tbase.delete();\n\t\tthis.Terminate();\n\t}\n\n\tpublic void Terminate()\n\t{\n\t\tif (ms_Instance == null)\n\t\t{\n\t\t\treturn; //Don't term twice\n\t\t}\n\n\t\t// NOTE: Do not check AkGlobalSoundEngine.IsInitialized()\n\t\t//  since its OnDestroy() has been called first in the project exec priority list.\n\t\tAkSoundEngine.Term();\n\t\tms_Instance = null;\n\n\t}\n\t \n}\n"
  },
  {
    "path": "Wwise/AkInMemBankLoader.cs",
    "content": "//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing ComponentBind;\nusing System.Collections.Generic;\nusing System.IO;\nusing System;\nusing System.Collections;\nusing System.Runtime.InteropServices;\n\npublic class AkBankLoader\n{\n\tpublic static string GetNonLocalizedBankPath(string filename)\n\t{\n\t\treturn Path.Combine(AkBankPath.GetPlatformBasePath(), filename);\n\t}\n\n\tpublic static string GetLocalizedBankPath(string filename)\n\t{\n\t\treturn Path.Combine(Path.Combine(AkBankPath.GetPlatformBasePath(), AkGlobalSoundEngineInitializer.GetCurrentLanguage()), filename);\n\t}\n\n\tpublic static AKRESULT LoadBank(string in_bankPath)\n\t{\n\t\tuint BankID;\n\n\t\tAKRESULT result = AkSoundEngine.LoadBank(in_bankPath, AkSoundEngine.AK_DEFAULT_POOL_ID, out BankID);\n\t\t\n\t\treturn result;\n\t}\n}\n"
  },
  {
    "path": "Wwise/AkListener.cs",
    "content": "//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing ComponentBind;\nusing Microsoft.Xna.Framework;\n\n//Add this script on the game object that represent an audio listener.  It will track its position in Wwise.\n//More information about Listeners in the Wwise SDK documentation : \n//Wwise SDK ﾻ Sound Engine Integration Walkthrough ﾻ Integrate Wwise Elements into Your Game ﾻ Integrating Listeners \npublic class AkListener : Component<BaseMain>, IUpdateableComponent\n{\n\tpublic Property<int> ListenerID = new Property<int>();\t//Wwise supports up to 8 listeners.  [0-7]\n\tpublic Property<Vector3> Position = new Property<Vector3>();\n\tpublic Property<Vector3> Forward = new Property<Vector3>();\n\tpublic Property<Vector3> Up = new Property<Vector3>();\n\n\tprivate Vector3 lastPosition;\n\tprivate Vector3 lastForward;\n\tprivate Vector3 lastUp;\n\t\n\tpublic void Update(float dt)\n\t{\n\t\tVector3 forward = -this.Forward.Value;\n\t\tVector3 up = this.Up;\n\t\tVector3 pos = this.Position;\n\t\tif (forward.Equals(this.lastForward) && up.Equals(this.lastUp) && pos.Equals(this.lastPosition))\n\t\t\treturn;\t// Position didn't change, no need to update.\n\n\t\t// Update position\n\t\tAkSoundEngine.SetListenerPosition(    \n\t\t\tforward.X,\n\t\t\tforward.Y, \n\t\t\tforward.Z,\n\t\t\tup.X,\n\t\t\tup.Y, \n\t\t\tup.Z,\n\t\t\tpos.X, \n\t\t\tpos.Y, \n\t\t\tpos.Z,\n#if UNITY_PS3 && !UNITY_EDITOR\n\t\t\t(ulong)this.ListenerID.Value);\n#else\n\t\t\t(uint)this.ListenerID.Value);\n#endif // #if UNITY_PS3\n\n\t\tthis.lastPosition = pos;\n\t\tthis.lastUp = up;\n\t\tthis.lastForward = forward;\n\t}\n}\n"
  },
  {
    "path": "Wwise/Generated/Common/AKRESULT.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AKRESULT {\n  AK_NotImplemented = 0,\n  AK_Success = 1,\n  AK_Fail = 2,\n  AK_PartialSuccess = 3,\n  AK_NotCompatible = 4,\n  AK_AlreadyConnected = 5,\n  AK_NameNotSet = 6,\n  AK_InvalidFile = 7,\n  AK_AudioFileHeaderTooLarge = 8,\n  AK_MaxReached = 9,\n  AK_InputsInUsed = 10,\n  AK_OutputsInUsed = 11,\n  AK_InvalidName = 12,\n  AK_NameAlreadyInUse = 13,\n  AK_InvalidID = 14,\n  AK_IDNotFound = 15,\n  AK_InvalidInstanceID = 16,\n  AK_NoMoreData = 17,\n  AK_NoSourceAvailable = 18,\n  AK_StateGroupAlreadyExists = 19,\n  AK_InvalidStateGroup = 20,\n  AK_ChildAlreadyHasAParent = 21,\n  AK_InvalidLanguage = 22,\n  AK_CannotAddItseflAsAChild = 23,\n  AK_TransitionNotFound = 24,\n  AK_TransitionNotStartable = 25,\n  AK_TransitionNotRemovable = 26,\n  AK_UsersListFull = 27,\n  AK_UserAlreadyInList = 28,\n  AK_UserNotInList = 29,\n  AK_NoTransitionPoint = 30,\n  AK_InvalidParameter = 31,\n  AK_ParameterAdjusted = 32,\n  AK_IsA3DSound = 33,\n  AK_NotA3DSound = 34,\n  AK_ElementAlreadyInList = 35,\n  AK_PathNotFound = 36,\n  AK_PathNoVertices = 37,\n  AK_PathNotRunning = 38,\n  AK_PathNotPaused = 39,\n  AK_PathNodeAlreadyInList = 40,\n  AK_PathNodeNotInList = 41,\n  AK_VoiceNotFound = 42,\n  AK_DataNeeded = 43,\n  AK_NoDataNeeded = 44,\n  AK_DataReady = 45,\n  AK_NoDataReady = 46,\n  AK_NoMoreSlotAvailable = 47,\n  AK_SlotNotFound = 48,\n  AK_ProcessingOnly = 49,\n  AK_MemoryLeak = 50,\n  AK_CorruptedBlockList = 51,\n  AK_InsufficientMemory = 52,\n  AK_Cancelled = 53,\n  AK_UnknownBankID = 54,\n  AK_IsProcessing = 55,\n  AK_BankReadError = 56,\n  AK_InvalidSwitchType = 57,\n  AK_VoiceDone = 58,\n  AK_UnknownEnvironment = 59,\n  AK_EnvironmentInUse = 60,\n  AK_UnknownObject = 61,\n  AK_NoConversionNeeded = 62,\n  AK_FormatNotReady = 63,\n  AK_WrongBankVersion = 64,\n  AK_DataReadyNoProcess = 65,\n  AK_FileNotFound = 66,\n  AK_DeviceNotReady = 67,\n  AK_CouldNotCreateSecBuffer = 68,\n  AK_BankAlreadyLoaded = 69,\n  AK_RenderedFX = 71,\n  AK_ProcessNeeded = 72,\n  AK_ProcessDone = 73,\n  AK_MemManagerNotInitialized = 74,\n  AK_StreamMgrNotInitialized = 75,\n  AK_SSEInstructionsNotSupported = 76,\n  AK_Busy = 77,\n  AK_UnsupportedChannelConfig = 78,\n  AK_PluginMediaNotAvailable = 79,\n  AK_MustBeVirtualized = 80,\n  AK_CommandTooLarge = 81\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkActionOnEventType.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkActionOnEventType {\n  AkActionOnEventType_Stop = 0,\n  AkActionOnEventType_Pause = 1,\n  AkActionOnEventType_Resume = 2,\n  AkActionOnEventType_Break = 3\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkArrayAllocatorAlignedSimd.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkArrayAllocatorAlignedSimd : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkArrayAllocatorAlignedSimd(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkArrayAllocatorAlignedSimd obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkArrayAllocatorAlignedSimd() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkArrayAllocatorAlignedSimd(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public static IntPtr Alloc(int in_poolId, uint in_uSize) { return AkSoundEnginePINVOKE.CSharp_AkArrayAllocatorAlignedSimd_Alloc(in_poolId, in_uSize); }\n\n  public static void Free(int in_poolId, IntPtr in_pAddress) {\n    AkSoundEnginePINVOKE.CSharp_AkArrayAllocatorAlignedSimd_Free(in_poolId, in_pAddress);\n\n  }\n\n  public AkArrayAllocatorAlignedSimd() : this(AkSoundEnginePINVOKE.CSharp_new_AkArrayAllocatorAlignedSimd(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkArrayAllocatorDefault.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkArrayAllocatorDefault : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkArrayAllocatorDefault(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkArrayAllocatorDefault obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkArrayAllocatorDefault() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkArrayAllocatorDefault(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public static IntPtr Alloc(int in_poolId, uint in_uSize) { return AkSoundEnginePINVOKE.CSharp_AkArrayAllocatorDefault_Alloc(in_poolId, in_uSize); }\n\n  public static void Free(int in_poolId, IntPtr in_pAddress) {\n    AkSoundEnginePINVOKE.CSharp_AkArrayAllocatorDefault_Free(in_poolId, in_pAddress);\n\n  }\n\n  public AkArrayAllocatorDefault() : this(AkSoundEnginePINVOKE.CSharp_new_AkArrayAllocatorDefault(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkAuxSendValue.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkAuxSendValue : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkAuxSendValue(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkAuxSendValue obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkAuxSendValue() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkAuxSendValue(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public uint auxBusID {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkAuxSendValue_auxBusID_set(swigCPtr, value);\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkAuxSendValue_auxBusID_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public float fControlValue {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkAuxSendValue_fControlValue_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkAuxSendValue_fControlValue_get(swigCPtr);\n      return ret;\n    } \n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkBankContent.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkBankContent {\n  AkBankContent_StructureOnly,\n  AkBankContent_All\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkCallbackSerializer.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkCallbackSerializer : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkCallbackSerializer(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkCallbackSerializer obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkCallbackSerializer() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkCallbackSerializer(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public static AKRESULT Init(IntPtr in_pMemory, uint in_uSize) {\n    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_AkCallbackSerializer_Init(in_pMemory, in_uSize);\n\n    return ret;\n  }\n\n  public static void Term() {\n    AkSoundEnginePINVOKE.CSharp_AkCallbackSerializer_Term();\n\n  }\n\n  public static IntPtr Lock() { return AkSoundEnginePINVOKE.CSharp_AkCallbackSerializer_Lock(); }\n\n  public static void SetLocalOutput(uint in_uErrorLevel) {\n    AkSoundEnginePINVOKE.CSharp_AkCallbackSerializer_SetLocalOutput(in_uErrorLevel);\n\n  }\n\n  public static void Unlock() {\n    AkSoundEnginePINVOKE.CSharp_AkCallbackSerializer_Unlock();\n\n  }\n\n  public AkCallbackSerializer() : this(AkSoundEnginePINVOKE.CSharp_new_AkCallbackSerializer(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkCallbackType.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkCallbackType {\n  AK_EndOfEvent = 0x0001,\n  AK_EndOfDynamicSequenceItem = 0x0002,\n  AK_Marker = 0x0004,\n  AK_Duration = 0x0008,\n  AK_SpeakerVolumeMatrix = 0x0010,\n  AK_MusicPlaylistSelect = 0x0040,\n  AK_MusicPlayStarted = 0x0080,\n  AK_MusicSyncBeat = 0x0100,\n  AK_MusicSyncBar = 0x0200,\n  AK_MusicSyncEntry = 0x0400,\n  AK_MusicSyncExit = 0x0800,\n  AK_MusicSyncGrid = 0x1000,\n  AK_MusicSyncUserCue = 0x2000,\n  AK_MusicSyncPoint = 0x4000,\n  AK_MusicSyncAll = 0xff00,\n  AK_CallbackBits = 0xffff,\n  AK_EnableGetSourcePlayPosition = 0x10000,\n  AK_EnableGetMusicPlayPosition = 0x20000,\n  AK_Monitoring = 0x20000000,\n  AK_Bank = 0x40000000,\n  AK_AudioInterruption = 0x22000000\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkChannelOrdering.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkChannelOrdering {\n  ChannelOrdering_Standard,\n  ChannelOrdering_RunTime\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkCurveInterpolation.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkCurveInterpolation {\n  AkCurveInterpolation_Log3 = 0,\n  AkCurveInterpolation_Sine = 1,\n  AkCurveInterpolation_Log1 = 2,\n  AkCurveInterpolation_InvSCurve = 3,\n  AkCurveInterpolation_Linear = 4,\n  AkCurveInterpolation_SCurve = 5,\n  AkCurveInterpolation_Exp1 = 6,\n  AkCurveInterpolation_SineRecip = 7,\n  AkCurveInterpolation_Exp3 = 8,\n  AkCurveInterpolation_LastFadeCurve = 8,\n  AkCurveInterpolation_Constant = 9\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkDeviceSettings.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkDeviceSettings : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkDeviceSettings(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkDeviceSettings obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkDeviceSettings() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkDeviceSettings(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public IntPtr pIOMemory { set { AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_pIOMemory_set(swigCPtr, value);\n }  get { return AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_pIOMemory_get(swigCPtr);\n }\n  }\n\n  public uint uIOMemorySize {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_uIOMemorySize_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_uIOMemorySize_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uIOMemoryAlignment {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_uIOMemoryAlignment_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_uIOMemoryAlignment_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public int ePoolAttributes { set { AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_ePoolAttributes_set(swigCPtr, value);\n }  get { return AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_ePoolAttributes_get(swigCPtr);\n } \n  }\n\n  public uint uGranularity {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_uGranularity_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_uGranularity_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uSchedulerTypeFlags {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_uSchedulerTypeFlags_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_uSchedulerTypeFlags_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkThreadProperties threadProperties {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_threadProperties_set(swigCPtr, AkThreadProperties.getCPtr(value));\n\n    } \n    get {\n      IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_threadProperties_get(swigCPtr);\n      AkThreadProperties ret = (cPtr == IntPtr.Zero) ? null : new AkThreadProperties(cPtr, false);\n\n      return ret;\n    } \n  }\n\n  public float fTargetAutoStmBufferLength {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uMaxConcurrentIO {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_uMaxConcurrentIO_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_uMaxConcurrentIO_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float fMaxCacheRatio {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_fMaxCacheRatio_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkDeviceSettings_fMaxCacheRatio_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkDeviceSettings() : this(AkSoundEnginePINVOKE.CSharp_new_AkDeviceSettings(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkExternalSourceInfo.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkExternalSourceInfo : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkExternalSourceInfo(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkExternalSourceInfo obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkExternalSourceInfo() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkExternalSourceInfo(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public uint iExternalSrcCookie {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_iExternalSrcCookie_set(swigCPtr, value);\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_iExternalSrcCookie_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public uint idCodec {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_idCodec_set(swigCPtr, value);\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_idCodec_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public string szFile {\tset { AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_szFile_set(swigCPtr, value); }  get { return AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_szFile_get(swigCPtr); } \n  }\n\n  public IntPtr pInMemory { set { AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_pInMemory_set(swigCPtr, value); }  get { return AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_pInMemory_get(swigCPtr); }\n  }\n\n  public uint uiMemorySize {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_uiMemorySize_set(swigCPtr, value);\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_uiMemorySize_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public uint idFile {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_idFile_set(swigCPtr, value);\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkExternalSourceInfo_idFile_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public AkExternalSourceInfo() : this(AkSoundEnginePINVOKE.CSharp_new_AkExternalSourceInfo__SWIG_0(), true) {\n  }\n\n  public AkExternalSourceInfo(IntPtr in_pInMemory, uint in_uiMemorySize, uint in_iExternalSrcCookie, uint in_idCodec) : this(AkSoundEnginePINVOKE.CSharp_new_AkExternalSourceInfo__SWIG_1(in_pInMemory, in_uiMemorySize, in_iExternalSrcCookie, in_idCodec), true) {\n  }\n\n  public AkExternalSourceInfo(string in_pszFileName, uint in_iExternalSrcCookie, uint in_idCodec) : this(AkSoundEnginePINVOKE.CSharp_new_AkExternalSourceInfo__SWIG_2(in_pszFileName, in_iExternalSrcCookie, in_idCodec), true) {\n  }\n\n  public AkExternalSourceInfo(uint in_idFile, uint in_iExternalSrcCookie, uint in_idCodec) : this(AkSoundEnginePINVOKE.CSharp_new_AkExternalSourceInfo__SWIG_3(in_idFile, in_iExternalSrcCookie, in_idCodec), true) {\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkGroupType.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkGroupType {\n  AkGroupType_Switch = 0,\n  AkGroupType_State = 1\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkInitSettings.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkInitSettings : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkInitSettings(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkInitSettings obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkInitSettings() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkInitSettings(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public int pfnAssertHook { set { } get { return 0; }\n  }\n\n  public uint uMaxNumPaths {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_uMaxNumPaths_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkInitSettings_uMaxNumPaths_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uMaxNumTransitions {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_uMaxNumTransitions_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkInitSettings_uMaxNumTransitions_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uDefaultPoolSize {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_uDefaultPoolSize_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkInitSettings_uDefaultPoolSize_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float fDefaultPoolRatioThreshold {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_fDefaultPoolRatioThreshold_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkInitSettings_fDefaultPoolRatioThreshold_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uCommandQueueSize {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_uCommandQueueSize_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkInitSettings_uCommandQueueSize_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public int uPrepareEventMemoryPoolID {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_uPrepareEventMemoryPoolID_set(swigCPtr, value);\n\n    } \n    get {\n      int ret = AkSoundEnginePINVOKE.CSharp_AkInitSettings_uPrepareEventMemoryPoolID_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public bool bEnableGameSyncPreparation {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_bEnableGameSyncPreparation_set(swigCPtr, value);\n\n    } \n    get {\n      bool ret = AkSoundEnginePINVOKE.CSharp_AkInitSettings_bEnableGameSyncPreparation_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uContinuousPlaybackLookAhead {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_uContinuousPlaybackLookAhead_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkInitSettings_uContinuousPlaybackLookAhead_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uMonitorPoolSize {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_uMonitorPoolSize_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkInitSettings_uMonitorPoolSize_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uMonitorQueuePoolSize {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_uMonitorQueuePoolSize_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkInitSettings_uMonitorQueuePoolSize_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkSinkType eMainOutputType {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_eMainOutputType_set(swigCPtr, (int)value);\n\n    } \n    get {\n      AkSinkType ret = (AkSinkType)AkSoundEnginePINVOKE.CSharp_AkInitSettings_eMainOutputType_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkOutputSettings settingsMainOutput {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkInitSettings_settingsMainOutput_set(swigCPtr, AkOutputSettings.getCPtr(value));\n\n    } \n    get {\n      IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkInitSettings_settingsMainOutput_get(swigCPtr);\n      AkOutputSettings ret = (cPtr == IntPtr.Zero) ? null : new AkOutputSettings(cPtr, false);\n\n      return ret;\n    } \n  }\n\n  public AkInitSettings() : this(AkSoundEnginePINVOKE.CSharp_new_AkInitSettings(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkListenerPosition.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkListenerPosition : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkListenerPosition(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkListenerPosition obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkListenerPosition() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkListenerPosition(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public AkVector OrientationFront {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkListenerPosition_OrientationFront_set(swigCPtr, AkVector.getCPtr(value));\n    } \n    get {\n      IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkListenerPosition_OrientationFront_get(swigCPtr);\n      AkVector ret = (cPtr == IntPtr.Zero) ? null : new AkVector(cPtr, false);\n      return ret;\n    } \n  }\n\n  public AkVector OrientationTop {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkListenerPosition_OrientationTop_set(swigCPtr, AkVector.getCPtr(value));\n    } \n    get {\n      IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkListenerPosition_OrientationTop_get(swigCPtr);\n      AkVector ret = (cPtr == IntPtr.Zero) ? null : new AkVector(cPtr, false);\n      return ret;\n    } \n  }\n\n  public AkVector Position {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkListenerPosition_Position_set(swigCPtr, AkVector.getCPtr(value));\n    } \n    get {\n      IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkListenerPosition_Position_get(swigCPtr);\n      AkVector ret = (cPtr == IntPtr.Zero) ? null : new AkVector(cPtr, false);\n      return ret;\n    } \n  }\n\n  public AkListenerPosition() : this(AkSoundEnginePINVOKE.CSharp_new_AkListenerPosition(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkMemSettings.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkMemSettings : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkMemSettings(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkMemSettings obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkMemSettings() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkMemSettings(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public uint uMaxNumPools {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkMemSettings_uMaxNumPools_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkMemSettings_uMaxNumPools_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkMemSettings() : this(AkSoundEnginePINVOKE.CSharp_new_AkMemSettings(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkMusicPlaylistCallbackInfo.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkMusicPlaylistCallbackInfo : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkMusicPlaylistCallbackInfo(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkMusicPlaylistCallbackInfo obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkMusicPlaylistCallbackInfo() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkMusicPlaylistCallbackInfo(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public uint playlistID {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkMusicPlaylistCallbackInfo_playlistID_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkMusicPlaylistCallbackInfo_playlistID_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uNumPlaylistItems {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkMusicPlaylistCallbackInfo_uNumPlaylistItems_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkMusicPlaylistCallbackInfo_uNumPlaylistItems_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uPlaylistSelection {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkMusicPlaylistCallbackInfo_uPlaylistSelection_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkMusicPlaylistCallbackInfo_uPlaylistSelection_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uPlaylistItemDone {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkMusicPlaylistCallbackInfo_uPlaylistItemDone_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkMusicPlaylistCallbackInfo_uPlaylistItemDone_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkMusicPlaylistCallbackInfo() : this(AkSoundEnginePINVOKE.CSharp_new_AkMusicPlaylistCallbackInfo(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkMusicSettings.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkMusicSettings : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkMusicSettings(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkMusicSettings obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkMusicSettings() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkMusicSettings(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public float fStreamingLookAheadRatio {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkMusicSettings_fStreamingLookAheadRatio_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkMusicSettings_fStreamingLookAheadRatio_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkMusicSettings() : this(AkSoundEnginePINVOKE.CSharp_new_AkMusicSettings(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkNodeType.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkNodeType {\n  AkNodeType_Default,\n  AkNodeType_Bus\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkObjectInfo.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkObjectInfo : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkObjectInfo(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkObjectInfo obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkObjectInfo() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkObjectInfo(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public uint objID {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkObjectInfo_objID_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkObjectInfo_objID_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint parentID {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkObjectInfo_parentID_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkObjectInfo_parentID_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public int iDepth {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkObjectInfo_iDepth_set(swigCPtr, value);\n\n    } \n    get {\n      int ret = AkSoundEnginePINVOKE.CSharp_AkObjectInfo_iDepth_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkObjectInfo() : this(AkSoundEnginePINVOKE.CSharp_new_AkObjectInfo(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkOutputSettings.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkOutputSettings : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkOutputSettings(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkOutputSettings obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkOutputSettings() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkOutputSettings(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public AkPanningRule ePanningRule {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkOutputSettings_ePanningRule_set(swigCPtr, (int)value);\n\n    } \n    get {\n      AkPanningRule ret = (AkPanningRule)AkSoundEnginePINVOKE.CSharp_AkOutputSettings_ePanningRule_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uChannelMask {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkOutputSettings_uChannelMask_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkOutputSettings_uChannelMask_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkOutputSettings() : this(AkSoundEnginePINVOKE.CSharp_new_AkOutputSettings(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkPannerType.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkPannerType {\n  Ak2D = 0,\n  Ak3D = 1\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkPanningRule.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkPanningRule {\n  AkPanningRule_Speakers = 0,\n  AkPanningRule_Headphones = 1\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkPlaylistArray.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkPlaylistArray : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkPlaylistArray(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkPlaylistArray obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkPlaylistArray() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkPlaylistArray(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public AkPlaylistArray() : this(AkSoundEnginePINVOKE.CSharp_new_AkPlaylistArray(), true) {\n\n  }\n\n  public Iterator Begin() {\n    Iterator ret = new Iterator(AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Begin(swigCPtr), true);\n\n    return ret;\n  }\n\n  public Iterator End() {\n    Iterator ret = new Iterator(AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_End(swigCPtr), true);\n\n    return ret;\n  }\n\n  public Iterator FindEx(PlaylistItem in_Item) {\n    Iterator ret = new Iterator(AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_FindEx(swigCPtr, PlaylistItem.getCPtr(in_Item)), true);\n\n    return ret;\n  }\n\n  public Iterator Erase(Iterator in_rIter) {\n    Iterator ret = new Iterator(AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Erase__SWIG_0(swigCPtr, Iterator.getCPtr(in_rIter)), true);\n\n    return ret;\n  }\n\n  public void Erase(uint in_uIndex) {\n    AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Erase__SWIG_1(swigCPtr, in_uIndex);\n\n  }\n\n  public Iterator EraseSwap(Iterator in_rIter) {\n    Iterator ret = new Iterator(AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_EraseSwap(swigCPtr, Iterator.getCPtr(in_rIter)), true);\n\n    return ret;\n  }\n\n  public AKRESULT Reserve(uint in_ulReserve) {\n    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Reserve(swigCPtr, in_ulReserve);\n\n    return ret;\n  }\n\n  public uint Reserved() {\n    uint ret = AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Reserved(swigCPtr);\n\n    return ret;\n  }\n\n  public void Term() {\n    AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Term(swigCPtr);\n\n  }\n\n  public uint Length() {\n    uint ret = AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Length(swigCPtr);\n\n    return ret;\n  }\n\n  public bool IsEmpty() {\n    bool ret = AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_IsEmpty(swigCPtr);\n\n    return ret;\n  }\n\n  public PlaylistItem Exists(PlaylistItem in_Item) {\n    IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Exists(swigCPtr, PlaylistItem.getCPtr(in_Item));\n    PlaylistItem ret = (cPtr == IntPtr.Zero) ? null : new PlaylistItem(cPtr, false);\n\n    return ret;\n  }\n\n  public PlaylistItem AddLast() {\n    IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_AddLast__SWIG_0(swigCPtr);\n    PlaylistItem ret = (cPtr == IntPtr.Zero) ? null : new PlaylistItem(cPtr, false);\n\n    return ret;\n  }\n\n  public PlaylistItem AddLast(PlaylistItem in_rItem) {\n    IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_AddLast__SWIG_1(swigCPtr, PlaylistItem.getCPtr(in_rItem));\n    PlaylistItem ret = (cPtr == IntPtr.Zero) ? null : new PlaylistItem(cPtr, false);\n\n    return ret;\n  }\n\n  public PlaylistItem Last() {\n    PlaylistItem ret = new PlaylistItem(AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Last(swigCPtr), false);\n\n    return ret;\n  }\n\n  public void RemoveLast() {\n    AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_RemoveLast(swigCPtr);\n\n  }\n\n  public AKRESULT Remove(PlaylistItem in_rItem) {\n    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Remove(swigCPtr, PlaylistItem.getCPtr(in_rItem));\n\n    return ret;\n  }\n\n  public AKRESULT RemoveSwap(PlaylistItem in_rItem) {\n    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_RemoveSwap(swigCPtr, PlaylistItem.getCPtr(in_rItem));\n\n    return ret;\n  }\n\n  public void RemoveAll() {\n    AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_RemoveAll(swigCPtr);\n\n  }\n\n  public PlaylistItem ItemAtIndex(uint uiIndex) {\n    PlaylistItem ret = new PlaylistItem(AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_ItemAtIndex(swigCPtr, uiIndex), false);\n\n    return ret;\n  }\n\n  public PlaylistItem Insert(uint in_uIndex) {\n    IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Insert(swigCPtr, in_uIndex);\n    PlaylistItem ret = (cPtr == IntPtr.Zero) ? null : new PlaylistItem(cPtr, false);\n\n    return ret;\n  }\n\n  public bool GrowArray(uint in_uGrowBy) {\n    bool ret = AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_GrowArray__SWIG_0(swigCPtr, in_uGrowBy);\n\n    return ret;\n  }\n\n  public bool GrowArray() {\n    bool ret = AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_GrowArray__SWIG_1(swigCPtr);\n\n    return ret;\n  }\n\n  public bool Resize(uint in_uiSize) {\n    bool ret = AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Resize(swigCPtr, in_uiSize);\n\n    return ret;\n  }\n\n  public void Transfer(AkPlaylistArray in_rSource) {\n    AkSoundEnginePINVOKE.CSharp_AkPlaylistArray_Transfer(swigCPtr, AkPlaylistArray.getCPtr(in_rSource));\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkPositionSourceType.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkPositionSourceType {\n  AkUserDef = 0,\n  AkGameDef = 1\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkPositioningInfo.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkPositioningInfo : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkPositioningInfo(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkPositioningInfo obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkPositioningInfo() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkPositioningInfo(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public float fCenterPct {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fCenterPct_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fCenterPct_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkPannerType pannerType {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_pannerType_set(swigCPtr, (int)value);\n\n    } \n    get {\n      AkPannerType ret = (AkPannerType)AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_pannerType_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkPositionSourceType posSourceType {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_posSourceType_set(swigCPtr, (int)value);\n\n    } \n    get {\n      AkPositionSourceType ret = (AkPositionSourceType)AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_posSourceType_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public bool bUpdateEachFrame {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_bUpdateEachFrame_set(swigCPtr, value);\n\n    } \n    get {\n      bool ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_bUpdateEachFrame_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public bool bUseSpatialization {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_bUseSpatialization_set(swigCPtr, value);\n\n    } \n    get {\n      bool ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_bUseSpatialization_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public bool bUseAttenuation {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_bUseAttenuation_set(swigCPtr, value);\n\n    } \n    get {\n      bool ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_bUseAttenuation_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public bool bUseConeAttenuation {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_bUseConeAttenuation_set(swigCPtr, value);\n\n    } \n    get {\n      bool ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_bUseConeAttenuation_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float fInnerAngle {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fInnerAngle_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fInnerAngle_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float fOuterAngle {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fOuterAngle_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fOuterAngle_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float fConeMaxAttenuation {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fConeMaxAttenuation_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fConeMaxAttenuation_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float LPFCone {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_LPFCone_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_LPFCone_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float fMaxDistance {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fMaxDistance_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fMaxDistance_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float fVolDryAtMaxDist {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fVolDryAtMaxDist_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fVolDryAtMaxDist_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float fVolAuxGameDefAtMaxDist {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float fVolAuxUserDefAtMaxDist {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float LPFValueAtMaxDist {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_LPFValueAtMaxDist_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkPositioningInfo_LPFValueAtMaxDist_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkPositioningInfo() : this(AkSoundEnginePINVOKE.CSharp_new_AkPositioningInfo(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkSegmentInfo.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkSegmentInfo : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkSegmentInfo(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkSegmentInfo obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkSegmentInfo() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkSegmentInfo(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public int iCurrentPosition {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSegmentInfo_iCurrentPosition_set(swigCPtr, value);\n\n    } \n    get {\n      int ret = AkSoundEnginePINVOKE.CSharp_AkSegmentInfo_iCurrentPosition_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public int iPreEntryDuration {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSegmentInfo_iPreEntryDuration_set(swigCPtr, value);\n\n    } \n    get {\n      int ret = AkSoundEnginePINVOKE.CSharp_AkSegmentInfo_iPreEntryDuration_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public int iActiveDuration {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSegmentInfo_iActiveDuration_set(swigCPtr, value);\n\n    } \n    get {\n      int ret = AkSoundEnginePINVOKE.CSharp_AkSegmentInfo_iActiveDuration_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public int iPostExitDuration {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSegmentInfo_iPostExitDuration_set(swigCPtr, value);\n\n    } \n    get {\n      int ret = AkSoundEnginePINVOKE.CSharp_AkSegmentInfo_iPostExitDuration_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public int iRemainingLookAheadTime {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSegmentInfo_iRemainingLookAheadTime_set(swigCPtr, value);\n\n    } \n    get {\n      int ret = AkSoundEnginePINVOKE.CSharp_AkSegmentInfo_iRemainingLookAheadTime_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkSegmentInfo() : this(AkSoundEnginePINVOKE.CSharp_new_AkSegmentInfo(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkSoundPosition.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkSoundPosition : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkSoundPosition(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkSoundPosition obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkSoundPosition() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkSoundPosition(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public AkVector Position {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSoundPosition_Position_set(swigCPtr, AkVector.getCPtr(value));\n    } \n    get {\n      IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkSoundPosition_Position_get(swigCPtr);\n      AkVector ret = (cPtr == IntPtr.Zero) ? null : new AkVector(cPtr, false);\n      return ret;\n    } \n  }\n\n  public AkVector Orientation {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSoundPosition_Orientation_set(swigCPtr, AkVector.getCPtr(value));\n    } \n    get {\n      IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkSoundPosition_Orientation_get(swigCPtr);\n      AkVector ret = (cPtr == IntPtr.Zero) ? null : new AkVector(cPtr, false);\n      return ret;\n    } \n  }\n\n  public AkSoundPosition() : this(AkSoundEnginePINVOKE.CSharp_new_AkSoundPosition(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkStreamMgrSettings.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkStreamMgrSettings : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkStreamMgrSettings(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkStreamMgrSettings obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkStreamMgrSettings() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkStreamMgrSettings(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public uint uMemorySize {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkStreamMgrSettings_uMemorySize_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkStreamMgrSettings_uMemorySize_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkStreamMgrSettings() : this(AkSoundEnginePINVOKE.CSharp_new_AkStreamMgrSettings(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkVector.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkVector : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkVector(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkVector obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkVector() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkVector(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public float X {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkVector_X_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkVector_X_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public float Y {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkVector_Y_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkVector_Y_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public float Z {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkVector_Z_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkVector_Z_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public AkVector() : this(AkSoundEnginePINVOKE.CSharp_new_AkVector(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/AkVolumeOffset.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkVolumeOffset : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkVolumeOffset(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkVolumeOffset obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkVolumeOffset() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkVolumeOffset(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public float fNext {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkVolumeOffset_fNext_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkVolumeOffset_fNext_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public float fPrev {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkVolumeOffset_fPrev_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkVolumeOffset_fPrev_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public AkVolumeOffset() : this(AkSoundEnginePINVOKE.CSharp_new_AkVolumeOffset(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/ArrayPoolDefault.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class ArrayPoolDefault : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal ArrayPoolDefault(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(ArrayPoolDefault obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~ArrayPoolDefault() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_ArrayPoolDefault(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public static int Get() {\n    int ret = AkSoundEnginePINVOKE.CSharp_ArrayPoolDefault_Get();\n\n    return ret;\n  }\n\n  public ArrayPoolDefault() : this(AkSoundEnginePINVOKE.CSharp_new_ArrayPoolDefault(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/ArrayPoolLEngineDefault.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class ArrayPoolLEngineDefault : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal ArrayPoolLEngineDefault(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(ArrayPoolLEngineDefault obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~ArrayPoolLEngineDefault() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_ArrayPoolLEngineDefault(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public static int Get() {\n    int ret = AkSoundEnginePINVOKE.CSharp_ArrayPoolLEngineDefault_Get();\n\n    return ret;\n  }\n\n  public ArrayPoolLEngineDefault() : this(AkSoundEnginePINVOKE.CSharp_new_ArrayPoolLEngineDefault(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/DynamicSequenceType.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum DynamicSequenceType {\n  DynamicSequenceType_SampleAccurate,\n  DynamicSequenceType_NormalTransition\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/EnvelopePoint.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class EnvelopePoint : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal EnvelopePoint(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(EnvelopePoint obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~EnvelopePoint() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_EnvelopePoint(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public uint uPosition {\n    set {\n      AkSoundEnginePINVOKE.CSharp_EnvelopePoint_uPosition_set(swigCPtr, value);\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_EnvelopePoint_uPosition_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public ushort uAttenuation {\n    set {\n      AkSoundEnginePINVOKE.CSharp_EnvelopePoint_uAttenuation_set(swigCPtr, value);\n    } \n    get {\n      ushort ret = AkSoundEnginePINVOKE.CSharp_EnvelopePoint_uAttenuation_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public EnvelopePoint() : this(AkSoundEnginePINVOKE.CSharp_new_EnvelopePoint(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/ErrorCode.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum ErrorCode {\n  ErrorCode_NoError = 0,\n  ErrorCode_FileNotFound,\n  ErrorCode_CannotOpenFile,\n  ErrorCode_CannotStartStreamNoMemory,\n  ErrorCode_IODevice,\n  ErrorCode_IncompatibleIOSettings,\n  ErrorCode_PluginUnsupportedChannelConfiguration,\n  ErrorCode_PluginMediaUnavailable,\n  ErrorCode_PluginInitialisationFailed,\n  ErrorCode_PluginProcessingFailed,\n  ErrorCode_PluginExecutionInvalid,\n  ErrorCode_PluginAllocationFailed,\n  ErrorCode_VorbisRequireSeekTable,\n  ErrorCode_VorbisRequireSeekTableVirtual,\n  ErrorCode_VorbisDecodeError,\n  ErrorCode_AACDecodeError,\n  ErrorCode_xWMACreateDecoderFailed,\n  ErrorCode_ATRAC9CreateDecoderFailed,\n  ErrorCode_ATRAC9CreateDecoderFailedChShortage,\n  ErrorCode_ATRAC9DecodeFailed,\n  ErrorCode_ATRAC9ClearContextFailed,\n  ErrorCode_InvalidAudioFileHeader,\n  ErrorCode_AudioFileHeaderTooLarge,\n  ErrorCode_FileTooSmall,\n  ErrorCode_TransitionNotAccurateChannel,\n  ErrorCode_TransitionNotAccurateStarvation,\n  ErrorCode_NothingToPlay,\n  ErrorCode_PlayFailed,\n  ErrorCode_StingerCouldNotBeScheduled,\n  ErrorCode_TooLongSegmentLookAhead,\n  ErrorCode_CannotScheduleMusicSwitch,\n  ErrorCode_TooManySimultaneousMusicSegments,\n  ErrorCode_PlaylistStoppedForEditing,\n  ErrorCode_MusicClipsRescheduledAfterTrackEdit,\n  ErrorCode_CannotPlaySource_Create,\n  ErrorCode_CannotPlaySource_VirtualOff,\n  ErrorCode_CannotPlaySource_TimeSkip,\n  ErrorCode_CannotPlaySource_InconsistentState,\n  ErrorCode_MediaNotLoaded,\n  ErrorCode_VoiceStarving,\n  ErrorCode_StreamingSourceStarving,\n  ErrorCode_XMADecoderSourceStarving,\n  ErrorCode_PluginNotRegistered,\n  ErrorCode_CodecNotRegistered,\n  ErrorCode_EventIDNotFound,\n  ErrorCode_InvalidGroupID,\n  ErrorCode_SelectedChildNotAvailable,\n  ErrorCode_SelectedNodeNotAvailable,\n  ErrorCode_SelectedMediaNotAvailable,\n  ErrorCode_NoValidSwitch,\n  ErrorCode_SelectedNodeNotAvailablePlay,\n  ErrorCode_FeedbackVoiceStarving,\n  ErrorCode_BankLoadFailed,\n  ErrorCode_BankUnloadFailed,\n  ErrorCode_ErrorWhileLoadingBank,\n  ErrorCode_InsufficientSpaceToLoadBank,\n  ErrorCode_LowerEngineCommandListFull,\n  ErrorCode_SeekNoMarker,\n  ErrorCode_CannotSeekContinuous,\n  ErrorCode_SeekAfterEof,\n  ErrorCode_UnknownGameObjectEvent,\n  ErrorCode_UnknownGameObject,\n  ErrorCode_ExternalSourceNotResolved,\n  ErrorCode_FileFormatMismatch,\n  ErrorCode_CommandQueueFull,\n  ErrorCode_CommandTooLarge,\n  ErrorCode_ExecuteActionOnEvent,\n  ErrorCode_StopAll,\n  ErrorCode_StopPlayingID,\n  ErrorCode_XMACreateDecoderLimitReached,\n  Num_ErrorCodes\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/ErrorLevel.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum ErrorLevel {\n  ErrorLevel_Message = (1 << 0),\n  ErrorLevel_Error = (1 << 1),\n  ErrorLevel_All = ErrorLevel_Message|ErrorLevel_Error\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/Iterator.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class Iterator : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal Iterator(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(Iterator obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~Iterator() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_Iterator(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public PlaylistItem pItem {\n    set {\n      AkSoundEnginePINVOKE.CSharp_Iterator_pItem_set(swigCPtr, PlaylistItem.getCPtr(value));\n\n    } \n    get {\n      IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_Iterator_pItem_get(swigCPtr);\n      PlaylistItem ret = (cPtr == IntPtr.Zero) ? null : new PlaylistItem(cPtr, false);\n\n      return ret;\n    } \n  }\n\n  public Iterator NextIter() {\n    Iterator ret = new Iterator(AkSoundEnginePINVOKE.CSharp_Iterator_NextIter(swigCPtr), false);\n\n    return ret;\n  }\n\n  public Iterator PrevIter() {\n    Iterator ret = new Iterator(AkSoundEnginePINVOKE.CSharp_Iterator_PrevIter(swigCPtr), false);\n\n    return ret;\n  }\n\n  public PlaylistItem GetItem() {\n    PlaylistItem ret = new PlaylistItem(AkSoundEnginePINVOKE.CSharp_Iterator_GetItem(swigCPtr), false);\n\n    return ret;\n  }\n\n  public bool IsEqualTo(Iterator in_rOp) {\n    bool ret = AkSoundEnginePINVOKE.CSharp_Iterator_IsEqualTo(swigCPtr, Iterator.getCPtr(in_rOp));\n\n    return ret;\n  }\n\n  public bool IsDifferentFrom(Iterator in_rOp) {\n    bool ret = AkSoundEnginePINVOKE.CSharp_Iterator_IsDifferentFrom(swigCPtr, Iterator.getCPtr(in_rOp));\n\n    return ret;\n  }\n\n  public Iterator() : this(AkSoundEnginePINVOKE.CSharp_new_Iterator(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/MultiPositionType.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum MultiPositionType {\n  MultiPositionType_SingleSource,\n  MultiPositionType_MultiSources,\n  MultiPositionType_MultiDirections\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/Playlist.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class Playlist : AkPlaylistArray {\n  private HandleRef swigCPtr;\n\n  internal Playlist(IntPtr cPtr, bool cMemoryOwn) : base(AkSoundEnginePINVOKE.CSharp_Playlist_SWIGUpcast(cPtr), cMemoryOwn) {\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(Playlist obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~Playlist() {\n    Dispose();\n  }\n\n  public override void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_Playlist(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n      base.Dispose();\n    }\n  }\n\n  public AKRESULT Enqueue(uint in_audioNodeID, int in_msDelay, IntPtr in_pCustomInfo, uint in_cExternals, AkExternalSourceInfo in_pExternalSources) {\n    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_Playlist_Enqueue__SWIG_0(swigCPtr, in_audioNodeID, in_msDelay, in_pCustomInfo, in_cExternals, AkExternalSourceInfo.getCPtr(in_pExternalSources));\n\n    return ret;\n  }\n\n  public AKRESULT Enqueue(uint in_audioNodeID, int in_msDelay, IntPtr in_pCustomInfo, uint in_cExternals) {\n    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_Playlist_Enqueue__SWIG_1(swigCPtr, in_audioNodeID, in_msDelay, in_pCustomInfo, in_cExternals);\n\n    return ret;\n  }\n\n  public AKRESULT Enqueue(uint in_audioNodeID, int in_msDelay, IntPtr in_pCustomInfo) {\n    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_Playlist_Enqueue__SWIG_2(swigCPtr, in_audioNodeID, in_msDelay, in_pCustomInfo);\n\n    return ret;\n  }\n\n  public AKRESULT Enqueue(uint in_audioNodeID, int in_msDelay) {\n    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_Playlist_Enqueue__SWIG_3(swigCPtr, in_audioNodeID, in_msDelay);\n\n    return ret;\n  }\n\n  public AKRESULT Enqueue(uint in_audioNodeID) {\n    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_Playlist_Enqueue__SWIG_4(swigCPtr, in_audioNodeID);\n\n    return ret;\n  }\n\n  public Playlist() : this(AkSoundEnginePINVOKE.CSharp_new_Playlist(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/PlaylistItem.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class PlaylistItem : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal PlaylistItem(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(PlaylistItem obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~PlaylistItem() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_PlaylistItem(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public PlaylistItem() : this(AkSoundEnginePINVOKE.CSharp_new_PlaylistItem__SWIG_0(), true) {\n\n  }\n\n  public PlaylistItem(PlaylistItem in_rCopy) : this(AkSoundEnginePINVOKE.CSharp_new_PlaylistItem__SWIG_1(PlaylistItem.getCPtr(in_rCopy)), true) {\n\n  }\n\n  public PlaylistItem Assign(PlaylistItem in_rCopy) {\n    PlaylistItem ret = new PlaylistItem(AkSoundEnginePINVOKE.CSharp_PlaylistItem_Assign(swigCPtr, PlaylistItem.getCPtr(in_rCopy)), false);\n\n    return ret;\n  }\n\n  public bool IsEqualTo(PlaylistItem in_rCopy) {\n    bool ret = AkSoundEnginePINVOKE.CSharp_PlaylistItem_IsEqualTo(swigCPtr, PlaylistItem.getCPtr(in_rCopy));\n\n    return ret;\n  }\n\n  public AKRESULT SetExternalSources(uint in_nExternalSrc, AkExternalSourceInfo in_pExternalSrc) {\n    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PlaylistItem_SetExternalSources(swigCPtr, in_nExternalSrc, AkExternalSourceInfo.getCPtr(in_pExternalSrc));\n\n    return ret;\n  }\n\n  public uint audioNodeID {\n    set {\n      AkSoundEnginePINVOKE.CSharp_PlaylistItem_audioNodeID_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_PlaylistItem_audioNodeID_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public int msDelay {\n    set {\n      AkSoundEnginePINVOKE.CSharp_PlaylistItem_msDelay_set(swigCPtr, value);\n\n    } \n    get {\n      int ret = AkSoundEnginePINVOKE.CSharp_PlaylistItem_msDelay_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public IntPtr pCustomInfo { set { AkSoundEnginePINVOKE.CSharp_PlaylistItem_pCustomInfo_set(swigCPtr, value);\n }  get { return AkSoundEnginePINVOKE.CSharp_PlaylistItem_pCustomInfo_get(swigCPtr);\n }\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/PreparationType.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum PreparationType {\n  Preparation_Load,\n  Preparation_Unload\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/RTPCValue_type.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum RTPCValue_type {\n  RTPCValue_Default,\n  RTPCValue_Global,\n  RTPCValue_GameObject,\n  RTPCValue_Unavailable\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/WwiseObjectID.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class WwiseObjectID : WwiseObjectIDext {\n  private HandleRef swigCPtr;\n\n  internal WwiseObjectID(IntPtr cPtr, bool cMemoryOwn) : base(AkSoundEnginePINVOKE.CSharp_WwiseObjectID_SWIGUpcast(cPtr), cMemoryOwn) {\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(WwiseObjectID obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~WwiseObjectID() {\n    Dispose();\n  }\n\n  public override void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_WwiseObjectID(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n      base.Dispose();\n    }\n  }\n\n  public WwiseObjectID() : this(AkSoundEnginePINVOKE.CSharp_new_WwiseObjectID__SWIG_0(), true) {\n  }\n\n  public WwiseObjectID(uint in_ID) : this(AkSoundEnginePINVOKE.CSharp_new_WwiseObjectID__SWIG_1(in_ID), true) {\n  }\n\n  public WwiseObjectID(uint in_ID, bool in_bIsBus) : this(AkSoundEnginePINVOKE.CSharp_new_WwiseObjectID__SWIG_2(in_ID, in_bIsBus), true) {\n  }\n\n  public WwiseObjectID(uint in_ID, AkNodeType in_eNodeType) : this(AkSoundEnginePINVOKE.CSharp_new_WwiseObjectID__SWIG_3(in_ID, (int)in_eNodeType), true) {\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Common/WwiseObjectIDext.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class WwiseObjectIDext : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal WwiseObjectIDext(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(WwiseObjectIDext obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~WwiseObjectIDext() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_WwiseObjectIDext(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public bool IsEqualTo(WwiseObjectIDext in_rOther) {\n    bool ret = AkSoundEnginePINVOKE.CSharp_WwiseObjectIDext_IsEqualTo(swigCPtr, WwiseObjectIDext.getCPtr(in_rOther));\n\n    return ret;\n  }\n\n  public AkNodeType GetNodeType() {\n    AkNodeType ret = (AkNodeType)AkSoundEnginePINVOKE.CSharp_WwiseObjectIDext_GetNodeType(swigCPtr);\n    return ret;\n  }\n\n  public uint id {\n    set {\n      AkSoundEnginePINVOKE.CSharp_WwiseObjectIDext_id_set(swigCPtr, value);\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_WwiseObjectIDext_id_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public bool bIsBus {\n    set {\n      AkSoundEnginePINVOKE.CSharp_WwiseObjectIDext_bIsBus_set(swigCPtr, value);\n    } \n    get {\n      bool ret = AkSoundEnginePINVOKE.CSharp_WwiseObjectIDext_bIsBus_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public WwiseObjectIDext() : this(AkSoundEnginePINVOKE.CSharp_new_WwiseObjectIDext(), true) {\n\n  }\n\n}\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Generated/Windows/AkMemPoolAttributes_Windows.cs",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkMemPoolAttributes {\n  AkNoAlloc = 0,\n  AkMalloc = 1 << 0,\n  AkVirtualAlloc = 1 << 1,\n  AkAllocMask = AkNoAlloc|AkMalloc|AkVirtualAlloc,\n  AkFixedSizeBlocksMode = 1 << 3,\n  AkBlockMgmtMask = AkFixedSizeBlocksMode\n}\n"
  },
  {
    "path": "Wwise/Generated/Windows/AkPlatformInitSettings_Windows.cs",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkPlatformInitSettings : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkPlatformInitSettings(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkPlatformInitSettings obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkPlatformInitSettings() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkPlatformInitSettings(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public AkThreadProperties threadLEngine {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_threadLEngine_set(swigCPtr, AkThreadProperties.getCPtr(value));\n\n    } \n    get {\n      IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_threadLEngine_get(swigCPtr);\n      AkThreadProperties ret = (cPtr == IntPtr.Zero) ? null : new AkThreadProperties(cPtr, false);\n\n      return ret;\n    } \n  }\n\n  public AkThreadProperties threadBankManager {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_threadBankManager_set(swigCPtr, AkThreadProperties.getCPtr(value));\n\n    } \n    get {\n      IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_threadBankManager_get(swigCPtr);\n      AkThreadProperties ret = (cPtr == IntPtr.Zero) ? null : new AkThreadProperties(cPtr, false);\n\n      return ret;\n    } \n  }\n\n  public AkThreadProperties threadMonitor {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_threadMonitor_set(swigCPtr, AkThreadProperties.getCPtr(value));\n\n    } \n    get {\n      IntPtr cPtr = AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_threadMonitor_get(swigCPtr);\n      AkThreadProperties ret = (cPtr == IntPtr.Zero) ? null : new AkThreadProperties(cPtr, false);\n\n      return ret;\n    } \n  }\n\n  public uint uLEngineDefaultPoolSize {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public float fLEngineDefaultPoolRatioThreshold {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_set(swigCPtr, value);\n\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public ushort uNumRefillsInVoice {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_uNumRefillsInVoice_set(swigCPtr, value);\n\n    } \n    get {\n      ushort ret = AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_uNumRefillsInVoice_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkSoundQuality eAudioQuality {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_eAudioQuality_set(swigCPtr, (int)value);\n\n    } \n    get {\n      AkSoundQuality ret = (AkSoundQuality)AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_eAudioQuality_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public bool bGlobalFocus {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_bGlobalFocus_set(swigCPtr, value);\n\n    } \n    get {\n      bool ret = AkSoundEnginePINVOKE.CSharp_AkPlatformInitSettings_bGlobalFocus_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkPlatformInitSettings() : this(AkSoundEnginePINVOKE.CSharp_new_AkPlatformInitSettings(), true) {\n\n  }\n\n}\n"
  },
  {
    "path": "Wwise/Generated/Windows/AkSinkType_Windows.cs",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkSinkType {\n  AkSink_Main = 0,\n  AkSink_Main_XAudio2,\n  AkSink_Main_DirectSound,\n  AkSink_Dummy,\n  AkSink_MergeToMain,\n  AkSink_NumSinkTypes\n}\n"
  },
  {
    "path": "Wwise/Generated/Windows/AkSoundEnginePINVOKE_Windows.cs",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\nclass AkSoundEnginePINVOKE {\n\n  static AkSoundEnginePINVOKE() {\n  }\n\n\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_VirtualAllocHook\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_VirtualAllocHook\")]\n#endif\n  public static extern IntPtr CSharp_VirtualAllocHook(IntPtr jarg1, uint jarg2, uint jarg3, uint jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_VirtualFreeHook\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_VirtualFreeHook\")]\n#endif\n  public static extern void CSharp_VirtualFreeHook(IntPtr jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AK_INVALID_AUX_ID_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AK_INVALID_AUX_ID_get\")]\n#endif\n  public static extern uint CSharp_AK_INVALID_AUX_ID_get();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AK_INVALID_CHANNELMASK_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AK_INVALID_CHANNELMASK_get\")]\n#endif\n  public static extern uint CSharp_AK_INVALID_CHANNELMASK_get();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AK_INVALID_OUTPUT_DEVICE_ID_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AK_INVALID_OUTPUT_DEVICE_ID_get\")]\n#endif\n  public static extern uint CSharp_AK_INVALID_OUTPUT_DEVICE_ID_get();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_iExternalSrcCookie_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_iExternalSrcCookie_set\")]\n#endif\n  public static extern void CSharp_AkExternalSourceInfo_iExternalSrcCookie_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_iExternalSrcCookie_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_iExternalSrcCookie_get\")]\n#endif\n  public static extern uint CSharp_AkExternalSourceInfo_iExternalSrcCookie_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_idCodec_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_idCodec_set\")]\n#endif\n  public static extern void CSharp_AkExternalSourceInfo_idCodec_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_idCodec_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_idCodec_get\")]\n#endif\n  public static extern uint CSharp_AkExternalSourceInfo_idCodec_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_szFile_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_szFile_set\")]\n#endif\n  public static extern void CSharp_AkExternalSourceInfo_szFile_set(HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_szFile_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_szFile_get\")]\n#endif\n  public static extern string CSharp_AkExternalSourceInfo_szFile_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_pInMemory_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_pInMemory_set\")]\n#endif\n  public static extern void CSharp_AkExternalSourceInfo_pInMemory_set(HandleRef jarg1, IntPtr jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_pInMemory_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_pInMemory_get\")]\n#endif\n  public static extern IntPtr CSharp_AkExternalSourceInfo_pInMemory_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_uiMemorySize_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_uiMemorySize_set\")]\n#endif\n  public static extern void CSharp_AkExternalSourceInfo_uiMemorySize_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_uiMemorySize_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_uiMemorySize_get\")]\n#endif\n  public static extern uint CSharp_AkExternalSourceInfo_uiMemorySize_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_idFile_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_idFile_set\")]\n#endif\n  public static extern void CSharp_AkExternalSourceInfo_idFile_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkExternalSourceInfo_idFile_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkExternalSourceInfo_idFile_get\")]\n#endif\n  public static extern uint CSharp_AkExternalSourceInfo_idFile_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkExternalSourceInfo__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkExternalSourceInfo__SWIG_0\")]\n#endif\n  public static extern IntPtr CSharp_new_AkExternalSourceInfo__SWIG_0();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkExternalSourceInfo__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkExternalSourceInfo__SWIG_1\")]\n#endif\n  public static extern IntPtr CSharp_new_AkExternalSourceInfo__SWIG_1(IntPtr jarg1, uint jarg2, uint jarg3, uint jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkExternalSourceInfo__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkExternalSourceInfo__SWIG_2\")]\n#endif\n  public static extern IntPtr CSharp_new_AkExternalSourceInfo__SWIG_2([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkExternalSourceInfo__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkExternalSourceInfo__SWIG_3\")]\n#endif\n  public static extern IntPtr CSharp_new_AkExternalSourceInfo__SWIG_3(uint jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkExternalSourceInfo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkExternalSourceInfo\")]\n#endif\n  public static extern void CSharp_delete_AkExternalSourceInfo(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkVector_X_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkVector_X_set\")]\n#endif\n  public static extern void CSharp_AkVector_X_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkVector_X_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkVector_X_get\")]\n#endif\n  public static extern float CSharp_AkVector_X_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkVector_Y_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkVector_Y_set\")]\n#endif\n  public static extern void CSharp_AkVector_Y_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkVector_Y_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkVector_Y_get\")]\n#endif\n  public static extern float CSharp_AkVector_Y_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkVector_Z_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkVector_Z_set\")]\n#endif\n  public static extern void CSharp_AkVector_Z_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkVector_Z_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkVector_Z_get\")]\n#endif\n  public static extern float CSharp_AkVector_Z_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkVector\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkVector\")]\n#endif\n  public static extern IntPtr CSharp_new_AkVector();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkVector\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkVector\")]\n#endif\n  public static extern void CSharp_delete_AkVector(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSoundPosition_Position_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSoundPosition_Position_set\")]\n#endif\n  public static extern void CSharp_AkSoundPosition_Position_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSoundPosition_Position_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSoundPosition_Position_get\")]\n#endif\n  public static extern IntPtr CSharp_AkSoundPosition_Position_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSoundPosition_Orientation_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSoundPosition_Orientation_set\")]\n#endif\n  public static extern void CSharp_AkSoundPosition_Orientation_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSoundPosition_Orientation_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSoundPosition_Orientation_get\")]\n#endif\n  public static extern IntPtr CSharp_AkSoundPosition_Orientation_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkSoundPosition\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkSoundPosition\")]\n#endif\n  public static extern IntPtr CSharp_new_AkSoundPosition();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkSoundPosition\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkSoundPosition\")]\n#endif\n  public static extern void CSharp_delete_AkSoundPosition(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkListenerPosition_OrientationFront_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkListenerPosition_OrientationFront_set\")]\n#endif\n  public static extern void CSharp_AkListenerPosition_OrientationFront_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkListenerPosition_OrientationFront_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkListenerPosition_OrientationFront_get\")]\n#endif\n  public static extern IntPtr CSharp_AkListenerPosition_OrientationFront_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkListenerPosition_OrientationTop_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkListenerPosition_OrientationTop_set\")]\n#endif\n  public static extern void CSharp_AkListenerPosition_OrientationTop_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkListenerPosition_OrientationTop_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkListenerPosition_OrientationTop_get\")]\n#endif\n  public static extern IntPtr CSharp_AkListenerPosition_OrientationTop_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkListenerPosition_Position_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkListenerPosition_Position_set\")]\n#endif\n  public static extern void CSharp_AkListenerPosition_Position_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkListenerPosition_Position_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkListenerPosition_Position_get\")]\n#endif\n  public static extern IntPtr CSharp_AkListenerPosition_Position_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkListenerPosition\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkListenerPosition\")]\n#endif\n  public static extern IntPtr CSharp_new_AkListenerPosition();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkListenerPosition\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkListenerPosition\")]\n#endif\n  public static extern void CSharp_delete_AkListenerPosition(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fFrontLeft_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fFrontLeft_set\")]\n#endif\n  public static extern void CSharp_AkSpeakerVolumes_fFrontLeft_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fFrontLeft_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fFrontLeft_get\")]\n#endif\n  public static extern float CSharp_AkSpeakerVolumes_fFrontLeft_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fFrontRight_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fFrontRight_set\")]\n#endif\n  public static extern void CSharp_AkSpeakerVolumes_fFrontRight_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fFrontRight_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fFrontRight_get\")]\n#endif\n  public static extern float CSharp_AkSpeakerVolumes_fFrontRight_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fCenter_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fCenter_set\")]\n#endif\n  public static extern void CSharp_AkSpeakerVolumes_fCenter_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fCenter_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fCenter_get\")]\n#endif\n  public static extern float CSharp_AkSpeakerVolumes_fCenter_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fRearLeft_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fRearLeft_set\")]\n#endif\n  public static extern void CSharp_AkSpeakerVolumes_fRearLeft_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fRearLeft_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fRearLeft_get\")]\n#endif\n  public static extern float CSharp_AkSpeakerVolumes_fRearLeft_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fRearRight_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fRearRight_set\")]\n#endif\n  public static extern void CSharp_AkSpeakerVolumes_fRearRight_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fRearRight_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fRearRight_get\")]\n#endif\n  public static extern float CSharp_AkSpeakerVolumes_fRearRight_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fSideLeft_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fSideLeft_set\")]\n#endif\n  public static extern void CSharp_AkSpeakerVolumes_fSideLeft_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fSideLeft_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fSideLeft_get\")]\n#endif\n  public static extern float CSharp_AkSpeakerVolumes_fSideLeft_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fSideRight_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fSideRight_set\")]\n#endif\n  public static extern void CSharp_AkSpeakerVolumes_fSideRight_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fSideRight_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fSideRight_get\")]\n#endif\n  public static extern float CSharp_AkSpeakerVolumes_fSideRight_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fLfe_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fLfe_set\")]\n#endif\n  public static extern void CSharp_AkSpeakerVolumes_fLfe_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSpeakerVolumes_fLfe_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSpeakerVolumes_fLfe_get\")]\n#endif\n  public static extern float CSharp_AkSpeakerVolumes_fLfe_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkSpeakerVolumes\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkSpeakerVolumes\")]\n#endif\n  public static extern IntPtr CSharp_new_AkSpeakerVolumes();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkSpeakerVolumes\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkSpeakerVolumes\")]\n#endif\n  public static extern void CSharp_delete_AkSpeakerVolumes(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkAuxSendValue_auxBusID_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkAuxSendValue_auxBusID_set\")]\n#endif\n  public static extern void CSharp_AkAuxSendValue_auxBusID_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkAuxSendValue_auxBusID_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkAuxSendValue_auxBusID_get\")]\n#endif\n  public static extern uint CSharp_AkAuxSendValue_auxBusID_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkAuxSendValue_fControlValue_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkAuxSendValue_fControlValue_set\")]\n#endif\n  public static extern void CSharp_AkAuxSendValue_fControlValue_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkAuxSendValue_fControlValue_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkAuxSendValue_fControlValue_get\")]\n#endif\n  public static extern float CSharp_AkAuxSendValue_fControlValue_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkAuxSendValue\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkAuxSendValue\")]\n#endif\n  public static extern void CSharp_delete_AkAuxSendValue(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkVolumeOffset_fNext_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkVolumeOffset_fNext_set\")]\n#endif\n  public static extern void CSharp_AkVolumeOffset_fNext_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkVolumeOffset_fNext_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkVolumeOffset_fNext_get\")]\n#endif\n  public static extern float CSharp_AkVolumeOffset_fNext_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkVolumeOffset_fPrev_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkVolumeOffset_fPrev_set\")]\n#endif\n  public static extern void CSharp_AkVolumeOffset_fPrev_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkVolumeOffset_fPrev_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkVolumeOffset_fPrev_get\")]\n#endif\n  public static extern float CSharp_AkVolumeOffset_fPrev_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkVolumeOffset\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkVolumeOffset\")]\n#endif\n  public static extern IntPtr CSharp_new_AkVolumeOffset();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkVolumeOffset\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkVolumeOffset\")]\n#endif\n  public static extern void CSharp_delete_AkVolumeOffset(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_WwiseObjectIDext_IsEqualTo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_WwiseObjectIDext_IsEqualTo\")]\n#endif\n  public static extern bool CSharp_WwiseObjectIDext_IsEqualTo(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_WwiseObjectIDext_GetNodeType\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_WwiseObjectIDext_GetNodeType\")]\n#endif\n  public static extern int CSharp_WwiseObjectIDext_GetNodeType(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_WwiseObjectIDext_id_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_WwiseObjectIDext_id_set\")]\n#endif\n  public static extern void CSharp_WwiseObjectIDext_id_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_WwiseObjectIDext_id_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_WwiseObjectIDext_id_get\")]\n#endif\n  public static extern uint CSharp_WwiseObjectIDext_id_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_WwiseObjectIDext_bIsBus_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_WwiseObjectIDext_bIsBus_set\")]\n#endif\n  public static extern void CSharp_WwiseObjectIDext_bIsBus_set(HandleRef jarg1, bool jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_WwiseObjectIDext_bIsBus_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_WwiseObjectIDext_bIsBus_get\")]\n#endif\n  public static extern bool CSharp_WwiseObjectIDext_bIsBus_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_WwiseObjectIDext\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_WwiseObjectIDext\")]\n#endif\n  public static extern IntPtr CSharp_new_WwiseObjectIDext();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_WwiseObjectIDext\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_WwiseObjectIDext\")]\n#endif\n  public static extern void CSharp_delete_WwiseObjectIDext(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_WwiseObjectID__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_WwiseObjectID__SWIG_0\")]\n#endif\n  public static extern IntPtr CSharp_new_WwiseObjectID__SWIG_0();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_WwiseObjectID__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_WwiseObjectID__SWIG_1\")]\n#endif\n  public static extern IntPtr CSharp_new_WwiseObjectID__SWIG_1(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_WwiseObjectID__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_WwiseObjectID__SWIG_2\")]\n#endif\n  public static extern IntPtr CSharp_new_WwiseObjectID__SWIG_2(uint jarg1, bool jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_WwiseObjectID__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_WwiseObjectID__SWIG_3\")]\n#endif\n  public static extern IntPtr CSharp_new_WwiseObjectID__SWIG_3(uint jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_WwiseObjectID\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_WwiseObjectID\")]\n#endif\n  public static extern void CSharp_delete_WwiseObjectID(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_EnvelopePoint_uPosition_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_EnvelopePoint_uPosition_set\")]\n#endif\n  public static extern void CSharp_EnvelopePoint_uPosition_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_EnvelopePoint_uPosition_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_EnvelopePoint_uPosition_get\")]\n#endif\n  public static extern uint CSharp_EnvelopePoint_uPosition_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_EnvelopePoint_uAttenuation_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_EnvelopePoint_uAttenuation_set\")]\n#endif\n  public static extern void CSharp_EnvelopePoint_uAttenuation_set(HandleRef jarg1, ushort jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_EnvelopePoint_uAttenuation_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_EnvelopePoint_uAttenuation_get\")]\n#endif\n  public static extern ushort CSharp_EnvelopePoint_uAttenuation_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_EnvelopePoint\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_EnvelopePoint\")]\n#endif\n  public static extern IntPtr CSharp_new_EnvelopePoint();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_EnvelopePoint\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_EnvelopePoint\")]\n#endif\n  public static extern void CSharp_delete_EnvelopePoint(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Iterator_pItem_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Iterator_pItem_set\")]\n#endif\n  public static extern void CSharp_Iterator_pItem_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Iterator_pItem_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Iterator_pItem_get\")]\n#endif\n  public static extern IntPtr CSharp_Iterator_pItem_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Iterator_NextIter\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Iterator_NextIter\")]\n#endif\n  public static extern IntPtr CSharp_Iterator_NextIter(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Iterator_PrevIter\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Iterator_PrevIter\")]\n#endif\n  public static extern IntPtr CSharp_Iterator_PrevIter(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Iterator_GetItem\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Iterator_GetItem\")]\n#endif\n  public static extern IntPtr CSharp_Iterator_GetItem(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Iterator_IsEqualTo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Iterator_IsEqualTo\")]\n#endif\n  public static extern bool CSharp_Iterator_IsEqualTo(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Iterator_IsDifferentFrom\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Iterator_IsDifferentFrom\")]\n#endif\n  public static extern bool CSharp_Iterator_IsDifferentFrom(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_Iterator\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_Iterator\")]\n#endif\n  public static extern IntPtr CSharp_new_Iterator();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_Iterator\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_Iterator\")]\n#endif\n  public static extern void CSharp_delete_Iterator(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ArrayPoolDefault_Get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ArrayPoolDefault_Get\")]\n#endif\n  public static extern int CSharp_ArrayPoolDefault_Get();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_ArrayPoolDefault\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_ArrayPoolDefault\")]\n#endif\n  public static extern IntPtr CSharp_new_ArrayPoolDefault();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_ArrayPoolDefault\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_ArrayPoolDefault\")]\n#endif\n  public static extern void CSharp_delete_ArrayPoolDefault(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ArrayPoolLEngineDefault_Get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ArrayPoolLEngineDefault_Get\")]\n#endif\n  public static extern int CSharp_ArrayPoolLEngineDefault_Get();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_ArrayPoolLEngineDefault\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_ArrayPoolLEngineDefault\")]\n#endif\n  public static extern IntPtr CSharp_new_ArrayPoolLEngineDefault();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_ArrayPoolLEngineDefault\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_ArrayPoolLEngineDefault\")]\n#endif\n  public static extern void CSharp_delete_ArrayPoolLEngineDefault(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkArrayAllocatorDefault_Alloc\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkArrayAllocatorDefault_Alloc\")]\n#endif\n  public static extern IntPtr CSharp_AkArrayAllocatorDefault_Alloc(int jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkArrayAllocatorDefault_Free\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkArrayAllocatorDefault_Free\")]\n#endif\n  public static extern void CSharp_AkArrayAllocatorDefault_Free(int jarg1, IntPtr jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkArrayAllocatorDefault\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkArrayAllocatorDefault\")]\n#endif\n  public static extern IntPtr CSharp_new_AkArrayAllocatorDefault();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkArrayAllocatorDefault\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkArrayAllocatorDefault\")]\n#endif\n  public static extern void CSharp_delete_AkArrayAllocatorDefault(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkArrayAllocatorAlignedSimd_Alloc\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkArrayAllocatorAlignedSimd_Alloc\")]\n#endif\n  public static extern IntPtr CSharp_AkArrayAllocatorAlignedSimd_Alloc(int jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkArrayAllocatorAlignedSimd_Free\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkArrayAllocatorAlignedSimd_Free\")]\n#endif\n  public static extern void CSharp_AkArrayAllocatorAlignedSimd_Free(int jarg1, IntPtr jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkArrayAllocatorAlignedSimd\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkArrayAllocatorAlignedSimd\")]\n#endif\n  public static extern IntPtr CSharp_new_AkArrayAllocatorAlignedSimd();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkArrayAllocatorAlignedSimd\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkArrayAllocatorAlignedSimd\")]\n#endif\n  public static extern void CSharp_delete_AkArrayAllocatorAlignedSimd(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_PlaylistItem__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_PlaylistItem__SWIG_0\")]\n#endif\n  public static extern IntPtr CSharp_new_PlaylistItem__SWIG_0();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_PlaylistItem__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_PlaylistItem__SWIG_1\")]\n#endif\n  public static extern IntPtr CSharp_new_PlaylistItem__SWIG_1(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_PlaylistItem\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_PlaylistItem\")]\n#endif\n  public static extern void CSharp_delete_PlaylistItem(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PlaylistItem_Assign\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PlaylistItem_Assign\")]\n#endif\n  public static extern IntPtr CSharp_PlaylistItem_Assign(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PlaylistItem_IsEqualTo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PlaylistItem_IsEqualTo\")]\n#endif\n  public static extern bool CSharp_PlaylistItem_IsEqualTo(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PlaylistItem_SetExternalSources\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PlaylistItem_SetExternalSources\")]\n#endif\n  public static extern int CSharp_PlaylistItem_SetExternalSources(HandleRef jarg1, uint jarg2, HandleRef jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PlaylistItem_audioNodeID_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PlaylistItem_audioNodeID_set\")]\n#endif\n  public static extern void CSharp_PlaylistItem_audioNodeID_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PlaylistItem_audioNodeID_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PlaylistItem_audioNodeID_get\")]\n#endif\n  public static extern uint CSharp_PlaylistItem_audioNodeID_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PlaylistItem_msDelay_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PlaylistItem_msDelay_set\")]\n#endif\n  public static extern void CSharp_PlaylistItem_msDelay_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PlaylistItem_msDelay_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PlaylistItem_msDelay_get\")]\n#endif\n  public static extern int CSharp_PlaylistItem_msDelay_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PlaylistItem_pCustomInfo_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PlaylistItem_pCustomInfo_set\")]\n#endif\n  public static extern void CSharp_PlaylistItem_pCustomInfo_set(HandleRef jarg1, IntPtr jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PlaylistItem_pCustomInfo_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PlaylistItem_pCustomInfo_get\")]\n#endif\n  public static extern IntPtr CSharp_PlaylistItem_pCustomInfo_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkPlaylistArray\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkPlaylistArray\")]\n#endif\n  public static extern IntPtr CSharp_new_AkPlaylistArray();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkPlaylistArray\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkPlaylistArray\")]\n#endif\n  public static extern void CSharp_delete_AkPlaylistArray(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Begin\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Begin\")]\n#endif\n  public static extern IntPtr CSharp_AkPlaylistArray_Begin(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_End\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_End\")]\n#endif\n  public static extern IntPtr CSharp_AkPlaylistArray_End(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_FindEx\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_FindEx\")]\n#endif\n  public static extern IntPtr CSharp_AkPlaylistArray_FindEx(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Erase__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Erase__SWIG_0\")]\n#endif\n  public static extern IntPtr CSharp_AkPlaylistArray_Erase__SWIG_0(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Erase__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Erase__SWIG_1\")]\n#endif\n  public static extern void CSharp_AkPlaylistArray_Erase__SWIG_1(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_EraseSwap\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_EraseSwap\")]\n#endif\n  public static extern IntPtr CSharp_AkPlaylistArray_EraseSwap(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Reserve\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Reserve\")]\n#endif\n  public static extern int CSharp_AkPlaylistArray_Reserve(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Reserved\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Reserved\")]\n#endif\n  public static extern uint CSharp_AkPlaylistArray_Reserved(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Term\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Term\")]\n#endif\n  public static extern void CSharp_AkPlaylistArray_Term(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Length\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Length\")]\n#endif\n  public static extern uint CSharp_AkPlaylistArray_Length(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_IsEmpty\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_IsEmpty\")]\n#endif\n  public static extern bool CSharp_AkPlaylistArray_IsEmpty(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Exists\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Exists\")]\n#endif\n  public static extern IntPtr CSharp_AkPlaylistArray_Exists(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_AddLast__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_AddLast__SWIG_0\")]\n#endif\n  public static extern IntPtr CSharp_AkPlaylistArray_AddLast__SWIG_0(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_AddLast__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_AddLast__SWIG_1\")]\n#endif\n  public static extern IntPtr CSharp_AkPlaylistArray_AddLast__SWIG_1(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Last\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Last\")]\n#endif\n  public static extern IntPtr CSharp_AkPlaylistArray_Last(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_RemoveLast\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_RemoveLast\")]\n#endif\n  public static extern void CSharp_AkPlaylistArray_RemoveLast(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Remove\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Remove\")]\n#endif\n  public static extern int CSharp_AkPlaylistArray_Remove(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_RemoveSwap\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_RemoveSwap\")]\n#endif\n  public static extern int CSharp_AkPlaylistArray_RemoveSwap(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_RemoveAll\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_RemoveAll\")]\n#endif\n  public static extern void CSharp_AkPlaylistArray_RemoveAll(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_ItemAtIndex\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_ItemAtIndex\")]\n#endif\n  public static extern IntPtr CSharp_AkPlaylistArray_ItemAtIndex(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Insert\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Insert\")]\n#endif\n  public static extern IntPtr CSharp_AkPlaylistArray_Insert(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_GrowArray__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_GrowArray__SWIG_0\")]\n#endif\n  public static extern bool CSharp_AkPlaylistArray_GrowArray__SWIG_0(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_GrowArray__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_GrowArray__SWIG_1\")]\n#endif\n  public static extern bool CSharp_AkPlaylistArray_GrowArray__SWIG_1(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Resize\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Resize\")]\n#endif\n  public static extern bool CSharp_AkPlaylistArray_Resize(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlaylistArray_Transfer\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlaylistArray_Transfer\")]\n#endif\n  public static extern void CSharp_AkPlaylistArray_Transfer(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Playlist_Enqueue__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Playlist_Enqueue__SWIG_0\")]\n#endif\n  public static extern int CSharp_Playlist_Enqueue__SWIG_0(HandleRef jarg1, uint jarg2, int jarg3, IntPtr jarg4, uint jarg5, HandleRef jarg6);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Playlist_Enqueue__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Playlist_Enqueue__SWIG_1\")]\n#endif\n  public static extern int CSharp_Playlist_Enqueue__SWIG_1(HandleRef jarg1, uint jarg2, int jarg3, IntPtr jarg4, uint jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Playlist_Enqueue__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Playlist_Enqueue__SWIG_2\")]\n#endif\n  public static extern int CSharp_Playlist_Enqueue__SWIG_2(HandleRef jarg1, uint jarg2, int jarg3, IntPtr jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Playlist_Enqueue__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Playlist_Enqueue__SWIG_3\")]\n#endif\n  public static extern int CSharp_Playlist_Enqueue__SWIG_3(HandleRef jarg1, uint jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Playlist_Enqueue__SWIG_4\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Playlist_Enqueue__SWIG_4\")]\n#endif\n  public static extern int CSharp_Playlist_Enqueue__SWIG_4(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_Playlist\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_Playlist\")]\n#endif\n  public static extern IntPtr CSharp_new_Playlist();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_Playlist\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_Playlist\")]\n#endif\n  public static extern void CSharp_delete_Playlist(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceOpen__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceOpen__SWIG_0\")]\n#endif\n  public static extern uint CSharp_DynamicSequenceOpen__SWIG_0(uint jarg1, uint jarg2, IntPtr jarg3, IntPtr jarg4, int jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceOpen__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceOpen__SWIG_1\")]\n#endif\n  public static extern uint CSharp_DynamicSequenceOpen__SWIG_1(uint jarg1, uint jarg2, IntPtr jarg3, IntPtr jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceOpen__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceOpen__SWIG_2\")]\n#endif\n  public static extern uint CSharp_DynamicSequenceOpen__SWIG_2(uint jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceOpen__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceOpen__SWIG_3\")]\n#endif\n  public static extern uint CSharp_DynamicSequenceOpen__SWIG_3(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceClose\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceClose\")]\n#endif\n  public static extern int CSharp_DynamicSequenceClose(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequencePlay__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequencePlay__SWIG_0\")]\n#endif\n  public static extern int CSharp_DynamicSequencePlay__SWIG_0(uint jarg1, int jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequencePlay__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequencePlay__SWIG_1\")]\n#endif\n  public static extern int CSharp_DynamicSequencePlay__SWIG_1(uint jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequencePlay__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequencePlay__SWIG_2\")]\n#endif\n  public static extern int CSharp_DynamicSequencePlay__SWIG_2(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequencePause__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequencePause__SWIG_0\")]\n#endif\n  public static extern int CSharp_DynamicSequencePause__SWIG_0(uint jarg1, int jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequencePause__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequencePause__SWIG_1\")]\n#endif\n  public static extern int CSharp_DynamicSequencePause__SWIG_1(uint jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequencePause__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequencePause__SWIG_2\")]\n#endif\n  public static extern int CSharp_DynamicSequencePause__SWIG_2(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceResume__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceResume__SWIG_0\")]\n#endif\n  public static extern int CSharp_DynamicSequenceResume__SWIG_0(uint jarg1, int jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceResume__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceResume__SWIG_1\")]\n#endif\n  public static extern int CSharp_DynamicSequenceResume__SWIG_1(uint jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceResume__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceResume__SWIG_2\")]\n#endif\n  public static extern int CSharp_DynamicSequenceResume__SWIG_2(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceStop__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceStop__SWIG_0\")]\n#endif\n  public static extern int CSharp_DynamicSequenceStop__SWIG_0(uint jarg1, int jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceStop__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceStop__SWIG_1\")]\n#endif\n  public static extern int CSharp_DynamicSequenceStop__SWIG_1(uint jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceStop__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceStop__SWIG_2\")]\n#endif\n  public static extern int CSharp_DynamicSequenceStop__SWIG_2(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceBreak\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceBreak\")]\n#endif\n  public static extern int CSharp_DynamicSequenceBreak(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceLockPlaylist\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceLockPlaylist\")]\n#endif\n  public static extern IntPtr CSharp_DynamicSequenceLockPlaylist(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_DynamicSequenceUnlockPlaylist\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_DynamicSequenceUnlockPlaylist\")]\n#endif\n  public static extern int CSharp_DynamicSequenceUnlockPlaylist(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkOutputSettings_ePanningRule_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkOutputSettings_ePanningRule_set\")]\n#endif\n  public static extern void CSharp_AkOutputSettings_ePanningRule_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkOutputSettings_ePanningRule_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkOutputSettings_ePanningRule_get\")]\n#endif\n  public static extern int CSharp_AkOutputSettings_ePanningRule_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkOutputSettings_uChannelMask_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkOutputSettings_uChannelMask_set\")]\n#endif\n  public static extern void CSharp_AkOutputSettings_uChannelMask_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkOutputSettings_uChannelMask_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkOutputSettings_uChannelMask_get\")]\n#endif\n  public static extern uint CSharp_AkOutputSettings_uChannelMask_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkOutputSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkOutputSettings\")]\n#endif\n  public static extern IntPtr CSharp_new_AkOutputSettings();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkOutputSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkOutputSettings\")]\n#endif\n  public static extern void CSharp_delete_AkOutputSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_pfnAssertHook_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_pfnAssertHook_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_pfnAssertHook_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_pfnAssertHook_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_pfnAssertHook_get\")]\n#endif\n  public static extern IntPtr CSharp_AkInitSettings_pfnAssertHook_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uMaxNumPaths_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uMaxNumPaths_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_uMaxNumPaths_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uMaxNumPaths_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uMaxNumPaths_get\")]\n#endif\n  public static extern uint CSharp_AkInitSettings_uMaxNumPaths_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uMaxNumTransitions_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uMaxNumTransitions_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_uMaxNumTransitions_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uMaxNumTransitions_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uMaxNumTransitions_get\")]\n#endif\n  public static extern uint CSharp_AkInitSettings_uMaxNumTransitions_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uDefaultPoolSize_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uDefaultPoolSize_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_uDefaultPoolSize_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uDefaultPoolSize_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uDefaultPoolSize_get\")]\n#endif\n  public static extern uint CSharp_AkInitSettings_uDefaultPoolSize_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_fDefaultPoolRatioThreshold_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_fDefaultPoolRatioThreshold_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_fDefaultPoolRatioThreshold_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_fDefaultPoolRatioThreshold_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_fDefaultPoolRatioThreshold_get\")]\n#endif\n  public static extern float CSharp_AkInitSettings_fDefaultPoolRatioThreshold_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uCommandQueueSize_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uCommandQueueSize_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_uCommandQueueSize_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uCommandQueueSize_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uCommandQueueSize_get\")]\n#endif\n  public static extern uint CSharp_AkInitSettings_uCommandQueueSize_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uPrepareEventMemoryPoolID_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uPrepareEventMemoryPoolID_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_uPrepareEventMemoryPoolID_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uPrepareEventMemoryPoolID_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uPrepareEventMemoryPoolID_get\")]\n#endif\n  public static extern int CSharp_AkInitSettings_uPrepareEventMemoryPoolID_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_bEnableGameSyncPreparation_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_bEnableGameSyncPreparation_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_bEnableGameSyncPreparation_set(HandleRef jarg1, bool jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_bEnableGameSyncPreparation_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_bEnableGameSyncPreparation_get\")]\n#endif\n  public static extern bool CSharp_AkInitSettings_bEnableGameSyncPreparation_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uContinuousPlaybackLookAhead_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uContinuousPlaybackLookAhead_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_uContinuousPlaybackLookAhead_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uContinuousPlaybackLookAhead_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uContinuousPlaybackLookAhead_get\")]\n#endif\n  public static extern uint CSharp_AkInitSettings_uContinuousPlaybackLookAhead_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uMonitorPoolSize_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uMonitorPoolSize_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_uMonitorPoolSize_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uMonitorPoolSize_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uMonitorPoolSize_get\")]\n#endif\n  public static extern uint CSharp_AkInitSettings_uMonitorPoolSize_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uMonitorQueuePoolSize_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uMonitorQueuePoolSize_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_uMonitorQueuePoolSize_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_uMonitorQueuePoolSize_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_uMonitorQueuePoolSize_get\")]\n#endif\n  public static extern uint CSharp_AkInitSettings_uMonitorQueuePoolSize_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_eMainOutputType_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_eMainOutputType_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_eMainOutputType_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_eMainOutputType_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_eMainOutputType_get\")]\n#endif\n  public static extern int CSharp_AkInitSettings_eMainOutputType_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_settingsMainOutput_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_settingsMainOutput_set\")]\n#endif\n  public static extern void CSharp_AkInitSettings_settingsMainOutput_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkInitSettings_settingsMainOutput_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkInitSettings_settingsMainOutput_get\")]\n#endif\n  public static extern IntPtr CSharp_AkInitSettings_settingsMainOutput_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkInitSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkInitSettings\")]\n#endif\n  public static extern IntPtr CSharp_new_AkInitSettings();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkInitSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkInitSettings\")]\n#endif\n  public static extern void CSharp_delete_AkInitSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetSpeakerConfiguration__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetSpeakerConfiguration__SWIG_0\")]\n#endif\n  public static extern uint CSharp_GetSpeakerConfiguration__SWIG_0(int jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetSpeakerConfiguration__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetSpeakerConfiguration__SWIG_1\")]\n#endif\n  public static extern uint CSharp_GetSpeakerConfiguration__SWIG_1(int jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetSpeakerConfiguration__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetSpeakerConfiguration__SWIG_2\")]\n#endif\n  public static extern uint CSharp_GetSpeakerConfiguration__SWIG_2();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetPanningRule__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetPanningRule__SWIG_0\")]\n#endif\n  public static extern int CSharp_GetPanningRule__SWIG_0(out int jarg1, int jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetPanningRule__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetPanningRule__SWIG_1\")]\n#endif\n  public static extern int CSharp_GetPanningRule__SWIG_1(out int jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetPanningRule__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetPanningRule__SWIG_2\")]\n#endif\n  public static extern int CSharp_GetPanningRule__SWIG_2(out int jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetPanningRule__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetPanningRule__SWIG_0\")]\n#endif\n  public static extern int CSharp_SetPanningRule__SWIG_0(int jarg1, int jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetPanningRule__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetPanningRule__SWIG_1\")]\n#endif\n  public static extern int CSharp_SetPanningRule__SWIG_1(int jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetPanningRule__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetPanningRule__SWIG_2\")]\n#endif\n  public static extern int CSharp_SetPanningRule__SWIG_2(int jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetSpeakerAngles__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetSpeakerAngles__SWIG_0\")]\n#endif\n  public static extern int CSharp_GetSpeakerAngles__SWIG_0(ref float jarg1, ref uint jarg2, int jarg3, uint jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetSpeakerAngles__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetSpeakerAngles__SWIG_1\")]\n#endif\n  public static extern int CSharp_GetSpeakerAngles__SWIG_1(ref float jarg1, ref uint jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetSpeakerAngles__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetSpeakerAngles__SWIG_2\")]\n#endif\n  public static extern int CSharp_GetSpeakerAngles__SWIG_2(ref float jarg1, ref uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetSpeakerAngles__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetSpeakerAngles__SWIG_0\")]\n#endif\n  public static extern int CSharp_SetSpeakerAngles__SWIG_0(float jarg1, uint jarg2, int jarg3, uint jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetSpeakerAngles__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetSpeakerAngles__SWIG_1\")]\n#endif\n  public static extern int CSharp_SetSpeakerAngles__SWIG_1(float jarg1, uint jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetSpeakerAngles__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetSpeakerAngles__SWIG_2\")]\n#endif\n  public static extern int CSharp_SetSpeakerAngles__SWIG_2(float jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetVolumeThreshold\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetVolumeThreshold\")]\n#endif\n  public static extern int CSharp_SetVolumeThreshold(float jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetMaxNumVoicesLimit\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetMaxNumVoicesLimit\")]\n#endif\n  public static extern int CSharp_SetMaxNumVoicesLimit(ushort jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_RenderAudio\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_RenderAudio\")]\n#endif\n  public static extern int CSharp_RenderAudio();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetIDFromString__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetIDFromString__SWIG_0\")]\n#endif\n  public static extern uint CSharp_GetIDFromString__SWIG_0([MarshalAs(UnmanagedType.LPWStr)]string jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_0\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_0(uint jarg1, uint jarg2, uint jarg3, IntPtr jarg4, IntPtr jarg5, uint jarg6, HandleRef jarg7, uint jarg8);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_1\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_1(uint jarg1, uint jarg2, uint jarg3, IntPtr jarg4, IntPtr jarg5, uint jarg6, HandleRef jarg7);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_2\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_2(uint jarg1, uint jarg2, uint jarg3, IntPtr jarg4, IntPtr jarg5, uint jarg6);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_3\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_3(uint jarg1, uint jarg2, uint jarg3, IntPtr jarg4, IntPtr jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_4\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_4\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_4(uint jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_5\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_5\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_5(uint jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_6\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_6\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_6([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, uint jarg3, IntPtr jarg4, IntPtr jarg5, uint jarg6, HandleRef jarg7, uint jarg8);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_7\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_7\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_7([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, uint jarg3, IntPtr jarg4, IntPtr jarg5, uint jarg6, HandleRef jarg7);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_8\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_8\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_8([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, uint jarg3, IntPtr jarg4, IntPtr jarg5, uint jarg6);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_9\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_9\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_9([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, uint jarg3, IntPtr jarg4, IntPtr jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_10\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_10\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_10([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostEvent__SWIG_11\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostEvent__SWIG_11\")]\n#endif\n  public static extern uint CSharp_PostEvent__SWIG_11([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_0\")]\n#endif\n  public static extern int CSharp_ExecuteActionOnEvent__SWIG_0(uint jarg1, int jarg2, uint jarg3, int jarg4, int jarg5, uint jarg6);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_1\")]\n#endif\n  public static extern int CSharp_ExecuteActionOnEvent__SWIG_1(uint jarg1, int jarg2, uint jarg3, int jarg4, int jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_2\")]\n#endif\n  public static extern int CSharp_ExecuteActionOnEvent__SWIG_2(uint jarg1, int jarg2, uint jarg3, int jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_3\")]\n#endif\n  public static extern int CSharp_ExecuteActionOnEvent__SWIG_3(uint jarg1, int jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_4\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_4\")]\n#endif\n  public static extern int CSharp_ExecuteActionOnEvent__SWIG_4(uint jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_5\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_5\")]\n#endif\n  public static extern int CSharp_ExecuteActionOnEvent__SWIG_5([MarshalAs(UnmanagedType.LPWStr)]string jarg1, int jarg2, uint jarg3, int jarg4, int jarg5, uint jarg6);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_6\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_6\")]\n#endif\n  public static extern int CSharp_ExecuteActionOnEvent__SWIG_6([MarshalAs(UnmanagedType.LPWStr)]string jarg1, int jarg2, uint jarg3, int jarg4, int jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_7\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_7\")]\n#endif\n  public static extern int CSharp_ExecuteActionOnEvent__SWIG_7([MarshalAs(UnmanagedType.LPWStr)]string jarg1, int jarg2, uint jarg3, int jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_8\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_8\")]\n#endif\n  public static extern int CSharp_ExecuteActionOnEvent__SWIG_8([MarshalAs(UnmanagedType.LPWStr)]string jarg1, int jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_9\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ExecuteActionOnEvent__SWIG_9\")]\n#endif\n  public static extern int CSharp_ExecuteActionOnEvent__SWIG_9([MarshalAs(UnmanagedType.LPWStr)]string jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_0\")]\n#endif\n  public static extern int CSharp_SeekOnEvent__SWIG_0(uint jarg1, uint jarg2, int jarg3, bool jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_1\")]\n#endif\n  public static extern int CSharp_SeekOnEvent__SWIG_1(uint jarg1, uint jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_2\")]\n#endif\n  public static extern int CSharp_SeekOnEvent__SWIG_2([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, int jarg3, bool jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_3\")]\n#endif\n  public static extern int CSharp_SeekOnEvent__SWIG_3([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_6\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_6\")]\n#endif\n  public static extern int CSharp_SeekOnEvent__SWIG_6(uint jarg1, uint jarg2, float jarg3, bool jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_7\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_7\")]\n#endif\n  public static extern int CSharp_SeekOnEvent__SWIG_7(uint jarg1, uint jarg2, float jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_8\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_8\")]\n#endif\n  public static extern int CSharp_SeekOnEvent__SWIG_8([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, float jarg3, bool jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_9\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SeekOnEvent__SWIG_9\")]\n#endif\n  public static extern int CSharp_SeekOnEvent__SWIG_9([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, float jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_CancelEventCallbackCookie\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_CancelEventCallbackCookie\")]\n#endif\n  public static extern void CSharp_CancelEventCallbackCookie(IntPtr jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_CancelEventCallback\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_CancelEventCallback\")]\n#endif\n  public static extern void CSharp_CancelEventCallback(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetSourcePlayPosition__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetSourcePlayPosition__SWIG_0\")]\n#endif\n  public static extern int CSharp_GetSourcePlayPosition__SWIG_0(uint jarg1, out int jarg2, bool jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetSourcePlayPosition__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetSourcePlayPosition__SWIG_1\")]\n#endif\n  public static extern int CSharp_GetSourcePlayPosition__SWIG_1(uint jarg1, out int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_StopAll__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_StopAll__SWIG_0\")]\n#endif\n  public static extern void CSharp_StopAll__SWIG_0(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_StopAll__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_StopAll__SWIG_1\")]\n#endif\n  public static extern void CSharp_StopAll__SWIG_1();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_StopPlayingID__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_StopPlayingID__SWIG_0\")]\n#endif\n  public static extern void CSharp_StopPlayingID__SWIG_0(uint jarg1, int jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_StopPlayingID__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_StopPlayingID__SWIG_1\")]\n#endif\n  public static extern void CSharp_StopPlayingID__SWIG_1(uint jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_StopPlayingID__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_StopPlayingID__SWIG_2\")]\n#endif\n  public static extern void CSharp_StopPlayingID__SWIG_2(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_RegisterGameObj__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_RegisterGameObj__SWIG_0\")]\n#endif\n  public static extern int CSharp_RegisterGameObj__SWIG_0(uint jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_RegisterGameObj__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_RegisterGameObj__SWIG_1\")]\n#endif\n  public static extern int CSharp_RegisterGameObj__SWIG_1(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_RegisterGameObj__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_RegisterGameObj__SWIG_2\")]\n#endif\n  public static extern int CSharp_RegisterGameObj__SWIG_2(uint jarg1, string jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_RegisterGameObj__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_RegisterGameObj__SWIG_3\")]\n#endif\n  public static extern int CSharp_RegisterGameObj__SWIG_3(uint jarg1, string jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_UnregisterGameObj\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_UnregisterGameObj\")]\n#endif\n  public static extern int CSharp_UnregisterGameObj(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_UnregisterAllGameObj\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_UnregisterAllGameObj\")]\n#endif\n  public static extern int CSharp_UnregisterAllGameObj();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetMultiplePositions__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetMultiplePositions__SWIG_0\")]\n#endif\n  public static extern int CSharp_SetMultiplePositions__SWIG_0(uint jarg1, IntPtr jarg2, ushort jarg3, int jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetMultiplePositions__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetMultiplePositions__SWIG_1\")]\n#endif\n  public static extern int CSharp_SetMultiplePositions__SWIG_1(uint jarg1, IntPtr jarg2, ushort jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetAttenuationScalingFactor\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetAttenuationScalingFactor\")]\n#endif\n  public static extern int CSharp_SetAttenuationScalingFactor(uint jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetListenerScalingFactor\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetListenerScalingFactor\")]\n#endif\n  public static extern int CSharp_SetListenerScalingFactor(uint jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ClearBanks\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ClearBanks\")]\n#endif\n  public static extern int CSharp_ClearBanks();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetBankLoadIOSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetBankLoadIOSettings\")]\n#endif\n  public static extern int CSharp_SetBankLoadIOSettings(float jarg1, char jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_LoadBank__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_LoadBank__SWIG_0\")]\n#endif\n  public static extern int CSharp_LoadBank__SWIG_0([MarshalAs(UnmanagedType.LPWStr)]string jarg1, int jarg2, out uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_LoadBank__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_LoadBank__SWIG_1\")]\n#endif\n  public static extern int CSharp_LoadBank__SWIG_1(uint jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_LoadBank__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_LoadBank__SWIG_2\")]\n#endif\n  public static extern int CSharp_LoadBank__SWIG_2(IntPtr jarg1, uint jarg2, out uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_LoadBank__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_LoadBank__SWIG_3\")]\n#endif\n  public static extern int CSharp_LoadBank__SWIG_3([MarshalAs(UnmanagedType.LPWStr)]string jarg1, IntPtr jarg2, IntPtr jarg3, int jarg4, out uint jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_LoadBank__SWIG_4\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_LoadBank__SWIG_4\")]\n#endif\n  public static extern int CSharp_LoadBank__SWIG_4(uint jarg1, IntPtr jarg2, IntPtr jarg3, int jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_LoadBank__SWIG_5\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_LoadBank__SWIG_5\")]\n#endif\n  public static extern int CSharp_LoadBank__SWIG_5(IntPtr jarg1, uint jarg2, IntPtr jarg3, IntPtr jarg4, out uint jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_UnloadBank__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_UnloadBank__SWIG_0\")]\n#endif\n  public static extern int CSharp_UnloadBank__SWIG_0([MarshalAs(UnmanagedType.LPWStr)]string jarg1, IntPtr jarg2, out int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_UnloadBank__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_UnloadBank__SWIG_1\")]\n#endif\n  public static extern int CSharp_UnloadBank__SWIG_1([MarshalAs(UnmanagedType.LPWStr)]string jarg1, IntPtr jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_UnloadBank__SWIG_4\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_UnloadBank__SWIG_4\")]\n#endif\n  public static extern int CSharp_UnloadBank__SWIG_4(uint jarg1, IntPtr jarg2, out int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_UnloadBank__SWIG_5\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_UnloadBank__SWIG_5\")]\n#endif\n  public static extern int CSharp_UnloadBank__SWIG_5(uint jarg1, IntPtr jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_UnloadBank__SWIG_6\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_UnloadBank__SWIG_6\")]\n#endif\n  public static extern int CSharp_UnloadBank__SWIG_6([MarshalAs(UnmanagedType.LPWStr)]string jarg1, IntPtr jarg2, IntPtr jarg3, IntPtr jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_UnloadBank__SWIG_8\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_UnloadBank__SWIG_8\")]\n#endif\n  public static extern int CSharp_UnloadBank__SWIG_8(uint jarg1, IntPtr jarg2, IntPtr jarg3, IntPtr jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_CancelBankCallbackCookie\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_CancelBankCallbackCookie\")]\n#endif\n  public static extern void CSharp_CancelBankCallbackCookie(IntPtr jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareBank__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareBank__SWIG_0\")]\n#endif\n  public static extern int CSharp_PrepareBank__SWIG_0(int jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareBank__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareBank__SWIG_1\")]\n#endif\n  public static extern int CSharp_PrepareBank__SWIG_1(int jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareBank__SWIG_4\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareBank__SWIG_4\")]\n#endif\n  public static extern int CSharp_PrepareBank__SWIG_4(int jarg1, uint jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareBank__SWIG_5\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareBank__SWIG_5\")]\n#endif\n  public static extern int CSharp_PrepareBank__SWIG_5(int jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareBank__SWIG_6\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareBank__SWIG_6\")]\n#endif\n  public static extern int CSharp_PrepareBank__SWIG_6(int jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2, IntPtr jarg3, IntPtr jarg4, int jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareBank__SWIG_7\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareBank__SWIG_7\")]\n#endif\n  public static extern int CSharp_PrepareBank__SWIG_7(int jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2, IntPtr jarg3, IntPtr jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareBank__SWIG_10\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareBank__SWIG_10\")]\n#endif\n  public static extern int CSharp_PrepareBank__SWIG_10(int jarg1, uint jarg2, IntPtr jarg3, IntPtr jarg4, int jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareBank__SWIG_11\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareBank__SWIG_11\")]\n#endif\n  public static extern int CSharp_PrepareBank__SWIG_11(int jarg1, uint jarg2, IntPtr jarg3, IntPtr jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ClearPreparedEvents\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ClearPreparedEvents\")]\n#endif\n  public static extern int CSharp_ClearPreparedEvents();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareEvent__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareEvent__SWIG_0\")]\n#endif\n  public static extern int CSharp_PrepareEvent__SWIG_0(int jarg1, IntPtr jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareEvent__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareEvent__SWIG_1\")]\n#endif\n  public static extern int CSharp_PrepareEvent__SWIG_1(int jarg1, [In, MarshalAs(UnmanagedType.LPArray)]uint[] jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareEvent__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareEvent__SWIG_2\")]\n#endif\n  public static extern int CSharp_PrepareEvent__SWIG_2(int jarg1, IntPtr jarg2, uint jarg3, IntPtr jarg4, IntPtr jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareEvent__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareEvent__SWIG_3\")]\n#endif\n  public static extern int CSharp_PrepareEvent__SWIG_3(int jarg1, [In, MarshalAs(UnmanagedType.LPArray)]uint[] jarg2, uint jarg3, IntPtr jarg4, IntPtr jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareGameSyncs__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareGameSyncs__SWIG_0\")]\n#endif\n  public static extern int CSharp_PrepareGameSyncs__SWIG_0(int jarg1, int jarg2, [MarshalAs(UnmanagedType.LPWStr)]string jarg3, IntPtr jarg4, uint jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareGameSyncs__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareGameSyncs__SWIG_1\")]\n#endif\n  public static extern int CSharp_PrepareGameSyncs__SWIG_1(int jarg1, int jarg2, uint jarg3, [In, MarshalAs(UnmanagedType.LPArray)]uint[] jarg4, uint jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareGameSyncs__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareGameSyncs__SWIG_2\")]\n#endif\n  public static extern int CSharp_PrepareGameSyncs__SWIG_2(int jarg1, int jarg2, [MarshalAs(UnmanagedType.LPWStr)]string jarg3, IntPtr jarg4, uint jarg5, IntPtr jarg6, IntPtr jarg7);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PrepareGameSyncs__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PrepareGameSyncs__SWIG_3\")]\n#endif\n  public static extern int CSharp_PrepareGameSyncs__SWIG_3(int jarg1, int jarg2, uint jarg3, [In, MarshalAs(UnmanagedType.LPArray)]uint[] jarg4, uint jarg5, IntPtr jarg6, IntPtr jarg7);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetActiveListeners\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetActiveListeners\")]\n#endif\n  public static extern int CSharp_SetActiveListeners(uint jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetListenerSpatialization__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetListenerSpatialization__SWIG_0\")]\n#endif\n  public static extern int CSharp_SetListenerSpatialization__SWIG_0(uint jarg1, bool jarg2, HandleRef jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetListenerSpatialization__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetListenerSpatialization__SWIG_1\")]\n#endif\n  public static extern int CSharp_SetListenerSpatialization__SWIG_1(uint jarg1, bool jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetListenerPipeline\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetListenerPipeline\")]\n#endif\n  public static extern int CSharp_SetListenerPipeline(uint jarg1, bool jarg2, bool jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_0\")]\n#endif\n  public static extern int CSharp_SetRTPCValue__SWIG_0(uint jarg1, float jarg2, uint jarg3, int jarg4, int jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_1\")]\n#endif\n  public static extern int CSharp_SetRTPCValue__SWIG_1(uint jarg1, float jarg2, uint jarg3, int jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_2\")]\n#endif\n  public static extern int CSharp_SetRTPCValue__SWIG_2(uint jarg1, float jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_3\")]\n#endif\n  public static extern int CSharp_SetRTPCValue__SWIG_3(uint jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_4\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_4\")]\n#endif\n  public static extern int CSharp_SetRTPCValue__SWIG_4([MarshalAs(UnmanagedType.LPWStr)]string jarg1, float jarg2, uint jarg3, int jarg4, int jarg5);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_5\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_5\")]\n#endif\n  public static extern int CSharp_SetRTPCValue__SWIG_5([MarshalAs(UnmanagedType.LPWStr)]string jarg1, float jarg2, uint jarg3, int jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_6\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_6\")]\n#endif\n  public static extern int CSharp_SetRTPCValue__SWIG_6([MarshalAs(UnmanagedType.LPWStr)]string jarg1, float jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_7\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetRTPCValue__SWIG_7\")]\n#endif\n  public static extern int CSharp_SetRTPCValue__SWIG_7([MarshalAs(UnmanagedType.LPWStr)]string jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_0\")]\n#endif\n  public static extern int CSharp_ResetRTPCValue__SWIG_0(uint jarg1, uint jarg2, int jarg3, int jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_1\")]\n#endif\n  public static extern int CSharp_ResetRTPCValue__SWIG_1(uint jarg1, uint jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_2\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_2\")]\n#endif\n  public static extern int CSharp_ResetRTPCValue__SWIG_2(uint jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_3\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_3\")]\n#endif\n  public static extern int CSharp_ResetRTPCValue__SWIG_3(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_4\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_4\")]\n#endif\n  public static extern int CSharp_ResetRTPCValue__SWIG_4([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, int jarg3, int jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_5\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_5\")]\n#endif\n  public static extern int CSharp_ResetRTPCValue__SWIG_5([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_6\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_6\")]\n#endif\n  public static extern int CSharp_ResetRTPCValue__SWIG_6([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_7\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ResetRTPCValue__SWIG_7\")]\n#endif\n  public static extern int CSharp_ResetRTPCValue__SWIG_7([MarshalAs(UnmanagedType.LPWStr)]string jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetSwitch__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetSwitch__SWIG_0\")]\n#endif\n  public static extern int CSharp_SetSwitch__SWIG_0(uint jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetSwitch__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetSwitch__SWIG_1\")]\n#endif\n  public static extern int CSharp_SetSwitch__SWIG_1([MarshalAs(UnmanagedType.LPWStr)]string jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostTrigger__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostTrigger__SWIG_0\")]\n#endif\n  public static extern int CSharp_PostTrigger__SWIG_0(uint jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostTrigger__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostTrigger__SWIG_1\")]\n#endif\n  public static extern int CSharp_PostTrigger__SWIG_1([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetState__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetState__SWIG_0\")]\n#endif\n  public static extern int CSharp_SetState__SWIG_0(uint jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetState__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetState__SWIG_1\")]\n#endif\n  public static extern int CSharp_SetState__SWIG_1([MarshalAs(UnmanagedType.LPWStr)]string jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetGameObjectAuxSendValues\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetGameObjectAuxSendValues\")]\n#endif\n  public static extern int CSharp_SetGameObjectAuxSendValues(uint jarg1, IntPtr jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetGameObjectOutputBusVolume\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetGameObjectOutputBusVolume\")]\n#endif\n  public static extern int CSharp_SetGameObjectOutputBusVolume(uint jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetActorMixerEffect\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetActorMixerEffect\")]\n#endif\n  public static extern int CSharp_SetActorMixerEffect(uint jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetBusEffect__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetBusEffect__SWIG_0\")]\n#endif\n  public static extern int CSharp_SetBusEffect__SWIG_0(uint jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetBusEffect__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetBusEffect__SWIG_1\")]\n#endif\n  public static extern int CSharp_SetBusEffect__SWIG_1([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetObjectObstructionAndOcclusion\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetObjectObstructionAndOcclusion\")]\n#endif\n  public static extern int CSharp_SetObjectObstructionAndOcclusion(uint jarg1, uint jarg2, float jarg3, float jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_StartOutputCapture\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_StartOutputCapture\")]\n#endif\n  public static extern int CSharp_StartOutputCapture([MarshalAs(UnmanagedType.LPWStr)]string jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_StopOutputCapture\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_StopOutputCapture\")]\n#endif\n  public static extern int CSharp_StopOutputCapture();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_StartProfilerCapture\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_StartProfilerCapture\")]\n#endif\n  public static extern int CSharp_StartProfilerCapture([MarshalAs(UnmanagedType.LPWStr)]string jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_StopProfilerCapture\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_StopProfilerCapture\")]\n#endif\n  public static extern int CSharp_StopProfilerCapture();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AddSecondaryOutput\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AddSecondaryOutput\")]\n#endif\n  public static extern int CSharp_AddSecondaryOutput(uint jarg1, int jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_RemoveSecondaryOutput\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_RemoveSecondaryOutput\")]\n#endif\n  public static extern int CSharp_RemoveSecondaryOutput(uint jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetSecondaryOutputVolume\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetSecondaryOutputVolume\")]\n#endif\n  public static extern int CSharp_SetSecondaryOutputVolume(uint jarg1, int jarg2, float jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_playlistID_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_playlistID_set\")]\n#endif\n  public static extern void CSharp_AkMusicPlaylistCallbackInfo_playlistID_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_playlistID_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_playlistID_get\")]\n#endif\n  public static extern uint CSharp_AkMusicPlaylistCallbackInfo_playlistID_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uNumPlaylistItems_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uNumPlaylistItems_set\")]\n#endif\n  public static extern void CSharp_AkMusicPlaylistCallbackInfo_uNumPlaylistItems_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uNumPlaylistItems_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uNumPlaylistItems_get\")]\n#endif\n  public static extern uint CSharp_AkMusicPlaylistCallbackInfo_uNumPlaylistItems_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uPlaylistSelection_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uPlaylistSelection_set\")]\n#endif\n  public static extern void CSharp_AkMusicPlaylistCallbackInfo_uPlaylistSelection_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uPlaylistSelection_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uPlaylistSelection_get\")]\n#endif\n  public static extern uint CSharp_AkMusicPlaylistCallbackInfo_uPlaylistSelection_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uPlaylistItemDone_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uPlaylistItemDone_set\")]\n#endif\n  public static extern void CSharp_AkMusicPlaylistCallbackInfo_uPlaylistItemDone_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uPlaylistItemDone_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMusicPlaylistCallbackInfo_uPlaylistItemDone_get\")]\n#endif\n  public static extern uint CSharp_AkMusicPlaylistCallbackInfo_uPlaylistItemDone_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkMusicPlaylistCallbackInfo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkMusicPlaylistCallbackInfo\")]\n#endif\n  public static extern IntPtr CSharp_new_AkMusicPlaylistCallbackInfo();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkMusicPlaylistCallbackInfo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkMusicPlaylistCallbackInfo\")]\n#endif\n  public static extern void CSharp_delete_AkMusicPlaylistCallbackInfo(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMemSettings_uMaxNumPools_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMemSettings_uMaxNumPools_set\")]\n#endif\n  public static extern void CSharp_AkMemSettings_uMaxNumPools_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMemSettings_uMaxNumPools_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMemSettings_uMaxNumPools_get\")]\n#endif\n  public static extern uint CSharp_AkMemSettings_uMaxNumPools_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkMemSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkMemSettings\")]\n#endif\n  public static extern IntPtr CSharp_new_AkMemSettings();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkMemSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkMemSettings\")]\n#endif\n  public static extern void CSharp_delete_AkMemSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMusicSettings_fStreamingLookAheadRatio_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMusicSettings_fStreamingLookAheadRatio_set\")]\n#endif\n  public static extern void CSharp_AkMusicSettings_fStreamingLookAheadRatio_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkMusicSettings_fStreamingLookAheadRatio_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkMusicSettings_fStreamingLookAheadRatio_get\")]\n#endif\n  public static extern float CSharp_AkMusicSettings_fStreamingLookAheadRatio_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkMusicSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkMusicSettings\")]\n#endif\n  public static extern IntPtr CSharp_new_AkMusicSettings();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkMusicSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkMusicSettings\")]\n#endif\n  public static extern void CSharp_delete_AkMusicSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSegmentInfo_iCurrentPosition_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSegmentInfo_iCurrentPosition_set\")]\n#endif\n  public static extern void CSharp_AkSegmentInfo_iCurrentPosition_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSegmentInfo_iCurrentPosition_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSegmentInfo_iCurrentPosition_get\")]\n#endif\n  public static extern int CSharp_AkSegmentInfo_iCurrentPosition_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSegmentInfo_iPreEntryDuration_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSegmentInfo_iPreEntryDuration_set\")]\n#endif\n  public static extern void CSharp_AkSegmentInfo_iPreEntryDuration_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSegmentInfo_iPreEntryDuration_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSegmentInfo_iPreEntryDuration_get\")]\n#endif\n  public static extern int CSharp_AkSegmentInfo_iPreEntryDuration_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSegmentInfo_iActiveDuration_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSegmentInfo_iActiveDuration_set\")]\n#endif\n  public static extern void CSharp_AkSegmentInfo_iActiveDuration_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSegmentInfo_iActiveDuration_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSegmentInfo_iActiveDuration_get\")]\n#endif\n  public static extern int CSharp_AkSegmentInfo_iActiveDuration_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSegmentInfo_iPostExitDuration_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSegmentInfo_iPostExitDuration_set\")]\n#endif\n  public static extern void CSharp_AkSegmentInfo_iPostExitDuration_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSegmentInfo_iPostExitDuration_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSegmentInfo_iPostExitDuration_get\")]\n#endif\n  public static extern int CSharp_AkSegmentInfo_iPostExitDuration_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSegmentInfo_iRemainingLookAheadTime_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSegmentInfo_iRemainingLookAheadTime_set\")]\n#endif\n  public static extern void CSharp_AkSegmentInfo_iRemainingLookAheadTime_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkSegmentInfo_iRemainingLookAheadTime_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkSegmentInfo_iRemainingLookAheadTime_get\")]\n#endif\n  public static extern int CSharp_AkSegmentInfo_iRemainingLookAheadTime_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkSegmentInfo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkSegmentInfo\")]\n#endif\n  public static extern IntPtr CSharp_new_AkSegmentInfo();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkSegmentInfo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkSegmentInfo\")]\n#endif\n  public static extern void CSharp_delete_AkSegmentInfo(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetPlayingSegmentInfo__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetPlayingSegmentInfo__SWIG_0\")]\n#endif\n  public static extern int CSharp_GetPlayingSegmentInfo__SWIG_0(uint jarg1, HandleRef jarg2, bool jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetPlayingSegmentInfo__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetPlayingSegmentInfo__SWIG_1\")]\n#endif\n  public static extern int CSharp_GetPlayingSegmentInfo__SWIG_1(uint jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkCallbackSerializer_Init\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkCallbackSerializer_Init\")]\n#endif\n  public static extern int CSharp_AkCallbackSerializer_Init(IntPtr jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkCallbackSerializer_Term\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkCallbackSerializer_Term\")]\n#endif\n  public static extern void CSharp_AkCallbackSerializer_Term();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkCallbackSerializer_Lock\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkCallbackSerializer_Lock\")]\n#endif\n  public static extern IntPtr CSharp_AkCallbackSerializer_Lock();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkCallbackSerializer_SetLocalOutput\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkCallbackSerializer_SetLocalOutput\")]\n#endif\n  public static extern void CSharp_AkCallbackSerializer_SetLocalOutput(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkCallbackSerializer_Unlock\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkCallbackSerializer_Unlock\")]\n#endif\n  public static extern void CSharp_AkCallbackSerializer_Unlock();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkCallbackSerializer\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkCallbackSerializer\")]\n#endif\n  public static extern IntPtr CSharp_new_AkCallbackSerializer();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkCallbackSerializer\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkCallbackSerializer\")]\n#endif\n  public static extern void CSharp_delete_AkCallbackSerializer(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostCode\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostCode\")]\n#endif\n  public static extern int CSharp_PostCode(int jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_PostString__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_PostString__SWIG_0\")]\n#endif\n  public static extern int CSharp_PostString__SWIG_0([MarshalAs(UnmanagedType.LPWStr)]string jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetTimeStamp\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetTimeStamp\")]\n#endif\n  public static extern int CSharp_GetTimeStamp();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ResolveDialogueEvent__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ResolveDialogueEvent__SWIG_0\")]\n#endif\n  public static extern uint CSharp_ResolveDialogueEvent__SWIG_0(uint jarg1, [In, MarshalAs(UnmanagedType.LPArray)]uint[] jarg2, uint jarg3, uint jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ResolveDialogueEvent__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ResolveDialogueEvent__SWIG_1\")]\n#endif\n  public static extern uint CSharp_ResolveDialogueEvent__SWIG_1(uint jarg1, [In, MarshalAs(UnmanagedType.LPArray)]uint[] jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fCenterPct_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fCenterPct_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_fCenterPct_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fCenterPct_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fCenterPct_get\")]\n#endif\n  public static extern float CSharp_AkPositioningInfo_fCenterPct_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_pannerType_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_pannerType_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_pannerType_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_pannerType_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_pannerType_get\")]\n#endif\n  public static extern int CSharp_AkPositioningInfo_pannerType_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_posSourceType_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_posSourceType_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_posSourceType_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_posSourceType_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_posSourceType_get\")]\n#endif\n  public static extern int CSharp_AkPositioningInfo_posSourceType_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_bUpdateEachFrame_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_bUpdateEachFrame_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_bUpdateEachFrame_set(HandleRef jarg1, bool jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_bUpdateEachFrame_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_bUpdateEachFrame_get\")]\n#endif\n  public static extern bool CSharp_AkPositioningInfo_bUpdateEachFrame_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_bUseSpatialization_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_bUseSpatialization_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_bUseSpatialization_set(HandleRef jarg1, bool jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_bUseSpatialization_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_bUseSpatialization_get\")]\n#endif\n  public static extern bool CSharp_AkPositioningInfo_bUseSpatialization_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_bUseAttenuation_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_bUseAttenuation_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_bUseAttenuation_set(HandleRef jarg1, bool jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_bUseAttenuation_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_bUseAttenuation_get\")]\n#endif\n  public static extern bool CSharp_AkPositioningInfo_bUseAttenuation_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_bUseConeAttenuation_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_bUseConeAttenuation_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_bUseConeAttenuation_set(HandleRef jarg1, bool jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_bUseConeAttenuation_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_bUseConeAttenuation_get\")]\n#endif\n  public static extern bool CSharp_AkPositioningInfo_bUseConeAttenuation_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fInnerAngle_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fInnerAngle_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_fInnerAngle_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fInnerAngle_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fInnerAngle_get\")]\n#endif\n  public static extern float CSharp_AkPositioningInfo_fInnerAngle_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fOuterAngle_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fOuterAngle_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_fOuterAngle_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fOuterAngle_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fOuterAngle_get\")]\n#endif\n  public static extern float CSharp_AkPositioningInfo_fOuterAngle_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fConeMaxAttenuation_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fConeMaxAttenuation_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_fConeMaxAttenuation_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fConeMaxAttenuation_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fConeMaxAttenuation_get\")]\n#endif\n  public static extern float CSharp_AkPositioningInfo_fConeMaxAttenuation_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_LPFCone_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_LPFCone_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_LPFCone_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_LPFCone_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_LPFCone_get\")]\n#endif\n  public static extern float CSharp_AkPositioningInfo_LPFCone_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fMaxDistance_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fMaxDistance_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_fMaxDistance_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fMaxDistance_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fMaxDistance_get\")]\n#endif\n  public static extern float CSharp_AkPositioningInfo_fMaxDistance_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fVolDryAtMaxDist_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fVolDryAtMaxDist_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_fVolDryAtMaxDist_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fVolDryAtMaxDist_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fVolDryAtMaxDist_get\")]\n#endif\n  public static extern float CSharp_AkPositioningInfo_fVolDryAtMaxDist_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_get\")]\n#endif\n  public static extern float CSharp_AkPositioningInfo_fVolAuxGameDefAtMaxDist_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_get\")]\n#endif\n  public static extern float CSharp_AkPositioningInfo_fVolAuxUserDefAtMaxDist_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_LPFValueAtMaxDist_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_LPFValueAtMaxDist_set\")]\n#endif\n  public static extern void CSharp_AkPositioningInfo_LPFValueAtMaxDist_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPositioningInfo_LPFValueAtMaxDist_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPositioningInfo_LPFValueAtMaxDist_get\")]\n#endif\n  public static extern float CSharp_AkPositioningInfo_LPFValueAtMaxDist_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkPositioningInfo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkPositioningInfo\")]\n#endif\n  public static extern IntPtr CSharp_new_AkPositioningInfo();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkPositioningInfo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkPositioningInfo\")]\n#endif\n  public static extern void CSharp_delete_AkPositioningInfo(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkObjectInfo_objID_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkObjectInfo_objID_set\")]\n#endif\n  public static extern void CSharp_AkObjectInfo_objID_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkObjectInfo_objID_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkObjectInfo_objID_get\")]\n#endif\n  public static extern uint CSharp_AkObjectInfo_objID_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkObjectInfo_parentID_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkObjectInfo_parentID_set\")]\n#endif\n  public static extern void CSharp_AkObjectInfo_parentID_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkObjectInfo_parentID_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkObjectInfo_parentID_get\")]\n#endif\n  public static extern uint CSharp_AkObjectInfo_parentID_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkObjectInfo_iDepth_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkObjectInfo_iDepth_set\")]\n#endif\n  public static extern void CSharp_AkObjectInfo_iDepth_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkObjectInfo_iDepth_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkObjectInfo_iDepth_get\")]\n#endif\n  public static extern int CSharp_AkObjectInfo_iDepth_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkObjectInfo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkObjectInfo\")]\n#endif\n  public static extern IntPtr CSharp_new_AkObjectInfo();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkObjectInfo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkObjectInfo\")]\n#endif\n  public static extern void CSharp_delete_AkObjectInfo(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetPosition\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetPosition\")]\n#endif\n  public static extern int CSharp_GetPosition(uint jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetActiveListeners\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetActiveListeners\")]\n#endif\n  public static extern int CSharp_GetActiveListeners(uint jarg1, out uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetListenerPosition\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetListenerPosition\")]\n#endif\n  public static extern int CSharp_GetListenerPosition(uint jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetListenerSpatialization\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetListenerSpatialization\")]\n#endif\n  public static extern int CSharp_GetListenerSpatialization(uint jarg1, out int jarg2, HandleRef jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetRTPCValue__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetRTPCValue__SWIG_0\")]\n#endif\n  public static extern int CSharp_GetRTPCValue__SWIG_0(uint jarg1, uint jarg2, out float jarg3, ref int jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetRTPCValue__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetRTPCValue__SWIG_1\")]\n#endif\n  public static extern int CSharp_GetRTPCValue__SWIG_1([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, out float jarg3, ref int jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetSwitch__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetSwitch__SWIG_0\")]\n#endif\n  public static extern int CSharp_GetSwitch__SWIG_0(uint jarg1, uint jarg2, out uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetSwitch__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetSwitch__SWIG_1\")]\n#endif\n  public static extern int CSharp_GetSwitch__SWIG_1([MarshalAs(UnmanagedType.LPWStr)]string jarg1, uint jarg2, out uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetState__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetState__SWIG_0\")]\n#endif\n  public static extern int CSharp_GetState__SWIG_0(uint jarg1, out uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetState__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetState__SWIG_1\")]\n#endif\n  public static extern int CSharp_GetState__SWIG_1([MarshalAs(UnmanagedType.LPWStr)]string jarg1, out uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetGameObjectAuxSendValues\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetGameObjectAuxSendValues\")]\n#endif\n  public static extern int CSharp_GetGameObjectAuxSendValues(uint jarg1, IntPtr jarg2, ref uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetGameObjectDryLevelValue\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetGameObjectDryLevelValue\")]\n#endif\n  public static extern int CSharp_GetGameObjectDryLevelValue(uint jarg1, out float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetObjectObstructionAndOcclusion\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetObjectObstructionAndOcclusion\")]\n#endif\n  public static extern int CSharp_GetObjectObstructionAndOcclusion(uint jarg1, uint jarg2, out float jarg3, out float jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_QueryAudioObjectIDs__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_QueryAudioObjectIDs__SWIG_0\")]\n#endif\n  public static extern int CSharp_QueryAudioObjectIDs__SWIG_0(uint jarg1, ref uint jarg2, HandleRef jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_QueryAudioObjectIDs__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_QueryAudioObjectIDs__SWIG_1\")]\n#endif\n  public static extern int CSharp_QueryAudioObjectIDs__SWIG_1([MarshalAs(UnmanagedType.LPWStr)]string jarg1, ref uint jarg2, HandleRef jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetPositioningInfo\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetPositioningInfo\")]\n#endif\n  public static extern int CSharp_GetPositioningInfo(uint jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetIsGameObjectActive\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetIsGameObjectActive\")]\n#endif\n  public static extern bool CSharp_GetIsGameObjectActive(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetMaxRadius\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetMaxRadius\")]\n#endif\n  public static extern float CSharp_GetMaxRadius(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetEventIDFromPlayingID\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetEventIDFromPlayingID\")]\n#endif\n  public static extern uint CSharp_GetEventIDFromPlayingID(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetGameObjectFromPlayingID\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetGameObjectFromPlayingID\")]\n#endif\n  public static extern uint CSharp_GetGameObjectFromPlayingID(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetPlayingIDsFromGameObject\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetPlayingIDsFromGameObject\")]\n#endif\n  public static extern int CSharp_GetPlayingIDsFromGameObject(uint jarg1, ref uint jarg2, [Out, MarshalAs(UnmanagedType.LPArray)]uint[] jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetCustomPropertyValue__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetCustomPropertyValue__SWIG_0\")]\n#endif\n  public static extern int CSharp_GetCustomPropertyValue__SWIG_0(uint jarg1, uint jarg2, out int jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetCustomPropertyValue__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetCustomPropertyValue__SWIG_1\")]\n#endif\n  public static extern int CSharp_GetCustomPropertyValue__SWIG_1(uint jarg1, uint jarg2, out float jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER\")]\n#endif\n  public static extern void CSharp_AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER(ref uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AK_SPEAKER_SETUP_FIX_SIDE_TO_REAR\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AK_SPEAKER_SETUP_FIX_SIDE_TO_REAR\")]\n#endif\n  public static extern void CSharp_AK_SPEAKER_SETUP_FIX_SIDE_TO_REAR(ref uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AK_SPEAKER_SETUP_CONVERT_TO_SUPPORTED\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AK_SPEAKER_SETUP_CONVERT_TO_SUPPORTED\")]\n#endif\n  public static extern void CSharp_AK_SPEAKER_SETUP_CONVERT_TO_SUPPORTED(ref uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ChannelMaskToNumChannels\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ChannelMaskToNumChannels\")]\n#endif\n  public static extern uint CSharp_ChannelMaskToNumChannels(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ChannelMaskFromNumChannels\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ChannelMaskFromNumChannels\")]\n#endif\n  public static extern uint CSharp_ChannelMaskFromNumChannels(uint jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_ChannelIndexToDisplayIndex\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_ChannelIndexToDisplayIndex\")]\n#endif\n  public static extern uint CSharp_ChannelIndexToDisplayIndex(int jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AddPlayerMotionDevice__SWIG_0\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AddPlayerMotionDevice__SWIG_0\")]\n#endif\n  public static extern int CSharp_AddPlayerMotionDevice__SWIG_0(byte jarg1, uint jarg2, uint jarg3, IntPtr jarg4);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AddPlayerMotionDevice__SWIG_1\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AddPlayerMotionDevice__SWIG_1\")]\n#endif\n  public static extern int CSharp_AddPlayerMotionDevice__SWIG_1(byte jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_RemovePlayerMotionDevice\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_RemovePlayerMotionDevice\")]\n#endif\n  public static extern void CSharp_RemovePlayerMotionDevice(byte jarg1, uint jarg2, uint jarg3);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetPlayerListener\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetPlayerListener\")]\n#endif\n  public static extern void CSharp_SetPlayerListener(byte jarg1, byte jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetPlayerVolume\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetPlayerVolume\")]\n#endif\n  public static extern void CSharp_SetPlayerVolume(byte jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkStreamMgrSettings_uMemorySize_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkStreamMgrSettings_uMemorySize_set\")]\n#endif\n  public static extern void CSharp_AkStreamMgrSettings_uMemorySize_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkStreamMgrSettings_uMemorySize_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkStreamMgrSettings_uMemorySize_get\")]\n#endif\n  public static extern uint CSharp_AkStreamMgrSettings_uMemorySize_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkStreamMgrSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkStreamMgrSettings\")]\n#endif\n  public static extern IntPtr CSharp_new_AkStreamMgrSettings();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkStreamMgrSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkStreamMgrSettings\")]\n#endif\n  public static extern void CSharp_delete_AkStreamMgrSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_pIOMemory_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_pIOMemory_set\")]\n#endif\n  public static extern void CSharp_AkDeviceSettings_pIOMemory_set(HandleRef jarg1, IntPtr jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_pIOMemory_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_pIOMemory_get\")]\n#endif\n  public static extern IntPtr CSharp_AkDeviceSettings_pIOMemory_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_uIOMemorySize_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_uIOMemorySize_set\")]\n#endif\n  public static extern void CSharp_AkDeviceSettings_uIOMemorySize_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_uIOMemorySize_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_uIOMemorySize_get\")]\n#endif\n  public static extern uint CSharp_AkDeviceSettings_uIOMemorySize_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_uIOMemoryAlignment_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_uIOMemoryAlignment_set\")]\n#endif\n  public static extern void CSharp_AkDeviceSettings_uIOMemoryAlignment_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_uIOMemoryAlignment_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_uIOMemoryAlignment_get\")]\n#endif\n  public static extern uint CSharp_AkDeviceSettings_uIOMemoryAlignment_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_ePoolAttributes_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_ePoolAttributes_set\")]\n#endif\n  public static extern void CSharp_AkDeviceSettings_ePoolAttributes_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_ePoolAttributes_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_ePoolAttributes_get\")]\n#endif\n  public static extern int CSharp_AkDeviceSettings_ePoolAttributes_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_uGranularity_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_uGranularity_set\")]\n#endif\n  public static extern void CSharp_AkDeviceSettings_uGranularity_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_uGranularity_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_uGranularity_get\")]\n#endif\n  public static extern uint CSharp_AkDeviceSettings_uGranularity_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_uSchedulerTypeFlags_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_uSchedulerTypeFlags_set\")]\n#endif\n  public static extern void CSharp_AkDeviceSettings_uSchedulerTypeFlags_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_uSchedulerTypeFlags_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_uSchedulerTypeFlags_get\")]\n#endif\n  public static extern uint CSharp_AkDeviceSettings_uSchedulerTypeFlags_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_threadProperties_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_threadProperties_set\")]\n#endif\n  public static extern void CSharp_AkDeviceSettings_threadProperties_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_threadProperties_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_threadProperties_get\")]\n#endif\n  public static extern IntPtr CSharp_AkDeviceSettings_threadProperties_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_set\")]\n#endif\n  public static extern void CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_get\")]\n#endif\n  public static extern float CSharp_AkDeviceSettings_fTargetAutoStmBufferLength_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_uMaxConcurrentIO_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_uMaxConcurrentIO_set\")]\n#endif\n  public static extern void CSharp_AkDeviceSettings_uMaxConcurrentIO_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_uMaxConcurrentIO_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_uMaxConcurrentIO_get\")]\n#endif\n  public static extern uint CSharp_AkDeviceSettings_uMaxConcurrentIO_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_fMaxCacheRatio_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_fMaxCacheRatio_set\")]\n#endif\n  public static extern void CSharp_AkDeviceSettings_fMaxCacheRatio_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkDeviceSettings_fMaxCacheRatio_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkDeviceSettings_fMaxCacheRatio_get\")]\n#endif\n  public static extern float CSharp_AkDeviceSettings_fMaxCacheRatio_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkDeviceSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkDeviceSettings\")]\n#endif\n  public static extern IntPtr CSharp_new_AkDeviceSettings();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkDeviceSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkDeviceSettings\")]\n#endif\n  public static extern void CSharp_delete_AkDeviceSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadLEngine_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadLEngine_set\")]\n#endif\n  public static extern void CSharp_AkPlatformInitSettings_threadLEngine_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadLEngine_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadLEngine_get\")]\n#endif\n  public static extern IntPtr CSharp_AkPlatformInitSettings_threadLEngine_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadBankManager_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadBankManager_set\")]\n#endif\n  public static extern void CSharp_AkPlatformInitSettings_threadBankManager_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadBankManager_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadBankManager_get\")]\n#endif\n  public static extern IntPtr CSharp_AkPlatformInitSettings_threadBankManager_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadMonitor_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadMonitor_set\")]\n#endif\n  public static extern void CSharp_AkPlatformInitSettings_threadMonitor_set(HandleRef jarg1, HandleRef jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadMonitor_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_threadMonitor_get\")]\n#endif\n  public static extern IntPtr CSharp_AkPlatformInitSettings_threadMonitor_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_set\")]\n#endif\n  public static extern void CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_get\")]\n#endif\n  public static extern uint CSharp_AkPlatformInitSettings_uLEngineDefaultPoolSize_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_set\")]\n#endif\n  public static extern void CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_set(HandleRef jarg1, float jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_get\")]\n#endif\n  public static extern float CSharp_AkPlatformInitSettings_fLEngineDefaultPoolRatioThreshold_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_uNumRefillsInVoice_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_uNumRefillsInVoice_set\")]\n#endif\n  public static extern void CSharp_AkPlatformInitSettings_uNumRefillsInVoice_set(HandleRef jarg1, ushort jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_uNumRefillsInVoice_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_uNumRefillsInVoice_get\")]\n#endif\n  public static extern ushort CSharp_AkPlatformInitSettings_uNumRefillsInVoice_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_eAudioQuality_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_eAudioQuality_set\")]\n#endif\n  public static extern void CSharp_AkPlatformInitSettings_eAudioQuality_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_eAudioQuality_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_eAudioQuality_get\")]\n#endif\n  public static extern int CSharp_AkPlatformInitSettings_eAudioQuality_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_bGlobalFocus_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_bGlobalFocus_set\")]\n#endif\n  public static extern void CSharp_AkPlatformInitSettings_bGlobalFocus_set(HandleRef jarg1, bool jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkPlatformInitSettings_bGlobalFocus_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkPlatformInitSettings_bGlobalFocus_get\")]\n#endif\n  public static extern bool CSharp_AkPlatformInitSettings_bGlobalFocus_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkPlatformInitSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkPlatformInitSettings\")]\n#endif\n  public static extern IntPtr CSharp_new_AkPlatformInitSettings();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkPlatformInitSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkPlatformInitSettings\")]\n#endif\n  public static extern void CSharp_delete_AkPlatformInitSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkThreadProperties_nPriority_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkThreadProperties_nPriority_set\")]\n#endif\n  public static extern void CSharp_AkThreadProperties_nPriority_set(HandleRef jarg1, int jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkThreadProperties_nPriority_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkThreadProperties_nPriority_get\")]\n#endif\n  public static extern int CSharp_AkThreadProperties_nPriority_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkThreadProperties_dwAffinityMask_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkThreadProperties_dwAffinityMask_set\")]\n#endif\n  public static extern void CSharp_AkThreadProperties_dwAffinityMask_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkThreadProperties_dwAffinityMask_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkThreadProperties_dwAffinityMask_get\")]\n#endif\n  public static extern uint CSharp_AkThreadProperties_dwAffinityMask_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkThreadProperties_uStackSize_set\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkThreadProperties_uStackSize_set\")]\n#endif\n  public static extern void CSharp_AkThreadProperties_uStackSize_set(HandleRef jarg1, uint jarg2);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_AkThreadProperties_uStackSize_get\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_AkThreadProperties_uStackSize_get\")]\n#endif\n  public static extern uint CSharp_AkThreadProperties_uStackSize_get(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_new_AkThreadProperties\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_new_AkThreadProperties\")]\n#endif\n  public static extern IntPtr CSharp_new_AkThreadProperties();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_delete_AkThreadProperties\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_delete_AkThreadProperties\")]\n#endif\n  public static extern void CSharp_delete_AkThreadProperties(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Term\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Term\")]\n#endif\n  public static extern void CSharp_Term();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Init\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Init\")]\n#endif\n  public static extern int CSharp_Init(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, HandleRef jarg5, HandleRef jarg6);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetDefaultStreamSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetDefaultStreamSettings\")]\n#endif\n  public static extern void CSharp_GetDefaultStreamSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetDefaultDeviceSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetDefaultDeviceSettings\")]\n#endif\n  public static extern void CSharp_GetDefaultDeviceSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetDefaultMusicSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetDefaultMusicSettings\")]\n#endif\n  public static extern void CSharp_GetDefaultMusicSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetDefaultInitSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetDefaultInitSettings\")]\n#endif\n  public static extern void CSharp_GetDefaultInitSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_GetDefaultPlatformInitSettings\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_GetDefaultPlatformInitSettings\")]\n#endif\n  public static extern void CSharp_GetDefaultPlatformInitSettings(HandleRef jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetBasePath\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetBasePath\")]\n#endif\n  public static extern int CSharp_SetBasePath([MarshalAs(UnmanagedType.LPWStr)]string jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetBankPath\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetBankPath\")]\n#endif\n  public static extern int CSharp_SetBankPath([MarshalAs(UnmanagedType.LPWStr)]string jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetAudioSrcPath\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetAudioSrcPath\")]\n#endif\n  public static extern int CSharp_SetAudioSrcPath([MarshalAs(UnmanagedType.LPWStr)]string jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetCurrentLanguage\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetCurrentLanguage\")]\n#endif\n  public static extern int CSharp_SetCurrentLanguage([MarshalAs(UnmanagedType.LPWStr)]string jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetObjectPosition\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetObjectPosition\")]\n#endif\n  public static extern int CSharp_SetObjectPosition(uint jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_SetListenerPosition\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_SetListenerPosition\")]\n#endif\n  public static extern int CSharp_SetListenerPosition(float jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9, uint jarg10);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_IsInitialized\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_IsInitialized\")]\n#endif\n  public static extern bool CSharp_IsInitialized();\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_WwiseObjectID_SWIGUpcast\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_WwiseObjectID_SWIGUpcast\")]\n#endif\n  public static extern IntPtr CSharp_WwiseObjectID_SWIGUpcast(IntPtr jarg1);\n\n#if DEBUG\n  [DllImport(\"AkSoundEngine_Win32_Profile\", EntryPoint=\"CSharp_Playlist_SWIGUpcast\")]\n#else\n  [DllImport(\"AkSoundEngine_Win32_Release\", EntryPoint=\"CSharp_Playlist_SWIGUpcast\")]\n#endif\n  public static extern IntPtr CSharp_Playlist_SWIGUpcast(IntPtr jarg1);}\n"
  },
  {
    "path": "Wwise/Generated/Windows/AkSoundEngine_Windows.cs",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\nusing Microsoft.Xna.Framework;\n\npublic class AkSoundEngine {\n\tpublic static IntPtr VirtualAllocHook(IntPtr in_pMemAddress, uint in_size, uint in_dwAllocationType, uint in_dwProtect) { return AkSoundEnginePINVOKE.CSharp_VirtualAllocHook(in_pMemAddress, in_size, in_dwAllocationType, in_dwProtect); }\n\tpublic static ComponentBind.Entity DefaultGameObject = null;\n\n\tpublic static void VirtualFreeHook(IntPtr in_pMemAddress, uint in_size, uint in_dwFreeType) {\n\t\tAkSoundEnginePINVOKE.CSharp_VirtualFreeHook(in_pMemAddress, in_size, in_dwFreeType);\n\t}\n\n\tpublic static uint AK_INVALID_AUX_ID {\n\t\tget {\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_AK_INVALID_AUX_ID_get();\n\t\t\treturn ret;\n\t\t} \n\t}\n\n\tpublic static uint AK_INVALID_CHANNELMASK {\n\t\tget {\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_AK_INVALID_CHANNELMASK_get();\n\t\t\treturn ret;\n\t\t} \n\t}\n\n\tpublic static uint AK_INVALID_OUTPUT_DEVICE_ID {\n\t\tget {\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_AK_INVALID_OUTPUT_DEVICE_ID_get();\n\t\t\treturn ret;\n\t\t} \n\t}\n\n\tpublic static uint DynamicSequenceOpen(ComponentBind.Entity in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie, DynamicSequenceType in_eDynamicSequenceType) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_DynamicSequenceOpen__SWIG_0(tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), (int)in_eDynamicSequenceType);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint DynamicSequenceOpen(ComponentBind.Entity in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_DynamicSequenceOpen__SWIG_1(tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint DynamicSequenceOpen(ComponentBind.Entity in_gameObjectID, uint in_uFlags) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_DynamicSequenceOpen__SWIG_2(tempin_gameObjectID, in_uFlags);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint DynamicSequenceOpen(ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_DynamicSequenceOpen__SWIG_3(tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT DynamicSequenceClose(uint in_playingID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequenceClose(in_playingID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequencePlay(uint in_playingID, int in_uTransitionDuration, AkCurveInterpolation in_eFadeCurve) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequencePlay__SWIG_0(in_playingID, in_uTransitionDuration, (int)in_eFadeCurve);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequencePlay(uint in_playingID, int in_uTransitionDuration) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequencePlay__SWIG_1(in_playingID, in_uTransitionDuration);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequencePlay(uint in_playingID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequencePlay__SWIG_2(in_playingID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequencePause(uint in_playingID, int in_uTransitionDuration, AkCurveInterpolation in_eFadeCurve) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequencePause__SWIG_0(in_playingID, in_uTransitionDuration, (int)in_eFadeCurve);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequencePause(uint in_playingID, int in_uTransitionDuration) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequencePause__SWIG_1(in_playingID, in_uTransitionDuration);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequencePause(uint in_playingID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequencePause__SWIG_2(in_playingID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequenceResume(uint in_playingID, int in_uTransitionDuration, AkCurveInterpolation in_eFadeCurve) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequenceResume__SWIG_0(in_playingID, in_uTransitionDuration, (int)in_eFadeCurve);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequenceResume(uint in_playingID, int in_uTransitionDuration) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequenceResume__SWIG_1(in_playingID, in_uTransitionDuration);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequenceResume(uint in_playingID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequenceResume__SWIG_2(in_playingID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequenceStop(uint in_playingID, int in_uTransitionDuration, AkCurveInterpolation in_eFadeCurve) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequenceStop__SWIG_0(in_playingID, in_uTransitionDuration, (int)in_eFadeCurve);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequenceStop(uint in_playingID, int in_uTransitionDuration) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequenceStop__SWIG_1(in_playingID, in_uTransitionDuration);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequenceStop(uint in_playingID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequenceStop__SWIG_2(in_playingID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequenceBreak(uint in_playingID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequenceBreak(in_playingID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static Playlist DynamicSequenceLockPlaylist(uint in_playingID) {\n\t\tIntPtr cPtr = AkSoundEnginePINVOKE.CSharp_DynamicSequenceLockPlaylist(in_playingID);\n\t\tPlaylist ret = (cPtr == IntPtr.Zero) ? null : new Playlist(cPtr, false);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT DynamicSequenceUnlockPlaylist(uint in_playingID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_DynamicSequenceUnlockPlaylist(in_playingID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static uint GetSpeakerConfiguration(AkSinkType in_eSinkType, uint in_iOutputID) {\n\t\tuint ret = AkSoundEnginePINVOKE.CSharp_GetSpeakerConfiguration__SWIG_0((int)in_eSinkType, in_iOutputID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static uint GetSpeakerConfiguration(AkSinkType in_eSinkType) {\n\t\tuint ret = AkSoundEnginePINVOKE.CSharp_GetSpeakerConfiguration__SWIG_1((int)in_eSinkType);\n\n\t\treturn ret;\n\t}\n\n\tpublic static uint GetSpeakerConfiguration() {\n\t\tuint ret = AkSoundEnginePINVOKE.CSharp_GetSpeakerConfiguration__SWIG_2();\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetPanningRule(out int out_ePanningRule, AkSinkType in_eSinkType, uint in_iOutputID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetPanningRule__SWIG_0(out out_ePanningRule, (int)in_eSinkType, in_iOutputID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetPanningRule(out int out_ePanningRule, AkSinkType in_eSinkType) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetPanningRule__SWIG_1(out out_ePanningRule, (int)in_eSinkType);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetPanningRule(out int out_ePanningRule) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetPanningRule__SWIG_2(out out_ePanningRule);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetPanningRule(AkPanningRule in_ePanningRule, AkSinkType in_eSinkType, uint in_iOutputID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetPanningRule__SWIG_0((int)in_ePanningRule, (int)in_eSinkType, in_iOutputID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetPanningRule(AkPanningRule in_ePanningRule, AkSinkType in_eSinkType) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetPanningRule__SWIG_1((int)in_ePanningRule, (int)in_eSinkType);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetPanningRule(AkPanningRule in_ePanningRule) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetPanningRule__SWIG_2((int)in_ePanningRule);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetSpeakerAngles(ref float io_pfSpeakerAngles, ref uint io_uNumAngles, AkSinkType in_eSinkType, uint in_iOutputID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetSpeakerAngles__SWIG_0(ref io_pfSpeakerAngles, ref io_uNumAngles, (int)in_eSinkType, in_iOutputID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetSpeakerAngles(ref float io_pfSpeakerAngles, ref uint io_uNumAngles, AkSinkType in_eSinkType) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetSpeakerAngles__SWIG_1(ref io_pfSpeakerAngles, ref io_uNumAngles, (int)in_eSinkType);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetSpeakerAngles(ref float io_pfSpeakerAngles, ref uint io_uNumAngles) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetSpeakerAngles__SWIG_2(ref io_pfSpeakerAngles, ref io_uNumAngles);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetSpeakerAngles(float in_pfSpeakerAngles, uint in_uNumAngles, AkSinkType in_eSinkType, uint in_iOutputID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetSpeakerAngles__SWIG_0(in_pfSpeakerAngles, in_uNumAngles, (int)in_eSinkType, in_iOutputID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetSpeakerAngles(float in_pfSpeakerAngles, uint in_uNumAngles, AkSinkType in_eSinkType) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetSpeakerAngles__SWIG_1(in_pfSpeakerAngles, in_uNumAngles, (int)in_eSinkType);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetSpeakerAngles(float in_pfSpeakerAngles, uint in_uNumAngles) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetSpeakerAngles__SWIG_2(in_pfSpeakerAngles, in_uNumAngles);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetVolumeThreshold(float in_fVolumeThresholdDB) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetVolumeThreshold(in_fVolumeThresholdDB);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetMaxNumVoicesLimit(ushort in_maxNumberVoices) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetMaxNumVoicesLimit(in_maxNumberVoices);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT RenderAudio() {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_RenderAudio();\n\n\t\treturn ret;\n\t}\n\n\tpublic static uint GetIDFromString(string in_pszString) {\n\t\tuint ret = AkSoundEnginePINVOKE.CSharp_GetIDFromString__SWIG_0(in_pszString);\n\n\t\treturn ret;\n\t}\n\n\tpublic static uint PostEvent(uint in_eventID, ComponentBind.Entity in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie, uint in_cExternals, AkExternalSourceInfo in_pExternalSources, uint in_PlayingID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_0(in_eventID, tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), in_cExternals, AkExternalSourceInfo.getCPtr(in_pExternalSources), in_PlayingID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint PostEvent(uint in_eventID, ComponentBind.Entity in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie, uint in_cExternals, AkExternalSourceInfo in_pExternalSources) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_1(in_eventID, tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), in_cExternals, AkExternalSourceInfo.getCPtr(in_pExternalSources));\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint PostEvent(uint in_eventID, ComponentBind.Entity in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie, uint in_cExternals) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_2(in_eventID, tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), in_cExternals);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint PostEvent(uint in_eventID, ComponentBind.Entity in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_3(in_eventID, tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint PostEvent(uint in_eventID, ComponentBind.Entity in_gameObjectID, uint in_uFlags) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_4(in_eventID, tempin_gameObjectID, in_uFlags);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint PostEvent(uint in_eventID, uint gameObject)\n\t{\n\t\treturn AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_5(in_eventID, gameObject);\n\t}\n\n\tpublic static uint PostEvent(uint in_eventID, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_5(in_eventID, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint PostEvent(string in_pszEventName, ComponentBind.Entity in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie, uint in_cExternals, AkExternalSourceInfo in_pExternalSources, uint in_PlayingID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_6(in_pszEventName, tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), in_cExternals, AkExternalSourceInfo.getCPtr(in_pExternalSources), in_PlayingID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint PostEvent(string in_pszEventName, ComponentBind.Entity in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie, uint in_cExternals, AkExternalSourceInfo in_pExternalSources) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_7(in_pszEventName, tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), in_cExternals, AkExternalSourceInfo.getCPtr(in_pExternalSources));\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint PostEvent(string in_pszEventName, ComponentBind.Entity in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie, uint in_cExternals) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_8(in_pszEventName, tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), in_cExternals);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint PostEvent(string in_pszEventName, ComponentBind.Entity in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_9(in_pszEventName, tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint PostEvent(string in_pszEventName, ComponentBind.Entity in_gameObjectID, uint in_uFlags) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_10(in_pszEventName, tempin_gameObjectID, in_uFlags);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint PostEvent(string in_pszEventName, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tuint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_11(in_pszEventName, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ExecuteActionOnEvent(uint in_eventID, AkActionOnEventType in_ActionType, ComponentBind.Entity in_gameObjectID, int in_uTransitionDuration, AkCurveInterpolation in_eFadeCurve, uint in_PlayingID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ExecuteActionOnEvent__SWIG_0(in_eventID, (int)in_ActionType, tempin_gameObjectID, in_uTransitionDuration, (int)in_eFadeCurve, in_PlayingID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ExecuteActionOnEvent(uint in_eventID, AkActionOnEventType in_ActionType, ComponentBind.Entity in_gameObjectID, int in_uTransitionDuration, AkCurveInterpolation in_eFadeCurve) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ExecuteActionOnEvent__SWIG_1(in_eventID, (int)in_ActionType, tempin_gameObjectID, in_uTransitionDuration, (int)in_eFadeCurve);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ExecuteActionOnEvent(uint in_eventID, AkActionOnEventType in_ActionType, ComponentBind.Entity in_gameObjectID, int in_uTransitionDuration) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ExecuteActionOnEvent__SWIG_2(in_eventID, (int)in_ActionType, tempin_gameObjectID, in_uTransitionDuration);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ExecuteActionOnEvent(uint in_eventID, AkActionOnEventType in_ActionType, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ExecuteActionOnEvent__SWIG_3(in_eventID, (int)in_ActionType, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ExecuteActionOnEvent(uint in_eventID, AkActionOnEventType in_ActionType) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ExecuteActionOnEvent__SWIG_4(in_eventID, (int)in_ActionType);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT ExecuteActionOnEvent(string in_pszEventName, AkActionOnEventType in_ActionType, ComponentBind.Entity in_gameObjectID, int in_uTransitionDuration, AkCurveInterpolation in_eFadeCurve, uint in_PlayingID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ExecuteActionOnEvent__SWIG_5(in_pszEventName, (int)in_ActionType, tempin_gameObjectID, in_uTransitionDuration, (int)in_eFadeCurve, in_PlayingID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ExecuteActionOnEvent(string in_pszEventName, AkActionOnEventType in_ActionType, ComponentBind.Entity in_gameObjectID, int in_uTransitionDuration, AkCurveInterpolation in_eFadeCurve) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ExecuteActionOnEvent__SWIG_6(in_pszEventName, (int)in_ActionType, tempin_gameObjectID, in_uTransitionDuration, (int)in_eFadeCurve);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ExecuteActionOnEvent(string in_pszEventName, AkActionOnEventType in_ActionType, ComponentBind.Entity in_gameObjectID, int in_uTransitionDuration) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ExecuteActionOnEvent__SWIG_7(in_pszEventName, (int)in_ActionType, tempin_gameObjectID, in_uTransitionDuration);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ExecuteActionOnEvent(string in_pszEventName, AkActionOnEventType in_ActionType, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ExecuteActionOnEvent__SWIG_8(in_pszEventName, (int)in_ActionType, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ExecuteActionOnEvent(string in_pszEventName, AkActionOnEventType in_ActionType) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ExecuteActionOnEvent__SWIG_9(in_pszEventName, (int)in_ActionType);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SeekOnEvent(uint in_eventID, ComponentBind.Entity in_gameObjectID, int in_iPosition, bool in_bSeekToNearestMarker) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SeekOnEvent__SWIG_0(in_eventID, tempin_gameObjectID, in_iPosition, in_bSeekToNearestMarker);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SeekOnEvent(uint in_eventID, ComponentBind.Entity in_gameObjectID, int in_iPosition) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SeekOnEvent__SWIG_1(in_eventID, tempin_gameObjectID, in_iPosition);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SeekOnEvent(string in_pszEventName, ComponentBind.Entity in_gameObjectID, int in_iPosition, bool in_bSeekToNearestMarker) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SeekOnEvent__SWIG_2(in_pszEventName, tempin_gameObjectID, in_iPosition, in_bSeekToNearestMarker);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SeekOnEvent(string in_pszEventName, ComponentBind.Entity in_gameObjectID, int in_iPosition) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SeekOnEvent__SWIG_3(in_pszEventName, tempin_gameObjectID, in_iPosition);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SeekOnEvent(uint in_eventID, ComponentBind.Entity in_gameObjectID, float in_fPercent, bool in_bSeekToNearestMarker) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SeekOnEvent__SWIG_6(in_eventID, tempin_gameObjectID, in_fPercent, in_bSeekToNearestMarker);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SeekOnEvent(uint in_eventID, ComponentBind.Entity in_gameObjectID, float in_fPercent) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SeekOnEvent__SWIG_7(in_eventID, tempin_gameObjectID, in_fPercent);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SeekOnEvent(string in_pszEventName, ComponentBind.Entity in_gameObjectID, float in_fPercent, bool in_bSeekToNearestMarker) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SeekOnEvent__SWIG_8(in_pszEventName, tempin_gameObjectID, in_fPercent, in_bSeekToNearestMarker);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SeekOnEvent(string in_pszEventName, ComponentBind.Entity in_gameObjectID, float in_fPercent) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SeekOnEvent__SWIG_9(in_pszEventName, tempin_gameObjectID, in_fPercent);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static void CancelEventCallbackCookie(object in_pCookie) {\n\t\tAkSoundEnginePINVOKE.CSharp_CancelEventCallbackCookie((IntPtr)in_pCookie.GetHashCode());\n\n\t}\n\n\tpublic static void CancelEventCallback(uint in_playingID) {\n\t\tAkSoundEnginePINVOKE.CSharp_CancelEventCallback(in_playingID);\n\n\t}\n\n\tpublic static AKRESULT GetSourcePlayPosition(uint in_PlayingID, out int out_puPosition, bool in_bExtrapolate) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetSourcePlayPosition__SWIG_0(in_PlayingID, out out_puPosition, in_bExtrapolate);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetSourcePlayPosition(uint in_PlayingID, out int out_puPosition) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetSourcePlayPosition__SWIG_1(in_PlayingID, out out_puPosition);\n\n\t\treturn ret;\n\t}\n\n\tpublic static void StopAll(ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAkSoundEnginePINVOKE.CSharp_StopAll__SWIG_0(tempin_gameObjectID);\n\n\t\t}\n\t}\n\n\tpublic static void StopAll() {\n\t\tAkSoundEnginePINVOKE.CSharp_StopAll__SWIG_1();\n\n\t}\n\n\tpublic static void StopPlayingID(uint in_playingID, int in_uTransitionDuration, AkCurveInterpolation in_eFadeCurve) {\n\t\tAkSoundEnginePINVOKE.CSharp_StopPlayingID__SWIG_0(in_playingID, in_uTransitionDuration, (int)in_eFadeCurve);\n\n\t}\n\n\tpublic static void StopPlayingID(uint in_playingID, int in_uTransitionDuration) {\n\t\tAkSoundEnginePINVOKE.CSharp_StopPlayingID__SWIG_1(in_playingID, in_uTransitionDuration);\n\n\t}\n\n\tpublic static void StopPlayingID(uint in_playingID) {\n\t\tAkSoundEnginePINVOKE.CSharp_StopPlayingID__SWIG_2(in_playingID);\n\n\t}\n\n\tpublic static AKRESULT RegisterGameObj(ComponentBind.Entity in_gameObjectID, uint in_uListenerMask) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_RegisterGameObj__SWIG_0(tempin_gameObjectID, in_uListenerMask);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT RegisterGameObj(ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_RegisterGameObj__SWIG_1(tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT RegisterGameObj(ComponentBind.Entity in_gameObjectID, string in_pszObjName, uint in_uListenerMask) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_RegisterGameObj__SWIG_2(tempin_gameObjectID, in_pszObjName, in_uListenerMask);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT RegisterGameObj(ComponentBind.Entity in_gameObjectID, string in_pszObjName) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_RegisterGameObj__SWIG_3(tempin_gameObjectID, in_pszObjName);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT UnregisterGameObj(ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_UnregisterGameObj(tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT UnregisterAllGameObj() {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_UnregisterAllGameObj();\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetMultiplePositions(ComponentBind.Entity in_GameObjectID, AkPositionArray in_pPositions, ushort in_NumPositions, MultiPositionType in_eMultiPositionType) {\n\t\t\n\t\t\t\tuint tempin_GameObjectID;\n\t\t\t\tif ( in_GameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = getGameObjectID(in_GameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_GameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_GameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetMultiplePositions__SWIG_0(tempin_GameObjectID, in_pPositions.m_Buffer, in_NumPositions, (int)in_eMultiPositionType);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetMultiplePositions(ComponentBind.Entity in_GameObjectID, AkPositionArray in_pPositions, ushort in_NumPositions) {\n\t\t\n\t\t\t\tuint tempin_GameObjectID;\n\t\t\t\tif ( in_GameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = getGameObjectID(in_GameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_GameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_GameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetMultiplePositions__SWIG_1(tempin_GameObjectID, in_pPositions.m_Buffer, in_NumPositions);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetAttenuationScalingFactor(ComponentBind.Entity in_GameObjectID, float in_fAttenuationScalingFactor) {\n\t\t\n\t\t\t\tuint tempin_GameObjectID;\n\t\t\t\tif ( in_GameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = getGameObjectID(in_GameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_GameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_GameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetAttenuationScalingFactor(tempin_GameObjectID, in_fAttenuationScalingFactor);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetListenerScalingFactor(uint in_uListenerIndex, float in_fListenerScalingFactor) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetListenerScalingFactor(in_uListenerIndex, in_fListenerScalingFactor);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT ClearBanks() {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ClearBanks();\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetBankLoadIOSettings(float in_fThroughput, char in_priority) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetBankLoadIOSettings(in_fThroughput, in_priority);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT LoadBank(string in_pszString, int in_memPoolId, out uint out_bankID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_LoadBank__SWIG_0(in_pszString, in_memPoolId, out out_bankID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT LoadBank(uint in_bankID, int in_memPoolId) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_LoadBank__SWIG_1(in_bankID, in_memPoolId);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT LoadBank(IntPtr in_pInMemoryBankPtr, uint in_uInMemoryBankSize, out uint out_bankID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_LoadBank__SWIG_2(in_pInMemoryBankPtr, in_uInMemoryBankSize, out out_bankID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT LoadBank(string in_pszString, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie, int in_memPoolId, out uint out_bankID) {\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_LoadBank__SWIG_3(in_pszString, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), in_memPoolId, out out_bankID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT LoadBank(uint in_bankID, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie, int in_memPoolId) {\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_LoadBank__SWIG_4(in_bankID, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), in_memPoolId);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT LoadBank(IntPtr in_pInMemoryBankPtr, uint in_uInMemoryBankSize, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie, out uint out_bankID) {\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_LoadBank__SWIG_5(in_pInMemoryBankPtr, in_uInMemoryBankSize, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), out out_bankID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT UnloadBank(string in_pszString, IntPtr in_pInMemoryBankPtr, out int out_pMemPoolId) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_UnloadBank__SWIG_0(in_pszString, in_pInMemoryBankPtr, out out_pMemPoolId);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT UnloadBank(string in_pszString, IntPtr in_pInMemoryBankPtr) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_UnloadBank__SWIG_1(in_pszString, in_pInMemoryBankPtr);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT UnloadBank(uint in_bankID, IntPtr in_pInMemoryBankPtr, out int out_pMemPoolId) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_UnloadBank__SWIG_4(in_bankID, in_pInMemoryBankPtr, out out_pMemPoolId);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT UnloadBank(uint in_bankID, IntPtr in_pInMemoryBankPtr) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_UnloadBank__SWIG_5(in_bankID, in_pInMemoryBankPtr);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT UnloadBank(string in_pszString, IntPtr in_pInMemoryBankPtr, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie) {\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_UnloadBank__SWIG_6(in_pszString, in_pInMemoryBankPtr, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT UnloadBank(uint in_bankID, IntPtr in_pInMemoryBankPtr, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie) {\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_UnloadBank__SWIG_8(in_bankID, in_pInMemoryBankPtr, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static void CancelBankCallbackCookie(object in_pCookie) {\n\t\tAkSoundEnginePINVOKE.CSharp_CancelBankCallbackCookie((IntPtr)in_pCookie.GetHashCode());\n\n\t}\n\n\tpublic static AKRESULT PrepareBank(PreparationType in_PreparationType, string in_pszString, AkBankContent in_uFlags) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareBank__SWIG_0((int)in_PreparationType, in_pszString, (int)in_uFlags);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT PrepareBank(PreparationType in_PreparationType, string in_pszString) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareBank__SWIG_1((int)in_PreparationType, in_pszString);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT PrepareBank(PreparationType in_PreparationType, uint in_bankID, AkBankContent in_uFlags) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareBank__SWIG_4((int)in_PreparationType, in_bankID, (int)in_uFlags);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT PrepareBank(PreparationType in_PreparationType, uint in_bankID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareBank__SWIG_5((int)in_PreparationType, in_bankID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT PrepareBank(PreparationType in_PreparationType, string in_pszString, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie, AkBankContent in_uFlags) {\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareBank__SWIG_6((int)in_PreparationType, in_pszString, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), (int)in_uFlags);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT PrepareBank(PreparationType in_PreparationType, string in_pszString, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie) {\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareBank__SWIG_7((int)in_PreparationType, in_pszString, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT PrepareBank(PreparationType in_PreparationType, uint in_bankID, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie, AkBankContent in_uFlags) {\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareBank__SWIG_10((int)in_PreparationType, in_bankID, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode(), (int)in_uFlags);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT PrepareBank(PreparationType in_PreparationType, uint in_bankID, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie) {\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareBank__SWIG_11((int)in_PreparationType, in_bankID, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ClearPreparedEvents() {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ClearPreparedEvents();\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT PrepareEvent(PreparationType in_PreparationType, string [] in_ppszString, uint in_uNumEvent) {\n\t\t\t\t\t\t\n\t\t\t\t//Find the required size\n\t\t\t\tint size = 0;\n\t\t\t\tforeach(string s in in_ppszString)\n\t\t\t\t\t\tsize += s.Length + 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\tint sizeofChar = 2;\t\t//Unicode\n\t\t\t\tIntPtr pMem = Marshal.AllocHGlobal(size * sizeofChar);\n\t\t\t\t\n\t\t\t\t//Write the length of array\n\t\t\t\tMarshal.WriteInt16(pMem, (short)in_ppszString.Length);\n\t\t\t\tIntPtr pCurrent = (IntPtr)(pMem.ToInt64() + sizeofChar);\n\t\t\t\t\n\t\t\t\t//Copy the strings one after the other.\n\t\t\t\tforeach(string s in in_ppszString)\n\t\t\t\t{\n\t\t\t\t\t\tMarshal.Copy(s.ToCharArray(), 0, pCurrent, s.Length);\n\t\t\t\t\t\tpCurrent = (IntPtr)(pCurrent.ToInt64() + sizeofChar * s.Length);\n\t\t\t\t\t\tMarshal.WriteInt16(pCurrent, 0);\t\t//Null-terminated string\n\t\t\t\t\t\tpCurrent = (IntPtr)(pCurrent.ToInt64() + sizeofChar);\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\ttry {\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareEvent__SWIG_0((int)in_PreparationType, pMem, in_uNumEvent);\n\n\t\t\treturn ret;\n\t\t} finally {\n\t\tMarshal.FreeHGlobal(pMem);\n\t\t}\n\t}\n\n\tpublic static AKRESULT PrepareEvent(PreparationType in_PreparationType, uint[] in_pEventID, uint in_uNumEvent) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareEvent__SWIG_1((int)in_PreparationType, in_pEventID, in_uNumEvent);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT PrepareEvent(PreparationType in_PreparationType, string [] in_ppszString, uint in_uNumEvent, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie) {\n\t\t\t\t\t\t\n\t\t\t\t//Find the required size\n\t\t\t\tint size = 0;\n\t\t\t\tforeach(string s in in_ppszString)\n\t\t\t\t\t\tsize += s.Length + 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\tint sizeofChar = 2;\t\t//Unicode\n\t\t\t\tIntPtr pMem = Marshal.AllocHGlobal(size * sizeofChar);\n\t\t\t\t\n\t\t\t\t//Write the length of array\n\t\t\t\tMarshal.WriteInt16(pMem, (short)in_ppszString.Length);\n\t\t\t\tIntPtr pCurrent = (IntPtr)(pMem.ToInt64() + sizeofChar);\n\t\t\t\t\n\t\t\t\t//Copy the strings one after the other.\n\t\t\t\tforeach(string s in in_ppszString)\n\t\t\t\t{\n\t\t\t\t\t\tMarshal.Copy(s.ToCharArray(), 0, pCurrent, s.Length);\n\t\t\t\t\t\tpCurrent = (IntPtr)(pCurrent.ToInt64() + sizeofChar * s.Length);\n\t\t\t\t\t\tMarshal.WriteInt16(pCurrent, 0);\t\t//Null-terminated string\n\t\t\t\t\t\tpCurrent = (IntPtr)(pCurrent.ToInt64() + sizeofChar);\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\ttry {\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareEvent__SWIG_2((int)in_PreparationType, pMem, in_uNumEvent, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());\n\n\t\t\treturn ret;\n\t\t} finally {\n\t\tMarshal.FreeHGlobal(pMem);\n\t\t}\n\t}\n\n\tpublic static AKRESULT PrepareEvent(PreparationType in_PreparationType, uint[] in_pEventID, uint in_uNumEvent, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie) {\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareEvent__SWIG_3((int)in_PreparationType, in_pEventID, in_uNumEvent, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT PrepareGameSyncs(PreparationType in_PreparationType, AkGroupType in_eGameSyncType, string in_pszGroupName, string [] in_ppszGameSyncName, uint in_uNumGameSyncs) {\n\t\t\t\t\t\t\n\t\t\t\t//Find the required size\n\t\t\t\tint size = 0;\n\t\t\t\tforeach(string s in in_ppszGameSyncName)\n\t\t\t\t\t\tsize += s.Length + 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\tint sizeofChar = 2;\t\t//Unicode\n\t\t\t\tIntPtr pMem = Marshal.AllocHGlobal(size * sizeofChar);\n\t\t\t\t\n\t\t\t\t//Write the length of array\n\t\t\t\tMarshal.WriteInt16(pMem, (short)in_ppszGameSyncName.Length);\n\t\t\t\tIntPtr pCurrent = (IntPtr)(pMem.ToInt64() + sizeofChar);\n\t\t\t\t\n\t\t\t\t//Copy the strings one after the other.\n\t\t\t\tforeach(string s in in_ppszGameSyncName)\n\t\t\t\t{\n\t\t\t\t\t\tMarshal.Copy(s.ToCharArray(), 0, pCurrent, s.Length);\n\t\t\t\t\t\tpCurrent = (IntPtr)(pCurrent.ToInt64() + sizeofChar * s.Length);\n\t\t\t\t\t\tMarshal.WriteInt16(pCurrent, 0);\t\t//Null-terminated string\n\t\t\t\t\t\tpCurrent = (IntPtr)(pCurrent.ToInt64() + sizeofChar);\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\ttry {\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareGameSyncs__SWIG_0((int)in_PreparationType, (int)in_eGameSyncType, in_pszGroupName, pMem, in_uNumGameSyncs);\n\n\t\t\treturn ret;\n\t\t} finally {\n\t\tMarshal.FreeHGlobal(pMem);\n\t\t}\n\t}\n\n\tpublic static AKRESULT PrepareGameSyncs(PreparationType in_PreparationType, AkGroupType in_eGameSyncType, uint in_GroupID, uint[] in_paGameSyncID, uint in_uNumGameSyncs) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareGameSyncs__SWIG_1((int)in_PreparationType, (int)in_eGameSyncType, in_GroupID, in_paGameSyncID, in_uNumGameSyncs);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT PrepareGameSyncs(PreparationType in_PreparationType, AkGroupType in_eGameSyncType, string in_pszGroupName, string [] in_ppszGameSyncName, uint in_uNumGameSyncs, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie) {\n\t\t\t\t\t\t\n\t\t\t\t//Find the required size\n\t\t\t\tint size = 0;\n\t\t\t\tforeach(string s in in_ppszGameSyncName)\n\t\t\t\t\t\tsize += s.Length + 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\tint sizeofChar = 2;\t\t//Unicode\n\t\t\t\tIntPtr pMem = Marshal.AllocHGlobal(size * sizeofChar);\n\t\t\t\t\n\t\t\t\t//Write the length of array\n\t\t\t\tMarshal.WriteInt16(pMem, (short)in_ppszGameSyncName.Length);\n\t\t\t\tIntPtr pCurrent = (IntPtr)(pMem.ToInt64() + sizeofChar);\n\t\t\t\t\n\t\t\t\t//Copy the strings one after the other.\n\t\t\t\tforeach(string s in in_ppszGameSyncName)\n\t\t\t\t{\n\t\t\t\t\t\tMarshal.Copy(s.ToCharArray(), 0, pCurrent, s.Length);\n\t\t\t\t\t\tpCurrent = (IntPtr)(pCurrent.ToInt64() + sizeofChar * s.Length);\n\t\t\t\t\t\tMarshal.WriteInt16(pCurrent, 0);\t\t//Null-terminated string\n\t\t\t\t\t\tpCurrent = (IntPtr)(pCurrent.ToInt64() + sizeofChar);\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\ttry {\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareGameSyncs__SWIG_2((int)in_PreparationType, (int)in_eGameSyncType, in_pszGroupName, pMem, in_uNumGameSyncs, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());\n\n\t\t\treturn ret;\n\t\t} finally {\n\t\tMarshal.FreeHGlobal(pMem);\n\t\t}\n\t}\n\n\tpublic static AKRESULT PrepareGameSyncs(PreparationType in_PreparationType, AkGroupType in_eGameSyncType, uint in_GroupID, uint[] in_paGameSyncID, uint in_uNumGameSyncs, AkCallbackManager.BankCallback in_pfnBankCallback, object in_pCookie) {\n\t\t\t\tin_pCookie = new AkCallbackManager.BankCallbackPackage(in_pfnBankCallback, in_pCookie);\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PrepareGameSyncs__SWIG_3((int)in_PreparationType, (int)in_eGameSyncType, in_GroupID, in_paGameSyncID, in_uNumGameSyncs, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetActiveListeners(ComponentBind.Entity in_GameObjectID, uint in_uListenerMask) {\n\t\t\n\t\t\t\tuint tempin_GameObjectID;\n\t\t\t\tif ( in_GameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = getGameObjectID(in_GameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_GameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_GameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetActiveListeners(tempin_GameObjectID, in_uListenerMask);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetListenerSpatialization(uint in_uIndex, bool in_bSpatialized, AkSpeakerVolumes in_pVolumeOffsets) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetListenerSpatialization__SWIG_0(in_uIndex, in_bSpatialized, AkSpeakerVolumes.getCPtr(in_pVolumeOffsets));\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetListenerSpatialization(uint in_uIndex, bool in_bSpatialized) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetListenerSpatialization__SWIG_1(in_uIndex, in_bSpatialized);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetListenerPipeline(uint in_uIndex, bool in_bAudio, bool in_bMotion) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetListenerPipeline(in_uIndex, in_bAudio, in_bMotion);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetRTPCValue(uint in_rtpcID, float in_value, ComponentBind.Entity in_gameObjectID, int in_uValueChangeDuration, AkCurveInterpolation in_eFadeCurve) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetRTPCValue__SWIG_0(in_rtpcID, in_value, tempin_gameObjectID, in_uValueChangeDuration, (int)in_eFadeCurve);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetRTPCValue(uint in_rtpcID, float in_value, ComponentBind.Entity in_gameObjectID, int in_uValueChangeDuration) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetRTPCValue__SWIG_1(in_rtpcID, in_value, tempin_gameObjectID, in_uValueChangeDuration);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetRTPCValue(uint in_rtpcID, float in_value, uint in_gameObjectID)\n\t{\n\t\treturn (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetRTPCValue__SWIG_2(in_rtpcID, in_value, in_gameObjectID);\n\t}\n\n\tpublic static AKRESULT SetRTPCValue(uint in_rtpcID, float in_value, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetRTPCValue__SWIG_2(in_rtpcID, in_value, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetRTPCValue(uint in_rtpcID, float in_value) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetRTPCValue__SWIG_3(in_rtpcID, in_value);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetRTPCValue(string in_pszRtpcName, float in_value, ComponentBind.Entity in_gameObjectID, int in_uValueChangeDuration, AkCurveInterpolation in_eFadeCurve) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetRTPCValue__SWIG_4(in_pszRtpcName, in_value, tempin_gameObjectID, in_uValueChangeDuration, (int)in_eFadeCurve);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetRTPCValue(string in_pszRtpcName, float in_value, ComponentBind.Entity in_gameObjectID, int in_uValueChangeDuration) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetRTPCValue__SWIG_5(in_pszRtpcName, in_value, tempin_gameObjectID, in_uValueChangeDuration);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetRTPCValue(string in_pszRtpcName, float in_value, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetRTPCValue__SWIG_6(in_pszRtpcName, in_value, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetRTPCValue(string in_pszRtpcName, float in_value) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetRTPCValue__SWIG_7(in_pszRtpcName, in_value);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT ResetRTPCValue(uint in_rtpcID, ComponentBind.Entity in_gameObjectID, int in_uValueChangeDuration, AkCurveInterpolation in_eFadeCurve) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ResetRTPCValue__SWIG_0(in_rtpcID, tempin_gameObjectID, in_uValueChangeDuration, (int)in_eFadeCurve);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ResetRTPCValue(uint in_rtpcID, ComponentBind.Entity in_gameObjectID, int in_uValueChangeDuration) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ResetRTPCValue__SWIG_1(in_rtpcID, tempin_gameObjectID, in_uValueChangeDuration);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ResetRTPCValue(uint in_rtpcID, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ResetRTPCValue__SWIG_2(in_rtpcID, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ResetRTPCValue(uint in_rtpcID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ResetRTPCValue__SWIG_3(in_rtpcID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT ResetRTPCValue(string in_pszRtpcName, ComponentBind.Entity in_gameObjectID, int in_uValueChangeDuration, AkCurveInterpolation in_eFadeCurve) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ResetRTPCValue__SWIG_4(in_pszRtpcName, tempin_gameObjectID, in_uValueChangeDuration, (int)in_eFadeCurve);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ResetRTPCValue(string in_pszRtpcName, ComponentBind.Entity in_gameObjectID, int in_uValueChangeDuration) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ResetRTPCValue__SWIG_5(in_pszRtpcName, tempin_gameObjectID, in_uValueChangeDuration);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ResetRTPCValue(string in_pszRtpcName, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ResetRTPCValue__SWIG_6(in_pszRtpcName, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT ResetRTPCValue(string in_pszRtpcName) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ResetRTPCValue__SWIG_7(in_pszRtpcName);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetSwitch(uint in_switchGroup, uint in_switchState, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetSwitch__SWIG_0(in_switchGroup, in_switchState, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetSwitch(string in_pszSwitchGroup, string in_pszSwitchState, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetSwitch__SWIG_1(in_pszSwitchGroup, in_pszSwitchState, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT PostTrigger(uint in_triggerID, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PostTrigger__SWIG_0(in_triggerID, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT PostTrigger(string in_pszTrigger, ComponentBind.Entity in_gameObjectID) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PostTrigger__SWIG_1(in_pszTrigger, tempin_gameObjectID);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetState(uint in_stateGroup, uint in_state) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetState__SWIG_0(in_stateGroup, in_state);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetState(string in_pszStateGroup, string in_pszState) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetState__SWIG_1(in_pszStateGroup, in_pszState);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetGameObjectAuxSendValues(ComponentBind.Entity in_gameObjectID, AkAuxSendArray in_aAuxSendValues, uint in_uNumSendValues) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetGameObjectAuxSendValues(tempin_gameObjectID, in_aAuxSendValues.m_Buffer, in_uNumSendValues);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetGameObjectOutputBusVolume(ComponentBind.Entity in_gameObjectID, float in_fControlValue) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetGameObjectOutputBusVolume(tempin_gameObjectID, in_fControlValue);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetActorMixerEffect(uint in_audioNodeID, uint in_uFXIndex, uint in_shareSetID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetActorMixerEffect(in_audioNodeID, in_uFXIndex, in_shareSetID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetBusEffect(uint in_audioNodeID, uint in_uFXIndex, uint in_shareSetID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetBusEffect__SWIG_0(in_audioNodeID, in_uFXIndex, in_shareSetID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetBusEffect(string in_pszBusName, uint in_uFXIndex, uint in_shareSetID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetBusEffect__SWIG_1(in_pszBusName, in_uFXIndex, in_shareSetID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetObjectObstructionAndOcclusion(ComponentBind.Entity in_ObjectID, uint in_uListener, float in_fObstructionLevel, float in_fOcclusionLevel) {\n\t\t\n\t\t\t\tuint tempin_ObjectID;\n\t\t\t\tif ( in_ObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_ObjectID = getGameObjectID(in_ObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_ObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_ObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_ObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetObjectObstructionAndOcclusion(tempin_ObjectID, in_uListener, in_fObstructionLevel, in_fOcclusionLevel);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT StartOutputCapture(string in_CaptureFileName) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_StartOutputCapture(in_CaptureFileName);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT StopOutputCapture() {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_StopOutputCapture();\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT StartProfilerCapture(string in_CaptureFileName) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_StartProfilerCapture(in_CaptureFileName);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT StopProfilerCapture() {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_StopProfilerCapture();\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT AddSecondaryOutput(uint in_iOutputID, AkSinkType in_iDeviceType, uint in_uListenerMask) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_AddSecondaryOutput(in_iOutputID, (int)in_iDeviceType, in_uListenerMask);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT RemoveSecondaryOutput(uint in_iOutputID, AkSinkType in_iDeviceType) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_RemoveSecondaryOutput(in_iOutputID, (int)in_iDeviceType);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetSecondaryOutputVolume(uint in_iOutputID, AkSinkType in_iDeviceType, float in_fVolume) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetSecondaryOutputVolume(in_iOutputID, (int)in_iDeviceType, in_fVolume);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetPlayingSegmentInfo(uint in_PlayingID, AkSegmentInfo out_segmentInfo, bool in_bExtrapolate) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetPlayingSegmentInfo__SWIG_0(in_PlayingID, AkSegmentInfo.getCPtr(out_segmentInfo), in_bExtrapolate);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetPlayingSegmentInfo(uint in_PlayingID, AkSegmentInfo out_segmentInfo) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetPlayingSegmentInfo__SWIG_1(in_PlayingID, AkSegmentInfo.getCPtr(out_segmentInfo));\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT PostCode(ErrorCode in_eError, ErrorLevel in_eErrorLevel) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PostCode((int)in_eError, (int)in_eErrorLevel);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT PostString(string in_pszError, ErrorLevel in_eErrorLevel) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_PostString__SWIG_0(in_pszError, (int)in_eErrorLevel);\n\n\t\treturn ret;\n\t}\n\n\tpublic static int GetTimeStamp() {\n\t\tint ret = AkSoundEnginePINVOKE.CSharp_GetTimeStamp();\n\n\t\treturn ret;\n\t}\n\n\tpublic static uint ResolveDialogueEvent(uint in_eventID, uint[] in_aArgumentValues, uint in_uNumArguments, uint in_idSequence) {\n\t\tuint ret = AkSoundEnginePINVOKE.CSharp_ResolveDialogueEvent__SWIG_0(in_eventID, in_aArgumentValues, in_uNumArguments, in_idSequence);\n\n\t\treturn ret;\n\t}\n\n\tpublic static uint ResolveDialogueEvent(uint in_eventID, uint[] in_aArgumentValues, uint in_uNumArguments) {\n\t\tuint ret = AkSoundEnginePINVOKE.CSharp_ResolveDialogueEvent__SWIG_1(in_eventID, in_aArgumentValues, in_uNumArguments);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetPosition(ComponentBind.Entity in_GameObjectID, AkSoundPosition out_rPosition) {\n\t\t\n\t\t\t\tuint tempin_GameObjectID;\n\t\t\t\tif ( in_GameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = getGameObjectID(in_GameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_GameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_GameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetPosition(tempin_GameObjectID, AkSoundPosition.getCPtr(out_rPosition));\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT GetActiveListeners(ComponentBind.Entity in_GameObjectID, out uint out_ruListenerMask) {\n\t\t\n\t\t\t\tuint tempin_GameObjectID;\n\t\t\t\tif ( in_GameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = getGameObjectID(in_GameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_GameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_GameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetActiveListeners(tempin_GameObjectID, out out_ruListenerMask);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT GetListenerPosition(uint in_uIndex, AkListenerPosition out_rPosition) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetListenerPosition(in_uIndex, AkListenerPosition.getCPtr(out_rPosition));\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetListenerSpatialization(uint in_uIndex, out int out_rbSpatialized, AkSpeakerVolumes out_rVolumeOffsets) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetListenerSpatialization(in_uIndex, out out_rbSpatialized, AkSpeakerVolumes.getCPtr(out_rVolumeOffsets));\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetRTPCValue(uint in_rtpcID, ComponentBind.Entity in_gameObjectID, out float out_rValue, ref int io_rValueType) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetRTPCValue__SWIG_0(in_rtpcID, tempin_gameObjectID, out out_rValue, ref io_rValueType);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT GetRTPCValue(string in_pszRtpcName, ComponentBind.Entity in_gameObjectID, out float out_rValue, ref int io_rValueType) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetRTPCValue__SWIG_1(in_pszRtpcName, tempin_gameObjectID, out out_rValue, ref io_rValueType);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT GetSwitch(uint in_switchGroup, ComponentBind.Entity in_gameObjectID, out uint out_rSwitchState) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetSwitch__SWIG_0(in_switchGroup, tempin_gameObjectID, out out_rSwitchState);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT GetSwitch(string in_pstrSwitchGroupName, ComponentBind.Entity in_GameObj, out uint out_rSwitchState) {\n\t\t\n\t\t\t\tuint tempin_GameObj;\n\t\t\t\tif ( in_GameObj != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObj = getGameObjectID(in_GameObj);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_GameObj.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_GameObj.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObj = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetSwitch__SWIG_1(in_pstrSwitchGroupName, tempin_GameObj, out out_rSwitchState);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT GetState(uint in_stateGroup, out uint out_rState) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetState__SWIG_0(in_stateGroup, out out_rState);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetState(string in_pstrStateGroupName, out uint out_rState) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetState__SWIG_1(in_pstrStateGroupName, out out_rState);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetGameObjectAuxSendValues(ComponentBind.Entity in_gameObjectID, AkAuxSendArray out_paAuxSendValues, ref uint io_ruNumSendValues) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetGameObjectAuxSendValues(tempin_gameObjectID, out_paAuxSendValues.m_Buffer, ref io_ruNumSendValues);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT GetGameObjectDryLevelValue(ComponentBind.Entity in_gameObjectID, out float out_rfControlValue) {\n\t\t\n\t\t\t\tuint tempin_gameObjectID;\n\t\t\t\tif ( in_gameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = getGameObjectID(in_gameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_gameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_gameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_gameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetGameObjectDryLevelValue(tempin_gameObjectID, out out_rfControlValue);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT GetObjectObstructionAndOcclusion(ComponentBind.Entity in_ObjectID, uint in_uListener, out float out_rfObstructionLevel, out float out_rfOcclusionLevel) {\n\t\t\n\t\t\t\tuint tempin_ObjectID;\n\t\t\t\tif ( in_ObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_ObjectID = getGameObjectID(in_ObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_ObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_ObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_ObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetObjectObstructionAndOcclusion(tempin_ObjectID, in_uListener, out out_rfObstructionLevel, out out_rfOcclusionLevel);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT QueryAudioObjectIDs(uint in_eventID, ref uint io_ruNumItems, AkObjectInfo out_aObjectInfos) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_QueryAudioObjectIDs__SWIG_0(in_eventID, ref io_ruNumItems, AkObjectInfo.getCPtr(out_aObjectInfos));\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT QueryAudioObjectIDs(string in_pszEventName, ref uint io_ruNumItems, AkObjectInfo out_aObjectInfos) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_QueryAudioObjectIDs__SWIG_1(in_pszEventName, ref io_ruNumItems, AkObjectInfo.getCPtr(out_aObjectInfos));\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetPositioningInfo(uint in_ObjectID, AkPositioningInfo out_rPositioningInfo) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetPositioningInfo(in_ObjectID, AkPositioningInfo.getCPtr(out_rPositioningInfo));\n\n\t\treturn ret;\n\t}\n\n\tpublic static bool GetIsGameObjectActive(ComponentBind.Entity in_GameObjId) {\n\t\t\n\t\t\t\tuint tempin_GameObjId;\n\t\t\t\tif ( in_GameObjId != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjId = getGameObjectID(in_GameObjId);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_GameObjId.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_GameObjId.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjId = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tbool ret = AkSoundEnginePINVOKE.CSharp_GetIsGameObjectActive(tempin_GameObjId);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static float GetMaxRadius(ComponentBind.Entity in_GameObjId) {\n\t\t\n\t\t\t\tuint tempin_GameObjId;\n\t\t\t\tif ( in_GameObjId != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjId = getGameObjectID(in_GameObjId);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_GameObjId.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_GameObjId.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjId = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tfloat ret = AkSoundEnginePINVOKE.CSharp_GetMaxRadius(tempin_GameObjId);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static uint GetEventIDFromPlayingID(uint in_playingID) {\n\t\tuint ret = AkSoundEnginePINVOKE.CSharp_GetEventIDFromPlayingID(in_playingID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static uint GetGameObjectFromPlayingID(uint in_playingID) { return (uint)AkSoundEnginePINVOKE.CSharp_GetGameObjectFromPlayingID(in_playingID); }\n\n\tpublic static AKRESULT GetPlayingIDsFromGameObject(ComponentBind.Entity in_GameObjId, ref uint io_ruNumIDs, uint[] out_aPlayingIDs) {\n\t\t\n\t\t\t\tuint tempin_GameObjId;\n\t\t\t\tif ( in_GameObjId != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjId = getGameObjectID(in_GameObjId);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_GameObjId.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_GameObjId.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjId = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetPlayingIDsFromGameObject(tempin_GameObjId, ref io_ruNumIDs, out_aPlayingIDs);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT GetCustomPropertyValue(uint in_ObjectID, uint in_uPropID, out int out_iValue) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetCustomPropertyValue__SWIG_0(in_ObjectID, in_uPropID, out out_iValue);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT GetCustomPropertyValue(uint in_ObjectID, uint in_uPropID, out float out_fValue) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetCustomPropertyValue__SWIG_1(in_ObjectID, in_uPropID, out out_fValue);\n\n\t\treturn ret;\n\t}\n\n\tpublic static void AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER(ref uint io_uChannelMask) {\n\t\tAkSoundEnginePINVOKE.CSharp_AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER(ref io_uChannelMask);\n\n\t}\n\n\tpublic static void AK_SPEAKER_SETUP_FIX_SIDE_TO_REAR(ref uint io_uChannelMask) {\n\t\tAkSoundEnginePINVOKE.CSharp_AK_SPEAKER_SETUP_FIX_SIDE_TO_REAR(ref io_uChannelMask);\n\n\t}\n\n\tpublic static void AK_SPEAKER_SETUP_CONVERT_TO_SUPPORTED(ref uint io_uChannelMask) {\n\t\tAkSoundEnginePINVOKE.CSharp_AK_SPEAKER_SETUP_CONVERT_TO_SUPPORTED(ref io_uChannelMask);\n\n\t}\n\n\tpublic static uint ChannelMaskToNumChannels(uint in_uChannelMask) {\n\t\tuint ret = AkSoundEnginePINVOKE.CSharp_ChannelMaskToNumChannels(in_uChannelMask);\n\n\t\treturn ret;\n\t}\n\n\tpublic static uint ChannelMaskFromNumChannels(uint in_uNumChannels) {\n\t\tuint ret = AkSoundEnginePINVOKE.CSharp_ChannelMaskFromNumChannels(in_uNumChannels);\n\n\t\treturn ret;\n\t}\n\n\tpublic static uint ChannelIndexToDisplayIndex(AkChannelOrdering in_eOrdering, uint in_uChannelMask, uint in_uChannelIdx) {\n\t\tuint ret = AkSoundEnginePINVOKE.CSharp_ChannelIndexToDisplayIndex((int)in_eOrdering, in_uChannelMask, in_uChannelIdx);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT AddPlayerMotionDevice(byte in_iPlayerID, uint in_iCompanyID, uint in_iDeviceID, IntPtr in_pDevice) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_AddPlayerMotionDevice__SWIG_0(in_iPlayerID, in_iCompanyID, in_iDeviceID, in_pDevice);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT AddPlayerMotionDevice(byte in_iPlayerID, uint in_iCompanyID, uint in_iDeviceID) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_AddPlayerMotionDevice__SWIG_1(in_iPlayerID, in_iCompanyID, in_iDeviceID);\n\n\t\treturn ret;\n\t}\n\n\tpublic static void RemovePlayerMotionDevice(byte in_iPlayerID, uint in_iCompanyID, uint in_iDeviceID) {\n\t\tAkSoundEnginePINVOKE.CSharp_RemovePlayerMotionDevice(in_iPlayerID, in_iCompanyID, in_iDeviceID);\n\n\t}\n\n\tpublic static void SetPlayerListener(byte in_iPlayerID, byte in_iListener) {\n\t\tAkSoundEnginePINVOKE.CSharp_SetPlayerListener(in_iPlayerID, in_iListener);\n\n\t}\n\n\tpublic static void SetPlayerVolume(byte in_iPlayerID, float in_fVolume) {\n\t\tAkSoundEnginePINVOKE.CSharp_SetPlayerVolume(in_iPlayerID, in_fVolume);\n\n\t}\n\n\tpublic static void Term() {\n\t\tAkSoundEnginePINVOKE.CSharp_Term();\n\n\t}\n\n\tpublic static AKRESULT Init(AkMemSettings in_pMemSettings, AkStreamMgrSettings in_pStmSettings, AkDeviceSettings in_pDefaultDeviceSettings, AkInitSettings in_pSettings, AkPlatformInitSettings in_pPlatformSettings, AkMusicSettings in_pMusicSettings) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_Init(AkMemSettings.getCPtr(in_pMemSettings), AkStreamMgrSettings.getCPtr(in_pStmSettings), AkDeviceSettings.getCPtr(in_pDefaultDeviceSettings), AkInitSettings.getCPtr(in_pSettings), AkPlatformInitSettings.getCPtr(in_pPlatformSettings), AkMusicSettings.getCPtr(in_pMusicSettings));\n\n\t\treturn ret;\n\t}\n\n\tpublic static void GetDefaultStreamSettings(AkStreamMgrSettings out_settings) {\n\t\tAkSoundEnginePINVOKE.CSharp_GetDefaultStreamSettings(AkStreamMgrSettings.getCPtr(out_settings));\n\n\t}\n\n\tpublic static void GetDefaultDeviceSettings(AkDeviceSettings out_settings) {\n\t\tAkSoundEnginePINVOKE.CSharp_GetDefaultDeviceSettings(AkDeviceSettings.getCPtr(out_settings));\n\n\t}\n\n\tpublic static void GetDefaultMusicSettings(AkMusicSettings out_settings) {\n\t\tAkSoundEnginePINVOKE.CSharp_GetDefaultMusicSettings(AkMusicSettings.getCPtr(out_settings));\n\n\t}\n\n\tpublic static void GetDefaultInitSettings(AkInitSettings out_settings) {\n\t\tAkSoundEnginePINVOKE.CSharp_GetDefaultInitSettings(AkInitSettings.getCPtr(out_settings));\n\n\t}\n\n\tpublic static void GetDefaultPlatformInitSettings(AkPlatformInitSettings out_settings) {\n\t\tAkSoundEnginePINVOKE.CSharp_GetDefaultPlatformInitSettings(AkPlatformInitSettings.getCPtr(out_settings));\n\n\t}\n\n\tpublic static AKRESULT SetBasePath(string in_pszBasePath) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetBasePath(in_pszBasePath);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetBankPath(string in_pszBankPath) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetBankPath(in_pszBankPath);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetAudioSrcPath(string in_pszAudioSrcPath) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetAudioSrcPath(in_pszAudioSrcPath);\n\n\t\treturn ret;\n\t}\n\n\tpublic static AKRESULT SetCurrentLanguage(string in_pszAudioSrcPath) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetCurrentLanguage(in_pszAudioSrcPath);\n\n\t\treturn ret;\n\t}\n\n\tprivate static uint getGameObjectID(ComponentBind.Entity entity)\n\t{\n\t\t\treturn (uint)(entity.GUID & 0xffffffff);\n\t}\n\n\tpublic static AKRESULT SetObjectPosition(ComponentBind.Entity in_GameObjectID, float PosX, float PosY, float PosZ, float OrientationX, float OrientationY, float OrientationZ) {\n\t\t\n\t\t\t\tuint tempin_GameObjectID;\n\t\t\t\tif ( in_GameObjectID != null )\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = getGameObjectID(in_GameObjectID);\n\t\t\t\t\t\t// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.\n\t\t\t\t\t\tif (in_GameObjectID.Get<AkGameObject>() == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tin_GameObjectID.Add(new AkGameObject());\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\ttempin_GameObjectID = unchecked((uint)-1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t{\n\t\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetObjectPosition(tempin_GameObjectID, PosX, PosY, PosZ, OrientationX, OrientationY, OrientationZ);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tpublic static AKRESULT SetListenerPosition(float FrontX, float FrontY, float FrontZ, float TopX, float TopY, float TopZ, float PosX, float PosY, float PosZ, uint in_ulListenerIndex) {\n\t\tAKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetListenerPosition(FrontX, FrontY, FrontZ, TopX, TopY, TopZ, PosX, PosY, PosZ, in_ulListenerIndex);\n\n\t\treturn ret;\n\t}\n\n\tpublic static bool IsInitialized() {\n\t\tbool ret = AkSoundEnginePINVOKE.CSharp_IsInitialized();\n\n\t\treturn ret;\n\t}\n\n\tpublic static uint PostEvent(uint e)\n\t{\n\t\treturn AkSoundEngine.PostEvent(e, AkSoundEngine.DefaultGameObject);\n\t}\n\n\tpublic static uint RegisterTemp(Vector3 pos, AkAuxSendArray aux)\n\t{\n\t\tuint id = (uint)(ComponentBind.Entity.CurrentGUID & 0xffffffff);\n\t\tComponentBind.Entity.CurrentGUID++;\n\t\tAkSoundEnginePINVOKE.CSharp_RegisterGameObj__SWIG_1(id);\n\t\tAkSoundEnginePINVOKE.CSharp_SetObjectPosition(id, pos.X, pos.Y, pos.Z, 0.0f, 0.0f, 1.0f);\n\t\tAkSoundEnginePINVOKE.CSharp_SetGameObjectAuxSendValues(id, aux.m_Buffer, aux.m_Count);\n\t\treturn id;\n\t}\n\n\tpublic static void UnregisterTemp(uint id)\n\t{\n\t\tAkSoundEnginePINVOKE.CSharp_UnregisterGameObj(id);\n\t}\n\n\tpublic static uint PostEvent(uint e, Vector3 pos, AkAuxSendArray aux)\n\t{\n\t\tuint id = (uint)(ComponentBind.Entity.CurrentGUID & 0xffffffff);\n\t\tComponentBind.Entity.CurrentGUID++;\n\t\tAkSoundEnginePINVOKE.CSharp_RegisterGameObj__SWIG_1(id);\n\t\tAkSoundEnginePINVOKE.CSharp_SetObjectPosition(id, pos.X, pos.Y, pos.Z, 0.0f, 0.0f, 1.0f);\n\t\tAkSoundEnginePINVOKE.CSharp_SetGameObjectAuxSendValues(id, aux.m_Buffer, aux.m_Count);\n\t\tuint result = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_5(e, id);\n\t\tAkSoundEnginePINVOKE.CSharp_UnregisterGameObj(id);\n\t\treturn result;\n\t}\n\n\tpublic const int _WIN32_WINNT = 0x0602;\n\tpublic const int AK_SIMD_ALIGNMENT = 16;\n\tpublic const int AK_BUFFER_ALIGNMENT = 16;\n\tpublic const int AK_XAUDIO2_FLAGS = 0;\n\tpublic const int AK_MAX_PATH = 260;\n\tpublic const int AK_BANK_PLATFORM_DATA_ALIGNMENT = (16);\n\tpublic const int NULL = 0;\n\tpublic const uint AK_INVALID_PLUGINID = 0xFFFFFFFF;\n\tpublic const uint AK_INVALID_GAME_OBJECT = 0xFFFFFFFF;\n\tpublic const uint AK_INVALID_UNIQUE_ID = 0;\n\tpublic const uint AK_INVALID_RTPC_ID = AK_INVALID_UNIQUE_ID;\n\tpublic const uint AK_INVALID_LISTENER_INDEX = 0xFFFFFFFF;\n\tpublic const uint AK_INVALID_PLAYING_ID = AK_INVALID_UNIQUE_ID;\n\tpublic const uint AK_DEFAULT_SWITCH_STATE = 0;\n\tpublic const uint AK_INVALID_POOL_ID = 0xFFFFFFFF;\n\tpublic const int AK_DEFAULT_POOL_ID = -1;\n\tpublic const uint AK_INVALID_ENV_ID = AK_INVALID_UNIQUE_ID;\n\tpublic const uint AK_INVALID_FILE_ID = 0xFFFFFFFF;\n\tpublic const uint AK_INVALID_DEVICE_ID = 0xFFFFFFFF;\n\tpublic const uint AK_INVALID_BANK_ID = AK_INVALID_UNIQUE_ID;\n\tpublic const uint AK_FALLBACK_ARGUMENTVALUE_ID = 0;\n\tpublic const uint AK_DEFAULT_PRIORITY = 50;\n\tpublic const uint AK_MIN_PRIORITY = 0;\n\tpublic const uint AK_MAX_PRIORITY = 100;\n\tpublic const uint AK_DEFAULT_BANK_IO_PRIORITY = AK_DEFAULT_PRIORITY;\n\tpublic const double AK_DEFAULT_BANK_THROUGHPUT = 1*1024*1024/1000.0;\n\tpublic const int AKCURVEINTERPOLATION_NUM_STORAGE_BIT = 5;\n\tpublic const int AK_MAX_AUX_PER_OBJ = (4);\n\tpublic const int AK_MAX_AUX_SUPPORTED = ((4) +4);\n\tpublic const int AK_NUM_LISTENERS = (8);\n\tpublic const int AK_MAX_LANGUAGE_NAME_SIZE = (32);\n\tpublic const int AKCOMPANYID_AUDIOKINETIC = (0);\n\tpublic const int AKCOMPANYID_AUDIOKINETIC_EXTERNAL = (1);\n\tpublic const int AKCOMPANYID_MCDSP = (256);\n\tpublic const int AKCOMPANYID_WAVEARTS = (257);\n\tpublic const int AKCOMPANYID_PHONETICARTS = (258);\n\tpublic const int AKCOMPANYID_IZOTOPE = (259);\n\tpublic const int AKCOMPANYID_GENAUDIO = (260);\n\tpublic const int AKCOMPANYID_CRANKCASEAUDIO = (261);\n\tpublic const int AKCODECID_BANK = (0);\n\tpublic const int AKCODECID_PCM = (1);\n\tpublic const int AKCODECID_ADPCM = (2);\n\tpublic const int AKCODECID_XMA = (3);\n\tpublic const int AKCODECID_VORBIS = (4);\n\tpublic const int AKCODECID_WIIADPCM = (5);\n\tpublic const int AKCODECID_PCMEX = (7);\n\tpublic const int AKCODECID_EXTERNAL_SOURCE = (8);\n\tpublic const int AKCODECID_XWMA = (9);\n\tpublic const int AKCODECID_AAC = (10);\n\tpublic const int AKCODECID_FILE_PACKAGE = (11);\n\tpublic const int AKCODECID_ATRAC9 = (12);\n\tpublic const int AKCODECID_VAG = (13);\n\tpublic const int AKCODECID_PROFILERCAPTURE = (14);\n\tpublic const int AKCODECID_ANALYSISFILE = (15);\n\tpublic const int AK_WAVE_FORMAT_VAG = 0xFFFB;\n\tpublic const int AK_WAVE_FORMAT_AT9 = 0xFFFC;\n\tpublic const int AK_WAVE_FORMAT_VORBIS = 0xFFFF;\n\tpublic const int AK_WAVE_FORMAT_AAC = 0xAAC0;\n\tpublic const int PANNER_NUM_STORAGE_BITS = 2;\n\tpublic const int POSSOURCE_NUM_STORAGE_BITS = 2;\n\tpublic const int AK_OS_STRUCT_ALIGN = 4;\n\tpublic const int AK_COMM_DEFAULT_DISCOVERY_PORT = 24024;\n\tpublic const int AK_SPEAKER_FRONT_LEFT = 0x1;\n\tpublic const int AK_SPEAKER_FRONT_RIGHT = 0x2;\n\tpublic const int AK_SPEAKER_FRONT_CENTER = 0x4;\n\tpublic const int AK_SPEAKER_LOW_FREQUENCY = 0x8;\n\tpublic const int AK_SPEAKER_BACK_LEFT = 0x10;\n\tpublic const int AK_SPEAKER_BACK_RIGHT = 0x20;\n\tpublic const int AK_SPEAKER_BACK_CENTER = 0x100;\n\tpublic const int AK_SPEAKER_SIDE_LEFT = 0x200;\n\tpublic const int AK_SPEAKER_SIDE_RIGHT = 0x400;\n\tpublic const int AK_CHANNEL_MASK_PARENT = 0x0;\n\tpublic const int AK_CHANNEL_MASK_DETECT = 0x0;\n\tpublic const int AK_CHANNEL_MASK_INVALID = 0x0;\n\tpublic const int AK_SPEAKER_SETUP_MONO = 0x4;\n\tpublic const int AK_SPEAKER_SETUP_0POINT1 = 0x8;\n\tpublic const int AK_SPEAKER_SETUP_1POINT1 = (0x4|0x8);\n\tpublic const int AK_SPEAKER_SETUP_STEREO = (0x1|0x2);\n\tpublic const int AK_SPEAKER_SETUP_2POINT1 = ((0x1|0x2)|0x8);\n\tpublic const int AK_SPEAKER_SETUP_3STEREO = ((0x1|0x2)|0x4);\n\tpublic const int AK_SPEAKER_SETUP_3POINT1 = (((0x1|0x2)|0x4)|0x8);\n\tpublic const int AK_SPEAKER_SETUP_4 = ((0x1|0x2)|0x10|0x20);\n\tpublic const int AK_SPEAKER_SETUP_4POINT1 = (((0x1|0x2)|0x10|0x20)|0x8);\n\tpublic const int AK_SPEAKER_SETUP_5 = (((0x1|0x2)|0x10|0x20)|0x4);\n\tpublic const int AK_SPEAKER_SETUP_5POINT1 = ((((0x1|0x2)|0x10|0x20)|0x4)|0x8);\n\tpublic const int AK_SPEAKER_SETUP_6 = (((0x1|0x2)|0x10|0x20)|0x200|0x400);\n\tpublic const int AK_SPEAKER_SETUP_6POINT1 = ((((0x1|0x2)|0x10|0x20)|0x200|0x400)|0x8);\n\tpublic const int AK_SPEAKER_SETUP_7 = ((((0x1|0x2)|0x10|0x20)|0x200|0x400)|0x4);\n\tpublic const int AK_SPEAKER_SETUP_7POINT1 = (((((0x1|0x2)|0x10|0x20)|0x200|0x400)|0x4)|0x8);\n\tpublic const int AK_SPEAKER_SETUP_SURROUND = ((0x1|0x2)|0x100);\n\tpublic const int AK_SPEAKER_SETUP_DPL2 = (((0x1|0x2)|0x10|0x20));\n\tpublic const int AK_SPEAKER_SETUP_0_1 = (0x8);\n\tpublic const int AK_SPEAKER_SETUP_1_0 = (0x1);\n\tpublic const int AK_SPEAKER_SETUP_1_1 = (0x1|0x8);\n\tpublic const int AK_SPEAKER_SETUP_1_0_CENTER = (0x4);\n\tpublic const int AK_SPEAKER_SETUP_1_1_CENTER = (0x4|0x8);\n\tpublic const int AK_SPEAKER_SETUP_2_0 = (0x1|0x2);\n\tpublic const int AK_SPEAKER_SETUP_2_1 = (0x1|0x2|0x8);\n\tpublic const int AK_SPEAKER_SETUP_3_0 = (0x1|0x2|0x4);\n\tpublic const int AK_SPEAKER_SETUP_3_1 = ((0x1|0x2|0x4)|0x8);\n\tpublic const int AK_SPEAKER_SETUP_FRONT = ((0x1|0x2|0x4));\n\tpublic const int AK_SPEAKER_SETUP_REAR = (0x10|0x20);\n\tpublic const int AK_SPEAKER_SETUP_SIDE = (0x200|0x400);\n\tpublic const int AK_SPEAKER_SETUP_4_0 = ((0x1|0x2)|(0x10|0x20));\n\tpublic const int AK_SPEAKER_SETUP_4_1 = (((0x1|0x2)|(0x10|0x20))|0x8);\n\tpublic const int AK_SPEAKER_SETUP_5_0 = (((0x1|0x2)|(0x10|0x20))|0x4);\n\tpublic const int AK_SPEAKER_SETUP_5_1 = ((((0x1|0x2)|(0x10|0x20))|0x4)|0x8);\n\tpublic const int AK_SPEAKER_SETUP_4_0_SIDE = ((0x1|0x2)|(0x200|0x400));\n\tpublic const int AK_SPEAKER_SETUP_4_1_SIDE = (((0x1|0x2)|(0x200|0x400))|0x8);\n\tpublic const int AK_SPEAKER_SETUP_5_0_SIDE = (((0x1|0x2)|(0x200|0x400))|0x4);\n\tpublic const int AK_SPEAKER_SETUP_5_1_SIDE = ((((0x1|0x2)|(0x200|0x400))|0x4)|0x8);\n\tpublic const int AK_SPEAKER_SETUP_6_0 = (((0x1|0x2)|(0x10|0x20))|(0x200|0x400));\n\tpublic const int AK_SPEAKER_SETUP_6_1 = ((((0x1|0x2)|(0x10|0x20))|(0x200|0x400))|0x8);\n\tpublic const int AK_SPEAKER_SETUP_7_0 = ((((0x1|0x2)|(0x10|0x20))|0x4)|(0x200|0x400));\n\tpublic const int AK_SPEAKER_SETUP_7_1 = (((((0x1|0x2)|(0x10|0x20))|0x4)|(0x200|0x400))|0x8);\n}"
  },
  {
    "path": "Wwise/Generated/Windows/AkSoundQuality_Windows.cs",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\npublic enum AkSoundQuality {\n  AkSoundQuality_High,\n  AkSoundQuality_Low\n}\n"
  },
  {
    "path": "Wwise/Generated/Windows/AkSpeakerVolumes_Windows.cs",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkSpeakerVolumes : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkSpeakerVolumes(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkSpeakerVolumes obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkSpeakerVolumes() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkSpeakerVolumes(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public float fFrontLeft {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fFrontLeft_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fFrontLeft_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public float fFrontRight {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fFrontRight_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fFrontRight_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public float fCenter {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fCenter_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fCenter_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public float fRearLeft {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fRearLeft_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fRearLeft_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public float fRearRight {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fRearRight_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fRearRight_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public float fSideLeft {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fSideLeft_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fSideLeft_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public float fSideRight {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fSideRight_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fSideRight_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public float fLfe {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fLfe_set(swigCPtr, value);\n    } \n    get {\n      float ret = AkSoundEnginePINVOKE.CSharp_AkSpeakerVolumes_fLfe_get(swigCPtr);\n      return ret;\n    } \n  }\n\n  public AkSpeakerVolumes() : this(AkSoundEnginePINVOKE.CSharp_new_AkSpeakerVolumes(), true) {\n\n  }\n\n}\n"
  },
  {
    "path": "Wwise/Generated/Windows/AkThreadProperties_Windows.cs",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (http://www.swig.org).\n * Version 2.0.11\n *\n * Do not make changes to this file unless you know what you are doing--modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n\nusing System;\nusing System.Runtime.InteropServices;\n\npublic class AkThreadProperties : IDisposable {\n  private HandleRef swigCPtr;\n  protected bool swigCMemOwn;\n\n  internal AkThreadProperties(IntPtr cPtr, bool cMemoryOwn) {\n    swigCMemOwn = cMemoryOwn;\n    swigCPtr = new HandleRef(this, cPtr);\n  }\n\n  internal static HandleRef getCPtr(AkThreadProperties obj) {\n    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;\n  }\n\n  ~AkThreadProperties() {\n    Dispose();\n  }\n\n  public virtual void Dispose() {\n    lock(this) {\n      if (swigCPtr.Handle != IntPtr.Zero) {\n        if (swigCMemOwn) {\n          swigCMemOwn = false;\n          AkSoundEnginePINVOKE.CSharp_delete_AkThreadProperties(swigCPtr);\n        }\n        swigCPtr = new HandleRef(null, IntPtr.Zero);\n      }\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  public int nPriority {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkThreadProperties_nPriority_set(swigCPtr, value);\n\n    } \n    get {\n      int ret = AkSoundEnginePINVOKE.CSharp_AkThreadProperties_nPriority_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint dwAffinityMask {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkThreadProperties_dwAffinityMask_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkThreadProperties_dwAffinityMask_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public uint uStackSize {\n    set {\n      AkSoundEnginePINVOKE.CSharp_AkThreadProperties_uStackSize_set(swigCPtr, value);\n\n    } \n    get {\n      uint ret = AkSoundEnginePINVOKE.CSharp_AkThreadProperties_uStackSize_get(swigCPtr);\n\n      return ret;\n    } \n  }\n\n  public AkThreadProperties() : this(AkSoundEnginePINVOKE.CSharp_new_AkThreadProperties(), true) {\n\n  }\n\n}\n"
  },
  {
    "path": "Wwise/Handwritten/AkAuxSendArray.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing System;\nusing System.Collections;\nusing System.Runtime.InteropServices;\n\npublic class AkAuxSendArray\n{\n\tpublic AkAuxSendArray(uint in_Count)\n\t{\n        m_Buffer = Marshal.AllocHGlobal((int)in_Count * (sizeof(uint) + sizeof(float)));\n        m_Current = m_Buffer;\n        m_MaxCount = in_Count;\n        m_Count = 0;\n    }\n\n\t~AkAuxSendArray()\n\t{\n        Marshal.FreeHGlobal(m_Buffer);\n        m_Buffer = IntPtr.Zero;\n\t}\n\t\n\tpublic void Reset()\n\t{\n\t\tm_Current = m_Buffer;        \n        m_Count = 0;\n\t}\n\t\n    public void Add(uint in_EnvID, float in_fValue)\n    {\n        if (m_Count >= m_MaxCount)\n            throw new IndexOutOfRangeException(\"Out of range access in AkAuxSendArray\");\n                          \n        Marshal.WriteInt32(m_Current, (int)in_EnvID);\n        m_Current = (IntPtr)(m_Current.ToInt64() + sizeof(uint));\t\t\n        Marshal.WriteInt32(m_Current, BitConverter.ToInt32(BitConverter.GetBytes(in_fValue), 0));  //Marshal doesn't do floats.  So copy the bytes themselves.  Grrr.\n        m_Current = (IntPtr)(m_Current.ToInt64() + sizeof(float));\n        m_Count++;\n    }\n\n    public IntPtr m_Buffer;    \n    private IntPtr m_Current;\n    private uint m_MaxCount;\n    public uint m_Count;\n};\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Handwritten/AkCallbackManager.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.IO;\nusing Microsoft.Xna.Framework;\nusing ComponentBind;\n\n#if UNITY_EDITOR\nusing UnityEditor;\n#endif\n\n#pragma warning disable 0618 // Marshal.SizeOf() => Marshal.SizeOf<T>() (.NET 4.5.1)\n\nstatic public class AkCallbackManager\n{\n    public delegate void EventCallback(object in_cookie, AkCallbackType in_type, object in_info);\n    public delegate void MonitoringCallback(ErrorCode in_errorCode, ErrorLevel in_errorLevel, uint in_playingID, IntPtr in_gameObjID, string in_msg);\n    public delegate void BankCallback(uint in_bankID, IntPtr in_InMemoryBankPtr, AKRESULT in_eLoadResult, uint in_memPoolId, object in_Cookie);\n\n    public class EventCallbackPackage\n    {\n        public EventCallbackPackage(EventCallback in_cb, object in_cookie)\n        {\n            m_Callback = in_cb;\n            m_Cookie = in_cookie;\n\n            m_mapEventCallbacks[GetHashCode()] = this;          \n\t\t}\n        public object m_Cookie;\n        public EventCallback m_Callback;\n    };\n\n    public class BankCallbackPackage\n    {\n        public BankCallbackPackage(BankCallback in_cb, object in_cookie)\n        {\n            m_Callback = in_cb;\n            m_Cookie = in_cookie;\n\n            m_mapBankCallbacks[GetHashCode()] = this;\n        }\n        public object m_Cookie;\n        public BankCallback m_Callback;\n    };\n\n#if UNITY_PS4 || UNITY_XBOXONE || UNITY_STANDALONE_WIN || (UNITY_EDITOR_WIN && UNITY_STANDALONE_WIN)\n    [StructLayout(LayoutKind.Sequential, Pack=4)]\n#else\n    [StructLayout(LayoutKind.Sequential)]\n#endif\n    struct AkCommonCallback\n    {\n        public IntPtr pPackage;     //The C# CallbackPackage to return to C#\n        public IntPtr pNext;        //The next callback\n\t\tpublic AkCallbackType eType;    //The type of structure following\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct AkEventCallbackInfo\n    {\n        public IntPtr pCookie;      ///< User data, passed to PostEvent()\n        public IntPtr gameObjID;    ///< Game object ID\n        public uint playingID;      ///< Playing ID of Event, returned by PostEvent()\n        public uint eventID;        ///< Unique ID of Event, passed to PostEvent()\n    }\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct AkDynamicSequenceItemCallbackInfo\n    {\n        public IntPtr pCookie;      ///< User data, passed to PostEvent()\n        public IntPtr gameObjID;    ///< Game object ID\n        public uint playingID;      ///< Playing ID of Event, returned by PostEvent()\n        public uint audioNodeID;    ///< Audio Node ID of finished item\n        public IntPtr pCustomInfo;  ///< Custom info passed to the DynamicSequence::Open function\n    };\n\n    [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]\n    public struct AkMarkerCallbackInfo\n    {\n        public IntPtr pCookie;      ///< User data, passed to PostEvent()\n        public IntPtr gameObjID;    ///< Game object ID\n        public uint playingID;      ///< Playing ID of Event, returned by PostEvent()\n        public uint eventID;        ///< Unique ID of Event, passed to PostEvent()\n        public uint uIdentifier;        ///< Cue point identifier\n        public uint uPosition;          ///< Position in the cue point (unit: sample frames)        \n        //[MarshalAs(UnmanagedType.LPStr)] TODO, figure out why strings aren't marshaled properly\n        public string strLabel;         ///< Label of the marker, read from the file\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct AkDurationCallbackInfo\n    {\n        public IntPtr pCookie;      ///< User data, passed to PostEvent()\n        public IntPtr gameObjID;    ///< Game object ID\n        public uint playingID;      ///< Playing ID of Event, returned by PostEvent()\n        public uint eventID;        ///< Unique ID of Event, passed to PostEvent()\n        public float fDuration;             ///< Duration of the sound (unit: milliseconds )\n        public float fEstimatedDuration;    ///< Estimated duration of the sound depending on source settings such as pitch. (unit: milliseconds )\n        public uint audioNodeID;            ///< Audio Node ID of playing item\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public class AkMusicSyncCallbackInfoBase\n    {\n        public IntPtr pCookie;      ///< User data, passed to PostEvent()\n        public IntPtr gameObjID;    ///< Game object ID\n        public uint playingID;          ///< Playing ID of Event, returned by PostEvent()\n        public AkCallbackType musicSyncType;    ///< Would be either AK_MusicSyncEntry, AK_MusicSyncBeat, AK_MusicSyncBar, AK_MusicSyncExit, AK_MusicSyncGrid, AK_MusicSyncPoint or AK_MusicSyncUserCue.\n        public float fBeatDuration;         ///< Beat Duration in seconds.\n        public float fBarDuration;          ///< Bar Duration in seconds.\n        public float fGridDuration;         ///< Grid duration in seconds.\n        public float fGridOffset;           ///< Grid offset in seconds.\n    }\n\n    [StructLayout(LayoutKind.Sequential)]\n    public class AkMusicSyncCallbackInfo : AkMusicSyncCallbackInfoBase\n    {\n        public string pszUserCueName;       ///< Cue name\n    };\n\n    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]\n    public struct AkMonitoringMsg\n    {\n        public ErrorCode errorCode;\n        public ErrorLevel errorLevel;\n        public uint playingID;\n        public IntPtr gameObjID;\n        //[MarshalAs(UnmanagedType.LPWStr)] TODO, figure out why strings aren't marshaled properly\n        public string msg;\n    }\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct AkBankInfo\n    {\n        public uint bankID;\n        public IntPtr inMemoryBankPtr;\n        public AKRESULT eLoadResult;\n        public uint memPoolId;\n    }\n\n    static Dictionary<int, EventCallbackPackage> m_mapEventCallbacks = new Dictionary<int, EventCallbackPackage>();\n    static Dictionary<int, BankCallbackPackage> m_mapBankCallbacks = new Dictionary<int, BankCallbackPackage>();\n    static IntPtr m_pNotifMem;\n    static private MonitoringCallback m_MonitoringCB;\n\n#if UNITY_IOS && ! UNITY_EDITOR\n    public delegate AKRESULT AudioInterruptionCallback(int in_bEnterInterruption, AKRESULT in_prevEngineStepResult, object in_Cookie);\n    private static AudioInterruptionCallbackPackage ms_interruptCallbackPkg = new AudioInterruptionCallbackPackage(AkGlobalSoundEngineInitializer.AppInterruptCallback, AkGlobalSoundEngineInitializer.ms_interruptCallbackCookie);\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct AkAudioInterruptionInfo\n    {\n        public Int32 bEnterInterruption;\n        public AKRESULT prevEngineStepResult;\n    }\n\n    public class AudioInterruptionCallbackPackage\n    {\n        public AudioInterruptionCallbackPackage(AudioInterruptionCallback in_cb, object in_cookie)\n        {\n            m_Callback = in_cb;\n            m_Cookie = in_cookie;\n        }\n        public object m_Cookie;\n        public AudioInterruptionCallback m_Callback;\n    };\n    \n#endif // #if UNITY_IOS && ! UNITY_EDITOR\n\n    static public AKRESULT Init()\n    {\n        //Allocate 1k for notifications that will happen during one game frame.\n        m_pNotifMem = Marshal.AllocHGlobal(1024);\n        return AkCallbackSerializer.Init(m_pNotifMem, 1024);\n    }\n\n    static public void Term()\n    {\n        AkCallbackSerializer.Term();\n        Marshal.FreeHGlobal(m_pNotifMem);\n        m_pNotifMem = IntPtr.Zero;\n    }\n\n    static public void SetMonitoringCallback(ErrorLevel in_Level, MonitoringCallback in_CB)\n    {\n        AkCallbackSerializer.SetLocalOutput((uint)in_Level);\n        m_MonitoringCB = in_CB;\n    }\n\n\tstatic public void PostCallbacks()\n    {\n        if ( ! AkSoundEngine.IsInitialized() )\n        {\n            return;\n        }\n\n\n        if (m_pNotifMem == IntPtr.Zero)\n            return;\n        \n        IntPtr pData = AkCallbackSerializer.Lock();\n        if (pData == IntPtr.Zero)\n        {\n            AkCallbackSerializer.Unlock();\n            return;\n        }\n        \n        AkCommonCallback commonCB;\n        commonCB.eType = 0;\n        commonCB.pPackage = IntPtr.Zero;\n        commonCB.pNext = IntPtr.Zero;\n\n        IntPtr callbacksStart = pData;\n\n        commonCB = new AkCommonCallback();\n        \n        commonCB.pPackage = Marshal.ReadIntPtr(pData);\n        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n        commonCB.pNext = Marshal.ReadIntPtr(pData);\n        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n        \n        commonCB.eType = (AkCallbackType)Marshal.ReadInt32(pData);\n        GotoEndOfCurrentStructMember_EnumType<AkCallbackType>(ref pData);\n        \n        EventCallbackPackage eventPkg = null;\n        BankCallbackPackage bankPkg = null;\n\n        if ( ! SafeExtractCallbackPackages(commonCB, out eventPkg, out bankPkg) )\n        {\n            AkCallbackSerializer.Unlock();\n            return;\n        }\n\n        pData = callbacksStart;\n\n        do\n        {\n            // Point to start of the next callback after commonCallback.\n            pData = (IntPtr)(pData.ToInt64() + Marshal.SizeOf(typeof(AkCommonCallback)));\n            \n            if (commonCB.eType == AkCallbackType.AK_Monitoring)\n            {\n                AkMonitoringMsg monitorMsg = new AkMonitoringMsg();\n\n                monitorMsg.errorCode = (ErrorCode)Marshal.ReadInt32(pData);\n                GotoEndOfCurrentStructMember_EnumType<ErrorCode>(ref pData);\n\n                monitorMsg.errorLevel = (ErrorLevel)Marshal.ReadInt32(pData);\n                GotoEndOfCurrentStructMember_EnumType<ErrorLevel>(ref pData);\n\n                monitorMsg.playingID = (uint)Marshal.ReadInt32(pData);\n                GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                monitorMsg.gameObjID = (IntPtr)Marshal.ReadIntPtr(pData);\n                GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n                // C# implementation of the struct does not include the tail string member, so as we skip sizes, pData is now at the actual start of the string member.\n                monitorMsg.msg = SafeMarshalString(pData);\n                if (m_MonitoringCB != null)\n                {\n                    m_MonitoringCB(monitorMsg.errorCode, monitorMsg.errorLevel, monitorMsg.playingID, monitorMsg.gameObjID, monitorMsg.msg);\n                }\n                else\n                {\n#if UNITY_EDITOR\n                    string msg = \"Wwise: \" + monitorMsg.msg;\n                    if (monitorMsg.gameObjID != (IntPtr)AkSoundEngine.AK_INVALID_GAME_OBJECT)\n                    {\n                        GameObject obj = EditorUtility.InstanceIDToObject((int)monitorMsg.gameObjID) as GameObject;                 \n                        string name = obj != null ? obj.ToString() : monitorMsg.gameObjID.ToString();\n                        msg += \"(Object: \" + name + \")\";\n                    }\n                                                    \n                    if (monitorMsg.errorLevel == ErrorLevel.ErrorLevel_Error)\n                        Debug.LogError(msg);\n                    else\n                        Debug.Log(msg);\n#endif\n                }\n            }\n            else if (commonCB.eType == AkCallbackType.AK_Bank)\n            {\n                AkBankInfo bankCB = new AkBankInfo();\n                \n                bankCB.bankID = (uint)Marshal.ReadInt32(pData);\n                GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n                \n                bankCB.inMemoryBankPtr = Marshal.ReadIntPtr(pData);\n                GotoEndOfCurrentStructMember_ValueType<IntPtr>(ref pData);\n\n                bankCB.eLoadResult = (AKRESULT)Marshal.ReadInt32(pData);\n                GotoEndOfCurrentStructMember_EnumType<AKRESULT>(ref pData);\n\n                bankCB.memPoolId = (uint)Marshal.ReadInt32(pData);\n                GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                if ( bankPkg != null )\n                {\n                    bankPkg.m_Callback(bankCB.bankID, bankCB.inMemoryBankPtr, bankCB.eLoadResult, bankCB.memPoolId, bankPkg.m_Cookie);\n                }\n\n            }\n#if UNITY_IOS && ! UNITY_EDITOR\n            else if (commonCB.eType == AkCallbackType.AK_AudioInterruption)\n            {\n                AkAudioInterruptionInfo cbInfo = new AkAudioInterruptionInfo();\n                \n                cbInfo.bEnterInterruption = Marshal.ReadInt32(pData);\n                GotoEndOfCurrentStructMember_ValueType<Int32>(ref pData);\n                \n                cbInfo.prevEngineStepResult = (AKRESULT)Marshal.ReadInt32(pData);\n                GotoEndOfCurrentStructMember_EnumType<AKRESULT>(ref pData);\n\n                ms_interruptCallbackPkg.m_Callback(cbInfo.bEnterInterruption, cbInfo.prevEngineStepResult, ms_interruptCallbackPkg.m_Cookie);\n            }\n#endif // #if UNITY_IOS && ! UNITY_EDITOR\n            else\n            {\n                //Get the other parameters                    \n                switch (commonCB.eType)\n                {\n                    case AkCallbackType.AK_EndOfEvent:\n                        AkEventCallbackInfo eventCB = new AkEventCallbackInfo();\n\n                        eventCB.pCookie = Marshal.ReadIntPtr(pData);\n                        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n                        eventCB.gameObjID = Marshal.ReadIntPtr(pData);\n                        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n                        eventCB.playingID = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        eventCB.eventID = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        eventPkg.m_Callback(eventPkg.m_Cookie, commonCB.eType, eventCB);\n                        break;\n\n                    case AkCallbackType.AK_EndOfDynamicSequenceItem:\n                        AkDynamicSequenceItemCallbackInfo dynSeqInfoCB = new AkDynamicSequenceItemCallbackInfo();\n\n                        dynSeqInfoCB.pCookie = Marshal.ReadIntPtr(pData);\n                        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n                        dynSeqInfoCB.playingID = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        dynSeqInfoCB.audioNodeID = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        dynSeqInfoCB.pCustomInfo = Marshal.ReadIntPtr(pData);\n                        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n                        eventPkg.m_Callback(eventPkg.m_Cookie, commonCB.eType, dynSeqInfoCB);\n                        break;\n\n                    case AkCallbackType.AK_Marker:\n                        AkMarkerCallbackInfo markerInfo = new AkMarkerCallbackInfo();\n\n                        markerInfo.pCookie = Marshal.ReadIntPtr(pData);\n                        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n                        markerInfo.gameObjID = Marshal.ReadIntPtr(pData);\n                        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n                        markerInfo.playingID = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        markerInfo.eventID = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        markerInfo.uIdentifier = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        markerInfo.uPosition = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        markerInfo.strLabel = SafeMarshalMarkerString(pData);\n\n                        eventPkg.m_Callback(eventPkg.m_Cookie, commonCB.eType, markerInfo);\n                        break;\n                        \n                    case AkCallbackType.AK_Duration:\n                        AkDurationCallbackInfo durInfoCB = new AkDurationCallbackInfo();\n\n                        durInfoCB.pCookie = Marshal.ReadIntPtr(pData);\n                        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n                        durInfoCB.gameObjID = Marshal.ReadIntPtr(pData);\n                        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n                        durInfoCB.playingID = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        durInfoCB.eventID = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        durInfoCB.fDuration = MarshalFloat32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<float>(ref pData);\n\n                        durInfoCB.fEstimatedDuration = MarshalFloat32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<float>(ref pData);\n\n                        durInfoCB.audioNodeID = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        eventPkg.m_Callback(eventPkg.m_Cookie, commonCB.eType, durInfoCB);\n                        break;\n\n                    case AkCallbackType.AK_MusicSyncUserCue:\n                    case AkCallbackType.AK_MusicPlayStarted:\n                    case AkCallbackType.AK_MusicSyncBar:\n                    case AkCallbackType.AK_MusicSyncBeat:\n                    case AkCallbackType.AK_MusicSyncEntry:\n                    case AkCallbackType.AK_MusicSyncExit:\n                    case AkCallbackType.AK_MusicSyncGrid:\n                    case AkCallbackType.AK_MusicSyncPoint:\n                        AkMusicSyncCallbackInfo pInfo = new AkMusicSyncCallbackInfo();\n                        \n                        pInfo.pCookie = Marshal.ReadIntPtr(pData);\n                        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n                        pInfo.gameObjID = Marshal.ReadIntPtr(pData);\n                        GotoEndOfCurrentStructMember_IntPtr(ref pData);\n\n                        pInfo.playingID = (uint)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<uint>(ref pData);\n\n                        pInfo.musicSyncType = (AkCallbackType)Marshal.ReadInt32(pData);\n                        GotoEndOfCurrentStructMember_EnumType<AkCallbackType>(ref pData);\n\n                        pInfo.fBeatDuration = MarshalFloat32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<float>(ref pData);\n\n                        pInfo.fBarDuration = MarshalFloat32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<float>(ref pData);\n\n                        pInfo.fGridDuration = MarshalFloat32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<float>(ref pData);\n\n                        pInfo.fGridOffset = MarshalFloat32(pData);\n                        GotoEndOfCurrentStructMember_ValueType<float>(ref pData);\n\n                        // WG-22334: User cues are always ANSI char*.\n                        pInfo.pszUserCueName = Marshal.PtrToStringAnsi(pData);\n\n                        eventPkg.m_Callback(eventPkg.m_Cookie, commonCB.eType, pInfo);\n                        break;\n                    default:\n                        string log = string.Format(\"WwiseUnity: PostCallbacks aborted due to error: Undefined callback type found. Callback object possiblly corrupted.\");\n                        Log.d(log);\n                        AkCallbackSerializer.Unlock();\n                        return;\n                };\n\n            }\n\n            if (commonCB.pNext == IntPtr.Zero)\n            {\n                break;\n            }\n\n            // Note: At the end of each callback case above, pData points to either end of the callback struct, or right before the tail string member of the struct. \n            pData = commonCB.pNext;\n\n            callbacksStart = pData;\n            \n            commonCB = new AkCommonCallback();\n\n            commonCB.pPackage = (IntPtr)Marshal.ReadIntPtr(pData);\n            GotoEndOfCurrentStructMember_IntPtr(ref pData);\n            \n            commonCB.pNext = (IntPtr)Marshal.ReadIntPtr(pData);\n            GotoEndOfCurrentStructMember_IntPtr(ref pData);\n            \n            commonCB.eType = (AkCallbackType)Marshal.ReadInt32(pData);\n            GotoEndOfCurrentStructMember_EnumType<AkCallbackType>(ref pData);\n                                    \n            eventPkg = null;\n            bankPkg = null;\n\n            if ( ! SafeExtractCallbackPackages(commonCB, out eventPkg, out bankPkg) )\n            {\n                AkCallbackSerializer.Unlock();\n                return;\n            }\n\n            pData = callbacksStart;\n            \n        } while (true);\n\n        AkCallbackSerializer.Unlock();\n    }\n\n    static private bool SafeExtractCallbackPackages(AkCommonCallback commonCB, out EventCallbackPackage eventPkg, out BankCallbackPackage bankPkg)\n    {\n        eventPkg = null;\n        bankPkg = null;\n        \n        // Callbacks without packages are always valid.\n        if ( commonCB.eType == AkCallbackType.AK_AudioInterruption )\n        {\n            return true;\n        }\n\n        bool isValidCallback = m_mapEventCallbacks.TryGetValue((int)commonCB.pPackage, out eventPkg);\n        if ( ! isValidCallback )\n        {\n            isValidCallback = m_mapBankCallbacks.TryGetValue((int)commonCB.pPackage, out bankPkg);\n            if ( ! isValidCallback )\n            {\n                return false;\n            }\n        }\n        \n        return true;\n    }\n    \n    static private string SafeMarshalString(IntPtr pData)\n    {\n#if UNITY_EDITOR\n    #if !UNITY_METRO\n        if (Path.DirectorySeparatorChar == '/')\n            return Marshal.PtrToStringAnsi(pData);\n        else \n            return Marshal.PtrToStringUni(pData);\n    #else\n        return Marshal.PtrToStringUni(pData);\n    #endif // #if !UNITY_METRO\n#elif UNITY_STANDALONE_WIN || UNITY_METRO\n    return Marshal.PtrToStringUni(pData);\n#else\n    return Marshal.PtrToStringAnsi(pData);\n#endif\n    }\n\n    // Temporary solution\n    static private string SafeMarshalMarkerString(IntPtr pData)\n    {\n        return Marshal.PtrToStringAnsi(pData);\n    }\n\n    static private void GotoEndOfCurrentStructMember_ValueType<T>(ref IntPtr pData)\n    {\n        pData = (IntPtr)(pData.ToInt64() + Marshal.SizeOf(typeof(T)));\n    }\n\n    static private void GotoEndOfCurrentStructMember_IntPtr(ref IntPtr pData)\n    {\n        pData = (IntPtr)(pData.ToInt64() + IntPtr.Size);\n    }\n\n    static private void GotoEndOfCurrentStructMember_EnumType<T>(ref IntPtr pData)\n    {\n        pData = (IntPtr)(pData.ToInt64() + Marshal.SizeOf(Enum.GetUnderlyingType(typeof(T))));\n    }\n\n    // WG-21968\n    static byte[] floatMarshalBuffer = new byte[4];\n    static private float MarshalFloat32(IntPtr pData)\n    {\n        floatMarshalBuffer[0] = Marshal.ReadByte(pData, 0);\n        floatMarshalBuffer[1] = Marshal.ReadByte(pData, 1);\n        floatMarshalBuffer[2] = Marshal.ReadByte(pData, 2);\n        floatMarshalBuffer[3] = Marshal.ReadByte(pData, 3);\n        float value = System.BitConverter.ToSingle(floatMarshalBuffer, 0);\n        return value;\n    }\n};\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Handwritten/AkPositionArray.cs",
    "content": "#if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n//////////////////////////////////////////////////////////////////////\n//\n// Copyright (c) 2012 Audiokinetic Inc. / All Rights Reserved\n//\n//////////////////////////////////////////////////////////////////////\n\nusing System;\nusing System.Collections;\nusing System.Runtime.InteropServices;\nusing Microsoft.Xna.Framework;\n\npublic class AkPositionArray : IDisposable\n{\n    public AkPositionArray(uint in_Count)\n    {\n        m_Buffer = Marshal.AllocHGlobal((int)in_Count * sizeof(float) * 6);\n        m_Current = m_Buffer;\n        m_MaxCount = in_Count;\n        m_Count = 0;\n    }\n\n    ~AkPositionArray()\n    {\n        Dispose();\n    }\n\n    public void Dispose()\n    {\n        if (m_Buffer != IntPtr.Zero)\n        {\n            Marshal.FreeHGlobal(m_Buffer);\n            m_Buffer = IntPtr.Zero;\n            m_MaxCount = 0;\n        }\n    }\n\n    public void Reset()\n    {\n        m_Current = m_Buffer;\n        m_Count = 0;\n    }\n\n    public void Add(Vector3 in_Pos, Vector3 in_Forward)\n    {\n        if (m_Count >= m_MaxCount)\n            throw new IndexOutOfRangeException(\"Out of range access in AkPositionArray\");\n\n        //Marshal doesn't do floats.  So copy the bytes themselves.  Grrr.\n        Marshal.WriteInt32(m_Current, BitConverter.ToInt32(BitConverter.GetBytes(in_Pos.X), 0));  \n        m_Current = (IntPtr)(m_Current.ToInt64() + sizeof(float));\n        Marshal.WriteInt32(m_Current, BitConverter.ToInt32(BitConverter.GetBytes(in_Pos.Y), 0));\n        m_Current = (IntPtr)(m_Current.ToInt64() + sizeof(float));\n        Marshal.WriteInt32(m_Current, BitConverter.ToInt32(BitConverter.GetBytes(in_Pos.Z), 0));\n        m_Current = (IntPtr)(m_Current.ToInt64() + sizeof(float));\n        Marshal.WriteInt32(m_Current, BitConverter.ToInt32(BitConverter.GetBytes(in_Forward.X), 0));\n        m_Current = (IntPtr)(m_Current.ToInt64() + sizeof(float));\n        Marshal.WriteInt32(m_Current, BitConverter.ToInt32(BitConverter.GetBytes(in_Forward.Y), 0));\n        m_Current = (IntPtr)(m_Current.ToInt64() + sizeof(float));\n        Marshal.WriteInt32(m_Current, BitConverter.ToInt32(BitConverter.GetBytes(in_Forward.Z), 0));\n        m_Current = (IntPtr)(m_Current.ToInt64() + sizeof(float));\n\n        m_Count++;\n    }\n\n    public IntPtr m_Buffer;\n    private IntPtr m_Current;\n    private uint m_MaxCount;\n    private uint m_Count;\n};\n#endif // #if ! (UNITY_DASHBOARD_WIDGET || UNITY_STANDALONE_LINUX || UNITY_WEBPLAYER || UNITY_WII || UNITY_NACL || UNITY_FLASH || UNITY_BLACKBERRY || UNITY_WP8) // Disable under unsupported platforms.\n"
  },
  {
    "path": "Wwise/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Wwise\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"Wwise\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"5e561e46-b090-4343-823b-5dec9a307fbe\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "Wwise/Wwise.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{B1452F01-704F-44CD-BAB5-2A15F8E5C2F1}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Wwise</RootNamespace>\n    <AssemblyName>Wwise</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;WINDOWS</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE;WINDOWS</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AkAuxSend.cs\" />\n    <Compile Include=\"AkAuxSendAware.cs\" />\n    <Compile Include=\"AkBankPath.cs\" />\n    <Compile Include=\"AkGameObject.cs\" />\n    <Compile Include=\"AkGameObjectTracker.cs\" />\n    <Compile Include=\"AkGlobalSoundEngineInitializer.cs\" />\n    <Compile Include=\"AkGlobalSoundEngineTerminator.cs\" />\n    <Compile Include=\"AkInMemBankLoader.cs\" />\n    <Compile Include=\"AkListener.cs\" />\n    <Compile Include=\"Generated\\Common\\AkActionOnEventType.cs\" />\n    <Compile Include=\"Generated\\Common\\AkArrayAllocatorAlignedSimd.cs\" />\n    <Compile Include=\"Generated\\Common\\AkArrayAllocatorDefault.cs\" />\n    <Compile Include=\"Generated\\Common\\AkAuxSendValue.cs\" />\n    <Compile Include=\"Generated\\Common\\AkBankContent.cs\" />\n    <Compile Include=\"Generated\\Common\\AkCallbackSerializer.cs\" />\n    <Compile Include=\"Generated\\Common\\AkCallbackType.cs\" />\n    <Compile Include=\"Generated\\Common\\AkChannelOrdering.cs\" />\n    <Compile Include=\"Generated\\Common\\AkCurveInterpolation.cs\" />\n    <Compile Include=\"Generated\\Common\\AkDeviceSettings.cs\" />\n    <Compile Include=\"Generated\\Common\\AkExternalSourceInfo.cs\" />\n    <Compile Include=\"Generated\\Common\\AkGroupType.cs\" />\n    <Compile Include=\"Generated\\Common\\AkInitSettings.cs\" />\n    <Compile Include=\"Generated\\Common\\AkListenerPosition.cs\" />\n    <Compile Include=\"Generated\\Common\\AkMemSettings.cs\" />\n    <Compile Include=\"Generated\\Common\\AkMusicPlaylistCallbackInfo.cs\" />\n    <Compile Include=\"Generated\\Common\\AkMusicSettings.cs\" />\n    <Compile Include=\"Generated\\Common\\AkNodeType.cs\" />\n    <Compile Include=\"Generated\\Common\\AkObjectInfo.cs\" />\n    <Compile Include=\"Generated\\Common\\AkOutputSettings.cs\" />\n    <Compile Include=\"Generated\\Common\\AkPannerType.cs\" />\n    <Compile Include=\"Generated\\Common\\AkPanningRule.cs\" />\n    <Compile Include=\"Generated\\Common\\AkPlaylistArray.cs\" />\n    <Compile Include=\"Generated\\Common\\AkPositioningInfo.cs\" />\n    <Compile Include=\"Generated\\Common\\AkPositionSourceType.cs\" />\n    <Compile Include=\"Generated\\Common\\AKRESULT.cs\" />\n    <Compile Include=\"Generated\\Common\\AkSegmentInfo.cs\" />\n    <Compile Include=\"Generated\\Common\\AkSoundPosition.cs\" />\n    <Compile Include=\"Generated\\Common\\AkStreamMgrSettings.cs\" />\n    <Compile Include=\"Generated\\Common\\AkVector.cs\" />\n    <Compile Include=\"Generated\\Common\\AkVolumeOffset.cs\" />\n    <Compile Include=\"Generated\\Common\\ArrayPoolDefault.cs\" />\n    <Compile Include=\"Generated\\Common\\ArrayPoolLEngineDefault.cs\" />\n    <Compile Include=\"Generated\\Common\\DynamicSequenceType.cs\" />\n    <Compile Include=\"Generated\\Common\\EnvelopePoint.cs\" />\n    <Compile Include=\"Generated\\Common\\ErrorCode.cs\" />\n    <Compile Include=\"Generated\\Common\\ErrorLevel.cs\" />\n    <Compile Include=\"Generated\\Common\\Iterator.cs\" />\n    <Compile Include=\"Generated\\Common\\MultiPositionType.cs\" />\n    <Compile Include=\"Generated\\Common\\Playlist.cs\" />\n    <Compile Include=\"Generated\\Common\\PlaylistItem.cs\" />\n    <Compile Include=\"Generated\\Common\\PreparationType.cs\" />\n    <Compile Include=\"Generated\\Common\\RTPCValue_type.cs\" />\n    <Compile Include=\"Generated\\Common\\WwiseObjectID.cs\" />\n    <Compile Include=\"Generated\\Common\\WwiseObjectIDext.cs\" />\n    <Compile Include=\"Generated\\Windows\\AkMemPoolAttributes_Windows.cs\" />\n    <Compile Include=\"Generated\\Windows\\AkPlatformInitSettings_Windows.cs\" />\n    <Compile Include=\"Generated\\Windows\\AkSinkType_Windows.cs\" />\n    <Compile Include=\"Generated\\Windows\\AkSoundEnginePINVOKE_Windows.cs\" />\n    <Compile Include=\"Generated\\Windows\\AkSoundEngine_Windows.cs\" />\n    <Compile Include=\"Generated\\Windows\\AkSoundQuality_Windows.cs\" />\n    <Compile Include=\"Generated\\Windows\\AkSpeakerVolumes_Windows.cs\" />\n    <Compile Include=\"Generated\\Windows\\AkThreadProperties_Windows.cs\" />\n    <Compile Include=\"Handwritten\\AkAuxSendArray.cs\" />\n    <Compile Include=\"Handwritten\\AkCallbackManager.cs\" />\n    <Compile Include=\"Handwritten\\AkPositionArray.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup Condition=\" '$(Configuration)' == 'Release' \">\n    <Content Include=\"AkSoundEngine_Win32_Release.dll\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n  <ItemGroup Condition=\" '$(Configuration)' == 'Debug' \">\n    <Content Include=\"AkSoundEngine_Win32_Profile.dll\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\ComponentBind\\ComponentBind.csproj\">\n      <Project>{2D0637AB-A380-4C97-A329-BF7C40C99495}</Project>\n      <Name>ComponentBind</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n    <Copy SourceFiles=\"@(Content)\" DestinationFolder=\"$(OutputPath)\" />\n  </Target>\n</Project>"
  }
]